@mlightcad/ui-components 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +329 -0
- package/dist/ui-components.es.js +324 -323
- package/dist/ui-components.umd.js +2 -2
- package/package.json +3 -3
- package/src/components/MlToggleButton.vue +1 -1
- package/src/components/MlToolPalette.vue +89 -62
- package/src/components/types.ts +1 -1
- package/src/composables/useResize.ts +3 -3
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-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-
|
|
2
|
-
import { ElIcon as U, ElDropdownItem as
|
|
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";
|
|
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 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";
|
|
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";
|
|
@@ -22,10 +22,10 @@ const fe = {
|
|
|
22
22
|
}, null, -1), _e = [
|
|
23
23
|
pe
|
|
24
24
|
];
|
|
25
|
-
function we(e,
|
|
26
|
-
return
|
|
25
|
+
function we(e, i) {
|
|
26
|
+
return x(), V("svg", fe, [..._e]);
|
|
27
27
|
}
|
|
28
|
-
const
|
|
28
|
+
const Q = { render: we }, ge = {
|
|
29
29
|
xmlns: "http://www.w3.org/2000/svg",
|
|
30
30
|
width: "1em",
|
|
31
31
|
height: "1em",
|
|
@@ -36,10 +36,10 @@ const K = { render: we }, ge = {
|
|
|
36
36
|
}, null, -1), Le = [
|
|
37
37
|
be
|
|
38
38
|
];
|
|
39
|
-
function xe(e,
|
|
40
|
-
return
|
|
39
|
+
function xe(e, i) {
|
|
40
|
+
return x(), V("svg", ge, [...Le]);
|
|
41
41
|
}
|
|
42
|
-
const
|
|
42
|
+
const Z = { render: xe }, Me = /* @__PURE__ */ Y({
|
|
43
43
|
__name: "MlCollapse",
|
|
44
44
|
props: /* @__PURE__ */ D({
|
|
45
45
|
size: { default: 18 },
|
|
@@ -49,24 +49,24 @@ const Q = { render: xe }, ye = /* @__PURE__ */ Y({
|
|
|
49
49
|
modelModifiers: {}
|
|
50
50
|
}),
|
|
51
51
|
emits: /* @__PURE__ */ D(["change"], ["update:modelValue"]),
|
|
52
|
-
setup(e, { emit:
|
|
53
|
-
const t = e, o = H(e, "modelValue"),
|
|
54
|
-
|
|
52
|
+
setup(e, { emit: i }) {
|
|
53
|
+
const t = e, o = H(e, "modelValue"), n = i, l = _(() => t.reverse ? o.value ? Q : Z : o.value ? Z : Q), u = _(() => `${t.size}px`), m = () => {
|
|
54
|
+
n("change", o.value), o.value = !o.value;
|
|
55
55
|
};
|
|
56
|
-
return (
|
|
57
|
-
const
|
|
58
|
-
return
|
|
56
|
+
return (a, c) => {
|
|
57
|
+
const d = U;
|
|
58
|
+
return x(), $(d, {
|
|
59
59
|
size: u.value,
|
|
60
60
|
onClick: m
|
|
61
61
|
}, {
|
|
62
|
-
default:
|
|
63
|
-
(
|
|
62
|
+
default: T(() => [
|
|
63
|
+
(x(), $(te(l.value)))
|
|
64
64
|
]),
|
|
65
65
|
_: 1
|
|
66
66
|
}, 8, ["size"]);
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
}),
|
|
69
|
+
}), ye = (e) => (le("data-v-3fc33b5d"), e = e(), ne(), e), Ee = /* @__PURE__ */ ye(() => /* @__PURE__ */ B("svg", {
|
|
70
70
|
preserveAspectRatio: "xMidYMid meet",
|
|
71
71
|
viewBox: "0 0 24 24",
|
|
72
72
|
width: "1.2em",
|
|
@@ -87,21 +87,21 @@ const Q = { render: xe }, ye = /* @__PURE__ */ Y({
|
|
|
87
87
|
emits: {
|
|
88
88
|
click: null
|
|
89
89
|
},
|
|
90
|
-
setup(e, { emit:
|
|
91
|
-
const t = e, o =
|
|
90
|
+
setup(e, { emit: i }) {
|
|
91
|
+
const t = e, o = i, n = _(() => t.items.filter((u) => u.name !== t.current)), l = (u) => {
|
|
92
92
|
o("click", u);
|
|
93
93
|
};
|
|
94
94
|
return (u, m) => {
|
|
95
|
-
const
|
|
96
|
-
return
|
|
97
|
-
dropdown:
|
|
98
|
-
S(
|
|
99
|
-
default:
|
|
100
|
-
(
|
|
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
101
|
key: r.text,
|
|
102
102
|
command: r.name
|
|
103
103
|
}, {
|
|
104
|
-
default:
|
|
104
|
+
default: T(() => [
|
|
105
105
|
me(O(r.text), 1)
|
|
106
106
|
]),
|
|
107
107
|
_: 2
|
|
@@ -110,12 +110,12 @@ const Q = { render: xe }, ye = /* @__PURE__ */ Y({
|
|
|
110
110
|
_: 1
|
|
111
111
|
})
|
|
112
112
|
]),
|
|
113
|
-
default:
|
|
114
|
-
S(
|
|
113
|
+
default: T(() => [
|
|
114
|
+
S(a, {
|
|
115
115
|
size: "30",
|
|
116
116
|
class: "ml-dropdown-icon"
|
|
117
117
|
}, {
|
|
118
|
-
default:
|
|
118
|
+
default: T(() => [
|
|
119
119
|
Ee
|
|
120
120
|
]),
|
|
121
121
|
_: 1
|
|
@@ -125,12 +125,12 @@ const Q = { render: xe }, ye = /* @__PURE__ */ Y({
|
|
|
125
125
|
});
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
|
-
}), A = (e,
|
|
128
|
+
}), A = (e, i) => {
|
|
129
129
|
const t = e.__vccOpts || e;
|
|
130
|
-
for (const [o,
|
|
131
|
-
t[o] =
|
|
130
|
+
for (const [o, n] of i)
|
|
131
|
+
t[o] = n;
|
|
132
132
|
return t;
|
|
133
|
-
},
|
|
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
134
|
__name: "MlLanguage",
|
|
135
135
|
props: {
|
|
136
136
|
languages: {},
|
|
@@ -139,20 +139,20 @@ const Q = { render: xe }, ye = /* @__PURE__ */ Y({
|
|
|
139
139
|
emits: {
|
|
140
140
|
click: null
|
|
141
141
|
},
|
|
142
|
-
setup(e, { emit:
|
|
143
|
-
const t = e, o =
|
|
144
|
-
o("click",
|
|
142
|
+
setup(e, { emit: i }) {
|
|
143
|
+
const t = e, o = i, n = (l) => {
|
|
144
|
+
o("click", l);
|
|
145
145
|
};
|
|
146
|
-
return (
|
|
147
|
-
icon:
|
|
146
|
+
return (l, u) => (x(), $(G, {
|
|
147
|
+
icon: Ce,
|
|
148
148
|
items: t.languages,
|
|
149
149
|
current: t.current,
|
|
150
|
-
onClick:
|
|
150
|
+
onClick: n
|
|
151
151
|
}, null, 8, ["items", "current"]));
|
|
152
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,
|
|
155
|
-
return
|
|
154
|
+
function Ve(e, i) {
|
|
155
|
+
return x(), V("div", ke, [
|
|
156
156
|
B("div", $e, [
|
|
157
157
|
X(e.$slots, "left", {}, void 0, !0)
|
|
158
158
|
]),
|
|
@@ -171,31 +171,31 @@ const We = /* @__PURE__ */ A(Be, [["render", Ve], ["__scopeId", "data-v-d6a59cf0
|
|
|
171
171
|
modelModifiers: {}
|
|
172
172
|
}),
|
|
173
173
|
emits: /* @__PURE__ */ D(["click"], ["update:modelValue"]),
|
|
174
|
-
setup(e, { emit:
|
|
174
|
+
setup(e, { emit: i }) {
|
|
175
175
|
he((c) => ({
|
|
176
|
-
"
|
|
176
|
+
"021a85e9": u.value
|
|
177
177
|
}));
|
|
178
|
-
const t = e, o = H(e, "modelValue"),
|
|
179
|
-
o.value = !o.value,
|
|
178
|
+
const t = e, o = H(e, "modelValue"), n = i, l = _(() => o.value ? t.data.onIcon : t.data.offIcon), u = _(() => t.size + "px"), m = _(() => o.value ? t.data.onTooltip : t.data.offTooltip), a = () => {
|
|
179
|
+
o.value = !o.value, n("click", o.value);
|
|
180
180
|
};
|
|
181
|
-
return (c,
|
|
182
|
-
const
|
|
183
|
-
return
|
|
181
|
+
return (c, d) => {
|
|
182
|
+
const w = R, r = ee;
|
|
183
|
+
return x(), $(r, {
|
|
184
184
|
content: m.value,
|
|
185
185
|
"hide-after": 0
|
|
186
186
|
}, {
|
|
187
|
-
default:
|
|
188
|
-
S(
|
|
187
|
+
default: T(() => [
|
|
188
|
+
S(w, {
|
|
189
189
|
class: "ml-toggle-button",
|
|
190
|
-
icon:
|
|
191
|
-
onClick:
|
|
190
|
+
icon: l.value,
|
|
191
|
+
onClick: a
|
|
192
192
|
}, null, 8, ["icon"])
|
|
193
193
|
]),
|
|
194
194
|
_: 1
|
|
195
195
|
}, 8, ["content"]);
|
|
196
196
|
};
|
|
197
197
|
}
|
|
198
|
-
}), Se = /* @__PURE__ */ A(De, [["__scopeId", "data-v-
|
|
198
|
+
}), Se = /* @__PURE__ */ A(De, [["__scopeId", "data-v-5adaeb5a"]]), Ye = {
|
|
199
199
|
key: 0,
|
|
200
200
|
class: "ml-toolbar-button-text"
|
|
201
201
|
}, Ae = /* @__PURE__ */ Y({
|
|
@@ -208,8 +208,8 @@ const We = /* @__PURE__ */ A(Be, [["render", Ve], ["__scopeId", "data-v-d6a59cf0
|
|
|
208
208
|
emits: {
|
|
209
209
|
click: null
|
|
210
210
|
},
|
|
211
|
-
setup(e, { emit:
|
|
212
|
-
const t = e, o =
|
|
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
213
|
switch (t.size) {
|
|
214
214
|
case "small":
|
|
215
215
|
return 30;
|
|
@@ -217,36 +217,36 @@ const We = /* @__PURE__ */ A(Be, [["render", Ve], ["__scopeId", "data-v-d6a59cf0
|
|
|
217
217
|
return 50;
|
|
218
218
|
}
|
|
219
219
|
return 70;
|
|
220
|
-
}), m = (
|
|
221
|
-
o("click",
|
|
220
|
+
}), m = (d) => d.description ? d.description : d.text, a = _(() => t.size === "large"), c = (d) => {
|
|
221
|
+
o("click", d);
|
|
222
222
|
};
|
|
223
|
-
return (
|
|
224
|
-
const r = U,
|
|
225
|
-
return
|
|
226
|
-
class:
|
|
223
|
+
return (d, w) => {
|
|
224
|
+
const r = U, f = R, v = ee, y = re;
|
|
225
|
+
return x(), $(y, {
|
|
226
|
+
class: N(n.value)
|
|
227
227
|
}, {
|
|
228
|
-
default:
|
|
229
|
-
(
|
|
228
|
+
default: T(() => [
|
|
229
|
+
(x(!0), V(j, null, q(d.items, (E, k) => (x(), $(v, {
|
|
230
230
|
key: E.text,
|
|
231
231
|
content: m(E),
|
|
232
232
|
"hide-after": 0
|
|
233
233
|
}, {
|
|
234
|
-
default:
|
|
235
|
-
(
|
|
234
|
+
default: T(() => [
|
|
235
|
+
(x(), $(f, {
|
|
236
236
|
class: "ml-toolbar-button",
|
|
237
|
-
style:
|
|
237
|
+
style: F({ width: u.value + "px", height: u.value + "px" }),
|
|
238
238
|
key: k,
|
|
239
239
|
onClick: (I) => c(E.command)
|
|
240
240
|
}, {
|
|
241
|
-
default:
|
|
241
|
+
default: T(() => [
|
|
242
242
|
B("div", null, [
|
|
243
|
-
S(r, { size:
|
|
244
|
-
default:
|
|
245
|
-
(
|
|
243
|
+
S(r, { size: l.value }, {
|
|
244
|
+
default: T(() => [
|
|
245
|
+
(x(), $(te(E.icon)))
|
|
246
246
|
]),
|
|
247
247
|
_: 2
|
|
248
248
|
}, 1032, ["size"]),
|
|
249
|
-
|
|
249
|
+
a.value ? (x(), V("div", Ye, O(E.text), 1)) : oe("", !0)
|
|
250
250
|
])
|
|
251
251
|
]),
|
|
252
252
|
_: 2
|
|
@@ -259,282 +259,282 @@ const We = /* @__PURE__ */ A(Be, [["render", Ve], ["__scopeId", "data-v-d6a59cf0
|
|
|
259
259
|
}, 8, ["class"]);
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
|
-
}), He = /* @__PURE__ */ A(Ae, [["__scopeId", "data-v-c6504e33"]]),
|
|
263
|
-
function Oe(e,
|
|
264
|
-
const o =
|
|
262
|
+
}), He = /* @__PURE__ */ A(Ae, [["__scopeId", "data-v-c6504e33"]]), P = 20;
|
|
263
|
+
function Oe(e, i, t) {
|
|
264
|
+
const o = p(!1), n = (a) => {
|
|
265
265
|
if (t.value && e.value) {
|
|
266
|
-
const c = e.value.getBoundingClientRect(),
|
|
267
|
-
o.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;
|
|
268
268
|
}
|
|
269
|
-
},
|
|
269
|
+
}, l = () => {
|
|
270
270
|
t.value && (o.value = !0);
|
|
271
271
|
}, u = () => {
|
|
272
|
-
|
|
272
|
+
i.value && i.value.addEventListener("mousemove", l), e.value && e.value.addEventListener("mousemove", l);
|
|
273
273
|
}, m = () => {
|
|
274
|
-
|
|
274
|
+
i.value && i.value.removeEventListener("mousemove", l), e.value && e.value.removeEventListener("mousemove", l);
|
|
275
275
|
};
|
|
276
276
|
return W(() => {
|
|
277
|
-
window.addEventListener("mousemove",
|
|
278
|
-
}),
|
|
279
|
-
window.removeEventListener("mousemove",
|
|
280
|
-
}),
|
|
281
|
-
|
|
282
|
-
}),
|
|
283
|
-
|
|
277
|
+
window.addEventListener("mousemove", n);
|
|
278
|
+
}), J(() => {
|
|
279
|
+
window.removeEventListener("mousemove", n);
|
|
280
|
+
}), M(t, (a) => {
|
|
281
|
+
a && (o.value = !1);
|
|
282
|
+
}), M(e, (a) => {
|
|
283
|
+
a ? u() : m();
|
|
284
284
|
}), { autoOpened: o };
|
|
285
285
|
}
|
|
286
|
-
function Xe(e,
|
|
287
|
-
const o =
|
|
288
|
-
x:
|
|
289
|
-
y:
|
|
290
|
-
}),
|
|
286
|
+
function Xe(e, i, t) {
|
|
287
|
+
const o = p(!1), n = p(null), l = p(null), u = { x: 0, y: 0 }, m = _(() => n.value == null || l.value == null ? { x: 0, y: 0 } : {
|
|
288
|
+
x: n.value.x - l.value.x,
|
|
289
|
+
y: n.value.y - l.value.y
|
|
290
|
+
}), a = () => {
|
|
291
291
|
if (e.value) {
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
x:
|
|
295
|
-
y:
|
|
296
|
-
},
|
|
297
|
-
x:
|
|
298
|
-
y:
|
|
292
|
+
const v = e.value.getBoundingClientRect();
|
|
293
|
+
l.value = {
|
|
294
|
+
x: v.left,
|
|
295
|
+
y: v.top
|
|
296
|
+
}, n.value = {
|
|
297
|
+
x: v.left,
|
|
298
|
+
y: v.top
|
|
299
299
|
};
|
|
300
300
|
}
|
|
301
301
|
}, c = () => {
|
|
302
|
-
e.value && e.value.addEventListener("mousedown",
|
|
303
|
-
},
|
|
304
|
-
e.value && e.value.removeEventListener("mousedown",
|
|
305
|
-
},
|
|
302
|
+
e.value && e.value.addEventListener("mousedown", w);
|
|
303
|
+
}, d = () => {
|
|
304
|
+
e.value && e.value.removeEventListener("mousedown", w);
|
|
305
|
+
}, w = (v) => {
|
|
306
306
|
if (e.value != null) {
|
|
307
|
-
if (
|
|
308
|
-
const
|
|
309
|
-
if (
|
|
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;
|
|
310
310
|
}
|
|
311
|
-
o.value = !0, u.x =
|
|
311
|
+
o.value = !0, u.x = v.clientX, u.y = v.clientY, a(), document.addEventListener("mousemove", r), document.addEventListener("mouseup", f);
|
|
312
312
|
}
|
|
313
|
-
}, r = (
|
|
314
|
-
if (o.value &&
|
|
315
|
-
const
|
|
316
|
-
|
|
313
|
+
}, r = (v) => {
|
|
314
|
+
if (o.value && l.value && n.value) {
|
|
315
|
+
const y = window.innerWidth, E = window.innerHeight, k = e.value, I = k.getBoundingClientRect(), C = I.width, s = I.height, h = l.value.x + (v.clientX - u.x), b = l.value.y + (v.clientY - u.y);
|
|
316
|
+
n.value.x = Math.max(
|
|
317
317
|
t ? t.value.offset.value.left : 0,
|
|
318
|
-
|
|
318
|
+
h
|
|
319
319
|
);
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
t ?
|
|
323
|
-
|
|
324
|
-
),
|
|
320
|
+
const L = y - C;
|
|
321
|
+
n.value.x = Math.min(
|
|
322
|
+
t ? L - t.value.offset.value.right : L,
|
|
323
|
+
n.value.x
|
|
324
|
+
), n.value.y = Math.max(
|
|
325
325
|
t ? t.value.offset.value.top : 0,
|
|
326
|
-
Math.min(
|
|
326
|
+
Math.min(b, E - s)
|
|
327
327
|
);
|
|
328
|
-
const z = E -
|
|
329
|
-
|
|
328
|
+
const z = E - s;
|
|
329
|
+
n.value.y = Math.min(
|
|
330
330
|
t ? z - t.value.offset.value.bottom : z,
|
|
331
|
-
|
|
332
|
-
), k.style.left =
|
|
331
|
+
n.value.y
|
|
332
|
+
), k.style.left = n.value.x + "px", k.style.top = n.value.y + "px";
|
|
333
333
|
}
|
|
334
|
-
},
|
|
335
|
-
o.value = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup",
|
|
334
|
+
}, f = () => {
|
|
335
|
+
o.value = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", f);
|
|
336
336
|
};
|
|
337
337
|
return W(() => {
|
|
338
|
-
e.value && (
|
|
339
|
-
}),
|
|
340
|
-
e.value && e.value.removeEventListener("mousedown",
|
|
341
|
-
}),
|
|
342
|
-
|
|
338
|
+
e.value && (a(), c());
|
|
339
|
+
}), J(() => {
|
|
340
|
+
e.value && e.value.removeEventListener("mousedown", w);
|
|
341
|
+
}), M(e, (v) => {
|
|
342
|
+
v ? (a(), c()) : d();
|
|
343
343
|
}), {
|
|
344
344
|
isDragging: o,
|
|
345
345
|
movement: m,
|
|
346
|
-
position:
|
|
346
|
+
position: n
|
|
347
347
|
};
|
|
348
348
|
}
|
|
349
|
-
function Ue(e,
|
|
350
|
-
const o =
|
|
349
|
+
function Ue(e, i, t) {
|
|
350
|
+
const o = p(!1), n = p("left"), { isDragging: l, movement: u, position: m } = Xe(
|
|
351
351
|
e,
|
|
352
|
-
|
|
352
|
+
i,
|
|
353
353
|
t
|
|
354
354
|
);
|
|
355
|
-
return
|
|
356
|
-
if (
|
|
357
|
-
const
|
|
358
|
-
|
|
355
|
+
return M(u, (a) => {
|
|
356
|
+
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;
|
|
359
359
|
}
|
|
360
360
|
}), {
|
|
361
361
|
docked: o,
|
|
362
|
-
orientation:
|
|
363
|
-
isDragging:
|
|
362
|
+
orientation: n,
|
|
363
|
+
isDragging: l,
|
|
364
364
|
movement: u,
|
|
365
365
|
position: m
|
|
366
366
|
};
|
|
367
367
|
}
|
|
368
|
-
function Ne(e,
|
|
369
|
-
const
|
|
370
|
-
return
|
|
371
|
-
l.value = c;
|
|
372
|
-
}), y(a, (s, c) => {
|
|
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) => {
|
|
373
371
|
n.value = c;
|
|
374
|
-
}),
|
|
372
|
+
}), M(i, (a, c) => {
|
|
373
|
+
l.value = c;
|
|
374
|
+
}), M(t, (a, c) => {
|
|
375
375
|
u.value = c;
|
|
376
|
-
}),
|
|
376
|
+
}), M(o, (a, c) => {
|
|
377
377
|
m.value = c;
|
|
378
378
|
}), {
|
|
379
|
-
lastLeft:
|
|
380
|
-
lastTop:
|
|
379
|
+
lastLeft: n,
|
|
380
|
+
lastTop: l,
|
|
381
381
|
lastWidth: u,
|
|
382
382
|
lastHeight: m
|
|
383
383
|
};
|
|
384
384
|
}
|
|
385
|
-
function Fe(e,
|
|
386
|
-
const
|
|
387
|
-
return
|
|
388
|
-
(
|
|
389
|
-
}),
|
|
390
|
-
o.value && t.value && (
|
|
391
|
-
}), { left:
|
|
385
|
+
function Fe(e, i, t, o) {
|
|
386
|
+
const n = p(e.value.width), l = p(e.value.left), u = _(() => e.value.width), m = _(() => e.value.left), a = _(() => t.value ? t.value.x : null);
|
|
387
|
+
return M([u, m], ([c, d]) => {
|
|
388
|
+
(n.value == null || l.value == null || i.value) && (n.value = c, l.value = d);
|
|
389
|
+
}), M(a, (c) => {
|
|
390
|
+
o.value && t.value && (l.value = c);
|
|
391
|
+
}), { left: l, width: n };
|
|
392
392
|
}
|
|
393
|
-
function Ge(e,
|
|
394
|
-
const t =
|
|
393
|
+
function Ge(e, i = p({ left: 0, right: 0, top: 0, bottom: 0 })) {
|
|
394
|
+
const t = p({});
|
|
395
395
|
let o = !1;
|
|
396
|
-
const
|
|
396
|
+
const n = () => {
|
|
397
397
|
if (!o && e.value) {
|
|
398
|
-
const
|
|
399
|
-
t.value.left = Math.max(
|
|
398
|
+
const l = e.value.getBoundingClientRect();
|
|
399
|
+
t.value.left = Math.max(l.left, i.value.left), t.value.top = Math.max(l.top, i.value.top), t.value.width = l.width, t.value.height = l.height, o = !0;
|
|
400
400
|
}
|
|
401
401
|
};
|
|
402
402
|
return W(() => {
|
|
403
|
-
e.value &&
|
|
404
|
-
}),
|
|
405
|
-
|
|
403
|
+
e.value && n();
|
|
404
|
+
}), M(e, (l) => {
|
|
405
|
+
l && n();
|
|
406
406
|
}), {
|
|
407
407
|
isIntialized: o,
|
|
408
408
|
initialRect: t
|
|
409
409
|
};
|
|
410
410
|
}
|
|
411
|
-
function je(e,
|
|
412
|
-
const { initialRect:
|
|
413
|
-
let m = 0,
|
|
414
|
-
const r = 5,
|
|
415
|
-
if (!(!e.value ||
|
|
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
416
|
if (u.value) {
|
|
417
|
-
const
|
|
418
|
-
if (
|
|
419
|
-
const
|
|
420
|
-
|
|
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");
|
|
421
421
|
}
|
|
422
|
-
if (
|
|
423
|
-
const
|
|
424
|
-
|
|
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");
|
|
425
425
|
}
|
|
426
|
-
if (
|
|
427
|
-
const
|
|
428
|
-
|
|
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");
|
|
429
429
|
}
|
|
430
430
|
} else {
|
|
431
|
-
const
|
|
432
|
-
|
|
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);
|
|
433
433
|
}
|
|
434
|
-
},
|
|
435
|
-
if (!e.value || !
|
|
436
|
-
const
|
|
437
|
-
|
|
434
|
+
}, y = (C) => {
|
|
435
|
+
if (!e.value || !f.value) return;
|
|
436
|
+
const s = e.value.getBoundingClientRect();
|
|
437
|
+
d = C.clientX, w = C.clientY, a = s.width, c = s.height, m = s.left, l.value.width = a, l.value.height = c, l.value.left = s.left, l.value.top = s.top, u.value = !0, document.addEventListener("mousemove", v), document.addEventListener("mouseup", E);
|
|
438
438
|
}, E = () => {
|
|
439
|
-
u.value = !1,
|
|
439
|
+
u.value = !1, f.value = null, e.value && (e.value.style.cursor = ""), document.removeEventListener("mousemove", v), document.removeEventListener("mouseup", E);
|
|
440
440
|
}, k = () => {
|
|
441
|
-
e.value && (e.value.removeEventListener("mousedown",
|
|
441
|
+
e.value && (e.value.removeEventListener("mousedown", y), e.value.removeEventListener("mousemove", v)), document.removeEventListener("mouseup", E);
|
|
442
442
|
}, I = () => {
|
|
443
|
-
e.value && (e.value.addEventListener("mousedown",
|
|
443
|
+
e.value && (e.value.addEventListener("mousedown", y), e.value.addEventListener("mousemove", v));
|
|
444
444
|
};
|
|
445
445
|
return W(() => {
|
|
446
446
|
e.value && I();
|
|
447
447
|
}), se(() => {
|
|
448
448
|
k();
|
|
449
|
-
}),
|
|
450
|
-
|
|
451
|
-
}), { rect:
|
|
449
|
+
}), M(e, (C) => {
|
|
450
|
+
C ? I() : k();
|
|
451
|
+
}), { rect: l, isResizing: u };
|
|
452
452
|
}
|
|
453
|
-
function qe(e,
|
|
454
|
-
const
|
|
453
|
+
function qe(e, i, t, o) {
|
|
454
|
+
const n = () => {
|
|
455
455
|
if (e.value) {
|
|
456
|
-
const
|
|
457
|
-
|
|
456
|
+
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";
|
|
458
458
|
}
|
|
459
|
-
},
|
|
459
|
+
}, l = () => {
|
|
460
460
|
e.value && (e.value.style.transition = "");
|
|
461
461
|
}, u = () => {
|
|
462
|
-
e.value && e.value.removeEventListener("transitionend",
|
|
462
|
+
e.value && e.value.removeEventListener("transitionend", l);
|
|
463
463
|
}, m = () => {
|
|
464
|
-
e.value && e.value.addEventListener("transitionend",
|
|
464
|
+
e.value && e.value.addEventListener("transitionend", l);
|
|
465
465
|
};
|
|
466
466
|
W(() => {
|
|
467
|
-
e.value && e.value.addEventListener("transitionend",
|
|
467
|
+
e.value && e.value.addEventListener("transitionend", l);
|
|
468
468
|
}), se(() => {
|
|
469
|
-
e.value && e.value.removeEventListener("transitionend",
|
|
470
|
-
}),
|
|
471
|
-
|
|
472
|
-
}),
|
|
473
|
-
|
|
474
|
-
}),
|
|
475
|
-
|
|
469
|
+
e.value && e.value.removeEventListener("transitionend", l);
|
|
470
|
+
}), M(e, (a) => {
|
|
471
|
+
a ? m() : u();
|
|
472
|
+
}), M(t, () => {
|
|
473
|
+
n();
|
|
474
|
+
}), M(o, () => {
|
|
475
|
+
n();
|
|
476
476
|
});
|
|
477
477
|
}
|
|
478
|
-
function Je(e,
|
|
479
|
-
const
|
|
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(
|
|
480
480
|
e,
|
|
481
|
-
|
|
481
|
+
i,
|
|
482
482
|
o
|
|
483
|
-
),
|
|
483
|
+
), w = _(() => m.value === "right"), { rect: r, isResizing: f } = je(
|
|
484
484
|
e,
|
|
485
485
|
t,
|
|
486
|
-
|
|
486
|
+
w,
|
|
487
487
|
o.value.offset
|
|
488
|
-
), { width:
|
|
488
|
+
), { width: v, left: y } = Fe(
|
|
489
489
|
r,
|
|
490
|
-
|
|
490
|
+
f,
|
|
491
491
|
c,
|
|
492
|
-
|
|
492
|
+
d
|
|
493
493
|
), { lastTop: E, lastHeight: k } = Ne(
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
), { autoOpened: I } = Oe(e,
|
|
499
|
-
qe(e,
|
|
500
|
-
const
|
|
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) => {
|
|
501
501
|
if (e.value) {
|
|
502
|
-
const z = e.value.getBoundingClientRect(),
|
|
503
|
-
if (
|
|
504
|
-
r.value.left =
|
|
505
|
-
const
|
|
506
|
-
z.left <= 0 &&
|
|
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);
|
|
507
507
|
} else
|
|
508
|
-
z.left + z.width >= window.innerWidth &&
|
|
508
|
+
z.left + z.width >= window.innerWidth && L < 0 && (r.value.left = Math.max(0, g));
|
|
509
509
|
}
|
|
510
|
-
},
|
|
511
|
-
const
|
|
512
|
-
|
|
510
|
+
}, s = () => {
|
|
511
|
+
const L = window.innerWidth - n.value;
|
|
512
|
+
n.value = window.innerWidth, l.value = window.innerHeight, C(L);
|
|
513
513
|
};
|
|
514
514
|
W(() => {
|
|
515
|
-
window.addEventListener("resize",
|
|
516
|
-
}),
|
|
517
|
-
window.removeEventListener("resize",
|
|
515
|
+
window.addEventListener("resize", s);
|
|
516
|
+
}), J(() => {
|
|
517
|
+
window.removeEventListener("resize", s);
|
|
518
518
|
});
|
|
519
|
-
const
|
|
520
|
-
|
|
521
|
-
},
|
|
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
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);
|
|
523
523
|
};
|
|
524
|
-
return
|
|
525
|
-
|
|
526
|
-
}),
|
|
527
|
-
L
|
|
528
|
-
}),
|
|
529
|
-
t.value && !
|
|
530
|
-
}),
|
|
531
|
-
if (
|
|
532
|
-
const
|
|
533
|
-
r.value.left =
|
|
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;
|
|
534
534
|
}
|
|
535
|
-
}), { rect: r, orientation: m, reversed:
|
|
535
|
+
}), { rect: r, orientation: m, reversed: w };
|
|
536
536
|
}
|
|
537
|
-
const Ke = (e) => (
|
|
537
|
+
const Ke = (e) => (le("data-v-cd1a3c67"), e = e(), ne(), e), Qe = /* @__PURE__ */ Ke(() => /* @__PURE__ */ B("svg", {
|
|
538
538
|
xmlns: "http://www.w3.org/2000/svg",
|
|
539
539
|
width: "1em",
|
|
540
540
|
height: "1em",
|
|
@@ -555,7 +555,8 @@ const Ke = (e) => (te("data-v-43098ce9"), e = e(), ne(), e), Qe = /* @__PURE__ *
|
|
|
555
555
|
leftOffset: { default: 0 },
|
|
556
556
|
rightOffset: { default: 0 },
|
|
557
557
|
topOffset: { default: 0 },
|
|
558
|
-
bottomOffset: { default: 0 }
|
|
558
|
+
bottomOffset: { default: 0 },
|
|
559
|
+
disabled: { type: Boolean, default: !1 }
|
|
559
560
|
}, {
|
|
560
561
|
modelValue: { default: !0 },
|
|
561
562
|
modelModifiers: {},
|
|
@@ -563,140 +564,140 @@ const Ke = (e) => (te("data-v-43098ce9"), e = e(), ne(), e), Qe = /* @__PURE__ *
|
|
|
563
564
|
activeTabModifiers: {}
|
|
564
565
|
}),
|
|
565
566
|
emits: /* @__PURE__ */ D(["close", "tab-change", "tab-close"], ["update:modelValue", "update:activeTab"]),
|
|
566
|
-
setup(e, { emit:
|
|
567
|
-
const t = e, o = H(e, "modelValue"),
|
|
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);
|
|
568
569
|
W(() => {
|
|
569
|
-
u.value && !
|
|
570
|
-
}),
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
570
|
+
u.value && !n.value && t.tabs && t.tabs.length > 0 && (n.value = t.tabs[0].name);
|
|
571
|
+
}), M(
|
|
572
|
+
() => t.tabs,
|
|
573
|
+
(s) => {
|
|
574
|
+
s && s.length > 0 && !n.value && (n.value = s[0].name);
|
|
575
|
+
},
|
|
576
|
+
{ immediate: !0 }
|
|
577
|
+
);
|
|
578
|
+
const m = p(!1), a = p(null), c = p(null), d = _(() => ({
|
|
579
|
+
offset: p({
|
|
575
580
|
left: t.leftOffset,
|
|
576
581
|
right: t.rightOffset,
|
|
577
582
|
top: t.topOffset,
|
|
578
583
|
bottom: t.bottomOffset
|
|
579
584
|
})
|
|
580
585
|
})), {
|
|
581
|
-
rect:
|
|
586
|
+
rect: w,
|
|
582
587
|
orientation: r,
|
|
583
|
-
reversed:
|
|
584
|
-
} = Je(c,
|
|
585
|
-
left: `${
|
|
586
|
-
top: `${
|
|
587
|
-
width: `${
|
|
588
|
-
height: `${
|
|
589
|
-
})),
|
|
590
|
-
borderLeft: "1px solid var(--el-border-color)",
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
}), E = p(() => {
|
|
596
|
-
if (u.value && l.value && t.tabs) {
|
|
597
|
-
const i = t.tabs.find((L) => L.name === l.value);
|
|
598
|
-
if (i && i.title)
|
|
599
|
-
return i.title;
|
|
588
|
+
reversed: f
|
|
589
|
+
} = Je(c, a, m, d), v = _(() => ({
|
|
590
|
+
left: `${w.value.left}px`,
|
|
591
|
+
top: `${w.value.top}px`,
|
|
592
|
+
width: `${w.value.width}px`,
|
|
593
|
+
height: `${w.value.height}px`
|
|
594
|
+
})), y = _(
|
|
595
|
+
() => f.value ? { borderLeft: "1px solid var(--el-border-color)", borderRight: null } : { borderLeft: null, borderRight: "1px solid var(--el-border-color)" }
|
|
596
|
+
), E = _(() => {
|
|
597
|
+
if (u.value && n.value && t.tabs) {
|
|
598
|
+
const s = t.tabs.find((h) => h.name === n.value);
|
|
599
|
+
if (s != null && s.title) return s.title;
|
|
600
600
|
}
|
|
601
601
|
return t.title;
|
|
602
602
|
}), k = () => {
|
|
603
603
|
o.value = !1;
|
|
604
|
-
const
|
|
605
|
-
|
|
606
|
-
x:
|
|
607
|
-
y:
|
|
604
|
+
const s = c.value;
|
|
605
|
+
l("close", {
|
|
606
|
+
x: s ? s.clientLeft : 0,
|
|
607
|
+
y: s ? s.clientTop : 0
|
|
608
608
|
});
|
|
609
|
-
}, I = (
|
|
610
|
-
|
|
611
|
-
},
|
|
612
|
-
if (
|
|
613
|
-
const
|
|
614
|
-
if (
|
|
615
|
-
const
|
|
616
|
-
|
|
609
|
+
}, I = (s) => {
|
|
610
|
+
l("tab-change", s);
|
|
611
|
+
}, C = (s) => {
|
|
612
|
+
if (l("tab-close", s), n.value === s && t.tabs) {
|
|
613
|
+
const h = t.tabs.findIndex((b) => b.name === s);
|
|
614
|
+
if (h >= 0) {
|
|
615
|
+
const b = t.tabs[h + 1] || t.tabs[h - 1];
|
|
616
|
+
b && (n.value = b.name);
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
619
|
};
|
|
620
|
-
return (
|
|
621
|
-
const
|
|
622
|
-
return o.value ? (
|
|
620
|
+
return (s, h) => {
|
|
621
|
+
const b = U, L = de, z = ve;
|
|
622
|
+
return o.value ? (x(), V("div", {
|
|
623
623
|
key: 0,
|
|
624
624
|
ref_key: "toolPaletteElement",
|
|
625
625
|
ref: c,
|
|
626
|
-
style:
|
|
627
|
-
class: "ml-tool-palette-dialog"
|
|
626
|
+
style: F([v.value]),
|
|
627
|
+
class: N(["ml-tool-palette-dialog", { "ml-tool-palette-disabled": s.disabled }])
|
|
628
628
|
}, [
|
|
629
629
|
B("div", {
|
|
630
|
-
class:
|
|
630
|
+
class: N(["ml-tool-palette-dialog-layout", K(r)])
|
|
631
631
|
}, [
|
|
632
632
|
B("div", {
|
|
633
633
|
ref_key: "titleBarElement",
|
|
634
|
-
ref:
|
|
634
|
+
ref: a,
|
|
635
635
|
class: "ml-tool-palette-title-bar",
|
|
636
|
-
style:
|
|
636
|
+
style: F(y.value)
|
|
637
637
|
}, [
|
|
638
|
-
S(
|
|
638
|
+
S(b, {
|
|
639
639
|
size: 18,
|
|
640
640
|
class: "ml-tool-palette-dialog-icon",
|
|
641
|
-
onClick: k
|
|
641
|
+
onClick: h[0] || (h[0] = (g) => !s.disabled && k())
|
|
642
642
|
}, {
|
|
643
|
-
default:
|
|
643
|
+
default: T(() => [
|
|
644
644
|
Qe
|
|
645
645
|
]),
|
|
646
646
|
_: 1
|
|
647
647
|
}),
|
|
648
|
-
S(
|
|
648
|
+
S(Me, {
|
|
649
649
|
class: "ml-tool-palette-dialog-icon",
|
|
650
650
|
modelValue: m.value,
|
|
651
|
-
"onUpdate:modelValue":
|
|
652
|
-
reverse:
|
|
653
|
-
|
|
651
|
+
"onUpdate:modelValue": h[1] || (h[1] = (g) => m.value = g),
|
|
652
|
+
reverse: K(f),
|
|
653
|
+
disabled: s.disabled
|
|
654
|
+
}, null, 8, ["modelValue", "reverse", "disabled"]),
|
|
654
655
|
B("span", Ze, O(E.value), 1)
|
|
655
656
|
], 4),
|
|
656
657
|
B("div", Pe, [
|
|
657
|
-
u.value ? (
|
|
658
|
+
u.value ? (x(), $(z, {
|
|
658
659
|
key: 0,
|
|
659
|
-
modelValue:
|
|
660
|
-
"onUpdate:modelValue":
|
|
660
|
+
modelValue: n.value,
|
|
661
|
+
"onUpdate:modelValue": h[2] || (h[2] = (g) => n.value = g),
|
|
661
662
|
type: "border-card",
|
|
662
663
|
class: "ml-tool-palette-tabs",
|
|
663
|
-
onTabRemove:
|
|
664
|
-
onTabChange: I
|
|
664
|
+
onTabRemove: h[3] || (h[3] = (g) => !s.disabled && C),
|
|
665
|
+
onTabChange: h[4] || (h[4] = (g) => !s.disabled && I)
|
|
665
666
|
}, {
|
|
666
|
-
default:
|
|
667
|
-
(
|
|
668
|
-
key:
|
|
669
|
-
name:
|
|
670
|
-
label:
|
|
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
|
|
671
672
|
}, {
|
|
672
|
-
label:
|
|
673
|
-
B("span", null, O(
|
|
673
|
+
label: T(() => [
|
|
674
|
+
B("span", null, O(g.label), 1)
|
|
674
675
|
]),
|
|
675
|
-
default:
|
|
676
|
-
X(
|
|
676
|
+
default: T(() => [
|
|
677
|
+
X(s.$slots, `tab-${g.name}`, {}, void 0, !0)
|
|
677
678
|
]),
|
|
678
679
|
_: 2
|
|
679
680
|
}, 1032, ["name", "label"]))), 128))
|
|
680
681
|
]),
|
|
681
682
|
_: 3
|
|
682
|
-
}, 8, ["modelValue"])) : (
|
|
683
|
-
X(
|
|
683
|
+
}, 8, ["modelValue"])) : (x(), V("div", Re, [
|
|
684
|
+
X(s.$slots, "default", {}, void 0, !0)
|
|
684
685
|
]))
|
|
685
686
|
])
|
|
686
687
|
], 2)
|
|
687
|
-
],
|
|
688
|
+
], 6)) : oe("", !0);
|
|
688
689
|
};
|
|
689
690
|
}
|
|
690
|
-
}), tt = /* @__PURE__ */ A(et, [["__scopeId", "data-v-
|
|
691
|
+
}), tt = /* @__PURE__ */ A(et, [["__scopeId", "data-v-cd1a3c67"]]), ht = {
|
|
691
692
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
692
693
|
install(e) {
|
|
693
|
-
e.component("MlCollapse",
|
|
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);
|
|
694
695
|
}
|
|
695
696
|
};
|
|
696
697
|
export {
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
698
|
+
Me as MlCollapse,
|
|
699
|
+
G as MlDropdown,
|
|
700
|
+
Te as MlLanguage,
|
|
700
701
|
We as MlStatusBar,
|
|
701
702
|
Se as MlToggleButton,
|
|
702
703
|
He as MlToolBar,
|