@tempots/beatui 0.53.0 → 0.54.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{2019-BiSy3dQP.cjs → 2019-5RIscTOv.cjs} +1 -1
- package/dist/{2019-Djx2f_nO.js → 2019-i1LHsYdK.js} +2 -2
- package/dist/{2020-BgJxYgaO.cjs → 2020-DeCezjWf.cjs} +1 -1
- package/dist/{2020-C1wOj1GM.js → 2020-S7qY95wq.js} +2 -2
- package/dist/{ar-BEbbig_x.cjs → ar-BqnDsD9v.cjs} +1 -1
- package/dist/{ar-Djuleurf.js → ar-DrBp_VwJ.js} +7 -12
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +353 -360
- package/dist/{de-E8u7Hbc0.js → de-B5oZoraI.js} +5 -10
- package/dist/{de-Br3MCGtv.cjs → de-C_N0wtxQ.cjs} +1 -1
- package/dist/{es-BN0iaBgJ.js → es-DRc5dc_G.js} +1 -6
- package/dist/{es-CAwGEj_N.cjs → es-JnLMDtzg.cjs} +1 -1
- package/dist/{fa-3Qfo8ZXh.js → fa-B0VDVs5B.js} +6 -11
- package/dist/{fa-CEz8tGnY.cjs → fa-BC16IdRL.cjs} +1 -1
- package/dist/{fr-Dbn62iEL.cjs → fr-BupZ6YnU.cjs} +1 -1
- package/dist/{fr-D1ndk0A5.js → fr-DXlfWwI6.js} +8 -13
- package/dist/{he-CIV7rntE.js → he-BX-Az8As.js} +8 -13
- package/dist/{he-OtaTg9wg.cjs → he-C-aQ2yoO.cjs} +1 -1
- package/dist/{hi-CnbarThz.cjs → hi-L3y3Aedb.cjs} +1 -1
- package/dist/{hi-tzWREPMb.js → hi-w4uL7LN1.js} +8 -13
- package/dist/{index-nRXzduHm.cjs → index-B7gVxeO9.cjs} +1 -1
- package/dist/{index-CBT2SLat.js → index-BI5w0jSz.js} +223 -224
- package/dist/{index-B9y4N11q.js → index-BnQvOXw8.js} +3019 -3004
- package/dist/{index-ClFVnBUS.cjs → index-Bv2gn_kV.cjs} +3 -3
- package/dist/{index-BjQW8AsK.cjs → index-CFOxIBGJ.cjs} +12 -12
- package/dist/{index-KPHFBjQB.cjs → index-CKyH3jwP.cjs} +1 -1
- package/dist/{index-TiMfhF1U.cjs → index-C_71zSeN.cjs} +1 -1
- package/dist/index-CkNcU-jd.cjs +8 -0
- package/dist/{index-qWS4IYZX.js → index-CyoxPiTg.js} +1 -1
- package/dist/{index-UMbs0jPr.js → index-DKwuTFYj.js} +377 -378
- package/dist/{index-DDhLWdaz.js → index-DNUXf4K4.js} +1 -1
- package/dist/{index-CAeOFdez.js → index-DjShJtXp.js} +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +2413 -2522
- package/dist/{it-1Hy_Ay2j.js → it-BCKQ5Tu8.js} +6 -11
- package/dist/{it-FOaX_rku.cjs → it-CnHaoq-X.cjs} +1 -1
- package/dist/{ja-C7_PK2VE.js → ja-DC47Nkza.js} +13 -18
- package/dist/{ja-DW4_3EWp.cjs → ja-DpDF4IgX.cjs} +1 -1
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +1 -1
- package/dist/{ko-C-jXKweM.cjs → ko-BMmVJHzm.cjs} +1 -1
- package/dist/{ko-BDOp6dFE.js → ko-ejUHA0Sw.js} +8 -13
- package/dist/markdown/index.cjs.js +1 -1
- package/dist/markdown/index.es.js +1 -1
- package/dist/{modal-BBaPJhi-.js → modal-CKyUdeEz.js} +54 -58
- package/dist/modal-rou7pM0r.cjs +1 -0
- package/dist/{nl-CF5W2Rt4.js → nl-WjgpPUel.js} +6 -11
- package/dist/{nl-Ui8TT45t.cjs → nl-viDlnQWK.cjs} +1 -1
- package/dist/{notice-DTTyRbwh.js → notice-BS0d903Q.js} +385 -387
- package/dist/notice-MF7whf3_.cjs +2 -0
- package/dist/{pl-oLzT5Ole.js → pl-Cw4CYjK_.js} +3 -8
- package/dist/{pl-8PM7rn2L.cjs → pl-Vrfv_fGt.cjs} +1 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/{pt-Bb0T3Cx1.js → pt-B4Rh_ZBF.js} +10 -15
- package/dist/{pt-kRRsG9-4.cjs → pt-CxQV74vS.cjs} +1 -1
- package/dist/{ru-C5AMF9a6.cjs → ru-BB3GRr_J.cjs} +1 -1
- package/dist/{ru-DwLv1myc.js → ru-DFHsLJ9b.js} +14 -19
- package/dist/{toolbar-D_LSJCtv.js → toolbar-D2J_NkKD.js} +1 -1
- package/dist/{toolbar-D6_MB1QI.cjs → toolbar-DRdm9W7H.cjs} +1 -1
- package/dist/{tr-DBQNjaPN.js → tr-Dbktyawl.js} +7 -12
- package/dist/{tr-BwgU2BAj.cjs → tr-mBiHcEl1.cjs} +1 -1
- package/dist/{translations-CG5-f9U8.js → translations-CaTkLRHu.js} +85 -93
- package/dist/{translations-t57jdjWu.js → translations-CpTeFtvW.js} +1 -1
- package/dist/{translations-D77sU1Wl.cjs → translations-ggnrzaCG.cjs} +1 -1
- package/dist/translations-h_OJS1Ut.cjs +1 -0
- package/dist/types/components/data/icon.d.ts +1 -1
- package/dist/types/components/data/page-drop-zone.d.ts +1 -1
- package/dist/types/components/data/unstyled-drop-zone.d.ts +1 -1
- package/dist/types/components/form/input/create-nullable-string-input.d.ts +24 -0
- package/dist/types/components/form/input/create-temporal-input.d.ts +54 -0
- package/dist/types/components/form/input/nullable-email-input.d.ts +1 -2
- package/dist/types/components/form/input/nullable-password-input.d.ts +1 -2
- package/dist/types/components/form/input/nullable-plain-date-input.d.ts +19 -3
- package/dist/types/components/form/input/nullable-plain-date-time-input.d.ts +19 -3
- package/dist/types/components/form/input/nullable-plain-time-input.d.ts +19 -3
- package/dist/types/components/form/input/nullable-plain-year-month-input.d.ts +19 -3
- package/dist/types/components/form/input/nullable-text-area.d.ts +6 -4
- package/dist/types/components/form/input/nullable-text-input.d.ts +3 -4
- package/dist/types/components/form/input/nullable-url-input.d.ts +1 -2
- package/dist/types/components/form/input/nullable-uuid-input.d.ts +1 -2
- package/dist/types/components/form/input/plain-date-input.d.ts +19 -3
- package/dist/types/components/form/input/plain-date-time-input.d.ts +19 -3
- package/dist/types/components/form/input/plain-time-input.d.ts +19 -3
- package/dist/types/components/form/input/plain-year-month-input.d.ts +19 -3
- package/dist/types/components/json-schema/controls/shared-utils.d.ts +8 -0
- package/dist/types/components/json-schema/schema-conditionals.d.ts +26 -0
- package/dist/types/components/json-schema/schema-context.d.ts +4 -107
- package/dist/types/components/json-schema/schema-merge.d.ts +9 -0
- package/dist/types/components/json-schema/schema-types.d.ts +85 -0
- package/dist/{ur-s32jv4mP.cjs → ur-CZ5sgUP1.cjs} +1 -1
- package/dist/{ur-BmK_ieRn.js → ur-Cqh7AYnd.js} +9 -14
- package/dist/utils-U1aNOU3o.cjs +1 -0
- package/dist/utils-w_vUChhV.js +2454 -0
- package/dist/{vi-DK0Fj95H.js → vi-CLBp2oaY.js} +11 -16
- package/dist/{vi-B4qRKlRd.cjs → vi-Ki_Urj_E.cjs} +1 -1
- package/dist/{zh-CUEpc9yf.cjs → zh-C78OkbS0.cjs} +1 -1
- package/dist/{zh-Db8COSme.js → zh-CT4aGkgD.js} +8 -13
- package/package.json +5 -4
- package/dist/index-ClqyVDXY.cjs +0 -8
- package/dist/modal-O7QoP7Zv.cjs +0 -1
- package/dist/notice-DLDzwKkw.cjs +0 -2
- package/dist/translations-BAk3j4bi.cjs +0 -1
- package/dist/utils-CYMdxKSM.js +0 -2516
- package/dist/utils-DI_H4_Gm.cjs +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Use as q, coalesce as Q, aria as
|
|
2
|
-
import { a as z, B as
|
|
1
|
+
import { Use as q, coalesce as Q, aria as x, attr as o, html as f, on as E, Value as C, Empty as _, computedOf as k, When as O, dataAttr as R, input as te, emitValue as F, prop as I, Fragment as P, emitValueAsNumber as ne, Unless as ie, Ensure as re } from "@tempots/dom";
|
|
2
|
+
import { a as z, B as ae, I as N, b as W, c as le, C as X } from "./translations-CaTkLRHu.js";
|
|
3
3
|
const K = /* @__PURE__ */ new Map();
|
|
4
4
|
function H(e) {
|
|
5
5
|
const s = K.get(e) ?? 0;
|
|
6
6
|
return K.set(e, s + 1), `${e}-${s}`;
|
|
7
7
|
}
|
|
8
|
-
const
|
|
8
|
+
const w = {
|
|
9
9
|
/**
|
|
10
10
|
* Creates a loading state.
|
|
11
11
|
* @param previousValue - The previous value.
|
|
@@ -84,7 +84,7 @@ const S = {
|
|
|
84
84
|
* @public
|
|
85
85
|
*/
|
|
86
86
|
getOrElse(e, s) {
|
|
87
|
-
return
|
|
87
|
+
return w.isSuccess(e) ? e.value : s;
|
|
88
88
|
},
|
|
89
89
|
/**
|
|
90
90
|
* Gets the value if the result is a success; otherwise, returns the value from the alternative function.
|
|
@@ -95,7 +95,7 @@ const S = {
|
|
|
95
95
|
* function.
|
|
96
96
|
*/
|
|
97
97
|
getOrElseLazy(e, s) {
|
|
98
|
-
return
|
|
98
|
+
return w.isSuccess(e) ? e.value : s();
|
|
99
99
|
},
|
|
100
100
|
/**
|
|
101
101
|
* Gets the value if the result is a success; otherwise, returns `null`.
|
|
@@ -104,7 +104,7 @@ const S = {
|
|
|
104
104
|
* @public
|
|
105
105
|
*/
|
|
106
106
|
getOrNull(e) {
|
|
107
|
-
return
|
|
107
|
+
return w.isSuccess(e) ? e.value : null;
|
|
108
108
|
},
|
|
109
109
|
/**
|
|
110
110
|
* Gets the value if the result is a success; otherwise, returns `undefined`.
|
|
@@ -113,7 +113,7 @@ const S = {
|
|
|
113
113
|
* @public
|
|
114
114
|
*/
|
|
115
115
|
getOrUndefined(e) {
|
|
116
|
-
return
|
|
116
|
+
return w.isSuccess(e) ? e.value : void 0;
|
|
117
117
|
},
|
|
118
118
|
/**
|
|
119
119
|
* Gets the value of a `AsyncResult` if it is a `Success`, otherwise it throws the error contained in the `Failure`.
|
|
@@ -121,9 +121,9 @@ const S = {
|
|
|
121
121
|
* @returns The value of the `AsyncResult` if it is a `Success`.
|
|
122
122
|
*/
|
|
123
123
|
getUnsafe: (e) => {
|
|
124
|
-
if (
|
|
124
|
+
if (w.isSuccess(e))
|
|
125
125
|
return e.value;
|
|
126
|
-
throw
|
|
126
|
+
throw w.isFailure(e) ? e.error : new Error("Cannot get value from a not-asked or loading result");
|
|
127
127
|
},
|
|
128
128
|
/**
|
|
129
129
|
* Based on the state of the result, it picks the appropriate function to call and returns the result.
|
|
@@ -139,7 +139,7 @@ const S = {
|
|
|
139
139
|
failure: t,
|
|
140
140
|
loading: n,
|
|
141
141
|
notAsked: i = n
|
|
142
|
-
}) =>
|
|
142
|
+
}) => w.isSuccess(e) ? s(e.value) : w.isFailure(e) ? t(e.error) : w.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
|
*
|
|
@@ -148,7 +148,7 @@ const S = {
|
|
|
148
148
|
* @returns The result that was passed in.
|
|
149
149
|
* @public
|
|
150
150
|
*/
|
|
151
|
-
whenSuccess: (e, s) => (
|
|
151
|
+
whenSuccess: (e, s) => (w.isSuccess(e) && s(e.value), e),
|
|
152
152
|
/**
|
|
153
153
|
* When the result is a failure, it applies the function to the error.
|
|
154
154
|
*
|
|
@@ -157,7 +157,7 @@ const S = {
|
|
|
157
157
|
* @returns The result that was passed in.
|
|
158
158
|
* @public
|
|
159
159
|
*/
|
|
160
|
-
whenFailure: (e, s) => (
|
|
160
|
+
whenFailure: (e, s) => (w.isFailure(e) && s(e.error), e),
|
|
161
161
|
/**
|
|
162
162
|
* Compares two results for equality.
|
|
163
163
|
* @param r1 - The first result.
|
|
@@ -177,11 +177,11 @@ const S = {
|
|
|
177
177
|
all: (e) => {
|
|
178
178
|
const s = [];
|
|
179
179
|
for (const t of e)
|
|
180
|
-
if (
|
|
180
|
+
if (w.isSuccess(t))
|
|
181
181
|
s.push(t.value);
|
|
182
182
|
else
|
|
183
183
|
return t;
|
|
184
|
-
return
|
|
184
|
+
return w.success(s);
|
|
185
185
|
},
|
|
186
186
|
/**
|
|
187
187
|
* Converts a Promise to an AsyncResult.
|
|
@@ -191,12 +191,12 @@ const S = {
|
|
|
191
191
|
ofPromise: async (e) => {
|
|
192
192
|
try {
|
|
193
193
|
const s = await e;
|
|
194
|
-
return
|
|
194
|
+
return w.success(s);
|
|
195
195
|
} catch (s) {
|
|
196
|
-
return
|
|
196
|
+
return w.failure(s instanceof Error ? s : new Error(String(s)));
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
},
|
|
199
|
+
}, $ = (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`.
|
|
@@ -308,8 +308,8 @@ const S = {
|
|
|
308
308
|
toAsync(e) {
|
|
309
309
|
return m.match(
|
|
310
310
|
e,
|
|
311
|
-
(s) =>
|
|
312
|
-
(s) =>
|
|
311
|
+
(s) => w.success(s),
|
|
312
|
+
(s) => w.failure(s)
|
|
313
313
|
);
|
|
314
314
|
},
|
|
315
315
|
/**
|
|
@@ -465,9 +465,9 @@ function ce({
|
|
|
465
465
|
onClick: r,
|
|
466
466
|
label: l
|
|
467
467
|
}, ...a) {
|
|
468
|
-
return q(z, (
|
|
469
|
-
const
|
|
470
|
-
return
|
|
468
|
+
return q(z, (c) => {
|
|
469
|
+
const p = Q(l, c.$.closeModal);
|
|
470
|
+
return ae(
|
|
471
471
|
{
|
|
472
472
|
variant: "text",
|
|
473
473
|
size: e,
|
|
@@ -476,17 +476,17 @@ function ce({
|
|
|
476
476
|
color: i,
|
|
477
477
|
onClick: r
|
|
478
478
|
},
|
|
479
|
-
|
|
480
|
-
|
|
479
|
+
o.title(p),
|
|
480
|
+
x.label(p),
|
|
481
481
|
...a,
|
|
482
|
-
|
|
482
|
+
N({ icon: s, size: e ?? "sm" })
|
|
483
483
|
);
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
486
|
function U(e) {
|
|
487
487
|
return `bc-label bc-label--${e}`;
|
|
488
488
|
}
|
|
489
|
-
const
|
|
489
|
+
const Ae = (...e) => f.span(o.class(U("emphasis")), ...e), oe = (...e) => f.span(o.class(U("default")), ...e), ue = (...e) => f.span(o.class(U("muted")), ...e), Ve = (...e) => f.span(o.class(U("danger")), ...e), Oe = (e) => {
|
|
490
490
|
const {
|
|
491
491
|
value: s,
|
|
492
492
|
onBlur: t,
|
|
@@ -495,80 +495,80 @@ const Ve = (...e) => b.span(c.class(U("emphasis")), ...e), ue = (...e) => b.span
|
|
|
495
495
|
disabled: r,
|
|
496
496
|
id: l,
|
|
497
497
|
checkedIcon: a,
|
|
498
|
-
uncheckedIcon:
|
|
499
|
-
iconSize:
|
|
500
|
-
} = e,
|
|
501
|
-
if (
|
|
502
|
-
const
|
|
503
|
-
n?.(!
|
|
504
|
-
}, v = (
|
|
505
|
-
|
|
498
|
+
uncheckedIcon: c,
|
|
499
|
+
iconSize: p = "lg"
|
|
500
|
+
} = e, h = l ?? H("checkbox"), b = `${h}-label`, S = () => {
|
|
501
|
+
if (C.get(r ?? !1)) return;
|
|
502
|
+
const u = C.get(s);
|
|
503
|
+
n?.(!u);
|
|
504
|
+
}, v = (u) => {
|
|
505
|
+
C.get(r ?? !1) || (u.key === " " || u.key === "Enter") && (u.preventDefault(), S());
|
|
506
506
|
};
|
|
507
507
|
return W(
|
|
508
508
|
{
|
|
509
509
|
baseContainer: !0,
|
|
510
510
|
growInput: !1,
|
|
511
511
|
...e,
|
|
512
|
-
input:
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
512
|
+
input: f.span(
|
|
513
|
+
o.class("bc-checkbox-input"),
|
|
514
|
+
f.span(
|
|
515
|
+
o.class("bc-checkbox-input__checkbox"),
|
|
516
|
+
o.class(
|
|
517
|
+
C.map(
|
|
518
518
|
s,
|
|
519
|
-
(
|
|
519
|
+
(u) => u ? "bc-checkbox-input__checkbox--checked" : "bc-checkbox-input__checkbox--unchecked"
|
|
520
520
|
)
|
|
521
521
|
),
|
|
522
|
-
|
|
523
|
-
|
|
522
|
+
o.class(
|
|
523
|
+
C.map(
|
|
524
524
|
r ?? !1,
|
|
525
|
-
(
|
|
525
|
+
(u) => u ? "bc-checkbox-input__checkbox--disabled" : ""
|
|
526
526
|
)
|
|
527
527
|
),
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
528
|
+
o.id(h),
|
|
529
|
+
o.role("checkbox"),
|
|
530
|
+
o.tabindex(
|
|
531
|
+
C.map(
|
|
532
532
|
r ?? !1,
|
|
533
|
-
(
|
|
533
|
+
(u) => u ? -1 : 0
|
|
534
534
|
)
|
|
535
535
|
),
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
i != null ?
|
|
536
|
+
x.checked(s),
|
|
537
|
+
x.disabled(r),
|
|
538
|
+
i != null ? x.labelledby(b) : _,
|
|
539
539
|
E.keydown(v),
|
|
540
540
|
t != null ? E.blur(t) : _,
|
|
541
|
-
|
|
542
|
-
icon:
|
|
541
|
+
N({
|
|
542
|
+
icon: k(
|
|
543
543
|
s,
|
|
544
544
|
a,
|
|
545
|
-
|
|
545
|
+
c
|
|
546
546
|
)(
|
|
547
|
-
(
|
|
547
|
+
(u, d, g) => u ? d ?? "akar-icons/check-box-fill" : g ?? "akar-icons/box"
|
|
548
548
|
),
|
|
549
549
|
accessibility: "decorative",
|
|
550
|
-
size:
|
|
550
|
+
size: p
|
|
551
551
|
})
|
|
552
552
|
),
|
|
553
|
-
i != null ?
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
553
|
+
i != null ? f.label(
|
|
554
|
+
o.class("bc-checkbox-input__label"),
|
|
555
|
+
o.id(b),
|
|
556
|
+
o.for(h),
|
|
557
|
+
ue(i)
|
|
558
558
|
) : _
|
|
559
559
|
)
|
|
560
560
|
},
|
|
561
|
-
E.click(
|
|
561
|
+
E.click(S)
|
|
562
562
|
);
|
|
563
|
-
},
|
|
564
|
-
|
|
563
|
+
}, he = f.span(
|
|
564
|
+
o.class("bc-input-wrapper__required"),
|
|
565
565
|
" *"
|
|
566
566
|
);
|
|
567
|
-
function
|
|
567
|
+
function de(e) {
|
|
568
568
|
const s = ["bc-input-wrapper"];
|
|
569
569
|
return e !== "vertical" && s.push(`bc-input-wrapper--${e}`), s.join(" ");
|
|
570
570
|
}
|
|
571
|
-
function
|
|
571
|
+
function pe(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
|
}
|
|
@@ -576,7 +576,7 @@ function G(e, s) {
|
|
|
576
576
|
if (e === "horizontal-fixed" && s != null)
|
|
577
577
|
return `--input-wrapper-label-width: ${s}`;
|
|
578
578
|
}
|
|
579
|
-
const
|
|
579
|
+
const Y = ({
|
|
580
580
|
fullWidth: e = !1,
|
|
581
581
|
required: s,
|
|
582
582
|
label: t,
|
|
@@ -585,105 +585,104 @@ const Z = ({
|
|
|
585
585
|
description: r,
|
|
586
586
|
content: l,
|
|
587
587
|
error: a,
|
|
588
|
-
labelFor:
|
|
589
|
-
hasError:
|
|
590
|
-
disabled:
|
|
591
|
-
layout:
|
|
592
|
-
labelWidth:
|
|
588
|
+
labelFor: c,
|
|
589
|
+
hasError: p,
|
|
590
|
+
disabled: h,
|
|
591
|
+
layout: b,
|
|
592
|
+
labelWidth: S
|
|
593
593
|
}, ...v) => {
|
|
594
|
-
const
|
|
595
|
-
return
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
y.map(
|
|
594
|
+
const u = p ?? a != null, d = h ?? !1, g = b ?? "vertical", T = H("input-wrapper"), A = r ? `${T}-description` : void 0, B = a != null ? `${T}-error` : void 0, L = k(g)((y) => y !== "vertical");
|
|
595
|
+
return f.div(
|
|
596
|
+
o.class(C.map(g, (y) => de(y))),
|
|
597
|
+
o.class(
|
|
598
|
+
C.map(
|
|
600
599
|
e,
|
|
601
|
-
(
|
|
600
|
+
(y) => y ? "bc-input-wrapper--full-width" : ""
|
|
602
601
|
)
|
|
603
602
|
),
|
|
604
603
|
O(
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
)((
|
|
609
|
-
() =>
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
)((
|
|
615
|
-
(
|
|
604
|
+
k(
|
|
605
|
+
g,
|
|
606
|
+
S ?? void 0
|
|
607
|
+
)((y, V) => G(y, V) != null),
|
|
608
|
+
() => o.style(
|
|
609
|
+
C.map(
|
|
610
|
+
k(
|
|
611
|
+
g,
|
|
612
|
+
S ?? void 0
|
|
613
|
+
)((y, V) => G(y, V)),
|
|
614
|
+
(y) => y
|
|
616
615
|
)
|
|
617
616
|
)
|
|
618
617
|
),
|
|
619
|
-
t != null || i != null ?
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
618
|
+
t != null || i != null ? f.div(
|
|
619
|
+
o.class("bc-input-wrapper__header"),
|
|
620
|
+
f.div(
|
|
621
|
+
o.class("bc-input-wrapper__label-section"),
|
|
622
|
+
f.label(
|
|
623
|
+
o.class("bc-input-wrapper__label"),
|
|
624
|
+
c != null ? o.for(c) : _,
|
|
625
|
+
f.span(
|
|
626
|
+
o.class(
|
|
627
|
+
k(
|
|
628
|
+
u,
|
|
630
629
|
d
|
|
631
630
|
)(
|
|
632
|
-
(
|
|
633
|
-
|
|
631
|
+
(y, V) => pe(
|
|
632
|
+
y ?? !1,
|
|
634
633
|
V ?? !1
|
|
635
634
|
)
|
|
636
635
|
)
|
|
637
636
|
),
|
|
638
637
|
t
|
|
639
638
|
),
|
|
640
|
-
t != null && s ?
|
|
639
|
+
t != null && s ? he : _
|
|
641
640
|
),
|
|
642
641
|
// Show description under label when horizontal
|
|
643
642
|
O(
|
|
644
|
-
|
|
645
|
-
|
|
643
|
+
k(
|
|
644
|
+
L,
|
|
646
645
|
r
|
|
647
|
-
)((
|
|
648
|
-
() =>
|
|
649
|
-
|
|
646
|
+
)((y, V) => y && V != null),
|
|
647
|
+
() => f.div(
|
|
648
|
+
o.class(
|
|
650
649
|
"bc-input-wrapper__description bc-input-wrapper__description--under-label"
|
|
651
650
|
),
|
|
652
|
-
|
|
651
|
+
o.id(A),
|
|
653
652
|
r
|
|
654
653
|
)
|
|
655
654
|
)
|
|
656
655
|
),
|
|
657
|
-
i != null ?
|
|
656
|
+
i != null ? oe(i) : _,
|
|
658
657
|
n
|
|
659
658
|
) : _,
|
|
660
|
-
|
|
661
|
-
|
|
659
|
+
f.div(
|
|
660
|
+
o.class("bc-input-wrapper__content"),
|
|
662
661
|
// Add data attributes to help inputs inherit accessibility information
|
|
663
|
-
[A,
|
|
664
|
-
[A,
|
|
662
|
+
[A, B].filter(Boolean).length > 0 ? R.describedby(
|
|
663
|
+
[A, B].filter(Boolean).join(" ")
|
|
665
664
|
) : _,
|
|
666
665
|
s ? R.required("true") : _,
|
|
667
|
-
O(
|
|
666
|
+
O(u, () => R.invalid("true")),
|
|
668
667
|
l
|
|
669
668
|
),
|
|
670
669
|
// Show description at bottom only when not horizontal
|
|
671
670
|
O(
|
|
672
|
-
|
|
673
|
-
() =>
|
|
674
|
-
|
|
675
|
-
|
|
671
|
+
k(L, r)((y, V) => !y && V != null),
|
|
672
|
+
() => f.div(
|
|
673
|
+
o.class("bc-input-wrapper__description"),
|
|
674
|
+
o.id(A),
|
|
676
675
|
r
|
|
677
676
|
)
|
|
678
677
|
),
|
|
679
678
|
a != null ? O(
|
|
680
|
-
|
|
681
|
-
() =>
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
679
|
+
u,
|
|
680
|
+
() => f.div(
|
|
681
|
+
o.class("bc-input-wrapper__error"),
|
|
682
|
+
o.id(B),
|
|
683
|
+
x.live("polite"),
|
|
685
684
|
// Announce errors to screen readers
|
|
686
|
-
|
|
685
|
+
o.role("alert"),
|
|
687
686
|
// Mark as alert for immediate attention
|
|
688
687
|
a
|
|
689
688
|
)
|
|
@@ -691,10 +690,10 @@ const Z = ({
|
|
|
691
690
|
...v
|
|
692
691
|
);
|
|
693
692
|
};
|
|
694
|
-
function
|
|
695
|
-
return
|
|
693
|
+
function Me(...e) {
|
|
694
|
+
return f.div(o.class("bc-stack"), ...e);
|
|
696
695
|
}
|
|
697
|
-
const
|
|
696
|
+
const Fe = (e) => {
|
|
698
697
|
const s = {
|
|
699
698
|
name: "email",
|
|
700
699
|
autocomplete: "email",
|
|
@@ -706,28 +705,28 @@ const $e = (e) => {
|
|
|
706
705
|
onChange: r,
|
|
707
706
|
onInput: l,
|
|
708
707
|
placeholder: a
|
|
709
|
-
} = s,
|
|
708
|
+
} = s, c = n ?? le({
|
|
710
709
|
icon: "line-md:email",
|
|
711
710
|
size: e.size,
|
|
712
711
|
color: "neutral"
|
|
713
712
|
});
|
|
714
713
|
return q(
|
|
715
714
|
z,
|
|
716
|
-
(
|
|
715
|
+
(p) => W({
|
|
717
716
|
...e,
|
|
718
|
-
before:
|
|
719
|
-
input:
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
i != null ? E.blur(
|
|
725
|
-
r != null ? E.change(
|
|
726
|
-
l != null ? E.input(
|
|
717
|
+
before: c,
|
|
718
|
+
input: te.email(
|
|
719
|
+
X(s),
|
|
720
|
+
o.placeholder(Q(a, p.$.emailPlaceholderText)),
|
|
721
|
+
o.value(t),
|
|
722
|
+
o.class("bc-input"),
|
|
723
|
+
i != null ? E.blur(F(i)) : _,
|
|
724
|
+
r != null ? E.change(F(r)) : _,
|
|
725
|
+
l != null ? E.input(F(l)) : _
|
|
727
726
|
)
|
|
728
727
|
})
|
|
729
728
|
);
|
|
730
|
-
},
|
|
729
|
+
}, $e = (e) => {
|
|
731
730
|
const {
|
|
732
731
|
value: s,
|
|
733
732
|
onBlur: t,
|
|
@@ -736,67 +735,67 @@ const $e = (e) => {
|
|
|
736
735
|
before: r,
|
|
737
736
|
after: l,
|
|
738
737
|
hasError: a,
|
|
739
|
-
disabled:
|
|
740
|
-
autocomplete:
|
|
741
|
-
placeholder:
|
|
742
|
-
...
|
|
743
|
-
} = e,
|
|
738
|
+
disabled: c,
|
|
739
|
+
autocomplete: p,
|
|
740
|
+
placeholder: h,
|
|
741
|
+
...b
|
|
742
|
+
} = e, S = {
|
|
744
743
|
name: "password",
|
|
745
|
-
disabled:
|
|
746
|
-
...
|
|
747
|
-
}, v = I(!0),
|
|
744
|
+
disabled: c,
|
|
745
|
+
...b
|
|
746
|
+
}, v = I(!0), u = k(
|
|
748
747
|
v,
|
|
749
|
-
|
|
750
|
-
)((d,
|
|
748
|
+
p
|
|
749
|
+
)((d, g) => d ? g ?? "current-password" : "off");
|
|
751
750
|
return q(z, (d) => {
|
|
752
|
-
const
|
|
751
|
+
const g = k(
|
|
753
752
|
d.$.passwordPlaceholderText,
|
|
754
753
|
v,
|
|
755
|
-
|
|
756
|
-
)((A,
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
754
|
+
h
|
|
755
|
+
)((A, B, L) => B ? "•••••••••••••••" : L ?? A), T = f.button(
|
|
756
|
+
o.type("button"),
|
|
757
|
+
o.class("bc-input-container__password-toggle"),
|
|
758
|
+
x.label(d.$.togglePasswordVisibility),
|
|
760
759
|
E.click(() => v.update((A) => !A)),
|
|
761
760
|
O(
|
|
762
761
|
v,
|
|
763
|
-
() =>
|
|
764
|
-
() =>
|
|
762
|
+
() => N({ icon: "line-md:watch" }),
|
|
763
|
+
() => N({ icon: "line-md:watch-off" })
|
|
765
764
|
)
|
|
766
765
|
);
|
|
767
766
|
return W({
|
|
768
767
|
before: r,
|
|
769
|
-
disabled:
|
|
768
|
+
disabled: c,
|
|
770
769
|
hasError: a,
|
|
771
|
-
input:
|
|
772
|
-
|
|
773
|
-
...
|
|
774
|
-
autocomplete:
|
|
775
|
-
placeholder:
|
|
770
|
+
input: f.input(
|
|
771
|
+
X({
|
|
772
|
+
...S,
|
|
773
|
+
autocomplete: u,
|
|
774
|
+
placeholder: g
|
|
776
775
|
}),
|
|
777
776
|
O(
|
|
778
777
|
v,
|
|
779
|
-
() =>
|
|
780
|
-
() =>
|
|
778
|
+
() => P(o.type("password")),
|
|
779
|
+
() => P(o.type("text"))
|
|
781
780
|
),
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
t != null ? E.blur(
|
|
785
|
-
n != null ? E.change(
|
|
786
|
-
i != null ? E.input(
|
|
781
|
+
o.class("bc-input"),
|
|
782
|
+
o.value(s),
|
|
783
|
+
t != null ? E.blur(F(t)) : _,
|
|
784
|
+
n != null ? E.change(F(n)) : _,
|
|
785
|
+
i != null ? E.input(F(i)) : _
|
|
787
786
|
),
|
|
788
|
-
after: l != null ?
|
|
787
|
+
after: l != null ? P(T, l) : T
|
|
789
788
|
});
|
|
790
789
|
});
|
|
791
|
-
},
|
|
790
|
+
}, fe = (
|
|
792
791
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
793
792
|
(e, s) => () => {
|
|
794
793
|
e.markTouched(), s?.();
|
|
795
794
|
}
|
|
796
|
-
),
|
|
795
|
+
), be = (e, s) => (t) => {
|
|
797
796
|
e.change(t), s?.(t);
|
|
798
797
|
};
|
|
799
|
-
function
|
|
798
|
+
function Z(e, s) {
|
|
800
799
|
const { controller: t, onBlur: n, onChange: i, id: r, ...l } = s;
|
|
801
800
|
return e({
|
|
802
801
|
id: r ?? t.name,
|
|
@@ -805,17 +804,17 @@ function ee(e, s) {
|
|
|
805
804
|
hasError: t.errorVisible,
|
|
806
805
|
name: t.name,
|
|
807
806
|
...l,
|
|
808
|
-
onChange:
|
|
809
|
-
onBlur:
|
|
807
|
+
onChange: be(t, i),
|
|
808
|
+
onBlur: fe(t, n)
|
|
810
809
|
});
|
|
811
810
|
}
|
|
812
|
-
function
|
|
811
|
+
function xe(e, { id: s, labelFor: t, ...n }, ...i) {
|
|
813
812
|
const r = s ?? n.controller.name ?? H("control");
|
|
814
|
-
return
|
|
813
|
+
return Y(
|
|
815
814
|
{
|
|
816
815
|
...n,
|
|
817
816
|
labelFor: t ?? r,
|
|
818
|
-
content:
|
|
817
|
+
content: Z(
|
|
819
818
|
(a) => e({ ...a, id: r }),
|
|
820
819
|
n
|
|
821
820
|
)
|
|
@@ -823,24 +822,24 @@ function Pe(e, { id: s, labelFor: t, ...n }, ...i) {
|
|
|
823
822
|
...i
|
|
824
823
|
);
|
|
825
824
|
}
|
|
826
|
-
function
|
|
825
|
+
function me(e, s) {
|
|
827
826
|
const { toInput: t, fromInput: n, controller: i, ...r } = s, l = i.transform(t, n);
|
|
828
|
-
return
|
|
827
|
+
return Z(e, {
|
|
829
828
|
...r,
|
|
830
829
|
controller: l
|
|
831
830
|
});
|
|
832
831
|
}
|
|
833
|
-
function
|
|
832
|
+
function Pe(e, {
|
|
834
833
|
id: s,
|
|
835
834
|
labelFor: t,
|
|
836
835
|
...n
|
|
837
836
|
}, ...i) {
|
|
838
837
|
const r = s ?? n.controller.name ?? H("control");
|
|
839
|
-
return
|
|
838
|
+
return Y(
|
|
840
839
|
{
|
|
841
840
|
...n,
|
|
842
841
|
labelFor: t ?? r,
|
|
843
|
-
content:
|
|
842
|
+
content: me(e, {
|
|
844
843
|
...n,
|
|
845
844
|
id: r
|
|
846
845
|
})
|
|
@@ -848,21 +847,21 @@ function Be(e, {
|
|
|
848
847
|
...i
|
|
849
848
|
);
|
|
850
849
|
}
|
|
851
|
-
function
|
|
850
|
+
function Be(e) {
|
|
852
851
|
return e.split(".").map((t) => {
|
|
853
852
|
const n = t.match(/^\[(\d+)\]$/);
|
|
854
853
|
return n ? Number(n[1]) : t;
|
|
855
854
|
});
|
|
856
855
|
}
|
|
857
|
-
function
|
|
856
|
+
function ge(e) {
|
|
858
857
|
return typeof e == "number" ? `[${e}]` : `.${e}`;
|
|
859
858
|
}
|
|
860
|
-
function
|
|
859
|
+
function ve(e) {
|
|
861
860
|
if (e.length === 0) return "";
|
|
862
861
|
const [s, ...t] = e;
|
|
863
862
|
return [
|
|
864
863
|
typeof s == "number" ? `[${s}]` : s,
|
|
865
|
-
...t.map(
|
|
864
|
+
...t.map(ge)
|
|
866
865
|
].join("");
|
|
867
866
|
}
|
|
868
867
|
function j(e) {
|
|
@@ -895,33 +894,33 @@ class M {
|
|
|
895
894
|
disabled;
|
|
896
895
|
#n = [];
|
|
897
896
|
disabledOrHasErrors;
|
|
898
|
-
constructor(s, t, n, i, r, l =
|
|
897
|
+
constructor(s, t, n, i, r, l = $) {
|
|
899
898
|
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
899
|
(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 =
|
|
900
|
+
), this.hasError = this.error.map((a) => a != null), this.touched = this.#e.touched, r.validationMode ? this.errorVisible = k(
|
|
902
901
|
this.hasError,
|
|
903
902
|
this.touched,
|
|
904
903
|
r.validationMode
|
|
905
|
-
)((a,
|
|
904
|
+
)((a, c, p) => p === "continuous" ? !!a : !!a && !!c) : this.errorVisible = k(
|
|
906
905
|
this.hasError,
|
|
907
906
|
this.touched
|
|
908
|
-
)((a,
|
|
907
|
+
)((a, c) => !!a && !!c), this.dirty = k(
|
|
909
908
|
this.signal,
|
|
910
909
|
this.#s
|
|
911
|
-
)((a,
|
|
910
|
+
)((a, c) => !this.#t(a, c)), this.dependencyErrors = i.map(
|
|
912
911
|
(a) => a?.type === "invalid" ? a.error?.dependencies : void 0
|
|
913
|
-
), this.parent = r, this.disabled =
|
|
912
|
+
), this.parent = r, this.disabled = k(
|
|
914
913
|
this.#e.disabled,
|
|
915
914
|
r.disabled
|
|
916
|
-
)((a,
|
|
915
|
+
)((a, c) => a || c), this.disabledOrHasErrors = k(
|
|
917
916
|
this.disabled,
|
|
918
917
|
this.hasError
|
|
919
|
-
)((a,
|
|
918
|
+
)((a, c) => a || c), this.onDispose(() => {
|
|
920
919
|
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();
|
|
921
920
|
});
|
|
922
921
|
}
|
|
923
922
|
get name() {
|
|
924
|
-
return
|
|
923
|
+
return ve(this.path);
|
|
925
924
|
}
|
|
926
925
|
onDispose = (s) => {
|
|
927
926
|
this.#n.push(s);
|
|
@@ -952,7 +951,7 @@ class M {
|
|
|
952
951
|
reset = () => {
|
|
953
952
|
this.change(this.#s.value);
|
|
954
953
|
};
|
|
955
|
-
array = (s =
|
|
954
|
+
array = (s = $) => new we(
|
|
956
955
|
this.path,
|
|
957
956
|
this.change,
|
|
958
957
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -961,7 +960,7 @@ class M {
|
|
|
961
960
|
this.parent,
|
|
962
961
|
s
|
|
963
962
|
);
|
|
964
|
-
object = (s =
|
|
963
|
+
object = (s = $) => new ye(
|
|
965
964
|
this.path,
|
|
966
965
|
this.change,
|
|
967
966
|
this.signal,
|
|
@@ -969,7 +968,7 @@ class M {
|
|
|
969
968
|
this.parent,
|
|
970
969
|
s
|
|
971
970
|
);
|
|
972
|
-
transform = (s, t, n = [], i =
|
|
971
|
+
transform = (s, t, n = [], i = $) => new M(
|
|
973
972
|
[...this.path, ...n],
|
|
974
973
|
(r) => this.change(t(r)),
|
|
975
974
|
this.signal.map(s, i),
|
|
@@ -977,7 +976,7 @@ class M {
|
|
|
977
976
|
this.parent,
|
|
978
977
|
i
|
|
979
978
|
);
|
|
980
|
-
asyncTransform = (s, t, n, i = [], r =
|
|
979
|
+
asyncTransform = (s, t, n, i = [], r = $) => new M(
|
|
981
980
|
[...this.path, ...i],
|
|
982
981
|
(l) => {
|
|
983
982
|
t(l).then((a) => this.change(a));
|
|
@@ -988,7 +987,7 @@ class M {
|
|
|
988
987
|
r
|
|
989
988
|
);
|
|
990
989
|
}
|
|
991
|
-
class
|
|
990
|
+
class ye extends M {
|
|
992
991
|
#e = /* @__PURE__ */ new Map();
|
|
993
992
|
#t = /* @__PURE__ */ new Map();
|
|
994
993
|
#s = /* @__PURE__ */ new Map();
|
|
@@ -998,9 +997,9 @@ class we extends M {
|
|
|
998
997
|
#i = /* @__PURE__ */ new Map();
|
|
999
998
|
#l = I(!1);
|
|
1000
999
|
dirtyDeep = this.#l;
|
|
1001
|
-
#
|
|
1000
|
+
#o;
|
|
1002
1001
|
#u;
|
|
1003
|
-
#
|
|
1002
|
+
#c = () => {
|
|
1004
1003
|
let s = !1;
|
|
1005
1004
|
for (const t of this.#t.values())
|
|
1006
1005
|
if (t) {
|
|
@@ -1013,24 +1012,24 @@ class we extends M {
|
|
|
1013
1012
|
super(
|
|
1014
1013
|
s,
|
|
1015
1014
|
t,
|
|
1016
|
-
n.map((
|
|
1015
|
+
n.map((c) => c ?? {}, l),
|
|
1017
1016
|
i,
|
|
1018
1017
|
r,
|
|
1019
1018
|
l
|
|
1020
|
-
), this.#
|
|
1021
|
-
this.#
|
|
1019
|
+
), this.#o = this.touched.on(() => {
|
|
1020
|
+
this.#c();
|
|
1022
1021
|
}), this.#u = this.dirty.on(() => {
|
|
1023
1022
|
this.#a();
|
|
1024
1023
|
});
|
|
1025
1024
|
const a = this.signal.on(() => this.#a());
|
|
1026
1025
|
this.onDispose(() => {
|
|
1027
|
-
for (const
|
|
1028
|
-
|
|
1026
|
+
for (const c of this.#e.values())
|
|
1027
|
+
c.dispose();
|
|
1029
1028
|
this.#e.clear();
|
|
1030
|
-
for (const
|
|
1029
|
+
for (const c of this.#s.values()) c();
|
|
1031
1030
|
this.#s.clear(), this.#t.clear(), this.#n.dispose();
|
|
1032
|
-
for (const
|
|
1033
|
-
this.#i.clear(), this.#r.clear(), this.#l.dispose(), this.#
|
|
1031
|
+
for (const c of this.#i.values()) c();
|
|
1032
|
+
this.#i.clear(), this.#r.clear(), this.#l.dispose(), this.#o(), this.#u(), a();
|
|
1034
1033
|
});
|
|
1035
1034
|
}
|
|
1036
1035
|
field = (s) => {
|
|
@@ -1054,7 +1053,7 @@ class we extends M {
|
|
|
1054
1053
|
);
|
|
1055
1054
|
this.#e.set(s, n);
|
|
1056
1055
|
const i = n.touched.on((l) => {
|
|
1057
|
-
this.#t.set(s, l), this.#
|
|
1056
|
+
this.#t.set(s, l), this.#c();
|
|
1058
1057
|
});
|
|
1059
1058
|
this.#s.set(s, i);
|
|
1060
1059
|
const r = n.dirty.on((l) => {
|
|
@@ -1088,7 +1087,7 @@ class we extends M {
|
|
|
1088
1087
|
this.#l.set(this.dirty.value || s);
|
|
1089
1088
|
};
|
|
1090
1089
|
}
|
|
1091
|
-
class
|
|
1090
|
+
class we extends M {
|
|
1092
1091
|
#e = new Array();
|
|
1093
1092
|
length;
|
|
1094
1093
|
#t = /* @__PURE__ */ new Map();
|
|
@@ -1099,9 +1098,9 @@ class ke extends M {
|
|
|
1099
1098
|
#i = /* @__PURE__ */ new Map();
|
|
1100
1099
|
#l = I(!1);
|
|
1101
1100
|
dirtyDeep = this.#l;
|
|
1102
|
-
#
|
|
1101
|
+
#o;
|
|
1103
1102
|
#u;
|
|
1104
|
-
#
|
|
1103
|
+
#c = () => {
|
|
1105
1104
|
let s = !1;
|
|
1106
1105
|
for (const t of this.#t.values())
|
|
1107
1106
|
if (t) {
|
|
@@ -1111,29 +1110,29 @@ class ke extends M {
|
|
|
1111
1110
|
this.#n.set(this.touched.value || s);
|
|
1112
1111
|
};
|
|
1113
1112
|
constructor(s, t, n, i, r, l) {
|
|
1114
|
-
const a = n.map((
|
|
1113
|
+
const a = n.map((h) => h ?? [], l);
|
|
1115
1114
|
super(s, t, a, i, r, l);
|
|
1116
|
-
const
|
|
1117
|
-
const
|
|
1118
|
-
|
|
1119
|
-
const
|
|
1120
|
-
|
|
1121
|
-
}), this.#
|
|
1115
|
+
const c = a.on((h) => {
|
|
1116
|
+
const b = this.#e.length - h.length;
|
|
1117
|
+
b > 0 && (this.#e.splice(h.length, b).forEach((S, v) => {
|
|
1118
|
+
const u = h.length + v;
|
|
1119
|
+
S.dispose(), this.#s.get(u)?.(), this.#s.delete(u), this.#t.delete(u), this.#i.get(u)?.(), this.#i.delete(u), this.#r.delete(u);
|
|
1120
|
+
}), this.#c(), this.#a());
|
|
1122
1121
|
});
|
|
1123
|
-
this.length = a.map((
|
|
1124
|
-
this.#
|
|
1122
|
+
this.length = a.map((h) => h.length), this.#o = this.touched.on(() => {
|
|
1123
|
+
this.#c();
|
|
1125
1124
|
}), this.#u = this.dirty.on(() => {
|
|
1126
1125
|
this.#a();
|
|
1127
1126
|
});
|
|
1128
|
-
const
|
|
1127
|
+
const p = this.signal.on(() => this.#a());
|
|
1129
1128
|
this.onDispose(() => {
|
|
1130
|
-
for (const
|
|
1131
|
-
|
|
1132
|
-
this.length.dispose(), this.#e.length = 0,
|
|
1133
|
-
for (const
|
|
1129
|
+
for (const h of this.#e)
|
|
1130
|
+
h.dispose();
|
|
1131
|
+
this.length.dispose(), this.#e.length = 0, c(), a.dispose();
|
|
1132
|
+
for (const h of this.#s.values()) h();
|
|
1134
1133
|
this.#s.clear(), this.#t.clear(), this.#n.dispose();
|
|
1135
|
-
for (const
|
|
1136
|
-
this.#i.clear(), this.#r.clear(), this.#l.dispose(), this.#
|
|
1134
|
+
for (const h of this.#i.values()) h();
|
|
1135
|
+
this.#i.clear(), this.#r.clear(), this.#l.dispose(), this.#o(), this.#u(), p();
|
|
1137
1136
|
});
|
|
1138
1137
|
}
|
|
1139
1138
|
item = (s) => {
|
|
@@ -1154,7 +1153,7 @@ class ke extends M {
|
|
|
1154
1153
|
);
|
|
1155
1154
|
this.#e[s] = n;
|
|
1156
1155
|
const i = n.touched.on((l) => {
|
|
1157
|
-
this.#t.set(s, l), this.#
|
|
1156
|
+
this.#t.set(s, l), this.#c();
|
|
1158
1157
|
});
|
|
1159
1158
|
this.#s.set(s, i);
|
|
1160
1159
|
const r = n.dirty.on((l) => {
|
|
@@ -1208,7 +1207,7 @@ class ke extends M {
|
|
|
1208
1207
|
this.#l.set(this.dirty.value || s);
|
|
1209
1208
|
};
|
|
1210
1209
|
}
|
|
1211
|
-
function
|
|
1210
|
+
function ke(e) {
|
|
1212
1211
|
function s(t) {
|
|
1213
1212
|
return typeof t == "number" ? t : t.toString();
|
|
1214
1213
|
}
|
|
@@ -1216,13 +1215,13 @@ function Se(e) {
|
|
|
1216
1215
|
(t) => typeof t == "object" && t.key != null ? s(t.key) : s(t)
|
|
1217
1216
|
);
|
|
1218
1217
|
}
|
|
1219
|
-
function
|
|
1218
|
+
function Se(e) {
|
|
1220
1219
|
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 =
|
|
1222
|
-
let
|
|
1223
|
-
for (const
|
|
1224
|
-
|
|
1225
|
-
return
|
|
1220
|
+
const l = ke(r.path), a = l.pop();
|
|
1221
|
+
let c = i;
|
|
1222
|
+
for (const p of l)
|
|
1223
|
+
c.dependencies == null && (c.dependencies = {}), c.dependencies[p] == null && (c.dependencies[p] = {}), c = c.dependencies[p];
|
|
1224
|
+
return c.dependencies == null && (c.dependencies = {}), c.dependencies[a] = { message: r.message }, i;
|
|
1226
1225
|
}, {}), n = s.join(`
|
|
1227
1226
|
`);
|
|
1228
1227
|
return {
|
|
@@ -1230,7 +1229,7 @@ function Ce(e) {
|
|
|
1230
1229
|
message: n != "" ? n : void 0
|
|
1231
1230
|
};
|
|
1232
1231
|
}
|
|
1233
|
-
function
|
|
1232
|
+
function Ce({
|
|
1234
1233
|
initialValue: e,
|
|
1235
1234
|
onChange: s,
|
|
1236
1235
|
validate: t,
|
|
@@ -1238,68 +1237,68 @@ function _e({
|
|
|
1238
1237
|
validationMode: i,
|
|
1239
1238
|
validateDebounceMs: r
|
|
1240
1239
|
}) {
|
|
1241
|
-
const l =
|
|
1240
|
+
const l = C.deriveProp(e), a = I(D.valid), c = I(!1), p = I(i ?? "touchedOrSubmit"), h = (d) => {
|
|
1242
1241
|
a.set(d);
|
|
1243
1242
|
};
|
|
1244
|
-
let
|
|
1245
|
-
const
|
|
1243
|
+
let b;
|
|
1244
|
+
const S = async (d) => {
|
|
1246
1245
|
if (t != null) {
|
|
1247
|
-
const
|
|
1248
|
-
|
|
1246
|
+
const g = await t(d);
|
|
1247
|
+
h(g);
|
|
1249
1248
|
}
|
|
1250
1249
|
}, v = async (d) => {
|
|
1251
1250
|
l.set(d), s?.(d);
|
|
1252
|
-
const
|
|
1251
|
+
const g = p.value;
|
|
1253
1252
|
if (t != null) {
|
|
1254
|
-
if (
|
|
1253
|
+
if (g === "onSubmit")
|
|
1255
1254
|
return;
|
|
1256
1255
|
const T = r ?? 0;
|
|
1257
|
-
T > 0 ? (
|
|
1258
|
-
|
|
1259
|
-
}, T)) : await
|
|
1256
|
+
T > 0 ? (b && clearTimeout(b), b = setTimeout(() => {
|
|
1257
|
+
S(d);
|
|
1258
|
+
}, T)) : await S(d);
|
|
1260
1259
|
}
|
|
1261
|
-
},
|
|
1260
|
+
}, u = new M(
|
|
1262
1261
|
[],
|
|
1263
1262
|
v,
|
|
1264
1263
|
l,
|
|
1265
1264
|
a,
|
|
1266
1265
|
{
|
|
1267
|
-
disabled:
|
|
1268
|
-
validationMode:
|
|
1266
|
+
disabled: c,
|
|
1267
|
+
validationMode: p
|
|
1269
1268
|
},
|
|
1270
|
-
n ??
|
|
1269
|
+
n ?? $
|
|
1271
1270
|
);
|
|
1272
|
-
return
|
|
1273
|
-
|
|
1274
|
-
}), { controller:
|
|
1271
|
+
return u.onDispose(() => {
|
|
1272
|
+
c.dispose(), l.dispose(), a.dispose(), p.dispose(), b && clearTimeout(b);
|
|
1273
|
+
}), { controller: u, setStatus: h };
|
|
1275
1274
|
}
|
|
1276
|
-
function
|
|
1277
|
-
return
|
|
1275
|
+
function ee(e) {
|
|
1276
|
+
return P(o.disabled(e.disabled), o.name(e.name));
|
|
1278
1277
|
}
|
|
1279
|
-
function
|
|
1278
|
+
function Ne(e, {
|
|
1280
1279
|
triggerOn: s = "change"
|
|
1281
1280
|
} = {}) {
|
|
1282
|
-
return
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
(s === "input" ? E.input : E.change)(
|
|
1281
|
+
return P(
|
|
1282
|
+
ee(e),
|
|
1283
|
+
o.value(e.signal),
|
|
1284
|
+
(s === "input" ? E.input : E.change)(F(e.change))
|
|
1286
1285
|
);
|
|
1287
1286
|
}
|
|
1288
|
-
function
|
|
1287
|
+
function Le(e, {
|
|
1289
1288
|
triggerOn: s = "change"
|
|
1290
1289
|
} = {}) {
|
|
1291
|
-
return
|
|
1292
|
-
|
|
1293
|
-
|
|
1290
|
+
return P(
|
|
1291
|
+
ee(e),
|
|
1292
|
+
o.valueAsNumber(e.signal),
|
|
1294
1293
|
(s === "input" ? E.input : E.change)(
|
|
1295
|
-
|
|
1294
|
+
ne(e.change)
|
|
1296
1295
|
)
|
|
1297
1296
|
);
|
|
1298
1297
|
}
|
|
1299
1298
|
function J(e) {
|
|
1300
|
-
return e.issues != null ? D.invalid(
|
|
1299
|
+
return e.issues != null ? D.invalid(Se(e.issues)) : D.valid;
|
|
1301
1300
|
}
|
|
1302
|
-
async function
|
|
1301
|
+
async function je({
|
|
1303
1302
|
task: e,
|
|
1304
1303
|
errorMessage: s,
|
|
1305
1304
|
errorPath: t = ["root"],
|
|
@@ -1313,11 +1312,11 @@ async function qe({
|
|
|
1313
1312
|
return t.length === 1 && t[0] === "root" ? D.invalid({
|
|
1314
1313
|
message: r
|
|
1315
1314
|
}) : D.invalid({
|
|
1316
|
-
dependencies:
|
|
1315
|
+
dependencies: se(t, r)
|
|
1317
1316
|
});
|
|
1318
1317
|
}
|
|
1319
1318
|
}
|
|
1320
|
-
function
|
|
1319
|
+
function se(e, s) {
|
|
1321
1320
|
if (e.length === 1)
|
|
1322
1321
|
return {
|
|
1323
1322
|
[e[0]]: { message: s }
|
|
@@ -1325,48 +1324,48 @@ function te(e, s) {
|
|
|
1325
1324
|
const [t, ...n] = e;
|
|
1326
1325
|
return {
|
|
1327
1326
|
[t]: {
|
|
1328
|
-
dependencies:
|
|
1327
|
+
dependencies: se(n, s)
|
|
1329
1328
|
}
|
|
1330
1329
|
};
|
|
1331
1330
|
}
|
|
1332
|
-
function
|
|
1331
|
+
function qe({
|
|
1333
1332
|
initialValue: e = {},
|
|
1334
1333
|
schema: s,
|
|
1335
1334
|
onSubmit: t = async () => D.valid,
|
|
1336
1335
|
validationMode: n,
|
|
1337
1336
|
validateDebounceMs: i
|
|
1338
1337
|
}) {
|
|
1339
|
-
const { controller: r, setStatus: l } =
|
|
1338
|
+
const { controller: r, setStatus: l } = Ce({
|
|
1340
1339
|
initialValue: e,
|
|
1341
1340
|
validationMode: n ?? "touchedOrSubmit",
|
|
1342
1341
|
validateDebounceMs: i,
|
|
1343
|
-
validate: (n ?? "touchedOrSubmit") === "onSubmit" || s == null ? void 0 : async (
|
|
1344
|
-
await s["~standard"].validate(
|
|
1342
|
+
validate: (n ?? "touchedOrSubmit") === "onSubmit" || s == null ? void 0 : async (h) => J(
|
|
1343
|
+
await s["~standard"].validate(h)
|
|
1345
1344
|
)
|
|
1346
|
-
}), a = I(!1),
|
|
1347
|
-
return
|
|
1348
|
-
controller:
|
|
1345
|
+
}), a = I(!1), c = r.object();
|
|
1346
|
+
return c.onDispose(a.dispose), {
|
|
1347
|
+
controller: c,
|
|
1349
1348
|
setStatus: l,
|
|
1350
|
-
submit: async (
|
|
1351
|
-
if (a.set(!0),
|
|
1352
|
-
const
|
|
1349
|
+
submit: async (h) => {
|
|
1350
|
+
if (a.set(!0), h?.preventDefault(), c.markAllTouched(), (n ?? "touchedOrSubmit") === "onSubmit") {
|
|
1351
|
+
const S = c.signal.value, v = s?.["~standard"].validate;
|
|
1353
1352
|
if (v == null) {
|
|
1354
1353
|
a.set(!1);
|
|
1355
1354
|
return;
|
|
1356
1355
|
}
|
|
1357
|
-
const
|
|
1358
|
-
if (l(
|
|
1356
|
+
const u = J(await v(S));
|
|
1357
|
+
if (l(u), u.type === "invalid") {
|
|
1359
1358
|
a.set(!1);
|
|
1360
1359
|
return;
|
|
1361
1360
|
}
|
|
1362
1361
|
}
|
|
1363
|
-
const
|
|
1364
|
-
a.set(!1),
|
|
1362
|
+
const b = await t(c.signal.value);
|
|
1363
|
+
a.set(!1), b.type === "invalid" && l(b);
|
|
1365
1364
|
},
|
|
1366
1365
|
submitting: a
|
|
1367
1366
|
};
|
|
1368
1367
|
}
|
|
1369
|
-
function
|
|
1368
|
+
function _e(e) {
|
|
1370
1369
|
switch (e) {
|
|
1371
1370
|
case "success":
|
|
1372
1371
|
return "material-symbols:check-circle-outline";
|
|
@@ -1379,7 +1378,7 @@ function De(e) {
|
|
|
1379
1378
|
return "material-symbols:info-outline";
|
|
1380
1379
|
}
|
|
1381
1380
|
}
|
|
1382
|
-
function
|
|
1381
|
+
function De(e) {
|
|
1383
1382
|
switch (e) {
|
|
1384
1383
|
case "success":
|
|
1385
1384
|
return "success";
|
|
@@ -1392,7 +1391,7 @@ function Ee(e) {
|
|
|
1392
1391
|
return "info";
|
|
1393
1392
|
}
|
|
1394
1393
|
}
|
|
1395
|
-
function
|
|
1394
|
+
function Ee(e, s, t, n) {
|
|
1396
1395
|
const i = [
|
|
1397
1396
|
"bc-notice",
|
|
1398
1397
|
`bc-notice--${e}`,
|
|
@@ -1400,7 +1399,7 @@ function Ie(e, s, t, n) {
|
|
|
1400
1399
|
];
|
|
1401
1400
|
return t && i.push("bc-notice--dismissible"), n && n.length > 0 && i.push(n), i.join(" ");
|
|
1402
1401
|
}
|
|
1403
|
-
function
|
|
1402
|
+
function ze({
|
|
1404
1403
|
variant: e = "info",
|
|
1405
1404
|
tone: s = "subtle",
|
|
1406
1405
|
role: t,
|
|
@@ -1409,106 +1408,105 @@ function He({
|
|
|
1409
1408
|
closable: r = !1,
|
|
1410
1409
|
onDismiss: l,
|
|
1411
1410
|
class: a
|
|
1412
|
-
}, ...
|
|
1413
|
-
const
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
u
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
() =>
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1411
|
+
}, ...c) {
|
|
1412
|
+
const p = I(!0);
|
|
1413
|
+
return O(p, () => {
|
|
1414
|
+
const h = C.map(
|
|
1415
|
+
r,
|
|
1416
|
+
(u) => !!u || l != null
|
|
1417
|
+
), b = C.map(e, (u) => u ?? "info"), S = C.map(s, (u) => u ?? "subtle"), v = k(
|
|
1418
|
+
t,
|
|
1419
|
+
b
|
|
1420
|
+
)(
|
|
1421
|
+
(u, d) => u ?? (d === "danger" ? "alert" : "status")
|
|
1422
|
+
);
|
|
1423
|
+
return q(
|
|
1424
|
+
z,
|
|
1425
|
+
(u) => f.div(
|
|
1426
|
+
o.class(
|
|
1427
|
+
k(
|
|
1428
|
+
b,
|
|
1429
|
+
S,
|
|
1430
|
+
h,
|
|
1431
|
+
a
|
|
1432
|
+
)((d, g, T, A) => Ee(d, g, T, A))
|
|
1433
|
+
),
|
|
1434
|
+
// Accessibility role mapping (always defined)
|
|
1435
|
+
o.role(C.map(v, (d) => d)),
|
|
1436
|
+
ie(
|
|
1437
|
+
C.map(i, (d) => d === !1),
|
|
1438
|
+
() => f.div(
|
|
1439
|
+
o.class("bc-notice__icon"),
|
|
1440
|
+
N({
|
|
1441
|
+
icon: k(
|
|
1442
|
+
i,
|
|
1443
|
+
b
|
|
1444
|
+
)(
|
|
1445
|
+
(d, g) => d === void 0 ? _e(g) : String(d)
|
|
1446
|
+
),
|
|
1447
|
+
size: "md",
|
|
1448
|
+
color: C.map(b, De)
|
|
1449
|
+
})
|
|
1450
|
+
)
|
|
1451
|
+
),
|
|
1452
|
+
f.div(
|
|
1453
|
+
o.class("bc-notice__body"),
|
|
1454
|
+
re(
|
|
1455
|
+
n,
|
|
1456
|
+
(d) => f.div(o.class("bc-notice__title"), d)
|
|
1457
|
+
),
|
|
1458
|
+
f.div(o.class("bc-notice__content"), ...c)
|
|
1459
|
+
),
|
|
1460
|
+
O(
|
|
1461
|
+
h,
|
|
1462
|
+
() => ce({
|
|
1463
|
+
size: "xs",
|
|
1464
|
+
label: u.$.closeModal,
|
|
1465
|
+
onClick: () => {
|
|
1466
|
+
p.set(!1), l?.();
|
|
1467
|
+
}
|
|
1445
1468
|
})
|
|
1446
1469
|
)
|
|
1447
|
-
),
|
|
1448
|
-
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)
|
|
1452
|
-
),
|
|
1453
|
-
O(
|
|
1454
|
-
f,
|
|
1455
|
-
() => ce({
|
|
1456
|
-
size: "xs",
|
|
1457
|
-
label: d.$.closeModal,
|
|
1458
|
-
onClick: () => {
|
|
1459
|
-
v.set(!1), l?.();
|
|
1460
|
-
}
|
|
1461
|
-
})
|
|
1462
1470
|
)
|
|
1463
|
-
)
|
|
1464
|
-
);
|
|
1465
|
-
return x(
|
|
1466
|
-
X(
|
|
1467
|
-
() => {
|
|
1468
|
-
y.dispose(f), y.dispose(u), y.dispose(g);
|
|
1469
|
-
},
|
|
1470
|
-
w,
|
|
1471
|
-
v
|
|
1472
|
-
),
|
|
1473
|
-
O(v, () => h)
|
|
1474
|
-
);
|
|
1471
|
+
);
|
|
1472
|
+
});
|
|
1475
1473
|
}
|
|
1476
1474
|
export {
|
|
1477
|
-
|
|
1478
|
-
|
|
1475
|
+
we as A,
|
|
1476
|
+
Z as B,
|
|
1479
1477
|
ce as C,
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1478
|
+
Ve as D,
|
|
1479
|
+
Fe as E,
|
|
1480
|
+
Y as I,
|
|
1481
|
+
oe as L,
|
|
1482
|
+
Pe as M,
|
|
1483
|
+
ze as N,
|
|
1484
|
+
$ as O,
|
|
1485
|
+
$e as P,
|
|
1486
|
+
he as R,
|
|
1487
|
+
Me as S,
|
|
1490
1488
|
D as a,
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1489
|
+
Oe as b,
|
|
1490
|
+
xe as c,
|
|
1491
|
+
be as d,
|
|
1494
1492
|
M as e,
|
|
1495
1493
|
j as f,
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1494
|
+
me as g,
|
|
1495
|
+
ve as h,
|
|
1496
|
+
ye as i,
|
|
1497
|
+
ke as j,
|
|
1498
|
+
Se as k,
|
|
1499
|
+
Ce as l,
|
|
1500
|
+
fe as m,
|
|
1501
|
+
ee as n,
|
|
1502
|
+
Ne as o,
|
|
1503
|
+
Be as p,
|
|
1504
|
+
Le as q,
|
|
1507
1505
|
J as r,
|
|
1508
1506
|
H as s,
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1507
|
+
je as t,
|
|
1508
|
+
qe as u,
|
|
1509
|
+
Ae as v,
|
|
1510
|
+
ge as w,
|
|
1511
|
+
ue as x
|
|
1514
1512
|
};
|