'use strict';

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

var vue = require('vue');
var lodashEs = require('lodash-es');
require('../../../../utils/index.js');
require('../config/index.js');
require('./api-modal.vue.js');
var createNamespace = require('../../../../utils/create-namespace.js');
var apiModal_vue_vue_type_script_setup_true_lang = require('./api-modal.vue2.js');
var clickInput = require('../config/click-input.js');

"use strict";
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
  ...{ name: "LlClickInput" },
  __name: "click-input",
  props: clickInput.clickInputProps,
  emits: clickInput.clickInputEmits,
  setup(__props, { emit: __emit }) {
    const bem = createNamespace.createNamespace("api-component");
    const props = __props;
    const emits = __emit;
    const attrs = vue.useAttrs();
    const innerValue = vue.ref(props.value);
    const open = vue.ref(false);
    const getBindValue = vue.computed(() => {
      return lodashEs.omit({ ...attrs }, ["value"]);
    });
    const handleClick = () => {
      if (attrs.disabled) return;
      open.value = true;
    };
    vue.watch(innerValue, (n) => {
      emits("update:value", n);
    });
    return (_ctx, _cache) => {
      const _component_ll_icon = vue.resolveComponent("ll-icon");
      const _component_ll_button = vue.resolveComponent("ll-button");
      const _component_ll_input = vue.resolveComponent("ll-input");
      return vue.openBlock(), vue.createElementBlock("div", null, [
        vue.createVNode(_component_ll_input, vue.mergeProps({
          value: innerValue.value,
          "onUpdate:value": _cache[0] || (_cache[0] = ($event) => innerValue.value = $event)
        }, getBindValue.value, {
          disabled: props.disabled,
          class: vue.unref(bem).m("click-input")
        }), {
          suffix: vue.withCtx(() => [
            vue.createVNode(_component_ll_button, {
              type: "link",
              disabled: props.disabled,
              onClick: handleClick
            }, {
              default: vue.withCtx(() => [
                vue.createVNode(_component_ll_icon, {
                  style: { "font-size": "16px" },
                  "icon-name": "icon-amplify2"
                })
              ]),
              _: 1
              /* STABLE */
            }, 8, ["disabled"])
          ]),
          _: 1
          /* STABLE */
        }, 16, ["value", "disabled", "class"]),
        vue.createVNode(apiModal_vue_vue_type_script_setup_true_lang.default, {
          value: innerValue.value,
          "onUpdate:value": _cache[1] || (_cache[1] = ($event) => innerValue.value = $event),
          open: open.value,
          "onUpdate:open": _cache[2] || (_cache[2] = ($event) => open.value = $event),
          type: props.type
        }, null, 8, ["value", "open", "type"])
      ]);
    };
  }
});

exports.default = _sfc_main;
//# sourceMappingURL=click-input.vue2.js.map
