@overmap-ai/forms 2.1.3 → 2.1.4
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/forms.js +128 -128
- package/dist/forms.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/forms.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as o, Fragment as X, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { Card as me, LuIcon as p, Text as _, Spinner as mt, Overlay as j, preventDefault as gt, ButtonGroup as D, IconButton as A, Separator as fe, Input as P, Badge as U, Checkbox as ct, CheckboxGroup as Ft, Popover as G, Button as V, DayPicker as Xn, Menu as m, OneTimePasswordField as Nt, toast as Z, stopPropagation as Ve, RadioGroup as Ue, TextArea as Ye, Rating as Un, Heading as Us, ToggleGroup as kt, useAlertDialog as Hs } from "@overmap-ai/blocks";
|
|
3
3
|
import { cx as ze, cva as Yt } from "class-variance-authority";
|
|
4
|
-
import { forwardRef as Qt, createElement as Wt, memo as
|
|
4
|
+
import { forwardRef as Qt, createElement as Wt, memo as z, createContext as Pe, useState as B, useLayoutEffect as Zn, useContext as bt, useEffect as ue, useCallback as u, Fragment as en, use as L, useMemo as $, useRef as ke } from "react";
|
|
5
5
|
import "@xyflow/react/dist/style.css";
|
|
6
6
|
import { getBezierPath as Gs, Position as Ce, BaseEdge as Js, EdgeLabelRenderer as Ws, NodeToolbar as Ks, Handle as Hn, MarkerType as Xs, useNodesState as Zs, useEdgesState as Ys, ReactFlow as Qs, Panel as qt } from "@xyflow/react";
|
|
7
7
|
import { willCreateCycle as Yn } from "graphology-dag";
|
|
@@ -374,7 +374,7 @@ const Ma = [
|
|
|
374
374
|
const Da = [
|
|
375
375
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
376
376
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
377
|
-
], he = q("x", Da), bi =
|
|
377
|
+
], he = q("x", Da), bi = z((n) => {
|
|
378
378
|
const { ref: e, file: t, className: i, error: s, rightSlot: r, size: a, ...h } = n, d = () => s ? /* @__PURE__ */ o(X, { children: [
|
|
379
379
|
/* @__PURE__ */ l(p, { icon: Qe, color: "var(--base-a11)" }),
|
|
380
380
|
/* @__PURE__ */ l(_, { accentColor: "base", className: "truncate", size: a, children: s })
|
|
@@ -540,14 +540,14 @@ const K = Pe({}), Ci = (n) => {
|
|
|
540
540
|
URL.revokeObjectURL(i);
|
|
541
541
|
};
|
|
542
542
|
}, [n]), e;
|
|
543
|
-
}, et =
|
|
543
|
+
}, et = z((n) => {
|
|
544
544
|
const { file: e, ...t } = n, i = Ci(e);
|
|
545
545
|
return /* @__PURE__ */ l("img", { src: i ?? void 0, alt: e.name, ...t });
|
|
546
546
|
});
|
|
547
547
|
et.displayName = "ImageFile";
|
|
548
548
|
const yi = Pe(() => {
|
|
549
549
|
throw new Error("No ImageViewerProvider found");
|
|
550
|
-
}), sn = () => bt(yi), vi =
|
|
550
|
+
}), sn = () => bt(yi), vi = z((n) => {
|
|
551
551
|
const { file: e, onClose: t } = n, [i, s] = B(!1);
|
|
552
552
|
ue(() => {
|
|
553
553
|
s(!1);
|
|
@@ -578,7 +578,7 @@ const yi = Pe(() => {
|
|
|
578
578
|
] }) });
|
|
579
579
|
});
|
|
580
580
|
vi.displayName = "ImageViewer";
|
|
581
|
-
const La =
|
|
581
|
+
const La = z((n) => {
|
|
582
582
|
const { children: e } = n, [t, i] = B(null), s = u(() => {
|
|
583
583
|
i(null);
|
|
584
584
|
}, []), r = u(
|
|
@@ -595,7 +595,7 @@ const La = x((n) => {
|
|
|
595
595
|
] });
|
|
596
596
|
});
|
|
597
597
|
La.displayName = "FileViewerProvider";
|
|
598
|
-
const Y =
|
|
598
|
+
const Y = z((n) => {
|
|
599
599
|
const { label: e, error: t, description: i, required: s, children: r, inputId: a, image: h, size: d } = n, [c, f] = B(void 0), C = sn();
|
|
600
600
|
ue(() => {
|
|
601
601
|
h instanceof Promise ? h.then(f).catch(console.error) : f(h);
|
|
@@ -639,7 +639,7 @@ const _a = (n) => n.map((e) => /* @__PURE__ */ l(en, { children: e.render() }, e
|
|
|
639
639
|
onChange: s,
|
|
640
640
|
onBlur: r
|
|
641
641
|
};
|
|
642
|
-
}, Vi =
|
|
642
|
+
}, Vi = z((n) => {
|
|
643
643
|
const { field: e } = n, { size: t } = L(K), { value: i, name: s, onBlur: r, onChange: a, error: h, disabled: d } = te({ field: e }), [c, f] = B(""), [C, b] = B(""), g = u(
|
|
644
644
|
(S) => {
|
|
645
645
|
a(S), r();
|
|
@@ -658,7 +658,7 @@ const _a = (n) => n.map((e) => /* @__PURE__ */ l(en, { children: e.render() }, e
|
|
|
658
658
|
}
|
|
659
659
|
const S = c.trim();
|
|
660
660
|
g([...i, S]), f("");
|
|
661
|
-
}, [c, C, g, i]),
|
|
661
|
+
}, [c, C, g, i]), x = u(
|
|
662
662
|
(S) => {
|
|
663
663
|
S.key === "Enter" && (S.preventDefault(), w());
|
|
664
664
|
},
|
|
@@ -696,7 +696,7 @@ const _a = (n) => n.map((e) => /* @__PURE__ */ l(en, { children: e.render() }, e
|
|
|
696
696
|
{
|
|
697
697
|
value: c,
|
|
698
698
|
onChange: y,
|
|
699
|
-
onKeyDown:
|
|
699
|
+
onKeyDown: x,
|
|
700
700
|
id: e.id,
|
|
701
701
|
placeholder: e.placeholder ?? "Press enter to add a new option",
|
|
702
702
|
onBlur: F,
|
|
@@ -943,7 +943,7 @@ class pe extends T {
|
|
|
943
943
|
];
|
|
944
944
|
}
|
|
945
945
|
}
|
|
946
|
-
const xi =
|
|
946
|
+
const xi = z((n) => {
|
|
947
947
|
const { field: e } = n, { size: t } = L(K), { value: i, name: s, onBlur: r, onChange: a, error: h, disabled: d } = te({ field: e }), c = u(
|
|
948
948
|
(C) => {
|
|
949
949
|
a(!!C), r();
|
|
@@ -1044,7 +1044,7 @@ class Ie extends T {
|
|
|
1044
1044
|
return e === t;
|
|
1045
1045
|
}
|
|
1046
1046
|
}
|
|
1047
|
-
const zi =
|
|
1047
|
+
const zi = z((n) => {
|
|
1048
1048
|
const { field: e } = n, { size: t } = L(K), { value: i, name: s, onBlur: r, onChange: a, error: h, disabled: d } = te({ field: e }), c = u(
|
|
1049
1049
|
(b) => {
|
|
1050
1050
|
const g = b.target.valueAsNumber, y = isNaN(g) ? null : g;
|
|
@@ -1355,7 +1355,7 @@ class Ge extends T {
|
|
|
1355
1355
|
return e === t;
|
|
1356
1356
|
}
|
|
1357
1357
|
}
|
|
1358
|
-
const Si =
|
|
1358
|
+
const Si = z((n) => {
|
|
1359
1359
|
const { field: e } = n, { size: t } = L(K), { value: i, name: s, onBlur: r, onChange: a, error: h, disabled: d } = te({ field: e }), c = u(
|
|
1360
1360
|
(C) => {
|
|
1361
1361
|
a(C), r();
|
|
@@ -1460,7 +1460,7 @@ class ye extends pe {
|
|
|
1460
1460
|
return i.size === s.size && i.isSubsetOf(s);
|
|
1461
1461
|
}
|
|
1462
1462
|
}
|
|
1463
|
-
const Fi =
|
|
1463
|
+
const Fi = z((n) => {
|
|
1464
1464
|
const { field: e } = n, { size: t } = L(K), { value: i, name: s, onBlur: r, onChange: a, error: h, disabled: d } = te({ field: e }), [c, f] = B(!1), C = u(
|
|
1465
1465
|
(g) => {
|
|
1466
1466
|
a(g ?? null), r(), f(!1);
|
|
@@ -1584,7 +1584,7 @@ class Je extends T {
|
|
|
1584
1584
|
}
|
|
1585
1585
|
}
|
|
1586
1586
|
var M = /* @__PURE__ */ ((n) => (n.Text = "text", n.Selection = "selection", n.Numeric = "numeric", n.Temporal = "temporal", n.Capture = "capture", n.Assessment = "assessment", n.Verification = "verification", n))(M || {});
|
|
1587
|
-
const Ni =
|
|
1587
|
+
const Ni = z((n) => {
|
|
1588
1588
|
const { field: e } = n, { size: t } = L(K), { value: i, name: s, onBlur: r, onChange: a, error: h, disabled: d } = te({ field: e }), c = u(
|
|
1589
1589
|
(C) => {
|
|
1590
1590
|
a(C), r();
|
|
@@ -1722,7 +1722,7 @@ class ve extends pe {
|
|
|
1722
1722
|
return i.size === s.size && i.isSubsetOf(s);
|
|
1723
1723
|
}
|
|
1724
1724
|
}
|
|
1725
|
-
const ki =
|
|
1725
|
+
const ki = z((n) => {
|
|
1726
1726
|
const { field: e } = n, { size: t } = L(K), { value: i, name: s, onBlur: r, onChange: a, error: h, disabled: d } = te({ field: e }), c = u(
|
|
1727
1727
|
(b) => {
|
|
1728
1728
|
a(b);
|
|
@@ -1941,7 +1941,7 @@ function rn(n, e) {
|
|
|
1941
1941
|
}
|
|
1942
1942
|
const qi = Pe(() => {
|
|
1943
1943
|
throw new Error("No ImageCapturerProvider found");
|
|
1944
|
-
}), Oi = () => bt(qi), Ii =
|
|
1944
|
+
}), Oi = () => bt(qi), Ii = z((n) => {
|
|
1945
1945
|
const { onCapture: e } = n, [t, i] = B("idle"), [s, r] = B(!1), a = ke(null), h = ke(null), d = ke(null), c = u(() => {
|
|
1946
1946
|
d.current && (d.current.getTracks().forEach((g) => g.stop()), d.current = null), a.current && (a.current.srcObject = null), i("idle");
|
|
1947
1947
|
}, []), f = Gn(
|
|
@@ -1968,7 +1968,7 @@ const qi = Pe(() => {
|
|
|
1968
1968
|
const g = a.current, y = h.current;
|
|
1969
1969
|
if (!g || !y || g.videoWidth <= 0 || g.videoHeight <= 0) return;
|
|
1970
1970
|
const w = Math.min(g.clientWidth / g.videoWidth, g.clientHeight / g.videoHeight);
|
|
1971
|
-
y.style.width = `${g.videoWidth * w}px`, y.style.height = `${g.videoHeight * w}px`, y.getAnimations().forEach((
|
|
1971
|
+
y.style.width = `${g.videoWidth * w}px`, y.style.height = `${g.videoHeight * w}px`, y.getAnimations().forEach((x) => x.cancel()), y.animate([{ opacity: 0.8 }, { opacity: 0 }], {
|
|
1972
1972
|
duration: 250,
|
|
1973
1973
|
easing: "ease-out"
|
|
1974
1974
|
});
|
|
@@ -1977,8 +1977,8 @@ const qi = Pe(() => {
|
|
|
1977
1977
|
if (a.current)
|
|
1978
1978
|
try {
|
|
1979
1979
|
r(!0);
|
|
1980
|
-
const y = a.current, w = y.videoHeight,
|
|
1981
|
-
F.width = Math.round(
|
|
1980
|
+
const y = a.current, w = y.videoHeight, x = y.videoWidth, N = Math.max(x, w), I = Math.min(1, 1920 / N), F = document.createElement("canvas");
|
|
1981
|
+
F.width = Math.round(x * I), F.height = Math.round(w * I);
|
|
1982
1982
|
const S = F.getContext("2d");
|
|
1983
1983
|
if (!S) throw new Error("Could not setup canvas context.");
|
|
1984
1984
|
S.drawImage(y, 0, 0, F.width, F.height), C();
|
|
@@ -2048,7 +2048,7 @@ const qi = Pe(() => {
|
|
|
2048
2048
|
] });
|
|
2049
2049
|
});
|
|
2050
2050
|
Ii.displayName = "Camera";
|
|
2051
|
-
const Ei =
|
|
2051
|
+
const Ei = z((n) => {
|
|
2052
2052
|
const {
|
|
2053
2053
|
files: e,
|
|
2054
2054
|
onDelete: t,
|
|
@@ -2100,7 +2100,7 @@ const Ei = x((n) => {
|
|
|
2100
2100
|
] });
|
|
2101
2101
|
});
|
|
2102
2102
|
Ei.displayName = "ImagesViewer";
|
|
2103
|
-
const Ti =
|
|
2103
|
+
const Ti = z((n) => {
|
|
2104
2104
|
const {
|
|
2105
2105
|
children: e,
|
|
2106
2106
|
open: t,
|
|
@@ -2144,7 +2144,7 @@ const Ti = x((n) => {
|
|
|
2144
2144
|
] });
|
|
2145
2145
|
});
|
|
2146
2146
|
Ti.displayName = "ImageCapturer";
|
|
2147
|
-
const ja =
|
|
2147
|
+
const ja = z((n) => {
|
|
2148
2148
|
const { children: e } = n, [t, i] = B(null), s = u(() => {
|
|
2149
2149
|
i(null);
|
|
2150
2150
|
}, []), r = u(
|
|
@@ -2161,7 +2161,7 @@ const ja = x((n) => {
|
|
|
2161
2161
|
] });
|
|
2162
2162
|
});
|
|
2163
2163
|
ja.displayName = "ImageCapturerProvider";
|
|
2164
|
-
const Ai =
|
|
2164
|
+
const Ai = z((n) => {
|
|
2165
2165
|
const { ref: e, file: t, error: i, rightSlot: s, className: r, size: a, ...h } = n;
|
|
2166
2166
|
return /* @__PURE__ */ o(
|
|
2167
2167
|
me,
|
|
@@ -2187,12 +2187,12 @@ const Ai = x((n) => {
|
|
|
2187
2187
|
);
|
|
2188
2188
|
});
|
|
2189
2189
|
Ai.displayName = "ImageCard";
|
|
2190
|
-
const an =
|
|
2190
|
+
const an = z((n) => {
|
|
2191
2191
|
const { file: e, ...t } = n, i = Ci(e);
|
|
2192
2192
|
return /* @__PURE__ */ l("video", { src: i ?? void 0, ...t });
|
|
2193
2193
|
});
|
|
2194
2194
|
an.displayName = "VideoFile";
|
|
2195
|
-
const Mi =
|
|
2195
|
+
const Mi = z((n) => {
|
|
2196
2196
|
const { ref: e, file: t, className: i, error: s, rightSlot: r, size: a, ...h } = n;
|
|
2197
2197
|
return /* @__PURE__ */ o(
|
|
2198
2198
|
me,
|
|
@@ -2240,7 +2240,7 @@ const Mi = x((n) => {
|
|
|
2240
2240
|
Mi.displayName = "VideoCard";
|
|
2241
2241
|
const Ri = Pe(() => {
|
|
2242
2242
|
throw new Error("No VideoViewerProvider found");
|
|
2243
|
-
}), Ba = () => bt(Ri), Di =
|
|
2243
|
+
}), Ba = () => bt(Ri), Di = z((n) => {
|
|
2244
2244
|
const { file: e, onClose: t } = n, [i, s] = B(!1);
|
|
2245
2245
|
ue(() => {
|
|
2246
2246
|
s(!1);
|
|
@@ -2283,7 +2283,7 @@ const Ri = Pe(() => {
|
|
|
2283
2283
|
] }) });
|
|
2284
2284
|
});
|
|
2285
2285
|
Di.displayName = "VideoViewer";
|
|
2286
|
-
const Pa =
|
|
2286
|
+
const Pa = z((n) => {
|
|
2287
2287
|
const { children: e } = n, [t, i] = B(null), s = u(() => {
|
|
2288
2288
|
i(null);
|
|
2289
2289
|
}, []), r = u(
|
|
@@ -2300,7 +2300,7 @@ const Pa = x((n) => {
|
|
|
2300
2300
|
] });
|
|
2301
2301
|
});
|
|
2302
2302
|
Pa.displayName = "VideoViewerProvider";
|
|
2303
|
-
const on =
|
|
2303
|
+
const on = z((n) => {
|
|
2304
2304
|
const { fileOrPromise: e, onRemove: t, disabled: i, size: s } = n, [r, a] = B(
|
|
2305
2305
|
e instanceof Ze ? null : e
|
|
2306
2306
|
), [h, d] = B(null), c = sn(), f = Ba();
|
|
@@ -2337,7 +2337,7 @@ const on = x((n) => {
|
|
|
2337
2337
|
}));
|
|
2338
2338
|
}, [i, b, c, r]), w = u(() => {
|
|
2339
2339
|
r && f(() => ({ file: r }));
|
|
2340
|
-
}, [f, r]),
|
|
2340
|
+
}, [f, r]), x = $(
|
|
2341
2341
|
() => /* @__PURE__ */ l("div", { className: "flex grow justify-end", children: /* @__PURE__ */ o(m.Root, { modal: !0, children: [
|
|
2342
2342
|
/* @__PURE__ */ l(m.ClickTrigger, { children: /* @__PURE__ */ l(
|
|
2343
2343
|
A,
|
|
@@ -2373,7 +2373,7 @@ const on = x((n) => {
|
|
|
2373
2373
|
onClick: y,
|
|
2374
2374
|
file: r,
|
|
2375
2375
|
error: h ?? void 0,
|
|
2376
|
-
rightSlot:
|
|
2376
|
+
rightSlot: x,
|
|
2377
2377
|
size: s
|
|
2378
2378
|
}
|
|
2379
2379
|
) : I ? /* @__PURE__ */ l(
|
|
@@ -2383,7 +2383,7 @@ const on = x((n) => {
|
|
|
2383
2383
|
onClick: w,
|
|
2384
2384
|
file: r,
|
|
2385
2385
|
error: h ?? void 0,
|
|
2386
|
-
rightSlot:
|
|
2386
|
+
rightSlot: x,
|
|
2387
2387
|
size: s
|
|
2388
2388
|
}
|
|
2389
2389
|
) : /* @__PURE__ */ l(
|
|
@@ -2393,13 +2393,13 @@ const on = x((n) => {
|
|
|
2393
2393
|
file: r,
|
|
2394
2394
|
error: h ?? void 0,
|
|
2395
2395
|
onClick: g,
|
|
2396
|
-
rightSlot:
|
|
2396
|
+
rightSlot: x,
|
|
2397
2397
|
size: s
|
|
2398
2398
|
}
|
|
2399
2399
|
);
|
|
2400
2400
|
});
|
|
2401
2401
|
on.displayName = "DisplayFile";
|
|
2402
|
-
const Li =
|
|
2402
|
+
const Li = z((n) => {
|
|
2403
2403
|
const { field: e } = n, { size: t } = L(K), { value: i, name: s, onBlur: r, onChange: a, error: h, disabled: d } = te({ field: e }), c = Oi(), f = ke(null), C = u(
|
|
2404
2404
|
(O) => {
|
|
2405
2405
|
const R = e.cleanValue({
|
|
@@ -2442,7 +2442,7 @@ const Li = x((n) => {
|
|
|
2442
2442
|
r(), O();
|
|
2443
2443
|
}
|
|
2444
2444
|
}));
|
|
2445
|
-
}, [r, a, i, c]),
|
|
2445
|
+
}, [r, a, i, c]), x = u(() => {
|
|
2446
2446
|
f.current?.click();
|
|
2447
2447
|
}, []), N = u(
|
|
2448
2448
|
(O) => {
|
|
@@ -2542,7 +2542,7 @@ const Li = x((n) => {
|
|
|
2542
2542
|
/* @__PURE__ */ l(p, { icon: oi }),
|
|
2543
2543
|
"Take photos"
|
|
2544
2544
|
] }),
|
|
2545
|
-
/* @__PURE__ */ o(m.Item, { onSelect:
|
|
2545
|
+
/* @__PURE__ */ o(m.Item, { onSelect: x, children: [
|
|
2546
2546
|
/* @__PURE__ */ l(p, { icon: mi }),
|
|
2547
2547
|
"Attach files"
|
|
2548
2548
|
] })
|
|
@@ -2722,7 +2722,7 @@ class Te extends T {
|
|
|
2722
2722
|
return Ka(e, t);
|
|
2723
2723
|
}
|
|
2724
2724
|
}
|
|
2725
|
-
const $i =
|
|
2725
|
+
const $i = z((n) => {
|
|
2726
2726
|
const { field: e } = n, { size: t } = L(K), { value: i, name: s, onBlur: r, onChange: a, error: h, disabled: d } = te({ field: e }), c = u(
|
|
2727
2727
|
(b) => {
|
|
2728
2728
|
a(b), r();
|
|
@@ -2860,7 +2860,7 @@ const Xa = Yt(
|
|
|
2860
2860
|
}
|
|
2861
2861
|
}
|
|
2862
2862
|
}
|
|
2863
|
-
), ji =
|
|
2863
|
+
), ji = z((n) => {
|
|
2864
2864
|
const { field: e } = n, { size: t } = L(K), { value: i, name: s, onBlur: r, onChange: a, error: h, disabled: d } = te({ field: e }), c = u(
|
|
2865
2865
|
(b) => {
|
|
2866
2866
|
a(b), r();
|
|
@@ -3014,7 +3014,7 @@ const cn = Pe(null), Za = () => {
|
|
|
3014
3014
|
if (!n)
|
|
3015
3015
|
throw new Error("useScanner must be used within a component tree wrapped by ScannerProvider.");
|
|
3016
3016
|
return n.openScanner;
|
|
3017
|
-
}, dn =
|
|
3017
|
+
}, dn = z((n) => {
|
|
3018
3018
|
const {
|
|
3019
3019
|
children: e,
|
|
3020
3020
|
open: t,
|
|
@@ -3034,7 +3034,7 @@ const cn = Pe(null), Za = () => {
|
|
|
3034
3034
|
] });
|
|
3035
3035
|
});
|
|
3036
3036
|
dn.displayName = "Scanner";
|
|
3037
|
-
const Bi =
|
|
3037
|
+
const Bi = z((n) => {
|
|
3038
3038
|
const { paused: e, formats: t, timeBetweenDecodingAttempts: i, trySkew: s, onDecodeResult: r, onDecodeError: a, onError: h } = n, { wasmUrl: d } = Za(), { ref: c } = lr({
|
|
3039
3039
|
wasmUrl: d,
|
|
3040
3040
|
paused: e,
|
|
@@ -3059,7 +3059,7 @@ const Bi = x((n) => {
|
|
|
3059
3059
|
] });
|
|
3060
3060
|
});
|
|
3061
3061
|
Bi.displayName = "ScannerInternal";
|
|
3062
|
-
const Ya =
|
|
3062
|
+
const Ya = z((n) => {
|
|
3063
3063
|
const { children: e, wasmUrl: t } = n, [i, s] = B(null), r = u(() => {
|
|
3064
3064
|
s(null);
|
|
3065
3065
|
}, []), a = u(
|
|
@@ -3082,18 +3082,18 @@ const Ya = x((n) => {
|
|
|
3082
3082
|
] });
|
|
3083
3083
|
});
|
|
3084
3084
|
Ya.displayName = "ScannerProvider";
|
|
3085
|
-
const Pi =
|
|
3085
|
+
const Pi = z((n) => {
|
|
3086
3086
|
const { field: e } = n, { size: t } = L(K), { value: i, name: s, onBlur: r, onChange: a, error: h, disabled: d } = te({ field: e }), [c, f] = B(!1), C = u(
|
|
3087
|
-
(
|
|
3088
|
-
const N =
|
|
3087
|
+
(x) => {
|
|
3088
|
+
const N = x.target.value;
|
|
3089
3089
|
a(N);
|
|
3090
3090
|
},
|
|
3091
3091
|
[a]
|
|
3092
3092
|
), b = u(() => {
|
|
3093
3093
|
r();
|
|
3094
3094
|
}, [r]), g = u(
|
|
3095
|
-
(
|
|
3096
|
-
a(
|
|
3095
|
+
(x) => {
|
|
3096
|
+
a(x.rawValue.trim()), r(), f(!1);
|
|
3097
3097
|
},
|
|
3098
3098
|
[a, r]
|
|
3099
3099
|
), y = u(() => {
|
|
@@ -3213,7 +3213,7 @@ class We extends T {
|
|
|
3213
3213
|
return e === t;
|
|
3214
3214
|
}
|
|
3215
3215
|
}
|
|
3216
|
-
const Ui =
|
|
3216
|
+
const Ui = z((n) => {
|
|
3217
3217
|
const { field: e } = n, { size: t } = L(K), { value: i, name: s, onBlur: r, onChange: a, error: h, disabled: d } = te({ field: e }), c = u(
|
|
3218
3218
|
(b) => {
|
|
3219
3219
|
a(b ?? null), r();
|
|
@@ -3341,7 +3341,7 @@ class Re extends pe {
|
|
|
3341
3341
|
return e === t;
|
|
3342
3342
|
}
|
|
3343
3343
|
}
|
|
3344
|
-
const Hi =
|
|
3344
|
+
const Hi = z((n) => {
|
|
3345
3345
|
const { field: e } = n, { size: t } = L(K), { value: i, name: s, onBlur: r, onChange: a, error: h, disabled: d } = te({ field: e }), c = u(
|
|
3346
3346
|
(b) => {
|
|
3347
3347
|
const g = b.target.value;
|
|
@@ -3421,7 +3421,7 @@ class De extends Ge {
|
|
|
3421
3421
|
return /* @__PURE__ */ l(Hi, { field: this });
|
|
3422
3422
|
}
|
|
3423
3423
|
}
|
|
3424
|
-
const Gi =
|
|
3424
|
+
const Gi = z((n) => {
|
|
3425
3425
|
const { field: e } = n, { size: t } = L(K), { value: i, name: s, onBlur: r, onChange: a, error: h, disabled: d } = te({ field: e }), c = u(
|
|
3426
3426
|
(C) => {
|
|
3427
3427
|
const b = C.target.value;
|
|
@@ -3557,7 +3557,7 @@ const Vt = (n) => {
|
|
|
3557
3557
|
}, Fc = (n) => typeof n == "object" && (ge(n.from) || ge(n.to)), Wi = (n, e) => {
|
|
3558
3558
|
const t = _e(n), i = e.from ? _e(e.from) : null, s = e.to ? _e(e.to) : null;
|
|
3559
3559
|
return i === null && s === null ? !0 : i === null ? t <= s : s === null ? t >= i : i <= s ? t >= i && t <= s : t >= i || t <= s;
|
|
3560
|
-
}, hn =
|
|
3560
|
+
}, hn = z((n) => {
|
|
3561
3561
|
const { value: e, onChange: t, onBlur: i, disabled: s, size: r = "md", id: a, name: h, compact: d = !1 } = n, c = e ? Vt(e) : null, f = c ? `${c.hours.toString().padStart(2, "0")}:${c.minutes.toString().padStart(2, "0")}` : "", C = u(
|
|
3562
3562
|
(y) => {
|
|
3563
3563
|
const w = y.target.value;
|
|
@@ -3565,8 +3565,8 @@ const Vt = (n) => {
|
|
|
3565
3565
|
t(null);
|
|
3566
3566
|
return;
|
|
3567
3567
|
}
|
|
3568
|
-
const [
|
|
3569
|
-
t(Ne(
|
|
3568
|
+
const [x, N] = w.split(":").map(Number);
|
|
3569
|
+
t(Ne(x, N, c?.utcOffset));
|
|
3570
3570
|
},
|
|
3571
3571
|
[t, c?.utcOffset]
|
|
3572
3572
|
), b = u(
|
|
@@ -3632,7 +3632,7 @@ const Vt = (n) => {
|
|
|
3632
3632
|
] });
|
|
3633
3633
|
});
|
|
3634
3634
|
hn.displayName = "TimeFieldControl";
|
|
3635
|
-
const Ki =
|
|
3635
|
+
const Ki = z((n) => {
|
|
3636
3636
|
const { field: e } = n, { size: t } = L(K), { value: i, name: s, onBlur: r, onChange: a, error: h, disabled: d } = te({ field: e });
|
|
3637
3637
|
return /* @__PURE__ */ l(
|
|
3638
3638
|
Y,
|
|
@@ -3720,7 +3720,7 @@ class Ke extends T {
|
|
|
3720
3720
|
return e === t;
|
|
3721
3721
|
}
|
|
3722
3722
|
}
|
|
3723
|
-
const Xi =
|
|
3723
|
+
const Xi = z((n) => {
|
|
3724
3724
|
const { field: e } = n, { size: t } = L(K), { value: i, name: s, onBlur: r, onChange: a, error: h, disabled: d } = te({ field: e }), c = Oi(), f = ke(null), C = u(() => {
|
|
3725
3725
|
c((F) => ({
|
|
3726
3726
|
onConfirm: (S) => {
|
|
@@ -3994,7 +3994,7 @@ class $e extends T {
|
|
|
3994
3994
|
return e.length === t.length;
|
|
3995
3995
|
}
|
|
3996
3996
|
}
|
|
3997
|
-
const Zi =
|
|
3997
|
+
const Zi = z((n) => {
|
|
3998
3998
|
const { field: e } = n, { size: t } = L(K), { value: i, name: s, onBlur: r, onChange: a, error: h, disabled: d } = te({ field: e }), c = u(
|
|
3999
3999
|
(g) => {
|
|
4000
4000
|
const y = g.target.value;
|
|
@@ -6153,7 +6153,7 @@ const So = (n, e) => {
|
|
|
6153
6153
|
xl: ["gap-10"]
|
|
6154
6154
|
}
|
|
6155
6155
|
}
|
|
6156
|
-
}), Cs =
|
|
6156
|
+
}), Cs = z((n) => {
|
|
6157
6157
|
const { fieldSection: e } = n, { label: t, description: i } = e, s = Qn(), { fieldSchema: r, size: a } = L(K), h = $(() => r.getFieldSections(), [r]), d = $(() => h.findIndex(({ id: b }) => b === e.id), [h, e.id]), c = $(() => h.filter((b) => e.id in b.conditions), [h, e.id]), f = $(() => c.length === 0 ? !0 : c.some((b) => {
|
|
6158
6158
|
const g = b.getConditions(e.id);
|
|
6159
6159
|
return In(g, s);
|
|
@@ -6362,7 +6362,7 @@ const be = Pe({}), ne = (n, e, t) => u(
|
|
|
6362
6362
|
t(n, d);
|
|
6363
6363
|
},
|
|
6364
6364
|
[n, e, t]
|
|
6365
|
-
), ys =
|
|
6365
|
+
), ys = z, xe = ys(function(n) {
|
|
6366
6366
|
const { ref: e, children: t, ...i } = n, s = u(
|
|
6367
6367
|
(r) => typeof t == "function" ? /* @__PURE__ */ o(X, { children: [
|
|
6368
6368
|
t(r),
|
|
@@ -6386,7 +6386,7 @@ const be = Pe({}), ne = (n, e, t) => u(
|
|
|
6386
6386
|
[t]
|
|
6387
6387
|
);
|
|
6388
6388
|
return /* @__PURE__ */ l(m.MultiSelectItem, { ref: e, ...i, children: s });
|
|
6389
|
-
}), _n =
|
|
6389
|
+
}), _n = z((n) => {
|
|
6390
6390
|
const { ref: e, children: t, ...i } = n, s = u(
|
|
6391
6391
|
(r) => typeof t == "function" ? /* @__PURE__ */ o(X, { children: [
|
|
6392
6392
|
t(r),
|
|
@@ -6400,7 +6400,7 @@ const be = Pe({}), ne = (n, e, t) => u(
|
|
|
6400
6400
|
return /* @__PURE__ */ l(m.SelectAllItem, { ref: e, ...i, children: s });
|
|
6401
6401
|
});
|
|
6402
6402
|
_n.displayName = "SelectAllItemTemplate";
|
|
6403
|
-
const Zt =
|
|
6403
|
+
const Zt = z((n) => {
|
|
6404
6404
|
const { children: e, open: t, onOpenChange: i, defaultOpen: s, modal: r, size: a, align: h, accentColor: d = "base", ...c } = n;
|
|
6405
6405
|
return /* @__PURE__ */ o(G.Root, { open: t, onOpenChange: i, defaultOpen: s, modal: r, children: [
|
|
6406
6406
|
/* @__PURE__ */ l(G.Trigger, { asChild: !0, children: e }),
|
|
@@ -6408,7 +6408,7 @@ const Zt = x((n) => {
|
|
|
6408
6408
|
] });
|
|
6409
6409
|
});
|
|
6410
6410
|
Zt.displayName = "DayPickerPopover";
|
|
6411
|
-
const Vs =
|
|
6411
|
+
const Vs = z((n) => {
|
|
6412
6412
|
const {
|
|
6413
6413
|
children: e,
|
|
6414
6414
|
open: t,
|
|
@@ -6428,7 +6428,7 @@ const Vs = x((n) => {
|
|
|
6428
6428
|
I.key === "Enter" && (I.preventDefault(), I.stopPropagation(), c([...d, b]), g(""));
|
|
6429
6429
|
},
|
|
6430
6430
|
[b, c, d]
|
|
6431
|
-
),
|
|
6431
|
+
), x = u(() => {
|
|
6432
6432
|
c([...d, b]), g("");
|
|
6433
6433
|
}, [b, c, d]), N = u(
|
|
6434
6434
|
(I) => {
|
|
@@ -6458,7 +6458,7 @@ const Vs = x((n) => {
|
|
|
6458
6458
|
accentColor: "base",
|
|
6459
6459
|
variant: "soft",
|
|
6460
6460
|
type: "button",
|
|
6461
|
-
onClick:
|
|
6461
|
+
onClick: x,
|
|
6462
6462
|
children: /* @__PURE__ */ l(p, { icon: ce })
|
|
6463
6463
|
}
|
|
6464
6464
|
)
|
|
@@ -6493,7 +6493,7 @@ const Vs = x((n) => {
|
|
|
6493
6493
|
] });
|
|
6494
6494
|
});
|
|
6495
6495
|
Vs.displayName = "NumberInputPopover";
|
|
6496
|
-
const je =
|
|
6496
|
+
const je = z((n) => {
|
|
6497
6497
|
const {
|
|
6498
6498
|
children: e,
|
|
6499
6499
|
open: t,
|
|
@@ -6510,12 +6510,12 @@ const je = x((n) => {
|
|
|
6510
6510
|
ue(() => {
|
|
6511
6511
|
d !== void 0 && g(d);
|
|
6512
6512
|
}, [d]);
|
|
6513
|
-
const y = u((
|
|
6514
|
-
const N =
|
|
6513
|
+
const y = u((x) => {
|
|
6514
|
+
const N = x.target.valueAsNumber;
|
|
6515
6515
|
g(isNaN(N) ? null : N);
|
|
6516
6516
|
}, []), w = u(
|
|
6517
|
-
(
|
|
6518
|
-
const N =
|
|
6517
|
+
(x) => {
|
|
6518
|
+
const N = x.target.valueAsNumber;
|
|
6519
6519
|
c?.(isNaN(N) ? null : N);
|
|
6520
6520
|
},
|
|
6521
6521
|
[c]
|
|
@@ -6542,7 +6542,7 @@ const ee = (n) => {
|
|
|
6542
6542
|
return /* @__PURE__ */ l(A, { onClick: s, ...i, children: /* @__PURE__ */ l(p, { icon: he }) });
|
|
6543
6543
|
};
|
|
6544
6544
|
ee.displayName = "RemoveConditionButton";
|
|
6545
|
-
const rt =
|
|
6545
|
+
const rt = z((n) => {
|
|
6546
6546
|
const { ref: e, selectFieldOptions: t, ...i } = n, s = $(() => Oe(t), [t]);
|
|
6547
6547
|
return /* @__PURE__ */ o(m.MultiSelectGroup, { ref: e, ...i, children: [
|
|
6548
6548
|
/* @__PURE__ */ l(_n, { children: "Select all" }),
|
|
@@ -6550,12 +6550,12 @@ const rt = x((n) => {
|
|
|
6550
6550
|
] });
|
|
6551
6551
|
});
|
|
6552
6552
|
rt.displayName = "SelectFieldOptionMultiSelectGroup";
|
|
6553
|
-
const $n =
|
|
6553
|
+
const $n = z((n) => {
|
|
6554
6554
|
const { ref: e, selectFieldOptions: t, ...i } = n, s = $(() => Oe(t), [t]);
|
|
6555
6555
|
return /* @__PURE__ */ l(m.SelectGroup, { ref: e, ...i, children: s.map((r) => /* @__PURE__ */ l(xe, { value: r.value, children: /* @__PURE__ */ l("span", { className: "truncate", children: r.label }) }, r.value)) });
|
|
6556
6556
|
});
|
|
6557
6557
|
$n.displayName = "SelectFieldOptionSelectGroup";
|
|
6558
|
-
const tt =
|
|
6558
|
+
const tt = z((n) => {
|
|
6559
6559
|
const {
|
|
6560
6560
|
children: e,
|
|
6561
6561
|
open: t,
|
|
@@ -6568,11 +6568,11 @@ const tt = x((n) => {
|
|
|
6568
6568
|
onValueChange: c,
|
|
6569
6569
|
placeholder: f = "Enter text",
|
|
6570
6570
|
...C
|
|
6571
|
-
} = n, [b, g] = B(""), y = u((
|
|
6572
|
-
g(
|
|
6571
|
+
} = n, [b, g] = B(""), y = u((x) => {
|
|
6572
|
+
g(x.target.value);
|
|
6573
6573
|
}, []), w = u(
|
|
6574
|
-
(
|
|
6575
|
-
const N =
|
|
6574
|
+
(x) => {
|
|
6575
|
+
const N = x.target.value;
|
|
6576
6576
|
c?.(N);
|
|
6577
6577
|
},
|
|
6578
6578
|
[c]
|
|
@@ -6594,7 +6594,7 @@ const tt = x((n) => {
|
|
|
6594
6594
|
] });
|
|
6595
6595
|
});
|
|
6596
6596
|
tt.displayName = "TextInputPopover";
|
|
6597
|
-
const ot =
|
|
6597
|
+
const ot = z((n) => {
|
|
6598
6598
|
const {
|
|
6599
6599
|
children: e,
|
|
6600
6600
|
open: t,
|
|
@@ -6712,7 +6712,7 @@ const ie = (n) => {
|
|
|
6712
6712
|
r(),
|
|
6713
6713
|
/* @__PURE__ */ l(ee, { condition: e, onClick: i })
|
|
6714
6714
|
] });
|
|
6715
|
-
}, zt =
|
|
6715
|
+
}, zt = z((n) => {
|
|
6716
6716
|
const { children: e, variant: t, size: i, accentColor: s, onSelectFieldType: r, ...a } = n, h = $(() => {
|
|
6717
6717
|
const d = {
|
|
6718
6718
|
[M.Assessment]: [],
|
|
@@ -6748,7 +6748,7 @@ const ie = (n) => {
|
|
|
6748
6748
|
] });
|
|
6749
6749
|
});
|
|
6750
6750
|
zt.displayName = "CreateFieldDropdownMenu";
|
|
6751
|
-
const ws =
|
|
6751
|
+
const ws = z((n) => {
|
|
6752
6752
|
const { fieldType: e, onSelectFieldType: t } = n, i = u(() => {
|
|
6753
6753
|
t(e);
|
|
6754
6754
|
}, [e, t]), { icon: s, name: r } = J[e];
|
|
@@ -6999,7 +6999,7 @@ const jn = (n) => {
|
|
|
6999
6999
|
default:
|
|
7000
7000
|
return;
|
|
7001
7001
|
}
|
|
7002
|
-
}, zs =
|
|
7002
|
+
}, zs = z((n) => {
|
|
7003
7003
|
const { popoverInputs: e, ...t } = n;
|
|
7004
7004
|
return /* @__PURE__ */ o(G.Root, { children: [
|
|
7005
7005
|
/* @__PURE__ */ l(G.Trigger, { asChild: !0, children: /* @__PURE__ */ o(V, { variant: "soft", type: "button", size: "sm", accentColor: "base", children: [
|
|
@@ -7010,7 +7010,7 @@ const jn = (n) => {
|
|
|
7010
7010
|
] });
|
|
7011
7011
|
});
|
|
7012
7012
|
zs.displayName = "FieldSettingsPopover";
|
|
7013
|
-
const Ss =
|
|
7013
|
+
const Ss = z((n) => {
|
|
7014
7014
|
const { parentPath: e, fieldIndex: t, field: i } = n, s = sn(), { disableRequiredFields: r } = L(be), [a, h] = B(void 0);
|
|
7015
7015
|
li(
|
|
7016
7016
|
(S) => {
|
|
@@ -7044,7 +7044,7 @@ const Ss = x((n) => {
|
|
|
7044
7044
|
i.setOptions({ required: !!S });
|
|
7045
7045
|
},
|
|
7046
7046
|
[i]
|
|
7047
|
-
),
|
|
7047
|
+
), x = u(
|
|
7048
7048
|
(S) => {
|
|
7049
7049
|
i.setOptions({ label: S.target.value });
|
|
7050
7050
|
},
|
|
@@ -7106,7 +7106,7 @@ const Ss = x((n) => {
|
|
|
7106
7106
|
{
|
|
7107
7107
|
placeholder: "Enter your question",
|
|
7108
7108
|
value: i.label ?? "",
|
|
7109
|
-
onChange:
|
|
7109
|
+
onChange: x,
|
|
7110
7110
|
maxLength: 200
|
|
7111
7111
|
}
|
|
7112
7112
|
) }),
|
|
@@ -7127,29 +7127,29 @@ const Ss = x((n) => {
|
|
|
7127
7127
|
] });
|
|
7128
7128
|
});
|
|
7129
7129
|
Ss.displayName = "FieldBuilder";
|
|
7130
|
-
const Bn =
|
|
7130
|
+
const Bn = z((n) => {
|
|
7131
7131
|
const { field: e, fieldSection: t, fieldIndex: i, sectionIndex: s } = n, r = ke(null), a = `fields.${s}.fields`, h = u(
|
|
7132
|
-
(
|
|
7133
|
-
t.addField(jn(
|
|
7132
|
+
(x) => {
|
|
7133
|
+
t.addField(jn(x), i + 1);
|
|
7134
7134
|
},
|
|
7135
7135
|
[i, t]
|
|
7136
7136
|
), d = u(async () => {
|
|
7137
7137
|
try {
|
|
7138
7138
|
await navigator.clipboard.writeText(e.id), Z.success({ title: "ID copied" });
|
|
7139
|
-
} catch {
|
|
7140
|
-
Z.
|
|
7139
|
+
} catch (x) {
|
|
7140
|
+
Z.error({ title: "Failed to copy ID", description: x instanceof Error ? x.message : void 0 });
|
|
7141
7141
|
}
|
|
7142
7142
|
}, [e.id]), c = u(() => {
|
|
7143
7143
|
t.addField(e.duplicate(k()));
|
|
7144
7144
|
}, [e, t]), f = u(
|
|
7145
|
-
(
|
|
7146
|
-
const N =
|
|
7145
|
+
(x) => {
|
|
7146
|
+
const N = x === "up" ? i - 1 : i + 1;
|
|
7147
7147
|
t.moveField(i, N);
|
|
7148
7148
|
},
|
|
7149
7149
|
[t, i]
|
|
7150
7150
|
), C = u(
|
|
7151
|
-
(
|
|
7152
|
-
const { files: N } =
|
|
7151
|
+
(x) => {
|
|
7152
|
+
const { files: N } = x.target;
|
|
7153
7153
|
if (!N || N.length !== 1) return;
|
|
7154
7154
|
const I = N.item(0);
|
|
7155
7155
|
I && e.setOptions({
|
|
@@ -7208,7 +7208,7 @@ const Bn = x((n) => {
|
|
|
7208
7208
|
] });
|
|
7209
7209
|
});
|
|
7210
7210
|
Bn.displayName = "FieldBuilderWithActions";
|
|
7211
|
-
const Pn =
|
|
7211
|
+
const Pn = z((n) => {
|
|
7212
7212
|
const { children: e, variant: t, size: i, accentColor: s, fields: r, onSelectField: a, onSelectAllFields: h, ...d } = n, c = u(() => {
|
|
7213
7213
|
h?.(r);
|
|
7214
7214
|
}, [h, r]);
|
|
@@ -7221,7 +7221,7 @@ const Pn = x((n) => {
|
|
|
7221
7221
|
] });
|
|
7222
7222
|
});
|
|
7223
7223
|
Pn.displayName = "FieldDropdownMenu";
|
|
7224
|
-
const Fs =
|
|
7224
|
+
const Fs = z((n) => {
|
|
7225
7225
|
const { field: e, onSelectField: t } = n, i = u(() => {
|
|
7226
7226
|
t(e);
|
|
7227
7227
|
}, [e, t]);
|
|
@@ -7231,7 +7231,7 @@ const Fs = x((n) => {
|
|
|
7231
7231
|
] });
|
|
7232
7232
|
});
|
|
7233
7233
|
Fs.displayName = "FieldDropdownMenuItem";
|
|
7234
|
-
const Ns =
|
|
7234
|
+
const Ns = z((n) => {
|
|
7235
7235
|
const { children: e, variant: t, size: i, accentColor: s, fieldSections: r, onSelectFieldSection: a, ...h } = n;
|
|
7236
7236
|
return /* @__PURE__ */ o(m.Root, { ...h, children: [
|
|
7237
7237
|
/* @__PURE__ */ l(m.ClickTrigger, { children: e }),
|
|
@@ -7246,7 +7246,7 @@ const Ns = x((n) => {
|
|
|
7246
7246
|
] });
|
|
7247
7247
|
});
|
|
7248
7248
|
Ns.displayName = "FieldSectionDropdownMenu";
|
|
7249
|
-
const ks =
|
|
7249
|
+
const ks = z((n) => {
|
|
7250
7250
|
const { fieldSection: e, onSelectFieldSection: t } = n, i = u(() => {
|
|
7251
7251
|
t(e);
|
|
7252
7252
|
}, [e, t]);
|
|
@@ -7980,7 +7980,7 @@ const Ro = (n) => {
|
|
|
7980
7980
|
] })
|
|
7981
7981
|
] })
|
|
7982
7982
|
] });
|
|
7983
|
-
}, Es =
|
|
7983
|
+
}, Es = z((n) => {
|
|
7984
7984
|
const { id: e, sourceX: t, sourceY: i, targetX: s, targetY: r, style: a, markerEnd: h, data: d } = n, { targetSection: c, sourceSection: f, layoutDirection: C } = d, b = f.getConditions(c.id), g = u(
|
|
7985
7985
|
(S, E) => {
|
|
7986
7986
|
f.replaceCondition(c.id, S, E);
|
|
@@ -7996,7 +7996,7 @@ const Ro = (n) => {
|
|
|
7996
7996
|
f.removeCondition(c.id, S);
|
|
7997
7997
|
},
|
|
7998
7998
|
[f, c.id]
|
|
7999
|
-
),
|
|
7999
|
+
), x = u(() => {
|
|
8000
8000
|
f.removeConditional(c.id);
|
|
8001
8001
|
}, [f, c.id]), [N, I, F] = Gs({
|
|
8002
8002
|
sourceX: t,
|
|
@@ -8029,7 +8029,7 @@ const Ro = (n) => {
|
|
|
8029
8029
|
size: "sm",
|
|
8030
8030
|
variant: "ghost",
|
|
8031
8031
|
accentColor: "base",
|
|
8032
|
-
onClick:
|
|
8032
|
+
onClick: x,
|
|
8033
8033
|
children: /* @__PURE__ */ l(p, { icon: Se })
|
|
8034
8034
|
}
|
|
8035
8035
|
)
|
|
@@ -8050,7 +8050,7 @@ const Ro = (n) => {
|
|
|
8050
8050
|
] });
|
|
8051
8051
|
});
|
|
8052
8052
|
Es.displayName = "FieldSectionConditionEdgeComponent";
|
|
8053
|
-
const Ts =
|
|
8053
|
+
const Ts = z((n) => {
|
|
8054
8054
|
const { data: e, selected: t } = n, { fieldSection: i, index: s, layoutDirection: r } = e, { fieldSchema: a } = L(be), h = u(() => {
|
|
8055
8055
|
a.removeFieldSection(i);
|
|
8056
8056
|
}, [a, i]), d = u(
|
|
@@ -8187,7 +8187,7 @@ const Qo = {
|
|
|
8187
8187
|
];
|
|
8188
8188
|
}, nc = {
|
|
8189
8189
|
hideAttribution: !0
|
|
8190
|
-
}, As =
|
|
8190
|
+
}, As = z(() => {
|
|
8191
8191
|
const { errors: n } = ei(), { handleSubmit: e } = ti(), { onSave: t, onCancel: i } = L(be), { fieldSchema: s } = L(be), r = ke(null), [a, h] = B(), [d, c] = B("TB");
|
|
8192
8192
|
Zn(() => {
|
|
8193
8193
|
r.current && r.current.classList.remove("light");
|
|
@@ -8228,12 +8228,12 @@ const Qo = {
|
|
|
8228
8228
|
});
|
|
8229
8229
|
}
|
|
8230
8230
|
return H;
|
|
8231
|
-
}, [s.fieldSections, d]), [b, g, y] = Zs(f), [w,
|
|
8231
|
+
}, [s.fieldSections, d]), [b, g, y] = Zs(f), [w, x, N] = Ys(C);
|
|
8232
8232
|
ue(() => {
|
|
8233
8233
|
g(f);
|
|
8234
8234
|
}, [f, g]), ue(() => {
|
|
8235
|
-
|
|
8236
|
-
}, [C,
|
|
8235
|
+
x(C);
|
|
8236
|
+
}, [C, x]);
|
|
8237
8237
|
const [I, F] = $(() => tc(b, w, d), [w, d, b]), S = u(() => {
|
|
8238
8238
|
s.addFieldSection(new oe({ id: k(), fields: [] }));
|
|
8239
8239
|
}, [s]), E = u(
|
|
@@ -8546,7 +8546,7 @@ class Be extends vt {
|
|
|
8546
8546
|
return zo(this.getFields(), e, t);
|
|
8547
8547
|
}
|
|
8548
8548
|
}
|
|
8549
|
-
const Rs =
|
|
8549
|
+
const Rs = z((n) => {
|
|
8550
8550
|
const { sourceFieldSection: e, targetFieldSection: t } = n, i = e.getConditions(t.id), s = u(
|
|
8551
8551
|
(d, c) => {
|
|
8552
8552
|
e.replaceCondition(t.id, d, c);
|
|
@@ -8597,7 +8597,7 @@ const Rs = x((n) => {
|
|
|
8597
8597
|
] });
|
|
8598
8598
|
});
|
|
8599
8599
|
Rs.displayName = "FieldSectionConditionalItem";
|
|
8600
|
-
const Ds =
|
|
8600
|
+
const Ds = z((n) => {
|
|
8601
8601
|
const { fieldSection: e } = n, { fieldSchema: t } = L(be), i = $(() => t.fieldSections.filter((d) => e.id in d.conditions), [t.fieldSections, e.id]), s = u(
|
|
8602
8602
|
(d) => {
|
|
8603
8603
|
d.addConditional(e.id);
|
|
@@ -8675,13 +8675,13 @@ const Ds = x((n) => {
|
|
|
8675
8675
|
] });
|
|
8676
8676
|
});
|
|
8677
8677
|
Ds.displayName = "FieldSectionBuilder";
|
|
8678
|
-
const Ls =
|
|
8678
|
+
const Ls = z((n) => {
|
|
8679
8679
|
const { fieldSection: e, sectionIndex: t } = n, { fieldSchema: i } = L(be), s = Hs(), r = u(() => {
|
|
8680
8680
|
i.removeFieldSection(e);
|
|
8681
8681
|
}, [i, e]), a = u(
|
|
8682
8682
|
(w) => {
|
|
8683
|
-
const
|
|
8684
|
-
i.moveFieldSection(t,
|
|
8683
|
+
const x = w === "up" ? t - 1 : t + 1;
|
|
8684
|
+
i.moveFieldSection(t, x);
|
|
8685
8685
|
},
|
|
8686
8686
|
[i, t]
|
|
8687
8687
|
), h = u(() => {
|
|
@@ -8696,18 +8696,18 @@ const Ls = x((n) => {
|
|
|
8696
8696
|
}, [a]), f = u(() => {
|
|
8697
8697
|
a("down");
|
|
8698
8698
|
}, [a]), C = u(async () => {
|
|
8699
|
-
const w = [e.serialize()],
|
|
8699
|
+
const w = [e.serialize()], x = Be.reseedFieldSections(w, {
|
|
8700
8700
|
conditions: !1
|
|
8701
|
-
}), N = JSON.stringify(
|
|
8701
|
+
}), N = JSON.stringify(x);
|
|
8702
8702
|
await navigator.clipboard.writeText(N), Z.success({ title: "Section copied" });
|
|
8703
8703
|
}, [e]), b = u(async () => {
|
|
8704
|
-
const
|
|
8704
|
+
const x = i.getDependenciesOfSection(e.id).map((F) => F.serialize()), N = Be.reseedFieldSections(x, {
|
|
8705
8705
|
conditions: !0
|
|
8706
8706
|
}), I = JSON.stringify(N);
|
|
8707
8707
|
await navigator.clipboard.writeText(I), Z.success({ title: "Section copied" });
|
|
8708
8708
|
}, [e, i]), g = u(async () => {
|
|
8709
|
-
const w = i.getDependenciesOfSection(e.id),
|
|
8710
|
-
|
|
8709
|
+
const w = i.getDependenciesOfSection(e.id), x = w.length > 1, N = w.length - 1;
|
|
8710
|
+
x ? s({
|
|
8711
8711
|
title: "Copy section dependencies?",
|
|
8712
8712
|
description: `This section has ${N} dependent section${N > 1 ? "s" : ""} that will also be copied to maintain the conditions. Do you want to include these dependencies?`,
|
|
8713
8713
|
action: "Include",
|
|
@@ -8723,13 +8723,13 @@ const Ls = x((n) => {
|
|
|
8723
8723
|
Z.error({ title: "Paste failed", description: "Unable to read clipboard contents." });
|
|
8724
8724
|
return;
|
|
8725
8725
|
}
|
|
8726
|
-
const
|
|
8727
|
-
if (!
|
|
8726
|
+
const x = w.trim();
|
|
8727
|
+
if (!x) {
|
|
8728
8728
|
Z.error({ title: "Paste failed", description: "Clipboard is empty." });
|
|
8729
8729
|
return;
|
|
8730
8730
|
}
|
|
8731
8731
|
try {
|
|
8732
|
-
const N = JSON.parse(
|
|
8732
|
+
const N = JSON.parse(x), I = si.array().parse(N), F = Rn(I);
|
|
8733
8733
|
if (F.length === 0) {
|
|
8734
8734
|
Z.error({ title: "Paste failed", description: "No valid sections found in the JSON." });
|
|
8735
8735
|
return;
|
|
@@ -8752,12 +8752,12 @@ const Ls = x((n) => {
|
|
|
8752
8752
|
" Add field"
|
|
8753
8753
|
] }) })
|
|
8754
8754
|
] }),
|
|
8755
|
-
e.fields.map((w,
|
|
8755
|
+
e.fields.map((w, x) => /* @__PURE__ */ l(
|
|
8756
8756
|
Bn,
|
|
8757
8757
|
{
|
|
8758
8758
|
field: w,
|
|
8759
8759
|
fieldSection: e,
|
|
8760
|
-
fieldIndex:
|
|
8760
|
+
fieldIndex: x,
|
|
8761
8761
|
sectionIndex: t
|
|
8762
8762
|
},
|
|
8763
8763
|
w.id
|
|
@@ -8811,7 +8811,7 @@ const Ls = x((n) => {
|
|
|
8811
8811
|
] });
|
|
8812
8812
|
});
|
|
8813
8813
|
Ls.displayName = "FieldSectionWithActions";
|
|
8814
|
-
const _s =
|
|
8814
|
+
const _s = z(() => {
|
|
8815
8815
|
const { handleSubmit: n } = ti(), { errors: e } = ei(), { onSave: t, onCancel: i } = L(be), { fieldSchema: s } = L(be), r = u(() => {
|
|
8816
8816
|
s.addFieldSection(new oe({ id: k(), fields: [] }));
|
|
8817
8817
|
}, [s]), a = u(async () => {
|
|
@@ -8896,7 +8896,7 @@ function $s(n) {
|
|
|
8896
8896
|
};
|
|
8897
8897
|
return e(n);
|
|
8898
8898
|
}
|
|
8899
|
-
const sc =
|
|
8899
|
+
const sc = z(
|
|
8900
8900
|
Qt((n, e) => {
|
|
8901
8901
|
const {
|
|
8902
8902
|
disabled: t = !1,
|
|
@@ -8913,7 +8913,7 @@ const sc = x(
|
|
|
8913
8913
|
submitButtonProps: g,
|
|
8914
8914
|
cancelButtonProps: y,
|
|
8915
8915
|
cancelIcon: w,
|
|
8916
|
-
submitIcon:
|
|
8916
|
+
submitIcon: x,
|
|
8917
8917
|
size: N = "md"
|
|
8918
8918
|
} = n, I = $(() => i.initializeValues(s), [i, s]), F = u(
|
|
8919
8919
|
(H) => {
|
|
@@ -8987,7 +8987,7 @@ const sc = x(
|
|
|
8987
8987
|
variant: "surface",
|
|
8988
8988
|
...g,
|
|
8989
8989
|
children: [
|
|
8990
|
-
/* @__PURE__ */ l(p, { icon:
|
|
8990
|
+
/* @__PURE__ */ l(p, { icon: x ?? re }),
|
|
8991
8991
|
h
|
|
8992
8992
|
]
|
|
8993
8993
|
}
|
|
@@ -8997,27 +8997,27 @@ const sc = x(
|
|
|
8997
8997
|
}
|
|
8998
8998
|
) }) });
|
|
8999
8999
|
})
|
|
9000
|
-
), js =
|
|
9000
|
+
), js = z(() => {
|
|
9001
9001
|
const { fieldSchema: n } = L(be);
|
|
9002
9002
|
return /* @__PURE__ */ l(sc, { fieldSchema: n, disabled: !1 });
|
|
9003
9003
|
});
|
|
9004
9004
|
js.displayName = "FormBuilderPreview";
|
|
9005
|
-
const Bs =
|
|
9005
|
+
const Bs = z((n) => {
|
|
9006
9006
|
const { children: e, initialFields: t, onSave: i, onCancel: s, disableRequiredFields: r = !1 } = n, a = u((y) => {
|
|
9007
9007
|
const w = {};
|
|
9008
9008
|
(!y.fields || y.fields.length === 0) && (w.fields = "At least one field is required.");
|
|
9009
|
-
const
|
|
9009
|
+
const x = [];
|
|
9010
9010
|
for (const [F, S] of y.fields.entries())
|
|
9011
9011
|
for (const [E, O] of S.fields.entries()) {
|
|
9012
9012
|
const R = xs(O.type, `fields.${F}.fields.${E}`)?.map(
|
|
9013
9013
|
({ field: W }) => W
|
|
9014
9014
|
) ?? [];
|
|
9015
|
-
|
|
9015
|
+
x.push(...R);
|
|
9016
9016
|
}
|
|
9017
9017
|
const N = {};
|
|
9018
|
-
for (const F of
|
|
9018
|
+
for (const F of x)
|
|
9019
9019
|
N[F.id] = ri(y, F.id);
|
|
9020
|
-
const I = Ms(
|
|
9020
|
+
const I = Ms(x, N);
|
|
9021
9021
|
return Object.keys(I).length > 0 && (w.fields = I.fields), Object.keys(w).length > 0 && Z.error({
|
|
9022
9022
|
title: "Some form settings are invalid",
|
|
9023
9023
|
description: "Please check settings highlighted in red."
|
|
@@ -9033,10 +9033,10 @@ const Bs = x((n) => {
|
|
|
9033
9033
|
criteriaMode: "all",
|
|
9034
9034
|
reValidateMode: "onSubmit",
|
|
9035
9035
|
resolver: (y) => {
|
|
9036
|
-
const w = a(y),
|
|
9036
|
+
const w = a(y), x = $s(w);
|
|
9037
9037
|
return Object.keys(w).length > 0 ? {
|
|
9038
9038
|
values: {},
|
|
9039
|
-
errors:
|
|
9039
|
+
errors: x
|
|
9040
9040
|
} : {
|
|
9041
9041
|
values: y,
|
|
9042
9042
|
errors: {}
|