ynotsoft-dynamic-form 1.0.93 → 1.0.94

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.
@@ -347,7 +347,7 @@ function dl({
347
347
  h(!1), r(e.name);
348
348
  break;
349
349
  }
350
- }, R = (N) => {
350
+ }, O = (N) => {
351
351
  const S = N.target.value;
352
352
  k(S), E(-1), P.current && clearTimeout(P.current), P.current = setTimeout(() => G(S), 300);
353
353
  };
@@ -364,7 +364,7 @@ function dl({
364
364
  };
365
365
  return document.addEventListener("mousedown", N), () => document.removeEventListener("mousedown", N);
366
366
  }, [e.name, r]);
367
- const O = (N, S) => {
367
+ const R = (N, S) => {
368
368
  N.stopPropagation();
369
369
  const z = Array.isArray(F) ? F : [], Y = l ? null : z.filter((j) => j !== S);
370
370
  n(e.name, Y), r(e.name);
@@ -404,7 +404,7 @@ function dl({
404
404
  {
405
405
  type: "button",
406
406
  "aria-label": `Remove ${N.label}`,
407
- onClick: (S) => O(S, N.value),
407
+ onClick: (S) => R(S, N.value),
408
408
  className: "ml-1 p-0.5 hover:bg-primary/20 rounded-full transition-colors",
409
409
  children: /* @__PURE__ */ u(Gr, { className: "w-3 h-3" })
410
410
  }
@@ -437,7 +437,7 @@ function dl({
437
437
  "aria-controls": `${e.name}-listbox`,
438
438
  "aria-activedescendant": C >= 0 ? `${e.name}-opt-${C}` : void 0,
439
439
  value: y,
440
- onChange: R,
440
+ onChange: O,
441
441
  onKeyDown: T,
442
442
  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",
443
443
  placeholder: "Type to search..."
@@ -1272,17 +1272,17 @@ const Zl = (e) => ({
1272
1272
  }, p = Jr(o), v = Zr(p), h = await s.getDimensions(l), y = p === "y", k = y ? "top" : "left", C = y ? "bottom" : "right", E = y ? "clientHeight" : "clientWidth", x = a.reference[v] + a.reference[p] - g[p] - a.floating[v], A = g[p] - a.reference[p], I = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l));
1273
1273
  let _ = I ? I[E] : 0;
1274
1274
  (!_ || !await (s.isElement == null ? void 0 : s.isElement(I))) && (_ = i.floating[E] || a.floating[v]);
1275
- const P = x / 2 - A / 2, F = _ / 2 - h[v] / 2 - 1, V = tt(m[k], F), H = tt(m[C], F), G = V, w = _ - h[v] - H, T = _ / 2 - h[v] / 2 + P, R = Rr(G, T, w), O = !c.arrow && Ot(o) != null && T !== R && a.reference[v] / 2 - (T < G ? V : H) - h[v] / 2 < 0, N = O ? T < G ? T - G : T - w : 0;
1275
+ const P = x / 2 - A / 2, F = _ / 2 - h[v] / 2 - 1, V = tt(m[k], F), H = tt(m[C], F), G = V, w = _ - h[v] - H, T = _ / 2 - h[v] / 2 + P, O = Rr(G, T, w), R = !c.arrow && Ot(o) != null && T !== O && a.reference[v] / 2 - (T < G ? V : H) - h[v] / 2 < 0, N = R ? T < G ? T - G : T - w : 0;
1276
1276
  return {
1277
1277
  [p]: g[p] + N,
1278
1278
  data: {
1279
- [p]: R,
1280
- centerOffset: T - R - N,
1281
- ...O && {
1279
+ [p]: O,
1280
+ centerOffset: T - O - N,
1281
+ ...R && {
1282
1282
  alignmentOffset: N
1283
1283
  }
1284
1284
  },
1285
- reset: O
1285
+ reset: R
1286
1286
  };
1287
1287
  }
1288
1288
  }), Jl = function(e) {
@@ -1322,8 +1322,8 @@ const Zl = (e) => ({
1322
1322
  overflows: F
1323
1323
  }], !F.every((T) => T <= 0)) {
1324
1324
  var H, G;
1325
- const T = (((H = a.flip) == null ? void 0 : H.index) || 0) + 1, R = _[T];
1326
- if (R && (!(m === "alignment" ? C !== ze(R) : !1) || // We leave the current main axis only if every placement on that axis
1325
+ const T = (((H = a.flip) == null ? void 0 : H.index) || 0) + 1, O = _[T];
1326
+ if (O && (!(m === "alignment" ? C !== ze(O) : !1) || // We leave the current main axis only if every placement on that axis
1327
1327
  // overflows the main axis.
1328
1328
  V.every((S) => ze(S.placement) === C ? S.overflows[0] > 0 : !0)))
1329
1329
  return {
@@ -1332,11 +1332,11 @@ const Zl = (e) => ({
1332
1332
  overflows: V
1333
1333
  },
1334
1334
  reset: {
1335
- placement: R
1335
+ placement: O
1336
1336
  }
1337
1337
  };
1338
- let O = (G = V.filter((N) => N.overflows[0] <= 0).sort((N, S) => N.overflows[1] - S.overflows[1])[0]) == null ? void 0 : G.placement;
1339
- if (!O)
1338
+ let R = (G = V.filter((N) => N.overflows[0] <= 0).sort((N, S) => N.overflows[1] - S.overflows[1])[0]) == null ? void 0 : G.placement;
1339
+ if (!R)
1340
1340
  switch (p) {
1341
1341
  case "bestFit": {
1342
1342
  var w;
@@ -1349,17 +1349,17 @@ const Zl = (e) => ({
1349
1349
  }
1350
1350
  return !0;
1351
1351
  }).map((S) => [S.placement, S.overflows.filter((z) => z > 0).reduce((z, Y) => z + Y, 0)]).sort((S, z) => S[1] - z[1])[0]) == null ? void 0 : w[0];
1352
- N && (O = N);
1352
+ N && (R = N);
1353
1353
  break;
1354
1354
  }
1355
1355
  case "initialPlacement":
1356
- O = i;
1356
+ R = i;
1357
1357
  break;
1358
1358
  }
1359
- if (o !== O)
1359
+ if (o !== R)
1360
1360
  return {
1361
1361
  reset: {
1362
- placement: O
1362
+ placement: R
1363
1363
  }
1364
1364
  };
1365
1365
  }
@@ -2218,12 +2218,12 @@ function Bu(e) {
2218
2218
  w();
2219
2219
  }
2220
2220
  }, [x, A, w, V, F]);
2221
- const R = f.useMemo(() => ({
2221
+ const O = f.useMemo(() => ({
2222
2222
  reference: I,
2223
2223
  floating: _,
2224
2224
  setReference: C,
2225
2225
  setFloating: E
2226
- }), [C, E]), O = f.useMemo(() => ({
2226
+ }), [C, E]), R = f.useMemo(() => ({
2227
2227
  reference: x,
2228
2228
  floating: A
2229
2229
  }), [x, A]), N = f.useMemo(() => {
@@ -2232,13 +2232,13 @@ function Bu(e) {
2232
2232
  left: 0,
2233
2233
  top: 0
2234
2234
  };
2235
- if (!O.floating)
2235
+ if (!R.floating)
2236
2236
  return S;
2237
- const z = Xo(O.floating, d.x), Y = Xo(O.floating, d.y);
2237
+ const z = Xo(R.floating, d.x), Y = Xo(R.floating, d.y);
2238
2238
  return i ? {
2239
2239
  ...S,
2240
2240
  transform: "translate(" + z + "px, " + Y + "px)",
2241
- ...qa(O.floating) >= 1.5 && {
2241
+ ...qa(R.floating) >= 1.5 && {
2242
2242
  willChange: "transform"
2243
2243
  }
2244
2244
  } : {
@@ -2246,14 +2246,14 @@ function Bu(e) {
2246
2246
  left: z,
2247
2247
  top: Y
2248
2248
  };
2249
- }, [n, i, O.floating, d.x, d.y]);
2249
+ }, [n, i, R.floating, d.x, d.y]);
2250
2250
  return f.useMemo(() => ({
2251
2251
  ...d,
2252
2252
  update: w,
2253
- refs: R,
2254
- elements: O,
2253
+ refs: O,
2254
+ elements: R,
2255
2255
  floatingStyles: N
2256
- }), [d, w, R, O, N]);
2256
+ }), [d, w, O, R, N]);
2257
2257
  }
2258
2258
  const Hu = (e) => {
2259
2259
  function t(n) {
@@ -2422,7 +2422,7 @@ var oo = "PopperContent", [nd, rd] = Za(oo), rs = f.forwardRef(
2422
2422
  boundary: H.filter(ad),
2423
2423
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
2424
2424
  altBoundary: G
2425
- }, { refs: T, floatingStyles: R, placement: O, isPositioned: N, middlewareData: S } = Bu({
2425
+ }, { refs: T, floatingStyles: O, placement: R, isPositioned: N, middlewareData: S } = Bu({
2426
2426
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
2427
2427
  strategy: "fixed",
2428
2428
  placement: F,
@@ -2452,7 +2452,7 @@ var oo = "PopperContent", [nd, rd] = Za(oo), rs = f.forwardRef(
2452
2452
  sd({ arrowWidth: _, arrowHeight: P }),
2453
2453
  g && qu({ strategy: "referenceHidden", ...w })
2454
2454
  ]
2455
- }), [z, Y] = ss(O), j = et(v);
2455
+ }), [z, Y] = ss(R), j = et(v);
2456
2456
  be(() => {
2457
2457
  N && j?.();
2458
2458
  }, [N, j]);
@@ -2465,8 +2465,8 @@ var oo = "PopperContent", [nd, rd] = Za(oo), rs = f.forwardRef(
2465
2465
  ref: T.setFloating,
2466
2466
  "data-radix-popper-content-wrapper": "",
2467
2467
  style: {
2468
- ...R,
2469
- transform: N ? R.transform : "translate(0, -200%)",
2468
+ ...O,
2469
+ transform: N ? O.transform : "translate(0, -200%)",
2470
2470
  // keep off the page when measuring
2471
2471
  minWidth: "max-content",
2472
2472
  zIndex: J,
@@ -3283,7 +3283,7 @@ var rf = [" ", "Enter", "ArrowUp", "ArrowDown"], of = [" ", "Enter"], mt = "Sele
3283
3283
  defaultProp: i,
3284
3284
  onChange: c,
3285
3285
  caller: mt
3286
- }), H = f.useRef(null), G = y ? v || !!y.closest("form") : !0, [w, T] = f.useState(/* @__PURE__ */ new Set()), R = Array.from(w).map((O) => O.props.value).join(";");
3286
+ }), H = f.useRef(null), G = y ? v || !!y.closest("form") : !0, [w, T] = f.useState(/* @__PURE__ */ new Set()), O = Array.from(w).map((R) => R.props.value).join(";");
3287
3287
  return /* @__PURE__ */ u(is, { ...h, children: /* @__PURE__ */ D(
3288
3288
  sf,
3289
3289
  {
@@ -3308,13 +3308,13 @@ var rf = [" ", "Enter", "ArrowUp", "ArrowDown"], of = [" ", "Enter"], mt = "Sele
3308
3308
  cf,
3309
3309
  {
3310
3310
  scope: e.__scopeSelect,
3311
- onNativeOptionAdd: f.useCallback((O) => {
3312
- T((N) => new Set(N).add(O));
3311
+ onNativeOptionAdd: f.useCallback((R) => {
3312
+ T((N) => new Set(N).add(R));
3313
3313
  }, []),
3314
- onNativeOptionRemove: f.useCallback((O) => {
3314
+ onNativeOptionRemove: f.useCallback((R) => {
3315
3315
  T((N) => {
3316
3316
  const S = new Set(N);
3317
- return S.delete(O), S;
3317
+ return S.delete(R), S;
3318
3318
  });
3319
3319
  }, []),
3320
3320
  children: n
@@ -3329,7 +3329,7 @@ var rf = [" ", "Enter", "ArrowUp", "ArrowDown"], of = [" ", "Enter"], mt = "Sele
3329
3329
  name: d,
3330
3330
  autoComplete: m,
3331
3331
  value: F,
3332
- onChange: (O) => V(O.target.value),
3332
+ onChange: (R) => V(R.target.value),
3333
3333
  disabled: g,
3334
3334
  form: v,
3335
3335
  children: [
@@ -3337,7 +3337,7 @@ var rf = [" ", "Enter", "ArrowUp", "ArrowDown"], of = [" ", "Enter"], mt = "Sele
3337
3337
  Array.from(w)
3338
3338
  ]
3339
3339
  },
3340
- R
3340
+ O
3341
3341
  ) : null
3342
3342
  ]
3343
3343
  }
@@ -3454,11 +3454,11 @@ var Oe = 10, [Ps, at] = Mt(pt), ff = "SelectContentImpl", mf = /* @__PURE__ */ C
3454
3454
  ...k
3455
3455
  } = e, C = ot(pt, n), [E, x] = f.useState(null), [A, I] = f.useState(null), _ = ie(t, (L) => x(L)), [P, F] = f.useState(null), [V, H] = f.useState(
3456
3456
  null
3457
- ), G = Bn(n), [w, T] = f.useState(!1), R = f.useRef(!1);
3457
+ ), G = Bn(n), [w, T] = f.useState(!1), O = f.useRef(!1);
3458
3458
  f.useEffect(() => {
3459
3459
  if (E) return ms(E);
3460
3460
  }, [E]), La();
3461
- const O = f.useCallback(
3461
+ const R = f.useCallback(
3462
3462
  (L) => {
3463
3463
  const [te, ...ce] = G().map((oe) => oe.ref.current), [Q] = ce.slice(-1), ne = document.activeElement;
3464
3464
  for (const oe of L)
@@ -3466,8 +3466,8 @@ var Oe = 10, [Ps, at] = Mt(pt), ff = "SelectContentImpl", mf = /* @__PURE__ */ C
3466
3466
  },
3467
3467
  [G, A]
3468
3468
  ), N = f.useCallback(
3469
- () => O([P, E]),
3470
- [O, P, E]
3469
+ () => R([P, E]),
3470
+ [R, P, E]
3471
3471
  );
3472
3472
  f.useEffect(() => {
3473
3473
  w && N();
@@ -3499,13 +3499,13 @@ var Oe = 10, [Ps, at] = Mt(pt), ff = "SelectContentImpl", mf = /* @__PURE__ */ C
3499
3499
  Q && setTimeout(() => Q.ref.current.focus());
3500
3500
  }), ve = f.useCallback(
3501
3501
  (L, te, ce) => {
3502
- const Q = !R.current && !ce;
3503
- (C.value !== void 0 && C.value === te || Q) && (F(L), Q && (R.current = !0));
3502
+ const Q = !O.current && !ce;
3503
+ (C.value !== void 0 && C.value === te || Q) && (F(L), Q && (O.current = !0));
3504
3504
  },
3505
3505
  [C.value]
3506
3506
  ), q = f.useCallback(() => E?.focus(), [E]), ee = f.useCallback(
3507
3507
  (L, te, ce) => {
3508
- const Q = !R.current && !ce;
3508
+ const Q = !O.current && !ce;
3509
3509
  (C.value !== void 0 && C.value === te || Q) && H(L);
3510
3510
  },
3511
3511
  [C.value]
@@ -3585,7 +3585,7 @@ var Oe = 10, [Ps, at] = Mt(pt), ff = "SelectContentImpl", mf = /* @__PURE__ */ C
3585
3585
  const ne = L.target, oe = Q.indexOf(ne);
3586
3586
  Q = Q.slice(oe + 1);
3587
3587
  }
3588
- setTimeout(() => O(Q)), L.preventDefault();
3588
+ setTimeout(() => R(Q)), L.preventDefault();
3589
3589
  }
3590
3590
  })
3591
3591
  }
