@mlightcad/ui-components 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui-components.es.js +179 -172
- package/dist/ui-components.umd.js +2 -2
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/src/components/MlStatusBar.vue +2 -2
- package/src/components/MlToolPalette.vue +13 -5
- package/src/composables/useBoundingRect.ts +1 -1
- package/src/composables/useDrag.ts +1 -1
package/dist/ui-components.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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-
|
|
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-ac7280f8]{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);border:1px solid var(--el-border-color)}.ml-status-bar-left[data-v-ac7280f8],.ml-status-bar-right[data-v-ac7280f8]{display:flex;align-items:center}.ml-status-bar-left[data-v-ac7280f8]>*{margin-right:10px}.ml-status-bar-right[data-v-ac7280f8]>*{margin-left:10px}.ml-vertical-toolbar-button-group[data-v-d5511111]{display:flex;flex-direction:column}.ml-horizontal-toolbar-button-group[data-v-d5511111]{display:flex;flex-direction:row}.ml-toolbar-button[data-v-d5511111]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px}.ml-toolbar-button-text[data-v-d5511111]{margin-left:0;margin-top:5px}.ml-tool-palette-dialog[data-v-c27d14f6]{cursor:default;width:300px;min-width:var(--collapsed-width);position:fixed;box-sizing:border-box;border:1px solid}.ml-tool-palette-dialog-icon[data-v-c27d14f6]{border-bottom:1px solid}.ml-tool-palette-dialog-layout[data-v-c27d14f6]{display:flex;height:100%}.ml-tool-palette-title-bar[data-v-c27d14f6]{width:var(--collapsed-width);display:flex;justify-content:left;align-items:center;cursor:move;writing-mode:vertical-rl;text-align:center}.ml-tool-palette-title[data-v-c27d14f6]{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-c27d14f6]{pointer-events:none;-webkit-user-select:none;user-select:none;flex-grow:1;display:flex;justify-content:space-around;background-color:var(--el-fill-color);overflow:hidden}.ml-tool-palette-dialog-layout.left .ml-tool-palette-title-bar[data-v-c27d14f6]{order:1}.ml-tool-palette-dialog-layout.left .ml-tool-palette-content[data-v-c27d14f6],.ml-tool-palette-dialog-layout.right .ml-tool-palette-title-bar[data-v-c27d14f6]{order:2}.ml-tool-palette-dialog-layout.right .ml-tool-palette-content[data-v-c27d14f6]{order:1}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
2
|
import { ElIcon as A, ElDropdownItem as se, ElDropdownMenu as ie, ElDropdown as ue, ElButton as ae, ElTooltip as ce, ElButtonGroup as re } from "element-plus/es";
|
|
3
3
|
import "element-plus/es/components/base/style/css";
|
|
4
4
|
import "element-plus/es/components/icon/style/css";
|
|
5
|
-
import { openBlock as
|
|
5
|
+
import { openBlock as y, createElementBlock as I, createElementVNode as b, defineComponent as V, mergeModels as Y, useModel as K, computed as g, createBlock as W, withCtx as k, resolveDynamicComponent as Q, createVNode as S, Fragment as Z, renderList as P, createTextVNode as ve, toDisplayString as U, pushScopeId as R, popScopeId as ee, renderSlot as O, normalizeClass as te, normalizeStyle as X, createCommentVNode as ne, ref as m, onMounted as D, onUnmounted as F, watch as L, onBeforeUnmount as le, unref as G } from "vue";
|
|
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";
|
|
@@ -21,9 +21,9 @@ const de = {
|
|
|
21
21
|
me
|
|
22
22
|
];
|
|
23
23
|
function fe(e, s) {
|
|
24
|
-
return
|
|
24
|
+
return y(), I("svg", de, [...he]);
|
|
25
25
|
}
|
|
26
|
-
const
|
|
26
|
+
const j = { render: fe }, pe = {
|
|
27
27
|
xmlns: "http://www.w3.org/2000/svg",
|
|
28
28
|
width: "1em",
|
|
29
29
|
height: "1em",
|
|
@@ -35,9 +35,9 @@ const G = { render: fe }, pe = {
|
|
|
35
35
|
we
|
|
36
36
|
];
|
|
37
37
|
function ge(e, s) {
|
|
38
|
-
return
|
|
38
|
+
return y(), I("svg", pe, [..._e]);
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const q = { render: ge }, Le = /* @__PURE__ */ V({
|
|
41
41
|
__name: "MlCollapse",
|
|
42
42
|
props: /* @__PURE__ */ Y({
|
|
43
43
|
size: { default: 18 },
|
|
@@ -48,23 +48,23 @@ const j = { render: ge }, Le = /* @__PURE__ */ V({
|
|
|
48
48
|
}),
|
|
49
49
|
emits: /* @__PURE__ */ Y(["change"], ["update:modelValue"]),
|
|
50
50
|
setup(e, { emit: s }) {
|
|
51
|
-
const t = e, o =
|
|
51
|
+
const t = e, o = K(e, "modelValue"), l = s, n = g(() => t.reverse ? o.value ? j : q : o.value ? q : j), u = g(() => `${t.size}px`), d = () => {
|
|
52
52
|
l("change", o.value), o.value = !o.value;
|
|
53
53
|
};
|
|
54
54
|
return (i, a) => {
|
|
55
|
-
const
|
|
56
|
-
return
|
|
55
|
+
const r = A;
|
|
56
|
+
return y(), W(r, {
|
|
57
57
|
size: u.value,
|
|
58
58
|
onClick: d
|
|
59
59
|
}, {
|
|
60
|
-
default:
|
|
61
|
-
(
|
|
60
|
+
default: k(() => [
|
|
61
|
+
(y(), W(Q(n.value)))
|
|
62
62
|
]),
|
|
63
63
|
_: 1
|
|
64
64
|
}, 8, ["size"]);
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
}), xe = (e) => (
|
|
67
|
+
}), xe = (e) => (R("data-v-3fc33b5d"), e = e(), ee(), e), ye = /* @__PURE__ */ xe(() => /* @__PURE__ */ b("svg", {
|
|
68
68
|
preserveAspectRatio: "xMidYMid meet",
|
|
69
69
|
viewBox: "0 0 24 24",
|
|
70
70
|
width: "1.2em",
|
|
@@ -75,7 +75,7 @@ const j = { render: ge }, Le = /* @__PURE__ */ V({
|
|
|
75
75
|
fill: "currentColor",
|
|
76
76
|
d: "m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"
|
|
77
77
|
})
|
|
78
|
-
], -1)),
|
|
78
|
+
], -1)), Me = /* @__PURE__ */ V({
|
|
79
79
|
__name: "MlDropdown",
|
|
80
80
|
props: {
|
|
81
81
|
icon: {},
|
|
@@ -86,21 +86,21 @@ const j = { render: ge }, Le = /* @__PURE__ */ V({
|
|
|
86
86
|
click: null
|
|
87
87
|
},
|
|
88
88
|
setup(e, { emit: s }) {
|
|
89
|
-
const t = e, o = s, l =
|
|
89
|
+
const t = e, o = s, l = g(() => t.items.filter((u) => u.name !== t.current)), n = (u) => {
|
|
90
90
|
o("click", u);
|
|
91
91
|
};
|
|
92
92
|
return (u, d) => {
|
|
93
|
-
const i = A, a = se,
|
|
94
|
-
return
|
|
95
|
-
dropdown:
|
|
96
|
-
S(
|
|
97
|
-
default:
|
|
98
|
-
(
|
|
93
|
+
const i = A, a = se, r = ie, w = ue;
|
|
94
|
+
return y(), W(w, { onCommand: n }, {
|
|
95
|
+
dropdown: k(() => [
|
|
96
|
+
S(r, null, {
|
|
97
|
+
default: k(() => [
|
|
98
|
+
(y(!0), I(Z, null, P(l.value, (c) => (y(), W(a, {
|
|
99
99
|
key: c.text,
|
|
100
100
|
command: c.name
|
|
101
101
|
}, {
|
|
102
|
-
default:
|
|
103
|
-
ve(
|
|
102
|
+
default: k(() => [
|
|
103
|
+
ve(U(c.text), 1)
|
|
104
104
|
]),
|
|
105
105
|
_: 2
|
|
106
106
|
}, 1032, ["command"]))), 128))
|
|
@@ -108,13 +108,13 @@ const j = { render: ge }, Le = /* @__PURE__ */ V({
|
|
|
108
108
|
_: 1
|
|
109
109
|
})
|
|
110
110
|
]),
|
|
111
|
-
default:
|
|
111
|
+
default: k(() => [
|
|
112
112
|
S(i, {
|
|
113
113
|
size: "30",
|
|
114
114
|
class: "ml-dropdown-icon"
|
|
115
115
|
}, {
|
|
116
|
-
default:
|
|
117
|
-
|
|
116
|
+
default: k(() => [
|
|
117
|
+
ye
|
|
118
118
|
]),
|
|
119
119
|
_: 1
|
|
120
120
|
})
|
|
@@ -128,7 +128,7 @@ const j = { render: ge }, Le = /* @__PURE__ */ V({
|
|
|
128
128
|
for (const [o, l] of s)
|
|
129
129
|
t[o] = l;
|
|
130
130
|
return t;
|
|
131
|
-
},
|
|
131
|
+
}, N = /* @__PURE__ */ H(Me, [["__scopeId", "data-v-3fc33b5d"]]), Ee = '<svg preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" width="1.2em" height="1.2em" data-v-63d067da=""><path fill="currentColor" d="m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"></path></svg>', ze = /* @__PURE__ */ V({
|
|
132
132
|
__name: "MlLanguage",
|
|
133
133
|
props: {
|
|
134
134
|
languages: {},
|
|
@@ -141,7 +141,7 @@ const j = { render: ge }, Le = /* @__PURE__ */ V({
|
|
|
141
141
|
const t = e, o = s, l = (n) => {
|
|
142
142
|
o("click", n);
|
|
143
143
|
};
|
|
144
|
-
return (n, u) => (
|
|
144
|
+
return (n, u) => (y(), W(N, {
|
|
145
145
|
icon: Ee,
|
|
146
146
|
items: t.languages,
|
|
147
147
|
current: t.current,
|
|
@@ -150,7 +150,7 @@ const j = { render: ge }, Le = /* @__PURE__ */ V({
|
|
|
150
150
|
}
|
|
151
151
|
}), be = {}, Ce = { class: "ml-status-bar" }, Be = { class: "ml-status-bar-left" }, ke = { class: "ml-status-bar-right" };
|
|
152
152
|
function $e(e, s) {
|
|
153
|
-
return
|
|
153
|
+
return y(), I("div", Ce, [
|
|
154
154
|
b("div", Be, [
|
|
155
155
|
O(e.$slots, "left", {}, void 0, !0)
|
|
156
156
|
]),
|
|
@@ -159,7 +159,7 @@ function $e(e, s) {
|
|
|
159
159
|
])
|
|
160
160
|
]);
|
|
161
161
|
}
|
|
162
|
-
const Te = /* @__PURE__ */ H(be, [["render", $e], ["__scopeId", "data-v-
|
|
162
|
+
const Te = /* @__PURE__ */ H(be, [["render", $e], ["__scopeId", "data-v-ac7280f8"]]), We = {
|
|
163
163
|
key: 0,
|
|
164
164
|
class: "ml-toolbar-button-text"
|
|
165
165
|
}, Ie = /* @__PURE__ */ V({
|
|
@@ -173,7 +173,7 @@ const Te = /* @__PURE__ */ H(be, [["render", $e], ["__scopeId", "data-v-b0c9d107
|
|
|
173
173
|
click: null
|
|
174
174
|
},
|
|
175
175
|
setup(e, { emit: s }) {
|
|
176
|
-
const t = e, o = s, l =
|
|
176
|
+
const t = e, o = s, l = g(() => t.direction === "vertical" ? "ml-vertical-toolbar-button-group" : "ml-horizontal-toolbar-button-group"), n = g(() => t.size === "small" ? 20 : 30), u = g(() => {
|
|
177
177
|
switch (t.size) {
|
|
178
178
|
case "small":
|
|
179
179
|
return 30;
|
|
@@ -181,36 +181,36 @@ const Te = /* @__PURE__ */ H(be, [["render", $e], ["__scopeId", "data-v-b0c9d107
|
|
|
181
181
|
return 50;
|
|
182
182
|
}
|
|
183
183
|
return 70;
|
|
184
|
-
}), d = (
|
|
185
|
-
o("click",
|
|
184
|
+
}), d = (r) => r.description ? r.description : r.text, i = g(() => t.size === "large"), a = (r) => {
|
|
185
|
+
o("click", r);
|
|
186
186
|
};
|
|
187
|
-
return (
|
|
188
|
-
const c = A, h = ae,
|
|
189
|
-
return
|
|
190
|
-
class:
|
|
187
|
+
return (r, w) => {
|
|
188
|
+
const c = A, h = ae, v = ce, f = re;
|
|
189
|
+
return y(), W(f, {
|
|
190
|
+
class: te(l.value)
|
|
191
191
|
}, {
|
|
192
|
-
default:
|
|
193
|
-
(
|
|
192
|
+
default: k(() => [
|
|
193
|
+
(y(!0), I(Z, null, P(r.items, (x, C) => (y(), W(v, {
|
|
194
194
|
key: x.text,
|
|
195
195
|
content: d(x),
|
|
196
196
|
"hide-after": 0
|
|
197
197
|
}, {
|
|
198
|
-
default:
|
|
199
|
-
(
|
|
198
|
+
default: k(() => [
|
|
199
|
+
(y(), W(h, {
|
|
200
200
|
class: "ml-toolbar-button",
|
|
201
|
-
style:
|
|
201
|
+
style: X({ width: u.value + "px", height: u.value + "px" }),
|
|
202
202
|
key: C,
|
|
203
|
-
onClick: (
|
|
203
|
+
onClick: (B) => a(x.command)
|
|
204
204
|
}, {
|
|
205
|
-
default:
|
|
205
|
+
default: k(() => [
|
|
206
206
|
b("div", null, [
|
|
207
207
|
S(c, { size: n.value }, {
|
|
208
|
-
default:
|
|
209
|
-
(
|
|
208
|
+
default: k(() => [
|
|
209
|
+
(y(), W(Q(x.icon)))
|
|
210
210
|
]),
|
|
211
211
|
_: 2
|
|
212
212
|
}, 1032, ["size"]),
|
|
213
|
-
i.value ? (
|
|
213
|
+
i.value ? (y(), I("div", We, U(x.text), 1)) : ne("", !0)
|
|
214
214
|
])
|
|
215
215
|
]),
|
|
216
216
|
_: 2
|
|
@@ -223,12 +223,12 @@ const Te = /* @__PURE__ */ H(be, [["render", $e], ["__scopeId", "data-v-b0c9d107
|
|
|
223
223
|
}, 8, ["class"]);
|
|
224
224
|
};
|
|
225
225
|
}
|
|
226
|
-
}), De = /* @__PURE__ */ H(Ie, [["__scopeId", "data-v-
|
|
226
|
+
}), De = /* @__PURE__ */ H(Ie, [["__scopeId", "data-v-d5511111"]]), J = 20;
|
|
227
227
|
function Se(e, s, t) {
|
|
228
228
|
const o = m(!1), l = (i) => {
|
|
229
229
|
if (t.value && e.value) {
|
|
230
|
-
const a = e.value.getBoundingClientRect(),
|
|
231
|
-
o.value = !
|
|
230
|
+
const a = e.value.getBoundingClientRect(), r = i.clientX < a.left || i.clientX > a.right || i.clientY < a.top || i.clientY > a.bottom;
|
|
231
|
+
o.value = !r;
|
|
232
232
|
}
|
|
233
233
|
}, n = () => {
|
|
234
234
|
t.value && (o.value = !0);
|
|
@@ -239,59 +239,59 @@ function Se(e, s, t) {
|
|
|
239
239
|
};
|
|
240
240
|
return D(() => {
|
|
241
241
|
window.addEventListener("mousemove", l);
|
|
242
|
-
}),
|
|
242
|
+
}), F(() => {
|
|
243
243
|
window.removeEventListener("mousemove", l);
|
|
244
|
-
}),
|
|
244
|
+
}), L(t, (i) => {
|
|
245
245
|
i && (o.value = !1);
|
|
246
|
-
}),
|
|
246
|
+
}), L(e, (i) => {
|
|
247
247
|
i ? u() : d();
|
|
248
248
|
}), { autoOpened: o };
|
|
249
249
|
}
|
|
250
250
|
function Ve(e, s, t) {
|
|
251
|
-
const o = m(!1), l = m(null), n = m(null), u = { x: 0, y: 0 }, d =
|
|
251
|
+
const o = m(!1), l = m(null), n = m(null), u = { x: 0, y: 0 }, d = g(() => l.value == null || n.value == null ? { x: 0, y: 0 } : {
|
|
252
252
|
x: l.value.x - n.value.x,
|
|
253
253
|
y: l.value.y - n.value.y
|
|
254
254
|
}), i = () => {
|
|
255
255
|
if (e.value) {
|
|
256
|
-
const
|
|
256
|
+
const v = e.value.getBoundingClientRect();
|
|
257
257
|
n.value = {
|
|
258
|
-
x:
|
|
259
|
-
y:
|
|
258
|
+
x: v.left,
|
|
259
|
+
y: v.top
|
|
260
260
|
}, l.value = {
|
|
261
|
-
x:
|
|
262
|
-
y:
|
|
261
|
+
x: v.left,
|
|
262
|
+
y: v.top
|
|
263
263
|
};
|
|
264
264
|
}
|
|
265
265
|
}, a = () => {
|
|
266
|
-
e.value && e.value.addEventListener("mousedown",
|
|
267
|
-
},
|
|
268
|
-
e.value && e.value.removeEventListener("mousedown",
|
|
269
|
-
},
|
|
266
|
+
e.value && e.value.addEventListener("mousedown", w);
|
|
267
|
+
}, r = () => {
|
|
268
|
+
e.value && e.value.removeEventListener("mousedown", w);
|
|
269
|
+
}, w = (v) => {
|
|
270
270
|
if (e.value != null) {
|
|
271
271
|
if (s && s.value) {
|
|
272
|
-
const
|
|
273
|
-
if (
|
|
272
|
+
const f = s.value.getBoundingClientRect();
|
|
273
|
+
if (v.clientX < f.left || v.clientX > f.right || v.clientY < f.top || v.clientY > f.bottom) return;
|
|
274
274
|
}
|
|
275
|
-
o.value = !0, u.x =
|
|
275
|
+
o.value = !0, u.x = v.clientX, u.y = v.clientY, i(), document.addEventListener("mousemove", c), document.addEventListener("mouseup", h);
|
|
276
276
|
}
|
|
277
|
-
}, c = (
|
|
277
|
+
}, c = (v) => {
|
|
278
278
|
if (o.value && n.value && l.value) {
|
|
279
|
-
const
|
|
279
|
+
const f = window.innerWidth, x = window.innerHeight, C = e.value, B = C.getBoundingClientRect(), z = B.width, p = B.height, T = n.value.x + (v.clientX - u.x), E = n.value.y + (v.clientY - u.y);
|
|
280
280
|
l.value.x = Math.max(
|
|
281
281
|
t ? t.value.offset.value.left : 0,
|
|
282
282
|
T
|
|
283
283
|
);
|
|
284
|
-
const
|
|
284
|
+
const _ = f - z;
|
|
285
285
|
l.value.x = Math.min(
|
|
286
|
-
t ?
|
|
286
|
+
t ? _ - t.value.offset.value.right : _,
|
|
287
287
|
l.value.x
|
|
288
288
|
), l.value.y = Math.max(
|
|
289
289
|
t ? t.value.offset.value.top : 0,
|
|
290
|
-
Math.min(E, x -
|
|
290
|
+
Math.min(E, x - p)
|
|
291
291
|
);
|
|
292
|
-
const
|
|
292
|
+
const M = x - p - 1;
|
|
293
293
|
l.value.y = Math.min(
|
|
294
|
-
t ?
|
|
294
|
+
t ? M - t.value.offset.value.bottom : M,
|
|
295
295
|
l.value.y
|
|
296
296
|
), C.style.left = l.value.x + "px", C.style.top = l.value.y + "px";
|
|
297
297
|
}
|
|
@@ -300,10 +300,10 @@ function Ve(e, s, t) {
|
|
|
300
300
|
};
|
|
301
301
|
return D(() => {
|
|
302
302
|
e.value && (i(), a());
|
|
303
|
-
}),
|
|
304
|
-
e.value && e.value.removeEventListener("mousedown",
|
|
305
|
-
}),
|
|
306
|
-
|
|
303
|
+
}), F(() => {
|
|
304
|
+
e.value && e.value.removeEventListener("mousedown", w);
|
|
305
|
+
}), L(e, (v) => {
|
|
306
|
+
v ? (i(), a()) : r();
|
|
307
307
|
}), {
|
|
308
308
|
isDragging: o,
|
|
309
309
|
movement: d,
|
|
@@ -316,10 +316,10 @@ function Ye(e, s, t) {
|
|
|
316
316
|
s,
|
|
317
317
|
t
|
|
318
318
|
);
|
|
319
|
-
return
|
|
319
|
+
return L(u, (i) => {
|
|
320
320
|
if (i && e.value) {
|
|
321
|
-
const
|
|
322
|
-
|
|
321
|
+
const r = e.value.getBoundingClientRect();
|
|
322
|
+
r.left <= t.value.offset.value.left ? (l.value = "left", o.value = !0) : window.innerWidth - r.left - r.width <= t.value.offset.value.right ? (l.value = "right", o.value = !0) : o.value = !1;
|
|
323
323
|
}
|
|
324
324
|
}), {
|
|
325
325
|
docked: o,
|
|
@@ -331,13 +331,13 @@ function Ye(e, s, t) {
|
|
|
331
331
|
}
|
|
332
332
|
function Ae(e, s, t, o) {
|
|
333
333
|
const l = m(null), n = m(null), u = m(null), d = m(null);
|
|
334
|
-
return
|
|
334
|
+
return L(e, (i, a) => {
|
|
335
335
|
l.value = a;
|
|
336
|
-
}),
|
|
336
|
+
}), L(s, (i, a) => {
|
|
337
337
|
n.value = a;
|
|
338
|
-
}),
|
|
338
|
+
}), L(t, (i, a) => {
|
|
339
339
|
u.value = a;
|
|
340
|
-
}),
|
|
340
|
+
}), L(o, (i, a) => {
|
|
341
341
|
d.value = a;
|
|
342
342
|
}), {
|
|
343
343
|
lastLeft: l,
|
|
@@ -347,10 +347,10 @@ function Ae(e, s, t, o) {
|
|
|
347
347
|
};
|
|
348
348
|
}
|
|
349
349
|
function He(e, s, t, o) {
|
|
350
|
-
const l = m(e.value.width), n = m(e.value.left), u =
|
|
351
|
-
return
|
|
352
|
-
(l.value == null || n.value == null || s.value) && (l.value = a, n.value =
|
|
353
|
-
}),
|
|
350
|
+
const l = m(e.value.width), n = m(e.value.left), u = g(() => e.value.width), d = g(() => e.value.left), i = g(() => t.value ? t.value.x : null);
|
|
351
|
+
return L([u, d], ([a, r]) => {
|
|
352
|
+
(l.value == null || n.value == null || s.value) && (l.value = a, n.value = r);
|
|
353
|
+
}), L(i, (a) => {
|
|
354
354
|
o.value && t.value && (n.value = a);
|
|
355
355
|
}), { left: n, width: l };
|
|
356
356
|
}
|
|
@@ -365,7 +365,7 @@ function Oe(e, s = m({ left: 0, right: 0, top: 0, bottom: 0 })) {
|
|
|
365
365
|
};
|
|
366
366
|
return D(() => {
|
|
367
367
|
e.value && l();
|
|
368
|
-
}),
|
|
368
|
+
}), L(e, (n) => {
|
|
369
369
|
n && l();
|
|
370
370
|
}), {
|
|
371
371
|
isIntialized: o,
|
|
@@ -374,17 +374,17 @@ function Oe(e, s = m({ left: 0, right: 0, top: 0, bottom: 0 })) {
|
|
|
374
374
|
}
|
|
375
375
|
function Xe(e, s = m(!1), t = m(!1), o = m({ left: 0, right: 0, top: 0, bottom: 0 }), l = { width: 20, height: 40 }) {
|
|
376
376
|
const { initialRect: n } = Oe(e, o), u = m(!1);
|
|
377
|
-
let d = 0, i = 0, a = 0,
|
|
378
|
-
const c = 5, h = m(null),
|
|
377
|
+
let d = 0, i = 0, a = 0, r = 0, w = 0;
|
|
378
|
+
const c = 5, h = m(null), v = (z) => {
|
|
379
379
|
if (!(!e.value || s.value))
|
|
380
380
|
if (u.value) {
|
|
381
|
-
const
|
|
381
|
+
const p = z.clientX - r, T = z.clientY - w;
|
|
382
382
|
if (h.value === "left" || h.value === "left-bottom-corner") {
|
|
383
|
-
const E = i -
|
|
384
|
-
E > l.width && (n.value.width = E, n.value.left = d +
|
|
383
|
+
const E = i - p;
|
|
384
|
+
E > l.width && (n.value.width = E, n.value.left = d + p, e.value.style.left = n.value.left + "px", e.value.style.width = n.value.width + "px");
|
|
385
385
|
}
|
|
386
386
|
if (h.value === "right" || h.value === "right-bottom-corner") {
|
|
387
|
-
const E = i +
|
|
387
|
+
const E = i + p;
|
|
388
388
|
E > l.width && (n.value.width = E, e.value.style.width = n.value.width + "px");
|
|
389
389
|
}
|
|
390
390
|
if (h.value === "bottom" || h.value === "left-bottom-corner" || h.value === "right-bottom-corner") {
|
|
@@ -392,26 +392,26 @@ function Xe(e, s = m(!1), t = m(!1), o = m({ left: 0, right: 0, top: 0, bottom:
|
|
|
392
392
|
E > l.height && (n.value.height = E, e.value.style.height = n.value.height + "px");
|
|
393
393
|
}
|
|
394
394
|
} else {
|
|
395
|
-
const
|
|
396
|
-
|
|
395
|
+
const p = e.value.getBoundingClientRect(), T = z.clientX - p.left, E = z.clientY - p.top, _ = T <= c, M = T >= p.width - c, $ = E >= p.height - c;
|
|
396
|
+
_ && $ && t.value ? (e.value.style.cursor = "nesw-resize", h.value = "left-bottom-corner") : M && $ && !t.value ? (e.value.style.cursor = "nwse-resize", h.value = "right-bottom-corner") : _ && t.value ? (e.value.style.cursor = "ew-resize", h.value = "left") : M && !t.value ? (e.value.style.cursor = "ew-resize", h.value = "right") : $ ? (e.value.style.cursor = "ns-resize", h.value = "bottom") : (e.value.style.cursor = "", h.value = null);
|
|
397
397
|
}
|
|
398
|
-
},
|
|
398
|
+
}, f = (z) => {
|
|
399
399
|
if (!e.value || !h.value) return;
|
|
400
|
-
const
|
|
401
|
-
|
|
400
|
+
const p = e.value.getBoundingClientRect();
|
|
401
|
+
r = z.clientX, w = z.clientY, i = p.width, a = p.height, d = p.left, n.value.width = i, n.value.height = a, n.value.left = p.left, n.value.top = p.top, u.value = !0, document.addEventListener("mousemove", v), document.addEventListener("mouseup", x);
|
|
402
402
|
}, x = () => {
|
|
403
|
-
u.value = !1, h.value = null, e.value && (e.value.style.cursor = ""), document.removeEventListener("mousemove",
|
|
403
|
+
u.value = !1, h.value = null, e.value && (e.value.style.cursor = ""), document.removeEventListener("mousemove", v), document.removeEventListener("mouseup", x);
|
|
404
404
|
}, C = () => {
|
|
405
|
-
e.value && (e.value.removeEventListener("mousedown",
|
|
406
|
-
},
|
|
407
|
-
e.value && (e.value.addEventListener("mousedown",
|
|
405
|
+
e.value && (e.value.removeEventListener("mousedown", f), e.value.removeEventListener("mousemove", v)), document.removeEventListener("mouseup", x);
|
|
406
|
+
}, B = () => {
|
|
407
|
+
e.value && (e.value.addEventListener("mousedown", f), e.value.addEventListener("mousemove", v));
|
|
408
408
|
};
|
|
409
409
|
return D(() => {
|
|
410
|
-
e.value &&
|
|
410
|
+
e.value && B();
|
|
411
411
|
}), le(() => {
|
|
412
412
|
C();
|
|
413
|
-
}),
|
|
414
|
-
z ?
|
|
413
|
+
}), L(e, (z) => {
|
|
414
|
+
z ? B() : C();
|
|
415
415
|
}), { rect: n, isResizing: u };
|
|
416
416
|
}
|
|
417
417
|
function Ne(e, s, t, o) {
|
|
@@ -431,74 +431,74 @@ function Ne(e, s, t, o) {
|
|
|
431
431
|
e.value && e.value.addEventListener("transitionend", n);
|
|
432
432
|
}), le(() => {
|
|
433
433
|
e.value && e.value.removeEventListener("transitionend", n);
|
|
434
|
-
}),
|
|
434
|
+
}), L(e, (i) => {
|
|
435
435
|
i ? d() : u();
|
|
436
|
-
}),
|
|
436
|
+
}), L(t, () => {
|
|
437
437
|
l();
|
|
438
|
-
}),
|
|
438
|
+
}), L(o, () => {
|
|
439
439
|
l();
|
|
440
440
|
});
|
|
441
441
|
}
|
|
442
442
|
function Ue(e, s, t, o) {
|
|
443
|
-
const l = m(window.innerWidth), n = m(window.innerHeight), { docked: u, orientation: d, movement: i, position: a, isDragging:
|
|
443
|
+
const l = m(window.innerWidth), n = m(window.innerHeight), { docked: u, orientation: d, movement: i, position: a, isDragging: r } = Ye(
|
|
444
444
|
e,
|
|
445
445
|
s,
|
|
446
446
|
o
|
|
447
|
-
),
|
|
447
|
+
), w = g(() => d.value === "right"), { rect: c, isResizing: h } = Xe(
|
|
448
448
|
e,
|
|
449
449
|
t,
|
|
450
|
-
|
|
450
|
+
w,
|
|
451
451
|
o.value.offset
|
|
452
|
-
), { width:
|
|
452
|
+
), { width: v, left: f } = He(
|
|
453
453
|
c,
|
|
454
454
|
h,
|
|
455
455
|
a,
|
|
456
|
-
|
|
456
|
+
r
|
|
457
457
|
), { lastTop: x, lastHeight: C } = Ae(
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
), { autoOpened:
|
|
463
|
-
Ne(e,
|
|
464
|
-
const z = (
|
|
458
|
+
g(() => c.value.left),
|
|
459
|
+
g(() => c.value.top),
|
|
460
|
+
g(() => c.value.width),
|
|
461
|
+
g(() => c.value.height)
|
|
462
|
+
), { autoOpened: B } = Se(e, s, t);
|
|
463
|
+
Ne(e, w, t, B);
|
|
464
|
+
const z = (_) => {
|
|
465
465
|
if (e.value) {
|
|
466
|
-
const
|
|
467
|
-
if (
|
|
468
|
-
c.value.left =
|
|
469
|
-
const oe = window.innerWidth -
|
|
470
|
-
|
|
466
|
+
const M = e.value.getBoundingClientRect(), $ = M.left + _;
|
|
467
|
+
if (w.value) {
|
|
468
|
+
c.value.left = $;
|
|
469
|
+
const oe = window.innerWidth - M.width - M.left;
|
|
470
|
+
M.left <= 0 && oe >= 0 && _ < 0 && (c.value.left = Math.max(0, $)), window.innerWidth - M.width <= 0 && (c.value.left = window.innerWidth - M.width);
|
|
471
471
|
} else
|
|
472
|
-
|
|
472
|
+
M.left + M.width >= window.innerWidth && _ < 0 && (c.value.left = Math.max(0, $));
|
|
473
473
|
}
|
|
474
|
-
},
|
|
475
|
-
const
|
|
476
|
-
l.value = window.innerWidth, n.value = window.innerHeight, z(
|
|
474
|
+
}, p = () => {
|
|
475
|
+
const _ = window.innerWidth - l.value;
|
|
476
|
+
l.value = window.innerWidth, n.value = window.innerHeight, z(_);
|
|
477
477
|
};
|
|
478
478
|
D(() => {
|
|
479
|
-
window.addEventListener("resize",
|
|
480
|
-
}),
|
|
481
|
-
window.removeEventListener("resize",
|
|
479
|
+
window.addEventListener("resize", p);
|
|
480
|
+
}), F(() => {
|
|
481
|
+
window.removeEventListener("resize", p);
|
|
482
482
|
});
|
|
483
|
-
const T = (
|
|
484
|
-
|
|
483
|
+
const T = (_) => {
|
|
484
|
+
_ ? (c.value.width = J, w.value && f.value && v.value && (c.value.left = f.value + v.value - J)) : (c.value.width = v.value, w.value && f.value && v.value && (c.value.left = f.value));
|
|
485
485
|
}, E = () => {
|
|
486
|
-
u.value ? (c.value.top = o.value.offset.value.top, c.value.height = window.innerHeight - o.value.offset.value.top - o.value.offset.value.bottom) : (c.value.top = x.value, c.value.height = C.value);
|
|
486
|
+
u.value ? (c.value.top = o.value.offset.value.top, c.value.height = window.innerHeight - o.value.offset.value.top - o.value.offset.value.bottom - 1) : (c.value.top = x.value, c.value.height = C.value);
|
|
487
487
|
};
|
|
488
|
-
return
|
|
488
|
+
return L(u, () => {
|
|
489
489
|
E();
|
|
490
|
-
}),
|
|
491
|
-
T(
|
|
492
|
-
}),
|
|
493
|
-
t.value && !
|
|
494
|
-
}),
|
|
495
|
-
if (
|
|
496
|
-
const
|
|
497
|
-
c.value.left =
|
|
490
|
+
}), L(t, (_) => {
|
|
491
|
+
T(_);
|
|
492
|
+
}), L(B, (_) => {
|
|
493
|
+
t.value && !r.value && T(!_);
|
|
494
|
+
}), L(i, (_) => {
|
|
495
|
+
if (_ && e.value) {
|
|
496
|
+
const $ = e.value.getBoundingClientRect();
|
|
497
|
+
c.value.left = $.left, c.value.top = $.top;
|
|
498
498
|
}
|
|
499
|
-
}), { rect: c, orientation: d, reversed:
|
|
499
|
+
}), { rect: c, orientation: d, reversed: w };
|
|
500
500
|
}
|
|
501
|
-
const Fe = (e) => (
|
|
501
|
+
const Fe = (e) => (R("data-v-c27d14f6"), e = e(), ee(), e), Ge = /* @__PURE__ */ Fe(() => /* @__PURE__ */ b("svg", {
|
|
502
502
|
xmlns: "http://www.w3.org/2000/svg",
|
|
503
503
|
width: "1em",
|
|
504
504
|
height: "1em",
|
|
@@ -522,7 +522,7 @@ const Fe = (e) => (P("data-v-539d98d3"), e = e(), R(), e), Ge = /* @__PURE__ */
|
|
|
522
522
|
}),
|
|
523
523
|
emits: /* @__PURE__ */ Y(["close"], ["update:modelValue"]),
|
|
524
524
|
setup(e, { emit: s }) {
|
|
525
|
-
const t = e, o =
|
|
525
|
+
const t = e, o = K(e, "modelValue"), l = s, n = m(!1), u = m(null), d = m(null), i = g(() => ({
|
|
526
526
|
offset: m({
|
|
527
527
|
left: t.leftOffset,
|
|
528
528
|
right: t.rightOffset,
|
|
@@ -531,44 +531,51 @@ const Fe = (e) => (P("data-v-539d98d3"), e = e(), R(), e), Ge = /* @__PURE__ */
|
|
|
531
531
|
})
|
|
532
532
|
})), {
|
|
533
533
|
rect: a,
|
|
534
|
-
orientation:
|
|
535
|
-
reversed:
|
|
536
|
-
} = Ue(d, u, n, i), c =
|
|
534
|
+
orientation: r,
|
|
535
|
+
reversed: w
|
|
536
|
+
} = Ue(d, u, n, i), c = g(() => ({
|
|
537
537
|
left: `${a.value.left}px`,
|
|
538
538
|
top: `${a.value.top}px`,
|
|
539
539
|
width: `${a.value.width}px`,
|
|
540
540
|
height: `${a.value.height}px`
|
|
541
|
-
})), h = () => {
|
|
541
|
+
})), h = g(() => w.value ? {
|
|
542
|
+
borderLeft: "1px solid",
|
|
543
|
+
borderRight: null
|
|
544
|
+
} : {
|
|
545
|
+
borderLeft: null,
|
|
546
|
+
borderRight: "1px solid"
|
|
547
|
+
}), v = () => {
|
|
542
548
|
o.value = !1;
|
|
543
|
-
const
|
|
549
|
+
const f = d.value;
|
|
544
550
|
l("close", {
|
|
545
|
-
x:
|
|
546
|
-
y:
|
|
551
|
+
x: f ? f.clientLeft : 0,
|
|
552
|
+
y: f ? f.clientTop : 0
|
|
547
553
|
});
|
|
548
554
|
};
|
|
549
|
-
return (
|
|
550
|
-
const
|
|
551
|
-
return o.value ? (
|
|
555
|
+
return (f, x) => {
|
|
556
|
+
const C = A;
|
|
557
|
+
return o.value ? (y(), I("div", {
|
|
552
558
|
key: 0,
|
|
553
559
|
ref_key: "toolPaletteElement",
|
|
554
560
|
ref: d,
|
|
555
|
-
style:
|
|
561
|
+
style: X([c.value]),
|
|
556
562
|
class: "ml-tool-palette-dialog"
|
|
557
563
|
}, [
|
|
558
564
|
b("div", {
|
|
559
|
-
class:
|
|
565
|
+
class: te(["ml-tool-palette-dialog-layout", G(r)])
|
|
560
566
|
}, [
|
|
561
567
|
b("div", {
|
|
562
568
|
ref_key: "titleBarElement",
|
|
563
569
|
ref: u,
|
|
564
|
-
class: "ml-tool-palette-title-bar"
|
|
570
|
+
class: "ml-tool-palette-title-bar",
|
|
571
|
+
style: X(h.value)
|
|
565
572
|
}, [
|
|
566
|
-
S(
|
|
573
|
+
S(C, {
|
|
567
574
|
size: 18,
|
|
568
575
|
class: "ml-tool-palette-dialog-icon",
|
|
569
|
-
onClick:
|
|
576
|
+
onClick: v
|
|
570
577
|
}, {
|
|
571
|
-
default:
|
|
578
|
+
default: k(() => [
|
|
572
579
|
Ge
|
|
573
580
|
]),
|
|
574
581
|
_: 1
|
|
@@ -576,27 +583,27 @@ const Fe = (e) => (P("data-v-539d98d3"), e = e(), R(), e), Ge = /* @__PURE__ */
|
|
|
576
583
|
S(Le, {
|
|
577
584
|
class: "ml-tool-palette-dialog-icon",
|
|
578
585
|
modelValue: n.value,
|
|
579
|
-
"onUpdate:modelValue":
|
|
580
|
-
reverse:
|
|
586
|
+
"onUpdate:modelValue": x[0] || (x[0] = (B) => n.value = B),
|
|
587
|
+
reverse: G(w)
|
|
581
588
|
}, null, 8, ["modelValue", "reverse"]),
|
|
582
|
-
b("span", je,
|
|
583
|
-
],
|
|
589
|
+
b("span", je, U(t.title), 1)
|
|
590
|
+
], 4),
|
|
584
591
|
b("div", qe, [
|
|
585
|
-
O(
|
|
592
|
+
O(f.$slots, "default", {}, void 0, !0)
|
|
586
593
|
])
|
|
587
594
|
], 2)
|
|
588
595
|
], 4)) : ne("", !0);
|
|
589
596
|
};
|
|
590
597
|
}
|
|
591
|
-
}), Ke = /* @__PURE__ */ H(Je, [["__scopeId", "data-v-
|
|
598
|
+
}), Ke = /* @__PURE__ */ H(Je, [["__scopeId", "data-v-c27d14f6"]]), it = {
|
|
592
599
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
593
600
|
install(e) {
|
|
594
|
-
e.component("MlCollapse",
|
|
601
|
+
e.component("MlCollapse", N), e.component("MlDropdown", N), e.component("MlLanguage", ze), e.component("MlStatusBar", Te), e.component("MlToolBar", De), e.component("MlToolPalette", Ke);
|
|
595
602
|
}
|
|
596
603
|
};
|
|
597
604
|
export {
|
|
598
605
|
Le as MlCollapse,
|
|
599
|
-
|
|
606
|
+
N as MlDropdown,
|
|
600
607
|
ze as MlLanguage,
|
|
601
608
|
Te as MlStatusBar,
|
|
602
609
|
De as MlToolBar,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".ml-dropdown-icon[data-v-3fc33b5d],.ml-dropdown-icon[data-v-3fc33b5d]:hover{outline:none;border:none}.ml-status-bar[data-v-
|
|
2
|
-
(function(y,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("element-plus/es"),require("element-plus/es/components/base/style/css"),require("element-plus/es/components/icon/style/css"),require("vue"),require("element-plus/es/components/dropdown/style/css"),require("element-plus/es/components/dropdown-menu/style/css"),require("element-plus/es/components/dropdown-item/style/css"),require("element-plus/es/components/button-group/style/css"),require("element-plus/es/components/tooltip/style/css"),require("element-plus/es/components/button/style/css")):typeof define=="function"&&define.amd?define(["exports","element-plus/es","element-plus/es/components/base/style/css","element-plus/es/components/icon/style/css","vue","element-plus/es/components/dropdown/style/css","element-plus/es/components/dropdown-menu/style/css","element-plus/es/components/dropdown-item/style/css","element-plus/es/components/button-group/style/css","element-plus/es/components/tooltip/style/css","element-plus/es/components/button/style/css"],x):(y=typeof globalThis<"u"?globalThis:y||self,x(y.UIComponents={},y.es,null,null,y.Vue))})(this,function(y,x,pe,fe,e){"use strict";const Y={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 1024 1024"},A=[e.createElementVNode("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.59 30.59 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.59 30.59 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0"},null,-1)];function H(t,i){return e.openBlock(),e.createElementBlock("svg",Y,[...A])}const $={render:H},X={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 1024 1024"},q=[e.createElementVNode("path",{fill:"currentColor",d:"M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512 340.864 831.872a30.59 30.59 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"},null,-1)];function U(t,i){return e.openBlock(),e.createElementBlock("svg",X,[...q])}const T={render:U},S=e.defineComponent({__name:"MlCollapse",props:e.mergeModels({size:{default:18},reverse:{type:Boolean,default:!1}},{modelValue:{default:!0},modelModifiers:{}}),emits:e.mergeModels(["change"],["update:modelValue"]),setup(t,{emit:i}){const n=t,s=e.useModel(t,"modelValue"),l=i,o=e.computed(()=>n.reverse?s.value?$:T:s.value?T:$),a=e.computed(()=>`${n.size}px`),h=()=>{l("change",s.value),s.value=!s.value};return(c,r)=>{const m=x.ElIcon;return e.openBlock(),e.createBlock(m,{size:a.value,onClick:h},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value)))]),_:1},8,["size"])}}}),F=(t=>(e.pushScopeId("data-v-3fc33b5d"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("svg",{preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em","data-v-63d067da":""},[e.createElementVNode("path",{fill:"currentColor",d:"m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"})],-1)),j=e.defineComponent({__name:"MlDropdown",props:{icon:{},items:{},current:{default:void 0}},emits:{click:null},setup(t,{emit:i}){const n=t,s=i,l=e.computed(()=>n.items.filter(a=>a.name!==n.current)),o=a=>{s("click",a)};return(a,h)=>{const c=x.ElIcon,r=x.ElDropdownItem,m=x.ElDropdownMenu,_=x.ElDropdown;return e.openBlock(),e.createBlock(_,{onCommand:o},{dropdown:e.withCtx(()=>[e.createVNode(m,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,u=>(e.openBlock(),e.createBlock(r,{key:u.text,command:u.name},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.text),1)]),_:2},1032,["command"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createVNode(c,{size:"30",class:"ml-dropdown-icon"},{default:e.withCtx(()=>[F]),_:1})]),_:1})}}}),z=(t,i)=>{const n=t.__vccOpts||t;for(const[s,l]of i)n[s]=l;return n},V=z(j,[["__scopeId","data-v-3fc33b5d"]]),G='<svg preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" width="1.2em" height="1.2em" data-v-63d067da=""><path fill="currentColor" d="m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"></path></svg>',I=e.defineComponent({__name:"MlLanguage",props:{languages:{},current:{}},emits:{click:null},setup(t,{emit:i}){const n=t,s=i,l=o=>{s("click",o)};return(o,a)=>(e.openBlock(),e.createBlock(V,{icon:G,items:n.languages,current:n.current,onClick:l},null,8,["items","current"]))}}),J={},K={class:"ml-status-bar"},Q={class:"ml-status-bar-left"},Z={class:"ml-status-bar-right"};function P(t,i){return e.openBlock(),e.createElementBlock("div",K,[e.createElementVNode("div",Q,[e.renderSlot(t.$slots,"left",{},void 0,!0)]),e.createElementVNode("div",Z,[e.renderSlot(t.$slots,"right",{},void 0,!0)])])}const N=z(J,[["render",P],["__scopeId","data-v-b0c9d107"]]),R={key:0,class:"ml-toolbar-button-text"},W=z(e.defineComponent({__name:"MlToolBar",props:{items:{},size:{default:"large"},direction:{}},emits:{click:null},setup(t,{emit:i}){const n=t,s=i,l=e.computed(()=>n.direction==="vertical"?"ml-vertical-toolbar-button-group":"ml-horizontal-toolbar-button-group"),o=e.computed(()=>n.size==="small"?20:30),a=e.computed(()=>{switch(n.size){case"small":return 30;case"medium":return 50}return 70}),h=m=>m.description?m.description:m.text,c=e.computed(()=>n.size==="large"),r=m=>{s("click",m)};return(m,_)=>{const u=x.ElIcon,p=x.ElButton,d=x.ElTooltip,v=x.ElButtonGroup;return e.openBlock(),e.createBlock(v,{class:e.normalizeClass(l.value)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.items,(g,M)=>(e.openBlock(),e.createBlock(d,{key:g.text,content:h(g),"hide-after":0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(p,{class:"ml-toolbar-button",style:e.normalizeStyle({width:a.value+"px",height:a.value+"px"}),key:M,onClick:C=>r(g.command)},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(u,{size:o.value},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g.icon)))]),_:2},1032,["size"]),c.value?(e.openBlock(),e.createElementBlock("div",R,e.toDisplayString(g.text),1)):e.createCommentVNode("",!0)])]),_:2},1032,["style","onClick"]))]),_:2},1032,["content"]))),128))]),_:1},8,["class"])}}}),[["__scopeId","data-v-fe5399ea"]]),D=20;function ee(t,i,n){const s=e.ref(!1),l=c=>{if(n.value&&t.value){const r=t.value.getBoundingClientRect(),m=c.clientX<r.left||c.clientX>r.right||c.clientY<r.top||c.clientY>r.bottom;s.value=!m}},o=()=>{n.value&&(s.value=!0)},a=()=>{i.value&&i.value.addEventListener("mousemove",o),t.value&&t.value.addEventListener("mousemove",o)},h=()=>{i.value&&i.value.removeEventListener("mousemove",o),t.value&&t.value.removeEventListener("mousemove",o)};return e.onMounted(()=>{window.addEventListener("mousemove",l)}),e.onUnmounted(()=>{window.removeEventListener("mousemove",l)}),e.watch(n,c=>{c&&(s.value=!1)}),e.watch(t,c=>{c?a():h()}),{autoOpened:s}}function te(t,i,n){const s=e.ref(!1),l=e.ref(null),o=e.ref(null),a={x:0,y:0},h=e.computed(()=>l.value==null||o.value==null?{x:0,y:0}:{x:l.value.x-o.value.x,y:l.value.y-o.value.y}),c=()=>{if(t.value){const d=t.value.getBoundingClientRect();o.value={x:d.left,y:d.top},l.value={x:d.left,y:d.top}}},r=()=>{t.value&&t.value.addEventListener("mousedown",_)},m=()=>{t.value&&t.value.removeEventListener("mousedown",_)},_=d=>{if(t.value!=null){if(i&&i.value){const v=i.value.getBoundingClientRect();if(d.clientX<v.left||d.clientX>v.right||d.clientY<v.top||d.clientY>v.bottom)return}s.value=!0,a.x=d.clientX,a.y=d.clientY,c(),document.addEventListener("mousemove",u),document.addEventListener("mouseup",p)}},u=d=>{if(s.value&&o.value&&l.value){const v=window.innerWidth,g=window.innerHeight,M=t.value,C=M.getBoundingClientRect(),B=C.width,f=C.height,b=o.value.x+(d.clientX-a.x),E=o.value.y+(d.clientY-a.y);l.value.x=Math.max(n?n.value.offset.value.left:0,b);const w=v-B;l.value.x=Math.min(n?w-n.value.offset.value.right:w,l.value.x),l.value.y=Math.max(n?n.value.offset.value.top:0,Math.min(E,g-f));const L=g-f;l.value.y=Math.min(n?L-n.value.offset.value.bottom:L,l.value.y),M.style.left=l.value.x+"px",M.style.top=l.value.y+"px"}},p=()=>{s.value=!1,document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",p)};return e.onMounted(()=>{t.value&&(c(),r())}),e.onUnmounted(()=>{t.value&&t.value.removeEventListener("mousedown",_)}),e.watch(t,d=>{d?(c(),r()):m()}),{isDragging:s,movement:h,position:l}}function ne(t,i,n){const s=e.ref(!1),l=e.ref("left"),{isDragging:o,movement:a,position:h}=te(t,i,n);return e.watch(a,c=>{if(c&&t.value){const m=t.value.getBoundingClientRect();m.left<=n.value.offset.value.left?(l.value="left",s.value=!0):window.innerWidth-m.left-m.width<=n.value.offset.value.right?(l.value="right",s.value=!0):s.value=!1}}),{docked:s,orientation:l,isDragging:o,movement:a,position:h}}function oe(t,i,n,s){const l=e.ref(null),o=e.ref(null),a=e.ref(null),h=e.ref(null);return e.watch(t,(c,r)=>{l.value=r}),e.watch(i,(c,r)=>{o.value=r}),e.watch(n,(c,r)=>{a.value=r}),e.watch(s,(c,r)=>{h.value=r}),{lastLeft:l,lastTop:o,lastWidth:a,lastHeight:h}}function le(t,i,n,s){const l=e.ref(t.value.width),o=e.ref(t.value.left),a=e.computed(()=>t.value.width),h=e.computed(()=>t.value.left),c=e.computed(()=>n.value?n.value.x:null);return e.watch([a,h],([r,m])=>{(l.value==null||o.value==null||i.value)&&(l.value=r,o.value=m)}),e.watch(c,r=>{s.value&&n.value&&(o.value=r)}),{left:o,width:l}}function se(t,i=e.ref({left:0,right:0,top:0,bottom:0})){const n=e.ref({});let s=!1;const l=()=>{if(!s&&t.value){const o=t.value.getBoundingClientRect();n.value.left=Math.max(o.left,i.value.left),n.value.top=Math.max(o.top,i.value.top),n.value.width=o.width,n.value.height=o.height,s=!0}};return e.onMounted(()=>{t.value&&l()}),e.watch(t,o=>{o&&l()}),{isIntialized:s,initialRect:n}}function ie(t,i=e.ref(!1),n=e.ref(!1),s=e.ref({left:0,right:0,top:0,bottom:0}),l={width:20,height:40}){const{initialRect:o}=se(t,s),a=e.ref(!1);let h=0,c=0,r=0,m=0,_=0;const u=5,p=e.ref(null),d=B=>{if(!(!t.value||i.value))if(a.value){const f=B.clientX-m,b=B.clientY-_;if(p.value==="left"||p.value==="left-bottom-corner"){const E=c-f;E>l.width&&(o.value.width=E,o.value.left=h+f,t.value.style.left=o.value.left+"px",t.value.style.width=o.value.width+"px")}if(p.value==="right"||p.value==="right-bottom-corner"){const E=c+f;E>l.width&&(o.value.width=E,t.value.style.width=o.value.width+"px")}if(p.value==="bottom"||p.value==="left-bottom-corner"||p.value==="right-bottom-corner"){const E=r+b;E>l.height&&(o.value.height=E,t.value.style.height=o.value.height+"px")}}else{const f=t.value.getBoundingClientRect(),b=B.clientX-f.left,E=B.clientY-f.top,w=b<=u,L=b>=f.width-u,k=E>=f.height-u;w&&k&&n.value?(t.value.style.cursor="nesw-resize",p.value="left-bottom-corner"):L&&k&&!n.value?(t.value.style.cursor="nwse-resize",p.value="right-bottom-corner"):w&&n.value?(t.value.style.cursor="ew-resize",p.value="left"):L&&!n.value?(t.value.style.cursor="ew-resize",p.value="right"):k?(t.value.style.cursor="ns-resize",p.value="bottom"):(t.value.style.cursor="",p.value=null)}},v=B=>{if(!t.value||!p.value)return;const f=t.value.getBoundingClientRect();m=B.clientX,_=B.clientY,c=f.width,r=f.height,h=f.left,o.value.width=c,o.value.height=r,o.value.left=f.left,o.value.top=f.top,a.value=!0,document.addEventListener("mousemove",d),document.addEventListener("mouseup",g)},g=()=>{a.value=!1,p.value=null,t.value&&(t.value.style.cursor=""),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",g)},M=()=>{t.value&&(t.value.removeEventListener("mousedown",v),t.value.removeEventListener("mousemove",d)),document.removeEventListener("mouseup",g)},C=()=>{t.value&&(t.value.addEventListener("mousedown",v),t.value.addEventListener("mousemove",d))};return e.onMounted(()=>{t.value&&C()}),e.onBeforeUnmount(()=>{M()}),e.watch(t,B=>{B?C():M()}),{rect:o,isResizing:a}}function ce(t,i,n,s){const l=()=>{if(t.value){const c=t.value;i.value?c.style.transition="width 0.3s ease-out, left 0.3s ease-out":c.style.transition="width 0.3s ease"}},o=()=>{t.value&&(t.value.style.transition="")},a=()=>{t.value&&t.value.removeEventListener("transitionend",o)},h=()=>{t.value&&t.value.addEventListener("transitionend",o)};e.onMounted(()=>{t.value&&t.value.addEventListener("transitionend",o)}),e.onBeforeUnmount(()=>{t.value&&t.value.removeEventListener("transitionend",o)}),e.watch(t,c=>{c?h():a()}),e.watch(n,()=>{l()}),e.watch(s,()=>{l()})}function ae(t,i,n,s){const l=e.ref(window.innerWidth),o=e.ref(window.innerHeight),{docked:a,orientation:h,movement:c,position:r,isDragging:m}=ne(t,i,s),_=e.computed(()=>h.value==="right"),{rect:u,isResizing:p}=ie(t,n,_,s.value.offset),{width:d,left:v}=le(u,p,r,m),{lastTop:g,lastHeight:M}=oe(e.computed(()=>u.value.left),e.computed(()=>u.value.top),e.computed(()=>u.value.width),e.computed(()=>u.value.height)),{autoOpened:C}=ee(t,i,n);ce(t,_,n,C);const B=w=>{if(t.value){const L=t.value.getBoundingClientRect(),k=L.left+w;if(_.value){u.value.left=k;const he=window.innerWidth-L.width-L.left;L.left<=0&&he>=0&&w<0&&(u.value.left=Math.max(0,k)),window.innerWidth-L.width<=0&&(u.value.left=window.innerWidth-L.width)}else L.left+L.width>=window.innerWidth&&w<0&&(u.value.left=Math.max(0,k))}},f=()=>{const w=window.innerWidth-l.value;l.value=window.innerWidth,o.value=window.innerHeight,B(w)};e.onMounted(()=>{window.addEventListener("resize",f)}),e.onUnmounted(()=>{window.removeEventListener("resize",f)});const b=w=>{w?(u.value.width=D,_.value&&v.value&&d.value&&(u.value.left=v.value+d.value-D)):(u.value.width=d.value,_.value&&v.value&&d.value&&(u.value.left=v.value))},E=()=>{a.value?(u.value.top=s.value.offset.value.top,u.value.height=window.innerHeight-s.value.offset.value.top-s.value.offset.value.bottom):(u.value.top=g.value,u.value.height=M.value)};return e.watch(a,()=>{E()}),e.watch(n,w=>{b(w)}),e.watch(C,w=>{n.value&&!m.value&&b(!w)}),e.watch(c,w=>{if(w&&t.value){const k=t.value.getBoundingClientRect();u.value.left=k.left,u.value.top=k.top}}),{rect:u,orientation:h,reversed:_}}const re=(t=>(e.pushScopeId("data-v-539d98d3"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592L512 466.88L259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512L214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})],-1)),ue={class:"ml-tool-palette-title"},de={class:"ml-tool-palette-content"},O=z(e.defineComponent({__name:"MlToolPalette",props:e.mergeModels({title:{default:""},leftOffset:{default:0},rightOffset:{default:0},topOffset:{default:0},bottomOffset:{default:0}},{modelValue:{default:!0},modelModifiers:{}}),emits:e.mergeModels(["close"],["update:modelValue"]),setup(t,{emit:i}){const n=t,s=e.useModel(t,"modelValue"),l=i,o=e.ref(!1),a=e.ref(null),h=e.ref(null),c=e.computed(()=>({offset:e.ref({left:n.leftOffset,right:n.rightOffset,top:n.topOffset,bottom:n.bottomOffset})})),{rect:r,orientation:m,reversed:_}=ae(h,a,o,c),u=e.computed(()=>({left:`${r.value.left}px`,top:`${r.value.top}px`,width:`${r.value.width}px`,height:`${r.value.height}px`})),p=()=>{s.value=!1;const d=h.value;l("close",{x:d?d.clientLeft:0,y:d?d.clientTop:0})};return(d,v)=>{const g=x.ElIcon;return s.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"toolPaletteElement",ref:h,style:e.normalizeStyle([u.value]),class:"ml-tool-palette-dialog"},[e.createElementVNode("div",{class:e.normalizeClass(["ml-tool-palette-dialog-layout",e.unref(m)])},[e.createElementVNode("div",{ref_key:"titleBarElement",ref:a,class:"ml-tool-palette-title-bar"},[e.createVNode(g,{size:18,class:"ml-tool-palette-dialog-icon",onClick:p},{default:e.withCtx(()=>[re]),_:1}),e.createVNode(S,{class:"ml-tool-palette-dialog-icon",modelValue:o.value,"onUpdate:modelValue":v[0]||(v[0]=M=>o.value=M),reverse:e.unref(_)},null,8,["modelValue","reverse"]),e.createElementVNode("span",ue,e.toDisplayString(n.title),1)],512),e.createElementVNode("div",de,[e.renderSlot(d.$slots,"default",{},void 0,!0)])],2)],4)):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-539d98d3"]]),me={install(t){t.component("MlCollapse",V),t.component("MlDropdown",V),t.component("MlLanguage",I),t.component("MlStatusBar",N),t.component("MlToolbar",W),t.component("MlToolPalette",O)}};y.MlCollapse=S,y.MlDropdown=V,y.MlLanguage=I,y.MlStatusBar=N,y.MlToolBar=W,y.MlToolPalette=O,y.default=me,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".ml-dropdown-icon[data-v-3fc33b5d],.ml-dropdown-icon[data-v-3fc33b5d]:hover{outline:none;border:none}.ml-status-bar[data-v-ac7280f8]{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);border:1px solid var(--el-border-color)}.ml-status-bar-left[data-v-ac7280f8],.ml-status-bar-right[data-v-ac7280f8]{display:flex;align-items:center}.ml-status-bar-left[data-v-ac7280f8]>*{margin-right:10px}.ml-status-bar-right[data-v-ac7280f8]>*{margin-left:10px}.ml-vertical-toolbar-button-group[data-v-d5511111]{display:flex;flex-direction:column}.ml-horizontal-toolbar-button-group[data-v-d5511111]{display:flex;flex-direction:row}.ml-toolbar-button[data-v-d5511111]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px}.ml-toolbar-button-text[data-v-d5511111]{margin-left:0;margin-top:5px}.ml-tool-palette-dialog[data-v-c27d14f6]{cursor:default;width:300px;min-width:var(--collapsed-width);position:fixed;box-sizing:border-box;border:1px solid}.ml-tool-palette-dialog-icon[data-v-c27d14f6]{border-bottom:1px solid}.ml-tool-palette-dialog-layout[data-v-c27d14f6]{display:flex;height:100%}.ml-tool-palette-title-bar[data-v-c27d14f6]{width:var(--collapsed-width);display:flex;justify-content:left;align-items:center;cursor:move;writing-mode:vertical-rl;text-align:center}.ml-tool-palette-title[data-v-c27d14f6]{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-c27d14f6]{pointer-events:none;-webkit-user-select:none;user-select:none;flex-grow:1;display:flex;justify-content:space-around;background-color:var(--el-fill-color);overflow:hidden}.ml-tool-palette-dialog-layout.left .ml-tool-palette-title-bar[data-v-c27d14f6]{order:1}.ml-tool-palette-dialog-layout.left .ml-tool-palette-content[data-v-c27d14f6],.ml-tool-palette-dialog-layout.right .ml-tool-palette-title-bar[data-v-c27d14f6]{order:2}.ml-tool-palette-dialog-layout.right .ml-tool-palette-content[data-v-c27d14f6]{order:1}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
(function(L,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("element-plus/es"),require("element-plus/es/components/base/style/css"),require("element-plus/es/components/icon/style/css"),require("vue"),require("element-plus/es/components/dropdown/style/css"),require("element-plus/es/components/dropdown-menu/style/css"),require("element-plus/es/components/dropdown-item/style/css"),require("element-plus/es/components/button-group/style/css"),require("element-plus/es/components/tooltip/style/css"),require("element-plus/es/components/button/style/css")):typeof define=="function"&&define.amd?define(["exports","element-plus/es","element-plus/es/components/base/style/css","element-plus/es/components/icon/style/css","vue","element-plus/es/components/dropdown/style/css","element-plus/es/components/dropdown-menu/style/css","element-plus/es/components/dropdown-item/style/css","element-plus/es/components/button-group/style/css","element-plus/es/components/tooltip/style/css","element-plus/es/components/button/style/css"],x):(L=typeof globalThis<"u"?globalThis:L||self,x(L.UIComponents={},L.es,null,null,L.Vue))})(this,function(L,x,pe,fe,e){"use strict";const Y={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 1024 1024"},A=[e.createElementVNode("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.59 30.59 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.59 30.59 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0"},null,-1)];function H(t,i){return e.openBlock(),e.createElementBlock("svg",Y,[...A])}const $={render:H},X={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 1024 1024"},q=[e.createElementVNode("path",{fill:"currentColor",d:"M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512 340.864 831.872a30.59 30.59 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"},null,-1)];function U(t,i){return e.openBlock(),e.createElementBlock("svg",X,[...q])}const T={render:U},S=e.defineComponent({__name:"MlCollapse",props:e.mergeModels({size:{default:18},reverse:{type:Boolean,default:!1}},{modelValue:{default:!0},modelModifiers:{}}),emits:e.mergeModels(["change"],["update:modelValue"]),setup(t,{emit:i}){const n=t,s=e.useModel(t,"modelValue"),l=i,o=e.computed(()=>n.reverse?s.value?$:T:s.value?T:$),a=e.computed(()=>`${n.size}px`),h=()=>{l("change",s.value),s.value=!s.value};return(c,r)=>{const d=x.ElIcon;return e.openBlock(),e.createBlock(d,{size:a.value,onClick:h},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value)))]),_:1},8,["size"])}}}),F=(t=>(e.pushScopeId("data-v-3fc33b5d"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("svg",{preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em","data-v-63d067da":""},[e.createElementVNode("path",{fill:"currentColor",d:"m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"})],-1)),j=e.defineComponent({__name:"MlDropdown",props:{icon:{},items:{},current:{default:void 0}},emits:{click:null},setup(t,{emit:i}){const n=t,s=i,l=e.computed(()=>n.items.filter(a=>a.name!==n.current)),o=a=>{s("click",a)};return(a,h)=>{const c=x.ElIcon,r=x.ElDropdownItem,d=x.ElDropdownMenu,w=x.ElDropdown;return e.openBlock(),e.createBlock(w,{onCommand:o},{dropdown:e.withCtx(()=>[e.createVNode(d,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,u=>(e.openBlock(),e.createBlock(r,{key:u.text,command:u.name},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.text),1)]),_:2},1032,["command"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createVNode(c,{size:"30",class:"ml-dropdown-icon"},{default:e.withCtx(()=>[F]),_:1})]),_:1})}}}),z=(t,i)=>{const n=t.__vccOpts||t;for(const[s,l]of i)n[s]=l;return n},V=z(j,[["__scopeId","data-v-3fc33b5d"]]),G='<svg preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" width="1.2em" height="1.2em" data-v-63d067da=""><path fill="currentColor" d="m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"></path></svg>',I=e.defineComponent({__name:"MlLanguage",props:{languages:{},current:{}},emits:{click:null},setup(t,{emit:i}){const n=t,s=i,l=o=>{s("click",o)};return(o,a)=>(e.openBlock(),e.createBlock(V,{icon:G,items:n.languages,current:n.current,onClick:l},null,8,["items","current"]))}}),J={},K={class:"ml-status-bar"},Q={class:"ml-status-bar-left"},Z={class:"ml-status-bar-right"};function P(t,i){return e.openBlock(),e.createElementBlock("div",K,[e.createElementVNode("div",Q,[e.renderSlot(t.$slots,"left",{},void 0,!0)]),e.createElementVNode("div",Z,[e.renderSlot(t.$slots,"right",{},void 0,!0)])])}const N=z(J,[["render",P],["__scopeId","data-v-ac7280f8"]]),R={key:0,class:"ml-toolbar-button-text"},W=z(e.defineComponent({__name:"MlToolBar",props:{items:{},size:{default:"large"},direction:{}},emits:{click:null},setup(t,{emit:i}){const n=t,s=i,l=e.computed(()=>n.direction==="vertical"?"ml-vertical-toolbar-button-group":"ml-horizontal-toolbar-button-group"),o=e.computed(()=>n.size==="small"?20:30),a=e.computed(()=>{switch(n.size){case"small":return 30;case"medium":return 50}return 70}),h=d=>d.description?d.description:d.text,c=e.computed(()=>n.size==="large"),r=d=>{s("click",d)};return(d,w)=>{const u=x.ElIcon,p=x.ElButton,m=x.ElTooltip,f=x.ElButtonGroup;return e.openBlock(),e.createBlock(f,{class:e.normalizeClass(l.value)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.items,(g,M)=>(e.openBlock(),e.createBlock(m,{key:g.text,content:h(g),"hide-after":0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(p,{class:"ml-toolbar-button",style:e.normalizeStyle({width:a.value+"px",height:a.value+"px"}),key:M,onClick:k=>r(g.command)},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(u,{size:o.value},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g.icon)))]),_:2},1032,["size"]),c.value?(e.openBlock(),e.createElementBlock("div",R,e.toDisplayString(g.text),1)):e.createCommentVNode("",!0)])]),_:2},1032,["style","onClick"]))]),_:2},1032,["content"]))),128))]),_:1},8,["class"])}}}),[["__scopeId","data-v-d5511111"]]),D=20;function ee(t,i,n){const s=e.ref(!1),l=c=>{if(n.value&&t.value){const r=t.value.getBoundingClientRect(),d=c.clientX<r.left||c.clientX>r.right||c.clientY<r.top||c.clientY>r.bottom;s.value=!d}},o=()=>{n.value&&(s.value=!0)},a=()=>{i.value&&i.value.addEventListener("mousemove",o),t.value&&t.value.addEventListener("mousemove",o)},h=()=>{i.value&&i.value.removeEventListener("mousemove",o),t.value&&t.value.removeEventListener("mousemove",o)};return e.onMounted(()=>{window.addEventListener("mousemove",l)}),e.onUnmounted(()=>{window.removeEventListener("mousemove",l)}),e.watch(n,c=>{c&&(s.value=!1)}),e.watch(t,c=>{c?a():h()}),{autoOpened:s}}function te(t,i,n){const s=e.ref(!1),l=e.ref(null),o=e.ref(null),a={x:0,y:0},h=e.computed(()=>l.value==null||o.value==null?{x:0,y:0}:{x:l.value.x-o.value.x,y:l.value.y-o.value.y}),c=()=>{if(t.value){const m=t.value.getBoundingClientRect();o.value={x:m.left,y:m.top},l.value={x:m.left,y:m.top}}},r=()=>{t.value&&t.value.addEventListener("mousedown",w)},d=()=>{t.value&&t.value.removeEventListener("mousedown",w)},w=m=>{if(t.value!=null){if(i&&i.value){const f=i.value.getBoundingClientRect();if(m.clientX<f.left||m.clientX>f.right||m.clientY<f.top||m.clientY>f.bottom)return}s.value=!0,a.x=m.clientX,a.y=m.clientY,c(),document.addEventListener("mousemove",u),document.addEventListener("mouseup",p)}},u=m=>{if(s.value&&o.value&&l.value){const f=window.innerWidth,g=window.innerHeight,M=t.value,k=M.getBoundingClientRect(),E=k.width,v=k.height,b=o.value.x+(m.clientX-a.x),B=o.value.y+(m.clientY-a.y);l.value.x=Math.max(n?n.value.offset.value.left:0,b);const _=f-E;l.value.x=Math.min(n?_-n.value.offset.value.right:_,l.value.x),l.value.y=Math.max(n?n.value.offset.value.top:0,Math.min(B,g-v));const y=g-v-1;l.value.y=Math.min(n?y-n.value.offset.value.bottom:y,l.value.y),M.style.left=l.value.x+"px",M.style.top=l.value.y+"px"}},p=()=>{s.value=!1,document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",p)};return e.onMounted(()=>{t.value&&(c(),r())}),e.onUnmounted(()=>{t.value&&t.value.removeEventListener("mousedown",w)}),e.watch(t,m=>{m?(c(),r()):d()}),{isDragging:s,movement:h,position:l}}function ne(t,i,n){const s=e.ref(!1),l=e.ref("left"),{isDragging:o,movement:a,position:h}=te(t,i,n);return e.watch(a,c=>{if(c&&t.value){const d=t.value.getBoundingClientRect();d.left<=n.value.offset.value.left?(l.value="left",s.value=!0):window.innerWidth-d.left-d.width<=n.value.offset.value.right?(l.value="right",s.value=!0):s.value=!1}}),{docked:s,orientation:l,isDragging:o,movement:a,position:h}}function oe(t,i,n,s){const l=e.ref(null),o=e.ref(null),a=e.ref(null),h=e.ref(null);return e.watch(t,(c,r)=>{l.value=r}),e.watch(i,(c,r)=>{o.value=r}),e.watch(n,(c,r)=>{a.value=r}),e.watch(s,(c,r)=>{h.value=r}),{lastLeft:l,lastTop:o,lastWidth:a,lastHeight:h}}function le(t,i,n,s){const l=e.ref(t.value.width),o=e.ref(t.value.left),a=e.computed(()=>t.value.width),h=e.computed(()=>t.value.left),c=e.computed(()=>n.value?n.value.x:null);return e.watch([a,h],([r,d])=>{(l.value==null||o.value==null||i.value)&&(l.value=r,o.value=d)}),e.watch(c,r=>{s.value&&n.value&&(o.value=r)}),{left:o,width:l}}function se(t,i=e.ref({left:0,right:0,top:0,bottom:0})){const n=e.ref({});let s=!1;const l=()=>{if(!s&&t.value){const o=t.value.getBoundingClientRect();n.value.left=Math.max(o.left,i.value.left),n.value.top=Math.max(o.top,i.value.top),n.value.width=o.width,n.value.height=o.height,s=!0}};return e.onMounted(()=>{t.value&&l()}),e.watch(t,o=>{o&&l()}),{isIntialized:s,initialRect:n}}function ie(t,i=e.ref(!1),n=e.ref(!1),s=e.ref({left:0,right:0,top:0,bottom:0}),l={width:20,height:40}){const{initialRect:o}=se(t,s),a=e.ref(!1);let h=0,c=0,r=0,d=0,w=0;const u=5,p=e.ref(null),m=E=>{if(!(!t.value||i.value))if(a.value){const v=E.clientX-d,b=E.clientY-w;if(p.value==="left"||p.value==="left-bottom-corner"){const B=c-v;B>l.width&&(o.value.width=B,o.value.left=h+v,t.value.style.left=o.value.left+"px",t.value.style.width=o.value.width+"px")}if(p.value==="right"||p.value==="right-bottom-corner"){const B=c+v;B>l.width&&(o.value.width=B,t.value.style.width=o.value.width+"px")}if(p.value==="bottom"||p.value==="left-bottom-corner"||p.value==="right-bottom-corner"){const B=r+b;B>l.height&&(o.value.height=B,t.value.style.height=o.value.height+"px")}}else{const v=t.value.getBoundingClientRect(),b=E.clientX-v.left,B=E.clientY-v.top,_=b<=u,y=b>=v.width-u,C=B>=v.height-u;_&&C&&n.value?(t.value.style.cursor="nesw-resize",p.value="left-bottom-corner"):y&&C&&!n.value?(t.value.style.cursor="nwse-resize",p.value="right-bottom-corner"):_&&n.value?(t.value.style.cursor="ew-resize",p.value="left"):y&&!n.value?(t.value.style.cursor="ew-resize",p.value="right"):C?(t.value.style.cursor="ns-resize",p.value="bottom"):(t.value.style.cursor="",p.value=null)}},f=E=>{if(!t.value||!p.value)return;const v=t.value.getBoundingClientRect();d=E.clientX,w=E.clientY,c=v.width,r=v.height,h=v.left,o.value.width=c,o.value.height=r,o.value.left=v.left,o.value.top=v.top,a.value=!0,document.addEventListener("mousemove",m),document.addEventListener("mouseup",g)},g=()=>{a.value=!1,p.value=null,t.value&&(t.value.style.cursor=""),document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",g)},M=()=>{t.value&&(t.value.removeEventListener("mousedown",f),t.value.removeEventListener("mousemove",m)),document.removeEventListener("mouseup",g)},k=()=>{t.value&&(t.value.addEventListener("mousedown",f),t.value.addEventListener("mousemove",m))};return e.onMounted(()=>{t.value&&k()}),e.onBeforeUnmount(()=>{M()}),e.watch(t,E=>{E?k():M()}),{rect:o,isResizing:a}}function ce(t,i,n,s){const l=()=>{if(t.value){const c=t.value;i.value?c.style.transition="width 0.3s ease-out, left 0.3s ease-out":c.style.transition="width 0.3s ease"}},o=()=>{t.value&&(t.value.style.transition="")},a=()=>{t.value&&t.value.removeEventListener("transitionend",o)},h=()=>{t.value&&t.value.addEventListener("transitionend",o)};e.onMounted(()=>{t.value&&t.value.addEventListener("transitionend",o)}),e.onBeforeUnmount(()=>{t.value&&t.value.removeEventListener("transitionend",o)}),e.watch(t,c=>{c?h():a()}),e.watch(n,()=>{l()}),e.watch(s,()=>{l()})}function ae(t,i,n,s){const l=e.ref(window.innerWidth),o=e.ref(window.innerHeight),{docked:a,orientation:h,movement:c,position:r,isDragging:d}=ne(t,i,s),w=e.computed(()=>h.value==="right"),{rect:u,isResizing:p}=ie(t,n,w,s.value.offset),{width:m,left:f}=le(u,p,r,d),{lastTop:g,lastHeight:M}=oe(e.computed(()=>u.value.left),e.computed(()=>u.value.top),e.computed(()=>u.value.width),e.computed(()=>u.value.height)),{autoOpened:k}=ee(t,i,n);ce(t,w,n,k);const E=_=>{if(t.value){const y=t.value.getBoundingClientRect(),C=y.left+_;if(w.value){u.value.left=C;const he=window.innerWidth-y.width-y.left;y.left<=0&&he>=0&&_<0&&(u.value.left=Math.max(0,C)),window.innerWidth-y.width<=0&&(u.value.left=window.innerWidth-y.width)}else y.left+y.width>=window.innerWidth&&_<0&&(u.value.left=Math.max(0,C))}},v=()=>{const _=window.innerWidth-l.value;l.value=window.innerWidth,o.value=window.innerHeight,E(_)};e.onMounted(()=>{window.addEventListener("resize",v)}),e.onUnmounted(()=>{window.removeEventListener("resize",v)});const b=_=>{_?(u.value.width=D,w.value&&f.value&&m.value&&(u.value.left=f.value+m.value-D)):(u.value.width=m.value,w.value&&f.value&&m.value&&(u.value.left=f.value))},B=()=>{a.value?(u.value.top=s.value.offset.value.top,u.value.height=window.innerHeight-s.value.offset.value.top-s.value.offset.value.bottom-1):(u.value.top=g.value,u.value.height=M.value)};return e.watch(a,()=>{B()}),e.watch(n,_=>{b(_)}),e.watch(k,_=>{n.value&&!d.value&&b(!_)}),e.watch(c,_=>{if(_&&t.value){const C=t.value.getBoundingClientRect();u.value.left=C.left,u.value.top=C.top}}),{rect:u,orientation:h,reversed:w}}const re=(t=>(e.pushScopeId("data-v-c27d14f6"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592L512 466.88L259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512L214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})],-1)),ue={class:"ml-tool-palette-title"},de={class:"ml-tool-palette-content"},O=z(e.defineComponent({__name:"MlToolPalette",props:e.mergeModels({title:{default:""},leftOffset:{default:0},rightOffset:{default:0},topOffset:{default:0},bottomOffset:{default:0}},{modelValue:{default:!0},modelModifiers:{}}),emits:e.mergeModels(["close"],["update:modelValue"]),setup(t,{emit:i}){const n=t,s=e.useModel(t,"modelValue"),l=i,o=e.ref(!1),a=e.ref(null),h=e.ref(null),c=e.computed(()=>({offset:e.ref({left:n.leftOffset,right:n.rightOffset,top:n.topOffset,bottom:n.bottomOffset})})),{rect:r,orientation:d,reversed:w}=ae(h,a,o,c),u=e.computed(()=>({left:`${r.value.left}px`,top:`${r.value.top}px`,width:`${r.value.width}px`,height:`${r.value.height}px`})),p=e.computed(()=>w.value?{borderLeft:"1px solid",borderRight:null}:{borderLeft:null,borderRight:"1px solid"}),m=()=>{s.value=!1;const f=h.value;l("close",{x:f?f.clientLeft:0,y:f?f.clientTop:0})};return(f,g)=>{const M=x.ElIcon;return s.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"toolPaletteElement",ref:h,style:e.normalizeStyle([u.value]),class:"ml-tool-palette-dialog"},[e.createElementVNode("div",{class:e.normalizeClass(["ml-tool-palette-dialog-layout",e.unref(d)])},[e.createElementVNode("div",{ref_key:"titleBarElement",ref:a,class:"ml-tool-palette-title-bar",style:e.normalizeStyle(p.value)},[e.createVNode(M,{size:18,class:"ml-tool-palette-dialog-icon",onClick:m},{default:e.withCtx(()=>[re]),_:1}),e.createVNode(S,{class:"ml-tool-palette-dialog-icon",modelValue:o.value,"onUpdate:modelValue":g[0]||(g[0]=k=>o.value=k),reverse:e.unref(w)},null,8,["modelValue","reverse"]),e.createElementVNode("span",ue,e.toDisplayString(n.title),1)],4),e.createElementVNode("div",de,[e.renderSlot(f.$slots,"default",{},void 0,!0)])],2)],4)):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-c27d14f6"]]),me={install(t){t.component("MlCollapse",V),t.component("MlDropdown",V),t.component("MlLanguage",I),t.component("MlStatusBar",N),t.component("MlToolBar",W),t.component("MlToolPalette",O)}};L.MlCollapse=S,L.MlDropdown=V,L.MlLanguage=I,L.MlStatusBar=N,L.MlToolBar=W,L.MlToolPalette=O,L.default=me,Object.defineProperties(L,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/lib/index.js
CHANGED
|
@@ -13,7 +13,7 @@ export default {
|
|
|
13
13
|
app.component('MlDropdown', MlDropdown);
|
|
14
14
|
app.component('MlLanguage', MlLanguage);
|
|
15
15
|
app.component('MlStatusBar', MlStatusBar);
|
|
16
|
-
app.component('
|
|
16
|
+
app.component('MlToolBar', MlToolBar);
|
|
17
17
|
app.component('MlToolPalette', MlToolPalette);
|
|
18
18
|
}
|
|
19
19
|
};
|
package/package.json
CHANGED
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
display: flex;
|
|
24
24
|
justify-content: space-between;
|
|
25
25
|
align-items: center;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
background-color: var(--el-fill-color);
|
|
27
|
+
border: 1px solid var(--el-border-color);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.ml-status-bar-left,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
v-if="visible"
|
|
7
7
|
>
|
|
8
8
|
<div class="ml-tool-palette-dialog-layout" :class="orientation">
|
|
9
|
-
<div ref="titleBarElement" class="ml-tool-palette-title-bar">
|
|
9
|
+
<div ref="titleBarElement" class="ml-tool-palette-title-bar" :style="titleBarBorderStyle">
|
|
10
10
|
<el-icon
|
|
11
11
|
:size="18"
|
|
12
12
|
class="ml-tool-palette-dialog-icon"
|
|
@@ -128,6 +128,16 @@ const resizedStyle = computed(() => {
|
|
|
128
128
|
}
|
|
129
129
|
})
|
|
130
130
|
|
|
131
|
+
const titleBarBorderStyle = computed(() => {
|
|
132
|
+
return reversed.value ? {
|
|
133
|
+
borderLeft: '1px solid',
|
|
134
|
+
borderRight: null
|
|
135
|
+
} : {
|
|
136
|
+
borderLeft: null,
|
|
137
|
+
borderRight: '1px solid'
|
|
138
|
+
}
|
|
139
|
+
})
|
|
140
|
+
|
|
131
141
|
const handleClose = () => {
|
|
132
142
|
visible.value = false
|
|
133
143
|
const element = toolPaletteElement.value
|
|
@@ -144,8 +154,8 @@ const handleClose = () => {
|
|
|
144
154
|
width: 300px;
|
|
145
155
|
min-width: var(--collapsed-width);
|
|
146
156
|
position: fixed;
|
|
157
|
+
box-sizing: border-box;
|
|
147
158
|
border: 1px solid;
|
|
148
|
-
border-radius: 4px;
|
|
149
159
|
}
|
|
150
160
|
|
|
151
161
|
.ml-tool-palette-dialog-icon {
|
|
@@ -165,7 +175,6 @@ const handleClose = () => {
|
|
|
165
175
|
cursor: move; /* Draggable cursor on the left part */
|
|
166
176
|
writing-mode: vertical-rl; /* Vertically align the text */
|
|
167
177
|
text-align: center;
|
|
168
|
-
border: 1px;
|
|
169
178
|
}
|
|
170
179
|
|
|
171
180
|
.ml-tool-palette-title {
|
|
@@ -185,8 +194,7 @@ const handleClose = () => {
|
|
|
185
194
|
flex-grow: 1;
|
|
186
195
|
display: flex;
|
|
187
196
|
justify-content: space-around;
|
|
188
|
-
|
|
189
|
-
background-color: white;
|
|
197
|
+
background-color: var(--el-fill-color);
|
|
190
198
|
overflow: hidden; /* Hides content when width becomes 0 */
|
|
191
199
|
}
|
|
192
200
|
|
|
@@ -125,7 +125,7 @@ export function useBoundingRect(
|
|
|
125
125
|
rect.value.height =
|
|
126
126
|
window.innerHeight -
|
|
127
127
|
dragOptions.value.offset.value.top -
|
|
128
|
-
dragOptions.value.offset.value.bottom
|
|
128
|
+
dragOptions.value.offset.value.bottom - 1
|
|
129
129
|
} else {
|
|
130
130
|
rect.value.top = lastTop.value
|
|
131
131
|
rect.value.height = lastHeight.value
|
|
@@ -125,7 +125,7 @@ export function useDrag(
|
|
|
125
125
|
options ? options.value.offset.value.top : 0,
|
|
126
126
|
Math.min(newY, viewportHeight - elementHeight)
|
|
127
127
|
)
|
|
128
|
-
const distanceToBottomBorder = viewportHeight - elementHeight
|
|
128
|
+
const distanceToBottomBorder = viewportHeight - elementHeight - 1
|
|
129
129
|
position.value.y = Math.min(
|
|
130
130
|
options
|
|
131
131
|
? distanceToBottomBorder - options.value.offset.value.bottom
|