@tempots/beatui 0.85.0 → 0.86.1
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/beatui.css +34 -52
- package/dist/beatui.tailwind.css +34 -52
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +1798 -1809
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +183 -196
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +93 -93
- package/dist/lexical/index.cjs.js +1 -1
- package/dist/lexical/index.es.js +1 -1
- package/dist/menu-De_-sGeb.cjs +1 -0
- package/dist/menu-Ui4lUPHM.js +373 -0
- package/dist/types/components/form/input/combobox-tags-input.d.ts +3 -3
- package/dist/{widget-customization-BngYjPvO.cjs → widget-customization-B9Oc1bG4.cjs} +1 -1
- package/dist/{widget-customization-D-Vvr4vg.js → widget-customization-Ct2eqKKR.js} +69 -73
- package/package.json +2 -2
- package/dist/menu-DMAhcoJ2.js +0 -377
- package/dist/menu-q8xJaBIb.cjs +0 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { _ as Z, g as Ke } from "../string-DYyMxBl-.js";
|
|
2
|
-
import { html as p, attr as f,
|
|
3
|
-
import { b, a as
|
|
4
|
-
import { e as
|
|
2
|
+
import { html as p, attr as f, Empty as H, MapSignal as B, Fragment as W, Value as x, computedOf as M, prop as Je, WithElement as Ze, OnDispose as He } from "@tempots/dom";
|
|
3
|
+
import { b, a as re, I as _, d as Xe, f as ie, A as K, g as Ye } from "../use-form-BurzbPVV.js";
|
|
4
|
+
import { e as X, N as Qe, f as de, g as fe, U as et, c as tt, a as nt, T as rt, L as me, b as ye, h as it, G as st, i as at, S as ut, j as ot } from "../deep-merge-CmQoIYPC.js";
|
|
5
5
|
import { T as ct } from "../text-input-CPJzUC2r.js";
|
|
6
6
|
import { N as lt, B as pt, D as dt, a as ft, P as mt, b as yt, c as gt, d as ht, e as bt, F as vt } from "../duration-input-DaB6s0rL.js";
|
|
7
7
|
import { l as xt } from "../colors-BmLYKmoH.js";
|
|
8
|
-
import { B as
|
|
9
|
-
import { S as
|
|
8
|
+
import { B as V } from "../input-container-Nx0gMAzS.js";
|
|
9
|
+
import { S as U, L as ge, M as $t, i as se } from "../stack-BJgsPJ9A.js";
|
|
10
10
|
function It(e) {
|
|
11
11
|
return e === "int64" || e === "int128" || e === "uint64" || e === "uint128";
|
|
12
12
|
}
|
|
13
13
|
function P(e) {
|
|
14
14
|
return e === "int8" || e === "int16" || e === "int32" || e === "int64" || e === "int128" || e === "uint8" || e === "uint16" || e === "uint32" || e === "uint64" || e === "uint128";
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function Y(e) {
|
|
17
17
|
return e === "float" || e === "double" || e === "decimal";
|
|
18
18
|
}
|
|
19
19
|
function Tt(e) {
|
|
20
|
-
return P(e) ||
|
|
20
|
+
return P(e) || Y(e);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function Q(e) {
|
|
23
23
|
return e === "date" || e === "datetime" || e === "time" || e === "duration";
|
|
24
24
|
}
|
|
25
25
|
function wt(e) {
|
|
26
|
-
return e === "string" || e === "boolean" || e === "null" || Tt(e) ||
|
|
26
|
+
return e === "string" || e === "boolean" || e === "null" || Tt(e) || Q(e) || e === "uuid" || e === "uri" || e === "binary";
|
|
27
27
|
}
|
|
28
28
|
function Qn(e) {
|
|
29
29
|
return e === "object" || e === "array" || e === "set" || e === "map" || e === "tuple" || e === "choice" || e === "any";
|
|
@@ -61,13 +61,13 @@ function St(e) {
|
|
|
61
61
|
function Dt(e) {
|
|
62
62
|
return "const" in e;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function ae(e) {
|
|
65
65
|
return e === void 0 ? null : typeof e == "string" || Array.isArray(e) ? e : (O(e), null);
|
|
66
66
|
}
|
|
67
67
|
function At(e) {
|
|
68
68
|
return e === void 0 ? !1 : e === "null" ? !0 : Array.isArray(e) ? e.includes("null") : !1;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function ee(e) {
|
|
71
71
|
return typeof e == "string" ? e === "null" ? [] : [e] : Array.isArray(e) ? e.filter((t) => t !== "null") : [];
|
|
72
72
|
}
|
|
73
73
|
const z = {
|
|
@@ -162,10 +162,10 @@ class Nt {
|
|
|
162
162
|
this.visited.clear();
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function te(e) {
|
|
166
166
|
return new Nt(e);
|
|
167
167
|
}
|
|
168
|
-
class
|
|
168
|
+
class ne {
|
|
169
169
|
schema;
|
|
170
170
|
definition;
|
|
171
171
|
path;
|
|
@@ -176,13 +176,13 @@ class te {
|
|
|
176
176
|
suppressLabel;
|
|
177
177
|
refResolver;
|
|
178
178
|
constructor(t) {
|
|
179
|
-
this.schema = t.schema, this.definition = t.definition, this.path = t.path, this.readOnly = t.readOnly ?? !1, this.locale = t.locale, this.widgetRegistry = t.widgetRegistry, this.isPropertyRequired = t.isPropertyRequired ?? !1, this.suppressLabel = t.suppressLabel ?? !1, this.refResolver = t.refResolver ??
|
|
179
|
+
this.schema = t.schema, this.definition = t.definition, this.path = t.path, this.readOnly = t.readOnly ?? !1, this.locale = t.locale, this.widgetRegistry = t.widgetRegistry, this.isPropertyRequired = t.isPropertyRequired ?? !1, this.suppressLabel = t.suppressLabel ?? !1, this.refResolver = t.refResolver ?? te(t.schema);
|
|
180
180
|
}
|
|
181
181
|
/**
|
|
182
182
|
* Create a new context with updated fields
|
|
183
183
|
*/
|
|
184
184
|
with(t) {
|
|
185
|
-
return new
|
|
185
|
+
return new ne({
|
|
186
186
|
schema: this.schema,
|
|
187
187
|
definition: t.definition ?? this.definition,
|
|
188
188
|
path: t.path ?? this.path,
|
|
@@ -227,16 +227,16 @@ class te {
|
|
|
227
227
|
if (!t) return null;
|
|
228
228
|
if (O(t)) {
|
|
229
229
|
const n = this.refResolver.resolve(t.$ref);
|
|
230
|
-
return n?.type ?
|
|
230
|
+
return n?.type ? ae(n.type) : null;
|
|
231
231
|
}
|
|
232
|
-
return
|
|
232
|
+
return ae(t);
|
|
233
233
|
}
|
|
234
234
|
/**
|
|
235
235
|
* Get the primary type (first non-null type)
|
|
236
236
|
*/
|
|
237
237
|
get primaryType() {
|
|
238
238
|
const t = this.resolvedType;
|
|
239
|
-
return t ? typeof t == "string" ? t === "null" ? null : t :
|
|
239
|
+
return t ? typeof t == "string" ? t === "null" ? null : t : ee(t)[0] ?? null : null;
|
|
240
240
|
}
|
|
241
241
|
/**
|
|
242
242
|
* Check if this type is nullable
|
|
@@ -377,12 +377,12 @@ class te {
|
|
|
377
377
|
}
|
|
378
378
|
function kt(e, t) {
|
|
379
379
|
let n;
|
|
380
|
-
const r =
|
|
380
|
+
const r = te(e);
|
|
381
381
|
if (e.$root) {
|
|
382
382
|
const s = r.resolve(e.$root);
|
|
383
383
|
s ? n = s : (console.warn(`Failed to resolve $root: ${e.$root}`), n = e);
|
|
384
384
|
} else e.type || e.properties ? n = e : n = { type: "any" };
|
|
385
|
-
return new
|
|
385
|
+
return new ne({
|
|
386
386
|
schema: e,
|
|
387
387
|
definition: n,
|
|
388
388
|
path: [],
|
|
@@ -435,19 +435,19 @@ function Rt(e, t) {
|
|
|
435
435
|
return t;
|
|
436
436
|
let n = { ...e[0] };
|
|
437
437
|
for (let a = 1; a < e.length; a++)
|
|
438
|
-
n =
|
|
439
|
-
n =
|
|
438
|
+
n = ue(n, e[a]);
|
|
439
|
+
n = ue(n, t);
|
|
440
440
|
const { $extends: r, ...s } = n;
|
|
441
441
|
return s;
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function ue(e, t) {
|
|
444
444
|
return C(e) && C(t) ? Pt(e, t) : { ...e, ...t };
|
|
445
445
|
}
|
|
446
446
|
function Pt(e, t) {
|
|
447
447
|
const n = {
|
|
448
448
|
...e.properties ?? {},
|
|
449
449
|
...t.properties ?? {}
|
|
450
|
-
}, r =
|
|
450
|
+
}, r = oe(e.required), s = oe(t.required), a = qt([...r, ...s]), u = {
|
|
451
451
|
...e,
|
|
452
452
|
...t,
|
|
453
453
|
type: "object",
|
|
@@ -455,14 +455,14 @@ function Pt(e, t) {
|
|
|
455
455
|
};
|
|
456
456
|
return a.length > 0 && (u.required = a), u;
|
|
457
457
|
}
|
|
458
|
-
function
|
|
458
|
+
function oe(e) {
|
|
459
459
|
return e ? e.length === 0 ? [] : Array.isArray(e[0]) ? e.flat() : e : [];
|
|
460
460
|
}
|
|
461
461
|
function qt(e) {
|
|
462
462
|
return [...new Set(e)];
|
|
463
463
|
}
|
|
464
464
|
function tr(e) {
|
|
465
|
-
const t =
|
|
465
|
+
const t = te(e);
|
|
466
466
|
return {
|
|
467
467
|
resolve: (n) => (t.reset(), Ie(n, e))
|
|
468
468
|
};
|
|
@@ -496,7 +496,7 @@ function Te({
|
|
|
496
496
|
const n = Lt(e);
|
|
497
497
|
return b(ct, {
|
|
498
498
|
...n,
|
|
499
|
-
controller:
|
|
499
|
+
controller: X(t)
|
|
500
500
|
});
|
|
501
501
|
}
|
|
502
502
|
function Et(e) {
|
|
@@ -511,11 +511,11 @@ function we({
|
|
|
511
511
|
ctx: e,
|
|
512
512
|
controller: t
|
|
513
513
|
}) {
|
|
514
|
-
const n = Et(e), r = b(
|
|
514
|
+
const n = Et(e), r = b(re, {
|
|
515
515
|
...n,
|
|
516
516
|
controller: t
|
|
517
517
|
});
|
|
518
|
-
return e.isNullable ? b(
|
|
518
|
+
return e.isNullable ? b(re, {
|
|
519
519
|
...n,
|
|
520
520
|
controller: t,
|
|
521
521
|
after: Qe(
|
|
@@ -654,7 +654,7 @@ function Ae({
|
|
|
654
654
|
const n = Wt(e);
|
|
655
655
|
return b(et, {
|
|
656
656
|
...n,
|
|
657
|
-
controller:
|
|
657
|
+
controller: X(t)
|
|
658
658
|
});
|
|
659
659
|
}
|
|
660
660
|
function _t(e) {
|
|
@@ -705,7 +705,7 @@ function Oe({
|
|
|
705
705
|
controller: t
|
|
706
706
|
});
|
|
707
707
|
default:
|
|
708
|
-
return console.warn(`Unknown temporal type: ${n}`),
|
|
708
|
+
return console.warn(`Unknown temporal type: ${n}`), H;
|
|
709
709
|
}
|
|
710
710
|
}
|
|
711
711
|
function zt(e) {
|
|
@@ -724,7 +724,7 @@ function Ce({
|
|
|
724
724
|
const n = zt(e);
|
|
725
725
|
return b(nt, {
|
|
726
726
|
...n,
|
|
727
|
-
controller:
|
|
727
|
+
controller: X(t)
|
|
728
728
|
});
|
|
729
729
|
}
|
|
730
730
|
function Gt(e) {
|
|
@@ -779,7 +779,7 @@ function J({
|
|
|
779
779
|
controller: Jt(t)
|
|
780
780
|
});
|
|
781
781
|
}
|
|
782
|
-
function
|
|
782
|
+
function q(e) {
|
|
783
783
|
return {
|
|
784
784
|
label: e.suppressLabel ? void 0 : e.label,
|
|
785
785
|
description: e.description,
|
|
@@ -843,11 +843,11 @@ function ke({
|
|
|
843
843
|
}).append(T),
|
|
844
844
|
controller: j
|
|
845
845
|
});
|
|
846
|
-
}), d =
|
|
846
|
+
}), d = B(t.signal, (v) => {
|
|
847
847
|
const I = Object.keys(v ?? {}), T = I.filter((w) => !y.has(w));
|
|
848
|
-
if (T.length === 0) return
|
|
848
|
+
if (T.length === 0) return H;
|
|
849
849
|
const j = I.length > o && !e.readOnly;
|
|
850
|
-
return
|
|
850
|
+
return W(
|
|
851
851
|
...T.map((w) => {
|
|
852
852
|
const R = t.field(w);
|
|
853
853
|
return p.div(
|
|
@@ -855,13 +855,13 @@ function ke({
|
|
|
855
855
|
p.div(
|
|
856
856
|
f.class("bc-json-structure-additional-property-header"),
|
|
857
857
|
p.strong(`${w}:`),
|
|
858
|
-
|
|
858
|
+
V(
|
|
859
859
|
{
|
|
860
860
|
variant: "text",
|
|
861
861
|
size: "xs",
|
|
862
862
|
onClick: () => {
|
|
863
|
-
const
|
|
864
|
-
delete
|
|
863
|
+
const L = { ...x.get(t.signal) ?? {} };
|
|
864
|
+
delete L[w], t.change(L);
|
|
865
865
|
},
|
|
866
866
|
disabled: !j
|
|
867
867
|
},
|
|
@@ -882,7 +882,7 @@ function ke({
|
|
|
882
882
|
);
|
|
883
883
|
})
|
|
884
884
|
);
|
|
885
|
-
}), g = u && !e.readOnly ?
|
|
885
|
+
}), g = u && !e.readOnly ? V(
|
|
886
886
|
{
|
|
887
887
|
variant: "outline",
|
|
888
888
|
size: "sm",
|
|
@@ -909,7 +909,7 @@ function ke({
|
|
|
909
909
|
m
|
|
910
910
|
);
|
|
911
911
|
return !e.suppressLabel && e.name ? _({
|
|
912
|
-
...
|
|
912
|
+
...q(e),
|
|
913
913
|
content: $
|
|
914
914
|
}) : $;
|
|
915
915
|
}
|
|
@@ -922,7 +922,7 @@ function Re({
|
|
|
922
922
|
return console.warn("StructureArrayControl requires an ArrayTypeDefinition"), p.div("Invalid array definition");
|
|
923
923
|
const r = n.items, s = n.minItems ?? 0, a = n.maxItems ?? 1 / 0, u = M(t.signal)((o) => (o?.length ?? 0) < a), i = M(t.signal)((o) => (o?.length ?? 0) > s);
|
|
924
924
|
return me({
|
|
925
|
-
...
|
|
925
|
+
...q(e),
|
|
926
926
|
controller: t,
|
|
927
927
|
createItem: () => k(r),
|
|
928
928
|
showAdd: !0,
|
|
@@ -958,7 +958,7 @@ function Pe({
|
|
|
958
958
|
return y;
|
|
959
959
|
});
|
|
960
960
|
return me({
|
|
961
|
-
...
|
|
961
|
+
...q(e),
|
|
962
962
|
controller: t,
|
|
963
963
|
createItem: () => k(r),
|
|
964
964
|
showAdd: !0,
|
|
@@ -973,7 +973,7 @@ function Pe({
|
|
|
973
973
|
}).append(l),
|
|
974
974
|
controller: y
|
|
975
975
|
});
|
|
976
|
-
return h.map((g) => g ?
|
|
976
|
+
return h.map((g) => g ? U(
|
|
977
977
|
f.class("bc-stack--gap-1"),
|
|
978
978
|
d,
|
|
979
979
|
ge(
|
|
@@ -998,11 +998,11 @@ function qe({
|
|
|
998
998
|
const n = e.definition;
|
|
999
999
|
if (n.type !== "map" || !("values" in n))
|
|
1000
1000
|
return console.warn("StructureMapControl requires a MapTypeDefinition"), p.div("Invalid map definition");
|
|
1001
|
-
const r = n.values, s = n.minProperties ?? 0, a = n.maxProperties ?? 1 / 0, u =
|
|
1001
|
+
const r = n.values, s = n.minProperties ?? 0, a = n.maxProperties ?? 1 / 0, u = B(t.signal, (l) => {
|
|
1002
1002
|
const y = Object.keys(l ?? {});
|
|
1003
|
-
if (y.length === 0) return
|
|
1003
|
+
if (y.length === 0) return H;
|
|
1004
1004
|
const h = y.length > s && !e.readOnly;
|
|
1005
|
-
return
|
|
1005
|
+
return W(
|
|
1006
1006
|
...y.map((d) => {
|
|
1007
1007
|
const g = t.field(d);
|
|
1008
1008
|
return p.div(
|
|
@@ -1013,7 +1013,7 @@ function qe({
|
|
|
1013
1013
|
f.class("bc-json-structure-map-entry-key"),
|
|
1014
1014
|
`${d}:`
|
|
1015
1015
|
),
|
|
1016
|
-
|
|
1016
|
+
V(
|
|
1017
1017
|
{
|
|
1018
1018
|
variant: "text",
|
|
1019
1019
|
size: "xs",
|
|
@@ -1039,7 +1039,7 @@ function qe({
|
|
|
1039
1039
|
);
|
|
1040
1040
|
})
|
|
1041
1041
|
);
|
|
1042
|
-
}), i = e.readOnly ? null :
|
|
1042
|
+
}), i = e.readOnly ? null : V(
|
|
1043
1043
|
{
|
|
1044
1044
|
variant: "outline",
|
|
1045
1045
|
size: "sm",
|
|
@@ -1062,7 +1062,7 @@ function qe({
|
|
|
1062
1062
|
i
|
|
1063
1063
|
), c = p.div(f.class("bc-json-structure-map"), o);
|
|
1064
1064
|
return !e.suppressLabel && e.name ? _({
|
|
1065
|
-
...
|
|
1065
|
+
...q(e),
|
|
1066
1066
|
content: c
|
|
1067
1067
|
}) : c;
|
|
1068
1068
|
}
|
|
@@ -1081,7 +1081,7 @@ function Fe({
|
|
|
1081
1081
|
});
|
|
1082
1082
|
t.change(i);
|
|
1083
1083
|
}
|
|
1084
|
-
const u =
|
|
1084
|
+
const u = q(e);
|
|
1085
1085
|
return p.div(
|
|
1086
1086
|
f.class("bc-json-structure-tuple"),
|
|
1087
1087
|
// Optional label and description
|
|
@@ -1160,7 +1160,7 @@ function Qt({
|
|
|
1160
1160
|
selector: t,
|
|
1161
1161
|
inner: n
|
|
1162
1162
|
}) {
|
|
1163
|
-
const r =
|
|
1163
|
+
const r = U(
|
|
1164
1164
|
f.class("bc-stack--gap-2 bc-stack--align-start"),
|
|
1165
1165
|
t,
|
|
1166
1166
|
n
|
|
@@ -1200,7 +1200,7 @@ function tn(e, t, n) {
|
|
|
1200
1200
|
if (t in r)
|
|
1201
1201
|
return r[t];
|
|
1202
1202
|
}
|
|
1203
|
-
function
|
|
1203
|
+
function ce(e, t, n) {
|
|
1204
1204
|
return n ? e && typeof e == "object" ? {
|
|
1205
1205
|
[n]: t,
|
|
1206
1206
|
...e
|
|
@@ -1243,12 +1243,12 @@ function Le({
|
|
|
1243
1243
|
l = !0, c.set(m);
|
|
1244
1244
|
const $ = r[m];
|
|
1245
1245
|
if ($) {
|
|
1246
|
-
const v = k($), I =
|
|
1246
|
+
const v = k($), I = ce(v, m, s);
|
|
1247
1247
|
t.change(I);
|
|
1248
1248
|
}
|
|
1249
1249
|
},
|
|
1250
1250
|
disabled: e.readOnly || e.isDeprecated
|
|
1251
|
-
}), g =
|
|
1251
|
+
}), g = B(c, (m) => {
|
|
1252
1252
|
const $ = r[x.get(m)];
|
|
1253
1253
|
if (!$)
|
|
1254
1254
|
return p.div(
|
|
@@ -1258,7 +1258,7 @@ function Le({
|
|
|
1258
1258
|
const v = M(t.signal)(
|
|
1259
1259
|
(j) => tn(j, x.get(m), s)
|
|
1260
1260
|
), I = (j) => {
|
|
1261
|
-
const w =
|
|
1261
|
+
const w = ce(
|
|
1262
1262
|
j,
|
|
1263
1263
|
x.get(m),
|
|
1264
1264
|
s
|
|
@@ -1317,7 +1317,7 @@ function Ve({
|
|
|
1317
1317
|
ctx: e,
|
|
1318
1318
|
controller: t
|
|
1319
1319
|
}) {
|
|
1320
|
-
return
|
|
1320
|
+
return W(
|
|
1321
1321
|
Ze(() => {
|
|
1322
1322
|
x.get(t.signal) !== e.constValue && t.change(e.constValue);
|
|
1323
1323
|
}),
|
|
@@ -1492,9 +1492,9 @@ function ln({
|
|
|
1492
1492
|
selector: n,
|
|
1493
1493
|
inner: r
|
|
1494
1494
|
}) {
|
|
1495
|
-
return e.isRoot ? t ?
|
|
1495
|
+
return e.isRoot ? t ? U(f.class("bc-stack--gap-2"), n, r) : r : _({
|
|
1496
1496
|
...rn(e),
|
|
1497
|
-
content: t ?
|
|
1497
|
+
content: t ? U(
|
|
1498
1498
|
f.class("bc-stack--gap-2 bc-stack--align-start"),
|
|
1499
1499
|
n,
|
|
1500
1500
|
r
|
|
@@ -1511,7 +1511,7 @@ function pn({
|
|
|
1511
1511
|
s = r;
|
|
1512
1512
|
else
|
|
1513
1513
|
return console.warn("StructureUnionControl called with non-array type"), D({ ctx: e, controller: t });
|
|
1514
|
-
const a = s.includes("null"), u =
|
|
1514
|
+
const a = s.includes("null"), u = ee(r), i = a && u.length > 0 ? u : s, o = on(i), c = new at(
|
|
1515
1515
|
t.path,
|
|
1516
1516
|
t.change,
|
|
1517
1517
|
t.signal,
|
|
@@ -1526,7 +1526,7 @@ function pn({
|
|
|
1526
1526
|
onChange: d
|
|
1527
1527
|
}), y = (d) => {
|
|
1528
1528
|
c.switchToBranch(d, !1);
|
|
1529
|
-
}, h =
|
|
1529
|
+
}, h = B(c.activeBranch, (d) => {
|
|
1530
1530
|
const g = x.get(d), m = c.getBranchController(g), $ = e.with({
|
|
1531
1531
|
definition: { ...n, type: g },
|
|
1532
1532
|
// Suppress inner labels only when union is nested (non-root)
|
|
@@ -1581,7 +1581,7 @@ function D({
|
|
|
1581
1581
|
controller: t
|
|
1582
1582
|
});
|
|
1583
1583
|
const a = n.resolvedType;
|
|
1584
|
-
if (Array.isArray(a) &&
|
|
1584
|
+
if (Array.isArray(a) && ee(a).length > 1)
|
|
1585
1585
|
return pn({
|
|
1586
1586
|
ctx: n,
|
|
1587
1587
|
controller: t
|
|
@@ -1593,7 +1593,7 @@ function D({
|
|
|
1593
1593
|
controller: t
|
|
1594
1594
|
});
|
|
1595
1595
|
if (C(n.definition)) {
|
|
1596
|
-
const i = t instanceof
|
|
1596
|
+
const i = t instanceof ie ? t : t.object();
|
|
1597
1597
|
return ke({
|
|
1598
1598
|
ctx: n,
|
|
1599
1599
|
controller: i
|
|
@@ -1614,7 +1614,7 @@ function D({
|
|
|
1614
1614
|
});
|
|
1615
1615
|
}
|
|
1616
1616
|
if (ve(n.definition)) {
|
|
1617
|
-
const i = t instanceof
|
|
1617
|
+
const i = t instanceof ie ? t : t.object();
|
|
1618
1618
|
return qe({
|
|
1619
1619
|
ctx: n,
|
|
1620
1620
|
controller: i
|
|
@@ -1670,11 +1670,11 @@ function D({
|
|
|
1670
1670
|
ctx: n,
|
|
1671
1671
|
controller: t,
|
|
1672
1672
|
intType: u
|
|
1673
|
-
}) :
|
|
1673
|
+
}) : Y(u) ? De({
|
|
1674
1674
|
ctx: n,
|
|
1675
1675
|
controller: t,
|
|
1676
1676
|
floatType: u
|
|
1677
|
-
}) :
|
|
1677
|
+
}) : Q(u) ? Oe({
|
|
1678
1678
|
ctx: n,
|
|
1679
1679
|
controller: t,
|
|
1680
1680
|
temporalType: u
|
|
@@ -1802,7 +1802,7 @@ class yn {
|
|
|
1802
1802
|
case "any":
|
|
1803
1803
|
return !0;
|
|
1804
1804
|
default:
|
|
1805
|
-
return P(n) ? this.validateInteger(t, n, r, s, a) :
|
|
1805
|
+
return P(n) ? this.validateInteger(t, n, r, s, a) : Y(n) ? this.validateFloat(t, r, s, a) : Q(n) ? this.validateTemporal(t, n, s, a) : n === "uuid" ? this.validateUuid(t, s, a) : n === "uri" ? this.validateUri(t, s, a) : n === "binary" ? this.validateBinary(t, s, a) : !1;
|
|
1806
1806
|
}
|
|
1807
1807
|
}
|
|
1808
1808
|
validateString(t, n, r, s) {
|
|
@@ -2049,9 +2049,9 @@ function hn(e, t) {
|
|
|
2049
2049
|
switch (e.type) {
|
|
2050
2050
|
// Type errors
|
|
2051
2051
|
case "type":
|
|
2052
|
-
return `Expected ${
|
|
2052
|
+
return `Expected ${le(e.expected)}, got ${bn(e.actual)}`;
|
|
2053
2053
|
case "type_mismatch":
|
|
2054
|
-
return `Value must be of type ${
|
|
2054
|
+
return `Value must be of type ${le(e.expected)}`;
|
|
2055
2055
|
// String validation
|
|
2056
2056
|
case "minLength":
|
|
2057
2057
|
return `Must be at least ${e.expected} characters`;
|
|
@@ -2115,13 +2115,13 @@ function hn(e, t) {
|
|
|
2115
2115
|
return e.context?.message ?? `Validation error: ${e.type}`;
|
|
2116
2116
|
}
|
|
2117
2117
|
}
|
|
2118
|
-
function
|
|
2119
|
-
return typeof e == "string" ?
|
|
2118
|
+
function le(e) {
|
|
2119
|
+
return typeof e == "string" ? pe(e) : Array.isArray(e) ? e.map(pe).join(" or ") : String(e);
|
|
2120
2120
|
}
|
|
2121
2121
|
function bn(e) {
|
|
2122
2122
|
return e === null ? "null" : e === void 0 ? "undefined" : typeof e;
|
|
2123
2123
|
}
|
|
2124
|
-
function
|
|
2124
|
+
function pe(e) {
|
|
2125
2125
|
return {
|
|
2126
2126
|
string: "text",
|
|
2127
2127
|
boolean: "true/false",
|
|
@@ -2294,12 +2294,12 @@ class G {
|
|
|
2294
2294
|
return new G(this);
|
|
2295
2295
|
}
|
|
2296
2296
|
}
|
|
2297
|
-
let
|
|
2298
|
-
function
|
|
2299
|
-
return
|
|
2297
|
+
let E = null;
|
|
2298
|
+
function F() {
|
|
2299
|
+
return E || (E = new G()), E;
|
|
2300
2300
|
}
|
|
2301
2301
|
function ur(e) {
|
|
2302
|
-
|
|
2302
|
+
E = e;
|
|
2303
2303
|
}
|
|
2304
2304
|
function or(e) {
|
|
2305
2305
|
return new G(e);
|
|
@@ -2366,7 +2366,7 @@ function wn(e, t) {
|
|
|
2366
2366
|
if (r)
|
|
2367
2367
|
return r;
|
|
2368
2368
|
}
|
|
2369
|
-
return
|
|
2369
|
+
return F().findBestWidget(e);
|
|
2370
2370
|
}
|
|
2371
2371
|
function fr(e) {
|
|
2372
2372
|
const t = e.definition, n = {};
|
|
@@ -2407,7 +2407,7 @@ function yr(e, t) {
|
|
|
2407
2407
|
if (a)
|
|
2408
2408
|
return { name: n, registration: a };
|
|
2409
2409
|
}
|
|
2410
|
-
const s =
|
|
2410
|
+
const s = F().get(n);
|
|
2411
2411
|
if (s)
|
|
2412
2412
|
return { name: n, registration: s };
|
|
2413
2413
|
console.warn(
|
|
@@ -2424,7 +2424,7 @@ function gr(e, t, n) {
|
|
|
2424
2424
|
...n
|
|
2425
2425
|
};
|
|
2426
2426
|
}
|
|
2427
|
-
function jn(e =
|
|
2427
|
+
function jn(e = F()) {
|
|
2428
2428
|
e.register("string", {
|
|
2429
2429
|
factory: ({ controller: i, ctx: o }) => Te({
|
|
2430
2430
|
ctx: o,
|
|
@@ -2623,10 +2623,10 @@ function jn(e = L()) {
|
|
|
2623
2623
|
matcher: (i) => i.hasConst
|
|
2624
2624
|
});
|
|
2625
2625
|
}
|
|
2626
|
-
function Mn(e =
|
|
2626
|
+
function Mn(e = F()) {
|
|
2627
2627
|
return e.has("string") && e.has("object") && e.has("array");
|
|
2628
2628
|
}
|
|
2629
|
-
function hr(e =
|
|
2629
|
+
function hr(e = F()) {
|
|
2630
2630
|
Mn(e) || jn(e);
|
|
2631
2631
|
}
|
|
2632
2632
|
function Sn(e) {
|
|
@@ -2877,7 +2877,7 @@ function Ge() {
|
|
|
2877
2877
|
}
|
|
2878
2878
|
function Wn(e) {
|
|
2879
2879
|
if (e.isValid)
|
|
2880
|
-
return
|
|
2880
|
+
return se.valid;
|
|
2881
2881
|
const t = Be(e.errors), n = /* @__PURE__ */ new Map();
|
|
2882
2882
|
for (const u of t) {
|
|
2883
2883
|
const i = n.get(u.path) || [];
|
|
@@ -2909,7 +2909,7 @@ function Wn(e) {
|
|
|
2909
2909
|
a[c] = r(l, i);
|
|
2910
2910
|
}
|
|
2911
2911
|
}
|
|
2912
|
-
return Object.keys(a).length > 0 && (s.dependencies = a),
|
|
2912
|
+
return Object.keys(a).length > 0 && (s.dependencies = a), se.invalid(s);
|
|
2913
2913
|
}
|
|
2914
2914
|
function br({
|
|
2915
2915
|
schema: e,
|
|
@@ -2932,8 +2932,8 @@ function br({
|
|
|
2932
2932
|
const g = Ue(e), m = n ?? "onTouched", $ = (w) => {
|
|
2933
2933
|
const R = g.validate(w);
|
|
2934
2934
|
if (o && !R.isValid) {
|
|
2935
|
-
const
|
|
2936
|
-
o(
|
|
2935
|
+
const L = Be(R.errors);
|
|
2936
|
+
o(L);
|
|
2937
2937
|
}
|
|
2938
2938
|
return Wn(R);
|
|
2939
2939
|
}, { controller: v, setStatus: I } = Ye({
|
|
@@ -2942,7 +2942,7 @@ function br({
|
|
|
2942
2942
|
validateDebounceMs: r,
|
|
2943
2943
|
validate: m === "onSubmit" ? void 0 : $,
|
|
2944
2944
|
onChange: i
|
|
2945
|
-
}), j =
|
|
2945
|
+
}), j = W(
|
|
2946
2946
|
He(() => {
|
|
2947
2947
|
v.dispose();
|
|
2948
2948
|
}),
|
|
@@ -2961,11 +2961,11 @@ export {
|
|
|
2961
2961
|
z as INTEGER_BOUNDS,
|
|
2962
2962
|
br as JSONStructureForm,
|
|
2963
2963
|
Nt as RefResolver,
|
|
2964
|
-
|
|
2964
|
+
ne as StructureContext,
|
|
2965
2965
|
dn as StructureControl,
|
|
2966
2966
|
D as StructureGenericControl,
|
|
2967
2967
|
tr as createExtendsResolver,
|
|
2968
|
-
|
|
2968
|
+
te as createRefResolver,
|
|
2969
2969
|
kt as createStructureContext,
|
|
2970
2970
|
Ue as createValidator,
|
|
2971
2971
|
or as createWidgetRegistry,
|
|
@@ -2980,9 +2980,9 @@ export {
|
|
|
2980
2980
|
ar as getChildErrors,
|
|
2981
2981
|
ir as getErrorsForPath,
|
|
2982
2982
|
We as getExplicitWidgetName,
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2983
|
+
F as getGlobalWidgetRegistry,
|
|
2984
|
+
ee as getNonNullTypes,
|
|
2985
|
+
ae as getResolvedType,
|
|
2986
2986
|
fr as getWidgetOptions,
|
|
2987
2987
|
rr as groupErrorsByPath,
|
|
2988
2988
|
Dt as hasConstValue,
|
|
@@ -2994,7 +2994,7 @@ export {
|
|
|
2994
2994
|
It as isBigIntType,
|
|
2995
2995
|
$e as isChoiceTypeDefinition,
|
|
2996
2996
|
Qn as isCompoundType,
|
|
2997
|
-
|
|
2997
|
+
Y as isFloatType,
|
|
2998
2998
|
P as isIntegerType,
|
|
2999
2999
|
ve as isMapTypeDefinition,
|
|
3000
3000
|
jt as isNamespace,
|
|
@@ -3003,7 +3003,7 @@ export {
|
|
|
3003
3003
|
C as isObjectTypeDefinition,
|
|
3004
3004
|
wt as isPrimitiveType,
|
|
3005
3005
|
be as isSetTypeDefinition,
|
|
3006
|
-
|
|
3006
|
+
Q as isTemporalType,
|
|
3007
3007
|
xe as isTupleTypeDefinition,
|
|
3008
3008
|
Mt as isTypeDefinition,
|
|
3009
3009
|
O as isTypeReference,
|