@webority/ui-react 0.7.6 → 0.7.7
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/types/components/AppAutocomplete.d.ts +1 -1
- package/dist/types/components/AppCheckbox.d.ts +1 -1
- package/dist/types/components/AppDatePicker.d.ts +1 -1
- package/dist/types/components/AppDateRangePicker.d.ts +1 -1
- package/dist/types/components/AppMultiSelect.d.ts +1 -1
- package/dist/types/components/AppNumberInput.d.ts +5 -1
- package/dist/types/components/AppRadio.d.ts +1 -1
- package/dist/types/components/AppShell.d.ts +11 -6
- package/dist/types/components/AppSlider.d.ts +1 -1
- package/dist/types/components/AppSwitch.d.ts +1 -1
- package/dist/types/components/AppTagInput.d.ts +1 -1
- package/dist/types/components/AppTimePicker.d.ts +1 -1
- package/dist/types/components/AppToastContainer.d.ts +6 -7
- package/dist/types/components/__tests__/restPassthrough.d.ts +9 -0
- package/dist/types/components/toastStore.d.ts +1 -0
- package/dist/types/components/useWuiControl.d.ts +55 -0
- package/dist/ui-react.js +1072 -862
- package/package.json +3 -3
package/dist/ui-react.js
CHANGED
|
@@ -227,7 +227,10 @@ function z({ icon: e, label: t, danger: n = !1, disabled: r = !1, size: i = 20,
|
|
|
227
227
|
function B({ items: e = [], multiple: t = !1, id: n, className: r = "", ...i }) {
|
|
228
228
|
M("AppAccordion", i);
|
|
229
229
|
let a = o(), s = n || a, [c, l] = u(() => {
|
|
230
|
-
let n = e.
|
|
230
|
+
let n = e.map((e, t) => ({
|
|
231
|
+
item: e,
|
|
232
|
+
key: e.key ?? String(t)
|
|
233
|
+
})).filter(({ item: e }) => e.open).map(({ key: e }) => e);
|
|
231
234
|
return new Set(t ? n : n.slice(0, 1));
|
|
232
235
|
}), d = (e, t) => e.key ?? String(t), m = (e) => {
|
|
233
236
|
l((n) => {
|
|
@@ -259,6 +262,8 @@ function B({ items: e = [], multiple: t = !1, id: n, className: r = "", ...i })
|
|
|
259
262
|
className: "faq-a-wrap",
|
|
260
263
|
id: i,
|
|
261
264
|
"aria-labelledby": a,
|
|
265
|
+
inert: !r,
|
|
266
|
+
"aria-hidden": !r || void 0,
|
|
262
267
|
children: /* @__PURE__ */ f("div", {
|
|
263
268
|
className: "faq-a-inner",
|
|
264
269
|
children: e.content
|
|
@@ -340,6 +345,7 @@ function ne({ icon: e, iconSize: t = 24, size: n = "md", title: r, text: i, acti
|
|
|
340
345
|
o
|
|
341
346
|
].filter(Boolean).join(" "),
|
|
342
347
|
style: s,
|
|
348
|
+
...c,
|
|
343
349
|
children: [
|
|
344
350
|
e ? /* @__PURE__ */ f("div", {
|
|
345
351
|
className: "empty-state-icon",
|
|
@@ -364,16 +370,18 @@ function ne({ icon: e, iconSize: t = 24, size: n = "md", title: r, text: i, acti
|
|
|
364
370
|
//#region src/components/AppSpinner.jsx
|
|
365
371
|
function re({ size: e = "md", label: t = "Loading", className: n = "", ...r }) {
|
|
366
372
|
M("AppSpinner", r);
|
|
367
|
-
let i = Number(e),
|
|
373
|
+
let { style: i, ...a } = r, o = Number(e), s = Number.isFinite(o) && o > 0;
|
|
368
374
|
return /* @__PURE__ */ f("span", {
|
|
369
|
-
className: `spinner-border${!
|
|
375
|
+
className: `spinner-border${!s && e === "sm" ? " spinner-border-sm" : ""}${n ? ` ${n}` : ""}`,
|
|
370
376
|
role: "status",
|
|
371
377
|
"aria-label": t,
|
|
372
|
-
style:
|
|
373
|
-
width: `${
|
|
374
|
-
height: `${
|
|
375
|
-
borderWidth: `${Math.max(2, Math.round(
|
|
376
|
-
|
|
378
|
+
style: s ? {
|
|
379
|
+
width: `${o}px`,
|
|
380
|
+
height: `${o}px`,
|
|
381
|
+
borderWidth: `${Math.max(2, Math.round(o / 8))}px`,
|
|
382
|
+
...i
|
|
383
|
+
} : i,
|
|
384
|
+
...a
|
|
377
385
|
});
|
|
378
386
|
}
|
|
379
387
|
//#endregion
|
|
@@ -439,40 +447,40 @@ var oe = class extends HTMLElement {
|
|
|
439
447
|
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>`;
|
|
440
448
|
}
|
|
441
449
|
}, U = 4;
|
|
442
|
-
function
|
|
450
|
+
function se(e, t, n = {}) {
|
|
443
451
|
if (!e || !t) return;
|
|
444
452
|
let r = e.getBoundingClientRect(), i = t.offsetHeight, a = window.innerHeight - r.bottom, o = a < i + U && r.top > a;
|
|
445
453
|
t.classList.toggle("drop-up", o), t.style.position = "fixed", t.style.top = o ? `${Math.max(U, r.top - i - U)}px` : `${r.bottom + U}px`, n.matchWidth && (t.style.width = `${r.width}px`);
|
|
446
454
|
let s = t.offsetWidth, c = Math.min(r.left, window.innerWidth - s - U);
|
|
447
455
|
t.style.left = `${Math.max(U, c)}px`;
|
|
448
456
|
}
|
|
449
|
-
function
|
|
450
|
-
|
|
457
|
+
function ce(e, t) {
|
|
458
|
+
W(e), e._reanchor = t, window.addEventListener("resize", e._reanchor), window.addEventListener("scroll", e._reanchor, !0);
|
|
451
459
|
}
|
|
452
|
-
function
|
|
460
|
+
function W(e) {
|
|
453
461
|
e?._reanchor && (window.removeEventListener("resize", e._reanchor), window.removeEventListener("scroll", e._reanchor, !0), e._reanchor = null);
|
|
454
462
|
}
|
|
455
|
-
var
|
|
456
|
-
function
|
|
457
|
-
let n = e.getAttribute("name"), r = e.querySelector(`:scope > input[${
|
|
463
|
+
var le = "data-wui-mirror";
|
|
464
|
+
function G(e, t) {
|
|
465
|
+
let n = e.getAttribute("name"), r = e.querySelector(`:scope > input[${le}]`);
|
|
458
466
|
if (!n) {
|
|
459
467
|
r?.remove();
|
|
460
468
|
return;
|
|
461
469
|
}
|
|
462
|
-
r || (r = document.createElement("input"), r.type = "hidden", r.setAttribute(
|
|
470
|
+
r || (r = document.createElement("input"), r.type = "hidden", r.setAttribute(le, ""), e.appendChild(r)), r.name = n, r.value = t == null ? "" : String(t);
|
|
463
471
|
for (let t of [...r.attributes]) t.name.startsWith("data-val") && !e.hasAttribute(t.name) && r.removeAttribute(t.name);
|
|
464
472
|
for (let t of e.attributes) t.name.startsWith("data-val") && r.setAttribute(t.name, t.value);
|
|
465
473
|
r.disabled = e.hasAttribute("disabled");
|
|
466
474
|
}
|
|
467
|
-
var
|
|
475
|
+
var ue = Symbol("wui.trustedHtml"), K = (e) => String(e ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), de = (e) => {
|
|
468
476
|
if (!e) return "";
|
|
469
477
|
let t = String(e).toLowerCase().replace(/[^a-z0-9-]/g, "");
|
|
470
478
|
return t ? `<i class="bi bi-${t}" aria-hidden="true"></i>` : "";
|
|
471
|
-
},
|
|
479
|
+
}, fe = (e) => {
|
|
472
480
|
if (e == null) return "";
|
|
473
|
-
let t = e[
|
|
481
|
+
let t = e[ue] ? String(e.label ?? "") : K(e.label), n = de(e.icon);
|
|
474
482
|
return n ? `<span class="wui-opt-label">${n}${t}</span>` : t;
|
|
475
|
-
},
|
|
483
|
+
}, pe = class extends HTMLElement {
|
|
476
484
|
static formAssociated = !0;
|
|
477
485
|
_accessibleName() {
|
|
478
486
|
return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Select";
|
|
@@ -491,7 +499,7 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
491
499
|
];
|
|
492
500
|
}
|
|
493
501
|
constructor() {
|
|
494
|
-
super(), this._value = "", this._label = "", this._optionsProp = null, this._loading = !1, this._active = -1, this._timer = null, this._reqSeq = 0;
|
|
502
|
+
super(), this._value = "", this._label = "", this._optionsProp = null, this._loading = !1, this._active = -1, this._timer = null, this._reqSeq = 0, this._pendingSearch = null;
|
|
495
503
|
try {
|
|
496
504
|
this._internals = this.attachInternals();
|
|
497
505
|
} catch {
|
|
@@ -499,7 +507,14 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
499
507
|
}
|
|
500
508
|
}
|
|
501
509
|
connectedCallback() {
|
|
502
|
-
|
|
510
|
+
if (!this._rendered) {
|
|
511
|
+
this._defaultCaptured ||= (this._defaultValue = this._value, !0), this.render();
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
if (this._bindGlobal?.(), this._pendingSearch) {
|
|
515
|
+
let { query: e, seq: t } = this._pendingSearch;
|
|
516
|
+
clearTimeout(this._timer), this._timer = setTimeout(() => this._fireSearch(e, t), this._debounceMs);
|
|
517
|
+
}
|
|
503
518
|
}
|
|
504
519
|
formResetCallback() {
|
|
505
520
|
this.value = this._defaultValue || "";
|
|
@@ -515,14 +530,14 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
515
530
|
return this._value;
|
|
516
531
|
}
|
|
517
532
|
set value(e) {
|
|
518
|
-
this._value = e == null ? "" : String(e),
|
|
533
|
+
this._value = e == null ? "" : String(e), G(this, this._value);
|
|
519
534
|
let t = this._readOptions().find((e) => String(e.value) === this._value);
|
|
520
|
-
this._label = t ?
|
|
535
|
+
this._label = t ? he(t.label) : "", this._syncInput(), this._renderOptions("");
|
|
521
536
|
}
|
|
522
537
|
set options(e) {
|
|
523
538
|
this._optionsProp = Array.isArray(e) ? e : [];
|
|
524
539
|
let t = this._readOptions().find((e) => String(e.value) === this._value);
|
|
525
|
-
t && (this._label =
|
|
540
|
+
t && (this._label = he(t.label)), this._renderOptions(), this._syncInput();
|
|
526
541
|
}
|
|
527
542
|
get options() {
|
|
528
543
|
return this._readOptions();
|
|
@@ -541,7 +556,7 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
541
556
|
}
|
|
542
557
|
_matchesKnownOption(e) {
|
|
543
558
|
let t = e.toLowerCase();
|
|
544
|
-
return this._readOptions().some((e) =>
|
|
559
|
+
return this._readOptions().some((e) => he(e.label).toLowerCase() === t || String(e.value ?? "").toLowerCase() === t);
|
|
545
560
|
}
|
|
546
561
|
get _minChars() {
|
|
547
562
|
return Math.max(0, Number(this.getAttribute("min-chars")) || +!!this._remote);
|
|
@@ -559,7 +574,7 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
559
574
|
value: e.getAttribute("value") ?? e.textContent.trim(),
|
|
560
575
|
label: e.innerHTML,
|
|
561
576
|
icon: e.getAttribute("icon") || void 0,
|
|
562
|
-
[
|
|
577
|
+
[ue]: !0,
|
|
563
578
|
selected: e.hasAttribute("selected")
|
|
564
579
|
})));
|
|
565
580
|
}
|
|
@@ -569,19 +584,21 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
569
584
|
render() {
|
|
570
585
|
this._snapshotDeclared();
|
|
571
586
|
let e = this.getAttribute("placeholder") || "Search…", t = this.getAttribute("size"), n = t === "sm" ? " search-select-sm" : t === "lg" ? " search-select-lg" : "";
|
|
572
|
-
this.
|
|
587
|
+
this.id ||= `wui-autocomplete-${Math.random().toString(36).slice(2, 9)}`;
|
|
588
|
+
let r = `${this.id}-listbox`;
|
|
589
|
+
this._listboxId = r, this.innerHTML = `
|
|
573
590
|
<div class="search-select${n}">
|
|
574
|
-
<div class="input search-select-control search-select-ac" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-label="${
|
|
575
|
-
<input class="search-select-input search-select-ac-input" placeholder="${
|
|
591
|
+
<div class="input search-select-control search-select-ac" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-controls="${me(r)}" aria-label="${me(this._accessibleName())}">
|
|
592
|
+
<input class="search-select-input search-select-ac-input" placeholder="${me(e)}" aria-autocomplete="list" autocomplete="off"${this.hasAttribute("disabled") ? " disabled" : ""} />
|
|
576
593
|
<span class="search-select-spinner spinner-border spinner-border-sm" role="status" aria-hidden="true" hidden></span>
|
|
577
594
|
<button type="button" class="search-select-clear" aria-label="Clear" hidden><i class="bi bi-x" aria-hidden="true"></i></button>
|
|
578
595
|
</div>
|
|
579
|
-
<div class="search-select-menu search-select-menu-fixed" role="listbox" tabindex="-1" hidden>
|
|
596
|
+
<div class="search-select-menu search-select-menu-fixed" role="listbox" id="${me(r)}" tabindex="-1" hidden>
|
|
580
597
|
<div class="search-select-options"></div>
|
|
581
598
|
<div class="search-select-empty" hidden>No matches</div>
|
|
582
599
|
<div class="search-select-hint" hidden>Type to search…</div>
|
|
583
600
|
</div>
|
|
584
|
-
</div>`, this._rendered = !0,
|
|
601
|
+
</div>`, this._rendered = !0, G(this, this._value), this._wire(), this._syncInput(), this._renderOptions();
|
|
585
602
|
}
|
|
586
603
|
_refs() {
|
|
587
604
|
return {
|
|
@@ -610,43 +627,44 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
610
627
|
let t = this._refs();
|
|
611
628
|
if (!t.optionsWrap) return;
|
|
612
629
|
let n = e ?? (t.input ? t.input.value : ""), r = n.trim().toLowerCase(), i = this._readOptions();
|
|
613
|
-
!this._remote && r && (i = i.filter((e) =>
|
|
630
|
+
!this._remote && r && (i = i.filter((e) => he(e.label).toLowerCase().includes(r)));
|
|
614
631
|
let a = n.trim(), o = this._allowCustom && a && !this._matchesKnownOption(a) ? [...i, {
|
|
615
632
|
value: a,
|
|
616
633
|
custom: !0
|
|
617
|
-
}] : i
|
|
618
|
-
t.optionsWrap.innerHTML = o.map((e) => {
|
|
634
|
+
}] : i, s = this._listboxId || `${this.id || "wui-autocomplete"}-listbox`;
|
|
635
|
+
t.optionsWrap.innerHTML = o.map((e, t) => {
|
|
636
|
+
let n = `${s}-opt-${t}`;
|
|
619
637
|
if (e.custom) {
|
|
620
|
-
let t = `Add “${
|
|
621
|
-
return `<button type="button" role="option" class="search-select-option search-select-option-custom" data-value="${
|
|
638
|
+
let t = `Add “${K(e.value)}”`;
|
|
639
|
+
return `<button type="button" role="option" id="${me(n)}" class="search-select-option search-select-option-custom" data-value="${me(e.value)}" data-custom="true" aria-selected="false">${t}</button>`;
|
|
622
640
|
}
|
|
623
|
-
let
|
|
624
|
-
return `<button type="button" role="option" class="search-select-option${
|
|
625
|
-
}).join(""), this._active = -1;
|
|
626
|
-
let
|
|
627
|
-
t.hint && (t.hint.hidden = !(this._remote &&
|
|
641
|
+
let r = String(e.value) === String(this._value);
|
|
642
|
+
return `<button type="button" role="option" id="${me(n)}" class="search-select-option${r ? " selected" : ""}" data-value="${me(e.value)}" aria-selected="${r}">${fe(e)}</button>`;
|
|
643
|
+
}).join(""), this._active = -1, t.control?.removeAttribute("aria-activedescendant");
|
|
644
|
+
let c = r.length < this._minChars;
|
|
645
|
+
t.hint && (t.hint.hidden = !(this._remote && c && !i.length)), t.empty && (t.empty.hidden = this._loading || o.length > 0 || this._remote && c);
|
|
628
646
|
}
|
|
629
647
|
_wire() {
|
|
630
648
|
this._teardown();
|
|
631
649
|
let e = this._refs();
|
|
632
650
|
if (!e.control || !e.input) return;
|
|
633
|
-
let t = () =>
|
|
634
|
-
let
|
|
635
|
-
this._active =
|
|
651
|
+
let t = () => se(e.control, e.menu, { matchWidth: !0 }), n = () => this._optionEls().filter((e) => !e.hidden), r = (t) => {
|
|
652
|
+
let r = n();
|
|
653
|
+
this._active = t;
|
|
636
654
|
for (let e of this._optionEls()) e.classList.remove("is-active");
|
|
637
|
-
|
|
655
|
+
t >= 0 && r[t] ? (r[t].classList.add("is-active"), r[t].scrollIntoView({ block: "nearest" }), e.control.setAttribute("aria-activedescendant", r[t].id)) : e.control.removeAttribute("aria-activedescendant");
|
|
638
656
|
}, i = () => !e.menu.hidden, a = () => {
|
|
639
657
|
e.menu.hidden = !1, e.control.setAttribute("aria-expanded", "true"), e.control.classList.add("open"), t(), this._renderOptions();
|
|
640
658
|
}, o = () => {
|
|
641
659
|
e.menu.hidden = !0, e.control.setAttribute("aria-expanded", "false"), e.control.classList.remove("open"), r(-1), this._syncInput();
|
|
642
660
|
}, s = (t) => {
|
|
643
661
|
let n = t.dataset.custom === "true";
|
|
644
|
-
this._value = t.dataset.value, this._label = n ? t.dataset.value :
|
|
662
|
+
this._value = t.dataset.value, this._label = n ? t.dataset.value : he(t.innerHTML), G(this, this._value), e.input.value = this._label, this.dispatchEvent(new CustomEvent("change", {
|
|
645
663
|
bubbles: !0,
|
|
646
664
|
detail: { isCustom: n }
|
|
647
665
|
})), o(), e.input.focus();
|
|
648
666
|
}, c = (t) => {
|
|
649
|
-
this._value = t, this._label = t,
|
|
667
|
+
this._value = t, this._label = t, G(this, t), e.input.value = t, this.dispatchEvent(new CustomEvent("change", {
|
|
650
668
|
bubbles: !0,
|
|
651
669
|
detail: { isCustom: !0 }
|
|
652
670
|
})), o();
|
|
@@ -654,17 +672,15 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
654
672
|
e.input.addEventListener("focus", () => a()), e.input.addEventListener("input", () => {
|
|
655
673
|
let t = e.input.value;
|
|
656
674
|
if (e.clear && (e.clear.hidden = !t), i() || a(), this._remote) {
|
|
657
|
-
if (this._renderOptions(t), clearTimeout(this._timer), t.trim().length < this._minChars)
|
|
675
|
+
if (this._renderOptions(t), clearTimeout(this._timer), t.trim().length < this._minChars) {
|
|
676
|
+
this._pendingSearch = null;
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
658
679
|
let e = ++this._reqSeq;
|
|
659
|
-
this.
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
query: t,
|
|
664
|
-
seq: e
|
|
665
|
-
}
|
|
666
|
-
}));
|
|
667
|
-
}, this._debounceMs);
|
|
680
|
+
this._pendingSearch = {
|
|
681
|
+
query: t,
|
|
682
|
+
seq: e
|
|
683
|
+
}, this._timer = setTimeout(() => this._fireSearch(t, e), this._debounceMs);
|
|
668
684
|
} else this._renderOptions(t);
|
|
669
685
|
}), e.input.addEventListener("keydown", (t) => {
|
|
670
686
|
let l = n();
|
|
@@ -688,20 +704,31 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
688
704
|
let t = e.target.closest(".search-select-option");
|
|
689
705
|
t && r(this._optionEls().indexOf(t));
|
|
690
706
|
}), e.optionsWrap.addEventListener("mouseleave", () => r(-1)), e.clear?.addEventListener("click", () => {
|
|
691
|
-
this._value = "", this._label = "",
|
|
692
|
-
}), this.
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
707
|
+
this._value = "", this._label = "", G(this, ""), e.input.value = "", e.clear.hidden = !0, this._renderOptions(""), this.dispatchEvent(new Event("change", { bubbles: !0 })), e.input.focus();
|
|
708
|
+
}), this._bindGlobal = () => {
|
|
709
|
+
this._teardown(), this._onDocClick = (e) => {
|
|
710
|
+
i() && !this.contains(e.target) && o();
|
|
711
|
+
}, document.addEventListener("click", this._onDocClick), ce(this, () => {
|
|
712
|
+
i() && t();
|
|
713
|
+
});
|
|
714
|
+
}, this._bindGlobal();
|
|
715
|
+
}
|
|
716
|
+
_fireSearch(e, t) {
|
|
717
|
+
this._pendingSearch = null, this.dispatchEvent(new CustomEvent("search", {
|
|
718
|
+
bubbles: !0,
|
|
719
|
+
detail: {
|
|
720
|
+
query: e,
|
|
721
|
+
seq: t
|
|
722
|
+
}
|
|
723
|
+
}));
|
|
697
724
|
}
|
|
698
725
|
_teardown() {
|
|
699
|
-
this._onDocClick
|
|
726
|
+
this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null), W(this), clearTimeout(this._timer);
|
|
700
727
|
}
|
|
701
728
|
disconnectedCallback() {
|
|
702
729
|
this._teardown();
|
|
703
730
|
}
|
|
704
|
-
},
|
|
731
|
+
}, me = (e) => String(e ?? "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<"), he = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), ge = [
|
|
705
732
|
"January",
|
|
706
733
|
"February",
|
|
707
734
|
"March",
|
|
@@ -714,7 +741,7 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
714
741
|
"October",
|
|
715
742
|
"November",
|
|
716
743
|
"December"
|
|
717
|
-
],
|
|
744
|
+
], _e = [
|
|
718
745
|
"Su",
|
|
719
746
|
"Mo",
|
|
720
747
|
"Tu",
|
|
@@ -722,24 +749,24 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
722
749
|
"Th",
|
|
723
750
|
"Fr",
|
|
724
751
|
"Sa"
|
|
725
|
-
],
|
|
752
|
+
], ve = (e) => String(e).padStart(2, "0"), ye = (e, t, n) => `${e}-${ve(t + 1)}-${ve(n)}`, q = (e) => {
|
|
726
753
|
let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e || "");
|
|
727
754
|
return t ? {
|
|
728
755
|
y: +t[1],
|
|
729
756
|
m: t[2] - 1,
|
|
730
757
|
d: +t[3]
|
|
731
758
|
} : null;
|
|
732
|
-
},
|
|
733
|
-
let t =
|
|
734
|
-
return t ? `${
|
|
735
|
-
},
|
|
759
|
+
}, be = (e) => {
|
|
760
|
+
let t = q(e);
|
|
761
|
+
return t ? `${ve(t.d)} ${ge[t.m].slice(0, 3)} ${t.y}` : "";
|
|
762
|
+
}, xe = (e, t) => new Date(e, t + 1, 0).getDate(), Se = (e, t) => {
|
|
736
763
|
for (; t < 0;) t += 12, --e;
|
|
737
764
|
for (; t > 11;) t -= 12, e += 1;
|
|
738
765
|
return {
|
|
739
766
|
y: e,
|
|
740
767
|
m: t
|
|
741
768
|
};
|
|
742
|
-
},
|
|
769
|
+
}, Ce = class extends HTMLElement {
|
|
743
770
|
static formAssociated = !0;
|
|
744
771
|
static get observedAttributes() {
|
|
745
772
|
return [
|
|
@@ -766,7 +793,11 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
766
793
|
this._viewY = e.getFullYear(), this._viewM = e.getMonth(), this._mode = "days", this._focus = null, this._slide = "";
|
|
767
794
|
}
|
|
768
795
|
connectedCallback() {
|
|
769
|
-
this._rendered
|
|
796
|
+
if (!this._rendered) {
|
|
797
|
+
this.render();
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
this._bindGlobal?.();
|
|
770
801
|
}
|
|
771
802
|
attributeChangedCallback(e, t, n) {
|
|
772
803
|
this._rendered && (e === "value" ? (this._value = n || "", this._syncFormValue(), this._syncTrigger()) : e === "first-day" ? this.querySelector(".datepicker-pop")?.hidden || this._renderView() : this.render());
|
|
@@ -778,37 +809,37 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
778
809
|
return this._value;
|
|
779
810
|
}
|
|
780
811
|
set value(e) {
|
|
781
|
-
this._value = e || "",
|
|
812
|
+
this._value = e || "", G(this, this._value), this._syncTrigger();
|
|
782
813
|
}
|
|
783
814
|
_firstDay() {
|
|
784
815
|
let e = Number.parseInt(this.getAttribute("first-day") ?? "", 10);
|
|
785
816
|
return Number.isInteger(e) && e >= 0 && e <= 6 ? e : 0;
|
|
786
817
|
}
|
|
787
818
|
render() {
|
|
788
|
-
this._defaultValue === void 0 && (this._defaultValue = this.getAttribute("value") || ""
|
|
789
|
-
let e = this.getAttribute("placeholder") || "Enter Date", t =
|
|
819
|
+
this._defaultValue === void 0 && (this._defaultValue = this.getAttribute("value") || "", this._value = this._defaultValue || this._value);
|
|
820
|
+
let e = this.getAttribute("placeholder") || "Enter Date", t = q(this._value);
|
|
790
821
|
t && (this._viewY = t.y, this._viewM = t.m);
|
|
791
822
|
let n = this.getAttribute("size"), r = n === "sm" ? " input-sm" : n === "lg" ? " input-lg" : "", i = this.getAttribute("aria-label"), a = this.getAttribute("aria-describedby");
|
|
792
823
|
this.innerHTML = `
|
|
793
824
|
<div class="datepicker">
|
|
794
|
-
<button type="button" class="input datepicker-trigger${r}${t ? " has-value" : ""}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}${i ? ` aria-label="${
|
|
795
|
-
<span data-trigger-label class="${t ? "" : "search-select-placeholder"}">${t ?
|
|
825
|
+
<button type="button" class="input datepicker-trigger${r}${t ? " has-value" : ""}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}${i ? ` aria-label="${K(i)}"` : ""}${a ? ` aria-describedby="${K(a)}"` : ""}>
|
|
826
|
+
<span data-trigger-label class="${t ? "" : "search-select-placeholder"}">${t ? be(this._value) : K(e)}</span>
|
|
796
827
|
<i class="bi bi-calendar3" aria-hidden="true"></i>
|
|
797
828
|
</button>
|
|
798
829
|
<div class="datepicker-pop" role="dialog" aria-modal="false" hidden></div>
|
|
799
|
-
</div>`, this._rendered = !0,
|
|
830
|
+
</div>`, this._rendered = !0, G(this, this._value), this._wire();
|
|
800
831
|
}
|
|
801
832
|
_syncFormValue() {
|
|
802
|
-
|
|
833
|
+
G(this, this._value);
|
|
803
834
|
}
|
|
804
835
|
_syncTrigger() {
|
|
805
836
|
let e = this.querySelector(".datepicker-trigger"), t = this.querySelector("[data-trigger-label]");
|
|
806
837
|
if (!t) return;
|
|
807
|
-
let n =
|
|
808
|
-
t.textContent = n ?
|
|
838
|
+
let n = q(this._value);
|
|
839
|
+
t.textContent = n ? be(this._value) : this.getAttribute("placeholder") || "Enter Date", t.classList.toggle("search-select-placeholder", !n), e?.classList.toggle("has-value", !!n);
|
|
809
840
|
}
|
|
810
841
|
_limits() {
|
|
811
|
-
let e =
|
|
842
|
+
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;
|
|
812
843
|
return {
|
|
813
844
|
dayDisabled: (e, t, i) => {
|
|
814
845
|
let a = new Date(e, t, i).getTime();
|
|
@@ -816,7 +847,7 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
816
847
|
},
|
|
817
848
|
monthDisabled: (e, t) => {
|
|
818
849
|
let i = new Date(e, t, 1).getTime();
|
|
819
|
-
return new Date(e, t,
|
|
850
|
+
return new Date(e, t, xe(e, t)).getTime() < n || i > r;
|
|
820
851
|
},
|
|
821
852
|
yearDisabled: (e) => {
|
|
822
853
|
let t = new Date(e, 0, 1).getTime();
|
|
@@ -829,28 +860,28 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
829
860
|
e && (this._mode === "months" ? e.innerHTML = this._monthsHtml() : this._mode === "years" ? e.innerHTML = this._yearsHtml() : e.innerHTML = this._daysHtml(), this._focusActive());
|
|
830
861
|
}
|
|
831
862
|
_daysHtml() {
|
|
832
|
-
let e = this._firstDay(), t = (new Date(this._viewY, this._viewM, 1).getDay() - e + 7) % 7, n =
|
|
863
|
+
let e = this._firstDay(), t = (new Date(this._viewY, this._viewM, 1).getDay() - e + 7) % 7, n = xe(this._viewY, this._viewM), r = q(this._value), i = /* @__PURE__ */ new Date(), { dayDisabled: a } = this._limits(), o = this._focus || r || {
|
|
833
864
|
y: this._viewY,
|
|
834
865
|
m: this._viewM,
|
|
835
866
|
d: 1
|
|
836
867
|
}, s = (e, t, n, s) => {
|
|
837
|
-
let c =
|
|
868
|
+
let c = ye(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);
|
|
838
869
|
return `<button type="button" class="${[
|
|
839
870
|
"datepicker-day",
|
|
840
871
|
s ? "is-outside" : "",
|
|
841
872
|
u ? "is-today" : "",
|
|
842
873
|
l ? "is-selected" : ""
|
|
843
874
|
].filter(Boolean).join(" ")}" data-iso="${c}" role="gridcell" tabindex="${d && !f ? "0" : "-1"}"${l ? " aria-selected=\"true\"" : ""}${f ? " disabled aria-disabled=\"true\"" : ""}>${n}</button>`;
|
|
844
|
-
}, c = "", l =
|
|
875
|
+
}, c = "", l = Se(this._viewY, this._viewM - 1), u = xe(l.y, l.m);
|
|
845
876
|
for (let e = t - 1; e >= 0; e--) c += s(l.y, l.m, u - e, !0);
|
|
846
877
|
for (let e = 1; e <= n; e++) c += s(this._viewY, this._viewM, e, !1);
|
|
847
|
-
let d =
|
|
878
|
+
let d = Se(this._viewY, this._viewM + 1), f = (7 - (t + n) % 7) % 7;
|
|
848
879
|
for (let e = 1; e <= f; e++) c += s(d.y, d.m, e, !0);
|
|
849
|
-
let p =
|
|
880
|
+
let p = _e.map((t, n) => _e[(n + e) % 7]).map((e) => `<span>${e}</span>`).join("");
|
|
850
881
|
return `
|
|
851
882
|
<div class="datepicker-head">
|
|
852
883
|
<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>
|
|
853
|
-
<button type="button" class="datepicker-month" data-view="months" aria-label="Choose month and year">${
|
|
884
|
+
<button type="button" class="datepicker-month" data-view="months" aria-label="Choose month and year">${ge[this._viewM]} ${this._viewY}</button>
|
|
854
885
|
<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>
|
|
855
886
|
</div>
|
|
856
887
|
<div class="datepicker-weekdays">${p}</div>
|
|
@@ -861,14 +892,14 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
861
892
|
</div>`;
|
|
862
893
|
}
|
|
863
894
|
_monthsHtml() {
|
|
864
|
-
let e =
|
|
895
|
+
let e = q(this._value), t = /* @__PURE__ */ new Date(), { monthDisabled: n } = this._limits(), r = "";
|
|
865
896
|
for (let i = 0; i < 12; i++) {
|
|
866
897
|
let a = e && e.y === this._viewY && e.m === i, o = t.getFullYear() === this._viewY && t.getMonth() === i, s = n(this._viewY, i), c = [
|
|
867
898
|
"datepicker-cell",
|
|
868
899
|
o ? "is-today" : "",
|
|
869
900
|
a ? "is-selected" : ""
|
|
870
901
|
].filter(Boolean).join(" ");
|
|
871
|
-
r += `<button type="button" class="${c}" data-month="${i}"${s ? " disabled" : ""}>${
|
|
902
|
+
r += `<button type="button" class="${c}" data-month="${i}"${s ? " disabled" : ""}>${ge[i].slice(0, 3)}</button>`;
|
|
872
903
|
}
|
|
873
904
|
return `
|
|
874
905
|
<div class="datepicker-head">
|
|
@@ -879,7 +910,7 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
879
910
|
<div class="datepicker-cells">${r}</div>`;
|
|
880
911
|
}
|
|
881
912
|
_yearsHtml() {
|
|
882
|
-
let e =
|
|
913
|
+
let e = q(this._value), t = (/* @__PURE__ */ new Date()).getFullYear(), { yearDisabled: n } = this._limits(), r = this._viewY - (this._viewY % 10 + 10) % 10 - 1, i = "";
|
|
883
914
|
for (let a = 0; a < 12; a++) {
|
|
884
915
|
let o = r + a, s = e && e.y === o, c = t === o, l = n(o), u = [
|
|
885
916
|
"datepicker-cell",
|
|
@@ -901,24 +932,24 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
901
932
|
t && e.contains(document.activeElement) && t.focus();
|
|
902
933
|
}
|
|
903
934
|
_position(e, t) {
|
|
904
|
-
|
|
935
|
+
se(e, t);
|
|
905
936
|
}
|
|
906
937
|
_setFocus(e, t, n, r) {
|
|
907
|
-
let { y: i, m: a } =
|
|
938
|
+
let { y: i, m: a } = Se(e, t);
|
|
908
939
|
this._focus = {
|
|
909
940
|
y: i,
|
|
910
941
|
m: a,
|
|
911
942
|
d: n
|
|
912
943
|
};
|
|
913
944
|
let o = i !== this._viewY || a !== this._viewM;
|
|
914
|
-
this._viewY = i, this._viewM = a, this._slide = o && r || "", this._renderView(), this._slide = "", this.querySelector(`.datepicker-day[data-iso="${
|
|
945
|
+
this._viewY = i, this._viewM = a, this._slide = o && r || "", this._renderView(), this._slide = "", this.querySelector(`.datepicker-day[data-iso="${ye(i, a, n)}"]`)?.focus();
|
|
915
946
|
}
|
|
916
947
|
_onKey(e) {
|
|
917
948
|
if (this._mode !== "days") {
|
|
918
949
|
e.key === "Escape" && this._close();
|
|
919
950
|
return;
|
|
920
951
|
}
|
|
921
|
-
let t = this._focus ||
|
|
952
|
+
let t = this._focus || q(this._value) || {
|
|
922
953
|
y: this._viewY,
|
|
923
954
|
m: this._viewM,
|
|
924
955
|
d: 1
|
|
@@ -936,17 +967,17 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
936
967
|
case "End": return n(6 - (new Date(t.y, t.m, t.d).getDay() - this._firstDay() + 7) % 7, "slide-next");
|
|
937
968
|
case "PageUp": {
|
|
938
969
|
e.preventDefault();
|
|
939
|
-
let n =
|
|
940
|
-
return this._setFocus(n.y, n.m, Math.min(t.d,
|
|
970
|
+
let n = Se(t.y, t.m - (e.shiftKey ? 12 : 1));
|
|
971
|
+
return this._setFocus(n.y, n.m, Math.min(t.d, xe(n.y, n.m)), "slide-prev");
|
|
941
972
|
}
|
|
942
973
|
case "PageDown": {
|
|
943
974
|
e.preventDefault();
|
|
944
|
-
let n =
|
|
945
|
-
return this._setFocus(n.y, n.m, Math.min(t.d,
|
|
975
|
+
let n = Se(t.y, t.m + (e.shiftKey ? 12 : 1));
|
|
976
|
+
return this._setFocus(n.y, n.m, Math.min(t.d, xe(n.y, n.m)), "slide-next");
|
|
946
977
|
}
|
|
947
978
|
case "Enter":
|
|
948
979
|
case " ":
|
|
949
|
-
e.preventDefault(), this._limits().dayDisabled(t.y, t.m, t.d) || (this.value =
|
|
980
|
+
e.preventDefault(), this._limits().dayDisabled(t.y, t.m, t.d) || (this.value = ye(t.y, t.m, t.d), this.dispatchEvent(new Event("change", { bubbles: !0 })), this._close());
|
|
950
981
|
return;
|
|
951
982
|
case "Escape": return this._close();
|
|
952
983
|
default:
|
|
@@ -958,11 +989,11 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
958
989
|
if (!e || !t) return;
|
|
959
990
|
let r = () => !t.hidden;
|
|
960
991
|
this._open = () => {
|
|
961
|
-
if (!
|
|
992
|
+
if (!q(this._value) && !this._viewNavigated) {
|
|
962
993
|
let e = /* @__PURE__ */ new Date();
|
|
963
994
|
this._viewY = e.getFullYear(), this._viewM = e.getMonth();
|
|
964
995
|
}
|
|
965
|
-
let r =
|
|
996
|
+
let r = q(this._value), i = /* @__PURE__ */ new Date();
|
|
966
997
|
this._mode = "days", this._focus = r || {
|
|
967
998
|
y: this._viewY,
|
|
968
999
|
m: this._viewM,
|
|
@@ -975,7 +1006,7 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
975
1006
|
let t = e.target.closest("[data-nav]");
|
|
976
1007
|
if (t) {
|
|
977
1008
|
this._viewNavigated = !0, this._slide = Number(t.dataset.nav) < 0 ? "slide-prev" : "slide-next";
|
|
978
|
-
let e =
|
|
1009
|
+
let e = Se(this._viewY, this._viewM + Number(t.dataset.nav));
|
|
979
1010
|
this._viewY = e.y, this._viewM = e.m, this._focus = {
|
|
980
1011
|
y: e.y,
|
|
981
1012
|
m: e.m,
|
|
@@ -1014,7 +1045,7 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1014
1045
|
}
|
|
1015
1046
|
if (e.target.closest("[data-today]")) {
|
|
1016
1047
|
let e = /* @__PURE__ */ new Date();
|
|
1017
|
-
this.value =
|
|
1048
|
+
this.value = ye(e.getFullYear(), e.getMonth(), e.getDate()), this.dispatchEvent(new Event("change", { bubbles: !0 })), this._close();
|
|
1018
1049
|
return;
|
|
1019
1050
|
}
|
|
1020
1051
|
if (e.target.closest("[data-clear]")) {
|
|
@@ -1025,22 +1056,24 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1025
1056
|
s && !s.disabled && (this.value = s.dataset.iso, this.dispatchEvent(new Event("change", { bubbles: !0 })), this._close());
|
|
1026
1057
|
}), this._onKeyBound = (e) => {
|
|
1027
1058
|
r() && this._onKey(e);
|
|
1028
|
-
}, t.addEventListener("keydown", this._onKeyBound), this.
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1059
|
+
}, t.addEventListener("keydown", this._onKeyBound), this._bindGlobal = () => {
|
|
1060
|
+
this._teardown(), this._onDocClick = (e) => {
|
|
1061
|
+
let t = this._popClick;
|
|
1062
|
+
this._popClick = !1, r() && !t && !this.contains(e.target) && this._close();
|
|
1063
|
+
}, document.addEventListener("click", this._onDocClick), this._onDocKey = (e) => {
|
|
1064
|
+
r() && e.key === "Escape" && this._close();
|
|
1065
|
+
}, document.addEventListener("keydown", this._onDocKey), ce(this, () => {
|
|
1066
|
+
r() && this._position(e, t);
|
|
1067
|
+
});
|
|
1068
|
+
}, this._bindGlobal(), this._syncFormValue();
|
|
1036
1069
|
}
|
|
1037
1070
|
_teardown() {
|
|
1038
|
-
this._onDocClick
|
|
1071
|
+
this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null), this._onDocKey &&= (document.removeEventListener("keydown", this._onDocKey), null), W(this);
|
|
1039
1072
|
}
|
|
1040
1073
|
disconnectedCallback() {
|
|
1041
1074
|
this._teardown();
|
|
1042
1075
|
}
|
|
1043
|
-
},
|
|
1076
|
+
}, we = [
|
|
1044
1077
|
"January",
|
|
1045
1078
|
"February",
|
|
1046
1079
|
"March",
|
|
@@ -1053,7 +1086,7 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1053
1086
|
"October",
|
|
1054
1087
|
"November",
|
|
1055
1088
|
"December"
|
|
1056
|
-
],
|
|
1089
|
+
], Te = [
|
|
1057
1090
|
"Su",
|
|
1058
1091
|
"Mo",
|
|
1059
1092
|
"Tu",
|
|
@@ -1061,24 +1094,24 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1061
1094
|
"Th",
|
|
1062
1095
|
"Fr",
|
|
1063
1096
|
"Sa"
|
|
1064
|
-
],
|
|
1097
|
+
], Ee = (e) => String(e).padStart(2, "0"), De = (e, t, n) => `${e}-${Ee(t + 1)}-${Ee(n)}`, Oe = (e) => {
|
|
1065
1098
|
let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e || "");
|
|
1066
1099
|
return t ? {
|
|
1067
1100
|
y: +t[1],
|
|
1068
1101
|
m: t[2] - 1,
|
|
1069
1102
|
d: +t[3]
|
|
1070
1103
|
} : null;
|
|
1071
|
-
},
|
|
1072
|
-
let t =
|
|
1073
|
-
return t ? `${
|
|
1074
|
-
},
|
|
1104
|
+
}, ke = (e) => {
|
|
1105
|
+
let t = Oe(e);
|
|
1106
|
+
return t ? `${Ee(t.d)} ${we[t.m].slice(0, 3)} ${t.y}` : "";
|
|
1107
|
+
}, Ae = (e, t) => new Date(e, t + 1, 0).getDate(), je = (e, t) => {
|
|
1075
1108
|
for (; t < 0;) t += 12, --e;
|
|
1076
1109
|
for (; t > 11;) t -= 12, e += 1;
|
|
1077
1110
|
return {
|
|
1078
1111
|
y: e,
|
|
1079
1112
|
m: t
|
|
1080
1113
|
};
|
|
1081
|
-
},
|
|
1114
|
+
}, Me = class extends HTMLElement {
|
|
1082
1115
|
static formAssociated = !0;
|
|
1083
1116
|
static get observedAttributes() {
|
|
1084
1117
|
return [
|
|
@@ -1109,7 +1142,11 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1109
1142
|
this._viewY = e.getFullYear(), this._viewM = e.getMonth();
|
|
1110
1143
|
}
|
|
1111
1144
|
connectedCallback() {
|
|
1112
|
-
this._rendered
|
|
1145
|
+
if (!this._rendered) {
|
|
1146
|
+
this.render();
|
|
1147
|
+
return;
|
|
1148
|
+
}
|
|
1149
|
+
this._bindGlobal?.();
|
|
1113
1150
|
}
|
|
1114
1151
|
attributeChangedCallback(e, t, n) {
|
|
1115
1152
|
this._rendered && (e === "start" || e === "end" ? (this._start = this.getAttribute("start") || "", this._end = this.getAttribute("end") || "", this._syncTrigger(), this._syncMirrors()) : this.render());
|
|
@@ -1133,19 +1170,19 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1133
1170
|
text: e,
|
|
1134
1171
|
empty: !0
|
|
1135
1172
|
} : {
|
|
1136
|
-
text: `${
|
|
1173
|
+
text: `${ke(this._start) || "Start"} – ${ke(this._end) || "End"}`,
|
|
1137
1174
|
empty: !1
|
|
1138
1175
|
};
|
|
1139
1176
|
}
|
|
1140
1177
|
render() {
|
|
1141
|
-
this._defaultStart === void 0 && (this._defaultStart = this.getAttribute("start") || "", this._defaultEnd = this.getAttribute("end") || ""
|
|
1142
|
-
let e =
|
|
1178
|
+
this._defaultStart === void 0 && (this._defaultStart = this.getAttribute("start") || "", this._defaultEnd = this.getAttribute("end") || "", this._start = this._defaultStart || this._start, this._end = this._defaultEnd || this._end);
|
|
1179
|
+
let e = Oe(this._start);
|
|
1143
1180
|
e && (this._viewY = e.y, this._viewM = e.m);
|
|
1144
1181
|
let t = this.getAttribute("size"), n = t === "sm" ? " input-sm" : t === "lg" ? " input-lg" : "", { text: r, empty: i } = this._label(), a = this.getAttribute("aria-label"), o = this.getAttribute("aria-describedby");
|
|
1145
1182
|
this.innerHTML = `
|
|
1146
1183
|
<div class="daterange">
|
|
1147
|
-
<button type="button" class="input daterange-trigger${n}${i ? "" : " has-value"}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}${a ? ` aria-label="${
|
|
1148
|
-
<span data-range-label class="${i ? "search-select-placeholder" : ""}">${
|
|
1184
|
+
<button type="button" class="input daterange-trigger${n}${i ? "" : " has-value"}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}${a ? ` aria-label="${K(a)}"` : ""}${o ? ` aria-describedby="${K(o)}"` : ""}>
|
|
1185
|
+
<span data-range-label class="${i ? "search-select-placeholder" : ""}">${K(r)}</span>
|
|
1149
1186
|
<i class="bi bi-calendar-range" aria-hidden="true"></i>
|
|
1150
1187
|
</button>
|
|
1151
1188
|
<div class="daterange-pop" role="dialog" aria-modal="false" hidden></div>
|
|
@@ -1173,24 +1210,24 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1173
1210
|
r || (r = document.createElement("input"), r.type = "hidden", r.setAttribute("data-range-mirror", e), this.appendChild(r)), r.name = t, r.value = n || "", r.disabled = this.hasAttribute("disabled");
|
|
1174
1211
|
}
|
|
1175
1212
|
_limits() {
|
|
1176
|
-
let e =
|
|
1213
|
+
let e = Oe(this.getAttribute("min")), t = Oe(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;
|
|
1177
1214
|
return (e, t, i) => {
|
|
1178
1215
|
let a = new Date(e, t, i).getTime();
|
|
1179
1216
|
return a < n || a > r;
|
|
1180
1217
|
};
|
|
1181
1218
|
}
|
|
1182
1219
|
_monthHtml(e, t) {
|
|
1183
|
-
let n = this._firstDay(), r = (new Date(e, t, 1).getDay() - n + 7) % 7, i =
|
|
1184
|
-
let i =
|
|
1220
|
+
let n = this._firstDay(), r = (new Date(e, t, 1).getDay() - n + 7) % 7, i = Ae(e, t), a = this._limits(), o = Te.map((e, t) => Te[(t + n) % 7]).map((e) => `<span>${e}</span>`).join(""), s = (e, t, n, r) => {
|
|
1221
|
+
let i = De(e, t, n), o = a(e, t, n);
|
|
1185
1222
|
return `<button type="button" class="${["datepicker-day", r ? "is-outside" : ""].filter(Boolean).join(" ")}" data-iso="${i}"${o ? " disabled" : ""}>${n}</button>`;
|
|
1186
|
-
}, c = "", l =
|
|
1223
|
+
}, c = "", l = je(e, t - 1), u = Ae(l.y, l.m);
|
|
1187
1224
|
for (let e = r - 1; e >= 0; e--) c += s(l.y, l.m, u - e, !0);
|
|
1188
1225
|
for (let n = 1; n <= i; n++) c += s(e, t, n, !1);
|
|
1189
|
-
let d =
|
|
1226
|
+
let d = je(e, t + 1), f = (7 - (r + i) % 7) % 7;
|
|
1190
1227
|
for (let e = 1; e <= f; e++) c += s(d.y, d.m, e, !0);
|
|
1191
1228
|
return `
|
|
1192
1229
|
<div class="daterange-cal">
|
|
1193
|
-
<div class="datepicker-month-label">${
|
|
1230
|
+
<div class="datepicker-month-label">${we[t]} ${e}</div>
|
|
1194
1231
|
<div class="datepicker-weekdays">${o}</div>
|
|
1195
1232
|
<div class="datepicker-grid" role="grid">${c}</div>
|
|
1196
1233
|
</div>`;
|
|
@@ -1198,7 +1235,7 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1198
1235
|
_renderView() {
|
|
1199
1236
|
let e = this.querySelector(".daterange-pop");
|
|
1200
1237
|
if (!e) return;
|
|
1201
|
-
let t =
|
|
1238
|
+
let t = je(this._viewY, this._viewM + 1);
|
|
1202
1239
|
e.innerHTML = `
|
|
1203
1240
|
<div class="daterange-head">
|
|
1204
1241
|
<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>
|
|
@@ -1224,10 +1261,10 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1224
1261
|
n.classList.toggle("is-range-start", i), n.classList.toggle("is-range-end", a), n.classList.toggle("in-range", o);
|
|
1225
1262
|
}
|
|
1226
1263
|
let i = e.querySelector("[data-range-hint]");
|
|
1227
|
-
i && (i.textContent = this._start ? this._end ? `${
|
|
1264
|
+
i && (i.textContent = this._start ? this._end ? `${ke(this._start)} – ${ke(this._end)}` : "Pick an end date" : "Pick a start date");
|
|
1228
1265
|
}
|
|
1229
1266
|
_position(e, t) {
|
|
1230
|
-
|
|
1267
|
+
se(e, t);
|
|
1231
1268
|
}
|
|
1232
1269
|
_pick(e) {
|
|
1233
1270
|
if (!this._start || this._start && this._end) {
|
|
@@ -1246,7 +1283,7 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1246
1283
|
if (!e || !t) return;
|
|
1247
1284
|
let r = () => !t.hidden;
|
|
1248
1285
|
this._open = () => {
|
|
1249
|
-
let r =
|
|
1286
|
+
let r = Oe(this._start);
|
|
1250
1287
|
if (r) this._viewY = r.y, this._viewM = r.m;
|
|
1251
1288
|
else {
|
|
1252
1289
|
let e = /* @__PURE__ */ new Date();
|
|
@@ -1259,7 +1296,7 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1259
1296
|
this._popClick = !0;
|
|
1260
1297
|
let t = e.target.closest("[data-nav]");
|
|
1261
1298
|
if (t) {
|
|
1262
|
-
let e =
|
|
1299
|
+
let e = je(this._viewY, this._viewM + Number(t.dataset.nav));
|
|
1263
1300
|
this._viewY = e.y, this._viewM = e.m, this._renderView();
|
|
1264
1301
|
return;
|
|
1265
1302
|
}
|
|
@@ -1272,22 +1309,24 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1272
1309
|
}), t.addEventListener("mouseover", (e) => {
|
|
1273
1310
|
let t = e.target.closest(".datepicker-day[data-iso]");
|
|
1274
1311
|
t && this._start && !this._end && (this._hover = t.dataset.iso, this._paint());
|
|
1275
|
-
}), this.
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1312
|
+
}), this._bindGlobal = () => {
|
|
1313
|
+
this._teardown(), this._onDocClick = (e) => {
|
|
1314
|
+
let t = this._popClick;
|
|
1315
|
+
this._popClick = !1, r() && !t && !this.contains(e.target) && this._close();
|
|
1316
|
+
}, document.addEventListener("click", this._onDocClick), this._onDocKey = (e) => {
|
|
1317
|
+
r() && e.key === "Escape" && this._close();
|
|
1318
|
+
}, document.addEventListener("keydown", this._onDocKey), ce(this, () => {
|
|
1319
|
+
r() && this._position(e, t);
|
|
1320
|
+
});
|
|
1321
|
+
}, this._bindGlobal(), this._syncMirrors();
|
|
1283
1322
|
}
|
|
1284
1323
|
_teardown() {
|
|
1285
|
-
this._onDocClick
|
|
1324
|
+
this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null), this._onDocKey &&= (document.removeEventListener("keydown", this._onDocKey), null), W(this);
|
|
1286
1325
|
}
|
|
1287
1326
|
disconnectedCallback() {
|
|
1288
1327
|
this._teardown();
|
|
1289
1328
|
}
|
|
1290
|
-
},
|
|
1329
|
+
}, Ne = class extends HTMLElement {
|
|
1291
1330
|
static formAssociated = !0;
|
|
1292
1331
|
_accessibleName() {
|
|
1293
1332
|
return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Select";
|
|
@@ -1315,11 +1354,17 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1315
1354
|
connectedCallback() {
|
|
1316
1355
|
if (!this._rendered) {
|
|
1317
1356
|
if (!this._valuesInit && !this._optionsProp && !this._values.length) {
|
|
1318
|
-
let e =
|
|
1319
|
-
e
|
|
1357
|
+
let e = this.getAttribute("value");
|
|
1358
|
+
if (e != null && e !== "") this._values = e.split(",").map((e) => e.trim()).filter(Boolean);
|
|
1359
|
+
else {
|
|
1360
|
+
let e = [...this.querySelectorAll(":scope > wui-option[selected]")].map((e) => e.getAttribute("value") ?? e.textContent.trim());
|
|
1361
|
+
e.length && (this._values = e.map(String));
|
|
1362
|
+
}
|
|
1320
1363
|
}
|
|
1321
1364
|
this._valuesInit = !0, this._defaultCaptured ||= (this._defaultValues = this._values.slice(), !0), this.render();
|
|
1365
|
+
return;
|
|
1322
1366
|
}
|
|
1367
|
+
this._bindGlobal?.();
|
|
1323
1368
|
}
|
|
1324
1369
|
formResetCallback() {
|
|
1325
1370
|
this.values = (this._defaultValues || []).slice();
|
|
@@ -1331,7 +1376,11 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1331
1376
|
return this._values.slice();
|
|
1332
1377
|
}
|
|
1333
1378
|
set values(e) {
|
|
1334
|
-
this._values = Array.isArray(e) ? e.map(String) : [],
|
|
1379
|
+
if (this._values = Array.isArray(e) ? e.map(String) : [], G(this, this._values.join(",")), this._rendered) {
|
|
1380
|
+
this._renderControl();
|
|
1381
|
+
let e = this.querySelector(".search-select-input");
|
|
1382
|
+
this._renderOptions(e ? e.value : "");
|
|
1383
|
+
}
|
|
1335
1384
|
}
|
|
1336
1385
|
set options(e) {
|
|
1337
1386
|
this._optionsProp = Array.isArray(e) ? e : null, this.isConnected && this.render();
|
|
@@ -1346,7 +1395,7 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1346
1395
|
value: e.getAttribute("value") ?? e.textContent.trim(),
|
|
1347
1396
|
label: e.innerHTML,
|
|
1348
1397
|
icon: e.getAttribute("icon") || void 0,
|
|
1349
|
-
[
|
|
1398
|
+
[ue]: !0,
|
|
1350
1399
|
selected: e.hasAttribute("selected")
|
|
1351
1400
|
})));
|
|
1352
1401
|
}
|
|
@@ -1359,34 +1408,36 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1359
1408
|
}
|
|
1360
1409
|
_labelHtmlFor(e) {
|
|
1361
1410
|
let t = this._readOptions().find((t) => String(t.value) === String(e));
|
|
1362
|
-
return t ?
|
|
1411
|
+
return t ? fe(t) : K(e);
|
|
1363
1412
|
}
|
|
1364
1413
|
render() {
|
|
1365
1414
|
this._snapshotDeclared();
|
|
1366
1415
|
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" : "";
|
|
1367
|
-
|
|
1416
|
+
G(this, this._values.join(",")), this.id ||= `wui-multiselect-${Math.random().toString(36).slice(2, 9)}`;
|
|
1417
|
+
let a = `${this.id}-listbox`;
|
|
1418
|
+
this._listboxId = a, this.innerHTML = `
|
|
1368
1419
|
<div class="search-select${i}">
|
|
1369
|
-
<div class="input search-select-control search-select-multi" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-label="${
|
|
1370
|
-
${n ? `<i class="bi bi-${
|
|
1420
|
+
<div class="input search-select-control search-select-multi" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-controls="${J(a)}" aria-label="${J(this._accessibleName())}"${this.hasAttribute("disabled") ? " aria-disabled=\"true\"" : " tabindex=\"0\""}>
|
|
1421
|
+
${n ? `<i class="bi bi-${J(n)} search-select-icon" aria-hidden="true"></i>` : ""}
|
|
1371
1422
|
<div class="ms-chips" data-chips></div>
|
|
1372
1423
|
<i class="bi bi-chevron-down search-select-caret" aria-hidden="true"></i>
|
|
1373
1424
|
</div>
|
|
1374
|
-
<div class="search-select-menu search-select-menu-fixed" role="listbox" aria-multiselectable="true" tabindex="-1" hidden>
|
|
1375
|
-
${e ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${
|
|
1425
|
+
<div class="search-select-menu search-select-menu-fixed" role="listbox" id="${J(a)}" aria-multiselectable="true" tabindex="-1" hidden>
|
|
1426
|
+
${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>` : ""}
|
|
1376
1427
|
<div class="search-select-options"></div>
|
|
1377
1428
|
<div class="search-select-empty" hidden>No matches</div>
|
|
1378
1429
|
</div>
|
|
1379
|
-
</div>`, this._rendered = !0,
|
|
1430
|
+
</div>`, this._rendered = !0, G(this, this._values.join(",")), this._renderControl(), this._renderOptions(), this._wire();
|
|
1380
1431
|
}
|
|
1381
1432
|
_renderControl() {
|
|
1382
1433
|
let e = this.querySelector("[data-chips]");
|
|
1383
1434
|
if (!e) return;
|
|
1384
1435
|
let t = this.getAttribute("placeholder") || "Select…";
|
|
1385
1436
|
if (!this._values.length) {
|
|
1386
|
-
e.innerHTML = `<span class="search-select-placeholder">${
|
|
1437
|
+
e.innerHTML = `<span class="search-select-placeholder">${K(t)}</span>`;
|
|
1387
1438
|
return;
|
|
1388
1439
|
}
|
|
1389
|
-
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="${
|
|
1440
|
+
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 ${J(Pe(this._labelFor(e)))}"><i class="bi bi-x" aria-hidden="true"></i></button></span>`).join(""), this._collapseChips();
|
|
1390
1441
|
}
|
|
1391
1442
|
_collapseChips() {
|
|
1392
1443
|
let e = this.querySelector("[data-chips]");
|
|
@@ -1410,28 +1461,28 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1410
1461
|
let t = this.querySelector(".search-select-options"), n = this.querySelector(".search-select-empty");
|
|
1411
1462
|
if (!t) return;
|
|
1412
1463
|
let r = (e || "").trim().toLowerCase(), i = this._readOptions();
|
|
1413
|
-
r && (i = i.filter((e) =>
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1464
|
+
r && (i = i.filter((e) => Pe(e.label).toLowerCase().includes(r)));
|
|
1465
|
+
let a = this._listboxId || `${this.id || "wui-multiselect"}-listbox`;
|
|
1466
|
+
t.innerHTML = i.map((e, t) => {
|
|
1467
|
+
let n = this._values.includes(String(e.value));
|
|
1468
|
+
return `<button type="button" role="option" id="${J(`${a}-opt-${t}`)}" class="search-select-option${n ? " selected" : ""}" data-value="${J(e.value)}" aria-selected="${n}"><span class="ms-opt-label">${fe(e)}</span><span class="ms-check"><i class="bi bi-check" aria-hidden="true"></i></span></button>`;
|
|
1469
|
+
}).join(""), n && (n.hidden = i.length > 0), this._active = -1, this.querySelector(".search-select-control")?.removeAttribute("aria-activedescendant");
|
|
1417
1470
|
}
|
|
1418
1471
|
_wire() {
|
|
1419
1472
|
this._teardown();
|
|
1420
1473
|
let e = this.querySelector(".search-select-control"), t = this.querySelector(".search-select-menu"), n = this.querySelector(".search-select-input"), r = this.querySelector(".search-select-clear"), i = this.querySelector(".search-select-options");
|
|
1421
1474
|
if (!e || !t) return;
|
|
1422
|
-
let a = () => this.hasAttribute("disabled")
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
let t = c();
|
|
1426
|
-
this._active = e;
|
|
1475
|
+
let a = () => this.hasAttribute("disabled"), o = () => se(e, t, { matchWidth: !0 }), s = () => [...this.querySelectorAll(".search-select-option")], c = () => s().filter((e) => !e.hidden), l = (t) => {
|
|
1476
|
+
let n = c();
|
|
1477
|
+
this._active = t;
|
|
1427
1478
|
for (let e of s()) e.classList.remove("is-active");
|
|
1428
|
-
|
|
1479
|
+
t >= 0 && n[t] ? (n[t].classList.add("is-active"), n[t].scrollIntoView({ block: "nearest" }), e.setAttribute("aria-activedescendant", n[t].id)) : e.removeAttribute("aria-activedescendant");
|
|
1429
1480
|
}, u = () => !t.hidden, d = () => {
|
|
1430
1481
|
a() || (t.hidden = !1, e.setAttribute("aria-expanded", "true"), e.classList.add("open"), o(), n && (n.value = "", this._renderOptions(""), n.focus()));
|
|
1431
1482
|
}, f = () => {
|
|
1432
1483
|
t.hidden = !0, e.setAttribute("aria-expanded", "false"), e.classList.remove("open"), l(-1);
|
|
1433
1484
|
}, p = () => {
|
|
1434
|
-
|
|
1485
|
+
G(this, this._values.join(",")), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
1435
1486
|
}, m = (e) => {
|
|
1436
1487
|
let t = String(e);
|
|
1437
1488
|
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();
|
|
@@ -1467,19 +1518,21 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1467
1518
|
return;
|
|
1468
1519
|
}
|
|
1469
1520
|
(e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") && (e.preventDefault(), d());
|
|
1470
|
-
}), this.
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1521
|
+
}), this._bindGlobal = () => {
|
|
1522
|
+
this._teardown(), !this._ro && typeof ResizeObserver < "u" && (this._ro = new ResizeObserver(() => this._collapseChips()), this._ro.observe(this)), this._onDocClick = (e) => {
|
|
1523
|
+
u() && !this.contains(e.target) && f();
|
|
1524
|
+
}, document.addEventListener("click", this._onDocClick), ce(this, () => {
|
|
1525
|
+
u() && o();
|
|
1526
|
+
});
|
|
1527
|
+
}, this._bindGlobal();
|
|
1475
1528
|
}
|
|
1476
1529
|
_teardown() {
|
|
1477
|
-
this._onDocClick
|
|
1530
|
+
this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null), W(this);
|
|
1478
1531
|
}
|
|
1479
1532
|
disconnectedCallback() {
|
|
1480
1533
|
this._teardown(), this._ro?.disconnect(), this._ro = null;
|
|
1481
1534
|
}
|
|
1482
|
-
},
|
|
1535
|
+
}, J = (e) => String(e ?? "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<"), Pe = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), Fe = /[^0-9]/g, Ie = /[^0-9a-zA-Z]/g, Le = class extends HTMLElement {
|
|
1483
1536
|
static formAssociated = !0;
|
|
1484
1537
|
static get observedAttributes() {
|
|
1485
1538
|
return [
|
|
@@ -1507,10 +1560,10 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1507
1560
|
return this._value ?? "";
|
|
1508
1561
|
}
|
|
1509
1562
|
set value(e) {
|
|
1510
|
-
this._value = this._clean(e),
|
|
1563
|
+
this._value = this._clean(e), G(this, this._value), this._paint();
|
|
1511
1564
|
}
|
|
1512
1565
|
_clean(e) {
|
|
1513
|
-
return (e == null ? "" : String(e)).replace(this.mode === "alphanumeric" ?
|
|
1566
|
+
return (e == null ? "" : String(e)).replace(this.mode === "alphanumeric" ? Ie : Fe, "").slice(0, this.length);
|
|
1514
1567
|
}
|
|
1515
1568
|
constructor() {
|
|
1516
1569
|
super();
|
|
@@ -1524,10 +1577,10 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1524
1577
|
this._rendered ? this._onSelectionChange && document.addEventListener("selectionchange", this._onSelectionChange) : (this._defaultCaptured ||= (this._defaultValue = this._value, !0), this.render());
|
|
1525
1578
|
}
|
|
1526
1579
|
formResetCallback() {
|
|
1527
|
-
this._value = this._defaultValue || "",
|
|
1580
|
+
this._value = this._defaultValue || "", G(this, this._value), this._paint();
|
|
1528
1581
|
}
|
|
1529
1582
|
attributeChangedCallback(e, t, n) {
|
|
1530
|
-
this._rendered && (e === "value" ? (this._value = this._clean(n),
|
|
1583
|
+
this._rendered && (e === "value" ? (this._value = this._clean(n), G(this, this._value), this._paint()) : this.render());
|
|
1531
1584
|
}
|
|
1532
1585
|
render() {
|
|
1533
1586
|
this._value = this._clean(this.getAttribute("value") ?? this._value);
|
|
@@ -1545,7 +1598,7 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1545
1598
|
spellcheck="false"
|
|
1546
1599
|
${n ? "disabled" : ""} />
|
|
1547
1600
|
<div class="otp-slots" aria-hidden="true">${r}</div>
|
|
1548
|
-
</div>`, this._rendered = !0,
|
|
1601
|
+
</div>`, this._rendered = !0, G(this, this._value), this._wire(), this._paint();
|
|
1549
1602
|
}
|
|
1550
1603
|
_refs() {
|
|
1551
1604
|
return {
|
|
@@ -1567,7 +1620,7 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1567
1620
|
if (!e) return;
|
|
1568
1621
|
let t = (e) => {
|
|
1569
1622
|
let t = this._clean(e), n = t !== this._value;
|
|
1570
|
-
this._value = t,
|
|
1623
|
+
this._value = t, G(this, this._value), this._paint(), n && this.dispatchEvent(new Event("change", { bubbles: !0 })), n && t.length === this.length && this.dispatchEvent(new CustomEvent("complete", {
|
|
1571
1624
|
bubbles: !0,
|
|
1572
1625
|
detail: t
|
|
1573
1626
|
}));
|
|
@@ -1590,7 +1643,7 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1590
1643
|
disconnectedCallback() {
|
|
1591
1644
|
this._onSelectionChange && document.removeEventListener("selectionchange", this._onSelectionChange);
|
|
1592
1645
|
}
|
|
1593
|
-
},
|
|
1646
|
+
}, Re = [
|
|
1594
1647
|
[
|
|
1595
1648
|
"AF",
|
|
1596
1649
|
"Afghanistan",
|
|
@@ -2816,56 +2869,56 @@ var ce = Symbol("wui.trustedHtml"), J = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
2816
2869
|
"Zimbabwe",
|
|
2817
2870
|
"263"
|
|
2818
2871
|
]
|
|
2819
|
-
],
|
|
2872
|
+
], ze = (e) => (Re.find((t) => t[0] === e) || [
|
|
2820
2873
|
"",
|
|
2821
2874
|
"",
|
|
2822
2875
|
""
|
|
2823
|
-
])[2],
|
|
2824
|
-
function
|
|
2825
|
-
return
|
|
2876
|
+
])[2], Be = (e) => `wui-flag wui-flag-${String(e).toLowerCase()}`, Y = null, Ve = null;
|
|
2877
|
+
function He() {
|
|
2878
|
+
return Y ? Promise.resolve(Y) : (Ve ||= Promise.all([import("./libphonenumber-js-BcNT8oq0-DMpMlice.js"), import("./examples.mobile.json-BMXTGiGC-Dl_Tt3py.js")]).then(([e, t]) => (Y = {
|
|
2826
2879
|
AsYouType: e.AsYouType,
|
|
2827
2880
|
getExampleNumber: e.getExampleNumber,
|
|
2828
2881
|
isValidPhoneNumber: e.isValidPhoneNumber,
|
|
2829
2882
|
examples: t.default || t
|
|
2830
|
-
},
|
|
2883
|
+
}, Y)).catch(() => null), Ve);
|
|
2831
2884
|
}
|
|
2832
|
-
function
|
|
2833
|
-
if (!
|
|
2885
|
+
function Ue(e, t) {
|
|
2886
|
+
if (!Y || !t) return t;
|
|
2834
2887
|
try {
|
|
2835
|
-
return new
|
|
2888
|
+
return new Y.AsYouType(e).input(t);
|
|
2836
2889
|
} catch {
|
|
2837
2890
|
return t;
|
|
2838
2891
|
}
|
|
2839
2892
|
}
|
|
2840
|
-
function
|
|
2841
|
-
if (!
|
|
2893
|
+
function We(e) {
|
|
2894
|
+
if (!Y) return null;
|
|
2842
2895
|
try {
|
|
2843
|
-
return
|
|
2896
|
+
return Y.getExampleNumber(e, Y.examples)?.formatNational() || null;
|
|
2844
2897
|
} catch {
|
|
2845
2898
|
return null;
|
|
2846
2899
|
}
|
|
2847
2900
|
}
|
|
2848
|
-
function
|
|
2849
|
-
if (!
|
|
2901
|
+
function Ge(e) {
|
|
2902
|
+
if (!Y || !e) return null;
|
|
2850
2903
|
try {
|
|
2851
|
-
return
|
|
2904
|
+
return Y.isValidPhoneNumber(e);
|
|
2852
2905
|
} catch {
|
|
2853
2906
|
return null;
|
|
2854
2907
|
}
|
|
2855
2908
|
}
|
|
2856
|
-
function
|
|
2857
|
-
if (!
|
|
2909
|
+
function Ke(e) {
|
|
2910
|
+
if (!Y) return null;
|
|
2858
2911
|
try {
|
|
2859
|
-
let t =
|
|
2912
|
+
let t = Y.getExampleNumber(e, Y.examples);
|
|
2860
2913
|
return t?.nationalNumber ? t.nationalNumber.length : null;
|
|
2861
2914
|
} catch {
|
|
2862
2915
|
return null;
|
|
2863
2916
|
}
|
|
2864
2917
|
}
|
|
2865
|
-
function
|
|
2866
|
-
if (!
|
|
2918
|
+
function qe(e) {
|
|
2919
|
+
if (!Y || !e?.trim().startsWith("+")) return null;
|
|
2867
2920
|
try {
|
|
2868
|
-
let t = new
|
|
2921
|
+
let t = new Y.AsYouType();
|
|
2869
2922
|
t.input(e.trim());
|
|
2870
2923
|
let n = t.getCountry();
|
|
2871
2924
|
return n ? {
|
|
@@ -2876,7 +2929,7 @@ function Ke(e) {
|
|
|
2876
2929
|
return null;
|
|
2877
2930
|
}
|
|
2878
2931
|
}
|
|
2879
|
-
var
|
|
2932
|
+
var Je = class extends HTMLElement {
|
|
2880
2933
|
static formAssociated = !0;
|
|
2881
2934
|
static get observedAttributes() {
|
|
2882
2935
|
return [
|
|
@@ -2912,41 +2965,41 @@ var qe = class extends HTMLElement {
|
|
|
2912
2965
|
this.value = this._defaultValue || "";
|
|
2913
2966
|
}
|
|
2914
2967
|
get value() {
|
|
2915
|
-
return this._national ? `+${
|
|
2968
|
+
return this._national ? `+${ze(this._country)}${this._national}` : "";
|
|
2916
2969
|
}
|
|
2917
2970
|
set value(e) {
|
|
2918
|
-
let t = String(e ?? "").trim(), n =
|
|
2971
|
+
let t = String(e ?? "").trim(), n = qe(t);
|
|
2919
2972
|
if (n) this._country = n.country, this._national = n.national.replace(/[^0-9]/g, "");
|
|
2920
2973
|
else if (t.startsWith("+")) {
|
|
2921
|
-
let e = t.replace(/[^0-9]/g, ""), n = String(
|
|
2974
|
+
let e = t.replace(/[^0-9]/g, ""), n = String(ze(this._country));
|
|
2922
2975
|
n && e.startsWith(n) && (e = e.slice(n.length)), this._national = e;
|
|
2923
2976
|
} else this._national = t.replace(/[^0-9]/g, "");
|
|
2924
2977
|
n && this.getAttribute("country") !== this._country ? this.setAttribute("country", this._country) : this._rendered && this.render(), this._syncMirror();
|
|
2925
2978
|
}
|
|
2926
2979
|
_syncMirror() {
|
|
2927
|
-
|
|
2980
|
+
G(this, this.value);
|
|
2928
2981
|
}
|
|
2929
2982
|
render() {
|
|
2930
2983
|
this._defaultValue === void 0 && (this._defaultValue = this.getAttribute("value") || "");
|
|
2931
|
-
let e = this.getAttribute("placeholder") ||
|
|
2984
|
+
let e = this.getAttribute("placeholder") || We(this._country) || "Enter phone number";
|
|
2932
2985
|
this._country = this.getAttribute("country") || this._country;
|
|
2933
|
-
let t =
|
|
2986
|
+
let t = Re.map(([e, t, n]) => `<button type="button" role="option" class="country-dropdown-item${e === this._country ? " selected" : ""}" data-iso="${e}"><span class="${Be(e)}" aria-hidden="true"></span><span class="country-name-text">${t}<span class="country-code-text">+${n}</span></span></button>`).join("");
|
|
2934
2987
|
this.innerHTML = `
|
|
2935
2988
|
<div class="phone-input-wrap">
|
|
2936
2989
|
<div class="phone-country-adornment">
|
|
2937
2990
|
<button type="button" class="country-toggle" aria-haspopup="listbox" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}>
|
|
2938
|
-
<span class="${
|
|
2991
|
+
<span class="${Be(this._country)}" data-flag aria-hidden="true"></span>
|
|
2939
2992
|
<i class="bi bi-chevron-down phone-chevron" aria-hidden="true"></i>
|
|
2940
|
-
<span class="phone-dial" data-dial>+${
|
|
2993
|
+
<span class="phone-dial" data-dial>+${ze(this._country)}</span>
|
|
2941
2994
|
</button>
|
|
2942
2995
|
<div class="country-dropdown-menu" role="listbox" hidden>
|
|
2943
2996
|
<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>
|
|
2944
2997
|
<div class="country-list-scroll">${t}<div class="country-empty" hidden>No countries found</div></div>
|
|
2945
2998
|
</div>
|
|
2946
2999
|
</div>
|
|
2947
|
-
<input type="tel" class="input" placeholder="${
|
|
3000
|
+
<input type="tel" class="input" placeholder="${Ye(e)}" value="${Ye(Ue(this._country, this._national))}"${this.getAttribute("aria-label") ? ` aria-label="${Ye(this.getAttribute("aria-label"))}"` : ""}${this.getAttribute("aria-describedby") ? ` aria-describedby="${Ye(this.getAttribute("aria-describedby"))}"` : ""}${this.hasAttribute("required") ? " required aria-required=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""} />
|
|
2948
3001
|
</div>
|
|
2949
|
-
<div class="field-error" data-phone-error hidden></div>`, this._rendered = !0,
|
|
3002
|
+
<div class="field-error" data-phone-error hidden></div>`, this._rendered = !0, G(this, this.value), this._wire();
|
|
2950
3003
|
}
|
|
2951
3004
|
_wire() {
|
|
2952
3005
|
this._teardown();
|
|
@@ -2971,7 +3024,7 @@ var qe = class extends HTMLElement {
|
|
|
2971
3024
|
}
|
|
2972
3025
|
a && (a.hidden = n > 0);
|
|
2973
3026
|
}, m = (e) => {
|
|
2974
|
-
this._country = e, this.setAttribute("country", e), s && (s.className =
|
|
3027
|
+
this._country = e, this.setAttribute("country", e), s && (s.className = Be(e)), c && (c.textContent = `+${ze(e)}`);
|
|
2975
3028
|
for (let t of i.querySelectorAll(".country-dropdown-item")) t.classList.toggle("selected", t.dataset.iso === e);
|
|
2976
3029
|
f(), this._syncMirror(), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2977
3030
|
};
|
|
@@ -2982,27 +3035,27 @@ var qe = class extends HTMLElement {
|
|
|
2982
3035
|
let h = this.querySelector("[data-phone-error]"), g = (e) => {
|
|
2983
3036
|
if (o.classList.toggle("is-invalid", e), e ? o.setAttribute("aria-invalid", "true") : o.removeAttribute("aria-invalid"), h) {
|
|
2984
3037
|
if (e) {
|
|
2985
|
-
let e =
|
|
3038
|
+
let e = We(this._country);
|
|
2986
3039
|
h.textContent = e ? `Enter a valid phone number, e.g. ${e}` : "Enter a valid phone number";
|
|
2987
3040
|
}
|
|
2988
3041
|
h.hidden = !e;
|
|
2989
3042
|
}
|
|
2990
3043
|
};
|
|
2991
3044
|
o.addEventListener("input", () => {
|
|
2992
|
-
let e = o.value.replace(/[^0-9]/g, ""), t =
|
|
3045
|
+
let e = o.value.replace(/[^0-9]/g, ""), t = Ke(this._country);
|
|
2993
3046
|
t && e.length > t && (e = e.slice(0, t)), this._national = e;
|
|
2994
|
-
let n =
|
|
2995
|
-
o.value !== n && (o.value = n), this._syncMirror(), this.dispatchEvent(new Event("change", { bubbles: !0 })), o.classList.contains("is-invalid") && (!this._national ||
|
|
3047
|
+
let n = Ue(this._country, this._national);
|
|
3048
|
+
o.value !== n && (o.value = n), this._syncMirror(), this.dispatchEvent(new Event("change", { bubbles: !0 })), o.classList.contains("is-invalid") && (!this._national || Ge(this.value) === !0) && g(!1);
|
|
2996
3049
|
}), o.addEventListener("blur", () => {
|
|
2997
|
-
g(this._national.length > 0 &&
|
|
3050
|
+
g(this._national.length > 0 && Ge(this.value) === !1);
|
|
2998
3051
|
}), o.addEventListener("paste", (e) => {
|
|
2999
|
-
let t =
|
|
3000
|
-
t && (e.preventDefault(), this._national = t.national.replace(/[^0-9]/g, ""), t.country === this._country ? o.value =
|
|
3052
|
+
let t = qe(e.clipboardData?.getData("text"));
|
|
3053
|
+
t && (e.preventDefault(), this._national = t.national.replace(/[^0-9]/g, ""), t.country === this._country ? o.value = Ue(this._country, this._national) : this.setAttribute("country", t.country), this._syncMirror(), this.dispatchEvent(new Event("change", { bubbles: !0 })), this.querySelector("input[type=tel]")?.focus());
|
|
3001
3054
|
}), this._onDocClick = (e) => {
|
|
3002
3055
|
l() && !this.contains(e.target) && f();
|
|
3003
|
-
}, document.addEventListener("click", this._onDocClick),
|
|
3004
|
-
if (!(!e || !o) && (this._national && (o.value =
|
|
3005
|
-
let e =
|
|
3056
|
+
}, document.addEventListener("click", this._onDocClick), He().then((e) => {
|
|
3057
|
+
if (!(!e || !o) && (this._national && (o.value = Ue(this._country, this._national)), !this.getAttribute("placeholder"))) {
|
|
3058
|
+
let e = We(this._country);
|
|
3006
3059
|
e && (o.placeholder = e);
|
|
3007
3060
|
}
|
|
3008
3061
|
}), this._syncMirror();
|
|
@@ -3013,7 +3066,7 @@ var qe = class extends HTMLElement {
|
|
|
3013
3066
|
disconnectedCallback() {
|
|
3014
3067
|
this._teardown();
|
|
3015
3068
|
}
|
|
3016
|
-
},
|
|
3069
|
+
}, Ye = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), Xe = class extends HTMLElement {
|
|
3017
3070
|
static formAssociated = !0;
|
|
3018
3071
|
static get observedAttributes() {
|
|
3019
3072
|
return [
|
|
@@ -3043,7 +3096,11 @@ var qe = class extends HTMLElement {
|
|
|
3043
3096
|
this._value = "", this._optionsProp = null, this._active = -1;
|
|
3044
3097
|
}
|
|
3045
3098
|
connectedCallback() {
|
|
3046
|
-
this._rendered
|
|
3099
|
+
if (!this._rendered) {
|
|
3100
|
+
this.render();
|
|
3101
|
+
return;
|
|
3102
|
+
}
|
|
3103
|
+
this._bindGlobal?.();
|
|
3047
3104
|
}
|
|
3048
3105
|
attributeChangedCallback(e, t, n) {
|
|
3049
3106
|
if (e === "value") {
|
|
@@ -3059,7 +3116,7 @@ var qe = class extends HTMLElement {
|
|
|
3059
3116
|
return this._value;
|
|
3060
3117
|
}
|
|
3061
3118
|
set value(e) {
|
|
3062
|
-
this._value = e == null ? "" : String(e),
|
|
3119
|
+
this._value = e == null ? "" : String(e), G(this, this._value), this._syncSelected(), this._syncReset();
|
|
3063
3120
|
}
|
|
3064
3121
|
set options(e) {
|
|
3065
3122
|
this._optionsProp = Array.isArray(e) ? e : null, this.isConnected && this.render();
|
|
@@ -3074,7 +3131,7 @@ var qe = class extends HTMLElement {
|
|
|
3074
3131
|
value: e.getAttribute("value") ?? e.textContent.trim(),
|
|
3075
3132
|
label: e.innerHTML,
|
|
3076
3133
|
icon: e.getAttribute("icon") || void 0,
|
|
3077
|
-
[
|
|
3134
|
+
[ue]: !0,
|
|
3078
3135
|
selected: e.hasAttribute("selected")
|
|
3079
3136
|
})));
|
|
3080
3137
|
}
|
|
@@ -3084,25 +3141,27 @@ var qe = class extends HTMLElement {
|
|
|
3084
3141
|
render() {
|
|
3085
3142
|
this._defaultValue === void 0 && (this._defaultValue = this.getAttribute("value") || ""), this._snapshotDeclared();
|
|
3086
3143
|
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);
|
|
3087
|
-
l && (this._value = String(l.value)),
|
|
3088
|
-
let u =
|
|
3089
|
-
|
|
3090
|
-
|
|
3144
|
+
l && (this._value = String(l.value)), G(this, this._value), this.id ||= `wui-select-${Math.random().toString(36).slice(2, 9)}`;
|
|
3145
|
+
let u = `${this.id}-listbox`;
|
|
3146
|
+
this._listboxId = u;
|
|
3147
|
+
let d = e.map((e, t) => {
|
|
3148
|
+
let n = String(e.value) === String(this._value);
|
|
3149
|
+
return `<button type="button" role="option" id="${Ze(`${u}-opt-${t}`)}" class="search-select-option${n ? " selected" : ""}" data-value="${Ze(e.value)}" aria-selected="${n}">${fe(e)}</button>`;
|
|
3091
3150
|
}).join("");
|
|
3092
3151
|
this.innerHTML = `
|
|
3093
3152
|
<div class="search-select${this.hasAttribute("compact") ? " search-select-compact" : ""}${i}">
|
|
3094
|
-
<button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false" aria-label="${
|
|
3095
|
-
${a ? `<i class="bi bi-${
|
|
3096
|
-
${o ? `<span class="search-select-prefix">${
|
|
3097
|
-
<span class="${l ? "" : "search-select-placeholder"}" data-label>${l ?
|
|
3153
|
+
<button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false" aria-controls="${Ze(u)}" aria-label="${Ze(this._accessibleName())}"${this.hasAttribute("disabled") ? " disabled" : ""}>
|
|
3154
|
+
${a ? `<i class="bi bi-${Ze(a)} search-select-icon" aria-hidden="true"></i>` : ""}
|
|
3155
|
+
${o ? `<span class="search-select-prefix">${K(o)}</span>` : ""}
|
|
3156
|
+
<span class="${l ? "" : "search-select-placeholder"}" data-label>${l ? fe(l) : K(s)}</span>
|
|
3098
3157
|
${n ? "<span class=\"search-select-reset\" role=\"button\" aria-label=\"Clear selection\" hidden><i class=\"bi bi-x-lg\" aria-hidden=\"true\"></i></span>" : ""}
|
|
3099
3158
|
<i class="bi bi-chevron-down search-select-caret" aria-hidden="true"></i>
|
|
3100
3159
|
</button>
|
|
3101
|
-
<div class="search-select-menu search-select-menu-fixed" role="listbox" tabindex="-1" hidden>
|
|
3102
|
-
${t ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${
|
|
3103
|
-
<div class="search-select-options">${
|
|
3160
|
+
<div class="search-select-menu search-select-menu-fixed" role="listbox" id="${Ze(u)}" tabindex="-1" hidden>
|
|
3161
|
+
${t ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${Ze(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>` : ""}
|
|
3162
|
+
<div class="search-select-options">${d}<div class="search-select-empty" hidden>No matches</div></div>
|
|
3104
3163
|
</div>
|
|
3105
|
-
</div>`, this._rendered = !0,
|
|
3164
|
+
</div>`, this._rendered = !0, G(this, this._value), this._wire(), this._syncReset();
|
|
3106
3165
|
}
|
|
3107
3166
|
_refs() {
|
|
3108
3167
|
return {
|
|
@@ -3128,7 +3187,7 @@ var qe = class extends HTMLElement {
|
|
|
3128
3187
|
let t = e.dataset.value === String(this._value);
|
|
3129
3188
|
e.classList.toggle("selected", t), e.setAttribute("aria-selected", String(t));
|
|
3130
3189
|
}
|
|
3131
|
-
e && (e.innerHTML = t ?
|
|
3190
|
+
e && (e.innerHTML = t ? fe(t) : K(this.getAttribute("placeholder") || "Select..."), e.classList.toggle("search-select-placeholder", !t));
|
|
3132
3191
|
}
|
|
3133
3192
|
_syncReset() {
|
|
3134
3193
|
let { reset: e } = this._refs();
|
|
@@ -3141,13 +3200,13 @@ var qe = class extends HTMLElement {
|
|
|
3141
3200
|
let t = () => {
|
|
3142
3201
|
if (this.hasAttribute("compact")) {
|
|
3143
3202
|
let t = e.control.getBoundingClientRect();
|
|
3144
|
-
e.menu.style.width = "max-content", e.menu.style.minWidth = `${t.width}px`, e.menu.style.maxWidth = "280px",
|
|
3145
|
-
} else
|
|
3146
|
-
}, n = (
|
|
3147
|
-
let
|
|
3148
|
-
this._active =
|
|
3203
|
+
e.menu.style.width = "max-content", e.menu.style.minWidth = `${t.width}px`, e.menu.style.maxWidth = "280px", se(e.control, e.menu);
|
|
3204
|
+
} else se(e.control, e.menu, { matchWidth: !0 });
|
|
3205
|
+
}, n = (t) => {
|
|
3206
|
+
let n = this._visible();
|
|
3207
|
+
this._active = t;
|
|
3149
3208
|
for (let e of this._optionEls()) e.classList.remove("is-active");
|
|
3150
|
-
|
|
3209
|
+
t >= 0 && n[t] ? (n[t].classList.add("is-active"), n[t].scrollIntoView({ block: "nearest" }), e.control.setAttribute("aria-activedescendant", n[t].id)) : e.control.removeAttribute("aria-activedescendant");
|
|
3151
3210
|
}, r = (t) => {
|
|
3152
3211
|
let n = t.trim().toLowerCase(), r = 0;
|
|
3153
3212
|
for (let e of this._optionEls()) {
|
|
@@ -3183,19 +3242,21 @@ var qe = class extends HTMLElement {
|
|
|
3183
3242
|
r(e.search.value), n(-1);
|
|
3184
3243
|
}), e.clear?.addEventListener("click", () => {
|
|
3185
3244
|
e.search.value = "", r(""), e.search.focus();
|
|
3186
|
-
}), e.menu.addEventListener("keydown", c), this.
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3245
|
+
}), e.menu.addEventListener("keydown", c), this._bindGlobal = () => {
|
|
3246
|
+
this._teardown(), this._onDocClick = (e) => {
|
|
3247
|
+
i() && !this.contains(e.target) && o();
|
|
3248
|
+
}, document.addEventListener("click", this._onDocClick), ce(this, () => {
|
|
3249
|
+
i() && t();
|
|
3250
|
+
});
|
|
3251
|
+
}, this._bindGlobal();
|
|
3191
3252
|
}
|
|
3192
3253
|
_teardown() {
|
|
3193
|
-
this._onDocClick
|
|
3254
|
+
this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null), W(this);
|
|
3194
3255
|
}
|
|
3195
3256
|
disconnectedCallback() {
|
|
3196
3257
|
this._teardown();
|
|
3197
3258
|
}
|
|
3198
|
-
},
|
|
3259
|
+
}, Ze = (e) => String(e ?? "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<"), Qe = class extends HTMLElement {
|
|
3199
3260
|
static formAssociated = !0;
|
|
3200
3261
|
static get observedAttributes() {
|
|
3201
3262
|
return [
|
|
@@ -3222,10 +3283,32 @@ var qe = class extends HTMLElement {
|
|
|
3222
3283
|
} catch {
|
|
3223
3284
|
this._internals = null;
|
|
3224
3285
|
}
|
|
3225
|
-
this._value = 50, this._start = 25, this._end = 75, this._isDragging = !1, this._dragThumb = null, this._pointerDownListener = null, this._pointerMoveListener = null, this._pointerUpListener = null;
|
|
3286
|
+
this._value = 50, this._start = 25, this._end = 75, this._isDragging = !1, this._dragThumb = null, this._pointerDownListener = null, this._pointerMoveListener = null, this._pointerUpListener = null, this._thumbKeyListener = null, this._trackClickListener = null;
|
|
3226
3287
|
}
|
|
3227
3288
|
connectedCallback() {
|
|
3228
|
-
this._rendered
|
|
3289
|
+
if (!this._rendered) {
|
|
3290
|
+
this.render();
|
|
3291
|
+
return;
|
|
3292
|
+
}
|
|
3293
|
+
this._wire();
|
|
3294
|
+
}
|
|
3295
|
+
get value() {
|
|
3296
|
+
return this._value;
|
|
3297
|
+
}
|
|
3298
|
+
set value(e) {
|
|
3299
|
+
this._value = this._snapToStep(this._clamp(X(e, this._value))), this._syncValue(), this._syncMirrors();
|
|
3300
|
+
}
|
|
3301
|
+
get start() {
|
|
3302
|
+
return this._start;
|
|
3303
|
+
}
|
|
3304
|
+
set start(e) {
|
|
3305
|
+
this._start = Math.min(this._snapToStep(this._clamp(X(e, this._start))), this._end), this._syncValue(), this._syncMirrors();
|
|
3306
|
+
}
|
|
3307
|
+
get end() {
|
|
3308
|
+
return this._end;
|
|
3309
|
+
}
|
|
3310
|
+
set end(e) {
|
|
3311
|
+
this._end = Math.max(this._snapToStep(this._clamp(X(e, this._end))), this._start), this._syncValue(), this._syncMirrors();
|
|
3229
3312
|
}
|
|
3230
3313
|
attributeChangedCallback(e, t, n) {
|
|
3231
3314
|
if (e === "value" || e === "start" || e === "end" || e === "min" || e === "max" || e === "step") {
|
|
@@ -3238,27 +3321,28 @@ var qe = class extends HTMLElement {
|
|
|
3238
3321
|
this._isRange() ? this._resetRange() : this._resetSingle();
|
|
3239
3322
|
}
|
|
3240
3323
|
_updateFromAttribute(e) {
|
|
3241
|
-
|
|
3242
|
-
e === "value" ? this._value = this._snapToStep(this._clamp(t(this.getAttribute("value")))) : e === "start" ? this._start = this._snapToStep(this._clamp(t(this.getAttribute("start")))) : e === "end" && (this._end = this._snapToStep(this._clamp(t(this.getAttribute("end")))));
|
|
3324
|
+
e === "value" ? this._value = this._snapToStep(this._clamp(X(this.getAttribute("value"), this._value))) : e === "start" ? this._start = this._snapToStep(this._clamp(X(this.getAttribute("start"), this._start))) : e === "end" && (this._end = this._snapToStep(this._clamp(X(this.getAttribute("end"), this._end))));
|
|
3243
3325
|
}
|
|
3244
3326
|
_isRange() {
|
|
3245
3327
|
return this.hasAttribute("range");
|
|
3246
3328
|
}
|
|
3247
3329
|
_min() {
|
|
3248
|
-
return
|
|
3330
|
+
return X(this.getAttribute("min"), 0);
|
|
3249
3331
|
}
|
|
3250
3332
|
_max() {
|
|
3251
|
-
return
|
|
3333
|
+
return X(this.getAttribute("max"), 100);
|
|
3252
3334
|
}
|
|
3253
3335
|
_step() {
|
|
3254
|
-
return
|
|
3336
|
+
return X(this.getAttribute("step"), 1);
|
|
3255
3337
|
}
|
|
3256
3338
|
_clamp(e) {
|
|
3257
3339
|
return Math.max(this._min(), Math.min(e, this._max()));
|
|
3258
3340
|
}
|
|
3259
3341
|
_snapToStep(e) {
|
|
3260
3342
|
let t = this._step();
|
|
3261
|
-
|
|
3343
|
+
if (t <= 0) return e;
|
|
3344
|
+
let n = this._min();
|
|
3345
|
+
return this._clamp(n + Math.round((e - n) / t) * t);
|
|
3262
3346
|
}
|
|
3263
3347
|
_captureDefaults() {
|
|
3264
3348
|
this._defaultsCaptured ||= (this._isRange() ? (this._defaultStart = this._start, this._defaultEnd = this._end) : this._defaultValue = this._value, !0);
|
|
@@ -3273,7 +3357,7 @@ var qe = class extends HTMLElement {
|
|
|
3273
3357
|
this._captureDefaults();
|
|
3274
3358
|
let e = this._min(), t = this._max(), n = this._isRange(), r = this.getAttribute("size"), i = r === "sm" ? " slider-sm" : r === "lg" ? " slider-lg" : "", a = this.hasAttribute("disabled");
|
|
3275
3359
|
n ? (this._start = this._clamp(this._start), this._end = this._clamp(this._end), this._start > this._end && ([this._start, this._end] = [this._end, this._start])) : this._value = this._clamp(this._value);
|
|
3276
|
-
let o = (n) => (n - e) / (t - e) * 100, s = n ? o(this._start) : 0, c = o(n ? this._end : this._value);
|
|
3360
|
+
let o = (n) => t === e ? 0 : (n - e) / (t - e) * 100, s = n ? o(this._start) : 0, c = o(n ? this._end : this._value);
|
|
3277
3361
|
this.innerHTML = `
|
|
3278
3362
|
<div class="slider${i}">
|
|
3279
3363
|
<div class="slider-track" role="presentation"></div>
|
|
@@ -3314,7 +3398,7 @@ var qe = class extends HTMLElement {
|
|
|
3314
3398
|
aria-valuenow="${this._value}"
|
|
3315
3399
|
aria-valuetext="${this._formatValue(this._value)}"
|
|
3316
3400
|
${a ? "disabled" : ""}
|
|
3317
|
-
aria-label="${
|
|
3401
|
+
aria-label="${$e(this.getAttribute("aria-label") || "Value")}"
|
|
3318
3402
|
></button>
|
|
3319
3403
|
`}
|
|
3320
3404
|
${this.hasAttribute("show-value") ? n ? `<span class="slider-value">${this._formatValue(this._start)} – ${this._formatValue(this._end)}</span>` : `<span class="slider-value">${this._formatValue(this._value)}</span>` : ""}
|
|
@@ -3326,7 +3410,7 @@ var qe = class extends HTMLElement {
|
|
|
3326
3410
|
}
|
|
3327
3411
|
_syncValue() {
|
|
3328
3412
|
if (!this._rendered) return;
|
|
3329
|
-
let e = this._min(), t = this._max(), n = (n) => (n - e) / (t - e) * 100, r = this.querySelector(".slider-fill");
|
|
3413
|
+
let e = this._min(), t = this._max(), n = (n) => t === e ? 0 : (n - e) / (t - e) * 100, r = this.querySelector(".slider-fill");
|
|
3330
3414
|
if (this._isRange()) {
|
|
3331
3415
|
let e = n(this._start), t = n(this._end);
|
|
3332
3416
|
r && (r.style.left = `${e}%`, r.style.right = `${100 - t}%`);
|
|
@@ -3347,7 +3431,7 @@ var qe = class extends HTMLElement {
|
|
|
3347
3431
|
this._isRange() ? this._syncRangeMirrors() : this._syncSingleMirror();
|
|
3348
3432
|
}
|
|
3349
3433
|
_syncSingleMirror() {
|
|
3350
|
-
this.getAttribute("name") &&
|
|
3434
|
+
this.getAttribute("name") && G(this, String(this._value));
|
|
3351
3435
|
}
|
|
3352
3436
|
_syncRangeMirrors() {
|
|
3353
3437
|
let e = this.getAttribute("start-name") || this.getAttribute("name"), t = this.getAttribute("end-name");
|
|
@@ -3361,8 +3445,8 @@ var qe = class extends HTMLElement {
|
|
|
3361
3445
|
_valueAtPosition(e) {
|
|
3362
3446
|
let t = this.querySelector(".slider-track");
|
|
3363
3447
|
if (!t) return this._min();
|
|
3364
|
-
let n = t.getBoundingClientRect(), r = Math.max(0, Math.min(1, (e - n.left) / n.width)), i = this._min() + r * (this._max() - this._min())
|
|
3365
|
-
return
|
|
3448
|
+
let n = t.getBoundingClientRect(), r = Math.max(0, Math.min(1, (e - n.left) / n.width)), i = this._min() + r * (this._max() - this._min());
|
|
3449
|
+
return this._snapToStep(i);
|
|
3366
3450
|
}
|
|
3367
3451
|
_nearestThumb(e) {
|
|
3368
3452
|
return Math.abs(e - this._start) <= Math.abs(e - this._end) ? "start" : "end";
|
|
@@ -3394,29 +3478,30 @@ var qe = class extends HTMLElement {
|
|
|
3394
3478
|
}
|
|
3395
3479
|
}, this._pointerUpListener = () => {
|
|
3396
3480
|
this._isDragging && (this._isDragging = !1, this._dragThumb = null, document.removeEventListener("pointermove", this._pointerMoveListener), document.removeEventListener("pointerup", this._pointerUpListener), this._syncMirrors(), this.dispatchEvent(new Event("change", { bubbles: !0 })));
|
|
3397
|
-
},
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
}), t && t.addEventListener("click", (e) => {
|
|
3481
|
+
}, this._thumbKeyListener = (e) => {
|
|
3482
|
+
let t = e.currentTarget;
|
|
3483
|
+
if (this.hasAttribute("disabled")) return;
|
|
3484
|
+
let n = this._step(), r = n * 10, i = null, a = t.getAttribute("data-thumb"), o = a === "end" ? this._end : a === "start" ? this._start : this._value;
|
|
3485
|
+
e.key === "ArrowLeft" || e.key === "ArrowDown" ? (e.preventDefault(), i = o - n) : e.key === "ArrowRight" || e.key === "ArrowUp" ? (e.preventDefault(), i = o + n) : e.key === "PageDown" ? (e.preventDefault(), i = o - r) : e.key === "PageUp" ? (e.preventDefault(), i = o + r) : e.key === "Home" ? (e.preventDefault(), i = this._min()) : e.key === "End" && (e.preventDefault(), i = this._max()), i != null && (i = this._clamp(i), a === "single" ? this._value = i : a === "start" ? this._start = Math.min(i, this._end) : a === "end" && (this._end = Math.max(i, this._start)), this._syncValue(), this._syncMirrors(), this.dispatchEvent(new Event("change", { bubbles: !0 })));
|
|
3486
|
+
}, this._trackClickListener = (e) => {
|
|
3404
3487
|
if (this.hasAttribute("disabled")) return;
|
|
3405
3488
|
let t = this._valueAtPosition(e.clientX);
|
|
3406
|
-
n ? this._nearestThumb(t) === "start" ? this._start = Math.min(t, this._end) : this._end = Math.max(t, this._start) : this._value = this._clamp(t), this._syncValue(), this._syncMirrors(), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
3407
|
-
})
|
|
3489
|
+
n ? this._nearestThumb(t) === "start" ? this._start = Math.min(this._clamp(t), this._end) : this._end = Math.max(this._clamp(t), this._start) : this._value = this._clamp(t), this._syncValue(), this._syncMirrors(), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
3490
|
+
}, e.forEach((e) => {
|
|
3491
|
+
e.addEventListener("pointerdown", this._pointerDownListener), e.addEventListener("keydown", this._thumbKeyListener);
|
|
3492
|
+
}), t?.addEventListener("click", this._trackClickListener);
|
|
3408
3493
|
}
|
|
3409
3494
|
_teardown() {
|
|
3410
|
-
this.querySelectorAll(".slider-thumb").
|
|
3411
|
-
|
|
3412
|
-
}), document.removeEventListener("pointermove", this._pointerMoveListener), document.removeEventListener("pointerup", this._pointerUpListener);
|
|
3413
|
-
let e = this.querySelector(".slider-track");
|
|
3414
|
-
e && e.removeEventListener("click", this._pointerUpListener);
|
|
3495
|
+
for (let e of this.querySelectorAll(".slider-thumb")) e.removeEventListener("pointerdown", this._pointerDownListener), e.removeEventListener("keydown", this._thumbKeyListener);
|
|
3496
|
+
document.removeEventListener("pointermove", this._pointerMoveListener), document.removeEventListener("pointerup", this._pointerUpListener), this._isDragging = !1, this._dragThumb = null, this.querySelector(".slider-track")?.removeEventListener("click", this._trackClickListener);
|
|
3415
3497
|
}
|
|
3416
3498
|
disconnectedCallback() {
|
|
3417
3499
|
this._teardown();
|
|
3418
3500
|
}
|
|
3419
|
-
},
|
|
3501
|
+
}, X = (e, t) => {
|
|
3502
|
+
let n = Number.parseFloat(e);
|
|
3503
|
+
return Number.isFinite(n) ? n : t;
|
|
3504
|
+
}, $e = (e) => String(e ?? "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<"), et = class extends HTMLElement {
|
|
3420
3505
|
static formAssociated = !0;
|
|
3421
3506
|
_accessibleName() {
|
|
3422
3507
|
return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Add tags";
|
|
@@ -3427,7 +3512,9 @@ var qe = class extends HTMLElement {
|
|
|
3427
3512
|
"disabled",
|
|
3428
3513
|
"size",
|
|
3429
3514
|
"max-tags",
|
|
3430
|
-
"aria-label"
|
|
3515
|
+
"aria-label",
|
|
3516
|
+
"separators",
|
|
3517
|
+
"allow-duplicates"
|
|
3431
3518
|
];
|
|
3432
3519
|
}
|
|
3433
3520
|
constructor() {
|
|
@@ -3441,35 +3528,47 @@ var qe = class extends HTMLElement {
|
|
|
3441
3528
|
connectedCallback() {
|
|
3442
3529
|
if (!this._rendered) {
|
|
3443
3530
|
if (!this._valuesInit && !this._values.length) {
|
|
3444
|
-
let e =
|
|
3445
|
-
e
|
|
3531
|
+
let e = this.getAttribute("value");
|
|
3532
|
+
if (e != null && e !== "") this._values = e.split(",").map((e) => e.trim()).filter(Boolean);
|
|
3533
|
+
else {
|
|
3534
|
+
let e = [...this.querySelectorAll(":scope > wui-tag")].map((e) => e.textContent.trim());
|
|
3535
|
+
e.length && (this._values = e.map(String));
|
|
3536
|
+
}
|
|
3446
3537
|
}
|
|
3447
3538
|
this._valuesInit = !0, this._defaultCaptured ||= (this._defaultValues = this._values.slice(), !0), this.render();
|
|
3539
|
+
return;
|
|
3448
3540
|
}
|
|
3541
|
+
this._wire();
|
|
3449
3542
|
}
|
|
3450
3543
|
formResetCallback() {
|
|
3451
3544
|
this.values = (this._defaultValues || []).slice(), this._draftText = "";
|
|
3452
3545
|
let e = this.querySelector("[data-input]");
|
|
3453
3546
|
e && (e.value = "");
|
|
3454
3547
|
}
|
|
3455
|
-
attributeChangedCallback() {
|
|
3456
|
-
this._rendered
|
|
3548
|
+
attributeChangedCallback(e) {
|
|
3549
|
+
if (this._rendered) {
|
|
3550
|
+
if (e === "separators" || e === "allow-duplicates") {
|
|
3551
|
+
this._wire();
|
|
3552
|
+
return;
|
|
3553
|
+
}
|
|
3554
|
+
this.render();
|
|
3555
|
+
}
|
|
3457
3556
|
}
|
|
3458
3557
|
get values() {
|
|
3459
3558
|
return this._values.slice();
|
|
3460
3559
|
}
|
|
3461
3560
|
set values(e) {
|
|
3462
|
-
this._values = Array.isArray(e) ? e.map(String) : [],
|
|
3561
|
+
this._values = Array.isArray(e) ? e.map(String) : [], G(this, this._values.join(",")), this._rendered && this._renderControl();
|
|
3463
3562
|
}
|
|
3464
3563
|
render() {
|
|
3465
3564
|
let e = this.getAttribute("size"), t = e === "sm" ? " search-select-sm" : e === "lg" ? " search-select-lg" : "";
|
|
3466
|
-
|
|
3565
|
+
G(this, this._values.join(",")), this.innerHTML = `
|
|
3467
3566
|
<div class="search-select${t}">
|
|
3468
3567
|
<div class="input search-select-control search-select-multi"${this.hasAttribute("disabled") ? " aria-disabled=\"true\"" : ""}>
|
|
3469
3568
|
<div class="ms-chips" data-chips></div>
|
|
3470
|
-
<input type="text" class="ms-input" data-input aria-label="${
|
|
3569
|
+
<input type="text" class="ms-input" data-input aria-label="${nt(this._accessibleName())}" placeholder="${nt(this.getAttribute("placeholder") || "Add…")}" autocomplete="off"${this.hasAttribute("disabled") ? " disabled" : ""}/>
|
|
3471
3570
|
</div>
|
|
3472
|
-
</div>`, this._rendered = !0,
|
|
3571
|
+
</div>`, this._rendered = !0, G(this, this._values.join(",")), this._renderControl(), this._wire();
|
|
3473
3572
|
}
|
|
3474
3573
|
_renderControl() {
|
|
3475
3574
|
let e = this.querySelector("[data-chips]");
|
|
@@ -3478,7 +3577,7 @@ var qe = class extends HTMLElement {
|
|
|
3478
3577
|
e.innerHTML = "";
|
|
3479
3578
|
return;
|
|
3480
3579
|
}
|
|
3481
|
-
e.innerHTML = this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${
|
|
3580
|
+
e.innerHTML = this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${tt(e)}</span><button type="button" class="chip-remove" data-remove="${nt(e)}" aria-label="Remove ${nt(e)}"><i class="bi bi-x" aria-hidden="true"></i></button></span>`).join("");
|
|
3482
3581
|
}
|
|
3483
3582
|
}
|
|
3484
3583
|
_wire() {
|
|
@@ -3488,7 +3587,7 @@ var qe = class extends HTMLElement {
|
|
|
3488
3587
|
let n = () => this.hasAttribute("disabled"), r = (this.getAttribute("separators") || "enter,comma").split(",").map((e) => e.trim()), i = this.getAttribute("max-tags"), a = this.hasAttribute("allow-duplicates"), o = /* @__PURE__ */ new Set();
|
|
3489
3588
|
for (let e of r) e === "enter" ? o.add("Enter") : e === "comma" ? o.add(",") : e === "space" ? o.add(" ") : e === "tab" && o.add("Tab");
|
|
3490
3589
|
let s = () => {
|
|
3491
|
-
|
|
3590
|
+
G(this, this._values.join(",")), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
3492
3591
|
}, c = (e) => {
|
|
3493
3592
|
let t = e.trim();
|
|
3494
3593
|
if (!t || i && this._values.length >= parseInt(i, 10)) return;
|
|
@@ -3496,16 +3595,7 @@ var qe = class extends HTMLElement {
|
|
|
3496
3595
|
(!this._values.some((e) => a ? e === t : e.toLowerCase() === n) || a) && (this._values.push(t), this._renderControl(), s());
|
|
3497
3596
|
}, l = (e) => {
|
|
3498
3597
|
this._values = this._values.filter((t) => t !== e), this._renderControl(), s();
|
|
3499
|
-
}
|
|
3500
|
-
e.addEventListener("click", (e) => {
|
|
3501
|
-
if (n()) return;
|
|
3502
|
-
let r = e.target.closest("[data-remove]");
|
|
3503
|
-
if (r) {
|
|
3504
|
-
e.stopPropagation(), l(r.dataset.remove), t.focus();
|
|
3505
|
-
return;
|
|
3506
|
-
}
|
|
3507
|
-
t.focus();
|
|
3508
|
-
}), t.addEventListener("keydown", (e) => {
|
|
3598
|
+
}, u = (e) => {
|
|
3509
3599
|
if (e.key === "Enter" && o.has("Enter")) {
|
|
3510
3600
|
e.preventDefault(), c(t.value), t.value = "";
|
|
3511
3601
|
return;
|
|
@@ -3524,7 +3614,7 @@ var qe = class extends HTMLElement {
|
|
|
3524
3614
|
return;
|
|
3525
3615
|
}
|
|
3526
3616
|
e.key === "Backspace" && !t.value && this._values.length && (e.preventDefault(), l(this._values[this._values.length - 1])), e.key === "Escape" && (t.value = "");
|
|
3527
|
-
}
|
|
3617
|
+
}, d = (e) => {
|
|
3528
3618
|
e.preventDefault();
|
|
3529
3619
|
let n = e.clipboardData.getData("text/plain"), a = [];
|
|
3530
3620
|
for (let e of r) {
|
|
@@ -3537,33 +3627,39 @@ var qe = class extends HTMLElement {
|
|
|
3537
3627
|
a.length || a.push(n.trim());
|
|
3538
3628
|
for (let e of a) if (c(e), i && this._values.length >= parseInt(i, 10)) break;
|
|
3539
3629
|
t.value = "";
|
|
3540
|
-
}
|
|
3630
|
+
};
|
|
3631
|
+
this._onControlClick = (e) => {
|
|
3632
|
+
if (n()) return;
|
|
3633
|
+
let r = e.target.closest("[data-remove]");
|
|
3634
|
+
if (r) {
|
|
3635
|
+
e.stopPropagation(), l(r.dataset.remove), t.focus();
|
|
3636
|
+
return;
|
|
3637
|
+
}
|
|
3638
|
+
t.focus();
|
|
3639
|
+
}, this._onInputKey = u, this._onInputPaste = d, e.addEventListener("click", this._onControlClick), t.addEventListener("keydown", this._onInputKey), t.addEventListener("paste", this._onInputPaste), this._onDocClick = (e) => {
|
|
3541
3640
|
this.contains(e.target) || t.blur();
|
|
3542
3641
|
}, document.addEventListener("click", this._onDocClick);
|
|
3543
3642
|
}
|
|
3544
3643
|
_teardown() {
|
|
3545
|
-
this._onDocClick
|
|
3546
|
-
let e = this.querySelector("[data-input]");
|
|
3547
|
-
|
|
3548
|
-
let t = e, n = t.cloneNode(!1);
|
|
3549
|
-
t.replaceWith(n);
|
|
3550
|
-
}
|
|
3644
|
+
this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null);
|
|
3645
|
+
let e = this.querySelector(".search-select-control"), t = this.querySelector("[data-input]");
|
|
3646
|
+
e && this._onControlClick && e.removeEventListener("click", this._onControlClick), t && this._onInputKey && (t.removeEventListener("keydown", this._onInputKey), t.removeEventListener("paste", this._onInputPaste));
|
|
3551
3647
|
}
|
|
3552
3648
|
disconnectedCallback() {
|
|
3553
3649
|
this._teardown();
|
|
3554
3650
|
}
|
|
3555
|
-
},
|
|
3651
|
+
}, tt = (e) => String(e ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), nt = (e) => String(e ?? "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<"), rt = (e) => String(e).padStart(2, "0"), it = (e, t) => `${rt(e)}:${rt(t)}`, at = (e) => {
|
|
3556
3652
|
let t = /^(\d{2}):(\d{2})$/.exec(e || "");
|
|
3557
3653
|
return t ? {
|
|
3558
3654
|
h: +t[1],
|
|
3559
3655
|
m: +t[2]
|
|
3560
3656
|
} : null;
|
|
3561
|
-
},
|
|
3657
|
+
}, ot = (e, t = "24") => {
|
|
3562
3658
|
if (!e) return "";
|
|
3563
|
-
if (t === "24") return
|
|
3659
|
+
if (t === "24") return it(e.h, e.m);
|
|
3564
3660
|
let n = e.h % 12 || 12, r = e.h >= 12 ? "PM" : "AM";
|
|
3565
|
-
return `${n}:${
|
|
3566
|
-
},
|
|
3661
|
+
return `${n}:${rt(e.m)} ${r}`;
|
|
3662
|
+
}, st = class extends HTMLElement {
|
|
3567
3663
|
static formAssociated = !0;
|
|
3568
3664
|
static get observedAttributes() {
|
|
3569
3665
|
return [
|
|
@@ -3590,7 +3686,11 @@ var qe = class extends HTMLElement {
|
|
|
3590
3686
|
this._value = "", this._focus = null;
|
|
3591
3687
|
}
|
|
3592
3688
|
connectedCallback() {
|
|
3593
|
-
this._rendered
|
|
3689
|
+
if (!this._rendered) {
|
|
3690
|
+
this.render();
|
|
3691
|
+
return;
|
|
3692
|
+
}
|
|
3693
|
+
this._bindGlobal?.();
|
|
3594
3694
|
}
|
|
3595
3695
|
attributeChangedCallback(e, t, n) {
|
|
3596
3696
|
this._rendered && (e === "value" ? (this._value = n || "", this._syncFormValue(), this._syncTrigger()) : this.render());
|
|
@@ -3602,34 +3702,34 @@ var qe = class extends HTMLElement {
|
|
|
3602
3702
|
return this._value;
|
|
3603
3703
|
}
|
|
3604
3704
|
set value(e) {
|
|
3605
|
-
this._value = e || "",
|
|
3705
|
+
this._value = e || "", G(this, this._value), this._syncTrigger();
|
|
3606
3706
|
}
|
|
3607
3707
|
render() {
|
|
3608
|
-
this._defaultValue === void 0 && (this._defaultValue = this.getAttribute("value") || ""
|
|
3609
|
-
let e = this.getAttribute("placeholder") || "Select time", t =
|
|
3708
|
+
this._defaultValue === void 0 && (this._defaultValue = this.getAttribute("value") || "", this._value = this._defaultValue || this._value);
|
|
3709
|
+
let e = this.getAttribute("placeholder") || "Select time", t = at(this._value), n = this.getAttribute("format") || "24", r = this.getAttribute("size"), i = r === "sm" ? " input-sm" : r === "lg" ? " input-lg" : "", a = this.getAttribute("aria-label"), o = this.getAttribute("aria-describedby");
|
|
3610
3710
|
this.innerHTML = `
|
|
3611
3711
|
<div class="timepicker">
|
|
3612
|
-
<button type="button" class="input timepicker-trigger${i}${t ? " has-value" : ""}" aria-haspopup="listbox" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}${a ? ` aria-label="${
|
|
3613
|
-
<span data-trigger-label class="${t ? "" : "timepicker-placeholder"}">${t ?
|
|
3712
|
+
<button type="button" class="input timepicker-trigger${i}${t ? " has-value" : ""}" aria-haspopup="listbox" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}${a ? ` aria-label="${K(a)}"` : ""}${o ? ` aria-describedby="${K(o)}"` : ""}>
|
|
3713
|
+
<span data-trigger-label class="${t ? "" : "timepicker-placeholder"}">${t ? ot(t, n) : K(e)}</span>
|
|
3614
3714
|
<i class="bi bi-clock" aria-hidden="true"></i>
|
|
3615
3715
|
</button>
|
|
3616
3716
|
<div class="timepicker-pop" role="listbox" tabindex="-1" hidden></div>
|
|
3617
|
-
</div>`, this._rendered = !0,
|
|
3717
|
+
</div>`, this._rendered = !0, G(this, this._value), this._wire();
|
|
3618
3718
|
}
|
|
3619
3719
|
_syncFormValue() {
|
|
3620
|
-
|
|
3720
|
+
G(this, this._value);
|
|
3621
3721
|
}
|
|
3622
3722
|
_syncTrigger() {
|
|
3623
3723
|
let e = this.querySelector(".timepicker-trigger"), t = this.querySelector("[data-trigger-label]");
|
|
3624
3724
|
if (!t) return;
|
|
3625
|
-
let n =
|
|
3626
|
-
t.textContent = n ?
|
|
3725
|
+
let n = at(this._value), r = this.getAttribute("format") || "24";
|
|
3726
|
+
t.textContent = n ? ot(n, r) : this.getAttribute("placeholder") || "Select time", t.classList.toggle("timepicker-placeholder", !n), e?.classList.toggle("has-value", !!n);
|
|
3627
3727
|
}
|
|
3628
3728
|
_buildTimes() {
|
|
3629
|
-
let e = Math.max(1, parseInt(this.getAttribute("step") || "30", 10)), t = this.getAttribute("min") || "00:00", n = this.getAttribute("max") || "23:59", r =
|
|
3729
|
+
let e = Math.max(1, parseInt(this.getAttribute("step") || "30", 10)), t = this.getAttribute("min") || "00:00", n = this.getAttribute("max") || "23:59", r = at(t) || {
|
|
3630
3730
|
h: 0,
|
|
3631
3731
|
m: 0
|
|
3632
|
-
}, i =
|
|
3732
|
+
}, i = at(n) || {
|
|
3633
3733
|
h: 23,
|
|
3634
3734
|
m: 59
|
|
3635
3735
|
}, a = [], o = r.h, s = r.m;
|
|
@@ -3642,10 +3742,10 @@ var qe = class extends HTMLElement {
|
|
|
3642
3742
|
_renderOptions() {
|
|
3643
3743
|
let e = this.querySelector(".timepicker-pop");
|
|
3644
3744
|
if (!e) return;
|
|
3645
|
-
let t = this.getAttribute("format") || "24", n = this._buildTimes(), r =
|
|
3745
|
+
let t = this.getAttribute("format") || "24", n = this._buildTimes(), r = at(this._value), i = this._focus, a = "";
|
|
3646
3746
|
for (let e = 0; e < n.length; e++) {
|
|
3647
|
-
let o = n[e], s =
|
|
3648
|
-
a += `<button type="button" class="timepicker-option${c ? " is-selected" : ""}" data-hm="${s}" role="option" tabindex="${i === e ? "0" : "-1"}"${c ? " aria-selected=\"true\"" : ""}>${
|
|
3747
|
+
let o = n[e], s = it(o.h, o.m), c = r && r.h === o.h && r.m === o.m;
|
|
3748
|
+
a += `<button type="button" class="timepicker-option${c ? " is-selected" : ""}" data-hm="${s}" role="option" tabindex="${i === e ? "0" : "-1"}"${c ? " aria-selected=\"true\"" : ""}>${ot(o, t)}</button>`;
|
|
3649
3749
|
}
|
|
3650
3750
|
e.innerHTML = a, this._focusActive();
|
|
3651
3751
|
}
|
|
@@ -3654,7 +3754,7 @@ var qe = class extends HTMLElement {
|
|
|
3654
3754
|
t && !e.hidden && t.focus();
|
|
3655
3755
|
}
|
|
3656
3756
|
_position(e, t) {
|
|
3657
|
-
|
|
3757
|
+
se(e, t);
|
|
3658
3758
|
}
|
|
3659
3759
|
_onKey(e) {
|
|
3660
3760
|
let t = [...this.querySelector(".timepicker-pop").querySelectorAll(".timepicker-option")];
|
|
@@ -3700,29 +3800,31 @@ var qe = class extends HTMLElement {
|
|
|
3700
3800
|
t && !t.disabled && (this.value = t.dataset.hm, this.dispatchEvent(new Event("change", { bubbles: !0 })), this._close());
|
|
3701
3801
|
}), this._onKeyBound = (e) => {
|
|
3702
3802
|
n() && this._onKey(e);
|
|
3703
|
-
}, t.addEventListener("keydown", this._onKeyBound), this.
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3803
|
+
}, t.addEventListener("keydown", this._onKeyBound), this._bindGlobal = () => {
|
|
3804
|
+
this._teardown(), this._onDocClick = (e) => {
|
|
3805
|
+
let t = this._popClick;
|
|
3806
|
+
this._popClick = !1, n() && !t && !this.contains(e.target) && this._close();
|
|
3807
|
+
}, document.addEventListener("click", this._onDocClick), this._onDocKey = (e) => {
|
|
3808
|
+
n() && e.key === "Escape" && this._close();
|
|
3809
|
+
}, document.addEventListener("keydown", this._onDocKey), ce(this, () => {
|
|
3810
|
+
n() && this._position(e, t);
|
|
3811
|
+
});
|
|
3812
|
+
}, this._bindGlobal(), this._syncFormValue();
|
|
3711
3813
|
}
|
|
3712
3814
|
_teardown() {
|
|
3713
|
-
this._onDocClick
|
|
3815
|
+
this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null), this._onDocKey &&= (document.removeEventListener("keydown", this._onDocKey), null), W(this);
|
|
3714
3816
|
}
|
|
3715
3817
|
disconnectedCallback() {
|
|
3716
3818
|
this._teardown();
|
|
3717
3819
|
}
|
|
3718
|
-
},
|
|
3820
|
+
}, ct = "image/png,image/jpeg,image/webp", lt = {
|
|
3719
3821
|
"image/png": [".png"],
|
|
3720
3822
|
"image/jpeg": [".jpg", ".jpeg"],
|
|
3721
3823
|
"image/webp": [".webp"],
|
|
3722
3824
|
"image/gif": [".gif"],
|
|
3723
3825
|
"image/svg+xml": [".svg"],
|
|
3724
3826
|
"application/pdf": [".pdf"]
|
|
3725
|
-
},
|
|
3827
|
+
}, ut = {
|
|
3726
3828
|
"image/png": "PNG",
|
|
3727
3829
|
"image/jpeg": "JPG",
|
|
3728
3830
|
"image/webp": "WEBP",
|
|
@@ -3736,7 +3838,7 @@ var qe = class extends HTMLElement {
|
|
|
3736
3838
|
".gif": "GIF",
|
|
3737
3839
|
".svg": "SVG",
|
|
3738
3840
|
".pdf": "PDF"
|
|
3739
|
-
},
|
|
3841
|
+
}, dt = (e) => String(e || "").split(",").map((e) => e.trim().toLowerCase()).filter(Boolean), ft = [
|
|
3740
3842
|
".png",
|
|
3741
3843
|
".jpg",
|
|
3742
3844
|
".jpeg",
|
|
@@ -3747,46 +3849,46 @@ var qe = class extends HTMLElement {
|
|
|
3747
3849
|
".avif",
|
|
3748
3850
|
".heic"
|
|
3749
3851
|
];
|
|
3750
|
-
function
|
|
3852
|
+
function pt(e) {
|
|
3751
3853
|
if (!e) return !1;
|
|
3752
3854
|
let t = typeof e == "object" && e.type ? String(e.type).toLowerCase() : "";
|
|
3753
3855
|
if (t) return t.startsWith("image/");
|
|
3754
3856
|
let n = typeof e == "string" ? e : e.name || e.url || "", r = String(n).toLowerCase();
|
|
3755
|
-
return
|
|
3756
|
-
}
|
|
3757
|
-
function pt(e) {
|
|
3758
|
-
let t = ut(e);
|
|
3759
|
-
return t.length ? t.every((e) => e.startsWith(".") ? dt.includes(e) : e === "image/*" || e.startsWith("image/")) : !1;
|
|
3857
|
+
return ft.some((e) => r.endsWith(e));
|
|
3760
3858
|
}
|
|
3761
3859
|
function mt(e) {
|
|
3860
|
+
let t = dt(e);
|
|
3861
|
+
return t.length ? t.every((e) => e.startsWith(".") ? ft.includes(e) : e === "image/*" || e.startsWith("image/")) : !1;
|
|
3862
|
+
}
|
|
3863
|
+
function ht(e) {
|
|
3762
3864
|
let t = [];
|
|
3763
|
-
for (let n of
|
|
3764
|
-
let e =
|
|
3865
|
+
for (let n of dt(e)) {
|
|
3866
|
+
let e = ut[n] || (n.startsWith(".") ? n.slice(1).toUpperCase() : n.toUpperCase());
|
|
3765
3867
|
t.includes(e) || t.push(e);
|
|
3766
3868
|
}
|
|
3767
3869
|
return t.length <= 1 ? t[0] || "supported" : `${t.slice(0, -1).join(", ")} or ${t[t.length - 1]}`;
|
|
3768
3870
|
}
|
|
3769
|
-
function
|
|
3770
|
-
let n =
|
|
3871
|
+
function gt(e, t) {
|
|
3872
|
+
let n = dt(t);
|
|
3771
3873
|
if (!n.length) return !0;
|
|
3772
3874
|
let r = (e.type || "").toLowerCase(), i = (e.name || "").toLowerCase();
|
|
3773
|
-
return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (
|
|
3875
|
+
return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (lt[e] || []).some((e) => i.endsWith(e)));
|
|
3774
3876
|
}
|
|
3775
|
-
function
|
|
3877
|
+
function _t(e, t = {}) {
|
|
3776
3878
|
if (!e) return null;
|
|
3777
|
-
let n = t.accept === void 0 ?
|
|
3778
|
-
return
|
|
3879
|
+
let n = t.accept === void 0 ? ct : t.accept, r = t.maxSizeMb || 5;
|
|
3880
|
+
return gt(e, n) ? e.size > r * 1024 * 1024 ? `Keep the file under ${r} MB.` : null : `Choose a ${ht(n)} file.`;
|
|
3779
3881
|
}
|
|
3780
3882
|
var Z = (e, t) => {
|
|
3781
3883
|
typeof customElements < "u" && !customElements.get(e) && customElements.define(e, t);
|
|
3782
3884
|
};
|
|
3783
|
-
function
|
|
3784
|
-
Z("wui-select",
|
|
3885
|
+
function vt() {
|
|
3886
|
+
Z("wui-select", Xe), Z("wui-phone", Je), Z("wui-datepicker", Ce), Z("wui-date-range", Me), Z("wui-slider", Qe), Z("wui-timepicker", st), Z("wui-autocomplete", pe), Z("wui-multiselect", Ne), Z("wui-taginput", et), Z("wui-otp", Le), Z("wui-status-icon", oe);
|
|
3785
3887
|
}
|
|
3786
|
-
|
|
3888
|
+
vt();
|
|
3787
3889
|
//#endregion
|
|
3788
3890
|
//#region src/components/AppInfoTip.jsx
|
|
3789
|
-
function
|
|
3891
|
+
function yt({ label: e, children: t, placement: n = "auto", ...r }) {
|
|
3790
3892
|
M("AppInfoTip", r);
|
|
3791
3893
|
let i = o(), [a, s] = u(!1), c = !!e, l = !!t;
|
|
3792
3894
|
return !c && !l ? null : /* @__PURE__ */ f("span", {
|
|
@@ -3826,7 +3928,7 @@ function Q() {
|
|
|
3826
3928
|
}
|
|
3827
3929
|
//#endregion
|
|
3828
3930
|
//#region src/components/AppAutocomplete.jsx
|
|
3829
|
-
var
|
|
3931
|
+
var bt = r(function({ value: e, onChange: t, options: n, loadOptions: r, placeholder: i = "Search…", minChars: s, debounce: c, disabled: u = !1, size: d, allowCustom: m = !1, name: h, label: g, error: _, hint: v, required: y = !1, help: b, helpLabel: x = "More information", fieldClassName: S = "", ...C }, w) {
|
|
3830
3932
|
M("AppAutocomplete", C);
|
|
3831
3933
|
let T = l(null), E = typeof r == "function", D = o(), O = h || D;
|
|
3832
3934
|
return a(() => {
|
|
@@ -3856,7 +3958,7 @@ var yt = r(function({ value: e, onChange: t, options: n, loadOptions: r, placeho
|
|
|
3856
3958
|
}
|
|
3857
3959
|
};
|
|
3858
3960
|
return e.addEventListener("search", i), () => {
|
|
3859
|
-
t = -1, n?.abort(), e.removeEventListener("search", i);
|
|
3961
|
+
t = -1, n?.abort(), e.removeEventListener("search", i), e.loading = !1;
|
|
3860
3962
|
};
|
|
3861
3963
|
}, [E, r]), /* @__PURE__ */ p("div", {
|
|
3862
3964
|
className: `field${S ? ` ${S}` : ""}`,
|
|
@@ -3867,7 +3969,7 @@ var yt = r(function({ value: e, onChange: t, options: n, loadOptions: r, placeho
|
|
|
3867
3969
|
children: [
|
|
3868
3970
|
g,
|
|
3869
3971
|
y && /* @__PURE__ */ f(Q, {}),
|
|
3870
|
-
b && /* @__PURE__ */ f(
|
|
3972
|
+
b && /* @__PURE__ */ f(yt, {
|
|
3871
3973
|
label: x,
|
|
3872
3974
|
children: b
|
|
3873
3975
|
})
|
|
@@ -3889,7 +3991,8 @@ var yt = r(function({ value: e, onChange: t, options: n, loadOptions: r, placeho
|
|
|
3889
3991
|
size: d || void 0,
|
|
3890
3992
|
"allow-custom": m ? "" : void 0,
|
|
3891
3993
|
disabled: u ? "" : void 0,
|
|
3892
|
-
required: y ? "" : void 0
|
|
3994
|
+
required: y ? "" : void 0,
|
|
3995
|
+
...C
|
|
3893
3996
|
}),
|
|
3894
3997
|
_ ? /* @__PURE__ */ f("div", {
|
|
3895
3998
|
className: "field-error",
|
|
@@ -3902,14 +4005,14 @@ var yt = r(function({ value: e, onChange: t, options: n, loadOptions: r, placeho
|
|
|
3902
4005
|
}) : null
|
|
3903
4006
|
]
|
|
3904
4007
|
});
|
|
3905
|
-
}),
|
|
4008
|
+
}), xt = /* @__PURE__ */ new Set([
|
|
3906
4009
|
"xs",
|
|
3907
4010
|
"sm",
|
|
3908
4011
|
"md",
|
|
3909
4012
|
"lg",
|
|
3910
4013
|
"xl",
|
|
3911
4014
|
"2xl"
|
|
3912
|
-
]),
|
|
4015
|
+
]), St = {
|
|
3913
4016
|
xs: 20,
|
|
3914
4017
|
sm: 24,
|
|
3915
4018
|
md: 32,
|
|
@@ -3917,47 +4020,50 @@ var yt = r(function({ value: e, onChange: t, options: n, loadOptions: r, placeho
|
|
|
3917
4020
|
xl: 64,
|
|
3918
4021
|
"2xl": 96
|
|
3919
4022
|
};
|
|
3920
|
-
function
|
|
4023
|
+
function Ct(e) {
|
|
3921
4024
|
let t = (e || "").trim();
|
|
3922
4025
|
if (!t) return "?";
|
|
3923
4026
|
let n = t.split(/\s+/).filter(Boolean);
|
|
3924
4027
|
return n.length === 1 ? n[0].slice(0, 2).toUpperCase() : (n[0][0] + n[n.length - 1][0]).toUpperCase();
|
|
3925
4028
|
}
|
|
3926
|
-
function
|
|
4029
|
+
function wt(e) {
|
|
3927
4030
|
let t = e || "", n = 0;
|
|
3928
4031
|
for (let e = 0; e < t.length; e += 1) n = Math.imul(n, 31) + t.charCodeAt(e) >>> 0;
|
|
3929
4032
|
return n % 360;
|
|
3930
4033
|
}
|
|
3931
|
-
function
|
|
4034
|
+
function Tt(e) {
|
|
3932
4035
|
if (typeof e == "number") return e;
|
|
3933
|
-
if (
|
|
4036
|
+
if (St[e] != null) return St[e];
|
|
3934
4037
|
let t = Number.parseInt(e, 10);
|
|
3935
4038
|
return Number.isNaN(t) ? 32 : t;
|
|
3936
4039
|
}
|
|
3937
|
-
function
|
|
4040
|
+
function Et({ name: e, src: t, size: n = "md", shape: r = "circle", tone: i = "primary", status: o = "none", ring: s = !1, label: c, icon: l, badge: m, href: h, onClick: g, linkComponent: _, className: v = "", ...y }) {
|
|
3938
4041
|
M("AppAvatar", y);
|
|
3939
|
-
let
|
|
4042
|
+
let { style: b, ...x } = y, [S, C] = u(!1);
|
|
3940
4043
|
a(() => {
|
|
3941
|
-
|
|
4044
|
+
C(!1);
|
|
3942
4045
|
}, [t]);
|
|
3943
|
-
let
|
|
4046
|
+
let w = typeof n == "string" && xt.has(n), T = w ? null : typeof n == "number" || /^\d+$/.test(n) ? `${n}px` : n, E = h != null || g != null, D = t != null && t !== "" && !S, O = [
|
|
3944
4047
|
"avatar",
|
|
3945
|
-
|
|
4048
|
+
w && n !== "md" ? `avatar-${n}` : "",
|
|
3946
4049
|
r === "circle" ? "" : `avatar-${r}`,
|
|
3947
4050
|
i === "primary" ? "" : `avatar-${i}`,
|
|
3948
4051
|
s ? "avatar-ring" : "",
|
|
3949
|
-
|
|
4052
|
+
E ? "avatar-clickable" : "",
|
|
3950
4053
|
v
|
|
3951
|
-
].filter(Boolean).join(" "),
|
|
3952
|
-
|
|
3953
|
-
let
|
|
4054
|
+
].filter(Boolean).join(" "), k = {};
|
|
4055
|
+
T && (k["--avatar-size"] = T), i === "auto" && (k["--avatar-hue"] = wt(e));
|
|
4056
|
+
let A = Object.keys(k).length || b ? {
|
|
4057
|
+
...k,
|
|
4058
|
+
...b
|
|
4059
|
+
} : void 0, j = /* @__PURE__ */ f("span", {
|
|
3954
4060
|
className: "avatar-face",
|
|
3955
4061
|
"aria-hidden": "true",
|
|
3956
|
-
children: l == null ?
|
|
4062
|
+
children: l == null ? Ct(e) : /* @__PURE__ */ f(L, {
|
|
3957
4063
|
name: l,
|
|
3958
|
-
size: Math.round(
|
|
4064
|
+
size: Math.round(Tt(n) * .55)
|
|
3959
4065
|
})
|
|
3960
|
-
}),
|
|
4066
|
+
}), N = /* @__PURE__ */ p(d, { children: [
|
|
3961
4067
|
o !== "none" && /* @__PURE__ */ f("span", {
|
|
3962
4068
|
className: `avatar-status avatar-status-${o}`,
|
|
3963
4069
|
"aria-hidden": "true"
|
|
@@ -3971,45 +4077,53 @@ function Tt({ name: e, src: t, size: n = "md", shape: r = "circle", tone: i = "p
|
|
|
3971
4077
|
"aria-hidden": "true",
|
|
3972
4078
|
children: c
|
|
3973
4079
|
})
|
|
3974
|
-
] }),
|
|
3975
|
-
|
|
3976
|
-
|
|
4080
|
+
] }), P = /* @__PURE__ */ p(d, { children: [
|
|
4081
|
+
j,
|
|
4082
|
+
D && /* @__PURE__ */ f("img", {
|
|
3977
4083
|
className: "avatar-img",
|
|
3978
4084
|
src: t,
|
|
3979
|
-
alt:
|
|
3980
|
-
onError: () =>
|
|
4085
|
+
alt: E ? "" : e || "Profile photo",
|
|
4086
|
+
onError: () => C(!0)
|
|
3981
4087
|
}),
|
|
3982
|
-
|
|
4088
|
+
N
|
|
3983
4089
|
] });
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
4090
|
+
if (h != null) {
|
|
4091
|
+
let t = _ || "a", n = _ ? { to: h } : { href: h };
|
|
4092
|
+
return /* @__PURE__ */ f(t, {
|
|
4093
|
+
className: O,
|
|
4094
|
+
style: A,
|
|
4095
|
+
...x,
|
|
4096
|
+
"aria-label": c || e,
|
|
4097
|
+
...n,
|
|
4098
|
+
onClick: g,
|
|
4099
|
+
children: P
|
|
4100
|
+
});
|
|
4101
|
+
}
|
|
4102
|
+
return g == null ? D ? /* @__PURE__ */ f("span", {
|
|
4103
|
+
className: O,
|
|
4104
|
+
style: A,
|
|
4105
|
+
...x,
|
|
4106
|
+
children: P
|
|
3988
4107
|
}) : /* @__PURE__ */ f("span", {
|
|
3989
|
-
className:
|
|
3990
|
-
style:
|
|
4108
|
+
className: O,
|
|
4109
|
+
style: A,
|
|
4110
|
+
...x,
|
|
3991
4111
|
role: "img",
|
|
3992
4112
|
"aria-label": e,
|
|
3993
|
-
children:
|
|
4113
|
+
children: P
|
|
3994
4114
|
}) : /* @__PURE__ */ f("button", {
|
|
3995
4115
|
type: "button",
|
|
3996
|
-
className:
|
|
3997
|
-
style:
|
|
3998
|
-
|
|
3999
|
-
onClick: g,
|
|
4000
|
-
children: j
|
|
4001
|
-
}) : /* @__PURE__ */ f(_ || "a", {
|
|
4002
|
-
className: E,
|
|
4003
|
-
style: O,
|
|
4116
|
+
className: O,
|
|
4117
|
+
style: A,
|
|
4118
|
+
...x,
|
|
4004
4119
|
"aria-label": c || e,
|
|
4005
|
-
..._ ? { to: h } : { href: h },
|
|
4006
4120
|
onClick: g,
|
|
4007
|
-
children:
|
|
4121
|
+
children: P
|
|
4008
4122
|
});
|
|
4009
4123
|
}
|
|
4010
4124
|
//#endregion
|
|
4011
4125
|
//#region src/components/AppAvatarGroup.jsx
|
|
4012
|
-
var
|
|
4126
|
+
var Dt = {
|
|
4013
4127
|
xs: 20,
|
|
4014
4128
|
sm: 24,
|
|
4015
4129
|
md: 32,
|
|
@@ -4017,38 +4131,42 @@ var Et = {
|
|
|
4017
4131
|
xl: 64,
|
|
4018
4132
|
"2xl": 96
|
|
4019
4133
|
};
|
|
4020
|
-
function
|
|
4021
|
-
return e == null ? null : typeof e == "number" ? `${e}px` :
|
|
4134
|
+
function Ot(e) {
|
|
4135
|
+
return e == null ? null : typeof e == "number" ? `${e}px` : Dt[e] == null ? /^\d+$/.test(e) ? `${e}px` : e : `${Dt[e]}px`;
|
|
4022
4136
|
}
|
|
4023
|
-
function
|
|
4137
|
+
function kt({ children: e, size: t, spacing: n = "normal", overflow: r, className: i = "", ...a }) {
|
|
4024
4138
|
M("AppAvatarGroup", a);
|
|
4025
|
-
let o = [
|
|
4139
|
+
let { style: o, ...s } = a, c = [
|
|
4026
4140
|
"avatar-group",
|
|
4027
4141
|
n === "normal" ? "" : `avatar-group-${n}`,
|
|
4028
4142
|
i
|
|
4029
|
-
].filter(Boolean).join(" "),
|
|
4143
|
+
].filter(Boolean).join(" "), l = Ot(t), u = l ? {
|
|
4144
|
+
"--avatar-size": l,
|
|
4145
|
+
...o
|
|
4146
|
+
} : o, d = typeof r == "string" ? Number.parseInt(r, 10) : r;
|
|
4030
4147
|
return /* @__PURE__ */ p("div", {
|
|
4031
|
-
className:
|
|
4032
|
-
style:
|
|
4033
|
-
|
|
4148
|
+
className: c,
|
|
4149
|
+
style: u,
|
|
4150
|
+
...s,
|
|
4151
|
+
children: [e, d > 0 && /* @__PURE__ */ p("span", {
|
|
4034
4152
|
className: "avatar avatar-more",
|
|
4035
4153
|
role: "img",
|
|
4036
|
-
"aria-label": `${
|
|
4037
|
-
children: ["+",
|
|
4154
|
+
"aria-label": `${d} more`,
|
|
4155
|
+
children: ["+", d]
|
|
4038
4156
|
})]
|
|
4039
4157
|
});
|
|
4040
4158
|
}
|
|
4041
4159
|
//#endregion
|
|
4042
4160
|
//#region src/components/normalizeTone.js
|
|
4043
|
-
var
|
|
4044
|
-
function
|
|
4045
|
-
return e && (
|
|
4161
|
+
var At = { warn: "warning" };
|
|
4162
|
+
function jt(e) {
|
|
4163
|
+
return e && (At[e] || e);
|
|
4046
4164
|
}
|
|
4047
4165
|
//#endregion
|
|
4048
4166
|
//#region src/components/AppBadge.jsx
|
|
4049
|
-
function
|
|
4167
|
+
function Mt({ children: e, tone: t, dot: n = !1, className: r = "", ...i }) {
|
|
4050
4168
|
M("AppBadge", i);
|
|
4051
|
-
let a =
|
|
4169
|
+
let a = jt(t);
|
|
4052
4170
|
return /* @__PURE__ */ f(h, {
|
|
4053
4171
|
bg: !1,
|
|
4054
4172
|
className: [
|
|
@@ -4062,19 +4180,24 @@ function jt({ children: e, tone: t, dot: n = !1, className: r = "", ...i }) {
|
|
|
4062
4180
|
}
|
|
4063
4181
|
//#endregion
|
|
4064
4182
|
//#region src/components/AppBanner.jsx
|
|
4065
|
-
var
|
|
4183
|
+
var Nt = [
|
|
4066
4184
|
"info",
|
|
4067
4185
|
"success",
|
|
4068
4186
|
"warning",
|
|
4069
4187
|
"danger",
|
|
4070
4188
|
"neutral"
|
|
4071
4189
|
];
|
|
4072
|
-
function
|
|
4190
|
+
function Pt({ tone: e = "info", icon: t, children: n, dismissible: r = !1, onDismiss: i, className: a = "", ...o }) {
|
|
4073
4191
|
M("AppBanner", o);
|
|
4074
4192
|
let [s, c] = u(!0);
|
|
4075
|
-
|
|
4076
|
-
|
|
4193
|
+
if (!s) return null;
|
|
4194
|
+
let l = jt(e), d = Nt.includes(l) ? l : "info", m = () => {
|
|
4195
|
+
c(!1), i?.();
|
|
4196
|
+
};
|
|
4197
|
+
return /* @__PURE__ */ p("div", {
|
|
4198
|
+
className: `wui-banner wui-banner-${d}${a ? ` ${a}` : ""}`,
|
|
4077
4199
|
role: "status",
|
|
4200
|
+
...o,
|
|
4078
4201
|
children: [
|
|
4079
4202
|
t && /* @__PURE__ */ f("span", {
|
|
4080
4203
|
className: "wui-banner-icon",
|
|
@@ -4088,22 +4211,21 @@ function Nt({ tone: e = "info", icon: t, children: n, dismissible: r = !1, onDis
|
|
|
4088
4211
|
type: "button",
|
|
4089
4212
|
className: "wui-banner-dismiss",
|
|
4090
4213
|
"aria-label": "Dismiss",
|
|
4091
|
-
onClick:
|
|
4092
|
-
c(!1), i?.();
|
|
4093
|
-
},
|
|
4214
|
+
onClick: m,
|
|
4094
4215
|
children: /* @__PURE__ */ f(L, {
|
|
4095
4216
|
name: "x",
|
|
4096
4217
|
size: 18
|
|
4097
4218
|
})
|
|
4098
4219
|
})
|
|
4099
4220
|
]
|
|
4100
|
-
})
|
|
4221
|
+
});
|
|
4101
4222
|
}
|
|
4102
4223
|
//#endregion
|
|
4103
4224
|
//#region src/components/AppBreadcrumbs.jsx
|
|
4104
|
-
function
|
|
4225
|
+
function Ft({ items: e = [], linkComponent: t, className: n = "", ...r }) {
|
|
4105
4226
|
return M("AppBreadcrumbs", r), /* @__PURE__ */ f(g, {
|
|
4106
4227
|
className: n || void 0,
|
|
4228
|
+
...r,
|
|
4107
4229
|
children: e.map((n, r) => {
|
|
4108
4230
|
let i = r === e.length - 1, a = n.icon ? R(n.icon, { size: 14 }) : null, o = {};
|
|
4109
4231
|
return i || (n.to && t ? o = {
|
|
@@ -4119,9 +4241,10 @@ function Pt({ items: e = [], linkComponent: t, className: n = "", ...r }) {
|
|
|
4119
4241
|
}
|
|
4120
4242
|
//#endregion
|
|
4121
4243
|
//#region src/components/AppCallout.jsx
|
|
4122
|
-
function
|
|
4244
|
+
function It({ children: e, icon: t = "info", className: n = "", ...r }) {
|
|
4123
4245
|
return M("AppCallout", r), /* @__PURE__ */ p("div", {
|
|
4124
4246
|
className: `info-callout${n ? ` ${n}` : ""}`,
|
|
4247
|
+
...r,
|
|
4125
4248
|
children: [t && /* @__PURE__ */ f("span", {
|
|
4126
4249
|
className: "info-callout-icon",
|
|
4127
4250
|
children: /* @__PURE__ */ f(L, {
|
|
@@ -4133,13 +4256,13 @@ function Ft({ children: e, icon: t = "info", className: n = "", ...r }) {
|
|
|
4133
4256
|
}
|
|
4134
4257
|
//#endregion
|
|
4135
4258
|
//#region src/components/AppCard.jsx
|
|
4136
|
-
var
|
|
4259
|
+
var Lt = {
|
|
4137
4260
|
xs: 320,
|
|
4138
4261
|
sm: 420,
|
|
4139
4262
|
md: 560,
|
|
4140
4263
|
lg: 720
|
|
4141
4264
|
};
|
|
4142
|
-
function
|
|
4265
|
+
function Rt({ title: e, subtitle: t, headerIcon: n, titleClassName: r = "", header: i, headerExtra: a, headerActions: o, footer: s, media: c, children: l, variant: u = "default", tone: m = "primary", padding: h = "md", maxWidth: g, className: _ = "", bodyClassName: y = "", headerClassName: b = "", body: x = !0, lifted: S = !1, href: C, onClick: w, linkComponent: T, ...E }) {
|
|
4143
4266
|
M("AppCard", E);
|
|
4144
4267
|
let { style: D, ...O } = E, k = C != null || w != null, A = [
|
|
4145
4268
|
u && u !== "default" ? `card-${u}` : "",
|
|
@@ -4149,7 +4272,7 @@ function Lt({ title: e, subtitle: t, headerIcon: n, titleClassName: r = "", head
|
|
|
4149
4272
|
g == null ? "" : "card-constrained",
|
|
4150
4273
|
k ? "card-clickable" : "",
|
|
4151
4274
|
_
|
|
4152
|
-
].filter(Boolean).join(" ") || void 0, j = g == null ? void 0 :
|
|
4275
|
+
].filter(Boolean).join(" ") || void 0, j = g == null ? void 0 : Lt[g] == null ? typeof g == "number" ? `${g}px` : g : `${Lt[g]}px`, N = j ? {
|
|
4153
4276
|
"--card-max-width": j,
|
|
4154
4277
|
...D
|
|
4155
4278
|
} : D, P = {};
|
|
@@ -4220,7 +4343,7 @@ function Lt({ title: e, subtitle: t, headerIcon: n, titleClassName: r = "", head
|
|
|
4220
4343
|
}
|
|
4221
4344
|
//#endregion
|
|
4222
4345
|
//#region src/components/AppCheckbox.jsx
|
|
4223
|
-
var
|
|
4346
|
+
var zt = r(function({ label: e, id: t, name: n, error: r, hint: i, className: a = "", ...s }, c) {
|
|
4224
4347
|
M("AppCheckbox", s);
|
|
4225
4348
|
let l = o(), u = t || l;
|
|
4226
4349
|
return /* @__PURE__ */ p("div", {
|
|
@@ -4252,9 +4375,9 @@ var Rt = r(function({ label: e, id: t, name: n, error: r, hint: i, className: a
|
|
|
4252
4375
|
});
|
|
4253
4376
|
//#endregion
|
|
4254
4377
|
//#region src/components/AppChip.jsx
|
|
4255
|
-
function
|
|
4378
|
+
function Bt({ label: e, children: t, tone: n = "neutral", size: r = "md", leadingIcon: i, avatar: a, onRemove: o, onClick: s, disabled: c = !1, removeLabel: l, className: u = "", ...m }) {
|
|
4256
4379
|
M("AppChip", m);
|
|
4257
|
-
let h = e ?? t, g =
|
|
4380
|
+
let h = e ?? t, g = jt(n), _ = [
|
|
4258
4381
|
"chip",
|
|
4259
4382
|
g && g !== "neutral" ? g : "",
|
|
4260
4383
|
r === "sm" ? "chip-sm" : "",
|
|
@@ -4274,22 +4397,23 @@ function zt({ label: e, children: t, tone: n = "neutral", size: r = "md", leadin
|
|
|
4274
4397
|
name: i,
|
|
4275
4398
|
size: r === "sm" ? 12 : 14
|
|
4276
4399
|
})
|
|
4277
|
-
}) : null
|
|
4278
|
-
|
|
4279
|
-
className:
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
onClick: s,
|
|
4284
|
-
disabled: c,
|
|
4285
|
-
children: [v, /* @__PURE__ */ f("span", {
|
|
4286
|
-
className: "chip-label",
|
|
4287
|
-
children: h
|
|
4288
|
-
})]
|
|
4289
|
-
}) : /* @__PURE__ */ p(d, { children: [v, /* @__PURE__ */ f("span", {
|
|
4400
|
+
}) : null, y = s ? /* @__PURE__ */ p("button", {
|
|
4401
|
+
type: "button",
|
|
4402
|
+
className: "chip-body",
|
|
4403
|
+
onClick: s,
|
|
4404
|
+
disabled: c,
|
|
4405
|
+
children: [v, /* @__PURE__ */ f("span", {
|
|
4290
4406
|
className: "chip-label",
|
|
4291
4407
|
children: h
|
|
4292
|
-
})]
|
|
4408
|
+
})]
|
|
4409
|
+
}) : /* @__PURE__ */ p(d, { children: [v, /* @__PURE__ */ f("span", {
|
|
4410
|
+
className: "chip-label",
|
|
4411
|
+
children: h
|
|
4412
|
+
})] });
|
|
4413
|
+
return /* @__PURE__ */ p("span", {
|
|
4414
|
+
className: _,
|
|
4415
|
+
...m,
|
|
4416
|
+
children: [y, o && /* @__PURE__ */ f("button", {
|
|
4293
4417
|
type: "button",
|
|
4294
4418
|
className: "chip-remove",
|
|
4295
4419
|
onClick: o,
|
|
@@ -4304,9 +4428,10 @@ function zt({ label: e, children: t, tone: n = "neutral", size: r = "md", leadin
|
|
|
4304
4428
|
}
|
|
4305
4429
|
//#endregion
|
|
4306
4430
|
//#region src/components/AppChoiceCard.jsx
|
|
4307
|
-
function
|
|
4431
|
+
function Vt({ name: e, multiple: t = !1, value: n, checked: r, onChange: i, icon: a, iconNode: o, iconSize: s = 18, image: c, imageAlt: l = "", children: u, title: m, description: h, checkIcon: g = "check", checkSize: _ = 12, className: v = "", ...y }) {
|
|
4308
4432
|
return M("AppChoiceCard", y), /* @__PURE__ */ p("label", {
|
|
4309
4433
|
className: `struct-card${c ? " struct-card-img-card" : ""}${r ? " checked" : ""}${v ? ` ${v}` : ""}`,
|
|
4434
|
+
...y,
|
|
4310
4435
|
children: [
|
|
4311
4436
|
/* @__PURE__ */ f("input", {
|
|
4312
4437
|
type: t ? "checkbox" : "radio",
|
|
@@ -4352,9 +4477,10 @@ function Bt({ name: e, multiple: t = !1, value: n, checked: r, onChange: i, icon
|
|
|
4352
4477
|
}
|
|
4353
4478
|
//#endregion
|
|
4354
4479
|
//#region src/components/AppChoiceChip.jsx
|
|
4355
|
-
function
|
|
4480
|
+
function Ht({ multiple: e = !0, label: t, name: n, value: r, checked: i, onChange: a, children: o, count: s, className: c = "", ...l }) {
|
|
4356
4481
|
return M("AppChoiceChip", l), /* @__PURE__ */ p("label", {
|
|
4357
4482
|
className: `choice-chip${i ? " checked" : ""}${c ? ` ${c}` : ""}`,
|
|
4483
|
+
...l,
|
|
4358
4484
|
children: [
|
|
4359
4485
|
/* @__PURE__ */ f("input", {
|
|
4360
4486
|
type: e ? "checkbox" : "radio",
|
|
@@ -4373,9 +4499,9 @@ function Vt({ multiple: e = !0, label: t, name: n, value: r, checked: i, onChang
|
|
|
4373
4499
|
}
|
|
4374
4500
|
//#endregion
|
|
4375
4501
|
//#region src/components/AppColorField.jsx
|
|
4376
|
-
function
|
|
4502
|
+
function Ut({ value: e = "#000000", onChange: t, label: n, required: r = !1, error: i, hint: a, name: s, id: c, disabled: l = !1, size: u = "md", className: d = "", ...m }) {
|
|
4377
4503
|
M("AppColorField", m);
|
|
4378
|
-
let h = o(), g = c ||
|
|
4504
|
+
let h = o(), g = c || h, _ = (e) => /^#[0-9a-f]{6}$/i.test(e), v = u === "sm" ? " color-field-sm" : u === "lg" ? " color-field-lg" : "", y = u === "sm" ? " input-sm" : u === "lg" ? " input-lg" : "";
|
|
4379
4505
|
return /* @__PURE__ */ p("div", {
|
|
4380
4506
|
className: `field${d ? ` ${d}` : ""}`,
|
|
4381
4507
|
children: [
|
|
@@ -4406,7 +4532,8 @@ function Ht({ value: e = "#000000", onChange: t, label: n, required: r = !1, err
|
|
|
4406
4532
|
maxLength: 7,
|
|
4407
4533
|
required: r,
|
|
4408
4534
|
disabled: l,
|
|
4409
|
-
"aria-invalid": i ? "true" : "false"
|
|
4535
|
+
"aria-invalid": i ? "true" : "false",
|
|
4536
|
+
...m
|
|
4410
4537
|
})]
|
|
4411
4538
|
}),
|
|
4412
4539
|
i ? /* @__PURE__ */ f("div", {
|
|
@@ -4421,7 +4548,7 @@ function Ht({ value: e = "#000000", onChange: t, label: n, required: r = !1, err
|
|
|
4421
4548
|
}
|
|
4422
4549
|
//#endregion
|
|
4423
4550
|
//#region src/components/AppCompareTable.jsx
|
|
4424
|
-
function
|
|
4551
|
+
function Wt({ columns: e = [], rows: t = [], caption: n, className: r = "", ...i }) {
|
|
4425
4552
|
M("AppCompareTable", i);
|
|
4426
4553
|
let a = (e) => e === !0 ? /* @__PURE__ */ f("span", {
|
|
4427
4554
|
className: "compare-yes",
|
|
@@ -4435,6 +4562,7 @@ function Ut({ columns: e = [], rows: t = [], caption: n, className: r = "", ...i
|
|
|
4435
4562
|
}) : e;
|
|
4436
4563
|
return /* @__PURE__ */ f("div", {
|
|
4437
4564
|
className: `compare-table${r ? ` ${r}` : ""}`,
|
|
4565
|
+
...i,
|
|
4438
4566
|
children: /* @__PURE__ */ p("table", { children: [
|
|
4439
4567
|
n && /* @__PURE__ */ f("caption", {
|
|
4440
4568
|
className: "visually-hidden",
|
|
@@ -4457,9 +4585,9 @@ function Ut({ columns: e = [], rows: t = [], caption: n, className: r = "", ...i
|
|
|
4457
4585
|
}
|
|
4458
4586
|
//#endregion
|
|
4459
4587
|
//#region src/components/AppInput.jsx
|
|
4460
|
-
var
|
|
4588
|
+
var Gt = r(function({ label: e, required: t = !1, error: n, hint: r, help: i, helpLabel: s = "More information", type: c = "text", size: d = "md", leftIcon: m, rightIcon: h, onRightIconClick: g, rightIconLabel: _, unit: v, id: y, name: x, className: S = "", fieldClassName: C = "", disabled: w = !1, clearable: T = !1, showCount: E = !1, maxLength: D, prefix: O, suffix: k, floatingLabel: A = !1, variant: j, ...N }, P) {
|
|
4461
4589
|
M("AppInput", N);
|
|
4462
|
-
let [F, I] = u(!1), R = o(), z = y ||
|
|
4590
|
+
let [F, I] = u(!1), R = o(), z = y || R, B = c === "password", ee = B && F ? "text" : c, V = l(null), te = (e) => {
|
|
4463
4591
|
V.current = e, typeof P == "function" ? P(e) : P && (P.current = e);
|
|
4464
4592
|
}, H = String(N.value ?? N.defaultValue ?? ""), [ne, re] = u(() => !!H), [ie, ae] = u(() => H.length), oe = T && !w, U = T || E;
|
|
4465
4593
|
a(() => {
|
|
@@ -4467,9 +4595,9 @@ var Wt = r(function({ label: e, required: t = !1, error: n, hint: r, help: i, he
|
|
|
4467
4595
|
let e = String(N.value ?? "");
|
|
4468
4596
|
re(!!e), ae(e.length);
|
|
4469
4597
|
}, [N.value, U]);
|
|
4470
|
-
let
|
|
4598
|
+
let se = (e) => {
|
|
4471
4599
|
re(!!e.target.value), ae(e.target.value.length), N.onInput?.(e);
|
|
4472
|
-
},
|
|
4600
|
+
}, ce = oe ? /* @__PURE__ */ f("button", {
|
|
4473
4601
|
type: "button",
|
|
4474
4602
|
className: "input-clear",
|
|
4475
4603
|
onClick: () => {
|
|
@@ -4485,7 +4613,7 @@ var Wt = r(function({ label: e, required: t = !1, error: n, hint: r, help: i, he
|
|
|
4485
4613
|
name: "x",
|
|
4486
4614
|
size: 16
|
|
4487
4615
|
})
|
|
4488
|
-
}) : null,
|
|
4616
|
+
}) : null, W = n && z ? `${z}-error` : void 0, le = r && z ? `${z}-hint` : void 0, G = W || le, ue = [
|
|
4489
4617
|
"input",
|
|
4490
4618
|
d === "sm" ? "input-sm" : "",
|
|
4491
4619
|
d === "lg" ? "input-lg" : "",
|
|
@@ -4495,24 +4623,24 @@ var Wt = r(function({ label: e, required: t = !1, error: n, hint: r, help: i, he
|
|
|
4495
4623
|
!(A && e || O || k || v || B || h) && T && oe ? "has-clear" : "",
|
|
4496
4624
|
j === "bare" ? "input-bare" : "",
|
|
4497
4625
|
S
|
|
4498
|
-
].filter(Boolean).join(" "),
|
|
4626
|
+
].filter(Boolean).join(" "), K = /* @__PURE__ */ f(b.Control, {
|
|
4499
4627
|
id: z,
|
|
4500
4628
|
name: x,
|
|
4501
4629
|
type: ee,
|
|
4502
|
-
className:
|
|
4630
|
+
className: ue,
|
|
4503
4631
|
disabled: w,
|
|
4504
4632
|
required: t,
|
|
4505
4633
|
"aria-invalid": n ? "true" : "false",
|
|
4506
|
-
"aria-describedby":
|
|
4634
|
+
"aria-describedby": G,
|
|
4507
4635
|
maxLength: D,
|
|
4508
4636
|
...N,
|
|
4509
4637
|
placeholder: A ? " " : N.placeholder,
|
|
4510
4638
|
ref: te,
|
|
4511
|
-
onInput: U ?
|
|
4512
|
-
}),
|
|
4513
|
-
return
|
|
4639
|
+
onInput: U ? se : N.onInput
|
|
4640
|
+
}), de;
|
|
4641
|
+
return de = A && e ? /* @__PURE__ */ p("div", {
|
|
4514
4642
|
className: "field-float",
|
|
4515
|
-
children: [
|
|
4643
|
+
children: [K, /* @__PURE__ */ p("label", {
|
|
4516
4644
|
className: "float-label",
|
|
4517
4645
|
htmlFor: z,
|
|
4518
4646
|
children: [e, t && /* @__PURE__ */ f(Q, {})]
|
|
@@ -4524,7 +4652,7 @@ var Wt = r(function({ label: e, required: t = !1, error: n, hint: r, help: i, he
|
|
|
4524
4652
|
className: "affix affix-pre",
|
|
4525
4653
|
children: O
|
|
4526
4654
|
}),
|
|
4527
|
-
|
|
4655
|
+
K,
|
|
4528
4656
|
k != null && /* @__PURE__ */ f("span", {
|
|
4529
4657
|
className: "affix affix-suf",
|
|
4530
4658
|
children: k
|
|
@@ -4532,13 +4660,13 @@ var Wt = r(function({ label: e, required: t = !1, error: n, hint: r, help: i, he
|
|
|
4532
4660
|
]
|
|
4533
4661
|
}) : v ? /* @__PURE__ */ p("div", {
|
|
4534
4662
|
className: "input-with-unit",
|
|
4535
|
-
children: [
|
|
4663
|
+
children: [K, /* @__PURE__ */ f("span", {
|
|
4536
4664
|
className: "unit",
|
|
4537
4665
|
children: v
|
|
4538
4666
|
})]
|
|
4539
4667
|
}) : B ? /* @__PURE__ */ p("div", {
|
|
4540
4668
|
className: "input-wrap",
|
|
4541
|
-
children: [
|
|
4669
|
+
children: [K, /* @__PURE__ */ f("button", {
|
|
4542
4670
|
type: "button",
|
|
4543
4671
|
className: "pw-toggle",
|
|
4544
4672
|
onClick: () => I((e) => !e),
|
|
@@ -4551,7 +4679,7 @@ var Wt = r(function({ label: e, required: t = !1, error: n, hint: r, help: i, he
|
|
|
4551
4679
|
})]
|
|
4552
4680
|
}) : h ? /* @__PURE__ */ p("div", {
|
|
4553
4681
|
className: "input-wrap",
|
|
4554
|
-
children: [
|
|
4682
|
+
children: [K, /* @__PURE__ */ f("button", {
|
|
4555
4683
|
type: "button",
|
|
4556
4684
|
className: "pw-toggle",
|
|
4557
4685
|
onClick: g,
|
|
@@ -4573,8 +4701,8 @@ var Wt = r(function({ label: e, required: t = !1, error: n, hint: r, help: i, he
|
|
|
4573
4701
|
size: 16
|
|
4574
4702
|
})
|
|
4575
4703
|
}),
|
|
4576
|
-
|
|
4577
|
-
|
|
4704
|
+
K,
|
|
4705
|
+
ce
|
|
4578
4706
|
]
|
|
4579
4707
|
}) : m ? /* @__PURE__ */ p("div", {
|
|
4580
4708
|
className: "input-icon",
|
|
@@ -4584,8 +4712,8 @@ var Wt = r(function({ label: e, required: t = !1, error: n, hint: r, help: i, he
|
|
|
4584
4712
|
name: m,
|
|
4585
4713
|
size: 16
|
|
4586
4714
|
})
|
|
4587
|
-
}),
|
|
4588
|
-
}) :
|
|
4715
|
+
}), K]
|
|
4716
|
+
}) : K, /* @__PURE__ */ p(b.Group, {
|
|
4589
4717
|
className: `field${C ? ` ${C}` : ""}`,
|
|
4590
4718
|
children: [
|
|
4591
4719
|
e && !A && /* @__PURE__ */ p(b.Label, {
|
|
@@ -4594,20 +4722,20 @@ var Wt = r(function({ label: e, required: t = !1, error: n, hint: r, help: i, he
|
|
|
4594
4722
|
children: [
|
|
4595
4723
|
e,
|
|
4596
4724
|
t && /* @__PURE__ */ f(Q, {}),
|
|
4597
|
-
i && /* @__PURE__ */ f(
|
|
4725
|
+
i && /* @__PURE__ */ f(yt, {
|
|
4598
4726
|
label: s,
|
|
4599
4727
|
children: i
|
|
4600
4728
|
})
|
|
4601
4729
|
]
|
|
4602
4730
|
}),
|
|
4603
|
-
|
|
4731
|
+
de,
|
|
4604
4732
|
n ? /* @__PURE__ */ f("div", {
|
|
4605
4733
|
className: "field-error",
|
|
4606
|
-
id:
|
|
4734
|
+
id: W,
|
|
4607
4735
|
children: n
|
|
4608
4736
|
}) : r ? /* @__PURE__ */ f("div", {
|
|
4609
4737
|
className: "field-hint",
|
|
4610
|
-
id:
|
|
4738
|
+
id: le,
|
|
4611
4739
|
children: r
|
|
4612
4740
|
}) : null,
|
|
4613
4741
|
E && /* @__PURE__ */ p("div", {
|
|
@@ -4616,32 +4744,32 @@ var Wt = r(function({ label: e, required: t = !1, error: n, hint: r, help: i, he
|
|
|
4616
4744
|
})
|
|
4617
4745
|
]
|
|
4618
4746
|
});
|
|
4619
|
-
}),
|
|
4747
|
+
}), Kt = "a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])", qt = {
|
|
4620
4748
|
sm: 380,
|
|
4621
4749
|
md: 440,
|
|
4622
4750
|
lg: 640,
|
|
4623
4751
|
xl: 880
|
|
4624
|
-
},
|
|
4625
|
-
function
|
|
4752
|
+
}, Jt = !1;
|
|
4753
|
+
function Yt() {
|
|
4626
4754
|
let e = !0;
|
|
4627
4755
|
try {
|
|
4628
4756
|
e = process.env.NODE_ENV !== "production";
|
|
4629
4757
|
} catch {
|
|
4630
4758
|
e = !0;
|
|
4631
4759
|
}
|
|
4632
|
-
!e ||
|
|
4760
|
+
!e || Jt || (Jt = !0, console.warn("[@webority/ui-react] <AppModal hideHeader> has no accessible name — pass `ariaLabel` (or a string `title`)."));
|
|
4633
4761
|
}
|
|
4634
|
-
function
|
|
4635
|
-
M("AppModal", b), h && !_ && typeof n != "string" &&
|
|
4762
|
+
function Xt({ open: e, eyebrow: t, title: n, subtitle: r, headerIcon: i, tone: o = "default", dismissible: s = !0, onClose: c, footer: u, size: d = "md", placement: m = "center", hideHeader: h = !1, staticBackdrop: g = !1, ariaLabel: _, className: v = "", children: y, ...b }) {
|
|
4763
|
+
M("AppModal", b), h && !_ && typeof n != "string" && Yt();
|
|
4636
4764
|
let S = l(null);
|
|
4637
4765
|
a(() => {
|
|
4638
4766
|
if (!e) return;
|
|
4639
4767
|
let t = S.current?.closest(".modal-content");
|
|
4640
4768
|
if (!t) return;
|
|
4641
|
-
let n = () => Array.from(t.querySelectorAll(
|
|
4769
|
+
let n = () => Array.from(t.querySelectorAll(Kt));
|
|
4642
4770
|
(t.querySelector("[data-autofocus]") || n().find((e) => !e.classList.contains("wui-modal-close")) || n()[0] || t).focus?.();
|
|
4643
4771
|
}, [e]);
|
|
4644
|
-
let C = typeof d == "number" ? d :
|
|
4772
|
+
let C = typeof d == "number" ? d : qt[d] ?? qt.md, w = [
|
|
4645
4773
|
"wui-modal",
|
|
4646
4774
|
o === "default" ? "" : `tone-${o}`,
|
|
4647
4775
|
v
|
|
@@ -4722,30 +4850,30 @@ function Yt({ open: e, eyebrow: t, title: n, subtitle: r, headerIcon: i, tone: o
|
|
|
4722
4850
|
}
|
|
4723
4851
|
//#endregion
|
|
4724
4852
|
//#region src/components/ModalIcons.jsx
|
|
4725
|
-
var
|
|
4853
|
+
var Zt = (e) => function({ size: t = 72 }) {
|
|
4726
4854
|
return /* @__PURE__ */ f("wui-status-icon", {
|
|
4727
4855
|
tone: e,
|
|
4728
4856
|
size: t
|
|
4729
4857
|
});
|
|
4730
|
-
},
|
|
4731
|
-
success:
|
|
4732
|
-
error:
|
|
4733
|
-
warning:
|
|
4734
|
-
info:
|
|
4735
|
-
delete:
|
|
4858
|
+
}, Qt = {
|
|
4859
|
+
success: Zt("success"),
|
|
4860
|
+
error: Zt("error"),
|
|
4861
|
+
warning: Zt("warning"),
|
|
4862
|
+
info: Zt("info"),
|
|
4863
|
+
delete: Zt("delete")
|
|
4736
4864
|
};
|
|
4737
4865
|
//#endregion
|
|
4738
4866
|
//#region src/components/AppConfirmDialog.jsx
|
|
4739
|
-
function
|
|
4867
|
+
function $t({ open: e, title: t, message: n, confirmLabel: r = "Confirm", cancelLabel: i = "Cancel", danger: o = !1, tone: s, confirmPhrase: c, onConfirm: l, onClose: m, loading: h = !1, staticBackdrop: g = !1, placement: _ = "center", ...v }) {
|
|
4740
4868
|
M("AppConfirmDialog", v);
|
|
4741
4869
|
let [y, b] = u("");
|
|
4742
4870
|
if (a(() => {
|
|
4743
4871
|
e || b("");
|
|
4744
4872
|
}, [e]), !e) return null;
|
|
4745
|
-
let x = !!c && y.trim() !== c, S =
|
|
4873
|
+
let x = !!c && y.trim() !== c, S = Qt[s || (o ? "delete" : "info")], C = () => {
|
|
4746
4874
|
h || m?.();
|
|
4747
4875
|
};
|
|
4748
|
-
return /* @__PURE__ */ f(
|
|
4876
|
+
return /* @__PURE__ */ f(Xt, {
|
|
4749
4877
|
open: e,
|
|
4750
4878
|
hideHeader: !0,
|
|
4751
4879
|
title: t,
|
|
@@ -4785,7 +4913,7 @@ function Qt({ open: e, title: t, message: n, confirmLabel: r = "Confirm", cancel
|
|
|
4785
4913
|
className: "wui-confirm-msg",
|
|
4786
4914
|
children: n
|
|
4787
4915
|
}),
|
|
4788
|
-
c && /* @__PURE__ */ f(
|
|
4916
|
+
c && /* @__PURE__ */ f(Gt, {
|
|
4789
4917
|
fieldClassName: "mt-3 mb-0 w-100 text-start",
|
|
4790
4918
|
label: /* @__PURE__ */ p(d, { children: [
|
|
4791
4919
|
"Type ",
|
|
@@ -4803,7 +4931,7 @@ function Qt({ open: e, title: t, message: n, confirmLabel: r = "Confirm", cancel
|
|
|
4803
4931
|
}
|
|
4804
4932
|
//#endregion
|
|
4805
4933
|
//#region src/components/AppCopyButton.jsx
|
|
4806
|
-
function
|
|
4934
|
+
function en({ text: e, label: t = "Copy", copiedLabel: n = "Copied", iconOnly: r = !1, size: a = "md", variant: o = "ghost", onCopied: s, className: c = "", ...l }) {
|
|
4807
4935
|
M("AppCopyButton", l);
|
|
4808
4936
|
let [d, p] = u(!1), m = i(async () => {
|
|
4809
4937
|
try {
|
|
@@ -4838,7 +4966,7 @@ function $t({ text: e, label: t = "Copy", copiedLabel: n = "Copied", iconOnly: r
|
|
|
4838
4966
|
}
|
|
4839
4967
|
//#endregion
|
|
4840
4968
|
//#region src/components/AppSkeleton.jsx
|
|
4841
|
-
function
|
|
4969
|
+
function tn({ width: e = "100%", height: t = 14, radius: n = 6, className: r = "", style: i, ...a }) {
|
|
4842
4970
|
return M("AppSkeleton", a), /* @__PURE__ */ f("span", {
|
|
4843
4971
|
className: `skeleton${r ? ` ${r}` : ""}`,
|
|
4844
4972
|
"aria-hidden": "true",
|
|
@@ -4851,36 +4979,73 @@ function en({ width: e = "100%", height: t = 14, radius: n = 6, className: r = "
|
|
|
4851
4979
|
...a
|
|
4852
4980
|
});
|
|
4853
4981
|
}
|
|
4854
|
-
function
|
|
4855
|
-
return Array.from({ length: e }).map((e, n) => /* @__PURE__ */ f("tr", { children: Array.from({ length: t }).map((e, t) => /* @__PURE__ */ f("td", { children: /* @__PURE__ */ f(
|
|
4982
|
+
function nn({ rows: e = 4, cols: t = 5 }) {
|
|
4983
|
+
return Array.from({ length: e }).map((e, n) => /* @__PURE__ */ f("tr", { children: Array.from({ length: t }).map((e, t) => /* @__PURE__ */ f("td", { children: /* @__PURE__ */ f(tn, {
|
|
4856
4984
|
width: t === 0 ? "70%" : "50%",
|
|
4857
4985
|
height: 12
|
|
4858
4986
|
}) }, `col-${t}`)) }, `row-${n}`));
|
|
4859
4987
|
}
|
|
4860
4988
|
//#endregion
|
|
4861
4989
|
//#region src/lib/pageWindow.js
|
|
4862
|
-
var
|
|
4990
|
+
var rn = (e, t) => {
|
|
4863
4991
|
let n = [];
|
|
4864
4992
|
for (let r = e; r <= t; r += 1) n.push(r);
|
|
4865
4993
|
return n;
|
|
4866
4994
|
};
|
|
4867
|
-
function
|
|
4995
|
+
function an(e, t, { siblingCount: n = 2, boundaryCount: r = 1 } = {}) {
|
|
4868
4996
|
let i = Math.max(1, t), a = Math.min(Math.max(1, e), i);
|
|
4869
|
-
if (i <= n * 2 + 3 + r * 2) return
|
|
4870
|
-
let o = Math.max(a - n, r + 2), s = Math.min(a + n, i - r - 1), c = o > r + 2, l = s < i - r - 1, u =
|
|
4871
|
-
return u.push(...c ? ["ellipsis-left"] :
|
|
4997
|
+
if (i <= n * 2 + 3 + r * 2) return rn(1, i);
|
|
4998
|
+
let o = Math.max(a - n, r + 2), s = Math.min(a + n, i - r - 1), c = o > r + 2, l = s < i - r - 1, u = rn(1, r);
|
|
4999
|
+
return u.push(...c ? ["ellipsis-left"] : rn(r + 1, o - 1)), u.push(...rn(o, s)), u.push(...l ? ["ellipsis-right"] : rn(s + 1, i - r)), u.push(...rn(i - r + 1, i)), u;
|
|
5000
|
+
}
|
|
5001
|
+
//#endregion
|
|
5002
|
+
//#region src/components/useWuiControl.js
|
|
5003
|
+
function on({ ref: e, value: t, onChange: n, readValue: r, writeValue: i, syncDeps: o = [] } = {}) {
|
|
5004
|
+
let s = l(null), c = r ?? sn, u = i ?? cn, d = (t) => {
|
|
5005
|
+
s.current = t, typeof e == "function" ? e(t) : e && (e.current = t);
|
|
5006
|
+
};
|
|
5007
|
+
return a(() => {
|
|
5008
|
+
let e = s.current;
|
|
5009
|
+
!e || t === void 0 || u(e, t);
|
|
5010
|
+
}, [
|
|
5011
|
+
t,
|
|
5012
|
+
u,
|
|
5013
|
+
...o
|
|
5014
|
+
]), a(() => {
|
|
5015
|
+
let e = s.current;
|
|
5016
|
+
if (!e) return;
|
|
5017
|
+
let t = () => n?.(c(e));
|
|
5018
|
+
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
5019
|
+
}, [n, c]), {
|
|
5020
|
+
setRef: d,
|
|
5021
|
+
innerRef: s
|
|
5022
|
+
};
|
|
5023
|
+
}
|
|
5024
|
+
function sn(e) {
|
|
5025
|
+
return e.value;
|
|
5026
|
+
}
|
|
5027
|
+
function cn(e, t) {
|
|
5028
|
+
let n = t ?? "";
|
|
5029
|
+
String(e.value ?? "") !== String(n) && (e.value = n);
|
|
5030
|
+
}
|
|
5031
|
+
function ln(e, t) {
|
|
5032
|
+
let n = e || [], r = t || [];
|
|
5033
|
+
return n.length === r.length && n.every((e, t) => e?.value === r[t]?.value && e?.label === r[t]?.label);
|
|
4872
5034
|
}
|
|
4873
5035
|
//#endregion
|
|
4874
5036
|
//#region src/components/AppSelectMini.jsx
|
|
4875
|
-
function
|
|
5037
|
+
function un({ value: e, onChange: t, options: n = [], placeholder: r = "Select...", name: i, ariaLabel: o, id: s, disabled: c, size: u, icon: d, prefix: p, className: m, ...h }) {
|
|
4876
5038
|
M("AppSelectMini", h);
|
|
4877
5039
|
let g = l(null);
|
|
4878
5040
|
return a(() => {
|
|
4879
|
-
|
|
5041
|
+
let e = g.current;
|
|
5042
|
+
if (!e) return;
|
|
5043
|
+
let t = n.map((e) => ({
|
|
4880
5044
|
value: e.value,
|
|
4881
5045
|
label: e.label ?? e.text ?? "",
|
|
4882
5046
|
icon: e.icon
|
|
4883
|
-
}))
|
|
5047
|
+
}));
|
|
5048
|
+
ln(t, e.options) || (e.options = t);
|
|
4884
5049
|
}, [n]), a(() => {
|
|
4885
5050
|
let t = g.current;
|
|
4886
5051
|
t && String(t.value ?? "") !== String(e ?? "") && (t.value = e ?? "");
|
|
@@ -4901,26 +5066,27 @@ function an({ value: e, onChange: t, options: n = [], placeholder: r = "Select..
|
|
|
4901
5066
|
"aria-label": o,
|
|
4902
5067
|
size: u || void 0,
|
|
4903
5068
|
disabled: c ? "" : void 0,
|
|
4904
|
-
className: m
|
|
5069
|
+
className: m,
|
|
5070
|
+
...h
|
|
4905
5071
|
});
|
|
4906
5072
|
}
|
|
4907
5073
|
//#endregion
|
|
4908
5074
|
//#region src/components/AppTablePagination.jsx
|
|
4909
|
-
var
|
|
5075
|
+
var dn = [
|
|
4910
5076
|
5,
|
|
4911
5077
|
10,
|
|
4912
5078
|
25,
|
|
4913
5079
|
50
|
|
4914
5080
|
];
|
|
4915
|
-
function
|
|
5081
|
+
function fn({ page: e, totalPages: t, pageSize: n, total: r, firstRow: i, lastRow: a, onPageChange: o, onPageSizeChange: s, pageSizes: c = dn, mode: l = "prev-next", showPageSize: u = !0, ...d }) {
|
|
4916
5082
|
M("AppTablePagination", d);
|
|
4917
|
-
let m = l === "numbered", h = m ?
|
|
5083
|
+
let m = l === "numbered", h = m ? an(e, t) : null;
|
|
4918
5084
|
return /* @__PURE__ */ p("div", {
|
|
4919
5085
|
className: "table-pagination",
|
|
4920
5086
|
children: [
|
|
4921
5087
|
u && /* @__PURE__ */ p("span", {
|
|
4922
5088
|
className: "tpg-rows",
|
|
4923
|
-
children: ["Rows per page:", /* @__PURE__ */ f(
|
|
5089
|
+
children: ["Rows per page:", /* @__PURE__ */ f(un, {
|
|
4924
5090
|
value: n,
|
|
4925
5091
|
onChange: (e) => s(Number(e)),
|
|
4926
5092
|
ariaLabel: "Rows per page",
|
|
@@ -4984,13 +5150,13 @@ function sn({ page: e, totalPages: t, pageSize: n, total: r, firstRow: i, lastRo
|
|
|
4984
5150
|
}
|
|
4985
5151
|
//#endregion
|
|
4986
5152
|
//#region src/components/AppDataTable.jsx
|
|
4987
|
-
function
|
|
5153
|
+
function pn(e) {
|
|
4988
5154
|
return e === "end" ? "wui-cell-end" : e === "num" ? "num" : e === "center" ? "text-center" : "";
|
|
4989
5155
|
}
|
|
4990
|
-
function
|
|
5156
|
+
function mn(e) {
|
|
4991
5157
|
return e == null || e === "" ? "—" : typeof e == "boolean" ? String(e) : e;
|
|
4992
5158
|
}
|
|
4993
|
-
function
|
|
5159
|
+
function hn({ columns: t, rows: n, rowKey: r = (e) => e.id, sort: i, onSort: a, loading: o = !1, skeletonRows: s = 5, empty: c = "No records found.", emptyFiltered: l, sourceCount: m, rowActions: h, rowActionsLabel: g, pagination: _, ariaLabel: v, className: y = "", selectable: b = !1, selectedIds: x, onToggleRow: S, onToggleAll: C, renderExpanded: w, ...T }) {
|
|
4994
5160
|
M("AppDataTable", T);
|
|
4995
5161
|
let E = typeof w == "function", [D, O] = u(() => /* @__PURE__ */ new Set()), k = (e) => O((t) => {
|
|
4996
5162
|
let n = new Set(t);
|
|
@@ -5025,7 +5191,7 @@ function un({ columns: t, rows: n, rowKey: r = (e) => e.id, sort: i, onSort: a,
|
|
|
5025
5191
|
t.map((e, t) => {
|
|
5026
5192
|
let n = !!(e.sortable && a), r = i && i.key === e.key;
|
|
5027
5193
|
return /* @__PURE__ */ p("th", {
|
|
5028
|
-
className: (n ? "sortable " : "") + (t === 0 ? "wui-name-cell " : "") +
|
|
5194
|
+
className: (n ? "sortable " : "") + (t === 0 ? "wui-name-cell " : "") + pn(e.align),
|
|
5029
5195
|
style: e.width ? { width: e.width } : void 0,
|
|
5030
5196
|
tabIndex: n ? 0 : void 0,
|
|
5031
5197
|
"aria-sort": r ? i.dir === "asc" ? "ascending" : "descending" : n ? "none" : void 0,
|
|
@@ -5052,7 +5218,7 @@ function un({ columns: t, rows: n, rowKey: r = (e) => e.id, sort: i, onSort: a,
|
|
|
5052
5218
|
children: "Actions"
|
|
5053
5219
|
})
|
|
5054
5220
|
}))
|
|
5055
|
-
] }) }), /* @__PURE__ */ f("tbody", { children: o ? /* @__PURE__ */ f(
|
|
5221
|
+
] }) }), /* @__PURE__ */ f("tbody", { children: o ? /* @__PURE__ */ f(nn, {
|
|
5056
5222
|
rows: s,
|
|
5057
5223
|
cols: A
|
|
5058
5224
|
}) : n?.length ? n.map((n, i) => {
|
|
@@ -5086,9 +5252,9 @@ function un({ columns: t, rows: n, rowKey: r = (e) => e.id, sort: i, onSort: a,
|
|
|
5086
5252
|
})
|
|
5087
5253
|
}),
|
|
5088
5254
|
t.map((e, t) => /* @__PURE__ */ f("td", {
|
|
5089
|
-
className: (t === 0 ? "wui-name-cell " : "") +
|
|
5255
|
+
className: (t === 0 ? "wui-name-cell " : "") + pn(e.align) + (e.cellClassName ? ` ${e.cellClassName}` : ""),
|
|
5090
5256
|
style: e.cellStyle,
|
|
5091
|
-
children: e.render ? e.render(n) :
|
|
5257
|
+
children: e.render ? e.render(n) : mn(n[e.key])
|
|
5092
5258
|
}, e.key)),
|
|
5093
5259
|
h && /* @__PURE__ */ f("td", { children: /* @__PURE__ */ f("div", {
|
|
5094
5260
|
className: "u-row-actions",
|
|
@@ -5109,7 +5275,7 @@ function un({ columns: t, rows: n, rowKey: r = (e) => e.id, sort: i, onSort: a,
|
|
|
5109
5275
|
children: I
|
|
5110
5276
|
}) }) })]
|
|
5111
5277
|
})
|
|
5112
|
-
}), _ && !o && _.total > 0 && /* @__PURE__ */ f(
|
|
5278
|
+
}), _ && !o && _.total > 0 && /* @__PURE__ */ f(fn, {
|
|
5113
5279
|
page: _.page,
|
|
5114
5280
|
totalPages: _.totalPages,
|
|
5115
5281
|
pageSize: _.pageSize,
|
|
@@ -5122,69 +5288,64 @@ function un({ columns: t, rows: n, rowKey: r = (e) => e.id, sort: i, onSort: a,
|
|
|
5122
5288
|
}
|
|
5123
5289
|
//#endregion
|
|
5124
5290
|
//#region src/components/AppDatePicker.jsx
|
|
5125
|
-
var
|
|
5126
|
-
M("AppDatePicker",
|
|
5127
|
-
let
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
max: d,
|
|
5145
|
-
placeholder: m,
|
|
5146
|
-
size: g || void 0,
|
|
5147
|
-
"first-day": _ == null ? void 0 : String(_),
|
|
5148
|
-
"aria-label": y || (typeof n == "string" ? n : void 0),
|
|
5149
|
-
"aria-describedby": O || k,
|
|
5150
|
-
"aria-invalid": s ? "true" : void 0,
|
|
5151
|
-
disabled: h ? "" : void 0,
|
|
5291
|
+
var gn = r(function({ value: e, onChange: t, label: n, required: r = !1, hint: i, error: a, name: s, min: c, max: l, placeholder: u = "Enter Date", disabled: d, size: m, firstDay: h, id: g, ariaLabel: _, className: v = "", ...y }, b) {
|
|
5292
|
+
M("AppDatePicker", y);
|
|
5293
|
+
let x = o(), S = g || s || x, { setRef: C } = on({
|
|
5294
|
+
ref: b,
|
|
5295
|
+
value: e ?? "",
|
|
5296
|
+
onChange: t
|
|
5297
|
+
}), w = !n && !a && !i, T = a ? `${S}-error` : void 0, E = i ? `${S}-hint` : void 0, D = /* @__PURE__ */ f("wui-datepicker", {
|
|
5298
|
+
ref: C,
|
|
5299
|
+
id: S,
|
|
5300
|
+
name: s,
|
|
5301
|
+
min: c,
|
|
5302
|
+
max: l,
|
|
5303
|
+
placeholder: u,
|
|
5304
|
+
size: m || void 0,
|
|
5305
|
+
"first-day": h == null ? void 0 : String(h),
|
|
5306
|
+
"aria-label": _ || (typeof n == "string" ? n : void 0),
|
|
5307
|
+
"aria-describedby": T || E,
|
|
5308
|
+
"aria-invalid": a ? "true" : void 0,
|
|
5309
|
+
disabled: d ? "" : void 0,
|
|
5152
5310
|
required: r ? "" : void 0,
|
|
5153
|
-
className:
|
|
5311
|
+
className: w && v || void 0,
|
|
5312
|
+
...y
|
|
5154
5313
|
});
|
|
5155
|
-
return
|
|
5156
|
-
className: `field${
|
|
5314
|
+
return w ? D : /* @__PURE__ */ p("div", {
|
|
5315
|
+
className: `field${v ? ` ${v}` : ""}`,
|
|
5157
5316
|
children: [
|
|
5158
5317
|
n && /* @__PURE__ */ p("label", {
|
|
5159
5318
|
className: "label",
|
|
5160
|
-
htmlFor:
|
|
5319
|
+
htmlFor: S,
|
|
5161
5320
|
children: [n, r && /* @__PURE__ */ f(Q, {})]
|
|
5162
5321
|
}),
|
|
5163
|
-
|
|
5164
|
-
|
|
5322
|
+
D,
|
|
5323
|
+
a && /* @__PURE__ */ f("div", {
|
|
5165
5324
|
className: "field-error",
|
|
5166
|
-
id:
|
|
5167
|
-
children:
|
|
5325
|
+
id: T,
|
|
5326
|
+
children: a
|
|
5168
5327
|
}),
|
|
5169
|
-
!
|
|
5328
|
+
!a && i && /* @__PURE__ */ f("div", {
|
|
5170
5329
|
className: "field-hint",
|
|
5171
|
-
id:
|
|
5330
|
+
id: E,
|
|
5172
5331
|
children: i
|
|
5173
5332
|
})
|
|
5174
5333
|
]
|
|
5175
5334
|
});
|
|
5176
|
-
}),
|
|
5335
|
+
}), _n = r(function({ start: e, end: t, onChange: n, label: r, required: i = !1, hint: s, error: c, startName: u, endName: d, min: m, max: h, placeholder: g = "Start – End", disabled: _, size: v, firstDay: y, id: b, ariaLabel: x, className: S = "", ...C }, w) {
|
|
5177
5336
|
M("AppDateRangePicker", C);
|
|
5178
5337
|
let T = l(null), E = (e) => {
|
|
5179
5338
|
T.current = e, typeof w == "function" ? w(e) : w && (w.current = e);
|
|
5180
5339
|
}, D = o(), O = b || u || D;
|
|
5181
5340
|
a(() => {
|
|
5182
|
-
let
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5341
|
+
let n = T.current;
|
|
5342
|
+
if (!n) return;
|
|
5343
|
+
let r = e === void 0 ? n.value.start : e, i = t === void 0 ? n.value.end : t;
|
|
5344
|
+
(n.value.start !== r || n.value.end !== i) && (n.value = {
|
|
5345
|
+
start: r,
|
|
5346
|
+
end: i
|
|
5347
|
+
});
|
|
5348
|
+
}, [e, t]), a(() => {
|
|
5188
5349
|
let e = T.current;
|
|
5189
5350
|
if (!e) return;
|
|
5190
5351
|
let t = () => n?.(e.value);
|
|
@@ -5231,7 +5392,7 @@ var dn = r(function({ value: e, onChange: t, label: n, required: r = !1, hint: i
|
|
|
5231
5392
|
});
|
|
5232
5393
|
//#endregion
|
|
5233
5394
|
//#region src/components/AppDescriptions.jsx
|
|
5234
|
-
function
|
|
5395
|
+
function vn({ items: e = [], columns: t = 2, size: n = "md", bordered: r = !1, title: i, className: a = "", ...o }) {
|
|
5235
5396
|
return M("AppDescriptions", o), /* @__PURE__ */ p("div", {
|
|
5236
5397
|
className: [
|
|
5237
5398
|
"descs",
|
|
@@ -5240,6 +5401,7 @@ function pn({ items: e = [], columns: t = 2, size: n = "md", bordered: r = !1, t
|
|
|
5240
5401
|
r ? "descs-bordered" : "",
|
|
5241
5402
|
a
|
|
5242
5403
|
].filter(Boolean).join(" ") || void 0,
|
|
5404
|
+
...o,
|
|
5243
5405
|
children: [i && /* @__PURE__ */ f("div", {
|
|
5244
5406
|
className: "descs-title",
|
|
5245
5407
|
children: i
|
|
@@ -5264,23 +5426,23 @@ function pn({ items: e = [], columns: t = 2, size: n = "md", bordered: r = !1, t
|
|
|
5264
5426
|
}
|
|
5265
5427
|
//#endregion
|
|
5266
5428
|
//#region src/components/AppDropdown.jsx
|
|
5267
|
-
var
|
|
5268
|
-
function
|
|
5429
|
+
var yn = !1;
|
|
5430
|
+
function bn() {
|
|
5269
5431
|
let e = !0;
|
|
5270
5432
|
try {
|
|
5271
5433
|
e = process.env.NODE_ENV !== "production";
|
|
5272
5434
|
} catch {
|
|
5273
5435
|
e = !0;
|
|
5274
5436
|
}
|
|
5275
|
-
!e ||
|
|
5437
|
+
!e || yn || (yn = !0, console.warn("[@webority/ui-react] <AppDropdown> icon-only toggle has no accessible name — pass `label` or `ariaLabel`."));
|
|
5276
5438
|
}
|
|
5277
|
-
function
|
|
5278
|
-
M("AppDropdown", d), !u && !i && !r &&
|
|
5439
|
+
function xn({ icon: e, iconSize: t, toggleClassName: n, label: r, ariaLabel: i, align: a = "end", items: o = [], menuClassName: s = "", linkComponent: c, children: l, trigger: u, ...d }) {
|
|
5440
|
+
M("AppDropdown", d), !u && !i && !r && bn();
|
|
5279
5441
|
let m = n ?? (u ? "wui-dropdown-trigger" : "topbar-icon-btn");
|
|
5280
5442
|
return /* @__PURE__ */ p(y, {
|
|
5281
5443
|
align: a,
|
|
5282
5444
|
children: [/* @__PURE__ */ f(y.Toggle, {
|
|
5283
|
-
as:
|
|
5445
|
+
as: Sn,
|
|
5284
5446
|
icon: e,
|
|
5285
5447
|
iconSize: t,
|
|
5286
5448
|
btnClassName: m,
|
|
@@ -5315,7 +5477,7 @@ function gn({ icon: e, iconSize: t, toggleClassName: n, label: r, ariaLabel: i,
|
|
|
5315
5477
|
})]
|
|
5316
5478
|
});
|
|
5317
5479
|
}
|
|
5318
|
-
var
|
|
5480
|
+
var Sn = r(function({ icon: e, iconSize: t = 20, btnClassName: n = "topbar-icon-btn", trigger: r, "aria-label": i, className: a, ...o }, s) {
|
|
5319
5481
|
return /* @__PURE__ */ f("button", {
|
|
5320
5482
|
ref: s,
|
|
5321
5483
|
type: "button",
|
|
@@ -5330,16 +5492,16 @@ var _n = r(function({ icon: e, iconSize: t = 20, btnClassName: n = "topbar-icon-
|
|
|
5330
5492
|
});
|
|
5331
5493
|
//#endregion
|
|
5332
5494
|
//#region src/lib/fileItem.js
|
|
5333
|
-
function
|
|
5495
|
+
function Cn(e) {
|
|
5334
5496
|
return e instanceof File ? `${e.name}:${e.size}` : e?.url || e?.name || "item";
|
|
5335
5497
|
}
|
|
5336
|
-
function
|
|
5498
|
+
function wn(e) {
|
|
5337
5499
|
return e instanceof File ? e.name : e?.name;
|
|
5338
5500
|
}
|
|
5339
|
-
function
|
|
5501
|
+
function Tn(e) {
|
|
5340
5502
|
return e instanceof File ? `${(e.size / 1024).toFixed(0)} KB` : null;
|
|
5341
5503
|
}
|
|
5342
|
-
function
|
|
5504
|
+
function En(e, t) {
|
|
5343
5505
|
let [n, r] = u(null);
|
|
5344
5506
|
return a(() => {
|
|
5345
5507
|
if (!t) {
|
|
@@ -5355,8 +5517,8 @@ function xn(e, t) {
|
|
|
5355
5517
|
}
|
|
5356
5518
|
//#endregion
|
|
5357
5519
|
//#region src/lib/FileItemRow.jsx
|
|
5358
|
-
function
|
|
5359
|
-
let i =
|
|
5520
|
+
function Dn({ item: e, isImage: t, onRemove: n, noun: r = "attachment" }) {
|
|
5521
|
+
let i = En(e, t), a = wn(e), o = Tn(e);
|
|
5360
5522
|
return /* @__PURE__ */ p("div", {
|
|
5361
5523
|
className: "attach-item",
|
|
5362
5524
|
children: [
|
|
@@ -5395,15 +5557,15 @@ function Sn({ item: e, isImage: t, onRemove: n, noun: r = "attachment" }) {
|
|
|
5395
5557
|
}
|
|
5396
5558
|
//#endregion
|
|
5397
5559
|
//#region src/components/AppFileAttachment.jsx
|
|
5398
|
-
function
|
|
5560
|
+
function On({ label: e = "Attachment", value: t, name: n, onChange: r, multiple: i = !1, accept: a = ct, maxSizeMb: s = 5, optional: c = !1, error: l, id: m, ...h }) {
|
|
5399
5561
|
M("AppFileAttachment", h);
|
|
5400
|
-
let g = o(), _ = m || n || g, [v, y] = u(""), b = i && Array.isArray(t) ? t : t ? [t] : [], x =
|
|
5562
|
+
let g = o(), _ = m || n || g, [v, y] = u(""), b = i && Array.isArray(t) ? t : t ? [t] : [], x = mt(a), S = (e) => e instanceof File ? pt(e) : x || pt(e), C = !i && b.length === 1 && S(b[0]);
|
|
5401
5563
|
function w(e) {
|
|
5402
5564
|
let n = Array.from(e.target.files || []);
|
|
5403
5565
|
if (e.target.value = "", !n.length) return;
|
|
5404
5566
|
let o = [], c = "";
|
|
5405
5567
|
for (let e of n) {
|
|
5406
|
-
let t =
|
|
5568
|
+
let t = _t(e, {
|
|
5407
5569
|
accept: a,
|
|
5408
5570
|
maxSizeMb: s
|
|
5409
5571
|
});
|
|
@@ -5414,8 +5576,8 @@ function Cn({ label: e = "Attachment", value: t, name: n, onChange: r, multiple:
|
|
|
5414
5576
|
o.push(e);
|
|
5415
5577
|
}
|
|
5416
5578
|
if (y(c), o.length) if (i) {
|
|
5417
|
-
let e = Array.isArray(t) ? t : t ? [t] : [], n = new Set(e.map(
|
|
5418
|
-
r(e.concat(o.filter((e) => !n.has(
|
|
5579
|
+
let e = Array.isArray(t) ? t : t ? [t] : [], n = new Set(e.map(Cn));
|
|
5580
|
+
r(e.concat(o.filter((e) => !n.has(Cn(e)))));
|
|
5419
5581
|
} else r(o[0]);
|
|
5420
5582
|
}
|
|
5421
5583
|
function T(e) {
|
|
@@ -5452,7 +5614,7 @@ function Cn({ label: e = "Attachment", value: t, name: n, onChange: r, multiple:
|
|
|
5452
5614
|
}), /* @__PURE__ */ p("span", {
|
|
5453
5615
|
className: "attach-drop-hint",
|
|
5454
5616
|
children: [
|
|
5455
|
-
|
|
5617
|
+
ht(a),
|
|
5456
5618
|
", up to ",
|
|
5457
5619
|
s,
|
|
5458
5620
|
" MB"
|
|
@@ -5467,23 +5629,24 @@ function Cn({ label: e = "Attachment", value: t, name: n, onChange: r, multiple:
|
|
|
5467
5629
|
}), /* @__PURE__ */ f("input", {
|
|
5468
5630
|
id: _,
|
|
5469
5631
|
type: "file",
|
|
5470
|
-
|
|
5632
|
+
className: "visually-hidden",
|
|
5471
5633
|
name: n,
|
|
5472
5634
|
accept: a,
|
|
5473
5635
|
multiple: i || void 0,
|
|
5474
|
-
onChange: w
|
|
5636
|
+
onChange: w,
|
|
5637
|
+
...h
|
|
5475
5638
|
})] }),
|
|
5476
|
-
C ? /* @__PURE__ */ f(
|
|
5639
|
+
C ? /* @__PURE__ */ f(kn, {
|
|
5477
5640
|
item: b[0],
|
|
5478
5641
|
isImage: !0,
|
|
5479
5642
|
onRemove: () => T(0)
|
|
5480
5643
|
}) : b.length > 0 && /* @__PURE__ */ f("div", {
|
|
5481
5644
|
className: "attach-list",
|
|
5482
|
-
children: b.map((e, t) => /* @__PURE__ */ f(
|
|
5645
|
+
children: b.map((e, t) => /* @__PURE__ */ f(Dn, {
|
|
5483
5646
|
item: e,
|
|
5484
5647
|
isImage: S(e),
|
|
5485
5648
|
onRemove: () => T(t)
|
|
5486
|
-
},
|
|
5649
|
+
}, Cn(e)))
|
|
5487
5650
|
}),
|
|
5488
5651
|
E && /* @__PURE__ */ f("div", {
|
|
5489
5652
|
className: "field-error",
|
|
@@ -5492,8 +5655,8 @@ function Cn({ label: e = "Attachment", value: t, name: n, onChange: r, multiple:
|
|
|
5492
5655
|
]
|
|
5493
5656
|
});
|
|
5494
5657
|
}
|
|
5495
|
-
function
|
|
5496
|
-
let r =
|
|
5658
|
+
function kn({ item: e, isImage: t, onRemove: n }) {
|
|
5659
|
+
let r = En(e, t), i = wn(e), a = Tn(e);
|
|
5497
5660
|
return /* @__PURE__ */ p("div", {
|
|
5498
5661
|
className: "attach-preview",
|
|
5499
5662
|
children: [/* @__PURE__ */ p("div", {
|
|
@@ -5525,18 +5688,18 @@ function wn({ item: e, isImage: t, onRemove: n }) {
|
|
|
5525
5688
|
}
|
|
5526
5689
|
//#endregion
|
|
5527
5690
|
//#region src/components/AppFilePicker.jsx
|
|
5528
|
-
function
|
|
5691
|
+
function An({ label: e, value: t, name: n, onPick: r, multiple: i = !1, maxFiles: s, accept: c = ".jpg,.jpeg,.png", maxSizeMb: d = 5, required: m, error: h, className: g = "", ..._ }) {
|
|
5529
5692
|
M("AppFilePicker", _);
|
|
5530
5693
|
let [v, y] = u(null), [b, x] = u(!1), [S, C] = u(""), w = l(null), T = o(), E = n || T;
|
|
5531
5694
|
a(() => {
|
|
5532
|
-
if (!i && t instanceof File &&
|
|
5695
|
+
if (!i && t instanceof File && pt(t)) {
|
|
5533
5696
|
let e = URL.createObjectURL(t);
|
|
5534
5697
|
return y(e), () => URL.revokeObjectURL(e);
|
|
5535
5698
|
}
|
|
5536
5699
|
y(null);
|
|
5537
5700
|
}, [t, i]);
|
|
5538
|
-
let D = i ? Array.isArray(t) ? t : t ? [t] : [] : [], O = h || S, k =
|
|
5539
|
-
let t =
|
|
5701
|
+
let D = i ? Array.isArray(t) ? t : t ? [t] : [] : [], O = h || S, k = mt(c), A = !i && !!t, j = A && (t instanceof File ? pt(t) : k || pt(t)), N = t?.name, P = j ? t?.url || v : null, F = (e) => {
|
|
5702
|
+
let t = _t(e, {
|
|
5540
5703
|
accept: c,
|
|
5541
5704
|
maxSizeMb: d
|
|
5542
5705
|
});
|
|
@@ -5544,9 +5707,9 @@ function Tn({ label: e, value: t, name: n, onPick: r, multiple: i = !1, maxFiles
|
|
|
5544
5707
|
}, I = (e) => {
|
|
5545
5708
|
let n = Array.from(e || []);
|
|
5546
5709
|
if (!n.length) return;
|
|
5547
|
-
let i = Array.isArray(t) ? t : t ? [t] : [], a = new Set(i.map(
|
|
5710
|
+
let i = Array.isArray(t) ? t : t ? [t] : [], a = new Set(i.map(Cn)), o = "", l = [];
|
|
5548
5711
|
for (let e of n) {
|
|
5549
|
-
let t =
|
|
5712
|
+
let t = _t(e, {
|
|
5550
5713
|
accept: c,
|
|
5551
5714
|
maxSizeMb: d
|
|
5552
5715
|
});
|
|
@@ -5554,7 +5717,7 @@ function Tn({ label: e, value: t, name: n, onPick: r, multiple: i = !1, maxFiles
|
|
|
5554
5717
|
o ||= t;
|
|
5555
5718
|
continue;
|
|
5556
5719
|
}
|
|
5557
|
-
a.has(
|
|
5720
|
+
a.has(Cn(e)) || (a.add(Cn(e)), l.push(e));
|
|
5558
5721
|
}
|
|
5559
5722
|
let u = i.concat(l);
|
|
5560
5723
|
s && u.length > s && (u = u.slice(0, s), o ||= `Up to ${s} files.`), C(o), r(u);
|
|
@@ -5581,11 +5744,12 @@ function Tn({ label: e, value: t, name: n, onPick: r, multiple: i = !1, maxFiles
|
|
|
5581
5744
|
type: "file",
|
|
5582
5745
|
accept: c,
|
|
5583
5746
|
multiple: i || void 0,
|
|
5584
|
-
|
|
5747
|
+
className: "visually-hidden",
|
|
5585
5748
|
onClick: (e) => {
|
|
5586
5749
|
e.currentTarget.value = "";
|
|
5587
5750
|
},
|
|
5588
|
-
onChange: R
|
|
5751
|
+
onChange: R,
|
|
5752
|
+
..._
|
|
5589
5753
|
});
|
|
5590
5754
|
return /* @__PURE__ */ p("div", {
|
|
5591
5755
|
className: `field${g ? ` ${g}` : ""}`,
|
|
@@ -5675,7 +5839,7 @@ function Tn({ label: e, value: t, name: n, onPick: r, multiple: i = !1, maxFiles
|
|
|
5675
5839
|
/* @__PURE__ */ p("span", {
|
|
5676
5840
|
className: "file-input-text",
|
|
5677
5841
|
children: [
|
|
5678
|
-
|
|
5842
|
+
ht(c),
|
|
5679
5843
|
" · up to ",
|
|
5680
5844
|
d,
|
|
5681
5845
|
" MB"
|
|
@@ -5686,12 +5850,12 @@ function Tn({ label: e, value: t, name: n, onPick: r, multiple: i = !1, maxFiles
|
|
|
5686
5850
|
V,
|
|
5687
5851
|
i && D.length > 0 && /* @__PURE__ */ f("div", {
|
|
5688
5852
|
className: "attach-list",
|
|
5689
|
-
children: D.map((e, t) => /* @__PURE__ */ f(
|
|
5853
|
+
children: D.map((e, t) => /* @__PURE__ */ f(Dn, {
|
|
5690
5854
|
item: e,
|
|
5691
|
-
isImage: e instanceof File ?
|
|
5855
|
+
isImage: e instanceof File ? pt(e) : k || pt(e),
|
|
5692
5856
|
noun: "file",
|
|
5693
5857
|
onRemove: () => B(t)
|
|
5694
|
-
},
|
|
5858
|
+
}, Cn(e)))
|
|
5695
5859
|
})
|
|
5696
5860
|
]
|
|
5697
5861
|
}),
|
|
@@ -5704,7 +5868,7 @@ function Tn({ label: e, value: t, name: n, onPick: r, multiple: i = !1, maxFiles
|
|
|
5704
5868
|
}
|
|
5705
5869
|
//#endregion
|
|
5706
5870
|
//#region src/components/AppFormActions.jsx
|
|
5707
|
-
function
|
|
5871
|
+
function jn({ children: e, sticky: t = !1, align: n = "end", className: r = "", ...i }) {
|
|
5708
5872
|
return M("AppFormActions", i), /* @__PURE__ */ f("div", {
|
|
5709
5873
|
className: [
|
|
5710
5874
|
"form-actions",
|
|
@@ -5712,23 +5876,31 @@ function En({ children: e, sticky: t = !1, align: n = "end", className: r = "",
|
|
|
5712
5876
|
n && n !== "end" ? `form-actions-${n}` : "",
|
|
5713
5877
|
r
|
|
5714
5878
|
].filter(Boolean).join(" "),
|
|
5879
|
+
...i,
|
|
5715
5880
|
children: e
|
|
5716
5881
|
});
|
|
5717
5882
|
}
|
|
5718
5883
|
//#endregion
|
|
5719
5884
|
//#region src/components/AppFormRow.jsx
|
|
5720
|
-
function
|
|
5721
|
-
|
|
5885
|
+
function Mn({ children: e, columns: t = 2, className: n = "", ...r }) {
|
|
5886
|
+
M("AppFormRow", r);
|
|
5887
|
+
let { style: i, ...a } = r;
|
|
5888
|
+
return /* @__PURE__ */ f("div", {
|
|
5722
5889
|
className: ["form-row-grid", n].filter(Boolean).join(" "),
|
|
5723
|
-
style: {
|
|
5890
|
+
style: {
|
|
5891
|
+
"--form-cols": t,
|
|
5892
|
+
...i
|
|
5893
|
+
},
|
|
5894
|
+
...a,
|
|
5724
5895
|
children: e
|
|
5725
5896
|
});
|
|
5726
5897
|
}
|
|
5727
5898
|
//#endregion
|
|
5728
5899
|
//#region src/components/AppFormSection.jsx
|
|
5729
|
-
function
|
|
5900
|
+
function Nn({ children: e, title: t, description: n, className: r = "", ...i }) {
|
|
5730
5901
|
return M("AppFormSection", i), /* @__PURE__ */ p("section", {
|
|
5731
5902
|
className: ["form-section", r].filter(Boolean).join(" "),
|
|
5903
|
+
...i,
|
|
5732
5904
|
children: [(t != null || n != null) && /* @__PURE__ */ p("div", {
|
|
5733
5905
|
className: "form-section-head",
|
|
5734
5906
|
children: [t != null && /* @__PURE__ */ f("h3", {
|
|
@@ -5746,9 +5918,10 @@ function On({ children: e, title: t, description: n, className: r = "", ...i })
|
|
|
5746
5918
|
}
|
|
5747
5919
|
//#endregion
|
|
5748
5920
|
//#region src/components/AppInfoList.jsx
|
|
5749
|
-
function
|
|
5921
|
+
function Pn({ items: e = [], className: t = "", ...n }) {
|
|
5750
5922
|
return M("AppInfoList", n), /* @__PURE__ */ f("div", {
|
|
5751
5923
|
className: `info-list${t ? ` ${t}` : ""}`,
|
|
5924
|
+
...n,
|
|
5752
5925
|
children: e.map((e, t) => {
|
|
5753
5926
|
let n = e.value == null || e.value === "", r = /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("span", {
|
|
5754
5927
|
className: "info-icon",
|
|
@@ -5776,20 +5949,20 @@ function kn({ items: e = [], className: t = "", ...n }) {
|
|
|
5776
5949
|
}
|
|
5777
5950
|
//#endregion
|
|
5778
5951
|
//#region src/components/AppKpiTile.jsx
|
|
5779
|
-
var
|
|
5780
|
-
function
|
|
5781
|
-
if (!e || e.length < 2) return `0,${
|
|
5782
|
-
let t = Math.min(...e), n = Math.max(...e) - t, r =
|
|
5783
|
-
return e.map((e, i) => `${i * r},${n === 0 ?
|
|
5952
|
+
var Fn = 48, In = 16;
|
|
5953
|
+
function Ln(e) {
|
|
5954
|
+
if (!e || e.length < 2) return `0,${In / 2} ${Fn},${In / 2}`;
|
|
5955
|
+
let t = Math.min(...e), n = Math.max(...e) - t, r = Fn / (e.length - 1);
|
|
5956
|
+
return e.map((e, i) => `${i * r},${n === 0 ? In / 2 : In - (e - t) / n * In}`).join(" ");
|
|
5784
5957
|
}
|
|
5785
|
-
function
|
|
5958
|
+
function Rn(e) {
|
|
5786
5959
|
if (typeof e != "string") return "flat";
|
|
5787
5960
|
let t = e.trim();
|
|
5788
5961
|
return t.startsWith("+") ? "up" : t.startsWith("-") || t.startsWith("−") ? "down" : "flat";
|
|
5789
5962
|
}
|
|
5790
|
-
function
|
|
5963
|
+
function zn({ label: e, value: t, icon: n, iconTone: r, delta: i, deltaDirection: a, sparkline: o, variant: s = "plain", size: c = "md", inline: l = !1, attention: u = !1, href: d, linkComponent: m, className: h = "", ...g }) {
|
|
5791
5964
|
M("AppKpiTile", g);
|
|
5792
|
-
let _ = `kpi${l ? " kpi-inline" : ""}${s === "filled" ? " kpi-filled" : s === "accent" ? " kpi-accent" : ""}${c === "lg" ? " kpi-lg" : ""}${u ? " kpi-attention" : ""}${h ? ` ${h}` : ""}`, v = a ??
|
|
5965
|
+
let _ = `kpi${l ? " kpi-inline" : ""}${s === "filled" ? " kpi-filled" : s === "accent" ? " kpi-accent" : ""}${c === "lg" ? " kpi-lg" : ""}${u ? " kpi-attention" : ""}${h ? ` ${h}` : ""}`, v = a ?? Rn(i), y = v === "up" ? "arrow-up" : v === "down" ? "arrow-down" : null, b = {};
|
|
5793
5966
|
return d != null && (b = m ? {
|
|
5794
5967
|
as: m,
|
|
5795
5968
|
to: d
|
|
@@ -5798,6 +5971,7 @@ function Pn({ label: e, value: t, icon: n, iconTone: r, delta: i, deltaDirection
|
|
|
5798
5971
|
href: d
|
|
5799
5972
|
}), /* @__PURE__ */ p(b.as || "div", {
|
|
5800
5973
|
className: _,
|
|
5974
|
+
...g,
|
|
5801
5975
|
...b,
|
|
5802
5976
|
children: [
|
|
5803
5977
|
n && /* @__PURE__ */ f("span", {
|
|
@@ -5821,12 +5995,12 @@ function Pn({ label: e, value: t, icon: n, iconTone: r, delta: i, deltaDirection
|
|
|
5821
5995
|
}),
|
|
5822
5996
|
o && o.length > 0 && /* @__PURE__ */ f("svg", {
|
|
5823
5997
|
className: "kpi-sparkline",
|
|
5824
|
-
width:
|
|
5825
|
-
height:
|
|
5826
|
-
viewBox: `0 0 ${
|
|
5998
|
+
width: Fn,
|
|
5999
|
+
height: In,
|
|
6000
|
+
viewBox: `0 0 ${Fn} ${In}`,
|
|
5827
6001
|
"aria-hidden": "true",
|
|
5828
6002
|
children: /* @__PURE__ */ f("polyline", {
|
|
5829
|
-
points:
|
|
6003
|
+
points: Ln(o),
|
|
5830
6004
|
stroke: "currentColor",
|
|
5831
6005
|
fill: "none"
|
|
5832
6006
|
})
|
|
@@ -5836,12 +6010,12 @@ function Pn({ label: e, value: t, icon: n, iconTone: r, delta: i, deltaDirection
|
|
|
5836
6010
|
}
|
|
5837
6011
|
//#endregion
|
|
5838
6012
|
//#region src/components/AppLogoPicker.jsx
|
|
5839
|
-
var
|
|
6013
|
+
var Bn = {
|
|
5840
6014
|
sm: 72,
|
|
5841
6015
|
md: 120,
|
|
5842
6016
|
lg: 160
|
|
5843
6017
|
};
|
|
5844
|
-
function
|
|
6018
|
+
function Vn({ value: e, fallback: t, name: n, onPick: r, onRemove: i, loading: s = !1, disabled: c = !1, accept: d = "image/png,image/jpeg,image/webp", maxSizeMb: m = 5, overlayIcon: h = "image", overlayLabel: g = "Update photo", ariaLabel: _ = "Upload photo", label: v, hint: y, error: b, required: x = !1, variant: S = "initials", size: C = "md", shape: w = "circle", className: T = "", ...E }) {
|
|
5845
6019
|
M("AppLogoPicker", E);
|
|
5846
6020
|
let D = l(null), O = o(), k = n || O, [A, j] = u(null), [N, P] = u(""), [F, I] = u(!1), [R, z] = u(!1);
|
|
5847
6021
|
a(() => () => A && URL.revokeObjectURL(A), [A]), a(() => {
|
|
@@ -5850,7 +6024,7 @@ function In({ value: e, fallback: t, name: n, onPick: r, onRemove: i, loading: s
|
|
|
5850
6024
|
let B = s || c, ee = A || (e && !F ? e : null), V = b || N, te = !B && (!!A || !!ee && !!i), H = () => {
|
|
5851
6025
|
B || D.current?.click();
|
|
5852
6026
|
}, ne = (e) => {
|
|
5853
|
-
let t =
|
|
6027
|
+
let t = _t(e, {
|
|
5854
6028
|
accept: d,
|
|
5855
6029
|
maxSizeMb: m
|
|
5856
6030
|
});
|
|
@@ -5868,7 +6042,7 @@ function In({ value: e, fallback: t, name: n, onPick: r, onRemove: i, loading: s
|
|
|
5868
6042
|
t && ne(t);
|
|
5869
6043
|
}, ae = () => {
|
|
5870
6044
|
j(null), P(""), I(!1), D.current && (D.current.value = ""), i?.();
|
|
5871
|
-
}, oe = typeof C == "number" ? C :
|
|
6045
|
+
}, oe = typeof C == "number" ? C : Bn[C] ?? Bn.md, U = Math.max(14, Math.round(oe * .18)), se = Math.round(oe * .5), ce = [
|
|
5872
6046
|
"set-uploader",
|
|
5873
6047
|
S === "avatar" ? "set-uploader--avatar" : "",
|
|
5874
6048
|
w === "rounded" ? "set-uploader--rounded" : w === "square" ? "set-uploader--square" : "",
|
|
@@ -5887,7 +6061,7 @@ function In({ value: e, fallback: t, name: n, onPick: r, onRemove: i, loading: s
|
|
|
5887
6061
|
children: [
|
|
5888
6062
|
/* @__PURE__ */ f("button", {
|
|
5889
6063
|
type: "button",
|
|
5890
|
-
className:
|
|
6064
|
+
className: ce,
|
|
5891
6065
|
style: { "--wui-logo-size": `${oe}px` },
|
|
5892
6066
|
"aria-busy": s || void 0,
|
|
5893
6067
|
disabled: B,
|
|
@@ -5900,6 +6074,7 @@ function In({ value: e, fallback: t, name: n, onPick: r, onRemove: i, loading: s
|
|
|
5900
6074
|
e.preventDefault(), z(!1);
|
|
5901
6075
|
},
|
|
5902
6076
|
onDrop: ie,
|
|
6077
|
+
...E,
|
|
5903
6078
|
children: /* @__PURE__ */ p("span", {
|
|
5904
6079
|
className: "set-uploader-ring",
|
|
5905
6080
|
children: [ee ? /* @__PURE__ */ f("img", {
|
|
@@ -5911,7 +6086,7 @@ function In({ value: e, fallback: t, name: n, onPick: r, onRemove: i, loading: s
|
|
|
5911
6086
|
className: "set-uploader-logo",
|
|
5912
6087
|
children: t || S === "avatar" && /* @__PURE__ */ f(L, {
|
|
5913
6088
|
name: "person",
|
|
5914
|
-
size:
|
|
6089
|
+
size: se
|
|
5915
6090
|
})
|
|
5916
6091
|
}), s ? /* @__PURE__ */ f("span", {
|
|
5917
6092
|
className: "set-uploader-overlay is-loading",
|
|
@@ -5967,27 +6142,27 @@ function In({ value: e, fallback: t, name: n, onPick: r, onRemove: i, loading: s
|
|
|
5967
6142
|
}
|
|
5968
6143
|
//#endregion
|
|
5969
6144
|
//#region src/components/AppMeter.jsx
|
|
5970
|
-
var
|
|
6145
|
+
var Hn = [
|
|
5971
6146
|
"info",
|
|
5972
6147
|
"success",
|
|
5973
6148
|
"warning",
|
|
5974
6149
|
"danger",
|
|
5975
6150
|
"neutral"
|
|
5976
6151
|
];
|
|
5977
|
-
function
|
|
6152
|
+
function Un(e, t, n) {
|
|
5978
6153
|
let r = n - t;
|
|
5979
6154
|
if (!(r > 0)) return 0;
|
|
5980
6155
|
let i = Math.min(100, Math.max(0, (e - t) / r * 100));
|
|
5981
6156
|
return Number(i.toFixed(2));
|
|
5982
6157
|
}
|
|
5983
|
-
function
|
|
6158
|
+
function Wn(e, t, n, r, i) {
|
|
5984
6159
|
if (t == null && n == null) return i;
|
|
5985
6160
|
let a = "mid";
|
|
5986
6161
|
return t != null && e <= t ? a = "low" : n != null && e >= n && (a = "high"), r === "low" ? a === "low" ? "success" : a === "high" ? "danger" : "warning" : a === "high" ? "success" : a === "low" ? "danger" : "warning";
|
|
5987
6162
|
}
|
|
5988
|
-
function
|
|
6163
|
+
function Gn({ value: e = 0, min: t = 0, max: n = 100, tone: r = "info", optimum: i = "high", low: a, high: o, size: s = "md", label: c, showLabel: l = !1, className: u = "", ...d }) {
|
|
5989
6164
|
M("AppMeter", d);
|
|
5990
|
-
let p =
|
|
6165
|
+
let p = jt(r), m = Wn(e, a, o, i, Hn.includes(p) ? p : "info"), h = Un(e, t, n);
|
|
5991
6166
|
return /* @__PURE__ */ f("div", {
|
|
5992
6167
|
className: `progress${s === "sm" ? " progress-sm" : ""}${u ? ` ${u}` : ""}`,
|
|
5993
6168
|
role: "meter",
|
|
@@ -5995,21 +6170,24 @@ function Bn({ value: e = 0, min: t = 0, max: n = 100, tone: r = "info", optimum:
|
|
|
5995
6170
|
"aria-valuemin": t,
|
|
5996
6171
|
"aria-valuemax": n,
|
|
5997
6172
|
"aria-label": c || void 0,
|
|
6173
|
+
...d,
|
|
5998
6174
|
children: /* @__PURE__ */ f("div", {
|
|
5999
|
-
className: `progress-bar wui-progress-${
|
|
6000
|
-
style: { width: `${
|
|
6175
|
+
className: `progress-bar wui-progress-${m}`,
|
|
6176
|
+
style: { width: `${h}%` },
|
|
6001
6177
|
children: l && c
|
|
6002
6178
|
})
|
|
6003
6179
|
});
|
|
6004
6180
|
}
|
|
6005
6181
|
//#endregion
|
|
6006
6182
|
//#region src/components/AppMultiSelect.jsx
|
|
6007
|
-
var
|
|
6183
|
+
var Kn = r(function({ values: e, onChange: t, options: n, placeholder: r = "Select…", searchPlaceholder: i = "Search…", searchable: s = !0, disabled: c = !1, icon: u, size: d, collapseChips: m = !1, name: h, label: g, error: _, hint: v, required: y = !1, help: b, helpLabel: x = "More information", fieldClassName: S = "", ...C }, w) {
|
|
6008
6184
|
M("AppMultiSelect", C);
|
|
6009
6185
|
let T = l(null), E = o(), D = h || E;
|
|
6010
6186
|
return a(() => {
|
|
6011
6187
|
let e = T.current;
|
|
6012
|
-
|
|
6188
|
+
if (!e) return;
|
|
6189
|
+
let t = n || [];
|
|
6190
|
+
ln(t, e.options) || (e.options = t);
|
|
6013
6191
|
}, [n]), a(() => {
|
|
6014
6192
|
let t = T.current;
|
|
6015
6193
|
if (!t) return;
|
|
@@ -6029,7 +6207,7 @@ var Vn = r(function({ values: e, onChange: t, options: n, placeholder: r = "Sele
|
|
|
6029
6207
|
children: [
|
|
6030
6208
|
g,
|
|
6031
6209
|
y && /* @__PURE__ */ f(Q, {}),
|
|
6032
|
-
b && /* @__PURE__ */ f(
|
|
6210
|
+
b && /* @__PURE__ */ f(yt, {
|
|
6033
6211
|
label: x,
|
|
6034
6212
|
children: b
|
|
6035
6213
|
})
|
|
@@ -6051,7 +6229,8 @@ var Vn = r(function({ values: e, onChange: t, options: n, placeholder: r = "Sele
|
|
|
6051
6229
|
"collapse-chips": m ? "" : void 0,
|
|
6052
6230
|
searchable: s ? "" : void 0,
|
|
6053
6231
|
disabled: c ? "" : void 0,
|
|
6054
|
-
required: y ? "" : void 0
|
|
6232
|
+
required: y ? "" : void 0,
|
|
6233
|
+
...C
|
|
6055
6234
|
}),
|
|
6056
6235
|
_ ? /* @__PURE__ */ f("div", {
|
|
6057
6236
|
className: "field-error",
|
|
@@ -6064,9 +6243,9 @@ var Vn = r(function({ values: e, onChange: t, options: n, placeholder: r = "Sele
|
|
|
6064
6243
|
}) : null
|
|
6065
6244
|
]
|
|
6066
6245
|
});
|
|
6067
|
-
}),
|
|
6246
|
+
}), qn = r(function({ label: e, required: t = !1, error: n, hint: r, value: i, onChange: s, min: c, max: l, step: d = 1, precision: m = 0, unit: h, size: g = "md", id: _, name: v, className: y = "", fieldClassName: x = "", disabled: S = !1, ...C }, w) {
|
|
6068
6247
|
M("AppNumberInput", C);
|
|
6069
|
-
let T = o(), E = _ ||
|
|
6248
|
+
let T = o(), E = _ || T, D = (e) => {
|
|
6070
6249
|
if (m === 0) return Math.round(e);
|
|
6071
6250
|
let t = 10 ** m;
|
|
6072
6251
|
return Math.round(e * t) / t;
|
|
@@ -6082,21 +6261,21 @@ var Vn = r(function({ values: e, onChange: t, options: n, placeholder: r = "Sele
|
|
|
6082
6261
|
j(i ?? "");
|
|
6083
6262
|
}, [i]);
|
|
6084
6263
|
let N = (e) => {
|
|
6085
|
-
let t = (k(
|
|
6264
|
+
let t = (k(A) ?? O(0)) + e * d, n = O(D(t));
|
|
6086
6265
|
j(String(n)), s?.(n);
|
|
6087
|
-
}, P = S || typeof c == "number" &&
|
|
6266
|
+
}, P = k(A), F = S || P !== null && typeof c == "number" && P <= c, I = S || P !== null && typeof l == "number" && P >= l, R = n && E ? `${E}-error` : void 0, z = r && E ? `${E}-hint` : void 0, B = R || z, ee = [
|
|
6088
6267
|
"input",
|
|
6089
6268
|
g === "sm" ? "input-sm" : "",
|
|
6090
6269
|
g === "lg" ? "input-lg" : "",
|
|
6091
6270
|
n ? "error" : "",
|
|
6092
6271
|
"num-input",
|
|
6093
6272
|
y
|
|
6094
|
-
].filter(Boolean).join(" "),
|
|
6273
|
+
].filter(Boolean).join(" "), V = (e) => {
|
|
6095
6274
|
let t = e.target.value;
|
|
6096
6275
|
j(t);
|
|
6097
6276
|
let n = k(t);
|
|
6098
6277
|
n !== null && s?.(n);
|
|
6099
|
-
},
|
|
6278
|
+
}, te = (e) => {
|
|
6100
6279
|
let t = k(e.target.value);
|
|
6101
6280
|
if (t === null) j(""), s?.("");
|
|
6102
6281
|
else {
|
|
@@ -6104,25 +6283,25 @@ var Vn = r(function({ values: e, onChange: t, options: n, placeholder: r = "Sele
|
|
|
6104
6283
|
j(String(e)), s?.(e);
|
|
6105
6284
|
}
|
|
6106
6285
|
C.onBlur?.(e);
|
|
6107
|
-
},
|
|
6286
|
+
}, H = (e) => {
|
|
6108
6287
|
e.key === "ArrowUp" ? (e.preventDefault(), N(1)) : e.key === "ArrowDown" && (e.preventDefault(), N(-1)), C.onKeyDown?.(e);
|
|
6109
|
-
},
|
|
6288
|
+
}, ne = /* @__PURE__ */ f(b.Control, {
|
|
6110
6289
|
...C,
|
|
6111
6290
|
id: E,
|
|
6112
6291
|
name: v,
|
|
6113
6292
|
type: "text",
|
|
6114
6293
|
inputMode: m > 0 ? "decimal" : "numeric",
|
|
6115
|
-
className:
|
|
6294
|
+
className: ee,
|
|
6116
6295
|
disabled: S,
|
|
6117
6296
|
required: t,
|
|
6118
6297
|
"aria-invalid": n ? "true" : "false",
|
|
6119
|
-
"aria-describedby":
|
|
6298
|
+
"aria-describedby": B,
|
|
6120
6299
|
value: A,
|
|
6121
6300
|
ref: w,
|
|
6122
|
-
onChange:
|
|
6123
|
-
onBlur:
|
|
6124
|
-
onKeyDown:
|
|
6125
|
-
}),
|
|
6301
|
+
onChange: V,
|
|
6302
|
+
onBlur: te,
|
|
6303
|
+
onKeyDown: H
|
|
6304
|
+
}), re = /* @__PURE__ */ p("div", {
|
|
6126
6305
|
className: "num-wrap",
|
|
6127
6306
|
children: [
|
|
6128
6307
|
/* @__PURE__ */ f("button", {
|
|
@@ -6130,14 +6309,14 @@ var Vn = r(function({ values: e, onChange: t, options: n, placeholder: r = "Sele
|
|
|
6130
6309
|
className: "num-btn",
|
|
6131
6310
|
"aria-label": "Decrease",
|
|
6132
6311
|
tabIndex: -1,
|
|
6133
|
-
disabled:
|
|
6312
|
+
disabled: F,
|
|
6134
6313
|
onClick: () => N(-1),
|
|
6135
6314
|
children: /* @__PURE__ */ f(L, {
|
|
6136
6315
|
name: "minus",
|
|
6137
6316
|
size: 16
|
|
6138
6317
|
})
|
|
6139
6318
|
}),
|
|
6140
|
-
|
|
6319
|
+
ne,
|
|
6141
6320
|
h && /* @__PURE__ */ f("span", {
|
|
6142
6321
|
className: "affix",
|
|
6143
6322
|
children: h
|
|
@@ -6147,7 +6326,7 @@ var Vn = r(function({ values: e, onChange: t, options: n, placeholder: r = "Sele
|
|
|
6147
6326
|
className: "num-btn",
|
|
6148
6327
|
"aria-label": "Increase",
|
|
6149
6328
|
tabIndex: -1,
|
|
6150
|
-
disabled:
|
|
6329
|
+
disabled: I,
|
|
6151
6330
|
onClick: () => N(1),
|
|
6152
6331
|
children: /* @__PURE__ */ f(L, {
|
|
6153
6332
|
name: "plus",
|
|
@@ -6164,21 +6343,21 @@ var Vn = r(function({ values: e, onChange: t, options: n, placeholder: r = "Sele
|
|
|
6164
6343
|
htmlFor: E,
|
|
6165
6344
|
children: [e, t && /* @__PURE__ */ f(Q, {})]
|
|
6166
6345
|
}),
|
|
6167
|
-
|
|
6346
|
+
re,
|
|
6168
6347
|
n ? /* @__PURE__ */ f("div", {
|
|
6169
6348
|
className: "field-error",
|
|
6170
|
-
id:
|
|
6349
|
+
id: R,
|
|
6171
6350
|
children: n
|
|
6172
6351
|
}) : r ? /* @__PURE__ */ f("div", {
|
|
6173
6352
|
className: "field-hint",
|
|
6174
|
-
id:
|
|
6353
|
+
id: z,
|
|
6175
6354
|
children: r
|
|
6176
6355
|
}) : null
|
|
6177
6356
|
]
|
|
6178
6357
|
});
|
|
6179
|
-
}),
|
|
6358
|
+
}), Jn = r(function({ value: e, onChange: t, onComplete: n, length: r = 6, mode: i = "numeric", label: s, required: c = !1, hint: u, error: d, disabled: m = !1, name: h, id: g, className: _ = "", ...v }, y) {
|
|
6180
6359
|
M("AppOtpInput", v);
|
|
6181
|
-
let b = l(null), x = o(), S = g ||
|
|
6360
|
+
let b = l(null), x = o(), S = g || x, C = (e) => {
|
|
6182
6361
|
b.current = e, typeof y == "function" ? y(e) : y && (y.current = e);
|
|
6183
6362
|
};
|
|
6184
6363
|
a(() => {
|
|
@@ -6201,7 +6380,8 @@ var Vn = r(function({ values: e, onChange: t, options: n, placeholder: r = "Sele
|
|
|
6201
6380
|
mode: i,
|
|
6202
6381
|
"aria-invalid": d ? "true" : void 0,
|
|
6203
6382
|
disabled: m ? "" : void 0,
|
|
6204
|
-
required: c ? "" : void 0
|
|
6383
|
+
required: c ? "" : void 0,
|
|
6384
|
+
...v
|
|
6205
6385
|
});
|
|
6206
6386
|
return !s && !d && !u ? w : /* @__PURE__ */ p("div", {
|
|
6207
6387
|
className: `field${_ ? ` ${_}` : ""}`,
|
|
@@ -6225,7 +6405,7 @@ var Vn = r(function({ values: e, onChange: t, options: n, placeholder: r = "Sele
|
|
|
6225
6405
|
});
|
|
6226
6406
|
//#endregion
|
|
6227
6407
|
//#region src/components/AppPageHeader.jsx
|
|
6228
|
-
function
|
|
6408
|
+
function Yn({ title: e, subtitle: t, eyebrow: n, icon: r, tone: i = "primary", status: a, breadcrumbs: o, actions: s, size: c = "md", align: l = "start", divider: u = !1, sticky: d = !1, className: m = "", ...h }) {
|
|
6229
6409
|
M("AppPageHeader", h);
|
|
6230
6410
|
let g = [
|
|
6231
6411
|
"page-header",
|
|
@@ -6241,6 +6421,7 @@ function Wn({ title: e, subtitle: t, eyebrow: n, icon: r, tone: i = "primary", s
|
|
|
6241
6421
|
}) : r;
|
|
6242
6422
|
return /* @__PURE__ */ p("div", {
|
|
6243
6423
|
className: g,
|
|
6424
|
+
...h,
|
|
6244
6425
|
children: [o != null && /* @__PURE__ */ f("div", {
|
|
6245
6426
|
className: "page-breadcrumbs",
|
|
6246
6427
|
children: o
|
|
@@ -6283,9 +6464,9 @@ function Wn({ title: e, subtitle: t, eyebrow: n, icon: r, tone: i = "primary", s
|
|
|
6283
6464
|
}
|
|
6284
6465
|
//#endregion
|
|
6285
6466
|
//#region src/components/AppPagination.jsx
|
|
6286
|
-
function
|
|
6467
|
+
function Xn({ page: e, totalPages: t, onChange: n, siblings: r = 1, size: i = "md", ariaLabel: a = "Pagination", className: o, ...s }) {
|
|
6287
6468
|
if (M("AppPagination", s), t <= 1) return null;
|
|
6288
|
-
let c =
|
|
6469
|
+
let c = an(e, t, { siblingCount: r });
|
|
6289
6470
|
return /* @__PURE__ */ f("nav", {
|
|
6290
6471
|
className: [
|
|
6291
6472
|
"pagination-nav",
|
|
@@ -6293,6 +6474,7 @@ function Gn({ page: e, totalPages: t, onChange: n, siblings: r = 1, size: i = "m
|
|
|
6293
6474
|
o
|
|
6294
6475
|
].filter(Boolean).join(" "),
|
|
6295
6476
|
"aria-label": a,
|
|
6477
|
+
...s,
|
|
6296
6478
|
children: /* @__PURE__ */ p("ul", {
|
|
6297
6479
|
className: "pagination",
|
|
6298
6480
|
children: [
|
|
@@ -6342,7 +6524,7 @@ function Gn({ page: e, totalPages: t, onChange: n, siblings: r = 1, size: i = "m
|
|
|
6342
6524
|
}
|
|
6343
6525
|
//#endregion
|
|
6344
6526
|
//#region src/components/AppPhoneNumberInput.jsx
|
|
6345
|
-
var
|
|
6527
|
+
var Zn = r(function({ value: e, onChange: t, country: n, disabled: r = !1, name: i, label: s = "Phone number", placeholder: c, required: u = !1, error: d, fieldClassName: m = "", ...h }, g) {
|
|
6346
6528
|
M("AppPhoneNumberInput", h);
|
|
6347
6529
|
let _ = l(null), v = (e) => {
|
|
6348
6530
|
_.current = e, typeof g == "function" ? g(e) : g && (g.current = e);
|
|
@@ -6371,7 +6553,8 @@ var Kn = r(function({ value: e, onChange: t, country: n, disabled: r = !1, name:
|
|
|
6371
6553
|
country: n,
|
|
6372
6554
|
placeholder: c,
|
|
6373
6555
|
required: u ? "" : void 0,
|
|
6374
|
-
disabled: r ? "" : void 0
|
|
6556
|
+
disabled: r ? "" : void 0,
|
|
6557
|
+
...h
|
|
6375
6558
|
}),
|
|
6376
6559
|
d && /* @__PURE__ */ f("div", {
|
|
6377
6560
|
className: "field-error",
|
|
@@ -6383,7 +6566,7 @@ var Kn = r(function({ value: e, onChange: t, country: n, disabled: r = !1, name:
|
|
|
6383
6566
|
});
|
|
6384
6567
|
//#endregion
|
|
6385
6568
|
//#region src/components/AppPopover.jsx
|
|
6386
|
-
function
|
|
6569
|
+
function Qn({ trigger: e, children: n, title: r, placement: i = "bottom", triggerType: a = "click", className: s = "", ...c }) {
|
|
6387
6570
|
M("AppPopover", c);
|
|
6388
6571
|
let l = o(), [d, m] = u(!1);
|
|
6389
6572
|
return /* @__PURE__ */ f(C, {
|
|
@@ -6404,7 +6587,7 @@ function qn({ trigger: e, children: n, title: r, placement: i = "bottom", trigge
|
|
|
6404
6587
|
}
|
|
6405
6588
|
//#endregion
|
|
6406
6589
|
//#region src/components/AppPricingCard.jsx
|
|
6407
|
-
function
|
|
6590
|
+
function $n({ name: e, price: t, unit: n, tagline: r, features: i = [], cta: a, featured: o = !1, current: s = !1, badge: c = "Most popular", className: l = "", ...u }) {
|
|
6408
6591
|
return M("AppPricingCard", u), /* @__PURE__ */ p("div", {
|
|
6409
6592
|
className: [
|
|
6410
6593
|
"plan-card",
|
|
@@ -6412,6 +6595,7 @@ function Jn({ name: e, price: t, unit: n, tagline: r, features: i = [], cta: a,
|
|
|
6412
6595
|
s ? "current" : "",
|
|
6413
6596
|
l
|
|
6414
6597
|
].filter(Boolean).join(" "),
|
|
6598
|
+
...u,
|
|
6415
6599
|
children: [
|
|
6416
6600
|
o && c && /* @__PURE__ */ f("span", {
|
|
6417
6601
|
className: "plan-badge",
|
|
@@ -6457,44 +6641,45 @@ function Jn({ name: e, price: t, unit: n, tagline: r, features: i = [], cta: a,
|
|
|
6457
6641
|
}
|
|
6458
6642
|
//#endregion
|
|
6459
6643
|
//#region src/components/AppProgress.jsx
|
|
6460
|
-
var
|
|
6644
|
+
var er = [
|
|
6461
6645
|
"info",
|
|
6462
6646
|
"success",
|
|
6463
6647
|
"warning",
|
|
6464
6648
|
"danger",
|
|
6465
6649
|
"neutral"
|
|
6466
6650
|
];
|
|
6467
|
-
function
|
|
6651
|
+
function tr(e, t) {
|
|
6468
6652
|
if (!(t > 0)) return 0;
|
|
6469
6653
|
let n = Math.min(100, Math.max(0, e / t * 100));
|
|
6470
6654
|
return Number(n.toFixed(2));
|
|
6471
6655
|
}
|
|
6472
|
-
function
|
|
6656
|
+
function nr({ value: e = 0, max: t = 100, tone: n = "info", size: r = "md", label: i, showLabel: a = !1, striped: o = !1, animated: s = !1, indeterminate: c = !1, className: l = "", ...u }) {
|
|
6473
6657
|
M("AppProgress", u);
|
|
6474
|
-
let d =
|
|
6658
|
+
let d = jt(n), p = er.includes(d) ? d : "info", m = tr(e, t), h = `progress${r === "sm" ? " progress-sm" : ""}${l ? ` ${l}` : ""}`, g = [
|
|
6475
6659
|
"progress-bar",
|
|
6476
|
-
`wui-progress-${
|
|
6660
|
+
`wui-progress-${p}`,
|
|
6477
6661
|
o || s ? "progress-bar-striped" : "",
|
|
6478
6662
|
s ? "progress-bar-animated" : "",
|
|
6479
6663
|
c ? "wui-progress-indeterminate" : ""
|
|
6480
6664
|
].filter(Boolean).join(" ");
|
|
6481
6665
|
return /* @__PURE__ */ f("div", {
|
|
6482
|
-
className:
|
|
6666
|
+
className: h,
|
|
6483
6667
|
role: "progressbar",
|
|
6484
6668
|
"aria-valuemin": 0,
|
|
6485
6669
|
"aria-valuemax": t,
|
|
6486
6670
|
...c ? {} : { "aria-valuenow": e },
|
|
6487
6671
|
"aria-label": i || void 0,
|
|
6672
|
+
...u,
|
|
6488
6673
|
children: /* @__PURE__ */ f("div", {
|
|
6489
|
-
className:
|
|
6490
|
-
style: c ? void 0 : { width: `${
|
|
6674
|
+
className: g,
|
|
6675
|
+
style: c ? void 0 : { width: `${m}%` },
|
|
6491
6676
|
children: !c && a && i
|
|
6492
6677
|
})
|
|
6493
6678
|
});
|
|
6494
6679
|
}
|
|
6495
6680
|
//#endregion
|
|
6496
6681
|
//#region src/components/AppRadio.jsx
|
|
6497
|
-
var
|
|
6682
|
+
var rr = r(function({ label: e, id: t, name: n, error: r, hint: i, className: a = "", ...s }, c) {
|
|
6498
6683
|
M("AppRadio", s);
|
|
6499
6684
|
let l = o(), u = t || l;
|
|
6500
6685
|
return /* @__PURE__ */ p("div", {
|
|
@@ -6526,7 +6711,7 @@ var Qn = r(function({ label: e, id: t, name: n, error: r, hint: i, className: a
|
|
|
6526
6711
|
});
|
|
6527
6712
|
//#endregion
|
|
6528
6713
|
//#region src/components/AppRepeater.jsx
|
|
6529
|
-
function
|
|
6714
|
+
function ir({ rows: e = [], renderRow: t, onAdd: n, onRemove: r, addLabel: i = "Add another", removeLabel: a = "Remove row", emptyText: o, min: s = 0, max: c, numbered: l = !0, className: u = "", ...d }) {
|
|
6530
6715
|
M("AppRepeater", d);
|
|
6531
6716
|
let m = typeof c == "number" && e.length >= c, h = !!r && e.length > s;
|
|
6532
6717
|
return /* @__PURE__ */ p("div", {
|
|
@@ -6570,7 +6755,7 @@ function $n({ rows: e = [], renderRow: t, onAdd: n, onRemove: r, addLabel: i = "
|
|
|
6570
6755
|
}
|
|
6571
6756
|
//#endregion
|
|
6572
6757
|
//#region src/components/AppResourceCard.jsx
|
|
6573
|
-
function
|
|
6758
|
+
function ar({ icon: e, title: t, text: n, href: r, external: i = !1, linkComponent: a, className: o = "", ...s }) {
|
|
6574
6759
|
M("AppResourceCard", s);
|
|
6575
6760
|
let c = /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("span", {
|
|
6576
6761
|
className: "res-card-icon",
|
|
@@ -6591,18 +6776,20 @@ function er({ icon: e, title: t, text: n, href: r, external: i = !1, linkCompone
|
|
|
6591
6776
|
return a && !i ? /* @__PURE__ */ f(a, {
|
|
6592
6777
|
className: l,
|
|
6593
6778
|
to: r,
|
|
6779
|
+
...s,
|
|
6594
6780
|
children: c
|
|
6595
6781
|
}) : /* @__PURE__ */ f("a", {
|
|
6596
6782
|
className: l,
|
|
6597
6783
|
href: r,
|
|
6598
6784
|
target: i ? "_blank" : void 0,
|
|
6599
6785
|
rel: i ? "noopener noreferrer" : void 0,
|
|
6786
|
+
...s,
|
|
6600
6787
|
children: c
|
|
6601
6788
|
});
|
|
6602
6789
|
}
|
|
6603
6790
|
//#endregion
|
|
6604
6791
|
//#region src/components/AppResult.jsx
|
|
6605
|
-
var
|
|
6792
|
+
var or = {
|
|
6606
6793
|
success: {
|
|
6607
6794
|
icon: "check-circle",
|
|
6608
6795
|
tone: "success"
|
|
@@ -6623,15 +6810,16 @@ var tr = {
|
|
|
6623
6810
|
404: { tone: "muted" },
|
|
6624
6811
|
500: { tone: "muted" }
|
|
6625
6812
|
};
|
|
6626
|
-
function
|
|
6813
|
+
function sr({ status: e = "info", title: t, subtitle: n, icon: r, actions: i, children: a, className: o = "", ...s }) {
|
|
6627
6814
|
M("AppResult", s);
|
|
6628
|
-
let c =
|
|
6815
|
+
let c = or[e] || or.info, l = c.tone, u = /^\d+$/.test(e), d = r ?? (u ? null : c.icon);
|
|
6629
6816
|
return /* @__PURE__ */ p("div", {
|
|
6630
6817
|
className: [
|
|
6631
6818
|
"result",
|
|
6632
6819
|
`result-${l}`,
|
|
6633
6820
|
o
|
|
6634
6821
|
].filter(Boolean).join(" "),
|
|
6822
|
+
...s,
|
|
6635
6823
|
children: [
|
|
6636
6824
|
u ? /* @__PURE__ */ f("div", {
|
|
6637
6825
|
className: "result-code",
|
|
@@ -6662,19 +6850,20 @@ function nr({ status: e = "info", title: t, subtitle: n, icon: r, actions: i, ch
|
|
|
6662
6850
|
}
|
|
6663
6851
|
//#endregion
|
|
6664
6852
|
//#region src/components/AppScrollbar.jsx
|
|
6665
|
-
function
|
|
6853
|
+
function cr({ children: e, className: t = "", maxHeight: n, style: r, ...i }) {
|
|
6666
6854
|
return M("AppScrollbar", i), /* @__PURE__ */ f("div", {
|
|
6667
6855
|
className: t ? `wui-scroll ${t}` : "wui-scroll",
|
|
6668
6856
|
style: n == null ? r : {
|
|
6669
6857
|
maxHeight: n,
|
|
6670
6858
|
...r
|
|
6671
6859
|
},
|
|
6860
|
+
...i,
|
|
6672
6861
|
children: e
|
|
6673
6862
|
});
|
|
6674
6863
|
}
|
|
6675
6864
|
//#endregion
|
|
6676
6865
|
//#region src/components/AppSearch.jsx
|
|
6677
|
-
function
|
|
6866
|
+
function lr({ value: e, onChange: t, onValueChange: n, placeholder: r = "Search…", ariaLabel: i, iconSize: a = 18, size: o, loading: s = !1, disabled: c = !1, className: l = "", ...u }) {
|
|
6678
6867
|
M("AppSearch", u);
|
|
6679
6868
|
let d = t || n;
|
|
6680
6869
|
return /* @__PURE__ */ p("div", {
|
|
@@ -6721,7 +6910,7 @@ function ir({ value: e, onChange: t, onValueChange: n, placeholder: r = "Search
|
|
|
6721
6910
|
}
|
|
6722
6911
|
//#endregion
|
|
6723
6912
|
//#region src/components/AppSegmented.jsx
|
|
6724
|
-
function
|
|
6913
|
+
function ur({ options: e = [], value: t, onChange: n, label: r, name: i, size: c = "md", fullWidth: u = !1, disabled: d = !1, className: m = "", ...h }) {
|
|
6725
6914
|
M("AppSegmented", h);
|
|
6726
6915
|
let g = o(), _ = i || g, v = l(null), y = l(null), b = [
|
|
6727
6916
|
"segmented",
|
|
@@ -6759,6 +6948,7 @@ function ar({ options: e = [], value: t, onChange: n, label: r, name: i, size: c
|
|
|
6759
6948
|
role: "radiogroup",
|
|
6760
6949
|
"aria-label": r,
|
|
6761
6950
|
"aria-disabled": d || void 0,
|
|
6951
|
+
...h,
|
|
6762
6952
|
children: [/* @__PURE__ */ f("span", {
|
|
6763
6953
|
className: "segmented-thumb",
|
|
6764
6954
|
ref: y,
|
|
@@ -6795,103 +6985,101 @@ function ar({ options: e = [], value: t, onChange: n, label: r, name: i, size: c
|
|
|
6795
6985
|
}
|
|
6796
6986
|
//#endregion
|
|
6797
6987
|
//#region src/components/AppSelect.jsx
|
|
6798
|
-
var
|
|
6799
|
-
M("AppSelect",
|
|
6800
|
-
let
|
|
6801
|
-
|
|
6802
|
-
|
|
6988
|
+
var dr = (e) => e == null ? "" : e.label ?? e.text ?? "", fr = r(function({ value: e, onChange: t, options: n = [], placeholder: r = "Select...", searchPlaceholder: i = "Search...", searchable: s = !1, clearable: c = !1, size: l, icon: u, floatingLabel: d = !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 = "", "aria-label": T, "aria-labelledby": E, "aria-describedby": D, ...O }, k) {
|
|
6989
|
+
M("AppSelect", O);
|
|
6990
|
+
let A = o(), { setRef: j, innerRef: N } = on({
|
|
6991
|
+
ref: k,
|
|
6992
|
+
value: e ?? "",
|
|
6993
|
+
onChange: t
|
|
6994
|
+
});
|
|
6803
6995
|
a(() => {
|
|
6804
|
-
|
|
6996
|
+
let e = N.current;
|
|
6997
|
+
if (!e) return;
|
|
6998
|
+
let t = n.map((e) => ({
|
|
6805
6999
|
value: e.value,
|
|
6806
|
-
label:
|
|
7000
|
+
label: dr(e),
|
|
6807
7001
|
icon: e.icon
|
|
6808
|
-
}))
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
|
|
6814
|
-
|
|
6815
|
-
|
|
6816
|
-
|
|
6817
|
-
|
|
6818
|
-
|
|
6819
|
-
|
|
6820
|
-
"aria-labelledby": D || void 0,
|
|
6821
|
-
"aria-describedby": L || R || O || void 0,
|
|
6822
|
-
"aria-invalid": v ? "true" : void 0,
|
|
6823
|
-
ref: P,
|
|
6824
|
-
id: F,
|
|
6825
|
-
name: C,
|
|
6826
|
-
placeholder: m && g ? " " : r,
|
|
7002
|
+
}));
|
|
7003
|
+
ln(t, e.options) || (e.options = t);
|
|
7004
|
+
}, [n, N]);
|
|
7005
|
+
let P = x || S || A, F = d && h, I = _ && P ? `${P}-error` : void 0, L = v && P ? `${P}-hint` : void 0, R = /* @__PURE__ */ f("wui-select", {
|
|
7006
|
+
"aria-label": T || (typeof h == "string" ? h : void 0),
|
|
7007
|
+
"aria-labelledby": E || void 0,
|
|
7008
|
+
"aria-describedby": I || L || D || void 0,
|
|
7009
|
+
"aria-invalid": _ ? "true" : void 0,
|
|
7010
|
+
ref: j,
|
|
7011
|
+
id: P,
|
|
7012
|
+
name: S,
|
|
7013
|
+
placeholder: d && h ? " " : r,
|
|
6827
7014
|
"search-placeholder": i,
|
|
6828
7015
|
searchable: s ? "" : void 0,
|
|
6829
7016
|
clearable: c ? "" : void 0,
|
|
6830
|
-
size:
|
|
6831
|
-
icon:
|
|
6832
|
-
disabled:
|
|
6833
|
-
required:
|
|
7017
|
+
size: l || void 0,
|
|
7018
|
+
icon: u || void 0,
|
|
7019
|
+
disabled: m ? "" : void 0,
|
|
7020
|
+
required: g ? "" : void 0,
|
|
7021
|
+
...O
|
|
6834
7022
|
});
|
|
6835
|
-
return !
|
|
7023
|
+
return !h && !_ && !v ? R : /* @__PURE__ */ p("div", {
|
|
6836
7024
|
className: [
|
|
6837
7025
|
"field",
|
|
6838
|
-
|
|
6839
|
-
|
|
7026
|
+
C,
|
|
7027
|
+
w
|
|
6840
7028
|
].filter(Boolean).join(" "),
|
|
6841
7029
|
children: [
|
|
6842
|
-
|
|
7030
|
+
h && !F && /* @__PURE__ */ p("label", {
|
|
6843
7031
|
className: "label",
|
|
6844
|
-
htmlFor:
|
|
7032
|
+
htmlFor: P,
|
|
6845
7033
|
children: [
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
label:
|
|
6850
|
-
children:
|
|
7034
|
+
h,
|
|
7035
|
+
g && /* @__PURE__ */ f(Q, {}),
|
|
7036
|
+
y && /* @__PURE__ */ f(yt, {
|
|
7037
|
+
label: b,
|
|
7038
|
+
children: y
|
|
6851
7039
|
})
|
|
6852
7040
|
]
|
|
6853
7041
|
}),
|
|
6854
|
-
|
|
7042
|
+
F ? /* @__PURE__ */ p("div", {
|
|
6855
7043
|
className: "field-float",
|
|
6856
|
-
children: [
|
|
7044
|
+
children: [R, /* @__PURE__ */ p("label", {
|
|
6857
7045
|
className: "float-label",
|
|
6858
|
-
htmlFor:
|
|
6859
|
-
children: [
|
|
7046
|
+
htmlFor: P,
|
|
7047
|
+
children: [h, g && /* @__PURE__ */ f(Q, {})]
|
|
6860
7048
|
})]
|
|
6861
|
-
}) :
|
|
6862
|
-
|
|
7049
|
+
}) : R,
|
|
7050
|
+
_ ? /* @__PURE__ */ f("div", {
|
|
6863
7051
|
className: "field-error",
|
|
7052
|
+
id: I,
|
|
7053
|
+
children: _
|
|
7054
|
+
}) : v ? /* @__PURE__ */ f("div", {
|
|
7055
|
+
className: "field-hint",
|
|
6864
7056
|
id: L,
|
|
6865
7057
|
children: v
|
|
6866
|
-
}) : y ? /* @__PURE__ */ f("div", {
|
|
6867
|
-
className: "field-hint",
|
|
6868
|
-
id: R,
|
|
6869
|
-
children: y
|
|
6870
7058
|
}) : null
|
|
6871
7059
|
]
|
|
6872
7060
|
});
|
|
6873
7061
|
});
|
|
6874
7062
|
//#endregion
|
|
6875
7063
|
//#region src/components/AppShell.jsx
|
|
6876
|
-
function
|
|
6877
|
-
M("AppShell",
|
|
6878
|
-
let [
|
|
7064
|
+
function pr({ groups: e = [], brand: t, sidebarStart: n, sidebarFooter: r, topbarStart: i, topbarEnd: o, footer: s, children: c, collapsed: l, onCollapsedChange: d, noSidebar: m = !1, navLabel: h = "Main navigation", linkComponent: g, className: _ = "", ...v }) {
|
|
7065
|
+
M("AppShell", v);
|
|
7066
|
+
let [y, b] = u(!1), [x, S] = u(!1), [C, w] = u(!1), T = l ?? y;
|
|
6879
7067
|
return a(() => {
|
|
6880
|
-
let e = () =>
|
|
7068
|
+
let e = () => w(window.scrollY > 4);
|
|
6881
7069
|
return e(), window.addEventListener("scroll", e, { passive: !0 }), () => window.removeEventListener("scroll", e);
|
|
6882
7070
|
}, []), a(() => {
|
|
6883
|
-
if (!
|
|
7071
|
+
if (!x) return;
|
|
6884
7072
|
let e = (e) => {
|
|
6885
|
-
e.key === "Escape" &&
|
|
7073
|
+
e.key === "Escape" && S(!1);
|
|
6886
7074
|
};
|
|
6887
7075
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
6888
|
-
}, [
|
|
7076
|
+
}, [x]), /* @__PURE__ */ p("div", {
|
|
6889
7077
|
className: [
|
|
6890
7078
|
"app-shell",
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
7079
|
+
T ? "collapsed" : "",
|
|
7080
|
+
m ? "no-sidebar" : "",
|
|
7081
|
+
x ? "mobile-open" : "",
|
|
7082
|
+
_
|
|
6895
7083
|
].filter(Boolean).join(" "),
|
|
6896
7084
|
children: [
|
|
6897
7085
|
/* @__PURE__ */ p("aside", {
|
|
@@ -6901,36 +7089,40 @@ function cr({ groups: e = [], brand: t, sidebarFooter: n, topbarStart: r, topbar
|
|
|
6901
7089
|
className: "app-sidebar-brand",
|
|
6902
7090
|
children: t
|
|
6903
7091
|
}),
|
|
7092
|
+
n && /* @__PURE__ */ f("div", {
|
|
7093
|
+
className: "app-sidebar-start",
|
|
7094
|
+
children: n
|
|
7095
|
+
}),
|
|
6904
7096
|
/* @__PURE__ */ f("nav", {
|
|
6905
7097
|
className: "app-sidebar-scroll",
|
|
6906
|
-
"aria-label":
|
|
7098
|
+
"aria-label": h,
|
|
6907
7099
|
children: e.map((e, t) => /* @__PURE__ */ p("div", {
|
|
6908
7100
|
className: "app-nav-group",
|
|
6909
7101
|
children: [e.label && /* @__PURE__ */ f("div", {
|
|
6910
7102
|
className: "app-nav-group-label",
|
|
6911
7103
|
children: e.label
|
|
6912
|
-
}), e.items.map((e) => /* @__PURE__ */ f(
|
|
7104
|
+
}), e.items.map((e) => /* @__PURE__ */ f(mr, {
|
|
6913
7105
|
item: e,
|
|
6914
|
-
linkComponent:
|
|
6915
|
-
onNavigate: () =>
|
|
7106
|
+
linkComponent: g,
|
|
7107
|
+
onNavigate: () => S(!1)
|
|
6916
7108
|
}, e.key ?? e.href))]
|
|
6917
7109
|
}, e.label ?? `group-${t}`))
|
|
6918
7110
|
}),
|
|
6919
|
-
|
|
7111
|
+
r && /* @__PURE__ */ f("div", {
|
|
6920
7112
|
className: "app-sidebar-foot",
|
|
6921
|
-
children:
|
|
7113
|
+
children: r
|
|
6922
7114
|
})
|
|
6923
7115
|
]
|
|
6924
7116
|
}),
|
|
6925
|
-
!
|
|
7117
|
+
!m && /* @__PURE__ */ f("button", {
|
|
6926
7118
|
type: "button",
|
|
6927
7119
|
className: "app-sidebar-toggle",
|
|
6928
7120
|
onClick: () => {
|
|
6929
|
-
let e = !
|
|
6930
|
-
|
|
7121
|
+
let e = !T;
|
|
7122
|
+
l === void 0 && b(e), d?.(e);
|
|
6931
7123
|
},
|
|
6932
|
-
"aria-label":
|
|
6933
|
-
"aria-expanded": !
|
|
7124
|
+
"aria-label": T ? "Expand navigation" : "Collapse navigation",
|
|
7125
|
+
"aria-expanded": !T,
|
|
6934
7126
|
children: /* @__PURE__ */ f(L, {
|
|
6935
7127
|
name: "chevron-left",
|
|
6936
7128
|
size: 14
|
|
@@ -6940,56 +7132,56 @@ function cr({ groups: e = [], brand: t, sidebarFooter: n, topbarStart: r, topbar
|
|
|
6940
7132
|
className: "app-main",
|
|
6941
7133
|
children: [
|
|
6942
7134
|
/* @__PURE__ */ p("header", {
|
|
6943
|
-
className: `app-topbar${
|
|
7135
|
+
className: `app-topbar${C ? " scrolled" : ""}`,
|
|
6944
7136
|
children: [/* @__PURE__ */ p("div", {
|
|
6945
7137
|
className: "app-topbar-start",
|
|
6946
7138
|
children: [/* @__PURE__ */ f("button", {
|
|
6947
7139
|
type: "button",
|
|
6948
7140
|
className: "app-topbar-menu",
|
|
6949
|
-
onClick: () =>
|
|
7141
|
+
onClick: () => S(!0),
|
|
6950
7142
|
"aria-label": "Open navigation",
|
|
6951
|
-
"aria-expanded":
|
|
7143
|
+
"aria-expanded": x,
|
|
6952
7144
|
children: /* @__PURE__ */ f(L, {
|
|
6953
7145
|
name: "menu",
|
|
6954
7146
|
size: 18
|
|
6955
7147
|
})
|
|
6956
|
-
}),
|
|
7148
|
+
}), i]
|
|
6957
7149
|
}), /* @__PURE__ */ f("div", {
|
|
6958
7150
|
className: "app-topbar-end",
|
|
6959
|
-
children:
|
|
7151
|
+
children: o
|
|
6960
7152
|
})]
|
|
6961
7153
|
}),
|
|
6962
7154
|
/* @__PURE__ */ f("main", {
|
|
6963
7155
|
className: "app-content",
|
|
6964
|
-
children:
|
|
7156
|
+
children: c
|
|
6965
7157
|
}),
|
|
6966
|
-
|
|
7158
|
+
s && /* @__PURE__ */ f("footer", {
|
|
6967
7159
|
className: "app-footer",
|
|
6968
|
-
children:
|
|
7160
|
+
children: s
|
|
6969
7161
|
})
|
|
6970
7162
|
]
|
|
6971
7163
|
}),
|
|
6972
7164
|
/* @__PURE__ */ f("button", {
|
|
6973
7165
|
type: "button",
|
|
6974
7166
|
className: "app-scrim",
|
|
6975
|
-
onClick: () =>
|
|
7167
|
+
onClick: () => S(!1),
|
|
6976
7168
|
"aria-label": "Close navigation",
|
|
6977
|
-
tabIndex:
|
|
7169
|
+
tabIndex: x ? 0 : -1
|
|
6978
7170
|
})
|
|
6979
7171
|
]
|
|
6980
7172
|
});
|
|
6981
7173
|
}
|
|
6982
|
-
function
|
|
7174
|
+
function mr({ item: e, linkComponent: t, onNavigate: n, sub: r = !1 }) {
|
|
6983
7175
|
let i = Array.isArray(e.children) && e.children.length > 0, o = i && e.children.some((e) => e.active), [s, c] = u(o);
|
|
6984
7176
|
a(() => {
|
|
6985
7177
|
o && !s && c(!0);
|
|
6986
7178
|
}, [o, s]);
|
|
6987
7179
|
let l = typeof e.label == "string" ? e.label : void 0, m = !r && e.icon && /* @__PURE__ */ f("span", {
|
|
6988
7180
|
className: "app-nav-icon",
|
|
6989
|
-
children: /* @__PURE__ */ f(L, {
|
|
7181
|
+
children: typeof e.icon == "string" ? /* @__PURE__ */ f(L, {
|
|
6990
7182
|
name: e.icon,
|
|
6991
7183
|
size: 22
|
|
6992
|
-
})
|
|
7184
|
+
}) : e.icon
|
|
6993
7185
|
}), h = e.badge != null && /* @__PURE__ */ f("span", {
|
|
6994
7186
|
className: `app-nav-badge${e.badgeTone ? ` tone-${e.badgeTone}` : ""}`,
|
|
6995
7187
|
children: e.badge
|
|
@@ -7019,7 +7211,7 @@ function lr({ item: e, linkComponent: t, onNavigate: n, sub: r = !1 }) {
|
|
|
7019
7211
|
className: `app-nav-sub${s ? " expanded" : ""}`,
|
|
7020
7212
|
children: /* @__PURE__ */ f("div", {
|
|
7021
7213
|
className: "app-nav-sub-inner",
|
|
7022
|
-
children: e.children.map((e) => /* @__PURE__ */ f(
|
|
7214
|
+
children: e.children.map((e) => /* @__PURE__ */ f(mr, {
|
|
7023
7215
|
item: e,
|
|
7024
7216
|
linkComponent: t,
|
|
7025
7217
|
onNavigate: n,
|
|
@@ -7036,10 +7228,10 @@ function lr({ item: e, linkComponent: t, onNavigate: n, sub: r = !1 }) {
|
|
|
7036
7228
|
h,
|
|
7037
7229
|
e.trailingIcon && /* @__PURE__ */ f("span", {
|
|
7038
7230
|
className: "app-nav-trailing",
|
|
7039
|
-
children: /* @__PURE__ */ f(L, {
|
|
7231
|
+
children: typeof e.trailingIcon == "string" ? /* @__PURE__ */ f(L, {
|
|
7040
7232
|
name: e.trailingIcon,
|
|
7041
7233
|
size: 16
|
|
7042
|
-
})
|
|
7234
|
+
}) : e.trailingIcon
|
|
7043
7235
|
})
|
|
7044
7236
|
] }), v = e.active ? "page" : void 0;
|
|
7045
7237
|
return t ? /* @__PURE__ */ f(t, {
|
|
@@ -7060,7 +7252,7 @@ function lr({ item: e, linkComponent: t, onNavigate: n, sub: r = !1 }) {
|
|
|
7060
7252
|
}
|
|
7061
7253
|
//#endregion
|
|
7062
7254
|
//#region src/components/AppSidebarMenu.jsx
|
|
7063
|
-
var
|
|
7255
|
+
var hr = {
|
|
7064
7256
|
left: "start",
|
|
7065
7257
|
right: "end",
|
|
7066
7258
|
start: "start",
|
|
@@ -7068,11 +7260,11 @@ var ur = {
|
|
|
7068
7260
|
top: "top",
|
|
7069
7261
|
bottom: "bottom"
|
|
7070
7262
|
};
|
|
7071
|
-
function
|
|
7263
|
+
function gr({ show: e, onHide: t, side: n = "right", title: r, titleIcon: i, header: a, children: o, footer: s, width: c, maxWidth: l, backdrop: u = !0, scroll: d = !1, keyboard: m = !0, closeButton: h = !0, responsive: g, className: _ = "", bodyClassName: v = "", ariaLabel: y, ...b }) {
|
|
7072
7264
|
return M("AppSidebarMenu", b), /* @__PURE__ */ p(S, {
|
|
7073
7265
|
show: e,
|
|
7074
7266
|
onHide: t,
|
|
7075
|
-
placement:
|
|
7267
|
+
placement: hr[n] || "end",
|
|
7076
7268
|
backdrop: u,
|
|
7077
7269
|
scroll: d,
|
|
7078
7270
|
keyboard: m,
|
|
@@ -7119,17 +7311,19 @@ function dr({ show: e, onHide: t, side: n = "right", title: r, titleIcon: i, hea
|
|
|
7119
7311
|
}
|
|
7120
7312
|
//#endregion
|
|
7121
7313
|
//#region src/components/AppSlider.jsx
|
|
7122
|
-
var
|
|
7314
|
+
var _r = r(function({ value: e, start: t, end: n, range: r = !1, onChange: i, label: s, required: c = !1, hint: u, error: d, name: m, startName: h, endName: g, min: _ = 0, max: v = 100, step: y = 1, disabled: b, size: x, showValue: S, unit: C, id: w, ariaLabel: T, className: E = "", ...D }, O) {
|
|
7123
7315
|
M("AppSlider", D);
|
|
7124
7316
|
let k = l(null), A = o(), j = w || m || r && h || A, N = r, P = (e) => {
|
|
7125
7317
|
k.current = e, typeof O == "function" ? O(e) : O && (O.current = e);
|
|
7126
7318
|
};
|
|
7127
7319
|
a(() => {
|
|
7128
7320
|
let r = k.current;
|
|
7129
|
-
if (r)
|
|
7130
|
-
|
|
7131
|
-
|
|
7132
|
-
|
|
7321
|
+
if (r) {
|
|
7322
|
+
if (N) t !== void 0 && t > r.end ? (n !== void 0 && r.end !== n && (r.end = n), t !== void 0 && r.start !== t && (r.start = t)) : (t !== void 0 && r.start !== t && (r.start = t), n !== void 0 && r.end !== n && (r.end = n));
|
|
7323
|
+
else if (e !== void 0) {
|
|
7324
|
+
let t = Number.parseFloat(e);
|
|
7325
|
+
Number.isFinite(t) && r.value !== t && (r.value = t);
|
|
7326
|
+
}
|
|
7133
7327
|
}
|
|
7134
7328
|
}, [
|
|
7135
7329
|
e,
|
|
@@ -7141,9 +7335,9 @@ var fr = r(function({ value: e, start: t, end: n, range: r = !1, onChange: i, la
|
|
|
7141
7335
|
if (!e) return;
|
|
7142
7336
|
let t = () => {
|
|
7143
7337
|
i && i(N ? {
|
|
7144
|
-
start: e.
|
|
7145
|
-
end: e.
|
|
7146
|
-
} : e.
|
|
7338
|
+
start: e.start,
|
|
7339
|
+
end: e.end
|
|
7340
|
+
} : e.value);
|
|
7147
7341
|
};
|
|
7148
7342
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
7149
7343
|
}, [i, N]);
|
|
@@ -7188,14 +7382,14 @@ var fr = r(function({ value: e, start: t, end: n, range: r = !1, onChange: i, la
|
|
|
7188
7382
|
})
|
|
7189
7383
|
]
|
|
7190
7384
|
});
|
|
7191
|
-
}),
|
|
7385
|
+
}), vr = {
|
|
7192
7386
|
sm: 44,
|
|
7193
7387
|
md: 56,
|
|
7194
7388
|
lg: 72
|
|
7195
7389
|
};
|
|
7196
|
-
function
|
|
7390
|
+
function yr({ logo: e, initials: t, text: n, subtext: r, variant: i = "bar", size: a = "md", label: o = "Loading", className: s = "", ...c }) {
|
|
7197
7391
|
M("AppSplash", c);
|
|
7198
|
-
let l = typeof a == "number" ? a :
|
|
7392
|
+
let { style: l, ...u } = c, d = typeof a == "number" ? a : vr[a] ?? vr.md, m = i === "ring" ? /* @__PURE__ */ f("span", {
|
|
7199
7393
|
className: "splash-ring",
|
|
7200
7394
|
"aria-hidden": "true"
|
|
7201
7395
|
}) : i === "dots" ? /* @__PURE__ */ p("span", {
|
|
@@ -7215,7 +7409,11 @@ function mr({ logo: e, initials: t, text: n, subtext: r, variant: i = "bar", siz
|
|
|
7215
7409
|
role: "status",
|
|
7216
7410
|
"aria-live": "polite",
|
|
7217
7411
|
"aria-label": o,
|
|
7218
|
-
style: {
|
|
7412
|
+
style: {
|
|
7413
|
+
"--wui-splash-size": `${d}px`,
|
|
7414
|
+
...l
|
|
7415
|
+
},
|
|
7416
|
+
...u,
|
|
7219
7417
|
children: /* @__PURE__ */ p("div", {
|
|
7220
7418
|
className: "splash-inner",
|
|
7221
7419
|
children: [
|
|
@@ -7223,7 +7421,7 @@ function mr({ logo: e, initials: t, text: n, subtext: r, variant: i = "bar", siz
|
|
|
7223
7421
|
className: "splash-mark",
|
|
7224
7422
|
children: t
|
|
7225
7423
|
}),
|
|
7226
|
-
|
|
7424
|
+
m,
|
|
7227
7425
|
n && /* @__PURE__ */ f("span", {
|
|
7228
7426
|
className: "splash-text",
|
|
7229
7427
|
children: n
|
|
@@ -7238,16 +7436,16 @@ function mr({ logo: e, initials: t, text: n, subtext: r, variant: i = "bar", siz
|
|
|
7238
7436
|
}
|
|
7239
7437
|
//#endregion
|
|
7240
7438
|
//#region src/components/AppStatusBadge.jsx
|
|
7241
|
-
function
|
|
7439
|
+
function br({ label: e, tone: t = "neutral", className: n = "", ...r }) {
|
|
7242
7440
|
return M("AppStatusBadge", r), e == null || e === "" ? "—" : /* @__PURE__ */ f("span", {
|
|
7243
|
-
className: `status-label ${
|
|
7441
|
+
className: `status-label ${jt(t)}${n ? ` ${n}` : ""}`,
|
|
7244
7442
|
...r,
|
|
7245
7443
|
children: e
|
|
7246
7444
|
});
|
|
7247
7445
|
}
|
|
7248
7446
|
//#endregion
|
|
7249
7447
|
//#region src/components/AppStepper.jsx
|
|
7250
|
-
function
|
|
7448
|
+
function xr({ steps: e = [], variant: t = "steps", orientation: n = "horizontal", activeStep: r, onStepClick: i, label: a = "Progress", linkComponent: o, className: s = "", ...c }) {
|
|
7251
7449
|
M("AppStepper", c);
|
|
7252
7450
|
let l = t === "journey";
|
|
7253
7451
|
return /* @__PURE__ */ f("nav", {
|
|
@@ -7259,7 +7457,7 @@ function gr({ steps: e = [], variant: t = "steps", orientation: n = "horizontal"
|
|
|
7259
7457
|
].filter(Boolean).join(" "),
|
|
7260
7458
|
"aria-label": a,
|
|
7261
7459
|
children: e.map((t, n) => {
|
|
7262
|
-
let a = t.status ||
|
|
7460
|
+
let a = t.status || Sr(n, r), s = `step${a === "pending" ? "" : ` ${a}`}`, c;
|
|
7263
7461
|
c = a === "done" ? /* @__PURE__ */ f(L, {
|
|
7264
7462
|
name: "check",
|
|
7265
7463
|
size: 14
|
|
@@ -7323,12 +7521,12 @@ function gr({ steps: e = [], variant: t = "steps", orientation: n = "horizontal"
|
|
|
7323
7521
|
})
|
|
7324
7522
|
});
|
|
7325
7523
|
}
|
|
7326
|
-
function
|
|
7524
|
+
function Sr(e, t) {
|
|
7327
7525
|
return typeof t == "number" ? e < t ? "done" : e === t ? "active" : "pending" : "pending";
|
|
7328
7526
|
}
|
|
7329
7527
|
//#endregion
|
|
7330
7528
|
//#region src/components/AppSwitch.jsx
|
|
7331
|
-
var
|
|
7529
|
+
var Cr = r(function({ label: e, id: t, name: n, error: r, hint: i, className: a = "", ...s }, c) {
|
|
7332
7530
|
M("AppSwitch", s);
|
|
7333
7531
|
let l = o(), u = t || l;
|
|
7334
7532
|
return /* @__PURE__ */ p("div", {
|
|
@@ -7360,9 +7558,10 @@ var vr = r(function({ label: e, id: t, name: n, error: r, hint: i, className: a
|
|
|
7360
7558
|
});
|
|
7361
7559
|
//#endregion
|
|
7362
7560
|
//#region src/components/AppTableEmptyState.jsx
|
|
7363
|
-
function
|
|
7561
|
+
function wr({ icon: e, title: t, text: n, action: r, ...i }) {
|
|
7364
7562
|
return M("AppTableEmptyState", i), /* @__PURE__ */ p("div", {
|
|
7365
7563
|
className: "tbl-empty",
|
|
7564
|
+
...i,
|
|
7366
7565
|
children: [
|
|
7367
7566
|
/* @__PURE__ */ f("span", {
|
|
7368
7567
|
className: "tbl-empty-icon",
|
|
@@ -7385,7 +7584,7 @@ function yr({ icon: e, title: t, text: n, action: r, ...i }) {
|
|
|
7385
7584
|
}
|
|
7386
7585
|
//#endregion
|
|
7387
7586
|
//#region src/components/AppTabs.jsx
|
|
7388
|
-
function
|
|
7587
|
+
function Tr({ tabs: e, value: t, onChange: n, variant: r = "underline", orientation: o = "horizontal", size: c = "md", fitted: d = !1, activation: m = "automatic", ariaLabel: h, className: g = "", style: _, ...v }) {
|
|
7389
7588
|
M("AppTabs", v);
|
|
7390
7589
|
let y = l(null), b = l(null), x = o === "vertical", [S, C] = u(t);
|
|
7391
7590
|
a(() => {
|
|
@@ -7518,7 +7717,7 @@ function br({ tabs: e, value: t, onChange: n, variant: r = "underline", orientat
|
|
|
7518
7717
|
}
|
|
7519
7718
|
//#endregion
|
|
7520
7719
|
//#region src/components/AppTagInput.jsx
|
|
7521
|
-
var
|
|
7720
|
+
var Er = r(function({ values: e, onChange: t, placeholder: n = "Add…", name: r, label: i, error: s, hint: c, required: u = !1, size: d, maxTags: m, allowDuplicates: h = !1, disabled: g = !1, id: _, ariaLabel: v, className: y = "", fieldClassName: b = "", help: x, helpLabel: S = "More information", ...C }, w) {
|
|
7522
7721
|
M("AppTagInput", C);
|
|
7523
7722
|
let T = l(null), E = o(), D = _ || r || E;
|
|
7524
7723
|
return a(() => {
|
|
@@ -7540,7 +7739,7 @@ var xr = r(function({ values: e, onChange: t, placeholder: n = "Add…", name: r
|
|
|
7540
7739
|
children: [
|
|
7541
7740
|
i,
|
|
7542
7741
|
u && /* @__PURE__ */ f(Q, {}),
|
|
7543
|
-
x && /* @__PURE__ */ f(
|
|
7742
|
+
x && /* @__PURE__ */ f(yt, {
|
|
7544
7743
|
label: S,
|
|
7545
7744
|
children: x
|
|
7546
7745
|
})
|
|
@@ -7561,7 +7760,8 @@ var xr = r(function({ values: e, onChange: t, placeholder: n = "Add…", name: r
|
|
|
7561
7760
|
"allow-duplicates": h ? "" : void 0,
|
|
7562
7761
|
disabled: g ? "" : void 0,
|
|
7563
7762
|
required: u ? "" : void 0,
|
|
7564
|
-
className: y || void 0
|
|
7763
|
+
className: y || void 0,
|
|
7764
|
+
...C
|
|
7565
7765
|
}),
|
|
7566
7766
|
s ? /* @__PURE__ */ f("div", {
|
|
7567
7767
|
className: "field-error",
|
|
@@ -7574,9 +7774,9 @@ var xr = r(function({ values: e, onChange: t, placeholder: n = "Add…", name: r
|
|
|
7574
7774
|
}) : null
|
|
7575
7775
|
]
|
|
7576
7776
|
});
|
|
7577
|
-
}),
|
|
7777
|
+
}), Dr = r(function({ label: e, required: t = !1, error: n, hint: r, help: a, helpLabel: c = "More information", id: u, name: d, rows: m = 4, autoGrow: h = !1, className: g = "", fieldClassName: _ = "", ...v }, y) {
|
|
7578
7778
|
M("AppTextarea", v);
|
|
7579
|
-
let x = o(), S = u ||
|
|
7779
|
+
let x = o(), S = u || x, C = [
|
|
7580
7780
|
"textarea",
|
|
7581
7781
|
h ? "autosize" : "",
|
|
7582
7782
|
n ? "error" : "",
|
|
@@ -7606,7 +7806,7 @@ var xr = r(function({ values: e, onChange: t, placeholder: n = "Add…", name: r
|
|
|
7606
7806
|
children: [
|
|
7607
7807
|
e,
|
|
7608
7808
|
t && /* @__PURE__ */ f(Q, {}),
|
|
7609
|
-
a && /* @__PURE__ */ f(
|
|
7809
|
+
a && /* @__PURE__ */ f(yt, {
|
|
7610
7810
|
label: c,
|
|
7611
7811
|
children: a
|
|
7612
7812
|
})
|
|
@@ -7639,9 +7839,10 @@ var xr = r(function({ values: e, onChange: t, placeholder: n = "Add…", name: r
|
|
|
7639
7839
|
});
|
|
7640
7840
|
//#endregion
|
|
7641
7841
|
//#region src/components/AppTimeline.jsx
|
|
7642
|
-
function
|
|
7842
|
+
function Or({ items: e = [], className: t = "", ...n }) {
|
|
7643
7843
|
return M("AppTimeline", n), /* @__PURE__ */ f("ol", {
|
|
7644
7844
|
className: `timeline${t ? ` ${t}` : ""}`,
|
|
7845
|
+
...n,
|
|
7645
7846
|
children: e.map((e, t) => /* @__PURE__ */ p("li", {
|
|
7646
7847
|
className: `timeline-item${e.tone && e.tone !== "neutral" ? ` ${e.tone}` : ""}`,
|
|
7647
7848
|
children: [/* @__PURE__ */ f("span", {
|
|
@@ -7678,7 +7879,7 @@ function Cr({ items: e = [], className: t = "", ...n }) {
|
|
|
7678
7879
|
}
|
|
7679
7880
|
//#endregion
|
|
7680
7881
|
//#region src/components/AppTimePicker.jsx
|
|
7681
|
-
var
|
|
7882
|
+
var kr = r(function({ value: e, onChange: t, label: n, required: r = !1, hint: i, error: s, name: c, min: u, max: d, step: m, format: h = "24", placeholder: g = "Select time", disabled: _, size: v, id: y, ariaLabel: b, className: x = "", ...S }, C) {
|
|
7682
7883
|
M("AppTimePicker", S);
|
|
7683
7884
|
let w = l(null), T = o(), E = y || c || T, D = (e) => {
|
|
7684
7885
|
w.current = e, typeof C == "function" ? C(e) : C && (C.current = e);
|
|
@@ -7707,7 +7908,8 @@ var wr = r(function({ value: e, onChange: t, label: n, required: r = !1, hint: i
|
|
|
7707
7908
|
"aria-invalid": s ? "true" : void 0,
|
|
7708
7909
|
disabled: _ ? "" : void 0,
|
|
7709
7910
|
required: r ? "" : void 0,
|
|
7710
|
-
className: O && x || void 0
|
|
7911
|
+
className: O && x || void 0,
|
|
7912
|
+
...S
|
|
7711
7913
|
});
|
|
7712
7914
|
return O ? j : /* @__PURE__ */ p("div", {
|
|
7713
7915
|
className: `field${x ? ` ${x}` : ""}`,
|
|
@@ -7730,38 +7932,46 @@ var wr = r(function({ value: e, onChange: t, label: n, required: r = !1, hint: i
|
|
|
7730
7932
|
})
|
|
7731
7933
|
]
|
|
7732
7934
|
});
|
|
7733
|
-
}), $ = [],
|
|
7734
|
-
function
|
|
7735
|
-
for (let e of
|
|
7935
|
+
}), $ = [], Ar = /* @__PURE__ */ new Set(), jr = /* @__PURE__ */ new Map(), Mr = 0;
|
|
7936
|
+
function Nr() {
|
|
7937
|
+
for (let e of Ar) e($);
|
|
7938
|
+
}
|
|
7939
|
+
function Pr(e) {
|
|
7940
|
+
let t = jr.get(e);
|
|
7941
|
+
t !== void 0 && (clearTimeout(t), jr.delete(e));
|
|
7736
7942
|
}
|
|
7737
|
-
function
|
|
7738
|
-
return
|
|
7943
|
+
function Fr(e) {
|
|
7944
|
+
return Ar.add(e), e($), () => Ar.delete(e);
|
|
7739
7945
|
}
|
|
7740
|
-
function
|
|
7946
|
+
function Ir(e, t, n = {}) {
|
|
7741
7947
|
let r = n.id;
|
|
7742
|
-
if (r)
|
|
7743
|
-
|
|
7948
|
+
if (r) {
|
|
7949
|
+
for (let e of $) e.externalId === r && Pr(e.id);
|
|
7950
|
+
$ = $.filter((e) => e.externalId !== r);
|
|
7951
|
+
} else {
|
|
7744
7952
|
let n = `${t}:${e}`;
|
|
7745
7953
|
if ($.some((e) => e.key === n)) return;
|
|
7746
7954
|
}
|
|
7955
|
+
let i = ++Mr, a = n.duration === void 0 ? 5e3 : n.duration;
|
|
7747
7956
|
$ = [...$, {
|
|
7748
|
-
id:
|
|
7957
|
+
id: i,
|
|
7749
7958
|
externalId: r,
|
|
7750
7959
|
message: e,
|
|
7751
7960
|
variant: t,
|
|
7752
7961
|
title: n.title,
|
|
7753
|
-
duration:
|
|
7962
|
+
duration: a,
|
|
7754
7963
|
action: n.action,
|
|
7755
7964
|
key: r ? void 0 : `${t}:${e}`
|
|
7756
|
-
}],
|
|
7965
|
+
}], Nr(), a > 0 && jr.set(i, setTimeout(() => Lr(i), a));
|
|
7757
7966
|
}
|
|
7758
|
-
function
|
|
7967
|
+
function Lr(e) {
|
|
7968
|
+
Pr(e);
|
|
7759
7969
|
let t = $.filter((t) => t.id !== e);
|
|
7760
|
-
t.length !== $.length && ($ = t,
|
|
7970
|
+
t.length !== $.length && ($ = t, Nr());
|
|
7761
7971
|
}
|
|
7762
7972
|
//#endregion
|
|
7763
7973
|
//#region src/components/AppToastContainer.jsx
|
|
7764
|
-
var
|
|
7974
|
+
var Rr = {
|
|
7765
7975
|
success: {
|
|
7766
7976
|
cls: "text-bg-success",
|
|
7767
7977
|
closeWhite: !0
|
|
@@ -7779,20 +7989,20 @@ var jr = {
|
|
|
7779
7989
|
closeWhite: !0
|
|
7780
7990
|
}
|
|
7781
7991
|
};
|
|
7782
|
-
function
|
|
7783
|
-
let [
|
|
7784
|
-
return a(() =>
|
|
7992
|
+
function zr({ position: e = "bottom-end" }) {
|
|
7993
|
+
let [t, n] = u([]);
|
|
7994
|
+
return a(() => Fr(n), []), /* @__PURE__ */ f(E, {
|
|
7785
7995
|
position: e,
|
|
7786
7996
|
containerPosition: "fixed",
|
|
7787
7997
|
className: "p-3",
|
|
7788
|
-
children:
|
|
7789
|
-
let
|
|
7998
|
+
children: t.map((e) => {
|
|
7999
|
+
let t = Rr[e.variant] ?? Rr.success, n = e.duration, r = n === 0;
|
|
7790
8000
|
return /* @__PURE__ */ p(T, {
|
|
7791
|
-
className:
|
|
7792
|
-
onClose: () =>
|
|
8001
|
+
className: t.cls,
|
|
8002
|
+
onClose: () => Lr(e.id),
|
|
7793
8003
|
show: !0,
|
|
7794
|
-
delay:
|
|
7795
|
-
autohide: !
|
|
8004
|
+
delay: n,
|
|
8005
|
+
autohide: !r,
|
|
7796
8006
|
children: [e.title && /* @__PURE__ */ p(T.Header, {
|
|
7797
8007
|
className: "wui-toast-header",
|
|
7798
8008
|
closeButton: !1,
|
|
@@ -7801,9 +8011,9 @@ function Mr({ position: e = "bottom-end", autoDismiss: t = 5e3 }) {
|
|
|
7801
8011
|
children: e.title
|
|
7802
8012
|
}), /* @__PURE__ */ f("button", {
|
|
7803
8013
|
type: "button",
|
|
7804
|
-
className:
|
|
8014
|
+
className: t.closeWhite ? "btn-close btn-close-white" : "btn-close",
|
|
7805
8015
|
"aria-label": "Close",
|
|
7806
|
-
onClick: () =>
|
|
8016
|
+
onClick: () => Lr(e.id)
|
|
7807
8017
|
})]
|
|
7808
8018
|
}), /* @__PURE__ */ p(T.Body, {
|
|
7809
8019
|
className: `d-flex align-items-center gap-3 ${e.title ? "pt-0" : ""}`,
|
|
@@ -7816,15 +8026,15 @@ function Mr({ position: e = "bottom-end", autoDismiss: t = 5e3 }) {
|
|
|
7816
8026
|
type: "button",
|
|
7817
8027
|
className: "btn btn-sm btn-link wui-toast-action",
|
|
7818
8028
|
onClick: () => {
|
|
7819
|
-
e.action.onClick?.(),
|
|
8029
|
+
e.action.onClick?.(), Lr(e.id);
|
|
7820
8030
|
},
|
|
7821
8031
|
children: e.action.label
|
|
7822
8032
|
}),
|
|
7823
8033
|
!e.title && /* @__PURE__ */ f("button", {
|
|
7824
8034
|
type: "button",
|
|
7825
|
-
className:
|
|
8035
|
+
className: t.closeWhite ? "btn-close btn-close-white" : "btn-close",
|
|
7826
8036
|
"aria-label": "Close",
|
|
7827
|
-
onClick: () =>
|
|
8037
|
+
onClick: () => Lr(e.id)
|
|
7828
8038
|
})
|
|
7829
8039
|
]
|
|
7830
8040
|
})]
|
|
@@ -7834,7 +8044,7 @@ function Mr({ position: e = "bottom-end", autoDismiss: t = 5e3 }) {
|
|
|
7834
8044
|
}
|
|
7835
8045
|
//#endregion
|
|
7836
8046
|
//#region src/components/AppTooltip.jsx
|
|
7837
|
-
function
|
|
8047
|
+
function Br({ content: e, children: t, placement: n = "top", className: r = "", ...i }) {
|
|
7838
8048
|
return M("AppTooltip", i), /* @__PURE__ */ f(C, {
|
|
7839
8049
|
trigger: ["hover", "focus"],
|
|
7840
8050
|
placement: n,
|
|
@@ -7848,33 +8058,33 @@ function Nr({ content: e, children: t, placement: n = "top", className: r = "",
|
|
|
7848
8058
|
}
|
|
7849
8059
|
//#endregion
|
|
7850
8060
|
//#region src/components/toast.js
|
|
7851
|
-
var
|
|
8061
|
+
var Vr = /* @__PURE__ */ new Set([
|
|
7852
8062
|
"success",
|
|
7853
8063
|
"info",
|
|
7854
8064
|
"warning",
|
|
7855
8065
|
"error"
|
|
7856
8066
|
]);
|
|
7857
|
-
function
|
|
8067
|
+
function Hr(e, t = "success") {
|
|
7858
8068
|
let n = "success", r = {};
|
|
7859
|
-
typeof t == "string" ? n =
|
|
8069
|
+
typeof t == "string" ? n = Vr.has(t) ? t : "success" : typeof t == "object" && t && (r = t, n = Vr.has(r.variant) ? r.variant : "info"), Ir(e, n, r);
|
|
7860
8070
|
}
|
|
7861
|
-
function
|
|
7862
|
-
|
|
8071
|
+
function Ur(e, t = {}) {
|
|
8072
|
+
Ir(e, "error", t);
|
|
7863
8073
|
}
|
|
7864
|
-
|
|
8074
|
+
Hr.promise = (e, t, n = {}) => {
|
|
7865
8075
|
let r = n.id || `promise-${Date.now()}-${Math.random()}`;
|
|
7866
|
-
return
|
|
8076
|
+
return Hr(t.loading || "Loading...", {
|
|
7867
8077
|
...n,
|
|
7868
8078
|
variant: "info",
|
|
7869
8079
|
id: r,
|
|
7870
8080
|
duration: 0
|
|
7871
|
-
}), e.then((e) => (
|
|
8081
|
+
}), e.then((e) => (Hr((typeof t.success == "function" ? t.success(e) : t.success) || "Done", {
|
|
7872
8082
|
...n,
|
|
7873
8083
|
variant: "success",
|
|
7874
8084
|
id: r,
|
|
7875
8085
|
duration: n.duration === void 0 ? 5e3 : n.duration
|
|
7876
8086
|
}), e)).catch((e) => {
|
|
7877
|
-
throw
|
|
8087
|
+
throw Hr((typeof t.error == "function" ? t.error(e) : t.error) || "Error", {
|
|
7878
8088
|
...n,
|
|
7879
8089
|
variant: "error",
|
|
7880
8090
|
id: r,
|
|
@@ -7884,7 +8094,7 @@ Fr.promise = (e, t, n = {}) => {
|
|
|
7884
8094
|
};
|
|
7885
8095
|
//#endregion
|
|
7886
8096
|
//#region src/lib/usePagination.js
|
|
7887
|
-
function
|
|
8097
|
+
function Wr(e, t = 10) {
|
|
7888
8098
|
let [n, r] = u(1), [i, o] = u(t), s = e.length, l = Math.max(1, Math.ceil(s / i));
|
|
7889
8099
|
a(() => {
|
|
7890
8100
|
n > l && r(l);
|
|
@@ -7910,4 +8120,4 @@ function Lr(e, t = 10) {
|
|
|
7910
8120
|
};
|
|
7911
8121
|
}
|
|
7912
8122
|
//#endregion
|
|
7913
|
-
export { z as ActionIcon, B as AppAccordion, ee as AppAlert, ie as AppAsyncBlock,
|
|
8123
|
+
export { z as ActionIcon, B as AppAccordion, ee as AppAlert, ie as AppAsyncBlock, bt as AppAutocomplete, Et as AppAvatar, kt as AppAvatarGroup, Mt as AppBadge, Pt as AppBanner, Ft as AppBreadcrumbs, H as AppButton, It as AppCallout, Rt as AppCard, zt as AppCheckbox, Bt as AppChip, Vt as AppChoiceCard, Ht as AppChoiceChip, Ut as AppColorField, Wt as AppCompareTable, $t as AppConfirmDialog, en as AppCopyButton, hn as AppDataTable, gn as AppDatePicker, _n as AppDateRangePicker, vn as AppDescriptions, xn as AppDropdown, ne as AppEmptyState, On as AppFileAttachment, An as AppFilePicker, jn as AppFormActions, Mn as AppFormRow, Nn as AppFormSection, Pn as AppInfoList, yt as AppInfoTip, Gt as AppInput, zn as AppKpiTile, Vn as AppLogoPicker, Gn as AppMeter, Xt as AppModal, Kn as AppMultiSelect, qn as AppNumberInput, Jn as AppOtpInput, Yn as AppPageHeader, Xn as AppPagination, Zn as AppPhoneNumberInput, Qn as AppPopover, $n as AppPricingCard, nr as AppProgress, rr as AppRadio, ir as AppRepeater, ar as AppResourceCard, sr as AppResult, cr as AppScrollbar, lr as AppSearch, ur as AppSegmented, fr as AppSelect, un as AppSelectMini, pr as AppShell, gr as AppSidebarMenu, tn as AppSkeleton, nn as AppSkeletonRows, _r as AppSlider, re as AppSpinner, yr as AppSplash, br as AppStatusBadge, xr as AppStepper, Cr as AppSwitch, wr as AppTableEmptyState, fn as AppTablePagination, Tr as AppTabs, Er as AppTagInput, Dr as AppTextarea, kr as AppTimePicker, Or as AppTimeline, zr as AppToastContainer, Br as AppTooltip, L as Icon, Qt as MODAL_ICONS, Q as RequiredMark, Ur as errorToast, P as iconNames, I as registerIcons, Hr as toast, Wr as usePagination };
|