@webority/ui-elements 0.34.0 → 0.35.1
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/WuiAutocomplete-ByxnwJNQ.js +283 -0
- package/dist/WuiCommandPalette-CtZ04JxZ.js +130 -0
- package/dist/WuiConsentBanner-oVe-jxCO.js +399 -0
- package/dist/WuiContextMenu-Bx_U2X3t.js +211 -0
- package/dist/WuiCountrySelect-CUAwKnL9.js +28 -0
- package/dist/WuiDatePicker-DkNbc-z7.js +325 -0
- package/dist/WuiDateRange-BocnVO6L.js +233 -0
- package/dist/WuiDock-BSDY9g8Q.js +57 -0
- package/dist/WuiImageCrop-1yaAONTk.js +462 -0
- package/dist/WuiMultiSelect-BrCGRNCt.js +416 -0
- package/dist/WuiOtp-D8-4Pqil.js +128 -0
- package/dist/WuiPhone-BvbhiP2r.js +731 -0
- package/dist/WuiSelect-BXrpiuXG.js +214 -0
- package/dist/WuiSlider-BcU0psYf.js +256 -0
- package/dist/WuiSortable-JjJqstSU.js +280 -0
- package/dist/WuiTagInput-D1ay3OcL.js +158 -0
- package/dist/WuiTimePicker-C7n-VFGt.js +370 -0
- package/dist/WuiTour-R5O9l--J.js +205 -0
- package/dist/WuiTree-Ds-8tNgs.js +393 -0
- package/dist/WuiWizardStep-BU5w9_Ds.js +221 -0
- package/dist/anchorOverlay-DluGZ8ef.js +23 -0
- package/dist/calendarMath-BAF2Jkg_.js +42 -0
- package/dist/countries-B-M_LTgS.js +1234 -0
- package/dist/elementBase-Bg1xpvup.js +9 -0
- package/dist/elements/autocomplete.js +6 -0
- package/dist/elements/command-palette.js +6 -0
- package/dist/elements/consent-banner.js +6 -0
- package/dist/elements/context-menu.js +6 -0
- package/dist/elements/country-select.js +6 -0
- package/dist/elements/date-range.js +6 -0
- package/dist/elements/datepicker.js +6 -0
- package/dist/elements/dock.js +6 -0
- package/dist/elements/image-crop.js +6 -0
- package/dist/elements/kanban.js +6 -0
- package/dist/elements/multiselect.js +6 -0
- package/dist/elements/otp.js +6 -0
- package/dist/elements/phone.js +6 -0
- package/dist/elements/select.js +6 -0
- package/dist/elements/slider.js +6 -0
- package/dist/elements/sortable.js +6 -0
- package/dist/elements/status-icon.js +6 -0
- package/dist/elements/taginput.js +6 -0
- package/dist/elements/timepicker.js +6 -0
- package/dist/elements/tour.js +6 -0
- package/dist/elements/tree.js +6 -0
- package/dist/elements/wizard.js +5 -0
- package/dist/formMirror-jGf5M4gk.js +29 -0
- package/dist/formatters-DusKbTyV.js +138 -0
- package/dist/helpers.js +5 -0
- package/dist/iconGlyphs.g-Cpg1BUHm.js +215 -0
- package/dist/kanban-BeVAItir.js +972 -0
- package/dist/listboxKeyNav-zts_8d5e.js +36 -0
- package/dist/optionLabel-Dn-I7zyp.js +16 -0
- package/dist/statusIcons-C3zjycpa.js +37 -0
- package/dist/textMatch-DEUjlkdy.js +27 -0
- package/dist/themeTransition-BpCuMnjk.js +589 -0
- package/dist/tokenCommit-VWz-2jEf.js +20 -0
- package/dist/ui-elements.global.js +118 -129
- package/dist/ui-elements.js +253 -8864
- package/dist/ui-phone.global.js +14 -0
- package/dist/wuiHttp-m0yQadwQ.js +117 -0
- package/package.json +28 -3
|
@@ -0,0 +1,589 @@
|
|
|
1
|
+
//#region src/avatarPicker.js
|
|
2
|
+
var e = "image/jpeg,image/png,image/webp,image/heic,image/heif,.heic,.heif", t = 10, n = 512, r = "image/webp", i = [96, 48], a = {
|
|
3
|
+
dialogTitle: "Edit photo",
|
|
4
|
+
dialogSubtitle: "Drag to position the photo, then zoom or rotate it.",
|
|
5
|
+
save: "Save photo",
|
|
6
|
+
cancel: "Cancel",
|
|
7
|
+
choose: "Upload photo",
|
|
8
|
+
change: "Change photo",
|
|
9
|
+
camera: "Take photo",
|
|
10
|
+
remove: "Remove photo",
|
|
11
|
+
unreadable: "That photo could not be opened. Choose a JPG, PNG or WebP image.",
|
|
12
|
+
heicUnreadable: "This browser cannot open HEIC photos. Choose a JPG, PNG or WebP image instead.",
|
|
13
|
+
cropFailed: "That photo could not be saved. Try again, or choose another one."
|
|
14
|
+
};
|
|
15
|
+
function o(e) {
|
|
16
|
+
if (!e) return !1;
|
|
17
|
+
let t = String(e.type || "").toLowerCase();
|
|
18
|
+
return t === "image/heic" || t === "image/heif" || /\.hei[cf]$/i.test(String(e.name || ""));
|
|
19
|
+
}
|
|
20
|
+
function s(e) {
|
|
21
|
+
return o(e) ? a.heicUnreadable : a.unreadable;
|
|
22
|
+
}
|
|
23
|
+
function c(e, t) {
|
|
24
|
+
let n = Number(t);
|
|
25
|
+
return {
|
|
26
|
+
name: e?.name || "photo",
|
|
27
|
+
type: r,
|
|
28
|
+
size: Number.isInteger(n) && n > 0 ? n : 512
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/copyText.js
|
|
33
|
+
var l = 2e3;
|
|
34
|
+
async function u(e) {
|
|
35
|
+
try {
|
|
36
|
+
if (navigator.clipboard?.writeText) return await navigator.clipboard.writeText(e), !0;
|
|
37
|
+
} catch {}
|
|
38
|
+
try {
|
|
39
|
+
let t = document.createElement("textarea");
|
|
40
|
+
t.value = e, t.style.position = "fixed", t.style.top = "0", t.style.left = "0", t.style.opacity = "0", document.body.appendChild(t), t.select();
|
|
41
|
+
let n = document.execCommand("copy");
|
|
42
|
+
return document.body.removeChild(t), !!n;
|
|
43
|
+
} catch {
|
|
44
|
+
return !1;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/fileValidation.js
|
|
49
|
+
var d = "image/png,image/jpeg,image/webp", f = 5, p = {
|
|
50
|
+
"image/png": [".png"],
|
|
51
|
+
"image/jpeg": [".jpg", ".jpeg"],
|
|
52
|
+
"image/webp": [".webp"],
|
|
53
|
+
"image/gif": [".gif"],
|
|
54
|
+
"image/svg+xml": [".svg"],
|
|
55
|
+
"image/heic": [".heic"],
|
|
56
|
+
"image/heif": [".heif"],
|
|
57
|
+
"application/pdf": [".pdf"]
|
|
58
|
+
}, m = {
|
|
59
|
+
"image/png": "PNG",
|
|
60
|
+
"image/jpeg": "JPG",
|
|
61
|
+
"image/webp": "WEBP",
|
|
62
|
+
"image/gif": "GIF",
|
|
63
|
+
"image/svg+xml": "SVG",
|
|
64
|
+
"image/heic": "HEIC",
|
|
65
|
+
"image/heif": "HEIC",
|
|
66
|
+
"application/pdf": "PDF",
|
|
67
|
+
".png": "PNG",
|
|
68
|
+
".jpg": "JPG",
|
|
69
|
+
".jpeg": "JPG",
|
|
70
|
+
".webp": "WEBP",
|
|
71
|
+
".gif": "GIF",
|
|
72
|
+
".svg": "SVG",
|
|
73
|
+
".heic": "HEIC",
|
|
74
|
+
".heif": "HEIC",
|
|
75
|
+
".pdf": "PDF"
|
|
76
|
+
}, h = (e) => String(e || "").split(",").map((e) => e.trim().toLowerCase()).filter(Boolean), g = [
|
|
77
|
+
".png",
|
|
78
|
+
".jpg",
|
|
79
|
+
".jpeg",
|
|
80
|
+
".webp",
|
|
81
|
+
".gif",
|
|
82
|
+
".svg",
|
|
83
|
+
".bmp",
|
|
84
|
+
".avif",
|
|
85
|
+
".heic",
|
|
86
|
+
".heif"
|
|
87
|
+
];
|
|
88
|
+
function _(e) {
|
|
89
|
+
if (!e) return !1;
|
|
90
|
+
let t = typeof e == "object" && e.type ? String(e.type).toLowerCase() : "";
|
|
91
|
+
if (t) return t.startsWith("image/");
|
|
92
|
+
let n = typeof e == "string" ? e : e.name || e.url || "", r = String(n).toLowerCase();
|
|
93
|
+
return g.some((e) => r.endsWith(e));
|
|
94
|
+
}
|
|
95
|
+
function v(e) {
|
|
96
|
+
if (!e) return !1;
|
|
97
|
+
let t = typeof e == "object" && e.type ? String(e.type).toLowerCase() : "";
|
|
98
|
+
if (t) return t === "application/pdf";
|
|
99
|
+
let n = typeof e == "string" ? e : e.name || e.url || "";
|
|
100
|
+
return String(n).toLowerCase().split(/[?#]/)[0].endsWith(".pdf");
|
|
101
|
+
}
|
|
102
|
+
function y(e) {
|
|
103
|
+
let t = h(e);
|
|
104
|
+
return t.length ? t.every((e) => e.startsWith(".") ? g.includes(e) : e === "image/*" || e.startsWith("image/")) : !1;
|
|
105
|
+
}
|
|
106
|
+
function b(e) {
|
|
107
|
+
let t = [];
|
|
108
|
+
for (let n of h(e)) {
|
|
109
|
+
let e = m[n] || (n.startsWith(".") ? n.slice(1).toUpperCase() : n.toUpperCase());
|
|
110
|
+
t.includes(e) || t.push(e);
|
|
111
|
+
}
|
|
112
|
+
return t.length <= 1 ? t[0] || "supported" : `${t.slice(0, -1).join(", ")} or ${t[t.length - 1]}`;
|
|
113
|
+
}
|
|
114
|
+
function x(e, t) {
|
|
115
|
+
let n = h(t);
|
|
116
|
+
if (!n.length) return !0;
|
|
117
|
+
let r = (e.type || "").toLowerCase(), i = (e.name || "").toLowerCase();
|
|
118
|
+
return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (p[e] || []).some((e) => i.endsWith(e)));
|
|
119
|
+
}
|
|
120
|
+
function S(e, t = {}) {
|
|
121
|
+
if (!e) return null;
|
|
122
|
+
let n = t.accept === void 0 ? d : t.accept, r = t.maxSizeMb === void 0 ? 5 : t.maxSizeMb;
|
|
123
|
+
return x(e, n) ? r > 0 && e.size > r * 1024 * 1024 ? `Keep the file under ${r} MB.` : null : `Choose a ${b(n)} file.`;
|
|
124
|
+
}
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/inputMask.js
|
|
127
|
+
var C = /[0-9]/, w = {
|
|
128
|
+
9: C,
|
|
129
|
+
A: /[A-Za-z]/,
|
|
130
|
+
"*": /[0-9A-Za-z]/
|
|
131
|
+
}, T = /[9A*]/, E = /* @__PURE__ */ new Set([
|
|
132
|
+
"text",
|
|
133
|
+
"tel",
|
|
134
|
+
"search",
|
|
135
|
+
"url",
|
|
136
|
+
"password"
|
|
137
|
+
]), D = (e) => {
|
|
138
|
+
let t = e.replace(/\D/g, "");
|
|
139
|
+
return t.length === 12 && t.startsWith("91") ? t.slice(2) : t.length === 11 && t.startsWith("0") ? t.slice(1) : e;
|
|
140
|
+
}, O = (e) => {
|
|
141
|
+
let t = Number(e.slice(0, 2)), n = Number(e.slice(2, 4)), r = Number(e.slice(4, 8));
|
|
142
|
+
if (r < 1) return !1;
|
|
143
|
+
let i = new Date(Date.UTC(r, n - 1, t));
|
|
144
|
+
return i.getUTCFullYear() === r && i.getUTCMonth() === n - 1 && i.getUTCDate() === t;
|
|
145
|
+
}, k = (e) => e.length <= 3 ? e : `${e.slice(0, -3).replace(/\B(?=(\d{2})+(?!\d))/g, ",")},${e.slice(-3)}`, A = (e) => {
|
|
146
|
+
let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());
|
|
147
|
+
return t ? `${t[3]}-${t[2]}-${t[1]}` : e;
|
|
148
|
+
};
|
|
149
|
+
function j(e, { upper: t = !1, normalize: n, valid: r, post: i = (e) => e, message: a = "Enter the full value" } = {}) {
|
|
150
|
+
let o = [...e].map((e) => w[e] ? { re: w[e] } : { lit: e }), s = o.filter((e) => e.re).length;
|
|
151
|
+
return {
|
|
152
|
+
inputMode: o.every((e) => !e.re || e.re === C) ? "numeric" : "text",
|
|
153
|
+
normalize: n,
|
|
154
|
+
post: i,
|
|
155
|
+
message: a,
|
|
156
|
+
extract(e) {
|
|
157
|
+
let n = "", r = 0;
|
|
158
|
+
for (let i of e) {
|
|
159
|
+
for (; r < o.length && o[r].lit !== void 0 && o[r].lit !== i;) r++;
|
|
160
|
+
if (r >= o.length) break;
|
|
161
|
+
let e = o[r];
|
|
162
|
+
e.lit === void 0 ? e.re.test(i) && (n += t ? i.toUpperCase() : i, r++) : r++;
|
|
163
|
+
}
|
|
164
|
+
return n;
|
|
165
|
+
},
|
|
166
|
+
layout(e) {
|
|
167
|
+
let t = "", n = [], r = 0;
|
|
168
|
+
for (let i = 0; i < o.length && r < e.length; i++) o[i].lit === void 0 ? (t += e[r++], n.push(!0)) : (t += o[i].lit, n.push(!1));
|
|
169
|
+
return {
|
|
170
|
+
text: t,
|
|
171
|
+
isRaw: n
|
|
172
|
+
};
|
|
173
|
+
},
|
|
174
|
+
isValid: (e) => e.length === s && (!r || r(e))
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
function M() {
|
|
178
|
+
return {
|
|
179
|
+
inputMode: "decimal",
|
|
180
|
+
post: (e) => e,
|
|
181
|
+
message: "Enter a valid amount",
|
|
182
|
+
extract(e) {
|
|
183
|
+
let t = "", n = !1, r = 0;
|
|
184
|
+
for (let i of e) C.test(i) ? n ? r < 2 && (t += i, r++) : t += i : i === "." && !n && (n = !0, t += i);
|
|
185
|
+
return t.startsWith(".") && (t = `0${t}`), t.replace(/^0+(?=\d)/, "");
|
|
186
|
+
},
|
|
187
|
+
layout(e) {
|
|
188
|
+
let [t, n] = e.split("."), r = k(t) + (e.includes(".") ? `.${n}` : "");
|
|
189
|
+
return {
|
|
190
|
+
text: r,
|
|
191
|
+
isRaw: [...r].map((e) => e !== ",")
|
|
192
|
+
};
|
|
193
|
+
},
|
|
194
|
+
isValid: (e) => /^\d+(\.\d{1,2})?$/.test(e)
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
var N = {
|
|
198
|
+
"phone-in": () => j("99999 99999", {
|
|
199
|
+
normalize: D,
|
|
200
|
+
valid: (e) => /^[6-9]/.test(e),
|
|
201
|
+
message: "Enter a 10-digit mobile number"
|
|
202
|
+
}),
|
|
203
|
+
pan: () => j("AAAAA9999A", {
|
|
204
|
+
upper: !0,
|
|
205
|
+
valid: (e) => /^[A-Z]{5}\d{4}[A-Z]$/.test(e),
|
|
206
|
+
message: "Enter a valid PAN"
|
|
207
|
+
}),
|
|
208
|
+
gstin: () => j("99AAAAA9999A***", {
|
|
209
|
+
upper: !0,
|
|
210
|
+
valid: (e) => /^\d{2}[A-Z]{5}\d{4}[A-Z][1-9A-Z]Z[0-9A-Z]$/.test(e),
|
|
211
|
+
message: "Enter a valid GSTIN"
|
|
212
|
+
}),
|
|
213
|
+
aadhaar: () => j("9999 9999 9999", {
|
|
214
|
+
valid: (e) => /^[2-9]/.test(e),
|
|
215
|
+
message: "Enter a valid 12-digit Aadhaar number"
|
|
216
|
+
}),
|
|
217
|
+
ifsc: () => j("AAAA*******", {
|
|
218
|
+
upper: !0,
|
|
219
|
+
valid: (e) => /^[A-Z]{4}0[A-Z0-9]{6}$/.test(e),
|
|
220
|
+
message: "Enter a valid IFSC"
|
|
221
|
+
}),
|
|
222
|
+
"pin-code": () => j("999999", {
|
|
223
|
+
valid: (e) => /^[1-9]/.test(e),
|
|
224
|
+
message: "Enter a valid 6-digit PIN code"
|
|
225
|
+
}),
|
|
226
|
+
date: () => j("99-99-9999", {
|
|
227
|
+
normalize: A,
|
|
228
|
+
valid: O,
|
|
229
|
+
post: (e, t) => e.length === 8 && O(e) ? `${e.slice(4)}-${e.slice(2, 4)}-${e.slice(0, 2)}` : t,
|
|
230
|
+
message: "Enter a valid date as DD-MM-YYYY"
|
|
231
|
+
}),
|
|
232
|
+
amount: M
|
|
233
|
+
}, ee = Object.keys(N), te = (e) => {
|
|
234
|
+
let t = String(e).toLowerCase();
|
|
235
|
+
return Object.hasOwn(N, t) ? t : void 0;
|
|
236
|
+
}, ne = (e) => T.test(String(e)) && te(e) === void 0, P = /* @__PURE__ */ new Map();
|
|
237
|
+
function F(e) {
|
|
238
|
+
if (e == null || e === "") return null;
|
|
239
|
+
let t = String(e);
|
|
240
|
+
return P.has(t) || (ne(t) ? P.set(t, j(t)) : P.set(t, Object.hasOwn(N, t) ? N[t]() : null)), P.get(t);
|
|
241
|
+
}
|
|
242
|
+
var I = (e, t) => e.normalize ? e.normalize(t) : t;
|
|
243
|
+
function re(e, t) {
|
|
244
|
+
let n = F(e);
|
|
245
|
+
return n ? n.extract(I(n, String(t ?? ""))) : String(t ?? "");
|
|
246
|
+
}
|
|
247
|
+
function ie(e, t) {
|
|
248
|
+
let n = F(e);
|
|
249
|
+
if (!n) return String(t ?? "");
|
|
250
|
+
let r = n.extract(I(n, String(t ?? "")));
|
|
251
|
+
return n.post(r, n.layout(r).text);
|
|
252
|
+
}
|
|
253
|
+
function ae(e, t) {
|
|
254
|
+
let n = F(e);
|
|
255
|
+
return n ? n.layout(n.extract(I(n, String(t ?? "")))).text : String(t ?? "");
|
|
256
|
+
}
|
|
257
|
+
var oe = (e, t) => {
|
|
258
|
+
if (t <= 0) return 0;
|
|
259
|
+
let n = 0;
|
|
260
|
+
for (let r = 0; r < e.length; r++) if (e[r] && ++n === t) return r + 1;
|
|
261
|
+
return e.length;
|
|
262
|
+
}, L = /* @__PURE__ */ new WeakMap(), se = (e) => L.get(e)?.(), ce = /* @__PURE__ */ new WeakMap();
|
|
263
|
+
function le(e, t, n, r) {
|
|
264
|
+
let i = e.getAll(t), a = ce.get(e);
|
|
265
|
+
a || ce.set(e, a = /* @__PURE__ */ new Set());
|
|
266
|
+
let o = i.findIndex((e, r) => e === n && !a.has(`${t}\u0000${r}`));
|
|
267
|
+
if (!(o < 0)) {
|
|
268
|
+
if (a.add(`${t}\u0000${o}`), i[o] = r, i.length === 1) {
|
|
269
|
+
e.set(t, r);
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
e.delete(t);
|
|
273
|
+
for (let n of i) e.append(t, n);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function ue(e) {
|
|
277
|
+
let t = null, n = null, r = !1, i = (t, n) => n === null ? e.removeAttribute(t) : e.setAttribute(t, n), a, o, s = () => {
|
|
278
|
+
t?.remove(), t = null, n && (n.hidden = !1), n = null, r && e.classList.remove("error"), r = !1, a !== void 0 && i("aria-invalid", a), o !== void 0 && i("aria-describedby", o), a = void 0, o = void 0;
|
|
279
|
+
};
|
|
280
|
+
return (i) => {
|
|
281
|
+
if (!i) {
|
|
282
|
+
s();
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
let c = e.closest(".field"), l = c?.querySelector(".field-error");
|
|
286
|
+
l && l !== t && l.textContent.trim() || (t || (r = !e.classList.contains("error"), e.classList.add("error"), a = e.getAttribute("aria-invalid"), o = e.getAttribute("aria-describedby"), c && (t = document.createElement("div"), t.className = "field-error", e.id && (t.id = `${e.id}-error`), n = c.querySelector(".field-hint"), n && (n.hidden = !0), c.insertBefore(t, [...c.children].find((e) => e.classList.contains("field-count")) ?? null), t.id && e.setAttribute("aria-describedby", t.id)), e.setAttribute("aria-invalid", "true")), t && (t.textContent = i));
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
function R(e, { mask: t, postFormatted: n = !1, onChange: r, onInvalidChange: i } = {}) {
|
|
290
|
+
let a = F(t);
|
|
291
|
+
if (!a || !E.has(e.type)) return () => {};
|
|
292
|
+
let o = Object.getPrototypeOf(e), s = Object.getOwnPropertyDescriptor(o, "value").set, c = !e.hasAttribute("inputmode");
|
|
293
|
+
c && e.setAttribute("inputmode", a.inputMode);
|
|
294
|
+
let l = i ?? ue(e), u = null, d = !1, f = !1, p = !1, m = "", h = "", g, _ = () => {
|
|
295
|
+
let e = p ? m : "";
|
|
296
|
+
e !== h && (h = e, l(h));
|
|
297
|
+
}, v = (t, n, i) => {
|
|
298
|
+
let o = a.extract(t.slice(0, n)).length, c = a.extract(t), { text: l, isRaw: d } = a.layout(c);
|
|
299
|
+
if (e.value !== l && (s.call(e, l), document.activeElement === e && E.has(e.type))) {
|
|
300
|
+
let t = oe(d, o);
|
|
301
|
+
e.setSelectionRange(t, t);
|
|
302
|
+
}
|
|
303
|
+
e.dataset.maskRaw = c, m = c && !a.isValid(c) ? a.message : "", e.setCustomValidity(m), _(), i && c !== u && r?.(c, l), u = c;
|
|
304
|
+
}, y = Object.getOwnPropertyDescriptor(e, "value"), b = y ?? Object.getOwnPropertyDescriptor(o, "value");
|
|
305
|
+
Object.defineProperty(e, "value", {
|
|
306
|
+
configurable: !0,
|
|
307
|
+
enumerable: b.enumerable,
|
|
308
|
+
get: () => b.get.call(e),
|
|
309
|
+
set: (t) => {
|
|
310
|
+
if (b.set.call(e, t), f) return;
|
|
311
|
+
let n = I(a, e.value);
|
|
312
|
+
v(n, n.length, !0);
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
let x = () => {
|
|
316
|
+
d = !0, e.dispatchEvent(new Event("input", { bubbles: !0 })), d = !1;
|
|
317
|
+
}, S = (t) => {
|
|
318
|
+
if (d || f || t.isComposing) return;
|
|
319
|
+
let n = t.inputType === "insertText" && (t.data?.length ?? 0) <= 1 || t.inputType?.startsWith("delete") ? e.value : I(a, e.value);
|
|
320
|
+
v(n, e.selectionStart ?? n.length, !0);
|
|
321
|
+
}, C = () => {
|
|
322
|
+
f = !0;
|
|
323
|
+
}, w = () => {
|
|
324
|
+
f = !1;
|
|
325
|
+
let t = I(a, e.value);
|
|
326
|
+
v(t, e.selectionStart ?? t.length, !0), x();
|
|
327
|
+
}, T = (t) => {
|
|
328
|
+
let n = t.inputType === "deleteContentBackward";
|
|
329
|
+
if (!n && t.inputType !== "deleteContentForward" || t.isComposing) return;
|
|
330
|
+
let r = e.selectionStart;
|
|
331
|
+
if (r == null || r !== e.selectionEnd) return;
|
|
332
|
+
let { isRaw: i } = a.layout(a.extract(e.value)), o = n ? r - 1 : r;
|
|
333
|
+
for (; o >= 0 && o < i.length && !i[o];) o += n ? -1 : 1;
|
|
334
|
+
o !== (n ? r - 1 : r) && (t.preventDefault(), !(o < 0 || o >= i.length) && (v(e.value.slice(0, o) + e.value.slice(o + 1), n ? o : r, !0), x()));
|
|
335
|
+
}, D = (t) => {
|
|
336
|
+
if (e.readOnly || e.disabled) return;
|
|
337
|
+
let n = t.clipboardData?.getData("text");
|
|
338
|
+
if (n == null) return;
|
|
339
|
+
t.preventDefault();
|
|
340
|
+
let r = I(a, n), i = e.selectionStart ?? e.value.length, o = e.selectionEnd ?? i;
|
|
341
|
+
v(e.value.slice(0, i) + r + e.value.slice(o), i + r.length, !0), x();
|
|
342
|
+
}, O = () => {
|
|
343
|
+
let t = a.extract(e.value);
|
|
344
|
+
return a.post(t, a.layout(t).text);
|
|
345
|
+
}, k = () => {
|
|
346
|
+
p = !0, _();
|
|
347
|
+
};
|
|
348
|
+
e.addEventListener("input", S), e.addEventListener("beforeinput", T), e.addEventListener("paste", D), e.addEventListener("compositionstart", C), e.addEventListener("compositionend", w), e.addEventListener("blur", k), e.addEventListener("invalid", k);
|
|
349
|
+
let A = e.form, j = (t) => {
|
|
350
|
+
e.name && !e.disabled && le(t.formData, e.name, e.value, O());
|
|
351
|
+
}, M = () => {
|
|
352
|
+
clearTimeout(g), g = setTimeout(() => {
|
|
353
|
+
p = !1, v(I(a, e.value), e.value.length, !0);
|
|
354
|
+
}, 0);
|
|
355
|
+
};
|
|
356
|
+
n || (A?.addEventListener("formdata", j), L.set(e, O)), A?.addEventListener("reset", M), A?.addEventListener("submit", k);
|
|
357
|
+
let N = I(a, e.value);
|
|
358
|
+
return v(N, N.length, !1), () => {
|
|
359
|
+
clearTimeout(g), e.removeEventListener("input", S), e.removeEventListener("beforeinput", T), e.removeEventListener("paste", D), e.removeEventListener("compositionstart", C), e.removeEventListener("compositionend", w), e.removeEventListener("blur", k), e.removeEventListener("invalid", k), A?.removeEventListener("formdata", j), A?.removeEventListener("reset", M), A?.removeEventListener("submit", k), L.delete(e), y ? Object.defineProperty(e, "value", y) : delete e.value, p = !1, m = "", _(), e.setCustomValidity(""), delete e.dataset.maskRaw, c && e.removeAttribute("inputmode");
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
function de() {
|
|
363
|
+
let e = typeof window > "u" ? void 0 : window.jQuery?.validator?.prototype;
|
|
364
|
+
if (!e || e.wuiMaskHook) return;
|
|
365
|
+
let t = e.elementValue;
|
|
366
|
+
e.elementValue = function(e) {
|
|
367
|
+
let n = se(e);
|
|
368
|
+
return n === void 0 ? t.call(this, e) : n;
|
|
369
|
+
}, e.wuiMaskHook = !0;
|
|
370
|
+
}
|
|
371
|
+
var z = /* @__PURE__ */ new WeakMap(), B, V = (e) => {
|
|
372
|
+
z.has(e) || z.set(e, R(e, {
|
|
373
|
+
mask: e.dataset.appMask,
|
|
374
|
+
postFormatted: e.hasAttribute("data-mask-post-formatted")
|
|
375
|
+
}));
|
|
376
|
+
}, H = (e) => e.nodeType === 1 ? [...e.matches("input[data-app-mask]") ? [e] : [], ...e.querySelectorAll("input[data-app-mask]")] : [];
|
|
377
|
+
function fe() {
|
|
378
|
+
B || typeof MutationObserver > "u" || (B = new MutationObserver((e) => {
|
|
379
|
+
for (let t of e) {
|
|
380
|
+
for (let e of t.removedNodes) for (let t of H(e)) z.get(t)?.(), z.delete(t);
|
|
381
|
+
for (let e of t.addedNodes) for (let t of H(e)) V(t);
|
|
382
|
+
}
|
|
383
|
+
}), B.observe(document.documentElement, {
|
|
384
|
+
childList: !0,
|
|
385
|
+
subtree: !0
|
|
386
|
+
}));
|
|
387
|
+
}
|
|
388
|
+
function pe(e = document) {
|
|
389
|
+
de();
|
|
390
|
+
for (let t of e.querySelectorAll("input[data-app-mask]")) V(t);
|
|
391
|
+
e === document && fe();
|
|
392
|
+
}
|
|
393
|
+
//#endregion
|
|
394
|
+
//#region src/passwordRules.js
|
|
395
|
+
var U = {
|
|
396
|
+
minLength: 10,
|
|
397
|
+
uppercase: !0,
|
|
398
|
+
lowercase: !0,
|
|
399
|
+
digit: !0,
|
|
400
|
+
special: !0,
|
|
401
|
+
uniqueChars: 0,
|
|
402
|
+
customRules: []
|
|
403
|
+
}, me = "Password requirements";
|
|
404
|
+
function he(e) {
|
|
405
|
+
return e === !0 || e == null ? { ...U } : {
|
|
406
|
+
...U,
|
|
407
|
+
...e
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
function W(e) {
|
|
411
|
+
let t = he(e), n = [];
|
|
412
|
+
if (t.minLength > 0 && n.push({
|
|
413
|
+
key: "length",
|
|
414
|
+
label: `At least ${t.minLength} characters long`,
|
|
415
|
+
test: (e) => e.length >= t.minLength
|
|
416
|
+
}), t.uppercase && n.push({
|
|
417
|
+
key: "uppercase",
|
|
418
|
+
label: "At least one uppercase letter",
|
|
419
|
+
test: (e) => /[A-Z]/.test(e)
|
|
420
|
+
}), t.lowercase && n.push({
|
|
421
|
+
key: "lowercase",
|
|
422
|
+
label: "At least one lowercase letter",
|
|
423
|
+
test: (e) => /[a-z]/.test(e)
|
|
424
|
+
}), t.digit && n.push({
|
|
425
|
+
key: "digit",
|
|
426
|
+
label: "At least one digit",
|
|
427
|
+
test: (e) => /[0-9]/.test(e)
|
|
428
|
+
}), t.special && n.push({
|
|
429
|
+
key: "special",
|
|
430
|
+
label: "At least one special character",
|
|
431
|
+
test: (e) => /[^A-Za-z0-9]/.test(e)
|
|
432
|
+
}), t.uniqueChars > 0) {
|
|
433
|
+
let e = t.uniqueChars;
|
|
434
|
+
n.push({
|
|
435
|
+
key: "unique",
|
|
436
|
+
label: `At least ${e} unique character${e > 1 ? "s" : ""}`,
|
|
437
|
+
test: (t) => new Set(t).size >= e
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
for (let [e, r] of (t.customRules ?? []).entries()) {
|
|
441
|
+
let t = new RegExp(r.pattern);
|
|
442
|
+
n.push({
|
|
443
|
+
key: `custom-${e}`,
|
|
444
|
+
label: r.label,
|
|
445
|
+
test: (e) => t.test(e)
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
return n;
|
|
449
|
+
}
|
|
450
|
+
function G(e, t) {
|
|
451
|
+
let n = e == null ? "" : String(e);
|
|
452
|
+
return W(t).map((e) => ({
|
|
453
|
+
key: e.key,
|
|
454
|
+
label: e.label,
|
|
455
|
+
met: e.test(n)
|
|
456
|
+
}));
|
|
457
|
+
}
|
|
458
|
+
function ge(e, t) {
|
|
459
|
+
return G(e, t).every((e) => e.met);
|
|
460
|
+
}
|
|
461
|
+
//#endregion
|
|
462
|
+
//#region src/themeTransition.js
|
|
463
|
+
var K = [
|
|
464
|
+
"light",
|
|
465
|
+
"dark",
|
|
466
|
+
"auto"
|
|
467
|
+
], _e = [
|
|
468
|
+
"wave",
|
|
469
|
+
"circle",
|
|
470
|
+
"slide",
|
|
471
|
+
"blinds",
|
|
472
|
+
"fade",
|
|
473
|
+
"none"
|
|
474
|
+
], q = "wave", J = "theme", Y = {
|
|
475
|
+
wave: 1100,
|
|
476
|
+
circle: 700,
|
|
477
|
+
slide: 600,
|
|
478
|
+
blinds: 900,
|
|
479
|
+
fade: 350,
|
|
480
|
+
none: 0
|
|
481
|
+
}, X = "wui-theme-switching", ve = "wui:theme:change", ye = "wui-theme-toggle", be = "(prefers-color-scheme: dark)", xe = (e) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(e).matches, Se = (e) => K.includes(e);
|
|
482
|
+
function Ce(e) {
|
|
483
|
+
return e === "dark" || e === "auto" && xe(be) ? "dark" : "light";
|
|
484
|
+
}
|
|
485
|
+
function we(e = J) {
|
|
486
|
+
let t = null;
|
|
487
|
+
try {
|
|
488
|
+
t = window.localStorage.getItem(e);
|
|
489
|
+
} catch {}
|
|
490
|
+
return Se(t) ? t : "auto";
|
|
491
|
+
}
|
|
492
|
+
function Te(e, t = J) {
|
|
493
|
+
try {
|
|
494
|
+
window.localStorage.setItem(t, e);
|
|
495
|
+
} catch {}
|
|
496
|
+
}
|
|
497
|
+
function Ee(e) {
|
|
498
|
+
let t = document.documentElement, n = Ce(e);
|
|
499
|
+
t.setAttribute("data-theme", e), t.setAttribute("data-bs-theme", n), document.dispatchEvent(new CustomEvent(ve, { detail: {
|
|
500
|
+
mode: n,
|
|
501
|
+
preference: e
|
|
502
|
+
} }));
|
|
503
|
+
}
|
|
504
|
+
var De = "(function(k){var m;try{m=localStorage.getItem(k)}catch{}if(m!=='light'&&m!=='dark')m='auto';var r=document.documentElement,q=window.matchMedia?window.matchMedia('(prefers-color-scheme: dark)'):null;function s(){var t=r.getAttribute('data-theme');r.setAttribute('data-bs-theme',t==='auto'?(q&&q.matches?'dark':'light'):t)}r.setAttribute('data-theme',m);s();if(q&&q.addEventListener)q.addEventListener('change',function(){if(r.getAttribute('data-theme')==='auto')s()})})(";
|
|
505
|
+
function Oe(e = J) {
|
|
506
|
+
return `${De}${JSON.stringify(String(e)).replace(/</g, "\\u003c")})`;
|
|
507
|
+
}
|
|
508
|
+
function ke(e, { includeAuto: t = !1 } = {}) {
|
|
509
|
+
return e === "light" ? "dark" : e === "dark" && t ? "auto" : "light";
|
|
510
|
+
}
|
|
511
|
+
function Ae(e) {
|
|
512
|
+
if (typeof window > "u" || typeof window.matchMedia != "function") return () => {};
|
|
513
|
+
let t = window.matchMedia(be), n = () => e(t.matches ? "dark" : "light");
|
|
514
|
+
return t.addEventListener("change", n), () => t.removeEventListener("change", n);
|
|
515
|
+
}
|
|
516
|
+
var je = 60, Me = (e) => e < .5 ? 4 * e * e * e : 1 - (-2 * e + 2) ** 3 / 2, Z = (e) => e.toFixed(1), Q = (e, t) => `${Z(e)}px ${Z(t)}px`, Ne = {
|
|
517
|
+
amplitude: 22,
|
|
518
|
+
segments: 36,
|
|
519
|
+
cycles: 1.5,
|
|
520
|
+
ripples: 2
|
|
521
|
+
}, Pe = 6, Fe = (e, t, n, r, i) => {
|
|
522
|
+
let { amplitude: a, segments: o, cycles: s } = Ne, c = n * (t + 2 * a), l = i ? t + a - c : c - a, u = i ? t + 2 * a : -2 * a, d = [Q(0, u)];
|
|
523
|
+
for (let t = 0; t <= o; t++) {
|
|
524
|
+
let n = e * t / o, i = l + a * Math.sin(2 * Math.PI * s * t / o + r);
|
|
525
|
+
d.push(Q(n, i));
|
|
526
|
+
}
|
|
527
|
+
return d.push(Q(e, u)), `polygon(${d.join(", ")})`;
|
|
528
|
+
}, Ie = (e, t, n, r) => {
|
|
529
|
+
let i = t / Pe, a = [];
|
|
530
|
+
for (let t = 0; t < Pe; t++) {
|
|
531
|
+
let o = t * i, s = i * n, c = r ? o + i - s : o, l = r ? o + i : o + s;
|
|
532
|
+
a.push(Q(0, c), Q(e, c), Q(e, l), Q(0, l));
|
|
533
|
+
}
|
|
534
|
+
return `polygon(${a.join(", ")})`;
|
|
535
|
+
};
|
|
536
|
+
function $(e, { width: t, height: n, to: r = "dark", origin: i } = {}) {
|
|
537
|
+
let a = r === "dark", o = [];
|
|
538
|
+
for (let r = 0; r <= je; r++) {
|
|
539
|
+
let s = r / je, c = Me(s);
|
|
540
|
+
switch (e) {
|
|
541
|
+
case "circle": {
|
|
542
|
+
let e = i?.x ?? t / 2, r = i?.y ?? n / 2, a = Math.hypot(Math.max(e, t - e), Math.max(r, n - r));
|
|
543
|
+
o.push({ clipPath: `circle(${Z(a * c)}px at ${Z(e)}px ${Z(r)}px)` });
|
|
544
|
+
break;
|
|
545
|
+
}
|
|
546
|
+
case "slide": {
|
|
547
|
+
let e = n * (1 - c);
|
|
548
|
+
o.push({ clipPath: a ? `inset(${Z(e)}px 0px 0px 0px)` : `inset(0px 0px ${Z(e)}px 0px)` });
|
|
549
|
+
break;
|
|
550
|
+
}
|
|
551
|
+
case "blinds":
|
|
552
|
+
o.push({ clipPath: Ie(t, n, c, a) });
|
|
553
|
+
break;
|
|
554
|
+
case "fade":
|
|
555
|
+
o.push({
|
|
556
|
+
clipPath: "none",
|
|
557
|
+
opacity: c
|
|
558
|
+
});
|
|
559
|
+
break;
|
|
560
|
+
case "none": return [];
|
|
561
|
+
default: o.push({ clipPath: Fe(t, n, c, s * Ne.ripples * 2 * Math.PI, a) });
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
return o;
|
|
565
|
+
}
|
|
566
|
+
function Le(e, { effect: t = q, to: n, origin: r, duration: i, live: a } = {}) {
|
|
567
|
+
let o = document.documentElement, s = n !== void 0 && o.getAttribute("data-bs-theme") === n;
|
|
568
|
+
if (t === "none" || s || xe("(prefers-reduced-motion: reduce)") || typeof document.startViewTransition != "function" || typeof o.animate != "function") return e(), Promise.resolve(!1);
|
|
569
|
+
o.classList.add(X);
|
|
570
|
+
let c = a instanceof Element ? a : null;
|
|
571
|
+
c && (c.style.viewTransitionName = ye);
|
|
572
|
+
let l = document.startViewTransition(e), u = i ?? Y[t] ?? Y.wave;
|
|
573
|
+
return l.ready.then(() => {
|
|
574
|
+
let e = $(t, {
|
|
575
|
+
width: window.innerWidth,
|
|
576
|
+
height: window.innerHeight,
|
|
577
|
+
to: n,
|
|
578
|
+
origin: r
|
|
579
|
+
});
|
|
580
|
+
o.animate(e, {
|
|
581
|
+
duration: u,
|
|
582
|
+
easing: "linear",
|
|
583
|
+
fill: "both",
|
|
584
|
+
pseudoElement: "::view-transition-new(root)"
|
|
585
|
+
});
|
|
586
|
+
}).catch(() => {}), l.finished.catch(() => {}).then(() => (o.classList.remove(X), c && (c.style.viewTransitionName = ""), !0));
|
|
587
|
+
}
|
|
588
|
+
//#endregion
|
|
589
|
+
export { se as A, x as B, ge as C, ae as D, R as E, f as F, t as G, l as H, b as I, i as J, n as K, _ as L, re as M, F as N, pe as O, d as P, o as Q, y as R, G as S, ee as T, u as U, S as V, e as W, c as X, a as Y, s as Z, Le as _, _e as a, me as b, K as c, ke as d, we as f, $ as g, Oe as h, ve as i, ie as j, ne as k, X as l, Te as m, J as n, Y as o, Ce as p, r as q, De as r, ye as s, q as t, Ee as u, Ae as v, E as w, W as x, U as y, v as z };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/tokenCommit.js
|
|
2
|
+
var e = {
|
|
3
|
+
enter: "Enter",
|
|
4
|
+
comma: ",",
|
|
5
|
+
space: " ",
|
|
6
|
+
tab: "Tab"
|
|
7
|
+
}, t = {
|
|
8
|
+
enter: "\n",
|
|
9
|
+
comma: ",",
|
|
10
|
+
space: " ",
|
|
11
|
+
tab: " "
|
|
12
|
+
}, n = (t) => e[t], r = (e) => t[e];
|
|
13
|
+
function i(e, t) {
|
|
14
|
+
let n = [String(e ?? "")];
|
|
15
|
+
for (let e of t) n = n.flatMap((t) => t.split(e));
|
|
16
|
+
return n.map((e) => e.trim()).filter(Boolean);
|
|
17
|
+
}
|
|
18
|
+
var a = (e, t) => t.some((t) => String(e ?? "").includes(t));
|
|
19
|
+
//#endregion
|
|
20
|
+
export { i, r as n, n as r, a as t };
|