@overmap-ai/forms 1.0.17-radio-field.19 → 1.0.18
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/form/builder/constants.d.ts +1 -1
- package/dist/form/builder/utils.d.ts +1 -1
- package/dist/form/fields/ScanField/ScanField.d.ts +21 -0
- package/dist/form/fields/ScanField/ScanInput.d.ts +8 -0
- package/dist/form/fields/ScanField/index.d.ts +3 -0
- package/dist/form/fields/{QrField → ScanField}/typings.d.ts +1 -1
- package/dist/form/fields/constants.d.ts +2 -2
- package/dist/form/fields/index.d.ts +1 -1
- package/dist/form/fields/typings.d.ts +2 -2
- package/dist/forms.js +1113 -1108
- package/dist/forms.umd.cjs +19 -19
- package/package.json +5 -5
- package/dist/form/fields/QrField/QrField.d.ts +0 -21
- package/dist/form/fields/QrField/QrInput.d.ts +0 -8
- package/dist/form/fields/QrField/index.d.ts +0 -3
package/dist/forms.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
var dr = Object.defineProperty;
|
|
2
2
|
var ur = (t, n, e) => n in t ? dr(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
|
|
3
3
|
var I = (t, n, e) => ur(t, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
-
import { jsx as l, jsxs as
|
|
5
|
-
import { RiIcon as L, Text as
|
|
4
|
+
import { jsx as l, jsxs as E, Fragment as pe } from "react/jsx-runtime";
|
|
5
|
+
import { RiIcon as L, Text as ae, Spinner as Wn, useToast as Ge, ButtonGroup as Kt, Tooltip as Ee, IconButton as J, Separator as jn, Input as ee, Badge as Ot, Checkbox as at, Popover as Be, Button as G, DayPicker as fr, Menu as B, RadioGroup as It, TextArea as qn, Card as Ke, Heading as Hn, HoverCard as St, useAlertDialog as mr, Tabs as Ie } from "@overmap-ai/blocks";
|
|
6
6
|
import { cx as je } from "class-variance-authority";
|
|
7
7
|
import * as h from "react";
|
|
8
|
-
import { memo as P, useMemo as O, forwardRef as
|
|
9
|
-
import { useField as
|
|
10
|
-
import { RiListCheck as vr, RiCheckboxCircleLine as yr, RiCalendarLine as br, RiCheckboxLine as xr, RiHashtag as wr,
|
|
11
|
-
import { DragDropContext as Xn, Droppable as
|
|
12
|
-
import
|
|
8
|
+
import { memo as P, useMemo as O, forwardRef as Xe, useCallback as R, createContext as Gn, useContext as hr, useState as K, useRef as bt, useEffect as H, Fragment as Kn, useId as pr, use as Xt, useReducer as gr } from "react";
|
|
9
|
+
import { useField as Yt, useFormikContext as xe, useFormik as Jt, FormikProvider as Zt } from "formik";
|
|
10
|
+
import { RiListCheck as vr, RiCheckboxCircleLine as yr, RiCalendarLine as br, RiCheckboxLine as xr, RiHashtag as wr, RiRadioButtonFill as Cr, RiFullscreenLine as Er, RiMenuFoldLine as Ir, RiInputField as Sr, RiAlignJustify as Nr, RiUpload2Line as Tr, RiFileCopyLine as Rr, RiDeleteBin7Fill as Fr, RiImageLine as Lr, RiArrowDownLine as Dr, RiArrowUpLine as Ar } from "react-icons/ri";
|
|
11
|
+
import { DragDropContext as Xn, Droppable as Qt, Draggable as en } from "@hello-pangea/dnd";
|
|
12
|
+
import se from "lodash.get";
|
|
13
13
|
import * as Pr from "react-dom";
|
|
14
14
|
import Or from "react-dom";
|
|
15
15
|
import { saveAs as Yn } from "file-saver";
|
|
16
|
-
import Mr from "
|
|
16
|
+
import { useZxing as Mr } from "react-zxing";
|
|
17
17
|
import Ve from "lodash.set";
|
|
18
18
|
import kr from "lodash.clonedeep";
|
|
19
19
|
const zr = ["image/jpeg", "image/png", "image/svg+xml"], _r = [
|
|
@@ -23,15 +23,15 @@ const zr = ["image/jpeg", "image/png", "image/svg+xml"], _r = [
|
|
|
23
23
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
24
24
|
// .xls
|
|
25
25
|
"application/vnd.ms-excel"
|
|
26
|
-
],
|
|
27
|
-
const { fileType: n } = t, e = O(() => _r.includes(n) ? /* @__PURE__ */ l(L, { icon: "RiFileExcelLine" }) :
|
|
26
|
+
], Br = ["application/pdf"], tn = P((t) => {
|
|
27
|
+
const { fileType: n } = t, e = O(() => _r.includes(n) ? /* @__PURE__ */ l(L, { icon: "RiFileExcelLine" }) : Br.includes(n) ? /* @__PURE__ */ l(L, { icon: "RiFilePdfLine" }) : zr.includes(n) ? /* @__PURE__ */ l(L, { icon: "RiFileImageLine" }) : /* @__PURE__ */ l(L, { icon: "RiFileLine" }), [n]);
|
|
28
28
|
return /* @__PURE__ */ l("div", { className: "h-max w-max", children: e });
|
|
29
29
|
});
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
30
|
+
tn.displayName = "FileIcon";
|
|
31
|
+
const Jn = P(
|
|
32
|
+
Xe((t, n) => {
|
|
33
33
|
const { file: e, className: i, error: r, rightSlot: o, ...s } = t;
|
|
34
|
-
return /* @__PURE__ */
|
|
34
|
+
return /* @__PURE__ */ E(
|
|
35
35
|
"div",
|
|
36
36
|
{
|
|
37
37
|
className: je(
|
|
@@ -44,22 +44,22 @@ const Qn = P(
|
|
|
44
44
|
ref: n,
|
|
45
45
|
...s,
|
|
46
46
|
children: [
|
|
47
|
-
r ? /* @__PURE__ */ l(L, { icon: "RiFileWarningLine" }) : /* @__PURE__ */ l(
|
|
48
|
-
r || (e ? /* @__PURE__ */ l(
|
|
47
|
+
r ? /* @__PURE__ */ l(L, { icon: "RiFileWarningLine" }) : /* @__PURE__ */ l(tn, { fileType: (e == null ? void 0 : e.type) ?? "" }),
|
|
48
|
+
r || (e ? /* @__PURE__ */ l(ae, { className: "truncate", children: e.name }) : /* @__PURE__ */ l("div", { className: "flex w-full justify-center", children: /* @__PURE__ */ l(Wn, {}) })),
|
|
49
49
|
o
|
|
50
50
|
]
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
53
|
})
|
|
54
54
|
);
|
|
55
|
-
|
|
55
|
+
Jn.displayName = "FileCard";
|
|
56
56
|
const ge = {
|
|
57
57
|
danger: "danger",
|
|
58
58
|
warning: "warning",
|
|
59
59
|
info: "base",
|
|
60
60
|
success: "success"
|
|
61
61
|
};
|
|
62
|
-
class
|
|
62
|
+
class Zn {
|
|
63
63
|
constructor(n) {
|
|
64
64
|
I(this, "type");
|
|
65
65
|
I(this, "identifier");
|
|
@@ -83,15 +83,15 @@ class Jn {
|
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
const
|
|
86
|
+
const Q = {
|
|
87
87
|
label: "",
|
|
88
88
|
description: "",
|
|
89
89
|
required: !1
|
|
90
90
|
};
|
|
91
|
-
class
|
|
91
|
+
class W extends Zn {
|
|
92
92
|
constructor(e) {
|
|
93
|
-
const { label: i, required: r, image: o, fieldValidators: s = [], formValidators: a = [], ...
|
|
94
|
-
super(
|
|
93
|
+
const { label: i, required: r, image: o, fieldValidators: s = [], formValidators: a = [], ...u } = e;
|
|
94
|
+
super(u);
|
|
95
95
|
I(this, "required");
|
|
96
96
|
I(this, "formValidators");
|
|
97
97
|
I(this, "fieldValidators");
|
|
@@ -150,18 +150,18 @@ class U extends Jn {
|
|
|
150
150
|
return JSON.parse(e);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
I(
|
|
154
|
-
const
|
|
155
|
-
const { id: n, field: e, formId: i, size: r, showInputOnly: o, onValuesChange: s, ...a } = t, [
|
|
156
|
-
...
|
|
153
|
+
I(W, "fieldTypeName"), I(W, "fieldTypeDescription");
|
|
154
|
+
const Z = (t) => {
|
|
155
|
+
const { id: n, field: e, formId: i, size: r, showInputOnly: o, onValuesChange: s, ...a } = t, [u, f, m] = Yt(e.getId()), { touched: d } = f, p = f.error ?? e.description, b = f.error ? "danger" : void 0, y = n ?? `${i}-${e.getId()}-input`, c = `${y}-label`, v = e.required ? `${e.label} *` : e.label, w = O(() => ({
|
|
156
|
+
...u,
|
|
157
157
|
// name and value not being overridden
|
|
158
158
|
onChange: (S) => {
|
|
159
|
-
|
|
159
|
+
m.setValue(S, !1).then(), s == null || s(e.getId(), S), (d || !e.onlyValidateAfterTouched) && m.setError(e.getError(S));
|
|
160
160
|
},
|
|
161
161
|
onBlur: (S) => {
|
|
162
|
-
|
|
162
|
+
m.setTouched(!0, !1).then(), m.setError(e.getError(S));
|
|
163
163
|
}
|
|
164
|
-
}), [e,
|
|
164
|
+
}), [e, u, m, s, d]);
|
|
165
165
|
return [
|
|
166
166
|
{
|
|
167
167
|
helpText: p,
|
|
@@ -172,35 +172,35 @@ const J = (t) => {
|
|
|
172
172
|
label: v,
|
|
173
173
|
showInputOnly: o,
|
|
174
174
|
fieldProps: w,
|
|
175
|
-
helpers:
|
|
175
|
+
helpers: m,
|
|
176
176
|
field: e,
|
|
177
|
-
touched:
|
|
177
|
+
touched: d
|
|
178
178
|
},
|
|
179
179
|
/* Props that should be spread on the html element representing the field */
|
|
180
180
|
{ ...a, "aria-labelledby": c }
|
|
181
181
|
];
|
|
182
|
-
},
|
|
183
|
-
let
|
|
182
|
+
}, nn = [];
|
|
183
|
+
let Je;
|
|
184
184
|
const Vr = new Uint8Array(16);
|
|
185
|
-
function
|
|
186
|
-
if (!
|
|
185
|
+
function $r() {
|
|
186
|
+
if (!Je && (Je = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Je))
|
|
187
187
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
188
|
-
return
|
|
188
|
+
return Je(Vr);
|
|
189
189
|
}
|
|
190
|
-
const
|
|
190
|
+
const U = [];
|
|
191
191
|
for (let t = 0; t < 256; ++t)
|
|
192
|
-
|
|
192
|
+
U.push((t + 256).toString(16).slice(1));
|
|
193
193
|
function Ur(t, n = 0) {
|
|
194
|
-
return
|
|
194
|
+
return U[t[n + 0]] + U[t[n + 1]] + U[t[n + 2]] + U[t[n + 3]] + "-" + U[t[n + 4]] + U[t[n + 5]] + "-" + U[t[n + 6]] + U[t[n + 7]] + "-" + U[t[n + 8]] + U[t[n + 9]] + "-" + U[t[n + 10]] + U[t[n + 11]] + U[t[n + 12]] + U[t[n + 13]] + U[t[n + 14]] + U[t[n + 15]];
|
|
195
195
|
}
|
|
196
|
-
const Wr = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
|
196
|
+
const Wr = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), En = {
|
|
197
197
|
randomUUID: Wr
|
|
198
198
|
};
|
|
199
199
|
function jr(t, n, e) {
|
|
200
|
-
if (
|
|
201
|
-
return
|
|
200
|
+
if (En.randomUUID && !t)
|
|
201
|
+
return En.randomUUID();
|
|
202
202
|
t = t || {};
|
|
203
|
-
const i = t.random || (t.rng ||
|
|
203
|
+
const i = t.random || (t.rng || $r)();
|
|
204
204
|
return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, Ur(i);
|
|
205
205
|
}
|
|
206
206
|
const me = (t) => t.type === "section", ct = (t = "", n = []) => ({
|
|
@@ -222,7 +222,7 @@ function Mt(t, n, e) {
|
|
|
222
222
|
if (!r) throw new Error("Could not find field to reorder.");
|
|
223
223
|
return i.splice(e, 0, r), i;
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function Qn(t, n, e) {
|
|
226
226
|
const i = Array.from(t ?? []);
|
|
227
227
|
return i.splice(n, 0, e), i;
|
|
228
228
|
}
|
|
@@ -230,7 +230,7 @@ function dt(t, n) {
|
|
|
230
230
|
const e = Array.from(t);
|
|
231
231
|
return e.splice(n, 1), e;
|
|
232
232
|
}
|
|
233
|
-
const
|
|
233
|
+
const rn = () => jr(), ei = (t, n) => {
|
|
234
234
|
if (!n) return null;
|
|
235
235
|
for (const e of t)
|
|
236
236
|
if (e.type === "section") {
|
|
@@ -242,13 +242,13 @@ const on = () => jr(), ei = (t, n) => {
|
|
|
242
242
|
}, ti = (t, n) => t.filter((e, i) => i < n).flatMap((e) => e.fields), ut = (t, n, e, i, r) => {
|
|
243
243
|
const o = {
|
|
244
244
|
...e,
|
|
245
|
-
identifier:
|
|
246
|
-
}, s =
|
|
245
|
+
identifier: rn()
|
|
246
|
+
}, s = se(i, t);
|
|
247
247
|
if (s === void 0)
|
|
248
248
|
throw new Error("Parent path must point to an existing field.");
|
|
249
249
|
if (!Array.isArray(s))
|
|
250
250
|
throw new Error("Parent path must point to an array.");
|
|
251
|
-
const a =
|
|
251
|
+
const a = Qn(s, n, o);
|
|
252
252
|
r(t, a).then();
|
|
253
253
|
}, Hr = (t, n, e) => {
|
|
254
254
|
const i = {
|
|
@@ -256,49 +256,49 @@ const on = () => jr(), ei = (t, n) => {
|
|
|
256
256
|
label: ""
|
|
257
257
|
};
|
|
258
258
|
ut("fields", t, i, n, e);
|
|
259
|
-
},
|
|
260
|
-
const { showError: t } =
|
|
261
|
-
(i, r, o, s, a,
|
|
262
|
-
const
|
|
263
|
-
if (!
|
|
264
|
-
let
|
|
259
|
+
}, on = () => {
|
|
260
|
+
const { showError: t } = Ge(), n = R(
|
|
261
|
+
(i, r, o, s, a, u) => {
|
|
262
|
+
const f = i[r];
|
|
263
|
+
if (!f) throw new Error("Could not find section context.");
|
|
264
|
+
let m = typeof f.conditionIndex < "u" ? (
|
|
265
265
|
// cannot move a section with a condition before the condition's field
|
|
266
|
-
Math.max(
|
|
266
|
+
Math.max(f.conditionIndex + 1, s)
|
|
267
267
|
) : s;
|
|
268
|
-
for (const
|
|
269
|
-
|
|
270
|
-
if (
|
|
268
|
+
for (const d of Object.values(i))
|
|
269
|
+
d.conditionIndex === o && (m = Math.min(m, d.index - 1));
|
|
270
|
+
if (m !== s) {
|
|
271
271
|
t({
|
|
272
272
|
title: "Could not reorder sections",
|
|
273
273
|
description: "Sections with conditions must be below the fields they reference."
|
|
274
274
|
});
|
|
275
275
|
return;
|
|
276
276
|
}
|
|
277
|
-
|
|
277
|
+
u("fields", Mt(a.fields, o, m));
|
|
278
278
|
},
|
|
279
279
|
[t]
|
|
280
280
|
), e = R(
|
|
281
|
-
(i, r, o, s, a,
|
|
282
|
-
var
|
|
281
|
+
(i, r, o, s, a, u, f) => {
|
|
282
|
+
var m;
|
|
283
283
|
if (!(i != null && i.fields) || !s) throw new Error("Could not find section with fields.");
|
|
284
284
|
if (i.identifier === s.identifier)
|
|
285
|
-
|
|
285
|
+
f(
|
|
286
286
|
`fields.${r}.fields`,
|
|
287
|
-
Mt(i.fields, o,
|
|
287
|
+
Mt(i.fields, o, u)
|
|
288
288
|
).then();
|
|
289
289
|
else {
|
|
290
|
-
const
|
|
291
|
-
if (!
|
|
292
|
-
if (((
|
|
290
|
+
const d = i.fields[o];
|
|
291
|
+
if (!d) throw new Error("Could not find field to reorder.");
|
|
292
|
+
if (((m = s.condition) == null ? void 0 : m.identifier) === d.identifier) {
|
|
293
293
|
t({
|
|
294
294
|
title: "Could not reorder field",
|
|
295
295
|
description: "Field must be above the section whose condition references it."
|
|
296
296
|
});
|
|
297
297
|
return;
|
|
298
298
|
}
|
|
299
|
-
|
|
299
|
+
f(`fields.${r}.fields`, dt(i.fields, o)).then(), f(
|
|
300
300
|
`fields.${a}.fields`,
|
|
301
|
-
|
|
301
|
+
Qn(s.fields, u, d)
|
|
302
302
|
).then();
|
|
303
303
|
}
|
|
304
304
|
},
|
|
@@ -307,20 +307,20 @@ const on = () => jr(), ei = (t, n) => {
|
|
|
307
307
|
return { reorderSection: n, reorderField: e };
|
|
308
308
|
}, ni = (t) => {
|
|
309
309
|
const { helpText: n, children: e, severity: i } = t, r = i ? ge[i] : "base";
|
|
310
|
-
return /* @__PURE__ */
|
|
310
|
+
return /* @__PURE__ */ E("div", { className: "flex flex-col gap-1", children: [
|
|
311
311
|
e,
|
|
312
|
-
!!n && /* @__PURE__ */ l("div", { className: "flex flex-col w-full", children: /* @__PURE__ */ l(
|
|
312
|
+
!!n && /* @__PURE__ */ l("div", { className: "flex flex-col w-full", children: /* @__PURE__ */ l(ae, { accentColor: r, size: "xs", children: n }) })
|
|
313
313
|
] });
|
|
314
314
|
}, ii = Gn(() => {
|
|
315
315
|
throw new Error("No ImageViewerProvider found");
|
|
316
|
-
}),
|
|
317
|
-
function
|
|
316
|
+
}), sn = () => hr(ii);
|
|
317
|
+
function fe(t, n, { checkForDefaultPrevented: e = !0 } = {}) {
|
|
318
318
|
return function(r) {
|
|
319
319
|
if (t == null || t(r), e === !1 || !r.defaultPrevented)
|
|
320
320
|
return n == null ? void 0 : n(r);
|
|
321
321
|
};
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function In(t, n) {
|
|
324
324
|
if (typeof t == "function")
|
|
325
325
|
return t(n);
|
|
326
326
|
t != null && (t.current = n);
|
|
@@ -329,14 +329,14 @@ function ri(...t) {
|
|
|
329
329
|
return (n) => {
|
|
330
330
|
let e = !1;
|
|
331
331
|
const i = t.map((r) => {
|
|
332
|
-
const o =
|
|
332
|
+
const o = In(r, n);
|
|
333
333
|
return !e && typeof o == "function" && (e = !0), o;
|
|
334
334
|
});
|
|
335
335
|
if (e)
|
|
336
336
|
return () => {
|
|
337
337
|
for (let r = 0; r < i.length; r++) {
|
|
338
338
|
const o = i[r];
|
|
339
|
-
typeof o == "function" ? o() :
|
|
339
|
+
typeof o == "function" ? o() : In(t[r], null);
|
|
340
340
|
}
|
|
341
341
|
};
|
|
342
342
|
};
|
|
@@ -346,8 +346,8 @@ function we(...t) {
|
|
|
346
346
|
}
|
|
347
347
|
function Gr(t, n) {
|
|
348
348
|
const e = h.createContext(n), i = (o) => {
|
|
349
|
-
const { children: s, ...a } = o,
|
|
350
|
-
return /* @__PURE__ */ l(e.Provider, { value:
|
|
349
|
+
const { children: s, ...a } = o, u = h.useMemo(() => a, Object.values(a));
|
|
350
|
+
return /* @__PURE__ */ l(e.Provider, { value: u, children: s });
|
|
351
351
|
};
|
|
352
352
|
i.displayName = t + "Provider";
|
|
353
353
|
function r(o) {
|
|
@@ -361,30 +361,30 @@ function Gr(t, n) {
|
|
|
361
361
|
function Kr(t, n = []) {
|
|
362
362
|
let e = [];
|
|
363
363
|
function i(o, s) {
|
|
364
|
-
const a = h.createContext(s),
|
|
364
|
+
const a = h.createContext(s), u = e.length;
|
|
365
365
|
e = [...e, s];
|
|
366
|
-
const
|
|
366
|
+
const f = (d) => {
|
|
367
367
|
var w;
|
|
368
|
-
const { scope: p, children: b, ...y } =
|
|
368
|
+
const { scope: p, children: b, ...y } = d, c = ((w = p == null ? void 0 : p[t]) == null ? void 0 : w[u]) || a, v = h.useMemo(() => y, Object.values(y));
|
|
369
369
|
return /* @__PURE__ */ l(c.Provider, { value: v, children: b });
|
|
370
370
|
};
|
|
371
|
-
|
|
372
|
-
function
|
|
371
|
+
f.displayName = o + "Provider";
|
|
372
|
+
function m(d, p) {
|
|
373
373
|
var c;
|
|
374
|
-
const b = ((c = p == null ? void 0 : p[t]) == null ? void 0 : c[
|
|
374
|
+
const b = ((c = p == null ? void 0 : p[t]) == null ? void 0 : c[u]) || a, y = h.useContext(b);
|
|
375
375
|
if (y) return y;
|
|
376
376
|
if (s !== void 0) return s;
|
|
377
|
-
throw new Error(`\`${
|
|
377
|
+
throw new Error(`\`${d}\` must be used within \`${o}\``);
|
|
378
378
|
}
|
|
379
|
-
return [
|
|
379
|
+
return [f, m];
|
|
380
380
|
}
|
|
381
381
|
const r = () => {
|
|
382
382
|
const o = e.map((s) => h.createContext(s));
|
|
383
383
|
return function(a) {
|
|
384
|
-
const
|
|
384
|
+
const u = (a == null ? void 0 : a[t]) || o;
|
|
385
385
|
return h.useMemo(
|
|
386
|
-
() => ({ [`__scope${t}`]: { ...a, [t]:
|
|
387
|
-
[a,
|
|
386
|
+
() => ({ [`__scope${t}`]: { ...a, [t]: u } }),
|
|
387
|
+
[a, u]
|
|
388
388
|
);
|
|
389
389
|
};
|
|
390
390
|
};
|
|
@@ -399,9 +399,9 @@ function Xr(...t) {
|
|
|
399
399
|
scopeName: r.scopeName
|
|
400
400
|
}));
|
|
401
401
|
return function(o) {
|
|
402
|
-
const s = i.reduce((a, { useScope:
|
|
403
|
-
const
|
|
404
|
-
return { ...a, ...
|
|
402
|
+
const s = i.reduce((a, { useScope: u, scopeName: f }) => {
|
|
403
|
+
const d = u(o)[`__scope${f}`];
|
|
404
|
+
return { ...a, ...d };
|
|
405
405
|
}, {});
|
|
406
406
|
return h.useMemo(() => ({ [`__scope${n.scopeName}`]: s }), [s]);
|
|
407
407
|
};
|
|
@@ -410,11 +410,11 @@ function Xr(...t) {
|
|
|
410
410
|
}
|
|
411
411
|
var ft = globalThis != null && globalThis.document ? h.useLayoutEffect : () => {
|
|
412
412
|
}, Yr = h.useId || (() => {
|
|
413
|
-
}),
|
|
413
|
+
}), Jr = 0;
|
|
414
414
|
function Nt(t) {
|
|
415
415
|
const [n, e] = h.useState(Yr());
|
|
416
416
|
return ft(() => {
|
|
417
|
-
e((i) => i ?? String(
|
|
417
|
+
e((i) => i ?? String(Jr++));
|
|
418
418
|
}, [t]), t || (n ? `radix-${n}` : "");
|
|
419
419
|
}
|
|
420
420
|
function ve(t) {
|
|
@@ -426,25 +426,25 @@ function ve(t) {
|
|
|
426
426
|
return (i = n.current) == null ? void 0 : i.call(n, ...e);
|
|
427
427
|
}, []);
|
|
428
428
|
}
|
|
429
|
-
function
|
|
429
|
+
function Zr({
|
|
430
430
|
prop: t,
|
|
431
431
|
defaultProp: n,
|
|
432
432
|
onChange: e = () => {
|
|
433
433
|
}
|
|
434
434
|
}) {
|
|
435
|
-
const [i, r] =
|
|
436
|
-
(
|
|
435
|
+
const [i, r] = Qr({ defaultProp: n, onChange: e }), o = t !== void 0, s = o ? t : i, a = ve(e), u = h.useCallback(
|
|
436
|
+
(f) => {
|
|
437
437
|
if (o) {
|
|
438
|
-
const
|
|
439
|
-
|
|
438
|
+
const d = typeof f == "function" ? f(t) : f;
|
|
439
|
+
d !== t && a(d);
|
|
440
440
|
} else
|
|
441
|
-
r(
|
|
441
|
+
r(f);
|
|
442
442
|
},
|
|
443
443
|
[o, t, r, a]
|
|
444
444
|
);
|
|
445
|
-
return [s,
|
|
445
|
+
return [s, u];
|
|
446
446
|
}
|
|
447
|
-
function
|
|
447
|
+
function Qr({
|
|
448
448
|
defaultProp: t,
|
|
449
449
|
onChange: n
|
|
450
450
|
}) {
|
|
@@ -453,15 +453,15 @@ function Zr({
|
|
|
453
453
|
r.current !== i && (o(i), r.current = i);
|
|
454
454
|
}, [i, r, o]), e;
|
|
455
455
|
}
|
|
456
|
-
var
|
|
456
|
+
var ln = h.forwardRef((t, n) => {
|
|
457
457
|
const { children: e, ...i } = t, r = h.Children.toArray(e), o = r.find(to);
|
|
458
458
|
if (o) {
|
|
459
|
-
const s = o.props.children, a = r.map((
|
|
459
|
+
const s = o.props.children, a = r.map((u) => u === o ? h.Children.count(s) > 1 ? h.Children.only(null) : h.isValidElement(s) ? s.props.children : null : u);
|
|
460
460
|
return /* @__PURE__ */ l(kt, { ...i, ref: n, children: h.isValidElement(s) ? h.cloneElement(s, void 0, a) : null });
|
|
461
461
|
}
|
|
462
462
|
return /* @__PURE__ */ l(kt, { ...i, ref: n, children: e });
|
|
463
463
|
});
|
|
464
|
-
|
|
464
|
+
ln.displayName = "Slot";
|
|
465
465
|
var kt = h.forwardRef((t, n) => {
|
|
466
466
|
const { children: e, ...i } = t;
|
|
467
467
|
if (h.isValidElement(e)) {
|
|
@@ -511,9 +511,9 @@ var ro = [
|
|
|
511
511
|
"span",
|
|
512
512
|
"svg",
|
|
513
513
|
"ul"
|
|
514
|
-
],
|
|
514
|
+
], ce = ro.reduce((t, n) => {
|
|
515
515
|
const e = h.forwardRef((i, r) => {
|
|
516
|
-
const { asChild: o, ...s } = i, a = o ?
|
|
516
|
+
const { asChild: o, ...s } = i, a = o ? ln : n;
|
|
517
517
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ l(a, { ...s, ref: r });
|
|
518
518
|
});
|
|
519
519
|
return e.displayName = `Primitive.${n}`, { ...t, [n]: e };
|
|
@@ -530,7 +530,7 @@ function so(t, n = globalThis == null ? void 0 : globalThis.document) {
|
|
|
530
530
|
return n.addEventListener("keydown", i, { capture: !0 }), () => n.removeEventListener("keydown", i, { capture: !0 });
|
|
531
531
|
}, [e, n]);
|
|
532
532
|
}
|
|
533
|
-
var lo = "DismissableLayer", zt = "dismissableLayer.update", ao = "dismissableLayer.pointerDownOutside", co = "dismissableLayer.focusOutside",
|
|
533
|
+
var lo = "DismissableLayer", zt = "dismissableLayer.update", ao = "dismissableLayer.pointerDownOutside", co = "dismissableLayer.focusOutside", Sn, oi = h.createContext({
|
|
534
534
|
layers: /* @__PURE__ */ new Set(),
|
|
535
535
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
536
536
|
branches: /* @__PURE__ */ new Set()
|
|
@@ -543,40 +543,40 @@ var lo = "DismissableLayer", zt = "dismissableLayer.update", ao = "dismissableLa
|
|
|
543
543
|
onFocusOutside: o,
|
|
544
544
|
onInteractOutside: s,
|
|
545
545
|
onDismiss: a,
|
|
546
|
-
...
|
|
547
|
-
} = t,
|
|
548
|
-
const T = N.target,
|
|
549
|
-
!S ||
|
|
546
|
+
...u
|
|
547
|
+
} = t, f = h.useContext(oi), [m, d] = h.useState(null), p = (m == null ? void 0 : m.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, b] = h.useState({}), y = we(n, (N) => d(N)), c = Array.from(f.layers), [v] = [...f.layersWithOutsidePointerEventsDisabled].slice(-1), w = c.indexOf(v), C = m ? c.indexOf(m) : -1, g = f.layersWithOutsidePointerEventsDisabled.size > 0, S = C >= w, x = mo((N) => {
|
|
548
|
+
const T = N.target, D = [...f.branches].some((M) => M.contains(T));
|
|
549
|
+
!S || D || (r == null || r(N), s == null || s(N), N.defaultPrevented || a == null || a());
|
|
550
550
|
}, p), F = ho((N) => {
|
|
551
551
|
const T = N.target;
|
|
552
|
-
[...
|
|
552
|
+
[...f.branches].some((M) => M.contains(T)) || (o == null || o(N), s == null || s(N), N.defaultPrevented || a == null || a());
|
|
553
553
|
}, p);
|
|
554
554
|
return so((N) => {
|
|
555
|
-
|
|
555
|
+
C === f.layers.size - 1 && (i == null || i(N), !N.defaultPrevented && a && (N.preventDefault(), a()));
|
|
556
556
|
}, p), h.useEffect(() => {
|
|
557
|
-
if (
|
|
558
|
-
return e && (
|
|
559
|
-
e &&
|
|
557
|
+
if (m)
|
|
558
|
+
return e && (f.layersWithOutsidePointerEventsDisabled.size === 0 && (Sn = p.body.style.pointerEvents, p.body.style.pointerEvents = "none"), f.layersWithOutsidePointerEventsDisabled.add(m)), f.layers.add(m), Nn(), () => {
|
|
559
|
+
e && f.layersWithOutsidePointerEventsDisabled.size === 1 && (p.body.style.pointerEvents = Sn);
|
|
560
560
|
};
|
|
561
|
-
}, [
|
|
562
|
-
|
|
563
|
-
}, [
|
|
561
|
+
}, [m, p, e, f]), h.useEffect(() => () => {
|
|
562
|
+
m && (f.layers.delete(m), f.layersWithOutsidePointerEventsDisabled.delete(m), Nn());
|
|
563
|
+
}, [m, f]), h.useEffect(() => {
|
|
564
564
|
const N = () => b({});
|
|
565
565
|
return document.addEventListener(zt, N), () => document.removeEventListener(zt, N);
|
|
566
566
|
}, []), /* @__PURE__ */ l(
|
|
567
|
-
|
|
567
|
+
ce.div,
|
|
568
568
|
{
|
|
569
|
-
...
|
|
569
|
+
...u,
|
|
570
570
|
ref: y,
|
|
571
571
|
style: {
|
|
572
572
|
pointerEvents: g ? S ? "auto" : "none" : void 0,
|
|
573
573
|
...t.style
|
|
574
574
|
},
|
|
575
|
-
onFocusCapture:
|
|
576
|
-
onBlurCapture:
|
|
577
|
-
onPointerDownCapture:
|
|
575
|
+
onFocusCapture: fe(t.onFocusCapture, F.onFocusCapture),
|
|
576
|
+
onBlurCapture: fe(t.onBlurCapture, F.onBlurCapture),
|
|
577
|
+
onPointerDownCapture: fe(
|
|
578
578
|
t.onPointerDownCapture,
|
|
579
|
-
|
|
579
|
+
x.onPointerDownCapture
|
|
580
580
|
)
|
|
581
581
|
}
|
|
582
582
|
);
|
|
@@ -591,7 +591,7 @@ var uo = "DismissableLayerBranch", fo = h.forwardRef((t, n) => {
|
|
|
591
591
|
return e.branches.add(o), () => {
|
|
592
592
|
e.branches.delete(o);
|
|
593
593
|
};
|
|
594
|
-
}, [e.branches]), /* @__PURE__ */ l(
|
|
594
|
+
}, [e.branches]), /* @__PURE__ */ l(ce.div, { ...t, ref: r });
|
|
595
595
|
});
|
|
596
596
|
fo.displayName = uo;
|
|
597
597
|
function mo(t, n = globalThis == null ? void 0 : globalThis.document) {
|
|
@@ -600,16 +600,16 @@ function mo(t, n = globalThis == null ? void 0 : globalThis.document) {
|
|
|
600
600
|
return h.useEffect(() => {
|
|
601
601
|
const o = (a) => {
|
|
602
602
|
if (a.target && !i.current) {
|
|
603
|
-
let
|
|
603
|
+
let u = function() {
|
|
604
604
|
li(
|
|
605
605
|
ao,
|
|
606
606
|
e,
|
|
607
|
-
|
|
607
|
+
f,
|
|
608
608
|
{ discrete: !0 }
|
|
609
609
|
);
|
|
610
610
|
};
|
|
611
|
-
const
|
|
612
|
-
a.pointerType === "touch" ? (n.removeEventListener("click", r.current), r.current =
|
|
611
|
+
const f = { originalEvent: a };
|
|
612
|
+
a.pointerType === "touch" ? (n.removeEventListener("click", r.current), r.current = u, n.addEventListener("click", r.current, { once: !0 })) : u();
|
|
613
613
|
} else
|
|
614
614
|
n.removeEventListener("click", r.current);
|
|
615
615
|
i.current = !1;
|
|
@@ -638,7 +638,7 @@ function ho(t, n = globalThis == null ? void 0 : globalThis.document) {
|
|
|
638
638
|
onBlurCapture: () => i.current = !1
|
|
639
639
|
};
|
|
640
640
|
}
|
|
641
|
-
function
|
|
641
|
+
function Nn() {
|
|
642
642
|
const t = new CustomEvent(zt);
|
|
643
643
|
document.dispatchEvent(t);
|
|
644
644
|
}
|
|
@@ -646,14 +646,14 @@ function li(t, n, e, { discrete: i }) {
|
|
|
646
646
|
const r = e.originalEvent.target, o = new CustomEvent(t, { bubbles: !1, cancelable: !0, detail: e });
|
|
647
647
|
n && r.addEventListener(t, n, { once: !0 }), i ? oo(r, o) : r.dispatchEvent(o);
|
|
648
648
|
}
|
|
649
|
-
var Tt = "focusScope.autoFocusOnMount", Rt = "focusScope.autoFocusOnUnmount",
|
|
649
|
+
var Tt = "focusScope.autoFocusOnMount", Rt = "focusScope.autoFocusOnUnmount", Tn = { bubbles: !1, cancelable: !0 }, po = "FocusScope", ai = h.forwardRef((t, n) => {
|
|
650
650
|
const {
|
|
651
651
|
loop: e = !1,
|
|
652
652
|
trapped: i = !1,
|
|
653
653
|
onMountAutoFocus: r,
|
|
654
654
|
onUnmountAutoFocus: o,
|
|
655
655
|
...s
|
|
656
|
-
} = t, [a,
|
|
656
|
+
} = t, [a, u] = h.useState(null), f = ve(r), m = ve(o), d = h.useRef(null), p = we(n, (c) => u(c)), b = h.useRef({
|
|
657
657
|
paused: !1,
|
|
658
658
|
pause() {
|
|
659
659
|
this.paused = !0;
|
|
@@ -667,59 +667,59 @@ var Tt = "focusScope.autoFocusOnMount", Rt = "focusScope.autoFocusOnUnmount", Rn
|
|
|
667
667
|
let c = function(g) {
|
|
668
668
|
if (b.paused || !a) return;
|
|
669
669
|
const S = g.target;
|
|
670
|
-
a.contains(S) ?
|
|
670
|
+
a.contains(S) ? d.current = S : ue(d.current, { select: !0 });
|
|
671
671
|
}, v = function(g) {
|
|
672
672
|
if (b.paused || !a) return;
|
|
673
673
|
const S = g.relatedTarget;
|
|
674
|
-
S !== null && (a.contains(S) ||
|
|
674
|
+
S !== null && (a.contains(S) || ue(d.current, { select: !0 }));
|
|
675
675
|
}, w = function(g) {
|
|
676
676
|
if (document.activeElement === document.body)
|
|
677
|
-
for (const
|
|
678
|
-
|
|
677
|
+
for (const x of g)
|
|
678
|
+
x.removedNodes.length > 0 && ue(a);
|
|
679
679
|
};
|
|
680
680
|
document.addEventListener("focusin", c), document.addEventListener("focusout", v);
|
|
681
|
-
const
|
|
682
|
-
return a &&
|
|
683
|
-
document.removeEventListener("focusin", c), document.removeEventListener("focusout", v),
|
|
681
|
+
const C = new MutationObserver(w);
|
|
682
|
+
return a && C.observe(a, { childList: !0, subtree: !0 }), () => {
|
|
683
|
+
document.removeEventListener("focusin", c), document.removeEventListener("focusout", v), C.disconnect();
|
|
684
684
|
};
|
|
685
685
|
}
|
|
686
686
|
}, [i, a, b.paused]), h.useEffect(() => {
|
|
687
687
|
if (a) {
|
|
688
|
-
|
|
688
|
+
Fn.add(b);
|
|
689
689
|
const c = document.activeElement;
|
|
690
690
|
if (!a.contains(c)) {
|
|
691
|
-
const w = new CustomEvent(Tt,
|
|
692
|
-
a.addEventListener(Tt,
|
|
691
|
+
const w = new CustomEvent(Tt, Tn);
|
|
692
|
+
a.addEventListener(Tt, f), a.dispatchEvent(w), w.defaultPrevented || (go(wo(ci(a)), { select: !0 }), document.activeElement === c && ue(a));
|
|
693
693
|
}
|
|
694
694
|
return () => {
|
|
695
|
-
a.removeEventListener(Tt,
|
|
696
|
-
const w = new CustomEvent(Rt,
|
|
697
|
-
a.addEventListener(Rt,
|
|
695
|
+
a.removeEventListener(Tt, f), setTimeout(() => {
|
|
696
|
+
const w = new CustomEvent(Rt, Tn);
|
|
697
|
+
a.addEventListener(Rt, m), a.dispatchEvent(w), w.defaultPrevented || ue(c ?? document.body, { select: !0 }), a.removeEventListener(Rt, m), Fn.remove(b);
|
|
698
698
|
}, 0);
|
|
699
699
|
};
|
|
700
700
|
}
|
|
701
|
-
}, [a,
|
|
701
|
+
}, [a, f, m, b]);
|
|
702
702
|
const y = h.useCallback(
|
|
703
703
|
(c) => {
|
|
704
704
|
if (!e && !i || b.paused) return;
|
|
705
705
|
const v = c.key === "Tab" && !c.altKey && !c.ctrlKey && !c.metaKey, w = document.activeElement;
|
|
706
706
|
if (v && w) {
|
|
707
|
-
const
|
|
708
|
-
g && S ? !c.shiftKey && w === S ? (c.preventDefault(), e &&
|
|
707
|
+
const C = c.currentTarget, [g, S] = vo(C);
|
|
708
|
+
g && S ? !c.shiftKey && w === S ? (c.preventDefault(), e && ue(g, { select: !0 })) : c.shiftKey && w === g && (c.preventDefault(), e && ue(S, { select: !0 })) : w === C && c.preventDefault();
|
|
709
709
|
}
|
|
710
710
|
},
|
|
711
711
|
[e, i, b.paused]
|
|
712
712
|
);
|
|
713
|
-
return /* @__PURE__ */ l(
|
|
713
|
+
return /* @__PURE__ */ l(ce.div, { tabIndex: -1, ...s, ref: p, onKeyDown: y });
|
|
714
714
|
});
|
|
715
715
|
ai.displayName = po;
|
|
716
716
|
function go(t, { select: n = !1 } = {}) {
|
|
717
717
|
const e = document.activeElement;
|
|
718
718
|
for (const i of t)
|
|
719
|
-
if (
|
|
719
|
+
if (ue(i, { select: n }), document.activeElement !== e) return;
|
|
720
720
|
}
|
|
721
721
|
function vo(t) {
|
|
722
|
-
const n = ci(t), e =
|
|
722
|
+
const n = ci(t), e = Rn(n, t), i = Rn(n.reverse(), t);
|
|
723
723
|
return [e, i];
|
|
724
724
|
}
|
|
725
725
|
function ci(t) {
|
|
@@ -732,7 +732,7 @@ function ci(t) {
|
|
|
732
732
|
for (; e.nextNode(); ) n.push(e.currentNode);
|
|
733
733
|
return n;
|
|
734
734
|
}
|
|
735
|
-
function
|
|
735
|
+
function Rn(t, n) {
|
|
736
736
|
for (const e of t)
|
|
737
737
|
if (!yo(e, { upTo: n })) return e;
|
|
738
738
|
}
|
|
@@ -748,27 +748,27 @@ function yo(t, { upTo: n }) {
|
|
|
748
748
|
function bo(t) {
|
|
749
749
|
return t instanceof HTMLInputElement && "select" in t;
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function ue(t, { select: n = !1 } = {}) {
|
|
752
752
|
if (t && t.focus) {
|
|
753
753
|
const e = document.activeElement;
|
|
754
754
|
t.focus({ preventScroll: !0 }), t !== e && bo(t) && n && t.select();
|
|
755
755
|
}
|
|
756
756
|
}
|
|
757
|
-
var
|
|
757
|
+
var Fn = xo();
|
|
758
758
|
function xo() {
|
|
759
759
|
let t = [];
|
|
760
760
|
return {
|
|
761
761
|
add(n) {
|
|
762
762
|
const e = t[0];
|
|
763
|
-
n !== e && (e == null || e.pause()), t =
|
|
763
|
+
n !== e && (e == null || e.pause()), t = Ln(t, n), t.unshift(n);
|
|
764
764
|
},
|
|
765
765
|
remove(n) {
|
|
766
766
|
var e;
|
|
767
|
-
t =
|
|
767
|
+
t = Ln(t, n), (e = t[0]) == null || e.resume();
|
|
768
768
|
}
|
|
769
769
|
};
|
|
770
770
|
}
|
|
771
|
-
function
|
|
771
|
+
function Ln(t, n) {
|
|
772
772
|
const e = [...t], i = e.indexOf(n);
|
|
773
773
|
return i !== -1 && e.splice(i, 1), e;
|
|
774
774
|
}
|
|
@@ -780,7 +780,7 @@ var Co = "Portal", di = h.forwardRef((t, n) => {
|
|
|
780
780
|
const { container: e, ...i } = t, [r, o] = h.useState(!1);
|
|
781
781
|
ft(() => o(!0), []);
|
|
782
782
|
const s = e || r && ((a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : a.body);
|
|
783
|
-
return s ? Or.createPortal(/* @__PURE__ */ l(
|
|
783
|
+
return s ? Or.createPortal(/* @__PURE__ */ l(ce.div, { ...i, ref: n }), s) : null;
|
|
784
784
|
});
|
|
785
785
|
di.displayName = Co;
|
|
786
786
|
function Eo(t, n) {
|
|
@@ -792,7 +792,7 @@ var xt = (t) => {
|
|
|
792
792
|
};
|
|
793
793
|
xt.displayName = "Presence";
|
|
794
794
|
function Io(t) {
|
|
795
|
-
const [n, e] = h.useState(), i = h.useRef({}), r = h.useRef(t), o = h.useRef("none"), s = t ? "mounted" : "unmounted", [a,
|
|
795
|
+
const [n, e] = h.useState(), i = h.useRef({}), r = h.useRef(t), o = h.useRef("none"), s = t ? "mounted" : "unmounted", [a, u] = Eo(s, {
|
|
796
796
|
mounted: {
|
|
797
797
|
UNMOUNT: "unmounted",
|
|
798
798
|
ANIMATION_OUT: "unmountSuspended"
|
|
@@ -806,41 +806,41 @@ function Io(t) {
|
|
|
806
806
|
}
|
|
807
807
|
});
|
|
808
808
|
return h.useEffect(() => {
|
|
809
|
-
const
|
|
810
|
-
o.current = a === "mounted" ?
|
|
809
|
+
const f = Ze(i.current);
|
|
810
|
+
o.current = a === "mounted" ? f : "none";
|
|
811
811
|
}, [a]), ft(() => {
|
|
812
|
-
const
|
|
813
|
-
if (
|
|
814
|
-
const p = o.current, b =
|
|
815
|
-
t ?
|
|
812
|
+
const f = i.current, m = r.current;
|
|
813
|
+
if (m !== t) {
|
|
814
|
+
const p = o.current, b = Ze(f);
|
|
815
|
+
t ? u("MOUNT") : b === "none" || (f == null ? void 0 : f.display) === "none" ? u("UNMOUNT") : u(m && p !== b ? "ANIMATION_OUT" : "UNMOUNT"), r.current = t;
|
|
816
816
|
}
|
|
817
|
-
}, [t,
|
|
817
|
+
}, [t, u]), ft(() => {
|
|
818
818
|
if (n) {
|
|
819
|
-
let
|
|
820
|
-
const
|
|
821
|
-
const c =
|
|
822
|
-
if (b.target === n && c && (
|
|
819
|
+
let f;
|
|
820
|
+
const m = n.ownerDocument.defaultView ?? window, d = (b) => {
|
|
821
|
+
const c = Ze(i.current).includes(b.animationName);
|
|
822
|
+
if (b.target === n && c && (u("ANIMATION_END"), !r.current)) {
|
|
823
823
|
const v = n.style.animationFillMode;
|
|
824
|
-
n.style.animationFillMode = "forwards",
|
|
824
|
+
n.style.animationFillMode = "forwards", f = m.setTimeout(() => {
|
|
825
825
|
n.style.animationFillMode === "forwards" && (n.style.animationFillMode = v);
|
|
826
826
|
});
|
|
827
827
|
}
|
|
828
828
|
}, p = (b) => {
|
|
829
|
-
b.target === n && (o.current =
|
|
829
|
+
b.target === n && (o.current = Ze(i.current));
|
|
830
830
|
};
|
|
831
|
-
return n.addEventListener("animationstart", p), n.addEventListener("animationcancel",
|
|
832
|
-
|
|
831
|
+
return n.addEventListener("animationstart", p), n.addEventListener("animationcancel", d), n.addEventListener("animationend", d), () => {
|
|
832
|
+
m.clearTimeout(f), n.removeEventListener("animationstart", p), n.removeEventListener("animationcancel", d), n.removeEventListener("animationend", d);
|
|
833
833
|
};
|
|
834
834
|
} else
|
|
835
|
-
|
|
836
|
-
}, [n,
|
|
835
|
+
u("ANIMATION_END");
|
|
836
|
+
}, [n, u]), {
|
|
837
837
|
isPresent: ["mounted", "unmountSuspended"].includes(a),
|
|
838
|
-
ref: h.useCallback((
|
|
839
|
-
|
|
838
|
+
ref: h.useCallback((f) => {
|
|
839
|
+
f && (i.current = getComputedStyle(f)), e(f);
|
|
840
840
|
}, [])
|
|
841
841
|
};
|
|
842
842
|
}
|
|
843
|
-
function
|
|
843
|
+
function Ze(t) {
|
|
844
844
|
return (t == null ? void 0 : t.animationName) || "none";
|
|
845
845
|
}
|
|
846
846
|
function So(t) {
|
|
@@ -852,23 +852,23 @@ var Ft = 0;
|
|
|
852
852
|
function No() {
|
|
853
853
|
h.useEffect(() => {
|
|
854
854
|
const t = document.querySelectorAll("[data-radix-focus-guard]");
|
|
855
|
-
return document.body.insertAdjacentElement("afterbegin", t[0] ??
|
|
855
|
+
return document.body.insertAdjacentElement("afterbegin", t[0] ?? Dn()), document.body.insertAdjacentElement("beforeend", t[1] ?? Dn()), Ft++, () => {
|
|
856
856
|
Ft === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((n) => n.remove()), Ft--;
|
|
857
857
|
};
|
|
858
858
|
}, []);
|
|
859
859
|
}
|
|
860
|
-
function
|
|
860
|
+
function Dn() {
|
|
861
861
|
const t = document.createElement("span");
|
|
862
862
|
return t.setAttribute("data-radix-focus-guard", ""), t.tabIndex = 0, t.style.outline = "none", t.style.opacity = "0", t.style.position = "fixed", t.style.pointerEvents = "none", t;
|
|
863
863
|
}
|
|
864
|
-
var
|
|
865
|
-
return
|
|
864
|
+
var oe = function() {
|
|
865
|
+
return oe = Object.assign || function(n) {
|
|
866
866
|
for (var e, i = 1, r = arguments.length; i < r; i++) {
|
|
867
867
|
e = arguments[i];
|
|
868
868
|
for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (n[o] = e[o]);
|
|
869
869
|
}
|
|
870
870
|
return n;
|
|
871
|
-
},
|
|
871
|
+
}, oe.apply(this, arguments);
|
|
872
872
|
};
|
|
873
873
|
function ui(t, n) {
|
|
874
874
|
var e = {};
|
|
@@ -888,7 +888,7 @@ function Lt(t, n) {
|
|
|
888
888
|
return typeof t == "function" ? t(n) : t && (t.current = n), t;
|
|
889
889
|
}
|
|
890
890
|
function Lo(t, n) {
|
|
891
|
-
var e =
|
|
891
|
+
var e = K(function() {
|
|
892
892
|
return {
|
|
893
893
|
// value
|
|
894
894
|
value: t,
|
|
@@ -908,7 +908,7 @@ function Lo(t, n) {
|
|
|
908
908
|
})[0];
|
|
909
909
|
return e.callback = n, e.facade;
|
|
910
910
|
}
|
|
911
|
-
var Do = typeof window < "u" ? h.useLayoutEffect : h.useEffect,
|
|
911
|
+
var Do = typeof window < "u" ? h.useLayoutEffect : h.useEffect, An = /* @__PURE__ */ new WeakMap();
|
|
912
912
|
function Ao(t, n) {
|
|
913
913
|
var e = Lo(null, function(i) {
|
|
914
914
|
return t.forEach(function(r) {
|
|
@@ -916,7 +916,7 @@ function Ao(t, n) {
|
|
|
916
916
|
});
|
|
917
917
|
});
|
|
918
918
|
return Do(function() {
|
|
919
|
-
var i =
|
|
919
|
+
var i = An.get(e);
|
|
920
920
|
if (i) {
|
|
921
921
|
var r = new Set(i), o = new Set(t), s = e.current;
|
|
922
922
|
r.forEach(function(a) {
|
|
@@ -925,7 +925,7 @@ function Ao(t, n) {
|
|
|
925
925
|
r.has(a) || Lt(a, s);
|
|
926
926
|
});
|
|
927
927
|
}
|
|
928
|
-
|
|
928
|
+
An.set(e, t);
|
|
929
929
|
}, [t]), e;
|
|
930
930
|
}
|
|
931
931
|
function Po(t) {
|
|
@@ -968,18 +968,18 @@ function Oo(t, n) {
|
|
|
968
968
|
var a = e;
|
|
969
969
|
e = [], a.forEach(o), s = e;
|
|
970
970
|
}
|
|
971
|
-
var
|
|
972
|
-
var
|
|
973
|
-
s = [],
|
|
974
|
-
},
|
|
975
|
-
return Promise.resolve().then(
|
|
971
|
+
var u = function() {
|
|
972
|
+
var m = s;
|
|
973
|
+
s = [], m.forEach(o);
|
|
974
|
+
}, f = function() {
|
|
975
|
+
return Promise.resolve().then(u);
|
|
976
976
|
};
|
|
977
|
-
|
|
978
|
-
push: function(
|
|
979
|
-
s.push(
|
|
977
|
+
f(), e = {
|
|
978
|
+
push: function(m) {
|
|
979
|
+
s.push(m), f();
|
|
980
980
|
},
|
|
981
|
-
filter: function(
|
|
982
|
-
return s = s.filter(
|
|
981
|
+
filter: function(m) {
|
|
982
|
+
return s = s.filter(m), e;
|
|
983
983
|
}
|
|
984
984
|
};
|
|
985
985
|
}
|
|
@@ -989,7 +989,7 @@ function Oo(t, n) {
|
|
|
989
989
|
function Mo(t) {
|
|
990
990
|
t === void 0 && (t = {});
|
|
991
991
|
var n = Oo(null);
|
|
992
|
-
return n.options =
|
|
992
|
+
return n.options = oe({ async: !0, ssr: !1 }, t), n;
|
|
993
993
|
}
|
|
994
994
|
var fi = function(t) {
|
|
995
995
|
var n = t.sideCar, e = ui(t, ["sideCar"]);
|
|
@@ -998,7 +998,7 @@ var fi = function(t) {
|
|
|
998
998
|
var i = n.read();
|
|
999
999
|
if (!i)
|
|
1000
1000
|
throw new Error("Sidecar medium not found");
|
|
1001
|
-
return h.createElement(i,
|
|
1001
|
+
return h.createElement(i, oe({}, e));
|
|
1002
1002
|
};
|
|
1003
1003
|
fi.isSideCarExport = !0;
|
|
1004
1004
|
function ko(t, n) {
|
|
@@ -1010,12 +1010,12 @@ var mi = Mo(), Dt = function() {
|
|
|
1010
1010
|
onScrollCapture: Dt,
|
|
1011
1011
|
onWheelCapture: Dt,
|
|
1012
1012
|
onTouchMoveCapture: Dt
|
|
1013
|
-
}), r = i[0], o = i[1], s = t.forwardProps, a = t.children,
|
|
1013
|
+
}), r = i[0], o = i[1], s = t.forwardProps, a = t.children, u = t.className, f = t.removeScrollBar, m = t.enabled, d = t.shards, p = t.sideCar, b = t.noIsolation, y = t.inert, c = t.allowPinchZoom, v = t.as, w = v === void 0 ? "div" : v, C = t.gapMode, g = ui(t, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), S = p, x = Ao([e, n]), F = oe(oe({}, g), r);
|
|
1014
1014
|
return h.createElement(
|
|
1015
1015
|
h.Fragment,
|
|
1016
1016
|
null,
|
|
1017
|
-
|
|
1018
|
-
s ? h.cloneElement(h.Children.only(a),
|
|
1017
|
+
m && h.createElement(S, { sideCar: mi, removeScrollBar: f, shards: d, noIsolation: b, inert: y, setCallbacks: o, allowPinchZoom: !!c, lockRef: e, gapMode: C }),
|
|
1018
|
+
s ? h.cloneElement(h.Children.only(a), oe(oe({}, F), { ref: x })) : h.createElement(w, oe({}, F, { className: u, ref: x }), a)
|
|
1019
1019
|
);
|
|
1020
1020
|
});
|
|
1021
1021
|
wt.defaultProps = {
|
|
@@ -1039,25 +1039,25 @@ function _o() {
|
|
|
1039
1039
|
var n = zo();
|
|
1040
1040
|
return n && t.setAttribute("nonce", n), t;
|
|
1041
1041
|
}
|
|
1042
|
-
function
|
|
1042
|
+
function Bo(t, n) {
|
|
1043
1043
|
t.styleSheet ? t.styleSheet.cssText = n : t.appendChild(document.createTextNode(n));
|
|
1044
1044
|
}
|
|
1045
1045
|
function Vo(t) {
|
|
1046
1046
|
var n = document.head || document.getElementsByTagName("head")[0];
|
|
1047
1047
|
n.appendChild(t);
|
|
1048
1048
|
}
|
|
1049
|
-
var
|
|
1049
|
+
var $o = function() {
|
|
1050
1050
|
var t = 0, n = null;
|
|
1051
1051
|
return {
|
|
1052
1052
|
add: function(e) {
|
|
1053
|
-
t == 0 && (n = _o()) && (
|
|
1053
|
+
t == 0 && (n = _o()) && (Bo(n, e), Vo(n)), t++;
|
|
1054
1054
|
},
|
|
1055
1055
|
remove: function() {
|
|
1056
1056
|
t--, !t && n && (n.parentNode && n.parentNode.removeChild(n), n = null);
|
|
1057
1057
|
}
|
|
1058
1058
|
};
|
|
1059
1059
|
}, Uo = function() {
|
|
1060
|
-
var t =
|
|
1060
|
+
var t = $o();
|
|
1061
1061
|
return function(n, e) {
|
|
1062
1062
|
h.useEffect(function() {
|
|
1063
1063
|
return t.add(n), function() {
|
|
@@ -1091,14 +1091,14 @@ var Bo = function() {
|
|
|
1091
1091
|
right: n[2],
|
|
1092
1092
|
gap: Math.max(0, i - e + n[2] - n[0])
|
|
1093
1093
|
};
|
|
1094
|
-
}, Ho = hi(),
|
|
1094
|
+
}, Ho = hi(), $e = "data-scroll-locked", Go = function(t, n, e, i) {
|
|
1095
1095
|
var r = t.left, o = t.top, s = t.right, a = t.gap;
|
|
1096
1096
|
return e === void 0 && (e = "margin"), `
|
|
1097
1097
|
.`.concat(Ro, ` {
|
|
1098
1098
|
overflow: hidden `).concat(i, `;
|
|
1099
1099
|
padding-right: `).concat(a, "px ").concat(i, `;
|
|
1100
1100
|
}
|
|
1101
|
-
body[`).concat(
|
|
1101
|
+
body[`).concat($e, `] {
|
|
1102
1102
|
overflow: hidden `).concat(i, `;
|
|
1103
1103
|
overscroll-behavior: contain;
|
|
1104
1104
|
`).concat([
|
|
@@ -1131,18 +1131,18 @@ var Bo = function() {
|
|
|
1131
1131
|
margin-right: 0 `).concat(i, `;
|
|
1132
1132
|
}
|
|
1133
1133
|
|
|
1134
|
-
body[`).concat(
|
|
1134
|
+
body[`).concat($e, `] {
|
|
1135
1135
|
`).concat(Fo, ": ").concat(a, `px;
|
|
1136
1136
|
}
|
|
1137
1137
|
`);
|
|
1138
|
-
},
|
|
1139
|
-
var t = parseInt(document.body.getAttribute(
|
|
1138
|
+
}, Pn = function() {
|
|
1139
|
+
var t = parseInt(document.body.getAttribute($e) || "0", 10);
|
|
1140
1140
|
return isFinite(t) ? t : 0;
|
|
1141
1141
|
}, Ko = function() {
|
|
1142
1142
|
h.useEffect(function() {
|
|
1143
|
-
return document.body.setAttribute(
|
|
1144
|
-
var t =
|
|
1145
|
-
t <= 0 ? document.body.removeAttribute(
|
|
1143
|
+
return document.body.setAttribute($e, (Pn() + 1).toString()), function() {
|
|
1144
|
+
var t = Pn() - 1;
|
|
1145
|
+
t <= 0 ? document.body.removeAttribute($e) : document.body.setAttribute($e, t.toString());
|
|
1146
1146
|
};
|
|
1147
1147
|
}, []);
|
|
1148
1148
|
}, Xo = function(t) {
|
|
@@ -1155,12 +1155,12 @@ var Bo = function() {
|
|
|
1155
1155
|
}, _t = !1;
|
|
1156
1156
|
if (typeof window < "u")
|
|
1157
1157
|
try {
|
|
1158
|
-
var
|
|
1158
|
+
var Qe = Object.defineProperty({}, "passive", {
|
|
1159
1159
|
get: function() {
|
|
1160
1160
|
return _t = !0, !0;
|
|
1161
1161
|
}
|
|
1162
1162
|
});
|
|
1163
|
-
window.addEventListener("test",
|
|
1163
|
+
window.addEventListener("test", Qe, Qe), window.removeEventListener("test", Qe, Qe);
|
|
1164
1164
|
} catch {
|
|
1165
1165
|
_t = !1;
|
|
1166
1166
|
}
|
|
@@ -1175,11 +1175,11 @@ var Se = _t ? { passive: !1 } : !1, Yo = function(t) {
|
|
|
1175
1175
|
e[n] !== "hidden" && // contains scroll inside self
|
|
1176
1176
|
!(e.overflowY === e.overflowX && !Yo(t) && e[n] === "visible")
|
|
1177
1177
|
);
|
|
1178
|
-
}, Qo = function(t) {
|
|
1179
|
-
return pi(t, "overflowY");
|
|
1180
1178
|
}, Jo = function(t) {
|
|
1179
|
+
return pi(t, "overflowY");
|
|
1180
|
+
}, Zo = function(t) {
|
|
1181
1181
|
return pi(t, "overflowX");
|
|
1182
|
-
},
|
|
1182
|
+
}, On = function(t, n) {
|
|
1183
1183
|
var e = n.ownerDocument, i = n;
|
|
1184
1184
|
do {
|
|
1185
1185
|
typeof ShadowRoot < "u" && i instanceof ShadowRoot && (i = i.host);
|
|
@@ -1192,7 +1192,7 @@ var Se = _t ? { passive: !1 } : !1, Yo = function(t) {
|
|
|
1192
1192
|
i = i.parentNode;
|
|
1193
1193
|
} while (i && i !== e.body);
|
|
1194
1194
|
return !1;
|
|
1195
|
-
},
|
|
1195
|
+
}, Qo = function(t) {
|
|
1196
1196
|
var n = t.scrollTop, e = t.scrollHeight, i = t.clientHeight;
|
|
1197
1197
|
return [
|
|
1198
1198
|
n,
|
|
@@ -1207,27 +1207,27 @@ var Se = _t ? { passive: !1 } : !1, Yo = function(t) {
|
|
|
1207
1207
|
i
|
|
1208
1208
|
];
|
|
1209
1209
|
}, gi = function(t, n) {
|
|
1210
|
-
return t === "v" ?
|
|
1210
|
+
return t === "v" ? Jo(n) : Zo(n);
|
|
1211
1211
|
}, vi = function(t, n) {
|
|
1212
|
-
return t === "v" ?
|
|
1212
|
+
return t === "v" ? Qo(n) : es(n);
|
|
1213
1213
|
}, ts = function(t, n) {
|
|
1214
1214
|
return t === "h" && n === "rtl" ? -1 : 1;
|
|
1215
1215
|
}, ns = function(t, n, e, i, r) {
|
|
1216
|
-
var o = ts(t, window.getComputedStyle(n).direction), s = o * i, a = e.target,
|
|
1216
|
+
var o = ts(t, window.getComputedStyle(n).direction), s = o * i, a = e.target, u = n.contains(a), f = !1, m = s > 0, d = 0, p = 0;
|
|
1217
1217
|
do {
|
|
1218
1218
|
var b = vi(t, a), y = b[0], c = b[1], v = b[2], w = c - v - o * y;
|
|
1219
|
-
(y || w) && gi(t, a) && (
|
|
1219
|
+
(y || w) && gi(t, a) && (d += w, p += y), a instanceof ShadowRoot ? a = a.host : a = a.parentNode;
|
|
1220
1220
|
} while (
|
|
1221
1221
|
// portaled content
|
|
1222
|
-
!
|
|
1223
|
-
|
|
1222
|
+
!u && a !== document.body || // self content
|
|
1223
|
+
u && (n.contains(a) || n === a)
|
|
1224
1224
|
);
|
|
1225
|
-
return (
|
|
1225
|
+
return (m && Math.abs(d) < 1 || !m && Math.abs(p) < 1) && (f = !0), f;
|
|
1226
1226
|
}, et = function(t) {
|
|
1227
1227
|
return "changedTouches" in t ? [t.changedTouches[0].clientX, t.changedTouches[0].clientY] : [0, 0];
|
|
1228
|
-
},
|
|
1228
|
+
}, Mn = function(t) {
|
|
1229
1229
|
return [t.deltaX, t.deltaY];
|
|
1230
|
-
},
|
|
1230
|
+
}, kn = function(t) {
|
|
1231
1231
|
return t && "current" in t ? t.current : t;
|
|
1232
1232
|
}, is = function(t, n) {
|
|
1233
1233
|
return t[0] === n[0] && t[1] === n[1];
|
|
@@ -1244,7 +1244,7 @@ function ss(t) {
|
|
|
1244
1244
|
}, [t]), h.useEffect(function() {
|
|
1245
1245
|
if (t.inert) {
|
|
1246
1246
|
document.body.classList.add("block-interactivity-".concat(r));
|
|
1247
|
-
var c = To([t.lockRef.current], (t.shards || []).map(
|
|
1247
|
+
var c = To([t.lockRef.current], (t.shards || []).map(kn), !0).filter(Boolean);
|
|
1248
1248
|
return c.forEach(function(v) {
|
|
1249
1249
|
return v.classList.add("allow-interactivity-".concat(r));
|
|
1250
1250
|
}), function() {
|
|
@@ -1257,58 +1257,58 @@ function ss(t) {
|
|
|
1257
1257
|
var a = h.useCallback(function(c, v) {
|
|
1258
1258
|
if ("touches" in c && c.touches.length === 2 || c.type === "wheel" && c.ctrlKey)
|
|
1259
1259
|
return !s.current.allowPinchZoom;
|
|
1260
|
-
var w = et(c),
|
|
1260
|
+
var w = et(c), C = e.current, g = "deltaX" in c ? c.deltaX : C[0] - w[0], S = "deltaY" in c ? c.deltaY : C[1] - w[1], x, F = c.target, N = Math.abs(g) > Math.abs(S) ? "h" : "v";
|
|
1261
1261
|
if ("touches" in c && N === "h" && F.type === "range")
|
|
1262
1262
|
return !1;
|
|
1263
|
-
var T =
|
|
1263
|
+
var T = On(N, F);
|
|
1264
1264
|
if (!T)
|
|
1265
1265
|
return !0;
|
|
1266
|
-
if (T ?
|
|
1266
|
+
if (T ? x = N : (x = N === "v" ? "h" : "v", T = On(N, F)), !T)
|
|
1267
1267
|
return !1;
|
|
1268
|
-
if (!i.current && "changedTouches" in c && (g || S) && (i.current =
|
|
1268
|
+
if (!i.current && "changedTouches" in c && (g || S) && (i.current = x), !x)
|
|
1269
1269
|
return !0;
|
|
1270
|
-
var
|
|
1271
|
-
return ns(
|
|
1272
|
-
}, []),
|
|
1270
|
+
var D = i.current || x;
|
|
1271
|
+
return ns(D, v, c, D === "h" ? g : S);
|
|
1272
|
+
}, []), u = h.useCallback(function(c) {
|
|
1273
1273
|
var v = c;
|
|
1274
1274
|
if (!(!Ne.length || Ne[Ne.length - 1] !== o)) {
|
|
1275
|
-
var w = "deltaY" in v ?
|
|
1276
|
-
return
|
|
1275
|
+
var w = "deltaY" in v ? Mn(v) : et(v), C = n.current.filter(function(x) {
|
|
1276
|
+
return x.name === v.type && (x.target === v.target || v.target === x.shadowParent) && is(x.delta, w);
|
|
1277
1277
|
})[0];
|
|
1278
|
-
if (
|
|
1278
|
+
if (C && C.should) {
|
|
1279
1279
|
v.cancelable && v.preventDefault();
|
|
1280
1280
|
return;
|
|
1281
1281
|
}
|
|
1282
|
-
if (!
|
|
1283
|
-
var g = (s.current.shards || []).map(
|
|
1284
|
-
return
|
|
1282
|
+
if (!C) {
|
|
1283
|
+
var g = (s.current.shards || []).map(kn).filter(Boolean).filter(function(x) {
|
|
1284
|
+
return x.contains(v.target);
|
|
1285
1285
|
}), S = g.length > 0 ? a(v, g[0]) : !s.current.noIsolation;
|
|
1286
1286
|
S && v.cancelable && v.preventDefault();
|
|
1287
1287
|
}
|
|
1288
1288
|
}
|
|
1289
|
-
}, []),
|
|
1290
|
-
var g = { name: c, delta: v, target: w, should:
|
|
1289
|
+
}, []), f = h.useCallback(function(c, v, w, C) {
|
|
1290
|
+
var g = { name: c, delta: v, target: w, should: C, shadowParent: ls(w) };
|
|
1291
1291
|
n.current.push(g), setTimeout(function() {
|
|
1292
1292
|
n.current = n.current.filter(function(S) {
|
|
1293
1293
|
return S !== g;
|
|
1294
1294
|
});
|
|
1295
1295
|
}, 1);
|
|
1296
|
-
}, []),
|
|
1296
|
+
}, []), m = h.useCallback(function(c) {
|
|
1297
1297
|
e.current = et(c), i.current = void 0;
|
|
1298
|
-
}, []),
|
|
1299
|
-
|
|
1298
|
+
}, []), d = h.useCallback(function(c) {
|
|
1299
|
+
f(c.type, Mn(c), c.target, a(c, t.lockRef.current));
|
|
1300
1300
|
}, []), p = h.useCallback(function(c) {
|
|
1301
|
-
|
|
1301
|
+
f(c.type, et(c), c.target, a(c, t.lockRef.current));
|
|
1302
1302
|
}, []);
|
|
1303
1303
|
h.useEffect(function() {
|
|
1304
1304
|
return Ne.push(o), t.setCallbacks({
|
|
1305
|
-
onScrollCapture:
|
|
1306
|
-
onWheelCapture:
|
|
1305
|
+
onScrollCapture: d,
|
|
1306
|
+
onWheelCapture: d,
|
|
1307
1307
|
onTouchMoveCapture: p
|
|
1308
|
-
}), document.addEventListener("wheel",
|
|
1308
|
+
}), document.addEventListener("wheel", u, Se), document.addEventListener("touchmove", u, Se), document.addEventListener("touchstart", m, Se), function() {
|
|
1309
1309
|
Ne = Ne.filter(function(c) {
|
|
1310
1310
|
return c !== o;
|
|
1311
|
-
}), document.removeEventListener("wheel",
|
|
1311
|
+
}), document.removeEventListener("wheel", u, Se), document.removeEventListener("touchmove", u, Se), document.removeEventListener("touchstart", m, Se);
|
|
1312
1312
|
};
|
|
1313
1313
|
}, []);
|
|
1314
1314
|
var b = t.removeScrollBar, y = t.inert;
|
|
@@ -1326,7 +1326,7 @@ function ls(t) {
|
|
|
1326
1326
|
}
|
|
1327
1327
|
const as = ko(mi, ss);
|
|
1328
1328
|
var yi = h.forwardRef(function(t, n) {
|
|
1329
|
-
return h.createElement(wt,
|
|
1329
|
+
return h.createElement(wt, oe({}, t, { ref: n, sideCar: as }));
|
|
1330
1330
|
});
|
|
1331
1331
|
yi.classNames = wt.classNames;
|
|
1332
1332
|
var cs = function(t) {
|
|
@@ -1348,14 +1348,14 @@ var cs = function(t) {
|
|
|
1348
1348
|
}, us = function(t, n, e, i) {
|
|
1349
1349
|
var r = ds(n, Array.isArray(t) ? t : [t]);
|
|
1350
1350
|
nt[e] || (nt[e] = /* @__PURE__ */ new WeakMap());
|
|
1351
|
-
var o = nt[e], s = [], a = /* @__PURE__ */ new Set(),
|
|
1352
|
-
!
|
|
1351
|
+
var o = nt[e], s = [], a = /* @__PURE__ */ new Set(), u = new Set(r), f = function(d) {
|
|
1352
|
+
!d || a.has(d) || (a.add(d), f(d.parentNode));
|
|
1353
1353
|
};
|
|
1354
|
-
r.forEach(
|
|
1355
|
-
var
|
|
1356
|
-
!
|
|
1354
|
+
r.forEach(f);
|
|
1355
|
+
var m = function(d) {
|
|
1356
|
+
!d || u.has(d) || Array.prototype.forEach.call(d.children, function(p) {
|
|
1357
1357
|
if (a.has(p))
|
|
1358
|
-
|
|
1358
|
+
m(p);
|
|
1359
1359
|
else
|
|
1360
1360
|
try {
|
|
1361
1361
|
var b = p.getAttribute(i), y = b !== null && b !== "false", c = (Te.get(p) || 0) + 1, v = (o.get(p) || 0) + 1;
|
|
@@ -1365,10 +1365,10 @@ var cs = function(t) {
|
|
|
1365
1365
|
}
|
|
1366
1366
|
});
|
|
1367
1367
|
};
|
|
1368
|
-
return
|
|
1369
|
-
s.forEach(function(
|
|
1370
|
-
var p = Te.get(
|
|
1371
|
-
Te.set(
|
|
1368
|
+
return m(n), a.clear(), Pt++, function() {
|
|
1369
|
+
s.forEach(function(d) {
|
|
1370
|
+
var p = Te.get(d) - 1, b = o.get(d) - 1;
|
|
1371
|
+
Te.set(d, p), o.set(d, b), p || (tt.has(d) || d.removeAttribute(i), tt.delete(d)), b || d.removeAttribute(e);
|
|
1372
1372
|
}), Pt--, Pt || (Te = /* @__PURE__ */ new WeakMap(), Te = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), nt = {});
|
|
1373
1373
|
};
|
|
1374
1374
|
}, fs = function(t, n, e) {
|
|
@@ -1377,7 +1377,7 @@ var cs = function(t) {
|
|
|
1377
1377
|
return r ? (i.push.apply(i, Array.from(r.querySelectorAll("[aria-live]"))), us(i, r, e, "aria-hidden")) : function() {
|
|
1378
1378
|
return null;
|
|
1379
1379
|
};
|
|
1380
|
-
},
|
|
1380
|
+
}, an = "Dialog", [xi, cl] = Kr(an), [ms, te] = xi(an), wi = (t) => {
|
|
1381
1381
|
const {
|
|
1382
1382
|
__scopeDialog: n,
|
|
1383
1383
|
children: e,
|
|
@@ -1385,7 +1385,7 @@ var cs = function(t) {
|
|
|
1385
1385
|
defaultOpen: r,
|
|
1386
1386
|
onOpenChange: o,
|
|
1387
1387
|
modal: s = !0
|
|
1388
|
-
} = t, a = h.useRef(null),
|
|
1388
|
+
} = t, a = h.useRef(null), u = h.useRef(null), [f = !1, m] = Zr({
|
|
1389
1389
|
prop: i,
|
|
1390
1390
|
defaultProp: r,
|
|
1391
1391
|
onChange: o
|
|
@@ -1395,62 +1395,62 @@ var cs = function(t) {
|
|
|
1395
1395
|
{
|
|
1396
1396
|
scope: n,
|
|
1397
1397
|
triggerRef: a,
|
|
1398
|
-
contentRef:
|
|
1398
|
+
contentRef: u,
|
|
1399
1399
|
contentId: Nt(),
|
|
1400
1400
|
titleId: Nt(),
|
|
1401
1401
|
descriptionId: Nt(),
|
|
1402
|
-
open:
|
|
1403
|
-
onOpenChange:
|
|
1404
|
-
onOpenToggle: h.useCallback(() =>
|
|
1402
|
+
open: f,
|
|
1403
|
+
onOpenChange: m,
|
|
1404
|
+
onOpenToggle: h.useCallback(() => m((d) => !d), [m]),
|
|
1405
1405
|
modal: s,
|
|
1406
1406
|
children: e
|
|
1407
1407
|
}
|
|
1408
1408
|
);
|
|
1409
1409
|
};
|
|
1410
|
-
wi.displayName =
|
|
1410
|
+
wi.displayName = an;
|
|
1411
1411
|
var Ci = "DialogTrigger", Ei = h.forwardRef(
|
|
1412
1412
|
(t, n) => {
|
|
1413
|
-
const { __scopeDialog: e, ...i } = t, r =
|
|
1413
|
+
const { __scopeDialog: e, ...i } = t, r = te(Ci, e), o = we(n, r.triggerRef);
|
|
1414
1414
|
return /* @__PURE__ */ l(
|
|
1415
|
-
|
|
1415
|
+
ce.button,
|
|
1416
1416
|
{
|
|
1417
1417
|
type: "button",
|
|
1418
1418
|
"aria-haspopup": "dialog",
|
|
1419
1419
|
"aria-expanded": r.open,
|
|
1420
1420
|
"aria-controls": r.contentId,
|
|
1421
|
-
"data-state":
|
|
1421
|
+
"data-state": un(r.open),
|
|
1422
1422
|
...i,
|
|
1423
1423
|
ref: o,
|
|
1424
|
-
onClick:
|
|
1424
|
+
onClick: fe(t.onClick, r.onOpenToggle)
|
|
1425
1425
|
}
|
|
1426
1426
|
);
|
|
1427
1427
|
}
|
|
1428
1428
|
);
|
|
1429
1429
|
Ei.displayName = Ci;
|
|
1430
|
-
var
|
|
1430
|
+
var cn = "DialogPortal", [hs, Ii] = xi(cn, {
|
|
1431
1431
|
forceMount: void 0
|
|
1432
1432
|
}), Si = (t) => {
|
|
1433
|
-
const { __scopeDialog: n, forceMount: e, children: i, container: r } = t, o =
|
|
1433
|
+
const { __scopeDialog: n, forceMount: e, children: i, container: r } = t, o = te(cn, n);
|
|
1434
1434
|
return /* @__PURE__ */ l(hs, { scope: n, forceMount: e, children: h.Children.map(i, (s) => /* @__PURE__ */ l(xt, { present: e || o.open, children: /* @__PURE__ */ l(di, { asChild: !0, container: r, children: s }) })) });
|
|
1435
1435
|
};
|
|
1436
|
-
Si.displayName =
|
|
1436
|
+
Si.displayName = cn;
|
|
1437
1437
|
var mt = "DialogOverlay", Ni = h.forwardRef(
|
|
1438
1438
|
(t, n) => {
|
|
1439
|
-
const e = Ii(mt, t.__scopeDialog), { forceMount: i = e.forceMount, ...r } = t, o =
|
|
1439
|
+
const e = Ii(mt, t.__scopeDialog), { forceMount: i = e.forceMount, ...r } = t, o = te(mt, t.__scopeDialog);
|
|
1440
1440
|
return o.modal ? /* @__PURE__ */ l(xt, { present: i || o.open, children: /* @__PURE__ */ l(ps, { ...r, ref: n }) }) : null;
|
|
1441
1441
|
}
|
|
1442
1442
|
);
|
|
1443
1443
|
Ni.displayName = mt;
|
|
1444
1444
|
var ps = h.forwardRef(
|
|
1445
1445
|
(t, n) => {
|
|
1446
|
-
const { __scopeDialog: e, ...i } = t, r =
|
|
1446
|
+
const { __scopeDialog: e, ...i } = t, r = te(mt, e);
|
|
1447
1447
|
return (
|
|
1448
1448
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
1449
1449
|
// ie. when `Overlay` and `Content` are siblings
|
|
1450
|
-
/* @__PURE__ */ l(yi, { as:
|
|
1451
|
-
|
|
1450
|
+
/* @__PURE__ */ l(yi, { as: ln, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ l(
|
|
1451
|
+
ce.div,
|
|
1452
1452
|
{
|
|
1453
|
-
"data-state":
|
|
1453
|
+
"data-state": un(r.open),
|
|
1454
1454
|
...i,
|
|
1455
1455
|
ref: n,
|
|
1456
1456
|
style: { pointerEvents: "auto", ...i.style }
|
|
@@ -1460,14 +1460,14 @@ var ps = h.forwardRef(
|
|
|
1460
1460
|
}
|
|
1461
1461
|
), ye = "DialogContent", Ti = h.forwardRef(
|
|
1462
1462
|
(t, n) => {
|
|
1463
|
-
const e = Ii(ye, t.__scopeDialog), { forceMount: i = e.forceMount, ...r } = t, o =
|
|
1463
|
+
const e = Ii(ye, t.__scopeDialog), { forceMount: i = e.forceMount, ...r } = t, o = te(ye, t.__scopeDialog);
|
|
1464
1464
|
return /* @__PURE__ */ l(xt, { present: i || o.open, children: o.modal ? /* @__PURE__ */ l(gs, { ...r, ref: n }) : /* @__PURE__ */ l(vs, { ...r, ref: n }) });
|
|
1465
1465
|
}
|
|
1466
1466
|
);
|
|
1467
1467
|
Ti.displayName = ye;
|
|
1468
1468
|
var gs = h.forwardRef(
|
|
1469
1469
|
(t, n) => {
|
|
1470
|
-
const e =
|
|
1470
|
+
const e = te(ye, t.__scopeDialog), i = h.useRef(null), r = we(n, e.contentRef, i);
|
|
1471
1471
|
return h.useEffect(() => {
|
|
1472
1472
|
const o = i.current;
|
|
1473
1473
|
if (o) return fs(o);
|
|
@@ -1478,15 +1478,15 @@ var gs = h.forwardRef(
|
|
|
1478
1478
|
ref: r,
|
|
1479
1479
|
trapFocus: e.open,
|
|
1480
1480
|
disableOutsidePointerEvents: !0,
|
|
1481
|
-
onCloseAutoFocus:
|
|
1481
|
+
onCloseAutoFocus: fe(t.onCloseAutoFocus, (o) => {
|
|
1482
1482
|
var s;
|
|
1483
1483
|
o.preventDefault(), (s = e.triggerRef.current) == null || s.focus();
|
|
1484
1484
|
}),
|
|
1485
|
-
onPointerDownOutside:
|
|
1485
|
+
onPointerDownOutside: fe(t.onPointerDownOutside, (o) => {
|
|
1486
1486
|
const s = o.detail.originalEvent, a = s.button === 0 && s.ctrlKey === !0;
|
|
1487
1487
|
(s.button === 2 || a) && o.preventDefault();
|
|
1488
1488
|
}),
|
|
1489
|
-
onFocusOutside:
|
|
1489
|
+
onFocusOutside: fe(
|
|
1490
1490
|
t.onFocusOutside,
|
|
1491
1491
|
(o) => o.preventDefault()
|
|
1492
1492
|
)
|
|
@@ -1495,7 +1495,7 @@ var gs = h.forwardRef(
|
|
|
1495
1495
|
}
|
|
1496
1496
|
), vs = h.forwardRef(
|
|
1497
1497
|
(t, n) => {
|
|
1498
|
-
const e =
|
|
1498
|
+
const e = te(ye, t.__scopeDialog), i = h.useRef(!1), r = h.useRef(!1);
|
|
1499
1499
|
return /* @__PURE__ */ l(
|
|
1500
1500
|
Ri,
|
|
1501
1501
|
{
|
|
@@ -1508,18 +1508,18 @@ var gs = h.forwardRef(
|
|
|
1508
1508
|
(s = t.onCloseAutoFocus) == null || s.call(t, o), o.defaultPrevented || (i.current || (a = e.triggerRef.current) == null || a.focus(), o.preventDefault()), i.current = !1, r.current = !1;
|
|
1509
1509
|
},
|
|
1510
1510
|
onInteractOutside: (o) => {
|
|
1511
|
-
var
|
|
1512
|
-
(
|
|
1511
|
+
var u, f;
|
|
1512
|
+
(u = t.onInteractOutside) == null || u.call(t, o), o.defaultPrevented || (i.current = !0, o.detail.originalEvent.type === "pointerdown" && (r.current = !0));
|
|
1513
1513
|
const s = o.target;
|
|
1514
|
-
((
|
|
1514
|
+
((f = e.triggerRef.current) == null ? void 0 : f.contains(s)) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && r.current && o.preventDefault();
|
|
1515
1515
|
}
|
|
1516
1516
|
}
|
|
1517
1517
|
);
|
|
1518
1518
|
}
|
|
1519
1519
|
), Ri = h.forwardRef(
|
|
1520
1520
|
(t, n) => {
|
|
1521
|
-
const { __scopeDialog: e, trapFocus: i, onOpenAutoFocus: r, onCloseAutoFocus: o, ...s } = t, a =
|
|
1522
|
-
return No(), /* @__PURE__ */
|
|
1521
|
+
const { __scopeDialog: e, trapFocus: i, onOpenAutoFocus: r, onCloseAutoFocus: o, ...s } = t, a = te(ye, e), u = h.useRef(null), f = we(n, u);
|
|
1522
|
+
return No(), /* @__PURE__ */ E(pe, { children: [
|
|
1523
1523
|
/* @__PURE__ */ l(
|
|
1524
1524
|
ai,
|
|
1525
1525
|
{
|
|
@@ -1535,55 +1535,55 @@ var gs = h.forwardRef(
|
|
|
1535
1535
|
id: a.contentId,
|
|
1536
1536
|
"aria-describedby": a.descriptionId,
|
|
1537
1537
|
"aria-labelledby": a.titleId,
|
|
1538
|
-
"data-state":
|
|
1538
|
+
"data-state": un(a.open),
|
|
1539
1539
|
...s,
|
|
1540
|
-
ref:
|
|
1540
|
+
ref: f,
|
|
1541
1541
|
onDismiss: () => a.onOpenChange(!1)
|
|
1542
1542
|
}
|
|
1543
1543
|
)
|
|
1544
1544
|
}
|
|
1545
1545
|
),
|
|
1546
|
-
/* @__PURE__ */
|
|
1546
|
+
/* @__PURE__ */ E(pe, { children: [
|
|
1547
1547
|
/* @__PURE__ */ l(xs, { titleId: a.titleId }),
|
|
1548
|
-
/* @__PURE__ */ l(Cs, { contentRef:
|
|
1548
|
+
/* @__PURE__ */ l(Cs, { contentRef: u, descriptionId: a.descriptionId })
|
|
1549
1549
|
] })
|
|
1550
1550
|
] });
|
|
1551
1551
|
}
|
|
1552
|
-
),
|
|
1552
|
+
), dn = "DialogTitle", ys = h.forwardRef(
|
|
1553
1553
|
(t, n) => {
|
|
1554
|
-
const { __scopeDialog: e, ...i } = t, r =
|
|
1555
|
-
return /* @__PURE__ */ l(
|
|
1554
|
+
const { __scopeDialog: e, ...i } = t, r = te(dn, e);
|
|
1555
|
+
return /* @__PURE__ */ l(ce.h2, { id: r.titleId, ...i, ref: n });
|
|
1556
1556
|
}
|
|
1557
1557
|
);
|
|
1558
|
-
ys.displayName =
|
|
1558
|
+
ys.displayName = dn;
|
|
1559
1559
|
var Fi = "DialogDescription", bs = h.forwardRef(
|
|
1560
1560
|
(t, n) => {
|
|
1561
|
-
const { __scopeDialog: e, ...i } = t, r =
|
|
1562
|
-
return /* @__PURE__ */ l(
|
|
1561
|
+
const { __scopeDialog: e, ...i } = t, r = te(Fi, e);
|
|
1562
|
+
return /* @__PURE__ */ l(ce.p, { id: r.descriptionId, ...i, ref: n });
|
|
1563
1563
|
}
|
|
1564
1564
|
);
|
|
1565
1565
|
bs.displayName = Fi;
|
|
1566
1566
|
var Li = "DialogClose", Di = h.forwardRef(
|
|
1567
1567
|
(t, n) => {
|
|
1568
|
-
const { __scopeDialog: e, ...i } = t, r =
|
|
1568
|
+
const { __scopeDialog: e, ...i } = t, r = te(Li, e);
|
|
1569
1569
|
return /* @__PURE__ */ l(
|
|
1570
|
-
|
|
1570
|
+
ce.button,
|
|
1571
1571
|
{
|
|
1572
1572
|
type: "button",
|
|
1573
1573
|
...i,
|
|
1574
1574
|
ref: n,
|
|
1575
|
-
onClick:
|
|
1575
|
+
onClick: fe(t.onClick, () => r.onOpenChange(!1))
|
|
1576
1576
|
}
|
|
1577
1577
|
);
|
|
1578
1578
|
}
|
|
1579
1579
|
);
|
|
1580
1580
|
Di.displayName = Li;
|
|
1581
|
-
function
|
|
1581
|
+
function un(t) {
|
|
1582
1582
|
return t ? "open" : "closed";
|
|
1583
1583
|
}
|
|
1584
1584
|
var Ai = "DialogTitleWarning", [dl, Pi] = Gr(Ai, {
|
|
1585
1585
|
contentName: ye,
|
|
1586
|
-
titleName:
|
|
1586
|
+
titleName: dn,
|
|
1587
1587
|
docsSlug: "dialog"
|
|
1588
1588
|
}), xs = ({ titleId: t }) => {
|
|
1589
1589
|
const n = Pi(Ai), e = `\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
|
|
@@ -1602,13 +1602,13 @@ For more information, see https://radix-ui.com/primitives/docs/components/${n.do
|
|
|
1602
1602
|
n && r && (document.getElementById(n) || console.warn(i));
|
|
1603
1603
|
}, [i, t, n]), null;
|
|
1604
1604
|
}, Oi = wi, Es = Ei, Mi = Si, ki = Ni, zi = Ti, _i = Di;
|
|
1605
|
-
const
|
|
1606
|
-
const { file: n, onClose: e } = t, i =
|
|
1605
|
+
const Bi = P((t) => {
|
|
1606
|
+
const { file: n, onClose: e } = t, i = bt(null), r = R(() => {
|
|
1607
1607
|
var a;
|
|
1608
1608
|
if (!i.current) return;
|
|
1609
1609
|
const s = document.createElement("canvas");
|
|
1610
|
-
s.width = i.current.width, s.height = i.current.height, (a = s.getContext("2d")) == null || a.drawImage(i.current, 0, 0, i.current.width, i.current.height), s.toBlob((
|
|
1611
|
-
|
|
1610
|
+
s.width = i.current.width, s.height = i.current.height, (a = s.getContext("2d")) == null || a.drawImage(i.current, 0, 0, i.current.width, i.current.height), s.toBlob((u) => {
|
|
1611
|
+
u && navigator.clipboard.write([new ClipboardItem({ "image/png": u })]);
|
|
1612
1612
|
}, "image/png");
|
|
1613
1613
|
}, []), o = R(() => {
|
|
1614
1614
|
Yn(n, n.name);
|
|
@@ -1618,30 +1618,30 @@ const $i = P((t) => {
|
|
|
1618
1618
|
{
|
|
1619
1619
|
className: "bg-(--color-background) fixed inset-0 data-[state='open']:fade-in-0 data-[state='open']:zoom-in-95 data-[state='closed']:animate-out data-[state='closed']:fade-out-0 data-[state='closed']:zoom-out-95 data-[state='open']:animate-in",
|
|
1620
1620
|
"data-floating-content": "",
|
|
1621
|
-
children: /* @__PURE__ */
|
|
1621
|
+
children: /* @__PURE__ */ E(
|
|
1622
1622
|
zi,
|
|
1623
1623
|
{
|
|
1624
1624
|
className: "absolute inset-0 py-12",
|
|
1625
1625
|
"data-floating-content": "",
|
|
1626
1626
|
onOpenAutoFocus: (s) => s.preventDefault(),
|
|
1627
1627
|
children: [
|
|
1628
|
-
/* @__PURE__ */
|
|
1629
|
-
|
|
1628
|
+
/* @__PURE__ */ E(
|
|
1629
|
+
Kt,
|
|
1630
1630
|
{
|
|
1631
1631
|
className: "flex gap-2 items-center top-0 absolute right-0 p-2",
|
|
1632
1632
|
accentColor: "base",
|
|
1633
1633
|
variant: "ghost",
|
|
1634
1634
|
children: [
|
|
1635
|
-
/* @__PURE__ */
|
|
1636
|
-
/* @__PURE__ */ l(Ee.Trigger, { asChild: !0, children: /* @__PURE__ */ l(
|
|
1635
|
+
/* @__PURE__ */ E(Ee.Root, { children: [
|
|
1636
|
+
/* @__PURE__ */ l(Ee.Trigger, { asChild: !0, children: /* @__PURE__ */ l(J, { onClick: r, "aria-label": "copy to clipboard", children: /* @__PURE__ */ l(L, { icon: "RiFileCopyLine" }) }) }),
|
|
1637
1637
|
/* @__PURE__ */ l(Ee.Content, { size: "sm", children: "Copy" })
|
|
1638
1638
|
] }),
|
|
1639
|
-
/* @__PURE__ */
|
|
1640
|
-
/* @__PURE__ */ l(Ee.Trigger, { asChild: !0, children: /* @__PURE__ */ l(
|
|
1639
|
+
/* @__PURE__ */ E(Ee.Root, { children: [
|
|
1640
|
+
/* @__PURE__ */ l(Ee.Trigger, { asChild: !0, children: /* @__PURE__ */ l(J, { onClick: o, "aria-label": "download", children: /* @__PURE__ */ l(L, { icon: "RiDownload2Line" }) }) }),
|
|
1641
1641
|
/* @__PURE__ */ l(Ee.Content, { size: "sm", children: "Download" })
|
|
1642
1642
|
] }),
|
|
1643
1643
|
/* @__PURE__ */ l(jn, { orientation: "vertical", size: "sm" }),
|
|
1644
|
-
/* @__PURE__ */ l(_i, { asChild: !0, children: /* @__PURE__ */ l(
|
|
1644
|
+
/* @__PURE__ */ l(_i, { asChild: !0, children: /* @__PURE__ */ l(J, { onClick: e, "aria-label": "close", children: /* @__PURE__ */ l(L, { icon: "RiCloseLine" }) }) })
|
|
1645
1645
|
]
|
|
1646
1646
|
}
|
|
1647
1647
|
),
|
|
@@ -1660,92 +1660,92 @@ const $i = P((t) => {
|
|
|
1660
1660
|
}
|
|
1661
1661
|
) }) });
|
|
1662
1662
|
});
|
|
1663
|
-
|
|
1663
|
+
Bi.displayName = "ImageViewer";
|
|
1664
1664
|
const Is = P((t) => {
|
|
1665
|
-
const { children: n } = t, [e, i] =
|
|
1665
|
+
const { children: n } = t, [e, i] = K(null), r = R(() => {
|
|
1666
1666
|
i(null);
|
|
1667
1667
|
}, []), o = R(
|
|
1668
|
-
(
|
|
1669
|
-
i(
|
|
1668
|
+
(u) => {
|
|
1669
|
+
i(u(r));
|
|
1670
1670
|
},
|
|
1671
1671
|
[r]
|
|
1672
1672
|
), s = R(() => {
|
|
1673
1673
|
e && (e.onClose && e.onClose(), r());
|
|
1674
1674
|
}, [r, e]), a = O(() => o, [o]);
|
|
1675
|
-
return /* @__PURE__ */
|
|
1675
|
+
return /* @__PURE__ */ E(ii.Provider, { value: a, children: [
|
|
1676
1676
|
n,
|
|
1677
|
-
e && /* @__PURE__ */ l(
|
|
1677
|
+
e && /* @__PURE__ */ l(Bi, { file: e.file, onClose: s })
|
|
1678
1678
|
] });
|
|
1679
1679
|
});
|
|
1680
1680
|
Is.displayName = "FileViewerProvider";
|
|
1681
|
-
const
|
|
1682
|
-
const { className: n, label: e, children: i, severity: r, inputId: o, labelId: s, image: a } = t, [
|
|
1683
|
-
|
|
1684
|
-
a instanceof Promise ? a.then(
|
|
1681
|
+
const ne = (t) => {
|
|
1682
|
+
const { className: n, label: e, children: i, severity: r, inputId: o, labelId: s, image: a } = t, [u, f] = K(void 0), m = sn(), d = r ? ge[r] : "base";
|
|
1683
|
+
H(() => {
|
|
1684
|
+
a instanceof Promise ? a.then(f).catch(console.error) : f(a);
|
|
1685
1685
|
}, [a]);
|
|
1686
|
-
const p =
|
|
1687
|
-
|
|
1688
|
-
file:
|
|
1686
|
+
const p = u ? URL.createObjectURL(u) : void 0, b = R(() => {
|
|
1687
|
+
u && m(() => ({
|
|
1688
|
+
file: u
|
|
1689
1689
|
}));
|
|
1690
|
-
}, [
|
|
1691
|
-
return /* @__PURE__ */
|
|
1692
|
-
|
|
1690
|
+
}, [m, u]);
|
|
1691
|
+
return /* @__PURE__ */ E("div", { className: "flex flex-col gap-1", children: [
|
|
1692
|
+
u && /* @__PURE__ */ l(
|
|
1693
1693
|
"img",
|
|
1694
1694
|
{
|
|
1695
1695
|
className: "h-[100px] w-full min-w-[300px] cursor-pointer rounded-md object-cover",
|
|
1696
1696
|
src: p,
|
|
1697
|
-
alt:
|
|
1697
|
+
alt: u.name,
|
|
1698
1698
|
onClick: b
|
|
1699
1699
|
}
|
|
1700
1700
|
),
|
|
1701
|
-
/* @__PURE__ */ l("label", { className: je(n, "flex flex-col gap-1 w-max max-w-full"), htmlFor: o, children: /* @__PURE__ */ l(
|
|
1701
|
+
/* @__PURE__ */ l("label", { className: je(n, "flex flex-col gap-1 w-max max-w-full"), htmlFor: o, children: /* @__PURE__ */ l(ae, { accentColor: d, size: "sm", id: s, weight: "medium", className: "text-wrap", children: e }) }),
|
|
1702
1702
|
i
|
|
1703
1703
|
] });
|
|
1704
|
-
},
|
|
1704
|
+
}, ie = (t) => {
|
|
1705
1705
|
const { children: n, ...e } = t;
|
|
1706
1706
|
return /* @__PURE__ */ l(ni, { ...e, children: n });
|
|
1707
1707
|
}, Vi = P((t) => {
|
|
1708
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, helpText: a, label:
|
|
1709
|
-
(
|
|
1710
|
-
y(
|
|
1708
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, helpText: a, label: u, fieldProps: f }, m] = Z(t), d = o ? null : a, p = o ? "" : u, { name: b, onChange: y, onBlur: c } = f, v = `${n}-droppable`, { disabled: w } = m, C = f.value ?? nn, [g, S] = K(""), [x, F] = K(""), N = x || d, T = R(
|
|
1709
|
+
(z) => {
|
|
1710
|
+
y(z), c(z);
|
|
1711
1711
|
},
|
|
1712
1712
|
[y, c]
|
|
1713
|
-
),
|
|
1714
|
-
(
|
|
1715
|
-
|
|
1713
|
+
), D = R(
|
|
1714
|
+
(z) => {
|
|
1715
|
+
C && C.findIndex((Y) => Y === z.target.value.trim()) >= 0 ? F("All options must be unique") : z.target.value ? F("") : F("Option cannot be empty"), S(z.target.value);
|
|
1716
1716
|
},
|
|
1717
|
-
[S,
|
|
1718
|
-
),
|
|
1719
|
-
if (
|
|
1717
|
+
[S, C]
|
|
1718
|
+
), M = R(() => {
|
|
1719
|
+
if (x) return;
|
|
1720
1720
|
if (!g.trim()) {
|
|
1721
1721
|
F("Option cannot be empty");
|
|
1722
1722
|
return;
|
|
1723
1723
|
}
|
|
1724
|
-
const
|
|
1725
|
-
T([...
|
|
1726
|
-
}, [g,
|
|
1727
|
-
(
|
|
1728
|
-
|
|
1724
|
+
const z = g.trim();
|
|
1725
|
+
T([...C, z]), S("");
|
|
1726
|
+
}, [g, x, T, C]), k = R(
|
|
1727
|
+
(z) => {
|
|
1728
|
+
z.key === "Enter" && (z.preventDefault(), M());
|
|
1729
1729
|
},
|
|
1730
|
-
[
|
|
1731
|
-
),
|
|
1732
|
-
(
|
|
1733
|
-
T(dt(
|
|
1730
|
+
[M]
|
|
1731
|
+
), V = R(
|
|
1732
|
+
(z) => {
|
|
1733
|
+
T(dt(C, z));
|
|
1734
1734
|
},
|
|
1735
|
-
[
|
|
1735
|
+
[C, T]
|
|
1736
1736
|
), X = R(
|
|
1737
|
-
(
|
|
1738
|
-
if (!
|
|
1739
|
-
const Y =
|
|
1740
|
-
T(Mt(
|
|
1737
|
+
(z) => {
|
|
1738
|
+
if (!z.destination) return;
|
|
1739
|
+
const Y = z.source.index, Ce = z.destination.index;
|
|
1740
|
+
T(Mt(C, Y, Ce));
|
|
1741
1741
|
},
|
|
1742
|
-
[T,
|
|
1743
|
-
),
|
|
1744
|
-
c(
|
|
1745
|
-
}, [c,
|
|
1746
|
-
return /* @__PURE__ */ l(Xn, { onDragEnd: X, children: /* @__PURE__ */
|
|
1747
|
-
/* @__PURE__ */ l(
|
|
1748
|
-
|
|
1742
|
+
[T, C]
|
|
1743
|
+
), le = R(() => {
|
|
1744
|
+
c(C);
|
|
1745
|
+
}, [c, C]);
|
|
1746
|
+
return /* @__PURE__ */ l(Xn, { onDragEnd: X, children: /* @__PURE__ */ E("div", { className: "flex flex-col gap-2", children: [
|
|
1747
|
+
/* @__PURE__ */ l(ie, { helpText: N, severity: r, children: /* @__PURE__ */ l(
|
|
1748
|
+
ne,
|
|
1749
1749
|
{
|
|
1750
1750
|
size: i,
|
|
1751
1751
|
severity: r,
|
|
@@ -1753,54 +1753,54 @@ const te = (t) => {
|
|
|
1753
1753
|
labelId: e,
|
|
1754
1754
|
label: p,
|
|
1755
1755
|
image: o ? void 0 : s.image,
|
|
1756
|
-
children: (!w ||
|
|
1757
|
-
/* @__PURE__ */ l(
|
|
1758
|
-
|
|
1756
|
+
children: (!w || C.length === 0) && /* @__PURE__ */ E("div", { className: "flex gap-2", children: [
|
|
1757
|
+
/* @__PURE__ */ l(ee.Root, { className: "grow", accentColor: "base", variant: "surface", size: "sm", children: /* @__PURE__ */ l(
|
|
1758
|
+
ee.Field,
|
|
1759
1759
|
{
|
|
1760
1760
|
value: g,
|
|
1761
|
-
onChange:
|
|
1762
|
-
onKeyDown:
|
|
1761
|
+
onChange: D,
|
|
1762
|
+
onKeyDown: k,
|
|
1763
1763
|
id: n,
|
|
1764
1764
|
placeholder: s.placeholder,
|
|
1765
|
-
onBlur:
|
|
1765
|
+
onBlur: le,
|
|
1766
1766
|
name: b,
|
|
1767
|
-
...
|
|
1767
|
+
...m
|
|
1768
1768
|
}
|
|
1769
1769
|
) }),
|
|
1770
1770
|
/* @__PURE__ */ l(
|
|
1771
|
-
|
|
1771
|
+
J,
|
|
1772
1772
|
{
|
|
1773
1773
|
size: "sm",
|
|
1774
1774
|
accentColor: "base",
|
|
1775
1775
|
variant: "soft",
|
|
1776
1776
|
type: "button",
|
|
1777
1777
|
"aria-label": "Add option",
|
|
1778
|
-
disabled: !!
|
|
1779
|
-
onClick:
|
|
1778
|
+
disabled: !!x || w,
|
|
1779
|
+
onClick: M,
|
|
1780
1780
|
children: /* @__PURE__ */ l(L, { icon: "RiAddLine" })
|
|
1781
1781
|
}
|
|
1782
1782
|
)
|
|
1783
1783
|
] })
|
|
1784
1784
|
}
|
|
1785
1785
|
) }),
|
|
1786
|
-
/* @__PURE__ */ l(
|
|
1786
|
+
/* @__PURE__ */ l(Qt, { droppableId: v, children: (z) => /* @__PURE__ */ E(
|
|
1787
1787
|
"div",
|
|
1788
1788
|
{
|
|
1789
1789
|
className: "flex flex-col",
|
|
1790
|
-
...
|
|
1791
|
-
ref:
|
|
1790
|
+
...z.droppableProps,
|
|
1791
|
+
ref: z.innerRef,
|
|
1792
1792
|
children: [
|
|
1793
|
-
|
|
1794
|
-
|
|
1793
|
+
C.map((Y, Ce) => /* @__PURE__ */ l(
|
|
1794
|
+
en,
|
|
1795
1795
|
{
|
|
1796
1796
|
draggableId: `${Y}-draggable`,
|
|
1797
1797
|
index: Ce,
|
|
1798
1798
|
isDragDisabled: w,
|
|
1799
|
-
children: ({ draggableProps:
|
|
1799
|
+
children: ({ draggableProps: de, dragHandleProps: Et, innerRef: Ye }) => /* @__PURE__ */ E(
|
|
1800
1800
|
Ot,
|
|
1801
1801
|
{
|
|
1802
1802
|
...Et,
|
|
1803
|
-
...
|
|
1803
|
+
...de,
|
|
1804
1804
|
ref: Ye,
|
|
1805
1805
|
className: "mb-1 flex items-center justify-between gap-2",
|
|
1806
1806
|
accentColor: "base",
|
|
@@ -1813,7 +1813,7 @@ const te = (t) => {
|
|
|
1813
1813
|
children: typeof Y == "object" && "label" in Y ? Y.label : Y
|
|
1814
1814
|
}),
|
|
1815
1815
|
/* @__PURE__ */ l(
|
|
1816
|
-
|
|
1816
|
+
J,
|
|
1817
1817
|
{
|
|
1818
1818
|
size: "xs",
|
|
1819
1819
|
variant: "ghost",
|
|
@@ -1822,7 +1822,7 @@ const te = (t) => {
|
|
|
1822
1822
|
accentColor: "base",
|
|
1823
1823
|
disabled: w,
|
|
1824
1824
|
onClick: () => {
|
|
1825
|
-
|
|
1825
|
+
V(Ce);
|
|
1826
1826
|
},
|
|
1827
1827
|
children: /* @__PURE__ */ l(L, { icon: "RiCloseLargeLine" })
|
|
1828
1828
|
}
|
|
@@ -1833,7 +1833,7 @@ const te = (t) => {
|
|
|
1833
1833
|
},
|
|
1834
1834
|
Y
|
|
1835
1835
|
)),
|
|
1836
|
-
|
|
1836
|
+
z.placeholder
|
|
1837
1837
|
]
|
|
1838
1838
|
}
|
|
1839
1839
|
) })
|
|
@@ -1841,11 +1841,11 @@ const te = (t) => {
|
|
|
1841
1841
|
});
|
|
1842
1842
|
Vi.displayName = "MultiStringInput";
|
|
1843
1843
|
const Ss = {
|
|
1844
|
-
...
|
|
1844
|
+
...Q,
|
|
1845
1845
|
type: "multi-string",
|
|
1846
1846
|
minimum_length: 0,
|
|
1847
1847
|
maximum_length: null
|
|
1848
|
-
}, Re = class Re extends
|
|
1848
|
+
}, Re = class Re extends W {
|
|
1849
1849
|
constructor(e) {
|
|
1850
1850
|
const { minimum_length: i, maximum_length: r, placeholder: o, ...s } = e;
|
|
1851
1851
|
super({ ...s, type: "multi-string" });
|
|
@@ -1888,8 +1888,8 @@ const Ss = {
|
|
|
1888
1888
|
}
|
|
1889
1889
|
};
|
|
1890
1890
|
I(Re, "fieldTypeName", "Multi-string"), I(Re, "fieldTypeDescription", "Allows the user to provide multiple unique strings."), I(Re, "Icon", vr);
|
|
1891
|
-
let
|
|
1892
|
-
class
|
|
1891
|
+
let qe = Re;
|
|
1892
|
+
class $i extends W {
|
|
1893
1893
|
constructor(e) {
|
|
1894
1894
|
const { placeholder: i = "", ...r } = e;
|
|
1895
1895
|
super(r);
|
|
@@ -1914,7 +1914,7 @@ class Bi extends U {
|
|
|
1914
1914
|
const i = e && `${e}.`;
|
|
1915
1915
|
return [
|
|
1916
1916
|
{
|
|
1917
|
-
field: new
|
|
1917
|
+
field: new qe({
|
|
1918
1918
|
label: "Options",
|
|
1919
1919
|
description: "List possible options for the user to select from.",
|
|
1920
1920
|
required: !0,
|
|
@@ -1927,16 +1927,16 @@ class Bi extends U {
|
|
|
1927
1927
|
}
|
|
1928
1928
|
}
|
|
1929
1929
|
const Ui = P((t) => {
|
|
1930
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, helpText: a, label:
|
|
1930
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, helpText: a, label: u, fieldProps: f }, m] = Z(t), { name: d, onBlur: p, onChange: b, value: y } = f, c = o ? null : a, v = o ? "" : u, w = R(
|
|
1931
1931
|
(g) => {
|
|
1932
1932
|
b(!!g), p(!!g);
|
|
1933
1933
|
},
|
|
1934
1934
|
[p, b]
|
|
1935
|
-
),
|
|
1935
|
+
), C = R(() => {
|
|
1936
1936
|
p(y);
|
|
1937
1937
|
}, [p, y]);
|
|
1938
|
-
return /* @__PURE__ */ l(
|
|
1939
|
-
|
|
1938
|
+
return /* @__PURE__ */ l(ie, { helpText: c, severity: r, children: /* @__PURE__ */ l(
|
|
1939
|
+
ne,
|
|
1940
1940
|
{
|
|
1941
1941
|
size: i,
|
|
1942
1942
|
severity: r,
|
|
@@ -1949,14 +1949,14 @@ const Ui = P((t) => {
|
|
|
1949
1949
|
at.Root,
|
|
1950
1950
|
{
|
|
1951
1951
|
id: n,
|
|
1952
|
-
name:
|
|
1952
|
+
name: d,
|
|
1953
1953
|
checked: y ?? !1,
|
|
1954
1954
|
onCheckedChange: w,
|
|
1955
|
-
onBlur:
|
|
1955
|
+
onBlur: C,
|
|
1956
1956
|
size: "sm",
|
|
1957
1957
|
accentColor: "primary",
|
|
1958
1958
|
variant: "surface",
|
|
1959
|
-
...
|
|
1959
|
+
...m,
|
|
1960
1960
|
children: /* @__PURE__ */ l(at.Indicator, { children: /* @__PURE__ */ l(L, { icon: "RiCheckLine" }) })
|
|
1961
1961
|
}
|
|
1962
1962
|
)
|
|
@@ -1965,9 +1965,9 @@ const Ui = P((t) => {
|
|
|
1965
1965
|
});
|
|
1966
1966
|
Ui.displayName = "BooleanInput";
|
|
1967
1967
|
const Ns = {
|
|
1968
|
-
...
|
|
1968
|
+
...Q,
|
|
1969
1969
|
type: "boolean"
|
|
1970
|
-
}, Fe = class Fe extends
|
|
1970
|
+
}, Fe = class Fe extends W {
|
|
1971
1971
|
constructor(e) {
|
|
1972
1972
|
super({ ...e, type: "boolean" });
|
|
1973
1973
|
I(this, "onlyValidateAfterTouched", !1);
|
|
@@ -1988,12 +1988,12 @@ const Ns = {
|
|
|
1988
1988
|
}
|
|
1989
1989
|
};
|
|
1990
1990
|
I(Fe, "fieldTypeName", "Checkbox"), I(Fe, "fieldTypeDescription", "Perfect for both optional and required yes/no questions."), I(Fe, "Icon", yr);
|
|
1991
|
-
let
|
|
1991
|
+
let He = Fe;
|
|
1992
1992
|
const Ts = {
|
|
1993
|
-
...
|
|
1993
|
+
...Q,
|
|
1994
1994
|
type: "custom"
|
|
1995
1995
|
};
|
|
1996
|
-
class ht extends
|
|
1996
|
+
class ht extends W {
|
|
1997
1997
|
constructor(e, i) {
|
|
1998
1998
|
super({ ...e, type: "custom" });
|
|
1999
1999
|
I(this, "Component");
|
|
@@ -2011,19 +2011,19 @@ class ht extends U {
|
|
|
2011
2011
|
}
|
|
2012
2012
|
I(ht, "fieldTypeName", "Custom"), I(ht, "fieldTypeDescription", "Allows re-rendering of field already in the form");
|
|
2013
2013
|
const Wi = P((t) => {
|
|
2014
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, helpText: a, label:
|
|
2015
|
-
(
|
|
2016
|
-
p(
|
|
2014
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, helpText: a, label: u, fieldProps: f }, m] = Z(t), { name: d, onChange: p, onBlur: b } = f, [y, c] = K(!1), v = o ? null : a, w = o ? "" : u, C = f.value ? new Date(f.value) : void 0, g = R(
|
|
2015
|
+
(x) => {
|
|
2016
|
+
p(x == null ? void 0 : x.toISOString()), c(!1);
|
|
2017
2017
|
},
|
|
2018
2018
|
[p]
|
|
2019
2019
|
), S = R(
|
|
2020
|
-
(
|
|
2021
|
-
c(
|
|
2020
|
+
(x) => {
|
|
2021
|
+
c(x), x || b(f.value);
|
|
2022
2022
|
},
|
|
2023
|
-
[
|
|
2023
|
+
[f.value, b]
|
|
2024
2024
|
);
|
|
2025
|
-
return /* @__PURE__ */ l(
|
|
2026
|
-
|
|
2025
|
+
return /* @__PURE__ */ l(ie, { helpText: v, severity: r, children: /* @__PURE__ */ l(
|
|
2026
|
+
ne,
|
|
2027
2027
|
{
|
|
2028
2028
|
size: i,
|
|
2029
2029
|
severity: r,
|
|
@@ -2031,20 +2031,20 @@ const Wi = P((t) => {
|
|
|
2031
2031
|
labelId: e,
|
|
2032
2032
|
label: w,
|
|
2033
2033
|
image: o ? void 0 : s.image,
|
|
2034
|
-
children: /* @__PURE__ */
|
|
2035
|
-
/* @__PURE__ */ l(
|
|
2036
|
-
|
|
2034
|
+
children: /* @__PURE__ */ E(Be.Root, { open: y, onOpenChange: S, children: [
|
|
2035
|
+
/* @__PURE__ */ l(Be.Trigger, { asChild: !0, children: /* @__PURE__ */ E(
|
|
2036
|
+
G,
|
|
2037
2037
|
{
|
|
2038
2038
|
id: n,
|
|
2039
|
-
name:
|
|
2039
|
+
name: d,
|
|
2040
2040
|
type: "button",
|
|
2041
2041
|
className: "!justify-between",
|
|
2042
2042
|
accentColor: "base",
|
|
2043
2043
|
variant: "surface",
|
|
2044
2044
|
size: "sm",
|
|
2045
|
-
...
|
|
2045
|
+
...m,
|
|
2046
2046
|
children: [
|
|
2047
|
-
|
|
2047
|
+
C ? C.toLocaleString(void 0, {
|
|
2048
2048
|
year: "numeric",
|
|
2049
2049
|
month: "2-digit",
|
|
2050
2050
|
day: "2-digit"
|
|
@@ -2053,13 +2053,13 @@ const Wi = P((t) => {
|
|
|
2053
2053
|
]
|
|
2054
2054
|
}
|
|
2055
2055
|
) }),
|
|
2056
|
-
/* @__PURE__ */ l(
|
|
2056
|
+
/* @__PURE__ */ l(Be.Content, { align: "start", children: /* @__PURE__ */ l(
|
|
2057
2057
|
fr,
|
|
2058
2058
|
{
|
|
2059
2059
|
required: !1,
|
|
2060
2060
|
mode: "single",
|
|
2061
2061
|
variant: "solid",
|
|
2062
|
-
selected:
|
|
2062
|
+
selected: C,
|
|
2063
2063
|
onSelect: g
|
|
2064
2064
|
}
|
|
2065
2065
|
) })
|
|
@@ -2069,9 +2069,9 @@ const Wi = P((t) => {
|
|
|
2069
2069
|
});
|
|
2070
2070
|
Wi.displayName = "DateInput";
|
|
2071
2071
|
const Rs = {
|
|
2072
|
-
...
|
|
2072
|
+
...Q,
|
|
2073
2073
|
type: "date"
|
|
2074
|
-
}, Le = class Le extends
|
|
2074
|
+
}, Le = class Le extends W {
|
|
2075
2075
|
constructor(e) {
|
|
2076
2076
|
super({ ...e, type: "date" });
|
|
2077
2077
|
I(this, "onlyValidateAfterTouched", !1);
|
|
@@ -2088,22 +2088,22 @@ const Rs = {
|
|
|
2088
2088
|
}
|
|
2089
2089
|
};
|
|
2090
2090
|
I(Le, "fieldTypeName", "Date"), I(Le, "fieldTypeDescription", "Allows specifying a date."), I(Le, "Icon", br);
|
|
2091
|
-
let
|
|
2091
|
+
let Bt = Le;
|
|
2092
2092
|
const ji = P((t) => {
|
|
2093
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, helpText: a, label:
|
|
2093
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, helpText: a, label: u, fieldProps: f }, m] = Z(t), { name: d, onChange: p, onBlur: b } = f, y = o ? null : a, c = o ? "" : u, v = f.value ?? nn, w = R(
|
|
2094
2094
|
(g) => {
|
|
2095
2095
|
const S = g.length > 0 ? g : void 0;
|
|
2096
2096
|
p(S), b(S);
|
|
2097
2097
|
},
|
|
2098
2098
|
[b, p]
|
|
2099
|
-
),
|
|
2099
|
+
), C = R(
|
|
2100
2100
|
(g) => {
|
|
2101
2101
|
g || b(v);
|
|
2102
2102
|
},
|
|
2103
2103
|
[v, b]
|
|
2104
2104
|
);
|
|
2105
|
-
return /* @__PURE__ */ l(
|
|
2106
|
-
|
|
2105
|
+
return /* @__PURE__ */ l(ie, { helpText: y, severity: r, children: /* @__PURE__ */ l(
|
|
2106
|
+
ne,
|
|
2107
2107
|
{
|
|
2108
2108
|
size: i,
|
|
2109
2109
|
severity: r,
|
|
@@ -2111,31 +2111,31 @@ const ji = P((t) => {
|
|
|
2111
2111
|
labelId: e,
|
|
2112
2112
|
label: c,
|
|
2113
2113
|
image: o ? void 0 : s.image,
|
|
2114
|
-
children: /* @__PURE__ */
|
|
2115
|
-
/* @__PURE__ */ l(
|
|
2116
|
-
|
|
2114
|
+
children: /* @__PURE__ */ E(B.Root, { onOpenChange: C, align: "start", children: [
|
|
2115
|
+
/* @__PURE__ */ l(B.ClickTrigger, { children: /* @__PURE__ */ E(
|
|
2116
|
+
G,
|
|
2117
2117
|
{
|
|
2118
2118
|
id: n,
|
|
2119
|
-
name:
|
|
2119
|
+
name: d,
|
|
2120
2120
|
className: "!justify-between",
|
|
2121
2121
|
variant: "surface",
|
|
2122
2122
|
type: "button",
|
|
2123
2123
|
size: "sm",
|
|
2124
2124
|
accentColor: "base",
|
|
2125
|
-
...
|
|
2125
|
+
...m,
|
|
2126
2126
|
children: [
|
|
2127
2127
|
/* @__PURE__ */ l("span", { className: "truncate", children: v && v.length > 0 ? v.join(", ") : s.placeholder }),
|
|
2128
2128
|
/* @__PURE__ */ l(L, { icon: "RiArrowDownSLine" })
|
|
2129
2129
|
]
|
|
2130
2130
|
}
|
|
2131
2131
|
) }),
|
|
2132
|
-
/* @__PURE__ */ l(
|
|
2133
|
-
/* @__PURE__ */
|
|
2134
|
-
/* @__PURE__ */ l(
|
|
2132
|
+
/* @__PURE__ */ l(B.Content, { children: /* @__PURE__ */ l(B.Scroll, { children: /* @__PURE__ */ E(B.MultiSelectGroup, { values: v, onValuesChange: w, children: [
|
|
2133
|
+
/* @__PURE__ */ E(B.SelectAllItem, { children: [
|
|
2134
|
+
/* @__PURE__ */ l(B.CheckboxItemIndicator, { children: (g) => g ? /* @__PURE__ */ l(L, { icon: "RiSubtractLine" }) : /* @__PURE__ */ l(L, { icon: "RiCheckLine" }) }),
|
|
2135
2135
|
"Select all"
|
|
2136
2136
|
] }),
|
|
2137
|
-
s.options.map((g) => /* @__PURE__ */
|
|
2138
|
-
/* @__PURE__ */ l(
|
|
2137
|
+
s.options.map((g) => /* @__PURE__ */ E(B.MultiSelectItem, { value: g.value, children: [
|
|
2138
|
+
/* @__PURE__ */ l(B.SelectedIndicator, { children: /* @__PURE__ */ l(L, { icon: "RiCheckLine" }) }),
|
|
2139
2139
|
g.label
|
|
2140
2140
|
] }, g.value))
|
|
2141
2141
|
] }) }) })
|
|
@@ -2145,10 +2145,10 @@ const ji = P((t) => {
|
|
|
2145
2145
|
});
|
|
2146
2146
|
ji.displayName = "MultiSelectInput";
|
|
2147
2147
|
const Fs = {
|
|
2148
|
-
...
|
|
2148
|
+
...Q,
|
|
2149
2149
|
type: "multi-select",
|
|
2150
2150
|
options: []
|
|
2151
|
-
}, De = class De extends
|
|
2151
|
+
}, De = class De extends $i {
|
|
2152
2152
|
constructor(n) {
|
|
2153
2153
|
const { placeholder: e = "Select one or more...", ...i } = n;
|
|
2154
2154
|
super({ ...i, placeholder: e, type: "multi-select" });
|
|
@@ -2174,36 +2174,36 @@ I(De, "fieldTypeName", "Multi-select"), I(De, "fieldTypeDescription", "Allows th
|
|
|
2174
2174
|
let pt = De;
|
|
2175
2175
|
const qi = P((t) => {
|
|
2176
2176
|
const [
|
|
2177
|
-
{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, helpText: a, label:
|
|
2177
|
+
{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, helpText: a, label: u, fieldProps: f, touched: m, helpers: d },
|
|
2178
2178
|
p
|
|
2179
|
-
] =
|
|
2180
|
-
|
|
2179
|
+
] = Z(t), { name: b, onBlur: y, onChange: c, value: v } = f, w = o ? null : a, C = o ? "" : u, [g, S] = K(void 0);
|
|
2180
|
+
H(() => {
|
|
2181
2181
|
S(v);
|
|
2182
2182
|
}, [v]);
|
|
2183
|
-
const
|
|
2183
|
+
const x = R(
|
|
2184
2184
|
(N) => {
|
|
2185
|
-
const T = N.target.valueAsNumber,
|
|
2186
|
-
S(
|
|
2185
|
+
const T = N.target.valueAsNumber, D = Number.isNaN(T) ? void 0 : T;
|
|
2186
|
+
S(D), (m || !s.onlyValidateAfterTouched) && d.setError(s.getError(D));
|
|
2187
2187
|
},
|
|
2188
|
-
[s,
|
|
2188
|
+
[s, d, m]
|
|
2189
2189
|
), F = R(() => {
|
|
2190
2190
|
c(g), y(g);
|
|
2191
2191
|
}, [g, y, c]);
|
|
2192
|
-
return /* @__PURE__ */ l(
|
|
2193
|
-
|
|
2192
|
+
return /* @__PURE__ */ l(ie, { helpText: w, severity: r, children: /* @__PURE__ */ l(
|
|
2193
|
+
ne,
|
|
2194
2194
|
{
|
|
2195
2195
|
size: i,
|
|
2196
2196
|
severity: r,
|
|
2197
2197
|
inputId: n,
|
|
2198
2198
|
labelId: e,
|
|
2199
|
-
label:
|
|
2199
|
+
label: C,
|
|
2200
2200
|
image: o ? void 0 : s.image,
|
|
2201
|
-
children: /* @__PURE__ */ l(
|
|
2202
|
-
|
|
2201
|
+
children: /* @__PURE__ */ l(ee.Root, { accentColor: "base", variant: "surface", size: "sm", children: /* @__PURE__ */ l(
|
|
2202
|
+
ee.Field,
|
|
2203
2203
|
{
|
|
2204
2204
|
id: n,
|
|
2205
2205
|
name: b,
|
|
2206
|
-
onChange:
|
|
2206
|
+
onChange: x,
|
|
2207
2207
|
onBlur: F,
|
|
2208
2208
|
value: g ?? "",
|
|
2209
2209
|
type: "number",
|
|
@@ -2219,12 +2219,12 @@ const qi = P((t) => {
|
|
|
2219
2219
|
});
|
|
2220
2220
|
qi.displayName = "NumberInput";
|
|
2221
2221
|
const Ls = {
|
|
2222
|
-
...
|
|
2222
|
+
...Q,
|
|
2223
2223
|
type: "number",
|
|
2224
2224
|
minimum: Number.MIN_SAFE_INTEGER,
|
|
2225
2225
|
maximum: Number.MAX_SAFE_INTEGER,
|
|
2226
2226
|
integers: !1
|
|
2227
|
-
},
|
|
2227
|
+
}, zn = (t) => "fields" in t, re = class re extends W {
|
|
2228
2228
|
constructor(e) {
|
|
2229
2229
|
const {
|
|
2230
2230
|
minimum: i = Number.MIN_SAFE_INTEGER,
|
|
@@ -2244,7 +2244,7 @@ const Ls = {
|
|
|
2244
2244
|
const i = e && `${e}.`;
|
|
2245
2245
|
return [
|
|
2246
2246
|
{
|
|
2247
|
-
field: new
|
|
2247
|
+
field: new re({
|
|
2248
2248
|
label: "Minimum",
|
|
2249
2249
|
description: "Minimum value",
|
|
2250
2250
|
integers: !0,
|
|
@@ -2255,7 +2255,7 @@ const Ls = {
|
|
|
2255
2255
|
showDirectly: !1
|
|
2256
2256
|
},
|
|
2257
2257
|
{
|
|
2258
|
-
field: new
|
|
2258
|
+
field: new re({
|
|
2259
2259
|
label: "Maximum",
|
|
2260
2260
|
description: "Maximum value",
|
|
2261
2261
|
integers: !0,
|
|
@@ -2266,7 +2266,7 @@ const Ls = {
|
|
|
2266
2266
|
showDirectly: !1
|
|
2267
2267
|
},
|
|
2268
2268
|
{
|
|
2269
|
-
field: new
|
|
2269
|
+
field: new He({
|
|
2270
2270
|
label: "Integers",
|
|
2271
2271
|
description: "Whole numbers only",
|
|
2272
2272
|
required: !1,
|
|
@@ -2300,149 +2300,31 @@ const Ls = {
|
|
|
2300
2300
|
}
|
|
2301
2301
|
static deserialize(e) {
|
|
2302
2302
|
if (e.type !== "number") throw new Error("Type mismatch.");
|
|
2303
|
-
return new
|
|
2303
|
+
return new re(e);
|
|
2304
2304
|
}
|
|
2305
2305
|
getInput(e) {
|
|
2306
2306
|
return /* @__PURE__ */ l(qi, { field: this, ...e });
|
|
2307
2307
|
}
|
|
2308
2308
|
};
|
|
2309
|
-
I(
|
|
2310
|
-
const o =
|
|
2309
|
+
I(re, "fieldTypeName", "Number"), I(re, "fieldTypeDescription", "Allows specifying a number within a given range."), I(re, "Icon", wr), I(re, "_validateMin", (e) => (i, r) => {
|
|
2310
|
+
const o = zn(r) ? se(r, e) : r;
|
|
2311
2311
|
return typeof o.maximum == "number" && typeof i == "number" && o.maximum < i ? "Minimum cannot be greater than minimum." : null;
|
|
2312
|
-
}), I(
|
|
2313
|
-
const o =
|
|
2312
|
+
}), I(re, "_validateMax", (e) => (i, r) => {
|
|
2313
|
+
const o = zn(r) ? se(r, e) : r;
|
|
2314
2314
|
return typeof o.minimum == "number" && typeof i == "number" && o.minimum > i ? "Maximum cannot be less than minimum." : null;
|
|
2315
2315
|
});
|
|
2316
|
-
let be =
|
|
2316
|
+
let be = re;
|
|
2317
2317
|
const Hi = P((t) => {
|
|
2318
|
-
const [{ inputId: n, labelId: e,
|
|
2319
|
-
(F) => {
|
|
2320
|
-
b(F), v(!1);
|
|
2321
|
-
},
|
|
2322
|
-
[b]
|
|
2323
|
-
), S = R(() => {
|
|
2324
|
-
b("");
|
|
2325
|
-
}, [b]), C = R(
|
|
2326
|
-
(F) => {
|
|
2327
|
-
v(F), F || p(y);
|
|
2328
|
-
},
|
|
2329
|
-
[p, y]
|
|
2330
|
-
);
|
|
2331
|
-
return /* @__PURE__ */ l(ne, { helpText: w, severity: s, children: /* @__PURE__ */ x(
|
|
2332
|
-
te,
|
|
2333
|
-
{
|
|
2334
|
-
size: o,
|
|
2335
|
-
severity: s,
|
|
2336
|
-
inputId: n,
|
|
2337
|
-
labelId: e,
|
|
2338
|
-
label: E,
|
|
2339
|
-
image: a ? void 0 : m.image,
|
|
2340
|
-
className: "flex-col items-start justify-start gap-2",
|
|
2341
|
-
children: [
|
|
2342
|
-
/* @__PURE__ */ x("div", { className: "flex w-max items-center gap-1", children: [
|
|
2343
|
-
/* @__PURE__ */ x(Oi, { open: c, onOpenChange: C, children: [
|
|
2344
|
-
/* @__PURE__ */ l(Es, { asChild: !0, children: /* @__PURE__ */ x(
|
|
2345
|
-
H,
|
|
2346
|
-
{
|
|
2347
|
-
id: n,
|
|
2348
|
-
name: u,
|
|
2349
|
-
type: "button",
|
|
2350
|
-
variant: "soft",
|
|
2351
|
-
size: "sm",
|
|
2352
|
-
accentColor: "base",
|
|
2353
|
-
...f,
|
|
2354
|
-
children: [
|
|
2355
|
-
/* @__PURE__ */ l(L, { icon: "RiQrCodeLine" }),
|
|
2356
|
-
"Scan"
|
|
2357
|
-
]
|
|
2358
|
-
}
|
|
2359
|
-
) }),
|
|
2360
|
-
/* @__PURE__ */ x(Mi, { children: [
|
|
2361
|
-
/* @__PURE__ */ l(ki, { className: "light:bg-(--black-a6) fixed inset-0 dark:bg-(--black-a8)" }),
|
|
2362
|
-
/* @__PURE__ */ l(zi, { className: "fixed inset-0", children: /* @__PURE__ */ l(Gi, { onQrScan: g }) })
|
|
2363
|
-
] })
|
|
2364
|
-
] }),
|
|
2365
|
-
y && /* @__PURE__ */ l(L, { icon: "RiCheckLine", className: "align-bottom text-(--primary-a11)" })
|
|
2366
|
-
] }),
|
|
2367
|
-
!!y && /* @__PURE__ */ l(qe, { className: "max-w-full w-max", size: "sm", children: /* @__PURE__ */ x("div", { className: "max-w-full w-max flex justify-between gap-2", children: [
|
|
2368
|
-
/* @__PURE__ */ l("code", { className: "bg-(--base-a3) truncate text-sm", children: y }),
|
|
2369
|
-
/* @__PURE__ */ l(
|
|
2370
|
-
Q,
|
|
2371
|
-
{
|
|
2372
|
-
accentColor: "base",
|
|
2373
|
-
variant: "ghost",
|
|
2374
|
-
"aria-label": "delete",
|
|
2375
|
-
size: "sm",
|
|
2376
|
-
onClick: S,
|
|
2377
|
-
children: /* @__PURE__ */ l(L, { icon: "RiCloseLine" })
|
|
2378
|
-
}
|
|
2379
|
-
)
|
|
2380
|
-
] }) })
|
|
2381
|
-
]
|
|
2382
|
-
}
|
|
2383
|
-
) });
|
|
2384
|
-
});
|
|
2385
|
-
Hi.displayName = "QrInput";
|
|
2386
|
-
const Gi = P((t) => {
|
|
2387
|
-
const { onQrScan: n } = t, e = Xe(null), [i, r] = G(!1);
|
|
2388
|
-
return q(() => {
|
|
2389
|
-
if (!e.current) return;
|
|
2390
|
-
const o = new Mr(
|
|
2391
|
-
e.current,
|
|
2392
|
-
(s) => {
|
|
2393
|
-
const a = s.data;
|
|
2394
|
-
n(a), o.destroy();
|
|
2395
|
-
},
|
|
2396
|
-
{
|
|
2397
|
-
highlightCodeOutline: !0,
|
|
2398
|
-
highlightScanRegion: !0,
|
|
2399
|
-
maxScansPerSecond: 1
|
|
2400
|
-
}
|
|
2401
|
-
);
|
|
2402
|
-
r(!0), o.start().finally(() => {
|
|
2403
|
-
r(!1);
|
|
2404
|
-
});
|
|
2405
|
-
}, [n]), /* @__PURE__ */ x("div", { className: "relative flex h-full w-full flex-col justify-center gap-2 bg-(--color-background)", children: [
|
|
2406
|
-
/* @__PURE__ */ l("div", { className: "absolute top-0 flex w-full p-2", children: /* @__PURE__ */ l(_i, { asChild: !0, children: /* @__PURE__ */ l(Q, { "aria-label": "close", variant: "soft", accentColor: "base", children: /* @__PURE__ */ l(L, { icon: "RiCloseLine" }) }) }) }),
|
|
2407
|
-
/* @__PURE__ */ x("div", { className: "relative max-h-full max-w-full", children: [
|
|
2408
|
-
/* @__PURE__ */ l("video", { className: "size-full", ref: e }),
|
|
2409
|
-
i && /* @__PURE__ */ l("div", { className: "absolute inset-0 flex items-center justify-center bg-(--color-background)", children: /* @__PURE__ */ l(Kt, {}) })
|
|
2410
|
-
] })
|
|
2411
|
-
] });
|
|
2412
|
-
});
|
|
2413
|
-
Gi.displayName = "QrScanner";
|
|
2414
|
-
const Ds = {
|
|
2415
|
-
...Z,
|
|
2416
|
-
type: "qr"
|
|
2417
|
-
}, Ae = class Ae extends U {
|
|
2418
|
-
constructor(e) {
|
|
2419
|
-
super({ ...e, type: "qr" });
|
|
2420
|
-
I(this, "onlyValidateAfterTouched", !1);
|
|
2421
|
-
}
|
|
2422
|
-
serialize() {
|
|
2423
|
-
return super._serialize();
|
|
2424
|
-
}
|
|
2425
|
-
static deserialize(e) {
|
|
2426
|
-
if (e.type !== "qr") throw new Error("Type mismatch.");
|
|
2427
|
-
return new Ae(e);
|
|
2428
|
-
}
|
|
2429
|
-
getInput(e) {
|
|
2430
|
-
return /* @__PURE__ */ l(Hi, { ...e, field: this });
|
|
2431
|
-
}
|
|
2432
|
-
};
|
|
2433
|
-
I(Ae, "fieldTypeName", "QR"), I(Ae, "fieldTypeDescription", "Used for scanning/reading QR codes."), I(Ae, "Icon", Cr);
|
|
2434
|
-
let Vt = Ae;
|
|
2435
|
-
const Ki = P((t) => {
|
|
2436
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, helpText: a, label: m, fieldProps: d }, f] = J(t), { name: u, onChange: p, onBlur: b, value: y } = d, c = o ? null : a, v = o ? "" : m, w = R(
|
|
2318
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, helpText: a, label: u, fieldProps: f }, m] = Z(t), { name: d, onChange: p, onBlur: b, value: y } = f, c = o ? null : a, v = o ? "" : u, w = R(
|
|
2437
2319
|
(g) => {
|
|
2438
2320
|
p(g ?? void 0), b(g ?? void 0);
|
|
2439
2321
|
},
|
|
2440
2322
|
[b, p]
|
|
2441
|
-
),
|
|
2323
|
+
), C = R(() => {
|
|
2442
2324
|
p(void 0), b(void 0);
|
|
2443
2325
|
}, [b, p]);
|
|
2444
|
-
return /* @__PURE__ */ l(
|
|
2445
|
-
|
|
2326
|
+
return /* @__PURE__ */ l(ie, { helpText: c, severity: r, children: /* @__PURE__ */ l(
|
|
2327
|
+
ne,
|
|
2446
2328
|
{
|
|
2447
2329
|
size: i,
|
|
2448
2330
|
severity: r,
|
|
@@ -2450,27 +2332,27 @@ const Ki = P((t) => {
|
|
|
2450
2332
|
labelId: e,
|
|
2451
2333
|
label: v,
|
|
2452
2334
|
image: o ? void 0 : s.image,
|
|
2453
|
-
children: /* @__PURE__ */
|
|
2335
|
+
children: /* @__PURE__ */ E(
|
|
2454
2336
|
It.Root,
|
|
2455
2337
|
{
|
|
2456
2338
|
id: n,
|
|
2457
|
-
name:
|
|
2339
|
+
name: d,
|
|
2458
2340
|
className: "flex flex-col gap-1",
|
|
2459
2341
|
accentColor: "base",
|
|
2460
2342
|
variant: "surface",
|
|
2461
2343
|
size: "sm",
|
|
2462
2344
|
value: y ?? "",
|
|
2463
2345
|
onValueChange: w,
|
|
2464
|
-
...
|
|
2346
|
+
...m,
|
|
2465
2347
|
children: [
|
|
2466
|
-
s.options.map((g) => /* @__PURE__ */
|
|
2348
|
+
s.options.map((g) => /* @__PURE__ */ E("label", { className: "flex gap-2 items-center min-w-0", children: [
|
|
2467
2349
|
/* @__PURE__ */ l(It.Item, { value: g.value, children: /* @__PURE__ */ l(It.Indicator, { children: /* @__PURE__ */ l(L, { icon: "RiCircleFill" }) }) }, g.value),
|
|
2468
|
-
/* @__PURE__ */ l(
|
|
2350
|
+
/* @__PURE__ */ l(ae, { size: "sm", accentColor: "base", className: "truncate", children: g.label })
|
|
2469
2351
|
] })),
|
|
2470
|
-
!!y && /* @__PURE__ */
|
|
2471
|
-
|
|
2352
|
+
!!y && /* @__PURE__ */ E(
|
|
2353
|
+
G,
|
|
2472
2354
|
{
|
|
2473
|
-
onClick:
|
|
2355
|
+
onClick: C,
|
|
2474
2356
|
className: "w-max -mx-2",
|
|
2475
2357
|
type: "button",
|
|
2476
2358
|
variant: "ghost",
|
|
@@ -2488,12 +2370,12 @@ const Ki = P((t) => {
|
|
|
2488
2370
|
}
|
|
2489
2371
|
) });
|
|
2490
2372
|
});
|
|
2491
|
-
|
|
2492
|
-
const
|
|
2493
|
-
...
|
|
2373
|
+
Hi.displayName = "SelectInput";
|
|
2374
|
+
const Ds = {
|
|
2375
|
+
...Q,
|
|
2494
2376
|
type: "radio",
|
|
2495
2377
|
options: []
|
|
2496
|
-
},
|
|
2378
|
+
}, Ae = class Ae extends W {
|
|
2497
2379
|
constructor(e) {
|
|
2498
2380
|
const { options: i, ...r } = e;
|
|
2499
2381
|
super({ ...r, type: "radio" });
|
|
@@ -2513,13 +2395,13 @@ const As = {
|
|
|
2513
2395
|
}
|
|
2514
2396
|
static deserialize(e) {
|
|
2515
2397
|
if (e.type !== "radio") throw new Error("Type mismatch.");
|
|
2516
|
-
return new
|
|
2398
|
+
return new Ae(e);
|
|
2517
2399
|
}
|
|
2518
2400
|
static getFieldCreationSchema(e = "") {
|
|
2519
2401
|
const i = e && `${e}.`;
|
|
2520
2402
|
return [
|
|
2521
2403
|
{
|
|
2522
|
-
field: new
|
|
2404
|
+
field: new qe({
|
|
2523
2405
|
label: "Options",
|
|
2524
2406
|
description: "List possible options for the user to select from.",
|
|
2525
2407
|
required: !0,
|
|
@@ -2531,20 +2413,143 @@ const As = {
|
|
|
2531
2413
|
];
|
|
2532
2414
|
}
|
|
2533
2415
|
getInput(e) {
|
|
2534
|
-
return /* @__PURE__ */ l(
|
|
2416
|
+
return /* @__PURE__ */ l(Hi, { field: this, ...e });
|
|
2535
2417
|
}
|
|
2536
2418
|
};
|
|
2537
|
-
I(
|
|
2538
|
-
let
|
|
2419
|
+
I(Ae, "fieldTypeName", "Option list"), I(Ae, "fieldTypeDescription", "Allows the user to select a single option from a list of options."), I(Ae, "Icon", Cr);
|
|
2420
|
+
let Vt = Ae;
|
|
2421
|
+
const Gi = P((t) => {
|
|
2422
|
+
const [
|
|
2423
|
+
{ inputId: n, labelId: e, label: i, helpText: r, size: o, severity: s, showInputOnly: a, field: u, fieldProps: f, helpers: m, touched: d },
|
|
2424
|
+
p
|
|
2425
|
+
] = Z(t), { name: b, onBlur: y, onChange: c, value: v } = f, [w, C] = K(!1), g = a ? null : r, S = a ? "" : i, [x, F] = K(void 0);
|
|
2426
|
+
H(() => {
|
|
2427
|
+
F(v);
|
|
2428
|
+
}, [v]);
|
|
2429
|
+
const N = R(
|
|
2430
|
+
(V) => {
|
|
2431
|
+
F(V.target.value || void 0), (d || !u.onlyValidateAfterTouched) && m.setError(u.getError(V.target.value));
|
|
2432
|
+
},
|
|
2433
|
+
[u, m, d]
|
|
2434
|
+
), T = R(() => {
|
|
2435
|
+
c(x), y(x);
|
|
2436
|
+
}, [x, y, c]), D = R(
|
|
2437
|
+
(V) => {
|
|
2438
|
+
c(V), C(!1);
|
|
2439
|
+
},
|
|
2440
|
+
[c]
|
|
2441
|
+
), M = R(() => {
|
|
2442
|
+
c(void 0);
|
|
2443
|
+
}, [c]), k = R(
|
|
2444
|
+
(V) => {
|
|
2445
|
+
C(V), V || y(v);
|
|
2446
|
+
},
|
|
2447
|
+
[y, v]
|
|
2448
|
+
);
|
|
2449
|
+
return /* @__PURE__ */ l(ie, { helpText: g, severity: s, children: /* @__PURE__ */ l(
|
|
2450
|
+
ne,
|
|
2451
|
+
{
|
|
2452
|
+
size: o,
|
|
2453
|
+
severity: s,
|
|
2454
|
+
inputId: n,
|
|
2455
|
+
labelId: e,
|
|
2456
|
+
label: S,
|
|
2457
|
+
image: a ? void 0 : u.image,
|
|
2458
|
+
className: "flex-col items-start justify-start gap-2",
|
|
2459
|
+
children: /* @__PURE__ */ E("div", { className: "flex w-full items-center gap-2", children: [
|
|
2460
|
+
/* @__PURE__ */ E(ee.Root, { className: "grow", accentColor: "base", variant: "surface", size: "sm", children: [
|
|
2461
|
+
/* @__PURE__ */ l(
|
|
2462
|
+
ee.Field,
|
|
2463
|
+
{
|
|
2464
|
+
id: n,
|
|
2465
|
+
className: "truncate",
|
|
2466
|
+
name: b,
|
|
2467
|
+
value: x ?? "",
|
|
2468
|
+
type: "text",
|
|
2469
|
+
placeholder: "Enter a qr or barcode",
|
|
2470
|
+
onChange: N,
|
|
2471
|
+
onBlur: T,
|
|
2472
|
+
...p
|
|
2473
|
+
}
|
|
2474
|
+
),
|
|
2475
|
+
!!v && /* @__PURE__ */ l(ee.Slot, { children: /* @__PURE__ */ l(
|
|
2476
|
+
J,
|
|
2477
|
+
{
|
|
2478
|
+
accentColor: "base",
|
|
2479
|
+
variant: "ghost",
|
|
2480
|
+
"aria-label": "delete",
|
|
2481
|
+
size: "xs",
|
|
2482
|
+
onClick: M,
|
|
2483
|
+
children: /* @__PURE__ */ l(L, { icon: "RiCloseLine" })
|
|
2484
|
+
}
|
|
2485
|
+
) })
|
|
2486
|
+
] }),
|
|
2487
|
+
/* @__PURE__ */ E(Oi, { open: w, onOpenChange: k, children: [
|
|
2488
|
+
/* @__PURE__ */ l(Es, { asChild: !0, children: /* @__PURE__ */ E(G, { type: "button", variant: "soft", size: "sm", accentColor: "base", children: [
|
|
2489
|
+
/* @__PURE__ */ l(L, { icon: "RiQrCodeLine" }),
|
|
2490
|
+
"Scan"
|
|
2491
|
+
] }) }),
|
|
2492
|
+
/* @__PURE__ */ E(Mi, { children: [
|
|
2493
|
+
/* @__PURE__ */ l(ki, { className: "light:bg-(--black-a6) fixed inset-0 dark:bg-(--black-a8)" }),
|
|
2494
|
+
/* @__PURE__ */ l(zi, { className: "fixed inset-0", children: /* @__PURE__ */ l(Ki, { onScan: D }) })
|
|
2495
|
+
] })
|
|
2496
|
+
] })
|
|
2497
|
+
] })
|
|
2498
|
+
}
|
|
2499
|
+
) });
|
|
2500
|
+
});
|
|
2501
|
+
Gi.displayName = "QrInput";
|
|
2502
|
+
const Ki = P((t) => {
|
|
2503
|
+
const { onScan: n } = t, { showError: e } = Ge(), i = R(
|
|
2504
|
+
(s) => {
|
|
2505
|
+
n(s.getText());
|
|
2506
|
+
},
|
|
2507
|
+
[n]
|
|
2508
|
+
), r = R(() => {
|
|
2509
|
+
e({
|
|
2510
|
+
title: "Scan Error",
|
|
2511
|
+
description: "An unknown error occurred while scanning."
|
|
2512
|
+
});
|
|
2513
|
+
}, [e]), { ref: o } = Mr({
|
|
2514
|
+
onDecodeResult: i,
|
|
2515
|
+
onError: r
|
|
2516
|
+
});
|
|
2517
|
+
return /* @__PURE__ */ E("div", { className: "relative flex h-full w-full flex-col justify-center gap-2 bg-(--color-background)", children: [
|
|
2518
|
+
/* @__PURE__ */ l("div", { className: "absolute top-0 flex w-full p-2", children: /* @__PURE__ */ l(_i, { asChild: !0, children: /* @__PURE__ */ l(J, { "aria-label": "close", variant: "soft", accentColor: "base", children: /* @__PURE__ */ l(L, { icon: "RiCloseLine" }) }) }) }),
|
|
2519
|
+
/* @__PURE__ */ l("div", { className: "relative max-h-full max-w-full **:stroke-(--primary-indicator)", children: /* @__PURE__ */ l("video", { className: "rotate-y-180 size-full", ref: o }) })
|
|
2520
|
+
] });
|
|
2521
|
+
});
|
|
2522
|
+
Ki.displayName = "QrScanner";
|
|
2523
|
+
const As = {
|
|
2524
|
+
...Q,
|
|
2525
|
+
type: "qr"
|
|
2526
|
+
}, Pe = class Pe extends W {
|
|
2527
|
+
constructor(e) {
|
|
2528
|
+
super({ ...e, type: "qr" });
|
|
2529
|
+
I(this, "onlyValidateAfterTouched", !1);
|
|
2530
|
+
}
|
|
2531
|
+
serialize() {
|
|
2532
|
+
return super._serialize();
|
|
2533
|
+
}
|
|
2534
|
+
static deserialize(e) {
|
|
2535
|
+
if (e.type !== "qr") throw new Error("Type mismatch.");
|
|
2536
|
+
return new Pe(e);
|
|
2537
|
+
}
|
|
2538
|
+
getInput(e) {
|
|
2539
|
+
return /* @__PURE__ */ l(Gi, { ...e, field: this });
|
|
2540
|
+
}
|
|
2541
|
+
};
|
|
2542
|
+
I(Pe, "fieldTypeName", "Scan"), I(Pe, "fieldTypeDescription", "Used for scanning/reading QR and barcodes."), I(Pe, "Icon", Er);
|
|
2543
|
+
let $t = Pe;
|
|
2539
2544
|
const Xi = P((t) => {
|
|
2540
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, helpText: a, label:
|
|
2545
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, helpText: a, label: u, fieldProps: f }, m] = Z(t), { name: d, onChange: p, onBlur: b, value: y } = f, c = o ? null : a, v = o ? "" : u, w = R(
|
|
2541
2546
|
(g) => {
|
|
2542
2547
|
p(g), b(g);
|
|
2543
2548
|
},
|
|
2544
2549
|
[b, p]
|
|
2545
|
-
),
|
|
2546
|
-
return /* @__PURE__ */ l(
|
|
2547
|
-
|
|
2550
|
+
), C = O(() => s.options.find((g) => g.value === y), [s.options, y]);
|
|
2551
|
+
return /* @__PURE__ */ l(ie, { helpText: c, severity: r, children: /* @__PURE__ */ l(
|
|
2552
|
+
ne,
|
|
2548
2553
|
{
|
|
2549
2554
|
size: i,
|
|
2550
2555
|
severity: r,
|
|
@@ -2552,26 +2557,26 @@ const Xi = P((t) => {
|
|
|
2552
2557
|
labelId: e,
|
|
2553
2558
|
label: v,
|
|
2554
2559
|
image: o ? void 0 : s.image,
|
|
2555
|
-
children: /* @__PURE__ */
|
|
2556
|
-
/* @__PURE__ */ l(
|
|
2557
|
-
|
|
2560
|
+
children: /* @__PURE__ */ E(B.Root, { align: "start", children: [
|
|
2561
|
+
/* @__PURE__ */ l(B.ClickTrigger, { children: /* @__PURE__ */ E(
|
|
2562
|
+
G,
|
|
2558
2563
|
{
|
|
2559
2564
|
id: n,
|
|
2560
|
-
name:
|
|
2565
|
+
name: d,
|
|
2561
2566
|
className: "!justify-between",
|
|
2562
2567
|
accentColor: "base",
|
|
2563
2568
|
variant: "surface",
|
|
2564
2569
|
type: "button",
|
|
2565
2570
|
size: "sm",
|
|
2566
|
-
...
|
|
2571
|
+
...m,
|
|
2567
2572
|
children: [
|
|
2568
|
-
/* @__PURE__ */ l("span", { className: "truncate", children:
|
|
2573
|
+
/* @__PURE__ */ l("span", { className: "truncate", children: C ? C.label : s.placeholder }),
|
|
2569
2574
|
/* @__PURE__ */ l(L, { icon: "RiArrowDownSLine" })
|
|
2570
2575
|
]
|
|
2571
2576
|
}
|
|
2572
2577
|
) }),
|
|
2573
|
-
/* @__PURE__ */ l(
|
|
2574
|
-
/* @__PURE__ */ l(
|
|
2578
|
+
/* @__PURE__ */ l(B.Content, { children: /* @__PURE__ */ l(B.Scroll, { children: /* @__PURE__ */ l(B.SelectGroup, { required: !1, value: y ?? void 0, onValueChange: w, children: s.options.map((g) => /* @__PURE__ */ E(B.SelectItem, { value: g.value, children: [
|
|
2579
|
+
/* @__PURE__ */ l(B.SelectedIndicator, { children: /* @__PURE__ */ l(L, { icon: "RiCheckLine" }) }),
|
|
2575
2580
|
g.label
|
|
2576
2581
|
] }, g.value)) }) }) })
|
|
2577
2582
|
] })
|
|
@@ -2580,10 +2585,10 @@ const Xi = P((t) => {
|
|
|
2580
2585
|
});
|
|
2581
2586
|
Xi.displayName = "SelectInput";
|
|
2582
2587
|
const Ps = {
|
|
2583
|
-
...
|
|
2588
|
+
...Q,
|
|
2584
2589
|
type: "select",
|
|
2585
2590
|
options: []
|
|
2586
|
-
}, Oe = class Oe extends
|
|
2591
|
+
}, Oe = class Oe extends $i {
|
|
2587
2592
|
constructor(n) {
|
|
2588
2593
|
const { placeholder: e = "Select one...", ...i } = n;
|
|
2589
2594
|
super({ ...i, placeholder: e, type: "select" });
|
|
@@ -2601,8 +2606,8 @@ const Ps = {
|
|
|
2601
2606
|
};
|
|
2602
2607
|
I(Oe, "fieldTypeName", "Dropdown"), I(Oe, "fieldTypeDescription", "Allows the user to select a single option from a list of options."), I(Oe, "Icon", Ir);
|
|
2603
2608
|
let gt = Oe;
|
|
2604
|
-
const ot = 500, Ue = 1e4,
|
|
2605
|
-
class vt extends
|
|
2609
|
+
const ot = 500, Ue = 1e4, _n = (t) => "fields" in t;
|
|
2610
|
+
class vt extends W {
|
|
2606
2611
|
constructor(e) {
|
|
2607
2612
|
const { minLength: i, maxLength: r, placeholder: o = "", ...s } = e;
|
|
2608
2613
|
super(s);
|
|
@@ -2673,7 +2678,7 @@ class vt extends U {
|
|
|
2673
2678
|
* equal to the value given for "maximum length".
|
|
2674
2679
|
*/
|
|
2675
2680
|
I(vt, "_validateMin", (e) => (i, r) => {
|
|
2676
|
-
const o =
|
|
2681
|
+
const o = _n(r) ? se(r, e) : r;
|
|
2677
2682
|
return typeof o.maximum_length == "number" && typeof i == "number" && o.maximum_length < i ? "Minimum cannot be greater than maximum." : null;
|
|
2678
2683
|
}), /**
|
|
2679
2684
|
* This function returns a function that validates that the value given for "maximum length" (when creating a new field) is greater than or
|
|
@@ -2681,36 +2686,36 @@ I(vt, "_validateMin", (e) => (i, r) => {
|
|
|
2681
2686
|
*/
|
|
2682
2687
|
I(vt, "_validateMax", (e) => (i, r) => {
|
|
2683
2688
|
if (typeof i != "number") return null;
|
|
2684
|
-
const { minimum_length: o } =
|
|
2689
|
+
const { minimum_length: o } = _n(r) ? se(r, e) : r;
|
|
2685
2690
|
return typeof o != "number" ? null : o > i ? "Maximum cannot be less than minimum." : null;
|
|
2686
2691
|
});
|
|
2687
2692
|
const Yi = P((t) => {
|
|
2688
2693
|
const [
|
|
2689
|
-
{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, helpText: a, label:
|
|
2694
|
+
{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, helpText: a, label: u, fieldProps: f, touched: m, helpers: d },
|
|
2690
2695
|
p
|
|
2691
|
-
] =
|
|
2692
|
-
|
|
2696
|
+
] = Z(t), { name: b, onBlur: y, onChange: c, value: v } = f, w = o ? null : a, C = o ? "" : u, [g, S] = K(void 0);
|
|
2697
|
+
H(() => {
|
|
2693
2698
|
S(v);
|
|
2694
2699
|
}, [v]);
|
|
2695
|
-
const
|
|
2700
|
+
const x = R(
|
|
2696
2701
|
(N) => {
|
|
2697
|
-
S(N.target.value || void 0), (
|
|
2702
|
+
S(N.target.value || void 0), (m || !s.onlyValidateAfterTouched) && d.setError(s.getError(N.target.value));
|
|
2698
2703
|
},
|
|
2699
|
-
[s,
|
|
2704
|
+
[s, d, m]
|
|
2700
2705
|
), F = R(() => {
|
|
2701
2706
|
c(g), y(g);
|
|
2702
2707
|
}, [g, y, c]);
|
|
2703
|
-
return /* @__PURE__ */ l(
|
|
2704
|
-
|
|
2708
|
+
return /* @__PURE__ */ l(ie, { helpText: w, severity: r, children: /* @__PURE__ */ l(
|
|
2709
|
+
ne,
|
|
2705
2710
|
{
|
|
2706
2711
|
size: i,
|
|
2707
2712
|
severity: r,
|
|
2708
2713
|
inputId: n,
|
|
2709
2714
|
labelId: e,
|
|
2710
|
-
label:
|
|
2715
|
+
label: C,
|
|
2711
2716
|
image: o ? void 0 : s.image,
|
|
2712
|
-
children: /* @__PURE__ */ l(
|
|
2713
|
-
|
|
2717
|
+
children: /* @__PURE__ */ l(ee.Root, { accentColor: "base", variant: "surface", size: "sm", children: /* @__PURE__ */ l(
|
|
2718
|
+
ee.Field,
|
|
2714
2719
|
{
|
|
2715
2720
|
id: n,
|
|
2716
2721
|
className: "truncate",
|
|
@@ -2718,7 +2723,7 @@ const Yi = P((t) => {
|
|
|
2718
2723
|
value: g ?? "",
|
|
2719
2724
|
type: s.inputType,
|
|
2720
2725
|
placeholder: s.placeholder,
|
|
2721
|
-
onChange:
|
|
2726
|
+
onChange: x,
|
|
2722
2727
|
onBlur: F,
|
|
2723
2728
|
...p
|
|
2724
2729
|
}
|
|
@@ -2728,7 +2733,7 @@ const Yi = P((t) => {
|
|
|
2728
2733
|
});
|
|
2729
2734
|
Yi.displayName = "StringInput";
|
|
2730
2735
|
const Os = {
|
|
2731
|
-
...
|
|
2736
|
+
...Q,
|
|
2732
2737
|
type: "string",
|
|
2733
2738
|
maximum_length: ot,
|
|
2734
2739
|
input_type: "text"
|
|
@@ -2759,30 +2764,30 @@ const Os = {
|
|
|
2759
2764
|
};
|
|
2760
2765
|
I(Me, "fieldTypeName", "Short Text"), I(Me, "fieldTypeDescription", `Short text fields can hold up to ${ot} characters on a single line.`), I(Me, "Icon", Sr);
|
|
2761
2766
|
let Ut = Me;
|
|
2762
|
-
const
|
|
2767
|
+
const Ji = P((t) => {
|
|
2763
2768
|
const [
|
|
2764
|
-
{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, helpText: a, label:
|
|
2769
|
+
{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, helpText: a, label: u, fieldProps: f, touched: m, helpers: d },
|
|
2765
2770
|
p
|
|
2766
|
-
] =
|
|
2767
|
-
|
|
2771
|
+
] = Z(t), { name: b, onBlur: y, onChange: c, value: v } = f, w = o ? null : a, C = o ? "" : u, [g, S] = K(void 0);
|
|
2772
|
+
H(() => {
|
|
2768
2773
|
S(v);
|
|
2769
2774
|
}, [v]);
|
|
2770
|
-
const
|
|
2775
|
+
const x = R(
|
|
2771
2776
|
(N) => {
|
|
2772
|
-
S(N.target.value || void 0), (
|
|
2777
|
+
S(N.target.value || void 0), (m || !s.onlyValidateAfterTouched) && d.setError(s.getError(N.target.value));
|
|
2773
2778
|
},
|
|
2774
|
-
[s,
|
|
2779
|
+
[s, d, m]
|
|
2775
2780
|
), F = R(() => {
|
|
2776
2781
|
c(g), y(g);
|
|
2777
2782
|
}, [g, y, c]);
|
|
2778
|
-
return /* @__PURE__ */ l(
|
|
2779
|
-
|
|
2783
|
+
return /* @__PURE__ */ l(ie, { helpText: w, severity: r, children: /* @__PURE__ */ l(
|
|
2784
|
+
ne,
|
|
2780
2785
|
{
|
|
2781
2786
|
size: i,
|
|
2782
2787
|
severity: r,
|
|
2783
2788
|
inputId: n,
|
|
2784
2789
|
labelId: e,
|
|
2785
|
-
label:
|
|
2790
|
+
label: C,
|
|
2786
2791
|
image: o ? void 0 : s.image,
|
|
2787
2792
|
children: /* @__PURE__ */ l(
|
|
2788
2793
|
qn,
|
|
@@ -2790,7 +2795,7 @@ const Qi = P((t) => {
|
|
|
2790
2795
|
id: n,
|
|
2791
2796
|
value: g ?? "",
|
|
2792
2797
|
name: b,
|
|
2793
|
-
onChange:
|
|
2798
|
+
onChange: x,
|
|
2794
2799
|
onBlur: F,
|
|
2795
2800
|
className: "field-sizing-content min-h-12",
|
|
2796
2801
|
placeholder: s.placeholder,
|
|
@@ -2804,9 +2809,9 @@ const Qi = P((t) => {
|
|
|
2804
2809
|
}
|
|
2805
2810
|
) });
|
|
2806
2811
|
});
|
|
2807
|
-
|
|
2812
|
+
Ji.displayName = "TextInput";
|
|
2808
2813
|
const Ms = {
|
|
2809
|
-
...
|
|
2814
|
+
...Q,
|
|
2810
2815
|
type: "text",
|
|
2811
2816
|
maximum_length: Ue
|
|
2812
2817
|
}, ke = class ke extends vt {
|
|
@@ -2828,15 +2833,15 @@ const Ms = {
|
|
|
2828
2833
|
});
|
|
2829
2834
|
}
|
|
2830
2835
|
getInput(n) {
|
|
2831
|
-
return /* @__PURE__ */ l(
|
|
2836
|
+
return /* @__PURE__ */ l(Ji, { field: this, ...n });
|
|
2832
2837
|
}
|
|
2833
2838
|
};
|
|
2834
2839
|
I(ke, "fieldTypeName", "Paragraph"), I(ke, "fieldTypeDescription", `Paragraph fields can hold up to ${Ue} characters and can have multiple lines.`), I(ke, "Icon", Nr);
|
|
2835
2840
|
let Wt = ke;
|
|
2836
2841
|
const ks = P(
|
|
2837
|
-
|
|
2842
|
+
Xe((t, n) => {
|
|
2838
2843
|
const { file: e, alt: i, error: r, rightSlot: o, className: s, ...a } = t;
|
|
2839
|
-
return /* @__PURE__ */
|
|
2844
|
+
return /* @__PURE__ */ E(
|
|
2840
2845
|
"div",
|
|
2841
2846
|
{
|
|
2842
2847
|
className: je(
|
|
@@ -2846,7 +2851,7 @@ const ks = P(
|
|
|
2846
2851
|
ref: n,
|
|
2847
2852
|
...a,
|
|
2848
2853
|
children: [
|
|
2849
|
-
!e && !r && /* @__PURE__ */ l("div", { className: "absolute flex h-full w-full flex-col items-center justify-center", children: /* @__PURE__ */ l(
|
|
2854
|
+
!e && !r && /* @__PURE__ */ l("div", { className: "absolute flex h-full w-full flex-col items-center justify-center", children: /* @__PURE__ */ l(Wn, {}) }),
|
|
2850
2855
|
/* @__PURE__ */ l("div", { className: "-m-4 flex max-w-full grow items-center justify-center overflow-hidden bg-clip-padding", children: e && !r && /* @__PURE__ */ l(
|
|
2851
2856
|
"img",
|
|
2852
2857
|
{
|
|
@@ -2855,15 +2860,15 @@ const ks = P(
|
|
|
2855
2860
|
alt: i ?? e.name
|
|
2856
2861
|
}
|
|
2857
2862
|
) }),
|
|
2858
|
-
/* @__PURE__ */
|
|
2863
|
+
/* @__PURE__ */ E(
|
|
2859
2864
|
"div",
|
|
2860
2865
|
{
|
|
2861
2866
|
className: je("flex h-max w-full items-center gap-1 bg-(--base-2) px-2 py-1", {
|
|
2862
2867
|
"bg-transparent": !e
|
|
2863
2868
|
}),
|
|
2864
2869
|
children: [
|
|
2865
|
-
r ? /* @__PURE__ */ l(L, { icon: "RiFileWarningLine" }) : e && /* @__PURE__ */ l(
|
|
2866
|
-
/* @__PURE__ */ l(
|
|
2870
|
+
r ? /* @__PURE__ */ l(L, { icon: "RiFileWarningLine" }) : e && /* @__PURE__ */ l(tn, { fileType: e.type }),
|
|
2871
|
+
/* @__PURE__ */ l(ae, { className: "truncate", size: "sm", children: r ?? (e == null ? void 0 : e.name) }),
|
|
2867
2872
|
o
|
|
2868
2873
|
]
|
|
2869
2874
|
}
|
|
@@ -2883,31 +2888,31 @@ const ks = P(
|
|
|
2883
2888
|
style: "unit",
|
|
2884
2889
|
unit: n[i]
|
|
2885
2890
|
}).format(e);
|
|
2886
|
-
},
|
|
2891
|
+
}, Zi = P((t) => {
|
|
2887
2892
|
var N;
|
|
2888
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, helpText: o, showInputOnly: s, field: a, fieldProps:
|
|
2889
|
-
let [{ label: b }] =
|
|
2893
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, helpText: o, showInputOnly: s, field: a, fieldProps: u }, f] = Z(t), { name: m, onChange: d, onBlur: p } = u;
|
|
2894
|
+
let [{ label: b }] = Z(t);
|
|
2890
2895
|
b = s ? "" : b;
|
|
2891
|
-
const y =
|
|
2896
|
+
const y = u.value ?? nn, c = bt(null), v = O(() => s ? null : o || (a.maxFileSize ? `Maximum file size: ${a.maxFileSize}MB` : null), [a.maxFileSize, o, s]), w = R(() => {
|
|
2892
2897
|
var T;
|
|
2893
2898
|
(T = c.current) == null || T.click();
|
|
2894
|
-
}, []),
|
|
2899
|
+
}, []), C = R(() => {
|
|
2895
2900
|
if (!c.current) return;
|
|
2896
2901
|
const T = c.current.files;
|
|
2897
2902
|
if (!T) {
|
|
2898
2903
|
p([]);
|
|
2899
2904
|
return;
|
|
2900
2905
|
}
|
|
2901
|
-
const
|
|
2902
|
-
|
|
2903
|
-
}, [p,
|
|
2906
|
+
const D = Array.from(T), M = [...y, ...D];
|
|
2907
|
+
d(M), p(M);
|
|
2908
|
+
}, [p, d, y]), g = R(
|
|
2904
2909
|
(T) => {
|
|
2905
|
-
const
|
|
2906
|
-
|
|
2910
|
+
const D = [...y];
|
|
2911
|
+
D.splice(T, 1), d(D.length > 0 ? D : void 0);
|
|
2907
2912
|
},
|
|
2908
|
-
[y,
|
|
2913
|
+
[y, d]
|
|
2909
2914
|
);
|
|
2910
|
-
|
|
2915
|
+
H(() => {
|
|
2911
2916
|
if (!c.current) return;
|
|
2912
2917
|
const T = new AbortController();
|
|
2913
2918
|
return c.current.addEventListener(
|
|
@@ -2922,10 +2927,10 @@ const ks = P(
|
|
|
2922
2927
|
T.abort();
|
|
2923
2928
|
};
|
|
2924
2929
|
}, [p, y]);
|
|
2925
|
-
const
|
|
2926
|
-
return /* @__PURE__ */
|
|
2927
|
-
/* @__PURE__ */ l(
|
|
2928
|
-
|
|
2930
|
+
const F = a.maxFiles > 1 ? "Select files" : "Select a file";
|
|
2931
|
+
return /* @__PURE__ */ E("div", { className: "flex flex-col gap-2", children: [
|
|
2932
|
+
/* @__PURE__ */ l(ie, { helpText: v, severity: r, children: /* @__PURE__ */ E(
|
|
2933
|
+
ne,
|
|
2929
2934
|
{
|
|
2930
2935
|
size: i,
|
|
2931
2936
|
severity: r,
|
|
@@ -2934,8 +2939,8 @@ const ks = P(
|
|
|
2934
2939
|
label: b,
|
|
2935
2940
|
image: s ? void 0 : a.image,
|
|
2936
2941
|
children: [
|
|
2937
|
-
/* @__PURE__ */ l("div", { className: "flex gap-2", children: /* @__PURE__ */
|
|
2938
|
-
|
|
2942
|
+
/* @__PURE__ */ l("div", { className: "flex gap-2", children: /* @__PURE__ */ E(
|
|
2943
|
+
G,
|
|
2939
2944
|
{
|
|
2940
2945
|
className: "w-max",
|
|
2941
2946
|
size: "sm",
|
|
@@ -2944,7 +2949,7 @@ const ks = P(
|
|
|
2944
2949
|
onClick: w,
|
|
2945
2950
|
id: "upload-input-upload-button",
|
|
2946
2951
|
type: "button",
|
|
2947
|
-
...
|
|
2952
|
+
...f,
|
|
2948
2953
|
children: [
|
|
2949
2954
|
/* @__PURE__ */ l(L, { icon: "RiUpload2Line" }),
|
|
2950
2955
|
" ",
|
|
@@ -2956,50 +2961,50 @@ const ks = P(
|
|
|
2956
2961
|
"input",
|
|
2957
2962
|
{
|
|
2958
2963
|
id: n,
|
|
2959
|
-
name:
|
|
2964
|
+
name: m,
|
|
2960
2965
|
type: "file",
|
|
2961
2966
|
ref: c,
|
|
2962
2967
|
accept: (N = a.extensions) == null ? void 0 : N.join(","),
|
|
2963
2968
|
multiple: a.maxFiles > 1,
|
|
2964
2969
|
className: "hidden",
|
|
2965
|
-
onChange:
|
|
2970
|
+
onChange: C,
|
|
2966
2971
|
value: ""
|
|
2967
2972
|
}
|
|
2968
2973
|
)
|
|
2969
2974
|
]
|
|
2970
2975
|
}
|
|
2971
2976
|
) }),
|
|
2972
|
-
Array.isArray(y) && y.length > 0 && /* @__PURE__ */ l("div", { className: "flex h-max flex-col gap-2", children: y.map((T,
|
|
2973
|
-
|
|
2977
|
+
Array.isArray(y) && y.length > 0 && /* @__PURE__ */ l("div", { className: "flex h-max flex-col gap-2", children: y.map((T, D) => /* @__PURE__ */ l(
|
|
2978
|
+
Qi,
|
|
2974
2979
|
{
|
|
2975
2980
|
field: a,
|
|
2976
2981
|
file: T,
|
|
2977
2982
|
onRemove: () => {
|
|
2978
|
-
g(
|
|
2983
|
+
g(D);
|
|
2979
2984
|
},
|
|
2980
|
-
disabled:
|
|
2985
|
+
disabled: f.disabled
|
|
2981
2986
|
},
|
|
2982
|
-
|
|
2987
|
+
D
|
|
2983
2988
|
)) })
|
|
2984
2989
|
] });
|
|
2985
2990
|
});
|
|
2986
|
-
|
|
2987
|
-
const
|
|
2988
|
-
const { file: n, field: e, onRemove: i, disabled: r } = t, [o, s] =
|
|
2991
|
+
Zi.displayName = "UploadInput";
|
|
2992
|
+
const Qi = P((t) => {
|
|
2993
|
+
const { file: n, field: e, onRemove: i, disabled: r } = t, [o, s] = K(null), a = sn(), u = O(() => o && e.getError([o]), [e, o]), { url: f, name: m } = O(() => {
|
|
2989
2994
|
let c = null, v, w;
|
|
2990
2995
|
return o != null && o.type.startsWith("image/") && (c = URL.createObjectURL(o)), o ? (v = o.name, w = zs(o.size)) : (v = "Downloading...", w = "..."), { url: c, name: v, size: w };
|
|
2991
2996
|
}, [o]);
|
|
2992
|
-
|
|
2997
|
+
H(() => {
|
|
2993
2998
|
n instanceof Promise ? n.then(s).catch(console.error) : s(n);
|
|
2994
2999
|
}, [n]);
|
|
2995
|
-
const
|
|
3000
|
+
const d = R(
|
|
2996
3001
|
(c) => {
|
|
2997
3002
|
if (c.stopPropagation(), !o)
|
|
2998
3003
|
throw new Error("Cannot download a file that is not resolved.");
|
|
2999
3004
|
const v = new Blob([o]);
|
|
3000
|
-
Yn(v,
|
|
3005
|
+
Yn(v, m);
|
|
3001
3006
|
},
|
|
3002
|
-
[
|
|
3007
|
+
[m, o]
|
|
3003
3008
|
), p = R(
|
|
3004
3009
|
(c) => {
|
|
3005
3010
|
c.stopPropagation(), i();
|
|
@@ -3013,44 +3018,44 @@ const Zi = P((t) => {
|
|
|
3013
3018
|
}
|
|
3014
3019
|
}));
|
|
3015
3020
|
}, [r, i, a, o]), y = O(
|
|
3016
|
-
() => /* @__PURE__ */
|
|
3021
|
+
() => /* @__PURE__ */ E(Kt, { className: "flex grow justify-end", variant: "ghost", accentColor: "base", size: "sm", children: [
|
|
3017
3022
|
/* @__PURE__ */ l(
|
|
3018
|
-
|
|
3023
|
+
J,
|
|
3019
3024
|
{
|
|
3020
|
-
"aria-label": `Download ${
|
|
3025
|
+
"aria-label": `Download ${m}`,
|
|
3021
3026
|
type: "button",
|
|
3022
|
-
onClick:
|
|
3027
|
+
onClick: d,
|
|
3023
3028
|
disabled: !o,
|
|
3024
3029
|
children: /* @__PURE__ */ l(L, { icon: "RiDownload2Line" })
|
|
3025
3030
|
}
|
|
3026
3031
|
),
|
|
3027
|
-
!r && /* @__PURE__ */ l(
|
|
3032
|
+
!r && /* @__PURE__ */ l(J, { type: "button", "aria-label": `Remove ${m}`, disabled: r, onClick: p, children: /* @__PURE__ */ l(L, { icon: "RiDeleteBin7Fill" }) })
|
|
3028
3033
|
] }),
|
|
3029
|
-
[r, p,
|
|
3034
|
+
[r, p, d, m, o]
|
|
3030
3035
|
);
|
|
3031
|
-
return
|
|
3036
|
+
return f ? /* @__PURE__ */ l(
|
|
3032
3037
|
ks,
|
|
3033
3038
|
{
|
|
3034
3039
|
className: "cursor-pointer",
|
|
3035
3040
|
onClick: b,
|
|
3036
3041
|
file: o,
|
|
3037
|
-
error:
|
|
3042
|
+
error: u ?? void 0,
|
|
3038
3043
|
rightSlot: y
|
|
3039
3044
|
}
|
|
3040
|
-
) : /* @__PURE__ */ l(
|
|
3045
|
+
) : /* @__PURE__ */ l(Jn, { file: o, error: u ?? void 0, rightSlot: y });
|
|
3041
3046
|
});
|
|
3042
|
-
|
|
3047
|
+
Qi.displayName = "DisplayFile";
|
|
3043
3048
|
const _s = {
|
|
3044
|
-
...
|
|
3049
|
+
...Q,
|
|
3045
3050
|
type: "upload",
|
|
3046
3051
|
extensions: [],
|
|
3047
3052
|
maximum_size: void 0,
|
|
3048
3053
|
maximum_files: 1
|
|
3049
3054
|
};
|
|
3050
|
-
function
|
|
3055
|
+
function Bn(t, n) {
|
|
3051
3056
|
return t.name === n.name && t.size === n.size && t.type === n.type;
|
|
3052
3057
|
}
|
|
3053
|
-
const ze = class ze extends
|
|
3058
|
+
const ze = class ze extends W {
|
|
3054
3059
|
constructor(e) {
|
|
3055
3060
|
const { extensions: i, maximum_files: r, maximum_size: o, ...s } = e;
|
|
3056
3061
|
super({ ...s, type: "upload" });
|
|
@@ -3064,7 +3069,7 @@ const ze = class ze extends U {
|
|
|
3064
3069
|
return super.isBlank(e) || (e == null ? void 0 : e.length) === 0;
|
|
3065
3070
|
}
|
|
3066
3071
|
isEqual(e, i) {
|
|
3067
|
-
return e === void 0 && i === void 0 ? !0 : !(e === void 0 || i === void 0 || !e.every((r) => i.some((o) =>
|
|
3072
|
+
return e === void 0 && i === void 0 ? !0 : !(e === void 0 || i === void 0 || !e.every((r) => i.some((o) => Bn(r, o))) || !i.every((r) => e.some((o) => Bn(o, r))));
|
|
3068
3073
|
}
|
|
3069
3074
|
static getFieldCreationSchema(e = "") {
|
|
3070
3075
|
const i = e && `${e}.`;
|
|
@@ -3150,25 +3155,25 @@ const ze = class ze extends U {
|
|
|
3150
3155
|
return new ze(e);
|
|
3151
3156
|
}
|
|
3152
3157
|
getInput(e) {
|
|
3153
|
-
return /* @__PURE__ */ l(
|
|
3158
|
+
return /* @__PURE__ */ l(Zi, { field: this, ...e });
|
|
3154
3159
|
}
|
|
3155
3160
|
};
|
|
3156
3161
|
I(ze, "fieldTypeName", "Upload"), I(ze, "fieldTypeDescription", "Allows a file to be uploaded."), I(ze, "Icon", Tr);
|
|
3157
3162
|
let jt = ze;
|
|
3158
|
-
const
|
|
3159
|
-
date:
|
|
3163
|
+
const fn = {
|
|
3164
|
+
date: Bt,
|
|
3160
3165
|
number: be,
|
|
3161
|
-
boolean:
|
|
3166
|
+
boolean: He,
|
|
3162
3167
|
select: gt,
|
|
3163
3168
|
string: Ut,
|
|
3164
3169
|
text: Wt,
|
|
3165
3170
|
custom: ht,
|
|
3166
3171
|
upload: jt,
|
|
3167
|
-
qr:
|
|
3168
|
-
"multi-string":
|
|
3172
|
+
qr: $t,
|
|
3173
|
+
"multi-string": qe,
|
|
3169
3174
|
"multi-select": pt,
|
|
3170
|
-
radio:
|
|
3171
|
-
},
|
|
3175
|
+
radio: Vt
|
|
3176
|
+
}, Bs = {
|
|
3172
3177
|
date: Rs,
|
|
3173
3178
|
number: Ls,
|
|
3174
3179
|
boolean: Ns,
|
|
@@ -3177,16 +3182,16 @@ const mn = {
|
|
|
3177
3182
|
text: Ms,
|
|
3178
3183
|
custom: Ts,
|
|
3179
3184
|
upload: _s,
|
|
3180
|
-
qr:
|
|
3185
|
+
qr: As,
|
|
3181
3186
|
"multi-string": Ss,
|
|
3182
3187
|
"multi-select": Fs,
|
|
3183
|
-
radio:
|
|
3188
|
+
radio: Ds
|
|
3184
3189
|
}, ul = {
|
|
3185
3190
|
boolean: "RiCheckboxCircleLine",
|
|
3186
3191
|
date: "RiCalendarLine",
|
|
3187
3192
|
"multi-string": "RiListCheck",
|
|
3188
3193
|
number: "RiHashtag",
|
|
3189
|
-
qr: "
|
|
3194
|
+
qr: "RiFullscreenLine",
|
|
3190
3195
|
"multi-select": "RiCheckboxLine",
|
|
3191
3196
|
select: "RiMenuFoldLine",
|
|
3192
3197
|
string: "RiInputField",
|
|
@@ -3195,10 +3200,10 @@ const mn = {
|
|
|
3195
3200
|
custom: "RiCodeSSlashLine",
|
|
3196
3201
|
section: "RiFolderLine",
|
|
3197
3202
|
radio: "RiRadioButtonFill"
|
|
3198
|
-
}, st = 50, Vs = st * 1e3,
|
|
3199
|
-
const { field: n, ...e } = t, [{ value: i }] =
|
|
3203
|
+
}, st = 50, Vs = st * 1e3, $s = Vs * 1e3, er = P((t) => {
|
|
3204
|
+
const { field: n, ...e } = t, [{ value: i }] = Yt(n.options.clonedFieldIdentifier), r = O(() => {
|
|
3200
3205
|
const o = n.options.getFieldToClone(i);
|
|
3201
|
-
return o ?
|
|
3206
|
+
return o ? mn(o) : null;
|
|
3202
3207
|
}, [n.options, i]);
|
|
3203
3208
|
return ir(r, e);
|
|
3204
3209
|
});
|
|
@@ -3210,32 +3215,32 @@ class Us extends ht {
|
|
|
3210
3215
|
}
|
|
3211
3216
|
const tr = (t) => {
|
|
3212
3217
|
const n = t.type;
|
|
3213
|
-
return
|
|
3214
|
-
},
|
|
3218
|
+
return fn[n].deserialize(t);
|
|
3219
|
+
}, mn = (t) => t.type === "section" ? q.deserialize(t) : tr(t);
|
|
3215
3220
|
function Ws(t) {
|
|
3216
|
-
return t.map((n) =>
|
|
3221
|
+
return t.map((n) => mn(n));
|
|
3217
3222
|
}
|
|
3218
|
-
function
|
|
3223
|
+
function hn(t) {
|
|
3219
3224
|
const n = [];
|
|
3220
3225
|
for (const e of t)
|
|
3221
|
-
if (e instanceof
|
|
3226
|
+
if (e instanceof q)
|
|
3222
3227
|
for (const i of e.fields)
|
|
3223
3228
|
n.push(i);
|
|
3224
3229
|
else {
|
|
3225
|
-
if (!(e instanceof
|
|
3230
|
+
if (!(e instanceof W))
|
|
3226
3231
|
throw new Error(`Invalid field type: ${e.type}`);
|
|
3227
3232
|
n.push(e);
|
|
3228
3233
|
}
|
|
3229
3234
|
return n;
|
|
3230
3235
|
}
|
|
3231
3236
|
function js(t) {
|
|
3232
|
-
const n =
|
|
3237
|
+
const n = hn(t), e = {};
|
|
3233
3238
|
for (const i of n)
|
|
3234
3239
|
e[i.identifier] = i;
|
|
3235
3240
|
return e;
|
|
3236
3241
|
}
|
|
3237
3242
|
function fl(t, n) {
|
|
3238
|
-
const e =
|
|
3243
|
+
const e = hn(t), i = {};
|
|
3239
3244
|
for (const r of e) {
|
|
3240
3245
|
const o = n[r.identifier] ?? null;
|
|
3241
3246
|
o !== null ? i[r.identifier] = r.decodeJsonToValue(o) : i[r.identifier] = o;
|
|
@@ -3243,7 +3248,7 @@ function fl(t, n) {
|
|
|
3243
3248
|
return i;
|
|
3244
3249
|
}
|
|
3245
3250
|
function ml(t, n) {
|
|
3246
|
-
const e =
|
|
3251
|
+
const e = hn(t), i = {};
|
|
3247
3252
|
for (const r of e) {
|
|
3248
3253
|
const o = n[r.identifier];
|
|
3249
3254
|
i[r.identifier] = r.encodeValueToJson(o);
|
|
@@ -3268,26 +3273,26 @@ const ir = (t, n) => O(() => !n || !t ? null : t.getInput(n), [t, n]), yt = (t,
|
|
|
3268
3273
|
const e = O(() => t.map((i) => /* @__PURE__ */ l(Kn, { children: i.getInput(n) }, i.getId())), [t, n]);
|
|
3269
3274
|
return /* @__PURE__ */ l("div", { className: "flex flex-col gap-4", children: e });
|
|
3270
3275
|
}, rr = P((t) => {
|
|
3271
|
-
const { field: n, ...e } = t, { label: i, description: r, fields: o, condition: s } = n, { values: a, setFieldValue:
|
|
3272
|
-
|
|
3273
|
-
if (!
|
|
3276
|
+
const { field: n, ...e } = t, { label: i, description: r, fields: o, condition: s } = n, { values: a, setFieldValue: u } = xe(), f = s != null && s.identifier ? se(a, s.identifier) : void 0, m = O(() => nr(s, f), [s, f]);
|
|
3277
|
+
H(() => {
|
|
3278
|
+
if (!m)
|
|
3274
3279
|
for (const p of o)
|
|
3275
|
-
|
|
3276
|
-
}, [
|
|
3277
|
-
const
|
|
3278
|
-
return
|
|
3279
|
-
(i || r) && /* @__PURE__ */
|
|
3280
|
-
/* @__PURE__ */
|
|
3280
|
+
u(p.getId(), "").then();
|
|
3281
|
+
}, [m, o, u]);
|
|
3282
|
+
const d = yt(o, e);
|
|
3283
|
+
return m ? /* @__PURE__ */ l(Ke, { variant: "soft", children: /* @__PURE__ */ E("div", { className: "flex flex-col gap-4", children: [
|
|
3284
|
+
(i || r) && /* @__PURE__ */ E(pe, { children: [
|
|
3285
|
+
/* @__PURE__ */ E("div", { className: "flex flex-col", children: [
|
|
3281
3286
|
/* @__PURE__ */ l(Hn, { size: "md", children: i }),
|
|
3282
|
-
/* @__PURE__ */ l(
|
|
3287
|
+
/* @__PURE__ */ l(ae, { accentColor: "base", children: r })
|
|
3283
3288
|
] }),
|
|
3284
3289
|
/* @__PURE__ */ l(jn, { size: "full" })
|
|
3285
3290
|
] }),
|
|
3286
|
-
|
|
3291
|
+
d
|
|
3287
3292
|
] }) }) : null;
|
|
3288
3293
|
});
|
|
3289
3294
|
rr.displayName = "FieldSectionLayout";
|
|
3290
|
-
const _e = class _e extends
|
|
3295
|
+
const _e = class _e extends Zn {
|
|
3291
3296
|
constructor(e) {
|
|
3292
3297
|
const { label: i = null, fields: r, condition: o = null, conditional: s, ...a } = e;
|
|
3293
3298
|
super({ ...a, type: "section" });
|
|
@@ -3301,7 +3306,7 @@ const _e = class _e extends Jn {
|
|
|
3301
3306
|
const r = i && `${i}.`;
|
|
3302
3307
|
return [
|
|
3303
3308
|
{
|
|
3304
|
-
field: new
|
|
3309
|
+
field: new He({
|
|
3305
3310
|
label: "Conditionally render section",
|
|
3306
3311
|
identifier: `${r}conditional`,
|
|
3307
3312
|
required: !1
|
|
@@ -3385,7 +3390,7 @@ const _e = class _e extends Jn {
|
|
|
3385
3390
|
getErrors(e) {
|
|
3386
3391
|
const i = {};
|
|
3387
3392
|
for (const r of this.fields) {
|
|
3388
|
-
const o = r.getId(), s = r.getError(
|
|
3393
|
+
const o = r.getId(), s = r.getError(se(e, o), e);
|
|
3389
3394
|
s && Ve(i, r.getId(), s);
|
|
3390
3395
|
}
|
|
3391
3396
|
return i;
|
|
@@ -3395,28 +3400,28 @@ const _e = class _e extends Jn {
|
|
|
3395
3400
|
}
|
|
3396
3401
|
};
|
|
3397
3402
|
I(_e, "fieldTypeName", "Section"), I(_e, "fieldTypeDescription", "Sections can be useful for grouping fields together. They can also be conditionally shown or hidden.");
|
|
3398
|
-
let
|
|
3399
|
-
const he = (t) => Object.keys(t).length > 0,
|
|
3403
|
+
let q = _e;
|
|
3404
|
+
const he = (t) => Object.keys(t).length > 0, pn = (t, n) => {
|
|
3400
3405
|
const e = {};
|
|
3401
3406
|
for (const i of t)
|
|
3402
|
-
if (i instanceof
|
|
3407
|
+
if (i instanceof q) {
|
|
3403
3408
|
if (i.condition) {
|
|
3404
3409
|
const { identifier: r } = i.condition;
|
|
3405
|
-
if (!nr(i.condition,
|
|
3410
|
+
if (!nr(i.condition, se(n, r)))
|
|
3406
3411
|
continue;
|
|
3407
3412
|
}
|
|
3408
3413
|
Object.assign(e, i.getErrors(n));
|
|
3409
3414
|
} else {
|
|
3410
|
-
if (!(i instanceof
|
|
3415
|
+
if (!(i instanceof W))
|
|
3411
3416
|
throw new Error("Invalid field type");
|
|
3412
|
-
const r = i.getId(), o = i.getError(
|
|
3417
|
+
const r = i.getId(), o = i.getError(se(n, r), n);
|
|
3413
3418
|
o && Ve(e, r, o);
|
|
3414
3419
|
}
|
|
3415
3420
|
if (he(e)) return e;
|
|
3416
|
-
},
|
|
3421
|
+
}, gn = (t, n) => t.reduce(
|
|
3417
3422
|
(e, i) => {
|
|
3418
|
-
if (i instanceof
|
|
3419
|
-
return { ...e, ...
|
|
3423
|
+
if (i instanceof q)
|
|
3424
|
+
return { ...e, ...gn(i.fields, n) };
|
|
3420
3425
|
const r = i.getId(), o = e[r];
|
|
3421
3426
|
switch (o) {
|
|
3422
3427
|
case "":
|
|
@@ -3437,15 +3442,15 @@ const he = (t) => Object.keys(t).length > 0, gn = (t, n) => {
|
|
|
3437
3442
|
// unknown reason.
|
|
3438
3443
|
kr(n)
|
|
3439
3444
|
), or = (t, n, e) => t.reduce((i, r) => {
|
|
3440
|
-
if (r instanceof
|
|
3445
|
+
if (r instanceof q)
|
|
3441
3446
|
return { ...i, ...or(r.fields, n, e) };
|
|
3442
|
-
if (r instanceof
|
|
3447
|
+
if (r instanceof W) {
|
|
3443
3448
|
const o = r.getId(), s = n[o], a = e[o];
|
|
3444
3449
|
r.isEqual(s, a) || Ve(i, o, a);
|
|
3445
3450
|
}
|
|
3446
3451
|
return i;
|
|
3447
3452
|
}, {}), qs = P(
|
|
3448
|
-
|
|
3453
|
+
Xe((t, n) => {
|
|
3449
3454
|
const {
|
|
3450
3455
|
schema: e,
|
|
3451
3456
|
values: i = {},
|
|
@@ -3453,71 +3458,71 @@ const he = (t) => Object.keys(t).length > 0, gn = (t, n) => {
|
|
|
3453
3458
|
onSubmit: o,
|
|
3454
3459
|
submitText: s = "Submit",
|
|
3455
3460
|
cancelText: a,
|
|
3456
|
-
onCancel:
|
|
3457
|
-
onDirty:
|
|
3458
|
-
onDirtyChange:
|
|
3461
|
+
onCancel: u,
|
|
3462
|
+
onDirty: f,
|
|
3463
|
+
onDirtyChange: m,
|
|
3459
3464
|
// if the title isn't provided, hide it by default
|
|
3460
|
-
hideTitle:
|
|
3465
|
+
hideTitle: d = !e.title,
|
|
3461
3466
|
hideDescription: p,
|
|
3462
3467
|
className: b,
|
|
3463
3468
|
buttonProps: y,
|
|
3464
3469
|
enableReinitialize: c = !1,
|
|
3465
3470
|
excludeUnchangedFields: v = !1
|
|
3466
|
-
} = t, { readonly: w } = e.meta,
|
|
3467
|
-
(
|
|
3468
|
-
o == null || o(v ? or(e.fields, g,
|
|
3471
|
+
} = t, { readonly: w } = e.meta, C = pr(), g = O(() => gn(e.fields, i), [e.fields, i]), S = R(
|
|
3472
|
+
(k) => {
|
|
3473
|
+
o == null || o(v ? or(e.fields, g, k) : k);
|
|
3469
3474
|
},
|
|
3470
3475
|
[v, g, o, e.fields]
|
|
3471
|
-
),
|
|
3476
|
+
), x = Jt({
|
|
3472
3477
|
initialValues: g,
|
|
3473
3478
|
onSubmit: S,
|
|
3474
|
-
validate: (
|
|
3479
|
+
validate: (k) => pn(e.fields, k),
|
|
3475
3480
|
// only validate the entire form on submit
|
|
3476
3481
|
validateOnBlur: !1,
|
|
3477
3482
|
validateOnChange: !1,
|
|
3478
3483
|
enableReinitialize: c
|
|
3479
|
-
}), { dirty: F } =
|
|
3484
|
+
}), { dirty: F } = x, N = O(
|
|
3480
3485
|
() => typeof e.title == "string" ? /* @__PURE__ */ l(Hn, { size: "md", children: e.title }) : e.title,
|
|
3481
3486
|
[e.title]
|
|
3482
3487
|
), T = O(
|
|
3483
|
-
() => typeof e.description == "string" ? /* @__PURE__ */ l(
|
|
3488
|
+
() => typeof e.description == "string" ? /* @__PURE__ */ l(ae, { accentColor: "base", children: e.description }) : e.description,
|
|
3484
3489
|
[e.description]
|
|
3485
|
-
),
|
|
3486
|
-
(
|
|
3487
|
-
js(e.fields)[
|
|
3490
|
+
), D = R(
|
|
3491
|
+
(k, V) => {
|
|
3492
|
+
js(e.fields)[k].isEqual(g[k], V) || r == null || r({ ...x.values, [k]: V }, { [k]: V });
|
|
3488
3493
|
},
|
|
3489
|
-
[
|
|
3490
|
-
),
|
|
3491
|
-
return
|
|
3492
|
-
F &&
|
|
3493
|
-
}, [F,
|
|
3494
|
+
[x.values, g, r, e.fields]
|
|
3495
|
+
), M = yt(e.fields, { formId: C, disabled: w, onValuesChange: D });
|
|
3496
|
+
return H(() => {
|
|
3497
|
+
F && f && f(), m && m(F);
|
|
3498
|
+
}, [F, f, m]), /* @__PURE__ */ l(Zt, { value: x, children: /* @__PURE__ */ E(
|
|
3494
3499
|
"form",
|
|
3495
3500
|
{
|
|
3496
|
-
id:
|
|
3501
|
+
id: C,
|
|
3497
3502
|
ref: n,
|
|
3498
3503
|
className: je(b, "flex flex-col gap-2"),
|
|
3499
|
-
onSubmit:
|
|
3504
|
+
onSubmit: x.handleSubmit,
|
|
3500
3505
|
children: [
|
|
3501
|
-
!
|
|
3506
|
+
!d && /* @__PURE__ */ l(Ke, { variant: "soft", children: /* @__PURE__ */ E("div", { className: "flex flex-col gap-1", children: [
|
|
3502
3507
|
N,
|
|
3503
3508
|
!p && T
|
|
3504
3509
|
] }) }),
|
|
3505
|
-
|
|
3506
|
-
!w && /* @__PURE__ */
|
|
3507
|
-
a && /* @__PURE__ */
|
|
3508
|
-
|
|
3510
|
+
M,
|
|
3511
|
+
!w && /* @__PURE__ */ E("div", { className: "flex items-center justify-end gap-2", children: [
|
|
3512
|
+
a && /* @__PURE__ */ E(
|
|
3513
|
+
G,
|
|
3509
3514
|
{
|
|
3510
3515
|
accentColor: ge.danger,
|
|
3511
3516
|
...y,
|
|
3512
3517
|
type: "button",
|
|
3513
|
-
onClick:
|
|
3518
|
+
onClick: u,
|
|
3514
3519
|
children: [
|
|
3515
3520
|
/* @__PURE__ */ l(L, { icon: "RiCloseLine" }),
|
|
3516
3521
|
a
|
|
3517
3522
|
]
|
|
3518
3523
|
}
|
|
3519
3524
|
),
|
|
3520
|
-
/* @__PURE__ */
|
|
3525
|
+
/* @__PURE__ */ E(G, { ...y, type: "submit", disabled: !x.isValid, accentColor: "success", children: [
|
|
3521
3526
|
/* @__PURE__ */ l(L, { icon: "RiCheckLine" }),
|
|
3522
3527
|
s
|
|
3523
3528
|
] })
|
|
@@ -3527,14 +3532,14 @@ const he = (t) => Object.keys(t).length > 0, gn = (t, n) => {
|
|
|
3527
3532
|
) });
|
|
3528
3533
|
})
|
|
3529
3534
|
), We = P((t) => {
|
|
3530
|
-
const { name: n, render: e } = t, { submitForm: i } = xe(), [r, o, s] =
|
|
3531
|
-
const
|
|
3532
|
-
s.setValue(
|
|
3535
|
+
const { name: n, render: e } = t, { submitForm: i } = xe(), [r, o, s] = Yt(n), a = O(() => {
|
|
3536
|
+
const u = (f) => {
|
|
3537
|
+
s.setValue(f, !1);
|
|
3533
3538
|
};
|
|
3534
3539
|
return e({
|
|
3535
3540
|
value: r.value,
|
|
3536
3541
|
meta: o,
|
|
3537
|
-
setValue:
|
|
3542
|
+
setValue: u,
|
|
3538
3543
|
patchValue: () => {
|
|
3539
3544
|
i();
|
|
3540
3545
|
}
|
|
@@ -3544,57 +3549,57 @@ const he = (t) => Object.keys(t).length > 0, gn = (t, n) => {
|
|
|
3544
3549
|
});
|
|
3545
3550
|
We.displayName = "PatchField";
|
|
3546
3551
|
const hl = P(
|
|
3547
|
-
|
|
3548
|
-
const { children: e, schema: i, values: r, onPatch: o, onError: s, requiresDiff: a = !0, onDirtyChange:
|
|
3549
|
-
(
|
|
3552
|
+
Xe((t, n) => {
|
|
3553
|
+
const { children: e, schema: i, values: r, onPatch: o, onError: s, requiresDiff: a = !0, onDirtyChange: u, ...f } = t, m = O(() => gn(i.fields, r), [i.fields, r]), d = R(
|
|
3554
|
+
(C) => {
|
|
3550
3555
|
const g = {};
|
|
3551
|
-
for (const S in
|
|
3552
|
-
const
|
|
3553
|
-
|
|
3556
|
+
for (const S in C) {
|
|
3557
|
+
const x = C[S];
|
|
3558
|
+
x !== m[S] && x !== void 0 && (g[S] = x);
|
|
3554
3559
|
}
|
|
3555
3560
|
return g;
|
|
3556
3561
|
},
|
|
3557
|
-
[
|
|
3562
|
+
[m]
|
|
3558
3563
|
), p = R(
|
|
3559
|
-
(
|
|
3560
|
-
const g =
|
|
3564
|
+
(C) => {
|
|
3565
|
+
const g = d(C);
|
|
3561
3566
|
a && !he(g) || o(g);
|
|
3562
3567
|
},
|
|
3563
|
-
[
|
|
3568
|
+
[d, o, a]
|
|
3564
3569
|
), b = R(
|
|
3565
|
-
(
|
|
3566
|
-
const g =
|
|
3567
|
-
if (g && s(g),
|
|
3568
|
-
const S =
|
|
3569
|
-
|
|
3570
|
+
(C) => {
|
|
3571
|
+
const g = pn(i.fields, C);
|
|
3572
|
+
if (g && s(g), u) {
|
|
3573
|
+
const S = d(C);
|
|
3574
|
+
u(he(S));
|
|
3570
3575
|
}
|
|
3571
3576
|
return g;
|
|
3572
3577
|
},
|
|
3573
|
-
[i.fields,
|
|
3578
|
+
[i.fields, u, s, d]
|
|
3574
3579
|
), y = Jt({
|
|
3575
|
-
initialValues:
|
|
3580
|
+
initialValues: m,
|
|
3576
3581
|
onSubmit: p,
|
|
3577
3582
|
validate: b,
|
|
3578
3583
|
// only validate the entire form on submit
|
|
3579
3584
|
validateOnBlur: !1,
|
|
3580
3585
|
validateOnChange: !1
|
|
3581
3586
|
}), c = R(() => {
|
|
3582
|
-
if (
|
|
3583
|
-
const
|
|
3584
|
-
he(
|
|
3587
|
+
if (u) {
|
|
3588
|
+
const C = d(y.values);
|
|
3589
|
+
he(C) && u(!0);
|
|
3585
3590
|
}
|
|
3586
|
-
}, [y.values,
|
|
3587
|
-
return
|
|
3588
|
-
he(v) && w({ values:
|
|
3589
|
-
}, [v,
|
|
3591
|
+
}, [y.values, d, u]), { errors: v, resetForm: w } = y;
|
|
3592
|
+
return H(() => {
|
|
3593
|
+
he(v) && w({ values: m, errors: {} });
|
|
3594
|
+
}, [v, m, w]), /* @__PURE__ */ l(Zt, { value: y, children: /* @__PURE__ */ l("form", { ...f, ref: n, onSubmit: y.handleSubmit, onChange: c, children: e }) });
|
|
3590
3595
|
})
|
|
3591
3596
|
), lt = "form-builder", Hs = [
|
|
3592
3597
|
["string", "text"],
|
|
3593
3598
|
["select", "multi-select", "upload", "qr", "radio"],
|
|
3594
3599
|
["boolean", "date", "number", "multi-string"]
|
|
3595
3600
|
], Ht = {
|
|
3596
|
-
...
|
|
3597
|
-
section:
|
|
3601
|
+
...fn,
|
|
3602
|
+
section: q
|
|
3598
3603
|
}, Ct = Gn({}), Gs = (t, n) => {
|
|
3599
3604
|
var i;
|
|
3600
3605
|
const e = { ...t };
|
|
@@ -3619,28 +3624,28 @@ const hl = P(
|
|
|
3619
3624
|
if (r.identifier === n) return e;
|
|
3620
3625
|
}
|
|
3621
3626
|
}
|
|
3622
|
-
},
|
|
3627
|
+
}, Vn = (t) => {
|
|
3623
3628
|
var e, i, r;
|
|
3624
3629
|
const n = {};
|
|
3625
3630
|
for (let o = 0; o < t.length; o++) {
|
|
3626
3631
|
const s = t[o];
|
|
3627
3632
|
if (!s) throw new Error("Field is undefined.");
|
|
3628
|
-
const a = o > 0 ? (e = n[t[o - 1].identifier]) == null ? void 0 : e.conditionFields : void 0,
|
|
3629
|
-
(i = s.condition) != null && i.identifier &&
|
|
3633
|
+
const a = o > 0 ? (e = n[t[o - 1].identifier]) == null ? void 0 : e.conditionFields : void 0, u = new Set(a);
|
|
3634
|
+
(i = s.condition) != null && i.identifier && u.add(s.condition.identifier), n[s.identifier] = {
|
|
3630
3635
|
disabled: !1,
|
|
3631
|
-
conditionFields:
|
|
3636
|
+
conditionFields: u,
|
|
3632
3637
|
conditionIndex: Ks(t, (r = s.condition) == null ? void 0 : r.identifier),
|
|
3633
3638
|
index: o,
|
|
3634
3639
|
label: s.label
|
|
3635
3640
|
};
|
|
3636
3641
|
}
|
|
3637
3642
|
return n;
|
|
3638
|
-
},
|
|
3643
|
+
}, vn = P((t) => {
|
|
3639
3644
|
const { index: n, type: e, sectionIndex: i, remove: r, duplicate: o, move: s, upload: a } = t;
|
|
3640
3645
|
if (e !== "section" && !a)
|
|
3641
3646
|
throw new Error("Upload function prop must be defined for non-section fields.");
|
|
3642
|
-
const { values:
|
|
3643
|
-
const
|
|
3647
|
+
const { values: u } = xe(), f = bt(null), m = O(() => {
|
|
3648
|
+
const d = [
|
|
3644
3649
|
{
|
|
3645
3650
|
Icon: Rr,
|
|
3646
3651
|
key: "duplicate",
|
|
@@ -3648,22 +3653,22 @@ const hl = P(
|
|
|
3648
3653
|
buttonProps: { onClick: o }
|
|
3649
3654
|
}
|
|
3650
3655
|
];
|
|
3651
|
-
return
|
|
3656
|
+
return d.push({
|
|
3652
3657
|
Icon: Fr,
|
|
3653
3658
|
key: "delete",
|
|
3654
3659
|
text: "Delete",
|
|
3655
3660
|
buttonProps: { onClick: r }
|
|
3656
|
-
}), e !== "section" &&
|
|
3661
|
+
}), e !== "section" && d.unshift({
|
|
3657
3662
|
Icon: Lr,
|
|
3658
3663
|
key: "upload",
|
|
3659
3664
|
text: "Upload image",
|
|
3660
3665
|
buttonProps: {
|
|
3661
3666
|
onClick: () => {
|
|
3662
3667
|
var p;
|
|
3663
|
-
(p =
|
|
3668
|
+
(p = f.current) == null || p.click();
|
|
3664
3669
|
}
|
|
3665
3670
|
}
|
|
3666
|
-
}), (i === void 0 && n !==
|
|
3671
|
+
}), (i === void 0 && n !== u.fields.length - 1 || i !== void 0 && (i < u.fields.length - 1 || n !== u.fields[i].fields.length - 1)) && d.unshift({
|
|
3667
3672
|
Icon: Dr,
|
|
3668
3673
|
key: "moveDown",
|
|
3669
3674
|
text: "Move down",
|
|
@@ -3672,7 +3677,7 @@ const hl = P(
|
|
|
3672
3677
|
s("down");
|
|
3673
3678
|
}
|
|
3674
3679
|
}
|
|
3675
|
-
}), (i === void 0 && n !== 0 || i !== void 0 && (i !== 0 || n !== 0)) &&
|
|
3680
|
+
}), (i === void 0 && n !== 0 || i !== void 0 && (i !== 0 || n !== 0)) && d.unshift({
|
|
3676
3681
|
Icon: Ar,
|
|
3677
3682
|
key: "moveUp",
|
|
3678
3683
|
text: "Move up",
|
|
@@ -3681,22 +3686,22 @@ const hl = P(
|
|
|
3681
3686
|
s("up");
|
|
3682
3687
|
}
|
|
3683
3688
|
}
|
|
3684
|
-
}),
|
|
3685
|
-
}, [o, n, s, r, i, e,
|
|
3686
|
-
return /* @__PURE__ */
|
|
3687
|
-
/* @__PURE__ */ l(
|
|
3688
|
-
|
|
3689
|
+
}), d;
|
|
3690
|
+
}, [o, n, s, r, i, e, u.fields]);
|
|
3691
|
+
return /* @__PURE__ */ E(pe, { children: [
|
|
3692
|
+
/* @__PURE__ */ l(Kt, { className: "mx-2 hidden flex-col gap-0.5 sm:flex", variant: "ghost", accentColor: "base", size: "sm", children: m.map((d) => /* @__PURE__ */ l(
|
|
3693
|
+
J,
|
|
3689
3694
|
{
|
|
3690
3695
|
type: "button",
|
|
3691
|
-
"aria-label":
|
|
3692
|
-
...
|
|
3693
|
-
children: /* @__PURE__ */ l(
|
|
3696
|
+
"aria-label": d.text,
|
|
3697
|
+
...d.buttonProps,
|
|
3698
|
+
children: /* @__PURE__ */ l(d.Icon, {})
|
|
3694
3699
|
},
|
|
3695
|
-
|
|
3700
|
+
d.key
|
|
3696
3701
|
)) }),
|
|
3697
|
-
/* @__PURE__ */ l("div", { className: "sm:hidden", children: /* @__PURE__ */
|
|
3698
|
-
/* @__PURE__ */ l(
|
|
3699
|
-
|
|
3702
|
+
/* @__PURE__ */ l("div", { className: "sm:hidden", children: /* @__PURE__ */ E(B.Root, { children: [
|
|
3703
|
+
/* @__PURE__ */ l(B.ClickTrigger, { children: /* @__PURE__ */ l(
|
|
3704
|
+
J,
|
|
3700
3705
|
{
|
|
3701
3706
|
variant: "ghost",
|
|
3702
3707
|
accentColor: "base",
|
|
@@ -3706,23 +3711,23 @@ const hl = P(
|
|
|
3706
3711
|
children: /* @__PURE__ */ l(L, { icon: "RiMore2Line" })
|
|
3707
3712
|
}
|
|
3708
3713
|
) }),
|
|
3709
|
-
/* @__PURE__ */ l(
|
|
3714
|
+
/* @__PURE__ */ l(B.Content, { children: m.map((d) => {
|
|
3710
3715
|
var p;
|
|
3711
|
-
return /* @__PURE__ */
|
|
3712
|
-
/* @__PURE__ */ l(
|
|
3713
|
-
|
|
3714
|
-
] },
|
|
3716
|
+
return /* @__PURE__ */ E(B.Item, { onClick: (p = d.buttonProps) == null ? void 0 : p.onClick, children: [
|
|
3717
|
+
/* @__PURE__ */ l(d.Icon, {}),
|
|
3718
|
+
d.text
|
|
3719
|
+
] }, d.key);
|
|
3715
3720
|
}) })
|
|
3716
3721
|
] }) }),
|
|
3717
|
-
e !== "section" && /* @__PURE__ */ l("input", { style: { display: "none" }, ref:
|
|
3722
|
+
e !== "section" && /* @__PURE__ */ l("input", { style: { display: "none" }, ref: f, type: "file", accept: "image/*", onChange: a })
|
|
3718
3723
|
] });
|
|
3719
3724
|
});
|
|
3720
|
-
|
|
3725
|
+
vn.displayName = "FieldActions";
|
|
3721
3726
|
const Gt = P((t) => {
|
|
3722
3727
|
const { popoverInputs: n, hasError: e, ...i } = t;
|
|
3723
|
-
return /* @__PURE__ */
|
|
3724
|
-
/* @__PURE__ */ l(
|
|
3725
|
-
|
|
3728
|
+
return /* @__PURE__ */ E(Be.Root, { children: [
|
|
3729
|
+
/* @__PURE__ */ l(Be.Trigger, { asChild: !0, children: /* @__PURE__ */ E(
|
|
3730
|
+
G,
|
|
3726
3731
|
{
|
|
3727
3732
|
variant: "soft",
|
|
3728
3733
|
type: "button",
|
|
@@ -3737,12 +3742,12 @@ const Gt = P((t) => {
|
|
|
3737
3742
|
},
|
|
3738
3743
|
"settings"
|
|
3739
3744
|
) }),
|
|
3740
|
-
/* @__PURE__ */ l(
|
|
3745
|
+
/* @__PURE__ */ l(Be.Content, { size: "sm", ...i, children: /* @__PURE__ */ l("div", { className: "flex w-full max-w-[350px] flex-col", children: n }) })
|
|
3741
3746
|
] });
|
|
3742
3747
|
});
|
|
3743
3748
|
Gt.displayName = "FieldSettingsPopover";
|
|
3744
3749
|
const sr = (t = () => null) => O(() => Hs.map((n) => n.map((e) => {
|
|
3745
|
-
const i =
|
|
3750
|
+
const i = fn[e], r = i.Icon;
|
|
3746
3751
|
return {
|
|
3747
3752
|
children: i.fieldTypeName,
|
|
3748
3753
|
icon: /* @__PURE__ */ l(r, {}),
|
|
@@ -3751,116 +3756,116 @@ const sr = (t = () => null) => O(() => Hs.map((n) => n.map((e) => {
|
|
|
3751
3756
|
t(e);
|
|
3752
3757
|
}
|
|
3753
3758
|
};
|
|
3754
|
-
})), [t]),
|
|
3755
|
-
var Ye, xn, wn, Cn
|
|
3756
|
-
const { parentPath: n, index: e, initial: i, conditionalSourceFields: r } = t, { values: o, setFieldValue: s, errors: a } = xe(),
|
|
3757
|
-
|
|
3759
|
+
})), [t]), $n = 576, yn = P((t) => {
|
|
3760
|
+
var Ye, bn, xn, wn, Cn;
|
|
3761
|
+
const { parentPath: n, index: e, initial: i, conditionalSourceFields: r } = t, { values: o, setFieldValue: s, errors: a } = xe(), u = sr(), f = sn(), { disableRequiredFields: m } = Xt(Ct), d = bt(null), [p, b] = K(
|
|
3762
|
+
d.current && d.current.getBoundingClientRect().width >= $n
|
|
3758
3763
|
);
|
|
3759
|
-
|
|
3760
|
-
const
|
|
3761
|
-
if (
|
|
3762
|
-
const
|
|
3763
|
-
|
|
3764
|
+
H(() => {
|
|
3765
|
+
const A = d.current;
|
|
3766
|
+
if (A) {
|
|
3767
|
+
const _ = new ResizeObserver((j) => {
|
|
3768
|
+
j[0] && b(j[0].contentRect.width >= $n);
|
|
3764
3769
|
});
|
|
3765
|
-
return
|
|
3766
|
-
|
|
3770
|
+
return _.observe(A), () => {
|
|
3771
|
+
_.disconnect();
|
|
3767
3772
|
};
|
|
3768
3773
|
}
|
|
3769
3774
|
}, []);
|
|
3770
|
-
const [y, c] =
|
|
3771
|
-
|
|
3775
|
+
const [y, c] = K(void 0);
|
|
3776
|
+
H(() => {
|
|
3772
3777
|
me(i) ? c(void 0) : i.image instanceof Promise ? i.image.then(c).catch(console.error) : c(i.image);
|
|
3773
3778
|
}, [i]);
|
|
3774
3779
|
const v = y ? URL.createObjectURL(y) : void 0, w = R(
|
|
3775
|
-
(
|
|
3776
|
-
|
|
3777
|
-
const { image:
|
|
3778
|
-
s(`${n}.${e}`,
|
|
3780
|
+
(A) => {
|
|
3781
|
+
A.stopPropagation();
|
|
3782
|
+
const { image: _, ...j } = i;
|
|
3783
|
+
s(`${n}.${e}`, j).then();
|
|
3779
3784
|
},
|
|
3780
3785
|
[e, i, n, s]
|
|
3781
3786
|
);
|
|
3782
|
-
|
|
3787
|
+
H(() => {
|
|
3783
3788
|
me(i) && !i.conditional && s(`${n}.${e}.condition`, null).then();
|
|
3784
3789
|
}, [e, i, n, s]);
|
|
3785
|
-
const
|
|
3790
|
+
const C = O(
|
|
3786
3791
|
() => {
|
|
3787
|
-
var
|
|
3788
|
-
return me(i) ? (
|
|
3792
|
+
var A, _;
|
|
3793
|
+
return me(i) ? (_ = ei(o.fields, (A = i.condition) == null ? void 0 : A.identifier)) == null ? void 0 : _.label : void 0;
|
|
3789
3794
|
},
|
|
3790
3795
|
[i, o.fields]
|
|
3791
3796
|
), g = me(i) ? Array.isArray((Ye = i.condition) == null ? void 0 : Ye.value) ? "contains all of" : "equals" : void 0;
|
|
3792
3797
|
let S;
|
|
3793
3798
|
if (me(i)) {
|
|
3794
|
-
if (qt((
|
|
3799
|
+
if (qt((bn = i.condition) == null ? void 0 : bn.value))
|
|
3795
3800
|
throw new Error("File values are not supported for conditions.");
|
|
3796
|
-
S = Array.isArray((
|
|
3801
|
+
S = Array.isArray((xn = i.condition) == null ? void 0 : xn.value) ? i.condition.value.map((A) => typeof A == "string" ? A : A.label).join(", ") : (Cn = (wn = i.condition) == null ? void 0 : wn.value) == null ? void 0 : Cn.toString();
|
|
3797
3802
|
}
|
|
3798
|
-
const
|
|
3799
|
-
|
|
3800
|
-
}, []), F = R((
|
|
3801
|
-
|
|
3802
|
-
}, []), N = i.type, T = Ht[N], [
|
|
3803
|
-
let
|
|
3804
|
-
if (T ===
|
|
3803
|
+
const x = R((A) => {
|
|
3804
|
+
A.target.parentNode instanceof HTMLElement && (A.target.parentNode.dataset.replicatedValue = A.target.value);
|
|
3805
|
+
}, []), F = R((A) => {
|
|
3806
|
+
A.target.parentNode instanceof HTMLElement && (A.target.parentNode.dataset.replicatedValue = A.target.value);
|
|
3807
|
+
}, []), N = i.type, T = Ht[N], [D, M] = O(() => {
|
|
3808
|
+
let A = [], _ = [];
|
|
3809
|
+
if (T === q) {
|
|
3805
3810
|
if (r === void 0)
|
|
3806
3811
|
throw new Error("Conditional source fields must be provided when changing sections.");
|
|
3807
|
-
const
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
),
|
|
3811
|
-
|
|
3812
|
+
const j = T.getFieldCreationSchema(r, `${n}.${e}`);
|
|
3813
|
+
A = A.concat(
|
|
3814
|
+
j.filter(($) => $.showDirectly).map(($) => $.field)
|
|
3815
|
+
), _ = _.concat(
|
|
3816
|
+
j.filter(($) => !$.showDirectly).map(($) => $.field)
|
|
3812
3817
|
);
|
|
3813
3818
|
} else {
|
|
3814
|
-
if (!(T.prototype instanceof
|
|
3819
|
+
if (!(T.prototype instanceof W))
|
|
3815
3820
|
throw new Error(`Field must be an instance of BaseField. Got ${T.toString()}.`);
|
|
3816
|
-
const
|
|
3821
|
+
const j = T.getFieldCreationSchema(
|
|
3817
3822
|
`${n}.${e}`
|
|
3818
3823
|
);
|
|
3819
|
-
p ? (
|
|
3820
|
-
...
|
|
3821
|
-
...
|
|
3822
|
-
],
|
|
3823
|
-
...
|
|
3824
|
-
...
|
|
3825
|
-
]) :
|
|
3824
|
+
p ? (A = [
|
|
3825
|
+
...A,
|
|
3826
|
+
...j.filter(($) => $.showDirectly).map(($) => $.field)
|
|
3827
|
+
], _ = [
|
|
3828
|
+
..._,
|
|
3829
|
+
...j.filter(($) => !$.showDirectly).map(($) => $.field)
|
|
3830
|
+
]) : _ = [..._, ...j.map(($) => $.field)];
|
|
3826
3831
|
}
|
|
3827
|
-
return [
|
|
3828
|
-
}, [T, r, n, e, p]),
|
|
3832
|
+
return [A, _];
|
|
3833
|
+
}, [T, r, n, e, p]), k = yt(D, {
|
|
3829
3834
|
formId: lt,
|
|
3830
3835
|
disabled: !1,
|
|
3831
|
-
...T ===
|
|
3832
|
-
}),
|
|
3836
|
+
...T === q && { size: "sm" }
|
|
3837
|
+
}), V = yt(M, {
|
|
3833
3838
|
formId: lt,
|
|
3834
3839
|
disabled: !1
|
|
3835
3840
|
});
|
|
3836
|
-
let X =
|
|
3837
|
-
me(i) &&
|
|
3838
|
-
const
|
|
3839
|
-
const
|
|
3840
|
-
return
|
|
3841
|
-
}),
|
|
3842
|
-
() =>
|
|
3843
|
-
[
|
|
3841
|
+
let X = M.length > 0;
|
|
3842
|
+
me(i) && M.length > 0 && (X = i.conditional);
|
|
3843
|
+
const le = M.some((A) => {
|
|
3844
|
+
const _ = se(a, T === q ? `${n}.${e}.condition` : A.getId());
|
|
3845
|
+
return _ && (typeof _ != "object" || he(_));
|
|
3846
|
+
}), z = le ? ge.danger : void 0, Y = O(() => mn(i), [i]), Ce = ir(Y, { formId: lt, showInputOnly: !1 }), de = O(
|
|
3847
|
+
() => u.flat().find((A) => A.value === N),
|
|
3848
|
+
[u, N]
|
|
3844
3849
|
), Et = R(() => {
|
|
3845
|
-
y &&
|
|
3850
|
+
y && f(() => ({
|
|
3846
3851
|
file: y
|
|
3847
3852
|
}));
|
|
3848
|
-
}, [
|
|
3849
|
-
return /* @__PURE__ */ l("div", { className: "flex grow items-center w-full", ref:
|
|
3850
|
-
T ===
|
|
3851
|
-
|
|
3852
|
-
X && /* @__PURE__ */
|
|
3853
|
+
}, [f, y]);
|
|
3854
|
+
return /* @__PURE__ */ l("div", { className: "flex grow items-center w-full", ref: d, children: /* @__PURE__ */ E("div", { className: "flex w-full flex-col gap-2", children: [
|
|
3855
|
+
T === q && (D.length > 0 || X) && /* @__PURE__ */ E("div", { className: "flex flex-col gap-2", children: [
|
|
3856
|
+
k,
|
|
3857
|
+
X && /* @__PURE__ */ E("div", { className: "flex items-center gap-4", children: [
|
|
3853
3858
|
/* @__PURE__ */ l(
|
|
3854
3859
|
Gt,
|
|
3855
3860
|
{
|
|
3856
|
-
popoverInputs:
|
|
3857
|
-
hasError:
|
|
3861
|
+
popoverInputs: V,
|
|
3862
|
+
hasError: le,
|
|
3858
3863
|
align: "start"
|
|
3859
3864
|
}
|
|
3860
3865
|
),
|
|
3861
|
-
me(i) && i.conditional && /* @__PURE__ */ l("span", { className: "text-sm text-(--accent-a11)", "data-accent-color":
|
|
3866
|
+
me(i) && i.conditional && /* @__PURE__ */ l("span", { className: "text-sm text-(--accent-a11)", "data-accent-color": z, children: /* @__PURE__ */ E("em", { children: [
|
|
3862
3867
|
"Display only if ",
|
|
3863
|
-
/* @__PURE__ */ l("strong", { children:
|
|
3868
|
+
/* @__PURE__ */ l("strong", { children: C }),
|
|
3864
3869
|
" ",
|
|
3865
3870
|
g,
|
|
3866
3871
|
" ",
|
|
@@ -3868,27 +3873,27 @@ const sr = (t = () => null) => O(() => Hs.map((n) => n.map((e) => {
|
|
|
3868
3873
|
] }) })
|
|
3869
3874
|
] })
|
|
3870
3875
|
] }),
|
|
3871
|
-
T !==
|
|
3872
|
-
/* @__PURE__ */
|
|
3873
|
-
/* @__PURE__ */
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
+
T !== q && /* @__PURE__ */ E("div", { className: "flex gap-2 w-full justify-between", children: [
|
|
3877
|
+
/* @__PURE__ */ E("div", { className: "flex gap-2 items-center", children: [
|
|
3878
|
+
/* @__PURE__ */ E(Ot, { accentColor: "base", variant: "soft", size: "sm", children: [
|
|
3879
|
+
de == null ? void 0 : de.icon,
|
|
3880
|
+
de == null ? void 0 : de.children
|
|
3876
3881
|
] }),
|
|
3877
|
-
!
|
|
3882
|
+
!m && /* @__PURE__ */ l(
|
|
3878
3883
|
We,
|
|
3879
3884
|
{
|
|
3880
3885
|
name: `${n}.${e}.required`,
|
|
3881
|
-
render: ({ setValue:
|
|
3886
|
+
render: ({ setValue: A, value: _ }) => /* @__PURE__ */ E("div", { className: "flex items-center gap-2", children: [
|
|
3882
3887
|
/* @__PURE__ */ l(
|
|
3883
3888
|
at.Root,
|
|
3884
3889
|
{
|
|
3885
|
-
checked:
|
|
3886
|
-
onCheckedChange:
|
|
3890
|
+
checked: _,
|
|
3891
|
+
onCheckedChange: A,
|
|
3887
3892
|
size: "sm",
|
|
3888
3893
|
children: /* @__PURE__ */ l(at.Indicator, { children: /* @__PURE__ */ l(L, { icon: "RiCheckLine" }) })
|
|
3889
3894
|
}
|
|
3890
3895
|
),
|
|
3891
|
-
/* @__PURE__ */ l(
|
|
3896
|
+
/* @__PURE__ */ l(ae, { size: "sm", accentColor: "base", children: "Required" })
|
|
3892
3897
|
] })
|
|
3893
3898
|
}
|
|
3894
3899
|
)
|
|
@@ -3896,13 +3901,13 @@ const sr = (t = () => null) => O(() => Hs.map((n) => n.map((e) => {
|
|
|
3896
3901
|
X && /* @__PURE__ */ l(
|
|
3897
3902
|
Gt,
|
|
3898
3903
|
{
|
|
3899
|
-
popoverInputs:
|
|
3900
|
-
hasError:
|
|
3904
|
+
popoverInputs: V,
|
|
3905
|
+
hasError: le,
|
|
3901
3906
|
align: "end"
|
|
3902
3907
|
}
|
|
3903
3908
|
)
|
|
3904
3909
|
] }),
|
|
3905
|
-
y && /* @__PURE__ */
|
|
3910
|
+
y && /* @__PURE__ */ E("div", { className: "group relative inline-block w-full min-w-[300px]", children: [
|
|
3906
3911
|
/* @__PURE__ */ l(
|
|
3907
3912
|
"img",
|
|
3908
3913
|
{
|
|
@@ -3913,7 +3918,7 @@ const sr = (t = () => null) => O(() => Hs.map((n) => n.map((e) => {
|
|
|
3913
3918
|
}
|
|
3914
3919
|
),
|
|
3915
3920
|
/* @__PURE__ */ l(
|
|
3916
|
-
|
|
3921
|
+
J,
|
|
3917
3922
|
{
|
|
3918
3923
|
className: "absolute top-2 right-2 hidden group-hover:not-disabled:flex",
|
|
3919
3924
|
variant: "solid",
|
|
@@ -3929,16 +3934,16 @@ const sr = (t = () => null) => O(() => Hs.map((n) => n.map((e) => {
|
|
|
3929
3934
|
We,
|
|
3930
3935
|
{
|
|
3931
3936
|
name: `${n}.${e}.label`,
|
|
3932
|
-
render: ({ setValue:
|
|
3937
|
+
render: ({ setValue: A, value: _ }) => /* @__PURE__ */ l(
|
|
3933
3938
|
"input",
|
|
3934
3939
|
{
|
|
3935
3940
|
className: "bg-transparent outline-none text-sm placeholder-(--base-a9)",
|
|
3936
3941
|
placeholder: N === "section" ? "Enter a section label (optional)" : "Enter your question",
|
|
3937
|
-
value:
|
|
3938
|
-
onChange: (
|
|
3939
|
-
|
|
3942
|
+
value: _,
|
|
3943
|
+
onChange: (j) => {
|
|
3944
|
+
A(j.target.value);
|
|
3940
3945
|
},
|
|
3941
|
-
onInput:
|
|
3946
|
+
onInput: x,
|
|
3942
3947
|
maxLength: 200
|
|
3943
3948
|
}
|
|
3944
3949
|
)
|
|
@@ -3948,14 +3953,14 @@ const sr = (t = () => null) => O(() => Hs.map((n) => n.map((e) => {
|
|
|
3948
3953
|
We,
|
|
3949
3954
|
{
|
|
3950
3955
|
name: `${n}.${e}.description`,
|
|
3951
|
-
render: ({ setValue:
|
|
3956
|
+
render: ({ setValue: A, value: _ }) => /* @__PURE__ */ l(
|
|
3952
3957
|
"textarea",
|
|
3953
3958
|
{
|
|
3954
3959
|
className: "bg-transparent outline-none text-sm field-sizing-content grow placeholder-(--base-a9)",
|
|
3955
3960
|
placeholder: `Enter a ${N === "section" ? "section" : "field"} description (optional)`,
|
|
3956
|
-
value:
|
|
3957
|
-
onChange: (
|
|
3958
|
-
|
|
3961
|
+
value: _,
|
|
3962
|
+
onChange: (j) => {
|
|
3963
|
+
A(j.target.value);
|
|
3959
3964
|
},
|
|
3960
3965
|
onInput: F,
|
|
3961
3966
|
maxLength: 1e3
|
|
@@ -3963,9 +3968,9 @@ const sr = (t = () => null) => O(() => Hs.map((n) => n.map((e) => {
|
|
|
3963
3968
|
)
|
|
3964
3969
|
}
|
|
3965
3970
|
),
|
|
3966
|
-
T !==
|
|
3967
|
-
T !==
|
|
3968
|
-
/* @__PURE__ */
|
|
3971
|
+
T !== q && D.length > 0 && /* @__PURE__ */ l("div", { className: "w-full", children: k }),
|
|
3972
|
+
T !== q && /* @__PURE__ */ E(Ke, { className: "flex gap-4 bg-(--accent-a2) items-center", children: [
|
|
3973
|
+
/* @__PURE__ */ E(St.Root, { children: [
|
|
3969
3974
|
/* @__PURE__ */ l(St.Trigger, { asChild: !0, children: /* @__PURE__ */ l(Ot, { icon: !0, size: "sm", variant: "soft", accentColor: "base", children: /* @__PURE__ */ l(L, { icon: "RiEyeLine" }) }) }),
|
|
3970
3975
|
/* @__PURE__ */ l(St.Content, { className: "w-[225px]", size: "sm", align: "start", children: "This is a preview of the field as it will be rendered in the form." })
|
|
3971
3976
|
] }),
|
|
@@ -3973,36 +3978,36 @@ const sr = (t = () => null) => O(() => Hs.map((n) => n.map((e) => {
|
|
|
3973
3978
|
] })
|
|
3974
3979
|
] }) });
|
|
3975
3980
|
});
|
|
3976
|
-
|
|
3981
|
+
yn.displayName = "FieldBuilder";
|
|
3977
3982
|
const lr = P((t) => {
|
|
3978
|
-
const { field: n, index: e, sectionIndex: i, remove: r } = t, { setFieldValue: o, values: s } = xe(), { reorderField: a } =
|
|
3983
|
+
const { field: n, index: e, sectionIndex: i, remove: r } = t, { setFieldValue: o, values: s } = xe(), { reorderField: a } = on(), { showInfo: u, showError: f } = Ge(), m = `fields.${i}.fields`, d = O(
|
|
3979
3984
|
() => ({
|
|
3980
3985
|
index: e,
|
|
3981
|
-
parentPath:
|
|
3986
|
+
parentPath: m,
|
|
3982
3987
|
initial: n
|
|
3983
3988
|
}),
|
|
3984
|
-
[n, e,
|
|
3989
|
+
[n, e, m]
|
|
3985
3990
|
), p = R(() => {
|
|
3986
3991
|
const c = n.label || "Unlabelled field", v = {
|
|
3987
3992
|
...n,
|
|
3988
3993
|
label: c
|
|
3989
3994
|
};
|
|
3990
|
-
ut(
|
|
3995
|
+
ut(m, e + 1, v, s, o), u({
|
|
3991
3996
|
title: "Field duplicated",
|
|
3992
3997
|
description: `The field "${c}" has been duplicated`
|
|
3993
3998
|
});
|
|
3994
|
-
}, [n,
|
|
3999
|
+
}, [n, m, e, s, o, u]), b = R(
|
|
3995
4000
|
(c) => {
|
|
3996
4001
|
const v = i, w = s.fields[v];
|
|
3997
|
-
let
|
|
3998
|
-
c === "up" && e === 0 ? (
|
|
3999
|
-
const S = s.fields[
|
|
4002
|
+
let C = i, g = c === "up" ? e - 1 : e + 1;
|
|
4003
|
+
c === "up" && e === 0 ? (C = i - 1, g = s.fields[C].fields.length) : c === "down" && e === w.fields.length - 1 && (C = i + 1, g = 0);
|
|
4004
|
+
const S = s.fields[C];
|
|
4000
4005
|
a(
|
|
4001
4006
|
w,
|
|
4002
4007
|
v,
|
|
4003
4008
|
e,
|
|
4004
4009
|
S,
|
|
4005
|
-
|
|
4010
|
+
C,
|
|
4006
4011
|
g,
|
|
4007
4012
|
o
|
|
4008
4013
|
);
|
|
@@ -4014,32 +4019,32 @@ const lr = P((t) => {
|
|
|
4014
4019
|
if (!v || v.length !== 1) return;
|
|
4015
4020
|
const w = v.item(0);
|
|
4016
4021
|
if (w) {
|
|
4017
|
-
if (w.size >
|
|
4018
|
-
|
|
4022
|
+
if (w.size > $s) {
|
|
4023
|
+
f({
|
|
4019
4024
|
title: "File upload error",
|
|
4020
4025
|
description: `The file ${w.name} exceeded the maximum file size`
|
|
4021
4026
|
});
|
|
4022
4027
|
return;
|
|
4023
4028
|
}
|
|
4024
|
-
o(`${
|
|
4029
|
+
o(`${m}.${e}`, {
|
|
4025
4030
|
...n,
|
|
4026
4031
|
image: w
|
|
4027
4032
|
}).then();
|
|
4028
4033
|
}
|
|
4029
4034
|
},
|
|
4030
|
-
[n, e,
|
|
4035
|
+
[n, e, m, o, f]
|
|
4031
4036
|
);
|
|
4032
|
-
return /* @__PURE__ */ l(
|
|
4033
|
-
|
|
4037
|
+
return /* @__PURE__ */ l(en, { draggableId: n.identifier, index: e, children: (c) => /* @__PURE__ */ l(
|
|
4038
|
+
Ke,
|
|
4034
4039
|
{
|
|
4035
4040
|
ref: c.innerRef,
|
|
4036
4041
|
...c.draggableProps,
|
|
4037
4042
|
...c.dragHandleProps,
|
|
4038
4043
|
className: "mb-4",
|
|
4039
|
-
children: /* @__PURE__ */
|
|
4040
|
-
/* @__PURE__ */ l(
|
|
4044
|
+
children: /* @__PURE__ */ E("div", { className: "flex items-center justify-between gap-4 w-full", children: [
|
|
4045
|
+
/* @__PURE__ */ l(yn, { ...d }),
|
|
4041
4046
|
/* @__PURE__ */ l(
|
|
4042
|
-
|
|
4047
|
+
vn,
|
|
4043
4048
|
{
|
|
4044
4049
|
index: e,
|
|
4045
4050
|
type: n.type,
|
|
@@ -4057,63 +4062,63 @@ const lr = P((t) => {
|
|
|
4057
4062
|
lr.displayName = "FieldWithActions";
|
|
4058
4063
|
const ar = P((t) => {
|
|
4059
4064
|
var S;
|
|
4060
|
-
const { field: n, index: e, dropState: i } = t, r = (S = i[n.identifier]) == null ? void 0 : S.disabled, { setFieldValue: o, values: s } = xe(), a = mr(), { reorderSection:
|
|
4061
|
-
(
|
|
4062
|
-
for (const N of
|
|
4065
|
+
const { field: n, index: e, dropState: i } = t, r = (S = i[n.identifier]) == null ? void 0 : S.disabled, { setFieldValue: o, values: s } = xe(), a = mr(), { reorderSection: u } = on(), { showInfo: f } = Ge(), { fieldsOnly: m } = Xt(Ct), d = R(
|
|
4066
|
+
(x, F) => {
|
|
4067
|
+
for (const N of x) {
|
|
4063
4068
|
const T = F.indexOf(N);
|
|
4064
4069
|
o(`fields.${T}.condition`, null).then(), o(`fields.${T}.conditional`, !1).then();
|
|
4065
4070
|
}
|
|
4066
4071
|
},
|
|
4067
4072
|
[o]
|
|
4068
4073
|
), p = R(
|
|
4069
|
-
(
|
|
4074
|
+
(x) => {
|
|
4070
4075
|
var T;
|
|
4071
|
-
const F = n.fields[
|
|
4076
|
+
const F = n.fields[x];
|
|
4072
4077
|
if (!F) throw new Error("Could not find field to remove.");
|
|
4073
4078
|
const N = [];
|
|
4074
|
-
for (const
|
|
4075
|
-
((T =
|
|
4079
|
+
for (const D of s.fields)
|
|
4080
|
+
((T = D.condition) == null ? void 0 : T.identifier) === F.identifier && N.push(D);
|
|
4076
4081
|
return {
|
|
4077
4082
|
removing: F,
|
|
4078
4083
|
affectedSections: N,
|
|
4079
|
-
action: () => o(`fields.${e}.fields`, dt(n.fields,
|
|
4084
|
+
action: () => o(`fields.${e}.fields`, dt(n.fields, x))
|
|
4080
4085
|
};
|
|
4081
4086
|
},
|
|
4082
4087
|
[n.fields, s.fields, o, e]
|
|
4083
4088
|
), b = R(
|
|
4084
|
-
(
|
|
4085
|
-
const { affectedSections: F, action: N, removing: T } = p(
|
|
4086
|
-
N().then(),
|
|
4089
|
+
(x) => {
|
|
4090
|
+
const { affectedSections: F, action: N, removing: T } = p(x), D = () => {
|
|
4091
|
+
N().then(), d(F, s.fields);
|
|
4087
4092
|
};
|
|
4088
4093
|
if (F.length > 0) {
|
|
4089
|
-
const
|
|
4094
|
+
const M = F.map((k) => k.label).join(", ");
|
|
4090
4095
|
a({
|
|
4091
4096
|
title: "Remove condition?",
|
|
4092
|
-
description: `${T.label} is being used as a condition, deleting it will remove the condition from the ${
|
|
4097
|
+
description: `${T.label} is being used as a condition, deleting it will remove the condition from the ${M} section(s).`,
|
|
4093
4098
|
action: "Remove",
|
|
4094
|
-
onAction:
|
|
4099
|
+
onAction: D
|
|
4095
4100
|
});
|
|
4096
4101
|
return;
|
|
4097
4102
|
}
|
|
4098
|
-
|
|
4103
|
+
D();
|
|
4099
4104
|
},
|
|
4100
|
-
[p,
|
|
4105
|
+
[p, d, s.fields, a]
|
|
4101
4106
|
), y = R(() => {
|
|
4102
|
-
const F = n.fields.map((X,
|
|
4107
|
+
const F = n.fields.map((X, le) => p(le)).flatMap((X) => X.affectedSections), N = F.length ? "Remove fields and conditions?" : "Remove fields?", T = n.fields.length, D = F.map((X) => X.label).join(", "), M = F.length ? `Deleting this section will remove the ${T} field(s) it contains and will remove the conditions from following sections: ${D}` : `Deleting this section will remove the ${T} field(s) it contains.`, k = dt(s.fields, e), V = () => o("fields", k);
|
|
4103
4108
|
if (F.length > 0) {
|
|
4104
4109
|
a({
|
|
4105
4110
|
title: N,
|
|
4106
|
-
description:
|
|
4111
|
+
description: M,
|
|
4107
4112
|
action: "Remove",
|
|
4108
4113
|
onAction: () => {
|
|
4109
|
-
|
|
4110
|
-
|
|
4114
|
+
V().then(() => {
|
|
4115
|
+
d(F, k);
|
|
4111
4116
|
});
|
|
4112
4117
|
}
|
|
4113
4118
|
});
|
|
4114
4119
|
return;
|
|
4115
4120
|
}
|
|
4116
|
-
|
|
4121
|
+
V().then();
|
|
4117
4122
|
}, [
|
|
4118
4123
|
n.fields,
|
|
4119
4124
|
s.fields,
|
|
@@ -4121,13 +4126,13 @@ const ar = P((t) => {
|
|
|
4121
4126
|
p,
|
|
4122
4127
|
o,
|
|
4123
4128
|
a,
|
|
4124
|
-
|
|
4129
|
+
d
|
|
4125
4130
|
]), c = R(
|
|
4126
|
-
(
|
|
4127
|
-
const F =
|
|
4128
|
-
|
|
4131
|
+
(x) => {
|
|
4132
|
+
const F = x === "up" ? e - 1 : e + 1;
|
|
4133
|
+
u(i, n.identifier, e, F, s, o);
|
|
4129
4134
|
},
|
|
4130
|
-
[e,
|
|
4135
|
+
[e, u, i, n.identifier, s, o]
|
|
4131
4136
|
), v = O(
|
|
4132
4137
|
() => ({
|
|
4133
4138
|
index: e,
|
|
@@ -4137,44 +4142,44 @@ const ar = P((t) => {
|
|
|
4137
4142
|
}),
|
|
4138
4143
|
[n, e, s.fields]
|
|
4139
4144
|
), w = R(() => {
|
|
4140
|
-
const
|
|
4145
|
+
const x = n.label || "Untitled section", F = n.fields.map((T) => ({
|
|
4141
4146
|
...T,
|
|
4142
|
-
identifier:
|
|
4143
|
-
})), N = { ...n, label:
|
|
4144
|
-
ut("fields", e + 1, N, s, o),
|
|
4147
|
+
identifier: rn()
|
|
4148
|
+
})), N = { ...n, label: x, fields: F };
|
|
4149
|
+
ut("fields", e + 1, N, s, o), f({
|
|
4145
4150
|
title: "Section duplicated",
|
|
4146
|
-
description: `The section "${
|
|
4151
|
+
description: `The section "${x}" has been duplicated.`
|
|
4147
4152
|
});
|
|
4148
|
-
}, [n, e, s, o,
|
|
4149
|
-
(
|
|
4153
|
+
}, [n, e, s, o, f]), C = R(
|
|
4154
|
+
(x) => {
|
|
4150
4155
|
ut(
|
|
4151
4156
|
`fields.${e}.fields`,
|
|
4152
4157
|
n.fields.length,
|
|
4153
|
-
|
|
4158
|
+
Bs[x],
|
|
4154
4159
|
s,
|
|
4155
4160
|
o
|
|
4156
4161
|
);
|
|
4157
4162
|
},
|
|
4158
4163
|
[e, n.fields.length, s, o]
|
|
4159
|
-
), g = sr(
|
|
4160
|
-
return /* @__PURE__ */ l(
|
|
4161
|
-
|
|
4164
|
+
), g = sr(C);
|
|
4165
|
+
return /* @__PURE__ */ l(en, { draggableId: n.identifier, index: e, children: (x) => /* @__PURE__ */ l(
|
|
4166
|
+
Ke,
|
|
4162
4167
|
{
|
|
4163
|
-
ref:
|
|
4164
|
-
...
|
|
4165
|
-
...
|
|
4168
|
+
ref: x.innerRef,
|
|
4169
|
+
...x.draggableProps,
|
|
4170
|
+
...x.dragHandleProps,
|
|
4166
4171
|
variant: "outline",
|
|
4167
4172
|
className: "mb-4 w-full",
|
|
4168
|
-
children: /* @__PURE__ */
|
|
4169
|
-
/* @__PURE__ */
|
|
4170
|
-
!
|
|
4173
|
+
children: /* @__PURE__ */ E("div", { className: "flex items-center justify-between gap-3 w-full", children: [
|
|
4174
|
+
/* @__PURE__ */ E("div", { className: "flex grow flex-col gap-2 w-full", children: [
|
|
4175
|
+
!m && /* @__PURE__ */ l(yn, { ...v }),
|
|
4171
4176
|
/* @__PURE__ */ l(
|
|
4172
|
-
|
|
4177
|
+
Qt,
|
|
4173
4178
|
{
|
|
4174
4179
|
droppableId: n.identifier,
|
|
4175
4180
|
type: "SECTION",
|
|
4176
4181
|
isDropDisabled: r,
|
|
4177
|
-
children: (F) => /* @__PURE__ */
|
|
4182
|
+
children: (F) => /* @__PURE__ */ E(
|
|
4178
4183
|
"div",
|
|
4179
4184
|
{
|
|
4180
4185
|
className: "flex flex-col gap-0 w-full",
|
|
@@ -4194,12 +4199,12 @@ const ar = P((t) => {
|
|
|
4194
4199
|
N.identifier
|
|
4195
4200
|
)),
|
|
4196
4201
|
F.placeholder,
|
|
4197
|
-
/* @__PURE__ */
|
|
4198
|
-
/* @__PURE__ */ l(
|
|
4202
|
+
/* @__PURE__ */ E(B.Root, { children: [
|
|
4203
|
+
/* @__PURE__ */ l(B.ClickTrigger, { children: /* @__PURE__ */ E(G, { type: "button", variant: "soft", size: "sm", children: [
|
|
4199
4204
|
/* @__PURE__ */ l(L, { icon: "RiAddLine" }),
|
|
4200
4205
|
" Add field"
|
|
4201
4206
|
] }) }),
|
|
4202
|
-
/* @__PURE__ */ l(
|
|
4207
|
+
/* @__PURE__ */ l(B.Content, { children: g.flat().map((N) => /* @__PURE__ */ E(B.Item, { onSelect: N.onSelect, children: [
|
|
4203
4208
|
N.icon,
|
|
4204
4209
|
N.children
|
|
4205
4210
|
] }, N.value)) })
|
|
@@ -4210,8 +4215,8 @@ const ar = P((t) => {
|
|
|
4210
4215
|
}
|
|
4211
4216
|
)
|
|
4212
4217
|
] }),
|
|
4213
|
-
!
|
|
4214
|
-
|
|
4218
|
+
!m && /* @__PURE__ */ l(
|
|
4219
|
+
vn,
|
|
4215
4220
|
{
|
|
4216
4221
|
index: e,
|
|
4217
4222
|
type: n.type,
|
|
@@ -4225,62 +4230,62 @@ const ar = P((t) => {
|
|
|
4225
4230
|
) });
|
|
4226
4231
|
});
|
|
4227
4232
|
ar.displayName = "FieldSectionWithActions";
|
|
4228
|
-
const
|
|
4233
|
+
const Un = (t, n) => {
|
|
4229
4234
|
for (const [e, i] of Object.entries(t))
|
|
4230
4235
|
if (i.identifier === n) return [i, e];
|
|
4231
4236
|
}, cr = P(() => {
|
|
4232
|
-
const { values: t, setFieldValue: n } = xe(), [e, i] = gr(Gs, t.fields,
|
|
4233
|
-
|
|
4234
|
-
i({ type: "update", state:
|
|
4237
|
+
const { values: t, setFieldValue: n } = xe(), [e, i] = gr(Gs, t.fields, Vn), { reorderSection: r, reorderField: o } = on(), { fieldsOnly: s } = Xt(Ct);
|
|
4238
|
+
H(() => {
|
|
4239
|
+
i({ type: "update", state: Vn(t.fields) });
|
|
4235
4240
|
}, [i, t.fields]);
|
|
4236
|
-
const a = R((
|
|
4237
|
-
|
|
4238
|
-
}, []),
|
|
4239
|
-
(
|
|
4240
|
-
const { source:
|
|
4241
|
+
const a = R((m) => {
|
|
4242
|
+
m.type === "SECTION" && i({ type: "hold", fieldId: m.draggableId });
|
|
4243
|
+
}, []), u = R(
|
|
4244
|
+
(m) => {
|
|
4245
|
+
const { source: d, destination: p, type: b, reason: y, draggableId: c } = m;
|
|
4241
4246
|
if (i({ type: "release" }), !p || y === "CANCEL") return;
|
|
4242
4247
|
if (b === "ROOT") {
|
|
4243
|
-
r(e, c,
|
|
4248
|
+
r(e, c, d.index, p.index, t, n);
|
|
4244
4249
|
return;
|
|
4245
4250
|
}
|
|
4246
4251
|
if (b !== "SECTION") throw new Error("Unexpected droppable type.");
|
|
4247
|
-
const [v, w] =
|
|
4252
|
+
const [v, w] = Un(t.fields, d.droppableId) ?? [], [C, g] = Un(t.fields, p.droppableId) ?? [];
|
|
4248
4253
|
o(
|
|
4249
4254
|
v,
|
|
4250
4255
|
w,
|
|
4251
|
-
|
|
4252
|
-
|
|
4256
|
+
d.index,
|
|
4257
|
+
C,
|
|
4253
4258
|
g,
|
|
4254
4259
|
p.index,
|
|
4255
4260
|
n
|
|
4256
4261
|
);
|
|
4257
4262
|
},
|
|
4258
4263
|
[t, o, n, r, e]
|
|
4259
|
-
),
|
|
4260
|
-
(
|
|
4261
|
-
Hr(
|
|
4264
|
+
), f = R(
|
|
4265
|
+
(m) => {
|
|
4266
|
+
Hr(m + 1, t, n);
|
|
4262
4267
|
},
|
|
4263
4268
|
[t, n]
|
|
4264
4269
|
);
|
|
4265
|
-
return /* @__PURE__ */ l(Xn, { onDragStart: a, onDragEnd:
|
|
4270
|
+
return /* @__PURE__ */ l(Xn, { onDragStart: a, onDragEnd: u, children: /* @__PURE__ */ l(Qt, { droppableId: "droppable", type: "ROOT", children: (m) => /* @__PURE__ */ E(
|
|
4266
4271
|
"div",
|
|
4267
4272
|
{
|
|
4268
4273
|
className: "flex flex-col gap-0",
|
|
4269
|
-
ref:
|
|
4270
|
-
...
|
|
4274
|
+
ref: m.innerRef,
|
|
4275
|
+
...m.droppableProps,
|
|
4271
4276
|
children: [
|
|
4272
|
-
t.fields.map((
|
|
4277
|
+
t.fields.map((d, p) => /* @__PURE__ */ E(Kn, { children: [
|
|
4273
4278
|
/* @__PURE__ */ l(
|
|
4274
4279
|
ar,
|
|
4275
4280
|
{
|
|
4276
|
-
field:
|
|
4281
|
+
field: d,
|
|
4277
4282
|
index: p,
|
|
4278
4283
|
dropState: e,
|
|
4279
4284
|
fieldsOnly: s
|
|
4280
4285
|
}
|
|
4281
4286
|
),
|
|
4282
|
-
!s && p !== t.fields.length - 1 && /* @__PURE__ */
|
|
4283
|
-
|
|
4287
|
+
!s && p !== t.fields.length - 1 && /* @__PURE__ */ E(
|
|
4288
|
+
G,
|
|
4284
4289
|
{
|
|
4285
4290
|
className: "mb-4",
|
|
4286
4291
|
type: "button",
|
|
@@ -4288,7 +4293,7 @@ const Wn = (t, n) => {
|
|
|
4288
4293
|
size: "sm",
|
|
4289
4294
|
accentColor: "base",
|
|
4290
4295
|
onClick: () => {
|
|
4291
|
-
|
|
4296
|
+
f(p);
|
|
4292
4297
|
},
|
|
4293
4298
|
children: [
|
|
4294
4299
|
/* @__PURE__ */ l(L, { icon: "RiAddLine" }),
|
|
@@ -4296,9 +4301,9 @@ const Wn = (t, n) => {
|
|
|
4296
4301
|
]
|
|
4297
4302
|
}
|
|
4298
4303
|
)
|
|
4299
|
-
] },
|
|
4300
|
-
/* @__PURE__ */
|
|
4301
|
-
|
|
4304
|
+
] }, d.identifier)),
|
|
4305
|
+
/* @__PURE__ */ E(
|
|
4306
|
+
G,
|
|
4302
4307
|
{
|
|
4303
4308
|
className: "mb-4",
|
|
4304
4309
|
type: "button",
|
|
@@ -4306,7 +4311,7 @@ const Wn = (t, n) => {
|
|
|
4306
4311
|
accentColor: "base",
|
|
4307
4312
|
size: "sm",
|
|
4308
4313
|
onClick: () => {
|
|
4309
|
-
|
|
4314
|
+
f(t.fields.length);
|
|
4310
4315
|
},
|
|
4311
4316
|
children: [
|
|
4312
4317
|
/* @__PURE__ */ l(L, { icon: "RiAddLine" }),
|
|
@@ -4314,14 +4319,14 @@ const Wn = (t, n) => {
|
|
|
4314
4319
|
]
|
|
4315
4320
|
}
|
|
4316
4321
|
),
|
|
4317
|
-
|
|
4322
|
+
m.placeholder
|
|
4318
4323
|
]
|
|
4319
4324
|
}
|
|
4320
4325
|
) }) });
|
|
4321
4326
|
});
|
|
4322
4327
|
cr.displayName = "FieldsEditor";
|
|
4323
4328
|
const pl = P(
|
|
4324
|
-
|
|
4329
|
+
Xe((t, n) => {
|
|
4325
4330
|
const {
|
|
4326
4331
|
onCancel: e,
|
|
4327
4332
|
onSave: i,
|
|
@@ -4329,28 +4334,28 @@ const pl = P(
|
|
|
4329
4334
|
initialDescription: o,
|
|
4330
4335
|
initialFields: s,
|
|
4331
4336
|
showExplainerText: a = !0,
|
|
4332
|
-
showFormTitle:
|
|
4333
|
-
fieldsOnly:
|
|
4334
|
-
showTabs:
|
|
4335
|
-
disableRequiredFields:
|
|
4337
|
+
showFormTitle: u = !0,
|
|
4338
|
+
fieldsOnly: f = !1,
|
|
4339
|
+
showTabs: m = !0,
|
|
4340
|
+
disableRequiredFields: d = !1,
|
|
4336
4341
|
tabsListClassName: p
|
|
4337
|
-
} = t, { showError: b } =
|
|
4342
|
+
} = t, { showError: b } = Ge(), y = R(
|
|
4338
4343
|
(g) => {
|
|
4339
4344
|
const S = {};
|
|
4340
4345
|
g.title || (S.title = "Title is required."), (!g.fields || g.fields.length === 0) && (S.fields = "At least one field is required.");
|
|
4341
|
-
let
|
|
4346
|
+
let x = [];
|
|
4342
4347
|
for (const [N, T] of g.fields.entries()) {
|
|
4343
|
-
const
|
|
4348
|
+
const M = Ht.section.getFieldCreationSchema(
|
|
4344
4349
|
ti(g.fields, N),
|
|
4345
4350
|
`fields.${N}`
|
|
4346
|
-
).map((
|
|
4347
|
-
|
|
4348
|
-
for (const [
|
|
4349
|
-
const
|
|
4350
|
-
|
|
4351
|
+
).map((k) => k.field);
|
|
4352
|
+
x = [...x, ...M];
|
|
4353
|
+
for (const [k, V] of T.fields.entries()) {
|
|
4354
|
+
const le = Ht[V.type].getFieldCreationSchema(`fields.${N}.fields.${k}`).map((z) => z.field);
|
|
4355
|
+
x = [...x, ...le];
|
|
4351
4356
|
}
|
|
4352
4357
|
}
|
|
4353
|
-
const F =
|
|
4358
|
+
const F = pn(x, g);
|
|
4354
4359
|
if (F && (S.fields = F.fields), he(S))
|
|
4355
4360
|
return b({
|
|
4356
4361
|
title: "Some form settings are invalid",
|
|
@@ -4362,7 +4367,7 @@ const pl = P(
|
|
|
4362
4367
|
() => ({
|
|
4363
4368
|
title: r ?? "",
|
|
4364
4369
|
description: o ?? "",
|
|
4365
|
-
fields: s ? qr(s) : [{ ...ct(
|
|
4370
|
+
fields: s ? qr(s) : [{ ...ct(rn()), label: "" }]
|
|
4366
4371
|
}),
|
|
4367
4372
|
[o, s, r]
|
|
4368
4373
|
), v = Jt({
|
|
@@ -4378,29 +4383,29 @@ const pl = P(
|
|
|
4378
4383
|
meta: {
|
|
4379
4384
|
readonly: !1
|
|
4380
4385
|
}
|
|
4381
|
-
}), [v.values]),
|
|
4382
|
-
disableRequiredFields:
|
|
4383
|
-
fieldsOnly:
|
|
4384
|
-
}), [
|
|
4385
|
-
return /* @__PURE__ */ l(Ct, { value:
|
|
4386
|
-
|
|
4386
|
+
}), [v.values]), C = O(() => ({
|
|
4387
|
+
disableRequiredFields: d,
|
|
4388
|
+
fieldsOnly: f
|
|
4389
|
+
}), [d, f]);
|
|
4390
|
+
return /* @__PURE__ */ l(Ct, { value: C, children: /* @__PURE__ */ l(Ie.Root, { ref: n, defaultValue: "edit", children: /* @__PURE__ */ E("div", { className: "flex flex-col gap-2", children: [
|
|
4391
|
+
m && /* @__PURE__ */ E(
|
|
4387
4392
|
Ie.List,
|
|
4388
4393
|
{
|
|
4389
4394
|
className: je("sticky top-0 z-[2000] flex bg-(--color-background)", p),
|
|
4390
4395
|
children: [
|
|
4391
|
-
/* @__PURE__ */ l(Ie.Trigger, { className: "grow", value: "edit", children: /* @__PURE__ */
|
|
4396
|
+
/* @__PURE__ */ l(Ie.Trigger, { className: "grow", value: "edit", children: /* @__PURE__ */ E("div", { className: "flex items-center gap-2", children: [
|
|
4392
4397
|
/* @__PURE__ */ l(L, { icon: "RiPencilLine" }),
|
|
4393
4398
|
"Edit form"
|
|
4394
4399
|
] }) }),
|
|
4395
|
-
/* @__PURE__ */ l(Ie.Trigger, { className: "grow", value: "preview", children: /* @__PURE__ */
|
|
4400
|
+
/* @__PURE__ */ l(Ie.Trigger, { className: "grow", value: "preview", children: /* @__PURE__ */ E("div", { className: "flex items-center gap-2", children: [
|
|
4396
4401
|
/* @__PURE__ */ l(L, { icon: "RiEyeLine" }),
|
|
4397
4402
|
"Preview form"
|
|
4398
4403
|
] }) })
|
|
4399
4404
|
]
|
|
4400
4405
|
}
|
|
4401
4406
|
),
|
|
4402
|
-
/* @__PURE__ */
|
|
4403
|
-
a && /* @__PURE__ */
|
|
4407
|
+
/* @__PURE__ */ E(Ie.Content, { value: "edit", children: [
|
|
4408
|
+
a && /* @__PURE__ */ E(ae, { children: [
|
|
4404
4409
|
"Create your form using various field types. Sections can be",
|
|
4405
4410
|
" ",
|
|
4406
4411
|
/* @__PURE__ */ l("strong", { children: "conditionally rendered" }),
|
|
@@ -4408,21 +4413,21 @@ const pl = P(
|
|
|
4408
4413
|
" ",
|
|
4409
4414
|
/* @__PURE__ */ l("strong", { children: "answers to fields in preceding sections. " })
|
|
4410
4415
|
] }),
|
|
4411
|
-
/* @__PURE__ */
|
|
4412
|
-
/* @__PURE__ */
|
|
4413
|
-
|
|
4416
|
+
/* @__PURE__ */ E("form", { className: "mt-3 flex flex-col gap-2", id: lt, onSubmit: v.handleSubmit, children: [
|
|
4417
|
+
/* @__PURE__ */ E(Zt, { value: v, children: [
|
|
4418
|
+
u && /* @__PURE__ */ E(pe, { children: [
|
|
4414
4419
|
/* @__PURE__ */ l(
|
|
4415
4420
|
We,
|
|
4416
4421
|
{
|
|
4417
4422
|
name: "title",
|
|
4418
|
-
render: ({ setValue: g, value: S, meta:
|
|
4419
|
-
|
|
4423
|
+
render: ({ setValue: g, value: S, meta: x }) => /* @__PURE__ */ l(ni, { severity: "danger", helpText: x.error ?? null, children: /* @__PURE__ */ l(
|
|
4424
|
+
ee.Root,
|
|
4420
4425
|
{
|
|
4421
4426
|
variant: "outline",
|
|
4422
4427
|
size: "md",
|
|
4423
|
-
accentColor:
|
|
4428
|
+
accentColor: x.error ? ge.danger : "primary",
|
|
4424
4429
|
children: /* @__PURE__ */ l(
|
|
4425
|
-
|
|
4430
|
+
ee.Field,
|
|
4426
4431
|
{
|
|
4427
4432
|
placeholder: "Form title",
|
|
4428
4433
|
value: S,
|
|
@@ -4446,8 +4451,8 @@ const pl = P(
|
|
|
4446
4451
|
className: "field-sizing-content",
|
|
4447
4452
|
placeholder: "Explain the purpose of this form",
|
|
4448
4453
|
value: S,
|
|
4449
|
-
onChange: (
|
|
4450
|
-
g(
|
|
4454
|
+
onChange: (x) => {
|
|
4455
|
+
g(x.target.value);
|
|
4451
4456
|
},
|
|
4452
4457
|
resize: "vertical",
|
|
4453
4458
|
maxLength: 1e3,
|
|
@@ -4467,95 +4472,95 @@ const pl = P(
|
|
|
4467
4472
|
}
|
|
4468
4473
|
)
|
|
4469
4474
|
] }),
|
|
4470
|
-
/* @__PURE__ */
|
|
4471
|
-
e && /* @__PURE__ */ l(
|
|
4472
|
-
/* @__PURE__ */ l(
|
|
4475
|
+
/* @__PURE__ */ E("div", { className: "flex items-center justify-end gap-2", children: [
|
|
4476
|
+
e && /* @__PURE__ */ l(G, { type: "button", variant: "solid", accentColor: "base", onClick: e, children: "Cancel" }),
|
|
4477
|
+
/* @__PURE__ */ l(G, { type: "submit", children: "Save form" })
|
|
4473
4478
|
] })
|
|
4474
4479
|
] })
|
|
4475
4480
|
] }),
|
|
4476
|
-
/* @__PURE__ */ l(Ie.Content, { value: "preview", children: /* @__PURE__ */ l(qs, { schema: w, hideTitle: !
|
|
4481
|
+
/* @__PURE__ */ l(Ie.Content, { value: "preview", children: /* @__PURE__ */ l(qs, { schema: w, hideTitle: !u }) })
|
|
4477
4482
|
] }) }) });
|
|
4478
4483
|
})
|
|
4479
4484
|
);
|
|
4480
4485
|
export {
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4486
|
+
W as BaseField,
|
|
4487
|
+
Zn as BaseFormElement,
|
|
4488
|
+
$i as BaseSelectField,
|
|
4489
|
+
He as BooleanField,
|
|
4485
4490
|
Ui as BooleanInput,
|
|
4486
|
-
|
|
4491
|
+
Bt as DateField,
|
|
4487
4492
|
Wi as DateInput,
|
|
4488
|
-
|
|
4493
|
+
q as FieldSection,
|
|
4489
4494
|
rr as FieldSectionLayout,
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4495
|
+
fn as FieldTypeToClsMapping,
|
|
4496
|
+
Bs as FieldTypeToEmptyFieldMapping,
|
|
4497
|
+
Jn as FileCard,
|
|
4498
|
+
tn as FileIcon,
|
|
4494
4499
|
pl as FormBuilder,
|
|
4495
4500
|
qs as FormRenderer,
|
|
4496
4501
|
ks as ImageCard,
|
|
4497
|
-
|
|
4502
|
+
Bi as ImageViewer,
|
|
4498
4503
|
Is as ImageViewerProvider,
|
|
4499
4504
|
ni as InputWithHelpText,
|
|
4500
|
-
|
|
4501
|
-
|
|
4505
|
+
ne as InputWithLabel,
|
|
4506
|
+
ie as InputWithLabelAndHelpText,
|
|
4502
4507
|
Ue as LONG_TEXT_FIELD_MAX_LENGTH,
|
|
4503
4508
|
pt as MultiSelectField,
|
|
4504
4509
|
ji as MultiSelectInput,
|
|
4505
|
-
|
|
4510
|
+
qe as MultiStringField,
|
|
4506
4511
|
Vi as MultiStringInput,
|
|
4507
4512
|
be as NumberField,
|
|
4508
4513
|
qi as NumberInput,
|
|
4509
4514
|
We as PatchField,
|
|
4510
4515
|
hl as PatchFormProvider,
|
|
4511
|
-
Vt as
|
|
4512
|
-
Hi as
|
|
4513
|
-
Gi as QrScanner,
|
|
4514
|
-
Bt as RadioField,
|
|
4515
|
-
Ki as RadioInput,
|
|
4516
|
+
Vt as RadioField,
|
|
4517
|
+
Hi as RadioInput,
|
|
4516
4518
|
ge as SEVERITY_COLOR_MAPPING,
|
|
4517
4519
|
ot as SHORT_TEXT_FIELD_MAX_LENGTH,
|
|
4518
4520
|
zr as SUPPORTED_IMAGE_FILE_TYPES,
|
|
4519
|
-
|
|
4521
|
+
Br as SUPPORTED_PDF_FILE_TYPES,
|
|
4520
4522
|
_r as SUPPORTED_SPREADSHEET_FILE_EXTENSIONS,
|
|
4523
|
+
$t as ScanField,
|
|
4524
|
+
Gi as ScanInput,
|
|
4525
|
+
Ki as Scanner,
|
|
4521
4526
|
gt as SelectField,
|
|
4522
4527
|
Xi as SelectInput,
|
|
4523
4528
|
Ut as StringField,
|
|
4524
4529
|
Yi as StringInput,
|
|
4525
4530
|
vt as StringOrTextField,
|
|
4526
4531
|
Wt as TextField,
|
|
4527
|
-
|
|
4532
|
+
Ji as TextInput,
|
|
4528
4533
|
jt as UploadField,
|
|
4529
|
-
|
|
4534
|
+
Zi as UploadInput,
|
|
4530
4535
|
fl as decodeFieldValues,
|
|
4531
|
-
|
|
4536
|
+
mn as deserialize,
|
|
4532
4537
|
tr as deserializeField,
|
|
4533
4538
|
Ws as deserializeFields,
|
|
4534
|
-
|
|
4539
|
+
Q as emptyBaseField,
|
|
4535
4540
|
Ns as emptyBooleanField,
|
|
4536
4541
|
Rs as emptyDateField,
|
|
4537
4542
|
Fs as emptyMultiSelectField,
|
|
4538
4543
|
Ss as emptyMultiStringField,
|
|
4539
4544
|
Ls as emptyNumberField,
|
|
4540
|
-
Ds as
|
|
4541
|
-
As as
|
|
4545
|
+
Ds as emptyRadioField,
|
|
4546
|
+
As as emptyScanField,
|
|
4542
4547
|
Ps as emptySelectField,
|
|
4543
4548
|
Os as emptyStringField,
|
|
4544
4549
|
Ms as emptyTextField,
|
|
4545
4550
|
_s as emptyUploadField,
|
|
4546
4551
|
ml as encodeFieldValues,
|
|
4547
4552
|
ul as fieldIcons,
|
|
4548
|
-
|
|
4553
|
+
hn as flattenFields,
|
|
4549
4554
|
js as getFieldsMapping,
|
|
4550
|
-
|
|
4555
|
+
gn as initializeFormValues,
|
|
4551
4556
|
nr as isConditionMet,
|
|
4552
|
-
|
|
4557
|
+
$s as maxFileSizeB,
|
|
4553
4558
|
Vs as maxFileSizeKB,
|
|
4554
4559
|
st as maxFileSizeMB,
|
|
4555
4560
|
ir as useFieldInput,
|
|
4556
4561
|
yt as useFieldInputs,
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4562
|
+
Z as useFormikInput,
|
|
4563
|
+
sn as useImageViewer,
|
|
4564
|
+
pn as validateFields,
|
|
4560
4565
|
qt as valueIsFile
|
|
4561
4566
|
};
|