@webority/ui-react 0.6.11 → 0.6.13
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/examples.mobile.json-BMXTGiGC-Dl_Tt3py.js +250 -0
- package/dist/libphonenumber-js-BcNT8oq0-DMpMlice.js +11439 -0
- package/dist/types/components/AppColorField.d.ts +4 -1
- package/dist/types/components/AppDatePicker.d.ts +5 -1
- package/dist/types/components/AppDateRangePicker.d.ts +53 -0
- package/dist/types/components/AppPhoneNumberInput.d.ts +1 -1
- package/dist/types/components/AppSegmented.d.ts +9 -4
- package/dist/types/index.d.ts +1 -0
- package/dist/ui-react.js +936 -351
- package/package.json +3 -3
package/dist/ui-react.js
CHANGED
|
@@ -259,7 +259,7 @@ var M = {
|
|
|
259
259
|
delete: "<rect width=\"174\" height=\"174\" rx=\"87\" fill=\"var(--wui-danger-5)\"/>\n<rect x=\"24\" y=\"24\" width=\"126\" height=\"126\" rx=\"63\" stroke=\"var(--wui-danger-20)\" stroke-width=\"16\"/>\n<g clip-path=\"url(#wui_delete_clip0)\">\n<rect x=\"32\" y=\"32\" width=\"110\" height=\"110\" rx=\"55\" fill=\"var(--wui-danger)\"/>\n<path d=\"M114.529 67.5672L163.249 116.287L116.354 163.183L67.6336 114.463L100.999 81.0975L64.999 77.5L58.999 69.5L114.529 67.5672Z\" fill=\"var(--wui-danger-active)\"/>\n<path d=\"M103.5 79L100.5 105.5L76 113L69.5 83.5L103.5 79Z\" fill=\"var(--wui-danger)\"/>\n<g clip-path=\"url(#wui_delete_clip1)\">\n<path d=\"M113.652 66.9993C108.895 66.5266 104.139 66.1721 99.3522 65.9061V65.8766L98.7022 62.0357C98.259 59.3175 97.609 55.2402 90.6954 55.2402H82.9545C76.0704 55.2402 75.4204 59.1402 74.9477 62.0061L74.3272 65.788C71.5795 65.9652 68.8318 66.1425 66.084 66.4084L60.0568 66.9993C58.8159 67.1175 57.9295 68.2107 58.0477 69.4221C58.1659 70.6334 59.2295 71.5198 60.4704 71.4016L66.4977 70.8107C81.9795 69.2743 97.5795 69.8652 113.239 71.4311C113.327 71.4311 113.386 71.4311 113.475 71.4311C114.598 71.4311 115.573 70.5743 115.691 69.4221C115.779 68.2107 114.893 67.1175 113.652 66.9993Z\" fill=\"white\"/>\n<path d=\"M108.216 75.5971C107.507 74.8585 106.532 74.4448 105.527 74.4448H68.1816C67.177 74.4448 66.1725 74.8585 65.4929 75.5971C64.8134 76.3357 64.4293 77.3403 64.4884 78.3744L66.3202 108.688C66.6452 113.179 67.0588 118.793 77.3702 118.793H96.3384C106.65 118.793 107.063 113.208 107.388 108.688L109.22 78.4039C109.279 77.3403 108.895 76.3357 108.216 75.5971ZM91.7588 103.99H81.9202C80.7088 103.99 79.7043 102.986 79.7043 101.774C79.7043 100.563 80.7088 99.5585 81.9202 99.5585H91.7588C92.9702 99.5585 93.9747 100.563 93.9747 101.774C93.9747 102.986 92.9702 103.99 91.7588 103.99ZM94.2406 92.1721H79.4679C78.2566 92.1721 77.252 91.1676 77.252 89.9562C77.252 88.7448 78.2566 87.7403 79.4679 87.7403H94.2406C95.452 87.7403 96.4566 88.7448 96.4566 89.9562C96.4566 91.1676 95.452 92.1721 94.2406 92.1721Z\" fill=\"white\"/>\n</g>\n</g>\n<defs><clipPath id=\"wui_delete_clip0\"><rect x=\"32\" y=\"32\" width=\"110\" height=\"110\" rx=\"55\" fill=\"white\"/></clipPath><clipPath id=\"wui_delete_clip1\"><rect width=\"65\" height=\"65\" fill=\"white\" transform=\"translate(54.3535 54.502)\"/></clipPath></defs>"
|
|
260
260
|
};
|
|
261
261
|
Object.keys(M);
|
|
262
|
-
var
|
|
262
|
+
var ee = class extends HTMLElement {
|
|
263
263
|
static get observedAttributes() {
|
|
264
264
|
return ["tone", "size"];
|
|
265
265
|
}
|
|
@@ -273,40 +273,40 @@ var N = class extends HTMLElement {
|
|
|
273
273
|
let e = this.getAttribute("tone"), t = this.getAttribute("size") || "72", n = M[e] || M.info;
|
|
274
274
|
this.innerHTML = `<svg width="${t}" height="${t}" viewBox="0 0 174 174" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">${n}</svg>`;
|
|
275
275
|
}
|
|
276
|
-
},
|
|
277
|
-
function
|
|
276
|
+
}, N = 4;
|
|
277
|
+
function P(e, t, n = {}) {
|
|
278
278
|
if (!e || !t) return;
|
|
279
|
-
let r = e.getBoundingClientRect(), i = t.offsetHeight, a = window.innerHeight - r.bottom, o = a < i +
|
|
280
|
-
t.classList.toggle("drop-up", o), t.style.position = "fixed", t.style.top = o ? `${Math.max(
|
|
281
|
-
let s = t.offsetWidth, c = Math.min(r.left, window.innerWidth - s -
|
|
282
|
-
t.style.left = `${Math.max(
|
|
279
|
+
let r = e.getBoundingClientRect(), i = t.offsetHeight, a = window.innerHeight - r.bottom, o = a < i + N && r.top > a;
|
|
280
|
+
t.classList.toggle("drop-up", o), t.style.position = "fixed", t.style.top = o ? `${Math.max(N, r.top - i - N)}px` : `${r.bottom + N}px`, n.matchWidth && (t.style.width = `${r.width}px`);
|
|
281
|
+
let s = t.offsetWidth, c = Math.min(r.left, window.innerWidth - s - N);
|
|
282
|
+
t.style.left = `${Math.max(N, c)}px`;
|
|
283
283
|
}
|
|
284
|
-
function
|
|
285
|
-
|
|
284
|
+
function F(e, t) {
|
|
285
|
+
I(e), e._reanchor = t, window.addEventListener("resize", e._reanchor), window.addEventListener("scroll", e._reanchor, !0);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function I(e) {
|
|
288
288
|
e?._reanchor && (window.removeEventListener("resize", e._reanchor), window.removeEventListener("scroll", e._reanchor, !0), e._reanchor = null);
|
|
289
289
|
}
|
|
290
|
-
var
|
|
291
|
-
function
|
|
292
|
-
let n = e.getAttribute("name"), r = e.querySelector(`:scope > input[${
|
|
290
|
+
var te = "data-wui-mirror";
|
|
291
|
+
function L(e, t) {
|
|
292
|
+
let n = e.getAttribute("name"), r = e.querySelector(`:scope > input[${te}]`);
|
|
293
293
|
if (!n) {
|
|
294
294
|
r?.remove();
|
|
295
295
|
return;
|
|
296
296
|
}
|
|
297
|
-
r || (r = document.createElement("input"), r.type = "hidden", r.setAttribute(
|
|
297
|
+
r || (r = document.createElement("input"), r.type = "hidden", r.setAttribute(te, ""), e.appendChild(r)), r.name = n, r.value = t == null ? "" : String(t);
|
|
298
298
|
for (let t of e.attributes) t.name.startsWith("data-val") && r.setAttribute(t.name, t.value);
|
|
299
299
|
r.disabled = e.hasAttribute("disabled");
|
|
300
300
|
}
|
|
301
|
-
var
|
|
301
|
+
var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), ne = (e) => {
|
|
302
302
|
if (!e) return "";
|
|
303
303
|
let t = String(e).toLowerCase().replace(/[^a-z0-9-]/g, "");
|
|
304
304
|
return t ? `<i class="bi bi-${t}" aria-hidden="true"></i>` : "";
|
|
305
|
-
},
|
|
305
|
+
}, B = (e) => {
|
|
306
306
|
if (e == null) return "";
|
|
307
|
-
let t = e[
|
|
307
|
+
let t = e[R] ? String(e.label ?? "") : z(e.label), n = ne(e.icon);
|
|
308
308
|
return n ? `<span class="wui-opt-label">${n}${t}</span>` : t;
|
|
309
|
-
},
|
|
309
|
+
}, re = class extends HTMLElement {
|
|
310
310
|
_accessibleName() {
|
|
311
311
|
return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Select";
|
|
312
312
|
}
|
|
@@ -335,9 +335,9 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
335
335
|
return this._value;
|
|
336
336
|
}
|
|
337
337
|
set value(e) {
|
|
338
|
-
this._value = e == null ? "" : String(e),
|
|
338
|
+
this._value = e == null ? "" : String(e), L(this, this._value);
|
|
339
339
|
let t = this._readOptions().find((e) => String(e.value) === this._value);
|
|
340
|
-
t && (this._label =
|
|
340
|
+
t && (this._label = H(t.label)), this._syncInput();
|
|
341
341
|
}
|
|
342
342
|
set options(e) {
|
|
343
343
|
this._optionsProp = Array.isArray(e) ? e : [], this._renderOptions();
|
|
@@ -368,7 +368,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
368
368
|
value: e.getAttribute("value") ?? e.textContent.trim(),
|
|
369
369
|
label: e.innerHTML,
|
|
370
370
|
icon: e.getAttribute("icon") || void 0,
|
|
371
|
-
[
|
|
371
|
+
[R]: !0,
|
|
372
372
|
selected: e.hasAttribute("selected")
|
|
373
373
|
})));
|
|
374
374
|
}
|
|
@@ -380,8 +380,8 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
380
380
|
let e = this.getAttribute("placeholder") || "Search…", t = this.getAttribute("size"), n = t === "sm" ? " search-select-sm" : t === "lg" ? " search-select-lg" : "";
|
|
381
381
|
this.innerHTML = `
|
|
382
382
|
<div class="search-select${n}">
|
|
383
|
-
<div class="input search-select-control search-select-ac" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-label="${
|
|
384
|
-
<input class="search-select-input search-select-ac-input" placeholder="${
|
|
383
|
+
<div class="input search-select-control search-select-ac" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-label="${V(this._accessibleName())}">
|
|
384
|
+
<input class="search-select-input search-select-ac-input" placeholder="${V(e)}" aria-autocomplete="list" autocomplete="off"${this.hasAttribute("disabled") ? " disabled" : ""} />
|
|
385
385
|
<span class="search-select-spinner spinner-border spinner-border-sm" role="status" aria-hidden="true" hidden></span>
|
|
386
386
|
<button type="button" class="search-select-clear" aria-label="Clear" hidden><i class="bi bi-x" aria-hidden="true"></i></button>
|
|
387
387
|
</div>
|
|
@@ -390,7 +390,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
390
390
|
<div class="search-select-empty" hidden>No matches</div>
|
|
391
391
|
<div class="search-select-hint" hidden>Type to search…</div>
|
|
392
392
|
</div>
|
|
393
|
-
</div>`, this._rendered = !0,
|
|
393
|
+
</div>`, this._rendered = !0, L(this, this._value), this._wire(), this._syncInput(), this._renderOptions();
|
|
394
394
|
}
|
|
395
395
|
_refs() {
|
|
396
396
|
return {
|
|
@@ -419,9 +419,9 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
419
419
|
let t = this._refs();
|
|
420
420
|
if (!t.optionsWrap) return;
|
|
421
421
|
let n = (e ?? (t.input ? t.input.value : "")).trim().toLowerCase(), r = this._readOptions();
|
|
422
|
-
!this._remote && n && (r = r.filter((e) =>
|
|
422
|
+
!this._remote && n && (r = r.filter((e) => H(e.label).toLowerCase().includes(n))), t.optionsWrap.innerHTML = r.map((e) => {
|
|
423
423
|
let t = String(e.value) === String(this._value);
|
|
424
|
-
return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${
|
|
424
|
+
return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${V(e.value)}" aria-selected="${t}">${B(e)}</button>`;
|
|
425
425
|
}).join(""), this._active = -1;
|
|
426
426
|
let i = n.length < this._minChars;
|
|
427
427
|
t.hint && (t.hint.hidden = !(this._remote && i && !r.length)), t.empty && (t.empty.hidden = this._loading || r.length > 0 || this._remote && i);
|
|
@@ -429,7 +429,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
429
429
|
_wire() {
|
|
430
430
|
let e = this._refs();
|
|
431
431
|
if (!e.control || !e.input) return;
|
|
432
|
-
let t = () =>
|
|
432
|
+
let t = () => P(e.control, e.menu, { matchWidth: !0 }), n = () => this._optionEls().filter((e) => !e.hidden), r = (e) => {
|
|
433
433
|
let t = n();
|
|
434
434
|
this._active = e;
|
|
435
435
|
for (let e of this._optionEls()) e.classList.remove("is-active");
|
|
@@ -439,7 +439,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
439
439
|
}, o = () => {
|
|
440
440
|
e.menu.hidden = !0, e.control.setAttribute("aria-expanded", "false"), e.control.classList.remove("open"), r(-1), this._syncInput();
|
|
441
441
|
}, s = (t) => {
|
|
442
|
-
this._value = t.dataset.value, this._label =
|
|
442
|
+
this._value = t.dataset.value, this._label = H(t.innerHTML), L(this, this._value), e.input.value = this._label, this.dispatchEvent(new Event("change", { bubbles: !0 })), o(), e.input.focus();
|
|
443
443
|
};
|
|
444
444
|
e.input.addEventListener("focus", () => a()), e.input.addEventListener("input", () => {
|
|
445
445
|
let t = e.input.value;
|
|
@@ -462,17 +462,17 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
462
462
|
let t = e.target.closest(".search-select-option");
|
|
463
463
|
t && r(this._optionEls().indexOf(t));
|
|
464
464
|
}), e.optionsWrap.addEventListener("mouseleave", () => r(-1)), e.clear?.addEventListener("click", () => {
|
|
465
|
-
this._value = "", this._label = "",
|
|
465
|
+
this._value = "", this._label = "", L(this, ""), e.input.value = "", e.clear.hidden = !0, this._renderOptions(""), this.dispatchEvent(new Event("change", { bubbles: !0 })), e.input.focus();
|
|
466
466
|
}), this._onDocClick = (e) => {
|
|
467
467
|
i() && !this.contains(e.target) && o();
|
|
468
|
-
}, document.addEventListener("click", this._onDocClick),
|
|
468
|
+
}, document.addEventListener("click", this._onDocClick), F(this, () => {
|
|
469
469
|
i() && t();
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
472
|
disconnectedCallback() {
|
|
473
|
-
this._onDocClick && document.removeEventListener("click", this._onDocClick),
|
|
473
|
+
this._onDocClick && document.removeEventListener("click", this._onDocClick), I(this), clearTimeout(this._timer);
|
|
474
474
|
}
|
|
475
|
-
},
|
|
475
|
+
}, V = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), H = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), ie = [
|
|
476
476
|
"January",
|
|
477
477
|
"February",
|
|
478
478
|
"March",
|
|
@@ -485,7 +485,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
485
485
|
"October",
|
|
486
486
|
"November",
|
|
487
487
|
"December"
|
|
488
|
-
],
|
|
488
|
+
], ae = [
|
|
489
489
|
"Su",
|
|
490
490
|
"Mo",
|
|
491
491
|
"Tu",
|
|
@@ -493,123 +493,532 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
493
493
|
"Th",
|
|
494
494
|
"Fr",
|
|
495
495
|
"Sa"
|
|
496
|
-
],
|
|
496
|
+
], oe = (e) => String(e).padStart(2, "0"), U = (e, t, n) => `${e}-${oe(t + 1)}-${oe(n)}`, W = (e) => {
|
|
497
497
|
let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e || "");
|
|
498
498
|
return t ? {
|
|
499
499
|
y: +t[1],
|
|
500
500
|
m: t[2] - 1,
|
|
501
501
|
d: +t[3]
|
|
502
502
|
} : null;
|
|
503
|
-
},
|
|
504
|
-
let t =
|
|
505
|
-
return t ? `${
|
|
506
|
-
},
|
|
503
|
+
}, se = (e) => {
|
|
504
|
+
let t = W(e);
|
|
505
|
+
return t ? `${oe(t.d)} ${ie[t.m].slice(0, 3)} ${t.y}` : "";
|
|
506
|
+
}, G = (e, t) => new Date(e, t + 1, 0).getDate(), K = (e, t) => {
|
|
507
|
+
for (; t < 0;) t += 12, --e;
|
|
508
|
+
for (; t > 11;) t -= 12, e += 1;
|
|
509
|
+
return {
|
|
510
|
+
y: e,
|
|
511
|
+
m: t
|
|
512
|
+
};
|
|
513
|
+
}, ce = class extends HTMLElement {
|
|
507
514
|
static get observedAttributes() {
|
|
508
515
|
return [
|
|
509
516
|
"value",
|
|
510
517
|
"min",
|
|
511
518
|
"max",
|
|
512
519
|
"placeholder",
|
|
513
|
-
"disabled"
|
|
520
|
+
"disabled",
|
|
521
|
+
"first-day",
|
|
522
|
+
"size"
|
|
514
523
|
];
|
|
515
524
|
}
|
|
516
525
|
constructor() {
|
|
517
526
|
super(), this._value = "";
|
|
518
527
|
let e = new Date(2e3, 0, 1);
|
|
519
|
-
this._viewY = e.getFullYear(), this._viewM = e.getMonth();
|
|
528
|
+
this._viewY = e.getFullYear(), this._viewM = e.getMonth(), this._mode = "days", this._focus = null, this._slide = "";
|
|
520
529
|
}
|
|
521
530
|
connectedCallback() {
|
|
522
531
|
this._rendered || this.render();
|
|
523
532
|
}
|
|
524
533
|
attributeChangedCallback(e, t, n) {
|
|
525
|
-
this._rendered && (e === "value" ? (this._value = n || "", this._syncTrigger()) : this.render());
|
|
534
|
+
this._rendered && (e === "value" ? (this._value = n || "", this._syncTrigger()) : e === "first-day" ? this.querySelector(".datepicker-pop")?.hidden || this._renderView() : this.render());
|
|
526
535
|
}
|
|
527
536
|
get value() {
|
|
528
537
|
return this._value;
|
|
529
538
|
}
|
|
530
539
|
set value(e) {
|
|
531
|
-
this._value = e || "",
|
|
540
|
+
this._value = e || "", L(this, this._value), this._syncTrigger(), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
541
|
+
}
|
|
542
|
+
_firstDay() {
|
|
543
|
+
let e = Number.parseInt(this.getAttribute("first-day") ?? "", 10);
|
|
544
|
+
return Number.isInteger(e) && e >= 0 && e <= 6 ? e : 0;
|
|
532
545
|
}
|
|
533
546
|
render() {
|
|
534
547
|
this._value = this.getAttribute("value") || this._value;
|
|
535
|
-
let e = this.getAttribute("placeholder") || "Enter Date", t =
|
|
536
|
-
t && (this._viewY = t.y, this._viewM = t.m)
|
|
548
|
+
let e = this.getAttribute("placeholder") || "Enter Date", t = W(this._value);
|
|
549
|
+
t && (this._viewY = t.y, this._viewM = t.m);
|
|
550
|
+
let n = this.getAttribute("size"), r = n === "sm" ? " input-sm" : n === "lg" ? " input-lg" : "";
|
|
551
|
+
this.innerHTML = `
|
|
537
552
|
<div class="datepicker">
|
|
538
|
-
<button type="button" class="input datepicker-trigger" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}>
|
|
539
|
-
<span data-trigger-label class="${t ? "" : "search-select-placeholder"}">${t ?
|
|
553
|
+
<button type="button" class="input datepicker-trigger${r}${t ? " has-value" : ""}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}>
|
|
554
|
+
<span data-trigger-label class="${t ? "" : "search-select-placeholder"}">${t ? se(this._value) : e}</span>
|
|
540
555
|
<i class="bi bi-calendar3" aria-hidden="true"></i>
|
|
541
556
|
</button>
|
|
542
|
-
<div class="datepicker-pop" role="dialog" hidden></div>
|
|
543
|
-
</div>`, this._rendered = !0,
|
|
557
|
+
<div class="datepicker-pop" role="dialog" aria-modal="false" hidden></div>
|
|
558
|
+
</div>`, this._rendered = !0, L(this, this._value), this._wire();
|
|
544
559
|
}
|
|
545
560
|
_syncFormValue() {
|
|
546
|
-
|
|
561
|
+
L(this, this._value);
|
|
547
562
|
}
|
|
548
563
|
_syncTrigger() {
|
|
549
|
-
let e = this.querySelector("[data-trigger-label]");
|
|
550
|
-
if (!
|
|
551
|
-
let
|
|
552
|
-
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
let e = this.
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
564
|
+
let e = this.querySelector(".datepicker-trigger"), t = this.querySelector("[data-trigger-label]");
|
|
565
|
+
if (!t) return;
|
|
566
|
+
let n = W(this._value);
|
|
567
|
+
t.textContent = n ? se(this._value) : this.getAttribute("placeholder") || "Enter Date", t.classList.toggle("search-select-placeholder", !n), e?.classList.toggle("has-value", !!n);
|
|
568
|
+
}
|
|
569
|
+
_limits() {
|
|
570
|
+
let e = W(this.getAttribute("min")), t = W(this.getAttribute("max")), n = e ? new Date(e.y, e.m, e.d).getTime() : -Infinity, r = t ? new Date(t.y, t.m, t.d).getTime() : Infinity;
|
|
571
|
+
return {
|
|
572
|
+
dayDisabled: (e, t, i) => {
|
|
573
|
+
let a = new Date(e, t, i).getTime();
|
|
574
|
+
return a < n || a > r;
|
|
575
|
+
},
|
|
576
|
+
monthDisabled: (e, t) => {
|
|
577
|
+
let i = new Date(e, t, 1).getTime();
|
|
578
|
+
return new Date(e, t, G(e, t)).getTime() < n || i > r;
|
|
579
|
+
},
|
|
580
|
+
yearDisabled: (e) => {
|
|
581
|
+
let t = new Date(e, 0, 1).getTime();
|
|
582
|
+
return new Date(e, 11, 31).getTime() < n || t > r;
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
_renderView() {
|
|
587
|
+
let e = this.querySelector(".datepicker-pop");
|
|
588
|
+
e && (this._mode === "months" ? e.innerHTML = this._monthsHtml() : this._mode === "years" ? e.innerHTML = this._yearsHtml() : e.innerHTML = this._daysHtml(), this._focusActive());
|
|
589
|
+
}
|
|
590
|
+
_daysHtml() {
|
|
591
|
+
let e = this._firstDay(), t = (new Date(this._viewY, this._viewM, 1).getDay() - e + 7) % 7, n = G(this._viewY, this._viewM), r = W(this._value), i = /* @__PURE__ */ new Date(), { dayDisabled: a } = this._limits(), o = this._focus || r || {
|
|
592
|
+
y: this._viewY,
|
|
593
|
+
m: this._viewM,
|
|
594
|
+
d: 1
|
|
595
|
+
}, s = (e, t, n, s) => {
|
|
596
|
+
let c = U(e, t, n), l = r && r.y === e && r.m === t && r.d === n, u = i.getFullYear() === e && i.getMonth() === t && i.getDate() === n, d = o.y === e && o.m === t && o.d === n, f = a(e, t, n);
|
|
597
|
+
return `<button type="button" class="${[
|
|
598
|
+
"datepicker-day",
|
|
599
|
+
s ? "is-outside" : "",
|
|
600
|
+
u ? "is-today" : "",
|
|
601
|
+
l ? "is-selected" : ""
|
|
602
|
+
].filter(Boolean).join(" ")}" data-iso="${c}" role="gridcell" tabindex="${d && !f ? "0" : "-1"}"${l ? " aria-selected=\"true\"" : ""}${f ? " disabled aria-disabled=\"true\"" : ""}>${n}</button>`;
|
|
603
|
+
}, c = "", l = K(this._viewY, this._viewM - 1), u = G(l.y, l.m);
|
|
604
|
+
for (let e = t - 1; e >= 0; e--) c += s(l.y, l.m, u - e, !0);
|
|
605
|
+
for (let e = 1; e <= n; e++) c += s(this._viewY, this._viewM, e, !1);
|
|
606
|
+
let d = K(this._viewY, this._viewM + 1), f = (7 - (t + n) % 7) % 7;
|
|
607
|
+
for (let e = 1; e <= f; e++) c += s(d.y, d.m, e, !0);
|
|
608
|
+
let p = ae.map((t, n) => ae[(n + e) % 7]).map((e) => `<span>${e}</span>`).join("");
|
|
609
|
+
return `
|
|
565
610
|
<div class="datepicker-head">
|
|
566
611
|
<button type="button" class="datepicker-nav-btn" data-nav="-1" aria-label="Previous month"><i class="bi bi-chevron-left" aria-hidden="true"></i></button>
|
|
567
|
-
<
|
|
612
|
+
<button type="button" class="datepicker-month" data-view="months" aria-label="Choose month and year">${ie[this._viewM]} ${this._viewY}</button>
|
|
568
613
|
<button type="button" class="datepicker-nav-btn" data-nav="1" aria-label="Next month"><i class="bi bi-chevron-right" aria-hidden="true"></i></button>
|
|
569
614
|
</div>
|
|
570
|
-
<div class="datepicker-weekdays">${
|
|
571
|
-
<div class="datepicker-grid">${
|
|
572
|
-
<div class="datepicker-foot"
|
|
615
|
+
<div class="datepicker-weekdays">${p}</div>
|
|
616
|
+
<div class="datepicker-grid${this._slide ? ` ${this._slide}` : ""}" role="grid">${c}</div>
|
|
617
|
+
<div class="datepicker-foot">
|
|
618
|
+
<button type="button" class="datepicker-link" data-today>Today</button>
|
|
619
|
+
<button type="button" class="datepicker-link" data-clear>Clear</button>
|
|
620
|
+
</div>`;
|
|
621
|
+
}
|
|
622
|
+
_monthsHtml() {
|
|
623
|
+
let e = W(this._value), t = /* @__PURE__ */ new Date(), { monthDisabled: n } = this._limits(), r = "";
|
|
624
|
+
for (let i = 0; i < 12; i++) {
|
|
625
|
+
let a = e && e.y === this._viewY && e.m === i, o = t.getFullYear() === this._viewY && t.getMonth() === i, s = n(this._viewY, i), c = [
|
|
626
|
+
"datepicker-cell",
|
|
627
|
+
o ? "is-today" : "",
|
|
628
|
+
a ? "is-selected" : ""
|
|
629
|
+
].filter(Boolean).join(" ");
|
|
630
|
+
r += `<button type="button" class="${c}" data-month="${i}"${s ? " disabled" : ""}>${ie[i].slice(0, 3)}</button>`;
|
|
631
|
+
}
|
|
632
|
+
return `
|
|
633
|
+
<div class="datepicker-head">
|
|
634
|
+
<button type="button" class="datepicker-nav-btn" data-nav-year="-1" aria-label="Previous year"><i class="bi bi-chevron-left" aria-hidden="true"></i></button>
|
|
635
|
+
<button type="button" class="datepicker-month" data-view="years" aria-label="Choose year">${this._viewY}</button>
|
|
636
|
+
<button type="button" class="datepicker-nav-btn" data-nav-year="1" aria-label="Next year"><i class="bi bi-chevron-right" aria-hidden="true"></i></button>
|
|
637
|
+
</div>
|
|
638
|
+
<div class="datepicker-cells">${r}</div>`;
|
|
639
|
+
}
|
|
640
|
+
_yearsHtml() {
|
|
641
|
+
let e = W(this._value), t = (/* @__PURE__ */ new Date()).getFullYear(), { yearDisabled: n } = this._limits(), r = this._viewY - (this._viewY % 10 + 10) % 10 - 1, i = "";
|
|
642
|
+
for (let a = 0; a < 12; a++) {
|
|
643
|
+
let o = r + a, s = e && e.y === o, c = t === o, l = n(o), u = [
|
|
644
|
+
"datepicker-cell",
|
|
645
|
+
c ? "is-today" : "",
|
|
646
|
+
s ? "is-selected" : ""
|
|
647
|
+
].filter(Boolean).join(" ");
|
|
648
|
+
i += `<button type="button" class="${u}" data-year="${o}"${l ? " disabled" : ""}>${o}</button>`;
|
|
649
|
+
}
|
|
650
|
+
return `
|
|
651
|
+
<div class="datepicker-head">
|
|
652
|
+
<button type="button" class="datepicker-nav-btn" data-nav-decade="-1" aria-label="Previous decade"><i class="bi bi-chevron-left" aria-hidden="true"></i></button>
|
|
653
|
+
<span class="datepicker-month">${r + 1} – ${r + 10}</span>
|
|
654
|
+
<button type="button" class="datepicker-nav-btn" data-nav-decade="1" aria-label="Next decade"><i class="bi bi-chevron-right" aria-hidden="true"></i></button>
|
|
655
|
+
</div>
|
|
656
|
+
<div class="datepicker-cells">${i}</div>`;
|
|
657
|
+
}
|
|
658
|
+
_focusActive() {
|
|
659
|
+
let e = this.querySelector(".datepicker-pop"), t = e?.querySelector("[tabindex=\"0\"]") || e?.querySelector(".is-selected") || e?.querySelector(".datepicker-day:not(:disabled), .datepicker-cell:not(:disabled)");
|
|
660
|
+
t && e.contains(document.activeElement) && t.focus();
|
|
573
661
|
}
|
|
574
662
|
_position(e, t) {
|
|
575
|
-
|
|
663
|
+
P(e, t);
|
|
664
|
+
}
|
|
665
|
+
_setFocus(e, t, n, r) {
|
|
666
|
+
let { y: i, m: a } = K(e, t);
|
|
667
|
+
this._focus = {
|
|
668
|
+
y: i,
|
|
669
|
+
m: a,
|
|
670
|
+
d: n
|
|
671
|
+
};
|
|
672
|
+
let o = i !== this._viewY || a !== this._viewM;
|
|
673
|
+
this._viewY = i, this._viewM = a, this._slide = o && r || "", this._renderView(), this._slide = "", this.querySelector(`.datepicker-day[data-iso="${U(i, a, n)}"]`)?.focus();
|
|
674
|
+
}
|
|
675
|
+
_onKey(e) {
|
|
676
|
+
if (this._mode !== "days") {
|
|
677
|
+
e.key === "Escape" && this._close();
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
let t = this._focus || W(this._value) || {
|
|
681
|
+
y: this._viewY,
|
|
682
|
+
m: this._viewM,
|
|
683
|
+
d: 1
|
|
684
|
+
}, n = (n, r) => {
|
|
685
|
+
e.preventDefault();
|
|
686
|
+
let i = new Date(t.y, t.m, t.d + n);
|
|
687
|
+
this._setFocus(i.getFullYear(), i.getMonth(), i.getDate(), r);
|
|
688
|
+
};
|
|
689
|
+
switch (e.key) {
|
|
690
|
+
case "ArrowLeft": return n(-1, "slide-prev");
|
|
691
|
+
case "ArrowRight": return n(1, "slide-next");
|
|
692
|
+
case "ArrowUp": return n(-7, "slide-prev");
|
|
693
|
+
case "ArrowDown": return n(7, "slide-next");
|
|
694
|
+
case "Home": return n(-((new Date(t.y, t.m, t.d).getDay() - this._firstDay() + 7) % 7), "slide-prev");
|
|
695
|
+
case "End": return n(6 - (new Date(t.y, t.m, t.d).getDay() - this._firstDay() + 7) % 7, "slide-next");
|
|
696
|
+
case "PageUp": {
|
|
697
|
+
e.preventDefault();
|
|
698
|
+
let n = K(t.y, t.m - (e.shiftKey ? 12 : 1));
|
|
699
|
+
return this._setFocus(n.y, n.m, Math.min(t.d, G(n.y, n.m)), "slide-prev");
|
|
700
|
+
}
|
|
701
|
+
case "PageDown": {
|
|
702
|
+
e.preventDefault();
|
|
703
|
+
let n = K(t.y, t.m + (e.shiftKey ? 12 : 1));
|
|
704
|
+
return this._setFocus(n.y, n.m, Math.min(t.d, G(n.y, n.m)), "slide-next");
|
|
705
|
+
}
|
|
706
|
+
case "Enter":
|
|
707
|
+
case " ":
|
|
708
|
+
e.preventDefault(), this._limits().dayDisabled(t.y, t.m, t.d) || (this.value = U(t.y, t.m, t.d), this._close());
|
|
709
|
+
return;
|
|
710
|
+
case "Escape": return this._close();
|
|
711
|
+
default:
|
|
712
|
+
}
|
|
576
713
|
}
|
|
577
714
|
_wire() {
|
|
578
|
-
let e = this.querySelector(".datepicker-trigger"), t = this.querySelector(".datepicker-pop");
|
|
715
|
+
let e = this.querySelector(".datepicker-trigger"), t = this.querySelector(".datepicker-pop"), n = this.querySelector(".datepicker");
|
|
579
716
|
if (!e || !t) return;
|
|
580
|
-
let
|
|
581
|
-
|
|
717
|
+
let r = () => !t.hidden;
|
|
718
|
+
this._open = () => {
|
|
719
|
+
if (!W(this._value) && !this._viewNavigated) {
|
|
582
720
|
let e = /* @__PURE__ */ new Date();
|
|
583
721
|
this._viewY = e.getFullYear(), this._viewM = e.getMonth();
|
|
584
722
|
}
|
|
585
|
-
this.
|
|
586
|
-
|
|
587
|
-
|
|
723
|
+
let r = W(this._value), i = /* @__PURE__ */ new Date();
|
|
724
|
+
this._mode = "days", this._focus = r || {
|
|
725
|
+
y: this._viewY,
|
|
726
|
+
m: this._viewM,
|
|
727
|
+
d: i.getFullYear() === this._viewY && i.getMonth() === this._viewM ? i.getDate() : 1
|
|
728
|
+
}, this._renderView(), t.hidden = !1, n?.classList.add("open"), this._position(e, t), e.setAttribute("aria-expanded", "true"), t.querySelector("[tabindex=\"0\"]")?.focus();
|
|
729
|
+
}, this._close = () => {
|
|
730
|
+
t.hidden = !0, n?.classList.remove("open"), e.setAttribute("aria-expanded", "false"), e.focus();
|
|
731
|
+
}, e.addEventListener("click", () => r() ? this._close() : this._open()), t.addEventListener("click", (e) => {
|
|
732
|
+
this._popClick = !0;
|
|
733
|
+
let t = e.target.closest("[data-nav]");
|
|
734
|
+
if (t) {
|
|
735
|
+
this._viewNavigated = !0, this._slide = Number(t.dataset.nav) < 0 ? "slide-prev" : "slide-next";
|
|
736
|
+
let e = K(this._viewY, this._viewM + Number(t.dataset.nav));
|
|
737
|
+
this._viewY = e.y, this._viewM = e.m, this._focus = {
|
|
738
|
+
y: e.y,
|
|
739
|
+
m: e.m,
|
|
740
|
+
d: 1
|
|
741
|
+
}, this._renderView(), this._slide = "";
|
|
742
|
+
return;
|
|
743
|
+
}
|
|
744
|
+
let n = e.target.closest("[data-nav-year]");
|
|
745
|
+
if (n) {
|
|
746
|
+
this._viewY += Number(n.dataset.navYear), this._renderView();
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
749
|
+
let r = e.target.closest("[data-nav-decade]");
|
|
750
|
+
if (r) {
|
|
751
|
+
this._viewY += Number(r.dataset.navDecade) * 10, this._renderView();
|
|
752
|
+
return;
|
|
753
|
+
}
|
|
754
|
+
let i = e.target.closest("[data-view]");
|
|
755
|
+
if (i) {
|
|
756
|
+
this._mode = i.dataset.view, this._renderView();
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
let a = e.target.closest("[data-month]");
|
|
760
|
+
if (a && !a.disabled) {
|
|
761
|
+
this._viewNavigated = !0, this._viewM = Number(a.dataset.month), this._mode = "days", this._focus = {
|
|
762
|
+
y: this._viewY,
|
|
763
|
+
m: this._viewM,
|
|
764
|
+
d: 1
|
|
765
|
+
}, this._renderView();
|
|
766
|
+
return;
|
|
767
|
+
}
|
|
768
|
+
let o = e.target.closest("[data-year]");
|
|
769
|
+
if (o && !o.disabled) {
|
|
770
|
+
this._viewNavigated = !0, this._viewY = Number(o.dataset.year), this._mode = "months", this._renderView();
|
|
771
|
+
return;
|
|
772
|
+
}
|
|
773
|
+
if (e.target.closest("[data-today]")) {
|
|
774
|
+
let e = /* @__PURE__ */ new Date();
|
|
775
|
+
this.value = U(e.getFullYear(), e.getMonth(), e.getDate()), this._close();
|
|
776
|
+
return;
|
|
777
|
+
}
|
|
778
|
+
if (e.target.closest("[data-clear]")) {
|
|
779
|
+
this.value = "", this._close();
|
|
780
|
+
return;
|
|
781
|
+
}
|
|
782
|
+
let s = e.target.closest(".datepicker-day[data-iso]");
|
|
783
|
+
s && !s.disabled && (this.value = s.dataset.iso, this._close());
|
|
784
|
+
}), this._onKeyBound = (e) => {
|
|
785
|
+
r() && this._onKey(e);
|
|
786
|
+
}, t.addEventListener("keydown", this._onKeyBound), this._onDocClick = (e) => {
|
|
787
|
+
let t = this._popClick;
|
|
788
|
+
this._popClick = !1, r() && !t && !this.contains(e.target) && this._close();
|
|
789
|
+
}, document.addEventListener("click", this._onDocClick), F(this, () => {
|
|
790
|
+
r() && this._position(e, t);
|
|
791
|
+
}), this._syncFormValue();
|
|
792
|
+
}
|
|
793
|
+
disconnectedCallback() {
|
|
794
|
+
this._onDocClick && document.removeEventListener("click", this._onDocClick), I(this);
|
|
795
|
+
}
|
|
796
|
+
}, le = [
|
|
797
|
+
"January",
|
|
798
|
+
"February",
|
|
799
|
+
"March",
|
|
800
|
+
"April",
|
|
801
|
+
"May",
|
|
802
|
+
"June",
|
|
803
|
+
"July",
|
|
804
|
+
"August",
|
|
805
|
+
"September",
|
|
806
|
+
"October",
|
|
807
|
+
"November",
|
|
808
|
+
"December"
|
|
809
|
+
], ue = [
|
|
810
|
+
"Su",
|
|
811
|
+
"Mo",
|
|
812
|
+
"Tu",
|
|
813
|
+
"We",
|
|
814
|
+
"Th",
|
|
815
|
+
"Fr",
|
|
816
|
+
"Sa"
|
|
817
|
+
], de = (e) => String(e).padStart(2, "0"), fe = (e, t, n) => `${e}-${de(t + 1)}-${de(n)}`, q = (e) => {
|
|
818
|
+
let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e || "");
|
|
819
|
+
return t ? {
|
|
820
|
+
y: +t[1],
|
|
821
|
+
m: t[2] - 1,
|
|
822
|
+
d: +t[3]
|
|
823
|
+
} : null;
|
|
824
|
+
}, pe = (e) => {
|
|
825
|
+
let t = q(e);
|
|
826
|
+
return t ? `${de(t.d)} ${le[t.m].slice(0, 3)} ${t.y}` : "";
|
|
827
|
+
}, me = (e, t) => new Date(e, t + 1, 0).getDate(), he = (e, t) => {
|
|
828
|
+
for (; t < 0;) t += 12, --e;
|
|
829
|
+
for (; t > 11;) t -= 12, e += 1;
|
|
830
|
+
return {
|
|
831
|
+
y: e,
|
|
832
|
+
m: t
|
|
833
|
+
};
|
|
834
|
+
}, ge = class extends HTMLElement {
|
|
835
|
+
static get observedAttributes() {
|
|
836
|
+
return [
|
|
837
|
+
"start",
|
|
838
|
+
"end",
|
|
839
|
+
"min",
|
|
840
|
+
"max",
|
|
841
|
+
"placeholder",
|
|
842
|
+
"disabled",
|
|
843
|
+
"first-day",
|
|
844
|
+
"size"
|
|
845
|
+
];
|
|
846
|
+
}
|
|
847
|
+
constructor() {
|
|
848
|
+
super(), this._start = "", this._end = "", this._hover = "";
|
|
849
|
+
let e = new Date(2e3, 0, 1);
|
|
850
|
+
this._viewY = e.getFullYear(), this._viewM = e.getMonth();
|
|
851
|
+
}
|
|
852
|
+
connectedCallback() {
|
|
853
|
+
this._rendered || this.render();
|
|
854
|
+
}
|
|
855
|
+
attributeChangedCallback(e, t, n) {
|
|
856
|
+
this._rendered && (e === "start" || e === "end" ? (this._start = this.getAttribute("start") || "", this._end = this.getAttribute("end") || "", this._syncTrigger(), this._syncMirrors()) : this.render());
|
|
857
|
+
}
|
|
858
|
+
get value() {
|
|
859
|
+
return {
|
|
860
|
+
start: this._start,
|
|
861
|
+
end: this._end
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
set value(e) {
|
|
865
|
+
this._start = e?.start || "", this._end = e?.end || "", this._syncTrigger(), this._syncMirrors(), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
866
|
+
}
|
|
867
|
+
_firstDay() {
|
|
868
|
+
let e = Number.parseInt(this.getAttribute("first-day") ?? "", 10);
|
|
869
|
+
return Number.isInteger(e) && e >= 0 && e <= 6 ? e : 0;
|
|
870
|
+
}
|
|
871
|
+
_label() {
|
|
872
|
+
let e = this.getAttribute("placeholder") || "Start – End";
|
|
873
|
+
return !this._start && !this._end ? {
|
|
874
|
+
text: e,
|
|
875
|
+
empty: !0
|
|
876
|
+
} : {
|
|
877
|
+
text: `${pe(this._start) || "Start"} – ${pe(this._end) || "End"}`,
|
|
878
|
+
empty: !1
|
|
588
879
|
};
|
|
589
|
-
|
|
880
|
+
}
|
|
881
|
+
render() {
|
|
882
|
+
this._start = this.getAttribute("start") || this._start, this._end = this.getAttribute("end") || this._end;
|
|
883
|
+
let e = q(this._start);
|
|
884
|
+
e && (this._viewY = e.y, this._viewM = e.m);
|
|
885
|
+
let t = this.getAttribute("size"), n = t === "sm" ? " input-sm" : t === "lg" ? " input-lg" : "", { text: r, empty: i } = this._label();
|
|
886
|
+
this.innerHTML = `
|
|
887
|
+
<div class="daterange">
|
|
888
|
+
<button type="button" class="input daterange-trigger${n}${i ? "" : " has-value"}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}>
|
|
889
|
+
<span data-range-label class="${i ? "search-select-placeholder" : ""}">${r}</span>
|
|
890
|
+
<i class="bi bi-calendar-range" aria-hidden="true"></i>
|
|
891
|
+
</button>
|
|
892
|
+
<div class="daterange-pop" role="dialog" aria-modal="false" hidden></div>
|
|
893
|
+
</div>`, this._rendered = !0, this._syncMirrors(), this._wire();
|
|
894
|
+
}
|
|
895
|
+
_syncTrigger() {
|
|
896
|
+
let e = this.querySelector(".daterange-trigger"), t = this.querySelector("[data-range-label]");
|
|
897
|
+
if (!t) return;
|
|
898
|
+
let { text: n, empty: r } = this._label();
|
|
899
|
+
t.textContent = n, t.classList.toggle("search-select-placeholder", r), e?.classList.toggle("has-value", !r);
|
|
900
|
+
}
|
|
901
|
+
_syncMirrors() {
|
|
902
|
+
let e = this.getAttribute("start-name") || this.getAttribute("name"), t = this.getAttribute("end-name");
|
|
903
|
+
this._mirror("start", e, this._start), this._mirror("end", t, this._end);
|
|
904
|
+
}
|
|
905
|
+
_mirror(e, t, n) {
|
|
906
|
+
if (!t) return;
|
|
907
|
+
let r = this.querySelector(`input[type="hidden"][data-range-mirror="${e}"]`);
|
|
908
|
+
r || (r = document.createElement("input"), r.type = "hidden", r.setAttribute("data-range-mirror", e), this.appendChild(r)), r.name = t, r.value = n || "";
|
|
909
|
+
}
|
|
910
|
+
_limits() {
|
|
911
|
+
let e = q(this.getAttribute("min")), t = q(this.getAttribute("max")), n = e ? new Date(e.y, e.m, e.d).getTime() : -Infinity, r = t ? new Date(t.y, t.m, t.d).getTime() : Infinity;
|
|
912
|
+
return (e, t, i) => {
|
|
913
|
+
let a = new Date(e, t, i).getTime();
|
|
914
|
+
return a < n || a > r;
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
_monthHtml(e, t) {
|
|
918
|
+
let n = this._firstDay(), r = (new Date(e, t, 1).getDay() - n + 7) % 7, i = me(e, t), a = this._limits(), o = ue.map((e, t) => ue[(t + n) % 7]).map((e) => `<span>${e}</span>`).join(""), s = (e, t, n, r) => {
|
|
919
|
+
let i = fe(e, t, n), o = a(e, t, n);
|
|
920
|
+
return `<button type="button" class="${["datepicker-day", r ? "is-outside" : ""].filter(Boolean).join(" ")}" data-iso="${i}"${o ? " disabled" : ""}>${n}</button>`;
|
|
921
|
+
}, c = "", l = he(e, t - 1), u = me(l.y, l.m);
|
|
922
|
+
for (let e = r - 1; e >= 0; e--) c += s(l.y, l.m, u - e, !0);
|
|
923
|
+
for (let n = 1; n <= i; n++) c += s(e, t, n, !1);
|
|
924
|
+
let d = he(e, t + 1), f = (7 - (r + i) % 7) % 7;
|
|
925
|
+
for (let e = 1; e <= f; e++) c += s(d.y, d.m, e, !0);
|
|
926
|
+
return `
|
|
927
|
+
<div class="daterange-cal">
|
|
928
|
+
<div class="datepicker-month-label">${le[t]} ${e}</div>
|
|
929
|
+
<div class="datepicker-weekdays">${o}</div>
|
|
930
|
+
<div class="datepicker-grid" role="grid">${c}</div>
|
|
931
|
+
</div>`;
|
|
932
|
+
}
|
|
933
|
+
_renderView() {
|
|
934
|
+
let e = this.querySelector(".daterange-pop");
|
|
935
|
+
if (!e) return;
|
|
936
|
+
let t = he(this._viewY, this._viewM + 1);
|
|
937
|
+
e.innerHTML = `
|
|
938
|
+
<div class="daterange-head">
|
|
939
|
+
<button type="button" class="datepicker-nav-btn" data-nav="-1" aria-label="Previous month"><i class="bi bi-chevron-left" aria-hidden="true"></i></button>
|
|
940
|
+
<button type="button" class="datepicker-nav-btn" data-nav="1" aria-label="Next month"><i class="bi bi-chevron-right" aria-hidden="true"></i></button>
|
|
941
|
+
</div>
|
|
942
|
+
<div class="daterange-cals">
|
|
943
|
+
${this._monthHtml(this._viewY, this._viewM)}
|
|
944
|
+
${this._monthHtml(t.y, t.m)}
|
|
945
|
+
</div>
|
|
946
|
+
<div class="datepicker-foot">
|
|
947
|
+
<span class="daterange-hint" data-range-hint></span>
|
|
948
|
+
<button type="button" class="datepicker-link" data-clear>Clear</button>
|
|
949
|
+
</div>`, this._paint();
|
|
950
|
+
}
|
|
951
|
+
_paint() {
|
|
952
|
+
let e = this.querySelector(".daterange-pop");
|
|
953
|
+
if (!e) return;
|
|
954
|
+
let t = this._start ? new Date(this._start).getTime() : null, n = this._end;
|
|
955
|
+
t && !this._end && this._hover && new Date(this._hover).getTime() >= t && (n = this._hover);
|
|
956
|
+
let r = n ? new Date(n).getTime() : null;
|
|
957
|
+
for (let n of e.querySelectorAll(".datepicker-day[data-iso]")) {
|
|
958
|
+
let e = new Date(n.dataset.iso).getTime(), i = t != null && e === t, a = r != null && e === r, o = t != null && r != null && e > t && e < r;
|
|
959
|
+
n.classList.toggle("is-range-start", i), n.classList.toggle("is-range-end", a), n.classList.toggle("in-range", o);
|
|
960
|
+
}
|
|
961
|
+
let i = e.querySelector("[data-range-hint]");
|
|
962
|
+
i && (i.textContent = this._start ? this._end ? `${pe(this._start)} – ${pe(this._end)}` : "Pick an end date" : "Pick a start date");
|
|
963
|
+
}
|
|
964
|
+
_position(e, t) {
|
|
965
|
+
P(e, t);
|
|
966
|
+
}
|
|
967
|
+
_pick(e) {
|
|
968
|
+
if (!this._start || this._start && this._end) {
|
|
969
|
+
this._start = e, this._end = "", this._hover = "", this._syncTrigger(), this._syncMirrors(), this._paint();
|
|
970
|
+
return;
|
|
971
|
+
}
|
|
972
|
+
if (new Date(e).getTime() < new Date(this._start).getTime()) {
|
|
973
|
+
this._start = e, this._paint();
|
|
974
|
+
return;
|
|
975
|
+
}
|
|
976
|
+
this._end = e, this._syncTrigger(), this._syncMirrors(), this._paint(), this.dispatchEvent(new Event("change", { bubbles: !0 })), this._close();
|
|
977
|
+
}
|
|
978
|
+
_wire() {
|
|
979
|
+
let e = this.querySelector(".daterange-trigger"), t = this.querySelector(".daterange-pop"), n = this.querySelector(".daterange");
|
|
980
|
+
if (!e || !t) return;
|
|
981
|
+
let r = () => !t.hidden;
|
|
982
|
+
this._open = () => {
|
|
983
|
+
let r = q(this._start);
|
|
984
|
+
if (r) this._viewY = r.y, this._viewM = r.m;
|
|
985
|
+
else {
|
|
986
|
+
let e = /* @__PURE__ */ new Date();
|
|
987
|
+
this._viewY = e.getFullYear(), this._viewM = e.getMonth();
|
|
988
|
+
}
|
|
989
|
+
this._renderView(), t.hidden = !1, n?.classList.add("open"), this._position(e, t), e.setAttribute("aria-expanded", "true");
|
|
990
|
+
}, this._close = () => {
|
|
991
|
+
t.hidden = !0, this._hover = "", n?.classList.remove("open"), e.setAttribute("aria-expanded", "false");
|
|
992
|
+
}, e.addEventListener("click", () => r() ? this._close() : this._open()), t.addEventListener("click", (e) => {
|
|
993
|
+
this._popClick = !0;
|
|
590
994
|
let t = e.target.closest("[data-nav]");
|
|
591
995
|
if (t) {
|
|
592
|
-
|
|
996
|
+
let e = he(this._viewY, this._viewM + Number(t.dataset.nav));
|
|
997
|
+
this._viewY = e.y, this._viewM = e.m, this._renderView();
|
|
593
998
|
return;
|
|
594
999
|
}
|
|
595
1000
|
if (e.target.closest("[data-clear]")) {
|
|
596
|
-
this.
|
|
1001
|
+
this._start = "", this._end = "", this._hover = "", this._syncTrigger(), this._syncMirrors(), this._renderView(), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
597
1002
|
return;
|
|
598
1003
|
}
|
|
599
1004
|
let n = e.target.closest(".datepicker-day[data-iso]");
|
|
600
|
-
n && !n.disabled &&
|
|
1005
|
+
n && !n.disabled && this._pick(n.dataset.iso);
|
|
1006
|
+
}), t.addEventListener("mouseover", (e) => {
|
|
1007
|
+
let t = e.target.closest(".datepicker-day[data-iso]");
|
|
1008
|
+
t && this._start && !this._end && (this._hover = t.dataset.iso, this._paint());
|
|
601
1009
|
}), this._onDocClick = (e) => {
|
|
602
|
-
|
|
1010
|
+
let t = this._popClick;
|
|
1011
|
+
this._popClick = !1, r() && !t && !this.contains(e.target) && this._close();
|
|
603
1012
|
}, document.addEventListener("click", this._onDocClick), this._onDocKey = (e) => {
|
|
604
|
-
|
|
605
|
-
}, document.addEventListener("keydown", this._onDocKey),
|
|
606
|
-
|
|
607
|
-
}), this.
|
|
1013
|
+
r() && e.key === "Escape" && this._close();
|
|
1014
|
+
}, document.addEventListener("keydown", this._onDocKey), F(this, () => {
|
|
1015
|
+
r() && this._position(e, t);
|
|
1016
|
+
}), this._syncMirrors();
|
|
608
1017
|
}
|
|
609
1018
|
disconnectedCallback() {
|
|
610
|
-
this._onDocClick && document.removeEventListener("click", this._onDocClick), this._onDocKey && document.removeEventListener("keydown", this._onDocKey),
|
|
1019
|
+
this._onDocClick && document.removeEventListener("click", this._onDocClick), this._onDocKey && document.removeEventListener("keydown", this._onDocKey), I(this);
|
|
611
1020
|
}
|
|
612
|
-
},
|
|
1021
|
+
}, _e = class extends HTMLElement {
|
|
613
1022
|
_accessibleName() {
|
|
614
1023
|
return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Select";
|
|
615
1024
|
}
|
|
@@ -644,7 +1053,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
644
1053
|
return this._values.slice();
|
|
645
1054
|
}
|
|
646
1055
|
set values(e) {
|
|
647
|
-
this._values = Array.isArray(e) ? e.map(String) : [],
|
|
1056
|
+
this._values = Array.isArray(e) ? e.map(String) : [], L(this, this._values.join(",")), this._rendered && this._renderControl();
|
|
648
1057
|
}
|
|
649
1058
|
set options(e) {
|
|
650
1059
|
this._optionsProp = Array.isArray(e) ? e : null, this.isConnected && this.render();
|
|
@@ -659,7 +1068,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
659
1068
|
value: e.getAttribute("value") ?? e.textContent.trim(),
|
|
660
1069
|
label: e.innerHTML,
|
|
661
1070
|
icon: e.getAttribute("icon") || void 0,
|
|
662
|
-
[
|
|
1071
|
+
[R]: !0,
|
|
663
1072
|
selected: e.hasAttribute("selected")
|
|
664
1073
|
})));
|
|
665
1074
|
}
|
|
@@ -672,34 +1081,34 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
672
1081
|
}
|
|
673
1082
|
_labelHtmlFor(e) {
|
|
674
1083
|
let t = this._readOptions().find((t) => String(t.value) === String(e));
|
|
675
|
-
return t ?
|
|
1084
|
+
return t ? B(t) : z(e);
|
|
676
1085
|
}
|
|
677
1086
|
render() {
|
|
678
1087
|
this._snapshotDeclared();
|
|
679
1088
|
let e = this.hasAttribute("searchable"), t = this.getAttribute("search-placeholder") || "Search…", n = this.getAttribute("icon"), r = this.getAttribute("size"), i = r === "sm" ? " search-select-sm" : r === "lg" ? " search-select-lg" : "";
|
|
680
|
-
|
|
1089
|
+
L(this, this._values.join(",")), this.innerHTML = `
|
|
681
1090
|
<div class="search-select${i}">
|
|
682
|
-
<div class="input search-select-control search-select-multi" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-label="${
|
|
683
|
-
${n ? `<i class="bi bi-${
|
|
1091
|
+
<div class="input search-select-control search-select-multi" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-label="${J(this._accessibleName())}"${this.hasAttribute("disabled") ? " aria-disabled=\"true\"" : ""}>
|
|
1092
|
+
${n ? `<i class="bi bi-${J(n)} search-select-icon" aria-hidden="true"></i>` : ""}
|
|
684
1093
|
<div class="ms-chips" data-chips></div>
|
|
685
1094
|
<i class="bi bi-chevron-down search-select-caret" aria-hidden="true"></i>
|
|
686
1095
|
</div>
|
|
687
1096
|
<div class="search-select-menu search-select-menu-fixed" role="listbox" aria-multiselectable="true" tabindex="-1" hidden>
|
|
688
|
-
${e ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${
|
|
1097
|
+
${e ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${J(t)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden><i class="bi bi-x" aria-hidden="true"></i></button></div>` : ""}
|
|
689
1098
|
<div class="search-select-options"></div>
|
|
690
1099
|
<div class="search-select-empty" hidden>No matches</div>
|
|
691
1100
|
</div>
|
|
692
|
-
</div>`, this._rendered = !0,
|
|
1101
|
+
</div>`, this._rendered = !0, L(this, this._values.join(",")), this._renderControl(), this._renderOptions(), this._wire();
|
|
693
1102
|
}
|
|
694
1103
|
_renderControl() {
|
|
695
1104
|
let e = this.querySelector("[data-chips]");
|
|
696
1105
|
if (!e) return;
|
|
697
1106
|
let t = this.getAttribute("placeholder") || "Select…";
|
|
698
1107
|
if (!this._values.length) {
|
|
699
|
-
e.innerHTML = `<span class="search-select-placeholder">${
|
|
1108
|
+
e.innerHTML = `<span class="search-select-placeholder">${z(t)}</span>`;
|
|
700
1109
|
return;
|
|
701
1110
|
}
|
|
702
|
-
e.innerHTML = this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${this._labelHtmlFor(e)}</span><button type="button" class="chip-remove" data-remove="${
|
|
1111
|
+
e.innerHTML = this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${this._labelHtmlFor(e)}</span><button type="button" class="chip-remove" data-remove="${J(e)}" aria-label="Remove"><i class="bi bi-x" aria-hidden="true"></i></button></span>`).join(""), this._collapseChips();
|
|
703
1112
|
}
|
|
704
1113
|
_collapseChips() {
|
|
705
1114
|
let e = this.querySelector("[data-chips]");
|
|
@@ -723,9 +1132,9 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
723
1132
|
let t = this.querySelector(".search-select-options"), n = this.querySelector(".search-select-empty");
|
|
724
1133
|
if (!t) return;
|
|
725
1134
|
let r = (e || "").trim().toLowerCase(), i = this._readOptions();
|
|
726
|
-
r && (i = i.filter((e) =>
|
|
1135
|
+
r && (i = i.filter((e) => ve(e.label).toLowerCase().includes(r))), t.innerHTML = i.map((e) => {
|
|
727
1136
|
let t = this._values.includes(String(e.value));
|
|
728
|
-
return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${
|
|
1137
|
+
return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${J(e.value)}" aria-selected="${t}"><span class="ms-opt-label">${B(e)}</span><span class="ms-check"><i class="bi bi-check" aria-hidden="true"></i></span></button>`;
|
|
729
1138
|
}).join(""), n && (n.hidden = i.length > 0), this._active = -1;
|
|
730
1139
|
}
|
|
731
1140
|
_wire() {
|
|
@@ -733,7 +1142,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
733
1142
|
if (!e || !t) return;
|
|
734
1143
|
let a = () => this.hasAttribute("disabled");
|
|
735
1144
|
!this._ro && typeof ResizeObserver < "u" && (this._ro = new ResizeObserver(() => this._collapseChips()), this._ro.observe(this));
|
|
736
|
-
let o = () =>
|
|
1145
|
+
let o = () => P(e, t, { matchWidth: !0 }), s = () => [...this.querySelectorAll(".search-select-option")], c = () => s().filter((e) => !e.hidden), l = (e) => {
|
|
737
1146
|
let t = c();
|
|
738
1147
|
this._active = e;
|
|
739
1148
|
for (let e of s()) e.classList.remove("is-active");
|
|
@@ -743,7 +1152,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
743
1152
|
}, f = () => {
|
|
744
1153
|
t.hidden = !0, e.setAttribute("aria-expanded", "false"), e.classList.remove("open"), l(-1);
|
|
745
1154
|
}, p = () => {
|
|
746
|
-
|
|
1155
|
+
L(this, this._values.join(",")), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
747
1156
|
}, m = (e) => {
|
|
748
1157
|
let t = String(e);
|
|
749
1158
|
this._values.includes(t) ? this._values = this._values.filter((e) => e !== t) : this._values = [...this._values, t], this._renderControl(), this._renderOptions(n ? n.value : ""), p();
|
|
@@ -780,14 +1189,14 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
780
1189
|
(e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") && (e.preventDefault(), d());
|
|
781
1190
|
}), this._onDocClick = (e) => {
|
|
782
1191
|
u() && !this.contains(e.target) && f();
|
|
783
|
-
}, document.addEventListener("click", this._onDocClick),
|
|
1192
|
+
}, document.addEventListener("click", this._onDocClick), F(this, () => {
|
|
784
1193
|
u() && o();
|
|
785
1194
|
});
|
|
786
1195
|
}
|
|
787
1196
|
disconnectedCallback() {
|
|
788
|
-
this._onDocClick && document.removeEventListener("click", this._onDocClick),
|
|
1197
|
+
this._onDocClick && document.removeEventListener("click", this._onDocClick), I(this), this._ro?.disconnect(), this._ro = null;
|
|
789
1198
|
}
|
|
790
|
-
},
|
|
1199
|
+
}, J = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), ve = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), ye = /[^0-9]/g, be = /[^0-9a-zA-Z]/g, xe = class extends HTMLElement {
|
|
791
1200
|
static get observedAttributes() {
|
|
792
1201
|
return [
|
|
793
1202
|
"value",
|
|
@@ -814,16 +1223,16 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
814
1223
|
return this._value ?? "";
|
|
815
1224
|
}
|
|
816
1225
|
set value(e) {
|
|
817
|
-
this._value = this._clean(e),
|
|
1226
|
+
this._value = this._clean(e), L(this, this._value), this._paint();
|
|
818
1227
|
}
|
|
819
1228
|
_clean(e) {
|
|
820
|
-
return (e == null ? "" : String(e)).replace(this.mode === "alphanumeric" ?
|
|
1229
|
+
return (e == null ? "" : String(e)).replace(this.mode === "alphanumeric" ? be : ye, "").slice(0, this.length);
|
|
821
1230
|
}
|
|
822
1231
|
connectedCallback() {
|
|
823
1232
|
this._rendered || this.render();
|
|
824
1233
|
}
|
|
825
1234
|
attributeChangedCallback(e, t, n) {
|
|
826
|
-
this._rendered && (e === "value" ? (this._value = this._clean(n),
|
|
1235
|
+
this._rendered && (e === "value" ? (this._value = this._clean(n), L(this, this._value), this._paint()) : this.render());
|
|
827
1236
|
}
|
|
828
1237
|
render() {
|
|
829
1238
|
this._value = this._clean(this.getAttribute("value") ?? this._value);
|
|
@@ -841,7 +1250,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
841
1250
|
spellcheck="false"
|
|
842
1251
|
${n ? "disabled" : ""} />
|
|
843
1252
|
<div class="otp-slots" aria-hidden="true">${r}</div>
|
|
844
|
-
</div>`, this._rendered = !0,
|
|
1253
|
+
</div>`, this._rendered = !0, L(this, this._value), this._wire(), this._paint();
|
|
845
1254
|
}
|
|
846
1255
|
_refs() {
|
|
847
1256
|
return {
|
|
@@ -863,7 +1272,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
863
1272
|
if (!e) return;
|
|
864
1273
|
let t = (e) => {
|
|
865
1274
|
let t = this._clean(e), n = t !== this._value;
|
|
866
|
-
this._value = t,
|
|
1275
|
+
this._value = t, L(this, this._value), this._paint(), n && this.dispatchEvent(new Event("change", { bubbles: !0 })), n && t.length === this.length && this.dispatchEvent(new CustomEvent("complete", {
|
|
867
1276
|
bubbles: !0,
|
|
868
1277
|
detail: t
|
|
869
1278
|
}));
|
|
@@ -883,7 +1292,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
883
1292
|
document.activeElement === e && this._paint();
|
|
884
1293
|
});
|
|
885
1294
|
}
|
|
886
|
-
},
|
|
1295
|
+
}, Se = [
|
|
887
1296
|
[
|
|
888
1297
|
"AF",
|
|
889
1298
|
"Afghanistan",
|
|
@@ -2109,11 +2518,67 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2109
2518
|
"Zimbabwe",
|
|
2110
2519
|
"263"
|
|
2111
2520
|
]
|
|
2112
|
-
],
|
|
2521
|
+
], Ce = (e) => (Se.find((t) => t[0] === e) || [
|
|
2113
2522
|
"",
|
|
2114
2523
|
"",
|
|
2115
2524
|
""
|
|
2116
|
-
])[2],
|
|
2525
|
+
])[2], we = (e) => `wui-flag wui-flag-${String(e).toLowerCase()}`, Y = null, Te = null;
|
|
2526
|
+
function Ee() {
|
|
2527
|
+
return Y ? Promise.resolve(Y) : (Te ||= Promise.all([import("./libphonenumber-js-BcNT8oq0-DMpMlice.js"), import("./examples.mobile.json-BMXTGiGC-Dl_Tt3py.js")]).then(([e, t]) => (Y = {
|
|
2528
|
+
AsYouType: e.AsYouType,
|
|
2529
|
+
getExampleNumber: e.getExampleNumber,
|
|
2530
|
+
isValidPhoneNumber: e.isValidPhoneNumber,
|
|
2531
|
+
examples: t.default || t
|
|
2532
|
+
}, Y)).catch(() => null), Te);
|
|
2533
|
+
}
|
|
2534
|
+
function De(e, t) {
|
|
2535
|
+
if (!Y || !t) return t;
|
|
2536
|
+
try {
|
|
2537
|
+
return new Y.AsYouType(e).input(t);
|
|
2538
|
+
} catch {
|
|
2539
|
+
return t;
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
function Oe(e) {
|
|
2543
|
+
if (!Y) return null;
|
|
2544
|
+
try {
|
|
2545
|
+
return Y.getExampleNumber(e, Y.examples)?.formatNational() || null;
|
|
2546
|
+
} catch {
|
|
2547
|
+
return null;
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
function ke(e) {
|
|
2551
|
+
if (!Y || !e) return null;
|
|
2552
|
+
try {
|
|
2553
|
+
return Y.isValidPhoneNumber(e);
|
|
2554
|
+
} catch {
|
|
2555
|
+
return null;
|
|
2556
|
+
}
|
|
2557
|
+
}
|
|
2558
|
+
function Ae(e) {
|
|
2559
|
+
if (!Y) return null;
|
|
2560
|
+
try {
|
|
2561
|
+
let t = Y.getExampleNumber(e, Y.examples);
|
|
2562
|
+
return t?.nationalNumber ? t.nationalNumber.length : null;
|
|
2563
|
+
} catch {
|
|
2564
|
+
return null;
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
function je(e) {
|
|
2568
|
+
if (!Y || !e?.trim().startsWith("+")) return null;
|
|
2569
|
+
try {
|
|
2570
|
+
let t = new Y.AsYouType();
|
|
2571
|
+
t.input(e.trim());
|
|
2572
|
+
let n = t.getCountry();
|
|
2573
|
+
return n ? {
|
|
2574
|
+
country: n,
|
|
2575
|
+
national: t.getNationalNumber() || ""
|
|
2576
|
+
} : null;
|
|
2577
|
+
} catch {
|
|
2578
|
+
return null;
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
var Me = class extends HTMLElement {
|
|
2117
2582
|
static get observedAttributes() {
|
|
2118
2583
|
return [
|
|
2119
2584
|
"value",
|
|
@@ -2132,73 +2597,97 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2132
2597
|
this._rendered && (e === "country" && (this._country = n || "IN"), this.render());
|
|
2133
2598
|
}
|
|
2134
2599
|
get value() {
|
|
2135
|
-
return `+${
|
|
2600
|
+
return `+${Ce(this._country)}${this._national}`;
|
|
2136
2601
|
}
|
|
2137
2602
|
set value(e) {
|
|
2138
2603
|
this._national = String(e ?? "").replace(/[^0-9]/g, ""), this._commit();
|
|
2139
2604
|
}
|
|
2140
2605
|
_commit() {
|
|
2141
|
-
|
|
2606
|
+
L(this, this.value), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2142
2607
|
}
|
|
2143
2608
|
render() {
|
|
2144
|
-
let e = this.getAttribute("placeholder") || "Enter phone number";
|
|
2609
|
+
let e = this.getAttribute("placeholder") || Oe(this._country) || "Enter phone number";
|
|
2145
2610
|
this._country = this.getAttribute("country") || this._country;
|
|
2146
|
-
let t =
|
|
2611
|
+
let t = Se.map(([e, t, n]) => `<button type="button" role="option" class="country-dropdown-item${e === this._country ? " selected" : ""}" data-iso="${e}"><span class="${we(e)}" aria-hidden="true"></span><span class="country-name-text">${t}<span class="country-code-text">+${n}</span></span></button>`).join("");
|
|
2147
2612
|
this.innerHTML = `
|
|
2148
2613
|
<div class="phone-input-wrap">
|
|
2149
2614
|
<div class="phone-country-adornment">
|
|
2150
2615
|
<button type="button" class="country-toggle" aria-haspopup="listbox" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}>
|
|
2151
|
-
<span class="${
|
|
2616
|
+
<span class="${we(this._country)}" data-flag aria-hidden="true"></span>
|
|
2152
2617
|
<i class="bi bi-chevron-down phone-chevron" aria-hidden="true"></i>
|
|
2153
|
-
<span class="phone-dial" data-dial>+${
|
|
2618
|
+
<span class="phone-dial" data-dial>+${Ce(this._country)}</span>
|
|
2154
2619
|
</button>
|
|
2155
2620
|
<div class="country-dropdown-menu" role="listbox" hidden>
|
|
2156
2621
|
<div class="dropdown-search-wrapper"><span class="dropdown-search-icon"><i class="bi bi-search" aria-hidden="true"></i></span><input type="text" class="dropdown-search-input" placeholder="Search country or code" aria-label="Search countries" /></div>
|
|
2157
2622
|
<div class="country-list-scroll">${t}<div class="country-empty" hidden>No countries found</div></div>
|
|
2158
2623
|
</div>
|
|
2159
2624
|
</div>
|
|
2160
|
-
<input type="tel" class="input" placeholder="${
|
|
2161
|
-
</div
|
|
2625
|
+
<input type="tel" class="input" placeholder="${Ne(e)}" value="${Ne(De(this._country, this._national))}"${this.hasAttribute("disabled") ? " disabled" : ""} />
|
|
2626
|
+
</div>
|
|
2627
|
+
<div class="field-error" data-phone-error hidden></div>`, this._rendered = !0, L(this, this.value), this._wire();
|
|
2162
2628
|
}
|
|
2163
2629
|
_wire() {
|
|
2164
|
-
let e = this.querySelector(".country-toggle"), t = this.querySelector(".country-dropdown-menu"),
|
|
2165
|
-
if (!e || !
|
|
2166
|
-
let
|
|
2167
|
-
let
|
|
2168
|
-
|
|
2169
|
-
}, u = () => {
|
|
2170
|
-
t.hidden = !1, e.setAttribute("aria-expanded", "true"), n.value = "", f(""), l(), n.focus();
|
|
2630
|
+
let e = this.querySelector(".country-toggle"), t = this.querySelector(".phone-input-wrap"), n = this.querySelector(".country-dropdown-menu"), r = this.querySelector(".dropdown-search-input"), i = this.querySelector(".country-list-scroll"), a = this.querySelector(".country-empty"), o = this.querySelector("input[type=tel]"), s = this.querySelector("[data-flag]"), c = this.querySelector("[data-dial]");
|
|
2631
|
+
if (!e || !n) return;
|
|
2632
|
+
let l = () => !n.hidden, u = () => {
|
|
2633
|
+
let r = (t || e).getBoundingClientRect(), i = n.offsetWidth || 320, a = n.offsetHeight || 320, o = window.innerHeight - r.bottom, s = o < a + 6 && r.top > o ? r.top - a - 6 : r.bottom + 6, c = Math.min(Math.max(8, r.left), Math.max(8, window.innerWidth - i - 8));
|
|
2634
|
+
n.style.top = `${Math.max(8, s)}px`, n.style.left = `${c}px`;
|
|
2171
2635
|
}, d = () => {
|
|
2172
|
-
|
|
2636
|
+
n.hidden = !1, e.setAttribute("aria-expanded", "true"), r.value = "", p(""), u(), r.focus();
|
|
2637
|
+
}, f = () => {
|
|
2638
|
+
n.hidden = !0, e.setAttribute("aria-expanded", "false");
|
|
2173
2639
|
};
|
|
2174
2640
|
this._reposition = () => {
|
|
2175
|
-
|
|
2641
|
+
l() && u();
|
|
2176
2642
|
}, window.addEventListener("scroll", this._reposition, !0), window.addEventListener("resize", this._reposition);
|
|
2177
|
-
let
|
|
2643
|
+
let p = (e) => {
|
|
2178
2644
|
let t = e.trim().toLowerCase(), n = 0;
|
|
2179
|
-
for (let e of
|
|
2645
|
+
for (let e of i.querySelectorAll(".country-dropdown-item")) {
|
|
2180
2646
|
let r = !t || e.textContent.toLowerCase().includes(t);
|
|
2181
2647
|
e.hidden = !r, r && (n += 1);
|
|
2182
2648
|
}
|
|
2183
|
-
|
|
2184
|
-
},
|
|
2185
|
-
this._country = e, this.setAttribute("country", e),
|
|
2186
|
-
for (let t of
|
|
2187
|
-
|
|
2649
|
+
a && (a.hidden = n > 0);
|
|
2650
|
+
}, m = (e) => {
|
|
2651
|
+
this._country = e, this.setAttribute("country", e), s && (s.className = we(e)), c && (c.textContent = `+${Ce(e)}`);
|
|
2652
|
+
for (let t of i.querySelectorAll(".country-dropdown-item")) t.classList.toggle("selected", t.dataset.iso === e);
|
|
2653
|
+
f(), this._commit();
|
|
2188
2654
|
};
|
|
2189
|
-
e.addEventListener("click", () =>
|
|
2655
|
+
e.addEventListener("click", () => l() ? f() : d()), r.addEventListener("input", () => p(r.value)), i.addEventListener("click", (e) => {
|
|
2190
2656
|
let t = e.target.closest(".country-dropdown-item");
|
|
2191
|
-
t &&
|
|
2192
|
-
})
|
|
2193
|
-
|
|
2657
|
+
t && m(t.dataset.iso);
|
|
2658
|
+
});
|
|
2659
|
+
let h = this.querySelector("[data-phone-error]"), g = (e) => {
|
|
2660
|
+
if (o.classList.toggle("is-invalid", e), e ? o.setAttribute("aria-invalid", "true") : o.removeAttribute("aria-invalid"), h) {
|
|
2661
|
+
if (e) {
|
|
2662
|
+
let e = Oe(this._country);
|
|
2663
|
+
h.textContent = e ? `Enter a valid phone number, e.g. ${e}` : "Enter a valid phone number";
|
|
2664
|
+
}
|
|
2665
|
+
h.hidden = !e;
|
|
2666
|
+
}
|
|
2667
|
+
};
|
|
2668
|
+
o.addEventListener("input", () => {
|
|
2669
|
+
let e = o.value.replace(/[^0-9]/g, ""), t = Ae(this._country);
|
|
2670
|
+
t && e.length > t && (e = e.slice(0, t)), this._national = e;
|
|
2671
|
+
let n = De(this._country, this._national);
|
|
2672
|
+
o.value !== n && (o.value = n), this._commit(), o.classList.contains("is-invalid") && (!this._national || ke(this.value) === !0) && g(!1);
|
|
2673
|
+
}), o.addEventListener("blur", () => {
|
|
2674
|
+
g(this._national.length > 0 && ke(this.value) === !1);
|
|
2675
|
+
}), o.addEventListener("paste", (e) => {
|
|
2676
|
+
let t = je(e.clipboardData?.getData("text"));
|
|
2677
|
+
t && (e.preventDefault(), this._national = t.national.replace(/[^0-9]/g, ""), t.country === this._country ? o.value = De(this._country, this._national) : this.setAttribute("country", t.country), this._commit(), this.querySelector("input[type=tel]")?.focus());
|
|
2194
2678
|
}), this._onDocClick = (e) => {
|
|
2195
|
-
|
|
2196
|
-
}, document.addEventListener("click", this._onDocClick),
|
|
2679
|
+
l() && !this.contains(e.target) && f();
|
|
2680
|
+
}, document.addEventListener("click", this._onDocClick), Ee().then((e) => {
|
|
2681
|
+
if (!(!e || !o) && (this._national && (o.value = De(this._country, this._national)), !this.getAttribute("placeholder"))) {
|
|
2682
|
+
let e = Oe(this._country);
|
|
2683
|
+
e && (o.placeholder = e);
|
|
2684
|
+
}
|
|
2685
|
+
}), L(this, this.value);
|
|
2197
2686
|
}
|
|
2198
2687
|
disconnectedCallback() {
|
|
2199
2688
|
this._reposition && (window.removeEventListener("scroll", this._reposition, !0), window.removeEventListener("resize", this._reposition)), this._onDocClick && document.removeEventListener("click", this._onDocClick);
|
|
2200
2689
|
}
|
|
2201
|
-
},
|
|
2690
|
+
}, Ne = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), Pe = class extends HTMLElement {
|
|
2202
2691
|
static get observedAttributes() {
|
|
2203
2692
|
return [
|
|
2204
2693
|
"value",
|
|
@@ -2230,7 +2719,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2230
2719
|
return this._value;
|
|
2231
2720
|
}
|
|
2232
2721
|
set value(e) {
|
|
2233
|
-
this._value = e == null ? "" : String(e),
|
|
2722
|
+
this._value = e == null ? "" : String(e), L(this, this._value), this._syncSelected(), this._syncReset();
|
|
2234
2723
|
}
|
|
2235
2724
|
set options(e) {
|
|
2236
2725
|
this._optionsProp = Array.isArray(e) ? e : null, this.isConnected && this.render();
|
|
@@ -2245,7 +2734,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2245
2734
|
value: e.getAttribute("value") ?? e.textContent.trim(),
|
|
2246
2735
|
label: e.innerHTML,
|
|
2247
2736
|
icon: e.getAttribute("icon") || void 0,
|
|
2248
|
-
[
|
|
2737
|
+
[R]: !0,
|
|
2249
2738
|
selected: e.hasAttribute("selected")
|
|
2250
2739
|
})));
|
|
2251
2740
|
}
|
|
@@ -2255,25 +2744,25 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2255
2744
|
render() {
|
|
2256
2745
|
this._snapshotDeclared();
|
|
2257
2746
|
let e = this._readOptions(), t = this.hasAttribute("searchable"), n = this.hasAttribute("clearable"), r = this.getAttribute("size"), i = r === "sm" ? " search-select-sm" : r === "lg" ? " search-select-lg" : "", a = this.getAttribute("icon"), o = this.getAttribute("prefix"), s = this.getAttribute("placeholder") || "Select...", c = this.getAttribute("search-placeholder") || "Search...", l = e.find((e) => String(e.value) === String(this._value)) || e.find((e) => e.selected);
|
|
2258
|
-
l && (this._value = String(l.value)),
|
|
2747
|
+
l && (this._value = String(l.value)), L(this, this._value);
|
|
2259
2748
|
let u = e.map((e) => {
|
|
2260
2749
|
let t = String(e.value) === String(this._value);
|
|
2261
|
-
return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${
|
|
2750
|
+
return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${Fe(e.value)}" aria-selected="${t}">${B(e)}</button>`;
|
|
2262
2751
|
}).join("");
|
|
2263
2752
|
this.innerHTML = `
|
|
2264
2753
|
<div class="search-select${this.hasAttribute("compact") ? " search-select-compact" : ""}${i}">
|
|
2265
|
-
<button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false" aria-label="${
|
|
2266
|
-
${a ? `<i class="bi bi-${
|
|
2267
|
-
${o ? `<span class="search-select-prefix">${
|
|
2268
|
-
<span class="${l ? "" : "search-select-placeholder"}" data-label>${l ?
|
|
2754
|
+
<button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false" aria-label="${Fe(this._accessibleName())}"${this.hasAttribute("disabled") ? " disabled" : ""}>
|
|
2755
|
+
${a ? `<i class="bi bi-${Fe(a)} search-select-icon" aria-hidden="true"></i>` : ""}
|
|
2756
|
+
${o ? `<span class="search-select-prefix">${z(o)}</span>` : ""}
|
|
2757
|
+
<span class="${l ? "" : "search-select-placeholder"}" data-label>${l ? B(l) : z(s)}</span>
|
|
2269
2758
|
${n ? "<span class=\"search-select-reset\" role=\"button\" aria-label=\"Clear selection\" hidden><i class=\"bi bi-x-lg\" aria-hidden=\"true\"></i></span>" : ""}
|
|
2270
2759
|
<i class="bi bi-chevron-down search-select-caret" aria-hidden="true"></i>
|
|
2271
2760
|
</button>
|
|
2272
2761
|
<div class="search-select-menu search-select-menu-fixed" role="listbox" tabindex="-1" hidden>
|
|
2273
|
-
${t ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${
|
|
2762
|
+
${t ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${Fe(c)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden><i class="bi bi-x" aria-hidden="true"></i></button></div>` : ""}
|
|
2274
2763
|
<div class="search-select-options">${u}<div class="search-select-empty" hidden>No matches</div></div>
|
|
2275
2764
|
</div>
|
|
2276
|
-
</div>`, this._rendered = !0,
|
|
2765
|
+
</div>`, this._rendered = !0, L(this, this._value), this._wire(), this._syncReset();
|
|
2277
2766
|
}
|
|
2278
2767
|
_refs() {
|
|
2279
2768
|
return {
|
|
@@ -2299,7 +2788,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2299
2788
|
let t = e.dataset.value === String(this._value);
|
|
2300
2789
|
e.classList.toggle("selected", t), e.setAttribute("aria-selected", String(t));
|
|
2301
2790
|
}
|
|
2302
|
-
e && (e.innerHTML = t ?
|
|
2791
|
+
e && (e.innerHTML = t ? B(t) : e.innerHTML, e.classList.toggle("search-select-placeholder", !t));
|
|
2303
2792
|
}
|
|
2304
2793
|
_syncReset() {
|
|
2305
2794
|
let { reset: e } = this._refs();
|
|
@@ -2311,8 +2800,8 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2311
2800
|
let t = () => {
|
|
2312
2801
|
if (this.hasAttribute("compact")) {
|
|
2313
2802
|
let t = e.control.getBoundingClientRect();
|
|
2314
|
-
e.menu.style.width = "max-content", e.menu.style.minWidth = `${t.width}px`, e.menu.style.maxWidth = "280px",
|
|
2315
|
-
} else
|
|
2803
|
+
e.menu.style.width = "max-content", e.menu.style.minWidth = `${t.width}px`, e.menu.style.maxWidth = "280px", P(e.control, e.menu);
|
|
2804
|
+
} else P(e.control, e.menu, { matchWidth: !0 });
|
|
2316
2805
|
}, n = (e) => {
|
|
2317
2806
|
let t = this._visible();
|
|
2318
2807
|
this._active = e;
|
|
@@ -2355,21 +2844,21 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2355
2844
|
e.search.value = "", r(""), e.search.focus();
|
|
2356
2845
|
}), e.menu.addEventListener("keydown", c), this._onDocClick = (e) => {
|
|
2357
2846
|
i() && !this.contains(e.target) && o();
|
|
2358
|
-
}, document.addEventListener("click", this._onDocClick),
|
|
2847
|
+
}, document.addEventListener("click", this._onDocClick), F(this, () => {
|
|
2359
2848
|
i() && t();
|
|
2360
2849
|
});
|
|
2361
2850
|
}
|
|
2362
2851
|
disconnectedCallback() {
|
|
2363
|
-
this._onDocClick && document.removeEventListener("click", this._onDocClick),
|
|
2852
|
+
this._onDocClick && document.removeEventListener("click", this._onDocClick), I(this);
|
|
2364
2853
|
}
|
|
2365
|
-
},
|
|
2854
|
+
}, Fe = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), Ie = "image/png,image/jpeg,image/webp", Le = {
|
|
2366
2855
|
"image/png": [".png"],
|
|
2367
2856
|
"image/jpeg": [".jpg", ".jpeg"],
|
|
2368
2857
|
"image/webp": [".webp"],
|
|
2369
2858
|
"image/gif": [".gif"],
|
|
2370
2859
|
"image/svg+xml": [".svg"],
|
|
2371
2860
|
"application/pdf": [".pdf"]
|
|
2372
|
-
},
|
|
2861
|
+
}, Re = {
|
|
2373
2862
|
"image/png": "PNG",
|
|
2374
2863
|
"image/jpeg": "JPG",
|
|
2375
2864
|
"image/webp": "WEBP",
|
|
@@ -2383,36 +2872,36 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2383
2872
|
".gif": "GIF",
|
|
2384
2873
|
".svg": "SVG",
|
|
2385
2874
|
".pdf": "PDF"
|
|
2386
|
-
},
|
|
2387
|
-
function
|
|
2875
|
+
}, ze = (e) => String(e || "").split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
|
|
2876
|
+
function Be(e) {
|
|
2388
2877
|
let t = [];
|
|
2389
|
-
for (let n of
|
|
2390
|
-
let e =
|
|
2878
|
+
for (let n of ze(e)) {
|
|
2879
|
+
let e = Re[n] || (n.startsWith(".") ? n.slice(1).toUpperCase() : n.toUpperCase());
|
|
2391
2880
|
t.includes(e) || t.push(e);
|
|
2392
2881
|
}
|
|
2393
2882
|
return t.length <= 1 ? t[0] || "supported" : `${t.slice(0, -1).join(", ")} or ${t[t.length - 1]}`;
|
|
2394
2883
|
}
|
|
2395
|
-
function
|
|
2396
|
-
let n =
|
|
2884
|
+
function Ve(e, t) {
|
|
2885
|
+
let n = ze(t);
|
|
2397
2886
|
if (!n.length) return !0;
|
|
2398
2887
|
let r = (e.type || "").toLowerCase(), i = (e.name || "").toLowerCase();
|
|
2399
|
-
return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (
|
|
2888
|
+
return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (Le[e] || []).some((e) => i.endsWith(e)));
|
|
2400
2889
|
}
|
|
2401
|
-
function
|
|
2890
|
+
function He(e, t = {}) {
|
|
2402
2891
|
if (!e) return null;
|
|
2403
|
-
let n = t.accept === void 0 ?
|
|
2404
|
-
return
|
|
2892
|
+
let n = t.accept === void 0 ? Ie : t.accept, r = t.maxSizeMb || 5;
|
|
2893
|
+
return Ve(e, n) ? e.size > r * 1024 * 1024 ? `Keep the file under ${r} MB.` : null : `Choose a ${Be(n)} file.`;
|
|
2405
2894
|
}
|
|
2406
|
-
var
|
|
2895
|
+
var X = (e, t) => {
|
|
2407
2896
|
typeof customElements < "u" && !customElements.get(e) && customElements.define(e, t);
|
|
2408
2897
|
};
|
|
2409
|
-
function
|
|
2410
|
-
|
|
2898
|
+
function Ue() {
|
|
2899
|
+
X("wui-select", Pe), X("wui-phone", Me), X("wui-datepicker", ce), X("wui-date-range", ge), X("wui-autocomplete", re), X("wui-multiselect", _e), X("wui-otp", xe), X("wui-status-icon", ee);
|
|
2411
2900
|
}
|
|
2412
|
-
|
|
2901
|
+
Ue();
|
|
2413
2902
|
//#endregion
|
|
2414
2903
|
//#region src/components/RequiredMark.jsx
|
|
2415
|
-
function
|
|
2904
|
+
function Z() {
|
|
2416
2905
|
return /* @__PURE__ */ t("span", {
|
|
2417
2906
|
className: "required",
|
|
2418
2907
|
"aria-hidden": "true",
|
|
@@ -2421,7 +2910,7 @@ function X() {
|
|
|
2421
2910
|
}
|
|
2422
2911
|
//#endregion
|
|
2423
2912
|
//#region src/components/AppAutocomplete.jsx
|
|
2424
|
-
function
|
|
2913
|
+
function We({ value: e, onChange: r, options: i, loadOptions: o, placeholder: s = "Search…", minChars: l, debounce: u, disabled: d = !1, size: f, name: p, label: m, error: h, hint: g, required: _ = !1, fieldClassName: v = "", ...y }) {
|
|
2425
2914
|
T("AppAutocomplete", y);
|
|
2426
2915
|
let b = c(null), x = typeof o == "function";
|
|
2427
2916
|
return a(() => {
|
|
@@ -2456,7 +2945,7 @@ function Ee({ value: e, onChange: r, options: i, loadOptions: o, placeholder: s
|
|
|
2456
2945
|
m && /* @__PURE__ */ n("label", {
|
|
2457
2946
|
className: "label",
|
|
2458
2947
|
htmlFor: p,
|
|
2459
|
-
children: [m, _ && /* @__PURE__ */ t(
|
|
2948
|
+
children: [m, _ && /* @__PURE__ */ t(Z, {})]
|
|
2460
2949
|
}),
|
|
2461
2950
|
/* @__PURE__ */ t("wui-autocomplete", {
|
|
2462
2951
|
"aria-label": typeof m == "string" ? m : void 0,
|
|
@@ -2483,13 +2972,13 @@ function Ee({ value: e, onChange: r, options: i, loadOptions: o, placeholder: s
|
|
|
2483
2972
|
}
|
|
2484
2973
|
//#endregion
|
|
2485
2974
|
//#region src/components/AppAvatar.jsx
|
|
2486
|
-
function
|
|
2975
|
+
function Ge(e) {
|
|
2487
2976
|
let t = (e || "").trim();
|
|
2488
2977
|
if (!t) return "?";
|
|
2489
2978
|
let n = t.split(/\s+/).filter(Boolean);
|
|
2490
2979
|
return n.length === 1 ? n[0].slice(0, 2).toUpperCase() : (n[0][0] + n[n.length - 1][0]).toUpperCase();
|
|
2491
2980
|
}
|
|
2492
|
-
function
|
|
2981
|
+
function Ke({ name: e, src: n, className: r = "", ...i }) {
|
|
2493
2982
|
T("AppAvatar", i);
|
|
2494
2983
|
let a = ["avatar", r].filter(Boolean).join(" ");
|
|
2495
2984
|
return n ? /* @__PURE__ */ t("span", {
|
|
@@ -2503,12 +2992,12 @@ function Oe({ name: e, src: n, className: r = "", ...i }) {
|
|
|
2503
2992
|
className: a,
|
|
2504
2993
|
role: "img",
|
|
2505
2994
|
"aria-label": e,
|
|
2506
|
-
children:
|
|
2995
|
+
children: Ge(e)
|
|
2507
2996
|
});
|
|
2508
2997
|
}
|
|
2509
2998
|
//#endregion
|
|
2510
2999
|
//#region src/components/AppBadge.jsx
|
|
2511
|
-
function
|
|
3000
|
+
function qe({ children: e, tone: n, dot: r = !1, className: i = "", ...a }) {
|
|
2512
3001
|
return T("AppBadge", a), /* @__PURE__ */ t(d, {
|
|
2513
3002
|
bg: !1,
|
|
2514
3003
|
className: [
|
|
@@ -2522,14 +3011,14 @@ function ke({ children: e, tone: n, dot: r = !1, className: i = "", ...a }) {
|
|
|
2522
3011
|
}
|
|
2523
3012
|
//#endregion
|
|
2524
3013
|
//#region src/components/AppButton.jsx
|
|
2525
|
-
var
|
|
3014
|
+
var Je = {
|
|
2526
3015
|
primary: "primary",
|
|
2527
3016
|
secondary: "secondary",
|
|
2528
3017
|
outline: "outline-primary",
|
|
2529
3018
|
ghost: "link",
|
|
2530
3019
|
danger: "danger"
|
|
2531
3020
|
};
|
|
2532
|
-
function
|
|
3021
|
+
function Ye(e, n) {
|
|
2533
3022
|
if (!e) return null;
|
|
2534
3023
|
let r = n === "left" ? "me-2" : "ms-2";
|
|
2535
3024
|
return typeof e == "string" ? /* @__PURE__ */ t(O, {
|
|
@@ -2541,12 +3030,12 @@ function je(e, n) {
|
|
|
2541
3030
|
children: e
|
|
2542
3031
|
});
|
|
2543
3032
|
}
|
|
2544
|
-
function
|
|
3033
|
+
function Q({ children: e, variant: r = "primary", size: i = "md", type: a = "button", loading: o = !1, disabled: s = !1, block: c = !1, leftIcon: l = null, rightIcon: u = null, className: d = "", ...p }) {
|
|
2545
3034
|
T("AppButton", p);
|
|
2546
3035
|
let m = [c ? "w-100" : "", d].filter(Boolean).join(" ");
|
|
2547
3036
|
return /* @__PURE__ */ n(f, {
|
|
2548
3037
|
type: (p.as === void 0 || p.as === "button") && p.href === void 0 ? a : void 0,
|
|
2549
|
-
variant:
|
|
3038
|
+
variant: Je[r] ?? "primary",
|
|
2550
3039
|
size: i === "md" ? void 0 : i,
|
|
2551
3040
|
disabled: s || o,
|
|
2552
3041
|
className: m || void 0,
|
|
@@ -2556,15 +3045,15 @@ function Z({ children: e, variant: r = "primary", size: i = "md", type: a = "but
|
|
|
2556
3045
|
className: "spinner-border spinner-border-sm me-2",
|
|
2557
3046
|
"aria-hidden": "true"
|
|
2558
3047
|
}),
|
|
2559
|
-
!o &&
|
|
3048
|
+
!o && Ye(l, "left"),
|
|
2560
3049
|
e,
|
|
2561
|
-
!o &&
|
|
3050
|
+
!o && Ye(u, "right")
|
|
2562
3051
|
]
|
|
2563
3052
|
});
|
|
2564
3053
|
}
|
|
2565
3054
|
//#endregion
|
|
2566
3055
|
//#region src/components/AppCallout.jsx
|
|
2567
|
-
function
|
|
3056
|
+
function Xe({ children: e, icon: r = "info", className: i = "", ...a }) {
|
|
2568
3057
|
return T("AppCallout", a), /* @__PURE__ */ n("div", {
|
|
2569
3058
|
className: `info-callout${i ? ` ${i}` : ""}`,
|
|
2570
3059
|
children: [r && /* @__PURE__ */ t("span", {
|
|
@@ -2578,7 +3067,7 @@ function Me({ children: e, icon: r = "info", className: i = "", ...a }) {
|
|
|
2578
3067
|
}
|
|
2579
3068
|
//#endregion
|
|
2580
3069
|
//#region src/components/AppCard.jsx
|
|
2581
|
-
function
|
|
3070
|
+
function Ze({ title: r, titleClassName: i = "", header: a, headerExtra: o, headerActions: s, children: c, className: l = "", bodyClassName: u = "", headerClassName: d = "", body: f = !0, lifted: m = !1, ...h }) {
|
|
2582
3071
|
T("AppCard", h);
|
|
2583
3072
|
let g = a != null || r != null || o != null || s != null;
|
|
2584
3073
|
return /* @__PURE__ */ n(p, {
|
|
@@ -2603,7 +3092,7 @@ function Ne({ title: r, titleClassName: i = "", header: a, headerExtra: o, heade
|
|
|
2603
3092
|
}
|
|
2604
3093
|
//#endregion
|
|
2605
3094
|
//#region src/components/AppCheckbox.jsx
|
|
2606
|
-
var
|
|
3095
|
+
var Qe = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
2607
3096
|
T("AppCheckbox", s);
|
|
2608
3097
|
let l = o(), u = r || i || l;
|
|
2609
3098
|
return /* @__PURE__ */ n("div", {
|
|
@@ -2624,7 +3113,7 @@ var Pe = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
|
2624
3113
|
});
|
|
2625
3114
|
//#endregion
|
|
2626
3115
|
//#region src/components/AppChip.jsx
|
|
2627
|
-
function
|
|
3116
|
+
function $e({ label: r, children: i, tone: a = "neutral", size: o = "md", leadingIcon: s, avatar: c, onRemove: l, onClick: u, disabled: d = !1, removeLabel: f, className: p = "", ...m }) {
|
|
2628
3117
|
T("AppChip", m);
|
|
2629
3118
|
let h = r ?? i, g = [
|
|
2630
3119
|
"chip",
|
|
@@ -2676,7 +3165,7 @@ function Fe({ label: r, children: i, tone: a = "neutral", size: o = "md", leadin
|
|
|
2676
3165
|
}
|
|
2677
3166
|
//#endregion
|
|
2678
3167
|
//#region src/components/AppChoiceCard.jsx
|
|
2679
|
-
function
|
|
3168
|
+
function et({ name: r, multiple: i = !1, value: a, checked: o, onChange: s, icon: c, iconNode: l, iconSize: u = 18, image: d, imageAlt: f = "", children: p, title: m, description: h, checkIcon: g = "check", checkSize: _ = 12, className: v = "", ...y }) {
|
|
2680
3169
|
return T("AppChoiceCard", y), /* @__PURE__ */ n("label", {
|
|
2681
3170
|
className: `struct-card${d ? " struct-card-img-card" : ""}${o ? " checked" : ""}${v ? ` ${v}` : ""}`,
|
|
2682
3171
|
children: [
|
|
@@ -2724,7 +3213,7 @@ function Ie({ name: r, multiple: i = !1, value: a, checked: o, onChange: s, icon
|
|
|
2724
3213
|
}
|
|
2725
3214
|
//#endregion
|
|
2726
3215
|
//#region src/components/AppChoiceChip.jsx
|
|
2727
|
-
function
|
|
3216
|
+
function tt({ multiple: e = !0, label: r, name: i, value: a, checked: o, onChange: s, children: c, count: l, className: u = "", ...d }) {
|
|
2728
3217
|
return T("AppChoiceChip", d), /* @__PURE__ */ n("label", {
|
|
2729
3218
|
className: `choice-chip${o ? " checked" : ""}${u ? ` ${u}` : ""}`,
|
|
2730
3219
|
children: [
|
|
@@ -2745,31 +3234,31 @@ function Le({ multiple: e = !0, label: r, name: i, value: a, checked: o, onChang
|
|
|
2745
3234
|
}
|
|
2746
3235
|
//#endregion
|
|
2747
3236
|
//#region src/components/AppColorField.jsx
|
|
2748
|
-
function
|
|
2749
|
-
T("AppColorField",
|
|
2750
|
-
let
|
|
3237
|
+
function nt({ value: e = "#000000", onChange: r, label: i, required: a = !1, error: o, hint: s, name: c, id: l, disabled: u = !1, size: d = "md", className: f = "", ...p }) {
|
|
3238
|
+
T("AppColorField", p);
|
|
3239
|
+
let m = l || c, h = (e) => /^#[0-9a-f]{6}$/i.test(e), g = d === "sm" ? " color-field-sm" : d === "lg" ? " color-field-lg" : "", _ = d === "sm" ? " input-sm" : d === "lg" ? " input-lg" : "";
|
|
2751
3240
|
return /* @__PURE__ */ n("div", {
|
|
2752
|
-
className: `field${
|
|
3241
|
+
className: `field${f ? ` ${f}` : ""}`,
|
|
2753
3242
|
children: [
|
|
2754
3243
|
i && /* @__PURE__ */ n("label", {
|
|
2755
3244
|
className: "label",
|
|
2756
|
-
htmlFor:
|
|
2757
|
-
children: [i, a && /* @__PURE__ */ t(
|
|
3245
|
+
htmlFor: m,
|
|
3246
|
+
children: [i, a && /* @__PURE__ */ t(Z, {})]
|
|
2758
3247
|
}),
|
|
2759
3248
|
/* @__PURE__ */ n("div", {
|
|
2760
|
-
className:
|
|
3249
|
+
className: `color-field${g}`,
|
|
2761
3250
|
children: [/* @__PURE__ */ t("input", {
|
|
2762
3251
|
type: "color",
|
|
2763
3252
|
className: "color-field-swatch",
|
|
2764
|
-
value: (
|
|
3253
|
+
value: h(e) ? e : "#000000",
|
|
2765
3254
|
onChange: (e) => r?.(e.target.value),
|
|
2766
3255
|
disabled: u,
|
|
2767
3256
|
"aria-label": `${i || "Colour"} — colour picker`,
|
|
2768
3257
|
tabIndex: -1
|
|
2769
3258
|
}), /* @__PURE__ */ t("input", {
|
|
2770
3259
|
type: "text",
|
|
2771
|
-
className: `input color-field-hex${o ? " error" : ""}`,
|
|
2772
|
-
id:
|
|
3260
|
+
className: `input color-field-hex${_}${o ? " error" : ""}`,
|
|
3261
|
+
id: m,
|
|
2773
3262
|
name: c,
|
|
2774
3263
|
value: e,
|
|
2775
3264
|
onChange: (e) => r?.(e.target.value),
|
|
@@ -2793,7 +3282,7 @@ function Re({ value: e = "#000000", onChange: r, label: i, required: a = !1, err
|
|
|
2793
3282
|
}
|
|
2794
3283
|
//#endregion
|
|
2795
3284
|
//#region src/components/AppCompareTable.jsx
|
|
2796
|
-
function
|
|
3285
|
+
function rt({ columns: e = [], rows: r = [], caption: i, className: a = "", ...o }) {
|
|
2797
3286
|
T("AppCompareTable", o);
|
|
2798
3287
|
let s = (e) => e === !0 ? /* @__PURE__ */ t("span", {
|
|
2799
3288
|
className: "compare-yes",
|
|
@@ -2829,7 +3318,7 @@ function ze({ columns: e = [], rows: r = [], caption: i, className: a = "", ...o
|
|
|
2829
3318
|
}
|
|
2830
3319
|
//#endregion
|
|
2831
3320
|
//#region src/components/AppInfoTip.jsx
|
|
2832
|
-
function
|
|
3321
|
+
function it({ label: e, children: r, ...i }) {
|
|
2833
3322
|
T("AppInfoTip", i);
|
|
2834
3323
|
let [a, u] = l(!1), [d, f] = l(null), p = c(null), m = c(null), g = o();
|
|
2835
3324
|
return s(() => {
|
|
@@ -2876,57 +3365,57 @@ function Q({ label: e, children: r, ...i }) {
|
|
|
2876
3365
|
}
|
|
2877
3366
|
//#endregion
|
|
2878
3367
|
//#region src/components/AppInput.jsx
|
|
2879
|
-
var
|
|
3368
|
+
var at = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, helpLabel: s = "More information", type: u = "text", size: d = "md", leftIcon: f, rightIcon: p, onRightIconClick: h, rightIconLabel: g, unit: _, id: v, name: y, className: b = "", fieldClassName: x = "", disabled: S = !1, clearable: C = !1, showCount: w = !1, maxLength: E, prefix: D, suffix: k, floatingLabel: A = !1, ...j }, M) {
|
|
2880
3369
|
T("AppInput", j);
|
|
2881
|
-
let [
|
|
2882
|
-
|
|
2883
|
-
},
|
|
2884
|
-
|
|
2885
|
-
},
|
|
3370
|
+
let [ee, N] = l(!1), P = v || y, F = u === "password", I = F && ee ? "text" : u, te = c(null), L = (e) => {
|
|
3371
|
+
te.current = e, typeof M == "function" ? M(e) : M && (M.current = e);
|
|
3372
|
+
}, R = String(j.value ?? j.defaultValue ?? ""), [z, ne] = l(() => !!R), [B, re] = l(() => R.length), V = C && !S, H = C || w, ie = (e) => {
|
|
3373
|
+
ne(!!e.target.value), re(e.target.value.length), j.onInput?.(e);
|
|
3374
|
+
}, ae = V ? /* @__PURE__ */ t("button", {
|
|
2886
3375
|
type: "button",
|
|
2887
3376
|
className: "input-clear",
|
|
2888
3377
|
onClick: () => {
|
|
2889
|
-
let e =
|
|
3378
|
+
let e = te.current;
|
|
2890
3379
|
if (!e) return;
|
|
2891
3380
|
let t = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set;
|
|
2892
|
-
t ? t.call(e, "") : e.value = "", e.dispatchEvent(new Event("input", { bubbles: !0 })),
|
|
3381
|
+
t ? t.call(e, "") : e.value = "", e.dispatchEvent(new Event("input", { bubbles: !0 })), ne(!1), e.focus();
|
|
2893
3382
|
},
|
|
2894
3383
|
"aria-label": "Clear",
|
|
2895
3384
|
tabIndex: -1,
|
|
2896
|
-
hidden: !
|
|
3385
|
+
hidden: !z,
|
|
2897
3386
|
children: /* @__PURE__ */ t(O, {
|
|
2898
3387
|
name: "x",
|
|
2899
3388
|
size: 16
|
|
2900
3389
|
})
|
|
2901
|
-
}) : null,
|
|
3390
|
+
}) : null, oe = [
|
|
2902
3391
|
"input",
|
|
2903
3392
|
d === "sm" ? "input-sm" : "",
|
|
2904
3393
|
d === "lg" ? "input-lg" : "",
|
|
2905
3394
|
i ? "error" : "",
|
|
2906
|
-
|
|
3395
|
+
F ? "pw" : "",
|
|
2907
3396
|
_ ? "num-input" : "",
|
|
2908
3397
|
C ? "has-clear" : "",
|
|
2909
3398
|
b
|
|
2910
|
-
].filter(Boolean).join(" "),
|
|
2911
|
-
id:
|
|
3399
|
+
].filter(Boolean).join(" "), U = /* @__PURE__ */ t(m.Control, {
|
|
3400
|
+
id: P,
|
|
2912
3401
|
name: y,
|
|
2913
|
-
type:
|
|
2914
|
-
className:
|
|
3402
|
+
type: I,
|
|
3403
|
+
className: oe,
|
|
2915
3404
|
disabled: S,
|
|
2916
3405
|
required: r,
|
|
2917
3406
|
"aria-invalid": i ? "true" : "false",
|
|
2918
3407
|
maxLength: E,
|
|
2919
3408
|
...j,
|
|
2920
3409
|
placeholder: A ? " " : j.placeholder,
|
|
2921
|
-
ref:
|
|
2922
|
-
onInput:
|
|
2923
|
-
}),
|
|
2924
|
-
return
|
|
3410
|
+
ref: L,
|
|
3411
|
+
onInput: H ? ie : j.onInput
|
|
3412
|
+
}), W;
|
|
3413
|
+
return W = A && e ? /* @__PURE__ */ n("div", {
|
|
2925
3414
|
className: "field-float",
|
|
2926
|
-
children: [
|
|
3415
|
+
children: [U, /* @__PURE__ */ n("label", {
|
|
2927
3416
|
className: "float-label",
|
|
2928
|
-
htmlFor:
|
|
2929
|
-
children: [e, r && /* @__PURE__ */ t(
|
|
3417
|
+
htmlFor: P,
|
|
3418
|
+
children: [e, r && /* @__PURE__ */ t(Z, {})]
|
|
2930
3419
|
})]
|
|
2931
3420
|
}) : D || k ? /* @__PURE__ */ n("div", {
|
|
2932
3421
|
className: "input-affixed",
|
|
@@ -2935,7 +3424,7 @@ var Be = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
2935
3424
|
className: "affix affix-pre",
|
|
2936
3425
|
children: D
|
|
2937
3426
|
}),
|
|
2938
|
-
|
|
3427
|
+
U,
|
|
2939
3428
|
k != null && /* @__PURE__ */ t("span", {
|
|
2940
3429
|
className: "affix affix-suf",
|
|
2941
3430
|
children: k
|
|
@@ -2943,26 +3432,26 @@ var Be = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
2943
3432
|
]
|
|
2944
3433
|
}) : _ ? /* @__PURE__ */ n("div", {
|
|
2945
3434
|
className: "input-with-unit",
|
|
2946
|
-
children: [
|
|
3435
|
+
children: [U, /* @__PURE__ */ t("span", {
|
|
2947
3436
|
className: "unit",
|
|
2948
3437
|
children: _
|
|
2949
3438
|
})]
|
|
2950
|
-
}) :
|
|
3439
|
+
}) : F ? /* @__PURE__ */ n("div", {
|
|
2951
3440
|
className: "input-wrap",
|
|
2952
|
-
children: [
|
|
3441
|
+
children: [U, /* @__PURE__ */ t("button", {
|
|
2953
3442
|
type: "button",
|
|
2954
3443
|
className: "pw-toggle",
|
|
2955
|
-
onClick: () =>
|
|
2956
|
-
"aria-label":
|
|
3444
|
+
onClick: () => N((e) => !e),
|
|
3445
|
+
"aria-label": ee ? "Hide password" : "Show password",
|
|
2957
3446
|
tabIndex: -1,
|
|
2958
3447
|
children: /* @__PURE__ */ t(O, {
|
|
2959
|
-
name:
|
|
3448
|
+
name: ee ? "eye-off" : "eye",
|
|
2960
3449
|
size: 18
|
|
2961
3450
|
})
|
|
2962
3451
|
})]
|
|
2963
3452
|
}) : p ? /* @__PURE__ */ n("div", {
|
|
2964
3453
|
className: "input-wrap",
|
|
2965
|
-
children: [
|
|
3454
|
+
children: [U, /* @__PURE__ */ t("button", {
|
|
2966
3455
|
type: "button",
|
|
2967
3456
|
className: "pw-toggle",
|
|
2968
3457
|
onClick: h,
|
|
@@ -2984,8 +3473,8 @@ var Be = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
2984
3473
|
size: 16
|
|
2985
3474
|
})
|
|
2986
3475
|
}),
|
|
2987
|
-
|
|
2988
|
-
|
|
3476
|
+
U,
|
|
3477
|
+
ae
|
|
2989
3478
|
]
|
|
2990
3479
|
}) : f ? /* @__PURE__ */ n("div", {
|
|
2991
3480
|
className: "input-icon",
|
|
@@ -2995,23 +3484,23 @@ var Be = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
2995
3484
|
name: f,
|
|
2996
3485
|
size: 16
|
|
2997
3486
|
})
|
|
2998
|
-
}),
|
|
2999
|
-
}) :
|
|
3487
|
+
}), U]
|
|
3488
|
+
}) : U, /* @__PURE__ */ n(m.Group, {
|
|
3000
3489
|
className: `field${x ? ` ${x}` : ""}`,
|
|
3001
3490
|
children: [
|
|
3002
3491
|
e && !A && /* @__PURE__ */ n(m.Label, {
|
|
3003
3492
|
className: "label",
|
|
3004
|
-
htmlFor:
|
|
3493
|
+
htmlFor: P,
|
|
3005
3494
|
children: [
|
|
3006
3495
|
e,
|
|
3007
|
-
r && /* @__PURE__ */ t(
|
|
3008
|
-
o && /* @__PURE__ */ t(
|
|
3496
|
+
r && /* @__PURE__ */ t(Z, {}),
|
|
3497
|
+
o && /* @__PURE__ */ t(it, {
|
|
3009
3498
|
label: s,
|
|
3010
3499
|
children: o
|
|
3011
3500
|
})
|
|
3012
3501
|
]
|
|
3013
3502
|
}),
|
|
3014
|
-
|
|
3503
|
+
W,
|
|
3015
3504
|
i ? /* @__PURE__ */ t("div", {
|
|
3016
3505
|
className: "field-error",
|
|
3017
3506
|
children: i
|
|
@@ -3020,20 +3509,20 @@ var Be = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
3020
3509
|
children: a
|
|
3021
3510
|
}) : null,
|
|
3022
3511
|
w && /* @__PURE__ */ n("div", {
|
|
3023
|
-
className: `field-count${E &&
|
|
3024
|
-
children: [
|
|
3512
|
+
className: `field-count${E && B >= E ? " at-limit" : ""}`,
|
|
3513
|
+
children: [B, E ? ` / ${E}` : ""]
|
|
3025
3514
|
})
|
|
3026
3515
|
]
|
|
3027
3516
|
});
|
|
3028
|
-
}),
|
|
3029
|
-
function
|
|
3517
|
+
}), ot = "a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])";
|
|
3518
|
+
function st({ open: e, title: r, subtitle: i, headerIcon: o, onClose: s, footer: l, size: u, wide: d = !1, side: f = !1, maxWidth: p, hideHeader: m = !1, className: h = "", children: _, ...v }) {
|
|
3030
3519
|
T("AppModal", v);
|
|
3031
3520
|
let y = c(null);
|
|
3032
3521
|
a(() => {
|
|
3033
3522
|
if (!e) return;
|
|
3034
3523
|
let t = y.current?.closest(".modal-content");
|
|
3035
3524
|
if (!t) return;
|
|
3036
|
-
let n = () => Array.from(t.querySelectorAll(
|
|
3525
|
+
let n = () => Array.from(t.querySelectorAll(ot));
|
|
3037
3526
|
(t.querySelector("[data-autofocus]") || n().find((e) => !e.classList.contains("lx-modal-close")) || n()[0] || t).focus?.();
|
|
3038
3527
|
}, [e]);
|
|
3039
3528
|
let b = ["lx-modal-shell", f ? "is-side" : ""].filter(Boolean).join(" "), x = [
|
|
@@ -3118,7 +3607,7 @@ var $ = (e) => function({ size: n = 72 }) {
|
|
|
3118
3607
|
tone: e,
|
|
3119
3608
|
size: n
|
|
3120
3609
|
});
|
|
3121
|
-
},
|
|
3610
|
+
}, ct = {
|
|
3122
3611
|
success: $("success"),
|
|
3123
3612
|
error: $("error"),
|
|
3124
3613
|
warning: $("warning"),
|
|
@@ -3127,14 +3616,14 @@ var $ = (e) => function({ size: n = 72 }) {
|
|
|
3127
3616
|
};
|
|
3128
3617
|
//#endregion
|
|
3129
3618
|
//#region src/components/AppConfirmDialog.jsx
|
|
3130
|
-
function
|
|
3619
|
+
function lt({ open: r, title: i, message: o, confirmLabel: s = "Confirm", cancelLabel: c = "Cancel", danger: u = !1, tone: d, confirmPhrase: f, onConfirm: p, onClose: m, ...h }) {
|
|
3131
3620
|
T("AppConfirmDialog", h);
|
|
3132
3621
|
let [g, _] = l("");
|
|
3133
3622
|
if (a(() => {
|
|
3134
3623
|
r || _("");
|
|
3135
3624
|
}, [r]), !r) return null;
|
|
3136
|
-
let v = !!f && g.trim() !== f, y =
|
|
3137
|
-
return /* @__PURE__ */ t(
|
|
3625
|
+
let v = !!f && g.trim() !== f, y = ct[d || (u ? "delete" : "info")];
|
|
3626
|
+
return /* @__PURE__ */ t(st, {
|
|
3138
3627
|
open: r,
|
|
3139
3628
|
hideHeader: !0,
|
|
3140
3629
|
title: i,
|
|
@@ -3142,11 +3631,11 @@ function We({ open: r, title: i, message: o, confirmLabel: s = "Confirm", cancel
|
|
|
3142
3631
|
className: "lx-confirm",
|
|
3143
3632
|
footer: /* @__PURE__ */ n("div", {
|
|
3144
3633
|
className: "lx-confirm-actions",
|
|
3145
|
-
children: [/* @__PURE__ */ t(
|
|
3634
|
+
children: [/* @__PURE__ */ t(Q, {
|
|
3146
3635
|
variant: "secondary",
|
|
3147
3636
|
onClick: m,
|
|
3148
3637
|
children: c
|
|
3149
|
-
}), /* @__PURE__ */ t(
|
|
3638
|
+
}), /* @__PURE__ */ t(Q, {
|
|
3150
3639
|
variant: u ? "danger" : "primary",
|
|
3151
3640
|
disabled: v,
|
|
3152
3641
|
onClick: p,
|
|
@@ -3170,7 +3659,7 @@ function We({ open: r, title: i, message: o, confirmLabel: s = "Confirm", cancel
|
|
|
3170
3659
|
className: "lx-confirm-msg",
|
|
3171
3660
|
children: o
|
|
3172
3661
|
}),
|
|
3173
|
-
f && /* @__PURE__ */ t(
|
|
3662
|
+
f && /* @__PURE__ */ t(at, {
|
|
3174
3663
|
fieldClassName: "mt-3 mb-0 w-100 text-start",
|
|
3175
3664
|
label: /* @__PURE__ */ n(e, { children: [
|
|
3176
3665
|
"Type ",
|
|
@@ -3187,7 +3676,7 @@ function We({ open: r, title: i, message: o, confirmLabel: s = "Confirm", cancel
|
|
|
3187
3676
|
}
|
|
3188
3677
|
//#endregion
|
|
3189
3678
|
//#region src/components/AppSkeleton.jsx
|
|
3190
|
-
function
|
|
3679
|
+
function ut({ width: e = "100%", height: n = 14, radius: r = 6, className: i = "", style: a, ...o }) {
|
|
3191
3680
|
return T("AppSkeleton", o), /* @__PURE__ */ t("span", {
|
|
3192
3681
|
className: `skeleton${i ? ` ${i}` : ""}`,
|
|
3193
3682
|
"aria-hidden": "true",
|
|
@@ -3199,7 +3688,7 @@ function Ge({ width: e = "100%", height: n = 14, radius: r = 6, className: i = "
|
|
|
3199
3688
|
}
|
|
3200
3689
|
});
|
|
3201
3690
|
}
|
|
3202
|
-
var
|
|
3691
|
+
var dt = [
|
|
3203
3692
|
"r0",
|
|
3204
3693
|
"r1",
|
|
3205
3694
|
"r2",
|
|
@@ -3208,7 +3697,7 @@ var Ke = [
|
|
|
3208
3697
|
"r5",
|
|
3209
3698
|
"r6",
|
|
3210
3699
|
"r7"
|
|
3211
|
-
],
|
|
3700
|
+
], ft = [
|
|
3212
3701
|
"c0",
|
|
3213
3702
|
"c1",
|
|
3214
3703
|
"c2",
|
|
@@ -3218,15 +3707,15 @@ var Ke = [
|
|
|
3218
3707
|
"c6",
|
|
3219
3708
|
"c7"
|
|
3220
3709
|
];
|
|
3221
|
-
function
|
|
3222
|
-
return
|
|
3710
|
+
function pt({ rows: e = 4, cols: n = 5 }) {
|
|
3711
|
+
return dt.slice(0, e).map((e) => /* @__PURE__ */ t("tr", { children: ft.slice(0, n).map((e, n) => /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(ut, {
|
|
3223
3712
|
width: n === 0 ? "70%" : "50%",
|
|
3224
3713
|
height: 12
|
|
3225
3714
|
}) }, e)) }, e));
|
|
3226
3715
|
}
|
|
3227
3716
|
//#endregion
|
|
3228
3717
|
//#region src/components/AppSelectMini.jsx
|
|
3229
|
-
function
|
|
3718
|
+
function mt({ value: e, onChange: n, options: r = [], placeholder: i = "Select...", name: o, ariaLabel: s, id: l, disabled: u, size: d, icon: f, prefix: p, className: m, ...h }) {
|
|
3230
3719
|
T("AppSelectMini", h);
|
|
3231
3720
|
let g = c(null);
|
|
3232
3721
|
return a(() => {
|
|
@@ -3260,19 +3749,19 @@ function Ye({ value: e, onChange: n, options: r = [], placeholder: i = "Select..
|
|
|
3260
3749
|
}
|
|
3261
3750
|
//#endregion
|
|
3262
3751
|
//#region src/components/AppTablePagination.jsx
|
|
3263
|
-
var
|
|
3752
|
+
var ht = [
|
|
3264
3753
|
5,
|
|
3265
3754
|
10,
|
|
3266
3755
|
25,
|
|
3267
3756
|
50
|
|
3268
3757
|
];
|
|
3269
|
-
function
|
|
3758
|
+
function gt({ page: e, totalPages: r, pageSize: i, total: a, firstRow: o, lastRow: s, onPageChange: c, onPageSizeChange: l, pageSizes: u = ht, ...d }) {
|
|
3270
3759
|
return T("AppTablePagination", d), /* @__PURE__ */ n("div", {
|
|
3271
3760
|
className: "table-pagination",
|
|
3272
3761
|
children: [
|
|
3273
3762
|
/* @__PURE__ */ n("span", {
|
|
3274
3763
|
className: "tpg-rows",
|
|
3275
|
-
children: ["Rows per page:", /* @__PURE__ */ t(
|
|
3764
|
+
children: ["Rows per page:", /* @__PURE__ */ t(mt, {
|
|
3276
3765
|
value: i,
|
|
3277
3766
|
onChange: (e) => l(Number(e)),
|
|
3278
3767
|
ariaLabel: "Rows per page",
|
|
@@ -3321,13 +3810,13 @@ function Ze({ page: e, totalPages: r, pageSize: i, total: a, firstRow: o, lastRo
|
|
|
3321
3810
|
}
|
|
3322
3811
|
//#endregion
|
|
3323
3812
|
//#region src/components/AppDataTable.jsx
|
|
3324
|
-
function
|
|
3813
|
+
function _t(e) {
|
|
3325
3814
|
return e === "end" ? "lx-cell-end" : e === "num" ? "num" : e === "center" ? "text-center" : "";
|
|
3326
3815
|
}
|
|
3327
|
-
function
|
|
3816
|
+
function vt(e) {
|
|
3328
3817
|
return e == null || e === "" ? "—" : e;
|
|
3329
3818
|
}
|
|
3330
|
-
function
|
|
3819
|
+
function yt({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s, loading: c = !1, skeletonRows: l = 5, empty: u = "No records found.", emptyFiltered: d, sourceCount: f, rowActions: p, rowActionsLabel: m, pagination: h, ariaLabel: g, className: _ = "", selectable: v = !1, selectedIds: y, onToggleRow: b, onToggleAll: x, ...S }) {
|
|
3331
3820
|
T("AppDataTable", S);
|
|
3332
3821
|
let C = Math.max(1, r.length + +!!p + +!!v), w = v && i ? i.reduce((e, t) => e + +!!y?.has(a(t)), 0) : 0, E = v && i && i.length > 0 && w === i.length, D = w > 0 && !E, k = (e) => {
|
|
3333
3822
|
e && (e.indeterminate = D);
|
|
@@ -3352,7 +3841,7 @@ function et({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3352
3841
|
r.map((e, r) => {
|
|
3353
3842
|
let i = !!(e.sortable && s), a = o && o.key === e.key;
|
|
3354
3843
|
return /* @__PURE__ */ n("th", {
|
|
3355
|
-
className: (i ? "sortable " : "") + (r === 0 ? "lx-name-cell " : "") +
|
|
3844
|
+
className: (i ? "sortable " : "") + (r === 0 ? "lx-name-cell " : "") + _t(e.align),
|
|
3356
3845
|
style: e.width ? { width: e.width } : void 0,
|
|
3357
3846
|
tabIndex: i ? 0 : void 0,
|
|
3358
3847
|
"aria-sort": a ? o.dir === "asc" ? "ascending" : "descending" : i ? "none" : void 0,
|
|
@@ -3379,7 +3868,7 @@ function et({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3379
3868
|
children: "Actions"
|
|
3380
3869
|
})
|
|
3381
3870
|
}))
|
|
3382
|
-
] }) }), /* @__PURE__ */ t("tbody", { children: c ? /* @__PURE__ */ t(
|
|
3871
|
+
] }) }), /* @__PURE__ */ t("tbody", { children: c ? /* @__PURE__ */ t(pt, {
|
|
3383
3872
|
rows: l,
|
|
3384
3873
|
cols: C
|
|
3385
3874
|
}) : i?.length ? i.map((e) => {
|
|
@@ -3398,8 +3887,8 @@ function et({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3398
3887
|
})
|
|
3399
3888
|
}),
|
|
3400
3889
|
r.map((n, r) => /* @__PURE__ */ t("td", {
|
|
3401
|
-
className: (r === 0 ? "lx-name-cell " : "") +
|
|
3402
|
-
children: n.render ? n.render(e) :
|
|
3890
|
+
className: (r === 0 ? "lx-name-cell " : "") + _t(n.align) + (n.cellClassName ? ` ${n.cellClassName}` : ""),
|
|
3891
|
+
children: n.render ? n.render(e) : vt(e[n.key])
|
|
3403
3892
|
}, n.key)),
|
|
3404
3893
|
p && /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t("div", {
|
|
3405
3894
|
className: "u-row-actions",
|
|
@@ -3413,7 +3902,7 @@ function et({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3413
3902
|
children: A
|
|
3414
3903
|
}) }) })]
|
|
3415
3904
|
})
|
|
3416
|
-
}), h && !c && h.total > 0 && /* @__PURE__ */ t(
|
|
3905
|
+
}), h && !c && h.total > 0 && /* @__PURE__ */ t(gt, {
|
|
3417
3906
|
page: h.page,
|
|
3418
3907
|
totalPages: h.totalPages,
|
|
3419
3908
|
pageSize: h.pageSize,
|
|
@@ -3426,43 +3915,46 @@ function et({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3426
3915
|
}
|
|
3427
3916
|
//#endregion
|
|
3428
3917
|
//#region src/components/AppDatePicker.jsx
|
|
3429
|
-
function
|
|
3430
|
-
T("AppDatePicker",
|
|
3431
|
-
let
|
|
3918
|
+
function bt({ value: e, onChange: r, label: i, required: s = !1, hint: l, error: u, name: d, min: f, max: p, placeholder: m = "Enter Date", disabled: h, size: g, firstDay: _, id: v, ariaLabel: y, className: b = "", ...x }) {
|
|
3919
|
+
T("AppDatePicker", x);
|
|
3920
|
+
let S = c(null), C = o(), w = v || d || C;
|
|
3432
3921
|
a(() => {
|
|
3433
|
-
let t =
|
|
3922
|
+
let t = S.current;
|
|
3434
3923
|
t && t.value !== (e ?? "") && (t.value = e ?? "");
|
|
3435
3924
|
}, [e]), a(() => {
|
|
3436
|
-
let e =
|
|
3925
|
+
let e = S.current;
|
|
3437
3926
|
if (!e) return;
|
|
3438
3927
|
let t = () => r?.(e.value);
|
|
3439
3928
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
3440
3929
|
}, [r]);
|
|
3441
|
-
let
|
|
3442
|
-
ref:
|
|
3443
|
-
id:
|
|
3930
|
+
let E = !i && !u && !l, D = /* @__PURE__ */ t("wui-datepicker", {
|
|
3931
|
+
ref: S,
|
|
3932
|
+
id: w,
|
|
3444
3933
|
name: d,
|
|
3445
3934
|
min: f,
|
|
3446
3935
|
max: p,
|
|
3447
3936
|
placeholder: m,
|
|
3448
|
-
|
|
3937
|
+
size: g || void 0,
|
|
3938
|
+
"first-day": _ == null ? void 0 : String(_),
|
|
3939
|
+
"aria-label": y,
|
|
3449
3940
|
"aria-invalid": u ? "true" : void 0,
|
|
3450
3941
|
disabled: h ? "" : void 0,
|
|
3451
|
-
required: s ? "" : void 0
|
|
3942
|
+
required: s ? "" : void 0,
|
|
3943
|
+
className: E && b || void 0
|
|
3452
3944
|
});
|
|
3453
|
-
return
|
|
3454
|
-
className: `field${
|
|
3945
|
+
return E ? D : /* @__PURE__ */ n("div", {
|
|
3946
|
+
className: `field${b ? ` ${b}` : ""}`,
|
|
3455
3947
|
children: [
|
|
3456
3948
|
i && /* @__PURE__ */ n("label", {
|
|
3457
3949
|
className: "label",
|
|
3458
|
-
htmlFor:
|
|
3950
|
+
htmlFor: w,
|
|
3459
3951
|
children: [i, s && /* @__PURE__ */ t("span", {
|
|
3460
3952
|
className: "required",
|
|
3461
3953
|
"aria-hidden": "true",
|
|
3462
3954
|
children: "*"
|
|
3463
3955
|
})]
|
|
3464
3956
|
}),
|
|
3465
|
-
|
|
3957
|
+
D,
|
|
3466
3958
|
u && /* @__PURE__ */ t("div", {
|
|
3467
3959
|
className: "field-error",
|
|
3468
3960
|
children: u
|
|
@@ -3475,8 +3967,65 @@ function tt({ value: e, onChange: r, label: i, required: s = !1, hint: l, error:
|
|
|
3475
3967
|
});
|
|
3476
3968
|
}
|
|
3477
3969
|
//#endregion
|
|
3970
|
+
//#region src/components/AppDateRangePicker.jsx
|
|
3971
|
+
function xt({ start: e, end: r, onChange: i, label: s, required: l = !1, hint: u, error: d, startName: f, endName: p, min: m, max: h, placeholder: g = "Start – End", disabled: _, size: v, firstDay: y, id: b, ariaLabel: x, className: S = "", ...C }) {
|
|
3972
|
+
T("AppDateRangePicker", C);
|
|
3973
|
+
let w = c(null), E = o(), D = b || f || E;
|
|
3974
|
+
a(() => {
|
|
3975
|
+
let t = w.current;
|
|
3976
|
+
t && t.value.start !== (e ?? "") && t.setAttribute("start", e ?? "");
|
|
3977
|
+
}, [e]), a(() => {
|
|
3978
|
+
let e = w.current;
|
|
3979
|
+
e && e.value.end !== (r ?? "") && e.setAttribute("end", r ?? "");
|
|
3980
|
+
}, [r]), a(() => {
|
|
3981
|
+
let e = w.current;
|
|
3982
|
+
if (!e) return;
|
|
3983
|
+
let t = () => i?.(e.value);
|
|
3984
|
+
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
3985
|
+
}, [i]);
|
|
3986
|
+
let O = !s && !d && !u, k = /* @__PURE__ */ t("wui-date-range", {
|
|
3987
|
+
ref: w,
|
|
3988
|
+
id: D,
|
|
3989
|
+
"start-name": f,
|
|
3990
|
+
"end-name": p,
|
|
3991
|
+
min: m,
|
|
3992
|
+
max: h,
|
|
3993
|
+
placeholder: g,
|
|
3994
|
+
size: v || void 0,
|
|
3995
|
+
"first-day": y == null ? void 0 : String(y),
|
|
3996
|
+
"aria-label": x,
|
|
3997
|
+
"aria-invalid": d ? "true" : void 0,
|
|
3998
|
+
disabled: _ ? "" : void 0,
|
|
3999
|
+
required: l ? "" : void 0,
|
|
4000
|
+
className: O && S || void 0
|
|
4001
|
+
});
|
|
4002
|
+
return O ? k : /* @__PURE__ */ n("div", {
|
|
4003
|
+
className: `field${S ? ` ${S}` : ""}`,
|
|
4004
|
+
children: [
|
|
4005
|
+
s && /* @__PURE__ */ n("label", {
|
|
4006
|
+
className: "label",
|
|
4007
|
+
htmlFor: D,
|
|
4008
|
+
children: [s, l && /* @__PURE__ */ t("span", {
|
|
4009
|
+
className: "required",
|
|
4010
|
+
"aria-hidden": "true",
|
|
4011
|
+
children: "*"
|
|
4012
|
+
})]
|
|
4013
|
+
}),
|
|
4014
|
+
k,
|
|
4015
|
+
d && /* @__PURE__ */ t("div", {
|
|
4016
|
+
className: "field-error",
|
|
4017
|
+
children: d
|
|
4018
|
+
}),
|
|
4019
|
+
!d && u && /* @__PURE__ */ t("div", {
|
|
4020
|
+
className: "field-hint",
|
|
4021
|
+
children: u
|
|
4022
|
+
})
|
|
4023
|
+
]
|
|
4024
|
+
});
|
|
4025
|
+
}
|
|
4026
|
+
//#endregion
|
|
3478
4027
|
//#region src/components/AppDropdown.jsx
|
|
3479
|
-
var
|
|
4028
|
+
var St = r(function({ icon: e, iconSize: n = 20, btnClassName: r = "topbar-icon-btn", label: i, align: a = "end", "aria-label": o, className: s, ...c }, l) {
|
|
3480
4029
|
return /* @__PURE__ */ t("button", {
|
|
3481
4030
|
ref: l,
|
|
3482
4031
|
type: "button",
|
|
@@ -3490,11 +4039,11 @@ var nt = r(function({ icon: e, iconSize: n = 20, btnClassName: r = "topbar-icon-
|
|
|
3490
4039
|
})
|
|
3491
4040
|
});
|
|
3492
4041
|
});
|
|
3493
|
-
function
|
|
4042
|
+
function Ct({ icon: e, iconSize: r, toggleClassName: i = "topbar-icon-btn", label: a, ariaLabel: o, align: s = "end", items: c = [], menuClassName: l = "", linkComponent: u, ...d }) {
|
|
3494
4043
|
return T("AppDropdown", d), /* @__PURE__ */ n(_, {
|
|
3495
4044
|
align: s,
|
|
3496
4045
|
children: [/* @__PURE__ */ t(_.Toggle, {
|
|
3497
|
-
as:
|
|
4046
|
+
as: St,
|
|
3498
4047
|
icon: e,
|
|
3499
4048
|
iconSize: r,
|
|
3500
4049
|
btnClassName: i,
|
|
@@ -3532,7 +4081,7 @@ function rt({ icon: e, iconSize: r, toggleClassName: i = "topbar-icon-btn", labe
|
|
|
3532
4081
|
}
|
|
3533
4082
|
//#endregion
|
|
3534
4083
|
//#region src/components/AppEmptyState.jsx
|
|
3535
|
-
function
|
|
4084
|
+
function wt({ icon: e, iconSize: r = 24, size: i = "md", title: a, text: o, action: s, className: c = "", style: l, ...u }) {
|
|
3536
4085
|
return T("AppEmptyState", u), /* @__PURE__ */ n("div", {
|
|
3537
4086
|
className: [
|
|
3538
4087
|
"empty-state",
|
|
@@ -3565,7 +4114,7 @@ function it({ icon: e, iconSize: r = 24, size: i = "md", title: a, text: o, acti
|
|
|
3565
4114
|
}
|
|
3566
4115
|
//#endregion
|
|
3567
4116
|
//#region src/components/AppFileAttachment.jsx
|
|
3568
|
-
function
|
|
4117
|
+
function Tt({ label: r = "Attachment", value: i, name: s, onChange: c, accept: u = Ie, maxSizeMb: d = 5, optional: f = !1, error: p, id: m, ...h }) {
|
|
3569
4118
|
T("AppFileAttachment", h);
|
|
3570
4119
|
let g = o(), _ = m || s || g, [v, y] = l(null), [b, x] = l("");
|
|
3571
4120
|
a(() => {
|
|
@@ -3578,7 +4127,7 @@ function at({ label: r = "Attachment", value: i, name: s, onChange: c, accept: u
|
|
|
3578
4127
|
function S(e) {
|
|
3579
4128
|
let t = e.target.files?.[0];
|
|
3580
4129
|
if (e.target.value = "", !t) return;
|
|
3581
|
-
let n =
|
|
4130
|
+
let n = He(t, {
|
|
3582
4131
|
accept: u,
|
|
3583
4132
|
maxSizeMb: d
|
|
3584
4133
|
});
|
|
@@ -3677,22 +4226,22 @@ function at({ label: r = "Attachment", value: i, name: s, onChange: c, accept: u
|
|
|
3677
4226
|
}
|
|
3678
4227
|
//#endregion
|
|
3679
4228
|
//#region src/components/toast.js
|
|
3680
|
-
var
|
|
4229
|
+
var Et = /* @__PURE__ */ new Set([
|
|
3681
4230
|
"success",
|
|
3682
4231
|
"info",
|
|
3683
4232
|
"warning",
|
|
3684
4233
|
"error"
|
|
3685
4234
|
]);
|
|
3686
|
-
function
|
|
3687
|
-
let n =
|
|
4235
|
+
function Dt(e, t = "success") {
|
|
4236
|
+
let n = Et.has(t) ? t : "success";
|
|
3688
4237
|
v[n](e, { toastId: `${n}:${e}` });
|
|
3689
4238
|
}
|
|
3690
|
-
function
|
|
4239
|
+
function Ot(e) {
|
|
3691
4240
|
v.error(e, { toastId: `error:${e}` });
|
|
3692
4241
|
}
|
|
3693
4242
|
//#endregion
|
|
3694
4243
|
//#region src/components/AppFilePicker.jsx
|
|
3695
|
-
function
|
|
4244
|
+
function kt({ label: e, value: r, name: i, onPick: s, accept: u = ".jpg,.jpeg,.png", maxSizeMb: d = 5, required: f, error: p, ...m }) {
|
|
3696
4245
|
T("AppFilePicker", m);
|
|
3697
4246
|
let [h, g] = l(null), [_, v] = l(!1), y = c(null), b = o(), x = i || b;
|
|
3698
4247
|
a(() => {
|
|
@@ -3703,11 +4252,11 @@ function lt({ label: e, value: r, name: i, onPick: s, accept: u = ".jpg,.jpeg,.p
|
|
|
3703
4252
|
g(null);
|
|
3704
4253
|
}, [r]);
|
|
3705
4254
|
let S = r?.url || h, C = (e) => {
|
|
3706
|
-
let t =
|
|
4255
|
+
let t = He(e, {
|
|
3707
4256
|
accept: u,
|
|
3708
4257
|
maxSizeMb: d
|
|
3709
4258
|
});
|
|
3710
|
-
return t ? (
|
|
4259
|
+
return t ? (Dt(t, "error"), !1) : (s(e), !0);
|
|
3711
4260
|
}, w = (e) => {
|
|
3712
4261
|
let t = e.target.files?.[0] || null;
|
|
3713
4262
|
t && (C(t) || (e.target.value = ""));
|
|
@@ -3733,7 +4282,7 @@ function lt({ label: e, value: r, name: i, onPick: s, accept: u = ".jpg,.jpeg,.p
|
|
|
3733
4282
|
/* @__PURE__ */ n("label", {
|
|
3734
4283
|
className: "label",
|
|
3735
4284
|
htmlFor: x,
|
|
3736
|
-
children: [e, f && /* @__PURE__ */ t(
|
|
4285
|
+
children: [e, f && /* @__PURE__ */ t(Z, {})]
|
|
3737
4286
|
}),
|
|
3738
4287
|
S ? /* @__PURE__ */ n("div", {
|
|
3739
4288
|
className: `file-preview${p ? " error" : ""}`,
|
|
@@ -3818,7 +4367,7 @@ function lt({ label: e, value: r, name: i, onPick: s, accept: u = ".jpg,.jpeg,.p
|
|
|
3818
4367
|
}
|
|
3819
4368
|
//#endregion
|
|
3820
4369
|
//#region src/components/AppInfoList.jsx
|
|
3821
|
-
function
|
|
4370
|
+
function At({ items: r = [], className: i = "", ...a }) {
|
|
3822
4371
|
return T("AppInfoList", a), /* @__PURE__ */ t("div", {
|
|
3823
4372
|
className: `info-list${i ? ` ${i}` : ""}`,
|
|
3824
4373
|
children: r.map((r, i) => {
|
|
@@ -3851,7 +4400,7 @@ function ut({ items: r = [], className: i = "", ...a }) {
|
|
|
3851
4400
|
}
|
|
3852
4401
|
//#endregion
|
|
3853
4402
|
//#region src/components/AppKpiTile.jsx
|
|
3854
|
-
function
|
|
4403
|
+
function jt({ label: e, value: r, icon: i, delta: a, deltaDirection: o = "flat", inline: s = !1, className: c = "", ...l }) {
|
|
3855
4404
|
T("AppKpiTile", l);
|
|
3856
4405
|
let u = `kpi${s ? " kpi-inline" : ""}${c ? ` ${c}` : ""}`, d = o === "up" ? "arrow-up" : o === "down" ? "arrow-down" : null;
|
|
3857
4406
|
return /* @__PURE__ */ n("div", {
|
|
@@ -3884,7 +4433,7 @@ function dt({ label: e, value: r, icon: i, delta: a, deltaDirection: o = "flat",
|
|
|
3884
4433
|
}
|
|
3885
4434
|
//#endregion
|
|
3886
4435
|
//#region src/components/AppLogoPicker.jsx
|
|
3887
|
-
function
|
|
4436
|
+
function Mt({ value: r, fallback: i, name: a, onPick: o, loading: s = !1, accept: l = "image/png,image/jpeg", maxSizeMb: u = 5, overlayIcon: d = "image", overlayLabel: f = "Update photo", ariaLabel: p = "Upload photo", ...m }) {
|
|
3888
4437
|
T("AppLogoPicker", m);
|
|
3889
4438
|
let h = c(null);
|
|
3890
4439
|
return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("button", {
|
|
@@ -3930,12 +4479,12 @@ function ft({ value: r, fallback: i, name: a, onPick: o, loading: s = !1, accept
|
|
|
3930
4479
|
onChange: (e) => {
|
|
3931
4480
|
let t = e.target.files?.[0];
|
|
3932
4481
|
if (e.target.value = "", !t) return;
|
|
3933
|
-
let n =
|
|
4482
|
+
let n = He(t, {
|
|
3934
4483
|
accept: l,
|
|
3935
4484
|
maxSizeMb: u
|
|
3936
4485
|
});
|
|
3937
4486
|
if (n) {
|
|
3938
|
-
|
|
4487
|
+
Dt(n, "error");
|
|
3939
4488
|
return;
|
|
3940
4489
|
}
|
|
3941
4490
|
o(t);
|
|
@@ -3945,7 +4494,7 @@ function ft({ value: r, fallback: i, name: a, onPick: o, loading: s = !1, accept
|
|
|
3945
4494
|
}
|
|
3946
4495
|
//#endregion
|
|
3947
4496
|
//#region src/components/AppMultiSelect.jsx
|
|
3948
|
-
function
|
|
4497
|
+
function Nt({ values: e, onChange: r, options: i, placeholder: o = "Select…", searchPlaceholder: s = "Search…", searchable: l = !0, disabled: u = !1, icon: d, size: f, collapseChips: p = !1, name: m, label: h, error: g, hint: _, required: v = !1, fieldClassName: y = "", ...b }) {
|
|
3949
4498
|
T("AppMultiSelect", b);
|
|
3950
4499
|
let x = c(null);
|
|
3951
4500
|
return a(() => {
|
|
@@ -3967,7 +4516,7 @@ function pt({ values: e, onChange: r, options: i, placeholder: o = "Select…",
|
|
|
3967
4516
|
h && /* @__PURE__ */ n("label", {
|
|
3968
4517
|
className: "label",
|
|
3969
4518
|
htmlFor: m,
|
|
3970
|
-
children: [h, v && /* @__PURE__ */ t(
|
|
4519
|
+
children: [h, v && /* @__PURE__ */ t(Z, {})]
|
|
3971
4520
|
}),
|
|
3972
4521
|
/* @__PURE__ */ t("wui-multiselect", {
|
|
3973
4522
|
"aria-label": typeof h == "string" ? h : void 0,
|
|
@@ -3995,7 +4544,7 @@ function pt({ values: e, onChange: r, options: i, placeholder: o = "Select…",
|
|
|
3995
4544
|
}
|
|
3996
4545
|
//#endregion
|
|
3997
4546
|
//#region src/components/AppOtpInput.jsx
|
|
3998
|
-
var
|
|
4547
|
+
var Pt = r(function({ value: e, onChange: r, onComplete: i, length: s = 6, mode: l = "numeric", label: u, required: d = !1, hint: f, error: p, disabled: m = !1, name: h, id: g, className: _ = "", ...v }, y) {
|
|
3999
4548
|
T("AppOtpInput", v);
|
|
4000
4549
|
let b = c(null), x = o(), S = g || h || x, C = (e) => {
|
|
4001
4550
|
b.current = e, typeof y == "function" ? y(e) : y && (y.current = e);
|
|
@@ -4048,7 +4597,7 @@ var mt = r(function({ value: e, onChange: r, onComplete: i, length: s = 6, mode:
|
|
|
4048
4597
|
});
|
|
4049
4598
|
//#endregion
|
|
4050
4599
|
//#region src/components/AppPageHeader.jsx
|
|
4051
|
-
function
|
|
4600
|
+
function Ft({ title: e, subtitle: r, actions: i, className: a = "", ...o }) {
|
|
4052
4601
|
return T("AppPageHeader", o), /* @__PURE__ */ n("div", {
|
|
4053
4602
|
className: `page-header${i ? " d-flex align-items-end justify-content-between" : ""}${a ? ` ${a}` : ""}`,
|
|
4054
4603
|
children: [/* @__PURE__ */ n("div", { children: [/* @__PURE__ */ t("div", {
|
|
@@ -4065,7 +4614,7 @@ function ht({ title: e, subtitle: r, actions: i, className: a = "", ...o }) {
|
|
|
4065
4614
|
}
|
|
4066
4615
|
//#endregion
|
|
4067
4616
|
//#region src/components/AppPhoneNumberInput.jsx
|
|
4068
|
-
function
|
|
4617
|
+
function It({ value: e, onChange: r, country: i, disabled: o = !1, name: s, label: l = "Phone number", placeholder: u, required: d = !1, error: f, fieldClassName: p = "", ...m }) {
|
|
4069
4618
|
T("AppPhoneNumberInput", m);
|
|
4070
4619
|
let h = c(null);
|
|
4071
4620
|
return a(() => {
|
|
@@ -4082,7 +4631,7 @@ function gt({ value: e, onChange: r, country: i, disabled: o = !1, name: s, labe
|
|
|
4082
4631
|
l && /* @__PURE__ */ n("label", {
|
|
4083
4632
|
className: "label",
|
|
4084
4633
|
htmlFor: s,
|
|
4085
|
-
children: [l, d && /* @__PURE__ */ t(
|
|
4634
|
+
children: [l, d && /* @__PURE__ */ t(Z, {})]
|
|
4086
4635
|
}),
|
|
4087
4636
|
/* @__PURE__ */ t("wui-phone", {
|
|
4088
4637
|
ref: h,
|
|
@@ -4100,7 +4649,7 @@ function gt({ value: e, onChange: r, country: i, disabled: o = !1, name: s, labe
|
|
|
4100
4649
|
}
|
|
4101
4650
|
//#endregion
|
|
4102
4651
|
//#region src/components/AppPricingCard.jsx
|
|
4103
|
-
function
|
|
4652
|
+
function Lt({ name: e, price: r, unit: i, tagline: a, features: o = [], cta: s, featured: c = !1, current: l = !1, badge: u = "Most popular", className: d = "", ...f }) {
|
|
4104
4653
|
return T("AppPricingCard", f), /* @__PURE__ */ n("div", {
|
|
4105
4654
|
className: [
|
|
4106
4655
|
"plan-card",
|
|
@@ -4153,7 +4702,7 @@ function _t({ name: e, price: r, unit: i, tagline: a, features: o = [], cta: s,
|
|
|
4153
4702
|
}
|
|
4154
4703
|
//#endregion
|
|
4155
4704
|
//#region src/components/AppRadio.jsx
|
|
4156
|
-
var
|
|
4705
|
+
var Rt = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
4157
4706
|
T("AppRadio", s);
|
|
4158
4707
|
let l = o(), u = r || l;
|
|
4159
4708
|
return /* @__PURE__ */ n("div", {
|
|
@@ -4174,7 +4723,7 @@ var vt = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
|
4174
4723
|
});
|
|
4175
4724
|
//#endregion
|
|
4176
4725
|
//#region src/components/AppRepeater.jsx
|
|
4177
|
-
function
|
|
4726
|
+
function zt({ rows: e = [], renderRow: r, onAdd: i, onRemove: a, addLabel: o = "Add another", removeLabel: s = "Remove row", emptyText: c, min: l = 0, max: u, numbered: d = !0, className: f = "", ...p }) {
|
|
4178
4727
|
T("AppRepeater", p);
|
|
4179
4728
|
let m = typeof u == "number" && e.length >= u, h = !!a && e.length > l;
|
|
4180
4729
|
return /* @__PURE__ */ n("div", {
|
|
@@ -4204,7 +4753,7 @@ function yt({ rows: e = [], renderRow: r, onAdd: i, onRemove: a, addLabel: o = "
|
|
|
4204
4753
|
})
|
|
4205
4754
|
]
|
|
4206
4755
|
}, e.id ?? i)),
|
|
4207
|
-
/* @__PURE__ */ t(
|
|
4756
|
+
/* @__PURE__ */ t(Q, {
|
|
4208
4757
|
variant: "secondary",
|
|
4209
4758
|
size: "sm",
|
|
4210
4759
|
leftIcon: "plus",
|
|
@@ -4218,7 +4767,7 @@ function yt({ rows: e = [], renderRow: r, onAdd: i, onRemove: a, addLabel: o = "
|
|
|
4218
4767
|
}
|
|
4219
4768
|
//#endregion
|
|
4220
4769
|
//#region src/components/AppResourceCard.jsx
|
|
4221
|
-
function
|
|
4770
|
+
function Bt({ icon: r, title: i, text: a, href: o, external: s = !1, linkComponent: c, className: l = "", ...u }) {
|
|
4222
4771
|
T("AppResourceCard", u);
|
|
4223
4772
|
let d = /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", {
|
|
4224
4773
|
className: "res-card-icon",
|
|
@@ -4250,7 +4799,7 @@ function bt({ icon: r, title: i, text: a, href: o, external: s = !1, linkCompone
|
|
|
4250
4799
|
}
|
|
4251
4800
|
//#endregion
|
|
4252
4801
|
//#region src/components/AppSearch.jsx
|
|
4253
|
-
function
|
|
4802
|
+
function Vt({ value: e, onValueChange: r, placeholder: i = "Search…", ariaLabel: a, iconSize: o = 18, size: s, loading: c = !1, disabled: l = !1, className: u = "", ...d }) {
|
|
4254
4803
|
return T("AppSearch", d), /* @__PURE__ */ n("div", {
|
|
4255
4804
|
className: [
|
|
4256
4805
|
"search-wrap",
|
|
@@ -4294,22 +4843,58 @@ function xt({ value: e, onValueChange: r, placeholder: i = "Search…", ariaLabe
|
|
|
4294
4843
|
}
|
|
4295
4844
|
//#endregion
|
|
4296
4845
|
//#region src/components/AppSegmented.jsx
|
|
4297
|
-
function
|
|
4298
|
-
T("AppSegmented",
|
|
4299
|
-
let
|
|
4300
|
-
|
|
4301
|
-
|
|
4846
|
+
function Ht({ options: e = [], value: r, onChange: i, label: l, name: u, size: d = "md", fullWidth: f = !1, disabled: p = !1, className: m = "", ...h }) {
|
|
4847
|
+
T("AppSegmented", h);
|
|
4848
|
+
let g = o(), _ = u || g, v = c(null), y = c(null), b = [
|
|
4849
|
+
"segmented",
|
|
4850
|
+
d === "sm" ? "segmented-sm" : d === "lg" ? "segmented-lg" : "",
|
|
4851
|
+
f ? "segmented-full" : "",
|
|
4852
|
+
p ? "is-disabled" : "",
|
|
4853
|
+
m
|
|
4854
|
+
].filter(Boolean).join(" ");
|
|
4855
|
+
return s(() => {
|
|
4856
|
+
let e = v.current, t = y.current;
|
|
4857
|
+
if (!e || !t) return;
|
|
4858
|
+
let n = () => {
|
|
4859
|
+
let n = e.querySelector(".segmented-option:has(.segmented-input:checked)");
|
|
4860
|
+
if (!n) {
|
|
4861
|
+
t.style.opacity = "0";
|
|
4862
|
+
return;
|
|
4863
|
+
}
|
|
4864
|
+
let r = e.getBoundingClientRect(), i = n.getBoundingClientRect(), a = Number.parseFloat(getComputedStyle(e).borderLeftWidth) || 0;
|
|
4865
|
+
t.style.width = `${i.width}px`, t.style.transform = `translateX(${i.left - r.left - a}px)`;
|
|
4866
|
+
};
|
|
4867
|
+
n();
|
|
4868
|
+
let r = typeof ResizeObserver < "u" ? new ResizeObserver(n) : null;
|
|
4869
|
+
return r?.observe(e), () => r?.disconnect();
|
|
4870
|
+
}, [
|
|
4871
|
+
r,
|
|
4872
|
+
e,
|
|
4873
|
+
d,
|
|
4874
|
+
f
|
|
4875
|
+
]), a(() => {
|
|
4876
|
+
let e = requestAnimationFrame(() => v.current?.classList.add("is-animated"));
|
|
4877
|
+
return () => cancelAnimationFrame(e);
|
|
4878
|
+
}, []), /* @__PURE__ */ n("div", {
|
|
4879
|
+
ref: v,
|
|
4880
|
+
className: b,
|
|
4302
4881
|
role: "radiogroup",
|
|
4303
|
-
"aria-label":
|
|
4304
|
-
|
|
4882
|
+
"aria-label": l,
|
|
4883
|
+
"aria-disabled": p || void 0,
|
|
4884
|
+
children: [/* @__PURE__ */ t("span", {
|
|
4885
|
+
className: "segmented-thumb",
|
|
4886
|
+
ref: y,
|
|
4887
|
+
"aria-hidden": "true"
|
|
4888
|
+
}), e.map((e) => /* @__PURE__ */ n("label", {
|
|
4305
4889
|
className: "segmented-option",
|
|
4306
4890
|
children: [
|
|
4307
4891
|
/* @__PURE__ */ t("input", {
|
|
4308
4892
|
type: "radio",
|
|
4309
4893
|
className: "segmented-input",
|
|
4310
|
-
name:
|
|
4894
|
+
name: _,
|
|
4311
4895
|
value: e.value,
|
|
4312
4896
|
checked: e.value === r,
|
|
4897
|
+
disabled: p || e.disabled,
|
|
4313
4898
|
onChange: () => i?.(e.value)
|
|
4314
4899
|
}),
|
|
4315
4900
|
e.icon && /* @__PURE__ */ t(O, {
|
|
@@ -4318,19 +4903,19 @@ function St({ options: e = [], value: r, onChange: i, label: a, name: s, size: c
|
|
|
4318
4903
|
}),
|
|
4319
4904
|
e.label
|
|
4320
4905
|
]
|
|
4321
|
-
}, e.value))
|
|
4906
|
+
}, e.value))]
|
|
4322
4907
|
});
|
|
4323
4908
|
}
|
|
4324
4909
|
//#endregion
|
|
4325
4910
|
//#region src/components/AppSelect.jsx
|
|
4326
|
-
var
|
|
4327
|
-
function
|
|
4911
|
+
var Ut = (e) => e == null ? "" : e.label ?? e.text ?? "";
|
|
4912
|
+
function Wt({ value: e, onChange: r, options: i = [], placeholder: o = "Select...", searchPlaceholder: s = "Search...", searchable: l = !1, clearable: u = !1, size: d, icon: f, floatingLabel: p = !1, disabled: m, label: h, required: g = !1, error: _, hint: v, help: y, helpLabel: b = "More information", id: x, name: S, className: C = "", fieldClassName: w = "", ...E }) {
|
|
4328
4913
|
T("AppSelect", E);
|
|
4329
4914
|
let D = c(null);
|
|
4330
4915
|
a(() => {
|
|
4331
4916
|
D.current && (D.current.options = i.map((e) => ({
|
|
4332
4917
|
value: e.value,
|
|
4333
|
-
label:
|
|
4918
|
+
label: Ut(e),
|
|
4334
4919
|
icon: e.icon
|
|
4335
4920
|
})));
|
|
4336
4921
|
}, [i]), a(() => {
|
|
@@ -4370,8 +4955,8 @@ function wt({ value: e, onChange: r, options: i = [], placeholder: o = "Select..
|
|
|
4370
4955
|
htmlFor: k,
|
|
4371
4956
|
children: [
|
|
4372
4957
|
h,
|
|
4373
|
-
g && /* @__PURE__ */ t(
|
|
4374
|
-
y && /* @__PURE__ */ t(
|
|
4958
|
+
g && /* @__PURE__ */ t(Z, {}),
|
|
4959
|
+
y && /* @__PURE__ */ t(it, {
|
|
4375
4960
|
label: b,
|
|
4376
4961
|
children: y
|
|
4377
4962
|
})
|
|
@@ -4382,7 +4967,7 @@ function wt({ value: e, onChange: r, options: i = [], placeholder: o = "Select..
|
|
|
4382
4967
|
children: [O, /* @__PURE__ */ n("label", {
|
|
4383
4968
|
className: "float-label",
|
|
4384
4969
|
htmlFor: k,
|
|
4385
|
-
children: [h, g && /* @__PURE__ */ t(
|
|
4970
|
+
children: [h, g && /* @__PURE__ */ t(Z, {})]
|
|
4386
4971
|
})]
|
|
4387
4972
|
}) : O,
|
|
4388
4973
|
_ ? /* @__PURE__ */ t("div", {
|
|
@@ -4397,7 +4982,7 @@ function wt({ value: e, onChange: r, options: i = [], placeholder: o = "Select..
|
|
|
4397
4982
|
}
|
|
4398
4983
|
//#endregion
|
|
4399
4984
|
//#region src/components/AppShell.jsx
|
|
4400
|
-
function
|
|
4985
|
+
function Gt({ groups: e = [], brand: r, sidebarFooter: i, topbarStart: o, topbarEnd: s, footer: c, children: u, collapsed: d, onCollapsedChange: f, noSidebar: p = !1, navLabel: m = "Main navigation", linkComponent: h, className: g = "", ..._ }) {
|
|
4401
4986
|
T("AppShell", _);
|
|
4402
4987
|
let [v, y] = l(!1), [b, x] = l(!1), [S, C] = l(!1), w = d ?? v;
|
|
4403
4988
|
return a(() => {
|
|
@@ -4433,7 +5018,7 @@ function Tt({ groups: e = [], brand: r, sidebarFooter: i, topbarStart: o, topbar
|
|
|
4433
5018
|
children: [e.label && /* @__PURE__ */ t("div", {
|
|
4434
5019
|
className: "app-nav-group-label",
|
|
4435
5020
|
children: e.label
|
|
4436
|
-
}), e.items.map((e) => /* @__PURE__ */ t(
|
|
5021
|
+
}), e.items.map((e) => /* @__PURE__ */ t(Kt, {
|
|
4437
5022
|
item: e,
|
|
4438
5023
|
linkComponent: h,
|
|
4439
5024
|
onNavigate: () => x(!1)
|
|
@@ -4503,7 +5088,7 @@ function Tt({ groups: e = [], brand: r, sidebarFooter: i, topbarStart: o, topbar
|
|
|
4503
5088
|
]
|
|
4504
5089
|
});
|
|
4505
5090
|
}
|
|
4506
|
-
function
|
|
5091
|
+
function Kt({ item: r, linkComponent: i, onNavigate: a }) {
|
|
4507
5092
|
let o = `app-nav-item${r.active ? " active" : ""}`, s = /* @__PURE__ */ n(e, { children: [
|
|
4508
5093
|
r.icon && /* @__PURE__ */ t("span", {
|
|
4509
5094
|
className: "app-nav-icon",
|
|
@@ -4537,7 +5122,7 @@ function Et({ item: r, linkComponent: i, onNavigate: a }) {
|
|
|
4537
5122
|
}
|
|
4538
5123
|
//#endregion
|
|
4539
5124
|
//#region src/components/AppSidebarMenu.jsx
|
|
4540
|
-
var
|
|
5125
|
+
var qt = {
|
|
4541
5126
|
left: "start",
|
|
4542
5127
|
right: "end",
|
|
4543
5128
|
start: "start",
|
|
@@ -4545,11 +5130,11 @@ var Dt = {
|
|
|
4545
5130
|
top: "top",
|
|
4546
5131
|
bottom: "bottom"
|
|
4547
5132
|
};
|
|
4548
|
-
function
|
|
5133
|
+
function Jt({ show: e, onHide: r, side: i = "right", title: a, titleIcon: o, header: s, children: c, footer: l, width: u, backdrop: d = !0, scroll: f = !1, keyboard: p = !0, closeButton: m = !0, responsive: h, className: g = "", bodyClassName: _ = "", ariaLabel: v, ...b }) {
|
|
4549
5134
|
return T("AppSidebarMenu", b), /* @__PURE__ */ n(y, {
|
|
4550
5135
|
show: e,
|
|
4551
5136
|
onHide: r,
|
|
4552
|
-
placement:
|
|
5137
|
+
placement: qt[i] || "end",
|
|
4553
5138
|
backdrop: d,
|
|
4554
5139
|
scroll: f,
|
|
4555
5140
|
keyboard: p,
|
|
@@ -4569,7 +5154,7 @@ function Ot({ show: e, onHide: r, side: i = "right", title: a, titleIcon: o, hea
|
|
|
4569
5154
|
size: 18
|
|
4570
5155
|
})
|
|
4571
5156
|
}), a]
|
|
4572
|
-
}), m && /* @__PURE__ */ t(
|
|
5157
|
+
}), m && /* @__PURE__ */ t(Q, {
|
|
4573
5158
|
variant: "ghost",
|
|
4574
5159
|
className: "btn-icon",
|
|
4575
5160
|
onClick: r,
|
|
@@ -4593,7 +5178,7 @@ function Ot({ show: e, onHide: r, side: i = "right", title: a, titleIcon: o, hea
|
|
|
4593
5178
|
}
|
|
4594
5179
|
//#endregion
|
|
4595
5180
|
//#region src/components/AppSpinner.jsx
|
|
4596
|
-
function
|
|
5181
|
+
function Yt({ size: e = "md", label: n = "Loading", className: r = "", ...i }) {
|
|
4597
5182
|
return T("AppSpinner", i), /* @__PURE__ */ t("span", {
|
|
4598
5183
|
className: `spinner-border${e === "sm" ? " spinner-border-sm" : ""}${r ? ` ${r}` : ""}`,
|
|
4599
5184
|
role: "status",
|
|
@@ -4602,7 +5187,7 @@ function kt({ size: e = "md", label: n = "Loading", className: r = "", ...i }) {
|
|
|
4602
5187
|
}
|
|
4603
5188
|
//#endregion
|
|
4604
5189
|
//#region src/components/AppSplash.jsx
|
|
4605
|
-
function
|
|
5190
|
+
function Xt({ logo: e, initials: r, text: i, label: a = "Loading", className: o = "", ...s }) {
|
|
4606
5191
|
return T("AppSplash", s), /* @__PURE__ */ t("div", {
|
|
4607
5192
|
className: `splash${o ? ` ${o}` : ""}`,
|
|
4608
5193
|
role: "status",
|
|
@@ -4629,7 +5214,7 @@ function At({ logo: e, initials: r, text: i, label: a = "Loading", className: o
|
|
|
4629
5214
|
}
|
|
4630
5215
|
//#endregion
|
|
4631
5216
|
//#region src/components/AppStatusBadge.jsx
|
|
4632
|
-
function
|
|
5217
|
+
function Zt({ label: e, tone: n = "neutral", className: r = "", ...i }) {
|
|
4633
5218
|
return T("AppStatusBadge", i), e == null || e === "" ? "—" : /* @__PURE__ */ t("span", {
|
|
4634
5219
|
className: `status-label ${n}${r ? ` ${r}` : ""}`,
|
|
4635
5220
|
children: e
|
|
@@ -4637,7 +5222,7 @@ function jt({ label: e, tone: n = "neutral", className: r = "", ...i }) {
|
|
|
4637
5222
|
}
|
|
4638
5223
|
//#endregion
|
|
4639
5224
|
//#region src/components/AppStepper.jsx
|
|
4640
|
-
function
|
|
5225
|
+
function Qt({ steps: r = [], variant: i = "steps", label: a = "Progress", linkComponent: o, className: s = "", ...c }) {
|
|
4641
5226
|
return T("AppStepper", c), /* @__PURE__ */ t("nav", {
|
|
4642
5227
|
className: [i === "journey" ? "stepper stepper-journey" : "stepper", s].filter(Boolean).join(" "),
|
|
4643
5228
|
"aria-label": a,
|
|
@@ -4684,7 +5269,7 @@ function Mt({ steps: r = [], variant: i = "steps", label: a = "Progress", linkCo
|
|
|
4684
5269
|
}
|
|
4685
5270
|
//#endregion
|
|
4686
5271
|
//#region src/components/AppSwitch.jsx
|
|
4687
|
-
var
|
|
5272
|
+
var $t = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
4688
5273
|
T("AppSwitch", s);
|
|
4689
5274
|
let l = o(), u = r || i || l;
|
|
4690
5275
|
return /* @__PURE__ */ n("div", {
|
|
@@ -4705,7 +5290,7 @@ var Nt = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
|
4705
5290
|
});
|
|
4706
5291
|
//#endregion
|
|
4707
5292
|
//#region src/components/AppTableEmptyState.jsx
|
|
4708
|
-
function
|
|
5293
|
+
function en({ icon: e, title: r, text: i, action: a, ...o }) {
|
|
4709
5294
|
return T("AppTableEmptyState", o), /* @__PURE__ */ n("div", {
|
|
4710
5295
|
className: "tbl-empty",
|
|
4711
5296
|
children: [
|
|
@@ -4733,7 +5318,7 @@ function Pt({ icon: e, title: r, text: i, action: a, ...o }) {
|
|
|
4733
5318
|
}
|
|
4734
5319
|
//#endregion
|
|
4735
5320
|
//#region src/components/AppTabs.jsx
|
|
4736
|
-
function
|
|
5321
|
+
function tn({ tabs: e, value: r, onChange: i, variant: a = "underline", ariaLabel: o, className: s = "", ...l }) {
|
|
4737
5322
|
T("AppTabs", l);
|
|
4738
5323
|
let u = c(null);
|
|
4739
5324
|
function d(t) {
|
|
@@ -4777,7 +5362,7 @@ function Ft({ tabs: e, value: r, onChange: i, variant: a = "underline", ariaLabe
|
|
|
4777
5362
|
}
|
|
4778
5363
|
//#endregion
|
|
4779
5364
|
//#region src/components/AppTextarea.jsx
|
|
4780
|
-
var
|
|
5365
|
+
var nn = r(function({ label: e, required: r = !1, error: a, hint: o, help: l, helpLabel: u = "More information", id: d, name: f, rows: p = 4, autoGrow: h = !1, className: g = "", fieldClassName: _ = "", ...v }, y) {
|
|
4781
5366
|
T("AppTextarea", v);
|
|
4782
5367
|
let b = d || f, x = [
|
|
4783
5368
|
"textarea",
|
|
@@ -4808,8 +5393,8 @@ var It = r(function({ label: e, required: r = !1, error: a, hint: o, help: l, he
|
|
|
4808
5393
|
htmlFor: b,
|
|
4809
5394
|
children: [
|
|
4810
5395
|
e,
|
|
4811
|
-
r && /* @__PURE__ */ t(
|
|
4812
|
-
l && /* @__PURE__ */ t(
|
|
5396
|
+
r && /* @__PURE__ */ t(Z, {}),
|
|
5397
|
+
l && /* @__PURE__ */ t(it, {
|
|
4813
5398
|
label: u,
|
|
4814
5399
|
children: l
|
|
4815
5400
|
})
|
|
@@ -4839,7 +5424,7 @@ var It = r(function({ label: e, required: r = !1, error: a, hint: o, help: l, he
|
|
|
4839
5424
|
});
|
|
4840
5425
|
//#endregion
|
|
4841
5426
|
//#region src/components/AppTimeline.jsx
|
|
4842
|
-
function
|
|
5427
|
+
function rn({ items: e = [], className: r = "", ...i }) {
|
|
4843
5428
|
return T("AppTimeline", i), /* @__PURE__ */ t("ol", {
|
|
4844
5429
|
className: `timeline${r ? ` ${r}` : ""}`,
|
|
4845
5430
|
children: e.map((e, r) => /* @__PURE__ */ n("li", {
|
|
@@ -4877,4 +5462,4 @@ function Lt({ items: e = [], className: r = "", ...i }) {
|
|
|
4877
5462
|
});
|
|
4878
5463
|
}
|
|
4879
5464
|
//#endregion
|
|
4880
|
-
export { k as ActionIcon, A as AppAccordion, j as AppAlert,
|
|
5465
|
+
export { k as ActionIcon, A as AppAccordion, j as AppAlert, We as AppAutocomplete, Ke as AppAvatar, qe as AppBadge, Q as AppButton, Xe as AppCallout, Ze as AppCard, Qe as AppCheckbox, $e as AppChip, et as AppChoiceCard, tt as AppChoiceChip, nt as AppColorField, rt as AppCompareTable, lt as AppConfirmDialog, yt as AppDataTable, bt as AppDatePicker, xt as AppDateRangePicker, Ct as AppDropdown, wt as AppEmptyState, Tt as AppFileAttachment, kt as AppFilePicker, At as AppInfoList, it as AppInfoTip, at as AppInput, jt as AppKpiTile, Mt as AppLogoPicker, st as AppModal, Nt as AppMultiSelect, Pt as AppOtpInput, Ft as AppPageHeader, It as AppPhoneNumberInput, Lt as AppPricingCard, Rt as AppRadio, zt as AppRepeater, Bt as AppResourceCard, Vt as AppSearch, Ht as AppSegmented, Wt as AppSelect, mt as AppSelectMini, Gt as AppShell, Jt as AppSidebarMenu, ut as AppSkeleton, pt as AppSkeletonRows, Yt as AppSpinner, Xt as AppSplash, Zt as AppStatusBadge, Qt as AppStepper, $t as AppSwitch, en as AppTableEmptyState, gt as AppTablePagination, tn as AppTabs, nn as AppTextarea, rn as AppTimeline, O as Icon, ct as MODAL_ICONS, Z as RequiredMark, Ot as errorToast, D as iconNames, Dt as toast };
|