@tempots/beatui 0.35.0 → 0.36.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-DJeW9RI7.cjs → 2019-B1QESOSc.cjs} +1 -1
- package/dist/{2019-Dmseo7Cq.js → 2019-RaU4YQ5c.js} +2 -2
- package/dist/{2020-I1mnGGtD.js → 2020-BAomdSE8.js} +2 -2
- package/dist/{2020-BySxLQc5.cjs → 2020-BI-SxTSK.cjs} +1 -1
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +2 -2
- package/dist/beatui.css +398 -10
- package/dist/beatui.tailwind.css +398 -10
- package/dist/{index-CBc0q0zl.cjs → index-BKjL6RO2.cjs} +2 -2
- package/dist/{index-D-CBfcZj.js → index-BS0NyhvV.js} +192 -189
- package/dist/{index-Ct2_ulan.cjs → index-BzApzJXc.cjs} +1 -1
- package/dist/{index-DbQzJti7.js → index-Dc9UNC8n.js} +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +1462 -1332
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +1 -1
- package/dist/{modal-Dm61yY5i.js → modal-CxG-RO9B.js} +1 -1
- package/dist/{modal-AFhB4rIq.cjs → modal-OMSAbIg1.cjs} +1 -1
- package/dist/notice-0Xhzr7qR.cjs +2 -0
- package/dist/{notice-Cd9ElXwb.js → notice-C7o5d8Jw.js} +390 -375
- package/dist/types/components/data/index.d.ts +1 -0
- package/dist/types/components/data/table.d.ts +27 -0
- package/dist/types/components/form/input/input-wrapper.d.ts +4 -2
- package/dist/types/components/form/input/switch.d.ts +4 -3
- package/dist/types/components/layout/action-card.d.ts +19 -0
- package/dist/types/components/layout/index.d.ts +1 -0
- package/dist/utils-BcIRhDH0.cjs +1 -0
- package/dist/{utils-g5YCiiS6.js → utils-C7619Rp3.js} +392 -398
- package/package.json +1 -1
- package/dist/notice-len8sDjL.cjs +0 -2
- package/dist/utils-BetBqtiV.cjs +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Use as
|
|
2
|
-
import { a as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const s =
|
|
6
|
-
return
|
|
1
|
+
import { Use as j, coalesce as G, aria as P, attr as o, html as b, on as I, Value as C, Empty as _, computedOf as w, When as O, dataAttr as H, input as se, emitValue as $, prop as T, Fragment as B, emitValueAsNumber as te, Unless as ne, Ensure as ie } from "@tempots/dom";
|
|
2
|
+
import { a as q, B as re, I as N, b as U, C as J } from "./translations-iam7PITs.js";
|
|
3
|
+
const R = /* @__PURE__ */ new Map();
|
|
4
|
+
function Q(e) {
|
|
5
|
+
const s = R.get(e) ?? 0;
|
|
6
|
+
return R.set(e, s + 1), `${e}-${s}`;
|
|
7
7
|
}
|
|
8
8
|
const k = {
|
|
9
9
|
/**
|
|
@@ -196,7 +196,7 @@ const k = {
|
|
|
196
196
|
return k.failure(s instanceof Error ? s : new Error(String(s)));
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
},
|
|
199
|
+
}, F = (e, s) => e === s || e !== e && s !== s, D = {
|
|
200
200
|
/**
|
|
201
201
|
* Creates a valid `Validation`.
|
|
202
202
|
* @returns A `Validation` that is `Valid`.
|
|
@@ -234,14 +234,14 @@ const k = {
|
|
|
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) => D.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) => D.match(
|
|
245
245
|
e,
|
|
246
246
|
() => m.success(s),
|
|
247
247
|
(t) => m.failure(t)
|
|
@@ -253,7 +253,7 @@ const k = {
|
|
|
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) => (D.isValid(e) && s(), e),
|
|
257
257
|
/**
|
|
258
258
|
* Execute a function when the `Validation` is invalid.
|
|
259
259
|
*
|
|
@@ -261,7 +261,7 @@ const k = {
|
|
|
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) => (D.isInvalid(e) && s(e.error), e)
|
|
265
265
|
}, m = {
|
|
266
266
|
/**
|
|
267
267
|
* Creates a successful `Result`.
|
|
@@ -321,8 +321,8 @@ const k = {
|
|
|
321
321
|
toValidation(e) {
|
|
322
322
|
return m.match(
|
|
323
323
|
e,
|
|
324
|
-
() =>
|
|
325
|
-
(s) =>
|
|
324
|
+
() => D.valid,
|
|
325
|
+
(s) => D.invalid(s)
|
|
326
326
|
);
|
|
327
327
|
},
|
|
328
328
|
/**
|
|
@@ -420,14 +420,14 @@ const k = {
|
|
|
420
420
|
e,
|
|
421
421
|
(n) => m.match(
|
|
422
422
|
s,
|
|
423
|
-
(
|
|
424
|
-
(
|
|
423
|
+
(r) => m.success(t(n, r)),
|
|
424
|
+
(r) => m.failure(r)
|
|
425
425
|
),
|
|
426
426
|
(n) => m.match(
|
|
427
427
|
s,
|
|
428
428
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
429
|
-
(
|
|
430
|
-
(
|
|
429
|
+
(r) => m.failure(n),
|
|
430
|
+
(r) => m.failure(i(n, r))
|
|
431
431
|
)
|
|
432
432
|
),
|
|
433
433
|
/**
|
|
@@ -456,55 +456,55 @@ const k = {
|
|
|
456
456
|
return m.success(s);
|
|
457
457
|
}
|
|
458
458
|
};
|
|
459
|
-
function
|
|
459
|
+
function ae({
|
|
460
460
|
size: e = "sm",
|
|
461
461
|
icon: s = "line-md:close",
|
|
462
462
|
disabled: t,
|
|
463
463
|
roundedness: i = "full",
|
|
464
464
|
color: n = "base",
|
|
465
|
-
onClick:
|
|
466
|
-
label:
|
|
465
|
+
onClick: r,
|
|
466
|
+
label: a
|
|
467
467
|
}, ...l) {
|
|
468
|
-
return
|
|
469
|
-
const
|
|
470
|
-
return
|
|
468
|
+
return j(q, (c) => {
|
|
469
|
+
const p = G(a, c.$.closeModal);
|
|
470
|
+
return re(
|
|
471
471
|
{
|
|
472
472
|
variant: "text",
|
|
473
473
|
size: e,
|
|
474
474
|
roundedness: i,
|
|
475
475
|
disabled: t,
|
|
476
476
|
color: n,
|
|
477
|
-
onClick:
|
|
477
|
+
onClick: r
|
|
478
478
|
},
|
|
479
|
-
o.title(
|
|
480
|
-
|
|
479
|
+
o.title(p),
|
|
480
|
+
P.label(p),
|
|
481
481
|
...l,
|
|
482
|
-
|
|
482
|
+
N({ icon: s, size: e ?? "sm" })
|
|
483
483
|
);
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
|
-
function
|
|
486
|
+
function z(e) {
|
|
487
487
|
return `bc-label bc-label--${e}`;
|
|
488
488
|
}
|
|
489
|
-
const
|
|
489
|
+
const Ie = (...e) => b.span(o.class(z("emphasis")), ...e), le = (...e) => b.span(o.class(z("default")), ...e), ce = (...e) => b.span(o.class(z("muted")), ...e), Te = (...e) => b.span(o.class(z("danger")), ...e), Ae = (e) => {
|
|
490
490
|
const {
|
|
491
491
|
value: s,
|
|
492
492
|
onBlur: t,
|
|
493
493
|
onChange: i,
|
|
494
494
|
placeholder: n,
|
|
495
|
-
disabled:
|
|
496
|
-
id:
|
|
495
|
+
disabled: r,
|
|
496
|
+
id: a,
|
|
497
497
|
checkedIcon: l,
|
|
498
498
|
uncheckedIcon: c,
|
|
499
|
-
iconSize:
|
|
500
|
-
} = e, u =
|
|
501
|
-
if (C.get(
|
|
502
|
-
const
|
|
503
|
-
i?.(!
|
|
504
|
-
}, v = (
|
|
505
|
-
C.get(
|
|
499
|
+
iconSize: p = "lg"
|
|
500
|
+
} = e, u = a ?? Q("checkbox"), g = `${u}-label`, S = () => {
|
|
501
|
+
if (C.get(r ?? !1)) return;
|
|
502
|
+
const d = C.get(s);
|
|
503
|
+
i?.(!d);
|
|
504
|
+
}, v = (d) => {
|
|
505
|
+
C.get(r ?? !1) || (d.key === " " || d.key === "Enter") && (d.preventDefault(), S());
|
|
506
506
|
};
|
|
507
|
-
return
|
|
507
|
+
return U(
|
|
508
508
|
{
|
|
509
509
|
baseContainer: !0,
|
|
510
510
|
growInput: !1,
|
|
@@ -516,79 +516,97 @@ const De = (...e) => b.span(o.class(j("emphasis")), ...e), ae = (...e) => b.span
|
|
|
516
516
|
o.class(
|
|
517
517
|
C.map(
|
|
518
518
|
s,
|
|
519
|
-
(
|
|
519
|
+
(d) => d ? "bc-checkbox-input__checkbox--checked" : "bc-checkbox-input__checkbox--unchecked"
|
|
520
520
|
)
|
|
521
521
|
),
|
|
522
522
|
o.class(
|
|
523
523
|
C.map(
|
|
524
|
-
|
|
525
|
-
(
|
|
524
|
+
r ?? !1,
|
|
525
|
+
(d) => d ? "bc-checkbox-input__checkbox--disabled" : ""
|
|
526
526
|
)
|
|
527
527
|
),
|
|
528
528
|
o.id(u),
|
|
529
529
|
o.role("checkbox"),
|
|
530
530
|
o.tabindex(
|
|
531
531
|
C.map(
|
|
532
|
-
|
|
533
|
-
(
|
|
532
|
+
r ?? !1,
|
|
533
|
+
(d) => d ? -1 : 0
|
|
534
534
|
)
|
|
535
535
|
),
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
n != null ?
|
|
539
|
-
|
|
540
|
-
t != null ?
|
|
541
|
-
|
|
542
|
-
icon:
|
|
536
|
+
P.checked(s),
|
|
537
|
+
P.disabled(r),
|
|
538
|
+
n != null ? P.labelledby(g) : _,
|
|
539
|
+
I.keydown(v),
|
|
540
|
+
t != null ? I.blur(t) : _,
|
|
541
|
+
N({
|
|
542
|
+
icon: w(
|
|
543
543
|
s,
|
|
544
544
|
l,
|
|
545
545
|
c
|
|
546
546
|
)(
|
|
547
|
-
(
|
|
547
|
+
(d, h, f) => d ? h ?? "akar-icons/check-box-fill" : f ?? "akar-icons/box"
|
|
548
548
|
),
|
|
549
549
|
accessibility: "decorative",
|
|
550
|
-
size:
|
|
550
|
+
size: p
|
|
551
551
|
})
|
|
552
552
|
),
|
|
553
553
|
n != null ? b.label(
|
|
554
554
|
o.class("bc-checkbox-input__label"),
|
|
555
555
|
o.id(g),
|
|
556
556
|
o.for(u),
|
|
557
|
-
|
|
558
|
-
) :
|
|
557
|
+
ce(n)
|
|
558
|
+
) : _
|
|
559
559
|
)
|
|
560
560
|
},
|
|
561
|
-
|
|
561
|
+
I.click(S)
|
|
562
562
|
);
|
|
563
|
-
},
|
|
563
|
+
}, oe = b.span(
|
|
564
564
|
o.class("bc-input-wrapper__required"),
|
|
565
565
|
" *"
|
|
566
566
|
);
|
|
567
|
-
function
|
|
567
|
+
function ue(e) {
|
|
568
568
|
const s = ["bc-input-wrapper"];
|
|
569
|
-
return e && s.push(
|
|
569
|
+
return e !== "vertical" && s.push(`bc-input-wrapper--${e}`), s.join(" ");
|
|
570
570
|
}
|
|
571
|
-
function
|
|
571
|
+
function he(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
|
-
|
|
575
|
+
function W(e, s) {
|
|
576
|
+
if (e === "horizontal-fixed" && s != null)
|
|
577
|
+
return `--input-wrapper-label-width: ${s}`;
|
|
578
|
+
}
|
|
579
|
+
const X = ({
|
|
576
580
|
required: e,
|
|
577
581
|
label: s,
|
|
578
582
|
labelChildren: t,
|
|
579
583
|
context: i,
|
|
580
584
|
description: n,
|
|
581
|
-
content:
|
|
582
|
-
error:
|
|
585
|
+
content: r,
|
|
586
|
+
error: a,
|
|
583
587
|
labelFor: l,
|
|
584
588
|
hasError: c,
|
|
585
|
-
disabled:
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
+
disabled: p,
|
|
590
|
+
layout: u,
|
|
591
|
+
labelWidth: g
|
|
592
|
+
}, ...S) => {
|
|
593
|
+
const v = c ?? a != null, d = p ?? !1, h = u ?? "vertical", f = Q("input-wrapper"), E = n ? `${f}-description` : void 0, A = a != null ? `${f}-error` : void 0, x = w(h)((y) => y !== "vertical");
|
|
589
594
|
return b.div(
|
|
590
|
-
o.class(
|
|
591
|
-
|
|
595
|
+
o.class(C.map(h, (y) => ue(y))),
|
|
596
|
+
O(
|
|
597
|
+
w(
|
|
598
|
+
h,
|
|
599
|
+
g ?? void 0
|
|
600
|
+
)((y, V) => W(y, V) != null),
|
|
601
|
+
() => o.style(
|
|
602
|
+
C.map(
|
|
603
|
+
w(
|
|
604
|
+
h,
|
|
605
|
+
g ?? void 0
|
|
606
|
+
)((y, V) => W(y, V)),
|
|
607
|
+
(y) => y
|
|
608
|
+
)
|
|
609
|
+
)
|
|
592
610
|
),
|
|
593
611
|
s != null || i != null ? b.div(
|
|
594
612
|
o.class("bc-input-wrapper__header"),
|
|
@@ -596,82 +614,79 @@ const G = ({
|
|
|
596
614
|
o.class("bc-input-wrapper__label-section"),
|
|
597
615
|
b.label(
|
|
598
616
|
o.class("bc-input-wrapper__label"),
|
|
599
|
-
l != null ? o.for(l) :
|
|
617
|
+
l != null ? o.for(l) : _,
|
|
600
618
|
b.span(
|
|
601
619
|
o.class(
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
620
|
+
w(
|
|
621
|
+
v,
|
|
622
|
+
d
|
|
605
623
|
)(
|
|
606
|
-
(
|
|
607
|
-
|
|
608
|
-
|
|
624
|
+
(y, V) => he(
|
|
625
|
+
y ?? !1,
|
|
626
|
+
V ?? !1
|
|
609
627
|
)
|
|
610
628
|
)
|
|
611
629
|
),
|
|
612
630
|
s
|
|
613
631
|
),
|
|
614
|
-
s != null && e ?
|
|
632
|
+
s != null && e ? oe : _
|
|
615
633
|
),
|
|
616
634
|
// Show description under label when horizontal
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
635
|
+
O(
|
|
636
|
+
w(
|
|
637
|
+
x,
|
|
620
638
|
n
|
|
621
|
-
)((
|
|
639
|
+
)((y, V) => y && V != null),
|
|
622
640
|
() => b.div(
|
|
623
641
|
o.class(
|
|
624
642
|
"bc-input-wrapper__description bc-input-wrapper__description--under-label"
|
|
625
643
|
),
|
|
626
|
-
o.id(
|
|
644
|
+
o.id(E),
|
|
627
645
|
n
|
|
628
646
|
)
|
|
629
647
|
)
|
|
630
648
|
),
|
|
631
|
-
i != null ?
|
|
649
|
+
i != null ? le(i) : _,
|
|
632
650
|
t
|
|
633
|
-
) :
|
|
651
|
+
) : _,
|
|
634
652
|
b.div(
|
|
635
653
|
o.class("bc-input-wrapper__content"),
|
|
636
654
|
// Add data attributes to help inputs inherit accessibility information
|
|
637
|
-
[
|
|
638
|
-
[
|
|
639
|
-
) :
|
|
640
|
-
e ?
|
|
641
|
-
|
|
642
|
-
|
|
655
|
+
[E, A].filter(Boolean).length > 0 ? H.describedby(
|
|
656
|
+
[E, A].filter(Boolean).join(" ")
|
|
657
|
+
) : _,
|
|
658
|
+
e ? H.required("true") : _,
|
|
659
|
+
O(v, () => H.invalid("true")),
|
|
660
|
+
r
|
|
643
661
|
),
|
|
644
662
|
// Show description at bottom only when not horizontal
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
h,
|
|
648
|
-
n
|
|
649
|
-
)((T, A) => !T && A != null),
|
|
663
|
+
O(
|
|
664
|
+
w(x, n)((y, V) => !y && V != null),
|
|
650
665
|
() => b.div(
|
|
651
666
|
o.class("bc-input-wrapper__description"),
|
|
652
|
-
o.id(
|
|
667
|
+
o.id(E),
|
|
653
668
|
n
|
|
654
669
|
)
|
|
655
670
|
),
|
|
656
|
-
|
|
657
|
-
|
|
671
|
+
a != null ? O(
|
|
672
|
+
v,
|
|
658
673
|
() => b.div(
|
|
659
674
|
o.class("bc-input-wrapper__error"),
|
|
660
|
-
o.id(
|
|
661
|
-
|
|
675
|
+
o.id(A),
|
|
676
|
+
P.live("polite"),
|
|
662
677
|
// Announce errors to screen readers
|
|
663
678
|
o.role("alert"),
|
|
664
679
|
// Mark as alert for immediate attention
|
|
665
|
-
|
|
680
|
+
a
|
|
666
681
|
)
|
|
667
682
|
) : null,
|
|
668
|
-
...
|
|
683
|
+
...S
|
|
669
684
|
);
|
|
670
685
|
};
|
|
671
|
-
function
|
|
686
|
+
function Ve(...e) {
|
|
672
687
|
return b.div(o.class("bc-stack"), ...e);
|
|
673
688
|
}
|
|
674
|
-
const
|
|
689
|
+
const Oe = (e) => {
|
|
675
690
|
const s = {
|
|
676
691
|
name: "email",
|
|
677
692
|
autocomplete: "email",
|
|
@@ -680,116 +695,116 @@ const Ae = (e) => {
|
|
|
680
695
|
value: t,
|
|
681
696
|
before: i,
|
|
682
697
|
onBlur: n,
|
|
683
|
-
onChange:
|
|
684
|
-
onInput:
|
|
698
|
+
onChange: r,
|
|
699
|
+
onInput: a,
|
|
685
700
|
placeholder: l
|
|
686
|
-
} = s, c = i ??
|
|
701
|
+
} = s, c = i ?? N({
|
|
687
702
|
icon: "line-md:email",
|
|
688
703
|
size: "sm",
|
|
689
704
|
color: "neutral"
|
|
690
705
|
});
|
|
691
|
-
return
|
|
692
|
-
|
|
693
|
-
(
|
|
706
|
+
return j(
|
|
707
|
+
q,
|
|
708
|
+
(p) => U({
|
|
694
709
|
...e,
|
|
695
710
|
before: c,
|
|
696
|
-
input:
|
|
697
|
-
|
|
698
|
-
o.placeholder(
|
|
711
|
+
input: se.email(
|
|
712
|
+
J(s),
|
|
713
|
+
o.placeholder(G(l, p.$.emailPlaceholderText)),
|
|
699
714
|
o.value(t),
|
|
700
715
|
o.class("bc-input"),
|
|
701
|
-
n != null ?
|
|
702
|
-
|
|
703
|
-
|
|
716
|
+
n != null ? I.blur($(n)) : _,
|
|
717
|
+
r != null ? I.change($(r)) : _,
|
|
718
|
+
a != null ? I.input($(a)) : _
|
|
704
719
|
)
|
|
705
720
|
})
|
|
706
721
|
);
|
|
707
|
-
},
|
|
722
|
+
}, Me = (e) => {
|
|
708
723
|
const {
|
|
709
724
|
value: s,
|
|
710
725
|
onBlur: t,
|
|
711
726
|
onChange: i,
|
|
712
727
|
onInput: n,
|
|
713
|
-
before:
|
|
714
|
-
after:
|
|
728
|
+
before: r,
|
|
729
|
+
after: a,
|
|
715
730
|
hasError: l,
|
|
716
731
|
disabled: c,
|
|
717
|
-
autocomplete:
|
|
732
|
+
autocomplete: p,
|
|
718
733
|
placeholder: u,
|
|
719
734
|
...g
|
|
720
|
-
} = e,
|
|
735
|
+
} = e, S = {
|
|
721
736
|
name: "password",
|
|
722
737
|
disabled: c,
|
|
723
738
|
...g
|
|
724
|
-
}, v =
|
|
739
|
+
}, v = T(!0), d = w(
|
|
725
740
|
v,
|
|
726
|
-
|
|
727
|
-
)((
|
|
728
|
-
return
|
|
729
|
-
const
|
|
730
|
-
|
|
741
|
+
p
|
|
742
|
+
)((h, f) => h ? f ?? "current-password" : "off");
|
|
743
|
+
return j(q, (h) => {
|
|
744
|
+
const f = w(
|
|
745
|
+
h.$.passwordPlaceholderText,
|
|
731
746
|
v,
|
|
732
747
|
u
|
|
733
|
-
)((
|
|
748
|
+
)((A, x, y) => x ? "•••••••••••••••" : y ?? A), E = b.button(
|
|
734
749
|
o.type("button"),
|
|
735
750
|
o.class("bc-input-container__password-toggle"),
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
751
|
+
P.label(h.$.togglePasswordVisibility),
|
|
752
|
+
I.click(() => v.update((A) => !A)),
|
|
753
|
+
O(
|
|
739
754
|
v,
|
|
740
|
-
() =>
|
|
741
|
-
() =>
|
|
755
|
+
() => N({ icon: "line-md:watch" }),
|
|
756
|
+
() => N({ icon: "line-md:watch-off" })
|
|
742
757
|
)
|
|
743
758
|
);
|
|
744
|
-
return
|
|
745
|
-
before:
|
|
759
|
+
return U({
|
|
760
|
+
before: r,
|
|
746
761
|
disabled: c,
|
|
747
762
|
hasError: l,
|
|
748
763
|
input: b.input(
|
|
749
|
-
|
|
750
|
-
...
|
|
751
|
-
autocomplete:
|
|
752
|
-
placeholder:
|
|
764
|
+
J({
|
|
765
|
+
...S,
|
|
766
|
+
autocomplete: d,
|
|
767
|
+
placeholder: f
|
|
753
768
|
}),
|
|
754
|
-
|
|
769
|
+
O(
|
|
755
770
|
v,
|
|
756
|
-
() =>
|
|
757
|
-
() =>
|
|
771
|
+
() => B(o.type("password")),
|
|
772
|
+
() => B(o.type("text"))
|
|
758
773
|
),
|
|
759
774
|
o.class("bc-input"),
|
|
760
775
|
o.value(s),
|
|
761
|
-
t != null ?
|
|
762
|
-
i != null ?
|
|
763
|
-
n != null ?
|
|
776
|
+
t != null ? I.blur($(t)) : _,
|
|
777
|
+
i != null ? I.change($(i)) : _,
|
|
778
|
+
n != null ? I.input($(n)) : _
|
|
764
779
|
),
|
|
765
|
-
after:
|
|
780
|
+
after: a != null ? B(E, a) : E
|
|
766
781
|
});
|
|
767
782
|
});
|
|
768
|
-
},
|
|
783
|
+
}, de = (
|
|
769
784
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
770
785
|
(e, s) => () => {
|
|
771
786
|
e.markTouched(), s?.();
|
|
772
787
|
}
|
|
773
|
-
),
|
|
788
|
+
), pe = (e, s) => (t) => {
|
|
774
789
|
e.change(t), s?.(t);
|
|
775
790
|
};
|
|
776
|
-
function
|
|
777
|
-
const { controller: t, onBlur: i, onChange: n, ...
|
|
791
|
+
function Y(e, s) {
|
|
792
|
+
const { controller: t, onBlur: i, onChange: n, ...r } = s;
|
|
778
793
|
return e({
|
|
779
794
|
id: t.name,
|
|
780
795
|
disabled: t.disabled,
|
|
781
796
|
value: t.signal,
|
|
782
797
|
hasError: t.errorVisible,
|
|
783
|
-
...
|
|
784
|
-
onChange:
|
|
785
|
-
onBlur:
|
|
798
|
+
...r,
|
|
799
|
+
onChange: pe(t, n),
|
|
800
|
+
onBlur: de(t, i)
|
|
786
801
|
});
|
|
787
802
|
}
|
|
788
|
-
function
|
|
789
|
-
return
|
|
803
|
+
function $e(e, s, ...t) {
|
|
804
|
+
return X(
|
|
790
805
|
{
|
|
791
806
|
...s,
|
|
792
|
-
content:
|
|
807
|
+
content: Y(
|
|
793
808
|
e,
|
|
794
809
|
s
|
|
795
810
|
)
|
|
@@ -797,49 +812,49 @@ function Oe(e, s, ...t) {
|
|
|
797
812
|
...t
|
|
798
813
|
);
|
|
799
814
|
}
|
|
800
|
-
function
|
|
801
|
-
const { toInput: t, fromInput: i, controller: n, ...
|
|
802
|
-
return
|
|
803
|
-
...
|
|
804
|
-
controller:
|
|
815
|
+
function fe(e, s) {
|
|
816
|
+
const { toInput: t, fromInput: i, controller: n, ...r } = s, a = n.transform(t, i);
|
|
817
|
+
return Y(e, {
|
|
818
|
+
...r,
|
|
819
|
+
controller: a
|
|
805
820
|
});
|
|
806
821
|
}
|
|
807
|
-
function
|
|
808
|
-
return
|
|
822
|
+
function xe(e, s, ...t) {
|
|
823
|
+
return X(
|
|
809
824
|
{
|
|
810
825
|
...s,
|
|
811
|
-
content:
|
|
826
|
+
content: fe(e, s)
|
|
812
827
|
},
|
|
813
828
|
...t
|
|
814
829
|
);
|
|
815
830
|
}
|
|
816
|
-
function
|
|
831
|
+
function Fe(e) {
|
|
817
832
|
return e.split(".").map((t) => {
|
|
818
833
|
const i = t.match(/^\[(\d+)\]$/);
|
|
819
834
|
return i ? Number(i[1]) : t;
|
|
820
835
|
});
|
|
821
836
|
}
|
|
822
|
-
function
|
|
837
|
+
function be(e) {
|
|
823
838
|
return typeof e == "number" ? `[${e}]` : `.${e}`;
|
|
824
839
|
}
|
|
825
|
-
function
|
|
840
|
+
function me(e) {
|
|
826
841
|
if (e.length === 0) return "";
|
|
827
842
|
const [s, ...t] = e;
|
|
828
843
|
return [
|
|
829
844
|
typeof s == "number" ? `[${s}]` : s,
|
|
830
|
-
...t.map(
|
|
845
|
+
...t.map(be)
|
|
831
846
|
].join("");
|
|
832
847
|
}
|
|
833
|
-
function
|
|
848
|
+
function L(e) {
|
|
834
849
|
return function(t) {
|
|
835
850
|
if (t.type === "valid") return t;
|
|
836
851
|
let i = t.error;
|
|
837
852
|
for (const n of e)
|
|
838
|
-
if (i = i?.dependencies?.[n], i == null) return
|
|
839
|
-
return
|
|
853
|
+
if (i = i?.dependencies?.[n], i == null) return D.valid;
|
|
854
|
+
return D.invalid(i);
|
|
840
855
|
};
|
|
841
856
|
}
|
|
842
|
-
class
|
|
857
|
+
class M {
|
|
843
858
|
path;
|
|
844
859
|
change;
|
|
845
860
|
signal;
|
|
@@ -851,34 +866,34 @@ class O {
|
|
|
851
866
|
dirty;
|
|
852
867
|
dependencyErrors;
|
|
853
868
|
#e = {
|
|
854
|
-
disabled:
|
|
855
|
-
touched:
|
|
869
|
+
disabled: T(!1),
|
|
870
|
+
touched: T(!1)
|
|
856
871
|
};
|
|
857
872
|
#t;
|
|
858
|
-
#s =
|
|
873
|
+
#s = T(void 0);
|
|
859
874
|
parent;
|
|
860
875
|
disabled;
|
|
861
876
|
#n = [];
|
|
862
877
|
disabledOrHasErrors;
|
|
863
|
-
constructor(s, t, i, n,
|
|
864
|
-
this.path = s, this.change = t, this.signal = i, this.status = n, this.#t =
|
|
878
|
+
constructor(s, t, i, n, r, a = F) {
|
|
879
|
+
this.path = s, this.change = t, this.signal = i, this.status = n, this.#t = a, this.#s.set(i.value), this.error = n.map(
|
|
865
880
|
(l) => l?.type === "invalid" ? l.error?.message : void 0
|
|
866
|
-
), this.hasError = this.error.map((l) => l != null), this.touched = this.#e.touched,
|
|
881
|
+
), this.hasError = this.error.map((l) => l != null), this.touched = this.#e.touched, r.validationMode ? this.errorVisible = w(
|
|
867
882
|
this.hasError,
|
|
868
883
|
this.touched,
|
|
869
|
-
|
|
870
|
-
)((l, c,
|
|
884
|
+
r.validationMode
|
|
885
|
+
)((l, c, p) => p === "continuous" ? !!l : !!l && !!c) : this.errorVisible = w(
|
|
871
886
|
this.hasError,
|
|
872
887
|
this.touched
|
|
873
|
-
)((l, c) => !!l && !!c), this.dirty =
|
|
888
|
+
)((l, c) => !!l && !!c), this.dirty = w(
|
|
874
889
|
this.signal,
|
|
875
890
|
this.#s
|
|
876
891
|
)((l, c) => !this.#t(l, c)), this.dependencyErrors = n.map(
|
|
877
892
|
(l) => l?.type === "invalid" ? l.error?.dependencies : void 0
|
|
878
|
-
), this.parent =
|
|
893
|
+
), this.parent = r, this.disabled = w(
|
|
879
894
|
this.#e.disabled,
|
|
880
|
-
|
|
881
|
-
)((l, c) => l || c), this.disabledOrHasErrors =
|
|
895
|
+
r.disabled
|
|
896
|
+
)((l, c) => l || c), this.disabledOrHasErrors = w(
|
|
882
897
|
this.disabled,
|
|
883
898
|
this.hasError
|
|
884
899
|
)((l, c) => l || c), this.onDispose(() => {
|
|
@@ -886,7 +901,7 @@ class O {
|
|
|
886
901
|
});
|
|
887
902
|
}
|
|
888
903
|
get name() {
|
|
889
|
-
return
|
|
904
|
+
return me(this.path);
|
|
890
905
|
}
|
|
891
906
|
onDispose = (s) => {
|
|
892
907
|
this.#n.push(s);
|
|
@@ -917,7 +932,7 @@ class O {
|
|
|
917
932
|
reset = () => {
|
|
918
933
|
this.change(this.#s.value);
|
|
919
934
|
};
|
|
920
|
-
array = (s =
|
|
935
|
+
array = (s = F) => new ve(
|
|
921
936
|
this.path,
|
|
922
937
|
this.change,
|
|
923
938
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -926,7 +941,7 @@ class O {
|
|
|
926
941
|
this.parent,
|
|
927
942
|
s
|
|
928
943
|
);
|
|
929
|
-
object = (s =
|
|
944
|
+
object = (s = F) => new ge(
|
|
930
945
|
this.path,
|
|
931
946
|
this.change,
|
|
932
947
|
this.signal,
|
|
@@ -934,34 +949,34 @@ class O {
|
|
|
934
949
|
this.parent,
|
|
935
950
|
s
|
|
936
951
|
);
|
|
937
|
-
transform = (s, t, i = [], n =
|
|
952
|
+
transform = (s, t, i = [], n = F) => new M(
|
|
938
953
|
[...this.path, ...i],
|
|
939
|
-
(
|
|
954
|
+
(r) => this.change(t(r)),
|
|
940
955
|
this.signal.map(s, n),
|
|
941
|
-
this.status.map(
|
|
956
|
+
this.status.map(L(i)),
|
|
942
957
|
this.parent,
|
|
943
958
|
n
|
|
944
959
|
);
|
|
945
|
-
asyncTransform = (s, t, i, n = [],
|
|
960
|
+
asyncTransform = (s, t, i, n = [], r = F) => new M(
|
|
946
961
|
[...this.path, ...n],
|
|
947
|
-
(
|
|
948
|
-
t(
|
|
962
|
+
(a) => {
|
|
963
|
+
t(a).then((l) => this.change(l));
|
|
949
964
|
},
|
|
950
|
-
this.signal.mapAsync(s, i, void 0,
|
|
951
|
-
this.status.map(
|
|
965
|
+
this.signal.mapAsync(s, i, void 0, r),
|
|
966
|
+
this.status.map(L(n)),
|
|
952
967
|
this.parent,
|
|
953
|
-
|
|
968
|
+
r
|
|
954
969
|
);
|
|
955
970
|
}
|
|
956
|
-
class
|
|
971
|
+
class ge extends M {
|
|
957
972
|
#e = /* @__PURE__ */ new Map();
|
|
958
973
|
#t = /* @__PURE__ */ new Map();
|
|
959
974
|
#s = /* @__PURE__ */ new Map();
|
|
960
|
-
#n =
|
|
975
|
+
#n = T(!1);
|
|
961
976
|
touchedDeep = this.#n;
|
|
962
|
-
#
|
|
977
|
+
#r = /* @__PURE__ */ new Map();
|
|
963
978
|
#i = /* @__PURE__ */ new Map();
|
|
964
|
-
#l =
|
|
979
|
+
#l = T(!1);
|
|
965
980
|
dirtyDeep = this.#l;
|
|
966
981
|
#o;
|
|
967
982
|
#u;
|
|
@@ -974,20 +989,20 @@ class be extends O {
|
|
|
974
989
|
}
|
|
975
990
|
this.#n.set(this.touched.value || s);
|
|
976
991
|
};
|
|
977
|
-
constructor(s, t, i, n,
|
|
992
|
+
constructor(s, t, i, n, r, a) {
|
|
978
993
|
super(
|
|
979
994
|
s,
|
|
980
995
|
t,
|
|
981
|
-
i.map((c) => c ?? {},
|
|
996
|
+
i.map((c) => c ?? {}, a),
|
|
982
997
|
n,
|
|
983
|
-
|
|
984
|
-
|
|
998
|
+
r,
|
|
999
|
+
a
|
|
985
1000
|
), this.#o = this.touched.on(() => {
|
|
986
1001
|
this.#c();
|
|
987
1002
|
}), this.#u = this.dirty.on(() => {
|
|
988
|
-
this.#
|
|
1003
|
+
this.#a();
|
|
989
1004
|
});
|
|
990
|
-
const l = this.signal.on(() => this.#
|
|
1005
|
+
const l = this.signal.on(() => this.#a());
|
|
991
1006
|
this.onDispose(() => {
|
|
992
1007
|
for (const c of this.#e.values())
|
|
993
1008
|
c.dispose();
|
|
@@ -995,22 +1010,22 @@ class be extends O {
|
|
|
995
1010
|
for (const c of this.#s.values()) c();
|
|
996
1011
|
this.#s.clear(), this.#t.clear(), this.#n.dispose();
|
|
997
1012
|
for (const c of this.#i.values()) c();
|
|
998
|
-
this.#i.clear(), this.#
|
|
1013
|
+
this.#i.clear(), this.#r.clear(), this.#l.dispose(), this.#o(), this.#u(), l();
|
|
999
1014
|
});
|
|
1000
1015
|
}
|
|
1001
1016
|
field = (s) => {
|
|
1002
1017
|
if (this.#e.has(s))
|
|
1003
1018
|
return this.#e.get(s);
|
|
1004
|
-
const t = async (
|
|
1019
|
+
const t = async (a) => {
|
|
1005
1020
|
this.change({
|
|
1006
1021
|
...this.signal.value,
|
|
1007
|
-
[s]:
|
|
1022
|
+
[s]: a
|
|
1008
1023
|
});
|
|
1009
|
-
}, i = new
|
|
1024
|
+
}, i = new M(
|
|
1010
1025
|
[...this.path, s],
|
|
1011
1026
|
t,
|
|
1012
|
-
this.signal.map((
|
|
1013
|
-
this.status.map(
|
|
1027
|
+
this.signal.map((a) => a[s]),
|
|
1028
|
+
this.status.map(L([s])),
|
|
1014
1029
|
{
|
|
1015
1030
|
disabled: this.disabled,
|
|
1016
1031
|
// propagate validationMode to children if present
|
|
@@ -1018,14 +1033,14 @@ class be extends O {
|
|
|
1018
1033
|
}
|
|
1019
1034
|
);
|
|
1020
1035
|
this.#e.set(s, i);
|
|
1021
|
-
const n = i.touched.on((
|
|
1022
|
-
this.#t.set(s,
|
|
1036
|
+
const n = i.touched.on((a) => {
|
|
1037
|
+
this.#t.set(s, a), this.#c();
|
|
1023
1038
|
});
|
|
1024
1039
|
this.#s.set(s, n);
|
|
1025
|
-
const
|
|
1026
|
-
this.#
|
|
1040
|
+
const r = i.dirty.on((a) => {
|
|
1041
|
+
this.#r.set(s, a), this.#a();
|
|
1027
1042
|
});
|
|
1028
|
-
return this.#i.set(s,
|
|
1043
|
+
return this.#i.set(s, r), i;
|
|
1029
1044
|
};
|
|
1030
1045
|
markAllTouched = () => {
|
|
1031
1046
|
this.markTouched();
|
|
@@ -1043,9 +1058,9 @@ class be extends O {
|
|
|
1043
1058
|
for (const t of this.#e.values())
|
|
1044
1059
|
t.markPristine?.();
|
|
1045
1060
|
};
|
|
1046
|
-
#
|
|
1061
|
+
#a = () => {
|
|
1047
1062
|
let s = !1;
|
|
1048
|
-
for (const t of this.#
|
|
1063
|
+
for (const t of this.#r.values())
|
|
1049
1064
|
if (t) {
|
|
1050
1065
|
s = !0;
|
|
1051
1066
|
break;
|
|
@@ -1053,16 +1068,16 @@ class be extends O {
|
|
|
1053
1068
|
this.#l.set(this.dirty.value || s);
|
|
1054
1069
|
};
|
|
1055
1070
|
}
|
|
1056
|
-
class
|
|
1071
|
+
class ve extends M {
|
|
1057
1072
|
#e = new Array();
|
|
1058
1073
|
length;
|
|
1059
1074
|
#t = /* @__PURE__ */ new Map();
|
|
1060
1075
|
#s = /* @__PURE__ */ new Map();
|
|
1061
|
-
#n =
|
|
1076
|
+
#n = T(!1);
|
|
1062
1077
|
touchedDeep = this.#n;
|
|
1063
|
-
#
|
|
1078
|
+
#r = /* @__PURE__ */ new Map();
|
|
1064
1079
|
#i = /* @__PURE__ */ new Map();
|
|
1065
|
-
#l =
|
|
1080
|
+
#l = T(!1);
|
|
1066
1081
|
dirtyDeep = this.#l;
|
|
1067
1082
|
#o;
|
|
1068
1083
|
#u;
|
|
@@ -1075,22 +1090,22 @@ class me extends O {
|
|
|
1075
1090
|
}
|
|
1076
1091
|
this.#n.set(this.touched.value || s);
|
|
1077
1092
|
};
|
|
1078
|
-
constructor(s, t, i, n,
|
|
1079
|
-
const l = i.map((u) => u ?? [],
|
|
1080
|
-
super(s, t, l, n,
|
|
1093
|
+
constructor(s, t, i, n, r, a) {
|
|
1094
|
+
const l = i.map((u) => u ?? [], a);
|
|
1095
|
+
super(s, t, l, n, r, a);
|
|
1081
1096
|
const c = l.on((u) => {
|
|
1082
1097
|
const g = this.#e.length - u.length;
|
|
1083
|
-
g > 0 && (this.#e.splice(u.length, g).forEach((
|
|
1084
|
-
const
|
|
1085
|
-
|
|
1086
|
-
}), this.#c(), this.#
|
|
1098
|
+
g > 0 && (this.#e.splice(u.length, g).forEach((S, v) => {
|
|
1099
|
+
const d = u.length + v;
|
|
1100
|
+
S.dispose(), this.#s.get(d)?.(), this.#s.delete(d), this.#t.delete(d), this.#i.get(d)?.(), this.#i.delete(d), this.#r.delete(d);
|
|
1101
|
+
}), this.#c(), this.#a());
|
|
1087
1102
|
});
|
|
1088
1103
|
this.length = l.map((u) => u.length), this.#o = this.touched.on(() => {
|
|
1089
1104
|
this.#c();
|
|
1090
1105
|
}), this.#u = this.dirty.on(() => {
|
|
1091
|
-
this.#
|
|
1106
|
+
this.#a();
|
|
1092
1107
|
});
|
|
1093
|
-
const
|
|
1108
|
+
const p = this.signal.on(() => this.#a());
|
|
1094
1109
|
this.onDispose(() => {
|
|
1095
1110
|
for (const u of this.#e)
|
|
1096
1111
|
u.dispose();
|
|
@@ -1098,34 +1113,34 @@ class me extends O {
|
|
|
1098
1113
|
for (const u of this.#s.values()) u();
|
|
1099
1114
|
this.#s.clear(), this.#t.clear(), this.#n.dispose();
|
|
1100
1115
|
for (const u of this.#i.values()) u();
|
|
1101
|
-
this.#i.clear(), this.#
|
|
1116
|
+
this.#i.clear(), this.#r.clear(), this.#l.dispose(), this.#o(), this.#u(), p();
|
|
1102
1117
|
});
|
|
1103
1118
|
}
|
|
1104
1119
|
item = (s) => {
|
|
1105
1120
|
if (this.#e[s])
|
|
1106
1121
|
return this.#e[s];
|
|
1107
|
-
const t = async (
|
|
1122
|
+
const t = async (a) => {
|
|
1108
1123
|
const l = this.signal.value.slice();
|
|
1109
|
-
l[s] =
|
|
1110
|
-
}, i = new
|
|
1124
|
+
l[s] = a, this.change(l);
|
|
1125
|
+
}, i = new M(
|
|
1111
1126
|
[...this.path, s],
|
|
1112
1127
|
t,
|
|
1113
|
-
this.signal.map((
|
|
1114
|
-
this.status.map(
|
|
1128
|
+
this.signal.map((a) => a[s]),
|
|
1129
|
+
this.status.map(L([s])),
|
|
1115
1130
|
{
|
|
1116
1131
|
disabled: this.disabled,
|
|
1117
1132
|
validationMode: this.parent.validationMode
|
|
1118
1133
|
}
|
|
1119
1134
|
);
|
|
1120
1135
|
this.#e[s] = i;
|
|
1121
|
-
const n = i.touched.on((
|
|
1122
|
-
this.#t.set(s,
|
|
1136
|
+
const n = i.touched.on((a) => {
|
|
1137
|
+
this.#t.set(s, a), this.#c();
|
|
1123
1138
|
});
|
|
1124
1139
|
this.#s.set(s, n);
|
|
1125
|
-
const
|
|
1126
|
-
this.#
|
|
1140
|
+
const r = i.dirty.on((a) => {
|
|
1141
|
+
this.#r.set(s, a), this.#a();
|
|
1127
1142
|
});
|
|
1128
|
-
return this.#i.set(s,
|
|
1143
|
+
return this.#i.set(s, r), i;
|
|
1129
1144
|
};
|
|
1130
1145
|
push = (...s) => {
|
|
1131
1146
|
this.change([...this.signal.value, ...s]);
|
|
@@ -1148,8 +1163,8 @@ class me extends O {
|
|
|
1148
1163
|
};
|
|
1149
1164
|
move = (s, t, i = 1) => {
|
|
1150
1165
|
if (i < 1 || s === t) return;
|
|
1151
|
-
const n = this.signal.value.slice(),
|
|
1152
|
-
n.splice(t, 0, ...
|
|
1166
|
+
const n = this.signal.value.slice(), r = n.splice(s, i);
|
|
1167
|
+
n.splice(t, 0, ...r), this.change(n);
|
|
1153
1168
|
};
|
|
1154
1169
|
markAllTouched = () => {
|
|
1155
1170
|
this.markTouched();
|
|
@@ -1163,9 +1178,9 @@ class me extends O {
|
|
|
1163
1178
|
for (let t = 0; t < s; t++)
|
|
1164
1179
|
this.item(t).markPristine?.();
|
|
1165
1180
|
};
|
|
1166
|
-
#
|
|
1181
|
+
#a = () => {
|
|
1167
1182
|
let s = !1;
|
|
1168
|
-
for (const t of this.#
|
|
1183
|
+
for (const t of this.#r.values())
|
|
1169
1184
|
if (t) {
|
|
1170
1185
|
s = !0;
|
|
1171
1186
|
break;
|
|
@@ -1173,7 +1188,7 @@ class me extends O {
|
|
|
1173
1188
|
this.#l.set(this.dirty.value || s);
|
|
1174
1189
|
};
|
|
1175
1190
|
}
|
|
1176
|
-
function
|
|
1191
|
+
function ye(e) {
|
|
1177
1192
|
function s(t) {
|
|
1178
1193
|
return typeof t == "number" ? t : t.toString();
|
|
1179
1194
|
}
|
|
@@ -1181,13 +1196,13 @@ function ge(e) {
|
|
|
1181
1196
|
(t) => typeof t == "object" && t.key != null ? s(t.key) : s(t)
|
|
1182
1197
|
);
|
|
1183
1198
|
}
|
|
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
|
|
1199
|
+
function ke(e) {
|
|
1200
|
+
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, r) => {
|
|
1201
|
+
const a = ye(r.path), l = a.pop();
|
|
1187
1202
|
let c = n;
|
|
1188
|
-
for (const
|
|
1189
|
-
c.dependencies == null && (c.dependencies = {}), c.dependencies[
|
|
1190
|
-
return c.dependencies == null && (c.dependencies = {}), c.dependencies[l] = { message:
|
|
1203
|
+
for (const p of a)
|
|
1204
|
+
c.dependencies == null && (c.dependencies = {}), c.dependencies[p] == null && (c.dependencies[p] = {}), c = c.dependencies[p];
|
|
1205
|
+
return c.dependencies == null && (c.dependencies = {}), c.dependencies[l] = { message: r.message }, n;
|
|
1191
1206
|
}, {}), i = s.join(`
|
|
1192
1207
|
`);
|
|
1193
1208
|
return {
|
|
@@ -1195,76 +1210,76 @@ function ve(e) {
|
|
|
1195
1210
|
message: i != "" ? i : void 0
|
|
1196
1211
|
};
|
|
1197
1212
|
}
|
|
1198
|
-
function
|
|
1213
|
+
function we({
|
|
1199
1214
|
initialValue: e,
|
|
1200
1215
|
onChange: s,
|
|
1201
1216
|
validate: t,
|
|
1202
1217
|
equals: i,
|
|
1203
1218
|
validationMode: n,
|
|
1204
|
-
validateDebounceMs:
|
|
1219
|
+
validateDebounceMs: r
|
|
1205
1220
|
}) {
|
|
1206
|
-
const
|
|
1207
|
-
l.set(
|
|
1221
|
+
const a = C.deriveProp(e), l = T(D.valid), c = T(!1), p = T(n ?? "touchedOrSubmit"), u = (h) => {
|
|
1222
|
+
l.set(h);
|
|
1208
1223
|
};
|
|
1209
1224
|
let g;
|
|
1210
|
-
const
|
|
1225
|
+
const S = async (h) => {
|
|
1211
1226
|
if (t != null) {
|
|
1212
|
-
const
|
|
1213
|
-
u(
|
|
1227
|
+
const f = await t(h);
|
|
1228
|
+
u(f);
|
|
1214
1229
|
}
|
|
1215
|
-
}, v = async (
|
|
1216
|
-
|
|
1217
|
-
const
|
|
1230
|
+
}, v = async (h) => {
|
|
1231
|
+
a.set(h), s?.(h);
|
|
1232
|
+
const f = p.value;
|
|
1218
1233
|
if (t != null) {
|
|
1219
|
-
if (
|
|
1234
|
+
if (f === "onSubmit")
|
|
1220
1235
|
return;
|
|
1221
|
-
const E =
|
|
1236
|
+
const E = r ?? 0;
|
|
1222
1237
|
E > 0 ? (g && clearTimeout(g), g = setTimeout(() => {
|
|
1223
|
-
|
|
1224
|
-
}, E)) : await
|
|
1238
|
+
S(h);
|
|
1239
|
+
}, E)) : await S(h);
|
|
1225
1240
|
}
|
|
1226
|
-
},
|
|
1241
|
+
}, d = new M(
|
|
1227
1242
|
[],
|
|
1228
1243
|
v,
|
|
1229
|
-
|
|
1244
|
+
a,
|
|
1230
1245
|
l,
|
|
1231
1246
|
{
|
|
1232
1247
|
disabled: c,
|
|
1233
|
-
validationMode:
|
|
1248
|
+
validationMode: p
|
|
1234
1249
|
},
|
|
1235
|
-
i ??
|
|
1250
|
+
i ?? F
|
|
1236
1251
|
);
|
|
1237
|
-
return
|
|
1238
|
-
c.dispose(),
|
|
1239
|
-
}), { controller:
|
|
1252
|
+
return d.onDispose(() => {
|
|
1253
|
+
c.dispose(), a.dispose(), l.dispose(), p.dispose(), g && clearTimeout(g);
|
|
1254
|
+
}), { controller: d, setStatus: u };
|
|
1240
1255
|
}
|
|
1241
|
-
function
|
|
1242
|
-
return
|
|
1256
|
+
function Z(e) {
|
|
1257
|
+
return B(o.disabled(e.disabled), o.name(e.name));
|
|
1243
1258
|
}
|
|
1244
|
-
function
|
|
1259
|
+
function Pe(e, {
|
|
1245
1260
|
triggerOn: s = "change"
|
|
1246
1261
|
} = {}) {
|
|
1247
|
-
return
|
|
1248
|
-
|
|
1262
|
+
return B(
|
|
1263
|
+
Z(e),
|
|
1249
1264
|
o.value(e.signal),
|
|
1250
|
-
(s === "input" ?
|
|
1265
|
+
(s === "input" ? I.input : I.change)($(e.change))
|
|
1251
1266
|
);
|
|
1252
1267
|
}
|
|
1253
|
-
function
|
|
1268
|
+
function Be(e, {
|
|
1254
1269
|
triggerOn: s = "change"
|
|
1255
1270
|
} = {}) {
|
|
1256
|
-
return
|
|
1257
|
-
|
|
1271
|
+
return B(
|
|
1272
|
+
Z(e),
|
|
1258
1273
|
o.valueAsNumber(e.signal),
|
|
1259
|
-
(s === "input" ?
|
|
1260
|
-
|
|
1274
|
+
(s === "input" ? I.input : I.change)(
|
|
1275
|
+
te(e.change)
|
|
1261
1276
|
)
|
|
1262
1277
|
);
|
|
1263
1278
|
}
|
|
1264
|
-
function
|
|
1265
|
-
return e.issues != null ?
|
|
1279
|
+
function K(e) {
|
|
1280
|
+
return e.issues != null ? D.invalid(ke(e.issues)) : D.valid;
|
|
1266
1281
|
}
|
|
1267
|
-
async function
|
|
1282
|
+
async function Ne({
|
|
1268
1283
|
task: e,
|
|
1269
1284
|
errorMessage: s,
|
|
1270
1285
|
errorPath: t = ["root"],
|
|
@@ -1272,17 +1287,17 @@ async function Pe({
|
|
|
1272
1287
|
}) {
|
|
1273
1288
|
try {
|
|
1274
1289
|
const n = await e();
|
|
1275
|
-
return i != null ? i(n) :
|
|
1290
|
+
return i != null ? i(n) : D.valid;
|
|
1276
1291
|
} catch (n) {
|
|
1277
|
-
const
|
|
1278
|
-
return t.length === 1 && t[0] === "root" ?
|
|
1279
|
-
message:
|
|
1280
|
-
}) :
|
|
1281
|
-
dependencies:
|
|
1292
|
+
const r = s ?? (n instanceof Error ? n.message : "Operation failed");
|
|
1293
|
+
return t.length === 1 && t[0] === "root" ? D.invalid({
|
|
1294
|
+
message: r
|
|
1295
|
+
}) : D.invalid({
|
|
1296
|
+
dependencies: ee(t, r)
|
|
1282
1297
|
});
|
|
1283
1298
|
}
|
|
1284
1299
|
}
|
|
1285
|
-
function
|
|
1300
|
+
function ee(e, s) {
|
|
1286
1301
|
if (e.length === 1)
|
|
1287
1302
|
return {
|
|
1288
1303
|
[e[0]]: { message: s }
|
|
@@ -1290,45 +1305,45 @@ function X(e, s) {
|
|
|
1290
1305
|
const [t, ...i] = e;
|
|
1291
1306
|
return {
|
|
1292
1307
|
[t]: {
|
|
1293
|
-
dependencies:
|
|
1308
|
+
dependencies: ee(i, s)
|
|
1294
1309
|
}
|
|
1295
1310
|
};
|
|
1296
1311
|
}
|
|
1297
|
-
function
|
|
1312
|
+
function Le({
|
|
1298
1313
|
initialValue: e = {},
|
|
1299
1314
|
schema: s,
|
|
1300
|
-
onSubmit: t = async () =>
|
|
1315
|
+
onSubmit: t = async () => D.valid,
|
|
1301
1316
|
validationMode: i,
|
|
1302
1317
|
validateDebounceMs: n
|
|
1303
1318
|
}) {
|
|
1304
|
-
const { controller:
|
|
1319
|
+
const { controller: r, setStatus: a } = we({
|
|
1305
1320
|
initialValue: e,
|
|
1306
1321
|
validationMode: i ?? "touchedOrSubmit",
|
|
1307
1322
|
validateDebounceMs: n,
|
|
1308
|
-
validate: (i ?? "touchedOrSubmit") === "onSubmit" ? void 0 : async (u) =>
|
|
1323
|
+
validate: (i ?? "touchedOrSubmit") === "onSubmit" ? void 0 : async (u) => K(
|
|
1309
1324
|
await s["~standard"].validate(u)
|
|
1310
1325
|
)
|
|
1311
|
-
}), l =
|
|
1326
|
+
}), l = T(!1), c = r.object();
|
|
1312
1327
|
return c.onDispose(l.dispose), {
|
|
1313
1328
|
controller: c,
|
|
1314
|
-
setStatus:
|
|
1329
|
+
setStatus: a,
|
|
1315
1330
|
submit: async (u) => {
|
|
1316
1331
|
if (l.set(!0), u?.preventDefault(), c.markAllTouched(), (i ?? "touchedOrSubmit") === "onSubmit") {
|
|
1317
|
-
const
|
|
1318
|
-
await s["~standard"].validate(
|
|
1332
|
+
const S = c.signal.value, v = K(
|
|
1333
|
+
await s["~standard"].validate(S)
|
|
1319
1334
|
);
|
|
1320
|
-
if (
|
|
1335
|
+
if (a(v), v.type === "invalid") {
|
|
1321
1336
|
l.set(!1);
|
|
1322
1337
|
return;
|
|
1323
1338
|
}
|
|
1324
1339
|
}
|
|
1325
1340
|
const g = await t(c.signal.value);
|
|
1326
|
-
l.set(!1), g.type === "invalid" &&
|
|
1341
|
+
l.set(!1), g.type === "invalid" && a(g);
|
|
1327
1342
|
},
|
|
1328
1343
|
submitting: l
|
|
1329
1344
|
};
|
|
1330
1345
|
}
|
|
1331
|
-
function
|
|
1346
|
+
function Se(e) {
|
|
1332
1347
|
switch (e) {
|
|
1333
1348
|
case "success":
|
|
1334
1349
|
return "material-symbols:check-circle-outline";
|
|
@@ -1341,7 +1356,7 @@ function ke(e) {
|
|
|
1341
1356
|
return "material-symbols:info-outline";
|
|
1342
1357
|
}
|
|
1343
1358
|
}
|
|
1344
|
-
function
|
|
1359
|
+
function Ce(e) {
|
|
1345
1360
|
switch (e) {
|
|
1346
1361
|
case "success":
|
|
1347
1362
|
return "success";
|
|
@@ -1354,7 +1369,7 @@ function we(e) {
|
|
|
1354
1369
|
return "info";
|
|
1355
1370
|
}
|
|
1356
1371
|
}
|
|
1357
|
-
function
|
|
1372
|
+
function _e(e, s, t, i) {
|
|
1358
1373
|
const n = [
|
|
1359
1374
|
"bc-notice",
|
|
1360
1375
|
`bc-notice--${e}`,
|
|
@@ -1362,106 +1377,106 @@ function Se(e, s, t, i) {
|
|
|
1362
1377
|
];
|
|
1363
1378
|
return t && n.push("bc-notice--dismissible"), i && i.length > 0 && n.push(i), n.join(" ");
|
|
1364
1379
|
}
|
|
1365
|
-
function
|
|
1380
|
+
function je({
|
|
1366
1381
|
variant: e = "info",
|
|
1367
1382
|
tone: s = "subtle",
|
|
1368
1383
|
role: t,
|
|
1369
1384
|
title: i,
|
|
1370
1385
|
icon: n,
|
|
1371
|
-
closable:
|
|
1372
|
-
onDismiss:
|
|
1386
|
+
closable: r = !1,
|
|
1387
|
+
onDismiss: a,
|
|
1373
1388
|
class: l
|
|
1374
1389
|
}, ...c) {
|
|
1375
|
-
const
|
|
1376
|
-
|
|
1377
|
-
(
|
|
1378
|
-
), u = C.map(e, (
|
|
1390
|
+
const p = C.map(
|
|
1391
|
+
r,
|
|
1392
|
+
(h) => !!h || a != null
|
|
1393
|
+
), u = C.map(e, (h) => h ?? "info"), g = C.map(s, (h) => h ?? "subtle"), S = w(
|
|
1379
1394
|
t,
|
|
1380
1395
|
u
|
|
1381
1396
|
)(
|
|
1382
|
-
(
|
|
1383
|
-
), v =
|
|
1384
|
-
|
|
1385
|
-
(
|
|
1397
|
+
(h, f) => h ?? (f === "danger" ? "alert" : "status")
|
|
1398
|
+
), v = T(!0), d = j(
|
|
1399
|
+
q,
|
|
1400
|
+
(h) => b.div(
|
|
1386
1401
|
o.class(
|
|
1387
|
-
|
|
1402
|
+
w(
|
|
1388
1403
|
u,
|
|
1389
1404
|
g,
|
|
1390
|
-
|
|
1405
|
+
p,
|
|
1391
1406
|
l
|
|
1392
|
-
)((
|
|
1407
|
+
)((f, E, A, x) => _e(f, E, A, x))
|
|
1393
1408
|
),
|
|
1394
1409
|
// Accessibility role mapping (always defined)
|
|
1395
|
-
o.role(C.map(
|
|
1396
|
-
|
|
1397
|
-
C.map(n, (
|
|
1410
|
+
o.role(C.map(S, (f) => f)),
|
|
1411
|
+
ne(
|
|
1412
|
+
C.map(n, (f) => f === !1),
|
|
1398
1413
|
() => b.div(
|
|
1399
1414
|
o.class("bc-notice__icon"),
|
|
1400
|
-
|
|
1401
|
-
icon:
|
|
1415
|
+
N({
|
|
1416
|
+
icon: w(
|
|
1402
1417
|
n,
|
|
1403
1418
|
u
|
|
1404
|
-
)((
|
|
1419
|
+
)((f, E) => f === void 0 ? Se(E) : String(f)),
|
|
1405
1420
|
size: "md",
|
|
1406
|
-
color: C.map(u,
|
|
1421
|
+
color: C.map(u, Ce)
|
|
1407
1422
|
})
|
|
1408
1423
|
)
|
|
1409
1424
|
),
|
|
1410
1425
|
b.div(
|
|
1411
1426
|
o.class("bc-notice__body"),
|
|
1412
|
-
|
|
1427
|
+
ie(i, (f) => b.div(o.class("bc-notice__title"), f)),
|
|
1413
1428
|
b.div(o.class("bc-notice__content"), ...c)
|
|
1414
1429
|
),
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
() =>
|
|
1430
|
+
O(
|
|
1431
|
+
p,
|
|
1432
|
+
() => ae({
|
|
1418
1433
|
size: "xs",
|
|
1419
|
-
label:
|
|
1434
|
+
label: h.$.closeModal,
|
|
1420
1435
|
onClick: () => {
|
|
1421
|
-
v.set(!1),
|
|
1436
|
+
v.set(!1), a?.();
|
|
1422
1437
|
}
|
|
1423
1438
|
})
|
|
1424
1439
|
)
|
|
1425
1440
|
)
|
|
1426
1441
|
);
|
|
1427
|
-
return
|
|
1442
|
+
return O(v, () => d);
|
|
1428
1443
|
}
|
|
1429
1444
|
export {
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1445
|
+
ve as A,
|
|
1446
|
+
Y as B,
|
|
1447
|
+
ae as C,
|
|
1448
|
+
Te as D,
|
|
1449
|
+
Oe as E,
|
|
1450
|
+
X as I,
|
|
1451
|
+
le as L,
|
|
1452
|
+
xe as M,
|
|
1453
|
+
je as N,
|
|
1454
|
+
F as O,
|
|
1455
|
+
Me as P,
|
|
1456
|
+
oe as R,
|
|
1457
|
+
Ve as S,
|
|
1458
|
+
D as a,
|
|
1459
|
+
Ae as b,
|
|
1460
|
+
$e as c,
|
|
1461
|
+
pe as d,
|
|
1462
|
+
M as e,
|
|
1463
|
+
L as f,
|
|
1464
|
+
fe as g,
|
|
1465
|
+
me as h,
|
|
1466
|
+
ge as i,
|
|
1467
|
+
ye as j,
|
|
1468
|
+
ke as k,
|
|
1469
|
+
we as l,
|
|
1470
|
+
de as m,
|
|
1471
|
+
Z as n,
|
|
1472
|
+
Pe as o,
|
|
1473
|
+
Fe as p,
|
|
1474
|
+
Be as q,
|
|
1475
|
+
K as r,
|
|
1476
|
+
Q as s,
|
|
1477
|
+
Ne as t,
|
|
1478
|
+
Le as u,
|
|
1479
|
+
Ie as v,
|
|
1480
|
+
be as w,
|
|
1481
|
+
ce as x
|
|
1467
1482
|
};
|