@mlightcad/ui-components 0.1.3 → 0.1.4

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