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