@mlightcad/ui-components 0.1.0 → 0.1.2
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 +142 -1
- package/dist/ui-components.es.js +358 -300
- package/dist/ui-components.umd.js +2 -2
- package/lib/index.d.ts +1 -0
- package/package.json +4 -4
- package/src/components/MlToolBar.vue +2 -0
- package/src/components/MlToolPalette.vue +158 -4
- package/src/index.ts +1 -0
package/dist/ui-components.es.js
CHANGED
|
@@ -1,81 +1,83 @@
|
|
|
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-b676e93b]{border:none;padding:0;cursor:pointer;width:var(--0547f26d);height:var(--0547f26d)}.ml-vertical-toolbar-button-group[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-b676e93b]{border:none;padding:0;cursor:pointer;width:var(--0547f26d);height:var(--0547f26d)}.ml-vertical-toolbar-button-group[data-v-c6504e33]{display:flex;flex-direction:column;background-color:var(--el-fill-color)}.ml-horizontal-toolbar-button-group[data-v-c6504e33]{display:flex;flex-direction:row;background-color:var(--el-fill-color)}.ml-toolbar-button[data-v-c6504e33]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px}.ml-toolbar-button-text[data-v-c6504e33]{margin-left:0;margin-top:5px}.ml-tool-palette-dialog[data-v-43098ce9]{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-dialog-icon[data-v-43098ce9]{border-bottom:1px solid var(--el-border-color);cursor:default}.ml-tool-palette-dialog-icon[data-v-43098ce9]:hover{color:var(--el-color-primary)}.ml-tool-palette-dialog-layout[data-v-43098ce9]{display:flex;height:100%}.ml-tool-palette-title-bar[data-v-43098ce9]{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-43098ce9]{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-43098ce9]{-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-43098ce9]{display:flex;flex-direction:column;height:100%;flex:1}.ml-tool-palette-tabs[data-v-43098ce9] .el-tabs{display:flex;flex-direction:column;height:100%}.ml-tool-palette-tabs[data-v-43098ce9] .el-tabs__header{margin:0;border-bottom:none;order:1;flex-shrink:0;position:relative}.ml-tool-palette-tabs[data-v-43098ce9] .el-tabs__content{flex:1;overflow:auto;padding:0;order:2;min-height:0;position:relative}.ml-tool-palette-tabs[data-v-43098ce9] .el-tab-pane{height:100%;overflow:auto}.ml-tool-palette-default-content[data-v-43098ce9]{flex:1;overflow:auto;display:flex;flex-direction:column}.ml-tool-palette-dialog-layout.left .ml-tool-palette-title-bar[data-v-43098ce9]{order:1}.ml-tool-palette-dialog-layout.left .ml-tool-palette-content[data-v-43098ce9],.ml-tool-palette-dialog-layout.right .ml-tool-palette-title-bar[data-v-43098ce9]{order:2}.ml-tool-palette-dialog-layout.right .ml-tool-palette-content[data-v-43098ce9]{order:1}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
import { ElIcon as U, ElDropdownItem as ae, ElDropdownMenu as ue, ElDropdown as ce, ElButton as P, ElTooltip as R, ElButtonGroup as re, ElTabPane as ve, ElTabs as de } 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 b, createElementBlock as V, createElementVNode as B, defineComponent as Y, mergeModels as D, useModel as H, computed as p, createBlock as $, withCtx as C, resolveDynamicComponent as ee, createVNode as S, Fragment as G, renderList as j, createTextVNode as me, toDisplayString as O, pushScopeId as te, popScopeId as ne, renderSlot as X, useCssVars as he, normalizeClass as le, normalizeStyle as N, createCommentVNode as oe, ref as f, onMounted as W, onUnmounted as q, watch as y, onBeforeUnmount as se, unref as J } 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
11
|
import "element-plus/es/components/button-group/style/css";
|
|
12
|
-
|
|
12
|
+
import "element-plus/es/components/tabs/style/css";
|
|
13
|
+
import "element-plus/es/components/tab-pane/style/css";
|
|
14
|
+
const fe = {
|
|
13
15
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14
16
|
width: "1em",
|
|
15
17
|
height: "1em",
|
|
16
18
|
viewBox: "0 0 1024 1024"
|
|
17
|
-
},
|
|
19
|
+
}, pe = /* @__PURE__ */ B("path", {
|
|
18
20
|
fill: "currentColor",
|
|
19
21
|
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"
|
|
20
|
-
}, null, -1),
|
|
21
|
-
|
|
22
|
+
}, null, -1), _e = [
|
|
23
|
+
pe
|
|
22
24
|
];
|
|
23
|
-
function
|
|
24
|
-
return
|
|
25
|
+
function we(e, a) {
|
|
26
|
+
return b(), V("svg", fe, [..._e]);
|
|
25
27
|
}
|
|
26
|
-
const
|
|
28
|
+
const K = { render: we }, ge = {
|
|
27
29
|
xmlns: "http://www.w3.org/2000/svg",
|
|
28
30
|
width: "1em",
|
|
29
31
|
height: "1em",
|
|
30
32
|
viewBox: "0 0 1024 1024"
|
|
31
|
-
},
|
|
33
|
+
}, be = /* @__PURE__ */ B("path", {
|
|
32
34
|
fill: "currentColor",
|
|
33
35
|
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"
|
|
34
|
-
}, null, -1),
|
|
35
|
-
|
|
36
|
+
}, null, -1), Le = [
|
|
37
|
+
be
|
|
36
38
|
];
|
|
37
|
-
function
|
|
38
|
-
return
|
|
39
|
+
function xe(e, a) {
|
|
40
|
+
return b(), V("svg", ge, [...Le]);
|
|
39
41
|
}
|
|
40
|
-
const
|
|
42
|
+
const Q = { render: xe }, ye = /* @__PURE__ */ Y({
|
|
41
43
|
__name: "MlCollapse",
|
|
42
|
-
props: /* @__PURE__ */
|
|
44
|
+
props: /* @__PURE__ */ D({
|
|
43
45
|
size: { default: 18 },
|
|
44
46
|
reverse: { type: Boolean, default: !1 }
|
|
45
47
|
}, {
|
|
46
48
|
modelValue: { default: !0 },
|
|
47
49
|
modelModifiers: {}
|
|
48
50
|
}),
|
|
49
|
-
emits: /* @__PURE__ */
|
|
50
|
-
setup(e, { emit:
|
|
51
|
-
const t = e, o =
|
|
51
|
+
emits: /* @__PURE__ */ D(["change"], ["update:modelValue"]),
|
|
52
|
+
setup(e, { emit: a }) {
|
|
53
|
+
const t = e, o = H(e, "modelValue"), l = a, n = p(() => t.reverse ? o.value ? K : Q : o.value ? Q : K), u = p(() => `${t.size}px`), m = () => {
|
|
52
54
|
l("change", o.value), o.value = !o.value;
|
|
53
55
|
};
|
|
54
|
-
return (
|
|
55
|
-
const
|
|
56
|
-
return
|
|
56
|
+
return (s, c) => {
|
|
57
|
+
const v = U;
|
|
58
|
+
return b(), $(v, {
|
|
57
59
|
size: u.value,
|
|
58
|
-
onClick:
|
|
60
|
+
onClick: m
|
|
59
61
|
}, {
|
|
60
|
-
default:
|
|
61
|
-
(
|
|
62
|
+
default: C(() => [
|
|
63
|
+
(b(), $(ee(n.value)))
|
|
62
64
|
]),
|
|
63
65
|
_: 1
|
|
64
66
|
}, 8, ["size"]);
|
|
65
67
|
};
|
|
66
68
|
}
|
|
67
|
-
}), Me = (e) => (te("data-v-3fc33b5d"), e = e(), ne(), e),
|
|
69
|
+
}), Me = (e) => (te("data-v-3fc33b5d"), e = e(), ne(), e), Ee = /* @__PURE__ */ Me(() => /* @__PURE__ */ B("svg", {
|
|
68
70
|
preserveAspectRatio: "xMidYMid meet",
|
|
69
71
|
viewBox: "0 0 24 24",
|
|
70
72
|
width: "1.2em",
|
|
71
73
|
height: "1.2em",
|
|
72
74
|
"data-v-63d067da": ""
|
|
73
75
|
}, [
|
|
74
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ B("path", {
|
|
75
77
|
fill: "currentColor",
|
|
76
78
|
d: "m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"
|
|
77
79
|
})
|
|
78
|
-
], -1)),
|
|
80
|
+
], -1)), ze = /* @__PURE__ */ Y({
|
|
79
81
|
__name: "MlDropdown",
|
|
80
82
|
props: {
|
|
81
83
|
icon: {},
|
|
@@ -85,22 +87,22 @@ const J = { render: Le }, xe = /* @__PURE__ */ S({
|
|
|
85
87
|
emits: {
|
|
86
88
|
click: null
|
|
87
89
|
},
|
|
88
|
-
setup(e, { emit:
|
|
89
|
-
const t = e, o =
|
|
90
|
+
setup(e, { emit: a }) {
|
|
91
|
+
const t = e, o = a, l = p(() => t.items.filter((u) => u.name !== t.current)), n = (u) => {
|
|
90
92
|
o("click", u);
|
|
91
93
|
};
|
|
92
|
-
return (u,
|
|
93
|
-
const
|
|
94
|
-
return
|
|
95
|
-
dropdown:
|
|
96
|
-
|
|
97
|
-
default:
|
|
98
|
-
(
|
|
99
|
-
key:
|
|
100
|
-
command:
|
|
94
|
+
return (u, m) => {
|
|
95
|
+
const s = U, c = ae, v = ue, _ = ce;
|
|
96
|
+
return b(), $(_, { onCommand: n }, {
|
|
97
|
+
dropdown: C(() => [
|
|
98
|
+
S(v, null, {
|
|
99
|
+
default: C(() => [
|
|
100
|
+
(b(!0), V(G, null, j(l.value, (r) => (b(), $(c, {
|
|
101
|
+
key: r.text,
|
|
102
|
+
command: r.name
|
|
101
103
|
}, {
|
|
102
|
-
default:
|
|
103
|
-
|
|
104
|
+
default: C(() => [
|
|
105
|
+
me(O(r.text), 1)
|
|
104
106
|
]),
|
|
105
107
|
_: 2
|
|
106
108
|
}, 1032, ["command"]))), 128))
|
|
@@ -108,13 +110,13 @@ const J = { render: Le }, xe = /* @__PURE__ */ S({
|
|
|
108
110
|
_: 1
|
|
109
111
|
})
|
|
110
112
|
]),
|
|
111
|
-
default:
|
|
112
|
-
|
|
113
|
+
default: C(() => [
|
|
114
|
+
S(s, {
|
|
113
115
|
size: "30",
|
|
114
116
|
class: "ml-dropdown-icon"
|
|
115
117
|
}, {
|
|
116
|
-
default:
|
|
117
|
-
|
|
118
|
+
default: C(() => [
|
|
119
|
+
Ee
|
|
118
120
|
]),
|
|
119
121
|
_: 1
|
|
120
122
|
})
|
|
@@ -123,12 +125,12 @@ const J = { render: Le }, xe = /* @__PURE__ */ S({
|
|
|
123
125
|
});
|
|
124
126
|
};
|
|
125
127
|
}
|
|
126
|
-
}), A = (e,
|
|
128
|
+
}), A = (e, a) => {
|
|
127
129
|
const t = e.__vccOpts || e;
|
|
128
|
-
for (const [o, l] of
|
|
130
|
+
for (const [o, l] of a)
|
|
129
131
|
t[o] = l;
|
|
130
132
|
return t;
|
|
131
|
-
},
|
|
133
|
+
}, F = /* @__PURE__ */ A(ze, [["__scopeId", "data-v-3fc33b5d"]]), Te = '<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>', Ce = /* @__PURE__ */ Y({
|
|
132
134
|
__name: "MlLanguage",
|
|
133
135
|
props: {
|
|
134
136
|
languages: {},
|
|
@@ -137,66 +139,66 @@ const J = { render: Le }, xe = /* @__PURE__ */ S({
|
|
|
137
139
|
emits: {
|
|
138
140
|
click: null
|
|
139
141
|
},
|
|
140
|
-
setup(e, { emit:
|
|
141
|
-
const t = e, o =
|
|
142
|
+
setup(e, { emit: a }) {
|
|
143
|
+
const t = e, o = a, l = (n) => {
|
|
142
144
|
o("click", n);
|
|
143
145
|
};
|
|
144
|
-
return (n, u) => (
|
|
145
|
-
icon:
|
|
146
|
+
return (n, u) => (b(), $(F, {
|
|
147
|
+
icon: Te,
|
|
146
148
|
items: t.languages,
|
|
147
149
|
current: t.current,
|
|
148
150
|
onClick: l
|
|
149
151
|
}, null, 8, ["items", "current"]));
|
|
150
152
|
}
|
|
151
|
-
}),
|
|
152
|
-
function
|
|
153
|
-
return
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
}), Be = {}, ke = { class: "ml-status-bar" }, $e = { class: "ml-status-bar-left" }, Ie = { class: "ml-status-bar-right" };
|
|
154
|
+
function Ve(e, a) {
|
|
155
|
+
return b(), V("div", ke, [
|
|
156
|
+
B("div", $e, [
|
|
157
|
+
X(e.$slots, "left", {}, void 0, !0)
|
|
156
158
|
]),
|
|
157
|
-
|
|
158
|
-
|
|
159
|
+
B("div", Ie, [
|
|
160
|
+
X(e.$slots, "right", {}, void 0, !0)
|
|
159
161
|
])
|
|
160
162
|
]);
|
|
161
163
|
}
|
|
162
|
-
const We = /* @__PURE__ */ A(
|
|
164
|
+
const We = /* @__PURE__ */ A(Be, [["render", Ve], ["__scopeId", "data-v-d6a59cf0"]]), De = /* @__PURE__ */ Y({
|
|
163
165
|
__name: "MlToggleButton",
|
|
164
|
-
props: /* @__PURE__ */
|
|
166
|
+
props: /* @__PURE__ */ D({
|
|
165
167
|
size: { default: 30 },
|
|
166
168
|
data: {}
|
|
167
169
|
}, {
|
|
168
170
|
modelValue: { default: !1 },
|
|
169
171
|
modelModifiers: {}
|
|
170
172
|
}),
|
|
171
|
-
emits: /* @__PURE__ */
|
|
172
|
-
setup(e, { emit:
|
|
173
|
-
|
|
173
|
+
emits: /* @__PURE__ */ D(["click"], ["update:modelValue"]),
|
|
174
|
+
setup(e, { emit: a }) {
|
|
175
|
+
he((c) => ({
|
|
174
176
|
"0547f26d": u.value
|
|
175
177
|
}));
|
|
176
|
-
const t = e, o =
|
|
178
|
+
const t = e, o = H(e, "modelValue"), l = a, n = p(() => o.value ? t.data.onIcon : t.data.offIcon), u = p(() => t.size + "px"), m = p(() => o.value ? t.data.onTooltip : t.data.offTooltip), s = () => {
|
|
177
179
|
o.value = !o.value, l("click", o.value);
|
|
178
180
|
};
|
|
179
|
-
return (
|
|
180
|
-
const _ =
|
|
181
|
-
return
|
|
182
|
-
content:
|
|
181
|
+
return (c, v) => {
|
|
182
|
+
const _ = P, r = R;
|
|
183
|
+
return b(), $(r, {
|
|
184
|
+
content: m.value,
|
|
183
185
|
"hide-after": 0
|
|
184
186
|
}, {
|
|
185
|
-
default:
|
|
186
|
-
|
|
187
|
+
default: C(() => [
|
|
188
|
+
S(_, {
|
|
187
189
|
class: "ml-toggle-button",
|
|
188
190
|
icon: n.value,
|
|
189
|
-
onClick:
|
|
191
|
+
onClick: s
|
|
190
192
|
}, null, 8, ["icon"])
|
|
191
193
|
]),
|
|
192
194
|
_: 1
|
|
193
195
|
}, 8, ["content"]);
|
|
194
196
|
};
|
|
195
197
|
}
|
|
196
|
-
}),
|
|
198
|
+
}), Se = /* @__PURE__ */ A(De, [["__scopeId", "data-v-b676e93b"]]), Ye = {
|
|
197
199
|
key: 0,
|
|
198
200
|
class: "ml-toolbar-button-text"
|
|
199
|
-
},
|
|
201
|
+
}, Ae = /* @__PURE__ */ Y({
|
|
200
202
|
__name: "MlToolBar",
|
|
201
203
|
props: {
|
|
202
204
|
items: {},
|
|
@@ -206,8 +208,8 @@ const We = /* @__PURE__ */ A(Ce, [["render", $e], ["__scopeId", "data-v-d6a59cf0
|
|
|
206
208
|
emits: {
|
|
207
209
|
click: null
|
|
208
210
|
},
|
|
209
|
-
setup(e, { emit:
|
|
210
|
-
const t = e, o =
|
|
211
|
+
setup(e, { emit: a }) {
|
|
212
|
+
const t = e, o = a, l = p(() => t.direction === "vertical" ? "ml-vertical-toolbar-button-group" : "ml-horizontal-toolbar-button-group"), n = p(() => t.size === "small" ? 20 : 30), u = p(() => {
|
|
211
213
|
switch (t.size) {
|
|
212
214
|
case "small":
|
|
213
215
|
return 30;
|
|
@@ -215,36 +217,36 @@ const We = /* @__PURE__ */ A(Ce, [["render", $e], ["__scopeId", "data-v-d6a59cf0
|
|
|
215
217
|
return 50;
|
|
216
218
|
}
|
|
217
219
|
return 70;
|
|
218
|
-
}),
|
|
219
|
-
o("click",
|
|
220
|
+
}), m = (v) => v.description ? v.description : v.text, s = p(() => t.size === "large"), c = (v) => {
|
|
221
|
+
o("click", v);
|
|
220
222
|
};
|
|
221
|
-
return (
|
|
222
|
-
const
|
|
223
|
-
return
|
|
223
|
+
return (v, _) => {
|
|
224
|
+
const r = U, h = P, d = R, M = re;
|
|
225
|
+
return b(), $(M, {
|
|
224
226
|
class: le(l.value)
|
|
225
227
|
}, {
|
|
226
|
-
default:
|
|
227
|
-
(
|
|
228
|
-
key:
|
|
229
|
-
content:
|
|
228
|
+
default: C(() => [
|
|
229
|
+
(b(!0), V(G, null, j(v.items, (E, k) => (b(), $(d, {
|
|
230
|
+
key: E.text,
|
|
231
|
+
content: m(E),
|
|
230
232
|
"hide-after": 0
|
|
231
233
|
}, {
|
|
232
|
-
default:
|
|
233
|
-
(
|
|
234
|
+
default: C(() => [
|
|
235
|
+
(b(), $(h, {
|
|
234
236
|
class: "ml-toolbar-button",
|
|
235
|
-
style:
|
|
236
|
-
key:
|
|
237
|
-
onClick: (
|
|
237
|
+
style: N({ width: u.value + "px", height: u.value + "px" }),
|
|
238
|
+
key: k,
|
|
239
|
+
onClick: (I) => c(E.command)
|
|
238
240
|
}, {
|
|
239
|
-
default:
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
default:
|
|
243
|
-
(
|
|
241
|
+
default: C(() => [
|
|
242
|
+
B("div", null, [
|
|
243
|
+
S(r, { size: n.value }, {
|
|
244
|
+
default: C(() => [
|
|
245
|
+
(b(), $(ee(E.icon)))
|
|
244
246
|
]),
|
|
245
247
|
_: 2
|
|
246
248
|
}, 1032, ["size"]),
|
|
247
|
-
|
|
249
|
+
s.value ? (b(), V("div", Ye, O(E.text), 1)) : oe("", !0)
|
|
248
250
|
])
|
|
249
251
|
]),
|
|
250
252
|
_: 2
|
|
@@ -257,391 +259,447 @@ const We = /* @__PURE__ */ A(Ce, [["render", $e], ["__scopeId", "data-v-d6a59cf0
|
|
|
257
259
|
}, 8, ["class"]);
|
|
258
260
|
};
|
|
259
261
|
}
|
|
260
|
-
}),
|
|
261
|
-
function
|
|
262
|
-
const o =
|
|
262
|
+
}), He = /* @__PURE__ */ A(Ae, [["__scopeId", "data-v-c6504e33"]]), Z = 20;
|
|
263
|
+
function Oe(e, a, t) {
|
|
264
|
+
const o = f(!1), l = (s) => {
|
|
263
265
|
if (t.value && e.value) {
|
|
264
|
-
const
|
|
265
|
-
o.value = !
|
|
266
|
+
const c = e.value.getBoundingClientRect(), v = s.clientX < c.left || s.clientX > c.right || s.clientY < c.top || s.clientY > c.bottom;
|
|
267
|
+
o.value = !v;
|
|
266
268
|
}
|
|
267
269
|
}, n = () => {
|
|
268
270
|
t.value && (o.value = !0);
|
|
269
271
|
}, u = () => {
|
|
270
|
-
|
|
271
|
-
},
|
|
272
|
-
|
|
272
|
+
a.value && a.value.addEventListener("mousemove", n), e.value && e.value.addEventListener("mousemove", n);
|
|
273
|
+
}, m = () => {
|
|
274
|
+
a.value && a.value.removeEventListener("mousemove", n), e.value && e.value.removeEventListener("mousemove", n);
|
|
273
275
|
};
|
|
274
|
-
return
|
|
276
|
+
return W(() => {
|
|
275
277
|
window.addEventListener("mousemove", l);
|
|
276
|
-
}),
|
|
278
|
+
}), q(() => {
|
|
277
279
|
window.removeEventListener("mousemove", l);
|
|
278
|
-
}),
|
|
279
|
-
|
|
280
|
-
}),
|
|
281
|
-
|
|
280
|
+
}), y(t, (s) => {
|
|
281
|
+
s && (o.value = !1);
|
|
282
|
+
}), y(e, (s) => {
|
|
283
|
+
s ? u() : m();
|
|
282
284
|
}), { autoOpened: o };
|
|
283
285
|
}
|
|
284
|
-
function
|
|
285
|
-
const o =
|
|
286
|
+
function Xe(e, a, t) {
|
|
287
|
+
const o = f(!1), l = f(null), n = f(null), u = { x: 0, y: 0 }, m = p(() => l.value == null || n.value == null ? { x: 0, y: 0 } : {
|
|
286
288
|
x: l.value.x - n.value.x,
|
|
287
289
|
y: l.value.y - n.value.y
|
|
288
|
-
}),
|
|
290
|
+
}), s = () => {
|
|
289
291
|
if (e.value) {
|
|
290
|
-
const
|
|
292
|
+
const d = e.value.getBoundingClientRect();
|
|
291
293
|
n.value = {
|
|
292
|
-
x:
|
|
293
|
-
y:
|
|
294
|
+
x: d.left,
|
|
295
|
+
y: d.top
|
|
294
296
|
}, l.value = {
|
|
295
|
-
x:
|
|
296
|
-
y:
|
|
297
|
+
x: d.left,
|
|
298
|
+
y: d.top
|
|
297
299
|
};
|
|
298
300
|
}
|
|
299
|
-
},
|
|
301
|
+
}, c = () => {
|
|
300
302
|
e.value && e.value.addEventListener("mousedown", _);
|
|
301
|
-
},
|
|
303
|
+
}, v = () => {
|
|
302
304
|
e.value && e.value.removeEventListener("mousedown", _);
|
|
303
|
-
}, _ = (
|
|
305
|
+
}, _ = (d) => {
|
|
304
306
|
if (e.value != null) {
|
|
305
|
-
if (
|
|
306
|
-
const
|
|
307
|
-
if (
|
|
307
|
+
if (a && a.value) {
|
|
308
|
+
const M = a.value.getBoundingClientRect();
|
|
309
|
+
if (d.clientX < M.left || d.clientX > M.right || d.clientY < M.top || d.clientY > M.bottom) return;
|
|
308
310
|
}
|
|
309
|
-
o.value = !0, u.x =
|
|
311
|
+
o.value = !0, u.x = d.clientX, u.y = d.clientY, s(), document.addEventListener("mousemove", r), document.addEventListener("mouseup", h);
|
|
310
312
|
}
|
|
311
|
-
},
|
|
313
|
+
}, r = (d) => {
|
|
312
314
|
if (o.value && n.value && l.value) {
|
|
313
|
-
const
|
|
315
|
+
const M = window.innerWidth, E = window.innerHeight, k = e.value, I = k.getBoundingClientRect(), T = I.width, i = I.height, L = n.value.x + (d.clientX - u.x), w = n.value.y + (d.clientY - u.y);
|
|
314
316
|
l.value.x = Math.max(
|
|
315
317
|
t ? t.value.offset.value.left : 0,
|
|
316
|
-
|
|
318
|
+
L
|
|
317
319
|
);
|
|
318
|
-
const g =
|
|
320
|
+
const g = M - T;
|
|
319
321
|
l.value.x = Math.min(
|
|
320
322
|
t ? g - t.value.offset.value.right : g,
|
|
321
323
|
l.value.x
|
|
322
324
|
), l.value.y = Math.max(
|
|
323
325
|
t ? t.value.offset.value.top : 0,
|
|
324
|
-
Math.min(
|
|
326
|
+
Math.min(w, E - i)
|
|
325
327
|
);
|
|
326
|
-
const
|
|
328
|
+
const z = E - i;
|
|
327
329
|
l.value.y = Math.min(
|
|
328
|
-
t ?
|
|
330
|
+
t ? z - t.value.offset.value.bottom : z,
|
|
329
331
|
l.value.y
|
|
330
|
-
),
|
|
332
|
+
), k.style.left = l.value.x + "px", k.style.top = l.value.y + "px";
|
|
331
333
|
}
|
|
332
334
|
}, h = () => {
|
|
333
|
-
o.value = !1, document.removeEventListener("mousemove",
|
|
335
|
+
o.value = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", h);
|
|
334
336
|
};
|
|
335
|
-
return
|
|
336
|
-
e.value && (
|
|
337
|
-
}),
|
|
337
|
+
return W(() => {
|
|
338
|
+
e.value && (s(), c());
|
|
339
|
+
}), q(() => {
|
|
338
340
|
e.value && e.value.removeEventListener("mousedown", _);
|
|
339
|
-
}),
|
|
340
|
-
|
|
341
|
+
}), y(e, (d) => {
|
|
342
|
+
d ? (s(), c()) : v();
|
|
341
343
|
}), {
|
|
342
344
|
isDragging: o,
|
|
343
|
-
movement:
|
|
345
|
+
movement: m,
|
|
344
346
|
position: l
|
|
345
347
|
};
|
|
346
348
|
}
|
|
347
|
-
function
|
|
348
|
-
const o =
|
|
349
|
+
function Ue(e, a, t) {
|
|
350
|
+
const o = f(!1), l = f("left"), { isDragging: n, movement: u, position: m } = Xe(
|
|
349
351
|
e,
|
|
350
|
-
|
|
352
|
+
a,
|
|
351
353
|
t
|
|
352
354
|
);
|
|
353
|
-
return
|
|
354
|
-
if (
|
|
355
|
-
const
|
|
356
|
-
|
|
355
|
+
return y(u, (s) => {
|
|
356
|
+
if (s && e.value) {
|
|
357
|
+
const v = e.value.getBoundingClientRect();
|
|
358
|
+
v.left <= t.value.offset.value.left ? (l.value = "left", o.value = !0) : window.innerWidth - v.left - v.width <= t.value.offset.value.right ? (l.value = "right", o.value = !0) : o.value = !1;
|
|
357
359
|
}
|
|
358
360
|
}), {
|
|
359
361
|
docked: o,
|
|
360
362
|
orientation: l,
|
|
361
363
|
isDragging: n,
|
|
362
364
|
movement: u,
|
|
363
|
-
position:
|
|
365
|
+
position: m
|
|
364
366
|
};
|
|
365
367
|
}
|
|
366
|
-
function
|
|
367
|
-
const l =
|
|
368
|
-
return
|
|
369
|
-
l.value =
|
|
370
|
-
}),
|
|
371
|
-
n.value =
|
|
372
|
-
}),
|
|
373
|
-
u.value =
|
|
374
|
-
}),
|
|
375
|
-
|
|
368
|
+
function Ne(e, a, t, o) {
|
|
369
|
+
const l = f(null), n = f(null), u = f(null), m = f(null);
|
|
370
|
+
return y(e, (s, c) => {
|
|
371
|
+
l.value = c;
|
|
372
|
+
}), y(a, (s, c) => {
|
|
373
|
+
n.value = c;
|
|
374
|
+
}), y(t, (s, c) => {
|
|
375
|
+
u.value = c;
|
|
376
|
+
}), y(o, (s, c) => {
|
|
377
|
+
m.value = c;
|
|
376
378
|
}), {
|
|
377
379
|
lastLeft: l,
|
|
378
380
|
lastTop: n,
|
|
379
381
|
lastWidth: u,
|
|
380
|
-
lastHeight:
|
|
382
|
+
lastHeight: m
|
|
381
383
|
};
|
|
382
384
|
}
|
|
383
|
-
function
|
|
384
|
-
const l =
|
|
385
|
-
return
|
|
386
|
-
(l.value == null || n.value == null ||
|
|
387
|
-
}),
|
|
388
|
-
o.value && t.value && (n.value =
|
|
385
|
+
function Fe(e, a, t, o) {
|
|
386
|
+
const l = f(e.value.width), n = f(e.value.left), u = p(() => e.value.width), m = p(() => e.value.left), s = p(() => t.value ? t.value.x : null);
|
|
387
|
+
return y([u, m], ([c, v]) => {
|
|
388
|
+
(l.value == null || n.value == null || a.value) && (l.value = c, n.value = v);
|
|
389
|
+
}), y(s, (c) => {
|
|
390
|
+
o.value && t.value && (n.value = c);
|
|
389
391
|
}), { left: n, width: l };
|
|
390
392
|
}
|
|
391
|
-
function
|
|
392
|
-
const t =
|
|
393
|
+
function Ge(e, a = f({ left: 0, right: 0, top: 0, bottom: 0 })) {
|
|
394
|
+
const t = f({});
|
|
393
395
|
let o = !1;
|
|
394
396
|
const l = () => {
|
|
395
397
|
if (!o && e.value) {
|
|
396
398
|
const n = e.value.getBoundingClientRect();
|
|
397
|
-
t.value.left = Math.max(n.left,
|
|
399
|
+
t.value.left = Math.max(n.left, a.value.left), t.value.top = Math.max(n.top, a.value.top), t.value.width = n.width, t.value.height = n.height, o = !0;
|
|
398
400
|
}
|
|
399
401
|
};
|
|
400
|
-
return
|
|
402
|
+
return W(() => {
|
|
401
403
|
e.value && l();
|
|
402
|
-
}),
|
|
404
|
+
}), y(e, (n) => {
|
|
403
405
|
n && l();
|
|
404
406
|
}), {
|
|
405
407
|
isIntialized: o,
|
|
406
408
|
initialRect: t
|
|
407
409
|
};
|
|
408
410
|
}
|
|
409
|
-
function
|
|
410
|
-
const { initialRect: n } =
|
|
411
|
-
let
|
|
412
|
-
const
|
|
413
|
-
if (!(!e.value ||
|
|
411
|
+
function je(e, a = f(!1), t = f(!1), o = f({ left: 0, right: 0, top: 0, bottom: 0 }), l = { width: 20, height: 40 }) {
|
|
412
|
+
const { initialRect: n } = Ge(e, o), u = f(!1);
|
|
413
|
+
let m = 0, s = 0, c = 0, v = 0, _ = 0;
|
|
414
|
+
const r = 5, h = f(null), d = (T) => {
|
|
415
|
+
if (!(!e.value || a.value))
|
|
414
416
|
if (u.value) {
|
|
415
|
-
const
|
|
417
|
+
const i = T.clientX - v, L = T.clientY - _;
|
|
416
418
|
if (h.value === "left" || h.value === "left-bottom-corner") {
|
|
417
|
-
const
|
|
418
|
-
|
|
419
|
+
const w = s - i;
|
|
420
|
+
w > l.width && (n.value.width = w, n.value.left = m + i, e.value.style.left = n.value.left + "px", e.value.style.width = n.value.width + "px");
|
|
419
421
|
}
|
|
420
422
|
if (h.value === "right" || h.value === "right-bottom-corner") {
|
|
421
|
-
const
|
|
422
|
-
|
|
423
|
+
const w = s + i;
|
|
424
|
+
w > l.width && (n.value.width = w, e.value.style.width = n.value.width + "px");
|
|
423
425
|
}
|
|
424
426
|
if (h.value === "bottom" || h.value === "left-bottom-corner" || h.value === "right-bottom-corner") {
|
|
425
|
-
const
|
|
426
|
-
|
|
427
|
+
const w = c + L;
|
|
428
|
+
w > l.height && (n.value.height = w, e.value.style.height = n.value.height + "px");
|
|
427
429
|
}
|
|
428
430
|
} else {
|
|
429
|
-
const
|
|
430
|
-
g &&
|
|
431
|
+
const i = e.value.getBoundingClientRect(), L = T.clientX - i.left, w = T.clientY - i.top, g = L <= r, z = L >= i.width - r, x = w >= i.height - r;
|
|
432
|
+
g && x && t.value ? (e.value.style.cursor = "nesw-resize", h.value = "left-bottom-corner") : z && x && !t.value ? (e.value.style.cursor = "nwse-resize", h.value = "right-bottom-corner") : g && t.value ? (e.value.style.cursor = "ew-resize", h.value = "left") : z && !t.value ? (e.value.style.cursor = "ew-resize", h.value = "right") : x ? (e.value.style.cursor = "ns-resize", h.value = "bottom") : (e.value.style.cursor = "", h.value = null);
|
|
431
433
|
}
|
|
432
|
-
},
|
|
434
|
+
}, M = (T) => {
|
|
433
435
|
if (!e.value || !h.value) return;
|
|
434
|
-
const
|
|
435
|
-
|
|
436
|
-
},
|
|
437
|
-
u.value = !1, h.value = null, e.value && (e.value.style.cursor = ""), document.removeEventListener("mousemove",
|
|
438
|
-
}, C = () => {
|
|
439
|
-
e.value && (e.value.removeEventListener("mousedown", f), e.value.removeEventListener("mousemove", v)), document.removeEventListener("mouseup", x);
|
|
436
|
+
const i = e.value.getBoundingClientRect();
|
|
437
|
+
v = T.clientX, _ = T.clientY, s = i.width, c = i.height, m = i.left, n.value.width = s, n.value.height = c, n.value.left = i.left, n.value.top = i.top, u.value = !0, document.addEventListener("mousemove", d), document.addEventListener("mouseup", E);
|
|
438
|
+
}, E = () => {
|
|
439
|
+
u.value = !1, h.value = null, e.value && (e.value.style.cursor = ""), document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", E);
|
|
440
440
|
}, k = () => {
|
|
441
|
-
e.value && (e.value.
|
|
441
|
+
e.value && (e.value.removeEventListener("mousedown", M), e.value.removeEventListener("mousemove", d)), document.removeEventListener("mouseup", E);
|
|
442
|
+
}, I = () => {
|
|
443
|
+
e.value && (e.value.addEventListener("mousedown", M), e.value.addEventListener("mousemove", d));
|
|
442
444
|
};
|
|
443
|
-
return
|
|
444
|
-
e.value &&
|
|
445
|
+
return W(() => {
|
|
446
|
+
e.value && I();
|
|
445
447
|
}), se(() => {
|
|
446
|
-
|
|
447
|
-
}),
|
|
448
|
-
|
|
448
|
+
k();
|
|
449
|
+
}), y(e, (T) => {
|
|
450
|
+
T ? I() : k();
|
|
449
451
|
}), { rect: n, isResizing: u };
|
|
450
452
|
}
|
|
451
|
-
function
|
|
453
|
+
function qe(e, a, t, o) {
|
|
452
454
|
const l = () => {
|
|
453
455
|
if (e.value) {
|
|
454
|
-
const
|
|
455
|
-
|
|
456
|
+
const s = e.value;
|
|
457
|
+
a.value ? s.style.transition = "width 0.3s ease-out, left 0.3s ease-out" : s.style.transition = "width 0.3s ease";
|
|
456
458
|
}
|
|
457
459
|
}, n = () => {
|
|
458
460
|
e.value && (e.value.style.transition = "");
|
|
459
461
|
}, u = () => {
|
|
460
462
|
e.value && e.value.removeEventListener("transitionend", n);
|
|
461
|
-
},
|
|
463
|
+
}, m = () => {
|
|
462
464
|
e.value && e.value.addEventListener("transitionend", n);
|
|
463
465
|
};
|
|
464
|
-
|
|
466
|
+
W(() => {
|
|
465
467
|
e.value && e.value.addEventListener("transitionend", n);
|
|
466
468
|
}), se(() => {
|
|
467
469
|
e.value && e.value.removeEventListener("transitionend", n);
|
|
468
|
-
}),
|
|
469
|
-
|
|
470
|
-
}),
|
|
470
|
+
}), y(e, (s) => {
|
|
471
|
+
s ? m() : u();
|
|
472
|
+
}), y(t, () => {
|
|
471
473
|
l();
|
|
472
|
-
}),
|
|
474
|
+
}), y(o, () => {
|
|
473
475
|
l();
|
|
474
476
|
});
|
|
475
477
|
}
|
|
476
|
-
function
|
|
477
|
-
const l =
|
|
478
|
+
function Je(e, a, t, o) {
|
|
479
|
+
const l = f(window.innerWidth), n = f(window.innerHeight), { docked: u, orientation: m, movement: s, position: c, isDragging: v } = Ue(
|
|
478
480
|
e,
|
|
479
|
-
|
|
481
|
+
a,
|
|
480
482
|
o
|
|
481
|
-
), _ = p(() =>
|
|
483
|
+
), _ = p(() => m.value === "right"), { rect: r, isResizing: h } = je(
|
|
482
484
|
e,
|
|
483
485
|
t,
|
|
484
486
|
_,
|
|
485
487
|
o.value.offset
|
|
486
|
-
), { width:
|
|
487
|
-
|
|
488
|
+
), { width: d, left: M } = Fe(
|
|
489
|
+
r,
|
|
488
490
|
h,
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
), { lastTop:
|
|
492
|
-
p(() =>
|
|
493
|
-
p(() =>
|
|
494
|
-
p(() =>
|
|
495
|
-
p(() =>
|
|
496
|
-
), { autoOpened:
|
|
497
|
-
|
|
498
|
-
const
|
|
491
|
+
c,
|
|
492
|
+
v
|
|
493
|
+
), { lastTop: E, lastHeight: k } = Ne(
|
|
494
|
+
p(() => r.value.left),
|
|
495
|
+
p(() => r.value.top),
|
|
496
|
+
p(() => r.value.width),
|
|
497
|
+
p(() => r.value.height)
|
|
498
|
+
), { autoOpened: I } = Oe(e, a, t);
|
|
499
|
+
qe(e, _, t, I);
|
|
500
|
+
const T = (g) => {
|
|
499
501
|
if (e.value) {
|
|
500
|
-
const
|
|
502
|
+
const z = e.value.getBoundingClientRect(), x = z.left + g;
|
|
501
503
|
if (_.value) {
|
|
502
|
-
|
|
503
|
-
const ie = window.innerWidth -
|
|
504
|
-
|
|
504
|
+
r.value.left = x;
|
|
505
|
+
const ie = window.innerWidth - z.width - z.left;
|
|
506
|
+
z.left <= 0 && ie >= 0 && g < 0 && (r.value.left = Math.max(0, x)), window.innerWidth - z.width <= 0 && (r.value.left = window.innerWidth - z.width);
|
|
505
507
|
} else
|
|
506
|
-
|
|
508
|
+
z.left + z.width >= window.innerWidth && g < 0 && (r.value.left = Math.max(0, x));
|
|
507
509
|
}
|
|
508
|
-
},
|
|
510
|
+
}, i = () => {
|
|
509
511
|
const g = window.innerWidth - l.value;
|
|
510
|
-
l.value = window.innerWidth, n.value = window.innerHeight,
|
|
512
|
+
l.value = window.innerWidth, n.value = window.innerHeight, T(g);
|
|
511
513
|
};
|
|
512
|
-
|
|
513
|
-
window.addEventListener("resize",
|
|
514
|
-
}),
|
|
515
|
-
window.removeEventListener("resize",
|
|
514
|
+
W(() => {
|
|
515
|
+
window.addEventListener("resize", i);
|
|
516
|
+
}), q(() => {
|
|
517
|
+
window.removeEventListener("resize", i);
|
|
516
518
|
});
|
|
517
|
-
const
|
|
518
|
-
g ? (
|
|
519
|
-
},
|
|
520
|
-
u.value ? (
|
|
519
|
+
const L = (g) => {
|
|
520
|
+
g ? (r.value.width = Z, _.value && M.value && d.value && (r.value.left = M.value + d.value - Z)) : (r.value.width = d.value, _.value && M.value && d.value && (r.value.left = M.value));
|
|
521
|
+
}, w = () => {
|
|
522
|
+
u.value ? (r.value.top = o.value.offset.value.top, r.value.height = window.innerHeight - o.value.offset.value.top - o.value.offset.value.bottom) : (r.value.top = E.value, r.value.height = k.value);
|
|
521
523
|
};
|
|
522
|
-
return
|
|
523
|
-
|
|
524
|
-
}),
|
|
525
|
-
|
|
526
|
-
}),
|
|
527
|
-
t.value && !
|
|
528
|
-
}),
|
|
524
|
+
return y(u, () => {
|
|
525
|
+
w();
|
|
526
|
+
}), y(t, (g) => {
|
|
527
|
+
L(g);
|
|
528
|
+
}), y(I, (g) => {
|
|
529
|
+
t.value && !v.value && L(!g);
|
|
530
|
+
}), y(s, (g) => {
|
|
529
531
|
if (g && e.value) {
|
|
530
|
-
const
|
|
531
|
-
|
|
532
|
+
const x = e.value.getBoundingClientRect();
|
|
533
|
+
r.value.left = x.left, r.value.top = x.top;
|
|
532
534
|
}
|
|
533
|
-
}), { rect:
|
|
535
|
+
}), { rect: r, orientation: m, reversed: _ };
|
|
534
536
|
}
|
|
535
|
-
const
|
|
537
|
+
const Ke = (e) => (te("data-v-43098ce9"), e = e(), ne(), e), Qe = /* @__PURE__ */ Ke(() => /* @__PURE__ */ B("svg", {
|
|
536
538
|
xmlns: "http://www.w3.org/2000/svg",
|
|
537
539
|
width: "1em",
|
|
538
540
|
height: "1em",
|
|
539
541
|
viewBox: "0 0 1024 1024"
|
|
540
542
|
}, [
|
|
541
|
-
/* @__PURE__ */
|
|
543
|
+
/* @__PURE__ */ B("path", {
|
|
542
544
|
fill: "currentColor",
|
|
543
545
|
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"
|
|
544
546
|
})
|
|
545
|
-
], -1)),
|
|
547
|
+
], -1)), Ze = { class: "ml-tool-palette-title" }, Pe = { class: "ml-tool-palette-content" }, Re = {
|
|
548
|
+
key: 1,
|
|
549
|
+
class: "ml-tool-palette-default-content"
|
|
550
|
+
}, et = /* @__PURE__ */ Y({
|
|
546
551
|
__name: "MlToolPalette",
|
|
547
|
-
props: /* @__PURE__ */
|
|
552
|
+
props: /* @__PURE__ */ D({
|
|
548
553
|
title: { default: "" },
|
|
554
|
+
tabs: { default: void 0 },
|
|
549
555
|
leftOffset: { default: 0 },
|
|
550
556
|
rightOffset: { default: 0 },
|
|
551
557
|
topOffset: { default: 0 },
|
|
552
558
|
bottomOffset: { default: 0 }
|
|
553
559
|
}, {
|
|
554
560
|
modelValue: { default: !0 },
|
|
555
|
-
modelModifiers: {}
|
|
561
|
+
modelModifiers: {},
|
|
562
|
+
activeTab: { default: "" },
|
|
563
|
+
activeTabModifiers: {}
|
|
556
564
|
}),
|
|
557
|
-
emits: /* @__PURE__ */
|
|
558
|
-
setup(e, { emit:
|
|
559
|
-
const t = e, o =
|
|
560
|
-
|
|
565
|
+
emits: /* @__PURE__ */ D(["close", "tab-change", "tab-close"], ["update:modelValue", "update:activeTab"]),
|
|
566
|
+
setup(e, { emit: a }) {
|
|
567
|
+
const t = e, o = H(e, "modelValue"), l = H(e, "activeTab"), n = a, u = p(() => t.tabs && t.tabs.length > 0);
|
|
568
|
+
W(() => {
|
|
569
|
+
u.value && !l.value && t.tabs && t.tabs.length > 0 && (l.value = t.tabs[0].name);
|
|
570
|
+
}), y(() => t.tabs, (i) => {
|
|
571
|
+
i && i.length > 0 && !l.value && (l.value = i[0].name);
|
|
572
|
+
}, { immediate: !0 });
|
|
573
|
+
const m = f(!1), s = f(null), c = f(null), v = p(() => ({
|
|
574
|
+
offset: f({
|
|
561
575
|
left: t.leftOffset,
|
|
562
576
|
right: t.rightOffset,
|
|
563
577
|
top: t.topOffset,
|
|
564
578
|
bottom: t.bottomOffset
|
|
565
579
|
})
|
|
566
580
|
})), {
|
|
567
|
-
rect:
|
|
581
|
+
rect: _,
|
|
568
582
|
orientation: r,
|
|
569
|
-
reversed:
|
|
570
|
-
} =
|
|
571
|
-
left: `${
|
|
572
|
-
top: `${
|
|
573
|
-
width: `${
|
|
574
|
-
height: `${
|
|
575
|
-
})),
|
|
583
|
+
reversed: h
|
|
584
|
+
} = Je(c, s, m, v), d = p(() => ({
|
|
585
|
+
left: `${_.value.left}px`,
|
|
586
|
+
top: `${_.value.top}px`,
|
|
587
|
+
width: `${_.value.width}px`,
|
|
588
|
+
height: `${_.value.height}px`
|
|
589
|
+
})), M = p(() => h.value ? {
|
|
576
590
|
borderLeft: "1px solid var(--el-border-color)",
|
|
577
591
|
borderRight: null
|
|
578
592
|
} : {
|
|
579
593
|
borderLeft: null,
|
|
580
594
|
borderRight: "1px solid var(--el-border-color)"
|
|
581
|
-
}),
|
|
595
|
+
}), E = p(() => {
|
|
596
|
+
if (u.value && l.value && t.tabs) {
|
|
597
|
+
const i = t.tabs.find((L) => L.name === l.value);
|
|
598
|
+
if (i && i.title)
|
|
599
|
+
return i.title;
|
|
600
|
+
}
|
|
601
|
+
return t.title;
|
|
602
|
+
}), k = () => {
|
|
582
603
|
o.value = !1;
|
|
583
|
-
const
|
|
584
|
-
|
|
585
|
-
x:
|
|
586
|
-
y:
|
|
604
|
+
const i = c.value;
|
|
605
|
+
n("close", {
|
|
606
|
+
x: i ? i.clientLeft : 0,
|
|
607
|
+
y: i ? i.clientTop : 0
|
|
587
608
|
});
|
|
609
|
+
}, I = (i) => {
|
|
610
|
+
n("tab-change", i);
|
|
611
|
+
}, T = (i) => {
|
|
612
|
+
if (n("tab-close", i), l.value === i && t.tabs) {
|
|
613
|
+
const L = t.tabs.findIndex((w) => w.name === i);
|
|
614
|
+
if (L >= 0) {
|
|
615
|
+
const w = t.tabs[L + 1] || t.tabs[L - 1];
|
|
616
|
+
w && (l.value = w.name);
|
|
617
|
+
}
|
|
618
|
+
}
|
|
588
619
|
};
|
|
589
|
-
return (
|
|
590
|
-
const
|
|
591
|
-
return o.value ? (
|
|
620
|
+
return (i, L) => {
|
|
621
|
+
const w = U, g = ve, z = de;
|
|
622
|
+
return o.value ? (b(), V("div", {
|
|
592
623
|
key: 0,
|
|
593
624
|
ref_key: "toolPaletteElement",
|
|
594
|
-
ref:
|
|
595
|
-
style:
|
|
625
|
+
ref: c,
|
|
626
|
+
style: N([d.value]),
|
|
596
627
|
class: "ml-tool-palette-dialog"
|
|
597
628
|
}, [
|
|
598
|
-
|
|
599
|
-
class: le(["ml-tool-palette-dialog-layout",
|
|
629
|
+
B("div", {
|
|
630
|
+
class: le(["ml-tool-palette-dialog-layout", J(r)])
|
|
600
631
|
}, [
|
|
601
|
-
|
|
632
|
+
B("div", {
|
|
602
633
|
ref_key: "titleBarElement",
|
|
603
|
-
ref:
|
|
634
|
+
ref: s,
|
|
604
635
|
class: "ml-tool-palette-title-bar",
|
|
605
|
-
style:
|
|
636
|
+
style: N(M.value)
|
|
606
637
|
}, [
|
|
607
|
-
|
|
638
|
+
S(w, {
|
|
608
639
|
size: 18,
|
|
609
640
|
class: "ml-tool-palette-dialog-icon",
|
|
610
|
-
onClick:
|
|
641
|
+
onClick: k
|
|
611
642
|
}, {
|
|
612
|
-
default:
|
|
613
|
-
|
|
643
|
+
default: C(() => [
|
|
644
|
+
Qe
|
|
614
645
|
]),
|
|
615
646
|
_: 1
|
|
616
647
|
}),
|
|
617
|
-
|
|
648
|
+
S(ye, {
|
|
618
649
|
class: "ml-tool-palette-dialog-icon",
|
|
619
|
-
modelValue:
|
|
620
|
-
"onUpdate:modelValue":
|
|
621
|
-
reverse:
|
|
650
|
+
modelValue: m.value,
|
|
651
|
+
"onUpdate:modelValue": L[0] || (L[0] = (x) => m.value = x),
|
|
652
|
+
reverse: J(h)
|
|
622
653
|
}, null, 8, ["modelValue", "reverse"]),
|
|
623
|
-
|
|
654
|
+
B("span", Ze, O(E.value), 1)
|
|
624
655
|
], 4),
|
|
625
|
-
|
|
626
|
-
|
|
656
|
+
B("div", Pe, [
|
|
657
|
+
u.value ? (b(), $(z, {
|
|
658
|
+
key: 0,
|
|
659
|
+
modelValue: l.value,
|
|
660
|
+
"onUpdate:modelValue": L[1] || (L[1] = (x) => l.value = x),
|
|
661
|
+
type: "border-card",
|
|
662
|
+
class: "ml-tool-palette-tabs",
|
|
663
|
+
onTabRemove: T,
|
|
664
|
+
onTabChange: I
|
|
665
|
+
}, {
|
|
666
|
+
default: C(() => [
|
|
667
|
+
(b(!0), V(G, null, j(t.tabs, (x) => (b(), $(g, {
|
|
668
|
+
key: x.name,
|
|
669
|
+
name: x.name,
|
|
670
|
+
label: x.label
|
|
671
|
+
}, {
|
|
672
|
+
label: C(() => [
|
|
673
|
+
B("span", null, O(x.label), 1)
|
|
674
|
+
]),
|
|
675
|
+
default: C(() => [
|
|
676
|
+
X(i.$slots, `tab-${x.name}`, {}, void 0, !0)
|
|
677
|
+
]),
|
|
678
|
+
_: 2
|
|
679
|
+
}, 1032, ["name", "label"]))), 128))
|
|
680
|
+
]),
|
|
681
|
+
_: 3
|
|
682
|
+
}, 8, ["modelValue"])) : (b(), V("div", Re, [
|
|
683
|
+
X(i.$slots, "default", {}, void 0, !0)
|
|
684
|
+
]))
|
|
627
685
|
])
|
|
628
686
|
], 2)
|
|
629
687
|
], 4)) : oe("", !0);
|
|
630
688
|
};
|
|
631
689
|
}
|
|
632
|
-
}),
|
|
690
|
+
}), tt = /* @__PURE__ */ A(et, [["__scopeId", "data-v-43098ce9"]]), ht = {
|
|
633
691
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
634
692
|
install(e) {
|
|
635
|
-
e.component("MlCollapse",
|
|
693
|
+
e.component("MlCollapse", F), e.component("MlDropdown", F), e.component("MlLanguage", Ce), e.component("MlStatusBar", We), e.component("MlToggleButton", Se), e.component("MlToolBar", He), e.component("MlToolPalette", tt);
|
|
636
694
|
}
|
|
637
695
|
};
|
|
638
696
|
export {
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
697
|
+
ye as MlCollapse,
|
|
698
|
+
F as MlDropdown,
|
|
699
|
+
Ce as MlLanguage,
|
|
642
700
|
We as MlStatusBar,
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
701
|
+
Se as MlToggleButton,
|
|
702
|
+
He as MlToolBar,
|
|
703
|
+
tt as MlToolPalette,
|
|
704
|
+
ht as default
|
|
647
705
|
};
|