@mlightcad/ui-components 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,83 +1,84 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".ml-dropdown-icon[data-v-3fc33b5d],.ml-dropdown-icon[data-v-3fc33b5d]:hover{outline:none;border:none}.ml-status-bar[data-v-d6a59cf0]{position:fixed;bottom:0;left:0;right:0;height:30px;display:flex;justify-content:space-between;align-items:center;background-color:var(--el-fill-color);box-sizing:border-box;border:1px solid var(--el-border-color)}.ml-status-bar-left[data-v-d6a59cf0],.ml-status-bar-right[data-v-d6a59cf0]{display:flex;align-items:center}.ml-status-bar-left[data-v-d6a59cf0]>*{margin-right:10px}.ml-status-bar-right[data-v-d6a59cf0]>*{margin-left:10px}.ml-toggle-button[data-v-b676e93b]{border:none;padding:0;cursor:pointer;width:var(--0547f26d);height:var(--0547f26d)}.ml-vertical-toolbar-button-group[data-v-c6504e33]{display:flex;flex-direction:column;background-color:var(--el-fill-color)}.ml-horizontal-toolbar-button-group[data-v-c6504e33]{display:flex;flex-direction:row;background-color:var(--el-fill-color)}.ml-toolbar-button[data-v-c6504e33]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px}.ml-toolbar-button-text[data-v-c6504e33]{margin-left:0;margin-top:5px}.ml-tool-palette-dialog[data-v-43098ce9]{cursor:default;width:300px;min-width:var(--collapsed-width);position:fixed;box-sizing:border-box;border:1px solid var(--el-border-color)}.ml-tool-palette-dialog-icon[data-v-43098ce9]{border-bottom:1px solid var(--el-border-color);cursor:default}.ml-tool-palette-dialog-icon[data-v-43098ce9]:hover{color:var(--el-color-primary)}.ml-tool-palette-dialog-layout[data-v-43098ce9]{display:flex;height:100%}.ml-tool-palette-title-bar[data-v-43098ce9]{width:var(--collapsed-width);display:flex;justify-content:left;align-items:center;cursor:move;writing-mode:vertical-rl;text-align:center;background-color:var(--el-fill-color)}.ml-tool-palette-title[data-v-43098ce9]{pointer-events:none;margin-top:10px;margin-bottom:10px;font-size:small;-webkit-user-select:none;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ml-tool-palette-content[data-v-43098ce9]{-webkit-user-select:none;user-select:none;flex-grow:1;display:flex;flex-direction:column;background-color:var(--el-fill-color);overflow:hidden}.ml-tool-palette-tabs[data-v-43098ce9]{display:flex;flex-direction:column;height:100%;flex:1}.ml-tool-palette-tabs[data-v-43098ce9] .el-tabs{display:flex;flex-direction:column;height:100%}.ml-tool-palette-tabs[data-v-43098ce9] .el-tabs__header{margin:0;border-bottom:none;order:1;flex-shrink:0;position:relative}.ml-tool-palette-tabs[data-v-43098ce9] .el-tabs__content{flex:1;overflow:auto;padding:0;order:2;min-height:0;position:relative}.ml-tool-palette-tabs[data-v-43098ce9] .el-tab-pane{height:100%;overflow:auto}.ml-tool-palette-default-content[data-v-43098ce9]{flex:1;overflow:auto;display:flex;flex-direction:column}.ml-tool-palette-dialog-layout.left .ml-tool-palette-title-bar[data-v-43098ce9]{order:1}.ml-tool-palette-dialog-layout.left .ml-tool-palette-content[data-v-43098ce9],.ml-tool-palette-dialog-layout.right .ml-tool-palette-title-bar[data-v-43098ce9]{order:2}.ml-tool-palette-dialog-layout.right .ml-tool-palette-content[data-v-43098ce9]{order:1}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- import { ElIcon as U, ElDropdownItem as ae, ElDropdownMenu as ue, ElDropdown as ce, ElButton as P, ElTooltip as R, ElButtonGroup as re, ElTabPane as ve, ElTabs as de } from "element-plus/es";
1
+ (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".ml-dropdown-icon[data-v-3fc33b5d],.ml-dropdown-icon[data-v-3fc33b5d]:hover{outline:none;border:none}.ml-status-bar[data-v-d6a59cf0]{position:fixed;bottom:0;left:0;right:0;height:30px;display:flex;justify-content:space-between;align-items:center;background-color:var(--el-fill-color);box-sizing:border-box;border:1px solid var(--el-border-color)}.ml-status-bar-left[data-v-d6a59cf0],.ml-status-bar-right[data-v-d6a59cf0]{display:flex;align-items:center}.ml-status-bar-left[data-v-d6a59cf0]>*{margin-right:10px}.ml-status-bar-right[data-v-d6a59cf0]>*{margin-left:10px}.ml-toggle-button[data-v-4a154978]{border:none;padding:0;cursor:pointer;width:var(--7a331cae);height:var(--7a331cae)}.ml-toolbar-group[data-v-c74d9a36]{background-color:var(--el-fill-color)}.ml-sub-toolbar-group[data-v-c74d9a36]{background-color:var(--el-bg-color)}.ml-toolbar-button[data-v-c74d9a36]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px}.ml-toolbar-button-text[data-v-c74d9a36]{margin-top:5px}.ml-tool-palette-dialog[data-v-cd1a3c67]{cursor:default;width:300px;min-width:var(--collapsed-width);position:fixed;box-sizing:border-box;border:1px solid var(--el-border-color)}.ml-tool-palette-disabled[data-v-cd1a3c67]{pointer-events:none;opacity:.6}.ml-tool-palette-dialog-icon[data-v-cd1a3c67]{border-bottom:1px solid var(--el-border-color);cursor:default}.ml-tool-palette-dialog-icon[data-v-cd1a3c67]:hover{color:var(--el-color-primary)}.ml-tool-palette-dialog-layout[data-v-cd1a3c67]{display:flex;height:100%}.ml-tool-palette-title-bar[data-v-cd1a3c67]{width:var(--collapsed-width);display:flex;justify-content:left;align-items:center;cursor:move;writing-mode:vertical-rl;text-align:center;background-color:var(--el-fill-color)}.ml-tool-palette-title[data-v-cd1a3c67]{pointer-events:none;margin-top:10px;margin-bottom:10px;font-size:small;-webkit-user-select:none;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ml-tool-palette-content[data-v-cd1a3c67]{-webkit-user-select:none;user-select:none;flex-grow:1;display:flex;flex-direction:column;background-color:var(--el-fill-color);overflow:hidden}.ml-tool-palette-tabs[data-v-cd1a3c67]{display:flex;flex-direction:column;height:100%;flex:1}.ml-tool-palette-tabs[data-v-cd1a3c67] .el-tabs{display:flex;flex-direction:column;height:100%}.ml-tool-palette-tabs[data-v-cd1a3c67] .el-tabs__header{margin:0;border-bottom:none;order:1;flex-shrink:0;position:relative}.ml-tool-palette-tabs[data-v-cd1a3c67] .el-tabs__content{flex:1;overflow:auto;padding:0;order:2;min-height:0;position:relative}.ml-tool-palette-tabs[data-v-cd1a3c67] .el-tab-pane{height:100%;overflow:auto}.ml-tool-palette-default-content[data-v-cd1a3c67]{flex:1;overflow:auto;display:flex;flex-direction:column}.ml-tool-palette-dialog-layout.left .ml-tool-palette-title-bar[data-v-cd1a3c67]{order:1}.ml-tool-palette-dialog-layout.left .ml-tool-palette-content[data-v-cd1a3c67],.ml-tool-palette-dialog-layout.right .ml-tool-palette-title-bar[data-v-cd1a3c67]{order:2}.ml-tool-palette-dialog-layout.right .ml-tool-palette-content[data-v-cd1a3c67]{order:1}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ import { ElIcon as J, ElDropdownItem as ue, ElDropdownMenu as re, ElDropdown as ce, ElButton as le, ElTooltip as ne, ElButtonGroup as de, ElPopover as ve, ElTabPane as me, ElTabs as he } from "element-plus/es";
3
3
  import "element-plus/es/components/base/style/css";
4
4
  import "element-plus/es/components/icon/style/css";
5
- import { openBlock as b, createElementBlock as V, createElementVNode as B, defineComponent as Y, mergeModels as D, useModel as H, computed as p, createBlock as $, withCtx as C, resolveDynamicComponent as ee, createVNode as S, Fragment as G, renderList as j, createTextVNode as me, toDisplayString as O, pushScopeId as te, popScopeId as ne, renderSlot as X, useCssVars as he, normalizeClass as le, normalizeStyle as N, createCommentVNode as oe, ref as f, onMounted as W, onUnmounted as q, watch as y, onBeforeUnmount as se, unref as J } from "vue";
5
+ import { openBlock as _, createElementBlock as V, createElementVNode as k, defineComponent as H, mergeModels as A, useModel as G, computed as M, createBlock as B, withCtx as x, resolveDynamicComponent as N, createVNode as I, Fragment as O, renderList as j, createTextVNode as fe, toDisplayString as Y, pushScopeId as oe, popScopeId as se, renderSlot as q, useCssVars as pe, ref as g, normalizeStyle as X, createCommentVNode as F, onMounted as D, onUnmounted as Q, watch as E, onBeforeUnmount as ae, normalizeClass as Z, unref as P } from "vue";
6
6
  import "element-plus/es/components/dropdown/style/css";
7
7
  import "element-plus/es/components/dropdown-menu/style/css";
8
8
  import "element-plus/es/components/dropdown-item/style/css";
9
9
  import "element-plus/es/components/tooltip/style/css";
10
10
  import "element-plus/es/components/button/style/css";
11
+ import "element-plus/es/components/popover/style/css";
11
12
  import "element-plus/es/components/button-group/style/css";
12
13
  import "element-plus/es/components/tabs/style/css";
13
14
  import "element-plus/es/components/tab-pane/style/css";
14
- const fe = {
15
+ const _e = {
15
16
  xmlns: "http://www.w3.org/2000/svg",
16
17
  width: "1em",
17
18
  height: "1em",
18
19
  viewBox: "0 0 1024 1024"
19
- }, pe = /* @__PURE__ */ B("path", {
20
+ }, we = /* @__PURE__ */ k("path", {
20
21
  fill: "currentColor",
21
22
  d: "M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.59 30.59 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.59 30.59 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0"
22
- }, null, -1), _e = [
23
- pe
23
+ }, null, -1), ge = [
24
+ we
24
25
  ];
25
- function we(e, a) {
26
- return b(), V("svg", fe, [..._e]);
26
+ function be(e, u) {
27
+ return _(), V("svg", _e, [...ge]);
27
28
  }
28
- const K = { render: we }, ge = {
29
+ const R = { render: be }, Le = {
29
30
  xmlns: "http://www.w3.org/2000/svg",
30
31
  width: "1em",
31
32
  height: "1em",
32
33
  viewBox: "0 0 1024 1024"
33
- }, be = /* @__PURE__ */ B("path", {
34
+ }, xe = /* @__PURE__ */ k("path", {
34
35
  fill: "currentColor",
35
36
  d: "M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512 340.864 831.872a30.59 30.59 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"
36
- }, null, -1), Le = [
37
- be
37
+ }, null, -1), Me = [
38
+ xe
38
39
  ];
39
- function xe(e, a) {
40
- return b(), V("svg", ge, [...Le]);
40
+ function ye(e, u) {
41
+ return _(), V("svg", Le, [...Me]);
41
42
  }
42
- const Q = { render: xe }, ye = /* @__PURE__ */ Y({
43
+ const ee = { render: ye }, ze = /* @__PURE__ */ H({
43
44
  __name: "MlCollapse",
44
- props: /* @__PURE__ */ D({
45
+ props: /* @__PURE__ */ A({
45
46
  size: { default: 18 },
46
47
  reverse: { type: Boolean, default: !1 }
47
48
  }, {
48
49
  modelValue: { default: !0 },
49
50
  modelModifiers: {}
50
51
  }),
51
- emits: /* @__PURE__ */ D(["change"], ["update:modelValue"]),
52
- setup(e, { emit: a }) {
53
- const t = e, o = H(e, "modelValue"), l = a, n = p(() => t.reverse ? o.value ? K : Q : o.value ? Q : K), u = p(() => `${t.size}px`), m = () => {
54
- l("change", o.value), o.value = !o.value;
52
+ emits: /* @__PURE__ */ A(["change"], ["update:modelValue"]),
53
+ setup(e, { emit: u }) {
54
+ const t = e, o = G(e, "modelValue"), n = u, l = M(() => t.reverse ? o.value ? R : ee : o.value ? ee : R), i = M(() => `${t.size}px`), m = () => {
55
+ n("change", o.value), o.value = !o.value;
55
56
  };
56
- return (s, c) => {
57
- const v = U;
58
- return b(), $(v, {
59
- size: u.value,
57
+ return (a, r) => {
58
+ const p = J;
59
+ return _(), B(p, {
60
+ size: i.value,
60
61
  onClick: m
61
62
  }, {
62
- default: C(() => [
63
- (b(), $(ee(n.value)))
63
+ default: x(() => [
64
+ (_(), B(N(l.value)))
64
65
  ]),
65
66
  _: 1
66
67
  }, 8, ["size"]);
67
68
  };
68
69
  }
69
- }), Me = (e) => (te("data-v-3fc33b5d"), e = e(), ne(), e), Ee = /* @__PURE__ */ Me(() => /* @__PURE__ */ B("svg", {
70
+ }), Ee = (e) => (oe("data-v-3fc33b5d"), e = e(), se(), e), Ce = /* @__PURE__ */ Ee(() => /* @__PURE__ */ k("svg", {
70
71
  preserveAspectRatio: "xMidYMid meet",
71
72
  viewBox: "0 0 24 24",
72
73
  width: "1.2em",
73
74
  height: "1.2em",
74
75
  "data-v-63d067da": ""
75
76
  }, [
76
- /* @__PURE__ */ B("path", {
77
+ /* @__PURE__ */ k("path", {
77
78
  fill: "currentColor",
78
79
  d: "m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"
79
80
  })
80
- ], -1)), ze = /* @__PURE__ */ Y({
81
+ ], -1)), Te = /* @__PURE__ */ H({
81
82
  __name: "MlDropdown",
82
83
  props: {
83
84
  icon: {},
@@ -87,22 +88,22 @@ const Q = { render: xe }, ye = /* @__PURE__ */ Y({
87
88
  emits: {
88
89
  click: null
89
90
  },
90
- setup(e, { emit: a }) {
91
- const t = e, o = a, l = p(() => t.items.filter((u) => u.name !== t.current)), n = (u) => {
92
- o("click", u);
91
+ setup(e, { emit: u }) {
92
+ const t = e, o = u, n = M(() => t.items.filter((i) => i.name !== t.current)), l = (i) => {
93
+ o("click", i);
93
94
  };
94
- return (u, m) => {
95
- const s = U, c = ae, v = ue, _ = ce;
96
- return b(), $(_, { onCommand: n }, {
97
- dropdown: C(() => [
98
- S(v, null, {
99
- default: C(() => [
100
- (b(!0), V(G, null, j(l.value, (r) => (b(), $(c, {
101
- key: r.text,
102
- command: r.name
95
+ return (i, m) => {
96
+ const a = J, r = ue, p = re, L = ce;
97
+ return _(), B(L, { onCommand: l }, {
98
+ dropdown: x(() => [
99
+ I(p, null, {
100
+ default: x(() => [
101
+ (_(!0), V(O, null, j(n.value, (c) => (_(), B(r, {
102
+ key: c.text,
103
+ command: c.name
103
104
  }, {
104
- default: C(() => [
105
- me(O(r.text), 1)
105
+ default: x(() => [
106
+ fe(Y(c.text), 1)
106
107
  ]),
107
108
  _: 2
108
109
  }, 1032, ["command"]))), 128))
@@ -110,13 +111,13 @@ const Q = { render: xe }, ye = /* @__PURE__ */ Y({
110
111
  _: 1
111
112
  })
112
113
  ]),
113
- default: C(() => [
114
- S(s, {
114
+ default: x(() => [
115
+ I(a, {
115
116
  size: "30",
116
117
  class: "ml-dropdown-icon"
117
118
  }, {
118
- default: C(() => [
119
- Ee
119
+ default: x(() => [
120
+ Ce
120
121
  ]),
121
122
  _: 1
122
123
  })
@@ -125,12 +126,12 @@ const Q = { render: xe }, ye = /* @__PURE__ */ Y({
125
126
  });
126
127
  };
127
128
  }
128
- }), A = (e, a) => {
129
+ }), U = (e, u) => {
129
130
  const t = e.__vccOpts || e;
130
- for (const [o, l] of a)
131
- t[o] = l;
131
+ for (const [o, n] of u)
132
+ t[o] = n;
132
133
  return t;
133
- }, F = /* @__PURE__ */ A(ze, [["__scopeId", "data-v-3fc33b5d"]]), Te = '<svg preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" width="1.2em" height="1.2em" data-v-63d067da=""><path fill="currentColor" d="m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"></path></svg>', Ce = /* @__PURE__ */ Y({
134
+ }, K = /* @__PURE__ */ U(Te, [["__scopeId", "data-v-3fc33b5d"]]), ke = '<svg preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" width="1.2em" height="1.2em" data-v-63d067da=""><path fill="currentColor" d="m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"></path></svg>', Be = /* @__PURE__ */ H({
134
135
  __name: "MlLanguage",
135
136
  props: {
136
137
  languages: {},
@@ -139,567 +140,671 @@ const Q = { render: xe }, ye = /* @__PURE__ */ Y({
139
140
  emits: {
140
141
  click: null
141
142
  },
142
- setup(e, { emit: a }) {
143
- const t = e, o = a, l = (n) => {
144
- o("click", n);
143
+ setup(e, { emit: u }) {
144
+ const t = e, o = u, n = (l) => {
145
+ o("click", l);
145
146
  };
146
- return (n, u) => (b(), $(F, {
147
- icon: Te,
147
+ return (l, i) => (_(), B(K, {
148
+ icon: ke,
148
149
  items: t.languages,
149
150
  current: t.current,
150
- onClick: l
151
+ onClick: n
151
152
  }, null, 8, ["items", "current"]));
152
153
  }
153
- }), Be = {}, ke = { class: "ml-status-bar" }, $e = { class: "ml-status-bar-left" }, Ie = { class: "ml-status-bar-right" };
154
- function Ve(e, a) {
155
- return b(), V("div", ke, [
156
- B("div", $e, [
157
- X(e.$slots, "left", {}, void 0, !0)
154
+ }), $e = {}, We = { class: "ml-status-bar" }, Ie = { class: "ml-status-bar-left" }, Ve = { class: "ml-status-bar-right" };
155
+ function Se(e, u) {
156
+ return _(), V("div", We, [
157
+ k("div", Ie, [
158
+ q(e.$slots, "left", {}, void 0, !0)
158
159
  ]),
159
- B("div", Ie, [
160
- X(e.$slots, "right", {}, void 0, !0)
160
+ k("div", Ve, [
161
+ q(e.$slots, "right", {}, void 0, !0)
161
162
  ])
162
163
  ]);
163
164
  }
164
- const We = /* @__PURE__ */ A(Be, [["render", Ve], ["__scopeId", "data-v-d6a59cf0"]]), De = /* @__PURE__ */ Y({
165
+ const De = /* @__PURE__ */ U($e, [["render", Se], ["__scopeId", "data-v-d6a59cf0"]]), Ye = /* @__PURE__ */ H({
165
166
  __name: "MlToggleButton",
166
- props: /* @__PURE__ */ D({
167
+ props: /* @__PURE__ */ A({
167
168
  size: { default: 30 },
168
169
  data: {}
169
170
  }, {
170
171
  modelValue: { default: !1 },
171
172
  modelModifiers: {}
172
173
  }),
173
- emits: /* @__PURE__ */ D(["click"], ["update:modelValue"]),
174
- setup(e, { emit: a }) {
175
- he((c) => ({
176
- "0547f26d": u.value
174
+ emits: /* @__PURE__ */ A(["click"], ["update:modelValue"]),
175
+ setup(e, { emit: u }) {
176
+ pe((r) => ({
177
+ "7a331cae": i.value
177
178
  }));
178
- const t = e, o = H(e, "modelValue"), l = a, n = p(() => o.value ? t.data.onIcon : t.data.offIcon), u = p(() => t.size + "px"), m = p(() => o.value ? t.data.onTooltip : t.data.offTooltip), s = () => {
179
- o.value = !o.value, l("click", o.value);
179
+ const t = e, o = G(e, "modelValue"), n = u, l = M(() => o.value ? t.data.onIcon : t.data.offIcon), i = M(() => t.size + "px"), m = M(() => o.value ? t.data.onTooltip : t.data.offTooltip), a = () => {
180
+ o.value = !o.value, n("click", o.value);
180
181
  };
181
- return (c, v) => {
182
- const _ = P, r = R;
183
- return b(), $(r, {
182
+ return (r, p) => {
183
+ const L = le, c = ne;
184
+ return _(), B(c, {
184
185
  content: m.value,
185
186
  "hide-after": 0
186
187
  }, {
187
- default: C(() => [
188
- S(_, {
188
+ default: x(() => [
189
+ I(L, {
189
190
  class: "ml-toggle-button",
190
- icon: n.value,
191
- onClick: s
191
+ icon: l.value,
192
+ onClick: a
192
193
  }, null, 8, ["icon"])
193
194
  ]),
194
195
  _: 1
195
196
  }, 8, ["content"]);
196
197
  };
197
198
  }
198
- }), Se = /* @__PURE__ */ A(De, [["__scopeId", "data-v-b676e93b"]]), Ye = {
199
+ }), Ae = /* @__PURE__ */ U(Ye, [["__scopeId", "data-v-4a154978"]]), He = {
199
200
  key: 0,
200
201
  class: "ml-toolbar-button-text"
201
- }, Ae = /* @__PURE__ */ Y({
202
+ }, Oe = {
203
+ key: 0,
204
+ class: "ml-toolbar-button-text"
205
+ }, Xe = {
206
+ key: 0,
207
+ class: "ml-toolbar-button-text"
208
+ }, Ue = /* @__PURE__ */ H({
202
209
  __name: "MlToolBar",
203
210
  props: {
204
211
  items: {},
205
212
  size: { default: "large" },
206
- direction: {}
207
- },
208
- emits: {
209
- click: null
213
+ direction: { default: "horizontal" },
214
+ placement: {}
210
215
  },
211
- setup(e, { emit: a }) {
212
- const t = e, o = a, l = p(() => t.direction === "vertical" ? "ml-vertical-toolbar-button-group" : "ml-horizontal-toolbar-button-group"), n = p(() => t.size === "small" ? 20 : 30), u = p(() => {
213
- switch (t.size) {
214
- case "small":
215
- return 30;
216
- case "medium":
217
- return 50;
218
- }
219
- return 70;
220
- }), m = (v) => v.description ? v.description : v.text, s = p(() => t.size === "large"), c = (v) => {
221
- o("click", v);
222
- };
223
- return (v, _) => {
224
- const r = U, h = P, d = R, M = re;
225
- return b(), $(M, {
226
- class: le(l.value)
216
+ emits: ["click"],
217
+ setup(e, { emit: u }) {
218
+ const t = e, o = u, n = M(() => t.size === "small" ? 20 : 30), l = M(() => t.size === "small" ? 30 : t.size === "medium" ? 50 : 70), i = M(() => t.size === "large"), m = (d) => d.description ?? d.text, a = g(null), r = (d) => {
219
+ a.value = d;
220
+ }, p = () => {
221
+ a.value = null;
222
+ }, L = (d) => {
223
+ d && o("click", d);
224
+ }, c = (d) => {
225
+ d && o("click", d), p();
226
+ }, b = M(() => {
227
+ const d = "right-start", $ = "bottom-start";
228
+ return t.placement && (t.direction === "vertical" && (t.placement.startsWith("left") || t.placement.startsWith("right")) || t.direction === "horizontal" && (t.placement.startsWith("top") || t.placement.startsWith("bottom"))) ? t.placement : t.direction === "vertical" ? d : $;
229
+ }), h = (d) => t.direction === "horizontal" && d.children ? d.children.length * l.value : l.value, T = (d) => t.direction === "vertical" && d.children ? l.value : 0;
230
+ return (d, $) => {
231
+ const W = J, C = le, s = ne, f = de, y = ve;
232
+ return _(), B(f, {
233
+ class: "ml-toolbar-group",
234
+ direction: d.direction
227
235
  }, {
228
- default: C(() => [
229
- (b(!0), V(G, null, j(v.items, (E, k) => (b(), $(d, {
230
- key: E.text,
231
- content: m(E),
232
- "hide-after": 0
233
- }, {
234
- default: C(() => [
235
- (b(), $(h, {
236
- class: "ml-toolbar-button",
237
- style: N({ width: u.value + "px", height: u.value + "px" }),
238
- key: k,
239
- onClick: (I) => c(E.command)
236
+ default: x(() => [
237
+ (_(!0), V(O, null, j(d.items, (v, z) => {
238
+ var w;
239
+ return _(), V(O, { key: z }, [
240
+ (w = v.children) != null && w.length ? (_(), B(y, {
241
+ key: 0,
242
+ visible: a.value === z,
243
+ trigger: "manual",
244
+ placement: b.value,
245
+ "show-arrow": !0,
246
+ teleported: !0,
247
+ "popper-style": {
248
+ minWidth: h(v) + "px",
249
+ maxWidth: T(v) + "px",
250
+ "--el-popover-padding": "0px",
251
+ "--el-popover-border-width": "0px",
252
+ "--el-popover-border-color": "transparent"
253
+ },
254
+ onMouseenter: (S) => r(z),
255
+ onMouseleave: p
240
256
  }, {
241
- default: C(() => [
242
- B("div", null, [
243
- S(r, { size: n.value }, {
244
- default: C(() => [
245
- (b(), $(ee(E.icon)))
246
- ]),
247
- _: 2
248
- }, 1032, ["size"]),
249
- s.value ? (b(), V("div", Ye, O(E.text), 1)) : oe("", !0)
250
- ])
257
+ reference: x(() => [
258
+ I(C, {
259
+ class: "ml-toolbar-button",
260
+ style: X({ width: l.value + "px", height: l.value + "px" }),
261
+ onMouseenter: (S) => r(z),
262
+ onMouseleave: p
263
+ }, {
264
+ default: x(() => [
265
+ I(s, {
266
+ content: m(v),
267
+ "auto-close": 3e3,
268
+ "show-after": 1e3,
269
+ "hide-after": 0
270
+ }, {
271
+ default: x(() => [
272
+ k("div", null, [
273
+ I(W, { size: n.value }, {
274
+ default: x(() => [
275
+ (_(), B(N(v.icon)))
276
+ ]),
277
+ _: 2
278
+ }, 1032, ["size"]),
279
+ i.value ? (_(), V("div", Oe, Y(v.text), 1)) : F("", !0)
280
+ ])
281
+ ]),
282
+ _: 2
283
+ }, 1032, ["content"])
284
+ ]),
285
+ _: 2
286
+ }, 1032, ["style", "onMouseenter"])
287
+ ]),
288
+ default: x(() => [
289
+ I(f, {
290
+ class: "ml-sub-toolbar-group",
291
+ direction: d.direction,
292
+ onMouseenter: (S) => r(z),
293
+ onMouseleave: p
294
+ }, {
295
+ default: x(() => [
296
+ (_(!0), V(O, null, j(v.children, (S, ie) => (_(), B(s, {
297
+ key: ie,
298
+ content: m(S),
299
+ "auto-close": 3e3,
300
+ "show-after": 1e3,
301
+ "hide-after": 0
302
+ }, {
303
+ default: x(() => [
304
+ I(C, {
305
+ class: "ml-toolbar-button",
306
+ style: X({ width: l.value + "px", height: l.value + "px" }),
307
+ onClick: (at) => c(S.command)
308
+ }, {
309
+ default: x(() => [
310
+ k("div", null, [
311
+ I(W, { size: n.value }, {
312
+ default: x(() => [
313
+ (_(), B(N(S.icon)))
314
+ ]),
315
+ _: 2
316
+ }, 1032, ["size"]),
317
+ i.value ? (_(), V("div", He, Y(S.text), 1)) : F("", !0)
318
+ ])
319
+ ]),
320
+ _: 2
321
+ }, 1032, ["style", "onClick"])
322
+ ]),
323
+ _: 2
324
+ }, 1032, ["content"]))), 128))
325
+ ]),
326
+ _: 2
327
+ }, 1032, ["direction", "onMouseenter"])
251
328
  ]),
252
329
  _: 2
253
- }, 1032, ["style", "onClick"]))
254
- ]),
255
- _: 2
256
- }, 1032, ["content"]))), 128))
330
+ }, 1032, ["visible", "placement", "popper-style", "onMouseenter"])) : (_(), B(s, {
331
+ key: 1,
332
+ content: m(v),
333
+ "auto-close": 3e3,
334
+ "show-after": 1e3,
335
+ "hide-after": 0
336
+ }, {
337
+ default: x(() => [
338
+ I(C, {
339
+ class: "ml-toolbar-button",
340
+ style: X({ width: l.value + "px", height: l.value + "px" }),
341
+ onClick: (S) => L(v.command)
342
+ }, {
343
+ default: x(() => [
344
+ k("div", null, [
345
+ I(W, { size: n.value }, {
346
+ default: x(() => [
347
+ (_(), B(N(v.icon)))
348
+ ]),
349
+ _: 2
350
+ }, 1032, ["size"]),
351
+ i.value ? (_(), V("div", Xe, Y(v.text), 1)) : F("", !0)
352
+ ])
353
+ ]),
354
+ _: 2
355
+ }, 1032, ["style", "onClick"])
356
+ ]),
357
+ _: 2
358
+ }, 1032, ["content"]))
359
+ ], 64);
360
+ }), 128))
257
361
  ]),
258
362
  _: 1
259
- }, 8, ["class"]);
363
+ }, 8, ["direction"]);
260
364
  };
261
365
  }
262
- }), He = /* @__PURE__ */ A(Ae, [["__scopeId", "data-v-c6504e33"]]), Z = 20;
263
- function Oe(e, a, t) {
264
- const o = f(!1), l = (s) => {
366
+ }), Ne = /* @__PURE__ */ U(Ue, [["__scopeId", "data-v-c74d9a36"]]), te = 20;
367
+ function Fe(e, u, t) {
368
+ const o = g(!1), n = (a) => {
265
369
  if (t.value && e.value) {
266
- const c = e.value.getBoundingClientRect(), v = s.clientX < c.left || s.clientX > c.right || s.clientY < c.top || s.clientY > c.bottom;
267
- o.value = !v;
370
+ const r = e.value.getBoundingClientRect(), p = a.clientX < r.left || a.clientX > r.right || a.clientY < r.top || a.clientY > r.bottom;
371
+ o.value = !p;
268
372
  }
269
- }, n = () => {
373
+ }, l = () => {
270
374
  t.value && (o.value = !0);
271
- }, u = () => {
272
- a.value && a.value.addEventListener("mousemove", n), e.value && e.value.addEventListener("mousemove", n);
375
+ }, i = () => {
376
+ u.value && u.value.addEventListener("mousemove", l), e.value && e.value.addEventListener("mousemove", l);
273
377
  }, m = () => {
274
- a.value && a.value.removeEventListener("mousemove", n), e.value && e.value.removeEventListener("mousemove", n);
378
+ u.value && u.value.removeEventListener("mousemove", l), e.value && e.value.removeEventListener("mousemove", l);
275
379
  };
276
- return W(() => {
277
- window.addEventListener("mousemove", l);
278
- }), q(() => {
279
- window.removeEventListener("mousemove", l);
280
- }), y(t, (s) => {
281
- s && (o.value = !1);
282
- }), y(e, (s) => {
283
- s ? u() : m();
380
+ return D(() => {
381
+ window.addEventListener("mousemove", n);
382
+ }), Q(() => {
383
+ window.removeEventListener("mousemove", n);
384
+ }), E(t, (a) => {
385
+ a && (o.value = !1);
386
+ }), E(e, (a) => {
387
+ a ? i() : m();
284
388
  }), { autoOpened: o };
285
389
  }
286
- function Xe(e, a, t) {
287
- const o = f(!1), l = f(null), n = f(null), u = { x: 0, y: 0 }, m = p(() => l.value == null || n.value == null ? { x: 0, y: 0 } : {
288
- x: l.value.x - n.value.x,
289
- y: l.value.y - n.value.y
290
- }), s = () => {
390
+ function Ge(e, u, t) {
391
+ const o = g(!1), n = g(null), l = g(null), i = { x: 0, y: 0 }, m = M(() => n.value == null || l.value == null ? { x: 0, y: 0 } : {
392
+ x: n.value.x - l.value.x,
393
+ y: n.value.y - l.value.y
394
+ }), a = () => {
291
395
  if (e.value) {
292
- const d = e.value.getBoundingClientRect();
293
- n.value = {
294
- x: d.left,
295
- y: d.top
296
- }, l.value = {
297
- x: d.left,
298
- y: d.top
396
+ const h = e.value.getBoundingClientRect();
397
+ l.value = {
398
+ x: h.left,
399
+ y: h.top
400
+ }, n.value = {
401
+ x: h.left,
402
+ y: h.top
299
403
  };
300
404
  }
301
- }, c = () => {
302
- e.value && e.value.addEventListener("mousedown", _);
303
- }, v = () => {
304
- e.value && e.value.removeEventListener("mousedown", _);
305
- }, _ = (d) => {
405
+ }, r = () => {
406
+ e.value && e.value.addEventListener("mousedown", L);
407
+ }, p = () => {
408
+ e.value && e.value.removeEventListener("mousedown", L);
409
+ }, L = (h) => {
306
410
  if (e.value != null) {
307
- if (a && a.value) {
308
- const M = a.value.getBoundingClientRect();
309
- if (d.clientX < M.left || d.clientX > M.right || d.clientY < M.top || d.clientY > M.bottom) return;
411
+ if (u && u.value) {
412
+ const T = u.value.getBoundingClientRect();
413
+ if (h.clientX < T.left || h.clientX > T.right || h.clientY < T.top || h.clientY > T.bottom) return;
310
414
  }
311
- o.value = !0, u.x = d.clientX, u.y = d.clientY, s(), document.addEventListener("mousemove", r), document.addEventListener("mouseup", h);
415
+ o.value = !0, i.x = h.clientX, i.y = h.clientY, a(), document.addEventListener("mousemove", c), document.addEventListener("mouseup", b);
312
416
  }
313
- }, r = (d) => {
314
- if (o.value && n.value && l.value) {
315
- const M = window.innerWidth, E = window.innerHeight, k = e.value, I = k.getBoundingClientRect(), T = I.width, i = I.height, L = n.value.x + (d.clientX - u.x), w = n.value.y + (d.clientY - u.y);
316
- l.value.x = Math.max(
417
+ }, c = (h) => {
418
+ if (o.value && l.value && n.value) {
419
+ const T = window.innerWidth, d = window.innerHeight, $ = e.value, W = $.getBoundingClientRect(), C = W.width, s = W.height, f = l.value.x + (h.clientX - i.x), y = l.value.y + (h.clientY - i.y);
420
+ n.value.x = Math.max(
317
421
  t ? t.value.offset.value.left : 0,
318
- L
422
+ f
319
423
  );
320
- const g = M - T;
321
- l.value.x = Math.min(
322
- t ? g - t.value.offset.value.right : g,
323
- l.value.x
324
- ), l.value.y = Math.max(
424
+ const v = T - C;
425
+ n.value.x = Math.min(
426
+ t ? v - t.value.offset.value.right : v,
427
+ n.value.x
428
+ ), n.value.y = Math.max(
325
429
  t ? t.value.offset.value.top : 0,
326
- Math.min(w, E - i)
430
+ Math.min(y, d - s)
327
431
  );
328
- const z = E - i;
329
- l.value.y = Math.min(
432
+ const z = d - s;
433
+ n.value.y = Math.min(
330
434
  t ? z - t.value.offset.value.bottom : z,
331
- l.value.y
332
- ), k.style.left = l.value.x + "px", k.style.top = l.value.y + "px";
435
+ n.value.y
436
+ ), $.style.left = n.value.x + "px", $.style.top = n.value.y + "px";
333
437
  }
334
- }, h = () => {
335
- o.value = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", h);
438
+ }, b = () => {
439
+ o.value = !1, document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", b);
336
440
  };
337
- return W(() => {
338
- e.value && (s(), c());
339
- }), q(() => {
340
- e.value && e.value.removeEventListener("mousedown", _);
341
- }), y(e, (d) => {
342
- d ? (s(), c()) : v();
441
+ return D(() => {
442
+ e.value && (a(), r());
443
+ }), Q(() => {
444
+ e.value && e.value.removeEventListener("mousedown", L);
445
+ }), E(e, (h) => {
446
+ h ? (a(), r()) : p();
343
447
  }), {
344
448
  isDragging: o,
345
449
  movement: m,
346
- position: l
450
+ position: n
347
451
  };
348
452
  }
349
- function Ue(e, a, t) {
350
- const o = f(!1), l = f("left"), { isDragging: n, movement: u, position: m } = Xe(
453
+ function je(e, u, t) {
454
+ const o = g(!1), n = g("left"), { isDragging: l, movement: i, position: m } = Ge(
351
455
  e,
352
- a,
456
+ u,
353
457
  t
354
458
  );
355
- return y(u, (s) => {
356
- if (s && e.value) {
357
- const v = e.value.getBoundingClientRect();
358
- v.left <= t.value.offset.value.left ? (l.value = "left", o.value = !0) : window.innerWidth - v.left - v.width <= t.value.offset.value.right ? (l.value = "right", o.value = !0) : o.value = !1;
459
+ return E(i, (a) => {
460
+ if (a && e.value) {
461
+ const p = e.value.getBoundingClientRect();
462
+ p.left <= t.value.offset.value.left ? (n.value = "left", o.value = !0) : window.innerWidth - p.left - p.width <= t.value.offset.value.right ? (n.value = "right", o.value = !0) : o.value = !1;
359
463
  }
360
464
  }), {
361
465
  docked: o,
362
- orientation: l,
363
- isDragging: n,
364
- movement: u,
466
+ orientation: n,
467
+ isDragging: l,
468
+ movement: i,
365
469
  position: m
366
470
  };
367
471
  }
368
- function Ne(e, a, t, o) {
369
- const l = f(null), n = f(null), u = f(null), m = f(null);
370
- return y(e, (s, c) => {
371
- l.value = c;
372
- }), y(a, (s, c) => {
373
- n.value = c;
374
- }), y(t, (s, c) => {
375
- u.value = c;
376
- }), y(o, (s, c) => {
377
- m.value = c;
472
+ function qe(e, u, t, o) {
473
+ const n = g(null), l = g(null), i = g(null), m = g(null);
474
+ return E(e, (a, r) => {
475
+ n.value = r;
476
+ }), E(u, (a, r) => {
477
+ l.value = r;
478
+ }), E(t, (a, r) => {
479
+ i.value = r;
480
+ }), E(o, (a, r) => {
481
+ m.value = r;
378
482
  }), {
379
- lastLeft: l,
380
- lastTop: n,
381
- lastWidth: u,
483
+ lastLeft: n,
484
+ lastTop: l,
485
+ lastWidth: i,
382
486
  lastHeight: m
383
487
  };
384
488
  }
385
- function Fe(e, a, t, o) {
386
- const l = f(e.value.width), n = f(e.value.left), u = p(() => e.value.width), m = p(() => e.value.left), s = p(() => t.value ? t.value.x : null);
387
- return y([u, m], ([c, v]) => {
388
- (l.value == null || n.value == null || a.value) && (l.value = c, n.value = v);
389
- }), y(s, (c) => {
390
- o.value && t.value && (n.value = c);
391
- }), { left: n, width: l };
489
+ function Je(e, u, t, o) {
490
+ const n = g(e.value.width), l = g(e.value.left), i = M(() => e.value.width), m = M(() => e.value.left), a = M(() => t.value ? t.value.x : null);
491
+ return E([i, m], ([r, p]) => {
492
+ (n.value == null || l.value == null || u.value) && (n.value = r, l.value = p);
493
+ }), E(a, (r) => {
494
+ o.value && t.value && (l.value = r);
495
+ }), { left: l, width: n };
392
496
  }
393
- function Ge(e, a = f({ left: 0, right: 0, top: 0, bottom: 0 })) {
394
- const t = f({});
497
+ function Ke(e, u = g({ left: 0, right: 0, top: 0, bottom: 0 })) {
498
+ const t = g({});
395
499
  let o = !1;
396
- const l = () => {
500
+ const n = () => {
397
501
  if (!o && e.value) {
398
- const n = e.value.getBoundingClientRect();
399
- t.value.left = Math.max(n.left, a.value.left), t.value.top = Math.max(n.top, a.value.top), t.value.width = n.width, t.value.height = n.height, o = !0;
502
+ const l = e.value.getBoundingClientRect();
503
+ t.value.left = Math.max(l.left, u.value.left), t.value.top = Math.max(l.top, u.value.top), t.value.width = l.width, t.value.height = l.height, o = !0;
400
504
  }
401
505
  };
402
- return W(() => {
403
- e.value && l();
404
- }), y(e, (n) => {
405
- n && l();
506
+ return D(() => {
507
+ e.value && n();
508
+ }), E(e, (l) => {
509
+ l && n();
406
510
  }), {
407
511
  isIntialized: o,
408
512
  initialRect: t
409
513
  };
410
514
  }
411
- function je(e, a = f(!1), t = f(!1), o = f({ left: 0, right: 0, top: 0, bottom: 0 }), l = { width: 20, height: 40 }) {
412
- const { initialRect: n } = Ge(e, o), u = f(!1);
413
- let m = 0, s = 0, c = 0, v = 0, _ = 0;
414
- const r = 5, h = f(null), d = (T) => {
415
- if (!(!e.value || a.value))
416
- if (u.value) {
417
- const i = T.clientX - v, L = T.clientY - _;
418
- if (h.value === "left" || h.value === "left-bottom-corner") {
419
- const w = s - i;
420
- w > l.width && (n.value.width = w, n.value.left = m + i, e.value.style.left = n.value.left + "px", e.value.style.width = n.value.width + "px");
515
+ function Qe(e, u = g(!1), t = g(!1), o = g({ left: 0, right: 0, top: 0, bottom: 0 }), n = { width: 20, height: 40 }) {
516
+ const { initialRect: l } = Ke(e, o), i = g(!1);
517
+ let m = 0, a = 0, r = 0, p = 0, L = 0;
518
+ const c = 5, b = g(null), h = (C) => {
519
+ if (!(!e.value || u.value))
520
+ if (i.value) {
521
+ const s = C.clientX - p, f = C.clientY - L;
522
+ if (b.value === "left" || b.value === "left-bottom-corner") {
523
+ const y = a - s;
524
+ y > n.width && (l.value.width = y, l.value.left = m + s, e.value.style.left = l.value.left + "px", e.value.style.width = l.value.width + "px");
421
525
  }
422
- if (h.value === "right" || h.value === "right-bottom-corner") {
423
- const w = s + i;
424
- w > l.width && (n.value.width = w, e.value.style.width = n.value.width + "px");
526
+ if (b.value === "right" || b.value === "right-bottom-corner") {
527
+ const y = a + s;
528
+ y > n.width && (l.value.width = y, e.value.style.width = l.value.width + "px");
425
529
  }
426
- if (h.value === "bottom" || h.value === "left-bottom-corner" || h.value === "right-bottom-corner") {
427
- const w = c + L;
428
- w > l.height && (n.value.height = w, e.value.style.height = n.value.height + "px");
530
+ if (b.value === "bottom" || b.value === "left-bottom-corner" || b.value === "right-bottom-corner") {
531
+ const y = r + f;
532
+ y > n.height && (l.value.height = y, e.value.style.height = l.value.height + "px");
429
533
  }
430
534
  } else {
431
- const i = e.value.getBoundingClientRect(), L = T.clientX - i.left, w = T.clientY - i.top, g = L <= r, z = L >= i.width - r, x = w >= i.height - r;
432
- g && x && t.value ? (e.value.style.cursor = "nesw-resize", h.value = "left-bottom-corner") : z && x && !t.value ? (e.value.style.cursor = "nwse-resize", h.value = "right-bottom-corner") : g && t.value ? (e.value.style.cursor = "ew-resize", h.value = "left") : z && !t.value ? (e.value.style.cursor = "ew-resize", h.value = "right") : x ? (e.value.style.cursor = "ns-resize", h.value = "bottom") : (e.value.style.cursor = "", h.value = null);
535
+ const s = e.value.getBoundingClientRect(), f = C.clientX - s.left, y = C.clientY - s.top, v = Math.abs(f) <= c, z = Math.abs(s.width - f) <= c, w = Math.abs(s.height - y) <= c;
536
+ v && w && t.value ? (e.value.style.cursor = "nesw-resize", b.value = "left-bottom-corner") : z && w && !t.value ? (e.value.style.cursor = "nwse-resize", b.value = "right-bottom-corner") : v && t.value ? (e.value.style.cursor = "ew-resize", b.value = "left") : z && !t.value ? (e.value.style.cursor = "ew-resize", b.value = "right") : w ? (e.value.style.cursor = "ns-resize", b.value = "bottom") : (e.value.style.cursor = "", b.value = null);
433
537
  }
434
- }, M = (T) => {
435
- if (!e.value || !h.value) return;
436
- const i = e.value.getBoundingClientRect();
437
- v = T.clientX, _ = T.clientY, s = i.width, c = i.height, m = i.left, n.value.width = s, n.value.height = c, n.value.left = i.left, n.value.top = i.top, u.value = !0, document.addEventListener("mousemove", d), document.addEventListener("mouseup", E);
438
- }, E = () => {
439
- u.value = !1, h.value = null, e.value && (e.value.style.cursor = ""), document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", E);
440
- }, k = () => {
441
- e.value && (e.value.removeEventListener("mousedown", M), e.value.removeEventListener("mousemove", d)), document.removeEventListener("mouseup", E);
442
- }, I = () => {
443
- e.value && (e.value.addEventListener("mousedown", M), e.value.addEventListener("mousemove", d));
538
+ }, T = (C) => {
539
+ if (!e.value || !b.value) return;
540
+ const s = e.value.getBoundingClientRect();
541
+ p = C.clientX, L = C.clientY, a = s.width, r = s.height, m = s.left, l.value.width = a, l.value.height = r, l.value.left = s.left, l.value.top = s.top, i.value = !0, document.addEventListener("mousemove", h), document.addEventListener("mouseup", d);
542
+ }, d = () => {
543
+ i.value = !1, b.value = null, e.value && (e.value.style.cursor = ""), document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", d);
544
+ }, $ = () => {
545
+ e.value && (e.value.removeEventListener("mousedown", T), e.value.removeEventListener("mousemove", h)), document.removeEventListener("mouseup", d);
546
+ }, W = () => {
547
+ e.value && (e.value.addEventListener("mousedown", T), e.value.addEventListener("mousemove", h));
444
548
  };
445
- return W(() => {
446
- e.value && I();
447
- }), se(() => {
448
- k();
449
- }), y(e, (T) => {
450
- T ? I() : k();
451
- }), { rect: n, isResizing: u };
549
+ return D(() => {
550
+ e.value && W();
551
+ }), ae(() => {
552
+ $();
553
+ }), E(e, (C) => {
554
+ C ? W() : $();
555
+ }), { rect: l, isResizing: i };
452
556
  }
453
- function qe(e, a, t, o) {
454
- const l = () => {
557
+ function Ze(e, u, t, o) {
558
+ const n = () => {
455
559
  if (e.value) {
456
- const s = e.value;
457
- a.value ? s.style.transition = "width 0.3s ease-out, left 0.3s ease-out" : s.style.transition = "width 0.3s ease";
560
+ const a = e.value;
561
+ u.value ? a.style.transition = "width 0.3s ease-out, left 0.3s ease-out" : a.style.transition = "width 0.3s ease";
458
562
  }
459
- }, n = () => {
563
+ }, l = () => {
460
564
  e.value && (e.value.style.transition = "");
461
- }, u = () => {
462
- e.value && e.value.removeEventListener("transitionend", n);
565
+ }, i = () => {
566
+ e.value && e.value.removeEventListener("transitionend", l);
463
567
  }, m = () => {
464
- e.value && e.value.addEventListener("transitionend", n);
568
+ e.value && e.value.addEventListener("transitionend", l);
465
569
  };
466
- W(() => {
467
- e.value && e.value.addEventListener("transitionend", n);
468
- }), se(() => {
469
- e.value && e.value.removeEventListener("transitionend", n);
470
- }), y(e, (s) => {
471
- s ? m() : u();
472
- }), y(t, () => {
473
- l();
474
- }), y(o, () => {
475
- l();
570
+ D(() => {
571
+ e.value && e.value.addEventListener("transitionend", l);
572
+ }), ae(() => {
573
+ e.value && e.value.removeEventListener("transitionend", l);
574
+ }), E(e, (a) => {
575
+ a ? m() : i();
576
+ }), E(t, () => {
577
+ n();
578
+ }), E(o, () => {
579
+ n();
476
580
  });
477
581
  }
478
- function Je(e, a, t, o) {
479
- const l = f(window.innerWidth), n = f(window.innerHeight), { docked: u, orientation: m, movement: s, position: c, isDragging: v } = Ue(
582
+ function Pe(e, u, t, o) {
583
+ const n = g(window.innerWidth), l = g(window.innerHeight), { docked: i, orientation: m, movement: a, position: r, isDragging: p } = je(
480
584
  e,
481
- a,
585
+ u,
482
586
  o
483
- ), _ = p(() => m.value === "right"), { rect: r, isResizing: h } = je(
587
+ ), L = M(() => m.value === "right"), { rect: c, isResizing: b } = Qe(
484
588
  e,
485
589
  t,
486
- _,
590
+ L,
487
591
  o.value.offset
488
- ), { width: d, left: M } = Fe(
489
- r,
490
- h,
592
+ ), { width: h, left: T } = Je(
491
593
  c,
492
- v
493
- ), { lastTop: E, lastHeight: k } = Ne(
494
- p(() => r.value.left),
495
- p(() => r.value.top),
496
- p(() => r.value.width),
497
- p(() => r.value.height)
498
- ), { autoOpened: I } = Oe(e, a, t);
499
- qe(e, _, t, I);
500
- const T = (g) => {
594
+ b,
595
+ r,
596
+ p
597
+ ), { lastTop: d, lastHeight: $ } = qe(
598
+ M(() => c.value.left),
599
+ M(() => c.value.top),
600
+ M(() => c.value.width),
601
+ M(() => c.value.height)
602
+ ), { autoOpened: W } = Fe(e, u, t);
603
+ Ze(e, L, t, W);
604
+ const C = (v) => {
501
605
  if (e.value) {
502
- const z = e.value.getBoundingClientRect(), x = z.left + g;
503
- if (_.value) {
504
- r.value.left = x;
505
- const ie = window.innerWidth - z.width - z.left;
506
- z.left <= 0 && ie >= 0 && g < 0 && (r.value.left = Math.max(0, x)), window.innerWidth - z.width <= 0 && (r.value.left = window.innerWidth - z.width);
606
+ const z = e.value.getBoundingClientRect(), w = z.left + v;
607
+ if (L.value) {
608
+ c.value.left = w;
609
+ const S = window.innerWidth - z.width - z.left;
610
+ z.left <= 0 && S >= 0 && v < 0 && (c.value.left = Math.max(0, w)), window.innerWidth - z.width <= 0 && (c.value.left = window.innerWidth - z.width);
507
611
  } else
508
- z.left + z.width >= window.innerWidth && g < 0 && (r.value.left = Math.max(0, x));
612
+ z.left + z.width >= window.innerWidth && v < 0 && (c.value.left = Math.max(0, w));
509
613
  }
510
- }, i = () => {
511
- const g = window.innerWidth - l.value;
512
- l.value = window.innerWidth, n.value = window.innerHeight, T(g);
614
+ }, s = () => {
615
+ const v = window.innerWidth - n.value;
616
+ n.value = window.innerWidth, l.value = window.innerHeight, C(v);
513
617
  };
514
- W(() => {
515
- window.addEventListener("resize", i);
516
- }), q(() => {
517
- window.removeEventListener("resize", i);
618
+ D(() => {
619
+ window.addEventListener("resize", s);
620
+ }), Q(() => {
621
+ window.removeEventListener("resize", s);
518
622
  });
519
- const L = (g) => {
520
- g ? (r.value.width = Z, _.value && M.value && d.value && (r.value.left = M.value + d.value - Z)) : (r.value.width = d.value, _.value && M.value && d.value && (r.value.left = M.value));
521
- }, w = () => {
522
- u.value ? (r.value.top = o.value.offset.value.top, r.value.height = window.innerHeight - o.value.offset.value.top - o.value.offset.value.bottom) : (r.value.top = E.value, r.value.height = k.value);
623
+ const f = (v) => {
624
+ v ? (c.value.width = te, L.value && T.value && h.value && (c.value.left = T.value + h.value - te)) : (c.value.width = h.value, L.value && T.value && h.value && (c.value.left = T.value));
625
+ }, y = () => {
626
+ i.value ? (c.value.top = o.value.offset.value.top, c.value.height = window.innerHeight - o.value.offset.value.top - o.value.offset.value.bottom) : (c.value.top = d.value, c.value.height = $.value);
523
627
  };
524
- return y(u, () => {
525
- w();
526
- }), y(t, (g) => {
527
- L(g);
528
- }), y(I, (g) => {
529
- t.value && !v.value && L(!g);
530
- }), y(s, (g) => {
531
- if (g && e.value) {
532
- const x = e.value.getBoundingClientRect();
533
- r.value.left = x.left, r.value.top = x.top;
628
+ return E(i, () => {
629
+ y();
630
+ }), E(t, (v) => {
631
+ f(v);
632
+ }), E(W, (v) => {
633
+ t.value && !p.value && f(!v);
634
+ }), E(a, (v) => {
635
+ if (v && e.value) {
636
+ const w = e.value.getBoundingClientRect();
637
+ c.value.left = w.left, c.value.top = w.top;
534
638
  }
535
- }), { rect: r, orientation: m, reversed: _ };
639
+ }), { rect: c, orientation: m, reversed: L };
536
640
  }
537
- const Ke = (e) => (te("data-v-43098ce9"), e = e(), ne(), e), Qe = /* @__PURE__ */ Ke(() => /* @__PURE__ */ B("svg", {
641
+ const Re = (e) => (oe("data-v-cd1a3c67"), e = e(), se(), e), et = /* @__PURE__ */ Re(() => /* @__PURE__ */ k("svg", {
538
642
  xmlns: "http://www.w3.org/2000/svg",
539
643
  width: "1em",
540
644
  height: "1em",
541
645
  viewBox: "0 0 1024 1024"
542
646
  }, [
543
- /* @__PURE__ */ B("path", {
647
+ /* @__PURE__ */ k("path", {
544
648
  fill: "currentColor",
545
649
  d: "M764.288 214.592L512 466.88L259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512L214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
546
650
  })
547
- ], -1)), Ze = { class: "ml-tool-palette-title" }, Pe = { class: "ml-tool-palette-content" }, Re = {
651
+ ], -1)), tt = { class: "ml-tool-palette-title" }, lt = { class: "ml-tool-palette-content" }, nt = {
548
652
  key: 1,
549
653
  class: "ml-tool-palette-default-content"
550
- }, et = /* @__PURE__ */ Y({
654
+ }, ot = /* @__PURE__ */ H({
551
655
  __name: "MlToolPalette",
552
- props: /* @__PURE__ */ D({
656
+ props: /* @__PURE__ */ A({
553
657
  title: { default: "" },
554
658
  tabs: { default: void 0 },
555
659
  leftOffset: { default: 0 },
556
660
  rightOffset: { default: 0 },
557
661
  topOffset: { default: 0 },
558
- bottomOffset: { default: 0 }
662
+ bottomOffset: { default: 0 },
663
+ disabled: { type: Boolean, default: !1 }
559
664
  }, {
560
665
  modelValue: { default: !0 },
561
666
  modelModifiers: {},
562
667
  activeTab: { default: "" },
563
668
  activeTabModifiers: {}
564
669
  }),
565
- emits: /* @__PURE__ */ D(["close", "tab-change", "tab-close"], ["update:modelValue", "update:activeTab"]),
566
- setup(e, { emit: a }) {
567
- const t = e, o = H(e, "modelValue"), l = H(e, "activeTab"), n = a, u = p(() => t.tabs && t.tabs.length > 0);
568
- W(() => {
569
- u.value && !l.value && t.tabs && t.tabs.length > 0 && (l.value = t.tabs[0].name);
570
- }), y(() => t.tabs, (i) => {
571
- i && i.length > 0 && !l.value && (l.value = i[0].name);
572
- }, { immediate: !0 });
573
- const m = f(!1), s = f(null), c = f(null), v = p(() => ({
574
- offset: f({
670
+ emits: /* @__PURE__ */ A(["close", "tab-change", "tab-close"], ["update:modelValue", "update:activeTab"]),
671
+ setup(e, { emit: u }) {
672
+ const t = e, o = G(e, "modelValue"), n = G(e, "activeTab"), l = u, i = M(() => t.tabs && t.tabs.length > 0);
673
+ D(() => {
674
+ i.value && !n.value && t.tabs && t.tabs.length > 0 && (n.value = t.tabs[0].name);
675
+ }), E(
676
+ () => t.tabs,
677
+ (s) => {
678
+ s && s.length > 0 && !n.value && (n.value = s[0].name);
679
+ },
680
+ { immediate: !0 }
681
+ );
682
+ const m = g(!1), a = g(null), r = g(null), p = M(() => ({
683
+ offset: g({
575
684
  left: t.leftOffset,
576
685
  right: t.rightOffset,
577
686
  top: t.topOffset,
578
687
  bottom: t.bottomOffset
579
688
  })
580
689
  })), {
581
- rect: _,
582
- orientation: r,
583
- reversed: h
584
- } = Je(c, s, m, v), d = p(() => ({
585
- left: `${_.value.left}px`,
586
- top: `${_.value.top}px`,
587
- width: `${_.value.width}px`,
588
- height: `${_.value.height}px`
589
- })), M = p(() => h.value ? {
590
- borderLeft: "1px solid var(--el-border-color)",
591
- borderRight: null
592
- } : {
593
- borderLeft: null,
594
- borderRight: "1px solid var(--el-border-color)"
595
- }), E = p(() => {
596
- if (u.value && l.value && t.tabs) {
597
- const i = t.tabs.find((L) => L.name === l.value);
598
- if (i && i.title)
599
- return i.title;
690
+ rect: L,
691
+ orientation: c,
692
+ reversed: b
693
+ } = Pe(r, a, m, p), h = M(() => ({
694
+ left: `${L.value.left}px`,
695
+ top: `${L.value.top}px`,
696
+ width: `${L.value.width}px`,
697
+ height: `${L.value.height}px`
698
+ })), T = M(
699
+ () => b.value ? { borderLeft: "1px solid var(--el-border-color)", borderRight: null } : { borderLeft: null, borderRight: "1px solid var(--el-border-color)" }
700
+ ), d = M(() => {
701
+ if (i.value && n.value && t.tabs) {
702
+ const s = t.tabs.find((f) => f.name === n.value);
703
+ if (s != null && s.title) return s.title;
600
704
  }
601
705
  return t.title;
602
- }), k = () => {
706
+ }), $ = () => {
603
707
  o.value = !1;
604
- const i = c.value;
605
- n("close", {
606
- x: i ? i.clientLeft : 0,
607
- y: i ? i.clientTop : 0
708
+ const s = r.value;
709
+ l("close", {
710
+ x: s ? s.clientLeft : 0,
711
+ y: s ? s.clientTop : 0
608
712
  });
609
- }, I = (i) => {
610
- n("tab-change", i);
611
- }, T = (i) => {
612
- if (n("tab-close", i), l.value === i && t.tabs) {
613
- const L = t.tabs.findIndex((w) => w.name === i);
614
- if (L >= 0) {
615
- const w = t.tabs[L + 1] || t.tabs[L - 1];
616
- w && (l.value = w.name);
713
+ }, W = (s) => {
714
+ l("tab-change", s);
715
+ }, C = (s) => {
716
+ if (l("tab-close", s), n.value === s && t.tabs) {
717
+ const f = t.tabs.findIndex((y) => y.name === s);
718
+ if (f >= 0) {
719
+ const y = t.tabs[f + 1] || t.tabs[f - 1];
720
+ y && (n.value = y.name);
617
721
  }
618
722
  }
619
723
  };
620
- return (i, L) => {
621
- const w = U, g = ve, z = de;
622
- return o.value ? (b(), V("div", {
724
+ return (s, f) => {
725
+ const y = J, v = me, z = he;
726
+ return o.value ? (_(), V("div", {
623
727
  key: 0,
624
728
  ref_key: "toolPaletteElement",
625
- ref: c,
626
- style: N([d.value]),
627
- class: "ml-tool-palette-dialog"
729
+ ref: r,
730
+ style: X([h.value]),
731
+ class: Z(["ml-tool-palette-dialog", { "ml-tool-palette-disabled": s.disabled }])
628
732
  }, [
629
- B("div", {
630
- class: le(["ml-tool-palette-dialog-layout", J(r)])
733
+ k("div", {
734
+ class: Z(["ml-tool-palette-dialog-layout", P(c)])
631
735
  }, [
632
- B("div", {
736
+ k("div", {
633
737
  ref_key: "titleBarElement",
634
- ref: s,
738
+ ref: a,
635
739
  class: "ml-tool-palette-title-bar",
636
- style: N(M.value)
740
+ style: X(T.value)
637
741
  }, [
638
- S(w, {
742
+ I(y, {
639
743
  size: 18,
640
744
  class: "ml-tool-palette-dialog-icon",
641
- onClick: k
745
+ onClick: f[0] || (f[0] = (w) => !s.disabled && $())
642
746
  }, {
643
- default: C(() => [
644
- Qe
747
+ default: x(() => [
748
+ et
645
749
  ]),
646
750
  _: 1
647
751
  }),
648
- S(ye, {
752
+ I(ze, {
649
753
  class: "ml-tool-palette-dialog-icon",
650
754
  modelValue: m.value,
651
- "onUpdate:modelValue": L[0] || (L[0] = (x) => m.value = x),
652
- reverse: J(h)
653
- }, null, 8, ["modelValue", "reverse"]),
654
- B("span", Ze, O(E.value), 1)
755
+ "onUpdate:modelValue": f[1] || (f[1] = (w) => m.value = w),
756
+ reverse: P(b),
757
+ disabled: s.disabled
758
+ }, null, 8, ["modelValue", "reverse", "disabled"]),
759
+ k("span", tt, Y(d.value), 1)
655
760
  ], 4),
656
- B("div", Pe, [
657
- u.value ? (b(), $(z, {
761
+ k("div", lt, [
762
+ i.value ? (_(), B(z, {
658
763
  key: 0,
659
- modelValue: l.value,
660
- "onUpdate:modelValue": L[1] || (L[1] = (x) => l.value = x),
764
+ modelValue: n.value,
765
+ "onUpdate:modelValue": f[2] || (f[2] = (w) => n.value = w),
661
766
  type: "border-card",
662
767
  class: "ml-tool-palette-tabs",
663
- onTabRemove: T,
664
- onTabChange: I
768
+ onTabRemove: f[3] || (f[3] = (w) => !s.disabled && C),
769
+ onTabChange: f[4] || (f[4] = (w) => !s.disabled && W)
665
770
  }, {
666
- default: C(() => [
667
- (b(!0), V(G, null, j(t.tabs, (x) => (b(), $(g, {
668
- key: x.name,
669
- name: x.name,
670
- label: x.label
771
+ default: x(() => [
772
+ (_(!0), V(O, null, j(t.tabs, (w) => (_(), B(v, {
773
+ key: w.name,
774
+ name: w.name,
775
+ label: w.label
671
776
  }, {
672
- label: C(() => [
673
- B("span", null, O(x.label), 1)
777
+ label: x(() => [
778
+ k("span", null, Y(w.label), 1)
674
779
  ]),
675
- default: C(() => [
676
- X(i.$slots, `tab-${x.name}`, {}, void 0, !0)
780
+ default: x(() => [
781
+ q(s.$slots, `tab-${w.name}`, {}, void 0, !0)
677
782
  ]),
678
783
  _: 2
679
784
  }, 1032, ["name", "label"]))), 128))
680
785
  ]),
681
786
  _: 3
682
- }, 8, ["modelValue"])) : (b(), V("div", Re, [
683
- X(i.$slots, "default", {}, void 0, !0)
787
+ }, 8, ["modelValue"])) : (_(), V("div", nt, [
788
+ q(s.$slots, "default", {}, void 0, !0)
684
789
  ]))
685
790
  ])
686
791
  ], 2)
687
- ], 4)) : oe("", !0);
792
+ ], 6)) : F("", !0);
688
793
  };
689
794
  }
690
- }), tt = /* @__PURE__ */ A(et, [["__scopeId", "data-v-43098ce9"]]), ht = {
795
+ }), st = /* @__PURE__ */ U(ot, [["__scopeId", "data-v-cd1a3c67"]]), bt = {
691
796
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
692
797
  install(e) {
693
- e.component("MlCollapse", F), e.component("MlDropdown", F), e.component("MlLanguage", Ce), e.component("MlStatusBar", We), e.component("MlToggleButton", Se), e.component("MlToolBar", He), e.component("MlToolPalette", tt);
798
+ e.component("MlCollapse", K), e.component("MlDropdown", K), e.component("MlLanguage", Be), e.component("MlStatusBar", De), e.component("MlToggleButton", Ae), e.component("MlToolBar", Ne), e.component("MlToolPalette", st);
694
799
  }
695
800
  };
696
801
  export {
697
- ye as MlCollapse,
698
- F as MlDropdown,
699
- Ce as MlLanguage,
700
- We as MlStatusBar,
701
- Se as MlToggleButton,
702
- He as MlToolBar,
703
- tt as MlToolPalette,
704
- ht as default
802
+ ze as MlCollapse,
803
+ K as MlDropdown,
804
+ Be as MlLanguage,
805
+ De as MlStatusBar,
806
+ Ae as MlToggleButton,
807
+ Ne as MlToolBar,
808
+ st as MlToolPalette,
809
+ bt as default
705
810
  };