import { defineComponent as j, computed as f, resolveComponent as u, openBlock as r, createElementBlock as c, createElementVNode as v, createVNode as t, withCtx as n, unref as i, h as y, withDirectives as g, vModelText as x, Fragment as O, renderList as B, createBlock as C, resolveDynamicComponent as h, createTextVNode as S, toDisplayString as R } from "vue";
import { g as k, i as F, k as q, j as G, f as H, h as J, b as K, a as P, c as Q, B as X, M as Y, D as Z, S as $, _ as ee } from "./index-CdE5rAGt.js";
const le = { class: "property-toolbar" }, te = { class: "toolbar-items" }, oe = /* @__PURE__ */ j({
  __name: "CommonText copy",
  props: {
    textElement: {
      type: Object,
      default: () => ({})
    }
  },
  emits: ["update:textElement"],
  setup(z, { emit: w }) {
    const A = z, D = w, e = f({
      get: () => A.textElement,
      set: (a) => D("update:textElement", a)
    }), E = [
      { value: "solid", label: "实线", icon: Y },
      { value: "dashed", label: "虚线", icon: Z },
      { value: "dotted", label: "点线", icon: $ }
    ], m = [
      { value: "none", label: "无框线", icon: k },
      { value: "all", label: "所有框线", icon: F },
      { value: "top", label: "上框线", icon: q },
      { value: "right", label: "右框线", icon: G },
      { value: "bottom", label: "下框线", icon: H },
      { value: "left", label: "左框线", icon: J }
    ], U = f(() => {
      const a = m.find(
        (o) => o.value === e.value.border
      );
      return a ? a.icon : k;
    });
    function T(a) {
      a > 0 && !e.value.borderStyle && (e.value.borderStyle = "solid", e.value.border = "all"), a === 0 && (e.value.border = "none", e.value.borderStyle = null);
    }
    function V({ key: a }) {
      e.value.border = a;
    }
    function M() {
      e.value.bold = !e.value.bold;
    }
    return (a, o) => {
      const d = u("a-radio-button"), p = u("a-radio-group"), _ = u("a-button"), b = u("a-input-number"), s = u("a-tooltip"), I = u("a-divider"), L = u("a-menu-item"), N = u("a-menu"), W = u("a-dropdown");
      return r(), c("div", le, [
        v("div", te, [
          t(p, {
            value: e.value.horzAlign,
            "onUpdate:value": o[0] || (o[0] = (l) => e.value.horzAlign = l),
            size: "small"
          }, {
            default: n(() => [
              t(d, { value: "left" }, {
                default: n(() => [
                  t(i(K))
                ]),
                _: 1
              }),
              t(d, { value: "center" }, {
                default: n(() => [
                  t(i(P))
                ]),
                _: 1
              }),
              t(d, { value: "right" }, {
                default: n(() => [
                  t(i(Q))
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["value"]),
          t(_, {
            size: "small",
            icon: y(i(X)),
            onClick: M
          }, null, 8, ["icon"]),
          t(s, {
            title: "字号",
            color: "blue"
          }, {
            default: n(() => [
              t(b, {
                value: e.value.fontSize,
                "onUpdate:value": o[1] || (o[1] = (l) => e.value.fontSize = l),
                placeholder: "字体大小",
                style: { width: "50px" },
                size: "small"
              }, null, 8, ["value"])
            ]),
            _: 1
          }),
          t(s, {
            title: "字体颜色",
            color: "blue"
          }, {
            default: n(() => [
              g(v("input", {
                type: "color",
                "onUpdate:modelValue": o[2] || (o[2] = (l) => e.value.color = l),
                class: "color-picker"
              }, null, 512), [
                [x, e.value.color]
              ])
            ]),
            _: 1
          }),
          t(I, { type: "vertical" }),
          t(W, null, {
            overlay: n(() => [
              t(N, { onClick: V }, {
                default: n(() => [
                  (r(), c(O, null, B(m, (l) => t(L, {
                    key: l.value,
                    disabled: l.value === e.value.border
                  }, {
                    default: n(() => [
                      (r(), C(h(l.icon), { style: { fontSize: "18px" } })),
                      S(" " + R(l.label), 1)
                    ]),
                    _: 2
                  }, 1032, ["disabled"])), 64))
                ]),
                _: 1
              })
            ]),
            default: n(() => [
              t(_, {
                size: "small",
                icon: y(U.value)
              }, null, 8, ["icon"])
            ]),
            _: 1
          }),
          t(s, {
            title: "边框宽度",
            color: "blue"
          }, {
            default: n(() => [
              t(b, {
                value: e.value.borderWidth,
                "onUpdate:value": o[3] || (o[3] = (l) => e.value.borderWidth = l),
                min: 0,
                max: 10,
                style: { width: "80px" },
                onChange: T,
                size: "small"
              }, {
                addonAfter: n(() => [...o[6] || (o[6] = [
                  S("px", -1)
                ])]),
                _: 1
              }, 8, ["value"])
            ]),
            _: 1
          }),
          g(v("input", {
            type: "color",
            "onUpdate:modelValue": o[4] || (o[4] = (l) => e.value.borderColor = l),
            class: "color-picker"
          }, null, 512), [
            [x, e.value.borderColor]
          ]),
          t(p, {
            value: e.value.borderStyle,
            "onUpdate:value": o[5] || (o[5] = (l) => e.value.borderStyle = l),
            size: "small"
          }, {
            default: n(() => [
              (r(), c(O, null, B(E, (l) => t(d, {
                key: l.value,
                value: l.value
              }, {
                default: n(() => [
                  (r(), C(h(l.icon)))
                ]),
                _: 2
              }, 1032, ["value"])), 64))
            ]),
            _: 1
          }, 8, ["value"])
        ])
      ]);
    };
  }
}), ue = /* @__PURE__ */ ee(oe, [["__scopeId", "data-v-553e4e34"]]);
export {
  ue as default
};
