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