@tempots/beatui 0.41.0 → 0.43.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/{2019-BFDr925O.cjs → 2019-BbqYDdRN.cjs} +1 -1
- package/dist/{2019-DnG5Y5sm.js → 2019-wmBa3AUH.js} +2 -2
- package/dist/{2020-gUs7l1CJ.cjs → 2020--7erNwhp.cjs} +1 -1
- package/dist/{2020-D0-tZTo7.js → 2020-DYhs4sKc.js} +2 -2
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +2 -2
- package/dist/{index-CWq36UAJ.js → index-B41Wk-Md.js} +4 -4
- package/dist/{index-BZ2AX5sk.cjs → index-BtBnohrx.cjs} +2 -2
- package/dist/{index-DRDJFYRb.cjs → index-C6ABrzNb.cjs} +1 -1
- package/dist/{index-Clw0AwwJ.js → index-DDV9l84p.js} +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +2534 -2413
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +1 -1
- package/dist/{modal-DMc-R2VT.js → modal-Ca0R0SXH.js} +1 -1
- package/dist/{modal-BmSRMdY9.cjs → modal-DDikqd_d.cjs} +1 -1
- package/dist/notice-BC7NWoXS.cjs +2 -0
- package/dist/{notice-B5Yn_3Ay.js → notice-HsPYb-CP.js} +339 -327
- package/dist/types/components/content/index.d.ts +1 -0
- package/dist/types/components/content/native-pdf-preview.d.ts +18 -2
- package/dist/types/components/content/pdfjs-preview.d.ts +34 -0
- package/dist/types/components/form/control/{control-factory.d.ts → control.d.ts} +6 -8
- package/dist/types/components/form/control/index.d.ts +1 -1
- package/dist/{utils-DH-SYrQg.cjs → utils-Bxv-9oEL.cjs} +1 -1
- package/dist/{utils-BOEQMy82.js → utils-DszNI59p.js} +1 -1
- package/package.json +1 -1
- package/dist/notice-D3P0lewM.cjs +0 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Use as q, coalesce as
|
|
2
|
-
import { a as z, B as le, I as L, b as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const s =
|
|
6
|
-
return
|
|
1
|
+
import { Use as q, coalesce as Q, aria as B, attr as c, html as b, on as E, Value as y, Empty as _, computedOf as C, OnDispose as X, When as O, dataAttr as R, input as ne, emitValue as $, prop as I, Fragment as x, emitValueAsNumber as ie, Unless as re, Ensure as ae } from "@tempots/dom";
|
|
2
|
+
import { a as z, B as le, I as L, b as W, c as oe, C as Y } from "./translations-D-fMB_IO.js";
|
|
3
|
+
const K = /* @__PURE__ */ new Map();
|
|
4
|
+
function H(e) {
|
|
5
|
+
const s = K.get(e) ?? 0;
|
|
6
|
+
return K.set(e, s + 1), `${e}-${s}`;
|
|
7
7
|
}
|
|
8
8
|
const S = {
|
|
9
9
|
/**
|
|
@@ -137,9 +137,9 @@ const S = {
|
|
|
137
137
|
match: (e, {
|
|
138
138
|
success: s,
|
|
139
139
|
failure: t,
|
|
140
|
-
loading:
|
|
141
|
-
notAsked:
|
|
142
|
-
}) => S.isSuccess(e) ? s(e.value) : S.isFailure(e) ? t(e.error) : S.isNotAsked(e) ?
|
|
140
|
+
loading: n,
|
|
141
|
+
notAsked: i = n
|
|
142
|
+
}) => S.isSuccess(e) ? s(e.value) : S.isFailure(e) ? t(e.error) : S.isNotAsked(e) ? i() : n(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 S = {
|
|
|
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: (n, i) => n === i,
|
|
170
|
+
errorEquals: (n, i) => n === i
|
|
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 S = {
|
|
|
416
416
|
* @returns The combined result.
|
|
417
417
|
* @public
|
|
418
418
|
*/
|
|
419
|
-
combine: (e, s, t,
|
|
419
|
+
combine: (e, s, t, n) => m.match(
|
|
420
420
|
e,
|
|
421
|
-
(
|
|
421
|
+
(i) => m.match(
|
|
422
422
|
s,
|
|
423
|
-
(
|
|
424
|
-
(
|
|
423
|
+
(r) => m.success(t(i, r)),
|
|
424
|
+
(r) => m.failure(r)
|
|
425
425
|
),
|
|
426
|
-
(
|
|
426
|
+
(i) => m.match(
|
|
427
427
|
s,
|
|
428
428
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
429
|
-
(
|
|
430
|
-
(
|
|
429
|
+
(r) => m.failure(i),
|
|
430
|
+
(r) => m.failure(n(i, r))
|
|
431
431
|
)
|
|
432
432
|
),
|
|
433
433
|
/**
|
|
@@ -438,8 +438,8 @@ const S = {
|
|
|
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: (n, i) => n === i,
|
|
442
|
+
errorEquals: (n, i) => n === i
|
|
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,93 +456,93 @@ const S = {
|
|
|
456
456
|
return m.success(s);
|
|
457
457
|
}
|
|
458
458
|
};
|
|
459
|
-
function
|
|
459
|
+
function ce({
|
|
460
460
|
size: e = "sm",
|
|
461
461
|
icon: s = "line-md:close",
|
|
462
462
|
disabled: t,
|
|
463
|
-
roundedness:
|
|
464
|
-
color:
|
|
465
|
-
onClick:
|
|
463
|
+
roundedness: n = "full",
|
|
464
|
+
color: i = "base",
|
|
465
|
+
onClick: r,
|
|
466
466
|
label: l
|
|
467
|
-
}, ...
|
|
468
|
-
return q(z, (
|
|
469
|
-
const f =
|
|
467
|
+
}, ...a) {
|
|
468
|
+
return q(z, (o) => {
|
|
469
|
+
const f = Q(l, o.$.closeModal);
|
|
470
470
|
return le(
|
|
471
471
|
{
|
|
472
472
|
variant: "text",
|
|
473
473
|
size: e,
|
|
474
|
-
roundedness:
|
|
474
|
+
roundedness: n,
|
|
475
475
|
disabled: t,
|
|
476
|
-
color:
|
|
477
|
-
onClick:
|
|
476
|
+
color: i,
|
|
477
|
+
onClick: r
|
|
478
478
|
},
|
|
479
|
-
|
|
479
|
+
c.title(f),
|
|
480
480
|
B.label(f),
|
|
481
|
-
...
|
|
481
|
+
...a,
|
|
482
482
|
L({ icon: s, size: e ?? "sm" })
|
|
483
483
|
);
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
|
-
function
|
|
486
|
+
function U(e) {
|
|
487
487
|
return `bc-label bc-label--${e}`;
|
|
488
488
|
}
|
|
489
|
-
const Ve = (...e) => b.span(
|
|
489
|
+
const Ve = (...e) => b.span(c.class(U("emphasis")), ...e), ue = (...e) => b.span(c.class(U("default")), ...e), he = (...e) => b.span(c.class(U("muted")), ...e), Oe = (...e) => b.span(c.class(U("danger")), ...e), Me = (e) => {
|
|
490
490
|
const {
|
|
491
491
|
value: s,
|
|
492
492
|
onBlur: t,
|
|
493
|
-
onChange:
|
|
494
|
-
placeholder:
|
|
495
|
-
disabled:
|
|
493
|
+
onChange: n,
|
|
494
|
+
placeholder: i,
|
|
495
|
+
disabled: r,
|
|
496
496
|
id: l,
|
|
497
|
-
checkedIcon:
|
|
498
|
-
uncheckedIcon:
|
|
497
|
+
checkedIcon: a,
|
|
498
|
+
uncheckedIcon: o,
|
|
499
499
|
iconSize: f = "lg"
|
|
500
|
-
} = e, u = l ??
|
|
501
|
-
if (y.get(
|
|
500
|
+
} = e, u = l ?? H("checkbox"), g = `${u}-label`, w = () => {
|
|
501
|
+
if (y.get(r ?? !1)) return;
|
|
502
502
|
const h = y.get(s);
|
|
503
|
-
|
|
503
|
+
n?.(!h);
|
|
504
504
|
}, v = (h) => {
|
|
505
|
-
y.get(
|
|
505
|
+
y.get(r ?? !1) || (h.key === " " || h.key === "Enter") && (h.preventDefault(), w());
|
|
506
506
|
};
|
|
507
|
-
return
|
|
507
|
+
return W(
|
|
508
508
|
{
|
|
509
509
|
baseContainer: !0,
|
|
510
510
|
growInput: !1,
|
|
511
511
|
...e,
|
|
512
512
|
input: b.span(
|
|
513
|
-
|
|
513
|
+
c.class("bc-checkbox-input"),
|
|
514
514
|
b.span(
|
|
515
|
-
|
|
516
|
-
|
|
515
|
+
c.class("bc-checkbox-input__checkbox"),
|
|
516
|
+
c.class(
|
|
517
517
|
y.map(
|
|
518
518
|
s,
|
|
519
519
|
(h) => h ? "bc-checkbox-input__checkbox--checked" : "bc-checkbox-input__checkbox--unchecked"
|
|
520
520
|
)
|
|
521
521
|
),
|
|
522
|
-
|
|
522
|
+
c.class(
|
|
523
523
|
y.map(
|
|
524
|
-
|
|
524
|
+
r ?? !1,
|
|
525
525
|
(h) => h ? "bc-checkbox-input__checkbox--disabled" : ""
|
|
526
526
|
)
|
|
527
527
|
),
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
528
|
+
c.id(u),
|
|
529
|
+
c.role("checkbox"),
|
|
530
|
+
c.tabindex(
|
|
531
531
|
y.map(
|
|
532
|
-
|
|
532
|
+
r ?? !1,
|
|
533
533
|
(h) => h ? -1 : 0
|
|
534
534
|
)
|
|
535
535
|
),
|
|
536
536
|
B.checked(s),
|
|
537
|
-
B.disabled(
|
|
538
|
-
|
|
537
|
+
B.disabled(r),
|
|
538
|
+
i != null ? B.labelledby(g) : _,
|
|
539
539
|
E.keydown(v),
|
|
540
540
|
t != null ? E.blur(t) : _,
|
|
541
541
|
L({
|
|
542
542
|
icon: C(
|
|
543
543
|
s,
|
|
544
|
-
|
|
545
|
-
|
|
544
|
+
a,
|
|
545
|
+
o
|
|
546
546
|
)(
|
|
547
547
|
(h, d, p) => h ? d ?? "akar-icons/check-box-fill" : p ?? "akar-icons/box"
|
|
548
548
|
),
|
|
@@ -550,18 +550,18 @@ const Ve = (...e) => b.span(o.class(H("emphasis")), ...e), ue = (...e) => b.span
|
|
|
550
550
|
size: f
|
|
551
551
|
})
|
|
552
552
|
),
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
he(
|
|
553
|
+
i != null ? b.label(
|
|
554
|
+
c.class("bc-checkbox-input__label"),
|
|
555
|
+
c.id(g),
|
|
556
|
+
c.for(u),
|
|
557
|
+
he(i)
|
|
558
558
|
) : _
|
|
559
559
|
)
|
|
560
560
|
},
|
|
561
561
|
E.click(w)
|
|
562
562
|
);
|
|
563
563
|
}, de = b.span(
|
|
564
|
-
|
|
564
|
+
c.class("bc-input-wrapper__required"),
|
|
565
565
|
" *"
|
|
566
566
|
);
|
|
567
567
|
function pe(e) {
|
|
@@ -572,7 +572,7 @@ function fe(e, s) {
|
|
|
572
572
|
const t = ["bc-input-wrapper__label-text"];
|
|
573
573
|
return e ? t.push("bc-input-wrapper__label-text--error") : s ? t.push("bc-input-wrapper__label-text--disabled") : t.push("bc-input-wrapper__label-text--default"), t.join(" ");
|
|
574
574
|
}
|
|
575
|
-
function
|
|
575
|
+
function G(e, s) {
|
|
576
576
|
if (e === "horizontal-fixed" && s != null)
|
|
577
577
|
return `--input-wrapper-label-width: ${s}`;
|
|
578
578
|
}
|
|
@@ -580,22 +580,22 @@ const Z = ({
|
|
|
580
580
|
fullWidth: e = !1,
|
|
581
581
|
required: s,
|
|
582
582
|
label: t,
|
|
583
|
-
labelChildren:
|
|
584
|
-
context:
|
|
585
|
-
description:
|
|
583
|
+
labelChildren: n,
|
|
584
|
+
context: i,
|
|
585
|
+
description: r,
|
|
586
586
|
content: l,
|
|
587
|
-
error:
|
|
588
|
-
labelFor:
|
|
587
|
+
error: a,
|
|
588
|
+
labelFor: o,
|
|
589
589
|
hasError: f,
|
|
590
590
|
disabled: u,
|
|
591
591
|
layout: g,
|
|
592
592
|
labelWidth: w
|
|
593
593
|
}, ...v) => {
|
|
594
|
-
const h = f ??
|
|
594
|
+
const h = f ?? a != null, d = u ?? !1, p = g ?? "vertical", T = H("input-wrapper"), A = r ? `${T}-description` : void 0, F = a != null ? `${T}-error` : void 0, N = C(p)((k) => k !== "vertical");
|
|
595
595
|
return b.div(
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
596
|
+
X(N),
|
|
597
|
+
c.class(y.map(p, (k) => pe(k))),
|
|
598
|
+
c.class(
|
|
599
599
|
y.map(
|
|
600
600
|
e,
|
|
601
601
|
(k) => k ? "bc-input-wrapper--full-width" : ""
|
|
@@ -605,26 +605,26 @@ const Z = ({
|
|
|
605
605
|
C(
|
|
606
606
|
p,
|
|
607
607
|
w ?? void 0
|
|
608
|
-
)((k, V) =>
|
|
609
|
-
() =>
|
|
608
|
+
)((k, V) => G(k, V) != null),
|
|
609
|
+
() => c.style(
|
|
610
610
|
y.map(
|
|
611
611
|
C(
|
|
612
612
|
p,
|
|
613
613
|
w ?? void 0
|
|
614
|
-
)((k, V) =>
|
|
614
|
+
)((k, V) => G(k, V)),
|
|
615
615
|
(k) => k
|
|
616
616
|
)
|
|
617
617
|
)
|
|
618
618
|
),
|
|
619
|
-
t != null ||
|
|
620
|
-
|
|
619
|
+
t != null || i != null ? b.div(
|
|
620
|
+
c.class("bc-input-wrapper__header"),
|
|
621
621
|
b.div(
|
|
622
|
-
|
|
622
|
+
c.class("bc-input-wrapper__label-section"),
|
|
623
623
|
b.label(
|
|
624
|
-
|
|
625
|
-
|
|
624
|
+
c.class("bc-input-wrapper__label"),
|
|
625
|
+
o != null ? c.for(o) : _,
|
|
626
626
|
b.span(
|
|
627
|
-
|
|
627
|
+
c.class(
|
|
628
628
|
C(
|
|
629
629
|
h,
|
|
630
630
|
d
|
|
@@ -643,106 +643,106 @@ const Z = ({
|
|
|
643
643
|
O(
|
|
644
644
|
C(
|
|
645
645
|
N,
|
|
646
|
-
|
|
646
|
+
r
|
|
647
647
|
)((k, V) => k && V != null),
|
|
648
648
|
() => b.div(
|
|
649
|
-
|
|
649
|
+
c.class(
|
|
650
650
|
"bc-input-wrapper__description bc-input-wrapper__description--under-label"
|
|
651
651
|
),
|
|
652
|
-
|
|
653
|
-
|
|
652
|
+
c.id(A),
|
|
653
|
+
r
|
|
654
654
|
)
|
|
655
655
|
)
|
|
656
656
|
),
|
|
657
|
-
|
|
658
|
-
|
|
657
|
+
i != null ? ue(i) : _,
|
|
658
|
+
n
|
|
659
659
|
) : _,
|
|
660
660
|
b.div(
|
|
661
|
-
|
|
661
|
+
c.class("bc-input-wrapper__content"),
|
|
662
662
|
// Add data attributes to help inputs inherit accessibility information
|
|
663
|
-
[A,
|
|
664
|
-
[A,
|
|
663
|
+
[A, F].filter(Boolean).length > 0 ? R.describedby(
|
|
664
|
+
[A, F].filter(Boolean).join(" ")
|
|
665
665
|
) : _,
|
|
666
|
-
s ?
|
|
667
|
-
O(h, () =>
|
|
666
|
+
s ? R.required("true") : _,
|
|
667
|
+
O(h, () => R.invalid("true")),
|
|
668
668
|
l
|
|
669
669
|
),
|
|
670
670
|
// Show description at bottom only when not horizontal
|
|
671
671
|
O(
|
|
672
|
-
C(N,
|
|
672
|
+
C(N, r)((k, V) => !k && V != null),
|
|
673
673
|
() => b.div(
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
674
|
+
c.class("bc-input-wrapper__description"),
|
|
675
|
+
c.id(A),
|
|
676
|
+
r
|
|
677
677
|
)
|
|
678
678
|
),
|
|
679
|
-
|
|
679
|
+
a != null ? O(
|
|
680
680
|
h,
|
|
681
681
|
() => b.div(
|
|
682
|
-
|
|
683
|
-
|
|
682
|
+
c.class("bc-input-wrapper__error"),
|
|
683
|
+
c.id(F),
|
|
684
684
|
B.live("polite"),
|
|
685
685
|
// Announce errors to screen readers
|
|
686
|
-
|
|
686
|
+
c.role("alert"),
|
|
687
687
|
// Mark as alert for immediate attention
|
|
688
|
-
|
|
688
|
+
a
|
|
689
689
|
)
|
|
690
690
|
) : null,
|
|
691
691
|
...v
|
|
692
692
|
);
|
|
693
693
|
};
|
|
694
|
-
function
|
|
695
|
-
return b.div(
|
|
694
|
+
function Fe(...e) {
|
|
695
|
+
return b.div(c.class("bc-stack"), ...e);
|
|
696
696
|
}
|
|
697
|
-
const
|
|
697
|
+
const $e = (e) => {
|
|
698
698
|
const s = {
|
|
699
699
|
name: "email",
|
|
700
700
|
autocomplete: "email",
|
|
701
701
|
...e
|
|
702
702
|
}, {
|
|
703
703
|
value: t,
|
|
704
|
-
before:
|
|
705
|
-
onBlur:
|
|
706
|
-
onChange:
|
|
704
|
+
before: n,
|
|
705
|
+
onBlur: i,
|
|
706
|
+
onChange: r,
|
|
707
707
|
onInput: l,
|
|
708
|
-
placeholder:
|
|
709
|
-
} = s,
|
|
708
|
+
placeholder: a
|
|
709
|
+
} = s, o = n ?? oe({
|
|
710
710
|
icon: "line-md:email",
|
|
711
711
|
size: e.size,
|
|
712
712
|
color: "neutral"
|
|
713
713
|
});
|
|
714
714
|
return q(
|
|
715
715
|
z,
|
|
716
|
-
(f) =>
|
|
716
|
+
(f) => W({
|
|
717
717
|
...e,
|
|
718
|
-
before:
|
|
718
|
+
before: o,
|
|
719
719
|
input: ne.email(
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
l != null ? E.input(
|
|
720
|
+
Y(s),
|
|
721
|
+
c.placeholder(Q(a, f.$.emailPlaceholderText)),
|
|
722
|
+
c.value(t),
|
|
723
|
+
c.class("bc-input"),
|
|
724
|
+
i != null ? E.blur($(i)) : _,
|
|
725
|
+
r != null ? E.change($(r)) : _,
|
|
726
|
+
l != null ? E.input($(l)) : _
|
|
727
727
|
)
|
|
728
728
|
})
|
|
729
729
|
);
|
|
730
|
-
},
|
|
730
|
+
}, xe = (e) => {
|
|
731
731
|
const {
|
|
732
732
|
value: s,
|
|
733
733
|
onBlur: t,
|
|
734
|
-
onChange:
|
|
735
|
-
onInput:
|
|
736
|
-
before:
|
|
734
|
+
onChange: n,
|
|
735
|
+
onInput: i,
|
|
736
|
+
before: r,
|
|
737
737
|
after: l,
|
|
738
|
-
hasError:
|
|
739
|
-
disabled:
|
|
738
|
+
hasError: a,
|
|
739
|
+
disabled: o,
|
|
740
740
|
autocomplete: f,
|
|
741
741
|
placeholder: u,
|
|
742
742
|
...g
|
|
743
743
|
} = e, w = {
|
|
744
744
|
name: "password",
|
|
745
|
-
disabled:
|
|
745
|
+
disabled: o,
|
|
746
746
|
...g
|
|
747
747
|
}, v = I(!0), h = C(
|
|
748
748
|
v,
|
|
@@ -753,9 +753,9 @@ const xe = (e) => {
|
|
|
753
753
|
d.$.passwordPlaceholderText,
|
|
754
754
|
v,
|
|
755
755
|
u
|
|
756
|
-
)((A,
|
|
757
|
-
|
|
758
|
-
|
|
756
|
+
)((A, F, N) => F ? "•••••••••••••••" : N ?? A), T = b.button(
|
|
757
|
+
c.type("button"),
|
|
758
|
+
c.class("bc-input-container__password-toggle"),
|
|
759
759
|
B.label(d.$.togglePasswordVisibility),
|
|
760
760
|
E.click(() => v.update((A) => !A)),
|
|
761
761
|
O(
|
|
@@ -764,28 +764,28 @@ const xe = (e) => {
|
|
|
764
764
|
() => L({ icon: "line-md:watch-off" })
|
|
765
765
|
)
|
|
766
766
|
);
|
|
767
|
-
return
|
|
768
|
-
before:
|
|
769
|
-
disabled:
|
|
770
|
-
hasError:
|
|
767
|
+
return W({
|
|
768
|
+
before: r,
|
|
769
|
+
disabled: o,
|
|
770
|
+
hasError: a,
|
|
771
771
|
input: b.input(
|
|
772
|
-
|
|
772
|
+
Y({
|
|
773
773
|
...w,
|
|
774
774
|
autocomplete: h,
|
|
775
775
|
placeholder: p
|
|
776
776
|
}),
|
|
777
777
|
O(
|
|
778
778
|
v,
|
|
779
|
-
() =>
|
|
780
|
-
() =>
|
|
779
|
+
() => x(c.type("password")),
|
|
780
|
+
() => x(c.type("text"))
|
|
781
781
|
),
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
t != null ? E.blur(
|
|
785
|
-
|
|
786
|
-
|
|
782
|
+
c.class("bc-input"),
|
|
783
|
+
c.value(s),
|
|
784
|
+
t != null ? E.blur($(t)) : _,
|
|
785
|
+
n != null ? E.change($(n)) : _,
|
|
786
|
+
i != null ? E.input($(i)) : _
|
|
787
787
|
),
|
|
788
|
-
after: l != null ?
|
|
788
|
+
after: l != null ? x(T, l) : T
|
|
789
789
|
});
|
|
790
790
|
});
|
|
791
791
|
}, be = (
|
|
@@ -797,49 +797,61 @@ const xe = (e) => {
|
|
|
797
797
|
e.change(t), s?.(t);
|
|
798
798
|
};
|
|
799
799
|
function ee(e, s) {
|
|
800
|
-
const { controller: t, onBlur:
|
|
800
|
+
const { controller: t, onBlur: n, onChange: i, id: r, ...l } = s;
|
|
801
801
|
return e({
|
|
802
|
-
id: t.name,
|
|
802
|
+
id: r ?? t.name,
|
|
803
803
|
disabled: t.disabled,
|
|
804
804
|
value: t.signal,
|
|
805
805
|
hasError: t.errorVisible,
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
806
|
+
name: t.name,
|
|
807
|
+
...l,
|
|
808
|
+
onChange: me(t, i),
|
|
809
|
+
onBlur: be(t, n)
|
|
809
810
|
});
|
|
810
811
|
}
|
|
811
|
-
function Pe(e, s, ...
|
|
812
|
+
function Pe(e, { id: s, labelFor: t, ...n }, ...i) {
|
|
813
|
+
const r = s ?? n.controller.name ?? H("control");
|
|
812
814
|
return Z(
|
|
813
815
|
{
|
|
814
|
-
...
|
|
816
|
+
...n,
|
|
817
|
+
labelFor: t ?? r,
|
|
815
818
|
content: ee(
|
|
816
|
-
e,
|
|
817
|
-
|
|
819
|
+
(a) => e({ ...a, id: r }),
|
|
820
|
+
n
|
|
818
821
|
)
|
|
819
822
|
},
|
|
820
|
-
...
|
|
823
|
+
...i
|
|
821
824
|
);
|
|
822
825
|
}
|
|
823
826
|
function ge(e, s) {
|
|
824
|
-
const { toInput: t, fromInput:
|
|
827
|
+
const { toInput: t, fromInput: n, controller: i, ...r } = s, l = i.transform(t, n);
|
|
825
828
|
return ee(e, {
|
|
826
|
-
...
|
|
829
|
+
...r,
|
|
827
830
|
controller: l
|
|
828
831
|
});
|
|
829
832
|
}
|
|
830
|
-
function Be(e,
|
|
833
|
+
function Be(e, {
|
|
834
|
+
id: s,
|
|
835
|
+
labelFor: t,
|
|
836
|
+
...n
|
|
837
|
+
}, ...i) {
|
|
838
|
+
const r = s ?? n.controller.name ?? H("control");
|
|
831
839
|
return Z(
|
|
832
840
|
{
|
|
833
|
-
...
|
|
834
|
-
|
|
841
|
+
...n,
|
|
842
|
+
labelFor: t ?? r,
|
|
843
|
+
content: ge(e, {
|
|
844
|
+
...n,
|
|
845
|
+
id: r
|
|
846
|
+
})
|
|
835
847
|
},
|
|
836
|
-
...
|
|
848
|
+
...i
|
|
837
849
|
);
|
|
838
850
|
}
|
|
839
851
|
function Ne(e) {
|
|
840
852
|
return e.split(".").map((t) => {
|
|
841
|
-
const
|
|
842
|
-
return
|
|
853
|
+
const n = t.match(/^\[(\d+)\]$/);
|
|
854
|
+
return n ? Number(n[1]) : t;
|
|
843
855
|
});
|
|
844
856
|
}
|
|
845
857
|
function ve(e) {
|
|
@@ -856,10 +868,10 @@ function ye(e) {
|
|
|
856
868
|
function j(e) {
|
|
857
869
|
return function(t) {
|
|
858
870
|
if (t.type === "valid") return t;
|
|
859
|
-
let
|
|
860
|
-
for (const
|
|
861
|
-
if (
|
|
862
|
-
return D.invalid(
|
|
871
|
+
let n = t.error;
|
|
872
|
+
for (const i of e)
|
|
873
|
+
if (n = n?.dependencies?.[i], n == null) return D.valid;
|
|
874
|
+
return D.invalid(n);
|
|
863
875
|
};
|
|
864
876
|
}
|
|
865
877
|
class M {
|
|
@@ -883,28 +895,28 @@ class M {
|
|
|
883
895
|
disabled;
|
|
884
896
|
#n = [];
|
|
885
897
|
disabledOrHasErrors;
|
|
886
|
-
constructor(s, t,
|
|
887
|
-
this.path = s, this.change = t, this.signal =
|
|
888
|
-
(
|
|
889
|
-
), this.hasError = this.error.map((
|
|
898
|
+
constructor(s, t, n, i, r, l = P) {
|
|
899
|
+
this.path = s, this.change = t, this.signal = n, this.status = i, this.#t = l, this.#s.set(n.value), this.error = i.map(
|
|
900
|
+
(a) => a?.type === "invalid" ? a.error?.message : void 0
|
|
901
|
+
), this.hasError = this.error.map((a) => a != null), this.touched = this.#e.touched, r.validationMode ? this.errorVisible = C(
|
|
890
902
|
this.hasError,
|
|
891
903
|
this.touched,
|
|
892
|
-
|
|
893
|
-
)((
|
|
904
|
+
r.validationMode
|
|
905
|
+
)((a, o, f) => f === "continuous" ? !!a : !!a && !!o) : this.errorVisible = C(
|
|
894
906
|
this.hasError,
|
|
895
907
|
this.touched
|
|
896
|
-
)((
|
|
908
|
+
)((a, o) => !!a && !!o), this.dirty = C(
|
|
897
909
|
this.signal,
|
|
898
910
|
this.#s
|
|
899
|
-
)((
|
|
900
|
-
(
|
|
901
|
-
), this.parent =
|
|
911
|
+
)((a, o) => !this.#t(a, o)), this.dependencyErrors = i.map(
|
|
912
|
+
(a) => a?.type === "invalid" ? a.error?.dependencies : void 0
|
|
913
|
+
), this.parent = r, this.disabled = C(
|
|
902
914
|
this.#e.disabled,
|
|
903
|
-
|
|
904
|
-
)((
|
|
915
|
+
r.disabled
|
|
916
|
+
)((a, o) => a || o), this.disabledOrHasErrors = C(
|
|
905
917
|
this.disabled,
|
|
906
918
|
this.hasError
|
|
907
|
-
)((
|
|
919
|
+
)((a, o) => a || o), this.onDispose(() => {
|
|
908
920
|
this.#e.disabled.dispose(), this.#e.touched.dispose(), this.disabled.dispose(), this.error.dispose(), this.errorVisible.dispose(), this.dirty.dispose(), this.#s.dispose(), this.dependencyErrors.dispose(), this.disabledOrHasErrors.dispose();
|
|
909
921
|
});
|
|
910
922
|
}
|
|
@@ -957,23 +969,23 @@ class M {
|
|
|
957
969
|
this.parent,
|
|
958
970
|
s
|
|
959
971
|
);
|
|
960
|
-
transform = (s, t,
|
|
961
|
-
[...this.path, ...
|
|
962
|
-
(
|
|
963
|
-
this.signal.map(s,
|
|
964
|
-
this.status.map(j(
|
|
972
|
+
transform = (s, t, n = [], i = P) => new M(
|
|
973
|
+
[...this.path, ...n],
|
|
974
|
+
(r) => this.change(t(r)),
|
|
975
|
+
this.signal.map(s, i),
|
|
976
|
+
this.status.map(j(n)),
|
|
965
977
|
this.parent,
|
|
966
|
-
|
|
978
|
+
i
|
|
967
979
|
);
|
|
968
|
-
asyncTransform = (s, t,
|
|
969
|
-
[...this.path, ...
|
|
980
|
+
asyncTransform = (s, t, n, i = [], r = P) => new M(
|
|
981
|
+
[...this.path, ...i],
|
|
970
982
|
(l) => {
|
|
971
|
-
t(l).then((
|
|
983
|
+
t(l).then((a) => this.change(a));
|
|
972
984
|
},
|
|
973
|
-
this.signal.mapAsync(s,
|
|
974
|
-
this.status.map(j(
|
|
985
|
+
this.signal.mapAsync(s, n, void 0, r),
|
|
986
|
+
this.status.map(j(i)),
|
|
975
987
|
this.parent,
|
|
976
|
-
|
|
988
|
+
r
|
|
977
989
|
);
|
|
978
990
|
}
|
|
979
991
|
class we extends M {
|
|
@@ -982,13 +994,13 @@ class we extends M {
|
|
|
982
994
|
#s = /* @__PURE__ */ new Map();
|
|
983
995
|
#n = I(!1);
|
|
984
996
|
touchedDeep = this.#n;
|
|
985
|
-
#
|
|
997
|
+
#r = /* @__PURE__ */ new Map();
|
|
986
998
|
#i = /* @__PURE__ */ new Map();
|
|
987
999
|
#l = I(!1);
|
|
988
1000
|
dirtyDeep = this.#l;
|
|
989
|
-
#
|
|
1001
|
+
#c;
|
|
990
1002
|
#u;
|
|
991
|
-
#
|
|
1003
|
+
#o = () => {
|
|
992
1004
|
let s = !1;
|
|
993
1005
|
for (const t of this.#t.values())
|
|
994
1006
|
if (t) {
|
|
@@ -997,28 +1009,28 @@ class we extends M {
|
|
|
997
1009
|
}
|
|
998
1010
|
this.#n.set(this.touched.value || s);
|
|
999
1011
|
};
|
|
1000
|
-
constructor(s, t,
|
|
1012
|
+
constructor(s, t, n, i, r, l) {
|
|
1001
1013
|
super(
|
|
1002
1014
|
s,
|
|
1003
1015
|
t,
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1016
|
+
n.map((o) => o ?? {}, l),
|
|
1017
|
+
i,
|
|
1018
|
+
r,
|
|
1007
1019
|
l
|
|
1008
|
-
), this.#
|
|
1009
|
-
this.#
|
|
1020
|
+
), this.#c = this.touched.on(() => {
|
|
1021
|
+
this.#o();
|
|
1010
1022
|
}), this.#u = this.dirty.on(() => {
|
|
1011
|
-
this.#
|
|
1023
|
+
this.#a();
|
|
1012
1024
|
});
|
|
1013
|
-
const
|
|
1025
|
+
const a = this.signal.on(() => this.#a());
|
|
1014
1026
|
this.onDispose(() => {
|
|
1015
|
-
for (const
|
|
1016
|
-
|
|
1027
|
+
for (const o of this.#e.values())
|
|
1028
|
+
o.dispose();
|
|
1017
1029
|
this.#e.clear();
|
|
1018
|
-
for (const
|
|
1030
|
+
for (const o of this.#s.values()) o();
|
|
1019
1031
|
this.#s.clear(), this.#t.clear(), this.#n.dispose();
|
|
1020
|
-
for (const
|
|
1021
|
-
this.#i.clear(), this.#
|
|
1032
|
+
for (const o of this.#i.values()) o();
|
|
1033
|
+
this.#i.clear(), this.#r.clear(), this.#l.dispose(), this.#c(), this.#u(), a();
|
|
1022
1034
|
});
|
|
1023
1035
|
}
|
|
1024
1036
|
field = (s) => {
|
|
@@ -1029,7 +1041,7 @@ class we extends M {
|
|
|
1029
1041
|
...this.signal.value,
|
|
1030
1042
|
[s]: l
|
|
1031
1043
|
});
|
|
1032
|
-
},
|
|
1044
|
+
}, n = new M(
|
|
1033
1045
|
[...this.path, s],
|
|
1034
1046
|
t,
|
|
1035
1047
|
this.signal.map((l) => l[s]),
|
|
@@ -1040,15 +1052,15 @@ class we extends M {
|
|
|
1040
1052
|
validationMode: this.parent.validationMode
|
|
1041
1053
|
}
|
|
1042
1054
|
);
|
|
1043
|
-
this.#e.set(s,
|
|
1044
|
-
const
|
|
1045
|
-
this.#t.set(s, l), this.#
|
|
1055
|
+
this.#e.set(s, n);
|
|
1056
|
+
const i = n.touched.on((l) => {
|
|
1057
|
+
this.#t.set(s, l), this.#o();
|
|
1046
1058
|
});
|
|
1047
|
-
this.#s.set(s,
|
|
1048
|
-
const
|
|
1049
|
-
this.#
|
|
1059
|
+
this.#s.set(s, i);
|
|
1060
|
+
const r = n.dirty.on((l) => {
|
|
1061
|
+
this.#r.set(s, l), this.#a();
|
|
1050
1062
|
});
|
|
1051
|
-
return this.#i.set(s,
|
|
1063
|
+
return this.#i.set(s, r), n;
|
|
1052
1064
|
};
|
|
1053
1065
|
markAllTouched = () => {
|
|
1054
1066
|
this.markTouched();
|
|
@@ -1066,9 +1078,9 @@ class we extends M {
|
|
|
1066
1078
|
for (const t of this.#e.values())
|
|
1067
1079
|
t.markPristine?.();
|
|
1068
1080
|
};
|
|
1069
|
-
#
|
|
1081
|
+
#a = () => {
|
|
1070
1082
|
let s = !1;
|
|
1071
|
-
for (const t of this.#
|
|
1083
|
+
for (const t of this.#r.values())
|
|
1072
1084
|
if (t) {
|
|
1073
1085
|
s = !0;
|
|
1074
1086
|
break;
|
|
@@ -1083,13 +1095,13 @@ class ke extends M {
|
|
|
1083
1095
|
#s = /* @__PURE__ */ new Map();
|
|
1084
1096
|
#n = I(!1);
|
|
1085
1097
|
touchedDeep = this.#n;
|
|
1086
|
-
#
|
|
1098
|
+
#r = /* @__PURE__ */ new Map();
|
|
1087
1099
|
#i = /* @__PURE__ */ new Map();
|
|
1088
1100
|
#l = I(!1);
|
|
1089
1101
|
dirtyDeep = this.#l;
|
|
1090
|
-
#
|
|
1102
|
+
#c;
|
|
1091
1103
|
#u;
|
|
1092
|
-
#
|
|
1104
|
+
#o = () => {
|
|
1093
1105
|
let s = !1;
|
|
1094
1106
|
for (const t of this.#t.values())
|
|
1095
1107
|
if (t) {
|
|
@@ -1098,39 +1110,39 @@ class ke extends M {
|
|
|
1098
1110
|
}
|
|
1099
1111
|
this.#n.set(this.touched.value || s);
|
|
1100
1112
|
};
|
|
1101
|
-
constructor(s, t,
|
|
1102
|
-
const
|
|
1103
|
-
super(s, t,
|
|
1104
|
-
const
|
|
1113
|
+
constructor(s, t, n, i, r, l) {
|
|
1114
|
+
const a = n.map((u) => u ?? [], l);
|
|
1115
|
+
super(s, t, a, i, r, l);
|
|
1116
|
+
const o = a.on((u) => {
|
|
1105
1117
|
const g = this.#e.length - u.length;
|
|
1106
1118
|
g > 0 && (this.#e.splice(u.length, g).forEach((w, v) => {
|
|
1107
1119
|
const h = u.length + v;
|
|
1108
|
-
w.dispose(), this.#s.get(h)?.(), this.#s.delete(h), this.#t.delete(h), this.#i.get(h)?.(), this.#i.delete(h), this.#
|
|
1109
|
-
}), this.#
|
|
1120
|
+
w.dispose(), this.#s.get(h)?.(), this.#s.delete(h), this.#t.delete(h), this.#i.get(h)?.(), this.#i.delete(h), this.#r.delete(h);
|
|
1121
|
+
}), this.#o(), this.#a());
|
|
1110
1122
|
});
|
|
1111
|
-
this.length =
|
|
1112
|
-
this.#
|
|
1123
|
+
this.length = a.map((u) => u.length), this.#c = this.touched.on(() => {
|
|
1124
|
+
this.#o();
|
|
1113
1125
|
}), this.#u = this.dirty.on(() => {
|
|
1114
|
-
this.#
|
|
1126
|
+
this.#a();
|
|
1115
1127
|
});
|
|
1116
|
-
const f = this.signal.on(() => this.#
|
|
1128
|
+
const f = this.signal.on(() => this.#a());
|
|
1117
1129
|
this.onDispose(() => {
|
|
1118
1130
|
for (const u of this.#e)
|
|
1119
1131
|
u.dispose();
|
|
1120
|
-
this.length.dispose(), this.#e.length = 0,
|
|
1132
|
+
this.length.dispose(), this.#e.length = 0, o(), a.dispose();
|
|
1121
1133
|
for (const u of this.#s.values()) u();
|
|
1122
1134
|
this.#s.clear(), this.#t.clear(), this.#n.dispose();
|
|
1123
1135
|
for (const u of this.#i.values()) u();
|
|
1124
|
-
this.#i.clear(), this.#
|
|
1136
|
+
this.#i.clear(), this.#r.clear(), this.#l.dispose(), this.#c(), this.#u(), f();
|
|
1125
1137
|
});
|
|
1126
1138
|
}
|
|
1127
1139
|
item = (s) => {
|
|
1128
1140
|
if (this.#e[s])
|
|
1129
1141
|
return this.#e[s];
|
|
1130
1142
|
const t = async (l) => {
|
|
1131
|
-
const
|
|
1132
|
-
|
|
1133
|
-
},
|
|
1143
|
+
const a = this.signal.value.slice();
|
|
1144
|
+
a[s] = l, this.change(a);
|
|
1145
|
+
}, n = new M(
|
|
1134
1146
|
[...this.path, s],
|
|
1135
1147
|
t,
|
|
1136
1148
|
this.signal.map((l) => l[s]),
|
|
@@ -1140,15 +1152,15 @@ class ke extends M {
|
|
|
1140
1152
|
validationMode: this.parent.validationMode
|
|
1141
1153
|
}
|
|
1142
1154
|
);
|
|
1143
|
-
this.#e[s] =
|
|
1144
|
-
const
|
|
1145
|
-
this.#t.set(s, l), this.#
|
|
1155
|
+
this.#e[s] = n;
|
|
1156
|
+
const i = n.touched.on((l) => {
|
|
1157
|
+
this.#t.set(s, l), this.#o();
|
|
1146
1158
|
});
|
|
1147
|
-
this.#s.set(s,
|
|
1148
|
-
const
|
|
1149
|
-
this.#
|
|
1159
|
+
this.#s.set(s, i);
|
|
1160
|
+
const r = n.dirty.on((l) => {
|
|
1161
|
+
this.#r.set(s, l), this.#a();
|
|
1150
1162
|
});
|
|
1151
|
-
return this.#i.set(s,
|
|
1163
|
+
return this.#i.set(s, r), n;
|
|
1152
1164
|
};
|
|
1153
1165
|
push = (...s) => {
|
|
1154
1166
|
this.change([...this.signal.value, ...s]);
|
|
@@ -1166,13 +1178,13 @@ class ke extends M {
|
|
|
1166
1178
|
this.splice(s, 1);
|
|
1167
1179
|
};
|
|
1168
1180
|
splice = (s, t) => {
|
|
1169
|
-
const
|
|
1170
|
-
|
|
1181
|
+
const n = this.signal.value.slice();
|
|
1182
|
+
n.splice(s, t), this.change(n);
|
|
1171
1183
|
};
|
|
1172
|
-
move = (s, t,
|
|
1173
|
-
if (
|
|
1174
|
-
const
|
|
1175
|
-
|
|
1184
|
+
move = (s, t, n = 1) => {
|
|
1185
|
+
if (n < 1 || s === t) return;
|
|
1186
|
+
const i = this.signal.value.slice(), r = i.splice(s, n);
|
|
1187
|
+
i.splice(t, 0, ...r), this.change(i);
|
|
1176
1188
|
};
|
|
1177
1189
|
markAllTouched = () => {
|
|
1178
1190
|
this.markTouched();
|
|
@@ -1186,9 +1198,9 @@ class ke extends M {
|
|
|
1186
1198
|
for (let t = 0; t < s; t++)
|
|
1187
1199
|
this.item(t).markPristine?.();
|
|
1188
1200
|
};
|
|
1189
|
-
#
|
|
1201
|
+
#a = () => {
|
|
1190
1202
|
let s = !1;
|
|
1191
|
-
for (const t of this.#
|
|
1203
|
+
for (const t of this.#r.values())
|
|
1192
1204
|
if (t) {
|
|
1193
1205
|
s = !0;
|
|
1194
1206
|
break;
|
|
@@ -1205,29 +1217,29 @@ function Se(e) {
|
|
|
1205
1217
|
);
|
|
1206
1218
|
}
|
|
1207
1219
|
function Ce(e) {
|
|
1208
|
-
const s = e.filter((
|
|
1209
|
-
const l = Se(
|
|
1210
|
-
let
|
|
1220
|
+
const s = e.filter((i) => i.path == null || i.path.length === 0).map((i) => i.message), t = e.filter((i) => i.path != null && i.path.length > 0).reduce((i, r) => {
|
|
1221
|
+
const l = Se(r.path), a = l.pop();
|
|
1222
|
+
let o = i;
|
|
1211
1223
|
for (const f of l)
|
|
1212
|
-
|
|
1213
|
-
return
|
|
1214
|
-
}, {}),
|
|
1224
|
+
o.dependencies == null && (o.dependencies = {}), o.dependencies[f] == null && (o.dependencies[f] = {}), o = o.dependencies[f];
|
|
1225
|
+
return o.dependencies == null && (o.dependencies = {}), o.dependencies[a] = { message: r.message }, i;
|
|
1226
|
+
}, {}), n = s.join(`
|
|
1215
1227
|
`);
|
|
1216
1228
|
return {
|
|
1217
1229
|
...t,
|
|
1218
|
-
message:
|
|
1230
|
+
message: n != "" ? n : void 0
|
|
1219
1231
|
};
|
|
1220
1232
|
}
|
|
1221
1233
|
function _e({
|
|
1222
1234
|
initialValue: e,
|
|
1223
1235
|
onChange: s,
|
|
1224
1236
|
validate: t,
|
|
1225
|
-
equals:
|
|
1226
|
-
validationMode:
|
|
1227
|
-
validateDebounceMs:
|
|
1237
|
+
equals: n,
|
|
1238
|
+
validationMode: i,
|
|
1239
|
+
validateDebounceMs: r
|
|
1228
1240
|
}) {
|
|
1229
|
-
const l = y.deriveProp(e),
|
|
1230
|
-
|
|
1241
|
+
const l = y.deriveProp(e), a = I(D.valid), o = I(!1), f = I(i ?? "touchedOrSubmit"), u = (d) => {
|
|
1242
|
+
a.set(d);
|
|
1231
1243
|
};
|
|
1232
1244
|
let g;
|
|
1233
1245
|
const w = async (d) => {
|
|
@@ -1241,7 +1253,7 @@ function _e({
|
|
|
1241
1253
|
if (t != null) {
|
|
1242
1254
|
if (p === "onSubmit")
|
|
1243
1255
|
return;
|
|
1244
|
-
const T =
|
|
1256
|
+
const T = r ?? 0;
|
|
1245
1257
|
T > 0 ? (g && clearTimeout(g), g = setTimeout(() => {
|
|
1246
1258
|
w(d);
|
|
1247
1259
|
}, T)) : await w(d);
|
|
@@ -1250,58 +1262,58 @@ function _e({
|
|
|
1250
1262
|
[],
|
|
1251
1263
|
v,
|
|
1252
1264
|
l,
|
|
1253
|
-
|
|
1265
|
+
a,
|
|
1254
1266
|
{
|
|
1255
|
-
disabled:
|
|
1267
|
+
disabled: o,
|
|
1256
1268
|
validationMode: f
|
|
1257
1269
|
},
|
|
1258
|
-
|
|
1270
|
+
n ?? P
|
|
1259
1271
|
);
|
|
1260
1272
|
return h.onDispose(() => {
|
|
1261
|
-
|
|
1273
|
+
o.dispose(), l.dispose(), a.dispose(), f.dispose(), g && clearTimeout(g);
|
|
1262
1274
|
}), { controller: h, setStatus: u };
|
|
1263
1275
|
}
|
|
1264
1276
|
function se(e) {
|
|
1265
|
-
return
|
|
1277
|
+
return x(c.disabled(e.disabled), c.name(e.name));
|
|
1266
1278
|
}
|
|
1267
1279
|
function Le(e, {
|
|
1268
1280
|
triggerOn: s = "change"
|
|
1269
1281
|
} = {}) {
|
|
1270
|
-
return
|
|
1282
|
+
return x(
|
|
1271
1283
|
se(e),
|
|
1272
|
-
|
|
1273
|
-
(s === "input" ? E.input : E.change)(
|
|
1284
|
+
c.value(e.signal),
|
|
1285
|
+
(s === "input" ? E.input : E.change)($(e.change))
|
|
1274
1286
|
);
|
|
1275
1287
|
}
|
|
1276
1288
|
function je(e, {
|
|
1277
1289
|
triggerOn: s = "change"
|
|
1278
1290
|
} = {}) {
|
|
1279
|
-
return
|
|
1291
|
+
return x(
|
|
1280
1292
|
se(e),
|
|
1281
|
-
|
|
1293
|
+
c.valueAsNumber(e.signal),
|
|
1282
1294
|
(s === "input" ? E.input : E.change)(
|
|
1283
1295
|
ie(e.change)
|
|
1284
1296
|
)
|
|
1285
1297
|
);
|
|
1286
1298
|
}
|
|
1287
|
-
function
|
|
1299
|
+
function J(e) {
|
|
1288
1300
|
return e.issues != null ? D.invalid(Ce(e.issues)) : D.valid;
|
|
1289
1301
|
}
|
|
1290
1302
|
async function qe({
|
|
1291
1303
|
task: e,
|
|
1292
1304
|
errorMessage: s,
|
|
1293
1305
|
errorPath: t = ["root"],
|
|
1294
|
-
validation:
|
|
1306
|
+
validation: n
|
|
1295
1307
|
}) {
|
|
1296
1308
|
try {
|
|
1297
|
-
const
|
|
1298
|
-
return
|
|
1299
|
-
} catch (
|
|
1300
|
-
const
|
|
1309
|
+
const i = await e();
|
|
1310
|
+
return n != null ? n(i) : D.valid;
|
|
1311
|
+
} catch (i) {
|
|
1312
|
+
const r = s ?? (i instanceof Error ? i.message : "Operation failed");
|
|
1301
1313
|
return t.length === 1 && t[0] === "root" ? D.invalid({
|
|
1302
|
-
message:
|
|
1314
|
+
message: r
|
|
1303
1315
|
}) : D.invalid({
|
|
1304
|
-
dependencies: te(t,
|
|
1316
|
+
dependencies: te(t, r)
|
|
1305
1317
|
});
|
|
1306
1318
|
}
|
|
1307
1319
|
}
|
|
@@ -1310,10 +1322,10 @@ function te(e, s) {
|
|
|
1310
1322
|
return {
|
|
1311
1323
|
[e[0]]: { message: s }
|
|
1312
1324
|
};
|
|
1313
|
-
const [t, ...
|
|
1325
|
+
const [t, ...n] = e;
|
|
1314
1326
|
return {
|
|
1315
1327
|
[t]: {
|
|
1316
|
-
dependencies: te(
|
|
1328
|
+
dependencies: te(n, s)
|
|
1317
1329
|
}
|
|
1318
1330
|
};
|
|
1319
1331
|
}
|
|
@@ -1321,37 +1333,37 @@ function ze({
|
|
|
1321
1333
|
initialValue: e = {},
|
|
1322
1334
|
schema: s,
|
|
1323
1335
|
onSubmit: t = async () => D.valid,
|
|
1324
|
-
validationMode:
|
|
1325
|
-
validateDebounceMs:
|
|
1336
|
+
validationMode: n,
|
|
1337
|
+
validateDebounceMs: i
|
|
1326
1338
|
}) {
|
|
1327
|
-
const { controller:
|
|
1339
|
+
const { controller: r, setStatus: l } = _e({
|
|
1328
1340
|
initialValue: e,
|
|
1329
|
-
validationMode:
|
|
1330
|
-
validateDebounceMs:
|
|
1331
|
-
validate: (
|
|
1341
|
+
validationMode: n ?? "touchedOrSubmit",
|
|
1342
|
+
validateDebounceMs: i,
|
|
1343
|
+
validate: (n ?? "touchedOrSubmit") === "onSubmit" || s == null ? void 0 : async (u) => J(
|
|
1332
1344
|
await s["~standard"].validate(u)
|
|
1333
1345
|
)
|
|
1334
|
-
}),
|
|
1335
|
-
return
|
|
1336
|
-
controller:
|
|
1346
|
+
}), a = I(!1), o = r.object();
|
|
1347
|
+
return o.onDispose(a.dispose), {
|
|
1348
|
+
controller: o,
|
|
1337
1349
|
setStatus: l,
|
|
1338
1350
|
submit: async (u) => {
|
|
1339
|
-
if (
|
|
1340
|
-
const w =
|
|
1351
|
+
if (a.set(!0), u?.preventDefault(), o.markAllTouched(), (n ?? "touchedOrSubmit") === "onSubmit") {
|
|
1352
|
+
const w = o.signal.value, v = s?.["~standard"].validate;
|
|
1341
1353
|
if (v == null) {
|
|
1342
|
-
|
|
1354
|
+
a.set(!1);
|
|
1343
1355
|
return;
|
|
1344
1356
|
}
|
|
1345
|
-
const h =
|
|
1357
|
+
const h = J(await v(w));
|
|
1346
1358
|
if (l(h), h.type === "invalid") {
|
|
1347
|
-
|
|
1359
|
+
a.set(!1);
|
|
1348
1360
|
return;
|
|
1349
1361
|
}
|
|
1350
1362
|
}
|
|
1351
|
-
const g = await t(
|
|
1352
|
-
|
|
1363
|
+
const g = await t(o.signal.value);
|
|
1364
|
+
a.set(!1), g.type === "invalid" && l(g);
|
|
1353
1365
|
},
|
|
1354
|
-
submitting:
|
|
1366
|
+
submitting: a
|
|
1355
1367
|
};
|
|
1356
1368
|
}
|
|
1357
1369
|
function De(e) {
|
|
@@ -1380,26 +1392,26 @@ function Ee(e) {
|
|
|
1380
1392
|
return "info";
|
|
1381
1393
|
}
|
|
1382
1394
|
}
|
|
1383
|
-
function Ie(e, s, t,
|
|
1384
|
-
const
|
|
1395
|
+
function Ie(e, s, t, n) {
|
|
1396
|
+
const i = [
|
|
1385
1397
|
"bc-notice",
|
|
1386
1398
|
`bc-notice--${e}`,
|
|
1387
1399
|
`bc-notice--tone-${s}`
|
|
1388
1400
|
];
|
|
1389
|
-
return t &&
|
|
1401
|
+
return t && i.push("bc-notice--dismissible"), n && n.length > 0 && i.push(n), i.join(" ");
|
|
1390
1402
|
}
|
|
1391
1403
|
function He({
|
|
1392
1404
|
variant: e = "info",
|
|
1393
1405
|
tone: s = "subtle",
|
|
1394
1406
|
role: t,
|
|
1395
|
-
title:
|
|
1396
|
-
icon:
|
|
1397
|
-
closable:
|
|
1407
|
+
title: n,
|
|
1408
|
+
icon: i,
|
|
1409
|
+
closable: r = !1,
|
|
1398
1410
|
onDismiss: l,
|
|
1399
|
-
class:
|
|
1400
|
-
}, ...
|
|
1411
|
+
class: a
|
|
1412
|
+
}, ...o) {
|
|
1401
1413
|
const f = y.map(
|
|
1402
|
-
|
|
1414
|
+
r,
|
|
1403
1415
|
(d) => !!d || l != null
|
|
1404
1416
|
), u = y.map(e, (d) => d ?? "info"), g = y.map(s, (d) => d ?? "subtle"), w = C(
|
|
1405
1417
|
t,
|
|
@@ -1409,23 +1421,23 @@ function He({
|
|
|
1409
1421
|
), v = I(!0), h = q(
|
|
1410
1422
|
z,
|
|
1411
1423
|
(d) => b.div(
|
|
1412
|
-
|
|
1424
|
+
c.class(
|
|
1413
1425
|
C(
|
|
1414
1426
|
u,
|
|
1415
1427
|
g,
|
|
1416
1428
|
f,
|
|
1417
|
-
|
|
1418
|
-
)((p, T, A,
|
|
1429
|
+
a
|
|
1430
|
+
)((p, T, A, F) => Ie(p, T, A, F))
|
|
1419
1431
|
),
|
|
1420
1432
|
// Accessibility role mapping (always defined)
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
y.map(
|
|
1433
|
+
c.role(y.map(w, (p) => p)),
|
|
1434
|
+
re(
|
|
1435
|
+
y.map(i, (p) => p === !1),
|
|
1424
1436
|
() => b.div(
|
|
1425
|
-
|
|
1437
|
+
c.class("bc-notice__icon"),
|
|
1426
1438
|
L({
|
|
1427
1439
|
icon: C(
|
|
1428
|
-
|
|
1440
|
+
i,
|
|
1429
1441
|
u
|
|
1430
1442
|
)((p, T) => p === void 0 ? De(T) : String(p)),
|
|
1431
1443
|
size: "md",
|
|
@@ -1434,13 +1446,13 @@ function He({
|
|
|
1434
1446
|
)
|
|
1435
1447
|
),
|
|
1436
1448
|
b.div(
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
b.div(
|
|
1449
|
+
c.class("bc-notice__body"),
|
|
1450
|
+
ae(n, (p) => b.div(c.class("bc-notice__title"), p)),
|
|
1451
|
+
b.div(c.class("bc-notice__content"), ...o)
|
|
1440
1452
|
),
|
|
1441
1453
|
O(
|
|
1442
1454
|
f,
|
|
1443
|
-
() =>
|
|
1455
|
+
() => ce({
|
|
1444
1456
|
size: "xs",
|
|
1445
1457
|
label: d.$.closeModal,
|
|
1446
1458
|
onClick: () => {
|
|
@@ -1450,8 +1462,8 @@ function He({
|
|
|
1450
1462
|
)
|
|
1451
1463
|
)
|
|
1452
1464
|
);
|
|
1453
|
-
return
|
|
1454
|
-
|
|
1465
|
+
return x(
|
|
1466
|
+
X(
|
|
1455
1467
|
() => {
|
|
1456
1468
|
y.dispose(f), y.dispose(u), y.dispose(g);
|
|
1457
1469
|
},
|
|
@@ -1464,17 +1476,17 @@ function He({
|
|
|
1464
1476
|
export {
|
|
1465
1477
|
ke as A,
|
|
1466
1478
|
ee as B,
|
|
1467
|
-
|
|
1479
|
+
ce as C,
|
|
1468
1480
|
Oe as D,
|
|
1469
|
-
|
|
1481
|
+
$e as E,
|
|
1470
1482
|
Z as I,
|
|
1471
1483
|
ue as L,
|
|
1472
1484
|
Be as M,
|
|
1473
1485
|
He as N,
|
|
1474
1486
|
P as O,
|
|
1475
|
-
|
|
1487
|
+
xe as P,
|
|
1476
1488
|
de as R,
|
|
1477
|
-
|
|
1489
|
+
Fe as S,
|
|
1478
1490
|
D as a,
|
|
1479
1491
|
Me as b,
|
|
1480
1492
|
Pe as c,
|
|
@@ -1492,8 +1504,8 @@ export {
|
|
|
1492
1504
|
Le as o,
|
|
1493
1505
|
Ne as p,
|
|
1494
1506
|
je as q,
|
|
1495
|
-
|
|
1496
|
-
|
|
1507
|
+
J as r,
|
|
1508
|
+
H as s,
|
|
1497
1509
|
qe as t,
|
|
1498
1510
|
ze as u,
|
|
1499
1511
|
Ve as v,
|