@mieweb/forms-renderer 0.1.4 → 0.1.7
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/README.md +148 -295
- package/dist/react.js +748 -0
- package/dist/react.js.map +1 -0
- package/dist/standalone.js +23137 -0
- package/dist/standalone.js.map +1 -0
- package/dist/standalone.umd.cjs +272 -0
- package/dist/standalone.umd.cjs.map +1 -0
- package/dist/web-component.css +1 -0
- package/package.json +22 -9
- package/dist/index.js +0 -734
- package/dist/index.js.map +0 -1
package/dist/index.js
DELETED
|
@@ -1,734 +0,0 @@
|
|
|
1
|
-
import A from "react";
|
|
2
|
-
import { useUIApi as ne, useFormStore as Ce, useFieldsArray as De, isVisible as Ie, getFieldComponent as gr } from "@mieweb/forms-engine";
|
|
3
|
-
var K = { exports: {} }, N = {};
|
|
4
|
-
/**
|
|
5
|
-
* @license React
|
|
6
|
-
* react-jsx-runtime.production.min.js
|
|
7
|
-
*
|
|
8
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the MIT license found in the
|
|
11
|
-
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/
|
|
13
|
-
var je;
|
|
14
|
-
function hr() {
|
|
15
|
-
if (je) return N;
|
|
16
|
-
je = 1;
|
|
17
|
-
var o = A, l = Symbol.for("react.element"), g = Symbol.for("react.fragment"), p = Object.prototype.hasOwnProperty, d = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, h = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
-
function O(S, y, P) {
|
|
19
|
-
var m, x = {}, C = null, _ = null;
|
|
20
|
-
P !== void 0 && (C = "" + P), y.key !== void 0 && (C = "" + y.key), y.ref !== void 0 && (_ = y.ref);
|
|
21
|
-
for (m in y) p.call(y, m) && !h.hasOwnProperty(m) && (x[m] = y[m]);
|
|
22
|
-
if (S && S.defaultProps) for (m in y = S.defaultProps, y) x[m] === void 0 && (x[m] = y[m]);
|
|
23
|
-
return { $$typeof: l, type: S, key: C, ref: _, props: x, _owner: d.current };
|
|
24
|
-
}
|
|
25
|
-
return N.Fragment = g, N.jsx = O, N.jsxs = O, N;
|
|
26
|
-
}
|
|
27
|
-
var L = {};
|
|
28
|
-
/**
|
|
29
|
-
* @license React
|
|
30
|
-
* react-jsx-runtime.development.js
|
|
31
|
-
*
|
|
32
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the MIT license found in the
|
|
35
|
-
* LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/
|
|
37
|
-
var ke;
|
|
38
|
-
function mr() {
|
|
39
|
-
return ke || (ke = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
40
|
-
var o = A, l = Symbol.for("react.element"), g = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), d = Symbol.for("react.strict_mode"), h = Symbol.for("react.profiler"), O = Symbol.for("react.provider"), S = Symbol.for("react.context"), y = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), x = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), v = Symbol.iterator, b = "@@iterator";
|
|
41
|
-
function I(e) {
|
|
42
|
-
if (e === null || typeof e != "object")
|
|
43
|
-
return null;
|
|
44
|
-
var r = v && e[v] || e[b];
|
|
45
|
-
return typeof r == "function" ? r : null;
|
|
46
|
-
}
|
|
47
|
-
var $ = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
48
|
-
function E(e) {
|
|
49
|
-
{
|
|
50
|
-
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
51
|
-
t[n - 1] = arguments[n];
|
|
52
|
-
$e("error", e, t);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function $e(e, r, t) {
|
|
56
|
-
{
|
|
57
|
-
var n = $.ReactDebugCurrentFrame, s = n.getStackAddendum();
|
|
58
|
-
s !== "" && (r += "%s", t = t.concat([s]));
|
|
59
|
-
var u = t.map(function(i) {
|
|
60
|
-
return String(i);
|
|
61
|
-
});
|
|
62
|
-
u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
var We = !1, Ye = !1, Ve = !1, Me = !1, Ne = !1, ae;
|
|
66
|
-
ae = Symbol.for("react.module.reference");
|
|
67
|
-
function Le(e) {
|
|
68
|
-
return !!(typeof e == "string" || typeof e == "function" || e === p || e === h || Ne || e === d || e === P || e === m || Me || e === _ || We || Ye || Ve || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === x || e.$$typeof === O || e.$$typeof === S || e.$$typeof === y || // This needs to include all possible module reference object
|
|
69
|
-
// types supported by any Flight configuration anywhere since
|
|
70
|
-
// we don't know which Flight build this will end up being used
|
|
71
|
-
// with.
|
|
72
|
-
e.$$typeof === ae || e.getModuleId !== void 0));
|
|
73
|
-
}
|
|
74
|
-
function Ue(e, r, t) {
|
|
75
|
-
var n = e.displayName;
|
|
76
|
-
if (n)
|
|
77
|
-
return n;
|
|
78
|
-
var s = r.displayName || r.name || "";
|
|
79
|
-
return s !== "" ? t + "(" + s + ")" : t;
|
|
80
|
-
}
|
|
81
|
-
function ie(e) {
|
|
82
|
-
return e.displayName || "Context";
|
|
83
|
-
}
|
|
84
|
-
function k(e) {
|
|
85
|
-
if (e == null)
|
|
86
|
-
return null;
|
|
87
|
-
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")
|
|
88
|
-
return e.displayName || e.name || null;
|
|
89
|
-
if (typeof e == "string")
|
|
90
|
-
return e;
|
|
91
|
-
switch (e) {
|
|
92
|
-
case p:
|
|
93
|
-
return "Fragment";
|
|
94
|
-
case g:
|
|
95
|
-
return "Portal";
|
|
96
|
-
case h:
|
|
97
|
-
return "Profiler";
|
|
98
|
-
case d:
|
|
99
|
-
return "StrictMode";
|
|
100
|
-
case P:
|
|
101
|
-
return "Suspense";
|
|
102
|
-
case m:
|
|
103
|
-
return "SuspenseList";
|
|
104
|
-
}
|
|
105
|
-
if (typeof e == "object")
|
|
106
|
-
switch (e.$$typeof) {
|
|
107
|
-
case S:
|
|
108
|
-
var r = e;
|
|
109
|
-
return ie(r) + ".Consumer";
|
|
110
|
-
case O:
|
|
111
|
-
var t = e;
|
|
112
|
-
return ie(t._context) + ".Provider";
|
|
113
|
-
case y:
|
|
114
|
-
return Ue(e, e.render, "ForwardRef");
|
|
115
|
-
case x:
|
|
116
|
-
var n = e.displayName || null;
|
|
117
|
-
return n !== null ? n : k(e.type) || "Memo";
|
|
118
|
-
case C: {
|
|
119
|
-
var s = e, u = s._payload, i = s._init;
|
|
120
|
-
try {
|
|
121
|
-
return k(i(u));
|
|
122
|
-
} catch {
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
var F = Object.assign, V = 0, oe, se, ue, le, ce, fe, de;
|
|
130
|
-
function ve() {
|
|
131
|
-
}
|
|
132
|
-
ve.__reactDisabledLog = !0;
|
|
133
|
-
function qe() {
|
|
134
|
-
{
|
|
135
|
-
if (V === 0) {
|
|
136
|
-
oe = console.log, se = console.info, ue = console.warn, le = console.error, ce = console.group, fe = console.groupCollapsed, de = console.groupEnd;
|
|
137
|
-
var e = {
|
|
138
|
-
configurable: !0,
|
|
139
|
-
enumerable: !0,
|
|
140
|
-
value: ve,
|
|
141
|
-
writable: !0
|
|
142
|
-
};
|
|
143
|
-
Object.defineProperties(console, {
|
|
144
|
-
info: e,
|
|
145
|
-
log: e,
|
|
146
|
-
warn: e,
|
|
147
|
-
error: e,
|
|
148
|
-
group: e,
|
|
149
|
-
groupCollapsed: e,
|
|
150
|
-
groupEnd: e
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
V++;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
function Be() {
|
|
157
|
-
{
|
|
158
|
-
if (V--, V === 0) {
|
|
159
|
-
var e = {
|
|
160
|
-
configurable: !0,
|
|
161
|
-
enumerable: !0,
|
|
162
|
-
writable: !0
|
|
163
|
-
};
|
|
164
|
-
Object.defineProperties(console, {
|
|
165
|
-
log: F({}, e, {
|
|
166
|
-
value: oe
|
|
167
|
-
}),
|
|
168
|
-
info: F({}, e, {
|
|
169
|
-
value: se
|
|
170
|
-
}),
|
|
171
|
-
warn: F({}, e, {
|
|
172
|
-
value: ue
|
|
173
|
-
}),
|
|
174
|
-
error: F({}, e, {
|
|
175
|
-
value: le
|
|
176
|
-
}),
|
|
177
|
-
group: F({}, e, {
|
|
178
|
-
value: ce
|
|
179
|
-
}),
|
|
180
|
-
groupCollapsed: F({}, e, {
|
|
181
|
-
value: fe
|
|
182
|
-
}),
|
|
183
|
-
groupEnd: F({}, e, {
|
|
184
|
-
value: de
|
|
185
|
-
})
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
V < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
var z = $.ReactCurrentDispatcher, G;
|
|
192
|
-
function U(e, r, t) {
|
|
193
|
-
{
|
|
194
|
-
if (G === void 0)
|
|
195
|
-
try {
|
|
196
|
-
throw Error();
|
|
197
|
-
} catch (s) {
|
|
198
|
-
var n = s.stack.trim().match(/\n( *(at )?)/);
|
|
199
|
-
G = n && n[1] || "";
|
|
200
|
-
}
|
|
201
|
-
return `
|
|
202
|
-
` + G + e;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
var X = !1, q;
|
|
206
|
-
{
|
|
207
|
-
var Je = typeof WeakMap == "function" ? WeakMap : Map;
|
|
208
|
-
q = new Je();
|
|
209
|
-
}
|
|
210
|
-
function pe(e, r) {
|
|
211
|
-
if (!e || X)
|
|
212
|
-
return "";
|
|
213
|
-
{
|
|
214
|
-
var t = q.get(e);
|
|
215
|
-
if (t !== void 0)
|
|
216
|
-
return t;
|
|
217
|
-
}
|
|
218
|
-
var n;
|
|
219
|
-
X = !0;
|
|
220
|
-
var s = Error.prepareStackTrace;
|
|
221
|
-
Error.prepareStackTrace = void 0;
|
|
222
|
-
var u;
|
|
223
|
-
u = z.current, z.current = null, qe();
|
|
224
|
-
try {
|
|
225
|
-
if (r) {
|
|
226
|
-
var i = function() {
|
|
227
|
-
throw Error();
|
|
228
|
-
};
|
|
229
|
-
if (Object.defineProperty(i.prototype, "props", {
|
|
230
|
-
set: function() {
|
|
231
|
-
throw Error();
|
|
232
|
-
}
|
|
233
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
|
234
|
-
try {
|
|
235
|
-
Reflect.construct(i, []);
|
|
236
|
-
} catch (T) {
|
|
237
|
-
n = T;
|
|
238
|
-
}
|
|
239
|
-
Reflect.construct(e, [], i);
|
|
240
|
-
} else {
|
|
241
|
-
try {
|
|
242
|
-
i.call();
|
|
243
|
-
} catch (T) {
|
|
244
|
-
n = T;
|
|
245
|
-
}
|
|
246
|
-
e.call(i.prototype);
|
|
247
|
-
}
|
|
248
|
-
} else {
|
|
249
|
-
try {
|
|
250
|
-
throw Error();
|
|
251
|
-
} catch (T) {
|
|
252
|
-
n = T;
|
|
253
|
-
}
|
|
254
|
-
e();
|
|
255
|
-
}
|
|
256
|
-
} catch (T) {
|
|
257
|
-
if (T && n && typeof T.stack == "string") {
|
|
258
|
-
for (var a = T.stack.split(`
|
|
259
|
-
`), R = n.stack.split(`
|
|
260
|
-
`), c = a.length - 1, f = R.length - 1; c >= 1 && f >= 0 && a[c] !== R[f]; )
|
|
261
|
-
f--;
|
|
262
|
-
for (; c >= 1 && f >= 0; c--, f--)
|
|
263
|
-
if (a[c] !== R[f]) {
|
|
264
|
-
if (c !== 1 || f !== 1)
|
|
265
|
-
do
|
|
266
|
-
if (c--, f--, f < 0 || a[c] !== R[f]) {
|
|
267
|
-
var w = `
|
|
268
|
-
` + a[c].replace(" at new ", " at ");
|
|
269
|
-
return e.displayName && w.includes("<anonymous>") && (w = w.replace("<anonymous>", e.displayName)), typeof e == "function" && q.set(e, w), w;
|
|
270
|
-
}
|
|
271
|
-
while (c >= 1 && f >= 0);
|
|
272
|
-
break;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
} finally {
|
|
276
|
-
X = !1, z.current = u, Be(), Error.prepareStackTrace = s;
|
|
277
|
-
}
|
|
278
|
-
var Y = e ? e.displayName || e.name : "", D = Y ? U(Y) : "";
|
|
279
|
-
return typeof e == "function" && q.set(e, D), D;
|
|
280
|
-
}
|
|
281
|
-
function Ke(e, r, t) {
|
|
282
|
-
return pe(e, !1);
|
|
283
|
-
}
|
|
284
|
-
function ze(e) {
|
|
285
|
-
var r = e.prototype;
|
|
286
|
-
return !!(r && r.isReactComponent);
|
|
287
|
-
}
|
|
288
|
-
function B(e, r, t) {
|
|
289
|
-
if (e == null)
|
|
290
|
-
return "";
|
|
291
|
-
if (typeof e == "function")
|
|
292
|
-
return pe(e, ze(e));
|
|
293
|
-
if (typeof e == "string")
|
|
294
|
-
return U(e);
|
|
295
|
-
switch (e) {
|
|
296
|
-
case P:
|
|
297
|
-
return U("Suspense");
|
|
298
|
-
case m:
|
|
299
|
-
return U("SuspenseList");
|
|
300
|
-
}
|
|
301
|
-
if (typeof e == "object")
|
|
302
|
-
switch (e.$$typeof) {
|
|
303
|
-
case y:
|
|
304
|
-
return Ke(e.render);
|
|
305
|
-
case x:
|
|
306
|
-
return B(e.type, r, t);
|
|
307
|
-
case C: {
|
|
308
|
-
var n = e, s = n._payload, u = n._init;
|
|
309
|
-
try {
|
|
310
|
-
return B(u(s), r, t);
|
|
311
|
-
} catch {
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
return "";
|
|
316
|
-
}
|
|
317
|
-
var M = Object.prototype.hasOwnProperty, ye = {}, be = $.ReactDebugCurrentFrame;
|
|
318
|
-
function J(e) {
|
|
319
|
-
if (e) {
|
|
320
|
-
var r = e._owner, t = B(e.type, e._source, r ? r.type : null);
|
|
321
|
-
be.setExtraStackFrame(t);
|
|
322
|
-
} else
|
|
323
|
-
be.setExtraStackFrame(null);
|
|
324
|
-
}
|
|
325
|
-
function Ge(e, r, t, n, s) {
|
|
326
|
-
{
|
|
327
|
-
var u = Function.call.bind(M);
|
|
328
|
-
for (var i in e)
|
|
329
|
-
if (u(e, i)) {
|
|
330
|
-
var a = void 0;
|
|
331
|
-
try {
|
|
332
|
-
if (typeof e[i] != "function") {
|
|
333
|
-
var R = 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`.");
|
|
334
|
-
throw R.name = "Invariant Violation", R;
|
|
335
|
-
}
|
|
336
|
-
a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
337
|
-
} catch (c) {
|
|
338
|
-
a = c;
|
|
339
|
-
}
|
|
340
|
-
a && !(a instanceof Error) && (J(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), J(null)), a instanceof Error && !(a.message in ye) && (ye[a.message] = !0, J(s), E("Failed %s type: %s", t, a.message), J(null));
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
var Xe = Array.isArray;
|
|
345
|
-
function H(e) {
|
|
346
|
-
return Xe(e);
|
|
347
|
-
}
|
|
348
|
-
function He(e) {
|
|
349
|
-
{
|
|
350
|
-
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
351
|
-
return t;
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
function Qe(e) {
|
|
355
|
-
try {
|
|
356
|
-
return ge(e), !1;
|
|
357
|
-
} catch {
|
|
358
|
-
return !0;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
function ge(e) {
|
|
362
|
-
return "" + e;
|
|
363
|
-
}
|
|
364
|
-
function he(e) {
|
|
365
|
-
if (Qe(e))
|
|
366
|
-
return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", He(e)), ge(e);
|
|
367
|
-
}
|
|
368
|
-
var me = $.ReactCurrentOwner, Ze = {
|
|
369
|
-
key: !0,
|
|
370
|
-
ref: !0,
|
|
371
|
-
__self: !0,
|
|
372
|
-
__source: !0
|
|
373
|
-
}, Ee, Re;
|
|
374
|
-
function er(e) {
|
|
375
|
-
if (M.call(e, "ref")) {
|
|
376
|
-
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
377
|
-
if (r && r.isReactWarning)
|
|
378
|
-
return !1;
|
|
379
|
-
}
|
|
380
|
-
return e.ref !== void 0;
|
|
381
|
-
}
|
|
382
|
-
function rr(e) {
|
|
383
|
-
if (M.call(e, "key")) {
|
|
384
|
-
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
385
|
-
if (r && r.isReactWarning)
|
|
386
|
-
return !1;
|
|
387
|
-
}
|
|
388
|
-
return e.key !== void 0;
|
|
389
|
-
}
|
|
390
|
-
function tr(e, r) {
|
|
391
|
-
typeof e.ref == "string" && me.current;
|
|
392
|
-
}
|
|
393
|
-
function nr(e, r) {
|
|
394
|
-
{
|
|
395
|
-
var t = function() {
|
|
396
|
-
Ee || (Ee = !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));
|
|
397
|
-
};
|
|
398
|
-
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
399
|
-
get: t,
|
|
400
|
-
configurable: !0
|
|
401
|
-
});
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
function ar(e, r) {
|
|
405
|
-
{
|
|
406
|
-
var t = function() {
|
|
407
|
-
Re || (Re = !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));
|
|
408
|
-
};
|
|
409
|
-
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
410
|
-
get: t,
|
|
411
|
-
configurable: !0
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
var ir = function(e, r, t, n, s, u, i) {
|
|
416
|
-
var a = {
|
|
417
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
418
|
-
$$typeof: l,
|
|
419
|
-
// Built-in properties that belong on the element
|
|
420
|
-
type: e,
|
|
421
|
-
key: r,
|
|
422
|
-
ref: t,
|
|
423
|
-
props: i,
|
|
424
|
-
// Record the component responsible for creating this element.
|
|
425
|
-
_owner: u
|
|
426
|
-
};
|
|
427
|
-
return a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
428
|
-
configurable: !1,
|
|
429
|
-
enumerable: !1,
|
|
430
|
-
writable: !0,
|
|
431
|
-
value: !1
|
|
432
|
-
}), Object.defineProperty(a, "_self", {
|
|
433
|
-
configurable: !1,
|
|
434
|
-
enumerable: !1,
|
|
435
|
-
writable: !1,
|
|
436
|
-
value: n
|
|
437
|
-
}), Object.defineProperty(a, "_source", {
|
|
438
|
-
configurable: !1,
|
|
439
|
-
enumerable: !1,
|
|
440
|
-
writable: !1,
|
|
441
|
-
value: s
|
|
442
|
-
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
443
|
-
};
|
|
444
|
-
function or(e, r, t, n, s) {
|
|
445
|
-
{
|
|
446
|
-
var u, i = {}, a = null, R = null;
|
|
447
|
-
t !== void 0 && (he(t), a = "" + t), rr(r) && (he(r.key), a = "" + r.key), er(r) && (R = r.ref, tr(r, s));
|
|
448
|
-
for (u in r)
|
|
449
|
-
M.call(r, u) && !Ze.hasOwnProperty(u) && (i[u] = r[u]);
|
|
450
|
-
if (e && e.defaultProps) {
|
|
451
|
-
var c = e.defaultProps;
|
|
452
|
-
for (u in c)
|
|
453
|
-
i[u] === void 0 && (i[u] = c[u]);
|
|
454
|
-
}
|
|
455
|
-
if (a || R) {
|
|
456
|
-
var f = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
457
|
-
a && nr(i, f), R && ar(i, f);
|
|
458
|
-
}
|
|
459
|
-
return ir(e, a, R, s, n, me.current, i);
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
var Q = $.ReactCurrentOwner, _e = $.ReactDebugCurrentFrame;
|
|
463
|
-
function W(e) {
|
|
464
|
-
if (e) {
|
|
465
|
-
var r = e._owner, t = B(e.type, e._source, r ? r.type : null);
|
|
466
|
-
_e.setExtraStackFrame(t);
|
|
467
|
-
} else
|
|
468
|
-
_e.setExtraStackFrame(null);
|
|
469
|
-
}
|
|
470
|
-
var Z;
|
|
471
|
-
Z = !1;
|
|
472
|
-
function ee(e) {
|
|
473
|
-
return typeof e == "object" && e !== null && e.$$typeof === l;
|
|
474
|
-
}
|
|
475
|
-
function Te() {
|
|
476
|
-
{
|
|
477
|
-
if (Q.current) {
|
|
478
|
-
var e = k(Q.current.type);
|
|
479
|
-
if (e)
|
|
480
|
-
return `
|
|
481
|
-
|
|
482
|
-
Check the render method of \`` + e + "`.";
|
|
483
|
-
}
|
|
484
|
-
return "";
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
function sr(e) {
|
|
488
|
-
return "";
|
|
489
|
-
}
|
|
490
|
-
var we = {};
|
|
491
|
-
function ur(e) {
|
|
492
|
-
{
|
|
493
|
-
var r = Te();
|
|
494
|
-
if (!r) {
|
|
495
|
-
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
496
|
-
t && (r = `
|
|
497
|
-
|
|
498
|
-
Check the top-level render call using <` + t + ">.");
|
|
499
|
-
}
|
|
500
|
-
return r;
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
function xe(e, r) {
|
|
504
|
-
{
|
|
505
|
-
if (!e._store || e._store.validated || e.key != null)
|
|
506
|
-
return;
|
|
507
|
-
e._store.validated = !0;
|
|
508
|
-
var t = ur(r);
|
|
509
|
-
if (we[t])
|
|
510
|
-
return;
|
|
511
|
-
we[t] = !0;
|
|
512
|
-
var n = "";
|
|
513
|
-
e && e._owner && e._owner !== Q.current && (n = " It was passed a child from " + k(e._owner.type) + "."), W(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), W(null);
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
function Se(e, r) {
|
|
517
|
-
{
|
|
518
|
-
if (typeof e != "object")
|
|
519
|
-
return;
|
|
520
|
-
if (H(e))
|
|
521
|
-
for (var t = 0; t < e.length; t++) {
|
|
522
|
-
var n = e[t];
|
|
523
|
-
ee(n) && xe(n, r);
|
|
524
|
-
}
|
|
525
|
-
else if (ee(e))
|
|
526
|
-
e._store && (e._store.validated = !0);
|
|
527
|
-
else if (e) {
|
|
528
|
-
var s = I(e);
|
|
529
|
-
if (typeof s == "function" && s !== e.entries)
|
|
530
|
-
for (var u = s.call(e), i; !(i = u.next()).done; )
|
|
531
|
-
ee(i.value) && xe(i.value, r);
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
function lr(e) {
|
|
536
|
-
{
|
|
537
|
-
var r = e.type;
|
|
538
|
-
if (r == null || typeof r == "string")
|
|
539
|
-
return;
|
|
540
|
-
var t;
|
|
541
|
-
if (typeof r == "function")
|
|
542
|
-
t = r.propTypes;
|
|
543
|
-
else if (typeof r == "object" && (r.$$typeof === y || // Note: Memo only checks outer props here.
|
|
544
|
-
// Inner props are checked in the reconciler.
|
|
545
|
-
r.$$typeof === x))
|
|
546
|
-
t = r.propTypes;
|
|
547
|
-
else
|
|
548
|
-
return;
|
|
549
|
-
if (t) {
|
|
550
|
-
var n = k(r);
|
|
551
|
-
Ge(t, e.props, "prop", n, e);
|
|
552
|
-
} else if (r.PropTypes !== void 0 && !Z) {
|
|
553
|
-
Z = !0;
|
|
554
|
-
var s = k(r);
|
|
555
|
-
E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
|
|
556
|
-
}
|
|
557
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
function cr(e) {
|
|
561
|
-
{
|
|
562
|
-
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
563
|
-
var n = r[t];
|
|
564
|
-
if (n !== "children" && n !== "key") {
|
|
565
|
-
W(e), E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), W(null);
|
|
566
|
-
break;
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
e.ref !== null && (W(e), E("Invalid attribute `ref` supplied to `React.Fragment`."), W(null));
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
var Oe = {};
|
|
573
|
-
function Pe(e, r, t, n, s, u) {
|
|
574
|
-
{
|
|
575
|
-
var i = Le(e);
|
|
576
|
-
if (!i) {
|
|
577
|
-
var a = "";
|
|
578
|
-
(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.");
|
|
579
|
-
var R = sr();
|
|
580
|
-
R ? a += R : a += Te();
|
|
581
|
-
var c;
|
|
582
|
-
e === null ? c = "null" : H(e) ? c = "array" : e !== void 0 && e.$$typeof === l ? (c = "<" + (k(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : c = 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", c, a);
|
|
583
|
-
}
|
|
584
|
-
var f = or(e, r, t, s, u);
|
|
585
|
-
if (f == null)
|
|
586
|
-
return f;
|
|
587
|
-
if (i) {
|
|
588
|
-
var w = r.children;
|
|
589
|
-
if (w !== void 0)
|
|
590
|
-
if (n)
|
|
591
|
-
if (H(w)) {
|
|
592
|
-
for (var Y = 0; Y < w.length; Y++)
|
|
593
|
-
Se(w[Y], e);
|
|
594
|
-
Object.freeze && Object.freeze(w);
|
|
595
|
-
} else
|
|
596
|
-
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.");
|
|
597
|
-
else
|
|
598
|
-
Se(w, e);
|
|
599
|
-
}
|
|
600
|
-
if (M.call(r, "key")) {
|
|
601
|
-
var D = k(e), T = Object.keys(r).filter(function(br) {
|
|
602
|
-
return br !== "key";
|
|
603
|
-
}), re = T.length > 0 ? "{key: someKey, " + T.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
604
|
-
if (!Oe[D + re]) {
|
|
605
|
-
var yr = T.length > 0 ? "{" + T.join(": ..., ") + ": ...}" : "{}";
|
|
606
|
-
E(`A props object containing a "key" prop is being spread into JSX:
|
|
607
|
-
let props = %s;
|
|
608
|
-
<%s {...props} />
|
|
609
|
-
React keys must be passed directly to JSX without using spread:
|
|
610
|
-
let props = %s;
|
|
611
|
-
<%s key={someKey} {...props} />`, re, D, yr, D), Oe[D + re] = !0;
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
return e === p ? cr(f) : lr(f), f;
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
function fr(e, r, t) {
|
|
618
|
-
return Pe(e, r, t, !0);
|
|
619
|
-
}
|
|
620
|
-
function dr(e, r, t) {
|
|
621
|
-
return Pe(e, r, t, !1);
|
|
622
|
-
}
|
|
623
|
-
var vr = dr, pr = fr;
|
|
624
|
-
L.Fragment = p, L.jsx = vr, L.jsxs = pr;
|
|
625
|
-
})()), L;
|
|
626
|
-
}
|
|
627
|
-
var Ae;
|
|
628
|
-
function Er() {
|
|
629
|
-
return Ae || (Ae = 1, process.env.NODE_ENV === "production" ? K.exports = hr() : K.exports = mr()), K.exports;
|
|
630
|
-
}
|
|
631
|
-
var j = Er();
|
|
632
|
-
function xr({
|
|
633
|
-
fields: o,
|
|
634
|
-
onChange: l,
|
|
635
|
-
onSubmit: g,
|
|
636
|
-
questionnaireId: p = "questionnaire-1",
|
|
637
|
-
subjectId: d,
|
|
638
|
-
className: h = "",
|
|
639
|
-
fullHeight: O = !1
|
|
640
|
-
}) {
|
|
641
|
-
const S = A.useRef(!1), y = ne();
|
|
642
|
-
A.useEffect(() => {
|
|
643
|
-
if (S.current || !Array.isArray(o)) return;
|
|
644
|
-
const _ = /* @__PURE__ */ new Set();
|
|
645
|
-
o.forEach((b) => {
|
|
646
|
-
(b == null ? void 0 : b.fieldType) === "section" && Array.isArray(b.fields) && b.fields.forEach((I) => (I == null ? void 0 : I.id) && _.add(I.id));
|
|
647
|
-
});
|
|
648
|
-
const v = o.filter((b) => !_.has(b.id));
|
|
649
|
-
Ce.getState().replaceAll(v), y.preview.set(!0), S.current = !0;
|
|
650
|
-
}, [o, y.preview]), A.useEffect(() => l ? Ce.subscribe((v) => {
|
|
651
|
-
const b = v.flatArray ? v.flatArray() : Object.values(v.byId);
|
|
652
|
-
l(b);
|
|
653
|
-
}) : void 0, [l]);
|
|
654
|
-
const P = De(), m = A.useCallback(() => {
|
|
655
|
-
const _ = [];
|
|
656
|
-
return (P || []).forEach((v) => {
|
|
657
|
-
if (v.fieldType === "section" && Array.isArray(v.fields)) {
|
|
658
|
-
v.fields.forEach((b) => {
|
|
659
|
-
b && _.push({
|
|
660
|
-
linkId: b.id,
|
|
661
|
-
text: b.question || b.title || "",
|
|
662
|
-
answer: Fe(b)
|
|
663
|
-
});
|
|
664
|
-
});
|
|
665
|
-
return;
|
|
666
|
-
}
|
|
667
|
-
v.fieldType !== "section" && _.push({
|
|
668
|
-
linkId: v.id,
|
|
669
|
-
text: v.question || v.title || "",
|
|
670
|
-
answer: Fe(v)
|
|
671
|
-
});
|
|
672
|
-
}), {
|
|
673
|
-
resourceType: "QuestionnaireResponse",
|
|
674
|
-
questionnaire: p,
|
|
675
|
-
status: "in-progress",
|
|
676
|
-
subject: d ? { reference: `Patient/${d}` } : void 0,
|
|
677
|
-
item: _
|
|
678
|
-
};
|
|
679
|
-
}, [P, p, d]), x = (_) => {
|
|
680
|
-
_.preventDefault();
|
|
681
|
-
const v = m();
|
|
682
|
-
g == null || g(v);
|
|
683
|
-
}, C = [
|
|
684
|
-
"qb-render-root",
|
|
685
|
-
"bg-gray-100",
|
|
686
|
-
"font-titillium",
|
|
687
|
-
O ? "min-h-screen" : "",
|
|
688
|
-
h
|
|
689
|
-
].filter(Boolean).join(" ");
|
|
690
|
-
return /* @__PURE__ */ j.jsx("div", { className: C, children: /* @__PURE__ */ j.jsxs("form", { onSubmit: x, className: "max-w-4xl mx-auto px-2 pb-8 pt-4", children: [
|
|
691
|
-
/* @__PURE__ */ j.jsx(Rr, {}),
|
|
692
|
-
/* @__PURE__ */ j.jsx("div", { className: "pt-2", children: /* @__PURE__ */ j.jsx("button", { type: "submit", className: "px-4 py-2 rounded bg-[#0076a8] text-white shadow hover:bg-[#00628a] transition-colors", children: "Submit" }) })
|
|
693
|
-
] }) });
|
|
694
|
-
}
|
|
695
|
-
function Fe(o) {
|
|
696
|
-
switch (o.fieldType) {
|
|
697
|
-
case "input":
|
|
698
|
-
return o.answer ? [{ valueString: String(o.answer) }] : [];
|
|
699
|
-
case "radio":
|
|
700
|
-
return o.selected ? [{ valueString: te(o, o.selected) }] : [];
|
|
701
|
-
case "check":
|
|
702
|
-
return (o.selected || []).map((l) => ({ valueString: te(o, l) }));
|
|
703
|
-
case "selection":
|
|
704
|
-
return o.selected ? [{ valueString: te(o, o.selected) }] : [];
|
|
705
|
-
default:
|
|
706
|
-
return [];
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
function te(o, l) {
|
|
710
|
-
const g = (o.options || []).find((p) => p.id === l || p.value === l);
|
|
711
|
-
return g ? g.value : "";
|
|
712
|
-
}
|
|
713
|
-
function Rr() {
|
|
714
|
-
const o = ne(), l = De() || [], g = A.useMemo(() => {
|
|
715
|
-
const d = [];
|
|
716
|
-
return l.forEach((h) => {
|
|
717
|
-
d.push(h), (h == null ? void 0 : h.fieldType) === "section" && Array.isArray(h.fields) && d.push(...h.fields);
|
|
718
|
-
}), d;
|
|
719
|
-
}, [l]), p = A.useMemo(() => o.state.isPreview ? l.filter((d) => Ie(d, g)) : l, [l, g, o.state.isPreview]);
|
|
720
|
-
return /* @__PURE__ */ j.jsx("div", { children: p.map((d) => /* @__PURE__ */ j.jsx(_r, { field: d, allFlat: g }, d.id)) });
|
|
721
|
-
}
|
|
722
|
-
function _r({ field: o, allFlat: l }) {
|
|
723
|
-
const g = ne(), p = gr(o.fieldType);
|
|
724
|
-
if (!p) return null;
|
|
725
|
-
if (o.fieldType === "section" && g.state.isPreview && Array.isArray(o.fields)) {
|
|
726
|
-
const d = o.fields.filter((O) => Ie(O, l)), h = { ...o, fields: d };
|
|
727
|
-
return /* @__PURE__ */ j.jsx(p, { field: h });
|
|
728
|
-
}
|
|
729
|
-
return /* @__PURE__ */ j.jsx(p, { field: o });
|
|
730
|
-
}
|
|
731
|
-
export {
|
|
732
|
-
xr as QuestionnaireRenderer
|
|
733
|
-
};
|
|
734
|
-
//# sourceMappingURL=index.js.map
|