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