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