/**
 * ldesign v0.2.14
 * (c) 2022/11/2 16:16 built by swimly
 * @license MIT
 */

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var components_configProvider_configReceiver = require('../config-provider/config-receiver.js');
var utils_mixins = require('../../utils/mixins.js');
var components_inputAdornment_props = require('./props.js');
require('vue');
require('lodash/mergeWith');
require('lodash');
require('../config-provider/context.js');
require('../../chunks/zh_CN.js');

const classPrefixMixins = components_configProvider_configReceiver.getClassPrefixMixins("input-adornment");
var _InputAdornment = utils_mixins["default"](classPrefixMixins).extend({
  name: "LInputAdornment",
  props: components_inputAdornment_props["default"],
  methods: {
    renderAddon(h, type, addon) {
      let addonNode;
      if (this.$scopedSlots[type]) addonNode = this.$scopedSlots[type](null);else if (typeof addon === "string") addonNode = addon;else if (typeof addon === "function") addonNode = addon(h);else addonNode = null;
      return addonNode ? h("span", {
        "class": `${this.componentName}__${type}`
      }, [addonNode]) : addonNode;
    }
  },
  render(h) {
    const prepend = this.renderAddon(h, "prepend", this.prepend);
    const append = this.renderAddon(h, "append", this.append);
    const defaultSlot = this.$scopedSlots.default ? this.$scopedSlots.default(null) : [null];
    const className = [this.componentName, {
      [`${this.componentName}--prepend`]: prepend,
      [`${this.componentName}--append`]: append
    }];
    if (!prepend && !append) return defaultSlot[0];
    return h("div", {
      "class": className
    }, [prepend, defaultSlot[0], append]);
  }
});

exports["default"] = _InputAdornment;
//# sourceMappingURL=input-adornment.js.map
