@mlightcad/ui-components 0.1.3 → 0.1.5

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-5adaeb5a]{border:none;padding:0;cursor:pointer;width:var(--021a85e9);height:var(--021a85e9)}.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-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 U, ElDropdownItem as ie, ElDropdownMenu as ue, ElDropdown as ce, ElButton as R, ElTooltip as ee, ElButtonGroup as re, ElTabPane as de, ElTabs as ve } 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-0dbba7bb]{border:none;padding:0;cursor:pointer;width:var(--10a97421);height:var(--10a97421)}.ml-toolbar-group[data-v-64f06546]{background-color:var(--el-fill-color)}.ml-sub-toolbar-group[data-v-64f06546]{background-color:var(--el-bg-color)}.ml-toolbar-button[data-v-64f06546]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px}.ml-toolbar-button-text[data-v-64f06546]{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 Q, ElDropdownItem as ve, ElDropdownMenu as me, ElDropdown as he, ElButton as ae, ElTooltip as ie, ElButtonGroup as fe, ElPopover as pe, ElTabPane as ge, ElTabs as _e } 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 x, createElementBlock as V, createElementVNode as B, defineComponent as Y, mergeModels as D, useModel as H, computed as _, createBlock as $, withCtx as T, resolveDynamicComponent as te, createVNode as S, Fragment as j, renderList as q, createTextVNode as me, toDisplayString as O, pushScopeId as le, popScopeId as ne, renderSlot as X, useCssVars as he, normalizeClass as N, normalizeStyle as F, createCommentVNode as oe, ref as p, onMounted as W, onUnmounted as J, watch as M, onBeforeUnmount as se, unref as K } from "vue";
5
+ import { openBlock as f, createElementBlock as W, createElementVNode as C, defineComponent as H, mergeModels as A, useModel as q, computed as M, createBlock as B, withCtx as L, resolveDynamicComponent as G, createVNode as $, Fragment as U, renderList as J, createTextVNode as we, toDisplayString as Y, pushScopeId as ue, popScopeId as re, renderSlot as K, useCssVars as be, ref as g, watch as z, normalizeStyle as N, createCommentVNode as j, onMounted as O, onUnmounted as R, onBeforeUnmount as ce, normalizeClass as te, unref as le } 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 xe = {
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
+ }, Le = /* @__PURE__ */ C("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), Me = [
24
+ Le
24
25
  ];
