@window-splitter/vue 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +5 -5
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +113 -101
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as be, useId as Ie, inject as X, computed as $, onMounted as G, watchEffect as ue, onUnmounted as Be, createElementBlock as ye, openBlock as Pe, normalizeProps as
|
|
2
|
-
var
|
|
1
|
+
import { defineComponent as be, useId as Ie, inject as X, computed as $, onMounted as G, watchEffect as ue, onUnmounted as Be, createElementBlock as ye, openBlock as Pe, normalizeProps as je, guardReactiveProps as We, renderSlot as Se, createPropsRestProxy as Ee, ref as me, provide as ie, onWatcherCleanup as Ue, mergeProps as Ke, unref as Ge } from "vue";
|
|
2
|
+
var Xe = 20, Ye = 1, J = 1e6, Je = 1e6, Qe = -7, Ze = 21, _e = !1, ne = "[big.js] ", j = ne + "Invalid ", fe = j + "decimal places", et = j + "rounding mode", Ne = ne + "Division by zero", I = {}, N = void 0, tt = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
|
|
3
3
|
function Oe() {
|
|
4
4
|
function e(t) {
|
|
5
5
|
var a = this;
|
|
@@ -12,15 +12,15 @@ function Oe() {
|
|
|
12
12
|
throw TypeError(j + "value");
|
|
13
13
|
t = t === 0 && 1 / t < 0 ? "-0" : String(t);
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
nt(a, t);
|
|
16
16
|
}
|
|
17
17
|
a.constructor = e;
|
|
18
18
|
}
|
|
19
|
-
return e.prototype = I, e.DP =
|
|
19
|
+
return e.prototype = I, e.DP = Xe, e.RM = Ye, e.NE = Qe, e.PE = Ze, e.strict = _e, e.roundDown = 0, e.roundHalfUp = 1, e.roundHalfEven = 2, e.roundUp = 3, e;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function nt(e, t) {
|
|
22
22
|
var a, r, l;
|
|
23
|
-
if (!
|
|
23
|
+
if (!tt.test(t))
|
|
24
24
|
throw Error(j + "number");
|
|
25
25
|
for (e.s = t.charAt(0) == "-" ? (t = t.slice(1), -1) : 1, (a = t.indexOf(".")) > -1 && (t = t.replace(".", "")), (r = t.search(/e/i)) > 0 ? (a < 0 && (a = r), a += +t.slice(r + 1), t = t.substring(0, r)) : a < 0 && (a = t.length), l = t.length, r = 0; r < l && t.charAt(r) == "0"; ) ++r;
|
|
26
26
|
if (r == l)
|
|
@@ -34,7 +34,7 @@ function tt(e, t) {
|
|
|
34
34
|
function W(e, t, a, r) {
|
|
35
35
|
var l = e.c;
|
|
36
36
|
if (a === N && (a = e.constructor.RM), a !== 0 && a !== 1 && a !== 2 && a !== 3)
|
|
37
|
-
throw Error(
|
|
37
|
+
throw Error(et);
|
|
38
38
|
if (t < 1)
|
|
39
39
|
r = a === 3 && (r || !!l[0]) || t === 0 && (a === 1 && l[0] >= 5 || a === 2 && (l[0] > 5 || l[0] === 5 && (r || l[1] !== N))), l.length = 1, r ? (e.e = e.e - t + 1, l[0] = 1) : l[0] = e.e = 0;
|
|
40
40
|
else if (t < l.length) {
|
|
@@ -84,7 +84,7 @@ I.div = function(e) {
|
|
|
84
84
|
throw Error(Ne);
|
|
85
85
|
if (!r[0])
|
|
86
86
|
return e.s = n, e.c = [e.e = 0], e;
|
|
87
|
-
var o, u, d, c, m, s = l.slice(), f = o = l.length, h = r.length, p = r.slice(0, o), v = p.length, g = e, z = g.c = [],
|
|
87
|
+
var o, u, d, c, m, s = l.slice(), f = o = l.length, h = r.length, p = r.slice(0, o), v = p.length, g = e, z = g.c = [], C = 0, x = i + (g.e = t.e - e.e) + 1;
|
|
88
88
|
for (g.s = n, n = x < 0 ? 0 : x, s.unshift(0); v++ < o; ) p.push(0);
|
|
89
89
|
do {
|
|
90
90
|
for (d = 0; d < 10; d++) {
|
|
@@ -108,9 +108,9 @@ I.div = function(e) {
|
|
|
108
108
|
} else
|
|
109
109
|
break;
|
|
110
110
|
}
|
|
111
|
-
z[
|
|
111
|
+
z[C++] = c ? d : ++d, p[0] && c ? p[v] = r[f] || 0 : p = [r[f]];
|
|
112
112
|
} while ((f++ < h || p[0] !== N) && n--);
|
|
113
|
-
return !z[0] &&
|
|
113
|
+
return !z[0] && C != 1 && (z.shift(), g.e--, x--), C > x && W(g, x, a.RM, p[0] !== N), g;
|
|
114
114
|
};
|
|
115
115
|
I.eq = function(e) {
|
|
116
116
|
return this.cmp(e) === 0;
|
|
@@ -183,7 +183,7 @@ I.plus = I.add = function(e) {
|
|
|
183
183
|
};
|
|
184
184
|
I.pow = function(e) {
|
|
185
185
|
var t = this, a = new t.constructor("1"), r = a, l = e < 0;
|
|
186
|
-
if (e !== ~~e || e < -1e6 || e >
|
|
186
|
+
if (e !== ~~e || e < -1e6 || e > Je)
|
|
187
187
|
throw Error(j + "exponent");
|
|
188
188
|
for (l && (e = -e); e & 1 && (r = r.times(t)), e >>= 1, !!e; )
|
|
189
189
|
t = t.times(t);
|
|
@@ -268,7 +268,7 @@ I.valueOf = function() {
|
|
|
268
268
|
return Q(e, e.e <= t.NE || e.e >= t.PE, !0);
|
|
269
269
|
};
|
|
270
270
|
var b = Oe();
|
|
271
|
-
function
|
|
271
|
+
function at(e, t) {
|
|
272
272
|
e.forEach((a) => {
|
|
273
273
|
try {
|
|
274
274
|
t(a);
|
|
@@ -278,7 +278,7 @@ function nt(e, t) {
|
|
|
278
278
|
});
|
|
279
279
|
}
|
|
280
280
|
let _ = 0;
|
|
281
|
-
function
|
|
281
|
+
function rt() {
|
|
282
282
|
let e = /* @__PURE__ */ new Set(), t = e;
|
|
283
283
|
return {
|
|
284
284
|
add(a) {
|
|
@@ -288,43 +288,43 @@ function at() {
|
|
|
288
288
|
return _ -= t == e && e.has(a) ? 1 : 0, e.delete(a);
|
|
289
289
|
},
|
|
290
290
|
flush(a) {
|
|
291
|
-
t.size && (e = /* @__PURE__ */ new Set(), _ -= t.size,
|
|
291
|
+
t.size && (e = /* @__PURE__ */ new Set(), _ -= t.size, at(t, (r) => r(a) && e.add(r)), _ += e.size, t = e);
|
|
292
292
|
}
|
|
293
293
|
};
|
|
294
294
|
}
|
|
295
|
-
const He =
|
|
296
|
-
}, ae = (e) =>
|
|
295
|
+
const He = rt(), $e = typeof window < "u" ? window.requestAnimationFrame : () => {
|
|
296
|
+
}, ae = (e) => lt(e, He);
|
|
297
297
|
ae.now = typeof performance < "u" ? () => performance.now() : Date.now;
|
|
298
298
|
ae.batchedUpdates = (e) => e();
|
|
299
299
|
let F = -1;
|
|
300
|
-
function
|
|
301
|
-
t.add(e),
|
|
300
|
+
function lt(e, t) {
|
|
301
|
+
t.add(e), it();
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function it() {
|
|
304
304
|
F < 0 && (F = 0, $e(Le));
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function ot() {
|
|
307
307
|
F = -1;
|
|
308
308
|
}
|
|
309
309
|
function Le() {
|
|
310
|
-
~F && ($e(Le), ae.batchedUpdates(
|
|
310
|
+
~F && ($e(Le), ae.batchedUpdates(st));
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function st() {
|
|
313
313
|
const e = F;
|
|
314
314
|
if (F = ae.now(), !_) {
|
|
315
|
-
|
|
315
|
+
ot();
|
|
316
316
|
return;
|
|
317
317
|
}
|
|
318
318
|
He.flush(e ? Math.min(64, F - e) : 16.667);
|
|
319
319
|
}
|
|
320
320
|
const xe = 50;
|
|
321
|
-
function
|
|
321
|
+
function ut(e) {
|
|
322
322
|
return { type: "percent", value: new b(e) };
|
|
323
323
|
}
|
|
324
324
|
function L(e) {
|
|
325
325
|
return { type: "pixel", value: new b(e) };
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function ct(e) {
|
|
328
328
|
let t = he.linear, a = 300;
|
|
329
329
|
return e.collapseAnimation && (typeof e.collapseAnimation == "string" ? t = he[e.collapseAnimation] : (a = e.collapseAnimation.duration, t = typeof e.collapseAnimation.easing == "function" ? e.collapseAnimation.easing : he[e.collapseAnimation.easing])), { ease: t, duration: a };
|
|
330
330
|
}
|
|
@@ -342,7 +342,7 @@ const he = {
|
|
|
342
342
|
function Ve(e) {
|
|
343
343
|
return e.orientation === "horizontal" ? e.dragOvershoot.gt(0) ? "w-resize" : e.dragOvershoot.lt(0) ? "e-resize" : "ew-resize" : e.dragOvershoot.gt(0) ? "n-resize" : e.dragOvershoot.lt(0) ? "s-resize" : "ns-resize";
|
|
344
344
|
}
|
|
345
|
-
function
|
|
345
|
+
function dt(e) {
|
|
346
346
|
if ("context" in e && (e = e.context), "items" in e) {
|
|
347
347
|
e.dragOvershoot = new b(e.dragOvershoot || 0);
|
|
348
348
|
for (const t of e.items)
|
|
@@ -363,7 +363,7 @@ function y(e) {
|
|
|
363
363
|
function k(e) {
|
|
364
364
|
return !!(e && typeof e == "object" && "type" in e && e.type === "handle");
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function ft(e) {
|
|
367
367
|
const t = () => {
|
|
368
368
|
let r = null;
|
|
369
369
|
return (l) => {
|
|
@@ -395,13 +395,13 @@ function dt(e) {
|
|
|
395
395
|
function ee(e, t) {
|
|
396
396
|
return e.type === t.type && e.value.eq(t.value);
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function pt(e, t) {
|
|
399
399
|
return !!(!t || !ee(e.min, t.min) || e.max === "1fr" && t.max !== "1fr" || e.max !== "1fr" && t.max === "1fr" || e.max !== "1fr" && t.max !== "1fr" && !ee(e.max, t.max) || e.default && !t.default || !e.default && t.default || e.default && t.default && !ee(e.default, t.default) || !ee(e.collapsedSize, t.collapsedSize) || e.isStaticAtRest !== t.isStaticAtRest || e.collapseAnimation && !t.collapseAnimation || !e.collapseAnimation && t.collapseAnimation || typeof e.collapseAnimation == "string" && typeof t.collapseAnimation == "string" && e.collapseAnimation !== t.collapseAnimation || typeof e.collapseAnimation == "object" && typeof t.collapseAnimation == "object" && (e.collapseAnimation.duration !== t.collapseAnimation.duration || e.collapseAnimation.easing !== t.collapseAnimation.easing) || e.collapsible !== t.collapsible);
|
|
400
400
|
}
|
|
401
|
-
function
|
|
401
|
+
function mt(e, t) {
|
|
402
402
|
return !t || !ee(e.size, t.size);
|
|
403
403
|
}
|
|
404
|
-
function
|
|
404
|
+
function ht(e) {
|
|
405
405
|
return {
|
|
406
406
|
type: "handle",
|
|
407
407
|
...e,
|
|
@@ -412,7 +412,7 @@ function q(e) {
|
|
|
412
412
|
if (e === "1fr" && (e = "100%"), e.endsWith("px"))
|
|
413
413
|
return L(parseFloat(e));
|
|
414
414
|
if (e.endsWith("%"))
|
|
415
|
-
return
|
|
415
|
+
return ut(parseFloat(e) / 100);
|
|
416
416
|
throw new Error(`Invalid unit: ${e}`);
|
|
417
417
|
}
|
|
418
418
|
function Y(e, t) {
|
|
@@ -421,12 +421,12 @@ function Y(e, t) {
|
|
|
421
421
|
function D(e) {
|
|
422
422
|
return e.orientation === "horizontal" ? e.size.width : e.size.height;
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function P(e, t) {
|
|
425
425
|
const a = t === "1fr" ? q(t) : t;
|
|
426
426
|
return a.type === "pixel" ? a.value : a.value.mul(D(e));
|
|
427
427
|
}
|
|
428
428
|
function H(e, t, a) {
|
|
429
|
-
const r =
|
|
429
|
+
const r = P(e, t.min), l = P(e, t.max);
|
|
430
430
|
return a.gte(r) && a.lte(l) ? a : a.lt(r) ? r : l;
|
|
431
431
|
}
|
|
432
432
|
function E(e, t) {
|
|
@@ -441,7 +441,7 @@ function Ce(e, t) {
|
|
|
441
441
|
return a;
|
|
442
442
|
throw new Error(`Expected panel handle with id: ${t}`);
|
|
443
443
|
}
|
|
444
|
-
function
|
|
444
|
+
function gt(e, t) {
|
|
445
445
|
if (!e.items.length)
|
|
446
446
|
throw new Error("No items in group");
|
|
447
447
|
const a = Ce(e, t), r = e.items[a - 1], l = e.items[a + 1];
|
|
@@ -475,7 +475,7 @@ function Me(e, t) {
|
|
|
475
475
|
let r = e.items[a + 1];
|
|
476
476
|
return r && k(r) && te(e, e.items, a + 1, 1, "add") ? { item: r, direction: 1 } : (r = e.items[a - 1], r && k(r) && te(e, e.items, a - 1, -1, "add") ? { item: r, direction: -1 } : ce(e, t));
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function qe(e) {
|
|
479
479
|
const t = {}, a = e.map((i) => i.order).filter((i) => i !== void 0);
|
|
480
480
|
let r = 0;
|
|
481
481
|
for (const i of e)
|
|
@@ -490,7 +490,7 @@ function gt(e) {
|
|
|
490
490
|
return l;
|
|
491
491
|
}
|
|
492
492
|
function vt(e, t, a) {
|
|
493
|
-
return T(t.currentValue.type === "pixel", `panelHasSpace only works with number values: ${t.id} ${t.currentValue}`), t.collapsible ? !t.collapsed : a === "add" ? t.currentValue.value.gte(
|
|
493
|
+
return T(t.currentValue.type === "pixel", `panelHasSpace only works with number values: ${t.id} ${t.currentValue}`), t.collapsible ? !t.collapsed : a === "add" ? t.currentValue.value.gte(P(e, t.min)) && t.currentValue.value.lt(P(e, t.max)) : t.currentValue.value.gt(P(e, t.min));
|
|
494
494
|
}
|
|
495
495
|
function te(e, t, a, r, l, n) {
|
|
496
496
|
const i = r === -1 ? t.slice(0, a + 1).reverse() : t.slice(a);
|
|
@@ -512,7 +512,7 @@ function B(e) {
|
|
|
512
512
|
return e.type === "pixel" ? `${e.value.toNumber()}px` : `${e.value.mul(100).toNumber()}%`;
|
|
513
513
|
}
|
|
514
514
|
function wt(e) {
|
|
515
|
-
return O(e).map((t) => y(t) ? t.currentValue.value.toNumber() :
|
|
515
|
+
return O(e).map((t) => y(t) ? t.currentValue.value.toNumber() : P(e, t.size).toNumber());
|
|
516
516
|
}
|
|
517
517
|
function zt(e, t) {
|
|
518
518
|
return E({ ...e, items: O(e) }, t).currentValue.value.toNumber();
|
|
@@ -564,7 +564,7 @@ function De(e) {
|
|
|
564
564
|
function ge(e, t) {
|
|
565
565
|
const a = e.findIndex((l) => l.id === t.id || typeof l.order == "number" && l.order === t.order);
|
|
566
566
|
let r = e;
|
|
567
|
-
return a !== -1 && (r = e.filter((l, n) => n !== a)),
|
|
567
|
+
return a !== -1 && (r = e.filter((l, n) => n !== a)), qe([...r, t]);
|
|
568
568
|
}
|
|
569
569
|
function ve(e, t) {
|
|
570
570
|
return {
|
|
@@ -598,7 +598,7 @@ function O(e) {
|
|
|
598
598
|
return a;
|
|
599
599
|
}
|
|
600
600
|
function oe(e, t) {
|
|
601
|
-
var
|
|
601
|
+
var A, R, K, M;
|
|
602
602
|
const a = Ce(e, t.handleId), r = e.items[a], l = [...e.items];
|
|
603
603
|
let n = e.orientation === "horizontal" ? t.value.deltaX : t.value.deltaY;
|
|
604
604
|
if (t.value.shiftKey && (n *= e.shiftAmount ?? 15), n === 0)
|
|
@@ -612,20 +612,20 @@ function oe(e, t) {
|
|
|
612
612
|
const u = t.type === "collapsePanel" && // If we have the panel id just use that
|
|
613
613
|
(l.find((V) => V.id === t.panelId && o.id !== t.panelId) || // otherwise fallback to the next panel with space
|
|
614
614
|
te(e, l, a - i, i * -1, "add", t.disregardCollapseBuffer)) || l[a - i];
|
|
615
|
-
if (T(u && y(u), `Expected panel after: ${r.id}`), u.currentValue.value.eq(
|
|
615
|
+
if (T(u && y(u), `Expected panel after: ${r.id}`), u.currentValue.value.eq(P(e, u.max)))
|
|
616
616
|
return {
|
|
617
617
|
dragOvershoot: e.dragOvershoot.add(n)
|
|
618
618
|
};
|
|
619
619
|
const d = e.dragOvershoot.add(n);
|
|
620
620
|
if (!t.disregardCollapseBuffer && !t.controlled) {
|
|
621
|
-
const V = d.lt(0) && i > 0, w = d.gt(0) && i > 0,
|
|
621
|
+
const V = d.lt(0) && i > 0, w = d.gt(0) && i > 0, S = d.gt(0) && i < 0, U = d.lt(0) && i < 0, re = u.currentValue.value.add(new b(d).mul(S ? i : 1)), le = P(e, u.min), Te = d.abs().lt(xe) && // Let the panel expand at it's min size
|
|
622
622
|
!u.currentValue.value.add(d.abs()).gte(u.min.value) && u.collapsible && u.collapsed && (w || U);
|
|
623
|
-
if (re.lte(le) && (d.eq(0) ||
|
|
623
|
+
if (re.lte(le) && (d.eq(0) || S || V || Te))
|
|
624
624
|
return { dragOvershoot: d };
|
|
625
625
|
}
|
|
626
|
-
if (!t.disregardCollapseBuffer && !t.controlled && o.collapsible && o.currentValue.value.eq(
|
|
626
|
+
if (!t.disregardCollapseBuffer && !t.controlled && o.collapsible && o.currentValue.value.eq(P(e, o.min))) {
|
|
627
627
|
const V = o.currentValue.value.sub(d.abs());
|
|
628
|
-
if (d.abs().lt(xe) && V.gt(
|
|
628
|
+
if (d.abs().lt(xe) && V.gt(P(e, o.collapsedSize)))
|
|
629
629
|
return { dragOvershoot: d };
|
|
630
630
|
}
|
|
631
631
|
const c = ve(e, o), m = o.currentValue.value, s = o.currentValue.value.minus(new b(n).mul(i));
|
|
@@ -635,21 +635,21 @@ function oe(e, t) {
|
|
|
635
635
|
if (t.disregardCollapseBuffer)
|
|
636
636
|
u.collapsible && u.collapsed && (u.collapsed = !1);
|
|
637
637
|
else if (u.collapsible && u.collapsed) {
|
|
638
|
-
if ((
|
|
638
|
+
if ((A = u.onCollapseChange) != null && A.current && u.collapseIsControlled && !t.controlled && !t.isVirtual)
|
|
639
639
|
return u.onCollapseChange.current(!1), { dragOvershoot: d };
|
|
640
640
|
const V = (
|
|
641
641
|
// Take the size it was at
|
|
642
|
-
|
|
642
|
+
P(e, u.collapsedSize).add(e.dragOvershoot.abs()).sub(z.add(Math.abs(n)))
|
|
643
643
|
);
|
|
644
644
|
if (V.gt(0) && (z = z.add(V)), f = f.minus(z.minus(p).minus(Math.abs(n))), f.lt(o.min.value) && !o.collapsible)
|
|
645
645
|
return { dragOvershoot: d };
|
|
646
646
|
u.collapsed = !1, (R = u.onCollapseChange) != null && R.current && !u.collapseIsControlled && !t.controlled && !t.isVirtual && u.onCollapseChange.current(!1);
|
|
647
647
|
}
|
|
648
|
-
const
|
|
649
|
-
if (!t.disregardCollapseBuffer && o.collapsible &&
|
|
648
|
+
const C = o.currentValue.value.eq(P(e, o.min));
|
|
649
|
+
if (!t.disregardCollapseBuffer && o.collapsible && C) {
|
|
650
650
|
if ((K = o.onCollapseChange) != null && K.current && o.collapseIsControlled && !t.controlled && !t.isVirtual)
|
|
651
651
|
return o.onCollapseChange.current(!0), { dragOvershoot: d };
|
|
652
|
-
o.collapsed = !0, f =
|
|
652
|
+
o.collapsed = !0, f = P(e, o.collapsedSize), z = u.currentValue.value.add(m.minus(f)), (M = o.onCollapseChange) != null && M.current && !o.collapseIsControlled && !t.controlled && !t.isVirtual && o.onCollapseChange.current(!0);
|
|
653
653
|
}
|
|
654
654
|
o.currentValue = { type: "pixel", value: f }, u.currentValue = { type: "pixel", value: z };
|
|
655
655
|
const x = new b(D(e)).minus(l.reduce((V, w) => V.add(y(w) ? w.currentValue.value : w.size.value), new b(0)));
|
|
@@ -727,7 +727,7 @@ function yt(e) {
|
|
|
727
727
|
if (k(u))
|
|
728
728
|
return u.size.value;
|
|
729
729
|
if (u.collapsed)
|
|
730
|
-
return
|
|
730
|
+
return P(e, u.currentValue);
|
|
731
731
|
const d = u.currentValue.type === "pixel" && u.currentValue.value || u.currentValue.value.mul(a);
|
|
732
732
|
return H(e, u, d);
|
|
733
733
|
}).reduce((u, d) => u.add(d), new b(0)), n = l.abs().sub(t);
|
|
@@ -736,7 +736,7 @@ function yt(e) {
|
|
|
736
736
|
let i = { ...e, items: O(e) };
|
|
737
737
|
const o = i.items.find((u) => !!(y(u) && u.collapsible));
|
|
738
738
|
if (o) {
|
|
739
|
-
const u = i.items.findIndex((m) => m.id === o.id), d = ce(i, o.id), c = o.currentValue.value.sub(
|
|
739
|
+
const u = i.items.findIndex((m) => m.id === o.id), d = ce(i, o.id), c = o.currentValue.value.sub(P(i, o.collapsedSize));
|
|
740
740
|
i = {
|
|
741
741
|
...i,
|
|
742
742
|
...de({
|
|
@@ -760,17 +760,17 @@ function Re(e) {
|
|
|
760
760
|
function Pt(e, t) {
|
|
761
761
|
document.cookie = `${e}=${encodeURIComponent(`${t}`)};path=/;max-age=31536000`;
|
|
762
762
|
}
|
|
763
|
-
function
|
|
763
|
+
function Fe(e, t) {
|
|
764
764
|
const a = E(e, t.panelId);
|
|
765
765
|
if (t.type === "expandPanel")
|
|
766
|
-
return new b(a.sizeBeforeCollapse ??
|
|
767
|
-
const r =
|
|
766
|
+
return new b(a.sizeBeforeCollapse ?? P(e, a.min)).minus(a.currentValue.value);
|
|
767
|
+
const r = P(e, a.collapsedSize);
|
|
768
768
|
return a.currentValue.value.minus(r);
|
|
769
769
|
}
|
|
770
770
|
function ke(e, t, a, r) {
|
|
771
771
|
const l = E(e, t.panelId), n = Me(e, t.panelId);
|
|
772
772
|
let i = new b(n.direction);
|
|
773
|
-
const o =
|
|
773
|
+
const o = Fe(e, t), u = { ...e, items: O(e) }, d = de({
|
|
774
774
|
context: u,
|
|
775
775
|
panelId: t.panelId,
|
|
776
776
|
handleId: n.item.id,
|
|
@@ -782,16 +782,16 @@ function ke(e, t, a, r) {
|
|
|
782
782
|
r.signal.addEventListener("abort", () => {
|
|
783
783
|
m(new Error("Operation was canceled"));
|
|
784
784
|
}), t.type === "collapsePanel" && (l.sizeBeforeCollapse = l.currentValue.value.toNumber(), i = i.mul(new b(-1)));
|
|
785
|
-
const s = 60, { duration: f, ease: h } =
|
|
785
|
+
const s = 60, { duration: f, ease: h } = ct(l), p = Math.ceil(l.collapseAnimation ? f / (1e3 / s) : 1);
|
|
786
786
|
let v = 0, g = new b(0);
|
|
787
787
|
function z() {
|
|
788
|
-
const
|
|
788
|
+
const C = ++v / p, x = new b(l.collapseAnimation ? h(C) : 1), A = x.mul(o).sub(g).mul(i);
|
|
789
789
|
if (a({
|
|
790
790
|
type: "applyDelta",
|
|
791
791
|
handleId: n.item.id,
|
|
792
|
-
delta:
|
|
792
|
+
delta: A.toNumber(),
|
|
793
793
|
panelId: l.id
|
|
794
|
-
}), g = g.add(
|
|
794
|
+
}), g = g.add(A.abs().mul(A.gt(0) && i.lt(0) || A.lt(0) && i.gt(0) ? -1 : 1)), x.eq(1)) {
|
|
795
795
|
e.items.find((K) => y(K) && K.currentValue.value.round(void 0, b.roundHalfEven).lt(0)) && se(e, d);
|
|
796
796
|
const R = t.type === "expandPanel" ? "expand" : "collapse";
|
|
797
797
|
return c({ panelId: l.id, action: R, resolve: t.resolve }), !1;
|
|
@@ -833,7 +833,7 @@ function Ct(e, t) {
|
|
|
833
833
|
var c, m;
|
|
834
834
|
for (const s of n.items)
|
|
835
835
|
if (y(s)) {
|
|
836
|
-
const f = s.lastKnownSize ? new b(n.orientation === "horizontal" ? s.lastKnownSize.width : s.lastKnownSize.height) : H(n, s,
|
|
836
|
+
const f = s.lastKnownSize ? new b(n.orientation === "horizontal" ? s.lastKnownSize.width : s.lastKnownSize.height) : H(n, s, P(n, s.currentValue)), h = D(n);
|
|
837
837
|
(m = (c = s.onResize) == null ? void 0 : c.current) == null || m.call(c, {
|
|
838
838
|
pixel: f.toNumber(),
|
|
839
839
|
percentage: h > 0 ? f.div(D(n)).toNumber() : -1
|
|
@@ -894,7 +894,7 @@ function Ct(e, t) {
|
|
|
894
894
|
Z(c, ["expandPanel"]);
|
|
895
895
|
const m = O(n);
|
|
896
896
|
let s = { ...n, items: m };
|
|
897
|
-
const f =
|
|
897
|
+
const f = Fe(n, c), h = Me(s, c.panelId);
|
|
898
898
|
s = {
|
|
899
899
|
...s,
|
|
900
900
|
...de({
|
|
@@ -907,7 +907,7 @@ function Ct(e, t) {
|
|
|
907
907
|
isVirtual: !0
|
|
908
908
|
})
|
|
909
909
|
};
|
|
910
|
-
const p = s.items.find((z) => z.id === c.panelId), v = s.items.reduce((z,
|
|
910
|
+
const p = s.items.find((z) => z.id === c.panelId), v = s.items.reduce((z, C) => z.add(y(C) ? C.currentValue.value : C.size.value), new b(0)), g = p && y(p) && !p.currentValue.value.eq(p.collapsedSize.value);
|
|
911
911
|
return v.gt(D(n)) || !g;
|
|
912
912
|
}
|
|
913
913
|
};
|
|
@@ -942,6 +942,9 @@ function Ct(e, t) {
|
|
|
942
942
|
}
|
|
943
943
|
if (!l) {
|
|
944
944
|
switch (c.type) {
|
|
945
|
+
case "updateItemIndex":
|
|
946
|
+
n.items = qe(n.items.map((s) => s.id === c.itemId ? { ...s, order: c.index } : s));
|
|
947
|
+
break;
|
|
945
948
|
case "registerPanel":
|
|
946
949
|
n.items = ge(n.items, {
|
|
947
950
|
type: "panel",
|
|
@@ -962,12 +965,21 @@ function Ct(e, t) {
|
|
|
962
965
|
case "registerDynamicPanel": {
|
|
963
966
|
i.prepare();
|
|
964
967
|
let s = L(0);
|
|
965
|
-
c.data.collapsible && c.data.collapsed && c.data.collapsedSize ? s =
|
|
968
|
+
c.data.collapsible && c.data.collapsed && c.data.collapsedSize ? s = {
|
|
969
|
+
type: "pixel",
|
|
970
|
+
value: P(n, c.data.collapsedSize)
|
|
971
|
+
} : c.data.default ? s = {
|
|
972
|
+
type: "pixel",
|
|
973
|
+
value: P(n, c.data.default)
|
|
974
|
+
} : s = {
|
|
975
|
+
type: "pixel",
|
|
976
|
+
value: P(n, c.data.min)
|
|
977
|
+
};
|
|
966
978
|
const f = ge(n.items, {
|
|
967
979
|
type: "panel",
|
|
968
980
|
...c.data,
|
|
969
981
|
currentValue: s
|
|
970
|
-
}), h = f.findIndex((g) => g.id === c.data.id), p = { ...n }, v = n.items.reduce((g, z) => k(z) ? g.add(
|
|
982
|
+
}), h = f.findIndex((g) => g.id === c.data.id), p = { ...n }, v = n.items.reduce((g, z) => k(z) ? g.add(P(n, z.size)) : g.add(z.currentValue.value), new b(0)).minus(D(n));
|
|
971
983
|
ze(p, f, h, s.value.add(v).neg()), n.items = f, i.clearLastKnownSize(), i.commit(), i.onResize(), i.onAutosave();
|
|
972
984
|
break;
|
|
973
985
|
}
|
|
@@ -1026,7 +1038,7 @@ function Ct(e, t) {
|
|
|
1026
1038
|
break;
|
|
1027
1039
|
case "setPanelPixelSize": {
|
|
1028
1040
|
i.prepare(), i.clearLastKnownSize();
|
|
1029
|
-
const s = E(n, c.panelId), f = ce(n, c.panelId), h = s.currentValue.value, p = H(n, s,
|
|
1041
|
+
const s = E(n, c.panelId), f = ce(n, c.panelId), h = s.currentValue.value, p = H(n, s, P(n, q(c.size))), v = p > h, g = v ? p.minus(h) : h.minus(p);
|
|
1030
1042
|
s.sizeBeforeCollapse = p.toNumber(), Object.assign(n, de({
|
|
1031
1043
|
context: n,
|
|
1032
1044
|
panelId: c.panelId,
|
|
@@ -1226,7 +1238,7 @@ const Et = /* @__PURE__ */ be({
|
|
|
1226
1238
|
isStaticAtRest: f,
|
|
1227
1239
|
collapsed: h,
|
|
1228
1240
|
...p
|
|
1229
|
-
} = a, v = n || Ie(), g = X("send"), z = X("state"),
|
|
1241
|
+
} = a, v = n || Ie(), g = X("send"), z = X("state"), C = X("isPrerender"), x = () => ft({
|
|
1230
1242
|
id: v,
|
|
1231
1243
|
min: a.min,
|
|
1232
1244
|
max: a.max,
|
|
@@ -1239,36 +1251,36 @@ const Et = /* @__PURE__ */ be({
|
|
|
1239
1251
|
defaultCollapsed: m,
|
|
1240
1252
|
default: s,
|
|
1241
1253
|
isStaticAtRest: f
|
|
1242
|
-
}),
|
|
1243
|
-
var
|
|
1244
|
-
const w = (
|
|
1254
|
+
}), A = $(() => {
|
|
1255
|
+
var S;
|
|
1256
|
+
const w = (S = z == null ? void 0 : z.value) == null ? void 0 : S.items.find((U) => U.id === v);
|
|
1245
1257
|
if (!(!w || !y(w)))
|
|
1246
1258
|
return w;
|
|
1247
1259
|
});
|
|
1248
1260
|
let R = !1;
|
|
1249
|
-
|
|
1261
|
+
A.value ? g == null || g({
|
|
1250
1262
|
type: "rebindPanelCallbacks",
|
|
1251
1263
|
data: {
|
|
1252
1264
|
id: v,
|
|
1253
1265
|
onCollapseChange: a.onCollapseChange ? { current: a.onCollapseChange } : void 0,
|
|
1254
1266
|
onResize: a.onResize ? { current: a.onResize } : void 0
|
|
1255
1267
|
}
|
|
1256
|
-
}) :
|
|
1268
|
+
}) : C != null && C.value ? g == null || g({ type: "registerPanel", data: x() }) : R = !0, G(() => {
|
|
1257
1269
|
var le;
|
|
1258
1270
|
const w = (le = z == null ? void 0 : z.value) == null ? void 0 : le.groupId;
|
|
1259
1271
|
if (!w || !R) return;
|
|
1260
|
-
const
|
|
1261
|
-
if (!
|
|
1272
|
+
const S = document.getElementById(w);
|
|
1273
|
+
if (!S) return;
|
|
1262
1274
|
const U = document.getElementById(v);
|
|
1263
1275
|
if (!U) return;
|
|
1264
|
-
const re = Array.from(
|
|
1276
|
+
const re = Array.from(S.children).indexOf(U);
|
|
1265
1277
|
typeof re == "number" && (g == null || g({
|
|
1266
1278
|
type: "registerDynamicPanel",
|
|
1267
1279
|
data: { ...x(), order: re }
|
|
1268
1280
|
}), R = !1);
|
|
1269
1281
|
});
|
|
1270
1282
|
const K = $(
|
|
1271
|
-
() => !R &&
|
|
1283
|
+
() => !R && pt(x(), A.value)
|
|
1272
1284
|
);
|
|
1273
1285
|
ue(() => {
|
|
1274
1286
|
K.value && (g == null || g({ type: "updateConstraints", data: x() }));
|
|
@@ -1278,25 +1290,25 @@ const Et = /* @__PURE__ */ be({
|
|
|
1278
1290
|
getId: () => v,
|
|
1279
1291
|
collapse: async () => {
|
|
1280
1292
|
var w;
|
|
1281
|
-
if ((w =
|
|
1282
|
-
return await new Promise((
|
|
1283
|
-
g == null || g({ type: "collapsePanel", panelId: v, controlled: !0, resolve:
|
|
1293
|
+
if ((w = A.value) != null && w.collapsible)
|
|
1294
|
+
return await new Promise((S) => {
|
|
1295
|
+
g == null || g({ type: "collapsePanel", panelId: v, controlled: !0, resolve: S });
|
|
1284
1296
|
});
|
|
1285
1297
|
},
|
|
1286
1298
|
isCollapsed: () => {
|
|
1287
|
-
var w,
|
|
1288
|
-
return !!((w =
|
|
1299
|
+
var w, S;
|
|
1300
|
+
return !!((w = A.value) != null && w.collapsible && ((S = A.value) != null && S.collapsed));
|
|
1289
1301
|
},
|
|
1290
1302
|
expand: async () => {
|
|
1291
1303
|
var w;
|
|
1292
|
-
if ((w =
|
|
1293
|
-
return await new Promise((
|
|
1294
|
-
g == null || g({ type: "expandPanel", panelId: v, controlled: !0, resolve:
|
|
1304
|
+
if ((w = A.value) != null && w.collapsible)
|
|
1305
|
+
return await new Promise((S) => {
|
|
1306
|
+
g == null || g({ type: "expandPanel", panelId: v, controlled: !0, resolve: S });
|
|
1295
1307
|
});
|
|
1296
1308
|
},
|
|
1297
1309
|
isExpanded: () => {
|
|
1298
|
-
var w,
|
|
1299
|
-
return !!((w =
|
|
1310
|
+
var w, S;
|
|
1311
|
+
return !!((w = A.value) != null && w.collapsible && !((S = A.value) != null && S.collapsed));
|
|
1300
1312
|
},
|
|
1301
1313
|
getPixelSize: () => zt(z.value, v),
|
|
1302
1314
|
getPercentageSize: () => It(z.value, v),
|
|
@@ -1305,7 +1317,7 @@ const Et = /* @__PURE__ */ be({
|
|
|
1305
1317
|
const M = $(
|
|
1306
1318
|
() => {
|
|
1307
1319
|
var w;
|
|
1308
|
-
return (w =
|
|
1320
|
+
return (w = A.value) == null ? void 0 : w.collapseIsControlled;
|
|
1309
1321
|
}
|
|
1310
1322
|
);
|
|
1311
1323
|
ue(() => {
|
|
@@ -1314,12 +1326,12 @@ const Et = /* @__PURE__ */ be({
|
|
|
1314
1326
|
});
|
|
1315
1327
|
});
|
|
1316
1328
|
const V = $(() => {
|
|
1317
|
-
var
|
|
1318
|
-
const w =
|
|
1329
|
+
var S;
|
|
1330
|
+
const w = A.value;
|
|
1319
1331
|
return {
|
|
1320
1332
|
...p,
|
|
1321
1333
|
...At({
|
|
1322
|
-
groupId: (
|
|
1334
|
+
groupId: (S = z == null ? void 0 : z.value) == null ? void 0 : S.groupId,
|
|
1323
1335
|
id: v,
|
|
1324
1336
|
collapsible: w == null ? void 0 : w.collapsible,
|
|
1325
1337
|
collapsed: w == null ? void 0 : w.collapsed
|
|
@@ -1331,7 +1343,7 @@ const Et = /* @__PURE__ */ be({
|
|
|
1331
1343
|
}
|
|
1332
1344
|
};
|
|
1333
1345
|
});
|
|
1334
|
-
return (w,
|
|
1346
|
+
return (w, S) => (Pe(), ye("div", je(We(V.value)), [
|
|
1335
1347
|
Se(w.$slots, "default")
|
|
1336
1348
|
], 16));
|
|
1337
1349
|
}
|
|
@@ -1360,7 +1372,7 @@ const Et = /* @__PURE__ */ be({
|
|
|
1360
1372
|
groupId: n,
|
|
1361
1373
|
autosaveStrategy: e.autosaveStrategy,
|
|
1362
1374
|
shiftAmount: e.shiftAmount,
|
|
1363
|
-
...r ?
|
|
1375
|
+
...r ? dt(r) : void 0
|
|
1364
1376
|
},
|
|
1365
1377
|
(f) => {
|
|
1366
1378
|
d.value = { ...f };
|
|
@@ -1398,7 +1410,7 @@ const Et = /* @__PURE__ */ be({
|
|
|
1398
1410
|
const f = Vt(n, (h) => {
|
|
1399
1411
|
o({ type: "setActualItemsSize", childrenSizes: h });
|
|
1400
1412
|
});
|
|
1401
|
-
|
|
1413
|
+
Ue(f);
|
|
1402
1414
|
});
|
|
1403
1415
|
}), G(() => (o({ type: "unlockGroup" }), () => o({ type: "lockGroup" }))), t({
|
|
1404
1416
|
getId: () => n,
|
|
@@ -1421,7 +1433,7 @@ const Et = /* @__PURE__ */ be({
|
|
|
1421
1433
|
}
|
|
1422
1434
|
}
|
|
1423
1435
|
}), (f, h) => (Pe(), ye("div", Ke(a, {
|
|
1424
|
-
id:
|
|
1436
|
+
id: Ge(n),
|
|
1425
1437
|
ref_key: "elementRef",
|
|
1426
1438
|
ref: m,
|
|
1427
1439
|
"data-panel-group-wrapper": "",
|
|
@@ -1442,7 +1454,7 @@ const Et = /* @__PURE__ */ be({
|
|
|
1442
1454
|
id: {}
|
|
1443
1455
|
},
|
|
1444
1456
|
setup(e) {
|
|
1445
|
-
const t = Ee(e, ["size", "id", "onDragStart", "onDrag", "onDragEnd", "disabled"]), r = e.id || Ie(), l = X("send"), n = X("state"), i = X("isPrerender"), o = () =>
|
|
1457
|
+
const t = Ee(e, ["size", "id", "onDragStart", "onDrag", "onDragEnd", "disabled"]), r = e.id || Ie(), l = X("send"), n = X("state"), i = X("isPrerender"), o = () => ht({ size: e.size, id: r }), u = $(() => {
|
|
1446
1458
|
var p;
|
|
1447
1459
|
const h = (p = n == null ? void 0 : n.value) == null ? void 0 : p.items.find((v) => v.id === r);
|
|
1448
1460
|
if (!(!h || !k(h)))
|
|
@@ -1450,9 +1462,9 @@ const Et = /* @__PURE__ */ be({
|
|
|
1450
1462
|
});
|
|
1451
1463
|
let d = !1;
|
|
1452
1464
|
u.value || (i != null && i.value ? l == null || l({ type: "registerPanelHandle", data: o() }) : d = !0), G(() => {
|
|
1453
|
-
var z,
|
|
1465
|
+
var z, C;
|
|
1454
1466
|
if (!((z = n == null ? void 0 : n.value) == null ? void 0 : z.groupId) || !d) return;
|
|
1455
|
-
const p = document.getElementById((
|
|
1467
|
+
const p = document.getElementById((C = n == null ? void 0 : n.value) == null ? void 0 : C.groupId);
|
|
1456
1468
|
if (!p) return;
|
|
1457
1469
|
const v = document.getElementById(r);
|
|
1458
1470
|
if (!v) return;
|
|
@@ -1463,7 +1475,7 @@ const Et = /* @__PURE__ */ be({
|
|
|
1463
1475
|
}), d = !1);
|
|
1464
1476
|
});
|
|
1465
1477
|
const c = $(
|
|
1466
|
-
() => !d &&
|
|
1478
|
+
() => !d && mt(o(), u.value)
|
|
1467
1479
|
);
|
|
1468
1480
|
ue(() => {
|
|
1469
1481
|
c.value && (l == null || l({ type: "updateConstraints", data: o() }));
|
|
@@ -1486,21 +1498,21 @@ const Et = /* @__PURE__ */ be({
|
|
|
1486
1498
|
}), s = (h) => {
|
|
1487
1499
|
if (n != null && n.value)
|
|
1488
1500
|
try {
|
|
1489
|
-
const p =
|
|
1501
|
+
const p = gt(n == null ? void 0 : n.value, r);
|
|
1490
1502
|
h.key === "Enter" && p && (p.collapsed ? l == null || l({ type: "expandPanel", panelId: p.id }) : l == null || l({ type: "collapsePanel", panelId: p.id }));
|
|
1491
1503
|
} catch {
|
|
1492
1504
|
}
|
|
1493
1505
|
}, f = $(() => {
|
|
1494
|
-
var g, z,
|
|
1506
|
+
var g, z, C, x, A, R, K, M, V;
|
|
1495
1507
|
const h = (g = n == null ? void 0 : n.value) == null ? void 0 : g.items.findIndex((w) => w.id === r);
|
|
1496
1508
|
if (!h) return { id: r };
|
|
1497
|
-
const p = (z = n == null ? void 0 : n.value) == null ? void 0 : z.items[h], v = (
|
|
1509
|
+
const p = (z = n == null ? void 0 : n.value) == null ? void 0 : z.items[h], v = (C = n == null ? void 0 : n.value) == null ? void 0 : C.items[h - 1];
|
|
1498
1510
|
return !v || !y(v) ? { id: r } : {
|
|
1499
1511
|
...t,
|
|
1500
1512
|
...xt({
|
|
1501
1513
|
groupId: (x = n == null ? void 0 : n.value) == null ? void 0 : x.groupId,
|
|
1502
1514
|
id: r,
|
|
1503
|
-
orientation: ((
|
|
1515
|
+
orientation: ((A = n == null ? void 0 : n.value) == null ? void 0 : A.orientation) || "horizontal",
|
|
1504
1516
|
isDragging: ((R = n == null ? void 0 : n.value) == null ? void 0 : R.activeDragHandleId) === r,
|
|
1505
1517
|
activeDragHandleId: (K = n == null ? void 0 : n.value) == null ? void 0 : K.activeDragHandleId,
|
|
1506
1518
|
disabled: e.disabled,
|