@@ -3621,7 +3621,7 @@ var pf = "SelectItemAlignedPosition", Os = f.forwardRef((e, t) => {
3621
3621
  ]);
3622
3622
  i.style.minWidth = Ne + "px", i.style.right = ct + "px";
3623
3623
  }
3624
- const H = g(), G = window.innerHeight - Oe * 2, w = h.scrollHeight, T = window.getComputedStyle(l), R = parseInt(T.borderTopWidth, 10), O = parseInt(T.paddingTop, 10), N = parseInt(T.borderBottomWidth, 10), S = parseInt(T.paddingBottom, 10), z = R + O + w + S + N, Y = Math.min(y.offsetHeight * 5, z), j = window.getComputedStyle(h), ve = parseInt(j.paddingTop, 10), q = parseInt(j.paddingBottom, 10), ee = _.top + _.height / 2 - Oe, J = G - ee, he = y.offsetHeight / 2, L = y.offsetTop + he, te = R + O + L, ce = z - te;
3624
+ const H = g(), G = window.innerHeight - Oe * 2, w = h.scrollHeight, T = window.getComputedStyle(l), O = parseInt(T.borderTopWidth, 10), R = parseInt(T.paddingTop, 10), N = parseInt(T.borderBottomWidth, 10), S = parseInt(T.paddingBottom, 10), z = O + R + w + S + N, Y = Math.min(y.offsetHeight * 5, z), j = window.getComputedStyle(h), ve = parseInt(j.paddingTop, 10), q = parseInt(j.paddingBottom, 10), ee = _.top + _.height / 2 - Oe, J = G - ee, he = y.offsetHeight / 2, L = y.offsetTop + he, te = O + R + L, ce = z - te;
3625
3625
  if (te <= ee) {
3626
3626
  const ne = H.length > 0 && y === H[H.length - 1].ref.current;
3627
3627
  i.style.bottom = "0px";
@@ -3636,7 +3636,7 @@ var pf = "SelectItemAlignedPosition", Os = f.forwardRef((e, t) => {
3636
3636
  i.style.top = "0px";
3637
3637
  const de = Math.max(
3638
3638
  ee,
3639
- R + h.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
3639
+ O + h.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
3640
3640
  (ne ? ve : 0) + he
3641
3641
  ) + ce;
3642
3642
  i.style.height = de + "px", h.scrollTop = te - ee + h.offsetTop;
@@ -4064,7 +4064,7 @@ function $f({ field: e, formValues: t, handleChange: n, handleBlur: r, error: o,
4064
4064
  value: E[e.valueId || "key"] || E.key,
4065
4065
  label: E[e.labelId || "value"] || E.value
4066
4066
  }));
4067
- l(C), e.name + "_count" in t && (console.log("Updating count for", e.name, "to", C.length), n(e.name + "_count", C.length));
4067
+ l(C), e.name + "_count" in t && n(e.name + "_count", C.length);
4068
4068
  } catch (p) {
4069
4069
  console.error("Failed to load options for SelectField:", p), l(e.options || []);
4070
4070
  } finally {
@@ -4449,8 +4449,8 @@ function Zs() {
4449
4449
  MUSTACHE_EXPR: G,
4450
4450
  ERB_EXPR: w,
4451
4451
  TMPLIT_EXPR: T,
4452
- DATA_ATTR: R,
4453
- ARIA_ATTR: O,
4452
+ DATA_ATTR: O,
4453
+ ARIA_ATTR: R,
4454
4454
  IS_SCRIPT_OR_DATA: N,
4455
4455
  ATTR_WHITESPACE: S,
4456
4456
  CUSTOM_ELEMENT: z
@@ -4641,8 +4641,8 @@ function Zs() {
4641
4641
  }, ko = function(b, M, B) {
4642
4642
  if (mo && (M === "id" || M === "name") && (B in n || B in ec))
4643
4643
  return !1;
4644
- if (!(Q && !L[M] && ye(R, M))) {
4645
- if (!(ce && ye(O, M))) {
4644
+ if (!(Q && !L[M] && ye(O, M))) {
4645
+ if (!(ce && ye(R, M))) {
4646
4646
  if (!(te.attributeCheck instanceof Function && te.attributeCheck(M, b))) {
4647
4647
  if (!q[M] || L[M]) {
4648
4648
  if (
@@ -7038,7 +7038,7 @@ const Lp = (e, t) => {
7038
7038
  "left-bottom"
7039
7039
  ], A = () => [...x(), W, $], I = () => ["auto", "hidden", "clip", "visible", "scroll"], _ = () => ["auto", "contain", "none"], P = () => [W, $, c], F = () => [kt, "full", "auto", ...P()], V = () => [Ze, "none", "subgrid", W, $], H = () => ["auto", {
7040
7040
  span: ["full", Ze, W, $]
7041
- }, Ze, W, $], G = () => [Ze, "auto", W, $], w = () => ["auto", "min", "max", "fr", W, $], T = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], R = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], O = () => ["auto", ...P()], N = () => [kt, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...P()], S = () => [e, W, $], z = () => [...x(), Ca, Sa, {
7041
+ }, Ze, W, $], G = () => [Ze, "auto", W, $], w = () => ["auto", "min", "max", "fr", W, $], T = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], O = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], R = () => ["auto", ...P()], N = () => [kt, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...P()], S = () => [e, W, $], z = () => [...x(), Ca, Sa, {
7042
7042
  position: [W, $]
7043
7043
  }], Y = () => ["no-repeat", {
7044
7044
  repeat: ["", "x", "y", "space", "round"]
@@ -7469,14 +7469,14 @@ const Lp = (e, t) => {
7469
7469
  * @see https://tailwindcss.com/docs/justify-items
7470
7470
  */
7471
7471
  "justify-items": [{
7472
- "justify-items": [...R(), "normal"]
7472
+ "justify-items": [...O(), "normal"]
7473
7473
  }],
7474
7474
  /**
7475
7475
  * Justify Self
7476
7476
  * @see https://tailwindcss.com/docs/justify-self
7477
7477
  */
7478
7478
  "justify-self": [{
7479
- "justify-self": ["auto", ...R()]
7479
+ "justify-self": ["auto", ...O()]
7480
7480
  }],
7481
7481
  /**
7482
7482
  * Align Content
@@ -7490,7 +7490,7 @@ const Lp = (e, t) => {
7490
7490
  * @see https://tailwindcss.com/docs/align-items
7491
7491
  */
7492
7492
  "align-items": [{
7493
- items: [...R(), {
7493
+ items: [...O(), {
7494
7494
  baseline: ["", "last"]
7495
7495
  }]
7496
7496
  }],
@@ -7499,7 +7499,7 @@ const Lp = (e, t) => {
7499
7499
  * @see https://tailwindcss.com/docs/align-self
7500
7500
  */
7501
7501
  "align-self": [{
7502
- self: ["auto", ...R(), {
7502
+ self: ["auto", ...O(), {
7503
7503
  baseline: ["", "last"]
7504
7504
  }]
7505
7505
  }],
@@ -7515,14 +7515,14 @@ const Lp = (e, t) => {
7515
7515
  * @see https://tailwindcss.com/docs/place-items
7516
7516
  */
7517
7517
  "place-items": [{
7518
- "place-items": [...R(), "baseline"]
7518
+ "place-items": [...O(), "baseline"]
7519
7519
  }],
7520
7520
  /**
7521
7521
  * Place Self
7522
7522
  * @see https://tailwindcss.com/docs/place-self
7523
7523
  */
7524
7524
  "place-self": [{
7525
- "place-self": ["auto", ...R()]
7525
+ "place-self": ["auto", ...O()]
7526
7526
  }],
7527
7527
  // Spacing
7528
7528
  /**
@@ -7593,63 +7593,63 @@ const Lp = (e, t) => {
7593
7593
  * @see https://tailwindcss.com/docs/margin
7594
7594
  */
7595
7595
  m: [{
7596
- m: O()
7596
+ m: R()
7597
7597
  }],
7598
7598
  /**
7599
7599
  * Margin X
7600
7600
  * @see https://tailwindcss.com/docs/margin
7601
7601
  */
7602
7602
  mx: [{
7603
- mx: O()
7603
+ mx: R()
7604
7604
  }],
7605
7605
  /**
7606
7606
  * Margin Y
7607
7607
  * @see https://tailwindcss.com/docs/margin
7608
7608
  */
7609
7609
  my: [{
7610
- my: O()
7610
+ my: R()
7611
7611
  }],
7612
7612
  /**
7613
7613
  * Margin Start
7614
7614
  * @see https://tailwindcss.com/docs/margin
7615
7615
  */
7616
7616
  ms: [{
7617
- ms: O()
7617
+ ms: R()
7618
7618
  }],
7619
7619
  /**
7620
7620
  * Margin End
7621
7621
  * @see https://tailwindcss.com/docs/margin
7622
7622
  */
7623
7623
  me: [{
7624
- me: O()
7624
+ me: R()
7625
7625
  }],
7626
7626
  /**
7627
7627
  * Margin Top
7628
7628
  * @see https://tailwindcss.com/docs/margin
7629
7629
  */
7630
7630
  mt: [{
7631
- mt: O()
7631
+ mt: R()
7632
7632
  }],
7633
7633
  /**
7634
7634
  * Margin Right
7635
7635
  * @see https://tailwindcss.com/docs/margin
7636
7636
  */
7637
7637
  mr: [{
7638
- mr: O()
7638
+ mr: R()
7639
7639
  }],
7640
7640
  /**
7641
7641
  * Margin Bottom
7642
7642
  * @see https://tailwindcss.com/docs/margin
7643
7643
  */
7644
7644
  mb: [{
7645
- mb: O()
7645
+ mb: R()
7646
7646
  }],
7647
7647
  /**
7648
7648
  * Margin Left
7649
7649
  * @see https://tailwindcss.com/docs/margin
7650
7650
  */
7651
7651
  ml: [{
7652
- ml: O()
7652
+ ml: R()
7653
7653
  }],
7654
7654
  /**
7655
7655
  * Space Between X
@@ -9657,29 +9657,29 @@ function Ea({
9657
9657
  );
9658
9658
  const k = (w) => {
9659
9659
  if (w === 0) return "0 Bytes";
9660
- const T = 1024, R = ["Bytes", "KB", "MB", "GB"], O = Math.floor(Math.log(w) / Math.log(T));
9661
- return `${parseFloat((w / T ** O).toFixed(2))} ${R[O]}`;
9660
+ const T = 1024, O = ["Bytes", "KB", "MB", "GB"], R = Math.floor(Math.log(w) / Math.log(T));
9661
+ return `${parseFloat((w / T ** R).toFixed(2))} ${O[R]}`;
9662
9662
  }, C = async (w) => {
9663
9663
  const T = new FormData();
9664
9664
  T.append("file", w);
9665
- const R = await fetch(`${y}`, {
9665
+ const O = await fetch(`${y}`, {
9666
9666
  method: "POST",
9667
9667
  body: T
9668
9668
  });
9669
- if (!R.ok)
9669
+ if (!O.ok)
9670
9670
  throw Cn.error("Upload failed"), new Error("Upload failed");
9671
- return await R.json();
9671
+ return await O.json();
9672
9672
  }, E = async (w, T) => {
9673
9673
  if (!T) return;
9674
9674
  if (w.maxSize && T.size > w.maxSize)
9675
9675
  throw new Error(
9676
9676
  `File size must not exceed ${k(w.maxSize)}`
9677
9677
  );
9678
- const R = await C(T), O = { ...t, [w.name]: R };
9679
- a(w.name, R), s(O);
9678
+ const O = await C(T), R = { ...t, [w.name]: O };
9679
+ a(w.name, O), s(R);
9680
9680
  }, x = async (w, T) => {
9681
- const R = t[w.name] || [];
9682
- if (w.maxFiles && R.length + T.length > w.maxFiles)
9681
+ const O = t[w.name] || [];
9682
+ if (w.maxFiles && O.length + T.length > w.maxFiles)
9683
9683
  throw new Error(`Maximum ${w.maxFiles} files allowed`);
9684
9684
  T.forEach((S) => {
9685
9685
  if (w.maxSize && S.size > w.maxSize)
@@ -9687,23 +9687,23 @@ function Ea({
9687
9687
  `Each file must not exceed ${k(w.maxSize)}`
9688
9688
  );
9689
9689
  });
9690
- const O = await Promise.all(
9690
+ const R = await Promise.all(
9691
9691
  T.map((S) => C(S))
9692
9692
  // Updated call
9693
- ), N = [...R, ...O];
9693
+ ), N = [...O, ...R];
9694
9694
  a(w.name, N), s({ ...t, [w.name]: N });
9695
9695
  }, A = async (w, T) => {
9696
9696
  if (l) return;
9697
- const R = Array.from(T);
9697
+ const O = Array.from(T);
9698
9698
  try {
9699
- e.type === "multifile" ? await x(e, R) : await E(e, R[0]), o.current?.[w] && (o.current[w].value = "");
9700
- } catch (O) {
9701
- Cn.error(`Upload failed: ${O.message}`);
9699
+ e.type === "multifile" ? await x(e, O) : await E(e, O[0]), o.current?.[w] && (o.current[w].value = "");
9700
+ } catch (R) {
9701
+ Cn.error(`Upload failed: ${R.message}`);
9702
9702
  }
9703
9703
  }, I = async (w, T) => {
9704
9704
  if (l) return;
9705
- let R;
9706
- e.type === "file" ? R = "" : R = (t[w] || []).filter((N) => N !== T), a(w, R), s({ ...t, [w]: R }), o.current?.[w] && (o.current[w].value = "");
9705
+ let O;
9706
+ e.type === "file" ? O = "" : O = (t[w] || []).filter((N) => N !== T), a(w, O), s({ ...t, [w]: O }), o.current?.[w] && (o.current[w].value = "");
9707
9707
  }, _ = (w) => {
9708
9708
  w.preventDefault(), l || h(!0);
9709
9709
  }, P = (w) => {
@@ -9773,17 +9773,17 @@ function Ea({
9773
9773
  }
9774
9774
  ),
9775
9775
  p.length > 0 && /* @__PURE__ */ u("div", { className: "space-y-2 pt-2 border-t border-gray-200", children: p.map((w, T) => {
9776
- const R = w.original_name || w.name || "File", O = w.size || null;
9776
+ const O = w.original_name || w.name || "File", R = w.size || null;
9777
9777
  return /* @__PURE__ */ D(
9778
9778
  "div",
9779
9779
  {
9780
9780
  className: "flex items-center justify-between p-2 bg-gray-50 rounded",
9781
9781
  children: [
9782
9782
  /* @__PURE__ */ D("div", { className: "flex items-center space-x-2 min-w-0", children: [
9783
- /* @__PURE__ */ u("span", { className: "text-sm truncate", children: R }),
9784
- O && /* @__PURE__ */ D("span", { className: "text-xs text-gray-500 flex-shrink-0", children: [
9783
+ /* @__PURE__ */ u("span", { className: "text-sm truncate", children: O }),
9784
+ R && /* @__PURE__ */ D("span", { className: "text-xs text-gray-500 flex-shrink-0", children: [
9785
9785
  "(",
9786
- k(O),
9786
+ k(R),
9787
9787
  ")"
9788
9788
  ] })
9789
9789
  ] }),
@@ -10271,10 +10271,10 @@ var Kh = f.forwardRef((e, t) => {
10271
10271
  if (P.target === P.currentTarget && F && !k) {
10272
10272
  const V = new CustomEvent(Nr, jh);
10273
10273
  if (P.currentTarget.dispatchEvent(V), !V.defaultPrevented) {
10274
- const H = x().filter((O) => O.focusable), G = H.find((O) => O.active), w = H.find((O) => O.id === h), R = [G, w, ...H].filter(
10274
+ const H = x().filter((R) => R.focusable), G = H.find((R) => R.active), w = H.find((R) => R.id === h), O = [G, w, ...H].filter(
10275
10275
  Boolean
10276
- ).map((O) => O.ref.current);
10277
- Li(R, d);
10276
+ ).map((R) => R.ref.current);
10277
+ Li(O, d);
10278
10278
  }
10279
10279
  }
10280
10280
  A.current = !1;
@@ -11237,52 +11237,52 @@ const $g = ({
11237
11237
  []
11238
11238
  ), A = async (w, T = null) => {
11239
11239
  if (!e) {
11240
- const R = `apiClient prop is required when using fields with optionsUrl. Field "${w.name}" requires optionsUrl but no apiClient was provided.`;
11241
- l && console.error(R), Cn.error(R);
11240
+ const O = `apiClient prop is required when using fields with optionsUrl. Field "${w.name}" requires optionsUrl but no apiClient was provided.`;
11241
+ l && console.error(O), Cn.error(O);
11242
11242
  return;
11243
11243
  }
11244
11244
  try {
11245
- const R = await e(`/${w.optionsUrl}`);
11246
- let O = [];
11247
- w.type === "select" ? O = [
11245
+ const O = await e(`/${w.optionsUrl}`);
11246
+ let R = [];
11247
+ w.type === "select" ? R = [
11248
11248
  { value: "", label: `Select ${w.label.toLowerCase()}` },
11249
- ...R.data
11250
- ] : O = [
11251
- ...R.data.map((N) => ({
11249
+ ...O.data
11250
+ ] : R = [
11251
+ ...O.data.map((N) => ({
11252
11252
  value: N.value,
11253
11253
  label: N.label
11254
11254
  }))
11255
11255
  ], r.fields.forEach((N) => {
11256
- N.name === w.name && (N.options = O);
11256
+ N.name === w.name && (N.options = R);
11257
11257
  });
11258
- } catch (R) {
11259
- l && console.error(`Failed to load options for ${w.name}:`, R);
11258
+ } catch (O) {
11259
+ l && console.error(`Failed to load options for ${w.name}:`, O);
11260
11260
  } finally {
11261
11261
  }
11262
11262
  };
11263
11263
  qe(() => {
11264
11264
  if (r?.fields && r.fields.length > 0) {
11265
- if (!r.fields.some((R) => R.value)) return;
11266
- r.fields.forEach((R) => {
11267
- R.optionsUrl && A(R);
11265
+ if (!r.fields.some((O) => O.value)) return;
11266
+ r.fields.forEach((O) => {
11267
+ O.optionsUrl && A(O);
11268
11268
  });
11269
11269
  const T = {};
11270
- r.fields.forEach((R) => {
11271
- if (!R.name) return;
11272
- const O = R.type === "multiselect" || R.type === "searchselect" || R.type === "checkbox" && R.options && R.options.length > 0;
11273
- let N = i[R.name] ?? R.value ?? (O ? [] : "");
11274
- ["date", "datetime", "datepicker"].includes(R.type?.toLowerCase()) && N && (console.log(`[BEFORE dateTimeParser] Field: ${R.name}, Type: ${R.type}, Value:`, N, `Type: ${typeof N}`), N = Eg(N) || N, console.log(`[AFTER dateTimeParser] Field: ${R.name}, Parsed Value:`, N, `Type: ${typeof N}`, `Is Date: ${N instanceof Date}`)), T[R.name] = N;
11270
+ r.fields.forEach((O) => {
11271
+ if (!O.name) return;
11272
+ const R = O.type === "multiselect" || O.type === "searchselect" || O.type === "checkbox" && O.options && O.options.length > 0;
11273
+ let N = i[O.name] ?? O.value ?? (R ? [] : "");
11274
+ ["date", "datetime", "datepicker"].includes(O.type?.toLowerCase()) && N && (N = Eg(N) || N), T[O.name] = N;
11275
11275
  }), m(T);
11276
11276
  }
11277
11277
  }, [r]);
11278
- const I = (w, T, R) => {
11279
- const O = typeof T == "object" && T !== null && !Array.isArray(T) && !(T instanceof Date), N = T == null || typeof T == "string" && T.trim() === "" || Array.isArray(T) && T.length === 0 || w.type === "checkbox" && T === !1 || O && Object.keys(T).length === 0;
11278
+ const I = (w, T, O) => {
11279
+ const R = typeof T == "object" && T !== null && !Array.isArray(T) && !(T instanceof Date), N = T == null || typeof T == "string" && T.trim() === "" || Array.isArray(T) && T.length === 0 || w.type === "checkbox" && T === !1 || R && Object.keys(T).length === 0;
11280
11280
  if (w.required && N)
11281
11281
  return l && console.warn(`VALIDATION FAILED (REQUIRED): ${w.name} is empty.`), `${w.label} is required`;
11282
11282
  if (N && !w.required)
11283
11283
  return null;
11284
11284
  if (w.validate) {
11285
- const S = w.validate(T, R);
11285
+ const S = w.validate(T, O);
11286
11286
  if (S) return S;
11287
11287
  }
11288
11288
  if (w.type === "email" && T && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(T))
@@ -11295,44 +11295,44 @@ const $g = ({
11295
11295
  }
11296
11296
  return w.type === "date" && T && !ir(T).isValid() ? `${w.label} must be a valid date` : w.maxLength && T && T.length > w.maxLength ? `${w.label} must not exceed ${w.maxLength} characters` : null;
11297
11297
  }, _ = (w, T) => {
11298
- const R = r.fields.find((N) => N.name === w);
11299
- if (!R) return;
11300
- const O = { ...d };
11301
- R.type === "multiselect" || R.type === "searchselect" ? Array.isArray(T) ? O[w] = T : T && T.target && T.target.selectedOptions ? O[w] = Array.from(T.target.selectedOptions).map(
11298
+ const O = r.fields.find((N) => N.name === w);
11299
+ if (!O) return;
11300
+ const R = { ...d };
11301
+ O.type === "multiselect" || O.type === "searchselect" ? Array.isArray(T) ? R[w] = T : T && T.target && T.target.selectedOptions ? R[w] = Array.from(T.target.selectedOptions).map(
11302
11302
  (N) => N.value
11303
- ) : O[w] = T : R.type === "dateRange" ? O[w] = [
11303
+ ) : R[w] = T : O.type === "dateRange" ? R[w] = [
11304
11304
  {
11305
11305
  startDate: T.from,
11306
11306
  endDate: T.to || T.from,
11307
11307
  key: "selection"
11308
11308
  }
11309
- ] : R.type === "dayTimePicker" ? O[w] = T ? ir(T).format("YYYY-MM-DD HH:mm:ss") : "" : R.type === "number" ? O[w] = T === "" ? "" : Number(T) : O[w] = T, R.type === "select" && r.fields.forEach((N) => {
11310
- if (N.showIf && !N.showIf(O)) {
11309
+ ] : O.type === "dayTimePicker" ? R[w] = T ? ir(T).format("YYYY-MM-DD HH:mm:ss") : "" : O.type === "number" ? R[w] = T === "" ? "" : Number(T) : R[w] = T, O.type === "select" && r.fields.forEach((N) => {
11310
+ if (N.showIf && !N.showIf(R)) {
11311
11311
  const S = N.type === "multiselect" || N.type === "searchselect" || N.type === "checkbox" && N.options && N.options.length > 0;
11312
- O[N.name] = S ? [] : "";
11312
+ R[N.name] = S ? [] : "";
11313
11313
  }
11314
11314
  }), r.fields.forEach((N) => {
11315
- if (typeof N.disabled == "function" && N.disabled(O)) {
11315
+ if (typeof N.disabled == "function" && N.disabled(R)) {
11316
11316
  const S = N.type === "multiselect" || N.type === "searchselect" || N.type === "checkbox" && N.options && N.options.length > 0;
11317
- O[N.name] = S ? [] : "";
11317
+ R[N.name] = S ? [] : "";
11318
11318
  }
11319
- }), m(O);
11319
+ }), m(R);
11320
11320
  }, P = (w) => {
11321
11321
  h({ ...v, [w]: !0 });
11322
11322
  }, F = (w) => {
11323
11323
  w.preventDefault();
11324
11324
  const T = {};
11325
- r.fields.forEach((O) => {
11326
- O.name && (T[O.name] = !0);
11325
+ r.fields.forEach((R) => {
11326
+ R.name && (T[R.name] = !0);
11327
11327
  }), h(T);
11328
- const R = {};
11329
- if (r.fields.forEach((O) => {
11330
- if (O.name && (!O.showIf || O.showIf(d))) {
11331
- const N = I(O, d[O.name], d);
11332
- N && (R[O.name] = N);
11328
+ const O = {};
11329
+ if (r.fields.forEach((R) => {
11330
+ if (R.name && (!R.showIf || R.showIf(d))) {
11331
+ const N = I(R, d[R.name], d);
11332
+ N && (O[R.name] = N);
11333
11333
  }
11334
- }), p(R), Object.keys(R).length === 0) {
11335
- const O = (S, z) => {
11334
+ }), p(O), Object.keys(O).length === 0) {
11335
+ const R = (S, z) => {
11336
11336
  if (S === "" || S === null || S === void 0) return null;
11337
11337
  const Y = z?.toLowerCase();
11338
11338
  if (Array.isArray(S))
@@ -11356,7 +11356,7 @@ const $g = ({
11356
11356
  }, N = {};
11357
11357
  r.fields.forEach((S) => {
11358
11358
  if (S.name) {
11359
- const z = d[S.name], Y = S.fieldType || "string", j = O(z, Y);
11359
+ const z = d[S.name], Y = S.fieldType || "string", j = R(z, Y);
11360
11360
  o ? N[S.name] = {
11361
11361
  value: j,
11362
11362
  fieldType: Y
@@ -11380,10 +11380,10 @@ const $g = ({
11380
11380
  pink: "border-pink-500 bg-pink-50",
11381
11381
  orange: "border-orange-500 bg-orange-50"
11382
11382
  };
11383
- function H(w, T, R) {
11384
- const O = `${T.name}-error`;
11385
- if (l && (R ? console.log(
11386
- `[fieldFormat RENDER] Rendering error for ${T.name}: ${R}`
11383
+ function H(w, T, O) {
11384
+ const R = `${T.name}-error`;
11385
+ if (l && (O ? console.log(
11386
+ `[fieldFormat RENDER] Rendering error for ${T.name}: ${O}`
11387
11387
  ) : g[T.name] && console.log(
11388
11388
  `[fieldFormat RENDER] Error exists in state for ${T.name} but not passed in props!`
11389
11389
  )), E.includes(T.type))
@@ -11401,12 +11401,12 @@ const $g = ({
11401
11401
  }
11402
11402
  ),
11403
11403
  /* @__PURE__ */ u("div", { children: Te.cloneElement(w, {
11404
- "aria-describedby": R ? O : void 0,
11405
- "aria-invalid": !!R,
11404
+ "aria-describedby": O ? R : void 0,
11405
+ "aria-invalid": !!O,
11406
11406
  "aria-required": T.required
11407
11407
  }) }),
11408
11408
  T.description && /* @__PURE__ */ u("p", { className: "text-xs mt-1.5 text-gray-400", children: T.description }),
11409
- R && /* @__PURE__ */ u("p", { id: O, className: "text-sm text-red-500 mt-1", role: "alert", children: R })
11409
+ O && /* @__PURE__ */ u("p", { id: R, className: "text-sm text-red-500 mt-1", role: "alert", children: O })
11410
11410
  ] });
11411
11411
  return /* @__PURE__ */ u("div", { className: "mb-4", children: N === "card" ? /* @__PURE__ */ u("div", { className: z, children: Y }) : Y });
11412
11412
  }
@@ -11417,7 +11417,7 @@ const $g = ({
11417
11417
  const N = w.type === "multiselect" || w.type === "searchselect" || w.type === "checkbox" && w.options && w.options.length > 0;
11418
11418
  d[w.name] = w.value !== void 0 ? w.value : N ? [] : "";
11419
11419
  }
11420
- const R = g[w.name] ? g[w.name] : null, O = typeof w.disabled == "function" ? w.disabled(d) : !!w.disabled;
11420
+ const O = g[w.name] ? g[w.name] : null, R = typeof w.disabled == "function" ? w.disabled(d) : !!w.disabled;
11421
11421
  return H(
11422
11422
  /* @__PURE__ */ u(
11423
11423
  T,
@@ -11429,14 +11429,14 @@ const $g = ({
11429
11429
  setCharCounts: k,
11430
11430
  charCount: y[w.name] || 0,
11431
11431
  api_URL: t,
11432
- error: R,
11432
+ error: O,
11433
11433
  fileInputRefs: C,
11434
- disabled: O,
11434
+ disabled: R,
11435
11435
  apiClient: e
11436
11436
  }
11437
11437
  ),
11438
11438
  w,
11439
- R
11439
+ O
11440
11440
  );
11441
11441
  };
11442
11442
  return /* @__PURE__ */ D(