25
- function we(e, i) {
26
- return x(), V("svg", fe, [..._e]);
26
+ function ye(e, u) {
27
+ return f(), W("svg", xe, [...Me]);
27
28
  }
28
- const Q = { render: we }, ge = {
29
+ const oe = { render: ye }, ze = {
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
+ }, Ee = /* @__PURE__ */ C("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), Te = [
38
+ Ee
38
39
  ];
39
- function xe(e, i) {
40
- return x(), V("svg", ge, [...Le]);
40
+ function Ce(e, u) {
41
+ return f(), W("svg", ze, [...Te]);
41
42
  }
42
- const Z = { render: xe }, Me = /* @__PURE__ */ Y({
43
+ const ne = { render: Ce }, ke = /* @__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: i }) {
53
- const t = e, o = H(e, "modelValue"), n = i, l = _(() => t.reverse ? o.value ? Q : Z : o.value ? Z : Q), u = _(() => `${t.size}px`), m = () => {
54
- n("change", o.value), o.value = !o.value;
52
+ emits: /* @__PURE__ */ A(["change"], ["update:modelValue"]),
53
+ setup(e, { emit: u }) {
54
+ const t = e, s = q(e, "modelValue"), n = u, o = M(() => t.reverse ? s.value ? oe : ne : s.value ? ne : oe), i = M(() => `${t.size}px`), m = () => {
55
+ n("change", s.value), s.value = !s.value;
55
56
  };
56
- return (a, c) => {
57
- const d = U;
58
- return x(), $(d, {
59
- size: u.value,
57
+ return (a, r) => {
58
+ const h = Q;
59
+ return f(), B(h, {
60
+ size: i.value,
60
61
  onClick: m
61
62
  }, {
62
- default: T(() => [
63
- (x(), $(te(l.value)))
63
+ default: L(() => [
64
+ (f(), B(G(o.value)))
64
65
  ]),
65
66
  _: 1
66
67
  }, 8, ["size"]);
67
68
  };
68
69
  }
69
- }), ye = (e) => (le("data-v-3fc33b5d"), e = e(), ne(), e), Ee = /* @__PURE__ */ ye(() => /* @__PURE__ */ B("svg", {
70
+ }), Be = (e) => (ue("data-v-3fc33b5d"), e = e(), re(), e), $e = /* @__PURE__ */ Be(() => /* @__PURE__ */ C("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__ */ C("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)), We = /* @__PURE__ */ H({
81
82
  __name: "MlDropdown",
82
83
  props: {
83
84
  icon: {},
@@ -87,22 +88,22 @@ const Z = { render: xe }, Me = /* @__PURE__ */ Y({
87
88
  emits: {
88
89
  click: null
89
90
  },
90
- setup(e, { emit: i }) {
91
- const t = e, o = i, n = _(() => t.items.filter((u) => u.name !== t.current)), l = (u) => {
92
- o("click", u);
91
+ setup(e, { emit: u }) {
92
+ const t = e, s = u, n = M(() => t.items.filter((i) => i.name !== t.current)), o = (i) => {
93
+ s("click", i);
93
94
  };
94
- return (u, m) => {
95
- const a = U, c = ie, d = ue, w = ce;
96
- return x(), $(w, { onCommand: l }, {
97
- dropdown: T(() => [
98
- S(d, null, {
99
- default: T(() => [
100
- (x(!0), V(j, null, q(n.value, (r) => (x(), $(c, {
101
- key: r.text,
102
- command: r.name
95
+ return (i, m) => {
96
+ const a = Q, r = ve, h = me, x = he;
97
+ return f(), B(x, { onCommand: o }, {
98
+ dropdown: L(() => [
99
+ $(h, null, {
100
+ default: L(() => [
101
+ (f(!0), W(U, null, J(n.value, (d) => (f(), B(r, {
102
+ key: d.text,
103
+ command: d.name
103
104
  }, {
104
- default: T(() => [
105
- me(O(r.text), 1)
105
+ default: L(() => [
106
+ we(Y(d.text), 1)
106
107
  ]),
107
108
  _: 2
108
109
  }, 1032, ["command"]))), 128))
@@ -110,13 +111,13 @@ const Z = { render: xe }, Me = /* @__PURE__ */ Y({
110
111
  _: 1
111
112
  })
112
113
  ]),
113
- default: T(() => [
114
- S(a, {
114
+ default: L(() => [
115
+ $(a, {
115
116
  size: "30",
116
117
  class: "ml-dropdown-icon"
117
118
  }, {
118
- default: T(() => [
119
- Ee
119
+ default: L(() => [
120
+ $e
120
121
  ]),
121
122
  _: 1
122
123
  })
@@ -125,12 +126,12 @@ const Z = { render: xe }, Me = /* @__PURE__ */ Y({
125
126
  });
126
127
  };
127
128
  }
128
- }), A = (e, i) => {
129
+ }), F = (e, u) => {
129
130
  const t = e.__vccOpts || e;
130
- for (const [o, n] of i)
131
- t[o] = n;
131
+ for (const [s, n] of u)
132
+ t[s] = n;
132
133
  return t;
133
- }, G = /* @__PURE__ */ A(ze, [["__scopeId", "data-v-3fc33b5d"]]), Ce = '<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>', Te = /* @__PURE__ */ Y({
134
+ }, P = /* @__PURE__ */ F(We, [["__scopeId", "data-v-3fc33b5d"]]), Ie = '<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>', Ve = /* @__PURE__ */ H({
134
135
  __name: "MlLanguage",
135
136
  props: {
136
137
  languages: {},
@@ -139,55 +140,55 @@ const Z = { render: xe }, Me = /* @__PURE__ */ Y({
139
140
  emits: {
140
141
  click: null
141
142
  },
142
- setup(e, { emit: i }) {
143
- const t = e, o = i, n = (l) => {
144
- o("click", l);
143
+ setup(e, { emit: u }) {
144
+ const t = e, s = u, n = (o) => {
145
+ s("click", o);
145
146
  };
146
- return (l, u) => (x(), $(G, {
147
- icon: Ce,
147
+ return (o, i) => (f(), B(P, {
148
+ icon: Ie,
148
149
  items: t.languages,
149
150
  current: t.current,
150
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, i) {
155
- return x(), V("div", ke, [
156
- B("div", $e, [
157
- X(e.$slots, "left", {}, void 0, !0)
154
+ }), Se = {}, De = { class: "ml-status-bar" }, Oe = { class: "ml-status-bar-left" }, Ye = { class: "ml-status-bar-right" };
155
+ function Ae(e, u) {
156
+ return f(), W("div", De, [
157
+ C("div", Oe, [
158
+ K(e.$slots, "left", {}, void 0, !0)
158
159
  ]),
159
- B("div", Ie, [
160
- X(e.$slots, "right", {}, void 0, !0)
160
+ C("div", Ye, [
161
+ K(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 He = /* @__PURE__ */ F(Se, [["render", Ae], ["__scopeId", "data-v-d6a59cf0"]]), Xe = /* @__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: i }) {
175
- he((c) => ({
176
- "021a85e9": u.value
174
+ emits: /* @__PURE__ */ A(["click"], ["update:modelValue"]),
175
+ setup(e, { emit: u }) {
176
+ be((r) => ({
177
+ "10a97421": i.value
177
178
  }));
178
- const t = e, o = H(e, "modelValue"), n = i, l = _(() => o.value ? t.data.onIcon : t.data.offIcon), u = _(() => t.size + "px"), m = _(() => o.value ? t.data.onTooltip : t.data.offTooltip), a = () => {
179
- o.value = !o.value, n("click", o.value);
179
+ const t = e, s = q(e, "modelValue"), n = u, o = M(() => s.value ? t.data.onIcon : t.data.offIcon), i = M(() => t.size + "px"), m = M(() => s.value ? t.data.onTooltip : t.data.offTooltip), a = () => {
180
+ s.value = !s.value, n("click", s.value);
180
181
  };
181
- return (c, d) => {
182
- const w = R, r = ee;
183
- return x(), $(r, {
182
+ return (r, h) => {
183
+ const x = ae, d = ie;
184
+ return f(), B(d, {
184
185
  content: m.value,
185
186
  "hide-after": 0
186
187
  }, {
187
- default: T(() => [
188
- S(w, {
188
+ default: L(() => [
189
+ $(x, {
189
190
  class: "ml-toggle-button",
190
- icon: l.value,
191
+ icon: o.value,
191
192
  onClick: a
192
193
  }, null, 8, ["icon"])
193
194
  ]),
@@ -195,102 +196,219 @@ const We = /* @__PURE__ */ A(Be, [["render", Ve], ["__scopeId", "data-v-d6a59cf0
195
196
  }, 8, ["content"]);
196
197
  };
197
198
  }
198
- }), Se = /* @__PURE__ */ A(De, [["__scopeId", "data-v-5adaeb5a"]]), Ye = {
199
+ }), Ue = /* @__PURE__ */ F(Xe, [["__scopeId", "data-v-0dbba7bb"]]), Ne = {
199
200
  key: 0,
200
201
  class: "ml-toolbar-button-text"
201
- }, Ae = /* @__PURE__ */ Y({
202
+ }, Fe = {
203
+ key: 0,
204
+ class: "ml-toolbar-button-text"
205
+ }, Ge = {
206
+ key: 0,
207
+ class: "ml-toolbar-button-text"
208
+ }, je = /* @__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: i }) {
212
- const t = e, o = i, n = _(() => t.direction === "vertical" ? "ml-vertical-toolbar-button-group" : "ml-horizontal-toolbar-button-group"), l = _(() => t.size === "small" ? 20 : 30), u = _(() => {
213
- switch (t.size) {
214
- case "small":
215
- return 30;
216
- case "medium":
217
- return 50;
218
- }
219
- return 70;
220
- }), m = (d) => d.description ? d.description : d.text, a = _(() => t.size === "large"), c = (d) => {
221
- o("click", d);
222
- };
223
- return (d, w) => {
224
- const r = U, f = R, v = ee, y = re;
225
- return x(), $(y, {
226
- class: N(n.value)
216
+ emits: ["click", "toggle"],
217
+ setup(e, { emit: u }) {
218
+ const t = e, s = u, n = M(() => t.size === "small" ? 20 : 30), o = M(() => t.size === "small" ? 30 : t.size === "medium" ? 50 : 70), i = M(() => t.size === "large"), m = g(null), a = (l) => {
219
+ m.value = l;
220
+ }, r = () => {
221
+ m.value = null;
222
+ }, h = g({});
223
+ z(
224
+ () => t.items,
225
+ (l) => {
226
+ l.forEach((c) => {
227
+ c.toggle && h.value[c.command] === void 0 && (h.value[c.command] = c.toggle.value ?? !1);
228
+ });
229
+ },
230
+ { immediate: !0 }
231
+ );
232
+ const x = (l) => {
233
+ if (l.toggle) {
234
+ const c = !h.value[l.command];
235
+ h.value[l.command] = c, s("toggle", l.command, c);
236
+ } else
237
+ s("click", l.command);
238
+ }, d = (l) => {
239
+ l && s("click", l), r();
240
+ }, p = (l) => !!l.toggle && h.value[l.command], v = (l) => l.toggle ? p(l) ? l.toggle.on.icon : l.toggle.off.icon : l.icon, E = (l) => l.toggle ? p(l) ? l.toggle.on.text : l.toggle.off.text : l.text, k = (l) => l.toggle ? p(l) ? l.toggle.on.description ?? l.toggle.on.text : l.toggle.off.description ?? l.toggle.off.text : l.description ?? l.text, I = M(() => {
241
+ const l = "right-start", c = "bottom-start";
242
+ 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" ? l : c;
243
+ }), V = (l) => t.direction === "horizontal" && l.children ? l.children.length * o.value : o.value, T = (l) => t.direction === "vertical" && l.children ? o.value : 0;
244
+ return (l, c) => {
245
+ const w = Q, b = ae, y = ie, _ = fe, Z = pe;
246
+ return f(), B(_, {
247
+ class: "ml-toolbar-group",
248
+ direction: l.direction
227
249
  }, {
228
- default: T(() => [
229
- (x(!0), V(j, null, q(d.items, (E, k) => (x(), $(v, {
230
- key: E.text,
231
- content: m(E),
232
- "hide-after": 0
233
- }, {
234
- default: T(() => [
235
- (x(), $(f, {
236
- class: "ml-toolbar-button",
237
- style: F({ width: u.value + "px", height: u.value + "px" }),
238
- key: k,
239
- onClick: (I) => c(E.command)
250
+ default: L(() => [
251
+ (f(!0), W(U, null, J(l.items, (S, X) => {
252
+ var ee;
253
+ return f(), W(U, { key: X }, [
254
+ (ee = S.children) != null && ee.length ? (f(), B(Z, {
255
+ key: 0,
256
+ visible: m.value === X,
257
+ trigger: "manual",
258
+ placement: I.value,
259
+ "show-arrow": !0,
260
+ teleported: !0,
261
+ "popper-style": {
262
+ minWidth: V(S) + "px",
263
+ maxWidth: T(S) + "px",
264
+ "--el-popover-padding": "0px",
265
+ "--el-popover-border-width": "0px",
266
+ "--el-popover-border-color": "transparent"
267
+ },
268
+ onMouseenter: (D) => a(X),
269
+ onMouseleave: r
240
270
  }, {
241
- default: T(() => [
242
- B("div", null, [
243
- S(r, { size: l.value }, {
244
- default: T(() => [
245
- (x(), $(te(E.icon)))
246
- ]),
247
- _: 2
248
- }, 1032, ["size"]),
249
- a.value ? (x(), V("div", Ye, O(E.text), 1)) : oe("", !0)
250
- ])
271
+ reference: L(() => [
272
+ $(b, {
273
+ class: "ml-toolbar-button",
274
+ style: N({ width: o.value + "px", height: o.value + "px" }),
275
+ onMouseenter: (D) => a(X),
276
+ onMouseleave: r
277
+ }, {
278
+ default: L(() => [
279
+ $(y, {
280
+ content: k(S),
281
+ "auto-close": 3e3,
282
+ "show-after": 1e3,
283
+ "hide-after": 0
284
+ }, {
285
+ default: L(() => [
286
+ C("div", null, [
287
+ $(w, { size: n.value }, {
288
+ default: L(() => [
289
+ (f(), B(G(v(S))))
290
+ ]),
291
+ _: 2
292
+ }, 1032, ["size"]),
293
+ i.value ? (f(), W("div", Fe, Y(E(S)), 1)) : j("", !0)
294
+ ])
295
+ ]),
296
+ _: 2
297
+ }, 1032, ["content"])
298
+ ]),
299
+ _: 2
300
+ }, 1032, ["style", "onMouseenter"])
301
+ ]),
302
+ default: L(() => [
303
+ $(_, {
304
+ class: "ml-sub-toolbar-group",
305
+ direction: l.direction,
306
+ onMouseenter: (D) => a(X),
307
+ onMouseleave: r
308
+ }, {
309
+ default: L(() => [
310
+ (f(!0), W(U, null, J(S.children, (D, de) => (f(), B(y, {
311
+ key: de,
312
+ content: k(D),
313
+ "auto-close": 3e3,
314
+ "show-after": 1e3,
315
+ "hide-after": 0
316
+ }, {
317
+ default: L(() => [
318
+ $(b, {
319
+ class: "ml-toolbar-button",
320
+ style: N({ width: o.value + "px", height: o.value + "px" }),
321
+ onClick: (ct) => d(D.command)
322
+ }, {
323
+ default: L(() => [
324
+ C("div", null, [
325
+ $(w, { size: n.value }, {
326
+ default: L(() => [
327
+ (f(), B(G(v(D))))
328
+ ]),
329
+ _: 2
330
+ }, 1032, ["size"]),
331
+ i.value ? (f(), W("div", Ne, Y(E(D)), 1)) : j("", !0)
332
+ ])
333
+ ]),
334
+ _: 2
335
+ }, 1032, ["style", "onClick"])
336
+ ]),
337
+ _: 2
338
+ }, 1032, ["content"]))), 128))
339
+ ]),
340
+ _: 2
341
+ }, 1032, ["direction", "onMouseenter"])
251
342
  ]),
252
343
  _: 2
253
- }, 1032, ["style", "onClick"]))
254
- ]),
255
- _: 2
256
- }, 1032, ["content"]))), 128))
344
+ }, 1032, ["visible", "placement", "popper-style", "onMouseenter"])) : (f(), B(y, {
345
+ key: 1,
346
+ content: k(S),
347
+ "auto-close": 3e3,
348
+ "show-after": 1e3,
349
+ "hide-after": 0
350
+ }, {
351
+ default: L(() => [
352
+ $(b, {
353
+ class: "ml-toolbar-button",
354
+ style: N({ width: o.value + "px", height: o.value + "px" }),
355
+ onClick: (D) => x(S)
356
+ }, {
357
+ default: L(() => [
358
+ C("div", null, [
359
+ $(w, { size: n.value }, {
360
+ default: L(() => [
361
+ (f(), B(G(v(S))))
362
+ ]),
363
+ _: 2
364
+ }, 1032, ["size"]),
365
+ i.value ? (f(), W("div", Ge, Y(E(S)), 1)) : j("", !0)
366
+ ])
367
+ ]),
368
+ _: 2
369
+ }, 1032, ["style", "onClick"])
370
+ ]),
371
+ _: 2
372
+ }, 1032, ["content"]))
373
+ ], 64);
374
+ }), 128))
257
375
  ]),
258
376
  _: 1
259
- }, 8, ["class"]);
377
+ }, 8, ["direction"]);
260
378
  };
261
379
  }
262
- }), He = /* @__PURE__ */ A(Ae, [["__scopeId", "data-v-c6504e33"]]), P = 20;
263
- function Oe(e, i, t) {
264
- const o = p(!1), n = (a) => {
380
+ }), qe = /* @__PURE__ */ F(je, [["__scopeId", "data-v-64f06546"]]), se = 20;
381
+ function Je(e, u, t) {
382
+ const s = g(!1), n = (a) => {
265
383
  if (t.value && e.value) {
266
- const c = e.value.getBoundingClientRect(), d = a.clientX < c.left || a.clientX > c.right || a.clientY < c.top || a.clientY > c.bottom;
267
- o.value = !d;
384
+ const r = e.value.getBoundingClientRect(), h = a.clientX < r.left || a.clientX > r.right || a.clientY < r.top || a.clientY > r.bottom;
385
+ s.value = !h;
268
386
  }
269
- }, l = () => {
270
- t.value && (o.value = !0);
271
- }, u = () => {
272
- i.value && i.value.addEventListener("mousemove", l), e.value && e.value.addEventListener("mousemove", l);
387
+ }, o = () => {
388
+ t.value && (s.value = !0);
389
+ }, i = () => {
390
+ u.value && u.value.addEventListener("mousemove", o), e.value && e.value.addEventListener("mousemove", o);
273
391
  }, m = () => {
274
- i.value && i.value.removeEventListener("mousemove", l), e.value && e.value.removeEventListener("mousemove", l);
392
+ u.value && u.value.removeEventListener("mousemove", o), e.value && e.value.removeEventListener("mousemove", o);
275
393
  };
276
- return W(() => {
394
+ return O(() => {
277
395
  window.addEventListener("mousemove", n);
278
- }), J(() => {
396
+ }), R(() => {
279
397
  window.removeEventListener("mousemove", n);
280
- }), M(t, (a) => {
281
- a && (o.value = !1);
282
- }), M(e, (a) => {
283
- a ? u() : m();
284
- }), { autoOpened: o };
398
+ }), z(t, (a) => {
399
+ a && (s.value = !1);
400
+ }), z(e, (a) => {
401
+ a ? i() : m();
402
+ }), { autoOpened: s };
285
403
  }
286
- function Xe(e, i, t) {
287
- const o = p(!1), n = p(null), l = p(null), u = { x: 0, y: 0 }, m = _(() => n.value == null || l.value == null ? { x: 0, y: 0 } : {
288
- x: n.value.x - l.value.x,
289
- y: n.value.y - l.value.y
404
+ function Ke(e, u, t) {
405
+ const s = g(!1), n = g(null), o = g(null), i = { x: 0, y: 0 }, m = M(() => n.value == null || o.value == null ? { x: 0, y: 0 } : {
406
+ x: n.value.x - o.value.x,
407
+ y: n.value.y - o.value.y
290
408
  }), a = () => {
291
409
  if (e.value) {
292
410
  const v = e.value.getBoundingClientRect();
293
- l.value = {
411
+ o.value = {
294
412
  x: v.left,
295
413
  y: v.top
296
414
  }, n.value = {
@@ -298,258 +416,258 @@ function Xe(e, i, t) {
298
416
  y: v.top
299
417
  };
300
418
  }
301
- }, c = () => {
302
- e.value && e.value.addEventListener("mousedown", w);
303
- }, d = () => {
304
- e.value && e.value.removeEventListener("mousedown", w);
305
- }, w = (v) => {
419
+ }, r = () => {
420
+ e.value && e.value.addEventListener("mousedown", x);
421
+ }, h = () => {
422
+ e.value && e.value.removeEventListener("mousedown", x);
423
+ }, x = (v) => {
306
424
  if (e.value != null) {
307
- if (i && i.value) {
308
- const y = i.value.getBoundingClientRect();
309
- if (v.clientX < y.left || v.clientX > y.right || v.clientY < y.top || v.clientY > y.bottom) return;
425
+ if (u && u.value) {
426
+ const E = u.value.getBoundingClientRect();
427
+ if (v.clientX < E.left || v.clientX > E.right || v.clientY < E.top || v.clientY > E.bottom) return;
310
428
  }
311
- o.value = !0, u.x = v.clientX, u.y = v.clientY, a(), document.addEventListener("mousemove", r), document.addEventListener("mouseup", f);
429
+ s.value = !0, i.x = v.clientX, i.y = v.clientY, a(), document.addEventListener("mousemove", d), document.addEventListener("mouseup", p);
312
430
  }
313
- }, r = (v) => {
314
- if (o.value && l.value && n.value) {
315
- const y = window.innerWidth, E = window.innerHeight, k = e.value, I = k.getBoundingClientRect(), C = I.width, s = I.height, h = l.value.x + (v.clientX - u.x), b = l.value.y + (v.clientY - u.y);
431
+ }, d = (v) => {
432
+ if (s.value && o.value && n.value) {
433
+ const E = window.innerWidth, k = window.innerHeight, I = e.value, V = I.getBoundingClientRect(), T = V.width, l = V.height, c = o.value.x + (v.clientX - i.x), w = o.value.y + (v.clientY - i.y);
316
434
  n.value.x = Math.max(
317
435
  t ? t.value.offset.value.left : 0,
318
- h
436
+ c
319
437
  );
320
- const L = y - C;
438
+ const b = E - T;
321
439
  n.value.x = Math.min(
322
- t ? L - t.value.offset.value.right : L,
440
+ t ? b - t.value.offset.value.right : b,
323
441
  n.value.x
324
442
  ), n.value.y = Math.max(
325
443
  t ? t.value.offset.value.top : 0,
326
- Math.min(b, E - s)
444
+ Math.min(w, k - l)
327
445
  );
328
- const z = E - s;
446
+ const y = k - l;
329
447
  n.value.y = Math.min(
330
- t ? z - t.value.offset.value.bottom : z,
448
+ t ? y - t.value.offset.value.bottom : y,
331
449
  n.value.y
332
- ), k.style.left = n.value.x + "px", k.style.top = n.value.y + "px";
450
+ ), I.style.left = n.value.x + "px", I.style.top = n.value.y + "px";
333
451
  }
334
- }, f = () => {
335
- o.value = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", f);
452
+ }, p = () => {
453
+ s.value = !1, document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", p);
336
454
  };
337
- return W(() => {
338
- e.value && (a(), c());
339
- }), J(() => {
340
- e.value && e.value.removeEventListener("mousedown", w);
341
- }), M(e, (v) => {
342
- v ? (a(), c()) : d();
455
+ return O(() => {
456
+ e.value && (a(), r());
457
+ }), R(() => {
458
+ e.value && e.value.removeEventListener("mousedown", x);
459
+ }), z(e, (v) => {
460
+ v ? (a(), r()) : h();
343
461
  }), {
344
- isDragging: o,
462
+ isDragging: s,
345
463
  movement: m,
346
464
  position: n
347
465
  };
348
466
  }
349
- function Ue(e, i, t) {
350
- const o = p(!1), n = p("left"), { isDragging: l, movement: u, position: m } = Xe(
467
+ function Qe(e, u, t) {
468
+ const s = g(!1), n = g("left"), { isDragging: o, movement: i, position: m } = Ke(
351
469
  e,
352
- i,
470
+ u,
353
471
  t
354
472
  );
355
- return M(u, (a) => {
473
+ return z(i, (a) => {
356
474
  if (a && e.value) {
357
- const d = e.value.getBoundingClientRect();
358
- d.left <= t.value.offset.value.left ? (n.value = "left", o.value = !0) : window.innerWidth - d.left - d.width <= t.value.offset.value.right ? (n.value = "right", o.value = !0) : o.value = !1;
475
+ const h = e.value.getBoundingClientRect();
476
+ h.left <= t.value.offset.value.left ? (n.value = "left", s.value = !0) : window.innerWidth - h.left - h.width <= t.value.offset.value.right ? (n.value = "right", s.value = !0) : s.value = !1;
359
477
  }
360
478
  }), {
361
- docked: o,
479
+ docked: s,
362
480
  orientation: n,
363
- isDragging: l,
364
- movement: u,
481
+ isDragging: o,
482
+ movement: i,
365
483
  position: m
366
484
  };
367
485
  }
368
- function Ne(e, i, t, o) {
369
- const n = p(null), l = p(null), u = p(null), m = p(null);
370
- return M(e, (a, c) => {
371
- n.value = c;
372
- }), M(i, (a, c) => {
373
- l.value = c;
374
- }), M(t, (a, c) => {
375
- u.value = c;
376
- }), M(o, (a, c) => {
377
- m.value = c;
486
+ function Ze(e, u, t, s) {
487
+ const n = g(null), o = g(null), i = g(null), m = g(null);
488
+ return z(e, (a, r) => {
489
+ n.value = r;
490
+ }), z(u, (a, r) => {
491
+ o.value = r;
492
+ }), z(t, (a, r) => {
493
+ i.value = r;
494
+ }), z(s, (a, r) => {
495
+ m.value = r;
378
496
  }), {
379
497
  lastLeft: n,
380
- lastTop: l,
381
- lastWidth: u,
498
+ lastTop: o,
499
+ lastWidth: i,
382
500
  lastHeight: m
383
501
  };
384
502
  }
385
- function Fe(e, i, t, o) {
386
- const n = p(e.value.width), l = p(e.value.left), u = _(() => e.value.width), m = _(() => e.value.left), a = _(() => t.value ? t.value.x : null);
387
- return M([u, m], ([c, d]) => {
388
- (n.value == null || l.value == null || i.value) && (n.value = c, l.value = d);
389
- }), M(a, (c) => {
390
- o.value && t.value && (l.value = c);
391
- }), { left: l, width: n };
503
+ function Pe(e, u, t, s) {
504
+ const n = g(e.value.width), o = g(e.value.left), i = M(() => e.value.width), m = M(() => e.value.left), a = M(() => t.value ? t.value.x : null);
505
+ return z([i, m], ([r, h]) => {
506
+ (n.value == null || o.value == null || u.value) && (n.value = r, o.value = h);
507
+ }), z(a, (r) => {
508
+ s.value && t.value && (o.value = r);
509
+ }), { left: o, width: n };
392
510
  }
393
- function Ge(e, i = p({ left: 0, right: 0, top: 0, bottom: 0 })) {
394
- const t = p({});
395
- let o = !1;
511
+ function Re(e, u = g({ left: 0, right: 0, top: 0, bottom: 0 })) {
512
+ const t = g({});
513
+ let s = !1;
396
514
  const n = () => {
397
- if (!o && e.value) {
398
- const l = e.value.getBoundingClientRect();
399
- t.value.left = Math.max(l.left, i.value.left), t.value.top = Math.max(l.top, i.value.top), t.value.width = l.width, t.value.height = l.height, o = !0;
515
+ if (!s && e.value) {
516
+ const o = e.value.getBoundingClientRect();
517
+ t.value.left = Math.max(o.left, u.value.left), t.value.top = Math.max(o.top, u.value.top), t.value.width = o.width, t.value.height = o.height, s = !0;
400
518
  }
401
519
  };
402
- return W(() => {
520
+ return O(() => {
403
521
  e.value && n();
404
- }), M(e, (l) => {
405
- l && n();
522
+ }), z(e, (o) => {
523
+ o && n();
406
524
  }), {
407
- isIntialized: o,
525
+ isIntialized: s,
408
526
  initialRect: t
409
527
  };
410
528
  }
411
- function je(e, i = p(!1), t = p(!1), o = p({ left: 0, right: 0, top: 0, bottom: 0 }), n = { width: 20, height: 40 }) {
412
- const { initialRect: l } = Ge(e, o), u = p(!1);
413
- let m = 0, a = 0, c = 0, d = 0, w = 0;
414
- const r = 5, f = p(null), v = (C) => {
415
- if (!(!e.value || i.value))
416
- if (u.value) {
417
- const s = C.clientX - d, h = C.clientY - w;
418
- if (f.value === "left" || f.value === "left-bottom-corner") {
419
- const b = a - s;
420
- b > n.width && (l.value.width = b, l.value.left = m + s, e.value.style.left = l.value.left + "px", e.value.style.width = l.value.width + "px");
529
+ function et(e, u = g(!1), t = g(!1), s = g({ left: 0, right: 0, top: 0, bottom: 0 }), n = { width: 20, height: 40 }) {
530
+ const { initialRect: o } = Re(e, s), i = g(!1);
531
+ let m = 0, a = 0, r = 0, h = 0, x = 0;
532
+ const d = 5, p = g(null), v = (T) => {
533
+ if (!(!e.value || u.value))
534
+ if (i.value) {
535
+ const l = T.clientX - h, c = T.clientY - x;
536
+ if (p.value === "left" || p.value === "left-bottom-corner") {
537
+ const w = a - l;
538
+ w > n.width && (o.value.width = w, o.value.left = m + l, e.value.style.left = o.value.left + "px", e.value.style.width = o.value.width + "px");
421
539
  }
422
- if (f.value === "right" || f.value === "right-bottom-corner") {
423
- const b = a + s;
424
- b > n.width && (l.value.width = b, e.value.style.width = l.value.width + "px");
540
+ if (p.value === "right" || p.value === "right-bottom-corner") {
541
+ const w = a + l;
542
+ w > n.width && (o.value.width = w, e.value.style.width = o.value.width + "px");
425
543
  }
426
- if (f.value === "bottom" || f.value === "left-bottom-corner" || f.value === "right-bottom-corner") {
427
- const b = c + h;
428
- b > n.height && (l.value.height = b, e.value.style.height = l.value.height + "px");
544
+ if (p.value === "bottom" || p.value === "left-bottom-corner" || p.value === "right-bottom-corner") {
545
+ const w = r + c;
546
+ w > n.height && (o.value.height = w, e.value.style.height = o.value.height + "px");
429
547
  }
430
548
  } else {
431
- const s = e.value.getBoundingClientRect(), h = C.clientX - s.left, b = C.clientY - s.top, L = Math.abs(h) <= r, z = Math.abs(s.width - h) <= r, g = Math.abs(s.height - b) <= r;
432
- L && g && t.value ? (e.value.style.cursor = "nesw-resize", f.value = "left-bottom-corner") : z && g && !t.value ? (e.value.style.cursor = "nwse-resize", f.value = "right-bottom-corner") : L && t.value ? (e.value.style.cursor = "ew-resize", f.value = "left") : z && !t.value ? (e.value.style.cursor = "ew-resize", f.value = "right") : g ? (e.value.style.cursor = "ns-resize", f.value = "bottom") : (e.value.style.cursor = "", f.value = null);
549
+ const l = e.value.getBoundingClientRect(), c = T.clientX - l.left, w = T.clientY - l.top, b = Math.abs(c) <= d, y = Math.abs(l.width - c) <= d, _ = Math.abs(l.height - w) <= d;
550
+ b && _ && t.value ? (e.value.style.cursor = "nesw-resize", p.value = "left-bottom-corner") : y && _ && !t.value ? (e.value.style.cursor = "nwse-resize", p.value = "right-bottom-corner") : b && t.value ? (e.value.style.cursor = "ew-resize", p.value = "left") : y && !t.value ? (e.value.style.cursor = "ew-resize", p.value = "right") : _ ? (e.value.style.cursor = "ns-resize", p.value = "bottom") : (e.value.style.cursor = "", p.value = null);
433
551
  }
434
- }, y = (C) => {
435
- if (!e.value || !f.value) return;
436
- const s = e.value.getBoundingClientRect();
437
- d = C.clientX, w = C.clientY, a = s.width, c = s.height, m = s.left, l.value.width = a, l.value.height = c, l.value.left = s.left, l.value.top = s.top, u.value = !0, document.addEventListener("mousemove", v), document.addEventListener("mouseup", E);
438
- }, E = () => {
439
- u.value = !1, f.value = null, e.value && (e.value.style.cursor = ""), document.removeEventListener("mousemove", v), document.removeEventListener("mouseup", E);
552
+ }, E = (T) => {
553
+ if (!e.value || !p.value) return;
554
+ const l = e.value.getBoundingClientRect();
555
+ h = T.clientX, x = T.clientY, a = l.width, r = l.height, m = l.left, o.value.width = a, o.value.height = r, o.value.left = l.left, o.value.top = l.top, i.value = !0, document.addEventListener("mousemove", v), document.addEventListener("mouseup", k);
440
556
  }, k = () => {
441
- e.value && (e.value.removeEventListener("mousedown", y), e.value.removeEventListener("mousemove", v)), document.removeEventListener("mouseup", E);
557
+ i.value = !1, p.value = null, e.value && (e.value.style.cursor = ""), document.removeEventListener("mousemove", v), document.removeEventListener("mouseup", k);
442
558
  }, I = () => {
443
- e.value && (e.value.addEventListener("mousedown", y), e.value.addEventListener("mousemove", v));
559
+ e.value && (e.value.removeEventListener("mousedown", E), e.value.removeEventListener("mousemove", v)), document.removeEventListener("mouseup", k);
560
+ }, V = () => {
561
+ e.value && (e.value.addEventListener("mousedown", E), e.value.addEventListener("mousemove", v));
444
562
  };
445
- return W(() => {
446
- e.value && I();
447
- }), se(() => {
448
- k();
449
- }), M(e, (C) => {
450
- C ? I() : k();
451
- }), { rect: l, isResizing: u };
563
+ return O(() => {
564
+ e.value && V();
565
+ }), ce(() => {
566
+ I();
567
+ }), z(e, (T) => {
568
+ T ? V() : I();
569
+ }), { rect: o, isResizing: i };
452
570
  }
453
- function qe(e, i, t, o) {
571
+ function tt(e, u, t, s) {
454
572
  const n = () => {
455
573
  if (e.value) {
456
574
  const a = e.value;
457
- i.value ? a.style.transition = "width 0.3s ease-out, left 0.3s ease-out" : a.style.transition = "width 0.3s ease";
575
+ u.value ? a.style.transition = "width 0.3s ease-out, left 0.3s ease-out" : a.style.transition = "width 0.3s ease";
458
576
  }
459
- }, l = () => {
577
+ }, o = () => {
460
578
  e.value && (e.value.style.transition = "");
461
- }, u = () => {
462
- e.value && e.value.removeEventListener("transitionend", l);
579
+ }, i = () => {
580
+ e.value && e.value.removeEventListener("transitionend", o);
463
581
  }, m = () => {
464
- e.value && e.value.addEventListener("transitionend", l);
582
+ e.value && e.value.addEventListener("transitionend", o);
465
583
  };
466
- W(() => {
467
- e.value && e.value.addEventListener("transitionend", l);
468
- }), se(() => {
469
- e.value && e.value.removeEventListener("transitionend", l);
470
- }), M(e, (a) => {
471
- a ? m() : u();
472
- }), M(t, () => {
584
+ O(() => {
585
+ e.value && e.value.addEventListener("transitionend", o);
586
+ }), ce(() => {
587
+ e.value && e.value.removeEventListener("transitionend", o);
588
+ }), z(e, (a) => {
589
+ a ? m() : i();
590
+ }), z(t, () => {
473
591
  n();
474
- }), M(o, () => {
592
+ }), z(s, () => {
475
593
  n();
476
594
  });
477
595
  }
478
- function Je(e, i, t, o) {
479
- const n = p(window.innerWidth), l = p(window.innerHeight), { docked: u, orientation: m, movement: a, position: c, isDragging: d } = Ue(
596
+ function lt(e, u, t, s) {
597
+ const n = g(window.innerWidth), o = g(window.innerHeight), { docked: i, orientation: m, movement: a, position: r, isDragging: h } = Qe(
480
598
  e,
481
- i,
482
- o
483
- ), w = _(() => m.value === "right"), { rect: r, isResizing: f } = je(
599
+ u,
600
+ s
601
+ ), x = M(() => m.value === "right"), { rect: d, isResizing: p } = et(
484
602
  e,
485
603
  t,
486
- w,
487
- o.value.offset
488
- ), { width: v, left: y } = Fe(
604
+ x,
605
+ s.value.offset
606
+ ), { width: v, left: E } = Pe(
607
+ d,
608
+ p,
489
609
  r,
490
- f,
491
- c,
492
- d
493
- ), { lastTop: E, lastHeight: k } = Ne(
494
- _(() => r.value.left),
495
- _(() => r.value.top),
496
- _(() => r.value.width),
497
- _(() => r.value.height)
498
- ), { autoOpened: I } = Oe(e, i, t);
499
- qe(e, w, t, I);
500
- const C = (L) => {
610
+ h
611
+ ), { lastTop: k, lastHeight: I } = Ze(
612
+ M(() => d.value.left),
613
+ M(() => d.value.top),
614
+ M(() => d.value.width),
615
+ M(() => d.value.height)
616
+ ), { autoOpened: V } = Je(e, u, t);
617
+ tt(e, x, t, V);
618
+ const T = (b) => {
501
619
  if (e.value) {
502
- const z = e.value.getBoundingClientRect(), g = z.left + L;
503
- if (w.value) {
504
- r.value.left = g;
505
- const ae = window.innerWidth - z.width - z.left;
506
- z.left <= 0 && ae >= 0 && L < 0 && (r.value.left = Math.max(0, g)), window.innerWidth - z.width <= 0 && (r.value.left = window.innerWidth - z.width);
620
+ const y = e.value.getBoundingClientRect(), _ = y.left + b;
621
+ if (x.value) {
622
+ d.value.left = _;
623
+ const Z = window.innerWidth - y.width - y.left;
624
+ y.left <= 0 && Z >= 0 && b < 0 && (d.value.left = Math.max(0, _)), window.innerWidth - y.width <= 0 && (d.value.left = window.innerWidth - y.width);
507
625
  } else
508
- z.left + z.width >= window.innerWidth && L < 0 && (r.value.left = Math.max(0, g));
626
+ y.left + y.width >= window.innerWidth && b < 0 && (d.value.left = Math.max(0, _));
509
627
  }
510
- }, s = () => {
511
- const L = window.innerWidth - n.value;
512
- n.value = window.innerWidth, l.value = window.innerHeight, C(L);
628
+ }, l = () => {
629
+ const b = window.innerWidth - n.value;
630
+ n.value = window.innerWidth, o.value = window.innerHeight, T(b);
513
631
  };
514
- W(() => {
515
- window.addEventListener("resize", s);
516
- }), J(() => {
517
- window.removeEventListener("resize", s);
632
+ O(() => {
633
+ window.addEventListener("resize", l);
634
+ }), R(() => {
635
+ window.removeEventListener("resize", l);
518
636
  });
519
- const h = (L) => {
520
- L ? (r.value.width = P, w.value && y.value && v.value && (r.value.left = y.value + v.value - P)) : (r.value.width = v.value, w.value && y.value && v.value && (r.value.left = y.value));
521
- }, b = () => {
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);
637
+ const c = (b) => {
638
+ b ? (d.value.width = se, x.value && E.value && v.value && (d.value.left = E.value + v.value - se)) : (d.value.width = v.value, x.value && E.value && v.value && (d.value.left = E.value));
639
+ }, w = () => {
640
+ i.value ? (d.value.top = s.value.offset.value.top, d.value.height = window.innerHeight - s.value.offset.value.top - s.value.offset.value.bottom) : (d.value.top = k.value, d.value.height = I.value);
523
641
  };
524
- return M(u, () => {
525
- b();
526
- }), M(t, (L) => {
527
- h(L);
528
- }), M(I, (L) => {
529
- t.value && !d.value && h(!L);
530
- }), M(a, (L) => {
531
- if (L && e.value) {
532
- const g = e.value.getBoundingClientRect();
533
- r.value.left = g.left, r.value.top = g.top;
642
+ return z(i, () => {
643
+ w();
644
+ }), z(t, (b) => {
645
+ c(b);
646
+ }), z(V, (b) => {
647
+ t.value && !h.value && c(!b);
648
+ }), z(a, (b) => {
649
+ if (b && e.value) {
650
+ const _ = e.value.getBoundingClientRect();
651
+ d.value.left = _.left, d.value.top = _.top;
534
652
  }
535
- }), { rect: r, orientation: m, reversed: w };
653
+ }), { rect: d, orientation: m, reversed: x };
536
654
  }
537
- const Ke = (e) => (le("data-v-cd1a3c67"), e = e(), ne(), e), Qe = /* @__PURE__ */ Ke(() => /* @__PURE__ */ B("svg", {
655
+ const ot = (e) => (ue("data-v-cd1a3c67"), e = e(), re(), e), nt = /* @__PURE__ */ ot(() => /* @__PURE__ */ C("svg", {
538
656
  xmlns: "http://www.w3.org/2000/svg",
539
657
  width: "1em",
540
658
  height: "1em",
541
659
  viewBox: "0 0 1024 1024"
542
660
  }, [
543
- /* @__PURE__ */ B("path", {
661
+ /* @__PURE__ */ C("path", {
544
662
  fill: "currentColor",
545
663
  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
664
  })
547
- ], -1)), Ze = { class: "ml-tool-palette-title" }, Pe = { class: "ml-tool-palette-content" }, Re = {
665
+ ], -1)), st = { class: "ml-tool-palette-title" }, at = { class: "ml-tool-palette-content" }, it = {
548
666
  key: 1,
549
667
  class: "ml-tool-palette-default-content"
550
- }, et = /* @__PURE__ */ Y({
668
+ }, ut = /* @__PURE__ */ H({
551
669
  __name: "MlToolPalette",
552
- props: /* @__PURE__ */ D({
670
+ props: /* @__PURE__ */ A({
553
671
  title: { default: "" },
554
672
  tabs: { default: void 0 },
555
673
  leftOffset: { default: 0 },
@@ -563,144 +681,144 @@ const Ke = (e) => (le("data-v-cd1a3c67"), e = e(), ne(), e), Qe = /* @__PURE__ *
563
681
  activeTab: { default: "" },
564
682
  activeTabModifiers: {}
565
683
  }),
566
- emits: /* @__PURE__ */ D(["close", "tab-change", "tab-close"], ["update:modelValue", "update:activeTab"]),
567
- setup(e, { emit: i }) {
568
- const t = e, o = H(e, "modelValue"), n = H(e, "activeTab"), l = i, u = _(() => t.tabs && t.tabs.length > 0);
569
- W(() => {
570
- u.value && !n.value && t.tabs && t.tabs.length > 0 && (n.value = t.tabs[0].name);
571
- }), M(
684
+ emits: /* @__PURE__ */ A(["close", "tab-change", "tab-close"], ["update:modelValue", "update:activeTab"]),
685
+ setup(e, { emit: u }) {
686
+ const t = e, s = q(e, "modelValue"), n = q(e, "activeTab"), o = u, i = M(() => t.tabs && t.tabs.length > 0);
687
+ O(() => {
688
+ i.value && !n.value && t.tabs && t.tabs.length > 0 && (n.value = t.tabs[0].name);
689
+ }), z(
572
690
  () => t.tabs,
573
- (s) => {
574
- s && s.length > 0 && !n.value && (n.value = s[0].name);
691
+ (l) => {
692
+ l && l.length > 0 && !n.value && (n.value = l[0].name);
575
693
  },
576
694
  { immediate: !0 }
577
695
  );
578
- const m = p(!1), a = p(null), c = p(null), d = _(() => ({
579
- offset: p({
696
+ const m = g(!1), a = g(null), r = g(null), h = M(() => ({
697
+ offset: g({
580
698
  left: t.leftOffset,
581
699
  right: t.rightOffset,
582
700
  top: t.topOffset,
583
701
  bottom: t.bottomOffset
584
702
  })
585
703
  })), {
586
- rect: w,
587
- orientation: r,
588
- reversed: f
589
- } = Je(c, a, m, d), v = _(() => ({
590
- left: `${w.value.left}px`,
591
- top: `${w.value.top}px`,
592
- width: `${w.value.width}px`,
593
- height: `${w.value.height}px`
594
- })), y = _(
595
- () => f.value ? { borderLeft: "1px solid var(--el-border-color)", borderRight: null } : { borderLeft: null, borderRight: "1px solid var(--el-border-color)" }
596
- ), E = _(() => {
597
- if (u.value && n.value && t.tabs) {
598
- const s = t.tabs.find((h) => h.name === n.value);
599
- if (s != null && s.title) return s.title;
704
+ rect: x,
705
+ orientation: d,
706
+ reversed: p
707
+ } = lt(r, a, m, h), v = M(() => ({
708
+ left: `${x.value.left}px`,
709
+ top: `${x.value.top}px`,
710
+ width: `${x.value.width}px`,
711
+ height: `${x.value.height}px`
712
+ })), E = M(
713
+ () => p.value ? { borderLeft: "1px solid var(--el-border-color)", borderRight: null } : { borderLeft: null, borderRight: "1px solid var(--el-border-color)" }
714
+ ), k = M(() => {
715
+ if (i.value && n.value && t.tabs) {
716
+ const l = t.tabs.find((c) => c.name === n.value);
717
+ if (l != null && l.title) return l.title;
600
718
  }
601
719
  return t.title;
602
- }), k = () => {
603
- o.value = !1;
604
- const s = c.value;
605
- l("close", {
606
- x: s ? s.clientLeft : 0,
607
- y: s ? s.clientTop : 0
720
+ }), I = () => {
721
+ s.value = !1;
722
+ const l = r.value;
723
+ o("close", {
724
+ x: l ? l.clientLeft : 0,
725
+ y: l ? l.clientTop : 0
608
726
  });
609
- }, I = (s) => {
610
- l("tab-change", s);
611
- }, C = (s) => {
612
- if (l("tab-close", s), n.value === s && t.tabs) {
613
- const h = t.tabs.findIndex((b) => b.name === s);
614
- if (h >= 0) {
615
- const b = t.tabs[h + 1] || t.tabs[h - 1];
616
- b && (n.value = b.name);
727
+ }, V = (l) => {
728
+ o("tab-change", l);
729
+ }, T = (l) => {
730
+ if (o("tab-close", l), n.value === l && t.tabs) {
731
+ const c = t.tabs.findIndex((w) => w.name === l);
732
+ if (c >= 0) {
733
+ const w = t.tabs[c + 1] || t.tabs[c - 1];
734
+ w && (n.value = w.name);
617
735
  }
618
736
  }
619
737
  };
620
- return (s, h) => {
621
- const b = U, L = de, z = ve;
622
- return o.value ? (x(), V("div", {
738
+ return (l, c) => {
739
+ const w = Q, b = ge, y = _e;
740
+ return s.value ? (f(), W("div", {
623
741
  key: 0,
624
742
  ref_key: "toolPaletteElement",
625
- ref: c,
626
- style: F([v.value]),
627
- class: N(["ml-tool-palette-dialog", { "ml-tool-palette-disabled": s.disabled }])
743
+ ref: r,
744
+ style: N([v.value]),
745
+ class: te(["ml-tool-palette-dialog", { "ml-tool-palette-disabled": l.disabled }])
628
746
  }, [
629
- B("div", {
630
- class: N(["ml-tool-palette-dialog-layout", K(r)])
747
+ C("div", {
748
+ class: te(["ml-tool-palette-dialog-layout", le(d)])
631
749
  }, [
632
- B("div", {
750
+ C("div", {
633
751
  ref_key: "titleBarElement",
634
752
  ref: a,
635
753
  class: "ml-tool-palette-title-bar",
636
- style: F(y.value)
754
+ style: N(E.value)
637
755
  }, [
638
- S(b, {
756
+ $(w, {
639
757
  size: 18,
640
758
  class: "ml-tool-palette-dialog-icon",
641
- onClick: h[0] || (h[0] = (g) => !s.disabled && k())
759
+ onClick: c[0] || (c[0] = (_) => !l.disabled && I())
642
760
  }, {
643
- default: T(() => [
644
- Qe
761
+ default: L(() => [
762
+ nt
645
763
  ]),
646
764
  _: 1
647
765
  }),
648
- S(Me, {
766
+ $(ke, {
649
767
  class: "ml-tool-palette-dialog-icon",
650
768
  modelValue: m.value,
651
- "onUpdate:modelValue": h[1] || (h[1] = (g) => m.value = g),
652
- reverse: K(f),
653
- disabled: s.disabled
769
+ "onUpdate:modelValue": c[1] || (c[1] = (_) => m.value = _),
770
+ reverse: le(p),
771
+ disabled: l.disabled
654
772
  }, null, 8, ["modelValue", "reverse", "disabled"]),
655
- B("span", Ze, O(E.value), 1)
773
+ C("span", st, Y(k.value), 1)
656
774
  ], 4),
657
- B("div", Pe, [
658
- u.value ? (x(), $(z, {
775
+ C("div", at, [
776
+ i.value ? (f(), B(y, {
659
777
  key: 0,
660
778
  modelValue: n.value,
661
- "onUpdate:modelValue": h[2] || (h[2] = (g) => n.value = g),
779
+ "onUpdate:modelValue": c[2] || (c[2] = (_) => n.value = _),
662
780
  type: "border-card",
663
781
  class: "ml-tool-palette-tabs",
664
- onTabRemove: h[3] || (h[3] = (g) => !s.disabled && C),
665
- onTabChange: h[4] || (h[4] = (g) => !s.disabled && I)
782
+ onTabRemove: c[3] || (c[3] = (_) => !l.disabled && T),
783
+ onTabChange: c[4] || (c[4] = (_) => !l.disabled && V)
666
784
  }, {
667
- default: T(() => [
668
- (x(!0), V(j, null, q(t.tabs, (g) => (x(), $(L, {
669
- key: g.name,
670
- name: g.name,
671
- label: g.label
785
+ default: L(() => [
786
+ (f(!0), W(U, null, J(t.tabs, (_) => (f(), B(b, {
787
+ key: _.name,
788
+ name: _.name,
789
+ label: _.label
672
790
  }, {
673
- label: T(() => [
674
- B("span", null, O(g.label), 1)
791
+ label: L(() => [
792
+ C("span", null, Y(_.label), 1)
675
793
  ]),
676
- default: T(() => [
677
- X(s.$slots, `tab-${g.name}`, {}, void 0, !0)
794
+ default: L(() => [
795
+ K(l.$slots, `tab-${_.name}`, {}, void 0, !0)
678
796
  ]),
679
797
  _: 2
680
798
  }, 1032, ["name", "label"]))), 128))
681
799
  ]),
682
800
  _: 3
683
- }, 8, ["modelValue"])) : (x(), V("div", Re, [
684
- X(s.$slots, "default", {}, void 0, !0)
801
+ }, 8, ["modelValue"])) : (f(), W("div", it, [
802
+ K(l.$slots, "default", {}, void 0, !0)
685
803
  ]))
686
804
  ])
687
805
  ], 2)
688
- ], 6)) : oe("", !0);
806
+ ], 6)) : j("", !0);
689
807
  };
690
808
  }
691
- }), tt = /* @__PURE__ */ A(et, [["__scopeId", "data-v-cd1a3c67"]]), ht = {
809
+ }), rt = /* @__PURE__ */ F(ut, [["__scopeId", "data-v-cd1a3c67"]]), yt = {
692
810
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
693
811
  install(e) {
694
- e.component("MlCollapse", G), e.component("MlDropdown", G), e.component("MlLanguage", Te), e.component("MlStatusBar", We), e.component("MlToggleButton", Se), e.component("MlToolBar", He), e.component("MlToolPalette", tt);
812
+ e.component("MlCollapse", P), e.component("MlDropdown", P), e.component("MlLanguage", Ve), e.component("MlStatusBar", He), e.component("MlToggleButton", Ue), e.component("MlToolBar", qe), e.component("MlToolPalette", rt);
695
813
  }
696
814
  };
697
815
  export {
698
- Me as MlCollapse,
699
- G as MlDropdown,
700
- Te as MlLanguage,
701
- We as MlStatusBar,
702
- Se as MlToggleButton,
703
- He as MlToolBar,
704
- tt as MlToolPalette,
705
- ht as default
816
+ ke as MlCollapse,
817
+ P as MlDropdown,
818
+ Ve as MlLanguage,
819
+ He as MlStatusBar,
820
+ Ue as MlToggleButton,
821
+ qe as MlToolBar,
822
+ rt as MlToolPalette,
823
+ yt as default
706
824
  };