import { defineComponent, ref, inject, computed, watch, resolveComponent, createElementBlock, openBlock, normalizeClass, unref, createVNode, createElementVNode, withCtx, toDisplayString, createCommentVNode, createTextVNode } from 'vue';
import '../config/index.mjs';
import '../../../../utils/index.mjs';
import { createNamespace } from '../../../../utils/create-namespace.mjs';
import { batchEditingOptions, batchEditingEmits, batchEditingProps } from '../config/batch-editing.mjs';

"use strict";
var _sfc_main = /* @__PURE__ */ defineComponent({
  ...{ name: "LlBatchEditing" },
  __name: "batch-editing",
  props: batchEditingProps,
  emits: batchEditingEmits,
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emits = __emit;
    const bem = createNamespace("batch-editing");
    const type = ref("comma");
    const disabled = inject("disabled");
    const currentPlaceholder = computed(() => {
      return type.value === "comma" ? "\u683C\u5F0F: \u542F\u7528,\u53C2\u6570\u540D,\u53C2\u6570\u503C,\u7C7B\u578B,\u5FC5\u9700\u5907\u4EFD" : "\u683C\u5F0F\uFF1A\u53C2\u6570\u540D\uFF1A\u53C2\u6570\u503C";
    });
    const innerValue = ref(props.value);
    watch(innerValue, () => {
      emits("update:value", innerValue.value);
    });
    return (_ctx, _cache) => {
      const _component_ll_segmented = resolveComponent("ll-segmented");
      const _component_ll_textarea = resolveComponent("ll-textarea");
      return openBlock(), createElementBlock(
        "div",
        {
          class: normalizeClass(unref(bem).b())
        },
        [
          createVNode(_component_ll_segmented, {
            value: type.value,
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => type.value = $event),
            options: unref(batchEditingOptions)
          }, {
            label: withCtx(({ payload }) => [
              createElementVNode(
                "div",
                null,
                toDisplayString(payload.title),
                1
                /* TEXT */
              )
            ]),
            _: 1
            /* STABLE */
          }, 8, ["value", "options"]),
          createElementVNode(
            "div",
            {
              class: normalizeClass(unref(bem).e("textarea"))
            },
            [
              createVNode(_component_ll_textarea, {
                value: innerValue.value,
                "onUpdate:value": _cache[1] || (_cache[1] = ($event) => innerValue.value = $event),
                disabled: unref(disabled),
                placeholder: currentPlaceholder.value,
                autosize: { minRows: 10 },
                bordered: false
              }, null, 8, ["value", "disabled", "placeholder"]),
              type.value === "comma" ? (openBlock(), createElementBlock(
                "p",
                {
                  key: 0,
                  class: normalizeClass(unref(bem).e("textarea-tip"))
                },
                [..._cache[2] || (_cache[2] = [
                  createTextVNode(
                    " \u6570\u636E\u683C\u5F0F\u9075\u5FAA ",
                    -1
                    /* CACHED */
                  ),
                  createElementVNode(
                    "a",
                    { href: "javascript:;" },
                    "\u300A\u6807\u51C6 CSV \u89C4\u8303\u300B",
                    -1
                    /* CACHED */
                  ),
                  createTextVNode(
                    " \u5B57\u6BB5\u4E4B\u95F4\u4EE5\u82F1\u6587\u9017\u53F7( , )\u5206\u9694\uFF0C\u591A\u6761\u8BB0\u5F55\u4EE5\u6362\u884C\u5206\u9694 ",
                    -1
                    /* CACHED */
                  )
                ])],
                2
                /* CLASS */
              )) : createCommentVNode("v-if", true)
            ],
            2
            /* CLASS */
          )
        ],
        2
        /* CLASS */
      );
    };
  }
});

export { _sfc_main as default };
//# sourceMappingURL=batch-editing.vue2.mjs.map
