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.
- package/dist/form-engine.es.js +168 -179
- package/dist/form-engine.umd.js +7 -7
- package/package.json +2 -2
- package/src/themes/default.css +8 -1
package/dist/form-engine.es.js
CHANGED
|
@@ -1,38 +1,30 @@
|
|
|
1
|
-
import Ne, { createContext as
|
|
2
|
-
import { Formio as Le } from "
|
|
3
|
-
import {
|
|
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
|
|
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,
|
|
18
|
-
function T(E, d,
|
|
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
|
-
|
|
21
|
-
for (a in d) m.call(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:
|
|
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
|
|
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"),
|
|
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[
|
|
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 ===
|
|
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
|
|
79
|
+
case F:
|
|
88
80
|
return "Profiler";
|
|
89
|
-
case
|
|
81
|
+
case P:
|
|
90
82
|
return "StrictMode";
|
|
91
|
-
case
|
|
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,
|
|
121
|
-
function
|
|
112
|
+
var j = Object.assign, D = 0, U, me, he, ge, ye, Re, Ee;
|
|
113
|
+
function _e() {
|
|
122
114
|
}
|
|
123
|
-
|
|
124
|
-
function
|
|
115
|
+
_e.__reactDisabledLog = !0;
|
|
116
|
+
function Be() {
|
|
125
117
|
{
|
|
126
118
|
if (D === 0) {
|
|
127
|
-
U = console.log,
|
|
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:
|
|
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
|
|
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:
|
|
152
|
+
value: me
|
|
161
153
|
}),
|
|
162
154
|
warn: j({}, e, {
|
|
163
|
-
value:
|
|
155
|
+
value: he
|
|
164
156
|
}),
|
|
165
157
|
error: j({}, e, {
|
|
166
|
-
value:
|
|
158
|
+
value: ge
|
|
167
159
|
}),
|
|
168
160
|
group: j({}, e, {
|
|
169
|
-
value:
|
|
161
|
+
value: ye
|
|
170
162
|
}),
|
|
171
163
|
groupCollapsed: j({}, e, {
|
|
172
|
-
value:
|
|
164
|
+
value: Re
|
|
173
165
|
}),
|
|
174
166
|
groupEnd: j({}, e, {
|
|
175
|
-
value:
|
|
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
|
|
199
|
-
G = new
|
|
190
|
+
var qe = typeof WeakMap == "function" ? WeakMap : Map;
|
|
191
|
+
G = new qe();
|
|
200
192
|
}
|
|
201
|
-
function
|
|
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,
|
|
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
|
|
250
|
+
var O = `
|
|
259
251
|
` + o[v].replace(" at new ", " at ");
|
|
260
|
-
return e.displayName &&
|
|
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,
|
|
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
|
|
273
|
-
return
|
|
264
|
+
function Ke(e, r, t) {
|
|
265
|
+
return be(e, !1);
|
|
274
266
|
}
|
|
275
|
-
function
|
|
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
|
|
275
|
+
return be(e, Ge(e));
|
|
284
276
|
if (typeof e == "string")
|
|
285
277
|
return K(e);
|
|
286
278
|
switch (e) {
|
|
287
|
-
case
|
|
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
|
|
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,
|
|
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
|
-
|
|
304
|
+
Te.setExtraStackFrame(t);
|
|
313
305
|
} else
|
|
314
|
-
|
|
306
|
+
Te.setExtraStackFrame(null);
|
|
315
307
|
}
|
|
316
|
-
function
|
|
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
|
|
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
|
|
327
|
+
var Xe = Array.isArray;
|
|
336
328
|
function se(e) {
|
|
337
|
-
return
|
|
329
|
+
return Xe(e);
|
|
338
330
|
}
|
|
339
|
-
function
|
|
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
|
|
337
|
+
function Ze(e) {
|
|
346
338
|
try {
|
|
347
|
-
return
|
|
339
|
+
return Se(e), !1;
|
|
348
340
|
} catch {
|
|
349
341
|
return !0;
|
|
350
342
|
}
|
|
351
343
|
}
|
|
352
|
-
function
|
|
344
|
+
function Se(e) {
|
|
353
345
|
return "" + e;
|
|
354
346
|
}
|
|
355
|
-
function
|
|
356
|
-
if (
|
|
357
|
-
return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
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
|
|
351
|
+
var Pe = A.ReactCurrentOwner, Qe = {
|
|
360
352
|
key: !0,
|
|
361
353
|
ref: !0,
|
|
362
354
|
__self: !0,
|
|
363
355
|
__source: !0
|
|
364
|
-
},
|
|
365
|
-
function
|
|
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
|
|
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
|
|
382
|
-
typeof e.ref == "string" &&
|
|
373
|
+
function tr(e, r) {
|
|
374
|
+
typeof e.ref == "string" && Pe.current;
|
|
383
375
|
}
|
|
384
|
-
function
|
|
376
|
+
function nr(e, r) {
|
|
385
377
|
{
|
|
386
378
|
var t = function() {
|
|
387
|
-
|
|
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
|
|
387
|
+
function ar(e, r) {
|
|
396
388
|
{
|
|
397
389
|
var t = function() {
|
|
398
|
-
|
|
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
|
|
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
|
|
427
|
+
function ir(e, r, t, n, u) {
|
|
436
428
|
{
|
|
437
429
|
var s, i = {}, o = null, b = null;
|
|
438
|
-
t !== void 0 && (
|
|
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) && !
|
|
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 &&
|
|
440
|
+
o && nr(i, p), b && ar(i, p);
|
|
449
441
|
}
|
|
450
|
-
return
|
|
442
|
+
return or(e, o, b, u, n, Pe.current, i);
|
|
451
443
|
}
|
|
452
444
|
}
|
|
453
|
-
var ce = A.ReactCurrentOwner,
|
|
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
|
-
|
|
449
|
+
xe.setExtraStackFrame(t);
|
|
458
450
|
} else
|
|
459
|
-
|
|
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
|
|
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
|
|
470
|
+
function ur(e) {
|
|
479
471
|
return "";
|
|
480
472
|
}
|
|
481
|
-
var
|
|
482
|
-
function
|
|
473
|
+
var ke = {};
|
|
474
|
+
function sr(e) {
|
|
483
475
|
{
|
|
484
|
-
var r =
|
|
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
|
|
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 =
|
|
500
|
-
if (
|
|
491
|
+
var t = sr(r);
|
|
492
|
+
if (ke[t])
|
|
501
493
|
return;
|
|
502
|
-
|
|
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
|
|
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) &&
|
|
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) &&
|
|
514
|
+
fe(i.value) && Ae(i.value, r);
|
|
523
515
|
}
|
|
524
516
|
}
|
|
525
517
|
}
|
|
526
|
-
function
|
|
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
|
-
|
|
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
|
|
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
|
|
564
|
-
function
|
|
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 =
|
|
571
|
-
b ? o += b : o +=
|
|
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 =
|
|
567
|
+
var p = ir(e, r, t, u, s);
|
|
576
568
|
if (p == null)
|
|
577
569
|
return p;
|
|
578
570
|
if (i) {
|
|
579
|
-
var
|
|
580
|
-
if (
|
|
571
|
+
var O = r.children;
|
|
572
|
+
if (O !== void 0)
|
|
581
573
|
if (n)
|
|
582
|
-
if (se(
|
|
583
|
-
for (var Y = 0; Y <
|
|
584
|
-
|
|
585
|
-
Object.freeze && Object.freeze(
|
|
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
|
-
|
|
581
|
+
De(O, e);
|
|
590
582
|
}
|
|
591
583
|
if (M.call(r, "key")) {
|
|
592
|
-
var $ = R(e), C = Object.keys(r).filter(function(
|
|
593
|
-
return
|
|
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 (!
|
|
596
|
-
var
|
|
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, $,
|
|
594
|
+
<%s key={someKey} {...props} />`, de, $, mr, $), Ve[$ + de] = !0;
|
|
603
595
|
}
|
|
604
596
|
}
|
|
605
|
-
return e === m ?
|
|
597
|
+
return e === m ? lr(p) : cr(p), p;
|
|
606
598
|
}
|
|
607
599
|
}
|
|
608
|
-
function
|
|
609
|
-
return
|
|
600
|
+
function fr(e, r, t) {
|
|
601
|
+
return $e(e, r, t, !0);
|
|
610
602
|
}
|
|
611
|
-
function
|
|
612
|
-
return
|
|
603
|
+
function dr(e, r, t) {
|
|
604
|
+
return $e(e, r, t, !1);
|
|
613
605
|
}
|
|
614
|
-
var
|
|
615
|
-
J.Fragment = m, J.jsx =
|
|
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
|
|
620
|
-
return Ye || (Ye = 1, process.env.NODE_ENV === "production" ? 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 =
|
|
623
|
-
const
|
|
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(
|
|
620
|
+
return /* @__PURE__ */ Z.jsx(Ue.Provider, { value: g, children: f });
|
|
629
621
|
};
|
|
630
|
-
|
|
631
|
-
|
|
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:
|
|
638
|
-
onSubmit:
|
|
627
|
+
options: P = {},
|
|
628
|
+
onSubmit: F,
|
|
639
629
|
onChange: T,
|
|
640
630
|
onError: E,
|
|
641
631
|
onRender: d,
|
|
642
|
-
onCustomEvent:
|
|
632
|
+
onCustomEvent: S,
|
|
643
633
|
onSubmitDone: a,
|
|
644
634
|
onFormLoad: l,
|
|
645
635
|
onAttach: _,
|
|
646
636
|
onBuild: k,
|
|
647
637
|
onFocus: h,
|
|
648
|
-
onBlur:
|
|
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 =
|
|
654
|
-
return
|
|
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 = { ...
|
|
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:
|
|
655
|
+
onSubmit: F,
|
|
666
656
|
onChange: T,
|
|
667
657
|
onError: E,
|
|
668
658
|
onRender: d,
|
|
669
|
-
onCustomEvent:
|
|
659
|
+
onCustomEvent: S,
|
|
670
660
|
onSubmitDone: a,
|
|
671
661
|
onFormLoad: l,
|
|
672
662
|
onAttach: _,
|
|
673
663
|
onBuild: k,
|
|
674
664
|
onFocus: h,
|
|
675
|
-
onBlur:
|
|
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
|
-
|
|
691
|
-
|
|
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:
|
|
698
|
-
onDeleteComponent:
|
|
686
|
+
onUpdateComponent: P,
|
|
687
|
+
onDeleteComponent: F,
|
|
699
688
|
onCancelComponent: T,
|
|
700
689
|
onEditComponent: E,
|
|
701
690
|
Builder: d
|
|
702
691
|
}) => {
|
|
703
|
-
const
|
|
692
|
+
const S = N(null), a = N(null);
|
|
704
693
|
return ve(() => {
|
|
705
|
-
if (!
|
|
706
|
-
const l = d ||
|
|
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(
|
|
697
|
+
const h = new l(S.current.firstChild, _, k);
|
|
709
698
|
a.current = h, h.ready.then(() => {
|
|
710
|
-
|
|
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
|
|
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:
|
|
707
|
+
}, [c?.display]), /* @__PURE__ */ Z.jsx("div", { ref: S, children: /* @__PURE__ */ Z.jsx("div", {}) });
|
|
719
708
|
};
|
|
720
|
-
|
|
721
|
-
function
|
|
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:
|
|
727
|
-
defaultValue:
|
|
715
|
+
weight: P = 10,
|
|
716
|
+
defaultValue: F = "",
|
|
728
717
|
settingsForm: T,
|
|
729
718
|
render: E
|
|
730
719
|
}) {
|
|
731
|
-
const d =
|
|
732
|
-
return class
|
|
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:
|
|
740
|
-
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:
|
|
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 =
|
|
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
|
|
780
|
+
function Dr(c, f) {
|
|
792
781
|
Le.registerComponent(c, f);
|
|
793
782
|
}
|
|
794
|
-
const
|
|
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
|
-
},
|
|
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
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
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
|
};
|
package/dist/form-engine.umd.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
`+
|
|
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=
|
|
5
|
-
`+
|
|
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
|
|
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
|
|
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} />`,
|
|
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
|
|
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
|
-
"
|
|
57
|
+
"@formio/js": "^5.3.0"
|
|
58
58
|
}
|
|
59
59
|
}
|
package/src/themes/default.css
CHANGED
|
@@ -8,4 +8,11 @@
|
|
|
8
8
|
* Usage:
|
|
9
9
|
* import '@workato/form-engine/themes/default.css';
|
|
10
10
|
*/
|
|
11
|
-
@import '
|
|
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
|
+
}
|