@mlightcad/ui-components 0.0.8 → 0.0.10
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 +21 -3
- package/dist/ui-components.es.js +416 -318
- package/dist/ui-components.umd.js +2 -2
- package/lib/index.d.ts +2 -1
- package/lib/index.js +3 -1
- package/package.json +1 -1
- package/src/components/MlCollapse.vue +11 -5
- package/src/components/MlStatusBar.vue +43 -0
- package/src/components/MlToolPalette.vue +41 -30
- package/src/{composable → composables}/types.ts +10 -0
- package/src/composables/useAutoOpen.ts +77 -0
- package/src/composables/useBoundingRect.ts +161 -0
- package/src/composables/useDrag.ts +176 -0
- package/src/{composable → composables}/useDragEx.ts +16 -6
- package/src/{composable → composables}/useInitialRect.ts +13 -13
- package/src/composables/useLastPosAndSize.ts +43 -0
- package/src/composables/useLeftPosAndWidth.ts +47 -0
- package/src/{composable → composables}/useResize.ts +36 -28
- package/src/{composable → composables}/useTransition.ts +31 -24
- package/src/index.ts +10 -1
- package/lib/MlDropdown.vue.d.ts +0 -59
- package/lib/MlDropdown.vue.js +0 -106
- package/lib/MlLanguage.vue.d.ts +0 -29
- package/lib/MlLanguage.vue.js +0 -67
- package/lib/MlToolPalette.vue.d.ts +0 -2
- package/lib/MlToolPalette.vue.js +0 -149
- package/lib/MlToolbar.vue.d.ts +0 -74
- package/lib/MlToolbar.vue.js +0 -129
- package/src/composable/useBoundingRect.ts +0 -87
- package/src/composable/useDrag.ts +0 -157
- package/src/composable/useRect.ts +0 -23
- /package/src/{composable → composables}/useWindowSize.ts +0 -0
- /package/src/{svg → svgs}/arrow-left.svg +0 -0
- /package/src/{svg → svgs}/arrow-right.svg +0 -0
- /package/src/{svg → svgs}/svg.d.ts +0 -0
package/dist/ui-components.es.js
CHANGED
|
@@ -1,83 +1,81 @@
|
|
|
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-vertical-toolbar-button-group[data-v-27b5412a]{display:flex;flex-direction:column}.ml-horizontal-toolbar-button-group[data-v-27b5412a]{display:flex;flex-direction:row}.ml-toolbar-button[data-v-27b5412a]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px}.ml-toolbar-button-text[data-v-27b5412a]{margin-left:0;margin-top:5px}.ml-tool-palette-dialog[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-27b5412a]{display:flex;flex-direction:column}.ml-horizontal-toolbar-button-group[data-v-27b5412a]{display:flex;flex-direction:row}.ml-toolbar-button[data-v-27b5412a]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px}.ml-toolbar-button-text[data-v-27b5412a]{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 Y, ElDropdownItem as oe, ElDropdownMenu as ie, ElDropdown as se, ElButton as ue, ElTooltip as ae, ElButtonGroup as ce } 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 y, createElementBlock as I, createElementVNode as z, defineComponent as S, mergeModels as V, useModel as J, computed as L, createBlock as W, withCtx as T, resolveDynamicComponent as re, createVNode as H, Fragment as K, renderList as Q, createTextVNode as ve, toDisplayString as N, pushScopeId as Z, popScopeId as P, renderSlot as O, normalizeClass as R, normalizeStyle as ee, createCommentVNode as te, ref as m, onMounted as D, onUnmounted as U, watch as _, onBeforeUnmount as ne, 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";
|
|
9
9
|
import "element-plus/es/components/button-group/style/css";
|
|
10
10
|
import "element-plus/es/components/tooltip/style/css";
|
|
11
11
|
import "element-plus/es/components/button/style/css";
|
|
12
|
-
const
|
|
12
|
+
const de = {
|
|
13
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14
14
|
width: "1em",
|
|
15
15
|
height: "1em",
|
|
16
16
|
viewBox: "0 0 1024 1024"
|
|
17
|
-
},
|
|
17
|
+
}, me = /* @__PURE__ */ z("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
|
-
}, null, -1),
|
|
21
|
-
|
|
20
|
+
}, null, -1), he = [
|
|
21
|
+
me
|
|
22
22
|
];
|
|
23
|
-
function
|
|
24
|
-
return
|
|
23
|
+
function fe(e, i) {
|
|
24
|
+
return y(), I("svg", de, [...he]);
|
|
25
25
|
}
|
|
26
|
-
const
|
|
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
|
-
},
|
|
31
|
+
}, we = /* @__PURE__ */ z("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
|
-
}, null, -1),
|
|
35
|
-
|
|
34
|
+
}, null, -1), _e = [
|
|
35
|
+
we
|
|
36
36
|
];
|
|
37
|
-
function
|
|
38
|
-
return
|
|
37
|
+
function ge(e, i) {
|
|
38
|
+
return y(), I("svg", pe, [..._e]);
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const j = { render: ge }, Le = /* @__PURE__ */ S({
|
|
41
41
|
__name: "MlCollapse",
|
|
42
|
-
props: /* @__PURE__ */
|
|
42
|
+
props: /* @__PURE__ */ V({
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const n = e, t = N(e, "modelValue"), o = l, c = L(() => n.reverse ? t.value ? X : U : t.value ? U : X), s = L(() => `${n.size}px`), v = () => {
|
|
54
|
-
o("change", t.value), t.value = !t.value;
|
|
49
|
+
emits: /* @__PURE__ */ V(["change"], ["update:modelValue"]),
|
|
50
|
+
setup(e, { emit: i }) {
|
|
51
|
+
const t = e, o = J(e, "modelValue"), l = i, n = L(() => t.reverse ? o.value ? G : j : o.value ? j : G), u = L(() => `${t.size}px`), d = () => {
|
|
52
|
+
l("change", o.value), o.value = !o.value;
|
|
55
53
|
};
|
|
56
|
-
return (
|
|
57
|
-
const
|
|
58
|
-
return
|
|
59
|
-
size:
|
|
60
|
-
onClick:
|
|
54
|
+
return (s, a) => {
|
|
55
|
+
const v = Y;
|
|
56
|
+
return y(), W(v, {
|
|
57
|
+
size: u.value,
|
|
58
|
+
onClick: d
|
|
61
59
|
}, {
|
|
62
|
-
default:
|
|
63
|
-
(
|
|
60
|
+
default: T(() => [
|
|
61
|
+
(y(), W(re(n.value)))
|
|
64
62
|
]),
|
|
65
63
|
_: 1
|
|
66
64
|
}, 8, ["size"]);
|
|
67
65
|
};
|
|
68
66
|
}
|
|
69
|
-
}), xe = (e) => (
|
|
67
|
+
}), xe = (e) => (Z("data-v-3fc33b5d"), e = e(), P(), e), Me = /* @__PURE__ */ xe(() => /* @__PURE__ */ z("svg", {
|
|
70
68
|
preserveAspectRatio: "xMidYMid meet",
|
|
71
69
|
viewBox: "0 0 24 24",
|
|
72
70
|
width: "1.2em",
|
|
73
71
|
height: "1.2em",
|
|
74
72
|
"data-v-63d067da": ""
|
|
75
73
|
}, [
|
|
76
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ z("path", {
|
|
77
75
|
fill: "currentColor",
|
|
78
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"
|
|
79
77
|
})
|
|
80
|
-
], -1)),
|
|
78
|
+
], -1)), ye = /* @__PURE__ */ S({
|
|
81
79
|
__name: "MlDropdown",
|
|
82
80
|
props: {
|
|
83
81
|
icon: {},
|
|
@@ -87,22 +85,22 @@ const U = { render: _e }, we = /* @__PURE__ */ D({
|
|
|
87
85
|
emits: {
|
|
88
86
|
click: null
|
|
89
87
|
},
|
|
90
|
-
setup(e, { emit:
|
|
91
|
-
const
|
|
92
|
-
|
|
88
|
+
setup(e, { emit: i }) {
|
|
89
|
+
const t = e, o = i, l = L(() => t.items.filter((u) => u.name !== t.current)), n = (u) => {
|
|
90
|
+
o("click", u);
|
|
93
91
|
};
|
|
94
|
-
return (
|
|
95
|
-
const
|
|
96
|
-
return
|
|
97
|
-
dropdown:
|
|
98
|
-
|
|
99
|
-
default:
|
|
100
|
-
(
|
|
101
|
-
key:
|
|
102
|
-
command:
|
|
92
|
+
return (u, d) => {
|
|
93
|
+
const s = Y, a = oe, v = ie, g = se;
|
|
94
|
+
return y(), W(g, { onCommand: n }, {
|
|
95
|
+
dropdown: T(() => [
|
|
96
|
+
H(v, null, {
|
|
97
|
+
default: T(() => [
|
|
98
|
+
(y(!0), I(K, null, Q(l.value, (c) => (y(), W(a, {
|
|
99
|
+
key: c.text,
|
|
100
|
+
command: c.name
|
|
103
101
|
}, {
|
|
104
|
-
default:
|
|
105
|
-
|
|
102
|
+
default: T(() => [
|
|
103
|
+
ve(N(c.text), 1)
|
|
106
104
|
]),
|
|
107
105
|
_: 2
|
|
108
106
|
}, 1032, ["command"]))), 128))
|
|
@@ -110,13 +108,13 @@ const U = { render: _e }, we = /* @__PURE__ */ D({
|
|
|
110
108
|
_: 1
|
|
111
109
|
})
|
|
112
110
|
]),
|
|
113
|
-
default:
|
|
114
|
-
|
|
111
|
+
default: T(() => [
|
|
112
|
+
H(s, {
|
|
115
113
|
size: "30",
|
|
116
114
|
class: "ml-dropdown-icon"
|
|
117
115
|
}, {
|
|
118
|
-
default:
|
|
119
|
-
|
|
116
|
+
default: T(() => [
|
|
117
|
+
Me
|
|
120
118
|
]),
|
|
121
119
|
_: 1
|
|
122
120
|
})
|
|
@@ -125,12 +123,12 @@ const U = { render: _e }, we = /* @__PURE__ */ D({
|
|
|
125
123
|
});
|
|
126
124
|
};
|
|
127
125
|
}
|
|
128
|
-
}),
|
|
129
|
-
const
|
|
130
|
-
for (const [
|
|
131
|
-
|
|
132
|
-
return
|
|
133
|
-
},
|
|
126
|
+
}), A = (e, i) => {
|
|
127
|
+
const t = e.__vccOpts || e;
|
|
128
|
+
for (const [o, l] of i)
|
|
129
|
+
t[o] = l;
|
|
130
|
+
return t;
|
|
131
|
+
}, X = /* @__PURE__ */ A(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>', be = /* @__PURE__ */ S({
|
|
134
132
|
__name: "MlLanguage",
|
|
135
133
|
props: {
|
|
136
134
|
languages: {},
|
|
@@ -139,21 +137,32 @@ const U = { render: _e }, we = /* @__PURE__ */ D({
|
|
|
139
137
|
emits: {
|
|
140
138
|
click: null
|
|
141
139
|
},
|
|
142
|
-
setup(e, { emit:
|
|
143
|
-
const
|
|
144
|
-
|
|
140
|
+
setup(e, { emit: i }) {
|
|
141
|
+
const t = e, o = i, l = (n) => {
|
|
142
|
+
o("click", n);
|
|
145
143
|
};
|
|
146
|
-
return (
|
|
147
|
-
icon:
|
|
148
|
-
items:
|
|
149
|
-
current:
|
|
150
|
-
onClick:
|
|
144
|
+
return (n, u) => (y(), W(X, {
|
|
145
|
+
icon: Ee,
|
|
146
|
+
items: t.languages,
|
|
147
|
+
current: t.current,
|
|
148
|
+
onClick: l
|
|
151
149
|
}, null, 8, ["items", "current"]));
|
|
152
150
|
}
|
|
153
|
-
}), ze = {
|
|
151
|
+
}), ze = {}, Ce = { class: "ml-status-bar" }, Be = { class: "ml-status-bar-left" }, Te = { class: "ml-status-bar-right" };
|
|
152
|
+
function ke(e, i) {
|
|
153
|
+
return y(), I("div", Ce, [
|
|
154
|
+
z("div", Be, [
|
|
155
|
+
O(e.$slots, "left", {}, void 0, !0)
|
|
156
|
+
]),
|
|
157
|
+
z("div", Te, [
|
|
158
|
+
O(e.$slots, "right", {}, void 0, !0)
|
|
159
|
+
])
|
|
160
|
+
]);
|
|
161
|
+
}
|
|
162
|
+
const $e = /* @__PURE__ */ A(ze, [["render", ke], ["__scopeId", "data-v-b0c9d107"]]), We = {
|
|
154
163
|
key: 0,
|
|
155
164
|
class: "ml-toolbar-button-text"
|
|
156
|
-
},
|
|
165
|
+
}, Ie = /* @__PURE__ */ S({
|
|
157
166
|
__name: "MlToolbar",
|
|
158
167
|
props: {
|
|
159
168
|
items: {},
|
|
@@ -163,43 +172,43 @@ const U = { render: _e }, we = /* @__PURE__ */ D({
|
|
|
163
172
|
emits: {
|
|
164
173
|
click: null
|
|
165
174
|
},
|
|
166
|
-
setup(e, { emit:
|
|
167
|
-
const
|
|
168
|
-
switch (
|
|
175
|
+
setup(e, { emit: i }) {
|
|
176
|
+
const t = e, o = i, 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
|
+
switch (t.size) {
|
|
169
178
|
case "small":
|
|
170
179
|
return 30;
|
|
171
180
|
case "medium":
|
|
172
181
|
return 50;
|
|
173
182
|
}
|
|
174
183
|
return 70;
|
|
175
|
-
}),
|
|
176
|
-
|
|
184
|
+
}), d = (v) => v.description ? v.description : v.text, s = L(() => t.size === "large"), a = (v) => {
|
|
185
|
+
o("click", v);
|
|
177
186
|
};
|
|
178
|
-
return (
|
|
179
|
-
const
|
|
180
|
-
return
|
|
181
|
-
class:
|
|
187
|
+
return (v, g) => {
|
|
188
|
+
const c = Y, h = ue, r = ae, p = ce;
|
|
189
|
+
return y(), W(p, {
|
|
190
|
+
class: R(l.value)
|
|
182
191
|
}, {
|
|
183
|
-
default:
|
|
184
|
-
(
|
|
185
|
-
key:
|
|
186
|
-
content:
|
|
192
|
+
default: T(() => [
|
|
193
|
+
(y(!0), I(K, null, Q(v.items, (x, C) => (y(), W(r, {
|
|
194
|
+
key: x.text,
|
|
195
|
+
content: d(x),
|
|
187
196
|
"hide-after": 0
|
|
188
197
|
}, {
|
|
189
|
-
default:
|
|
190
|
-
(
|
|
198
|
+
default: T(() => [
|
|
199
|
+
(y(), W(h, {
|
|
191
200
|
class: "ml-toolbar-button",
|
|
192
|
-
style:
|
|
193
|
-
key:
|
|
194
|
-
onClick: (
|
|
201
|
+
style: ee({ width: u.value + "px", height: u.value + "px" }),
|
|
202
|
+
key: C,
|
|
203
|
+
onClick: (k) => a(x.command)
|
|
195
204
|
}, {
|
|
196
|
-
default:
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
size:
|
|
200
|
-
innerHTML:
|
|
205
|
+
default: T(() => [
|
|
206
|
+
z("div", null, [
|
|
207
|
+
H(c, {
|
|
208
|
+
size: n.value,
|
|
209
|
+
innerHTML: x.icon
|
|
201
210
|
}, null, 8, ["size", "innerHTML"]),
|
|
202
|
-
|
|
211
|
+
s.value ? (y(), I("div", We, N(x.text), 1)) : te("", !0)
|
|
203
212
|
])
|
|
204
213
|
]),
|
|
205
214
|
_: 2
|
|
@@ -212,294 +221,383 @@ const U = { render: _e }, we = /* @__PURE__ */ D({
|
|
|
212
221
|
}, 8, ["class"]);
|
|
213
222
|
};
|
|
214
223
|
}
|
|
215
|
-
}),
|
|
216
|
-
function
|
|
217
|
-
const l =
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
224
|
+
}), De = /* @__PURE__ */ A(Ie, [["__scopeId", "data-v-27b5412a"]]), q = 20;
|
|
225
|
+
function He(e, i, t) {
|
|
226
|
+
const o = m(!1), l = (s) => {
|
|
227
|
+
if (t.value && e.value) {
|
|
228
|
+
const a = e.value.getBoundingClientRect(), v = s.clientX < a.left || s.clientX > a.right || s.clientY < a.top || s.clientY > a.bottom;
|
|
229
|
+
o.value = !v;
|
|
230
|
+
}
|
|
231
|
+
}, n = () => {
|
|
232
|
+
t.value && (o.value = !0);
|
|
233
|
+
}, u = () => {
|
|
234
|
+
i.value && i.value.addEventListener("mousemove", n), e.value && e.value.addEventListener("mousemove", n);
|
|
235
|
+
}, d = () => {
|
|
236
|
+
i.value && i.value.removeEventListener("mousemove", n), e.value && e.value.removeEventListener("mousemove", n);
|
|
237
|
+
};
|
|
238
|
+
return D(() => {
|
|
239
|
+
window.addEventListener("mousemove", l);
|
|
240
|
+
}), U(() => {
|
|
241
|
+
window.removeEventListener("mousemove", l);
|
|
242
|
+
}), _(t, (s) => {
|
|
243
|
+
s && (o.value = !1);
|
|
244
|
+
}), _(e, (s) => {
|
|
245
|
+
s ? u() : d();
|
|
246
|
+
}), { autoOpened: o };
|
|
247
|
+
}
|
|
248
|
+
function Se(e, i, t) {
|
|
249
|
+
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
|
+
x: l.value.x - n.value.x,
|
|
251
|
+
y: l.value.y - n.value.y
|
|
252
|
+
}), s = () => {
|
|
253
|
+
if (e.value) {
|
|
254
|
+
const r = e.value.getBoundingClientRect();
|
|
255
|
+
n.value = {
|
|
256
|
+
x: r.left,
|
|
257
|
+
y: r.top
|
|
258
|
+
}, l.value = {
|
|
259
|
+
x: r.left,
|
|
260
|
+
y: r.top
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
}, a = () => {
|
|
264
|
+
e.value && e.value.addEventListener("mousedown", g);
|
|
265
|
+
}, v = () => {
|
|
266
|
+
e.value && e.value.removeEventListener("mousedown", g);
|
|
267
|
+
}, g = (r) => {
|
|
268
|
+
if (e.value != null) {
|
|
269
|
+
if (i && i.value) {
|
|
270
|
+
const p = i.value.getBoundingClientRect();
|
|
271
|
+
if (r.clientX < p.left || r.clientX > p.right || r.clientY < p.top || r.clientY > p.bottom) return;
|
|
272
|
+
}
|
|
273
|
+
o.value = !0, u.x = r.clientX, u.y = r.clientY, s(), document.addEventListener("mousemove", c), document.addEventListener("mouseup", h);
|
|
274
|
+
}
|
|
275
|
+
}, c = (r) => {
|
|
276
|
+
if (o.value && n.value && l.value) {
|
|
277
|
+
const p = window.innerWidth, x = window.innerHeight, C = e.value, k = C.getBoundingClientRect(), b = k.width, f = k.height, $ = n.value.x + (r.clientX - u.x), E = n.value.y + (r.clientY - u.y);
|
|
278
|
+
l.value.x = Math.max(
|
|
279
|
+
t ? t.value.offset.value.left : 0,
|
|
280
|
+
$
|
|
281
|
+
);
|
|
282
|
+
const w = p - b;
|
|
283
|
+
l.value.x = Math.min(
|
|
284
|
+
t ? w - t.value.offset.value.right : w,
|
|
285
|
+
l.value.x
|
|
286
|
+
), l.value.y = Math.max(
|
|
287
|
+
t ? t.value.offset.value.top : 0,
|
|
288
|
+
Math.min(E, x - f)
|
|
289
|
+
);
|
|
290
|
+
const M = x - f;
|
|
291
|
+
l.value.y = Math.min(
|
|
292
|
+
t ? M - t.value.offset.value.bottom : M,
|
|
293
|
+
l.value.y
|
|
294
|
+
), C.style.left = l.value.x + "px", C.style.top = l.value.y + "px";
|
|
295
|
+
}
|
|
296
|
+
}, h = () => {
|
|
297
|
+
o.value = !1, document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", h);
|
|
298
|
+
};
|
|
299
|
+
return D(() => {
|
|
300
|
+
e.value && (s(), a());
|
|
301
|
+
}), U(() => {
|
|
302
|
+
e.value && e.value.removeEventListener("mousedown", g);
|
|
303
|
+
}), _(e, (r) => {
|
|
304
|
+
r ? (s(), a()) : v();
|
|
305
|
+
}), {
|
|
306
|
+
isDragging: o,
|
|
307
|
+
movement: d,
|
|
308
|
+
position: l
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
function Ve(e, i, t) {
|
|
312
|
+
const o = m(!1), l = m("left"), { isDragging: n, movement: u, position: d } = Se(
|
|
313
|
+
e,
|
|
314
|
+
i,
|
|
315
|
+
t
|
|
316
|
+
);
|
|
317
|
+
return _(u, (s) => {
|
|
318
|
+
if (s && e.value) {
|
|
319
|
+
const v = e.value.getBoundingClientRect();
|
|
320
|
+
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
|
+
}
|
|
322
|
+
}), {
|
|
323
|
+
docked: o,
|
|
324
|
+
orientation: l,
|
|
325
|
+
isDragging: n,
|
|
326
|
+
movement: u,
|
|
327
|
+
position: d
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
function Ye(e, i, t, o) {
|
|
331
|
+
const l = m(null), n = m(null), u = m(null), d = m(null);
|
|
332
|
+
return _(e, (s, a) => {
|
|
333
|
+
l.value = a;
|
|
334
|
+
}), _(i, (s, a) => {
|
|
335
|
+
n.value = a;
|
|
336
|
+
}), _(t, (s, a) => {
|
|
337
|
+
u.value = a;
|
|
338
|
+
}), _(o, (s, a) => {
|
|
339
|
+
d.value = a;
|
|
340
|
+
}), {
|
|
341
|
+
lastLeft: l,
|
|
342
|
+
lastTop: n,
|
|
343
|
+
lastWidth: u,
|
|
344
|
+
lastHeight: d
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
function Ae(e, i, t, o) {
|
|
348
|
+
const l = m(e.value.width), n = m(e.value.left), u = L(() => e.value.width), d = L(() => e.value.left), s = L(() => t.value ? t.value.x : null);
|
|
349
|
+
return _([u, d], ([a, v]) => {
|
|
350
|
+
(l.value == null || n.value == null || i.value) && (l.value = a, n.value = v);
|
|
351
|
+
}), _(s, (a) => {
|
|
352
|
+
o.value && t.value && (n.value = a);
|
|
353
|
+
}), { left: n, width: l };
|
|
354
|
+
}
|
|
355
|
+
function Oe(e, i = m({ left: 0, right: 0, top: 0, bottom: 0 })) {
|
|
356
|
+
const t = m({});
|
|
357
|
+
let o = !1;
|
|
358
|
+
const l = () => {
|
|
359
|
+
if (!o && e.value) {
|
|
360
|
+
const n = e.value.getBoundingClientRect();
|
|
361
|
+
t.value.left = Math.max(n.left, i.value.left), t.value.top = Math.max(n.top, i.value.top), t.value.width = n.width, t.value.height = n.height, o = !0;
|
|
223
362
|
}
|
|
224
363
|
};
|
|
225
|
-
return
|
|
226
|
-
e.value &&
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
}), C(e, (o) => {
|
|
230
|
-
o && H(() => {
|
|
231
|
-
t();
|
|
232
|
-
});
|
|
364
|
+
return D(() => {
|
|
365
|
+
e.value && l();
|
|
366
|
+
}), _(e, (n) => {
|
|
367
|
+
n && l();
|
|
233
368
|
}), {
|
|
234
|
-
isIntialized:
|
|
235
|
-
initialRect:
|
|
369
|
+
isIntialized: o,
|
|
370
|
+
initialRect: t
|
|
236
371
|
};
|
|
237
372
|
}
|
|
238
|
-
function
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
s + m
|
|
258
|
-
), e.value.style.width = t.value.width + "px"), (i.value === "bottom" || i.value === "left-bottom-corner" || i.value === "right-bottom-corner") && (t.value.height = Math.max(
|
|
259
|
-
n.height,
|
|
260
|
-
v + z
|
|
261
|
-
), e.value.style.height = t.value.height + "px");
|
|
373
|
+
function Xe(e, i = m(!1), t = m(!1), o = m({ left: 0, right: 0, top: 0, bottom: 0 }), l = { width: 20, height: 40 }) {
|
|
374
|
+
const { initialRect: n } = Oe(e, o), u = m(!1);
|
|
375
|
+
let d = 0, s = 0, a = 0, v = 0, g = 0;
|
|
376
|
+
const c = 5, h = m(null), r = (b) => {
|
|
377
|
+
if (!(!e.value || i.value))
|
|
378
|
+
if (u.value) {
|
|
379
|
+
const f = b.clientX - v, $ = b.clientY - g;
|
|
380
|
+
if (h.value === "left" || h.value === "left-bottom-corner") {
|
|
381
|
+
const E = s - f;
|
|
382
|
+
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
|
+
}
|
|
384
|
+
if (h.value === "right" || h.value === "right-bottom-corner") {
|
|
385
|
+
const E = s + f;
|
|
386
|
+
E > l.width && (n.value.width = E, e.value.style.width = n.value.width + "px");
|
|
387
|
+
}
|
|
388
|
+
if (h.value === "bottom" || h.value === "left-bottom-corner" || h.value === "right-bottom-corner") {
|
|
389
|
+
const E = a + $;
|
|
390
|
+
E > l.height && (n.value.height = E, e.value.style.height = n.value.height + "px");
|
|
391
|
+
}
|
|
262
392
|
} else {
|
|
263
|
-
const
|
|
264
|
-
|
|
393
|
+
const f = e.value.getBoundingClientRect(), $ = b.clientX - f.left, E = b.clientY - f.top, w = $ <= c, M = $ >= f.width - c, B = E >= f.height - c;
|
|
394
|
+
w && B && t.value ? (e.value.style.cursor = "nesw-resize", h.value = "left-bottom-corner") : M && B && !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") : M && !t.value ? (e.value.style.cursor = "ew-resize", h.value = "right") : B ? (e.value.style.cursor = "ns-resize", h.value = "bottom") : (e.value.style.cursor = "", h.value = null);
|
|
265
395
|
}
|
|
266
|
-
}, p = (
|
|
267
|
-
if (!e.value || !
|
|
268
|
-
const
|
|
269
|
-
|
|
396
|
+
}, p = (b) => {
|
|
397
|
+
if (!e.value || !h.value) return;
|
|
398
|
+
const f = e.value.getBoundingClientRect();
|
|
399
|
+
v = b.clientX, g = b.clientY, s = f.width, a = f.height, d = f.left, n.value.width = s, 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);
|
|
270
400
|
}, x = () => {
|
|
271
|
-
|
|
272
|
-
},
|
|
273
|
-
e.value && (e.value.removeEventListener("mousedown", p), e.value.removeEventListener("mousemove",
|
|
274
|
-
},
|
|
275
|
-
e.value && (e.value.addEventListener("mousedown", p), e.value.addEventListener("mousemove",
|
|
401
|
+
u.value = !1, h.value = null, e.value && (e.value.style.cursor = ""), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", x);
|
|
402
|
+
}, C = () => {
|
|
403
|
+
e.value && (e.value.removeEventListener("mousedown", p), e.value.removeEventListener("mousemove", r)), document.removeEventListener("mouseup", x);
|
|
404
|
+
}, k = () => {
|
|
405
|
+
e.value && (e.value.addEventListener("mousedown", p), e.value.addEventListener("mousemove", r));
|
|
276
406
|
};
|
|
277
|
-
return
|
|
278
|
-
e.value &&
|
|
279
|
-
}),
|
|
280
|
-
|
|
281
|
-
}),
|
|
282
|
-
|
|
283
|
-
}), { rect:
|
|
407
|
+
return D(() => {
|
|
408
|
+
e.value && k();
|
|
409
|
+
}), ne(() => {
|
|
410
|
+
C();
|
|
411
|
+
}), _(e, (b) => {
|
|
412
|
+
b ? k() : C();
|
|
413
|
+
}), { rect: n, isResizing: u };
|
|
284
414
|
}
|
|
285
|
-
function
|
|
286
|
-
|
|
287
|
-
e.value && (e.value.style.transition = "");
|
|
288
|
-
}
|
|
289
|
-
const o = () => {
|
|
290
|
-
e.value && e.value.removeEventListener("transitionend", t);
|
|
291
|
-
}, c = () => {
|
|
292
|
-
e.value && e.value.addEventListener("transitionend", t);
|
|
293
|
-
};
|
|
294
|
-
I(() => {
|
|
295
|
-
e.value && e.value.addEventListener("transitionend", t);
|
|
296
|
-
}), Z(() => {
|
|
297
|
-
e.value && e.value.removeEventListener("transitionend", t);
|
|
298
|
-
}), C(e, (s) => {
|
|
299
|
-
s ? c() : o();
|
|
300
|
-
}), C(n, () => {
|
|
415
|
+
function Ne(e, i, t, o) {
|
|
416
|
+
const l = () => {
|
|
301
417
|
if (e.value) {
|
|
302
418
|
const s = e.value;
|
|
303
|
-
|
|
419
|
+
i.value ? s.style.transition = "width 0.3s ease-out, left 0.3s ease-out" : s.style.transition = "width 0.3s ease";
|
|
304
420
|
}
|
|
305
|
-
})
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
if (e.value && l.value) {
|
|
312
|
-
const p = e.value.getBoundingClientRect();
|
|
313
|
-
e.value.style.left = p.left + a + "px";
|
|
314
|
-
}
|
|
315
|
-
}, r = () => {
|
|
316
|
-
const a = window.innerWidth - o.value;
|
|
317
|
-
o.value = window.innerWidth, c.value = window.innerHeight, h(a);
|
|
421
|
+
}, n = () => {
|
|
422
|
+
e.value && (e.value.style.transition = "");
|
|
423
|
+
}, u = () => {
|
|
424
|
+
e.value && e.value.removeEventListener("transitionend", n);
|
|
425
|
+
}, d = () => {
|
|
426
|
+
e.value && e.value.addEventListener("transitionend", n);
|
|
318
427
|
};
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
}),
|
|
322
|
-
|
|
428
|
+
D(() => {
|
|
429
|
+
e.value && e.value.addEventListener("transitionend", n);
|
|
430
|
+
}), ne(() => {
|
|
431
|
+
e.value && e.value.removeEventListener("transitionend", n);
|
|
432
|
+
}), _(e, (s) => {
|
|
433
|
+
s ? d() : u();
|
|
434
|
+
}), _(t, () => {
|
|
435
|
+
l();
|
|
436
|
+
}), _(o, () => {
|
|
437
|
+
l();
|
|
323
438
|
});
|
|
324
|
-
let i = null;
|
|
325
|
-
return C(n, (a) => {
|
|
326
|
-
a ? (i = u.value.width, u.value.width = V, l.value && u.value.left && i && (u.value.left = u.value.left + i - V)) : (u.value.width = i, l.value && u.value.left && i && (u.value.left = u.value.left - i + V), i = null);
|
|
327
|
-
}), C(t, (a) => {
|
|
328
|
-
if (a && e.value) {
|
|
329
|
-
const x = e.value.getBoundingClientRect();
|
|
330
|
-
u.value.left = x.left, u.value.top = x.top;
|
|
331
|
-
}
|
|
332
|
-
}), { rect: u };
|
|
333
439
|
}
|
|
334
|
-
function
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
440
|
+
function Ue(e, i, t, o) {
|
|
441
|
+
const l = m(window.innerWidth), n = m(window.innerHeight), { docked: u, orientation: d, movement: s, position: a, isDragging: v } = Ve(
|
|
442
|
+
e,
|
|
443
|
+
i,
|
|
444
|
+
o
|
|
445
|
+
), g = L(() => d.value === "right"), { rect: c, isResizing: h } = Xe(
|
|
446
|
+
e,
|
|
447
|
+
t,
|
|
448
|
+
g,
|
|
449
|
+
o.value.offset
|
|
450
|
+
), { width: r, left: p } = Ae(
|
|
451
|
+
c,
|
|
452
|
+
h,
|
|
453
|
+
a,
|
|
454
|
+
v
|
|
455
|
+
), { lastTop: x, lastHeight: C } = Ye(
|
|
456
|
+
L(() => c.value.left),
|
|
457
|
+
L(() => c.value.top),
|
|
458
|
+
L(() => c.value.width),
|
|
459
|
+
L(() => c.value.height)
|
|
460
|
+
), { autoOpened: k } = He(e, i, t);
|
|
461
|
+
Ne(e, g, t, k);
|
|
462
|
+
const b = (w) => {
|
|
339
463
|
if (e.value) {
|
|
340
|
-
const
|
|
341
|
-
|
|
464
|
+
const M = e.value.getBoundingClientRect(), B = M.left + w;
|
|
465
|
+
if (g.value) {
|
|
466
|
+
c.value.left = B;
|
|
467
|
+
const le = window.innerWidth - M.width - M.left;
|
|
468
|
+
M.left <= 0 && le >= 0 && w < 0 && (c.value.left = Math.max(0, B)), window.innerWidth - M.width <= 0 && (c.value.left = window.innerWidth - M.width);
|
|
469
|
+
} else
|
|
470
|
+
M.left + M.width >= window.innerWidth && w < 0 && (c.value.left = Math.max(0, B));
|
|
342
471
|
}
|
|
343
|
-
},
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
e.value && e.value.removeEventListener("mousedown", h);
|
|
347
|
-
}, h = () => {
|
|
348
|
-
n.value = !0, document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
|
|
349
|
-
}, r = (a) => {
|
|
350
|
-
if (n.value) {
|
|
351
|
-
const p = window.innerWidth, x = window.innerHeight, y = e.value, w = y.offsetWidth, d = y.offsetHeight, m = t.value.x + a.movementX, z = t.value.y + a.movementY;
|
|
352
|
-
t.value.x = Math.max(
|
|
353
|
-
l ? l.value.leftGap : 0,
|
|
354
|
-
Math.min(m, p - w)
|
|
355
|
-
);
|
|
356
|
-
const k = l && l.value.container ? l.value.container.clientWidth : 0, B = p - k - w;
|
|
357
|
-
if (t.value.x = Math.min(
|
|
358
|
-
l ? B - l.value.rightGap : B,
|
|
359
|
-
t.value.x
|
|
360
|
-
), t.value.y = Math.max(
|
|
361
|
-
0,
|
|
362
|
-
Math.min(z, x - d)
|
|
363
|
-
), l != null && l.value.container) {
|
|
364
|
-
const T = l == null ? void 0 : l.value.container;
|
|
365
|
-
T.style.left = t.value.x + "px", T.style.top = t.value.y + "px";
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}, i = () => {
|
|
369
|
-
n.value = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
|
|
472
|
+
}, f = () => {
|
|
473
|
+
const w = window.innerWidth - l.value;
|
|
474
|
+
l.value = window.innerWidth, n.value = window.innerHeight, b(w);
|
|
370
475
|
};
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
})
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
}) : u();
|
|
381
|
-
}), {
|
|
382
|
-
isDragging: n,
|
|
383
|
-
movement: c,
|
|
384
|
-
position: t
|
|
476
|
+
D(() => {
|
|
477
|
+
window.addEventListener("resize", f);
|
|
478
|
+
}), U(() => {
|
|
479
|
+
window.removeEventListener("resize", f);
|
|
480
|
+
});
|
|
481
|
+
const $ = (w) => {
|
|
482
|
+
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
|
+
}, E = () => {
|
|
484
|
+
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);
|
|
385
485
|
};
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
486
|
+
return _(u, () => {
|
|
487
|
+
E();
|
|
488
|
+
}), _(t, (w) => {
|
|
489
|
+
$(w);
|
|
490
|
+
}), _(k, (w) => {
|
|
491
|
+
t.value && !v.value && $(!w);
|
|
492
|
+
}), _(s, (w) => {
|
|
493
|
+
if (w && e.value) {
|
|
494
|
+
const B = e.value.getBoundingClientRect();
|
|
495
|
+
c.value.left = B.left, c.value.top = B.top;
|
|
393
496
|
}
|
|
394
|
-
}), {
|
|
395
|
-
docked: n,
|
|
396
|
-
orientation: t,
|
|
397
|
-
isDragging: o,
|
|
398
|
-
movement: c,
|
|
399
|
-
position: s
|
|
400
|
-
};
|
|
497
|
+
}), { rect: c, orientation: d, reversed: g };
|
|
401
498
|
}
|
|
402
|
-
const
|
|
499
|
+
const Fe = (e) => (Z("data-v-539d98d3"), e = e(), P(), e), Ge = /* @__PURE__ */ Fe(() => /* @__PURE__ */ z("svg", {
|
|
403
500
|
xmlns: "http://www.w3.org/2000/svg",
|
|
404
501
|
width: "1em",
|
|
405
502
|
height: "1em",
|
|
406
503
|
viewBox: "0 0 1024 1024"
|
|
407
504
|
}, [
|
|
408
|
-
/* @__PURE__ */
|
|
505
|
+
/* @__PURE__ */ z("path", {
|
|
409
506
|
fill: "currentColor",
|
|
410
507
|
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"
|
|
411
508
|
})
|
|
412
|
-
], -1)),
|
|
509
|
+
], -1)), je = { class: "ml-tool-palette-title" }, qe = { class: "ml-tool-palette-content" }, Je = /* @__PURE__ */ S({
|
|
413
510
|
__name: "MlToolPalette",
|
|
414
|
-
props: /* @__PURE__ */
|
|
415
|
-
title: { default: "" }
|
|
511
|
+
props: /* @__PURE__ */ V({
|
|
512
|
+
title: { default: "" },
|
|
513
|
+
leftOffset: { default: 0 },
|
|
514
|
+
rightOffset: { default: 0 },
|
|
515
|
+
topOffset: { default: 0 },
|
|
516
|
+
bottomOffset: { default: 0 }
|
|
416
517
|
}, {
|
|
417
518
|
modelValue: { default: !0 },
|
|
418
519
|
modelModifiers: {}
|
|
419
520
|
}),
|
|
420
|
-
emits: /* @__PURE__ */
|
|
421
|
-
setup(e, { emit:
|
|
422
|
-
const
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
), {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
o("close", {
|
|
445
|
-
x: d ? d.clientLeft : 0,
|
|
446
|
-
y: d ? d.clientTop : 0
|
|
521
|
+
emits: /* @__PURE__ */ V(["close"], ["update:modelValue"]),
|
|
522
|
+
setup(e, { emit: i }) {
|
|
523
|
+
const t = e, o = J(e, "modelValue"), l = i, n = m(!1), u = m(null), d = m(null), s = L(() => ({
|
|
524
|
+
offset: m({
|
|
525
|
+
left: t.leftOffset,
|
|
526
|
+
right: t.rightOffset,
|
|
527
|
+
top: t.topOffset,
|
|
528
|
+
bottom: t.bottomOffset
|
|
529
|
+
})
|
|
530
|
+
})), {
|
|
531
|
+
rect: a,
|
|
532
|
+
orientation: v,
|
|
533
|
+
reversed: g
|
|
534
|
+
} = Ue(d, u, n, s), c = L(() => ({
|
|
535
|
+
left: `${a.value.left}px`,
|
|
536
|
+
top: `${a.value.top}px`,
|
|
537
|
+
width: `${a.value.width}px`,
|
|
538
|
+
height: `${a.value.height}px`
|
|
539
|
+
})), h = () => {
|
|
540
|
+
o.value = !1;
|
|
541
|
+
const r = d.value;
|
|
542
|
+
l("close", {
|
|
543
|
+
x: r ? r.clientLeft : 0,
|
|
544
|
+
y: r ? r.clientTop : 0
|
|
447
545
|
});
|
|
448
546
|
};
|
|
449
|
-
return (
|
|
450
|
-
const
|
|
451
|
-
return
|
|
547
|
+
return (r, p) => {
|
|
548
|
+
const x = Y;
|
|
549
|
+
return o.value ? (y(), I("div", {
|
|
452
550
|
key: 0,
|
|
453
551
|
ref_key: "toolPaletteElement",
|
|
454
|
-
ref:
|
|
455
|
-
style:
|
|
552
|
+
ref: d,
|
|
553
|
+
style: ee([c.value]),
|
|
456
554
|
class: "ml-tool-palette-dialog"
|
|
457
555
|
}, [
|
|
458
|
-
|
|
459
|
-
class:
|
|
556
|
+
z("div", {
|
|
557
|
+
class: R(["ml-tool-palette-dialog-layout", F(v)])
|
|
460
558
|
}, [
|
|
461
|
-
|
|
559
|
+
z("div", {
|
|
462
560
|
ref_key: "titleBarElement",
|
|
463
|
-
ref:
|
|
561
|
+
ref: u,
|
|
464
562
|
class: "ml-tool-palette-title-bar"
|
|
465
563
|
}, [
|
|
466
|
-
|
|
564
|
+
H(x, {
|
|
467
565
|
size: 18,
|
|
468
566
|
class: "ml-tool-palette-dialog-icon",
|
|
469
|
-
onClick:
|
|
567
|
+
onClick: h
|
|
470
568
|
}, {
|
|
471
|
-
default:
|
|
472
|
-
|
|
569
|
+
default: T(() => [
|
|
570
|
+
Ge
|
|
473
571
|
]),
|
|
474
572
|
_: 1
|
|
475
573
|
}),
|
|
476
|
-
|
|
574
|
+
H(Le, {
|
|
477
575
|
class: "ml-tool-palette-dialog-icon",
|
|
478
|
-
modelValue:
|
|
479
|
-
"onUpdate:modelValue":
|
|
480
|
-
reverse:
|
|
481
|
-
onChange: y
|
|
576
|
+
modelValue: n.value,
|
|
577
|
+
"onUpdate:modelValue": p[0] || (p[0] = (C) => n.value = C),
|
|
578
|
+
reverse: F(g)
|
|
482
579
|
}, null, 8, ["modelValue", "reverse"]),
|
|
483
|
-
|
|
580
|
+
z("span", je, N(t.title), 1)
|
|
484
581
|
], 512),
|
|
485
|
-
|
|
486
|
-
|
|
582
|
+
z("div", qe, [
|
|
583
|
+
O(r.$slots, "default", {}, void 0, !0)
|
|
487
584
|
])
|
|
488
585
|
], 2)
|
|
489
|
-
], 4)) :
|
|
586
|
+
], 4)) : te("", !0);
|
|
490
587
|
};
|
|
491
588
|
}
|
|
492
|
-
}),
|
|
589
|
+
}), Ke = /* @__PURE__ */ A(Je, [["__scopeId", "data-v-539d98d3"]]), st = {
|
|
493
590
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
494
591
|
install(e) {
|
|
495
|
-
e.component("MlCollapse",
|
|
592
|
+
e.component("MlCollapse", X), e.component("MlDropdown", X), e.component("MlLanguage", be), e.component("MlStatusBar", $e), e.component("MlToolbar", De), e.component("MlToolPalette", Ke);
|
|
496
593
|
}
|
|
497
594
|
};
|
|
498
595
|
export {
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
596
|
+
Le as MlCollapse,
|
|
597
|
+
X as MlDropdown,
|
|
598
|
+
be as MlLanguage,
|
|
599
|
+
$e as MlStatusBar,
|
|
600
|
+
Ke as MlToolPalette,
|
|
601
|
+
De as MlToolbar,
|
|
602
|
+
st as default
|
|
505
603
|
};
|