@reformer/renderer-json 9.0.0-beta.1 → 9.0.0-beta.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-Bu5XPCQ7.js → index-DrpWfdbU.js} +24 -14
- package/dist/index.d.ts +11 -4
- package/dist/index.js +541 -162
- package/dist/locale/i18n.d.ts +21 -0
- package/dist/locale/locale-context.d.ts +36 -0
- package/dist/locale/locale-service.d.ts +76 -0
- package/dist/locale/locale-service.test.d.ts +1 -0
- package/dist/locale/use-signal-value.d.ts +15 -0
- package/dist/locale/use-signal-value.test.d.ts +1 -0
- package/dist/operators.d.ts +37 -3
- package/dist/operators.test.d.ts +1 -0
- package/dist/registry/component-registry.d.ts +2 -0
- package/dist/registry/component-registry.test.d.ts +1 -0
- package/dist/registry/constants.d.ts +17 -0
- package/dist/registry/types.d.ts +24 -3
- package/dist/schema/index.d.ts +18 -0
- package/dist/validate.d.ts +5 -1
- package/dist/validate.js +1156 -1155
- package/llms.txt +663 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,171 +1,229 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useContext as
|
|
3
|
-
import { createRenderSchema as
|
|
4
|
-
import { i as
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { jsx as v, jsxs as M } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as N, createContext as V, useMemo as x, useState as Y, useEffect as tt, useRef as et, useCallback as A, useSyncExternalStore as nt } from "react";
|
|
3
|
+
import { createRenderSchema as rt, FormRenderer as ot } from "@reformer/renderer-react";
|
|
4
|
+
import { i as h, a as C, p as u, b as it, c as st, d as ft } from "./index-DrpWfdbU.js";
|
|
5
|
+
import { e as Zt, f as Kt, g as Tt, h as zt, j as Bt, k as Gt } from "./index-DrpWfdbU.js";
|
|
6
|
+
const ct = "$fieldWrapper", D = "$localeService";
|
|
7
|
+
class p {
|
|
7
8
|
own = /* @__PURE__ */ new Map();
|
|
8
9
|
parent = null;
|
|
9
10
|
get(e) {
|
|
10
11
|
return this.own.get(e) ?? this.parent?.get(e);
|
|
11
12
|
}
|
|
12
13
|
getDataSource(e) {
|
|
13
|
-
const
|
|
14
|
-
if (!(!
|
|
15
|
-
return
|
|
14
|
+
const n = this.get(e);
|
|
15
|
+
if (!(!n || n.type !== "dataSource"))
|
|
16
|
+
return n.component;
|
|
17
|
+
}
|
|
18
|
+
getLocale() {
|
|
19
|
+
const e = this.get(D);
|
|
20
|
+
if (!(!e || e.type !== "locale"))
|
|
21
|
+
return e.component;
|
|
16
22
|
}
|
|
17
23
|
has(e) {
|
|
18
24
|
return this.own.has(e) || (this.parent?.has(e) ?? !1);
|
|
19
25
|
}
|
|
20
26
|
names() {
|
|
21
|
-
const e = this.parent?.names() ?? [],
|
|
22
|
-
return [.../* @__PURE__ */ new Set([...e, ...
|
|
27
|
+
const e = this.parent?.names() ?? [], n = Array.from(this.own.keys());
|
|
28
|
+
return [.../* @__PURE__ */ new Set([...e, ...n])];
|
|
23
29
|
}
|
|
24
|
-
_set(e,
|
|
25
|
-
this.own.has(e) && console.warn(`[ComponentRegistry] Overwriting entry: ${e}`), this.own.set(e,
|
|
30
|
+
_set(e, n) {
|
|
31
|
+
this.own.has(e) && console.warn(`[ComponentRegistry] Overwriting entry: ${e}`), this.own.set(e, n);
|
|
26
32
|
}
|
|
27
|
-
static withParent(e,
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
|
|
33
|
+
static withParent(e, n) {
|
|
34
|
+
const r = new p(), o = (i) => {
|
|
35
|
+
if (i instanceof p)
|
|
36
|
+
i.own.forEach((f, a) => r.own.set(a, f));
|
|
31
37
|
else
|
|
32
|
-
for (const
|
|
33
|
-
const a =
|
|
34
|
-
a &&
|
|
38
|
+
for (const f of i.names()) {
|
|
39
|
+
const a = i.get(f);
|
|
40
|
+
a && r.own.set(f, a);
|
|
35
41
|
}
|
|
36
42
|
};
|
|
37
|
-
return e instanceof
|
|
43
|
+
return e instanceof p ? r.parent = e : o(e), o(n), r;
|
|
38
44
|
}
|
|
39
45
|
}
|
|
40
|
-
function
|
|
41
|
-
const e = new
|
|
42
|
-
return
|
|
43
|
-
component(
|
|
44
|
-
e._set(
|
|
46
|
+
function Jt(t) {
|
|
47
|
+
const e = new p();
|
|
48
|
+
return t({
|
|
49
|
+
component(r, o, i) {
|
|
50
|
+
e._set(r, { component: o, type: "component", description: i });
|
|
51
|
+
},
|
|
52
|
+
dataSource(r, o, i) {
|
|
53
|
+
e._set(r, { component: o, type: "dataSource", description: i });
|
|
54
|
+
},
|
|
55
|
+
fn(r, o, i) {
|
|
56
|
+
if (typeof o != "function")
|
|
57
|
+
throw new Error(
|
|
58
|
+
`reg.fn("${r}") expects a function, got ${typeof o}. Use reg.dataSource(...) for non-function values.`
|
|
59
|
+
);
|
|
60
|
+
e._set(r, { component: o, type: "fn", description: i });
|
|
45
61
|
},
|
|
46
|
-
|
|
47
|
-
|
|
62
|
+
locale(r, o) {
|
|
63
|
+
const i = typeof r == "function" ? { resolve: r } : r;
|
|
64
|
+
e._set(D, { component: i, type: "locale", description: o });
|
|
48
65
|
}
|
|
49
66
|
}), e;
|
|
50
67
|
}
|
|
51
|
-
const
|
|
52
|
-
function
|
|
53
|
-
const
|
|
54
|
-
const
|
|
68
|
+
const j = V({});
|
|
69
|
+
function Ft({ settings: t, children: e }) {
|
|
70
|
+
const n = N(j), r = x(() => n.registry && t.registry ? p.withParent(n.registry, t.registry) : t.registry ?? n.registry, [n.registry, t.registry]), o = x(() => {
|
|
71
|
+
const i = r?.get(ct)?.component;
|
|
55
72
|
return {
|
|
73
|
+
...n,
|
|
56
74
|
...t,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
fieldWrapper: r.fieldWrapper ?? s ?? t.fieldWrapper
|
|
75
|
+
registry: r,
|
|
76
|
+
fieldWrapper: t.fieldWrapper ?? i ?? n.fieldWrapper
|
|
60
77
|
};
|
|
61
|
-
}, [t, r
|
|
62
|
-
return /* @__PURE__ */
|
|
78
|
+
}, [n, t, r]);
|
|
79
|
+
return /* @__PURE__ */ v(j.Provider, { value: o, children: e });
|
|
63
80
|
}
|
|
64
|
-
function
|
|
65
|
-
return
|
|
81
|
+
function at() {
|
|
82
|
+
return N(j);
|
|
66
83
|
}
|
|
67
|
-
function
|
|
68
|
-
const e =
|
|
69
|
-
return
|
|
84
|
+
function I(t) {
|
|
85
|
+
const e = t;
|
|
86
|
+
return h(e.array) && typeof e.item == "object" && e.item !== null && "$template" in e.item;
|
|
70
87
|
}
|
|
71
|
-
function
|
|
72
|
-
return
|
|
88
|
+
function _(t) {
|
|
89
|
+
return h(t.value);
|
|
73
90
|
}
|
|
74
|
-
function
|
|
75
|
-
return
|
|
91
|
+
function ut(t) {
|
|
92
|
+
return C(t.component) && !_(t) && !I(t);
|
|
93
|
+
}
|
|
94
|
+
function E(t, e) {
|
|
95
|
+
if (!t) return;
|
|
96
|
+
const n = u(t)?.arg;
|
|
97
|
+
if (!n) throw new Error(`Invalid $component operator: "${t}"`);
|
|
98
|
+
const r = e.get(n);
|
|
99
|
+
if (!r)
|
|
100
|
+
throw new Error(
|
|
101
|
+
`Component "${n}" not found in registry. Available: ${e.names().join(", ")}`
|
|
102
|
+
);
|
|
103
|
+
if (r.type !== "component")
|
|
104
|
+
throw new Error(`Entry "${n}" is a '${r.type}' and cannot be used as $component(...)`);
|
|
105
|
+
return r.component;
|
|
76
106
|
}
|
|
77
|
-
function
|
|
78
|
-
if (!r) return;
|
|
79
|
-
const t = d(r)?.arg;
|
|
80
|
-
if (!t) throw new Error(`Invalid $component operator: "${r}"`);
|
|
107
|
+
function lt(t, e) {
|
|
81
108
|
const n = e.get(t);
|
|
82
109
|
if (!n)
|
|
83
110
|
throw new Error(
|
|
84
|
-
`
|
|
111
|
+
`Data source "${t}" not found in registry. Available: ${e.names().join(", ")}`
|
|
85
112
|
);
|
|
86
|
-
if (n.type
|
|
87
|
-
throw new Error(`Entry "${t}" is a '
|
|
113
|
+
if (n.type !== "dataSource")
|
|
114
|
+
throw new Error(`Entry "${t}" is a '${n.type}' and cannot be used as $dataSource(...)`);
|
|
88
115
|
return n.component;
|
|
89
116
|
}
|
|
90
|
-
function
|
|
91
|
-
const
|
|
92
|
-
if (!
|
|
117
|
+
function ht(t, e) {
|
|
118
|
+
const n = e.get(t);
|
|
119
|
+
if (!n)
|
|
93
120
|
throw new Error(
|
|
94
|
-
`
|
|
121
|
+
`Function "${t}" not found in registry. Available: ${e.names().join(", ")}`
|
|
95
122
|
);
|
|
96
|
-
if (
|
|
97
|
-
throw new Error(`Entry "${
|
|
98
|
-
return
|
|
99
|
-
}
|
|
100
|
-
function
|
|
101
|
-
return e.
|
|
102
|
-
}
|
|
103
|
-
function
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
123
|
+
if (n.type !== "fn")
|
|
124
|
+
throw new Error(`Entry "${t}" is a '${n.type}' and cannot be used as $fn(...)`);
|
|
125
|
+
return n.component;
|
|
126
|
+
}
|
|
127
|
+
function W(t, e, n) {
|
|
128
|
+
return e.getLocale?.()?.resolve(t, n) ?? t;
|
|
129
|
+
}
|
|
130
|
+
function dt(t) {
|
|
131
|
+
return t !== null && typeof t == "object" && typeof t.$locale == "string";
|
|
132
|
+
}
|
|
133
|
+
function pt(t, e) {
|
|
134
|
+
if (!t) return t;
|
|
135
|
+
let n = !1;
|
|
136
|
+
const r = {};
|
|
137
|
+
for (const o of Object.keys(t)) {
|
|
138
|
+
const i = t[o];
|
|
139
|
+
if (h(i)) {
|
|
140
|
+
const f = e.signalAt(u(i).arg);
|
|
141
|
+
r[o] = f?.peek?.(), n = !0;
|
|
142
|
+
} else
|
|
143
|
+
r[o] = i;
|
|
144
|
+
}
|
|
145
|
+
return n ? r : t;
|
|
146
|
+
}
|
|
147
|
+
function vt(t, e) {
|
|
148
|
+
if (!(!e || typeof console > "u"))
|
|
149
|
+
for (const n of Object.keys(e))
|
|
150
|
+
h(e[n]) && console.warn(
|
|
151
|
+
`[JsonRenderer] $locale("${t}"): параметр "${n}" (=${String(e[n])}) взят снимком значения на момент рендера и не обновляется при изменении модели. Для реактивного значения используй I18n: { component: "$component(I18n)", componentProps: { id: "${t}", values: { ${n}: "${String(e[n])}" } } }.`
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
function mt(t, e) {
|
|
155
|
+
return e.split(".").reduce((n, r) => n == null ? n : n[r], t);
|
|
156
|
+
}
|
|
157
|
+
function yt(t) {
|
|
158
|
+
if (t === null || typeof t != "object") return !1;
|
|
159
|
+
const e = t;
|
|
160
|
+
return h(e.value) || h(e.array) || C(e.component);
|
|
161
|
+
}
|
|
162
|
+
function gt(t) {
|
|
163
|
+
return t == null ? t : JSON.parse(JSON.stringify(t));
|
|
164
|
+
}
|
|
165
|
+
function L(t, e, n) {
|
|
166
|
+
if (it(t)) return lt(u(t).arg, n);
|
|
167
|
+
if (C(t)) return E(t, n);
|
|
168
|
+
if (st(t)) return ht(u(t).arg, n);
|
|
169
|
+
if (ft(t)) return W(u(t).arg, n);
|
|
170
|
+
if (h(t)) return e.signalAt(u(t).arg);
|
|
171
|
+
if (dt(t))
|
|
172
|
+
return vt(t.$locale, t.params), W(t.$locale, n, pt(t.params, e));
|
|
173
|
+
if (yt(t)) return b(t, e, n);
|
|
174
|
+
if (Array.isArray(t)) return t.map((r) => L(r, e, n));
|
|
175
|
+
if (t !== null && typeof t == "object") {
|
|
176
|
+
const r = t, o = {};
|
|
177
|
+
for (const i of Object.keys(r)) o[i] = L(r[i], e, n);
|
|
120
178
|
return o;
|
|
121
179
|
}
|
|
122
|
-
return
|
|
180
|
+
return t;
|
|
123
181
|
}
|
|
124
|
-
function
|
|
125
|
-
if (!
|
|
126
|
-
const
|
|
127
|
-
for (const o of Object.keys(
|
|
128
|
-
return
|
|
182
|
+
function R(t, e, n) {
|
|
183
|
+
if (!t) return;
|
|
184
|
+
const r = {};
|
|
185
|
+
for (const o of Object.keys(t)) r[o] = L(t[o], e, n);
|
|
186
|
+
return r;
|
|
129
187
|
}
|
|
130
|
-
function
|
|
131
|
-
if (
|
|
132
|
-
const
|
|
188
|
+
function b(t, e, n) {
|
|
189
|
+
if (I(t)) {
|
|
190
|
+
const r = mt(e, u(t.array).arg), o = t.item.$template, i = t.initialValue;
|
|
133
191
|
return {
|
|
134
|
-
...
|
|
135
|
-
array:
|
|
136
|
-
initialValue: () =>
|
|
137
|
-
item: (
|
|
138
|
-
componentProps:
|
|
192
|
+
...t.selector ? { selector: t.selector } : {},
|
|
193
|
+
array: r,
|
|
194
|
+
initialValue: () => i ? gt(i) : {},
|
|
195
|
+
item: (f) => b(o, f, n),
|
|
196
|
+
componentProps: R(t.componentProps, e, n)
|
|
139
197
|
};
|
|
140
198
|
}
|
|
141
|
-
if (
|
|
142
|
-
const
|
|
143
|
-
!o && typeof console < "u" && console.warn(`[JsonRenderer/M1] No model signal for "${
|
|
144
|
-
const
|
|
199
|
+
if (_(t)) {
|
|
200
|
+
const r = u(t.value).arg, o = e.signalAt(r);
|
|
201
|
+
!o && typeof console < "u" && console.warn(`[JsonRenderer/M1] No model signal for "${r}".`);
|
|
202
|
+
const i = R(t.componentProps, e, n), f = t.wrapper ? E(t.wrapper.component, n) : void 0;
|
|
145
203
|
return {
|
|
146
|
-
...
|
|
204
|
+
...t.selector ? { selector: t.selector } : {},
|
|
147
205
|
value: o,
|
|
148
|
-
component:
|
|
149
|
-
componentProps:
|
|
206
|
+
component: E(t.component, n),
|
|
207
|
+
componentProps: f ? { ...i ?? {}, fieldWrapper: f } : i
|
|
150
208
|
};
|
|
151
209
|
}
|
|
152
|
-
if (
|
|
210
|
+
if (ut(t))
|
|
153
211
|
return {
|
|
154
|
-
...
|
|
155
|
-
component:
|
|
156
|
-
componentProps:
|
|
157
|
-
children:
|
|
212
|
+
...t.selector ? { selector: t.selector } : {},
|
|
213
|
+
component: E(t.component, n),
|
|
214
|
+
componentProps: R(t.componentProps, e, n),
|
|
215
|
+
children: t.children?.map((r) => b(r, e, n))
|
|
158
216
|
};
|
|
159
|
-
throw new Error(`Invalid JSON node (M1): ${JSON.stringify(
|
|
217
|
+
throw new Error(`Invalid JSON node (M1): ${JSON.stringify(t)}`);
|
|
160
218
|
}
|
|
161
|
-
function
|
|
162
|
-
return
|
|
219
|
+
function Mt(t, e, n) {
|
|
220
|
+
return b(t.root, n, e);
|
|
163
221
|
}
|
|
164
|
-
function
|
|
165
|
-
return () =>
|
|
222
|
+
function St(t, e, n) {
|
|
223
|
+
return () => b(t.root, n, e);
|
|
166
224
|
}
|
|
167
|
-
function
|
|
168
|
-
return /* @__PURE__ */
|
|
225
|
+
function wt({ errors: t }) {
|
|
226
|
+
return /* @__PURE__ */ M(
|
|
169
227
|
"div",
|
|
170
228
|
{
|
|
171
229
|
role: "alert",
|
|
@@ -179,43 +237,43 @@ function I({ errors: r }) {
|
|
|
179
237
|
font: "14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace"
|
|
180
238
|
},
|
|
181
239
|
children: [
|
|
182
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ M("strong", { style: { display: "block", marginBottom: 8, fontSize: 15 }, children: [
|
|
183
241
|
"Невалидная JSON-схема формы (",
|
|
184
|
-
|
|
242
|
+
t.length,
|
|
185
243
|
")"
|
|
186
244
|
] }),
|
|
187
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ v("ul", { style: { margin: 0, paddingLeft: 20 }, children: t.map((e, n) => /* @__PURE__ */ v("li", { style: { marginBottom: 4 }, children: e }, n)) })
|
|
188
246
|
]
|
|
189
247
|
}
|
|
190
248
|
);
|
|
191
249
|
}
|
|
192
|
-
function
|
|
193
|
-
schema:
|
|
250
|
+
function At({
|
|
251
|
+
schema: t,
|
|
194
252
|
renderBehavior: e,
|
|
195
|
-
onSchemaReady:
|
|
196
|
-
validate:
|
|
253
|
+
onSchemaReady: n,
|
|
254
|
+
validate: r = !1
|
|
197
255
|
}) {
|
|
198
|
-
const { registry: o, model:
|
|
199
|
-
|
|
256
|
+
const { registry: o, model: i, ...f } = at(), [a, $] = Y(
|
|
257
|
+
r ? void 0 : null
|
|
200
258
|
);
|
|
201
|
-
|
|
202
|
-
if (!
|
|
203
|
-
|
|
259
|
+
tt(() => {
|
|
260
|
+
if (!r) {
|
|
261
|
+
$(null);
|
|
204
262
|
return;
|
|
205
263
|
}
|
|
206
|
-
let
|
|
207
|
-
return
|
|
208
|
-
if (
|
|
209
|
-
const { valid:
|
|
210
|
-
|
|
211
|
-
}).catch((
|
|
212
|
-
|
|
264
|
+
let S = !1;
|
|
265
|
+
return $(void 0), import("./validate.js").then(({ validateFormSchema: d }) => {
|
|
266
|
+
if (S) return;
|
|
267
|
+
const { valid: Q, errors: X } = d(t, { registry: o });
|
|
268
|
+
$(Q ? null : X);
|
|
269
|
+
}).catch((d) => {
|
|
270
|
+
S || $([`Schema validator failed to load: ${String(d)}`]);
|
|
213
271
|
}), () => {
|
|
214
|
-
|
|
272
|
+
S = !0;
|
|
215
273
|
};
|
|
216
|
-
}, [
|
|
217
|
-
const
|
|
218
|
-
if (!
|
|
274
|
+
}, [r, t, o]);
|
|
275
|
+
const g = x(() => {
|
|
276
|
+
if (!i)
|
|
219
277
|
throw new Error(
|
|
220
278
|
"JsonFormRenderer: settings.model is required (M1). Pass the FormModel via JsonRendererProvider."
|
|
221
279
|
);
|
|
@@ -224,31 +282,352 @@ function X({
|
|
|
224
282
|
throw new Error(
|
|
225
283
|
"JsonFormRenderer: settings.registry is required. Pass a ComponentRegistry via JsonRendererProvider."
|
|
226
284
|
);
|
|
227
|
-
const
|
|
228
|
-
return e && e(
|
|
229
|
-
}, [
|
|
230
|
-
return
|
|
231
|
-
|
|
232
|
-
}, [
|
|
285
|
+
const S = St(t, o, i), d = rt(S);
|
|
286
|
+
return e && e(d), d;
|
|
287
|
+
}, [t, o, e, i, a]);
|
|
288
|
+
return x(() => {
|
|
289
|
+
g && n && n(g);
|
|
290
|
+
}, [g]), a && a.length > 0 ? /* @__PURE__ */ v(wt, { errors: a }) : g ? /* @__PURE__ */ v(ot, { render: g, settings: f }) : null;
|
|
291
|
+
}
|
|
292
|
+
const Wt = (t) => t;
|
|
293
|
+
function Ut(t) {
|
|
294
|
+
return { resolve: (e) => t[e] ?? e, keys: Object.keys(t) };
|
|
295
|
+
}
|
|
296
|
+
function Vt(t) {
|
|
297
|
+
return { resolve: (e, n) => t[e]?.(n) ?? e, keys: Object.keys(t) };
|
|
298
|
+
}
|
|
299
|
+
const bt = { resolve: (t) => t }, q = V(bt);
|
|
300
|
+
function Dt({ service: t, children: e }) {
|
|
301
|
+
return /* @__PURE__ */ v(q.Provider, { value: t, children: e });
|
|
302
|
+
}
|
|
303
|
+
function $t() {
|
|
304
|
+
return N(q);
|
|
305
|
+
}
|
|
306
|
+
var Et = Symbol.for("preact-signals");
|
|
307
|
+
function J() {
|
|
308
|
+
if (l > 1)
|
|
309
|
+
l--;
|
|
310
|
+
else {
|
|
311
|
+
var t, e = !1;
|
|
312
|
+
for ((function() {
|
|
313
|
+
var o = P;
|
|
314
|
+
for (P = void 0; o !== void 0; )
|
|
315
|
+
o.S.v === o.v && (o.S.i = o.i), o = o.o;
|
|
316
|
+
})(); w !== void 0; ) {
|
|
317
|
+
var n = w;
|
|
318
|
+
for (w = void 0, O++; n !== void 0; ) {
|
|
319
|
+
var r = n.u;
|
|
320
|
+
if (n.u = void 0, n.f &= -3, !(8 & n.f) && T(n)) try {
|
|
321
|
+
n.c();
|
|
322
|
+
} catch (o) {
|
|
323
|
+
e || (t = o, e = !0);
|
|
324
|
+
}
|
|
325
|
+
n = r;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
if (O = 0, l--, e) throw t;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
var s = void 0;
|
|
332
|
+
function Z(t) {
|
|
333
|
+
var e = s;
|
|
334
|
+
s = void 0;
|
|
335
|
+
try {
|
|
336
|
+
return t();
|
|
337
|
+
} finally {
|
|
338
|
+
s = e;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
var w = void 0, l = 0, O = 0, U = 0, P = void 0, k = 0;
|
|
342
|
+
function K(t) {
|
|
343
|
+
if (s !== void 0) {
|
|
344
|
+
var e = t.n;
|
|
345
|
+
if (e === void 0 || e.t !== s)
|
|
346
|
+
return e = { i: 0, S: t, p: s.s, n: void 0, t: s, e: void 0, x: void 0, r: e }, s.s !== void 0 && (s.s.n = e), s.s = e, t.n = e, 32 & s.f && t.S(e), e;
|
|
347
|
+
if (e.i === -1)
|
|
348
|
+
return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = s.s, e.n = void 0, s.s.n = e, s.s = e), e;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
function c(t, e) {
|
|
352
|
+
this.v = t, this.i = 0, this.n = void 0, this.t = void 0, this.l = 0, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
|
|
353
|
+
}
|
|
354
|
+
c.prototype.brand = Et;
|
|
355
|
+
c.prototype.h = function() {
|
|
356
|
+
return !0;
|
|
357
|
+
};
|
|
358
|
+
c.prototype.S = function(t) {
|
|
359
|
+
var e = this, n = this.t;
|
|
360
|
+
n !== t && t.e === void 0 && (t.x = n, this.t = t, n !== void 0 ? n.e = t : Z(function() {
|
|
361
|
+
var r;
|
|
362
|
+
(r = e.W) == null || r.call(e);
|
|
363
|
+
}));
|
|
364
|
+
};
|
|
365
|
+
c.prototype.U = function(t) {
|
|
366
|
+
var e = this;
|
|
367
|
+
if (this.t !== void 0) {
|
|
368
|
+
var n = t.e, r = t.x;
|
|
369
|
+
n !== void 0 && (n.x = r, t.e = void 0), r !== void 0 && (r.e = n, t.x = void 0), t === this.t && (this.t = r, r === void 0 && Z(function() {
|
|
370
|
+
var o;
|
|
371
|
+
(o = e.Z) == null || o.call(e);
|
|
372
|
+
}));
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
c.prototype.subscribe = function(t) {
|
|
376
|
+
var e = this;
|
|
377
|
+
return H(function() {
|
|
378
|
+
var n = e.value, r = s;
|
|
379
|
+
s = void 0;
|
|
380
|
+
try {
|
|
381
|
+
t(n);
|
|
382
|
+
} finally {
|
|
383
|
+
s = r;
|
|
384
|
+
}
|
|
385
|
+
}, { name: "sub" });
|
|
386
|
+
};
|
|
387
|
+
c.prototype.valueOf = function() {
|
|
388
|
+
return this.value;
|
|
389
|
+
};
|
|
390
|
+
c.prototype.toString = function() {
|
|
391
|
+
return this.value + "";
|
|
392
|
+
};
|
|
393
|
+
c.prototype.toJSON = function() {
|
|
394
|
+
return this.value;
|
|
395
|
+
};
|
|
396
|
+
c.prototype.peek = function() {
|
|
397
|
+
var t = s;
|
|
398
|
+
s = void 0;
|
|
399
|
+
try {
|
|
400
|
+
return this.value;
|
|
401
|
+
} finally {
|
|
402
|
+
s = t;
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
Object.defineProperty(c.prototype, "value", { get: function() {
|
|
406
|
+
var t = K(this);
|
|
407
|
+
return t !== void 0 && (t.i = this.i), this.v;
|
|
408
|
+
}, set: function(t) {
|
|
409
|
+
if (t !== this.v) {
|
|
410
|
+
if (O > 100) throw new Error("Cycle detected");
|
|
411
|
+
(function(n) {
|
|
412
|
+
l !== 0 && O === 0 && n.l !== U && (n.l = U, P = { S: n, v: n.v, i: n.i, o: P });
|
|
413
|
+
})(this), this.v = t, this.i++, k++, l++;
|
|
414
|
+
try {
|
|
415
|
+
for (var e = this.t; e !== void 0; e = e.x) e.t.N();
|
|
416
|
+
} finally {
|
|
417
|
+
J();
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
} });
|
|
421
|
+
function T(t) {
|
|
422
|
+
for (var e = t.s; e !== void 0; e = e.n) if (e.S.i !== e.i || !e.S.h() || e.S.i !== e.i) return !0;
|
|
423
|
+
return !1;
|
|
424
|
+
}
|
|
425
|
+
function z(t) {
|
|
426
|
+
for (var e = t.s; e !== void 0; e = e.n) {
|
|
427
|
+
var n = e.S.n;
|
|
428
|
+
if (n !== void 0 && (e.r = n), e.S.n = e, e.i = -1, e.n === void 0) {
|
|
429
|
+
t.s = e;
|
|
430
|
+
break;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
function B(t) {
|
|
435
|
+
for (var e = t.s, n = void 0; e !== void 0; ) {
|
|
436
|
+
var r = e.p;
|
|
437
|
+
e.i === -1 ? (e.S.U(e), r !== void 0 && (r.n = e.n), e.n !== void 0 && (e.n.p = r)) : n = e, e.S.n = e.r, e.r !== void 0 && (e.r = void 0), e = r;
|
|
438
|
+
}
|
|
439
|
+
t.s = n;
|
|
440
|
+
}
|
|
441
|
+
function m(t, e) {
|
|
442
|
+
c.call(this, void 0), this.x = t, this.s = void 0, this.g = k - 1, this.f = 4, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
|
|
443
|
+
}
|
|
444
|
+
m.prototype = new c();
|
|
445
|
+
m.prototype.h = function() {
|
|
446
|
+
if (this.f &= -3, 1 & this.f) return !1;
|
|
447
|
+
if ((36 & this.f) == 32 || (this.f &= -5, this.g === k)) return !0;
|
|
448
|
+
if (this.g = k, this.f |= 1, this.i > 0 && !T(this))
|
|
449
|
+
return this.f &= -2, !0;
|
|
450
|
+
var t = s;
|
|
451
|
+
try {
|
|
452
|
+
z(this), s = this;
|
|
453
|
+
var e = this.x();
|
|
454
|
+
(16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
|
|
455
|
+
} catch (n) {
|
|
456
|
+
this.v = n, this.f |= 16, this.i++;
|
|
457
|
+
}
|
|
458
|
+
return s = t, B(this), this.f &= -2, !0;
|
|
459
|
+
};
|
|
460
|
+
m.prototype.S = function(t) {
|
|
461
|
+
if (this.t === void 0) {
|
|
462
|
+
this.f |= 36;
|
|
463
|
+
for (var e = this.s; e !== void 0; e = e.n) e.S.S(e);
|
|
464
|
+
}
|
|
465
|
+
c.prototype.S.call(this, t);
|
|
466
|
+
};
|
|
467
|
+
m.prototype.U = function(t) {
|
|
468
|
+
if (this.t !== void 0 && (c.prototype.U.call(this, t), this.t === void 0)) {
|
|
469
|
+
this.f &= -33;
|
|
470
|
+
for (var e = this.s; e !== void 0; e = e.n) e.S.U(e);
|
|
471
|
+
}
|
|
472
|
+
};
|
|
473
|
+
m.prototype.N = function() {
|
|
474
|
+
if (!(2 & this.f)) {
|
|
475
|
+
this.f |= 6;
|
|
476
|
+
for (var t = this.t; t !== void 0; t = t.x) t.t.N();
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
Object.defineProperty(m.prototype, "value", { get: function() {
|
|
480
|
+
if (1 & this.f) throw new Error("Cycle detected");
|
|
481
|
+
var t = K(this);
|
|
482
|
+
if (this.h(), t !== void 0 && (t.i = this.i), 16 & this.f) throw this.v;
|
|
483
|
+
return this.v;
|
|
484
|
+
} });
|
|
485
|
+
function G(t) {
|
|
486
|
+
var e = t.m;
|
|
487
|
+
if (t.m = void 0, typeof e == "function") {
|
|
488
|
+
l++;
|
|
489
|
+
var n = s;
|
|
490
|
+
s = void 0;
|
|
491
|
+
try {
|
|
492
|
+
e();
|
|
493
|
+
} catch (r) {
|
|
494
|
+
throw t.f &= -2, t.f |= 8, F(t), r;
|
|
495
|
+
} finally {
|
|
496
|
+
s = n, J();
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
function F(t) {
|
|
501
|
+
for (var e = t.s; e !== void 0; e = e.n) e.S.U(e);
|
|
502
|
+
t.x = void 0, t.s = void 0, G(t);
|
|
503
|
+
}
|
|
504
|
+
function xt(t) {
|
|
505
|
+
if (s !== this) throw new Error("Out-of-order effect");
|
|
506
|
+
B(this), s = t, this.f &= -2, 8 & this.f && F(this), J();
|
|
507
|
+
}
|
|
508
|
+
function y(t, e) {
|
|
509
|
+
this.x = t, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = e?.name;
|
|
510
|
+
}
|
|
511
|
+
y.prototype.c = function() {
|
|
512
|
+
var t = this.S();
|
|
513
|
+
try {
|
|
514
|
+
if (8 & this.f || this.x === void 0) return;
|
|
515
|
+
var e = this.x();
|
|
516
|
+
typeof e == "function" && (this.m = e);
|
|
517
|
+
} finally {
|
|
518
|
+
t();
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
y.prototype.S = function() {
|
|
522
|
+
if (1 & this.f) throw new Error("Cycle detected");
|
|
523
|
+
this.f |= 1, this.f &= -9, G(this), z(this), l++;
|
|
524
|
+
var t = s;
|
|
525
|
+
return s = this, xt.bind(this, t);
|
|
526
|
+
};
|
|
527
|
+
y.prototype.N = function() {
|
|
528
|
+
2 & this.f || (this.f |= 2, this.u = w, w = this);
|
|
529
|
+
};
|
|
530
|
+
y.prototype.d = function() {
|
|
531
|
+
this.f |= 8, 1 & this.f || F(this);
|
|
532
|
+
};
|
|
533
|
+
y.prototype.dispose = function() {
|
|
534
|
+
this.d();
|
|
535
|
+
};
|
|
536
|
+
function H(t, e) {
|
|
537
|
+
var n = new y(t, e);
|
|
538
|
+
try {
|
|
539
|
+
n.c();
|
|
540
|
+
} catch (o) {
|
|
541
|
+
throw n.d(), o;
|
|
542
|
+
}
|
|
543
|
+
var r = n.d.bind(n);
|
|
544
|
+
return r[Symbol.dispose] = r, r;
|
|
545
|
+
}
|
|
546
|
+
function Ot(t) {
|
|
547
|
+
if (!t) return t;
|
|
548
|
+
let e = !1;
|
|
549
|
+
const n = {};
|
|
550
|
+
for (const r of Object.keys(t)) {
|
|
551
|
+
const o = t[r];
|
|
552
|
+
o instanceof c ? (n[r] = o.value, e = !0) : n[r] = o;
|
|
553
|
+
}
|
|
554
|
+
return e ? n : t;
|
|
555
|
+
}
|
|
556
|
+
function Pt(t) {
|
|
557
|
+
const e = [];
|
|
558
|
+
if (t)
|
|
559
|
+
for (const n of Object.keys(t)) {
|
|
560
|
+
const r = t[n];
|
|
561
|
+
r instanceof c && e.push(r);
|
|
562
|
+
}
|
|
563
|
+
return e;
|
|
564
|
+
}
|
|
565
|
+
function kt(t, e) {
|
|
566
|
+
if (t === e) return !0;
|
|
567
|
+
if (!t || !e) return !1;
|
|
568
|
+
const n = Object.keys(t), r = Object.keys(e);
|
|
569
|
+
if (n.length !== r.length) return !1;
|
|
570
|
+
for (const o of n) if (t[o] !== e[o]) return !1;
|
|
571
|
+
return !0;
|
|
572
|
+
}
|
|
573
|
+
function Rt(t) {
|
|
574
|
+
const e = et(void 0), n = A(
|
|
575
|
+
(o) => {
|
|
576
|
+
const i = Pt(t);
|
|
577
|
+
if (i.length === 0) return () => {
|
|
578
|
+
};
|
|
579
|
+
let f = !0;
|
|
580
|
+
return H(() => {
|
|
581
|
+
for (const a of i) a.value;
|
|
582
|
+
if (f) {
|
|
583
|
+
f = !1;
|
|
584
|
+
return;
|
|
585
|
+
}
|
|
586
|
+
o();
|
|
587
|
+
});
|
|
588
|
+
},
|
|
589
|
+
[t]
|
|
590
|
+
), r = A(() => {
|
|
591
|
+
const o = Ot(t);
|
|
592
|
+
return kt(e.current, o) ? e.current : (e.current = o, o);
|
|
593
|
+
}, [t]);
|
|
594
|
+
return nt(n, r, r);
|
|
595
|
+
}
|
|
596
|
+
function It({ id: t, values: e }) {
|
|
597
|
+
const n = $t(), r = Rt(e);
|
|
598
|
+
return n.render ? n.render(t, r) : n.resolve(t, r);
|
|
233
599
|
}
|
|
234
600
|
export {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
601
|
+
ct as FIELD_WRAPPER,
|
|
602
|
+
It as I18n,
|
|
603
|
+
At as JsonFormRenderer,
|
|
604
|
+
Ft as JsonRendererProvider,
|
|
605
|
+
D as LOCALE_SERVICE,
|
|
606
|
+
Dt as LocaleProvider,
|
|
607
|
+
wt as SchemaErrorPanel,
|
|
608
|
+
Zt as buildFormSchemaMetaSchema,
|
|
609
|
+
Mt as convertJsonToM1Tree,
|
|
610
|
+
Ut as createLocaleResolver,
|
|
611
|
+
Vt as createLocaleService,
|
|
612
|
+
St as createRenderSchemaFromJsonM1,
|
|
613
|
+
Wt as defaultLocaleResolver,
|
|
614
|
+
Jt as defineRegistry,
|
|
615
|
+
Kt as formSchemaMetaSchema,
|
|
616
|
+
Tt as getComponentNames,
|
|
617
|
+
zt as getDataSourceNames,
|
|
618
|
+
Bt as getFnNames,
|
|
619
|
+
Gt as getLocaleKeys,
|
|
620
|
+
I as isArrayNode,
|
|
621
|
+
C as isComponentOp,
|
|
622
|
+
ut as isContainerNode,
|
|
623
|
+
it as isDataSourceOp,
|
|
624
|
+
_ as isFieldNode,
|
|
625
|
+
st as isFnOp,
|
|
626
|
+
ft as isLocaleOp,
|
|
627
|
+
h as isModelOp,
|
|
628
|
+
u as parseOperator,
|
|
629
|
+
Ot as unwrapSignalValues,
|
|
630
|
+
at as useJsonRendererSettings,
|
|
631
|
+
$t as useLocale,
|
|
632
|
+
Rt as useSignalValues
|
|
254
633
|
};
|