@tempots/beatui 0.32.2 → 0.34.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/README.md +9 -0
- package/dist/{2019-BMZkvreo.cjs → 2019-DJeW9RI7.cjs} +1 -1
- package/dist/{2019-BAbSTPyW.js → 2019-Dmseo7Cq.js} +2 -2
- package/dist/{2020-COaJ7nGc.cjs → 2020-BySxLQc5.cjs} +1 -1
- package/dist/{2020-BQNEk3m-.js → 2020-I1mnGGtD.js} +2 -2
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +27 -27
- package/dist/beatui.css +95 -11
- package/dist/beatui.tailwind.css +95 -11
- package/dist/hls-B7ZdiUxL.js +21734 -0
- package/dist/hls-C6lKM-CG.cjs +40 -0
- package/dist/{index-DqeaEUPG.cjs → index-BBIdmCak.cjs} +1 -1
- package/dist/{index-CDOHHPwQ.js → index-BXjEbt8G.js} +2 -2
- package/dist/{index-1_pssujS.cjs → index-CBc0q0zl.cjs} +2 -2
- package/dist/{index-CFh4D56e.cjs → index-Ct2_ulan.cjs} +1 -1
- package/dist/{index-DfmwsIle.js → index-D-CBfcZj.js} +37 -35
- package/dist/{index-E76KKV9V.js → index-DbQzJti7.js} +1 -1
- package/dist/{index-B4irUWVb.cjs → index-HIb25Ti2.cjs} +1 -1
- package/dist/{index-Caetcp0r.js → index-xdCnysNz.js} +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +2202 -1766
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +1 -1
- package/dist/{modal-CepbiM3u.cjs → modal-AFhB4rIq.cjs} +1 -1
- package/dist/{modal-eY-3j_zS.js → modal-Dm61yY5i.js} +2 -2
- package/dist/monaco/index.cjs.js +1 -1
- package/dist/monaco/index.es.js +2 -2
- package/dist/{notice-Ct8ZHvwq.js → notice-Cd9ElXwb.js} +234 -234
- package/dist/notice-len8sDjL.cjs +2 -0
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/theme-B5pmbvQ_.js +37 -0
- package/dist/theme-Dt6lCAvY.cjs +1 -0
- package/dist/timer-DK_yKNwE.cjs +1 -0
- package/dist/timer-DzWb416P.js +51 -0
- package/dist/types/components/beatui.d.ts +2 -1
- package/dist/types/components/form/controller/color-controller.d.ts +1 -1
- package/dist/types/components/form/controller/controller.d.ts +4 -4
- package/dist/types/components/form/controller/union-controller.d.ts +1 -1
- package/dist/types/components/media/base-video-player.d.ts +77 -0
- package/dist/types/components/media/index.d.ts +1 -0
- package/dist/types/components/overlay/index.d.ts +1 -0
- package/dist/types/components/overlay/lightbox.d.ts +22 -0
- package/dist/types/components/theme/theme.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/utils-BetBqtiV.cjs +1 -0
- package/dist/{utils-CuD-_CDx.js → utils-g5YCiiS6.js} +8 -8
- package/package.json +3 -1
- package/dist/notice-cpODDUvJ.cjs +0 -2
- package/dist/theme-B7C5kIJj.cjs +0 -1
- package/dist/theme-DsQOxXW1.js +0 -34
- package/dist/timer-BdH4cK6a.cjs +0 -1
- package/dist/timer-CQlK5LhW.js +0 -47
- package/dist/utils-CCAYvnZh.cjs +0 -1
|
@@ -137,9 +137,9 @@ const k = {
|
|
|
137
137
|
match: (e, {
|
|
138
138
|
success: s,
|
|
139
139
|
failure: t,
|
|
140
|
-
loading:
|
|
141
|
-
notAsked: n =
|
|
142
|
-
}) => k.isSuccess(e) ? s(e.value) : k.isFailure(e) ? t(e.error) : k.isNotAsked(e) ? n() :
|
|
140
|
+
loading: i,
|
|
141
|
+
notAsked: n = i
|
|
142
|
+
}) => k.isSuccess(e) ? s(e.value) : k.isFailure(e) ? t(e.error) : k.isNotAsked(e) ? n() : i(e.previousValue),
|
|
143
143
|
/**
|
|
144
144
|
* When the result is a success, it applies the function to the value.
|
|
145
145
|
*
|
|
@@ -166,8 +166,8 @@ const k = {
|
|
|
166
166
|
* @returns `true` if the results are equal, `false` otherwise.
|
|
167
167
|
*/
|
|
168
168
|
equals: (e, s, t = {
|
|
169
|
-
valueEquals: (
|
|
170
|
-
errorEquals: (
|
|
169
|
+
valueEquals: (i, n) => i === n,
|
|
170
|
+
errorEquals: (i, n) => i === n
|
|
171
171
|
}) => e.type === "AsyncSuccess" && s.type === "AsyncSuccess" ? t.valueEquals(e.value, s.value) : e.type === "AsyncFailure" && s.type === "AsyncFailure" ? t.errorEquals(e.error, s.error) : e.type === "Loading" && s.type === "Loading" ? t.valueEquals(e.previousValue, s.previousValue) : e.type === "NotAsked" && s.type === "NotAsked",
|
|
172
172
|
/**
|
|
173
173
|
* Combines multiple results into a single result.
|
|
@@ -416,18 +416,18 @@ const k = {
|
|
|
416
416
|
* @returns The combined result.
|
|
417
417
|
* @public
|
|
418
418
|
*/
|
|
419
|
-
combine: (e, s, t,
|
|
419
|
+
combine: (e, s, t, i) => m.match(
|
|
420
420
|
e,
|
|
421
421
|
(n) => m.match(
|
|
422
422
|
s,
|
|
423
|
-
(
|
|
424
|
-
(
|
|
423
|
+
(a) => m.success(t(n, a)),
|
|
424
|
+
(a) => m.failure(a)
|
|
425
425
|
),
|
|
426
426
|
(n) => m.match(
|
|
427
427
|
s,
|
|
428
428
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
429
|
-
(
|
|
430
|
-
(
|
|
429
|
+
(a) => m.failure(n),
|
|
430
|
+
(a) => m.failure(i(n, a))
|
|
431
431
|
)
|
|
432
432
|
),
|
|
433
433
|
/**
|
|
@@ -438,8 +438,8 @@ const k = {
|
|
|
438
438
|
* @returns `true` if the results are equal, `false` otherwise.
|
|
439
439
|
*/
|
|
440
440
|
equals: (e, s, t = {
|
|
441
|
-
valueEquals: (
|
|
442
|
-
errorEquals: (
|
|
441
|
+
valueEquals: (i, n) => i === n,
|
|
442
|
+
errorEquals: (i, n) => i === n
|
|
443
443
|
}) => e.type === "Success" && s.type === "Success" ? t.valueEquals(e.value, s.value) : e.type === "Failure" && s.type === "Failure" ? t.errorEquals(e.error, s.error) : !1,
|
|
444
444
|
/**
|
|
445
445
|
* Combines multiple results into a single result.
|
|
@@ -456,25 +456,25 @@ const k = {
|
|
|
456
456
|
return m.success(s);
|
|
457
457
|
}
|
|
458
458
|
};
|
|
459
|
-
function
|
|
459
|
+
function ie({
|
|
460
460
|
size: e = "sm",
|
|
461
461
|
icon: s = "line-md:close",
|
|
462
462
|
disabled: t,
|
|
463
|
-
roundedness:
|
|
463
|
+
roundedness: i = "full",
|
|
464
464
|
color: n = "base",
|
|
465
|
-
onClick:
|
|
466
|
-
label:
|
|
465
|
+
onClick: a,
|
|
466
|
+
label: r
|
|
467
467
|
}, ...l) {
|
|
468
468
|
return N(L, (c) => {
|
|
469
|
-
const f = R(
|
|
469
|
+
const f = R(r, c.$.closeModal);
|
|
470
470
|
return ne(
|
|
471
471
|
{
|
|
472
472
|
variant: "text",
|
|
473
473
|
size: e,
|
|
474
|
-
roundedness:
|
|
474
|
+
roundedness: i,
|
|
475
475
|
disabled: t,
|
|
476
476
|
color: n,
|
|
477
|
-
onClick:
|
|
477
|
+
onClick: a
|
|
478
478
|
},
|
|
479
479
|
o.title(f),
|
|
480
480
|
x.label(f),
|
|
@@ -486,23 +486,23 @@ function ae({
|
|
|
486
486
|
function j(e) {
|
|
487
487
|
return `bc-label bc-label--${e}`;
|
|
488
488
|
}
|
|
489
|
-
const De = (...e) => b.span(o.class(j("emphasis")), ...e),
|
|
489
|
+
const De = (...e) => b.span(o.class(j("emphasis")), ...e), ae = (...e) => b.span(o.class(j("default")), ...e), re = (...e) => b.span(o.class(j("muted")), ...e), Ee = (...e) => b.span(o.class(j("danger")), ...e), Te = (e) => {
|
|
490
490
|
const {
|
|
491
491
|
value: s,
|
|
492
492
|
onBlur: t,
|
|
493
|
-
onChange:
|
|
493
|
+
onChange: i,
|
|
494
494
|
placeholder: n,
|
|
495
|
-
disabled:
|
|
496
|
-
id:
|
|
495
|
+
disabled: a,
|
|
496
|
+
id: r,
|
|
497
497
|
checkedIcon: l,
|
|
498
498
|
uncheckedIcon: c,
|
|
499
499
|
iconSize: f = "lg"
|
|
500
|
-
} = e, u =
|
|
501
|
-
if (C.get(
|
|
500
|
+
} = e, u = r ?? K("checkbox"), g = `${u}-label`, y = () => {
|
|
501
|
+
if (C.get(a ?? !1)) return;
|
|
502
502
|
const h = C.get(s);
|
|
503
|
-
|
|
504
|
-
},
|
|
505
|
-
C.get(
|
|
503
|
+
i?.(!h);
|
|
504
|
+
}, v = (h) => {
|
|
505
|
+
C.get(a ?? !1) || (h.key === " " || h.key === "Enter") && (h.preventDefault(), y());
|
|
506
506
|
};
|
|
507
507
|
return z(
|
|
508
508
|
{
|
|
@@ -521,7 +521,7 @@ const De = (...e) => b.span(o.class(j("emphasis")), ...e), re = (...e) => b.span
|
|
|
521
521
|
),
|
|
522
522
|
o.class(
|
|
523
523
|
C.map(
|
|
524
|
-
|
|
524
|
+
a ?? !1,
|
|
525
525
|
(h) => h ? "bc-checkbox-input__checkbox--disabled" : ""
|
|
526
526
|
)
|
|
527
527
|
),
|
|
@@ -529,14 +529,14 @@ const De = (...e) => b.span(o.class(j("emphasis")), ...e), re = (...e) => b.span
|
|
|
529
529
|
o.role("checkbox"),
|
|
530
530
|
o.tabindex(
|
|
531
531
|
C.map(
|
|
532
|
-
|
|
532
|
+
a ?? !1,
|
|
533
533
|
(h) => h ? -1 : 0
|
|
534
534
|
)
|
|
535
535
|
),
|
|
536
536
|
x.checked(s),
|
|
537
|
-
x.disabled(
|
|
538
|
-
n != null ? x.labelledby(
|
|
539
|
-
D.keydown(
|
|
537
|
+
x.disabled(a),
|
|
538
|
+
n != null ? x.labelledby(g) : w,
|
|
539
|
+
D.keydown(v),
|
|
540
540
|
t != null ? D.blur(t) : w,
|
|
541
541
|
P({
|
|
542
542
|
icon: _(
|
|
@@ -552,13 +552,13 @@ const De = (...e) => b.span(o.class(j("emphasis")), ...e), re = (...e) => b.span
|
|
|
552
552
|
),
|
|
553
553
|
n != null ? b.label(
|
|
554
554
|
o.class("bc-checkbox-input__label"),
|
|
555
|
-
o.id(
|
|
555
|
+
o.id(g),
|
|
556
556
|
o.for(u),
|
|
557
|
-
|
|
557
|
+
re(n)
|
|
558
558
|
) : w
|
|
559
559
|
)
|
|
560
560
|
},
|
|
561
|
-
D.click(
|
|
561
|
+
D.click(y)
|
|
562
562
|
);
|
|
563
563
|
}, le = b.span(
|
|
564
564
|
o.class("bc-input-wrapper__required"),
|
|
@@ -576,21 +576,21 @@ const G = ({
|
|
|
576
576
|
required: e,
|
|
577
577
|
label: s,
|
|
578
578
|
labelChildren: t,
|
|
579
|
-
context:
|
|
579
|
+
context: i,
|
|
580
580
|
description: n,
|
|
581
|
-
content:
|
|
582
|
-
error:
|
|
581
|
+
content: a,
|
|
582
|
+
error: r,
|
|
583
583
|
labelFor: l,
|
|
584
584
|
hasError: c,
|
|
585
585
|
disabled: f,
|
|
586
586
|
horizontal: u
|
|
587
|
-
}, ...
|
|
588
|
-
const
|
|
587
|
+
}, ...g) => {
|
|
588
|
+
const y = c ?? r != null, v = f ?? !1, h = u ?? !1, d = K("input-wrapper"), p = n ? `${d}-description` : void 0, E = r != null ? `${d}-error` : void 0;
|
|
589
589
|
return b.div(
|
|
590
590
|
o.class(
|
|
591
591
|
C.map(h, (T) => ce(T))
|
|
592
592
|
),
|
|
593
|
-
s != null ||
|
|
593
|
+
s != null || i != null ? b.div(
|
|
594
594
|
o.class("bc-input-wrapper__header"),
|
|
595
595
|
b.div(
|
|
596
596
|
o.class("bc-input-wrapper__label-section"),
|
|
@@ -600,8 +600,8 @@ const G = ({
|
|
|
600
600
|
b.span(
|
|
601
601
|
o.class(
|
|
602
602
|
_(
|
|
603
|
-
|
|
604
|
-
|
|
603
|
+
y,
|
|
604
|
+
v
|
|
605
605
|
)(
|
|
606
606
|
(T, A) => oe(
|
|
607
607
|
T ?? !1,
|
|
@@ -628,7 +628,7 @@ const G = ({
|
|
|
628
628
|
)
|
|
629
629
|
)
|
|
630
630
|
),
|
|
631
|
-
|
|
631
|
+
i != null ? ae(i) : w,
|
|
632
632
|
t
|
|
633
633
|
) : w,
|
|
634
634
|
b.div(
|
|
@@ -638,8 +638,8 @@ const G = ({
|
|
|
638
638
|
[p, E].filter(Boolean).join(" ")
|
|
639
639
|
) : w,
|
|
640
640
|
e ? q.required("true") : w,
|
|
641
|
-
V(
|
|
642
|
-
|
|
641
|
+
V(y, () => q.invalid("true")),
|
|
642
|
+
a
|
|
643
643
|
),
|
|
644
644
|
// Show description at bottom only when not horizontal
|
|
645
645
|
V(
|
|
@@ -653,8 +653,8 @@ const G = ({
|
|
|
653
653
|
n
|
|
654
654
|
)
|
|
655
655
|
),
|
|
656
|
-
|
|
657
|
-
|
|
656
|
+
r != null ? V(
|
|
657
|
+
y,
|
|
658
658
|
() => b.div(
|
|
659
659
|
o.class("bc-input-wrapper__error"),
|
|
660
660
|
o.id(E),
|
|
@@ -662,10 +662,10 @@ const G = ({
|
|
|
662
662
|
// Announce errors to screen readers
|
|
663
663
|
o.role("alert"),
|
|
664
664
|
// Mark as alert for immediate attention
|
|
665
|
-
|
|
665
|
+
r
|
|
666
666
|
)
|
|
667
667
|
) : null,
|
|
668
|
-
...
|
|
668
|
+
...g
|
|
669
669
|
);
|
|
670
670
|
};
|
|
671
671
|
function Ie(...e) {
|
|
@@ -678,12 +678,12 @@ const Ae = (e) => {
|
|
|
678
678
|
...e
|
|
679
679
|
}, {
|
|
680
680
|
value: t,
|
|
681
|
-
before:
|
|
681
|
+
before: i,
|
|
682
682
|
onBlur: n,
|
|
683
|
-
onChange:
|
|
684
|
-
onInput:
|
|
683
|
+
onChange: a,
|
|
684
|
+
onInput: r,
|
|
685
685
|
placeholder: l
|
|
686
|
-
} = s, c =
|
|
686
|
+
} = s, c = i ?? P({
|
|
687
687
|
icon: "line-md:email",
|
|
688
688
|
size: "sm",
|
|
689
689
|
color: "neutral"
|
|
@@ -699,8 +699,8 @@ const Ae = (e) => {
|
|
|
699
699
|
o.value(t),
|
|
700
700
|
o.class("bc-input"),
|
|
701
701
|
n != null ? D.blur(M(n)) : w,
|
|
702
|
-
|
|
703
|
-
|
|
702
|
+
a != null ? D.change(M(a)) : w,
|
|
703
|
+
r != null ? D.input(M(r)) : w
|
|
704
704
|
)
|
|
705
705
|
})
|
|
706
706
|
);
|
|
@@ -708,61 +708,61 @@ const Ae = (e) => {
|
|
|
708
708
|
const {
|
|
709
709
|
value: s,
|
|
710
710
|
onBlur: t,
|
|
711
|
-
onChange:
|
|
711
|
+
onChange: i,
|
|
712
712
|
onInput: n,
|
|
713
|
-
before:
|
|
714
|
-
after:
|
|
713
|
+
before: a,
|
|
714
|
+
after: r,
|
|
715
715
|
hasError: l,
|
|
716
716
|
disabled: c,
|
|
717
717
|
autocomplete: f,
|
|
718
718
|
placeholder: u,
|
|
719
|
-
...
|
|
720
|
-
} = e,
|
|
719
|
+
...g
|
|
720
|
+
} = e, y = {
|
|
721
721
|
name: "password",
|
|
722
722
|
disabled: c,
|
|
723
|
-
...
|
|
724
|
-
},
|
|
725
|
-
|
|
723
|
+
...g
|
|
724
|
+
}, v = I(!0), h = _(
|
|
725
|
+
v,
|
|
726
726
|
f
|
|
727
727
|
)((d, p) => d ? p ?? "current-password" : "off");
|
|
728
728
|
return N(L, (d) => {
|
|
729
729
|
const p = _(
|
|
730
730
|
d.$.passwordPlaceholderText,
|
|
731
|
-
|
|
731
|
+
v,
|
|
732
732
|
u
|
|
733
733
|
)((T, A, Y) => A ? "•••••••••••••••" : Y ?? T), E = b.button(
|
|
734
734
|
o.type("button"),
|
|
735
735
|
o.class("bc-input-container__password-toggle"),
|
|
736
736
|
x.label(d.$.togglePasswordVisibility),
|
|
737
|
-
D.click(() =>
|
|
737
|
+
D.click(() => v.update((T) => !T)),
|
|
738
738
|
V(
|
|
739
|
-
|
|
739
|
+
v,
|
|
740
740
|
() => P({ icon: "line-md:watch" }),
|
|
741
741
|
() => P({ icon: "line-md:watch-off" })
|
|
742
742
|
)
|
|
743
743
|
);
|
|
744
744
|
return z({
|
|
745
|
-
before:
|
|
745
|
+
before: a,
|
|
746
746
|
disabled: c,
|
|
747
747
|
hasError: l,
|
|
748
748
|
input: b.input(
|
|
749
749
|
W({
|
|
750
|
-
...
|
|
750
|
+
...y,
|
|
751
751
|
autocomplete: h,
|
|
752
752
|
placeholder: p
|
|
753
753
|
}),
|
|
754
754
|
V(
|
|
755
|
-
|
|
755
|
+
v,
|
|
756
756
|
() => F(o.type("password")),
|
|
757
757
|
() => F(o.type("text"))
|
|
758
758
|
),
|
|
759
759
|
o.class("bc-input"),
|
|
760
760
|
o.value(s),
|
|
761
761
|
t != null ? D.blur(M(t)) : w,
|
|
762
|
-
|
|
762
|
+
i != null ? D.change(M(i)) : w,
|
|
763
763
|
n != null ? D.input(M(n)) : w
|
|
764
764
|
),
|
|
765
|
-
after:
|
|
765
|
+
after: r != null ? F(E, r) : E
|
|
766
766
|
});
|
|
767
767
|
});
|
|
768
768
|
}, ue = (
|
|
@@ -774,15 +774,15 @@ const Ae = (e) => {
|
|
|
774
774
|
e.change(t), s?.(t);
|
|
775
775
|
};
|
|
776
776
|
function J(e, s) {
|
|
777
|
-
const { controller: t, onBlur:
|
|
777
|
+
const { controller: t, onBlur: i, onChange: n, ...a } = s;
|
|
778
778
|
return e({
|
|
779
779
|
id: t.name,
|
|
780
780
|
disabled: t.disabled,
|
|
781
|
-
value: t.
|
|
781
|
+
value: t.signal,
|
|
782
782
|
hasError: t.errorVisible,
|
|
783
|
-
...
|
|
783
|
+
...a,
|
|
784
784
|
onChange: he(t, n),
|
|
785
|
-
onBlur: ue(t,
|
|
785
|
+
onBlur: ue(t, i)
|
|
786
786
|
});
|
|
787
787
|
}
|
|
788
788
|
function Oe(e, s, ...t) {
|
|
@@ -798,10 +798,10 @@ function Oe(e, s, ...t) {
|
|
|
798
798
|
);
|
|
799
799
|
}
|
|
800
800
|
function de(e, s) {
|
|
801
|
-
const { toInput: t, fromInput:
|
|
801
|
+
const { toInput: t, fromInput: i, controller: n, ...a } = s, r = n.transform(t, i);
|
|
802
802
|
return J(e, {
|
|
803
|
-
...
|
|
804
|
-
controller:
|
|
803
|
+
...a,
|
|
804
|
+
controller: r
|
|
805
805
|
});
|
|
806
806
|
}
|
|
807
807
|
function Me(e, s, ...t) {
|
|
@@ -815,8 +815,8 @@ function Me(e, s, ...t) {
|
|
|
815
815
|
}
|
|
816
816
|
function $e(e) {
|
|
817
817
|
return e.split(".").map((t) => {
|
|
818
|
-
const
|
|
819
|
-
return
|
|
818
|
+
const i = t.match(/^\[(\d+)\]$/);
|
|
819
|
+
return i ? Number(i[1]) : t;
|
|
820
820
|
});
|
|
821
821
|
}
|
|
822
822
|
function pe(e) {
|
|
@@ -833,16 +833,16 @@ function fe(e) {
|
|
|
833
833
|
function B(e) {
|
|
834
834
|
return function(t) {
|
|
835
835
|
if (t.type === "valid") return t;
|
|
836
|
-
let
|
|
836
|
+
let i = t.error;
|
|
837
837
|
for (const n of e)
|
|
838
|
-
if (
|
|
839
|
-
return S.invalid(
|
|
838
|
+
if (i = i?.dependencies?.[n], i == null) return S.valid;
|
|
839
|
+
return S.invalid(i);
|
|
840
840
|
};
|
|
841
841
|
}
|
|
842
842
|
class O {
|
|
843
843
|
path;
|
|
844
844
|
change;
|
|
845
|
-
|
|
845
|
+
signal;
|
|
846
846
|
status;
|
|
847
847
|
error;
|
|
848
848
|
hasError;
|
|
@@ -860,24 +860,24 @@ class O {
|
|
|
860
860
|
disabled;
|
|
861
861
|
#n = [];
|
|
862
862
|
disabledOrHasErrors;
|
|
863
|
-
constructor(s, t,
|
|
864
|
-
this.path = s, this.change = t, this.
|
|
863
|
+
constructor(s, t, i, n, a, r = $) {
|
|
864
|
+
this.path = s, this.change = t, this.signal = i, this.status = n, this.#t = r, this.#s.set(i.value), this.error = n.map(
|
|
865
865
|
(l) => l?.type === "invalid" ? l.error?.message : void 0
|
|
866
|
-
), this.hasError = this.error.map((l) => l != null), this.touched = this.#e.touched,
|
|
866
|
+
), this.hasError = this.error.map((l) => l != null), this.touched = this.#e.touched, a.validationMode ? this.errorVisible = _(
|
|
867
867
|
this.hasError,
|
|
868
868
|
this.touched,
|
|
869
|
-
|
|
869
|
+
a.validationMode
|
|
870
870
|
)((l, c, f) => f === "continuous" ? !!l : !!l && !!c) : this.errorVisible = _(
|
|
871
871
|
this.hasError,
|
|
872
872
|
this.touched
|
|
873
873
|
)((l, c) => !!l && !!c), this.dirty = _(
|
|
874
|
-
this.
|
|
874
|
+
this.signal,
|
|
875
875
|
this.#s
|
|
876
876
|
)((l, c) => !this.#t(l, c)), this.dependencyErrors = n.map(
|
|
877
877
|
(l) => l?.type === "invalid" ? l.error?.dependencies : void 0
|
|
878
|
-
), this.parent =
|
|
878
|
+
), this.parent = a, this.disabled = _(
|
|
879
879
|
this.#e.disabled,
|
|
880
|
-
|
|
880
|
+
a.disabled
|
|
881
881
|
)((l, c) => l || c), this.disabledOrHasErrors = _(
|
|
882
882
|
this.disabled,
|
|
883
883
|
this.hasError
|
|
@@ -912,7 +912,7 @@ class O {
|
|
|
912
912
|
this.#e.touched.set(!1);
|
|
913
913
|
};
|
|
914
914
|
markPristine = () => {
|
|
915
|
-
this.#s.set(this.
|
|
915
|
+
this.#s.set(this.signal.value);
|
|
916
916
|
};
|
|
917
917
|
reset = () => {
|
|
918
918
|
this.change(this.#s.value);
|
|
@@ -921,7 +921,7 @@ class O {
|
|
|
921
921
|
this.path,
|
|
922
922
|
this.change,
|
|
923
923
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
924
|
-
this.
|
|
924
|
+
this.signal,
|
|
925
925
|
this.status,
|
|
926
926
|
this.parent,
|
|
927
927
|
s
|
|
@@ -929,28 +929,28 @@ class O {
|
|
|
929
929
|
object = (s = $) => new be(
|
|
930
930
|
this.path,
|
|
931
931
|
this.change,
|
|
932
|
-
this.
|
|
932
|
+
this.signal,
|
|
933
933
|
this.status,
|
|
934
934
|
this.parent,
|
|
935
935
|
s
|
|
936
936
|
);
|
|
937
|
-
transform = (s, t,
|
|
938
|
-
[...this.path, ...
|
|
939
|
-
(
|
|
940
|
-
this.
|
|
941
|
-
this.status.map(B(
|
|
937
|
+
transform = (s, t, i = [], n = $) => new O(
|
|
938
|
+
[...this.path, ...i],
|
|
939
|
+
(a) => this.change(t(a)),
|
|
940
|
+
this.signal.map(s, n),
|
|
941
|
+
this.status.map(B(i)),
|
|
942
942
|
this.parent,
|
|
943
943
|
n
|
|
944
944
|
);
|
|
945
|
-
asyncTransform = (s, t,
|
|
945
|
+
asyncTransform = (s, t, i, n = [], a = $) => new O(
|
|
946
946
|
[...this.path, ...n],
|
|
947
|
-
(
|
|
948
|
-
t(
|
|
947
|
+
(r) => {
|
|
948
|
+
t(r).then((l) => this.change(l));
|
|
949
949
|
},
|
|
950
|
-
this.
|
|
950
|
+
this.signal.mapAsync(s, i, void 0, a),
|
|
951
951
|
this.status.map(B(n)),
|
|
952
952
|
this.parent,
|
|
953
|
-
|
|
953
|
+
a
|
|
954
954
|
);
|
|
955
955
|
}
|
|
956
956
|
class be extends O {
|
|
@@ -959,8 +959,8 @@ class be extends O {
|
|
|
959
959
|
#s = /* @__PURE__ */ new Map();
|
|
960
960
|
#n = I(!1);
|
|
961
961
|
touchedDeep = this.#n;
|
|
962
|
-
#r = /* @__PURE__ */ new Map();
|
|
963
962
|
#a = /* @__PURE__ */ new Map();
|
|
963
|
+
#i = /* @__PURE__ */ new Map();
|
|
964
964
|
#l = I(!1);
|
|
965
965
|
dirtyDeep = this.#l;
|
|
966
966
|
#o;
|
|
@@ -974,42 +974,42 @@ class be extends O {
|
|
|
974
974
|
}
|
|
975
975
|
this.#n.set(this.touched.value || s);
|
|
976
976
|
};
|
|
977
|
-
constructor(s, t,
|
|
977
|
+
constructor(s, t, i, n, a, r) {
|
|
978
978
|
super(
|
|
979
979
|
s,
|
|
980
980
|
t,
|
|
981
|
-
|
|
981
|
+
i.map((c) => c ?? {}, r),
|
|
982
982
|
n,
|
|
983
|
-
|
|
984
|
-
|
|
983
|
+
a,
|
|
984
|
+
r
|
|
985
985
|
), this.#o = this.touched.on(() => {
|
|
986
986
|
this.#c();
|
|
987
987
|
}), this.#u = this.dirty.on(() => {
|
|
988
|
-
this.#
|
|
988
|
+
this.#r();
|
|
989
989
|
});
|
|
990
|
-
const l = this.
|
|
990
|
+
const l = this.signal.on(() => this.#r());
|
|
991
991
|
this.onDispose(() => {
|
|
992
992
|
for (const c of this.#e.values())
|
|
993
993
|
c.dispose();
|
|
994
994
|
this.#e.clear();
|
|
995
995
|
for (const c of this.#s.values()) c();
|
|
996
996
|
this.#s.clear(), this.#t.clear(), this.#n.dispose();
|
|
997
|
-
for (const c of this.#
|
|
998
|
-
this.#
|
|
997
|
+
for (const c of this.#i.values()) c();
|
|
998
|
+
this.#i.clear(), this.#a.clear(), this.#l.dispose(), this.#o(), this.#u(), l();
|
|
999
999
|
});
|
|
1000
1000
|
}
|
|
1001
1001
|
field = (s) => {
|
|
1002
1002
|
if (this.#e.has(s))
|
|
1003
1003
|
return this.#e.get(s);
|
|
1004
|
-
const t = async (
|
|
1004
|
+
const t = async (r) => {
|
|
1005
1005
|
this.change({
|
|
1006
|
-
...this.
|
|
1007
|
-
[s]:
|
|
1006
|
+
...this.signal.value,
|
|
1007
|
+
[s]: r
|
|
1008
1008
|
});
|
|
1009
|
-
},
|
|
1009
|
+
}, i = new O(
|
|
1010
1010
|
[...this.path, s],
|
|
1011
1011
|
t,
|
|
1012
|
-
this.
|
|
1012
|
+
this.signal.map((r) => r[s]),
|
|
1013
1013
|
this.status.map(B([s])),
|
|
1014
1014
|
{
|
|
1015
1015
|
disabled: this.disabled,
|
|
@@ -1017,19 +1017,19 @@ class be extends O {
|
|
|
1017
1017
|
validationMode: this.parent.validationMode
|
|
1018
1018
|
}
|
|
1019
1019
|
);
|
|
1020
|
-
this.#e.set(s,
|
|
1021
|
-
const n =
|
|
1022
|
-
this.#t.set(s,
|
|
1020
|
+
this.#e.set(s, i);
|
|
1021
|
+
const n = i.touched.on((r) => {
|
|
1022
|
+
this.#t.set(s, r), this.#c();
|
|
1023
1023
|
});
|
|
1024
1024
|
this.#s.set(s, n);
|
|
1025
|
-
const
|
|
1026
|
-
this.#
|
|
1025
|
+
const a = i.dirty.on((r) => {
|
|
1026
|
+
this.#a.set(s, r), this.#r();
|
|
1027
1027
|
});
|
|
1028
|
-
return this.#
|
|
1028
|
+
return this.#i.set(s, a), i;
|
|
1029
1029
|
};
|
|
1030
1030
|
markAllTouched = () => {
|
|
1031
1031
|
this.markTouched();
|
|
1032
|
-
const s = this.
|
|
1032
|
+
const s = this.signal.value;
|
|
1033
1033
|
for (const t of Object.keys(s))
|
|
1034
1034
|
this.field(t).markTouched();
|
|
1035
1035
|
for (const t of this.#e.values())
|
|
@@ -1037,15 +1037,15 @@ class be extends O {
|
|
|
1037
1037
|
};
|
|
1038
1038
|
markAllPristine = () => {
|
|
1039
1039
|
this.markPristine();
|
|
1040
|
-
const s = this.
|
|
1040
|
+
const s = this.signal.value;
|
|
1041
1041
|
for (const t of Object.keys(s))
|
|
1042
1042
|
this.field(t).markPristine?.();
|
|
1043
1043
|
for (const t of this.#e.values())
|
|
1044
1044
|
t.markPristine?.();
|
|
1045
1045
|
};
|
|
1046
|
-
#
|
|
1046
|
+
#r = () => {
|
|
1047
1047
|
let s = !1;
|
|
1048
|
-
for (const t of this.#
|
|
1048
|
+
for (const t of this.#a.values())
|
|
1049
1049
|
if (t) {
|
|
1050
1050
|
s = !0;
|
|
1051
1051
|
break;
|
|
@@ -1060,8 +1060,8 @@ class me extends O {
|
|
|
1060
1060
|
#s = /* @__PURE__ */ new Map();
|
|
1061
1061
|
#n = I(!1);
|
|
1062
1062
|
touchedDeep = this.#n;
|
|
1063
|
-
#r = /* @__PURE__ */ new Map();
|
|
1064
1063
|
#a = /* @__PURE__ */ new Map();
|
|
1064
|
+
#i = /* @__PURE__ */ new Map();
|
|
1065
1065
|
#l = I(!1);
|
|
1066
1066
|
dirtyDeep = this.#l;
|
|
1067
1067
|
#o;
|
|
@@ -1075,97 +1075,97 @@ class me extends O {
|
|
|
1075
1075
|
}
|
|
1076
1076
|
this.#n.set(this.touched.value || s);
|
|
1077
1077
|
};
|
|
1078
|
-
constructor(s, t,
|
|
1079
|
-
const l =
|
|
1080
|
-
super(s, t, l, n,
|
|
1078
|
+
constructor(s, t, i, n, a, r) {
|
|
1079
|
+
const l = i.map((u) => u ?? [], r);
|
|
1080
|
+
super(s, t, l, n, a, r);
|
|
1081
1081
|
const c = l.on((u) => {
|
|
1082
|
-
const
|
|
1083
|
-
|
|
1084
|
-
const h = u.length +
|
|
1085
|
-
|
|
1086
|
-
}), this.#c(), this.#
|
|
1082
|
+
const g = this.#e.length - u.length;
|
|
1083
|
+
g > 0 && (this.#e.splice(u.length, g).forEach((y, v) => {
|
|
1084
|
+
const h = u.length + v;
|
|
1085
|
+
y.dispose(), this.#s.get(h)?.(), this.#s.delete(h), this.#t.delete(h), this.#i.get(h)?.(), this.#i.delete(h), this.#a.delete(h);
|
|
1086
|
+
}), this.#c(), this.#r());
|
|
1087
1087
|
});
|
|
1088
1088
|
this.length = l.map((u) => u.length), this.#o = this.touched.on(() => {
|
|
1089
1089
|
this.#c();
|
|
1090
1090
|
}), this.#u = this.dirty.on(() => {
|
|
1091
|
-
this.#
|
|
1091
|
+
this.#r();
|
|
1092
1092
|
});
|
|
1093
|
-
const f = this.
|
|
1093
|
+
const f = this.signal.on(() => this.#r());
|
|
1094
1094
|
this.onDispose(() => {
|
|
1095
1095
|
for (const u of this.#e)
|
|
1096
1096
|
u.dispose();
|
|
1097
1097
|
this.length.dispose(), this.#e.length = 0, c(), l.dispose();
|
|
1098
1098
|
for (const u of this.#s.values()) u();
|
|
1099
1099
|
this.#s.clear(), this.#t.clear(), this.#n.dispose();
|
|
1100
|
-
for (const u of this.#
|
|
1101
|
-
this.#
|
|
1100
|
+
for (const u of this.#i.values()) u();
|
|
1101
|
+
this.#i.clear(), this.#a.clear(), this.#l.dispose(), this.#o(), this.#u(), f();
|
|
1102
1102
|
});
|
|
1103
1103
|
}
|
|
1104
1104
|
item = (s) => {
|
|
1105
1105
|
if (this.#e[s])
|
|
1106
1106
|
return this.#e[s];
|
|
1107
|
-
const t = async (
|
|
1108
|
-
const l = this.
|
|
1109
|
-
l[s] =
|
|
1110
|
-
},
|
|
1107
|
+
const t = async (r) => {
|
|
1108
|
+
const l = this.signal.value.slice();
|
|
1109
|
+
l[s] = r, this.change(l);
|
|
1110
|
+
}, i = new O(
|
|
1111
1111
|
[...this.path, s],
|
|
1112
1112
|
t,
|
|
1113
|
-
this.
|
|
1113
|
+
this.signal.map((r) => r[s]),
|
|
1114
1114
|
this.status.map(B([s])),
|
|
1115
1115
|
{
|
|
1116
1116
|
disabled: this.disabled,
|
|
1117
1117
|
validationMode: this.parent.validationMode
|
|
1118
1118
|
}
|
|
1119
1119
|
);
|
|
1120
|
-
this.#e[s] =
|
|
1121
|
-
const n =
|
|
1122
|
-
this.#t.set(s,
|
|
1120
|
+
this.#e[s] = i;
|
|
1121
|
+
const n = i.touched.on((r) => {
|
|
1122
|
+
this.#t.set(s, r), this.#c();
|
|
1123
1123
|
});
|
|
1124
1124
|
this.#s.set(s, n);
|
|
1125
|
-
const
|
|
1126
|
-
this.#
|
|
1125
|
+
const a = i.dirty.on((r) => {
|
|
1126
|
+
this.#a.set(s, r), this.#r();
|
|
1127
1127
|
});
|
|
1128
|
-
return this.#
|
|
1128
|
+
return this.#i.set(s, a), i;
|
|
1129
1129
|
};
|
|
1130
1130
|
push = (...s) => {
|
|
1131
|
-
this.change([...this.
|
|
1131
|
+
this.change([...this.signal.value, ...s]);
|
|
1132
1132
|
};
|
|
1133
1133
|
pop = () => {
|
|
1134
|
-
this.splice(this.
|
|
1134
|
+
this.splice(this.signal.value.length - 1, 1);
|
|
1135
1135
|
};
|
|
1136
1136
|
shift = () => {
|
|
1137
1137
|
this.splice(0, 1);
|
|
1138
1138
|
};
|
|
1139
1139
|
unshift = (...s) => {
|
|
1140
|
-
this.change([...s, ...this.
|
|
1140
|
+
this.change([...s, ...this.signal.value]);
|
|
1141
1141
|
};
|
|
1142
1142
|
removeAt = (s) => {
|
|
1143
1143
|
this.splice(s, 1);
|
|
1144
1144
|
};
|
|
1145
1145
|
splice = (s, t) => {
|
|
1146
|
-
const
|
|
1147
|
-
|
|
1146
|
+
const i = this.signal.value.slice();
|
|
1147
|
+
i.splice(s, t), this.change(i);
|
|
1148
1148
|
};
|
|
1149
|
-
move = (s, t,
|
|
1150
|
-
if (
|
|
1151
|
-
const n = this.
|
|
1152
|
-
n.splice(t, 0, ...
|
|
1149
|
+
move = (s, t, i = 1) => {
|
|
1150
|
+
if (i < 1 || s === t) return;
|
|
1151
|
+
const n = this.signal.value.slice(), a = n.splice(s, i);
|
|
1152
|
+
n.splice(t, 0, ...a), this.change(n);
|
|
1153
1153
|
};
|
|
1154
1154
|
markAllTouched = () => {
|
|
1155
1155
|
this.markTouched();
|
|
1156
|
-
const s = this.
|
|
1156
|
+
const s = this.signal.value.length;
|
|
1157
1157
|
for (let t = 0; t < s; t++)
|
|
1158
1158
|
this.item(t).markTouched();
|
|
1159
1159
|
};
|
|
1160
1160
|
markAllPristine = () => {
|
|
1161
1161
|
this.markPristine();
|
|
1162
|
-
const s = this.
|
|
1162
|
+
const s = this.signal.value.length;
|
|
1163
1163
|
for (let t = 0; t < s; t++)
|
|
1164
1164
|
this.item(t).markPristine?.();
|
|
1165
1165
|
};
|
|
1166
|
-
#
|
|
1166
|
+
#r = () => {
|
|
1167
1167
|
let s = !1;
|
|
1168
|
-
for (const t of this.#
|
|
1168
|
+
for (const t of this.#a.values())
|
|
1169
1169
|
if (t) {
|
|
1170
1170
|
s = !0;
|
|
1171
1171
|
break;
|
|
@@ -1173,7 +1173,7 @@ class me extends O {
|
|
|
1173
1173
|
this.#l.set(this.dirty.value || s);
|
|
1174
1174
|
};
|
|
1175
1175
|
}
|
|
1176
|
-
function
|
|
1176
|
+
function ge(e) {
|
|
1177
1177
|
function s(t) {
|
|
1178
1178
|
return typeof t == "number" ? t : t.toString();
|
|
1179
1179
|
}
|
|
@@ -1181,61 +1181,61 @@ function ve(e) {
|
|
|
1181
1181
|
(t) => typeof t == "object" && t.key != null ? s(t.key) : s(t)
|
|
1182
1182
|
);
|
|
1183
1183
|
}
|
|
1184
|
-
function
|
|
1185
|
-
const s = e.filter((n) => n.path == null || n.path.length === 0).map((n) => n.message), t = e.filter((n) => n.path != null && n.path.length > 0).reduce((n,
|
|
1186
|
-
const
|
|
1184
|
+
function ve(e) {
|
|
1185
|
+
const s = e.filter((n) => n.path == null || n.path.length === 0).map((n) => n.message), t = e.filter((n) => n.path != null && n.path.length > 0).reduce((n, a) => {
|
|
1186
|
+
const r = ge(a.path), l = r.pop();
|
|
1187
1187
|
let c = n;
|
|
1188
|
-
for (const f of
|
|
1188
|
+
for (const f of r)
|
|
1189
1189
|
c.dependencies == null && (c.dependencies = {}), c.dependencies[f] == null && (c.dependencies[f] = {}), c = c.dependencies[f];
|
|
1190
|
-
return c.dependencies == null && (c.dependencies = {}), c.dependencies[l] = { message:
|
|
1191
|
-
}, {}),
|
|
1190
|
+
return c.dependencies == null && (c.dependencies = {}), c.dependencies[l] = { message: a.message }, n;
|
|
1191
|
+
}, {}), i = s.join(`
|
|
1192
1192
|
`);
|
|
1193
1193
|
return {
|
|
1194
1194
|
...t,
|
|
1195
|
-
message:
|
|
1195
|
+
message: i != "" ? i : void 0
|
|
1196
1196
|
};
|
|
1197
1197
|
}
|
|
1198
|
-
function
|
|
1198
|
+
function ye({
|
|
1199
1199
|
initialValue: e,
|
|
1200
1200
|
onChange: s,
|
|
1201
1201
|
validate: t,
|
|
1202
|
-
equals:
|
|
1202
|
+
equals: i,
|
|
1203
1203
|
validationMode: n,
|
|
1204
|
-
validateDebounceMs:
|
|
1204
|
+
validateDebounceMs: a
|
|
1205
1205
|
}) {
|
|
1206
|
-
const
|
|
1206
|
+
const r = C.deriveProp(e), l = I(S.valid), c = I(!1), f = I(n ?? "touchedOrSubmit"), u = (d) => {
|
|
1207
1207
|
l.set(d);
|
|
1208
1208
|
};
|
|
1209
|
-
let
|
|
1210
|
-
const
|
|
1209
|
+
let g;
|
|
1210
|
+
const y = async (d) => {
|
|
1211
1211
|
if (t != null) {
|
|
1212
1212
|
const p = await t(d);
|
|
1213
1213
|
u(p);
|
|
1214
1214
|
}
|
|
1215
|
-
},
|
|
1216
|
-
|
|
1215
|
+
}, v = async (d) => {
|
|
1216
|
+
r.set(d), s?.(d);
|
|
1217
1217
|
const p = f.value;
|
|
1218
1218
|
if (t != null) {
|
|
1219
1219
|
if (p === "onSubmit")
|
|
1220
1220
|
return;
|
|
1221
|
-
const E =
|
|
1222
|
-
E > 0 ? (
|
|
1223
|
-
|
|
1224
|
-
}, E)) : await
|
|
1221
|
+
const E = a ?? 0;
|
|
1222
|
+
E > 0 ? (g && clearTimeout(g), g = setTimeout(() => {
|
|
1223
|
+
y(d);
|
|
1224
|
+
}, E)) : await y(d);
|
|
1225
1225
|
}
|
|
1226
1226
|
}, h = new O(
|
|
1227
1227
|
[],
|
|
1228
|
-
|
|
1229
|
-
|
|
1228
|
+
v,
|
|
1229
|
+
r,
|
|
1230
1230
|
l,
|
|
1231
1231
|
{
|
|
1232
1232
|
disabled: c,
|
|
1233
1233
|
validationMode: f
|
|
1234
1234
|
},
|
|
1235
|
-
|
|
1235
|
+
i ?? $
|
|
1236
1236
|
);
|
|
1237
1237
|
return h.onDispose(() => {
|
|
1238
|
-
c.dispose(),
|
|
1238
|
+
c.dispose(), r.dispose(), l.dispose(), f.dispose(), g && clearTimeout(g);
|
|
1239
1239
|
}), { controller: h, setStatus: u };
|
|
1240
1240
|
}
|
|
1241
1241
|
function Q(e) {
|
|
@@ -1246,7 +1246,7 @@ function xe(e, {
|
|
|
1246
1246
|
} = {}) {
|
|
1247
1247
|
return F(
|
|
1248
1248
|
Q(e),
|
|
1249
|
-
o.value(e.
|
|
1249
|
+
o.value(e.signal),
|
|
1250
1250
|
(s === "input" ? D.input : D.change)(M(e.change))
|
|
1251
1251
|
);
|
|
1252
1252
|
}
|
|
@@ -1255,30 +1255,30 @@ function Fe(e, {
|
|
|
1255
1255
|
} = {}) {
|
|
1256
1256
|
return F(
|
|
1257
1257
|
Q(e),
|
|
1258
|
-
o.valueAsNumber(e.
|
|
1258
|
+
o.valueAsNumber(e.signal),
|
|
1259
1259
|
(s === "input" ? D.input : D.change)(
|
|
1260
1260
|
ee(e.change)
|
|
1261
1261
|
)
|
|
1262
1262
|
);
|
|
1263
1263
|
}
|
|
1264
1264
|
function U(e) {
|
|
1265
|
-
return e.issues != null ? S.invalid(
|
|
1265
|
+
return e.issues != null ? S.invalid(ve(e.issues)) : S.valid;
|
|
1266
1266
|
}
|
|
1267
1267
|
async function Pe({
|
|
1268
1268
|
task: e,
|
|
1269
1269
|
errorMessage: s,
|
|
1270
1270
|
errorPath: t = ["root"],
|
|
1271
|
-
validation:
|
|
1271
|
+
validation: i
|
|
1272
1272
|
}) {
|
|
1273
1273
|
try {
|
|
1274
1274
|
const n = await e();
|
|
1275
|
-
return
|
|
1275
|
+
return i != null ? i(n) : S.valid;
|
|
1276
1276
|
} catch (n) {
|
|
1277
|
-
const
|
|
1277
|
+
const a = s ?? (n instanceof Error ? n.message : "Operation failed");
|
|
1278
1278
|
return t.length === 1 && t[0] === "root" ? S.invalid({
|
|
1279
|
-
message:
|
|
1279
|
+
message: a
|
|
1280
1280
|
}) : S.invalid({
|
|
1281
|
-
dependencies: X(t,
|
|
1281
|
+
dependencies: X(t, a)
|
|
1282
1282
|
});
|
|
1283
1283
|
}
|
|
1284
1284
|
}
|
|
@@ -1287,10 +1287,10 @@ function X(e, s) {
|
|
|
1287
1287
|
return {
|
|
1288
1288
|
[e[0]]: { message: s }
|
|
1289
1289
|
};
|
|
1290
|
-
const [t, ...
|
|
1290
|
+
const [t, ...i] = e;
|
|
1291
1291
|
return {
|
|
1292
1292
|
[t]: {
|
|
1293
|
-
dependencies: X(
|
|
1293
|
+
dependencies: X(i, s)
|
|
1294
1294
|
}
|
|
1295
1295
|
};
|
|
1296
1296
|
}
|
|
@@ -1298,32 +1298,32 @@ function Be({
|
|
|
1298
1298
|
initialValue: e = {},
|
|
1299
1299
|
schema: s,
|
|
1300
1300
|
onSubmit: t = async () => S.valid,
|
|
1301
|
-
validationMode:
|
|
1301
|
+
validationMode: i,
|
|
1302
1302
|
validateDebounceMs: n
|
|
1303
1303
|
}) {
|
|
1304
|
-
const { controller:
|
|
1304
|
+
const { controller: a, setStatus: r } = ye({
|
|
1305
1305
|
initialValue: e,
|
|
1306
|
-
validationMode:
|
|
1306
|
+
validationMode: i ?? "touchedOrSubmit",
|
|
1307
1307
|
validateDebounceMs: n,
|
|
1308
|
-
validate: (
|
|
1308
|
+
validate: (i ?? "touchedOrSubmit") === "onSubmit" ? void 0 : async (u) => U(
|
|
1309
1309
|
await s["~standard"].validate(u)
|
|
1310
1310
|
)
|
|
1311
|
-
}), l = I(!1), c =
|
|
1311
|
+
}), l = I(!1), c = a.object();
|
|
1312
1312
|
return c.onDispose(l.dispose), {
|
|
1313
1313
|
controller: c,
|
|
1314
|
-
setStatus:
|
|
1314
|
+
setStatus: r,
|
|
1315
1315
|
submit: async (u) => {
|
|
1316
|
-
if (l.set(!0), u?.preventDefault(), c.markAllTouched(), (
|
|
1317
|
-
const
|
|
1318
|
-
await s["~standard"].validate(
|
|
1316
|
+
if (l.set(!0), u?.preventDefault(), c.markAllTouched(), (i ?? "touchedOrSubmit") === "onSubmit") {
|
|
1317
|
+
const y = c.signal.value, v = U(
|
|
1318
|
+
await s["~standard"].validate(y)
|
|
1319
1319
|
);
|
|
1320
|
-
if (
|
|
1320
|
+
if (r(v), v.type === "invalid") {
|
|
1321
1321
|
l.set(!1);
|
|
1322
1322
|
return;
|
|
1323
1323
|
}
|
|
1324
1324
|
}
|
|
1325
|
-
const
|
|
1326
|
-
l.set(!1),
|
|
1325
|
+
const g = await t(c.signal.value);
|
|
1326
|
+
l.set(!1), g.type === "invalid" && r(g);
|
|
1327
1327
|
},
|
|
1328
1328
|
submitting: l
|
|
1329
1329
|
};
|
|
@@ -1354,45 +1354,45 @@ function we(e) {
|
|
|
1354
1354
|
return "info";
|
|
1355
1355
|
}
|
|
1356
1356
|
}
|
|
1357
|
-
function Se(e, s, t,
|
|
1357
|
+
function Se(e, s, t, i) {
|
|
1358
1358
|
const n = [
|
|
1359
1359
|
"bc-notice",
|
|
1360
1360
|
`bc-notice--${e}`,
|
|
1361
1361
|
`bc-notice--tone-${s}`
|
|
1362
1362
|
];
|
|
1363
|
-
return t && n.push("bc-notice--dismissible"),
|
|
1363
|
+
return t && n.push("bc-notice--dismissible"), i && i.length > 0 && n.push(i), n.join(" ");
|
|
1364
1364
|
}
|
|
1365
1365
|
function Ne({
|
|
1366
1366
|
variant: e = "info",
|
|
1367
1367
|
tone: s = "subtle",
|
|
1368
1368
|
role: t,
|
|
1369
|
-
title:
|
|
1369
|
+
title: i,
|
|
1370
1370
|
icon: n,
|
|
1371
|
-
closable:
|
|
1372
|
-
onDismiss:
|
|
1371
|
+
closable: a = !1,
|
|
1372
|
+
onDismiss: r,
|
|
1373
1373
|
class: l
|
|
1374
1374
|
}, ...c) {
|
|
1375
1375
|
const f = C.map(
|
|
1376
|
-
|
|
1377
|
-
(d) => !!d ||
|
|
1378
|
-
), u = C.map(e, (d) => d ?? "info"),
|
|
1376
|
+
a,
|
|
1377
|
+
(d) => !!d || r != null
|
|
1378
|
+
), u = C.map(e, (d) => d ?? "info"), g = C.map(s, (d) => d ?? "subtle"), y = _(
|
|
1379
1379
|
t,
|
|
1380
1380
|
u
|
|
1381
1381
|
)(
|
|
1382
1382
|
(d, p) => d ?? (p === "danger" ? "alert" : "status")
|
|
1383
|
-
),
|
|
1383
|
+
), v = I(!0), h = N(
|
|
1384
1384
|
L,
|
|
1385
1385
|
(d) => b.div(
|
|
1386
1386
|
o.class(
|
|
1387
1387
|
_(
|
|
1388
1388
|
u,
|
|
1389
|
-
|
|
1389
|
+
g,
|
|
1390
1390
|
f,
|
|
1391
1391
|
l
|
|
1392
1392
|
)((p, E, T, A) => Se(p, E, T, A))
|
|
1393
1393
|
),
|
|
1394
1394
|
// Accessibility role mapping (always defined)
|
|
1395
|
-
o.role(C.map(
|
|
1395
|
+
o.role(C.map(y, (p) => p)),
|
|
1396
1396
|
se(
|
|
1397
1397
|
C.map(n, (p) => p === !1),
|
|
1398
1398
|
() => b.div(
|
|
@@ -1409,31 +1409,31 @@ function Ne({
|
|
|
1409
1409
|
),
|
|
1410
1410
|
b.div(
|
|
1411
1411
|
o.class("bc-notice__body"),
|
|
1412
|
-
te(
|
|
1412
|
+
te(i, (p) => b.div(o.class("bc-notice__title"), p)),
|
|
1413
1413
|
b.div(o.class("bc-notice__content"), ...c)
|
|
1414
1414
|
),
|
|
1415
1415
|
V(
|
|
1416
1416
|
f,
|
|
1417
|
-
() =>
|
|
1417
|
+
() => ie({
|
|
1418
1418
|
size: "xs",
|
|
1419
1419
|
label: d.$.closeModal,
|
|
1420
1420
|
onClick: () => {
|
|
1421
|
-
|
|
1421
|
+
v.set(!1), r?.();
|
|
1422
1422
|
}
|
|
1423
1423
|
})
|
|
1424
1424
|
)
|
|
1425
1425
|
)
|
|
1426
1426
|
);
|
|
1427
|
-
return V(
|
|
1427
|
+
return V(v, () => h);
|
|
1428
1428
|
}
|
|
1429
1429
|
export {
|
|
1430
1430
|
me as A,
|
|
1431
1431
|
J as B,
|
|
1432
|
-
|
|
1432
|
+
ie as C,
|
|
1433
1433
|
Ee as D,
|
|
1434
1434
|
Ae as E,
|
|
1435
1435
|
G as I,
|
|
1436
|
-
|
|
1436
|
+
ae as L,
|
|
1437
1437
|
Me as M,
|
|
1438
1438
|
Ne as N,
|
|
1439
1439
|
$ as O,
|
|
@@ -1449,9 +1449,9 @@ export {
|
|
|
1449
1449
|
de as g,
|
|
1450
1450
|
fe as h,
|
|
1451
1451
|
be as i,
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1452
|
+
ge as j,
|
|
1453
|
+
ve as k,
|
|
1454
|
+
ye as l,
|
|
1455
1455
|
ue as m,
|
|
1456
1456
|
Q as n,
|
|
1457
1457
|
xe as o,
|
|
@@ -1463,5 +1463,5 @@ export {
|
|
|
1463
1463
|
Be as u,
|
|
1464
1464
|
De as v,
|
|
1465
1465
|
pe as w,
|
|
1466
|
-
|
|
1466
|
+
re as x
|
|
1467
1467
|
};
|