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

import { getClassPrefixMixins } from '../config-provider/config-receiver.js';
import mixins from '../../utils/mixins.js';
import props from './props.js';
import 'vue';
import 'lodash/mergeWith';
import 'lodash';
import '../config-provider/context.js';
import '../../chunks/zh_CN.js';
import '../config-provider/type.js';

const classPrefixMixins = getClassPrefixMixins("input-adornment");
var _InputAdornment = mixins(classPrefixMixins).extend({
  name: "LInputAdornment",
  props,
  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]);
  }
});

export { _InputAdornment as default };
//# sourceMappingURL=input-adornment.js.map
