/**
 * ldesign v0.2.2
 * (c) 2022年9月20日 swimly
 * @license MIT
 */

import _defineProperty from '@babel/runtime/helpers/defineProperty';
import props from './props.js';
import { getClassPrefixMixins } from '../config-provider/config-receiver.js';
import mixins from '../../utils/mixins.js';
import 'vue';
import 'lodash/mergeWith';
import 'lodash';
import '../config-provider/context.js';
import '../../_chunks/dep-a0f2090c.js';

var classPrefixMixins = getClassPrefixMixins("input-adornment");
var _InputAdornment = mixins(classPrefixMixins).extend({
  name: "LInputAdornment",
  props: props,
  methods: {
    renderAddon: function renderAddon(h, type, addon) {
      var 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": "".concat(this.componentName, "__").concat(type)
      }, [addonNode]) : addonNode;
    }
  },
  render: function render(h) {
    var _ref;

    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];
    var className = [this.componentName, (_ref = {}, _defineProperty(_ref, "".concat(this.componentName, "--prepend"), prepend), _defineProperty(_ref, "".concat(this.componentName, "--append"), append), _ref)];

    if (!prepend && !append) {
      return defaultSlot[0];
    }

    return h("div", {
      "class": className
    }, [prepend, defaultSlot[0], append]);
  }
});

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