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