import { defineComponent, resolveComponent, openBlock, createBlock, unref, withCtx, createVNode, createTextVNode, createElementBlock, resolveDynamicComponent, createCommentVNode } from "vue";
import { a_ as SettingItemBox, _ as _export_sfc } from "./index-67bc0910.js";
import { u as useTargetData } from "./useTargetData.hook-83638ed4.js";
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
  __name: "NameSetting",
  props: {
    chartConfig: {
      type: Object,
      required: true
    }
  },
  setup(__props) {
    const props = __props;
    let valueCatch = "";
    const handleFocus = () => {
      valueCatch = props.chartConfig.title;
    };
    const handleBlur = () => {
      if (!props.chartConfig.title.length) {
        window["$message"].warning("请输入至少一个字符!");
        props.chartConfig.title = valueCatch;
      }
    };
    return (_ctx, _cache) => {
      const _component_n_input = resolveComponent("n-input");
      return openBlock(), createBlock(unref(SettingItemBox), {
        name: "名称",
        alone: true
      }, {
        default: withCtx(() => [
          createVNode(_component_n_input, {
            type: "text",
            maxlength: "12",
            minlength: "1",
            placeholder: "请输入图表名称",
            size: "small",
            clearable: "",
            "show-count": "",
            value: __props.chartConfig.title,
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => __props.chartConfig.title = $event),
            onFocus: handleFocus,
            onBlur: handleBlur
          }, null, 8, ["value"])
        ]),
        _: 1
      });
    };
  }
});
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
  __name: "PositionSetting",
  props: {
    canvasConfig: {
      type: Object,
      required: true
    },
    chartAttr: {
      type: Object,
      required: true
    }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      const _component_n_text = resolveComponent("n-text");
      const _component_n_input_number = resolveComponent("n-input-number");
      return openBlock(), createBlock(unref(SettingItemBox), { name: "位置" }, {
        default: withCtx(() => [
          createVNode(_component_n_input_number, {
            value: __props.chartAttr.y,
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => __props.chartAttr.y = $event),
            min: 0,
            size: "small",
            placeholder: "px"
          }, {
            prefix: withCtx(() => [
              createVNode(_component_n_text, { depth: "3" }, {
                default: withCtx(() => [
                  createTextVNode("上")
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"]),
          createVNode(_component_n_input_number, {
            value: __props.chartAttr.x,
            "onUpdate:value": _cache[1] || (_cache[1] = ($event) => __props.chartAttr.x = $event),
            min: 0,
            size: "small",
            placeholder: "px"
          }, {
            prefix: withCtx(() => [
              createVNode(_component_n_text, { depth: "3" }, {
                default: withCtx(() => [
                  createTextVNode("左")
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"])
        ]),
        _: 1
      });
    };
  }
});
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
  __name: "SizeSetting",
  props: {
    chartAttr: {
      type: Object,
      required: true
    },
    isGroup: {
      type: Boolean,
      required: false
    }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      const _component_n_text = resolveComponent("n-text");
      const _component_n_input_number = resolveComponent("n-input-number");
      return openBlock(), createBlock(unref(SettingItemBox), { name: "尺寸" }, {
        default: withCtx(() => [
          createVNode(_component_n_input_number, {
            value: __props.chartAttr.w,
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => __props.chartAttr.w = $event),
            min: 50,
            disabled: __props.isGroup,
            size: "small",
            placeholder: "px"
          }, {
            prefix: withCtx(() => [
              createVNode(_component_n_text, { depth: "3" }, {
                default: withCtx(() => [
                  createTextVNode("宽度")
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value", "disabled"]),
          createVNode(_component_n_input_number, {
            value: __props.chartAttr.h,
            "onUpdate:value": _cache[1] || (_cache[1] = ($event) => __props.chartAttr.h = $event),
            min: 50,
            disabled: __props.isGroup,
            size: "small",
            placeholder: "px"
          }, {
            prefix: withCtx(() => [
              createVNode(_component_n_text, { depth: "3" }, {
                default: withCtx(() => [
                  createTextVNode("高度")
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value", "disabled"])
        ]),
        _: 1
      });
    };
  }
});
const _hoisted_1 = {
  key: 0,
  class: "go-chart-configurations-setting"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  setup(__props) {
    const { targetData, chartEditStore } = useTargetData();
    return (_ctx, _cache) => {
      return unref(targetData) ? (openBlock(), createElementBlock("div", _hoisted_1, [
        createVNode(unref(_sfc_main$3), {
          chartConfig: unref(targetData).chartConfig
        }, null, 8, ["chartConfig"]),
        createVNode(unref(_sfc_main$1), {
          isGroup: unref(targetData).isGroup,
          chartAttr: unref(targetData).attr
        }, null, 8, ["isGroup", "chartAttr"]),
        createVNode(unref(_sfc_main$2), {
          chartAttr: unref(targetData).attr,
          canvasConfig: unref(chartEditStore).getEditCanvasConfig
        }, null, 8, ["chartAttr", "canvasConfig"]),
        (openBlock(), createBlock(resolveDynamicComponent(unref(targetData).chartConfig.conKey), {
          optionData: unref(targetData).option
        }, null, 8, ["optionData"]))
      ])) : createCommentVNode("", true);
    };
  }
});
const index_vue_vue_type_style_index_0_scoped_8af2de12_lang = "";
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8af2de12"]]);
export {
  index as default
};
