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

import _defineProperty from '@babel/runtime/helpers/defineProperty';
import { defineComponent, h, createVNode } from 'vue';
import isString from 'lodash/isString';
import isNumber from 'lodash/isNumber';
import isFunction from 'lodash/isFunction';
import { usePrefixClass } from '../hooks/useConfig.js';
import { useTNodeJSX } from '../hooks/tnode.js';
import props from './props.js';
import '../config-provider/useConfig.js';
import 'lodash/cloneDeep';
import '../config-provider/context.js';
import 'lodash/mergeWith';
import 'lodash/merge';
import 'lodash/isArray';
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-e041f5b0.js';
import 'dayjs';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import '../utils/render-tnode.js';
import 'lodash/isEmpty';
import 'lodash/isObject';

var _InputAdornment = defineComponent({
  name: "TInputAdornment",
  inheritAttrs: false,
  props: props,
  setup: function setup(props2, _ref) {
    var slots = _ref.slots;
    var COMPONENT_NAME = usePrefixClass("input-adornment");
    var renderTNodeJSX = useTNodeJSX();
    var renderAddon = function renderAddon(h2, type, addon) {
      var addonNode;
      var isContentNode = isString(addon) || isNumber(addon);
      if (slots[type]) {
        addonNode = slots[type](null);
      } else if (isFunction(addon)) {
        addonNode = addon(h2);
      } else {
        addonNode = isContentNode ? createVNode("span", {
          "class": "".concat(COMPONENT_NAME.value, "__text")
        }, [addon]) : addon;
      }
      return addonNode ? createVNode("span", {
        "class": "".concat(COMPONENT_NAME.value, "__").concat(type)
      }, [addonNode]) : addonNode;
    };
    return function () {
      var _ref2;
      var prepend = renderAddon(h, "prepend", props2.prepend);
      var append = renderAddon(h, "append", props2.append);
      var defaultSlot = renderTNodeJSX("default") || [null];
      var className = [COMPONENT_NAME.value, (_ref2 = {}, _defineProperty(_ref2, "".concat(COMPONENT_NAME.value, "--prepend"), prepend), _defineProperty(_ref2, "".concat(COMPONENT_NAME.value, "--append"), append), _ref2)];
      if (!prepend && !append) return defaultSlot[0];
      return createVNode("div", {
        "class": className
      }, [prepend, defaultSlot[0], append]);
    };
  }
});

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