@tempots/beatui 0.39.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -11
- package/dist/{2019-1S9vgvv2.cjs → 2019-BFDr925O.cjs} +1 -1
- package/dist/{2019-DPD_eCKE.js → 2019-DnG5Y5sm.js} +2 -2
- package/dist/{2020-aLm9VmDL.js → 2020-D0-tZTo7.js} +2 -2
- package/dist/{2020-CGrbEEmD.cjs → 2020-gUs7l1CJ.cjs} +1 -1
- package/dist/{ar-B0vT_MPe.cjs → ar-BLgxAefV.cjs} +1 -1
- package/dist/{ar-CbM09z5P.js → ar-DpQo8C31.js} +1 -1
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +54 -49
- package/dist/beatui.css +216 -129
- package/dist/beatui.tailwind.css +216 -129
- package/dist/{de-tK36cL_u.cjs → de-Bv-qs--J.cjs} +1 -1
- package/dist/{de-Dd907tZQ.js → de-D1MQ4wen.js} +1 -1
- package/dist/{es-K35LRZa-.cjs → es-3r8Ko5Dn.cjs} +1 -1
- package/dist/{es-BkJxjMdG.js → es-DwPjonS7.js} +1 -1
- package/dist/{fa-BBikwwku.cjs → fa-Qw6uVZeX.cjs} +1 -1
- package/dist/{fa-DBTUBsw_.js → fa-fxf_lWjh.js} +1 -1
- package/dist/{fr-Fmupo556.js → fr-BDDsMHRZ.js} +1 -1
- package/dist/{fr-DMtXrrnJ.cjs → fr-pVhG9qik.cjs} +1 -1
- package/dist/{he-DkI64oaY.js → he-B4deK_wE.js} +1 -1
- package/dist/{he-on3Ivp8g.cjs → he-D-fvzfe1.cjs} +1 -1
- package/dist/{hi-GdD5MihT.js → hi-CxQT8nRD.js} +1 -1
- package/dist/{hi-CNFV8ITE.cjs → hi-DKgxHzmH.cjs} +1 -1
- package/dist/{index-BK8t6gqu.js → index-Acyxme63.js} +680 -677
- package/dist/{index-e8oQ-k0x.cjs → index-BZ2AX5sk.cjs} +4 -4
- package/dist/{index-BfFlhmAq.js → index-BwEJlbG2.js} +1 -1
- package/dist/{index-DjShJtXp.js → index-CAeOFdez.js} +1 -1
- package/dist/{index-BI5w0jSz.js → index-CBT2SLat.js} +224 -223
- package/dist/{index-BkQ7xHgi.js → index-CWq36UAJ.js} +770 -757
- package/dist/{index-Bv2gn_kV.cjs → index-ClFVnBUS.cjs} +3 -3
- package/dist/{index-LUItEwlw.js → index-Clw0AwwJ.js} +1 -1
- package/dist/{index-wdi93sK4.cjs → index-DRDJFYRb.cjs} +1 -1
- package/dist/{index-CKyH3jwP.cjs → index-KPHFBjQB.cjs} +1 -1
- package/dist/{index-BA93M8Ux.cjs → index-Lj0QS2po.cjs} +1 -1
- package/dist/{index-CPBlySmE.cjs → index-nVVPqgLq.cjs} +12 -12
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +2200 -2181
- package/dist/{it-Bpnfd60V.js → it-6QS5PWzQ.js} +1 -1
- package/dist/{it-BDOzBRkQ.cjs → it-Ck0r9TO3.cjs} +1 -1
- package/dist/{ja-SjlGNgs9.js → ja-D2VvVGEN.js} +1 -1
- package/dist/{ja-N-7c7zD7.cjs → ja-D6b9suYB.cjs} +1 -1
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +1 -1
- package/dist/{ko-CH69ZNts.js → ko-CP_WopWz.js} +1 -1
- package/dist/{ko-BBeTXIlY.cjs → ko-CzvM2Bjv.cjs} +1 -1
- package/dist/markdown/index.cjs.js +1 -1
- package/dist/markdown/index.es.js +1 -1
- package/dist/modal-BmSRMdY9.cjs +1 -0
- package/dist/{modal-BD76Rve3.js → modal-DMc-R2VT.js} +234 -209
- package/dist/{nl-DnvMlW8v.js → nl-DZ4dFolZ.js} +1 -1
- package/dist/{nl-C2C9QDH2.cjs → nl-_9vJc8JD.cjs} +1 -1
- package/dist/{notice-CQZseCQs.js → notice-B5Yn_3Ay.js} +205 -195
- package/dist/notice-D3P0lewM.cjs +2 -0
- package/dist/{pl-CBEX2qN1.js → pl-BE81iFSF.js} +1 -1
- package/dist/{pl-sNBCzEUd.cjs → pl-DKcVCojx.cjs} +1 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/{pt-ByFqFAdQ.js → pt-BcCdXUA2.js} +1 -1
- package/dist/{pt-Bvxg9VEA.cjs → pt-DNVS1_MF.cjs} +1 -1
- package/dist/{ru-6d5JfoDw.js → ru-Bo_jc3s1.js} +1 -1
- package/dist/{ru-CPAdsn4m.cjs → ru-DTn9Rssv.cjs} +1 -1
- package/dist/{toolbar-Cl_TAa3r.js → toolbar-DhD5GmMa.js} +1 -1
- package/dist/{toolbar-Dw2VQD9y.cjs → toolbar-jPGzdJGi.cjs} +1 -1
- package/dist/{tr-IKZtCQQR.cjs → tr-BhTJYHQ3.cjs} +1 -1
- package/dist/{tr-gv4vJfm8.js → tr-CBw3FlOg.js} +1 -1
- package/dist/{translations-DXLmnUiB.js → translations-B0HuWYIz.js} +1 -1
- package/dist/{translations-CK426qyd.cjs → translations-B7_3phoA.cjs} +1 -1
- package/dist/translations-C21osktO.cjs +1 -0
- package/dist/{translations-djDSPqdb.js → translations-D-fMB_IO.js} +212 -183
- package/dist/types/components/form/controller/color-controller.d.ts +1 -1
- package/dist/types/components/form/input/color-input.d.ts +2 -5
- package/dist/types/components/form/input/color-swatch-input.d.ts +9 -0
- package/dist/types/components/form/input/index.d.ts +1 -0
- package/dist/types/components/form/input/input-container.d.ts +7 -0
- package/dist/types/components/misc/notification-provider.d.ts +3 -3
- package/dist/types/utils/{color-validation.d.ts → color.d.ts} +13 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/use-animated-toggle.d.ts +17 -4
- package/dist/{ur-Bgq_2yjr.cjs → ur-BjuXyU8Z.cjs} +1 -1
- package/dist/{ur-Bo6bjEBS.js → ur-BsXnPgxd.js} +1 -1
- package/dist/utils-BOEQMy82.js +2512 -0
- package/dist/utils-DH-SYrQg.cjs +1 -0
- package/dist/{vi-BrUQnj-8.cjs → vi-CvsTHMkK.cjs} +1 -1
- package/dist/{vi-xDLJ3TIx.js → vi-D1rLo6MX.js} +1 -1
- package/dist/{zh-BivWxJJh.js → zh-BoLsjdfz.js} +1 -1
- package/dist/{zh-BqH1Cioq.cjs → zh-zh1FJ4Ud.cjs} +1 -1
- package/package.json +4 -3
- package/dist/modal-DQycMZ8_.cjs +0 -1
- package/dist/notice-CFoc4PJe.cjs +0 -2
- package/dist/translations-DJR65Jii.cjs +0 -1
- package/dist/utils-Bsrfm-0d.cjs +0 -1
- package/dist/utils-Bw911Eo4.js +0 -2418
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { WithElement as
|
|
2
|
-
import { g as
|
|
3
|
-
import { s as Y, C as Z } from "./notice-
|
|
4
|
-
import { a as K, B as
|
|
1
|
+
import { WithElement as D, OnDispose as V, prop as R, computedOf as w, Fragment as B, attr as g, WithBrowserCtx as J, Value as U, render as Q, html as k, dataAttr as S, aria as F, on as X, When as I, Use as H, coalesce as _ } from "@tempots/dom";
|
|
2
|
+
import { g as $, T as P } from "./timer-DzWb416P.js";
|
|
3
|
+
import { s as Y, C as Z } from "./notice-B5Yn_3Ay.js";
|
|
4
|
+
import { a as K, B as W } from "./translations-D-fMB_IO.js";
|
|
5
5
|
const ee = [
|
|
6
6
|
"a[href]",
|
|
7
7
|
"button:not([disabled])",
|
|
@@ -23,23 +23,23 @@ function te(o) {
|
|
|
23
23
|
}
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function M(o = {}) {
|
|
27
27
|
const {
|
|
28
28
|
active: t = !0,
|
|
29
29
|
escapeDeactivates: s = !0,
|
|
30
30
|
onEscape: e,
|
|
31
31
|
initialFocus: n,
|
|
32
|
-
returnFocus:
|
|
33
|
-
clickOutsideDeactivates:
|
|
34
|
-
onClickOutside:
|
|
32
|
+
returnFocus: r,
|
|
33
|
+
clickOutsideDeactivates: a = !1,
|
|
34
|
+
onClickOutside: u
|
|
35
35
|
} = o;
|
|
36
|
-
return
|
|
37
|
-
let
|
|
36
|
+
return D((m) => {
|
|
37
|
+
let f = t, p = null, c = [];
|
|
38
38
|
typeof document < "u" && (p = document.activeElement);
|
|
39
39
|
const v = () => {
|
|
40
|
-
c = te(
|
|
40
|
+
c = te(m);
|
|
41
41
|
}, b = (l) => {
|
|
42
|
-
if (
|
|
42
|
+
if (f) {
|
|
43
43
|
if (s && l.key === "Escape") {
|
|
44
44
|
l.preventDefault(), e?.();
|
|
45
45
|
return;
|
|
@@ -49,39 +49,39 @@ function $(o = {}) {
|
|
|
49
49
|
l.preventDefault();
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
|
-
const
|
|
52
|
+
const i = c.indexOf(
|
|
53
53
|
document.activeElement
|
|
54
54
|
);
|
|
55
|
-
l.shiftKey ?
|
|
55
|
+
l.shiftKey ? i <= 0 && (l.preventDefault(), c[c.length - 1]?.focus()) : i >= c.length - 1 && (l.preventDefault(), c[0]?.focus());
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
}, h = (l) => {
|
|
59
|
-
if (!
|
|
60
|
-
const
|
|
61
|
-
|
|
59
|
+
if (!f || !a) return;
|
|
60
|
+
const i = l.target;
|
|
61
|
+
m.contains(i) || u?.();
|
|
62
62
|
}, y = () => {
|
|
63
|
-
if (!
|
|
63
|
+
if (!f) return;
|
|
64
64
|
v();
|
|
65
65
|
let l = null;
|
|
66
66
|
typeof n == "function" ? l = n() : n ? l = n : c.length > 0 && (l = c[0]), l && setTimeout(() => {
|
|
67
67
|
l?.focus();
|
|
68
|
-
}, 50), document.addEventListener("keydown", b, !0),
|
|
69
|
-
},
|
|
70
|
-
|
|
68
|
+
}, 50), document.addEventListener("keydown", b, !0), a && document.addEventListener("click", h, !0);
|
|
69
|
+
}, L = () => {
|
|
70
|
+
f = !1, document.removeEventListener("keydown", b, !0), document.removeEventListener("click", h, !0);
|
|
71
71
|
let l = null;
|
|
72
|
-
typeof
|
|
72
|
+
typeof r == "function" ? l = r() : r ? l = r : p && (l = p), l && document.body.contains(l) && setTimeout(() => {
|
|
73
73
|
l?.focus();
|
|
74
74
|
}, 0);
|
|
75
75
|
};
|
|
76
|
-
return setTimeout(() => y(), 0),
|
|
77
|
-
|
|
76
|
+
return setTimeout(() => y(), 0), V(() => {
|
|
77
|
+
L();
|
|
78
78
|
});
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function pe(o = {}) {
|
|
82
82
|
return {
|
|
83
|
-
activate: () =>
|
|
84
|
-
deactivate: () =>
|
|
83
|
+
activate: () => M({ ...o, active: !0 }),
|
|
84
|
+
deactivate: () => M({ ...o, active: !1 })
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
function N({
|
|
@@ -89,35 +89,35 @@ function N({
|
|
|
89
89
|
openedAfter: t,
|
|
90
90
|
closedAfter: s
|
|
91
91
|
}) {
|
|
92
|
-
const e =
|
|
92
|
+
const e = R(o), n = () => {
|
|
93
93
|
e.set("start-opening");
|
|
94
|
-
},
|
|
94
|
+
}, r = () => {
|
|
95
95
|
e.set("start-closing");
|
|
96
|
-
},
|
|
97
|
-
(
|
|
98
|
-
),
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
e.on((
|
|
105
|
-
|
|
96
|
+
}, a = e.map(
|
|
97
|
+
(i) => i !== "closed" && i !== "start-closing" && i !== "closing"
|
|
98
|
+
), u = (i) => {
|
|
99
|
+
i ? n() : r();
|
|
100
|
+
}, m = () => {
|
|
101
|
+
u(!a.value);
|
|
102
|
+
}, f = [], p = (i) => {
|
|
103
|
+
f.push(
|
|
104
|
+
e.on((T) => {
|
|
105
|
+
T === "closed" && i();
|
|
106
106
|
})
|
|
107
107
|
);
|
|
108
108
|
};
|
|
109
109
|
let c = () => {
|
|
110
110
|
};
|
|
111
|
-
e.on((
|
|
112
|
-
switch (c(),
|
|
111
|
+
e.on((i) => {
|
|
112
|
+
switch (c(), i) {
|
|
113
113
|
case "start-opening":
|
|
114
|
-
c =
|
|
114
|
+
c = $(() => e.set("opening"));
|
|
115
115
|
break;
|
|
116
116
|
case "opening":
|
|
117
117
|
c = t(() => e.set("opened"));
|
|
118
118
|
break;
|
|
119
119
|
case "start-closing":
|
|
120
|
-
c =
|
|
120
|
+
c = $(() => e.set("closing"));
|
|
121
121
|
break;
|
|
122
122
|
case "closing":
|
|
123
123
|
c = s(() => e.set("closed"));
|
|
@@ -128,27 +128,27 @@ function N({
|
|
|
128
128
|
break;
|
|
129
129
|
}
|
|
130
130
|
}), e.onDispose(() => {
|
|
131
|
-
|
|
131
|
+
f.forEach((i) => i()), c();
|
|
132
132
|
});
|
|
133
|
-
const v = e.map((
|
|
133
|
+
const v = e.map((i) => i === "closed"), b = e.map((i) => i === "start-opening"), h = e.map((i) => i === "opening"), y = e.map((i) => i === "opened"), L = e.map((i) => i === "closing"), l = e.map((i) => i === "start-closing");
|
|
134
134
|
return {
|
|
135
135
|
status: e,
|
|
136
136
|
open: n,
|
|
137
|
-
close:
|
|
138
|
-
toggle:
|
|
139
|
-
setOpen:
|
|
140
|
-
display:
|
|
137
|
+
close: r,
|
|
138
|
+
toggle: m,
|
|
139
|
+
setOpen: u,
|
|
140
|
+
display: a,
|
|
141
141
|
isClosed: v,
|
|
142
142
|
isStartOpening: b,
|
|
143
143
|
isOpening: h,
|
|
144
144
|
isOpened: y,
|
|
145
|
-
isClosing:
|
|
145
|
+
isClosing: L,
|
|
146
146
|
isStartClosing: l,
|
|
147
147
|
dispose: () => e.dispose(),
|
|
148
148
|
listenOnClosed: p
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function he({
|
|
152
152
|
initialStatus: o = "closed",
|
|
153
153
|
duration: t,
|
|
154
154
|
openDuration: s = t ?? 500,
|
|
@@ -156,30 +156,30 @@ function fe({
|
|
|
156
156
|
} = {}) {
|
|
157
157
|
return N({
|
|
158
158
|
initialStatus: o,
|
|
159
|
-
openedAfter: (n) =>
|
|
160
|
-
closedAfter: (n) =>
|
|
159
|
+
openedAfter: (n) => P(n, s),
|
|
160
|
+
closedAfter: (n) => P(n, e)
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function z(o, t) {
|
|
164
164
|
let s = !1, e = null;
|
|
165
165
|
function n() {
|
|
166
|
-
s || (s = !0, o.removeEventListener("transitionend",
|
|
166
|
+
s || (s = !0, o.removeEventListener("transitionend", r), o.removeEventListener("animationend", a), e && (clearTimeout(e), e = null), t());
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
|
|
168
|
+
function r(f) {
|
|
169
|
+
f.target === o && n();
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
|
|
171
|
+
function a(f) {
|
|
172
|
+
f.target === o && n();
|
|
173
173
|
}
|
|
174
|
-
const
|
|
174
|
+
const m = $(() => {
|
|
175
175
|
if (typeof o.getAnimations > "u") {
|
|
176
176
|
e = setTimeout(n, 16);
|
|
177
177
|
return;
|
|
178
178
|
}
|
|
179
|
-
o.addEventListener("transitionend",
|
|
179
|
+
o.addEventListener("transitionend", r), o.addEventListener("animationend", a), o.getAnimations().length === 0 && (e = setTimeout(n, 1e3));
|
|
180
180
|
});
|
|
181
181
|
return () => {
|
|
182
|
-
s = !0,
|
|
182
|
+
s = !0, m(), e && (clearTimeout(e), e = null), o.removeEventListener("transitionend", r), o.removeEventListener("animationend", a);
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
185
|
function G({
|
|
@@ -194,42 +194,67 @@ function G({
|
|
|
194
194
|
...N({
|
|
195
195
|
initialStatus: o,
|
|
196
196
|
openedAfter: (e) => s == null ? (e(), () => {
|
|
197
|
-
}) :
|
|
197
|
+
}) : z(s, e),
|
|
198
198
|
closedAfter: (e) => s == null ? (e(), () => {
|
|
199
|
-
}) :
|
|
199
|
+
}) : z(s, e)
|
|
200
200
|
})
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
|
-
function se({
|
|
204
|
-
|
|
203
|
+
function se(o) {
|
|
204
|
+
if (o == null) return "";
|
|
205
|
+
const t = [];
|
|
206
|
+
return o.fade && t.push("fade"), o.slide && t.push(`slide-${o.slide}`), o.scale != null && t.push("scale"), t.length > 0 ? t.join(" ") : "none";
|
|
207
|
+
}
|
|
208
|
+
function ne(o) {
|
|
209
|
+
if (o == null) return "";
|
|
210
|
+
const t = [];
|
|
211
|
+
return o.scale != null && typeof o.scale == "number" && t.push(`--scale-factor: ${o.scale}`), o.transformOrigin != null && t.push(`--transform-origin: ${o.transformOrigin}`), o.duration != null && t.push(`--animation-duration: ${o.duration}ms`), o.easing != null && t.push(`--animation-easing: ${o.easing}`), t.join("; ");
|
|
212
|
+
}
|
|
213
|
+
function oe({
|
|
214
|
+
animation: o,
|
|
205
215
|
status: t
|
|
206
216
|
}) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
)
|
|
212
|
-
|
|
213
|
-
|
|
217
|
+
const s = w(
|
|
218
|
+
o,
|
|
219
|
+
t
|
|
220
|
+
)((n, r) => {
|
|
221
|
+
if (n == null)
|
|
222
|
+
return `bc-animated-toggle bc-animated-toggle--${r}`;
|
|
223
|
+
const a = r === "start-opening" || r === "opening" || r === "opened";
|
|
224
|
+
let u;
|
|
225
|
+
return "enter" in n || "exit" in n ? u = a ? n.enter : n.exit : u = n, `bc-animated-toggle bc-animated-toggle--${se(u)} bc-animated-toggle--${r}`;
|
|
226
|
+
}), e = w(
|
|
227
|
+
o,
|
|
228
|
+
t
|
|
229
|
+
)((n, r) => {
|
|
230
|
+
if (n == null) return "";
|
|
231
|
+
const a = r === "start-opening" || r === "opening" || r === "opened";
|
|
232
|
+
let u;
|
|
233
|
+
return "enter" in n || "exit" in n ? u = a ? n.enter : n.exit : u = n, ne(u);
|
|
234
|
+
});
|
|
235
|
+
return B(
|
|
236
|
+
V(s, e),
|
|
237
|
+
g.class(s),
|
|
238
|
+
g.style(e)
|
|
214
239
|
);
|
|
215
240
|
}
|
|
216
|
-
function
|
|
241
|
+
function ge({
|
|
217
242
|
initialStatus: o = "closed",
|
|
218
|
-
animation: t
|
|
243
|
+
animation: t
|
|
219
244
|
}, s) {
|
|
220
|
-
return
|
|
221
|
-
const { setElement: n, dispose:
|
|
245
|
+
return D((e) => {
|
|
246
|
+
const { setElement: n, dispose: r, ...a } = G({
|
|
222
247
|
initialStatus: o,
|
|
223
248
|
element: e
|
|
224
249
|
});
|
|
225
|
-
return n(e),
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
s(
|
|
250
|
+
return n(e), B(
|
|
251
|
+
oe({ status: a.status, animation: t }),
|
|
252
|
+
V(r),
|
|
253
|
+
s(a)
|
|
229
254
|
);
|
|
230
255
|
});
|
|
231
256
|
}
|
|
232
|
-
function
|
|
257
|
+
function re(o) {
|
|
233
258
|
return {
|
|
234
259
|
"~standard": {
|
|
235
260
|
version: 1,
|
|
@@ -253,7 +278,7 @@ function ne(o) {
|
|
|
253
278
|
errors: e.errors.map((n) => ({
|
|
254
279
|
message: n.message,
|
|
255
280
|
path: n.path?.map(
|
|
256
|
-
(
|
|
281
|
+
(r) => typeof r == "object" && "key" in r ? r.key.toString() : r.toString()
|
|
257
282
|
) || []
|
|
258
283
|
}))
|
|
259
284
|
}
|
|
@@ -261,18 +286,18 @@ function ne(o) {
|
|
|
261
286
|
}
|
|
262
287
|
};
|
|
263
288
|
}
|
|
264
|
-
class
|
|
289
|
+
class A {
|
|
265
290
|
optional() {
|
|
266
|
-
return new
|
|
291
|
+
return new ae(this);
|
|
267
292
|
}
|
|
268
293
|
default(t) {
|
|
269
|
-
return new
|
|
294
|
+
return new ie(this, t);
|
|
270
295
|
}
|
|
271
296
|
schema() {
|
|
272
|
-
return
|
|
297
|
+
return re(this);
|
|
273
298
|
}
|
|
274
299
|
}
|
|
275
|
-
class
|
|
300
|
+
class C extends A {
|
|
276
301
|
minLength;
|
|
277
302
|
maxLength;
|
|
278
303
|
pattern;
|
|
@@ -289,36 +314,36 @@ class w extends T {
|
|
|
289
314
|
return s.length > 0 ? { success: !1, errors: s } : { success: !0, data: t };
|
|
290
315
|
}
|
|
291
316
|
min(t, s) {
|
|
292
|
-
const e = new
|
|
317
|
+
const e = new C();
|
|
293
318
|
return e.minLength = t, e.maxLength = this.maxLength, e.pattern = this.pattern, e.customValidations = [...this.customValidations], s && e.customValidations.push(
|
|
294
319
|
(n) => n.length < t ? s : null
|
|
295
320
|
), e;
|
|
296
321
|
}
|
|
297
322
|
max(t, s) {
|
|
298
|
-
const e = new
|
|
323
|
+
const e = new C();
|
|
299
324
|
return e.minLength = this.minLength, e.maxLength = t, e.pattern = this.pattern, e.customValidations = [...this.customValidations], s && e.customValidations.push(
|
|
300
325
|
(n) => n.length > t ? s : null
|
|
301
326
|
), e;
|
|
302
327
|
}
|
|
303
328
|
regex(t, s) {
|
|
304
|
-
const e = new
|
|
329
|
+
const e = new C();
|
|
305
330
|
return e.minLength = this.minLength, e.maxLength = this.maxLength, e.pattern = t, e.customValidations = [...this.customValidations], s && e.customValidations.push(
|
|
306
331
|
(n) => t.test(n) ? null : s
|
|
307
332
|
), e;
|
|
308
333
|
}
|
|
309
334
|
email(t = "Please enter a valid email address") {
|
|
310
|
-
const s = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, e = new
|
|
335
|
+
const s = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, e = new C();
|
|
311
336
|
return e.minLength = this.minLength, e.maxLength = this.maxLength, e.pattern = this.pattern, e.customValidations = [
|
|
312
337
|
...this.customValidations,
|
|
313
338
|
(n) => s.test(n) ? null : t
|
|
314
339
|
], e;
|
|
315
340
|
}
|
|
316
341
|
refine(t) {
|
|
317
|
-
const s = new
|
|
342
|
+
const s = new C();
|
|
318
343
|
return s.minLength = this.minLength, s.maxLength = this.maxLength, s.pattern = this.pattern, s.customValidations = [...this.customValidations, t], s;
|
|
319
344
|
}
|
|
320
345
|
}
|
|
321
|
-
class
|
|
346
|
+
class O extends A {
|
|
322
347
|
mustBeTrue = !1;
|
|
323
348
|
trueMessage;
|
|
324
349
|
validate(t) {
|
|
@@ -328,20 +353,20 @@ class B extends T {
|
|
|
328
353
|
} : { success: !0, data: t };
|
|
329
354
|
}
|
|
330
355
|
refine(t, s) {
|
|
331
|
-
const e = new
|
|
356
|
+
const e = new O();
|
|
332
357
|
e.mustBeTrue = this.mustBeTrue, e.trueMessage = this.trueMessage;
|
|
333
358
|
const n = e.validate.bind(e);
|
|
334
|
-
return e.validate = (
|
|
335
|
-
const
|
|
336
|
-
return
|
|
359
|
+
return e.validate = (r) => {
|
|
360
|
+
const a = n(r);
|
|
361
|
+
return a.success ? t(a.data) ? a : { success: !1, errors: [{ message: s }] } : a;
|
|
337
362
|
}, e;
|
|
338
363
|
}
|
|
339
364
|
literal(t, s) {
|
|
340
|
-
const e = new
|
|
365
|
+
const e = new O();
|
|
341
366
|
return e.mustBeTrue = !0, e.trueMessage = s, e;
|
|
342
367
|
}
|
|
343
368
|
}
|
|
344
|
-
class
|
|
369
|
+
class ae extends A {
|
|
345
370
|
constructor(t) {
|
|
346
371
|
super(), this.inner = t;
|
|
347
372
|
}
|
|
@@ -352,7 +377,7 @@ class oe extends T {
|
|
|
352
377
|
return s.success ? { success: !0, data: s.data } : { success: !1, errors: s.errors };
|
|
353
378
|
}
|
|
354
379
|
}
|
|
355
|
-
class
|
|
380
|
+
class ie extends A {
|
|
356
381
|
constructor(t, s) {
|
|
357
382
|
super(), this.inner = t, this.defaultValue = s;
|
|
358
383
|
}
|
|
@@ -360,7 +385,7 @@ class ae extends T {
|
|
|
360
385
|
return t === void 0 ? { success: !0, data: this.defaultValue } : this.inner.validate(t);
|
|
361
386
|
}
|
|
362
387
|
}
|
|
363
|
-
class
|
|
388
|
+
class j extends A {
|
|
364
389
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
365
390
|
constructor(t) {
|
|
366
391
|
super(), this.shape = t;
|
|
@@ -369,47 +394,47 @@ class M extends T {
|
|
|
369
394
|
if (typeof t != "object" || t === null || Array.isArray(t))
|
|
370
395
|
return { success: !1, errors: [{ message: "Expected object" }] };
|
|
371
396
|
const s = t, e = {}, n = [];
|
|
372
|
-
for (const [
|
|
373
|
-
const
|
|
374
|
-
if (
|
|
375
|
-
e[
|
|
397
|
+
for (const [r, a] of Object.entries(this.shape)) {
|
|
398
|
+
const u = a.validate(s[r]);
|
|
399
|
+
if (u.success)
|
|
400
|
+
e[r] = u.data;
|
|
376
401
|
else
|
|
377
|
-
for (const
|
|
402
|
+
for (const m of u.errors)
|
|
378
403
|
n.push({
|
|
379
|
-
message:
|
|
380
|
-
path: [
|
|
404
|
+
message: m.message,
|
|
405
|
+
path: [r, ...m.path || []]
|
|
381
406
|
});
|
|
382
407
|
}
|
|
383
408
|
return n.length > 0 ? { success: !1, errors: n } : { success: !0, data: e };
|
|
384
409
|
}
|
|
385
410
|
refine(t, s) {
|
|
386
|
-
const e = new
|
|
387
|
-
return e.validate = (
|
|
388
|
-
const
|
|
389
|
-
if (!
|
|
390
|
-
const
|
|
391
|
-
return
|
|
411
|
+
const e = new j(this.shape), n = e.validate.bind(e);
|
|
412
|
+
return e.validate = (r) => {
|
|
413
|
+
const a = n(r);
|
|
414
|
+
if (!a.success) return a;
|
|
415
|
+
const u = t(a.data);
|
|
416
|
+
return u ? {
|
|
392
417
|
success: !1,
|
|
393
418
|
errors: [
|
|
394
419
|
{
|
|
395
|
-
message:
|
|
420
|
+
message: u,
|
|
396
421
|
path: s?.path
|
|
397
422
|
}
|
|
398
423
|
]
|
|
399
|
-
} : { success: !0, data:
|
|
424
|
+
} : { success: !0, data: a.data };
|
|
400
425
|
}, e;
|
|
401
426
|
}
|
|
402
427
|
}
|
|
403
|
-
const
|
|
404
|
-
function
|
|
428
|
+
const be = () => new C(), ve = () => new O(), ye = (o) => new j(o);
|
|
429
|
+
function ce(o) {
|
|
405
430
|
return J((t) => {
|
|
406
|
-
const s = [], e = () => s.forEach((
|
|
431
|
+
const s = [], e = () => s.forEach((r) => r());
|
|
407
432
|
return o(({
|
|
408
|
-
effect:
|
|
409
|
-
mode:
|
|
410
|
-
onClickOutside:
|
|
411
|
-
onEscape:
|
|
412
|
-
content:
|
|
433
|
+
effect: r = "opaque",
|
|
434
|
+
mode: a = "capturing",
|
|
435
|
+
onClickOutside: u,
|
|
436
|
+
onEscape: m,
|
|
437
|
+
content: f,
|
|
413
438
|
container: p = "body"
|
|
414
439
|
}) => {
|
|
415
440
|
p === "body" && (t = t.makePortal("body"));
|
|
@@ -419,132 +444,132 @@ function re(o) {
|
|
|
419
444
|
}, b = () => {
|
|
420
445
|
};
|
|
421
446
|
const h = (E) => {
|
|
422
|
-
E.key === "Escape" && (
|
|
447
|
+
E.key === "Escape" && (m?.(), c.close());
|
|
423
448
|
}, y = () => {
|
|
424
|
-
|
|
425
|
-
},
|
|
449
|
+
u?.(), c.close();
|
|
450
|
+
}, L = (E) => {
|
|
426
451
|
v(), b(), E === "capturing" ? (document.addEventListener("keydown", h), v = () => document.removeEventListener("keydown", h), t.element.addEventListener("mousedown", y), b = () => t.element.removeEventListener("mousedown", y)) : (v = () => {
|
|
427
452
|
}, b = () => {
|
|
428
453
|
});
|
|
429
|
-
}, l = U.on(
|
|
454
|
+
}, l = U.on(a, L);
|
|
430
455
|
s.push(l), s.push(() => {
|
|
431
456
|
c.dispose(), v(), b();
|
|
432
457
|
});
|
|
433
|
-
const
|
|
458
|
+
const T = Q((() => {
|
|
434
459
|
const E = /* @__PURE__ */ new Set();
|
|
435
|
-
for (const
|
|
460
|
+
for (const d of t.element.querySelectorAll(
|
|
436
461
|
":scope > :not([data-overlay])"
|
|
437
462
|
))
|
|
438
|
-
|
|
463
|
+
d.hasAttribute("inert") ? E.add(d) : d.setAttribute("inert", "");
|
|
439
464
|
return s.push(() => {
|
|
440
|
-
for (const
|
|
465
|
+
for (const d of t.element.querySelectorAll(
|
|
441
466
|
":scope > :not([data-overlay])"
|
|
442
467
|
))
|
|
443
|
-
E.has(
|
|
468
|
+
E.has(d) || d.removeAttribute("inert");
|
|
444
469
|
E.clear();
|
|
445
470
|
}), document.activeElement?.blur?.(), k.div(
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
471
|
+
D((d) => c.setElement(d)),
|
|
472
|
+
S.status(c.status.map(String)),
|
|
473
|
+
S.overlay("true"),
|
|
449
474
|
g.class(
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
475
|
+
w(
|
|
476
|
+
r ?? "opaque",
|
|
477
|
+
a
|
|
453
478
|
)(
|
|
454
|
-
(
|
|
479
|
+
(d, x) => `bc-overlay bc-overlay--effect-${d} bc-overlay--mode-${x}`
|
|
455
480
|
)
|
|
456
481
|
),
|
|
457
|
-
|
|
482
|
+
f
|
|
458
483
|
);
|
|
459
484
|
})(), t.element, {
|
|
460
485
|
disposeWithParent: !0,
|
|
461
486
|
clear: !1,
|
|
462
487
|
providers: t.providers
|
|
463
488
|
});
|
|
464
|
-
s.push(
|
|
489
|
+
s.push(T), $(() => c.open());
|
|
465
490
|
}, e);
|
|
466
491
|
});
|
|
467
492
|
}
|
|
468
|
-
function
|
|
493
|
+
function le(o, t) {
|
|
469
494
|
const {
|
|
470
495
|
size: s = "md",
|
|
471
496
|
dismissable: e = !0,
|
|
472
497
|
showCloseButton: n = !0,
|
|
473
|
-
onClose:
|
|
474
|
-
overlayEffect:
|
|
475
|
-
container:
|
|
476
|
-
position:
|
|
498
|
+
onClose: r,
|
|
499
|
+
overlayEffect: a = "opaque",
|
|
500
|
+
container: u = "body",
|
|
501
|
+
position: m = "center"
|
|
477
502
|
} = o;
|
|
478
|
-
return
|
|
503
|
+
return ce((f, p) => {
|
|
479
504
|
let c = () => {
|
|
480
505
|
};
|
|
481
506
|
return t((h) => {
|
|
482
507
|
c = p;
|
|
483
|
-
const y =
|
|
484
|
-
U.on(e, (
|
|
485
|
-
y.set(
|
|
508
|
+
const y = R("capturing");
|
|
509
|
+
U.on(e, (d) => {
|
|
510
|
+
y.set(d ? "capturing" : "non-capturing");
|
|
486
511
|
});
|
|
487
|
-
const
|
|
512
|
+
const L = w(
|
|
488
513
|
h.header != null,
|
|
489
514
|
n
|
|
490
|
-
)((
|
|
515
|
+
)((d, x) => d || x), l = Y("modal"), i = `${l}-header`, T = `${l}-body`, E = k.div(
|
|
491
516
|
g.class(
|
|
492
|
-
|
|
517
|
+
w(
|
|
493
518
|
s,
|
|
494
|
-
|
|
519
|
+
m
|
|
495
520
|
)(
|
|
496
|
-
(
|
|
521
|
+
(d, x) => `bc-modal bc-modal--size-${d} bc-modal--container-${u} bc-modal--position-${x}`
|
|
497
522
|
)
|
|
498
523
|
),
|
|
499
524
|
// Essential ARIA attributes for modal dialog
|
|
500
525
|
g.role("dialog"),
|
|
501
|
-
|
|
502
|
-
...h.header ? [
|
|
503
|
-
|
|
526
|
+
F.modal(!0),
|
|
527
|
+
...h.header ? [F.labelledby(i)] : [],
|
|
528
|
+
F.describedby(T),
|
|
504
529
|
g.tabindex(-1),
|
|
505
530
|
// Make modal focusable for initial focus
|
|
506
531
|
g.id(l),
|
|
507
|
-
|
|
532
|
+
S.focusTrap("true"),
|
|
508
533
|
// Mark as focus trap container
|
|
509
|
-
X.mousedown((
|
|
534
|
+
X.mousedown((d) => d.stopPropagation()),
|
|
510
535
|
// Prevent overlay click-outside when clicking modal content
|
|
511
536
|
// Focus trap implementation
|
|
512
|
-
|
|
537
|
+
M({
|
|
513
538
|
escapeDeactivates: !1,
|
|
514
539
|
// Let Overlay handle escape key
|
|
515
540
|
initialFocus: () => {
|
|
516
|
-
const
|
|
517
|
-
if (!
|
|
518
|
-
const
|
|
541
|
+
const d = document.getElementById(l);
|
|
542
|
+
if (!d) return null;
|
|
543
|
+
const x = d.querySelector(
|
|
519
544
|
'[aria-label="Close modal"]'
|
|
520
545
|
);
|
|
521
|
-
if (
|
|
522
|
-
const
|
|
546
|
+
if (x) return x;
|
|
547
|
+
const q = d.querySelector(
|
|
523
548
|
'button, input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
524
549
|
);
|
|
525
|
-
return
|
|
550
|
+
return q || d;
|
|
526
551
|
}
|
|
527
552
|
}),
|
|
528
553
|
// Modal content container
|
|
529
554
|
k.div(
|
|
530
555
|
g.class("bc-modal__content"),
|
|
531
556
|
// Header section
|
|
532
|
-
|
|
533
|
-
|
|
557
|
+
I(
|
|
558
|
+
L,
|
|
534
559
|
() => k.div(
|
|
535
560
|
g.class("bc-modal__header"),
|
|
536
561
|
k.div(
|
|
537
562
|
g.class("bc-modal__title"),
|
|
538
|
-
...h.header ? [g.id(
|
|
563
|
+
...h.header ? [g.id(i)] : [],
|
|
539
564
|
h.header
|
|
540
565
|
),
|
|
541
|
-
|
|
566
|
+
I(
|
|
542
567
|
n,
|
|
543
568
|
() => H(
|
|
544
569
|
K,
|
|
545
|
-
(
|
|
570
|
+
(d) => Z({
|
|
546
571
|
size: "sm",
|
|
547
|
-
label:
|
|
572
|
+
label: d.$.closeModal,
|
|
548
573
|
onClick: () => {
|
|
549
574
|
c(), p();
|
|
550
575
|
}
|
|
@@ -554,21 +579,21 @@ function ie(o, t) {
|
|
|
554
579
|
)
|
|
555
580
|
),
|
|
556
581
|
// Body section
|
|
557
|
-
k.div(g.class("bc-modal__body"), g.id(
|
|
582
|
+
k.div(g.class("bc-modal__body"), g.id(T), h.body),
|
|
558
583
|
// Footer section
|
|
559
584
|
h.footer && k.div(g.class("bc-modal__footer"), h.footer)
|
|
560
585
|
)
|
|
561
586
|
);
|
|
562
|
-
|
|
587
|
+
f({
|
|
563
588
|
mode: y,
|
|
564
|
-
effect:
|
|
565
|
-
container:
|
|
566
|
-
content: E,
|
|
589
|
+
effect: a ?? "opaque",
|
|
590
|
+
container: u,
|
|
591
|
+
content: B(V(y, L), E),
|
|
567
592
|
onClickOutside: () => {
|
|
568
|
-
|
|
593
|
+
r?.(), p();
|
|
569
594
|
},
|
|
570
595
|
onEscape: () => {
|
|
571
|
-
|
|
596
|
+
r?.(), p();
|
|
572
597
|
}
|
|
573
598
|
});
|
|
574
599
|
}, () => {
|
|
@@ -576,58 +601,58 @@ function ie(o, t) {
|
|
|
576
601
|
});
|
|
577
602
|
});
|
|
578
603
|
}
|
|
579
|
-
function
|
|
580
|
-
const { confirmText: s, cancelText: e, onConfirm: n, onCancel:
|
|
604
|
+
function Ee(o, t) {
|
|
605
|
+
const { confirmText: s, cancelText: e, onConfirm: n, onCancel: r, ...a } = o;
|
|
581
606
|
return H(
|
|
582
607
|
K,
|
|
583
|
-
(
|
|
608
|
+
(u) => le({ showCloseButton: !1, ...a }, (m, f) => {
|
|
584
609
|
const p = () => {
|
|
585
|
-
n?.(),
|
|
610
|
+
n?.(), f();
|
|
586
611
|
}, c = () => {
|
|
587
|
-
|
|
612
|
+
r?.(), f();
|
|
588
613
|
};
|
|
589
614
|
return t((b) => {
|
|
590
|
-
|
|
615
|
+
m({
|
|
591
616
|
body: b,
|
|
592
|
-
footer:
|
|
617
|
+
footer: B(
|
|
593
618
|
g.class("bc-modal__actions"),
|
|
594
|
-
|
|
619
|
+
W(
|
|
595
620
|
{
|
|
596
621
|
variant: "outline",
|
|
597
622
|
onClick: c
|
|
598
623
|
},
|
|
599
|
-
|
|
624
|
+
_(e, u.$.cancel)
|
|
600
625
|
),
|
|
601
|
-
|
|
626
|
+
W(
|
|
602
627
|
{
|
|
603
628
|
color: "primary",
|
|
604
629
|
variant: "filled",
|
|
605
630
|
onClick: p
|
|
606
631
|
},
|
|
607
|
-
|
|
632
|
+
_(s, u.$.confirm)
|
|
608
633
|
)
|
|
609
634
|
)
|
|
610
635
|
});
|
|
611
|
-
},
|
|
636
|
+
}, f);
|
|
612
637
|
})
|
|
613
638
|
);
|
|
614
639
|
}
|
|
615
640
|
export {
|
|
616
|
-
|
|
617
|
-
B,
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
641
|
+
oe as A,
|
|
642
|
+
O as B,
|
|
643
|
+
Ee as C,
|
|
644
|
+
M as F,
|
|
645
|
+
le as M,
|
|
646
|
+
ce as O,
|
|
647
|
+
C as S,
|
|
648
|
+
ge as a,
|
|
649
|
+
ve as b,
|
|
650
|
+
j as c,
|
|
651
|
+
re as d,
|
|
652
|
+
pe as e,
|
|
628
653
|
N as f,
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
654
|
+
he as g,
|
|
655
|
+
ye as o,
|
|
656
|
+
be as s,
|
|
632
657
|
G as u
|
|
633
658
|
};
|