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