@a-ludi/rjsf-formulas 0.6.0 → 0.6.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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +175 -169
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { findSchemaDefinition as ut } from "@rjsf/utils";
|
|
2
2
|
import { jsx as at } from "react/jsx-runtime";
|
|
3
|
-
import { useState as lt, useRef as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
function
|
|
3
|
+
import { useState as lt, useRef as g, useEffect as m, useCallback as K, forwardRef as pt, useMemo as Q } from "react";
|
|
4
|
+
import dt from "@rjsf/core";
|
|
5
|
+
const U = Symbol("arrayIndex");
|
|
6
|
+
function yt(t, r) {
|
|
7
7
|
const e = (r == null ? void 0 : r.formulaKey) ?? "x-formula", s = (r == null ? void 0 : r.formulaContextKey) ?? "x-formula-context", n = (r == null ? void 0 : r.formulaConflictBehavior) ?? "warn", o = [];
|
|
8
|
-
return
|
|
8
|
+
return O(t, [], o, e, s, n, !0, t), o;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function W(t, r) {
|
|
11
11
|
if (t === !0) return r;
|
|
12
12
|
const e = t;
|
|
13
13
|
return Array.isArray(e.allOf) ? { allOf: [...e.allOf, r] } : { allOf: [t, r] };
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function gt(t, r) {
|
|
16
16
|
return t === void 0 || t === "siblings" ? "siblings" : t === "extended" ? "extended" : (console.warn(
|
|
17
17
|
`[rjsf-formulas] Unknown x-formula-context value "${t}" at path [${H(r)}], treating as "siblings"`
|
|
18
18
|
), "siblings");
|
|
@@ -23,7 +23,7 @@ function H(t) {
|
|
|
23
23
|
function L(t) {
|
|
24
24
|
return t.map((r) => typeof r == "symbol" ? "[*]" : String(r)).join(".");
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function mt(t, r, e) {
|
|
27
27
|
const s = L(t.path);
|
|
28
28
|
if (e === "error")
|
|
29
29
|
throw new TypeError(
|
|
@@ -36,14 +36,14 @@ function gt(t, r, e) {
|
|
|
36
36
|
function ht(t, r, e) {
|
|
37
37
|
for (const s of r) {
|
|
38
38
|
const n = L(s.path), o = t.findIndex((i) => L(i.path) === n);
|
|
39
|
-
o !== -1 ? (
|
|
39
|
+
o !== -1 ? (mt(t[o], s, e), t[o] = s) : t.push(s);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function O(t, r, e, s, n, o, i, u) {
|
|
43
43
|
const f = t;
|
|
44
44
|
if (typeof f.$ref == "string") {
|
|
45
45
|
const c = ut(f.$ref, u);
|
|
46
|
-
|
|
46
|
+
O(c, r, e, s, n, o, i, u);
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
49
|
if (s in t) {
|
|
@@ -57,7 +57,7 @@ function x(t, r, e, s, n, o, i, u) {
|
|
|
57
57
|
e.push({
|
|
58
58
|
path: r,
|
|
59
59
|
formula: c,
|
|
60
|
-
contextMode:
|
|
60
|
+
contextMode: gt(f[n], r),
|
|
61
61
|
condition: i
|
|
62
62
|
});
|
|
63
63
|
return;
|
|
@@ -65,7 +65,7 @@ function x(t, r, e, s, n, o, i, u) {
|
|
|
65
65
|
const l = t.type === "array" || t.type == null && (Array.isArray(f.prefixItems) || t.items != null);
|
|
66
66
|
if (t.properties && !l)
|
|
67
67
|
for (const [c, a] of Object.entries(t.properties))
|
|
68
|
-
|
|
68
|
+
O(
|
|
69
69
|
a,
|
|
70
70
|
[...r, c],
|
|
71
71
|
e,
|
|
@@ -75,13 +75,13 @@ function x(t, r, e, s, n, o, i, u) {
|
|
|
75
75
|
i,
|
|
76
76
|
u
|
|
77
77
|
);
|
|
78
|
-
if (l && (Array.isArray(f.prefixItems) && f.prefixItems.forEach((a,
|
|
79
|
-
|
|
80
|
-
}), Array.isArray(t.items) && t.items.forEach((c, a) => {
|
|
81
|
-
|
|
82
|
-
}), t.items && !Array.isArray(t.items) &&
|
|
78
|
+
if (l && (Array.isArray(f.prefixItems) && f.prefixItems.forEach((a, y) => {
|
|
79
|
+
O(a, [...r, y], e, s, n, o, i, u);
|
|
80
|
+
}), Array.isArray(t.items) && (t.items.forEach((c, a) => {
|
|
81
|
+
O(c, [...r, a], e, s, n, o, i, u);
|
|
82
|
+
}), t.additionalItems && typeof t.additionalItems == "object" && O(t.additionalItems, [...r, U], e, s, n, o, i, u)), t.items && !Array.isArray(t.items) && O(
|
|
83
83
|
t.items,
|
|
84
|
-
[...r,
|
|
84
|
+
[...r, U],
|
|
85
85
|
e,
|
|
86
86
|
s,
|
|
87
87
|
n,
|
|
@@ -91,38 +91,38 @@ function x(t, r, e, s, n, o, i, u) {
|
|
|
91
91
|
)), Array.isArray(f.allOf)) {
|
|
92
92
|
const c = f.allOf;
|
|
93
93
|
for (const a of c) {
|
|
94
|
-
const
|
|
95
|
-
|
|
94
|
+
const y = [];
|
|
95
|
+
O(a, r, y, s, n, o, i, u), ht(e, y, o);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
for (const c of ["oneOf", "anyOf"])
|
|
99
99
|
if (Array.isArray(f[c])) {
|
|
100
100
|
const a = f[c];
|
|
101
|
-
for (const
|
|
102
|
-
const
|
|
103
|
-
|
|
101
|
+
for (const y of a) {
|
|
102
|
+
const h = W(i, y);
|
|
103
|
+
O(y, r, e, s, n, o, h, u);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
if ("if" in f) {
|
|
107
|
-
const c = f.if, a = f.then,
|
|
107
|
+
const c = f.if, a = f.then, y = f.else;
|
|
108
108
|
if (s in c && console.warn(
|
|
109
109
|
`[rjsf-formulas] Formula key "${s}" found inside an "if" schema at path [${H(r)}]. The "if" schema is a validation predicate and is never rendered — the formula will be ignored.`
|
|
110
110
|
), a !== void 0) {
|
|
111
|
-
const
|
|
112
|
-
|
|
111
|
+
const h = W(i, c);
|
|
112
|
+
O(a, r, e, s, n, o, h, u);
|
|
113
113
|
}
|
|
114
|
-
if (
|
|
115
|
-
const
|
|
116
|
-
|
|
114
|
+
if (y !== void 0) {
|
|
115
|
+
const h = W(i, { not: c });
|
|
116
|
+
O(y, r, e, s, n, o, h, u);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function jt(t) {
|
|
121
121
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
122
122
|
}
|
|
123
|
-
var
|
|
124
|
-
function
|
|
125
|
-
return et || (et = 1,
|
|
123
|
+
var Z, et;
|
|
124
|
+
function wt() {
|
|
125
|
+
return et || (et = 1, Z = function t(r, e) {
|
|
126
126
|
if (r === e) return !0;
|
|
127
127
|
if (r && e && typeof r == "object" && typeof e == "object") {
|
|
128
128
|
if (r.constructor !== e.constructor) return !1;
|
|
@@ -146,10 +146,10 @@ function jt() {
|
|
|
146
146
|
return !0;
|
|
147
147
|
}
|
|
148
148
|
return r !== r && e !== e;
|
|
149
|
-
}),
|
|
149
|
+
}), Z;
|
|
150
150
|
}
|
|
151
|
-
var At =
|
|
152
|
-
const Ot = /* @__PURE__ */
|
|
151
|
+
var At = wt();
|
|
152
|
+
const Ot = /* @__PURE__ */ jt(At);
|
|
153
153
|
function xt(t, r, e, s) {
|
|
154
154
|
const o = r.slice(0, -1).reduce((u, f) => {
|
|
155
155
|
if (!(u == null || typeof u != "object"))
|
|
@@ -166,7 +166,7 @@ function xt(t, r, e, s) {
|
|
|
166
166
|
function nt(t) {
|
|
167
167
|
return t.map((r) => typeof r == "symbol" ? "[*]" : String(r)).join(", ");
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function E(t, r) {
|
|
170
170
|
return r.reduce((e, s) => {
|
|
171
171
|
if (!(e == null || typeof e != "object"))
|
|
172
172
|
return e[s];
|
|
@@ -174,21 +174,21 @@ function M(t, r) {
|
|
|
174
174
|
}
|
|
175
175
|
function B(t, r, e) {
|
|
176
176
|
if (r.length === 0) return;
|
|
177
|
-
const s =
|
|
177
|
+
const s = E(t, r.slice(0, -1));
|
|
178
178
|
s != null && typeof s == "object" && (s[r[r.length - 1]] = e);
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function q(t, r, e = []) {
|
|
181
181
|
if (t.length === 0) return [e];
|
|
182
182
|
const [s, ...n] = t;
|
|
183
|
-
if (s ===
|
|
184
|
-
const o =
|
|
183
|
+
if (s === U) {
|
|
184
|
+
const o = E(r, e);
|
|
185
185
|
if (!Array.isArray(o)) return [];
|
|
186
186
|
const i = [];
|
|
187
187
|
for (let u = 0; u < o.length; u++)
|
|
188
|
-
i.push(...
|
|
188
|
+
i.push(...q(n, r, [...e, u]));
|
|
189
189
|
return i;
|
|
190
190
|
}
|
|
191
|
-
return
|
|
191
|
+
return q(n, r, [...e, s]);
|
|
192
192
|
}
|
|
193
193
|
function tt(t, r) {
|
|
194
194
|
return Ot(t, r);
|
|
@@ -196,7 +196,7 @@ function tt(t, r) {
|
|
|
196
196
|
async function st(t, r, e, s) {
|
|
197
197
|
const n = structuredClone(t), o = [];
|
|
198
198
|
for (const f of r)
|
|
199
|
-
for (const l of
|
|
199
|
+
for (const l of q(f.path, n)) {
|
|
200
200
|
const c = xt(f, l, n, s);
|
|
201
201
|
o.push({ field: f, concretePath: l, context: c });
|
|
202
202
|
}
|
|
@@ -216,10 +216,10 @@ async function st(t, r, e, s) {
|
|
|
216
216
|
}
|
|
217
217
|
function Rt(t, r, e, s) {
|
|
218
218
|
for (const n of e)
|
|
219
|
-
for (const o of
|
|
219
|
+
for (const o of q(n.path, r))
|
|
220
220
|
if (!tt(
|
|
221
|
-
s(
|
|
222
|
-
s(
|
|
221
|
+
s(E(t, o), o),
|
|
222
|
+
s(E(r, o), o)
|
|
223
223
|
))
|
|
224
224
|
return !1;
|
|
225
225
|
return !0;
|
|
@@ -229,10 +229,10 @@ async function bt(t, r, e, s, n, o, i, u, f, l = (c) => c) {
|
|
|
229
229
|
(p) => p.condition === !0 || u(p.condition, t)
|
|
230
230
|
);
|
|
231
231
|
if (c.length === 0) return t;
|
|
232
|
-
const a = /* @__PURE__ */ new Map(),
|
|
232
|
+
const a = /* @__PURE__ */ new Map(), y = [];
|
|
233
233
|
for (const p of c) {
|
|
234
|
-
const
|
|
235
|
-
if (a.has(
|
|
234
|
+
const d = JSON.stringify(p.path);
|
|
235
|
+
if (a.has(d)) {
|
|
236
236
|
if (f === "error")
|
|
237
237
|
throw new TypeError(
|
|
238
238
|
`[rjsf-formulas] Formula conflict: two active fields share path [${nt(p.path)}]`
|
|
@@ -240,136 +240,136 @@ async function bt(t, r, e, s, n, o, i, u, f, l = (c) => c) {
|
|
|
240
240
|
f === "warn" && console.warn(
|
|
241
241
|
`[rjsf-formulas] Formula conflict: two active fields share path [${nt(p.path)}]; taking last`
|
|
242
242
|
);
|
|
243
|
-
const
|
|
244
|
-
|
|
243
|
+
const j = y.indexOf(a.get(d));
|
|
244
|
+
y[j] = p, a.set(d, p);
|
|
245
245
|
} else
|
|
246
|
-
a.set(
|
|
246
|
+
a.set(d, p), y.push(p);
|
|
247
247
|
}
|
|
248
|
-
const
|
|
249
|
-
let
|
|
248
|
+
const h = { formulaDataKey: o, formulaPathKey: i };
|
|
249
|
+
let x = t;
|
|
250
250
|
for (let p = 0; p < s; p++) {
|
|
251
|
-
const { data:
|
|
252
|
-
if (Rt(
|
|
253
|
-
for (const { path: A, error: b } of
|
|
251
|
+
const { data: d, errors: j } = await st(x, y, e, h);
|
|
252
|
+
if (Rt(x, d, y, l)) {
|
|
253
|
+
for (const { path: A, error: b } of j)
|
|
254
254
|
n == null || n(A, b);
|
|
255
|
-
return
|
|
255
|
+
return d;
|
|
256
256
|
}
|
|
257
|
-
|
|
257
|
+
x = d;
|
|
258
258
|
}
|
|
259
|
-
const { data: R } = await st(
|
|
260
|
-
for (const p of
|
|
261
|
-
for (const
|
|
259
|
+
const { data: R } = await st(x, y, e, h), _ = structuredClone(R);
|
|
260
|
+
for (const p of y)
|
|
261
|
+
for (const d of q(p.path, R))
|
|
262
262
|
tt(
|
|
263
|
-
l(
|
|
264
|
-
l(
|
|
263
|
+
l(E(x, d), d),
|
|
264
|
+
l(E(R, d), d)
|
|
265
265
|
) || (n == null || n(
|
|
266
|
-
|
|
266
|
+
d,
|
|
267
267
|
new Error(
|
|
268
|
-
`[rjsf-formulas] Formula at [${
|
|
268
|
+
`[rjsf-formulas] Formula at [${d.join(", ")}] did not converge after ${s} passes`
|
|
269
269
|
)
|
|
270
|
-
), B(
|
|
271
|
-
return
|
|
270
|
+
), B(_, d, void 0));
|
|
271
|
+
return _;
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function It(t) {
|
|
274
274
|
return JSON.stringify(t);
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
const [
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
}, [o]),
|
|
276
|
+
function $t(t, r, e, s, n, o, i, u, f, l, c, a) {
|
|
277
|
+
const [y, h] = lt(t), x = g(t), R = g(t), _ = g(/* @__PURE__ */ new Map()), p = g(null), d = g(!1), j = g(o), A = g(i), b = g(e), J = g(r), z = g(n), P = g(u), v = g(f), D = g(l), F = g(a);
|
|
278
|
+
m(() => {
|
|
279
|
+
j.current = o;
|
|
280
|
+
}, [o]), m(() => {
|
|
281
281
|
A.current = i;
|
|
282
|
-
}, [i]),
|
|
282
|
+
}, [i]), m(() => {
|
|
283
283
|
b.current = e;
|
|
284
|
-
}, [e]),
|
|
285
|
-
|
|
286
|
-
}, [r]),
|
|
287
|
-
|
|
288
|
-
}, [n]),
|
|
289
|
-
|
|
290
|
-
}, [u]),
|
|
284
|
+
}, [e]), m(() => {
|
|
285
|
+
J.current = r;
|
|
286
|
+
}, [r]), m(() => {
|
|
287
|
+
z.current = n;
|
|
288
|
+
}, [n]), m(() => {
|
|
289
|
+
P.current = u;
|
|
290
|
+
}, [u]), m(() => {
|
|
291
291
|
v.current = f;
|
|
292
|
-
}, [f]),
|
|
293
|
-
|
|
294
|
-
}, [l]),
|
|
295
|
-
|
|
292
|
+
}, [f]), m(() => {
|
|
293
|
+
D.current = l;
|
|
294
|
+
}, [l]), m(() => {
|
|
295
|
+
F.current = a;
|
|
296
296
|
}, [a]);
|
|
297
|
-
const
|
|
298
|
-
if (
|
|
297
|
+
const X = K(() => {
|
|
298
|
+
if (d.current) return;
|
|
299
299
|
(async () => {
|
|
300
|
-
var
|
|
301
|
-
|
|
300
|
+
var I, V;
|
|
301
|
+
d.current = !0;
|
|
302
302
|
try {
|
|
303
303
|
for (; ; ) {
|
|
304
|
-
const T =
|
|
305
|
-
(
|
|
304
|
+
const T = x.current, rt = J.current, ot = rt.filter(
|
|
305
|
+
(k) => k.condition === !0 || v.current(k.condition, T)
|
|
306
306
|
), N = [];
|
|
307
|
-
for (const
|
|
308
|
-
for (const it of
|
|
307
|
+
for (const k of ot)
|
|
308
|
+
for (const it of q(k.path, T))
|
|
309
309
|
N.push(it);
|
|
310
|
-
const
|
|
311
|
-
|
|
312
|
-
for (const
|
|
313
|
-
N.length > 0 && ((
|
|
310
|
+
const G = _.current;
|
|
311
|
+
G.clear();
|
|
312
|
+
for (const k of N) G.set(It(k), "running");
|
|
313
|
+
N.length > 0 && ((I = A.current) == null || I.call(A, N));
|
|
314
314
|
const ft = await bt(
|
|
315
315
|
T,
|
|
316
316
|
rt,
|
|
317
317
|
b.current,
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
318
|
+
z.current,
|
|
319
|
+
j.current,
|
|
320
|
+
P.current.formulaDataKey,
|
|
321
|
+
P.current.formulaPathKey,
|
|
322
322
|
v.current,
|
|
323
|
-
|
|
324
|
-
|
|
323
|
+
D.current,
|
|
324
|
+
F.current
|
|
325
325
|
);
|
|
326
|
-
if (
|
|
327
|
-
const ct = [...
|
|
328
|
-
if (
|
|
329
|
-
|
|
326
|
+
if (Y.current) break;
|
|
327
|
+
const ct = [...G.values()].some((k) => k === "dirty");
|
|
328
|
+
if (G.clear(), !ct) {
|
|
329
|
+
h(ft), N.length > 0 && ((V = A.current) == null || V.call(A, []));
|
|
330
330
|
break;
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
} finally {
|
|
334
|
-
|
|
334
|
+
d.current = !1;
|
|
335
335
|
}
|
|
336
336
|
})();
|
|
337
|
-
}, []), $ =
|
|
338
|
-
(
|
|
339
|
-
|
|
340
|
-
const
|
|
341
|
-
for (const [
|
|
342
|
-
T === "running" &&
|
|
343
|
-
|
|
344
|
-
p.current = null,
|
|
337
|
+
}, []), $ = K(
|
|
338
|
+
(w) => {
|
|
339
|
+
x.current = w, h(w);
|
|
340
|
+
const I = _.current;
|
|
341
|
+
for (const [V, T] of I)
|
|
342
|
+
T === "running" && I.set(V, "dirty");
|
|
343
|
+
d.current || (p.current !== null && clearTimeout(p.current), p.current = setTimeout(() => {
|
|
344
|
+
p.current = null, X();
|
|
345
345
|
}, s));
|
|
346
346
|
},
|
|
347
|
-
[s,
|
|
348
|
-
),
|
|
349
|
-
return
|
|
350
|
-
|
|
351
|
-
}),
|
|
352
|
-
|
|
353
|
-
}), []), { enrichedFormData:
|
|
347
|
+
[s, X]
|
|
348
|
+
), M = g(!1), Y = g(!1);
|
|
349
|
+
return m(() => {
|
|
350
|
+
M.current ? tt(t, R.current) || (R.current = t, $(t)) : (M.current = !0, R.current = t, c !== "skip" && $(t));
|
|
351
|
+
}), m(() => (Y.current = !1, () => {
|
|
352
|
+
Y.current = !0, M.current = !1, p.current !== null && clearTimeout(p.current);
|
|
353
|
+
}), []), { enrichedFormData: y, handleInput: $ };
|
|
354
354
|
}
|
|
355
355
|
function kt(t, r) {
|
|
356
|
-
const e = structuredClone(t ?? {}), s =
|
|
356
|
+
const e = structuredClone(t ?? {}), s = _t(r);
|
|
357
357
|
for (const n of r)
|
|
358
358
|
S(e, n.path, s);
|
|
359
359
|
return e;
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function _t(t) {
|
|
362
362
|
const r = /* @__PURE__ */ new Set();
|
|
363
363
|
for (let e = 0; e < t.length; e++) {
|
|
364
364
|
const s = t[e].path;
|
|
365
365
|
for (let n = 0; n < s.length; n++) {
|
|
366
366
|
const o = s[n];
|
|
367
|
-
if (typeof o != "number" && o !==
|
|
367
|
+
if (typeof o != "number" && o !== U) continue;
|
|
368
368
|
const i = C(s.slice(0, n)), u = typeof o == "number";
|
|
369
369
|
t.some((l, c) => {
|
|
370
370
|
if (c === e || l.path.length <= n || C(l.path.slice(0, n)) !== i) return !1;
|
|
371
371
|
const a = l.path[n];
|
|
372
|
-
return u ? a ===
|
|
372
|
+
return u ? a === U : typeof a == "number";
|
|
373
373
|
}) && r.add(i);
|
|
374
374
|
}
|
|
375
375
|
}
|
|
@@ -409,86 +409,92 @@ function S(t, r, e, s = []) {
|
|
|
409
409
|
(!t.items || typeof t.items != "object") && (t.items = {}), S(t.items, o, e, [...s, n]);
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function vt(t, r) {
|
|
413
413
|
const {
|
|
414
414
|
schema: e,
|
|
415
415
|
formData: s,
|
|
416
416
|
validator: n,
|
|
417
417
|
uiSchema: o,
|
|
418
418
|
evaluator: i,
|
|
419
|
-
Form: u =
|
|
419
|
+
Form: u = dt,
|
|
420
420
|
formulaKey: f = "x-formula",
|
|
421
421
|
formulaContextKey: l = "x-formula-context",
|
|
422
422
|
formulaDataKey: c = "__formData__",
|
|
423
423
|
formulaPathKey: a = "__path__",
|
|
424
|
-
maxConvergencePasses:
|
|
425
|
-
debounceMs:
|
|
426
|
-
onFormulaError:
|
|
424
|
+
maxConvergencePasses: y = 10,
|
|
425
|
+
debounceMs: h = 300,
|
|
426
|
+
onFormulaError: x,
|
|
427
427
|
onLoadingChange: R,
|
|
428
|
-
formulaConflictBehavior:
|
|
428
|
+
formulaConflictBehavior: _ = "warn",
|
|
429
429
|
initialComputationMode: p = "always",
|
|
430
|
-
convergenceKey:
|
|
431
|
-
onChange:
|
|
430
|
+
convergenceKey: d = (w) => w,
|
|
431
|
+
onChange: j,
|
|
432
432
|
...A
|
|
433
|
-
} = t, b =
|
|
434
|
-
() =>
|
|
433
|
+
} = t, b = Q(
|
|
434
|
+
() => yt(e, { formulaKey: f, formulaContextKey: l }),
|
|
435
435
|
[e, f, l]
|
|
436
|
-
),
|
|
436
|
+
), J = Q(
|
|
437
437
|
() => ({ formulaDataKey: c, formulaPathKey: a }),
|
|
438
438
|
[c, a]
|
|
439
|
-
),
|
|
439
|
+
), z = Q(
|
|
440
440
|
() => kt(o, b),
|
|
441
441
|
[o, b]
|
|
442
|
-
),
|
|
443
|
-
(w,
|
|
442
|
+
), P = K(
|
|
443
|
+
(w, I) => n.isValid(w, I, e),
|
|
444
444
|
[n, e]
|
|
445
|
-
), v = p === "always" ? 0 : p === "skip" ? 1 : 2,
|
|
446
|
-
|
|
447
|
-
|
|
445
|
+
), v = p === "always" ? 0 : p === "skip" ? 1 : 2, D = g(v);
|
|
446
|
+
m(() => (D.current = v, () => {
|
|
447
|
+
D.current = v;
|
|
448
448
|
}), []);
|
|
449
|
-
const { enrichedFormData:
|
|
449
|
+
const { enrichedFormData: F, handleInput: X } = $t(
|
|
450
450
|
s,
|
|
451
451
|
b,
|
|
452
452
|
i,
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
453
|
+
h,
|
|
454
|
+
y,
|
|
455
|
+
x,
|
|
456
456
|
R,
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
457
|
+
J,
|
|
458
|
+
P,
|
|
459
|
+
_,
|
|
460
460
|
p,
|
|
461
|
-
|
|
462
|
-
), $ =
|
|
463
|
-
|
|
464
|
-
$.current =
|
|
465
|
-
}, [
|
|
461
|
+
d
|
|
462
|
+
), $ = g(j);
|
|
463
|
+
m(() => {
|
|
464
|
+
$.current = j;
|
|
465
|
+
}, [j]);
|
|
466
|
+
const M = g(!1);
|
|
467
|
+
return m(() => {
|
|
466
468
|
var w;
|
|
467
469
|
if (b.length !== 0) {
|
|
468
|
-
if (
|
|
469
|
-
|
|
470
|
+
if (M.current) {
|
|
471
|
+
M.current = !1;
|
|
470
472
|
return;
|
|
471
473
|
}
|
|
472
|
-
|
|
474
|
+
if (D.current > 0) {
|
|
475
|
+
D.current--;
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
(w = $.current) == null || w.call($, { formData: F }, void 0);
|
|
473
479
|
}
|
|
474
|
-
}, [
|
|
480
|
+
}, [F]), /* @__PURE__ */ at(
|
|
475
481
|
u,
|
|
476
482
|
{
|
|
477
483
|
ref: r,
|
|
478
484
|
...A,
|
|
479
485
|
schema: e,
|
|
480
486
|
validator: n,
|
|
481
|
-
formData:
|
|
482
|
-
uiSchema:
|
|
483
|
-
onChange: (w,
|
|
484
|
-
|
|
487
|
+
formData: F,
|
|
488
|
+
uiSchema: z,
|
|
489
|
+
onChange: (w, I) => {
|
|
490
|
+
M.current = !0, X(w.formData), j == null || j(w, I);
|
|
485
491
|
}
|
|
486
492
|
}
|
|
487
493
|
);
|
|
488
494
|
}
|
|
489
|
-
const qt = pt(
|
|
495
|
+
const qt = pt(vt);
|
|
490
496
|
export {
|
|
491
497
|
qt as FormulaForm,
|
|
492
|
-
|
|
498
|
+
yt as analyzeSchema
|
|
493
499
|
};
|
|
494
500
|
//# sourceMappingURL=index.mjs.map
|