@tempots/beatui 0.21.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -6
- package/dist/{2019-5KfqWnec.js → 2019-BD_R8GCb.js} +2 -2
- package/dist/{2019-2VJkiLfN.cjs → 2019-DsAbc1I5.cjs} +1 -1
- package/dist/{2020-DgsRREzV.js → 2020-DZOE7XZH.js} +2 -2
- package/dist/{2020-B8Q7fWlH.cjs → 2020-j6NLRYni.cjs} +1 -1
- package/dist/{ar-DyhaQaJU.cjs → ar-CYAprS9_.cjs} +1 -1
- package/dist/{ar-RkpJ2n6w.js → ar-DuYtkwHz.js} +1 -1
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +232 -232
- package/dist/beatui.css +6840 -1
- package/dist/beatui.tailwind.css +6507 -0
- package/dist/colors-5Nwx_gSj.js +528 -0
- package/dist/colors-B8HoRLA_.cjs +1 -0
- package/dist/{de-BdSVR4Zm.js → de-BSxDfb1B.js} +1 -1
- package/dist/{de-CnZ4Ik2a.cjs → de-rQvC-Ydh.cjs} +1 -1
- package/dist/{es-ZKraCneL.cjs → es-BvmzhRc0.cjs} +1 -1
- package/dist/{es-B_Qn5EUy.js → es-CAIPTBfa.js} +1 -1
- package/dist/{fa-D2p_ch4Q.cjs → fa-B3IJgHCh.cjs} +1 -1
- package/dist/{fa-jBaLjqfG.js → fa-COTldXuh.js} +1 -1
- package/dist/{fr-CBeo42lQ.cjs → fr-C9hsLGOb.cjs} +1 -1
- package/dist/{fr-B0KaMM2j.js → fr-Djxzcm-x.js} +1 -1
- package/dist/{he-BmqEF3o-.cjs → he-CHrcixO3.cjs} +1 -1
- package/dist/{he-DjeYjcW7.js → he-C_CvtpO2.js} +1 -1
- package/dist/{hi-DxBQV0uz.js → hi-C47vc5OG.js} +1 -1
- package/dist/{hi-BAfIFl1n.cjs → hi-CpbCblie.cjs} +1 -1
- package/dist/{index-c-O5R5i2.js → index--c2sxg96.js} +2 -2
- package/dist/{index-NysVuvZA.js → index-2J0cohRF.js} +2 -2
- package/dist/{index-uR3OZ_8K.cjs → index-B8EM1O9d.cjs} +1 -1
- package/dist/{index-CpKAa22o.cjs → index-BHOzetMx.cjs} +1 -1
- package/dist/{index-C4xio93t.js → index-BIBYSE0O.js} +3 -3
- package/dist/{index-BInDdLXi.cjs → index-BIbSEVsf.cjs} +1 -1
- package/dist/{index-Jt6D3QJ7.cjs → index-BJZGXsLQ.cjs} +1 -1
- package/dist/{index-DXFCOeK6.cjs → index-BK8EFVAw.cjs} +1 -1
- package/dist/index-BLjWV-YV.cjs +8 -0
- package/dist/{index-CpMCZBAl.js → index-BNQL8moK.js} +2 -2
- package/dist/{index-cjtIcxwt.cjs → index-BUE3WeDh.cjs} +1 -1
- package/dist/{index-BX_AooS9.js → index-BXHmDsV_.js} +2 -2
- package/dist/{index-CdvplJG6.js → index-BiHxJSI9.js} +3 -3
- package/dist/index-Br70wXYb.cjs +1 -0
- package/dist/{index-MyVoESdk.js → index-BtAze4TI.js} +3 -3
- package/dist/{index-D7o5LhMm.cjs → index-C-UADaTN.cjs} +1 -1
- package/dist/{index-DOyppfix.cjs → index-C0yFCSoy.cjs} +1 -1
- package/dist/{index-C4jYy0NW.js → index-C4wKda5M.js} +2 -2
- package/dist/{index-CaOzAsWD.cjs → index-CBlls5Ux.cjs} +1 -1
- package/dist/{index-BnbEC2zq.js → index-CQcRWw-d.js} +2 -2
- package/dist/{index-CvRJPSEv.cjs → index-CSK499Fw.cjs} +1 -1
- package/dist/{index-DiV6JJiS.js → index-CW3QYddJ.js} +2 -2
- package/dist/{index-C5l1mFuD.js → index-C_T9Gzw8.js} +2 -2
- package/dist/{index-DlaVE6S2.cjs → index-CcB11LV-.cjs} +1 -1
- package/dist/{index-KcBlGDqr.cjs → index-CeyxEbJL.cjs} +1 -1
- package/dist/{index-VAdTFk7m.js → index-CjQ-nqcq.js} +1 -1
- package/dist/{index-DXUQTPON.cjs → index-CngY8bhO.cjs} +1 -1
- package/dist/{index-BnaafQ9o.js → index-CsPpB1Kw.js} +1 -1
- package/dist/{index-Dl-wY6fc.cjs → index-CtlfDEiP.cjs} +1 -1
- package/dist/{index-CaNnYmEs.js → index-D3y-KMW-.js} +4 -4
- package/dist/{index-CZaadFtU.js → index-D7a7hidA.js} +1230 -1216
- package/dist/{index-CJM_lW9n.cjs → index-DPHERztz.cjs} +1 -1
- package/dist/{index-9UO7Pd64.cjs → index-DS0bdfOa.cjs} +1 -1
- package/dist/index-DVdM4Oz7.js +420 -0
- package/dist/{index-D5nWhHZv.js → index-DtpMK8Ak.js} +2 -2
- package/dist/{index-DhJIuRg9.js → index-Du_-zpYu.js} +4 -4
- package/dist/{index-fnMeddEM.js → index-KlPMACee.js} +2 -2
- package/dist/{index-DC5Cn-TM.js → index-OUX19p46.js} +2 -2
- package/dist/{index-CDYYXcsk.cjs → index-SP-G4Erl.cjs} +1 -1
- package/dist/{index-CpB78PPQ.cjs → index-YbpU8b-b.cjs} +1 -1
- package/dist/{index-DCpnqWRN.js → index-_0aF8UPX.js} +2 -2
- package/dist/{index-BWiQR9j3.cjs → index-c5HMVa4V.cjs} +1 -1
- package/dist/{index-BIUeLQJ1.js → index-h82qauh2.js} +4 -4
- package/dist/{index-ClvbjqJL.js → index-jLIz3LSI.js} +2 -2
- package/dist/{index-Blq-MoAk.cjs → index-jr-7RW3y.cjs} +1 -1
- package/dist/{index-B001qopB.js → index-m-1yJOxv.js} +3 -3
- package/dist/{index-4NoQLiJo.cjs → index-o4bA2Ymm.cjs} +1 -1
- package/dist/{index-RGCDszX8.cjs → index-zcRhAq4N.cjs} +1 -1
- package/dist/index.cjs.js +4 -143
- package/dist/index.es.js +2568 -3481
- package/dist/{it-CzKrFTFY.cjs → it-iA1CUA-2.cjs} +1 -1
- package/dist/{it-B4qZsicu.js → it-l8u4xqsP.js} +1 -1
- package/dist/{ja-i_9MZ1j0.cjs → ja-CRKtLvpo.cjs} +1 -1
- package/dist/{ja-BnCSmhkg.js → ja-Dr2Azv8X.js} +1 -1
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +1 -1
- package/dist/{ko-D_gGkjrC.js → ko-C97MbNN9.js} +1 -1
- package/dist/{ko-CF9il-Az.cjs → ko-DAqjjbor.cjs} +1 -1
- package/dist/markdown/index.cjs.js +2 -2
- package/dist/markdown/index.es.js +34 -34
- package/dist/markdown.css +162 -0
- package/dist/milkdown/index.cjs.js +1 -1
- package/dist/milkdown/index.es.js +1 -1
- package/dist/{milkdown-input-CYme9OBn.js → milkdown-input-Dp-upGqQ.js} +26 -26
- package/dist/{milkdown-input-KjtVqDzi.cjs → milkdown-input-EMBZNdma.cjs} +2 -2
- package/dist/milkdown-url-DgMTahqt.js +4 -0
- package/dist/milkdown-url-DjKYrEOH.cjs +1 -0
- package/dist/milkdown.css +21 -10
- package/dist/{modal-BItfEmu0.js → modal-at2TcO_O.js} +85 -85
- package/dist/{modal-B-f3LBKr.cjs → modal-hr4K3edu.cjs} +1 -1
- package/dist/{nl-CsLCWUFF.js → nl-BnDPAHZz.js} +1 -1
- package/dist/{nl-DfWlqR6T.cjs → nl-CCa2fPh7.cjs} +1 -1
- package/dist/notice-CplKL-zm.cjs +1 -0
- package/dist/{notice-tCSEbjFE.js → notice-DhynzVip.js} +842 -788
- package/dist/{pl-wK2sgv7l.cjs → pl-BVuQd0i3.cjs} +1 -1
- package/dist/{pl-Bsmj1KbZ.js → pl-DYEVmpx5.js} +1 -1
- package/dist/{pt-DAQIuOPW.cjs → pt-BFGThC8F.cjs} +1 -1
- package/dist/{pt-BR_NuRJS.js → pt-C-cIHGoh.js} +1 -1
- package/dist/{ru-BnoiCxrw.cjs → ru-M4WO0h1a.cjs} +1 -1
- package/dist/{ru-CiQ_qKD_.js → ru-n2tT3Gv-.js} +1 -1
- package/dist/styles-url-CIhMtnm4.js +4 -0
- package/dist/styles-url-SkuBc_7K.cjs +1 -0
- package/dist/tailwind/index.cjs.js +1 -0
- package/dist/tailwind/index.es.js +5 -0
- package/dist/tailwind/preset.cjs.js +1 -0
- package/dist/tailwind/preset.es.js +6 -0
- package/dist/tailwind/vite-plugin.cjs.js +26 -0
- package/dist/tailwind/vite-plugin.es.js +297 -0
- package/dist/{tr-Q9xP1nE4.js → tr-CFUAqbmS.js} +1 -1
- package/dist/{tr-Bme5PfaE.cjs → tr-KxY4CbD3.cjs} +1 -1
- package/dist/{translations-ClgoCEFC.js → translations-924E7r4Q.js} +756 -582
- package/dist/translations-BtAHDMLA.cjs +2 -0
- package/dist/{translations-D4hFMU4P.js → translations-DGCYRUSw.js} +1 -1
- package/dist/{translations-lnK_6RdU.cjs → translations-Do79R-x4.cjs} +1 -1
- package/dist/types/components/button/button.d.ts +3 -1
- package/dist/types/components/data/icon.d.ts +3 -1
- package/dist/types/components/form/input/input-wrapper.d.ts +2 -1
- package/dist/types/components/form/use-form.d.ts +3 -3
- package/dist/types/components/navigation/link/button-link.d.ts +1 -1
- package/dist/types/components/navigation/link/link.d.ts +1 -0
- package/dist/types/components/navigation/tabs/tabs.d.ts +7 -7
- package/dist/types/components/theme/style-utils.d.ts +16 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/markdown/index.d.ts +1 -1
- package/dist/types/styles/base.d.ts +2 -0
- package/dist/types/tailwind/index.d.ts +2 -0
- package/dist/types/tailwind/preset.d.ts +37 -0
- package/dist/types/tailwind/vite-plugin.d.ts +16 -0
- package/dist/types/temporal/with-temporal.d.ts +5 -1
- package/dist/types/tokens/colors.d.ts +13 -3
- package/dist/types/tokens/index.d.ts +3 -0
- package/dist/{ur-CGTjSoJt.js → ur-B7kT0PwV.js} +1 -1
- package/dist/{ur-B4b39hNV.cjs → ur-GeXcd9eA.cjs} +1 -1
- package/dist/{vi-BF3HTFU9.js → vi-CA85io1z.js} +1 -1
- package/dist/{vi-CSpW181L.cjs → vi-DYvrvqim.cjs} +1 -1
- package/dist/{zh-PeL8FN2c.cjs → zh-EIWIyzbZ.cjs} +1 -1
- package/dist/{zh-BreM8U2w.js → zh-cLh5uTFh.js} +1 -1
- package/package.json +27 -3
- package/dist/index-BXJtZL3s.cjs +0 -8
- package/dist/milkdown-url-BKbqhNCO.js +0 -4
- package/dist/milkdown-url-BLgXPmZR.cjs +0 -1
- package/dist/notice-DvzonVEo.cjs +0 -1
- package/dist/styles-url-B-d6aezR.cjs +0 -1
- package/dist/styles-url-B4WGMvfi.js +0 -4
- package/dist/translations-DRBh70w8.cjs +0 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { makeProviderMark as
|
|
2
|
-
import { WhenInViewport as
|
|
3
|
-
|
|
1
|
+
import { makeProviderMark as ae, localStorageProp as X, computedOf as k, Use as q, html as p, attr as c, When as _, Fragment as E, aria as x, coalesce as Q, style as H, prop as I, on as y, OnDispose as oe, Value as L, WithElement as ve, Empty as v, dataAttr as J, input as ie, emitValue as M, emitValueAsNumber as ke } from "@tempots/dom";
|
|
2
|
+
import { WhenInViewport as ye, Query as we, ElementRect as Ce } from "@tempots/ui";
|
|
3
|
+
import { b as xe, g as Se } from "./colors-5Nwx_gSj.js";
|
|
4
|
+
function ee(e, {
|
|
4
5
|
units: t = ["B", "KB", "MB", "GB", "TB"],
|
|
5
6
|
decimalPlaces: s = 0,
|
|
6
7
|
locale: n
|
|
@@ -28,12 +29,12 @@ function K(e, {
|
|
|
28
29
|
maximumFractionDigits: r === 0 ? 0 : s
|
|
29
30
|
}).format(a).replace("byte", t[r]);
|
|
30
31
|
}
|
|
31
|
-
const
|
|
32
|
-
function
|
|
33
|
-
const t =
|
|
34
|
-
return
|
|
32
|
+
const te = /* @__PURE__ */ new Map();
|
|
33
|
+
function le(e) {
|
|
34
|
+
const t = te.get(e) ?? 0;
|
|
35
|
+
return te.set(e, t + 1), `${e}-${t}`;
|
|
35
36
|
}
|
|
36
|
-
const
|
|
37
|
+
const C = {
|
|
37
38
|
/**
|
|
38
39
|
* Creates a loading state.
|
|
39
40
|
* @param previousValue - The previous value.
|
|
@@ -112,7 +113,7 @@ const w = {
|
|
|
112
113
|
* @public
|
|
113
114
|
*/
|
|
114
115
|
getOrElse(e, t) {
|
|
115
|
-
return
|
|
116
|
+
return C.isSuccess(e) ? e.value : t;
|
|
116
117
|
},
|
|
117
118
|
/**
|
|
118
119
|
* Gets the value if the result is a success; otherwise, returns the value from the alternative function.
|
|
@@ -123,7 +124,7 @@ const w = {
|
|
|
123
124
|
* function.
|
|
124
125
|
*/
|
|
125
126
|
getOrElseLazy(e, t) {
|
|
126
|
-
return
|
|
127
|
+
return C.isSuccess(e) ? e.value : t();
|
|
127
128
|
},
|
|
128
129
|
/**
|
|
129
130
|
* Gets the value if the result is a success; otherwise, returns `null`.
|
|
@@ -132,7 +133,7 @@ const w = {
|
|
|
132
133
|
* @public
|
|
133
134
|
*/
|
|
134
135
|
getOrNull(e) {
|
|
135
|
-
return
|
|
136
|
+
return C.isSuccess(e) ? e.value : null;
|
|
136
137
|
},
|
|
137
138
|
/**
|
|
138
139
|
* Gets the value if the result is a success; otherwise, returns `undefined`.
|
|
@@ -141,7 +142,7 @@ const w = {
|
|
|
141
142
|
* @public
|
|
142
143
|
*/
|
|
143
144
|
getOrUndefined(e) {
|
|
144
|
-
return
|
|
145
|
+
return C.isSuccess(e) ? e.value : void 0;
|
|
145
146
|
},
|
|
146
147
|
/**
|
|
147
148
|
* Gets the value of a `AsyncResult` if it is a `Success`, otherwise it throws the error contained in the `Failure`.
|
|
@@ -149,9 +150,9 @@ const w = {
|
|
|
149
150
|
* @returns The value of the `AsyncResult` if it is a `Success`.
|
|
150
151
|
*/
|
|
151
152
|
getUnsafe: (e) => {
|
|
152
|
-
if (
|
|
153
|
+
if (C.isSuccess(e))
|
|
153
154
|
return e.value;
|
|
154
|
-
throw
|
|
155
|
+
throw C.isFailure(e) ? e.error : new Error("Cannot get value from a not-asked or loading result");
|
|
155
156
|
},
|
|
156
157
|
/**
|
|
157
158
|
* Based on the state of the result, it picks the appropriate function to call and returns the result.
|
|
@@ -167,7 +168,7 @@ const w = {
|
|
|
167
168
|
failure: s,
|
|
168
169
|
loading: n,
|
|
169
170
|
notAsked: r = n
|
|
170
|
-
}) =>
|
|
171
|
+
}) => C.isSuccess(e) ? t(e.value) : C.isFailure(e) ? s(e.error) : C.isNotAsked(e) ? r() : n(e.previousValue),
|
|
171
172
|
/**
|
|
172
173
|
* When the result is a success, it applies the function to the value.
|
|
173
174
|
*
|
|
@@ -176,7 +177,7 @@ const w = {
|
|
|
176
177
|
* @returns The result that was passed in.
|
|
177
178
|
* @public
|
|
178
179
|
*/
|
|
179
|
-
whenSuccess: (e, t) => (
|
|
180
|
+
whenSuccess: (e, t) => (C.isSuccess(e) && t(e.value), e),
|
|
180
181
|
/**
|
|
181
182
|
* When the result is a failure, it applies the function to the error.
|
|
182
183
|
*
|
|
@@ -185,7 +186,7 @@ const w = {
|
|
|
185
186
|
* @returns The result that was passed in.
|
|
186
187
|
* @public
|
|
187
188
|
*/
|
|
188
|
-
whenFailure: (e, t) => (
|
|
189
|
+
whenFailure: (e, t) => (C.isFailure(e) && t(e.error), e),
|
|
189
190
|
/**
|
|
190
191
|
* Compares two results for equality.
|
|
191
192
|
* @param r1 - The first result.
|
|
@@ -205,11 +206,11 @@ const w = {
|
|
|
205
206
|
all: (e) => {
|
|
206
207
|
const t = [];
|
|
207
208
|
for (const s of e)
|
|
208
|
-
if (
|
|
209
|
+
if (C.isSuccess(s))
|
|
209
210
|
t.push(s.value);
|
|
210
211
|
else
|
|
211
212
|
return s;
|
|
212
|
-
return
|
|
213
|
+
return C.success(t);
|
|
213
214
|
},
|
|
214
215
|
/**
|
|
215
216
|
* Converts a Promise to an AsyncResult.
|
|
@@ -219,12 +220,12 @@ const w = {
|
|
|
219
220
|
ofPromise: async (e) => {
|
|
220
221
|
try {
|
|
221
222
|
const t = await e;
|
|
222
|
-
return
|
|
223
|
+
return C.success(t);
|
|
223
224
|
} catch (t) {
|
|
224
|
-
return
|
|
225
|
+
return C.failure(t instanceof Error ? t : new Error(String(t)));
|
|
225
226
|
}
|
|
226
227
|
}
|
|
227
|
-
},
|
|
228
|
+
}, N = (e, t) => e === t || e !== e && t !== t, D = {
|
|
228
229
|
/**
|
|
229
230
|
* Creates a valid `Validation`.
|
|
230
231
|
* @returns A `Validation` that is `Valid`.
|
|
@@ -271,8 +272,8 @@ const w = {
|
|
|
271
272
|
*/
|
|
272
273
|
toResult: (e, t) => D.match(
|
|
273
274
|
e,
|
|
274
|
-
() =>
|
|
275
|
-
(s) =>
|
|
275
|
+
() => b.success(t),
|
|
276
|
+
(s) => b.failure(s)
|
|
276
277
|
),
|
|
277
278
|
/**
|
|
278
279
|
* Execute a function when the `Validation` is valid.
|
|
@@ -290,7 +291,7 @@ const w = {
|
|
|
290
291
|
* @returns The `Validation` object.
|
|
291
292
|
*/
|
|
292
293
|
whenInvalid: (e, t) => (D.isInvalid(e) && t(e.error), e)
|
|
293
|
-
},
|
|
294
|
+
}, b = {
|
|
294
295
|
/**
|
|
295
296
|
* Creates a successful `Result`.
|
|
296
297
|
* @param value - The value to wrap in a `Success` type.
|
|
@@ -318,7 +319,7 @@ const w = {
|
|
|
318
319
|
* @returns A new `Result` with the mapped value.
|
|
319
320
|
* @public
|
|
320
321
|
*/
|
|
321
|
-
map: (e, t) => e.type === "Success" ?
|
|
322
|
+
map: (e, t) => e.type === "Success" ? b.success(t(e.value)) : e,
|
|
322
323
|
/**
|
|
323
324
|
* Maps the value of a `Result` to a new `Result`.
|
|
324
325
|
* @param r - The `Result` to map.
|
|
@@ -334,10 +335,10 @@ const w = {
|
|
|
334
335
|
* @public
|
|
335
336
|
*/
|
|
336
337
|
toAsync(e) {
|
|
337
|
-
return
|
|
338
|
+
return b.match(
|
|
338
339
|
e,
|
|
339
|
-
(t) =>
|
|
340
|
-
(t) =>
|
|
340
|
+
(t) => C.success(t),
|
|
341
|
+
(t) => C.failure(t)
|
|
341
342
|
);
|
|
342
343
|
},
|
|
343
344
|
/**
|
|
@@ -347,7 +348,7 @@ const w = {
|
|
|
347
348
|
* @public
|
|
348
349
|
*/
|
|
349
350
|
toValidation(e) {
|
|
350
|
-
return
|
|
351
|
+
return b.match(
|
|
351
352
|
e,
|
|
352
353
|
() => D.valid,
|
|
353
354
|
(t) => D.invalid(t)
|
|
@@ -379,7 +380,7 @@ const w = {
|
|
|
379
380
|
* @public
|
|
380
381
|
*/
|
|
381
382
|
getOrElse(e, t) {
|
|
382
|
-
return
|
|
383
|
+
return b.isSuccess(e) ? e.value : t;
|
|
383
384
|
},
|
|
384
385
|
/**
|
|
385
386
|
* Gets the value of a `Result` if it is a `Success`, otherwise returns the result of the provided function.
|
|
@@ -389,7 +390,7 @@ const w = {
|
|
|
389
390
|
* @public
|
|
390
391
|
*/
|
|
391
392
|
getOrElseLazy(e, t) {
|
|
392
|
-
return
|
|
393
|
+
return b.isSuccess(e) ? e.value : t();
|
|
393
394
|
},
|
|
394
395
|
/**
|
|
395
396
|
* Gets the value of a `Result` if it is a `Success`, otherwise returns `null`.
|
|
@@ -398,7 +399,7 @@ const w = {
|
|
|
398
399
|
* @public
|
|
399
400
|
*/
|
|
400
401
|
getOrNull(e) {
|
|
401
|
-
return
|
|
402
|
+
return b.isSuccess(e) ? e.value : null;
|
|
402
403
|
},
|
|
403
404
|
/**
|
|
404
405
|
* Gets the value of a `Result` if it is a `Success`, otherwise returns `undefined`.
|
|
@@ -407,7 +408,7 @@ const w = {
|
|
|
407
408
|
* @public
|
|
408
409
|
*/
|
|
409
410
|
getOrUndefined(e) {
|
|
410
|
-
return
|
|
411
|
+
return b.isSuccess(e) ? e.value : void 0;
|
|
411
412
|
},
|
|
412
413
|
/**
|
|
413
414
|
* Gets the value of a `Result` if it is a `Success`, otherwise it throws the error contained in the `Failure`.
|
|
@@ -415,7 +416,7 @@ const w = {
|
|
|
415
416
|
* @returns The value of the `Result` if it is a `Success`.
|
|
416
417
|
*/
|
|
417
418
|
getUnsafe: (e) => {
|
|
418
|
-
if (
|
|
419
|
+
if (b.isSuccess(e))
|
|
419
420
|
return e.value;
|
|
420
421
|
throw e.error;
|
|
421
422
|
},
|
|
@@ -426,15 +427,15 @@ const w = {
|
|
|
426
427
|
* @returns The result of calling the appropriate function based on the state of the result.
|
|
427
428
|
* @public
|
|
428
429
|
*/
|
|
429
|
-
match: (e, t, s) =>
|
|
430
|
+
match: (e, t, s) => b.isSuccess(e) ? t(e.value) : s(e.error),
|
|
430
431
|
/**
|
|
431
432
|
* Calls the provided function if the result is a success.
|
|
432
433
|
* @param apply - The function to call if the result is a success.
|
|
433
434
|
* @returns A function that takes a `Result` and calls the provided function if the result is a success.
|
|
434
435
|
* @public
|
|
435
436
|
*/
|
|
436
|
-
whenSuccess: (e, t) => (
|
|
437
|
-
whenFailure: (e, t) => (
|
|
437
|
+
whenSuccess: (e, t) => (b.isSuccess(e) && t(e.value), e),
|
|
438
|
+
whenFailure: (e, t) => (b.isFailure(e) && t(e.error), e),
|
|
438
439
|
/**
|
|
439
440
|
* Combines two results into a single result.
|
|
440
441
|
* @param r1 - The first result.
|
|
@@ -444,18 +445,18 @@ const w = {
|
|
|
444
445
|
* @returns The combined result.
|
|
445
446
|
* @public
|
|
446
447
|
*/
|
|
447
|
-
combine: (e, t, s, n) =>
|
|
448
|
+
combine: (e, t, s, n) => b.match(
|
|
448
449
|
e,
|
|
449
|
-
(r) =>
|
|
450
|
+
(r) => b.match(
|
|
450
451
|
t,
|
|
451
|
-
(a) =>
|
|
452
|
-
(a) =>
|
|
452
|
+
(a) => b.success(s(r, a)),
|
|
453
|
+
(a) => b.failure(a)
|
|
453
454
|
),
|
|
454
|
-
(r) =>
|
|
455
|
+
(r) => b.match(
|
|
455
456
|
t,
|
|
456
457
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
457
|
-
(a) =>
|
|
458
|
-
(a) =>
|
|
458
|
+
(a) => b.failure(r),
|
|
459
|
+
(a) => b.failure(n(r, a))
|
|
459
460
|
)
|
|
460
461
|
),
|
|
461
462
|
/**
|
|
@@ -477,13 +478,13 @@ const w = {
|
|
|
477
478
|
all: (e) => {
|
|
478
479
|
const t = [];
|
|
479
480
|
for (const s of e)
|
|
480
|
-
if (
|
|
481
|
+
if (b.isSuccess(s))
|
|
481
482
|
t.push(s.value);
|
|
482
483
|
else
|
|
483
484
|
return s;
|
|
484
|
-
return
|
|
485
|
+
return b.success(t);
|
|
485
486
|
}
|
|
486
|
-
},
|
|
487
|
+
}, ce = {
|
|
487
488
|
loadingExtended: "Loading, please wait",
|
|
488
489
|
loadingShort: "Loading...",
|
|
489
490
|
locale: "Locale",
|
|
@@ -546,29 +547,29 @@ const w = {
|
|
|
546
547
|
if (e || t) {
|
|
547
548
|
const r = [];
|
|
548
549
|
if (e != null && e > 1 && r.push(`up to ${e} files`), t && s) {
|
|
549
|
-
const a =
|
|
550
|
+
const a = ee(t, {
|
|
550
551
|
units: s
|
|
551
552
|
});
|
|
552
553
|
r.push(`max ${a} each`);
|
|
553
554
|
}
|
|
554
555
|
r.length > 0 && (n += ` (${r.join(", ")})`);
|
|
555
556
|
} else if (t && s) {
|
|
556
|
-
const r =
|
|
557
|
+
const r = ee(t, {
|
|
557
558
|
units: s
|
|
558
559
|
});
|
|
559
560
|
n += ` (max ${r})`;
|
|
560
561
|
}
|
|
561
562
|
return n;
|
|
562
563
|
}
|
|
563
|
-
},
|
|
564
|
+
}, De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
564
565
|
__proto__: null,
|
|
565
|
-
default:
|
|
566
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
566
|
+
default: ce
|
|
567
|
+
}, Symbol.toStringTag, { value: "Module" })), Ie = ce, _e = "en", Ee = (e, t, s) => {
|
|
567
568
|
const n = e[t];
|
|
568
569
|
return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((r, a) => {
|
|
569
570
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(a.bind(null, /* @__PURE__ */ new Error("Unknown variable dynamic import: " + t + (t.split("/").length !== s ? ". Note that variables only represent file names one level deep." : ""))));
|
|
570
571
|
});
|
|
571
|
-
},
|
|
572
|
+
}, Te = /* @__PURE__ */ new Set([
|
|
572
573
|
"ar",
|
|
573
574
|
// Arabic
|
|
574
575
|
"he",
|
|
@@ -594,24 +595,24 @@ const w = {
|
|
|
594
595
|
"in"
|
|
595
596
|
// Indonesian (deprecated, but sometimes confused)
|
|
596
597
|
]);
|
|
597
|
-
function
|
|
598
|
+
function ue(e) {
|
|
598
599
|
if (!e) return "ltr";
|
|
599
600
|
const t = e.split(/[-_]/)[0].toLowerCase();
|
|
600
|
-
return
|
|
601
|
+
return Te.has(t) ? "rtl" : "ltr";
|
|
601
602
|
}
|
|
602
|
-
function
|
|
603
|
-
return e === "auto" ?
|
|
603
|
+
function Le(e, t) {
|
|
604
|
+
return e === "auto" ? ue(t) : e;
|
|
604
605
|
}
|
|
605
|
-
function
|
|
606
|
+
function mt(e) {
|
|
606
607
|
return `b-${e}`;
|
|
607
608
|
}
|
|
608
|
-
function
|
|
609
|
-
return
|
|
609
|
+
function vt(e) {
|
|
610
|
+
return ue(e) === "rtl";
|
|
610
611
|
}
|
|
611
|
-
function
|
|
612
|
+
function kt(e) {
|
|
612
613
|
return e === "ltr" ? "rtl" : "ltr";
|
|
613
614
|
}
|
|
614
|
-
const
|
|
615
|
+
const Me = {
|
|
615
616
|
ltr: {
|
|
616
617
|
"inline-start": "left",
|
|
617
618
|
"inline-end": "right",
|
|
@@ -625,23 +626,23 @@ const ke = {
|
|
|
625
626
|
"block-end": "bottom"
|
|
626
627
|
}
|
|
627
628
|
};
|
|
628
|
-
function
|
|
629
|
-
return
|
|
629
|
+
function yt(e, t) {
|
|
630
|
+
return Me[t][e];
|
|
630
631
|
}
|
|
631
|
-
const
|
|
632
|
-
mark:
|
|
632
|
+
const Pe = {
|
|
633
|
+
mark: ae("Locale"),
|
|
633
634
|
create: (e) => {
|
|
634
|
-
const t =
|
|
635
|
+
const t = X({
|
|
635
636
|
defaultValue: navigator.language ?? "en-US",
|
|
636
637
|
key: "beatui-locale"
|
|
637
|
-
}), s =
|
|
638
|
+
}), s = X({
|
|
638
639
|
defaultValue: "auto",
|
|
639
640
|
key: "beatui-direction-preference"
|
|
640
|
-
}), n =
|
|
641
|
+
}), n = k(
|
|
641
642
|
t,
|
|
642
643
|
s
|
|
643
644
|
)(
|
|
644
|
-
(a,
|
|
645
|
+
(a, o) => Le(o, a)
|
|
645
646
|
);
|
|
646
647
|
return {
|
|
647
648
|
value: {
|
|
@@ -656,16 +657,117 @@ const Se = {
|
|
|
656
657
|
}
|
|
657
658
|
};
|
|
658
659
|
}
|
|
659
|
-
},
|
|
660
|
+
}, {
|
|
661
|
+
variants: Ve,
|
|
662
|
+
special: Ae,
|
|
663
|
+
overrides: Y
|
|
664
|
+
} = xe;
|
|
665
|
+
function B(e, t) {
|
|
666
|
+
switch (e) {
|
|
667
|
+
case "white":
|
|
668
|
+
return "var(--color-white)";
|
|
669
|
+
case "black":
|
|
670
|
+
return "var(--color-black)";
|
|
671
|
+
case "transparent":
|
|
672
|
+
return "transparent";
|
|
673
|
+
default:
|
|
674
|
+
return Se(e, t);
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
function de(e, t) {
|
|
678
|
+
const s = Ae[e];
|
|
679
|
+
if (!s) return;
|
|
680
|
+
if (t === "light")
|
|
681
|
+
return s;
|
|
682
|
+
const n = Y[e];
|
|
683
|
+
return n ? n[t] : s;
|
|
684
|
+
}
|
|
685
|
+
function O(e, t, s) {
|
|
686
|
+
const n = Y[e];
|
|
687
|
+
if (n) {
|
|
688
|
+
const a = n[s];
|
|
689
|
+
if (a)
|
|
690
|
+
return { backgroundColor: a.backgroundColor, textColor: a.color };
|
|
691
|
+
}
|
|
692
|
+
if (t === "solid") {
|
|
693
|
+
const a = de(e, s);
|
|
694
|
+
if (a)
|
|
695
|
+
return {
|
|
696
|
+
backgroundColor: a.backgroundColor,
|
|
697
|
+
textColor: a.color
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
const r = Ve[t][s];
|
|
701
|
+
return {
|
|
702
|
+
backgroundColor: B(e, r.bgShade),
|
|
703
|
+
textColor: r.textColor
|
|
704
|
+
};
|
|
705
|
+
}
|
|
706
|
+
const $e = {
|
|
707
|
+
light: { shade: 600, textColor: "var(--color-white)" },
|
|
708
|
+
dark: { shade: 600, textColor: "var(--text-inverted-dark)" }
|
|
709
|
+
}, Be = {
|
|
710
|
+
light: { shade: 300, textColor: "var(--text-normal-light)" },
|
|
711
|
+
dark: { shade: 700, textColor: "var(--text-normal-dark)" }
|
|
712
|
+
}, Oe = {
|
|
713
|
+
light: { shade: 400, textColor: "var(--text-normal-light)" },
|
|
714
|
+
dark: { shade: 600, textColor: "var(--text-normal-dark)" }
|
|
715
|
+
};
|
|
716
|
+
function V(e, t, s) {
|
|
717
|
+
const n = Y[e];
|
|
718
|
+
if (n) {
|
|
719
|
+
const a = n[s];
|
|
720
|
+
if (a)
|
|
721
|
+
return { backgroundColor: a.backgroundColor, textColor: a.color };
|
|
722
|
+
}
|
|
723
|
+
if (t === "solid") {
|
|
724
|
+
const a = de(e, s);
|
|
725
|
+
if (a)
|
|
726
|
+
return {
|
|
727
|
+
backgroundColor: a.backgroundColor,
|
|
728
|
+
textColor: a.color
|
|
729
|
+
};
|
|
730
|
+
const o = $e[s];
|
|
731
|
+
return {
|
|
732
|
+
backgroundColor: B(e, o.shade),
|
|
733
|
+
textColor: o.textColor
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
const r = t === "light" ? Be[s] : Oe[s];
|
|
737
|
+
return {
|
|
738
|
+
backgroundColor: B(e, r.shade),
|
|
739
|
+
textColor: r.textColor
|
|
740
|
+
};
|
|
741
|
+
}
|
|
742
|
+
function se(e, t) {
|
|
743
|
+
const s = t === "light" ? 500 : 600;
|
|
744
|
+
switch (e) {
|
|
745
|
+
case "white":
|
|
746
|
+
return t === "light" ? "var(--text-inverse-light)" : "var(--text-inverted-dark)";
|
|
747
|
+
case "black":
|
|
748
|
+
return "var(--color-black)";
|
|
749
|
+
case "transparent":
|
|
750
|
+
return "transparent";
|
|
751
|
+
default:
|
|
752
|
+
return B(e, s);
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
function j(e, t) {
|
|
756
|
+
return e === "white" ? "var(--color-white)" : e === "black" ? "var(--color-black)" : e === "transparent" ? "inherit" : B(e, t === "light" ? 800 : 200);
|
|
757
|
+
}
|
|
758
|
+
function ne(e, t, s) {
|
|
759
|
+
return t === "soft" ? B(e, s === "light" ? 300 : 700) : B(e, s === "light" ? 500 : 600);
|
|
760
|
+
}
|
|
761
|
+
const je = "bui-icons", U = /* @__PURE__ */ new Map(), he = (() => {
|
|
660
762
|
try {
|
|
661
763
|
return typeof indexedDB < "u" && indexedDB !== null;
|
|
662
764
|
} catch {
|
|
663
765
|
return !1;
|
|
664
766
|
}
|
|
665
767
|
})();
|
|
666
|
-
function
|
|
667
|
-
return
|
|
668
|
-
const s = indexedDB.open(
|
|
768
|
+
function Ne() {
|
|
769
|
+
return he ? new Promise((e, t) => {
|
|
770
|
+
const s = indexedDB.open(je, 1);
|
|
669
771
|
s.onupgradeneeded = function(n) {
|
|
670
772
|
const r = n.target.result;
|
|
671
773
|
r.objectStoreNames.contains("icons") || r.createObjectStore("icons");
|
|
@@ -676,36 +778,36 @@ function De() {
|
|
|
676
778
|
};
|
|
677
779
|
}) : Promise.reject(new Error("IndexedDB not available"));
|
|
678
780
|
}
|
|
679
|
-
const
|
|
680
|
-
function
|
|
781
|
+
const z = he ? Ne() : null;
|
|
782
|
+
function Fe(e, t) {
|
|
681
783
|
return new Promise(async (s, n) => {
|
|
682
784
|
try {
|
|
683
|
-
if (
|
|
684
|
-
const a = (await
|
|
785
|
+
if (z) {
|
|
786
|
+
const a = (await z).transaction("icons", "readwrite");
|
|
685
787
|
a.objectStore("icons").put(t, e), a.oncomplete = s, a.onerror = n;
|
|
686
788
|
} else
|
|
687
|
-
|
|
789
|
+
U.set(e, t), s(void 0);
|
|
688
790
|
} catch {
|
|
689
|
-
|
|
791
|
+
U.set(e, t), s(void 0);
|
|
690
792
|
}
|
|
691
793
|
});
|
|
692
794
|
}
|
|
693
|
-
function
|
|
795
|
+
function qe(e) {
|
|
694
796
|
return new Promise(async (t, s) => {
|
|
695
797
|
try {
|
|
696
|
-
if (
|
|
697
|
-
const
|
|
698
|
-
|
|
699
|
-
t(
|
|
700
|
-
},
|
|
798
|
+
if (z) {
|
|
799
|
+
const o = (await z).transaction("icons", "readonly").objectStore("icons").get(e);
|
|
800
|
+
o.onsuccess = function() {
|
|
801
|
+
t(o.result);
|
|
802
|
+
}, o.onerror = s;
|
|
701
803
|
} else
|
|
702
|
-
t(
|
|
804
|
+
t(U.get(e) || null);
|
|
703
805
|
} catch {
|
|
704
|
-
t(
|
|
806
|
+
t(U.get(e) || null);
|
|
705
807
|
}
|
|
706
808
|
});
|
|
707
809
|
}
|
|
708
|
-
async function
|
|
810
|
+
async function Re(e) {
|
|
709
811
|
const t = `https://api.iconify.design/${e}.svg`;
|
|
710
812
|
return fetch(t).then((s) => {
|
|
711
813
|
if (s.status === 200)
|
|
@@ -713,174 +815,244 @@ async function Ee(e) {
|
|
|
713
815
|
throw new Error(`Failed to load icon: ${e}`);
|
|
714
816
|
});
|
|
715
817
|
}
|
|
716
|
-
async function
|
|
717
|
-
const t = e.replace(":", "/"), s = await
|
|
818
|
+
async function He(e) {
|
|
819
|
+
const t = e.replace(":", "/"), s = await qe(t);
|
|
718
820
|
if (s)
|
|
719
821
|
return s;
|
|
720
|
-
const n = await
|
|
721
|
-
return await
|
|
822
|
+
const n = await Re(t);
|
|
823
|
+
return await Fe(t, n), n;
|
|
824
|
+
}
|
|
825
|
+
function Ue(e) {
|
|
826
|
+
return ["bc-icon", `bc-icon--${e}`].join(" ");
|
|
722
827
|
}
|
|
723
|
-
function
|
|
724
|
-
|
|
725
|
-
|
|
828
|
+
function ze(e, t = "solid") {
|
|
829
|
+
if (!e) return "";
|
|
830
|
+
const s = ne(e, t, "light"), n = ne(e, t, "dark");
|
|
831
|
+
return `--icon-color: ${s}; --icon-color-dark: ${n}`;
|
|
726
832
|
}
|
|
727
|
-
function
|
|
728
|
-
|
|
833
|
+
function F({
|
|
834
|
+
icon: e,
|
|
835
|
+
size: t = "md",
|
|
836
|
+
color: s,
|
|
837
|
+
title: n,
|
|
838
|
+
accessibility: r = "auto",
|
|
839
|
+
tone: a = "solid"
|
|
840
|
+
}, ...o) {
|
|
841
|
+
const i = k(
|
|
729
842
|
r,
|
|
730
843
|
n
|
|
731
|
-
)((
|
|
732
|
-
return
|
|
733
|
-
|
|
734
|
-
(
|
|
735
|
-
c.class("bu-content-box"),
|
|
844
|
+
)((l, h) => l === "decorative" ? !1 : l === "informative" ? !0 : h != null && h !== "");
|
|
845
|
+
return q(
|
|
846
|
+
R,
|
|
847
|
+
(l) => p.span(
|
|
736
848
|
c.class(
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
849
|
+
k(t, s)((h) => Ue(h ?? "md"))
|
|
850
|
+
),
|
|
851
|
+
c.style(
|
|
852
|
+
k(
|
|
853
|
+
s,
|
|
854
|
+
a
|
|
855
|
+
)(
|
|
856
|
+
(h, u) => ze(h ?? void 0, u ?? "solid")
|
|
857
|
+
)
|
|
741
858
|
),
|
|
742
859
|
// Add accessibility attributes based on icon type
|
|
743
|
-
|
|
860
|
+
_(
|
|
744
861
|
i,
|
|
745
|
-
() =>
|
|
862
|
+
() => E(
|
|
746
863
|
c.role("img"),
|
|
747
|
-
|
|
864
|
+
x.label(Q(n, l.$.iconDescription))
|
|
748
865
|
),
|
|
749
|
-
() =>
|
|
866
|
+
() => x.hidden(!0)
|
|
750
867
|
),
|
|
751
|
-
|
|
868
|
+
ye(
|
|
752
869
|
{ once: !0 },
|
|
753
|
-
() =>
|
|
870
|
+
() => we({
|
|
754
871
|
request: e,
|
|
755
|
-
load: ({ request:
|
|
872
|
+
load: ({ request: h }) => He(h),
|
|
756
873
|
convertError: String,
|
|
757
|
-
success: ({ value:
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
c.innerHTML(
|
|
874
|
+
success: ({ value: h }) => p.span(
|
|
875
|
+
H.width("100%"),
|
|
876
|
+
H.height("100%"),
|
|
877
|
+
c.innerHTML(h)
|
|
761
878
|
),
|
|
762
879
|
pending: () => p.span(
|
|
763
880
|
c.class("animate-spin"),
|
|
764
881
|
// Loading state accessibility
|
|
765
|
-
|
|
882
|
+
_(
|
|
766
883
|
i,
|
|
767
|
-
() =>
|
|
768
|
-
() =>
|
|
884
|
+
() => E(c.role("img"), x.label(l.$.loadingIcon)),
|
|
885
|
+
() => x.hidden(!0)
|
|
769
886
|
),
|
|
770
887
|
"↻"
|
|
771
888
|
),
|
|
772
|
-
failure: ({ error:
|
|
773
|
-
c.title(
|
|
889
|
+
failure: ({ error: h }) => p.span(
|
|
890
|
+
c.title(h),
|
|
774
891
|
c.class("text-red-500"),
|
|
775
892
|
// Error state accessibility
|
|
776
|
-
|
|
893
|
+
_(
|
|
777
894
|
i,
|
|
778
|
-
() =>
|
|
779
|
-
() =>
|
|
895
|
+
() => E(c.role("img"), x.label(l.$.failedToLoadIcon)),
|
|
896
|
+
() => x.hidden(!0)
|
|
780
897
|
),
|
|
781
898
|
"🚫"
|
|
782
899
|
)
|
|
783
900
|
})
|
|
784
901
|
),
|
|
785
|
-
...
|
|
902
|
+
...o
|
|
786
903
|
)
|
|
787
904
|
);
|
|
788
905
|
}
|
|
789
|
-
function
|
|
790
|
-
const
|
|
906
|
+
function Ge(e, t, s, n, r, a) {
|
|
907
|
+
const o = [
|
|
791
908
|
"bc-button",
|
|
792
|
-
`
|
|
909
|
+
`bc-button--size-${t}`,
|
|
793
910
|
`bc-control--padding-${t}`,
|
|
794
|
-
`
|
|
911
|
+
`bc-control--rounded-${n}`
|
|
795
912
|
];
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
913
|
+
return a && o.push("bc-button--loading"), o.join(" ");
|
|
914
|
+
}
|
|
915
|
+
function We(e, t, s) {
|
|
916
|
+
const n = /* @__PURE__ */ new Map(), r = (a, o, i, l) => {
|
|
917
|
+
s || (n.set("--button-bg-hover", a), n.set("--button-text-hover", i), n.set("--button-bg-hover-dark", o), n.set("--button-text-hover-dark", l));
|
|
918
|
+
};
|
|
919
|
+
switch (e) {
|
|
920
|
+
case "filled": {
|
|
921
|
+
const a = O(t, "solid", "light"), o = O(t, "solid", "dark");
|
|
922
|
+
n.set("--button-bg", a.backgroundColor), n.set("--button-text", a.textColor), n.set("--button-bg-dark", o.backgroundColor), n.set("--button-text-dark", o.textColor);
|
|
923
|
+
const i = V(t, "solid", "light"), l = V(t, "solid", "dark");
|
|
924
|
+
r(
|
|
925
|
+
i.backgroundColor,
|
|
926
|
+
l.backgroundColor,
|
|
927
|
+
i.textColor,
|
|
928
|
+
l.textColor
|
|
929
|
+
);
|
|
799
930
|
break;
|
|
800
|
-
|
|
801
|
-
|
|
931
|
+
}
|
|
932
|
+
case "light": {
|
|
933
|
+
const a = O(t, "light", "light"), o = O(t, "light", "dark");
|
|
934
|
+
n.set("--button-bg", a.backgroundColor), n.set("--button-text", a.textColor), n.set("--button-bg-dark", o.backgroundColor), n.set("--button-text-dark", o.textColor);
|
|
935
|
+
const i = V(t, "light", "light"), l = V(t, "light", "dark");
|
|
936
|
+
r(
|
|
937
|
+
i.backgroundColor,
|
|
938
|
+
l.backgroundColor,
|
|
939
|
+
i.textColor,
|
|
940
|
+
l.textColor
|
|
941
|
+
);
|
|
802
942
|
break;
|
|
803
|
-
|
|
804
|
-
|
|
943
|
+
}
|
|
944
|
+
case "outline": {
|
|
945
|
+
n.set("--button-bg", "transparent"), n.set("--button-bg-dark", "transparent"), n.set("--button-border", se(t, "light")), n.set("--button-border-dark", se(t, "dark")), n.set("--button-text", j(t, "light")), n.set("--button-text-dark", j(t, "dark"));
|
|
946
|
+
const a = V(t, "light", "light"), o = V(t, "light", "dark");
|
|
947
|
+
r(
|
|
948
|
+
a.backgroundColor,
|
|
949
|
+
o.backgroundColor,
|
|
950
|
+
a.textColor,
|
|
951
|
+
o.textColor
|
|
952
|
+
);
|
|
805
953
|
break;
|
|
806
|
-
|
|
807
|
-
|
|
954
|
+
}
|
|
955
|
+
case "default": {
|
|
956
|
+
const a = O("neutral", "light", "light"), o = O("neutral", "light", "dark");
|
|
957
|
+
n.set("--button-bg", a.backgroundColor), n.set("--button-text", j(t, "light")), n.set("--button-bg-dark", o.backgroundColor), n.set("--button-text-dark", j(t, "dark"));
|
|
958
|
+
const i = V("base", "light", "light"), l = V("base", "light", "dark");
|
|
959
|
+
r(
|
|
960
|
+
i.backgroundColor,
|
|
961
|
+
l.backgroundColor,
|
|
962
|
+
n.get("--button-text") ?? a.textColor,
|
|
963
|
+
n.get("--button-text-dark") ?? o.textColor
|
|
964
|
+
);
|
|
808
965
|
break;
|
|
809
|
-
|
|
810
|
-
|
|
966
|
+
}
|
|
967
|
+
case "text": {
|
|
968
|
+
n.set("--button-bg", "transparent"), n.set("--button-bg-dark", "transparent"), n.set("--button-text", j(t, "light")), n.set("--button-text-dark", j(t, "dark")), s || n.set("--button-hover-decoration", "underline");
|
|
811
969
|
break;
|
|
970
|
+
}
|
|
812
971
|
}
|
|
813
|
-
return
|
|
972
|
+
return Array.from(n.entries()).map(([a, o]) => `${a}: ${o}`).join("; ");
|
|
814
973
|
}
|
|
815
|
-
function
|
|
974
|
+
function Ke({
|
|
816
975
|
type: e = "button",
|
|
817
976
|
disabled: t,
|
|
818
977
|
loading: s,
|
|
819
978
|
variant: n = "filled",
|
|
820
979
|
size: r = "md",
|
|
821
980
|
color: a = "base",
|
|
822
|
-
roundedness:
|
|
823
|
-
onClick:
|
|
981
|
+
roundedness: o = "sm",
|
|
982
|
+
onClick: i = () => {
|
|
824
983
|
}
|
|
825
984
|
}, ...l) {
|
|
826
|
-
const h =
|
|
827
|
-
return
|
|
828
|
-
|
|
829
|
-
(
|
|
985
|
+
const h = I(null);
|
|
986
|
+
return q(
|
|
987
|
+
R,
|
|
988
|
+
(u) => p.button(
|
|
830
989
|
c.type(e),
|
|
831
990
|
c.disabled(
|
|
832
|
-
|
|
991
|
+
k(
|
|
833
992
|
t,
|
|
834
993
|
s
|
|
835
|
-
)((
|
|
994
|
+
)((d, f) => d || f)
|
|
836
995
|
),
|
|
837
996
|
// Add ARIA attributes for accessibility
|
|
838
|
-
|
|
839
|
-
|
|
997
|
+
x.busy(s ?? !1),
|
|
998
|
+
_(s ?? !1, () => x.label(u.$.loadingExtended)),
|
|
840
999
|
c.class(
|
|
841
|
-
|
|
1000
|
+
k(
|
|
842
1001
|
n,
|
|
843
1002
|
r,
|
|
844
1003
|
a,
|
|
845
|
-
|
|
1004
|
+
o,
|
|
846
1005
|
t,
|
|
847
1006
|
s
|
|
848
1007
|
)(
|
|
849
|
-
(
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
1008
|
+
(d, f, m, w, g, S) => Ge(
|
|
1009
|
+
d ?? "filled",
|
|
1010
|
+
f ?? "md",
|
|
1011
|
+
m ?? "base",
|
|
1012
|
+
w ?? "sm",
|
|
1013
|
+
g,
|
|
1014
|
+
S
|
|
856
1015
|
)
|
|
857
1016
|
)
|
|
858
1017
|
),
|
|
859
|
-
|
|
1018
|
+
c.style(
|
|
1019
|
+
k(
|
|
1020
|
+
n,
|
|
1021
|
+
a,
|
|
1022
|
+
t
|
|
1023
|
+
)(
|
|
1024
|
+
(d, f, m) => We(
|
|
1025
|
+
d ?? "filled",
|
|
1026
|
+
f ?? "base",
|
|
1027
|
+
m
|
|
1028
|
+
)
|
|
1029
|
+
)
|
|
1030
|
+
),
|
|
1031
|
+
_(
|
|
860
1032
|
s ?? !1,
|
|
861
|
-
() =>
|
|
862
|
-
|
|
863
|
-
h.map((
|
|
1033
|
+
() => E(
|
|
1034
|
+
H.width(
|
|
1035
|
+
h.map((d) => d == null ? "" : `${d.width}px`)
|
|
864
1036
|
),
|
|
865
|
-
|
|
866
|
-
h.map((
|
|
1037
|
+
H.height(
|
|
1038
|
+
h.map((d) => d == null ? "" : `${d.height}px`)
|
|
867
1039
|
),
|
|
868
|
-
|
|
1040
|
+
F({ icon: "line-md:loading-twotone-loop", size: r ?? "md" }),
|
|
869
1041
|
// Hidden live region for screen reader announcements
|
|
870
1042
|
p.span(
|
|
871
1043
|
c.class("sr-only"),
|
|
872
|
-
|
|
873
|
-
|
|
1044
|
+
x.live("polite"),
|
|
1045
|
+
u.$.loadingExtended
|
|
874
1046
|
)
|
|
875
1047
|
),
|
|
876
|
-
() =>
|
|
1048
|
+
() => E(y.click(i), ...l)
|
|
877
1049
|
),
|
|
878
|
-
|
|
1050
|
+
_(
|
|
879
1051
|
s != null,
|
|
880
|
-
() =>
|
|
881
|
-
(
|
|
882
|
-
|
|
883
|
-
|
|
1052
|
+
() => Ce(
|
|
1053
|
+
(d) => oe(
|
|
1054
|
+
d.on((f) => {
|
|
1055
|
+
L.get(s ?? !1) || h.set(f);
|
|
884
1056
|
})
|
|
885
1057
|
)
|
|
886
1058
|
)
|
|
@@ -888,18 +1060,18 @@ function $e({
|
|
|
888
1060
|
)
|
|
889
1061
|
);
|
|
890
1062
|
}
|
|
891
|
-
function
|
|
1063
|
+
function wt({
|
|
892
1064
|
size: e = "sm",
|
|
893
1065
|
icon: t = "line-md:close",
|
|
894
1066
|
disabled: s,
|
|
895
1067
|
roundedness: n = "full",
|
|
896
1068
|
color: r = "base",
|
|
897
1069
|
onClick: a,
|
|
898
|
-
label:
|
|
899
|
-
}, ...
|
|
900
|
-
return
|
|
901
|
-
const h =
|
|
902
|
-
return
|
|
1070
|
+
label: o
|
|
1071
|
+
}, ...i) {
|
|
1072
|
+
return q(R, (l) => {
|
|
1073
|
+
const h = Q(o, l.$.closeModal);
|
|
1074
|
+
return Ke(
|
|
903
1075
|
{
|
|
904
1076
|
variant: "text",
|
|
905
1077
|
size: e,
|
|
@@ -909,13 +1081,13 @@ function nt({
|
|
|
909
1081
|
onClick: a
|
|
910
1082
|
},
|
|
911
1083
|
c.title(h),
|
|
912
|
-
|
|
913
|
-
...
|
|
914
|
-
|
|
1084
|
+
x.label(h),
|
|
1085
|
+
...i,
|
|
1086
|
+
F({ icon: t, size: e ?? "sm" })
|
|
915
1087
|
);
|
|
916
1088
|
});
|
|
917
1089
|
}
|
|
918
|
-
function
|
|
1090
|
+
function Je(e, t, s) {
|
|
919
1091
|
const n = [
|
|
920
1092
|
e ? "bc-base-input-container" : "bc-input-container"
|
|
921
1093
|
];
|
|
@@ -925,34 +1097,34 @@ function Ae(e, t, s) {
|
|
|
925
1097
|
e ? "bc-base-input-container--default" : "bc-input-container--default"
|
|
926
1098
|
), s && n.push("bc-input-container--error"), n.join(" ");
|
|
927
1099
|
}
|
|
928
|
-
const
|
|
1100
|
+
const W = ({
|
|
929
1101
|
baseContainer: e,
|
|
930
1102
|
disabled: t,
|
|
931
1103
|
input: s,
|
|
932
1104
|
before: n,
|
|
933
1105
|
after: r,
|
|
934
1106
|
hasError: a,
|
|
935
|
-
focusableSelector:
|
|
936
|
-
growInput:
|
|
1107
|
+
focusableSelector: o = "input, select, textarea",
|
|
1108
|
+
growInput: i = !0
|
|
937
1109
|
}, ...l) => {
|
|
938
|
-
const h =
|
|
1110
|
+
const h = L.map(t ?? !1, (u) => u);
|
|
939
1111
|
return p.div(
|
|
940
|
-
|
|
941
|
-
const
|
|
942
|
-
|
|
1112
|
+
ve((u) => {
|
|
1113
|
+
const d = () => {
|
|
1114
|
+
u.querySelector(o)?.focus();
|
|
943
1115
|
};
|
|
944
|
-
return
|
|
1116
|
+
return u.addEventListener("click", d), oe(() => u.removeEventListener("click", d));
|
|
945
1117
|
}),
|
|
946
1118
|
c.class(
|
|
947
|
-
|
|
1119
|
+
k(
|
|
948
1120
|
e,
|
|
949
1121
|
h,
|
|
950
1122
|
a ?? !1
|
|
951
1123
|
)(
|
|
952
|
-
(
|
|
953
|
-
d ?? !1,
|
|
1124
|
+
(u, d, f) => Je(
|
|
954
1125
|
u ?? !1,
|
|
955
|
-
|
|
1126
|
+
d ?? !1,
|
|
1127
|
+
f ?? !1
|
|
956
1128
|
)
|
|
957
1129
|
)
|
|
958
1130
|
),
|
|
@@ -960,9 +1132,9 @@ const R = ({
|
|
|
960
1132
|
p.div(
|
|
961
1133
|
c.class("bc-input-container__input"),
|
|
962
1134
|
c.class(
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
(
|
|
1135
|
+
L.map(
|
|
1136
|
+
i,
|
|
1137
|
+
(u) => u ? "bc-input-container__input--grow" : ""
|
|
966
1138
|
)
|
|
967
1139
|
),
|
|
968
1140
|
s
|
|
@@ -971,18 +1143,18 @@ const R = ({
|
|
|
971
1143
|
...l
|
|
972
1144
|
);
|
|
973
1145
|
};
|
|
974
|
-
function
|
|
1146
|
+
function K(e) {
|
|
975
1147
|
return `bc-label bc-label--${e}`;
|
|
976
1148
|
}
|
|
977
|
-
const
|
|
978
|
-
const { value: t, onBlur: s, onChange: n, placeholder: r, disabled: a, id:
|
|
979
|
-
if (
|
|
980
|
-
const
|
|
981
|
-
n?.(!
|
|
982
|
-
},
|
|
983
|
-
|
|
1149
|
+
const Ct = (...e) => p.span(c.class(K("emphasis")), ...e), Qe = (...e) => p.span(c.class(K("default")), ...e), Ye = (...e) => p.span(c.class(K("muted")), ...e), xt = (...e) => p.span(c.class(K("error")), ...e), St = (e) => {
|
|
1150
|
+
const { value: t, onBlur: s, onChange: n, placeholder: r, disabled: a, id: o } = e, i = o ?? le("checkbox"), l = `${i}-label`, h = () => {
|
|
1151
|
+
if (L.get(a ?? !1)) return;
|
|
1152
|
+
const d = L.get(t);
|
|
1153
|
+
n?.(!d);
|
|
1154
|
+
}, u = (d) => {
|
|
1155
|
+
L.get(a ?? !1) || (d.key === " " || d.key === "Enter") && (d.preventDefault(), h());
|
|
984
1156
|
};
|
|
985
|
-
return
|
|
1157
|
+
return W(
|
|
986
1158
|
{
|
|
987
1159
|
baseContainer: !0,
|
|
988
1160
|
growInput: !1,
|
|
@@ -992,93 +1164,94 @@ const rt = (...e) => p.span(c.class(H("emphasis")), ...e), xe = (...e) => p.span
|
|
|
992
1164
|
p.span(
|
|
993
1165
|
c.class("bc-checkbox-input__checkbox"),
|
|
994
1166
|
c.class(
|
|
995
|
-
|
|
1167
|
+
L.map(
|
|
996
1168
|
t,
|
|
997
|
-
(
|
|
1169
|
+
(d) => d ? "bc-checkbox-input__checkbox--checked" : ""
|
|
998
1170
|
)
|
|
999
1171
|
),
|
|
1000
1172
|
c.class(
|
|
1001
|
-
|
|
1173
|
+
L.map(
|
|
1002
1174
|
a ?? !1,
|
|
1003
|
-
(
|
|
1175
|
+
(d) => d ? "bc-checkbox-input__checkbox--disabled" : ""
|
|
1004
1176
|
)
|
|
1005
1177
|
),
|
|
1006
|
-
c.id(
|
|
1178
|
+
c.id(i),
|
|
1007
1179
|
c.role("checkbox"),
|
|
1008
1180
|
c.tabindex(
|
|
1009
|
-
|
|
1181
|
+
L.map(
|
|
1010
1182
|
a ?? !1,
|
|
1011
|
-
(
|
|
1183
|
+
(d) => d ? -1 : 0
|
|
1012
1184
|
)
|
|
1013
1185
|
),
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
r != null ?
|
|
1017
|
-
y.keydown(
|
|
1186
|
+
x.checked(t),
|
|
1187
|
+
x.disabled(a),
|
|
1188
|
+
r != null ? x.labelledby(l) : v,
|
|
1189
|
+
y.keydown(u),
|
|
1018
1190
|
s != null ? y.blur(s) : v
|
|
1019
1191
|
),
|
|
1020
1192
|
r != null ? p.label(
|
|
1021
1193
|
c.class("bc-checkbox-input__label"),
|
|
1022
1194
|
c.id(l),
|
|
1023
|
-
c.for(
|
|
1024
|
-
|
|
1195
|
+
c.for(i),
|
|
1196
|
+
Ye(r)
|
|
1025
1197
|
) : v
|
|
1026
1198
|
)
|
|
1027
1199
|
},
|
|
1028
1200
|
y.click(h)
|
|
1029
1201
|
);
|
|
1030
|
-
},
|
|
1202
|
+
}, Z = ({
|
|
1031
1203
|
autocomplete: e,
|
|
1032
1204
|
autofocus: t,
|
|
1033
1205
|
class: s,
|
|
1034
1206
|
disabled: n,
|
|
1035
1207
|
name: r,
|
|
1036
1208
|
placeholder: a,
|
|
1037
|
-
id:
|
|
1038
|
-
required:
|
|
1209
|
+
id: o,
|
|
1210
|
+
required: i,
|
|
1039
1211
|
hasError: l
|
|
1040
|
-
}) =>
|
|
1212
|
+
}) => E(
|
|
1041
1213
|
c.autocomplete(e),
|
|
1042
1214
|
c.autofocus(t),
|
|
1043
1215
|
c.class(s),
|
|
1044
1216
|
c.disabled(n),
|
|
1045
|
-
c.name(r ??
|
|
1217
|
+
c.name(r ?? o),
|
|
1046
1218
|
c.placeholder(a),
|
|
1047
|
-
c.id(
|
|
1048
|
-
|
|
1049
|
-
l != null ?
|
|
1219
|
+
c.id(o),
|
|
1220
|
+
x.required(i),
|
|
1221
|
+
l != null ? x.invalid(
|
|
1050
1222
|
l ?? !1
|
|
1051
1223
|
) : null
|
|
1052
|
-
),
|
|
1224
|
+
), Ze = p.span(
|
|
1053
1225
|
c.class("bc-input-wrapper__required"),
|
|
1054
1226
|
" *"
|
|
1055
1227
|
);
|
|
1056
|
-
function
|
|
1228
|
+
function Xe(e) {
|
|
1057
1229
|
const t = ["bc-input-wrapper"];
|
|
1058
1230
|
return e && t.push("bc-input-wrapper--horizontal"), t.join(" ");
|
|
1059
1231
|
}
|
|
1060
|
-
function
|
|
1232
|
+
function et(e, t) {
|
|
1061
1233
|
const s = ["bc-input-wrapper__label-text"];
|
|
1062
1234
|
return e ? s.push("bc-input-wrapper__label-text--error") : t ? s.push("bc-input-wrapper__label-text--disabled") : s.push("bc-input-wrapper__label-text--default"), s.join(" ");
|
|
1063
1235
|
}
|
|
1064
|
-
const
|
|
1236
|
+
const pe = ({
|
|
1065
1237
|
required: e,
|
|
1066
1238
|
label: t,
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1239
|
+
labelChildren: s,
|
|
1240
|
+
context: n,
|
|
1241
|
+
description: r,
|
|
1242
|
+
content: a,
|
|
1243
|
+
error: o,
|
|
1071
1244
|
labelFor: i,
|
|
1072
|
-
hasError:
|
|
1073
|
-
disabled:
|
|
1074
|
-
horizontal:
|
|
1245
|
+
hasError: l,
|
|
1246
|
+
disabled: h,
|
|
1247
|
+
horizontal: u
|
|
1075
1248
|
}, ...d) => {
|
|
1076
|
-
const
|
|
1249
|
+
const f = l ?? o != null, m = h ?? !1, w = u ?? !1, g = le("input-wrapper"), S = r ? `${g}-description` : void 0, P = o != null ? `${g}-error` : void 0;
|
|
1077
1250
|
return p.div(
|
|
1078
1251
|
c.class(
|
|
1079
|
-
|
|
1252
|
+
L.map(w, (T) => Xe(T))
|
|
1080
1253
|
),
|
|
1081
|
-
t != null ||
|
|
1254
|
+
t != null || n != null ? p.div(
|
|
1082
1255
|
c.class("bc-input-wrapper__header"),
|
|
1083
1256
|
p.div(
|
|
1084
1257
|
c.class("bc-input-wrapper__label-section"),
|
|
@@ -1087,81 +1260,79 @@ const re = ({
|
|
|
1087
1260
|
i != null ? c.for(i) : v,
|
|
1088
1261
|
p.span(
|
|
1089
1262
|
c.class(
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1263
|
+
k(
|
|
1264
|
+
f,
|
|
1265
|
+
m
|
|
1093
1266
|
)(
|
|
1094
|
-
(
|
|
1095
|
-
|
|
1096
|
-
|
|
1267
|
+
(T, $) => et(
|
|
1268
|
+
T ?? !1,
|
|
1269
|
+
$ ?? !1
|
|
1097
1270
|
)
|
|
1098
1271
|
)
|
|
1099
1272
|
),
|
|
1100
1273
|
t
|
|
1101
1274
|
),
|
|
1102
|
-
t != null && e ?
|
|
1275
|
+
t != null && e ? Ze : v
|
|
1103
1276
|
),
|
|
1104
1277
|
// Show description under label when horizontal
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
)((
|
|
1278
|
+
_(
|
|
1279
|
+
k(
|
|
1280
|
+
w,
|
|
1281
|
+
r
|
|
1282
|
+
)((T, $) => T && $ != null),
|
|
1110
1283
|
() => p.div(
|
|
1111
1284
|
c.class(
|
|
1112
1285
|
"bc-input-wrapper__description bc-input-wrapper__description--under-label"
|
|
1113
1286
|
),
|
|
1114
|
-
c.id(
|
|
1115
|
-
|
|
1287
|
+
c.id(S),
|
|
1288
|
+
r
|
|
1116
1289
|
)
|
|
1117
1290
|
)
|
|
1118
1291
|
),
|
|
1119
|
-
|
|
1292
|
+
n != null ? Qe(n) : v,
|
|
1293
|
+
s
|
|
1120
1294
|
) : v,
|
|
1121
1295
|
p.div(
|
|
1122
1296
|
c.class("bc-input-wrapper__content"),
|
|
1123
1297
|
// Add data attributes to help inputs inherit accessibility information
|
|
1124
|
-
[
|
|
1125
|
-
[
|
|
1298
|
+
[S, P].filter(Boolean).length > 0 ? J.describedby(
|
|
1299
|
+
[S, P].filter(Boolean).join(" ")
|
|
1126
1300
|
) : v,
|
|
1127
|
-
e ?
|
|
1128
|
-
|
|
1129
|
-
|
|
1301
|
+
e ? J.required("true") : v,
|
|
1302
|
+
_(f, () => J.invalid("true")),
|
|
1303
|
+
a
|
|
1130
1304
|
),
|
|
1131
1305
|
// Show description at bottom only when not horizontal
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
)((
|
|
1306
|
+
_(
|
|
1307
|
+
k(
|
|
1308
|
+
w,
|
|
1309
|
+
r
|
|
1310
|
+
)((T, $) => !T && $ != null),
|
|
1137
1311
|
() => p.div(
|
|
1138
1312
|
c.class("bc-input-wrapper__description"),
|
|
1139
|
-
c.id(
|
|
1140
|
-
|
|
1313
|
+
c.id(S),
|
|
1314
|
+
r
|
|
1141
1315
|
)
|
|
1142
1316
|
),
|
|
1143
|
-
|
|
1144
|
-
|
|
1317
|
+
o != null ? _(
|
|
1318
|
+
f,
|
|
1145
1319
|
() => p.div(
|
|
1146
1320
|
c.class("bc-input-wrapper__error"),
|
|
1147
|
-
c.id(
|
|
1148
|
-
|
|
1321
|
+
c.id(P),
|
|
1322
|
+
x.live("polite"),
|
|
1149
1323
|
// Announce errors to screen readers
|
|
1150
1324
|
c.role("alert"),
|
|
1151
1325
|
// Mark as alert for immediate attention
|
|
1152
|
-
|
|
1326
|
+
o
|
|
1153
1327
|
)
|
|
1154
1328
|
) : null,
|
|
1155
1329
|
...d
|
|
1156
1330
|
);
|
|
1157
1331
|
};
|
|
1158
|
-
function
|
|
1159
|
-
return p.div(c.class("bc-group"), ...e);
|
|
1160
|
-
}
|
|
1161
|
-
function lt(...e) {
|
|
1332
|
+
function Dt(...e) {
|
|
1162
1333
|
return p.div(c.class("bc-stack"), ...e);
|
|
1163
1334
|
}
|
|
1164
|
-
const
|
|
1335
|
+
const It = (e) => {
|
|
1165
1336
|
const t = {
|
|
1166
1337
|
name: "email",
|
|
1167
1338
|
autocomplete: "email",
|
|
@@ -1171,111 +1342,111 @@ const ct = (e) => {
|
|
|
1171
1342
|
before: n,
|
|
1172
1343
|
onBlur: r,
|
|
1173
1344
|
onChange: a,
|
|
1174
|
-
onInput:
|
|
1175
|
-
placeholder:
|
|
1176
|
-
} = t, l = n ??
|
|
1345
|
+
onInput: o,
|
|
1346
|
+
placeholder: i
|
|
1347
|
+
} = t, l = n ?? F({
|
|
1177
1348
|
icon: "line-md:email",
|
|
1178
1349
|
size: "sm",
|
|
1179
1350
|
color: "neutral"
|
|
1180
1351
|
});
|
|
1181
|
-
return
|
|
1182
|
-
|
|
1183
|
-
(h) =>
|
|
1352
|
+
return q(
|
|
1353
|
+
R,
|
|
1354
|
+
(h) => W({
|
|
1184
1355
|
...e,
|
|
1185
1356
|
before: l,
|
|
1186
|
-
input:
|
|
1187
|
-
|
|
1188
|
-
c.placeholder(
|
|
1357
|
+
input: ie.email(
|
|
1358
|
+
Z(t),
|
|
1359
|
+
c.placeholder(Q(i, h.$.emailPlaceholderText)),
|
|
1189
1360
|
c.value(s),
|
|
1190
1361
|
c.class("bc-input"),
|
|
1191
|
-
r != null ? y.blur(
|
|
1192
|
-
a != null ? y.change(
|
|
1193
|
-
|
|
1362
|
+
r != null ? y.blur(M(r)) : v,
|
|
1363
|
+
a != null ? y.change(M(a)) : v,
|
|
1364
|
+
o != null ? y.input(M(o)) : v
|
|
1194
1365
|
)
|
|
1195
1366
|
})
|
|
1196
1367
|
);
|
|
1197
|
-
},
|
|
1368
|
+
}, _t = (e) => {
|
|
1198
1369
|
const { value: t, onBlur: s, onChange: n, onInput: r } = e;
|
|
1199
|
-
return
|
|
1370
|
+
return W({
|
|
1200
1371
|
...e,
|
|
1201
|
-
input:
|
|
1202
|
-
|
|
1372
|
+
input: ie.text(
|
|
1373
|
+
Z(e),
|
|
1203
1374
|
c.value(t),
|
|
1204
1375
|
c.class("bc-input"),
|
|
1205
|
-
s != null ? y.blur(
|
|
1206
|
-
n != null ? y.change(
|
|
1207
|
-
r != null ? y.input(
|
|
1376
|
+
s != null ? y.blur(M(s)) : v,
|
|
1377
|
+
n != null ? y.change(M(n)) : v,
|
|
1378
|
+
r != null ? y.input(M(r)) : v
|
|
1208
1379
|
)
|
|
1209
1380
|
});
|
|
1210
|
-
},
|
|
1381
|
+
}, Et = (e) => {
|
|
1211
1382
|
const {
|
|
1212
1383
|
value: t,
|
|
1213
1384
|
onBlur: s,
|
|
1214
1385
|
onChange: n,
|
|
1215
1386
|
onInput: r,
|
|
1216
1387
|
before: a,
|
|
1217
|
-
after:
|
|
1218
|
-
hasError:
|
|
1388
|
+
after: o,
|
|
1389
|
+
hasError: i,
|
|
1219
1390
|
disabled: l,
|
|
1220
1391
|
autocomplete: h,
|
|
1221
|
-
placeholder:
|
|
1222
|
-
...
|
|
1223
|
-
} = e,
|
|
1392
|
+
placeholder: u,
|
|
1393
|
+
...d
|
|
1394
|
+
} = e, f = {
|
|
1224
1395
|
name: "password",
|
|
1225
1396
|
disabled: l,
|
|
1226
|
-
...
|
|
1227
|
-
},
|
|
1228
|
-
|
|
1397
|
+
...d
|
|
1398
|
+
}, m = I(!0), w = k(
|
|
1399
|
+
m,
|
|
1229
1400
|
h
|
|
1230
|
-
)((
|
|
1231
|
-
return
|
|
1232
|
-
const
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
)((
|
|
1237
|
-
c.class("bc-input-container__password-toggle
|
|
1238
|
-
|
|
1239
|
-
y.click(() =>
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
() =>
|
|
1243
|
-
() =>
|
|
1401
|
+
)((g, S) => g ? S ?? "current-password" : "off");
|
|
1402
|
+
return q(R, (g) => {
|
|
1403
|
+
const S = k(
|
|
1404
|
+
g.$.passwordPlaceholderText,
|
|
1405
|
+
m,
|
|
1406
|
+
u
|
|
1407
|
+
)((T, $, me) => $ ? "•••••••••••••••" : me ?? T), P = p.button(
|
|
1408
|
+
c.class("bc-input-container__password-toggle"),
|
|
1409
|
+
x.label(g.$.togglePasswordVisibility),
|
|
1410
|
+
y.click(() => m.update((T) => !T)),
|
|
1411
|
+
_(
|
|
1412
|
+
m,
|
|
1413
|
+
() => F({ icon: "line-md:watch" }),
|
|
1414
|
+
() => F({ icon: "line-md:watch-off" })
|
|
1244
1415
|
)
|
|
1245
1416
|
);
|
|
1246
|
-
return
|
|
1417
|
+
return W({
|
|
1247
1418
|
before: a,
|
|
1248
1419
|
disabled: l,
|
|
1249
|
-
hasError:
|
|
1420
|
+
hasError: i,
|
|
1250
1421
|
input: p.input(
|
|
1251
|
-
|
|
1252
|
-
...
|
|
1253
|
-
autocomplete:
|
|
1254
|
-
placeholder:
|
|
1422
|
+
Z({
|
|
1423
|
+
...f,
|
|
1424
|
+
autocomplete: w,
|
|
1425
|
+
placeholder: S
|
|
1255
1426
|
}),
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
() =>
|
|
1259
|
-
() =>
|
|
1427
|
+
_(
|
|
1428
|
+
m,
|
|
1429
|
+
() => E(c.type("password")),
|
|
1430
|
+
() => E(c.type("text"))
|
|
1260
1431
|
),
|
|
1261
1432
|
c.class("bc-input"),
|
|
1262
1433
|
c.value(t),
|
|
1263
|
-
s != null ? y.blur(
|
|
1264
|
-
n != null ? y.change(
|
|
1265
|
-
r != null ? y.input(
|
|
1434
|
+
s != null ? y.blur(M(s)) : v,
|
|
1435
|
+
n != null ? y.change(M(n)) : v,
|
|
1436
|
+
r != null ? y.input(M(r)) : v
|
|
1266
1437
|
),
|
|
1267
|
-
after:
|
|
1438
|
+
after: o != null ? E(P, o) : P
|
|
1268
1439
|
});
|
|
1269
1440
|
});
|
|
1270
|
-
},
|
|
1441
|
+
}, tt = (
|
|
1271
1442
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1272
1443
|
(e, t) => () => {
|
|
1273
1444
|
e.markTouched(), t?.();
|
|
1274
1445
|
}
|
|
1275
|
-
),
|
|
1446
|
+
), st = (e, t) => (s) => {
|
|
1276
1447
|
e.change(s), t?.(s);
|
|
1277
1448
|
};
|
|
1278
|
-
function
|
|
1449
|
+
function fe(e, t) {
|
|
1279
1450
|
const { controller: s, onBlur: n, onChange: r, ...a } = t;
|
|
1280
1451
|
return e({
|
|
1281
1452
|
id: s.name,
|
|
@@ -1283,15 +1454,15 @@ function ae(e, t) {
|
|
|
1283
1454
|
value: s.value,
|
|
1284
1455
|
hasError: s.errorVisible,
|
|
1285
1456
|
...a,
|
|
1286
|
-
onChange:
|
|
1287
|
-
onBlur:
|
|
1457
|
+
onChange: st(s, r),
|
|
1458
|
+
onBlur: tt(s, n)
|
|
1288
1459
|
});
|
|
1289
1460
|
}
|
|
1290
|
-
function
|
|
1291
|
-
return
|
|
1461
|
+
function Tt(e, t, ...s) {
|
|
1462
|
+
return pe(
|
|
1292
1463
|
{
|
|
1293
1464
|
...t,
|
|
1294
|
-
content:
|
|
1465
|
+
content: fe(
|
|
1295
1466
|
e,
|
|
1296
1467
|
t
|
|
1297
1468
|
)
|
|
@@ -1299,40 +1470,40 @@ function ht(e, t, ...s) {
|
|
|
1299
1470
|
...s
|
|
1300
1471
|
);
|
|
1301
1472
|
}
|
|
1302
|
-
function
|
|
1303
|
-
const { toInput: s, fromInput: n, controller: r, ...a } = t,
|
|
1304
|
-
return
|
|
1473
|
+
function nt(e, t) {
|
|
1474
|
+
const { toInput: s, fromInput: n, controller: r, ...a } = t, o = r.transform(s, n);
|
|
1475
|
+
return fe(e, {
|
|
1305
1476
|
...a,
|
|
1306
|
-
controller:
|
|
1477
|
+
controller: o
|
|
1307
1478
|
});
|
|
1308
1479
|
}
|
|
1309
|
-
function
|
|
1310
|
-
return
|
|
1480
|
+
function Lt(e, t, ...s) {
|
|
1481
|
+
return pe(
|
|
1311
1482
|
{
|
|
1312
1483
|
...t,
|
|
1313
|
-
content:
|
|
1484
|
+
content: nt(e, t)
|
|
1314
1485
|
},
|
|
1315
1486
|
...s
|
|
1316
1487
|
);
|
|
1317
1488
|
}
|
|
1318
|
-
function
|
|
1489
|
+
function Mt(e) {
|
|
1319
1490
|
return e.split(".").map((s) => {
|
|
1320
1491
|
const n = s.match(/^\[(\d+)\]$/);
|
|
1321
1492
|
return n ? Number(n[1]) : s;
|
|
1322
1493
|
});
|
|
1323
1494
|
}
|
|
1324
|
-
function
|
|
1495
|
+
function rt(e) {
|
|
1325
1496
|
return typeof e == "number" ? `[${e}]` : `.${e}`;
|
|
1326
1497
|
}
|
|
1327
|
-
function
|
|
1498
|
+
function at(e) {
|
|
1328
1499
|
if (e.length === 0) return "";
|
|
1329
1500
|
const [t, ...s] = e;
|
|
1330
1501
|
return [
|
|
1331
1502
|
typeof t == "number" ? `[${t}]` : t,
|
|
1332
|
-
...s.map(
|
|
1503
|
+
...s.map(rt)
|
|
1333
1504
|
].join("");
|
|
1334
1505
|
}
|
|
1335
|
-
function
|
|
1506
|
+
function G(e) {
|
|
1336
1507
|
return function(s) {
|
|
1337
1508
|
if (s.type === "valid") return s;
|
|
1338
1509
|
let n = s.error;
|
|
@@ -1341,7 +1512,7 @@ function q(e) {
|
|
|
1341
1512
|
return D.invalid(n);
|
|
1342
1513
|
};
|
|
1343
1514
|
}
|
|
1344
|
-
class
|
|
1515
|
+
class A {
|
|
1345
1516
|
path;
|
|
1346
1517
|
change;
|
|
1347
1518
|
value;
|
|
@@ -1353,42 +1524,42 @@ class x {
|
|
|
1353
1524
|
dirty;
|
|
1354
1525
|
dependencyErrors;
|
|
1355
1526
|
#e = {
|
|
1356
|
-
disabled:
|
|
1357
|
-
touched:
|
|
1527
|
+
disabled: I(!1),
|
|
1528
|
+
touched: I(!1)
|
|
1358
1529
|
};
|
|
1359
1530
|
#s;
|
|
1360
|
-
#t =
|
|
1531
|
+
#t = I(void 0);
|
|
1361
1532
|
parent;
|
|
1362
1533
|
disabled;
|
|
1363
1534
|
#n = [];
|
|
1364
1535
|
disabledOrHasErrors;
|
|
1365
|
-
constructor(t, s, n, r, a,
|
|
1366
|
-
this.path = t, this.change = s, this.value = n, this.status = r, this.#s =
|
|
1367
|
-
(
|
|
1368
|
-
), this.hasError = this.error.map((
|
|
1536
|
+
constructor(t, s, n, r, a, o = N) {
|
|
1537
|
+
this.path = t, this.change = s, this.value = n, this.status = r, this.#s = o, this.#t.set(n.value), this.error = r.map(
|
|
1538
|
+
(i) => i?.type === "invalid" ? i.error?.message : void 0
|
|
1539
|
+
), this.hasError = this.error.map((i) => i != null), this.touched = this.#e.touched, a.validationMode ? this.errorVisible = k(
|
|
1369
1540
|
this.hasError,
|
|
1370
1541
|
this.touched,
|
|
1371
1542
|
a.validationMode
|
|
1372
|
-
)((
|
|
1543
|
+
)((i, l, h) => h === "continuous" ? !!i : !!i && !!l) : this.errorVisible = k(
|
|
1373
1544
|
this.hasError,
|
|
1374
1545
|
this.touched
|
|
1375
|
-
)((
|
|
1546
|
+
)((i, l) => !!i && !!l), this.dirty = k(
|
|
1376
1547
|
this.value,
|
|
1377
1548
|
this.#t
|
|
1378
|
-
)((
|
|
1379
|
-
(
|
|
1380
|
-
), this.parent = a, this.disabled =
|
|
1549
|
+
)((i, l) => !this.#s(i, l)), this.dependencyErrors = r.map(
|
|
1550
|
+
(i) => i?.type === "invalid" ? i.error?.dependencies : void 0
|
|
1551
|
+
), this.parent = a, this.disabled = k(
|
|
1381
1552
|
this.#e.disabled,
|
|
1382
1553
|
a.disabled
|
|
1383
|
-
)((
|
|
1554
|
+
)((i, l) => i || l), this.disabledOrHasErrors = k(
|
|
1384
1555
|
this.disabled,
|
|
1385
1556
|
this.hasError
|
|
1386
|
-
)((
|
|
1557
|
+
)((i, l) => i || l), this.onDispose(() => {
|
|
1387
1558
|
this.#e.disabled.dispose(), this.#e.touched.dispose(), this.disabled.dispose(), this.error.dispose(), this.errorVisible.dispose(), this.dirty.dispose(), this.#t.dispose(), this.dependencyErrors.dispose(), this.disabledOrHasErrors.dispose();
|
|
1388
1559
|
});
|
|
1389
1560
|
}
|
|
1390
1561
|
get name() {
|
|
1391
|
-
return
|
|
1562
|
+
return at(this.path);
|
|
1392
1563
|
}
|
|
1393
1564
|
onDispose = (t) => {
|
|
1394
1565
|
this.#n.push(t);
|
|
@@ -1419,7 +1590,7 @@ class x {
|
|
|
1419
1590
|
reset = () => {
|
|
1420
1591
|
this.change(this.#t.value);
|
|
1421
1592
|
};
|
|
1422
|
-
array = (t =
|
|
1593
|
+
array = (t = N) => new it(
|
|
1423
1594
|
this.path,
|
|
1424
1595
|
this.change,
|
|
1425
1596
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1428,7 +1599,7 @@ class x {
|
|
|
1428
1599
|
this.parent,
|
|
1429
1600
|
t
|
|
1430
1601
|
);
|
|
1431
|
-
object = (t =
|
|
1602
|
+
object = (t = N) => new ot(
|
|
1432
1603
|
this.path,
|
|
1433
1604
|
this.change,
|
|
1434
1605
|
this.value,
|
|
@@ -1436,35 +1607,35 @@ class x {
|
|
|
1436
1607
|
this.parent,
|
|
1437
1608
|
t
|
|
1438
1609
|
);
|
|
1439
|
-
transform = (t, s, n = [], r =
|
|
1610
|
+
transform = (t, s, n = [], r = N) => new A(
|
|
1440
1611
|
[...this.path, ...n],
|
|
1441
1612
|
(a) => this.change(s(a)),
|
|
1442
1613
|
this.value.map(t, r),
|
|
1443
|
-
this.status.map(
|
|
1614
|
+
this.status.map(G(n)),
|
|
1444
1615
|
this.parent,
|
|
1445
1616
|
r
|
|
1446
1617
|
);
|
|
1447
|
-
asyncTransform = (t, s, n, r = [], a =
|
|
1618
|
+
asyncTransform = (t, s, n, r = [], a = N) => new A(
|
|
1448
1619
|
[...this.path, ...r],
|
|
1449
|
-
(
|
|
1450
|
-
s(
|
|
1620
|
+
(o) => {
|
|
1621
|
+
s(o).then((i) => this.change(i));
|
|
1451
1622
|
},
|
|
1452
1623
|
this.value.mapAsync(t, n, void 0, a),
|
|
1453
|
-
this.status.map(
|
|
1624
|
+
this.status.map(G(r)),
|
|
1454
1625
|
this.parent,
|
|
1455
1626
|
a
|
|
1456
1627
|
);
|
|
1457
1628
|
}
|
|
1458
|
-
class
|
|
1629
|
+
class ot extends A {
|
|
1459
1630
|
#e = /* @__PURE__ */ new Map();
|
|
1460
1631
|
#s = /* @__PURE__ */ new Map();
|
|
1461
1632
|
#t = /* @__PURE__ */ new Map();
|
|
1462
|
-
#n =
|
|
1633
|
+
#n = I(!1);
|
|
1463
1634
|
touchedDeep = this.#n;
|
|
1464
1635
|
#a = /* @__PURE__ */ new Map();
|
|
1465
1636
|
#r = /* @__PURE__ */ new Map();
|
|
1466
|
-
#
|
|
1467
|
-
dirtyDeep = this.#
|
|
1637
|
+
#i = I(!1);
|
|
1638
|
+
dirtyDeep = this.#i;
|
|
1468
1639
|
#c;
|
|
1469
1640
|
#u;
|
|
1470
1641
|
#l = () => {
|
|
@@ -1476,20 +1647,20 @@ class He extends x {
|
|
|
1476
1647
|
}
|
|
1477
1648
|
this.#n.set(this.touched.value || t);
|
|
1478
1649
|
};
|
|
1479
|
-
constructor(t, s, n, r, a,
|
|
1650
|
+
constructor(t, s, n, r, a, o) {
|
|
1480
1651
|
super(
|
|
1481
1652
|
t,
|
|
1482
1653
|
s,
|
|
1483
|
-
n.map((l) => l ?? {},
|
|
1654
|
+
n.map((l) => l ?? {}, o),
|
|
1484
1655
|
r,
|
|
1485
1656
|
a,
|
|
1486
|
-
|
|
1657
|
+
o
|
|
1487
1658
|
), this.#c = this.touched.on(() => {
|
|
1488
1659
|
this.#l();
|
|
1489
1660
|
}), this.#u = this.dirty.on(() => {
|
|
1490
|
-
this.#
|
|
1661
|
+
this.#o();
|
|
1491
1662
|
});
|
|
1492
|
-
const
|
|
1663
|
+
const i = this.value.on(() => this.#o());
|
|
1493
1664
|
this.onDispose(() => {
|
|
1494
1665
|
for (const l of this.#e.values())
|
|
1495
1666
|
l.dispose();
|
|
@@ -1497,22 +1668,22 @@ class He extends x {
|
|
|
1497
1668
|
for (const l of this.#t.values()) l();
|
|
1498
1669
|
this.#t.clear(), this.#s.clear(), this.#n.dispose();
|
|
1499
1670
|
for (const l of this.#r.values()) l();
|
|
1500
|
-
this.#r.clear(), this.#a.clear(), this.#
|
|
1671
|
+
this.#r.clear(), this.#a.clear(), this.#i.dispose(), this.#c(), this.#u(), i();
|
|
1501
1672
|
});
|
|
1502
1673
|
}
|
|
1503
1674
|
field = (t) => {
|
|
1504
1675
|
if (this.#e.has(t))
|
|
1505
1676
|
return this.#e.get(t);
|
|
1506
|
-
const s = async (
|
|
1677
|
+
const s = async (o) => {
|
|
1507
1678
|
this.change({
|
|
1508
1679
|
...this.value.value,
|
|
1509
|
-
[t]:
|
|
1680
|
+
[t]: o
|
|
1510
1681
|
});
|
|
1511
|
-
}, n = new
|
|
1682
|
+
}, n = new A(
|
|
1512
1683
|
[...this.path, t],
|
|
1513
1684
|
s,
|
|
1514
|
-
this.value.map((
|
|
1515
|
-
this.status.map(
|
|
1685
|
+
this.value.map((o) => o[t]),
|
|
1686
|
+
this.status.map(G([t])),
|
|
1516
1687
|
{
|
|
1517
1688
|
disabled: this.disabled,
|
|
1518
1689
|
// propagate validationMode to children if present
|
|
@@ -1520,12 +1691,12 @@ class He extends x {
|
|
|
1520
1691
|
}
|
|
1521
1692
|
);
|
|
1522
1693
|
this.#e.set(t, n);
|
|
1523
|
-
const r = n.touched.on((
|
|
1524
|
-
this.#s.set(t,
|
|
1694
|
+
const r = n.touched.on((o) => {
|
|
1695
|
+
this.#s.set(t, o), this.#l();
|
|
1525
1696
|
});
|
|
1526
1697
|
this.#t.set(t, r);
|
|
1527
|
-
const a = n.dirty.on((
|
|
1528
|
-
this.#a.set(t,
|
|
1698
|
+
const a = n.dirty.on((o) => {
|
|
1699
|
+
this.#a.set(t, o), this.#o();
|
|
1529
1700
|
});
|
|
1530
1701
|
return this.#r.set(t, a), n;
|
|
1531
1702
|
};
|
|
@@ -1545,27 +1716,27 @@ class He extends x {
|
|
|
1545
1716
|
for (const s of this.#e.values())
|
|
1546
1717
|
s.markPristine?.();
|
|
1547
1718
|
};
|
|
1548
|
-
#
|
|
1719
|
+
#o = () => {
|
|
1549
1720
|
let t = !1;
|
|
1550
1721
|
for (const s of this.#a.values())
|
|
1551
1722
|
if (s) {
|
|
1552
1723
|
t = !0;
|
|
1553
1724
|
break;
|
|
1554
1725
|
}
|
|
1555
|
-
this.#
|
|
1726
|
+
this.#i.set(this.dirty.value || t);
|
|
1556
1727
|
};
|
|
1557
1728
|
}
|
|
1558
|
-
class
|
|
1729
|
+
class it extends A {
|
|
1559
1730
|
#e = new Array();
|
|
1560
1731
|
length;
|
|
1561
1732
|
#s = /* @__PURE__ */ new Map();
|
|
1562
1733
|
#t = /* @__PURE__ */ new Map();
|
|
1563
|
-
#n =
|
|
1734
|
+
#n = I(!1);
|
|
1564
1735
|
touchedDeep = this.#n;
|
|
1565
1736
|
#a = /* @__PURE__ */ new Map();
|
|
1566
1737
|
#r = /* @__PURE__ */ new Map();
|
|
1567
|
-
#
|
|
1568
|
-
dirtyDeep = this.#
|
|
1738
|
+
#i = I(!1);
|
|
1739
|
+
dirtyDeep = this.#i;
|
|
1569
1740
|
#c;
|
|
1570
1741
|
#u;
|
|
1571
1742
|
#l = () => {
|
|
@@ -1577,55 +1748,55 @@ class Ue extends x {
|
|
|
1577
1748
|
}
|
|
1578
1749
|
this.#n.set(this.touched.value || t);
|
|
1579
1750
|
};
|
|
1580
|
-
constructor(t, s, n, r, a,
|
|
1581
|
-
const
|
|
1582
|
-
super(t, s,
|
|
1583
|
-
const l =
|
|
1584
|
-
const
|
|
1585
|
-
|
|
1586
|
-
const
|
|
1587
|
-
|
|
1588
|
-
}), this.#l(), this.#
|
|
1751
|
+
constructor(t, s, n, r, a, o) {
|
|
1752
|
+
const i = n.map((u) => u ?? [], o);
|
|
1753
|
+
super(t, s, i, r, a, o);
|
|
1754
|
+
const l = i.on((u) => {
|
|
1755
|
+
const d = this.#e.length - u.length;
|
|
1756
|
+
d > 0 && (this.#e.splice(u.length, d).forEach((f, m) => {
|
|
1757
|
+
const w = u.length + m;
|
|
1758
|
+
f.dispose(), this.#t.get(w)?.(), this.#t.delete(w), this.#s.delete(w), this.#r.get(w)?.(), this.#r.delete(w), this.#a.delete(w);
|
|
1759
|
+
}), this.#l(), this.#o());
|
|
1589
1760
|
});
|
|
1590
|
-
this.length =
|
|
1761
|
+
this.length = i.map((u) => u.length), this.#c = this.touched.on(() => {
|
|
1591
1762
|
this.#l();
|
|
1592
1763
|
}), this.#u = this.dirty.on(() => {
|
|
1593
|
-
this.#
|
|
1764
|
+
this.#o();
|
|
1594
1765
|
});
|
|
1595
|
-
const h = this.value.on(() => this.#
|
|
1766
|
+
const h = this.value.on(() => this.#o());
|
|
1596
1767
|
this.onDispose(() => {
|
|
1597
|
-
for (const
|
|
1598
|
-
|
|
1599
|
-
this.length.dispose(), this.#e.length = 0, l(),
|
|
1600
|
-
for (const
|
|
1768
|
+
for (const u of this.#e)
|
|
1769
|
+
u.dispose();
|
|
1770
|
+
this.length.dispose(), this.#e.length = 0, l(), i.dispose();
|
|
1771
|
+
for (const u of this.#t.values()) u();
|
|
1601
1772
|
this.#t.clear(), this.#s.clear(), this.#n.dispose();
|
|
1602
|
-
for (const
|
|
1603
|
-
this.#r.clear(), this.#a.clear(), this.#
|
|
1773
|
+
for (const u of this.#r.values()) u();
|
|
1774
|
+
this.#r.clear(), this.#a.clear(), this.#i.dispose(), this.#c(), this.#u(), h();
|
|
1604
1775
|
});
|
|
1605
1776
|
}
|
|
1606
1777
|
item = (t) => {
|
|
1607
1778
|
if (this.#e[t])
|
|
1608
1779
|
return this.#e[t];
|
|
1609
|
-
const s = async (
|
|
1610
|
-
const
|
|
1611
|
-
|
|
1612
|
-
}, n = new
|
|
1780
|
+
const s = async (o) => {
|
|
1781
|
+
const i = this.value.value.slice();
|
|
1782
|
+
i[t] = o, this.change(i);
|
|
1783
|
+
}, n = new A(
|
|
1613
1784
|
[...this.path, t],
|
|
1614
1785
|
s,
|
|
1615
|
-
this.value.map((
|
|
1616
|
-
this.status.map(
|
|
1786
|
+
this.value.map((o) => o[t]),
|
|
1787
|
+
this.status.map(G([t])),
|
|
1617
1788
|
{
|
|
1618
1789
|
disabled: this.disabled,
|
|
1619
1790
|
validationMode: this.parent.validationMode
|
|
1620
1791
|
}
|
|
1621
1792
|
);
|
|
1622
1793
|
this.#e[t] = n;
|
|
1623
|
-
const r = n.touched.on((
|
|
1624
|
-
this.#s.set(t,
|
|
1794
|
+
const r = n.touched.on((o) => {
|
|
1795
|
+
this.#s.set(t, o), this.#l();
|
|
1625
1796
|
});
|
|
1626
1797
|
this.#t.set(t, r);
|
|
1627
|
-
const a = n.dirty.on((
|
|
1628
|
-
this.#a.set(t,
|
|
1798
|
+
const a = n.dirty.on((o) => {
|
|
1799
|
+
this.#a.set(t, o), this.#o();
|
|
1629
1800
|
});
|
|
1630
1801
|
return this.#r.set(t, a), n;
|
|
1631
1802
|
};
|
|
@@ -1665,17 +1836,17 @@ class Ue extends x {
|
|
|
1665
1836
|
for (let s = 0; s < t; s++)
|
|
1666
1837
|
this.item(s).markPristine?.();
|
|
1667
1838
|
};
|
|
1668
|
-
#
|
|
1839
|
+
#o = () => {
|
|
1669
1840
|
let t = !1;
|
|
1670
1841
|
for (const s of this.#a.values())
|
|
1671
1842
|
if (s) {
|
|
1672
1843
|
t = !0;
|
|
1673
1844
|
break;
|
|
1674
1845
|
}
|
|
1675
|
-
this.#
|
|
1846
|
+
this.#i.set(this.dirty.value || t);
|
|
1676
1847
|
};
|
|
1677
1848
|
}
|
|
1678
|
-
function
|
|
1849
|
+
function lt(e) {
|
|
1679
1850
|
function t(s) {
|
|
1680
1851
|
return typeof s == "number" ? s : s.toString();
|
|
1681
1852
|
}
|
|
@@ -1683,13 +1854,13 @@ function Ge(e) {
|
|
|
1683
1854
|
(s) => typeof s == "object" && s.key != null ? t(s.key) : t(s)
|
|
1684
1855
|
);
|
|
1685
1856
|
}
|
|
1686
|
-
function
|
|
1857
|
+
function ct(e) {
|
|
1687
1858
|
const t = e.filter((r) => r.path == null || r.path.length === 0).map((r) => r.message), s = e.filter((r) => r.path != null && r.path.length > 0).reduce((r, a) => {
|
|
1688
|
-
const
|
|
1859
|
+
const o = lt(a.path), i = o.pop();
|
|
1689
1860
|
let l = r;
|
|
1690
|
-
for (const h of
|
|
1861
|
+
for (const h of o)
|
|
1691
1862
|
l.dependencies == null && (l.dependencies = {}), l.dependencies[h] == null && (l.dependencies[h] = {}), l = l.dependencies[h];
|
|
1692
|
-
return l.dependencies == null && (l.dependencies = {}), l.dependencies[
|
|
1863
|
+
return l.dependencies == null && (l.dependencies = {}), l.dependencies[i] = { message: a.message }, r;
|
|
1693
1864
|
}, {}), n = t.join(`
|
|
1694
1865
|
`);
|
|
1695
1866
|
return {
|
|
@@ -1697,7 +1868,7 @@ function ze(e) {
|
|
|
1697
1868
|
message: n != "" ? n : void 0
|
|
1698
1869
|
};
|
|
1699
1870
|
}
|
|
1700
|
-
function
|
|
1871
|
+
function ut({
|
|
1701
1872
|
initialValue: e,
|
|
1702
1873
|
onChange: t,
|
|
1703
1874
|
validate: s,
|
|
@@ -1705,68 +1876,68 @@ function We({
|
|
|
1705
1876
|
validationMode: r,
|
|
1706
1877
|
validateDebounceMs: a
|
|
1707
1878
|
}) {
|
|
1708
|
-
const
|
|
1709
|
-
|
|
1879
|
+
const o = L.deriveProp(e), i = I(D.valid), l = I(!1), h = I(r ?? "touchedOrSubmit"), u = (g) => {
|
|
1880
|
+
i.set(g);
|
|
1710
1881
|
};
|
|
1711
|
-
let
|
|
1712
|
-
const
|
|
1882
|
+
let d;
|
|
1883
|
+
const f = async (g) => {
|
|
1713
1884
|
if (s != null) {
|
|
1714
|
-
const
|
|
1715
|
-
|
|
1885
|
+
const S = await s(g);
|
|
1886
|
+
u(S);
|
|
1716
1887
|
}
|
|
1717
|
-
},
|
|
1718
|
-
|
|
1719
|
-
const
|
|
1888
|
+
}, m = async (g) => {
|
|
1889
|
+
o.set(g), t?.(g);
|
|
1890
|
+
const S = h.value;
|
|
1720
1891
|
if (s != null) {
|
|
1721
|
-
if (
|
|
1892
|
+
if (S === "onSubmit")
|
|
1722
1893
|
return;
|
|
1723
|
-
const
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
},
|
|
1894
|
+
const P = a ?? 0;
|
|
1895
|
+
P > 0 ? (d && clearTimeout(d), d = setTimeout(() => {
|
|
1896
|
+
f(g);
|
|
1897
|
+
}, P)) : await f(g);
|
|
1727
1898
|
}
|
|
1728
|
-
},
|
|
1899
|
+
}, w = new A(
|
|
1729
1900
|
[],
|
|
1730
|
-
|
|
1731
|
-
i,
|
|
1901
|
+
m,
|
|
1732
1902
|
o,
|
|
1903
|
+
i,
|
|
1733
1904
|
{
|
|
1734
1905
|
disabled: l,
|
|
1735
1906
|
validationMode: h
|
|
1736
1907
|
},
|
|
1737
|
-
n ??
|
|
1908
|
+
n ?? N
|
|
1738
1909
|
);
|
|
1739
|
-
return
|
|
1740
|
-
l.dispose(),
|
|
1741
|
-
}), { controller:
|
|
1910
|
+
return w.onDispose(() => {
|
|
1911
|
+
l.dispose(), o.dispose(), i.dispose(), h.dispose(), d && clearTimeout(d);
|
|
1912
|
+
}), { controller: w, setStatus: u };
|
|
1742
1913
|
}
|
|
1743
|
-
function
|
|
1744
|
-
return
|
|
1914
|
+
function be(e) {
|
|
1915
|
+
return E(c.disabled(e.disabled), c.name(e.name));
|
|
1745
1916
|
}
|
|
1746
|
-
function
|
|
1917
|
+
function Pt(e, {
|
|
1747
1918
|
triggerOn: t = "change"
|
|
1748
1919
|
} = {}) {
|
|
1749
|
-
return
|
|
1750
|
-
|
|
1920
|
+
return E(
|
|
1921
|
+
be(e),
|
|
1751
1922
|
c.value(e.value),
|
|
1752
|
-
(t === "input" ? y.input : y.change)(
|
|
1923
|
+
(t === "input" ? y.input : y.change)(M(e.change))
|
|
1753
1924
|
);
|
|
1754
1925
|
}
|
|
1755
|
-
function
|
|
1926
|
+
function Vt(e, {
|
|
1756
1927
|
triggerOn: t = "change"
|
|
1757
1928
|
} = {}) {
|
|
1758
|
-
return
|
|
1759
|
-
|
|
1929
|
+
return E(
|
|
1930
|
+
be(e),
|
|
1760
1931
|
c.valueAsNumber(e.value),
|
|
1761
1932
|
(t === "input" ? y.input : y.change)(
|
|
1762
|
-
|
|
1933
|
+
ke(e.change)
|
|
1763
1934
|
)
|
|
1764
1935
|
);
|
|
1765
1936
|
}
|
|
1766
|
-
function
|
|
1767
|
-
return e.issues != null ? D.invalid(
|
|
1937
|
+
function re(e) {
|
|
1938
|
+
return e.issues != null ? D.invalid(ct(e.issues)) : D.valid;
|
|
1768
1939
|
}
|
|
1769
|
-
async function
|
|
1940
|
+
async function At({
|
|
1770
1941
|
task: e,
|
|
1771
1942
|
errorMessage: t,
|
|
1772
1943
|
errorPath: s = ["root"],
|
|
@@ -1780,11 +1951,11 @@ async function gt({
|
|
|
1780
1951
|
return s.length === 1 && s[0] === "root" ? D.invalid({
|
|
1781
1952
|
message: a
|
|
1782
1953
|
}) : D.invalid({
|
|
1783
|
-
dependencies:
|
|
1954
|
+
dependencies: ge(s, a)
|
|
1784
1955
|
});
|
|
1785
1956
|
}
|
|
1786
1957
|
}
|
|
1787
|
-
function
|
|
1958
|
+
function ge(e, t) {
|
|
1788
1959
|
if (e.length === 1)
|
|
1789
1960
|
return {
|
|
1790
1961
|
[e[0]]: { message: t }
|
|
@@ -1792,178 +1963,181 @@ function oe(e, t) {
|
|
|
1792
1963
|
const [s, ...n] = e;
|
|
1793
1964
|
return {
|
|
1794
1965
|
[s]: {
|
|
1795
|
-
dependencies:
|
|
1966
|
+
dependencies: ge(n, t)
|
|
1796
1967
|
}
|
|
1797
1968
|
};
|
|
1798
1969
|
}
|
|
1799
|
-
function
|
|
1970
|
+
function $t({
|
|
1800
1971
|
initialValue: e = {},
|
|
1801
1972
|
schema: t,
|
|
1802
|
-
|
|
1973
|
+
onSubmit: s = async () => D.valid,
|
|
1803
1974
|
validationMode: n,
|
|
1804
1975
|
validateDebounceMs: r
|
|
1805
1976
|
}) {
|
|
1806
|
-
const { controller: a, setStatus:
|
|
1977
|
+
const { controller: a, setStatus: o } = ut({
|
|
1807
1978
|
initialValue: e,
|
|
1808
1979
|
validationMode: n ?? "touchedOrSubmit",
|
|
1809
1980
|
validateDebounceMs: r,
|
|
1810
|
-
validate: (n ?? "touchedOrSubmit") === "onSubmit" ? void 0 : async (
|
|
1811
|
-
await t["~standard"].validate(
|
|
1981
|
+
validate: (n ?? "touchedOrSubmit") === "onSubmit" ? void 0 : async (u) => re(
|
|
1982
|
+
await t["~standard"].validate(u)
|
|
1812
1983
|
)
|
|
1813
|
-
}),
|
|
1814
|
-
return l.onDispose(
|
|
1984
|
+
}), i = I(!1), l = a.object();
|
|
1985
|
+
return l.onDispose(i.dispose), {
|
|
1815
1986
|
controller: l,
|
|
1816
|
-
setStatus:
|
|
1817
|
-
|
|
1818
|
-
if (
|
|
1819
|
-
const
|
|
1820
|
-
await t["~standard"].validate(
|
|
1987
|
+
setStatus: o,
|
|
1988
|
+
submit: async (u) => {
|
|
1989
|
+
if (i.set(!0), u?.preventDefault(), l.markAllTouched(), (n ?? "touchedOrSubmit") === "onSubmit") {
|
|
1990
|
+
const f = l.value.value, m = re(
|
|
1991
|
+
await t["~standard"].validate(f)
|
|
1821
1992
|
);
|
|
1822
|
-
if (
|
|
1823
|
-
|
|
1993
|
+
if (o(m), m.type === "invalid") {
|
|
1994
|
+
i.set(!1);
|
|
1824
1995
|
return;
|
|
1825
1996
|
}
|
|
1826
1997
|
}
|
|
1827
|
-
const
|
|
1828
|
-
|
|
1998
|
+
const d = await s(l.value.value);
|
|
1999
|
+
i.set(!1), d.type === "invalid" && o(d);
|
|
1829
2000
|
},
|
|
1830
|
-
submitting:
|
|
2001
|
+
submitting: i
|
|
1831
2002
|
};
|
|
1832
2003
|
}
|
|
1833
|
-
function
|
|
2004
|
+
function dt(e) {
|
|
1834
2005
|
const t = e.split("-"), s = [e];
|
|
1835
2006
|
return t.length > 1 && s.push(t[0]), s;
|
|
1836
2007
|
}
|
|
1837
|
-
function
|
|
2008
|
+
function ht({
|
|
1838
2009
|
locale: e,
|
|
1839
2010
|
defaultLocale: t = "en-US",
|
|
1840
2011
|
defaultMessages: s,
|
|
1841
2012
|
localeLoader: n
|
|
1842
2013
|
}) {
|
|
1843
|
-
const r =
|
|
1844
|
-
if (
|
|
1845
|
-
r.set(
|
|
1846
|
-
const l =
|
|
2014
|
+
const r = I(t), a = I(s), o = e.on(async (i) => {
|
|
2015
|
+
if (i === r.value) return;
|
|
2016
|
+
r.set(i);
|
|
2017
|
+
const l = dt(i);
|
|
1847
2018
|
for (const h of l)
|
|
1848
2019
|
try {
|
|
1849
|
-
const
|
|
2020
|
+
const u = await n(h);
|
|
1850
2021
|
if (
|
|
1851
2022
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1852
|
-
typeof
|
|
2023
|
+
typeof u.default == "object" && Object.keys(u).length === 1
|
|
1853
2024
|
) {
|
|
1854
2025
|
console.error(
|
|
1855
2026
|
"It appears that you are trying to load a translation module without referencing the default export. Please use `(await import(...)).default` in your loader function."
|
|
1856
2027
|
);
|
|
1857
2028
|
return;
|
|
1858
2029
|
}
|
|
1859
|
-
if (
|
|
1860
|
-
a.set(
|
|
2030
|
+
if (i === r.value) {
|
|
2031
|
+
a.set(u);
|
|
1861
2032
|
return;
|
|
1862
2033
|
}
|
|
1863
2034
|
} catch {
|
|
1864
2035
|
continue;
|
|
1865
2036
|
}
|
|
1866
|
-
console.warn(`No locale found for "'${e}", using fallback`),
|
|
2037
|
+
console.warn(`No locale found for "'${e}", using fallback`), i === r.value && a.set(s);
|
|
1867
2038
|
});
|
|
1868
2039
|
return {
|
|
1869
2040
|
/** Clean up all resources and event listeners */
|
|
1870
2041
|
dispose: () => {
|
|
1871
|
-
|
|
2042
|
+
o(), r.dispose(), a.dispose();
|
|
1872
2043
|
},
|
|
1873
2044
|
/** Translation functions that return reactive signals */
|
|
1874
2045
|
t: a
|
|
1875
2046
|
};
|
|
1876
2047
|
}
|
|
1877
|
-
function
|
|
2048
|
+
function pt({
|
|
1878
2049
|
defaultLocale: e,
|
|
1879
2050
|
defaultMessages: t,
|
|
1880
2051
|
localeLoader: s,
|
|
1881
2052
|
providerName: n = "I18nProvider"
|
|
1882
2053
|
}) {
|
|
1883
2054
|
return {
|
|
1884
|
-
mark:
|
|
2055
|
+
mark: ae(n),
|
|
1885
2056
|
create: (r, a) => {
|
|
1886
2057
|
const {
|
|
1887
|
-
value: { locale:
|
|
1888
|
-
} = a.getProvider(
|
|
1889
|
-
locale:
|
|
2058
|
+
value: { locale: o }
|
|
2059
|
+
} = a.getProvider(Pe.mark), { t: i, dispose: l } = ht({
|
|
2060
|
+
locale: o,
|
|
1890
2061
|
defaultMessages: t,
|
|
1891
2062
|
defaultLocale: e,
|
|
1892
2063
|
localeLoader: s
|
|
1893
2064
|
});
|
|
1894
2065
|
return {
|
|
1895
|
-
value:
|
|
2066
|
+
value: i,
|
|
1896
2067
|
dispose: l
|
|
1897
2068
|
};
|
|
1898
2069
|
}
|
|
1899
2070
|
};
|
|
1900
2071
|
}
|
|
1901
|
-
const
|
|
1902
|
-
defaultLocale:
|
|
1903
|
-
defaultMessages:
|
|
1904
|
-
localeLoader: async (e) => (await
|
|
2072
|
+
const R = pt({
|
|
2073
|
+
defaultLocale: _e,
|
|
2074
|
+
defaultMessages: Ie,
|
|
2075
|
+
localeLoader: async (e) => (await Ee(/* @__PURE__ */ Object.assign({ "./locales/ar.ts": () => import("./ar-DuYtkwHz.js"), "./locales/de.ts": () => import("./de-BSxDfb1B.js"), "./locales/en.ts": () => Promise.resolve().then(() => De), "./locales/es.ts": () => import("./es-CAIPTBfa.js"), "./locales/fa.ts": () => import("./fa-COTldXuh.js"), "./locales/fr.ts": () => import("./fr-Djxzcm-x.js"), "./locales/he.ts": () => import("./he-C_CvtpO2.js"), "./locales/hi.ts": () => import("./hi-C47vc5OG.js"), "./locales/it.ts": () => import("./it-l8u4xqsP.js"), "./locales/ja.ts": () => import("./ja-Dr2Azv8X.js"), "./locales/ko.ts": () => import("./ko-C97MbNN9.js"), "./locales/nl.ts": () => import("./nl-BnDPAHZz.js"), "./locales/pl.ts": () => import("./pl-DYEVmpx5.js"), "./locales/pt.ts": () => import("./pt-C-cIHGoh.js"), "./locales/ru.ts": () => import("./ru-n2tT3Gv-.js"), "./locales/tr.ts": () => import("./tr-CFUAqbmS.js"), "./locales/ur.ts": () => import("./ur-B7kT0PwV.js"), "./locales/vi.ts": () => import("./vi-CA85io1z.js"), "./locales/zh.ts": () => import("./zh-cLh5uTFh.js") }), `./locales/${e}.ts`, 3)).default,
|
|
1905
2076
|
providerName: "BeatUII18n"
|
|
1906
2077
|
});
|
|
1907
2078
|
export {
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
2079
|
+
Ct as $,
|
|
2080
|
+
Fe as A,
|
|
2081
|
+
R as B,
|
|
2082
|
+
wt as C,
|
|
2083
|
+
qe as D,
|
|
2084
|
+
It as E,
|
|
2085
|
+
nt as F,
|
|
2086
|
+
Mt as G,
|
|
2087
|
+
rt as H,
|
|
2088
|
+
F as I,
|
|
2089
|
+
at as J,
|
|
2090
|
+
ot as K,
|
|
2091
|
+
Qe as L,
|
|
2092
|
+
Lt as M,
|
|
2093
|
+
it as N,
|
|
2094
|
+
N as O,
|
|
2095
|
+
Et as P,
|
|
2096
|
+
lt as Q,
|
|
2097
|
+
Ze as R,
|
|
2098
|
+
Dt as S,
|
|
2099
|
+
_t as T,
|
|
2100
|
+
ct as U,
|
|
2101
|
+
ut as V,
|
|
2102
|
+
be as W,
|
|
2103
|
+
Pt as X,
|
|
2104
|
+
Vt as Y,
|
|
2105
|
+
re as Z,
|
|
2106
|
+
Ee as _,
|
|
2107
|
+
Ke as a,
|
|
2108
|
+
Ye as a0,
|
|
2109
|
+
xt as a1,
|
|
2110
|
+
ht as a2,
|
|
2111
|
+
ue as a3,
|
|
2112
|
+
Le as a4,
|
|
2113
|
+
mt as a5,
|
|
2114
|
+
vt as a6,
|
|
2115
|
+
kt as a7,
|
|
2116
|
+
Me as a8,
|
|
2117
|
+
yt as a9,
|
|
1944
2118
|
D as b,
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
2119
|
+
St as c,
|
|
2120
|
+
Tt as d,
|
|
2121
|
+
W as e,
|
|
2122
|
+
ee as f,
|
|
2123
|
+
Z as g,
|
|
2124
|
+
tt as h,
|
|
2125
|
+
st as i,
|
|
2126
|
+
pe as j,
|
|
2127
|
+
Ie as k,
|
|
2128
|
+
Pe as l,
|
|
2129
|
+
pt as m,
|
|
2130
|
+
A as n,
|
|
2131
|
+
G as o,
|
|
2132
|
+
O as p,
|
|
2133
|
+
V as q,
|
|
2134
|
+
fe as r,
|
|
2135
|
+
le as s,
|
|
2136
|
+
At as t,
|
|
2137
|
+
$t as u,
|
|
2138
|
+
j as v,
|
|
2139
|
+
Ge as w,
|
|
2140
|
+
We as x,
|
|
2141
|
+
_e as y,
|
|
2142
|
+
he as z
|
|
1969
2143
|
};
|