ynotsoft-dynamic-form 1.0.100 → 1.0.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dynamic-form.js +298 -290
- package/dist/dynamic-form.umd.cjs +17 -17
- package/package.json +1 -1
package/dist/dynamic-form.js
CHANGED
|
@@ -267,12 +267,12 @@ function dl({
|
|
|
267
267
|
apiClient: s,
|
|
268
268
|
...i
|
|
269
269
|
}) {
|
|
270
|
-
const c = a, l = e.selectMode !== "multiple", d = e.returnValueOnly === !0, [m, g] = ue([]), [h, w] = ue(!1), [p, v] = ue(!1), [
|
|
270
|
+
const c = a, l = e.selectMode !== "multiple", d = e.returnValueOnly === !0, [m, g] = ue([]), [h, w] = ue(!1), [p, v] = ue(!1), [k, A] = ue(""), [C, y] = ue(-1), [E, I] = ue({}), O = Yt(null), T = Yt(null), z = Yt(null), H = t[e.name], q = sr(() => H ? (Array.isArray(H) ? H : [H]).map((L) => {
|
|
271
271
|
if (L && typeof L == "object" && L.value !== void 0)
|
|
272
272
|
return { value: L.value, label: L.label || L.value };
|
|
273
273
|
const U = m.find((G) => G.value === L);
|
|
274
|
-
return U || (
|
|
275
|
-
}) : [], [H, m,
|
|
274
|
+
return U || (E[L] ? E[L] : { value: L, label: L });
|
|
275
|
+
}) : [], [H, m, E])(), x = sr(
|
|
276
276
|
async (S = "") => {
|
|
277
277
|
if (e.onSearch) {
|
|
278
278
|
const L = await e.onSearch(S, t);
|
|
@@ -319,7 +319,7 @@ function dl({
|
|
|
319
319
|
const G = Array.isArray(H) ? H : [];
|
|
320
320
|
U = G.some((Y) => (Y?.value ?? Y) === S.value) ? G.filter((Y) => (Y?.value ?? Y) !== S.value) : [...G, L];
|
|
321
321
|
}
|
|
322
|
-
n(e.name, U), r(e.name), e.clearSearchOnSelect &&
|
|
322
|
+
n(e.name, U), r(e.name), e.clearSearchOnSelect && A("");
|
|
323
323
|
},
|
|
324
324
|
[
|
|
325
325
|
H,
|
|
@@ -353,16 +353,16 @@ function dl({
|
|
|
353
353
|
}
|
|
354
354
|
}, P = (S) => {
|
|
355
355
|
const L = S.target.value;
|
|
356
|
-
|
|
356
|
+
A(L), y(-1), z.current && clearTimeout(z.current), z.current = setTimeout(() => x(L), 300);
|
|
357
357
|
};
|
|
358
358
|
He(() => {
|
|
359
359
|
if (p) {
|
|
360
|
-
x(
|
|
360
|
+
x(k);
|
|
361
361
|
const S = setTimeout(() => T.current?.focus(), 50);
|
|
362
362
|
return () => clearTimeout(S);
|
|
363
363
|
} else
|
|
364
364
|
y(-1);
|
|
365
|
-
}, [p, x,
|
|
365
|
+
}, [p, x, k]), He(() => {
|
|
366
366
|
if (!p) return;
|
|
367
367
|
const S = (L) => {
|
|
368
368
|
O.current && !O.current.contains(L.target) && (v(!1), r(e.name));
|
|
@@ -441,7 +441,7 @@ function dl({
|
|
|
441
441
|
"aria-autocomplete": "list",
|
|
442
442
|
"aria-controls": `${e.name}-listbox`,
|
|
443
443
|
"aria-activedescendant": C >= 0 ? `${e.name}-opt-${C}` : void 0,
|
|
444
|
-
value:
|
|
444
|
+
value: k,
|
|
445
445
|
onChange: P,
|
|
446
446
|
onKeyDown: R,
|
|
447
447
|
className: "w-full h-9 pl-9 pr-3 text-sm bg-transparent border border-input rounded-md focus:outline-none focus:ring-1 focus:ring-ring",
|
|
@@ -620,30 +620,30 @@ function _a(e) {
|
|
|
620
620
|
t,
|
|
621
621
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
622
622
|
), s = (p) => {
|
|
623
|
-
const { scope: v, children:
|
|
624
|
-
return /* @__PURE__ */ u(o, { scope: v, itemMap: C, collectionRef:
|
|
623
|
+
const { scope: v, children: k } = p, A = Te.useRef(null), C = Te.useRef(/* @__PURE__ */ new Map()).current;
|
|
624
|
+
return /* @__PURE__ */ u(o, { scope: v, itemMap: C, collectionRef: A, children: k });
|
|
625
625
|
};
|
|
626
626
|
s.displayName = t;
|
|
627
627
|
const i = e + "CollectionSlot", c = /* @__PURE__ */ Ce(i), l = Te.forwardRef(
|
|
628
628
|
(p, v) => {
|
|
629
|
-
const { scope:
|
|
630
|
-
return /* @__PURE__ */ u(c, { ref: y, children:
|
|
629
|
+
const { scope: k, children: A } = p, C = a(i, k), y = ie(v, C.collectionRef);
|
|
630
|
+
return /* @__PURE__ */ u(c, { ref: y, children: A });
|
|
631
631
|
}
|
|
632
632
|
);
|
|
633
633
|
l.displayName = i;
|
|
634
634
|
const d = e + "CollectionItemSlot", m = "data-radix-collection-item", g = /* @__PURE__ */ Ce(d), h = Te.forwardRef(
|
|
635
635
|
(p, v) => {
|
|
636
|
-
const { scope:
|
|
637
|
-
return Te.useEffect(() => (I.itemMap.set(y, { ref: y, ...C }), () => void I.itemMap.delete(y))), /* @__PURE__ */ u(g, { [m]: "", ref:
|
|
636
|
+
const { scope: k, children: A, ...C } = p, y = Te.useRef(null), E = ie(v, y), I = a(d, k);
|
|
637
|
+
return Te.useEffect(() => (I.itemMap.set(y, { ref: y, ...C }), () => void I.itemMap.delete(y))), /* @__PURE__ */ u(g, { [m]: "", ref: E, children: A });
|
|
638
638
|
}
|
|
639
639
|
);
|
|
640
640
|
h.displayName = d;
|
|
641
641
|
function w(p) {
|
|
642
642
|
const v = a(e + "CollectionConsumer", p);
|
|
643
643
|
return Te.useCallback(() => {
|
|
644
|
-
const
|
|
645
|
-
if (!
|
|
646
|
-
const C = Array.from(
|
|
644
|
+
const A = v.collectionRef.current;
|
|
645
|
+
if (!A) return [];
|
|
646
|
+
const C = Array.from(A.querySelectorAll(`[${m}]`));
|
|
647
647
|
return Array.from(v.itemMap.values()).sort(
|
|
648
648
|
(I, O) => C.indexOf(I.ref.current) - C.indexOf(O.ref.current)
|
|
649
649
|
);
|
|
@@ -717,7 +717,7 @@ var Sl = "DismissableLayer", Pr = "dismissableLayer.update", Cl = "dismissableLa
|
|
|
717
717
|
onInteractOutside: s,
|
|
718
718
|
onDismiss: i,
|
|
719
719
|
...c
|
|
720
|
-
} = e, l = f.useContext(Da), [d, m] = f.useState(null), g = d?.ownerDocument ?? globalThis?.document, [, h] = f.useState({}), w = ie(t, (O) => m(O)), p = Array.from(l.layers), [v] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1),
|
|
720
|
+
} = e, l = f.useContext(Da), [d, m] = f.useState(null), g = d?.ownerDocument ?? globalThis?.document, [, h] = f.useState({}), w = ie(t, (O) => m(O)), p = Array.from(l.layers), [v] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), k = p.indexOf(v), A = d ? p.indexOf(d) : -1, C = l.layersWithOutsidePointerEventsDisabled.size > 0, y = A >= k, E = Nl((O) => {
|
|
721
721
|
const T = O.target, z = [...l.branches].some((H) => H.contains(T));
|
|
722
722
|
!y || z || (o?.(O), s?.(O), O.defaultPrevented || i?.());
|
|
723
723
|
}, g), I = Tl((O) => {
|
|
@@ -725,7 +725,7 @@ var Sl = "DismissableLayer", Pr = "dismissableLayer.update", Cl = "dismissableLa
|
|
|
725
725
|
[...l.branches].some((H) => H.contains(T)) || (a?.(O), s?.(O), O.defaultPrevented || i?.());
|
|
726
726
|
}, g);
|
|
727
727
|
return xl((O) => {
|
|
728
|
-
|
|
728
|
+
A === l.layers.size - 1 && (r?.(O), !O.defaultPrevented && i && (O.preventDefault(), i()));
|
|
729
729
|
}, g), f.useEffect(() => {
|
|
730
730
|
if (d)
|
|
731
731
|
return n && (l.layersWithOutsidePointerEventsDisabled.size === 0 && (Do = g.body.style.pointerEvents, g.body.style.pointerEvents = "none"), l.layersWithOutsidePointerEventsDisabled.add(d)), l.layers.add(d), Io(), () => {
|
|
@@ -749,7 +749,7 @@ var Sl = "DismissableLayer", Pr = "dismissableLayer.update", Cl = "dismissableLa
|
|
|
749
749
|
onBlurCapture: J(e.onBlurCapture, I.onBlurCapture),
|
|
750
750
|
onPointerDownCapture: J(
|
|
751
751
|
e.onPointerDownCapture,
|
|
752
|
-
|
|
752
|
+
E.onPointerDownCapture
|
|
753
753
|
)
|
|
754
754
|
}
|
|
755
755
|
);
|
|
@@ -882,15 +882,15 @@ var Pl = [
|
|
|
882
882
|
if (h.paused || !i) return;
|
|
883
883
|
const y = C.relatedTarget;
|
|
884
884
|
y !== null && (i.contains(y) || Je(m.current, { select: !0 }));
|
|
885
|
-
},
|
|
885
|
+
}, k = function(C) {
|
|
886
886
|
if (document.activeElement === document.body)
|
|
887
|
-
for (const
|
|
888
|
-
|
|
887
|
+
for (const E of C)
|
|
888
|
+
E.removedNodes.length > 0 && Je(i);
|
|
889
889
|
};
|
|
890
890
|
document.addEventListener("focusin", p), document.addEventListener("focusout", v);
|
|
891
|
-
const
|
|
892
|
-
return i &&
|
|
893
|
-
document.removeEventListener("focusin", p), document.removeEventListener("focusout", v),
|
|
891
|
+
const A = new MutationObserver(k);
|
|
892
|
+
return i && A.observe(i, { childList: !0, subtree: !0 }), () => {
|
|
893
|
+
document.removeEventListener("focusin", p), document.removeEventListener("focusout", v), A.disconnect();
|
|
894
894
|
};
|
|
895
895
|
}
|
|
896
896
|
}, [r, i, h.paused]), f.useEffect(() => {
|
|
@@ -898,13 +898,13 @@ var Pl = [
|
|
|
898
898
|
Wo.add(h);
|
|
899
899
|
const p = document.activeElement;
|
|
900
900
|
if (!i.contains(p)) {
|
|
901
|
-
const
|
|
902
|
-
i.addEventListener(lr, l), i.dispatchEvent(
|
|
901
|
+
const k = new CustomEvent(lr, Fo);
|
|
902
|
+
i.addEventListener(lr, l), i.dispatchEvent(k), k.defaultPrevented || (_l(Fl(Fa(i)), { select: !0 }), document.activeElement === p && Je(i));
|
|
903
903
|
}
|
|
904
904
|
return () => {
|
|
905
905
|
i.removeEventListener(lr, l), setTimeout(() => {
|
|
906
|
-
const
|
|
907
|
-
i.addEventListener(ur, d), i.dispatchEvent(
|
|
906
|
+
const k = new CustomEvent(ur, Fo);
|
|
907
|
+
i.addEventListener(ur, d), i.dispatchEvent(k), k.defaultPrevented || Je(p ?? document.body, { select: !0 }), i.removeEventListener(ur, d), Wo.remove(h);
|
|
908
908
|
}, 0);
|
|
909
909
|
};
|
|
910
910
|
}
|
|
@@ -912,10 +912,10 @@ var Pl = [
|
|
|
912
912
|
const w = f.useCallback(
|
|
913
913
|
(p) => {
|
|
914
914
|
if (!n && !r || h.paused) return;
|
|
915
|
-
const v = p.key === "Tab" && !p.altKey && !p.ctrlKey && !p.metaKey,
|
|
916
|
-
if (v &&
|
|
917
|
-
const
|
|
918
|
-
C && y ? !p.shiftKey &&
|
|
915
|
+
const v = p.key === "Tab" && !p.altKey && !p.ctrlKey && !p.metaKey, k = document.activeElement;
|
|
916
|
+
if (v && k) {
|
|
917
|
+
const A = p.currentTarget, [C, y] = Ml(A);
|
|
918
|
+
C && y ? !p.shiftKey && k === y ? (p.preventDefault(), n && Je(C, { select: !0 })) : p.shiftKey && k === C && (p.preventDefault(), n && Je(y, { select: !0 })) : k === A && p.preventDefault();
|
|
919
919
|
}
|
|
920
920
|
},
|
|
921
921
|
[n, r, h.paused]
|
|
@@ -1165,13 +1165,13 @@ const Ql = async (e, t, n) => {
|
|
|
1165
1165
|
for (let p = 0; p < i.length; p++) {
|
|
1166
1166
|
const {
|
|
1167
1167
|
name: v,
|
|
1168
|
-
fn:
|
|
1168
|
+
fn: k
|
|
1169
1169
|
} = i[p], {
|
|
1170
|
-
x:
|
|
1170
|
+
x: A,
|
|
1171
1171
|
y: C,
|
|
1172
1172
|
data: y,
|
|
1173
|
-
reset:
|
|
1174
|
-
} = await
|
|
1173
|
+
reset: E
|
|
1174
|
+
} = await k({
|
|
1175
1175
|
x: d,
|
|
1176
1176
|
y: m,
|
|
1177
1177
|
initialPlacement: r,
|
|
@@ -1185,17 +1185,17 @@ const Ql = async (e, t, n) => {
|
|
|
1185
1185
|
floating: t
|
|
1186
1186
|
}
|
|
1187
1187
|
});
|
|
1188
|
-
d =
|
|
1188
|
+
d = A ?? d, m = C ?? m, h = {
|
|
1189
1189
|
...h,
|
|
1190
1190
|
[v]: {
|
|
1191
1191
|
...h[v],
|
|
1192
1192
|
...y
|
|
1193
1193
|
}
|
|
1194
|
-
},
|
|
1194
|
+
}, E && w <= 50 && (w++, typeof E == "object" && (E.placement && (g = E.placement), E.rects && (l = E.rects === !0 ? await s.getElementRects({
|
|
1195
1195
|
reference: e,
|
|
1196
1196
|
floating: t,
|
|
1197
1197
|
strategy: o
|
|
1198
|
-
}) :
|
|
1198
|
+
}) : E.rects), {
|
|
1199
1199
|
x: d,
|
|
1200
1200
|
y: m
|
|
1201
1201
|
} = Uo(l, g, c)), p = -1);
|
|
@@ -1224,12 +1224,12 @@ async function qt(e, t) {
|
|
|
1224
1224
|
elementContext: m = "floating",
|
|
1225
1225
|
altBoundary: g = !1,
|
|
1226
1226
|
padding: h = 0
|
|
1227
|
-
} = Ke(t, e), w = $a(h), v = i[g ? m === "floating" ? "reference" : "floating" : m],
|
|
1227
|
+
} = Ke(t, e), w = $a(h), v = i[g ? m === "floating" ? "reference" : "floating" : m], k = An(await a.getClippingRect({
|
|
1228
1228
|
element: (n = await (a.isElement == null ? void 0 : a.isElement(v))) == null || n ? v : v.contextElement || await (a.getDocumentElement == null ? void 0 : a.getDocumentElement(i.floating)),
|
|
1229
1229
|
boundary: l,
|
|
1230
1230
|
rootBoundary: d,
|
|
1231
1231
|
strategy: c
|
|
1232
|
-
})),
|
|
1232
|
+
})), A = m === "floating" ? {
|
|
1233
1233
|
x: r,
|
|
1234
1234
|
y: o,
|
|
1235
1235
|
width: s.floating.width,
|
|
@@ -1240,17 +1240,17 @@ async function qt(e, t) {
|
|
|
1240
1240
|
} : {
|
|
1241
1241
|
x: 1,
|
|
1242
1242
|
y: 1
|
|
1243
|
-
},
|
|
1243
|
+
}, E = An(a.convertOffsetParentRelativeRectToViewportRelativeRect ? await a.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
1244
1244
|
elements: i,
|
|
1245
|
-
rect:
|
|
1245
|
+
rect: A,
|
|
1246
1246
|
offsetParent: C,
|
|
1247
1247
|
strategy: c
|
|
1248
|
-
}) :
|
|
1248
|
+
}) : A);
|
|
1249
1249
|
return {
|
|
1250
|
-
top: (
|
|
1251
|
-
bottom: (
|
|
1252
|
-
left: (
|
|
1253
|
-
right: (
|
|
1250
|
+
top: (k.top - E.top + w.top) / y.y,
|
|
1251
|
+
bottom: (E.bottom - k.bottom + w.bottom) / y.y,
|
|
1252
|
+
left: (k.left - E.left + w.left) / y.x,
|
|
1253
|
+
right: (E.right - k.right + w.right) / y.x
|
|
1254
1254
|
};
|
|
1255
1255
|
}
|
|
1256
1256
|
const Zl = (e) => ({
|
|
@@ -1274,10 +1274,10 @@ const Zl = (e) => ({
|
|
|
1274
1274
|
const m = $a(d), g = {
|
|
1275
1275
|
x: n,
|
|
1276
1276
|
y: r
|
|
1277
|
-
}, h = eo(o), w = Jr(h), p = await s.getDimensions(l), v = h === "y",
|
|
1277
|
+
}, h = eo(o), w = Jr(h), p = await s.getDimensions(l), v = h === "y", k = v ? "top" : "left", A = v ? "bottom" : "right", C = v ? "clientHeight" : "clientWidth", y = a.reference[w] + a.reference[h] - g[h] - a.floating[w], E = g[h] - a.reference[h], I = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l));
|
|
1278
1278
|
let O = I ? I[C] : 0;
|
|
1279
1279
|
(!O || !await (s.isElement == null ? void 0 : s.isElement(I))) && (O = i.floating[C] || a.floating[w]);
|
|
1280
|
-
const T = y / 2 -
|
|
1280
|
+
const T = y / 2 - E / 2, z = O / 2 - p[w] / 2 - 1, H = tt(m[k], z), V = tt(m[A], z), q = H, x = O - p[w] - V, N = O / 2 - p[w] / 2 + T, R = Rr(q, N, x), P = !c.arrow && Ot(o) != null && N !== R && a.reference[w] / 2 - (N < q ? H : V) - p[w] / 2 < 0, _ = P ? N < q ? N - q : N - x : 0;
|
|
1281
1281
|
return {
|
|
1282
1282
|
[h]: g[h] + _,
|
|
1283
1283
|
data: {
|
|
@@ -1314,11 +1314,11 @@ const Zl = (e) => ({
|
|
|
1314
1314
|
} = Ke(e, t);
|
|
1315
1315
|
if ((n = a.arrow) != null && n.alignmentOffset)
|
|
1316
1316
|
return {};
|
|
1317
|
-
const
|
|
1318
|
-
!g && I &&
|
|
1319
|
-
const O = [i, ...
|
|
1317
|
+
const k = Xe(o), A = ze(i), C = Xe(i) === i, y = await (c.isRTL == null ? void 0 : c.isRTL(l.floating)), E = g || (C || !p ? [kn(i)] : Vl(i)), I = w !== "none";
|
|
1318
|
+
!g && I && E.push(...Kl(i, p, w, y));
|
|
1319
|
+
const O = [i, ...E], T = await qt(t, v), z = [];
|
|
1320
1320
|
let H = ((r = a.flip) == null ? void 0 : r.overflows) || [];
|
|
1321
|
-
if (d && z.push(T[
|
|
1321
|
+
if (d && z.push(T[k]), m) {
|
|
1322
1322
|
const N = jl(o, s, y);
|
|
1323
1323
|
z.push(T[N[0]], T[N[1]]);
|
|
1324
1324
|
}
|
|
@@ -1328,9 +1328,9 @@ const Zl = (e) => ({
|
|
|
1328
1328
|
}], !z.every((N) => N <= 0)) {
|
|
1329
1329
|
var V, q;
|
|
1330
1330
|
const N = (((V = a.flip) == null ? void 0 : V.index) || 0) + 1, R = O[N];
|
|
1331
|
-
if (R && (!(m === "alignment" ?
|
|
1331
|
+
if (R && (!(m === "alignment" ? A !== ze(R) : !1) || // We leave the current main axis only if every placement on that axis
|
|
1332
1332
|
// overflows the main axis.
|
|
1333
|
-
H.every((S) => ze(S.placement) ===
|
|
1333
|
+
H.every((S) => ze(S.placement) === A ? S.overflows[0] > 0 : !0)))
|
|
1334
1334
|
return {
|
|
1335
1335
|
data: {
|
|
1336
1336
|
index: N,
|
|
@@ -1348,7 +1348,7 @@ const Zl = (e) => ({
|
|
|
1348
1348
|
const _ = (x = H.filter((S) => {
|
|
1349
1349
|
if (I) {
|
|
1350
1350
|
const L = ze(S.placement);
|
|
1351
|
-
return L ===
|
|
1351
|
+
return L === A || // Create a bias to the `y` side axis due to horizontal
|
|
1352
1352
|
// reading directions favoring greater width.
|
|
1353
1353
|
L === "y";
|
|
1354
1354
|
}
|
|
@@ -1489,12 +1489,12 @@ const nu = function(e) {
|
|
|
1489
1489
|
limiter: i = {
|
|
1490
1490
|
fn: (v) => {
|
|
1491
1491
|
let {
|
|
1492
|
-
x:
|
|
1493
|
-
y:
|
|
1492
|
+
x: k,
|
|
1493
|
+
y: A
|
|
1494
1494
|
} = v;
|
|
1495
1495
|
return {
|
|
1496
|
-
x:
|
|
1497
|
-
y:
|
|
1496
|
+
x: k,
|
|
1497
|
+
y: A
|
|
1498
1498
|
};
|
|
1499
1499
|
}
|
|
1500
1500
|
},
|
|
@@ -1505,12 +1505,12 @@ const nu = function(e) {
|
|
|
1505
1505
|
}, d = await qt(t, c), m = ze(Xe(o)), g = Zr(m);
|
|
1506
1506
|
let h = l[g], w = l[m];
|
|
1507
1507
|
if (a) {
|
|
1508
|
-
const v = g === "y" ? "top" : "left",
|
|
1509
|
-
h = Rr(
|
|
1508
|
+
const v = g === "y" ? "top" : "left", k = g === "y" ? "bottom" : "right", A = h + d[v], C = h - d[k];
|
|
1509
|
+
h = Rr(A, h, C);
|
|
1510
1510
|
}
|
|
1511
1511
|
if (s) {
|
|
1512
|
-
const v = m === "y" ? "top" : "left",
|
|
1513
|
-
w = Rr(
|
|
1512
|
+
const v = m === "y" ? "top" : "left", k = m === "y" ? "bottom" : "right", A = w + d[v], C = w - d[k];
|
|
1513
|
+
w = Rr(A, w, C);
|
|
1514
1514
|
}
|
|
1515
1515
|
const p = i.fn({
|
|
1516
1516
|
...t,
|
|
@@ -1558,13 +1558,13 @@ const nu = function(e) {
|
|
|
1558
1558
|
...p
|
|
1559
1559
|
};
|
|
1560
1560
|
if (c) {
|
|
1561
|
-
const C = g === "y" ? "height" : "width", y = a.reference[g] - a.floating[C] + v.mainAxis,
|
|
1562
|
-
h < y ? h = y : h >
|
|
1561
|
+
const C = g === "y" ? "height" : "width", y = a.reference[g] - a.floating[C] + v.mainAxis, E = a.reference[g] + a.reference[C] - v.mainAxis;
|
|
1562
|
+
h < y ? h = y : h > E && (h = E);
|
|
1563
1563
|
}
|
|
1564
1564
|
if (l) {
|
|
1565
|
-
var
|
|
1566
|
-
const C = g === "y" ? "width" : "height", y = Wa.has(Xe(o)),
|
|
1567
|
-
w <
|
|
1565
|
+
var k, A;
|
|
1566
|
+
const C = g === "y" ? "width" : "height", y = Wa.has(Xe(o)), E = a.reference[m] - a.floating[C] + (y && ((k = s.offset) == null ? void 0 : k[m]) || 0) + (y ? 0 : v.crossAxis), I = a.reference[m] + a.reference[C] + (y ? 0 : ((A = s.offset) == null ? void 0 : A[m]) || 0) - (y ? v.crossAxis : 0);
|
|
1567
|
+
w < E ? w = E : w > I && (w = I);
|
|
1568
1568
|
}
|
|
1569
1569
|
return {
|
|
1570
1570
|
[g]: h,
|
|
@@ -1591,11 +1591,11 @@ const nu = function(e) {
|
|
|
1591
1591
|
width: w,
|
|
1592
1592
|
height: p
|
|
1593
1593
|
} = a.floating;
|
|
1594
|
-
let v,
|
|
1595
|
-
m === "top" || m === "bottom" ? (v = m,
|
|
1596
|
-
const
|
|
1597
|
-
let O = y, T =
|
|
1598
|
-
if ((n = t.middlewareData.shift) != null && n.enabled.x && (T = C), (r = t.middlewareData.shift) != null && r.enabled.y && (O =
|
|
1594
|
+
let v, k;
|
|
1595
|
+
m === "top" || m === "bottom" ? (v = m, k = g === (await (s.isRTL == null ? void 0 : s.isRTL(i.floating)) ? "start" : "end") ? "left" : "right") : (k = m, v = g === "end" ? "top" : "bottom");
|
|
1596
|
+
const A = p - d.top - d.bottom, C = w - d.left - d.right, y = tt(p - d[v], A), E = tt(w - d[k], C), I = !t.middlewareData.shift;
|
|
1597
|
+
let O = y, T = E;
|
|
1598
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (T = C), (r = t.middlewareData.shift) != null && r.enabled.y && (O = A), I && !g) {
|
|
1599
1599
|
const H = Ee(d.left, 0), V = Ee(d.right, 0), q = Ee(d.top, 0), x = Ee(d.bottom, 0);
|
|
1600
1600
|
h ? T = w - 2 * (H !== 0 || V !== 0 ? H + V : Ee(d.left, d.right)) : O = p - 2 * (q !== 0 || x !== 0 ? q + x : Ee(d.top, d.bottom));
|
|
1601
1601
|
}
|
|
@@ -1777,7 +1777,7 @@ function ft(e, t, n, r) {
|
|
|
1777
1777
|
const g = ke(a), h = r && Me(r) ? ke(r) : r;
|
|
1778
1778
|
let w = g, p = _r(w);
|
|
1779
1779
|
for (; p && r && h !== w; ) {
|
|
1780
|
-
const v = At(p),
|
|
1780
|
+
const v = At(p), k = p.getBoundingClientRect(), A = De(p), C = k.left + (p.clientLeft + parseFloat(A.paddingLeft)) * v.x, y = k.top + (p.clientTop + parseFloat(A.paddingTop)) * v.y;
|
|
1781
1781
|
c *= v.x, l *= v.y, d *= v.x, m *= v.y, c += C, l += y, w = ke(p), p = _r(w);
|
|
1782
1782
|
}
|
|
1783
1783
|
}
|
|
@@ -2035,12 +2035,12 @@ function Ru(e, t) {
|
|
|
2035
2035
|
} = l;
|
|
2036
2036
|
if (i || t(), !g || !h)
|
|
2037
2037
|
return;
|
|
2038
|
-
const w = ln(m), p = ln(o.clientWidth - (d + g)), v = ln(o.clientHeight - (m + h)),
|
|
2039
|
-
rootMargin: -w + "px " + -p + "px " + -v + "px " + -
|
|
2038
|
+
const w = ln(m), p = ln(o.clientWidth - (d + g)), v = ln(o.clientHeight - (m + h)), k = ln(d), C = {
|
|
2039
|
+
rootMargin: -w + "px " + -p + "px " + -v + "px " + -k + "px",
|
|
2040
2040
|
threshold: Ee(0, tt(1, c)) || 1
|
|
2041
2041
|
};
|
|
2042
2042
|
let y = !0;
|
|
2043
|
-
function
|
|
2043
|
+
function E(I) {
|
|
2044
2044
|
const O = I[0].intersectionRatio;
|
|
2045
2045
|
if (O !== c) {
|
|
2046
2046
|
if (!y)
|
|
@@ -2052,13 +2052,13 @@ function Ru(e, t) {
|
|
|
2052
2052
|
O === 1 && !Ya(l, e.getBoundingClientRect()) && s(), y = !1;
|
|
2053
2053
|
}
|
|
2054
2054
|
try {
|
|
2055
|
-
n = new IntersectionObserver(
|
|
2055
|
+
n = new IntersectionObserver(E, {
|
|
2056
2056
|
...C,
|
|
2057
2057
|
// Handle <iframe>s
|
|
2058
2058
|
root: o.ownerDocument
|
|
2059
2059
|
});
|
|
2060
2060
|
} catch {
|
|
2061
|
-
n = new IntersectionObserver(
|
|
2061
|
+
n = new IntersectionObserver(E, C);
|
|
2062
2062
|
}
|
|
2063
2063
|
n.observe(e);
|
|
2064
2064
|
}
|
|
@@ -2073,16 +2073,16 @@ function Ou(e, t, n, r) {
|
|
|
2073
2073
|
layoutShift: i = typeof IntersectionObserver == "function",
|
|
2074
2074
|
animationFrame: c = !1
|
|
2075
2075
|
} = r, l = ro(e), d = o || a ? [...l ? Kt(l) : [], ...Kt(t)] : [];
|
|
2076
|
-
d.forEach((
|
|
2077
|
-
o &&
|
|
2076
|
+
d.forEach((k) => {
|
|
2077
|
+
o && k.addEventListener("scroll", n, {
|
|
2078
2078
|
passive: !0
|
|
2079
|
-
}), a &&
|
|
2079
|
+
}), a && k.addEventListener("resize", n);
|
|
2080
2080
|
});
|
|
2081
2081
|
const m = l && i ? Ru(l, n) : null;
|
|
2082
2082
|
let g = -1, h = null;
|
|
2083
|
-
s && (h = new ResizeObserver((
|
|
2084
|
-
let [
|
|
2085
|
-
|
|
2083
|
+
s && (h = new ResizeObserver((k) => {
|
|
2084
|
+
let [A] = k;
|
|
2085
|
+
A && A.target === l && h && (h.unobserve(t), cancelAnimationFrame(g), g = requestAnimationFrame(() => {
|
|
2086
2086
|
var C;
|
|
2087
2087
|
(C = h) == null || C.observe(t);
|
|
2088
2088
|
})), n();
|
|
@@ -2090,14 +2090,14 @@ function Ou(e, t, n, r) {
|
|
|
2090
2090
|
let w, p = c ? ft(e) : null;
|
|
2091
2091
|
c && v();
|
|
2092
2092
|
function v() {
|
|
2093
|
-
const
|
|
2094
|
-
p && !Ya(p,
|
|
2093
|
+
const k = ft(e);
|
|
2094
|
+
p && !Ya(p, k) && n(), p = k, w = requestAnimationFrame(v);
|
|
2095
2095
|
}
|
|
2096
2096
|
return n(), () => {
|
|
2097
|
-
var
|
|
2098
|
-
d.forEach((
|
|
2099
|
-
o &&
|
|
2100
|
-
}), m?.(), (
|
|
2097
|
+
var k;
|
|
2098
|
+
d.forEach((A) => {
|
|
2099
|
+
o && A.removeEventListener("scroll", n), a && A.removeEventListener("resize", n);
|
|
2100
|
+
}), m?.(), (k = h) == null || k.disconnect(), h = null, c && cancelAnimationFrame(w);
|
|
2101
2101
|
};
|
|
2102
2102
|
}
|
|
2103
2103
|
const _u = nu, Mu = ru, Du = Jl, Iu = au, Lu = eu, Xo = Zl, Fu = ou, $u = (e, t, n) => {
|
|
@@ -2181,11 +2181,11 @@ function Bu(e) {
|
|
|
2181
2181
|
isPositioned: !1
|
|
2182
2182
|
}), [g, h] = f.useState(r);
|
|
2183
2183
|
Nn(g, r) || h(r);
|
|
2184
|
-
const [w, p] = f.useState(null), [v,
|
|
2184
|
+
const [w, p] = f.useState(null), [v, k] = f.useState(null), A = f.useCallback((S) => {
|
|
2185
2185
|
S !== I.current && (I.current = S, p(S));
|
|
2186
2186
|
}, []), C = f.useCallback((S) => {
|
|
2187
|
-
S !== O.current && (O.current = S,
|
|
2188
|
-
}, []), y = a || w,
|
|
2187
|
+
S !== O.current && (O.current = S, k(S));
|
|
2188
|
+
}, []), y = a || w, E = s || v, I = f.useRef(null), O = f.useRef(null), T = f.useRef(d), z = c != null, H = fr(c), V = fr(o), q = fr(l), x = f.useCallback(() => {
|
|
2189
2189
|
if (!I.current || !O.current)
|
|
2190
2190
|
return;
|
|
2191
2191
|
const S = {
|
|
@@ -2217,21 +2217,21 @@ function Bu(e) {
|
|
|
2217
2217
|
yn(() => (N.current = !0, () => {
|
|
2218
2218
|
N.current = !1;
|
|
2219
2219
|
}), []), yn(() => {
|
|
2220
|
-
if (y && (I.current = y),
|
|
2220
|
+
if (y && (I.current = y), E && (O.current = E), y && E) {
|
|
2221
2221
|
if (H.current)
|
|
2222
|
-
return H.current(y,
|
|
2222
|
+
return H.current(y, E, x);
|
|
2223
2223
|
x();
|
|
2224
2224
|
}
|
|
2225
|
-
}, [y,
|
|
2225
|
+
}, [y, E, x, H, z]);
|
|
2226
2226
|
const R = f.useMemo(() => ({
|
|
2227
2227
|
reference: I,
|
|
2228
2228
|
floating: O,
|
|
2229
|
-
setReference:
|
|
2229
|
+
setReference: A,
|
|
2230
2230
|
setFloating: C
|
|
2231
|
-
}), [
|
|
2231
|
+
}), [A, C]), P = f.useMemo(() => ({
|
|
2232
2232
|
reference: y,
|
|
2233
|
-
floating:
|
|
2234
|
-
}), [y,
|
|
2233
|
+
floating: E
|
|
2234
|
+
}), [y, E]), _ = f.useMemo(() => {
|
|
2235
2235
|
const S = {
|
|
2236
2236
|
position: n,
|
|
2237
2237
|
left: 0,
|
|
@@ -2422,7 +2422,7 @@ var ao = "PopperContent", [nd, rd] = Za(ao), rs = f.forwardRef(
|
|
|
2422
2422
|
updatePositionStrategy: h = "optimized",
|
|
2423
2423
|
onPlaced: w,
|
|
2424
2424
|
...p
|
|
2425
|
-
} = e, v = Ja(ao, n), [
|
|
2425
|
+
} = e, v = Ja(ao, n), [k, A] = f.useState(null), C = ie(t, (F) => A(F)), [y, E] = f.useState(null), I = Qa(y), O = I?.width ?? 0, T = I?.height ?? 0, z = r + (a !== "center" ? "-" + a : ""), H = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, V = Array.isArray(l) ? l : [l], q = V.length > 0, x = {
|
|
2426
2426
|
padding: H,
|
|
2427
2427
|
boundary: V.filter(ad),
|
|
2428
2428
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
@@ -2463,8 +2463,8 @@ var ao = "PopperContent", [nd, rd] = Za(ao), rs = f.forwardRef(
|
|
|
2463
2463
|
}, [_, G]);
|
|
2464
2464
|
const ce = S.arrow?.x, Y = S.arrow?.y, oe = S.arrow?.centerOffset !== 0, [K, ge] = f.useState();
|
|
2465
2465
|
return ve(() => {
|
|
2466
|
-
|
|
2467
|
-
}, [
|
|
2466
|
+
k && ge(window.getComputedStyle(k).zIndex);
|
|
2467
|
+
}, [k]), /* @__PURE__ */ u(
|
|
2468
2468
|
"div",
|
|
2469
2469
|
{
|
|
2470
2470
|
ref: N.setFloating,
|
|
@@ -2493,7 +2493,7 @@ var ao = "PopperContent", [nd, rd] = Za(ao), rs = f.forwardRef(
|
|
|
2493
2493
|
{
|
|
2494
2494
|
scope: n,
|
|
2495
2495
|
placedSide: L,
|
|
2496
|
-
onArrowChange:
|
|
2496
|
+
onArrowChange: E,
|
|
2497
2497
|
arrowX: ce,
|
|
2498
2498
|
arrowY: Y,
|
|
2499
2499
|
shouldHideArrow: oe,
|
|
@@ -2770,8 +2770,8 @@ var vd = function(e) {
|
|
|
2770
2770
|
try {
|
|
2771
2771
|
var h = g.getAttribute(r), w = h !== null && h !== "false", p = (xt.get(g) || 0) + 1, v = (a.get(g) || 0) + 1;
|
|
2772
2772
|
xt.set(g, p), a.set(g, v), s.push(g), p === 1 && w && un.set(g, !0), v === 1 && g.setAttribute(n, "true"), w || g.setAttribute(r, "true");
|
|
2773
|
-
} catch (
|
|
2774
|
-
console.error("aria-hidden: cannot operate on ", g,
|
|
2773
|
+
} catch (k) {
|
|
2774
|
+
console.error("aria-hidden: cannot operate on ", g, k);
|
|
2775
2775
|
}
|
|
2776
2776
|
});
|
|
2777
2777
|
};
|
|
@@ -2936,12 +2936,12 @@ var gs = Pd(), hr = function() {
|
|
|
2936
2936
|
onScrollCapture: hr,
|
|
2937
2937
|
onWheelCapture: hr,
|
|
2938
2938
|
onTouchMoveCapture: hr
|
|
2939
|
-
}), o = r[0], a = r[1], s = e.forwardProps, i = e.children, c = e.className, l = e.removeScrollBar, d = e.enabled, m = e.shards, g = e.sideCar, h = e.noRelative, w = e.noIsolation, p = e.inert, v = e.allowPinchZoom,
|
|
2939
|
+
}), o = r[0], a = r[1], s = e.forwardProps, i = e.children, c = e.className, l = e.removeScrollBar, d = e.enabled, m = e.shards, g = e.sideCar, h = e.noRelative, w = e.noIsolation, p = e.inert, v = e.allowPinchZoom, k = e.as, A = k === void 0 ? "div" : k, C = e.gapMode, y = ps(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), E = g, I = Ad([n, t]), O = We(We({}, y), o);
|
|
2940
2940
|
return f.createElement(
|
|
2941
2941
|
f.Fragment,
|
|
2942
2942
|
null,
|
|
2943
|
-
d && f.createElement(
|
|
2944
|
-
s ? f.cloneElement(f.Children.only(i), We(We({}, O), { ref: I })) : f.createElement(
|
|
2943
|
+
d && f.createElement(E, { sideCar: gs, removeScrollBar: l, shards: m, noRelative: h, noIsolation: w, inert: p, setCallbacks: a, allowPinchZoom: !!v, lockRef: n, gapMode: C }),
|
|
2944
|
+
s ? f.cloneElement(f.Children.only(i), We(We({}, O), { ref: I })) : f.createElement(A, We({}, O, { className: c, ref: I }), i)
|
|
2945
2945
|
);
|
|
2946
2946
|
});
|
|
2947
2947
|
Wn.defaultProps = {
|
|
@@ -3143,10 +3143,10 @@ var St = Mr ? { passive: !1 } : !1, jd = function(e) {
|
|
|
3143
3143
|
do {
|
|
3144
3144
|
if (!i)
|
|
3145
3145
|
break;
|
|
3146
|
-
var h = ws(e, i), w = h[0], p = h[1], v = h[2],
|
|
3147
|
-
(w ||
|
|
3148
|
-
var
|
|
3149
|
-
i =
|
|
3146
|
+
var h = ws(e, i), w = h[0], p = h[1], v = h[2], k = p - v - a * w;
|
|
3147
|
+
(w || k) && ys(e, i) && (m += k, g += w);
|
|
3148
|
+
var A = i.parentNode;
|
|
3149
|
+
i = A && A.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? A.host : A;
|
|
3150
3150
|
} while (
|
|
3151
3151
|
// portaled content
|
|
3152
3152
|
!c && i !== document.body || // self content
|
|
@@ -3187,37 +3187,37 @@ function ef(e) {
|
|
|
3187
3187
|
var i = f.useCallback(function(p, v) {
|
|
3188
3188
|
if ("touches" in p && p.touches.length === 2 || p.type === "wheel" && p.ctrlKey)
|
|
3189
3189
|
return !s.current.allowPinchZoom;
|
|
3190
|
-
var
|
|
3190
|
+
var k = mn(p), A = n.current, C = "deltaX" in p ? p.deltaX : A[0] - k[0], y = "deltaY" in p ? p.deltaY : A[1] - k[1], E, I = p.target, O = Math.abs(C) > Math.abs(y) ? "h" : "v";
|
|
3191
3191
|
if ("touches" in p && O === "h" && I.type === "range")
|
|
3192
3192
|
return !1;
|
|
3193
3193
|
var T = ea(O, I);
|
|
3194
3194
|
if (!T)
|
|
3195
3195
|
return !0;
|
|
3196
|
-
if (T ?
|
|
3196
|
+
if (T ? E = O : (E = O === "v" ? "h" : "v", T = ea(O, I)), !T)
|
|
3197
3197
|
return !1;
|
|
3198
|
-
if (!r.current && "changedTouches" in p && (C || y) && (r.current =
|
|
3198
|
+
if (!r.current && "changedTouches" in p && (C || y) && (r.current = E), !E)
|
|
3199
3199
|
return !0;
|
|
3200
|
-
var z = r.current ||
|
|
3200
|
+
var z = r.current || E;
|
|
3201
3201
|
return Xd(z, v, p, z === "h" ? C : y);
|
|
3202
3202
|
}, []), c = f.useCallback(function(p) {
|
|
3203
3203
|
var v = p;
|
|
3204
3204
|
if (!(!Ct.length || Ct[Ct.length - 1] !== a)) {
|
|
3205
|
-
var
|
|
3206
|
-
return
|
|
3205
|
+
var k = "deltaY" in v ? ta(v) : mn(v), A = t.current.filter(function(E) {
|
|
3206
|
+
return E.name === v.type && (E.target === v.target || v.target === E.shadowParent) && Qd(E.delta, k);
|
|
3207
3207
|
})[0];
|
|
3208
|
-
if (
|
|
3208
|
+
if (A && A.should) {
|
|
3209
3209
|
v.cancelable && v.preventDefault();
|
|
3210
3210
|
return;
|
|
3211
3211
|
}
|
|
3212
|
-
if (!
|
|
3213
|
-
var C = (s.current.shards || []).map(na).filter(Boolean).filter(function(
|
|
3214
|
-
return
|
|
3212
|
+
if (!A) {
|
|
3213
|
+
var C = (s.current.shards || []).map(na).filter(Boolean).filter(function(E) {
|
|
3214
|
+
return E.contains(v.target);
|
|
3215
3215
|
}), y = C.length > 0 ? i(v, C[0]) : !s.current.noIsolation;
|
|
3216
3216
|
y && v.cancelable && v.preventDefault();
|
|
3217
3217
|
}
|
|
3218
3218
|
}
|
|
3219
|
-
}, []), l = f.useCallback(function(p, v,
|
|
3220
|
-
var C = { name: p, delta: v, target:
|
|
3219
|
+
}, []), l = f.useCallback(function(p, v, k, A) {
|
|
3220
|
+
var C = { name: p, delta: v, target: k, should: A, shadowParent: tf(k) };
|
|
3221
3221
|
t.current.push(C), setTimeout(function() {
|
|
3222
3222
|
t.current = t.current.filter(function(y) {
|
|
3223
3223
|
return y !== C;
|
|
@@ -3278,7 +3278,7 @@ var rf = [" ", "Enter", "ArrowUp", "ArrowDown"], of = [" ", "Enter"], mt = "Sele
|
|
|
3278
3278
|
disabled: g,
|
|
3279
3279
|
required: h,
|
|
3280
3280
|
form: w
|
|
3281
|
-
} = e, p = Hn(t), [v,
|
|
3281
|
+
} = e, p = Hn(t), [v, k] = f.useState(null), [A, C] = f.useState(null), [y, E] = f.useState(!1), I = Kr(l), [O, T] = Xt({
|
|
3282
3282
|
prop: r,
|
|
3283
3283
|
defaultProp: o ?? !1,
|
|
3284
3284
|
onChange: a,
|
|
@@ -3295,11 +3295,11 @@ var rf = [" ", "Enter", "ArrowUp", "ArrowDown"], of = [" ", "Enter"], mt = "Sele
|
|
|
3295
3295
|
required: h,
|
|
3296
3296
|
scope: t,
|
|
3297
3297
|
trigger: v,
|
|
3298
|
-
onTriggerChange:
|
|
3299
|
-
valueNode:
|
|
3298
|
+
onTriggerChange: k,
|
|
3299
|
+
valueNode: A,
|
|
3300
3300
|
onValueNodeChange: C,
|
|
3301
3301
|
valueNodeHasChildren: y,
|
|
3302
|
-
onValueNodeHasChildrenChange:
|
|
3302
|
+
onValueNodeHasChildrenChange: E,
|
|
3303
3303
|
contentId: Zt(),
|
|
3304
3304
|
value: z,
|
|
3305
3305
|
onValueChange: H,
|
|
@@ -3352,8 +3352,8 @@ xs.displayName = mt;
|
|
|
3352
3352
|
var Ss = "SelectTrigger", Cs = f.forwardRef(
|
|
3353
3353
|
(e, t) => {
|
|
3354
3354
|
const { __scopeSelect: n, disabled: r = !1, ...o } = e, a = Hn(n), s = ot(Ss, n), i = s.disabled || r, c = ie(t, s.onTriggerChange), l = Bn(n), d = f.useRef("touch"), [m, g, h] = Ys((p) => {
|
|
3355
|
-
const v = l().filter((C) => !C.disabled),
|
|
3356
|
-
|
|
3355
|
+
const v = l().filter((C) => !C.disabled), k = v.find((C) => C.value === s.value), A = qs(v, p, k);
|
|
3356
|
+
A !== void 0 && s.onValueChange(A.value);
|
|
3357
3357
|
}), w = (p) => {
|
|
3358
3358
|
i || (s.onOpenChange(!0), h()), p && (s.triggerPointerDownPosRef.current = {
|
|
3359
3359
|
x: Math.round(p.pageX),
|
|
@@ -3456,8 +3456,8 @@ var Oe = 10, [Ps, at] = Mt(pt), ff = "SelectContentImpl", mf = /* @__PURE__ */ C
|
|
|
3456
3456
|
hideWhenDetached: p,
|
|
3457
3457
|
avoidCollisions: v,
|
|
3458
3458
|
//
|
|
3459
|
-
...
|
|
3460
|
-
} = e,
|
|
3459
|
+
...k
|
|
3460
|
+
} = e, A = ot(pt, n), [C, y] = f.useState(null), [E, I] = f.useState(null), O = ie(t, (F) => y(F)), [T, z] = f.useState(null), [H, V] = f.useState(
|
|
3461
3461
|
null
|
|
3462
3462
|
), q = Bn(n), [x, N] = f.useState(!1), R = f.useRef(!1);
|
|
3463
3463
|
f.useEffect(() => {
|
|
@@ -3467,9 +3467,9 @@ var Oe = 10, [Ps, at] = Mt(pt), ff = "SelectContentImpl", mf = /* @__PURE__ */ C
|
|
|
3467
3467
|
(F) => {
|
|
3468
3468
|
const [ee, ...le] = q().map((re) => re.ref.current), [Z] = le.slice(-1), te = document.activeElement;
|
|
3469
3469
|
for (const re of F)
|
|
3470
|
-
if (re === te || (re?.scrollIntoView({ block: "nearest" }), re === ee &&
|
|
3470
|
+
if (re === te || (re?.scrollIntoView({ block: "nearest" }), re === ee && E && (E.scrollTop = 0), re === Z && E && (E.scrollTop = E.scrollHeight), re?.focus(), document.activeElement !== te)) return;
|
|
3471
3471
|
},
|
|
3472
|
-
[q,
|
|
3472
|
+
[q, E]
|
|
3473
3473
|
), _ = f.useCallback(
|
|
3474
3474
|
() => P([T, C]),
|
|
3475
3475
|
[P, T, C]
|
|
@@ -3477,7 +3477,7 @@ var Oe = 10, [Ps, at] = Mt(pt), ff = "SelectContentImpl", mf = /* @__PURE__ */ C
|
|
|
3477
3477
|
f.useEffect(() => {
|
|
3478
3478
|
x && _();
|
|
3479
3479
|
}, [x, _]);
|
|
3480
|
-
const { onOpenChange: S, triggerPointerDownPosRef: L } =
|
|
3480
|
+
const { onOpenChange: S, triggerPointerDownPosRef: L } = A;
|
|
3481
3481
|
f.useEffect(() => {
|
|
3482
3482
|
if (C) {
|
|
3483
3483
|
let F = { x: 0, y: 0 };
|
|
@@ -3505,15 +3505,15 @@ var Oe = 10, [Ps, at] = Mt(pt), ff = "SelectContentImpl", mf = /* @__PURE__ */ C
|
|
|
3505
3505
|
}), ce = f.useCallback(
|
|
3506
3506
|
(F, ee, le) => {
|
|
3507
3507
|
const Z = !R.current && !le;
|
|
3508
|
-
(
|
|
3508
|
+
(A.value !== void 0 && A.value === ee || Z) && (z(F), Z && (R.current = !0));
|
|
3509
3509
|
},
|
|
3510
|
-
[
|
|
3510
|
+
[A.value]
|
|
3511
3511
|
), Y = f.useCallback(() => C?.focus(), [C]), oe = f.useCallback(
|
|
3512
3512
|
(F, ee, le) => {
|
|
3513
3513
|
const Z = !R.current && !le;
|
|
3514
|
-
(
|
|
3514
|
+
(A.value !== void 0 && A.value === ee || Z) && V(F);
|
|
3515
3515
|
},
|
|
3516
|
-
[
|
|
3516
|
+
[A.value]
|
|
3517
3517
|
), K = r === "popper" ? Dr : Os, ge = K === Dr ? {
|
|
3518
3518
|
side: i,
|
|
3519
3519
|
sideOffset: c,
|
|
@@ -3531,7 +3531,7 @@ var Oe = 10, [Ps, at] = Mt(pt), ff = "SelectContentImpl", mf = /* @__PURE__ */ C
|
|
|
3531
3531
|
{
|
|
3532
3532
|
scope: n,
|
|
3533
3533
|
content: C,
|
|
3534
|
-
viewport:
|
|
3534
|
+
viewport: E,
|
|
3535
3535
|
onViewportChange: I,
|
|
3536
3536
|
itemRefCallback: ce,
|
|
3537
3537
|
selectedItem: T,
|
|
@@ -3546,12 +3546,12 @@ var Oe = 10, [Ps, at] = Mt(pt), ff = "SelectContentImpl", mf = /* @__PURE__ */ C
|
|
|
3546
3546
|
Qr,
|
|
3547
3547
|
{
|
|
3548
3548
|
asChild: !0,
|
|
3549
|
-
trapped:
|
|
3549
|
+
trapped: A.open,
|
|
3550
3550
|
onMountAutoFocus: (F) => {
|
|
3551
3551
|
F.preventDefault();
|
|
3552
3552
|
},
|
|
3553
3553
|
onUnmountAutoFocus: J(o, (F) => {
|
|
3554
|
-
|
|
3554
|
+
A.trigger?.focus({ preventScroll: !0 }), F.preventDefault();
|
|
3555
3555
|
}),
|
|
3556
3556
|
children: /* @__PURE__ */ u(
|
|
3557
3557
|
Xr,
|
|
@@ -3561,16 +3561,16 @@ var Oe = 10, [Ps, at] = Mt(pt), ff = "SelectContentImpl", mf = /* @__PURE__ */ C
|
|
|
3561
3561
|
onEscapeKeyDown: a,
|
|
3562
3562
|
onPointerDownOutside: s,
|
|
3563
3563
|
onFocusOutside: (F) => F.preventDefault(),
|
|
3564
|
-
onDismiss: () =>
|
|
3564
|
+
onDismiss: () => A.onOpenChange(!1),
|
|
3565
3565
|
children: /* @__PURE__ */ u(
|
|
3566
3566
|
K,
|
|
3567
3567
|
{
|
|
3568
3568
|
role: "listbox",
|
|
3569
|
-
id:
|
|
3570
|
-
"data-state":
|
|
3571
|
-
dir:
|
|
3569
|
+
id: A.contentId,
|
|
3570
|
+
"data-state": A.open ? "open" : "closed",
|
|
3571
|
+
dir: A.dir,
|
|
3572
3572
|
onContextMenu: (F) => F.preventDefault(),
|
|
3573
|
-
...
|
|
3573
|
+
...k,
|
|
3574
3574
|
...ge,
|
|
3575
3575
|
onPlaced: () => N(!0),
|
|
3576
3576
|
ref: O,
|
|
@@ -3580,9 +3580,9 @@ var Oe = 10, [Ps, at] = Mt(pt), ff = "SelectContentImpl", mf = /* @__PURE__ */ C
|
|
|
3580
3580
|
flexDirection: "column",
|
|
3581
3581
|
// reset the outline by default as the content MAY get focused
|
|
3582
3582
|
outline: "none",
|
|
3583
|
-
...
|
|
3583
|
+
...k.style
|
|
3584
3584
|
},
|
|
3585
|
-
onKeyDown: J(
|
|
3585
|
+
onKeyDown: J(k.onKeyDown, (F) => {
|
|
3586
3586
|
const ee = F.ctrlKey || F.altKey || F.metaKey;
|
|
3587
3587
|
if (F.key === "Tab" && F.preventDefault(), !ee && F.key.length === 1 && G(F.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(F.key)) {
|
|
3588
3588
|
let Z = q().filter((te) => !te.disabled).map((te) => te.ref.current);
|
|
@@ -3605,9 +3605,9 @@ var Oe = 10, [Ps, at] = Mt(pt), ff = "SelectContentImpl", mf = /* @__PURE__ */ C
|
|
|
3605
3605
|
);
|
|
3606
3606
|
Rs.displayName = ff;
|
|
3607
3607
|
var pf = "SelectItemAlignedPosition", Os = f.forwardRef((e, t) => {
|
|
3608
|
-
const { __scopeSelect: n, onPlaced: r, ...o } = e, a = ot(pt, n), s = at(pt, n), [i, c] = f.useState(null), [l, d] = f.useState(null), m = ie(t, (O) => d(O)), g = Bn(n), h = f.useRef(!1), w = f.useRef(!0), { viewport: p, selectedItem: v, selectedItemText:
|
|
3609
|
-
if (a.trigger && a.valueNode && i && l && p && v &&
|
|
3610
|
-
const O = a.trigger.getBoundingClientRect(), T = l.getBoundingClientRect(), z = a.valueNode.getBoundingClientRect(), H =
|
|
3608
|
+
const { __scopeSelect: n, onPlaced: r, ...o } = e, a = ot(pt, n), s = at(pt, n), [i, c] = f.useState(null), [l, d] = f.useState(null), m = ie(t, (O) => d(O)), g = Bn(n), h = f.useRef(!1), w = f.useRef(!0), { viewport: p, selectedItem: v, selectedItemText: k, focusSelectedItem: A } = s, C = f.useCallback(() => {
|
|
3609
|
+
if (a.trigger && a.valueNode && i && l && p && v && k) {
|
|
3610
|
+
const O = a.trigger.getBoundingClientRect(), T = l.getBoundingClientRect(), z = a.valueNode.getBoundingClientRect(), H = k.getBoundingClientRect();
|
|
3611
3611
|
if (a.dir !== "rtl") {
|
|
3612
3612
|
const te = H.left - T.left, re = z.left - te, fe = O.left - re, Ne = O.width + fe, Re = Math.max(Ne, T.width), it = window.innerWidth - Oe, ct = _o(re, [
|
|
3613
3613
|
Oe,
|
|
@@ -3656,20 +3656,20 @@ var pf = "SelectItemAlignedPosition", Os = f.forwardRef((e, t) => {
|
|
|
3656
3656
|
l,
|
|
3657
3657
|
p,
|
|
3658
3658
|
v,
|
|
3659
|
-
|
|
3659
|
+
k,
|
|
3660
3660
|
a.dir,
|
|
3661
3661
|
r
|
|
3662
3662
|
]);
|
|
3663
3663
|
ve(() => C(), [C]);
|
|
3664
|
-
const [y,
|
|
3664
|
+
const [y, E] = f.useState();
|
|
3665
3665
|
ve(() => {
|
|
3666
|
-
l &&
|
|
3666
|
+
l && E(window.getComputedStyle(l).zIndex);
|
|
3667
3667
|
}, [l]);
|
|
3668
3668
|
const I = f.useCallback(
|
|
3669
3669
|
(O) => {
|
|
3670
|
-
O && w.current === !0 && (C(),
|
|
3670
|
+
O && w.current === !0 && (C(), A?.(), w.current = !1);
|
|
3671
3671
|
},
|
|
3672
|
-
[C,
|
|
3672
|
+
[C, A]
|
|
3673
3673
|
);
|
|
3674
3674
|
return /* @__PURE__ */ u(
|
|
3675
3675
|
gf,
|
|
@@ -3776,9 +3776,9 @@ var [gf, lo] = Mt(pt, {}), Ir = "SelectViewport", _s = f.forwardRef(
|
|
|
3776
3776
|
if (g?.current && m) {
|
|
3777
3777
|
const h = Math.abs(c.current - d.scrollTop);
|
|
3778
3778
|
if (h > 0) {
|
|
3779
|
-
const w = window.innerHeight - Oe * 2, p = parseFloat(m.style.minHeight), v = parseFloat(m.style.height),
|
|
3780
|
-
if (
|
|
3781
|
-
const
|
|
3779
|
+
const w = window.innerHeight - Oe * 2, p = parseFloat(m.style.minHeight), v = parseFloat(m.style.height), k = Math.max(p, v);
|
|
3780
|
+
if (k < w) {
|
|
3781
|
+
const A = k + h, C = Math.min(w, A), y = A - C;
|
|
3782
3782
|
m.style.height = C + "px", m.style.bottom === "0px" && (d.scrollTop = y > 0 ? y : 0, m.style.justifyContent = "flex-end");
|
|
3783
3783
|
}
|
|
3784
3784
|
}
|
|
@@ -3815,8 +3815,8 @@ var Tn = "SelectItem", [yf, Fs] = Mt(Tn), $s = f.forwardRef(
|
|
|
3815
3815
|
...s
|
|
3816
3816
|
} = e, i = ot(Tn, n), c = at(Tn, n), l = i.value === r, [d, m] = f.useState(a ?? ""), [g, h] = f.useState(!1), w = ie(
|
|
3817
3817
|
t,
|
|
3818
|
-
(
|
|
3819
|
-
), p = Zt(), v = f.useRef("touch"),
|
|
3818
|
+
(A) => c.itemRefCallback?.(A, r, o)
|
|
3819
|
+
), p = Zt(), v = f.useRef("touch"), k = () => {
|
|
3820
3820
|
o || (i.onValueChange(r), i.onOpenChange(!1));
|
|
3821
3821
|
};
|
|
3822
3822
|
if (r === "")
|
|
@@ -3831,8 +3831,8 @@ var Tn = "SelectItem", [yf, Fs] = Mt(Tn), $s = f.forwardRef(
|
|
|
3831
3831
|
disabled: o,
|
|
3832
3832
|
textId: p,
|
|
3833
3833
|
isSelected: l,
|
|
3834
|
-
onItemTextChange: f.useCallback((
|
|
3835
|
-
m((C) => C || (
|
|
3834
|
+
onItemTextChange: f.useCallback((A) => {
|
|
3835
|
+
m((C) => C || (A?.textContent ?? "").trim());
|
|
3836
3836
|
}, []),
|
|
3837
3837
|
children: /* @__PURE__ */ u(
|
|
3838
3838
|
zn.ItemSlot,
|
|
@@ -3857,22 +3857,22 @@ var Tn = "SelectItem", [yf, Fs] = Mt(Tn), $s = f.forwardRef(
|
|
|
3857
3857
|
onFocus: J(s.onFocus, () => h(!0)),
|
|
3858
3858
|
onBlur: J(s.onBlur, () => h(!1)),
|
|
3859
3859
|
onClick: J(s.onClick, () => {
|
|
3860
|
-
v.current !== "mouse" &&
|
|
3860
|
+
v.current !== "mouse" && k();
|
|
3861
3861
|
}),
|
|
3862
3862
|
onPointerUp: J(s.onPointerUp, () => {
|
|
3863
|
-
v.current === "mouse" &&
|
|
3863
|
+
v.current === "mouse" && k();
|
|
3864
3864
|
}),
|
|
3865
|
-
onPointerDown: J(s.onPointerDown, (
|
|
3866
|
-
v.current =
|
|
3865
|
+
onPointerDown: J(s.onPointerDown, (A) => {
|
|
3866
|
+
v.current = A.pointerType;
|
|
3867
3867
|
}),
|
|
3868
|
-
onPointerMove: J(s.onPointerMove, (
|
|
3869
|
-
v.current =
|
|
3868
|
+
onPointerMove: J(s.onPointerMove, (A) => {
|
|
3869
|
+
v.current = A.pointerType, o ? c.onItemLeave?.() : v.current === "mouse" && A.currentTarget.focus({ preventScroll: !0 });
|
|
3870
3870
|
}),
|
|
3871
|
-
onPointerLeave: J(s.onPointerLeave, (
|
|
3872
|
-
|
|
3871
|
+
onPointerLeave: J(s.onPointerLeave, (A) => {
|
|
3872
|
+
A.currentTarget === document.activeElement && c.onItemLeave?.();
|
|
3873
3873
|
}),
|
|
3874
|
-
onKeyDown: J(s.onKeyDown, (
|
|
3875
|
-
c.searchRef?.current !== "" &&
|
|
3874
|
+
onKeyDown: J(s.onKeyDown, (A) => {
|
|
3875
|
+
c.searchRef?.current !== "" && A.key === " " || (of.includes(A.key) && k(), A.key === " " && A.preventDefault());
|
|
3876
3876
|
})
|
|
3877
3877
|
}
|
|
3878
3878
|
)
|
|
@@ -3887,9 +3887,9 @@ var Gt = "SelectItemText", Ws = f.forwardRef(
|
|
|
3887
3887
|
(e, t) => {
|
|
3888
3888
|
const { __scopeSelect: n, className: r, style: o, ...a } = e, s = ot(Gt, n), i = at(Gt, n), c = Fs(Gt, n), l = lf(Gt, n), [d, m] = f.useState(null), g = ie(
|
|
3889
3889
|
t,
|
|
3890
|
-
(
|
|
3890
|
+
(k) => m(k),
|
|
3891
3891
|
c.onItemTextChange,
|
|
3892
|
-
(
|
|
3892
|
+
(k) => i.itemTextRefCallback?.(k, c.value, c.disabled)
|
|
3893
3893
|
), h = d?.textContent, w = f.useMemo(
|
|
3894
3894
|
() => /* @__PURE__ */ u("option", { value: c.value, disabled: c.disabled, children: h }, c.value),
|
|
3895
3895
|
[c.disabled, c.value, h]
|
|
@@ -4065,7 +4065,7 @@ function $f({ field: e, formValues: t, handleChange: n, handleBlur: r, error: o,
|
|
|
4065
4065
|
const y = typeof e.queryParams == "function" ? e.queryParams(t) : e.queryParams;
|
|
4066
4066
|
typeof y == "string" ? w += y.startsWith("?") ? y : `?${y}` : p = { params: y };
|
|
4067
4067
|
}
|
|
4068
|
-
const v = await a(w, p),
|
|
4068
|
+
const v = await a(w, p), k = v.data || v, C = (Array.isArray(k) ? k : []).map((y) => ({
|
|
4069
4069
|
value: y[e.valueId || "key"] || y.key,
|
|
4070
4070
|
label: y[e.labelId || "value"] || y.value
|
|
4071
4071
|
}));
|
|
@@ -4432,12 +4432,12 @@ function Zs() {
|
|
|
4432
4432
|
HTMLFormElement: m,
|
|
4433
4433
|
DOMParser: g,
|
|
4434
4434
|
trustedTypes: h
|
|
4435
|
-
} = e, w = c.prototype, p = Bt(w, "cloneNode"), v = Bt(w, "remove"),
|
|
4435
|
+
} = e, w = c.prototype, p = Bt(w, "cloneNode"), v = Bt(w, "remove"), k = Bt(w, "nextSibling"), A = Bt(w, "childNodes"), C = Bt(w, "parentNode");
|
|
4436
4436
|
if (typeof s == "function") {
|
|
4437
4437
|
const j = n.createElement("template");
|
|
4438
4438
|
j.content && j.content.ownerDocument && (n = j.content.ownerDocument);
|
|
4439
4439
|
}
|
|
4440
|
-
let y,
|
|
4440
|
+
let y, E = "";
|
|
4441
4441
|
const {
|
|
4442
4442
|
implementation: I,
|
|
4443
4443
|
createNodeIterator: O,
|
|
@@ -4524,9 +4524,9 @@ function Zs() {
|
|
|
4524
4524
|
throw zt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
4525
4525
|
if (typeof b.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
4526
4526
|
throw zt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
4527
|
-
y = b.TRUSTED_TYPES_POLICY,
|
|
4527
|
+
y = b.TRUSTED_TYPES_POLICY, E = y.createHTML("");
|
|
4528
4528
|
} else
|
|
4529
|
-
y === void 0 && (y = im(h, o)), y !== null && typeof
|
|
4529
|
+
y === void 0 && (y = im(h, o)), y !== null && typeof E == "string" && (E = y.createHTML(""));
|
|
4530
4530
|
we && we(b), yt = b;
|
|
4531
4531
|
}
|
|
4532
4532
|
}, wo = Q({}, [...yr, ...wr, ...Xf]), xo = Q({}, [...xr, ...Qf]), tc = function(b) {
|
|
@@ -4587,7 +4587,7 @@ function Zs() {
|
|
|
4587
4587
|
if (!M || !M.documentElement) {
|
|
4588
4588
|
M = I.createDocument(vt, "template", null);
|
|
4589
4589
|
try {
|
|
4590
|
-
M.documentElement.innerHTML = tr ?
|
|
4590
|
+
M.documentElement.innerHTML = tr ? E : se;
|
|
4591
4591
|
} catch {
|
|
4592
4592
|
}
|
|
4593
4593
|
}
|
|
@@ -4625,12 +4625,12 @@ function Zs() {
|
|
|
4625
4625
|
if (!ge[B] && No(B) && (K.tagNameCheck instanceof RegExp && ye(K.tagNameCheck, B) || K.tagNameCheck instanceof Function && K.tagNameCheck(B)))
|
|
4626
4626
|
return !1;
|
|
4627
4627
|
if (Zn && !Le[B]) {
|
|
4628
|
-
const se = C(b) || b.parentNode, be =
|
|
4628
|
+
const se = C(b) || b.parentNode, be = A(b) || b.childNodes;
|
|
4629
4629
|
if (be && se) {
|
|
4630
4630
|
const de = be.length;
|
|
4631
4631
|
for (let Se = de - 1; Se >= 0; --Se) {
|
|
4632
4632
|
const Ye = p(be[Se], !0);
|
|
4633
|
-
Ye.__removalCount = (b.__removalCount || 0) + 1, se.insertBefore(Ye,
|
|
4633
|
+
Ye.__removalCount = (b.__removalCount || 0) + 1, se.insertBefore(Ye, k(b));
|
|
4634
4634
|
}
|
|
4635
4635
|
}
|
|
4636
4636
|
}
|
|
@@ -4769,7 +4769,7 @@ function Zs() {
|
|
|
4769
4769
|
j.indexOf("<") === -1)
|
|
4770
4770
|
return y && rn ? y.createHTML(j) : j;
|
|
4771
4771
|
if (M = So(j), !M)
|
|
4772
|
-
return gt ? null : rn ?
|
|
4772
|
+
return gt ? null : rn ? E : "";
|
|
4773
4773
|
}
|
|
4774
4774
|
M && ct && Fe(M.firstChild);
|
|
4775
4775
|
const de = Co(Lt ? j : M);
|
|
@@ -5058,14 +5058,14 @@ function dm({
|
|
|
5058
5058
|
setCharCounts: d,
|
|
5059
5059
|
fileInputRefs: m,
|
|
5060
5060
|
...g
|
|
5061
|
-
} = s, h = a, w = e.options || [], p = e.inline || e.layout === "inline", v = g["aria-describedby"],
|
|
5061
|
+
} = s, h = a, w = e.options || [], p = e.inline || e.layout === "inline", v = g["aria-describedby"], k = `
|
|
5062
5062
|
size-4 rounded border-input bg-background transition-all accent-primary
|
|
5063
5063
|
focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
|
|
5064
5064
|
disabled:cursor-not-allowed disabled:opacity-50
|
|
5065
5065
|
`;
|
|
5066
5066
|
if (w.length > 0) {
|
|
5067
|
-
const
|
|
5068
|
-
let I =
|
|
5067
|
+
const A = Array.isArray(t[e.name]) ? t[e.name] : [], C = (y, E) => {
|
|
5068
|
+
let I = E ? [...A, y] : A.filter((O) => O !== y);
|
|
5069
5069
|
n(e.name, I), r(e.name);
|
|
5070
5070
|
};
|
|
5071
5071
|
return /* @__PURE__ */ D(
|
|
@@ -5081,7 +5081,7 @@ function dm({
|
|
|
5081
5081
|
{
|
|
5082
5082
|
className: p ? "flex flex-wrap gap-x-6 gap-y-3" : "space-y-4",
|
|
5083
5083
|
children: w.map((y) => {
|
|
5084
|
-
const
|
|
5084
|
+
const E = typeof y == "object" ? y.value : y, I = typeof y == "object" ? y.label : y, O = typeof y == "object" ? y.description : null, T = `${e.name}-${E}`, z = A.includes(E);
|
|
5085
5085
|
return /* @__PURE__ */ D(
|
|
5086
5086
|
"div",
|
|
5087
5087
|
{
|
|
@@ -5095,10 +5095,10 @@ function dm({
|
|
|
5095
5095
|
type: "checkbox",
|
|
5096
5096
|
id: T,
|
|
5097
5097
|
checked: z,
|
|
5098
|
-
onChange: (H) => C(
|
|
5098
|
+
onChange: (H) => C(E, H.target.checked),
|
|
5099
5099
|
onBlur: () => r(e.name),
|
|
5100
5100
|
disabled: h,
|
|
5101
|
-
className: `${
|
|
5101
|
+
className: `${k} ${!h && "cursor-pointer hover:border-primary/50"} ${o ? "border-destructive ring-destructive/20" : "border-input"}`
|
|
5102
5102
|
}
|
|
5103
5103
|
) }),
|
|
5104
5104
|
/* @__PURE__ */ D("div", { className: "ml-3 text-sm leading-6", children: [
|
|
@@ -5120,7 +5120,7 @@ function dm({
|
|
|
5120
5120
|
] })
|
|
5121
5121
|
]
|
|
5122
5122
|
},
|
|
5123
|
-
|
|
5123
|
+
E
|
|
5124
5124
|
);
|
|
5125
5125
|
})
|
|
5126
5126
|
}
|
|
@@ -5138,12 +5138,12 @@ function dm({
|
|
|
5138
5138
|
id: e.name,
|
|
5139
5139
|
type: "checkbox",
|
|
5140
5140
|
checked: !!t[e.name],
|
|
5141
|
-
onChange: (
|
|
5142
|
-
n(e.name,
|
|
5141
|
+
onChange: (A) => {
|
|
5142
|
+
n(e.name, A.target.checked), r(e.name);
|
|
5143
5143
|
},
|
|
5144
5144
|
onBlur: () => r(e.name),
|
|
5145
5145
|
disabled: h,
|
|
5146
|
-
className: `${
|
|
5146
|
+
className: `${k} ${!h && "cursor-pointer hover:border-primary/50"} ${o ? "border-destructive" : "border-input"}`
|
|
5147
5147
|
}
|
|
5148
5148
|
) }),
|
|
5149
5149
|
/* @__PURE__ */ u("div", { className: "ml-3 text-sm leading-6", children: /* @__PURE__ */ D(
|
|
@@ -6957,25 +6957,25 @@ const Lp = (e, t) => {
|
|
|
6957
6957
|
c = d + (c.length > 0 ? " " + c : c);
|
|
6958
6958
|
continue;
|
|
6959
6959
|
}
|
|
6960
|
-
let v = !!p,
|
|
6961
|
-
if (!
|
|
6960
|
+
let v = !!p, k = r(v ? w.substring(0, p) : w);
|
|
6961
|
+
if (!k) {
|
|
6962
6962
|
if (!v) {
|
|
6963
6963
|
c = d + (c.length > 0 ? " " + c : c);
|
|
6964
6964
|
continue;
|
|
6965
6965
|
}
|
|
6966
|
-
if (
|
|
6966
|
+
if (k = r(w), !k) {
|
|
6967
6967
|
c = d + (c.length > 0 ? " " + c : c);
|
|
6968
6968
|
continue;
|
|
6969
6969
|
}
|
|
6970
6970
|
v = !1;
|
|
6971
6971
|
}
|
|
6972
|
-
const
|
|
6972
|
+
const A = g.length === 0 ? "" : g.length === 1 ? g[0] : a(g).join(":"), C = h ? A + Ur : A, y = C + k;
|
|
6973
6973
|
if (s.indexOf(y) > -1)
|
|
6974
6974
|
continue;
|
|
6975
6975
|
s.push(y);
|
|
6976
|
-
const
|
|
6977
|
-
for (let I = 0; I <
|
|
6978
|
-
const O =
|
|
6976
|
+
const E = o(k, v);
|
|
6977
|
+
for (let I = 0; I < E.length; ++I) {
|
|
6978
|
+
const O = E[I];
|
|
6979
6979
|
s.push(C + O);
|
|
6980
6980
|
}
|
|
6981
6981
|
c = d + (c.length > 0 ? " " + c : c);
|
|
@@ -7021,7 +7021,7 @@ const Lp = (e, t) => {
|
|
|
7021
7021
|
const r = xi.exec(e);
|
|
7022
7022
|
return r ? r[1] ? t(r[1]) : n : !1;
|
|
7023
7023
|
}, Ci = (e) => e === "position" || e === "percentage", Ei = (e) => e === "image" || e === "url", ki = (e) => e === "length" || e === "size" || e === "bg-size", Ai = (e) => e === "length", wh = (e) => e === "number", xh = (e) => e === "family-name", Ni = (e) => e === "shadow", Sh = () => {
|
|
7024
|
-
const e = pe("color"), t = pe("font"), n = pe("text"), r = pe("font-weight"), o = pe("tracking"), a = pe("leading"), s = pe("breakpoint"), i = pe("container"), c = pe("spacing"), l = pe("radius"), d = pe("shadow"), m = pe("inset-shadow"), g = pe("text-shadow"), h = pe("drop-shadow"), w = pe("blur"), p = pe("perspective"), v = pe("aspect"),
|
|
7024
|
+
const e = pe("color"), t = pe("font"), n = pe("text"), r = pe("font-weight"), o = pe("tracking"), a = pe("leading"), s = pe("breakpoint"), i = pe("container"), c = pe("spacing"), l = pe("radius"), d = pe("shadow"), m = pe("inset-shadow"), g = pe("text-shadow"), h = pe("drop-shadow"), w = pe("blur"), p = pe("perspective"), v = pe("aspect"), k = pe("ease"), A = pe("animate"), C = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], y = () => [
|
|
7025
7025
|
"center",
|
|
7026
7026
|
"top",
|
|
7027
7027
|
"bottom",
|
|
@@ -7039,7 +7039,7 @@ const Lp = (e, t) => {
|
|
|
7039
7039
|
"bottom-left",
|
|
7040
7040
|
// Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
|
|
7041
7041
|
"left-bottom"
|
|
7042
|
-
],
|
|
7042
|
+
], E = () => [...y(), W, $], I = () => ["auto", "hidden", "clip", "visible", "scroll"], O = () => ["auto", "contain", "none"], T = () => [W, $, c], z = () => [kt, "full", "auto", ...T()], H = () => [Ze, "none", "subgrid", W, $], V = () => ["auto", {
|
|
7043
7043
|
span: ["full", Ze, W, $]
|
|
7044
7044
|
}, Ze, W, $], q = () => [Ze, "auto", W, $], x = () => ["auto", "min", "max", "fr", W, $], N = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], R = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], P = () => ["auto", ...T()], _ = () => [kt, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...T()], S = () => [e, W, $], L = () => [...y(), Ea, Ca, {
|
|
7045
7045
|
position: [W, $]
|
|
@@ -7186,7 +7186,7 @@ const Lp = (e, t) => {
|
|
|
7186
7186
|
* @see https://tailwindcss.com/docs/object-position
|
|
7187
7187
|
*/
|
|
7188
7188
|
"object-position": [{
|
|
7189
|
-
object:
|
|
7189
|
+
object: E()
|
|
7190
7190
|
}],
|
|
7191
7191
|
/**
|
|
7192
7192
|
* Overflow
|
|
@@ -8964,7 +8964,7 @@ const Lp = (e, t) => {
|
|
|
8964
8964
|
* @see https://tailwindcss.com/docs/transition-timing-function
|
|
8965
8965
|
*/
|
|
8966
8966
|
ease: [{
|
|
8967
|
-
ease: ["linear", "initial",
|
|
8967
|
+
ease: ["linear", "initial", k, W, $]
|
|
8968
8968
|
}],
|
|
8969
8969
|
/**
|
|
8970
8970
|
* Transition Delay
|
|
@@ -8978,7 +8978,7 @@ const Lp = (e, t) => {
|
|
|
8978
8978
|
* @see https://tailwindcss.com/docs/animation
|
|
8979
8979
|
*/
|
|
8980
8980
|
animate: [{
|
|
8981
|
-
animate: ["none",
|
|
8981
|
+
animate: ["none", A, W, $]
|
|
8982
8982
|
}],
|
|
8983
8983
|
// ------------------
|
|
8984
8984
|
// --- Transforms ---
|
|
@@ -9002,7 +9002,7 @@ const Lp = (e, t) => {
|
|
|
9002
9002
|
* @see https://tailwindcss.com/docs/perspective-origin
|
|
9003
9003
|
*/
|
|
9004
9004
|
"perspective-origin": [{
|
|
9005
|
-
"perspective-origin":
|
|
9005
|
+
"perspective-origin": E()
|
|
9006
9006
|
}],
|
|
9007
9007
|
/**
|
|
9008
9008
|
* Rotate
|
|
@@ -9098,7 +9098,7 @@ const Lp = (e, t) => {
|
|
|
9098
9098
|
* @see https://tailwindcss.com/docs/transform-origin
|
|
9099
9099
|
*/
|
|
9100
9100
|
"transform-origin": [{
|
|
9101
|
-
origin:
|
|
9101
|
+
origin: E()
|
|
9102
9102
|
}],
|
|
9103
9103
|
/**
|
|
9104
9104
|
* Transform Style
|
|
@@ -9547,7 +9547,9 @@ function Eh({
|
|
|
9547
9547
|
}, [c]), d = (g) => {
|
|
9548
9548
|
g.preventDefault(), g.stopPropagation(), n(e.name, { from: void 0, to: void 0 }), r(e.name);
|
|
9549
9549
|
}, m = [];
|
|
9550
|
-
return e.maxDate && m.push({ after: new Date(e.maxDate) }), e.minDate && m.push({ before: new Date(e.minDate) }), /* @__PURE__ */ u("div", { className: "relative w-full", children: /* @__PURE__ */ D(Yn, { open: s, onOpenChange:
|
|
9550
|
+
return e.maxDate && m.push({ after: new Date(e.maxDate) }), e.minDate && m.push({ before: new Date(e.minDate) }), /* @__PURE__ */ u("div", { className: "relative w-full", children: /* @__PURE__ */ D(Yn, { open: a ? !1 : s, onOpenChange: (g) => {
|
|
9551
|
+
a || i(g);
|
|
9552
|
+
}, children: [
|
|
9551
9553
|
/* @__PURE__ */ u(qn, { asChild: !0, children: /* @__PURE__ */ D(
|
|
9552
9554
|
"div",
|
|
9553
9555
|
{
|
|
@@ -9558,7 +9560,7 @@ function Eh({
|
|
|
9558
9560
|
tabIndex: a ? -1 : 0,
|
|
9559
9561
|
onClick: () => !a && i(!0),
|
|
9560
9562
|
onKeyDown: (g) => {
|
|
9561
|
-
(g.key === "Enter" || g.key === " ") && (g.preventDefault(), i(!0));
|
|
9563
|
+
a || (g.key === "Enter" || g.key === " ") && (g.preventDefault(), i(!0));
|
|
9562
9564
|
},
|
|
9563
9565
|
className: `
|
|
9564
9566
|
flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm
|
|
@@ -9658,11 +9660,11 @@ function ka({
|
|
|
9658
9660
|
!v && e.uploadEndpoint && console.error(
|
|
9659
9661
|
`api_URL prop is required when using FileField with upload functionality for field "${e.name}"`
|
|
9660
9662
|
);
|
|
9661
|
-
const
|
|
9663
|
+
const k = (x) => {
|
|
9662
9664
|
if (x === 0) return "0 Bytes";
|
|
9663
9665
|
const N = 1024, R = ["Bytes", "KB", "MB", "GB"], P = Math.floor(Math.log(x) / Math.log(N));
|
|
9664
9666
|
return `${parseFloat((x / N ** P).toFixed(2))} ${R[P]}`;
|
|
9665
|
-
},
|
|
9667
|
+
}, A = async (x) => {
|
|
9666
9668
|
const N = new FormData();
|
|
9667
9669
|
N.append("file", x);
|
|
9668
9670
|
const R = await fetch(`${v}`, {
|
|
@@ -9676,9 +9678,9 @@ function ka({
|
|
|
9676
9678
|
if (!N) return;
|
|
9677
9679
|
if (x.maxSize && N.size > x.maxSize)
|
|
9678
9680
|
throw new Error(
|
|
9679
|
-
`File size must not exceed ${
|
|
9681
|
+
`File size must not exceed ${k(x.maxSize)}`
|
|
9680
9682
|
);
|
|
9681
|
-
const R = await
|
|
9683
|
+
const R = await A(N), P = { ...t, [x.name]: R };
|
|
9682
9684
|
a(x.name, R), s(P);
|
|
9683
9685
|
}, y = async (x, N) => {
|
|
9684
9686
|
const R = t[x.name] || [];
|
|
@@ -9687,15 +9689,15 @@ function ka({
|
|
|
9687
9689
|
N.forEach((S) => {
|
|
9688
9690
|
if (x.maxSize && S.size > x.maxSize)
|
|
9689
9691
|
throw new Error(
|
|
9690
|
-
`Each file must not exceed ${
|
|
9692
|
+
`Each file must not exceed ${k(x.maxSize)}`
|
|
9691
9693
|
);
|
|
9692
9694
|
});
|
|
9693
9695
|
const P = await Promise.all(
|
|
9694
|
-
N.map((S) =>
|
|
9696
|
+
N.map((S) => A(S))
|
|
9695
9697
|
// Updated call
|
|
9696
9698
|
), _ = [...R, ...P];
|
|
9697
9699
|
a(x.name, _), s({ ...t, [x.name]: _ });
|
|
9698
|
-
},
|
|
9700
|
+
}, E = async (x, N) => {
|
|
9699
9701
|
if (l) return;
|
|
9700
9702
|
const R = Array.from(N);
|
|
9701
9703
|
try {
|
|
@@ -9712,8 +9714,8 @@ function ka({
|
|
|
9712
9714
|
}, T = (x) => {
|
|
9713
9715
|
x.preventDefault(), l || p(!1);
|
|
9714
9716
|
}, z = (x) => {
|
|
9715
|
-
x.preventDefault(), p(!1), !l && x.dataTransfer.files && x.dataTransfer.files.length > 0 &&
|
|
9716
|
-
}, H = e.accept ? e.accept.split(",").map((x) => x.split("/")[1] || x.split(".")[1] || x).join(", ").toUpperCase() : "PNG, JPG, PDF", V = e.maxSize ? `, up to ${
|
|
9717
|
+
x.preventDefault(), p(!1), !l && x.dataTransfer.files && x.dataTransfer.files.length > 0 && E(e.name, x.dataTransfer.files);
|
|
9718
|
+
}, H = e.accept ? e.accept.split(",").map((x) => x.split("/")[1] || x.split(".")[1] || x).join(", ").toUpperCase() : "PNG, JPG, PDF", V = e.maxSize ? `, up to ${k(e.maxSize)}` : "", q = `
|
|
9717
9719
|
w-full flex flex-col items-center justify-center p-6 border-2 border-dashed rounded-lg transition-all duration-200
|
|
9718
9720
|
// Ensure focus styling is handled correctly for the button element
|
|
9719
9721
|
focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50
|
|
@@ -9771,7 +9773,7 @@ function ka({
|
|
|
9771
9773
|
accept: e.accept,
|
|
9772
9774
|
multiple: d,
|
|
9773
9775
|
className: "sr-only",
|
|
9774
|
-
onChange: (x) =>
|
|
9776
|
+
onChange: (x) => E(e.name, x.target.files),
|
|
9775
9777
|
disabled: l
|
|
9776
9778
|
}
|
|
9777
9779
|
),
|
|
@@ -9786,7 +9788,7 @@ function ka({
|
|
|
9786
9788
|
/* @__PURE__ */ u("span", { className: "text-sm truncate", children: R }),
|
|
9787
9789
|
P && /* @__PURE__ */ D("span", { className: "text-xs text-gray-500 flex-shrink-0", children: [
|
|
9788
9790
|
"(",
|
|
9789
|
-
|
|
9791
|
+
k(P),
|
|
9790
9792
|
")"
|
|
9791
9793
|
] })
|
|
9792
9794
|
] }),
|
|
@@ -9882,43 +9884,46 @@ function kh({
|
|
|
9882
9884
|
] });
|
|
9883
9885
|
}
|
|
9884
9886
|
function Ah({ field: e, formValues: t, handleChange: n, handleBlur: r, error: o }) {
|
|
9885
|
-
const [a, s] = ue(!1), i = t[e.name], c = i ? new Date(i) : null, l = c ? (c.getHours() % 12 || 12).toString().padStart(2, "0") : "12", d = c ? c.getMinutes().toString().padStart(2, "0") : "00", m = c ? c.getHours() >= 12 ? "PM" : "AM" : "PM", g = (
|
|
9886
|
-
if (!
|
|
9887
|
+
const [a, s] = ue(!1), i = t[e.name], c = i ? new Date(i) : null, l = c ? (c.getHours() % 12 || 12).toString().padStart(2, "0") : "12", d = c ? c.getMinutes().toString().padStart(2, "0") : "00", m = c ? c.getHours() >= 12 ? "PM" : "AM" : "PM", g = (E) => {
|
|
9888
|
+
if (!E) {
|
|
9887
9889
|
n(e.name, null);
|
|
9888
9890
|
return;
|
|
9889
9891
|
}
|
|
9890
|
-
const I = new Date(
|
|
9892
|
+
const I = new Date(E);
|
|
9891
9893
|
c ? (I.setHours(c.getHours()), I.setMinutes(c.getMinutes())) : (I.setHours(12), I.setMinutes(0)), n(e.name, I);
|
|
9892
|
-
}, h = (
|
|
9894
|
+
}, h = (E, I, O) => {
|
|
9893
9895
|
const T = c ? new Date(c) : /* @__PURE__ */ new Date();
|
|
9894
|
-
let z = parseInt(
|
|
9896
|
+
let z = parseInt(E);
|
|
9895
9897
|
O === "PM" && z !== 12 && (z += 12), O === "AM" && z === 12 && (z = 0), T.setHours(z), T.setMinutes(parseInt(I)), n(e.name, T);
|
|
9896
9898
|
}, w = () => {
|
|
9897
|
-
let
|
|
9898
|
-
|
|
9899
|
+
let E = parseInt(l);
|
|
9900
|
+
E = E % 12 + 1, h(E.toString(), d, m);
|
|
9899
9901
|
}, p = () => {
|
|
9900
|
-
let
|
|
9901
|
-
|
|
9902
|
+
let E = parseInt(l);
|
|
9903
|
+
E = E === 1 ? 12 : E - 1, h(E.toString(), d, m);
|
|
9902
9904
|
}, v = () => {
|
|
9903
|
-
let
|
|
9904
|
-
|
|
9905
|
-
}, E = () => {
|
|
9906
|
-
let A = parseInt(d);
|
|
9907
|
-
A = A === 0 ? 55 : A - 5, h(l, A.toString(), m);
|
|
9905
|
+
let E = parseInt(d);
|
|
9906
|
+
E = (E + 5) % 60, h(l, E.toString(), m);
|
|
9908
9907
|
}, k = () => {
|
|
9908
|
+
let E = parseInt(d);
|
|
9909
|
+
E = E === 0 ? 55 : E - 5, h(l, E.toString(), m);
|
|
9910
|
+
}, A = () => {
|
|
9909
9911
|
h(l, d, m === "AM" ? "PM" : "AM");
|
|
9910
9912
|
}, C = () => n(e.name, null), y = [];
|
|
9911
9913
|
return e.maxDate && y.push({ after: new Date(e.maxDate) }), e.minDate && y.push({ before: new Date(e.minDate) }), /* @__PURE__ */ D("div", { className: "relative", children: [
|
|
9912
|
-
/* @__PURE__ */ D(Yn, { open: a, onOpenChange:
|
|
9914
|
+
/* @__PURE__ */ D(Yn, { open: e.disabled ? !1 : a, onOpenChange: (E) => {
|
|
9915
|
+
e.disabled || s(E);
|
|
9916
|
+
}, children: [
|
|
9913
9917
|
/* @__PURE__ */ u(qn, { asChild: !0, children: /* @__PURE__ */ D(
|
|
9914
9918
|
"button",
|
|
9915
9919
|
{
|
|
9916
9920
|
type: "button",
|
|
9917
9921
|
id: e.name,
|
|
9922
|
+
disabled: e.disabled,
|
|
9918
9923
|
"aria-haspopup": "dialog",
|
|
9919
9924
|
"aria-expanded": a,
|
|
9920
|
-
onClick: () => s(!0),
|
|
9921
|
-
onKeyDown: (
|
|
9925
|
+
onClick: () => !e.disabled && s(!0),
|
|
9926
|
+
onKeyDown: (E) => !e.disabled && E.key === "Enter" && s(!0),
|
|
9922
9927
|
className: `
|
|
9923
9928
|
group inline-flex items-center justify-between gap-2
|
|
9924
9929
|
w-full h-10 rounded-lg border bg-white
|
|
@@ -9989,7 +9994,7 @@ function Ah({ field: e, formValues: t, handleChange: n, handleBlur: r, error: o
|
|
|
9989
9994
|
/* @__PURE__ */ D("div", { className: "flex flex-col items-center gap-1", children: [
|
|
9990
9995
|
/* @__PURE__ */ u("button", { type: "button", onClick: v, className: "p-1 h-6 w-6 flex items-center justify-center text-slate-400 hover:text-slate-700 hover:bg-slate-200 rounded-full transition-all", children: /* @__PURE__ */ u("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ u("path", { d: "m18 15-6-6-6 6" }) }) }),
|
|
9991
9996
|
/* @__PURE__ */ u("div", { className: "w-12 h-10 flex items-center justify-center bg-white border border-slate-200 rounded-lg text-lg font-semibold shadow-sm text-slate-700", children: d }),
|
|
9992
|
-
/* @__PURE__ */ u("button", { type: "button", onClick:
|
|
9997
|
+
/* @__PURE__ */ u("button", { type: "button", onClick: k, className: "p-1 h-6 w-6 flex items-center justify-center text-slate-400 hover:text-slate-700 hover:bg-slate-200 rounded-full transition-all", children: /* @__PURE__ */ u("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ u("path", { d: "m6 9 6 6 6-6" }) }) })
|
|
9993
9998
|
] })
|
|
9994
9999
|
] }),
|
|
9995
10000
|
/* @__PURE__ */ D("div", { className: "flex flex-col gap-1 bg-white p-1 rounded-lg border border-slate-200 shadow-sm", children: [
|
|
@@ -9997,7 +10002,7 @@ function Ah({ field: e, formValues: t, handleChange: n, handleBlur: r, error: o
|
|
|
9997
10002
|
"button",
|
|
9998
10003
|
{
|
|
9999
10004
|
type: "button",
|
|
10000
|
-
onClick: () => m !== "AM" &&
|
|
10005
|
+
onClick: () => m !== "AM" && A(),
|
|
10001
10006
|
className: `px-3 py-1 text-xs font-bold rounded-md transition-all ${m === "AM" ? "bg-blue-50 text-blue-600" : "text-slate-400 hover:text-slate-600"}`,
|
|
10002
10007
|
children: "AM"
|
|
10003
10008
|
}
|
|
@@ -10006,7 +10011,7 @@ function Ah({ field: e, formValues: t, handleChange: n, handleBlur: r, error: o
|
|
|
10006
10011
|
"button",
|
|
10007
10012
|
{
|
|
10008
10013
|
type: "button",
|
|
10009
|
-
onClick: () => m !== "PM" &&
|
|
10014
|
+
onClick: () => m !== "PM" && A(),
|
|
10010
10015
|
className: `px-3 py-1 text-xs font-bold rounded-md transition-all ${m === "PM" ? "bg-blue-50 text-blue-600" : "text-slate-400 hover:text-slate-600"}`,
|
|
10011
10016
|
children: "PM"
|
|
10012
10017
|
}
|
|
@@ -10232,7 +10237,7 @@ var Kh = f.forwardRef((e, t) => {
|
|
|
10232
10237
|
defaultProp: i ?? null,
|
|
10233
10238
|
onChange: c,
|
|
10234
10239
|
caller: tn
|
|
10235
|
-
}), [
|
|
10240
|
+
}), [k, A] = f.useState(!1), C = et(l), y = Oi(n), E = f.useRef(!1), [I, O] = f.useState(0);
|
|
10236
10241
|
return f.useEffect(() => {
|
|
10237
10242
|
const T = g.current;
|
|
10238
10243
|
if (T)
|
|
@@ -10249,7 +10254,7 @@ var Kh = f.forwardRef((e, t) => {
|
|
|
10249
10254
|
(T) => v(T),
|
|
10250
10255
|
[v]
|
|
10251
10256
|
),
|
|
10252
|
-
onItemShiftTab: f.useCallback(() =>
|
|
10257
|
+
onItemShiftTab: f.useCallback(() => A(!0), []),
|
|
10253
10258
|
onFocusableItemAdd: f.useCallback(
|
|
10254
10259
|
() => O((T) => T + 1),
|
|
10255
10260
|
[]
|
|
@@ -10261,17 +10266,17 @@ var Kh = f.forwardRef((e, t) => {
|
|
|
10261
10266
|
children: /* @__PURE__ */ u(
|
|
10262
10267
|
Ri.div,
|
|
10263
10268
|
{
|
|
10264
|
-
tabIndex:
|
|
10269
|
+
tabIndex: k || I === 0 ? -1 : 0,
|
|
10265
10270
|
"data-orientation": r,
|
|
10266
10271
|
...m,
|
|
10267
10272
|
ref: h,
|
|
10268
10273
|
style: { outline: "none", ...e.style },
|
|
10269
10274
|
onMouseDown: J(e.onMouseDown, () => {
|
|
10270
|
-
|
|
10275
|
+
E.current = !0;
|
|
10271
10276
|
}),
|
|
10272
10277
|
onFocus: J(e.onFocus, (T) => {
|
|
10273
|
-
const z = !
|
|
10274
|
-
if (T.target === T.currentTarget && z && !
|
|
10278
|
+
const z = !E.current;
|
|
10279
|
+
if (T.target === T.currentTarget && z && !k) {
|
|
10275
10280
|
const H = new CustomEvent(Nr, jh);
|
|
10276
10281
|
if (T.currentTarget.dispatchEvent(H), !H.defaultPrevented) {
|
|
10277
10282
|
const V = y().filter((P) => P.focusable), q = V.find((P) => P.active), x = V.find((P) => P.id === p), R = [q, x, ...V].filter(
|
|
@@ -10280,9 +10285,9 @@ var Kh = f.forwardRef((e, t) => {
|
|
|
10280
10285
|
Li(R, d);
|
|
10281
10286
|
}
|
|
10282
10287
|
}
|
|
10283
|
-
|
|
10288
|
+
E.current = !1;
|
|
10284
10289
|
}),
|
|
10285
|
-
onBlur: J(e.onBlur, () =>
|
|
10290
|
+
onBlur: J(e.onBlur, () => A(!1))
|
|
10286
10291
|
}
|
|
10287
10292
|
)
|
|
10288
10293
|
}
|
|
@@ -10324,14 +10329,14 @@ var Kh = f.forwardRef((e, t) => {
|
|
|
10324
10329
|
return;
|
|
10325
10330
|
}
|
|
10326
10331
|
if (v.target !== v.currentTarget) return;
|
|
10327
|
-
const
|
|
10328
|
-
if (
|
|
10332
|
+
const k = Zh(v, d.orientation, d.dir);
|
|
10333
|
+
if (k !== void 0) {
|
|
10329
10334
|
if (v.metaKey || v.ctrlKey || v.altKey || v.shiftKey) return;
|
|
10330
10335
|
v.preventDefault();
|
|
10331
10336
|
let C = g().filter((y) => y.focusable).map((y) => y.ref.current);
|
|
10332
|
-
if (
|
|
10333
|
-
else if (
|
|
10334
|
-
|
|
10337
|
+
if (k === "last") C.reverse();
|
|
10338
|
+
else if (k === "prev" || k === "next") {
|
|
10339
|
+
k === "prev" && C.reverse();
|
|
10335
10340
|
const y = C.indexOf(v.currentTarget);
|
|
10336
10341
|
C = d.loop ? Jh(C, y + 1) : C.slice(y + 1);
|
|
10337
10342
|
}
|
|
@@ -10647,28 +10652,31 @@ function hg({
|
|
|
10647
10652
|
setCharCounts: d,
|
|
10648
10653
|
fileInputRefs: m,
|
|
10649
10654
|
...g
|
|
10650
|
-
} = s, h = t[e.name]
|
|
10655
|
+
} = s, h = t[e.name] ?? "", w = a, p = e.options || [], v = e.inline || !1, k = e.renderType === "segment", A = g["aria-describedby"], C = k ? "mt-2 inline-flex w-full p-1 rounded-lg bg-muted/50 border border-border shadow-inner" : v ? "flex flex-wrap gap-6 mt-2" : "space-y-4 mt-2";
|
|
10651
10656
|
return /* @__PURE__ */ D(
|
|
10652
10657
|
"fieldset",
|
|
10653
10658
|
{
|
|
10654
10659
|
className: `mb-4 ${e.fieldClass ? e.fieldClass : "col-span-full"}`,
|
|
10655
10660
|
"aria-labelledby": `${e.name}-legend`,
|
|
10656
|
-
"aria-describedby": o ?
|
|
10661
|
+
"aria-describedby": o ? A : void 0,
|
|
10657
10662
|
children: [
|
|
10658
10663
|
/* @__PURE__ */ u("legend", { className: "sr-only", children: e.label }),
|
|
10659
10664
|
/* @__PURE__ */ u(
|
|
10660
10665
|
pg,
|
|
10661
10666
|
{
|
|
10662
10667
|
...g,
|
|
10663
|
-
value: h,
|
|
10668
|
+
value: String(h),
|
|
10664
10669
|
onValueChange: (y) => {
|
|
10665
|
-
|
|
10670
|
+
const E = p.find(
|
|
10671
|
+
(O) => String(typeof O == "object" ? O.value : O) === y
|
|
10672
|
+
), I = E ? typeof E == "object" ? E.value : E : y;
|
|
10673
|
+
n(e.name, I), r(e.name);
|
|
10666
10674
|
},
|
|
10667
10675
|
disabled: w,
|
|
10668
10676
|
className: C,
|
|
10669
10677
|
children: p.map((y) => {
|
|
10670
|
-
const
|
|
10671
|
-
return
|
|
10678
|
+
const E = typeof y == "object" ? y.value : y, I = typeof y == "object" ? y.label : y, O = typeof y == "object" ? y.description : null, T = `${e.name}-${String(E)}`, z = String(h) === String(E);
|
|
10679
|
+
return k ? /* @__PURE__ */ D(
|
|
10672
10680
|
"label",
|
|
10673
10681
|
{
|
|
10674
10682
|
htmlFor: T,
|
|
@@ -10683,7 +10691,7 @@ function hg({
|
|
|
10683
10691
|
/* @__PURE__ */ u(
|
|
10684
10692
|
Na,
|
|
10685
10693
|
{
|
|
10686
|
-
value:
|
|
10694
|
+
value: String(E),
|
|
10687
10695
|
id: T,
|
|
10688
10696
|
disabled: w,
|
|
10689
10697
|
className: "sr-only"
|
|
@@ -10692,12 +10700,12 @@ function hg({
|
|
|
10692
10700
|
I
|
|
10693
10701
|
]
|
|
10694
10702
|
},
|
|
10695
|
-
|
|
10703
|
+
String(E)
|
|
10696
10704
|
) : /* @__PURE__ */ D("div", { className: "relative flex items-start group", children: [
|
|
10697
10705
|
/* @__PURE__ */ u("div", { className: "flex h-6 items-center", children: /* @__PURE__ */ u(
|
|
10698
10706
|
Na,
|
|
10699
10707
|
{
|
|
10700
|
-
value:
|
|
10708
|
+
value: String(E),
|
|
10701
10709
|
id: T,
|
|
10702
10710
|
disabled: w,
|
|
10703
10711
|
className: `
|
|
@@ -10725,7 +10733,7 @@ function hg({
|
|
|
10725
10733
|
}
|
|
10726
10734
|
)
|
|
10727
10735
|
] })
|
|
10728
|
-
] },
|
|
10736
|
+
] }, String(E));
|
|
10729
10737
|
})
|
|
10730
10738
|
}
|
|
10731
10739
|
)
|
|
@@ -10795,18 +10803,18 @@ function bg({
|
|
|
10795
10803
|
e.maxDate && p.push({ after: new Date(e.maxDate) }), e.minDate && p.push({ before: new Date(e.minDate) });
|
|
10796
10804
|
const v = (C) => {
|
|
10797
10805
|
n(e.name, C || null), C && w(C), e.closeOnSelect !== !1 && l(!1), r(e.name);
|
|
10798
|
-
},
|
|
10806
|
+
}, k = () => {
|
|
10799
10807
|
const C = /* @__PURE__ */ new Date();
|
|
10800
10808
|
n(e.name, C), w(C), e.closeOnSelect !== !1 && l(!1), r(e.name);
|
|
10801
|
-
},
|
|
10809
|
+
}, A = (C) => {
|
|
10802
10810
|
C.preventDefault(), C.stopPropagation(), n(e.name, null), w(/* @__PURE__ */ new Date()), r(e.name);
|
|
10803
10811
|
};
|
|
10804
10812
|
return /* @__PURE__ */ u("div", { className: "relative w-full", children: /* @__PURE__ */ D(
|
|
10805
10813
|
Yn,
|
|
10806
10814
|
{
|
|
10807
|
-
open: c,
|
|
10815
|
+
open: d ? !1 : c,
|
|
10808
10816
|
onOpenChange: (C) => {
|
|
10809
|
-
l(C), C || r(e.name);
|
|
10817
|
+
d || (l(C), C || r(e.name));
|
|
10810
10818
|
},
|
|
10811
10819
|
children: [
|
|
10812
10820
|
/* @__PURE__ */ u(qn, { asChild: !0, children: /* @__PURE__ */ D(
|
|
@@ -10844,7 +10852,7 @@ function bg({
|
|
|
10844
10852
|
{
|
|
10845
10853
|
type: "button",
|
|
10846
10854
|
"aria-label": "Clear selected date",
|
|
10847
|
-
onClick:
|
|
10855
|
+
onClick: A,
|
|
10848
10856
|
className: "p-1 hover:bg-muted rounded-full transition-colors focus-visible:ring-1 focus-visible:ring-ring outline-none relative z-10",
|
|
10849
10857
|
children: /* @__PURE__ */ u(
|
|
10850
10858
|
Yr,
|
|
@@ -10897,7 +10905,7 @@ function bg({
|
|
|
10897
10905
|
"button",
|
|
10898
10906
|
{
|
|
10899
10907
|
type: "button",
|
|
10900
|
-
onClick:
|
|
10908
|
+
onClick: k,
|
|
10901
10909
|
className: "text-xs font-medium px-4 py-2 rounded-md border border-input bg-background hover:bg-muted transition-all focus-visible:ring-2 focus-visible:ring-ring",
|
|
10902
10910
|
children: "Today"
|
|
10903
10911
|
}
|
|
@@ -10935,10 +10943,10 @@ function vg({ field: e, formValues: t, handleChange: n, handleBlur: r, error: o
|
|
|
10935
10943
|
}, v = () => {
|
|
10936
10944
|
const y = parseInt(i);
|
|
10937
10945
|
c((y % 12 + 1).toString().padStart(2, "0"));
|
|
10938
|
-
},
|
|
10946
|
+
}, k = () => {
|
|
10939
10947
|
const y = parseInt(i);
|
|
10940
10948
|
c((y === 1 ? 12 : y - 1).toString().padStart(2, "0"));
|
|
10941
|
-
},
|
|
10949
|
+
}, A = () => {
|
|
10942
10950
|
const y = parseInt(l);
|
|
10943
10951
|
d(((y + 5) % 60).toString().padStart(2, "0"));
|
|
10944
10952
|
}, C = () => {
|
|
@@ -11023,8 +11031,8 @@ function vg({ field: e, formValues: t, handleChange: n, handleBlur: r, error: o
|
|
|
11023
11031
|
type: "text",
|
|
11024
11032
|
value: i,
|
|
11025
11033
|
onChange: (y) => {
|
|
11026
|
-
const
|
|
11027
|
-
(
|
|
11034
|
+
const E = y.target.value.replace(/\D/g, "");
|
|
11035
|
+
(E === "" || parseInt(E) >= 1 && parseInt(E) <= 12) && c(E.padStart(2, "0"));
|
|
11028
11036
|
},
|
|
11029
11037
|
className: "w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2",
|
|
11030
11038
|
maxLength: "2"
|
|
@@ -11034,7 +11042,7 @@ function vg({ field: e, formValues: t, handleChange: n, handleBlur: r, error: o
|
|
|
11034
11042
|
"button",
|
|
11035
11043
|
{
|
|
11036
11044
|
type: "button",
|
|
11037
|
-
onClick:
|
|
11045
|
+
onClick: k,
|
|
11038
11046
|
className: "p-1 hover:bg-gray-100 rounded",
|
|
11039
11047
|
children: /* @__PURE__ */ u(
|
|
11040
11048
|
"svg",
|
|
@@ -11058,7 +11066,7 @@ function vg({ field: e, formValues: t, handleChange: n, handleBlur: r, error: o
|
|
|
11058
11066
|
"button",
|
|
11059
11067
|
{
|
|
11060
11068
|
type: "button",
|
|
11061
|
-
onClick:
|
|
11069
|
+
onClick: A,
|
|
11062
11070
|
className: "p-1 hover:bg-gray-100 rounded",
|
|
11063
11071
|
children: /* @__PURE__ */ u(
|
|
11064
11072
|
"svg",
|
|
@@ -11081,8 +11089,8 @@ function vg({ field: e, formValues: t, handleChange: n, handleBlur: r, error: o
|
|
|
11081
11089
|
type: "text",
|
|
11082
11090
|
value: l,
|
|
11083
11091
|
onChange: (y) => {
|
|
11084
|
-
const
|
|
11085
|
-
(
|
|
11092
|
+
const E = y.target.value.replace(/\D/g, "");
|
|
11093
|
+
(E === "" || parseInt(E) >= 0 && parseInt(E) <= 59) && d(E.padStart(2, "0"));
|
|
11086
11094
|
},
|
|
11087
11095
|
className: "w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2",
|
|
11088
11096
|
maxLength: "2"
|
|
@@ -11239,7 +11247,7 @@ const $g = ({
|
|
|
11239
11247
|
},
|
|
11240
11248
|
debugMode: l = !1
|
|
11241
11249
|
}) => {
|
|
11242
|
-
const [d, m] = ue({ ...i }), [g, h] = ue({}), [w, p] = ue({}), [v,
|
|
11250
|
+
const [d, m] = ue({ ...i }), [g, h] = ue({}), [w, p] = ue({}), [v, k] = ue({}), A = Yt({}), C = ["hidden", "linebreak", "header", "alert"], y = Vr(
|
|
11243
11251
|
() => ({
|
|
11244
11252
|
file: ka,
|
|
11245
11253
|
multifile: ka,
|
|
@@ -11263,7 +11271,7 @@ const $g = ({
|
|
|
11263
11271
|
linebreak: Bh
|
|
11264
11272
|
}),
|
|
11265
11273
|
[]
|
|
11266
|
-
),
|
|
11274
|
+
), E = async (x, N = null) => {
|
|
11267
11275
|
if (!(x.optionsUrl && !x.preloadOptions)) {
|
|
11268
11276
|
if (!e) {
|
|
11269
11277
|
const R = `apiClient prop is required when using fields with optionsUrl. Field "${x.name}" requires optionsUrl but no apiClient was provided.`;
|
|
@@ -11294,7 +11302,7 @@ const $g = ({
|
|
|
11294
11302
|
if (r?.fields && r.fields.length > 0) {
|
|
11295
11303
|
if (!r.fields.some((R) => R.value)) return;
|
|
11296
11304
|
r.fields.forEach((R) => {
|
|
11297
|
-
R.optionsUrl &&
|
|
11305
|
+
R.optionsUrl && E(R);
|
|
11298
11306
|
});
|
|
11299
11307
|
const N = {};
|
|
11300
11308
|
r.fields.forEach((R) => {
|
|
@@ -11456,11 +11464,11 @@ const $g = ({
|
|
|
11456
11464
|
formValues: d,
|
|
11457
11465
|
handleChange: O,
|
|
11458
11466
|
handleBlur: () => T(x.name),
|
|
11459
|
-
setCharCounts:
|
|
11467
|
+
setCharCounts: k,
|
|
11460
11468
|
charCount: v[x.name] || 0,
|
|
11461
11469
|
api_URL: t,
|
|
11462
11470
|
error: R,
|
|
11463
|
-
fileInputRefs:
|
|
11471
|
+
fileInputRefs: A,
|
|
11464
11472
|
disabled: P,
|
|
11465
11473
|
apiClient: e
|
|
11466
11474
|
}
|