@arudovwen/form-builder-react 1.4.37 → 1.4.39
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.es.js +65 -55
- package/dist/form-builder.umd.js +14 -14
- package/dist/index.css +1 -1
- package/package.json +1 -1
package/dist/form-builder.es.js
CHANGED
|
@@ -215,8 +215,8 @@ function ko() {
|
|
|
215
215
|
}
|
|
216
216
|
var si = !1, di;
|
|
217
217
|
{
|
|
218
|
-
var
|
|
219
|
-
di = new
|
|
218
|
+
var ki = typeof WeakMap == "function" ? WeakMap : Map;
|
|
219
|
+
di = new ki();
|
|
220
220
|
}
|
|
221
221
|
function yi(b, k) {
|
|
222
222
|
if (!b || si)
|
|
@@ -289,10 +289,10 @@ function ko() {
|
|
|
289
289
|
var Li = b ? b.displayName || b.name : "", Ti = Li ? ui(Li) : "";
|
|
290
290
|
return typeof b == "function" && di.set(b, Ti), Ti;
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function ji(b, k, T) {
|
|
293
293
|
return yi(b, !1);
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function Ci(b) {
|
|
296
296
|
var k = b.prototype;
|
|
297
297
|
return !!(k && k.isReactComponent);
|
|
298
298
|
}
|
|
@@ -300,7 +300,7 @@ function ko() {
|
|
|
300
300
|
if (b == null)
|
|
301
301
|
return "";
|
|
302
302
|
if (typeof b == "function")
|
|
303
|
-
return yi(b,
|
|
303
|
+
return yi(b, Ci(b));
|
|
304
304
|
if (typeof b == "string")
|
|
305
305
|
return ui(b);
|
|
306
306
|
switch (b) {
|
|
@@ -312,7 +312,7 @@ function ko() {
|
|
|
312
312
|
if (typeof b == "object")
|
|
313
313
|
switch (b.$$typeof) {
|
|
314
314
|
case u:
|
|
315
|
-
return
|
|
315
|
+
return ji(b.render);
|
|
316
316
|
case v:
|
|
317
317
|
return zi(b.type, k, T);
|
|
318
318
|
case h: {
|
|
@@ -2742,7 +2742,7 @@ const F = ({
|
|
|
2742
2742
|
sn,
|
|
2743
2743
|
{
|
|
2744
2744
|
onValueChange: (S) => {
|
|
2745
|
-
|
|
2745
|
+
u(e, S != null ? S : null), o && o(e), c && c(e);
|
|
2746
2746
|
},
|
|
2747
2747
|
placeholder: d,
|
|
2748
2748
|
className: `field-control ${s != null && s[e] ? "border-red-300" : "border-[#D0D5DD]"}`,
|
|
@@ -5055,7 +5055,7 @@ function hs({
|
|
|
5055
5055
|
register: o,
|
|
5056
5056
|
trigger: s,
|
|
5057
5057
|
setValue: a,
|
|
5058
|
-
value: t
|
|
5058
|
+
value: t,
|
|
5059
5059
|
prefix: i.prefix,
|
|
5060
5060
|
disabled: d,
|
|
5061
5061
|
watch: l
|
|
@@ -7504,7 +7504,7 @@ const xl = ({
|
|
|
7504
7504
|
onTitleChange: v,
|
|
7505
7505
|
uploadUrl: h
|
|
7506
7506
|
}
|
|
7507
|
-
)),
|
|
7507
|
+
)), Mi = {
|
|
7508
7508
|
required: "This field is required",
|
|
7509
7509
|
email: "Invalid email format",
|
|
7510
7510
|
url: "Invalid url format",
|
|
@@ -7520,12 +7520,12 @@ const xl = ({
|
|
|
7520
7520
|
selectField: B.string().nullable(),
|
|
7521
7521
|
checkbox: B.mixed().nullable(),
|
|
7522
7522
|
radio: B.mixed().nullable(),
|
|
7523
|
-
email: B.string().nullable().test("email-format",
|
|
7523
|
+
email: B.string().nullable().test("email-format", Mi.email, (o) => !o || o.trim() === "" ? !0 : /^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/.test(o)),
|
|
7524
7524
|
date: B.date().typeError("Invalid date").nullable(),
|
|
7525
|
-
url: B.string().nullable().test("url-format",
|
|
7525
|
+
url: B.string().nullable().test("url-format", Mi.url, (o) => !o || o.trim() === "" ? !0 : /^(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\/.*)?$/.test(
|
|
7526
7526
|
o
|
|
7527
7527
|
))
|
|
7528
|
-
})[i] || B.mixed().nullable(), Qs = (i, e, o) => e ? i.type === "boolean" ? i.oneOf([!0], o ||
|
|
7528
|
+
})[i] || B.mixed().nullable(), Qs = (i, e, o) => e ? i.type === "boolean" ? i.oneOf([!0], o || Mi.required) : i.required(o || Mi.required) : i, Xs = (i, {
|
|
7529
7529
|
minLength: e,
|
|
7530
7530
|
maxLength: o,
|
|
7531
7531
|
minLengthMessage: s,
|
|
@@ -7534,10 +7534,10 @@ const xl = ({
|
|
|
7534
7534
|
let l = i;
|
|
7535
7535
|
return e && (l = l.min(
|
|
7536
7536
|
e,
|
|
7537
|
-
s ||
|
|
7537
|
+
s || Mi.minLength(e)
|
|
7538
7538
|
)), o && (l = l.max(
|
|
7539
7539
|
o,
|
|
7540
|
-
a ||
|
|
7540
|
+
a || Mi.maxLength(o)
|
|
7541
7541
|
)), l;
|
|
7542
7542
|
}, il = (i, {
|
|
7543
7543
|
minAmount: e,
|
|
@@ -7548,10 +7548,10 @@ const xl = ({
|
|
|
7548
7548
|
let l = i;
|
|
7549
7549
|
return e && (l = l.min(
|
|
7550
7550
|
parseFloat(String(e)),
|
|
7551
|
-
s ||
|
|
7551
|
+
s || Mi.minAmount(e)
|
|
7552
7552
|
)), o && (l = l.max(
|
|
7553
7553
|
parseFloat(String(o)),
|
|
7554
|
-
a ||
|
|
7554
|
+
a || Mi.maxAmount(o)
|
|
7555
7555
|
)), l;
|
|
7556
7556
|
};
|
|
7557
7557
|
function nl(i) {
|
|
@@ -7784,13 +7784,16 @@ const sl = ({
|
|
|
7784
7784
|
}, [v, r]), O(() => {
|
|
7785
7785
|
if (!(y != null && y.length) || !a) return;
|
|
7786
7786
|
const di = y.flatMap(
|
|
7787
|
-
(
|
|
7787
|
+
(ki) => {
|
|
7788
7788
|
var yi;
|
|
7789
|
-
return (yi =
|
|
7790
|
-
id:
|
|
7791
|
-
value: G[
|
|
7792
|
-
sectionId:
|
|
7793
|
-
type:
|
|
7789
|
+
return (yi = ki.questionData) == null ? void 0 : yi.map((ji) => ({
|
|
7790
|
+
id: ji.id,
|
|
7791
|
+
value: G[ji.id],
|
|
7792
|
+
sectionId: ki.id,
|
|
7793
|
+
type: ji.type,
|
|
7794
|
+
metaData: {
|
|
7795
|
+
prefix: ji.prefix
|
|
7796
|
+
}
|
|
7794
7797
|
}));
|
|
7795
7798
|
}
|
|
7796
7799
|
);
|
|
@@ -7806,25 +7809,28 @@ const sl = ({
|
|
|
7806
7809
|
}, [e, C]);
|
|
7807
7810
|
const w = Y(
|
|
7808
7811
|
(di) => {
|
|
7809
|
-
const
|
|
7812
|
+
const ki = y.flatMap(
|
|
7810
7813
|
(yi) => {
|
|
7811
|
-
var
|
|
7812
|
-
return (
|
|
7813
|
-
id:
|
|
7814
|
-
value: di[
|
|
7814
|
+
var ji;
|
|
7815
|
+
return (ji = yi.questionData) == null ? void 0 : ji.map((Ci) => ({
|
|
7816
|
+
id: Ci.id,
|
|
7817
|
+
value: di[Ci.id],
|
|
7815
7818
|
sectionId: yi.id,
|
|
7816
|
-
type:
|
|
7819
|
+
type: Ci.type,
|
|
7820
|
+
metaData: {
|
|
7821
|
+
prefix: Ci.prefix
|
|
7822
|
+
}
|
|
7817
7823
|
}));
|
|
7818
7824
|
}
|
|
7819
7825
|
);
|
|
7820
|
-
Object.keys(W).length > 0 || s == null || s(
|
|
7826
|
+
Object.keys(W).length > 0 || s == null || s(ki);
|
|
7821
7827
|
},
|
|
7822
7828
|
[W, y, s]
|
|
7823
7829
|
), I = Y(async () => {
|
|
7824
|
-
var di,
|
|
7830
|
+
var di, ki;
|
|
7825
7831
|
if (!o) {
|
|
7826
|
-
const yi = (
|
|
7827
|
-
(
|
|
7832
|
+
const yi = (ki = (di = y == null ? void 0 : y[h]) == null ? void 0 : di.questionData) == null ? void 0 : ki.map(
|
|
7833
|
+
(Ci) => Ci.id
|
|
7828
7834
|
);
|
|
7829
7835
|
if (!await M(yi)) return;
|
|
7830
7836
|
}
|
|
@@ -7892,26 +7898,30 @@ const sl = ({
|
|
|
7892
7898
|
},
|
|
7893
7899
|
(si = y == null ? void 0 : y[h]) == null ? void 0 : si.id
|
|
7894
7900
|
) }),
|
|
7895
|
-
!u && /* @__PURE__ */ n.jsx("footer", { className: "
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
|
|
7912
|
-
|
|
7913
|
-
|
|
7914
|
-
|
|
7901
|
+
!u && /* @__PURE__ */ n.jsx("footer", { className: "w-full footer", children: d === "multi" ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
7902
|
+
/* @__PURE__ */ n.jsxs("div", { className: "flex gap-x-4 justify-end", children: [
|
|
7903
|
+
h > 0 && /* @__PURE__ */ n.jsx(
|
|
7904
|
+
Ei,
|
|
7905
|
+
{
|
|
7906
|
+
type: "button",
|
|
7907
|
+
text: "Back",
|
|
7908
|
+
onClick: U,
|
|
7909
|
+
btnClass: "text-gray-700 text-sm border-[#98A2B3] !font-medium !py-2 px-10 bg-gray-200 rounded-lg"
|
|
7910
|
+
}
|
|
7911
|
+
),
|
|
7912
|
+
h < f - 1 && /* @__PURE__ */ n.jsx(
|
|
7913
|
+
Ei,
|
|
7914
|
+
{
|
|
7915
|
+
type: "button",
|
|
7916
|
+
text: "Next",
|
|
7917
|
+
onClick: I,
|
|
7918
|
+
style: { background: (m == null ? void 0 : m.buttonColor) || "#333" },
|
|
7919
|
+
btnClass: "text-gray-700 text-sm border-[#98A2B3] !font-medium !py-2 px-10 bg-blue-600 text-white rounded-lg continue_btn"
|
|
7920
|
+
}
|
|
7921
|
+
)
|
|
7922
|
+
] }),
|
|
7923
|
+
" ",
|
|
7924
|
+
!o && /* @__PURE__ */ n.jsx("div", { className: "mt-10", children: t != null ? t : /* @__PURE__ */ n.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ n.jsx(
|
|
7915
7925
|
Ei,
|
|
7916
7926
|
{
|
|
7917
7927
|
isDisabled: Z || Object.keys(W).length > 0,
|
|
@@ -7921,8 +7931,8 @@ const sl = ({
|
|
|
7921
7931
|
style: { background: (m == null ? void 0 : m.buttonColor) || "#333" },
|
|
7922
7932
|
btnClass: "text-gray-700 border-[#98A2B3] !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg submit_btn"
|
|
7923
7933
|
}
|
|
7924
|
-
))
|
|
7925
|
-
] }) : !o && (t != null ? t : /* @__PURE__ */ n.jsx(
|
|
7934
|
+
) }) })
|
|
7935
|
+
] }) : !o && (t != null ? t : /* @__PURE__ */ n.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ n.jsx(
|
|
7926
7936
|
Ei,
|
|
7927
7937
|
{
|
|
7928
7938
|
isDisabled: Z || Object.keys(W).length > 0,
|
|
@@ -7932,7 +7942,7 @@ const sl = ({
|
|
|
7932
7942
|
style: { background: (m == null ? void 0 : m.buttonColor) || "#333" },
|
|
7933
7943
|
btnClass: "text-gray-700 border-[#98A2B3] !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg submit_btn"
|
|
7934
7944
|
}
|
|
7935
|
-
)) })
|
|
7945
|
+
) })) })
|
|
7936
7946
|
]
|
|
7937
7947
|
}
|
|
7938
7948
|
)
|