@tempots/beatui 0.76.0 → 0.77.0
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/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +3 -3
- package/dist/beatui.css +11 -2
- package/dist/beatui.tailwind.css +11 -2
- package/dist/deep-merge-DBUbjJYt.cjs +1 -0
- package/dist/{deep-merge-CQQCMLwG.js → deep-merge-E6b9KE6l.js} +221 -223
- package/dist/{duration-input-D-SIoDoo.cjs → duration-input-CsygvJJ_.cjs} +1 -1
- package/dist/{duration-input-DKxZ6OCa.js → duration-input-j7bVks-S.js} +2 -2
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +238 -237
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +5 -5
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +3 -3
- package/dist/{modal-MofsfmAe.js → modal--5-j6x0s.js} +1 -1
- package/dist/{modal-5P9mU_a4.cjs → modal-rLbLQYhb.cjs} +1 -1
- package/dist/{notice-DP209Ed8.cjs → notice-BGaJ4k0O.cjs} +1 -1
- package/dist/{notice-Cqq8g17n.js → notice-BvS1_9Va.js} +1 -1
- package/dist/types/components/form/controller/controller-validation.d.ts +41 -0
- package/dist/types/components/json-schema/widgets/widget-customization.d.ts +7 -7
- package/dist/use-form-B4D58mxd.cjs +2 -0
- package/dist/{use-form-B7A865EM.js → use-form-DzA1RSrN.js} +115 -88
- package/dist/{widget-customization-GaZB6sLP.cjs → widget-customization-DKlfR6Qb.cjs} +1 -1
- package/dist/{widget-customization-CobH7Rj_.js → widget-customization-DfBf7gGp.js} +3 -3
- package/package.json +1 -1
- package/dist/deep-merge-DZxfgKqX.cjs +0 -1
- package/dist/use-form-DVJXMMoN.cjs +0 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Use as X, coalesce as Y, aria as F, attr as o, html as
|
|
1
|
+
import { Use as X, coalesce as Y, aria as F, attr as o, html as b, on as I, Value as E, Empty as T, computedOf as w, When as x, dataAttr as B, TextNode as Z, prop as S, Fragment as q, emitValue as ee, emitValueAsNumber as se } from "@tempots/dom";
|
|
2
2
|
import { a as te, B as ne, c as R, b as re } from "./translations-DQxouiBG.js";
|
|
3
3
|
const H = /* @__PURE__ */ new Map();
|
|
4
4
|
function N(e) {
|
|
5
5
|
const s = H.get(e) ?? 0;
|
|
6
6
|
return H.set(e, s + 1), `${e}-${s}`;
|
|
7
7
|
}
|
|
8
|
-
const
|
|
8
|
+
const m = {
|
|
9
9
|
/**
|
|
10
10
|
* Creates a loading state.
|
|
11
11
|
* @param previousValue - The previous value.
|
|
@@ -84,7 +84,7 @@ const b = {
|
|
|
84
84
|
* @public
|
|
85
85
|
*/
|
|
86
86
|
getOrElse(e, s) {
|
|
87
|
-
return
|
|
87
|
+
return m.isSuccess(e) ? e.value : s;
|
|
88
88
|
},
|
|
89
89
|
/**
|
|
90
90
|
* Gets the value if the result is a success; otherwise, returns the value from the alternative function.
|
|
@@ -95,7 +95,7 @@ const b = {
|
|
|
95
95
|
* function.
|
|
96
96
|
*/
|
|
97
97
|
getOrElseLazy(e, s) {
|
|
98
|
-
return
|
|
98
|
+
return m.isSuccess(e) ? e.value : s();
|
|
99
99
|
},
|
|
100
100
|
/**
|
|
101
101
|
* Gets the value if the result is a success; otherwise, returns `null`.
|
|
@@ -104,7 +104,7 @@ const b = {
|
|
|
104
104
|
* @public
|
|
105
105
|
*/
|
|
106
106
|
getOrNull(e) {
|
|
107
|
-
return
|
|
107
|
+
return m.isSuccess(e) ? e.value : null;
|
|
108
108
|
},
|
|
109
109
|
/**
|
|
110
110
|
* Gets the value if the result is a success; otherwise, returns `undefined`.
|
|
@@ -113,7 +113,7 @@ const b = {
|
|
|
113
113
|
* @public
|
|
114
114
|
*/
|
|
115
115
|
getOrUndefined(e) {
|
|
116
|
-
return
|
|
116
|
+
return m.isSuccess(e) ? e.value : void 0;
|
|
117
117
|
},
|
|
118
118
|
/**
|
|
119
119
|
* Gets the value of a `AsyncResult` if it is a `Success`, otherwise it throws the error contained in the `Failure`.
|
|
@@ -121,9 +121,9 @@ const b = {
|
|
|
121
121
|
* @returns The value of the `AsyncResult` if it is a `Success`.
|
|
122
122
|
*/
|
|
123
123
|
getUnsafe: (e) => {
|
|
124
|
-
if (
|
|
124
|
+
if (m.isSuccess(e))
|
|
125
125
|
return e.value;
|
|
126
|
-
throw
|
|
126
|
+
throw m.isFailure(e) ? e.error : new Error("Cannot get value from a not-asked or loading result");
|
|
127
127
|
},
|
|
128
128
|
/**
|
|
129
129
|
* Based on the state of the result, it picks the appropriate function to call and returns the result.
|
|
@@ -139,7 +139,7 @@ const b = {
|
|
|
139
139
|
failure: t,
|
|
140
140
|
loading: n,
|
|
141
141
|
notAsked: r = n
|
|
142
|
-
}) =>
|
|
142
|
+
}) => m.isSuccess(e) ? s(e.value) : m.isFailure(e) ? t(e.error) : m.isNotAsked(e) ? r() : n(e.previousValue),
|
|
143
143
|
/**
|
|
144
144
|
* When the result is a success, it applies the function to the value.
|
|
145
145
|
*
|
|
@@ -148,7 +148,7 @@ const b = {
|
|
|
148
148
|
* @returns The result that was passed in.
|
|
149
149
|
* @public
|
|
150
150
|
*/
|
|
151
|
-
whenSuccess: (e, s) => (
|
|
151
|
+
whenSuccess: (e, s) => (m.isSuccess(e) && s(e.value), e),
|
|
152
152
|
/**
|
|
153
153
|
* When the result is a failure, it applies the function to the error.
|
|
154
154
|
*
|
|
@@ -157,7 +157,7 @@ const b = {
|
|
|
157
157
|
* @returns The result that was passed in.
|
|
158
158
|
* @public
|
|
159
159
|
*/
|
|
160
|
-
whenFailure: (e, s) => (
|
|
160
|
+
whenFailure: (e, s) => (m.isFailure(e) && s(e.error), e),
|
|
161
161
|
/**
|
|
162
162
|
* Compares two results for equality.
|
|
163
163
|
* @param r1 - The first result.
|
|
@@ -177,11 +177,11 @@ const b = {
|
|
|
177
177
|
all: (e) => {
|
|
178
178
|
const s = [];
|
|
179
179
|
for (const t of e)
|
|
180
|
-
if (
|
|
180
|
+
if (m.isSuccess(t))
|
|
181
181
|
s.push(t.value);
|
|
182
182
|
else
|
|
183
183
|
return t;
|
|
184
|
-
return
|
|
184
|
+
return m.success(s);
|
|
185
185
|
},
|
|
186
186
|
/**
|
|
187
187
|
* Converts a Promise to an AsyncResult.
|
|
@@ -191,12 +191,12 @@ const b = {
|
|
|
191
191
|
ofPromise: async (e) => {
|
|
192
192
|
try {
|
|
193
193
|
const s = await e;
|
|
194
|
-
return
|
|
194
|
+
return m.success(s);
|
|
195
195
|
} catch (s) {
|
|
196
|
-
return
|
|
196
|
+
return m.failure(s instanceof Error ? s : new Error(String(s)));
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
}, V = (e, s) => e === s || e !== e && s !== s,
|
|
199
|
+
}, V = (e, s) => e === s || e !== e && s !== s, f = {
|
|
200
200
|
/**
|
|
201
201
|
* Creates a valid `Validation`.
|
|
202
202
|
* @returns A `Validation` that is `Valid`.
|
|
@@ -234,14 +234,14 @@ const b = {
|
|
|
234
234
|
* @param invalid - The mapping function for an invalid value.
|
|
235
235
|
* @returns The mapped value.
|
|
236
236
|
*/
|
|
237
|
-
match: (e, s, t) =>
|
|
237
|
+
match: (e, s, t) => f.isValid(e) ? s() : t(e.error),
|
|
238
238
|
/**
|
|
239
239
|
* Maps the value of a `Validation` to a new `Validation`.
|
|
240
240
|
* @param validation - The `Validation` to map.
|
|
241
241
|
* @param value - The value to map.
|
|
242
242
|
* @returns A new `Validation` with the mapped value.
|
|
243
243
|
*/
|
|
244
|
-
toResult: (e, s) =>
|
|
244
|
+
toResult: (e, s) => f.match(
|
|
245
245
|
e,
|
|
246
246
|
() => d.success(s),
|
|
247
247
|
(t) => d.failure(t)
|
|
@@ -253,7 +253,7 @@ const b = {
|
|
|
253
253
|
* @param apply - The function to execute when the `Validation` is valid.
|
|
254
254
|
* @returns The `Validation` object.
|
|
255
255
|
*/
|
|
256
|
-
whenValid: (e, s) => (
|
|
256
|
+
whenValid: (e, s) => (f.isValid(e) && s(), e),
|
|
257
257
|
/**
|
|
258
258
|
* Execute a function when the `Validation` is invalid.
|
|
259
259
|
*
|
|
@@ -261,7 +261,7 @@ const b = {
|
|
|
261
261
|
* @param apply - The function to execute when the `Validation` is invalid.
|
|
262
262
|
* @returns The `Validation` object.
|
|
263
263
|
*/
|
|
264
|
-
whenInvalid: (e, s) => (
|
|
264
|
+
whenInvalid: (e, s) => (f.isInvalid(e) && s(e.error), e)
|
|
265
265
|
}, d = {
|
|
266
266
|
/**
|
|
267
267
|
* Creates a successful `Result`.
|
|
@@ -308,8 +308,8 @@ const b = {
|
|
|
308
308
|
toAsync(e) {
|
|
309
309
|
return d.match(
|
|
310
310
|
e,
|
|
311
|
-
(s) =>
|
|
312
|
-
(s) =>
|
|
311
|
+
(s) => m.success(s),
|
|
312
|
+
(s) => m.failure(s)
|
|
313
313
|
);
|
|
314
314
|
},
|
|
315
315
|
/**
|
|
@@ -321,8 +321,8 @@ const b = {
|
|
|
321
321
|
toValidation(e) {
|
|
322
322
|
return d.match(
|
|
323
323
|
e,
|
|
324
|
-
() =>
|
|
325
|
-
(s) =>
|
|
324
|
+
() => f.valid,
|
|
325
|
+
(s) => f.invalid(s)
|
|
326
326
|
);
|
|
327
327
|
},
|
|
328
328
|
/**
|
|
@@ -486,7 +486,7 @@ function Se({
|
|
|
486
486
|
function $(e) {
|
|
487
487
|
return `bc-label bc-label--${e}`;
|
|
488
488
|
}
|
|
489
|
-
const De = (...e) =>
|
|
489
|
+
const De = (...e) => b.span(o.class($("emphasis")), ...e), ie = (...e) => b.span(o.class($("default")), ...e), ae = (...e) => b.span(o.class($("muted")), ...e), Ce = (...e) => b.span(o.class($("danger")), ...e), Ee = (e) => {
|
|
490
490
|
const {
|
|
491
491
|
value: s,
|
|
492
492
|
onBlur: t,
|
|
@@ -497,7 +497,7 @@ const De = (...e) => f.span(o.class($("emphasis")), ...e), ie = (...e) => f.span
|
|
|
497
497
|
checkedIcon: a,
|
|
498
498
|
uncheckedIcon: c,
|
|
499
499
|
iconSize: p = "lg"
|
|
500
|
-
} = e, u = l ?? N("checkbox"),
|
|
500
|
+
} = e, u = l ?? N("checkbox"), v = `${u}-label`, k = () => {
|
|
501
501
|
if (E.get(i ?? !1)) return;
|
|
502
502
|
const h = E.get(s);
|
|
503
503
|
n?.(!h);
|
|
@@ -509,9 +509,9 @@ const De = (...e) => f.span(o.class($("emphasis")), ...e), ie = (...e) => f.span
|
|
|
509
509
|
baseContainer: !0,
|
|
510
510
|
growInput: !1,
|
|
511
511
|
...e,
|
|
512
|
-
input:
|
|
512
|
+
input: b.span(
|
|
513
513
|
o.class("bc-checkbox-input"),
|
|
514
|
-
|
|
514
|
+
b.span(
|
|
515
515
|
o.class("bc-checkbox-input__checkbox"),
|
|
516
516
|
o.class(
|
|
517
517
|
E.map(
|
|
@@ -535,7 +535,7 @@ const De = (...e) => f.span(o.class($("emphasis")), ...e), ie = (...e) => f.span
|
|
|
535
535
|
),
|
|
536
536
|
F.checked(s),
|
|
537
537
|
F.disabled(i),
|
|
538
|
-
r != null ? F.labelledby(
|
|
538
|
+
r != null ? F.labelledby(v) : T,
|
|
539
539
|
I.keydown(D),
|
|
540
540
|
t != null ? I.blur(t) : T,
|
|
541
541
|
R({
|
|
@@ -544,15 +544,15 @@ const De = (...e) => f.span(o.class($("emphasis")), ...e), ie = (...e) => f.span
|
|
|
544
544
|
a,
|
|
545
545
|
c
|
|
546
546
|
)(
|
|
547
|
-
(h,
|
|
547
|
+
(h, g, C) => h ? g ?? "akar-icons/check-box-fill" : C ?? "akar-icons/box"
|
|
548
548
|
),
|
|
549
549
|
accessibility: "decorative",
|
|
550
550
|
size: p
|
|
551
551
|
})
|
|
552
552
|
),
|
|
553
|
-
r != null ?
|
|
553
|
+
r != null ? b.label(
|
|
554
554
|
o.class("bc-checkbox-input__label"),
|
|
555
|
-
o.id(
|
|
555
|
+
o.id(v),
|
|
556
556
|
o.for(u),
|
|
557
557
|
ae(r)
|
|
558
558
|
) : T
|
|
@@ -560,7 +560,7 @@ const De = (...e) => f.span(o.class($("emphasis")), ...e), ie = (...e) => f.span
|
|
|
560
560
|
},
|
|
561
561
|
I.click(k)
|
|
562
562
|
);
|
|
563
|
-
}, le =
|
|
563
|
+
}, le = b.span(
|
|
564
564
|
o.class("bc-input-wrapper__required"),
|
|
565
565
|
" *"
|
|
566
566
|
);
|
|
@@ -588,14 +588,14 @@ const W = ({
|
|
|
588
588
|
labelFor: c,
|
|
589
589
|
hasError: p,
|
|
590
590
|
disabled: u,
|
|
591
|
-
layout:
|
|
591
|
+
layout: v,
|
|
592
592
|
labelWidth: k
|
|
593
593
|
}, ...D) => {
|
|
594
|
-
const h = p ?? a != null,
|
|
594
|
+
const h = p ?? a != null, g = u ?? !1, C = v ?? "vertical", M = N("input-wrapper"), O = i ? `${M}-description` : void 0, j = a != null ? `${M}-error` : void 0, P = w(C)((y) => y !== "vertical"), Q = w(
|
|
595
595
|
C,
|
|
596
596
|
k ?? void 0
|
|
597
597
|
)((y, A) => ue(y, A));
|
|
598
|
-
return
|
|
598
|
+
return b.div(
|
|
599
599
|
o.class(E.map(C, (y) => ce(y))),
|
|
600
600
|
o.class(
|
|
601
601
|
E.map(
|
|
@@ -604,18 +604,18 @@ const W = ({
|
|
|
604
604
|
)
|
|
605
605
|
),
|
|
606
606
|
o.style(Q),
|
|
607
|
-
t != null || r != null ?
|
|
607
|
+
t != null || r != null ? b.div(
|
|
608
608
|
o.class("bc-input-wrapper__header"),
|
|
609
|
-
|
|
609
|
+
b.div(
|
|
610
610
|
o.class("bc-input-wrapper__label-section"),
|
|
611
|
-
|
|
611
|
+
b.label(
|
|
612
612
|
o.class("bc-input-wrapper__label"),
|
|
613
613
|
c != null ? o.for(c) : T,
|
|
614
|
-
|
|
614
|
+
b.span(
|
|
615
615
|
o.class(
|
|
616
616
|
w(
|
|
617
617
|
h,
|
|
618
|
-
|
|
618
|
+
g
|
|
619
619
|
)(
|
|
620
620
|
(y, A) => oe(
|
|
621
621
|
y ?? !1,
|
|
@@ -633,7 +633,7 @@ const W = ({
|
|
|
633
633
|
P,
|
|
634
634
|
i
|
|
635
635
|
)((y, A) => y && A != null),
|
|
636
|
-
() =>
|
|
636
|
+
() => b.div(
|
|
637
637
|
o.class(
|
|
638
638
|
"bc-input-wrapper__description bc-input-wrapper__description--under-label"
|
|
639
639
|
),
|
|
@@ -645,20 +645,20 @@ const W = ({
|
|
|
645
645
|
r != null ? ie(r) : T,
|
|
646
646
|
n
|
|
647
647
|
) : T,
|
|
648
|
-
|
|
648
|
+
b.div(
|
|
649
649
|
o.class("bc-input-wrapper__content"),
|
|
650
650
|
// Add data attributes to help inputs inherit accessibility information
|
|
651
|
-
[O,
|
|
652
|
-
[O,
|
|
651
|
+
[O, j].filter(Boolean).length > 0 ? B.describedby(
|
|
652
|
+
[O, j].filter(Boolean).join(" ")
|
|
653
653
|
) : T,
|
|
654
|
-
s ?
|
|
655
|
-
x(h, () =>
|
|
654
|
+
s ? B.required("true") : T,
|
|
655
|
+
x(h, () => B.invalid("true")),
|
|
656
656
|
l
|
|
657
657
|
),
|
|
658
658
|
// Show description at bottom only when not horizontal
|
|
659
659
|
x(
|
|
660
660
|
w(P, i)((y, A) => !y && A != null),
|
|
661
|
-
() =>
|
|
661
|
+
() => b.div(
|
|
662
662
|
o.class("bc-input-wrapper__description"),
|
|
663
663
|
o.id(O),
|
|
664
664
|
i
|
|
@@ -666,9 +666,9 @@ const W = ({
|
|
|
666
666
|
),
|
|
667
667
|
x(
|
|
668
668
|
h,
|
|
669
|
-
() =>
|
|
669
|
+
() => b.div(
|
|
670
670
|
o.class("bc-input-wrapper__error"),
|
|
671
|
-
o.id(
|
|
671
|
+
o.id(j),
|
|
672
672
|
F.live("polite"),
|
|
673
673
|
// Announce errors to screen readers
|
|
674
674
|
o.role("alert"),
|
|
@@ -680,7 +680,7 @@ const W = ({
|
|
|
680
680
|
);
|
|
681
681
|
};
|
|
682
682
|
function Te(...e) {
|
|
683
|
-
return
|
|
683
|
+
return b.div(o.class("bc-stack"), ...e);
|
|
684
684
|
}
|
|
685
685
|
const he = (
|
|
686
686
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -762,13 +762,39 @@ function fe(e) {
|
|
|
762
762
|
...t.map(pe)
|
|
763
763
|
].join("");
|
|
764
764
|
}
|
|
765
|
+
const Ve = {
|
|
766
|
+
/** A valid validation result */
|
|
767
|
+
valid: f.valid,
|
|
768
|
+
/**
|
|
769
|
+
* Create an invalid validation with a message
|
|
770
|
+
*/
|
|
771
|
+
invalid(e) {
|
|
772
|
+
return f.invalid({ message: e });
|
|
773
|
+
},
|
|
774
|
+
/**
|
|
775
|
+
* Create an invalid validation with field-specific errors.
|
|
776
|
+
* Values can be error messages (strings) or full ControllerError objects.
|
|
777
|
+
*/
|
|
778
|
+
invalidFields(e) {
|
|
779
|
+
const s = {};
|
|
780
|
+
for (const [t, n] of Object.entries(e))
|
|
781
|
+
s[t] = typeof n == "string" ? { message: n } : n;
|
|
782
|
+
return f.invalid({ dependencies: s });
|
|
783
|
+
},
|
|
784
|
+
/**
|
|
785
|
+
* Create an invalid validation from a ControllerError object
|
|
786
|
+
*/
|
|
787
|
+
fromError(e) {
|
|
788
|
+
return f.invalid(e);
|
|
789
|
+
}
|
|
790
|
+
};
|
|
765
791
|
function L(e) {
|
|
766
792
|
return function(t) {
|
|
767
793
|
if (t.type === "valid") return t;
|
|
768
794
|
let n = t.error;
|
|
769
795
|
for (const r of e)
|
|
770
|
-
if (n = n?.dependencies?.[r], n == null) return
|
|
771
|
-
return
|
|
796
|
+
if (n = n?.dependencies?.[r], n == null) return f.valid;
|
|
797
|
+
return f.invalid(n);
|
|
772
798
|
};
|
|
773
799
|
}
|
|
774
800
|
class _ {
|
|
@@ -1011,8 +1037,8 @@ class me extends _ {
|
|
|
1011
1037
|
const a = n.map((u) => u ?? [], l);
|
|
1012
1038
|
super(s, t, a, r, i, l);
|
|
1013
1039
|
const c = a.on((u) => {
|
|
1014
|
-
const
|
|
1015
|
-
|
|
1040
|
+
const v = this.#e.length - u.length;
|
|
1041
|
+
v > 0 && (this.#e.splice(u.length, v).forEach((k, D) => {
|
|
1016
1042
|
const h = u.length + D;
|
|
1017
1043
|
k.dispose(), this.#s.get(h)?.(), this.#s.delete(h), this.#t.delete(h), this.#r.get(h)?.(), this.#r.delete(h), this.#i.delete(h);
|
|
1018
1044
|
}), this.#c(), this.#a());
|
|
@@ -1105,7 +1131,7 @@ class me extends _ {
|
|
|
1105
1131
|
this.#l.set(this.dirty.value || s);
|
|
1106
1132
|
};
|
|
1107
1133
|
}
|
|
1108
|
-
function
|
|
1134
|
+
function ve(e) {
|
|
1109
1135
|
function s(t) {
|
|
1110
1136
|
return typeof t == "number" ? t : t.toString();
|
|
1111
1137
|
}
|
|
@@ -1113,9 +1139,9 @@ function ge(e) {
|
|
|
1113
1139
|
(t) => typeof t == "object" && t.key != null ? s(t.key) : s(t)
|
|
1114
1140
|
);
|
|
1115
1141
|
}
|
|
1116
|
-
function
|
|
1142
|
+
function ge(e) {
|
|
1117
1143
|
const s = e.filter((r) => r.path == null || r.path.length === 0).map((r) => r.message), t = e.filter((r) => r.path != null && r.path.length > 0).reduce((r, i) => {
|
|
1118
|
-
const l =
|
|
1144
|
+
const l = ve(i.path), a = l.pop();
|
|
1119
1145
|
let c = r;
|
|
1120
1146
|
for (const p of l)
|
|
1121
1147
|
c.dependencies == null && (c.dependencies = {}), c.dependencies[p] == null && (c.dependencies[p] = {}), c = c.dependencies[p];
|
|
@@ -1135,25 +1161,25 @@ function ye({
|
|
|
1135
1161
|
validationMode: r,
|
|
1136
1162
|
validateDebounceMs: i
|
|
1137
1163
|
}) {
|
|
1138
|
-
const l = E.deriveProp(e), a = S(
|
|
1139
|
-
a.set(
|
|
1164
|
+
const l = E.deriveProp(e), a = S(f.valid), c = S(!1), p = S(r ?? "onTouched"), u = (g) => {
|
|
1165
|
+
a.set(g);
|
|
1140
1166
|
};
|
|
1141
|
-
let
|
|
1142
|
-
const k = async (
|
|
1167
|
+
let v;
|
|
1168
|
+
const k = async (g) => {
|
|
1143
1169
|
if (t != null) {
|
|
1144
|
-
const C = await t(
|
|
1170
|
+
const C = await t(g);
|
|
1145
1171
|
u(C);
|
|
1146
1172
|
}
|
|
1147
|
-
}, D = async (
|
|
1148
|
-
l.set(
|
|
1173
|
+
}, D = async (g) => {
|
|
1174
|
+
l.set(g), s?.(g);
|
|
1149
1175
|
const C = p.value;
|
|
1150
1176
|
if (t != null) {
|
|
1151
1177
|
if (C === "onSubmit")
|
|
1152
1178
|
return;
|
|
1153
1179
|
const M = i ?? 0;
|
|
1154
|
-
M > 0 ? (
|
|
1155
|
-
k(
|
|
1156
|
-
}, M)) : await k(
|
|
1180
|
+
M > 0 ? (v && clearTimeout(v), v = setTimeout(() => {
|
|
1181
|
+
k(g);
|
|
1182
|
+
}, M)) : await k(g);
|
|
1157
1183
|
}
|
|
1158
1184
|
}, h = new _(
|
|
1159
1185
|
[],
|
|
@@ -1167,13 +1193,13 @@ function ye({
|
|
|
1167
1193
|
n ?? V
|
|
1168
1194
|
);
|
|
1169
1195
|
return h.onDispose(() => {
|
|
1170
|
-
c.dispose(), l.dispose(), a.dispose(), p.dispose(),
|
|
1196
|
+
c.dispose(), l.dispose(), a.dispose(), p.dispose(), v && clearTimeout(v);
|
|
1171
1197
|
}), { controller: h, setStatus: u };
|
|
1172
1198
|
}
|
|
1173
1199
|
function G(e) {
|
|
1174
1200
|
return q(o.disabled(e.disabled), o.name(e.name));
|
|
1175
1201
|
}
|
|
1176
|
-
function
|
|
1202
|
+
function Me(e, {
|
|
1177
1203
|
triggerOn: s = "change"
|
|
1178
1204
|
} = {}) {
|
|
1179
1205
|
return q(
|
|
@@ -1182,7 +1208,7 @@ function Ve(e, {
|
|
|
1182
1208
|
(s === "input" ? I.input : I.change)(ee(e.change))
|
|
1183
1209
|
);
|
|
1184
1210
|
}
|
|
1185
|
-
function
|
|
1211
|
+
function Fe(e, {
|
|
1186
1212
|
triggerOn: s = "change"
|
|
1187
1213
|
} = {}) {
|
|
1188
1214
|
return q(
|
|
@@ -1194,9 +1220,9 @@ function Me(e, {
|
|
|
1194
1220
|
);
|
|
1195
1221
|
}
|
|
1196
1222
|
function U(e) {
|
|
1197
|
-
return e.issues != null ?
|
|
1223
|
+
return e.issues != null ? f.invalid(ge(e.issues)) : f.valid;
|
|
1198
1224
|
}
|
|
1199
|
-
async function
|
|
1225
|
+
async function Oe({
|
|
1200
1226
|
task: e,
|
|
1201
1227
|
errorMessage: s,
|
|
1202
1228
|
errorPath: t = ["root"],
|
|
@@ -1204,12 +1230,12 @@ async function Fe({
|
|
|
1204
1230
|
}) {
|
|
1205
1231
|
try {
|
|
1206
1232
|
const r = await e();
|
|
1207
|
-
return n != null ? n(r) :
|
|
1233
|
+
return n != null ? n(r) : f.valid;
|
|
1208
1234
|
} catch (r) {
|
|
1209
1235
|
const i = s ?? (r instanceof Error ? r.message : "Operation failed");
|
|
1210
|
-
return t.length === 1 && t[0] === "root" ?
|
|
1236
|
+
return t.length === 1 && t[0] === "root" ? f.invalid({
|
|
1211
1237
|
message: i
|
|
1212
|
-
}) :
|
|
1238
|
+
}) : f.invalid({
|
|
1213
1239
|
dependencies: J(t, i)
|
|
1214
1240
|
});
|
|
1215
1241
|
}
|
|
@@ -1226,10 +1252,10 @@ function J(e, s) {
|
|
|
1226
1252
|
}
|
|
1227
1253
|
};
|
|
1228
1254
|
}
|
|
1229
|
-
function
|
|
1255
|
+
function xe({
|
|
1230
1256
|
initialValue: e = {},
|
|
1231
1257
|
schema: s,
|
|
1232
|
-
onSubmit: t = async () =>
|
|
1258
|
+
onSubmit: t = async () => f.valid,
|
|
1233
1259
|
validationMode: n,
|
|
1234
1260
|
validateDebounceMs: r
|
|
1235
1261
|
}) {
|
|
@@ -1254,8 +1280,8 @@ function Oe({
|
|
|
1254
1280
|
return;
|
|
1255
1281
|
}
|
|
1256
1282
|
}
|
|
1257
|
-
const
|
|
1258
|
-
a.set(!1),
|
|
1283
|
+
const v = await t(c.signal.value);
|
|
1284
|
+
a.set(!1), v.type === "invalid" && l(v);
|
|
1259
1285
|
},
|
|
1260
1286
|
submitting: a
|
|
1261
1287
|
};
|
|
@@ -1272,7 +1298,7 @@ export {
|
|
|
1272
1298
|
V as O,
|
|
1273
1299
|
le as R,
|
|
1274
1300
|
Te as S,
|
|
1275
|
-
|
|
1301
|
+
f as a,
|
|
1276
1302
|
Ee as b,
|
|
1277
1303
|
_e as c,
|
|
1278
1304
|
z as d,
|
|
@@ -1283,16 +1309,17 @@ export {
|
|
|
1283
1309
|
de as i,
|
|
1284
1310
|
Ae as j,
|
|
1285
1311
|
fe as k,
|
|
1286
|
-
|
|
1312
|
+
Ve as l,
|
|
1287
1313
|
he as m,
|
|
1288
1314
|
ve as n,
|
|
1289
|
-
|
|
1315
|
+
ge as o,
|
|
1290
1316
|
Ie as p,
|
|
1291
|
-
|
|
1317
|
+
G as q,
|
|
1292
1318
|
Me as r,
|
|
1293
1319
|
N as s,
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
pe as w
|
|
1320
|
+
Oe as t,
|
|
1321
|
+
xe as u,
|
|
1322
|
+
Fe as v,
|
|
1323
|
+
pe as w,
|
|
1324
|
+
U as x
|
|
1298
1325
|
};
|