@mlightcad/ui-components 0.0.15 → 0.1.0

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.
package/README.md CHANGED
@@ -9,6 +9,8 @@ The following components are included in this package.
9
9
  - Tool Palette: one dockable, resizable, and floating window, which is quite similar to AutoCAD Tool Palette.
10
10
  - Toolbar: one toolbar which can be easily customized by one array of button data.
11
11
 
12
+ You can play with them through [this live demo](https://mlight-lee.github.io/ui-components/).
13
+
12
14
  ### Tool Palette
13
15
 
14
16
  AutoCAD uses [tool palettes](https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-167A8594-92CB-4FCC-B72C-0F546383E97C) to organize blocks, hatches, and custom tools in a tabbed window. Tool Palette component is quite similar to one in AutoCAD. It supports the following features.
@@ -1,81 +1,81 @@
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-vertical-toolbar-button-group[data-v-d5511111]{display:flex;flex-direction:column}.ml-horizontal-toolbar-button-group[data-v-d5511111]{display:flex;flex-direction:row}.ml-toolbar-button[data-v-d5511111]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px}.ml-toolbar-button-text[data-v-d5511111]{margin-left:0;margin-top:5px}.ml-tool-palette-dialog[data-v-11a64c54]{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-11a64c54]{border-bottom:1px solid var(--el-border-color)}.ml-tool-palette-dialog-layout[data-v-11a64c54]{display:flex;height:100%}.ml-tool-palette-title-bar[data-v-11a64c54]{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-11a64c54]{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-11a64c54]{-webkit-user-select:none;user-select:none;flex-grow:1;display:flex;justify-content:space-around;background-color:var(--el-fill-color);overflow:hidden}.ml-tool-palette-dialog-layout.left .ml-tool-palette-title-bar[data-v-11a64c54]{order:1}.ml-tool-palette-dialog-layout.left .ml-tool-palette-content[data-v-11a64c54],.ml-tool-palette-dialog-layout.right .ml-tool-palette-title-bar[data-v-11a64c54]{order:2}.ml-tool-palette-dialog-layout.right .ml-tool-palette-content[data-v-11a64c54]{order:1}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- import { ElIcon as A, ElDropdownItem as se, ElDropdownMenu as ie, ElDropdown as ue, ElButton as ae, ElTooltip as ce, ElButtonGroup as re } 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-b676e93b]{border:none;padding:0;cursor:pointer;width:var(--0547f26d);height:var(--0547f26d)}.ml-vertical-toolbar-button-group[data-v-5261c686]{display:flex;flex-direction:column}.ml-horizontal-toolbar-button-group[data-v-5261c686]{display:flex;flex-direction:row}.ml-toolbar-button[data-v-5261c686]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px}.ml-toolbar-button-text[data-v-5261c686]{margin-left:0;margin-top:5px}.ml-tool-palette-dialog[data-v-8645db4f]{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-8645db4f]{border-bottom:1px solid var(--el-border-color);cursor:default}.ml-tool-palette-dialog-icon[data-v-8645db4f]:hover{color:var(--el-color-primary)}.ml-tool-palette-dialog-layout[data-v-8645db4f]{display:flex;height:100%}.ml-tool-palette-title-bar[data-v-8645db4f]{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-8645db4f]{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-8645db4f]{-webkit-user-select:none;user-select:none;flex-grow:1;display:flex;justify-content:space-around;background-color:var(--el-fill-color);overflow:hidden}.ml-tool-palette-dialog-layout.left .ml-tool-palette-title-bar[data-v-8645db4f]{order:1}.ml-tool-palette-dialog-layout.left .ml-tool-palette-content[data-v-8645db4f],.ml-tool-palette-dialog-layout.right .ml-tool-palette-title-bar[data-v-8645db4f]{order:2}.ml-tool-palette-dialog-layout.right .ml-tool-palette-content[data-v-8645db4f]{order:1}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ import { ElIcon as H, ElDropdownItem as ue, ElDropdownMenu as ae, ElDropdown as ce, ElButton as Q, ElTooltip as Z, ElButtonGroup as re } 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 y, createElementBlock as I, createElementVNode as z, defineComponent as V, mergeModels as Y, useModel as K, computed as g, createBlock as W, withCtx as k, resolveDynamicComponent as Q, createVNode as S, Fragment as Z, renderList as P, createTextVNode as ve, toDisplayString as U, pushScopeId as R, popScopeId as ee, renderSlot as O, normalizeClass as te, normalizeStyle as X, createCommentVNode as ne, ref as m, onMounted as D, onUnmounted as F, watch as L, onBeforeUnmount as le, unref as G } from "vue";
5
+ import { openBlock as M, createElementBlock as I, createElementVNode as E, defineComponent as S, mergeModels as V, useModel as U, computed as p, createBlock as $, withCtx as B, resolveDynamicComponent as P, createVNode as D, Fragment as R, renderList as ee, createTextVNode as ve, toDisplayString as F, pushScopeId as te, popScopeId as ne, renderSlot as O, useCssVars as de, normalizeClass as le, normalizeStyle as X, createCommentVNode as oe, ref as m, onMounted as Y, onUnmounted as G, watch as L, onBeforeUnmount as se, unref as j } 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
- import "element-plus/es/components/button-group/style/css";
10
9
  import "element-plus/es/components/tooltip/style/css";
11
10
  import "element-plus/es/components/button/style/css";
