@arcadeai/design-system 0.7.4 → 0.7.5
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/components/index.js +109 -108
- package/dist/components/ui/atoms/accordion.js +1 -1
- package/dist/components/ui/atoms/avatar.js +200 -82
- package/dist/components/ui/atoms/breadcrumb.js +25 -37
- package/dist/components/ui/atoms/chart.js +115 -10398
- package/dist/components/ui/atoms/command.js +158 -168
- package/dist/components/ui/atoms/dialog.js +30 -29
- package/dist/components/ui/atoms/dropdown-menu.js +153 -162
- package/dist/components/ui/atoms/form.js +57 -250
- package/dist/components/ui/atoms/hover-card.js +1 -1
- package/dist/components/ui/atoms/index.js +109 -108
- package/dist/components/ui/atoms/popover.js +1 -1
- package/dist/components/ui/atoms/resizable.js +359 -372
- package/dist/components/ui/atoms/select.js +101 -110
- package/dist/components/ui/atoms/sheet.js +24 -23
- package/dist/components/ui/atoms/sidebar.js +80 -89
- package/dist/components/ui/atoms/tooltip.js +1 -1
- package/dist/components/ui/index.js +109 -108
- package/dist/{index-f0YS5Ufh.js → index-PlrlSrPo.js} +266 -259
- package/dist/{index-DLfXSskr.js → index-toVHZ337.js} +49 -61
- package/dist/main.js +109 -108
- package/package.json +1 -1
- package/dist/check-B5h1DvDs.js +0 -11
- package/dist/chevron-down-DmZMdOiC.js +0 -11
- package/dist/chevron-right-BYYHEJjK.js +0 -11
- package/dist/createLucideIcon-XRdN60yz.js +0 -94
- package/dist/index-CJFGOBPb.js +0 -122
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
import { jsx as ve } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import { GripVerticalIcon as Rn } from "lucide-react";
|
|
3
|
+
import * as Ln from "react";
|
|
4
|
+
import { createContext as An, forwardRef as en, createElement as de, useContext as nn, useRef as F, useLayoutEffect as Mn, useImperativeHandle as tn, useState as ue, useEffect as te, useCallback as B, useMemo as Dn } from "react";
|
|
4
5
|
import { c as rn } from "../../../utils-CRiPKpXj.js";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @license lucide-react v0.525.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/
|
|
12
|
-
const Nn = [
|
|
13
|
-
["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
|
|
14
|
-
["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
|
|
15
|
-
["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
|
|
16
|
-
["circle", { cx: "15", cy: "12", r: "1", key: "1tmaij" }],
|
|
17
|
-
["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
|
|
18
|
-
["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }]
|
|
19
|
-
], Dn = Mn("grip-vertical", Nn), Re = Ln(null);
|
|
6
|
+
const Re = An(null);
|
|
20
7
|
Re.displayName = "PanelGroupContext";
|
|
21
8
|
const A = {
|
|
22
9
|
group: "data-panel-group",
|
|
@@ -31,11 +18,11 @@ const A = {
|
|
|
31
18
|
resizeHandleEnabled: "data-panel-resize-handle-enabled",
|
|
32
19
|
resizeHandleId: "data-panel-resize-handle-id",
|
|
33
20
|
resizeHandleState: "data-resize-handle-state"
|
|
34
|
-
}, Be = 10, re =
|
|
35
|
-
let
|
|
21
|
+
}, Be = 10, re = Mn, Oe = Ln.useId, Hn = typeof Oe == "function" ? Oe : () => null;
|
|
22
|
+
let Nn = 0;
|
|
36
23
|
function Fe(e = null) {
|
|
37
24
|
const n = Hn(), t = F(e || n || null);
|
|
38
|
-
return t.current === null && (t.current = "" +
|
|
25
|
+
return t.current === null && (t.current = "" + Nn++), e ?? t.current;
|
|
39
26
|
}
|
|
40
27
|
function on({
|
|
41
28
|
children: e,
|
|
@@ -50,9 +37,9 @@ function on({
|
|
|
50
37
|
onCollapse: m,
|
|
51
38
|
onExpand: P,
|
|
52
39
|
onResize: f,
|
|
53
|
-
order:
|
|
40
|
+
order: u,
|
|
54
41
|
style: x,
|
|
55
|
-
tagName:
|
|
42
|
+
tagName: h = "div",
|
|
56
43
|
...I
|
|
57
44
|
}) {
|
|
58
45
|
const w = nn(Re);
|
|
@@ -61,15 +48,15 @@ function on({
|
|
|
61
48
|
const {
|
|
62
49
|
collapsePanel: S,
|
|
63
50
|
expandPanel: R,
|
|
64
|
-
getPanelSize:
|
|
65
|
-
getPanelStyle:
|
|
66
|
-
groupId:
|
|
51
|
+
getPanelSize: D,
|
|
52
|
+
getPanelStyle: N,
|
|
53
|
+
groupId: q,
|
|
67
54
|
isPanelCollapsed: C,
|
|
68
55
|
reevaluatePanelConstraints: b,
|
|
69
56
|
registerPanel: K,
|
|
70
57
|
resizePanel: J,
|
|
71
58
|
unregisterPanel: V
|
|
72
|
-
} = w, _ = Fe(l),
|
|
59
|
+
} = w, _ = Fe(l), M = F({
|
|
73
60
|
callbacks: {
|
|
74
61
|
onCollapse: m,
|
|
75
62
|
onExpand: P,
|
|
@@ -84,48 +71,48 @@ function on({
|
|
|
84
71
|
},
|
|
85
72
|
id: _,
|
|
86
73
|
idIsFromProps: l !== void 0,
|
|
87
|
-
order:
|
|
74
|
+
order: u
|
|
88
75
|
});
|
|
89
76
|
F({
|
|
90
77
|
didLogMissingDefaultSizeWarning: !1
|
|
91
78
|
}), re(() => {
|
|
92
79
|
const {
|
|
93
|
-
callbacks:
|
|
94
|
-
constraints:
|
|
95
|
-
} =
|
|
96
|
-
|
|
80
|
+
callbacks: k,
|
|
81
|
+
constraints: $
|
|
82
|
+
} = M.current, G = {
|
|
83
|
+
...$
|
|
97
84
|
};
|
|
98
|
-
|
|
85
|
+
M.current.id = _, M.current.idIsFromProps = l !== void 0, M.current.order = u, k.onCollapse = m, k.onExpand = P, k.onResize = f, $.collapsedSize = t, $.collapsible = r, $.defaultSize = i, $.maxSize = a, $.minSize = s, (G.collapsedSize !== $.collapsedSize || G.collapsible !== $.collapsible || G.maxSize !== $.maxSize || G.minSize !== $.minSize) && b(M.current, G);
|
|
99
86
|
}), re(() => {
|
|
100
|
-
const
|
|
101
|
-
return K(
|
|
102
|
-
V(
|
|
87
|
+
const k = M.current;
|
|
88
|
+
return K(k), () => {
|
|
89
|
+
V(k);
|
|
103
90
|
};
|
|
104
|
-
}, [
|
|
91
|
+
}, [u, _, K, V]), tn(o, () => ({
|
|
105
92
|
collapse: () => {
|
|
106
|
-
S(
|
|
93
|
+
S(M.current);
|
|
107
94
|
},
|
|
108
|
-
expand: (
|
|
109
|
-
R(
|
|
95
|
+
expand: (k) => {
|
|
96
|
+
R(M.current, k);
|
|
110
97
|
},
|
|
111
98
|
getId() {
|
|
112
99
|
return _;
|
|
113
100
|
},
|
|
114
101
|
getSize() {
|
|
115
|
-
return M
|
|
102
|
+
return D(M.current);
|
|
116
103
|
},
|
|
117
104
|
isCollapsed() {
|
|
118
|
-
return C(
|
|
105
|
+
return C(M.current);
|
|
119
106
|
},
|
|
120
107
|
isExpanded() {
|
|
121
|
-
return !C(
|
|
108
|
+
return !C(M.current);
|
|
122
109
|
},
|
|
123
|
-
resize: (
|
|
124
|
-
J(
|
|
110
|
+
resize: (k) => {
|
|
111
|
+
J(M.current, k);
|
|
125
112
|
}
|
|
126
|
-
}), [S, R,
|
|
127
|
-
const ee =
|
|
128
|
-
return de(
|
|
113
|
+
}), [S, R, D, C, _, J]);
|
|
114
|
+
const ee = N(M.current, i);
|
|
115
|
+
return de(h, {
|
|
129
116
|
...I,
|
|
130
117
|
children: e,
|
|
131
118
|
className: n,
|
|
@@ -135,7 +122,7 @@ function on({
|
|
|
135
122
|
...x
|
|
136
123
|
},
|
|
137
124
|
// CSS selectors
|
|
138
|
-
[A.groupId]:
|
|
125
|
+
[A.groupId]: q,
|
|
139
126
|
[A.panel]: "",
|
|
140
127
|
[A.panelCollapsible]: r || void 0,
|
|
141
128
|
[A.panelId]: _,
|
|
@@ -149,7 +136,7 @@ const ln = en((e, n) => de(on, {
|
|
|
149
136
|
on.displayName = "Panel";
|
|
150
137
|
ln.displayName = "forwardRef(Panel)";
|
|
151
138
|
let Te = null, Ie = -1, Z = null;
|
|
152
|
-
function
|
|
139
|
+
function $n(e, n) {
|
|
153
140
|
if (n) {
|
|
154
141
|
const t = (n & dn) !== 0, r = (n & fn) !== 0, i = (n & pn) !== 0, o = (n & gn) !== 0;
|
|
155
142
|
if (t)
|
|
@@ -170,12 +157,12 @@ function _n(e, n) {
|
|
|
170
157
|
return "ns-resize";
|
|
171
158
|
}
|
|
172
159
|
}
|
|
173
|
-
function
|
|
160
|
+
function kn() {
|
|
174
161
|
Z !== null && (document.head.removeChild(Z), Te = null, Z = null, Ie = -1);
|
|
175
162
|
}
|
|
176
|
-
function
|
|
163
|
+
function Ne(e, n) {
|
|
177
164
|
var t, r;
|
|
178
|
-
const i =
|
|
165
|
+
const i = $n(e, n);
|
|
179
166
|
if (Te !== i) {
|
|
180
167
|
if (Te = i, Z === null && (Z = document.createElement("style"), document.head.appendChild(Z)), Ie >= 0) {
|
|
181
168
|
var o;
|
|
@@ -190,7 +177,7 @@ function an(e) {
|
|
|
190
177
|
function sn(e) {
|
|
191
178
|
return e.type.startsWith("pointer");
|
|
192
179
|
}
|
|
193
|
-
function
|
|
180
|
+
function un(e) {
|
|
194
181
|
return e.type.startsWith("mouse");
|
|
195
182
|
}
|
|
196
183
|
function Le(e) {
|
|
@@ -200,7 +187,7 @@ function Le(e) {
|
|
|
200
187
|
x: e.clientX,
|
|
201
188
|
y: e.clientY
|
|
202
189
|
};
|
|
203
|
-
} else if (
|
|
190
|
+
} else if (un(e))
|
|
204
191
|
return {
|
|
205
192
|
x: e.clientX,
|
|
206
193
|
y: e.clientY
|
|
@@ -210,26 +197,26 @@ function Le(e) {
|
|
|
210
197
|
y: 1 / 0
|
|
211
198
|
};
|
|
212
199
|
}
|
|
213
|
-
function
|
|
200
|
+
function _n() {
|
|
214
201
|
if (typeof matchMedia == "function")
|
|
215
202
|
return matchMedia("(pointer:coarse)").matches ? "coarse" : "fine";
|
|
216
203
|
}
|
|
217
|
-
function
|
|
204
|
+
function Gn(e, n, t) {
|
|
218
205
|
return e.x < n.x + n.width && e.x + e.width > n.x && e.y < n.y + n.height && e.y + e.height > n.y;
|
|
219
206
|
}
|
|
220
|
-
function
|
|
207
|
+
function Tn(e, n) {
|
|
221
208
|
if (e === n) throw new Error("Cannot compare node with itself");
|
|
222
209
|
const t = {
|
|
223
|
-
a:
|
|
224
|
-
b:
|
|
210
|
+
a: je(e),
|
|
211
|
+
b: je(n)
|
|
225
212
|
};
|
|
226
213
|
let r;
|
|
227
214
|
for (; t.a.at(-1) === t.b.at(-1); )
|
|
228
215
|
e = t.a.pop(), n = t.b.pop(), r = e;
|
|
229
|
-
|
|
216
|
+
y(r, "Stacking order can only be calculated for elements with a common ancestor");
|
|
230
217
|
const i = {
|
|
231
|
-
a: qe(
|
|
232
|
-
b: qe(
|
|
218
|
+
a: Xe(qe(t.a)),
|
|
219
|
+
b: Xe(qe(t.b))
|
|
233
220
|
};
|
|
234
221
|
if (i.a === i.b) {
|
|
235
222
|
const o = r.childNodes, l = {
|
|
@@ -245,43 +232,43 @@ function Fn(e, n) {
|
|
|
245
232
|
}
|
|
246
233
|
return Math.sign(i.a - i.b);
|
|
247
234
|
}
|
|
248
|
-
const
|
|
249
|
-
function
|
|
235
|
+
const Bn = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
236
|
+
function Fn(e) {
|
|
250
237
|
var n;
|
|
251
|
-
const t = getComputedStyle((n =
|
|
238
|
+
const t = getComputedStyle((n = cn(e)) !== null && n !== void 0 ? n : e).display;
|
|
252
239
|
return t === "flex" || t === "inline-flex";
|
|
253
240
|
}
|
|
254
|
-
function
|
|
241
|
+
function Vn(e) {
|
|
255
242
|
const n = getComputedStyle(e);
|
|
256
|
-
return !!(n.position === "fixed" || n.zIndex !== "auto" && (n.position !== "static" ||
|
|
243
|
+
return !!(n.position === "fixed" || n.zIndex !== "auto" && (n.position !== "static" || Fn(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" || Bn.test(n.willChange) || n.webkitOverflowScrolling === "touch");
|
|
257
244
|
}
|
|
258
|
-
function
|
|
245
|
+
function qe(e) {
|
|
259
246
|
let n = e.length;
|
|
260
247
|
for (; n--; ) {
|
|
261
248
|
const t = e[n];
|
|
262
|
-
if (
|
|
249
|
+
if (y(t, "Missing node"), Vn(t)) return t;
|
|
263
250
|
}
|
|
264
251
|
return null;
|
|
265
252
|
}
|
|
266
|
-
function
|
|
253
|
+
function Xe(e) {
|
|
267
254
|
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
268
255
|
}
|
|
269
|
-
function
|
|
256
|
+
function je(e) {
|
|
270
257
|
const n = [];
|
|
271
258
|
for (; e; )
|
|
272
|
-
n.push(e), e =
|
|
259
|
+
n.push(e), e = cn(e);
|
|
273
260
|
return n;
|
|
274
261
|
}
|
|
275
|
-
function
|
|
262
|
+
function cn(e) {
|
|
276
263
|
const {
|
|
277
264
|
parentNode: n
|
|
278
265
|
} = e;
|
|
279
266
|
return n && n instanceof ShadowRoot ? n.host : n;
|
|
280
267
|
}
|
|
281
|
-
const dn = 1, fn = 2, pn = 4, gn = 8,
|
|
282
|
-
let
|
|
268
|
+
const dn = 1, fn = 2, pn = 4, gn = 8, Wn = _n() === "coarse";
|
|
269
|
+
let O = [], ce = !1, Q = /* @__PURE__ */ new Map(), Ae = /* @__PURE__ */ new Map();
|
|
283
270
|
const Se = /* @__PURE__ */ new Set();
|
|
284
|
-
function
|
|
271
|
+
function Kn(e, n, t, r, i) {
|
|
285
272
|
var o;
|
|
286
273
|
const {
|
|
287
274
|
ownerDocument: l
|
|
@@ -295,31 +282,31 @@ function jn(e, n, t, r, i) {
|
|
|
295
282
|
var P;
|
|
296
283
|
Ae.delete(e), Se.delete(a);
|
|
297
284
|
const f = (P = Q.get(l)) !== null && P !== void 0 ? P : 1;
|
|
298
|
-
if (Q.set(l, f - 1), Ee(), f === 1 && Q.delete(l),
|
|
299
|
-
const
|
|
300
|
-
|
|
285
|
+
if (Q.set(l, f - 1), Ee(), f === 1 && Q.delete(l), O.includes(a)) {
|
|
286
|
+
const u = O.indexOf(a);
|
|
287
|
+
u >= 0 && O.splice(u, 1), We(), i("up", !0, null);
|
|
301
288
|
}
|
|
302
289
|
};
|
|
303
290
|
}
|
|
304
|
-
function
|
|
291
|
+
function Un(e) {
|
|
305
292
|
const {
|
|
306
293
|
target: n
|
|
307
294
|
} = e, {
|
|
308
295
|
x: t,
|
|
309
296
|
y: r
|
|
310
297
|
} = Le(e);
|
|
311
|
-
|
|
298
|
+
ce = !0, Ve({
|
|
312
299
|
target: n,
|
|
313
300
|
x: t,
|
|
314
301
|
y: r
|
|
315
|
-
}), Ee(),
|
|
302
|
+
}), Ee(), O.length > 0 && (Ce("down", e), e.preventDefault(), mn(n) || e.stopImmediatePropagation());
|
|
316
303
|
}
|
|
317
|
-
function
|
|
304
|
+
function $e(e) {
|
|
318
305
|
const {
|
|
319
306
|
x: n,
|
|
320
307
|
y: t
|
|
321
308
|
} = Le(e);
|
|
322
|
-
if (
|
|
309
|
+
if (ce && e.buttons === 0 && (ce = !1, Ce("up", e)), !ce) {
|
|
323
310
|
const {
|
|
324
311
|
target: r
|
|
325
312
|
} = e;
|
|
@@ -329,16 +316,16 @@ function He(e) {
|
|
|
329
316
|
y: t
|
|
330
317
|
});
|
|
331
318
|
}
|
|
332
|
-
Ce("move", e), We(),
|
|
319
|
+
Ce("move", e), We(), O.length > 0 && e.preventDefault();
|
|
333
320
|
}
|
|
334
|
-
function
|
|
321
|
+
function ke(e) {
|
|
335
322
|
const {
|
|
336
323
|
target: n
|
|
337
324
|
} = e, {
|
|
338
325
|
x: t,
|
|
339
326
|
y: r
|
|
340
327
|
} = Le(e);
|
|
341
|
-
Ae.clear(),
|
|
328
|
+
Ae.clear(), ce = !1, O.length > 0 && (e.preventDefault(), mn(n) || e.stopImmediatePropagation()), Ce("up", e), Ve({
|
|
342
329
|
target: n,
|
|
343
330
|
x: t,
|
|
344
331
|
y: r
|
|
@@ -358,7 +345,7 @@ function Ve({
|
|
|
358
345
|
x: n,
|
|
359
346
|
y: t
|
|
360
347
|
}) {
|
|
361
|
-
|
|
348
|
+
O.splice(0);
|
|
362
349
|
let r = null;
|
|
363
350
|
(e instanceof HTMLElement || e instanceof SVGElement) && (r = e), Se.forEach((i) => {
|
|
364
351
|
const {
|
|
@@ -369,24 +356,24 @@ function Ve({
|
|
|
369
356
|
left: m,
|
|
370
357
|
right: P,
|
|
371
358
|
top: f
|
|
372
|
-
} = a,
|
|
373
|
-
if (n >= m -
|
|
359
|
+
} = a, u = Wn ? l.coarse : l.fine;
|
|
360
|
+
if (n >= m - u && n <= P + u && t >= f - u && t <= s + u) {
|
|
374
361
|
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
|
|
375
362
|
// That is why we only check potentially intersecting handles,
|
|
376
363
|
// and why we skip if the event target is within the handle's DOM
|
|
377
|
-
|
|
378
|
-
let
|
|
379
|
-
for (;
|
|
380
|
-
if (
|
|
364
|
+
Tn(r, o) > 0) {
|
|
365
|
+
let h = r, I = !1;
|
|
366
|
+
for (; h && !h.contains(o); ) {
|
|
367
|
+
if (Gn(h.getBoundingClientRect(), a)) {
|
|
381
368
|
I = !0;
|
|
382
369
|
break;
|
|
383
370
|
}
|
|
384
|
-
|
|
371
|
+
h = h.parentElement;
|
|
385
372
|
}
|
|
386
373
|
if (I)
|
|
387
374
|
return;
|
|
388
375
|
}
|
|
389
|
-
|
|
376
|
+
O.push(i);
|
|
390
377
|
}
|
|
391
378
|
});
|
|
392
379
|
}
|
|
@@ -395,7 +382,7 @@ function _e(e, n) {
|
|
|
395
382
|
}
|
|
396
383
|
function We() {
|
|
397
384
|
let e = !1, n = !1;
|
|
398
|
-
|
|
385
|
+
O.forEach((r) => {
|
|
399
386
|
const {
|
|
400
387
|
direction: i
|
|
401
388
|
} = r;
|
|
@@ -404,7 +391,7 @@ function We() {
|
|
|
404
391
|
let t = 0;
|
|
405
392
|
Ae.forEach((r) => {
|
|
406
393
|
t |= r;
|
|
407
|
-
}), e && n ?
|
|
394
|
+
}), e && n ? Ne("intersection", t) : e ? Ne("horizontal", t) : n ? Ne("vertical", t) : kn();
|
|
408
395
|
}
|
|
409
396
|
let Ge;
|
|
410
397
|
function Ee() {
|
|
@@ -414,36 +401,36 @@ function Ee() {
|
|
|
414
401
|
capture: !0,
|
|
415
402
|
signal: Ge.signal
|
|
416
403
|
};
|
|
417
|
-
Se.size && (
|
|
404
|
+
Se.size && (ce ? (O.length > 0 && Q.forEach((t, r) => {
|
|
418
405
|
const {
|
|
419
406
|
body: i
|
|
420
407
|
} = r;
|
|
421
|
-
t > 0 && (i.addEventListener("contextmenu",
|
|
408
|
+
t > 0 && (i.addEventListener("contextmenu", ke, n), i.addEventListener("pointerleave", $e, n), i.addEventListener("pointermove", $e, n));
|
|
422
409
|
}), Q.forEach((t, r) => {
|
|
423
410
|
const {
|
|
424
411
|
body: i
|
|
425
412
|
} = r;
|
|
426
|
-
i.addEventListener("pointerup",
|
|
413
|
+
i.addEventListener("pointerup", ke, n), i.addEventListener("pointercancel", ke, n);
|
|
427
414
|
})) : Q.forEach((t, r) => {
|
|
428
415
|
const {
|
|
429
416
|
body: i
|
|
430
417
|
} = r;
|
|
431
|
-
t > 0 && (i.addEventListener("pointerdown",
|
|
418
|
+
t > 0 && (i.addEventListener("pointerdown", Un, n), i.addEventListener("pointermove", $e, n));
|
|
432
419
|
}));
|
|
433
420
|
}
|
|
434
421
|
function Ce(e, n) {
|
|
435
422
|
Se.forEach((t) => {
|
|
436
423
|
const {
|
|
437
424
|
setResizeHandlerState: r
|
|
438
|
-
} = t, i =
|
|
425
|
+
} = t, i = O.includes(t);
|
|
439
426
|
r(e, i, n);
|
|
440
427
|
});
|
|
441
428
|
}
|
|
442
|
-
function
|
|
443
|
-
const [e, n] =
|
|
429
|
+
function On() {
|
|
430
|
+
const [e, n] = ue(0);
|
|
444
431
|
return B(() => n((t) => t + 1), []);
|
|
445
432
|
}
|
|
446
|
-
function
|
|
433
|
+
function y(e, n) {
|
|
447
434
|
if (!e)
|
|
448
435
|
throw console.error(n), Error(n);
|
|
449
436
|
}
|
|
@@ -456,7 +443,7 @@ function Y(e, n, t = Be) {
|
|
|
456
443
|
function W(e, n, t) {
|
|
457
444
|
return oe(e, n, t) === 0;
|
|
458
445
|
}
|
|
459
|
-
function
|
|
446
|
+
function qn(e, n, t) {
|
|
460
447
|
if (e.length !== n.length)
|
|
461
448
|
return !1;
|
|
462
449
|
for (let r = 0; r < e.length; r++) {
|
|
@@ -472,7 +459,7 @@ function se({
|
|
|
472
459
|
size: t
|
|
473
460
|
}) {
|
|
474
461
|
const r = e[n];
|
|
475
|
-
|
|
462
|
+
y(r != null, `Panel constraints not found for index ${n}`);
|
|
476
463
|
let {
|
|
477
464
|
collapsedSize: i = 0,
|
|
478
465
|
collapsible: o,
|
|
@@ -487,7 +474,7 @@ function se({
|
|
|
487
474
|
t = a;
|
|
488
475
|
return t = Math.min(l, t), t = parseFloat(t.toFixed(Be)), t;
|
|
489
476
|
}
|
|
490
|
-
function
|
|
477
|
+
function ye({
|
|
491
478
|
delta: e,
|
|
492
479
|
initialLayout: n,
|
|
493
480
|
panelConstraints: t,
|
|
@@ -498,36 +485,36 @@ function ze({
|
|
|
498
485
|
if (W(e, 0))
|
|
499
486
|
return n;
|
|
500
487
|
const l = [...n], [a, s] = r;
|
|
501
|
-
|
|
488
|
+
y(a != null, "Invalid first pivot index"), y(s != null, "Invalid second pivot index");
|
|
502
489
|
let m = 0;
|
|
503
490
|
if (o === "keyboard") {
|
|
504
491
|
{
|
|
505
|
-
const f = e < 0 ? s : a,
|
|
506
|
-
|
|
492
|
+
const f = e < 0 ? s : a, u = t[f];
|
|
493
|
+
y(u, `Panel constraints not found for index ${f}`);
|
|
507
494
|
const {
|
|
508
495
|
collapsedSize: x = 0,
|
|
509
|
-
collapsible:
|
|
496
|
+
collapsible: h,
|
|
510
497
|
minSize: I = 0
|
|
511
|
-
} =
|
|
512
|
-
if (
|
|
498
|
+
} = u;
|
|
499
|
+
if (h) {
|
|
513
500
|
const w = n[f];
|
|
514
|
-
if (
|
|
501
|
+
if (y(w != null, `Previous layout not found for panel index ${f}`), W(w, x)) {
|
|
515
502
|
const S = I - w;
|
|
516
503
|
oe(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
517
504
|
}
|
|
518
505
|
}
|
|
519
506
|
}
|
|
520
507
|
{
|
|
521
|
-
const f = e < 0 ? a : s,
|
|
522
|
-
|
|
508
|
+
const f = e < 0 ? a : s, u = t[f];
|
|
509
|
+
y(u, `No panel constraints found for index ${f}`);
|
|
523
510
|
const {
|
|
524
511
|
collapsedSize: x = 0,
|
|
525
|
-
collapsible:
|
|
512
|
+
collapsible: h,
|
|
526
513
|
minSize: I = 0
|
|
527
|
-
} =
|
|
528
|
-
if (
|
|
514
|
+
} = u;
|
|
515
|
+
if (h) {
|
|
529
516
|
const w = n[f];
|
|
530
|
-
if (
|
|
517
|
+
if (y(w != null, `Previous layout not found for panel index ${f}`), W(w, I)) {
|
|
531
518
|
const S = w - x;
|
|
532
519
|
oe(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
533
520
|
}
|
|
@@ -536,82 +523,82 @@ function ze({
|
|
|
536
523
|
}
|
|
537
524
|
{
|
|
538
525
|
const f = e < 0 ? 1 : -1;
|
|
539
|
-
let
|
|
526
|
+
let u = e < 0 ? s : a, x = 0;
|
|
540
527
|
for (; ; ) {
|
|
541
|
-
const I = n[
|
|
542
|
-
|
|
528
|
+
const I = n[u];
|
|
529
|
+
y(I != null, `Previous layout not found for panel index ${u}`);
|
|
543
530
|
const S = se({
|
|
544
531
|
panelConstraints: t,
|
|
545
|
-
panelIndex:
|
|
532
|
+
panelIndex: u,
|
|
546
533
|
size: 100
|
|
547
534
|
}) - I;
|
|
548
|
-
if (x += S,
|
|
535
|
+
if (x += S, u += f, u < 0 || u >= t.length)
|
|
549
536
|
break;
|
|
550
537
|
}
|
|
551
|
-
const
|
|
552
|
-
e = e < 0 ? 0 -
|
|
538
|
+
const h = Math.min(Math.abs(e), Math.abs(x));
|
|
539
|
+
e = e < 0 ? 0 - h : h;
|
|
553
540
|
}
|
|
554
541
|
{
|
|
555
|
-
let
|
|
556
|
-
for (;
|
|
557
|
-
const x = Math.abs(e) - Math.abs(m),
|
|
558
|
-
|
|
559
|
-
const I =
|
|
542
|
+
let u = e < 0 ? a : s;
|
|
543
|
+
for (; u >= 0 && u < t.length; ) {
|
|
544
|
+
const x = Math.abs(e) - Math.abs(m), h = n[u];
|
|
545
|
+
y(h != null, `Previous layout not found for panel index ${u}`);
|
|
546
|
+
const I = h - x, w = se({
|
|
560
547
|
panelConstraints: t,
|
|
561
|
-
panelIndex:
|
|
548
|
+
panelIndex: u,
|
|
562
549
|
size: I
|
|
563
550
|
});
|
|
564
|
-
if (!W(
|
|
551
|
+
if (!W(h, w) && (m += h - w, l[u] = w, m.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3), void 0, {
|
|
565
552
|
numeric: !0
|
|
566
553
|
}) >= 0))
|
|
567
554
|
break;
|
|
568
|
-
e < 0 ?
|
|
555
|
+
e < 0 ? u-- : u++;
|
|
569
556
|
}
|
|
570
557
|
}
|
|
571
|
-
if (
|
|
558
|
+
if (qn(i, l))
|
|
572
559
|
return i;
|
|
573
560
|
{
|
|
574
|
-
const f = e < 0 ? s : a,
|
|
575
|
-
|
|
576
|
-
const x =
|
|
561
|
+
const f = e < 0 ? s : a, u = n[f];
|
|
562
|
+
y(u != null, `Previous layout not found for panel index ${f}`);
|
|
563
|
+
const x = u + m, h = se({
|
|
577
564
|
panelConstraints: t,
|
|
578
565
|
panelIndex: f,
|
|
579
566
|
size: x
|
|
580
567
|
});
|
|
581
|
-
if (l[f] =
|
|
582
|
-
let I = x -
|
|
568
|
+
if (l[f] = h, !W(h, x)) {
|
|
569
|
+
let I = x - h, S = e < 0 ? s : a;
|
|
583
570
|
for (; S >= 0 && S < t.length; ) {
|
|
584
571
|
const R = l[S];
|
|
585
|
-
|
|
586
|
-
const
|
|
572
|
+
y(R != null, `Previous layout not found for panel index ${S}`);
|
|
573
|
+
const D = R + I, N = se({
|
|
587
574
|
panelConstraints: t,
|
|
588
575
|
panelIndex: S,
|
|
589
|
-
size:
|
|
576
|
+
size: D
|
|
590
577
|
});
|
|
591
|
-
if (W(R,
|
|
578
|
+
if (W(R, N) || (I -= N - R, l[S] = N), W(I, 0))
|
|
592
579
|
break;
|
|
593
580
|
e > 0 ? S-- : S++;
|
|
594
581
|
}
|
|
595
582
|
}
|
|
596
583
|
}
|
|
597
|
-
const P = l.reduce((f,
|
|
584
|
+
const P = l.reduce((f, u) => u + f, 0);
|
|
598
585
|
return W(P, 100) ? l : i;
|
|
599
586
|
}
|
|
600
|
-
function
|
|
587
|
+
function Xn({
|
|
601
588
|
layout: e,
|
|
602
589
|
panelsArray: n,
|
|
603
590
|
pivotIndices: t
|
|
604
591
|
}) {
|
|
605
592
|
let r = 0, i = 100, o = 0, l = 0;
|
|
606
593
|
const a = t[0];
|
|
607
|
-
|
|
594
|
+
y(a != null, "No pivot index found"), n.forEach((f, u) => {
|
|
608
595
|
const {
|
|
609
596
|
constraints: x
|
|
610
597
|
} = f, {
|
|
611
|
-
maxSize:
|
|
598
|
+
maxSize: h = 100,
|
|
612
599
|
minSize: I = 0
|
|
613
600
|
} = x;
|
|
614
|
-
|
|
601
|
+
u === a ? (r = I, i = h) : (o += I, l += h);
|
|
615
602
|
});
|
|
616
603
|
const s = Math.min(i, 100 - o), m = Math.max(r, 100 - l), P = e[a];
|
|
617
604
|
return {
|
|
@@ -623,33 +610,33 @@ function Jn({
|
|
|
623
610
|
function be(e, n = document) {
|
|
624
611
|
return Array.from(n.querySelectorAll(`[${A.resizeHandleId}][data-panel-group-id="${e}"]`));
|
|
625
612
|
}
|
|
626
|
-
function
|
|
613
|
+
function hn(e, n, t = document) {
|
|
627
614
|
const i = be(e, t).findIndex((o) => o.getAttribute(A.resizeHandleId) === n);
|
|
628
615
|
return i ?? null;
|
|
629
616
|
}
|
|
630
|
-
function
|
|
631
|
-
const r =
|
|
617
|
+
function zn(e, n, t) {
|
|
618
|
+
const r = hn(e, n, t);
|
|
632
619
|
return r != null ? [r, r + 1] : [-1, -1];
|
|
633
620
|
}
|
|
634
|
-
function
|
|
621
|
+
function jn(e) {
|
|
635
622
|
return e instanceof HTMLElement ? !0 : typeof e == "object" && e !== null && "tagName" in e && "getAttribute" in e;
|
|
636
623
|
}
|
|
637
|
-
function
|
|
638
|
-
if (
|
|
624
|
+
function yn(e, n = document) {
|
|
625
|
+
if (jn(n) && n.dataset.panelGroupId == e)
|
|
639
626
|
return n;
|
|
640
627
|
const t = n.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);
|
|
641
628
|
return t || null;
|
|
642
629
|
}
|
|
643
|
-
function
|
|
630
|
+
function Me(e, n = document) {
|
|
644
631
|
const t = n.querySelector(`[${A.resizeHandleId}="${e}"]`);
|
|
645
632
|
return t || null;
|
|
646
633
|
}
|
|
647
|
-
function
|
|
634
|
+
function Jn(e, n, t, r = document) {
|
|
648
635
|
var i, o, l, a;
|
|
649
|
-
const s =
|
|
650
|
-
return [f,
|
|
636
|
+
const s = Me(n, r), m = be(e, r), P = s ? m.indexOf(s) : -1, f = (i = (o = t[P]) === null || o === void 0 ? void 0 : o.id) !== null && i !== void 0 ? i : null, u = (l = (a = t[P + 1]) === null || a === void 0 ? void 0 : a.id) !== null && l !== void 0 ? l : null;
|
|
637
|
+
return [f, u];
|
|
651
638
|
}
|
|
652
|
-
function
|
|
639
|
+
function Yn({
|
|
653
640
|
committedValuesRef: e,
|
|
654
641
|
eagerValuesRef: n,
|
|
655
642
|
groupId: t,
|
|
@@ -669,14 +656,14 @@ function Qn({
|
|
|
669
656
|
valueMax: m,
|
|
670
657
|
valueMin: P,
|
|
671
658
|
valueNow: f
|
|
672
|
-
} =
|
|
659
|
+
} = Xn({
|
|
673
660
|
layout: r,
|
|
674
661
|
panelsArray: i,
|
|
675
662
|
pivotIndices: [s, s + 1]
|
|
676
|
-
}),
|
|
677
|
-
if (
|
|
663
|
+
}), u = a[s];
|
|
664
|
+
if (u != null) {
|
|
678
665
|
const x = i[s];
|
|
679
|
-
|
|
666
|
+
y(x, `No panel data found for index "${s}"`), u.setAttribute("aria-controls", x.id), u.setAttribute("aria-valuemax", "" + Math.round(m)), u.setAttribute("aria-valuemin", "" + Math.round(P)), u.setAttribute("aria-valuenow", f != null ? "" + Math.round(f) : "");
|
|
680
667
|
}
|
|
681
668
|
}
|
|
682
669
|
return () => {
|
|
@@ -688,18 +675,18 @@ function Qn({
|
|
|
688
675
|
if (!o)
|
|
689
676
|
return;
|
|
690
677
|
const a = n.current;
|
|
691
|
-
|
|
678
|
+
y(a, "Eager values not found");
|
|
692
679
|
const {
|
|
693
680
|
panelDataArray: s
|
|
694
|
-
} = a, m =
|
|
695
|
-
|
|
681
|
+
} = a, m = yn(t, o);
|
|
682
|
+
y(m != null, `No group found for id "${t}"`);
|
|
696
683
|
const P = be(t, o);
|
|
697
|
-
|
|
698
|
-
const f = P.map((
|
|
699
|
-
const x =
|
|
700
|
-
|
|
701
|
-
const [
|
|
702
|
-
if (
|
|
684
|
+
y(P, `No resize handles found for group id "${t}"`);
|
|
685
|
+
const f = P.map((u) => {
|
|
686
|
+
const x = u.getAttribute(A.resizeHandleId);
|
|
687
|
+
y(x, "Resize handle element has no handle id attribute");
|
|
688
|
+
const [h, I] = Jn(t, x, s, o);
|
|
689
|
+
if (h == null || I == null)
|
|
703
690
|
return () => {
|
|
704
691
|
};
|
|
705
692
|
const w = (S) => {
|
|
@@ -707,21 +694,21 @@ function Qn({
|
|
|
707
694
|
switch (S.key) {
|
|
708
695
|
case "Enter": {
|
|
709
696
|
S.preventDefault();
|
|
710
|
-
const R = s.findIndex((
|
|
697
|
+
const R = s.findIndex((D) => D.id === h);
|
|
711
698
|
if (R >= 0) {
|
|
712
|
-
const
|
|
713
|
-
|
|
714
|
-
const
|
|
715
|
-
collapsedSize:
|
|
699
|
+
const D = s[R];
|
|
700
|
+
y(D, `No panel data found for index ${R}`);
|
|
701
|
+
const N = r[R], {
|
|
702
|
+
collapsedSize: q = 0,
|
|
716
703
|
collapsible: C,
|
|
717
704
|
minSize: b = 0
|
|
718
|
-
} =
|
|
719
|
-
if (
|
|
720
|
-
const K =
|
|
721
|
-
delta: W(
|
|
705
|
+
} = D.constraints;
|
|
706
|
+
if (N != null && C) {
|
|
707
|
+
const K = ye({
|
|
708
|
+
delta: W(N, q) ? b - q : q - N,
|
|
722
709
|
initialLayout: r,
|
|
723
710
|
panelConstraints: s.map((J) => J.constraints),
|
|
724
|
-
pivotIndices:
|
|
711
|
+
pivotIndices: zn(t, x, o),
|
|
725
712
|
prevLayout: r,
|
|
726
713
|
trigger: "keyboard"
|
|
727
714
|
});
|
|
@@ -732,12 +719,12 @@ function Qn({
|
|
|
732
719
|
}
|
|
733
720
|
}
|
|
734
721
|
};
|
|
735
|
-
return
|
|
736
|
-
|
|
722
|
+
return u.addEventListener("keydown", w), () => {
|
|
723
|
+
u.removeEventListener("keydown", w);
|
|
737
724
|
};
|
|
738
725
|
});
|
|
739
726
|
return () => {
|
|
740
|
-
f.forEach((
|
|
727
|
+
f.forEach((u) => u());
|
|
741
728
|
};
|
|
742
729
|
}, [o, e, n, t, r, i, l]);
|
|
743
730
|
}
|
|
@@ -756,20 +743,20 @@ function xn(e, n) {
|
|
|
756
743
|
} = Le(n);
|
|
757
744
|
return t ? r : i;
|
|
758
745
|
}
|
|
759
|
-
function
|
|
760
|
-
const o = t === "horizontal", l =
|
|
761
|
-
|
|
746
|
+
function Zn(e, n, t, r, i) {
|
|
747
|
+
const o = t === "horizontal", l = Me(n, i);
|
|
748
|
+
y(l, `No resize handle element found for id "${n}"`);
|
|
762
749
|
const a = l.getAttribute(A.groupId);
|
|
763
|
-
|
|
750
|
+
y(a, "Resize handle element has no group id attribute");
|
|
764
751
|
let {
|
|
765
752
|
initialCursorPosition: s
|
|
766
753
|
} = r;
|
|
767
|
-
const m = xn(t, e), P =
|
|
768
|
-
|
|
769
|
-
const f = P.getBoundingClientRect(),
|
|
770
|
-
return (m - s) /
|
|
754
|
+
const m = xn(t, e), P = yn(a, i);
|
|
755
|
+
y(P, `No group element found for id "${a}"`);
|
|
756
|
+
const f = P.getBoundingClientRect(), u = o ? f.width : f.height;
|
|
757
|
+
return (m - s) / u * 100;
|
|
771
758
|
}
|
|
772
|
-
function
|
|
759
|
+
function Qn(e, n, t, r, i, o) {
|
|
773
760
|
if (an(e)) {
|
|
774
761
|
const l = t === "horizontal";
|
|
775
762
|
let a = 0;
|
|
@@ -797,16 +784,16 @@ function nt(e, n, t, r, i, o) {
|
|
|
797
784
|
}
|
|
798
785
|
return s;
|
|
799
786
|
} else
|
|
800
|
-
return r == null ? 0 :
|
|
787
|
+
return r == null ? 0 : Zn(e, n, t, r, o);
|
|
801
788
|
}
|
|
802
|
-
function
|
|
789
|
+
function et({
|
|
803
790
|
panelDataArray: e
|
|
804
791
|
}) {
|
|
805
792
|
const n = Array(e.length), t = e.map((o) => o.constraints);
|
|
806
793
|
let r = 0, i = 100;
|
|
807
794
|
for (let o = 0; o < e.length; o++) {
|
|
808
795
|
const l = t[o];
|
|
809
|
-
|
|
796
|
+
y(l, `Panel constraints not found for index ${o}`);
|
|
810
797
|
const {
|
|
811
798
|
defaultSize: a
|
|
812
799
|
} = l;
|
|
@@ -814,7 +801,7 @@ function tt({
|
|
|
814
801
|
}
|
|
815
802
|
for (let o = 0; o < e.length; o++) {
|
|
816
803
|
const l = t[o];
|
|
817
|
-
|
|
804
|
+
y(l, `Panel constraints not found for index ${o}`);
|
|
818
805
|
const {
|
|
819
806
|
defaultSize: a
|
|
820
807
|
} = l;
|
|
@@ -828,7 +815,7 @@ function tt({
|
|
|
828
815
|
function le(e, n, t) {
|
|
829
816
|
n.forEach((r, i) => {
|
|
830
817
|
const o = e[i];
|
|
831
|
-
|
|
818
|
+
y(o, `Panel data not found for index ${i}`);
|
|
832
819
|
const {
|
|
833
820
|
callbacks: l,
|
|
834
821
|
constraints: a,
|
|
@@ -840,11 +827,11 @@ function le(e, n, t) {
|
|
|
840
827
|
if (f == null || r !== f) {
|
|
841
828
|
t[s] = r;
|
|
842
829
|
const {
|
|
843
|
-
onCollapse:
|
|
830
|
+
onCollapse: u,
|
|
844
831
|
onExpand: x,
|
|
845
|
-
onResize:
|
|
832
|
+
onResize: h
|
|
846
833
|
} = l;
|
|
847
|
-
|
|
834
|
+
h && h(r, f), P && (u || x) && (x && (f == null || Y(f, m)) && !Y(r, m) && x(), u && (f == null || !Y(f, m)) && Y(r, m) && u());
|
|
848
835
|
}
|
|
849
836
|
});
|
|
850
837
|
}
|
|
@@ -856,7 +843,7 @@ function we(e, n) {
|
|
|
856
843
|
return !1;
|
|
857
844
|
return !0;
|
|
858
845
|
}
|
|
859
|
-
function
|
|
846
|
+
function nt({
|
|
860
847
|
defaultSize: e,
|
|
861
848
|
dragState: n,
|
|
862
849
|
layout: t,
|
|
@@ -877,7 +864,7 @@ function rt({
|
|
|
877
864
|
pointerEvents: n !== null ? "none" : void 0
|
|
878
865
|
};
|
|
879
866
|
}
|
|
880
|
-
function
|
|
867
|
+
function tt(e, n = 10) {
|
|
881
868
|
let t = null;
|
|
882
869
|
return (...i) => {
|
|
883
870
|
t !== null && clearTimeout(t), t = setTimeout(() => {
|
|
@@ -924,12 +911,12 @@ function bn(e, n) {
|
|
|
924
911
|
}
|
|
925
912
|
return null;
|
|
926
913
|
}
|
|
927
|
-
function
|
|
914
|
+
function rt(e, n, t) {
|
|
928
915
|
var r, i;
|
|
929
916
|
const o = (r = bn(e, t)) !== null && r !== void 0 ? r : {}, l = Sn(n);
|
|
930
917
|
return (i = o[l]) !== null && i !== void 0 ? i : null;
|
|
931
918
|
}
|
|
932
|
-
function
|
|
919
|
+
function ot(e, n, t, r, i) {
|
|
933
920
|
var o;
|
|
934
921
|
const l = vn(e), a = Sn(n), s = (o = bn(e, i)) !== null && o !== void 0 ? o : {};
|
|
935
922
|
s[a] = {
|
|
@@ -952,14 +939,14 @@ function Ze({
|
|
|
952
939
|
if (!W(r, 100) && t.length > 0)
|
|
953
940
|
for (let o = 0; o < n.length; o++) {
|
|
954
941
|
const l = t[o];
|
|
955
|
-
|
|
942
|
+
y(l != null, `No layout data found for index ${o}`);
|
|
956
943
|
const a = 100 / r * l;
|
|
957
944
|
t[o] = a;
|
|
958
945
|
}
|
|
959
946
|
let i = 0;
|
|
960
947
|
for (let o = 0; o < n.length; o++) {
|
|
961
948
|
const l = t[o];
|
|
962
|
-
|
|
949
|
+
y(l != null, `No layout data found for index ${o}`);
|
|
963
950
|
const a = se({
|
|
964
951
|
panelConstraints: n,
|
|
965
952
|
panelIndex: o,
|
|
@@ -970,7 +957,7 @@ function Ze({
|
|
|
970
957
|
if (!W(i, 0))
|
|
971
958
|
for (let o = 0; o < n.length; o++) {
|
|
972
959
|
const l = t[o];
|
|
973
|
-
|
|
960
|
+
y(l != null, `No layout data found for index ${o}`);
|
|
974
961
|
const a = l + i, s = se({
|
|
975
962
|
panelConstraints: n,
|
|
976
963
|
panelIndex: o,
|
|
@@ -981,7 +968,7 @@ function Ze({
|
|
|
981
968
|
}
|
|
982
969
|
return t;
|
|
983
970
|
}
|
|
984
|
-
const
|
|
971
|
+
const it = 100, xe = {
|
|
985
972
|
getItem: (e) => (Ye(xe), xe.getItem(e)),
|
|
986
973
|
setItem: (e, n) => {
|
|
987
974
|
Ye(xe), xe.setItem(e, n);
|
|
@@ -1001,11 +988,11 @@ function Pn({
|
|
|
1001
988
|
tagName: P = "div",
|
|
1002
989
|
...f
|
|
1003
990
|
}) {
|
|
1004
|
-
const
|
|
991
|
+
const u = Fe(o), x = F(null), [h, I] = ue(null), [w, S] = ue([]), R = On(), D = F({}), N = F(/* @__PURE__ */ new Map()), q = F(0), C = F({
|
|
1005
992
|
autoSaveId: e,
|
|
1006
993
|
direction: r,
|
|
1007
|
-
dragState:
|
|
1008
|
-
id:
|
|
994
|
+
dragState: h,
|
|
995
|
+
id: u,
|
|
1009
996
|
keyboardResizeBy: a,
|
|
1010
997
|
onLayout: l,
|
|
1011
998
|
storage: s
|
|
@@ -1022,247 +1009,247 @@ function Pn({
|
|
|
1022
1009
|
getId: () => C.current.id,
|
|
1023
1010
|
getLayout: () => {
|
|
1024
1011
|
const {
|
|
1025
|
-
layout:
|
|
1012
|
+
layout: c
|
|
1026
1013
|
} = b.current;
|
|
1027
|
-
return
|
|
1014
|
+
return c;
|
|
1028
1015
|
},
|
|
1029
|
-
setLayout: (
|
|
1016
|
+
setLayout: (c) => {
|
|
1030
1017
|
const {
|
|
1031
1018
|
onLayout: g
|
|
1032
1019
|
} = C.current, {
|
|
1033
1020
|
layout: v,
|
|
1034
1021
|
panelDataArray: p
|
|
1035
1022
|
} = b.current, d = Ze({
|
|
1036
|
-
layout:
|
|
1037
|
-
panelConstraints: p.map((
|
|
1023
|
+
layout: c,
|
|
1024
|
+
panelConstraints: p.map((z) => z.constraints)
|
|
1038
1025
|
});
|
|
1039
|
-
Je(v, d) || (S(d), b.current.layout = d, g && g(d), le(p, d,
|
|
1026
|
+
Je(v, d) || (S(d), b.current.layout = d, g && g(d), le(p, d, D.current));
|
|
1040
1027
|
}
|
|
1041
1028
|
}), []), re(() => {
|
|
1042
|
-
C.current.autoSaveId = e, C.current.direction = r, C.current.dragState =
|
|
1043
|
-
}),
|
|
1029
|
+
C.current.autoSaveId = e, C.current.direction = r, C.current.dragState = h, C.current.id = u, C.current.onLayout = l, C.current.storage = s;
|
|
1030
|
+
}), Yn({
|
|
1044
1031
|
committedValuesRef: C,
|
|
1045
1032
|
eagerValuesRef: b,
|
|
1046
|
-
groupId:
|
|
1033
|
+
groupId: u,
|
|
1047
1034
|
layout: w,
|
|
1048
1035
|
panelDataArray: b.current.panelDataArray,
|
|
1049
1036
|
setLayout: S,
|
|
1050
1037
|
panelGroupElement: x.current
|
|
1051
1038
|
}), te(() => {
|
|
1052
1039
|
const {
|
|
1053
|
-
panelDataArray:
|
|
1040
|
+
panelDataArray: c
|
|
1054
1041
|
} = b.current;
|
|
1055
1042
|
if (e) {
|
|
1056
|
-
if (w.length === 0 || w.length !==
|
|
1043
|
+
if (w.length === 0 || w.length !== c.length)
|
|
1057
1044
|
return;
|
|
1058
1045
|
let g = Qe[e];
|
|
1059
|
-
g == null && (g = ot
|
|
1060
|
-
const v = [...
|
|
1046
|
+
g == null && (g = tt(ot, it), Qe[e] = g);
|
|
1047
|
+
const v = [...c], p = new Map(N.current);
|
|
1061
1048
|
g(e, v, p, w, s);
|
|
1062
1049
|
}
|
|
1063
1050
|
}, [e, w, s]), te(() => {
|
|
1064
1051
|
});
|
|
1065
|
-
const K = B((
|
|
1052
|
+
const K = B((c) => {
|
|
1066
1053
|
const {
|
|
1067
1054
|
onLayout: g
|
|
1068
1055
|
} = C.current, {
|
|
1069
1056
|
layout: v,
|
|
1070
1057
|
panelDataArray: p
|
|
1071
1058
|
} = b.current;
|
|
1072
|
-
if (
|
|
1073
|
-
const d = p.map((
|
|
1074
|
-
collapsedSize:
|
|
1059
|
+
if (c.constraints.collapsible) {
|
|
1060
|
+
const d = p.map((X) => X.constraints), {
|
|
1061
|
+
collapsedSize: z = 0,
|
|
1075
1062
|
panelSize: E,
|
|
1076
|
-
pivotIndices:
|
|
1077
|
-
} = ne(p,
|
|
1078
|
-
if (
|
|
1079
|
-
|
|
1080
|
-
const
|
|
1081
|
-
delta:
|
|
1063
|
+
pivotIndices: H
|
|
1064
|
+
} = ne(p, c, v);
|
|
1065
|
+
if (y(E != null, `Panel size not found for panel "${c.id}"`), !Y(E, z)) {
|
|
1066
|
+
N.current.set(c.id, E);
|
|
1067
|
+
const j = ae(p, c) === p.length - 1 ? E - z : z - E, L = ye({
|
|
1068
|
+
delta: j,
|
|
1082
1069
|
initialLayout: v,
|
|
1083
1070
|
panelConstraints: d,
|
|
1084
|
-
pivotIndices:
|
|
1071
|
+
pivotIndices: H,
|
|
1085
1072
|
prevLayout: v,
|
|
1086
1073
|
trigger: "imperative-api"
|
|
1087
1074
|
});
|
|
1088
|
-
we(v, L) || (S(L), b.current.layout = L, g && g(L), le(p, L,
|
|
1075
|
+
we(v, L) || (S(L), b.current.layout = L, g && g(L), le(p, L, D.current));
|
|
1089
1076
|
}
|
|
1090
1077
|
}
|
|
1091
|
-
}, []), J = B((
|
|
1078
|
+
}, []), J = B((c, g) => {
|
|
1092
1079
|
const {
|
|
1093
1080
|
onLayout: v
|
|
1094
1081
|
} = C.current, {
|
|
1095
1082
|
layout: p,
|
|
1096
1083
|
panelDataArray: d
|
|
1097
1084
|
} = b.current;
|
|
1098
|
-
if (
|
|
1099
|
-
const
|
|
1085
|
+
if (c.constraints.collapsible) {
|
|
1086
|
+
const z = d.map((U) => U.constraints), {
|
|
1100
1087
|
collapsedSize: E = 0,
|
|
1101
|
-
panelSize:
|
|
1102
|
-
minSize:
|
|
1103
|
-
pivotIndices:
|
|
1104
|
-
} = ne(d,
|
|
1105
|
-
if (Y(
|
|
1106
|
-
const U =
|
|
1107
|
-
delta:
|
|
1088
|
+
panelSize: H = 0,
|
|
1089
|
+
minSize: X = 0,
|
|
1090
|
+
pivotIndices: j
|
|
1091
|
+
} = ne(d, c, p), L = g ?? X;
|
|
1092
|
+
if (Y(H, E)) {
|
|
1093
|
+
const U = N.current.get(c.id), he = U != null && U >= L ? U : L, He = ae(d, c) === d.length - 1 ? H - he : he - H, T = ye({
|
|
1094
|
+
delta: He,
|
|
1108
1095
|
initialLayout: p,
|
|
1109
|
-
panelConstraints:
|
|
1110
|
-
pivotIndices:
|
|
1096
|
+
panelConstraints: z,
|
|
1097
|
+
pivotIndices: j,
|
|
1111
1098
|
prevLayout: p,
|
|
1112
1099
|
trigger: "imperative-api"
|
|
1113
1100
|
});
|
|
1114
|
-
we(p, T) || (S(T), b.current.layout = T, v && v(T), le(d, T,
|
|
1101
|
+
we(p, T) || (S(T), b.current.layout = T, v && v(T), le(d, T, D.current));
|
|
1115
1102
|
}
|
|
1116
1103
|
}
|
|
1117
|
-
}, []), V = B((
|
|
1104
|
+
}, []), V = B((c) => {
|
|
1118
1105
|
const {
|
|
1119
1106
|
layout: g,
|
|
1120
1107
|
panelDataArray: v
|
|
1121
1108
|
} = b.current, {
|
|
1122
1109
|
panelSize: p
|
|
1123
|
-
} = ne(v,
|
|
1124
|
-
return
|
|
1125
|
-
}, []), _ = B((
|
|
1110
|
+
} = ne(v, c, g);
|
|
1111
|
+
return y(p != null, `Panel size not found for panel "${c.id}"`), p;
|
|
1112
|
+
}, []), _ = B((c, g) => {
|
|
1126
1113
|
const {
|
|
1127
1114
|
panelDataArray: v
|
|
1128
|
-
} = b.current, p = ae(v,
|
|
1129
|
-
return
|
|
1115
|
+
} = b.current, p = ae(v, c);
|
|
1116
|
+
return nt({
|
|
1130
1117
|
defaultSize: g,
|
|
1131
|
-
dragState:
|
|
1118
|
+
dragState: h,
|
|
1132
1119
|
layout: w,
|
|
1133
1120
|
panelData: v,
|
|
1134
1121
|
panelIndex: p
|
|
1135
1122
|
});
|
|
1136
|
-
}, [
|
|
1123
|
+
}, [h, w]), M = B((c) => {
|
|
1137
1124
|
const {
|
|
1138
1125
|
layout: g,
|
|
1139
1126
|
panelDataArray: v
|
|
1140
1127
|
} = b.current, {
|
|
1141
1128
|
collapsedSize: p = 0,
|
|
1142
1129
|
collapsible: d,
|
|
1143
|
-
panelSize:
|
|
1144
|
-
} = ne(v,
|
|
1145
|
-
return z
|
|
1146
|
-
}, []), ee = B((
|
|
1130
|
+
panelSize: z
|
|
1131
|
+
} = ne(v, c, g);
|
|
1132
|
+
return y(z != null, `Panel size not found for panel "${c.id}"`), d === !0 && Y(z, p);
|
|
1133
|
+
}, []), ee = B((c) => {
|
|
1147
1134
|
const {
|
|
1148
1135
|
layout: g,
|
|
1149
1136
|
panelDataArray: v
|
|
1150
1137
|
} = b.current, {
|
|
1151
1138
|
collapsedSize: p = 0,
|
|
1152
1139
|
collapsible: d,
|
|
1153
|
-
panelSize:
|
|
1154
|
-
} = ne(v,
|
|
1155
|
-
return z
|
|
1156
|
-
}, []),
|
|
1140
|
+
panelSize: z
|
|
1141
|
+
} = ne(v, c, g);
|
|
1142
|
+
return y(z != null, `Panel size not found for panel "${c.id}"`), !d || oe(z, p) > 0;
|
|
1143
|
+
}, []), k = B((c) => {
|
|
1157
1144
|
const {
|
|
1158
1145
|
panelDataArray: g
|
|
1159
1146
|
} = b.current;
|
|
1160
|
-
g.push(
|
|
1161
|
-
const d = v.order,
|
|
1162
|
-
return d == null &&
|
|
1147
|
+
g.push(c), g.sort((v, p) => {
|
|
1148
|
+
const d = v.order, z = p.order;
|
|
1149
|
+
return d == null && z == null ? 0 : d == null ? -1 : z == null ? 1 : d - z;
|
|
1163
1150
|
}), b.current.panelDataArrayChanged = !0, R();
|
|
1164
1151
|
}, [R]);
|
|
1165
1152
|
re(() => {
|
|
1166
1153
|
if (b.current.panelDataArrayChanged) {
|
|
1167
1154
|
b.current.panelDataArrayChanged = !1;
|
|
1168
1155
|
const {
|
|
1169
|
-
autoSaveId:
|
|
1156
|
+
autoSaveId: c,
|
|
1170
1157
|
onLayout: g,
|
|
1171
1158
|
storage: v
|
|
1172
1159
|
} = C.current, {
|
|
1173
1160
|
layout: p,
|
|
1174
1161
|
panelDataArray: d
|
|
1175
1162
|
} = b.current;
|
|
1176
|
-
let
|
|
1177
|
-
if (
|
|
1178
|
-
const
|
|
1179
|
-
|
|
1163
|
+
let z = null;
|
|
1164
|
+
if (c) {
|
|
1165
|
+
const H = rt(c, d, v);
|
|
1166
|
+
H && (N.current = new Map(Object.entries(H.expandToSizes)), z = H.layout);
|
|
1180
1167
|
}
|
|
1181
|
-
|
|
1168
|
+
z == null && (z = et({
|
|
1182
1169
|
panelDataArray: d
|
|
1183
1170
|
}));
|
|
1184
1171
|
const E = Ze({
|
|
1185
|
-
layout:
|
|
1186
|
-
panelConstraints: d.map((
|
|
1172
|
+
layout: z,
|
|
1173
|
+
panelConstraints: d.map((H) => H.constraints)
|
|
1187
1174
|
});
|
|
1188
|
-
Je(p, E) || (S(E), b.current.layout = E, g && g(E), le(d, E,
|
|
1175
|
+
Je(p, E) || (S(E), b.current.layout = E, g && g(E), le(d, E, D.current));
|
|
1189
1176
|
}
|
|
1190
1177
|
}), re(() => {
|
|
1191
|
-
const
|
|
1178
|
+
const c = b.current;
|
|
1192
1179
|
return () => {
|
|
1193
|
-
|
|
1180
|
+
c.layout = [];
|
|
1194
1181
|
};
|
|
1195
1182
|
}, []);
|
|
1196
|
-
const
|
|
1183
|
+
const $ = B((c) => {
|
|
1197
1184
|
let g = !1;
|
|
1198
1185
|
const v = x.current;
|
|
1199
1186
|
return v && window.getComputedStyle(v, null).getPropertyValue("direction") === "rtl" && (g = !0), function(d) {
|
|
1200
1187
|
d.preventDefault();
|
|
1201
|
-
const
|
|
1202
|
-
if (!
|
|
1188
|
+
const z = x.current;
|
|
1189
|
+
if (!z)
|
|
1203
1190
|
return () => null;
|
|
1204
1191
|
const {
|
|
1205
1192
|
direction: E,
|
|
1206
|
-
dragState:
|
|
1207
|
-
id:
|
|
1208
|
-
keyboardResizeBy:
|
|
1193
|
+
dragState: H,
|
|
1194
|
+
id: X,
|
|
1195
|
+
keyboardResizeBy: j,
|
|
1209
1196
|
onLayout: L
|
|
1210
1197
|
} = C.current, {
|
|
1211
1198
|
layout: U,
|
|
1212
|
-
panelDataArray:
|
|
1199
|
+
panelDataArray: he
|
|
1213
1200
|
} = b.current, {
|
|
1214
1201
|
initialLayout: Pe
|
|
1215
|
-
} =
|
|
1216
|
-
let T =
|
|
1202
|
+
} = H ?? {}, He = zn(X, c, z);
|
|
1203
|
+
let T = Qn(d, c, E, H, j, z);
|
|
1217
1204
|
const Ke = E === "horizontal";
|
|
1218
1205
|
Ke && g && (T = -T);
|
|
1219
|
-
const En =
|
|
1206
|
+
const En = he.map((Cn) => Cn.constraints), ze = ye({
|
|
1220
1207
|
delta: T,
|
|
1221
1208
|
initialLayout: Pe ?? U,
|
|
1222
1209
|
panelConstraints: En,
|
|
1223
|
-
pivotIndices:
|
|
1210
|
+
pivotIndices: He,
|
|
1224
1211
|
prevLayout: U,
|
|
1225
1212
|
trigger: an(d) ? "keyboard" : "mouse-or-touch"
|
|
1226
|
-
}), Ue = !we(U,
|
|
1227
|
-
(sn(d) ||
|
|
1213
|
+
}), Ue = !we(U, ze);
|
|
1214
|
+
(sn(d) || un(d)) && q.current != T && (q.current = T, !Ue && T !== 0 ? Ke ? _e(c, T < 0 ? dn : fn) : _e(c, T < 0 ? pn : gn) : _e(c, 0)), Ue && (S(ze), b.current.layout = ze, L && L(ze), le(he, ze, D.current));
|
|
1228
1215
|
};
|
|
1229
|
-
}, []), G = B((
|
|
1216
|
+
}, []), G = B((c, g) => {
|
|
1230
1217
|
const {
|
|
1231
1218
|
onLayout: v
|
|
1232
1219
|
} = C.current, {
|
|
1233
1220
|
layout: p,
|
|
1234
1221
|
panelDataArray: d
|
|
1235
|
-
} = b.current,
|
|
1222
|
+
} = b.current, z = d.map((U) => U.constraints), {
|
|
1236
1223
|
panelSize: E,
|
|
1237
|
-
pivotIndices:
|
|
1238
|
-
} = ne(d,
|
|
1239
|
-
|
|
1240
|
-
const
|
|
1241
|
-
delta:
|
|
1224
|
+
pivotIndices: H
|
|
1225
|
+
} = ne(d, c, p);
|
|
1226
|
+
y(E != null, `Panel size not found for panel "${c.id}"`);
|
|
1227
|
+
const j = ae(d, c) === d.length - 1 ? E - g : g - E, L = ye({
|
|
1228
|
+
delta: j,
|
|
1242
1229
|
initialLayout: p,
|
|
1243
|
-
panelConstraints:
|
|
1244
|
-
pivotIndices:
|
|
1230
|
+
panelConstraints: z,
|
|
1231
|
+
pivotIndices: H,
|
|
1245
1232
|
prevLayout: p,
|
|
1246
1233
|
trigger: "imperative-api"
|
|
1247
1234
|
});
|
|
1248
|
-
we(p, L) || (S(L), b.current.layout = L, v && v(L), le(d, L,
|
|
1249
|
-
}, []), fe = B((
|
|
1235
|
+
we(p, L) || (S(L), b.current.layout = L, v && v(L), le(d, L, D.current));
|
|
1236
|
+
}, []), fe = B((c, g) => {
|
|
1250
1237
|
const {
|
|
1251
1238
|
layout: v,
|
|
1252
1239
|
panelDataArray: p
|
|
1253
1240
|
} = b.current, {
|
|
1254
1241
|
collapsedSize: d = 0,
|
|
1255
|
-
collapsible:
|
|
1242
|
+
collapsible: z
|
|
1256
1243
|
} = g, {
|
|
1257
1244
|
collapsedSize: E = 0,
|
|
1258
|
-
collapsible:
|
|
1259
|
-
maxSize:
|
|
1260
|
-
minSize:
|
|
1261
|
-
} =
|
|
1245
|
+
collapsible: H,
|
|
1246
|
+
maxSize: X = 100,
|
|
1247
|
+
minSize: j = 0
|
|
1248
|
+
} = c.constraints, {
|
|
1262
1249
|
panelSize: L
|
|
1263
|
-
} = ne(p,
|
|
1264
|
-
L != null && (
|
|
1265
|
-
}, [G]), pe = B((
|
|
1250
|
+
} = ne(p, c, v);
|
|
1251
|
+
L != null && (z && H && Y(L, d) ? Y(d, E) || G(c, E) : L < j ? G(c, j) : L > X && G(c, X));
|
|
1252
|
+
}, [G]), pe = B((c, g) => {
|
|
1266
1253
|
const {
|
|
1267
1254
|
direction: v
|
|
1268
1255
|
} = C.current, {
|
|
@@ -1270,41 +1257,41 @@ function Pn({
|
|
|
1270
1257
|
} = b.current;
|
|
1271
1258
|
if (!x.current)
|
|
1272
1259
|
return;
|
|
1273
|
-
const d =
|
|
1274
|
-
|
|
1275
|
-
const
|
|
1260
|
+
const d = Me(c, x.current);
|
|
1261
|
+
y(d, `Drag handle element not found for id "${c}"`);
|
|
1262
|
+
const z = xn(v, g);
|
|
1276
1263
|
I({
|
|
1277
|
-
dragHandleId:
|
|
1264
|
+
dragHandleId: c,
|
|
1278
1265
|
dragHandleRect: d.getBoundingClientRect(),
|
|
1279
|
-
initialCursorPosition:
|
|
1266
|
+
initialCursorPosition: z,
|
|
1280
1267
|
initialLayout: p
|
|
1281
1268
|
});
|
|
1282
1269
|
}, []), ge = B(() => {
|
|
1283
1270
|
I(null);
|
|
1284
|
-
}, []),
|
|
1271
|
+
}, []), De = B((c) => {
|
|
1285
1272
|
const {
|
|
1286
1273
|
panelDataArray: g
|
|
1287
|
-
} = b.current, v = ae(g,
|
|
1288
|
-
v >= 0 && (g.splice(v, 1), delete
|
|
1289
|
-
}, [R]), ie =
|
|
1274
|
+
} = b.current, v = ae(g, c);
|
|
1275
|
+
v >= 0 && (g.splice(v, 1), delete D.current[c.id], b.current.panelDataArrayChanged = !0, R());
|
|
1276
|
+
}, [R]), ie = Dn(() => ({
|
|
1290
1277
|
collapsePanel: K,
|
|
1291
1278
|
direction: r,
|
|
1292
|
-
dragState:
|
|
1279
|
+
dragState: h,
|
|
1293
1280
|
expandPanel: J,
|
|
1294
1281
|
getPanelSize: V,
|
|
1295
1282
|
getPanelStyle: _,
|
|
1296
|
-
groupId:
|
|
1297
|
-
isPanelCollapsed:
|
|
1283
|
+
groupId: u,
|
|
1284
|
+
isPanelCollapsed: M,
|
|
1298
1285
|
isPanelExpanded: ee,
|
|
1299
1286
|
reevaluatePanelConstraints: fe,
|
|
1300
|
-
registerPanel:
|
|
1301
|
-
registerResizeHandle:
|
|
1287
|
+
registerPanel: k,
|
|
1288
|
+
registerResizeHandle: $,
|
|
1302
1289
|
resizePanel: G,
|
|
1303
1290
|
startDragging: pe,
|
|
1304
1291
|
stopDragging: ge,
|
|
1305
|
-
unregisterPanel:
|
|
1292
|
+
unregisterPanel: De,
|
|
1306
1293
|
panelGroupElement: x.current
|
|
1307
|
-
}), [K,
|
|
1294
|
+
}), [K, h, r, J, V, _, u, M, ee, fe, k, $, G, pe, ge, De]), me = {
|
|
1308
1295
|
display: "flex",
|
|
1309
1296
|
flexDirection: r === "horizontal" ? "row" : "column",
|
|
1310
1297
|
height: "100%",
|
|
@@ -1326,7 +1313,7 @@ function Pn({
|
|
|
1326
1313
|
// CSS selectors
|
|
1327
1314
|
[A.group]: "",
|
|
1328
1315
|
[A.groupDirection]: r,
|
|
1329
|
-
[A.groupId]:
|
|
1316
|
+
[A.groupId]: u
|
|
1330
1317
|
}));
|
|
1331
1318
|
}
|
|
1332
1319
|
const wn = en((e, n) => de(Pn, {
|
|
@@ -1346,7 +1333,7 @@ function ne(e, n, t) {
|
|
|
1346
1333
|
pivotIndices: o
|
|
1347
1334
|
};
|
|
1348
1335
|
}
|
|
1349
|
-
function
|
|
1336
|
+
function lt({
|
|
1350
1337
|
disabled: e,
|
|
1351
1338
|
handleId: n,
|
|
1352
1339
|
resizeHandler: t,
|
|
@@ -1355,7 +1342,7 @@ function st({
|
|
|
1355
1342
|
te(() => {
|
|
1356
1343
|
if (e || t == null || r == null)
|
|
1357
1344
|
return;
|
|
1358
|
-
const i =
|
|
1345
|
+
const i = Me(n, r);
|
|
1359
1346
|
if (i == null)
|
|
1360
1347
|
return;
|
|
1361
1348
|
const o = (l) => {
|
|
@@ -1373,9 +1360,9 @@ function st({
|
|
|
1373
1360
|
case "F6": {
|
|
1374
1361
|
l.preventDefault();
|
|
1375
1362
|
const a = i.getAttribute(A.groupId);
|
|
1376
|
-
|
|
1377
|
-
const s = be(a, r), m =
|
|
1378
|
-
|
|
1363
|
+
y(a, `No group element found for id "${a}"`);
|
|
1364
|
+
const s = be(a, r), m = hn(a, n, r);
|
|
1365
|
+
y(m !== null, `No resize element found for id "${n}"`);
|
|
1379
1366
|
const P = l.shiftKey ? m > 0 ? m - 1 : s.length - 1 : m + 1 < s.length ? m + 1 : 0;
|
|
1380
1367
|
s[P].focus();
|
|
1381
1368
|
break;
|
|
@@ -1400,9 +1387,9 @@ function In({
|
|
|
1400
1387
|
onPointerDown: m,
|
|
1401
1388
|
onPointerUp: P,
|
|
1402
1389
|
style: f = {},
|
|
1403
|
-
tabIndex:
|
|
1390
|
+
tabIndex: u = 0,
|
|
1404
1391
|
tagName: x = "div",
|
|
1405
|
-
...
|
|
1392
|
+
...h
|
|
1406
1393
|
}) {
|
|
1407
1394
|
var I, w;
|
|
1408
1395
|
const S = F(null), R = F({
|
|
@@ -1414,17 +1401,17 @@ function In({
|
|
|
1414
1401
|
te(() => {
|
|
1415
1402
|
R.current.onClick = l, R.current.onDragging = a, R.current.onPointerDown = m, R.current.onPointerUp = P;
|
|
1416
1403
|
});
|
|
1417
|
-
const
|
|
1418
|
-
if (
|
|
1404
|
+
const D = nn(Re);
|
|
1405
|
+
if (D === null)
|
|
1419
1406
|
throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");
|
|
1420
1407
|
const {
|
|
1421
|
-
direction:
|
|
1422
|
-
groupId:
|
|
1408
|
+
direction: N,
|
|
1409
|
+
groupId: q,
|
|
1423
1410
|
registerResizeHandle: C,
|
|
1424
1411
|
startDragging: b,
|
|
1425
1412
|
stopDragging: K,
|
|
1426
1413
|
panelGroupElement: J
|
|
1427
|
-
} =
|
|
1414
|
+
} = D, V = Fe(i), [_, M] = ue("inactive"), [ee, k] = ue(!1), [$, G] = ue(null), fe = F({
|
|
1428
1415
|
state: _
|
|
1429
1416
|
});
|
|
1430
1417
|
re(() => {
|
|
@@ -1439,63 +1426,63 @@ function In({
|
|
|
1439
1426
|
}, [t, V, C]);
|
|
1440
1427
|
const pe = (I = r?.coarse) !== null && I !== void 0 ? I : 15, ge = (w = r?.fine) !== null && w !== void 0 ? w : 5;
|
|
1441
1428
|
return te(() => {
|
|
1442
|
-
if (t ||
|
|
1429
|
+
if (t || $ == null)
|
|
1443
1430
|
return;
|
|
1444
1431
|
const ie = S.current;
|
|
1445
|
-
|
|
1432
|
+
y(ie, "Element ref not attached");
|
|
1446
1433
|
let me = !1;
|
|
1447
|
-
return
|
|
1434
|
+
return Kn(V, ie, N, {
|
|
1448
1435
|
coarse: pe,
|
|
1449
1436
|
fine: ge
|
|
1450
1437
|
}, (g, v, p) => {
|
|
1451
1438
|
if (!v) {
|
|
1452
|
-
|
|
1439
|
+
M("inactive");
|
|
1453
1440
|
return;
|
|
1454
1441
|
}
|
|
1455
1442
|
switch (g) {
|
|
1456
1443
|
case "down": {
|
|
1457
|
-
|
|
1444
|
+
M("drag"), me = !1, y(p, 'Expected event to be defined for "down" action'), b(V, p);
|
|
1458
1445
|
const {
|
|
1459
1446
|
onDragging: d,
|
|
1460
|
-
onPointerDown:
|
|
1447
|
+
onPointerDown: z
|
|
1461
1448
|
} = R.current;
|
|
1462
|
-
d?.(!0),
|
|
1449
|
+
d?.(!0), z?.();
|
|
1463
1450
|
break;
|
|
1464
1451
|
}
|
|
1465
1452
|
case "move": {
|
|
1466
1453
|
const {
|
|
1467
1454
|
state: d
|
|
1468
1455
|
} = fe.current;
|
|
1469
|
-
me = !0, d !== "drag" &&
|
|
1456
|
+
me = !0, d !== "drag" && M("hover"), y(p, 'Expected event to be defined for "move" action'), $(p);
|
|
1470
1457
|
break;
|
|
1471
1458
|
}
|
|
1472
1459
|
case "up": {
|
|
1473
|
-
|
|
1460
|
+
M("hover"), K();
|
|
1474
1461
|
const {
|
|
1475
1462
|
onClick: d,
|
|
1476
|
-
onDragging:
|
|
1463
|
+
onDragging: z,
|
|
1477
1464
|
onPointerUp: E
|
|
1478
1465
|
} = R.current;
|
|
1479
|
-
|
|
1466
|
+
z?.(!1), E?.(), me || d?.();
|
|
1480
1467
|
break;
|
|
1481
1468
|
}
|
|
1482
1469
|
}
|
|
1483
1470
|
});
|
|
1484
|
-
}, [pe,
|
|
1471
|
+
}, [pe, N, t, ge, C, V, $, b, K]), lt({
|
|
1485
1472
|
disabled: t,
|
|
1486
1473
|
handleId: V,
|
|
1487
|
-
resizeHandler:
|
|
1474
|
+
resizeHandler: $,
|
|
1488
1475
|
panelGroupElement: J
|
|
1489
1476
|
}), de(x, {
|
|
1490
|
-
...
|
|
1477
|
+
...h,
|
|
1491
1478
|
children: e,
|
|
1492
1479
|
className: n,
|
|
1493
1480
|
id: i,
|
|
1494
1481
|
onBlur: () => {
|
|
1495
|
-
|
|
1482
|
+
k(!1), o?.();
|
|
1496
1483
|
},
|
|
1497
1484
|
onFocus: () => {
|
|
1498
|
-
|
|
1485
|
+
k(!0), s?.();
|
|
1499
1486
|
},
|
|
1500
1487
|
ref: S,
|
|
1501
1488
|
role: "separator",
|
|
@@ -1506,10 +1493,10 @@ function In({
|
|
|
1506
1493
|
},
|
|
1507
1494
|
...f
|
|
1508
1495
|
},
|
|
1509
|
-
tabIndex:
|
|
1496
|
+
tabIndex: u,
|
|
1510
1497
|
// CSS selectors
|
|
1511
|
-
[A.groupDirection]:
|
|
1512
|
-
[A.groupId]:
|
|
1498
|
+
[A.groupDirection]: N,
|
|
1499
|
+
[A.groupId]: q,
|
|
1513
1500
|
[A.resizeHandle]: "",
|
|
1514
1501
|
[A.resizeHandleActive]: _ === "drag" ? "pointer" : ee ? "keyboard" : void 0,
|
|
1515
1502
|
[A.resizeHandleEnabled]: !t,
|
|
@@ -1518,7 +1505,7 @@ function In({
|
|
|
1518
1505
|
});
|
|
1519
1506
|
}
|
|
1520
1507
|
In.displayName = "PanelResizeHandle";
|
|
1521
|
-
function
|
|
1508
|
+
function dt({
|
|
1522
1509
|
className: e,
|
|
1523
1510
|
...n
|
|
1524
1511
|
}) {
|
|
@@ -1534,12 +1521,12 @@ function pt({
|
|
|
1534
1521
|
}
|
|
1535
1522
|
);
|
|
1536
1523
|
}
|
|
1537
|
-
function
|
|
1524
|
+
function ft({
|
|
1538
1525
|
...e
|
|
1539
1526
|
}) {
|
|
1540
1527
|
return /* @__PURE__ */ ve(ln, { "data-slot": "resizable-panel", ...e });
|
|
1541
1528
|
}
|
|
1542
|
-
function
|
|
1529
|
+
function pt({
|
|
1543
1530
|
withHandle: e,
|
|
1544
1531
|
className: n,
|
|
1545
1532
|
...t
|
|
@@ -1553,12 +1540,12 @@ function mt({
|
|
|
1553
1540
|
),
|
|
1554
1541
|
"data-slot": "resizable-handle",
|
|
1555
1542
|
...t,
|
|
1556
|
-
children: e && /* @__PURE__ */ ve("div", { className: "z-10 flex h-4 w-3 items-center justify-center rounded-xs border bg-border", children: /* @__PURE__ */ ve(
|
|
1543
|
+
children: e && /* @__PURE__ */ ve("div", { className: "z-10 flex h-4 w-3 items-center justify-center rounded-xs border bg-border", children: /* @__PURE__ */ ve(Rn, { className: "size-2.5" }) })
|
|
1557
1544
|
}
|
|
1558
1545
|
);
|
|
1559
1546
|
}
|
|
1560
1547
|
export {
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1548
|
+
pt as ResizableHandle,
|
|
1549
|
+
ft as ResizablePanel,
|
|
1550
|
+
dt as ResizablePanelGroup
|
|
1564
1551
|
};
|