@tempots/beatui 0.22.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/{2019-DsAbc1I5.cjs → 2019-7ojCcWUJ.cjs} +1 -1
- package/dist/{2019-BD_R8GCb.js → 2019-JwkYbae8.js} +2 -2
- package/dist/{2020-j6NLRYni.cjs → 2020-BLYgDBO4.cjs} +1 -1
- package/dist/{2020-DZOE7XZH.js → 2020-kK0rQWn9.js} +2 -2
- package/dist/{ar-CYAprS9_.cjs → ar-BAb4yHZS.cjs} +1 -1
- package/dist/{ar-DuYtkwHz.js → ar-BgrUqaxG.js} +1 -1
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +3 -3
- package/dist/beatui.css +610 -394
- package/dist/beatui.tailwind.css +606 -394
- package/dist/{colors-B8HoRLA_.cjs → colors-Qc1mmmfr.cjs} +1 -1
- package/dist/{colors-5Nwx_gSj.js → colors-WfmhQ5e1.js} +63 -67
- package/dist/{de-BSxDfb1B.js → de-D_sdCcAw.js} +1 -1
- package/dist/{de-rQvC-Ydh.cjs → de-Dn2CdXgD.cjs} +1 -1
- package/dist/{es-BvmzhRc0.cjs → es-CEPxKSog.cjs} +1 -1
- package/dist/{es-CAIPTBfa.js → es-DczvLqEV.js} +1 -1
- package/dist/{fa-COTldXuh.js → fa-DhPP5Tgo.js} +1 -1
- package/dist/{fa-B3IJgHCh.cjs → fa-NvkKjIQ6.cjs} +1 -1
- package/dist/{fr-Djxzcm-x.js → fr-D3WwoeQg.js} +1 -1
- package/dist/{fr-C9hsLGOb.cjs → fr-cR59lx1A.cjs} +1 -1
- package/dist/{he-C_CvtpO2.js → he-CFhi-6Rs.js} +1 -1
- package/dist/{he-CHrcixO3.cjs → he-CxSHPJMg.cjs} +1 -1
- package/dist/{hi-C47vc5OG.js → hi-Cqy8JcS7.js} +1 -1
- package/dist/{hi-CpbCblie.cjs → hi-DLnz3lCX.cjs} +1 -1
- package/dist/{index-CeyxEbJL.cjs → index-0nXL1jt0.cjs} +1 -1
- package/dist/{index-C0yFCSoy.cjs → index-4MNPHZD0.cjs} +1 -1
- package/dist/{index-YbpU8b-b.cjs → index-4pbqdHdu.cjs} +1 -1
- package/dist/{index-m-1yJOxv.js → index-5kvan4pZ.js} +3 -3
- package/dist/{index--c2sxg96.js → index-8xL7lFvb.js} +2 -2
- package/dist/{index-KlPMACee.js → index-B8jOeOOB.js} +2 -2
- package/dist/{index-CW3QYddJ.js → index-BCaOVY88.js} +2 -2
- package/dist/{index-CsPpB1Kw.js → index-BICIDfB6.js} +1 -1
- package/dist/{index-BNQL8moK.js → index-BKHqr1z2.js} +2 -2
- package/dist/{index-BiHxJSI9.js → index-BSaEXg56.js} +3 -3
- package/dist/{index-B8EM1O9d.cjs → index-BSfK-Qwf.cjs} +1 -1
- package/dist/{index-SP-G4Erl.cjs → index-Bc-5l3Cz.cjs} +1 -1
- package/dist/{index-CjQ-nqcq.js → index-BeoVum6H.js} +1 -1
- package/dist/{index-BJZGXsLQ.cjs → index-Bk0BtvLD.cjs} +1 -1
- package/dist/{index-BUE3WeDh.cjs → index-BvXl7BJD.cjs} +1 -1
- package/dist/{index-DS0bdfOa.cjs → index-BzaR8uM1.cjs} +1 -1
- package/dist/{index-BIBYSE0O.js → index-C5uZbosj.js} +3 -3
- package/dist/{index-CcB11LV-.cjs → index-C7L2gKXf.cjs} +1 -1
- package/dist/{index-BtAze4TI.js → index-C7NeFFtL.js} +3 -3
- package/dist/{index-DtpMK8Ak.js → index-CEvEqrWz.js} +2 -2
- package/dist/{index-o4bA2Ymm.cjs → index-CGAE3ijj.cjs} +1 -1
- package/dist/{index-2J0cohRF.js → index-CJIznGSs.js} +2 -2
- package/dist/{index-h82qauh2.js → index-CKRtOTlW.js} +4 -4
- package/dist/{index-OUX19p46.js → index-CN4vYjXL.js} +2 -2
- package/dist/{index-CtlfDEiP.cjs → index-CPUSDEhf.cjs} +1 -1
- package/dist/{index-DPHERztz.cjs → index-CTiwmXQv.cjs} +1 -1
- package/dist/{index-c5HMVa4V.cjs → index-CflXJ8xJ.cjs} +1 -1
- package/dist/{index-BK8EFVAw.cjs → index-CgH6d8ie.cjs} +1 -1
- package/dist/{index-C4wKda5M.js → index-CiwYKSUt.js} +2 -2
- package/dist/{index-jLIz3LSI.js → index-Cwsc5H7D.js} +2 -2
- package/dist/{index-BLjWV-YV.cjs → index-D1rYqvi5.cjs} +2 -2
- package/dist/{index-BXHmDsV_.js → index-D6aavhaa.js} +2 -2
- package/dist/{index-C_T9Gzw8.js → index-DAdi5JJz.js} +2 -2
- package/dist/{index-CSK499Fw.cjs → index-DKyf2VGu.cjs} +1 -1
- package/dist/{index-CBlls5Ux.cjs → index-DXB8LND-.cjs} +1 -1
- package/dist/{index-D7a7hidA.js → index-DYmfX0jE.js} +100 -100
- package/dist/{index-_0aF8UPX.js → index-DZRUtuQ1.js} +2 -2
- package/dist/{index-CQcRWw-d.js → index-DqP1O6vK.js} +2 -2
- package/dist/{index-D3y-KMW-.js → index-Dr0vUVGJ.js} +4 -4
- package/dist/{index-CngY8bhO.cjs → index-DrNo6z9a.cjs} +1 -1
- package/dist/{index-C-UADaTN.cjs → index-Dsgj-jNd.cjs} +1 -1
- package/dist/index-Dvc6ZVJ3.cjs +1 -0
- package/dist/index-OrV7N-wE.js +680 -0
- package/dist/{index-Du_-zpYu.js → index-SPJ46EtH.js} +4 -4
- package/dist/{index-zcRhAq4N.cjs → index-ZuS9yWom.cjs} +1 -1
- package/dist/{index-BHOzetMx.cjs → index-ljok1ep6.cjs} +1 -1
- package/dist/{index-BIbSEVsf.cjs → index-uOI0LXHI.cjs} +1 -1
- package/dist/{index-jr-7RW3y.cjs → index-zvVNcjMi.cjs} +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +1731 -1731
- package/dist/{it-iA1CUA-2.cjs → it-C7Kv6j-_.cjs} +1 -1
- package/dist/{it-l8u4xqsP.js → it-CtMArqSp.js} +1 -1
- package/dist/{ja-CRKtLvpo.cjs → ja-BPL80aw5.cjs} +1 -1
- package/dist/{ja-Dr2Azv8X.js → ja-UFqZT78C.js} +1 -1
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +1 -1
- package/dist/{ko-C97MbNN9.js → ko-B5LB1_X_.js} +1 -1
- package/dist/{ko-DAqjjbor.cjs → ko-Cmt_34Xp.cjs} +1 -1
- package/dist/markdown/index.cjs.js +1 -1
- package/dist/markdown/index.es.js +1 -1
- package/dist/markdown.css +52 -3
- package/dist/milkdown/index.cjs.js +1 -1
- package/dist/milkdown/index.es.js +1 -1
- package/dist/{milkdown-input-Dp-upGqQ.js → milkdown-input-BI5TwGax.js} +26 -26
- package/dist/{milkdown-input-EMBZNdma.cjs → milkdown-input-CdJ7N_YZ.cjs} +2 -2
- package/dist/{milkdown-url-DgMTahqt.js → milkdown-url-D99P-nA-.js} +1 -1
- package/dist/{milkdown-url-DjKYrEOH.cjs → milkdown-url-DqoUZH3u.cjs} +1 -1
- package/dist/milkdown.css +4 -4
- package/dist/{modal-at2TcO_O.js → modal-C2Aa-aVN.js} +1 -1
- package/dist/{modal-hr4K3edu.cjs → modal-UsqvSvHy.cjs} +1 -1
- package/dist/{nl-CCa2fPh7.cjs → nl-B-WL9SX2.cjs} +1 -1
- package/dist/{nl-BnDPAHZz.js → nl-DCfHVqzQ.js} +1 -1
- package/dist/notice-C7I6EmRh.cjs +1 -0
- package/dist/{notice-DhynzVip.js → notice-c9Vbv45l.js} +836 -821
- package/dist/{pl-BVuQd0i3.cjs → pl-TGqkSi2w.cjs} +1 -1
- package/dist/{pl-DYEVmpx5.js → pl-UcTv39q1.js} +1 -1
- package/dist/{pt-C-cIHGoh.js → pt-CXsgmVtb.js} +1 -1
- package/dist/{pt-BFGThC8F.cjs → pt-Ua_e-1JE.cjs} +1 -1
- package/dist/{ru-M4WO0h1a.cjs → ru-9YWCN6fR.cjs} +1 -1
- package/dist/{ru-n2tT3Gv-.js → ru-C0MvZW2g.js} +1 -1
- package/dist/styles-url-B3p8AqBy.cjs +1 -0
- package/dist/styles-url-COuz9fVH.js +4 -0
- package/dist/tailwind/index.cjs.js +1 -1
- package/dist/tailwind/index.es.js +2 -2
- package/dist/tailwind/preset.cjs.js +1 -1
- package/dist/tailwind/preset.es.js +3 -3
- package/dist/tailwind/vite-plugin.cjs.js +13 -6
- package/dist/tailwind/vite-plugin.es.js +478 -161
- package/dist/{tr-CFUAqbmS.js → tr-CIIkc1uL.js} +1 -1
- package/dist/{tr-KxY4CbD3.cjs → tr-D70Oy8aN.cjs} +1 -1
- package/dist/{translations-DGCYRUSw.js → translations-CB6iJ1Rn.js} +1 -1
- package/dist/translations-DpZ-btu9.cjs +2 -0
- package/dist/{translations-924E7r4Q.js → translations-GO9sIajX.js} +235 -203
- package/dist/{translations-Do79R-x4.cjs → translations-NYxsXjMT.cjs} +1 -1
- package/dist/types/components/button/button.d.ts +1 -1
- package/dist/types/components/form/input/checkbox-input.d.ts +8 -1
- package/dist/types/components/form/input/switch.d.ts +3 -1
- package/dist/types/components/misc/notice.d.ts +1 -1
- package/dist/types/components/navigation/link/link.d.ts +1 -1
- package/dist/types/components/theme/types.d.ts +1 -1
- package/dist/types/components/typography/label.d.ts +1 -1
- package/dist/types/tailwind/google-fonts.d.ts +45 -0
- package/dist/types/tailwind/preset.d.ts +34 -0
- package/dist/types/tailwind/vite-plugin.d.ts +4 -0
- package/dist/types/tokens/colors.d.ts +6 -6
- package/dist/types/tokens/index.d.ts +19 -1
- package/dist/types/tokens/motion.d.ts +25 -0
- package/dist/types/tokens/radius.d.ts +5 -0
- package/dist/types/tokens/shadows.d.ts +5 -0
- package/dist/types/tokens/spacing.d.ts +5 -0
- package/dist/types/tokens/text-shadows.d.ts +5 -0
- package/dist/types/tokens/typography.d.ts +9 -1
- package/dist/{ur-B7kT0PwV.js → ur-Cpx9oyTV.js} +1 -1
- package/dist/{ur-GeXcd9eA.cjs → ur-DmxXuJ9O.cjs} +1 -1
- package/dist/{vi-DYvrvqim.cjs → vi-Cboo_ueb.cjs} +1 -1
- package/dist/{vi-CA85io1z.js → vi-D24AUQ01.js} +1 -1
- package/dist/{zh-cLh5uTFh.js → zh-25YFRjoV.js} +1 -1
- package/dist/{zh-EIWIyzbZ.cjs → zh-BXivX7rD.cjs} +1 -1
- package/package.json +1 -1
- package/dist/index-Br70wXYb.cjs +0 -1
- package/dist/index-DVdM4Oz7.js +0 -420
- package/dist/notice-CplKL-zm.cjs +0 -1
- package/dist/styles-url-CIhMtnm4.js +0 -4
- package/dist/styles-url-SkuBc_7K.cjs +0 -1
- package/dist/translations-BtAHDMLA.cjs +0 -2
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { Use as O, Value as i, prop as K, html as
|
|
2
|
-
import { f as
|
|
3
|
-
import { g as
|
|
4
|
-
import { ElementRect as
|
|
5
|
-
import { B as W, e as P, f as
|
|
6
|
-
class
|
|
1
|
+
import { Use as O, Value as i, prop as K, html as y, attr as a, on as C, WithElement as ie, OnDispose as Z, aria as N, bind as $e, computedOf as B, style as de, When as E, NotEmpty as Qe, Fragment as L, ForEach as fe, svg as Ae, svgAttr as ge, Empty as D, emitValue as j, coalesce as Je, Ensure as Oe, OneOfType as Ke, Repeat as je, signal as Fe, input as ee, emitValueAsNullableDate as et, emitValueAsNullableDateTime as tt, emitValueAsNumber as G, emit as nt, Task as Be, Unless as st } from "@tempots/dom";
|
|
2
|
+
import { f as rt } from "./colors-WfmhQ5e1.js";
|
|
3
|
+
import { g as lt } from "./timer-CQlK5LhW.js";
|
|
4
|
+
import { ElementRect as He, AutoSelect as at } from "@tempots/ui";
|
|
5
|
+
import { B as W, e as P, f as ot, C as me, I as z, g as H, h as ct, i as it, j as We, k as ye, T as ut, E as pt, P as dt, S as ne, s as ft, L as mt, l as ht, n as Ve, o as gt, a as be, p as ve, O as ae, q as Le } from "./translations-GO9sIajX.js";
|
|
6
|
+
class bt extends Error {
|
|
7
7
|
constructor(t = "Missing implementation") {
|
|
8
8
|
super(t), this.name = "MissingImplementationError";
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const fn = (e) => vt(e).split("_").join(" "), vt = (e) => (e = e.replace(/::/g, "/"), e = e.replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2"), e = e.replace(/([a-z\d])([A-Z])/g, "$1_$2"), e = e.replace(/-/g, "_"), e.toLowerCase()), mn = (e) => e.substring(0, 1).toUpperCase() + e.substring(1), xt = (e) => {
|
|
12
12
|
if (typeof Buffer < "u")
|
|
13
13
|
return Buffer.from(e, "base64").toString("utf8");
|
|
14
14
|
if (typeof atob < "u")
|
|
15
15
|
return atob(e);
|
|
16
|
-
throw new
|
|
16
|
+
throw new bt(
|
|
17
17
|
"No implementation found for base64 decoding"
|
|
18
18
|
);
|
|
19
19
|
};
|
|
20
|
-
function
|
|
20
|
+
function Ee({
|
|
21
21
|
onChange: e,
|
|
22
22
|
value: t,
|
|
23
23
|
accept: r = "*/*",
|
|
@@ -27,40 +27,40 @@ function Le({
|
|
|
27
27
|
allowMultiple: l
|
|
28
28
|
}) {
|
|
29
29
|
return O(W, (u) => {
|
|
30
|
-
const c = i.deriveProp(t ?? []),
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
const v = Array.from(
|
|
30
|
+
const c = i.deriveProp(t ?? []), p = K(!1), m = (h) => {
|
|
31
|
+
h.preventDefault(), h.stopPropagation(), p.value = !0;
|
|
32
|
+
}, f = (h) => {
|
|
33
|
+
h.preventDefault(), h.stopPropagation(), (!h.currentTarget || !h.currentTarget.contains(h.relatedTarget)) && (p.value = !1);
|
|
34
|
+
}, x = (h) => {
|
|
35
|
+
h.preventDefault(), h.stopPropagation(), p.value = !1;
|
|
36
|
+
const v = Array.from(h.dataTransfer?.files || []);
|
|
37
37
|
v.length > 0 && (c.value = v, e(v));
|
|
38
|
-
},
|
|
39
|
-
i.get(n) &&
|
|
38
|
+
}, d = (h) => {
|
|
39
|
+
i.get(n) && h.currentTarget.querySelector(
|
|
40
40
|
'input[type="file"]'
|
|
41
41
|
)?.click();
|
|
42
42
|
};
|
|
43
|
-
let
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
}, _ = (
|
|
49
|
-
i.get(n) && (
|
|
43
|
+
let g = null;
|
|
44
|
+
const b = () => {
|
|
45
|
+
if (g == null) return;
|
|
46
|
+
const h = Array.from(g.files ?? []);
|
|
47
|
+
h.length > 0 && (c.value = h, e(h)), g.value = "";
|
|
48
|
+
}, _ = (h) => {
|
|
49
|
+
i.get(n) && (h.key === "Enter" || h.key === " ") && (h.preventDefault(), d(h));
|
|
50
50
|
};
|
|
51
|
-
return
|
|
51
|
+
return y.div(
|
|
52
52
|
a.role("button"),
|
|
53
53
|
a.tabindex(
|
|
54
|
-
i.map(n, (
|
|
54
|
+
i.map(n, (h) => h ? 0 : -1)
|
|
55
55
|
),
|
|
56
56
|
a.style("position: relative;"),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
C.dragover(m),
|
|
58
|
+
C.dragleave(f),
|
|
59
|
+
C.drop(x),
|
|
60
|
+
C.click(d),
|
|
61
|
+
C.keydown(_),
|
|
62
62
|
// Hidden file input
|
|
63
|
-
|
|
63
|
+
y.input(
|
|
64
64
|
a.type("file"),
|
|
65
65
|
a.disabled(o),
|
|
66
66
|
a.accept(r),
|
|
@@ -68,13 +68,13 @@ function Le({
|
|
|
68
68
|
a.style(
|
|
69
69
|
"position: absolute; left: -9999px; opacity: 0; pointer-events: none;"
|
|
70
70
|
),
|
|
71
|
-
|
|
72
|
-
ie((
|
|
71
|
+
C.change(b),
|
|
72
|
+
ie((h) => (g = h, Z(
|
|
73
73
|
c.on((v) => {
|
|
74
74
|
const T = globalThis.DataTransfer;
|
|
75
75
|
if (T != null) {
|
|
76
|
-
const
|
|
77
|
-
v.forEach((
|
|
76
|
+
const I = new T();
|
|
77
|
+
v.forEach(($) => I.items.add($)), h.files = I.files;
|
|
78
78
|
}
|
|
79
79
|
})
|
|
80
80
|
)))
|
|
@@ -86,113 +86,113 @@ function Le({
|
|
|
86
86
|
);
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function wt(e, t) {
|
|
90
90
|
return e.length === t.length && e.every((r, n) => r === t[n]);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function _t(e, t) {
|
|
93
93
|
const r = ["bc-segmented-control", `bc-segmented-control--size-${e}`];
|
|
94
94
|
return t && r.push("bc-segmented-control--disabled"), r.join(" ");
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function hn({
|
|
97
97
|
options: e,
|
|
98
98
|
value: t,
|
|
99
99
|
onChange: r,
|
|
100
100
|
size: n = "md",
|
|
101
101
|
disabled: s = !1
|
|
102
102
|
}, ...o) {
|
|
103
|
-
const l =
|
|
103
|
+
const l = rt(e).map(([u, c]) => ({
|
|
104
104
|
key: u,
|
|
105
105
|
label: c
|
|
106
106
|
}));
|
|
107
107
|
return ie(() => {
|
|
108
108
|
const u = Object.fromEntries(
|
|
109
|
-
l.map((
|
|
109
|
+
l.map((p, m) => [p.key, m])
|
|
110
110
|
), c = K(
|
|
111
111
|
l.map(() => ({ left: 0, width: 0 })),
|
|
112
|
-
|
|
112
|
+
wt
|
|
113
113
|
);
|
|
114
|
-
return
|
|
114
|
+
return y.div(
|
|
115
115
|
a.class(
|
|
116
116
|
B(
|
|
117
117
|
n,
|
|
118
118
|
s
|
|
119
119
|
)(
|
|
120
|
-
(
|
|
120
|
+
(p, m) => _t(p ?? "md", m ?? !1)
|
|
121
121
|
)
|
|
122
122
|
),
|
|
123
|
-
|
|
123
|
+
y.div(
|
|
124
124
|
a.class("bc-segmented-control__container"),
|
|
125
|
-
|
|
125
|
+
y.div(
|
|
126
126
|
a.class("bc-segmented-control__indicator"),
|
|
127
|
-
|
|
127
|
+
de.width(
|
|
128
128
|
B(
|
|
129
129
|
t,
|
|
130
130
|
c
|
|
131
|
-
)((
|
|
132
|
-
const { width:
|
|
133
|
-
return `${
|
|
131
|
+
)((p, m) => {
|
|
132
|
+
const { width: f } = m[u[p] ?? 0];
|
|
133
|
+
return `${f}px`;
|
|
134
134
|
})
|
|
135
135
|
),
|
|
136
|
-
|
|
136
|
+
de.left(
|
|
137
137
|
B(
|
|
138
138
|
t,
|
|
139
139
|
c
|
|
140
|
-
)((
|
|
141
|
-
const { left:
|
|
142
|
-
return `${
|
|
140
|
+
)((p, m) => {
|
|
141
|
+
const { left: f } = m[u[p] ?? 0];
|
|
142
|
+
return `${f}px`;
|
|
143
143
|
})
|
|
144
144
|
)
|
|
145
145
|
),
|
|
146
146
|
// clickable buttons
|
|
147
|
-
l.map(({ label:
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
l.map(({ label: p, key: m }, f) => y.button(
|
|
148
|
+
C.click((x) => {
|
|
149
|
+
x.preventDefault(), i.get(s) || r?.(m);
|
|
150
150
|
}),
|
|
151
151
|
a.disabled(s),
|
|
152
152
|
a.class("bc-segmented-control__segment"),
|
|
153
153
|
a.class(
|
|
154
|
-
i.map(t, (
|
|
154
|
+
i.map(t, (x) => x === m ? "bc-segmented-control__segment--active" : "bc-segmented-control__segment--inactive")
|
|
155
155
|
),
|
|
156
|
-
|
|
157
|
-
function
|
|
158
|
-
c.update((
|
|
159
|
-
const _ = [...
|
|
160
|
-
return _[
|
|
161
|
-
width:
|
|
162
|
-
left:
|
|
156
|
+
He((x) => {
|
|
157
|
+
function d() {
|
|
158
|
+
c.update((b) => {
|
|
159
|
+
const _ = [...b];
|
|
160
|
+
return _[f] = {
|
|
161
|
+
width: x.value.width,
|
|
162
|
+
left: x.value.localLeft
|
|
163
163
|
}, _;
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
|
-
const
|
|
167
|
-
return Z(
|
|
166
|
+
const g = lt(d);
|
|
167
|
+
return Z(g, x.on(d));
|
|
168
168
|
}),
|
|
169
|
-
|
|
169
|
+
p
|
|
170
170
|
))
|
|
171
171
|
),
|
|
172
172
|
...o
|
|
173
173
|
);
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function $t(e) {
|
|
177
177
|
const t = e.type.toLowerCase();
|
|
178
178
|
return t.startsWith("image/") && (t.includes("jpeg") || t.includes("jpg") || t.includes("png") || t.includes("gif") || t.includes("webp") || t.includes("svg"));
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function yt(e) {
|
|
181
181
|
const t = e.type.toLowerCase();
|
|
182
182
|
return t.startsWith("image/") ? "vscode-icons:file-type-image" : t.startsWith("video/") ? "vscode-icons:file-type-video" : t.startsWith("audio/") ? "vscode-icons:file-type-audio" : t.includes("pdf") ? "vscode-icons:file-type-pdf2" : t.includes("word") || t.includes("document") ? "vscode-icons:file-type-word" : t.includes("excel") || t.includes("spreadsheet") ? "vscode-icons:file-type-excel" : t.includes("powerpoint") || t.includes("presentation") ? "vscode-icons:file-type-powerpoint" : t.includes("zip") || t.includes("archive") ? "vscode-icons:file-type-zip" : t.includes("text") ? "vscode-icons:file-type-text" : t.includes("json") ? "vscode-icons:file-type-json-official" : t.includes("csv") ? "vscode-icons:file-type-csv" : t.includes("xml") ? "vscode-icons:file-type-xml" : t.includes("yaml") ? "vscode-icons:file-type-yaml-official" : "vscode-icons:file-type-binary";
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function Ue(e) {
|
|
185
185
|
return E(
|
|
186
|
-
e.map(
|
|
186
|
+
e.map($t),
|
|
187
187
|
() => {
|
|
188
188
|
const t = K(null);
|
|
189
189
|
return e.on((r) => {
|
|
190
190
|
t.value && URL.revokeObjectURL(t.value);
|
|
191
191
|
const n = URL.createObjectURL(r);
|
|
192
192
|
t.value = n;
|
|
193
|
-
}),
|
|
193
|
+
}), y.div(
|
|
194
194
|
a.class("bc-file-input__thumbnail-container"),
|
|
195
|
-
|
|
195
|
+
y.img(
|
|
196
196
|
a.src(t),
|
|
197
197
|
a.alt(e.map((r) => r.name)),
|
|
198
198
|
a.class("bc-file-input__thumbnail"),
|
|
@@ -202,10 +202,10 @@ function Ee(e) {
|
|
|
202
202
|
)
|
|
203
203
|
);
|
|
204
204
|
},
|
|
205
|
-
() => z({ icon: e.map(
|
|
205
|
+
() => z({ icon: e.map(yt) })
|
|
206
206
|
);
|
|
207
207
|
}
|
|
208
|
-
const
|
|
208
|
+
const kt = (e, ...t) => {
|
|
209
209
|
const {
|
|
210
210
|
value: r = K([]),
|
|
211
211
|
accept: n = "*/*",
|
|
@@ -214,79 +214,79 @@ const $t = (e, ...t) => {
|
|
|
214
214
|
onChange: l,
|
|
215
215
|
onBlur: u,
|
|
216
216
|
disabled: c,
|
|
217
|
-
hasError:
|
|
218
|
-
mode:
|
|
219
|
-
showFileList:
|
|
220
|
-
...
|
|
221
|
-
} = e,
|
|
222
|
-
let
|
|
217
|
+
hasError: p,
|
|
218
|
+
mode: m = "default",
|
|
219
|
+
showFileList: f = !0,
|
|
220
|
+
...x
|
|
221
|
+
} = e, d = r, g = i.map(m, (I) => I === "compact"), b = (I) => {
|
|
222
|
+
let $ = I;
|
|
223
223
|
if (s != null) {
|
|
224
224
|
const w = i.get(s);
|
|
225
|
-
|
|
225
|
+
$ = $.slice(0, w);
|
|
226
226
|
}
|
|
227
227
|
if (o) {
|
|
228
228
|
const w = i.get(o);
|
|
229
|
-
|
|
229
|
+
$ = $.filter((k) => k.size <= w);
|
|
230
230
|
}
|
|
231
|
-
l?.(
|
|
232
|
-
}, _ = (
|
|
233
|
-
const w =
|
|
231
|
+
l?.($);
|
|
232
|
+
}, _ = (I) => {
|
|
233
|
+
const w = d.value.filter((k, M) => M !== I);
|
|
234
234
|
l?.(w);
|
|
235
|
-
},
|
|
235
|
+
}, h = () => {
|
|
236
236
|
l?.([]);
|
|
237
237
|
}, v = ({
|
|
238
|
-
files:
|
|
239
|
-
clear:
|
|
238
|
+
files: I,
|
|
239
|
+
clear: $,
|
|
240
240
|
change: w
|
|
241
241
|
}) => O(
|
|
242
242
|
W,
|
|
243
|
-
(
|
|
243
|
+
(k) => y.div(
|
|
244
244
|
a.class("bc-file-input__drop-zone"),
|
|
245
|
-
|
|
245
|
+
y.div(
|
|
246
246
|
a.class(
|
|
247
247
|
"bc-file-input__drop-zone-content bc-file-input__drop-zone-content--empty"
|
|
248
248
|
),
|
|
249
249
|
z({ icon: "mdi:cloud-upload-outline", size: "xl" }),
|
|
250
|
-
|
|
250
|
+
y.div(
|
|
251
251
|
a.class("bc-file-input__drop-zone-text"),
|
|
252
|
-
$e(
|
|
252
|
+
$e(k.$.filesInputInstructions)(
|
|
253
253
|
s,
|
|
254
254
|
o,
|
|
255
|
-
|
|
255
|
+
k.$.fileSizeUnits.value
|
|
256
256
|
)
|
|
257
257
|
)
|
|
258
258
|
)
|
|
259
259
|
)
|
|
260
260
|
), T = ({
|
|
261
|
-
files:
|
|
261
|
+
files: I
|
|
262
262
|
}) => O(
|
|
263
263
|
W,
|
|
264
|
-
(
|
|
264
|
+
($) => y.div(
|
|
265
265
|
a.class("bc-file-input__compact-input"),
|
|
266
266
|
E(
|
|
267
|
-
|
|
268
|
-
() =>
|
|
267
|
+
I.map((w) => w.length > 0),
|
|
268
|
+
() => y.span(
|
|
269
269
|
a.class("bc-file-input__compact-value"),
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
(w) =>
|
|
270
|
+
fe(
|
|
271
|
+
I,
|
|
272
|
+
(w) => y.span(
|
|
273
273
|
a.class("bc-file-input__compact-value-item"),
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
Ue(w),
|
|
275
|
+
y.span(
|
|
276
276
|
a.class("bc-file-input__compact-value-item-name"),
|
|
277
277
|
w.$.name
|
|
278
278
|
)
|
|
279
279
|
)
|
|
280
280
|
)
|
|
281
281
|
),
|
|
282
|
-
() =>
|
|
282
|
+
() => y.span(
|
|
283
283
|
a.class("bc-file-input__compact-placeholder"),
|
|
284
284
|
z({ icon: "mdi:cloud-upload-outline", size: "sm" }),
|
|
285
285
|
" ",
|
|
286
|
-
$e(
|
|
286
|
+
$e($.$.filesInputInstructions)(
|
|
287
287
|
s,
|
|
288
288
|
o,
|
|
289
|
-
|
|
289
|
+
$.$.fileSizeUnits.value
|
|
290
290
|
)
|
|
291
291
|
)
|
|
292
292
|
)
|
|
@@ -294,95 +294,95 @@ const $t = (e, ...t) => {
|
|
|
294
294
|
);
|
|
295
295
|
return O(
|
|
296
296
|
W,
|
|
297
|
-
(
|
|
297
|
+
(I) => P(
|
|
298
298
|
{
|
|
299
|
-
baseContainer: i.map(
|
|
299
|
+
baseContainer: i.map(g, ($) => !$),
|
|
300
300
|
disabled: c,
|
|
301
|
-
hasError:
|
|
301
|
+
hasError: p,
|
|
302
302
|
after: E(
|
|
303
|
-
|
|
303
|
+
g,
|
|
304
304
|
() => E(
|
|
305
|
-
|
|
305
|
+
d.map(({ length: $ }) => $ > 0),
|
|
306
306
|
() => me(
|
|
307
307
|
{
|
|
308
308
|
size: "sm",
|
|
309
|
-
label:
|
|
309
|
+
label: I.$.clearAllFiles,
|
|
310
310
|
disabled: c,
|
|
311
|
-
onClick:
|
|
311
|
+
onClick: h
|
|
312
312
|
},
|
|
313
313
|
a.class("bc-file-input__compact-clear")
|
|
314
314
|
)
|
|
315
315
|
)
|
|
316
316
|
),
|
|
317
|
-
...
|
|
317
|
+
...x,
|
|
318
318
|
input: E(
|
|
319
|
-
|
|
320
|
-
() =>
|
|
319
|
+
g,
|
|
320
|
+
() => y.div(
|
|
321
321
|
a.class("bc-file-input bc-file-input--compact"),
|
|
322
|
-
|
|
323
|
-
value:
|
|
322
|
+
Ee({
|
|
323
|
+
value: d,
|
|
324
324
|
accept: n,
|
|
325
325
|
enableClick: !0,
|
|
326
|
-
allowMultiple: i.map(s ?? 1 / 0, (
|
|
326
|
+
allowMultiple: i.map(s ?? 1 / 0, ($) => $ > 1),
|
|
327
327
|
disabled: c,
|
|
328
|
-
onChange:
|
|
328
|
+
onChange: b,
|
|
329
329
|
content: T
|
|
330
330
|
})
|
|
331
331
|
),
|
|
332
|
-
() =>
|
|
332
|
+
() => y.div(
|
|
333
333
|
a.class("bc-file-input"),
|
|
334
|
-
|
|
335
|
-
value:
|
|
334
|
+
Ee({
|
|
335
|
+
value: d,
|
|
336
336
|
accept: n,
|
|
337
337
|
enableClick: !0,
|
|
338
|
-
allowMultiple: i.map(s ?? 1 / 0, (
|
|
338
|
+
allowMultiple: i.map(s ?? 1 / 0, ($) => $ > 1),
|
|
339
339
|
disabled: c,
|
|
340
|
-
onChange:
|
|
340
|
+
onChange: b,
|
|
341
341
|
content: v
|
|
342
342
|
}),
|
|
343
343
|
E(
|
|
344
|
-
|
|
345
|
-
() =>
|
|
346
|
-
|
|
344
|
+
f,
|
|
345
|
+
() => Qe(
|
|
346
|
+
d,
|
|
347
347
|
() => L(
|
|
348
|
-
|
|
348
|
+
y.div(
|
|
349
349
|
a.class("bc-file-input__file-list"),
|
|
350
|
-
|
|
351
|
-
const
|
|
352
|
-
return
|
|
350
|
+
fe(d, ($, w) => {
|
|
351
|
+
const k = w.index;
|
|
352
|
+
return y.div(
|
|
353
353
|
a.class("bc-file-input__file-item"),
|
|
354
|
-
|
|
354
|
+
y.div(
|
|
355
355
|
a.class("bc-file-input__file-icon"),
|
|
356
|
-
|
|
356
|
+
Ue($)
|
|
357
357
|
),
|
|
358
|
-
|
|
358
|
+
y.div(
|
|
359
359
|
a.class("bc-file-input__file-info"),
|
|
360
|
-
|
|
360
|
+
y.div(
|
|
361
361
|
a.class("bc-file-input__file-name"),
|
|
362
|
-
a.title(
|
|
363
|
-
|
|
362
|
+
a.title($.$.name),
|
|
363
|
+
$.$.name
|
|
364
364
|
),
|
|
365
|
-
|
|
365
|
+
y.div(
|
|
366
366
|
a.class("bc-file-input__file-meta"),
|
|
367
367
|
B(
|
|
368
|
-
|
|
369
|
-
|
|
368
|
+
$.$.size,
|
|
369
|
+
I.$.fileSizeUnits
|
|
370
370
|
)(
|
|
371
|
-
(M, A) =>
|
|
371
|
+
(M, A) => ot(M, { units: A })
|
|
372
372
|
),
|
|
373
373
|
" • ",
|
|
374
374
|
B(
|
|
375
|
-
|
|
376
|
-
|
|
375
|
+
$.$.type,
|
|
376
|
+
I.$.unknownType
|
|
377
377
|
)((M, A) => M || A)
|
|
378
378
|
)
|
|
379
379
|
),
|
|
380
380
|
me(
|
|
381
381
|
{
|
|
382
382
|
size: "sm",
|
|
383
|
-
label:
|
|
383
|
+
label: I.$.removeFile,
|
|
384
384
|
disabled: c,
|
|
385
|
-
onClick: () => _(
|
|
385
|
+
onClick: () => _(k)
|
|
386
386
|
},
|
|
387
387
|
a.class("bc-file-input__remove-button")
|
|
388
388
|
)
|
|
@@ -390,18 +390,18 @@ const $t = (e, ...t) => {
|
|
|
390
390
|
})
|
|
391
391
|
),
|
|
392
392
|
E(
|
|
393
|
-
|
|
394
|
-
() =>
|
|
393
|
+
d.map(({ length: $ }) => $ > 1),
|
|
394
|
+
() => y.div(
|
|
395
395
|
a.class(
|
|
396
396
|
"bc-file-input__clear-all-button-container"
|
|
397
397
|
),
|
|
398
|
-
|
|
398
|
+
y.button(
|
|
399
399
|
a.type("button"),
|
|
400
400
|
a.class("bc-file-input__clear-all-button"),
|
|
401
401
|
a.disabled(c),
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
402
|
+
I.$.clearAllFiles,
|
|
403
|
+
C.click(($) => {
|
|
404
|
+
$.preventDefault(), $.stopPropagation(), h();
|
|
405
405
|
})
|
|
406
406
|
)
|
|
407
407
|
)
|
|
@@ -416,7 +416,7 @@ const $t = (e, ...t) => {
|
|
|
416
416
|
)
|
|
417
417
|
);
|
|
418
418
|
};
|
|
419
|
-
async function
|
|
419
|
+
async function It(e) {
|
|
420
420
|
return new Promise((t, r) => {
|
|
421
421
|
const n = new FileReader();
|
|
422
422
|
n.readAsDataURL(e), n.onload = () => {
|
|
@@ -425,10 +425,10 @@ async function yt(e) {
|
|
|
425
425
|
}, n.onerror = (s) => r(s);
|
|
426
426
|
});
|
|
427
427
|
}
|
|
428
|
-
function
|
|
429
|
-
return Promise.all(e.map(
|
|
428
|
+
function Ct(e) {
|
|
429
|
+
return Promise.all(e.map(It));
|
|
430
430
|
}
|
|
431
|
-
function
|
|
431
|
+
function Mt(e) {
|
|
432
432
|
if (e.length >= 4) {
|
|
433
433
|
if (e[0] === 137 && e[1] === 80 && e[2] === 78 && e[3] === 71)
|
|
434
434
|
return "image/png";
|
|
@@ -444,45 +444,45 @@ function kt(e) {
|
|
|
444
444
|
}
|
|
445
445
|
return "application/octet-stream";
|
|
446
446
|
}
|
|
447
|
-
function
|
|
448
|
-
const t =
|
|
447
|
+
function Tt(e) {
|
|
448
|
+
const t = xt(e ?? ""), r = t.length, n = new Uint8Array(r);
|
|
449
449
|
for (let s = 0; s < r; s++) n[s] = t.charCodeAt(s);
|
|
450
450
|
return n;
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function St(e) {
|
|
453
453
|
const {
|
|
454
454
|
value: t,
|
|
455
455
|
onChange: r,
|
|
456
456
|
onInput: n,
|
|
457
457
|
...s
|
|
458
|
-
} = e, o = /* @__PURE__ */ new Map(), l = i.toSignal(t).map((
|
|
459
|
-
const
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
), v = new Blob([
|
|
463
|
-
return new File([v], _, { type:
|
|
464
|
-
})), u = (
|
|
465
|
-
|
|
466
|
-
for (const [
|
|
467
|
-
o.set(
|
|
468
|
-
|
|
458
|
+
} = e, o = /* @__PURE__ */ new Map(), l = i.toSignal(t).map((m) => m.map((f, x) => {
|
|
459
|
+
const d = o.get(f), g = Tt(f ?? ""), b = d?.type || Mt(g), _ = d?.name ?? `file-${x}`, h = g.buffer.slice(
|
|
460
|
+
g.byteOffset,
|
|
461
|
+
g.byteOffset + g.byteLength
|
|
462
|
+
), v = new Blob([h], { type: b });
|
|
463
|
+
return new File([v], _, { type: b });
|
|
464
|
+
})), u = (m) => (f) => {
|
|
465
|
+
m && Ct(f).then((x) => {
|
|
466
|
+
for (const [d, g] of x.entries())
|
|
467
|
+
o.set(g, { name: f[d].name, type: f[d].type });
|
|
468
|
+
m(x);
|
|
469
469
|
});
|
|
470
|
-
}, c = u(r),
|
|
471
|
-
return
|
|
470
|
+
}, c = u(r), p = u(n);
|
|
471
|
+
return kt({
|
|
472
472
|
...s,
|
|
473
473
|
value: l,
|
|
474
474
|
onChange: c,
|
|
475
|
-
onInput:
|
|
475
|
+
onInput: p
|
|
476
476
|
});
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function gn(e) {
|
|
479
479
|
const {
|
|
480
480
|
value: t,
|
|
481
481
|
onInput: r,
|
|
482
482
|
onChange: n,
|
|
483
483
|
...s
|
|
484
484
|
} = e;
|
|
485
|
-
return
|
|
485
|
+
return St({
|
|
486
486
|
...s,
|
|
487
487
|
maxFiles: 1,
|
|
488
488
|
value: i.map(t, (o) => o == null ? [] : [o]),
|
|
@@ -494,41 +494,41 @@ function mn(e) {
|
|
|
494
494
|
}
|
|
495
495
|
});
|
|
496
496
|
}
|
|
497
|
-
function
|
|
497
|
+
function ke(e) {
|
|
498
498
|
const t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
|
|
499
499
|
return t ? [parseInt(t[1], 16), parseInt(t[2], 16), parseInt(t[3], 16)] : [0, 0, 0];
|
|
500
500
|
}
|
|
501
|
-
function
|
|
501
|
+
function Ie(e, t, r) {
|
|
502
502
|
const n = (s) => s.toString(16).padStart(2, "0");
|
|
503
503
|
return `#${n(Math.max(0, Math.min(255, e)))}${n(
|
|
504
504
|
Math.max(0, Math.min(255, t))
|
|
505
505
|
)}${n(Math.max(0, Math.min(255, r)))}`;
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function Dt(e) {
|
|
508
508
|
if (!e) return [0, 0, 0, 1];
|
|
509
509
|
const r = e.trim().match(
|
|
510
510
|
/^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/
|
|
511
511
|
);
|
|
512
512
|
if (r) {
|
|
513
|
-
const
|
|
514
|
-
if (
|
|
515
|
-
const
|
|
516
|
-
return [
|
|
513
|
+
const f = r[1];
|
|
514
|
+
if (f.length === 8) {
|
|
515
|
+
const x = parseInt(f.slice(0, 2), 16), d = parseInt(f.slice(2, 4), 16), g = parseInt(f.slice(4, 6), 16), b = parseInt(f.slice(6, 8), 16) / 255;
|
|
516
|
+
return [x, d, g, b];
|
|
517
517
|
}
|
|
518
|
-
if (
|
|
518
|
+
if (f.length === 6)
|
|
519
519
|
return [
|
|
520
|
-
parseInt(
|
|
521
|
-
parseInt(
|
|
522
|
-
parseInt(
|
|
520
|
+
parseInt(f.slice(0, 2), 16),
|
|
521
|
+
parseInt(f.slice(2, 4), 16),
|
|
522
|
+
parseInt(f.slice(4, 6), 16),
|
|
523
523
|
1
|
|
524
524
|
];
|
|
525
|
-
if (
|
|
526
|
-
const
|
|
527
|
-
return [
|
|
525
|
+
if (f.length === 4) {
|
|
526
|
+
const x = parseInt(f[0] + f[0], 16), d = parseInt(f[1] + f[1], 16), g = parseInt(f[2] + f[2], 16), b = parseInt(f[3] + f[3], 16) / 255;
|
|
527
|
+
return [x, d, g, b];
|
|
528
528
|
}
|
|
529
|
-
if (
|
|
530
|
-
const
|
|
531
|
-
return [
|
|
529
|
+
if (f.length === 3) {
|
|
530
|
+
const x = parseInt(f[0] + f[0], 16), d = parseInt(f[1] + f[1], 16), g = parseInt(f[2] + f[2], 16);
|
|
531
|
+
return [x, d, g, 1];
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
534
|
const n = e.match(
|
|
@@ -550,37 +550,37 @@ function Tt(e) {
|
|
|
550
550
|
/^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i
|
|
551
551
|
);
|
|
552
552
|
if (o) {
|
|
553
|
-
const
|
|
554
|
-
return [
|
|
553
|
+
const f = parseFloat(o[1]), x = parseFloat(o[2]), d = parseFloat(o[3]), g = o[4] != null ? parseFloat(o[4]) : 1, [b, _, h] = Ze(f, x / 100, d / 100);
|
|
554
|
+
return [b, _, h, g];
|
|
555
555
|
}
|
|
556
556
|
const l = e.match(
|
|
557
557
|
/^hwb\(\s*([+-]?[\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[/]\s*(\d?(?:\.\d+)?))?\s*\)$/i
|
|
558
558
|
);
|
|
559
559
|
if (l) {
|
|
560
|
-
const
|
|
561
|
-
return [
|
|
560
|
+
const f = parseFloat(l[1]), x = parseFloat(l[2]) / 100, d = parseFloat(l[3]) / 100, g = l[4] != null ? parseFloat(l[4]) : 1, [b, _, h] = Bt(f, x, d);
|
|
561
|
+
return [b, _, h, g];
|
|
562
562
|
}
|
|
563
563
|
const u = e.match(
|
|
564
564
|
/^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i
|
|
565
565
|
);
|
|
566
566
|
if (u) {
|
|
567
|
-
const
|
|
568
|
-
return [_,
|
|
567
|
+
const f = u[1], x = parseFloat(u[2]), d = parseFloat(u[3]), g = u[4] != null ? parseFloat(u[4]) : 1, b = f.endsWith("%") ? Math.max(0, Math.min(1, parseFloat(f) / 100)) : Math.max(0, Math.min(1, parseFloat(f))), [_, h, v] = Lt(b, x, d);
|
|
568
|
+
return [_, h, v, g];
|
|
569
569
|
}
|
|
570
|
-
const [c,
|
|
571
|
-
return [c,
|
|
570
|
+
const [c, p, m] = ke(e);
|
|
571
|
+
return [c, p, m, 1];
|
|
572
572
|
}
|
|
573
|
-
const
|
|
573
|
+
const At = (e, t, r, n) => `rgba(${Math.round(e)}, ${Math.round(t)}, ${Math.round(r)}, ${Math.max(
|
|
574
574
|
0,
|
|
575
575
|
Math.min(1, Math.round(n * 100) / 100)
|
|
576
576
|
)})`;
|
|
577
|
-
function
|
|
577
|
+
function Ft(e) {
|
|
578
578
|
let t = e + 1831565813;
|
|
579
579
|
return function() {
|
|
580
580
|
return t = Math.imul(t ^ t >>> 15, t | 1), t ^= t + Math.imul(t ^ t >>> 7, t | 61), ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
581
581
|
};
|
|
582
582
|
}
|
|
583
|
-
function
|
|
583
|
+
function Ze(e, t, r) {
|
|
584
584
|
e = (e % 360 + 360) % 360;
|
|
585
585
|
const n = (1 - Math.abs(2 * r - 1)) * t, s = n * (1 - Math.abs(e / 60 % 2 - 1)), o = r - n / 2;
|
|
586
586
|
let l = 0, u = 0, c = 0;
|
|
@@ -590,12 +590,12 @@ function We(e, t, r) {
|
|
|
590
590
|
Math.round((c + o) * 255)
|
|
591
591
|
];
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function Bt(e, t, r) {
|
|
594
594
|
e = (e % 360 + 360) % 360;
|
|
595
595
|
const n = t + r;
|
|
596
596
|
n > 1 && (t /= n, r /= n);
|
|
597
|
-
const [s, o, l] =
|
|
598
|
-
return [Math.round(c * 255), Math.round(
|
|
597
|
+
const [s, o, l] = Ze(e, 1, 0.5).map((f) => f / 255), u = 1 - t - r, c = s * u + t, p = o * u + t, m = l * u + t;
|
|
598
|
+
return [Math.round(c * 255), Math.round(p * 255), Math.round(m * 255)];
|
|
599
599
|
}
|
|
600
600
|
function Ce(e, t, r) {
|
|
601
601
|
e /= 255, t /= 255, r /= 255;
|
|
@@ -617,7 +617,7 @@ function Ce(e, t, r) {
|
|
|
617
617
|
}
|
|
618
618
|
return [Math.round(o), Math.round(l * 100), Math.round(u * 100)];
|
|
619
619
|
}
|
|
620
|
-
function
|
|
620
|
+
function Vt(e, t, r) {
|
|
621
621
|
const [n] = Ce(e, t, r), s = e / 255, o = t / 255, l = r / 255, u = Math.min(s, o, l), c = 1 - Math.max(s, o, l);
|
|
622
622
|
return [n, Math.round(u * 100), Math.round(c * 100)];
|
|
623
623
|
}
|
|
@@ -629,14 +629,14 @@ function we(e) {
|
|
|
629
629
|
const t = e <= 31308e-7 ? 12.92 * e : 1.055 * Math.pow(e, 0.4166666666666667) - 0.055;
|
|
630
630
|
return Math.round(Math.max(0, Math.min(1, t)) * 255);
|
|
631
631
|
}
|
|
632
|
-
function
|
|
633
|
-
const n = r * Math.PI / 180, s = Math.cos(n) * t, o = Math.sin(n) * t, l = e + 0.3963377774 * s + 0.2158037573 * o, u = e - 0.1055613458 * s - 0.0638541728 * o, c = e - 0.0894841775 * s - 1.291485548 * o,
|
|
634
|
-
return [we(
|
|
632
|
+
function Lt(e, t, r) {
|
|
633
|
+
const n = r * Math.PI / 180, s = Math.cos(n) * t, o = Math.sin(n) * t, l = e + 0.3963377774 * s + 0.2158037573 * o, u = e - 0.1055613458 * s - 0.0638541728 * o, c = e - 0.0894841775 * s - 1.291485548 * o, p = l * l * l, m = u * u * u, f = c * c * c, x = 4.0767416621 * p - 3.3077115913 * m + 0.2309699292 * f, d = -1.2684380046 * p + 2.6097574011 * m - 0.3413193965 * f, g = -0.0041960863 * p - 0.7034186147 * m + 1.707614701 * f;
|
|
634
|
+
return [we(x), we(d), we(g)];
|
|
635
635
|
}
|
|
636
|
-
function
|
|
637
|
-
const n = xe(e), s = xe(t), o = xe(r), l = 0.4122214708 * n + 0.5363325363 * s + 0.0514459929 * o, u = 0.2119034982 * n + 0.6806995451 * s + 0.1073969566 * o, c = 0.0883024619 * n + 0.2817188376 * s + 0.6299787005 * o,
|
|
638
|
-
let _ = Math.atan2(
|
|
639
|
-
return _ < 0 && (_ += 360), [
|
|
636
|
+
function Et(e, t, r) {
|
|
637
|
+
const n = xe(e), s = xe(t), o = xe(r), l = 0.4122214708 * n + 0.5363325363 * s + 0.0514459929 * o, u = 0.2119034982 * n + 0.6806995451 * s + 0.1073969566 * o, c = 0.0883024619 * n + 0.2817188376 * s + 0.6299787005 * o, p = Math.cbrt(l), m = Math.cbrt(u), f = Math.cbrt(c), x = 0.2104542553 * p + 0.793617785 * m - 0.0040720468 * f, d = 1.9779984951 * p - 2.428592205 * m + 0.4505937099 * f, g = 0.0259040371 * p + 0.7827717662 * m - 0.808675766 * f, b = Math.sqrt(d * d + g * g);
|
|
638
|
+
let _ = Math.atan2(g, d) * 180 / Math.PI;
|
|
639
|
+
return _ < 0 && (_ += 360), [x, b, _];
|
|
640
640
|
}
|
|
641
641
|
function oe(e, t, r, n, s, o) {
|
|
642
642
|
switch (s) {
|
|
@@ -645,7 +645,7 @@ function oe(e, t, r, n, s, o) {
|
|
|
645
645
|
const l = (c) => c.toString(16).padStart(2, "0"), u = Math.max(0, Math.min(255, Math.round(n * 255)));
|
|
646
646
|
return `#${l(e)}${l(t)}${l(r)}${l(u)}`;
|
|
647
647
|
}
|
|
648
|
-
return
|
|
648
|
+
return Ie(e, t, r);
|
|
649
649
|
case "rgb":
|
|
650
650
|
return `rgb(${e}, ${t}, ${r})`;
|
|
651
651
|
case "rgba":
|
|
@@ -659,63 +659,63 @@ function oe(e, t, r, n, s, o) {
|
|
|
659
659
|
return `hsla(${l}, ${u}%, ${c}%, ${Math.round(n * 100) / 100})`;
|
|
660
660
|
}
|
|
661
661
|
case "hwb": {
|
|
662
|
-
const [l, u, c] =
|
|
662
|
+
const [l, u, c] = Vt(e, t, r);
|
|
663
663
|
return n < 1 ? `hwb(${l} ${u}% ${c}% / ${Math.round(n * 100) / 100})` : `hwb(${l} ${u}% ${c}%)`;
|
|
664
664
|
}
|
|
665
665
|
case "oklch": {
|
|
666
|
-
const [l, u, c] =
|
|
667
|
-
return o || n < 1 ? `oklch(${
|
|
666
|
+
const [l, u, c] = Et(e, t, r), p = (Math.round(l * 1e3) / 1e3).toFixed(3), m = (Math.round(u * 1e3) / 1e3).toFixed(3), f = (Math.round(c * 10) / 10).toFixed(1), x = Math.round(n * 100) / 100;
|
|
667
|
+
return o || n < 1 ? `oklch(${p} ${m} ${f} / ${x})` : `oklch(${p} ${m} ${f})`;
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
671
|
function ce(e, t) {
|
|
672
672
|
return t ? e === "rgb" ? "rgba" : e === "hsl" ? "hsla" : e : e === "rgba" ? "rgb" : e === "hsla" ? "hsl" : e;
|
|
673
673
|
}
|
|
674
|
-
function
|
|
675
|
-
const [r, n, s] = e, o = r << 16 ^ n << 8 ^ s, l =
|
|
676
|
-
for (let
|
|
677
|
-
const
|
|
678
|
-
|
|
674
|
+
function Ut(e, t) {
|
|
675
|
+
const [r, n, s] = e, o = r << 16 ^ n << 8 ^ s, l = Ft(o), u = 6 + Math.floor(l() * 5), c = 0.18 + l() * 0.06, p = [];
|
|
676
|
+
for (let d = 0; d < u; d++) {
|
|
677
|
+
const g = d / u * Math.PI * 2, b = t * (1 + (l() * 2 - 1) * c), _ = Math.cos(g) * b, h = Math.sin(g) * b;
|
|
678
|
+
p.push({ x: _, y: h });
|
|
679
679
|
}
|
|
680
|
-
const
|
|
681
|
-
let
|
|
682
|
-
for (let
|
|
683
|
-
const
|
|
684
|
-
|
|
680
|
+
const m = (p[0].x + p[u - 1].x) / 2, f = (p[0].y + p[u - 1].y) / 2;
|
|
681
|
+
let x = `M ${m.toFixed(3)} ${f.toFixed(3)}`;
|
|
682
|
+
for (let d = 0; d < u; d++) {
|
|
683
|
+
const g = p[d], b = p[(d + 1) % u], _ = (g.x + b.x) / 2, h = (g.y + b.y) / 2;
|
|
684
|
+
x += ` Q ${g.x.toFixed(3)} ${g.y.toFixed(3)} ${_.toFixed(3)} ${h.toFixed(3)}`;
|
|
685
685
|
}
|
|
686
|
-
return
|
|
686
|
+
return x += " Z", x;
|
|
687
687
|
}
|
|
688
|
-
const
|
|
689
|
-
const { value: t, onBlur: r, onChange: n, onInput: s, displayValue: o, size: l, withAlpha: u } = e, c = i.map(l ?? 32, (w) => w),
|
|
690
|
-
|
|
691
|
-
([w,
|
|
692
|
-
),
|
|
688
|
+
const bn = (e) => {
|
|
689
|
+
const { value: t, onBlur: r, onChange: n, onInput: s, displayValue: o, size: l, withAlpha: u } = e, c = i.map(l ?? 32, (w) => w), p = i.map(t, (w) => Dt(w ?? "#000000")), m = i.map(
|
|
690
|
+
p,
|
|
691
|
+
([w, k, M]) => [w, k, M]
|
|
692
|
+
), f = i.map(p, ([, , , w]) => w), x = K(i.get(f) ?? 1), d = i.map(u ?? !1, (w) => w), g = i.map(
|
|
693
693
|
e.colorTextFormat ?? "rgb",
|
|
694
694
|
(w) => w
|
|
695
|
-
),
|
|
696
|
-
h,
|
|
697
|
-
b,
|
|
695
|
+
), b = B(
|
|
698
696
|
m,
|
|
699
|
-
|
|
697
|
+
x,
|
|
698
|
+
g,
|
|
699
|
+
d
|
|
700
700
|
)(
|
|
701
|
-
([w,
|
|
701
|
+
([w, k, M], A, F, S) => oe(w, k, M, A ?? 1, ce(F, S), S)
|
|
702
702
|
), _ = i.map(
|
|
703
703
|
e.colorTextFormat ?? "hex",
|
|
704
704
|
(w) => w
|
|
705
|
-
),
|
|
706
|
-
|
|
705
|
+
), h = i.map(c, (w) => `-${w / 2} -${w / 2} ${w} ${w}`), v = B(
|
|
706
|
+
m,
|
|
707
707
|
c
|
|
708
|
-
)((w,
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
708
|
+
)((w, k) => Ut(w, k / 2)), T = B(
|
|
709
|
+
m,
|
|
710
|
+
x,
|
|
711
|
+
d
|
|
712
712
|
)(
|
|
713
|
-
([w,
|
|
714
|
-
),
|
|
713
|
+
([w, k, M], A, F) => F || A < 1 ? At(w, k, M, A) : Ie(w, k, M)
|
|
714
|
+
), I = y.div(
|
|
715
715
|
a.class("bc-color-input__control"),
|
|
716
716
|
a.class(
|
|
717
717
|
i.map(
|
|
718
|
-
|
|
718
|
+
d,
|
|
719
719
|
(w) => w ? "bc-color-input__control--alpha" : ""
|
|
720
720
|
)
|
|
721
721
|
),
|
|
@@ -723,62 +723,62 @@ const hn = (e) => {
|
|
|
723
723
|
// The SVG blob preview
|
|
724
724
|
Ae.svg(
|
|
725
725
|
a.class("bc-color-input__svg"),
|
|
726
|
-
ge.viewBox(
|
|
726
|
+
ge.viewBox(h),
|
|
727
727
|
Ae.path(ge.d(v), ge.fill(T))
|
|
728
728
|
),
|
|
729
729
|
// Invisible native input overlays the blob for picker and accessibility
|
|
730
|
-
|
|
730
|
+
y.input(
|
|
731
731
|
a.type("color"),
|
|
732
732
|
H(e),
|
|
733
733
|
// Native color input needs hex without alpha
|
|
734
|
-
a.value(i.map(
|
|
734
|
+
a.value(i.map(m, ([w, k, M]) => Ie(w, k, M))),
|
|
735
735
|
a.class("bc-input bc-color-input bc-color-input__native"),
|
|
736
|
-
r != null ?
|
|
737
|
-
n != null ?
|
|
738
|
-
const
|
|
736
|
+
r != null ? C.blur(r) : D,
|
|
737
|
+
n != null ? C.change((w) => {
|
|
738
|
+
const k = w.target.value;
|
|
739
739
|
if (!n) return;
|
|
740
|
-
const [M, A, F] =
|
|
740
|
+
const [M, A, F] = ke(k), S = i.get(x) ?? 1, V = ce(
|
|
741
741
|
i.get(_),
|
|
742
|
-
i.get(
|
|
743
|
-
), R = oe(M, A, F,
|
|
742
|
+
i.get(d)
|
|
743
|
+
), R = oe(M, A, F, S, V, i.get(d));
|
|
744
744
|
n(R);
|
|
745
|
-
}) :
|
|
746
|
-
s != null ?
|
|
747
|
-
const
|
|
745
|
+
}) : D,
|
|
746
|
+
s != null ? C.input((w) => {
|
|
747
|
+
const k = w.target.value;
|
|
748
748
|
if (!s) return;
|
|
749
|
-
const [M, A, F] =
|
|
749
|
+
const [M, A, F] = ke(k), S = i.get(x) ?? 1, V = ce(
|
|
750
750
|
i.get(_),
|
|
751
|
-
i.get(
|
|
752
|
-
), R = oe(M, A, F,
|
|
751
|
+
i.get(d)
|
|
752
|
+
), R = oe(M, A, F, S, V, i.get(d));
|
|
753
753
|
s(R);
|
|
754
|
-
}) :
|
|
754
|
+
}) : D
|
|
755
755
|
)
|
|
756
|
-
),
|
|
757
|
-
|
|
758
|
-
() =>
|
|
756
|
+
), $ = E(
|
|
757
|
+
d,
|
|
758
|
+
() => y.input(
|
|
759
759
|
a.type("range"),
|
|
760
760
|
a.class("bc-color-input__alpha"),
|
|
761
761
|
a.min(0),
|
|
762
762
|
a.max(1),
|
|
763
763
|
a.step(0.01),
|
|
764
|
-
a.value(i.map(
|
|
764
|
+
a.value(i.map(x, (w) => String(w ?? 1))),
|
|
765
765
|
a.disabled(e.disabled),
|
|
766
|
-
|
|
767
|
-
const
|
|
768
|
-
|
|
769
|
-
const [M, A, F] = i.get(
|
|
766
|
+
C.input((w) => {
|
|
767
|
+
const k = parseFloat(w.target.value);
|
|
768
|
+
x.set(k);
|
|
769
|
+
const [M, A, F] = i.get(m), S = ce(
|
|
770
770
|
i.get(_),
|
|
771
|
-
i.get(
|
|
772
|
-
), V = oe(M, A, F,
|
|
771
|
+
i.get(d)
|
|
772
|
+
), V = oe(M, A, F, k, S, i.get(d));
|
|
773
773
|
s?.(V);
|
|
774
774
|
}),
|
|
775
|
-
|
|
776
|
-
const
|
|
777
|
-
|
|
778
|
-
const [M, A, F] = i.get(
|
|
775
|
+
C.change((w) => {
|
|
776
|
+
const k = parseFloat(w.target.value);
|
|
777
|
+
x.set(k);
|
|
778
|
+
const [M, A, F] = i.get(m), S = ce(
|
|
779
779
|
i.get(_),
|
|
780
|
-
i.get(
|
|
781
|
-
), V = oe(M, A, F,
|
|
780
|
+
i.get(d)
|
|
781
|
+
), V = oe(M, A, F, k, S, i.get(d));
|
|
782
782
|
n?.(V);
|
|
783
783
|
})
|
|
784
784
|
)
|
|
@@ -788,45 +788,45 @@ const hn = (e) => {
|
|
|
788
788
|
...e,
|
|
789
789
|
// ensure our control does not try to grow
|
|
790
790
|
growInput: !1,
|
|
791
|
-
input:
|
|
791
|
+
input: I,
|
|
792
792
|
// If caller provided an `after`, append RGB before it
|
|
793
793
|
after: L(
|
|
794
794
|
E(
|
|
795
795
|
o ?? !1,
|
|
796
|
-
() =>
|
|
796
|
+
() => y.span(a.class("bc-color-input__rgb"), b)
|
|
797
797
|
),
|
|
798
|
-
|
|
798
|
+
$,
|
|
799
799
|
e.after
|
|
800
800
|
)
|
|
801
801
|
});
|
|
802
|
-
}, Te = "$$tts-exp-",
|
|
802
|
+
}, Te = "$$tts-exp-", Nt = (e, t) => ie((r) => {
|
|
803
803
|
const n = `${Te}${e}`;
|
|
804
804
|
return Z(i.on(t, (s) => Reflect.set(r, n, s)));
|
|
805
|
-
}),
|
|
805
|
+
}), vn = (e, t) => {
|
|
806
806
|
const r = `${Te}${e}`;
|
|
807
807
|
return (n) => {
|
|
808
808
|
t(Reflect.get(n.target, r));
|
|
809
809
|
};
|
|
810
|
-
},
|
|
810
|
+
}, zt = (e, t) => {
|
|
811
811
|
const r = `${Te}${e}`;
|
|
812
812
|
return (n) => {
|
|
813
813
|
const s = n.target, o = s.selectedIndex, l = s.options[o];
|
|
814
814
|
t(Reflect.get(l, r));
|
|
815
815
|
};
|
|
816
816
|
};
|
|
817
|
-
function
|
|
817
|
+
function Rt(e, t, r) {
|
|
818
818
|
const n = ["bc-card"];
|
|
819
819
|
return e !== "default" && n.push(`bc-card--${e}`), t !== "md" && n.push(`bc-card--padding-${t}`), r !== "lg" && n.push(`bc-card--rounded-${r}`), n.join(" ");
|
|
820
820
|
}
|
|
821
|
-
function
|
|
822
|
-
return
|
|
821
|
+
function xn({ variant: e = "default", size: t = "md", roundedness: r = "lg" } = {}, ...n) {
|
|
822
|
+
return y.div(
|
|
823
823
|
a.class(
|
|
824
824
|
B(
|
|
825
825
|
e,
|
|
826
826
|
t,
|
|
827
827
|
r
|
|
828
828
|
)(
|
|
829
|
-
(s, o, l) =>
|
|
829
|
+
(s, o, l) => Rt(
|
|
830
830
|
s ?? "default",
|
|
831
831
|
o ?? "md",
|
|
832
832
|
l ?? "lg"
|
|
@@ -837,9 +837,9 @@ function bn({ variant: e = "default", size: t = "md", roundedness: r = "lg" } =
|
|
|
837
837
|
);
|
|
838
838
|
}
|
|
839
839
|
function pe(...e) {
|
|
840
|
-
return
|
|
840
|
+
return y.div(a.class("bc-group"), ...e);
|
|
841
841
|
}
|
|
842
|
-
const
|
|
842
|
+
const wn = ({
|
|
843
843
|
startEditing: e,
|
|
844
844
|
value: t,
|
|
845
845
|
onChange: r,
|
|
@@ -847,7 +847,7 @@ const vn = ({
|
|
|
847
847
|
disabled: s
|
|
848
848
|
}) => {
|
|
849
849
|
const o = i.deriveProp(e ?? !1), l = K(!1), u = i.map(s ?? !1, (c) => c);
|
|
850
|
-
return
|
|
850
|
+
return y.div(
|
|
851
851
|
a.class("bc-editable-text"),
|
|
852
852
|
a.class(
|
|
853
853
|
i.map(
|
|
@@ -858,15 +858,15 @@ const vn = ({
|
|
|
858
858
|
N.disabled(u),
|
|
859
859
|
E(
|
|
860
860
|
o,
|
|
861
|
-
() =>
|
|
861
|
+
() => y.input(
|
|
862
862
|
a.placeholder(n),
|
|
863
863
|
a.value(t),
|
|
864
864
|
a.class("bc-editable-text__input"),
|
|
865
|
-
|
|
866
|
-
|
|
865
|
+
at(),
|
|
866
|
+
C.keydown((c) => {
|
|
867
867
|
c.key === "Enter" ? o.set(!1) : c.key === "Escape" && (l.set(!0), o.set(!1));
|
|
868
868
|
}),
|
|
869
|
-
|
|
869
|
+
C.blur(
|
|
870
870
|
j((c) => {
|
|
871
871
|
if (o.set(!1), l.value) {
|
|
872
872
|
l.set(!1);
|
|
@@ -876,67 +876,67 @@ const vn = ({
|
|
|
876
876
|
})
|
|
877
877
|
)
|
|
878
878
|
),
|
|
879
|
-
() =>
|
|
880
|
-
|
|
879
|
+
() => y.span(
|
|
880
|
+
C.click(() => {
|
|
881
881
|
i.get(u) || o.set(!0);
|
|
882
882
|
}),
|
|
883
883
|
a.class("bc-editable-text__display"),
|
|
884
884
|
E(
|
|
885
885
|
i.map(t, (c) => c != null && c.trim() !== ""),
|
|
886
|
-
() =>
|
|
887
|
-
() =>
|
|
886
|
+
() => y.span(a.class("bc-editable-text__text"), t),
|
|
887
|
+
() => y.span(
|
|
888
888
|
a.class("bc-editable-text__placeholder"),
|
|
889
889
|
n
|
|
890
890
|
)
|
|
891
891
|
),
|
|
892
892
|
E(
|
|
893
893
|
i.map(u, (c) => !c),
|
|
894
|
-
() =>
|
|
894
|
+
() => y.button(
|
|
895
895
|
a.class("bc-editable-text__edit-button"),
|
|
896
896
|
O(W, (c) => N.label(c.$.editLabel)),
|
|
897
|
-
|
|
897
|
+
C.click(() => o.set(!0)),
|
|
898
898
|
z({ icon: "line-md/pencil", color: "neutral" })
|
|
899
899
|
)
|
|
900
900
|
)
|
|
901
901
|
)
|
|
902
902
|
)
|
|
903
903
|
);
|
|
904
|
-
},
|
|
904
|
+
}, Ye = (e, t, r) => Oe(
|
|
905
905
|
e,
|
|
906
|
-
(n) =>
|
|
906
|
+
(n) => Ke(n, {
|
|
907
907
|
value: (s) => {
|
|
908
908
|
const o = B(
|
|
909
909
|
s,
|
|
910
910
|
r
|
|
911
911
|
)((l, u) => t(l.value, u));
|
|
912
|
-
return
|
|
912
|
+
return y.option(
|
|
913
913
|
Z(o.dispose),
|
|
914
914
|
a.selected(o),
|
|
915
|
-
|
|
915
|
+
Nt("value", s.$.value),
|
|
916
916
|
s.$.label
|
|
917
917
|
);
|
|
918
918
|
},
|
|
919
|
-
group: (s) =>
|
|
919
|
+
group: (s) => y.optgroup(
|
|
920
920
|
a.label(s.$.group),
|
|
921
|
-
|
|
921
|
+
fe(
|
|
922
922
|
s.$.options,
|
|
923
|
-
(o) =>
|
|
923
|
+
(o) => Ye(
|
|
924
924
|
o,
|
|
925
925
|
t,
|
|
926
926
|
r
|
|
927
927
|
)
|
|
928
928
|
)
|
|
929
929
|
),
|
|
930
|
-
break: () =>
|
|
930
|
+
break: () => y.hr()
|
|
931
931
|
})
|
|
932
|
-
),
|
|
932
|
+
), Pt = (e) => {
|
|
933
933
|
const {
|
|
934
934
|
value: t,
|
|
935
935
|
onBlur: r,
|
|
936
936
|
onChange: n,
|
|
937
937
|
options: s,
|
|
938
938
|
unselectedLabel: o,
|
|
939
|
-
equality: l = (
|
|
939
|
+
equality: l = (p, m) => p === m,
|
|
940
940
|
after: u
|
|
941
941
|
} = e;
|
|
942
942
|
let c;
|
|
@@ -951,54 +951,54 @@ const vn = ({
|
|
|
951
951
|
}),
|
|
952
952
|
u
|
|
953
953
|
),
|
|
954
|
-
input:
|
|
955
|
-
ie((
|
|
956
|
-
c =
|
|
957
|
-
const
|
|
958
|
-
const { removedNodes:
|
|
959
|
-
|
|
954
|
+
input: y.select(
|
|
955
|
+
ie((p) => {
|
|
956
|
+
c = p;
|
|
957
|
+
const m = new MutationObserver((f) => {
|
|
958
|
+
const { removedNodes: x } = f[0];
|
|
959
|
+
x.length > 0 && (c.selectedIndex = 0);
|
|
960
960
|
});
|
|
961
|
-
return
|
|
961
|
+
return m.observe(p, { childList: !0 }), Z(() => m.disconnect());
|
|
962
962
|
}),
|
|
963
963
|
H(e),
|
|
964
964
|
a.class("bc-native-select bc-input"),
|
|
965
965
|
O(
|
|
966
966
|
W,
|
|
967
|
-
(
|
|
967
|
+
(p) => y.option(
|
|
968
968
|
a.hidden("hidden"),
|
|
969
|
-
|
|
969
|
+
Je(o, p.$.selectOne)
|
|
970
970
|
)
|
|
971
971
|
),
|
|
972
|
-
|
|
973
|
-
r != null ?
|
|
974
|
-
n != null ?
|
|
972
|
+
fe(s, (p) => Ye(p, l, t)),
|
|
973
|
+
r != null ? C.blur(r) : D,
|
|
974
|
+
n != null ? C.change(zt("value", (p) => n(p))) : D
|
|
975
975
|
)
|
|
976
976
|
},
|
|
977
|
-
|
|
977
|
+
C.click(() => {
|
|
978
978
|
c?.focus(), typeof c?.showPicker == "function" && c.showPicker();
|
|
979
979
|
})
|
|
980
980
|
);
|
|
981
981
|
};
|
|
982
|
-
function
|
|
982
|
+
function Ot(e) {
|
|
983
983
|
const { controller: t, onChange: r, onBlur: n, ...s } = e;
|
|
984
|
-
return
|
|
984
|
+
return Pt({
|
|
985
985
|
...s,
|
|
986
986
|
value: t.value,
|
|
987
|
-
onChange:
|
|
988
|
-
onBlur:
|
|
987
|
+
onChange: it(t, r),
|
|
988
|
+
onBlur: ct(t, n)
|
|
989
989
|
});
|
|
990
990
|
}
|
|
991
|
-
function
|
|
992
|
-
return
|
|
991
|
+
function _n(e) {
|
|
992
|
+
return We({
|
|
993
993
|
...e,
|
|
994
|
-
content:
|
|
994
|
+
content: Ot(e)
|
|
995
995
|
});
|
|
996
996
|
}
|
|
997
|
-
function
|
|
997
|
+
function jt(e, t, r) {
|
|
998
998
|
const n = e.length.map((s) => s);
|
|
999
999
|
return L(
|
|
1000
1000
|
Z(() => n.dispose()),
|
|
1001
|
-
|
|
1001
|
+
je(
|
|
1002
1002
|
n,
|
|
1003
1003
|
(s) => {
|
|
1004
1004
|
const o = e.item(s.index), l = [];
|
|
@@ -1034,7 +1034,7 @@ function Pt(e, t, r) {
|
|
|
1034
1034
|
case "up":
|
|
1035
1035
|
return Fe(s.index > 0);
|
|
1036
1036
|
case "down":
|
|
1037
|
-
return e.length.map((
|
|
1037
|
+
return e.length.map((p) => s.index < p - 1);
|
|
1038
1038
|
}
|
|
1039
1039
|
})();
|
|
1040
1040
|
return l.push(() => c.dispose()), c;
|
|
@@ -1045,7 +1045,7 @@ function Pt(e, t, r) {
|
|
|
1045
1045
|
case "up":
|
|
1046
1046
|
return Fe(s.index === 0);
|
|
1047
1047
|
case "down":
|
|
1048
|
-
return e.length.map((
|
|
1048
|
+
return e.length.map((p) => s.index === p - 1);
|
|
1049
1049
|
}
|
|
1050
1050
|
})();
|
|
1051
1051
|
return l.push(() => c.dispose()), c;
|
|
@@ -1057,14 +1057,14 @@ function Pt(e, t, r) {
|
|
|
1057
1057
|
)
|
|
1058
1058
|
);
|
|
1059
1059
|
}
|
|
1060
|
-
const
|
|
1060
|
+
const Ne = {
|
|
1061
1061
|
9: { pattern: /^[0-9]$/ },
|
|
1062
1062
|
A: { pattern: /^[A-Za-z]$/, transform: (e) => e.toUpperCase() },
|
|
1063
1063
|
"*": { pattern: /^.$/ }
|
|
1064
|
-
},
|
|
1065
|
-
function
|
|
1064
|
+
}, Ht = (e) => e instanceof RegExp;
|
|
1065
|
+
function Xe(e, t, r) {
|
|
1066
1066
|
if (e == null) return [];
|
|
1067
|
-
const n = r ? { ...
|
|
1067
|
+
const n = r ? { ...Ne, ...t } : t ?? Ne, s = (l, u) => {
|
|
1068
1068
|
const c = n[u];
|
|
1069
1069
|
c ? l.push({ type: "pattern", name: u, ...c }) : l.push({ type: "literal", char: u });
|
|
1070
1070
|
}, o = [];
|
|
@@ -1076,10 +1076,10 @@ function Ye(e, t, r) {
|
|
|
1076
1076
|
if (typeof l == "string")
|
|
1077
1077
|
if (l.length <= 1) s(o, l);
|
|
1078
1078
|
else for (const u of l) s(o, u);
|
|
1079
|
-
else
|
|
1079
|
+
else Ht(l) ? o.push({ type: "pattern", pattern: l }) : typeof l == "object" && l && o.push(l);
|
|
1080
1080
|
return o;
|
|
1081
1081
|
}
|
|
1082
|
-
function
|
|
1082
|
+
function Wt(e, t) {
|
|
1083
1083
|
return (r) => {
|
|
1084
1084
|
switch (e) {
|
|
1085
1085
|
case "digits":
|
|
@@ -1095,64 +1095,64 @@ function jt(e, t) {
|
|
|
1095
1095
|
}
|
|
1096
1096
|
};
|
|
1097
1097
|
}
|
|
1098
|
-
function
|
|
1098
|
+
function ze(e, t, r, n, s, o) {
|
|
1099
1099
|
const l = {
|
|
1100
1100
|
raw: e,
|
|
1101
1101
|
previousConformed: t,
|
|
1102
1102
|
cursor: s ?? e.length,
|
|
1103
1103
|
completed: !1
|
|
1104
|
-
}, u = n.definitions ?? {}, c = typeof r == "function" ? r(e, l) : r,
|
|
1104
|
+
}, u = n.definitions ?? {}, c = typeof r == "function" ? r(e, l) : r, p = Xe(
|
|
1105
1105
|
c,
|
|
1106
1106
|
u,
|
|
1107
1107
|
n.useDefaultDefinitions ?? !0
|
|
1108
|
-
),
|
|
1109
|
-
for (const
|
|
1110
|
-
if (n.prefix) for (const
|
|
1111
|
-
if (n.suffix) for (const
|
|
1112
|
-
const
|
|
1113
|
-
if (
|
|
1114
|
-
const
|
|
1115
|
-
let
|
|
1116
|
-
for (const
|
|
1117
|
-
if (
|
|
1118
|
-
|
|
1108
|
+
), m = Wt(n.allowMode, n.allow), f = /* @__PURE__ */ new Set();
|
|
1109
|
+
for (const S of p) S.type === "literal" && f.add(S.char);
|
|
1110
|
+
if (n.prefix) for (const S of n.prefix) f.add(S);
|
|
1111
|
+
if (n.suffix) for (const S of n.suffix) f.add(S);
|
|
1112
|
+
const x = Array.from(e).filter((S) => m(S) && !f.has(S));
|
|
1113
|
+
if (x.length === 0) return { value: "", cursor: 0, completed: !1 };
|
|
1114
|
+
const d = [], g = [];
|
|
1115
|
+
let b = 0, _ = 0, h = 0, v = -1;
|
|
1116
|
+
for (const S of p) {
|
|
1117
|
+
if (S.type === "literal") {
|
|
1118
|
+
d.push(S.char), g.push({ kind: "literal", filled: !0 });
|
|
1119
1119
|
continue;
|
|
1120
1120
|
}
|
|
1121
|
-
_ +=
|
|
1122
|
-
const V = b
|
|
1121
|
+
_ += S.optional ? 0 : 1;
|
|
1122
|
+
const V = x[b];
|
|
1123
1123
|
if (V == null)
|
|
1124
1124
|
break;
|
|
1125
|
-
if (
|
|
1126
|
-
|
|
1125
|
+
if (S.type === "any") {
|
|
1126
|
+
h++, d.push(S.transform ? S.transform(V) : V), g.push({ kind: "slot", filled: !0 }), v = g.length - 1, b++;
|
|
1127
1127
|
continue;
|
|
1128
1128
|
}
|
|
1129
|
-
if (
|
|
1130
|
-
if (
|
|
1131
|
-
|
|
1132
|
-
const R =
|
|
1133
|
-
|
|
1129
|
+
if (S.type === "pattern")
|
|
1130
|
+
if (S.pattern.test(V)) {
|
|
1131
|
+
h++;
|
|
1132
|
+
const R = S.transform ? S.transform(V) : V;
|
|
1133
|
+
d.push(R), g.push({ kind: "slot", filled: !0 }), v = g.length - 1, b++;
|
|
1134
1134
|
} else {
|
|
1135
|
-
|
|
1135
|
+
b++;
|
|
1136
1136
|
continue;
|
|
1137
1137
|
}
|
|
1138
1138
|
}
|
|
1139
|
-
const T =
|
|
1139
|
+
const T = d.join(""), I = (n.prefix ?? "") + T + (n.suffix ?? "");
|
|
1140
1140
|
let w = (n.prefix ?? "").length;
|
|
1141
1141
|
if (v >= 0) {
|
|
1142
|
-
let
|
|
1142
|
+
let S = v + 1;
|
|
1143
1143
|
if ((o?.policy ?? "smart") !== "sticky")
|
|
1144
|
-
for (;
|
|
1145
|
-
w +=
|
|
1144
|
+
for (; S < g.length && g[S].kind === "literal"; ) S++;
|
|
1145
|
+
w += S;
|
|
1146
1146
|
}
|
|
1147
|
-
const
|
|
1147
|
+
const k = n.completion?.mode === "min" ? (n.completion.minChars ?? 0) <= h : n.completion?.mode === "custom" ? !!n.completion.isComplete?.(I) : _ > 0 && h >= _, M = n.pipe?.(I, { ...l, completed: k });
|
|
1148
1148
|
let A, F = w;
|
|
1149
|
-
return M === !1 ? (A = t, F = t.length) : typeof M == "string" ? (A = M, F = M.length) : typeof M == "object" && M ? (A = M.value, F = M.cursor ?? M.value.length) : A =
|
|
1149
|
+
return M === !1 ? (A = t, F = t.length) : typeof M == "string" ? (A = M, F = M.length) : typeof M == "object" && M ? (A = M.value, F = M.cursor ?? M.value.length) : A = I, { value: A, cursor: F, completed: k };
|
|
1150
1150
|
}
|
|
1151
|
-
function
|
|
1151
|
+
function Zt(e, t) {
|
|
1152
1152
|
const r = t?.strategy ?? "none";
|
|
1153
1153
|
return r === "custom" && t?.unmask ? t.unmask(e) : r === "strip" ? e.replace(/[^A-Za-z0-9]/g, "") : e;
|
|
1154
1154
|
}
|
|
1155
|
-
const
|
|
1155
|
+
const qe = (e) => {
|
|
1156
1156
|
const {
|
|
1157
1157
|
value: t,
|
|
1158
1158
|
onBlur: r,
|
|
@@ -1162,102 +1162,102 @@ const Xe = (e) => {
|
|
|
1162
1162
|
onComplete: l,
|
|
1163
1163
|
mask: u,
|
|
1164
1164
|
definitions: c,
|
|
1165
|
-
useDefaultDefinitions:
|
|
1166
|
-
extraLiterals:
|
|
1167
|
-
prefix:
|
|
1168
|
-
suffix:
|
|
1169
|
-
autofix:
|
|
1170
|
-
pipe:
|
|
1171
|
-
completion:
|
|
1165
|
+
useDefaultDefinitions: p,
|
|
1166
|
+
extraLiterals: m,
|
|
1167
|
+
prefix: f,
|
|
1168
|
+
suffix: x,
|
|
1169
|
+
autofix: d,
|
|
1170
|
+
pipe: g,
|
|
1171
|
+
completion: b,
|
|
1172
1172
|
unmask: _,
|
|
1173
|
-
allowMode:
|
|
1173
|
+
allowMode: h,
|
|
1174
1174
|
allow: v,
|
|
1175
1175
|
placeholder: T,
|
|
1176
|
-
placeholderOptions:
|
|
1177
|
-
} = e,
|
|
1176
|
+
placeholderOptions: I
|
|
1177
|
+
} = e, $ = B(
|
|
1178
1178
|
t,
|
|
1179
1179
|
u,
|
|
1180
1180
|
c,
|
|
1181
|
+
p,
|
|
1182
|
+
m,
|
|
1181
1183
|
f,
|
|
1182
|
-
|
|
1184
|
+
x,
|
|
1183
1185
|
d,
|
|
1184
1186
|
b,
|
|
1185
|
-
p,
|
|
1186
|
-
x,
|
|
1187
1187
|
_,
|
|
1188
|
-
|
|
1188
|
+
h,
|
|
1189
1189
|
T,
|
|
1190
|
-
|
|
1191
|
-
)((
|
|
1190
|
+
I
|
|
1191
|
+
)((k, M, A, F, S, V, R, re, le, te, Q, ue, q) => M ? ze(k ?? "", "", M, {
|
|
1192
1192
|
definitions: A ?? {},
|
|
1193
1193
|
useDefaultDefinitions: F ?? !0,
|
|
1194
|
-
extraLiterals:
|
|
1194
|
+
extraLiterals: S ?? [],
|
|
1195
1195
|
autofix: re ?? "none",
|
|
1196
1196
|
completion: le ?? { mode: "mask" },
|
|
1197
|
-
pipe:
|
|
1197
|
+
pipe: g ?? ((U) => U),
|
|
1198
1198
|
unmask: te ?? { strategy: "none" },
|
|
1199
1199
|
allowMode: Q ?? "all",
|
|
1200
1200
|
allow: v,
|
|
1201
1201
|
prefix: V,
|
|
1202
1202
|
suffix: R
|
|
1203
|
-
}).value :
|
|
1204
|
-
const A =
|
|
1203
|
+
}).value : k ?? ""), w = (k, M) => {
|
|
1204
|
+
const A = k.value ?? "", F = i.get(t) ?? "", S = u != null ? i.get(u) : null, V = c != null ? i.get(c) : void 0, R = p != null ? i.get(p) : void 0, re = m != null ? i.get(m) : void 0, le = d != null ? i.get(d) : void 0, te = b != null ? i.get(b) : void 0, Q = _ != null ? i.get(_) : void 0, ue = h != null ? i.get(h) : void 0, q = f != null ? i.get(f) : void 0, U = x != null ? i.get(x) : void 0, {
|
|
1205
1205
|
value: J,
|
|
1206
1206
|
cursor: he,
|
|
1207
|
-
completed:
|
|
1208
|
-
} =
|
|
1207
|
+
completed: Se
|
|
1208
|
+
} = S ? ze(
|
|
1209
1209
|
A,
|
|
1210
1210
|
F,
|
|
1211
|
-
|
|
1211
|
+
S,
|
|
1212
1212
|
{
|
|
1213
1213
|
definitions: V ?? {},
|
|
1214
1214
|
useDefaultDefinitions: R ?? !0,
|
|
1215
1215
|
extraLiterals: re ?? [],
|
|
1216
1216
|
autofix: le ?? "none",
|
|
1217
1217
|
completion: te ?? { mode: "mask" },
|
|
1218
|
-
pipe:
|
|
1218
|
+
pipe: g ?? ((Ge) => Ge),
|
|
1219
1219
|
unmask: Q ?? { strategy: "none" },
|
|
1220
1220
|
allowMode: ue ?? "all",
|
|
1221
1221
|
allow: v,
|
|
1222
1222
|
prefix: q,
|
|
1223
1223
|
suffix: U
|
|
1224
1224
|
},
|
|
1225
|
-
|
|
1225
|
+
k.selectionStart ?? A.length,
|
|
1226
1226
|
e.cursor ? i.get(e.cursor) : void 0
|
|
1227
1227
|
) : { value: A, cursor: A.length, completed: !0 };
|
|
1228
1228
|
if (J !== A) {
|
|
1229
|
-
|
|
1229
|
+
k.value = J;
|
|
1230
1230
|
try {
|
|
1231
|
-
|
|
1231
|
+
k.setSelectionRange(he, he);
|
|
1232
1232
|
} catch {
|
|
1233
1233
|
}
|
|
1234
1234
|
}
|
|
1235
|
-
const
|
|
1235
|
+
const De = Zt(J, Q);
|
|
1236
1236
|
o?.({
|
|
1237
|
-
raw:
|
|
1237
|
+
raw: De,
|
|
1238
1238
|
conformed: J,
|
|
1239
|
-
completed:
|
|
1239
|
+
completed: Se,
|
|
1240
1240
|
cursor: he
|
|
1241
|
-
}), M === "input" ? s?.(J) : (n?.(J),
|
|
1241
|
+
}), M === "input" ? s?.(J) : (n?.(J), Se && l?.({ raw: De, conformed: J }));
|
|
1242
1242
|
};
|
|
1243
1243
|
return P({
|
|
1244
1244
|
...e,
|
|
1245
1245
|
input: ee.text(
|
|
1246
1246
|
H(e),
|
|
1247
|
-
a.value(
|
|
1247
|
+
a.value($),
|
|
1248
1248
|
a.class("bc-input"),
|
|
1249
|
-
r != null ?
|
|
1249
|
+
r != null ? C.blur(r) : D,
|
|
1250
1250
|
ie(
|
|
1251
|
-
(
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1251
|
+
(k) => k instanceof HTMLInputElement ? L(
|
|
1252
|
+
C.input(() => w(k, "input")),
|
|
1253
|
+
C.change(() => w(k, "change")),
|
|
1254
|
+
C.keydown((M) => {
|
|
1255
1255
|
if (M.key !== "Backspace" || !(e.cursor ? i.get(e.cursor)?.backspaceRubberBand ?? !0 : !0)) return;
|
|
1256
|
-
const F =
|
|
1257
|
-
if (F !==
|
|
1258
|
-
const V =
|
|
1256
|
+
const F = k.selectionStart ?? 0, S = k.selectionEnd ?? F;
|
|
1257
|
+
if (F !== S || F <= 0) return;
|
|
1258
|
+
const V = k.value ?? "", R = u != null ? i.get(u) : null;
|
|
1259
1259
|
if (!R) return;
|
|
1260
|
-
const re = c != null ? i.get(c) : void 0, le =
|
|
1260
|
+
const re = c != null ? i.get(c) : void 0, le = p != null ? i.get(p) : !0, te = f != null ? i.get(f) : void 0, Q = x != null ? i.get(x) : void 0, ue = Xe(
|
|
1261
1261
|
typeof R == "function" ? R(V, {
|
|
1262
1262
|
raw: V,
|
|
1263
1263
|
previousConformed: V,
|
|
@@ -1274,10 +1274,10 @@ const Xe = (e) => {
|
|
|
1274
1274
|
if (q.has(V[F - 1])) {
|
|
1275
1275
|
let U = F - 1;
|
|
1276
1276
|
for (; U >= 0 && q.has(V[U]); ) U--;
|
|
1277
|
-
U >= 0 && (M.preventDefault(), M.stopPropagation(),
|
|
1277
|
+
U >= 0 && (M.preventDefault(), M.stopPropagation(), k.value = V.slice(0, U) + V.slice(U + 1), w(k, "input"));
|
|
1278
1278
|
}
|
|
1279
1279
|
})
|
|
1280
|
-
) :
|
|
1280
|
+
) : D
|
|
1281
1281
|
)
|
|
1282
1282
|
)
|
|
1283
1283
|
});
|
|
@@ -1286,20 +1286,20 @@ function X(e, t, r) {
|
|
|
1286
1286
|
const n = i.map(e, (o) => o != null), s = ye.clearValue;
|
|
1287
1287
|
return E(
|
|
1288
1288
|
n,
|
|
1289
|
-
() =>
|
|
1289
|
+
() => y.button(
|
|
1290
1290
|
a.type("button"),
|
|
1291
1291
|
a.class("bc-input-container__reset"),
|
|
1292
1292
|
N.label(s),
|
|
1293
1293
|
a.title(s),
|
|
1294
1294
|
a.disabled(t ?? !1),
|
|
1295
1295
|
z({ icon: "mdi:close", size: "sm" }),
|
|
1296
|
-
|
|
1296
|
+
C.click((o) => {
|
|
1297
1297
|
o.preventDefault(), o.stopPropagation(), r?.(null);
|
|
1298
1298
|
})
|
|
1299
1299
|
)
|
|
1300
1300
|
);
|
|
1301
1301
|
}
|
|
1302
|
-
const
|
|
1302
|
+
const $n = (e) => {
|
|
1303
1303
|
const { value: t, onBlur: r, onChange: n, after: s, disabled: o } = e, l = X(t, o, n);
|
|
1304
1304
|
return P({
|
|
1305
1305
|
...e,
|
|
@@ -1307,234 +1307,234 @@ const wn = (e) => {
|
|
|
1307
1307
|
H(e),
|
|
1308
1308
|
a.valueAsDate(t),
|
|
1309
1309
|
a.class("bc-input"),
|
|
1310
|
-
r != null ?
|
|
1311
|
-
n != null ?
|
|
1310
|
+
r != null ? C.blur(j(r)) : D,
|
|
1311
|
+
n != null ? C.change(et(n)) : D
|
|
1312
1312
|
),
|
|
1313
1313
|
after: s != null ? L(l, s) : l
|
|
1314
1314
|
});
|
|
1315
|
-
},
|
|
1315
|
+
}, Yt = (e) => {
|
|
1316
1316
|
const t = e.getFullYear(), r = e.getMonth() + 1, n = e.getDate(), s = e.getHours(), o = e.getMinutes(), l = e.getSeconds();
|
|
1317
1317
|
return `${t}-${r.toString().padStart(2, "0")}-${n.toString().padStart(2, "0")}T${s.toString().padStart(2, "0")}:${o.toString().padStart(2, "0")}:${l.toString().padStart(2, "0")}`;
|
|
1318
|
-
},
|
|
1319
|
-
const { value: t, onBlur: r, onChange: n, after: s, disabled: o } = e, l = i.map(t, (c) => c != null ?
|
|
1318
|
+
}, yn = (e) => {
|
|
1319
|
+
const { value: t, onBlur: r, onChange: n, after: s, disabled: o } = e, l = i.map(t, (c) => c != null ? Yt(c) : null), u = X(t, o, n);
|
|
1320
1320
|
return P({
|
|
1321
1321
|
...e,
|
|
1322
1322
|
input: ee["datetime-local"](
|
|
1323
1323
|
H(e),
|
|
1324
1324
|
a.value(i.map(l, (c) => c ?? null)),
|
|
1325
1325
|
a.class("bc-input"),
|
|
1326
|
-
r != null ?
|
|
1327
|
-
n != null ?
|
|
1326
|
+
r != null ? C.blur(j(r)) : D,
|
|
1327
|
+
n != null ? C.change(tt(n)) : D
|
|
1328
1328
|
),
|
|
1329
1329
|
after: s != null ? L(u, s) : u
|
|
1330
1330
|
});
|
|
1331
|
-
}, Y = (e) => typeof e == "string" && e.trim() === "" ? null : e, se = (e) => e ?? "",
|
|
1331
|
+
}, Y = (e) => typeof e == "string" && e.trim() === "" ? null : e, se = (e) => e ?? "", kn = (e) => {
|
|
1332
1332
|
const { value: t, onBlur: r, onChange: n, onInput: s, after: o, disabled: l, ...u } = e, c = X(t, l, n);
|
|
1333
|
-
return
|
|
1333
|
+
return ut({
|
|
1334
1334
|
...u,
|
|
1335
1335
|
value: i.map(t, se),
|
|
1336
|
-
onChange: n != null ? (
|
|
1337
|
-
onInput: s != null ? (
|
|
1336
|
+
onChange: n != null ? (p) => n(Y(p)) : void 0,
|
|
1337
|
+
onInput: s != null ? (p) => s(Y(p)) : void 0,
|
|
1338
1338
|
onBlur: r,
|
|
1339
1339
|
after: o != null ? L(c, o) : c
|
|
1340
1340
|
});
|
|
1341
|
-
},
|
|
1341
|
+
}, In = (e) => {
|
|
1342
1342
|
const { value: t, onBlur: r, onChange: n, onInput: s, after: o, disabled: l, ...u } = e, c = X(t, l, n);
|
|
1343
|
-
return
|
|
1343
|
+
return pt({
|
|
1344
1344
|
...u,
|
|
1345
1345
|
value: i.map(t, se),
|
|
1346
|
-
onChange: n != null ? (
|
|
1347
|
-
onInput: s != null ? (
|
|
1346
|
+
onChange: n != null ? (p) => n(Y(p)) : void 0,
|
|
1347
|
+
onInput: s != null ? (p) => s(Y(p)) : void 0,
|
|
1348
1348
|
onBlur: r,
|
|
1349
1349
|
after: o != null ? L(c, o) : c
|
|
1350
1350
|
});
|
|
1351
|
-
},
|
|
1351
|
+
}, Cn = (e) => {
|
|
1352
1352
|
const { value: t, onBlur: r, onChange: n, onInput: s, after: o, disabled: l, ...u } = e, c = X(t, l, n);
|
|
1353
|
-
return
|
|
1353
|
+
return dt({
|
|
1354
1354
|
...u,
|
|
1355
1355
|
value: i.map(t, se),
|
|
1356
|
-
onChange: n != null ? (
|
|
1357
|
-
onInput: s != null ? (
|
|
1356
|
+
onChange: n != null ? (p) => n(Y(p)) : void 0,
|
|
1357
|
+
onInput: s != null ? (p) => s(Y(p)) : void 0,
|
|
1358
1358
|
onBlur: r,
|
|
1359
1359
|
after: o != null ? L(c, o) : c
|
|
1360
1360
|
});
|
|
1361
|
-
},
|
|
1361
|
+
}, Xt = (e) => {
|
|
1362
1362
|
const { value: t, onBlur: r, onChange: n, onInput: s, rows: o } = e;
|
|
1363
1363
|
return P({
|
|
1364
1364
|
...e,
|
|
1365
|
-
input:
|
|
1365
|
+
input: y.textarea(
|
|
1366
1366
|
H(e),
|
|
1367
1367
|
a.rows(o ?? 3),
|
|
1368
1368
|
a.value(t),
|
|
1369
1369
|
a.class("bc-input"),
|
|
1370
|
-
r != null ?
|
|
1371
|
-
n != null ?
|
|
1372
|
-
s != null ?
|
|
1370
|
+
r != null ? C.blur(j(r)) : D,
|
|
1371
|
+
n != null ? C.change(j(n)) : D,
|
|
1372
|
+
s != null ? C.input(j(s)) : D
|
|
1373
1373
|
)
|
|
1374
1374
|
});
|
|
1375
|
-
},
|
|
1375
|
+
}, Mn = (e) => {
|
|
1376
1376
|
const { value: t, onBlur: r, onChange: n, onInput: s, after: o, disabled: l, ...u } = e, c = X(t, l, n);
|
|
1377
|
-
return
|
|
1377
|
+
return Xt({
|
|
1378
1378
|
...u,
|
|
1379
1379
|
value: i.map(t, se),
|
|
1380
|
-
onChange: n != null ? (
|
|
1381
|
-
onInput: s != null ? (
|
|
1380
|
+
onChange: n != null ? (p) => n(Y(p)) : void 0,
|
|
1381
|
+
onInput: s != null ? (p) => s(Y(p)) : void 0,
|
|
1382
1382
|
onBlur: r,
|
|
1383
1383
|
after: o != null ? L(c, o) : c
|
|
1384
1384
|
});
|
|
1385
|
-
},
|
|
1386
|
-
const { value: t, step: r, min: n, max: s, onBlur: o, onChange: l, onInput: u, after: c } = e,
|
|
1387
|
-
const
|
|
1388
|
-
return
|
|
1389
|
-
},
|
|
1390
|
-
const
|
|
1385
|
+
}, Tn = (e) => {
|
|
1386
|
+
const { value: t, step: r, min: n, max: s, onBlur: o, onChange: l, onInput: u, after: c } = e, p = (x) => {
|
|
1387
|
+
const d = n != null ? i.get(n) : void 0, g = s != null ? i.get(s) : void 0;
|
|
1388
|
+
return d != null && x < d ? d : g != null && x > g ? g : x;
|
|
1389
|
+
}, m = r != null ? O(W, (x) => {
|
|
1390
|
+
const d = B(
|
|
1391
1391
|
t,
|
|
1392
1392
|
n
|
|
1393
|
-
)((
|
|
1393
|
+
)((h, v) => v == null ? !0 : (h ?? 0) > v), g = B(
|
|
1394
1394
|
t,
|
|
1395
1395
|
s
|
|
1396
|
-
)((
|
|
1397
|
-
const v = i.get(t) ?? 0, T = i.get(r),
|
|
1398
|
-
if (w != null &&
|
|
1396
|
+
)((h, v) => v == null ? !0 : (h ?? 0) < v), b = (h) => {
|
|
1397
|
+
const v = i.get(t) ?? 0, T = i.get(r), I = h?.shiftKey ? 10 : 1, $ = v - T * I, w = n != null ? i.get(n) : void 0;
|
|
1398
|
+
if (w != null && $ < w)
|
|
1399
1399
|
return;
|
|
1400
|
-
const
|
|
1401
|
-
|
|
1402
|
-
}, _ = (
|
|
1403
|
-
const v = i.get(t) ?? 0, T = i.get(r),
|
|
1404
|
-
if (w != null &&
|
|
1400
|
+
const k = p($);
|
|
1401
|
+
k !== v && l && l(k);
|
|
1402
|
+
}, _ = (h) => {
|
|
1403
|
+
const v = i.get(t) ?? 0, T = i.get(r), I = h?.shiftKey ? 10 : 1, $ = v + T * I, w = s != null ? i.get(s) : void 0;
|
|
1404
|
+
if (w != null && $ > w)
|
|
1405
1405
|
return;
|
|
1406
|
-
const
|
|
1407
|
-
|
|
1406
|
+
const k = p($);
|
|
1407
|
+
k !== v && l && l(k);
|
|
1408
1408
|
};
|
|
1409
1409
|
return ne(
|
|
1410
1410
|
a.class("bc-number-input-steppers"),
|
|
1411
1411
|
// Increment second
|
|
1412
|
-
|
|
1412
|
+
y.button(
|
|
1413
1413
|
a.class(
|
|
1414
1414
|
"bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"
|
|
1415
1415
|
),
|
|
1416
1416
|
a.disabled(
|
|
1417
1417
|
B(
|
|
1418
|
-
|
|
1418
|
+
g,
|
|
1419
1419
|
e.disabled ?? !1
|
|
1420
|
-
)((
|
|
1420
|
+
)((h, v) => !h || v)
|
|
1421
1421
|
),
|
|
1422
|
-
|
|
1423
|
-
N.label(
|
|
1422
|
+
C.click((h) => _(h)),
|
|
1423
|
+
N.label(x.$.incrementValue),
|
|
1424
1424
|
z({ icon: "line-md:plus", size: "xs" })
|
|
1425
1425
|
),
|
|
1426
1426
|
// Decrement first (matches tests expecting first button to be decrement)
|
|
1427
|
-
|
|
1427
|
+
y.button(
|
|
1428
1428
|
a.class(
|
|
1429
1429
|
"bc-button bc-number-input-steppers-button bc-number-input-steppers-button--decrement"
|
|
1430
1430
|
),
|
|
1431
1431
|
a.disabled(
|
|
1432
1432
|
B(
|
|
1433
|
-
|
|
1433
|
+
d,
|
|
1434
1434
|
e.disabled ?? !1
|
|
1435
|
-
)((
|
|
1435
|
+
)((h, v) => !h || v)
|
|
1436
1436
|
),
|
|
1437
|
-
|
|
1438
|
-
N.label(
|
|
1437
|
+
C.click((h) => b(h)),
|
|
1438
|
+
N.label(x.$.decrementValue),
|
|
1439
1439
|
z({ icon: "line-md:minus", size: "xs" })
|
|
1440
1440
|
)
|
|
1441
1441
|
);
|
|
1442
|
-
}) : null,
|
|
1442
|
+
}) : null, f = c != null && m != null ? L(m, c) : c ?? m;
|
|
1443
1443
|
return P({
|
|
1444
1444
|
...e,
|
|
1445
1445
|
input: ee.number(
|
|
1446
1446
|
n != null ? L(
|
|
1447
1447
|
a.min(n),
|
|
1448
1448
|
Z(
|
|
1449
|
-
i.on(n, (
|
|
1450
|
-
|
|
1449
|
+
i.on(n, (x) => {
|
|
1450
|
+
x < i.get(t);
|
|
1451
1451
|
})
|
|
1452
1452
|
)
|
|
1453
|
-
) :
|
|
1453
|
+
) : D,
|
|
1454
1454
|
s != null ? L(
|
|
1455
1455
|
a.max(s),
|
|
1456
1456
|
Z(
|
|
1457
|
-
i.on(s, (
|
|
1458
|
-
|
|
1457
|
+
i.on(s, (x) => {
|
|
1458
|
+
x > i.get(t);
|
|
1459
1459
|
})
|
|
1460
1460
|
)
|
|
1461
|
-
) :
|
|
1461
|
+
) : D,
|
|
1462
1462
|
H(e),
|
|
1463
1463
|
a.valueAsNumber(t),
|
|
1464
1464
|
a.step(r),
|
|
1465
1465
|
a.class("bc-input bc-number-input"),
|
|
1466
|
-
o != null ?
|
|
1467
|
-
l != null ?
|
|
1468
|
-
u != null ?
|
|
1466
|
+
o != null ? C.blur(j(o)) : D,
|
|
1467
|
+
l != null ? C.change(G(l)) : D,
|
|
1468
|
+
u != null ? C.input(G(u)) : D,
|
|
1469
1469
|
// Add wheel event support when step is defined
|
|
1470
|
-
r != null ?
|
|
1471
|
-
|
|
1472
|
-
const
|
|
1473
|
-
|
|
1474
|
-
}) :
|
|
1470
|
+
r != null ? C.wheel((x) => {
|
|
1471
|
+
x.preventDefault();
|
|
1472
|
+
const d = i.get(t) ?? 0, g = i.get(r), b = x.shiftKey ? 10 : 1, _ = x.deltaY < 0 ? g * b : -g * b, h = p(d + _);
|
|
1473
|
+
h !== d && l && l(h);
|
|
1474
|
+
}) : D
|
|
1475
1475
|
),
|
|
1476
|
-
after:
|
|
1476
|
+
after: f
|
|
1477
1477
|
});
|
|
1478
|
-
},
|
|
1478
|
+
}, Re = (e) => {
|
|
1479
1479
|
if (e == null || e === "") return null;
|
|
1480
1480
|
const t = Number(e);
|
|
1481
1481
|
return Number.isNaN(t) ? null : t;
|
|
1482
|
-
},
|
|
1483
|
-
const { value: t, step: r, min: n, max: s, onBlur: o, onChange: l, onInput: u, after: c } = e,
|
|
1484
|
-
const
|
|
1485
|
-
return
|
|
1486
|
-
},
|
|
1482
|
+
}, Sn = (e) => {
|
|
1483
|
+
const { value: t, step: r, min: n, max: s, onBlur: o, onChange: l, onInput: u, after: c } = e, p = (d) => {
|
|
1484
|
+
const g = n != null ? i.get(n) : void 0, b = s != null ? i.get(s) : void 0;
|
|
1485
|
+
return g != null && d < g ? g : b != null && d > b ? b : d;
|
|
1486
|
+
}, m = (() => {
|
|
1487
1487
|
if (r == null) return null;
|
|
1488
|
-
const
|
|
1488
|
+
const d = B(
|
|
1489
1489
|
t,
|
|
1490
1490
|
n
|
|
1491
1491
|
)((v, T) => {
|
|
1492
|
-
const
|
|
1493
|
-
return T == null ? !0 :
|
|
1494
|
-
}),
|
|
1492
|
+
const I = v ?? 0;
|
|
1493
|
+
return T == null ? !0 : I > T;
|
|
1494
|
+
}), g = B(
|
|
1495
1495
|
t,
|
|
1496
1496
|
s
|
|
1497
1497
|
)((v, T) => {
|
|
1498
|
-
const
|
|
1499
|
-
return T == null ? !0 :
|
|
1500
|
-
}),
|
|
1501
|
-
const T = i.get(t) ?? 0,
|
|
1502
|
-
if (
|
|
1503
|
-
const M =
|
|
1498
|
+
const I = v ?? 0;
|
|
1499
|
+
return T == null ? !0 : I < T;
|
|
1500
|
+
}), b = (v) => {
|
|
1501
|
+
const T = i.get(t) ?? 0, I = i.get(r), $ = v?.shiftKey ? 10 : 1, w = T - I * $, k = n != null ? i.get(n) : void 0;
|
|
1502
|
+
if (k != null && w < k) return;
|
|
1503
|
+
const M = p(w);
|
|
1504
1504
|
M !== T && l && l(M);
|
|
1505
1505
|
}, _ = (v) => {
|
|
1506
|
-
const T = i.get(t) ?? 0,
|
|
1507
|
-
if (
|
|
1508
|
-
const M =
|
|
1506
|
+
const T = i.get(t) ?? 0, I = i.get(r), $ = v?.shiftKey ? 10 : 1, w = T + I * $, k = s != null ? i.get(s) : void 0;
|
|
1507
|
+
if (k != null && w > k) return;
|
|
1508
|
+
const M = p(w);
|
|
1509
1509
|
M !== T && l && l(M);
|
|
1510
1510
|
};
|
|
1511
1511
|
return ((v, T) => ne(
|
|
1512
1512
|
a.class("bc-number-input-steppers"),
|
|
1513
|
-
|
|
1513
|
+
y.button(
|
|
1514
1514
|
a.class(
|
|
1515
1515
|
"bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"
|
|
1516
1516
|
),
|
|
1517
1517
|
a.disabled(
|
|
1518
1518
|
B(
|
|
1519
|
-
|
|
1519
|
+
g,
|
|
1520
1520
|
e.disabled ?? !1
|
|
1521
|
-
)((
|
|
1521
|
+
)((I, $) => !I || $)
|
|
1522
1522
|
),
|
|
1523
|
-
|
|
1523
|
+
C.click((I) => _(I)),
|
|
1524
1524
|
N.label(v),
|
|
1525
1525
|
z({ icon: "line-md:plus", size: "xs" })
|
|
1526
1526
|
),
|
|
1527
|
-
|
|
1527
|
+
y.button(
|
|
1528
1528
|
a.class(
|
|
1529
1529
|
"bc-button bc-number-input-steppers-button bc-number-input-steppers-button--decrement"
|
|
1530
1530
|
),
|
|
1531
1531
|
a.disabled(
|
|
1532
1532
|
B(
|
|
1533
|
-
|
|
1533
|
+
d,
|
|
1534
1534
|
e.disabled ?? !1
|
|
1535
|
-
)((
|
|
1535
|
+
)((I, $) => !I || $)
|
|
1536
1536
|
),
|
|
1537
|
-
|
|
1537
|
+
C.click((I) => b(I)),
|
|
1538
1538
|
N.label(T),
|
|
1539
1539
|
z({ icon: "line-md:minus", size: "xs" })
|
|
1540
1540
|
)
|
|
@@ -1542,7 +1542,7 @@ const wn = (e) => {
|
|
|
1542
1542
|
ye.incrementValue,
|
|
1543
1543
|
ye.decrementValue
|
|
1544
1544
|
);
|
|
1545
|
-
})(),
|
|
1545
|
+
})(), f = X(t, e.disabled, l), x = c != null && m != null ? L(m, f, c) : c != null ? L(f, c) : m != null ? L(m, f) : f;
|
|
1546
1546
|
return P({
|
|
1547
1547
|
...e,
|
|
1548
1548
|
input: ee.number(
|
|
@@ -1550,45 +1550,45 @@ const wn = (e) => {
|
|
|
1550
1550
|
n != null ? L(
|
|
1551
1551
|
a.min(n),
|
|
1552
1552
|
Z(
|
|
1553
|
-
i.on(n, (
|
|
1553
|
+
i.on(n, (d) => {
|
|
1554
1554
|
})
|
|
1555
1555
|
)
|
|
1556
|
-
) :
|
|
1556
|
+
) : D,
|
|
1557
1557
|
s != null ? L(
|
|
1558
1558
|
a.max(s),
|
|
1559
1559
|
Z(
|
|
1560
|
-
i.on(s, (
|
|
1560
|
+
i.on(s, (d) => {
|
|
1561
1561
|
})
|
|
1562
1562
|
)
|
|
1563
|
-
) :
|
|
1563
|
+
) : D,
|
|
1564
1564
|
H(e),
|
|
1565
1565
|
// Represent null as empty string so the field can be cleared
|
|
1566
|
-
a.value(i.map(t, (
|
|
1566
|
+
a.value(i.map(t, (d) => d == null ? "" : String(d))),
|
|
1567
1567
|
a.step(r),
|
|
1568
1568
|
a.class("bc-input bc-number-input"),
|
|
1569
|
-
o != null ?
|
|
1570
|
-
l != null ?
|
|
1571
|
-
j((
|
|
1572
|
-
const
|
|
1573
|
-
l(
|
|
1569
|
+
o != null ? C.blur(j(o)) : D,
|
|
1570
|
+
l != null ? C.change(
|
|
1571
|
+
j((d) => {
|
|
1572
|
+
const g = Re(d);
|
|
1573
|
+
l(g);
|
|
1574
1574
|
})
|
|
1575
|
-
) :
|
|
1576
|
-
u != null ?
|
|
1577
|
-
j((
|
|
1578
|
-
const
|
|
1579
|
-
u(
|
|
1575
|
+
) : D,
|
|
1576
|
+
u != null ? C.input(
|
|
1577
|
+
j((d) => {
|
|
1578
|
+
const g = Re(d);
|
|
1579
|
+
u(g);
|
|
1580
1580
|
})
|
|
1581
|
-
) :
|
|
1581
|
+
) : D,
|
|
1582
1582
|
// Wheel support when step is defined
|
|
1583
|
-
r != null ?
|
|
1584
|
-
|
|
1585
|
-
const
|
|
1586
|
-
v !==
|
|
1587
|
-
}) :
|
|
1583
|
+
r != null ? C.wheel((d) => {
|
|
1584
|
+
d.preventDefault();
|
|
1585
|
+
const g = i.get(t) ?? 0, b = i.get(r), _ = d.shiftKey ? 10 : 1, h = d.deltaY < 0 ? b * _ : -b * _, v = p(g + h);
|
|
1586
|
+
v !== g && l && l(v);
|
|
1587
|
+
}) : D
|
|
1588
1588
|
),
|
|
1589
|
-
after:
|
|
1589
|
+
after: x
|
|
1590
1590
|
});
|
|
1591
|
-
},
|
|
1591
|
+
}, Dn = ({
|
|
1592
1592
|
value: e,
|
|
1593
1593
|
onChange: t,
|
|
1594
1594
|
offLabel: r,
|
|
@@ -1596,97 +1596,110 @@ const wn = (e) => {
|
|
|
1596
1596
|
label: s,
|
|
1597
1597
|
disabled: o = !1,
|
|
1598
1598
|
size: l = "md",
|
|
1599
|
-
id: u
|
|
1599
|
+
id: u,
|
|
1600
|
+
color: c = "primary"
|
|
1600
1601
|
}) => {
|
|
1601
|
-
const
|
|
1602
|
-
function
|
|
1603
|
-
const
|
|
1602
|
+
const p = u ?? ft("switch"), m = `${p}-label`;
|
|
1603
|
+
function f(b, _) {
|
|
1604
|
+
const h = [
|
|
1604
1605
|
"bc-switch",
|
|
1605
|
-
`bc-switch--size-${
|
|
1606
|
-
`bc-switch--${
|
|
1606
|
+
`bc-switch--size-${_}`,
|
|
1607
|
+
`bc-switch--${_}`
|
|
1607
1608
|
];
|
|
1608
|
-
return
|
|
1609
|
+
return b && h.push("bc-switch--disabled"), h.join(" ");
|
|
1610
|
+
}
|
|
1611
|
+
function x(b) {
|
|
1612
|
+
const _ = b ?? "primary", h = /* @__PURE__ */ new Map(), v = Ve(_, "solid", "light"), T = Ve(_, "solid", "dark");
|
|
1613
|
+
return h.set("--switch-track-on-bg", v.backgroundColor), h.set("--switch-track-on-label", v.textColor), h.set("--switch-track-on-bg-dark", T.backgroundColor), h.set("--switch-track-on-label-dark", T.textColor), h.set(
|
|
1614
|
+
"--switch-track-on-border-dark",
|
|
1615
|
+
gt(_, "dark")
|
|
1616
|
+
), Array.from(h.entries()).map(([I, $]) => `${I}: ${$}`).join("; ");
|
|
1609
1617
|
}
|
|
1610
1618
|
const d = () => {
|
|
1611
1619
|
i.get(o) || t(!i.get(e));
|
|
1612
|
-
},
|
|
1613
|
-
i.get(o) || (
|
|
1620
|
+
}, g = (b) => {
|
|
1621
|
+
i.get(o) || (b.key === " " || b.key === "Enter") && (b.preventDefault(), d());
|
|
1614
1622
|
};
|
|
1615
|
-
return
|
|
1623
|
+
return y.div(
|
|
1616
1624
|
a.class(
|
|
1617
1625
|
B(
|
|
1618
1626
|
o ?? !1,
|
|
1619
1627
|
l
|
|
1620
1628
|
)(
|
|
1621
|
-
(
|
|
1629
|
+
(b, _) => f(b ?? !1, _ ?? "md")
|
|
1630
|
+
)
|
|
1631
|
+
),
|
|
1632
|
+
a.style(
|
|
1633
|
+
B(c)(
|
|
1634
|
+
(b) => x(b)
|
|
1622
1635
|
)
|
|
1623
1636
|
),
|
|
1624
|
-
a.id(
|
|
1637
|
+
a.id(p),
|
|
1625
1638
|
a.role("switch"),
|
|
1626
1639
|
a.tabindex(
|
|
1627
|
-
i.map(o, (
|
|
1640
|
+
i.map(o, (b) => b ? -1 : 0)
|
|
1628
1641
|
),
|
|
1629
1642
|
N.checked(e),
|
|
1630
1643
|
N.disabled(o),
|
|
1631
|
-
N.labelledby(s != null ?
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
s != null ?
|
|
1635
|
-
a.id(
|
|
1644
|
+
N.labelledby(s != null ? m : void 0),
|
|
1645
|
+
C.click(d),
|
|
1646
|
+
C.keydown(g),
|
|
1647
|
+
s != null ? mt(
|
|
1648
|
+
a.id(m),
|
|
1636
1649
|
a.class(
|
|
1637
1650
|
`bc-switch__label bc-switch__label--size-${l} bc-switch__label--nowrap`
|
|
1638
1651
|
),
|
|
1639
1652
|
s
|
|
1640
1653
|
) : null,
|
|
1641
|
-
|
|
1654
|
+
y.div(
|
|
1642
1655
|
a.class("bc-switch__track"),
|
|
1643
1656
|
a.class(
|
|
1644
1657
|
i.map(
|
|
1645
1658
|
e,
|
|
1646
|
-
(
|
|
1659
|
+
(b) => b ? "bc-switch__track--on" : "bc-switch__track--off"
|
|
1647
1660
|
)
|
|
1648
1661
|
),
|
|
1649
|
-
r != null ?
|
|
1662
|
+
r != null ? y.div(
|
|
1650
1663
|
N.hidden(!0),
|
|
1651
1664
|
a.class("bc-switch__track-label bc-switch__track-label--off"),
|
|
1652
1665
|
a.class(
|
|
1653
1666
|
i.map(
|
|
1654
1667
|
e,
|
|
1655
|
-
(
|
|
1668
|
+
(b) => b ? "bc-switch__track-label--hidden" : "bc-switch__track-label--visible"
|
|
1656
1669
|
)
|
|
1657
1670
|
),
|
|
1658
1671
|
r
|
|
1659
1672
|
) : null,
|
|
1660
|
-
n != null ?
|
|
1673
|
+
n != null ? y.div(
|
|
1661
1674
|
a.class("bc-switch__track-label bc-switch__track-label--on"),
|
|
1662
1675
|
a.class(
|
|
1663
1676
|
i.map(
|
|
1664
1677
|
e,
|
|
1665
|
-
(
|
|
1678
|
+
(b) => b ? "bc-switch__track-label--visible" : "bc-switch__track-label--hidden"
|
|
1666
1679
|
)
|
|
1667
1680
|
),
|
|
1668
1681
|
n
|
|
1669
1682
|
) : null,
|
|
1670
|
-
|
|
1671
|
-
(
|
|
1672
|
-
|
|
1673
|
-
({ direction:
|
|
1683
|
+
He(
|
|
1684
|
+
(b) => O(
|
|
1685
|
+
ht,
|
|
1686
|
+
({ direction: _ }) => y.div(
|
|
1674
1687
|
a.class("bc-switch__thumb"),
|
|
1675
1688
|
a.class(
|
|
1676
1689
|
i.map(
|
|
1677
1690
|
e,
|
|
1678
|
-
(
|
|
1691
|
+
(h) => h ? "bc-switch__thumb--on" : "bc-switch__thumb--off"
|
|
1679
1692
|
)
|
|
1680
1693
|
),
|
|
1681
|
-
|
|
1694
|
+
de.transform(
|
|
1682
1695
|
B(
|
|
1683
1696
|
e,
|
|
1684
|
-
|
|
1697
|
+
b,
|
|
1685
1698
|
l,
|
|
1686
|
-
|
|
1687
|
-
)((
|
|
1688
|
-
const
|
|
1689
|
-
switch (
|
|
1699
|
+
_
|
|
1700
|
+
)((h, { width: v }, T, I) => {
|
|
1701
|
+
const $ = (() => {
|
|
1702
|
+
switch (T) {
|
|
1690
1703
|
case "xs":
|
|
1691
1704
|
return 5;
|
|
1692
1705
|
case "sm":
|
|
@@ -1698,8 +1711,8 @@ const wn = (e) => {
|
|
|
1698
1711
|
case "xl":
|
|
1699
1712
|
return 8;
|
|
1700
1713
|
}
|
|
1701
|
-
})(),
|
|
1702
|
-
return
|
|
1714
|
+
})(), w = I === "rtl" ? `calc((var(--spacing-base) * ${$}) - ${v}px)` : `calc(${v}px - (var(--spacing-base) * ${$}))`;
|
|
1715
|
+
return h ? `translateX(${w})` : "translateX(0)";
|
|
1703
1716
|
})
|
|
1704
1717
|
)
|
|
1705
1718
|
)
|
|
@@ -1707,13 +1720,13 @@ const wn = (e) => {
|
|
|
1707
1720
|
)
|
|
1708
1721
|
)
|
|
1709
1722
|
);
|
|
1710
|
-
},
|
|
1723
|
+
}, qt = (e) => {
|
|
1711
1724
|
const t = {
|
|
1712
1725
|
type: "pattern",
|
|
1713
1726
|
pattern: /[0-9A-Fa-f]/,
|
|
1714
1727
|
transform: (n) => n.toLowerCase()
|
|
1715
1728
|
};
|
|
1716
|
-
return
|
|
1729
|
+
return qe({
|
|
1717
1730
|
...e,
|
|
1718
1731
|
mask: [
|
|
1719
1732
|
t,
|
|
@@ -1756,17 +1769,17 @@ const wn = (e) => {
|
|
|
1756
1769
|
// Sensible default placeholder; can be overridden via options.placeholder
|
|
1757
1770
|
placeholder: e.placeholder ?? "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
1758
1771
|
});
|
|
1759
|
-
},
|
|
1772
|
+
}, An = (e) => {
|
|
1760
1773
|
const { value: t, onBlur: r, onChange: n, onInput: s, after: o, disabled: l, ...u } = e, c = X(t, l, n);
|
|
1761
|
-
return
|
|
1774
|
+
return qt({
|
|
1762
1775
|
...u,
|
|
1763
1776
|
value: i.map(t, se),
|
|
1764
|
-
onChange: n != null ? (
|
|
1765
|
-
onInput: s != null ? (
|
|
1777
|
+
onChange: n != null ? (p) => n(Y(p)) : void 0,
|
|
1778
|
+
onInput: s != null ? (p) => s(Y(p)) : void 0,
|
|
1766
1779
|
onBlur: r,
|
|
1767
1780
|
after: o != null ? L(c, o) : c
|
|
1768
1781
|
});
|
|
1769
|
-
},
|
|
1782
|
+
}, Gt = "line-md:star-alt-filled", Qt = "line-md:star-alt", Jt = (e) => {
|
|
1770
1783
|
const {
|
|
1771
1784
|
value: t,
|
|
1772
1785
|
onChange: r,
|
|
@@ -1774,64 +1787,64 @@ const wn = (e) => {
|
|
|
1774
1787
|
max: s = 5,
|
|
1775
1788
|
fullColor: o = "yellow",
|
|
1776
1789
|
emptyColor: l = "neutral",
|
|
1777
|
-
fullIcon: u =
|
|
1778
|
-
emptyIcon: c =
|
|
1779
|
-
size:
|
|
1780
|
-
onBlur:
|
|
1781
|
-
rounding:
|
|
1782
|
-
} = e,
|
|
1783
|
-
const v = i.get(
|
|
1790
|
+
fullIcon: u = Gt,
|
|
1791
|
+
emptyIcon: c = Qt,
|
|
1792
|
+
size: p = "md",
|
|
1793
|
+
onBlur: m,
|
|
1794
|
+
rounding: f = 1
|
|
1795
|
+
} = e, x = () => {
|
|
1796
|
+
const v = i.get(f);
|
|
1784
1797
|
return v > 0 ? v : 1;
|
|
1785
|
-
},
|
|
1798
|
+
}, d = (v) => Math.min(Math.max(v, 0), i.get(s)), g = (v, T) => {
|
|
1786
1799
|
if (i.get(n ?? !1)) return;
|
|
1787
|
-
const
|
|
1800
|
+
const $ = v.currentTarget.getBoundingClientRect(), w = (v.clientX - $.left) / $.width, k = T - 1 + w, M = x(), A = Math.ceil(k / M) * M, F = d(A);
|
|
1788
1801
|
r?.(F);
|
|
1789
|
-
},
|
|
1802
|
+
}, b = (v) => {
|
|
1790
1803
|
if (i.get(n ?? !1)) return;
|
|
1791
|
-
const T =
|
|
1792
|
-
let
|
|
1804
|
+
const T = x(), I = i.get(t) ?? 0;
|
|
1805
|
+
let $;
|
|
1793
1806
|
switch (v.key) {
|
|
1794
1807
|
case "ArrowRight":
|
|
1795
1808
|
case "ArrowUp":
|
|
1796
|
-
|
|
1809
|
+
$ = d(I + T);
|
|
1797
1810
|
break;
|
|
1798
1811
|
case "ArrowLeft":
|
|
1799
1812
|
case "ArrowDown":
|
|
1800
|
-
|
|
1813
|
+
$ = d(I - T);
|
|
1801
1814
|
break;
|
|
1802
1815
|
case "Home":
|
|
1803
|
-
|
|
1816
|
+
$ = 0;
|
|
1804
1817
|
break;
|
|
1805
1818
|
case "End":
|
|
1806
|
-
|
|
1819
|
+
$ = i.get(s);
|
|
1807
1820
|
break;
|
|
1808
1821
|
default:
|
|
1809
1822
|
return;
|
|
1810
1823
|
}
|
|
1811
|
-
v.preventDefault(), r?.(
|
|
1812
|
-
}, _ = i.map(
|
|
1824
|
+
v.preventDefault(), r?.($);
|
|
1825
|
+
}, _ = i.map(p, (v) => `bc-icon--${v}`), h = ({ index: v, counter: T }) => y.span(
|
|
1813
1826
|
a.class("bc-rating-input__icon-container"),
|
|
1814
1827
|
a.class(_),
|
|
1815
1828
|
z(
|
|
1816
|
-
{ icon: c, size:
|
|
1829
|
+
{ icon: c, size: p, color: l, tone: "soft" },
|
|
1817
1830
|
a.class("bc-rating-input__icon-empty")
|
|
1818
1831
|
),
|
|
1819
|
-
|
|
1832
|
+
y.span(
|
|
1820
1833
|
a.class("bc-rating-input__icon-clipper"),
|
|
1821
1834
|
a.class(_),
|
|
1822
|
-
|
|
1823
|
-
i.map(t, (
|
|
1824
|
-
const
|
|
1825
|
-
return
|
|
1835
|
+
de.width(
|
|
1836
|
+
i.map(t, (I) => {
|
|
1837
|
+
const $ = Math.floor(I);
|
|
1838
|
+
return $ > v ? "100%" : $ < v ? "0%" : `${(I - v) * 100}%`;
|
|
1826
1839
|
})
|
|
1827
1840
|
),
|
|
1828
1841
|
z(
|
|
1829
|
-
{ icon: u, size:
|
|
1842
|
+
{ icon: u, size: p, color: o, tone: "soft" },
|
|
1830
1843
|
a.class("bc-rating-input__icon-full")
|
|
1831
1844
|
)
|
|
1832
1845
|
),
|
|
1833
|
-
|
|
1834
|
-
|
|
1846
|
+
C.click(
|
|
1847
|
+
nt((I) => g(I, T), {
|
|
1835
1848
|
preventDefault: !0,
|
|
1836
1849
|
stopPropagation: !0
|
|
1837
1850
|
})
|
|
@@ -1842,7 +1855,7 @@ const wn = (e) => {
|
|
|
1842
1855
|
growInput: !1,
|
|
1843
1856
|
focusableSelector: '[role="slider"]',
|
|
1844
1857
|
...e,
|
|
1845
|
-
input:
|
|
1858
|
+
input: y.div(
|
|
1846
1859
|
// Common input attributes (id, required, invalid, custom classes, etc.)
|
|
1847
1860
|
H(e),
|
|
1848
1861
|
a.class("bc-rating-input"),
|
|
@@ -1858,19 +1871,19 @@ const wn = (e) => {
|
|
|
1858
1871
|
t,
|
|
1859
1872
|
s
|
|
1860
1873
|
)((v, T) => {
|
|
1861
|
-
const
|
|
1862
|
-
return `${String(
|
|
1874
|
+
const I = v ?? 0, $ = T ?? 0;
|
|
1875
|
+
return `${String(I)} / ${String($)}`;
|
|
1863
1876
|
})
|
|
1864
1877
|
),
|
|
1865
1878
|
// Keyboard & focus handlers
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1879
|
+
C.keydown(b),
|
|
1880
|
+
m != null ? C.blur(m) : null,
|
|
1881
|
+
je(s, h)
|
|
1869
1882
|
)
|
|
1870
1883
|
});
|
|
1871
|
-
},
|
|
1884
|
+
}, Fn = (e) => {
|
|
1872
1885
|
const { value: t, onChange: r, onBlur: n, after: s, disabled: o, ...l } = e, u = X(t, o, r);
|
|
1873
|
-
return
|
|
1886
|
+
return Jt({
|
|
1874
1887
|
...l,
|
|
1875
1888
|
// Map null -> 0 for display so the control shows as empty when null
|
|
1876
1889
|
value: i.map(t, (c) => c ?? 0),
|
|
@@ -1879,13 +1892,13 @@ const wn = (e) => {
|
|
|
1879
1892
|
onBlur: n,
|
|
1880
1893
|
after: s != null ? L(u, s) : u
|
|
1881
1894
|
});
|
|
1882
|
-
},
|
|
1895
|
+
}, Bn = (e) => {
|
|
1883
1896
|
const { value: t, step: r, min: n, max: s, onBlur: o, onChange: l, onInput: u } = e;
|
|
1884
1897
|
return P({
|
|
1885
1898
|
...e,
|
|
1886
1899
|
// Make sure clicks anywhere focus the range input
|
|
1887
1900
|
focusableSelector: 'input[type="range"]',
|
|
1888
|
-
input:
|
|
1901
|
+
input: y.input(
|
|
1889
1902
|
a.type("range"),
|
|
1890
1903
|
H(e),
|
|
1891
1904
|
a.min(n),
|
|
@@ -1894,25 +1907,25 @@ const wn = (e) => {
|
|
|
1894
1907
|
// Using value as number to keep it in sync
|
|
1895
1908
|
a.valueAsNumber(t),
|
|
1896
1909
|
a.class("bc-input bc-slider-input"),
|
|
1897
|
-
o != null ?
|
|
1898
|
-
l != null ?
|
|
1899
|
-
u != null ?
|
|
1910
|
+
o != null ? C.blur(G(o)) : D,
|
|
1911
|
+
l != null ? C.change(G(l)) : D,
|
|
1912
|
+
u != null ? C.input(G(u)) : D
|
|
1900
1913
|
)
|
|
1901
1914
|
});
|
|
1902
|
-
},
|
|
1903
|
-
const { value: t, step: r, min: n, max: s, onBlur: o, onChange: l, onInput: u } = e, c = i.map(t, (
|
|
1904
|
-
if (
|
|
1905
|
-
const
|
|
1906
|
-
return typeof
|
|
1907
|
-
}),
|
|
1908
|
-
l?.(
|
|
1915
|
+
}, Vn = (e) => {
|
|
1916
|
+
const { value: t, step: r, min: n, max: s, onBlur: o, onChange: l, onInput: u } = e, c = i.map(t, (m) => {
|
|
1917
|
+
if (m != null) return m;
|
|
1918
|
+
const f = n != null ? i.get(n) : void 0;
|
|
1919
|
+
return typeof f == "number" ? f : 0;
|
|
1920
|
+
}), p = X(t, e.disabled, (m) => {
|
|
1921
|
+
l?.(m);
|
|
1909
1922
|
});
|
|
1910
1923
|
return P(
|
|
1911
1924
|
{
|
|
1912
1925
|
...e,
|
|
1913
1926
|
focusableSelector: 'input[type="range"]',
|
|
1914
|
-
after:
|
|
1915
|
-
input:
|
|
1927
|
+
after: p,
|
|
1928
|
+
input: y.input(
|
|
1916
1929
|
a.type("range"),
|
|
1917
1930
|
H(e),
|
|
1918
1931
|
a.min(n),
|
|
@@ -1920,17 +1933,17 @@ const wn = (e) => {
|
|
|
1920
1933
|
a.step(r),
|
|
1921
1934
|
a.valueAsNumber(c),
|
|
1922
1935
|
a.class("bc-input bc-slider-input"),
|
|
1923
|
-
o != null ?
|
|
1924
|
-
l != null ?
|
|
1925
|
-
G((
|
|
1926
|
-
l(
|
|
1936
|
+
o != null ? C.blur(G(o)) : D,
|
|
1937
|
+
l != null ? C.change(
|
|
1938
|
+
G((m) => {
|
|
1939
|
+
l(m);
|
|
1927
1940
|
})
|
|
1928
|
-
) :
|
|
1929
|
-
u != null ?
|
|
1930
|
-
G((
|
|
1931
|
-
u(
|
|
1941
|
+
) : D,
|
|
1942
|
+
u != null ? C.input(
|
|
1943
|
+
G((m) => {
|
|
1944
|
+
u(m);
|
|
1932
1945
|
})
|
|
1933
|
-
) :
|
|
1946
|
+
) : D
|
|
1934
1947
|
)
|
|
1935
1948
|
},
|
|
1936
1949
|
// Ensure container grows input naturally
|
|
@@ -1945,25 +1958,25 @@ async function Me() {
|
|
|
1945
1958
|
return e.Temporal || (e.Temporal = r), r;
|
|
1946
1959
|
})), _e);
|
|
1947
1960
|
}
|
|
1948
|
-
const
|
|
1961
|
+
const Kt = (e, t) => t ? Be(Me, {
|
|
1949
1962
|
then: e,
|
|
1950
1963
|
pending: t.pending,
|
|
1951
1964
|
error: t.error
|
|
1952
|
-
}) : Be(Me, e),
|
|
1953
|
-
function
|
|
1965
|
+
}) : Be(Me, e), en = /^P(\d+([YMWD]|$)){0,4}(T(\d+([HMS]|$)){0,3})?$/i, tn = /^P(?:(\d+Y)?(\d+M)?(\d+W)?(\d+D)?)(T(\d+H)?(\d+M)?(\d+S)?)?$/i;
|
|
1966
|
+
function nn(e) {
|
|
1954
1967
|
return {
|
|
1955
1968
|
mask: null,
|
|
1956
1969
|
allowMode: "custom",
|
|
1957
1970
|
allow: (t) => /[0-9ptwdhms]/i.test(t),
|
|
1958
1971
|
pipe: (t) => {
|
|
1959
1972
|
const r = t.toUpperCase();
|
|
1960
|
-
return r.length === 0 ? r : !r.startsWith("P") || !
|
|
1973
|
+
return r.length === 0 ? r : !r.startsWith("P") || !en.test(r) ? !1 : r;
|
|
1961
1974
|
},
|
|
1962
1975
|
completion: {
|
|
1963
1976
|
mode: "custom",
|
|
1964
1977
|
isComplete: (t) => {
|
|
1965
1978
|
const r = t.toUpperCase();
|
|
1966
|
-
if (!
|
|
1979
|
+
if (!tn.test(r)) return !1;
|
|
1967
1980
|
try {
|
|
1968
1981
|
return e(r), !0;
|
|
1969
1982
|
} catch {
|
|
@@ -1973,25 +1986,25 @@ function en(e) {
|
|
|
1973
1986
|
}
|
|
1974
1987
|
};
|
|
1975
1988
|
}
|
|
1976
|
-
const
|
|
1989
|
+
const Pe = (e, t) => {
|
|
1977
1990
|
if (e == null) return null;
|
|
1978
1991
|
try {
|
|
1979
1992
|
return e.Duration.from(t);
|
|
1980
1993
|
} catch {
|
|
1981
1994
|
return null;
|
|
1982
1995
|
}
|
|
1983
|
-
},
|
|
1996
|
+
}, Ln = (e) => {
|
|
1984
1997
|
const { value: t, onChange: r, after: n, disabled: s, onBlur: o } = e, l = () => {
|
|
1985
|
-
const
|
|
1986
|
-
return n != null ? L(
|
|
1987
|
-
}, u = e.placeholder != null ?
|
|
1988
|
-
return
|
|
1989
|
-
(
|
|
1998
|
+
const p = X(t, s, r);
|
|
1999
|
+
return n != null ? L(p, n) : p;
|
|
2000
|
+
}, u = e.placeholder != null ? D : a.placeholder("P0DT0H0M0S");
|
|
2001
|
+
return Kt(
|
|
2002
|
+
(p) => qe({
|
|
1990
2003
|
...e,
|
|
1991
|
-
value: i.map(t, (
|
|
1992
|
-
onChange: r ? (
|
|
2004
|
+
value: i.map(t, (m) => m?.toString() ?? ""),
|
|
2005
|
+
onChange: r ? (m) => r(m === "" ? null : p.Duration.from(m)) : void 0,
|
|
1993
2006
|
onInput: void 0,
|
|
1994
|
-
...
|
|
2007
|
+
...nn(p.Duration.from),
|
|
1995
2008
|
placeholder: "P0DT0H0M0S",
|
|
1996
2009
|
after: l()
|
|
1997
2010
|
}),
|
|
@@ -1999,32 +2012,32 @@ const Re = (e, t) => {
|
|
|
1999
2012
|
...e,
|
|
2000
2013
|
input: ee.text(
|
|
2001
2014
|
H(e),
|
|
2002
|
-
a.value(i.map(t, (
|
|
2015
|
+
a.value(i.map(t, (p) => p?.toString() ?? "")),
|
|
2003
2016
|
a.class("bc-input"),
|
|
2004
2017
|
u,
|
|
2005
|
-
o != null ?
|
|
2006
|
-
r != null ?
|
|
2007
|
-
const
|
|
2008
|
-
if (
|
|
2018
|
+
o != null ? C.blur(() => o()) : D,
|
|
2019
|
+
r != null ? C.change((p) => {
|
|
2020
|
+
const f = p.currentTarget?.value ?? "";
|
|
2021
|
+
if (f === "") {
|
|
2009
2022
|
r(null);
|
|
2010
2023
|
return;
|
|
2011
2024
|
}
|
|
2012
|
-
const
|
|
2013
|
-
if (
|
|
2014
|
-
r(
|
|
2025
|
+
const x = globalThis.Temporal, d = Pe(x, f);
|
|
2026
|
+
if (d != null) {
|
|
2027
|
+
r(d);
|
|
2015
2028
|
return;
|
|
2016
2029
|
}
|
|
2017
|
-
Me().then((
|
|
2018
|
-
const
|
|
2019
|
-
|
|
2030
|
+
Me().then((g) => {
|
|
2031
|
+
const b = Pe(g, f);
|
|
2032
|
+
b != null && r(b);
|
|
2020
2033
|
}).catch(() => {
|
|
2021
2034
|
});
|
|
2022
|
-
}) :
|
|
2035
|
+
}) : D
|
|
2023
2036
|
),
|
|
2024
2037
|
after: l()
|
|
2025
2038
|
}) }
|
|
2026
2039
|
);
|
|
2027
|
-
},
|
|
2040
|
+
}, sn = (e) => {
|
|
2028
2041
|
const { value: t, onBlur: r, onChange: n, onInput: s } = e;
|
|
2029
2042
|
return P({
|
|
2030
2043
|
...e,
|
|
@@ -2032,22 +2045,22 @@ const Re = (e, t) => {
|
|
|
2032
2045
|
H(e),
|
|
2033
2046
|
a.value(t),
|
|
2034
2047
|
a.class("bc-input"),
|
|
2035
|
-
r != null ?
|
|
2036
|
-
n != null ?
|
|
2037
|
-
s != null ?
|
|
2048
|
+
r != null ? C.blur(j(r)) : D,
|
|
2049
|
+
n != null ? C.change(j(n)) : D,
|
|
2050
|
+
s != null ? C.input(j(s)) : D
|
|
2038
2051
|
)
|
|
2039
2052
|
});
|
|
2040
|
-
},
|
|
2053
|
+
}, En = (e) => {
|
|
2041
2054
|
const { value: t, onBlur: r, onChange: n, onInput: s, after: o, disabled: l, ...u } = e, c = X(t, l, n);
|
|
2042
|
-
return
|
|
2055
|
+
return sn({
|
|
2043
2056
|
...u,
|
|
2044
2057
|
value: i.map(t, se),
|
|
2045
|
-
onChange: n != null ? (
|
|
2046
|
-
onInput: s != null ? (
|
|
2058
|
+
onChange: n != null ? (p) => n(Y(p)) : void 0,
|
|
2059
|
+
onInput: s != null ? (p) => s(Y(p)) : void 0,
|
|
2047
2060
|
onBlur: r,
|
|
2048
2061
|
after: o != null ? L(c, o) : c
|
|
2049
2062
|
});
|
|
2050
|
-
},
|
|
2063
|
+
}, Un = (e, ...t) => {
|
|
2051
2064
|
const {
|
|
2052
2065
|
element: r,
|
|
2053
2066
|
separator: n,
|
|
@@ -2056,16 +2069,16 @@ const Re = (e, t) => {
|
|
|
2056
2069
|
showAdd: l = !0,
|
|
2057
2070
|
createItem: u,
|
|
2058
2071
|
addLabel: c,
|
|
2059
|
-
controlsLayout:
|
|
2060
|
-
...
|
|
2061
|
-
} = e,
|
|
2062
|
-
const
|
|
2072
|
+
controlsLayout: p = "aside",
|
|
2073
|
+
...m
|
|
2074
|
+
} = e, f = i.toSignal(p).map((g) => g === "aside"), x = (g) => {
|
|
2075
|
+
const b = E(
|
|
2063
2076
|
s ?? !1,
|
|
2064
|
-
() =>
|
|
2077
|
+
() => y.div(
|
|
2065
2078
|
a.class("bc-group--align-center"),
|
|
2066
2079
|
a.class(
|
|
2067
|
-
|
|
2068
|
-
(
|
|
2080
|
+
f.map(
|
|
2081
|
+
(h) => h ? "bc-group--direction-column bc-group--gap-1" : "bc-group--direction-row bc-group--gap-1"
|
|
2069
2082
|
)
|
|
2070
2083
|
),
|
|
2071
2084
|
be(
|
|
@@ -2073,15 +2086,15 @@ const Re = (e, t) => {
|
|
|
2073
2086
|
size: "xs",
|
|
2074
2087
|
roundedness: "full",
|
|
2075
2088
|
variant: "text",
|
|
2076
|
-
onClick: () =>
|
|
2077
|
-
disabled:
|
|
2089
|
+
onClick: () => g.move("up"),
|
|
2090
|
+
disabled: g.cannotMove("up")
|
|
2078
2091
|
},
|
|
2079
2092
|
O(
|
|
2080
2093
|
W,
|
|
2081
|
-
(
|
|
2094
|
+
(h) => z({
|
|
2082
2095
|
size: "xs",
|
|
2083
2096
|
icon: "line-md:arrow-up",
|
|
2084
|
-
title:
|
|
2097
|
+
title: h.$.incrementValue
|
|
2085
2098
|
})
|
|
2086
2099
|
)
|
|
2087
2100
|
),
|
|
@@ -2090,15 +2103,15 @@ const Re = (e, t) => {
|
|
|
2090
2103
|
size: "xs",
|
|
2091
2104
|
roundedness: "full",
|
|
2092
2105
|
variant: "text",
|
|
2093
|
-
onClick: () =>
|
|
2094
|
-
disabled:
|
|
2106
|
+
onClick: () => g.move("down"),
|
|
2107
|
+
disabled: g.cannotMove("down")
|
|
2095
2108
|
},
|
|
2096
2109
|
O(
|
|
2097
2110
|
W,
|
|
2098
|
-
(
|
|
2111
|
+
(h) => z({
|
|
2099
2112
|
size: "xs",
|
|
2100
2113
|
icon: "line-md:arrow-down",
|
|
2101
|
-
title:
|
|
2114
|
+
title: h.$.decrementValue
|
|
2102
2115
|
})
|
|
2103
2116
|
)
|
|
2104
2117
|
)
|
|
@@ -2107,46 +2120,46 @@ const Re = (e, t) => {
|
|
|
2107
2120
|
o,
|
|
2108
2121
|
() => O(
|
|
2109
2122
|
W,
|
|
2110
|
-
(
|
|
2123
|
+
(h) => me({
|
|
2111
2124
|
size: "xs",
|
|
2112
2125
|
// Use a lowercase label to satisfy tests that query with [aria-label*="remove"]
|
|
2113
|
-
label: i.map(
|
|
2114
|
-
color: "
|
|
2126
|
+
label: i.map(h.$.removeItem, (v) => v.toLowerCase()),
|
|
2127
|
+
color: "danger",
|
|
2115
2128
|
disabled: e.removeDisabled,
|
|
2116
|
-
onClick:
|
|
2129
|
+
onClick: g.remove
|
|
2117
2130
|
})
|
|
2118
2131
|
)
|
|
2119
2132
|
);
|
|
2120
|
-
return (
|
|
2121
|
-
|
|
2133
|
+
return (h) => E(
|
|
2134
|
+
f,
|
|
2122
2135
|
() => pe(
|
|
2123
2136
|
a.class("bc-group--gap-1 bc-group--align-center"),
|
|
2124
|
-
ne(a.class("bc-stack--grow"),
|
|
2137
|
+
ne(a.class("bc-stack--grow"), h),
|
|
2125
2138
|
ne(
|
|
2126
2139
|
a.class("bc-stack--align-center"),
|
|
2127
2140
|
E(
|
|
2128
2141
|
e.controller.value.map((v) => v.length > 1),
|
|
2129
|
-
() =>
|
|
2142
|
+
() => b
|
|
2130
2143
|
),
|
|
2131
2144
|
_
|
|
2132
2145
|
)
|
|
2133
2146
|
),
|
|
2134
2147
|
() => ne(
|
|
2135
2148
|
a.class("bc-stack--gap-2"),
|
|
2136
|
-
|
|
2149
|
+
h,
|
|
2137
2150
|
pe(
|
|
2138
2151
|
a.class("bc-group--gap-2 bc-group--justify-between"),
|
|
2139
2152
|
E(
|
|
2140
2153
|
e.controller.value.map((v) => v.length > 1),
|
|
2141
|
-
() =>
|
|
2142
|
-
() =>
|
|
2154
|
+
() => b,
|
|
2155
|
+
() => y.div()
|
|
2143
2156
|
),
|
|
2144
2157
|
_
|
|
2145
2158
|
)
|
|
2146
2159
|
)
|
|
2147
2160
|
);
|
|
2148
|
-
},
|
|
2149
|
-
B(l, u)((
|
|
2161
|
+
}, d = E(
|
|
2162
|
+
B(l, u)((g, b) => g && b != null),
|
|
2150
2163
|
() => pe(
|
|
2151
2164
|
a.class(
|
|
2152
2165
|
"bc-group--gap-2 bc-group--align-center bc-group--justify-center"
|
|
@@ -2155,83 +2168,83 @@ const Re = (e, t) => {
|
|
|
2155
2168
|
{
|
|
2156
2169
|
size: "sm",
|
|
2157
2170
|
variant: "filled",
|
|
2158
|
-
onClick: () =>
|
|
2171
|
+
onClick: () => m.controller.push(u()),
|
|
2159
2172
|
disabled: B(
|
|
2160
|
-
|
|
2173
|
+
m.controller.disabled,
|
|
2161
2174
|
e.addDisabled ?? !1
|
|
2162
|
-
)((
|
|
2175
|
+
)((g, b) => g || b)
|
|
2163
2176
|
},
|
|
2164
2177
|
O(
|
|
2165
2178
|
W,
|
|
2166
|
-
(
|
|
2179
|
+
(g) => pe(
|
|
2167
2180
|
a.class("bc-group--gap-2"),
|
|
2168
2181
|
z({ icon: "line-md:plus" }),
|
|
2169
|
-
c ??
|
|
2182
|
+
c ?? g.$.addLabel
|
|
2170
2183
|
)
|
|
2171
2184
|
)
|
|
2172
2185
|
)
|
|
2173
2186
|
)
|
|
2174
2187
|
);
|
|
2175
|
-
return
|
|
2188
|
+
return We(
|
|
2176
2189
|
{
|
|
2177
|
-
...
|
|
2190
|
+
...m,
|
|
2178
2191
|
content: ne(
|
|
2179
2192
|
a.class("bc-stack--gap-2"),
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
(
|
|
2193
|
+
jt(
|
|
2194
|
+
m.controller,
|
|
2195
|
+
(g) => x(g)(r(g)),
|
|
2183
2196
|
n
|
|
2184
2197
|
),
|
|
2185
|
-
|
|
2198
|
+
d
|
|
2186
2199
|
)
|
|
2187
2200
|
},
|
|
2188
2201
|
...t
|
|
2189
2202
|
);
|
|
2190
2203
|
};
|
|
2191
|
-
class
|
|
2204
|
+
class Nn extends ve {
|
|
2192
2205
|
branches;
|
|
2193
2206
|
activeBranch;
|
|
2194
2207
|
#t;
|
|
2195
2208
|
#e = /* @__PURE__ */ new Map();
|
|
2196
2209
|
constructor(t, r, n, s, o, l, u = ae) {
|
|
2197
2210
|
super(t, r, n, s, o, u), this.branches = l;
|
|
2198
|
-
const c = (
|
|
2199
|
-
for (const
|
|
2200
|
-
if (
|
|
2201
|
-
return
|
|
2211
|
+
const c = (m) => {
|
|
2212
|
+
for (const f of l)
|
|
2213
|
+
if (f.detect(m))
|
|
2214
|
+
return f.key;
|
|
2202
2215
|
return l[0]?.key ?? "unknown";
|
|
2203
2216
|
};
|
|
2204
2217
|
this.activeBranch = n.map(c, ae);
|
|
2205
|
-
const
|
|
2206
|
-
if (this.#e.has(
|
|
2207
|
-
return this.#e.get(
|
|
2208
|
-
const
|
|
2209
|
-
if (!
|
|
2210
|
-
throw new Error(`Unknown branch: ${
|
|
2211
|
-
const
|
|
2212
|
-
[...t,
|
|
2213
|
-
(
|
|
2214
|
-
this.change(
|
|
2218
|
+
const p = (m) => {
|
|
2219
|
+
if (this.#e.has(m))
|
|
2220
|
+
return this.#e.get(m);
|
|
2221
|
+
const f = l.find((d) => d.key === m);
|
|
2222
|
+
if (!f)
|
|
2223
|
+
throw new Error(`Unknown branch: ${m}`);
|
|
2224
|
+
const x = new ve(
|
|
2225
|
+
[...t, m],
|
|
2226
|
+
(d) => {
|
|
2227
|
+
this.change(d);
|
|
2215
2228
|
},
|
|
2216
2229
|
n.map(
|
|
2217
|
-
(
|
|
2230
|
+
(d) => f.detect(d) ? d : f.defaultValue(),
|
|
2218
2231
|
u
|
|
2219
2232
|
),
|
|
2220
|
-
s.map(
|
|
2233
|
+
s.map(Le([m])),
|
|
2221
2234
|
{
|
|
2222
2235
|
disabled: this.disabled,
|
|
2223
2236
|
validationMode: this.parent.validationMode
|
|
2224
2237
|
},
|
|
2225
2238
|
u
|
|
2226
2239
|
);
|
|
2227
|
-
return this.#e.set(
|
|
2240
|
+
return this.#e.set(m, x), x;
|
|
2228
2241
|
};
|
|
2229
2242
|
this.#t = this.activeBranch.map(
|
|
2230
|
-
(
|
|
2243
|
+
(m) => p(m),
|
|
2231
2244
|
ae
|
|
2232
2245
|
), this.onDispose(() => {
|
|
2233
|
-
for (const
|
|
2234
|
-
|
|
2246
|
+
for (const m of this.#e.values())
|
|
2247
|
+
m.dispose();
|
|
2235
2248
|
this.#e.clear(), this.activeBranch.dispose(), this.#t.dispose();
|
|
2236
2249
|
});
|
|
2237
2250
|
}
|
|
@@ -2259,7 +2272,7 @@ class En extends ve {
|
|
|
2259
2272
|
(s) => r.detect(s) ? s : r.defaultValue(),
|
|
2260
2273
|
ae
|
|
2261
2274
|
),
|
|
2262
|
-
this.status.map(
|
|
2275
|
+
this.status.map(Le([t])),
|
|
2263
2276
|
{
|
|
2264
2277
|
disabled: this.disabled,
|
|
2265
2278
|
validationMode: this.parent.validationMode
|
|
@@ -2298,51 +2311,51 @@ class En extends ve {
|
|
|
2298
2311
|
return this.branches.find((r) => r.key === t);
|
|
2299
2312
|
}
|
|
2300
2313
|
}
|
|
2301
|
-
function
|
|
2314
|
+
function zn(e) {
|
|
2302
2315
|
return e.transform(
|
|
2303
2316
|
(t) => t ?? null,
|
|
2304
2317
|
(t) => t ?? void 0
|
|
2305
2318
|
);
|
|
2306
2319
|
}
|
|
2307
|
-
function
|
|
2320
|
+
function Rn(e) {
|
|
2308
2321
|
return e.transform(
|
|
2309
2322
|
(t) => t ?? "",
|
|
2310
2323
|
(t) => t === "" ? void 0 : t
|
|
2311
2324
|
);
|
|
2312
2325
|
}
|
|
2313
|
-
function
|
|
2326
|
+
function Pn(e) {
|
|
2314
2327
|
return e.transform(
|
|
2315
2328
|
(t) => t ?? void 0,
|
|
2316
2329
|
(t) => t ?? null
|
|
2317
2330
|
);
|
|
2318
2331
|
}
|
|
2319
|
-
function
|
|
2332
|
+
function rn(e) {
|
|
2320
2333
|
switch (e) {
|
|
2321
2334
|
case "success":
|
|
2322
2335
|
return "material-symbols:check-circle-outline";
|
|
2323
2336
|
case "warning":
|
|
2324
2337
|
return "material-symbols:warning-outline";
|
|
2325
|
-
case "
|
|
2338
|
+
case "danger":
|
|
2326
2339
|
return "material-symbols:error-outline";
|
|
2327
2340
|
case "info":
|
|
2328
2341
|
default:
|
|
2329
2342
|
return "material-symbols:info-outline";
|
|
2330
2343
|
}
|
|
2331
2344
|
}
|
|
2332
|
-
function
|
|
2345
|
+
function ln(e) {
|
|
2333
2346
|
switch (e) {
|
|
2334
2347
|
case "success":
|
|
2335
2348
|
return "success";
|
|
2336
2349
|
case "warning":
|
|
2337
2350
|
return "warning";
|
|
2338
|
-
case "
|
|
2339
|
-
return "
|
|
2351
|
+
case "danger":
|
|
2352
|
+
return "danger";
|
|
2340
2353
|
case "info":
|
|
2341
2354
|
default:
|
|
2342
2355
|
return "info";
|
|
2343
2356
|
}
|
|
2344
2357
|
}
|
|
2345
|
-
function
|
|
2358
|
+
function an(e, t, r, n) {
|
|
2346
2359
|
const s = [
|
|
2347
2360
|
"bc-notice",
|
|
2348
2361
|
`bc-notice--${e}`,
|
|
@@ -2350,7 +2363,7 @@ function rn(e, t, r, n) {
|
|
|
2350
2363
|
];
|
|
2351
2364
|
return r && s.push("bc-notice--dismissible"), n && n.length > 0 && s.push(n), s.join(" ");
|
|
2352
2365
|
}
|
|
2353
|
-
function
|
|
2366
|
+
function On({
|
|
2354
2367
|
variant: e = "info",
|
|
2355
2368
|
tone: t = "subtle",
|
|
2356
2369
|
role: r,
|
|
@@ -2360,108 +2373,110 @@ function Rn({
|
|
|
2360
2373
|
onDismiss: l,
|
|
2361
2374
|
class: u
|
|
2362
2375
|
}, ...c) {
|
|
2363
|
-
const
|
|
2376
|
+
const p = i.map(
|
|
2364
2377
|
o,
|
|
2365
|
-
(
|
|
2366
|
-
),
|
|
2378
|
+
(b) => !!b || l != null
|
|
2379
|
+
), m = i.map(e, (b) => b ?? "info"), f = i.map(t, (b) => b ?? "subtle"), x = B(
|
|
2367
2380
|
r,
|
|
2368
|
-
|
|
2369
|
-
)(
|
|
2381
|
+
m
|
|
2382
|
+
)(
|
|
2383
|
+
(b, _) => b ?? (_ === "danger" ? "alert" : "status")
|
|
2384
|
+
), d = K(!0), g = O(
|
|
2370
2385
|
W,
|
|
2371
|
-
(
|
|
2386
|
+
(b) => y.div(
|
|
2372
2387
|
a.class(
|
|
2373
2388
|
B(
|
|
2374
|
-
|
|
2375
|
-
d,
|
|
2389
|
+
m,
|
|
2376
2390
|
f,
|
|
2391
|
+
p,
|
|
2377
2392
|
u
|
|
2378
|
-
)((_,
|
|
2393
|
+
)((_, h, v, T) => an(_, h, v, T))
|
|
2379
2394
|
),
|
|
2380
2395
|
// Accessibility role mapping (always defined)
|
|
2381
|
-
a.role(i.map(
|
|
2382
|
-
|
|
2396
|
+
a.role(i.map(x, (_) => _)),
|
|
2397
|
+
st(
|
|
2383
2398
|
i.map(s, (_) => _ === !1),
|
|
2384
|
-
() =>
|
|
2399
|
+
() => y.div(
|
|
2385
2400
|
a.class("bc-notice__icon"),
|
|
2386
2401
|
z({
|
|
2387
2402
|
icon: B(
|
|
2388
2403
|
s,
|
|
2389
|
-
|
|
2390
|
-
)((_,
|
|
2404
|
+
m
|
|
2405
|
+
)((_, h) => _ === void 0 ? rn(h) : String(_)),
|
|
2391
2406
|
size: "md",
|
|
2392
|
-
color: i.map(
|
|
2407
|
+
color: i.map(m, ln)
|
|
2393
2408
|
})
|
|
2394
2409
|
)
|
|
2395
2410
|
),
|
|
2396
|
-
|
|
2411
|
+
y.div(
|
|
2397
2412
|
a.class("bc-notice__body"),
|
|
2398
|
-
|
|
2399
|
-
|
|
2413
|
+
Oe(n, (_) => y.div(a.class("bc-notice__title"), _)),
|
|
2414
|
+
y.div(a.class("bc-notice__content"), ...c)
|
|
2400
2415
|
),
|
|
2401
2416
|
E(
|
|
2402
|
-
|
|
2417
|
+
p,
|
|
2403
2418
|
() => me({
|
|
2404
2419
|
size: "xs",
|
|
2405
|
-
label:
|
|
2420
|
+
label: b.$.closeModal,
|
|
2406
2421
|
onClick: () => {
|
|
2407
|
-
|
|
2422
|
+
d.set(!1), l?.();
|
|
2408
2423
|
}
|
|
2409
2424
|
})
|
|
2410
2425
|
)
|
|
2411
2426
|
)
|
|
2412
2427
|
);
|
|
2413
|
-
return E(
|
|
2428
|
+
return E(d, () => g);
|
|
2414
2429
|
}
|
|
2415
2430
|
export {
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2431
|
+
Bn as A,
|
|
2432
|
+
gn as B,
|
|
2433
|
+
bn as C,
|
|
2434
|
+
Vn as D,
|
|
2435
|
+
Nt as E,
|
|
2436
|
+
kt as F,
|
|
2422
2437
|
pe as G,
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2438
|
+
Ln as H,
|
|
2439
|
+
sn as I,
|
|
2440
|
+
En as J,
|
|
2441
|
+
xn as K,
|
|
2442
|
+
Un as L,
|
|
2443
|
+
qe as M,
|
|
2444
|
+
Pt as N,
|
|
2445
|
+
vn as O,
|
|
2446
|
+
zt as P,
|
|
2447
|
+
On as Q,
|
|
2448
|
+
Jt as R,
|
|
2449
|
+
hn as S,
|
|
2450
|
+
Xt as T,
|
|
2451
|
+
Ee as U,
|
|
2437
2452
|
Me as V,
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2453
|
+
Kt as W,
|
|
2454
|
+
fn as X,
|
|
2455
|
+
mn as _,
|
|
2441
2456
|
X as a,
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2457
|
+
Nn as b,
|
|
2458
|
+
Rn as c,
|
|
2459
|
+
nn as d,
|
|
2445
2460
|
Y as e,
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2461
|
+
Pn as f,
|
|
2462
|
+
It as g,
|
|
2463
|
+
St as h,
|
|
2464
|
+
wn as i,
|
|
2465
|
+
jt as j,
|
|
2466
|
+
Ot as k,
|
|
2467
|
+
_n as l,
|
|
2468
|
+
$n as m,
|
|
2454
2469
|
se as n,
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2470
|
+
yn as o,
|
|
2471
|
+
In as p,
|
|
2472
|
+
Cn as q,
|
|
2473
|
+
Mn as r,
|
|
2474
|
+
kn as s,
|
|
2475
|
+
zn as t,
|
|
2476
|
+
Tn as u,
|
|
2477
|
+
Sn as v,
|
|
2478
|
+
Dn as w,
|
|
2479
|
+
qt as x,
|
|
2480
|
+
An as y,
|
|
2481
|
+
Fn as z
|
|
2467
2482
|
};
|