@tempots/beatui 1.3.0 → 1.5.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/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/{auth-divider-D_3gKZ6g.js → auth-divider-BIATan1F.js} +3 -3
- package/dist/{auth-divider-itm5-j5G.cjs → auth-divider-CVKfA8Cp.cjs} +1 -1
- package/dist/beatui.css +416 -55
- package/dist/beatui.tailwind.css +416 -55
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +2 -2
- package/dist/deep-merge-B33Qtlmw.cjs +1 -0
- package/dist/{deep-merge-CzZVsVF-.js → deep-merge-BUsrE2v4.js} +130 -130
- package/dist/{duration-input-BrYLC1js.cjs → duration-input-C5il_E0F.cjs} +1 -1
- package/dist/{duration-input-CFu6vq-y.js → duration-input-DoCCrqOG.js} +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +6560 -6032
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +107 -107
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +3 -3
- package/dist/{modal-YKqlh4Dk.js → modal-BHlp4QeT.js} +1 -1
- package/dist/{modal-DCxNGrzk.cjs → modal-BmpfNL48.cjs} +1 -1
- package/dist/{notice-Q0A1gIho.cjs → notice-BBnSXYUc.cjs} +1 -1
- package/dist/{notice-Du3tWJTW.js → notice-BXKtBEiC.js} +1 -1
- package/dist/types/components/data/auto-color-badge.d.ts +60 -0
- package/dist/types/components/data/data-table-context.d.ts +9 -1
- package/dist/types/components/data/data-table-row-details.d.ts +21 -0
- package/dist/types/components/data/data-table-types.d.ts +23 -0
- package/dist/types/components/data/index.d.ts +2 -0
- package/dist/types/components/form/control/control.d.ts +5 -5
- package/dist/types/components/form/control/list-control.d.ts +11 -11
- package/dist/types/components/form/fieldset/fieldset.d.ts +60 -0
- package/dist/types/components/form/fieldset/index.d.ts +1 -0
- package/dist/types/components/form/index.d.ts +1 -0
- package/dist/types/components/form/input/combobox-input.d.ts +2 -2
- package/dist/types/components/form/input/combobox-tags-input.d.ts +1 -1
- package/dist/types/components/form/input/date-time-input.d.ts +1 -1
- package/dist/types/components/form/input/dropdown-input.d.ts +2 -2
- package/dist/types/components/form/input/field-layout.d.ts +64 -0
- package/dist/types/components/form/input/{input-wrapper.d.ts → field.d.ts} +23 -14
- package/dist/types/components/form/input/index.d.ts +2 -1
- package/dist/types/components/form/input/multi-select.d.ts +2 -2
- package/dist/types/components/form/input/native-select.d.ts +1 -1
- package/dist/types/components/form/input/range-slider.d.ts +19 -2
- package/dist/types/components/form/input/select-tags-input.d.ts +1 -1
- package/dist/types/components/format/format-bigint.d.ts +64 -0
- package/dist/types/components/format/format-date-time.d.ts +54 -0
- package/dist/types/components/format/format-date.d.ts +82 -0
- package/dist/types/components/format/format-display-name.d.ts +70 -0
- package/dist/types/components/format/format-file-size.d.ts +30 -0
- package/dist/types/components/format/format-list.d.ts +61 -0
- package/dist/types/components/format/format-number.d.ts +88 -0
- package/dist/types/components/format/format-plural.d.ts +96 -0
- package/dist/types/components/format/format-relative-time.d.ts +62 -0
- package/dist/types/components/format/format-time.d.ts +66 -0
- package/dist/types/components/format/index.d.ts +11 -0
- package/dist/types/components/i18n/locale-selector.d.ts +1 -1
- package/dist/types/components/json-schema/controls/composition-shared.d.ts +1 -1
- package/dist/types/components/json-schema/controls/shared-utils.d.ts +3 -3
- package/dist/types/components/json-schema/widgets/string-controls.d.ts +2 -2
- package/dist/types/components/json-schema-display/display-wrapper.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/use-form-CP6nftVl.cjs +2 -0
- package/dist/{use-form-D_TJyZhP.js → use-form-CmQdxpOi.js} +474 -434
- package/dist/{widget-customization-DELy3SMQ.cjs → widget-customization-B0y-eesp.cjs} +1 -1
- package/dist/{widget-customization-BAchyOUo.js → widget-customization-CKbR4Dsg.js} +2 -2
- package/package.json +1 -1
- package/dist/deep-merge-Bydz6jLt.cjs +0 -1
- package/dist/use-form-BvBkVEKi.cjs +0 -2
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Task as ye, Use as
|
|
1
|
+
import { Task as ye, Use as F, Value as p, prop as ae, html as g, attr as r, on as C, WithElement as te, Empty as M, aria as J, bind as ie, OnDispose as ne, coalesce as Ne, ForEach as ee, Fragment as N, Ensure as Pe, OneOfType as je, computedOf as A, input as se, emitValue as P, emitValueAsNumber as we, style as _e, When as U, NotEmpty as We, Repeat as Ze, signal as ke } from "@tempots/dom";
|
|
2
2
|
import { I as W, a as He, B as be } from "./input-container-CO3DNqpp.js";
|
|
3
3
|
import { C as q, m as qe } from "./text-input-BAn02BzO.js";
|
|
4
|
-
import {
|
|
5
|
-
import { B as
|
|
4
|
+
import { F as Ae, m as Ye, c as Ge, C as oe, d as fe, e as Ce } from "./use-form-CmQdxpOi.js";
|
|
5
|
+
import { B as O, d as ce, I as E, b as De, f as Ie } from "./translations-DT5QQ4WO.js";
|
|
6
6
|
import { S as Le } from "./stack-BLMteGTn.js";
|
|
7
7
|
import { objectEntries as Je, delayedAnimationFrame as Xe, strictEqual as K } from "@tempots/std";
|
|
8
8
|
import { ElementRect as Qe } from "@tempots/ui";
|
|
9
|
-
let
|
|
9
|
+
let pe = null;
|
|
10
10
|
async function he() {
|
|
11
11
|
const t = globalThis;
|
|
12
|
-
return t.Temporal ? t.Temporal : (
|
|
12
|
+
return t.Temporal ? t.Temporal : (pe || (pe = import("./index.esm-By0m3ki1.js").then((e) => {
|
|
13
13
|
const n = e.Temporal;
|
|
14
14
|
return t.Temporal || (t.Temporal = n), n;
|
|
15
|
-
})),
|
|
15
|
+
})), pe);
|
|
16
16
|
}
|
|
17
17
|
const Ke = (t, e) => e ? ye(he, {
|
|
18
18
|
then: t,
|
|
@@ -28,8 +28,8 @@ function de({
|
|
|
28
28
|
disabled: h = !1,
|
|
29
29
|
allowMultiple: o
|
|
30
30
|
}) {
|
|
31
|
-
return O
|
|
32
|
-
const b =
|
|
31
|
+
return F(O, (d) => {
|
|
32
|
+
const b = p.deriveProp(e ?? []), w = ae(!1), f = (a) => {
|
|
33
33
|
a.preventDefault(), a.stopPropagation(), w.value = !0;
|
|
34
34
|
}, m = (a) => {
|
|
35
35
|
a.preventDefault(), a.stopPropagation(), (!a.currentTarget || !a.currentTarget.contains(a.relatedTarget)) && (w.value = !1);
|
|
@@ -38,7 +38,7 @@ function de({
|
|
|
38
38
|
const x = Array.from(a.dataTransfer?.files || []);
|
|
39
39
|
x.length > 0 && (b.value = x, t(x, "dragdrop"));
|
|
40
40
|
}, i = (a) => {
|
|
41
|
-
|
|
41
|
+
p.get(s) && a.currentTarget.querySelector(
|
|
42
42
|
'input[type="file"]'
|
|
43
43
|
)?.click();
|
|
44
44
|
};
|
|
@@ -48,15 +48,15 @@ function de({
|
|
|
48
48
|
const a = Array.from(u.files ?? []);
|
|
49
49
|
a.length > 0 && (b.value = a, t(a, "click")), u.value = "";
|
|
50
50
|
}, S = (a) => {
|
|
51
|
-
|
|
51
|
+
p.get(s) && (a.key === "Enter" || a.key === " ") && (a.preventDefault(), i(a));
|
|
52
52
|
};
|
|
53
53
|
return g.div(
|
|
54
54
|
r.role("button"),
|
|
55
55
|
r.tabindex(
|
|
56
|
-
|
|
56
|
+
p.map(s, (a) => a ? 0 : -1)
|
|
57
57
|
),
|
|
58
58
|
r.style("position: relative;"),
|
|
59
|
-
C.dragover(
|
|
59
|
+
C.dragover(f),
|
|
60
60
|
C.dragleave(m),
|
|
61
61
|
C.drop(v),
|
|
62
62
|
C.click(i),
|
|
@@ -92,7 +92,7 @@ function de({
|
|
|
92
92
|
}
|
|
93
93
|
const ge = "$$tts-exp-", et = (t, e) => te((n) => {
|
|
94
94
|
const s = `${ge}${t}`;
|
|
95
|
-
return ne(
|
|
95
|
+
return ne(p.on(e, (l) => Reflect.set(n, s, l)));
|
|
96
96
|
}), $t = (t, e) => {
|
|
97
97
|
const n = `${ge}${t}`;
|
|
98
98
|
return (s) => {
|
|
@@ -139,7 +139,7 @@ const ge = "$$tts-exp-", et = (t, e) => te((n) => {
|
|
|
139
139
|
onInput: l,
|
|
140
140
|
options: h,
|
|
141
141
|
unselectedLabel: o,
|
|
142
|
-
equality: d = (
|
|
142
|
+
equality: d = (f, m) => f === m,
|
|
143
143
|
after: b
|
|
144
144
|
} = t;
|
|
145
145
|
let w;
|
|
@@ -155,27 +155,27 @@ const ge = "$$tts-exp-", et = (t, e) => te((n) => {
|
|
|
155
155
|
b
|
|
156
156
|
),
|
|
157
157
|
input: g.select(
|
|
158
|
-
te((
|
|
159
|
-
w =
|
|
158
|
+
te((f) => {
|
|
159
|
+
w = f;
|
|
160
160
|
const m = new MutationObserver((v) => {
|
|
161
161
|
const { removedNodes: i } = v[0];
|
|
162
162
|
i.length > 0 && (w.selectedIndex = 0);
|
|
163
163
|
});
|
|
164
|
-
return m.observe(
|
|
164
|
+
return m.observe(f, { childList: !0 }), ne(() => m.disconnect());
|
|
165
165
|
}),
|
|
166
166
|
q(t),
|
|
167
167
|
r.class("bc-native-select bc-input"),
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
(
|
|
168
|
+
F(
|
|
169
|
+
O,
|
|
170
|
+
(f) => g.option(
|
|
171
171
|
r.hidden("hidden"),
|
|
172
|
-
Ne(o,
|
|
172
|
+
Ne(o, f.$.selectOne)
|
|
173
173
|
)
|
|
174
174
|
),
|
|
175
|
-
ee(h, (
|
|
175
|
+
ee(h, (f) => Ue(f, d, e)),
|
|
176
176
|
n != null ? C.blur(n) : M,
|
|
177
|
-
s != null ? C.change($e("value", (
|
|
178
|
-
l != null ? C.input($e("value", (
|
|
177
|
+
s != null ? C.change($e("value", (f) => s(f))) : M,
|
|
178
|
+
l != null ? C.input($e("value", (f) => l(f))) : M
|
|
179
179
|
)
|
|
180
180
|
},
|
|
181
181
|
C.click(() => {
|
|
@@ -203,7 +203,7 @@ function Mt(t) {
|
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
205
|
function Ee(t, e, n) {
|
|
206
|
-
const s =
|
|
206
|
+
const s = p.map(t, (o) => o != null), l = A(
|
|
207
207
|
s,
|
|
208
208
|
e ?? !1
|
|
209
209
|
)((o, d) => !o || d), h = ce.clearValue;
|
|
@@ -234,9 +234,9 @@ function G(t, e) {
|
|
|
234
234
|
}
|
|
235
235
|
const St = (t) => {
|
|
236
236
|
const { value: e, step: n, min: s, max: l, onBlur: h, onChange: o, onInput: d, after: b } = t, w = (v) => {
|
|
237
|
-
const i = s != null ?
|
|
237
|
+
const i = s != null ? p.get(s) : void 0, u = l != null ? p.get(l) : void 0;
|
|
238
238
|
return i != null && v < i ? i : u != null && v > u ? u : v;
|
|
239
|
-
},
|
|
239
|
+
}, f = n != null ? F(O, (v) => {
|
|
240
240
|
const i = A(
|
|
241
241
|
e,
|
|
242
242
|
s
|
|
@@ -244,19 +244,19 @@ const St = (t) => {
|
|
|
244
244
|
e,
|
|
245
245
|
l
|
|
246
246
|
)((a, x) => x == null ? !0 : (a ?? 0) < x), D = (a) => {
|
|
247
|
-
const x =
|
|
247
|
+
const x = p.get(e) ?? 0, $ = p.get(n), I = a?.shiftKey ? 10 : 1, V = G(
|
|
248
248
|
x - $ * I,
|
|
249
249
|
$
|
|
250
|
-
), k = s != null ?
|
|
250
|
+
), k = s != null ? p.get(s) : void 0;
|
|
251
251
|
if (k != null && V < k)
|
|
252
252
|
return;
|
|
253
253
|
const c = w(V);
|
|
254
254
|
c !== x && (o?.(c), d?.(c));
|
|
255
255
|
}, S = (a) => {
|
|
256
|
-
const x =
|
|
256
|
+
const x = p.get(e) ?? 0, $ = p.get(n), I = a?.shiftKey ? 10 : 1, V = G(
|
|
257
257
|
x + $ * I,
|
|
258
258
|
$
|
|
259
|
-
), k = l != null ?
|
|
259
|
+
), k = l != null ? p.get(l) : void 0;
|
|
260
260
|
if (k != null && V > k)
|
|
261
261
|
return;
|
|
262
262
|
const c = w(V);
|
|
@@ -297,7 +297,7 @@ const St = (t) => {
|
|
|
297
297
|
E({ icon: "line-md:minus", size: "xs" })
|
|
298
298
|
)
|
|
299
299
|
);
|
|
300
|
-
}) : null, m = b != null &&
|
|
300
|
+
}) : null, m = b != null && f != null ? N(f, b) : b ?? f;
|
|
301
301
|
return W({
|
|
302
302
|
...t,
|
|
303
303
|
input: se.number(
|
|
@@ -313,7 +313,7 @@ const St = (t) => {
|
|
|
313
313
|
// Add wheel event support when step is defined
|
|
314
314
|
n != null ? C.wheel((v) => {
|
|
315
315
|
v.preventDefault();
|
|
316
|
-
const i =
|
|
316
|
+
const i = p.get(e) ?? 0, u = p.get(n), D = v.shiftKey ? 10 : 1, S = v.deltaY < 0 ? u * D : -u * D, a = w(G(i + S, u));
|
|
317
317
|
a !== i && (o?.(a), d?.(a));
|
|
318
318
|
}) : M
|
|
319
319
|
),
|
|
@@ -341,14 +341,14 @@ function Tt({
|
|
|
341
341
|
variant: h = "pill",
|
|
342
342
|
color: o
|
|
343
343
|
}, ...d) {
|
|
344
|
-
const b = Je(t).map(([w,
|
|
344
|
+
const b = Je(t).map(([w, f]) => ({
|
|
345
345
|
key: w,
|
|
346
|
-
label:
|
|
346
|
+
label: f
|
|
347
347
|
}));
|
|
348
348
|
return te(() => {
|
|
349
349
|
const w = Object.fromEntries(
|
|
350
350
|
b.map((m, v) => [m.key, v])
|
|
351
|
-
),
|
|
351
|
+
), f = ae(
|
|
352
352
|
b.map(() => ({ left: 0, width: 0 })),
|
|
353
353
|
lt
|
|
354
354
|
);
|
|
@@ -367,7 +367,7 @@ function Tt({
|
|
|
367
367
|
)
|
|
368
368
|
),
|
|
369
369
|
r.style(
|
|
370
|
-
o != null ?
|
|
370
|
+
o != null ? p.map(o, (m) => it(m)) : ""
|
|
371
371
|
),
|
|
372
372
|
g.div(
|
|
373
373
|
r.class("bc-segmented-input__container"),
|
|
@@ -376,7 +376,7 @@ function Tt({
|
|
|
376
376
|
_e.width(
|
|
377
377
|
A(
|
|
378
378
|
e,
|
|
379
|
-
|
|
379
|
+
f
|
|
380
380
|
)((m, v) => {
|
|
381
381
|
const { width: i } = v[w[m] ?? 0];
|
|
382
382
|
return `${i}px`;
|
|
@@ -385,7 +385,7 @@ function Tt({
|
|
|
385
385
|
_e.left(
|
|
386
386
|
A(
|
|
387
387
|
e,
|
|
388
|
-
|
|
388
|
+
f
|
|
389
389
|
)((m, v) => {
|
|
390
390
|
const { left: i } = v[w[m] ?? 0];
|
|
391
391
|
return `${i}px`;
|
|
@@ -396,16 +396,16 @@ function Tt({
|
|
|
396
396
|
b.map(({ label: m, key: v }, i) => g.button(
|
|
397
397
|
r.type("button"),
|
|
398
398
|
C.click((u) => {
|
|
399
|
-
u.preventDefault(),
|
|
399
|
+
u.preventDefault(), p.get(l) || n?.(v);
|
|
400
400
|
}),
|
|
401
401
|
r.disabled(l),
|
|
402
402
|
r.class("bc-segmented-input__segment"),
|
|
403
403
|
r.class(
|
|
404
|
-
|
|
404
|
+
p.map(e, (u) => u === v ? "bc-segmented-input__segment--active" : "bc-segmented-input__segment--inactive")
|
|
405
405
|
),
|
|
406
406
|
Qe((u) => {
|
|
407
407
|
function D() {
|
|
408
|
-
|
|
408
|
+
f.update((a) => {
|
|
409
409
|
const x = [...a];
|
|
410
410
|
return x[i] = {
|
|
411
411
|
width: u.value.width,
|
|
@@ -465,17 +465,17 @@ const zt = (t, ...e) => {
|
|
|
465
465
|
onBlur: d,
|
|
466
466
|
disabled: b,
|
|
467
467
|
hasError: w,
|
|
468
|
-
mode:
|
|
468
|
+
mode: f = "default",
|
|
469
469
|
showFileList: m = !0,
|
|
470
470
|
...v
|
|
471
|
-
} = t, i = n, u =
|
|
471
|
+
} = t, i = n, u = p.map(f, (k) => k === "input"), D = p.map(f, (k) => k === "compact"), S = (k) => {
|
|
472
472
|
let c = k;
|
|
473
473
|
if (l != null) {
|
|
474
|
-
const y =
|
|
474
|
+
const y = p.get(l);
|
|
475
475
|
c = c.slice(0, y);
|
|
476
476
|
}
|
|
477
477
|
if (h) {
|
|
478
|
-
const y =
|
|
478
|
+
const y = p.get(h);
|
|
479
479
|
c = c.filter((T) => T.size <= y);
|
|
480
480
|
}
|
|
481
481
|
o?.(c);
|
|
@@ -488,8 +488,8 @@ const zt = (t, ...e) => {
|
|
|
488
488
|
files: k,
|
|
489
489
|
clear: c,
|
|
490
490
|
change: y
|
|
491
|
-
}) =>
|
|
492
|
-
|
|
491
|
+
}) => F(
|
|
492
|
+
O,
|
|
493
493
|
(T) => g.div(
|
|
494
494
|
r.class("bc-file-input__drop-zone"),
|
|
495
495
|
g.div(
|
|
@@ -509,8 +509,8 @@ const zt = (t, ...e) => {
|
|
|
509
509
|
)
|
|
510
510
|
), I = ({
|
|
511
511
|
files: k
|
|
512
|
-
}) =>
|
|
513
|
-
|
|
512
|
+
}) => F(
|
|
513
|
+
O,
|
|
514
514
|
(c) => g.div(
|
|
515
515
|
r.class("bc-file-input__compact-drop-zone"),
|
|
516
516
|
U(
|
|
@@ -573,8 +573,8 @@ const zt = (t, ...e) => {
|
|
|
573
573
|
)
|
|
574
574
|
), V = ({
|
|
575
575
|
files: k
|
|
576
|
-
}) =>
|
|
577
|
-
|
|
576
|
+
}) => F(
|
|
577
|
+
O,
|
|
578
578
|
(c) => g.div(
|
|
579
579
|
r.class("bc-file-input__compact-input"),
|
|
580
580
|
U(
|
|
@@ -606,11 +606,11 @@ const zt = (t, ...e) => {
|
|
|
606
606
|
)
|
|
607
607
|
)
|
|
608
608
|
);
|
|
609
|
-
return
|
|
610
|
-
|
|
609
|
+
return F(
|
|
610
|
+
O,
|
|
611
611
|
(k) => W(
|
|
612
612
|
{
|
|
613
|
-
baseContainer:
|
|
613
|
+
baseContainer: p.map(u, (c) => !c),
|
|
614
614
|
disabled: b,
|
|
615
615
|
hasError: w,
|
|
616
616
|
after: U(
|
|
@@ -637,7 +637,7 @@ const zt = (t, ...e) => {
|
|
|
637
637
|
value: i,
|
|
638
638
|
accept: s,
|
|
639
639
|
enableClick: !0,
|
|
640
|
-
allowMultiple:
|
|
640
|
+
allowMultiple: p.map(l ?? 1 / 0, (c) => c > 1),
|
|
641
641
|
disabled: b,
|
|
642
642
|
onChange: S,
|
|
643
643
|
content: V
|
|
@@ -651,7 +651,7 @@ const zt = (t, ...e) => {
|
|
|
651
651
|
value: i,
|
|
652
652
|
accept: s,
|
|
653
653
|
enableClick: !0,
|
|
654
|
-
allowMultiple:
|
|
654
|
+
allowMultiple: p.map(l ?? 1 / 0, (c) => c > 1),
|
|
655
655
|
disabled: b,
|
|
656
656
|
onChange: S,
|
|
657
657
|
content: I
|
|
@@ -663,7 +663,7 @@ const zt = (t, ...e) => {
|
|
|
663
663
|
value: i,
|
|
664
664
|
accept: s,
|
|
665
665
|
enableClick: !0,
|
|
666
|
-
allowMultiple:
|
|
666
|
+
allowMultiple: p.map(l ?? 1 / 0, (c) => c > 1),
|
|
667
667
|
disabled: b,
|
|
668
668
|
onChange: S,
|
|
669
669
|
content: $
|
|
@@ -810,7 +810,7 @@ const Se = {
|
|
|
810
810
|
A: { pattern: /^[A-Za-z]$/, transform: (t) => t.toUpperCase() },
|
|
811
811
|
"*": { pattern: /^.$/ }
|
|
812
812
|
}, ut = (t) => t instanceof RegExp;
|
|
813
|
-
function
|
|
813
|
+
function Fe(t, e, n) {
|
|
814
814
|
if (t == null) return [];
|
|
815
815
|
const s = n ? { ...Se, ...e } : e ?? Se, l = (o, d) => {
|
|
816
816
|
const b = s[d];
|
|
@@ -827,7 +827,7 @@ function Oe(t, e, n) {
|
|
|
827
827
|
else ut(o) ? h.push({ type: "pattern", pattern: o }) : typeof o == "object" && o && h.push(o);
|
|
828
828
|
return h;
|
|
829
829
|
}
|
|
830
|
-
function
|
|
830
|
+
function ft(t, e) {
|
|
831
831
|
return (n) => {
|
|
832
832
|
switch (t) {
|
|
833
833
|
case "digits":
|
|
@@ -849,15 +849,15 @@ function Te(t, e, n, s, l, h) {
|
|
|
849
849
|
previousConformed: e,
|
|
850
850
|
cursor: l ?? t.length,
|
|
851
851
|
completed: !1
|
|
852
|
-
}, d = s.definitions ?? {}, b = typeof n == "function" ? n(t, o) : n, w =
|
|
852
|
+
}, d = s.definitions ?? {}, b = typeof n == "function" ? n(t, o) : n, w = Fe(
|
|
853
853
|
b,
|
|
854
854
|
d,
|
|
855
855
|
s.useDefaultDefinitions ?? !0
|
|
856
|
-
),
|
|
856
|
+
), f = ft(s.allowMode, s.allow), m = /* @__PURE__ */ new Set();
|
|
857
857
|
for (const _ of w) _.type === "literal" && m.add(_.char);
|
|
858
858
|
if (s.prefix) for (const _ of s.prefix) m.add(_);
|
|
859
859
|
if (s.suffix) for (const _ of s.suffix) m.add(_);
|
|
860
|
-
const v = Array.from(t).filter((_) =>
|
|
860
|
+
const v = Array.from(t).filter((_) => f(_) && !m.has(_));
|
|
861
861
|
if (v.length === 0) return { value: "", cursor: 0, completed: !1 };
|
|
862
862
|
const i = [], u = [];
|
|
863
863
|
let D = 0, S = 0, a = 0, x = -1;
|
|
@@ -896,11 +896,11 @@ function Te(t, e, n, s, l, h) {
|
|
|
896
896
|
let T, z = k;
|
|
897
897
|
return y === !1 ? (T = e, z = e.length) : typeof y == "string" ? (T = y, z = y.length) : typeof y == "object" && y ? (T = y.value, z = y.cursor ?? y.value.length) : T = I, { value: T, cursor: z, completed: c };
|
|
898
898
|
}
|
|
899
|
-
function
|
|
899
|
+
function pt(t, e) {
|
|
900
900
|
const n = e?.strategy ?? "none";
|
|
901
901
|
return n === "custom" && e?.unmask ? e.unmask(t) : n === "strip" ? t.replace(/[^A-Za-z0-9]/g, "") : t;
|
|
902
902
|
}
|
|
903
|
-
const
|
|
903
|
+
const Oe = (t) => {
|
|
904
904
|
const {
|
|
905
905
|
value: e,
|
|
906
906
|
onBlur: n,
|
|
@@ -911,7 +911,7 @@ const Fe = (t) => {
|
|
|
911
911
|
mask: d,
|
|
912
912
|
definitions: b,
|
|
913
913
|
useDefaultDefinitions: w,
|
|
914
|
-
extraLiterals:
|
|
914
|
+
extraLiterals: f,
|
|
915
915
|
prefix: m,
|
|
916
916
|
suffix: v,
|
|
917
917
|
autofix: i,
|
|
@@ -927,7 +927,7 @@ const Fe = (t) => {
|
|
|
927
927
|
d,
|
|
928
928
|
b,
|
|
929
929
|
w,
|
|
930
|
-
|
|
930
|
+
f,
|
|
931
931
|
m,
|
|
932
932
|
v,
|
|
933
933
|
i,
|
|
@@ -949,7 +949,7 @@ const Fe = (t) => {
|
|
|
949
949
|
prefix: B,
|
|
950
950
|
suffix: R
|
|
951
951
|
}).value : c ?? ""), k = (c, y) => {
|
|
952
|
-
const T = c.value ?? "", z =
|
|
952
|
+
const T = c.value ?? "", z = p.get(e) ?? "", _ = d != null ? p.get(d) : null, B = b != null ? p.get(b) : void 0, R = w != null ? p.get(w) : void 0, X = f != null ? p.get(f) : void 0, Q = i != null ? p.get(i) : void 0, Y = D != null ? p.get(D) : void 0, Z = S != null ? p.get(S) : void 0, le = a != null ? p.get(a) : void 0, j = m != null ? p.get(m) : void 0, L = v != null ? p.get(v) : void 0, {
|
|
953
953
|
value: H,
|
|
954
954
|
cursor: ue,
|
|
955
955
|
completed: ve
|
|
@@ -971,7 +971,7 @@ const Fe = (t) => {
|
|
|
971
971
|
suffix: L
|
|
972
972
|
},
|
|
973
973
|
c.selectionStart ?? T.length,
|
|
974
|
-
t.cursor ?
|
|
974
|
+
t.cursor ? p.get(t.cursor) : void 0
|
|
975
975
|
) : { value: T, cursor: T.length, completed: !0 };
|
|
976
976
|
if (H !== T) {
|
|
977
977
|
c.value = H;
|
|
@@ -980,7 +980,7 @@ const Fe = (t) => {
|
|
|
980
980
|
} catch {
|
|
981
981
|
}
|
|
982
982
|
}
|
|
983
|
-
const xe =
|
|
983
|
+
const xe = pt(H, Z);
|
|
984
984
|
h?.({
|
|
985
985
|
raw: xe,
|
|
986
986
|
conformed: H,
|
|
@@ -1000,12 +1000,12 @@ const Fe = (t) => {
|
|
|
1000
1000
|
C.input(() => k(c, "input")),
|
|
1001
1001
|
C.change(() => k(c, "change")),
|
|
1002
1002
|
C.keydown((y) => {
|
|
1003
|
-
if (y.key !== "Backspace" || !(t.cursor ?
|
|
1003
|
+
if (y.key !== "Backspace" || !(t.cursor ? p.get(t.cursor)?.backspaceRubberBand ?? !0 : !0)) return;
|
|
1004
1004
|
const z = c.selectionStart ?? 0, _ = c.selectionEnd ?? z;
|
|
1005
1005
|
if (z !== _ || z <= 0) return;
|
|
1006
|
-
const B = c.value ?? "", R = d != null ?
|
|
1006
|
+
const B = c.value ?? "", R = d != null ? p.get(d) : null;
|
|
1007
1007
|
if (!R) return;
|
|
1008
|
-
const X = b != null ?
|
|
1008
|
+
const X = b != null ? p.get(b) : void 0, Q = w != null ? p.get(w) : !0, Y = m != null ? p.get(m) : void 0, Z = v != null ? p.get(v) : void 0, le = Fe(
|
|
1009
1009
|
typeof R == "function" ? R(B, {
|
|
1010
1010
|
raw: B,
|
|
1011
1011
|
previousConformed: B,
|
|
@@ -1049,9 +1049,9 @@ const Fe = (t) => {
|
|
|
1049
1049
|
return Number.isNaN(e) ? null : e;
|
|
1050
1050
|
}, Vt = (t) => {
|
|
1051
1051
|
const { value: e, step: n, min: s, max: l, onBlur: h, onChange: o, onInput: d, after: b } = t, w = (i) => {
|
|
1052
|
-
const u = s != null ?
|
|
1052
|
+
const u = s != null ? p.get(s) : void 0, D = l != null ? p.get(l) : void 0;
|
|
1053
1053
|
return u != null && i < u ? u : D != null && i > D ? D : i;
|
|
1054
|
-
},
|
|
1054
|
+
}, f = (() => {
|
|
1055
1055
|
if (n == null) return null;
|
|
1056
1056
|
const i = A(
|
|
1057
1057
|
e,
|
|
@@ -1066,12 +1066,12 @@ const Fe = (t) => {
|
|
|
1066
1066
|
const I = x ?? 0;
|
|
1067
1067
|
return $ == null ? !0 : I < $;
|
|
1068
1068
|
}), D = (x) => {
|
|
1069
|
-
const $ =
|
|
1069
|
+
const $ = p.get(e) ?? 0, I = p.get(n), V = x?.shiftKey ? 10 : 1, k = G($ - I * V, I), c = s != null ? p.get(s) : void 0;
|
|
1070
1070
|
if (c != null && k < c) return;
|
|
1071
1071
|
const y = w(k);
|
|
1072
1072
|
y !== $ && (o?.(y), d?.(y));
|
|
1073
1073
|
}, S = (x) => {
|
|
1074
|
-
const $ =
|
|
1074
|
+
const $ = p.get(e) ?? 0, I = p.get(n), V = x?.shiftKey ? 10 : 1, k = G($ + I * V, I), c = l != null ? p.get(l) : void 0;
|
|
1075
1075
|
if (c != null && k > c) return;
|
|
1076
1076
|
const y = w(k);
|
|
1077
1077
|
y !== $ && (o?.(y), d?.(y));
|
|
@@ -1116,7 +1116,7 @@ const Fe = (t) => {
|
|
|
1116
1116
|
e,
|
|
1117
1117
|
t.disabled,
|
|
1118
1118
|
o ?? d
|
|
1119
|
-
), v = b != null &&
|
|
1119
|
+
), v = b != null && f != null ? N(f, m, b) : b != null ? N(m, b) : f != null ? N(f, m) : m;
|
|
1120
1120
|
return W({
|
|
1121
1121
|
...t,
|
|
1122
1122
|
input: se.number(
|
|
@@ -1125,7 +1125,7 @@ const Fe = (t) => {
|
|
|
1125
1125
|
l != null ? r.max(l) : M,
|
|
1126
1126
|
q(t),
|
|
1127
1127
|
// Represent null as empty string so the field can be cleared
|
|
1128
|
-
r.value(
|
|
1128
|
+
r.value(p.map(e, (i) => i == null ? "" : String(i))),
|
|
1129
1129
|
r.step(n),
|
|
1130
1130
|
r.class("bc-input bc-number-input"),
|
|
1131
1131
|
h != null ? C.blur(P(h)) : M,
|
|
@@ -1144,7 +1144,7 @@ const Fe = (t) => {
|
|
|
1144
1144
|
// Wheel support when step is defined
|
|
1145
1145
|
n != null ? C.wheel((i) => {
|
|
1146
1146
|
i.preventDefault();
|
|
1147
|
-
const u =
|
|
1147
|
+
const u = p.get(e) ?? 0, D = p.get(n), S = i.shiftKey ? 10 : 1, a = i.deltaY < 0 ? D * S : -D * S, x = w(G(u + a, D));
|
|
1148
1148
|
x !== u && (o?.(x), d?.(x));
|
|
1149
1149
|
}) : M
|
|
1150
1150
|
),
|
|
@@ -1192,8 +1192,8 @@ const Fe = (t) => {
|
|
|
1192
1192
|
e,
|
|
1193
1193
|
e,
|
|
1194
1194
|
e
|
|
1195
|
-
], s = t.class ?
|
|
1196
|
-
return
|
|
1195
|
+
], s = t.class ? p.map(t.class, (l) => `bc-uuid-input ${l}`) : "bc-uuid-input";
|
|
1196
|
+
return Oe({
|
|
1197
1197
|
...t,
|
|
1198
1198
|
class: s,
|
|
1199
1199
|
mask: n,
|
|
@@ -1233,26 +1233,26 @@ const Be = (t, e) => {
|
|
|
1233
1233
|
}
|
|
1234
1234
|
}, Lt = (t) => {
|
|
1235
1235
|
const { value: e, onChange: n, onInput: s, after: l, disabled: h, onBlur: o } = t, d = () => {
|
|
1236
|
-
const
|
|
1237
|
-
return l != null ? N(
|
|
1236
|
+
const f = Ee(e, h, n ?? s);
|
|
1237
|
+
return l != null ? N(f, l) : f;
|
|
1238
1238
|
}, b = t.placeholder != null ? M : r.placeholder("P0DT0H0M0S");
|
|
1239
1239
|
return Ke(
|
|
1240
|
-
(
|
|
1240
|
+
(f) => {
|
|
1241
1241
|
const m = qe(
|
|
1242
1242
|
t,
|
|
1243
1243
|
(v) => v?.toString() ?? "",
|
|
1244
|
-
(v) => v === "" ? null :
|
|
1244
|
+
(v) => v === "" ? null : f.Duration.from(v)
|
|
1245
1245
|
);
|
|
1246
|
-
return
|
|
1246
|
+
return Oe({
|
|
1247
1247
|
...m,
|
|
1248
1248
|
onInput: void 0,
|
|
1249
|
-
...bt(
|
|
1249
|
+
...bt(f.Duration.from),
|
|
1250
1250
|
placeholder: "P0DT0H0M0S",
|
|
1251
1251
|
after: d()
|
|
1252
1252
|
});
|
|
1253
1253
|
},
|
|
1254
1254
|
{ pending: () => {
|
|
1255
|
-
const
|
|
1255
|
+
const f = (m) => (v) => {
|
|
1256
1256
|
const u = v.currentTarget?.value ?? "";
|
|
1257
1257
|
if (u === "") {
|
|
1258
1258
|
m(null);
|
|
@@ -1273,12 +1273,12 @@ const Be = (t, e) => {
|
|
|
1273
1273
|
...t,
|
|
1274
1274
|
input: se.text(
|
|
1275
1275
|
q(t),
|
|
1276
|
-
r.value(
|
|
1276
|
+
r.value(p.map(e, (m) => m?.toString() ?? "")),
|
|
1277
1277
|
r.class("bc-input"),
|
|
1278
1278
|
b,
|
|
1279
1279
|
o != null ? C.blur(() => o()) : M,
|
|
1280
|
-
n != null ? C.change(
|
|
1281
|
-
s != null ? C.input(
|
|
1280
|
+
n != null ? C.change(f(n)) : M,
|
|
1281
|
+
s != null ? C.input(f(s)) : M
|
|
1282
1282
|
),
|
|
1283
1283
|
after: d()
|
|
1284
1284
|
});
|
|
@@ -1308,8 +1308,8 @@ function ht(t, e) {
|
|
|
1308
1308
|
showRemove: d = !0,
|
|
1309
1309
|
removeDisabled: b,
|
|
1310
1310
|
showMoveButtons: w = !0,
|
|
1311
|
-
layout:
|
|
1312
|
-
} = t, m =
|
|
1311
|
+
layout: f = "aside"
|
|
1312
|
+
} = t, m = p.toSignal(f).map((u) => u === "aside"), v = U(
|
|
1313
1313
|
o,
|
|
1314
1314
|
() => g.div(
|
|
1315
1315
|
r.class("bc-list-item-controls__move"),
|
|
@@ -1321,8 +1321,8 @@ function ht(t, e) {
|
|
|
1321
1321
|
onClick: () => n("up"),
|
|
1322
1322
|
disabled: s
|
|
1323
1323
|
},
|
|
1324
|
-
|
|
1325
|
-
|
|
1324
|
+
F(
|
|
1325
|
+
O,
|
|
1326
1326
|
(u) => E({
|
|
1327
1327
|
size: "xs",
|
|
1328
1328
|
icon: "line-md:arrow-up",
|
|
@@ -1338,8 +1338,8 @@ function ht(t, e) {
|
|
|
1338
1338
|
onClick: () => n("down"),
|
|
1339
1339
|
disabled: l
|
|
1340
1340
|
},
|
|
1341
|
-
|
|
1342
|
-
|
|
1341
|
+
F(
|
|
1342
|
+
O,
|
|
1343
1343
|
(u) => E({
|
|
1344
1344
|
size: "xs",
|
|
1345
1345
|
icon: "line-md:arrow-down",
|
|
@@ -1350,11 +1350,11 @@ function ht(t, e) {
|
|
|
1350
1350
|
)
|
|
1351
1351
|
), i = U(
|
|
1352
1352
|
d,
|
|
1353
|
-
() =>
|
|
1354
|
-
|
|
1353
|
+
() => F(
|
|
1354
|
+
O,
|
|
1355
1355
|
(u) => oe({
|
|
1356
1356
|
size: "xs",
|
|
1357
|
-
label:
|
|
1357
|
+
label: p.map(u.$.removeItem, (D) => D.toLowerCase()),
|
|
1358
1358
|
color: "danger",
|
|
1359
1359
|
disabled: b,
|
|
1360
1360
|
onClick: h
|
|
@@ -1398,7 +1398,7 @@ const gt = (t) => {
|
|
|
1398
1398
|
createItem: d,
|
|
1399
1399
|
addLabel: b,
|
|
1400
1400
|
controlsLayout: w = "aside",
|
|
1401
|
-
removeDisabled:
|
|
1401
|
+
removeDisabled: f,
|
|
1402
1402
|
addDisabled: m
|
|
1403
1403
|
} = t, v = U(
|
|
1404
1404
|
A(o, d)((i, u) => i && u != null),
|
|
@@ -1418,8 +1418,8 @@ const gt = (t) => {
|
|
|
1418
1418
|
(i, u) => i || u
|
|
1419
1419
|
)
|
|
1420
1420
|
},
|
|
1421
|
-
|
|
1422
|
-
|
|
1421
|
+
F(
|
|
1422
|
+
O,
|
|
1423
1423
|
(i) => Me(
|
|
1424
1424
|
r.class("bc-group--gap-2"),
|
|
1425
1425
|
E({ icon: "line-md:plus" }),
|
|
@@ -1440,7 +1440,7 @@ const gt = (t) => {
|
|
|
1440
1440
|
onRemove: i.remove,
|
|
1441
1441
|
showMove: l,
|
|
1442
1442
|
showRemove: h,
|
|
1443
|
-
removeDisabled:
|
|
1443
|
+
removeDisabled: f,
|
|
1444
1444
|
showMoveButtons: e.signal.map((u) => u.length > 1),
|
|
1445
1445
|
layout: w
|
|
1446
1446
|
},
|
|
@@ -1460,7 +1460,7 @@ const gt = (t) => {
|
|
|
1460
1460
|
showAdd: d,
|
|
1461
1461
|
createItem: b,
|
|
1462
1462
|
addLabel: w,
|
|
1463
|
-
controlsLayout:
|
|
1463
|
+
controlsLayout: f,
|
|
1464
1464
|
removeDisabled: m,
|
|
1465
1465
|
addDisabled: v,
|
|
1466
1466
|
...i
|
|
@@ -1477,7 +1477,7 @@ const gt = (t) => {
|
|
|
1477
1477
|
showAdd: d,
|
|
1478
1478
|
createItem: b,
|
|
1479
1479
|
addLabel: w,
|
|
1480
|
-
controlsLayout:
|
|
1480
|
+
controlsLayout: f,
|
|
1481
1481
|
removeDisabled: m,
|
|
1482
1482
|
addDisabled: v
|
|
1483
1483
|
})
|
|
@@ -1485,7 +1485,7 @@ const gt = (t) => {
|
|
|
1485
1485
|
...e
|
|
1486
1486
|
);
|
|
1487
1487
|
};
|
|
1488
|
-
class
|
|
1488
|
+
class Ft extends fe {
|
|
1489
1489
|
/** The immutable list of branch definitions for this union */
|
|
1490
1490
|
branches;
|
|
1491
1491
|
/** Reactive signal containing the key of the currently active branch */
|
|
@@ -1507,21 +1507,21 @@ class Ot extends pe {
|
|
|
1507
1507
|
*/
|
|
1508
1508
|
constructor(e, n, s, l, h, o, d = K) {
|
|
1509
1509
|
super(e, n, s, l, h, d), this.branches = o;
|
|
1510
|
-
const b = (
|
|
1510
|
+
const b = (f) => {
|
|
1511
1511
|
for (const m of o)
|
|
1512
|
-
if (m.detect(
|
|
1512
|
+
if (m.detect(f))
|
|
1513
1513
|
return m.key;
|
|
1514
1514
|
return o[0]?.key ?? "unknown";
|
|
1515
1515
|
};
|
|
1516
1516
|
this.activeBranch = s.map(b, K);
|
|
1517
|
-
const w = (
|
|
1518
|
-
if (this.#e.has(
|
|
1519
|
-
return this.#e.get(
|
|
1520
|
-
const m = o.find((i) => i.key ===
|
|
1517
|
+
const w = (f) => {
|
|
1518
|
+
if (this.#e.has(f))
|
|
1519
|
+
return this.#e.get(f);
|
|
1520
|
+
const m = o.find((i) => i.key === f);
|
|
1521
1521
|
if (!m)
|
|
1522
|
-
throw new Error(`Unknown branch: ${
|
|
1523
|
-
const v = new
|
|
1524
|
-
[...e,
|
|
1522
|
+
throw new Error(`Unknown branch: ${f}`);
|
|
1523
|
+
const v = new fe(
|
|
1524
|
+
[...e, f],
|
|
1525
1525
|
(i) => {
|
|
1526
1526
|
this.change(i);
|
|
1527
1527
|
},
|
|
@@ -1529,21 +1529,21 @@ class Ot extends pe {
|
|
|
1529
1529
|
(i) => m.detect(i) ? i : m.defaultValue(),
|
|
1530
1530
|
d
|
|
1531
1531
|
),
|
|
1532
|
-
l.map(Ce([
|
|
1532
|
+
l.map(Ce([f])),
|
|
1533
1533
|
{
|
|
1534
1534
|
disabled: this.disabled,
|
|
1535
1535
|
validationMode: this.parent.validationMode
|
|
1536
1536
|
},
|
|
1537
1537
|
d
|
|
1538
1538
|
);
|
|
1539
|
-
return this.#e.set(
|
|
1539
|
+
return this.#e.set(f, v), v;
|
|
1540
1540
|
};
|
|
1541
1541
|
this.#t = this.activeBranch.map(
|
|
1542
|
-
(
|
|
1542
|
+
(f) => w(f),
|
|
1543
1543
|
K
|
|
1544
1544
|
), this.onDispose(() => {
|
|
1545
|
-
for (const
|
|
1546
|
-
|
|
1545
|
+
for (const f of this.#e.values())
|
|
1546
|
+
f.dispose();
|
|
1547
1547
|
this.#e.clear(), this.activeBranch.dispose(), this.#t.dispose();
|
|
1548
1548
|
});
|
|
1549
1549
|
}
|
|
@@ -1556,7 +1556,7 @@ class Ot extends pe {
|
|
|
1556
1556
|
* @returns The `Controller<unknown>` for the active branch
|
|
1557
1557
|
*/
|
|
1558
1558
|
get activeController() {
|
|
1559
|
-
return
|
|
1559
|
+
return p.get(this.#t);
|
|
1560
1560
|
}
|
|
1561
1561
|
/**
|
|
1562
1562
|
* Gets or creates a controller for a specific branch by key.
|
|
@@ -1573,7 +1573,7 @@ class Ot extends pe {
|
|
|
1573
1573
|
throw new Error(`Unknown branch: ${e}`);
|
|
1574
1574
|
if (this.#e.has(e))
|
|
1575
1575
|
return this.#e.get(e);
|
|
1576
|
-
const s = new
|
|
1576
|
+
const s = new fe(
|
|
1577
1577
|
[...this.path, e],
|
|
1578
1578
|
(l) => {
|
|
1579
1579
|
this.change(l);
|
|
@@ -1609,7 +1609,7 @@ class Ot extends pe {
|
|
|
1609
1609
|
const s = this.branches.find((o) => o.key === e);
|
|
1610
1610
|
if (!s)
|
|
1611
1611
|
throw new Error(`Unknown branch: ${e}`);
|
|
1612
|
-
const l =
|
|
1612
|
+
const l = p.get(this.signal);
|
|
1613
1613
|
if (s.detect(l))
|
|
1614
1614
|
return !0;
|
|
1615
1615
|
if (s.convert) {
|
|
@@ -1628,11 +1628,11 @@ class Ot extends pe {
|
|
|
1628
1628
|
* @returns The active branch definition, or `undefined` if no branch matches
|
|
1629
1629
|
*/
|
|
1630
1630
|
get activeBranchDefinition() {
|
|
1631
|
-
const e =
|
|
1631
|
+
const e = p.get(this.activeBranch);
|
|
1632
1632
|
return this.branches.find((n) => n.key === e);
|
|
1633
1633
|
}
|
|
1634
1634
|
}
|
|
1635
|
-
function
|
|
1635
|
+
function Ot(t) {
|
|
1636
1636
|
return t.transform(
|
|
1637
1637
|
(e) => e ?? null,
|
|
1638
1638
|
(e) => e ?? void 0
|
|
@@ -1675,7 +1675,7 @@ export {
|
|
|
1675
1675
|
zt as F,
|
|
1676
1676
|
Me as G,
|
|
1677
1677
|
Et as L,
|
|
1678
|
-
|
|
1678
|
+
Oe as M,
|
|
1679
1679
|
Ee as N,
|
|
1680
1680
|
Tt as S,
|
|
1681
1681
|
Bt as T,
|
|
@@ -1689,7 +1689,7 @@ export {
|
|
|
1689
1689
|
Vt as f,
|
|
1690
1690
|
St as g,
|
|
1691
1691
|
Mt as h,
|
|
1692
|
-
|
|
1692
|
+
Ft as i,
|
|
1693
1693
|
vt as j,
|
|
1694
1694
|
nt as k,
|
|
1695
1695
|
at as l,
|
|
@@ -1700,5 +1700,5 @@ export {
|
|
|
1700
1700
|
he as q,
|
|
1701
1701
|
G as r,
|
|
1702
1702
|
Nt as s,
|
|
1703
|
-
|
|
1703
|
+
Ot as t
|
|
1704
1704
|
};
|