'use strict';

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

var vue = require('vue');
require('../../../../utils/index.js');
require('../config/index.js');
var createNamespace = require('../../../../utils/create-namespace.js');
var search = require('../config/search.js');

"use strict";
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
  ...{
    name: "LlIconPickerSearch"
  },
  __name: "search",
  props: search.iconPickerSearchProps,
  emits: search.iconPickerSearchEmits,
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emits = __emit;
    const attrs = vue.useAttrs();
    const bem = createNamespace.createNamespace("icon-picker-search");
    const handleModal = () => emits("handleModal", true);
    const newValue = vue.computed({
      get() {
        return props.value;
      },
      set(value) {
        emits("update:value", value);
        emits("change", value);
      }
    });
    const getInputSizeCss = vue.computed(() => {
      if (props.extendSize === "small" || props.size === "small") {
        return "ant-input-affix-wrapper-sm";
      } else if (props.extendSize === "large" || props.size === "large") {
        return "ant-input-affix-wrapper-lg";
      }
      return "";
    });
    const getBtnSizeCss = vue.computed(() => {
      if (props.extendSize === "small" || props.size === "small") {
        return "ant-btn-sm";
      } else if (props.extendSize === "large" || props.size === "large") {
        return "ant-btn-lg";
      }
      return "";
    });
    return (_ctx, _cache) => {
      const _component_ll_icon = vue.resolveComponent("ll-icon");
      const _component_ll_input = vue.resolveComponent("ll-input");
      const _component_ll_button = vue.resolveComponent("ll-button");
      const _component_a_space_compact = vue.resolveComponent("a-space-compact");
      return vue.openBlock(), vue.createBlock(_component_a_space_compact, {
        block: !_ctx.showIconOnly,
        class: vue.normalizeClass(vue.unref(bem).b()),
        size: _ctx.extendSize ? _ctx.extendSize : _ctx.size
      }, {
        default: vue.withCtx(() => [
          !_ctx.showIconOnly ? (vue.openBlock(), vue.createBlock(_component_ll_input, vue.mergeProps({ key: 0 }, vue.unref(attrs), {
            value: newValue.value,
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => newValue.value = $event),
            class: [vue.unref(bem).e("input"), getInputSizeCss.value],
            readonly: props.readonly
          }), {
            suffix: vue.withCtx(() => [
              vue.createVNode(_component_ll_icon, {
                "icon-name": "icon-" + _ctx.value
              }, null, 8, ["icon-name"])
            ]),
            _: 1
            /* STABLE */
          }, 16, ["value", "class", "readonly"])) : vue.createCommentVNode("v-if", true),
          vue.createVNode(_component_ll_button, {
            disabled: vue.unref(attrs).disabled,
            class: vue.normalizeClass([vue.unref(bem).e("btn"), getBtnSizeCss.value]),
            onClick: handleModal
          }, {
            icon: vue.withCtx(() => [
              vue.createVNode(_component_ll_icon, {
                "icon-name": _ctx.showIconOnly ? "icon-" + newValue.value : "icon-select-icon"
              }, null, 8, ["icon-name"])
            ]),
            _: 1
            /* STABLE */
          }, 8, ["disabled", "class"])
        ]),
        _: 1
        /* STABLE */
      }, 8, ["block", "class", "size"]);
    };
  }
});

exports.default = _sfc_main;
//# sourceMappingURL=search.vue2.js.map
