/**
 * ldesign v0.4.6
 * (c) 2023 ldesign
 * @license MIT
 */

import isString from 'lodash/isString';
import isNumber from 'lodash/isNumber';
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 '../config-provider/context.js';
import 'lodash/merge';
import '../_common/js/global-config/default-config.js';
import '../_common/js/global-config/locale/zh_CN.js';
import '@babel/runtime/helpers/typeof';
import '../_chunks/dep-2cb61c79.js';
import 'dayjs';

var classPrefixMixins = getClassPrefixMixins("input-adornment");
var _InputAdornment = mixins(classPrefixMixins).extend({
  name: "TInputAdornment",
  props: props,
  methods: {
    renderAddon: function renderAddon(h, type, addon) {
      var addonNode;
      var isContentNode = isString(addon) || isNumber(addon);
      if (this.$scopedSlots[type]) {
        if (this.$scopedSlots[type](null).length === 1 && this.$scopedSlots[type](null)[0].text) addonNode = h("span", {
          "class": "".concat(this.componentName, "__text")
        }, [this.$scopedSlots[type](null)]);else addonNode = this.$scopedSlots[type](null);
      } else if (typeof addon === "function") {
        addonNode = addon(h);
      } else {
        addonNode = isContentNode ? h("span", {
          "class": "".concat(this.componentName, "__text")
        }, [addon]) : addon;
      }
      return addonNode ? h("span", {
        "class": "".concat(this.componentName, "__").concat(type)
      }, [addonNode]) : addonNode;
    }
  },
  render: function render(h) {
    var prepend = this.renderAddon(h, "prepend", this.prepend);
    var append = this.renderAddon(h, "append", this.append);
    var defaultSlot = this.$scopedSlots["default"] ? this.$scopedSlots["default"](null) : [null];
    if (!prepend && !append) return defaultSlot[0];
    return h("div", {
      "class": this.componentName
    }, [prepend, defaultSlot[0], append]);
  }
});

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