vue-dockable-desktop 1.1.2 → 1.2.0
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/CHANGELOG.md +48 -0
- package/dist/composables/useLibraryMessage.d.ts +10 -0
- package/dist/core/messages.d.ts +8 -0
- package/dist/core/panelDom.d.ts +8 -2
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +689 -613
- package/dist/index.js.map +1 -1
- package/dist/styles.css +27 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, getCurrentScope as d, guardReactiveProps as f, inject as p, isVNode as m, markRaw as h, mergeModels as g, mergeProps as _, nextTick as v, normalizeClass as y, normalizeProps as b, normalizeStyle as x, onBeforeUnmount as S, onMounted as C, onScopeDispose as w, openBlock as T, provide as E, reactive as D, readonly as O, ref as k, renderList as A, renderSlot as j, resolveComponent as M, resolveDynamicComponent as N, shallowReactive as P, shallowRef as F, toDisplayString as I, toRaw as L, toValue as R, unref as z, useModel as B, useSlots as V, useTemplateRef as H, vModelText as ee, watch as U, watchEffect as
|
|
1
|
+
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, getCurrentScope as d, guardReactiveProps as f, inject as p, isVNode as m, markRaw as h, mergeModels as g, mergeProps as _, nextTick as v, normalizeClass as y, normalizeProps as b, normalizeStyle as x, onBeforeUnmount as S, onMounted as C, onScopeDispose as w, openBlock as T, provide as E, reactive as D, readonly as O, ref as k, renderList as A, renderSlot as j, resolveComponent as M, resolveDynamicComponent as N, shallowReactive as P, shallowRef as F, toDisplayString as I, toRaw as L, toValue as R, unref as z, useModel as B, useSlots as V, useTemplateRef as H, vModelText as ee, watch as U, watchEffect as W, withCtx as G, withDirectives as te, withKeys as ne, withModifiers as K } from "vue";
|
|
2
2
|
//#region src/core/layoutTree.ts
|
|
3
|
-
var
|
|
3
|
+
var re = {
|
|
4
4
|
type: "leaf",
|
|
5
5
|
id: "group-default",
|
|
6
6
|
panels: [],
|
|
7
7
|
activePanelId: null
|
|
8
|
-
},
|
|
9
|
-
...
|
|
8
|
+
}, q = () => ({
|
|
9
|
+
...re,
|
|
10
10
|
panels: []
|
|
11
11
|
});
|
|
12
|
-
function
|
|
12
|
+
function ie(e, t) {
|
|
13
13
|
if (e.type === "leaf") {
|
|
14
14
|
let n = e.panels.indexOf(t);
|
|
15
15
|
if (n === -1) return e;
|
|
@@ -20,7 +20,7 @@ function ae(e, t) {
|
|
|
20
20
|
activePanelId: i
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
let n = e.children.map((e) =>
|
|
23
|
+
let n = e.children.map((e) => ie(e, t)).filter((e) => e !== null);
|
|
24
24
|
if (n.length === 0) return null;
|
|
25
25
|
if (n.length === 1) return n[0];
|
|
26
26
|
let r = e.sizes.slice(0, n.length), i = r.reduce((e, t) => e + t, 0);
|
|
@@ -30,7 +30,7 @@ function ae(e, t) {
|
|
|
30
30
|
sizes: r.map((e) => e / i)
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function ae(e, t, n, r) {
|
|
34
34
|
let i = r?.select !== !1;
|
|
35
35
|
if (e.type === "leaf") {
|
|
36
36
|
if (e.id !== t) return e;
|
|
@@ -43,10 +43,10 @@ function oe(e, t, n, r) {
|
|
|
43
43
|
}
|
|
44
44
|
return {
|
|
45
45
|
...e,
|
|
46
|
-
children: e.children.map((e) =>
|
|
46
|
+
children: e.children.map((e) => ae(e, t, n, r))
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function oe(e, t, n, r) {
|
|
50
50
|
if (e.type === "leaf") {
|
|
51
51
|
if (e.id !== t) return e;
|
|
52
52
|
let i = e.panels.filter((e) => e !== n), a = Math.max(0, Math.min(r, i.length)), o = [...i];
|
|
@@ -58,11 +58,11 @@ function se(e, t, n, r) {
|
|
|
58
58
|
}
|
|
59
59
|
return {
|
|
60
60
|
...e,
|
|
61
|
-
children: e.children.map((e) =>
|
|
61
|
+
children: e.children.map((e) => oe(e, t, n, r))
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
var
|
|
65
|
-
function
|
|
64
|
+
var se = (e) => `group-${e}-${Date.now()}-${Math.floor(Math.random() * 1e3)}`;
|
|
65
|
+
function ce(e, t, n, r, i, a = se("split")) {
|
|
66
66
|
if (e.type === "leaf") {
|
|
67
67
|
if (e.id !== t) return e;
|
|
68
68
|
let o = {
|
|
@@ -80,10 +80,10 @@ function le(e, t, n, r, i, a = ce("split")) {
|
|
|
80
80
|
}
|
|
81
81
|
return {
|
|
82
82
|
...e,
|
|
83
|
-
children: e.children.map((e) =>
|
|
83
|
+
children: e.children.map((e) => ce(e, t, n, r, i, a))
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function le(e, t, n, r, i = se("edge")) {
|
|
87
87
|
let a = {
|
|
88
88
|
type: "leaf",
|
|
89
89
|
id: i,
|
|
@@ -97,9 +97,9 @@ function ue(e, t, n, r, i = ce("edge")) {
|
|
|
97
97
|
children: o ? [a, e] : [e, a]
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function ue(e, t) {
|
|
101
101
|
if (e.type === "leaf") return e.id === t && e.canClose !== !1 ? null : e;
|
|
102
|
-
let n = e.children.map((e) =>
|
|
102
|
+
let n = e.children.map((e) => ue(e, t)).filter((e) => e !== null);
|
|
103
103
|
if (n.length === 0) return null;
|
|
104
104
|
if (n.length === 1) return n[0];
|
|
105
105
|
let r = e.sizes.slice(0, n.length), i = r.reduce((e, t) => e + t, 0);
|
|
@@ -109,45 +109,45 @@ function de(e, t) {
|
|
|
109
109
|
sizes: r.map((e) => e / i)
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function de(e, t) {
|
|
113
113
|
return e.type === "leaf" ? e.panels.includes(t) ? {
|
|
114
114
|
...e,
|
|
115
115
|
activePanelId: t
|
|
116
116
|
} : e : {
|
|
117
117
|
...e,
|
|
118
|
-
children: e.children.map((e) =>
|
|
118
|
+
children: e.children.map((e) => de(e, t))
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function fe(e) {
|
|
122
122
|
if (e.type === "leaf") return e.id;
|
|
123
123
|
for (let t of e.children) {
|
|
124
|
-
let e =
|
|
124
|
+
let e = fe(t);
|
|
125
125
|
if (e) return e;
|
|
126
126
|
}
|
|
127
127
|
return null;
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function pe(e, t) {
|
|
130
130
|
if (e.type === "leaf") return e.panels.includes(t) ? e.id : null;
|
|
131
131
|
for (let n of e.children) {
|
|
132
|
-
let e =
|
|
132
|
+
let e = pe(n, t);
|
|
133
133
|
if (e) return e;
|
|
134
134
|
}
|
|
135
135
|
return null;
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function me(e, t) {
|
|
138
138
|
if (!e) return null;
|
|
139
139
|
if (e.type === "leaf") return e.id === t ? e : null;
|
|
140
140
|
for (let n of e.children) {
|
|
141
|
-
let e =
|
|
141
|
+
let e = me(n, t);
|
|
142
142
|
if (e) return e;
|
|
143
143
|
}
|
|
144
144
|
return null;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
147
|
-
let r =
|
|
146
|
+
function he(e, t, n) {
|
|
147
|
+
let r = me(e, t);
|
|
148
148
|
return r !== null && r.panels.length === 1 && r.panels[0] === n;
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function ge(e, t) {
|
|
151
151
|
let n = [], r = /* @__PURE__ */ new Set(), i = (e) => {
|
|
152
152
|
if (e.type === "leaf") {
|
|
153
153
|
let t = e.panels.filter((e) => r.has(e) ? (n.push(`panel "${e}" was listed in more than one group`), !1) : (r.add(e), !0));
|
|
@@ -170,7 +170,7 @@ function _e(e, t) {
|
|
|
170
170
|
children: t,
|
|
171
171
|
sizes: a.map((e) => e / o)
|
|
172
172
|
};
|
|
173
|
-
}, a = i(e) ??
|
|
173
|
+
}, a = i(e) ?? q(), o = Object.values(t).filter((e) => e.state === "docked" && !r.has(e.id));
|
|
174
174
|
if (o.length > 0) {
|
|
175
175
|
for (let e of o) n.push(`panel "${e.id}" is docked but was in no group`);
|
|
176
176
|
let e = o.map((e) => e.id), t = (n) => n.type === "leaf" ? {
|
|
@@ -188,10 +188,10 @@ function _e(e, t) {
|
|
|
188
188
|
repairs: n
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
|
-
function
|
|
192
|
-
return
|
|
191
|
+
function _e(e, t) {
|
|
192
|
+
return me(e, t) !== null;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function ve(e, t, n) {
|
|
195
195
|
let r = (e, i) => {
|
|
196
196
|
if (e.type === "leaf") return e;
|
|
197
197
|
if (i === t.length) return {
|
|
@@ -206,14 +206,14 @@ function ye(e, t, n) {
|
|
|
206
206
|
};
|
|
207
207
|
return r(e, 0);
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function ye(e, t) {
|
|
210
210
|
let n = t.panels[e];
|
|
211
211
|
if (!n || n.state === "minimized") return !1;
|
|
212
212
|
if (t.floating.some((t) => t.id === e)) return !0;
|
|
213
213
|
let r = (t) => t.type === "leaf" ? t.activePanelId === e : t.children.some(r);
|
|
214
214
|
return t.gridRoot ? r(t.gridRoot) : !1;
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function be(e) {
|
|
217
217
|
let t = (t) => t !== null && !!e.panels[t] && e.panels[t].state !== "minimized", n = (e) => {
|
|
218
218
|
if (e.type === "leaf") return t(e.activePanelId) ? e.activePanelId : null;
|
|
219
219
|
for (let t of e.children) {
|
|
@@ -229,7 +229,7 @@ function xe(e) {
|
|
|
229
229
|
}
|
|
230
230
|
//#endregion
|
|
231
231
|
//#region src/core/serialize.ts
|
|
232
|
-
function
|
|
232
|
+
function xe(e) {
|
|
233
233
|
return e.map((e) => {
|
|
234
234
|
let t = e;
|
|
235
235
|
if (!("stickyRight" in t) && !("stickyBottom" in t)) return t;
|
|
@@ -240,18 +240,18 @@ function Se(e) {
|
|
|
240
240
|
};
|
|
241
241
|
});
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function Se(e, t) {
|
|
244
244
|
if (!e || typeof e != "object") return null;
|
|
245
245
|
let n = e;
|
|
246
246
|
if (!n.gridRoot || !Array.isArray(n.floating) || !Array.isArray(n.minimized) || !n.panels) return null;
|
|
247
|
-
let r =
|
|
247
|
+
let r = xe(n.floating), i = n.panels, a = ge(n.gridRoot, i);
|
|
248
248
|
a.repairs.length > 0 && t?.(`Repaired the saved layout on load: ${a.repairs.join("; ")}. Layouts written before this version could contain it — dropping a lone docked panel onto its own group left the panel in no group — and the repair runs every time the layout is read, so saving again from this session stores the corrected layout.`);
|
|
249
249
|
let o = a.gridRoot, s = {
|
|
250
250
|
gridRoot: o,
|
|
251
251
|
floating: r,
|
|
252
252
|
panels: i
|
|
253
253
|
}, c = typeof n.activePanelId == "string" ? n.activePanelId : null, l = null;
|
|
254
|
-
return c !== null && (
|
|
254
|
+
return c !== null && (ye(c, s) ? l = c : t?.(`Ignoring the saved layout's activePanelId ("${c}") — it does not name a currently visible panel (it may have been closed, minimised, or excluded from the snapshot as non-serialisable). Falling back to the selected tab of the first leaf.`)), l === null && (l = be(s)), {
|
|
255
255
|
gridRoot: o,
|
|
256
256
|
floating: r,
|
|
257
257
|
minimized: n.minimized,
|
|
@@ -259,16 +259,16 @@ function Ce(e, t) {
|
|
|
259
259
|
activePanelId: l
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function Ce(e, t) {
|
|
263
263
|
if (e) try {
|
|
264
|
-
let n =
|
|
264
|
+
let n = Se(JSON.parse(e), t);
|
|
265
265
|
if (n) return n;
|
|
266
266
|
} catch {
|
|
267
267
|
t?.("initialState is not valid JSON; starting from an empty workspace.");
|
|
268
268
|
}
|
|
269
269
|
return {
|
|
270
270
|
gridRoot: {
|
|
271
|
-
...
|
|
271
|
+
...re,
|
|
272
272
|
panels: []
|
|
273
273
|
},
|
|
274
274
|
floating: [],
|
|
@@ -279,7 +279,7 @@ function we(e, t) {
|
|
|
279
279
|
}
|
|
280
280
|
//#endregion
|
|
281
281
|
//#region src/core/serializable.ts
|
|
282
|
-
function
|
|
282
|
+
function we(e) {
|
|
283
283
|
if (e === null) return !0;
|
|
284
284
|
if (e === void 0) return !1;
|
|
285
285
|
let t = typeof e;
|
|
@@ -287,13 +287,13 @@ function Te(e) {
|
|
|
287
287
|
if (t === "function" || t === "symbol" || t === "bigint") return !1;
|
|
288
288
|
if (e instanceof Date) return !0;
|
|
289
289
|
if (m(e)) return !1;
|
|
290
|
-
if (Array.isArray(e)) return e.every(
|
|
290
|
+
if (Array.isArray(e)) return e.every(we);
|
|
291
291
|
let n = Object.getPrototypeOf(e);
|
|
292
|
-
return n !== Object.prototype && n !== null ? !1 : Object.values(e).every(
|
|
292
|
+
return n !== Object.prototype && n !== null ? !1 : Object.values(e).every(we);
|
|
293
293
|
}
|
|
294
294
|
//#endregion
|
|
295
295
|
//#region src/core/registry.ts
|
|
296
|
-
var
|
|
296
|
+
var Te = class {
|
|
297
297
|
entries = /* @__PURE__ */ new Map();
|
|
298
298
|
register(e, t, n) {
|
|
299
299
|
this.entries.set(e, {
|
|
@@ -313,7 +313,7 @@ var Ee = class {
|
|
|
313
313
|
keys() {
|
|
314
314
|
return Array.from(this.entries.keys());
|
|
315
315
|
}
|
|
316
|
-
},
|
|
316
|
+
}, Ee = class {
|
|
317
317
|
listeners = /* @__PURE__ */ new Map();
|
|
318
318
|
subscribe(e, t) {
|
|
319
319
|
let n = this.listeners.get(e);
|
|
@@ -339,7 +339,7 @@ var Ee = class {
|
|
|
339
339
|
clear() {
|
|
340
340
|
this.listeners.clear();
|
|
341
341
|
}
|
|
342
|
-
},
|
|
342
|
+
}, De = (e) => "separator" in e, Oe = (e) => !De(e) && "items" in e;
|
|
343
343
|
function ke(e) {
|
|
344
344
|
let t = e.event;
|
|
345
345
|
if (!t) return {
|
|
@@ -468,6 +468,14 @@ var je = {
|
|
|
468
468
|
search: {
|
|
469
469
|
id: "vdd.search",
|
|
470
470
|
defaultMessage: "Search"
|
|
471
|
+
},
|
|
472
|
+
notifications: {
|
|
473
|
+
id: "vdd.notifications",
|
|
474
|
+
defaultMessage: "Notifications"
|
|
475
|
+
},
|
|
476
|
+
closeNotification: {
|
|
477
|
+
id: "vdd.closeNotification",
|
|
478
|
+
defaultMessage: "Close notification"
|
|
471
479
|
}
|
|
472
480
|
};
|
|
473
481
|
function Me(e, t) {
|
|
@@ -668,12 +676,12 @@ var He = (e, t) => Math.min(.9, Math.max(.1, e ?? t)), J = {
|
|
|
668
676
|
height: 350
|
|
669
677
|
}, Ue = Symbol("vdd-workspace");
|
|
670
678
|
function We(e = {}) {
|
|
671
|
-
let t = new
|
|
679
|
+
let t = new Te();
|
|
672
680
|
for (let [n, r] of Object.entries(e.panels ?? {})) t.register(n, r.component, r.defaultOptions);
|
|
673
|
-
let r = new
|
|
681
|
+
let r = new Ee(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = k(0), c = F(null), l = {
|
|
674
682
|
...je,
|
|
675
683
|
...e.messages ?? {}
|
|
676
|
-
}, u = e.zIndexBase ?? 1e3, d = u, f =
|
|
684
|
+
}, u = e.zIndexBase ?? 1e3, d = u, f = Ce(e.initialState, m), p = D({
|
|
677
685
|
gridRoot: f.gridRoot,
|
|
678
686
|
floating: f.floating,
|
|
679
687
|
minimized: f.minimized,
|
|
@@ -696,7 +704,7 @@ function We(e = {}) {
|
|
|
696
704
|
});
|
|
697
705
|
function _(e) {
|
|
698
706
|
let t = p.activePanelId, n;
|
|
699
|
-
n = e &&
|
|
707
|
+
n = e && ye(e, g()) ? e : p.activePanelId && ye(p.activePanelId, g()) ? p.activePanelId : be(g()), n !== t && (p.activePanelId = n, r.emit("panel:activated", {
|
|
700
708
|
id: n,
|
|
701
709
|
previous: t
|
|
702
710
|
}));
|
|
@@ -733,15 +741,15 @@ function We(e = {}) {
|
|
|
733
741
|
}
|
|
734
742
|
function C(e) {
|
|
735
743
|
let t = L(p).gridRoot;
|
|
736
|
-
p.gridRoot =
|
|
744
|
+
p.gridRoot = ie(t, e) ?? (t.type === "leaf" ? {
|
|
737
745
|
...t,
|
|
738
746
|
panels: [],
|
|
739
747
|
activePanelId: null
|
|
740
|
-
} :
|
|
748
|
+
} : q()), p.floating = p.floating.filter((t) => t.id !== e), p.minimized = p.minimized.filter((t) => t.id !== e);
|
|
741
749
|
}
|
|
742
750
|
function w(e, t, n) {
|
|
743
751
|
let r = L(p).gridRoot;
|
|
744
|
-
return
|
|
752
|
+
return he(r, t, e) ? !0 : !_e(r, t) && (m(`${n}("${e}", "${t}") was ignored: no group with that id is in the layout. Emptying a group removes it, so an id kept across a layout change can name a group that no longer exists.`), !0);
|
|
745
753
|
}
|
|
746
754
|
function T(e, n, i) {
|
|
747
755
|
t.has(n) || m(`Panel "${e}" references component key "${n}", which is not registered. Add it to createWorkspace({ panels: { "${n}": { component: YourComponent } } }).`);
|
|
@@ -756,7 +764,7 @@ function We(e = {}) {
|
|
|
756
764
|
M(a, { focus: s });
|
|
757
765
|
return;
|
|
758
766
|
}
|
|
759
|
-
if (o.state === "docked" &&
|
|
767
|
+
if (o.state === "docked" && pe(L(p).gridRoot, a) === null) {
|
|
760
768
|
m(`Panel "${a}" was open but in no group; docking it again.`), P(a), s && V(a);
|
|
761
769
|
return;
|
|
762
770
|
}
|
|
@@ -768,7 +776,7 @@ function We(e = {}) {
|
|
|
768
776
|
title: i?.title ?? c?.defaultOptions?.title ?? a,
|
|
769
777
|
component: n,
|
|
770
778
|
state: l === "floating" ? "floating" : "docked",
|
|
771
|
-
serializable: !d ||
|
|
779
|
+
serializable: !d || we(L(i.props)),
|
|
772
780
|
...d ? { props: h(i.props) } : {},
|
|
773
781
|
...i?.dedupeKey === void 0 ? {} : { dedupeKey: i.dedupeKey }
|
|
774
782
|
};
|
|
@@ -777,8 +785,8 @@ function We(e = {}) {
|
|
|
777
785
|
[a]: f
|
|
778
786
|
}, l === "floating") S(a, x(u), i?.anchor ?? c?.defaultOptions?.defaultAnchor ?? null);
|
|
779
787
|
else {
|
|
780
|
-
let e =
|
|
781
|
-
p.gridRoot =
|
|
788
|
+
let e = fe(L(p).gridRoot) ?? q().id;
|
|
789
|
+
p.gridRoot = ae(L(p).gridRoot, e, a, { select: s });
|
|
782
790
|
}
|
|
783
791
|
_(s ? a : null), r.emit("panel:opened", {
|
|
784
792
|
id: a,
|
|
@@ -799,8 +807,8 @@ function We(e = {}) {
|
|
|
799
807
|
let n = i.get(e);
|
|
800
808
|
if (n && !await n()) return;
|
|
801
809
|
let r = p.panels[e];
|
|
802
|
-
(!r?.dirty || await (t?.onConfirm ?? ((e) =>
|
|
803
|
-
title:
|
|
810
|
+
(!r?.dirty || await (t?.onConfirm ?? ((e) => xe.confirmDiscard({
|
|
811
|
+
title: ge(r.title),
|
|
804
812
|
dirtyOptions: e
|
|
805
813
|
})))(r.dirtyOptions)) && E(e);
|
|
806
814
|
}
|
|
@@ -817,7 +825,7 @@ function We(e = {}) {
|
|
|
817
825
|
height: Number(t.height),
|
|
818
826
|
anchor: t.anchor ?? null
|
|
819
827
|
});
|
|
820
|
-
} else i =
|
|
828
|
+
} else i = pe(L(p).gridRoot, e) ?? void 0;
|
|
821
829
|
C(e), p.panels = {
|
|
822
830
|
...p.panels,
|
|
823
831
|
[e]: {
|
|
@@ -853,9 +861,9 @@ function We(e = {}) {
|
|
|
853
861
|
...i,
|
|
854
862
|
state: "docked"
|
|
855
863
|
}
|
|
856
|
-
}, p.gridRoot =
|
|
864
|
+
}, p.gridRoot = ae(L(p).gridRoot, t, e, { select: a });
|
|
857
865
|
};
|
|
858
|
-
o === "floating" ? l() : i.lastLeafId &&
|
|
866
|
+
o === "floating" ? l() : i.lastLeafId && _e(L(p).gridRoot, i.lastLeafId) ? u(i.lastLeafId) : b(e).canDrag === !1 ? u(fe(L(p).gridRoot) ?? q().id) : l(), _(a ? e : null), r.emit("panel:restored", { id: e }), v();
|
|
859
867
|
}
|
|
860
868
|
function N(e, n, r) {
|
|
861
869
|
let i = p.panels[e];
|
|
@@ -873,14 +881,14 @@ function We(e = {}) {
|
|
|
873
881
|
let n = p.panels[e];
|
|
874
882
|
if (!n) return;
|
|
875
883
|
C(e);
|
|
876
|
-
let r = n.lastLeafId &&
|
|
884
|
+
let r = n.lastLeafId && _e(L(p).gridRoot, n.lastLeafId) ? n.lastLeafId : void 0, i = t ?? r ?? fe(L(p).gridRoot) ?? q().id;
|
|
877
885
|
p.panels = {
|
|
878
886
|
...p.panels,
|
|
879
887
|
[e]: {
|
|
880
888
|
...n,
|
|
881
889
|
state: "docked"
|
|
882
890
|
}
|
|
883
|
-
}, p.gridRoot =
|
|
891
|
+
}, p.gridRoot = ae(L(p).gridRoot, i, e), _(e), v();
|
|
884
892
|
}
|
|
885
893
|
function I(e, t, n) {
|
|
886
894
|
let r = p.panels[e];
|
|
@@ -890,29 +898,29 @@ function We(e = {}) {
|
|
|
890
898
|
...r,
|
|
891
899
|
state: "docked"
|
|
892
900
|
}
|
|
893
|
-
}, p.gridRoot = n === "center" ?
|
|
901
|
+
}, p.gridRoot = n === "center" ? ae(L(p).gridRoot, t, e) : ce(L(p).gridRoot, t, e, n, p.splitRatio), p.draggedPanelId = null, _(e), v()));
|
|
894
902
|
}
|
|
895
903
|
function R(e, t) {
|
|
896
904
|
let n = p.panels[e];
|
|
897
|
-
n &&
|
|
905
|
+
n && ie(L(p).gridRoot, e) !== null && (C(e), p.panels = {
|
|
898
906
|
...p.panels,
|
|
899
907
|
[e]: {
|
|
900
908
|
...n,
|
|
901
909
|
state: "docked"
|
|
902
910
|
}
|
|
903
|
-
}, p.gridRoot =
|
|
911
|
+
}, p.gridRoot = le(L(p).gridRoot, e, t, p.edgeSplitRatio), p.draggedPanelId = null, _(e), v());
|
|
904
912
|
}
|
|
905
913
|
function z(e, t, n) {
|
|
906
914
|
let r = p.panels[e];
|
|
907
915
|
if (!r || w(e, t, "movePanelOrder")) return;
|
|
908
|
-
let i =
|
|
916
|
+
let i = ie(L(p).gridRoot, e) ?? q();
|
|
909
917
|
p.floating = p.floating.filter((t) => t.id !== e), p.minimized = p.minimized.filter((t) => t.id !== e), p.panels = {
|
|
910
918
|
...p.panels,
|
|
911
919
|
[e]: {
|
|
912
920
|
...r,
|
|
913
921
|
state: "docked"
|
|
914
922
|
}
|
|
915
|
-
}, p.gridRoot =
|
|
923
|
+
}, p.gridRoot = oe(i, t, e, n), p.draggedPanelId = null, _(e), v();
|
|
916
924
|
}
|
|
917
925
|
function B(e) {
|
|
918
926
|
p.panels[e]?.state === "minimized" && M(e);
|
|
@@ -935,7 +943,7 @@ function We(e = {}) {
|
|
|
935
943
|
z: t
|
|
936
944
|
} : n);
|
|
937
945
|
}
|
|
938
|
-
} else t.state === "docked" && (p.gridRoot =
|
|
946
|
+
} else t.state === "docked" && (p.gridRoot = de(L(p).gridRoot, e));
|
|
939
947
|
if (t.state === "minimized") {
|
|
940
948
|
let t = p.activePanelId;
|
|
941
949
|
t !== e && (p.activePanelId = e, r.emit("panel:activated", {
|
|
@@ -948,10 +956,10 @@ function We(e = {}) {
|
|
|
948
956
|
}
|
|
949
957
|
}
|
|
950
958
|
function H(e) {
|
|
951
|
-
p.gridRoot =
|
|
959
|
+
p.gridRoot = ue(L(p).gridRoot, e) ?? q(), _(), v();
|
|
952
960
|
}
|
|
953
961
|
function ee(e, t) {
|
|
954
|
-
p.gridRoot =
|
|
962
|
+
p.gridRoot = ve(L(p).gridRoot, e, t), v();
|
|
955
963
|
}
|
|
956
964
|
function U(e, t) {
|
|
957
965
|
p.floating = p.floating.map((n) => n.id === e ? {
|
|
@@ -959,7 +967,7 @@ function We(e = {}) {
|
|
|
959
967
|
...t
|
|
960
968
|
} : n);
|
|
961
969
|
}
|
|
962
|
-
function
|
|
970
|
+
function W(e, t, n) {
|
|
963
971
|
let r = p.panels[e];
|
|
964
972
|
r && (p.panels = {
|
|
965
973
|
...p.panels,
|
|
@@ -970,7 +978,7 @@ function We(e = {}) {
|
|
|
970
978
|
}
|
|
971
979
|
});
|
|
972
980
|
}
|
|
973
|
-
function
|
|
981
|
+
function G(e, t) {
|
|
974
982
|
let n = p.panels[e];
|
|
975
983
|
n && (p.panels = {
|
|
976
984
|
...p.panels,
|
|
@@ -983,26 +991,26 @@ function We(e = {}) {
|
|
|
983
991
|
title: t
|
|
984
992
|
} : n)));
|
|
985
993
|
}
|
|
986
|
-
function
|
|
994
|
+
function te(e) {
|
|
987
995
|
p.dir !== e && (p.dir = e, p.isRtl = e === "rtl");
|
|
988
996
|
}
|
|
989
|
-
function
|
|
997
|
+
function ne() {
|
|
990
998
|
let e = L(p), t = [], n = {};
|
|
991
999
|
for (let [r, i] of Object.entries(e.panels)) {
|
|
992
1000
|
let e = a.get(r), o = e?.(), s = e !== void 0 && o !== void 0, c = s ? o : i.props;
|
|
993
|
-
(s ?
|
|
1001
|
+
(s ? we(L(o)) : i.serializable) ? n[r] = s ? {
|
|
994
1002
|
...i,
|
|
995
1003
|
props: c,
|
|
996
1004
|
serializable: !0
|
|
997
1005
|
} : i : t.push(r);
|
|
998
1006
|
}
|
|
999
1007
|
let i = e.gridRoot, o = e.floating, s = e.minimized;
|
|
1000
|
-
for (let e of t) i =
|
|
1008
|
+
for (let e of t) i = ie(i, e) ?? q(), o = o.filter((t) => t.id !== e), s = s.filter((t) => t.id !== e);
|
|
1001
1009
|
t.length && r.emit("layout:panels-excluded", { panels: t.map((t) => ({
|
|
1002
1010
|
id: t,
|
|
1003
1011
|
component: e.panels[t].component
|
|
1004
1012
|
})) });
|
|
1005
|
-
let c = e.activePanelId, l = c !== null &&
|
|
1013
|
+
let c = e.activePanelId, l = c !== null && ye(c, {
|
|
1006
1014
|
gridRoot: i,
|
|
1007
1015
|
floating: o,
|
|
1008
1016
|
panels: n
|
|
@@ -1016,14 +1024,14 @@ function We(e = {}) {
|
|
|
1016
1024
|
};
|
|
1017
1025
|
return JSON.stringify(u);
|
|
1018
1026
|
}
|
|
1019
|
-
function
|
|
1027
|
+
function K(e) {
|
|
1020
1028
|
let t;
|
|
1021
1029
|
try {
|
|
1022
1030
|
t = JSON.parse(e);
|
|
1023
1031
|
} catch {
|
|
1024
1032
|
return m("loadLayout received invalid JSON; the current layout is unchanged."), !1;
|
|
1025
1033
|
}
|
|
1026
|
-
let n =
|
|
1034
|
+
let n = Se(t, m);
|
|
1027
1035
|
if (!n) return m("loadLayout received something that is not a layout (it needs gridRoot, floating, minimized and panels); the current layout is unchanged."), !1;
|
|
1028
1036
|
p.gridRoot = n.gridRoot, p.floating = n.floating, p.minimized = n.minimized, p.panels = n.panels, p.draggedPanelId = null, d = Math.max(u, ...n.floating.map((e) => e.z), 0);
|
|
1029
1037
|
let i = p.activePanelId;
|
|
@@ -1032,29 +1040,29 @@ function We(e = {}) {
|
|
|
1032
1040
|
previous: i
|
|
1033
1041
|
}), v(), !0;
|
|
1034
1042
|
}
|
|
1035
|
-
function
|
|
1043
|
+
function re(e, t) {
|
|
1036
1044
|
return i.set(e, t), () => {
|
|
1037
1045
|
i.get(e) === t && i.delete(e);
|
|
1038
1046
|
};
|
|
1039
1047
|
}
|
|
1040
|
-
function
|
|
1048
|
+
function se(e, t) {
|
|
1041
1049
|
return a.set(e, t), () => {
|
|
1042
1050
|
a.get(e) === t && a.delete(e);
|
|
1043
1051
|
};
|
|
1044
1052
|
}
|
|
1045
|
-
function
|
|
1053
|
+
function me(e, t) {
|
|
1046
1054
|
return o.set(e, t), s.value++, () => {
|
|
1047
1055
|
o.get(e) === t && (o.delete(e), s.value++);
|
|
1048
1056
|
};
|
|
1049
1057
|
}
|
|
1050
|
-
let
|
|
1058
|
+
let ge = (t) => {
|
|
1051
1059
|
if (t == null) return "";
|
|
1052
1060
|
if (typeof t == "string") return t;
|
|
1053
1061
|
if (e.formatMessage) return e.formatMessage(t);
|
|
1054
1062
|
let n = t.defaultMessage ?? t.id;
|
|
1055
1063
|
for (let [e, r] of Object.entries(t.values ?? {})) n = n.replace(`{${e}}`, String(r));
|
|
1056
1064
|
return n;
|
|
1057
|
-
},
|
|
1065
|
+
}, xe = Ie(), De = Le(), Oe = {
|
|
1058
1066
|
state: O(p),
|
|
1059
1067
|
registry: t,
|
|
1060
1068
|
gridRoot: n(() => p.gridRoot),
|
|
@@ -1080,26 +1088,26 @@ function We(e = {}) {
|
|
|
1080
1088
|
closeLeafGroup: H,
|
|
1081
1089
|
updateSplitSizes: ee,
|
|
1082
1090
|
updateFloatingPosition: U,
|
|
1083
|
-
setPanelDirty:
|
|
1084
|
-
updatePanelTitle:
|
|
1085
|
-
setDirection:
|
|
1091
|
+
setPanelDirty: W,
|
|
1092
|
+
updatePanelTitle: G,
|
|
1093
|
+
setDirection: te,
|
|
1086
1094
|
setDraggedPanelId: (e) => {
|
|
1087
1095
|
p.draggedPanelId = e;
|
|
1088
1096
|
},
|
|
1089
1097
|
isOpen: (e) => e in p.panels,
|
|
1090
1098
|
getOpenPanelIds: () => Object.keys(p.panels),
|
|
1091
1099
|
findPanelId: (e, t) => Object.values(p.panels).find((n) => n.component === e && n.dedupeKey === t)?.id ?? null,
|
|
1092
|
-
saveLayout:
|
|
1093
|
-
loadLayout:
|
|
1100
|
+
saveLayout: ne,
|
|
1101
|
+
loadLayout: K,
|
|
1094
1102
|
publish: (e, t) => r.publish(e, t),
|
|
1095
1103
|
subscribe: (e, t) => r.subscribe(e, t),
|
|
1096
1104
|
toolbar: Ne(),
|
|
1097
|
-
overlays:
|
|
1098
|
-
contributions:
|
|
1099
|
-
activeContribution: Ve(
|
|
1100
|
-
registerCloseGuard:
|
|
1101
|
-
registerStateProvider:
|
|
1102
|
-
registerPanelMenu:
|
|
1105
|
+
overlays: xe,
|
|
1106
|
+
contributions: De,
|
|
1107
|
+
activeContribution: Ve(De, () => p.activePanelId),
|
|
1108
|
+
registerCloseGuard: re,
|
|
1109
|
+
registerStateProvider: se,
|
|
1110
|
+
registerPanelMenu: me,
|
|
1103
1111
|
panelMenuItems: (e) => (s.value, o.get(e)?.() ?? []),
|
|
1104
1112
|
showContextMenu: (e) => {
|
|
1105
1113
|
e.event?.preventDefault?.(), c.value = {
|
|
@@ -1119,20 +1127,20 @@ function We(e = {}) {
|
|
|
1119
1127
|
window: e.classes?.window ?? "",
|
|
1120
1128
|
windowBody: e.classes?.windowBody ?? ""
|
|
1121
1129
|
},
|
|
1122
|
-
format:
|
|
1130
|
+
format: ge,
|
|
1123
1131
|
messages: l,
|
|
1124
1132
|
config: {
|
|
1125
1133
|
...e,
|
|
1126
1134
|
zIndexBase: u
|
|
1127
1135
|
},
|
|
1128
1136
|
install(e) {
|
|
1129
|
-
e.provide(Ue,
|
|
1137
|
+
e.provide(Ue, Oe);
|
|
1130
1138
|
},
|
|
1131
1139
|
dispose() {
|
|
1132
|
-
r.clear(),
|
|
1140
|
+
r.clear(), xe.dispose(), i.clear(), a.clear(), o.clear(), c.value = null;
|
|
1133
1141
|
}
|
|
1134
1142
|
};
|
|
1135
|
-
return
|
|
1143
|
+
return Oe;
|
|
1136
1144
|
}
|
|
1137
1145
|
//#endregion
|
|
1138
1146
|
//#region src/core/anchorGeometry.ts
|
|
@@ -1165,13 +1173,16 @@ function Je(e) {
|
|
|
1165
1173
|
return n(e), t;
|
|
1166
1174
|
}
|
|
1167
1175
|
var Ye = class {
|
|
1168
|
-
|
|
1176
|
+
ownerDocument;
|
|
1169
1177
|
elements = /* @__PURE__ */ new Map();
|
|
1170
1178
|
preserved = /* @__PURE__ */ new Map();
|
|
1171
1179
|
sizes = /* @__PURE__ */ new Map();
|
|
1172
1180
|
hidden = null;
|
|
1173
|
-
constructor(e
|
|
1174
|
-
this.
|
|
1181
|
+
constructor(e) {
|
|
1182
|
+
this.ownerDocument = e;
|
|
1183
|
+
}
|
|
1184
|
+
get doc() {
|
|
1185
|
+
return this.ownerDocument ?? document;
|
|
1175
1186
|
}
|
|
1176
1187
|
hiddenStore() {
|
|
1177
1188
|
if (!this.hidden || !this.hidden.isConnected) {
|
|
@@ -1182,7 +1193,7 @@ var Ye = class {
|
|
|
1182
1193
|
}
|
|
1183
1194
|
elementFor(e) {
|
|
1184
1195
|
let t = this.elements.get(e);
|
|
1185
|
-
return t || (t = this.doc.createElement("div"), t.className = "vdd-panel-mount", t.
|
|
1196
|
+
return t || (t = this.doc.createElement("div"), t.className = "vdd-panel-mount", t.setAttribute("data-vdd-panel", e), this.hiddenStore().appendChild(t), this.elements.set(e, t)), t;
|
|
1186
1197
|
}
|
|
1187
1198
|
has(e) {
|
|
1188
1199
|
return this.elements.has(e);
|
|
@@ -1339,7 +1350,7 @@ function at(e) {
|
|
|
1339
1350
|
else if (c) {
|
|
1340
1351
|
let n = c.index;
|
|
1341
1352
|
c.side === "right" && (n += 1);
|
|
1342
|
-
let r =
|
|
1353
|
+
let r = me(e.state.gridRoot, c.leafId);
|
|
1343
1354
|
if (r) {
|
|
1344
1355
|
let e = r.panels.indexOf(t);
|
|
1345
1356
|
e !== -1 && e < n && --n;
|
|
@@ -1484,15 +1495,19 @@ function Y() {
|
|
|
1484
1495
|
}
|
|
1485
1496
|
//#endregion
|
|
1486
1497
|
//#region src/composables/useColorScheme.ts
|
|
1487
|
-
var ut = () => document.documentElement.getAttribute("data-color-scheme") === "light" ? "light" : "dark";
|
|
1498
|
+
var ut = () => typeof document < "u" && document.documentElement.getAttribute("data-color-scheme") === "light" ? "light" : "dark";
|
|
1488
1499
|
function dt() {
|
|
1489
|
-
let e = k(ut())
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1500
|
+
let e = k(ut());
|
|
1501
|
+
if (typeof document < "u") {
|
|
1502
|
+
let t = new MutationObserver(() => {
|
|
1503
|
+
e.value = ut();
|
|
1504
|
+
});
|
|
1505
|
+
t.observe(document.documentElement, {
|
|
1506
|
+
attributes: !0,
|
|
1507
|
+
attributeFilter: ["data-color-scheme"]
|
|
1508
|
+
}), w(() => t.disconnect());
|
|
1509
|
+
}
|
|
1510
|
+
return n(() => e.value);
|
|
1496
1511
|
}
|
|
1497
1512
|
//#endregion
|
|
1498
1513
|
//#region src/components/VddPanelSlot.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1563,29 +1578,34 @@ var ft = ["data-vdd-slot"], pt = /* @__PURE__ */ u({
|
|
|
1563
1578
|
style: x(f.value)
|
|
1564
1579
|
}, null, 4)) : i("", !0)], 64));
|
|
1565
1580
|
}
|
|
1566
|
-
}), vt = ["data-vdd-leaf", "data-active-panel-id"], yt = { class: "vdd-workspace-tab-bar" }, bt =
|
|
1581
|
+
}), vt = ["data-vdd-leaf", "data-active-panel-id"], yt = { class: "vdd-workspace-tab-bar" }, bt = [
|
|
1567
1582
|
"data-vdd-tab",
|
|
1568
1583
|
"data-vdd-tab-leaf",
|
|
1569
1584
|
"data-vdd-tab-index",
|
|
1570
1585
|
"aria-selected",
|
|
1586
|
+
"tabindex",
|
|
1571
1587
|
"onClick",
|
|
1572
1588
|
"onContextmenu",
|
|
1573
1589
|
"onPointerdown",
|
|
1574
|
-
"onPointermove"
|
|
1575
|
-
|
|
1590
|
+
"onPointermove",
|
|
1591
|
+
"onKeydown"
|
|
1592
|
+
], xt = { class: "vdd-text-truncate" }, St = {
|
|
1576
1593
|
key: 0,
|
|
1577
1594
|
class: "vdd-workspace-tab-icon"
|
|
1578
|
-
},
|
|
1595
|
+
}, Ct = [
|
|
1579
1596
|
"title",
|
|
1580
1597
|
"data-vdd-close",
|
|
1581
1598
|
"onClick"
|
|
1582
|
-
],
|
|
1599
|
+
], wt = {
|
|
1583
1600
|
key: 0,
|
|
1584
1601
|
class: "vdd-tab-header-actions"
|
|
1585
|
-
},
|
|
1602
|
+
}, Tt = ["title", "aria-label"], Et = {
|
|
1603
|
+
class: "vdd-panel-body",
|
|
1604
|
+
role: "tabpanel"
|
|
1605
|
+
}, Dt = {
|
|
1586
1606
|
key: 2,
|
|
1587
1607
|
class: "vdd-empty-leaf-placeholder"
|
|
1588
|
-
},
|
|
1608
|
+
}, Ot = /* @__PURE__ */ u({
|
|
1589
1609
|
__name: "VddLeafGroup",
|
|
1590
1610
|
props: { leaf: {} },
|
|
1591
1611
|
setup(t) {
|
|
@@ -1622,7 +1642,22 @@ var ft = ["data-vdd-slot"], pt = /* @__PURE__ */ u({
|
|
|
1622
1642
|
panel: t,
|
|
1623
1643
|
options: c.registry.get(t.component)?.defaultOptions ?? {}
|
|
1624
1644
|
}] : [];
|
|
1625
|
-
})), p = n(() => s.leaf.activePanelId), m = (e) =>
|
|
1645
|
+
})), p = n(() => s.leaf.activePanelId), m = H("tabBar"), h = (e, t) => (p.value ? e === p.value : t === 0) ? 0 : -1;
|
|
1646
|
+
function g(e, t) {
|
|
1647
|
+
let n = f.value, r = n[e];
|
|
1648
|
+
if (!r) return;
|
|
1649
|
+
if (t.key === "Delete") {
|
|
1650
|
+
r.options.canClose !== !1 && c.requestClosePanel(r.id), t.preventDefault();
|
|
1651
|
+
return;
|
|
1652
|
+
}
|
|
1653
|
+
if (t.key !== "ArrowRight" && t.key !== "ArrowLeft") return;
|
|
1654
|
+
t.preventDefault();
|
|
1655
|
+
let i = n[(e + (t.key === "ArrowRight" === c.state.isRtl ? n.length - 1 : 1)) % n.length];
|
|
1656
|
+
c.focusPanel(i.id), v(() => {
|
|
1657
|
+
m.value?.querySelector(`[data-vdd-tab="${CSS.escape(i.id)}"]`)?.focus();
|
|
1658
|
+
});
|
|
1659
|
+
}
|
|
1660
|
+
let _ = (e) => {
|
|
1626
1661
|
let t = l?.tab.value, n = t?.leafId === s.leaf.id && t.panelId === e;
|
|
1627
1662
|
return [
|
|
1628
1663
|
"vdd-workspace-tab",
|
|
@@ -1635,26 +1670,34 @@ var ft = ["data-vdd-slot"], pt = /* @__PURE__ */ u({
|
|
|
1635
1670
|
"data-vdd-leaf": t.leaf.id,
|
|
1636
1671
|
"data-active-panel-id": p.value ?? "",
|
|
1637
1672
|
onPointerdown: s[2] ||= (e) => p.value && z(c).focusPanel(p.value)
|
|
1638
|
-
}, [o("div", yt, [o("div",
|
|
1673
|
+
}, [o("div", yt, [o("div", {
|
|
1674
|
+
ref_key: "tabBar",
|
|
1675
|
+
ref: m,
|
|
1676
|
+
class: "vdd-tab-headers-container",
|
|
1677
|
+
role: "tablist"
|
|
1678
|
+
}, [(T(!0), a(e, null, A(f.value, (e, n) => (T(), a("div", {
|
|
1639
1679
|
key: e.id,
|
|
1640
|
-
class: y(
|
|
1680
|
+
class: y(_(e.id)),
|
|
1641
1681
|
"data-vdd-tab": e.id,
|
|
1642
1682
|
"data-vdd-tab-leaf": t.leaf.id,
|
|
1643
1683
|
"data-vdd-tab-index": String(n),
|
|
1644
1684
|
role: "tab",
|
|
1645
1685
|
"aria-selected": e.id === p.value,
|
|
1686
|
+
tabindex: h(e.id, n),
|
|
1646
1687
|
style: x({ cursor: e.options.canDrag === !1 ? "default" : "pointer" }),
|
|
1647
1688
|
onClick: (t) => z(c).focusPanel(e.id),
|
|
1648
|
-
onContextmenu:
|
|
1689
|
+
onContextmenu: K((t) => u(e.id, t), ["prevent"]),
|
|
1649
1690
|
onPointerdown: (t) => e.options.canDrag === !1 ? void 0 : z(l)?.startTabDrag(e.id, t, (t) => u(e.id, t)),
|
|
1650
1691
|
onPointermove: (r) => d(t.leaf.id, e.id, n, r),
|
|
1651
|
-
onPointerleave: s[0] ||= (e) => z(l)?.dragging.value && z(l).hoverTab(null)
|
|
1652
|
-
|
|
1692
|
+
onPointerleave: s[0] ||= (e) => z(l)?.dragging.value && z(l).hoverTab(null),
|
|
1693
|
+
onKeydown: (e) => g(n, e)
|
|
1694
|
+
}, [o("span", xt, [e.options.icon ? (T(), a("span", St, [(T(), r(N(e.options.icon)))])) : i("", !0), o("span", null, I(z(c).format(e.panel.title)) + I(e.panel.dirty ? " *" : ""), 1)]), e.options.canClose === !1 ? i("", !0) : (T(), a("span", {
|
|
1653
1695
|
key: 0,
|
|
1654
1696
|
class: "vdd-close-tab-x",
|
|
1697
|
+
"aria-hidden": "true",
|
|
1655
1698
|
title: z(c).format(z(c).messages.closeTab),
|
|
1656
1699
|
"data-vdd-close": e.id,
|
|
1657
|
-
onClick:
|
|
1700
|
+
onClick: K((t) => z(c).requestClosePanel(e.id), ["stop"])
|
|
1658
1701
|
}, [...s[3] ||= [o("svg", {
|
|
1659
1702
|
width: "12",
|
|
1660
1703
|
height: "12",
|
|
@@ -1662,13 +1705,13 @@ var ft = ["data-vdd-slot"], pt = /* @__PURE__ */ u({
|
|
|
1662
1705
|
fill: "none",
|
|
1663
1706
|
stroke: "currentColor",
|
|
1664
1707
|
"stroke-width": "2.5"
|
|
1665
|
-
}, [o("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]], 8,
|
|
1708
|
+
}, [o("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]], 8, Ct))], 46, bt))), 128))], 512), f.value.length === 0 ? (T(), a("div", wt, [o("button", {
|
|
1666
1709
|
type: "button",
|
|
1667
1710
|
class: "vdd-header-close-empty-group",
|
|
1668
1711
|
title: z(c).format(z(c).messages.closeEmptyGroup),
|
|
1669
1712
|
"aria-label": z(c).format(z(c).messages.closeEmptyGroup),
|
|
1670
1713
|
"data-vdd-close-empty-group": "",
|
|
1671
|
-
onClick: s[1] ||=
|
|
1714
|
+
onClick: s[1] ||= K((e) => z(c).closeLeafGroup(t.leaf.id), ["stop"])
|
|
1672
1715
|
}, [...s[4] ||= [o("svg", {
|
|
1673
1716
|
width: "12",
|
|
1674
1717
|
height: "12",
|
|
@@ -1676,15 +1719,15 @@ var ft = ["data-vdd-slot"], pt = /* @__PURE__ */ u({
|
|
|
1676
1719
|
fill: "none",
|
|
1677
1720
|
stroke: "currentColor",
|
|
1678
1721
|
"stroke-width": "2.5"
|
|
1679
|
-
}, [o("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]], 8,
|
|
1722
|
+
}, [o("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]], 8, Tt)])) : i("", !0)]), o("div", Et, [z(l)?.dragging.value ? (T(), r(_t, {
|
|
1680
1723
|
key: 0,
|
|
1681
1724
|
"leaf-id": t.leaf.id
|
|
1682
1725
|
}, null, 8, ["leaf-id"])) : i("", !0), p.value ? (T(), r(pt, {
|
|
1683
1726
|
key: p.value,
|
|
1684
1727
|
"panel-id": p.value
|
|
1685
|
-
}, null, 8, ["panel-id"])) : (T(), a("div",
|
|
1728
|
+
}, null, 8, ["panel-id"])) : (T(), a("div", Dt, [o("span", null, I(z(c).format(z(c).messages.emptyGroup)), 1)]))])], 40, vt));
|
|
1686
1729
|
}
|
|
1687
|
-
}),
|
|
1730
|
+
}), kt = ["data-vdd-divider", "onPointerdown"], At = /* @__PURE__ */ u({
|
|
1688
1731
|
__name: "VddWorkspaceGrid",
|
|
1689
1732
|
props: {
|
|
1690
1733
|
node: {},
|
|
@@ -1717,7 +1760,7 @@ var ft = ["data-vdd-slot"], pt = /* @__PURE__ */ u({
|
|
|
1717
1760
|
}
|
|
1718
1761
|
return (n, s) => {
|
|
1719
1762
|
let c = M("VddWorkspaceGrid", !0);
|
|
1720
|
-
return t.node.type === "leaf" ? (T(), r(
|
|
1763
|
+
return t.node.type === "leaf" ? (T(), r(Ot, {
|
|
1721
1764
|
key: 0,
|
|
1722
1765
|
leaf: t.node
|
|
1723
1766
|
}, null, 8, ["leaf"])) : (T(), a("div", {
|
|
@@ -1752,16 +1795,16 @@ var ft = ["data-vdd-slot"], pt = /* @__PURE__ */ u({
|
|
|
1752
1795
|
zIndex: 20
|
|
1753
1796
|
}),
|
|
1754
1797
|
onPointerdown: (e) => d(r, e)
|
|
1755
|
-
}, null, 44,
|
|
1798
|
+
}, null, 44, kt)) : i("", !0)], 64))), 128))], 6));
|
|
1756
1799
|
};
|
|
1757
1800
|
}
|
|
1758
|
-
}),
|
|
1759
|
-
function
|
|
1760
|
-
E(
|
|
1801
|
+
}), jt = Symbol("vdd-panel");
|
|
1802
|
+
function Mt(e) {
|
|
1803
|
+
E(jt, e);
|
|
1761
1804
|
}
|
|
1762
|
-
var
|
|
1763
|
-
function
|
|
1764
|
-
let e = p(
|
|
1805
|
+
var Nt = "standalone";
|
|
1806
|
+
function Pt() {
|
|
1807
|
+
let e = p(jt, null), t = p(Ue, null), r = e?.id ?? Nt, i = (e) => {
|
|
1765
1808
|
process.env.NODE_ENV !== "production" && console.warn(`[vue-dockable-desktop] usePanel().${e} was called outside a panel container, so it did nothing. This is expected when a panel component is rendered standalone.`);
|
|
1766
1809
|
}, a = (e, t) => {
|
|
1767
1810
|
process.env.NODE_ENV !== "production" && console.warn(`[vue-dockable-desktop] usePanel().${e} did nothing: ${t}`);
|
|
@@ -1772,7 +1815,7 @@ function Ft() {
|
|
|
1772
1815
|
isActive: n(() => !!t && t.state.activePanelId === r),
|
|
1773
1816
|
isMinimized: n(() => o.value?.state === "minimized"),
|
|
1774
1817
|
isFloating: n(() => o.value?.state === "floating"),
|
|
1775
|
-
containerType: n(() => e?.containerType.value ??
|
|
1818
|
+
containerType: n(() => e?.containerType.value ?? Nt),
|
|
1776
1819
|
size: n(() => (e?.size ?? s).value),
|
|
1777
1820
|
dirty: n(() => e?.dirty ? e.dirty.value : o.value?.dirty === !0),
|
|
1778
1821
|
setTitle: (n) => {
|
|
@@ -1816,10 +1859,10 @@ function Ft() {
|
|
|
1816
1859
|
}
|
|
1817
1860
|
//#endregion
|
|
1818
1861
|
//#region src/components/VddPanelMount.vue?vue&type=script&setup=true&lang.ts
|
|
1819
|
-
var
|
|
1862
|
+
var Ft = ["dir"], It = {
|
|
1820
1863
|
key: 1,
|
|
1821
1864
|
class: "vdd-unregistered-panel"
|
|
1822
|
-
},
|
|
1865
|
+
}, Lt = /* @__PURE__ */ u({
|
|
1823
1866
|
__name: "VddPanelMount",
|
|
1824
1867
|
props: {
|
|
1825
1868
|
panelId: {},
|
|
@@ -1830,13 +1873,13 @@ var It = ["dir"], Lt = {
|
|
|
1830
1873
|
let e = c.value;
|
|
1831
1874
|
return e && (e.state === "minimized" ? e.previousState ?? "docked" : e.state) === "floating" ? "floating-window" : "dockable-panel";
|
|
1832
1875
|
}), d = k(null);
|
|
1833
|
-
|
|
1876
|
+
Mt({
|
|
1834
1877
|
id: i.panelId,
|
|
1835
1878
|
containerType: u,
|
|
1836
1879
|
size: d
|
|
1837
1880
|
});
|
|
1838
1881
|
let f = n(() => i.cache.elementFor(i.panelId)), p = null;
|
|
1839
|
-
return
|
|
1882
|
+
return W((e) => {
|
|
1840
1883
|
let t = f.value;
|
|
1841
1884
|
typeof ResizeObserver > "u" || (p = new ResizeObserver((e) => {
|
|
1842
1885
|
for (let t of e) {
|
|
@@ -1855,18 +1898,18 @@ var It = ["dir"], Lt = {
|
|
|
1855
1898
|
}), (n, i) => (T(), r(t, { to: f.value }, [o("div", {
|
|
1856
1899
|
class: "vdd-panel-content",
|
|
1857
1900
|
dir: z(s).state.dir
|
|
1858
|
-
}, [l.value ? (T(), r(N(l.value.component), _({ key: 0 }, c.value?.props ?? {}, { "panel-id": e.panelId }), null, 16, ["panel-id"])) : (T(), a("div",
|
|
1901
|
+
}, [l.value ? (T(), r(N(l.value.component), _({ key: 0 }, c.value?.props ?? {}, { "panel-id": e.panelId }), null, 16, ["panel-id"])) : (T(), a("div", It, [i[0] ||= o("strong", null, "Unregistered panel", -1), o("span", null, "No component is registered for key \"" + I(c.value?.component) + "\".", 1)]))], 8, Ft)], 8, ["to"]));
|
|
1859
1902
|
}
|
|
1860
|
-
}),
|
|
1903
|
+
}), Rt = ["data-vdd-window", "dir"], zt = ["data-vdd-titlebar"], Bt = { class: "vdd-floating-window-title" }, Vt = {
|
|
1861
1904
|
key: 0,
|
|
1862
1905
|
class: "vdd-window-title-icon"
|
|
1863
|
-
},
|
|
1906
|
+
}, Ht = ["data-vdd-more", "title"], Ut = {
|
|
1864
1907
|
width: "14",
|
|
1865
1908
|
height: "14",
|
|
1866
1909
|
viewBox: "0 0 24 24",
|
|
1867
1910
|
fill: "currentColor",
|
|
1868
1911
|
style: { display: "block" }
|
|
1869
|
-
},
|
|
1912
|
+
}, Wt = ["data-vdd-maximize", "title"], Gt = ["data-vdd-minimize", "title"], Kt = ["data-vdd-close-window", "title"], qt = ["data-vdd-handle", "onPointerdown"], Jt = 8, Yt = 8, Xt = /* @__PURE__ */ u({
|
|
1870
1913
|
__name: "VddFloatingWindow",
|
|
1871
1914
|
props: {
|
|
1872
1915
|
window: {},
|
|
@@ -1884,10 +1927,10 @@ var It = ["dir"], Lt = {
|
|
|
1884
1927
|
"nw"
|
|
1885
1928
|
], f = n(() => c.state.panels[s.window.id]), p = n(() => f.value ? c.registry.get(f.value.component)?.defaultOptions ?? {} : {}), m = n(() => c.state.activePanelId === s.window.id), h = n(() => c.state.draggedPanelId === s.window.id), g = (e) => typeof e == "number" ? `${e}px` : e, _ = n(() => c.state.floating.filter((e) => e.anchor === s.window.anchor && !e.maximized)), v = n(() => {
|
|
1886
1929
|
if (!s.window.anchor) return 0;
|
|
1887
|
-
let e = _.value.findIndex((e) => e.id === s.window.id), t =
|
|
1930
|
+
let e = _.value.findIndex((e) => e.id === s.window.id), t = Jt;
|
|
1888
1931
|
for (let n = 0; n < e; n++) {
|
|
1889
1932
|
let e = _.value[n].height;
|
|
1890
|
-
t += (typeof e == "number" ? e : Number.parseFloat(String(e))) +
|
|
1933
|
+
t += (typeof e == "number" ? e : Number.parseFloat(String(e))) + Yt;
|
|
1891
1934
|
}
|
|
1892
1935
|
return t;
|
|
1893
1936
|
}), b = n(() => {
|
|
@@ -1907,7 +1950,7 @@ var It = ["dir"], Lt = {
|
|
|
1907
1950
|
let n = e.anchor.startsWith("top"), r = e.anchor.endsWith("-right");
|
|
1908
1951
|
return {
|
|
1909
1952
|
...t,
|
|
1910
|
-
[r ? "insetInlineEnd" : "insetInlineStart"]: `${
|
|
1953
|
+
[r ? "insetInlineEnd" : "insetInlineStart"]: `${Jt}px`,
|
|
1911
1954
|
[n ? "top" : "bottom"]: `${v.value}px`,
|
|
1912
1955
|
width: g(e.width),
|
|
1913
1956
|
height: g(e.height),
|
|
@@ -2013,11 +2056,11 @@ var It = ["dir"], Lt = {
|
|
|
2013
2056
|
"data-vdd-titlebar": t.window.id,
|
|
2014
2057
|
style: x({ cursor: t.window.maximized || p.value.canDrag === !1 ? "default" : "move" }),
|
|
2015
2058
|
onPointerdown: w,
|
|
2016
|
-
onContextmenu: s[5] ||=
|
|
2059
|
+
onContextmenu: s[5] ||= K((e) => C(e), ["prevent"]),
|
|
2017
2060
|
onDblclick: s[6] ||= (e) => z(c).maximizePanel(t.window.id)
|
|
2018
|
-
}, [o("span",
|
|
2061
|
+
}, [o("span", Bt, [p.value.icon ? (T(), a("span", Vt, [(T(), r(N(p.value.icon)))])) : i("", !0), o("span", null, I(z(c).format(f.value.title)) + I(f.value.dirty ? " *" : ""), 1)]), o("div", {
|
|
2019
2062
|
class: "vdd-titlebar-actions",
|
|
2020
|
-
onPointerdown: s[4] ||=
|
|
2063
|
+
onPointerdown: s[4] ||= K(() => {}, ["stop"])
|
|
2021
2064
|
}, [
|
|
2022
2065
|
S.value.length > 0 ? (T(), a("button", {
|
|
2023
2066
|
key: 0,
|
|
@@ -2026,7 +2069,7 @@ var It = ["dir"], Lt = {
|
|
|
2026
2069
|
"data-vdd-more": t.window.id,
|
|
2027
2070
|
title: z(c).format(z(c).messages.moreActions),
|
|
2028
2071
|
onClick: s[0] ||= (e) => C(e, !0)
|
|
2029
|
-
}, [(T(), a("svg",
|
|
2072
|
+
}, [(T(), a("svg", Ut, [...s[8] ||= [
|
|
2030
2073
|
o("circle", {
|
|
2031
2074
|
cx: "12",
|
|
2032
2075
|
cy: "5",
|
|
@@ -2042,7 +2085,7 @@ var It = ["dir"], Lt = {
|
|
|
2042
2085
|
cy: "19",
|
|
2043
2086
|
r: "2"
|
|
2044
2087
|
}, null, -1)
|
|
2045
|
-
]]))], 8,
|
|
2088
|
+
]]))], 8, Ht)) : i("", !0),
|
|
2046
2089
|
o("button", {
|
|
2047
2090
|
type: "button",
|
|
2048
2091
|
class: "vdd-custom-tab-btn vdd-btn-maximize-tab",
|
|
@@ -2062,7 +2105,7 @@ var It = ["dir"], Lt = {
|
|
|
2062
2105
|
width: "16",
|
|
2063
2106
|
height: "16",
|
|
2064
2107
|
rx: "1.5"
|
|
2065
|
-
})], -1)]], 8,
|
|
2108
|
+
})], -1)]], 8, Wt),
|
|
2066
2109
|
p.value.canMinimize === !1 ? i("", !0) : (T(), a("button", {
|
|
2067
2110
|
key: 1,
|
|
2068
2111
|
type: "button",
|
|
@@ -2077,7 +2120,7 @@ var It = ["dir"], Lt = {
|
|
|
2077
2120
|
fill: "none",
|
|
2078
2121
|
stroke: "currentColor",
|
|
2079
2122
|
"stroke-width": "3"
|
|
2080
|
-
}, [o("path", { d: "M5 12h14" })], -1)]], 8,
|
|
2123
|
+
}, [o("path", { d: "M5 12h14" })], -1)]], 8, Gt)),
|
|
2081
2124
|
p.value.canClose === !1 ? i("", !0) : (T(), a("button", {
|
|
2082
2125
|
key: 2,
|
|
2083
2126
|
type: "button",
|
|
@@ -2092,18 +2135,18 @@ var It = ["dir"], Lt = {
|
|
|
2092
2135
|
fill: "none",
|
|
2093
2136
|
stroke: "currentColor",
|
|
2094
2137
|
"stroke-width": "3"
|
|
2095
|
-
}, [o("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]], 8,
|
|
2096
|
-
], 32)], 44,
|
|
2138
|
+
}, [o("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]], 8, Kt))
|
|
2139
|
+
], 32)], 44, zt),
|
|
2097
2140
|
o("div", { class: y(["vdd-floating-window-body", z(c).classes.windowBody]) }, [l(pt, { "panel-id": t.window.id }, null, 8, ["panel-id"])], 2),
|
|
2098
2141
|
t.window.maximized ? i("", !0) : (T(), a(e, { key: 0 }, A(d, (e) => o("div", {
|
|
2099
2142
|
key: e,
|
|
2100
2143
|
class: y(["vdd-resize-handle", `vdd-resize-${e}`]),
|
|
2101
2144
|
"data-vdd-handle": `${t.window.id}:${e}`,
|
|
2102
2145
|
onPointerdown: (t) => E(e, t)
|
|
2103
|
-
}, null, 42,
|
|
2104
|
-
], 46,
|
|
2146
|
+
}, null, 42, qt)), 64))
|
|
2147
|
+
], 46, Rt)) : i("", !0);
|
|
2105
2148
|
}
|
|
2106
|
-
}),
|
|
2149
|
+
}), Zt = ["data-vdd-edge", "onPointerenter"], Qt = ["data-vdd-corner", "onPointerenter"], $t = /* @__PURE__ */ u({
|
|
2107
2150
|
__name: "VddEdgeZones",
|
|
2108
2151
|
setup(t) {
|
|
2109
2152
|
let r = ot(), s = Y(), c = [
|
|
@@ -2154,7 +2197,7 @@ var It = ["dir"], Lt = {
|
|
|
2154
2197
|
"data-vdd-edge": e,
|
|
2155
2198
|
onPointerenter: (t) => z(r)?.hoverEdge(e),
|
|
2156
2199
|
onPointerleave: n[0] ||= (e) => z(r)?.hoverEdge(null)
|
|
2157
|
-
}, null, 42,
|
|
2200
|
+
}, null, 42, Zt)), 64)),
|
|
2158
2201
|
(T(), a(e, null, A(l, (e) => o("div", {
|
|
2159
2202
|
key: e,
|
|
2160
2203
|
class: y(["vdd-corner-zone", [`vdd-corner-zone--${e}`, { "vdd-corner-zone--hovered": z(r)?.corner.value === e }]]),
|
|
@@ -2162,7 +2205,7 @@ var It = ["dir"], Lt = {
|
|
|
2162
2205
|
"aria-hidden": "true",
|
|
2163
2206
|
onPointerenter: (t) => z(r)?.hoverCorner(e),
|
|
2164
2207
|
onPointerleave: n[1] ||= (e) => z(r)?.hoverCorner(null)
|
|
2165
|
-
}, null, 42,
|
|
2208
|
+
}, null, 42, Qt)), 64)),
|
|
2166
2209
|
u.value ? (T(), a("div", {
|
|
2167
2210
|
key: 0,
|
|
2168
2211
|
class: "vdd-workspace-edge-preview",
|
|
@@ -2170,7 +2213,7 @@ var It = ["dir"], Lt = {
|
|
|
2170
2213
|
}, null, 4)) : i("", !0)
|
|
2171
2214
|
], 64));
|
|
2172
2215
|
}
|
|
2173
|
-
}),
|
|
2216
|
+
}), en = /* @__PURE__ */ u({
|
|
2174
2217
|
__name: "VddDragGhost",
|
|
2175
2218
|
setup(e) {
|
|
2176
2219
|
let t = ot(), r = Y(), o = n(() => {
|
|
@@ -2189,10 +2232,10 @@ var It = ["dir"], Lt = {
|
|
|
2189
2232
|
})
|
|
2190
2233
|
}, I(o.value), 5)) : i("", !0);
|
|
2191
2234
|
}
|
|
2192
|
-
}),
|
|
2235
|
+
}), tn = ["dir"], nn = { class: "vdd-tooltip-header-row" }, rn = { class: "vdd-tooltip-title-text vdd-text-truncate" }, an = ["data-vdd-preview-close", "title"], on = {
|
|
2193
2236
|
key: 1,
|
|
2194
2237
|
class: "vdd-taskbar-item-preview-letter"
|
|
2195
|
-
},
|
|
2238
|
+
}, sn = 220, cn = 140, ln = /* @__PURE__ */ u({
|
|
2196
2239
|
__name: "VddTaskbarPreview",
|
|
2197
2240
|
props: {
|
|
2198
2241
|
panelId: {},
|
|
@@ -2206,7 +2249,7 @@ var It = ["dir"], Lt = {
|
|
|
2206
2249
|
"keep"
|
|
2207
2250
|
],
|
|
2208
2251
|
setup(e, { emit: i }) {
|
|
2209
|
-
let s = e, c = i, l = Y(), u = n(() => l.state.panels[s.panelId]), d = n(() => u.value ? l.registry.get(u.value.component)?.defaultOptions ?? {} : {}), f = n(() => d.value.disableLivePreview !== !0), p = n(() => s.cache.sizeOf(s.panelId)), m = n(() => Math.min(
|
|
2252
|
+
let s = e, c = i, l = Y(), u = n(() => l.state.panels[s.panelId]), d = n(() => u.value ? l.registry.get(u.value.component)?.defaultOptions ?? {} : {}), f = n(() => d.value.disableLivePreview !== !0), p = n(() => s.cache.sizeOf(s.panelId)), m = n(() => Math.min(sn / p.value.width, cn / p.value.height)), h = n(() => ({
|
|
2210
2253
|
width: `${Math.round(p.value.width * m.value)}px`,
|
|
2211
2254
|
height: `${Math.round(p.value.height * m.value)}px`
|
|
2212
2255
|
})), g = n(() => ({
|
|
@@ -2251,11 +2294,12 @@ var It = ["dir"], Lt = {
|
|
|
2251
2294
|
onClick: i[1] ||= (e) => c("restore"),
|
|
2252
2295
|
onPointerenter: i[2] ||= (e) => c("keep"),
|
|
2253
2296
|
onPointerleave: i[3] ||= (e) => c("dismiss")
|
|
2254
|
-
}, [o("div",
|
|
2297
|
+
}, [o("div", nn, [o("span", rn, I(z(l).format(u.value?.title)) + I(u.value?.dirty ? " *" : ""), 1), o("span", {
|
|
2255
2298
|
class: "vdd-tooltip-close-x",
|
|
2299
|
+
"aria-hidden": "true",
|
|
2256
2300
|
"data-vdd-preview-close": e.panelId,
|
|
2257
2301
|
title: z(l).format(z(l).messages.closePanel),
|
|
2258
|
-
onClick: i[0] ||=
|
|
2302
|
+
onClick: i[0] ||= K((e) => c("close"), ["stop"])
|
|
2259
2303
|
}, [...i[4] ||= [o("svg", {
|
|
2260
2304
|
width: "12",
|
|
2261
2305
|
height: "12",
|
|
@@ -2263,7 +2307,7 @@ var It = ["dir"], Lt = {
|
|
|
2263
2307
|
fill: "none",
|
|
2264
2308
|
stroke: "currentColor",
|
|
2265
2309
|
"stroke-width": "2.5"
|
|
2266
|
-
}, [o("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]], 8,
|
|
2310
|
+
}, [o("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]], 8, an)]), o("div", {
|
|
2267
2311
|
class: "vdd-taskbar-item-preview-frame",
|
|
2268
2312
|
style: x(h.value)
|
|
2269
2313
|
}, [f.value ? (T(), a("div", {
|
|
@@ -2271,20 +2315,20 @@ var It = ["dir"], Lt = {
|
|
|
2271
2315
|
ref: y,
|
|
2272
2316
|
class: "vdd-taskbar-item-preview-host",
|
|
2273
2317
|
style: x(g.value)
|
|
2274
|
-
}, null, 4)) : (T(), a("div",
|
|
2318
|
+
}, null, 4)) : (T(), a("div", on, I(_.value), 1))], 4)], 44, tn)]));
|
|
2275
2319
|
}
|
|
2276
|
-
}),
|
|
2320
|
+
}), un = ["data-vdd-taskbar-mode"], dn = {
|
|
2277
2321
|
key: 0,
|
|
2278
2322
|
class: "vdd-taskbar-peek-handle",
|
|
2279
2323
|
"data-vdd-peek": ""
|
|
2280
|
-
},
|
|
2324
|
+
}, fn = ["aria-label"], pn = [
|
|
2281
2325
|
"data-vdd-taskbar-item",
|
|
2282
2326
|
"title",
|
|
2283
2327
|
"onClick",
|
|
2284
2328
|
"onContextmenu",
|
|
2285
2329
|
"onPointerdown",
|
|
2286
2330
|
"onPointerenter"
|
|
2287
|
-
],
|
|
2331
|
+
], mn = { class: "vdd-taskbar-item-icon" }, hn = {
|
|
2288
2332
|
key: 1,
|
|
2289
2333
|
width: "14",
|
|
2290
2334
|
height: "14",
|
|
@@ -2292,7 +2336,7 @@ var It = ["dir"], Lt = {
|
|
|
2292
2336
|
fill: "none",
|
|
2293
2337
|
stroke: "currentColor",
|
|
2294
2338
|
"stroke-width": "2"
|
|
2295
|
-
},
|
|
2339
|
+
}, gn = ["aria-label"], _n = 4, vn = 400, yn = 2e3, bn = /* @__PURE__ */ u({
|
|
2296
2340
|
__name: "VddTaskbar",
|
|
2297
2341
|
props: {
|
|
2298
2342
|
visibility: { default: "always" },
|
|
@@ -2304,7 +2348,7 @@ var It = ["dir"], Lt = {
|
|
|
2304
2348
|
let c = t, l = s, u = Y(), d = F(null), f = k(!1), p = k(null), m, h, g = n(() => u.state.minimized.map((e) => ({
|
|
2305
2349
|
...e,
|
|
2306
2350
|
options: u.registry.get(e.component)?.defaultOptions ?? {}
|
|
2307
|
-
}))), _ = n(() => c.visibility === "always" || g.value.length > 0), v = n(() => g.value.length >
|
|
2351
|
+
}))), _ = n(() => c.visibility === "always" || g.value.length > 0), v = n(() => g.value.length > _n);
|
|
2308
2352
|
function b(e) {
|
|
2309
2353
|
d.value?.scrollBy({
|
|
2310
2354
|
left: e * 150,
|
|
@@ -2316,12 +2360,12 @@ var It = ["dir"], Lt = {
|
|
|
2316
2360
|
}, C = () => {
|
|
2317
2361
|
clearTimeout(m), m = setTimeout(() => {
|
|
2318
2362
|
f.value = !1;
|
|
2319
|
-
},
|
|
2363
|
+
}, vn);
|
|
2320
2364
|
};
|
|
2321
2365
|
U(() => u.state.minimized.length, (e, t) => {
|
|
2322
2366
|
c.visibility !== "autohide" || e <= (t ?? 0) || (x(), m = setTimeout(() => {
|
|
2323
2367
|
f.value = !1;
|
|
2324
|
-
},
|
|
2368
|
+
}, yn));
|
|
2325
2369
|
});
|
|
2326
2370
|
let w = (e) => {
|
|
2327
2371
|
let t = e.getBoundingClientRect();
|
|
@@ -2379,7 +2423,7 @@ var It = ["dir"], Lt = {
|
|
|
2379
2423
|
onPointerenter: s[7] ||= (e) => t.visibility === "autohide" && x(),
|
|
2380
2424
|
onPointerleave: s[8] ||= (e) => t.visibility === "autohide" && C()
|
|
2381
2425
|
}, [
|
|
2382
|
-
t.visibility === "autohide" ? (T(), a("div",
|
|
2426
|
+
t.visibility === "autohide" ? (T(), a("div", dn)) : i("", !0),
|
|
2383
2427
|
v.value ? (T(), a("button", {
|
|
2384
2428
|
key: 1,
|
|
2385
2429
|
type: "button",
|
|
@@ -2387,7 +2431,7 @@ var It = ["dir"], Lt = {
|
|
|
2387
2431
|
"data-vdd-taskbar-scroll": "left",
|
|
2388
2432
|
"aria-label": z(u).format(z(u).messages.scrollTabsLeft),
|
|
2389
2433
|
onClick: s[0] ||= (e) => b(-1)
|
|
2390
|
-
}, "◀", 8,
|
|
2434
|
+
}, "◀", 8, fn)) : i("", !0),
|
|
2391
2435
|
o("div", {
|
|
2392
2436
|
ref_key: "strip",
|
|
2393
2437
|
ref: d,
|
|
@@ -2399,11 +2443,11 @@ var It = ["dir"], Lt = {
|
|
|
2399
2443
|
role: "button",
|
|
2400
2444
|
title: z(u).format(e.title),
|
|
2401
2445
|
onClick: (t) => P(e.id, t),
|
|
2402
|
-
onContextmenu:
|
|
2446
|
+
onContextmenu: K((t) => l("contextMenu", e.id, t), ["prevent"]),
|
|
2403
2447
|
onPointerdown: (t) => I(e.id, t),
|
|
2404
2448
|
onPointerenter: (t) => j(e.id, t),
|
|
2405
2449
|
onPointerleave: s[1] ||= (e) => D()
|
|
2406
|
-
}, [o("span",
|
|
2450
|
+
}, [o("span", mn, [e.options.icon ?? t.defaultIcon ? (T(), r(N(e.options.icon ?? t.defaultIcon), { key: 0 })) : (T(), a("svg", hn, [...s[9] ||= [
|
|
2407
2451
|
o("rect", {
|
|
2408
2452
|
x: "3",
|
|
2409
2453
|
y: "3",
|
|
@@ -2432,7 +2476,7 @@ var It = ["dir"], Lt = {
|
|
|
2432
2476
|
height: "5",
|
|
2433
2477
|
rx: "1"
|
|
2434
2478
|
}, null, -1)
|
|
2435
|
-
]]))])], 40,
|
|
2479
|
+
]]))])], 40, pn))), 128))], 512),
|
|
2436
2480
|
v.value ? (T(), a("button", {
|
|
2437
2481
|
key: 2,
|
|
2438
2482
|
type: "button",
|
|
@@ -2440,8 +2484,8 @@ var It = ["dir"], Lt = {
|
|
|
2440
2484
|
"data-vdd-taskbar-scroll": "right",
|
|
2441
2485
|
"aria-label": z(u).format(z(u).messages.scrollTabsRight),
|
|
2442
2486
|
onClick: s[2] ||= (e) => b(1)
|
|
2443
|
-
}, "▶", 8,
|
|
2444
|
-
p.value ? (T(), r(
|
|
2487
|
+
}, "▶", 8, gn)) : i("", !0),
|
|
2488
|
+
p.value ? (T(), r(ln, {
|
|
2445
2489
|
key: p.value.id,
|
|
2446
2490
|
"panel-id": p.value.id,
|
|
2447
2491
|
anchor: p.value.anchor,
|
|
@@ -2457,16 +2501,16 @@ var It = ["dir"], Lt = {
|
|
|
2457
2501
|
"anchor",
|
|
2458
2502
|
"cache"
|
|
2459
2503
|
])) : i("", !0)
|
|
2460
|
-
], 42,
|
|
2504
|
+
], 42, un)) : i("", !0);
|
|
2461
2505
|
}
|
|
2462
|
-
}),
|
|
2506
|
+
}), xn = [
|
|
2463
2507
|
"data-vdd-skin",
|
|
2464
2508
|
"data-color-scheme",
|
|
2465
2509
|
"dir"
|
|
2466
|
-
],
|
|
2510
|
+
], Sn = {
|
|
2467
2511
|
class: "vdd-panel-port",
|
|
2468
2512
|
"aria-hidden": "true"
|
|
2469
|
-
},
|
|
2513
|
+
}, Cn = /* @__PURE__ */ u({
|
|
2470
2514
|
__name: "VddDesktop",
|
|
2471
2515
|
props: {
|
|
2472
2516
|
skin: { default: "vscode" },
|
|
@@ -2481,36 +2525,36 @@ var It = ["dir"], Lt = {
|
|
|
2481
2525
|
setup(t, { emit: s }) {
|
|
2482
2526
|
let c = t, u = s, d = Y(), f = dt(), p = new Ye();
|
|
2483
2527
|
Ze(p);
|
|
2484
|
-
let m = at(d), h = n(() => Object.keys(d.state.panels));
|
|
2485
|
-
U(
|
|
2528
|
+
let m = at(d), h = typeof document > "u", g = n(() => h ? [] : Object.keys(d.state.panels));
|
|
2529
|
+
U(g, (e, t) => {
|
|
2486
2530
|
for (let n of t ?? []) e.includes(n) || p.release(n);
|
|
2487
2531
|
}), C(() => {
|
|
2488
2532
|
if (process.env.NODE_ENV !== "production") try {
|
|
2489
2533
|
getComputedStyle(document.documentElement).getPropertyValue("--vdd-styles-loaded").trim() !== "1" && console.error("[vue-dockable-desktop] the stylesheet is not imported.\nAdd this to your entry file (main.ts):\n import 'vue-dockable-desktop/styles.css'\nWithout it the workspace renders as a black rectangle, with no other error.");
|
|
2490
2534
|
} catch {}
|
|
2491
2535
|
});
|
|
2492
|
-
let
|
|
2536
|
+
let _ = H("viewport"), v = k({
|
|
2493
2537
|
width: 1024,
|
|
2494
2538
|
height: 768
|
|
2495
|
-
}),
|
|
2496
|
-
U(
|
|
2497
|
-
|
|
2539
|
+
}), b = null, x = !1;
|
|
2540
|
+
U(_, (e) => {
|
|
2541
|
+
b?.disconnect(), !(!e || typeof ResizeObserver > "u") && (b = new ResizeObserver((t) => {
|
|
2498
2542
|
let n = t[0]?.contentRect;
|
|
2499
|
-
if (n && (
|
|
2543
|
+
if (n && (v.value = {
|
|
2500
2544
|
width: Math.max(100, n.width),
|
|
2501
2545
|
height: Math.max(100, n.height)
|
|
2502
|
-
}, process.env.NODE_ENV !== "production" && n.height < 10 && !
|
|
2503
|
-
|
|
2546
|
+
}, process.env.NODE_ENV !== "production" && n.height < 10 && !x)) {
|
|
2547
|
+
x = !0;
|
|
2504
2548
|
let t = e, n = e.parentElement;
|
|
2505
2549
|
for (; n && n !== document.documentElement && n.getBoundingClientRect().height < 10;) t = n, n = n.parentElement;
|
|
2506
2550
|
let r = t === e ? "the workspace element itself" : `<${t.tagName.toLowerCase()}${t.id ? ` id="${t.id}"` : ""}${t.className ? ` class="${t.className}"` : ""}>`;
|
|
2507
2551
|
console.warn(`[vue-dockable-desktop] The workspace has no height, so it is invisible.\n\nZero height starts at: ${r}\n\nIn CSS, height: 100% only resolves when every ancestor has a real height. If any one of them is height: auto (a div's default), the chain breaks.\n\nGive the workspace's container a height — 100vh, or flex: 1 with min-height: 0 inside a flex column. The library deliberately does not style your page; for the simple case, the .vdd-fill-viewport class works on <VddDesktop> itself or on its container.`);
|
|
2508
2552
|
}
|
|
2509
|
-
}),
|
|
2553
|
+
}), b.observe(e));
|
|
2510
2554
|
}, {
|
|
2511
2555
|
immediate: !0,
|
|
2512
2556
|
flush: "post"
|
|
2513
|
-
}), U([
|
|
2557
|
+
}), U([v, () => d.state.floating], ([e, t]) => {
|
|
2514
2558
|
for (let n of t) {
|
|
2515
2559
|
let t = (e) => typeof e == "number" ? e : Number.parseFloat(String(e)), r = {
|
|
2516
2560
|
x: t(n.x),
|
|
@@ -2521,7 +2565,7 @@ var It = ["dir"], Lt = {
|
|
|
2521
2565
|
i !== r && d.updateFloatingPosition(n.id, i);
|
|
2522
2566
|
}
|
|
2523
2567
|
}, { deep: !0 });
|
|
2524
|
-
function
|
|
2568
|
+
function w(e, t) {
|
|
2525
2569
|
let n = d.state.panels[e];
|
|
2526
2570
|
if (n) {
|
|
2527
2571
|
let r = d.registry.get(n.component)?.defaultOptions ?? {}, i = ct(d, e, r, {
|
|
@@ -2538,7 +2582,7 @@ var It = ["dir"], Lt = {
|
|
|
2538
2582
|
}
|
|
2539
2583
|
u("taskbarContextMenu", e, t);
|
|
2540
2584
|
}
|
|
2541
|
-
let
|
|
2585
|
+
let E = () => {
|
|
2542
2586
|
let e = document.documentElement;
|
|
2543
2587
|
e.setAttribute("data-vdd-skin", c.skin), e.classList.toggle("vdd-no-animations", c.animations === !1), e.style.setProperty("--vdd-z-base", String(d.config.zIndexBase));
|
|
2544
2588
|
};
|
|
@@ -2546,8 +2590,8 @@ var It = ["dir"], Lt = {
|
|
|
2546
2590
|
c.skin,
|
|
2547
2591
|
c.animations,
|
|
2548
2592
|
d.config.zIndexBase
|
|
2549
|
-
],
|
|
2550
|
-
|
|
2593
|
+
], E), C(E), S(() => {
|
|
2594
|
+
b?.disconnect();
|
|
2551
2595
|
let e = document.documentElement;
|
|
2552
2596
|
e.removeAttribute("data-vdd-skin"), e.classList.remove("vdd-no-animations"), e.style.removeProperty("--vdd-z-base"), p.dispose();
|
|
2553
2597
|
}), (n, s) => (T(), a("div", {
|
|
@@ -2558,58 +2602,59 @@ var It = ["dir"], Lt = {
|
|
|
2558
2602
|
}, [
|
|
2559
2603
|
o("div", {
|
|
2560
2604
|
ref_key: "viewport",
|
|
2561
|
-
ref:
|
|
2605
|
+
ref: v,
|
|
2562
2606
|
class: "vdd-workspace-viewport"
|
|
2563
2607
|
}, [
|
|
2564
|
-
z(m).dragging.value ? (T(), r(
|
|
2565
|
-
l(
|
|
2608
|
+
z(m).dragging.value ? (T(), r($t, { key: 0 })) : i("", !0),
|
|
2609
|
+
l(At, {
|
|
2566
2610
|
node: z(d).state.gridRoot,
|
|
2567
2611
|
path: []
|
|
2568
2612
|
}, null, 8, ["node"]),
|
|
2569
|
-
(T(!0), a(e, null, A(z(d).state.floating, (e) => (T(), r(
|
|
2613
|
+
(T(!0), a(e, null, A(z(d).state.floating, (e) => (T(), r(Xt, {
|
|
2570
2614
|
key: e.id,
|
|
2571
2615
|
window: e,
|
|
2572
|
-
viewport:
|
|
2616
|
+
viewport: v.value
|
|
2573
2617
|
}, null, 8, ["window", "viewport"]))), 128))
|
|
2574
2618
|
], 512),
|
|
2575
|
-
l(
|
|
2619
|
+
l(bn, {
|
|
2576
2620
|
visibility: t.taskbar,
|
|
2577
2621
|
cache: z(p),
|
|
2578
2622
|
"default-icon": t.defaultPanelIcon,
|
|
2579
|
-
onContextMenu:
|
|
2623
|
+
onContextMenu: w
|
|
2580
2624
|
}, null, 8, [
|
|
2581
2625
|
"visibility",
|
|
2582
2626
|
"cache",
|
|
2583
2627
|
"default-icon"
|
|
2584
2628
|
]),
|
|
2585
|
-
l(
|
|
2586
|
-
o("div",
|
|
2629
|
+
l(en),
|
|
2630
|
+
o("div", Sn, [(T(!0), a(e, null, A(g.value, (e) => (T(), r(Lt, {
|
|
2587
2631
|
key: e,
|
|
2588
2632
|
"panel-id": e,
|
|
2589
2633
|
cache: z(p)
|
|
2590
2634
|
}, null, 8, ["panel-id", "cache"]))), 128))])
|
|
2591
|
-
], 10,
|
|
2635
|
+
], 10, xn));
|
|
2592
2636
|
}
|
|
2593
|
-
}),
|
|
2594
|
-
function
|
|
2595
|
-
|
|
2637
|
+
}), wn = /* @__PURE__ */ new WeakSet();
|
|
2638
|
+
function Tn(e) {
|
|
2639
|
+
wn.add(e), e.preventDefault();
|
|
2596
2640
|
}
|
|
2597
|
-
function
|
|
2598
|
-
return e.defaultPrevented ||
|
|
2641
|
+
function En(e) {
|
|
2642
|
+
return e.defaultPrevented || wn.has(e);
|
|
2599
2643
|
}
|
|
2600
2644
|
//#endregion
|
|
2601
2645
|
//#region src/components/VddContextMenu.vue?vue&type=script&setup=true&lang.ts
|
|
2602
|
-
var
|
|
2646
|
+
var Dn = ["dir"], On = {
|
|
2603
2647
|
key: 0,
|
|
2604
2648
|
class: "vdd-context-menu__separator",
|
|
2605
2649
|
role: "separator"
|
|
2606
|
-
},
|
|
2650
|
+
}, kn = [
|
|
2607
2651
|
"title",
|
|
2608
2652
|
"data-vdd-menu-submenu",
|
|
2609
2653
|
"aria-expanded",
|
|
2654
|
+
"onClick",
|
|
2610
2655
|
"onPointerenter",
|
|
2611
2656
|
"onPointerleave"
|
|
2612
|
-
],
|
|
2657
|
+
], An = { class: "vdd-context-menu__label" }, jn = [
|
|
2613
2658
|
"disabled",
|
|
2614
2659
|
"title",
|
|
2615
2660
|
"data-cy-action",
|
|
@@ -2619,27 +2664,27 @@ var On = ["dir"], kn = {
|
|
|
2619
2664
|
"onClick",
|
|
2620
2665
|
"onPointerenter",
|
|
2621
2666
|
"onPointerleave"
|
|
2622
|
-
],
|
|
2667
|
+
], Mn = ["aria-hidden"], Nn = { class: "vdd-context-menu__label" }, Pn = {
|
|
2623
2668
|
width: "12",
|
|
2624
2669
|
height: "12",
|
|
2625
2670
|
viewBox: "0 0 12 12",
|
|
2626
2671
|
fill: "none"
|
|
2627
|
-
},
|
|
2672
|
+
}, Fn = ["fill"], In = {
|
|
2628
2673
|
key: 0,
|
|
2629
2674
|
d: "M2.5 6 L4.5 8.5 L9.5 3.5",
|
|
2630
2675
|
stroke: "white",
|
|
2631
2676
|
"stroke-width": "1.5",
|
|
2632
2677
|
"stroke-linecap": "round",
|
|
2633
2678
|
"stroke-linejoin": "round"
|
|
2634
|
-
},
|
|
2679
|
+
}, Ln = ["dir"], Rn = {
|
|
2635
2680
|
key: 0,
|
|
2636
2681
|
class: "vdd-context-menu__separator",
|
|
2637
2682
|
role: "separator"
|
|
2638
|
-
},
|
|
2683
|
+
}, zn = [
|
|
2639
2684
|
"disabled",
|
|
2640
2685
|
"data-vdd-menu-item",
|
|
2641
2686
|
"onClick"
|
|
2642
|
-
],
|
|
2687
|
+
], Bn = ["aria-hidden"], Vn = { class: "vdd-context-menu__label" }, Hn = 150, Un = 200, Wn = /* @__PURE__ */ u({
|
|
2643
2688
|
__name: "VddContextMenu",
|
|
2644
2689
|
props: { theme: { default: "dark" } },
|
|
2645
2690
|
setup(s) {
|
|
@@ -2651,16 +2696,16 @@ var On = ["dir"], kn = {
|
|
|
2651
2696
|
y: 0
|
|
2652
2697
|
}), g = /* @__PURE__ */ new Map(), _, b, C = () => {
|
|
2653
2698
|
clearTimeout(_), clearTimeout(b);
|
|
2654
|
-
};
|
|
2655
|
-
function
|
|
2656
|
-
C(), m.value = null, c.closeContextMenu();
|
|
2699
|
+
}, w = null;
|
|
2700
|
+
function E(e = !1) {
|
|
2701
|
+
C(), m.value = null, c.closeContextMenu(), e && w?.isConnected && w.focus({ preventScroll: !0 }), w = null;
|
|
2657
2702
|
}
|
|
2658
2703
|
U(f, async (e) => {
|
|
2659
2704
|
if (!e) {
|
|
2660
2705
|
m.value = null;
|
|
2661
2706
|
return;
|
|
2662
2707
|
}
|
|
2663
|
-
p.value = {
|
|
2708
|
+
w = document.activeElement instanceof HTMLElement ? document.activeElement : null, p.value = {
|
|
2664
2709
|
x: e.x,
|
|
2665
2710
|
y: e.y
|
|
2666
2711
|
}, g.clear(), m.value = null, await v();
|
|
@@ -2676,64 +2721,80 @@ var On = ["dir"], kn = {
|
|
|
2676
2721
|
}, {
|
|
2677
2722
|
width: window.innerWidth,
|
|
2678
2723
|
height: window.innerHeight
|
|
2679
|
-
});
|
|
2680
|
-
})
|
|
2681
|
-
|
|
2724
|
+
}), D(t)[0]?.focus({ preventScroll: !0 });
|
|
2725
|
+
});
|
|
2726
|
+
let D = (e) => Array.from(e.querySelectorAll("button[role^=\"menuitem\"]:not(:disabled)"));
|
|
2727
|
+
function O(e) {
|
|
2728
|
+
if (e.key === "Tab") {
|
|
2729
|
+
E(!0);
|
|
2730
|
+
return;
|
|
2731
|
+
}
|
|
2732
|
+
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
2733
|
+
e.preventDefault();
|
|
2734
|
+
let t = D(e.currentTarget);
|
|
2735
|
+
t.length !== 0 && t[(t.indexOf(document.activeElement) + (e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length].focus({ preventScroll: !0 });
|
|
2736
|
+
}
|
|
2737
|
+
U(f, (e) => {
|
|
2738
|
+
e ? (document.addEventListener("pointerdown", M, { capture: !0 }), window.addEventListener("click", M), document.addEventListener("keydown", P, { capture: !0 })) : (document.removeEventListener("pointerdown", M, { capture: !0 }), window.removeEventListener("click", M), document.removeEventListener("keydown", P, { capture: !0 }));
|
|
2682
2739
|
});
|
|
2683
|
-
function
|
|
2740
|
+
function M(e) {
|
|
2684
2741
|
let t = e.target;
|
|
2685
2742
|
if (!(t instanceof Node)) {
|
|
2686
|
-
|
|
2743
|
+
E();
|
|
2687
2744
|
return;
|
|
2688
2745
|
}
|
|
2689
|
-
l.value?.contains(t) || u.value?.contains(t) || d.value?.contains(t) ||
|
|
2746
|
+
l.value?.contains(t) || u.value?.contains(t) || d.value?.contains(t) || E();
|
|
2690
2747
|
}
|
|
2691
|
-
function
|
|
2692
|
-
e.key === "Escape" && !
|
|
2748
|
+
function P(e) {
|
|
2749
|
+
e.key === "Escape" && !En(e) && (Tn(e), E(!0));
|
|
2693
2750
|
}
|
|
2694
2751
|
S(() => {
|
|
2695
|
-
C(), document.removeEventListener("pointerdown",
|
|
2752
|
+
C(), document.removeEventListener("pointerdown", M, { capture: !0 }), window.removeEventListener("click", M), document.removeEventListener("keydown", P, { capture: !0 });
|
|
2696
2753
|
});
|
|
2697
|
-
let
|
|
2698
|
-
let t =
|
|
2754
|
+
let F = (e) => e, L = (e) => {
|
|
2755
|
+
let t = F(e).checkbox;
|
|
2699
2756
|
return !!t && t.active !== !1;
|
|
2700
|
-
},
|
|
2701
|
-
function
|
|
2757
|
+
}, R = (e) => L(e) && F(e).checkbox.value === !0, B = (e) => F(e).disabled === !0 || L(e) && F(e).checkbox.enabled === !1;
|
|
2758
|
+
function V(e, t) {
|
|
2702
2759
|
let n = t;
|
|
2703
2760
|
n ? g.set(e, n) : g.delete(e);
|
|
2704
2761
|
}
|
|
2705
|
-
function
|
|
2706
|
-
|
|
2762
|
+
function ee(e) {
|
|
2763
|
+
B(e) || (F(e).action?.(), E(!0));
|
|
2707
2764
|
}
|
|
2708
|
-
function
|
|
2709
|
-
clearTimeout(b), m.value !== null && m.value !== e && (clearTimeout(_), m.value = null),
|
|
2710
|
-
let t = g.get(e);
|
|
2711
|
-
if (t) {
|
|
2712
|
-
let e = t.getBoundingClientRect();
|
|
2713
|
-
h.value = c.state.isRtl ? {
|
|
2714
|
-
x: window.innerWidth - e.left + 2,
|
|
2715
|
-
y: e.top
|
|
2716
|
-
} : {
|
|
2717
|
-
x: e.right + 2,
|
|
2718
|
-
y: e.top
|
|
2719
|
-
};
|
|
2720
|
-
}
|
|
2721
|
-
m.value = e;
|
|
2722
|
-
}, Un)) : (clearTimeout(_), m.value !== null && (b = setTimeout(() => {
|
|
2765
|
+
function W(e, t) {
|
|
2766
|
+
clearTimeout(b), m.value !== null && m.value !== e && (clearTimeout(_), m.value = null), Oe(t) && t.items?.length ? (clearTimeout(_), _ = setTimeout(() => G(e), Hn)) : (clearTimeout(_), m.value !== null && (b = setTimeout(() => {
|
|
2723
2767
|
m.value = null;
|
|
2724
|
-
},
|
|
2768
|
+
}, Un)));
|
|
2725
2769
|
}
|
|
2726
|
-
function
|
|
2727
|
-
|
|
2770
|
+
function G(e) {
|
|
2771
|
+
let t = g.get(e);
|
|
2772
|
+
if (t) {
|
|
2773
|
+
let e = t.getBoundingClientRect();
|
|
2774
|
+
h.value = c.state.isRtl ? {
|
|
2775
|
+
x: window.innerWidth - e.left + 2,
|
|
2776
|
+
y: e.top
|
|
2777
|
+
} : {
|
|
2778
|
+
x: e.right + 2,
|
|
2779
|
+
y: e.top
|
|
2780
|
+
};
|
|
2781
|
+
}
|
|
2782
|
+
m.value = e;
|
|
2783
|
+
}
|
|
2784
|
+
function te(e) {
|
|
2785
|
+
C(), G(e);
|
|
2786
|
+
}
|
|
2787
|
+
function ne(e) {
|
|
2788
|
+
clearTimeout(_), Oe(e) && e.items?.length && (b = setTimeout(() => {
|
|
2728
2789
|
m.value = null;
|
|
2729
|
-
},
|
|
2790
|
+
}, Un));
|
|
2730
2791
|
}
|
|
2731
|
-
let
|
|
2792
|
+
let K = n(() => {
|
|
2732
2793
|
let e = m.value;
|
|
2733
2794
|
if (e === null || !f.value) return [];
|
|
2734
2795
|
let t = f.value.items[e];
|
|
2735
|
-
return t &&
|
|
2736
|
-
}),
|
|
2796
|
+
return t && Oe(t) ? t.items ?? [] : [];
|
|
2797
|
+
}), re = n(() => c.state.isRtl ? {
|
|
2737
2798
|
position: "fixed",
|
|
2738
2799
|
right: `${h.value.x}px`,
|
|
2739
2800
|
top: `${h.value.y}px`
|
|
@@ -2755,7 +2816,7 @@ var On = ["dir"], kn = {
|
|
|
2755
2816
|
items: f.value.items,
|
|
2756
2817
|
x: p.value.x,
|
|
2757
2818
|
y: p.value.y,
|
|
2758
|
-
close:
|
|
2819
|
+
close: E
|
|
2759
2820
|
})], 512)) : (T(), a("div", {
|
|
2760
2821
|
key: 1,
|
|
2761
2822
|
ref_key: "root",
|
|
@@ -2769,109 +2830,115 @@ var On = ["dir"], kn = {
|
|
|
2769
2830
|
dir: z(c).state.dir,
|
|
2770
2831
|
"data-vdd-menu": "",
|
|
2771
2832
|
role: "menu",
|
|
2772
|
-
"aria-orientation": "vertical"
|
|
2773
|
-
|
|
2833
|
+
"aria-orientation": "vertical",
|
|
2834
|
+
onKeydown: O
|
|
2835
|
+
}, [(T(!0), a(e, null, A(f.value.items, (t, n) => (T(), a(e, { key: n }, [z(De)(t) ? (T(), a("hr", On)) : z(Oe)(t) ? (T(), a("button", {
|
|
2774
2836
|
key: 1,
|
|
2775
2837
|
ref_for: !0,
|
|
2776
|
-
ref: (e) =>
|
|
2838
|
+
ref: (e) => V(n, e),
|
|
2777
2839
|
type: "button",
|
|
2778
2840
|
class: y(["vdd-context-menu__item vdd-context-menu__item--has-submenu", { "vdd-context-menu__item--submenu-open": m.value === n }]),
|
|
2779
2841
|
title: t.title ? z(c).format(t.title) : void 0,
|
|
2780
2842
|
"data-vdd-menu-submenu": z(c).format(t.label),
|
|
2781
2843
|
role: "menuitem",
|
|
2782
|
-
|
|
2844
|
+
tabindex: "-1",
|
|
2845
|
+
"aria-haspopup": "menu",
|
|
2783
2846
|
"aria-expanded": m.value === n,
|
|
2784
|
-
|
|
2785
|
-
|
|
2847
|
+
onClick: (e) => te(n),
|
|
2848
|
+
onPointerenter: (e) => W(n, t),
|
|
2849
|
+
onPointerleave: (e) => ne(t)
|
|
2786
2850
|
}, [
|
|
2787
2851
|
h[2] ||= o("span", {
|
|
2788
2852
|
class: "vdd-context-menu__icon",
|
|
2789
2853
|
"aria-hidden": "true"
|
|
2790
2854
|
}, null, -1),
|
|
2791
|
-
o("span",
|
|
2855
|
+
o("span", An, I(z(c).format(t.label)), 1),
|
|
2792
2856
|
h[3] ||= o("span", {
|
|
2793
2857
|
class: "vdd-context-menu__chevron",
|
|
2794
2858
|
"aria-hidden": "true"
|
|
2795
2859
|
}, "›", -1)
|
|
2796
|
-
], 42,
|
|
2860
|
+
], 42, kn)) : (T(), a("button", {
|
|
2797
2861
|
key: 2,
|
|
2798
2862
|
ref_for: !0,
|
|
2799
|
-
ref: (e) =>
|
|
2863
|
+
ref: (e) => V(n, e),
|
|
2800
2864
|
type: "button",
|
|
2801
|
-
class: y(["vdd-context-menu__item", { "vdd-context-menu__item--disabled":
|
|
2802
|
-
disabled:
|
|
2803
|
-
title:
|
|
2804
|
-
"data-cy-action":
|
|
2805
|
-
"data-vdd-menu-item": z(c).format(
|
|
2806
|
-
role:
|
|
2807
|
-
"
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2865
|
+
class: y(["vdd-context-menu__item", { "vdd-context-menu__item--disabled": B(t) }]),
|
|
2866
|
+
disabled: B(t),
|
|
2867
|
+
title: F(t).title ? z(c).format(F(t).title) : void 0,
|
|
2868
|
+
"data-cy-action": F(t).cyAction,
|
|
2869
|
+
"data-vdd-menu-item": z(c).format(F(t).label),
|
|
2870
|
+
role: L(t) ? "menuitemcheckbox" : "menuitem",
|
|
2871
|
+
tabindex: "-1",
|
|
2872
|
+
"aria-checked": L(t) ? R(t) : void 0,
|
|
2873
|
+
onClick: (e) => ee(t),
|
|
2874
|
+
onPointerenter: (e) => W(n, t),
|
|
2875
|
+
onPointerleave: (e) => ne(t)
|
|
2811
2876
|
}, [
|
|
2812
2877
|
o("span", {
|
|
2813
2878
|
class: "vdd-context-menu__icon",
|
|
2814
|
-
"aria-hidden": !
|
|
2815
|
-
}, [
|
|
2816
|
-
o("span",
|
|
2817
|
-
|
|
2879
|
+
"aria-hidden": !F(t).icon
|
|
2880
|
+
}, [F(t).icon ? (T(), r(N(F(t).icon), { key: 0 })) : i("", !0)], 8, Mn),
|
|
2881
|
+
o("span", Nn, I(z(c).format(F(t).label)), 1),
|
|
2882
|
+
L(t) ? (T(), a("span", {
|
|
2818
2883
|
key: 0,
|
|
2819
|
-
class: y(["vdd-context-menu__checkbox", { "vdd-context-menu__checkbox--checked":
|
|
2884
|
+
class: y(["vdd-context-menu__checkbox", { "vdd-context-menu__checkbox--checked": R(t) }]),
|
|
2820
2885
|
"aria-hidden": "true"
|
|
2821
|
-
}, [(T(), a("svg",
|
|
2886
|
+
}, [(T(), a("svg", Pn, [o("rect", {
|
|
2822
2887
|
x: "0.75",
|
|
2823
2888
|
y: "0.75",
|
|
2824
2889
|
width: "10.5",
|
|
2825
2890
|
height: "10.5",
|
|
2826
2891
|
rx: "2",
|
|
2827
|
-
fill:
|
|
2892
|
+
fill: R(t) ? "currentColor" : "none",
|
|
2828
2893
|
stroke: "currentColor",
|
|
2829
2894
|
"stroke-width": "1.5"
|
|
2830
|
-
}, null, 8,
|
|
2831
|
-
], 42,
|
|
2895
|
+
}, null, 8, Fn), R(t) ? (T(), a("path", In)) : i("", !0)]))], 2)) : i("", !0)
|
|
2896
|
+
], 42, jn))], 64))), 128))], 46, Dn)), m.value !== null && K.value.length ? (T(), a("div", {
|
|
2832
2897
|
key: 2,
|
|
2833
2898
|
ref_key: "submenuRoot",
|
|
2834
2899
|
ref: u,
|
|
2835
2900
|
class: y(["vdd-context-menu vdd-context-menu--submenu", `vdd-context-menu--${s.theme}`]),
|
|
2836
|
-
style: x(
|
|
2901
|
+
style: x(re.value),
|
|
2837
2902
|
dir: z(c).state.dir,
|
|
2838
2903
|
"data-vdd-submenu": "",
|
|
2839
2904
|
role: "menu",
|
|
2905
|
+
onKeydown: O,
|
|
2840
2906
|
onPointerenter: h[0] ||= (e) => C(),
|
|
2841
2907
|
onPointerleave: h[1] ||= (e) => m.value = null
|
|
2842
|
-
}, [(T(!0), a(e, null, A(
|
|
2908
|
+
}, [(T(!0), a(e, null, A(K.value, (t, n) => (T(), a(e, { key: n }, [z(De)(t) ? (T(), a("hr", Rn)) : (T(), a("button", {
|
|
2843
2909
|
key: 1,
|
|
2844
2910
|
type: "button",
|
|
2845
|
-
class: y(["vdd-context-menu__item", { "vdd-context-menu__item--disabled":
|
|
2846
|
-
disabled:
|
|
2847
|
-
"data-vdd-menu-item": z(c).format(
|
|
2911
|
+
class: y(["vdd-context-menu__item", { "vdd-context-menu__item--disabled": B(t) }]),
|
|
2912
|
+
disabled: B(t),
|
|
2913
|
+
"data-vdd-menu-item": z(c).format(F(t).label),
|
|
2848
2914
|
role: "menuitem",
|
|
2849
|
-
|
|
2915
|
+
tabindex: "-1",
|
|
2916
|
+
onClick: (e) => ee(t)
|
|
2850
2917
|
}, [o("span", {
|
|
2851
2918
|
class: "vdd-context-menu__icon",
|
|
2852
|
-
"aria-hidden": !
|
|
2853
|
-
}, [
|
|
2919
|
+
"aria-hidden": !F(t).icon
|
|
2920
|
+
}, [F(t).icon ? (T(), r(N(F(t).icon), { key: 0 })) : i("", !0)], 8, Bn), o("span", Vn, I(z(c).format(F(t).label)), 1)], 10, zn))], 64))), 128))], 46, Ln)) : i("", !0)])) : i("", !0);
|
|
2854
2921
|
}
|
|
2855
|
-
}),
|
|
2922
|
+
}), Gn = (e) => "custom" in e && e.custom === !0, Kn = (e) => !Gn(e) && !("onClick" in e), qn = (e) => !Gn(e) && "onClick" in e, Jn = (e) => e == null ? [] : Array.isArray(e) ? e : [e], Yn = Symbol("vdd-sidebar"), Xn = Symbol("vdd-sidebar-tab"), Zn = {
|
|
2856
2923
|
key: 0,
|
|
2857
2924
|
class: "vdd-sidebar-tabs-list"
|
|
2858
|
-
},
|
|
2925
|
+
}, Qn = [
|
|
2859
2926
|
"title",
|
|
2860
2927
|
"aria-pressed",
|
|
2861
2928
|
"data-vdd-sidebar-tab",
|
|
2862
2929
|
"onClick"
|
|
2863
|
-
],
|
|
2930
|
+
], $n = [
|
|
2864
2931
|
"disabled",
|
|
2865
2932
|
"title",
|
|
2866
2933
|
"aria-label",
|
|
2867
2934
|
"data-vdd-rail-action",
|
|
2868
2935
|
"onClick"
|
|
2869
|
-
],
|
|
2936
|
+
], er = [
|
|
2870
2937
|
"title",
|
|
2871
2938
|
"aria-pressed",
|
|
2872
2939
|
"data-vdd-sidebar-tab",
|
|
2873
2940
|
"onClick"
|
|
2874
|
-
],
|
|
2941
|
+
], tr = 56, nr = /* @__PURE__ */ u({
|
|
2875
2942
|
__name: "VddSidebarRail",
|
|
2876
2943
|
props: {
|
|
2877
2944
|
tabs: {},
|
|
@@ -2886,19 +2953,19 @@ var On = ["dir"], kn = {
|
|
|
2886
2953
|
let s = n, c = (e) => e.filter((e) => !e.hidden);
|
|
2887
2954
|
return (n, l) => (T(), a("div", {
|
|
2888
2955
|
class: "vdd-sidebar-strip-outer",
|
|
2889
|
-
style: x({ width: t.visible ? `${
|
|
2956
|
+
style: x({ width: t.visible ? `${tr}px` : "0px" }),
|
|
2890
2957
|
"data-vdd-sidebar-strip": ""
|
|
2891
2958
|
}, [o("div", {
|
|
2892
2959
|
class: y(["vdd-sidebar-tabs-strip", [`vdd-${t.position}`, {
|
|
2893
2960
|
"vdd-sidebar-tabs-strip--has-header-action": t.header.length > 0,
|
|
2894
2961
|
"vdd-sidebar-tabs-strip--has-footer-action": t.footer.length > 0
|
|
2895
2962
|
}]]),
|
|
2896
|
-
style: x({ width: `${
|
|
2963
|
+
style: x({ width: `${tr}px` })
|
|
2897
2964
|
}, [(T(), a(e, null, A([
|
|
2898
2965
|
"header",
|
|
2899
2966
|
"tabs",
|
|
2900
2967
|
"footer"
|
|
2901
|
-
], (n) => (T(), a(e, { key: n }, [n === "tabs" ? (T(), a("div",
|
|
2968
|
+
], (n) => (T(), a(e, { key: n }, [n === "tabs" ? (T(), a("div", Zn, [(T(!0), a(e, null, A(c(t.tabs), (e) => (T(), a("button", {
|
|
2902
2969
|
key: e.id,
|
|
2903
2970
|
type: "button",
|
|
2904
2971
|
class: y(["vdd-sidebar-tab-btn", { "vdd-active": t.activeTabId === e.id }]),
|
|
@@ -2906,13 +2973,13 @@ var On = ["dir"], kn = {
|
|
|
2906
2973
|
"aria-pressed": t.activeTabId === e.id,
|
|
2907
2974
|
"data-vdd-sidebar-tab": e.id,
|
|
2908
2975
|
onClick: (t) => s("select", e.id)
|
|
2909
|
-
}, [(T(), r(N(e.icon)))], 10,
|
|
2976
|
+
}, [(T(), r(N(e.icon)))], 10, Qn))), 128))])) : (n === "header" ? t.header : t.footer).length ? (T(), a("div", {
|
|
2910
2977
|
key: 1,
|
|
2911
2978
|
class: y(n === "header" ? "vdd-sidebar-header-area" : "vdd-sidebar-footer-area")
|
|
2912
|
-
}, [(T(!0), a(e, null, A(n === "header" ? t.header : t.footer, (n, o) => (T(), a(e, { key: o }, [z(
|
|
2979
|
+
}, [(T(!0), a(e, null, A(n === "header" ? t.header : t.footer, (n, o) => (T(), a(e, { key: o }, [z(Gn)(n) ? (T(), r(N(n.component), _({
|
|
2913
2980
|
key: 0,
|
|
2914
2981
|
ref_for: !0
|
|
2915
|
-
}, n.props), null, 16)) : z(
|
|
2982
|
+
}, n.props), null, 16)) : z(qn)(n) ? (T(), a("button", {
|
|
2916
2983
|
key: 1,
|
|
2917
2984
|
type: "button",
|
|
2918
2985
|
class: "vdd-sidebar-tab-btn vdd-sidebar-header-action-btn",
|
|
@@ -2921,7 +2988,7 @@ var On = ["dir"], kn = {
|
|
|
2921
2988
|
"aria-label": n.label,
|
|
2922
2989
|
"data-vdd-rail-action": n.id ?? n.label,
|
|
2923
2990
|
onClick: (e) => n.onClick()
|
|
2924
|
-
}, [(T(), r(N(n.icon)))], 8,
|
|
2991
|
+
}, [(T(), r(N(n.icon)))], 8, $n)) : n.hidden ? i("", !0) : (T(), a("button", {
|
|
2925
2992
|
key: 2,
|
|
2926
2993
|
type: "button",
|
|
2927
2994
|
class: y(["vdd-sidebar-tab-btn", { "vdd-active": t.activeTabId === n.id }]),
|
|
@@ -2929,25 +2996,34 @@ var On = ["dir"], kn = {
|
|
|
2929
2996
|
"aria-pressed": t.activeTabId === n.id,
|
|
2930
2997
|
"data-vdd-sidebar-tab": n.id,
|
|
2931
2998
|
onClick: (e) => s("select", n.id)
|
|
2932
|
-
}, [(T(), r(N(n.icon)))], 10,
|
|
2999
|
+
}, [(T(), r(N(n.icon)))], 10, er))], 64))), 128))], 2)) : i("", !0)], 64))), 64))], 6)], 4));
|
|
2933
3000
|
}
|
|
2934
|
-
}),
|
|
3001
|
+
}), rr = /* @__PURE__ */ u({
|
|
2935
3002
|
__name: "VddSidebarTabScope",
|
|
2936
3003
|
props: { tabId: {} },
|
|
2937
3004
|
emits: ["close", "open"],
|
|
2938
3005
|
setup(e, { emit: t }) {
|
|
2939
3006
|
let n = e, r = t;
|
|
2940
|
-
return E(
|
|
3007
|
+
return E(Xn, {
|
|
2941
3008
|
tabId: n.tabId,
|
|
2942
3009
|
open: () => r("open", n.tabId),
|
|
2943
3010
|
close: () => r("close"),
|
|
2944
3011
|
openTab: (e) => r("open", e)
|
|
2945
3012
|
}), (e, t) => (T(), a("div", null, [j(e.$slots, "default")]));
|
|
2946
3013
|
}
|
|
2947
|
-
})
|
|
3014
|
+
});
|
|
3015
|
+
//#endregion
|
|
3016
|
+
//#region src/composables/useLibraryMessage.ts
|
|
3017
|
+
function ir() {
|
|
3018
|
+
let e = p(Ue, null);
|
|
3019
|
+
return (t) => e ? e.format(e.messages[t]) : Me(je[t]);
|
|
3020
|
+
}
|
|
3021
|
+
//#endregion
|
|
3022
|
+
//#region src/components/VddSidebarDrawer.vue?vue&type=script&setup=true&lang.ts
|
|
3023
|
+
var ar = ["data-vdd-sidebar-pane"], or = {
|
|
2948
3024
|
key: 1,
|
|
2949
3025
|
class: "vdd-sidebar-drawer-header"
|
|
2950
|
-
}, sr = { class: "vdd-sidebar-header-title" }, cr = /* @__PURE__ */ u({
|
|
3026
|
+
}, sr = { class: "vdd-sidebar-header-title" }, cr = ["title", "aria-label"], lr = /* @__PURE__ */ u({
|
|
2951
3027
|
__name: "VddSidebarDrawer",
|
|
2952
3028
|
props: {
|
|
2953
3029
|
tabs: {},
|
|
@@ -2963,8 +3039,8 @@ var On = ["dir"], kn = {
|
|
|
2963
3039
|
},
|
|
2964
3040
|
emits: ["close", "open"],
|
|
2965
3041
|
setup(t, { emit: n }) {
|
|
2966
|
-
let s = n;
|
|
2967
|
-
return (n,
|
|
3042
|
+
let s = ir(), c = n;
|
|
3043
|
+
return (n, u) => (T(), a("div", {
|
|
2968
3044
|
class: y(["vdd-sidebar-content-drawer", `vdd-${t.position}`]),
|
|
2969
3045
|
"data-vdd-sidebar-drawer": "",
|
|
2970
3046
|
style: x({
|
|
@@ -2980,33 +3056,33 @@ var On = ["dir"], kn = {
|
|
|
2980
3056
|
"data-vdd-sidebar-pane": e.id
|
|
2981
3057
|
}, [t.headerOverridden ? j(n.$slots, "header", {
|
|
2982
3058
|
tab: e,
|
|
2983
|
-
close: () =>
|
|
2984
|
-
open: () =>
|
|
3059
|
+
close: () => c("close"),
|
|
3060
|
+
open: () => c("open", e.id)
|
|
2985
3061
|
}, void 0, void 0, 0) : (T(), a("div", or, [o("span", sr, I(e.label), 1), t.showCloseButton ? (T(), a("button", {
|
|
2986
3062
|
key: 0,
|
|
2987
3063
|
type: "button",
|
|
2988
3064
|
class: "vdd-sidebar-drawer-close-button",
|
|
2989
3065
|
"data-vdd-sidebar-close": "",
|
|
2990
|
-
title: "
|
|
2991
|
-
"aria-label": "
|
|
2992
|
-
onClick:
|
|
2993
|
-
}, [...
|
|
3066
|
+
title: z(s)("close"),
|
|
3067
|
+
"aria-label": z(s)("close"),
|
|
3068
|
+
onClick: u[0] ||= (e) => c("close")
|
|
3069
|
+
}, [...u[3] ||= [o("svg", {
|
|
2994
3070
|
width: "14",
|
|
2995
3071
|
height: "14",
|
|
2996
3072
|
viewBox: "0 0 24 24",
|
|
2997
3073
|
fill: "none",
|
|
2998
3074
|
stroke: "currentColor",
|
|
2999
3075
|
"stroke-width": "2.5"
|
|
3000
|
-
}, [o("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]])) : i("", !0)])), l(
|
|
3076
|
+
}, [o("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]], 8, cr)) : i("", !0)])), l(rr, {
|
|
3001
3077
|
class: "vdd-sidebar-drawer-body",
|
|
3002
3078
|
"tab-id": e.id,
|
|
3003
|
-
onClose:
|
|
3004
|
-
onOpen:
|
|
3079
|
+
onClose: u[1] ||= (e) => c("close"),
|
|
3080
|
+
onOpen: u[2] ||= (e) => c("open", e)
|
|
3005
3081
|
}, {
|
|
3006
|
-
default:
|
|
3082
|
+
default: G(() => [j(n.$slots, `tab-${e.id}`, {
|
|
3007
3083
|
tab: e,
|
|
3008
|
-
close: () =>
|
|
3009
|
-
open: () =>
|
|
3084
|
+
close: () => c("close"),
|
|
3085
|
+
open: () => c("open", e.id)
|
|
3010
3086
|
}, () => [e.component ? (T(), r(N(e.component), _({
|
|
3011
3087
|
key: 0,
|
|
3012
3088
|
ref_for: !0
|
|
@@ -3014,10 +3090,10 @@ var On = ["dir"], kn = {
|
|
|
3014
3090
|
_: 2
|
|
3015
3091
|
}, 1032, ["tab-id"])], 12, ar))), 128))], 6));
|
|
3016
3092
|
}
|
|
3017
|
-
}),
|
|
3093
|
+
}), ur = ["data-vdd-sidebar"], dr = {
|
|
3018
3094
|
key: 3,
|
|
3019
3095
|
class: "vdd-sidebar-main"
|
|
3020
|
-
},
|
|
3096
|
+
}, fr = /* @__PURE__ */ u({
|
|
3021
3097
|
__name: "VddSidebar",
|
|
3022
3098
|
props: /*@__PURE__*/ g({
|
|
3023
3099
|
position: { default: "right" },
|
|
@@ -3061,10 +3137,10 @@ var On = ["dir"], kn = {
|
|
|
3061
3137
|
"update:width"
|
|
3062
3138
|
],
|
|
3063
3139
|
setup(t) {
|
|
3064
|
-
let o = t, c = V(), l = B(t, "activeTabId"), u = B(t, "visible"), d = B(t, "stripVisible"), f = B(t, "width"), p = n(() =>
|
|
3065
|
-
...p.value.filter(
|
|
3140
|
+
let o = t, c = V(), l = B(t, "activeTabId"), u = B(t, "visible"), d = B(t, "stripVisible"), f = B(t, "width"), p = n(() => Jn(o.headerAction)), m = n(() => Jn(o.footerAction)), h = n(() => [
|
|
3141
|
+
...p.value.filter(Kn),
|
|
3066
3142
|
...o.tabs,
|
|
3067
|
-
...m.value.filter(
|
|
3143
|
+
...m.value.filter(Kn)
|
|
3068
3144
|
]), g = k(/* @__PURE__ */ new Set()), v = n(() => {
|
|
3069
3145
|
let e = new Set(g.value);
|
|
3070
3146
|
l.value && e.add(l.value);
|
|
@@ -3116,7 +3192,7 @@ var On = ["dir"], kn = {
|
|
|
3116
3192
|
}
|
|
3117
3193
|
});
|
|
3118
3194
|
}
|
|
3119
|
-
E(
|
|
3195
|
+
E(Yn, {
|
|
3120
3196
|
openTab: (e) => y(e),
|
|
3121
3197
|
closeDrawer: M,
|
|
3122
3198
|
activeTabId: l,
|
|
@@ -3143,7 +3219,7 @@ var On = ["dir"], kn = {
|
|
|
3143
3219
|
"resizer",
|
|
3144
3220
|
"drawer",
|
|
3145
3221
|
"rail"
|
|
3146
|
-
], (o) => (T(), a(e, { key: o }, [o === "rail" ? (T(), r(
|
|
3222
|
+
], (o) => (T(), a(e, { key: o }, [o === "rail" ? (T(), r(nr, {
|
|
3147
3223
|
key: 0,
|
|
3148
3224
|
tabs: t.tabs,
|
|
3149
3225
|
header: p.value,
|
|
@@ -3159,7 +3235,7 @@ var On = ["dir"], kn = {
|
|
|
3159
3235
|
"active-tab-id",
|
|
3160
3236
|
"position",
|
|
3161
3237
|
"visible"
|
|
3162
|
-
])) : o === "drawer" ? (T(), r(
|
|
3238
|
+
])) : o === "drawer" ? (T(), r(lr, {
|
|
3163
3239
|
key: 1,
|
|
3164
3240
|
tabs: b.value,
|
|
3165
3241
|
"active-tab-id": l.value,
|
|
@@ -3175,11 +3251,11 @@ var On = ["dir"], kn = {
|
|
|
3175
3251
|
onOpen: y
|
|
3176
3252
|
}, s({ _: 2 }, [n.$slots.header ? {
|
|
3177
3253
|
name: "header",
|
|
3178
|
-
fn:
|
|
3254
|
+
fn: G((e) => [j(n.$slots, "header", _({ ref_for: !0 }, e))]),
|
|
3179
3255
|
key: "0"
|
|
3180
3256
|
} : void 0, A(b.value, (e) => ({
|
|
3181
3257
|
name: `tab-${e.id}`,
|
|
3182
|
-
fn:
|
|
3258
|
+
fn: G((t) => [j(n.$slots, `tab-${e.id}`, _({ ref_for: !0 }, t))])
|
|
3183
3259
|
}))]), 1032, [
|
|
3184
3260
|
"tabs",
|
|
3185
3261
|
"active-tab-id",
|
|
@@ -3203,9 +3279,9 @@ var On = ["dir"], kn = {
|
|
|
3203
3279
|
zIndex: 20
|
|
3204
3280
|
},
|
|
3205
3281
|
onPointerdown: P
|
|
3206
|
-
}, null, 32)) : o === "main" ? (T(), a("div",
|
|
3282
|
+
}, null, 32)) : o === "main" ? (T(), a("div", dr, [j(n.$slots, "default")])) : i("", !0)], 64))), 128))], 8, ur));
|
|
3207
3283
|
}
|
|
3208
|
-
}),
|
|
3284
|
+
}), pr = /* @__PURE__ */ u({
|
|
3209
3285
|
__name: "VddSecondarySidebar",
|
|
3210
3286
|
props: {
|
|
3211
3287
|
tabs: {},
|
|
@@ -3217,11 +3293,11 @@ var On = ["dir"], kn = {
|
|
|
3217
3293
|
hideDefaultHeader: { type: Boolean }
|
|
3218
3294
|
},
|
|
3219
3295
|
setup(e) {
|
|
3220
|
-
let t = e, i = p(
|
|
3296
|
+
let t = e, i = p(Yn, null);
|
|
3221
3297
|
if (!i) throw Error("[vue-dockable-desktop] <VddSecondarySidebar> must be rendered inside a <VddSidebar>. It takes the edge the primary sidebar is not using, so it needs one to be nested in.");
|
|
3222
3298
|
if (i.isSecondary) throw Error("[vue-dockable-desktop] <VddSecondarySidebar> cannot be nested inside another one. The library supports one primary and one secondary sidebar, nothing deeper.");
|
|
3223
3299
|
let a = n(() => i.position === "left" ? "right" : "left");
|
|
3224
|
-
return (e, n) => (T(), r(
|
|
3300
|
+
return (e, n) => (T(), r(fr, _({
|
|
3225
3301
|
...t,
|
|
3226
3302
|
...e.$attrs
|
|
3227
3303
|
}, {
|
|
@@ -3229,11 +3305,11 @@ var On = ["dir"], kn = {
|
|
|
3229
3305
|
"is-secondary": ""
|
|
3230
3306
|
}), s({ _: 2 }, [A(e.$slots, (t, n) => ({
|
|
3231
3307
|
name: n,
|
|
3232
|
-
fn:
|
|
3308
|
+
fn: G((t) => [j(e.$slots, n, b(f(t ?? {})))])
|
|
3233
3309
|
}))]), 1040, ["position"]));
|
|
3234
3310
|
}
|
|
3235
|
-
}),
|
|
3236
|
-
function
|
|
3311
|
+
}), mr = (e) => !("type" in e);
|
|
3312
|
+
function hr(e, t, n, r = !1, i = 8) {
|
|
3237
3313
|
switch (t) {
|
|
3238
3314
|
case "left": return r ? {
|
|
3239
3315
|
right: n.width - e.left + i,
|
|
@@ -3267,32 +3343,32 @@ function mr(e, t, n, r = !1, i = 8) {
|
|
|
3267
3343
|
}
|
|
3268
3344
|
//#endregion
|
|
3269
3345
|
//#region src/components/VddToolbarGroupButton.vue?vue&type=script&setup=true&lang.ts
|
|
3270
|
-
var
|
|
3346
|
+
var gr = [
|
|
3271
3347
|
"title",
|
|
3272
3348
|
"aria-label",
|
|
3273
3349
|
"aria-expanded",
|
|
3274
3350
|
"disabled",
|
|
3275
3351
|
"data-vdd-toolbar-item"
|
|
3276
|
-
],
|
|
3352
|
+
], _r = ["dir", "data-vdd-flyout"], vr = {
|
|
3277
3353
|
key: 0,
|
|
3278
3354
|
class: "vdd-toolbar-group-flyout-sep",
|
|
3279
3355
|
role: "separator"
|
|
3280
|
-
},
|
|
3356
|
+
}, yr = [
|
|
3281
3357
|
"disabled",
|
|
3282
3358
|
"aria-checked",
|
|
3283
3359
|
"data-vdd-flyout-item",
|
|
3284
3360
|
"onClick"
|
|
3285
|
-
],
|
|
3361
|
+
], br = { class: "vdd-toolbar-group-flyout-icon" }, xr = { class: "vdd-toolbar-group-flyout-label" }, Sr = {
|
|
3286
3362
|
key: 0,
|
|
3287
3363
|
class: "vdd-toolbar-group-flyout-shortcut"
|
|
3288
|
-
},
|
|
3364
|
+
}, Cr = /* @__PURE__ */ u({
|
|
3289
3365
|
__name: "VddToolbarGroupButton",
|
|
3290
3366
|
props: {
|
|
3291
3367
|
item: {},
|
|
3292
3368
|
position: {}
|
|
3293
3369
|
},
|
|
3294
3370
|
setup(s) {
|
|
3295
|
-
let c = s, l = Y(), u = H("button"), d = H("flyout"), f = k(!1), p = k({}), m = n(() => c.item.activeItemId !== void 0), h = n(() => m.value ? c.item.activeItemId ?? null : l.toolbar.activeInGroup(c.item.id)), g = n(() => c.item.items.find((e) =>
|
|
3371
|
+
let c = s, l = Y(), u = H("button"), d = H("flyout"), f = k(!1), p = k({}), m = n(() => c.item.activeItemId !== void 0), h = n(() => m.value ? c.item.activeItemId ?? null : l.toolbar.activeInGroup(c.item.id)), g = n(() => c.item.items.find((e) => mr(e) && e.id === h.value)), _ = n(() => g.value && mr(g.value) ? g.value.icon : c.item.defaultIcon), b = n(() => g.value && mr(g.value) ? g.value.label : c.item.label);
|
|
3296
3372
|
async function C() {
|
|
3297
3373
|
if (c.item.disabled) return;
|
|
3298
3374
|
if (f.value) {
|
|
@@ -3300,7 +3376,7 @@ var hr = [
|
|
|
3300
3376
|
return;
|
|
3301
3377
|
}
|
|
3302
3378
|
let e = u.value?.getBoundingClientRect();
|
|
3303
|
-
e && (p.value =
|
|
3379
|
+
e && (p.value = hr(e, c.position, {
|
|
3304
3380
|
width: window.innerWidth,
|
|
3305
3381
|
height: window.innerHeight
|
|
3306
3382
|
}, et(u.value))), f.value = !0, await v(), E(), document.addEventListener("pointerdown", D, { capture: !0 }), document.addEventListener("keydown", O, { capture: !0 });
|
|
@@ -3323,7 +3399,7 @@ var hr = [
|
|
|
3323
3399
|
u.value?.contains(t) || d.value?.contains(t) || w();
|
|
3324
3400
|
}
|
|
3325
3401
|
function O(e) {
|
|
3326
|
-
e.key === "Escape" && !
|
|
3402
|
+
e.key === "Escape" && !En(e) && (Tn(e), w());
|
|
3327
3403
|
}
|
|
3328
3404
|
function j(e, t) {
|
|
3329
3405
|
m.value ? c.item.onActiveItemChange?.(e) : l.toolbar.setActiveInGroup(c.item.id, e), t?.(e), w();
|
|
@@ -3346,7 +3422,7 @@ var hr = [
|
|
|
3346
3422
|
disabled: s.item.disabled,
|
|
3347
3423
|
"data-vdd-toolbar-item": s.item.id,
|
|
3348
3424
|
onClick: C
|
|
3349
|
-
}, [(T(), r(N(_.value)))], 10,
|
|
3425
|
+
}, [(T(), r(N(_.value)))], 10, gr), f.value ? (T(), r(t, {
|
|
3350
3426
|
key: 0,
|
|
3351
3427
|
to: "body"
|
|
3352
3428
|
}, [o("div", {
|
|
@@ -3357,7 +3433,7 @@ var hr = [
|
|
|
3357
3433
|
dir: z(l).state.dir,
|
|
3358
3434
|
"data-vdd-flyout": s.item.id,
|
|
3359
3435
|
role: "menu"
|
|
3360
|
-
}, [(T(!0), a(e, null, A(s.item.items, (t, n) => (T(), a(e, { key: n }, [z(
|
|
3436
|
+
}, [(T(!0), a(e, null, A(s.item.items, (t, n) => (T(), a(e, { key: n }, [z(mr)(t) ? (T(), a("button", {
|
|
3361
3437
|
key: 1,
|
|
3362
3438
|
type: "button",
|
|
3363
3439
|
class: y(["vdd-toolbar-group-flyout-item", { "vdd-active": h.value === t.id }]),
|
|
@@ -3367,40 +3443,40 @@ var hr = [
|
|
|
3367
3443
|
"data-vdd-flyout-item": t.id,
|
|
3368
3444
|
onClick: (e) => j(t.id, t.onActivate)
|
|
3369
3445
|
}, [
|
|
3370
|
-
o("span",
|
|
3371
|
-
o("span",
|
|
3372
|
-
t.shortcut ? (T(), a("span",
|
|
3373
|
-
], 10,
|
|
3446
|
+
o("span", br, [(T(), r(N(t.icon)))]),
|
|
3447
|
+
o("span", xr, I(t.label), 1),
|
|
3448
|
+
t.shortcut ? (T(), a("span", Sr, I(t.shortcut), 1)) : i("", !0)
|
|
3449
|
+
], 10, yr)) : (T(), a("div", vr))], 64))), 128))], 14, _r)])) : i("", !0)], 64));
|
|
3374
3450
|
}
|
|
3375
|
-
}),
|
|
3451
|
+
}), wr = [
|
|
3376
3452
|
"inert",
|
|
3377
3453
|
"data-vdd-toolbar",
|
|
3378
3454
|
"aria-orientation"
|
|
3379
|
-
],
|
|
3455
|
+
], Tr = {
|
|
3380
3456
|
key: 0,
|
|
3381
3457
|
class: "vdd-toolbar-separator",
|
|
3382
3458
|
role: "separator"
|
|
3383
|
-
},
|
|
3459
|
+
}, Er = [
|
|
3384
3460
|
"title",
|
|
3385
3461
|
"aria-label",
|
|
3386
3462
|
"disabled",
|
|
3387
3463
|
"data-vdd-toolbar-item",
|
|
3388
3464
|
"onClick"
|
|
3389
|
-
],
|
|
3465
|
+
], Dr = [
|
|
3390
3466
|
"title",
|
|
3391
3467
|
"aria-label",
|
|
3392
3468
|
"aria-pressed",
|
|
3393
3469
|
"disabled",
|
|
3394
3470
|
"data-vdd-toolbar-item",
|
|
3395
3471
|
"onClick"
|
|
3396
|
-
],
|
|
3472
|
+
], Or = [
|
|
3397
3473
|
"title",
|
|
3398
3474
|
"aria-label",
|
|
3399
3475
|
"aria-pressed",
|
|
3400
3476
|
"disabled",
|
|
3401
3477
|
"data-vdd-toolbar-item",
|
|
3402
3478
|
"onClick"
|
|
3403
|
-
],
|
|
3479
|
+
], kr = /* @__PURE__ */ u({
|
|
3404
3480
|
__name: "VddToolbar",
|
|
3405
3481
|
props: /*@__PURE__*/ g({
|
|
3406
3482
|
position: { default: "left" },
|
|
@@ -3430,7 +3506,7 @@ var hr = [
|
|
|
3430
3506
|
"data-vdd-toolbar": t.position,
|
|
3431
3507
|
role: "toolbar",
|
|
3432
3508
|
"aria-orientation": l.value ? "vertical" : "horizontal"
|
|
3433
|
-
}, [(T(!0), a(e, null, A(t.items, (n, o) => (T(), a(e, { key: n.type === "separator" ? `sep-${o}` : n.id }, [n.type === "separator" ? (T(), a("div",
|
|
3509
|
+
}, [(T(!0), a(e, null, A(t.items, (n, o) => (T(), a(e, { key: n.type === "separator" ? `sep-${o}` : n.id }, [n.type === "separator" ? (T(), a("div", Tr)) : n.type === "action" ? (T(), a("button", {
|
|
3434
3510
|
key: 1,
|
|
3435
3511
|
type: "button",
|
|
3436
3512
|
class: "vdd-toolbar-btn vdd-toolbar-btn-action",
|
|
@@ -3439,7 +3515,7 @@ var hr = [
|
|
|
3439
3515
|
disabled: n.disabled,
|
|
3440
3516
|
"data-vdd-toolbar-item": n.id,
|
|
3441
3517
|
onClick: (e) => n.onClick()
|
|
3442
|
-
}, [(T(), r(N(n.icon)))], 8,
|
|
3518
|
+
}, [(T(), r(N(n.icon)))], 8, Er)) : n.type === "radio" ? (T(), a("button", {
|
|
3443
3519
|
key: 2,
|
|
3444
3520
|
type: "button",
|
|
3445
3521
|
class: y(["vdd-toolbar-btn vdd-toolbar-btn-radio", { "vdd-active": d(n.group, n.id) }]),
|
|
@@ -3449,7 +3525,7 @@ var hr = [
|
|
|
3449
3525
|
disabled: n.disabled,
|
|
3450
3526
|
"data-vdd-toolbar-item": n.id,
|
|
3451
3527
|
onClick: (e) => f(n.group, n.id, n.onActivate)
|
|
3452
|
-
}, [(T(), r(N(n.icon)))], 10,
|
|
3528
|
+
}, [(T(), r(N(n.icon)))], 10, Dr)) : n.type === "toggle" ? (T(), a("button", {
|
|
3453
3529
|
key: 3,
|
|
3454
3530
|
type: "button",
|
|
3455
3531
|
class: y(["vdd-toolbar-btn vdd-toolbar-btn-toggle", { "vdd-active": p(n) }]),
|
|
@@ -3459,14 +3535,14 @@ var hr = [
|
|
|
3459
3535
|
disabled: n.disabled,
|
|
3460
3536
|
"data-vdd-toolbar-item": n.id,
|
|
3461
3537
|
onClick: (e) => m(n)
|
|
3462
|
-
}, [(T(), r(N(n.icon)))], 10,
|
|
3538
|
+
}, [(T(), r(N(n.icon)))], 10, Or)) : n.type === "group" ? (T(), r(Cr, {
|
|
3463
3539
|
key: 4,
|
|
3464
3540
|
item: n,
|
|
3465
3541
|
position: t.position
|
|
3466
|
-
}, null, 8, ["item", "position"])) : i("", !0)], 64))), 128))], 14,
|
|
3542
|
+
}, null, 8, ["item", "position"])) : i("", !0)], 64))), 128))], 14, wr));
|
|
3467
3543
|
}
|
|
3468
|
-
}),
|
|
3469
|
-
function
|
|
3544
|
+
}), Ar = /* @__PURE__ */ new Map(), jr = 0;
|
|
3545
|
+
function Mr(e) {
|
|
3470
3546
|
let t = Y(), { overlays: r } = t, i = () => R(e), a = k(null), o = n(() => i().kind !== "modal" || i().options.closable !== !1), s = (e) => r.requestClose(i().id, {
|
|
3471
3547
|
...e,
|
|
3472
3548
|
confirm: (e) => r.confirmDiscard({
|
|
@@ -3475,26 +3551,26 @@ function jr(e) {
|
|
|
3475
3551
|
})
|
|
3476
3552
|
});
|
|
3477
3553
|
function c(e) {
|
|
3478
|
-
if (e.key !== "Escape" || !o.value ||
|
|
3554
|
+
if (e.key !== "Escape" || !o.value || En(e)) return;
|
|
3479
3555
|
let t = i();
|
|
3480
3556
|
if (t.kind === "modal") {
|
|
3481
3557
|
if (r.topmostModal()?.id !== t.id) return;
|
|
3482
3558
|
e.stopPropagation();
|
|
3483
3559
|
} else if (r.state.modals.length > 0) return;
|
|
3484
3560
|
else if (!u(t.id)) return;
|
|
3485
|
-
|
|
3561
|
+
Tn(e), s();
|
|
3486
3562
|
}
|
|
3487
3563
|
let l = 0;
|
|
3488
3564
|
C(() => {
|
|
3489
|
-
l = ++
|
|
3565
|
+
l = ++jr, Ar.set(i().id, l), document.addEventListener("keydown", c);
|
|
3490
3566
|
}), S(() => {
|
|
3491
|
-
|
|
3567
|
+
Ar.get(i().id) === l && Ar.delete(i().id), document.removeEventListener("keydown", c);
|
|
3492
3568
|
});
|
|
3493
3569
|
function u(e) {
|
|
3494
|
-
let t = [r.state.leftPanel, r.state.rightPanel].filter((t) => t !== null && t.id !== e), n =
|
|
3495
|
-
return t.every((e) => (
|
|
3570
|
+
let t = [r.state.leftPanel, r.state.rightPanel].filter((t) => t !== null && t.id !== e), n = Ar.get(e) ?? 0;
|
|
3571
|
+
return t.every((e) => (Ar.get(e.id) ?? 0) < n);
|
|
3496
3572
|
}
|
|
3497
|
-
return
|
|
3573
|
+
return Mt({
|
|
3498
3574
|
id: i().id,
|
|
3499
3575
|
containerType: n(() => i().kind),
|
|
3500
3576
|
close: s,
|
|
@@ -3526,7 +3602,7 @@ function jr(e) {
|
|
|
3526
3602
|
}
|
|
3527
3603
|
//#endregion
|
|
3528
3604
|
//#region src/components/VddOverlayFrame.vue?vue&type=script&setup=true&lang.ts
|
|
3529
|
-
var
|
|
3605
|
+
var Nr = ["title", "aria-label"], Pr = /* @__PURE__ */ u({
|
|
3530
3606
|
__name: "VddOverlayFrame",
|
|
3531
3607
|
props: {
|
|
3532
3608
|
block: {},
|
|
@@ -3572,13 +3648,13 @@ var Mr = ["title", "aria-label"], Nr = /* @__PURE__ */ u({
|
|
|
3572
3648
|
fill: "none",
|
|
3573
3649
|
stroke: "currentColor",
|
|
3574
3650
|
"stroke-width": "2.5"
|
|
3575
|
-
}, [o("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]], 10,
|
|
3651
|
+
}, [o("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]], 10, Nr)) : i("", !0)
|
|
3576
3652
|
], 2), o("div", {
|
|
3577
3653
|
class: y([f.value.body, m.value]),
|
|
3578
3654
|
style: x(t.bodyPadding == null ? void 0 : { padding: t.bodyPadding })
|
|
3579
3655
|
}, [j(n.$slots, "default")], 6)], 64));
|
|
3580
3656
|
}
|
|
3581
|
-
}),
|
|
3657
|
+
}), Fr = ["dir", "data-vdd-side-panel"], Ir = /* @__PURE__ */ u({
|
|
3582
3658
|
__name: "VddSidePanelHost",
|
|
3583
3659
|
props: {
|
|
3584
3660
|
instance: {},
|
|
@@ -3586,7 +3662,7 @@ var Mr = ["title", "aria-label"], Nr = /* @__PURE__ */ u({
|
|
|
3586
3662
|
defaultWidth: {}
|
|
3587
3663
|
},
|
|
3588
3664
|
setup(e) {
|
|
3589
|
-
let t = e, i = Y(), { displayTitle: s, icon: c, close: u, bodyPadding: d } =
|
|
3665
|
+
let t = e, i = Y(), { displayTitle: s, icon: c, close: u, bodyPadding: d } = Mr(() => t.instance), p = n(() => {
|
|
3590
3666
|
let e = t.instance.options.width ?? t.defaultWidth;
|
|
3591
3667
|
return typeof e == "number" ? `${e}px` : e;
|
|
3592
3668
|
});
|
|
@@ -3595,7 +3671,7 @@ var Mr = ["title", "aria-label"], Nr = /* @__PURE__ */ u({
|
|
|
3595
3671
|
style: x({ width: p.value }),
|
|
3596
3672
|
dir: z(i).state.dir,
|
|
3597
3673
|
"data-vdd-side-panel": e.position
|
|
3598
|
-
}, [o("div", { class: y(["vdd-side-panel-window", z(i).classes.sidePanel]) }, [l(
|
|
3674
|
+
}, [o("div", { class: y(["vdd-side-panel-window", z(i).classes.sidePanel]) }, [l(Pr, {
|
|
3599
3675
|
block: "side-panel",
|
|
3600
3676
|
title: z(s),
|
|
3601
3677
|
icon: z(c),
|
|
@@ -3604,7 +3680,7 @@ var Mr = ["title", "aria-label"], Nr = /* @__PURE__ */ u({
|
|
|
3604
3680
|
"body-padding": z(d),
|
|
3605
3681
|
onClose: n[0] ||= (e) => z(u)()
|
|
3606
3682
|
}, {
|
|
3607
|
-
default:
|
|
3683
|
+
default: G(() => [(T(), r(N(e.instance.component), b(f({
|
|
3608
3684
|
...e.instance.props,
|
|
3609
3685
|
panelId: e.instance.id
|
|
3610
3686
|
})), null, 16))]),
|
|
@@ -3614,9 +3690,9 @@ var Mr = ["title", "aria-label"], Nr = /* @__PURE__ */ u({
|
|
|
3614
3690
|
"icon",
|
|
3615
3691
|
"close-label",
|
|
3616
3692
|
"body-padding"
|
|
3617
|
-
])], 2)], 14,
|
|
3693
|
+
])], 2)], 14, Fr));
|
|
3618
3694
|
}
|
|
3619
|
-
}),
|
|
3695
|
+
}), Lr = /* @__PURE__ */ u({
|
|
3620
3696
|
__name: "VddSidePanels",
|
|
3621
3697
|
props: {
|
|
3622
3698
|
defaultWidth: { default: 400 },
|
|
@@ -3624,26 +3700,26 @@ var Mr = ["title", "aria-label"], Nr = /* @__PURE__ */ u({
|
|
|
3624
3700
|
},
|
|
3625
3701
|
setup(t) {
|
|
3626
3702
|
let o = t, { overlays: s } = Y(), c = n(() => o.sides === "right" ? null : s.state.leftPanel), l = n(() => o.sides === "left" ? null : s.state.rightPanel);
|
|
3627
|
-
return (n, o) => (T(), a(e, null, [c.value ? (T(), r(
|
|
3703
|
+
return (n, o) => (T(), a(e, null, [c.value ? (T(), r(Ir, {
|
|
3628
3704
|
key: c.value.id,
|
|
3629
3705
|
instance: c.value,
|
|
3630
3706
|
position: "left",
|
|
3631
3707
|
"default-width": t.defaultWidth
|
|
3632
|
-
}, null, 8, ["instance", "default-width"])) : i("", !0), l.value ? (T(), r(
|
|
3708
|
+
}, null, 8, ["instance", "default-width"])) : i("", !0), l.value ? (T(), r(Ir, {
|
|
3633
3709
|
key: l.value.id,
|
|
3634
3710
|
instance: l.value,
|
|
3635
3711
|
position: "right",
|
|
3636
3712
|
"default-width": t.defaultWidth
|
|
3637
3713
|
}, null, 8, ["instance", "default-width"])) : i("", !0)], 64));
|
|
3638
3714
|
}
|
|
3639
|
-
}),
|
|
3715
|
+
}), Rr = ["dir", "data-vdd-modal"], zr = /* @__PURE__ */ u({
|
|
3640
3716
|
__name: "VddModalHost",
|
|
3641
3717
|
props: {
|
|
3642
3718
|
instance: {},
|
|
3643
3719
|
index: {}
|
|
3644
3720
|
},
|
|
3645
3721
|
setup(e) {
|
|
3646
|
-
let t = e, i = Y(), { displayTitle: s, icon: c, dismissible: u, close: d, bodyPadding: p } =
|
|
3722
|
+
let t = e, i = Y(), { displayTitle: s, icon: c, dismissible: u, close: d, bodyPadding: p } = Mr(() => t.instance), m = n(() => `vdd-modal-size-${t.instance.options.size ?? "auto"}`), h = n(() => `calc(var(--vdd-z-base, 1000) + 9000 + ${t.index * 10})`);
|
|
3647
3723
|
return (t, n) => (T(), a("div", {
|
|
3648
3724
|
class: "vdd-modal-overlay",
|
|
3649
3725
|
style: x({ zIndex: h.value }),
|
|
@@ -3653,7 +3729,7 @@ var Mr = ["title", "aria-label"], Nr = /* @__PURE__ */ u({
|
|
|
3653
3729
|
class: "vdd-modal-curtain",
|
|
3654
3730
|
"data-vdd-modal-curtain": "",
|
|
3655
3731
|
onClick: n[0] ||= (e) => z(u) && z(d)()
|
|
3656
|
-
}), o("div", { class: y(["vdd-modal-window", [m.value, z(i).classes.modal]]) }, [l(
|
|
3732
|
+
}), o("div", { class: y(["vdd-modal-window", [m.value, z(i).classes.modal]]) }, [l(Pr, {
|
|
3657
3733
|
block: "modal",
|
|
3658
3734
|
title: z(s),
|
|
3659
3735
|
icon: z(c),
|
|
@@ -3662,7 +3738,7 @@ var Mr = ["title", "aria-label"], Nr = /* @__PURE__ */ u({
|
|
|
3662
3738
|
"body-padding": z(p),
|
|
3663
3739
|
onClose: n[1] ||= (e) => z(d)()
|
|
3664
3740
|
}, {
|
|
3665
|
-
default:
|
|
3741
|
+
default: G(() => [(T(), r(N(e.instance.component), b(f({
|
|
3666
3742
|
...e.instance.props,
|
|
3667
3743
|
panelId: e.instance.id
|
|
3668
3744
|
})), null, 16))]),
|
|
@@ -3673,9 +3749,9 @@ var Mr = ["title", "aria-label"], Nr = /* @__PURE__ */ u({
|
|
|
3673
3749
|
"closable",
|
|
3674
3750
|
"close-label",
|
|
3675
3751
|
"body-padding"
|
|
3676
|
-
])], 2)], 12,
|
|
3752
|
+
])], 2)], 12, Rr));
|
|
3677
3753
|
}
|
|
3678
|
-
}),
|
|
3754
|
+
}), Br = { class: "vdd-confirmation-message" }, Vr = { class: "vdd-confirmation-actions" }, Hr = /* @__PURE__ */ u({
|
|
3679
3755
|
__name: "VddConfirm",
|
|
3680
3756
|
props: {
|
|
3681
3757
|
message: {},
|
|
@@ -3690,7 +3766,7 @@ var Mr = ["title", "aria-label"], Nr = /* @__PURE__ */ u({
|
|
|
3690
3766
|
onSettled: {}
|
|
3691
3767
|
},
|
|
3692
3768
|
setup(e) {
|
|
3693
|
-
let t = e, n = Y(), r =
|
|
3769
|
+
let t = e, n = Y(), r = Pt(), s = H("confirmButton"), c = !1;
|
|
3694
3770
|
function l(e) {
|
|
3695
3771
|
c || (c = !0, t.onSettled?.(e));
|
|
3696
3772
|
}
|
|
@@ -3704,14 +3780,14 @@ var Mr = ["title", "aria-label"], Nr = /* @__PURE__ */ u({
|
|
|
3704
3780
|
r.setIcon(void 0), s.value?.focus({ preventScroll: !0 });
|
|
3705
3781
|
}), S(() => l(!1)), (t, r) => (T(), a("form", {
|
|
3706
3782
|
class: "vdd-confirmation-form-body",
|
|
3707
|
-
onSubmit:
|
|
3783
|
+
onSubmit: K(u, ["prevent"])
|
|
3708
3784
|
}, [
|
|
3709
3785
|
e.alert ? (T(), a("div", {
|
|
3710
3786
|
key: 0,
|
|
3711
3787
|
class: y(["vdd-confirmation-alert", `vdd-confirmation-alert-${e.alertType}`])
|
|
3712
3788
|
}, [o("span", null, I(e.alert), 1)], 2)) : i("", !0),
|
|
3713
|
-
o("div",
|
|
3714
|
-
o("div",
|
|
3789
|
+
o("div", Br, I(z(n).format(e.message)), 1),
|
|
3790
|
+
o("div", Vr, [o("button", {
|
|
3715
3791
|
type: "button",
|
|
3716
3792
|
class: "vdd-btn vdd-btn-sm vdd-btn-outline",
|
|
3717
3793
|
"data-vdd-confirm-cancel": "",
|
|
@@ -3725,13 +3801,13 @@ var Mr = ["title", "aria-label"], Nr = /* @__PURE__ */ u({
|
|
|
3725
3801
|
}, I(z(n).format(e.yesNo ? z(n).messages.yes : z(n).messages.ok)), 513)])
|
|
3726
3802
|
], 32));
|
|
3727
3803
|
}
|
|
3728
|
-
}),
|
|
3804
|
+
}), Ur = /* @__PURE__ */ u({
|
|
3729
3805
|
__name: "VddModals",
|
|
3730
3806
|
setup(t) {
|
|
3731
3807
|
let n = Y(), { overlays: i } = n;
|
|
3732
3808
|
function o(e) {
|
|
3733
3809
|
return new Promise((t) => {
|
|
3734
|
-
i.openModal(
|
|
3810
|
+
i.openModal(Hr, {
|
|
3735
3811
|
message: e.dirtyOptions?.message ?? {
|
|
3736
3812
|
...n.messages.unsavedChangesMessage,
|
|
3737
3813
|
values: { title: e.title }
|
|
@@ -3746,33 +3822,33 @@ var Mr = ["title", "aria-label"], Nr = /* @__PURE__ */ u({
|
|
|
3746
3822
|
});
|
|
3747
3823
|
});
|
|
3748
3824
|
}
|
|
3749
|
-
return C(() => i.setConfirmRenderer(o)), S(() => i.setConfirmRenderer(null)), (t, n) => (T(!0), a(e, null, A(z(i).state.modals, (e, t) => (T(), r(
|
|
3825
|
+
return C(() => i.setConfirmRenderer(o)), S(() => i.setConfirmRenderer(null)), (t, n) => (T(!0), a(e, null, A(z(i).state.modals, (e, t) => (T(), r(zr, {
|
|
3750
3826
|
key: e.id,
|
|
3751
3827
|
instance: e,
|
|
3752
3828
|
index: t
|
|
3753
3829
|
}, null, 8, ["instance", "index"]))), 128));
|
|
3754
3830
|
}
|
|
3755
|
-
}),
|
|
3831
|
+
}), Wr = {
|
|
3756
3832
|
duration: 5e3,
|
|
3757
3833
|
closable: !0
|
|
3758
3834
|
}, X = D({
|
|
3759
3835
|
items: [],
|
|
3760
3836
|
adapter: null,
|
|
3761
|
-
defaults: { ...
|
|
3762
|
-
}),
|
|
3763
|
-
function
|
|
3837
|
+
defaults: { ...Wr }
|
|
3838
|
+
}), Gr = /* @__PURE__ */ new Set(), Kr = 0;
|
|
3839
|
+
function qr(e) {
|
|
3764
3840
|
return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
|
|
3765
3841
|
}
|
|
3766
|
-
function
|
|
3767
|
-
let i =
|
|
3768
|
-
if (
|
|
3842
|
+
function Jr(e, t, n, r) {
|
|
3843
|
+
let i = qr(r);
|
|
3844
|
+
if (Gr.has(t)) {
|
|
3769
3845
|
e.update(t, n, {
|
|
3770
3846
|
...i,
|
|
3771
3847
|
id: t
|
|
3772
3848
|
});
|
|
3773
3849
|
return;
|
|
3774
3850
|
}
|
|
3775
|
-
|
|
3851
|
+
Gr.add(t), e.show(t, n, {
|
|
3776
3852
|
type: "info",
|
|
3777
3853
|
duration: X.defaults.duration,
|
|
3778
3854
|
closable: X.defaults.closable,
|
|
@@ -3781,11 +3857,11 @@ function qr(e, t, n, r) {
|
|
|
3781
3857
|
});
|
|
3782
3858
|
}
|
|
3783
3859
|
function Z(e, t = {}) {
|
|
3784
|
-
let n = t.id ?? `vdd-toast-${++
|
|
3860
|
+
let n = t.id ?? `vdd-toast-${++Kr}`, r = {
|
|
3785
3861
|
...t,
|
|
3786
3862
|
id: n
|
|
3787
3863
|
};
|
|
3788
|
-
if (X.adapter) return
|
|
3864
|
+
if (X.adapter) return Jr(X.adapter, n, e, t), n;
|
|
3789
3865
|
let i = X.items.find((e) => e.id === n);
|
|
3790
3866
|
return i ? (i.message = e, i.options = {
|
|
3791
3867
|
...i.options,
|
|
@@ -3798,26 +3874,26 @@ function Z(e, t = {}) {
|
|
|
3798
3874
|
revision: 0
|
|
3799
3875
|
}), n);
|
|
3800
3876
|
}
|
|
3801
|
-
function
|
|
3877
|
+
function Yr(e) {
|
|
3802
3878
|
let t = X.items.find((t) => t.id === e);
|
|
3803
3879
|
t && !t.exiting && (t.exiting = !0, t.options.onClose?.());
|
|
3804
3880
|
}
|
|
3805
|
-
function
|
|
3881
|
+
function Xr(e) {
|
|
3806
3882
|
let t = X.items.findIndex((t) => t.id === e);
|
|
3807
3883
|
t !== -1 && X.items.splice(t, 1);
|
|
3808
3884
|
}
|
|
3809
|
-
function
|
|
3885
|
+
function Zr(e) {
|
|
3810
3886
|
if (X.adapter) {
|
|
3811
|
-
e === void 0 ?
|
|
3887
|
+
e === void 0 ? Gr.clear() : Gr.delete(e), X.adapter.dismiss(e);
|
|
3812
3888
|
return;
|
|
3813
3889
|
}
|
|
3814
3890
|
if (e === void 0) {
|
|
3815
|
-
for (let e of [...X.items])
|
|
3891
|
+
for (let e of [...X.items]) Yr(e.id);
|
|
3816
3892
|
return;
|
|
3817
3893
|
}
|
|
3818
|
-
|
|
3894
|
+
Yr(e);
|
|
3819
3895
|
}
|
|
3820
|
-
var
|
|
3896
|
+
var Qr = Object.assign((e, t) => Z(e, t), {
|
|
3821
3897
|
info: (e, t) => Z(e, {
|
|
3822
3898
|
...t,
|
|
3823
3899
|
type: "info"
|
|
@@ -3834,7 +3910,7 @@ var Zr = Object.assign((e, t) => Z(e, t), {
|
|
|
3834
3910
|
...t,
|
|
3835
3911
|
type: "error"
|
|
3836
3912
|
}),
|
|
3837
|
-
dismiss:
|
|
3913
|
+
dismiss: Zr,
|
|
3838
3914
|
promise(e, t, n) {
|
|
3839
3915
|
let r = Z(t.pending, {
|
|
3840
3916
|
...n,
|
|
@@ -3858,45 +3934,45 @@ var Zr = Object.assign((e, t) => Z(e, t), {
|
|
|
3858
3934
|
}), e;
|
|
3859
3935
|
}
|
|
3860
3936
|
});
|
|
3861
|
-
function
|
|
3862
|
-
X.items.splice(0), X.adapter = null, X.defaults = { ...
|
|
3937
|
+
function $r() {
|
|
3938
|
+
X.items.splice(0), X.adapter = null, X.defaults = { ...Wr }, Gr.clear();
|
|
3863
3939
|
}
|
|
3864
|
-
function
|
|
3865
|
-
if (X.defaults = { ...t }, L(X.adapter) === L(e) || (X.adapter = e,
|
|
3940
|
+
function ei(e, t) {
|
|
3941
|
+
if (X.defaults = { ...t }, L(X.adapter) === L(e) || (X.adapter = e, Gr.clear(), !e)) return;
|
|
3866
3942
|
let n = X.items.splice(0).filter((e) => !e.exiting);
|
|
3867
|
-
for (let t of n)
|
|
3943
|
+
for (let t of n) Jr(e, t.id, t.message, t.options);
|
|
3868
3944
|
}
|
|
3869
3945
|
//#endregion
|
|
3870
3946
|
//#region src/components/VddToastIcon.vue?vue&type=script&setup=true&lang.ts
|
|
3871
|
-
var
|
|
3947
|
+
var ti = {
|
|
3872
3948
|
class: "vdd-toast__icon",
|
|
3873
3949
|
viewBox: "0 0 16 16",
|
|
3874
3950
|
fill: "none",
|
|
3875
3951
|
"aria-hidden": "true"
|
|
3876
|
-
},
|
|
3952
|
+
}, ni = {
|
|
3877
3953
|
key: 0,
|
|
3878
3954
|
d: "M5 8l2 2 4-4",
|
|
3879
3955
|
stroke: "currentColor",
|
|
3880
3956
|
"stroke-width": "1.5",
|
|
3881
3957
|
"stroke-linecap": "round",
|
|
3882
3958
|
"stroke-linejoin": "round"
|
|
3883
|
-
},
|
|
3959
|
+
}, ri = {
|
|
3884
3960
|
key: 1,
|
|
3885
3961
|
d: "M5.5 5.5l5 5M10.5 5.5l-5 5",
|
|
3886
3962
|
stroke: "currentColor",
|
|
3887
3963
|
"stroke-width": "1.5",
|
|
3888
3964
|
"stroke-linecap": "round"
|
|
3889
|
-
},
|
|
3965
|
+
}, ii = {
|
|
3890
3966
|
key: 2,
|
|
3891
3967
|
d: "M8 5v.01M8 7.5v3.5",
|
|
3892
3968
|
stroke: "currentColor",
|
|
3893
3969
|
"stroke-width": "1.5",
|
|
3894
3970
|
"stroke-linecap": "round"
|
|
3895
|
-
},
|
|
3971
|
+
}, ai = /* @__PURE__ */ u({
|
|
3896
3972
|
__name: "VddToastIcon",
|
|
3897
3973
|
props: { type: {} },
|
|
3898
3974
|
setup(t) {
|
|
3899
|
-
return (n, r) => (T(), a("svg",
|
|
3975
|
+
return (n, r) => (T(), a("svg", ti, [t.type === "warning" ? (T(), a(e, { key: 0 }, [r[0] ||= o("path", {
|
|
3900
3976
|
d: "M8 2.5L14 13.5H2L8 2.5z",
|
|
3901
3977
|
stroke: "currentColor",
|
|
3902
3978
|
"stroke-width": "1.5",
|
|
@@ -3912,9 +3988,9 @@ var ei = {
|
|
|
3912
3988
|
r: "7",
|
|
3913
3989
|
stroke: "currentColor",
|
|
3914
3990
|
"stroke-width": "1.5"
|
|
3915
|
-
}, null, -1), t.type === "success" ? (T(), a("path",
|
|
3991
|
+
}, null, -1), t.type === "success" ? (T(), a("path", ni)) : t.type === "error" ? (T(), a("path", ri)) : (T(), a("path", ii))], 64))]));
|
|
3916
3992
|
}
|
|
3917
|
-
}),
|
|
3993
|
+
}), oi = ["data-vdd-toast"], si = ["aria-label"], ci = /* @__PURE__ */ u({
|
|
3918
3994
|
__name: "VddToastItem",
|
|
3919
3995
|
props: {
|
|
3920
3996
|
toast: {},
|
|
@@ -3927,81 +4003,81 @@ var ei = {
|
|
|
3927
4003
|
},
|
|
3928
4004
|
emits: ["exited"],
|
|
3929
4005
|
setup(t, { emit: s }) {
|
|
3930
|
-
let l =
|
|
3931
|
-
function
|
|
3932
|
-
e <= 0 || (
|
|
3933
|
-
}
|
|
3934
|
-
function j() {
|
|
3935
|
-
E &&= (clearTimeout(E), null);
|
|
4006
|
+
let l = ir(), u = t, d = s, f = H("card"), p = H("body"), m = n(() => u.toast.options.type ?? "info"), h = n(() => u.toast.options.duration ?? u.defaultDuration), g = n(() => u.toast.options.closable ?? u.defaultClosable), v = n(() => u.toast.options.icon ?? null), w = k(u.animation === "none" ? "vdd-toast--visible" : u.animation === "fade" ? "vdd-toast--fade-entering" : u.isLeft ? "vdd-toast--entering-left" : "vdd-toast--entering"), E = k(!1), D = null, O = 0, A = 0;
|
|
4007
|
+
function j(e) {
|
|
4008
|
+
e <= 0 || (A = Date.now(), D = setTimeout(() => Yr(u.toast.id), e));
|
|
3936
4009
|
}
|
|
3937
|
-
U([m, () => l.toast.revision], () => {
|
|
3938
|
-
j(), D = m.value, A(m.value);
|
|
3939
|
-
}, { immediate: !0 });
|
|
3940
4010
|
function M() {
|
|
3941
|
-
|
|
4011
|
+
D &&= (clearTimeout(D), null);
|
|
3942
4012
|
}
|
|
4013
|
+
U([h, () => u.toast.revision], () => {
|
|
4014
|
+
M(), O = h.value, j(h.value);
|
|
4015
|
+
}, { immediate: !0 });
|
|
3943
4016
|
function P() {
|
|
3944
|
-
|
|
4017
|
+
u.pauseOnHover && h.value !== 0 && D && (M(), O = Math.max(0, O - (Date.now() - A)), E.value = !0);
|
|
3945
4018
|
}
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
4019
|
+
function F() {
|
|
4020
|
+
u.pauseOnHover && h.value !== 0 && (E.value = !1, j(O));
|
|
4021
|
+
}
|
|
4022
|
+
let L = null;
|
|
4023
|
+
function R() {
|
|
4024
|
+
let e = f.value;
|
|
4025
|
+
e && !u.toast.exiting && (e.style.maxHeight = `${e.scrollHeight}px`);
|
|
3950
4026
|
}
|
|
3951
4027
|
C(() => {
|
|
3952
|
-
|
|
3953
|
-
|
|
4028
|
+
R(), typeof ResizeObserver < "u" && p.value && (L = new ResizeObserver(R), L.observe(p.value)), u.animation !== "none" && requestAnimationFrame(() => {
|
|
4029
|
+
w.value = "vdd-toast--visible";
|
|
3954
4030
|
});
|
|
3955
4031
|
});
|
|
3956
|
-
let
|
|
3957
|
-
U(() =>
|
|
4032
|
+
let B = null;
|
|
4033
|
+
U(() => u.toast.exiting, (e) => {
|
|
3958
4034
|
if (e) {
|
|
3959
|
-
if (
|
|
3960
|
-
|
|
4035
|
+
if (M(), L?.disconnect(), L = null, u.animation === "none" || !f.value) {
|
|
4036
|
+
d("exited", u.toast.id);
|
|
3961
4037
|
return;
|
|
3962
4038
|
}
|
|
3963
|
-
|
|
4039
|
+
B = setTimeout(() => d("exited", u.toast.id), 520);
|
|
3964
4040
|
}
|
|
3965
4041
|
}, { immediate: !0 });
|
|
3966
|
-
function
|
|
3967
|
-
|
|
4042
|
+
function V(e) {
|
|
4043
|
+
u.toast.exiting && e.propertyName === "max-height" && d("exited", u.toast.id);
|
|
3968
4044
|
}
|
|
3969
4045
|
return S(() => {
|
|
3970
|
-
|
|
4046
|
+
M(), B && clearTimeout(B), L?.disconnect();
|
|
3971
4047
|
}), (n, s) => (T(), a("div", {
|
|
3972
4048
|
ref_key: "card",
|
|
3973
|
-
ref:
|
|
4049
|
+
ref: f,
|
|
3974
4050
|
role: "status",
|
|
3975
4051
|
"aria-live": "polite",
|
|
3976
4052
|
class: y(["vdd-toast", [
|
|
3977
|
-
`vdd-toast--${
|
|
3978
|
-
|
|
4053
|
+
`vdd-toast--${m.value}`,
|
|
4054
|
+
w.value,
|
|
3979
4055
|
{
|
|
3980
4056
|
"vdd-toast--exiting": t.toast.exiting,
|
|
3981
|
-
"vdd-toast--paused":
|
|
4057
|
+
"vdd-toast--paused": E.value
|
|
3982
4058
|
}
|
|
3983
4059
|
]]),
|
|
3984
4060
|
"data-vdd-toast": t.toast.id,
|
|
3985
|
-
onMouseenter:
|
|
3986
|
-
onMouseleave:
|
|
3987
|
-
onTransitionend:
|
|
4061
|
+
onMouseenter: P,
|
|
4062
|
+
onMouseleave: F,
|
|
4063
|
+
onTransitionend: V
|
|
3988
4064
|
}, [
|
|
3989
|
-
|
|
4065
|
+
v.value ? (T(), r(N(v.value), { key: 0 })) : (T(), r(ai, {
|
|
3990
4066
|
key: 1,
|
|
3991
|
-
type:
|
|
4067
|
+
type: m.value
|
|
3992
4068
|
}, null, 8, ["type"])),
|
|
3993
4069
|
o("div", {
|
|
3994
4070
|
ref_key: "body",
|
|
3995
|
-
ref:
|
|
4071
|
+
ref: p,
|
|
3996
4072
|
class: "vdd-toast__body"
|
|
3997
4073
|
}, [t.toast.options.content ? (T(), r(N(t.toast.options.content), b(_({ key: 0 }, t.toast.options.contentProps)), null, 16)) : (T(), a(e, { key: 1 }, [c(I(t.toast.message), 1)], 64))], 512),
|
|
3998
|
-
|
|
4074
|
+
g.value ? (T(), a("button", {
|
|
3999
4075
|
key: 2,
|
|
4000
4076
|
type: "button",
|
|
4001
4077
|
class: "vdd-toast__close",
|
|
4002
|
-
"aria-label": "
|
|
4078
|
+
"aria-label": z(l)("closeNotification"),
|
|
4003
4079
|
"data-vdd-toast-close": "",
|
|
4004
|
-
onClick: s[0] ||= (e) => z(
|
|
4080
|
+
onClick: s[0] ||= (e) => z(Yr)(t.toast.id)
|
|
4005
4081
|
}, [...s[1] ||= [o("svg", {
|
|
4006
4082
|
width: "14",
|
|
4007
4083
|
height: "14",
|
|
@@ -4013,15 +4089,15 @@ var ei = {
|
|
|
4013
4089
|
stroke: "currentColor",
|
|
4014
4090
|
"stroke-width": "1.5",
|
|
4015
4091
|
"stroke-linecap": "round"
|
|
4016
|
-
})], -1)]])) : i("", !0),
|
|
4017
|
-
t.showProgress &&
|
|
4092
|
+
})], -1)]], 8, si)) : i("", !0),
|
|
4093
|
+
t.showProgress && h.value > 0 ? (T(), a("div", {
|
|
4018
4094
|
key: 3,
|
|
4019
4095
|
class: "vdd-toast__progress",
|
|
4020
|
-
style: x({ animationDuration: `${
|
|
4096
|
+
style: x({ animationDuration: `${h.value}ms` })
|
|
4021
4097
|
}, null, 4)) : i("", !0)
|
|
4022
|
-
], 42,
|
|
4098
|
+
], 42, oi));
|
|
4023
4099
|
}
|
|
4024
|
-
}),
|
|
4100
|
+
}), li = ["aria-label"], ui = /* @__PURE__ */ u({
|
|
4025
4101
|
__name: "VddToasts",
|
|
4026
4102
|
props: {
|
|
4027
4103
|
position: { default: "top-right" },
|
|
@@ -4048,38 +4124,38 @@ var ei = {
|
|
|
4048
4124
|
adapter: {}
|
|
4049
4125
|
},
|
|
4050
4126
|
setup(s) {
|
|
4051
|
-
let c = s;
|
|
4127
|
+
let c = ir(), l = s;
|
|
4052
4128
|
U(() => [
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
], ([e, t, n]) =>
|
|
4129
|
+
l.adapter,
|
|
4130
|
+
l.defaultDuration,
|
|
4131
|
+
l.defaultClosable
|
|
4132
|
+
], ([e, t, n]) => ei(e ?? null, {
|
|
4057
4133
|
duration: t,
|
|
4058
4134
|
closable: n
|
|
4059
4135
|
}), { immediate: !0 }), S(() => {
|
|
4060
|
-
|
|
4061
|
-
duration:
|
|
4062
|
-
closable:
|
|
4136
|
+
l.adapter && L(X.adapter) === L(l.adapter) && ei(null, {
|
|
4137
|
+
duration: l.defaultDuration,
|
|
4138
|
+
closable: l.defaultClosable
|
|
4063
4139
|
});
|
|
4064
4140
|
});
|
|
4065
|
-
let
|
|
4141
|
+
let u = n(() => {
|
|
4066
4142
|
let e = [], t = 0;
|
|
4067
4143
|
for (let n of X.items) {
|
|
4068
4144
|
if (n.exiting) {
|
|
4069
4145
|
e.push(n);
|
|
4070
4146
|
continue;
|
|
4071
4147
|
}
|
|
4072
|
-
if (t >=
|
|
4148
|
+
if (t >= l.maxVisible) break;
|
|
4073
4149
|
e.push(n), t++;
|
|
4074
4150
|
}
|
|
4075
|
-
return
|
|
4151
|
+
return l.newestOnTop ? [...e].reverse() : e;
|
|
4076
4152
|
});
|
|
4077
4153
|
U(() => X.items.map((e) => `${e.id}:${e.exiting}`).join(","), () => {
|
|
4078
|
-
let e = new Set(
|
|
4079
|
-
for (let t of [...X.items]) t.exiting && !e.has(t.id) &&
|
|
4154
|
+
let e = new Set(u.value.map((e) => e.id));
|
|
4155
|
+
for (let t of [...X.items]) t.exiting && !e.has(t.id) && Xr(t.id);
|
|
4080
4156
|
}, { immediate: !0 });
|
|
4081
|
-
let
|
|
4082
|
-
return (n,
|
|
4157
|
+
let d = n(() => l.position.endsWith("left"));
|
|
4158
|
+
return (n, l) => s.adapter ? (T(), r(t, {
|
|
4083
4159
|
key: 0,
|
|
4084
4160
|
to: "body"
|
|
4085
4161
|
}, [s.adapter.component ? (T(), r(N(s.adapter.component), {
|
|
@@ -4092,19 +4168,19 @@ var ei = {
|
|
|
4092
4168
|
class: y(["vdd-toast-container", [`vdd-toast-container--${s.position}`, s.newestOnTop ? "vdd-toast-container--newest-top" : "vdd-toast-container--newest-bottom"]]),
|
|
4093
4169
|
style: x({ width: `${s.width}px` }),
|
|
4094
4170
|
role: "region",
|
|
4095
|
-
"aria-label": "
|
|
4171
|
+
"aria-label": z(c)("notifications"),
|
|
4096
4172
|
"aria-live": "polite",
|
|
4097
4173
|
"data-vdd-toasts": ""
|
|
4098
|
-
}, [(T(!0), a(e, null, A(
|
|
4174
|
+
}, [(T(!0), a(e, null, A(u.value, (e) => (T(), r(ci, {
|
|
4099
4175
|
key: e.id,
|
|
4100
4176
|
toast: e,
|
|
4101
|
-
"is-left":
|
|
4177
|
+
"is-left": d.value,
|
|
4102
4178
|
"show-progress": s.progressBar,
|
|
4103
4179
|
"pause-on-hover": s.pauseOnHover,
|
|
4104
4180
|
animation: s.animation,
|
|
4105
4181
|
"default-duration": s.defaultDuration,
|
|
4106
4182
|
"default-closable": s.defaultClosable,
|
|
4107
|
-
onExited: z(
|
|
4183
|
+
onExited: z(Xr)
|
|
4108
4184
|
}, null, 8, [
|
|
4109
4185
|
"toast",
|
|
4110
4186
|
"is-left",
|
|
@@ -4114,20 +4190,20 @@ var ei = {
|
|
|
4114
4190
|
"default-duration",
|
|
4115
4191
|
"default-closable",
|
|
4116
4192
|
"onExited"
|
|
4117
|
-
]))), 128))],
|
|
4193
|
+
]))), 128))], 14, li)]));
|
|
4118
4194
|
}
|
|
4119
|
-
}), Q = (e) => e === "width" || e === "both", $ = (e) => e === "height" || e === "both",
|
|
4195
|
+
}), Q = (e) => e === "width" || e === "both", $ = (e) => e === "height" || e === "both", di = (e, t) => t === "inline" ? $(e) ? "both" : "width" : Q(e) ? "both" : "height", fi = (e, t) => t === "inline" ? e === "both" ? "height" : Q(e) ? null : e : e === "both" ? "width" : $(e) ? null : e, pi = (e, t) => $(t) ? [] : Q(t) ? e.startsWith("top-") ? ["top-left", "top-right"] : ["bottom-left", "bottom-right"] : [e], mi = [
|
|
4120
4196
|
"top-left",
|
|
4121
4197
|
"top-right",
|
|
4122
4198
|
"bottom-left",
|
|
4123
4199
|
"bottom-right"
|
|
4124
4200
|
];
|
|
4125
|
-
function
|
|
4201
|
+
function hi(e, t, n) {
|
|
4126
4202
|
let r = t - e.left, i = n - e.top;
|
|
4127
4203
|
return r < 80 && i < 80 ? "top-left" : r > e.width - 80 && i < 80 ? "top-right" : r < 80 && i > e.height - 80 ? "bottom-left" : r > e.width - 80 && i > e.height - 80 ? "bottom-right" : null;
|
|
4128
4204
|
}
|
|
4129
|
-
var
|
|
4130
|
-
function
|
|
4205
|
+
var gi = (e) => e.endsWith("-left") ? e.replace("-left", "-right") : e.replace("-right", "-left");
|
|
4206
|
+
function _i(e, t) {
|
|
4131
4207
|
return {
|
|
4132
4208
|
left: (t ? e.inlineEnd : e.inlineStart) + 8,
|
|
4133
4209
|
right: (t ? e.inlineStart : e.inlineEnd) + 8,
|
|
@@ -4135,7 +4211,7 @@ function mi(e, t) {
|
|
|
4135
4211
|
bottom: e.bottom
|
|
4136
4212
|
};
|
|
4137
4213
|
}
|
|
4138
|
-
function
|
|
4214
|
+
function vi(e, t, n, r) {
|
|
4139
4215
|
if (e === "free") return [
|
|
4140
4216
|
"n",
|
|
4141
4217
|
"ne",
|
|
@@ -4149,7 +4225,7 @@ function hi(e, t, n, r) {
|
|
|
4149
4225
|
let i = t.startsWith("top-") ? "s" : "n", a = t.endsWith("-right") === r ? "e" : "w", o = Q(n), s = $(n), c = [];
|
|
4150
4226
|
return c.push(...o ? ["e", "w"] : [a]), c.push(...s ? ["n", "s"] : [i]), !o && !s && c.push(`${i}${a}`), c;
|
|
4151
4227
|
}
|
|
4152
|
-
function
|
|
4228
|
+
function yi(e, t, n, r) {
|
|
4153
4229
|
let i = e;
|
|
4154
4230
|
if (n.inline) {
|
|
4155
4231
|
let e = t.includes("e");
|
|
@@ -4157,7 +4233,7 @@ function gi(e, t, n, r) {
|
|
|
4157
4233
|
}
|
|
4158
4234
|
return n.block && (i = `${t.includes("s") ? "top" : "bottom"}-${i.endsWith("-right") ? "right" : "left"}`), i;
|
|
4159
4235
|
}
|
|
4160
|
-
function
|
|
4236
|
+
function bi(e, t, n, r, i) {
|
|
4161
4237
|
let a = t.length === 0, o = 0;
|
|
4162
4238
|
for (let s of t) {
|
|
4163
4239
|
let t = n[s] ?? [], c = t.indexOf(e);
|
|
@@ -4174,8 +4250,8 @@ function _i(e, t, n, r, i) {
|
|
|
4174
4250
|
}
|
|
4175
4251
|
//#endregion
|
|
4176
4252
|
//#region src/core/overlayState.ts
|
|
4177
|
-
var
|
|
4178
|
-
function
|
|
4253
|
+
var xi = Symbol("vdd-panel-overlay");
|
|
4254
|
+
function Si() {
|
|
4179
4255
|
let e = F(null), t = D({
|
|
4180
4256
|
top: 0,
|
|
4181
4257
|
bottom: 0,
|
|
@@ -4209,14 +4285,14 @@ function yi() {
|
|
|
4209
4285
|
d += 1, r[e] = d, n.value = e;
|
|
4210
4286
|
},
|
|
4211
4287
|
dock: (e, t, n) => {
|
|
4212
|
-
let r =
|
|
4213
|
-
for (let t of
|
|
4288
|
+
let r = pi(t, n);
|
|
4289
|
+
for (let t of mi) {
|
|
4214
4290
|
let n = i[t].filter((t) => t !== e), a = r.includes(t) ? [...n, e] : n;
|
|
4215
4291
|
a.length === i[t].length && a.every((e, n) => e === i[t][n]) || (i[t] = a);
|
|
4216
4292
|
}
|
|
4217
4293
|
},
|
|
4218
4294
|
undock: (e) => {
|
|
4219
|
-
for (let t of
|
|
4295
|
+
for (let t of mi) i[t].includes(e) && (i[t] = i[t].filter((t) => t !== e));
|
|
4220
4296
|
},
|
|
4221
4297
|
reportSize: (e, t) => {
|
|
4222
4298
|
a[e] !== t && (a[e] = t);
|
|
@@ -4248,16 +4324,16 @@ function yi() {
|
|
|
4248
4324
|
}
|
|
4249
4325
|
//#endregion
|
|
4250
4326
|
//#region src/composables/usePanelOverlay.ts
|
|
4251
|
-
function
|
|
4252
|
-
let e = p(
|
|
4327
|
+
function Ci() {
|
|
4328
|
+
let e = p(xi, null);
|
|
4253
4329
|
if (!e) throw Error("[vue-dockable-desktop] This component must be used inside a <VddPanelOverlay>. Wrap your panel content in one to enable toolbars and floating widgets.");
|
|
4254
4330
|
return e;
|
|
4255
4331
|
}
|
|
4256
|
-
function
|
|
4257
|
-
return p(
|
|
4332
|
+
function wi() {
|
|
4333
|
+
return p(xi, null);
|
|
4258
4334
|
}
|
|
4259
|
-
function
|
|
4260
|
-
let e =
|
|
4335
|
+
function Ti() {
|
|
4336
|
+
let e = Ci();
|
|
4261
4337
|
return {
|
|
4262
4338
|
openIds: n(() => e.managedIds()),
|
|
4263
4339
|
open: e.openManaged,
|
|
@@ -4268,10 +4344,10 @@ function Si() {
|
|
|
4268
4344
|
}
|
|
4269
4345
|
//#endregion
|
|
4270
4346
|
//#region src/components/VddFloatingWidget.vue?vue&type=script&setup=true&lang.ts
|
|
4271
|
-
var
|
|
4347
|
+
var Ei = ["dir", "data-vdd-widget"], Di = {
|
|
4272
4348
|
key: 0,
|
|
4273
4349
|
class: "vdd-panel-float__icon"
|
|
4274
|
-
},
|
|
4350
|
+
}, Oi = { class: "vdd-panel-float__title" }, ki = ["title", "aria-label"], Ai = { class: "vdd-panel-float__body" }, ji = ["data-vdd-widget-resize", "onPointerdown"], Mi = /* @__PURE__ */ u({
|
|
4275
4351
|
__name: "VddFloatingWidget",
|
|
4276
4352
|
props: /*@__PURE__*/ g({
|
|
4277
4353
|
widgetId: {},
|
|
@@ -4297,7 +4373,7 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4297
4373
|
}),
|
|
4298
4374
|
emits: ["update:open", "update:placement"],
|
|
4299
4375
|
setup(t) {
|
|
4300
|
-
let s = t, c = B(t, "open"), l = B(t, "placement"), u = Y(), d =
|
|
4376
|
+
let s = t, c = B(t, "open"), l = B(t, "placement"), u = Y(), d = wi(), f = H("el"), p = n(() => u.state.isRtl), m = n(() => l.value.anchor), h = n(() => l.value.stretch), g = k("docked"), _ = k(null), v = k({
|
|
4301
4377
|
w: s.width,
|
|
4302
4378
|
h: s.height
|
|
4303
4379
|
}), b = k({
|
|
@@ -4334,7 +4410,7 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4334
4410
|
let e = m.value.endsWith("-right") ? "right" : "left", t = [`top-${e}`, `bottom-${e}`].flatMap((e) => d.stacks[e] ?? []).filter((e) => e !== s.widgetId);
|
|
4335
4411
|
t.length !== 0 && (w = !0, console.warn(`[vue-dockable-desktop] <VddFloatingWidget> "${s.widgetId}" stretches the block axis ("${h.value}") while ${t.length} other widget(s) are anchored to the same side (${t.join(", ")}). A block-stretched widget spans the axis stacking uses to separate siblings, so it cannot stack and will overlap them — z-order decides which is on top. Give it a fixed height, or move the others to the opposite side.`));
|
|
4336
4412
|
});
|
|
4337
|
-
let E = n(() => d?.zOrders[s.widgetId] ?? 101), D = n(() => !d || d.topId.value === s.widgetId), O = () =>
|
|
4413
|
+
let E = n(() => d?.zOrders[s.widgetId] ?? 101), D = n(() => !d || d.topId.value === s.widgetId), O = () => _i(d?.insets ?? {
|
|
4338
4414
|
top: 0,
|
|
4339
4415
|
bottom: 0,
|
|
4340
4416
|
inlineStart: 0,
|
|
@@ -4350,7 +4426,7 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4350
4426
|
let P = n(() => !d || g.value !== "docked" ? {
|
|
4351
4427
|
offset: 0,
|
|
4352
4428
|
registered: !0
|
|
4353
|
-
} :
|
|
4429
|
+
} : bi(s.widgetId, pi(m.value, h.value), d.stacks, d.dockedSizes, s.height)), F = n(() => {
|
|
4354
4430
|
if (g.value !== "docked" || !d) return {
|
|
4355
4431
|
left: `${_.value?.x ?? 0}px`,
|
|
4356
4432
|
top: `${_.value?.y ?? 0}px`,
|
|
@@ -4364,7 +4440,7 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4364
4440
|
pointerEvents: P.value.registered ? void 0 : "none"
|
|
4365
4441
|
};
|
|
4366
4442
|
return Q(h.value) ? (t.insetInlineStart = `${d.insets.inlineStart + 8}px`, t.insetInlineEnd = `${d.insets.inlineEnd + 8}px`) : (t[m.value.endsWith("-right") ? "insetInlineEnd" : "insetInlineStart"] = "8px", t.width = `${v.value.w}px`), $(h.value) ? (t.top = `${e.top}px`, t.bottom = `${e.bottom}px`) : m.value.startsWith("top-") ? (t.top = `${e.top + P.value.offset}px`, t.height = `${v.value.h}px`) : (t.bottom = `${e.bottom + P.value.offset}px`, t.height = `${v.value.h}px`), t;
|
|
4367
|
-
}), L = n(() =>
|
|
4443
|
+
}), L = n(() => vi(g.value, m.value, h.value, p.value)), R = null;
|
|
4368
4444
|
function V(e) {
|
|
4369
4445
|
if (e.button !== 0) return;
|
|
4370
4446
|
e.preventDefault();
|
|
@@ -4407,21 +4483,21 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4407
4483
|
};
|
|
4408
4484
|
let r = d?.container.value;
|
|
4409
4485
|
if (r && d) {
|
|
4410
|
-
let t =
|
|
4411
|
-
d.hovered.value = t && p.value ?
|
|
4486
|
+
let t = hi(r.getBoundingClientRect(), e.clientX, e.clientY);
|
|
4487
|
+
d.hovered.value = t && p.value ? gi(t) : t;
|
|
4412
4488
|
}
|
|
4413
4489
|
}
|
|
4414
|
-
function
|
|
4490
|
+
function W() {
|
|
4415
4491
|
if (R?.moved && d) {
|
|
4416
4492
|
let e = d.hovered.value;
|
|
4417
4493
|
e && (g.value = "docked", _.value = null, C(e, h.value)), d.hovered.value = null, d.draggingId.value = null;
|
|
4418
4494
|
}
|
|
4419
4495
|
document.body.classList.remove("vdd-dragging-active"), R = null;
|
|
4420
4496
|
}
|
|
4421
|
-
function
|
|
4497
|
+
function G() {
|
|
4422
4498
|
R?.moved && d && (d.hovered.value = null, d.draggingId.value = null), document.body.classList.remove("vdd-dragging-active"), R = null;
|
|
4423
4499
|
}
|
|
4424
|
-
function
|
|
4500
|
+
function te(e, t) {
|
|
4425
4501
|
if (t.button !== 0) return;
|
|
4426
4502
|
t.preventDefault(), t.stopPropagation();
|
|
4427
4503
|
let n = 0, r = 0;
|
|
@@ -4451,7 +4527,7 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4451
4527
|
if (!n.inline && !n.block) return;
|
|
4452
4528
|
l = !0;
|
|
4453
4529
|
let r = t;
|
|
4454
|
-
n.inline && (r =
|
|
4530
|
+
n.inline && (r = fi(r, "inline")), n.block && (r = fi(r, "block")), C(yi(m.value, e, n, p.value), r);
|
|
4455
4531
|
}
|
|
4456
4532
|
$e({
|
|
4457
4533
|
element: t.currentTarget,
|
|
@@ -4481,7 +4557,7 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4481
4557
|
let e = i - f.left - f.right, t = a - f.top - f.bottom - P.value.offset, n = h.value, r = { ...u };
|
|
4482
4558
|
o && !Q(n) && (p.w >= e - 16 ? r.inline = !0 : u.inline && p.w < e - 40 && (r.inline = !1)), c && !$(n) && (p.h >= t - 16 ? r.block = !0 : u.block && p.h < t - 40 && (r.block = !1)), (r.inline !== u.inline || r.block !== u.block) && (u = r, b.value = r);
|
|
4483
4559
|
}
|
|
4484
|
-
let m = l ?
|
|
4560
|
+
let m = l ? fi(fi(h.value, o ? "inline" : "block"), c ? "block" : "inline") : h.value;
|
|
4485
4561
|
v.value = {
|
|
4486
4562
|
w: Q(m) ? v.value.w : p.w,
|
|
4487
4563
|
h: $(m) ? v.value.h : p.h
|
|
@@ -4503,7 +4579,7 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4503
4579
|
h: u.block ? e.h : v.value.h
|
|
4504
4580
|
};
|
|
4505
4581
|
let t = h.value;
|
|
4506
|
-
u.inline && (t =
|
|
4582
|
+
u.inline && (t = di(t, "inline")), u.block && (t = di(t, "block")), C(m.value, t), b.value = {
|
|
4507
4583
|
inline: !1,
|
|
4508
4584
|
block: !1
|
|
4509
4585
|
};
|
|
@@ -4523,16 +4599,16 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4523
4599
|
"data-vdd-widget": t.widgetId,
|
|
4524
4600
|
onPointerdown: s[2] ||= (e) => z(d)?.focus(t.widgetId),
|
|
4525
4601
|
onPointermove: ee,
|
|
4526
|
-
onPointerup:
|
|
4527
|
-
onPointercancel:
|
|
4602
|
+
onPointerup: W,
|
|
4603
|
+
onPointercancel: G
|
|
4528
4604
|
}, [
|
|
4529
4605
|
o("div", {
|
|
4530
4606
|
class: "vdd-panel-float__header",
|
|
4531
4607
|
"data-vdd-widget-header": "",
|
|
4532
4608
|
onPointerdown: V
|
|
4533
4609
|
}, [
|
|
4534
|
-
t.icon ? (T(), a("span",
|
|
4535
|
-
o("span",
|
|
4610
|
+
t.icon ? (T(), a("span", Di, [(T(), r(N(t.icon)))])) : i("", !0),
|
|
4611
|
+
o("span", Oi, I(z(u).format(t.title)), 1),
|
|
4536
4612
|
o("button", {
|
|
4537
4613
|
type: "button",
|
|
4538
4614
|
class: "vdd-panel-float__close",
|
|
@@ -4540,7 +4616,7 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4540
4616
|
"aria-label": z(u).format(z(u).messages.close),
|
|
4541
4617
|
"data-vdd-widget-close": "",
|
|
4542
4618
|
onClick: s[0] ||= (e) => c.value = !1,
|
|
4543
|
-
onPointerdown: s[1] ||=
|
|
4619
|
+
onPointerdown: s[1] ||= K(() => {}, ["stop"])
|
|
4544
4620
|
}, [...s[3] ||= [o("svg", {
|
|
4545
4621
|
width: "8",
|
|
4546
4622
|
height: "8",
|
|
@@ -4559,24 +4635,24 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4559
4635
|
y1: "1",
|
|
4560
4636
|
x2: "1",
|
|
4561
4637
|
y2: "9"
|
|
4562
|
-
})], -1)]], 40,
|
|
4638
|
+
})], -1)]], 40, ki)
|
|
4563
4639
|
], 32),
|
|
4564
|
-
o("div",
|
|
4640
|
+
o("div", Ai, [j(n.$slots, "default")]),
|
|
4565
4641
|
(T(!0), a(e, null, A(L.value, (e) => (T(), a("div", {
|
|
4566
4642
|
key: e,
|
|
4567
4643
|
class: y(["vdd-resize-handle", `vdd-resize-${e}`]),
|
|
4568
4644
|
"data-vdd-widget-resize": e,
|
|
4569
|
-
onPointerdown: (t) =>
|
|
4570
|
-
}, null, 42,
|
|
4571
|
-
], 46,
|
|
4645
|
+
onPointerdown: (t) => te(e, t)
|
|
4646
|
+
}, null, 42, ji))), 128))
|
|
4647
|
+
], 46, Ei)) : i("", !0);
|
|
4572
4648
|
}
|
|
4573
|
-
}),
|
|
4649
|
+
}), Ni = ["data-vdd-dropzone"], Pi = /* @__PURE__ */ u({
|
|
4574
4650
|
__name: "VddPanelOverlay",
|
|
4575
4651
|
setup(t) {
|
|
4576
|
-
let o =
|
|
4577
|
-
E(
|
|
4652
|
+
let o = Si();
|
|
4653
|
+
E(xi, o);
|
|
4578
4654
|
let s = H("root");
|
|
4579
|
-
|
|
4655
|
+
W(() => {
|
|
4580
4656
|
o.container.value = s.value;
|
|
4581
4657
|
});
|
|
4582
4658
|
let c = n(() => o.managedIds().map((e) => ({
|
|
@@ -4591,13 +4667,13 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4591
4667
|
"data-vdd-panel-overlay": ""
|
|
4592
4668
|
}, [
|
|
4593
4669
|
j(t.$slots, "default"),
|
|
4594
|
-
l.value ? (T(!0), a(e, { key: 0 }, A(z(
|
|
4670
|
+
l.value ? (T(!0), a(e, { key: 0 }, A(z(mi), (e) => (T(), a("div", {
|
|
4595
4671
|
key: e,
|
|
4596
4672
|
class: y(["vdd-panel-float-dropzone", [`vdd-panel-float-dropzone--${e}`, { "vdd-panel-float-dropzone--hovered": z(o).hovered.value === e }]]),
|
|
4597
4673
|
"data-vdd-dropzone": e,
|
|
4598
4674
|
"aria-hidden": "true"
|
|
4599
|
-
}, null, 10,
|
|
4600
|
-
(T(!0), a(e, null, A(c.value, ({ id: e, widget: t, placement: n }) => (T(), r(
|
|
4675
|
+
}, null, 10, Ni))), 128)) : i("", !0),
|
|
4676
|
+
(T(!0), a(e, null, A(c.value, ({ id: e, widget: t, placement: n }) => (T(), r(Mi, {
|
|
4601
4677
|
key: e,
|
|
4602
4678
|
"widget-id": e,
|
|
4603
4679
|
title: t.title,
|
|
@@ -4611,7 +4687,7 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4611
4687
|
},
|
|
4612
4688
|
"onUpdate:placement": (t) => z(o).setManagedPlacement(e, t)
|
|
4613
4689
|
}, {
|
|
4614
|
-
default:
|
|
4690
|
+
default: G(() => [(T(), r(N(t.component), _({ ref_for: !0 }, t.props), null, 16))]),
|
|
4615
4691
|
_: 2
|
|
4616
4692
|
}, 1032, [
|
|
4617
4693
|
"widget-id",
|
|
@@ -4625,12 +4701,12 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4625
4701
|
]))), 128))
|
|
4626
4702
|
], 2));
|
|
4627
4703
|
}
|
|
4628
|
-
}),
|
|
4704
|
+
}), Fi = [
|
|
4629
4705
|
"data-variant",
|
|
4630
4706
|
"data-btn-variant",
|
|
4631
4707
|
"data-vdd-panel-toolbar",
|
|
4632
4708
|
"aria-orientation"
|
|
4633
|
-
],
|
|
4709
|
+
], Ii = /* @__PURE__ */ u({
|
|
4634
4710
|
__name: "VddPanelToolbar",
|
|
4635
4711
|
props: {
|
|
4636
4712
|
position: {},
|
|
@@ -4639,8 +4715,8 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4639
4715
|
buttonSize: {}
|
|
4640
4716
|
},
|
|
4641
4717
|
setup(e) {
|
|
4642
|
-
let t = e, r =
|
|
4643
|
-
|
|
4718
|
+
let t = e, r = Ci(), i = H("el"), o = n(() => t.position === "top" || t.position === "bottom"), s = null;
|
|
4719
|
+
W((e) => {
|
|
4644
4720
|
let n = i.value, a = t.position;
|
|
4645
4721
|
if (!n) return;
|
|
4646
4722
|
let c = () => {
|
|
@@ -4687,14 +4763,14 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4687
4763
|
}),
|
|
4688
4764
|
role: "toolbar",
|
|
4689
4765
|
"aria-orientation": o.value ? "horizontal" : "vertical"
|
|
4690
|
-
}, [j(t.$slots, "default")], 14,
|
|
4766
|
+
}, [j(t.$slots, "default")], 14, Fi));
|
|
4691
4767
|
}
|
|
4692
|
-
}),
|
|
4768
|
+
}), Li = [
|
|
4693
4769
|
"title",
|
|
4694
4770
|
"aria-label",
|
|
4695
4771
|
"disabled",
|
|
4696
4772
|
"data-variant"
|
|
4697
|
-
],
|
|
4773
|
+
], Ri = /* @__PURE__ */ u({
|
|
4698
4774
|
__name: "VddToolbarButton",
|
|
4699
4775
|
props: {
|
|
4700
4776
|
title: {},
|
|
@@ -4712,15 +4788,15 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4712
4788
|
disabled: e.disabled,
|
|
4713
4789
|
"data-variant": e.variant,
|
|
4714
4790
|
onClick: r[0] ||= (e) => n("click")
|
|
4715
|
-
}, [j(t.$slots, "default")], 8,
|
|
4791
|
+
}, [j(t.$slots, "default")], 8, Li));
|
|
4716
4792
|
}
|
|
4717
|
-
}),
|
|
4793
|
+
}), zi = [
|
|
4718
4794
|
"title",
|
|
4719
4795
|
"aria-label",
|
|
4720
4796
|
"aria-pressed",
|
|
4721
4797
|
"disabled",
|
|
4722
4798
|
"data-variant"
|
|
4723
|
-
],
|
|
4799
|
+
], Bi = /* @__PURE__ */ u({
|
|
4724
4800
|
__name: "VddToolbarToggle",
|
|
4725
4801
|
props: /*@__PURE__*/ g({
|
|
4726
4802
|
title: {},
|
|
@@ -4745,44 +4821,44 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4745
4821
|
disabled: e.disabled,
|
|
4746
4822
|
"data-variant": e.variant,
|
|
4747
4823
|
onClick: r[0] ||= (e) => t.value = !t.value
|
|
4748
|
-
}, [j(n.$slots, "default")], 10,
|
|
4824
|
+
}, [j(n.$slots, "default")], 10, zi));
|
|
4749
4825
|
}
|
|
4750
|
-
}),
|
|
4826
|
+
}), Vi = {
|
|
4751
4827
|
class: "vdd-panel-toolbar__sep",
|
|
4752
4828
|
"aria-hidden": "true"
|
|
4753
|
-
},
|
|
4829
|
+
}, Hi = /* @__PURE__ */ u({
|
|
4754
4830
|
__name: "VddToolbarSeparator",
|
|
4755
4831
|
setup(e) {
|
|
4756
|
-
return (e, t) => (T(), a("span",
|
|
4832
|
+
return (e, t) => (T(), a("span", Vi));
|
|
4757
4833
|
}
|
|
4758
|
-
}),
|
|
4834
|
+
}), Ui = {
|
|
4759
4835
|
class: "vdd-panel-toolbar__spacer",
|
|
4760
4836
|
"aria-hidden": "true"
|
|
4761
|
-
},
|
|
4837
|
+
}, Wi = /* @__PURE__ */ u({
|
|
4762
4838
|
__name: "VddToolbarSpacer",
|
|
4763
4839
|
setup(e) {
|
|
4764
|
-
return (e, t) => (T(), a("span",
|
|
4840
|
+
return (e, t) => (T(), a("span", Ui));
|
|
4765
4841
|
}
|
|
4766
|
-
}),
|
|
4842
|
+
}), Gi = { class: "vdd-panel-toolbar__item" }, Ki = /* @__PURE__ */ u({
|
|
4767
4843
|
__name: "VddToolbarItem",
|
|
4768
4844
|
setup(e) {
|
|
4769
|
-
return (e, t) => (T(), a("span",
|
|
4845
|
+
return (e, t) => (T(), a("span", Gi, [j(e.$slots, "default")]));
|
|
4770
4846
|
}
|
|
4771
|
-
}),
|
|
4847
|
+
}), qi = { class: "vdd-panel-toolbar__center" }, Ji = /* @__PURE__ */ u({
|
|
4772
4848
|
__name: "VddToolbarCenter",
|
|
4773
4849
|
setup(e) {
|
|
4774
|
-
return (e, t) => (T(), a("div",
|
|
4850
|
+
return (e, t) => (T(), a("div", qi, [j(e.$slots, "default")]));
|
|
4775
4851
|
}
|
|
4776
|
-
}),
|
|
4852
|
+
}), Yi = ["title", "aria-label"], Xi = ["placeholder"], Zi = {
|
|
4777
4853
|
key: 0,
|
|
4778
4854
|
class: "vdd-panel-toolbar-search__group"
|
|
4779
|
-
},
|
|
4855
|
+
}, Qi = ["data-vdd-search-result", "onClick"], $i = {
|
|
4780
4856
|
key: 0,
|
|
4781
4857
|
class: "vdd-panel-toolbar-search__item-icon"
|
|
4782
|
-
},
|
|
4858
|
+
}, ea = { class: "vdd-panel-toolbar-search__item-label" }, ta = {
|
|
4783
4859
|
key: 1,
|
|
4784
4860
|
class: "vdd-panel-toolbar-search__item-desc"
|
|
4785
|
-
},
|
|
4861
|
+
}, na = /* @__PURE__ */ u({
|
|
4786
4862
|
__name: "VddToolbarSearch",
|
|
4787
4863
|
props: {
|
|
4788
4864
|
placeholder: {},
|
|
@@ -4802,7 +4878,7 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4802
4878
|
m.value = !1, h.value = "", g.value = [], _.value = null, w();
|
|
4803
4879
|
}
|
|
4804
4880
|
function O(e) {
|
|
4805
|
-
|
|
4881
|
+
En(e) || (Tn(e), D());
|
|
4806
4882
|
}
|
|
4807
4883
|
function j() {
|
|
4808
4884
|
let e = f.value;
|
|
@@ -4882,8 +4958,8 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4882
4958
|
y1: "10",
|
|
4883
4959
|
x2: "14",
|
|
4884
4960
|
y2: "14"
|
|
4885
|
-
})], -1)]], 8,
|
|
4886
|
-
m.value ?
|
|
4961
|
+
})], -1)]], 8, Yi),
|
|
4962
|
+
m.value ? te((T(), a("input", {
|
|
4887
4963
|
key: 0,
|
|
4888
4964
|
ref_key: "input",
|
|
4889
4965
|
ref: p,
|
|
@@ -4894,8 +4970,8 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4894
4970
|
autocomplete: "off",
|
|
4895
4971
|
"data-vdd-search-input": "",
|
|
4896
4972
|
onInput: M,
|
|
4897
|
-
onKeydown:
|
|
4898
|
-
}, null, 40,
|
|
4973
|
+
onKeydown: ne(O, ["esc"])
|
|
4974
|
+
}, null, 40, Xi)), [[ee, h.value]]) : i("", !0),
|
|
4899
4975
|
_.value && g.value.length ? (T(), r(t, {
|
|
4900
4976
|
key: 1,
|
|
4901
4977
|
to: "body"
|
|
@@ -4908,29 +4984,29 @@ var Ci = ["dir", "data-vdd-widget"], wi = {
|
|
|
4908
4984
|
width: `${_.value.width}px`
|
|
4909
4985
|
}),
|
|
4910
4986
|
"data-vdd-search-results": "",
|
|
4911
|
-
onMousedown: c[2] ||=
|
|
4912
|
-
}, [(T(!0), a(e, null, A(L.value, ({ group: t, items: n }) => (T(), a(e, { key: t || "__default__" }, [t ? (T(), a("div",
|
|
4987
|
+
onMousedown: c[2] ||= K(() => {}, ["prevent"])
|
|
4988
|
+
}, [(T(!0), a(e, null, A(L.value, ({ group: t, items: n }) => (T(), a(e, { key: t || "__default__" }, [t ? (T(), a("div", Zi, I(t), 1)) : i("", !0), (T(!0), a(e, null, A(n, (e) => (T(), a("button", {
|
|
4913
4989
|
key: e.id,
|
|
4914
4990
|
type: "button",
|
|
4915
4991
|
class: "vdd-panel-toolbar-search__item",
|
|
4916
4992
|
"data-vdd-search-result": e.id,
|
|
4917
4993
|
onClick: (t) => P(e)
|
|
4918
4994
|
}, [
|
|
4919
|
-
e.icon ? (T(), a("span",
|
|
4920
|
-
o("span",
|
|
4921
|
-
e.description ? (T(), a("span",
|
|
4922
|
-
], 8,
|
|
4995
|
+
e.icon ? (T(), a("span", $i, [(T(), r(N(e.icon)))])) : i("", !0),
|
|
4996
|
+
o("span", ea, I(e.label), 1),
|
|
4997
|
+
e.description ? (T(), a("span", ta, I(e.description), 1)) : i("", !0)
|
|
4998
|
+
], 8, Qi))), 128))], 64))), 128))], 36)])) : i("", !0)
|
|
4923
4999
|
], 34));
|
|
4924
5000
|
}
|
|
4925
5001
|
});
|
|
4926
5002
|
//#endregion
|
|
4927
5003
|
//#region src/composables/useContextMenu.ts
|
|
4928
|
-
function
|
|
5004
|
+
function ra() {
|
|
4929
5005
|
let e = Y();
|
|
4930
5006
|
return (t) => e.showContextMenu(t);
|
|
4931
5007
|
}
|
|
4932
|
-
function
|
|
4933
|
-
let t = Y(), { id: n } =
|
|
5008
|
+
function ia(e) {
|
|
5009
|
+
let t = Y(), { id: n } = Pt();
|
|
4934
5010
|
if (n === "standalone") {
|
|
4935
5011
|
process.env.NODE_ENV !== "production" && console.warn("[vue-dockable-desktop] usePanelContextMenu() was called outside a panel, so it did nothing. This is expected when a panel component is rendered standalone.");
|
|
4936
5012
|
return;
|
|
@@ -4940,24 +5016,24 @@ function ta(e) {
|
|
|
4940
5016
|
}
|
|
4941
5017
|
//#endregion
|
|
4942
5018
|
//#region src/composables/useSidebar.ts
|
|
4943
|
-
function
|
|
4944
|
-
let e = p(
|
|
5019
|
+
function aa() {
|
|
5020
|
+
let e = p(Yn, null);
|
|
4945
5021
|
if (!e) throw Error("[vue-dockable-desktop] useSidebar() must be used inside a <VddSidebar>.");
|
|
4946
5022
|
return e;
|
|
4947
5023
|
}
|
|
4948
|
-
function
|
|
4949
|
-
let e = p(
|
|
5024
|
+
function oa() {
|
|
5025
|
+
let e = p(Xn, null);
|
|
4950
5026
|
if (!e) throw Error("[vue-dockable-desktop] useSidebarTab() must be used inside a sidebar tab's content.");
|
|
4951
5027
|
return e;
|
|
4952
5028
|
}
|
|
4953
5029
|
//#endregion
|
|
4954
5030
|
//#region src/composables/useToolbar.ts
|
|
4955
|
-
function
|
|
5031
|
+
function sa() {
|
|
4956
5032
|
return Y().toolbar;
|
|
4957
5033
|
}
|
|
4958
5034
|
//#endregion
|
|
4959
5035
|
//#region src/composables/useOverlays.ts
|
|
4960
|
-
function
|
|
5036
|
+
function ca() {
|
|
4961
5037
|
let { overlays: e } = Y();
|
|
4962
5038
|
return {
|
|
4963
5039
|
stack: n(() => e.state.modals),
|
|
@@ -4967,7 +5043,7 @@ function aa() {
|
|
|
4967
5043
|
closeAll: e.closeAllModals
|
|
4968
5044
|
};
|
|
4969
5045
|
}
|
|
4970
|
-
function
|
|
5046
|
+
function la() {
|
|
4971
5047
|
let { overlays: e } = Y();
|
|
4972
5048
|
return {
|
|
4973
5049
|
left: n(() => e.state.leftPanel),
|
|
@@ -4982,8 +5058,8 @@ function oa() {
|
|
|
4982
5058
|
}
|
|
4983
5059
|
//#endregion
|
|
4984
5060
|
//#region src/composables/useContributions.ts
|
|
4985
|
-
function
|
|
4986
|
-
let t = Y(), { id: n } =
|
|
5061
|
+
function ua(e) {
|
|
5062
|
+
let t = Y(), { id: n } = Pt();
|
|
4987
5063
|
if (n === "standalone") {
|
|
4988
5064
|
process.env.NODE_ENV !== "production" && console.warn("[vue-dockable-desktop] usePanelContribution() was called outside a panel, so it did nothing. This is expected when a panel component is rendered standalone.");
|
|
4989
5065
|
return;
|
|
@@ -4996,21 +5072,21 @@ function sa(e) {
|
|
|
4996
5072
|
i(), r();
|
|
4997
5073
|
});
|
|
4998
5074
|
}
|
|
4999
|
-
function
|
|
5075
|
+
function da() {
|
|
5000
5076
|
return Y().activeContribution;
|
|
5001
5077
|
}
|
|
5002
|
-
function
|
|
5003
|
-
let t =
|
|
5078
|
+
function fa(e) {
|
|
5079
|
+
let t = da();
|
|
5004
5080
|
return n(() => ze(R(e), t.value));
|
|
5005
5081
|
}
|
|
5006
|
-
function
|
|
5007
|
-
let r =
|
|
5082
|
+
function pa(e, t) {
|
|
5083
|
+
let r = da();
|
|
5008
5084
|
return n(() => Be(R(e), r.value, t));
|
|
5009
5085
|
}
|
|
5010
5086
|
//#endregion
|
|
5011
5087
|
//#region src/index.ts
|
|
5012
|
-
var
|
|
5088
|
+
var ma = "1.2.0";
|
|
5013
5089
|
//#endregion
|
|
5014
|
-
export {
|
|
5090
|
+
export { Te as PanelRegistry, Hr as VddConfirm, Wn as VddContextMenu, Cn as VddDesktop, Mi as VddFloatingWidget, Ur as VddModals, Pi as VddPanelOverlay, Ii as VddPanelToolbar, pr as VddSecondarySidebar, Lr as VddSidePanels, fr as VddSidebar, ui as VddToasts, kr as VddToolbar, Ri as VddToolbarButton, Ji as VddToolbarCenter, Ki as VddToolbarItem, na as VddToolbarSearch, Hi as VddToolbarSeparator, Wi as VddToolbarSpacer, Bi as VddToolbarToggle, Ue as WORKSPACE_KEY, Ke as clampFloatingRect, nt as computeResizedRect, We as createWorkspace, je as defaultMessages, Me as formatLabel, we as isSerializable, Be as mergeSidebarTabs, ze as mergeToolbarItems, $r as resetToasts, Re as sectionToTab, $e as startPointerDrag, Qr as toast, da as useActiveContribution, dt as useColorScheme, ra as useContextMenu, Ti as useFloatingWidgets, pa as useMergedSidebarTabs, fa as useMergedToolbarItems, ca as useModals, Pt as usePanel, ia as usePanelContextMenu, ua as usePanelContribution, la as useSidePanels, aa as useSidebar, oa as useSidebarTab, sa as useToolbar, Y as useWorkspace, ma as version };
|
|
5015
5091
|
|
|
5016
5092
|
//# sourceMappingURL=index.js.map
|