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