@kaushalparajuli/react-crud-ui 1.0.14 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -5
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +414 -410
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -353,7 +353,7 @@ const ye = (e) => {
|
|
|
353
353
|
// I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
|
|
354
354
|
Mf.test(e) && !kf.test(e)
|
|
355
355
|
), Qi = () => !1, jf = (e) => If.test(e), Uf = (e) => Df.test(e), zf = () => {
|
|
356
|
-
const e = ye("colors"), t = ye("spacing"), r = ye("blur"), n = ye("brightness"), o = ye("borderColor"), s = ye("borderRadius"), i = ye("borderSpacing"), a = ye("borderWidth"), c = ye("contrast"), d = ye("grayscale"), p = ye("hueRotate"), f = ye("invert"), m = ye("gap"), g = ye("gradientColorStops"), v = ye("gradientColorStopPositions"), h = ye("inset"), b = ye("margin"), y = ye("opacity"), w = ye("padding"), S = ye("saturate"), C = ye("scale"), N = ye("sepia"), A = ye("skew"), _ = ye("space"),
|
|
356
|
+
const e = ye("colors"), t = ye("spacing"), r = ye("blur"), n = ye("brightness"), o = ye("borderColor"), s = ye("borderRadius"), i = ye("borderSpacing"), a = ye("borderWidth"), c = ye("contrast"), d = ye("grayscale"), p = ye("hueRotate"), f = ye("invert"), m = ye("gap"), g = ye("gradientColorStops"), v = ye("gradientColorStopPositions"), h = ye("inset"), b = ye("margin"), y = ye("opacity"), w = ye("padding"), S = ye("saturate"), C = ye("scale"), N = ye("sepia"), A = ye("skew"), _ = ye("space"), F = ye("translate"), O = () => ["auto", "contain", "none"], L = () => ["auto", "hidden", "clip", "visible", "scroll"], T = () => ["auto", se, t], M = () => [se, t], I = () => ["", mt, wt], G = () => ["auto", Yt, se], X = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], U = () => ["solid", "dashed", "dotted", "double", "none"], D = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], j = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], V = () => ["", "0", se], ne = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], W = () => [Yt, se];
|
|
357
357
|
return {
|
|
358
358
|
cacheSize: 500,
|
|
359
359
|
separator: ":",
|
|
@@ -483,42 +483,42 @@ const ye = (e) => {
|
|
|
483
483
|
* @see https://tailwindcss.com/docs/overflow
|
|
484
484
|
*/
|
|
485
485
|
overflow: [{
|
|
486
|
-
overflow:
|
|
486
|
+
overflow: L()
|
|
487
487
|
}],
|
|
488
488
|
/**
|
|
489
489
|
* Overflow X
|
|
490
490
|
* @see https://tailwindcss.com/docs/overflow
|
|
491
491
|
*/
|
|
492
492
|
"overflow-x": [{
|
|
493
|
-
"overflow-x":
|
|
493
|
+
"overflow-x": L()
|
|
494
494
|
}],
|
|
495
495
|
/**
|
|
496
496
|
* Overflow Y
|
|
497
497
|
* @see https://tailwindcss.com/docs/overflow
|
|
498
498
|
*/
|
|
499
499
|
"overflow-y": [{
|
|
500
|
-
"overflow-y":
|
|
500
|
+
"overflow-y": L()
|
|
501
501
|
}],
|
|
502
502
|
/**
|
|
503
503
|
* Overscroll Behavior
|
|
504
504
|
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
505
505
|
*/
|
|
506
506
|
overscroll: [{
|
|
507
|
-
overscroll:
|
|
507
|
+
overscroll: O()
|
|
508
508
|
}],
|
|
509
509
|
/**
|
|
510
510
|
* Overscroll Behavior X
|
|
511
511
|
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
512
512
|
*/
|
|
513
513
|
"overscroll-x": [{
|
|
514
|
-
"overscroll-x":
|
|
514
|
+
"overscroll-x": O()
|
|
515
515
|
}],
|
|
516
516
|
/**
|
|
517
517
|
* Overscroll Behavior Y
|
|
518
518
|
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
519
519
|
*/
|
|
520
520
|
"overscroll-y": [{
|
|
521
|
-
"overscroll-y":
|
|
521
|
+
"overscroll-y": O()
|
|
522
522
|
}],
|
|
523
523
|
/**
|
|
524
524
|
* Position
|
|
@@ -1747,14 +1747,14 @@ const ye = (e) => {
|
|
|
1747
1747
|
* @see https://tailwindcss.com/docs/mix-blend-mode
|
|
1748
1748
|
*/
|
|
1749
1749
|
"mix-blend": [{
|
|
1750
|
-
"mix-blend": [...
|
|
1750
|
+
"mix-blend": [...D(), "plus-lighter", "plus-darker"]
|
|
1751
1751
|
}],
|
|
1752
1752
|
/**
|
|
1753
1753
|
* Background Blend Mode
|
|
1754
1754
|
* @see https://tailwindcss.com/docs/background-blend-mode
|
|
1755
1755
|
*/
|
|
1756
1756
|
"bg-blend": [{
|
|
1757
|
-
"bg-blend":
|
|
1757
|
+
"bg-blend": D()
|
|
1758
1758
|
}],
|
|
1759
1759
|
// Filters
|
|
1760
1760
|
/**
|
|
@@ -2019,14 +2019,14 @@ const ye = (e) => {
|
|
|
2019
2019
|
* @see https://tailwindcss.com/docs/translate
|
|
2020
2020
|
*/
|
|
2021
2021
|
"translate-x": [{
|
|
2022
|
-
"translate-x": [
|
|
2022
|
+
"translate-x": [F]
|
|
2023
2023
|
}],
|
|
2024
2024
|
/**
|
|
2025
2025
|
* Translate Y
|
|
2026
2026
|
* @see https://tailwindcss.com/docs/translate
|
|
2027
2027
|
*/
|
|
2028
2028
|
"translate-y": [{
|
|
2029
|
-
"translate-y": [
|
|
2029
|
+
"translate-y": [F]
|
|
2030
2030
|
}],
|
|
2031
2031
|
/**
|
|
2032
2032
|
* Skew X
|
|
@@ -3189,11 +3189,11 @@ function Fo(e) {
|
|
|
3189
3189
|
function Np(e, t) {
|
|
3190
3190
|
return l.useReducer((r, n) => t[r][n] ?? r, e);
|
|
3191
3191
|
}
|
|
3192
|
-
var
|
|
3192
|
+
var Fe = (e) => {
|
|
3193
3193
|
const { present: t, children: r } = e, n = Ep(t), o = typeof r == "function" ? r({ present: n.isPresent }) : l.Children.only(r), s = ie(n.ref, Rp(o));
|
|
3194
3194
|
return typeof r == "function" || n.isPresent ? l.cloneElement(o, { ref: s }) : null;
|
|
3195
3195
|
};
|
|
3196
|
-
|
|
3196
|
+
Fe.displayName = "Presence";
|
|
3197
3197
|
function Ep(e) {
|
|
3198
3198
|
const [t, r] = l.useState(), n = l.useRef(null), o = l.useRef(e), s = l.useRef("none"), i = e ? "mounted" : "unmounted", [a, c] = Np(i, {
|
|
3199
3199
|
mounted: {
|
|
@@ -3462,7 +3462,7 @@ var ca = "CheckboxIndicator", ua = l.forwardRef(
|
|
|
3462
3462
|
(e, t) => {
|
|
3463
3463
|
const { __scopeCheckbox: r, forceMount: n, ...o } = e, s = Wo(ca, r);
|
|
3464
3464
|
return /* @__PURE__ */ u(
|
|
3465
|
-
|
|
3465
|
+
Fe,
|
|
3466
3466
|
{
|
|
3467
3467
|
present: n || Nt(s.checked) || s.checked === !0,
|
|
3468
3468
|
children: /* @__PURE__ */ u(
|
|
@@ -4165,11 +4165,11 @@ var wm = "DismissableLayer", go = "dismissableLayer.update", xm = "dismissableLa
|
|
|
4165
4165
|
onDismiss: a,
|
|
4166
4166
|
...c
|
|
4167
4167
|
} = e, d = l.useContext(Ea), [p, f] = l.useState(null), m = (p == null ? void 0 : p.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, g] = l.useState({}), v = ie(t, (_) => f(_)), h = Array.from(d.layers), [b] = [...d.layersWithOutsidePointerEventsDisabled].slice(-1), y = h.indexOf(b), w = p ? h.indexOf(p) : -1, S = d.layersWithOutsidePointerEventsDisabled.size > 0, C = w >= y, N = Em((_) => {
|
|
4168
|
-
const
|
|
4169
|
-
!C ||
|
|
4168
|
+
const F = _.target, O = [...d.branches].some((L) => L.contains(F));
|
|
4169
|
+
!C || O || (o == null || o(_), i == null || i(_), _.defaultPrevented || a == null || a());
|
|
4170
4170
|
}, m), A = Rm((_) => {
|
|
4171
|
-
const
|
|
4172
|
-
[...d.branches].some((
|
|
4171
|
+
const F = _.target;
|
|
4172
|
+
[...d.branches].some((L) => L.contains(F)) || (s == null || s(_), i == null || i(_), _.defaultPrevented || a == null || a());
|
|
4173
4173
|
}, m);
|
|
4174
4174
|
return bm((_) => {
|
|
4175
4175
|
w === d.layers.size - 1 && (n == null || n(_), !_.defaultPrevented && a && (_.preventDefault(), a()));
|
|
@@ -4768,14 +4768,14 @@ const rh = (e) => ({
|
|
|
4768
4768
|
}, g = Go(o), v = zo(g), h = await i.getDimensions(d), b = g === "y", y = b ? "top" : "left", w = b ? "bottom" : "right", S = b ? "clientHeight" : "clientWidth", C = s.reference[v] + s.reference[g] - m[g] - s.floating[v], N = m[g] - s.reference[g], A = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(d));
|
|
4769
4769
|
let _ = A ? A[S] : 0;
|
|
4770
4770
|
(!_ || !await (i.isElement == null ? void 0 : i.isElement(A))) && (_ = a.floating[S] || s.floating[v]);
|
|
4771
|
-
const
|
|
4771
|
+
const F = C / 2 - N / 2, O = _ / 2 - h[v] / 2 - 1, L = Et(f[y], O), T = Et(f[w], O), M = L, I = _ - h[v] - T, G = _ / 2 - h[v] / 2 + F, X = vo(M, G, I), U = !c.arrow && rr(o) != null && G !== X && s.reference[v] / 2 - (G < M ? L : T) - h[v] / 2 < 0, D = U ? G < M ? G - M : G - I : 0;
|
|
4772
4772
|
return {
|
|
4773
|
-
[g]: m[g] +
|
|
4773
|
+
[g]: m[g] + D,
|
|
4774
4774
|
data: {
|
|
4775
4775
|
[g]: X,
|
|
4776
|
-
centerOffset: G - X -
|
|
4776
|
+
centerOffset: G - X - D,
|
|
4777
4777
|
...U && {
|
|
4778
|
-
alignmentOffset:
|
|
4778
|
+
alignmentOffset: D
|
|
4779
4779
|
}
|
|
4780
4780
|
},
|
|
4781
4781
|
reset: U
|
|
@@ -4807,36 +4807,36 @@ const rh = (e) => ({
|
|
|
4807
4807
|
return {};
|
|
4808
4808
|
const y = yt(o), w = lt(a), S = yt(a) === a, C = await (c.isRTL == null ? void 0 : c.isRTL(d.floating)), N = m || (S || !h ? [tn(a)] : qm(a)), A = v !== "none";
|
|
4809
4809
|
!m && A && N.push(...Jm(a, h, v, C));
|
|
4810
|
-
const _ = [a, ...N],
|
|
4811
|
-
let
|
|
4812
|
-
if (p &&
|
|
4810
|
+
const _ = [a, ...N], F = await wr(t, b), O = [];
|
|
4811
|
+
let L = ((n = s.flip) == null ? void 0 : n.overflows) || [];
|
|
4812
|
+
if (p && O.push(F[y]), f) {
|
|
4813
4813
|
const G = Ym(o, i, C);
|
|
4814
|
-
|
|
4814
|
+
O.push(F[G[0]], F[G[1]]);
|
|
4815
4815
|
}
|
|
4816
|
-
if (
|
|
4816
|
+
if (L = [...L, {
|
|
4817
4817
|
placement: o,
|
|
4818
|
-
overflows:
|
|
4819
|
-
}], !
|
|
4818
|
+
overflows: O
|
|
4819
|
+
}], !O.every((G) => G <= 0)) {
|
|
4820
4820
|
var T, M;
|
|
4821
4821
|
const G = (((T = s.flip) == null ? void 0 : T.index) || 0) + 1, X = _[G];
|
|
4822
4822
|
if (X && (!(f === "alignment" ? w !== lt(X) : !1) || // We leave the current main axis only if every placement on that axis
|
|
4823
4823
|
// overflows the main axis.
|
|
4824
|
-
|
|
4824
|
+
L.every((j) => lt(j.placement) === w ? j.overflows[0] > 0 : !0)))
|
|
4825
4825
|
return {
|
|
4826
4826
|
data: {
|
|
4827
4827
|
index: G,
|
|
4828
|
-
overflows:
|
|
4828
|
+
overflows: L
|
|
4829
4829
|
},
|
|
4830
4830
|
reset: {
|
|
4831
4831
|
placement: X
|
|
4832
4832
|
}
|
|
4833
4833
|
};
|
|
4834
|
-
let U = (M =
|
|
4834
|
+
let U = (M = L.filter((D) => D.overflows[0] <= 0).sort((D, j) => D.overflows[1] - j.overflows[1])[0]) == null ? void 0 : M.placement;
|
|
4835
4835
|
if (!U)
|
|
4836
4836
|
switch (g) {
|
|
4837
4837
|
case "bestFit": {
|
|
4838
4838
|
var I;
|
|
4839
|
-
const
|
|
4839
|
+
const D = (I = L.filter((j) => {
|
|
4840
4840
|
if (A) {
|
|
4841
4841
|
const V = lt(j.placement);
|
|
4842
4842
|
return V === w || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -4845,7 +4845,7 @@ const rh = (e) => ({
|
|
|
4845
4845
|
}
|
|
4846
4846
|
return !0;
|
|
4847
4847
|
}).map((j) => [j.placement, j.overflows.filter((V) => V > 0).reduce((V, ne) => V + ne, 0)]).sort((j, V) => j[1] - V[1])[0]) == null ? void 0 : I[0];
|
|
4848
|
-
|
|
4848
|
+
D && (U = D);
|
|
4849
4849
|
break;
|
|
4850
4850
|
}
|
|
4851
4851
|
case "initialPlacement":
|
|
@@ -5085,18 +5085,18 @@ const ih = function(e) {
|
|
|
5085
5085
|
let b, y;
|
|
5086
5086
|
f === "top" || f === "bottom" ? (b = f, y = m === (await (i.isRTL == null ? void 0 : i.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (y = f, b = m === "end" ? "top" : "bottom");
|
|
5087
5087
|
const w = h - p.top - p.bottom, S = v - p.left - p.right, C = Et(h - p[b], w), N = Et(v - p[y], S), A = !t.middlewareData.shift;
|
|
5088
|
-
let _ = C,
|
|
5089
|
-
if ((r = t.middlewareData.shift) != null && r.enabled.x && (
|
|
5090
|
-
const
|
|
5091
|
-
g ?
|
|
5088
|
+
let _ = C, F = N;
|
|
5089
|
+
if ((r = t.middlewareData.shift) != null && r.enabled.x && (F = S), (n = t.middlewareData.shift) != null && n.enabled.y && (_ = w), A && !m) {
|
|
5090
|
+
const L = je(p.left, 0), T = je(p.right, 0), M = je(p.top, 0), I = je(p.bottom, 0);
|
|
5091
|
+
g ? F = v - 2 * (L !== 0 || T !== 0 ? L + T : je(p.left, p.right)) : _ = h - 2 * (M !== 0 || I !== 0 ? M + I : je(p.top, p.bottom));
|
|
5092
5092
|
}
|
|
5093
5093
|
await c({
|
|
5094
5094
|
...t,
|
|
5095
|
-
availableWidth:
|
|
5095
|
+
availableWidth: F,
|
|
5096
5096
|
availableHeight: _
|
|
5097
5097
|
});
|
|
5098
|
-
const
|
|
5099
|
-
return v !==
|
|
5098
|
+
const O = await i.getDimensions(a.floating);
|
|
5099
|
+
return v !== O.width || h !== O.height ? {
|
|
5100
5100
|
reset: {
|
|
5101
5101
|
rects: !0
|
|
5102
5102
|
}
|
|
@@ -5676,7 +5676,7 @@ function zh(e) {
|
|
|
5676
5676
|
j !== A.current && (A.current = j, h(j));
|
|
5677
5677
|
}, []), S = l.useCallback((j) => {
|
|
5678
5678
|
j !== _.current && (_.current = j, y(j));
|
|
5679
|
-
}, []), C = s || v, N = i || b, A = l.useRef(null), _ = l.useRef(null),
|
|
5679
|
+
}, []), C = s || v, N = i || b, A = l.useRef(null), _ = l.useRef(null), F = l.useRef(p), O = c != null, L = to(c), T = to(o), M = to(d), I = l.useCallback(() => {
|
|
5680
5680
|
if (!A.current || !_.current)
|
|
5681
5681
|
return;
|
|
5682
5682
|
const j = {
|
|
@@ -5693,13 +5693,13 @@ function zh(e) {
|
|
|
5693
5693
|
// setting it to `true` when `open === false` (must be specified).
|
|
5694
5694
|
isPositioned: M.current !== !1
|
|
5695
5695
|
};
|
|
5696
|
-
G.current && !nn(
|
|
5696
|
+
G.current && !nn(F.current, ne) && (F.current = ne, Rr.flushSync(() => {
|
|
5697
5697
|
f(ne);
|
|
5698
5698
|
}));
|
|
5699
5699
|
});
|
|
5700
5700
|
}, [m, t, r, T, M]);
|
|
5701
5701
|
qr(() => {
|
|
5702
|
-
d === !1 &&
|
|
5702
|
+
d === !1 && F.current.isPositioned && (F.current.isPositioned = !1, f((j) => ({
|
|
5703
5703
|
...j,
|
|
5704
5704
|
isPositioned: !1
|
|
5705
5705
|
})));
|
|
@@ -5709,11 +5709,11 @@ function zh(e) {
|
|
|
5709
5709
|
G.current = !1;
|
|
5710
5710
|
}), []), qr(() => {
|
|
5711
5711
|
if (C && (A.current = C), N && (_.current = N), C && N) {
|
|
5712
|
-
if (
|
|
5713
|
-
return
|
|
5712
|
+
if (L.current)
|
|
5713
|
+
return L.current(C, N, I);
|
|
5714
5714
|
I();
|
|
5715
5715
|
}
|
|
5716
|
-
}, [C, N, I,
|
|
5716
|
+
}, [C, N, I, L, O]);
|
|
5717
5717
|
const X = l.useMemo(() => ({
|
|
5718
5718
|
reference: A,
|
|
5719
5719
|
floating: _,
|
|
@@ -5722,7 +5722,7 @@ function zh(e) {
|
|
|
5722
5722
|
}), [w, S]), U = l.useMemo(() => ({
|
|
5723
5723
|
reference: C,
|
|
5724
5724
|
floating: N
|
|
5725
|
-
}), [C, N]),
|
|
5725
|
+
}), [C, N]), D = l.useMemo(() => {
|
|
5726
5726
|
const j = {
|
|
5727
5727
|
position: r,
|
|
5728
5728
|
left: 0,
|
|
@@ -5748,8 +5748,8 @@ function zh(e) {
|
|
|
5748
5748
|
update: I,
|
|
5749
5749
|
refs: X,
|
|
5750
5750
|
elements: U,
|
|
5751
|
-
floatingStyles:
|
|
5752
|
-
}), [p, I, X, U,
|
|
5751
|
+
floatingStyles: D
|
|
5752
|
+
}), [p, I, X, U, D]);
|
|
5753
5753
|
}
|
|
5754
5754
|
const Gh = (e) => {
|
|
5755
5755
|
function t(r) {
|
|
@@ -6014,7 +6014,7 @@ var Ua = "PopperAnchor", za = l.forwardRef(
|
|
|
6014
6014
|
za.displayName = Ua;
|
|
6015
6015
|
var Zo = "PopperContent", [wg, xg] = Ba(Zo), Ga = l.forwardRef(
|
|
6016
6016
|
(e, t) => {
|
|
6017
|
-
var
|
|
6017
|
+
var $, J, Z, oe, ee, z;
|
|
6018
6018
|
const {
|
|
6019
6019
|
__scopePopper: r,
|
|
6020
6020
|
side: n = "bottom",
|
|
@@ -6030,15 +6030,15 @@ var Zo = "PopperContent", [wg, xg] = Ba(Zo), Ga = l.forwardRef(
|
|
|
6030
6030
|
updatePositionStrategy: g = "optimized",
|
|
6031
6031
|
onPlaced: v,
|
|
6032
6032
|
...h
|
|
6033
|
-
} = e, b = Ha(Zo, r), [y, w] = l.useState(null), S = ie(t, (te) => w(te)), [C, N] = l.useState(null), A = Fo(C), _ = (A == null ? void 0 : A.width) ?? 0,
|
|
6034
|
-
padding:
|
|
6033
|
+
} = e, b = Ha(Zo, r), [y, w] = l.useState(null), S = ie(t, (te) => w(te)), [C, N] = l.useState(null), A = Fo(C), _ = (A == null ? void 0 : A.width) ?? 0, F = (A == null ? void 0 : A.height) ?? 0, O = n + (s !== "center" ? "-" + s : ""), L = typeof p == "number" ? p : { top: 0, right: 0, bottom: 0, left: 0, ...p }, T = Array.isArray(d) ? d : [d], M = T.length > 0, I = {
|
|
6034
|
+
padding: L,
|
|
6035
6035
|
boundary: T.filter(Cg),
|
|
6036
6036
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
6037
6037
|
altBoundary: M
|
|
6038
|
-
}, { refs: G, floatingStyles: X, placement: U, isPositioned:
|
|
6038
|
+
}, { refs: G, floatingStyles: X, placement: U, isPositioned: D, middlewareData: j } = zh({
|
|
6039
6039
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
6040
6040
|
strategy: "fixed",
|
|
6041
|
-
placement:
|
|
6041
|
+
placement: O,
|
|
6042
6042
|
whileElementsMounted: (...te) => Oh(...te, {
|
|
6043
6043
|
animationFrame: g === "always"
|
|
6044
6044
|
}),
|
|
@@ -6046,7 +6046,7 @@ var Zo = "PopperContent", [wg, xg] = Ba(Zo), Ga = l.forwardRef(
|
|
|
6046
6046
|
reference: b.anchor
|
|
6047
6047
|
},
|
|
6048
6048
|
middleware: [
|
|
6049
|
-
Kh({ mainAxis: o +
|
|
6049
|
+
Kh({ mainAxis: o + F, alignmentAxis: i }),
|
|
6050
6050
|
c && Yh({
|
|
6051
6051
|
mainAxis: !0,
|
|
6052
6052
|
crossAxis: !1,
|
|
@@ -6056,20 +6056,20 @@ var Zo = "PopperContent", [wg, xg] = Ba(Zo), Ga = l.forwardRef(
|
|
|
6056
6056
|
c && Xh({ ...I }),
|
|
6057
6057
|
Zh({
|
|
6058
6058
|
...I,
|
|
6059
|
-
apply: ({ elements: te, rects: be, availableWidth: ve, availableHeight:
|
|
6060
|
-
const { width:
|
|
6061
|
-
He.setProperty("--radix-popper-available-width", `${ve}px`), He.setProperty("--radix-popper-available-height", `${
|
|
6059
|
+
apply: ({ elements: te, rects: be, availableWidth: ve, availableHeight: De }) => {
|
|
6060
|
+
const { width: Oe, height: Ve } = be.reference, He = te.floating.style;
|
|
6061
|
+
He.setProperty("--radix-popper-available-width", `${ve}px`), He.setProperty("--radix-popper-available-height", `${De}px`), He.setProperty("--radix-popper-anchor-width", `${Oe}px`), He.setProperty("--radix-popper-anchor-height", `${Ve}px`);
|
|
6062
6062
|
}
|
|
6063
6063
|
}),
|
|
6064
6064
|
C && Jh({ element: C, padding: a }),
|
|
6065
|
-
Ng({ arrowWidth: _, arrowHeight:
|
|
6065
|
+
Ng({ arrowWidth: _, arrowHeight: F }),
|
|
6066
6066
|
m && Qh({ strategy: "referenceHidden", ...I })
|
|
6067
6067
|
]
|
|
6068
6068
|
}), [V, ne] = qa(U), W = Pe(v);
|
|
6069
6069
|
Re(() => {
|
|
6070
|
-
|
|
6071
|
-
}, [
|
|
6072
|
-
const re = (
|
|
6070
|
+
D && (W == null || W());
|
|
6071
|
+
}, [D, W]);
|
|
6072
|
+
const re = ($ = j.arrow) == null ? void 0 : $.x, ce = (J = j.arrow) == null ? void 0 : J.y, de = ((Z = j.arrow) == null ? void 0 : Z.centerOffset) !== 0, [ge, me] = l.useState();
|
|
6073
6073
|
return Re(() => {
|
|
6074
6074
|
y && me(window.getComputedStyle(y).zIndex);
|
|
6075
6075
|
}, [y]), /* @__PURE__ */ u(
|
|
@@ -6079,7 +6079,7 @@ var Zo = "PopperContent", [wg, xg] = Ba(Zo), Ga = l.forwardRef(
|
|
|
6079
6079
|
"data-radix-popper-content-wrapper": "",
|
|
6080
6080
|
style: {
|
|
6081
6081
|
...X,
|
|
6082
|
-
transform:
|
|
6082
|
+
transform: D ? X.transform : "translate(0, -200%)",
|
|
6083
6083
|
// keep off the page when measuring
|
|
6084
6084
|
minWidth: "max-content",
|
|
6085
6085
|
zIndex: ge,
|
|
@@ -6116,7 +6116,7 @@ var Zo = "PopperContent", [wg, xg] = Ba(Zo), Ga = l.forwardRef(
|
|
|
6116
6116
|
...h.style,
|
|
6117
6117
|
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
6118
6118
|
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
6119
|
-
animation:
|
|
6119
|
+
animation: D ? void 0 : "none"
|
|
6120
6120
|
}
|
|
6121
6121
|
}
|
|
6122
6122
|
)
|
|
@@ -6883,8 +6883,8 @@ function kv(e) {
|
|
|
6883
6883
|
var y = Yr(h), w = r.current, S = "deltaX" in h ? h.deltaX : w[0] - y[0], C = "deltaY" in h ? h.deltaY : w[1] - y[1], N, A = h.target, _ = Math.abs(S) > Math.abs(C) ? "h" : "v";
|
|
6884
6884
|
if ("touches" in h && _ === "h" && A.type === "range")
|
|
6885
6885
|
return !1;
|
|
6886
|
-
var
|
|
6887
|
-
if (
|
|
6886
|
+
var F = window.getSelection(), O = F && F.anchorNode, L = O ? O === A || O.contains(A) : !1;
|
|
6887
|
+
if (L)
|
|
6888
6888
|
return !1;
|
|
6889
6889
|
var T = bi(_, A);
|
|
6890
6890
|
if (!T)
|
|
@@ -6974,12 +6974,12 @@ var Ov = [" ", "Enter", "ArrowUp", "ArrowDown"], $v = [" ", "Enter"], Lt = "Sele
|
|
|
6974
6974
|
disabled: m,
|
|
6975
6975
|
required: g,
|
|
6976
6976
|
form: v
|
|
6977
|
-
} = e, h = In(t), [b, y] = l.useState(null), [w, S] = l.useState(null), [C, N] = l.useState(!1), A = Pr(d), [_,
|
|
6977
|
+
} = e, h = In(t), [b, y] = l.useState(null), [w, S] = l.useState(null), [C, N] = l.useState(!1), A = Pr(d), [_, F] = ut({
|
|
6978
6978
|
prop: n,
|
|
6979
6979
|
defaultProp: o ?? !1,
|
|
6980
6980
|
onChange: s,
|
|
6981
6981
|
caller: Lt
|
|
6982
|
-
}), [
|
|
6982
|
+
}), [O, L] = ut({
|
|
6983
6983
|
prop: i,
|
|
6984
6984
|
defaultProp: a,
|
|
6985
6985
|
onChange: c,
|
|
@@ -6997,10 +6997,10 @@ var Ov = [" ", "Enter", "ArrowUp", "ArrowDown"], $v = [" ", "Enter"], Lt = "Sele
|
|
|
6997
6997
|
valueNodeHasChildren: C,
|
|
6998
6998
|
onValueNodeHasChildrenChange: N,
|
|
6999
6999
|
contentId: ze(),
|
|
7000
|
-
value:
|
|
7001
|
-
onValueChange:
|
|
7000
|
+
value: O,
|
|
7001
|
+
onValueChange: L,
|
|
7002
7002
|
open: _,
|
|
7003
|
-
onOpenChange:
|
|
7003
|
+
onOpenChange: F,
|
|
7004
7004
|
dir: A,
|
|
7005
7005
|
triggerPointerDownPosRef: T,
|
|
7006
7006
|
disabled: m,
|
|
@@ -7010,11 +7010,11 @@ var Ov = [" ", "Enter", "ArrowUp", "ArrowDown"], $v = [" ", "Enter"], Lt = "Sele
|
|
|
7010
7010
|
{
|
|
7011
7011
|
scope: e.__scopeSelect,
|
|
7012
7012
|
onNativeOptionAdd: l.useCallback((U) => {
|
|
7013
|
-
G((
|
|
7013
|
+
G((D) => new Set(D).add(U));
|
|
7014
7014
|
}, []),
|
|
7015
7015
|
onNativeOptionRemove: l.useCallback((U) => {
|
|
7016
|
-
G((
|
|
7017
|
-
const j = new Set(
|
|
7016
|
+
G((D) => {
|
|
7017
|
+
const j = new Set(D);
|
|
7018
7018
|
return j.delete(U), j;
|
|
7019
7019
|
});
|
|
7020
7020
|
}, []),
|
|
@@ -7029,12 +7029,12 @@ var Ov = [" ", "Enter", "ArrowUp", "ArrowDown"], $v = [" ", "Enter"], Lt = "Sele
|
|
|
7029
7029
|
tabIndex: -1,
|
|
7030
7030
|
name: p,
|
|
7031
7031
|
autoComplete: f,
|
|
7032
|
-
value:
|
|
7033
|
-
onChange: (U) =>
|
|
7032
|
+
value: O,
|
|
7033
|
+
onChange: (U) => L(U.target.value),
|
|
7034
7034
|
disabled: m,
|
|
7035
7035
|
form: v,
|
|
7036
7036
|
children: [
|
|
7037
|
-
|
|
7037
|
+
O === void 0 ? /* @__PURE__ */ u("option", { value: "" }) : null,
|
|
7038
7038
|
Array.from(I)
|
|
7039
7039
|
]
|
|
7040
7040
|
},
|
|
@@ -7153,62 +7153,62 @@ var Ze = 10, [hl, Pt] = sr(Ft), jv = "SelectContentImpl", Uv = /* @__PURE__ */ X
|
|
|
7153
7153
|
avoidCollisions: b,
|
|
7154
7154
|
//
|
|
7155
7155
|
...y
|
|
7156
|
-
} = e, w = _t(Ft, r), [S, C] = l.useState(null), [N, A] = l.useState(null), _ = ie(t, (
|
|
7156
|
+
} = e, w = _t(Ft, r), [S, C] = l.useState(null), [N, A] = l.useState(null), _ = ie(t, ($) => C($)), [F, O] = l.useState(null), [L, T] = l.useState(
|
|
7157
7157
|
null
|
|
7158
7158
|
), M = kn(r), [I, G] = l.useState(!1), X = l.useRef(!1);
|
|
7159
7159
|
l.useEffect(() => {
|
|
7160
7160
|
if (S) return ts(S);
|
|
7161
7161
|
}, [S]), jo();
|
|
7162
7162
|
const U = l.useCallback(
|
|
7163
|
-
(
|
|
7163
|
+
($) => {
|
|
7164
7164
|
const [J, ...Z] = M().map((z) => z.ref.current), [oe] = Z.slice(-1), ee = document.activeElement;
|
|
7165
|
-
for (const z of
|
|
7165
|
+
for (const z of $)
|
|
7166
7166
|
if (z === ee || (z == null || z.scrollIntoView({ block: "nearest" }), z === J && N && (N.scrollTop = 0), z === oe && N && (N.scrollTop = N.scrollHeight), z == null || z.focus(), document.activeElement !== ee)) return;
|
|
7167
7167
|
},
|
|
7168
7168
|
[M, N]
|
|
7169
|
-
),
|
|
7170
|
-
() => U([
|
|
7171
|
-
[U,
|
|
7169
|
+
), D = l.useCallback(
|
|
7170
|
+
() => U([F, S]),
|
|
7171
|
+
[U, F, S]
|
|
7172
7172
|
);
|
|
7173
7173
|
l.useEffect(() => {
|
|
7174
|
-
I &&
|
|
7175
|
-
}, [I,
|
|
7174
|
+
I && D();
|
|
7175
|
+
}, [I, D]);
|
|
7176
7176
|
const { onOpenChange: j, triggerPointerDownPosRef: V } = w;
|
|
7177
7177
|
l.useEffect(() => {
|
|
7178
7178
|
if (S) {
|
|
7179
|
-
let
|
|
7179
|
+
let $ = { x: 0, y: 0 };
|
|
7180
7180
|
const J = (oe) => {
|
|
7181
7181
|
var ee, z;
|
|
7182
|
-
|
|
7182
|
+
$ = {
|
|
7183
7183
|
x: Math.abs(Math.round(oe.pageX) - (((ee = V.current) == null ? void 0 : ee.x) ?? 0)),
|
|
7184
7184
|
y: Math.abs(Math.round(oe.pageY) - (((z = V.current) == null ? void 0 : z.y) ?? 0))
|
|
7185
7185
|
};
|
|
7186
7186
|
}, Z = (oe) => {
|
|
7187
|
-
|
|
7187
|
+
$.x <= 10 && $.y <= 10 ? oe.preventDefault() : S.contains(oe.target) || j(!1), document.removeEventListener("pointermove", J), V.current = null;
|
|
7188
7188
|
};
|
|
7189
7189
|
return V.current !== null && (document.addEventListener("pointermove", J), document.addEventListener("pointerup", Z, { capture: !0, once: !0 })), () => {
|
|
7190
7190
|
document.removeEventListener("pointermove", J), document.removeEventListener("pointerup", Z, { capture: !0 });
|
|
7191
7191
|
};
|
|
7192
7192
|
}
|
|
7193
7193
|
}, [S, j, V]), l.useEffect(() => {
|
|
7194
|
-
const
|
|
7195
|
-
return window.addEventListener("blur",
|
|
7196
|
-
window.removeEventListener("blur",
|
|
7194
|
+
const $ = () => j(!1);
|
|
7195
|
+
return window.addEventListener("blur", $), window.addEventListener("resize", $), () => {
|
|
7196
|
+
window.removeEventListener("blur", $), window.removeEventListener("resize", $);
|
|
7197
7197
|
};
|
|
7198
7198
|
}, [j]);
|
|
7199
|
-
const [ne, W] = Dl((
|
|
7200
|
-
const J = M().filter((ee) => !ee.disabled), Z = J.find((ee) => ee.ref.current === document.activeElement), oe = Ol(J,
|
|
7199
|
+
const [ne, W] = Dl(($) => {
|
|
7200
|
+
const J = M().filter((ee) => !ee.disabled), Z = J.find((ee) => ee.ref.current === document.activeElement), oe = Ol(J, $, Z);
|
|
7201
7201
|
oe && setTimeout(() => oe.ref.current.focus());
|
|
7202
7202
|
}), re = l.useCallback(
|
|
7203
|
-
(
|
|
7203
|
+
($, J, Z) => {
|
|
7204
7204
|
const oe = !X.current && !Z;
|
|
7205
|
-
(w.value !== void 0 && w.value === J || oe) && (
|
|
7205
|
+
(w.value !== void 0 && w.value === J || oe) && (O($), oe && (X.current = !0));
|
|
7206
7206
|
},
|
|
7207
7207
|
[w.value]
|
|
7208
7208
|
), ce = l.useCallback(() => S == null ? void 0 : S.focus(), [S]), de = l.useCallback(
|
|
7209
|
-
(
|
|
7209
|
+
($, J, Z) => {
|
|
7210
7210
|
const oe = !X.current && !Z;
|
|
7211
|
-
(w.value !== void 0 && w.value === J || oe) && T(
|
|
7211
|
+
(w.value !== void 0 && w.value === J || oe) && T($);
|
|
7212
7212
|
},
|
|
7213
7213
|
[w.value]
|
|
7214
7214
|
), ge = n === "popper" ? xo : vl, me = ge === xo ? {
|
|
@@ -7231,11 +7231,11 @@ var Ze = 10, [hl, Pt] = sr(Ft), jv = "SelectContentImpl", Uv = /* @__PURE__ */ X
|
|
|
7231
7231
|
viewport: N,
|
|
7232
7232
|
onViewportChange: A,
|
|
7233
7233
|
itemRefCallback: re,
|
|
7234
|
-
selectedItem:
|
|
7234
|
+
selectedItem: F,
|
|
7235
7235
|
onItemLeave: ce,
|
|
7236
7236
|
itemTextRefCallback: de,
|
|
7237
|
-
focusSelectedItem:
|
|
7238
|
-
selectedItemText:
|
|
7237
|
+
focusSelectedItem: D,
|
|
7238
|
+
selectedItemText: L,
|
|
7239
7239
|
position: n,
|
|
7240
7240
|
isPositioned: I,
|
|
7241
7241
|
searchRef: ne,
|
|
@@ -7244,12 +7244,12 @@ var Ze = 10, [hl, Pt] = sr(Ft), jv = "SelectContentImpl", Uv = /* @__PURE__ */ X
|
|
|
7244
7244
|
{
|
|
7245
7245
|
asChild: !0,
|
|
7246
7246
|
trapped: w.open,
|
|
7247
|
-
onMountAutoFocus: (
|
|
7248
|
-
|
|
7247
|
+
onMountAutoFocus: ($) => {
|
|
7248
|
+
$.preventDefault();
|
|
7249
7249
|
},
|
|
7250
|
-
onUnmountAutoFocus: K(o, (
|
|
7250
|
+
onUnmountAutoFocus: K(o, ($) => {
|
|
7251
7251
|
var J;
|
|
7252
|
-
(J = w.trigger) == null || J.focus({ preventScroll: !0 }),
|
|
7252
|
+
(J = w.trigger) == null || J.focus({ preventScroll: !0 }), $.preventDefault();
|
|
7253
7253
|
}),
|
|
7254
7254
|
children: /* @__PURE__ */ u(
|
|
7255
7255
|
Ar,
|
|
@@ -7258,7 +7258,7 @@ var Ze = 10, [hl, Pt] = sr(Ft), jv = "SelectContentImpl", Uv = /* @__PURE__ */ X
|
|
|
7258
7258
|
disableOutsidePointerEvents: !0,
|
|
7259
7259
|
onEscapeKeyDown: s,
|
|
7260
7260
|
onPointerDownOutside: i,
|
|
7261
|
-
onFocusOutside: (
|
|
7261
|
+
onFocusOutside: ($) => $.preventDefault(),
|
|
7262
7262
|
onDismiss: () => w.onOpenChange(!1),
|
|
7263
7263
|
children: /* @__PURE__ */ u(
|
|
7264
7264
|
ge,
|
|
@@ -7267,7 +7267,7 @@ var Ze = 10, [hl, Pt] = sr(Ft), jv = "SelectContentImpl", Uv = /* @__PURE__ */ X
|
|
|
7267
7267
|
id: w.contentId,
|
|
7268
7268
|
"data-state": w.open ? "open" : "closed",
|
|
7269
7269
|
dir: w.dir,
|
|
7270
|
-
onContextMenu: (
|
|
7270
|
+
onContextMenu: ($) => $.preventDefault(),
|
|
7271
7271
|
...y,
|
|
7272
7272
|
...me,
|
|
7273
7273
|
onPlaced: () => G(!0),
|
|
@@ -7280,15 +7280,15 @@ var Ze = 10, [hl, Pt] = sr(Ft), jv = "SelectContentImpl", Uv = /* @__PURE__ */ X
|
|
|
7280
7280
|
outline: "none",
|
|
7281
7281
|
...y.style
|
|
7282
7282
|
},
|
|
7283
|
-
onKeyDown: K(y.onKeyDown, (
|
|
7284
|
-
const J =
|
|
7285
|
-
if (
|
|
7283
|
+
onKeyDown: K(y.onKeyDown, ($) => {
|
|
7284
|
+
const J = $.ctrlKey || $.altKey || $.metaKey;
|
|
7285
|
+
if ($.key === "Tab" && $.preventDefault(), !J && $.key.length === 1 && W($.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes($.key)) {
|
|
7286
7286
|
let oe = M().filter((ee) => !ee.disabled).map((ee) => ee.ref.current);
|
|
7287
|
-
if (["ArrowUp", "End"].includes(
|
|
7288
|
-
const ee =
|
|
7287
|
+
if (["ArrowUp", "End"].includes($.key) && (oe = oe.slice().reverse()), ["ArrowUp", "ArrowDown"].includes($.key)) {
|
|
7288
|
+
const ee = $.target, z = oe.indexOf(ee);
|
|
7289
7289
|
oe = oe.slice(z + 1);
|
|
7290
7290
|
}
|
|
7291
|
-
setTimeout(() => U(oe)),
|
|
7291
|
+
setTimeout(() => U(oe)), $.preventDefault();
|
|
7292
7292
|
}
|
|
7293
7293
|
})
|
|
7294
7294
|
}
|
|
@@ -7305,33 +7305,33 @@ gl.displayName = jv;
|
|
|
7305
7305
|
var zv = "SelectItemAlignedPosition", vl = l.forwardRef((e, t) => {
|
|
7306
7306
|
const { __scopeSelect: r, onPlaced: n, ...o } = e, s = _t(Ft, r), i = Pt(Ft, r), [a, c] = l.useState(null), [d, p] = l.useState(null), f = ie(t, (_) => p(_)), m = kn(r), g = l.useRef(!1), v = l.useRef(!0), { viewport: h, selectedItem: b, selectedItemText: y, focusSelectedItem: w } = i, S = l.useCallback(() => {
|
|
7307
7307
|
if (s.trigger && s.valueNode && a && d && h && b && y) {
|
|
7308
|
-
const _ = s.trigger.getBoundingClientRect(),
|
|
7308
|
+
const _ = s.trigger.getBoundingClientRect(), F = d.getBoundingClientRect(), O = s.valueNode.getBoundingClientRect(), L = y.getBoundingClientRect();
|
|
7309
7309
|
if (s.dir !== "rtl") {
|
|
7310
|
-
const ee =
|
|
7310
|
+
const ee = L.left - F.left, z = O.left - ee, te = _.left - z, be = _.width + te, ve = Math.max(be, F.width), De = window.innerWidth - Ze, Oe = ho(z, [
|
|
7311
7311
|
Ze,
|
|
7312
7312
|
// Prevents the content from going off the starting edge of the
|
|
7313
7313
|
// viewport. It may still go off the ending edge, but this can be
|
|
7314
7314
|
// controlled by the user since they may want to manage overflow in a
|
|
7315
7315
|
// specific way.
|
|
7316
7316
|
// https://github.com/radix-ui/primitives/issues/2049
|
|
7317
|
-
Math.max(Ze,
|
|
7317
|
+
Math.max(Ze, De - ve)
|
|
7318
7318
|
]);
|
|
7319
|
-
a.style.minWidth = be + "px", a.style.left =
|
|
7319
|
+
a.style.minWidth = be + "px", a.style.left = Oe + "px";
|
|
7320
7320
|
} else {
|
|
7321
|
-
const ee =
|
|
7321
|
+
const ee = F.right - L.right, z = window.innerWidth - O.right - ee, te = window.innerWidth - _.right - z, be = _.width + te, ve = Math.max(be, F.width), De = window.innerWidth - Ze, Oe = ho(z, [
|
|
7322
7322
|
Ze,
|
|
7323
|
-
Math.max(Ze,
|
|
7323
|
+
Math.max(Ze, De - ve)
|
|
7324
7324
|
]);
|
|
7325
|
-
a.style.minWidth = be + "px", a.style.right =
|
|
7325
|
+
a.style.minWidth = be + "px", a.style.right = Oe + "px";
|
|
7326
7326
|
}
|
|
7327
|
-
const T = m(), M = window.innerHeight - Ze * 2, I = h.scrollHeight, G = window.getComputedStyle(d), X = parseInt(G.borderTopWidth, 10), U = parseInt(G.paddingTop, 10),
|
|
7327
|
+
const T = m(), M = window.innerHeight - Ze * 2, I = h.scrollHeight, G = window.getComputedStyle(d), X = parseInt(G.borderTopWidth, 10), U = parseInt(G.paddingTop, 10), D = parseInt(G.borderBottomWidth, 10), j = parseInt(G.paddingBottom, 10), V = X + U + I + j + D, ne = Math.min(b.offsetHeight * 5, V), W = window.getComputedStyle(h), re = parseInt(W.paddingTop, 10), ce = parseInt(W.paddingBottom, 10), de = _.top + _.height / 2 - Ze, ge = M - de, me = b.offsetHeight / 2, $ = b.offsetTop + me, J = X + U + $, Z = V - J;
|
|
7328
7328
|
if (J <= de) {
|
|
7329
7329
|
const ee = T.length > 0 && b === T[T.length - 1].ref.current;
|
|
7330
7330
|
a.style.bottom = "0px";
|
|
7331
7331
|
const z = d.clientHeight - h.offsetTop - h.offsetHeight, te = Math.max(
|
|
7332
7332
|
ge,
|
|
7333
7333
|
me + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
7334
|
-
(ee ? ce : 0) + z +
|
|
7334
|
+
(ee ? ce : 0) + z + D
|
|
7335
7335
|
), be = J + te;
|
|
7336
7336
|
a.style.height = be + "px";
|
|
7337
7337
|
} else {
|
|
@@ -8051,13 +8051,13 @@ var is = "DialogPortal", [xy, Ql] = Yl(is, {
|
|
|
8051
8051
|
forceMount: void 0
|
|
8052
8052
|
}), Jl = (e) => {
|
|
8053
8053
|
const { __scopeDialog: t, forceMount: r, children: n, container: o } = e, s = ot(is, t);
|
|
8054
|
-
return /* @__PURE__ */ u(xy, { scope: t, forceMount: r, children: l.Children.map(n, (i) => /* @__PURE__ */ u(
|
|
8054
|
+
return /* @__PURE__ */ u(xy, { scope: t, forceMount: r, children: l.Children.map(n, (i) => /* @__PURE__ */ u(Fe, { present: r || s.open, children: /* @__PURE__ */ u(Pn, { asChild: !0, container: o, children: i }) })) });
|
|
8055
8055
|
};
|
|
8056
8056
|
Jl.displayName = is;
|
|
8057
8057
|
var sn = "DialogOverlay", ec = l.forwardRef(
|
|
8058
8058
|
(e, t) => {
|
|
8059
8059
|
const r = Ql(sn, e.__scopeDialog), { forceMount: n = r.forceMount, ...o } = e, s = ot(sn, e.__scopeDialog);
|
|
8060
|
-
return s.modal ? /* @__PURE__ */ u(
|
|
8060
|
+
return s.modal ? /* @__PURE__ */ u(Fe, { present: n || s.open, children: /* @__PURE__ */ u(Cy, { ...o, ref: t }) }) : null;
|
|
8061
8061
|
}
|
|
8062
8062
|
);
|
|
8063
8063
|
ec.displayName = sn;
|
|
@@ -8081,7 +8081,7 @@ var Sy = /* @__PURE__ */ Kl("DialogOverlay.RemoveScroll"), Cy = l.forwardRef(
|
|
|
8081
8081
|
), Vt = "DialogContent", tc = l.forwardRef(
|
|
8082
8082
|
(e, t) => {
|
|
8083
8083
|
const r = Ql(Vt, e.__scopeDialog), { forceMount: n = r.forceMount, ...o } = e, s = ot(Vt, e.__scopeDialog);
|
|
8084
|
-
return /* @__PURE__ */ u(
|
|
8084
|
+
return /* @__PURE__ */ u(Fe, { present: n || s.open, children: s.modal ? /* @__PURE__ */ u(Ny, { ...o, ref: t }) : /* @__PURE__ */ u(Ey, { ...o, ref: t }) });
|
|
8085
8085
|
}
|
|
8086
8086
|
);
|
|
8087
8087
|
tc.displayName = Vt;
|
|
@@ -8499,9 +8499,9 @@ var Xy = l.forwardRef((e, t) => {
|
|
|
8499
8499
|
caller: kr
|
|
8500
8500
|
}), [y, w] = l.useState(!1), S = Pe(d), C = xc(r), N = l.useRef(!1), [A, _] = l.useState(0);
|
|
8501
8501
|
return l.useEffect(() => {
|
|
8502
|
-
const
|
|
8503
|
-
if (
|
|
8504
|
-
return
|
|
8502
|
+
const F = m.current;
|
|
8503
|
+
if (F)
|
|
8504
|
+
return F.addEventListener(io, S), () => F.removeEventListener(io, S);
|
|
8505
8505
|
}, [S]), /* @__PURE__ */ u(
|
|
8506
8506
|
Yy,
|
|
8507
8507
|
{
|
|
@@ -8511,16 +8511,16 @@ var Xy = l.forwardRef((e, t) => {
|
|
|
8511
8511
|
loop: o,
|
|
8512
8512
|
currentTabStopId: h,
|
|
8513
8513
|
onItemFocus: l.useCallback(
|
|
8514
|
-
(
|
|
8514
|
+
(F) => b(F),
|
|
8515
8515
|
[b]
|
|
8516
8516
|
),
|
|
8517
8517
|
onItemShiftTab: l.useCallback(() => w(!0), []),
|
|
8518
8518
|
onFocusableItemAdd: l.useCallback(
|
|
8519
|
-
() => _((
|
|
8519
|
+
() => _((F) => F + 1),
|
|
8520
8520
|
[]
|
|
8521
8521
|
),
|
|
8522
8522
|
onFocusableItemRemove: l.useCallback(
|
|
8523
|
-
() => _((
|
|
8523
|
+
() => _((F) => F - 1),
|
|
8524
8524
|
[]
|
|
8525
8525
|
),
|
|
8526
8526
|
children: /* @__PURE__ */ u(
|
|
@@ -8534,11 +8534,11 @@ var Xy = l.forwardRef((e, t) => {
|
|
|
8534
8534
|
onMouseDown: K(e.onMouseDown, () => {
|
|
8535
8535
|
N.current = !0;
|
|
8536
8536
|
}),
|
|
8537
|
-
onFocus: K(e.onFocus, (
|
|
8538
|
-
const
|
|
8539
|
-
if (
|
|
8540
|
-
const
|
|
8541
|
-
if (
|
|
8537
|
+
onFocus: K(e.onFocus, (F) => {
|
|
8538
|
+
const O = !N.current;
|
|
8539
|
+
if (F.target === F.currentTarget && O && !y) {
|
|
8540
|
+
const L = new CustomEvent(io, zy);
|
|
8541
|
+
if (F.currentTarget.dispatchEvent(L), !L.defaultPrevented) {
|
|
8542
8542
|
const T = C().filter((U) => U.focusable), M = T.find((U) => U.active), I = T.find((U) => U.id === h), X = [M, I, ...T].filter(
|
|
8543
8543
|
Boolean
|
|
8544
8544
|
).map((U) => U.ref.current);
|
|
@@ -8820,7 +8820,7 @@ var Dc = "TabsContent", Oc = l.forwardRef(
|
|
|
8820
8820
|
return l.useEffect(() => {
|
|
8821
8821
|
const m = requestAnimationFrame(() => f.current = !1);
|
|
8822
8822
|
return () => cancelAnimationFrame(m);
|
|
8823
|
-
}, []), /* @__PURE__ */ u(
|
|
8823
|
+
}, []), /* @__PURE__ */ u(Fe, { present: o || p, children: ({ present: m }) => /* @__PURE__ */ u(
|
|
8824
8824
|
$n.div,
|
|
8825
8825
|
{
|
|
8826
8826
|
"data-state": p ? "active" : "inactive",
|
|
@@ -9471,7 +9471,7 @@ var Fb = "TooltipPortal", [fC, Vb] = Fn(Fb, {
|
|
|
9471
9471
|
}), Jt = "TooltipContent", ou = l.forwardRef(
|
|
9472
9472
|
(e, t) => {
|
|
9473
9473
|
const r = Vb(Jt, e.__scopeTooltip), { forceMount: n = r.forceMount, side: o = "top", ...s } = e, i = Wn(Jt, e.__scopeTooltip);
|
|
9474
|
-
return /* @__PURE__ */ u(
|
|
9474
|
+
return /* @__PURE__ */ u(Fe, { present: n || i.open, children: i.disableHoverableContent ? /* @__PURE__ */ u(su, { side: o, ...s, ref: t }) : /* @__PURE__ */ u(Wb, { side: o, ...s, ref: t }) });
|
|
9475
9475
|
}
|
|
9476
9476
|
), Wb = l.forwardRef((e, t) => {
|
|
9477
9477
|
const r = Wn(Jt, e.__scopeTooltip), n = fs(Jt, e.__scopeTooltip), o = l.useRef(null), s = ie(t, o), [i, a] = l.useState(null), { trigger: c, onClose: d } = r, p = o.current, { onPointerInTransitChange: f } = n, m = l.useCallback(() => {
|
|
@@ -9962,13 +9962,13 @@ var ms = "MenuPortal", [Pw, mu] = Wt(ms, {
|
|
|
9962
9962
|
forceMount: void 0
|
|
9963
9963
|
}), hu = (e) => {
|
|
9964
9964
|
const { __scopeMenu: t, forceMount: r, children: n, container: o } = e, s = At(ms, t);
|
|
9965
|
-
return /* @__PURE__ */ u(Pw, { scope: t, forceMount: r, children: /* @__PURE__ */ u(
|
|
9965
|
+
return /* @__PURE__ */ u(Pw, { scope: t, forceMount: r, children: /* @__PURE__ */ u(Fe, { present: r || s.open, children: /* @__PURE__ */ u(Pn, { asChild: !0, container: o, children: n }) }) });
|
|
9966
9966
|
};
|
|
9967
9967
|
hu.displayName = ms;
|
|
9968
9968
|
var Ye = "MenuContent", [Aw, hs] = Wt(Ye), gu = l.forwardRef(
|
|
9969
9969
|
(e, t) => {
|
|
9970
9970
|
const r = mu(Ye, e.__scopeMenu), { forceMount: n = r.forceMount, ...o } = e, s = At(Ye, e.__scopeMenu), i = $r(Ye, e.__scopeMenu);
|
|
9971
|
-
return /* @__PURE__ */ u(Cr.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u(
|
|
9971
|
+
return /* @__PURE__ */ u(Cr.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u(Fe, { present: n || s.open, children: /* @__PURE__ */ u(Cr.Slot, { scope: e.__scopeMenu, children: i.modal ? /* @__PURE__ */ u(Tw, { ...o, ref: t }) : /* @__PURE__ */ u(Mw, { ...o, ref: t }) }) }) });
|
|
9972
9972
|
}
|
|
9973
9973
|
), Tw = l.forwardRef(
|
|
9974
9974
|
(e, t) => {
|
|
@@ -10023,14 +10023,14 @@ var Ye = "MenuContent", [Aw, hs] = Wt(Ye), gu = l.forwardRef(
|
|
|
10023
10023
|
onDismiss: g,
|
|
10024
10024
|
disableOutsideScroll: v,
|
|
10025
10025
|
...h
|
|
10026
|
-
} = e, b = At(Ye, r), y = $r(Ye, r), w = Or(r), S = du(r), C = Nw(r), [N, A] = l.useState(null), _ = l.useRef(null),
|
|
10027
|
-
var
|
|
10028
|
-
const ne =
|
|
10026
|
+
} = e, b = At(Ye, r), y = $r(Ye, r), w = Or(r), S = du(r), C = Nw(r), [N, A] = l.useState(null), _ = l.useRef(null), F = ie(t, _, b.onContentChange), O = l.useRef(0), L = l.useRef(""), T = l.useRef(0), M = l.useRef(null), I = l.useRef("right"), G = l.useRef(0), X = v ? Tn : l.Fragment, U = v ? { as: kw, allowPinchZoom: !0 } : void 0, D = (V) => {
|
|
10027
|
+
var $, J;
|
|
10028
|
+
const ne = L.current + V, W = C().filter((Z) => !Z.disabled), re = document.activeElement, ce = ($ = W.find((Z) => Z.ref.current === re)) == null ? void 0 : $.textValue, de = W.map((Z) => Z.textValue), ge = Uw(de, ne, ce), me = (J = W.find((Z) => Z.textValue === ge)) == null ? void 0 : J.ref.current;
|
|
10029
10029
|
(function Z(oe) {
|
|
10030
|
-
|
|
10030
|
+
L.current = oe, window.clearTimeout(O.current), oe !== "" && (O.current = window.setTimeout(() => Z(""), 1e3));
|
|
10031
10031
|
})(ne), me && setTimeout(() => me.focus());
|
|
10032
10032
|
};
|
|
10033
|
-
l.useEffect(() => () => window.clearTimeout(
|
|
10033
|
+
l.useEffect(() => () => window.clearTimeout(O.current), []), jo();
|
|
10034
10034
|
const j = l.useCallback((V) => {
|
|
10035
10035
|
var W, re;
|
|
10036
10036
|
return I.current === ((W = M.current) == null ? void 0 : W.side) && Gw(V, (re = M.current) == null ? void 0 : re.area);
|
|
@@ -10039,7 +10039,7 @@ var Ye = "MenuContent", [Aw, hs] = Wt(Ye), gu = l.forwardRef(
|
|
|
10039
10039
|
Aw,
|
|
10040
10040
|
{
|
|
10041
10041
|
scope: r,
|
|
10042
|
-
searchRef:
|
|
10042
|
+
searchRef: L,
|
|
10043
10043
|
onItemEnter: l.useCallback(
|
|
10044
10044
|
(V) => {
|
|
10045
10045
|
j(V) && V.preventDefault();
|
|
@@ -10107,19 +10107,19 @@ var Ye = "MenuContent", [Aw, hs] = Wt(Ye), gu = l.forwardRef(
|
|
|
10107
10107
|
dir: y.dir,
|
|
10108
10108
|
...w,
|
|
10109
10109
|
...h,
|
|
10110
|
-
ref:
|
|
10110
|
+
ref: F,
|
|
10111
10111
|
style: { outline: "none", ...h.style },
|
|
10112
10112
|
onKeyDown: K(h.onKeyDown, (V) => {
|
|
10113
10113
|
const W = V.target.closest("[data-radix-menu-content]") === V.currentTarget, re = V.ctrlKey || V.altKey || V.metaKey, ce = V.key.length === 1;
|
|
10114
|
-
W && (V.key === "Tab" && V.preventDefault(), !re && ce &&
|
|
10114
|
+
W && (V.key === "Tab" && V.preventDefault(), !re && ce && D(V.key));
|
|
10115
10115
|
const de = _.current;
|
|
10116
10116
|
if (V.target !== de || !xw.includes(V.key)) return;
|
|
10117
10117
|
V.preventDefault();
|
|
10118
|
-
const me = C().filter((
|
|
10118
|
+
const me = C().filter(($) => !$.disabled).map(($) => $.ref.current);
|
|
10119
10119
|
cu.includes(V.key) && me.reverse(), Hw(me);
|
|
10120
10120
|
}),
|
|
10121
10121
|
onBlur: K(e.onBlur, (V) => {
|
|
10122
|
-
V.currentTarget.contains(V.target) || (window.clearTimeout(
|
|
10122
|
+
V.currentTarget.contains(V.target) || (window.clearTimeout(O.current), L.current = "");
|
|
10123
10123
|
}),
|
|
10124
10124
|
onPointerMove: K(
|
|
10125
10125
|
e.onPointerMove,
|
|
@@ -10292,7 +10292,7 @@ var ys = "MenuItemIndicator", [Nu, Fw] = Wt(
|
|
|
10292
10292
|
(e, t) => {
|
|
10293
10293
|
const { __scopeMenu: r, forceMount: n, ...o } = e, s = Fw(ys, r);
|
|
10294
10294
|
return /* @__PURE__ */ u(
|
|
10295
|
-
|
|
10295
|
+
Fe,
|
|
10296
10296
|
{
|
|
10297
10297
|
present: n || ln(s.checked) || s.checked === !0,
|
|
10298
10298
|
children: /* @__PURE__ */ u(
|
|
@@ -10429,7 +10429,7 @@ Tu.displayName = ur;
|
|
|
10429
10429
|
var Mu = "MenuSubContent", ku = l.forwardRef(
|
|
10430
10430
|
(e, t) => {
|
|
10431
10431
|
const r = mu(Ye, e.__scopeMenu), { forceMount: n = r.forceMount, ...o } = e, s = At(Ye, e.__scopeMenu), i = $r(Ye, e.__scopeMenu), a = Pu(Mu, e.__scopeMenu), c = l.useRef(null), d = ie(t, c);
|
|
10432
|
-
return /* @__PURE__ */ u(Cr.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u(
|
|
10432
|
+
return /* @__PURE__ */ u(Cr.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u(Fe, { present: n || s.open, children: /* @__PURE__ */ u(Cr.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ u(
|
|
10433
10433
|
gs,
|
|
10434
10434
|
{
|
|
10435
10435
|
id: a.contentId,
|
|
@@ -10941,13 +10941,13 @@ var Cs = "ScrollArea", [cd] = Hx(Cs), [zx, qe] = cd(Cs), ud = l.forwardRef(
|
|
|
10941
10941
|
dir: o,
|
|
10942
10942
|
scrollHideDelay: s = 600,
|
|
10943
10943
|
...i
|
|
10944
|
-
} = e, [a, c] = l.useState(null), [d, p] = l.useState(null), [f, m] = l.useState(null), [g, v] = l.useState(null), [h, b] = l.useState(null), [y, w] = l.useState(0), [S, C] = l.useState(0), [N, A] = l.useState(!1), [_,
|
|
10944
|
+
} = e, [a, c] = l.useState(null), [d, p] = l.useState(null), [f, m] = l.useState(null), [g, v] = l.useState(null), [h, b] = l.useState(null), [y, w] = l.useState(0), [S, C] = l.useState(0), [N, A] = l.useState(!1), [_, F] = l.useState(!1), O = ie(t, (T) => c(T)), L = Pr(o);
|
|
10945
10945
|
return /* @__PURE__ */ u(
|
|
10946
10946
|
zx,
|
|
10947
10947
|
{
|
|
10948
10948
|
scope: r,
|
|
10949
10949
|
type: n,
|
|
10950
|
-
dir:
|
|
10950
|
+
dir: L,
|
|
10951
10951
|
scrollHideDelay: s,
|
|
10952
10952
|
scrollArea: a,
|
|
10953
10953
|
viewport: d,
|
|
@@ -10961,15 +10961,15 @@ var Cs = "ScrollArea", [cd] = Hx(Cs), [zx, qe] = cd(Cs), ud = l.forwardRef(
|
|
|
10961
10961
|
scrollbarY: h,
|
|
10962
10962
|
onScrollbarYChange: b,
|
|
10963
10963
|
scrollbarYEnabled: _,
|
|
10964
|
-
onScrollbarYEnabledChange:
|
|
10964
|
+
onScrollbarYEnabledChange: F,
|
|
10965
10965
|
onCornerWidthChange: w,
|
|
10966
10966
|
onCornerHeightChange: C,
|
|
10967
10967
|
children: /* @__PURE__ */ u(
|
|
10968
10968
|
Lr.div,
|
|
10969
10969
|
{
|
|
10970
|
-
dir:
|
|
10970
|
+
dir: L,
|
|
10971
10971
|
...i,
|
|
10972
|
-
ref:
|
|
10972
|
+
ref: O,
|
|
10973
10973
|
style: {
|
|
10974
10974
|
position: "relative",
|
|
10975
10975
|
// Pass corner sizes as CSS vars to reduce re-renders of context consumers
|
|
@@ -11050,7 +11050,7 @@ var Gx = l.forwardRef((e, t) => {
|
|
|
11050
11050
|
window.clearTimeout(c), a.removeEventListener("pointerenter", d), a.removeEventListener("pointerleave", p);
|
|
11051
11051
|
};
|
|
11052
11052
|
}
|
|
11053
|
-
}, [o.scrollArea, o.scrollHideDelay]), /* @__PURE__ */ u(
|
|
11053
|
+
}, [o.scrollArea, o.scrollHideDelay]), /* @__PURE__ */ u(Fe, { present: r || s, children: /* @__PURE__ */ u(
|
|
11054
11054
|
pd,
|
|
11055
11055
|
{
|
|
11056
11056
|
"data-state": s ? "visible" : "hidden",
|
|
@@ -11092,7 +11092,7 @@ var Gx = l.forwardRef((e, t) => {
|
|
|
11092
11092
|
};
|
|
11093
11093
|
return d.addEventListener("scroll", m), () => d.removeEventListener("scroll", m);
|
|
11094
11094
|
}
|
|
11095
|
-
}, [o.viewport, s, c, i]), /* @__PURE__ */ u(
|
|
11095
|
+
}, [o.viewport, s, c, i]), /* @__PURE__ */ u(Fe, { present: r || a !== "hidden", children: /* @__PURE__ */ u(
|
|
11096
11096
|
Es,
|
|
11097
11097
|
{
|
|
11098
11098
|
"data-state": a === "hidden" ? "hidden" : "visible",
|
|
@@ -11109,7 +11109,7 @@ var Gx = l.forwardRef((e, t) => {
|
|
|
11109
11109
|
i(a ? d : p);
|
|
11110
11110
|
}
|
|
11111
11111
|
}, 10);
|
|
11112
|
-
return er(r.viewport, c), er(r.content, c), /* @__PURE__ */ u(
|
|
11112
|
+
return er(r.viewport, c), er(r.content, c), /* @__PURE__ */ u(Fe, { present: n || s, children: /* @__PURE__ */ u(
|
|
11113
11113
|
Es,
|
|
11114
11114
|
{
|
|
11115
11115
|
"data-state": s ? "visible" : "hidden",
|
|
@@ -11263,19 +11263,19 @@ var Gx = l.forwardRef((e, t) => {
|
|
|
11263
11263
|
onWheelScroll: p,
|
|
11264
11264
|
onResize: f,
|
|
11265
11265
|
...m
|
|
11266
|
-
} = e, g = qe(pt, r), [v, h] = l.useState(null), b = ie(t, (
|
|
11267
|
-
function
|
|
11266
|
+
} = e, g = qe(pt, r), [v, h] = l.useState(null), b = ie(t, (O) => h(O)), y = l.useRef(null), w = l.useRef(""), S = g.viewport, C = n.content - n.viewport, N = Pe(p), A = Pe(c), _ = Un(f, 10);
|
|
11267
|
+
function F(O) {
|
|
11268
11268
|
if (y.current) {
|
|
11269
|
-
const
|
|
11270
|
-
d({ x:
|
|
11269
|
+
const L = O.clientX - y.current.left, T = O.clientY - y.current.top;
|
|
11270
|
+
d({ x: L, y: T });
|
|
11271
11271
|
}
|
|
11272
11272
|
}
|
|
11273
11273
|
return l.useEffect(() => {
|
|
11274
|
-
const
|
|
11275
|
-
const T =
|
|
11276
|
-
(v == null ? void 0 : v.contains(T)) && N(
|
|
11274
|
+
const O = (L) => {
|
|
11275
|
+
const T = L.target;
|
|
11276
|
+
(v == null ? void 0 : v.contains(T)) && N(L, C);
|
|
11277
11277
|
};
|
|
11278
|
-
return document.addEventListener("wheel",
|
|
11278
|
+
return document.addEventListener("wheel", O, { passive: !1 }), () => document.removeEventListener("wheel", O, { passive: !1 });
|
|
11279
11279
|
}, [S, v, C, N]), l.useEffect(A, [n, A]), er(v, _), er(g.content, _), /* @__PURE__ */ u(
|
|
11280
11280
|
Xx,
|
|
11281
11281
|
{
|
|
@@ -11292,13 +11292,13 @@ var Gx = l.forwardRef((e, t) => {
|
|
|
11292
11292
|
...m,
|
|
11293
11293
|
ref: b,
|
|
11294
11294
|
style: { position: "absolute", ...m.style },
|
|
11295
|
-
onPointerDown: K(e.onPointerDown, (
|
|
11296
|
-
|
|
11295
|
+
onPointerDown: K(e.onPointerDown, (O) => {
|
|
11296
|
+
O.button === 0 && (O.target.setPointerCapture(O.pointerId), y.current = v.getBoundingClientRect(), w.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", g.viewport && (g.viewport.style.scrollBehavior = "auto"), F(O));
|
|
11297
11297
|
}),
|
|
11298
|
-
onPointerMove: K(e.onPointerMove,
|
|
11299
|
-
onPointerUp: K(e.onPointerUp, (
|
|
11300
|
-
const
|
|
11301
|
-
|
|
11298
|
+
onPointerMove: K(e.onPointerMove, F),
|
|
11299
|
+
onPointerUp: K(e.onPointerUp, (O) => {
|
|
11300
|
+
const L = O.target;
|
|
11301
|
+
L.hasPointerCapture(O.pointerId) && L.releasePointerCapture(O.pointerId), document.body.style.webkitUserSelect = w.current, g.viewport && (g.viewport.style.scrollBehavior = ""), y.current = null;
|
|
11302
11302
|
})
|
|
11303
11303
|
}
|
|
11304
11304
|
)
|
|
@@ -11307,7 +11307,7 @@ var Gx = l.forwardRef((e, t) => {
|
|
|
11307
11307
|
}), dn = "ScrollAreaThumb", gd = l.forwardRef(
|
|
11308
11308
|
(e, t) => {
|
|
11309
11309
|
const { forceMount: r, ...n } = e, o = md(dn, e.__scopeScrollArea);
|
|
11310
|
-
return /* @__PURE__ */ u(
|
|
11310
|
+
return /* @__PURE__ */ u(Fe, { present: r || o.hasThumb, children: /* @__PURE__ */ u(Zx, { ref: t, ...n }) });
|
|
11311
11311
|
}
|
|
11312
11312
|
), Zx = l.forwardRef(
|
|
11313
11313
|
(e, t) => {
|
|
@@ -11625,14 +11625,14 @@ const Ad = l.forwardRef(({
|
|
|
11625
11625
|
loadingMessage: y = "Loading...",
|
|
11626
11626
|
...w
|
|
11627
11627
|
}, S) => {
|
|
11628
|
-
const [C, N] = l.useState(!1), [A, _] = l.useState(""), [
|
|
11628
|
+
const [C, N] = l.useState(!1), [A, _] = l.useState(""), [F, O] = l.useState(0), L = l.useRef(null), T = l.useRef(null), M = l.useMemo(() => A ? h ? e.filter((W) => h(W, A)) : e.filter((W) => g(W).toLowerCase().includes(A.toLowerCase())) : e, [e, A, h, g]), I = l.useMemo(
|
|
11629
11629
|
() => Kf((W) => {
|
|
11630
11630
|
n == null || n(W);
|
|
11631
11631
|
}, 300),
|
|
11632
11632
|
[n]
|
|
11633
11633
|
), G = (W) => {
|
|
11634
11634
|
const re = W.target.value;
|
|
11635
|
-
_(re),
|
|
11635
|
+
_(re), O(0), I(re);
|
|
11636
11636
|
}, X = (W) => {
|
|
11637
11637
|
if (c) {
|
|
11638
11638
|
const re = Array.isArray(t) ? t : [], ce = v(W);
|
|
@@ -11641,22 +11641,22 @@ const Ad = l.forwardRef(({
|
|
|
11641
11641
|
r == null || r(W), N(!1), _("");
|
|
11642
11642
|
}, U = (W) => {
|
|
11643
11643
|
W.stopPropagation(), r == null || r(c ? [] : null), _("");
|
|
11644
|
-
},
|
|
11644
|
+
}, D = (W) => {
|
|
11645
11645
|
if (!C) {
|
|
11646
11646
|
(W.key === "Enter" || W.key === " " || W.key === "ArrowDown") && (W.preventDefault(), N(!0));
|
|
11647
11647
|
return;
|
|
11648
11648
|
}
|
|
11649
11649
|
switch (W.key) {
|
|
11650
11650
|
case "ArrowDown":
|
|
11651
|
-
W.preventDefault(),
|
|
11651
|
+
W.preventDefault(), O(
|
|
11652
11652
|
(re) => Math.min(re + 1, M.length - 1)
|
|
11653
11653
|
);
|
|
11654
11654
|
break;
|
|
11655
11655
|
case "ArrowUp":
|
|
11656
|
-
W.preventDefault(),
|
|
11656
|
+
W.preventDefault(), O((re) => Math.max(re - 1, 0));
|
|
11657
11657
|
break;
|
|
11658
11658
|
case "Enter":
|
|
11659
|
-
W.preventDefault(), M[
|
|
11659
|
+
W.preventDefault(), M[F] && X(M[F]);
|
|
11660
11660
|
break;
|
|
11661
11661
|
case "Escape":
|
|
11662
11662
|
W.preventDefault(), N(!1), _("");
|
|
@@ -11665,7 +11665,7 @@ const Ad = l.forwardRef(({
|
|
|
11665
11665
|
};
|
|
11666
11666
|
l.useEffect(() => {
|
|
11667
11667
|
const W = (re) => {
|
|
11668
|
-
|
|
11668
|
+
L.current && !L.current.contains(re.target) && (N(!1), _(""));
|
|
11669
11669
|
};
|
|
11670
11670
|
return document.addEventListener("mousedown", W), () => document.removeEventListener("mousedown", W);
|
|
11671
11671
|
}, []);
|
|
@@ -11682,7 +11682,7 @@ const Ad = l.forwardRef(({
|
|
|
11682
11682
|
return /* @__PURE__ */ R(
|
|
11683
11683
|
"div",
|
|
11684
11684
|
{
|
|
11685
|
-
ref:
|
|
11685
|
+
ref: L,
|
|
11686
11686
|
className: k("relative w-full", p),
|
|
11687
11687
|
...w,
|
|
11688
11688
|
children: [
|
|
@@ -11696,7 +11696,7 @@ const Ad = l.forwardRef(({
|
|
|
11696
11696
|
"aria-haspopup": "listbox",
|
|
11697
11697
|
disabled: a,
|
|
11698
11698
|
onClick: () => N(!C),
|
|
11699
|
-
onKeyDown:
|
|
11699
|
+
onKeyDown: D,
|
|
11700
11700
|
className: k(
|
|
11701
11701
|
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
11702
11702
|
C && "ring-2 ring-ring ring-offset-2"
|
|
@@ -11742,10 +11742,10 @@ const Ad = l.forwardRef(({
|
|
|
11742
11742
|
role: "option",
|
|
11743
11743
|
"aria-selected": j(W),
|
|
11744
11744
|
onClick: () => X(W),
|
|
11745
|
-
onMouseEnter: () =>
|
|
11745
|
+
onMouseEnter: () => O(re),
|
|
11746
11746
|
className: k(
|
|
11747
11747
|
"relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",
|
|
11748
|
-
|
|
11748
|
+
F === re && "bg-accent text-accent-foreground",
|
|
11749
11749
|
j(W) && "bg-accent/50"
|
|
11750
11750
|
),
|
|
11751
11751
|
children: [
|
|
@@ -12490,9 +12490,9 @@ const Fd = ({
|
|
|
12490
12490
|
actions: A = [],
|
|
12491
12491
|
onRowClick: _,
|
|
12492
12492
|
// Appearance
|
|
12493
|
-
striped:
|
|
12494
|
-
hover:
|
|
12495
|
-
compact:
|
|
12493
|
+
striped: F = !1,
|
|
12494
|
+
hover: O = !0,
|
|
12495
|
+
compact: L = !1,
|
|
12496
12496
|
className: T,
|
|
12497
12497
|
// Empty state
|
|
12498
12498
|
emptyTitle: M = "No data found",
|
|
@@ -12500,34 +12500,34 @@ const Fd = ({
|
|
|
12500
12500
|
emptyAction: G,
|
|
12501
12501
|
onEmptyAction: X,
|
|
12502
12502
|
// Row key
|
|
12503
|
-
getRowKey: U = (
|
|
12503
|
+
getRowKey: U = (D) => D.id || D._id
|
|
12504
12504
|
}) => {
|
|
12505
|
-
const [
|
|
12505
|
+
const [D, j] = l.useState(b);
|
|
12506
12506
|
l.useEffect(() => {
|
|
12507
|
-
const
|
|
12508
|
-
y &&
|
|
12507
|
+
const $ = setTimeout(() => {
|
|
12508
|
+
y && D !== b && y(D);
|
|
12509
12509
|
}, 300);
|
|
12510
|
-
return () => clearTimeout(
|
|
12511
|
-
}, [
|
|
12512
|
-
const V = (
|
|
12513
|
-
if (!f ||
|
|
12514
|
-
const J =
|
|
12510
|
+
return () => clearTimeout($);
|
|
12511
|
+
}, [D]);
|
|
12512
|
+
const V = ($) => {
|
|
12513
|
+
if (!f || !$.sortable) return;
|
|
12514
|
+
const J = $.sortKey || $.accessor;
|
|
12515
12515
|
let Z = "asc";
|
|
12516
12516
|
m === J && (Z = g === "asc" ? "desc" : "asc"), v == null || v(J, Z);
|
|
12517
|
-
}, ne = (
|
|
12518
|
-
|
|
12519
|
-
}, W = (
|
|
12520
|
-
J ? N == null || N([...C,
|
|
12521
|
-
}, re = e.length > 0 && C.length === e.length, ce = C.length > 0 && C.length < e.length, de = (
|
|
12522
|
-
const oe =
|
|
12523
|
-
return
|
|
12524
|
-
}, ge = (
|
|
12525
|
-
if (!f ||
|
|
12526
|
-
const J =
|
|
12517
|
+
}, ne = ($) => {
|
|
12518
|
+
$ ? N == null || N(e.map(U)) : N == null || N([]);
|
|
12519
|
+
}, W = ($, J) => {
|
|
12520
|
+
J ? N == null || N([...C, $]) : N == null || N(C.filter((Z) => Z !== $));
|
|
12521
|
+
}, re = e.length > 0 && C.length === e.length, ce = C.length > 0 && C.length < e.length, de = ($, J, Z) => {
|
|
12522
|
+
const oe = $.accessor || $.key, ee = oe ? typeof oe == "function" ? oe(J) : J[oe] : void 0;
|
|
12523
|
+
return $.render ? $.render(ee, J, Z) : $.format ? $.format(ee, J) : ee !== null && typeof ee == "object" ? "-" : ee ?? "-";
|
|
12524
|
+
}, ge = ($) => {
|
|
12525
|
+
if (!f || !$.sortable) return null;
|
|
12526
|
+
const J = $.sortKey || $.accessor;
|
|
12527
12527
|
return m !== J ? /* @__PURE__ */ u(Qf, { className: "ml-2 h-4 w-4 opacity-50" }) : g === "asc" ? /* @__PURE__ */ u(Jf, { className: "ml-2 h-4 w-4" }) : /* @__PURE__ */ u(Zf, { className: "ml-2 h-4 w-4" });
|
|
12528
|
-
}, me = (
|
|
12528
|
+
}, me = ($) => {
|
|
12529
12529
|
if (!A || A.length === 0) return null;
|
|
12530
|
-
const J = A.filter((Z) => Z.hidden ? typeof Z.hidden == "function" ? !Z.hidden(
|
|
12530
|
+
const J = A.filter((Z) => Z.hidden ? typeof Z.hidden == "function" ? !Z.hidden($) : !Z.hidden : !0);
|
|
12531
12531
|
return J.length === 0 ? null : /* @__PURE__ */ R(ad, { children: [
|
|
12532
12532
|
/* @__PURE__ */ u(ld, { asChild: !0, children: /* @__PURE__ */ R(le, { variant: "ghost", size: "icon", className: "h-8 w-8", children: [
|
|
12533
12533
|
/* @__PURE__ */ u(lp, { className: "h-4 w-4" }),
|
|
@@ -12541,7 +12541,7 @@ const Fd = ({
|
|
|
12541
12541
|
{
|
|
12542
12542
|
onClick: () => {
|
|
12543
12543
|
var ee;
|
|
12544
|
-
return (ee = Z.onClick) == null ? void 0 : ee.call(Z,
|
|
12544
|
+
return (ee = Z.onClick) == null ? void 0 : ee.call(Z, $);
|
|
12545
12545
|
},
|
|
12546
12546
|
className: k(
|
|
12547
12547
|
Z.variant === "destructive" && "text-destructive focus:text-destructive"
|
|
@@ -12565,12 +12565,12 @@ const Fd = ({
|
|
|
12565
12565
|
yr,
|
|
12566
12566
|
{
|
|
12567
12567
|
placeholder: w,
|
|
12568
|
-
value:
|
|
12569
|
-
onChange: (
|
|
12568
|
+
value: D,
|
|
12569
|
+
onChange: ($) => j($.target.value),
|
|
12570
12570
|
className: "pl-9 pr-9"
|
|
12571
12571
|
}
|
|
12572
12572
|
),
|
|
12573
|
-
|
|
12573
|
+
D && /* @__PURE__ */ u(
|
|
12574
12574
|
"button",
|
|
12575
12575
|
{
|
|
12576
12576
|
onClick: () => {
|
|
@@ -12605,21 +12605,21 @@ const Fd = ({
|
|
|
12605
12605
|
onCheckedChange: ne
|
|
12606
12606
|
}
|
|
12607
12607
|
) }),
|
|
12608
|
-
t.map((
|
|
12608
|
+
t.map(($, J) => /* @__PURE__ */ u(
|
|
12609
12609
|
Qr,
|
|
12610
12610
|
{
|
|
12611
12611
|
className: k(
|
|
12612
|
-
|
|
12613
|
-
f &&
|
|
12612
|
+
$.headerClassName,
|
|
12613
|
+
f && $.sortable && "cursor-pointer select-none"
|
|
12614
12614
|
),
|
|
12615
|
-
style: { width:
|
|
12616
|
-
onClick: () => V(
|
|
12615
|
+
style: { width: $.width },
|
|
12616
|
+
onClick: () => V($),
|
|
12617
12617
|
children: /* @__PURE__ */ R("div", { className: "flex items-center", children: [
|
|
12618
|
-
|
|
12619
|
-
ge(
|
|
12618
|
+
$.header,
|
|
12619
|
+
ge($)
|
|
12620
12620
|
] })
|
|
12621
12621
|
},
|
|
12622
|
-
|
|
12622
|
+
$.accessor || J
|
|
12623
12623
|
)),
|
|
12624
12624
|
A && A.length > 0 && /* @__PURE__ */ u(Qr, { className: "w-12", children: "Actions" })
|
|
12625
12625
|
] }) }),
|
|
@@ -12635,10 +12635,10 @@ const Fd = ({
|
|
|
12635
12635
|
{
|
|
12636
12636
|
colSpan: t.length + (S ? 1 : 0) + (A != null && A.length ? 1 : 0),
|
|
12637
12637
|
className: "h-48",
|
|
12638
|
-
children:
|
|
12638
|
+
children: D ? /* @__PURE__ */ u(
|
|
12639
12639
|
$d,
|
|
12640
12640
|
{
|
|
12641
|
-
searchTerm:
|
|
12641
|
+
searchTerm: D,
|
|
12642
12642
|
onClear: () => {
|
|
12643
12643
|
j(""), y == null || y("");
|
|
12644
12644
|
}
|
|
@@ -12653,18 +12653,18 @@ const Fd = ({
|
|
|
12653
12653
|
}
|
|
12654
12654
|
)
|
|
12655
12655
|
}
|
|
12656
|
-
) }) : e.map((
|
|
12657
|
-
const Z = U(
|
|
12656
|
+
) }) : e.map(($, J) => {
|
|
12657
|
+
const Z = U($), oe = C.includes(Z);
|
|
12658
12658
|
return /* @__PURE__ */ R(
|
|
12659
12659
|
dr,
|
|
12660
12660
|
{
|
|
12661
12661
|
"data-state": oe ? "selected" : void 0,
|
|
12662
12662
|
className: k(
|
|
12663
|
-
|
|
12664
|
-
|
|
12663
|
+
F && J % 2 === 1 && "bg-muted/50",
|
|
12664
|
+
O && "cursor-pointer",
|
|
12665
12665
|
_ && "hover:bg-muted"
|
|
12666
12666
|
),
|
|
12667
|
-
onClick: () => _ == null ? void 0 : _(
|
|
12667
|
+
onClick: () => _ == null ? void 0 : _($),
|
|
12668
12668
|
children: [
|
|
12669
12669
|
S && /* @__PURE__ */ u(Gt, { onClick: (ee) => ee.stopPropagation(), children: /* @__PURE__ */ u(
|
|
12670
12670
|
br,
|
|
@@ -12677,14 +12677,14 @@ const Fd = ({
|
|
|
12677
12677
|
Gt,
|
|
12678
12678
|
{
|
|
12679
12679
|
className: k(
|
|
12680
|
-
|
|
12680
|
+
L && "py-2",
|
|
12681
12681
|
ee.cellClassName
|
|
12682
12682
|
),
|
|
12683
|
-
children: de(ee,
|
|
12683
|
+
children: de(ee, $, J)
|
|
12684
12684
|
},
|
|
12685
12685
|
ee.accessor || z
|
|
12686
12686
|
)),
|
|
12687
|
-
A && A.length > 0 && /* @__PURE__ */ u(Gt, { onClick: (ee) => ee.stopPropagation(), children: me(
|
|
12687
|
+
A && A.length > 0 && /* @__PURE__ */ u(Gt, { onClick: (ee) => ee.stopPropagation(), children: me($) })
|
|
12688
12688
|
]
|
|
12689
12689
|
},
|
|
12690
12690
|
Z
|
|
@@ -12738,10 +12738,10 @@ const mS = ({
|
|
|
12738
12738
|
onView: N,
|
|
12739
12739
|
onEdit: A,
|
|
12740
12740
|
onDelete: _,
|
|
12741
|
-
onRefresh:
|
|
12742
|
-
onExport:
|
|
12741
|
+
onRefresh: F,
|
|
12742
|
+
onExport: O,
|
|
12743
12743
|
// Navigation paths (used with store)
|
|
12744
|
-
createPath:
|
|
12744
|
+
createPath: L,
|
|
12745
12745
|
detailPath: T,
|
|
12746
12746
|
editPath: M,
|
|
12747
12747
|
// Custom actions
|
|
@@ -12750,7 +12750,7 @@ const mS = ({
|
|
|
12750
12750
|
// Labels
|
|
12751
12751
|
title: X,
|
|
12752
12752
|
description: U,
|
|
12753
|
-
createLabel:
|
|
12753
|
+
createLabel: D = "Create",
|
|
12754
12754
|
refreshLabel: j = "Refresh",
|
|
12755
12755
|
exportLabel: V = "Export",
|
|
12756
12756
|
viewLabel: ne = "View",
|
|
@@ -12762,7 +12762,7 @@ const mS = ({
|
|
|
12762
12762
|
// Appearance
|
|
12763
12763
|
showHeader: ge = !0,
|
|
12764
12764
|
showToolbar: me = !0,
|
|
12765
|
-
compact:
|
|
12765
|
+
compact: $ = !1,
|
|
12766
12766
|
className: J,
|
|
12767
12767
|
// Delete confirmation
|
|
12768
12768
|
deleteConfirmTitle: Z,
|
|
@@ -12775,25 +12775,25 @@ const mS = ({
|
|
|
12775
12775
|
// Searchable
|
|
12776
12776
|
searchable: be = !0
|
|
12777
12777
|
}) => {
|
|
12778
|
-
const ve = Do(), [
|
|
12778
|
+
const ve = Do(), [De, Oe] = l.useState(!1), [Ve, He] = l.useState(null), [x, E] = l.useState(!1), [P, Y] = l.useState(""), H = l.useRef(!1), B = l.useRef(P), Q = l.useRef(null), ue = l.useRef(null), pe = (e == null ? void 0 : e.items) ?? t ?? [], Ae = (e == null ? void 0 : e.loading) ?? r, We = (e == null ? void 0 : e.error) ?? n, ke = (e == null ? void 0 : e.pagination) ?? {
|
|
12779
12779
|
page: s,
|
|
12780
12780
|
pageSize: i,
|
|
12781
12781
|
total: a,
|
|
12782
12782
|
totalPages: c
|
|
12783
|
-
},
|
|
12783
|
+
}, $e = ke.page ?? s, Me = ke.pageSize ?? i, bt = ke.total ?? a, Xe = ke.totalPages ?? c, _e = e == null ? void 0 : e.fetchList, Bt = e == null ? void 0 : e.delete, st = e == null ? void 0 : e.setPage, Gn = e == null ? void 0 : e.setPageSize, Tt = e == null ? void 0 : e.setFilters;
|
|
12784
12784
|
l.useEffect(() => {
|
|
12785
|
-
_e && !H.current && (H.current = !0, Q.current =
|
|
12785
|
+
_e && !H.current && (H.current = !0, Q.current = $e, ue.current = Me, _e());
|
|
12786
12786
|
}, [_e]), l.useEffect(() => {
|
|
12787
12787
|
if (!_e || !H.current) return;
|
|
12788
|
-
const ae = Q.current !==
|
|
12789
|
-
(ae || Yn) && (Q.current =
|
|
12790
|
-
}, [
|
|
12788
|
+
const ae = Q.current !== $e, Yn = ue.current !== Me;
|
|
12789
|
+
(ae || Yn) && (Q.current = $e, ue.current = Me, _e());
|
|
12790
|
+
}, [$e, Me, _e]), l.useEffect(() => {
|
|
12791
12791
|
if (!_e || !H.current || B.current === P) return;
|
|
12792
12792
|
const ae = setTimeout(() => {
|
|
12793
|
-
be && (B.current = P, Tt == null || Tt({ search: P }),
|
|
12793
|
+
be && (B.current = P, Tt == null || Tt({ search: P }), $e !== 1 ? st == null || st(1) : _e());
|
|
12794
12794
|
}, 300);
|
|
12795
12795
|
return () => clearTimeout(ae);
|
|
12796
|
-
}, [P, be,
|
|
12796
|
+
}, [P, be, $e, Tt, st, _e]);
|
|
12797
12797
|
const qd = l.useCallback((ae) => {
|
|
12798
12798
|
st ? st(ae) : d == null || d(ae);
|
|
12799
12799
|
}, [st, d]), Xd = l.useCallback((ae) => {
|
|
@@ -12801,20 +12801,20 @@ const mS = ({
|
|
|
12801
12801
|
}, [Gn, p]), Zd = l.useCallback((ae) => {
|
|
12802
12802
|
Tt ? Y(ae) : h == null || h(ae);
|
|
12803
12803
|
}, [Tt, h]), Ds = l.useCallback(() => {
|
|
12804
|
-
|
|
12805
|
-
}, [
|
|
12804
|
+
L ? ve(L) : C == null || C();
|
|
12805
|
+
}, [L, ve, C]), Os = l.useCallback((ae) => {
|
|
12806
12806
|
T ? ve(`${T}/${de(ae)}`) : N == null || N(ae);
|
|
12807
12807
|
}, [T, ve, de, N]), $s = l.useCallback((ae) => {
|
|
12808
12808
|
M ? ve(`${M}/${de(ae)}/edit`) : A == null || A(ae);
|
|
12809
12809
|
}, [M, ve, de, A]), Qd = l.useCallback(() => {
|
|
12810
|
-
_e ? _e() :
|
|
12811
|
-
}, [_e,
|
|
12812
|
-
He(ae),
|
|
12810
|
+
_e ? _e() : F == null || F();
|
|
12811
|
+
}, [_e, F]), Ls = l.useCallback((ae) => {
|
|
12812
|
+
He(ae), Oe(!0);
|
|
12813
12813
|
}, []), Jd = async () => {
|
|
12814
|
-
if (
|
|
12814
|
+
if (Ve) {
|
|
12815
12815
|
E(!0);
|
|
12816
12816
|
try {
|
|
12817
|
-
Bt ? (await Bt(de(
|
|
12817
|
+
Bt ? (await Bt(de(Ve)), _e == null || _e()) : _ && await _(Ve), Oe(!1), He(null);
|
|
12818
12818
|
} catch (ae) {
|
|
12819
12819
|
console.error("Delete error:", ae);
|
|
12820
12820
|
} finally {
|
|
@@ -12837,7 +12837,7 @@ const mS = ({
|
|
|
12837
12837
|
variant: "destructive",
|
|
12838
12838
|
onClick: Ls
|
|
12839
12839
|
}), [...ae, ...I];
|
|
12840
|
-
}, [T, M, N, A, Bt, _, ne, W, re, Os, $s, Ls, I]), Kn =
|
|
12840
|
+
}, [T, M, N, A, Bt, _, ne, W, re, Os, $s, Ls, I]), Kn = L || C, tf = _e || F, Fs = l.useMemo(() => Ve ? ee ? ee(Ve) : Ve.name || Ve.title || ce : ce, [Ve, ee, ce]), Vs = () => me ? /* @__PURE__ */ R("div", { className: "flex items-center gap-2", children: [
|
|
12841
12841
|
te,
|
|
12842
12842
|
y && w.length > 0 && G.length > 0 && /* @__PURE__ */ u(Se, { children: G.map((ae, Yn) => /* @__PURE__ */ R(
|
|
12843
12843
|
le,
|
|
@@ -12856,7 +12856,7 @@ const mS = ({
|
|
|
12856
12856
|
},
|
|
12857
12857
|
ae.label || Yn
|
|
12858
12858
|
)) }),
|
|
12859
|
-
|
|
12859
|
+
O && /* @__PURE__ */ R(le, { variant: "outline", size: "sm", onClick: O, children: [
|
|
12860
12860
|
/* @__PURE__ */ u(ap, { className: "mr-2 h-4 w-4" }),
|
|
12861
12861
|
V
|
|
12862
12862
|
] }),
|
|
@@ -12875,7 +12875,7 @@ const mS = ({
|
|
|
12875
12875
|
),
|
|
12876
12876
|
Kn && /* @__PURE__ */ R(le, { size: "sm", onClick: Ds, children: [
|
|
12877
12877
|
/* @__PURE__ */ u(fp, { className: "mr-2 h-4 w-4" }),
|
|
12878
|
-
|
|
12878
|
+
D
|
|
12879
12879
|
] })
|
|
12880
12880
|
] }) : null, Ws = /* @__PURE__ */ R(Se, { children: [
|
|
12881
12881
|
z && /* @__PURE__ */ u("div", { className: "mb-4 flex items-center gap-2", children: z }),
|
|
@@ -12885,8 +12885,8 @@ const mS = ({
|
|
|
12885
12885
|
data: pe,
|
|
12886
12886
|
columns: o,
|
|
12887
12887
|
loading: Ae,
|
|
12888
|
-
error:
|
|
12889
|
-
currentPage:
|
|
12888
|
+
error: We,
|
|
12889
|
+
currentPage: $e,
|
|
12890
12890
|
pageSize: Me,
|
|
12891
12891
|
totalItems: bt,
|
|
12892
12892
|
totalPages: Xe,
|
|
@@ -12904,7 +12904,7 @@ const mS = ({
|
|
|
12904
12904
|
onSelectionChange: S,
|
|
12905
12905
|
actions: ef,
|
|
12906
12906
|
getRowKey: de,
|
|
12907
|
-
compact:
|
|
12907
|
+
compact: $,
|
|
12908
12908
|
emptyTitle: `No ${ce}s found`,
|
|
12909
12909
|
emptyDescription: `Create your first ${ce} to get started.`,
|
|
12910
12910
|
emptyAction: Kn ? `Create ${ce}` : void 0,
|
|
@@ -12914,8 +12914,8 @@ const mS = ({
|
|
|
12914
12914
|
/* @__PURE__ */ u(
|
|
12915
12915
|
pn,
|
|
12916
12916
|
{
|
|
12917
|
-
open:
|
|
12918
|
-
onOpenChange:
|
|
12917
|
+
open: De,
|
|
12918
|
+
onOpenChange: Oe,
|
|
12919
12919
|
onConfirm: Jd,
|
|
12920
12920
|
title: Z || `Delete ${ce}`,
|
|
12921
12921
|
description: oe || `Are you sure you want to delete "${Fs}"? This action cannot be undone.`,
|
|
@@ -12942,9 +12942,9 @@ const mS = ({
|
|
|
12942
12942
|
] });
|
|
12943
12943
|
};
|
|
12944
12944
|
mS.displayName = "CrudList";
|
|
12945
|
-
var Wr = (e) => e.type === "checkbox", kt = (e) => e instanceof Date,
|
|
12945
|
+
var Wr = (e) => e.type === "checkbox", kt = (e) => e instanceof Date, Be = (e) => e == null;
|
|
12946
12946
|
const Vd = (e) => typeof e == "object";
|
|
12947
|
-
var Ee = (e) => !
|
|
12947
|
+
var Ee = (e) => !Be(e) && !Array.isArray(e) && Vd(e) && !kt(e), hS = (e) => Ee(e) && e.target ? Wr(e.target) ? e.target.checked : e.target.value : e, gS = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, vS = (e, t) => e.has(gS(t)), yS = (e) => {
|
|
12948
12948
|
const t = e.constructor && e.constructor.prototype;
|
|
12949
12949
|
return Ee(t) && t.hasOwnProperty("isPrototypeOf");
|
|
12950
12950
|
}, Ps = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
@@ -12966,7 +12966,7 @@ function Te(e) {
|
|
|
12966
12966
|
var zn = (e) => /^\w*$/.test(e), xe = (e) => e === void 0, As = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Ts = (e) => As(e.replace(/["|']|\]/g, "").split(/\.|\[/)), q = (e, t, r) => {
|
|
12967
12967
|
if (!t || !Ee(e))
|
|
12968
12968
|
return r;
|
|
12969
|
-
const n = (zn(t) ? [t] : Ts(t)).reduce((o, s) =>
|
|
12969
|
+
const n = (zn(t) ? [t] : Ts(t)).reduce((o, s) => Be(o) ? o : o[s], e);
|
|
12970
12970
|
return xe(n) || n === e ? xe(e[t]) ? r : e[t] : n;
|
|
12971
12971
|
}, it = (e) => typeof e == "boolean", he = (e, t, r) => {
|
|
12972
12972
|
let n = -1;
|
|
@@ -13016,7 +13016,7 @@ var wS = (e, t, r, n = !0) => {
|
|
|
13016
13016
|
return o;
|
|
13017
13017
|
};
|
|
13018
13018
|
const xS = typeof window < "u" ? we.useLayoutEffect : we.useEffect;
|
|
13019
|
-
var Ue = (e) => typeof e == "string", SS = (e, t, r, n, o) => Ue(e) ? (n && t.watch.add(e), q(r, e, o)) : Array.isArray(e) ? e.map((s) => (n && t.watch.add(s), q(r, s))) : (n && (t.watchAll = !0), r), ko = (e) =>
|
|
13019
|
+
var Ue = (e) => typeof e == "string", SS = (e, t, r, n, o) => Ue(e) ? (n && t.watch.add(e), q(r, e, o)) : Array.isArray(e) ? e.map((s) => (n && t.watch.add(s), q(r, s))) : (n && (t.watchAll = !0), r), ko = (e) => Be(e) || !Vd(e);
|
|
13020
13020
|
function Ct(e, t, r = /* @__PURE__ */ new WeakSet()) {
|
|
13021
13021
|
if (ko(e) || ko(t))
|
|
13022
13022
|
return Object.is(e, t);
|
|
@@ -13078,7 +13078,7 @@ function Bd(e, t) {
|
|
|
13078
13078
|
}
|
|
13079
13079
|
return r;
|
|
13080
13080
|
}
|
|
13081
|
-
var
|
|
13081
|
+
var Le = (e) => Ee(e) && !Object.keys(e).length, Ms = (e) => e.type === "file", tt = (e) => typeof e == "function", mn = (e) => {
|
|
13082
13082
|
if (!Ps)
|
|
13083
13083
|
return !1;
|
|
13084
13084
|
const t = e ? e.ownerDocument : 0;
|
|
@@ -13099,7 +13099,7 @@ function ES(e) {
|
|
|
13099
13099
|
}
|
|
13100
13100
|
function Ne(e, t) {
|
|
13101
13101
|
const r = Array.isArray(t) ? t : zn(t) ? [t] : Ts(t), n = r.length === 1 ? e : NS(e, r), o = r.length - 1, s = r[o];
|
|
13102
|
-
return n && delete n[s], o !== 0 && (Ee(n) &&
|
|
13102
|
+
return n && delete n[s], o !== 0 && (Ee(n) && Le(n) || Array.isArray(n) && ES(n)) && Ne(e, r.slice(0, -1)), e;
|
|
13103
13103
|
}
|
|
13104
13104
|
var RS = (e) => {
|
|
13105
13105
|
for (const t in e)
|
|
@@ -13122,7 +13122,7 @@ function Kt(e, t, r) {
|
|
|
13122
13122
|
for (const n in e) {
|
|
13123
13123
|
const o = e[n];
|
|
13124
13124
|
if (jd(o))
|
|
13125
|
-
xe(t) || ko(r[n]) ? r[n] = Io(o, Array.isArray(o) ? [] : {}) : Kt(o,
|
|
13125
|
+
xe(t) || ko(r[n]) ? r[n] = Io(o, Array.isArray(o) ? [] : {}) : Kt(o, Be(t) ? {} : t[n], r[n]);
|
|
13126
13126
|
else {
|
|
13127
13127
|
const s = t[n];
|
|
13128
13128
|
r[n] = !Ct(o, s);
|
|
@@ -13228,7 +13228,7 @@ function $i(e, t, r) {
|
|
|
13228
13228
|
var TS = (e, t, r, n) => {
|
|
13229
13229
|
r(e);
|
|
13230
13230
|
const { name: o, ...s } = e;
|
|
13231
|
-
return
|
|
13231
|
+
return Le(s) || Object.keys(s).length >= Object.keys(t).length || Object.keys(s).find((i) => t[i] === (!n || et.all));
|
|
13232
13232
|
}, MS = (e, t, r) => !e || !t || e === t || fr(e).some((n) => n && (r ? n === t : n.startsWith(t) || t.startsWith(n))), kS = (e, t, r, n, o) => o.isOnAll ? !1 : !r && o.isOnTouch ? !(t || e) : (r ? n.isOnBlur : o.isOnBlur) ? !e : (r ? n.isOnChange : o.isOnChange) ? e : !0, IS = (e, t) => !As(q(e, t)).length && Ne(e, t), DS = (e, t, r) => {
|
|
13233
13233
|
const n = fr(q(e, r));
|
|
13234
13234
|
return he(n, "root", t[r]), he(e, r, n), e;
|
|
@@ -13250,50 +13250,50 @@ var zt = (e) => Ee(e) && !hn(e) ? e : {
|
|
|
13250
13250
|
return {};
|
|
13251
13251
|
const S = a ? a[0] : i, C = (M) => {
|
|
13252
13252
|
o && S.reportValidity && (S.setCustomValidity(it(M) ? "" : M || ""), S.reportValidity());
|
|
13253
|
-
}, N = {}, A = ks(i), _ = Wr(i),
|
|
13254
|
-
const
|
|
13253
|
+
}, N = {}, A = ks(i), _ = Wr(i), F = A || _, O = (b || Ms(i)) && xe(i.value) && xe(w) || mn(i) && i.value === "" || w === "" || Array.isArray(w) && !w.length, L = Wd.bind(null, h, n, N), T = (M, I, G, X = ht.maxLength, U = ht.minLength) => {
|
|
13254
|
+
const D = M ? I : G;
|
|
13255
13255
|
N[h] = {
|
|
13256
13256
|
type: M ? X : U,
|
|
13257
|
-
message:
|
|
13257
|
+
message: D,
|
|
13258
13258
|
ref: i,
|
|
13259
|
-
|
|
13259
|
+
...L(M ? X : U, D)
|
|
13260
13260
|
};
|
|
13261
13261
|
};
|
|
13262
|
-
if (s ? !Array.isArray(w) || !w.length : c && (!
|
|
13262
|
+
if (s ? !Array.isArray(w) || !w.length : c && (!F && (O || Be(w)) || it(w) && !w || _ && !Ud(a).isValid || A && !Gd(a).isValid)) {
|
|
13263
13263
|
const { value: M, message: I } = Ue(c) ? { value: !!c, message: c } : zt(c);
|
|
13264
13264
|
if (M && (N[h] = {
|
|
13265
13265
|
type: ht.required,
|
|
13266
13266
|
message: I,
|
|
13267
13267
|
ref: S,
|
|
13268
|
-
|
|
13268
|
+
...L(ht.required, I)
|
|
13269
13269
|
}, !n))
|
|
13270
13270
|
return C(I), N;
|
|
13271
13271
|
}
|
|
13272
|
-
if (!
|
|
13272
|
+
if (!O && (!Be(f) || !Be(m))) {
|
|
13273
13273
|
let M, I;
|
|
13274
13274
|
const G = zt(m), X = zt(f);
|
|
13275
|
-
if (!
|
|
13275
|
+
if (!Be(w) && !isNaN(w)) {
|
|
13276
13276
|
const U = i.valueAsNumber || w && +w;
|
|
13277
|
-
|
|
13277
|
+
Be(G.value) || (M = U > G.value), Be(X.value) || (I = U < X.value);
|
|
13278
13278
|
} else {
|
|
13279
|
-
const U = i.valueAsDate || new Date(w),
|
|
13280
|
-
Ue(G.value) && w && (M = j ?
|
|
13279
|
+
const U = i.valueAsDate || new Date(w), D = (ne) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ne), j = i.type == "time", V = i.type == "week";
|
|
13280
|
+
Ue(G.value) && w && (M = j ? D(w) > D(G.value) : V ? w > G.value : U > new Date(G.value)), Ue(X.value) && w && (I = j ? D(w) < D(X.value) : V ? w < X.value : U < new Date(X.value));
|
|
13281
13281
|
}
|
|
13282
13282
|
if ((M || I) && (T(!!M, G.message, X.message, ht.max, ht.min), !n))
|
|
13283
13283
|
return C(N[h].message), N;
|
|
13284
13284
|
}
|
|
13285
|
-
if ((d || p) && !
|
|
13286
|
-
const M = zt(d), I = zt(p), G = !
|
|
13285
|
+
if ((d || p) && !O && (Ue(w) || s && Array.isArray(w))) {
|
|
13286
|
+
const M = zt(d), I = zt(p), G = !Be(M.value) && w.length > +M.value, X = !Be(I.value) && w.length < +I.value;
|
|
13287
13287
|
if ((G || X) && (T(G, M.message, I.message), !n))
|
|
13288
13288
|
return C(N[h].message), N;
|
|
13289
13289
|
}
|
|
13290
|
-
if (g && !
|
|
13290
|
+
if (g && !O && Ue(w)) {
|
|
13291
13291
|
const { value: M, message: I } = zt(g);
|
|
13292
13292
|
if (hn(M) && !w.match(M) && (N[h] = {
|
|
13293
13293
|
type: ht.pattern,
|
|
13294
13294
|
message: I,
|
|
13295
13295
|
ref: i,
|
|
13296
|
-
|
|
13296
|
+
...L(ht.pattern, I)
|
|
13297
13297
|
}, !n))
|
|
13298
13298
|
return C(I), N;
|
|
13299
13299
|
}
|
|
@@ -13302,21 +13302,21 @@ var zt = (e) => Ee(e) && !hn(e) ? e : {
|
|
|
13302
13302
|
const M = await v(w, r), I = Li(M, S);
|
|
13303
13303
|
if (I && (N[h] = {
|
|
13304
13304
|
...I,
|
|
13305
|
-
|
|
13305
|
+
...L(ht.validate, I.message)
|
|
13306
13306
|
}, !n))
|
|
13307
13307
|
return C(I.message), N;
|
|
13308
13308
|
} else if (Ee(v)) {
|
|
13309
13309
|
let M = {};
|
|
13310
13310
|
for (const I in v) {
|
|
13311
|
-
if (!
|
|
13311
|
+
if (!Le(M) && !n)
|
|
13312
13312
|
break;
|
|
13313
13313
|
const G = Li(await v[I](w, r), S, I);
|
|
13314
13314
|
G && (M = {
|
|
13315
13315
|
...G,
|
|
13316
|
-
|
|
13316
|
+
...L(I, G.message)
|
|
13317
13317
|
}, C(G.message), n && (N[h] = M));
|
|
13318
13318
|
}
|
|
13319
|
-
if (!
|
|
13319
|
+
if (!Le(M) && (N[h] = {
|
|
13320
13320
|
ref: S,
|
|
13321
13321
|
...M
|
|
13322
13322
|
}, !n))
|
|
@@ -13379,7 +13379,7 @@ function $S(e = {}) {
|
|
|
13379
13379
|
clearTimeout(d), d = setTimeout(x, E);
|
|
13380
13380
|
}, h = async (x) => {
|
|
13381
13381
|
if (!t.disabled && (p.isValid || f.isValid || x)) {
|
|
13382
|
-
const E = t.resolver ?
|
|
13382
|
+
const E = t.resolver ? Le((await _()).errors) : await O(n, !0);
|
|
13383
13383
|
E !== r.isValid && m.state.next({
|
|
13384
13384
|
isValid: E
|
|
13385
13385
|
});
|
|
@@ -13389,7 +13389,7 @@ function $S(e = {}) {
|
|
|
13389
13389
|
P && (E ? he(r.validatingFields, P, E) : Ne(r.validatingFields, P));
|
|
13390
13390
|
}), m.state.next({
|
|
13391
13391
|
validatingFields: r.validatingFields,
|
|
13392
|
-
isValidating: !
|
|
13392
|
+
isValidating: !Le(r.validatingFields)
|
|
13393
13393
|
}));
|
|
13394
13394
|
}, y = (x, E = [], P, Y, H = !0, B = !0) => {
|
|
13395
13395
|
if (Y && P && !t.disabled) {
|
|
@@ -13449,7 +13449,7 @@ function $S(e = {}) {
|
|
|
13449
13449
|
return B ? ue : {};
|
|
13450
13450
|
}, A = (x, E, P, Y) => {
|
|
13451
13451
|
const H = q(r.errors, x), B = (p.isValid || f.isValid) && it(E) && r.isValid !== E;
|
|
13452
|
-
if (t.delayError && P ? (c = v(() => w(x, P)), c(t.delayError)) : (clearTimeout(d), c = null, P ? he(r.errors, x, P) : Ne(r.errors, x)), (P ? !Ct(H, P) : H) || !
|
|
13452
|
+
if (t.delayError && P ? (c = v(() => w(x, P)), c(t.delayError)) : (clearTimeout(d), c = null, P ? he(r.errors, x, P) : Ne(r.errors, x)), (P ? !Ct(H, P) : H) || !Le(Y) || B) {
|
|
13453
13453
|
const Q = {
|
|
13454
13454
|
...Y,
|
|
13455
13455
|
...B && it(E) ? { isValid: E } : {},
|
|
@@ -13465,7 +13465,7 @@ function $S(e = {}) {
|
|
|
13465
13465
|
b(x, !0);
|
|
13466
13466
|
const E = await t.resolver(s, t.context, _S(x || a.mount, n, t.criteriaMode, t.shouldUseNativeValidation));
|
|
13467
13467
|
return b(x), E;
|
|
13468
|
-
},
|
|
13468
|
+
}, F = async (x) => {
|
|
13469
13469
|
const { errors: E } = await _(x);
|
|
13470
13470
|
if (x)
|
|
13471
13471
|
for (const P of x) {
|
|
@@ -13475,7 +13475,7 @@ function $S(e = {}) {
|
|
|
13475
13475
|
else
|
|
13476
13476
|
r.errors = E;
|
|
13477
13477
|
return E;
|
|
13478
|
-
},
|
|
13478
|
+
}, O = async (x, E, P = {
|
|
13479
13479
|
valid: !0
|
|
13480
13480
|
}) => {
|
|
13481
13481
|
for (const Y in x) {
|
|
@@ -13490,14 +13490,14 @@ function $S(e = {}) {
|
|
|
13490
13490
|
break;
|
|
13491
13491
|
!E && (q(Ae, B.name) ? ue ? DS(r.errors, Ae, B.name) : he(r.errors, B.name, Ae[B.name]) : Ne(r.errors, B.name));
|
|
13492
13492
|
}
|
|
13493
|
-
!
|
|
13493
|
+
!Le(Q) && await O(Q, E, P);
|
|
13494
13494
|
}
|
|
13495
13495
|
}
|
|
13496
13496
|
return P.valid;
|
|
13497
|
-
},
|
|
13497
|
+
}, L = () => {
|
|
13498
13498
|
for (const x of a.unMount) {
|
|
13499
13499
|
const E = q(n, x);
|
|
13500
|
-
E && (E._f.refs ? E._f.refs.every((P) => !co(P)) : !co(E._f.ref)) &&
|
|
13500
|
+
E && (E._f.refs ? E._f.refs.every((P) => !co(P)) : !co(E._f.ref)) && $(x);
|
|
13501
13501
|
}
|
|
13502
13502
|
a.unMount = /* @__PURE__ */ new Set();
|
|
13503
13503
|
}, T = (x, E) => !t.disabled && (x && E && he(s, x, E), !Ct(ne(), o)), M = (x, E, P) => SS(x, a, {
|
|
@@ -13507,7 +13507,7 @@ function $S(e = {}) {
|
|
|
13507
13507
|
let H = E;
|
|
13508
13508
|
if (Y) {
|
|
13509
13509
|
const B = Y._f;
|
|
13510
|
-
B && (!B.disabled && he(s, x, zd(E, B)), H = mn(B.ref) &&
|
|
13510
|
+
B && (!B.disabled && he(s, x, zd(E, B)), H = mn(B.ref) && Be(E) ? "" : E, Hd(B.ref) ? [...B.ref.options].forEach((Q) => Q.selected = H.includes(Q.value)) : B.refs ? Wr(B.ref) ? B.refs.forEach((Q) => {
|
|
13511
13511
|
(!Q.defaultChecked || !Q.disabled) && (Array.isArray(H) ? Q.checked = !!H.find((ue) => ue === Q.value) : Q.checked = H === Q.value || !!H);
|
|
13512
13512
|
}) : B.refs.forEach((Q) => Q.checked = Q.value === H) : Ms(B.ref) ? B.ref.value = "" : (B.ref.value = H, B.ref.type || m.state.next({
|
|
13513
13513
|
name: x,
|
|
@@ -13531,11 +13531,11 @@ function $S(e = {}) {
|
|
|
13531
13531
|
name: x,
|
|
13532
13532
|
dirtyFields: Kt(o, s),
|
|
13533
13533
|
isDirty: T(x, B)
|
|
13534
|
-
})) : Y && !Y._f && !
|
|
13534
|
+
})) : Y && !Y._f && !Be(B) ? X(x, B, P) : G(x, B, P), Oi(x, a) && m.state.next({ ...r, name: x }), m.state.next({
|
|
13535
13535
|
name: i.mount ? x : void 0,
|
|
13536
13536
|
values: Te(s)
|
|
13537
13537
|
});
|
|
13538
|
-
},
|
|
13538
|
+
}, D = async (x) => {
|
|
13539
13539
|
i.mount = !0;
|
|
13540
13540
|
const E = x.target;
|
|
13541
13541
|
let P = E.name, Y = !0;
|
|
@@ -13544,23 +13544,23 @@ function $S(e = {}) {
|
|
|
13544
13544
|
}, Q = Ii(t.mode), ue = Ii(t.reValidateMode);
|
|
13545
13545
|
if (H) {
|
|
13546
13546
|
let pe, Ae;
|
|
13547
|
-
const
|
|
13548
|
-
he(s, P,
|
|
13549
|
-
const bt = N(P,
|
|
13547
|
+
const We = E.type ? ki(H._f) : hS(x), ke = x.type === _i.BLUR || x.type === _i.FOCUS_OUT, $e = !AS(H._f) && !t.resolver && !q(r.errors, P) && !H._f.deps || kS(ke, q(r.touchedFields, P), r.isSubmitted, ue, Q), Me = Oi(P, a, ke);
|
|
13548
|
+
he(s, P, We), ke ? (!E || !E.readOnly) && (H._f.onBlur && H._f.onBlur(x), c && c(0)) : H._f.onChange && H._f.onChange(x);
|
|
13549
|
+
const bt = N(P, We, ke), Xe = !Le(bt) || Me;
|
|
13550
13550
|
if (!ke && m.state.next({
|
|
13551
13551
|
name: P,
|
|
13552
13552
|
type: x.type,
|
|
13553
13553
|
values: Te(s)
|
|
13554
|
-
}),
|
|
13554
|
+
}), $e)
|
|
13555
13555
|
return (p.isValid || f.isValid) && (t.mode === "onBlur" ? ke && h() : ke || h()), Xe && m.state.next({ name: P, ...Me ? {} : bt });
|
|
13556
13556
|
if (!ke && Me && m.state.next({ ...r }), t.resolver) {
|
|
13557
13557
|
const { errors: _e } = await _([P]);
|
|
13558
|
-
if (B(
|
|
13558
|
+
if (B(We), Y) {
|
|
13559
13559
|
const Bt = $i(r.errors, n, P), st = $i(_e, n, Bt.name || P);
|
|
13560
|
-
pe = st.error, P = st.name, Ae =
|
|
13560
|
+
pe = st.error, P = st.name, Ae = Le(_e);
|
|
13561
13561
|
}
|
|
13562
13562
|
} else
|
|
13563
|
-
b([P], !0), pe = (await Fi(H, a.disabled, s, g, t.shouldUseNativeValidation))[P], b([P]), B(
|
|
13563
|
+
b([P], !0), pe = (await Fi(H, a.disabled, s, g, t.shouldUseNativeValidation))[P], b([P]), B(We), Y && (pe ? Ae = !1 : (p.isValid || f.isValid) && (Ae = await O(n, !0)));
|
|
13564
13564
|
Y && (H._f.deps && (!Array.isArray(H._f.deps) || H._f.deps.length > 0) && V(H._f.deps), A(P, Ae, pe, bt));
|
|
13565
13565
|
}
|
|
13566
13566
|
}, j = (x, E) => {
|
|
@@ -13570,12 +13570,12 @@ function $S(e = {}) {
|
|
|
13570
13570
|
let P, Y;
|
|
13571
13571
|
const H = fr(x);
|
|
13572
13572
|
if (t.resolver) {
|
|
13573
|
-
const B = await
|
|
13574
|
-
P =
|
|
13573
|
+
const B = await F(xe(x) ? x : H);
|
|
13574
|
+
P = Le(B), Y = x ? !H.some((Q) => q(B, Q)) : P;
|
|
13575
13575
|
} else x ? (Y = (await Promise.all(H.map(async (B) => {
|
|
13576
13576
|
const Q = q(n, B);
|
|
13577
|
-
return await
|
|
13578
|
-
}))).every(Boolean), !(!Y && !r.isValid) && h()) : Y = P = await
|
|
13577
|
+
return await O(Q && Q._f ? { [B]: Q } : Q);
|
|
13578
|
+
}))).every(Boolean), !(!Y && !r.isValid) && h()) : Y = P = await O(n);
|
|
13579
13579
|
return m.state.next({
|
|
13580
13580
|
...!Ue(x) || (p.isValid || f.isValid) && P !== r.isValid ? {} : { name: x },
|
|
13581
13581
|
...t.resolver || !x ? { isValid: P } : {},
|
|
@@ -13611,7 +13611,7 @@ function $S(e = {}) {
|
|
|
13611
13611
|
next: (P) => "values" in P && x(M(void 0, E), P)
|
|
13612
13612
|
}) : M(x, E, !0), ge = (x) => m.state.subscribe({
|
|
13613
13613
|
next: (E) => {
|
|
13614
|
-
MS(x.name, E.name, x.exact) && TS(E, x.formState || p,
|
|
13614
|
+
MS(x.name, E.name, x.exact) && TS(E, x.formState || p, Oe, x.reRenderRoot) && x.callback({
|
|
13615
13615
|
values: { ...s },
|
|
13616
13616
|
...r,
|
|
13617
13617
|
...E,
|
|
@@ -13624,7 +13624,7 @@ function $S(e = {}) {
|
|
|
13624
13624
|
}, ge({
|
|
13625
13625
|
...x,
|
|
13626
13626
|
formState: f
|
|
13627
|
-
})),
|
|
13627
|
+
})), $ = (x, E = {}) => {
|
|
13628
13628
|
for (const P of x ? fr(x) : a.mount)
|
|
13629
13629
|
a.mount.delete(P), a.array.delete(P), E.keepValue || (Ne(n, P), Ne(s, P)), !E.keepError && Ne(r.errors, P), !E.keepDirty && Ne(r.dirtyFields, P), !E.keepTouched && Ne(r.touchedFields, P), !E.keepIsValidating && Ne(r.validatingFields, P), !t.shouldUnregister && !E.keepDefaultValue && Ne(o, P);
|
|
13630
13630
|
m.state.next({
|
|
@@ -13660,8 +13660,8 @@ function $S(e = {}) {
|
|
|
13660
13660
|
pattern: lr(E.pattern)
|
|
13661
13661
|
} : {},
|
|
13662
13662
|
name: x,
|
|
13663
|
-
onChange:
|
|
13664
|
-
onBlur:
|
|
13663
|
+
onChange: D,
|
|
13664
|
+
onBlur: D,
|
|
13665
13665
|
ref: (H) => {
|
|
13666
13666
|
if (H) {
|
|
13667
13667
|
Z(x, E), P = q(n, x);
|
|
@@ -13702,11 +13702,11 @@ function $S(e = {}) {
|
|
|
13702
13702
|
const { errors: B, values: Q } = await _();
|
|
13703
13703
|
r.errors = B, H = Te(Q);
|
|
13704
13704
|
} else
|
|
13705
|
-
await
|
|
13705
|
+
await O(n);
|
|
13706
13706
|
if (a.disabled.size)
|
|
13707
13707
|
for (const B of a.disabled)
|
|
13708
13708
|
Ne(H, B);
|
|
13709
|
-
if (Ne(r.errors, "root"),
|
|
13709
|
+
if (Ne(r.errors, "root"), Le(r.errors)) {
|
|
13710
13710
|
m.state.next({
|
|
13711
13711
|
errors: {}
|
|
13712
13712
|
});
|
|
@@ -13720,7 +13720,7 @@ function $S(e = {}) {
|
|
|
13720
13720
|
if (m.state.next({
|
|
13721
13721
|
isSubmitted: !0,
|
|
13722
13722
|
isSubmitting: !1,
|
|
13723
|
-
isSubmitSuccessful:
|
|
13723
|
+
isSubmitSuccessful: Le(r.errors) && !Y,
|
|
13724
13724
|
submitCount: r.submitCount + 1,
|
|
13725
13725
|
errors: r.errors
|
|
13726
13726
|
}), Y)
|
|
@@ -13728,7 +13728,7 @@ function $S(e = {}) {
|
|
|
13728
13728
|
}, te = (x, E = {}) => {
|
|
13729
13729
|
q(n, x) && (xe(E.defaultValue) ? U(x, Te(q(o, x))) : (U(x, E.defaultValue), he(o, x, Te(E.defaultValue))), E.keepTouched || Ne(r.touchedFields, x), E.keepDirty || (Ne(r.dirtyFields, x), r.isDirty = E.defaultValue ? T(x, Te(q(o, x))) : T()), E.keepError || (Ne(r.errors, x), p.isValid && h()), m.state.next({ ...r }));
|
|
13730
13730
|
}, be = (x, E = {}) => {
|
|
13731
|
-
const P = x ? Te(x) : o, Y = Te(P), H =
|
|
13731
|
+
const P = x ? Te(x) : o, Y = Te(P), H = Le(x), B = H ? o : Y;
|
|
13732
13732
|
if (E.keepDefaultValues || (o = P), !E.keepValues) {
|
|
13733
13733
|
if (E.keepDirtyValues) {
|
|
13734
13734
|
const Q = /* @__PURE__ */ new Set([
|
|
@@ -13772,7 +13772,7 @@ function $S(e = {}) {
|
|
|
13772
13772
|
watch: /* @__PURE__ */ new Set(),
|
|
13773
13773
|
watchAll: !1,
|
|
13774
13774
|
focus: ""
|
|
13775
|
-
}, i.mount = !p.isValid || !!E.keepIsValid || !!E.keepDirtyValues || !t.shouldUnregister && !
|
|
13775
|
+
}, i.mount = !p.isValid || !!E.keepIsValid || !!E.keepDirtyValues || !t.shouldUnregister && !Le(B), i.watch = !!t.shouldUnregister, i.action = !1, E.keepErrors || (r.errors = {}), m.state.next({
|
|
13776
13776
|
submitCount: E.keepSubmitCount ? r.submitCount : 0,
|
|
13777
13777
|
isDirty: H ? !1 : E.keepDirty ? r.isDirty : !!(E.keepDefaultValues && !Ct(x, o)),
|
|
13778
13778
|
isSubmitted: E.keepIsSubmitted ? r.isSubmitted : !1,
|
|
@@ -13783,13 +13783,13 @@ function $S(e = {}) {
|
|
|
13783
13783
|
isSubmitting: !1,
|
|
13784
13784
|
defaultValues: o
|
|
13785
13785
|
});
|
|
13786
|
-
}, ve = (x, E) => be(tt(x) ? x(s) : x, E),
|
|
13786
|
+
}, ve = (x, E) => be(tt(x) ? x(s) : x, E), De = (x, E = {}) => {
|
|
13787
13787
|
const P = q(n, x), Y = P && P._f;
|
|
13788
13788
|
if (Y) {
|
|
13789
13789
|
const H = Y.refs ? Y.refs[0] : Y.ref;
|
|
13790
13790
|
H.focus && (H.focus(), E.shouldSelect && tt(H.select) && H.select());
|
|
13791
13791
|
}
|
|
13792
|
-
},
|
|
13792
|
+
}, Oe = (x) => {
|
|
13793
13793
|
r = {
|
|
13794
13794
|
...r,
|
|
13795
13795
|
...x
|
|
@@ -13797,7 +13797,7 @@ function $S(e = {}) {
|
|
|
13797
13797
|
}, He = {
|
|
13798
13798
|
control: {
|
|
13799
13799
|
register: Z,
|
|
13800
|
-
unregister:
|
|
13800
|
+
unregister: $,
|
|
13801
13801
|
getFieldState: W,
|
|
13802
13802
|
handleSubmit: z,
|
|
13803
13803
|
setError: ce,
|
|
@@ -13817,7 +13817,7 @@ function $S(e = {}) {
|
|
|
13817
13817
|
isLoading: !1
|
|
13818
13818
|
});
|
|
13819
13819
|
}),
|
|
13820
|
-
_removeUnmounted:
|
|
13820
|
+
_removeUnmounted: L,
|
|
13821
13821
|
_disableForm: ee,
|
|
13822
13822
|
_subjects: m,
|
|
13823
13823
|
_proxyFormState: p,
|
|
@@ -13865,9 +13865,9 @@ function $S(e = {}) {
|
|
|
13865
13865
|
reset: ve,
|
|
13866
13866
|
resetField: te,
|
|
13867
13867
|
clearErrors: re,
|
|
13868
|
-
unregister:
|
|
13868
|
+
unregister: $,
|
|
13869
13869
|
setError: ce,
|
|
13870
|
-
setFocus:
|
|
13870
|
+
setFocus: De,
|
|
13871
13871
|
getFieldState: W
|
|
13872
13872
|
};
|
|
13873
13873
|
return {
|
|
@@ -14038,16 +14038,16 @@ const HS = ({
|
|
|
14038
14038
|
listPath: A,
|
|
14039
14039
|
// Appearance
|
|
14040
14040
|
icon: _,
|
|
14041
|
-
className:
|
|
14042
|
-
...
|
|
14041
|
+
className: F,
|
|
14042
|
+
...O
|
|
14043
14043
|
}) => {
|
|
14044
14044
|
var He;
|
|
14045
|
-
const
|
|
14046
|
-
l.useEffect(() => (M && T &&
|
|
14045
|
+
const L = Do(), { id: T } = Bi(), M = !!T, I = e == null ? void 0 : e(), G = I == null ? void 0 : I.form, X = (I == null ? void 0 : I.loading) ?? !1, U = ((He = I == null ? void 0 : I.form) == null ? void 0 : He.isSubmitting) ?? !1, D = (I == null ? void 0 : I.fetchAndPopulateForm) || (I == null ? void 0 : I.fetchById) || (I == null ? void 0 : I.fetchOne), j = I == null ? void 0 : I.create, V = I == null ? void 0 : I.update, ne = I == null ? void 0 : I.resetForm, W = p || X, re = f || U;
|
|
14046
|
+
l.useEffect(() => (M && T && D && D(T), () => {
|
|
14047
14047
|
ne == null || ne();
|
|
14048
14048
|
}), [T, M]);
|
|
14049
14049
|
const ce = () => {
|
|
14050
|
-
a ? a() :
|
|
14050
|
+
a ? a() : L(A || -1);
|
|
14051
14051
|
}, de = () => {
|
|
14052
14052
|
i ? i() : ce();
|
|
14053
14053
|
}, ge = async (x) => {
|
|
@@ -14093,7 +14093,7 @@ const HS = ({
|
|
|
14093
14093
|
)
|
|
14094
14094
|
] })
|
|
14095
14095
|
] });
|
|
14096
|
-
return N ? /* @__PURE__ */ R(Qe, { className:
|
|
14096
|
+
return N ? /* @__PURE__ */ R(Qe, { className: F, ...O, children: [
|
|
14097
14097
|
/* @__PURE__ */ u(hr, { children: /* @__PURE__ */ R("div", { className: "flex items-center gap-4", children: [
|
|
14098
14098
|
C && /* @__PURE__ */ u(le, { variant: "ghost", size: "icon", onClick: ce, children: /* @__PURE__ */ u(gt, { className: "h-4 w-4" }) }),
|
|
14099
14099
|
_ && /* @__PURE__ */ u("div", { className: "h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center", children: /* @__PURE__ */ u(_, { className: "h-5 w-5 text-primary" }) }),
|
|
@@ -14103,7 +14103,7 @@ const HS = ({
|
|
|
14103
14103
|
] })
|
|
14104
14104
|
] }) }),
|
|
14105
14105
|
/* @__PURE__ */ u(Je, { children: E })
|
|
14106
|
-
] }) : /* @__PURE__ */ R("div", { className: k("space-y-6",
|
|
14106
|
+
] }) : /* @__PURE__ */ R("div", { className: k("space-y-6", F), ...O, children: [
|
|
14107
14107
|
/* @__PURE__ */ R("div", { className: "flex items-center gap-4", children: [
|
|
14108
14108
|
C && /* @__PURE__ */ u(le, { variant: "ghost", size: "icon", onClick: ce, children: /* @__PURE__ */ u(gt, { className: "h-4 w-4" }) }),
|
|
14109
14109
|
_ && /* @__PURE__ */ u("div", { className: "h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center", children: /* @__PURE__ */ u(_, { className: "h-5 w-5 text-primary" }) }),
|
|
@@ -14120,7 +14120,7 @@ const HS = ({
|
|
|
14120
14120
|
resolver: n ? BS(n) : void 0,
|
|
14121
14121
|
mode: "onBlur"
|
|
14122
14122
|
}), {
|
|
14123
|
-
handleSubmit:
|
|
14123
|
+
handleSubmit: $,
|
|
14124
14124
|
formState: { errors: J, isDirty: Z, isValid: oe },
|
|
14125
14125
|
reset: ee,
|
|
14126
14126
|
watch: z,
|
|
@@ -14136,7 +14136,7 @@ const HS = ({
|
|
|
14136
14136
|
} catch (E) {
|
|
14137
14137
|
console.error("Form submission error:", E);
|
|
14138
14138
|
}
|
|
14139
|
-
},
|
|
14139
|
+
}, De = (x) => {
|
|
14140
14140
|
var bt;
|
|
14141
14141
|
const {
|
|
14142
14142
|
name: E,
|
|
@@ -14148,8 +14148,8 @@ const HS = ({
|
|
|
14148
14148
|
disabled: ue,
|
|
14149
14149
|
options: pe = [],
|
|
14150
14150
|
className: Ae,
|
|
14151
|
-
...
|
|
14152
|
-
} = x, ke = (bt = J[E]) == null ? void 0 : bt.message,
|
|
14151
|
+
...We
|
|
14152
|
+
} = x, ke = (bt = J[E]) == null ? void 0 : bt.message, $e = z(E), Me = {
|
|
14153
14153
|
label: Y,
|
|
14154
14154
|
placeholder: H,
|
|
14155
14155
|
description: B,
|
|
@@ -14171,7 +14171,7 @@ const HS = ({
|
|
|
14171
14171
|
...Me,
|
|
14172
14172
|
type: P,
|
|
14173
14173
|
...me.register(E),
|
|
14174
|
-
...
|
|
14174
|
+
...We
|
|
14175
14175
|
}
|
|
14176
14176
|
);
|
|
14177
14177
|
case "textarea":
|
|
@@ -14180,7 +14180,7 @@ const HS = ({
|
|
|
14180
14180
|
{
|
|
14181
14181
|
...Me,
|
|
14182
14182
|
...me.register(E),
|
|
14183
|
-
...
|
|
14183
|
+
...We
|
|
14184
14184
|
}
|
|
14185
14185
|
);
|
|
14186
14186
|
case "select":
|
|
@@ -14189,9 +14189,9 @@ const HS = ({
|
|
|
14189
14189
|
{
|
|
14190
14190
|
...Me,
|
|
14191
14191
|
options: pe,
|
|
14192
|
-
value:
|
|
14192
|
+
value: $e,
|
|
14193
14193
|
onChange: (Xe) => te(E, Xe, { shouldValidate: !0 }),
|
|
14194
|
-
...
|
|
14194
|
+
...We
|
|
14195
14195
|
}
|
|
14196
14196
|
);
|
|
14197
14197
|
case "search-select":
|
|
@@ -14200,9 +14200,9 @@ const HS = ({
|
|
|
14200
14200
|
{
|
|
14201
14201
|
...Me,
|
|
14202
14202
|
options: pe,
|
|
14203
|
-
value:
|
|
14203
|
+
value: $e,
|
|
14204
14204
|
onChange: (Xe) => te(E, Xe, { shouldValidate: !0 }),
|
|
14205
|
-
...
|
|
14205
|
+
...We
|
|
14206
14206
|
}
|
|
14207
14207
|
);
|
|
14208
14208
|
case "switch":
|
|
@@ -14210,9 +14210,9 @@ const HS = ({
|
|
|
14210
14210
|
Id,
|
|
14211
14211
|
{
|
|
14212
14212
|
...Me,
|
|
14213
|
-
checked:
|
|
14213
|
+
checked: $e,
|
|
14214
14214
|
onCheckedChange: (Xe) => te(E, Xe, { shouldValidate: !0 }),
|
|
14215
|
-
...
|
|
14215
|
+
...We
|
|
14216
14216
|
}
|
|
14217
14217
|
);
|
|
14218
14218
|
case "checkbox":
|
|
@@ -14220,13 +14220,13 @@ const HS = ({
|
|
|
14220
14220
|
Dd,
|
|
14221
14221
|
{
|
|
14222
14222
|
...Me,
|
|
14223
|
-
checked:
|
|
14223
|
+
checked: $e,
|
|
14224
14224
|
onCheckedChange: (Xe) => te(E, Xe, { shouldValidate: !0 }),
|
|
14225
|
-
...
|
|
14225
|
+
...We
|
|
14226
14226
|
}
|
|
14227
14227
|
);
|
|
14228
14228
|
case "custom":
|
|
14229
|
-
return x.render ? x.render({ form: me, field: x, error: ke, value:
|
|
14229
|
+
return x.render ? x.render({ form: me, field: x, error: ke, value: $e }) : null;
|
|
14230
14230
|
default:
|
|
14231
14231
|
return /* @__PURE__ */ u(
|
|
14232
14232
|
Mo,
|
|
@@ -14234,18 +14234,18 @@ const HS = ({
|
|
|
14234
14234
|
...Me,
|
|
14235
14235
|
type: "text",
|
|
14236
14236
|
...me.register(E),
|
|
14237
|
-
...
|
|
14237
|
+
...We
|
|
14238
14238
|
}
|
|
14239
14239
|
);
|
|
14240
14240
|
}
|
|
14241
|
-
},
|
|
14241
|
+
}, Oe = k(
|
|
14242
14242
|
"grid gap-4",
|
|
14243
14243
|
y === 1 && "grid-cols-1",
|
|
14244
14244
|
y === 2 && "grid-cols-1 md:grid-cols-2",
|
|
14245
14245
|
y === 3 && "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
|
|
14246
14246
|
y === 4 && "grid-cols-1 md:grid-cols-2 lg:grid-cols-4"
|
|
14247
|
-
),
|
|
14248
|
-
/* @__PURE__ */ u("div", { className:
|
|
14247
|
+
), Ve = /* @__PURE__ */ R("form", { onSubmit: $(ve), children: [
|
|
14248
|
+
/* @__PURE__ */ u("div", { className: Oe, children: t.map((x) => {
|
|
14249
14249
|
if (x.hidden && (typeof x.hidden == "function" ? x.hidden(z()) : x.hidden))
|
|
14250
14250
|
return null;
|
|
14251
14251
|
const E = x.colSpan || 1, P = k(
|
|
@@ -14254,7 +14254,7 @@ const HS = ({
|
|
|
14254
14254
|
E === 4 && "md:col-span-2 lg:col-span-4",
|
|
14255
14255
|
E === "full" && "col-span-full"
|
|
14256
14256
|
);
|
|
14257
|
-
return /* @__PURE__ */ u("div", { className: P, children:
|
|
14257
|
+
return /* @__PURE__ */ u("div", { className: P, children: De(x) }, x.name);
|
|
14258
14258
|
}) }),
|
|
14259
14259
|
S && /* @__PURE__ */ R("div", { className: "flex items-center justify-end gap-2 mt-6 pt-4 border-t", children: [
|
|
14260
14260
|
i && /* @__PURE__ */ R(
|
|
@@ -14286,7 +14286,7 @@ const HS = ({
|
|
|
14286
14286
|
)
|
|
14287
14287
|
] })
|
|
14288
14288
|
] });
|
|
14289
|
-
return w && (m || g || C) ? /* @__PURE__ */ R(Qe, { className:
|
|
14289
|
+
return w && (m || g || C) ? /* @__PURE__ */ R(Qe, { className: F, ...O, children: [
|
|
14290
14290
|
/* @__PURE__ */ u(hr, { children: /* @__PURE__ */ R("div", { className: "flex items-center gap-4", children: [
|
|
14291
14291
|
C && a && /* @__PURE__ */ u(le, { variant: "ghost", size: "icon", onClick: a, children: /* @__PURE__ */ u(gt, { className: "h-4 w-4" }) }),
|
|
14292
14292
|
/* @__PURE__ */ R("div", { children: [
|
|
@@ -14294,8 +14294,8 @@ const HS = ({
|
|
|
14294
14294
|
g && /* @__PURE__ */ u(vr, { children: g })
|
|
14295
14295
|
] })
|
|
14296
14296
|
] }) }),
|
|
14297
|
-
/* @__PURE__ */ u(Je, { children:
|
|
14298
|
-
] }) : /* @__PURE__ */ u("div", { className:
|
|
14297
|
+
/* @__PURE__ */ u(Je, { children: Ve })
|
|
14298
|
+
] }) : /* @__PURE__ */ u("div", { className: F, ...O, children: Ve });
|
|
14299
14299
|
};
|
|
14300
14300
|
HS.displayName = "CrudForm";
|
|
14301
14301
|
const jS = ({
|
|
@@ -14331,29 +14331,29 @@ const jS = ({
|
|
|
14331
14331
|
// Appearance
|
|
14332
14332
|
icon: A,
|
|
14333
14333
|
className: _,
|
|
14334
|
-
...
|
|
14334
|
+
...F
|
|
14335
14335
|
}) => {
|
|
14336
|
-
const
|
|
14336
|
+
const O = Do(), { id: L } = Bi(), T = e == null ? void 0 : e(), M = T == null ? void 0 : T.currentItem, I = (T == null ? void 0 : T.loading) ?? !1, G = T == null ? void 0 : T.error, X = (T == null ? void 0 : T.fetchById) || (T == null ? void 0 : T.fetchOne), U = T == null ? void 0 : T.delete, D = r || M, j = n || I, V = o || G, [ne, W] = l.useState(!1), [re, ce] = l.useState(!1);
|
|
14337
14337
|
l.useEffect(() => {
|
|
14338
|
-
|
|
14339
|
-
}, [
|
|
14338
|
+
L && X && X(L);
|
|
14339
|
+
}, [L]);
|
|
14340
14340
|
const de = () => {
|
|
14341
|
-
i ? i() :
|
|
14341
|
+
i ? i() : O(d || -1);
|
|
14342
14342
|
}, ge = () => {
|
|
14343
|
-
a ? a(
|
|
14343
|
+
a ? a(D) : p && L && O(`${p}/${L}/edit`);
|
|
14344
14344
|
}, me = async () => {
|
|
14345
14345
|
ce(!0);
|
|
14346
14346
|
try {
|
|
14347
|
-
c ? await c(
|
|
14347
|
+
c ? await c(D) : U && L && (await U(L), de()), W(!1);
|
|
14348
14348
|
} catch (z) {
|
|
14349
14349
|
console.error("Delete error:", z);
|
|
14350
14350
|
} finally {
|
|
14351
14351
|
ce(!1);
|
|
14352
14352
|
}
|
|
14353
|
-
},
|
|
14353
|
+
}, $ = D && y ? y(D) : (D == null ? void 0 : D.name) || (D == null ? void 0 : D.title) || b, J = (z, te) => {
|
|
14354
14354
|
if (z.render)
|
|
14355
|
-
return z.render(te,
|
|
14356
|
-
if (te == null)
|
|
14355
|
+
return D ? z.render(te, D) : /* @__PURE__ */ u("span", { className: "text-muted-foreground", children: "-" });
|
|
14356
|
+
if (te == null || te === "")
|
|
14357
14357
|
return /* @__PURE__ */ u("span", { className: "text-muted-foreground", children: "-" });
|
|
14358
14358
|
switch (z.type) {
|
|
14359
14359
|
case "badge":
|
|
@@ -14368,7 +14368,8 @@ const jS = ({
|
|
|
14368
14368
|
};
|
|
14369
14369
|
return /* @__PURE__ */ u(Hr, { variant: be[te == null ? void 0 : te.toLowerCase()] || "default", children: z.format ? z.format(te) : String(te) });
|
|
14370
14370
|
case "boolean":
|
|
14371
|
-
|
|
14371
|
+
const ve = !!te;
|
|
14372
|
+
return /* @__PURE__ */ u(Hr, { variant: ve ? "success" : "secondary", children: ve ? z.trueLabel || "Yes" : z.falseLabel || "No" });
|
|
14372
14373
|
case "date":
|
|
14373
14374
|
return Ji(te);
|
|
14374
14375
|
case "datetime":
|
|
@@ -14381,7 +14382,7 @@ const jS = ({
|
|
|
14381
14382
|
case "number":
|
|
14382
14383
|
return z.format ? z.format(te) : new Intl.NumberFormat().format(te);
|
|
14383
14384
|
case "list":
|
|
14384
|
-
return Array.isArray(te) ? /* @__PURE__ */ u("div", { className: "flex flex-wrap gap-1", children: te.map((
|
|
14385
|
+
return Array.isArray(te) ? /* @__PURE__ */ u("div", { className: "flex flex-wrap gap-1", children: te.map((De, Oe) => /* @__PURE__ */ u(Hr, { variant: "outline", children: z.getItemLabel ? z.getItemLabel(De) : String(De) }, Oe)) }) : String(te);
|
|
14385
14386
|
case "link":
|
|
14386
14387
|
return /* @__PURE__ */ u(
|
|
14387
14388
|
"a",
|
|
@@ -14417,14 +14418,17 @@ const jS = ({
|
|
|
14417
14418
|
default:
|
|
14418
14419
|
return z.format ? z.format(te) : String(te);
|
|
14419
14420
|
}
|
|
14420
|
-
}, Z = (z) =>
|
|
14421
|
+
}, Z = (z) => {
|
|
14422
|
+
if (D)
|
|
14423
|
+
return z.accessor ? typeof z.accessor == "function" ? z.accessor(D) : D[z.accessor] : D[z.name];
|
|
14424
|
+
}, oe = k(
|
|
14421
14425
|
"grid gap-6",
|
|
14422
14426
|
N === 1 && "grid-cols-1",
|
|
14423
14427
|
N === 2 && "grid-cols-1 md:grid-cols-2",
|
|
14424
14428
|
N === 3 && "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
14425
14429
|
), ee = /* @__PURE__ */ R(Se, { children: [
|
|
14426
14430
|
/* @__PURE__ */ u("div", { className: oe, children: s.map((z) => {
|
|
14427
|
-
if (z.hidden && (typeof z.hidden == "function" ? z.hidden(
|
|
14431
|
+
if (z.hidden && (typeof z.hidden == "function" ? D && z.hidden(D) : z.hidden))
|
|
14428
14432
|
return null;
|
|
14429
14433
|
const te = Z(z), be = z.colSpan || 1, ve = k(
|
|
14430
14434
|
be === 2 && "md:col-span-2",
|
|
@@ -14439,28 +14443,28 @@ const jS = ({
|
|
|
14439
14443
|
/* @__PURE__ */ u("dd", { className: "text-sm", children: J(z, te) })
|
|
14440
14444
|
] }, z.name || z.accessor);
|
|
14441
14445
|
}) }),
|
|
14442
|
-
S && (
|
|
14446
|
+
S && D && (D.created_at || D.updated_at || D.createdAt || D.updatedAt) && /* @__PURE__ */ R(Se, { children: [
|
|
14443
14447
|
/* @__PURE__ */ u(xn, { className: "my-6" }),
|
|
14444
14448
|
/* @__PURE__ */ R("div", { className: "flex flex-wrap gap-6 text-sm text-muted-foreground", children: [
|
|
14445
|
-
(
|
|
14449
|
+
(D.created_at || D.createdAt) && (D.created_at || D.createdAt) !== "" && /* @__PURE__ */ R("div", { className: "flex items-center gap-2", children: [
|
|
14446
14450
|
/* @__PURE__ */ u(Ks, { className: "h-4 w-4" }),
|
|
14447
14451
|
/* @__PURE__ */ R("span", { children: [
|
|
14448
14452
|
"Created: ",
|
|
14449
|
-
Xn(
|
|
14453
|
+
Xn(D.created_at || D.createdAt)
|
|
14450
14454
|
] })
|
|
14451
14455
|
] }),
|
|
14452
|
-
(
|
|
14456
|
+
(D.updated_at || D.updatedAt) && (D.updated_at || D.updatedAt) !== "" && /* @__PURE__ */ R("div", { className: "flex items-center gap-2", children: [
|
|
14453
14457
|
/* @__PURE__ */ u(Ks, { className: "h-4 w-4" }),
|
|
14454
14458
|
/* @__PURE__ */ R("span", { children: [
|
|
14455
14459
|
"Updated: ",
|
|
14456
|
-
Xn(
|
|
14460
|
+
Xn(D.updated_at || D.updatedAt)
|
|
14457
14461
|
] })
|
|
14458
14462
|
] }),
|
|
14459
|
-
(
|
|
14463
|
+
(D.id || D._id) && /* @__PURE__ */ R("div", { className: "flex items-center gap-2", children: [
|
|
14460
14464
|
/* @__PURE__ */ u(up, { className: "h-4 w-4" }),
|
|
14461
14465
|
/* @__PURE__ */ R("span", { children: [
|
|
14462
14466
|
"ID: ",
|
|
14463
|
-
|
|
14467
|
+
D.id || D._id
|
|
14464
14468
|
] })
|
|
14465
14469
|
] })
|
|
14466
14470
|
] })
|
|
@@ -14472,8 +14476,8 @@ const jS = ({
|
|
|
14472
14476
|
/* @__PURE__ */ u(gt, { className: "mr-2 h-4 w-4" }),
|
|
14473
14477
|
h
|
|
14474
14478
|
] })
|
|
14475
|
-
] }) }) }) :
|
|
14476
|
-
/* @__PURE__ */ R("div", { className: k("space-y-6", _), ...
|
|
14479
|
+
] }) }) }) : D ? /* @__PURE__ */ R(Se, { children: [
|
|
14480
|
+
/* @__PURE__ */ R("div", { className: k("space-y-6", _), ...F, children: [
|
|
14477
14481
|
w && /* @__PURE__ */ R("div", { className: "flex items-center justify-between", children: [
|
|
14478
14482
|
/* @__PURE__ */ R("div", { className: "flex items-center gap-4", children: [
|
|
14479
14483
|
/* @__PURE__ */ u(le, { variant: "ghost", size: "icon", onClick: de, children: /* @__PURE__ */ u(gt, { className: "h-4 w-4" }) }),
|
|
@@ -14501,7 +14505,7 @@ const jS = ({
|
|
|
14501
14505
|
)
|
|
14502
14506
|
] })
|
|
14503
14507
|
] }),
|
|
14504
|
-
t(
|
|
14508
|
+
t(D)
|
|
14505
14509
|
] }),
|
|
14506
14510
|
/* @__PURE__ */ u(
|
|
14507
14511
|
pn,
|
|
@@ -14509,7 +14513,7 @@ const jS = ({
|
|
|
14509
14513
|
open: ne,
|
|
14510
14514
|
onOpenChange: W,
|
|
14511
14515
|
onConfirm: me,
|
|
14512
|
-
itemName:
|
|
14516
|
+
itemName: $,
|
|
14513
14517
|
loading: re
|
|
14514
14518
|
}
|
|
14515
14519
|
)
|
|
@@ -14529,8 +14533,8 @@ const jS = ({
|
|
|
14529
14533
|
/* @__PURE__ */ u(gt, { className: "mr-2 h-4 w-4" }),
|
|
14530
14534
|
h
|
|
14531
14535
|
] })
|
|
14532
|
-
] }) }) :
|
|
14533
|
-
/* @__PURE__ */ R(Qe, { className: _, ...
|
|
14536
|
+
] }) }) : D ? /* @__PURE__ */ R(Se, { children: [
|
|
14537
|
+
/* @__PURE__ */ R(Qe, { className: _, ...F, children: [
|
|
14534
14538
|
w && /* @__PURE__ */ R(hr, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
|
|
14535
14539
|
/* @__PURE__ */ R("div", { className: "flex items-center gap-4", children: [
|
|
14536
14540
|
/* @__PURE__ */ u(le, { variant: "ghost", size: "icon", onClick: de, children: /* @__PURE__ */ u(gt, { className: "h-4 w-4" }) }),
|
|
@@ -14565,7 +14569,7 @@ const jS = ({
|
|
|
14565
14569
|
open: ne,
|
|
14566
14570
|
onOpenChange: W,
|
|
14567
14571
|
onConfirm: me,
|
|
14568
|
-
itemName:
|
|
14572
|
+
itemName: $,
|
|
14569
14573
|
loading: re
|
|
14570
14574
|
}
|
|
14571
14575
|
)
|
|
@@ -14658,16 +14662,16 @@ const US = (e) => {
|
|
|
14658
14662
|
...h.filters,
|
|
14659
14663
|
...v
|
|
14660
14664
|
};
|
|
14661
|
-
Object.keys(C).forEach((
|
|
14662
|
-
(C[
|
|
14665
|
+
Object.keys(C).forEach((L) => {
|
|
14666
|
+
(C[L] === void 0 || C[L] === "") && delete C[L];
|
|
14663
14667
|
});
|
|
14664
|
-
const A = (await r.get(n, { params: C })).data, _ = A[d] || A.data || (Array.isArray(A) ? A : []),
|
|
14668
|
+
const A = (await r.get(n, { params: C })).data, _ = A[d] || A.data || (Array.isArray(A) ? A : []), F = A[p] || A.total || _.length, O = Math.ceil(F / h.pageSize);
|
|
14665
14669
|
return m({
|
|
14666
14670
|
items: _.map(o),
|
|
14667
|
-
totalItems:
|
|
14668
|
-
totalPages:
|
|
14671
|
+
totalItems: F,
|
|
14672
|
+
totalPages: O,
|
|
14669
14673
|
loading: !1
|
|
14670
|
-
}), { items: _, totalItems:
|
|
14674
|
+
}), { items: _, totalItems: F, totalPages: O };
|
|
14671
14675
|
} catch (C) {
|
|
14672
14676
|
const N = ((y = (b = C.response) == null ? void 0 : b.data) == null ? void 0 : y.message) || ((S = (w = C.response) == null ? void 0 : w.data) == null ? void 0 : S.detail) || C.message || "Failed to fetch items";
|
|
14673
14677
|
throw m({
|
|
@@ -14722,13 +14726,13 @@ const US = (e) => {
|
|
|
14722
14726
|
m({ submitting: !0, error: null });
|
|
14723
14727
|
try {
|
|
14724
14728
|
const N = s(h), A = await r.patch(`${n}/${v}/`, N), _ = o(A.data);
|
|
14725
|
-
return m((
|
|
14726
|
-
var
|
|
14729
|
+
return m((F) => {
|
|
14730
|
+
var O;
|
|
14727
14731
|
return {
|
|
14728
|
-
items:
|
|
14729
|
-
(
|
|
14732
|
+
items: F.items.map(
|
|
14733
|
+
(L) => L[c] === v ? _ : L
|
|
14730
14734
|
),
|
|
14731
|
-
item: ((
|
|
14735
|
+
item: ((O = F.item) == null ? void 0 : O[c]) === v ? _ : F.item,
|
|
14732
14736
|
submitting: !1
|
|
14733
14737
|
};
|
|
14734
14738
|
}), _;
|
|
@@ -14794,13 +14798,13 @@ const US = (e) => {
|
|
|
14794
14798
|
m({ submitting: !0, error: null });
|
|
14795
14799
|
try {
|
|
14796
14800
|
const N = s(h), A = await r.put(`${n}/${v}/`, N), _ = o(A.data);
|
|
14797
|
-
return m((
|
|
14798
|
-
var
|
|
14801
|
+
return m((F) => {
|
|
14802
|
+
var O;
|
|
14799
14803
|
return {
|
|
14800
|
-
items:
|
|
14801
|
-
(
|
|
14804
|
+
items: F.items.map(
|
|
14805
|
+
(L) => L[c] === v ? _ : L
|
|
14802
14806
|
),
|
|
14803
|
-
item: ((
|
|
14807
|
+
item: ((O = F.item) == null ? void 0 : O[c]) === v ? _ : F.item,
|
|
14804
14808
|
submitting: !1
|
|
14805
14809
|
};
|
|
14806
14810
|
}), _;
|
|
@@ -14901,8 +14905,8 @@ function SC({
|
|
|
14901
14905
|
className: S,
|
|
14902
14906
|
children: C
|
|
14903
14907
|
}) {
|
|
14904
|
-
const [N, A] = It(""), [_,
|
|
14905
|
-
M.preventDefault(), e && await e({ email: N, password: _, rememberMe:
|
|
14908
|
+
const [N, A] = It(""), [_, F] = It(""), [O, L] = It(!1), T = async (M) => {
|
|
14909
|
+
M.preventDefault(), e && await e({ email: N, password: _, rememberMe: O });
|
|
14906
14910
|
};
|
|
14907
14911
|
return /* @__PURE__ */ R("div", { className: k("space-y-6", S), children: [
|
|
14908
14912
|
w && /* @__PURE__ */ u("div", { className: "flex justify-center", children: w }),
|
|
@@ -14945,7 +14949,7 @@ function SC({
|
|
|
14945
14949
|
id: "password",
|
|
14946
14950
|
type: "password",
|
|
14947
14951
|
value: _,
|
|
14948
|
-
onChange: (M) =>
|
|
14952
|
+
onChange: (M) => F(M.target.value),
|
|
14949
14953
|
required: !0,
|
|
14950
14954
|
autoComplete: "current-password"
|
|
14951
14955
|
}
|
|
@@ -14956,8 +14960,8 @@ function SC({
|
|
|
14956
14960
|
br,
|
|
14957
14961
|
{
|
|
14958
14962
|
id: "remember",
|
|
14959
|
-
checked:
|
|
14960
|
-
onCheckedChange:
|
|
14963
|
+
checked: O,
|
|
14964
|
+
onCheckedChange: L
|
|
14961
14965
|
}
|
|
14962
14966
|
),
|
|
14963
14967
|
/* @__PURE__ */ u(Dt, { htmlFor: "remember", className: "text-sm font-normal cursor-pointer", children: c })
|
|
@@ -15025,7 +15029,7 @@ function GS({
|
|
|
15025
15029
|
headerSlot: m,
|
|
15026
15030
|
footerSlot: g
|
|
15027
15031
|
}) {
|
|
15028
|
-
var
|
|
15032
|
+
var O, L;
|
|
15029
15033
|
const { isOpen: v, isCollapsed: h, setOpen: b, toggleCollapse: y } = Is(), w = ji(), [S, C] = It([]), N = (T) => {
|
|
15030
15034
|
C(
|
|
15031
15035
|
(M) => M.includes(T) ? M.filter((I) => I !== T) : [...M, T]
|
|
@@ -15038,7 +15042,7 @@ function GS({
|
|
|
15038
15042
|
] }, T.title);
|
|
15039
15043
|
if (f)
|
|
15040
15044
|
return f(T, { isCollapsed: h, isSubItem: M, location: w });
|
|
15041
|
-
const I = T.icon, G = T.children && T.children.length > 0, X = S.includes(T.label), U = T.path && w.pathname.startsWith(T.path),
|
|
15045
|
+
const I = T.icon, G = T.children && T.children.length > 0, X = S.includes(T.label), U = T.path && w.pathname.startsWith(T.path), D = G && T.children.some(
|
|
15042
15046
|
(j) => w.pathname.startsWith(j.path)
|
|
15043
15047
|
);
|
|
15044
15048
|
return G ? /* @__PURE__ */ R("div", { children: [
|
|
@@ -15048,7 +15052,7 @@ function GS({
|
|
|
15048
15052
|
onClick: () => N(T.label),
|
|
15049
15053
|
className: k(
|
|
15050
15054
|
"w-full flex items-center gap-3 px-3 py-2 rounded-lg transition-colors text-sm",
|
|
15051
|
-
|
|
15055
|
+
D ? "bg-sidebar-accent text-sidebar-accent-foreground" : "hover:bg-sidebar-accent text-sidebar-foreground hover:text-sidebar-accent-foreground",
|
|
15052
15056
|
h && "justify-center px-2"
|
|
15053
15057
|
),
|
|
15054
15058
|
title: h ? T.label : void 0,
|
|
@@ -15113,7 +15117,7 @@ function GS({
|
|
|
15113
15117
|
children: h ? /* @__PURE__ */ u(yn, { className: "h-4 w-4 text-sidebar-foreground" }) : /* @__PURE__ */ u(ta, { className: "h-4 w-4 text-sidebar-foreground" })
|
|
15114
15118
|
}
|
|
15115
15119
|
)
|
|
15116
|
-
] }),
|
|
15120
|
+
] }), F = o && a && /* @__PURE__ */ u("div", { className: "px-3 py-3 border-t border-sidebar-border", children: /* @__PURE__ */ R(ad, { children: [
|
|
15117
15121
|
/* @__PURE__ */ u(ld, { asChild: !0, children: /* @__PURE__ */ R(
|
|
15118
15122
|
"button",
|
|
15119
15123
|
{
|
|
@@ -15125,8 +15129,8 @@ function GS({
|
|
|
15125
15129
|
/* @__PURE__ */ R(Xc, { className: "h-8 w-8", children: [
|
|
15126
15130
|
/* @__PURE__ */ u(Zc, { src: o.avatar, alt: o.firstName || "User" }),
|
|
15127
15131
|
/* @__PURE__ */ R(Qc, { className: "bg-sidebar-primary text-sidebar-primary-foreground text-xs", children: [
|
|
15128
|
-
((
|
|
15129
|
-
((
|
|
15132
|
+
((O = o.firstName) == null ? void 0 : O[0]) || "U",
|
|
15133
|
+
((L = o.lastName) == null ? void 0 : L[0]) || ""
|
|
15130
15134
|
] })
|
|
15131
15135
|
] }),
|
|
15132
15136
|
!h && /* @__PURE__ */ R("div", { className: "flex-1 text-left", children: [
|
|
@@ -15177,7 +15181,7 @@ function GS({
|
|
|
15177
15181
|
children: [
|
|
15178
15182
|
m || _,
|
|
15179
15183
|
/* @__PURE__ */ u("nav", { className: "flex-1 overflow-y-auto px-3 py-3", children: /* @__PURE__ */ u("div", { className: "space-y-1", children: e.map((T) => A(T)) }) }),
|
|
15180
|
-
g ||
|
|
15184
|
+
g || F
|
|
15181
15185
|
]
|
|
15182
15186
|
}
|
|
15183
15187
|
)
|