ics-ui-kit 0.1.6 → 0.1.8
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/dist/{Command-BhbfL5wm.js → Command-CiZHptkR.js} +2 -2
- package/dist/{Command-BhbfL5wm.js.map → Command-CiZHptkR.js.map} +1 -1
- package/dist/{Dialog-ByiJIDhl.js → Dialog-Bs1B5Iu8.js} +2 -2
- package/dist/{Dialog-ByiJIDhl.js.map → Dialog-Bs1B5Iu8.js.map} +1 -1
- package/dist/Overlay-CVt011mY.js +28 -0
- package/dist/Overlay-CVt011mY.js.map +1 -0
- package/dist/{Sheet-rtwmzm2-.js → Sheet-zTMuP7C8.js} +2 -2
- package/dist/{Sheet-rtwmzm2-.js.map → Sheet-zTMuP7C8.js.map} +1 -1
- package/dist/components/alert-dialog.js +1 -1
- package/dist/components/command.js +1 -1
- package/dist/components/dialog.js +2 -2
- package/dist/components/drawer.js +1 -1
- package/dist/components/file-upload/FileUpload.d.ts +1 -0
- package/dist/components/file-upload/FileUpload.stories.d.ts +1 -0
- package/dist/components/file-upload/components/file-upload-compact-input-zone/FileUploadCompactInputZone.d.ts +1 -1
- package/dist/components/file-upload/components/file-upload-input-zone/FileUploadInputZone.d.ts +1 -1
- package/dist/components/file-upload/components/file-upload-item/FileUploadItem.d.ts +2 -0
- package/dist/components/file-upload/components/file-upload-item/FileUploadItem.stories.d.ts +1 -0
- package/dist/components/file-upload/components/file-upload-item-compact/FileUploadItemCompact.d.ts +2 -0
- package/dist/components/file-upload/components/file-upload-item-compact/FileUploadItemCompact.stories.d.ts +1 -0
- package/dist/components/file-upload/file-upload-compact/FileUploadCompact.d.ts +1 -0
- package/dist/components/file-upload/file-upload-compact/FileUploadCompact.stories.d.ts +1 -0
- package/dist/components/file-upload.js +194 -185
- package/dist/components/file-upload.js.map +1 -1
- package/dist/components/overlay.js +1 -1
- package/dist/components/resizable/components/ResizableCornerIcon.d.ts +3 -0
- package/dist/components/resizable/components/ResizableCornerIcon.stories.d.ts +7 -0
- package/dist/components/resizable/index.d.ts +1 -0
- package/dist/components/resizable.js +255 -232
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/search-select.js +1 -1
- package/dist/components/sheet.js +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/formatBytes-C4QXq5lC.js +9 -0
- package/dist/formatBytes-C4QXq5lC.js.map +1 -0
- package/dist/hooks/use-file-upload.js +1 -1
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/lib/utils.js +4 -2
- package/dist/lib/utils.js.map +1 -1
- package/dist/styles-scoped.css +54 -40
- package/dist/styles.css +54 -40
- package/dist/theme.css +25 -25
- package/dist/useFileUpload-Bnl3P8mP.js +193 -0
- package/dist/useFileUpload-Bnl3P8mP.js.map +1 -0
- package/package.json +1 -1
- package/tailwind.preset.js +2 -2
- package/dist/Overlay-2XMlxApi.js +0 -28
- package/dist/Overlay-2XMlxApi.js.map +0 -1
- package/dist/useFileUpload-iDag0iqM.js +0 -197
- package/dist/useFileUpload-iDag0iqM.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as ce } from "react/jsx-runtime";
|
|
2
2
|
import * as Rn from "react";
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { T as
|
|
3
|
+
import { forwardRef as tn, createElement as fe, useRef as F, useEffect as te, useContext as rn, createContext as Ln, useState as ue, useLayoutEffect as An, useImperativeHandle as on, useCallback as B, useMemo as kn } from "react";
|
|
4
|
+
import { T as Fe } from "../index-BVqs-uqP.js";
|
|
5
5
|
import { I as Dn } from "../Icon-DH3ev9GK.js";
|
|
6
6
|
import { c as Hn } from "../createLucideIcon-DwBrHnj9.js";
|
|
7
7
|
/**
|
|
@@ -32,9 +32,9 @@ const A = {
|
|
|
32
32
|
resizeHandleEnabled: "data-panel-resize-handle-enabled",
|
|
33
33
|
resizeHandleId: "data-panel-resize-handle-id",
|
|
34
34
|
resizeHandleState: "data-resize-handle-state"
|
|
35
|
-
},
|
|
35
|
+
}, Ve = 10, re = An, qe = Rn.useId, Nn = typeof qe == "function" ? qe : () => null;
|
|
36
36
|
let $n = 0;
|
|
37
|
-
function
|
|
37
|
+
function We(e = null) {
|
|
38
38
|
const n = Nn(), t = F(e || n || null);
|
|
39
39
|
return t.current === null && (t.current = "" + $n++), e ?? t.current;
|
|
40
40
|
}
|
|
@@ -49,15 +49,15 @@ function ln({
|
|
|
49
49
|
maxSize: a,
|
|
50
50
|
minSize: s,
|
|
51
51
|
onCollapse: m,
|
|
52
|
-
onExpand:
|
|
52
|
+
onExpand: w,
|
|
53
53
|
onResize: f,
|
|
54
54
|
order: c,
|
|
55
55
|
style: x,
|
|
56
|
-
tagName:
|
|
56
|
+
tagName: h = "div",
|
|
57
57
|
...I
|
|
58
58
|
}) {
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
59
|
+
const P = rn(Re);
|
|
60
|
+
if (P === null)
|
|
61
61
|
throw Error("Panel components must be rendered within a PanelGroup container");
|
|
62
62
|
const {
|
|
63
63
|
collapsePanel: b,
|
|
@@ -67,13 +67,13 @@ function ln({
|
|
|
67
67
|
groupId: O,
|
|
68
68
|
isPanelCollapsed: C,
|
|
69
69
|
reevaluatePanelConstraints: S,
|
|
70
|
-
registerPanel:
|
|
70
|
+
registerPanel: j,
|
|
71
71
|
resizePanel: J,
|
|
72
72
|
unregisterPanel: V
|
|
73
|
-
} =
|
|
73
|
+
} = P, _ = We(l), k = F({
|
|
74
74
|
callbacks: {
|
|
75
75
|
onCollapse: m,
|
|
76
|
-
onExpand:
|
|
76
|
+
onExpand: w,
|
|
77
77
|
onResize: f
|
|
78
78
|
},
|
|
79
79
|
constraints: {
|
|
@@ -96,13 +96,13 @@ function ln({
|
|
|
96
96
|
} = k.current, G = {
|
|
97
97
|
...N
|
|
98
98
|
};
|
|
99
|
-
k.current.id = _, k.current.idIsFromProps = l !== void 0, k.current.order = c, $.onCollapse = m, $.onExpand =
|
|
99
|
+
k.current.id = _, k.current.idIsFromProps = l !== void 0, k.current.order = c, $.onCollapse = m, $.onExpand = w, $.onResize = f, N.collapsedSize = t, N.collapsible = r, N.defaultSize = i, N.maxSize = a, N.minSize = s, (G.collapsedSize !== N.collapsedSize || G.collapsible !== N.collapsible || G.maxSize !== N.maxSize || G.minSize !== N.minSize) && S(k.current, G);
|
|
100
100
|
}), re(() => {
|
|
101
101
|
const $ = k.current;
|
|
102
|
-
return
|
|
102
|
+
return j($), () => {
|
|
103
103
|
V($);
|
|
104
104
|
};
|
|
105
|
-
}, [c, _,
|
|
105
|
+
}, [c, _, j, V]), on(o, () => ({
|
|
106
106
|
collapse: () => {
|
|
107
107
|
b(k.current);
|
|
108
108
|
},
|
|
@@ -126,7 +126,7 @@ function ln({
|
|
|
126
126
|
}
|
|
127
127
|
}), [b, R, D, C, _, J]);
|
|
128
128
|
const ee = M(k.current, i);
|
|
129
|
-
return
|
|
129
|
+
return fe(h, {
|
|
130
130
|
...I,
|
|
131
131
|
children: e,
|
|
132
132
|
className: n,
|
|
@@ -143,7 +143,7 @@ function ln({
|
|
|
143
143
|
[A.panelSize]: parseFloat("" + ee.flexGrow).toFixed(1)
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
|
-
const an =
|
|
146
|
+
const an = tn((e, n) => fe(ln, {
|
|
147
147
|
...e,
|
|
148
148
|
forwardedRef: n
|
|
149
149
|
}));
|
|
@@ -221,16 +221,16 @@ function Bn(e, n, t) {
|
|
|
221
221
|
function Fn(e, n) {
|
|
222
222
|
if (e === n) throw new Error("Cannot compare node with itself");
|
|
223
223
|
const t = {
|
|
224
|
-
a:
|
|
225
|
-
b:
|
|
224
|
+
a: Ye(e),
|
|
225
|
+
b: Ye(n)
|
|
226
226
|
};
|
|
227
227
|
let r;
|
|
228
228
|
for (; t.a.at(-1) === t.b.at(-1); )
|
|
229
229
|
e = t.a.pop(), n = t.b.pop(), r = e;
|
|
230
230
|
z(r, "Stacking order can only be calculated for elements with a common ancestor");
|
|
231
231
|
const i = {
|
|
232
|
-
a: Xe(
|
|
233
|
-
b: Xe(
|
|
232
|
+
a: Je(Xe(t.a)),
|
|
233
|
+
b: Je(Xe(t.b))
|
|
234
234
|
};
|
|
235
235
|
if (i.a === i.b) {
|
|
236
236
|
const o = r.childNodes, l = {
|
|
@@ -252,22 +252,22 @@ function Wn(e) {
|
|
|
252
252
|
const t = getComputedStyle((n = dn(e)) !== null && n !== void 0 ? n : e).display;
|
|
253
253
|
return t === "flex" || t === "inline-flex";
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function jn(e) {
|
|
256
256
|
const n = getComputedStyle(e);
|
|
257
257
|
return !!(n.position === "fixed" || n.zIndex !== "auto" && (n.position !== "static" || Wn(e)) || +n.opacity < 1 || "transform" in n && n.transform !== "none" || "webkitTransform" in n && n.webkitTransform !== "none" || "mixBlendMode" in n && n.mixBlendMode !== "normal" || "filter" in n && n.filter !== "none" || "webkitFilter" in n && n.webkitFilter !== "none" || "isolation" in n && n.isolation === "isolate" || Vn.test(n.willChange) || n.webkitOverflowScrolling === "touch");
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function Xe(e) {
|
|
260
260
|
let n = e.length;
|
|
261
261
|
for (; n--; ) {
|
|
262
262
|
const t = e[n];
|
|
263
|
-
if (z(t, "Missing node"),
|
|
263
|
+
if (z(t, "Missing node"), jn(t)) return t;
|
|
264
264
|
}
|
|
265
265
|
return null;
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function Je(e) {
|
|
268
268
|
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function Ye(e) {
|
|
271
271
|
const n = [];
|
|
272
272
|
for (; e; )
|
|
273
273
|
n.push(e), e = dn(e);
|
|
@@ -279,10 +279,10 @@ function dn(e) {
|
|
|
279
279
|
} = e;
|
|
280
280
|
return n && n instanceof ShadowRoot ? n.host : n;
|
|
281
281
|
}
|
|
282
|
-
const fn = 1, pn = 2, gn = 4, mn = 8,
|
|
283
|
-
let
|
|
284
|
-
const
|
|
285
|
-
function
|
|
282
|
+
const fn = 1, pn = 2, gn = 4, mn = 8, Kn = Tn() === "coarse";
|
|
283
|
+
let U = [], de = !1, Q = /* @__PURE__ */ new Map(), Ae = /* @__PURE__ */ new Map();
|
|
284
|
+
const be = /* @__PURE__ */ new Set();
|
|
285
|
+
function Un(e, n, t, r, i) {
|
|
286
286
|
var o;
|
|
287
287
|
const {
|
|
288
288
|
ownerDocument: l
|
|
@@ -292,13 +292,13 @@ function jn(e, n, t, r, i) {
|
|
|
292
292
|
hitAreaMargins: r,
|
|
293
293
|
setResizeHandlerState: i
|
|
294
294
|
}, s = (o = Q.get(l)) !== null && o !== void 0 ? o : 0;
|
|
295
|
-
return Q.set(l, s + 1),
|
|
296
|
-
var
|
|
297
|
-
Ae.delete(e),
|
|
298
|
-
const f = (
|
|
299
|
-
if (Q.set(l, f - 1), Ee(), f === 1 && Q.delete(l),
|
|
300
|
-
const c =
|
|
301
|
-
c >= 0 &&
|
|
295
|
+
return Q.set(l, s + 1), be.add(a), Ee(), function() {
|
|
296
|
+
var w;
|
|
297
|
+
Ae.delete(e), be.delete(a);
|
|
298
|
+
const f = (w = Q.get(l)) !== null && w !== void 0 ? w : 1;
|
|
299
|
+
if (Q.set(l, f - 1), Ee(), f === 1 && Q.delete(l), U.includes(a)) {
|
|
300
|
+
const c = U.indexOf(a);
|
|
301
|
+
c >= 0 && U.splice(c, 1), ke(), i("up", !0, null);
|
|
302
302
|
}
|
|
303
303
|
};
|
|
304
304
|
}
|
|
@@ -309,29 +309,29 @@ function On(e) {
|
|
|
309
309
|
x: t,
|
|
310
310
|
y: r
|
|
311
311
|
} = Le(e);
|
|
312
|
-
|
|
312
|
+
de = !0, je({
|
|
313
313
|
target: n,
|
|
314
314
|
x: t,
|
|
315
315
|
y: r
|
|
316
|
-
}), Ee(),
|
|
316
|
+
}), Ee(), U.length > 0 && (Ce("down", e), ke(), e.preventDefault(), hn(n) || e.stopImmediatePropagation());
|
|
317
317
|
}
|
|
318
318
|
function $e(e) {
|
|
319
319
|
const {
|
|
320
320
|
x: n,
|
|
321
321
|
y: t
|
|
322
322
|
} = Le(e);
|
|
323
|
-
if (
|
|
324
|
-
e.type !== "pointerleave" && e.buttons === 0 && (
|
|
323
|
+
if (de && // Skip this check for "pointerleave" events, else Firefox triggers a false positive (see #514)
|
|
324
|
+
e.type !== "pointerleave" && e.buttons === 0 && (de = !1, Ce("up", e)), !de) {
|
|
325
325
|
const {
|
|
326
326
|
target: r
|
|
327
327
|
} = e;
|
|
328
|
-
|
|
328
|
+
je({
|
|
329
329
|
target: r,
|
|
330
330
|
x: n,
|
|
331
331
|
y: t
|
|
332
332
|
});
|
|
333
333
|
}
|
|
334
|
-
Ce("move", e), ke(),
|
|
334
|
+
Ce("move", e), ke(), U.length > 0 && e.preventDefault();
|
|
335
335
|
}
|
|
336
336
|
function _e(e) {
|
|
337
337
|
const {
|
|
@@ -340,13 +340,13 @@ function _e(e) {
|
|
|
340
340
|
x: t,
|
|
341
341
|
y: r
|
|
342
342
|
} = Le(e);
|
|
343
|
-
Ae.clear(),
|
|
343
|
+
Ae.clear(), de = !1, U.length > 0 && (e.preventDefault(), hn(n) || e.stopImmediatePropagation()), Ce("up", e), je({
|
|
344
344
|
target: n,
|
|
345
345
|
x: t,
|
|
346
346
|
y: r
|
|
347
347
|
}), ke(), Ee();
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function hn(e) {
|
|
350
350
|
let n = e;
|
|
351
351
|
for (; n; ) {
|
|
352
352
|
if (n.hasAttribute(A.resizeHandle))
|
|
@@ -355,40 +355,40 @@ function yn(e) {
|
|
|
355
355
|
}
|
|
356
356
|
return !1;
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function je({
|
|
359
359
|
target: e,
|
|
360
360
|
x: n,
|
|
361
361
|
y: t
|
|
362
362
|
}) {
|
|
363
|
-
|
|
363
|
+
U.splice(0);
|
|
364
364
|
let r = null;
|
|
365
|
-
(e instanceof HTMLElement || e instanceof SVGElement) && (r = e),
|
|
365
|
+
(e instanceof HTMLElement || e instanceof SVGElement) && (r = e), be.forEach((i) => {
|
|
366
366
|
const {
|
|
367
367
|
element: o,
|
|
368
368
|
hitAreaMargins: l
|
|
369
369
|
} = i, a = o.getBoundingClientRect(), {
|
|
370
370
|
bottom: s,
|
|
371
371
|
left: m,
|
|
372
|
-
right:
|
|
372
|
+
right: w,
|
|
373
373
|
top: f
|
|
374
|
-
} = a, c =
|
|
375
|
-
if (n >= m - c && n <=
|
|
374
|
+
} = a, c = Kn ? l.coarse : l.fine;
|
|
375
|
+
if (n >= m - c && n <= w + c && t >= f - c && t <= s + c) {
|
|
376
376
|
if (r !== null && document.contains(r) && o !== r && !o.contains(r) && !r.contains(o) && // Calculating stacking order has a cost, so we should avoid it if possible
|
|
377
377
|
// That is why we only check potentially intersecting handles,
|
|
378
378
|
// and why we skip if the event target is within the handle's DOM
|
|
379
379
|
Fn(r, o) > 0) {
|
|
380
|
-
let
|
|
381
|
-
for (;
|
|
382
|
-
if (Bn(
|
|
380
|
+
let h = r, I = !1;
|
|
381
|
+
for (; h && !h.contains(o); ) {
|
|
382
|
+
if (Bn(h.getBoundingClientRect(), a)) {
|
|
383
383
|
I = !0;
|
|
384
384
|
break;
|
|
385
385
|
}
|
|
386
|
-
|
|
386
|
+
h = h.parentElement;
|
|
387
387
|
}
|
|
388
388
|
if (I)
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
|
-
|
|
391
|
+
U.push(i);
|
|
392
392
|
}
|
|
393
393
|
});
|
|
394
394
|
}
|
|
@@ -397,7 +397,7 @@ function Ge(e, n) {
|
|
|
397
397
|
}
|
|
398
398
|
function ke() {
|
|
399
399
|
let e = !1, n = !1;
|
|
400
|
-
|
|
400
|
+
U.forEach((r) => {
|
|
401
401
|
const {
|
|
402
402
|
direction: i
|
|
403
403
|
} = r;
|
|
@@ -416,7 +416,7 @@ function Ee() {
|
|
|
416
416
|
capture: !0,
|
|
417
417
|
signal: Te.signal
|
|
418
418
|
};
|
|
419
|
-
|
|
419
|
+
be.size && (de ? (U.length > 0 && Q.forEach((t, r) => {
|
|
420
420
|
const {
|
|
421
421
|
body: i
|
|
422
422
|
} = r;
|
|
@@ -434,25 +434,25 @@ function Ee() {
|
|
|
434
434
|
}));
|
|
435
435
|
}
|
|
436
436
|
function Ce(e, n) {
|
|
437
|
-
|
|
437
|
+
be.forEach((t) => {
|
|
438
438
|
const {
|
|
439
439
|
setResizeHandlerState: r
|
|
440
|
-
} = t, i =
|
|
440
|
+
} = t, i = U.includes(t);
|
|
441
441
|
r(e, i, n);
|
|
442
442
|
});
|
|
443
443
|
}
|
|
444
444
|
function qn() {
|
|
445
|
-
const [e, n] =
|
|
445
|
+
const [e, n] = ue(0);
|
|
446
446
|
return B(() => n((t) => t + 1), []);
|
|
447
447
|
}
|
|
448
448
|
function z(e, n) {
|
|
449
449
|
if (!e)
|
|
450
450
|
throw console.error(n), Error(n);
|
|
451
451
|
}
|
|
452
|
-
function oe(e, n, t =
|
|
452
|
+
function oe(e, n, t = Ve) {
|
|
453
453
|
return e.toFixed(t) === n.toFixed(t) ? 0 : e > n ? 1 : -1;
|
|
454
454
|
}
|
|
455
|
-
function Y(e, n, t =
|
|
455
|
+
function Y(e, n, t = Ve) {
|
|
456
456
|
return oe(e, n, t) === 0;
|
|
457
457
|
}
|
|
458
458
|
function W(e, n, t) {
|
|
@@ -487,9 +487,9 @@ function se({
|
|
|
487
487
|
oe(t, s) < 0 ? t = i : t = a;
|
|
488
488
|
} else
|
|
489
489
|
t = a;
|
|
490
|
-
return t = Math.min(l, t), t = parseFloat(t.toFixed(
|
|
490
|
+
return t = Math.min(l, t), t = parseFloat(t.toFixed(Ve)), t;
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function xe({
|
|
493
493
|
delta: e,
|
|
494
494
|
initialLayout: n,
|
|
495
495
|
panelConstraints: t,
|
|
@@ -508,13 +508,13 @@ function ze({
|
|
|
508
508
|
z(c, `Panel constraints not found for index ${f}`);
|
|
509
509
|
const {
|
|
510
510
|
collapsedSize: x = 0,
|
|
511
|
-
collapsible:
|
|
511
|
+
collapsible: h,
|
|
512
512
|
minSize: I = 0
|
|
513
513
|
} = c;
|
|
514
|
-
if (
|
|
515
|
-
const
|
|
516
|
-
if (z(
|
|
517
|
-
const b = I -
|
|
514
|
+
if (h) {
|
|
515
|
+
const P = n[f];
|
|
516
|
+
if (z(P != null, `Previous layout not found for panel index ${f}`), W(P, x)) {
|
|
517
|
+
const b = I - P;
|
|
518
518
|
oe(b, Math.abs(e)) > 0 && (e = e < 0 ? 0 - b : b);
|
|
519
519
|
}
|
|
520
520
|
}
|
|
@@ -524,13 +524,13 @@ function ze({
|
|
|
524
524
|
z(c, `No panel constraints found for index ${f}`);
|
|
525
525
|
const {
|
|
526
526
|
collapsedSize: x = 0,
|
|
527
|
-
collapsible:
|
|
527
|
+
collapsible: h,
|
|
528
528
|
minSize: I = 0
|
|
529
529
|
} = c;
|
|
530
|
-
if (
|
|
531
|
-
const
|
|
532
|
-
if (z(
|
|
533
|
-
const b =
|
|
530
|
+
if (h) {
|
|
531
|
+
const P = n[f];
|
|
532
|
+
if (z(P != null, `Previous layout not found for panel index ${f}`), W(P, I)) {
|
|
533
|
+
const b = P - x;
|
|
534
534
|
oe(b, Math.abs(e)) > 0 && (e = e < 0 ? 0 - b : b);
|
|
535
535
|
}
|
|
536
536
|
}
|
|
@@ -550,20 +550,20 @@ function ze({
|
|
|
550
550
|
if (x += b, c += f, c < 0 || c >= t.length)
|
|
551
551
|
break;
|
|
552
552
|
}
|
|
553
|
-
const
|
|
554
|
-
e = e < 0 ? 0 -
|
|
553
|
+
const h = Math.min(Math.abs(e), Math.abs(x));
|
|
554
|
+
e = e < 0 ? 0 - h : h;
|
|
555
555
|
}
|
|
556
556
|
{
|
|
557
557
|
let c = e < 0 ? a : s;
|
|
558
558
|
for (; c >= 0 && c < t.length; ) {
|
|
559
|
-
const x = Math.abs(e) - Math.abs(m),
|
|
560
|
-
z(
|
|
561
|
-
const I =
|
|
559
|
+
const x = Math.abs(e) - Math.abs(m), h = n[c];
|
|
560
|
+
z(h != null, `Previous layout not found for panel index ${c}`);
|
|
561
|
+
const I = h - x, P = se({
|
|
562
562
|
panelConstraints: t,
|
|
563
563
|
panelIndex: c,
|
|
564
564
|
size: I
|
|
565
565
|
});
|
|
566
|
-
if (!W(
|
|
566
|
+
if (!W(h, P) && (m += h - P, l[c] = P, m.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
567
567
|
numeric: !0
|
|
568
568
|
}) >= 0))
|
|
569
569
|
break;
|
|
@@ -575,13 +575,13 @@ function ze({
|
|
|
575
575
|
{
|
|
576
576
|
const f = e < 0 ? s : a, c = n[f];
|
|
577
577
|
z(c != null, `Previous layout not found for panel index ${f}`);
|
|
578
|
-
const x = c + m,
|
|
578
|
+
const x = c + m, h = se({
|
|
579
579
|
panelConstraints: t,
|
|
580
580
|
panelIndex: f,
|
|
581
581
|
size: x
|
|
582
582
|
});
|
|
583
|
-
if (l[f] =
|
|
584
|
-
let I = x -
|
|
583
|
+
if (l[f] = h, !W(h, x)) {
|
|
584
|
+
let I = x - h, b = e < 0 ? s : a;
|
|
585
585
|
for (; b >= 0 && b < t.length; ) {
|
|
586
586
|
const R = l[b];
|
|
587
587
|
z(R != null, `Previous layout not found for panel index ${b}`);
|
|
@@ -596,8 +596,8 @@ function ze({
|
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
|
-
const
|
|
600
|
-
return W(
|
|
599
|
+
const w = l.reduce((f, c) => c + f, 0);
|
|
600
|
+
return W(w, 100) ? l : i;
|
|
601
601
|
}
|
|
602
602
|
function Jn({
|
|
603
603
|
layout: e,
|
|
@@ -610,27 +610,27 @@ function Jn({
|
|
|
610
610
|
const {
|
|
611
611
|
constraints: x
|
|
612
612
|
} = f, {
|
|
613
|
-
maxSize:
|
|
613
|
+
maxSize: h = 100,
|
|
614
614
|
minSize: I = 0
|
|
615
615
|
} = x;
|
|
616
|
-
c === a ? (r = I, i =
|
|
616
|
+
c === a ? (r = I, i = h) : (o += I, l += h);
|
|
617
617
|
});
|
|
618
|
-
const s = Math.min(i, 100 - o), m = Math.max(r, 100 - l),
|
|
618
|
+
const s = Math.min(i, 100 - o), m = Math.max(r, 100 - l), w = e[a];
|
|
619
619
|
return {
|
|
620
620
|
valueMax: s,
|
|
621
621
|
valueMin: m,
|
|
622
|
-
valueNow:
|
|
622
|
+
valueNow: w
|
|
623
623
|
};
|
|
624
624
|
}
|
|
625
|
-
function
|
|
625
|
+
function Se(e, n = document) {
|
|
626
626
|
return Array.from(n.querySelectorAll(`[${A.resizeHandleId}][data-panel-group-id="${e}"]`));
|
|
627
627
|
}
|
|
628
|
-
function
|
|
629
|
-
const i =
|
|
628
|
+
function yn(e, n, t = document) {
|
|
629
|
+
const i = Se(e, t).findIndex((o) => o.getAttribute(A.resizeHandleId) === n);
|
|
630
630
|
return i ?? null;
|
|
631
631
|
}
|
|
632
632
|
function zn(e, n, t) {
|
|
633
|
-
const r =
|
|
633
|
+
const r = yn(e, n, t);
|
|
634
634
|
return r != null ? [r, r + 1] : [-1, -1];
|
|
635
635
|
}
|
|
636
636
|
function Yn(e) {
|
|
@@ -648,7 +648,7 @@ function De(e, n = document) {
|
|
|
648
648
|
}
|
|
649
649
|
function Zn(e, n, t, r = document) {
|
|
650
650
|
var i, o, l, a;
|
|
651
|
-
const s = De(n, r), m =
|
|
651
|
+
const s = De(n, r), m = Se(e, r), w = s ? m.indexOf(s) : -1, f = (i = (o = t[w]) === null || o === void 0 ? void 0 : o.id) !== null && i !== void 0 ? i : null, c = (l = (a = t[w + 1]) === null || a === void 0 ? void 0 : a.id) !== null && l !== void 0 ? l : null;
|
|
652
652
|
return [f, c];
|
|
653
653
|
}
|
|
654
654
|
function Qn({
|
|
@@ -665,11 +665,11 @@ function Qn({
|
|
|
665
665
|
}), re(() => {
|
|
666
666
|
if (!o)
|
|
667
667
|
return;
|
|
668
|
-
const a =
|
|
668
|
+
const a = Se(t, o);
|
|
669
669
|
for (let s = 0; s < i.length - 1; s++) {
|
|
670
670
|
const {
|
|
671
671
|
valueMax: m,
|
|
672
|
-
valueMin:
|
|
672
|
+
valueMin: w,
|
|
673
673
|
valueNow: f
|
|
674
674
|
} = Jn({
|
|
675
675
|
layout: r,
|
|
@@ -678,7 +678,7 @@ function Qn({
|
|
|
678
678
|
}), c = a[s];
|
|
679
679
|
if (c != null) {
|
|
680
680
|
const x = i[s];
|
|
681
|
-
z(x, `No panel data found for index "${s}"`), c.setAttribute("aria-controls", x.id), c.setAttribute("aria-valuemax", "" + Math.round(m)), c.setAttribute("aria-valuemin", "" + Math.round(
|
|
681
|
+
z(x, `No panel data found for index "${s}"`), c.setAttribute("aria-controls", x.id), c.setAttribute("aria-valuemax", "" + Math.round(m)), c.setAttribute("aria-valuemin", "" + Math.round(w)), c.setAttribute("aria-valuenow", f != null ? "" + Math.round(f) : "");
|
|
682
682
|
}
|
|
683
683
|
}
|
|
684
684
|
return () => {
|
|
@@ -695,21 +695,21 @@ function Qn({
|
|
|
695
695
|
panelDataArray: s
|
|
696
696
|
} = a, m = xn(t, o);
|
|
697
697
|
z(m != null, `No group found for id "${t}"`);
|
|
698
|
-
const
|
|
699
|
-
z(
|
|
700
|
-
const f =
|
|
698
|
+
const w = Se(t, o);
|
|
699
|
+
z(w, `No resize handles found for group id "${t}"`);
|
|
700
|
+
const f = w.map((c) => {
|
|
701
701
|
const x = c.getAttribute(A.resizeHandleId);
|
|
702
702
|
z(x, "Resize handle element has no handle id attribute");
|
|
703
|
-
const [
|
|
704
|
-
if (
|
|
703
|
+
const [h, I] = Zn(t, x, s, o);
|
|
704
|
+
if (h == null || I == null)
|
|
705
705
|
return () => {
|
|
706
706
|
};
|
|
707
|
-
const
|
|
707
|
+
const P = (b) => {
|
|
708
708
|
if (!b.defaultPrevented)
|
|
709
709
|
switch (b.key) {
|
|
710
710
|
case "Enter": {
|
|
711
711
|
b.preventDefault();
|
|
712
|
-
const R = s.findIndex((D) => D.id ===
|
|
712
|
+
const R = s.findIndex((D) => D.id === h);
|
|
713
713
|
if (R >= 0) {
|
|
714
714
|
const D = s[R];
|
|
715
715
|
z(D, `No panel data found for index ${R}`);
|
|
@@ -719,7 +719,7 @@ function Qn({
|
|
|
719
719
|
minSize: S = 0
|
|
720
720
|
} = D.constraints;
|
|
721
721
|
if (M != null && C) {
|
|
722
|
-
const
|
|
722
|
+
const j = xe({
|
|
723
723
|
delta: W(M, O) ? S - O : O - M,
|
|
724
724
|
initialLayout: r,
|
|
725
725
|
panelConstraints: s.map((J) => J.constraints),
|
|
@@ -727,15 +727,15 @@ function Qn({
|
|
|
727
727
|
prevLayout: r,
|
|
728
728
|
trigger: "keyboard"
|
|
729
729
|
});
|
|
730
|
-
r !==
|
|
730
|
+
r !== j && l(j);
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
733
|
break;
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
736
|
};
|
|
737
|
-
return c.addEventListener("keydown",
|
|
738
|
-
c.removeEventListener("keydown",
|
|
737
|
+
return c.addEventListener("keydown", P), () => {
|
|
738
|
+
c.removeEventListener("keydown", P);
|
|
739
739
|
};
|
|
740
740
|
});
|
|
741
741
|
return () => {
|
|
@@ -743,7 +743,7 @@ function Qn({
|
|
|
743
743
|
};
|
|
744
744
|
}, [o, e, n, t, r, i, l]);
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function Ze(e, n) {
|
|
747
747
|
if (e.length !== n.length)
|
|
748
748
|
return !1;
|
|
749
749
|
for (let t = 0; t < e.length; t++)
|
|
@@ -766,9 +766,9 @@ function et(e, n, t, r, i) {
|
|
|
766
766
|
let {
|
|
767
767
|
initialCursorPosition: s
|
|
768
768
|
} = r;
|
|
769
|
-
const m = vn(t, e),
|
|
770
|
-
z(
|
|
771
|
-
const f =
|
|
769
|
+
const m = vn(t, e), w = xn(a, i);
|
|
770
|
+
z(w, `No group element found for id "${a}"`);
|
|
771
|
+
const f = w.getBoundingClientRect(), c = o ? f.width : f.height;
|
|
772
772
|
return (m - s) / c * 100;
|
|
773
773
|
}
|
|
774
774
|
function nt(e, n, t, r, i, o) {
|
|
@@ -837,16 +837,16 @@ function le(e, n, t) {
|
|
|
837
837
|
id: s
|
|
838
838
|
} = o, {
|
|
839
839
|
collapsedSize: m = 0,
|
|
840
|
-
collapsible:
|
|
840
|
+
collapsible: w
|
|
841
841
|
} = a, f = t[s];
|
|
842
842
|
if (f == null || r !== f) {
|
|
843
843
|
t[s] = r;
|
|
844
844
|
const {
|
|
845
845
|
onCollapse: c,
|
|
846
846
|
onExpand: x,
|
|
847
|
-
onResize:
|
|
847
|
+
onResize: h
|
|
848
848
|
} = l;
|
|
849
|
-
|
|
849
|
+
h && h(r, f), w && (c || x) && (x && (f == null || Y(f, m)) && !Y(r, m) && x(), c && (f == null || !Y(f, m)) && Y(r, m) && c());
|
|
850
850
|
}
|
|
851
851
|
});
|
|
852
852
|
}
|
|
@@ -887,7 +887,7 @@ function ot(e, n = 10) {
|
|
|
887
887
|
}, n);
|
|
888
888
|
};
|
|
889
889
|
}
|
|
890
|
-
function
|
|
890
|
+
function Qe(e) {
|
|
891
891
|
try {
|
|
892
892
|
if (typeof localStorage < "u")
|
|
893
893
|
e.getItem = (n) => localStorage.getItem(n), e.setItem = (n, t) => {
|
|
@@ -914,7 +914,7 @@ function Sn(e) {
|
|
|
914
914
|
return i ? r : o ? `${o}:${JSON.stringify(t)}` : JSON.stringify(t);
|
|
915
915
|
}).sort((n, t) => n.localeCompare(t)).join(",");
|
|
916
916
|
}
|
|
917
|
-
function
|
|
917
|
+
function wn(e, n) {
|
|
918
918
|
try {
|
|
919
919
|
const t = bn(e), r = n.getItem(t);
|
|
920
920
|
if (r) {
|
|
@@ -928,12 +928,12 @@ function Pn(e, n) {
|
|
|
928
928
|
}
|
|
929
929
|
function it(e, n, t) {
|
|
930
930
|
var r, i;
|
|
931
|
-
const o = (r =
|
|
931
|
+
const o = (r = wn(e, t)) !== null && r !== void 0 ? r : {}, l = Sn(n);
|
|
932
932
|
return (i = o[l]) !== null && i !== void 0 ? i : null;
|
|
933
933
|
}
|
|
934
934
|
function lt(e, n, t, r, i) {
|
|
935
935
|
var o;
|
|
936
|
-
const l = bn(e), a = Sn(n), s = (o =
|
|
936
|
+
const l = bn(e), a = Sn(n), s = (o = wn(e, i)) !== null && o !== void 0 ? o : {};
|
|
937
937
|
s[a] = {
|
|
938
938
|
expandToSizes: Object.fromEntries(t.entries()),
|
|
939
939
|
layout: r
|
|
@@ -944,7 +944,7 @@ function lt(e, n, t, r, i) {
|
|
|
944
944
|
console.error(m);
|
|
945
945
|
}
|
|
946
946
|
}
|
|
947
|
-
function
|
|
947
|
+
function en({
|
|
948
948
|
layout: e,
|
|
949
949
|
panelConstraints: n
|
|
950
950
|
}) {
|
|
@@ -983,13 +983,13 @@ function Qe({
|
|
|
983
983
|
}
|
|
984
984
|
return t;
|
|
985
985
|
}
|
|
986
|
-
const at = 100,
|
|
987
|
-
getItem: (e) => (
|
|
986
|
+
const at = 100, ve = {
|
|
987
|
+
getItem: (e) => (Qe(ve), ve.getItem(e)),
|
|
988
988
|
setItem: (e, n) => {
|
|
989
|
-
|
|
989
|
+
Qe(ve), ve.setItem(e, n);
|
|
990
990
|
}
|
|
991
|
-
},
|
|
992
|
-
function
|
|
991
|
+
}, nn = {};
|
|
992
|
+
function Pn({
|
|
993
993
|
autoSaveId: e = null,
|
|
994
994
|
children: n,
|
|
995
995
|
className: t = "",
|
|
@@ -998,21 +998,21 @@ function wn({
|
|
|
998
998
|
id: o = null,
|
|
999
999
|
onLayout: l = null,
|
|
1000
1000
|
keyboardResizeBy: a = null,
|
|
1001
|
-
storage: s =
|
|
1001
|
+
storage: s = ve,
|
|
1002
1002
|
style: m,
|
|
1003
|
-
tagName:
|
|
1003
|
+
tagName: w = "div",
|
|
1004
1004
|
...f
|
|
1005
1005
|
}) {
|
|
1006
|
-
const c =
|
|
1006
|
+
const c = We(o), x = F(null), [h, I] = ue(null), [P, b] = ue([]), R = qn(), D = F({}), M = F(/* @__PURE__ */ new Map()), O = F(0), C = F({
|
|
1007
1007
|
autoSaveId: e,
|
|
1008
1008
|
direction: r,
|
|
1009
|
-
dragState:
|
|
1009
|
+
dragState: h,
|
|
1010
1010
|
id: c,
|
|
1011
1011
|
keyboardResizeBy: a,
|
|
1012
1012
|
onLayout: l,
|
|
1013
1013
|
storage: s
|
|
1014
1014
|
}), S = F({
|
|
1015
|
-
layout:
|
|
1015
|
+
layout: P,
|
|
1016
1016
|
panelDataArray: [],
|
|
1017
1017
|
panelDataArrayChanged: !1
|
|
1018
1018
|
});
|
|
@@ -1020,7 +1020,7 @@ function wn({
|
|
|
1020
1020
|
didLogIdAndOrderWarning: !1,
|
|
1021
1021
|
didLogPanelConstraintsWarning: !1,
|
|
1022
1022
|
prevPanelIds: []
|
|
1023
|
-
}),
|
|
1023
|
+
}), on(i, () => ({
|
|
1024
1024
|
getId: () => C.current.id,
|
|
1025
1025
|
getLayout: () => {
|
|
1026
1026
|
const {
|
|
@@ -1034,19 +1034,19 @@ function wn({
|
|
|
1034
1034
|
} = C.current, {
|
|
1035
1035
|
layout: v,
|
|
1036
1036
|
panelDataArray: p
|
|
1037
|
-
} = S.current, d =
|
|
1037
|
+
} = S.current, d = en({
|
|
1038
1038
|
layout: u,
|
|
1039
|
-
panelConstraints: p.map((
|
|
1039
|
+
panelConstraints: p.map((y) => y.constraints)
|
|
1040
1040
|
});
|
|
1041
|
-
|
|
1041
|
+
Ze(v, d) || (b(d), S.current.layout = d, g && g(d), le(p, d, D.current));
|
|
1042
1042
|
}
|
|
1043
1043
|
}), []), re(() => {
|
|
1044
|
-
C.current.autoSaveId = e, C.current.direction = r, C.current.dragState =
|
|
1044
|
+
C.current.autoSaveId = e, C.current.direction = r, C.current.dragState = h, C.current.id = c, C.current.onLayout = l, C.current.storage = s;
|
|
1045
1045
|
}), Qn({
|
|
1046
1046
|
committedValuesRef: C,
|
|
1047
1047
|
eagerValuesRef: S,
|
|
1048
1048
|
groupId: c,
|
|
1049
|
-
layout:
|
|
1049
|
+
layout: P,
|
|
1050
1050
|
panelDataArray: S.current.panelDataArray,
|
|
1051
1051
|
setLayout: b,
|
|
1052
1052
|
panelGroupElement: x.current
|
|
@@ -1055,16 +1055,16 @@ function wn({
|
|
|
1055
1055
|
panelDataArray: u
|
|
1056
1056
|
} = S.current;
|
|
1057
1057
|
if (e) {
|
|
1058
|
-
if (
|
|
1058
|
+
if (P.length === 0 || P.length !== u.length)
|
|
1059
1059
|
return;
|
|
1060
|
-
let g =
|
|
1061
|
-
g == null && (g = ot(lt, at),
|
|
1060
|
+
let g = nn[e];
|
|
1061
|
+
g == null && (g = ot(lt, at), nn[e] = g);
|
|
1062
1062
|
const v = [...u], p = new Map(M.current);
|
|
1063
|
-
g(e, v, p,
|
|
1063
|
+
g(e, v, p, P, s);
|
|
1064
1064
|
}
|
|
1065
|
-
}, [e,
|
|
1065
|
+
}, [e, P, s]), te(() => {
|
|
1066
1066
|
});
|
|
1067
|
-
const
|
|
1067
|
+
const j = B((u) => {
|
|
1068
1068
|
const {
|
|
1069
1069
|
onLayout: g
|
|
1070
1070
|
} = C.current, {
|
|
@@ -1073,13 +1073,13 @@ function wn({
|
|
|
1073
1073
|
} = S.current;
|
|
1074
1074
|
if (u.constraints.collapsible) {
|
|
1075
1075
|
const d = p.map((q) => q.constraints), {
|
|
1076
|
-
collapsedSize:
|
|
1076
|
+
collapsedSize: y = 0,
|
|
1077
1077
|
panelSize: E,
|
|
1078
1078
|
pivotIndices: H
|
|
1079
1079
|
} = ne(p, u, v);
|
|
1080
|
-
if (z(E != null, `Panel size not found for panel "${u.id}"`), !Y(E,
|
|
1080
|
+
if (z(E != null, `Panel size not found for panel "${u.id}"`), !Y(E, y)) {
|
|
1081
1081
|
M.current.set(u.id, E);
|
|
1082
|
-
const X = ae(p, u) === p.length - 1 ? E -
|
|
1082
|
+
const X = ae(p, u) === p.length - 1 ? E - y : y - E, L = xe({
|
|
1083
1083
|
delta: X,
|
|
1084
1084
|
initialLayout: v,
|
|
1085
1085
|
panelConstraints: d,
|
|
@@ -1098,17 +1098,17 @@ function wn({
|
|
|
1098
1098
|
panelDataArray: d
|
|
1099
1099
|
} = S.current;
|
|
1100
1100
|
if (u.constraints.collapsible) {
|
|
1101
|
-
const
|
|
1101
|
+
const y = d.map((K) => K.constraints), {
|
|
1102
1102
|
collapsedSize: E = 0,
|
|
1103
1103
|
panelSize: H = 0,
|
|
1104
1104
|
minSize: q = 0,
|
|
1105
1105
|
pivotIndices: X
|
|
1106
1106
|
} = ne(d, u, p), L = g ?? q;
|
|
1107
1107
|
if (Y(H, E)) {
|
|
1108
|
-
const
|
|
1108
|
+
const K = M.current.get(u.id), ye = K != null && K >= L ? K : L, Me = ae(d, u) === d.length - 1 ? H - ye : ye - H, T = xe({
|
|
1109
1109
|
delta: Me,
|
|
1110
1110
|
initialLayout: p,
|
|
1111
|
-
panelConstraints:
|
|
1111
|
+
panelConstraints: y,
|
|
1112
1112
|
pivotIndices: X,
|
|
1113
1113
|
prevLayout: p,
|
|
1114
1114
|
trigger: "imperative-api"
|
|
@@ -1130,21 +1130,21 @@ function wn({
|
|
|
1130
1130
|
} = S.current, p = ae(v, u);
|
|
1131
1131
|
return rt({
|
|
1132
1132
|
defaultSize: g,
|
|
1133
|
-
dragState:
|
|
1134
|
-
layout:
|
|
1133
|
+
dragState: h,
|
|
1134
|
+
layout: P,
|
|
1135
1135
|
panelData: v,
|
|
1136
1136
|
panelIndex: p
|
|
1137
1137
|
});
|
|
1138
|
-
}, [
|
|
1138
|
+
}, [h, P]), k = B((u) => {
|
|
1139
1139
|
const {
|
|
1140
1140
|
layout: g,
|
|
1141
1141
|
panelDataArray: v
|
|
1142
1142
|
} = S.current, {
|
|
1143
1143
|
collapsedSize: p = 0,
|
|
1144
1144
|
collapsible: d,
|
|
1145
|
-
panelSize:
|
|
1145
|
+
panelSize: y
|
|
1146
1146
|
} = ne(v, u, g);
|
|
1147
|
-
return z(
|
|
1147
|
+
return z(y != null, `Panel size not found for panel "${u.id}"`), d === !0 && Y(y, p);
|
|
1148
1148
|
}, []), ee = B((u) => {
|
|
1149
1149
|
const {
|
|
1150
1150
|
layout: g,
|
|
@@ -1152,16 +1152,16 @@ function wn({
|
|
|
1152
1152
|
} = S.current, {
|
|
1153
1153
|
collapsedSize: p = 0,
|
|
1154
1154
|
collapsible: d,
|
|
1155
|
-
panelSize:
|
|
1155
|
+
panelSize: y
|
|
1156
1156
|
} = ne(v, u, g);
|
|
1157
|
-
return z(
|
|
1157
|
+
return z(y != null, `Panel size not found for panel "${u.id}"`), !d || oe(y, p) > 0;
|
|
1158
1158
|
}, []), $ = B((u) => {
|
|
1159
1159
|
const {
|
|
1160
1160
|
panelDataArray: g
|
|
1161
1161
|
} = S.current;
|
|
1162
1162
|
g.push(u), g.sort((v, p) => {
|
|
1163
|
-
const d = v.order,
|
|
1164
|
-
return d == null &&
|
|
1163
|
+
const d = v.order, y = p.order;
|
|
1164
|
+
return d == null && y == null ? 0 : d == null ? -1 : y == null ? 1 : d - y;
|
|
1165
1165
|
}), S.current.panelDataArrayChanged = !0, R();
|
|
1166
1166
|
}, [R]);
|
|
1167
1167
|
re(() => {
|
|
@@ -1175,19 +1175,19 @@ function wn({
|
|
|
1175
1175
|
layout: p,
|
|
1176
1176
|
panelDataArray: d
|
|
1177
1177
|
} = S.current;
|
|
1178
|
-
let
|
|
1178
|
+
let y = null;
|
|
1179
1179
|
if (u) {
|
|
1180
1180
|
const H = it(u, d, v);
|
|
1181
|
-
H && (M.current = new Map(Object.entries(H.expandToSizes)),
|
|
1181
|
+
H && (M.current = new Map(Object.entries(H.expandToSizes)), y = H.layout);
|
|
1182
1182
|
}
|
|
1183
|
-
|
|
1183
|
+
y == null && (y = tt({
|
|
1184
1184
|
panelDataArray: d
|
|
1185
1185
|
}));
|
|
1186
|
-
const E =
|
|
1187
|
-
layout:
|
|
1186
|
+
const E = en({
|
|
1187
|
+
layout: y,
|
|
1188
1188
|
panelConstraints: d.map((H) => H.constraints)
|
|
1189
1189
|
});
|
|
1190
|
-
|
|
1190
|
+
Ze(p, E) || (b(E), S.current.layout = E, g && g(E), le(d, E, D.current));
|
|
1191
1191
|
}
|
|
1192
1192
|
}), re(() => {
|
|
1193
1193
|
const u = S.current;
|
|
@@ -1200,8 +1200,8 @@ function wn({
|
|
|
1200
1200
|
const v = x.current;
|
|
1201
1201
|
return v && window.getComputedStyle(v, null).getPropertyValue("direction") === "rtl" && (g = !0), function(d) {
|
|
1202
1202
|
d.preventDefault();
|
|
1203
|
-
const
|
|
1204
|
-
if (!
|
|
1203
|
+
const y = x.current;
|
|
1204
|
+
if (!y)
|
|
1205
1205
|
return () => null;
|
|
1206
1206
|
const {
|
|
1207
1207
|
direction: E,
|
|
@@ -1210,23 +1210,23 @@ function wn({
|
|
|
1210
1210
|
keyboardResizeBy: X,
|
|
1211
1211
|
onLayout: L
|
|
1212
1212
|
} = C.current, {
|
|
1213
|
-
layout:
|
|
1213
|
+
layout: K,
|
|
1214
1214
|
panelDataArray: ye
|
|
1215
1215
|
} = S.current, {
|
|
1216
|
-
initialLayout:
|
|
1217
|
-
} = H ?? {}, Me = zn(q, u,
|
|
1218
|
-
let T = nt(d, u, E, H, X,
|
|
1216
|
+
initialLayout: we
|
|
1217
|
+
} = H ?? {}, Me = zn(q, u, y);
|
|
1218
|
+
let T = nt(d, u, E, H, X, y);
|
|
1219
1219
|
const Ue = E === "horizontal";
|
|
1220
1220
|
Ue && g && (T = -T);
|
|
1221
|
-
const En = ye.map((Cn) => Cn.constraints),
|
|
1221
|
+
const En = ye.map((Cn) => Cn.constraints), ze = xe({
|
|
1222
1222
|
delta: T,
|
|
1223
|
-
initialLayout:
|
|
1223
|
+
initialLayout: we ?? K,
|
|
1224
1224
|
panelConstraints: En,
|
|
1225
1225
|
pivotIndices: Me,
|
|
1226
|
-
prevLayout:
|
|
1226
|
+
prevLayout: K,
|
|
1227
1227
|
trigger: sn(d) ? "keyboard" : "mouse-or-touch"
|
|
1228
|
-
}),
|
|
1229
|
-
(cn(d) || un(d)) && O.current != T && (O.current = T, !
|
|
1228
|
+
}), Oe = !Pe(K, ze);
|
|
1229
|
+
(cn(d) || un(d)) && O.current != T && (O.current = T, !Oe && T !== 0 ? Ue ? Ge(u, T < 0 ? fn : pn) : Ge(u, T < 0 ? gn : mn) : Ge(u, 0)), Oe && (b(ze), S.current.layout = ze, L && L(ze), le(ye, ze, D.current));
|
|
1230
1230
|
};
|
|
1231
1231
|
}, []), G = B((u, g) => {
|
|
1232
1232
|
const {
|
|
@@ -1234,27 +1234,27 @@ function wn({
|
|
|
1234
1234
|
} = C.current, {
|
|
1235
1235
|
layout: p,
|
|
1236
1236
|
panelDataArray: d
|
|
1237
|
-
} = S.current,
|
|
1237
|
+
} = S.current, y = d.map((K) => K.constraints), {
|
|
1238
1238
|
panelSize: E,
|
|
1239
1239
|
pivotIndices: H
|
|
1240
1240
|
} = ne(d, u, p);
|
|
1241
1241
|
z(E != null, `Panel size not found for panel "${u.id}"`);
|
|
1242
|
-
const X = ae(d, u) === d.length - 1 ? E - g : g - E, L =
|
|
1242
|
+
const X = ae(d, u) === d.length - 1 ? E - g : g - E, L = xe({
|
|
1243
1243
|
delta: X,
|
|
1244
1244
|
initialLayout: p,
|
|
1245
|
-
panelConstraints:
|
|
1245
|
+
panelConstraints: y,
|
|
1246
1246
|
pivotIndices: H,
|
|
1247
1247
|
prevLayout: p,
|
|
1248
1248
|
trigger: "imperative-api"
|
|
1249
1249
|
});
|
|
1250
1250
|
Pe(p, L) || (b(L), S.current.layout = L, v && v(L), le(d, L, D.current));
|
|
1251
|
-
}, []),
|
|
1251
|
+
}, []), pe = B((u, g) => {
|
|
1252
1252
|
const {
|
|
1253
1253
|
layout: v,
|
|
1254
1254
|
panelDataArray: p
|
|
1255
1255
|
} = S.current, {
|
|
1256
1256
|
collapsedSize: d = 0,
|
|
1257
|
-
collapsible:
|
|
1257
|
+
collapsible: y
|
|
1258
1258
|
} = g, {
|
|
1259
1259
|
collapsedSize: E = 0,
|
|
1260
1260
|
collapsible: H,
|
|
@@ -1263,8 +1263,8 @@ function wn({
|
|
|
1263
1263
|
} = u.constraints, {
|
|
1264
1264
|
panelSize: L
|
|
1265
1265
|
} = ne(p, u, v);
|
|
1266
|
-
L != null && (
|
|
1267
|
-
}, [G]),
|
|
1266
|
+
L != null && (y && H && Y(L, d) ? Y(d, E) || G(u, E) : L < X ? G(u, X) : L > q && G(u, q));
|
|
1267
|
+
}, [G]), ge = B((u, g) => {
|
|
1268
1268
|
const {
|
|
1269
1269
|
direction: v
|
|
1270
1270
|
} = C.current, {
|
|
@@ -1274,14 +1274,14 @@ function wn({
|
|
|
1274
1274
|
return;
|
|
1275
1275
|
const d = De(u, x.current);
|
|
1276
1276
|
z(d, `Drag handle element not found for id "${u}"`);
|
|
1277
|
-
const
|
|
1277
|
+
const y = vn(v, g);
|
|
1278
1278
|
I({
|
|
1279
1279
|
dragHandleId: u,
|
|
1280
1280
|
dragHandleRect: d.getBoundingClientRect(),
|
|
1281
|
-
initialCursorPosition:
|
|
1281
|
+
initialCursorPosition: y,
|
|
1282
1282
|
initialLayout: p
|
|
1283
1283
|
});
|
|
1284
|
-
}, []),
|
|
1284
|
+
}, []), me = B(() => {
|
|
1285
1285
|
I(null);
|
|
1286
1286
|
}, []), He = B((u) => {
|
|
1287
1287
|
const {
|
|
@@ -1289,40 +1289,40 @@ function wn({
|
|
|
1289
1289
|
} = S.current, v = ae(g, u);
|
|
1290
1290
|
v >= 0 && (g.splice(v, 1), delete D.current[u.id], S.current.panelDataArrayChanged = !0, R());
|
|
1291
1291
|
}, [R]), ie = kn(() => ({
|
|
1292
|
-
collapsePanel:
|
|
1292
|
+
collapsePanel: j,
|
|
1293
1293
|
direction: r,
|
|
1294
|
-
dragState:
|
|
1294
|
+
dragState: h,
|
|
1295
1295
|
expandPanel: J,
|
|
1296
1296
|
getPanelSize: V,
|
|
1297
1297
|
getPanelStyle: _,
|
|
1298
1298
|
groupId: c,
|
|
1299
1299
|
isPanelCollapsed: k,
|
|
1300
1300
|
isPanelExpanded: ee,
|
|
1301
|
-
reevaluatePanelConstraints:
|
|
1301
|
+
reevaluatePanelConstraints: pe,
|
|
1302
1302
|
registerPanel: $,
|
|
1303
1303
|
registerResizeHandle: N,
|
|
1304
1304
|
resizePanel: G,
|
|
1305
|
-
startDragging:
|
|
1306
|
-
stopDragging:
|
|
1305
|
+
startDragging: ge,
|
|
1306
|
+
stopDragging: me,
|
|
1307
1307
|
unregisterPanel: He,
|
|
1308
1308
|
panelGroupElement: x.current
|
|
1309
|
-
}), [
|
|
1309
|
+
}), [j, h, r, J, V, _, c, k, ee, pe, $, N, G, ge, me, He]), he = {
|
|
1310
1310
|
display: "flex",
|
|
1311
1311
|
flexDirection: r === "horizontal" ? "row" : "column",
|
|
1312
1312
|
height: "100%",
|
|
1313
1313
|
overflow: "hidden",
|
|
1314
1314
|
width: "100%"
|
|
1315
1315
|
};
|
|
1316
|
-
return
|
|
1316
|
+
return fe(Re.Provider, {
|
|
1317
1317
|
value: ie
|
|
1318
|
-
},
|
|
1318
|
+
}, fe(w, {
|
|
1319
1319
|
...f,
|
|
1320
1320
|
children: n,
|
|
1321
1321
|
className: t,
|
|
1322
1322
|
id: o,
|
|
1323
1323
|
ref: x,
|
|
1324
1324
|
style: {
|
|
1325
|
-
...
|
|
1325
|
+
...he,
|
|
1326
1326
|
...m
|
|
1327
1327
|
},
|
|
1328
1328
|
// CSS selectors
|
|
@@ -1331,11 +1331,11 @@ function wn({
|
|
|
1331
1331
|
[A.groupId]: c
|
|
1332
1332
|
}));
|
|
1333
1333
|
}
|
|
1334
|
-
const In =
|
|
1334
|
+
const In = tn((e, n) => fe(Pn, {
|
|
1335
1335
|
...e,
|
|
1336
1336
|
forwardedRef: n
|
|
1337
1337
|
}));
|
|
1338
|
-
|
|
1338
|
+
Pn.displayName = "PanelGroup";
|
|
1339
1339
|
In.displayName = "forwardRef(PanelGroup)";
|
|
1340
1340
|
function ae(e, n) {
|
|
1341
1341
|
return e.findIndex((t) => t === n || t.id === n.id);
|
|
@@ -1376,10 +1376,10 @@ function st({
|
|
|
1376
1376
|
l.preventDefault();
|
|
1377
1377
|
const a = i.getAttribute(A.groupId);
|
|
1378
1378
|
z(a, `No group element found for id "${a}"`);
|
|
1379
|
-
const s =
|
|
1379
|
+
const s = Se(a, r), m = yn(a, n, r);
|
|
1380
1380
|
z(m !== null, `No resize element found for id "${n}"`);
|
|
1381
|
-
const
|
|
1382
|
-
s[
|
|
1381
|
+
const w = l.shiftKey ? m > 0 ? m - 1 : s.length - 1 : m + 1 < s.length ? m + 1 : 0;
|
|
1382
|
+
s[w].focus();
|
|
1383
1383
|
break;
|
|
1384
1384
|
}
|
|
1385
1385
|
}
|
|
@@ -1400,23 +1400,23 @@ function Ke({
|
|
|
1400
1400
|
onDragging: a,
|
|
1401
1401
|
onFocus: s,
|
|
1402
1402
|
onPointerDown: m,
|
|
1403
|
-
onPointerUp:
|
|
1403
|
+
onPointerUp: w,
|
|
1404
1404
|
style: f = {},
|
|
1405
1405
|
tabIndex: c = 0,
|
|
1406
1406
|
tagName: x = "div",
|
|
1407
|
-
...
|
|
1407
|
+
...h
|
|
1408
1408
|
}) {
|
|
1409
|
-
var I,
|
|
1409
|
+
var I, P;
|
|
1410
1410
|
const b = F(null), R = F({
|
|
1411
1411
|
onClick: l,
|
|
1412
1412
|
onDragging: a,
|
|
1413
1413
|
onPointerDown: m,
|
|
1414
|
-
onPointerUp:
|
|
1414
|
+
onPointerUp: w
|
|
1415
1415
|
});
|
|
1416
1416
|
te(() => {
|
|
1417
|
-
R.current.onClick = l, R.current.onDragging = a, R.current.onPointerDown = m, R.current.onPointerUp =
|
|
1417
|
+
R.current.onClick = l, R.current.onDragging = a, R.current.onPointerDown = m, R.current.onPointerUp = w;
|
|
1418
1418
|
});
|
|
1419
|
-
const D =
|
|
1419
|
+
const D = rn(Re);
|
|
1420
1420
|
if (D === null)
|
|
1421
1421
|
throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");
|
|
1422
1422
|
const {
|
|
@@ -1424,13 +1424,13 @@ function Ke({
|
|
|
1424
1424
|
groupId: O,
|
|
1425
1425
|
registerResizeHandle: C,
|
|
1426
1426
|
startDragging: S,
|
|
1427
|
-
stopDragging:
|
|
1427
|
+
stopDragging: j,
|
|
1428
1428
|
panelGroupElement: J
|
|
1429
|
-
} = D, V =
|
|
1429
|
+
} = D, V = We(i), [_, k] = ue("inactive"), [ee, $] = ue(!1), [N, G] = ue(null), pe = F({
|
|
1430
1430
|
state: _
|
|
1431
1431
|
});
|
|
1432
1432
|
re(() => {
|
|
1433
|
-
|
|
1433
|
+
pe.current.state = _;
|
|
1434
1434
|
}), te(() => {
|
|
1435
1435
|
if (t)
|
|
1436
1436
|
G(null);
|
|
@@ -1439,16 +1439,16 @@ function Ke({
|
|
|
1439
1439
|
G(() => ie);
|
|
1440
1440
|
}
|
|
1441
1441
|
}, [t, V, C]);
|
|
1442
|
-
const
|
|
1442
|
+
const ge = (I = r?.coarse) !== null && I !== void 0 ? I : 15, me = (P = r?.fine) !== null && P !== void 0 ? P : 5;
|
|
1443
1443
|
return te(() => {
|
|
1444
1444
|
if (t || N == null)
|
|
1445
1445
|
return;
|
|
1446
1446
|
const ie = b.current;
|
|
1447
1447
|
z(ie, "Element ref not attached");
|
|
1448
|
-
let
|
|
1449
|
-
return
|
|
1450
|
-
coarse:
|
|
1451
|
-
fine:
|
|
1448
|
+
let he = !1;
|
|
1449
|
+
return Un(V, ie, M, {
|
|
1450
|
+
coarse: ge,
|
|
1451
|
+
fine: me
|
|
1452
1452
|
}, (g, v, p) => {
|
|
1453
1453
|
if (!v) {
|
|
1454
1454
|
k("inactive");
|
|
@@ -1456,40 +1456,40 @@ function Ke({
|
|
|
1456
1456
|
}
|
|
1457
1457
|
switch (g) {
|
|
1458
1458
|
case "down": {
|
|
1459
|
-
k("drag"),
|
|
1459
|
+
k("drag"), he = !1, z(p, 'Expected event to be defined for "down" action'), S(V, p);
|
|
1460
1460
|
const {
|
|
1461
1461
|
onDragging: d,
|
|
1462
|
-
onPointerDown:
|
|
1462
|
+
onPointerDown: y
|
|
1463
1463
|
} = R.current;
|
|
1464
|
-
d?.(!0),
|
|
1464
|
+
d?.(!0), y?.();
|
|
1465
1465
|
break;
|
|
1466
1466
|
}
|
|
1467
1467
|
case "move": {
|
|
1468
1468
|
const {
|
|
1469
1469
|
state: d
|
|
1470
|
-
} =
|
|
1471
|
-
|
|
1470
|
+
} = pe.current;
|
|
1471
|
+
he = !0, d !== "drag" && k("hover"), z(p, 'Expected event to be defined for "move" action'), N(p);
|
|
1472
1472
|
break;
|
|
1473
1473
|
}
|
|
1474
1474
|
case "up": {
|
|
1475
|
-
k("hover"),
|
|
1475
|
+
k("hover"), j();
|
|
1476
1476
|
const {
|
|
1477
1477
|
onClick: d,
|
|
1478
|
-
onDragging:
|
|
1478
|
+
onDragging: y,
|
|
1479
1479
|
onPointerUp: E
|
|
1480
1480
|
} = R.current;
|
|
1481
|
-
|
|
1481
|
+
y?.(!1), E?.(), he || d?.();
|
|
1482
1482
|
break;
|
|
1483
1483
|
}
|
|
1484
1484
|
}
|
|
1485
1485
|
});
|
|
1486
|
-
}, [
|
|
1486
|
+
}, [ge, M, t, me, C, V, N, S, j]), st({
|
|
1487
1487
|
disabled: t,
|
|
1488
1488
|
handleId: V,
|
|
1489
1489
|
resizeHandler: N,
|
|
1490
1490
|
panelGroupElement: J
|
|
1491
|
-
}),
|
|
1492
|
-
...
|
|
1491
|
+
}), fe(x, {
|
|
1492
|
+
...h,
|
|
1493
1493
|
children: e,
|
|
1494
1494
|
className: n,
|
|
1495
1495
|
id: i,
|
|
@@ -1520,12 +1520,12 @@ function Ke({
|
|
|
1520
1520
|
});
|
|
1521
1521
|
}
|
|
1522
1522
|
Ke.displayName = "PanelResizeHandle";
|
|
1523
|
-
const ct =
|
|
1523
|
+
const ct = Fe({
|
|
1524
1524
|
base: "flex h-full w-full data-[panel-group-direction=vertical]:flex-col"
|
|
1525
1525
|
}), yt = ({
|
|
1526
1526
|
className: e,
|
|
1527
1527
|
...n
|
|
1528
|
-
}) => /* @__PURE__ */
|
|
1528
|
+
}) => /* @__PURE__ */ ce(In, { className: ct({ className: e }), ...n }), zt = an, xt = Ke, ut = Fe({
|
|
1529
1529
|
slots: {
|
|
1530
1530
|
wrapper: [
|
|
1531
1531
|
"relative flex w-px items-center justify-center bg-secondary-border hover:bg-primary-border",
|
|
@@ -1536,18 +1536,41 @@ const ct = on({
|
|
|
1536
1536
|
handle: "z-10 flex h-4 w-2.5 items-center justify-center rounded-sm border border-secondary-border bg-secondary-border hover:border-primary-border hover:bg-primary-border",
|
|
1537
1537
|
icon: "h-2.5 w-2.5"
|
|
1538
1538
|
}
|
|
1539
|
-
}),
|
|
1539
|
+
}), vt = ({
|
|
1540
1540
|
withHandle: e,
|
|
1541
1541
|
className: n,
|
|
1542
1542
|
...t
|
|
1543
1543
|
}) => {
|
|
1544
1544
|
const r = ut();
|
|
1545
|
-
return /* @__PURE__ */
|
|
1546
|
-
}
|
|
1545
|
+
return /* @__PURE__ */ ce(Ke, { className: r.wrapper({ className: n }), ...t, children: e && /* @__PURE__ */ ce("div", { className: r.handle(), children: /* @__PURE__ */ ce(Dn, { icon: Mn, className: r.icon() }) }) });
|
|
1546
|
+
}, dt = Fe({
|
|
1547
|
+
base: "pointer-events-none text-muted"
|
|
1548
|
+
}), bt = ({ className: e }) => /* @__PURE__ */ ce(
|
|
1549
|
+
"svg",
|
|
1550
|
+
{
|
|
1551
|
+
className: dt({ className: e }),
|
|
1552
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1553
|
+
width: "12",
|
|
1554
|
+
height: "11",
|
|
1555
|
+
viewBox: "0 0 12 11",
|
|
1556
|
+
fill: "none",
|
|
1557
|
+
children: /* @__PURE__ */ ce(
|
|
1558
|
+
"path",
|
|
1559
|
+
{
|
|
1560
|
+
d: "M10.4517 0.738281C9.64307 2.85547 8.59048 4.66724 6.65088 6.54297C5.08973 8.05271 2.94628 9.35933 0.73877 10.009",
|
|
1561
|
+
stroke: "currentColor",
|
|
1562
|
+
strokeWidth: "1",
|
|
1563
|
+
strokeLinecap: "round",
|
|
1564
|
+
strokeLinejoin: "round"
|
|
1565
|
+
}
|
|
1566
|
+
)
|
|
1567
|
+
}
|
|
1568
|
+
);
|
|
1547
1569
|
export {
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1570
|
+
bt as ResizableCornerIcon,
|
|
1571
|
+
vt as ResizableHandle,
|
|
1572
|
+
xt as ResizableHandlePrimitive,
|
|
1573
|
+
zt as ResizablePanel,
|
|
1551
1574
|
yt as ResizablePanelGroup
|
|
1552
1575
|
};
|
|
1553
1576
|
//# sourceMappingURL=resizable.js.map
|