@tempots/beatui 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{2019-u0Cs1ZdE.cjs → 2019-2VJkiLfN.cjs} +1 -1
- package/dist/{2019-B4Mw3glM.js → 2019-5KfqWnec.js} +2 -2
- package/dist/{2020-BcwEHv2O.cjs → 2020-B8Q7fWlH.cjs} +1 -1
- package/dist/{2020-BvFyb4Gy.js → 2020-DgsRREzV.js} +2 -2
- package/dist/{index-JHbFZFZF.cjs → index-BXJtZL3s.cjs} +2 -2
- package/dist/{index-DOlgncMG.js → index-CZaadFtU.js} +3 -3
- package/dist/{index-DdlxwtnE.cjs → index-DXFCOeK6.cjs} +1 -1
- package/dist/{index-Cs_PxtnZ.js → index-VAdTFk7m.js} +1 -1
- package/dist/index.cjs.js +16 -16
- package/dist/index.es.js +2061 -2016
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +1 -1
- package/dist/notice-DvzonVEo.cjs +1 -0
- package/dist/{notice-CmmpobJd.js → notice-tCSEbjFE.js} +787 -789
- package/dist/types/components/navigation/flyout.d.ts +2 -0
- package/dist/types/components/navigation/link/button-link.d.ts +6 -2
- package/dist/types/components/navigation/link/link.d.ts +6 -2
- package/dist/types/components/navigation/link/navigation-link.d.ts +5 -5
- package/dist/types/components/navigation/link/navigation-options.d.ts +5 -0
- package/dist/types/components/navigation/sidebar/sidebar-link.d.ts +5 -0
- package/package.json +3 -3
- package/dist/notice-B7JqE59s.cjs +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Use as
|
|
1
|
+
import { Use as O, Value as u, prop as K, html as $, attr as a, on as k, WithElement as ie, OnDispose as W, aria as N, bind as $e, computedOf as B, style as pe, When as E, NotEmpty as Ye, Fragment as L, ForEach as de, svg as Se, svgAttr as be, Empty as S, emitValue as P, coalesce as Xe, Ensure as Ne, OneOfType as qe, Repeat as Re, signal as Ae, input as ne, emitValueAsNullableDate as Ge, emitValueAsNullableDateTime as Qe, emitValueAsNumber as G, emit as Je, Task as Ke, Unless as et } from "@tempots/dom";
|
|
2
2
|
import { g as tt } from "./timer-CQlK5LhW.js";
|
|
3
|
-
import { ElementRect as
|
|
4
|
-
import { B as
|
|
3
|
+
import { ElementRect as ze, AutoSelect as nt } from "@tempots/ui";
|
|
4
|
+
import { B as H, e as j, f as st, C as me, I as R, g as Y, h as rt, i as lt, j as Oe, k as ye, T as at, E as ot, P as ct, S as te, s as it, L as ut, l as ft, G as fe, a as ge, n as ve, O as ae, o as Fe } from "./translations-ClgoCEFC.js";
|
|
5
5
|
const pt = (e) => Object.entries(e);
|
|
6
6
|
class dt extends Error {
|
|
7
7
|
constructor(t = "Missing implementation") {
|
|
@@ -24,36 +24,36 @@ function Be({
|
|
|
24
24
|
enableClick: n = !0,
|
|
25
25
|
content: s,
|
|
26
26
|
disabled: o = !1,
|
|
27
|
-
allowMultiple:
|
|
27
|
+
allowMultiple: l
|
|
28
28
|
}) {
|
|
29
|
-
return
|
|
30
|
-
const c =
|
|
29
|
+
return O(H, (i) => {
|
|
30
|
+
const c = u.deriveProp(t ?? []), p = K(!1), h = (b) => {
|
|
31
31
|
b.preventDefault(), b.stopPropagation(), p.value = !0;
|
|
32
32
|
}, d = (b) => {
|
|
33
33
|
b.preventDefault(), b.stopPropagation(), (!b.currentTarget || !b.currentTarget.contains(b.relatedTarget)) && (p.value = !1);
|
|
34
34
|
}, g = (b) => {
|
|
35
35
|
b.preventDefault(), b.stopPropagation(), p.value = !1;
|
|
36
|
-
const
|
|
37
|
-
|
|
36
|
+
const v = Array.from(b.dataTransfer?.files || []);
|
|
37
|
+
v.length > 0 && (c.value = v, e(v));
|
|
38
38
|
}, f = (b) => {
|
|
39
|
-
|
|
39
|
+
u.get(n) && b.currentTarget.querySelector(
|
|
40
40
|
'input[type="file"]'
|
|
41
41
|
)?.click();
|
|
42
42
|
};
|
|
43
43
|
let m = null;
|
|
44
|
-
const
|
|
44
|
+
const x = () => {
|
|
45
45
|
if (m == null) return;
|
|
46
46
|
const b = Array.from(m.files ?? []);
|
|
47
47
|
b.length > 0 && (c.value = b, e(b)), m.value = "";
|
|
48
48
|
}, _ = (b) => {
|
|
49
|
-
|
|
49
|
+
u.get(n) && (b.key === "Enter" || b.key === " ") && (b.preventDefault(), f(b));
|
|
50
50
|
};
|
|
51
51
|
return $.div(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
a.role("button"),
|
|
53
|
+
a.tabindex(
|
|
54
|
+
u.map(n, (b) => b ? 0 : -1)
|
|
55
55
|
),
|
|
56
|
-
|
|
56
|
+
a.style("position: relative;"),
|
|
57
57
|
k.dragover(h),
|
|
58
58
|
k.dragleave(d),
|
|
59
59
|
k.drop(g),
|
|
@@ -61,26 +61,26 @@ function Be({
|
|
|
61
61
|
k.keydown(_),
|
|
62
62
|
// Hidden file input
|
|
63
63
|
$.input(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
a.type("file"),
|
|
65
|
+
a.disabled(o),
|
|
66
|
+
a.accept(r),
|
|
67
|
+
a.multiple(l),
|
|
68
|
+
a.style(
|
|
69
69
|
"position: absolute; left: -9999px; opacity: 0; pointer-events: none;"
|
|
70
70
|
),
|
|
71
|
-
k.change(
|
|
72
|
-
|
|
73
|
-
c.on((
|
|
74
|
-
const
|
|
75
|
-
if (
|
|
76
|
-
const
|
|
77
|
-
|
|
71
|
+
k.change(x),
|
|
72
|
+
ie((b) => (m = b, W(
|
|
73
|
+
c.on((v) => {
|
|
74
|
+
const T = globalThis.DataTransfer;
|
|
75
|
+
if (T != null) {
|
|
76
|
+
const I = new T();
|
|
77
|
+
v.forEach((y) => I.items.add(y)), b.files = I.files;
|
|
78
78
|
}
|
|
79
79
|
})
|
|
80
80
|
)))
|
|
81
81
|
),
|
|
82
82
|
// Screen reader instructions
|
|
83
|
-
|
|
83
|
+
N.label($e(i.$.dropZoneInstructions)(n)),
|
|
84
84
|
// Content
|
|
85
85
|
s({ files: c, clear: () => c.value = [], change: c.set })
|
|
86
86
|
);
|
|
@@ -104,20 +104,20 @@ function fn({
|
|
|
104
104
|
size: n = "md",
|
|
105
105
|
disabled: s = !1
|
|
106
106
|
}, ...o) {
|
|
107
|
-
const
|
|
108
|
-
key:
|
|
107
|
+
const l = pt(e).map(([i, c]) => ({
|
|
108
|
+
key: i,
|
|
109
109
|
label: c
|
|
110
110
|
}));
|
|
111
|
-
return
|
|
112
|
-
const
|
|
113
|
-
|
|
111
|
+
return ie(() => {
|
|
112
|
+
const i = Object.fromEntries(
|
|
113
|
+
l.map((p, h) => [p.key, h])
|
|
114
114
|
), c = K(
|
|
115
|
-
|
|
115
|
+
l.map(() => ({ left: 0, width: 0 })),
|
|
116
116
|
bt
|
|
117
117
|
);
|
|
118
118
|
return $.div(
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
a.class(
|
|
120
|
+
B(
|
|
121
121
|
n,
|
|
122
122
|
s
|
|
123
123
|
)(
|
|
@@ -125,42 +125,42 @@ function fn({
|
|
|
125
125
|
)
|
|
126
126
|
),
|
|
127
127
|
$.div(
|
|
128
|
-
|
|
128
|
+
a.class("bc-segmented-control__container"),
|
|
129
129
|
$.div(
|
|
130
|
-
|
|
130
|
+
a.class("bc-segmented-control__indicator"),
|
|
131
131
|
pe.width(
|
|
132
|
-
|
|
132
|
+
B(
|
|
133
133
|
t,
|
|
134
134
|
c
|
|
135
135
|
)((p, h) => {
|
|
136
|
-
const { width: d } = h[
|
|
136
|
+
const { width: d } = h[i[p] ?? 0];
|
|
137
137
|
return `${d}px`;
|
|
138
138
|
})
|
|
139
139
|
),
|
|
140
140
|
pe.left(
|
|
141
|
-
|
|
141
|
+
B(
|
|
142
142
|
t,
|
|
143
143
|
c
|
|
144
144
|
)((p, h) => {
|
|
145
|
-
const { left: d } = h[
|
|
145
|
+
const { left: d } = h[i[p] ?? 0];
|
|
146
146
|
return `${d}px`;
|
|
147
147
|
})
|
|
148
148
|
)
|
|
149
149
|
),
|
|
150
150
|
// clickable buttons
|
|
151
|
-
|
|
151
|
+
l.map(({ label: p, key: h }, d) => $.button(
|
|
152
152
|
k.click((g) => {
|
|
153
|
-
g.preventDefault(),
|
|
153
|
+
g.preventDefault(), u.get(s) || r?.(h);
|
|
154
154
|
}),
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
a.disabled(s),
|
|
156
|
+
a.class("bc-segmented-control__segment"),
|
|
157
|
+
a.class(
|
|
158
|
+
u.map(t, (g) => g === h ? "bc-segmented-control__segment--active" : "bc-segmented-control__segment--inactive")
|
|
159
159
|
),
|
|
160
|
-
|
|
160
|
+
ze((g) => {
|
|
161
161
|
function f() {
|
|
162
|
-
c.update((
|
|
163
|
-
const _ = [...
|
|
162
|
+
c.update((x) => {
|
|
163
|
+
const _ = [...x];
|
|
164
164
|
return _[d] = {
|
|
165
165
|
width: g.value.width,
|
|
166
166
|
left: g.value.localLeft
|
|
@@ -168,7 +168,7 @@ function fn({
|
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
const m = tt(f);
|
|
171
|
-
return
|
|
171
|
+
return W(m, g.on(f));
|
|
172
172
|
}),
|
|
173
173
|
p
|
|
174
174
|
))
|
|
@@ -195,18 +195,18 @@ function Ve(e) {
|
|
|
195
195
|
const n = URL.createObjectURL(r);
|
|
196
196
|
t.value = n;
|
|
197
197
|
}), $.div(
|
|
198
|
-
|
|
198
|
+
a.class("bc-file-input__thumbnail-container"),
|
|
199
199
|
$.img(
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
200
|
+
a.src(t),
|
|
201
|
+
a.alt(e.map((r) => r.name)),
|
|
202
|
+
a.class("bc-file-input__thumbnail"),
|
|
203
|
+
W(() => {
|
|
204
204
|
t.value && URL.revokeObjectURL(t.value);
|
|
205
205
|
})
|
|
206
206
|
)
|
|
207
207
|
);
|
|
208
208
|
},
|
|
209
|
-
() =>
|
|
209
|
+
() => R({ icon: e.map(xt) })
|
|
210
210
|
);
|
|
211
211
|
}
|
|
212
212
|
const wt = (e, ...t) => {
|
|
@@ -215,77 +215,77 @@ const wt = (e, ...t) => {
|
|
|
215
215
|
accept: n = "*/*",
|
|
216
216
|
maxFiles: s,
|
|
217
217
|
maxFileSize: o,
|
|
218
|
-
onChange:
|
|
219
|
-
onBlur:
|
|
218
|
+
onChange: l,
|
|
219
|
+
onBlur: i,
|
|
220
220
|
disabled: c,
|
|
221
221
|
hasError: p,
|
|
222
222
|
mode: h = "default",
|
|
223
223
|
showFileList: d = !0,
|
|
224
224
|
...g
|
|
225
|
-
} = e, f = r, m =
|
|
226
|
-
let y =
|
|
225
|
+
} = e, f = r, m = u.map(h, (I) => I === "compact"), x = (I) => {
|
|
226
|
+
let y = I;
|
|
227
227
|
if (s != null) {
|
|
228
|
-
const
|
|
229
|
-
y = y.slice(0,
|
|
228
|
+
const w = u.get(s);
|
|
229
|
+
y = y.slice(0, w);
|
|
230
230
|
}
|
|
231
231
|
if (o) {
|
|
232
|
-
const
|
|
233
|
-
y = y.filter((
|
|
232
|
+
const w = u.get(o);
|
|
233
|
+
y = y.filter((C) => C.size <= w);
|
|
234
234
|
}
|
|
235
|
-
|
|
236
|
-
}, _ = (
|
|
237
|
-
const
|
|
238
|
-
|
|
235
|
+
l?.(y);
|
|
236
|
+
}, _ = (I) => {
|
|
237
|
+
const w = f.value.filter((C, M) => M !== I);
|
|
238
|
+
l?.(w);
|
|
239
239
|
}, b = () => {
|
|
240
|
-
|
|
241
|
-
},
|
|
242
|
-
files:
|
|
240
|
+
l?.([]);
|
|
241
|
+
}, v = ({
|
|
242
|
+
files: I,
|
|
243
243
|
clear: y,
|
|
244
|
-
change:
|
|
245
|
-
}) =>
|
|
246
|
-
|
|
247
|
-
(
|
|
248
|
-
|
|
244
|
+
change: w
|
|
245
|
+
}) => O(
|
|
246
|
+
H,
|
|
247
|
+
(C) => $.div(
|
|
248
|
+
a.class("bc-file-input__drop-zone"),
|
|
249
249
|
$.div(
|
|
250
|
-
|
|
250
|
+
a.class(
|
|
251
251
|
"bc-file-input__drop-zone-content bc-file-input__drop-zone-content--empty"
|
|
252
252
|
),
|
|
253
|
-
|
|
253
|
+
R({ icon: "mdi:cloud-upload-outline", size: "xl" }),
|
|
254
254
|
$.div(
|
|
255
|
-
|
|
256
|
-
$e(
|
|
255
|
+
a.class("bc-file-input__drop-zone-text"),
|
|
256
|
+
$e(C.$.filesInputInstructions)(
|
|
257
257
|
s,
|
|
258
258
|
o,
|
|
259
|
-
|
|
259
|
+
C.$.fileSizeUnits.value
|
|
260
260
|
)
|
|
261
261
|
)
|
|
262
262
|
)
|
|
263
263
|
)
|
|
264
|
-
),
|
|
265
|
-
files:
|
|
266
|
-
}) =>
|
|
267
|
-
|
|
264
|
+
), T = ({
|
|
265
|
+
files: I
|
|
266
|
+
}) => O(
|
|
267
|
+
H,
|
|
268
268
|
(y) => $.div(
|
|
269
|
-
|
|
269
|
+
a.class("bc-file-input__compact-input"),
|
|
270
270
|
E(
|
|
271
|
-
|
|
271
|
+
I.map((w) => w.length > 0),
|
|
272
272
|
() => $.span(
|
|
273
|
-
|
|
273
|
+
a.class("bc-file-input__compact-value"),
|
|
274
274
|
de(
|
|
275
|
-
|
|
276
|
-
(
|
|
277
|
-
|
|
278
|
-
Ve(
|
|
275
|
+
I,
|
|
276
|
+
(w) => $.span(
|
|
277
|
+
a.class("bc-file-input__compact-value-item"),
|
|
278
|
+
Ve(w),
|
|
279
279
|
$.span(
|
|
280
|
-
|
|
281
|
-
|
|
280
|
+
a.class("bc-file-input__compact-value-item-name"),
|
|
281
|
+
w.$.name
|
|
282
282
|
)
|
|
283
283
|
)
|
|
284
284
|
)
|
|
285
285
|
),
|
|
286
286
|
() => $.span(
|
|
287
|
-
|
|
288
|
-
|
|
287
|
+
a.class("bc-file-input__compact-placeholder"),
|
|
288
|
+
R({ icon: "mdi:cloud-upload-outline", size: "sm" }),
|
|
289
289
|
" ",
|
|
290
290
|
$e(y.$.filesInputInstructions)(
|
|
291
291
|
s,
|
|
@@ -296,11 +296,11 @@ const wt = (e, ...t) => {
|
|
|
296
296
|
)
|
|
297
297
|
)
|
|
298
298
|
);
|
|
299
|
-
return
|
|
300
|
-
|
|
301
|
-
(
|
|
299
|
+
return O(
|
|
300
|
+
H,
|
|
301
|
+
(I) => j(
|
|
302
302
|
{
|
|
303
|
-
baseContainer:
|
|
303
|
+
baseContainer: u.map(m, (y) => !y),
|
|
304
304
|
disabled: c,
|
|
305
305
|
hasError: p,
|
|
306
306
|
after: E(
|
|
@@ -310,11 +310,11 @@ const wt = (e, ...t) => {
|
|
|
310
310
|
() => me(
|
|
311
311
|
{
|
|
312
312
|
size: "sm",
|
|
313
|
-
label:
|
|
313
|
+
label: I.$.clearAllFiles,
|
|
314
314
|
disabled: c,
|
|
315
315
|
onClick: b
|
|
316
316
|
},
|
|
317
|
-
|
|
317
|
+
a.class("bc-file-input__compact-clear")
|
|
318
318
|
)
|
|
319
319
|
)
|
|
320
320
|
),
|
|
@@ -322,27 +322,27 @@ const wt = (e, ...t) => {
|
|
|
322
322
|
input: E(
|
|
323
323
|
m,
|
|
324
324
|
() => $.div(
|
|
325
|
-
|
|
325
|
+
a.class("bc-file-input bc-file-input--compact"),
|
|
326
326
|
Be({
|
|
327
327
|
value: f,
|
|
328
328
|
accept: n,
|
|
329
329
|
enableClick: !0,
|
|
330
|
-
allowMultiple:
|
|
330
|
+
allowMultiple: u.map(s ?? 1 / 0, (y) => y > 1),
|
|
331
331
|
disabled: c,
|
|
332
|
-
onChange:
|
|
333
|
-
content:
|
|
332
|
+
onChange: x,
|
|
333
|
+
content: T
|
|
334
334
|
})
|
|
335
335
|
),
|
|
336
336
|
() => $.div(
|
|
337
|
-
|
|
337
|
+
a.class("bc-file-input"),
|
|
338
338
|
Be({
|
|
339
339
|
value: f,
|
|
340
340
|
accept: n,
|
|
341
341
|
enableClick: !0,
|
|
342
|
-
allowMultiple:
|
|
342
|
+
allowMultiple: u.map(s ?? 1 / 0, (y) => y > 1),
|
|
343
343
|
disabled: c,
|
|
344
|
-
onChange:
|
|
345
|
-
content:
|
|
344
|
+
onChange: x,
|
|
345
|
+
content: v
|
|
346
346
|
}),
|
|
347
347
|
E(
|
|
348
348
|
d,
|
|
@@ -350,45 +350,45 @@ const wt = (e, ...t) => {
|
|
|
350
350
|
f,
|
|
351
351
|
() => L(
|
|
352
352
|
$.div(
|
|
353
|
-
|
|
354
|
-
de(f, (y,
|
|
355
|
-
const
|
|
353
|
+
a.class("bc-file-input__file-list"),
|
|
354
|
+
de(f, (y, w) => {
|
|
355
|
+
const C = w.index;
|
|
356
356
|
return $.div(
|
|
357
|
-
|
|
357
|
+
a.class("bc-file-input__file-item"),
|
|
358
358
|
$.div(
|
|
359
|
-
|
|
359
|
+
a.class("bc-file-input__file-icon"),
|
|
360
360
|
Ve(y)
|
|
361
361
|
),
|
|
362
362
|
$.div(
|
|
363
|
-
|
|
363
|
+
a.class("bc-file-input__file-info"),
|
|
364
364
|
$.div(
|
|
365
|
-
|
|
366
|
-
|
|
365
|
+
a.class("bc-file-input__file-name"),
|
|
366
|
+
a.title(y.$.name),
|
|
367
367
|
y.$.name
|
|
368
368
|
),
|
|
369
369
|
$.div(
|
|
370
|
-
|
|
371
|
-
|
|
370
|
+
a.class("bc-file-input__file-meta"),
|
|
371
|
+
B(
|
|
372
372
|
y.$.size,
|
|
373
|
-
|
|
373
|
+
I.$.fileSizeUnits
|
|
374
374
|
)(
|
|
375
375
|
(M, A) => st(M, { units: A })
|
|
376
376
|
),
|
|
377
377
|
" • ",
|
|
378
|
-
|
|
378
|
+
B(
|
|
379
379
|
y.$.type,
|
|
380
|
-
|
|
380
|
+
I.$.unknownType
|
|
381
381
|
)((M, A) => M || A)
|
|
382
382
|
)
|
|
383
383
|
),
|
|
384
384
|
me(
|
|
385
385
|
{
|
|
386
386
|
size: "sm",
|
|
387
|
-
label:
|
|
387
|
+
label: I.$.removeFile,
|
|
388
388
|
disabled: c,
|
|
389
|
-
onClick: () => _(
|
|
389
|
+
onClick: () => _(C)
|
|
390
390
|
},
|
|
391
|
-
|
|
391
|
+
a.class("bc-file-input__remove-button")
|
|
392
392
|
)
|
|
393
393
|
);
|
|
394
394
|
})
|
|
@@ -396,14 +396,14 @@ const wt = (e, ...t) => {
|
|
|
396
396
|
E(
|
|
397
397
|
f.map(({ length: y }) => y > 1),
|
|
398
398
|
() => $.div(
|
|
399
|
-
|
|
399
|
+
a.class(
|
|
400
400
|
"bc-file-input__clear-all-button-container"
|
|
401
401
|
),
|
|
402
402
|
$.button(
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
403
|
+
a.type("button"),
|
|
404
|
+
a.class("bc-file-input__clear-all-button"),
|
|
405
|
+
a.disabled(c),
|
|
406
|
+
I.$.clearAllFiles,
|
|
407
407
|
k.click((y) => {
|
|
408
408
|
y.preventDefault(), y.stopPropagation(), b();
|
|
409
409
|
})
|
|
@@ -459,22 +459,22 @@ function Ct(e) {
|
|
|
459
459
|
onChange: r,
|
|
460
460
|
onInput: n,
|
|
461
461
|
...s
|
|
462
|
-
} = e, o = /* @__PURE__ */ new Map(),
|
|
463
|
-
const f = o.get(d), m = It(d ?? ""),
|
|
462
|
+
} = e, o = /* @__PURE__ */ new Map(), l = u.toSignal(t).map((h) => h.map((d, g) => {
|
|
463
|
+
const f = o.get(d), m = It(d ?? ""), x = f?.type || yt(m), _ = f?.name ?? `file-${g}`, b = m.buffer.slice(
|
|
464
464
|
m.byteOffset,
|
|
465
465
|
m.byteOffset + m.byteLength
|
|
466
|
-
),
|
|
467
|
-
return new File([
|
|
468
|
-
})),
|
|
466
|
+
), v = new Blob([b], { type: x });
|
|
467
|
+
return new File([v], _, { type: x });
|
|
468
|
+
})), i = (h) => (d) => {
|
|
469
469
|
h && $t(d).then((g) => {
|
|
470
470
|
for (const [f, m] of g.entries())
|
|
471
471
|
o.set(m, { name: d[f].name, type: d[f].type });
|
|
472
472
|
h(g);
|
|
473
473
|
});
|
|
474
|
-
}, c =
|
|
474
|
+
}, c = i(r), p = i(n);
|
|
475
475
|
return wt({
|
|
476
476
|
...s,
|
|
477
|
-
value:
|
|
477
|
+
value: l,
|
|
478
478
|
onChange: c,
|
|
479
479
|
onInput: p
|
|
480
480
|
});
|
|
@@ -489,7 +489,7 @@ function pn(e) {
|
|
|
489
489
|
return Ct({
|
|
490
490
|
...s,
|
|
491
491
|
maxFiles: 1,
|
|
492
|
-
value:
|
|
492
|
+
value: u.map(t, (o) => o == null ? [] : [o]),
|
|
493
493
|
onChange: (o) => {
|
|
494
494
|
n?.(o[0]);
|
|
495
495
|
},
|
|
@@ -516,8 +516,8 @@ function kt(e) {
|
|
|
516
516
|
if (r) {
|
|
517
517
|
const d = r[1];
|
|
518
518
|
if (d.length === 8) {
|
|
519
|
-
const g = parseInt(d.slice(0, 2), 16), f = parseInt(d.slice(2, 4), 16), m = parseInt(d.slice(4, 6), 16),
|
|
520
|
-
return [g, f, m,
|
|
519
|
+
const g = parseInt(d.slice(0, 2), 16), f = parseInt(d.slice(2, 4), 16), m = parseInt(d.slice(4, 6), 16), x = parseInt(d.slice(6, 8), 16) / 255;
|
|
520
|
+
return [g, f, m, x];
|
|
521
521
|
}
|
|
522
522
|
if (d.length === 6)
|
|
523
523
|
return [
|
|
@@ -527,8 +527,8 @@ function kt(e) {
|
|
|
527
527
|
1
|
|
528
528
|
];
|
|
529
529
|
if (d.length === 4) {
|
|
530
|
-
const g = parseInt(d[0] + d[0], 16), f = parseInt(d[1] + d[1], 16), m = parseInt(d[2] + d[2], 16),
|
|
531
|
-
return [g, f, m,
|
|
530
|
+
const g = parseInt(d[0] + d[0], 16), f = parseInt(d[1] + d[1], 16), m = parseInt(d[2] + d[2], 16), x = parseInt(d[3] + d[3], 16) / 255;
|
|
531
|
+
return [g, f, m, x];
|
|
532
532
|
}
|
|
533
533
|
if (d.length === 3) {
|
|
534
534
|
const g = parseInt(d[0] + d[0], 16), f = parseInt(d[1] + d[1], 16), m = parseInt(d[2] + d[2], 16);
|
|
@@ -554,22 +554,22 @@ function kt(e) {
|
|
|
554
554
|
/^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i
|
|
555
555
|
);
|
|
556
556
|
if (o) {
|
|
557
|
-
const d = parseFloat(o[1]), g = parseFloat(o[2]), f = parseFloat(o[3]), m = o[4] != null ? parseFloat(o[4]) : 1, [
|
|
558
|
-
return [
|
|
557
|
+
const d = parseFloat(o[1]), g = parseFloat(o[2]), f = parseFloat(o[3]), m = o[4] != null ? parseFloat(o[4]) : 1, [x, _, b] = Pe(d, g / 100, f / 100);
|
|
558
|
+
return [x, _, b, m];
|
|
559
559
|
}
|
|
560
|
-
const
|
|
560
|
+
const l = e.match(
|
|
561
561
|
/^hwb\(\s*([+-]?[\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[/]\s*(\d?(?:\.\d+)?))?\s*\)$/i
|
|
562
562
|
);
|
|
563
|
-
if (
|
|
564
|
-
const d = parseFloat(
|
|
565
|
-
return [
|
|
563
|
+
if (l) {
|
|
564
|
+
const d = parseFloat(l[1]), g = parseFloat(l[2]) / 100, f = parseFloat(l[3]) / 100, m = l[4] != null ? parseFloat(l[4]) : 1, [x, _, b] = Dt(d, g, f);
|
|
565
|
+
return [x, _, b, m];
|
|
566
566
|
}
|
|
567
|
-
const
|
|
567
|
+
const i = e.match(
|
|
568
568
|
/^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i
|
|
569
569
|
);
|
|
570
|
-
if (
|
|
571
|
-
const d =
|
|
572
|
-
return [_, b,
|
|
570
|
+
if (i) {
|
|
571
|
+
const d = i[1], g = parseFloat(i[2]), f = parseFloat(i[3]), m = i[4] != null ? parseFloat(i[4]) : 1, x = d.endsWith("%") ? Math.max(0, Math.min(1, parseFloat(d) / 100)) : Math.max(0, Math.min(1, parseFloat(d))), [_, b, v] = At(x, g, f);
|
|
572
|
+
return [_, b, v, m];
|
|
573
573
|
}
|
|
574
574
|
const [c, p, h] = Ie(e);
|
|
575
575
|
return [c, p, h, 1];
|
|
@@ -578,7 +578,7 @@ const Mt = (e, t, r, n) => `rgba(${Math.round(e)}, ${Math.round(t)}, ${Math.roun
|
|
|
578
578
|
0,
|
|
579
579
|
Math.min(1, Math.round(n * 100) / 100)
|
|
580
580
|
)})`;
|
|
581
|
-
function
|
|
581
|
+
function Tt(e) {
|
|
582
582
|
let t = e + 1831565813;
|
|
583
583
|
return function() {
|
|
584
584
|
return t = Math.imul(t ^ t >>> 15, t | 1), t ^= t + Math.imul(t ^ t >>> 7, t | 61), ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
@@ -587,27 +587,27 @@ function St(e) {
|
|
|
587
587
|
function Pe(e, t, r) {
|
|
588
588
|
e = (e % 360 + 360) % 360;
|
|
589
589
|
const n = (1 - Math.abs(2 * r - 1)) * t, s = n * (1 - Math.abs(e / 60 % 2 - 1)), o = r - n / 2;
|
|
590
|
-
let
|
|
591
|
-
return 0 <= e && e < 60 ? [
|
|
592
|
-
Math.round((
|
|
593
|
-
Math.round((
|
|
590
|
+
let l = 0, i = 0, c = 0;
|
|
591
|
+
return 0 <= e && e < 60 ? [l, i, c] = [n, s, 0] : 60 <= e && e < 120 ? [l, i, c] = [s, n, 0] : 120 <= e && e < 180 ? [l, i, c] = [0, n, s] : 180 <= e && e < 240 ? [l, i, c] = [0, s, n] : 240 <= e && e < 300 ? [l, i, c] = [s, 0, n] : [l, i, c] = [n, 0, s], [
|
|
592
|
+
Math.round((l + o) * 255),
|
|
593
|
+
Math.round((i + o) * 255),
|
|
594
594
|
Math.round((c + o) * 255)
|
|
595
595
|
];
|
|
596
596
|
}
|
|
597
|
-
function
|
|
597
|
+
function Dt(e, t, r) {
|
|
598
598
|
e = (e % 360 + 360) % 360;
|
|
599
599
|
const n = t + r;
|
|
600
600
|
n > 1 && (t /= n, r /= n);
|
|
601
|
-
const [s, o,
|
|
601
|
+
const [s, o, l] = Pe(e, 1, 0.5).map((d) => d / 255), i = 1 - t - r, c = s * i + t, p = o * i + t, h = l * i + t;
|
|
602
602
|
return [Math.round(c * 255), Math.round(p * 255), Math.round(h * 255)];
|
|
603
603
|
}
|
|
604
604
|
function ke(e, t, r) {
|
|
605
605
|
e /= 255, t /= 255, r /= 255;
|
|
606
606
|
const n = Math.max(e, t, r), s = Math.min(e, t, r);
|
|
607
|
-
let o = 0,
|
|
608
|
-
const
|
|
607
|
+
let o = 0, l = 0;
|
|
608
|
+
const i = (n + s) / 2, c = n - s;
|
|
609
609
|
if (c !== 0) {
|
|
610
|
-
switch (
|
|
610
|
+
switch (l = i > 0.5 ? c / (2 - n - s) : c / (n + s), n) {
|
|
611
611
|
case e:
|
|
612
612
|
o = (t - r) / c + (t < r ? 6 : 0);
|
|
613
613
|
break;
|
|
@@ -619,11 +619,11 @@ function ke(e, t, r) {
|
|
|
619
619
|
}
|
|
620
620
|
o *= 60;
|
|
621
621
|
}
|
|
622
|
-
return [Math.round(o), Math.round(
|
|
622
|
+
return [Math.round(o), Math.round(l * 100), Math.round(i * 100)];
|
|
623
623
|
}
|
|
624
|
-
function
|
|
625
|
-
const [n] = ke(e, t, r), s = e / 255, o = t / 255,
|
|
626
|
-
return [n, Math.round(
|
|
624
|
+
function St(e, t, r) {
|
|
625
|
+
const [n] = ke(e, t, r), s = e / 255, o = t / 255, l = r / 255, i = Math.min(s, o, l), c = 1 - Math.max(s, o, l);
|
|
626
|
+
return [n, Math.round(i * 100), Math.round(c * 100)];
|
|
627
627
|
}
|
|
628
628
|
function xe(e) {
|
|
629
629
|
const t = e / 255;
|
|
@@ -634,20 +634,20 @@ function we(e) {
|
|
|
634
634
|
return Math.round(Math.max(0, Math.min(1, t)) * 255);
|
|
635
635
|
}
|
|
636
636
|
function At(e, t, r) {
|
|
637
|
-
const n = r * Math.PI / 180, s = Math.cos(n) * t, o = Math.sin(n) * t,
|
|
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, i = e - 0.1055613458 * s - 0.0638541728 * o, c = e - 0.0894841775 * s - 1.291485548 * o, p = l * l * l, h = i * i * i, d = c * c * c, g = 4.0767416621 * p - 3.3077115913 * h + 0.2309699292 * d, f = -1.2684380046 * p + 2.6097574011 * h - 0.3413193965 * d, m = -0.0041960863 * p - 0.7034186147 * h + 1.707614701 * d;
|
|
638
638
|
return [we(g), we(f), we(m)];
|
|
639
639
|
}
|
|
640
640
|
function Ft(e, t, r) {
|
|
641
|
-
const n = xe(e), s = xe(t), o = xe(r),
|
|
641
|
+
const n = xe(e), s = xe(t), o = xe(r), l = 0.4122214708 * n + 0.5363325363 * s + 0.0514459929 * o, i = 0.2119034982 * n + 0.6806995451 * s + 0.1073969566 * o, c = 0.0883024619 * n + 0.2817188376 * s + 0.6299787005 * o, p = Math.cbrt(l), h = Math.cbrt(i), d = Math.cbrt(c), g = 0.2104542553 * p + 0.793617785 * h - 0.0040720468 * d, f = 1.9779984951 * p - 2.428592205 * h + 0.4505937099 * d, m = 0.0259040371 * p + 0.7827717662 * h - 0.808675766 * d, x = Math.sqrt(f * f + m * m);
|
|
642
642
|
let _ = Math.atan2(m, f) * 180 / Math.PI;
|
|
643
|
-
return _ < 0 && (_ += 360), [g,
|
|
643
|
+
return _ < 0 && (_ += 360), [g, x, _];
|
|
644
644
|
}
|
|
645
|
-
function
|
|
645
|
+
function oe(e, t, r, n, s, o) {
|
|
646
646
|
switch (s) {
|
|
647
647
|
case "hex":
|
|
648
648
|
if (o) {
|
|
649
|
-
const
|
|
650
|
-
return `#${
|
|
649
|
+
const l = (c) => c.toString(16).padStart(2, "0"), i = Math.max(0, Math.min(255, Math.round(n * 255)));
|
|
650
|
+
return `#${l(e)}${l(t)}${l(r)}${l(i)}`;
|
|
651
651
|
}
|
|
652
652
|
return Ce(e, t, r);
|
|
653
653
|
case "rgb":
|
|
@@ -655,157 +655,157 @@ function ce(e, t, r, n, s, o) {
|
|
|
655
655
|
case "rgba":
|
|
656
656
|
return `rgba(${e}, ${t}, ${r}, ${Math.round(n * 100) / 100})`;
|
|
657
657
|
case "hsl": {
|
|
658
|
-
const [
|
|
659
|
-
return `hsl(${
|
|
658
|
+
const [l, i, c] = ke(e, t, r);
|
|
659
|
+
return `hsl(${l}, ${i}%, ${c}%)`;
|
|
660
660
|
}
|
|
661
661
|
case "hsla": {
|
|
662
|
-
const [
|
|
663
|
-
return `hsla(${
|
|
662
|
+
const [l, i, c] = ke(e, t, r);
|
|
663
|
+
return `hsla(${l}, ${i}%, ${c}%, ${Math.round(n * 100) / 100})`;
|
|
664
664
|
}
|
|
665
665
|
case "hwb": {
|
|
666
|
-
const [
|
|
667
|
-
return n < 1 ? `hwb(${
|
|
666
|
+
const [l, i, c] = St(e, t, r);
|
|
667
|
+
return n < 1 ? `hwb(${l} ${i}% ${c}% / ${Math.round(n * 100) / 100})` : `hwb(${l} ${i}% ${c}%)`;
|
|
668
668
|
}
|
|
669
669
|
case "oklch": {
|
|
670
|
-
const [
|
|
670
|
+
const [l, i, c] = Ft(e, t, r), p = (Math.round(l * 1e3) / 1e3).toFixed(3), h = (Math.round(i * 1e3) / 1e3).toFixed(3), d = (Math.round(c * 10) / 10).toFixed(1), g = Math.round(n * 100) / 100;
|
|
671
671
|
return o || n < 1 ? `oklch(${p} ${h} ${d} / ${g})` : `oklch(${p} ${h} ${d})`;
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function ce(e, t) {
|
|
676
676
|
return t ? e === "rgb" ? "rgba" : e === "hsl" ? "hsla" : e : e === "rgba" ? "rgb" : e === "hsla" ? "hsl" : e;
|
|
677
677
|
}
|
|
678
678
|
function Bt(e, t) {
|
|
679
|
-
const [r, n, s] = e, o = r << 16 ^ n << 8 ^ s,
|
|
680
|
-
for (let f = 0; f <
|
|
681
|
-
const m = f /
|
|
679
|
+
const [r, n, s] = e, o = r << 16 ^ n << 8 ^ s, l = Tt(o), i = 6 + Math.floor(l() * 5), c = 0.18 + l() * 0.06, p = [];
|
|
680
|
+
for (let f = 0; f < i; f++) {
|
|
681
|
+
const m = f / i * Math.PI * 2, x = t * (1 + (l() * 2 - 1) * c), _ = Math.cos(m) * x, b = Math.sin(m) * x;
|
|
682
682
|
p.push({ x: _, y: b });
|
|
683
683
|
}
|
|
684
|
-
const h = (p[0].x + p[
|
|
684
|
+
const h = (p[0].x + p[i - 1].x) / 2, d = (p[0].y + p[i - 1].y) / 2;
|
|
685
685
|
let g = `M ${h.toFixed(3)} ${d.toFixed(3)}`;
|
|
686
|
-
for (let f = 0; f <
|
|
687
|
-
const m = p[f],
|
|
686
|
+
for (let f = 0; f < i; f++) {
|
|
687
|
+
const m = p[f], x = p[(f + 1) % i], _ = (m.x + x.x) / 2, b = (m.y + x.y) / 2;
|
|
688
688
|
g += ` Q ${m.x.toFixed(3)} ${m.y.toFixed(3)} ${_.toFixed(3)} ${b.toFixed(3)}`;
|
|
689
689
|
}
|
|
690
690
|
return g += " Z", g;
|
|
691
691
|
}
|
|
692
692
|
const dn = (e) => {
|
|
693
|
-
const { value: t, onBlur: r, onChange: n, onInput: s, displayValue: o, size:
|
|
693
|
+
const { value: t, onBlur: r, onChange: n, onInput: s, displayValue: o, size: l, withAlpha: i } = e, c = u.map(l ?? 32, (w) => w), p = u.map(t, (w) => kt(w ?? "#000000")), h = u.map(
|
|
694
694
|
p,
|
|
695
|
-
([
|
|
696
|
-
), d =
|
|
695
|
+
([w, C, M]) => [w, C, M]
|
|
696
|
+
), d = u.map(p, ([, , , w]) => w), g = K(u.get(d) ?? 1), f = u.map(i ?? !1, (w) => w), m = u.map(
|
|
697
697
|
e.colorTextFormat ?? "rgb",
|
|
698
|
-
(
|
|
699
|
-
),
|
|
698
|
+
(w) => w
|
|
699
|
+
), x = B(
|
|
700
700
|
h,
|
|
701
701
|
g,
|
|
702
702
|
m,
|
|
703
703
|
f
|
|
704
704
|
)(
|
|
705
|
-
([
|
|
706
|
-
), _ =
|
|
705
|
+
([w, C, M], A, F, D) => oe(w, C, M, A ?? 1, ce(F, D), D)
|
|
706
|
+
), _ = u.map(
|
|
707
707
|
e.colorTextFormat ?? "hex",
|
|
708
|
-
(
|
|
709
|
-
), b =
|
|
708
|
+
(w) => w
|
|
709
|
+
), b = u.map(c, (w) => `-${w / 2} -${w / 2} ${w} ${w}`), v = B(
|
|
710
710
|
h,
|
|
711
711
|
c
|
|
712
|
-
)((
|
|
712
|
+
)((w, C) => Bt(w, C / 2)), T = B(
|
|
713
713
|
h,
|
|
714
714
|
g,
|
|
715
715
|
f
|
|
716
716
|
)(
|
|
717
|
-
([
|
|
718
|
-
),
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
717
|
+
([w, C, M], A, F) => F || A < 1 ? Mt(w, C, M, A) : Ce(w, C, M)
|
|
718
|
+
), I = $.div(
|
|
719
|
+
a.class("bc-color-input__control"),
|
|
720
|
+
a.class(
|
|
721
|
+
u.map(
|
|
722
722
|
f,
|
|
723
|
-
(
|
|
723
|
+
(w) => w ? "bc-color-input__control--alpha" : ""
|
|
724
724
|
)
|
|
725
725
|
),
|
|
726
|
-
|
|
726
|
+
a.style(B(c)((w) => `width:${w}px;height:${w}px`)),
|
|
727
727
|
// The SVG blob preview
|
|
728
|
-
|
|
729
|
-
|
|
728
|
+
Se.svg(
|
|
729
|
+
a.class("bc-color-input__svg"),
|
|
730
730
|
be.viewBox(b),
|
|
731
|
-
|
|
731
|
+
Se.path(be.d(v), be.fill(T))
|
|
732
732
|
),
|
|
733
733
|
// Invisible native input overlays the blob for picker and accessibility
|
|
734
734
|
$.input(
|
|
735
|
-
|
|
735
|
+
a.type("color"),
|
|
736
736
|
Y(e),
|
|
737
737
|
// Native color input needs hex without alpha
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
r != null ? k.blur(r) :
|
|
741
|
-
n != null ? k.change((
|
|
742
|
-
const
|
|
738
|
+
a.value(u.map(h, ([w, C, M]) => Ce(w, C, M))),
|
|
739
|
+
a.class("bc-input bc-color-input bc-color-input__native"),
|
|
740
|
+
r != null ? k.blur(r) : S,
|
|
741
|
+
n != null ? k.change((w) => {
|
|
742
|
+
const C = w.target.value;
|
|
743
743
|
if (!n) return;
|
|
744
|
-
const [M, A, F] = Ie(
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
), z =
|
|
744
|
+
const [M, A, F] = Ie(C), D = u.get(g) ?? 1, V = ce(
|
|
745
|
+
u.get(_),
|
|
746
|
+
u.get(f)
|
|
747
|
+
), z = oe(M, A, F, D, V, u.get(f));
|
|
748
748
|
n(z);
|
|
749
|
-
}) :
|
|
750
|
-
s != null ? k.input((
|
|
751
|
-
const
|
|
749
|
+
}) : S,
|
|
750
|
+
s != null ? k.input((w) => {
|
|
751
|
+
const C = w.target.value;
|
|
752
752
|
if (!s) return;
|
|
753
|
-
const [M, A, F] = Ie(
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
), z =
|
|
753
|
+
const [M, A, F] = Ie(C), D = u.get(g) ?? 1, V = ce(
|
|
754
|
+
u.get(_),
|
|
755
|
+
u.get(f)
|
|
756
|
+
), z = oe(M, A, F, D, V, u.get(f));
|
|
757
757
|
s(z);
|
|
758
|
-
}) :
|
|
758
|
+
}) : S
|
|
759
759
|
)
|
|
760
760
|
), y = E(
|
|
761
761
|
f,
|
|
762
762
|
() => $.input(
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
k.input((
|
|
771
|
-
const
|
|
772
|
-
g.set(
|
|
773
|
-
const [M, A, F] =
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
),
|
|
777
|
-
s?.(
|
|
763
|
+
a.type("range"),
|
|
764
|
+
a.class("bc-color-input__alpha"),
|
|
765
|
+
a.min(0),
|
|
766
|
+
a.max(1),
|
|
767
|
+
a.step(0.01),
|
|
768
|
+
a.value(u.map(g, (w) => String(w ?? 1))),
|
|
769
|
+
a.disabled(e.disabled),
|
|
770
|
+
k.input((w) => {
|
|
771
|
+
const C = parseFloat(w.target.value);
|
|
772
|
+
g.set(C);
|
|
773
|
+
const [M, A, F] = u.get(h), D = ce(
|
|
774
|
+
u.get(_),
|
|
775
|
+
u.get(f)
|
|
776
|
+
), V = oe(M, A, F, C, D, u.get(f));
|
|
777
|
+
s?.(V);
|
|
778
778
|
}),
|
|
779
|
-
k.change((
|
|
780
|
-
const
|
|
781
|
-
g.set(
|
|
782
|
-
const [M, A, F] =
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
),
|
|
786
|
-
n?.(
|
|
779
|
+
k.change((w) => {
|
|
780
|
+
const C = parseFloat(w.target.value);
|
|
781
|
+
g.set(C);
|
|
782
|
+
const [M, A, F] = u.get(h), D = ce(
|
|
783
|
+
u.get(_),
|
|
784
|
+
u.get(f)
|
|
785
|
+
), V = oe(M, A, F, C, D, u.get(f));
|
|
786
|
+
n?.(V);
|
|
787
787
|
})
|
|
788
788
|
)
|
|
789
789
|
);
|
|
790
|
-
return
|
|
790
|
+
return j({
|
|
791
791
|
baseContainer: !0,
|
|
792
792
|
...e,
|
|
793
793
|
// ensure our control does not try to grow
|
|
794
794
|
growInput: !1,
|
|
795
|
-
input:
|
|
795
|
+
input: I,
|
|
796
796
|
// If caller provided an `after`, append RGB before it
|
|
797
797
|
after: L(
|
|
798
798
|
E(
|
|
799
799
|
o ?? !1,
|
|
800
|
-
() => $.span(
|
|
800
|
+
() => $.span(a.class("bc-color-input__rgb"), x)
|
|
801
801
|
),
|
|
802
802
|
y,
|
|
803
803
|
e.after
|
|
804
804
|
)
|
|
805
805
|
});
|
|
806
|
-
}, Me = "$$tts-exp-", Vt = (e, t) =>
|
|
806
|
+
}, Me = "$$tts-exp-", Vt = (e, t) => ie((r) => {
|
|
807
807
|
const n = `${Me}${e}`;
|
|
808
|
-
return
|
|
808
|
+
return W(u.on(t, (s) => Reflect.set(r, n, s)));
|
|
809
809
|
}), mn = (e, t) => {
|
|
810
810
|
const r = `${Me}${e}`;
|
|
811
811
|
return (n) => {
|
|
@@ -814,8 +814,8 @@ const dn = (e) => {
|
|
|
814
814
|
}, Lt = (e, t) => {
|
|
815
815
|
const r = `${Me}${e}`;
|
|
816
816
|
return (n) => {
|
|
817
|
-
const s = n.target, o = s.selectedIndex,
|
|
818
|
-
t(Reflect.get(
|
|
817
|
+
const s = n.target, o = s.selectedIndex, l = s.options[o];
|
|
818
|
+
t(Reflect.get(l, r));
|
|
819
819
|
};
|
|
820
820
|
};
|
|
821
821
|
function Et(e, t, r) {
|
|
@@ -824,16 +824,16 @@ function Et(e, t, r) {
|
|
|
824
824
|
}
|
|
825
825
|
function hn({ variant: e = "default", size: t = "md", roundedness: r = "lg" } = {}, ...n) {
|
|
826
826
|
return $.div(
|
|
827
|
-
|
|
828
|
-
|
|
827
|
+
a.class(
|
|
828
|
+
B(
|
|
829
829
|
e,
|
|
830
830
|
t,
|
|
831
831
|
r
|
|
832
832
|
)(
|
|
833
|
-
(s, o,
|
|
833
|
+
(s, o, l) => Et(
|
|
834
834
|
s ?? "default",
|
|
835
835
|
o ?? "md",
|
|
836
|
-
|
|
836
|
+
l ?? "lg"
|
|
837
837
|
)
|
|
838
838
|
)
|
|
839
839
|
),
|
|
@@ -847,30 +847,30 @@ const bn = ({
|
|
|
847
847
|
placeholder: n,
|
|
848
848
|
disabled: s
|
|
849
849
|
}) => {
|
|
850
|
-
const o =
|
|
850
|
+
const o = u.deriveProp(e ?? !1), l = K(!1), i = u.map(s ?? !1, (c) => c);
|
|
851
851
|
return $.div(
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
852
|
+
a.class("bc-editable-text"),
|
|
853
|
+
a.class(
|
|
854
|
+
u.map(
|
|
855
|
+
i,
|
|
856
856
|
(c) => c ? "bc-editable-text--disabled" : ""
|
|
857
857
|
)
|
|
858
858
|
),
|
|
859
|
-
|
|
859
|
+
N.disabled(i),
|
|
860
860
|
E(
|
|
861
861
|
o,
|
|
862
862
|
() => $.input(
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
863
|
+
a.placeholder(n),
|
|
864
|
+
a.value(t),
|
|
865
|
+
a.class("bc-editable-text__input"),
|
|
866
866
|
nt(),
|
|
867
867
|
k.keydown((c) => {
|
|
868
|
-
c.key === "Enter" ? o.set(!1) : c.key === "Escape" && (
|
|
868
|
+
c.key === "Enter" ? o.set(!1) : c.key === "Escape" && (l.set(!0), o.set(!1));
|
|
869
869
|
}),
|
|
870
870
|
k.blur(
|
|
871
871
|
P((c) => {
|
|
872
|
-
if (o.set(!1),
|
|
873
|
-
|
|
872
|
+
if (o.set(!1), l.value) {
|
|
873
|
+
l.set(!1);
|
|
874
874
|
return;
|
|
875
875
|
}
|
|
876
876
|
r(c);
|
|
@@ -879,24 +879,24 @@ const bn = ({
|
|
|
879
879
|
),
|
|
880
880
|
() => $.span(
|
|
881
881
|
k.click(() => {
|
|
882
|
-
|
|
882
|
+
u.get(i) || o.set(!0);
|
|
883
883
|
}),
|
|
884
|
-
|
|
884
|
+
a.class("bc-editable-text__display"),
|
|
885
885
|
E(
|
|
886
|
-
|
|
887
|
-
() => $.span(
|
|
886
|
+
u.map(t, (c) => c != null && c.trim() !== ""),
|
|
887
|
+
() => $.span(a.class("bc-editable-text__text"), t),
|
|
888
888
|
() => $.span(
|
|
889
|
-
|
|
889
|
+
a.class("bc-editable-text__placeholder"),
|
|
890
890
|
n
|
|
891
891
|
)
|
|
892
892
|
),
|
|
893
893
|
E(
|
|
894
|
-
|
|
894
|
+
u.map(i, (c) => !c),
|
|
895
895
|
() => $.button(
|
|
896
|
-
|
|
897
|
-
|
|
896
|
+
a.class("bc-editable-text__edit-button"),
|
|
897
|
+
O(H, (c) => N.label(c.$.editLabel)),
|
|
898
898
|
k.click(() => o.set(!0)),
|
|
899
|
-
|
|
899
|
+
R({ icon: "line-md/pencil", color: "neutral" })
|
|
900
900
|
)
|
|
901
901
|
)
|
|
902
902
|
)
|
|
@@ -906,19 +906,19 @@ const bn = ({
|
|
|
906
906
|
e,
|
|
907
907
|
(n) => qe(n, {
|
|
908
908
|
value: (s) => {
|
|
909
|
-
const o =
|
|
909
|
+
const o = B(
|
|
910
910
|
s,
|
|
911
911
|
r
|
|
912
|
-
)((
|
|
912
|
+
)((l, i) => t(l.value, i));
|
|
913
913
|
return $.option(
|
|
914
|
-
|
|
915
|
-
|
|
914
|
+
W(o.dispose),
|
|
915
|
+
a.selected(o),
|
|
916
916
|
Vt("value", s.$.value),
|
|
917
917
|
s.$.label
|
|
918
918
|
);
|
|
919
919
|
},
|
|
920
920
|
group: (s) => $.optgroup(
|
|
921
|
-
|
|
921
|
+
a.label(s.$.group),
|
|
922
922
|
de(
|
|
923
923
|
s.$.options,
|
|
924
924
|
(o) => je(
|
|
@@ -937,42 +937,42 @@ const bn = ({
|
|
|
937
937
|
onChange: n,
|
|
938
938
|
options: s,
|
|
939
939
|
unselectedLabel: o,
|
|
940
|
-
equality:
|
|
941
|
-
after:
|
|
940
|
+
equality: l = (p, h) => p === h,
|
|
941
|
+
after: i
|
|
942
942
|
} = e;
|
|
943
943
|
let c;
|
|
944
|
-
return
|
|
944
|
+
return j(
|
|
945
945
|
{
|
|
946
946
|
...e,
|
|
947
947
|
after: L(
|
|
948
|
-
|
|
948
|
+
R({
|
|
949
949
|
icon: "ph:caret-down-bold",
|
|
950
950
|
color: "neutral",
|
|
951
951
|
size: "sm"
|
|
952
952
|
}),
|
|
953
|
-
|
|
953
|
+
i
|
|
954
954
|
),
|
|
955
955
|
input: $.select(
|
|
956
|
-
|
|
956
|
+
ie((p) => {
|
|
957
957
|
c = p;
|
|
958
958
|
const h = new MutationObserver((d) => {
|
|
959
959
|
const { removedNodes: g } = d[0];
|
|
960
960
|
g.length > 0 && (c.selectedIndex = 0);
|
|
961
961
|
});
|
|
962
|
-
return h.observe(p, { childList: !0 }),
|
|
962
|
+
return h.observe(p, { childList: !0 }), W(() => h.disconnect());
|
|
963
963
|
}),
|
|
964
964
|
Y(e),
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
965
|
+
a.class("bc-native-select bc-input bu-w-full"),
|
|
966
|
+
O(
|
|
967
|
+
H,
|
|
968
968
|
(p) => $.option(
|
|
969
|
-
|
|
969
|
+
a.hidden("hidden"),
|
|
970
970
|
Xe(o, p.$.selectOne)
|
|
971
971
|
)
|
|
972
972
|
),
|
|
973
|
-
de(s, (p) => je(p,
|
|
974
|
-
r != null ? k.blur(r) :
|
|
975
|
-
n != null ? k.change(Lt("value", (p) => n(p))) :
|
|
973
|
+
de(s, (p) => je(p, l, t)),
|
|
974
|
+
r != null ? k.blur(r) : S,
|
|
975
|
+
n != null ? k.change(Lt("value", (p) => n(p))) : S
|
|
976
976
|
)
|
|
977
977
|
},
|
|
978
978
|
k.click(() => {
|
|
@@ -985,7 +985,7 @@ function Nt(e) {
|
|
|
985
985
|
return Ut({
|
|
986
986
|
...s,
|
|
987
987
|
value: t.value,
|
|
988
|
-
onChange:
|
|
988
|
+
onChange: lt(t, r),
|
|
989
989
|
onBlur: rt(t, n)
|
|
990
990
|
});
|
|
991
991
|
}
|
|
@@ -995,25 +995,25 @@ function gn(e) {
|
|
|
995
995
|
content: Nt(e)
|
|
996
996
|
});
|
|
997
997
|
}
|
|
998
|
-
function
|
|
998
|
+
function Rt(e, t, r) {
|
|
999
999
|
const n = e.length.map((s) => s);
|
|
1000
1000
|
return L(
|
|
1001
|
-
|
|
1002
|
-
|
|
1001
|
+
W(() => n.dispose()),
|
|
1002
|
+
Re(
|
|
1003
1003
|
n,
|
|
1004
1004
|
(s) => {
|
|
1005
|
-
const o = e.item(s.index),
|
|
1005
|
+
const o = e.item(s.index), l = [];
|
|
1006
1006
|
return L(
|
|
1007
|
-
|
|
1008
|
-
o.dispose(),
|
|
1007
|
+
W(() => {
|
|
1008
|
+
o.dispose(), l.forEach((i) => i());
|
|
1009
1009
|
}),
|
|
1010
1010
|
t({
|
|
1011
1011
|
list: e,
|
|
1012
1012
|
item: o,
|
|
1013
1013
|
position: s,
|
|
1014
1014
|
remove: () => e.removeAt(s.index),
|
|
1015
|
-
move: (
|
|
1016
|
-
switch (
|
|
1015
|
+
move: (i) => {
|
|
1016
|
+
switch (i) {
|
|
1017
1017
|
case "up":
|
|
1018
1018
|
if (s.index === 0) return;
|
|
1019
1019
|
e.move(s.index, s.index - 1);
|
|
@@ -1029,27 +1029,27 @@ function zt(e, t, r) {
|
|
|
1029
1029
|
e.move(s.index, e.length.value - 1);
|
|
1030
1030
|
}
|
|
1031
1031
|
},
|
|
1032
|
-
canMove: (
|
|
1032
|
+
canMove: (i) => {
|
|
1033
1033
|
const c = (() => {
|
|
1034
|
-
switch (
|
|
1034
|
+
switch (i) {
|
|
1035
1035
|
case "up":
|
|
1036
1036
|
return Ae(s.index > 0);
|
|
1037
1037
|
case "down":
|
|
1038
1038
|
return e.length.map((p) => s.index < p - 1);
|
|
1039
1039
|
}
|
|
1040
1040
|
})();
|
|
1041
|
-
return
|
|
1041
|
+
return l.push(() => c.dispose()), c;
|
|
1042
1042
|
},
|
|
1043
|
-
cannotMove: (
|
|
1043
|
+
cannotMove: (i) => {
|
|
1044
1044
|
const c = (() => {
|
|
1045
|
-
switch (
|
|
1045
|
+
switch (i) {
|
|
1046
1046
|
case "up":
|
|
1047
1047
|
return Ae(s.index === 0);
|
|
1048
1048
|
case "down":
|
|
1049
1049
|
return e.length.map((p) => s.index === p - 1);
|
|
1050
1050
|
}
|
|
1051
1051
|
})();
|
|
1052
|
-
return
|
|
1052
|
+
return l.push(() => c.dispose()), c;
|
|
1053
1053
|
}
|
|
1054
1054
|
})
|
|
1055
1055
|
);
|
|
@@ -1062,22 +1062,22 @@ const Le = {
|
|
|
1062
1062
|
9: { pattern: /^[0-9]$/ },
|
|
1063
1063
|
A: { pattern: /^[A-Za-z]$/, transform: (e) => e.toUpperCase() },
|
|
1064
1064
|
"*": { pattern: /^.$/ }
|
|
1065
|
-
},
|
|
1065
|
+
}, zt = (e) => e instanceof RegExp;
|
|
1066
1066
|
function He(e, t, r) {
|
|
1067
1067
|
if (e == null) return [];
|
|
1068
|
-
const n = r ? { ...Le, ...t } : t ?? Le, s = (
|
|
1069
|
-
const c = n[
|
|
1070
|
-
c ?
|
|
1068
|
+
const n = r ? { ...Le, ...t } : t ?? Le, s = (l, i) => {
|
|
1069
|
+
const c = n[i];
|
|
1070
|
+
c ? l.push({ type: "pattern", name: i, ...c }) : l.push({ type: "literal", char: i });
|
|
1071
1071
|
}, o = [];
|
|
1072
1072
|
if (typeof e == "string") {
|
|
1073
|
-
for (const
|
|
1073
|
+
for (const l of e) s(o, l);
|
|
1074
1074
|
return o;
|
|
1075
1075
|
}
|
|
1076
|
-
for (const
|
|
1077
|
-
if (typeof
|
|
1078
|
-
if (
|
|
1079
|
-
else for (const
|
|
1080
|
-
else
|
|
1076
|
+
for (const l of e)
|
|
1077
|
+
if (typeof l == "string")
|
|
1078
|
+
if (l.length <= 1) s(o, l);
|
|
1079
|
+
else for (const i of l) s(o, i);
|
|
1080
|
+
else zt(l) ? o.push({ type: "pattern", pattern: l }) : typeof l == "object" && l && o.push(l);
|
|
1081
1081
|
return o;
|
|
1082
1082
|
}
|
|
1083
1083
|
function Ot(e, t) {
|
|
@@ -1097,57 +1097,57 @@ function Ot(e, t) {
|
|
|
1097
1097
|
};
|
|
1098
1098
|
}
|
|
1099
1099
|
function Ee(e, t, r, n, s, o) {
|
|
1100
|
-
const
|
|
1100
|
+
const l = {
|
|
1101
1101
|
raw: e,
|
|
1102
1102
|
previousConformed: t,
|
|
1103
1103
|
cursor: s ?? e.length,
|
|
1104
1104
|
completed: !1
|
|
1105
|
-
},
|
|
1105
|
+
}, i = n.definitions ?? {}, c = typeof r == "function" ? r(e, l) : r, p = He(
|
|
1106
1106
|
c,
|
|
1107
|
-
|
|
1107
|
+
i,
|
|
1108
1108
|
n.useDefaultDefinitions ?? !0
|
|
1109
1109
|
), h = Ot(n.allowMode, n.allow), d = /* @__PURE__ */ new Set();
|
|
1110
|
-
for (const
|
|
1111
|
-
if (n.prefix) for (const
|
|
1112
|
-
if (n.suffix) for (const
|
|
1113
|
-
const g = Array.from(e).filter((
|
|
1110
|
+
for (const D of p) D.type === "literal" && d.add(D.char);
|
|
1111
|
+
if (n.prefix) for (const D of n.prefix) d.add(D);
|
|
1112
|
+
if (n.suffix) for (const D of n.suffix) d.add(D);
|
|
1113
|
+
const g = Array.from(e).filter((D) => h(D) && !d.has(D));
|
|
1114
1114
|
if (g.length === 0) return { value: "", cursor: 0, completed: !1 };
|
|
1115
1115
|
const f = [], m = [];
|
|
1116
|
-
let
|
|
1117
|
-
for (const
|
|
1118
|
-
if (
|
|
1119
|
-
f.push(
|
|
1116
|
+
let x = 0, _ = 0, b = 0, v = -1;
|
|
1117
|
+
for (const D of p) {
|
|
1118
|
+
if (D.type === "literal") {
|
|
1119
|
+
f.push(D.char), m.push({ kind: "literal", filled: !0 });
|
|
1120
1120
|
continue;
|
|
1121
1121
|
}
|
|
1122
|
-
_ +=
|
|
1123
|
-
const
|
|
1124
|
-
if (
|
|
1122
|
+
_ += D.optional ? 0 : 1;
|
|
1123
|
+
const V = g[x];
|
|
1124
|
+
if (V == null)
|
|
1125
1125
|
break;
|
|
1126
|
-
if (
|
|
1127
|
-
b++, f.push(
|
|
1126
|
+
if (D.type === "any") {
|
|
1127
|
+
b++, f.push(D.transform ? D.transform(V) : V), m.push({ kind: "slot", filled: !0 }), v = m.length - 1, x++;
|
|
1128
1128
|
continue;
|
|
1129
1129
|
}
|
|
1130
|
-
if (
|
|
1131
|
-
if (
|
|
1130
|
+
if (D.type === "pattern")
|
|
1131
|
+
if (D.pattern.test(V)) {
|
|
1132
1132
|
b++;
|
|
1133
|
-
const z =
|
|
1134
|
-
f.push(z), m.push({ kind: "slot", filled: !0 }),
|
|
1133
|
+
const z = D.transform ? D.transform(V) : V;
|
|
1134
|
+
f.push(z), m.push({ kind: "slot", filled: !0 }), v = m.length - 1, x++;
|
|
1135
1135
|
} else {
|
|
1136
|
-
|
|
1136
|
+
x++;
|
|
1137
1137
|
continue;
|
|
1138
1138
|
}
|
|
1139
1139
|
}
|
|
1140
|
-
const
|
|
1141
|
-
let
|
|
1142
|
-
if (
|
|
1143
|
-
let
|
|
1140
|
+
const T = f.join(""), I = (n.prefix ?? "") + T + (n.suffix ?? "");
|
|
1141
|
+
let w = (n.prefix ?? "").length;
|
|
1142
|
+
if (v >= 0) {
|
|
1143
|
+
let D = v + 1;
|
|
1144
1144
|
if ((o?.policy ?? "smart") !== "sticky")
|
|
1145
|
-
for (;
|
|
1146
|
-
|
|
1145
|
+
for (; D < m.length && m[D].kind === "literal"; ) D++;
|
|
1146
|
+
w += D;
|
|
1147
1147
|
}
|
|
1148
|
-
const
|
|
1149
|
-
let A, F =
|
|
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 =
|
|
1148
|
+
const C = n.completion?.mode === "min" ? (n.completion.minChars ?? 0) <= b : n.completion?.mode === "custom" ? !!n.completion.isComplete?.(I) : _ > 0 && b >= _, M = n.pipe?.(I, { ...l, completed: C });
|
|
1149
|
+
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 = I, { value: A, cursor: F, completed: C };
|
|
1151
1151
|
}
|
|
1152
1152
|
function Pt(e, t) {
|
|
1153
1153
|
const r = t?.strategy ?? "none";
|
|
@@ -1160,8 +1160,8 @@ const We = (e) => {
|
|
|
1160
1160
|
onChange: n,
|
|
1161
1161
|
onInput: s,
|
|
1162
1162
|
onAccept: o,
|
|
1163
|
-
onComplete:
|
|
1164
|
-
mask:
|
|
1163
|
+
onComplete: l,
|
|
1164
|
+
mask: i,
|
|
1165
1165
|
definitions: c,
|
|
1166
1166
|
useDefaultDefinitions: p,
|
|
1167
1167
|
extraLiterals: h,
|
|
@@ -1169,131 +1169,131 @@ const We = (e) => {
|
|
|
1169
1169
|
suffix: g,
|
|
1170
1170
|
autofix: f,
|
|
1171
1171
|
pipe: m,
|
|
1172
|
-
completion:
|
|
1172
|
+
completion: x,
|
|
1173
1173
|
unmask: _,
|
|
1174
1174
|
allowMode: b,
|
|
1175
|
-
allow:
|
|
1176
|
-
placeholder:
|
|
1177
|
-
placeholderOptions:
|
|
1178
|
-
} = e, y =
|
|
1175
|
+
allow: v,
|
|
1176
|
+
placeholder: T,
|
|
1177
|
+
placeholderOptions: I
|
|
1178
|
+
} = e, y = B(
|
|
1179
1179
|
t,
|
|
1180
|
-
|
|
1180
|
+
i,
|
|
1181
1181
|
c,
|
|
1182
1182
|
p,
|
|
1183
1183
|
h,
|
|
1184
1184
|
d,
|
|
1185
1185
|
g,
|
|
1186
1186
|
f,
|
|
1187
|
-
|
|
1187
|
+
x,
|
|
1188
1188
|
_,
|
|
1189
1189
|
b,
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
)((
|
|
1190
|
+
T,
|
|
1191
|
+
I
|
|
1192
|
+
)((C, M, A, F, D, V, z, re, le, ee, Q, ue, q) => M ? Ee(C ?? "", "", M, {
|
|
1193
1193
|
definitions: A ?? {},
|
|
1194
1194
|
useDefaultDefinitions: F ?? !0,
|
|
1195
|
-
extraLiterals:
|
|
1196
|
-
autofix:
|
|
1195
|
+
extraLiterals: D ?? [],
|
|
1196
|
+
autofix: re ?? "none",
|
|
1197
1197
|
completion: le ?? { mode: "mask" },
|
|
1198
1198
|
pipe: m ?? ((U) => U),
|
|
1199
1199
|
unmask: ee ?? { strategy: "none" },
|
|
1200
1200
|
allowMode: Q ?? "all",
|
|
1201
|
-
allow:
|
|
1202
|
-
prefix:
|
|
1201
|
+
allow: v,
|
|
1202
|
+
prefix: V,
|
|
1203
1203
|
suffix: z
|
|
1204
|
-
}).value :
|
|
1205
|
-
const A =
|
|
1204
|
+
}).value : C ?? ""), w = (C, M) => {
|
|
1205
|
+
const A = C.value ?? "", F = u.get(t) ?? "", D = i != null ? u.get(i) : null, V = c != null ? u.get(c) : void 0, z = p != null ? u.get(p) : void 0, re = h != null ? u.get(h) : void 0, le = f != null ? u.get(f) : void 0, ee = x != null ? u.get(x) : void 0, Q = _ != null ? u.get(_) : void 0, ue = b != null ? u.get(b) : void 0, q = d != null ? u.get(d) : void 0, U = g != null ? u.get(g) : void 0, {
|
|
1206
1206
|
value: J,
|
|
1207
1207
|
cursor: he,
|
|
1208
|
-
completed:
|
|
1209
|
-
} =
|
|
1208
|
+
completed: Te
|
|
1209
|
+
} = D ? Ee(
|
|
1210
1210
|
A,
|
|
1211
1211
|
F,
|
|
1212
|
-
|
|
1212
|
+
D,
|
|
1213
1213
|
{
|
|
1214
|
-
definitions:
|
|
1214
|
+
definitions: V ?? {},
|
|
1215
1215
|
useDefaultDefinitions: z ?? !0,
|
|
1216
|
-
extraLiterals:
|
|
1216
|
+
extraLiterals: re ?? [],
|
|
1217
1217
|
autofix: le ?? "none",
|
|
1218
1218
|
completion: ee ?? { mode: "mask" },
|
|
1219
1219
|
pipe: m ?? ((Ze) => Ze),
|
|
1220
1220
|
unmask: Q ?? { strategy: "none" },
|
|
1221
1221
|
allowMode: ue ?? "all",
|
|
1222
|
-
allow:
|
|
1222
|
+
allow: v,
|
|
1223
1223
|
prefix: q,
|
|
1224
1224
|
suffix: U
|
|
1225
1225
|
},
|
|
1226
|
-
|
|
1227
|
-
e.cursor ?
|
|
1226
|
+
C.selectionStart ?? A.length,
|
|
1227
|
+
e.cursor ? u.get(e.cursor) : void 0
|
|
1228
1228
|
) : { value: A, cursor: A.length, completed: !0 };
|
|
1229
1229
|
if (J !== A) {
|
|
1230
|
-
|
|
1230
|
+
C.value = J;
|
|
1231
1231
|
try {
|
|
1232
|
-
|
|
1232
|
+
C.setSelectionRange(he, he);
|
|
1233
1233
|
} catch {
|
|
1234
1234
|
}
|
|
1235
1235
|
}
|
|
1236
|
-
const
|
|
1236
|
+
const De = Pt(J, Q);
|
|
1237
1237
|
o?.({
|
|
1238
|
-
raw:
|
|
1238
|
+
raw: De,
|
|
1239
1239
|
conformed: J,
|
|
1240
|
-
completed:
|
|
1240
|
+
completed: Te,
|
|
1241
1241
|
cursor: he
|
|
1242
|
-
}), M === "input" ? s?.(J) : (n?.(J),
|
|
1242
|
+
}), M === "input" ? s?.(J) : (n?.(J), Te && l?.({ raw: De, conformed: J }));
|
|
1243
1243
|
};
|
|
1244
|
-
return
|
|
1244
|
+
return j({
|
|
1245
1245
|
...e,
|
|
1246
|
-
input:
|
|
1246
|
+
input: ne.text(
|
|
1247
1247
|
Y(e),
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
r != null ? k.blur(r) :
|
|
1251
|
-
|
|
1252
|
-
(
|
|
1253
|
-
k.input(() =>
|
|
1254
|
-
k.change(() =>
|
|
1248
|
+
a.value(y),
|
|
1249
|
+
a.class("bc-input"),
|
|
1250
|
+
r != null ? k.blur(r) : S,
|
|
1251
|
+
ie(
|
|
1252
|
+
(C) => C instanceof HTMLInputElement ? L(
|
|
1253
|
+
k.input(() => w(C, "input")),
|
|
1254
|
+
k.change(() => w(C, "change")),
|
|
1255
1255
|
k.keydown((M) => {
|
|
1256
|
-
if (M.key !== "Backspace" || !(e.cursor ?
|
|
1257
|
-
const F =
|
|
1258
|
-
if (F !==
|
|
1259
|
-
const
|
|
1256
|
+
if (M.key !== "Backspace" || !(e.cursor ? u.get(e.cursor)?.backspaceRubberBand ?? !0 : !0)) return;
|
|
1257
|
+
const F = C.selectionStart ?? 0, D = C.selectionEnd ?? F;
|
|
1258
|
+
if (F !== D || F <= 0) return;
|
|
1259
|
+
const V = C.value ?? "", z = i != null ? u.get(i) : null;
|
|
1260
1260
|
if (!z) return;
|
|
1261
|
-
const
|
|
1262
|
-
typeof z == "function" ? z(
|
|
1263
|
-
raw:
|
|
1264
|
-
previousConformed:
|
|
1261
|
+
const re = c != null ? u.get(c) : void 0, le = p != null ? u.get(p) : !0, ee = d != null ? u.get(d) : void 0, Q = g != null ? u.get(g) : void 0, ue = He(
|
|
1262
|
+
typeof z == "function" ? z(V, {
|
|
1263
|
+
raw: V,
|
|
1264
|
+
previousConformed: V,
|
|
1265
1265
|
cursor: F,
|
|
1266
1266
|
completed: !1
|
|
1267
1267
|
}) : z,
|
|
1268
|
-
|
|
1268
|
+
re ?? {},
|
|
1269
1269
|
le ?? !0
|
|
1270
1270
|
), q = /* @__PURE__ */ new Set();
|
|
1271
1271
|
for (const U of ue)
|
|
1272
1272
|
U.type === "literal" && q.add(U.char);
|
|
1273
1273
|
if (ee) for (const U of ee) q.add(U);
|
|
1274
1274
|
if (Q) for (const U of Q) q.add(U);
|
|
1275
|
-
if (q.has(
|
|
1275
|
+
if (q.has(V[F - 1])) {
|
|
1276
1276
|
let U = F - 1;
|
|
1277
|
-
for (; U >= 0 && q.has(
|
|
1278
|
-
U >= 0 && (M.preventDefault(), M.stopPropagation(),
|
|
1277
|
+
for (; U >= 0 && q.has(V[U]); ) U--;
|
|
1278
|
+
U >= 0 && (M.preventDefault(), M.stopPropagation(), C.value = V.slice(0, U) + V.slice(U + 1), w(C, "input"));
|
|
1279
1279
|
}
|
|
1280
1280
|
})
|
|
1281
|
-
) :
|
|
1281
|
+
) : S
|
|
1282
1282
|
)
|
|
1283
1283
|
)
|
|
1284
1284
|
});
|
|
1285
1285
|
};
|
|
1286
1286
|
function X(e, t, r) {
|
|
1287
|
-
const n =
|
|
1287
|
+
const n = u.map(e, (o) => o != null), s = ye.clearValue;
|
|
1288
1288
|
return E(
|
|
1289
1289
|
n,
|
|
1290
1290
|
() => $.button(
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1291
|
+
a.type("button"),
|
|
1292
|
+
a.class("bc-input-container__reset bu-text-light-gray"),
|
|
1293
|
+
N.label(s),
|
|
1294
|
+
a.title(s),
|
|
1295
|
+
a.disabled(t ?? !1),
|
|
1296
|
+
R({ icon: "mdi:close", size: "sm" }),
|
|
1297
1297
|
k.click((o) => {
|
|
1298
1298
|
o.preventDefault(), o.stopPropagation(), r?.(null);
|
|
1299
1299
|
})
|
|
@@ -1301,59 +1301,59 @@ function X(e, t, r) {
|
|
|
1301
1301
|
);
|
|
1302
1302
|
}
|
|
1303
1303
|
const vn = (e) => {
|
|
1304
|
-
const { value: t, onBlur: r, onChange: n, after: s, disabled: o } = e,
|
|
1305
|
-
return
|
|
1304
|
+
const { value: t, onBlur: r, onChange: n, after: s, disabled: o } = e, l = X(t, o, n);
|
|
1305
|
+
return j({
|
|
1306
1306
|
...e,
|
|
1307
|
-
input:
|
|
1307
|
+
input: ne.date(
|
|
1308
1308
|
Y(e),
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
r != null ? k.blur(P(r)) :
|
|
1312
|
-
n != null ? k.change(Ge(n)) :
|
|
1309
|
+
a.valueAsDate(t),
|
|
1310
|
+
a.class("bc-input"),
|
|
1311
|
+
r != null ? k.blur(P(r)) : S,
|
|
1312
|
+
n != null ? k.change(Ge(n)) : S
|
|
1313
1313
|
),
|
|
1314
|
-
after: s != null ? L(
|
|
1314
|
+
after: s != null ? L(l, s) : l
|
|
1315
1315
|
});
|
|
1316
1316
|
}, jt = (e) => {
|
|
1317
|
-
const t = e.getFullYear(), r = e.getMonth() + 1, n = e.getDate(), s = e.getHours(), o = e.getMinutes(),
|
|
1318
|
-
return `${t}-${r.toString().padStart(2, "0")}-${n.toString().padStart(2, "0")}T${s.toString().padStart(2, "0")}:${o.toString().padStart(2, "0")}:${
|
|
1317
|
+
const t = e.getFullYear(), r = e.getMonth() + 1, n = e.getDate(), s = e.getHours(), o = e.getMinutes(), l = e.getSeconds();
|
|
1318
|
+
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
1319
|
}, xn = (e) => {
|
|
1320
|
-
const { value: t, onBlur: r, onChange: n, after: s, disabled: o } = e,
|
|
1321
|
-
return
|
|
1320
|
+
const { value: t, onBlur: r, onChange: n, after: s, disabled: o } = e, l = u.map(t, (c) => c != null ? jt(c) : null), i = X(t, o, n);
|
|
1321
|
+
return j({
|
|
1322
1322
|
...e,
|
|
1323
|
-
input:
|
|
1323
|
+
input: ne["datetime-local"](
|
|
1324
1324
|
Y(e),
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
r != null ? k.blur(P(r)) :
|
|
1328
|
-
n != null ? k.change(Qe(n)) :
|
|
1325
|
+
a.value(u.map(l, (c) => c ?? null)),
|
|
1326
|
+
a.class("bc-input"),
|
|
1327
|
+
r != null ? k.blur(P(r)) : S,
|
|
1328
|
+
n != null ? k.change(Qe(n)) : S
|
|
1329
1329
|
),
|
|
1330
|
-
after: s != null ? L(
|
|
1330
|
+
after: s != null ? L(i, s) : i
|
|
1331
1331
|
});
|
|
1332
|
-
}, Z = (e) => typeof e == "string" && e.trim() === "" ? null : e,
|
|
1333
|
-
const { value: t, onBlur: r, onChange: n, onInput: s, after: o, disabled:
|
|
1334
|
-
return
|
|
1335
|
-
...
|
|
1336
|
-
value:
|
|
1332
|
+
}, Z = (e) => typeof e == "string" && e.trim() === "" ? null : e, se = (e) => e ?? "", wn = (e) => {
|
|
1333
|
+
const { value: t, onBlur: r, onChange: n, onInput: s, after: o, disabled: l, ...i } = e, c = X(t, l, n);
|
|
1334
|
+
return at({
|
|
1335
|
+
...i,
|
|
1336
|
+
value: u.map(t, se),
|
|
1337
1337
|
onChange: n != null ? (p) => n(Z(p)) : void 0,
|
|
1338
1338
|
onInput: s != null ? (p) => s(Z(p)) : void 0,
|
|
1339
1339
|
onBlur: r,
|
|
1340
1340
|
after: o != null ? L(c, o) : c
|
|
1341
1341
|
});
|
|
1342
1342
|
}, _n = (e) => {
|
|
1343
|
-
const { value: t, onBlur: r, onChange: n, onInput: s, after: o, disabled:
|
|
1343
|
+
const { value: t, onBlur: r, onChange: n, onInput: s, after: o, disabled: l, ...i } = e, c = X(t, l, n);
|
|
1344
1344
|
return ot({
|
|
1345
|
-
...
|
|
1346
|
-
value:
|
|
1345
|
+
...i,
|
|
1346
|
+
value: u.map(t, se),
|
|
1347
1347
|
onChange: n != null ? (p) => n(Z(p)) : void 0,
|
|
1348
1348
|
onInput: s != null ? (p) => s(Z(p)) : void 0,
|
|
1349
1349
|
onBlur: r,
|
|
1350
1350
|
after: o != null ? L(c, o) : c
|
|
1351
1351
|
});
|
|
1352
1352
|
}, $n = (e) => {
|
|
1353
|
-
const { value: t, onBlur: r, onChange: n, onInput: s, after: o, disabled:
|
|
1353
|
+
const { value: t, onBlur: r, onChange: n, onInput: s, after: o, disabled: l, ...i } = e, c = X(t, l, n);
|
|
1354
1354
|
return ct({
|
|
1355
|
-
...
|
|
1356
|
-
value:
|
|
1355
|
+
...i,
|
|
1356
|
+
value: u.map(t, se),
|
|
1357
1357
|
onChange: n != null ? (p) => n(Z(p)) : void 0,
|
|
1358
1358
|
onInput: s != null ? (p) => s(Z(p)) : void 0,
|
|
1359
1359
|
onBlur: r,
|
|
@@ -1361,118 +1361,118 @@ const vn = (e) => {
|
|
|
1361
1361
|
});
|
|
1362
1362
|
}, Ht = (e) => {
|
|
1363
1363
|
const { value: t, onBlur: r, onChange: n, onInput: s, rows: o } = e;
|
|
1364
|
-
return
|
|
1364
|
+
return j({
|
|
1365
1365
|
...e,
|
|
1366
1366
|
input: $.textarea(
|
|
1367
1367
|
Y(e),
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
r != null ? k.blur(P(r)) :
|
|
1372
|
-
n != null ? k.change(P(n)) :
|
|
1373
|
-
s != null ? k.input(P(s)) :
|
|
1368
|
+
a.rows(o ?? 3),
|
|
1369
|
+
a.value(t),
|
|
1370
|
+
a.class("bc-input"),
|
|
1371
|
+
r != null ? k.blur(P(r)) : S,
|
|
1372
|
+
n != null ? k.change(P(n)) : S,
|
|
1373
|
+
s != null ? k.input(P(s)) : S
|
|
1374
1374
|
)
|
|
1375
1375
|
});
|
|
1376
1376
|
}, yn = (e) => {
|
|
1377
|
-
const { value: t, onBlur: r, onChange: n, onInput: s, after: o, disabled:
|
|
1377
|
+
const { value: t, onBlur: r, onChange: n, onInput: s, after: o, disabled: l, ...i } = e, c = X(t, l, n);
|
|
1378
1378
|
return Ht({
|
|
1379
|
-
...
|
|
1380
|
-
value:
|
|
1379
|
+
...i,
|
|
1380
|
+
value: u.map(t, se),
|
|
1381
1381
|
onChange: n != null ? (p) => n(Z(p)) : void 0,
|
|
1382
1382
|
onInput: s != null ? (p) => s(Z(p)) : void 0,
|
|
1383
1383
|
onBlur: r,
|
|
1384
1384
|
after: o != null ? L(c, o) : c
|
|
1385
1385
|
});
|
|
1386
1386
|
}, In = (e) => {
|
|
1387
|
-
const { value: t, step: r, min: n, max: s, onBlur: o, onChange:
|
|
1388
|
-
const f = n != null ?
|
|
1387
|
+
const { value: t, step: r, min: n, max: s, onBlur: o, onChange: l, onInput: i, after: c } = e, p = (g) => {
|
|
1388
|
+
const f = n != null ? u.get(n) : void 0, m = s != null ? u.get(s) : void 0;
|
|
1389
1389
|
return f != null && g < f ? f : m != null && g > m ? m : g;
|
|
1390
|
-
}, h = r != null ?
|
|
1391
|
-
const f =
|
|
1390
|
+
}, h = r != null ? O(H, (g) => {
|
|
1391
|
+
const f = B(
|
|
1392
1392
|
t,
|
|
1393
1393
|
n
|
|
1394
|
-
)((b,
|
|
1394
|
+
)((b, v) => v == null ? !0 : (b ?? 0) > v), m = B(
|
|
1395
1395
|
t,
|
|
1396
1396
|
s
|
|
1397
|
-
)((b,
|
|
1398
|
-
const
|
|
1399
|
-
if (
|
|
1397
|
+
)((b, v) => v == null ? !0 : (b ?? 0) < v), x = (b) => {
|
|
1398
|
+
const v = u.get(t) ?? 0, T = u.get(r), I = b?.shiftKey ? 10 : 1, y = v - T * I, w = n != null ? u.get(n) : void 0;
|
|
1399
|
+
if (w != null && y < w)
|
|
1400
1400
|
return;
|
|
1401
|
-
const
|
|
1402
|
-
|
|
1401
|
+
const C = p(y);
|
|
1402
|
+
C !== v && l && l(C);
|
|
1403
1403
|
}, _ = (b) => {
|
|
1404
|
-
const
|
|
1405
|
-
if (
|
|
1404
|
+
const v = u.get(t) ?? 0, T = u.get(r), I = b?.shiftKey ? 10 : 1, y = v + T * I, w = s != null ? u.get(s) : void 0;
|
|
1405
|
+
if (w != null && y > w)
|
|
1406
1406
|
return;
|
|
1407
|
-
const
|
|
1408
|
-
|
|
1407
|
+
const C = p(y);
|
|
1408
|
+
C !== v && l && l(C);
|
|
1409
1409
|
};
|
|
1410
1410
|
return te(
|
|
1411
|
-
|
|
1411
|
+
a.class("bc-number-input-steppers"),
|
|
1412
1412
|
// Increment second
|
|
1413
1413
|
$.button(
|
|
1414
|
-
|
|
1414
|
+
a.class(
|
|
1415
1415
|
"bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"
|
|
1416
1416
|
),
|
|
1417
|
-
|
|
1418
|
-
|
|
1417
|
+
a.disabled(
|
|
1418
|
+
B(
|
|
1419
1419
|
m,
|
|
1420
1420
|
e.disabled ?? !1
|
|
1421
|
-
)((b,
|
|
1421
|
+
)((b, v) => !b || v)
|
|
1422
1422
|
),
|
|
1423
1423
|
k.click((b) => _(b)),
|
|
1424
|
-
|
|
1425
|
-
|
|
1424
|
+
N.label(g.$.incrementValue),
|
|
1425
|
+
R({ icon: "line-md:plus", size: "xs" })
|
|
1426
1426
|
),
|
|
1427
1427
|
// Decrement first (matches tests expecting first button to be decrement)
|
|
1428
1428
|
$.button(
|
|
1429
|
-
|
|
1429
|
+
a.class(
|
|
1430
1430
|
"bc-button bc-number-input-steppers-button bc-number-input-steppers-button--decrement"
|
|
1431
1431
|
),
|
|
1432
|
-
|
|
1433
|
-
|
|
1432
|
+
a.disabled(
|
|
1433
|
+
B(
|
|
1434
1434
|
f,
|
|
1435
1435
|
e.disabled ?? !1
|
|
1436
|
-
)((b,
|
|
1436
|
+
)((b, v) => !b || v)
|
|
1437
1437
|
),
|
|
1438
|
-
k.click((b) =>
|
|
1439
|
-
|
|
1440
|
-
|
|
1438
|
+
k.click((b) => x(b)),
|
|
1439
|
+
N.label(g.$.decrementValue),
|
|
1440
|
+
R({ icon: "line-md:minus", size: "xs" })
|
|
1441
1441
|
)
|
|
1442
1442
|
);
|
|
1443
1443
|
}) : null, d = c != null && h != null ? L(h, c) : c ?? h;
|
|
1444
|
-
return
|
|
1444
|
+
return j({
|
|
1445
1445
|
...e,
|
|
1446
|
-
input:
|
|
1446
|
+
input: ne.number(
|
|
1447
1447
|
n != null ? L(
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
g <
|
|
1448
|
+
a.min(n),
|
|
1449
|
+
W(
|
|
1450
|
+
u.on(n, (g) => {
|
|
1451
|
+
g < u.get(t);
|
|
1452
1452
|
})
|
|
1453
1453
|
)
|
|
1454
|
-
) :
|
|
1454
|
+
) : S,
|
|
1455
1455
|
s != null ? L(
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
g >
|
|
1456
|
+
a.max(s),
|
|
1457
|
+
W(
|
|
1458
|
+
u.on(s, (g) => {
|
|
1459
|
+
g > u.get(t);
|
|
1460
1460
|
})
|
|
1461
1461
|
)
|
|
1462
|
-
) :
|
|
1462
|
+
) : S,
|
|
1463
1463
|
Y(e),
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
o != null ? k.blur(P(o)) :
|
|
1468
|
-
|
|
1469
|
-
|
|
1464
|
+
a.valueAsNumber(t),
|
|
1465
|
+
a.step(r),
|
|
1466
|
+
a.class("bc-input bc-number-input"),
|
|
1467
|
+
o != null ? k.blur(P(o)) : S,
|
|
1468
|
+
l != null ? k.change(G(l)) : S,
|
|
1469
|
+
i != null ? k.input(G(i)) : S,
|
|
1470
1470
|
// Add wheel event support when step is defined
|
|
1471
1471
|
r != null ? k.wheel((g) => {
|
|
1472
1472
|
g.preventDefault();
|
|
1473
|
-
const f =
|
|
1474
|
-
b !== f &&
|
|
1475
|
-
}) :
|
|
1473
|
+
const f = u.get(t) ?? 0, m = u.get(r), x = g.shiftKey ? 10 : 1, _ = g.deltaY < 0 ? m * x : -m * x, b = p(f + _);
|
|
1474
|
+
b !== f && l && l(b);
|
|
1475
|
+
}) : S
|
|
1476
1476
|
),
|
|
1477
1477
|
after: d
|
|
1478
1478
|
});
|
|
@@ -1481,111 +1481,111 @@ const vn = (e) => {
|
|
|
1481
1481
|
const t = Number(e);
|
|
1482
1482
|
return Number.isNaN(t) ? null : t;
|
|
1483
1483
|
}, Cn = (e) => {
|
|
1484
|
-
const { value: t, step: r, min: n, max: s, onBlur: o, onChange:
|
|
1485
|
-
const m = n != null ?
|
|
1486
|
-
return m != null && f < m ? m :
|
|
1484
|
+
const { value: t, step: r, min: n, max: s, onBlur: o, onChange: l, onInput: i, after: c } = e, p = (f) => {
|
|
1485
|
+
const m = n != null ? u.get(n) : void 0, x = s != null ? u.get(s) : void 0;
|
|
1486
|
+
return m != null && f < m ? m : x != null && f > x ? x : f;
|
|
1487
1487
|
}, h = (() => {
|
|
1488
1488
|
if (r == null) return null;
|
|
1489
|
-
const f =
|
|
1489
|
+
const f = B(
|
|
1490
1490
|
t,
|
|
1491
1491
|
n
|
|
1492
|
-
)((
|
|
1493
|
-
const
|
|
1494
|
-
return
|
|
1495
|
-
}), m =
|
|
1492
|
+
)((v, T) => {
|
|
1493
|
+
const I = v ?? 0;
|
|
1494
|
+
return T == null ? !0 : I > T;
|
|
1495
|
+
}), m = B(
|
|
1496
1496
|
t,
|
|
1497
1497
|
s
|
|
1498
|
-
)((
|
|
1499
|
-
const
|
|
1500
|
-
return
|
|
1501
|
-
}),
|
|
1502
|
-
const
|
|
1503
|
-
if (
|
|
1504
|
-
const M = p(
|
|
1505
|
-
M !==
|
|
1506
|
-
}, _ = (
|
|
1507
|
-
const
|
|
1508
|
-
if (
|
|
1509
|
-
const M = p(
|
|
1510
|
-
M !==
|
|
1498
|
+
)((v, T) => {
|
|
1499
|
+
const I = v ?? 0;
|
|
1500
|
+
return T == null ? !0 : I < T;
|
|
1501
|
+
}), x = (v) => {
|
|
1502
|
+
const T = u.get(t) ?? 0, I = u.get(r), y = v?.shiftKey ? 10 : 1, w = T - I * y, C = n != null ? u.get(n) : void 0;
|
|
1503
|
+
if (C != null && w < C) return;
|
|
1504
|
+
const M = p(w);
|
|
1505
|
+
M !== T && l && l(M);
|
|
1506
|
+
}, _ = (v) => {
|
|
1507
|
+
const T = u.get(t) ?? 0, I = u.get(r), y = v?.shiftKey ? 10 : 1, w = T + I * y, C = s != null ? u.get(s) : void 0;
|
|
1508
|
+
if (C != null && w > C) return;
|
|
1509
|
+
const M = p(w);
|
|
1510
|
+
M !== T && l && l(M);
|
|
1511
1511
|
};
|
|
1512
|
-
return ((
|
|
1513
|
-
|
|
1512
|
+
return ((v, T) => te(
|
|
1513
|
+
a.class("bc-number-input-steppers"),
|
|
1514
1514
|
$.button(
|
|
1515
|
-
|
|
1515
|
+
a.class(
|
|
1516
1516
|
"bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"
|
|
1517
1517
|
),
|
|
1518
|
-
|
|
1519
|
-
|
|
1518
|
+
a.disabled(
|
|
1519
|
+
B(
|
|
1520
1520
|
m,
|
|
1521
1521
|
e.disabled ?? !1
|
|
1522
|
-
)((
|
|
1522
|
+
)((I, y) => !I || y)
|
|
1523
1523
|
),
|
|
1524
|
-
k.click((
|
|
1525
|
-
|
|
1526
|
-
|
|
1524
|
+
k.click((I) => _(I)),
|
|
1525
|
+
N.label(v),
|
|
1526
|
+
R({ icon: "line-md:plus", size: "xs" })
|
|
1527
1527
|
),
|
|
1528
1528
|
$.button(
|
|
1529
|
-
|
|
1529
|
+
a.class(
|
|
1530
1530
|
"bc-button bc-number-input-steppers-button bc-number-input-steppers-button--decrement"
|
|
1531
1531
|
),
|
|
1532
|
-
|
|
1533
|
-
|
|
1532
|
+
a.disabled(
|
|
1533
|
+
B(
|
|
1534
1534
|
f,
|
|
1535
1535
|
e.disabled ?? !1
|
|
1536
|
-
)((
|
|
1536
|
+
)((I, y) => !I || y)
|
|
1537
1537
|
),
|
|
1538
|
-
k.click((
|
|
1539
|
-
|
|
1540
|
-
|
|
1538
|
+
k.click((I) => x(I)),
|
|
1539
|
+
N.label(T),
|
|
1540
|
+
R({ icon: "line-md:minus", size: "xs" })
|
|
1541
1541
|
)
|
|
1542
1542
|
))(
|
|
1543
1543
|
ye.incrementValue,
|
|
1544
1544
|
ye.decrementValue
|
|
1545
1545
|
);
|
|
1546
|
-
})(), d = X(t, e.disabled,
|
|
1547
|
-
return
|
|
1546
|
+
})(), d = X(t, e.disabled, l), g = c != null && h != null ? L(h, d, c) : c != null ? L(d, c) : h != null ? L(h, d) : d;
|
|
1547
|
+
return j({
|
|
1548
1548
|
...e,
|
|
1549
|
-
input:
|
|
1549
|
+
input: ne.number(
|
|
1550
1550
|
// min/max attributes and reactive watchers (no forced correction)
|
|
1551
1551
|
n != null ? L(
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1552
|
+
a.min(n),
|
|
1553
|
+
W(
|
|
1554
|
+
u.on(n, (f) => {
|
|
1555
1555
|
})
|
|
1556
1556
|
)
|
|
1557
|
-
) :
|
|
1557
|
+
) : S,
|
|
1558
1558
|
s != null ? L(
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1559
|
+
a.max(s),
|
|
1560
|
+
W(
|
|
1561
|
+
u.on(s, (f) => {
|
|
1562
1562
|
})
|
|
1563
1563
|
)
|
|
1564
|
-
) :
|
|
1564
|
+
) : S,
|
|
1565
1565
|
Y(e),
|
|
1566
1566
|
// Represent null as empty string so the field can be cleared
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
o != null ? k.blur(P(o)) :
|
|
1571
|
-
|
|
1567
|
+
a.value(u.map(t, (f) => f == null ? "" : String(f))),
|
|
1568
|
+
a.step(r),
|
|
1569
|
+
a.class("bc-input bc-number-input"),
|
|
1570
|
+
o != null ? k.blur(P(o)) : S,
|
|
1571
|
+
l != null ? k.change(
|
|
1572
1572
|
P((f) => {
|
|
1573
1573
|
const m = Ue(f);
|
|
1574
|
-
|
|
1574
|
+
l(m);
|
|
1575
1575
|
})
|
|
1576
|
-
) :
|
|
1577
|
-
|
|
1576
|
+
) : S,
|
|
1577
|
+
i != null ? k.input(
|
|
1578
1578
|
P((f) => {
|
|
1579
1579
|
const m = Ue(f);
|
|
1580
|
-
|
|
1580
|
+
i(m);
|
|
1581
1581
|
})
|
|
1582
|
-
) :
|
|
1582
|
+
) : S,
|
|
1583
1583
|
// Wheel support when step is defined
|
|
1584
1584
|
r != null ? k.wheel((f) => {
|
|
1585
1585
|
f.preventDefault();
|
|
1586
|
-
const m =
|
|
1587
|
-
|
|
1588
|
-
}) :
|
|
1586
|
+
const m = u.get(t) ?? 0, x = u.get(r), _ = f.shiftKey ? 10 : 1, b = f.deltaY < 0 ? x * _ : -x * _, v = p(m + b);
|
|
1587
|
+
v !== m && l && l(v);
|
|
1588
|
+
}) : S
|
|
1589
1589
|
),
|
|
1590
1590
|
after: g
|
|
1591
1591
|
});
|
|
@@ -1596,52 +1596,52 @@ const vn = (e) => {
|
|
|
1596
1596
|
onLabel: n,
|
|
1597
1597
|
label: s,
|
|
1598
1598
|
disabled: o = !1,
|
|
1599
|
-
size:
|
|
1600
|
-
id:
|
|
1599
|
+
size: l = "md",
|
|
1600
|
+
id: i
|
|
1601
1601
|
}) => {
|
|
1602
|
-
const c =
|
|
1602
|
+
const c = i ?? it("switch"), p = `${c}-label`;
|
|
1603
1603
|
function h(f, m) {
|
|
1604
|
-
const
|
|
1605
|
-
return f &&
|
|
1604
|
+
const x = ["bc-switch", `bu-text-${m}`, `bc-switch--${m}`];
|
|
1605
|
+
return f && x.push("bc-switch--disabled"), x.join(" ");
|
|
1606
1606
|
}
|
|
1607
1607
|
const d = () => {
|
|
1608
|
-
|
|
1608
|
+
u.get(o) || t(!u.get(e));
|
|
1609
1609
|
}, g = (f) => {
|
|
1610
|
-
|
|
1610
|
+
u.get(o) || (f.key === " " || f.key === "Enter") && (f.preventDefault(), d());
|
|
1611
1611
|
};
|
|
1612
1612
|
return $.div(
|
|
1613
|
-
|
|
1614
|
-
|
|
1613
|
+
a.class(
|
|
1614
|
+
B(
|
|
1615
1615
|
o ?? !1,
|
|
1616
|
-
|
|
1616
|
+
l
|
|
1617
1617
|
)(
|
|
1618
1618
|
(f, m) => h(f ?? !1, m ?? "md")
|
|
1619
1619
|
)
|
|
1620
1620
|
),
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1621
|
+
a.id(c),
|
|
1622
|
+
a.role("switch"),
|
|
1623
|
+
a.tabindex(
|
|
1624
|
+
u.map(o, (f) => f ? -1 : 0)
|
|
1625
1625
|
),
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1626
|
+
N.checked(e),
|
|
1627
|
+
N.disabled(o),
|
|
1628
|
+
N.labelledby(s != null ? p : void 0),
|
|
1629
1629
|
k.click(d),
|
|
1630
1630
|
k.keydown(g),
|
|
1631
|
-
s != null ? ut(
|
|
1631
|
+
s != null ? ut(a.id(p), a.class(`bu-text-${l} bu-nowrap`), s) : null,
|
|
1632
1632
|
$.div(
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1633
|
+
a.class("bc-switch__track"),
|
|
1634
|
+
a.class(
|
|
1635
|
+
u.map(
|
|
1636
1636
|
e,
|
|
1637
1637
|
(f) => f ? "bc-switch__track--on" : "bc-switch__track--off"
|
|
1638
1638
|
)
|
|
1639
1639
|
),
|
|
1640
1640
|
r != null ? $.div(
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1641
|
+
N.hidden(!0),
|
|
1642
|
+
a.class("bc-switch__track-label bc-switch__track-label--off"),
|
|
1643
|
+
a.class(
|
|
1644
|
+
u.map(
|
|
1645
1645
|
e,
|
|
1646
1646
|
(f) => f ? "bc-switch__track-label--hidden" : "bc-switch__track-label--visible"
|
|
1647
1647
|
)
|
|
@@ -1649,34 +1649,34 @@ const vn = (e) => {
|
|
|
1649
1649
|
r
|
|
1650
1650
|
) : null,
|
|
1651
1651
|
n != null ? $.div(
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1652
|
+
a.class("bc-switch__track-label bc-switch__track-label--on"),
|
|
1653
|
+
a.class(
|
|
1654
|
+
u.map(
|
|
1655
1655
|
e,
|
|
1656
1656
|
(f) => f ? "bc-switch__track-label--visible" : "bc-switch__track-label--hidden"
|
|
1657
1657
|
)
|
|
1658
1658
|
),
|
|
1659
1659
|
n
|
|
1660
1660
|
) : null,
|
|
1661
|
-
|
|
1662
|
-
(f) =>
|
|
1661
|
+
ze(
|
|
1662
|
+
(f) => O(
|
|
1663
1663
|
ft,
|
|
1664
1664
|
({ direction: m }) => $.div(
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1665
|
+
a.class("bc-switch__thumb"),
|
|
1666
|
+
a.class(
|
|
1667
|
+
u.map(
|
|
1668
1668
|
e,
|
|
1669
|
-
(
|
|
1669
|
+
(x) => x ? "bc-switch__thumb--on" : "bc-switch__thumb--off"
|
|
1670
1670
|
)
|
|
1671
1671
|
),
|
|
1672
1672
|
pe.transform(
|
|
1673
|
-
|
|
1673
|
+
B(
|
|
1674
1674
|
e,
|
|
1675
1675
|
f,
|
|
1676
|
-
|
|
1676
|
+
l,
|
|
1677
1677
|
m
|
|
1678
|
-
)((
|
|
1679
|
-
const
|
|
1678
|
+
)((x, { width: _ }, b, v) => {
|
|
1679
|
+
const T = (() => {
|
|
1680
1680
|
switch (b) {
|
|
1681
1681
|
case "xs":
|
|
1682
1682
|
return 5;
|
|
@@ -1689,8 +1689,8 @@ const vn = (e) => {
|
|
|
1689
1689
|
case "xl":
|
|
1690
1690
|
return 8;
|
|
1691
1691
|
}
|
|
1692
|
-
})(),
|
|
1693
|
-
return
|
|
1692
|
+
})(), I = v === "rtl" ? `calc((var(--spacing-base) * ${T}) - ${_}px)` : `calc(${_}px - (var(--spacing-base) * ${T}))`;
|
|
1693
|
+
return x ? `translateX(${I})` : "translateX(0)";
|
|
1694
1694
|
})
|
|
1695
1695
|
)
|
|
1696
1696
|
)
|
|
@@ -1748,10 +1748,10 @@ const vn = (e) => {
|
|
|
1748
1748
|
placeholder: e.placeholder ?? "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
1749
1749
|
});
|
|
1750
1750
|
}, Mn = (e) => {
|
|
1751
|
-
const { value: t, onBlur: r, onChange: n, onInput: s, after: o, disabled:
|
|
1751
|
+
const { value: t, onBlur: r, onChange: n, onInput: s, after: o, disabled: l, ...i } = e, c = X(t, l, n);
|
|
1752
1752
|
return Wt({
|
|
1753
|
-
...
|
|
1754
|
-
value:
|
|
1753
|
+
...i,
|
|
1754
|
+
value: u.map(t, se),
|
|
1755
1755
|
onChange: n != null ? (p) => n(Z(p)) : void 0,
|
|
1756
1756
|
onInput: s != null ? (p) => s(Z(p)) : void 0,
|
|
1757
1757
|
onBlur: r,
|
|
@@ -1764,70 +1764,70 @@ const vn = (e) => {
|
|
|
1764
1764
|
disabled: n,
|
|
1765
1765
|
max: s = 5,
|
|
1766
1766
|
fullColor: o = "yellow",
|
|
1767
|
-
emptyColor:
|
|
1768
|
-
fullIcon:
|
|
1767
|
+
emptyColor: l = "neutral",
|
|
1768
|
+
fullIcon: i = Zt,
|
|
1769
1769
|
emptyIcon: c = Yt,
|
|
1770
1770
|
size: p = "md",
|
|
1771
1771
|
onBlur: h,
|
|
1772
1772
|
rounding: d = 1
|
|
1773
1773
|
} = e, g = () => {
|
|
1774
|
-
const
|
|
1775
|
-
return
|
|
1776
|
-
}, f = (
|
|
1777
|
-
if (
|
|
1778
|
-
const y =
|
|
1774
|
+
const v = u.get(d);
|
|
1775
|
+
return v > 0 ? v : 1;
|
|
1776
|
+
}, f = (v) => Math.min(Math.max(v, 0), u.get(s)), m = (v, T) => {
|
|
1777
|
+
if (u.get(n ?? !1)) return;
|
|
1778
|
+
const y = v.currentTarget.getBoundingClientRect(), w = (v.clientX - y.left) / y.width, C = T - 1 + w, M = g(), A = Math.ceil(C / M) * M, F = f(A);
|
|
1779
1779
|
r?.(F);
|
|
1780
|
-
},
|
|
1781
|
-
if (
|
|
1782
|
-
const
|
|
1780
|
+
}, x = (v) => {
|
|
1781
|
+
if (u.get(n ?? !1)) return;
|
|
1782
|
+
const T = g(), I = u.get(t) ?? 0;
|
|
1783
1783
|
let y;
|
|
1784
|
-
switch (
|
|
1784
|
+
switch (v.key) {
|
|
1785
1785
|
case "ArrowRight":
|
|
1786
1786
|
case "ArrowUp":
|
|
1787
|
-
y = f(
|
|
1787
|
+
y = f(I + T);
|
|
1788
1788
|
break;
|
|
1789
1789
|
case "ArrowLeft":
|
|
1790
1790
|
case "ArrowDown":
|
|
1791
|
-
y = f(
|
|
1791
|
+
y = f(I - T);
|
|
1792
1792
|
break;
|
|
1793
1793
|
case "Home":
|
|
1794
1794
|
y = 0;
|
|
1795
1795
|
break;
|
|
1796
1796
|
case "End":
|
|
1797
|
-
y =
|
|
1797
|
+
y = u.get(s);
|
|
1798
1798
|
break;
|
|
1799
1799
|
default:
|
|
1800
1800
|
return;
|
|
1801
1801
|
}
|
|
1802
|
-
|
|
1803
|
-
}, _ =
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1802
|
+
v.preventDefault(), r?.(y);
|
|
1803
|
+
}, _ = u.map(p, (v) => `bc-icon--${v}`), b = ({ index: v, counter: T }) => $.span(
|
|
1804
|
+
a.class("bc-rating-input__icon-container"),
|
|
1805
|
+
a.class(_),
|
|
1806
|
+
R(
|
|
1807
1807
|
{ icon: c, size: p },
|
|
1808
|
-
|
|
1809
|
-
|
|
1808
|
+
a.class("bc-rating-input__icon-empty"),
|
|
1809
|
+
a.class(u.map(l, (I) => `bu-fg-soft-${I}`))
|
|
1810
1810
|
),
|
|
1811
1811
|
$.span(
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1812
|
+
a.class("bc-rating-input__icon-clipper"),
|
|
1813
|
+
a.class(_),
|
|
1814
|
+
a.class(u.map(o, (I) => `bu-fg-soft-${I}`)),
|
|
1815
1815
|
pe.width(
|
|
1816
|
-
|
|
1817
|
-
const y = Math.floor(
|
|
1818
|
-
return y >
|
|
1816
|
+
u.map(t, (I) => {
|
|
1817
|
+
const y = Math.floor(I);
|
|
1818
|
+
return y > v ? "100%" : y < v ? "0%" : `${(I - v) * 100}%`;
|
|
1819
1819
|
})
|
|
1820
1820
|
),
|
|
1821
|
-
|
|
1821
|
+
R({ icon: i, size: p }, a.class("bc-rating-input__icon-full"))
|
|
1822
1822
|
),
|
|
1823
1823
|
k.click(
|
|
1824
|
-
Je((
|
|
1824
|
+
Je((I) => m(I, T), {
|
|
1825
1825
|
preventDefault: !0,
|
|
1826
1826
|
stopPropagation: !0
|
|
1827
1827
|
})
|
|
1828
1828
|
)
|
|
1829
1829
|
);
|
|
1830
|
-
return
|
|
1830
|
+
return j({
|
|
1831
1831
|
baseContainer: !0,
|
|
1832
1832
|
growInput: !1,
|
|
1833
1833
|
focusableSelector: '[role="slider"]',
|
|
@@ -1835,94 +1835,92 @@ const vn = (e) => {
|
|
|
1835
1835
|
input: $.div(
|
|
1836
1836
|
// Common input attributes (id, required, invalid, custom classes, etc.)
|
|
1837
1837
|
Y(e),
|
|
1838
|
-
|
|
1838
|
+
a.class("bc-rating-input"),
|
|
1839
1839
|
// ARIA slider semantics
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1840
|
+
a.role("slider"),
|
|
1841
|
+
a.tabindex(u.map(n ?? !1, (v) => v ? -1 : 0)),
|
|
1842
|
+
N.disabled(n ?? !1),
|
|
1843
|
+
N.valuemin(0),
|
|
1844
|
+
N.valuemax(u.map(s, (v) => v ?? 0)),
|
|
1845
|
+
N.valuenow(u.map(t, (v) => v ?? 0)),
|
|
1846
|
+
N.valuetext(
|
|
1847
|
+
B(
|
|
1848
|
+
t,
|
|
1849
|
+
s
|
|
1850
|
+
)((v, T) => {
|
|
1851
|
+
const I = v ?? 0, y = T ?? 0;
|
|
1852
|
+
return `${String(I)} / ${String(y)}`;
|
|
1853
|
+
})
|
|
1854
|
+
),
|
|
1843
1855
|
// Keyboard & focus handlers
|
|
1844
|
-
k.keydown(
|
|
1856
|
+
k.keydown(x),
|
|
1845
1857
|
h != null ? k.blur(h) : null,
|
|
1846
|
-
|
|
1847
|
-
ne((x) => {
|
|
1848
|
-
const S = (v, I) => x.setAttribute(v, I);
|
|
1849
|
-
S("aria-valuemin", "0"), S("aria-valuemax", String(i.get(s))), S("aria-valuenow", String(i.get(t) ?? 0)), S(
|
|
1850
|
-
"aria-valuetext",
|
|
1851
|
-
`${String(i.get(t) ?? 0)} / ${String(i.get(s))}`
|
|
1852
|
-
);
|
|
1853
|
-
const C = i.on(s, (v) => S("aria-valuemax", String(v))), y = i.on(t, (v) => {
|
|
1854
|
-
S("aria-valuenow", String(v ?? 0)), S("aria-valuetext", `${String(v ?? 0)} / ${String(i.get(s))}`);
|
|
1855
|
-
});
|
|
1856
|
-
return j(() => {
|
|
1857
|
-
C(), y();
|
|
1858
|
-
});
|
|
1859
|
-
}),
|
|
1860
|
-
ze(s, b)
|
|
1858
|
+
Re(s, b)
|
|
1861
1859
|
)
|
|
1862
1860
|
});
|
|
1863
|
-
},
|
|
1864
|
-
const { value: t, onChange: r, onBlur: n, after: s, disabled: o, ...
|
|
1861
|
+
}, Tn = (e) => {
|
|
1862
|
+
const { value: t, onChange: r, onBlur: n, after: s, disabled: o, ...l } = e, i = X(t, o, r);
|
|
1865
1863
|
return Xt({
|
|
1866
|
-
...
|
|
1864
|
+
...l,
|
|
1867
1865
|
// Map null -> 0 for display so the control shows as empty when null
|
|
1868
|
-
value:
|
|
1866
|
+
value: u.map(t, (c) => c ?? 0),
|
|
1869
1867
|
// Pass through numeric changes; clear button will call onChange(null)
|
|
1870
1868
|
onChange: r,
|
|
1871
1869
|
onBlur: n,
|
|
1872
|
-
after: s != null ? L(
|
|
1870
|
+
after: s != null ? L(i, s) : i
|
|
1873
1871
|
});
|
|
1874
|
-
},
|
|
1875
|
-
const { value: t, step: r, min: n, max: s, onBlur: o, onChange:
|
|
1876
|
-
return
|
|
1872
|
+
}, Dn = (e) => {
|
|
1873
|
+
const { value: t, step: r, min: n, max: s, onBlur: o, onChange: l, onInput: i } = e;
|
|
1874
|
+
return j({
|
|
1877
1875
|
...e,
|
|
1878
1876
|
// Make sure clicks anywhere focus the range input
|
|
1879
1877
|
focusableSelector: 'input[type="range"]',
|
|
1880
1878
|
input: $.input(
|
|
1881
|
-
|
|
1879
|
+
a.type("range"),
|
|
1882
1880
|
Y(e),
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1881
|
+
a.min(n),
|
|
1882
|
+
a.max(s),
|
|
1883
|
+
a.step(r),
|
|
1886
1884
|
// Using value as number to keep it in sync
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
o != null ? k.blur(G(o)) :
|
|
1890
|
-
|
|
1891
|
-
|
|
1885
|
+
a.valueAsNumber(t),
|
|
1886
|
+
a.class("bc-input bc-slider-input"),
|
|
1887
|
+
o != null ? k.blur(G(o)) : S,
|
|
1888
|
+
l != null ? k.change(G(l)) : S,
|
|
1889
|
+
i != null ? k.input(G(i)) : S
|
|
1892
1890
|
)
|
|
1893
1891
|
});
|
|
1894
|
-
},
|
|
1895
|
-
const { value: t, step: r, min: n, max: s, onBlur: o, onChange:
|
|
1892
|
+
}, Sn = (e) => {
|
|
1893
|
+
const { value: t, step: r, min: n, max: s, onBlur: o, onChange: l, onInput: i } = e, c = u.map(t, (h) => {
|
|
1896
1894
|
if (h != null) return h;
|
|
1897
|
-
const d = n != null ?
|
|
1895
|
+
const d = n != null ? u.get(n) : void 0;
|
|
1898
1896
|
return typeof d == "number" ? d : 0;
|
|
1899
1897
|
}), p = X(t, e.disabled, (h) => {
|
|
1900
|
-
|
|
1898
|
+
l?.(h);
|
|
1901
1899
|
});
|
|
1902
|
-
return
|
|
1900
|
+
return j(
|
|
1903
1901
|
{
|
|
1904
1902
|
...e,
|
|
1905
1903
|
focusableSelector: 'input[type="range"]',
|
|
1906
1904
|
after: p,
|
|
1907
1905
|
input: $.input(
|
|
1908
|
-
|
|
1906
|
+
a.type("range"),
|
|
1909
1907
|
Y(e),
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
o != null ? k.blur(G(o)) :
|
|
1916
|
-
|
|
1908
|
+
a.min(n),
|
|
1909
|
+
a.max(s),
|
|
1910
|
+
a.step(r),
|
|
1911
|
+
a.valueAsNumber(c),
|
|
1912
|
+
a.class("bc-input bc-slider-input"),
|
|
1913
|
+
o != null ? k.blur(G(o)) : S,
|
|
1914
|
+
l != null ? k.change(
|
|
1917
1915
|
G((h) => {
|
|
1918
|
-
|
|
1916
|
+
l(h);
|
|
1919
1917
|
})
|
|
1920
|
-
) :
|
|
1921
|
-
|
|
1918
|
+
) : S,
|
|
1919
|
+
i != null ? k.input(
|
|
1922
1920
|
G((h) => {
|
|
1923
|
-
|
|
1921
|
+
i(h);
|
|
1924
1922
|
})
|
|
1925
|
-
) :
|
|
1923
|
+
) : S
|
|
1926
1924
|
)
|
|
1927
1925
|
},
|
|
1928
1926
|
// Ensure container grows input naturally
|
|
@@ -1964,34 +1962,34 @@ function Kt(e) {
|
|
|
1964
1962
|
const An = (e) => {
|
|
1965
1963
|
const { value: t, onChange: r, after: n, disabled: s } = e, o = X(t, s, r);
|
|
1966
1964
|
return Gt(
|
|
1967
|
-
(
|
|
1965
|
+
(l) => We({
|
|
1968
1966
|
...e,
|
|
1969
|
-
value:
|
|
1970
|
-
onChange: r ? (
|
|
1967
|
+
value: u.map(t, (i) => i?.toString() ?? ""),
|
|
1968
|
+
onChange: r ? (i) => r(i === "" ? null : l.Duration.from(i)) : void 0,
|
|
1971
1969
|
onInput: void 0,
|
|
1972
|
-
...Kt(
|
|
1970
|
+
...Kt(l.Duration.from),
|
|
1973
1971
|
placeholder: "P0DT0H0M0S",
|
|
1974
1972
|
after: n != null ? L(o, n) : o
|
|
1975
1973
|
})
|
|
1976
1974
|
);
|
|
1977
1975
|
}, en = (e) => {
|
|
1978
1976
|
const { value: t, onBlur: r, onChange: n, onInput: s } = e;
|
|
1979
|
-
return
|
|
1977
|
+
return j({
|
|
1980
1978
|
...e,
|
|
1981
|
-
input:
|
|
1979
|
+
input: ne.url(
|
|
1982
1980
|
Y(e),
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
r != null ? k.blur(P(r)) :
|
|
1986
|
-
n != null ? k.change(P(n)) :
|
|
1987
|
-
s != null ? k.input(P(s)) :
|
|
1981
|
+
a.value(t),
|
|
1982
|
+
a.class("bc-input"),
|
|
1983
|
+
r != null ? k.blur(P(r)) : S,
|
|
1984
|
+
n != null ? k.change(P(n)) : S,
|
|
1985
|
+
s != null ? k.input(P(s)) : S
|
|
1988
1986
|
)
|
|
1989
1987
|
});
|
|
1990
1988
|
}, Fn = (e) => {
|
|
1991
|
-
const { value: t, onBlur: r, onChange: n, onInput: s, after: o, disabled:
|
|
1989
|
+
const { value: t, onBlur: r, onChange: n, onInput: s, after: o, disabled: l, ...i } = e, c = X(t, l, n);
|
|
1992
1990
|
return en({
|
|
1993
|
-
...
|
|
1994
|
-
value:
|
|
1991
|
+
...i,
|
|
1992
|
+
value: u.map(t, se),
|
|
1995
1993
|
onChange: n != null ? (p) => n(Z(p)) : void 0,
|
|
1996
1994
|
onInput: s != null ? (p) => s(Z(p)) : void 0,
|
|
1997
1995
|
onBlur: r,
|
|
@@ -2003,17 +2001,17 @@ const An = (e) => {
|
|
|
2003
2001
|
separator: n,
|
|
2004
2002
|
showMove: s = !0,
|
|
2005
2003
|
showRemove: o = !0,
|
|
2006
|
-
showAdd:
|
|
2007
|
-
createItem:
|
|
2004
|
+
showAdd: l = !0,
|
|
2005
|
+
createItem: i,
|
|
2008
2006
|
addLabel: c,
|
|
2009
2007
|
controlsLayout: p = "aside",
|
|
2010
2008
|
...h
|
|
2011
|
-
} = e, d =
|
|
2012
|
-
const
|
|
2009
|
+
} = e, d = u.toSignal(p).map((m) => m === "aside"), g = (m) => {
|
|
2010
|
+
const x = E(
|
|
2013
2011
|
s ?? !1,
|
|
2014
2012
|
() => $.div(
|
|
2015
|
-
|
|
2016
|
-
|
|
2013
|
+
a.class("bu-items-center"),
|
|
2014
|
+
a.class(
|
|
2017
2015
|
d.map(
|
|
2018
2016
|
(b) => b ? "bu-flex-col" : "bu-flex-row bu-gap-1"
|
|
2019
2017
|
)
|
|
@@ -2026,9 +2024,9 @@ const An = (e) => {
|
|
|
2026
2024
|
onClick: () => m.move("up"),
|
|
2027
2025
|
disabled: m.cannotMove("up")
|
|
2028
2026
|
},
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
(b) =>
|
|
2027
|
+
O(
|
|
2028
|
+
H,
|
|
2029
|
+
(b) => R({
|
|
2032
2030
|
size: "xs",
|
|
2033
2031
|
icon: "line-md:arrow-up",
|
|
2034
2032
|
title: b.$.incrementValue
|
|
@@ -2043,9 +2041,9 @@ const An = (e) => {
|
|
|
2043
2041
|
onClick: () => m.move("down"),
|
|
2044
2042
|
disabled: m.cannotMove("down")
|
|
2045
2043
|
},
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
(b) =>
|
|
2044
|
+
O(
|
|
2045
|
+
H,
|
|
2046
|
+
(b) => R({
|
|
2049
2047
|
size: "xs",
|
|
2050
2048
|
icon: "line-md:arrow-down",
|
|
2051
2049
|
title: b.$.decrementValue
|
|
@@ -2055,12 +2053,12 @@ const An = (e) => {
|
|
|
2055
2053
|
)
|
|
2056
2054
|
), _ = E(
|
|
2057
2055
|
o,
|
|
2058
|
-
() =>
|
|
2059
|
-
|
|
2056
|
+
() => O(
|
|
2057
|
+
H,
|
|
2060
2058
|
(b) => me({
|
|
2061
2059
|
size: "xs",
|
|
2062
2060
|
// Use a lowercase label to satisfy tests that query with [aria-label*="remove"]
|
|
2063
|
-
label:
|
|
2061
|
+
label: u.map(b.$.removeItem, (v) => v.toLowerCase()),
|
|
2064
2062
|
color: "error",
|
|
2065
2063
|
disabled: e.removeDisabled,
|
|
2066
2064
|
onClick: m.remove
|
|
@@ -2070,25 +2068,25 @@ const An = (e) => {
|
|
|
2070
2068
|
return (b) => E(
|
|
2071
2069
|
d,
|
|
2072
2070
|
() => fe(
|
|
2073
|
-
|
|
2074
|
-
te(
|
|
2071
|
+
a.class("bu-gap-1 bu-items-center"),
|
|
2072
|
+
te(a.class("bu-flex-grow"), b),
|
|
2075
2073
|
te(
|
|
2076
|
-
|
|
2074
|
+
a.class("bu-items-center"),
|
|
2077
2075
|
E(
|
|
2078
|
-
e.controller.value.map((
|
|
2079
|
-
() =>
|
|
2076
|
+
e.controller.value.map((v) => v.length > 1),
|
|
2077
|
+
() => x
|
|
2080
2078
|
),
|
|
2081
2079
|
_
|
|
2082
2080
|
)
|
|
2083
2081
|
),
|
|
2084
2082
|
() => te(
|
|
2085
|
-
|
|
2083
|
+
a.class("bu-gap-2"),
|
|
2086
2084
|
b,
|
|
2087
2085
|
fe(
|
|
2088
|
-
|
|
2086
|
+
a.class("bu-gap-2 bu-justify-between"),
|
|
2089
2087
|
E(
|
|
2090
|
-
e.controller.value.map((
|
|
2091
|
-
() =>
|
|
2088
|
+
e.controller.value.map((v) => v.length > 1),
|
|
2089
|
+
() => x,
|
|
2092
2090
|
() => $.div()
|
|
2093
2091
|
),
|
|
2094
2092
|
_
|
|
@@ -2096,24 +2094,24 @@ const An = (e) => {
|
|
|
2096
2094
|
)
|
|
2097
2095
|
);
|
|
2098
2096
|
}, f = E(
|
|
2099
|
-
|
|
2097
|
+
B(l, i)((m, x) => m && x != null),
|
|
2100
2098
|
() => fe(
|
|
2101
|
-
|
|
2099
|
+
a.class("bu-gap-2 bu-items-center bu-justify-center"),
|
|
2102
2100
|
ge(
|
|
2103
2101
|
{
|
|
2104
2102
|
size: "sm",
|
|
2105
2103
|
variant: "filled",
|
|
2106
|
-
onClick: () => h.controller.push(
|
|
2107
|
-
disabled:
|
|
2104
|
+
onClick: () => h.controller.push(i()),
|
|
2105
|
+
disabled: B(
|
|
2108
2106
|
h.controller.disabled,
|
|
2109
2107
|
e.addDisabled ?? !1
|
|
2110
|
-
)((m,
|
|
2108
|
+
)((m, x) => m || x)
|
|
2111
2109
|
},
|
|
2112
|
-
|
|
2113
|
-
|
|
2110
|
+
O(
|
|
2111
|
+
H,
|
|
2114
2112
|
(m) => fe(
|
|
2115
|
-
|
|
2116
|
-
|
|
2113
|
+
a.class("bu-gap-2"),
|
|
2114
|
+
R({ icon: "line-md:plus" }),
|
|
2117
2115
|
c ?? m.$.addLabel
|
|
2118
2116
|
)
|
|
2119
2117
|
)
|
|
@@ -2124,8 +2122,8 @@ const An = (e) => {
|
|
|
2124
2122
|
{
|
|
2125
2123
|
...h,
|
|
2126
2124
|
content: te(
|
|
2127
|
-
|
|
2128
|
-
|
|
2125
|
+
a.class("bu-gap-2"),
|
|
2126
|
+
Rt(
|
|
2129
2127
|
h.controller,
|
|
2130
2128
|
(m) => g(m)(r(m)),
|
|
2131
2129
|
n
|
|
@@ -2141,19 +2139,19 @@ class Vn extends ve {
|
|
|
2141
2139
|
activeBranch;
|
|
2142
2140
|
#t;
|
|
2143
2141
|
#e = /* @__PURE__ */ new Map();
|
|
2144
|
-
constructor(t, r, n, s, o,
|
|
2145
|
-
super(t, r, n, s, o,
|
|
2142
|
+
constructor(t, r, n, s, o, l, i = ae) {
|
|
2143
|
+
super(t, r, n, s, o, i), this.branches = l;
|
|
2146
2144
|
const c = (h) => {
|
|
2147
|
-
for (const d of
|
|
2145
|
+
for (const d of l)
|
|
2148
2146
|
if (d.detect(h))
|
|
2149
2147
|
return d.key;
|
|
2150
|
-
return
|
|
2148
|
+
return l[0]?.key ?? "unknown";
|
|
2151
2149
|
};
|
|
2152
|
-
this.activeBranch = n.map(c,
|
|
2150
|
+
this.activeBranch = n.map(c, ae);
|
|
2153
2151
|
const p = (h) => {
|
|
2154
2152
|
if (this.#e.has(h))
|
|
2155
2153
|
return this.#e.get(h);
|
|
2156
|
-
const d =
|
|
2154
|
+
const d = l.find((f) => f.key === h);
|
|
2157
2155
|
if (!d)
|
|
2158
2156
|
throw new Error(`Unknown branch: ${h}`);
|
|
2159
2157
|
const g = new ve(
|
|
@@ -2163,20 +2161,20 @@ class Vn extends ve {
|
|
|
2163
2161
|
},
|
|
2164
2162
|
n.map(
|
|
2165
2163
|
(f) => d.detect(f) ? f : d.defaultValue(),
|
|
2166
|
-
|
|
2164
|
+
i
|
|
2167
2165
|
),
|
|
2168
2166
|
s.map(Fe([h])),
|
|
2169
2167
|
{
|
|
2170
2168
|
disabled: this.disabled,
|
|
2171
2169
|
validationMode: this.parent.validationMode
|
|
2172
2170
|
},
|
|
2173
|
-
|
|
2171
|
+
i
|
|
2174
2172
|
);
|
|
2175
2173
|
return this.#e.set(h, g), g;
|
|
2176
2174
|
};
|
|
2177
2175
|
this.#t = this.activeBranch.map(
|
|
2178
2176
|
(h) => p(h),
|
|
2179
|
-
|
|
2177
|
+
ae
|
|
2180
2178
|
), this.onDispose(() => {
|
|
2181
2179
|
for (const h of this.#e.values())
|
|
2182
2180
|
h.dispose();
|
|
@@ -2187,7 +2185,7 @@ class Vn extends ve {
|
|
|
2187
2185
|
* Get the controller for the currently active branch
|
|
2188
2186
|
*/
|
|
2189
2187
|
get activeController() {
|
|
2190
|
-
return
|
|
2188
|
+
return u.get(this.#t);
|
|
2191
2189
|
}
|
|
2192
2190
|
/**
|
|
2193
2191
|
* Get a controller for a specific branch
|
|
@@ -2205,14 +2203,14 @@ class Vn extends ve {
|
|
|
2205
2203
|
},
|
|
2206
2204
|
this.value.map(
|
|
2207
2205
|
(s) => r.detect(s) ? s : r.defaultValue(),
|
|
2208
|
-
|
|
2206
|
+
ae
|
|
2209
2207
|
),
|
|
2210
2208
|
this.status.map(Fe([t])),
|
|
2211
2209
|
{
|
|
2212
2210
|
disabled: this.disabled,
|
|
2213
2211
|
validationMode: this.parent.validationMode
|
|
2214
2212
|
},
|
|
2215
|
-
|
|
2213
|
+
ae
|
|
2216
2214
|
);
|
|
2217
2215
|
return this.#e.set(t, n), n;
|
|
2218
2216
|
}
|
|
@@ -2220,16 +2218,16 @@ class Vn extends ve {
|
|
|
2220
2218
|
* Switch to a different branch
|
|
2221
2219
|
*/
|
|
2222
2220
|
switchToBranch(t, r = !1) {
|
|
2223
|
-
const n = this.branches.find((
|
|
2221
|
+
const n = this.branches.find((l) => l.key === t);
|
|
2224
2222
|
if (!n)
|
|
2225
2223
|
throw new Error(`Unknown branch: ${t}`);
|
|
2226
|
-
const s =
|
|
2224
|
+
const s = u.get(this.value);
|
|
2227
2225
|
if (n.detect(s))
|
|
2228
2226
|
return !0;
|
|
2229
2227
|
if (n.convert) {
|
|
2230
|
-
const
|
|
2231
|
-
if (
|
|
2232
|
-
return this.change(
|
|
2228
|
+
const l = n.convert(s);
|
|
2229
|
+
if (l.ok)
|
|
2230
|
+
return this.change(l.value), !0;
|
|
2233
2231
|
}
|
|
2234
2232
|
if (r && typeof window == "object" && typeof window.confirm == "function" && !window.confirm(
|
|
2235
2233
|
"Changing type will clear the current value. Continue?"
|
|
@@ -2242,7 +2240,7 @@ class Vn extends ve {
|
|
|
2242
2240
|
* Get the current active branch definition
|
|
2243
2241
|
*/
|
|
2244
2242
|
get activeBranchDefinition() {
|
|
2245
|
-
const t =
|
|
2243
|
+
const t = u.get(this.activeBranch);
|
|
2246
2244
|
return this.branches.find((r) => r.key === t);
|
|
2247
2245
|
}
|
|
2248
2246
|
}
|
|
@@ -2305,54 +2303,54 @@ function Nn({
|
|
|
2305
2303
|
title: n,
|
|
2306
2304
|
icon: s,
|
|
2307
2305
|
closable: o = !1,
|
|
2308
|
-
onDismiss:
|
|
2309
|
-
class:
|
|
2306
|
+
onDismiss: l,
|
|
2307
|
+
class: i
|
|
2310
2308
|
}, ...c) {
|
|
2311
|
-
const p =
|
|
2309
|
+
const p = u.map(
|
|
2312
2310
|
o,
|
|
2313
|
-
(
|
|
2314
|
-
), h =
|
|
2311
|
+
(x) => !!x || l != null
|
|
2312
|
+
), h = u.map(e, (x) => x ?? "info"), d = u.map(t, (x) => x ?? "subtle"), g = B(
|
|
2315
2313
|
r,
|
|
2316
2314
|
h
|
|
2317
|
-
)((
|
|
2318
|
-
|
|
2319
|
-
(
|
|
2320
|
-
|
|
2321
|
-
|
|
2315
|
+
)((x, _) => x ?? (_ === "error" ? "alert" : "status")), f = K(!0), m = O(
|
|
2316
|
+
H,
|
|
2317
|
+
(x) => $.div(
|
|
2318
|
+
a.class(
|
|
2319
|
+
B(
|
|
2322
2320
|
h,
|
|
2323
2321
|
d,
|
|
2324
2322
|
p,
|
|
2325
|
-
|
|
2326
|
-
)((_, b,
|
|
2323
|
+
i
|
|
2324
|
+
)((_, b, v, T) => sn(_, b, v, T))
|
|
2327
2325
|
),
|
|
2328
2326
|
// Accessibility role mapping (always defined)
|
|
2329
|
-
|
|
2327
|
+
a.role(u.map(g, (_) => _)),
|
|
2330
2328
|
et(
|
|
2331
|
-
|
|
2329
|
+
u.map(s, (_) => _ === !1),
|
|
2332
2330
|
() => $.div(
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
icon:
|
|
2331
|
+
a.class("bc-notice__icon"),
|
|
2332
|
+
R({
|
|
2333
|
+
icon: B(
|
|
2336
2334
|
s,
|
|
2337
2335
|
h
|
|
2338
2336
|
)((_, b) => _ === void 0 ? tn(b) : String(_)),
|
|
2339
2337
|
size: "md",
|
|
2340
|
-
color:
|
|
2338
|
+
color: u.map(h, nn)
|
|
2341
2339
|
})
|
|
2342
2340
|
)
|
|
2343
2341
|
),
|
|
2344
2342
|
$.div(
|
|
2345
|
-
|
|
2346
|
-
Ne(n, (_) => $.div(
|
|
2347
|
-
$.div(
|
|
2343
|
+
a.class("bc-notice__body"),
|
|
2344
|
+
Ne(n, (_) => $.div(a.class("bc-notice__title"), _)),
|
|
2345
|
+
$.div(a.class("bc-notice__content"), ...c)
|
|
2348
2346
|
),
|
|
2349
2347
|
E(
|
|
2350
2348
|
p,
|
|
2351
2349
|
() => me({
|
|
2352
2350
|
size: "xs",
|
|
2353
|
-
label:
|
|
2351
|
+
label: x.$.closeModal,
|
|
2354
2352
|
onClick: () => {
|
|
2355
|
-
f.set(!1),
|
|
2353
|
+
f.set(!1), l?.();
|
|
2356
2354
|
}
|
|
2357
2355
|
})
|
|
2358
2356
|
)
|
|
@@ -2361,13 +2359,13 @@ function Nn({
|
|
|
2361
2359
|
return E(f, () => m);
|
|
2362
2360
|
}
|
|
2363
2361
|
export {
|
|
2364
|
-
|
|
2362
|
+
Tn as A,
|
|
2365
2363
|
pn as B,
|
|
2366
2364
|
dn as C,
|
|
2367
|
-
|
|
2365
|
+
Dn as D,
|
|
2368
2366
|
Vt as E,
|
|
2369
2367
|
wt as F,
|
|
2370
|
-
|
|
2368
|
+
Sn as G,
|
|
2371
2369
|
An as H,
|
|
2372
2370
|
en as I,
|
|
2373
2371
|
Fn as J,
|
|
@@ -2396,10 +2394,10 @@ export {
|
|
|
2396
2394
|
_t as h,
|
|
2397
2395
|
Ct as i,
|
|
2398
2396
|
bn as j,
|
|
2399
|
-
|
|
2397
|
+
Rt as k,
|
|
2400
2398
|
Nt as l,
|
|
2401
2399
|
gn as m,
|
|
2402
|
-
|
|
2400
|
+
se as n,
|
|
2403
2401
|
vn as o,
|
|
2404
2402
|
xn as p,
|
|
2405
2403
|
_n as q,
|