react-formio-engine 1.0.7 → 1.1.0

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.
@@ -1,38 +1,30 @@
1
- import Ne, { createContext as Rr, forwardRef as Er, useRef as N, useContext as _r, useImperativeHandle as br, useEffect as ve } from "react";
2
- import { Formio as Le } from "formiojs";
3
- import { Formio as qr } from "formiojs";
4
- import Cr from "formiojs/Form";
5
- import Ue from "formiojs/components/Components";
6
- import Me from "formiojs/components";
7
- import Tr from "formiojs/FormBuilder";
8
- import { createRoot as wr } from "react-dom/client";
9
- import $e from "formiojs/components/_classes/field/Field";
10
- import { default as Gr } from "formiojs/components/_classes/field/Field";
11
- import { default as Xr } from "formiojs/components/_classes/component/Component.form";
1
+ import Ne, { createContext as gr, forwardRef as yr, useRef as N, useContext as Rr, useImperativeHandle as Er, useEffect as ve } from "react";
2
+ import { Form as _r, FormBuilder as br, Components as pe, Formio as Le } from "@formio/js";
3
+ import { createRoot as Cr } from "react-dom/client";
12
4
  var H = { exports: {} }, B = {};
13
5
  var Ie;
14
- function Sr() {
6
+ function Tr() {
15
7
  if (Ie) return B;
16
8
  Ie = 1;
17
- var c = Ne, f = /* @__PURE__ */ Symbol.for("react.element"), g = /* @__PURE__ */ Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, O = c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, P = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function T(E, d, w) {
9
+ var c = Ne, f = /* @__PURE__ */ Symbol.for("react.element"), g = /* @__PURE__ */ Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, P = c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, F = { key: !0, ref: !0, __self: !0, __source: !0 };
10
+ function T(E, d, S) {
19
11
  var a, l = {}, _ = null, k = null;
20
- w !== void 0 && (_ = "" + w), d.key !== void 0 && (_ = "" + d.key), d.ref !== void 0 && (k = d.ref);
21
- for (a in d) m.call(d, a) && !P.hasOwnProperty(a) && (l[a] = d[a]);
12
+ S !== void 0 && (_ = "" + S), d.key !== void 0 && (_ = "" + d.key), d.ref !== void 0 && (k = d.ref);
13
+ for (a in d) m.call(d, a) && !F.hasOwnProperty(a) && (l[a] = d[a]);
22
14
  if (E && E.defaultProps) for (a in d = E.defaultProps, d) l[a] === void 0 && (l[a] = d[a]);
23
- return { $$typeof: f, type: E, key: _, ref: k, props: l, _owner: O.current };
15
+ return { $$typeof: f, type: E, key: _, ref: k, props: l, _owner: P.current };
24
16
  }
25
17
  return B.Fragment = g, B.jsx = T, B.jsxs = T, B;
26
18
  }
27
19
  var J = {};
28
20
  var We;
29
- function Or() {
21
+ function Sr() {
30
22
  return We || (We = 1, process.env.NODE_ENV !== "production" && (function() {
31
- var c = Ne, f = /* @__PURE__ */ Symbol.for("react.element"), g = /* @__PURE__ */ Symbol.for("react.portal"), m = /* @__PURE__ */ Symbol.for("react.fragment"), O = /* @__PURE__ */ Symbol.for("react.strict_mode"), P = /* @__PURE__ */ Symbol.for("react.profiler"), T = /* @__PURE__ */ Symbol.for("react.provider"), E = /* @__PURE__ */ Symbol.for("react.context"), d = /* @__PURE__ */ Symbol.for("react.forward_ref"), w = /* @__PURE__ */ Symbol.for("react.suspense"), a = /* @__PURE__ */ Symbol.for("react.suspense_list"), l = /* @__PURE__ */ Symbol.for("react.memo"), _ = /* @__PURE__ */ Symbol.for("react.lazy"), k = /* @__PURE__ */ Symbol.for("react.offscreen"), h = Symbol.iterator, F = "@@iterator";
23
+ var c = Ne, f = /* @__PURE__ */ Symbol.for("react.element"), g = /* @__PURE__ */ Symbol.for("react.portal"), m = /* @__PURE__ */ Symbol.for("react.fragment"), P = /* @__PURE__ */ Symbol.for("react.strict_mode"), F = /* @__PURE__ */ Symbol.for("react.profiler"), T = /* @__PURE__ */ Symbol.for("react.provider"), E = /* @__PURE__ */ Symbol.for("react.context"), d = /* @__PURE__ */ Symbol.for("react.forward_ref"), S = /* @__PURE__ */ Symbol.for("react.suspense"), a = /* @__PURE__ */ Symbol.for("react.suspense_list"), l = /* @__PURE__ */ Symbol.for("react.memo"), _ = /* @__PURE__ */ Symbol.for("react.lazy"), k = /* @__PURE__ */ Symbol.for("react.offscreen"), h = Symbol.iterator, w = "@@iterator";
32
24
  function Q(e) {
33
25
  if (e === null || typeof e != "object")
34
26
  return null;
35
- var r = h && e[h] || e[F];
27
+ var r = h && e[h] || e[w];
36
28
  return typeof r == "function" ? r : null;
37
29
  }
38
30
  var A = c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
@@ -56,7 +48,7 @@ function Or() {
56
48
  var L = !1, x = !1, re = !1, q = !1, te = !1, V;
57
49
  V = /* @__PURE__ */ Symbol.for("react.module.reference");
58
50
  function ne(e) {
59
- return !!(typeof e == "string" || typeof e == "function" || e === m || e === P || te || e === O || e === w || e === a || q || e === k || L || x || re || typeof e == "object" && e !== null && (e.$$typeof === _ || e.$$typeof === l || e.$$typeof === T || e.$$typeof === E || e.$$typeof === d || // This needs to include all possible module reference object
51
+ return !!(typeof e == "string" || typeof e == "function" || e === m || e === F || te || e === P || e === S || e === a || q || e === k || L || x || re || typeof e == "object" && e !== null && (e.$$typeof === _ || e.$$typeof === l || e.$$typeof === T || e.$$typeof === E || e.$$typeof === d || // This needs to include all possible module reference object
60
52
  // types supported by any Flight configuration anywhere since
61
53
  // we don't know which Flight build this will end up being used
62
54
  // with.
@@ -84,11 +76,11 @@ function Or() {
84
76
  return "Fragment";
85
77
  case g:
86
78
  return "Portal";
87
- case P:
79
+ case F:
88
80
  return "Profiler";
89
- case O:
81
+ case P:
90
82
  return "StrictMode";
91
- case w:
83
+ case S:
92
84
  return "Suspense";
93
85
  case a:
94
86
  return "SuspenseList";
@@ -117,18 +109,18 @@ function Or() {
117
109
  }
118
110
  return null;
119
111
  }
120
- var j = Object.assign, D = 0, U, pe, me, he, ge, ye, Re;
121
- function Ee() {
112
+ var j = Object.assign, D = 0, U, me, he, ge, ye, Re, Ee;
113
+ function _e() {
122
114
  }
123
- Ee.__reactDisabledLog = !0;
124
- function qe() {
115
+ _e.__reactDisabledLog = !0;
116
+ function Be() {
125
117
  {
126
118
  if (D === 0) {
127
- U = console.log, pe = console.info, me = console.warn, he = console.error, ge = console.group, ye = console.groupCollapsed, Re = console.groupEnd;
119
+ U = console.log, me = console.info, he = console.warn, ge = console.error, ye = console.group, Re = console.groupCollapsed, Ee = console.groupEnd;
128
120
  var e = {
129
121
  configurable: !0,
130
122
  enumerable: !0,
131
- value: Ee,
123
+ value: _e,
132
124
  writable: !0
133
125
  };
134
126
  Object.defineProperties(console, {
@@ -144,7 +136,7 @@ function Or() {
144
136
  D++;
145
137
  }
146
138
  }
147
- function Ke() {
139
+ function Je() {
148
140
  {
149
141
  if (D--, D === 0) {
150
142
  var e = {
@@ -157,22 +149,22 @@ function Or() {
157
149
  value: U
158
150
  }),
159
151
  info: j({}, e, {
160
- value: pe
152
+ value: me
161
153
  }),
162
154
  warn: j({}, e, {
163
- value: me
155
+ value: he
164
156
  }),
165
157
  error: j({}, e, {
166
- value: he
158
+ value: ge
167
159
  }),
168
160
  group: j({}, e, {
169
- value: ge
161
+ value: ye
170
162
  }),
171
163
  groupCollapsed: j({}, e, {
172
- value: ye
164
+ value: Re
173
165
  }),
174
166
  groupEnd: j({}, e, {
175
- value: Re
167
+ value: Ee
176
168
  })
177
169
  });
178
170
  }
@@ -195,10 +187,10 @@ function Or() {
195
187
  }
196
188
  var ue = !1, G;
197
189
  {
198
- var Ge = typeof WeakMap == "function" ? WeakMap : Map;
199
- G = new Ge();
190
+ var qe = typeof WeakMap == "function" ? WeakMap : Map;
191
+ G = new qe();
200
192
  }
201
- function _e(e, r) {
193
+ function be(e, r) {
202
194
  if (!e || ue)
203
195
  return "";
204
196
  {
@@ -211,7 +203,7 @@ function Or() {
211
203
  var u = Error.prepareStackTrace;
212
204
  Error.prepareStackTrace = void 0;
213
205
  var s;
214
- s = oe.current, oe.current = null, qe();
206
+ s = oe.current, oe.current = null, Be();
215
207
  try {
216
208
  if (r) {
217
209
  var i = function() {
@@ -255,24 +247,24 @@ function Or() {
255
247
  if (v !== 1 || p !== 1)
256
248
  do
257
249
  if (v--, p--, p < 0 || o[v] !== b[p]) {
258
- var S = `
250
+ var O = `
259
251
  ` + o[v].replace(" at new ", " at ");
260
- return e.displayName && S.includes("<anonymous>") && (S = S.replace("<anonymous>", e.displayName)), typeof e == "function" && G.set(e, S), S;
252
+ return e.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", e.displayName)), typeof e == "function" && G.set(e, O), O;
261
253
  }
262
254
  while (v >= 1 && p >= 0);
263
255
  break;
264
256
  }
265
257
  }
266
258
  } finally {
267
- ue = !1, oe.current = s, Ke(), Error.prepareStackTrace = u;
259
+ ue = !1, oe.current = s, Je(), Error.prepareStackTrace = u;
268
260
  }
269
261
  var Y = e ? e.displayName || e.name : "", $ = Y ? K(Y) : "";
270
262
  return typeof e == "function" && G.set(e, $), $;
271
263
  }
272
- function ze(e, r, t) {
273
- return _e(e, !1);
264
+ function Ke(e, r, t) {
265
+ return be(e, !1);
274
266
  }
275
- function Xe(e) {
267
+ function Ge(e) {
276
268
  var r = e.prototype;
277
269
  return !!(r && r.isReactComponent);
278
270
  }
@@ -280,11 +272,11 @@ function Or() {
280
272
  if (e == null)
281
273
  return "";
282
274
  if (typeof e == "function")
283
- return _e(e, Xe(e));
275
+ return be(e, Ge(e));
284
276
  if (typeof e == "string")
285
277
  return K(e);
286
278
  switch (e) {
287
- case w:
279
+ case S:
288
280
  return K("Suspense");
289
281
  case a:
290
282
  return K("SuspenseList");
@@ -292,7 +284,7 @@ function Or() {
292
284
  if (typeof e == "object")
293
285
  switch (e.$$typeof) {
294
286
  case d:
295
- return ze(e.render);
287
+ return Ke(e.render);
296
288
  case l:
297
289
  return z(e.type, r, t);
298
290
  case _: {
@@ -305,15 +297,15 @@ function Or() {
305
297
  }
306
298
  return "";
307
299
  }
308
- var M = Object.prototype.hasOwnProperty, be = {}, Ce = A.ReactDebugCurrentFrame;
300
+ var M = Object.prototype.hasOwnProperty, Ce = {}, Te = A.ReactDebugCurrentFrame;
309
301
  function X(e) {
310
302
  if (e) {
311
303
  var r = e._owner, t = z(e.type, e._source, r ? r.type : null);
312
- Ce.setExtraStackFrame(t);
304
+ Te.setExtraStackFrame(t);
313
305
  } else
314
- Ce.setExtraStackFrame(null);
306
+ Te.setExtraStackFrame(null);
315
307
  }
316
- function He(e, r, t, n, u) {
308
+ function ze(e, r, t, n, u) {
317
309
  {
318
310
  var s = Function.call.bind(M);
319
311
  for (var i in e)
@@ -328,41 +320,41 @@ function Or() {
328
320
  } catch (v) {
329
321
  o = v;
330
322
  }
331
- o && !(o instanceof Error) && (X(u), y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof o), X(null)), o instanceof Error && !(o.message in be) && (be[o.message] = !0, X(u), y("Failed %s type: %s", t, o.message), X(null));
323
+ o && !(o instanceof Error) && (X(u), y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof o), X(null)), o instanceof Error && !(o.message in Ce) && (Ce[o.message] = !0, X(u), y("Failed %s type: %s", t, o.message), X(null));
332
324
  }
333
325
  }
334
326
  }
335
- var Ze = Array.isArray;
327
+ var Xe = Array.isArray;
336
328
  function se(e) {
337
- return Ze(e);
329
+ return Xe(e);
338
330
  }
339
- function Qe(e) {
331
+ function He(e) {
340
332
  {
341
333
  var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
342
334
  return t;
343
335
  }
344
336
  }
345
- function er(e) {
337
+ function Ze(e) {
346
338
  try {
347
- return Te(e), !1;
339
+ return Se(e), !1;
348
340
  } catch {
349
341
  return !0;
350
342
  }
351
343
  }
352
- function Te(e) {
344
+ function Se(e) {
353
345
  return "" + e;
354
346
  }
355
- function we(e) {
356
- if (er(e))
357
- return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Qe(e)), Te(e);
347
+ function Oe(e) {
348
+ if (Ze(e))
349
+ return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", He(e)), Se(e);
358
350
  }
359
- var Se = A.ReactCurrentOwner, rr = {
351
+ var Pe = A.ReactCurrentOwner, Qe = {
360
352
  key: !0,
361
353
  ref: !0,
362
354
  __self: !0,
363
355
  __source: !0
364
- }, Oe, Pe;
365
- function tr(e) {
356
+ }, Fe, we;
357
+ function er(e) {
366
358
  if (M.call(e, "ref")) {
367
359
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
368
360
  if (r && r.isReactWarning)
@@ -370,7 +362,7 @@ function Or() {
370
362
  }
371
363
  return e.ref !== void 0;
372
364
  }
373
- function nr(e) {
365
+ function rr(e) {
374
366
  if (M.call(e, "key")) {
375
367
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
376
368
  if (r && r.isReactWarning)
@@ -378,13 +370,13 @@ function Or() {
378
370
  }
379
371
  return e.key !== void 0;
380
372
  }
381
- function ar(e, r) {
382
- typeof e.ref == "string" && Se.current;
373
+ function tr(e, r) {
374
+ typeof e.ref == "string" && Pe.current;
383
375
  }
384
- function or(e, r) {
376
+ function nr(e, r) {
385
377
  {
386
378
  var t = function() {
387
- Oe || (Oe = !0, y("%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://reactjs.org/link/special-props)", r));
379
+ Fe || (Fe = !0, y("%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://reactjs.org/link/special-props)", r));
388
380
  };
389
381
  t.isReactWarning = !0, Object.defineProperty(e, "key", {
390
382
  get: t,
@@ -392,10 +384,10 @@ function Or() {
392
384
  });
393
385
  }
394
386
  }
395
- function ir(e, r) {
387
+ function ar(e, r) {
396
388
  {
397
389
  var t = function() {
398
- Pe || (Pe = !0, y("%s: `ref` 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://reactjs.org/link/special-props)", r));
390
+ we || (we = !0, y("%s: `ref` 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://reactjs.org/link/special-props)", r));
399
391
  };
400
392
  t.isReactWarning = !0, Object.defineProperty(e, "ref", {
401
393
  get: t,
@@ -403,7 +395,7 @@ function Or() {
403
395
  });
404
396
  }
405
397
  }
406
- var ur = function(e, r, t, n, u, s, i) {
398
+ var or = function(e, r, t, n, u, s, i) {
407
399
  var o = {
408
400
  // This tag allows us to uniquely identify this as a React Element
409
401
  $$typeof: f,
@@ -432,12 +424,12 @@ function Or() {
432
424
  value: u
433
425
  }), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
434
426
  };
435
- function sr(e, r, t, n, u) {
427
+ function ir(e, r, t, n, u) {
436
428
  {
437
429
  var s, i = {}, o = null, b = null;
438
- t !== void 0 && (we(t), o = "" + t), nr(r) && (we(r.key), o = "" + r.key), tr(r) && (b = r.ref, ar(r, u));
430
+ t !== void 0 && (Oe(t), o = "" + t), rr(r) && (Oe(r.key), o = "" + r.key), er(r) && (b = r.ref, tr(r, u));
439
431
  for (s in r)
440
- M.call(r, s) && !rr.hasOwnProperty(s) && (i[s] = r[s]);
432
+ M.call(r, s) && !Qe.hasOwnProperty(s) && (i[s] = r[s]);
441
433
  if (e && e.defaultProps) {
442
434
  var v = e.defaultProps;
443
435
  for (s in v)
@@ -445,25 +437,25 @@ function Or() {
445
437
  }
446
438
  if (o || b) {
447
439
  var p = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
448
- o && or(i, p), b && ir(i, p);
440
+ o && nr(i, p), b && ar(i, p);
449
441
  }
450
- return ur(e, o, b, u, n, Se.current, i);
442
+ return or(e, o, b, u, n, Pe.current, i);
451
443
  }
452
444
  }
453
- var ce = A.ReactCurrentOwner, Fe = A.ReactDebugCurrentFrame;
445
+ var ce = A.ReactCurrentOwner, xe = A.ReactDebugCurrentFrame;
454
446
  function W(e) {
455
447
  if (e) {
456
448
  var r = e._owner, t = z(e.type, e._source, r ? r.type : null);
457
- Fe.setExtraStackFrame(t);
449
+ xe.setExtraStackFrame(t);
458
450
  } else
459
- Fe.setExtraStackFrame(null);
451
+ xe.setExtraStackFrame(null);
460
452
  }
461
453
  var le;
462
454
  le = !1;
463
455
  function fe(e) {
464
456
  return typeof e == "object" && e !== null && e.$$typeof === f;
465
457
  }
466
- function xe() {
458
+ function je() {
467
459
  {
468
460
  if (ce.current) {
469
461
  var e = R(ce.current.type);
@@ -475,13 +467,13 @@ Check the render method of \`` + e + "`.";
475
467
  return "";
476
468
  }
477
469
  }
478
- function cr(e) {
470
+ function ur(e) {
479
471
  return "";
480
472
  }
481
- var je = {};
482
- function lr(e) {
473
+ var ke = {};
474
+ function sr(e) {
483
475
  {
484
- var r = xe();
476
+ var r = je();
485
477
  if (!r) {
486
478
  var t = typeof e == "string" ? e : e.displayName || e.name;
487
479
  t && (r = `
@@ -491,27 +483,27 @@ Check the top-level render call using <` + t + ">.");
491
483
  return r;
492
484
  }
493
485
  }
494
- function ke(e, r) {
486
+ function Ae(e, r) {
495
487
  {
496
488
  if (!e._store || e._store.validated || e.key != null)
497
489
  return;
498
490
  e._store.validated = !0;
499
- var t = lr(r);
500
- if (je[t])
491
+ var t = sr(r);
492
+ if (ke[t])
501
493
  return;
502
- je[t] = !0;
494
+ ke[t] = !0;
503
495
  var n = "";
504
496
  e && e._owner && e._owner !== ce.current && (n = " It was passed a child from " + R(e._owner.type) + "."), W(e), y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), W(null);
505
497
  }
506
498
  }
507
- function Ae(e, r) {
499
+ function De(e, r) {
508
500
  {
509
501
  if (typeof e != "object")
510
502
  return;
511
503
  if (se(e))
512
504
  for (var t = 0; t < e.length; t++) {
513
505
  var n = e[t];
514
- fe(n) && ke(n, r);
506
+ fe(n) && Ae(n, r);
515
507
  }
516
508
  else if (fe(e))
517
509
  e._store && (e._store.validated = !0);
@@ -519,11 +511,11 @@ Check the top-level render call using <` + t + ">.");
519
511
  var u = Q(e);
520
512
  if (typeof u == "function" && u !== e.entries)
521
513
  for (var s = u.call(e), i; !(i = s.next()).done; )
522
- fe(i.value) && ke(i.value, r);
514
+ fe(i.value) && Ae(i.value, r);
523
515
  }
524
516
  }
525
517
  }
526
- function fr(e) {
518
+ function cr(e) {
527
519
  {
528
520
  var r = e.type;
529
521
  if (r == null || typeof r == "string")
@@ -539,7 +531,7 @@ Check the top-level render call using <` + t + ">.");
539
531
  return;
540
532
  if (t) {
541
533
  var n = R(r);
542
- He(t, e.props, "prop", n, e);
534
+ ze(t, e.props, "prop", n, e);
543
535
  } else if (r.PropTypes !== void 0 && !le) {
544
536
  le = !0;
545
537
  var u = R(r);
@@ -548,7 +540,7 @@ Check the top-level render call using <` + t + ">.");
548
540
  typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
549
541
  }
550
542
  }
551
- function dr(e) {
543
+ function lr(e) {
552
544
  {
553
545
  for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
554
546
  var n = r[t];
@@ -560,119 +552,117 @@ Check the top-level render call using <` + t + ">.");
560
552
  e.ref !== null && (W(e), y("Invalid attribute `ref` supplied to `React.Fragment`."), W(null));
561
553
  }
562
554
  }
563
- var De = {};
564
- function Ve(e, r, t, n, u, s) {
555
+ var Ve = {};
556
+ function $e(e, r, t, n, u, s) {
565
557
  {
566
558
  var i = ne(e);
567
559
  if (!i) {
568
560
  var o = "";
569
561
  (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (o += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
570
- var b = cr();
571
- b ? o += b : o += xe();
562
+ var b = ur();
563
+ b ? o += b : o += je();
572
564
  var v;
573
565
  e === null ? v = "null" : se(e) ? v = "array" : e !== void 0 && e.$$typeof === f ? (v = "<" + (R(e.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : v = typeof e, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", v, o);
574
566
  }
575
- var p = sr(e, r, t, u, s);
567
+ var p = ir(e, r, t, u, s);
576
568
  if (p == null)
577
569
  return p;
578
570
  if (i) {
579
- var S = r.children;
580
- if (S !== void 0)
571
+ var O = r.children;
572
+ if (O !== void 0)
581
573
  if (n)
582
- if (se(S)) {
583
- for (var Y = 0; Y < S.length; Y++)
584
- Ae(S[Y], e);
585
- Object.freeze && Object.freeze(S);
574
+ if (se(O)) {
575
+ for (var Y = 0; Y < O.length; Y++)
576
+ De(O[Y], e);
577
+ Object.freeze && Object.freeze(O);
586
578
  } else
587
579
  y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
588
580
  else
589
- Ae(S, e);
581
+ De(O, e);
590
582
  }
591
583
  if (M.call(r, "key")) {
592
- var $ = R(e), C = Object.keys(r).filter(function(yr) {
593
- return yr !== "key";
584
+ var $ = R(e), C = Object.keys(r).filter(function(hr) {
585
+ return hr !== "key";
594
586
  }), de = C.length > 0 ? "{key: someKey, " + C.join(": ..., ") + ": ...}" : "{key: someKey}";
595
- if (!De[$ + de]) {
596
- var gr = C.length > 0 ? "{" + C.join(": ..., ") + ": ...}" : "{}";
587
+ if (!Ve[$ + de]) {
588
+ var mr = C.length > 0 ? "{" + C.join(": ..., ") + ": ...}" : "{}";
597
589
  y(`A props object containing a "key" prop is being spread into JSX:
598
590
  let props = %s;
599
591
  <%s {...props} />
600
592
  React keys must be passed directly to JSX without using spread:
601
593
  let props = %s;
602
- <%s key={someKey} {...props} />`, de, $, gr, $), De[$ + de] = !0;
594
+ <%s key={someKey} {...props} />`, de, $, mr, $), Ve[$ + de] = !0;
603
595
  }
604
596
  }
605
- return e === m ? dr(p) : fr(p), p;
597
+ return e === m ? lr(p) : cr(p), p;
606
598
  }
607
599
  }
608
- function vr(e, r, t) {
609
- return Ve(e, r, t, !0);
600
+ function fr(e, r, t) {
601
+ return $e(e, r, t, !0);
610
602
  }
611
- function pr(e, r, t) {
612
- return Ve(e, r, t, !1);
603
+ function dr(e, r, t) {
604
+ return $e(e, r, t, !1);
613
605
  }
614
- var mr = pr, hr = vr;
615
- J.Fragment = m, J.jsx = mr, J.jsxs = hr;
606
+ var vr = dr, pr = fr;
607
+ J.Fragment = m, J.jsx = vr, J.jsxs = pr;
616
608
  })()), J;
617
609
  }
618
610
  var Ye;
619
- function Pr() {
620
- return Ye || (Ye = 1, process.env.NODE_ENV === "production" ? H.exports = Sr() : H.exports = Or()), H.exports;
611
+ function Or() {
612
+ return Ye || (Ye = 1, process.env.NODE_ENV === "production" ? H.exports = Tr() : H.exports = Sr()), H.exports;
621
613
  }
622
- var Z = Pr();
623
- const Be = Rr({ theme: "default" }), Fr = ({ theme: c = "default", children: f }) => {
614
+ var Z = Or();
615
+ const Ue = gr({ theme: "default" }), Pr = ({ theme: c = "default", children: f }) => {
624
616
  const g = {
625
617
  theme: c,
626
618
  className: `form-engine-theme-${c}`
627
619
  };
628
- return /* @__PURE__ */ Z.jsx(Be.Provider, { value: g, children: f });
620
+ return /* @__PURE__ */ Z.jsx(Ue.Provider, { value: g, children: f });
629
621
  };
630
- Fr.displayName = "FormEngineProvider";
631
- Ue.setComponents(Me);
632
- typeof window < "u" && (window.Formio = Le);
633
- const xr = Er(function({
622
+ Pr.displayName = "FormEngineProvider";
623
+ const Fr = yr(function({
634
624
  src: f,
635
625
  form: g,
636
626
  submission: m,
637
- options: O = {},
638
- onSubmit: P,
627
+ options: P = {},
628
+ onSubmit: F,
639
629
  onChange: T,
640
630
  onError: E,
641
631
  onRender: d,
642
- onCustomEvent: w,
632
+ onCustomEvent: S,
643
633
  onSubmitDone: a,
644
634
  onFormLoad: l,
645
635
  onAttach: _,
646
636
  onBuild: k,
647
637
  onFocus: h,
648
- onBlur: F,
638
+ onBlur: w,
649
639
  onInitialized: Q,
650
640
  formioform: A,
651
641
  ...y
652
642
  }, ee) {
653
- const L = N(null), x = N(null), re = N(null), q = N(null), te = _r(Be);
654
- return br(ee, () => ({
643
+ const L = N(null), x = N(null), re = N(null), q = N(null), te = Rr(Ue);
644
+ return Er(ee, () => ({
655
645
  get formio() {
656
646
  return x.current;
657
647
  }
658
648
  })), ve(() => {
659
649
  const V = f || g;
660
650
  if (!V || !L.current) return;
661
- const ne = { ...O }, ae = A || Cr, I = new ae(L.current, V, ne);
651
+ const ne = { ...P }, ae = A || _r, I = new ae(L.current, V, ne);
662
652
  return re.current = I, q.current = I.ready.then((R) => (x.current = R, f ? R.src = V : R.form = V, R)), I.onAny(function(R, ...j) {
663
653
  if (R.startsWith("formio.")) {
664
654
  const D = "on" + R.charAt(7).toUpperCase() + R.slice(8), U = {
665
- onSubmit: P,
655
+ onSubmit: F,
666
656
  onChange: T,
667
657
  onError: E,
668
658
  onRender: d,
669
- onCustomEvent: w,
659
+ onCustomEvent: S,
670
660
  onSubmitDone: a,
671
661
  onFormLoad: l,
672
662
  onAttach: _,
673
663
  onBuild: k,
674
664
  onFocus: h,
675
- onBlur: F,
665
+ onBlur: w,
676
666
  onInitialized: Q,
677
667
  ...y
678
668
  };
@@ -687,64 +677,63 @@ const xr = Er(function({
687
677
  m && x.current && (x.current.submission = m);
688
678
  }, [m]), /* @__PURE__ */ Z.jsx("div", { ref: L, className: te?.className || "" });
689
679
  });
690
- xr.displayName = "FormRenderer";
691
- Ue.setComponents(Me);
692
- const jr = ({
680
+ Fr.displayName = "FormRenderer";
681
+ const wr = ({
693
682
  form: c,
694
683
  options: f = {},
695
684
  onChange: g,
696
685
  onSaveComponent: m,
697
- onUpdateComponent: O,
698
- onDeleteComponent: P,
686
+ onUpdateComponent: P,
687
+ onDeleteComponent: F,
699
688
  onCancelComponent: T,
700
689
  onEditComponent: E,
701
690
  Builder: d
702
691
  }) => {
703
- const w = N(null), a = N(null);
692
+ const S = N(null), a = N(null);
704
693
  return ve(() => {
705
- if (!w.current) return;
706
- const l = d || Tr, _ = { ...c }, k = { ...f };
694
+ if (!S.current) return;
695
+ const l = d || br, _ = { ...c }, k = { ...f };
707
696
  a.current && a.current.instance?.destroy(!0);
708
- const h = new l(w.current.firstChild, _, k);
697
+ const h = new l(S.current.firstChild, _, k);
709
698
  a.current = h, h.ready.then(() => {
710
- F(), m && h.instance.on("saveComponent", m), O && h.instance.on("updateComponent", O), P && h.instance.on("removeComponent", P), T && h.instance.on("cancelComponent", T), E && h.instance.on("editComponent", E), h.instance.on("addComponent", F), h.instance.on("saveComponent", F), h.instance.on("updateComponent", F), h.instance.on("removeComponent", F), h.instance.on("deleteComponent", F), h.instance.on("pdfUploaded", F);
699
+ w(), m && h.instance.on("saveComponent", m), P && h.instance.on("updateComponent", P), F && h.instance.on("removeComponent", F), T && h.instance.on("cancelComponent", T), E && h.instance.on("editComponent", E), h.instance.on("addComponent", w), h.instance.on("saveComponent", w), h.instance.on("updateComponent", w), h.instance.on("removeComponent", w), h.instance.on("deleteComponent", w), h.instance.on("pdfUploaded", w);
711
700
  });
712
- function F() {
701
+ function w() {
713
702
  typeof g == "function" && a.current?.instance && g(a.current.instance.form);
714
703
  }
715
704
  return () => {
716
705
  a.current?.instance && (a.current.instance.destroy(!0), a.current = null);
717
706
  };
718
- }, [c?.display]), /* @__PURE__ */ Z.jsx("div", { ref: w, children: /* @__PURE__ */ Z.jsx("div", {}) });
707
+ }, [c?.display]), /* @__PURE__ */ Z.jsx("div", { ref: S, children: /* @__PURE__ */ Z.jsx("div", {}) });
719
708
  };
720
- jr.displayName = "FormBuilder";
721
- function Nr({
709
+ wr.displayName = "FormBuilder";
710
+ function Ar({
722
711
  type: c,
723
712
  label: f,
724
713
  icon: g,
725
714
  group: m = "basic",
726
- weight: O = 10,
727
- defaultValue: P = "",
715
+ weight: P = 10,
716
+ defaultValue: F = "",
728
717
  settingsForm: T,
729
718
  render: E
730
719
  }) {
731
- const d = $e.default || $e;
732
- return class Je extends d {
720
+ const d = pe.components.field;
721
+ return class Me extends d {
733
722
  static get builderInfo() {
734
723
  return {
735
724
  title: f,
736
725
  icon: g || "cog",
737
726
  group: m,
738
727
  documentation: "",
739
- weight: O,
740
- schema: Je.schema()
728
+ weight: P,
729
+ schema: Me.schema()
741
730
  };
742
731
  }
743
732
  static schema() {
744
733
  return d.schema({
745
734
  type: c,
746
735
  label: f,
747
- defaultValue: P ?? ""
736
+ defaultValue: F ?? ""
748
737
  });
749
738
  }
750
739
  static editForm = T;
@@ -761,7 +750,7 @@ function Nr({
761
750
  attach(a) {
762
751
  super.attach(a), this.loadRefs(a, { [`react-${this.id}`]: "single" });
763
752
  const l = this.refs[`react-${this.id}`];
764
- return l && (this._root = wr(l), this._root.render(
753
+ return l && (this._root = Cr(l), this._root.render(
765
754
  E({
766
755
  component: this.component,
767
756
  value: this.dataValue,
@@ -788,10 +777,10 @@ function Nr({
788
777
  }
789
778
  };
790
779
  }
791
- function Lr(c, f) {
780
+ function Dr(c, f) {
792
781
  Le.registerComponent(c, f);
793
782
  }
794
- const Ur = (c) => {
783
+ const Vr = (c) => {
795
784
  if (c && c.components) {
796
785
  const f = c.components.filter(
797
786
  (g) => g.action !== "submit"
@@ -799,7 +788,7 @@ const Ur = (c) => {
799
788
  return { display: c.display, components: f };
800
789
  }
801
790
  return c;
802
- }, Mr = (c) => {
791
+ }, $r = (c) => {
803
792
  const f = c?.components;
804
793
  if (f) {
805
794
  const g = f.map((m) => ({
@@ -809,18 +798,18 @@ const Ur = (c) => {
809
798
  return { ...c, components: g };
810
799
  }
811
800
  return c;
812
- };
801
+ }, Ir = pe.components.field, Wr = pe.baseEditForm, Yr = Le;
813
802
  export {
814
- xr as Form,
815
- jr as FormBuilder,
816
- Be as FormEngineContext,
817
- Fr as FormEngineProvider,
818
- xr as FormRenderer,
819
- qr as Formio,
820
- Gr as ReactComponent,
821
- Xr as baseEditForm,
822
- Nr as createFormComponent,
823
- Lr as registerComponent,
824
- Mr as removeAutoFocusFormio,
825
- Ur as removeSubmitFormio
803
+ Fr as Form,
804
+ wr as FormBuilder,
805
+ Ue as FormEngineContext,
806
+ Pr as FormEngineProvider,
807
+ Fr as FormRenderer,
808
+ Yr as Formio,
809
+ Ir as ReactComponent,
810
+ Wr as baseEditForm,
811
+ Ar as createFormComponent,
812
+ Dr as registerComponent,
813
+ $r as removeAutoFocusFormio,
814
+ Vr as removeSubmitFormio
826
815
  };
@@ -1,14 +1,14 @@
1
- (function(c,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react"),require("formiojs"),require("formiojs/Form"),require("formiojs/components/Components"),require("formiojs/components"),require("formiojs/FormBuilder"),require("react-dom/client"),require("formiojs/components/_classes/field/Field"),require("formiojs/components/_classes/component/Component.form")):typeof define=="function"&&define.amd?define(["exports","react","formiojs","formiojs/Form","formiojs/components/Components","formiojs/components","formiojs/FormBuilder","react-dom/client","formiojs/components/_classes/field/Field","formiojs/components/_classes/component/Component.form"],h):(c=typeof globalThis<"u"?globalThis:c||self,h(c.FormEngine={},c.React,c.Formio,c.FormioForm,c.Components,c.components,c.FormioFormBuilder,c.ReactDOMClient,c.Field,c.Component_form))})(this,(function(c,h,ee,Xe,ge,Re,qe,He,re,Ze){"use strict";var z={exports:{}},L={};var Ee;function Qe(){if(Ee)return L;Ee=1;var f=h,d=Symbol.for("react.element"),R=Symbol.for("react.fragment"),y=Object.prototype.hasOwnProperty,P=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,w={key:!0,ref:!0,__self:!0,__source:!0};function j(b,m,S){var o,l={},C=null,D=null;S!==void 0&&(C=""+S),m.key!==void 0&&(C=""+m.key),m.ref!==void 0&&(D=m.ref);for(o in m)y.call(m,o)&&!w.hasOwnProperty(o)&&(l[o]=m[o]);if(b&&b.defaultProps)for(o in m=b.defaultProps,m)l[o]===void 0&&(l[o]=m[o]);return{$$typeof:d,type:b,key:C,ref:D,props:l,_owner:P.current}}return L.Fragment=R,L.jsx=j,L.jsxs=j,L}var U={};var _e;function $e(){return _e||(_e=1,process.env.NODE_ENV!=="production"&&(function(){var f=h,d=Symbol.for("react.element"),R=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),b=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),o=Symbol.for("react.suspense_list"),l=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),D=Symbol.for("react.offscreen"),g=Symbol.iterator,x="@@iterator";function oe(e){if(e===null||typeof e!="object")return null;var r=g&&e[g]||e[x];return typeof r=="function"?r:null}var V=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];ae("error",e,t)}}function ae(e,r,t){{var n=V.ReactDebugCurrentFrame,s=n.getStackAddendum();s!==""&&(r+="%s",t=t.concat([s]));var u=t.map(function(i){return String(i)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var J=!1,k=!1,ie=!1,q=!1,se=!1,W;W=Symbol.for("react.module.reference");function ue(e){return!!(typeof e=="string"||typeof e=="function"||e===y||e===w||se||e===P||e===S||e===o||q||e===D||J||k||ie||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===l||e.$$typeof===j||e.$$typeof===b||e.$$typeof===m||e.$$typeof===W||e.getModuleId!==void 0))}function ce(e,r,t){var n=e.displayName;if(n)return n;var s=r.displayName||r.name||"";return s!==""?t+"("+s+")":t}function N(e){return e.displayName||"Context"}function _(e){if(e==null)return null;if(typeof e.tag=="number"&&E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case y:return"Fragment";case R:return"Portal";case w:return"Profiler";case P:return"StrictMode";case S:return"Suspense";case o:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case b:var r=e;return N(r)+".Consumer";case j:var t=e;return N(t._context)+".Provider";case m:return ce(e,e.render,"ForwardRef");case l:var n=e.displayName||null;return n!==null?n:_(e.type)||"Memo";case C:{var s=e,u=s._payload,i=s._init;try{return _(i(u))}catch{return null}}}return null}var A=Object.assign,I=0,K,Te,je,Se,Oe,Pe,we;function xe(){}xe.__reactDisabledLog=!0;function ar(){{if(I===0){K=console.log,Te=console.info,je=console.warn,Se=console.error,Oe=console.group,Pe=console.groupCollapsed,we=console.groupEnd;var e={configurable:!0,enumerable:!0,value:xe,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}I++}}function ir(){{if(I--,I===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},e,{value:K}),info:A({},e,{value:Te}),warn:A({},e,{value:je}),error:A({},e,{value:Se}),group:A({},e,{value:Oe}),groupCollapsed:A({},e,{value:Pe}),groupEnd:A({},e,{value:we})})}I<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var fe=V.ReactCurrentDispatcher,le;function H(e,r,t){{if(le===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);le=n&&n[1]||""}return`
2
- `+le+e}}var de=!1,Z;{var sr=typeof WeakMap=="function"?WeakMap:Map;Z=new sr}function ke(e,r){if(!e||de)return"";{var t=Z.get(e);if(t!==void 0)return t}var n;de=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=fe.current,fe.current=null,ar();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(T){n=T}Reflect.construct(e,[],i)}else{try{i.call()}catch(T){n=T}e.call(i.prototype)}}else{try{throw Error()}catch(T){n=T}e()}}catch(T){if(T&&n&&typeof T.stack=="string"){for(var a=T.stack.split(`
1
+ (function(p,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react"),require("@formio/js"),require("react-dom/client")):typeof define=="function"&&define.amd?define(["exports","react","@formio/js","react-dom/client"],h):(p=typeof globalThis<"u"?globalThis:p||self,h(p.FormEngine={},p.React,p.Formio,p.ReactDOMClient))})(this,(function(p,h,W,Ke){"use strict";var X={exports:{}},B={};var ge;function Ge(){if(ge)return B;ge=1;var c=h,l=Symbol.for("react.element"),y=Symbol.for("react.fragment"),g=Object.prototype.hasOwnProperty,w=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,j={key:!0,ref:!0,__self:!0,__source:!0};function S(b,d,O){var a,f={},C=null,D=null;O!==void 0&&(C=""+O),d.key!==void 0&&(C=""+d.key),d.ref!==void 0&&(D=d.ref);for(a in d)g.call(d,a)&&!j.hasOwnProperty(a)&&(f[a]=d[a]);if(b&&b.defaultProps)for(a in d=b.defaultProps,d)f[a]===void 0&&(f[a]=d[a]);return{$$typeof:l,type:b,key:C,ref:D,props:f,_owner:w.current}}return B.Fragment=y,B.jsx=S,B.jsxs=S,B}var J={};var Re;function ze(){return Re||(Re=1,process.env.NODE_ENV!=="production"&&(function(){var c=h,l=Symbol.for("react.element"),y=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),b=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),a=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),D=Symbol.for("react.offscreen"),R=Symbol.iterator,x="@@iterator";function ne(e){if(e===null||typeof e!="object")return null;var r=R&&e[R]||e[x];return typeof r=="function"?r:null}var V=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];ae("error",e,t)}}function ae(e,r,t){{var n=V.ReactDebugCurrentFrame,u=n.getStackAddendum();u!==""&&(r+="%s",t=t.concat([u]));var s=t.map(function(i){return String(i)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var K=!1,k=!1,oe=!1,Z=!1,ie=!1,Y;Y=Symbol.for("react.module.reference");function ue(e){return!!(typeof e=="string"||typeof e=="function"||e===g||e===j||ie||e===w||e===O||e===a||Z||e===D||K||k||oe||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===f||e.$$typeof===S||e.$$typeof===b||e.$$typeof===d||e.$$typeof===Y||e.getModuleId!==void 0))}function se(e,r,t){var n=e.displayName;if(n)return n;var u=r.displayName||r.name||"";return u!==""?t+"("+u+")":t}function M(e){return e.displayName||"Context"}function _(e){if(e==null)return null;if(typeof e.tag=="number"&&E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case g:return"Fragment";case y:return"Portal";case j:return"Profiler";case w:return"StrictMode";case O:return"Suspense";case a:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case b:var r=e;return M(r)+".Consumer";case S:var t=e;return M(t._context)+".Provider";case d:return se(e,e.render,"ForwardRef");case f:var n=e.displayName||null;return n!==null?n:_(e.type)||"Memo";case C:{var u=e,s=u._payload,i=u._init;try{return _(i(s))}catch{return null}}}return null}var A=Object.assign,I=0,G,be,Ce,Fe,Te,Se,Oe;function Pe(){}Pe.__reactDisabledLog=!0;function tr(){{if(I===0){G=console.log,be=console.info,Ce=console.warn,Fe=console.error,Te=console.group,Se=console.groupCollapsed,Oe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Pe,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}I++}}function nr(){{if(I--,I===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},e,{value:G}),info:A({},e,{value:be}),warn:A({},e,{value:Ce}),error:A({},e,{value:Fe}),group:A({},e,{value:Te}),groupCollapsed:A({},e,{value:Se}),groupEnd:A({},e,{value:Oe})})}I<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ce=V.ReactCurrentDispatcher,fe;function Q(e,r,t){{if(fe===void 0)try{throw Error()}catch(u){var n=u.stack.trim().match(/\n( *(at )?)/);fe=n&&n[1]||""}return`
2
+ `+fe+e}}var le=!1,$;{var ar=typeof WeakMap=="function"?WeakMap:Map;$=new ar}function we(e,r){if(!e||le)return"";{var t=$.get(e);if(t!==void 0)return t}var n;le=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=ce.current,ce.current=null,tr();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(T){n=T}Reflect.construct(e,[],i)}else{try{i.call()}catch(T){n=T}e.call(i.prototype)}}else{try{throw Error()}catch(T){n=T}e()}}catch(T){if(T&&n&&typeof T.stack=="string"){for(var o=T.stack.split(`
3
3
  `),F=n.stack.split(`
4
- `),v=a.length-1,p=F.length-1;v>=1&&p>=0&&a[v]!==F[p];)p--;for(;v>=1&&p>=0;v--,p--)if(a[v]!==F[p]){if(v!==1||p!==1)do if(v--,p--,p<0||a[v]!==F[p]){var O=`
5
- `+a[v].replace(" at new "," at ");return e.displayName&&O.includes("<anonymous>")&&(O=O.replace("<anonymous>",e.displayName)),typeof e=="function"&&Z.set(e,O),O}while(v>=1&&p>=0);break}}}finally{de=!1,fe.current=u,ir(),Error.prepareStackTrace=s}var B=e?e.displayName||e.name:"",Y=B?H(B):"";return typeof e=="function"&&Z.set(e,Y),Y}function ur(e,r,t){return ke(e,!1)}function cr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function Q(e,r,t){if(e==null)return"";if(typeof e=="function")return ke(e,cr(e));if(typeof e=="string")return H(e);switch(e){case S:return H("Suspense");case o:return H("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case m:return ur(e.render);case l:return Q(e.type,r,t);case C:{var n=e,s=n._payload,u=n._init;try{return Q(u(s),r,t)}catch{}}}return""}var G=Object.prototype.hasOwnProperty,Ae={},De=V.ReactDebugCurrentFrame;function $(e){if(e){var r=e._owner,t=Q(e.type,e._source,r?r.type:null);De.setExtraStackFrame(t)}else De.setExtraStackFrame(null)}function fr(e,r,t,n,s){{var u=Function.call.bind(G);for(var i in e)if(u(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var F=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw F.name="Invariant Violation",F}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(v){a=v}a&&!(a instanceof Error)&&($(s),E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),$(null)),a instanceof Error&&!(a.message in Ae)&&(Ae[a.message]=!0,$(s),E("Failed %s type: %s",t,a.message),$(null))}}}var lr=Array.isArray;function me(e){return lr(e)}function dr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function mr(e){try{return Ve(e),!1}catch{return!0}}function Ve(e){return""+e}function Ie(e){if(mr(e))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",dr(e)),Ve(e)}var We=V.ReactCurrentOwner,vr={key:!0,ref:!0,__self:!0,__source:!0},Ye,Ne;function pr(e){if(G.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function hr(e){if(G.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function yr(e,r){typeof e.ref=="string"&&We.current}function gr(e,r){{var t=function(){Ye||(Ye=!0,E("%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://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function Rr(e,r){{var t=function(){Ne||(Ne=!0,E("%s: `ref` 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://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var Er=function(e,r,t,n,s,u,i){var a={$$typeof:d,type:e,key:r,ref:t,props:i,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function _r(e,r,t,n,s){{var u,i={},a=null,F=null;t!==void 0&&(Ie(t),a=""+t),hr(r)&&(Ie(r.key),a=""+r.key),pr(r)&&(F=r.ref,yr(r,s));for(u in r)G.call(r,u)&&!vr.hasOwnProperty(u)&&(i[u]=r[u]);if(e&&e.defaultProps){var v=e.defaultProps;for(u in v)i[u]===void 0&&(i[u]=v[u])}if(a||F){var p=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&gr(i,p),F&&Rr(i,p)}return Er(e,a,F,s,n,We.current,i)}}var ve=V.ReactCurrentOwner,Me=V.ReactDebugCurrentFrame;function M(e){if(e){var r=e._owner,t=Q(e.type,e._source,r?r.type:null);Me.setExtraStackFrame(t)}else Me.setExtraStackFrame(null)}var pe;pe=!1;function he(e){return typeof e=="object"&&e!==null&&e.$$typeof===d}function Be(){{if(ve.current){var e=_(ve.current.type);if(e)return`
4
+ `),v=o.length-1,m=F.length-1;v>=1&&m>=0&&o[v]!==F[m];)m--;for(;v>=1&&m>=0;v--,m--)if(o[v]!==F[m]){if(v!==1||m!==1)do if(v--,m--,m<0||o[v]!==F[m]){var P=`
5
+ `+o[v].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&$.set(e,P),P}while(v>=1&&m>=0);break}}}finally{le=!1,ce.current=s,nr(),Error.prepareStackTrace=u}var U=e?e.displayName||e.name:"",N=U?Q(U):"";return typeof e=="function"&&$.set(e,N),N}function or(e,r,t){return we(e,!1)}function ir(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function q(e,r,t){if(e==null)return"";if(typeof e=="function")return we(e,ir(e));if(typeof e=="string")return Q(e);switch(e){case O:return Q("Suspense");case a:return Q("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return or(e.render);case f:return q(e.type,r,t);case C:{var n=e,u=n._payload,s=n._init;try{return q(s(u),r,t)}catch{}}}return""}var z=Object.prototype.hasOwnProperty,je={},xe=V.ReactDebugCurrentFrame;function ee(e){if(e){var r=e._owner,t=q(e.type,e._source,r?r.type:null);xe.setExtraStackFrame(t)}else xe.setExtraStackFrame(null)}function ur(e,r,t,n,u){{var s=Function.call.bind(z);for(var i in e)if(s(e,i)){var o=void 0;try{if(typeof e[i]!="function"){var F=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw F.name="Invariant Violation",F}o=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(v){o=v}o&&!(o instanceof Error)&&(ee(u),E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof o),ee(null)),o instanceof Error&&!(o.message in je)&&(je[o.message]=!0,ee(u),E("Failed %s type: %s",t,o.message),ee(null))}}}var sr=Array.isArray;function de(e){return sr(e)}function cr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function fr(e){try{return ke(e),!1}catch{return!0}}function ke(e){return""+e}function Ae(e){if(fr(e))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",cr(e)),ke(e)}var De=V.ReactCurrentOwner,lr={key:!0,ref:!0,__self:!0,__source:!0},Ve,Ie;function dr(e){if(z.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function vr(e){if(z.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function pr(e,r){typeof e.ref=="string"&&De.current}function mr(e,r){{var t=function(){Ve||(Ve=!0,E("%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://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function hr(e,r){{var t=function(){Ie||(Ie=!0,E("%s: `ref` 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://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var gr=function(e,r,t,n,u,s,i){var o={$$typeof:l,type:e,key:r,ref:t,props:i,_owner:s};return o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o};function Rr(e,r,t,n,u){{var s,i={},o=null,F=null;t!==void 0&&(Ae(t),o=""+t),vr(r)&&(Ae(r.key),o=""+r.key),dr(r)&&(F=r.ref,pr(r,u));for(s in r)z.call(r,s)&&!lr.hasOwnProperty(s)&&(i[s]=r[s]);if(e&&e.defaultProps){var v=e.defaultProps;for(s in v)i[s]===void 0&&(i[s]=v[s])}if(o||F){var m=typeof e=="function"?e.displayName||e.name||"Unknown":e;o&&mr(i,m),F&&hr(i,m)}return gr(e,o,F,u,n,De.current,i)}}var ve=V.ReactCurrentOwner,We=V.ReactDebugCurrentFrame;function L(e){if(e){var r=e._owner,t=q(e.type,e._source,r?r.type:null);We.setExtraStackFrame(t)}else We.setExtraStackFrame(null)}var pe;pe=!1;function me(e){return typeof e=="object"&&e!==null&&e.$$typeof===l}function Ye(){{if(ve.current){var e=_(ve.current.type);if(e)return`
6
6
 
7
- Check the render method of \``+e+"`."}return""}}function br(e){return""}var Le={};function Cr(e){{var r=Be();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
7
+ Check the render method of \``+e+"`."}return""}}function yr(e){return""}var Ne={};function Er(e){{var r=Ye();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
8
8
 
9
- Check the top-level render call using <`+t+">.")}return r}}function Ue(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Cr(r);if(Le[t])return;Le[t]=!0;var n="";e&&e._owner&&e._owner!==ve.current&&(n=" It was passed a child from "+_(e._owner.type)+"."),M(e),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),M(null)}}function Je(e,r){{if(typeof e!="object")return;if(me(e))for(var t=0;t<e.length;t++){var n=e[t];he(n)&&Ue(n,r)}else if(he(e))e._store&&(e._store.validated=!0);else if(e){var s=oe(e);if(typeof s=="function"&&s!==e.entries)for(var u=s.call(e),i;!(i=u.next()).done;)he(i.value)&&Ue(i.value,r)}}}function Fr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===m||r.$$typeof===l))t=r.propTypes;else return;if(t){var n=_(r);fr(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!pe){pe=!0;var s=_(r);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",s||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Tr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){M(e),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),M(null);break}}e.ref!==null&&(M(e),E("Invalid attribute `ref` supplied to `React.Fragment`."),M(null))}}var Ke={};function Ge(e,r,t,n,s,u){{var i=ue(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var F=br();F?a+=F:a+=Be();var v;e===null?v="null":me(e)?v="array":e!==void 0&&e.$$typeof===d?(v="<"+(_(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):v=typeof e,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",v,a)}var p=_r(e,r,t,s,u);if(p==null)return p;if(i){var O=r.children;if(O!==void 0)if(n)if(me(O)){for(var B=0;B<O.length;B++)Je(O[B],e);Object.freeze&&Object.freeze(O)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Je(O,e)}if(G.call(r,"key")){var Y=_(e),T=Object.keys(r).filter(function(xr){return xr!=="key"}),ye=T.length>0?"{key: someKey, "+T.join(": ..., ")+": ...}":"{key: someKey}";if(!Ke[Y+ye]){var wr=T.length>0?"{"+T.join(": ..., ")+": ...}":"{}";E(`A props object containing a "key" prop is being spread into JSX:
9
+ Check the top-level render call using <`+t+">.")}return r}}function Me(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Er(r);if(Ne[t])return;Ne[t]=!0;var n="";e&&e._owner&&e._owner!==ve.current&&(n=" It was passed a child from "+_(e._owner.type)+"."),L(e),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),L(null)}}function Le(e,r){{if(typeof e!="object")return;if(de(e))for(var t=0;t<e.length;t++){var n=e[t];me(n)&&Me(n,r)}else if(me(e))e._store&&(e._store.validated=!0);else if(e){var u=ne(e);if(typeof u=="function"&&u!==e.entries)for(var s=u.call(e),i;!(i=s.next()).done;)me(i.value)&&Me(i.value,r)}}}function _r(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===d||r.$$typeof===f))t=r.propTypes;else return;if(t){var n=_(r);ur(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!pe){pe=!0;var u=_(r);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",u||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function br(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){L(e),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),L(null);break}}e.ref!==null&&(L(e),E("Invalid attribute `ref` supplied to `React.Fragment`."),L(null))}}var Ue={};function Be(e,r,t,n,u,s){{var i=ue(e);if(!i){var o="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(o+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var F=yr();F?o+=F:o+=Ye();var v;e===null?v="null":de(e)?v="array":e!==void 0&&e.$$typeof===l?(v="<"+(_(e.type)||"Unknown")+" />",o=" Did you accidentally export a JSX literal instead of a component?"):v=typeof e,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",v,o)}var m=Rr(e,r,t,u,s);if(m==null)return m;if(i){var P=r.children;if(P!==void 0)if(n)if(de(P)){for(var U=0;U<P.length;U++)Le(P[U],e);Object.freeze&&Object.freeze(P)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Le(P,e)}if(z.call(r,"key")){var N=_(e),T=Object.keys(r).filter(function(Pr){return Pr!=="key"}),he=T.length>0?"{key: someKey, "+T.join(": ..., ")+": ...}":"{key: someKey}";if(!Ue[N+he]){var Or=T.length>0?"{"+T.join(": ..., ")+": ...}":"{}";E(`A props object containing a "key" prop is being spread into JSX:
10
10
  let props = %s;
11
11
  <%s {...props} />
12
12
  React keys must be passed directly to JSX without using spread:
13
13
  let props = %s;
14
- <%s key={someKey} {...props} />`,ye,Y,wr,Y),Ke[Y+ye]=!0}}return e===y?Tr(p):Fr(p),p}}function jr(e,r,t){return Ge(e,r,t,!0)}function Sr(e,r,t){return Ge(e,r,t,!1)}var Or=Sr,Pr=jr;U.Fragment=y,U.jsx=Or,U.jsxs=Pr})()),U}var be;function er(){return be||(be=1,process.env.NODE_ENV==="production"?z.exports=Qe():z.exports=$e()),z.exports}var X=er();const te=h.createContext({theme:"default"}),Ce=({theme:f="default",children:d})=>{const R={theme:f,className:`form-engine-theme-${f}`};return X.jsx(te.Provider,{value:R,children:d})};Ce.displayName="FormEngineProvider",ge.setComponents(Re),typeof window<"u"&&(window.Formio=ee.Formio);const ne=h.forwardRef(function({src:d,form:R,submission:y,options:P={},onSubmit:w,onChange:j,onError:b,onRender:m,onCustomEvent:S,onSubmitDone:o,onFormLoad:l,onAttach:C,onBuild:D,onFocus:g,onBlur:x,onInitialized:oe,formioform:V,...E},ae){const J=h.useRef(null),k=h.useRef(null),ie=h.useRef(null),q=h.useRef(null),se=h.useContext(te);return h.useImperativeHandle(ae,()=>({get formio(){return k.current}})),h.useEffect(()=>{const W=d||R;if(!W||!J.current)return;const ue={...P},ce=V||Xe,N=new ce(J.current,W,ue);return ie.current=N,q.current=N.ready.then(_=>(k.current=_,d?_.src=W:_.form=W,_)),N.onAny(function(_,...A){if(_.startsWith("formio.")){const I="on"+_.charAt(7).toUpperCase()+_.slice(8),K={onSubmit:w,onChange:j,onError:b,onRender:m,onCustomEvent:S,onSubmitDone:o,onFormLoad:l,onAttach:C,onBuild:D,onFocus:g,onBlur:x,onInitialized:oe,...E};typeof K[I]=="function"&&K[I](...A)}}),q.current.then(()=>{y&&k.current&&(k.current.submission=y)}),()=>{k.current&&(k.current.destroy(!0),k.current=null)}},[d,R]),h.useEffect(()=>{y&&k.current&&(k.current.submission=y)},[y]),X.jsx("div",{ref:J,className:se?.className||""})});ne.displayName="FormRenderer",ge.setComponents(Re);const Fe=({form:f,options:d={},onChange:R,onSaveComponent:y,onUpdateComponent:P,onDeleteComponent:w,onCancelComponent:j,onEditComponent:b,Builder:m})=>{const S=h.useRef(null),o=h.useRef(null);return h.useEffect(()=>{if(!S.current)return;const l=m||qe,C={...f},D={...d};o.current&&o.current.instance?.destroy(!0);const g=new l(S.current.firstChild,C,D);o.current=g,g.ready.then(()=>{x(),y&&g.instance.on("saveComponent",y),P&&g.instance.on("updateComponent",P),w&&g.instance.on("removeComponent",w),j&&g.instance.on("cancelComponent",j),b&&g.instance.on("editComponent",b),g.instance.on("addComponent",x),g.instance.on("saveComponent",x),g.instance.on("updateComponent",x),g.instance.on("removeComponent",x),g.instance.on("deleteComponent",x),g.instance.on("pdfUploaded",x)});function x(){typeof R=="function"&&o.current?.instance&&R(o.current.instance.form)}return()=>{o.current?.instance&&(o.current.instance.destroy(!0),o.current=null)}},[f?.display]),X.jsx("div",{ref:S,children:X.jsx("div",{})})};Fe.displayName="FormBuilder";function rr({type:f,label:d,icon:R,group:y="basic",weight:P=10,defaultValue:w="",settingsForm:j,render:b}){const m=re.default||re;return class ze extends m{static get builderInfo(){return{title:d,icon:R||"cog",group:y,documentation:"",weight:P,schema:ze.schema()}}static schema(){return m.schema({type:f,label:d,defaultValue:w??""})}static editForm=j;constructor(o,l,C){super(o,l,C),this._root=null}updateValue=o=>{const l=o??this.getValue(),C=l!==void 0?this.hasChanged(l,this.dataValue):!1;return this.dataValue=Array.isArray(l)?[...l]:l,this.updateOnChange({},C),!0};render(){return super.render(`<div ref="react-${this.id}"></div>`)}attach(o){super.attach(o),this.loadRefs(o,{[`react-${this.id}`]:"single"});const l=this.refs[`react-${this.id}`];return l&&(this._root=He.createRoot(l),this._root.render(b({component:this.component,value:this.dataValue,onChange:this.updateValue,data:this.data})),this.shouldSetValue&&(this.setValue(this.dataForSetting),this.updateValue(this.dataForSetting))),Promise.resolve()}detach(){this.refs[`react-${this.id}`]&&this._root&&(this._root.unmount(),this._root=null),super.detach()}setValue(o){this._root?(this._root.render(b({component:this.component,value:o,onChange:this.updateValue,data:this.data})),this.shouldSetValue=!1):(this.shouldSetValue=!0,this.dataForSetting=o)}getValue(){return this.dataValue}}}function tr(f,d){ee.Formio.registerComponent(f,d)}const nr=f=>{if(f&&f.components){const d=f.components.filter(R=>R.action!=="submit");return{display:f.display,components:d}}return f},or=f=>{const d=f?.components;if(d){const R=d.map(y=>({...y,autofocus:!1}));return{...f,components:R}}return f};Object.defineProperty(c,"Formio",{enumerable:!0,get:()=>ee.Formio}),c.ReactComponent=re,c.baseEditForm=Ze,c.Form=ne,c.FormBuilder=Fe,c.FormEngineContext=te,c.FormEngineProvider=Ce,c.FormRenderer=ne,c.createFormComponent=rr,c.registerComponent=tr,c.removeAutoFocusFormio=or,c.removeSubmitFormio=nr,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})}));
14
+ <%s key={someKey} {...props} />`,he,N,Or,N),Ue[N+he]=!0}}return e===g?br(m):_r(m),m}}function Cr(e,r,t){return Be(e,r,t,!0)}function Fr(e,r,t){return Be(e,r,t,!1)}var Tr=Fr,Sr=Cr;J.Fragment=g,J.jsx=Tr,J.jsxs=Sr})()),J}var ye;function Xe(){return ye||(ye=1,process.env.NODE_ENV==="production"?X.exports=Ge():X.exports=ze()),X.exports}var H=Xe();const re=h.createContext({theme:"default"}),Ee=({theme:c="default",children:l})=>{const y={theme:c,className:`form-engine-theme-${c}`};return H.jsx(re.Provider,{value:y,children:l})};Ee.displayName="FormEngineProvider";const te=h.forwardRef(function({src:l,form:y,submission:g,options:w={},onSubmit:j,onChange:S,onError:b,onRender:d,onCustomEvent:O,onSubmitDone:a,onFormLoad:f,onAttach:C,onBuild:D,onFocus:R,onBlur:x,onInitialized:ne,formioform:V,...E},ae){const K=h.useRef(null),k=h.useRef(null),oe=h.useRef(null),Z=h.useRef(null),ie=h.useContext(re);return h.useImperativeHandle(ae,()=>({get formio(){return k.current}})),h.useEffect(()=>{const Y=l||y;if(!Y||!K.current)return;const ue={...w},se=V||W.Form,M=new se(K.current,Y,ue);return oe.current=M,Z.current=M.ready.then(_=>(k.current=_,l?_.src=Y:_.form=Y,_)),M.onAny(function(_,...A){if(_.startsWith("formio.")){const I="on"+_.charAt(7).toUpperCase()+_.slice(8),G={onSubmit:j,onChange:S,onError:b,onRender:d,onCustomEvent:O,onSubmitDone:a,onFormLoad:f,onAttach:C,onBuild:D,onFocus:R,onBlur:x,onInitialized:ne,...E};typeof G[I]=="function"&&G[I](...A)}}),Z.current.then(()=>{g&&k.current&&(k.current.submission=g)}),()=>{k.current&&(k.current.destroy(!0),k.current=null)}},[l,y]),h.useEffect(()=>{g&&k.current&&(k.current.submission=g)},[g]),H.jsx("div",{ref:K,className:ie?.className||""})});te.displayName="FormRenderer";const _e=({form:c,options:l={},onChange:y,onSaveComponent:g,onUpdateComponent:w,onDeleteComponent:j,onCancelComponent:S,onEditComponent:b,Builder:d})=>{const O=h.useRef(null),a=h.useRef(null);return h.useEffect(()=>{if(!O.current)return;const f=d||W.FormBuilder,C={...c},D={...l};a.current&&a.current.instance?.destroy(!0);const R=new f(O.current.firstChild,C,D);a.current=R,R.ready.then(()=>{x(),g&&R.instance.on("saveComponent",g),w&&R.instance.on("updateComponent",w),j&&R.instance.on("removeComponent",j),S&&R.instance.on("cancelComponent",S),b&&R.instance.on("editComponent",b),R.instance.on("addComponent",x),R.instance.on("saveComponent",x),R.instance.on("updateComponent",x),R.instance.on("removeComponent",x),R.instance.on("deleteComponent",x),R.instance.on("pdfUploaded",x)});function x(){typeof y=="function"&&a.current?.instance&&y(a.current.instance.form)}return()=>{a.current?.instance&&(a.current.instance.destroy(!0),a.current=null)}},[c?.display]),H.jsx("div",{ref:O,children:H.jsx("div",{})})};_e.displayName="FormBuilder";function He({type:c,label:l,icon:y,group:g="basic",weight:w=10,defaultValue:j="",settingsForm:S,render:b}){const d=W.Components.components.field;return class Je extends d{static get builderInfo(){return{title:l,icon:y||"cog",group:g,documentation:"",weight:w,schema:Je.schema()}}static schema(){return d.schema({type:c,label:l,defaultValue:j??""})}static editForm=S;constructor(a,f,C){super(a,f,C),this._root=null}updateValue=a=>{const f=a??this.getValue(),C=f!==void 0?this.hasChanged(f,this.dataValue):!1;return this.dataValue=Array.isArray(f)?[...f]:f,this.updateOnChange({},C),!0};render(){return super.render(`<div ref="react-${this.id}"></div>`)}attach(a){super.attach(a),this.loadRefs(a,{[`react-${this.id}`]:"single"});const f=this.refs[`react-${this.id}`];return f&&(this._root=Ke.createRoot(f),this._root.render(b({component:this.component,value:this.dataValue,onChange:this.updateValue,data:this.data})),this.shouldSetValue&&(this.setValue(this.dataForSetting),this.updateValue(this.dataForSetting))),Promise.resolve()}detach(){this.refs[`react-${this.id}`]&&this._root&&(this._root.unmount(),this._root=null),super.detach()}setValue(a){this._root?(this._root.render(b({component:this.component,value:a,onChange:this.updateValue,data:this.data})),this.shouldSetValue=!1):(this.shouldSetValue=!0,this.dataForSetting=a)}getValue(){return this.dataValue}}}function Ze(c,l){W.Formio.registerComponent(c,l)}const Qe=c=>{if(c&&c.components){const l=c.components.filter(y=>y.action!=="submit");return{display:c.display,components:l}}return c},$e=c=>{const l=c?.components;if(l){const y=l.map(g=>({...g,autofocus:!1}));return{...c,components:y}}return c},qe=W.Components.components.field,er=W.Components.baseEditForm,rr=W.Formio;p.Form=te,p.FormBuilder=_e,p.FormEngineContext=re,p.FormEngineProvider=Ee,p.FormRenderer=te,p.Formio=rr,p.ReactComponent=qe,p.baseEditForm=er,p.createFormComponent=He,p.registerComponent=Ze,p.removeAutoFocusFormio=$e,p.removeSubmitFormio=Qe,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-formio-engine",
3
- "version": "1.0.7",
3
+ "version": "1.1.0",
4
4
  "description": "Form engine with builder and renderer - formiojs-powered with React functional components",
5
5
  "type": "module",
6
6
  "main": "dist/form-engine.umd.js",
@@ -54,6 +54,6 @@
54
54
  },
55
55
  "license": "MIT",
56
56
  "dependencies": {
57
- "formiojs": "^4.21.7"
57
+ "@formio/js": "^5.3.0"
58
58
  }
59
59
  }
@@ -8,4 +8,11 @@
8
8
  * Usage:
9
9
  * import '@workato/form-engine/themes/default.css';
10
10
  */
11
- @import 'formiojs/dist/formio.full.css';
11
+ @import '@formio/js/dist/formio.full.css';
12
+
13
+ /* Make builder sidebar component buttons uniform width */
14
+ .formcomponents .btn.formcomponent {
15
+ display: block;
16
+ width: 100%;
17
+ text-align: left;
18
+ }