12
- const de = {
11
+ import "element-plus/es/components/button-group/style/css";
12
+ const me = {
13
13
  xmlns: "http://www.w3.org/2000/svg",
14
14
  width: "1em",
15
15
  height: "1em",
16
16
  viewBox: "0 0 1024 1024"
17
- }, me = /* @__PURE__ */ z("path", {
17
+ }, he = /* @__PURE__ */ E("path", {
18
18
  fill: "currentColor",
19
19
  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"
20
- }, null, -1), he = [
21
- me
20
+ }, null, -1), fe = [
21
+ he
22
22
  ];
23
- function fe(e, s) {
24
- return y(), I("svg", de, [...he]);
23
+ function pe(e, s) {
24
+ return M(), I("svg", me, [...fe]);
25
25
  }
26
- const j = { render: fe }, pe = {
26
+ const q = { render: pe }, _e = {
27
27
  xmlns: "http://www.w3.org/2000/svg",
28
28
  width: "1em",
29
29
  height: "1em",
30
30
  viewBox: "0 0 1024 1024"
31
- }, we = /* @__PURE__ */ z("path", {
31
+ }, we = /* @__PURE__ */ E("path", {
32
32
  fill: "currentColor",
33
33
  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"
34
- }, null, -1), _e = [
34
+ }, null, -1), ge = [
35
35
  we
36
36
  ];
37
- function ge(e, s) {
38
- return y(), I("svg", pe, [..._e]);
37
+ function Le(e, s) {
38
+ return M(), I("svg", _e, [...ge]);
39
39
  }
40
- const q = { render: ge }, Le = /* @__PURE__ */ V({
40
+ const J = { render: Le }, xe = /* @__PURE__ */ S({
41
41
  __name: "MlCollapse",
42
- props: /* @__PURE__ */ Y({
42
+ props: /* @__PURE__ */ V({
43
43
  size: { default: 18 },
44
44
  reverse: { type: Boolean, default: !1 }
45
45
  }, {
46
46
  modelValue: { default: !0 },
47
47
  modelModifiers: {}
48
48
  }),
49
- emits: /* @__PURE__ */ Y(["change"], ["update:modelValue"]),
49
+ emits: /* @__PURE__ */ V(["change"], ["update:modelValue"]),
50
50
  setup(e, { emit: s }) {
51
- const t = e, o = K(e, "modelValue"), l = s, n = g(() => t.reverse ? o.value ? j : q : o.value ? q : j), u = g(() => `${t.size}px`), d = () => {
51
+ const t = e, o = U(e, "modelValue"), l = s, n = p(() => t.reverse ? o.value ? q : J : o.value ? J : q), u = p(() => `${t.size}px`), d = () => {
52
52
  l("change", o.value), o.value = !o.value;
53
53
  };
54
54
  return (i, a) => {
55
- const r = A;
56
- return y(), W(r, {
55
+ const r = H;
56
+ return M(), $(r, {
57
57
  size: u.value,
58
58
  onClick: d
59
59
  }, {
60
- default: k(() => [
61
- (y(), W(Q(n.value)))
60
+ default: B(() => [
61
+ (M(), $(P(n.value)))
62
62
  ]),
63
63
  _: 1
64
64
  }, 8, ["size"]);
65
65
  };
66
66
  }
67
- }), xe = (e) => (R("data-v-3fc33b5d"), e = e(), ee(), e), ye = /* @__PURE__ */ xe(() => /* @__PURE__ */ z("svg", {
67
+ }), Me = (e) => (te("data-v-3fc33b5d"), e = e(), ne(), e), be = /* @__PURE__ */ Me(() => /* @__PURE__ */ E("svg", {
68
68
  preserveAspectRatio: "xMidYMid meet",
69
69
  viewBox: "0 0 24 24",
70
70
  width: "1.2em",
71
71
  height: "1.2em",
72
72
  "data-v-63d067da": ""
73
73
  }, [
74
- /* @__PURE__ */ z("path", {
74
+ /* @__PURE__ */ E("path", {
75
75
  fill: "currentColor",
76
76
  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"
77
77
  })
78
- ], -1)), Me = /* @__PURE__ */ V({
78
+ ], -1)), ye = /* @__PURE__ */ S({
79
79
  __name: "MlDropdown",
80
80
  props: {
81
81
  icon: {},
@@ -86,21 +86,21 @@ const q = { render: ge }, Le = /* @__PURE__ */ V({
86
86
  click: null
87
87
  },
88
88
  setup(e, { emit: s }) {
89
- const t = e, o = s, l = g(() => t.items.filter((u) => u.name !== t.current)), n = (u) => {
89
+ const t = e, o = s, l = p(() => t.items.filter((u) => u.name !== t.current)), n = (u) => {
90
90
  o("click", u);
91
91
  };
92
92
  return (u, d) => {
93
- const i = A, a = se, r = ie, w = ue;
94
- return y(), W(w, { onCommand: n }, {
95
- dropdown: k(() => [
96
- S(r, null, {
97
- default: k(() => [
98
- (y(!0), I(Z, null, P(l.value, (c) => (y(), W(a, {
93
+ const i = H, a = ue, r = ae, _ = ce;
94
+ return M(), $(_, { onCommand: n }, {
95
+ dropdown: B(() => [
96
+ D(r, null, {
97
+ default: B(() => [
98
+ (M(!0), I(R, null, ee(l.value, (c) => (M(), $(a, {
99
99
  key: c.text,
100
100
  command: c.name
101
101
  }, {
102
- default: k(() => [
103
- ve(U(c.text), 1)
102
+ default: B(() => [
103
+ ve(F(c.text), 1)
104
104
  ]),
105
105
  _: 2
106
106
  }, 1032, ["command"]))), 128))
@@ -108,13 +108,13 @@ const q = { render: ge }, Le = /* @__PURE__ */ V({
108
108
  _: 1
109
109
  })
110
110
  ]),
111
- default: k(() => [
112
- S(i, {
111
+ default: B(() => [
112
+ D(i, {
113
113
  size: "30",
114
114
  class: "ml-dropdown-icon"
115
115
  }, {
116
- default: k(() => [
117
- ye
116
+ default: B(() => [
117
+ be
118
118
  ]),
119
119
  _: 1
120
120
  })
@@ -123,12 +123,12 @@ const q = { render: ge }, Le = /* @__PURE__ */ V({
123
123
  });
124
124
  };
125
125
  }
126
- }), H = (e, s) => {
126
+ }), A = (e, s) => {
127
127
  const t = e.__vccOpts || e;
128
128
  for (const [o, l] of s)
129
129
  t[o] = l;
130
130
  return t;
131
- }, N = /* @__PURE__ */ H(Me, [["__scopeId", "data-v-3fc33b5d"]]), Ee = '<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__ */ V({
131
+ }, N = /* @__PURE__ */ A(ye, [["__scopeId", "data-v-3fc33b5d"]]), ze = '<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>', Ee = /* @__PURE__ */ S({
132
132
  __name: "MlLanguage",
133
133
  props: {
134
134
  languages: {},
@@ -141,28 +141,62 @@ const q = { render: ge }, Le = /* @__PURE__ */ V({
141
141
  const t = e, o = s, l = (n) => {
142
142
  o("click", n);
143
143
  };
144
- return (n, u) => (y(), W(N, {
145
- icon: Ee,
144
+ return (n, u) => (M(), $(N, {
145
+ icon: ze,
146
146
  items: t.languages,
147
147
  current: t.current,
148
148
  onClick: l
149
149
  }, null, 8, ["items", "current"]));
150
150
  }
151
- }), ze = {}, Ce = { class: "ml-status-bar" }, Be = { class: "ml-status-bar-left" }, ke = { class: "ml-status-bar-right" };
151
+ }), Ce = {}, Be = { class: "ml-status-bar" }, ke = { class: "ml-status-bar-left" }, Te = { class: "ml-status-bar-right" };
152
152
  function $e(e, s) {
153
- return y(), I("div", Ce, [
154
- z("div", Be, [
153
+ return M(), I("div", Be, [
154
+ E("div", ke, [
155
155
  O(e.$slots, "left", {}, void 0, !0)
156
156
  ]),
157
- z("div", ke, [
157
+ E("div", Te, [
158
158
  O(e.$slots, "right", {}, void 0, !0)
159
159
  ])
160
160
  ]);
161
161
  }
162
- const Te = /* @__PURE__ */ H(ze, [["render", $e], ["__scopeId", "data-v-d6a59cf0"]]), We = {
162
+ const We = /* @__PURE__ */ A(Ce, [["render", $e], ["__scopeId", "data-v-d6a59cf0"]]), Ie = /* @__PURE__ */ S({
163
+ __name: "MlToggleButton",
164
+ props: /* @__PURE__ */ V({
165
+ size: { default: 30 },
166
+ data: {}
167
+ }, {
168
+ modelValue: { default: !1 },
169
+ modelModifiers: {}
170
+ }),
171
+ emits: /* @__PURE__ */ V(["click"], ["update:modelValue"]),
172
+ setup(e, { emit: s }) {
173
+ de((a) => ({
174
+ "0547f26d": u.value
175
+ }));
176
+ const t = e, o = U(e, "modelValue"), l = s, n = p(() => o.value ? t.data.onIcon : t.data.offIcon), u = p(() => t.size + "px"), d = p(() => o.value ? t.data.onTooltip : t.data.offTooltip), i = () => {
177
+ o.value = !o.value, l("click", o.value);
178
+ };
179
+ return (a, r) => {
180
+ const _ = Q, c = Z;
181
+ return M(), $(c, {
182
+ content: d.value,
183
+ "hide-after": 0
184
+ }, {
185
+ default: B(() => [
186
+ D(_, {
187
+ class: "ml-toggle-button",
188
+ icon: n.value,
189
+ onClick: i
190
+ }, null, 8, ["icon"])
191
+ ]),
192
+ _: 1
193
+ }, 8, ["content"]);
194
+ };
195
+ }
196
+ }), Ve = /* @__PURE__ */ A(Ie, [["__scopeId", "data-v-b676e93b"]]), De = {
163
197
  key: 0,
164
198
  class: "ml-toolbar-button-text"
165
- }, Ie = /* @__PURE__ */ V({
199
+ }, Se = /* @__PURE__ */ S({
166
200
  __name: "MlToolBar",
167
201
  props: {
168
202
  items: {},
@@ -173,7 +207,7 @@ const Te = /* @__PURE__ */ H(ze, [["render", $e], ["__scopeId", "data-v-d6a59cf0
173
207
  click: null
174
208
  },
175
209
  setup(e, { emit: s }) {
176
- const t = e, o = s, l = g(() => t.direction === "vertical" ? "ml-vertical-toolbar-button-group" : "ml-horizontal-toolbar-button-group"), n = g(() => t.size === "small" ? 20 : 30), u = g(() => {
210
+ const t = e, o = s, l = p(() => t.direction === "vertical" ? "ml-vertical-toolbar-button-group" : "ml-horizontal-toolbar-button-group"), n = p(() => t.size === "small" ? 20 : 30), u = p(() => {
177
211
  switch (t.size) {
178
212
  case "small":
179
213
  return 30;
@@ -181,36 +215,36 @@ const Te = /* @__PURE__ */ H(ze, [["render", $e], ["__scopeId", "data-v-d6a59cf0
181
215
  return 50;
182
216
  }
183
217
  return 70;
184
- }), d = (r) => r.description ? r.description : r.text, i = g(() => t.size === "large"), a = (r) => {
218
+ }), d = (r) => r.description ? r.description : r.text, i = p(() => t.size === "large"), a = (r) => {
185
219
  o("click", r);
186
220
  };
187
- return (r, w) => {
188
- const c = A, h = ae, v = ce, f = re;
189
- return y(), W(f, {
190
- class: te(l.value)
221
+ return (r, _) => {
222
+ const c = H, h = Q, v = Z, f = re;
223
+ return M(), $(f, {
224
+ class: le(l.value)
191
225
  }, {
192
- default: k(() => [
193
- (y(!0), I(Z, null, P(r.items, (x, C) => (y(), W(v, {
226
+ default: B(() => [
227
+ (M(!0), I(R, null, ee(r.items, (x, C) => (M(), $(v, {
194
228
  key: x.text,
195
229
  content: d(x),
196
230
  "hide-after": 0
197
231
  }, {
198
- default: k(() => [
199
- (y(), W(h, {
232
+ default: B(() => [
233
+ (M(), $(h, {
200
234
  class: "ml-toolbar-button",
201
235
  style: X({ width: u.value + "px", height: u.value + "px" }),
202
236
  key: C,
203
- onClick: (B) => a(x.command)
237
+ onClick: (k) => a(x.command)
204
238
  }, {
205
- default: k(() => [
206
- z("div", null, [
207
- S(c, { size: n.value }, {
208
- default: k(() => [
209
- (y(), W(Q(x.icon)))
239
+ default: B(() => [
240
+ E("div", null, [
241
+ D(c, { size: n.value }, {
242
+ default: B(() => [
243
+ (M(), $(P(x.icon)))
210
244
  ]),
211
245
  _: 2
212
246
  }, 1032, ["size"]),
213
- i.value ? (y(), I("div", We, U(x.text), 1)) : ne("", !0)
247
+ i.value ? (M(), I("div", De, F(x.text), 1)) : oe("", !0)
214
248
  ])
215
249
  ]),
216
250
  _: 2
@@ -223,8 +257,8 @@ const Te = /* @__PURE__ */ H(ze, [["render", $e], ["__scopeId", "data-v-d6a59cf0
223
257
  }, 8, ["class"]);
224
258
  };
225
259
  }
226
- }), De = /* @__PURE__ */ H(Ie, [["__scopeId", "data-v-d5511111"]]), J = 20;
227
- function Se(e, s, t) {
260
+ }), Ye = /* @__PURE__ */ A(Se, [["__scopeId", "data-v-5261c686"]]), K = 20;
261
+ function Ae(e, s, t) {
228
262
  const o = m(!1), l = (i) => {
229
263
  if (t.value && e.value) {
230
264
  const a = e.value.getBoundingClientRect(), r = i.clientX < a.left || i.clientX > a.right || i.clientY < a.top || i.clientY > a.bottom;
@@ -237,9 +271,9 @@ function Se(e, s, t) {
237
271
  }, d = () => {
238
272
  s.value && s.value.removeEventListener("mousemove", n), e.value && e.value.removeEventListener("mousemove", n);
239
273
  };
240
- return D(() => {
274
+ return Y(() => {
241
275
  window.addEventListener("mousemove", l);
242
- }), F(() => {
276
+ }), G(() => {
243
277
  window.removeEventListener("mousemove", l);
244
278
  }), L(t, (i) => {
245
279
  i && (o.value = !1);
@@ -247,8 +281,8 @@ function Se(e, s, t) {
247
281
  i ? u() : d();
248
282
  }), { autoOpened: o };
249
283
  }
250
- function Ve(e, s, t) {
251
- const o = m(!1), l = m(null), n = m(null), u = { x: 0, y: 0 }, d = g(() => l.value == null || n.value == null ? { x: 0, y: 0 } : {
284
+ function He(e, s, t) {
285
+ const o = m(!1), l = m(null), n = m(null), u = { x: 0, y: 0 }, d = p(() => l.value == null || n.value == null ? { x: 0, y: 0 } : {
252
286
  x: l.value.x - n.value.x,
253
287
  y: l.value.y - n.value.y
254
288
  }), i = () => {
@@ -263,10 +297,10 @@ function Ve(e, s, t) {
263
297
  };
264
298
  }
265
299
  }, a = () => {
266
- e.value && e.value.addEventListener("mousedown", w);
300
+ e.value && e.value.addEventListener("mousedown", _);
267
301
  }, r = () => {
268
- e.value && e.value.removeEventListener("mousedown", w);
269
- }, w = (v) => {
302
+ e.value && e.value.removeEventListener("mousedown", _);
303
+ }, _ = (v) => {
270
304
  if (e.value != null) {
271
305
  if (s && s.value) {
272
306
  const f = s.value.getBoundingClientRect();
@@ -276,32 +310,32 @@ function Ve(e, s, t) {
276
310
  }
277
311
  }, c = (v) => {
278
312
  if (o.value && n.value && l.value) {
279
- const f = window.innerWidth, x = window.innerHeight, C = e.value, B = C.getBoundingClientRect(), b = B.width, p = B.height, T = n.value.x + (v.clientX - u.x), E = n.value.y + (v.clientY - u.y);
313
+ const f = window.innerWidth, x = window.innerHeight, C = e.value, k = C.getBoundingClientRect(), z = k.width, w = k.height, W = n.value.x + (v.clientX - u.x), y = n.value.y + (v.clientY - u.y);
280
314
  l.value.x = Math.max(
281
315
  t ? t.value.offset.value.left : 0,
282
- T
316
+ W
283
317
  );
284
- const _ = f - b;
318
+ const g = f - z;
285
319
  l.value.x = Math.min(
286
- t ? _ - t.value.offset.value.right : _,
320
+ t ? g - t.value.offset.value.right : g,
287
321
  l.value.x
288
322
  ), l.value.y = Math.max(
289
323
  t ? t.value.offset.value.top : 0,
290
- Math.min(E, x - p)
324
+ Math.min(y, x - w)
291
325
  );
292
- const M = x - p;
326
+ const b = x - w;
293
327
  l.value.y = Math.min(
294
- t ? M - t.value.offset.value.bottom : M,
328
+ t ? b - t.value.offset.value.bottom : b,
295
329
  l.value.y
296
330
  ), C.style.left = l.value.x + "px", C.style.top = l.value.y + "px";
297
331
  }
298
332
  }, h = () => {
299
333
  o.value = !1, document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", h);
300
334
  };
301
- return D(() => {
335
+ return Y(() => {
302
336
  e.value && (i(), a());
303
- }), F(() => {
304
- e.value && e.value.removeEventListener("mousedown", w);
337
+ }), G(() => {
338
+ e.value && e.value.removeEventListener("mousedown", _);
305
339
  }), L(e, (v) => {
306
340
  v ? (i(), a()) : r();
307
341
  }), {
@@ -310,8 +344,8 @@ function Ve(e, s, t) {
310
344
  position: l
311
345
  };
312
346
  }
313
- function Ye(e, s, t) {
314
- const o = m(!1), l = m("left"), { isDragging: n, movement: u, position: d } = Ve(
347
+ function Oe(e, s, t) {
348
+ const o = m(!1), l = m("left"), { isDragging: n, movement: u, position: d } = He(
315
349
  e,
316
350
  s,
317
351
  t
@@ -329,7 +363,7 @@ function Ye(e, s, t) {
329
363
  position: d
330
364
  };
331
365
  }
332
- function Ae(e, s, t, o) {
366
+ function Xe(e, s, t, o) {
333
367
  const l = m(null), n = m(null), u = m(null), d = m(null);
334
368
  return L(e, (i, a) => {
335
369
  l.value = a;
@@ -346,15 +380,15 @@ function Ae(e, s, t, o) {
346
380
  lastHeight: d
347
381
  };
348
382
  }
349
- function He(e, s, t, o) {
350
- const l = m(e.value.width), n = m(e.value.left), u = g(() => e.value.width), d = g(() => e.value.left), i = g(() => t.value ? t.value.x : null);
383
+ function Ne(e, s, t, o) {
384
+ const l = m(e.value.width), n = m(e.value.left), u = p(() => e.value.width), d = p(() => e.value.left), i = p(() => t.value ? t.value.x : null);
351
385
  return L([u, d], ([a, r]) => {
352
386
  (l.value == null || n.value == null || s.value) && (l.value = a, n.value = r);
353
387
  }), L(i, (a) => {
354
388
  o.value && t.value && (n.value = a);
355
389
  }), { left: n, width: l };
356
390
  }
357
- function Oe(e, s = m({ left: 0, right: 0, top: 0, bottom: 0 })) {
391
+ function Ue(e, s = m({ left: 0, right: 0, top: 0, bottom: 0 })) {
358
392
  const t = m({});
359
393
  let o = !1;
360
394
  const l = () => {
@@ -363,7 +397,7 @@ function Oe(e, s = m({ left: 0, right: 0, top: 0, bottom: 0 })) {
363
397
  t.value.left = Math.max(n.left, s.value.left), t.value.top = Math.max(n.top, s.value.top), t.value.width = n.width, t.value.height = n.height, o = !0;
364
398
  }
365
399
  };
366
- return D(() => {
400
+ return Y(() => {
367
401
  e.value && l();
368
402
  }), L(e, (n) => {
369
403
  n && l();
@@ -372,49 +406,49 @@ function Oe(e, s = m({ left: 0, right: 0, top: 0, bottom: 0 })) {
372
406
  initialRect: t
373
407
  };
374
408
  }
375
- function Xe(e, s = m(!1), t = m(!1), o = m({ left: 0, right: 0, top: 0, bottom: 0 }), l = { width: 20, height: 40 }) {
376
- const { initialRect: n } = Oe(e, o), u = m(!1);
377
- let d = 0, i = 0, a = 0, r = 0, w = 0;
378
- const c = 5, h = m(null), v = (b) => {
409
+ function Fe(e, s = m(!1), t = m(!1), o = m({ left: 0, right: 0, top: 0, bottom: 0 }), l = { width: 20, height: 40 }) {
410
+ const { initialRect: n } = Ue(e, o), u = m(!1);
411
+ let d = 0, i = 0, a = 0, r = 0, _ = 0;
412
+ const c = 5, h = m(null), v = (z) => {
379
413
  if (!(!e.value || s.value))
380
414
  if (u.value) {
381
- const p = b.clientX - r, T = b.clientY - w;
415
+ const w = z.clientX - r, W = z.clientY - _;
382
416
  if (h.value === "left" || h.value === "left-bottom-corner") {
383
- const E = i - p;
384
- E > l.width && (n.value.width = E, n.value.left = d + p, e.value.style.left = n.value.left + "px", e.value.style.width = n.value.width + "px");
417
+ const y = i - w;
418
+ y > l.width && (n.value.width = y, n.value.left = d + w, e.value.style.left = n.value.left + "px", e.value.style.width = n.value.width + "px");
385
419
  }
386
420
  if (h.value === "right" || h.value === "right-bottom-corner") {
387
- const E = i + p;
388
- E > l.width && (n.value.width = E, e.value.style.width = n.value.width + "px");
421
+ const y = i + w;
422
+ y > l.width && (n.value.width = y, e.value.style.width = n.value.width + "px");
389
423
  }
390
424
  if (h.value === "bottom" || h.value === "left-bottom-corner" || h.value === "right-bottom-corner") {
391
- const E = a + T;
392
- E > l.height && (n.value.height = E, e.value.style.height = n.value.height + "px");
425
+ const y = a + W;
426
+ y > l.height && (n.value.height = y, e.value.style.height = n.value.height + "px");
393
427
  }
394
428
  } else {
395
- const p = e.value.getBoundingClientRect(), T = b.clientX - p.left, E = b.clientY - p.top, _ = T <= c, M = T >= p.width - c, $ = E >= p.height - c;
396
- _ && $ && t.value ? (e.value.style.cursor = "nesw-resize", h.value = "left-bottom-corner") : M && $ && !t.value ? (e.value.style.cursor = "nwse-resize", h.value = "right-bottom-corner") : _ && t.value ? (e.value.style.cursor = "ew-resize", h.value = "left") : M && !t.value ? (e.value.style.cursor = "ew-resize", h.value = "right") : $ ? (e.value.style.cursor = "ns-resize", h.value = "bottom") : (e.value.style.cursor = "", h.value = null);
429
+ const w = e.value.getBoundingClientRect(), W = z.clientX - w.left, y = z.clientY - w.top, g = W <= c, b = W >= w.width - c, T = y >= w.height - c;
430
+ g && T && t.value ? (e.value.style.cursor = "nesw-resize", h.value = "left-bottom-corner") : b && T && !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") : b && !t.value ? (e.value.style.cursor = "ew-resize", h.value = "right") : T ? (e.value.style.cursor = "ns-resize", h.value = "bottom") : (e.value.style.cursor = "", h.value = null);
397
431
  }
398
- }, f = (b) => {
432
+ }, f = (z) => {
399
433
  if (!e.value || !h.value) return;
400
- const p = e.value.getBoundingClientRect();
401
- r = b.clientX, w = b.clientY, i = p.width, a = p.height, d = p.left, n.value.width = i, n.value.height = a, n.value.left = p.left, n.value.top = p.top, u.value = !0, document.addEventListener("mousemove", v), document.addEventListener("mouseup", x);
434
+ const w = e.value.getBoundingClientRect();
435
+ r = z.clientX, _ = z.clientY, i = w.width, a = w.height, d = w.left, n.value.width = i, n.value.height = a, n.value.left = w.left, n.value.top = w.top, u.value = !0, document.addEventListener("mousemove", v), document.addEventListener("mouseup", x);
402
436
  }, x = () => {
403
437
  u.value = !1, h.value = null, e.value && (e.value.style.cursor = ""), document.removeEventListener("mousemove", v), document.removeEventListener("mouseup", x);
404
438
  }, C = () => {
405
439
  e.value && (e.value.removeEventListener("mousedown", f), e.value.removeEventListener("mousemove", v)), document.removeEventListener("mouseup", x);
406
- }, B = () => {
440
+ }, k = () => {
407
441
  e.value && (e.value.addEventListener("mousedown", f), e.value.addEventListener("mousemove", v));
408
442
  };
409
- return D(() => {
410
- e.value && B();
411
- }), le(() => {
443
+ return Y(() => {
444
+ e.value && k();
445
+ }), se(() => {
412
446
  C();
413
- }), L(e, (b) => {
414
- b ? B() : C();
447
+ }), L(e, (z) => {
448
+ z ? k() : C();
415
449
  }), { rect: n, isResizing: u };
416
450
  }
417
- function Ne(e, s, t, o) {
451
+ function Ge(e, s, t, o) {
418
452
  const l = () => {
419
453
  if (e.value) {
420
454
  const i = e.value;
@@ -427,9 +461,9 @@ function Ne(e, s, t, o) {
427
461
  }, d = () => {
428
462
  e.value && e.value.addEventListener("transitionend", n);
429
463
  };
430
- D(() => {
464
+ Y(() => {
431
465
  e.value && e.value.addEventListener("transitionend", n);
432
- }), le(() => {
466
+ }), se(() => {
433
467
  e.value && e.value.removeEventListener("transitionend", n);
434
468
  }), L(e, (i) => {
435
469
  i ? d() : u();
@@ -439,78 +473,78 @@ function Ne(e, s, t, o) {
439
473
  l();
440
474
  });
441
475
  }
442
- function Ue(e, s, t, o) {
443
- const l = m(window.innerWidth), n = m(window.innerHeight), { docked: u, orientation: d, movement: i, position: a, isDragging: r } = Ye(
476
+ function je(e, s, t, o) {
477
+ const l = m(window.innerWidth), n = m(window.innerHeight), { docked: u, orientation: d, movement: i, position: a, isDragging: r } = Oe(
444
478
  e,
445
479
  s,
446
480
  o
447
- ), w = g(() => d.value === "right"), { rect: c, isResizing: h } = Xe(
481
+ ), _ = p(() => d.value === "right"), { rect: c, isResizing: h } = Fe(
448
482
  e,
449
483
  t,
450
- w,
484
+ _,
451
485
  o.value.offset
452
- ), { width: v, left: f } = He(
486
+ ), { width: v, left: f } = Ne(
453
487
  c,
454
488
  h,
455
489
  a,
456
490
  r
457
- ), { lastTop: x, lastHeight: C } = Ae(
458
- g(() => c.value.left),
459
- g(() => c.value.top),
460
- g(() => c.value.width),
461
- g(() => c.value.height)
462
- ), { autoOpened: B } = Se(e, s, t);
463
- Ne(e, w, t, B);
464
- const b = (_) => {
491
+ ), { lastTop: x, lastHeight: C } = Xe(
492
+ p(() => c.value.left),
493
+ p(() => c.value.top),
494
+ p(() => c.value.width),
495
+ p(() => c.value.height)
496
+ ), { autoOpened: k } = Ae(e, s, t);
497
+ Ge(e, _, t, k);
498
+ const z = (g) => {
465
499
  if (e.value) {
466
- const M = e.value.getBoundingClientRect(), $ = M.left + _;
467
- if (w.value) {
468
- c.value.left = $;
469
- const oe = window.innerWidth - M.width - M.left;
470
- M.left <= 0 && oe >= 0 && _ < 0 && (c.value.left = Math.max(0, $)), window.innerWidth - M.width <= 0 && (c.value.left = window.innerWidth - M.width);
500
+ const b = e.value.getBoundingClientRect(), T = b.left + g;
501
+ if (_.value) {
502
+ c.value.left = T;
503
+ const ie = window.innerWidth - b.width - b.left;
504
+ b.left <= 0 && ie >= 0 && g < 0 && (c.value.left = Math.max(0, T)), window.innerWidth - b.width <= 0 && (c.value.left = window.innerWidth - b.width);
471
505
  } else
472
- M.left + M.width >= window.innerWidth && _ < 0 && (c.value.left = Math.max(0, $));
506
+ b.left + b.width >= window.innerWidth && g < 0 && (c.value.left = Math.max(0, T));
473
507
  }
474
- }, p = () => {
475
- const _ = window.innerWidth - l.value;
476
- l.value = window.innerWidth, n.value = window.innerHeight, b(_);
508
+ }, w = () => {
509
+ const g = window.innerWidth - l.value;
510
+ l.value = window.innerWidth, n.value = window.innerHeight, z(g);
477
511
  };
478
- D(() => {
479
- window.addEventListener("resize", p);
480
- }), F(() => {
481
- window.removeEventListener("resize", p);
512
+ Y(() => {
513
+ window.addEventListener("resize", w);
514
+ }), G(() => {
515
+ window.removeEventListener("resize", w);
482
516
  });
483
- const T = (_) => {
484
- _ ? (c.value.width = J, w.value && f.value && v.value && (c.value.left = f.value + v.value - J)) : (c.value.width = v.value, w.value && f.value && v.value && (c.value.left = f.value));
485
- }, E = () => {
517
+ const W = (g) => {
518
+ g ? (c.value.width = K, _.value && f.value && v.value && (c.value.left = f.value + v.value - K)) : (c.value.width = v.value, _.value && f.value && v.value && (c.value.left = f.value));
519
+ }, y = () => {
486
520
  u.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 = x.value, c.value.height = C.value);
487
521
  };
488
522
  return L(u, () => {
489
- E();
490
- }), L(t, (_) => {
491
- T(_);
492
- }), L(B, (_) => {
493
- t.value && !r.value && T(!_);
494
- }), L(i, (_) => {
495
- if (_ && e.value) {
496
- const $ = e.value.getBoundingClientRect();
497
- c.value.left = $.left, c.value.top = $.top;
523
+ y();
524
+ }), L(t, (g) => {
525
+ W(g);
526
+ }), L(k, (g) => {
527
+ t.value && !r.value && W(!g);
528
+ }), L(i, (g) => {
529
+ if (g && e.value) {
530
+ const T = e.value.getBoundingClientRect();
531
+ c.value.left = T.left, c.value.top = T.top;
498
532
  }
499
- }), { rect: c, orientation: d, reversed: w };
533
+ }), { rect: c, orientation: d, reversed: _ };
500
534
  }
501
- const Fe = (e) => (R("data-v-11a64c54"), e = e(), ee(), e), Ge = /* @__PURE__ */ Fe(() => /* @__PURE__ */ z("svg", {
535
+ const qe = (e) => (te("data-v-8645db4f"), e = e(), ne(), e), Je = /* @__PURE__ */ qe(() => /* @__PURE__ */ E("svg", {
502
536
  xmlns: "http://www.w3.org/2000/svg",
503
537
  width: "1em",
504
538
  height: "1em",
505
539
  viewBox: "0 0 1024 1024"
506
540
  }, [
507
- /* @__PURE__ */ z("path", {
541
+ /* @__PURE__ */ E("path", {
508
542
  fill: "currentColor",
509
543
  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"
510
544
  })
511
- ], -1)), je = { class: "ml-tool-palette-title" }, qe = { class: "ml-tool-palette-content" }, Je = /* @__PURE__ */ V({
545
+ ], -1)), Ke = { class: "ml-tool-palette-title" }, Qe = { class: "ml-tool-palette-content" }, Ze = /* @__PURE__ */ S({
512
546
  __name: "MlToolPalette",
513
- props: /* @__PURE__ */ Y({
547
+ props: /* @__PURE__ */ V({
514
548
  title: { default: "" },
515
549
  leftOffset: { default: 0 },
516
550
  rightOffset: { default: 0 },
@@ -520,9 +554,9 @@ const Fe = (e) => (R("data-v-11a64c54"), e = e(), ee(), e), Ge = /* @__PURE__ */
520
554
  modelValue: { default: !0 },
521
555
  modelModifiers: {}
522
556
  }),
523
- emits: /* @__PURE__ */ Y(["close"], ["update:modelValue"]),
557
+ emits: /* @__PURE__ */ V(["close"], ["update:modelValue"]),
524
558
  setup(e, { emit: s }) {
525
- const t = e, o = K(e, "modelValue"), l = s, n = m(!1), u = m(null), d = m(null), i = g(() => ({
559
+ const t = e, o = U(e, "modelValue"), l = s, n = m(!1), u = m(null), d = m(null), i = p(() => ({
526
560
  offset: m({
527
561
  left: t.leftOffset,
528
562
  right: t.rightOffset,
@@ -532,13 +566,13 @@ const Fe = (e) => (R("data-v-11a64c54"), e = e(), ee(), e), Ge = /* @__PURE__ */
532
566
  })), {
533
567
  rect: a,
534
568
  orientation: r,
535
- reversed: w
536
- } = Ue(d, u, n, i), c = g(() => ({
569
+ reversed: _
570
+ } = je(d, u, n, i), c = p(() => ({
537
571
  left: `${a.value.left}px`,
538
572
  top: `${a.value.top}px`,
539
573
  width: `${a.value.width}px`,
540
574
  height: `${a.value.height}px`
541
- })), h = g(() => w.value ? {
575
+ })), h = p(() => _.value ? {
542
576
  borderLeft: "1px solid var(--el-border-color)",
543
577
  borderRight: null
544
578
  } : {
@@ -553,60 +587,61 @@ const Fe = (e) => (R("data-v-11a64c54"), e = e(), ee(), e), Ge = /* @__PURE__ */
553
587
  });
554
588
  };
555
589
  return (f, x) => {
556
- const C = A;
557
- return o.value ? (y(), I("div", {
590
+ const C = H;
591
+ return o.value ? (M(), I("div", {
558
592
  key: 0,
559
593
  ref_key: "toolPaletteElement",
560
594
  ref: d,
561
595
  style: X([c.value]),
562
596
  class: "ml-tool-palette-dialog"
563
597
  }, [
564
- z("div", {
565
- class: te(["ml-tool-palette-dialog-layout", G(r)])
598
+ E("div", {
599
+ class: le(["ml-tool-palette-dialog-layout", j(r)])
566
600
  }, [
567
- z("div", {
601
+ E("div", {
568
602
  ref_key: "titleBarElement",
569
603
  ref: u,
570
604
  class: "ml-tool-palette-title-bar",
571
605
  style: X(h.value)
572
606
  }, [
573
- S(C, {
607
+ D(C, {
574
608
  size: 18,
575
609
  class: "ml-tool-palette-dialog-icon",
576
610
  onClick: v
577
611
  }, {
578
- default: k(() => [
579
- Ge
612
+ default: B(() => [
613
+ Je
580
614
  ]),
581
615
  _: 1
582
616
  }),
583
- S(Le, {
617
+ D(xe, {
584
618
  class: "ml-tool-palette-dialog-icon",
585
619
  modelValue: n.value,
586
- "onUpdate:modelValue": x[0] || (x[0] = (B) => n.value = B),
587
- reverse: G(w)
620
+ "onUpdate:modelValue": x[0] || (x[0] = (k) => n.value = k),
621
+ reverse: j(_)
588
622
  }, null, 8, ["modelValue", "reverse"]),
589
- z("span", je, U(t.title), 1)
623
+ E("span", Ke, F(t.title), 1)
590
624
  ], 4),
591
- z("div", qe, [
625
+ E("div", Qe, [
592
626
  O(f.$slots, "default", {}, void 0, !0)
593
627
  ])
594
628
  ], 2)
595
- ], 4)) : ne("", !0);
629
+ ], 4)) : oe("", !0);
596
630
  };
597
631
  }
598
- }), Ke = /* @__PURE__ */ H(Je, [["__scopeId", "data-v-11a64c54"]]), it = {
632
+ }), Pe = /* @__PURE__ */ A(Ze, [["__scopeId", "data-v-8645db4f"]]), ct = {
599
633
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
600
634
  install(e) {
601
- e.component("MlCollapse", N), e.component("MlDropdown", N), e.component("MlLanguage", be), e.component("MlStatusBar", Te), e.component("MlToolBar", De), e.component("MlToolPalette", Ke);
635
+ e.component("MlCollapse", N), e.component("MlDropdown", N), e.component("MlLanguage", Ee), e.component("MlStatusBar", We), e.component("MlToggleButton", Ve), e.component("MlToolBar", Ye), e.component("MlToolPalette", Pe);
602
636
  }
603
637
  };
604
638
  export {
605
- Le as MlCollapse,
639
+ xe as MlCollapse,
606
640
  N as MlDropdown,
607
- be as MlLanguage,
608
- Te as MlStatusBar,
609
- De as MlToolBar,
610
- Ke as MlToolPalette,
611
- it as default
641
+ Ee as MlLanguage,
642
+ We as MlStatusBar,
643
+ Ve as MlToggleButton,
644
+ Ye as MlToolBar,
645
+ Pe as MlToolPalette,
646
+ ct as default
612
647
  };
@@ -1,2 +1,2 @@
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-vertical-toolbar-button-group[data-v-d5511111]{display:flex;flex-direction:column}.ml-horizontal-toolbar-button-group[data-v-d5511111]{display:flex;flex-direction:row}.ml-toolbar-button[data-v-d5511111]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px}.ml-toolbar-button-text[data-v-d5511111]{margin-left:0;margin-top:5px}.ml-tool-palette-dialog[data-v-11a64c54]{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-11a64c54]{border-bottom:1px solid var(--el-border-color)}.ml-tool-palette-dialog-layout[data-v-11a64c54]{display:flex;height:100%}.ml-tool-palette-title-bar[data-v-11a64c54]{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-11a64c54]{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-11a64c54]{-webkit-user-select:none;user-select:none;flex-grow:1;display:flex;justify-content:space-around;background-color:var(--el-fill-color);overflow:hidden}.ml-tool-palette-dialog-layout.left .ml-tool-palette-title-bar[data-v-11a64c54]{order:1}.ml-tool-palette-dialog-layout.left .ml-tool-palette-content[data-v-11a64c54],.ml-tool-palette-dialog-layout.right .ml-tool-palette-title-bar[data-v-11a64c54]{order:2}.ml-tool-palette-dialog-layout.right .ml-tool-palette-content[data-v-11a64c54]{order:1}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- (function(L,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("element-plus/es"),require("element-plus/es/components/base/style/css"),require("element-plus/es/components/icon/style/css"),require("vue"),require("element-plus/es/components/dropdown/style/css"),require("element-plus/es/components/dropdown-menu/style/css"),require("element-plus/es/components/dropdown-item/style/css"),require("element-plus/es/components/button-group/style/css"),require("element-plus/es/components/tooltip/style/css"),require("element-plus/es/components/button/style/css")):typeof define=="function"&&define.amd?define(["exports","element-plus/es","element-plus/es/components/base/style/css","element-plus/es/components/icon/style/css","vue","element-plus/es/components/dropdown/style/css","element-plus/es/components/dropdown-menu/style/css","element-plus/es/components/dropdown-item/style/css","element-plus/es/components/button-group/style/css","element-plus/es/components/tooltip/style/css","element-plus/es/components/button/style/css"],x):(L=typeof globalThis<"u"?globalThis:L||self,x(L.UIComponents={},L.es,null,null,L.Vue))})(this,function(L,x,pe,fe,e){"use strict";const Y={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 1024 1024"},A=[e.createElementVNode("path",{fill:"currentColor",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"},null,-1)];function H(t,i){return e.openBlock(),e.createElementBlock("svg",Y,[...A])}const $={render:H},X={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 1024 1024"},q=[e.createElementVNode("path",{fill:"currentColor",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"},null,-1)];function U(t,i){return e.openBlock(),e.createElementBlock("svg",X,[...q])}const T={render:U},S=e.defineComponent({__name:"MlCollapse",props:e.mergeModels({size:{default:18},reverse:{type:Boolean,default:!1}},{modelValue:{default:!0},modelModifiers:{}}),emits:e.mergeModels(["change"],["update:modelValue"]),setup(t,{emit:i}){const n=t,s=e.useModel(t,"modelValue"),l=i,o=e.computed(()=>n.reverse?s.value?$:T:s.value?T:$),c=e.computed(()=>`${n.size}px`),h=()=>{l("change",s.value),s.value=!s.value};return(a,r)=>{const d=x.ElIcon;return e.openBlock(),e.createBlock(d,{size:c.value,onClick:h},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value)))]),_:1},8,["size"])}}}),F=(t=>(e.pushScopeId("data-v-3fc33b5d"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("svg",{preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em","data-v-63d067da":""},[e.createElementVNode("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"})],-1)),j=e.defineComponent({__name:"MlDropdown",props:{icon:{},items:{},current:{default:void 0}},emits:{click:null},setup(t,{emit:i}){const n=t,s=i,l=e.computed(()=>n.items.filter(c=>c.name!==n.current)),o=c=>{s("click",c)};return(c,h)=>{const a=x.ElIcon,r=x.ElDropdownItem,d=x.ElDropdownMenu,w=x.ElDropdown;return e.openBlock(),e.createBlock(w,{onCommand:o},{dropdown:e.withCtx(()=>[e.createVNode(d,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,u=>(e.openBlock(),e.createBlock(r,{key:u.text,command:u.name},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.text),1)]),_:2},1032,["command"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createVNode(a,{size:"30",class:"ml-dropdown-icon"},{default:e.withCtx(()=>[F]),_:1})]),_:1})}}}),z=(t,i)=>{const n=t.__vccOpts||t;for(const[s,l]of i)n[s]=l;return n},V=z(j,[["__scopeId","data-v-3fc33b5d"]]),G='<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>',I=e.defineComponent({__name:"MlLanguage",props:{languages:{},current:{}},emits:{click:null},setup(t,{emit:i}){const n=t,s=i,l=o=>{s("click",o)};return(o,c)=>(e.openBlock(),e.createBlock(V,{icon:G,items:n.languages,current:n.current,onClick:l},null,8,["items","current"]))}}),J={},K={class:"ml-status-bar"},Q={class:"ml-status-bar-left"},Z={class:"ml-status-bar-right"};function P(t,i){return e.openBlock(),e.createElementBlock("div",K,[e.createElementVNode("div",Q,[e.renderSlot(t.$slots,"left",{},void 0,!0)]),e.createElementVNode("div",Z,[e.renderSlot(t.$slots,"right",{},void 0,!0)])])}const N=z(J,[["render",P],["__scopeId","data-v-d6a59cf0"]]),R={key:0,class:"ml-toolbar-button-text"},W=z(e.defineComponent({__name:"MlToolBar",props:{items:{},size:{default:"large"},direction:{}},emits:{click:null},setup(t,{emit:i}){const n=t,s=i,l=e.computed(()=>n.direction==="vertical"?"ml-vertical-toolbar-button-group":"ml-horizontal-toolbar-button-group"),o=e.computed(()=>n.size==="small"?20:30),c=e.computed(()=>{switch(n.size){case"small":return 30;case"medium":return 50}return 70}),h=d=>d.description?d.description:d.text,a=e.computed(()=>n.size==="large"),r=d=>{s("click",d)};return(d,w)=>{const u=x.ElIcon,p=x.ElButton,m=x.ElTooltip,f=x.ElButtonGroup;return e.openBlock(),e.createBlock(f,{class:e.normalizeClass(l.value)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.items,(g,M)=>(e.openBlock(),e.createBlock(m,{key:g.text,content:h(g),"hide-after":0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(p,{class:"ml-toolbar-button",style:e.normalizeStyle({width:c.value+"px",height:c.value+"px"}),key:M,onClick:k=>r(g.command)},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(u,{size:o.value},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g.icon)))]),_:2},1032,["size"]),a.value?(e.openBlock(),e.createElementBlock("div",R,e.toDisplayString(g.text),1)):e.createCommentVNode("",!0)])]),_:2},1032,["style","onClick"]))]),_:2},1032,["content"]))),128))]),_:1},8,["class"])}}}),[["__scopeId","data-v-d5511111"]]),D=20;function ee(t,i,n){const s=e.ref(!1),l=a=>{if(n.value&&t.value){const r=t.value.getBoundingClientRect(),d=a.clientX<r.left||a.clientX>r.right||a.clientY<r.top||a.clientY>r.bottom;s.value=!d}},o=()=>{n.value&&(s.value=!0)},c=()=>{i.value&&i.value.addEventListener("mousemove",o),t.value&&t.value.addEventListener("mousemove",o)},h=()=>{i.value&&i.value.removeEventListener("mousemove",o),t.value&&t.value.removeEventListener("mousemove",o)};return e.onMounted(()=>{window.addEventListener("mousemove",l)}),e.onUnmounted(()=>{window.removeEventListener("mousemove",l)}),e.watch(n,a=>{a&&(s.value=!1)}),e.watch(t,a=>{a?c():h()}),{autoOpened:s}}function te(t,i,n){const s=e.ref(!1),l=e.ref(null),o=e.ref(null),c={x:0,y:0},h=e.computed(()=>l.value==null||o.value==null?{x:0,y:0}:{x:l.value.x-o.value.x,y:l.value.y-o.value.y}),a=()=>{if(t.value){const m=t.value.getBoundingClientRect();o.value={x:m.left,y:m.top},l.value={x:m.left,y:m.top}}},r=()=>{t.value&&t.value.addEventListener("mousedown",w)},d=()=>{t.value&&t.value.removeEventListener("mousedown",w)},w=m=>{if(t.value!=null){if(i&&i.value){const f=i.value.getBoundingClientRect();if(m.clientX<f.left||m.clientX>f.right||m.clientY<f.top||m.clientY>f.bottom)return}s.value=!0,c.x=m.clientX,c.y=m.clientY,a(),document.addEventListener("mousemove",u),document.addEventListener("mouseup",p)}},u=m=>{if(s.value&&o.value&&l.value){const f=window.innerWidth,g=window.innerHeight,M=t.value,k=M.getBoundingClientRect(),E=k.width,v=k.height,b=o.value.x+(m.clientX-c.x),B=o.value.y+(m.clientY-c.y);l.value.x=Math.max(n?n.value.offset.value.left:0,b);const _=f-E;l.value.x=Math.min(n?_-n.value.offset.value.right:_,l.value.x),l.value.y=Math.max(n?n.value.offset.value.top:0,Math.min(B,g-v));const y=g-v;l.value.y=Math.min(n?y-n.value.offset.value.bottom:y,l.value.y),M.style.left=l.value.x+"px",M.style.top=l.value.y+"px"}},p=()=>{s.value=!1,document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",p)};return e.onMounted(()=>{t.value&&(a(),r())}),e.onUnmounted(()=>{t.value&&t.value.removeEventListener("mousedown",w)}),e.watch(t,m=>{m?(a(),r()):d()}),{isDragging:s,movement:h,position:l}}function ne(t,i,n){const s=e.ref(!1),l=e.ref("left"),{isDragging:o,movement:c,position:h}=te(t,i,n);return e.watch(c,a=>{if(a&&t.value){const d=t.value.getBoundingClientRect();d.left<=n.value.offset.value.left?(l.value="left",s.value=!0):window.innerWidth-d.left-d.width<=n.value.offset.value.right?(l.value="right",s.value=!0):s.value=!1}}),{docked:s,orientation:l,isDragging:o,movement:c,position:h}}function oe(t,i,n,s){const l=e.ref(null),o=e.ref(null),c=e.ref(null),h=e.ref(null);return e.watch(t,(a,r)=>{l.value=r}),e.watch(i,(a,r)=>{o.value=r}),e.watch(n,(a,r)=>{c.value=r}),e.watch(s,(a,r)=>{h.value=r}),{lastLeft:l,lastTop:o,lastWidth:c,lastHeight:h}}function le(t,i,n,s){const l=e.ref(t.value.width),o=e.ref(t.value.left),c=e.computed(()=>t.value.width),h=e.computed(()=>t.value.left),a=e.computed(()=>n.value?n.value.x:null);return e.watch([c,h],([r,d])=>{(l.value==null||o.value==null||i.value)&&(l.value=r,o.value=d)}),e.watch(a,r=>{s.value&&n.value&&(o.value=r)}),{left:o,width:l}}function se(t,i=e.ref({left:0,right:0,top:0,bottom:0})){const n=e.ref({});let s=!1;const l=()=>{if(!s&&t.value){const o=t.value.getBoundingClientRect();n.value.left=Math.max(o.left,i.value.left),n.value.top=Math.max(o.top,i.value.top),n.value.width=o.width,n.value.height=o.height,s=!0}};return e.onMounted(()=>{t.value&&l()}),e.watch(t,o=>{o&&l()}),{isIntialized:s,initialRect:n}}function ie(t,i=e.ref(!1),n=e.ref(!1),s=e.ref({left:0,right:0,top:0,bottom:0}),l={width:20,height:40}){const{initialRect:o}=se(t,s),c=e.ref(!1);let h=0,a=0,r=0,d=0,w=0;const u=5,p=e.ref(null),m=E=>{if(!(!t.value||i.value))if(c.value){const v=E.clientX-d,b=E.clientY-w;if(p.value==="left"||p.value==="left-bottom-corner"){const B=a-v;B>l.width&&(o.value.width=B,o.value.left=h+v,t.value.style.left=o.value.left+"px",t.value.style.width=o.value.width+"px")}if(p.value==="right"||p.value==="right-bottom-corner"){const B=a+v;B>l.width&&(o.value.width=B,t.value.style.width=o.value.width+"px")}if(p.value==="bottom"||p.value==="left-bottom-corner"||p.value==="right-bottom-corner"){const B=r+b;B>l.height&&(o.value.height=B,t.value.style.height=o.value.height+"px")}}else{const v=t.value.getBoundingClientRect(),b=E.clientX-v.left,B=E.clientY-v.top,_=b<=u,y=b>=v.width-u,C=B>=v.height-u;_&&C&&n.value?(t.value.style.cursor="nesw-resize",p.value="left-bottom-corner"):y&&C&&!n.value?(t.value.style.cursor="nwse-resize",p.value="right-bottom-corner"):_&&n.value?(t.value.style.cursor="ew-resize",p.value="left"):y&&!n.value?(t.value.style.cursor="ew-resize",p.value="right"):C?(t.value.style.cursor="ns-resize",p.value="bottom"):(t.value.style.cursor="",p.value=null)}},f=E=>{if(!t.value||!p.value)return;const v=t.value.getBoundingClientRect();d=E.clientX,w=E.clientY,a=v.width,r=v.height,h=v.left,o.value.width=a,o.value.height=r,o.value.left=v.left,o.value.top=v.top,c.value=!0,document.addEventListener("mousemove",m),document.addEventListener("mouseup",g)},g=()=>{c.value=!1,p.value=null,t.value&&(t.value.style.cursor=""),document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",g)},M=()=>{t.value&&(t.value.removeEventListener("mousedown",f),t.value.removeEventListener("mousemove",m)),document.removeEventListener("mouseup",g)},k=()=>{t.value&&(t.value.addEventListener("mousedown",f),t.value.addEventListener("mousemove",m))};return e.onMounted(()=>{t.value&&k()}),e.onBeforeUnmount(()=>{M()}),e.watch(t,E=>{E?k():M()}),{rect:o,isResizing:c}}function ae(t,i,n,s){const l=()=>{if(t.value){const a=t.value;i.value?a.style.transition="width 0.3s ease-out, left 0.3s ease-out":a.style.transition="width 0.3s ease"}},o=()=>{t.value&&(t.value.style.transition="")},c=()=>{t.value&&t.value.removeEventListener("transitionend",o)},h=()=>{t.value&&t.value.addEventListener("transitionend",o)};e.onMounted(()=>{t.value&&t.value.addEventListener("transitionend",o)}),e.onBeforeUnmount(()=>{t.value&&t.value.removeEventListener("transitionend",o)}),e.watch(t,a=>{a?h():c()}),e.watch(n,()=>{l()}),e.watch(s,()=>{l()})}function ce(t,i,n,s){const l=e.ref(window.innerWidth),o=e.ref(window.innerHeight),{docked:c,orientation:h,movement:a,position:r,isDragging:d}=ne(t,i,s),w=e.computed(()=>h.value==="right"),{rect:u,isResizing:p}=ie(t,n,w,s.value.offset),{width:m,left:f}=le(u,p,r,d),{lastTop:g,lastHeight:M}=oe(e.computed(()=>u.value.left),e.computed(()=>u.value.top),e.computed(()=>u.value.width),e.computed(()=>u.value.height)),{autoOpened:k}=ee(t,i,n);ae(t,w,n,k);const E=_=>{if(t.value){const y=t.value.getBoundingClientRect(),C=y.left+_;if(w.value){u.value.left=C;const he=window.innerWidth-y.width-y.left;y.left<=0&&he>=0&&_<0&&(u.value.left=Math.max(0,C)),window.innerWidth-y.width<=0&&(u.value.left=window.innerWidth-y.width)}else y.left+y.width>=window.innerWidth&&_<0&&(u.value.left=Math.max(0,C))}},v=()=>{const _=window.innerWidth-l.value;l.value=window.innerWidth,o.value=window.innerHeight,E(_)};e.onMounted(()=>{window.addEventListener("resize",v)}),e.onUnmounted(()=>{window.removeEventListener("resize",v)});const b=_=>{_?(u.value.width=D,w.value&&f.value&&m.value&&(u.value.left=f.value+m.value-D)):(u.value.width=m.value,w.value&&f.value&&m.value&&(u.value.left=f.value))},B=()=>{c.value?(u.value.top=s.value.offset.value.top,u.value.height=window.innerHeight-s.value.offset.value.top-s.value.offset.value.bottom):(u.value.top=g.value,u.value.height=M.value)};return e.watch(c,()=>{B()}),e.watch(n,_=>{b(_)}),e.watch(k,_=>{n.value&&!d.value&&b(!_)}),e.watch(a,_=>{if(_&&t.value){const C=t.value.getBoundingClientRect();u.value.left=C.left,u.value.top=C.top}}),{rect:u,orientation:h,reversed:w}}const re=(t=>(e.pushScopeId("data-v-11a64c54"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",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"})],-1)),ue={class:"ml-tool-palette-title"},de={class:"ml-tool-palette-content"},O=z(e.defineComponent({__name:"MlToolPalette",props:e.mergeModels({title:{default:""},leftOffset:{default:0},rightOffset:{default:0},topOffset:{default:0},bottomOffset:{default:0}},{modelValue:{default:!0},modelModifiers:{}}),emits:e.mergeModels(["close"],["update:modelValue"]),setup(t,{emit:i}){const n=t,s=e.useModel(t,"modelValue"),l=i,o=e.ref(!1),c=e.ref(null),h=e.ref(null),a=e.computed(()=>({offset:e.ref({left:n.leftOffset,right:n.rightOffset,top:n.topOffset,bottom:n.bottomOffset})})),{rect:r,orientation:d,reversed:w}=ce(h,c,o,a),u=e.computed(()=>({left:`${r.value.left}px`,top:`${r.value.top}px`,width:`${r.value.width}px`,height:`${r.value.height}px`})),p=e.computed(()=>w.value?{borderLeft:"1px solid var(--el-border-color)",borderRight:null}:{borderLeft:null,borderRight:"1px solid var(--el-border-color)"}),m=()=>{s.value=!1;const f=h.value;l("close",{x:f?f.clientLeft:0,y:f?f.clientTop:0})};return(f,g)=>{const M=x.ElIcon;return s.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"toolPaletteElement",ref:h,style:e.normalizeStyle([u.value]),class:"ml-tool-palette-dialog"},[e.createElementVNode("div",{class:e.normalizeClass(["ml-tool-palette-dialog-layout",e.unref(d)])},[e.createElementVNode("div",{ref_key:"titleBarElement",ref:c,class:"ml-tool-palette-title-bar",style:e.normalizeStyle(p.value)},[e.createVNode(M,{size:18,class:"ml-tool-palette-dialog-icon",onClick:m},{default:e.withCtx(()=>[re]),_:1}),e.createVNode(S,{class:"ml-tool-palette-dialog-icon",modelValue:o.value,"onUpdate:modelValue":g[0]||(g[0]=k=>o.value=k),reverse:e.unref(w)},null,8,["modelValue","reverse"]),e.createElementVNode("span",ue,e.toDisplayString(n.title),1)],4),e.createElementVNode("div",de,[e.renderSlot(f.$slots,"default",{},void 0,!0)])],2)],4)):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-11a64c54"]]),me={install(t){t.component("MlCollapse",V),t.component("MlDropdown",V),t.component("MlLanguage",I),t.component("MlStatusBar",N),t.component("MlToolBar",W),t.component("MlToolPalette",O)}};L.MlCollapse=S,L.MlDropdown=V,L.MlLanguage=I,L.MlStatusBar=N,L.MlToolBar=W,L.MlToolPalette=O,L.default=me,Object.defineProperties(L,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
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-5261c686]{display:flex;flex-direction:column}.ml-horizontal-toolbar-button-group[data-v-5261c686]{display:flex;flex-direction:row}.ml-toolbar-button[data-v-5261c686]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px}.ml-toolbar-button-text[data-v-5261c686]{margin-left:0;margin-top:5px}.ml-tool-palette-dialog[data-v-8645db4f]{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-8645db4f]{border-bottom:1px solid var(--el-border-color);cursor:default}.ml-tool-palette-dialog-icon[data-v-8645db4f]:hover{color:var(--el-color-primary)}.ml-tool-palette-dialog-layout[data-v-8645db4f]{display:flex;height:100%}.ml-tool-palette-title-bar[data-v-8645db4f]{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-8645db4f]{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-8645db4f]{-webkit-user-select:none;user-select:none;flex-grow:1;display:flex;justify-content:space-around;background-color:var(--el-fill-color);overflow:hidden}.ml-tool-palette-dialog-layout.left .ml-tool-palette-title-bar[data-v-8645db4f]{order:1}.ml-tool-palette-dialog-layout.left .ml-tool-palette-content[data-v-8645db4f],.ml-tool-palette-dialog-layout.right .ml-tool-palette-title-bar[data-v-8645db4f]{order:2}.ml-tool-palette-dialog-layout.right .ml-tool-palette-content[data-v-8645db4f]{order:1}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ (function(B,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("element-plus/es"),require("element-plus/es/components/base/style/css"),require("element-plus/es/components/icon/style/css"),require("vue"),require("element-plus/es/components/dropdown/style/css"),require("element-plus/es/components/dropdown-menu/style/css"),require("element-plus/es/components/dropdown-item/style/css"),require("element-plus/es/components/tooltip/style/css"),require("element-plus/es/components/button/style/css"),require("element-plus/es/components/button-group/style/css")):typeof define=="function"&&define.amd?define(["exports","element-plus/es","element-plus/es/components/base/style/css","element-plus/es/components/icon/style/css","vue","element-plus/es/components/dropdown/style/css","element-plus/es/components/dropdown-menu/style/css","element-plus/es/components/dropdown-item/style/css","element-plus/es/components/tooltip/style/css","element-plus/es/components/button/style/css","element-plus/es/components/button-group/style/css"],y):(B=typeof globalThis<"u"?globalThis:B||self,y(B.UIComponents={},B.es,null,null,B.Vue))})(this,function(B,y,fe,ve,e){"use strict";const A={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 1024 1024"},H=[e.createElementVNode("path",{fill:"currentColor",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"},null,-1)];function X(t,i){return e.openBlock(),e.createElementBlock("svg",A,[...H])}const V={render:X},q={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 1024 1024"},U=[e.createElementVNode("path",{fill:"currentColor",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"},null,-1)];function F(t,i){return e.openBlock(),e.createElementBlock("svg",q,[...U])}const $={render:F},I=e.defineComponent({__name:"MlCollapse",props:e.mergeModels({size:{default:18},reverse:{type:Boolean,default:!1}},{modelValue:{default:!0},modelModifiers:{}}),emits:e.mergeModels(["change"],["update:modelValue"]),setup(t,{emit:i}){const o=t,s=e.useModel(t,"modelValue"),l=i,n=e.computed(()=>o.reverse?s.value?V:$:s.value?$:V),a=e.computed(()=>`${o.size}px`),h=()=>{l("change",s.value),s.value=!s.value};return(c,r)=>{const d=y.ElIcon;return e.openBlock(),e.createBlock(d,{size:a.value,onClick:h},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value)))]),_:1},8,["size"])}}}),j=(t=>(e.pushScopeId("data-v-3fc33b5d"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("svg",{preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em","data-v-63d067da":""},[e.createElementVNode("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"})],-1)),G=e.defineComponent({__name:"MlDropdown",props:{icon:{},items:{},current:{default:void 0}},emits:{click:null},setup(t,{emit:i}){const o=t,s=i,l=e.computed(()=>o.items.filter(a=>a.name!==o.current)),n=a=>{s("click",a)};return(a,h)=>{const c=y.ElIcon,r=y.ElDropdownItem,d=y.ElDropdownMenu,v=y.ElDropdown;return e.openBlock(),e.createBlock(v,{onCommand:n},{dropdown:e.withCtx(()=>[e.createVNode(d,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,u=>(e.openBlock(),e.createBlock(r,{key:u.text,command:u.name},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.text),1)]),_:2},1032,["command"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createVNode(c,{size:"30",class:"ml-dropdown-icon"},{default:e.withCtx(()=>[j]),_:1})]),_:1})}}}),z=(t,i)=>{const o=t.__vccOpts||t;for(const[s,l]of i)o[s]=l;return o},T=z(G,[["__scopeId","data-v-3fc33b5d"]]),J='<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>',S=e.defineComponent({__name:"MlLanguage",props:{languages:{},current:{}},emits:{click:null},setup(t,{emit:i}){const o=t,s=i,l=n=>{s("click",n)};return(n,a)=>(e.openBlock(),e.createBlock(T,{icon:J,items:o.languages,current:o.current,onClick:l},null,8,["items","current"]))}}),K={},Q={class:"ml-status-bar"},Z={class:"ml-status-bar-left"},P={class:"ml-status-bar-right"};function R(t,i){return e.openBlock(),e.createElementBlock("div",Q,[e.createElementVNode("div",Z,[e.renderSlot(t.$slots,"left",{},void 0,!0)]),e.createElementVNode("div",P,[e.renderSlot(t.$slots,"right",{},void 0,!0)])])}const N=z(K,[["render",R],["__scopeId","data-v-d6a59cf0"]]),W=z(e.defineComponent({__name:"MlToggleButton",props:e.mergeModels({size:{default:30},data:{}},{modelValue:{default:!1},modelModifiers:{}}),emits:e.mergeModels(["click"],["update:modelValue"]),setup(t,{emit:i}){e.useCssVars(r=>({"0547f26d":a.value}));const o=t,s=e.useModel(t,"modelValue"),l=i,n=e.computed(()=>s.value?o.data.onIcon:o.data.offIcon),a=e.computed(()=>o.size+"px"),h=e.computed(()=>s.value?o.data.onTooltip:o.data.offTooltip),c=()=>{s.value=!s.value,l("click",s.value)};return(r,d)=>{const v=y.ElButton,u=y.ElTooltip;return e.openBlock(),e.createBlock(u,{content:h.value,"hide-after":0},{default:e.withCtx(()=>[e.createVNode(v,{class:"ml-toggle-button",icon:n.value,onClick:c},null,8,["icon"])]),_:1},8,["content"])}}}),[["__scopeId","data-v-b676e93b"]]),ee={key:0,class:"ml-toolbar-button-text"},D=z(e.defineComponent({__name:"MlToolBar",props:{items:{},size:{default:"large"},direction:{}},emits:{click:null},setup(t,{emit:i}){const o=t,s=i,l=e.computed(()=>o.direction==="vertical"?"ml-vertical-toolbar-button-group":"ml-horizontal-toolbar-button-group"),n=e.computed(()=>o.size==="small"?20:30),a=e.computed(()=>{switch(o.size){case"small":return 30;case"medium":return 50}return 70}),h=d=>d.description?d.description:d.text,c=e.computed(()=>o.size==="large"),r=d=>{s("click",d)};return(d,v)=>{const u=y.ElIcon,p=y.ElButton,m=y.ElTooltip,f=y.ElButtonGroup;return e.openBlock(),e.createBlock(f,{class:e.normalizeClass(l.value)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.items,(g,E)=>(e.openBlock(),e.createBlock(m,{key:g.text,content:h(g),"hide-after":0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(p,{class:"ml-toolbar-button",style:e.normalizeStyle({width:a.value+"px",height:a.value+"px"}),key:E,onClick:k=>r(g.command)},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(u,{size:n.value},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g.icon)))]),_:2},1032,["size"]),c.value?(e.openBlock(),e.createElementBlock("div",ee,e.toDisplayString(g.text),1)):e.createCommentVNode("",!0)])]),_:2},1032,["style","onClick"]))]),_:2},1032,["content"]))),128))]),_:1},8,["class"])}}}),[["__scopeId","data-v-5261c686"]]),O=20;function te(t,i,o){const s=e.ref(!1),l=c=>{if(o.value&&t.value){const r=t.value.getBoundingClientRect(),d=c.clientX<r.left||c.clientX>r.right||c.clientY<r.top||c.clientY>r.bottom;s.value=!d}},n=()=>{o.value&&(s.value=!0)},a=()=>{i.value&&i.value.addEventListener("mousemove",n),t.value&&t.value.addEventListener("mousemove",n)},h=()=>{i.value&&i.value.removeEventListener("mousemove",n),t.value&&t.value.removeEventListener("mousemove",n)};return e.onMounted(()=>{window.addEventListener("mousemove",l)}),e.onUnmounted(()=>{window.removeEventListener("mousemove",l)}),e.watch(o,c=>{c&&(s.value=!1)}),e.watch(t,c=>{c?a():h()}),{autoOpened:s}}function oe(t,i,o){const s=e.ref(!1),l=e.ref(null),n=e.ref(null),a={x:0,y:0},h=e.computed(()=>l.value==null||n.value==null?{x:0,y:0}:{x:l.value.x-n.value.x,y:l.value.y-n.value.y}),c=()=>{if(t.value){const m=t.value.getBoundingClientRect();n.value={x:m.left,y:m.top},l.value={x:m.left,y:m.top}}},r=()=>{t.value&&t.value.addEventListener("mousedown",v)},d=()=>{t.value&&t.value.removeEventListener("mousedown",v)},v=m=>{if(t.value!=null){if(i&&i.value){const f=i.value.getBoundingClientRect();if(m.clientX<f.left||m.clientX>f.right||m.clientY<f.top||m.clientY>f.bottom)return}s.value=!0,a.x=m.clientX,a.y=m.clientY,c(),document.addEventListener("mousemove",u),document.addEventListener("mouseup",p)}},u=m=>{if(s.value&&n.value&&l.value){const f=window.innerWidth,g=window.innerHeight,E=t.value,k=E.getBoundingClientRect(),x=k.width,w=k.height,b=n.value.x+(m.clientX-a.x),M=n.value.y+(m.clientY-a.y);l.value.x=Math.max(o?o.value.offset.value.left:0,b);const _=f-x;l.value.x=Math.min(o?_-o.value.offset.value.right:_,l.value.x),l.value.y=Math.max(o?o.value.offset.value.top:0,Math.min(M,g-w));const L=g-w;l.value.y=Math.min(o?L-o.value.offset.value.bottom:L,l.value.y),E.style.left=l.value.x+"px",E.style.top=l.value.y+"px"}},p=()=>{s.value=!1,document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",p)};return e.onMounted(()=>{t.value&&(c(),r())}),e.onUnmounted(()=>{t.value&&t.value.removeEventListener("mousedown",v)}),e.watch(t,m=>{m?(c(),r()):d()}),{isDragging:s,movement:h,position:l}}function ne(t,i,o){const s=e.ref(!1),l=e.ref("left"),{isDragging:n,movement:a,position:h}=oe(t,i,o);return e.watch(a,c=>{if(c&&t.value){const d=t.value.getBoundingClientRect();d.left<=o.value.offset.value.left?(l.value="left",s.value=!0):window.innerWidth-d.left-d.width<=o.value.offset.value.right?(l.value="right",s.value=!0):s.value=!1}}),{docked:s,orientation:l,isDragging:n,movement:a,position:h}}function le(t,i,o,s){const l=e.ref(null),n=e.ref(null),a=e.ref(null),h=e.ref(null);return e.watch(t,(c,r)=>{l.value=r}),e.watch(i,(c,r)=>{n.value=r}),e.watch(o,(c,r)=>{a.value=r}),e.watch(s,(c,r)=>{h.value=r}),{lastLeft:l,lastTop:n,lastWidth:a,lastHeight:h}}function se(t,i,o,s){const l=e.ref(t.value.width),n=e.ref(t.value.left),a=e.computed(()=>t.value.width),h=e.computed(()=>t.value.left),c=e.computed(()=>o.value?o.value.x:null);return e.watch([a,h],([r,d])=>{(l.value==null||n.value==null||i.value)&&(l.value=r,n.value=d)}),e.watch(c,r=>{s.value&&o.value&&(n.value=r)}),{left:n,width:l}}function ie(t,i=e.ref({left:0,right:0,top:0,bottom:0})){const o=e.ref({});let s=!1;const l=()=>{if(!s&&t.value){const n=t.value.getBoundingClientRect();o.value.left=Math.max(n.left,i.value.left),o.value.top=Math.max(n.top,i.value.top),o.value.width=n.width,o.value.height=n.height,s=!0}};return e.onMounted(()=>{t.value&&l()}),e.watch(t,n=>{n&&l()}),{isIntialized:s,initialRect:o}}function ce(t,i=e.ref(!1),o=e.ref(!1),s=e.ref({left:0,right:0,top:0,bottom:0}),l={width:20,height:40}){const{initialRect:n}=ie(t,s),a=e.ref(!1);let h=0,c=0,r=0,d=0,v=0;const u=5,p=e.ref(null),m=x=>{if(!(!t.value||i.value))if(a.value){const w=x.clientX-d,b=x.clientY-v;if(p.value==="left"||p.value==="left-bottom-corner"){const M=c-w;M>l.width&&(n.value.width=M,n.value.left=h+w,t.value.style.left=n.value.left+"px",t.value.style.width=n.value.width+"px")}if(p.value==="right"||p.value==="right-bottom-corner"){const M=c+w;M>l.width&&(n.value.width=M,t.value.style.width=n.value.width+"px")}if(p.value==="bottom"||p.value==="left-bottom-corner"||p.value==="right-bottom-corner"){const M=r+b;M>l.height&&(n.value.height=M,t.value.style.height=n.value.height+"px")}}else{const w=t.value.getBoundingClientRect(),b=x.clientX-w.left,M=x.clientY-w.top,_=b<=u,L=b>=w.width-u,C=M>=w.height-u;_&&C&&o.value?(t.value.style.cursor="nesw-resize",p.value="left-bottom-corner"):L&&C&&!o.value?(t.value.style.cursor="nwse-resize",p.value="right-bottom-corner"):_&&o.value?(t.value.style.cursor="ew-resize",p.value="left"):L&&!o.value?(t.value.style.cursor="ew-resize",p.value="right"):C?(t.value.style.cursor="ns-resize",p.value="bottom"):(t.value.style.cursor="",p.value=null)}},f=x=>{if(!t.value||!p.value)return;const w=t.value.getBoundingClientRect();d=x.clientX,v=x.clientY,c=w.width,r=w.height,h=w.left,n.value.width=c,n.value.height=r,n.value.left=w.left,n.value.top=w.top,a.value=!0,document.addEventListener("mousemove",m),document.addEventListener("mouseup",g)},g=()=>{a.value=!1,p.value=null,t.value&&(t.value.style.cursor=""),document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",g)},E=()=>{t.value&&(t.value.removeEventListener("mousedown",f),t.value.removeEventListener("mousemove",m)),document.removeEventListener("mouseup",g)},k=()=>{t.value&&(t.value.addEventListener("mousedown",f),t.value.addEventListener("mousemove",m))};return e.onMounted(()=>{t.value&&k()}),e.onBeforeUnmount(()=>{E()}),e.watch(t,x=>{x?k():E()}),{rect:n,isResizing:a}}function ae(t,i,o,s){const l=()=>{if(t.value){const c=t.value;i.value?c.style.transition="width 0.3s ease-out, left 0.3s ease-out":c.style.transition="width 0.3s ease"}},n=()=>{t.value&&(t.value.style.transition="")},a=()=>{t.value&&t.value.removeEventListener("transitionend",n)},h=()=>{t.value&&t.value.addEventListener("transitionend",n)};e.onMounted(()=>{t.value&&t.value.addEventListener("transitionend",n)}),e.onBeforeUnmount(()=>{t.value&&t.value.removeEventListener("transitionend",n)}),e.watch(t,c=>{c?h():a()}),e.watch(o,()=>{l()}),e.watch(s,()=>{l()})}function re(t,i,o,s){const l=e.ref(window.innerWidth),n=e.ref(window.innerHeight),{docked:a,orientation:h,movement:c,position:r,isDragging:d}=ne(t,i,s),v=e.computed(()=>h.value==="right"),{rect:u,isResizing:p}=ce(t,o,v,s.value.offset),{width:m,left:f}=se(u,p,r,d),{lastTop:g,lastHeight:E}=le(e.computed(()=>u.value.left),e.computed(()=>u.value.top),e.computed(()=>u.value.width),e.computed(()=>u.value.height)),{autoOpened:k}=te(t,i,o);ae(t,v,o,k);const x=_=>{if(t.value){const L=t.value.getBoundingClientRect(),C=L.left+_;if(v.value){u.value.left=C;const pe=window.innerWidth-L.width-L.left;L.left<=0&&pe>=0&&_<0&&(u.value.left=Math.max(0,C)),window.innerWidth-L.width<=0&&(u.value.left=window.innerWidth-L.width)}else L.left+L.width>=window.innerWidth&&_<0&&(u.value.left=Math.max(0,C))}},w=()=>{const _=window.innerWidth-l.value;l.value=window.innerWidth,n.value=window.innerHeight,x(_)};e.onMounted(()=>{window.addEventListener("resize",w)}),e.onUnmounted(()=>{window.removeEventListener("resize",w)});const b=_=>{_?(u.value.width=O,v.value&&f.value&&m.value&&(u.value.left=f.value+m.value-O)):(u.value.width=m.value,v.value&&f.value&&m.value&&(u.value.left=f.value))},M=()=>{a.value?(u.value.top=s.value.offset.value.top,u.value.height=window.innerHeight-s.value.offset.value.top-s.value.offset.value.bottom):(u.value.top=g.value,u.value.height=E.value)};return e.watch(a,()=>{M()}),e.watch(o,_=>{b(_)}),e.watch(k,_=>{o.value&&!d.value&&b(!_)}),e.watch(c,_=>{if(_&&t.value){const C=t.value.getBoundingClientRect();u.value.left=C.left,u.value.top=C.top}}),{rect:u,orientation:h,reversed:v}}const ue=(t=>(e.pushScopeId("data-v-8645db4f"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",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"})],-1)),de={class:"ml-tool-palette-title"},me={class:"ml-tool-palette-content"},Y=z(e.defineComponent({__name:"MlToolPalette",props:e.mergeModels({title:{default:""},leftOffset:{default:0},rightOffset:{default:0},topOffset:{default:0},bottomOffset:{default:0}},{modelValue:{default:!0},modelModifiers:{}}),emits:e.mergeModels(["close"],["update:modelValue"]),setup(t,{emit:i}){const o=t,s=e.useModel(t,"modelValue"),l=i,n=e.ref(!1),a=e.ref(null),h=e.ref(null),c=e.computed(()=>({offset:e.ref({left:o.leftOffset,right:o.rightOffset,top:o.topOffset,bottom:o.bottomOffset})})),{rect:r,orientation:d,reversed:v}=re(h,a,n,c),u=e.computed(()=>({left:`${r.value.left}px`,top:`${r.value.top}px`,width:`${r.value.width}px`,height:`${r.value.height}px`})),p=e.computed(()=>v.value?{borderLeft:"1px solid var(--el-border-color)",borderRight:null}:{borderLeft:null,borderRight:"1px solid var(--el-border-color)"}),m=()=>{s.value=!1;const f=h.value;l("close",{x:f?f.clientLeft:0,y:f?f.clientTop:0})};return(f,g)=>{const E=y.ElIcon;return s.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"toolPaletteElement",ref:h,style:e.normalizeStyle([u.value]),class:"ml-tool-palette-dialog"},[e.createElementVNode("div",{class:e.normalizeClass(["ml-tool-palette-dialog-layout",e.unref(d)])},[e.createElementVNode("div",{ref_key:"titleBarElement",ref:a,class:"ml-tool-palette-title-bar",style:e.normalizeStyle(p.value)},[e.createVNode(E,{size:18,class:"ml-tool-palette-dialog-icon",onClick:m},{default:e.withCtx(()=>[ue]),_:1}),e.createVNode(I,{class:"ml-tool-palette-dialog-icon",modelValue:n.value,"onUpdate:modelValue":g[0]||(g[0]=k=>n.value=k),reverse:e.unref(v)},null,8,["modelValue","reverse"]),e.createElementVNode("span",de,e.toDisplayString(o.title),1)],4),e.createElementVNode("div",me,[e.renderSlot(f.$slots,"default",{},void 0,!0)])],2)],4)):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-8645db4f"]]),he={install(t){t.component("MlCollapse",T),t.component("MlDropdown",T),t.component("MlLanguage",S),t.component("MlStatusBar",N),t.component("MlToggleButton",W),t.component("MlToolBar",D),t.component("MlToolPalette",Y)}};B.MlCollapse=I,B.MlDropdown=T,B.MlLanguage=S,B.MlStatusBar=N,B.MlToggleButton=W,B.MlToolBar=D,B.MlToolPalette=Y,B.default=he,Object.defineProperties(B,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/lib/index.d.ts CHANGED
@@ -2,11 +2,14 @@ import MlCollapse from './components/MlCollapse.vue';
2
2
  import MlDropdown from './components/MlDropdown.vue';
3
3
  import MlLanguage from './components/MlLanguage.vue';
4
4
  import MlStatusBar from './components/MlStatusBar.vue';
5
+ import MlToggleButton from './components/MlToggleButton.vue';
5
6
  import MlToolBar from './components/MlToolBar.vue';
6
7
  import MlToolPalette from './components/MlToolPalette.vue';
7
- export { MlCollapse, MlDropdown, MlLanguage, MlStatusBar, MlToolBar, MlToolPalette };
8
+ export { MlCollapse, MlDropdown, MlLanguage, MlStatusBar, MlToggleButton, MlToolBar, MlToolPalette };
8
9
  export type { MlDropdownMenuItem } from './components/MlDropdown.vue';
10
+ export type { MlToggleButtonData } from './components/MlToggleButton.vue';
9
11
  export type { MlButtonData } from './components/MlToolBar.vue';
12
+ export * from './components/types';
10
13
  declare const _default: {
11
14
  install(app: any): void;
12
15
  };
package/lib/index.js CHANGED
@@ -2,9 +2,11 @@ import MlCollapse from './components/MlCollapse.vue';
2
2
  import MlDropdown from './components/MlDropdown.vue';
3
3
  import MlLanguage from './components/MlLanguage.vue';
4
4
  import MlStatusBar from './components/MlStatusBar.vue';
5
+ import MlToggleButton from './components/MlToggleButton.vue';
5
6
  import MlToolBar from './components/MlToolBar.vue';
6
7
  import MlToolPalette from './components/MlToolPalette.vue';
7
- export { MlCollapse, MlDropdown, MlLanguage, MlStatusBar, MlToolBar, MlToolPalette };
8
+ export { MlCollapse, MlDropdown, MlLanguage, MlStatusBar, MlToggleButton, MlToolBar, MlToolPalette };
9
+ export * from './components/types';
8
10
  // Optionally, export them as a plugin for Vue
9
11
  export default {
10
12
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -13,6 +15,7 @@ export default {
13
15
  app.component('MlDropdown', MlDropdown);
14
16
  app.component('MlLanguage', MlLanguage);
15
17
  app.component('MlStatusBar', MlStatusBar);
18
+ app.component('MlToggleButton', MlToggleButton);
16
19
  app.component('MlToolBar', MlToolBar);
17
20
  app.component('MlToolPalette', MlToolPalette);
18
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mlightcad/ui-components",
3
- "version": "0.0.15",
3
+ "version": "0.1.0",
4
4
  "description": "One common UI component library based on Element Plus",
5
5
  "license": "MIT",
6
6
  "author": "MLight Lee <mlight.lee@outlook.com>",
@@ -14,6 +14,8 @@
14
14
  "vue",
15
15
  "element plus",
16
16
  "cad",
17
+ "AutoCAD",
18
+ "tool palette",
17
19
  "mlight"
18
20
  ],
19
21
  "main": "dist/ui-components.umd.js",
@@ -0,0 +1,88 @@
1
+ <template>
2
+ <el-tooltip :content="tooltip" :hide-after="0">
3
+ <el-button class="ml-toggle-button" :icon="icon" @click="handleClicked" />
4
+ </el-tooltip>
5
+ </template>
6
+
7
+ <script lang="ts" setup>
8
+ import { computed } from 'vue'
9
+
10
+ import { MlIconType } from './types'
11
+
12
+ /**
13
+ * Data to descibe toggle button
14
+ */
15
+ export interface MlToggleButtonData {
16
+ /**
17
+ * Icon used when button is 'on'
18
+ */
19
+ onIcon: MlIconType
20
+ /**
21
+ * Icon used when button is 'off'.
22
+ */
23
+ offIcon: MlIconType
24
+ /**
25
+ * Tooltip when button is 'on'
26
+ */
27
+ onTooltip: string
28
+ /**
29
+ * Tooltip when button is 'off'
30
+ */
31
+ offTooltip: string
32
+ }
33
+
34
+ /**
35
+ * Properties of MlToggleButton component
36
+ */
37
+ interface Props {
38
+ /**
39
+ * Button size
40
+ */
41
+ size?: number | string
42
+ /**
43
+ * Data to descibe toggle button
44
+ */
45
+ data: MlToggleButtonData
46
+ }
47
+
48
+ interface Events {
49
+ /**
50
+ * Trigger this event when toggle button is clicked.
51
+ * @param state New state of toggle button
52
+ */
53
+ (e: 'click', state: boolean): void
54
+ }
55
+
56
+ const props = withDefaults(defineProps<Props>(), {
57
+ size: 30,
58
+ })
59
+ const on = defineModel({ default: false })
60
+ const emit = defineEmits<Events>()
61
+
62
+ const icon = computed(() => {
63
+ return on.value ? props.data.onIcon : props.data.offIcon
64
+ })
65
+
66
+ const size = computed(() => {
67
+ return props.size + 'px'
68
+ })
69
+
70
+ const tooltip = computed(() => {
71
+ return on.value ? props.data.onTooltip : props.data.offTooltip
72
+ })
73
+
74
+ const handleClicked = () => {
75
+ on.value = !on.value
76
+ emit('click', on.value)
77
+ }
78
+ </script>
79
+
80
+ <style scoped>
81
+ .ml-toggle-button {
82
+ border: none;
83
+ padding: 0px;
84
+ cursor: pointer;
85
+ width: v-bind(size);
86
+ height: v-bind(size);
87
+ }
88
+ </style>
@@ -26,9 +26,9 @@
26
26
  </template>
27
27
 
28
28
  <script setup lang="ts">
29
- import { computed, DefineComponent } from 'vue'
29
+ import { computed } from 'vue'
30
30
 
31
- export type MlIconType = () => DefineComponent
31
+ import { MlIconType } from './types'
32
32
 
33
33
  /**
34
34
  * Data to descibe button appearance
@@ -160,6 +160,11 @@ const handleClose = () => {
160
160
 
161
161
  .ml-tool-palette-dialog-icon {
162
162
  border-bottom: 1px solid var(--el-border-color);
163
+ cursor: default; /* Override parent move cursor on icon */
164
+ }
165
+
166
+ .ml-tool-palette-dialog-icon:hover {
167
+ color: var(--el-color-primary);
163
168
  }
164
169
 
165
170
  .ml-tool-palette-dialog-layout {
@@ -0,0 +1,3 @@
1
+ import { DefineComponent } from 'vue'
2
+
3
+ export type MlIconType = () => DefineComponent
package/src/index.ts CHANGED
@@ -2,6 +2,7 @@ import MlCollapse from './components/MlCollapse.vue'
2
2
  import MlDropdown from './components/MlDropdown.vue'
3
3
  import MlLanguage from './components/MlLanguage.vue'
4
4
  import MlStatusBar from './components/MlStatusBar.vue'
5
+ import MlToggleButton from './components/MlToggleButton.vue'
5
6
  import MlToolBar from './components/MlToolBar.vue'
6
7
  import MlToolPalette from './components/MlToolPalette.vue'
7
8
  export {
@@ -9,11 +10,14 @@ export {
9
10
  MlDropdown,
10
11
  MlLanguage,
11
12
  MlStatusBar,
13
+ MlToggleButton,
12
14
  MlToolBar,
13
15
  MlToolPalette
14
16
  }
15
17
  export type { MlDropdownMenuItem } from './components/MlDropdown.vue'
18
+ export type { MlToggleButtonData } from './components/MlToggleButton.vue'
16
19
  export type { MlButtonData } from './components/MlToolBar.vue'
20
+ export * from './components/types'
17
21
 
18
22
  // Optionally, export them as a plugin for Vue
19
23
  export default {
@@ -23,6 +27,7 @@ export default {
23
27
  app.component('MlDropdown', MlDropdown)
24
28
  app.component('MlLanguage', MlLanguage)
25
29
  app.component('MlStatusBar', MlStatusBar)
30
+ app.component('MlToggleButton', MlToggleButton)
26
31
  app.component('MlToolBar', MlToolBar)
27
32
  app.component('MlToolPalette', MlToolPalette)
28
33
  }