react-form-dto 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/dist/index.d.ts +1 -1
- package/dist/react-form-dto.es.js +357 -335
- package/dist/react-form-dto.umd.js +2 -2
- package/dist/types/dto.d.ts +15 -0
- package/dist/utils/evaluateVisibleWhen.d.ts +8 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { FormControl as
|
|
3
|
-
var S = { exports: {} },
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
if (
|
|
7
|
-
|
|
8
|
-
var e = Symbol.for("react.transitional.element"),
|
|
9
|
-
function
|
|
10
|
-
var
|
|
11
|
-
if (
|
|
12
|
-
|
|
1
|
+
import J, { useState as V, useImperativeHandle as pe } from "react";
|
|
2
|
+
import { FormControl as X, InputLabel as fe, Select as be, MenuItem as he, Typography as _, TextField as A, FormControlLabel as H, Checkbox as ve, FormHelperText as Z, Autocomplete as Q, FormLabel as xe, RadioGroup as ge, Radio as Ee, Box as je, Grid as M } from "@mui/material";
|
|
3
|
+
var S = { exports: {} }, j = {};
|
|
4
|
+
var B;
|
|
5
|
+
function ye() {
|
|
6
|
+
if (B) return j;
|
|
7
|
+
B = 1;
|
|
8
|
+
var e = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
9
|
+
function t(a, o, s) {
|
|
10
|
+
var u = null;
|
|
11
|
+
if (s !== void 0 && (u = "" + s), o.key !== void 0 && (u = "" + o.key), "key" in o) {
|
|
12
|
+
s = {};
|
|
13
13
|
for (var c in o)
|
|
14
|
-
c !== "key" && (
|
|
15
|
-
} else
|
|
16
|
-
return o =
|
|
14
|
+
c !== "key" && (s[c] = o[c]);
|
|
15
|
+
} else s = o;
|
|
16
|
+
return o = s.ref, {
|
|
17
17
|
$$typeof: e,
|
|
18
|
-
type:
|
|
19
|
-
key:
|
|
18
|
+
type: a,
|
|
19
|
+
key: u,
|
|
20
20
|
ref: o !== void 0 ? o : null,
|
|
21
|
-
props:
|
|
21
|
+
props: s
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return j.Fragment = n, j.jsx = t, j.jsxs = t, j;
|
|
25
25
|
}
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
function
|
|
29
|
-
return
|
|
26
|
+
var y = {};
|
|
27
|
+
var U;
|
|
28
|
+
function _e() {
|
|
29
|
+
return U || (U = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
30
30
|
function e(r) {
|
|
31
31
|
if (r == null) return null;
|
|
32
32
|
if (typeof r == "function")
|
|
33
|
-
return r.$$typeof ===
|
|
33
|
+
return r.$$typeof === ce ? null : r.displayName || r.name || null;
|
|
34
34
|
if (typeof r == "string") return r;
|
|
35
35
|
switch (r) {
|
|
36
36
|
case $:
|
|
37
37
|
return "Fragment";
|
|
38
|
-
case
|
|
38
|
+
case te:
|
|
39
39
|
return "Profiler";
|
|
40
|
-
case
|
|
40
|
+
case re:
|
|
41
41
|
return "StrictMode";
|
|
42
42
|
case oe:
|
|
43
43
|
return "Suspense";
|
|
44
|
-
case
|
|
44
|
+
case ue:
|
|
45
45
|
return "SuspenseList";
|
|
46
|
-
case
|
|
46
|
+
case ie:
|
|
47
47
|
return "Activity";
|
|
48
48
|
}
|
|
49
49
|
if (typeof r == "object")
|
|
50
50
|
switch (typeof r.tag == "number" && console.error(
|
|
51
51
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
52
52
|
), r.$$typeof) {
|
|
53
|
-
case
|
|
53
|
+
case ee:
|
|
54
54
|
return "Portal";
|
|
55
|
-
case
|
|
55
|
+
case ae:
|
|
56
56
|
return r.displayName || "Context";
|
|
57
|
-
case
|
|
57
|
+
case ne:
|
|
58
58
|
return (r._context.displayName || "Context") + ".Consumer";
|
|
59
|
-
case
|
|
59
|
+
case se:
|
|
60
60
|
var i = r.render;
|
|
61
61
|
return r = r.displayName, r || (r = i.displayName || i.name || "", r = r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"), r;
|
|
62
|
-
case
|
|
62
|
+
case le:
|
|
63
63
|
return i = r.displayName || null, i !== null ? i : e(r.type) || "Memo";
|
|
64
64
|
case w:
|
|
65
65
|
i = r._payload, r = r._init;
|
|
@@ -70,12 +70,12 @@ function je() {
|
|
|
70
70
|
}
|
|
71
71
|
return null;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function n(r) {
|
|
74
74
|
return "" + r;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function t(r) {
|
|
77
77
|
try {
|
|
78
|
-
|
|
78
|
+
n(r);
|
|
79
79
|
var i = !1;
|
|
80
80
|
} catch {
|
|
81
81
|
i = !0;
|
|
@@ -87,10 +87,10 @@ function je() {
|
|
|
87
87
|
i,
|
|
88
88
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
89
89
|
d
|
|
90
|
-
),
|
|
90
|
+
), n(r);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function a(r) {
|
|
94
94
|
if (r === $) return "<>";
|
|
95
95
|
if (typeof r == "object" && r !== null && r.$$typeof === w)
|
|
96
96
|
return "<...>";
|
|
@@ -105,11 +105,11 @@ function je() {
|
|
|
105
105
|
var r = O.A;
|
|
106
106
|
return r === null ? null : r.getOwner();
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function s() {
|
|
109
109
|
return Error("react-stack-top-frame");
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
if (
|
|
111
|
+
function u(r) {
|
|
112
|
+
if (N.call(r, "key")) {
|
|
113
113
|
var i = Object.getOwnPropertyDescriptor(r, "key").get;
|
|
114
114
|
if (i && i.isReactWarning) return !1;
|
|
115
115
|
}
|
|
@@ -117,7 +117,7 @@ function je() {
|
|
|
117
117
|
}
|
|
118
118
|
function c(r, i) {
|
|
119
119
|
function m() {
|
|
120
|
-
|
|
120
|
+
D || (D = !0, console.error(
|
|
121
121
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
122
122
|
i
|
|
123
123
|
));
|
|
@@ -129,11 +129,11 @@ function je() {
|
|
|
129
129
|
}
|
|
130
130
|
function h() {
|
|
131
131
|
var r = e(this.type);
|
|
132
|
-
return
|
|
132
|
+
return q[r] || (q[r] = !0, console.error(
|
|
133
133
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
134
134
|
)), r = this.props.ref, r !== void 0 ? r : null;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function b(r, i, m, d, T, P) {
|
|
137
137
|
var p = m.ref;
|
|
138
138
|
return r = {
|
|
139
139
|
$$typeof: L,
|
|
@@ -170,21 +170,21 @@ function je() {
|
|
|
170
170
|
var p = i.children;
|
|
171
171
|
if (p !== void 0)
|
|
172
172
|
if (d)
|
|
173
|
-
if (
|
|
173
|
+
if (me(p)) {
|
|
174
174
|
for (d = 0; d < p.length; d++)
|
|
175
|
-
|
|
175
|
+
x(p[d]);
|
|
176
176
|
Object.freeze && Object.freeze(p);
|
|
177
177
|
} else
|
|
178
178
|
console.error(
|
|
179
179
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
180
180
|
);
|
|
181
|
-
else
|
|
182
|
-
if (
|
|
181
|
+
else x(p);
|
|
182
|
+
if (N.call(i, "key")) {
|
|
183
183
|
p = e(r);
|
|
184
|
-
var E = Object.keys(i).filter(function(
|
|
185
|
-
return
|
|
184
|
+
var E = Object.keys(i).filter(function(de) {
|
|
185
|
+
return de !== "key";
|
|
186
186
|
});
|
|
187
|
-
d = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}",
|
|
187
|
+
d = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", W[p + d] || (E = 0 < E.length ? "{" + E.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
188
188
|
`A props object containing a "key" prop is being spread into JSX:
|
|
189
189
|
let props = %s;
|
|
190
190
|
<%s {...props} />
|
|
@@ -195,9 +195,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
195
195
|
p,
|
|
196
196
|
E,
|
|
197
197
|
p
|
|
198
|
-
),
|
|
198
|
+
), W[p + d] = !0);
|
|
199
199
|
}
|
|
200
|
-
if (p = null, m !== void 0 && (
|
|
200
|
+
if (p = null, m !== void 0 && (t(m), p = "" + m), u(i) && (t(i.key), p = "" + i.key), "key" in i) {
|
|
201
201
|
m = {};
|
|
202
202
|
for (var C in i)
|
|
203
203
|
C !== "key" && (m[C] = i[C]);
|
|
@@ -205,7 +205,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
205
205
|
return p && c(
|
|
206
206
|
m,
|
|
207
207
|
typeof r == "function" ? r.displayName || r.name || "Unknown" : r
|
|
208
|
-
),
|
|
208
|
+
), b(
|
|
209
209
|
r,
|
|
210
210
|
p,
|
|
211
211
|
m,
|
|
@@ -214,25 +214,25 @@ React keys must be passed directly to JSX without using spread:
|
|
|
214
214
|
P
|
|
215
215
|
);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
|
|
217
|
+
function x(r) {
|
|
218
|
+
R(r) ? r._store && (r._store.validated = 1) : typeof r == "object" && r !== null && r.$$typeof === w && (r._payload.status === "fulfilled" ? R(r._payload.value) && r._payload.value._store && (r._payload.value._store.validated = 1) : r._store && (r._store.validated = 1));
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function R(r) {
|
|
221
221
|
return typeof r == "object" && r !== null && r.$$typeof === L;
|
|
222
222
|
}
|
|
223
|
-
var
|
|
223
|
+
var v = J, L = Symbol.for("react.transitional.element"), ee = Symbol.for("react.portal"), $ = Symbol.for("react.fragment"), re = Symbol.for("react.strict_mode"), te = Symbol.for("react.profiler"), ne = Symbol.for("react.consumer"), ae = Symbol.for("react.context"), se = Symbol.for("react.forward_ref"), oe = Symbol.for("react.suspense"), ue = Symbol.for("react.suspense_list"), le = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), ie = Symbol.for("react.activity"), ce = Symbol.for("react.client.reference"), O = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, N = Object.prototype.hasOwnProperty, me = Array.isArray, F = console.createTask ? console.createTask : function() {
|
|
224
224
|
return null;
|
|
225
225
|
};
|
|
226
|
-
|
|
226
|
+
v = {
|
|
227
227
|
react_stack_bottom_frame: function(r) {
|
|
228
228
|
return r();
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
|
-
var
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
)(), Y = F(
|
|
235
|
-
|
|
231
|
+
var D, q = {}, z = v.react_stack_bottom_frame.bind(
|
|
232
|
+
v,
|
|
233
|
+
s
|
|
234
|
+
)(), Y = F(a(s)), W = {};
|
|
235
|
+
y.Fragment = $, y.jsx = function(r, i, m) {
|
|
236
236
|
var d = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
237
237
|
return g(
|
|
238
238
|
r,
|
|
@@ -240,9 +240,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
240
240
|
m,
|
|
241
241
|
!1,
|
|
242
242
|
d ? Error("react-stack-top-frame") : z,
|
|
243
|
-
d ? F(
|
|
243
|
+
d ? F(a(r)) : Y
|
|
244
244
|
);
|
|
245
|
-
},
|
|
245
|
+
}, y.jsxs = function(r, i, m) {
|
|
246
246
|
var d = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
247
247
|
return g(
|
|
248
248
|
r,
|
|
@@ -250,67 +250,67 @@ React keys must be passed directly to JSX without using spread:
|
|
|
250
250
|
m,
|
|
251
251
|
!0,
|
|
252
252
|
d ? Error("react-stack-top-frame") : z,
|
|
253
|
-
d ? F(
|
|
253
|
+
d ? F(a(r)) : Y
|
|
254
254
|
);
|
|
255
255
|
};
|
|
256
|
-
})()),
|
|
256
|
+
})()), y;
|
|
257
257
|
}
|
|
258
|
-
var
|
|
258
|
+
var G;
|
|
259
259
|
function Re() {
|
|
260
|
-
return
|
|
260
|
+
return G || (G = 1, process.env.NODE_ENV === "production" ? S.exports = ye() : S.exports = _e()), S.exports;
|
|
261
261
|
}
|
|
262
262
|
var l = Re();
|
|
263
|
-
function
|
|
264
|
-
return e ? typeof e == "string" ? e : e[
|
|
263
|
+
function f(e, n = "en") {
|
|
264
|
+
return e ? typeof e == "string" ? e : e[n] || e.en || Object.values(e)[0] || "" : "";
|
|
265
265
|
}
|
|
266
|
-
function
|
|
267
|
-
return e ? e.map((
|
|
268
|
-
value:
|
|
269
|
-
label:
|
|
266
|
+
function k(e, n = "en") {
|
|
267
|
+
return e ? e.map((t) => typeof t == "string" ? { value: t, label: t } : {
|
|
268
|
+
value: t.value,
|
|
269
|
+
label: f(t.label, n)
|
|
270
270
|
}) : [];
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function Te({
|
|
273
273
|
field: e,
|
|
274
|
-
value:
|
|
275
|
-
onChange:
|
|
276
|
-
error:
|
|
274
|
+
value: n,
|
|
275
|
+
onChange: t,
|
|
276
|
+
error: a,
|
|
277
277
|
locale: o = "en"
|
|
278
278
|
}) {
|
|
279
|
-
const
|
|
280
|
-
return /* @__PURE__ */ l.jsxs(
|
|
281
|
-
/* @__PURE__ */ l.jsx(
|
|
279
|
+
const s = k(e.options || [], o);
|
|
280
|
+
return /* @__PURE__ */ l.jsxs(X, { fullWidth: !0, children: [
|
|
281
|
+
/* @__PURE__ */ l.jsx(fe, { id: `${e.id}-label`, children: f(e.label, o) }),
|
|
282
282
|
/* @__PURE__ */ l.jsx(
|
|
283
283
|
be,
|
|
284
284
|
{
|
|
285
285
|
labelId: `${e.id}-label`,
|
|
286
|
-
value:
|
|
286
|
+
value: n,
|
|
287
287
|
id: e.id,
|
|
288
288
|
name: e.id,
|
|
289
|
-
onChange: (
|
|
290
|
-
label:
|
|
291
|
-
error: !!
|
|
292
|
-
children:
|
|
289
|
+
onChange: (u) => t(u.target.value),
|
|
290
|
+
label: f(e.label, o),
|
|
291
|
+
error: !!a,
|
|
292
|
+
children: s?.map((u) => /* @__PURE__ */ l.jsx(he, { value: u.value, children: u.label }, u.label))
|
|
293
293
|
}
|
|
294
294
|
),
|
|
295
|
-
|
|
295
|
+
a && /* @__PURE__ */ l.jsx(_, { variant: "caption", color: "error", children: a })
|
|
296
296
|
] });
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function Se({
|
|
299
299
|
field: e,
|
|
300
|
-
value:
|
|
301
|
-
onChange:
|
|
302
|
-
error:
|
|
300
|
+
value: n,
|
|
301
|
+
onChange: t,
|
|
302
|
+
error: a,
|
|
303
303
|
locale: o
|
|
304
304
|
}) {
|
|
305
|
-
return console.log("error",
|
|
306
|
-
|
|
305
|
+
return console.log("error", a), /* @__PURE__ */ l.jsx(
|
|
306
|
+
A,
|
|
307
307
|
{
|
|
308
308
|
fullWidth: !0,
|
|
309
|
-
label:
|
|
310
|
-
placeholder:
|
|
311
|
-
value:
|
|
309
|
+
label: f(e.label, o),
|
|
310
|
+
placeholder: f(e.placeholder || "", o),
|
|
311
|
+
value: n || "",
|
|
312
312
|
name: e.id,
|
|
313
|
-
onChange: (
|
|
313
|
+
onChange: (s) => t(s.target.value),
|
|
314
314
|
disabled: e.disabled,
|
|
315
315
|
type: e.type,
|
|
316
316
|
slotProps: {
|
|
@@ -318,161 +318,161 @@ function Te({
|
|
|
318
318
|
shrink: e.type === "date" ? !0 : void 0
|
|
319
319
|
}
|
|
320
320
|
},
|
|
321
|
-
error: !!
|
|
322
|
-
helperText:
|
|
321
|
+
error: !!a,
|
|
322
|
+
helperText: a
|
|
323
323
|
}
|
|
324
324
|
);
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function Ae({
|
|
327
327
|
field: e,
|
|
328
|
-
value:
|
|
329
|
-
onChange:
|
|
330
|
-
error:
|
|
328
|
+
value: n,
|
|
329
|
+
onChange: t,
|
|
330
|
+
error: a,
|
|
331
331
|
locale: o
|
|
332
332
|
}) {
|
|
333
333
|
return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
334
334
|
/* @__PURE__ */ l.jsx(
|
|
335
|
-
|
|
335
|
+
H,
|
|
336
336
|
{
|
|
337
337
|
name: e.id,
|
|
338
338
|
control: /* @__PURE__ */ l.jsx(
|
|
339
|
-
|
|
339
|
+
ve,
|
|
340
340
|
{
|
|
341
|
-
checked: !!
|
|
342
|
-
onChange: (
|
|
341
|
+
checked: !!n,
|
|
342
|
+
onChange: (s) => t(s.target.checked),
|
|
343
343
|
disabled: e.disabled
|
|
344
344
|
}
|
|
345
345
|
),
|
|
346
|
-
label:
|
|
346
|
+
label: f(e.label, o)
|
|
347
347
|
}
|
|
348
348
|
),
|
|
349
|
-
|
|
349
|
+
a && /* @__PURE__ */ l.jsx(Z, { children: a })
|
|
350
350
|
] });
|
|
351
351
|
}
|
|
352
352
|
const ke = ({
|
|
353
353
|
field: e,
|
|
354
|
-
value:
|
|
355
|
-
onChange:
|
|
356
|
-
error:
|
|
354
|
+
value: n,
|
|
355
|
+
onChange: t,
|
|
356
|
+
error: a,
|
|
357
357
|
locale: o
|
|
358
358
|
}) => {
|
|
359
|
-
const
|
|
359
|
+
const s = k(e.options || [], o);
|
|
360
360
|
return /* @__PURE__ */ l.jsx(
|
|
361
|
-
|
|
361
|
+
Q,
|
|
362
362
|
{
|
|
363
363
|
fullWidth: !0,
|
|
364
|
-
options:
|
|
365
|
-
value:
|
|
366
|
-
onChange: (
|
|
367
|
-
renderInput: (
|
|
368
|
-
|
|
364
|
+
options: s || [],
|
|
365
|
+
value: n || null,
|
|
366
|
+
onChange: (u, c) => t(c),
|
|
367
|
+
renderInput: (u) => /* @__PURE__ */ l.jsx(
|
|
368
|
+
A,
|
|
369
369
|
{
|
|
370
|
-
...
|
|
370
|
+
...u,
|
|
371
371
|
name: e.id,
|
|
372
|
-
label:
|
|
373
|
-
placeholder:
|
|
372
|
+
label: f(e.label, o),
|
|
373
|
+
placeholder: f(
|
|
374
374
|
e.placeholder || "",
|
|
375
375
|
o
|
|
376
376
|
),
|
|
377
377
|
disabled: e.disabled,
|
|
378
|
-
error: !!
|
|
379
|
-
helperText:
|
|
378
|
+
error: !!a,
|
|
379
|
+
helperText: a
|
|
380
380
|
}
|
|
381
381
|
)
|
|
382
382
|
}
|
|
383
383
|
);
|
|
384
|
-
},
|
|
384
|
+
}, $e = ({
|
|
385
385
|
field: e,
|
|
386
|
-
value:
|
|
387
|
-
onChange:
|
|
388
|
-
error:
|
|
386
|
+
value: n,
|
|
387
|
+
onChange: t,
|
|
388
|
+
error: a,
|
|
389
389
|
locale: o
|
|
390
390
|
}) => {
|
|
391
|
-
const
|
|
391
|
+
const s = k(e.options || [], o);
|
|
392
392
|
return /* @__PURE__ */ l.jsx(
|
|
393
|
-
|
|
393
|
+
Q,
|
|
394
394
|
{
|
|
395
395
|
multiple: !0,
|
|
396
396
|
fullWidth: !0,
|
|
397
|
-
options:
|
|
398
|
-
value:
|
|
399
|
-
onChange: (
|
|
400
|
-
renderInput: (
|
|
401
|
-
|
|
397
|
+
options: s || [],
|
|
398
|
+
value: n || [],
|
|
399
|
+
onChange: (u, c) => t(c),
|
|
400
|
+
renderInput: (u) => /* @__PURE__ */ l.jsx(
|
|
401
|
+
A,
|
|
402
402
|
{
|
|
403
|
-
...
|
|
403
|
+
...u,
|
|
404
404
|
name: e.id,
|
|
405
|
-
label:
|
|
406
|
-
placeholder:
|
|
405
|
+
label: f(e.label, o),
|
|
406
|
+
placeholder: f(
|
|
407
407
|
e.placeholder || "",
|
|
408
408
|
o
|
|
409
409
|
),
|
|
410
410
|
disabled: e.disabled,
|
|
411
|
-
error: !!
|
|
412
|
-
helperText:
|
|
411
|
+
error: !!a,
|
|
412
|
+
helperText: a
|
|
413
413
|
}
|
|
414
414
|
)
|
|
415
415
|
}
|
|
416
416
|
);
|
|
417
|
-
},
|
|
417
|
+
}, we = ({
|
|
418
418
|
field: e,
|
|
419
|
-
value:
|
|
420
|
-
onChange:
|
|
421
|
-
error:
|
|
419
|
+
value: n,
|
|
420
|
+
onChange: t,
|
|
421
|
+
error: a,
|
|
422
422
|
locale: o = "en"
|
|
423
423
|
}) => /* @__PURE__ */ l.jsx(
|
|
424
|
-
|
|
424
|
+
A,
|
|
425
425
|
{
|
|
426
426
|
fullWidth: !0,
|
|
427
427
|
multiline: !0,
|
|
428
428
|
rows: e.rows || 4,
|
|
429
|
-
label:
|
|
430
|
-
placeholder:
|
|
431
|
-
value:
|
|
432
|
-
onChange: (
|
|
429
|
+
label: f(e.label, o),
|
|
430
|
+
placeholder: f(e.placeholder || "", o),
|
|
431
|
+
value: n || "",
|
|
432
|
+
onChange: (s) => t(s.target.value),
|
|
433
433
|
required: !!e.validations?.required,
|
|
434
434
|
disabled: e.disabled,
|
|
435
|
-
error: !!
|
|
436
|
-
helperText:
|
|
435
|
+
error: !!a,
|
|
436
|
+
helperText: a
|
|
437
437
|
}
|
|
438
|
-
),
|
|
438
|
+
), Oe = ({
|
|
439
439
|
field: e,
|
|
440
|
-
value:
|
|
441
|
-
onChange:
|
|
442
|
-
error:
|
|
440
|
+
value: n,
|
|
441
|
+
onChange: t,
|
|
442
|
+
error: a,
|
|
443
443
|
locale: o = "en"
|
|
444
444
|
}) => {
|
|
445
|
-
const
|
|
446
|
-
return /* @__PURE__ */ l.jsxs(
|
|
445
|
+
const s = k(e.options || [], o);
|
|
446
|
+
return /* @__PURE__ */ l.jsxs(X, { component: "fieldset", fullWidth: !0, error: !!a, children: [
|
|
447
447
|
/* @__PURE__ */ l.jsxs(xe, { component: "legend", children: [
|
|
448
|
-
|
|
448
|
+
f(e.label, o),
|
|
449
449
|
e.validations?.required ? " *" : ""
|
|
450
450
|
] }),
|
|
451
451
|
/* @__PURE__ */ l.jsx(
|
|
452
|
-
|
|
452
|
+
ge,
|
|
453
453
|
{
|
|
454
454
|
row: e.layout?.direction === "row" || !1,
|
|
455
|
-
value:
|
|
456
|
-
onChange: (
|
|
457
|
-
children: (
|
|
458
|
-
|
|
455
|
+
value: n || "",
|
|
456
|
+
onChange: (u) => t(u.target.value),
|
|
457
|
+
children: (s || []).map((u) => /* @__PURE__ */ l.jsx(
|
|
458
|
+
H,
|
|
459
459
|
{
|
|
460
|
-
value:
|
|
461
|
-
control: /* @__PURE__ */ l.jsx(
|
|
462
|
-
label:
|
|
460
|
+
value: u,
|
|
461
|
+
control: /* @__PURE__ */ l.jsx(Ee, {}),
|
|
462
|
+
label: u.label,
|
|
463
463
|
disabled: e.disabled
|
|
464
464
|
},
|
|
465
|
-
|
|
465
|
+
u.label
|
|
466
466
|
))
|
|
467
467
|
}
|
|
468
468
|
),
|
|
469
|
-
|
|
469
|
+
a && /* @__PURE__ */ l.jsx(Z, { children: a })
|
|
470
470
|
] });
|
|
471
|
-
},
|
|
471
|
+
}, Fe = ({
|
|
472
472
|
field: e,
|
|
473
|
-
value:
|
|
474
|
-
onChange:
|
|
475
|
-
error:
|
|
473
|
+
value: n,
|
|
474
|
+
onChange: t,
|
|
475
|
+
error: a,
|
|
476
476
|
locale: o = "en"
|
|
477
477
|
}) => {
|
|
478
478
|
switch (e.type) {
|
|
@@ -482,23 +482,23 @@ const ke = ({
|
|
|
482
482
|
case "password":
|
|
483
483
|
case "number":
|
|
484
484
|
return /* @__PURE__ */ l.jsx(
|
|
485
|
-
|
|
485
|
+
Se,
|
|
486
486
|
{
|
|
487
487
|
field: e,
|
|
488
|
-
value:
|
|
489
|
-
onChange:
|
|
490
|
-
error:
|
|
488
|
+
value: n,
|
|
489
|
+
onChange: t,
|
|
490
|
+
error: a,
|
|
491
491
|
locale: o
|
|
492
492
|
}
|
|
493
493
|
);
|
|
494
494
|
case "select":
|
|
495
495
|
return /* @__PURE__ */ l.jsx(
|
|
496
|
-
|
|
496
|
+
Te,
|
|
497
497
|
{
|
|
498
498
|
field: e,
|
|
499
|
-
value:
|
|
500
|
-
onChange:
|
|
501
|
-
error:
|
|
499
|
+
value: n,
|
|
500
|
+
onChange: t,
|
|
501
|
+
error: a,
|
|
502
502
|
locale: o
|
|
503
503
|
}
|
|
504
504
|
);
|
|
@@ -507,53 +507,53 @@ const ke = ({
|
|
|
507
507
|
ke,
|
|
508
508
|
{
|
|
509
509
|
field: e,
|
|
510
|
-
value:
|
|
511
|
-
onChange:
|
|
512
|
-
error:
|
|
510
|
+
value: n,
|
|
511
|
+
onChange: t,
|
|
512
|
+
error: a,
|
|
513
513
|
locale: o
|
|
514
514
|
}
|
|
515
515
|
);
|
|
516
516
|
case "multi-autocomplete":
|
|
517
517
|
return /* @__PURE__ */ l.jsx(
|
|
518
|
-
|
|
518
|
+
$e,
|
|
519
519
|
{
|
|
520
520
|
field: e,
|
|
521
|
-
value:
|
|
522
|
-
onChange:
|
|
523
|
-
error:
|
|
521
|
+
value: n,
|
|
522
|
+
onChange: t,
|
|
523
|
+
error: a,
|
|
524
524
|
locale: o
|
|
525
525
|
}
|
|
526
526
|
);
|
|
527
527
|
case "checkbox":
|
|
528
528
|
return /* @__PURE__ */ l.jsx(
|
|
529
|
-
|
|
529
|
+
Ae,
|
|
530
530
|
{
|
|
531
531
|
field: e,
|
|
532
|
-
value:
|
|
533
|
-
onChange:
|
|
534
|
-
error:
|
|
532
|
+
value: n,
|
|
533
|
+
onChange: t,
|
|
534
|
+
error: a,
|
|
535
535
|
locale: o
|
|
536
536
|
}
|
|
537
537
|
);
|
|
538
538
|
case "textarea":
|
|
539
539
|
return /* @__PURE__ */ l.jsx(
|
|
540
|
-
|
|
540
|
+
we,
|
|
541
541
|
{
|
|
542
542
|
field: e,
|
|
543
|
-
value:
|
|
544
|
-
onChange:
|
|
545
|
-
error:
|
|
543
|
+
value: n,
|
|
544
|
+
onChange: t,
|
|
545
|
+
error: a,
|
|
546
546
|
locale: o
|
|
547
547
|
}
|
|
548
548
|
);
|
|
549
549
|
case "radio":
|
|
550
550
|
return /* @__PURE__ */ l.jsx(
|
|
551
|
-
|
|
551
|
+
Oe,
|
|
552
552
|
{
|
|
553
553
|
field: e,
|
|
554
|
-
value:
|
|
555
|
-
onChange:
|
|
556
|
-
error:
|
|
554
|
+
value: n,
|
|
555
|
+
onChange: t,
|
|
556
|
+
error: a,
|
|
557
557
|
locale: o
|
|
558
558
|
}
|
|
559
559
|
);
|
|
@@ -563,152 +563,102 @@ const ke = ({
|
|
|
563
563
|
e.type
|
|
564
564
|
] });
|
|
565
565
|
}
|
|
566
|
-
},
|
|
566
|
+
}, Pe = ({
|
|
567
567
|
field: e,
|
|
568
|
-
value:
|
|
569
|
-
onChange:
|
|
570
|
-
error:
|
|
568
|
+
value: n,
|
|
569
|
+
onChange: t,
|
|
570
|
+
error: a,
|
|
571
571
|
renderers: o = {},
|
|
572
|
-
locale:
|
|
572
|
+
locale: s = "en"
|
|
573
573
|
}) => {
|
|
574
|
-
const
|
|
574
|
+
const u = o[e.type] || Fe;
|
|
575
575
|
return /* @__PURE__ */ l.jsx(
|
|
576
|
-
|
|
576
|
+
u,
|
|
577
577
|
{
|
|
578
578
|
field: e,
|
|
579
|
-
value:
|
|
580
|
-
onChange:
|
|
581
|
-
error:
|
|
582
|
-
locale:
|
|
579
|
+
value: n,
|
|
580
|
+
onChange: t,
|
|
581
|
+
error: a,
|
|
582
|
+
locale: s
|
|
583
583
|
}
|
|
584
584
|
);
|
|
585
585
|
};
|
|
586
|
-
function
|
|
587
|
-
const
|
|
586
|
+
function Ce(e) {
|
|
587
|
+
const n = e ?? 12;
|
|
588
588
|
return {
|
|
589
589
|
xs: 12,
|
|
590
590
|
// always full width on mobile
|
|
591
|
-
sm:
|
|
591
|
+
sm: n,
|
|
592
592
|
// use span for tablet
|
|
593
|
-
md:
|
|
593
|
+
md: n,
|
|
594
594
|
// use span for desktop
|
|
595
|
-
lg:
|
|
595
|
+
lg: n,
|
|
596
596
|
// use span for large screens
|
|
597
|
-
xl:
|
|
597
|
+
xl: n
|
|
598
598
|
};
|
|
599
599
|
}
|
|
600
|
-
const
|
|
601
|
-
section: e,
|
|
602
|
-
values: t,
|
|
603
|
-
onChange: n,
|
|
604
|
-
renderers: u,
|
|
605
|
-
validateField: o,
|
|
606
|
-
locale: a = "en"
|
|
607
|
-
}) => /* @__PURE__ */ l.jsxs(Ee, { mb: 2, children: [
|
|
608
|
-
e.heading && /* @__PURE__ */ l.jsx(
|
|
609
|
-
R,
|
|
610
|
-
{
|
|
611
|
-
variant: "h6",
|
|
612
|
-
sx: {
|
|
613
|
-
fontSize: e.headingFontSize ? `${e.headingFontSize}rem` : "1.25rem"
|
|
614
|
-
},
|
|
615
|
-
gutterBottom: !0,
|
|
616
|
-
color: "black",
|
|
617
|
-
children: b(e.heading, a)
|
|
618
|
-
}
|
|
619
|
-
),
|
|
620
|
-
e.description && /* @__PURE__ */ l.jsx(
|
|
621
|
-
R,
|
|
622
|
-
{
|
|
623
|
-
variant: "body2",
|
|
624
|
-
sx: {
|
|
625
|
-
fontSize: e.descriptionFontSize ? `${e.descriptionFontSize}rem` : "inherit"
|
|
626
|
-
},
|
|
627
|
-
color: "textSecondary",
|
|
628
|
-
gutterBottom: !0,
|
|
629
|
-
children: b(e.description, a)
|
|
630
|
-
}
|
|
631
|
-
),
|
|
632
|
-
/* @__PURE__ */ l.jsx(V, { container: !0, spacing: 2, children: e.fields.map((s) => /* @__PURE__ */ l.jsx(
|
|
633
|
-
V,
|
|
634
|
-
{
|
|
635
|
-
size: Pe(s.layout?.cols),
|
|
636
|
-
children: /* @__PURE__ */ l.jsx(
|
|
637
|
-
Fe,
|
|
638
|
-
{
|
|
639
|
-
field: s,
|
|
640
|
-
value: t[s.id],
|
|
641
|
-
onChange: (c) => n(s.id, c),
|
|
642
|
-
renderers: u,
|
|
643
|
-
error: o(s.id)?.join(","),
|
|
644
|
-
locale: a
|
|
645
|
-
}
|
|
646
|
-
)
|
|
647
|
-
},
|
|
648
|
-
s.id
|
|
649
|
-
)) })
|
|
650
|
-
] }), ze = {
|
|
600
|
+
const ze = {
|
|
651
601
|
/**
|
|
652
602
|
* Validates that a required field has a value.
|
|
653
603
|
* @param field - The field definition
|
|
654
604
|
* @param value - The field value to validate
|
|
655
605
|
* @returns Error message if validation fails, null otherwise
|
|
656
606
|
*/
|
|
657
|
-
required: (e,
|
|
607
|
+
required: (e, n) => e.required && (n == null || n === "") ? `${e.label} is required` : null,
|
|
658
608
|
/**
|
|
659
609
|
* Validates that a number field meets the minimum value requirement.
|
|
660
610
|
* @param field - The field definition
|
|
661
611
|
* @param value - The field value to validate
|
|
662
612
|
* @returns Error message if validation fails, null otherwise
|
|
663
613
|
*/
|
|
664
|
-
min: (e,
|
|
614
|
+
min: (e, n) => e.type === "number" && e.min !== void 0 && n < e.min ? `${e.label} must be at least ${e.min}` : null,
|
|
665
615
|
/**
|
|
666
616
|
* Validates that a number field does not exceed the maximum value.
|
|
667
617
|
* @param field - The field definition
|
|
668
618
|
* @param value - The field value to validate
|
|
669
619
|
* @returns Error message if validation fails, null otherwise
|
|
670
620
|
*/
|
|
671
|
-
max: (e,
|
|
621
|
+
max: (e, n) => e.type === "number" && e.max !== void 0 && n > e.max ? `${e.label} must be at most ${e.max}` : null,
|
|
672
622
|
/**
|
|
673
623
|
* Validates that a string field meets the minimum length requirement.
|
|
674
624
|
* @param field - The field definition
|
|
675
625
|
* @param value - The field value to validate
|
|
676
626
|
* @returns Error message if validation fails, null otherwise
|
|
677
627
|
*/
|
|
678
|
-
minLength: (e,
|
|
628
|
+
minLength: (e, n) => typeof n == "string" && e.minLength !== void 0 && n.length < e.minLength ? `${e.label} must be at least ${e.minLength} characters` : null,
|
|
679
629
|
/**
|
|
680
630
|
* Validates that a string field does not exceed the maximum length.
|
|
681
631
|
* @param field - The field definition
|
|
682
632
|
* @param value - The field value to validate
|
|
683
633
|
* @returns Error message if validation fails, null otherwise
|
|
684
634
|
*/
|
|
685
|
-
maxLength: (e,
|
|
635
|
+
maxLength: (e, n) => typeof n == "string" && e.maxLength !== void 0 && n.length > e.maxLength ? `${e.label} must be at most ${e.maxLength} characters` : null,
|
|
686
636
|
/**
|
|
687
637
|
* Validates that a string field matches the specified regex pattern.
|
|
688
638
|
* @param field - The field definition
|
|
689
639
|
* @param value - The field value to validate
|
|
690
640
|
* @returns Error message if validation fails, null otherwise
|
|
691
641
|
*/
|
|
692
|
-
pattern: (e,
|
|
642
|
+
pattern: (e, n) => e.pattern && typeof n == "string" && !e.pattern.test(n) ? `${e.label} is invalid` : null,
|
|
693
643
|
/**
|
|
694
644
|
* Validates that a select field value is one of the allowed options.
|
|
695
645
|
* @param field - The field definition
|
|
696
646
|
* @param value - The field value to validate
|
|
697
647
|
* @returns Error message if validation fails, null otherwise
|
|
698
648
|
*/
|
|
699
|
-
options: (e,
|
|
649
|
+
options: (e, n) => e.type === "select" && e.options && !e.options.includes(n) ? `${e.label} must be one of: ${e.options.join(", ")}` : null,
|
|
700
650
|
/**
|
|
701
651
|
* Validates that a date field falls within the specified date range.
|
|
702
652
|
* @param field - The field definition
|
|
703
653
|
* @param value - The field value to validate
|
|
704
654
|
* @returns Error message if validation fails, null otherwise
|
|
705
655
|
*/
|
|
706
|
-
dateRange: (e,
|
|
707
|
-
if (e.type === "date" &&
|
|
708
|
-
const
|
|
709
|
-
if (e.minDate &&
|
|
656
|
+
dateRange: (e, n) => {
|
|
657
|
+
if (e.type === "date" && n) {
|
|
658
|
+
const t = new Date(n);
|
|
659
|
+
if (e.minDate && t < new Date(e.minDate))
|
|
710
660
|
return `${e.label} must be after ${e.minDate}`;
|
|
711
|
-
if (e.maxDate &&
|
|
661
|
+
if (e.maxDate && t > new Date(e.maxDate))
|
|
712
662
|
return `${e.label} must be before ${e.maxDate}`;
|
|
713
663
|
}
|
|
714
664
|
return null;
|
|
@@ -719,70 +669,142 @@ const Ce = ({
|
|
|
719
669
|
* @param value - The field value to validate
|
|
720
670
|
* @returns Error message if validation fails, null otherwise
|
|
721
671
|
*/
|
|
722
|
-
customValidator: (e,
|
|
672
|
+
customValidator: (e, n) => {
|
|
723
673
|
if (e.customValidator && typeof e.customValidator == "function") {
|
|
724
|
-
const
|
|
725
|
-
if (typeof
|
|
726
|
-
return
|
|
674
|
+
const t = e.customValidator(n);
|
|
675
|
+
if (typeof t == "string")
|
|
676
|
+
return t;
|
|
727
677
|
}
|
|
728
678
|
return null;
|
|
729
679
|
}
|
|
730
|
-
},
|
|
731
|
-
const
|
|
680
|
+
}, Ie = (e, n, t = "en") => {
|
|
681
|
+
const a = {};
|
|
732
682
|
return e.sections.forEach((o) => {
|
|
733
|
-
o.fields.forEach((
|
|
734
|
-
const
|
|
735
|
-
|
|
683
|
+
o.fields.forEach((s) => {
|
|
684
|
+
const u = K(e, n, s.id);
|
|
685
|
+
u.length > 0 && (a[s.id] = u);
|
|
736
686
|
});
|
|
737
|
-
}),
|
|
738
|
-
},
|
|
739
|
-
const o = e.sections.flatMap((
|
|
687
|
+
}), a;
|
|
688
|
+
}, K = (e, n, t, a = "en") => {
|
|
689
|
+
const o = e.sections.flatMap((b) => b.fields).find((b) => b.id === t);
|
|
740
690
|
if (!o) return [];
|
|
741
|
-
const
|
|
742
|
-
if (
|
|
743
|
-
typeof
|
|
744
|
-
),
|
|
745
|
-
const
|
|
746
|
-
|
|
691
|
+
const s = o.validations || {}, u = n[t], c = [], h = f(o.label, a);
|
|
692
|
+
if (s.required && (u == null || u === "") && c.push(
|
|
693
|
+
typeof s.required == "string" ? s.required : `${h} is required`
|
|
694
|
+
), s.min !== void 0 && typeof u == "number" && u < s.min && c.push(`${h} must be at least ${s.min}`), s.max !== void 0 && typeof u == "number" && u > s.max && c.push(`${h} must be at most ${s.max}`), s.minLength !== void 0 && typeof u == "string" && u.length < s.minLength && c.push(`${h} must be at least ${s.minLength} characters`), s.maxLength !== void 0 && typeof u == "string" && u.length > s.maxLength && c.push(`${h} must be at most ${s.maxLength} characters`), s.pattern && typeof u == "string" && !s.pattern.test(u) && c.push(`${h} is invalid`), s.validate) {
|
|
695
|
+
const b = s.validate(u);
|
|
696
|
+
b && c.push(f(b, a));
|
|
747
697
|
}
|
|
748
698
|
return c;
|
|
749
699
|
};
|
|
750
|
-
function
|
|
751
|
-
|
|
700
|
+
function I(e, n) {
|
|
701
|
+
if (!e)
|
|
702
|
+
return !0;
|
|
703
|
+
if ("field" in e) {
|
|
704
|
+
let t = n[e.field] ?? "";
|
|
705
|
+
return Array.isArray(t) ? t = t.map((a) => a.value ?? "") : typeof t == "object" && t !== null && (t = t.value ?? ""), e.equals !== void 0 ? t === e.equals : e.notEquals !== void 0 ? t !== e.notEquals : e.in !== void 0 ? Array.isArray(t) ? e.in ? t.some((a) => e.in.includes(a)) : !1 : e.in.includes(t) : e.notIn !== void 0 ? Array.isArray(t) ? t.every((a) => !e.notIn.includes(a)) : !e.notIn.includes(t) : e.greaterThan !== void 0 ? t > e.greaterThan : e.lessThan !== void 0 ? t < e.lessThan : !0;
|
|
706
|
+
}
|
|
707
|
+
if ("operator" in e) {
|
|
708
|
+
if (e.operator === "AND")
|
|
709
|
+
return e.conditions.every(
|
|
710
|
+
(a) => I(a, n)
|
|
711
|
+
);
|
|
712
|
+
if (e.operator === "OR")
|
|
713
|
+
return e.conditions.some(
|
|
714
|
+
(t) => I(t, n)
|
|
715
|
+
);
|
|
716
|
+
}
|
|
717
|
+
return !1;
|
|
718
|
+
}
|
|
719
|
+
const Le = ({
|
|
720
|
+
section: e,
|
|
721
|
+
values: n,
|
|
722
|
+
onChange: t,
|
|
723
|
+
renderers: a,
|
|
724
|
+
validateField: o,
|
|
725
|
+
locale: s = "en"
|
|
726
|
+
}) => /* @__PURE__ */ l.jsxs(je, { mb: 2, children: [
|
|
727
|
+
e.heading && /* @__PURE__ */ l.jsx(
|
|
728
|
+
_,
|
|
729
|
+
{
|
|
730
|
+
variant: "h6",
|
|
731
|
+
sx: {
|
|
732
|
+
fontSize: e.headingFontSize ? `${e.headingFontSize}rem` : "1.25rem"
|
|
733
|
+
},
|
|
734
|
+
gutterBottom: !0,
|
|
735
|
+
color: "black",
|
|
736
|
+
children: f(e.heading, s)
|
|
737
|
+
}
|
|
738
|
+
),
|
|
739
|
+
e.description && /* @__PURE__ */ l.jsx(
|
|
740
|
+
_,
|
|
741
|
+
{
|
|
742
|
+
variant: "body2",
|
|
743
|
+
sx: {
|
|
744
|
+
fontSize: e.descriptionFontSize ? `${e.descriptionFontSize}rem` : "inherit"
|
|
745
|
+
},
|
|
746
|
+
color: "textSecondary",
|
|
747
|
+
gutterBottom: !0,
|
|
748
|
+
children: f(e.description, s)
|
|
749
|
+
}
|
|
750
|
+
),
|
|
751
|
+
/* @__PURE__ */ l.jsx(M, { container: !0, spacing: 2, children: e.fields.map(
|
|
752
|
+
(u) => I(u.visibleWhen, n) && /* @__PURE__ */ l.jsx(
|
|
753
|
+
M,
|
|
754
|
+
{
|
|
755
|
+
size: Ce(u.layout?.cols),
|
|
756
|
+
children: /* @__PURE__ */ l.jsx(
|
|
757
|
+
Pe,
|
|
758
|
+
{
|
|
759
|
+
field: u,
|
|
760
|
+
value: n[u.id],
|
|
761
|
+
onChange: (c) => t(u.id, c),
|
|
762
|
+
renderers: a,
|
|
763
|
+
error: o(u.id)?.join(","),
|
|
764
|
+
locale: s
|
|
765
|
+
}
|
|
766
|
+
)
|
|
767
|
+
},
|
|
768
|
+
u.id
|
|
769
|
+
)
|
|
770
|
+
) })
|
|
771
|
+
] });
|
|
772
|
+
function Ne(e, n = "en") {
|
|
773
|
+
const [t, a] = V({}), [o, s] = V({});
|
|
752
774
|
return {
|
|
753
775
|
/** Current form values for all fields */
|
|
754
|
-
values:
|
|
776
|
+
values: t,
|
|
755
777
|
/** Function to update a field value */
|
|
756
|
-
handleChange: (
|
|
757
|
-
|
|
778
|
+
handleChange: (x, R) => {
|
|
779
|
+
a((v) => ({ ...v, [x]: R })), s((v) => ({ ...v, [x]: null }));
|
|
758
780
|
},
|
|
759
781
|
/** Function to validate all fields */
|
|
760
|
-
validateAll: () =>
|
|
782
|
+
validateAll: () => Ie(e, t, n),
|
|
761
783
|
/** Function to get all current form values */
|
|
762
|
-
getValues: () =>
|
|
784
|
+
getValues: () => t,
|
|
763
785
|
/** Function to get all current form errors */
|
|
764
786
|
getErrors: () => o,
|
|
765
787
|
/** Function to validate a specific field */
|
|
766
|
-
validateField: (
|
|
788
|
+
validateField: (x) => K(e, t, x, n)
|
|
767
789
|
};
|
|
768
790
|
}
|
|
769
|
-
const Ye =
|
|
791
|
+
const Ye = J.forwardRef(({ dto: e, renderers: n, locale: t = "en" }, a) => {
|
|
770
792
|
const {
|
|
771
793
|
values: o,
|
|
772
|
-
handleChange:
|
|
773
|
-
getValues:
|
|
794
|
+
handleChange: s,
|
|
795
|
+
getValues: u,
|
|
774
796
|
getErrors: c,
|
|
775
797
|
validateAll: h,
|
|
776
|
-
validateField:
|
|
777
|
-
} =
|
|
778
|
-
return
|
|
779
|
-
getValues:
|
|
798
|
+
validateField: b
|
|
799
|
+
} = Ne(e, t);
|
|
800
|
+
return pe(a, () => ({
|
|
801
|
+
getValues: u,
|
|
780
802
|
getErrors: c,
|
|
781
803
|
validateAll: h,
|
|
782
|
-
validateField:
|
|
804
|
+
validateField: b
|
|
783
805
|
})), /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
784
806
|
e.title && /* @__PURE__ */ l.jsx(
|
|
785
|
-
|
|
807
|
+
_,
|
|
786
808
|
{
|
|
787
809
|
variant: "h5",
|
|
788
810
|
color: "black",
|
|
@@ -791,11 +813,11 @@ const Ye = G.forwardRef(({ dto: e, renderers: t, locale: n = "en" }, u) => {
|
|
|
791
813
|
fontWeight: "bold"
|
|
792
814
|
},
|
|
793
815
|
gutterBottom: !0,
|
|
794
|
-
children:
|
|
816
|
+
children: f(e.title, t)
|
|
795
817
|
}
|
|
796
818
|
),
|
|
797
819
|
e.description && /* @__PURE__ */ l.jsx(
|
|
798
|
-
|
|
820
|
+
_,
|
|
799
821
|
{
|
|
800
822
|
component: "p",
|
|
801
823
|
sx: {
|
|
@@ -803,18 +825,18 @@ const Ye = G.forwardRef(({ dto: e, renderers: t, locale: n = "en" }, u) => {
|
|
|
803
825
|
},
|
|
804
826
|
color: "textSecondary",
|
|
805
827
|
gutterBottom: !0,
|
|
806
|
-
children:
|
|
828
|
+
children: f(e.description, t)
|
|
807
829
|
}
|
|
808
830
|
),
|
|
809
831
|
e.sections.map((g) => /* @__PURE__ */ l.jsx(
|
|
810
|
-
|
|
832
|
+
Le,
|
|
811
833
|
{
|
|
812
834
|
section: g,
|
|
813
835
|
values: o,
|
|
814
|
-
onChange:
|
|
815
|
-
renderers:
|
|
816
|
-
validateField:
|
|
817
|
-
locale:
|
|
836
|
+
onChange: s,
|
|
837
|
+
renderers: n,
|
|
838
|
+
validateField: b,
|
|
839
|
+
locale: t
|
|
818
840
|
},
|
|
819
841
|
g.id
|
|
820
842
|
))
|
|
@@ -822,17 +844,17 @@ const Ye = G.forwardRef(({ dto: e, renderers: t, locale: n = "en" }, u) => {
|
|
|
822
844
|
});
|
|
823
845
|
export {
|
|
824
846
|
ke as AutoCompleteField,
|
|
825
|
-
|
|
826
|
-
|
|
847
|
+
Ae as CheckBoxInput,
|
|
848
|
+
Pe as Field,
|
|
827
849
|
Ye as FormBuilder,
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
850
|
+
$e as MultiAutoCompleteField,
|
|
851
|
+
Oe as RadioInput,
|
|
852
|
+
Le as Section,
|
|
853
|
+
Te as SelectInput,
|
|
854
|
+
we as TextAreaInput,
|
|
855
|
+
Se as TextInput,
|
|
856
|
+
Ne as useFormBuilder,
|
|
857
|
+
Ie as validateAll,
|
|
858
|
+
K as validateField,
|
|
837
859
|
ze as validationRules
|
|
838
860
|
};
|