@arudovwen/form-builder-react 1.4.36 → 1.4.38

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.
@@ -215,8 +215,8 @@ function ko() {
215
215
  }
216
216
  var si = !1, di;
217
217
  {
218
- var ji = typeof WeakMap == "function" ? WeakMap : Map;
219
- di = new ji();
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 ki(b, k, T) {
292
+ function ji(b, k, T) {
293
293
  return yi(b, !1);
294
294
  }
295
- function Mi(b) {
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, Mi(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 ki(b.render);
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
- u(e, S), o && o(e), c && c(e);
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]"}`,
@@ -7504,7 +7504,7 @@ const xl = ({
7504
7504
  onTitleChange: v,
7505
7505
  uploadUrl: h
7506
7506
  }
7507
- )), Ci = {
7507
+ )), Mi = {
7508
7508
  required: "This field is required",
7509
7509
  email: "Invalid email format",
7510
7510
  url: "Invalid url format",
@@ -7520,16 +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().matches(
7524
- /^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/,
7525
- Ci.email
7526
- ),
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)),
7527
7524
  date: B.date().typeError("Invalid date").nullable(),
7528
- url: B.string().nullable().matches(
7529
- /^(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\/.*)?$/,
7530
- Ci.url
7531
- )
7532
- })[i] || B.mixed().nullable(), Qs = (i, e, o) => e ? i.type === "boolean" ? i.oneOf([!0], o || Ci.required) : i.required(o || Ci.required) : i, Xs = (i, {
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
+ o
7527
+ ))
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, {
7533
7529
  minLength: e,
7534
7530
  maxLength: o,
7535
7531
  minLengthMessage: s,
@@ -7538,10 +7534,10 @@ const xl = ({
7538
7534
  let l = i;
7539
7535
  return e && (l = l.min(
7540
7536
  e,
7541
- s || Ci.minLength(e)
7537
+ s || Mi.minLength(e)
7542
7538
  )), o && (l = l.max(
7543
7539
  o,
7544
- a || Ci.maxLength(o)
7540
+ a || Mi.maxLength(o)
7545
7541
  )), l;
7546
7542
  }, il = (i, {
7547
7543
  minAmount: e,
@@ -7552,10 +7548,10 @@ const xl = ({
7552
7548
  let l = i;
7553
7549
  return e && (l = l.min(
7554
7550
  parseFloat(String(e)),
7555
- s || Ci.minAmount(e)
7551
+ s || Mi.minAmount(e)
7556
7552
  )), o && (l = l.max(
7557
7553
  parseFloat(String(o)),
7558
- a || Ci.maxAmount(o)
7554
+ a || Mi.maxAmount(o)
7559
7555
  )), l;
7560
7556
  };
7561
7557
  function nl(i) {
@@ -7788,13 +7784,16 @@ const sl = ({
7788
7784
  }, [v, r]), O(() => {
7789
7785
  if (!(y != null && y.length) || !a) return;
7790
7786
  const di = y.flatMap(
7791
- (ji) => {
7787
+ (ki) => {
7792
7788
  var yi;
7793
- return (yi = ji.questionData) == null ? void 0 : yi.map((ki) => ({
7794
- id: ki.id,
7795
- value: G[ki.id],
7796
- sectionId: ji.id,
7797
- type: ki.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
+ }
7798
7797
  }));
7799
7798
  }
7800
7799
  );
@@ -7810,25 +7809,28 @@ const sl = ({
7810
7809
  }, [e, C]);
7811
7810
  const w = Y(
7812
7811
  (di) => {
7813
- const ji = y.flatMap(
7812
+ const ki = y.flatMap(
7814
7813
  (yi) => {
7815
- var ki;
7816
- return (ki = yi.questionData) == null ? void 0 : ki.map((Mi) => ({
7817
- id: Mi.id,
7818
- value: di[Mi.id],
7814
+ var ji;
7815
+ return (ji = yi.questionData) == null ? void 0 : ji.map((Ci) => ({
7816
+ id: Ci.id,
7817
+ value: di[Ci.id],
7819
7818
  sectionId: yi.id,
7820
- type: Mi.type
7819
+ type: Ci.type,
7820
+ metaData: {
7821
+ prefix: Ci.prefix
7822
+ }
7821
7823
  }));
7822
7824
  }
7823
7825
  );
7824
- Object.keys(W).length > 0 || s == null || s(ji);
7826
+ Object.keys(W).length > 0 || s == null || s(ki);
7825
7827
  },
7826
7828
  [W, y, s]
7827
7829
  ), I = Y(async () => {
7828
- var di, ji;
7830
+ var di, ki;
7829
7831
  if (!o) {
7830
- const yi = (ji = (di = y == null ? void 0 : y[h]) == null ? void 0 : di.questionData) == null ? void 0 : ji.map(
7831
- (Mi) => Mi.id
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
7832
7834
  );
7833
7835
  if (!await M(yi)) return;
7834
7836
  }