@webority/ui-react 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/components/AppChoiceCard.d.ts +6 -0
- package/dist/types/components/AppChoiceChip.d.ts +2 -0
- package/dist/types/components/AppDataTable.d.ts +2 -0
- package/dist/types/components/AppFilePicker.d.ts +2 -0
- package/dist/types/components/AppTablePagination.d.ts +10 -4
- package/dist/types/lib/usePagination.d.ts +1 -1
- package/dist/ui-react.js +187 -160
- package/package.json +3 -3
package/dist/ui-react.js
CHANGED
|
@@ -247,8 +247,11 @@ var E = class extends HTMLElement {
|
|
|
247
247
|
let e = this.getAttribute("tone"), t = this.getAttribute("size") || "72", n = T[e] || T.info;
|
|
248
248
|
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>`;
|
|
249
249
|
}
|
|
250
|
-
}, D = class extends HTMLElement {
|
|
250
|
+
}, D = Symbol("wui.trustedHtml"), O = (e) => String(e ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), k = (e) => e?.[D] ? String(e.label ?? "") : O(e == null ? "" : e.label), A = class extends HTMLElement {
|
|
251
251
|
static formAssociated = !0;
|
|
252
|
+
_accessibleName() {
|
|
253
|
+
return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Select";
|
|
254
|
+
}
|
|
252
255
|
static get observedAttributes() {
|
|
253
256
|
return [
|
|
254
257
|
"value",
|
|
@@ -274,7 +277,7 @@ var E = class extends HTMLElement {
|
|
|
274
277
|
set value(e) {
|
|
275
278
|
this._value = e == null ? "" : String(e), this._internals?.setFormValue(this._value);
|
|
276
279
|
let t = this._readOptions().find((e) => String(e.value) === this._value);
|
|
277
|
-
t && (this._label =
|
|
280
|
+
t && (this._label = M(t.label)), this._syncInput();
|
|
278
281
|
}
|
|
279
282
|
set options(e) {
|
|
280
283
|
this._optionsProp = Array.isArray(e) ? e : [], this._renderOptions();
|
|
@@ -304,6 +307,7 @@ var E = class extends HTMLElement {
|
|
|
304
307
|
e.length && (this._declared = e.map((e) => ({
|
|
305
308
|
value: e.getAttribute("value") ?? e.textContent.trim(),
|
|
306
309
|
label: e.innerHTML,
|
|
310
|
+
[D]: !0,
|
|
307
311
|
selected: e.hasAttribute("selected")
|
|
308
312
|
})));
|
|
309
313
|
}
|
|
@@ -315,8 +319,8 @@ var E = class extends HTMLElement {
|
|
|
315
319
|
let e = this.getAttribute("placeholder") || "Search…";
|
|
316
320
|
this.innerHTML = `
|
|
317
321
|
<div class="search-select">
|
|
318
|
-
<div class="input search-select-control search-select-ac" role="combobox" aria-haspopup="listbox" aria-expanded="false">
|
|
319
|
-
<input class="search-select-input search-select-ac-input" placeholder="${
|
|
322
|
+
<div class="input search-select-control search-select-ac" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-label="${j(this._accessibleName())}">
|
|
323
|
+
<input class="search-select-input search-select-ac-input" placeholder="${j(e)}" aria-autocomplete="list" autocomplete="off"${this.hasAttribute("disabled") ? " disabled" : ""} />
|
|
320
324
|
<span class="search-select-spinner spinner-border spinner-border-sm" role="status" aria-hidden="true" hidden></span>
|
|
321
325
|
<button type="button" class="search-select-clear" aria-label="Clear" hidden><i class="bi bi-x" aria-hidden="true"></i></button>
|
|
322
326
|
</div>
|
|
@@ -354,9 +358,9 @@ var E = class extends HTMLElement {
|
|
|
354
358
|
let t = this._refs();
|
|
355
359
|
if (!t.optionsWrap) return;
|
|
356
360
|
let n = (e ?? (t.input ? t.input.value : "")).trim().toLowerCase(), r = this._readOptions();
|
|
357
|
-
!this._remote && n && (r = r.filter((e) =>
|
|
361
|
+
!this._remote && n && (r = r.filter((e) => M(e.label).toLowerCase().includes(n))), t.optionsWrap.innerHTML = r.map((e) => {
|
|
358
362
|
let t = String(e.value) === String(this._value);
|
|
359
|
-
return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${
|
|
363
|
+
return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${j(e.value)}" aria-selected="${t}">${k(e)}</button>`;
|
|
360
364
|
}).join(""), this._active = -1;
|
|
361
365
|
let i = n.length < this._minChars;
|
|
362
366
|
t.hint && (t.hint.hidden = !(this._remote && i && !r.length)), t.empty && (t.empty.hidden = this._loading || r.length > 0 || this._remote && i);
|
|
@@ -377,7 +381,7 @@ var E = class extends HTMLElement {
|
|
|
377
381
|
}, o = () => {
|
|
378
382
|
e.menu.hidden = !0, e.control.setAttribute("aria-expanded", "false"), e.control.classList.remove("open"), r(-1), this._syncInput();
|
|
379
383
|
}, s = (t) => {
|
|
380
|
-
this._value = t.dataset.value, this._label =
|
|
384
|
+
this._value = t.dataset.value, this._label = M(t.innerHTML), this._internals?.setFormValue(this._value), e.input.value = this._label, this.dispatchEvent(new Event("change", { bubbles: !0 })), o(), e.input.focus();
|
|
381
385
|
};
|
|
382
386
|
e.input.addEventListener("focus", () => a()), e.input.addEventListener("input", () => {
|
|
383
387
|
let t = e.input.value;
|
|
@@ -410,7 +414,7 @@ var E = class extends HTMLElement {
|
|
|
410
414
|
disconnectedCallback() {
|
|
411
415
|
this._onDocClick && document.removeEventListener("click", this._onDocClick), clearTimeout(this._timer);
|
|
412
416
|
}
|
|
413
|
-
},
|
|
417
|
+
}, j = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), M = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), N = [
|
|
414
418
|
"January",
|
|
415
419
|
"February",
|
|
416
420
|
"March",
|
|
@@ -431,16 +435,16 @@ var E = class extends HTMLElement {
|
|
|
431
435
|
"Th",
|
|
432
436
|
"Fr",
|
|
433
437
|
"Sa"
|
|
434
|
-
],
|
|
438
|
+
], P = (e) => String(e).padStart(2, "0"), te = (e, t, n) => `${e}-${P(t + 1)}-${P(n)}`, F = (e) => {
|
|
435
439
|
let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e || "");
|
|
436
440
|
return t ? {
|
|
437
441
|
y: +t[1],
|
|
438
442
|
m: t[2] - 1,
|
|
439
443
|
d: +t[3]
|
|
440
444
|
} : null;
|
|
441
|
-
},
|
|
442
|
-
let t =
|
|
443
|
-
return t ? `${
|
|
445
|
+
}, I = (e) => {
|
|
446
|
+
let t = F(e);
|
|
447
|
+
return t ? `${P(t.d)} ${N[t.m].slice(0, 3)} ${t.y}` : "";
|
|
444
448
|
}, ne = class extends HTMLElement {
|
|
445
449
|
static formAssociated = !0;
|
|
446
450
|
static get observedAttributes() {
|
|
@@ -471,11 +475,11 @@ var E = class extends HTMLElement {
|
|
|
471
475
|
}
|
|
472
476
|
render() {
|
|
473
477
|
this._value = this.getAttribute("value") || this._value;
|
|
474
|
-
let e = this.getAttribute("placeholder") || "Enter Date", t =
|
|
478
|
+
let e = this.getAttribute("placeholder") || "Enter Date", t = F(this._value);
|
|
475
479
|
t && (this._viewY = t.y, this._viewM = t.m), this.innerHTML = `
|
|
476
480
|
<div class="datepicker">
|
|
477
481
|
<button type="button" class="input datepicker-trigger" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}>
|
|
478
|
-
<span data-trigger-label class="${t ? "" : "search-select-placeholder"}">${t ?
|
|
482
|
+
<span data-trigger-label class="${t ? "" : "search-select-placeholder"}">${t ? I(this._value) : e}</span>
|
|
479
483
|
<i class="bi bi-calendar3" aria-hidden="true"></i>
|
|
480
484
|
</button>
|
|
481
485
|
<div class="datepicker-pop" role="dialog" hidden></div>
|
|
@@ -487,11 +491,11 @@ var E = class extends HTMLElement {
|
|
|
487
491
|
_syncTrigger() {
|
|
488
492
|
let e = this.querySelector("[data-trigger-label]");
|
|
489
493
|
if (!e) return;
|
|
490
|
-
let t =
|
|
491
|
-
e.textContent = t ?
|
|
494
|
+
let t = F(this._value);
|
|
495
|
+
e.textContent = t ? I(this._value) : this.getAttribute("placeholder") || "Enter Date", e.classList.toggle("search-select-placeholder", !t);
|
|
492
496
|
}
|
|
493
497
|
_renderMonth() {
|
|
494
|
-
let e = this.querySelector(".datepicker-pop"), t = new Date(this._viewY, this._viewM, 1).getDay(), n = new Date(this._viewY, this._viewM + 1, 0).getDate(), r =
|
|
498
|
+
let e = this.querySelector(".datepicker-pop"), t = new Date(this._viewY, this._viewM, 1).getDay(), n = new Date(this._viewY, this._viewM + 1, 0).getDate(), r = F(this._value), i = F(this.getAttribute("min")), a = F(this.getAttribute("max")), o = (e, t, n) => {
|
|
495
499
|
let r = new Date(e, t, n).getTime();
|
|
496
500
|
return !!(i && r < new Date(i.y, i.m, i.d).getTime() || a && r > new Date(a.y, a.m, a.d).getTime());
|
|
497
501
|
}, s = "";
|
|
@@ -503,7 +507,7 @@ var E = class extends HTMLElement {
|
|
|
503
507
|
e.innerHTML = `
|
|
504
508
|
<div class="datepicker-head">
|
|
505
509
|
<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>
|
|
506
|
-
<span class="datepicker-month">${
|
|
510
|
+
<span class="datepicker-month">${N[this._viewM]} ${this._viewY}</span>
|
|
507
511
|
<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>
|
|
508
512
|
</div>
|
|
509
513
|
<div class="datepicker-weekdays">${ee.map((e) => `<span>${e}</span>`).join("")}</div>
|
|
@@ -532,15 +536,18 @@ var E = class extends HTMLElement {
|
|
|
532
536
|
n && !n.disabled && (this.value = n.dataset.iso, i());
|
|
533
537
|
}), this._onDocClick = (e) => {
|
|
534
538
|
n() && !this.contains(e.target) && i();
|
|
535
|
-
}, document.addEventListener("click", this._onDocClick),
|
|
539
|
+
}, document.addEventListener("click", this._onDocClick), this._onDocKey = (e) => {
|
|
536
540
|
n() && e.key === "Escape" && i();
|
|
537
|
-
}), this._internalsSet();
|
|
541
|
+
}, document.addEventListener("keydown", this._onDocKey), this._internalsSet();
|
|
538
542
|
}
|
|
539
543
|
disconnectedCallback() {
|
|
540
|
-
this._onDocClick && document.removeEventListener("click", this._onDocClick);
|
|
544
|
+
this._onDocClick && document.removeEventListener("click", this._onDocClick), this._onDocKey && document.removeEventListener("keydown", this._onDocKey);
|
|
541
545
|
}
|
|
542
546
|
}, re = class extends HTMLElement {
|
|
543
547
|
static formAssociated = !0;
|
|
548
|
+
_accessibleName() {
|
|
549
|
+
return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Select";
|
|
550
|
+
}
|
|
544
551
|
static get observedAttributes() {
|
|
545
552
|
return [
|
|
546
553
|
"placeholder",
|
|
@@ -582,6 +589,7 @@ var E = class extends HTMLElement {
|
|
|
582
589
|
e.length && (this._declared = e.map((e) => ({
|
|
583
590
|
value: e.getAttribute("value") ?? e.textContent.trim(),
|
|
584
591
|
label: e.innerHTML,
|
|
592
|
+
[D]: !0,
|
|
585
593
|
selected: e.hasAttribute("selected")
|
|
586
594
|
})));
|
|
587
595
|
}
|
|
@@ -592,17 +600,21 @@ var E = class extends HTMLElement {
|
|
|
592
600
|
let t = this._readOptions().find((t) => String(t.value) === String(e));
|
|
593
601
|
return t ? t.label : e;
|
|
594
602
|
}
|
|
603
|
+
_labelHtmlFor(e) {
|
|
604
|
+
let t = this._readOptions().find((t) => String(t.value) === String(e));
|
|
605
|
+
return t ? k(t) : O(e);
|
|
606
|
+
}
|
|
595
607
|
render() {
|
|
596
608
|
this._snapshotDeclared();
|
|
597
609
|
let e = this.hasAttribute("searchable"), t = this.getAttribute("search-placeholder") || "Search…";
|
|
598
610
|
this._internals?.setFormValue(this._values.join(",")), this.innerHTML = `
|
|
599
611
|
<div class="search-select">
|
|
600
|
-
<div class="input search-select-control search-select-multi" role="combobox" aria-haspopup="listbox" aria-expanded="false"${this.hasAttribute("disabled") ? " aria-disabled=\"true\"" : ""}>
|
|
612
|
+
<div class="input search-select-control search-select-multi" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-label="${L(this._accessibleName())}"${this.hasAttribute("disabled") ? " aria-disabled=\"true\"" : ""}>
|
|
601
613
|
<div class="ms-chips" data-chips></div>
|
|
602
614
|
<i class="bi bi-chevron-down search-select-caret" aria-hidden="true"></i>
|
|
603
615
|
</div>
|
|
604
616
|
<div class="search-select-menu search-select-menu-fixed" role="listbox" aria-multiselectable="true" tabindex="-1" hidden>
|
|
605
|
-
${e ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${
|
|
617
|
+
${e ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${L(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>` : ""}
|
|
606
618
|
<div class="search-select-options"></div>
|
|
607
619
|
<div class="search-select-empty" hidden>No matches</div>
|
|
608
620
|
</div>
|
|
@@ -613,18 +625,18 @@ var E = class extends HTMLElement {
|
|
|
613
625
|
if (!e) return;
|
|
614
626
|
let t = this.getAttribute("placeholder") || "Select…";
|
|
615
627
|
if (!this._values.length) {
|
|
616
|
-
e.innerHTML = `<span class="search-select-placeholder">${
|
|
628
|
+
e.innerHTML = `<span class="search-select-placeholder">${O(t)}</span>`;
|
|
617
629
|
return;
|
|
618
630
|
}
|
|
619
|
-
e.innerHTML = this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${this.
|
|
631
|
+
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="${L(e)}" aria-label="Remove"><i class="bi bi-x" aria-hidden="true"></i></button></span>`).join("");
|
|
620
632
|
}
|
|
621
633
|
_renderOptions(e) {
|
|
622
634
|
let t = this.querySelector(".search-select-options"), n = this.querySelector(".search-select-empty");
|
|
623
635
|
if (!t) return;
|
|
624
636
|
let r = (e || "").trim().toLowerCase(), i = this._readOptions();
|
|
625
|
-
r && (i = i.filter((e) =>
|
|
637
|
+
r && (i = i.filter((e) => ie(e.label).toLowerCase().includes(r))), t.innerHTML = i.map((e) => {
|
|
626
638
|
let t = this._values.includes(String(e.value));
|
|
627
|
-
return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${
|
|
639
|
+
return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${L(e.value)}" aria-selected="${t}"><span class="ms-check"><i class="bi bi-check" aria-hidden="true"></i></span><span class="ms-opt-label">${k(e)}</span></button>`;
|
|
628
640
|
}).join(""), n && (n.hidden = i.length > 0), this._active = -1;
|
|
629
641
|
}
|
|
630
642
|
_wire() {
|
|
@@ -665,13 +677,19 @@ var E = class extends HTMLElement {
|
|
|
665
677
|
t && l(c().indexOf(t));
|
|
666
678
|
}), n?.addEventListener("input", () => {
|
|
667
679
|
this._renderOptions(n.value), r && (r.hidden = !n.value), l(-1);
|
|
668
|
-
})
|
|
680
|
+
});
|
|
681
|
+
let g = (t) => {
|
|
669
682
|
let r = c();
|
|
670
683
|
t.key === "ArrowDown" ? (t.preventDefault(), l(Math.min(this._active + 1, r.length - 1))) : t.key === "ArrowUp" ? (t.preventDefault(), l(Math.max(this._active - 1, 0))) : t.key === "Enter" ? (t.preventDefault(), r[this._active] && m(r[this._active].dataset.value)) : t.key === "Escape" ? (f(), e.focus()) : t.key === "Backspace" && !n.value && this._values.length && h(this._values[this._values.length - 1]);
|
|
671
|
-
}
|
|
684
|
+
};
|
|
685
|
+
n?.addEventListener("keydown", g), r?.addEventListener("click", () => {
|
|
672
686
|
n.value = "", this._renderOptions(""), r.hidden = !0, n.focus();
|
|
673
687
|
}), e.addEventListener("keydown", (e) => {
|
|
674
|
-
|
|
688
|
+
if (u()) {
|
|
689
|
+
g(e);
|
|
690
|
+
return;
|
|
691
|
+
}
|
|
692
|
+
(e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") && (e.preventDefault(), d());
|
|
675
693
|
}), this._onDocClick = (e) => {
|
|
676
694
|
u() && !this.contains(e.target) && f();
|
|
677
695
|
}, document.addEventListener("click", this._onDocClick), window.addEventListener("resize", () => {
|
|
@@ -681,7 +699,7 @@ var E = class extends HTMLElement {
|
|
|
681
699
|
disconnectedCallback() {
|
|
682
700
|
this._onDocClick && document.removeEventListener("click", this._onDocClick);
|
|
683
701
|
}
|
|
684
|
-
},
|
|
702
|
+
}, L = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), ie = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), ae = [
|
|
685
703
|
[
|
|
686
704
|
"AF",
|
|
687
705
|
"Afghanistan",
|
|
@@ -1907,11 +1925,11 @@ var E = class extends HTMLElement {
|
|
|
1907
1925
|
"Zimbabwe",
|
|
1908
1926
|
"263"
|
|
1909
1927
|
]
|
|
1910
|
-
],
|
|
1928
|
+
], R = (e) => (ae.find((t) => t[0] === e) || [
|
|
1911
1929
|
"",
|
|
1912
1930
|
"",
|
|
1913
1931
|
""
|
|
1914
|
-
])[2],
|
|
1932
|
+
])[2], z = (e) => `wui-flag wui-flag-${String(e).toLowerCase()}`, oe = class extends HTMLElement {
|
|
1915
1933
|
static formAssociated = !0;
|
|
1916
1934
|
static get observedAttributes() {
|
|
1917
1935
|
return [
|
|
@@ -1931,7 +1949,7 @@ var E = class extends HTMLElement {
|
|
|
1931
1949
|
this._rendered && (e === "country" && (this._country = n || "IN"), this.render());
|
|
1932
1950
|
}
|
|
1933
1951
|
get value() {
|
|
1934
|
-
return `+${
|
|
1952
|
+
return `+${R(this._country)}${this._national}`;
|
|
1935
1953
|
}
|
|
1936
1954
|
set value(e) {
|
|
1937
1955
|
this._national = String(e ?? "").replace(/[^0-9]/g, ""), this._commit();
|
|
@@ -1942,21 +1960,21 @@ var E = class extends HTMLElement {
|
|
|
1942
1960
|
render() {
|
|
1943
1961
|
let e = this.getAttribute("placeholder") || "Enter phone number";
|
|
1944
1962
|
this._country = this.getAttribute("country") || this._country;
|
|
1945
|
-
let t =
|
|
1963
|
+
let t = ae.map(([e, t, n]) => `<button type="button" role="option" class="country-dropdown-item${e === this._country ? " selected" : ""}" data-iso="${e}"><span class="${z(e)}" aria-hidden="true"></span><span class="country-name-text">${t}<span class="country-code-text">+${n}</span></span></button>`).join("");
|
|
1946
1964
|
this.innerHTML = `
|
|
1947
1965
|
<div class="phone-input-wrap">
|
|
1948
1966
|
<div class="phone-country-adornment">
|
|
1949
1967
|
<button type="button" class="country-toggle" aria-haspopup="listbox" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}>
|
|
1950
|
-
<span class="${
|
|
1968
|
+
<span class="${z(this._country)}" data-flag aria-hidden="true"></span>
|
|
1951
1969
|
<i class="bi bi-chevron-down phone-chevron" aria-hidden="true"></i>
|
|
1952
|
-
<span class="phone-dial" data-dial>+${
|
|
1970
|
+
<span class="phone-dial" data-dial>+${R(this._country)}</span>
|
|
1953
1971
|
</button>
|
|
1954
1972
|
<div class="country-dropdown-menu" role="listbox" hidden>
|
|
1955
1973
|
<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>
|
|
1956
1974
|
<div class="country-list-scroll">${t}<div class="country-empty" hidden>No countries found</div></div>
|
|
1957
1975
|
</div>
|
|
1958
1976
|
</div>
|
|
1959
|
-
<input type="tel" class="input" placeholder="${
|
|
1977
|
+
<input type="tel" class="input" placeholder="${B(e)}" value="${B(this._national)}"${this.hasAttribute("disabled") ? " disabled" : ""} />
|
|
1960
1978
|
</div>`, this._rendered = !0, this._wire();
|
|
1961
1979
|
}
|
|
1962
1980
|
_wire() {
|
|
@@ -1981,7 +1999,7 @@ var E = class extends HTMLElement {
|
|
|
1981
1999
|
}
|
|
1982
2000
|
i && (i.hidden = n > 0);
|
|
1983
2001
|
}, p = (e) => {
|
|
1984
|
-
this._country = e, this.setAttribute("country", e), o && (o.className =
|
|
2002
|
+
this._country = e, this.setAttribute("country", e), o && (o.className = z(e)), s && (s.textContent = `+${R(e)}`);
|
|
1985
2003
|
for (let t of r.querySelectorAll(".country-dropdown-item")) t.classList.toggle("selected", t.dataset.iso === e);
|
|
1986
2004
|
d(), this._commit();
|
|
1987
2005
|
};
|
|
@@ -1997,7 +2015,7 @@ var E = class extends HTMLElement {
|
|
|
1997
2015
|
disconnectedCallback() {
|
|
1998
2016
|
this._reposition && (window.removeEventListener("scroll", this._reposition, !0), window.removeEventListener("resize", this._reposition)), this._onDocClick && document.removeEventListener("click", this._onDocClick);
|
|
1999
2017
|
}
|
|
2000
|
-
},
|
|
2018
|
+
}, B = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), se = class extends HTMLElement {
|
|
2001
2019
|
static formAssociated = !0;
|
|
2002
2020
|
static get observedAttributes() {
|
|
2003
2021
|
return [
|
|
@@ -2006,9 +2024,13 @@ var E = class extends HTMLElement {
|
|
|
2006
2024
|
"search-placeholder",
|
|
2007
2025
|
"searchable",
|
|
2008
2026
|
"disabled",
|
|
2009
|
-
"compact"
|
|
2027
|
+
"compact",
|
|
2028
|
+
"aria-label"
|
|
2010
2029
|
];
|
|
2011
2030
|
}
|
|
2031
|
+
_accessibleName() {
|
|
2032
|
+
return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Select";
|
|
2033
|
+
}
|
|
2012
2034
|
constructor() {
|
|
2013
2035
|
super(), this._internals = this.attachInternals ? this.attachInternals() : null, this._value = "", this._optionsProp = null, this._active = -1;
|
|
2014
2036
|
}
|
|
@@ -2036,6 +2058,7 @@ var E = class extends HTMLElement {
|
|
|
2036
2058
|
e.length && (this._declared = e.map((e) => ({
|
|
2037
2059
|
value: e.getAttribute("value") ?? e.textContent.trim(),
|
|
2038
2060
|
label: e.innerHTML,
|
|
2061
|
+
[D]: !0,
|
|
2039
2062
|
selected: e.hasAttribute("selected")
|
|
2040
2063
|
})));
|
|
2041
2064
|
}
|
|
@@ -2048,16 +2071,16 @@ var E = class extends HTMLElement {
|
|
|
2048
2071
|
i && (this._value = String(i.value)), this._internals?.setFormValue(this._value);
|
|
2049
2072
|
let a = e.map((e) => {
|
|
2050
2073
|
let t = String(e.value) === String(this._value);
|
|
2051
|
-
return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${
|
|
2074
|
+
return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${V(e.value)}" aria-selected="${t}">${k(e)}</button>`;
|
|
2052
2075
|
}).join("");
|
|
2053
2076
|
this.innerHTML = `
|
|
2054
2077
|
<div class="search-select${this.hasAttribute("compact") ? " search-select-compact" : ""}">
|
|
2055
|
-
<button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}>
|
|
2056
|
-
<span class="${i ? "" : "search-select-placeholder"}" data-label>${i ? i
|
|
2078
|
+
<button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false" aria-label="${V(this._accessibleName())}"${this.hasAttribute("disabled") ? " disabled" : ""}>
|
|
2079
|
+
<span class="${i ? "" : "search-select-placeholder"}" data-label>${i ? k(i) : O(n)}</span>
|
|
2057
2080
|
<i class="bi bi-chevron-down search-select-caret" aria-hidden="true"></i>
|
|
2058
2081
|
</button>
|
|
2059
2082
|
<div class="search-select-menu search-select-menu-fixed" role="listbox" tabindex="-1" hidden>
|
|
2060
|
-
${t ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${
|
|
2083
|
+
${t ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${V(r)}" 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>` : ""}
|
|
2061
2084
|
<div class="search-select-options">${a}<div class="search-select-empty" hidden>No matches</div></div>
|
|
2062
2085
|
</div>
|
|
2063
2086
|
</div>`, this._rendered = !0, this._wire();
|
|
@@ -2085,7 +2108,7 @@ var E = class extends HTMLElement {
|
|
|
2085
2108
|
let t = e.dataset.value === String(this._value);
|
|
2086
2109
|
e.classList.toggle("selected", t), e.setAttribute("aria-selected", String(t));
|
|
2087
2110
|
}
|
|
2088
|
-
e && (e.innerHTML = t ? t
|
|
2111
|
+
e && (e.innerHTML = t ? k(t) : e.innerHTML, e.classList.toggle("search-select-placeholder", !t));
|
|
2089
2112
|
}
|
|
2090
2113
|
_wire() {
|
|
2091
2114
|
let e = this._refs();
|
|
@@ -2116,7 +2139,11 @@ var E = class extends HTMLElement {
|
|
|
2116
2139
|
t.key === "ArrowDown" ? (t.preventDefault(), n(Math.min(this._active + 1, r.length - 1))) : t.key === "ArrowUp" ? (t.preventDefault(), n(Math.max(this._active - 1, 0))) : t.key === "Enter" ? (t.preventDefault(), r[this._active] && s(r[this._active])) : t.key === "Escape" && (o(), e.control.focus());
|
|
2117
2140
|
};
|
|
2118
2141
|
e.control.addEventListener("click", () => i() ? o() : a()), e.control.addEventListener("keydown", (e) => {
|
|
2119
|
-
|
|
2142
|
+
if (i()) {
|
|
2143
|
+
c(e);
|
|
2144
|
+
return;
|
|
2145
|
+
}
|
|
2146
|
+
(e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") && (e.preventDefault(), a());
|
|
2120
2147
|
}), e.optionsWrap.addEventListener("click", (e) => {
|
|
2121
2148
|
let t = e.target.closest(".search-select-option");
|
|
2122
2149
|
t && s(t);
|
|
@@ -2136,7 +2163,7 @@ var E = class extends HTMLElement {
|
|
|
2136
2163
|
disconnectedCallback() {
|
|
2137
2164
|
this._onDocClick && document.removeEventListener("click", this._onDocClick);
|
|
2138
2165
|
}
|
|
2139
|
-
},
|
|
2166
|
+
}, V = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), H = "image/png,image/jpeg,image/webp", ce = {
|
|
2140
2167
|
"image/png": [".png"],
|
|
2141
2168
|
"image/jpeg": [".jpg", ".jpeg"],
|
|
2142
2169
|
"image/webp": [".webp"],
|
|
@@ -2157,36 +2184,36 @@ var E = class extends HTMLElement {
|
|
|
2157
2184
|
".gif": "GIF",
|
|
2158
2185
|
".svg": "SVG",
|
|
2159
2186
|
".pdf": "PDF"
|
|
2160
|
-
},
|
|
2187
|
+
}, U = (e) => String(e || "").split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
|
|
2161
2188
|
function ue(e) {
|
|
2162
2189
|
let t = [];
|
|
2163
|
-
for (let n of
|
|
2190
|
+
for (let n of U(e)) {
|
|
2164
2191
|
let e = le[n] || (n.startsWith(".") ? n.slice(1).toUpperCase() : n.toUpperCase());
|
|
2165
2192
|
t.includes(e) || t.push(e);
|
|
2166
2193
|
}
|
|
2167
2194
|
return t.length <= 1 ? t[0] || "supported" : `${t.slice(0, -1).join(", ")} or ${t[t.length - 1]}`;
|
|
2168
2195
|
}
|
|
2169
2196
|
function de(e, t) {
|
|
2170
|
-
let n =
|
|
2197
|
+
let n = U(t);
|
|
2171
2198
|
if (!n.length) return !0;
|
|
2172
2199
|
let r = (e.type || "").toLowerCase(), i = (e.name || "").toLowerCase();
|
|
2173
2200
|
return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (ce[e] || []).some((e) => i.endsWith(e)));
|
|
2174
2201
|
}
|
|
2175
|
-
function
|
|
2202
|
+
function W(e, t = {}) {
|
|
2176
2203
|
if (!e) return null;
|
|
2177
|
-
let n = t.accept === void 0 ?
|
|
2204
|
+
let n = t.accept === void 0 ? H : t.accept, r = t.maxSizeMb || 5;
|
|
2178
2205
|
return de(e, n) ? e.size > r * 1024 * 1024 ? `Keep the file under ${r} MB.` : null : `Choose a ${ue(n)} file.`;
|
|
2179
2206
|
}
|
|
2180
|
-
var
|
|
2207
|
+
var G = (e, t) => {
|
|
2181
2208
|
typeof customElements < "u" && !customElements.get(e) && customElements.define(e, t);
|
|
2182
2209
|
};
|
|
2183
2210
|
function fe() {
|
|
2184
|
-
|
|
2211
|
+
G("wui-select", se), G("wui-phone", oe), G("wui-datepicker", ne), G("wui-autocomplete", A), G("wui-multiselect", re), G("wui-status-icon", E);
|
|
2185
2212
|
}
|
|
2186
2213
|
fe();
|
|
2187
2214
|
//#endregion
|
|
2188
2215
|
//#region src/components/RequiredMark.jsx
|
|
2189
|
-
function
|
|
2216
|
+
function K() {
|
|
2190
2217
|
return /* @__PURE__ */ t("span", {
|
|
2191
2218
|
className: "required",
|
|
2192
2219
|
"aria-hidden": "true",
|
|
@@ -2229,9 +2256,10 @@ function pe({ value: e, onChange: r, options: a, loadOptions: o, placeholder: c
|
|
|
2229
2256
|
p && /* @__PURE__ */ n("label", {
|
|
2230
2257
|
className: "label",
|
|
2231
2258
|
htmlFor: f,
|
|
2232
|
-
children: [p, g && /* @__PURE__ */ t(
|
|
2259
|
+
children: [p, g && /* @__PURE__ */ t(K, {})]
|
|
2233
2260
|
}),
|
|
2234
2261
|
/* @__PURE__ */ t("wui-autocomplete", {
|
|
2262
|
+
"aria-label": typeof p == "string" ? p : void 0,
|
|
2235
2263
|
id: f,
|
|
2236
2264
|
ref: v,
|
|
2237
2265
|
name: f,
|
|
@@ -2298,14 +2326,14 @@ var _e = {
|
|
|
2298
2326
|
ghost: "link",
|
|
2299
2327
|
danger: "danger"
|
|
2300
2328
|
};
|
|
2301
|
-
function
|
|
2329
|
+
function q(e, n) {
|
|
2302
2330
|
return e ? typeof e == "string" ? /* @__PURE__ */ t(x, {
|
|
2303
2331
|
name: e,
|
|
2304
2332
|
size: 16,
|
|
2305
2333
|
className: n === "left" ? "me-2" : "ms-2"
|
|
2306
2334
|
}) : e : null;
|
|
2307
2335
|
}
|
|
2308
|
-
function
|
|
2336
|
+
function J({ children: e, variant: r = "primary", size: i = "md", type: a = "button", loading: o = !1, disabled: s = !1, block: c = !1, leftIcon: l = null, rightIcon: u = null, className: f = "", ...p }) {
|
|
2309
2337
|
let m = [c ? "w-100" : "", f].filter(Boolean).join(" ");
|
|
2310
2338
|
return /* @__PURE__ */ n(d, {
|
|
2311
2339
|
type: a,
|
|
@@ -2319,9 +2347,9 @@ function K({ children: e, variant: r = "primary", size: i = "md", type: a = "but
|
|
|
2319
2347
|
className: "spinner-border spinner-border-sm me-2",
|
|
2320
2348
|
"aria-hidden": "true"
|
|
2321
2349
|
}),
|
|
2322
|
-
!o &&
|
|
2350
|
+
!o && q(l, "left"),
|
|
2323
2351
|
e,
|
|
2324
|
-
!o &&
|
|
2352
|
+
!o && q(u, "right")
|
|
2325
2353
|
]
|
|
2326
2354
|
});
|
|
2327
2355
|
}
|
|
@@ -2513,7 +2541,7 @@ function we({ value: e = "#000000", onChange: r, label: i, required: a = !1, err
|
|
|
2513
2541
|
i && /* @__PURE__ */ n("label", {
|
|
2514
2542
|
className: "label",
|
|
2515
2543
|
htmlFor: f,
|
|
2516
|
-
children: [i, a && /* @__PURE__ */ t(
|
|
2544
|
+
children: [i, a && /* @__PURE__ */ t(K, {})]
|
|
2517
2545
|
}),
|
|
2518
2546
|
/* @__PURE__ */ n("div", {
|
|
2519
2547
|
className: "color-field",
|
|
@@ -2587,7 +2615,7 @@ function Te({ columns: e = [], rows: r = [], caption: i, className: a = "" }) {
|
|
|
2587
2615
|
}
|
|
2588
2616
|
//#endregion
|
|
2589
2617
|
//#region src/components/AppInfoTip.jsx
|
|
2590
|
-
function
|
|
2618
|
+
function Y({ label: e, children: r }) {
|
|
2591
2619
|
let [i, l] = c(!1), [u, d] = c(null), f = s(null), p = s(null), h = a();
|
|
2592
2620
|
return o(() => {
|
|
2593
2621
|
if (!i || !f.current || !p.current) return;
|
|
@@ -2633,7 +2661,7 @@ function q({ label: e, children: r }) {
|
|
|
2633
2661
|
}
|
|
2634
2662
|
//#endregion
|
|
2635
2663
|
//#region src/components/AppInput.jsx
|
|
2636
|
-
var
|
|
2664
|
+
var X = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, helpLabel: s = "More information", type: l = "text", leftIcon: u, rightIcon: d, onRightIconClick: f, unit: m, id: h, name: g, className: _ = "", fieldClassName: v = "", disabled: y = !1, ...b }, S) {
|
|
2637
2665
|
let [C, w] = c(!1), T = h || g, E = l === "password", D = E && C ? "text" : l, O = [
|
|
2638
2666
|
"input",
|
|
2639
2667
|
i ? "error" : "",
|
|
@@ -2700,11 +2728,11 @@ var J = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, hel
|
|
|
2700
2728
|
htmlFor: T,
|
|
2701
2729
|
children: [
|
|
2702
2730
|
e,
|
|
2703
|
-
o && /* @__PURE__ */ t(
|
|
2731
|
+
o && /* @__PURE__ */ t(Y, {
|
|
2704
2732
|
label: s,
|
|
2705
2733
|
children: o
|
|
2706
2734
|
}),
|
|
2707
|
-
r && /* @__PURE__ */ t(
|
|
2735
|
+
r && /* @__PURE__ */ t(K, {})
|
|
2708
2736
|
]
|
|
2709
2737
|
}),
|
|
2710
2738
|
A,
|
|
@@ -2718,7 +2746,7 @@ var J = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, hel
|
|
|
2718
2746
|
]
|
|
2719
2747
|
});
|
|
2720
2748
|
}), Ee = "a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])";
|
|
2721
|
-
function
|
|
2749
|
+
function Z({ open: e, title: r, subtitle: a, headerIcon: o, onClose: c, footer: l, size: u, wide: d = !1, side: f = !1, maxWidth: p, hideHeader: m = !1, className: g = "", children: _ }) {
|
|
2722
2750
|
let v = s(null);
|
|
2723
2751
|
i(() => {
|
|
2724
2752
|
if (!e) return;
|
|
@@ -2804,27 +2832,27 @@ function Y({ open: e, title: r, subtitle: a, headerIcon: o, onClose: c, footer:
|
|
|
2804
2832
|
}
|
|
2805
2833
|
//#endregion
|
|
2806
2834
|
//#region src/components/ModalIcons.jsx
|
|
2807
|
-
var
|
|
2835
|
+
var Q = (e) => function({ size: n = 72 }) {
|
|
2808
2836
|
return /* @__PURE__ */ t("wui-status-icon", {
|
|
2809
2837
|
tone: e,
|
|
2810
2838
|
size: n
|
|
2811
2839
|
});
|
|
2812
|
-
},
|
|
2813
|
-
success:
|
|
2814
|
-
error:
|
|
2815
|
-
warning:
|
|
2816
|
-
info:
|
|
2817
|
-
delete:
|
|
2840
|
+
}, De = {
|
|
2841
|
+
success: Q("success"),
|
|
2842
|
+
error: Q("error"),
|
|
2843
|
+
warning: Q("warning"),
|
|
2844
|
+
info: Q("info"),
|
|
2845
|
+
delete: Q("delete")
|
|
2818
2846
|
};
|
|
2819
2847
|
//#endregion
|
|
2820
2848
|
//#region src/components/AppConfirmDialog.jsx
|
|
2821
|
-
function
|
|
2849
|
+
function Oe({ open: r, title: a, message: o, confirmLabel: s = "Confirm", cancelLabel: l = "Cancel", danger: u = !1, tone: d, confirmPhrase: f, onConfirm: p, onClose: m }) {
|
|
2822
2850
|
let [h, g] = c("");
|
|
2823
2851
|
if (i(() => {
|
|
2824
2852
|
r || g("");
|
|
2825
2853
|
}, [r]), !r) return null;
|
|
2826
|
-
let _ = !!f && h.trim() !== f, v =
|
|
2827
|
-
return /* @__PURE__ */ t(
|
|
2854
|
+
let _ = !!f && h.trim() !== f, v = De[d || (u ? "delete" : "info")];
|
|
2855
|
+
return /* @__PURE__ */ t(Z, {
|
|
2828
2856
|
open: r,
|
|
2829
2857
|
hideHeader: !0,
|
|
2830
2858
|
title: a,
|
|
@@ -2832,11 +2860,11 @@ function De({ open: r, title: a, message: o, confirmLabel: s = "Confirm", cancel
|
|
|
2832
2860
|
className: "lx-confirm",
|
|
2833
2861
|
footer: /* @__PURE__ */ n("div", {
|
|
2834
2862
|
className: "lx-confirm-actions",
|
|
2835
|
-
children: [/* @__PURE__ */ t(
|
|
2863
|
+
children: [/* @__PURE__ */ t(J, {
|
|
2836
2864
|
variant: "secondary",
|
|
2837
2865
|
onClick: m,
|
|
2838
2866
|
children: l
|
|
2839
|
-
}), /* @__PURE__ */ t(
|
|
2867
|
+
}), /* @__PURE__ */ t(J, {
|
|
2840
2868
|
variant: u ? "danger" : "primary",
|
|
2841
2869
|
disabled: _,
|
|
2842
2870
|
onClick: p,
|
|
@@ -2858,7 +2886,7 @@ function De({ open: r, title: a, message: o, confirmLabel: s = "Confirm", cancel
|
|
|
2858
2886
|
className: "lx-confirm-msg",
|
|
2859
2887
|
children: o
|
|
2860
2888
|
}),
|
|
2861
|
-
f && /* @__PURE__ */ t(
|
|
2889
|
+
f && /* @__PURE__ */ t(X, {
|
|
2862
2890
|
fieldClassName: "mt-3 mb-0 w-100 text-start",
|
|
2863
2891
|
label: /* @__PURE__ */ n(e, { children: [
|
|
2864
2892
|
"Type ",
|
|
@@ -2875,7 +2903,7 @@ function De({ open: r, title: a, message: o, confirmLabel: s = "Confirm", cancel
|
|
|
2875
2903
|
}
|
|
2876
2904
|
//#endregion
|
|
2877
2905
|
//#region src/components/AppSkeleton.jsx
|
|
2878
|
-
function
|
|
2906
|
+
function ke({ width: e = "100%", height: n = 14, radius: r = 6, className: i = "", style: a }) {
|
|
2879
2907
|
return /* @__PURE__ */ t("span", {
|
|
2880
2908
|
className: `skeleton${i ? ` ${i}` : ""}`,
|
|
2881
2909
|
"aria-hidden": "true",
|
|
@@ -2887,7 +2915,7 @@ function Q({ width: e = "100%", height: n = 14, radius: r = 6, className: i = ""
|
|
|
2887
2915
|
}
|
|
2888
2916
|
});
|
|
2889
2917
|
}
|
|
2890
|
-
var
|
|
2918
|
+
var Ae = [
|
|
2891
2919
|
"r0",
|
|
2892
2920
|
"r1",
|
|
2893
2921
|
"r2",
|
|
@@ -2896,7 +2924,7 @@ var Oe = [
|
|
|
2896
2924
|
"r5",
|
|
2897
2925
|
"r6",
|
|
2898
2926
|
"r7"
|
|
2899
|
-
],
|
|
2927
|
+
], je = [
|
|
2900
2928
|
"c0",
|
|
2901
2929
|
"c1",
|
|
2902
2930
|
"c2",
|
|
@@ -2906,15 +2934,15 @@ var Oe = [
|
|
|
2906
2934
|
"c6",
|
|
2907
2935
|
"c7"
|
|
2908
2936
|
];
|
|
2909
|
-
function
|
|
2910
|
-
return
|
|
2937
|
+
function Me({ rows: e = 4, cols: n = 5 }) {
|
|
2938
|
+
return Ae.slice(0, e).map((e) => /* @__PURE__ */ t("tr", { children: je.slice(0, n).map((e, n) => /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(ke, {
|
|
2911
2939
|
width: n === 0 ? "70%" : "50%",
|
|
2912
2940
|
height: 12
|
|
2913
2941
|
}) }, e)) }, e));
|
|
2914
2942
|
}
|
|
2915
2943
|
//#endregion
|
|
2916
2944
|
//#region src/components/AppSelectMini.jsx
|
|
2917
|
-
function
|
|
2945
|
+
function Ne({ value: e, onChange: n, options: r = [], placeholder: a = "Select...", name: o, ariaLabel: c, id: l, disabled: u }) {
|
|
2918
2946
|
let d = s(null);
|
|
2919
2947
|
return i(() => {
|
|
2920
2948
|
d.current && (d.current.options = r.map((e) => ({
|
|
@@ -2941,19 +2969,19 @@ function je({ value: e, onChange: n, options: r = [], placeholder: a = "Select..
|
|
|
2941
2969
|
}
|
|
2942
2970
|
//#endregion
|
|
2943
2971
|
//#region src/components/AppTablePagination.jsx
|
|
2944
|
-
var
|
|
2972
|
+
var Pe = [
|
|
2945
2973
|
5,
|
|
2946
2974
|
10,
|
|
2947
2975
|
25,
|
|
2948
2976
|
50
|
|
2949
2977
|
];
|
|
2950
|
-
function
|
|
2978
|
+
function Fe({ page: e, totalPages: r, pageSize: i, total: a, firstRow: o, lastRow: s, onPageChange: c, onPageSizeChange: l, pageSizes: u = Pe }) {
|
|
2951
2979
|
return /* @__PURE__ */ n("div", {
|
|
2952
2980
|
className: "table-pagination",
|
|
2953
2981
|
children: [
|
|
2954
2982
|
/* @__PURE__ */ n("span", {
|
|
2955
2983
|
className: "tpg-rows",
|
|
2956
|
-
children: ["Rows per page:", /* @__PURE__ */ t(
|
|
2984
|
+
children: ["Rows per page:", /* @__PURE__ */ t(Ne, {
|
|
2957
2985
|
compact: !0,
|
|
2958
2986
|
value: i,
|
|
2959
2987
|
onChange: (e) => l(Number(e)),
|
|
@@ -2979,8 +3007,8 @@ function Ne({ page: e, pageCount: r, pageSize: i, total: a, firstRow: o, lastRow
|
|
|
2979
3007
|
children: [/* @__PURE__ */ t("button", {
|
|
2980
3008
|
type: "button",
|
|
2981
3009
|
className: "tpg-arrow",
|
|
2982
|
-
onClick: () => c(Math.max(
|
|
2983
|
-
disabled: e
|
|
3010
|
+
onClick: () => c(Math.max(1, e - 1)),
|
|
3011
|
+
disabled: e <= 1,
|
|
2984
3012
|
"aria-label": "Previous page",
|
|
2985
3013
|
children: /* @__PURE__ */ t(x, {
|
|
2986
3014
|
name: "arrow-left",
|
|
@@ -2989,8 +3017,8 @@ function Ne({ page: e, pageCount: r, pageSize: i, total: a, firstRow: o, lastRow
|
|
|
2989
3017
|
}), /* @__PURE__ */ t("button", {
|
|
2990
3018
|
type: "button",
|
|
2991
3019
|
className: "tpg-arrow",
|
|
2992
|
-
onClick: () => c(Math.min(r
|
|
2993
|
-
disabled: e >= r
|
|
3020
|
+
onClick: () => c(Math.min(r, e + 1)),
|
|
3021
|
+
disabled: e >= r,
|
|
2994
3022
|
"aria-label": "Next page",
|
|
2995
3023
|
children: /* @__PURE__ */ t(x, {
|
|
2996
3024
|
name: "arrow-right",
|
|
@@ -3003,13 +3031,13 @@ function Ne({ page: e, pageCount: r, pageSize: i, total: a, firstRow: o, lastRow
|
|
|
3003
3031
|
}
|
|
3004
3032
|
//#endregion
|
|
3005
3033
|
//#region src/components/AppDataTable.jsx
|
|
3006
|
-
function
|
|
3034
|
+
function Ie(e) {
|
|
3007
3035
|
return e === "end" ? "lx-cell-end" : e === "num" ? "num" : e === "center" ? "text-center" : "";
|
|
3008
3036
|
}
|
|
3009
|
-
function
|
|
3037
|
+
function Le(e) {
|
|
3010
3038
|
return e == null || e === "" ? "—" : e;
|
|
3011
3039
|
}
|
|
3012
|
-
function
|
|
3040
|
+
function Re({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s, loading: c = !1, skeletonRows: l = 5, empty: u = "No records found.", emptyFiltered: d, sourceCount: f, rowActions: p, rowActionsLabel: m, pagination: h, ariaLabel: g, className: _ = "", selectable: v = !1, selectedIds: y, onToggleRow: b, onToggleAll: S }) {
|
|
3013
3041
|
let C = Math.max(1, r.length + +!!p + +!!v), w = v && i ? i.reduce((e, t) => e + +!!y?.has(a(t)), 0) : 0, T = v && i && i.length > 0 && w === i.length, E = w > 0 && !T, D = (e) => {
|
|
3014
3042
|
e && (e.indeterminate = E);
|
|
3015
3043
|
}, O = d !== void 0 && f > 0 ? d : u;
|
|
@@ -3033,7 +3061,7 @@ function Ie({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3033
3061
|
r.map((e) => {
|
|
3034
3062
|
let r = !!(e.sortable && s), i = o && o.key === e.key;
|
|
3035
3063
|
return /* @__PURE__ */ n("th", {
|
|
3036
|
-
className: (r ? "sortable " : "") +
|
|
3064
|
+
className: (r ? "sortable " : "") + Ie(e.align),
|
|
3037
3065
|
style: e.width ? { width: e.width } : void 0,
|
|
3038
3066
|
tabIndex: r ? 0 : void 0,
|
|
3039
3067
|
"aria-sort": i ? o.dir === "asc" ? "ascending" : "descending" : r ? "none" : void 0,
|
|
@@ -3060,7 +3088,7 @@ function Ie({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3060
3088
|
children: "Actions"
|
|
3061
3089
|
})
|
|
3062
3090
|
}))
|
|
3063
|
-
] }) }), /* @__PURE__ */ t("tbody", { children: c ? /* @__PURE__ */ t(
|
|
3091
|
+
] }) }), /* @__PURE__ */ t("tbody", { children: c ? /* @__PURE__ */ t(Me, {
|
|
3064
3092
|
rows: l,
|
|
3065
3093
|
cols: C
|
|
3066
3094
|
}) : i?.length ? i.map((e) => {
|
|
@@ -3079,8 +3107,8 @@ function Ie({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3079
3107
|
})
|
|
3080
3108
|
}),
|
|
3081
3109
|
r.map((n) => /* @__PURE__ */ t("td", {
|
|
3082
|
-
className:
|
|
3083
|
-
children: n.render ? n.render(e) :
|
|
3110
|
+
className: Ie(n.align) + (n.cellClassName ? ` ${n.cellClassName}` : ""),
|
|
3111
|
+
children: n.render ? n.render(e) : Le(e[n.key])
|
|
3084
3112
|
}, n.key)),
|
|
3085
3113
|
p && /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t("div", {
|
|
3086
3114
|
className: "u-row-actions",
|
|
@@ -3094,9 +3122,9 @@ function Ie({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3094
3122
|
children: O
|
|
3095
3123
|
}) }) })]
|
|
3096
3124
|
})
|
|
3097
|
-
}), h && !c && h.total > 0 && /* @__PURE__ */ t(
|
|
3125
|
+
}), h && !c && h.total > 0 && /* @__PURE__ */ t(Fe, {
|
|
3098
3126
|
page: h.page,
|
|
3099
|
-
|
|
3127
|
+
totalPages: h.totalPages,
|
|
3100
3128
|
pageSize: h.pageSize,
|
|
3101
3129
|
total: h.total,
|
|
3102
3130
|
firstRow: h.firstRow,
|
|
@@ -3107,7 +3135,7 @@ function Ie({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3107
3135
|
}
|
|
3108
3136
|
//#endregion
|
|
3109
3137
|
//#region src/components/AppDatePicker.jsx
|
|
3110
|
-
function
|
|
3138
|
+
function ze({ value: e, onChange: r, label: o, required: c = !1, hint: l, error: u, name: d, min: f, max: p, placeholder: m = "Enter Date", disabled: h, id: g, ariaLabel: _, className: v = "" }) {
|
|
3111
3139
|
let y = s(null), b = a(), x = g || d || b;
|
|
3112
3140
|
i(() => {
|
|
3113
3141
|
let t = y.current;
|
|
@@ -3155,7 +3183,7 @@ function Le({ value: e, onChange: r, label: o, required: c = !1, hint: l, error:
|
|
|
3155
3183
|
}
|
|
3156
3184
|
//#endregion
|
|
3157
3185
|
//#region src/components/AppDropdown.jsx
|
|
3158
|
-
var
|
|
3186
|
+
var Be = r(function({ icon: e, iconSize: n = 20, btnClassName: r = "topbar-icon-btn", label: i, align: a = "end", "aria-label": o, className: s, ...c }, l) {
|
|
3159
3187
|
return /* @__PURE__ */ t("button", {
|
|
3160
3188
|
ref: l,
|
|
3161
3189
|
type: "button",
|
|
@@ -3169,11 +3197,11 @@ var Re = r(function({ icon: e, iconSize: n = 20, btnClassName: r = "topbar-icon-
|
|
|
3169
3197
|
})
|
|
3170
3198
|
});
|
|
3171
3199
|
});
|
|
3172
|
-
function
|
|
3200
|
+
function Ve({ icon: e, iconSize: r, toggleClassName: i = "topbar-icon-btn", label: a, ariaLabel: o, align: s = "end", items: c = [], menuClassName: l = "", linkComponent: u }) {
|
|
3173
3201
|
return /* @__PURE__ */ n(g, {
|
|
3174
3202
|
align: s,
|
|
3175
3203
|
children: [/* @__PURE__ */ t(g.Toggle, {
|
|
3176
|
-
as:
|
|
3204
|
+
as: Be,
|
|
3177
3205
|
icon: e,
|
|
3178
3206
|
iconSize: r,
|
|
3179
3207
|
btnClassName: i,
|
|
@@ -3209,7 +3237,7 @@ function ze({ icon: e, iconSize: r, toggleClassName: i = "topbar-icon-btn", labe
|
|
|
3209
3237
|
}
|
|
3210
3238
|
//#endregion
|
|
3211
3239
|
//#region src/components/AppEmptyState.jsx
|
|
3212
|
-
function
|
|
3240
|
+
function He({ icon: e, iconSize: r = 24, size: i = "md", title: a, text: o, action: s, className: c = "", style: l }) {
|
|
3213
3241
|
return /* @__PURE__ */ n("div", {
|
|
3214
3242
|
className: [
|
|
3215
3243
|
"empty-state",
|
|
@@ -3242,7 +3270,7 @@ function Be({ icon: e, iconSize: r = 24, size: i = "md", title: a, text: o, acti
|
|
|
3242
3270
|
}
|
|
3243
3271
|
//#endregion
|
|
3244
3272
|
//#region src/components/AppFileAttachment.jsx
|
|
3245
|
-
function
|
|
3273
|
+
function Ue({ label: r = "Attachment", value: o, name: s, onChange: l, accept: u = H, maxSizeMb: d = 5, optional: f = !1, error: p, id: m }) {
|
|
3246
3274
|
let h = a(), g = m || s || h, [_, v] = c(null), [y, b] = c("");
|
|
3247
3275
|
i(() => {
|
|
3248
3276
|
if (o instanceof File) {
|
|
@@ -3254,7 +3282,7 @@ function Ve({ label: r = "Attachment", value: o, name: s, onChange: l, accept: u
|
|
|
3254
3282
|
function S(e) {
|
|
3255
3283
|
let t = e.target.files?.[0];
|
|
3256
3284
|
if (e.target.value = "", !t) return;
|
|
3257
|
-
let n =
|
|
3285
|
+
let n = W(t, {
|
|
3258
3286
|
accept: u,
|
|
3259
3287
|
maxSizeMb: d
|
|
3260
3288
|
});
|
|
@@ -3353,22 +3381,22 @@ function Ve({ label: r = "Attachment", value: o, name: s, onChange: l, accept: u
|
|
|
3353
3381
|
}
|
|
3354
3382
|
//#endregion
|
|
3355
3383
|
//#region src/components/toast.js
|
|
3356
|
-
var
|
|
3384
|
+
var We = /* @__PURE__ */ new Set([
|
|
3357
3385
|
"success",
|
|
3358
3386
|
"info",
|
|
3359
3387
|
"warning",
|
|
3360
3388
|
"error"
|
|
3361
3389
|
]);
|
|
3362
3390
|
function $(e, t = "success") {
|
|
3363
|
-
let n =
|
|
3391
|
+
let n = We.has(t) ? t : "success";
|
|
3364
3392
|
_[n](e, { toastId: `${n}:${e}` });
|
|
3365
3393
|
}
|
|
3366
|
-
function
|
|
3394
|
+
function Ge(e) {
|
|
3367
3395
|
_.error(e, { toastId: `error:${e}` });
|
|
3368
3396
|
}
|
|
3369
3397
|
//#endregion
|
|
3370
3398
|
//#region src/components/AppFilePicker.jsx
|
|
3371
|
-
function
|
|
3399
|
+
function Ke({ label: e, value: r, name: o, onPick: l, accept: u = ".jpg,.jpeg,.png", maxSizeMb: d = 5, required: f, error: p }) {
|
|
3372
3400
|
let [m, h] = c(null), [g, _] = c(!1), v = s(null), y = a(), b = o || y;
|
|
3373
3401
|
i(() => {
|
|
3374
3402
|
if (r instanceof File) {
|
|
@@ -3378,7 +3406,7 @@ function We({ label: e, value: r, name: o, onPick: l, accept: u = ".jpg,.jpeg,.p
|
|
|
3378
3406
|
h(null);
|
|
3379
3407
|
}, [r]);
|
|
3380
3408
|
let S = r?.url || m, C = (e) => {
|
|
3381
|
-
let t =
|
|
3409
|
+
let t = W(e, {
|
|
3382
3410
|
accept: u,
|
|
3383
3411
|
maxSizeMb: d
|
|
3384
3412
|
});
|
|
@@ -3408,7 +3436,7 @@ function We({ label: e, value: r, name: o, onPick: l, accept: u = ".jpg,.jpeg,.p
|
|
|
3408
3436
|
/* @__PURE__ */ n("label", {
|
|
3409
3437
|
className: "label",
|
|
3410
3438
|
htmlFor: b,
|
|
3411
|
-
children: [e, f && /* @__PURE__ */ t(
|
|
3439
|
+
children: [e, f && /* @__PURE__ */ t(K, {})]
|
|
3412
3440
|
}),
|
|
3413
3441
|
S ? /* @__PURE__ */ n("div", {
|
|
3414
3442
|
className: `file-preview${p ? " error" : ""}`,
|
|
@@ -3493,7 +3521,7 @@ function We({ label: e, value: r, name: o, onPick: l, accept: u = ".jpg,.jpeg,.p
|
|
|
3493
3521
|
}
|
|
3494
3522
|
//#endregion
|
|
3495
3523
|
//#region src/components/AppInfoList.jsx
|
|
3496
|
-
function
|
|
3524
|
+
function qe({ items: r = [], className: i = "" }) {
|
|
3497
3525
|
return /* @__PURE__ */ t("div", {
|
|
3498
3526
|
className: `info-list${i ? ` ${i}` : ""}`,
|
|
3499
3527
|
children: r.map((r, i) => {
|
|
@@ -3526,7 +3554,7 @@ function Ge({ items: r = [], className: i = "" }) {
|
|
|
3526
3554
|
}
|
|
3527
3555
|
//#endregion
|
|
3528
3556
|
//#region src/components/AppKpiTile.jsx
|
|
3529
|
-
function
|
|
3557
|
+
function Je({ label: e, value: r, icon: i, delta: a, deltaDirection: o = "flat", inline: s = !1, className: c = "" }) {
|
|
3530
3558
|
let l = `kpi${s ? " kpi-inline" : ""}${c ? ` ${c}` : ""}`, u = o === "up" ? "arrow-up" : o === "down" ? "arrow-down" : null;
|
|
3531
3559
|
return /* @__PURE__ */ n("div", {
|
|
3532
3560
|
className: l,
|
|
@@ -3558,7 +3586,7 @@ function Ke({ label: e, value: r, icon: i, delta: a, deltaDirection: o = "flat",
|
|
|
3558
3586
|
}
|
|
3559
3587
|
//#endregion
|
|
3560
3588
|
//#region src/components/AppLogoPicker.jsx
|
|
3561
|
-
function
|
|
3589
|
+
function Ye({ value: r, fallback: i, name: a, onPick: o, loading: c = !1, accept: l = "image/png,image/jpeg", maxSizeMb: u = 5, overlayIcon: d = "image", overlayLabel: f = "Update photo", ariaLabel: p = "Upload photo" }) {
|
|
3562
3590
|
let m = s(null);
|
|
3563
3591
|
return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("button", {
|
|
3564
3592
|
type: "button",
|
|
@@ -3603,7 +3631,7 @@ function qe({ value: r, fallback: i, name: a, onPick: o, loading: c = !1, accept
|
|
|
3603
3631
|
onChange: (e) => {
|
|
3604
3632
|
let t = e.target.files?.[0];
|
|
3605
3633
|
if (e.target.value = "", !t) return;
|
|
3606
|
-
let n =
|
|
3634
|
+
let n = W(t, {
|
|
3607
3635
|
accept: l,
|
|
3608
3636
|
maxSizeMb: u
|
|
3609
3637
|
});
|
|
@@ -3618,7 +3646,7 @@ function qe({ value: r, fallback: i, name: a, onPick: o, loading: c = !1, accept
|
|
|
3618
3646
|
}
|
|
3619
3647
|
//#endregion
|
|
3620
3648
|
//#region src/components/AppMultiSelect.jsx
|
|
3621
|
-
function
|
|
3649
|
+
function Xe({ values: e, onChange: r, options: a, placeholder: o = "Select…", searchPlaceholder: c = "Search…", searchable: l = !0, disabled: u = !1, name: d, label: f, error: p, hint: m, required: h = !1, fieldClassName: g = "" }) {
|
|
3622
3650
|
let _ = s(null);
|
|
3623
3651
|
return i(() => {
|
|
3624
3652
|
let e = _.current;
|
|
@@ -3639,9 +3667,10 @@ function Je({ values: e, onChange: r, options: a, placeholder: o = "Select…",
|
|
|
3639
3667
|
f && /* @__PURE__ */ n("label", {
|
|
3640
3668
|
className: "label",
|
|
3641
3669
|
htmlFor: d,
|
|
3642
|
-
children: [f, h && /* @__PURE__ */ t(
|
|
3670
|
+
children: [f, h && /* @__PURE__ */ t(K, {})]
|
|
3643
3671
|
}),
|
|
3644
3672
|
/* @__PURE__ */ t("wui-multiselect", {
|
|
3673
|
+
"aria-label": typeof f == "string" ? f : void 0,
|
|
3645
3674
|
id: d,
|
|
3646
3675
|
ref: _,
|
|
3647
3676
|
name: d,
|
|
@@ -3662,7 +3691,7 @@ function Je({ values: e, onChange: r, options: a, placeholder: o = "Select…",
|
|
|
3662
3691
|
}
|
|
3663
3692
|
//#endregion
|
|
3664
3693
|
//#region src/components/AppPageHeader.jsx
|
|
3665
|
-
function
|
|
3694
|
+
function Ze({ title: e, subtitle: r, actions: i, className: a = "" }) {
|
|
3666
3695
|
return /* @__PURE__ */ n("div", {
|
|
3667
3696
|
className: `page-header${i ? " d-flex align-items-end justify-content-between" : ""}${a ? ` ${a}` : ""}`,
|
|
3668
3697
|
children: [/* @__PURE__ */ n("div", { children: [/* @__PURE__ */ t("div", {
|
|
@@ -3679,7 +3708,7 @@ function Ye({ title: e, subtitle: r, actions: i, className: a = "" }) {
|
|
|
3679
3708
|
}
|
|
3680
3709
|
//#endregion
|
|
3681
3710
|
//#region src/components/AppPhoneNumberInput.jsx
|
|
3682
|
-
function
|
|
3711
|
+
function Qe({ value: e, onChange: r, country: a, disabled: o = !1, name: c, label: l = "Phone number", placeholder: u = "Enter phone number", required: d = !1, error: f, fieldClassName: p = "" }) {
|
|
3683
3712
|
let m = s(null);
|
|
3684
3713
|
return i(() => {
|
|
3685
3714
|
let t = m.current;
|
|
@@ -3695,7 +3724,7 @@ function Xe({ value: e, onChange: r, country: a, disabled: o = !1, name: c, labe
|
|
|
3695
3724
|
l && /* @__PURE__ */ n("label", {
|
|
3696
3725
|
className: "label",
|
|
3697
3726
|
htmlFor: c,
|
|
3698
|
-
children: [l, d && /* @__PURE__ */ t(
|
|
3727
|
+
children: [l, d && /* @__PURE__ */ t(K, {})]
|
|
3699
3728
|
}),
|
|
3700
3729
|
/* @__PURE__ */ t("wui-phone", {
|
|
3701
3730
|
ref: m,
|
|
@@ -3713,7 +3742,7 @@ function Xe({ value: e, onChange: r, country: a, disabled: o = !1, name: c, labe
|
|
|
3713
3742
|
}
|
|
3714
3743
|
//#endregion
|
|
3715
3744
|
//#region src/components/AppPricingCard.jsx
|
|
3716
|
-
function
|
|
3745
|
+
function $e({ name: e, price: r, unit: i, tagline: a, features: o = [], cta: s, featured: c = !1, current: l = !1, badge: u = "Most popular", className: d = "" }) {
|
|
3717
3746
|
return /* @__PURE__ */ n("div", {
|
|
3718
3747
|
className: [
|
|
3719
3748
|
"plan-card",
|
|
@@ -3766,7 +3795,7 @@ function Ze({ name: e, price: r, unit: i, tagline: a, features: o = [], cta: s,
|
|
|
3766
3795
|
}
|
|
3767
3796
|
//#endregion
|
|
3768
3797
|
//#region src/components/AppRadio.jsx
|
|
3769
|
-
var
|
|
3798
|
+
var et = r(function({ label: e, id: r, name: i, className: o = "", ...s }, c) {
|
|
3770
3799
|
let l = a(), u = r || i || l;
|
|
3771
3800
|
return /* @__PURE__ */ n("div", {
|
|
3772
3801
|
className: `form-check${o ? ` ${o}` : ""}`,
|
|
@@ -3786,7 +3815,7 @@ var Qe = r(function({ label: e, id: r, name: i, className: o = "", ...s }, c) {
|
|
|
3786
3815
|
});
|
|
3787
3816
|
//#endregion
|
|
3788
3817
|
//#region src/components/AppRepeater.jsx
|
|
3789
|
-
function
|
|
3818
|
+
function tt({ rows: e = [], renderRow: r, onAdd: i, onRemove: a, addLabel: o = "Add another", removeLabel: s = "Remove row", emptyText: c, min: l = 0, max: u, numbered: d = !0, className: f = "" }) {
|
|
3790
3819
|
let p = typeof u == "number" && e.length >= u, m = !!a && e.length > l;
|
|
3791
3820
|
return /* @__PURE__ */ n("div", {
|
|
3792
3821
|
className: `repeater${f ? ` ${f}` : ""}`,
|
|
@@ -3815,7 +3844,7 @@ function $e({ rows: e = [], renderRow: r, onAdd: i, onRemove: a, addLabel: o = "
|
|
|
3815
3844
|
})
|
|
3816
3845
|
]
|
|
3817
3846
|
}, e.id ?? i)),
|
|
3818
|
-
/* @__PURE__ */ t(
|
|
3847
|
+
/* @__PURE__ */ t(J, {
|
|
3819
3848
|
variant: "secondary",
|
|
3820
3849
|
size: "sm",
|
|
3821
3850
|
leftIcon: /* @__PURE__ */ t(x, {
|
|
@@ -3833,7 +3862,7 @@ function $e({ rows: e = [], renderRow: r, onAdd: i, onRemove: a, addLabel: o = "
|
|
|
3833
3862
|
}
|
|
3834
3863
|
//#endregion
|
|
3835
3864
|
//#region src/components/AppResourceCard.jsx
|
|
3836
|
-
function
|
|
3865
|
+
function nt({ icon: r, title: i, text: a, href: o, external: s = !1, linkComponent: c, className: l = "" }) {
|
|
3837
3866
|
let u = /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", {
|
|
3838
3867
|
className: "res-card-icon",
|
|
3839
3868
|
children: /* @__PURE__ */ t(x, {
|
|
@@ -3864,7 +3893,7 @@ function et({ icon: r, title: i, text: a, href: o, external: s = !1, linkCompone
|
|
|
3864
3893
|
}
|
|
3865
3894
|
//#endregion
|
|
3866
3895
|
//#region src/components/AppSearch.jsx
|
|
3867
|
-
function
|
|
3896
|
+
function rt({ value: e, onValueChange: r, placeholder: i, ariaLabel: a, iconSize: o = 18, className: s = "", ...c }) {
|
|
3868
3897
|
return /* @__PURE__ */ n("div", {
|
|
3869
3898
|
className: [
|
|
3870
3899
|
"search-wrap",
|
|
@@ -3901,7 +3930,7 @@ function tt({ value: e, onValueChange: r, placeholder: i, ariaLabel: a, iconSize
|
|
|
3901
3930
|
}
|
|
3902
3931
|
//#endregion
|
|
3903
3932
|
//#region src/components/AppSegmented.jsx
|
|
3904
|
-
function
|
|
3933
|
+
function it({ options: e = [], value: r, onChange: i, label: o, name: s, size: c = "md", className: l = "" }) {
|
|
3905
3934
|
let u = a(), d = s || u;
|
|
3906
3935
|
return /* @__PURE__ */ t("div", {
|
|
3907
3936
|
className: `segmented${c === "sm" ? " segmented-sm" : ""}${l ? ` ${l}` : ""}`,
|
|
@@ -3929,13 +3958,13 @@ function nt({ options: e = [], value: r, onChange: i, label: o, name: s, size: c
|
|
|
3929
3958
|
}
|
|
3930
3959
|
//#endregion
|
|
3931
3960
|
//#region src/components/AppSelect.jsx
|
|
3932
|
-
var
|
|
3933
|
-
function
|
|
3961
|
+
var at = (e) => e == null ? "" : e.label ?? e.text ?? "";
|
|
3962
|
+
function ot({ value: e, onChange: r, options: a = [], placeholder: o = "Select...", searchPlaceholder: c = "Search...", searchable: l = !1, disabled: u, label: d, required: f = !1, error: p, hint: m, help: h, helpLabel: g = "More information", id: _, name: v, fieldClassName: y = "" }) {
|
|
3934
3963
|
let b = s(null);
|
|
3935
3964
|
i(() => {
|
|
3936
3965
|
b.current && (b.current.options = a.map((e) => ({
|
|
3937
3966
|
value: e.value,
|
|
3938
|
-
label:
|
|
3967
|
+
label: at(e)
|
|
3939
3968
|
})));
|
|
3940
3969
|
}, [a]), i(() => {
|
|
3941
3970
|
let t = b.current;
|
|
@@ -3947,6 +3976,7 @@ function it({ value: e, onChange: r, options: a = [], placeholder: o = "Select..
|
|
|
3947
3976
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
3948
3977
|
}, [r]);
|
|
3949
3978
|
let x = /* @__PURE__ */ t("wui-select", {
|
|
3979
|
+
"aria-label": typeof d == "string" ? d : void 0,
|
|
3950
3980
|
ref: b,
|
|
3951
3981
|
id: _ || v,
|
|
3952
3982
|
name: v,
|
|
@@ -3965,11 +3995,11 @@ function it({ value: e, onChange: r, options: a = [], placeholder: o = "Select..
|
|
|
3965
3995
|
htmlFor: S,
|
|
3966
3996
|
children: [
|
|
3967
3997
|
d,
|
|
3968
|
-
h && /* @__PURE__ */ t(
|
|
3998
|
+
h && /* @__PURE__ */ t(Y, {
|
|
3969
3999
|
label: g,
|
|
3970
4000
|
children: h
|
|
3971
4001
|
}),
|
|
3972
|
-
f && /* @__PURE__ */ t(
|
|
4002
|
+
f && /* @__PURE__ */ t(K, {})
|
|
3973
4003
|
]
|
|
3974
4004
|
}),
|
|
3975
4005
|
x,
|
|
@@ -3985,7 +4015,7 @@ function it({ value: e, onChange: r, options: a = [], placeholder: o = "Select..
|
|
|
3985
4015
|
}
|
|
3986
4016
|
//#endregion
|
|
3987
4017
|
//#region src/components/AppShell.jsx
|
|
3988
|
-
function
|
|
4018
|
+
function st({ groups: e = [], brand: r, sidebarFooter: a, topbarStart: o, topbarEnd: s, footer: l, children: u, collapsed: d, onCollapsedChange: f, noSidebar: p = !1, navLabel: m = "Main navigation", linkComponent: h, className: g = "" }) {
|
|
3989
4019
|
let [_, v] = c(!1), [y, b] = c(!1), [S, C] = c(!1), w = d ?? _;
|
|
3990
4020
|
return i(() => {
|
|
3991
4021
|
let e = () => C(window.scrollY > 4);
|
|
@@ -4020,7 +4050,7 @@ function at({ groups: e = [], brand: r, sidebarFooter: a, topbarStart: o, topbar
|
|
|
4020
4050
|
children: [e.label && /* @__PURE__ */ t("div", {
|
|
4021
4051
|
className: "app-nav-group-label",
|
|
4022
4052
|
children: e.label
|
|
4023
|
-
}), e.items.map((e) => /* @__PURE__ */ t(
|
|
4053
|
+
}), e.items.map((e) => /* @__PURE__ */ t(ct, {
|
|
4024
4054
|
item: e,
|
|
4025
4055
|
linkComponent: h,
|
|
4026
4056
|
onNavigate: () => b(!1)
|
|
@@ -4090,7 +4120,7 @@ function at({ groups: e = [], brand: r, sidebarFooter: a, topbarStart: o, topbar
|
|
|
4090
4120
|
]
|
|
4091
4121
|
});
|
|
4092
4122
|
}
|
|
4093
|
-
function
|
|
4123
|
+
function ct({ item: r, linkComponent: i, onNavigate: a }) {
|
|
4094
4124
|
let o = `app-nav-item${r.active ? " active" : ""}`, s = /* @__PURE__ */ n(e, { children: [
|
|
4095
4125
|
r.icon && /* @__PURE__ */ t("span", {
|
|
4096
4126
|
className: "app-nav-icon",
|
|
@@ -4124,7 +4154,7 @@ function ot({ item: r, linkComponent: i, onNavigate: a }) {
|
|
|
4124
4154
|
}
|
|
4125
4155
|
//#endregion
|
|
4126
4156
|
//#region src/components/AppSidebarMenu.jsx
|
|
4127
|
-
var
|
|
4157
|
+
var lt = {
|
|
4128
4158
|
left: "start",
|
|
4129
4159
|
right: "end",
|
|
4130
4160
|
start: "start",
|
|
@@ -4132,11 +4162,11 @@ var st = {
|
|
|
4132
4162
|
top: "top",
|
|
4133
4163
|
bottom: "bottom"
|
|
4134
4164
|
};
|
|
4135
|
-
function
|
|
4165
|
+
function ut({ show: e, onHide: r, side: i = "right", title: a, titleIcon: o, header: s, children: c, footer: l, width: u, backdrop: d = !0, scroll: f = !1, keyboard: p = !0, closeButton: m = !0, responsive: h, className: g = "", bodyClassName: _ = "", ariaLabel: y }) {
|
|
4136
4166
|
return /* @__PURE__ */ n(v, {
|
|
4137
4167
|
show: e,
|
|
4138
4168
|
onHide: r,
|
|
4139
|
-
placement:
|
|
4169
|
+
placement: lt[i] || "end",
|
|
4140
4170
|
backdrop: d,
|
|
4141
4171
|
scroll: f,
|
|
4142
4172
|
keyboard: p,
|
|
@@ -4156,7 +4186,7 @@ function ct({ show: e, onHide: r, side: i = "right", title: a, titleIcon: o, hea
|
|
|
4156
4186
|
size: 18
|
|
4157
4187
|
})
|
|
4158
4188
|
}), a]
|
|
4159
|
-
}), m && /* @__PURE__ */ t(
|
|
4189
|
+
}), m && /* @__PURE__ */ t(J, {
|
|
4160
4190
|
variant: "ghost",
|
|
4161
4191
|
className: "btn-icon",
|
|
4162
4192
|
onClick: r,
|
|
@@ -4180,7 +4210,7 @@ function ct({ show: e, onHide: r, side: i = "right", title: a, titleIcon: o, hea
|
|
|
4180
4210
|
}
|
|
4181
4211
|
//#endregion
|
|
4182
4212
|
//#region src/components/AppSpinner.jsx
|
|
4183
|
-
function
|
|
4213
|
+
function dt({ size: e = "md", label: n = "Loading", className: r = "" }) {
|
|
4184
4214
|
return /* @__PURE__ */ t("span", {
|
|
4185
4215
|
className: `spinner-border${e === "sm" ? " spinner-border-sm" : ""}${r ? ` ${r}` : ""}`,
|
|
4186
4216
|
role: "status",
|
|
@@ -4189,7 +4219,7 @@ function lt({ size: e = "md", label: n = "Loading", className: r = "" }) {
|
|
|
4189
4219
|
}
|
|
4190
4220
|
//#endregion
|
|
4191
4221
|
//#region src/components/AppSplash.jsx
|
|
4192
|
-
function
|
|
4222
|
+
function ft({ logo: e, initials: r, text: i, label: a = "Loading", className: o = "" }) {
|
|
4193
4223
|
return /* @__PURE__ */ t("div", {
|
|
4194
4224
|
className: `splash${o ? ` ${o}` : ""}`,
|
|
4195
4225
|
role: "status",
|
|
@@ -4216,7 +4246,7 @@ function ut({ logo: e, initials: r, text: i, label: a = "Loading", className: o
|
|
|
4216
4246
|
}
|
|
4217
4247
|
//#endregion
|
|
4218
4248
|
//#region src/components/AppStatusBadge.jsx
|
|
4219
|
-
function
|
|
4249
|
+
function pt({ label: e, tone: n = "neutral", className: r = "" }) {
|
|
4220
4250
|
return e == null || e === "" ? "—" : /* @__PURE__ */ t("span", {
|
|
4221
4251
|
className: `status-label ${n}${r ? ` ${r}` : ""}`,
|
|
4222
4252
|
children: e
|
|
@@ -4224,7 +4254,7 @@ function dt({ label: e, tone: n = "neutral", className: r = "" }) {
|
|
|
4224
4254
|
}
|
|
4225
4255
|
//#endregion
|
|
4226
4256
|
//#region src/components/AppStepper.jsx
|
|
4227
|
-
function
|
|
4257
|
+
function mt({ steps: r = [], variant: i = "steps", label: a = "Progress", linkComponent: o, className: s = "" }) {
|
|
4228
4258
|
return /* @__PURE__ */ t("nav", {
|
|
4229
4259
|
className: [i === "journey" ? "stepper stepper-journey" : "stepper", s].filter(Boolean).join(" "),
|
|
4230
4260
|
"aria-label": a,
|
|
@@ -4271,7 +4301,7 @@ function ft({ steps: r = [], variant: i = "steps", label: a = "Progress", linkCo
|
|
|
4271
4301
|
}
|
|
4272
4302
|
//#endregion
|
|
4273
4303
|
//#region src/components/AppSwitch.jsx
|
|
4274
|
-
var
|
|
4304
|
+
var ht = r(function({ label: e, id: r, name: i, className: o = "", ...s }, c) {
|
|
4275
4305
|
let l = a(), u = r || i || l;
|
|
4276
4306
|
return /* @__PURE__ */ n("div", {
|
|
4277
4307
|
className: `form-check form-switch${o ? ` ${o}` : ""}`,
|
|
@@ -4291,7 +4321,7 @@ var pt = r(function({ label: e, id: r, name: i, className: o = "", ...s }, c) {
|
|
|
4291
4321
|
});
|
|
4292
4322
|
//#endregion
|
|
4293
4323
|
//#region src/components/AppTableEmptyState.jsx
|
|
4294
|
-
function
|
|
4324
|
+
function gt({ icon: e, title: r, text: i, action: a }) {
|
|
4295
4325
|
return /* @__PURE__ */ n("div", {
|
|
4296
4326
|
className: "tbl-empty",
|
|
4297
4327
|
children: [
|
|
@@ -4319,7 +4349,7 @@ function mt({ icon: e, title: r, text: i, action: a }) {
|
|
|
4319
4349
|
}
|
|
4320
4350
|
//#endregion
|
|
4321
4351
|
//#region src/components/AppTabs.jsx
|
|
4322
|
-
function
|
|
4352
|
+
function _t({ tabs: e, value: r, onChange: i, variant: a = "underline", ariaLabel: o, className: c = "" }) {
|
|
4323
4353
|
let l = s(null);
|
|
4324
4354
|
function u(t) {
|
|
4325
4355
|
let n = e.findIndex((e) => e.key === r);
|
|
@@ -4339,11 +4369,8 @@ function ht({ tabs: e, value: r, onChange: i, variant: a = "underline", ariaLabe
|
|
|
4339
4369
|
e != null && i(e);
|
|
4340
4370
|
},
|
|
4341
4371
|
onKeyDown: u,
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
a === "pills" ? "app-tabs-pills" : "",
|
|
4345
|
-
c
|
|
4346
|
-
].filter(Boolean).join(" "),
|
|
4372
|
+
bsPrefix: "app-tabs",
|
|
4373
|
+
className: [a === "pills" ? "app-tabs-pills" : "", c].filter(Boolean).join(" "),
|
|
4347
4374
|
"aria-label": o,
|
|
4348
4375
|
children: e.map((e) => /* @__PURE__ */ n(y.Link, {
|
|
4349
4376
|
as: "button",
|
|
@@ -4365,7 +4392,7 @@ function ht({ tabs: e, value: r, onChange: i, variant: a = "underline", ariaLabe
|
|
|
4365
4392
|
}
|
|
4366
4393
|
//#endregion
|
|
4367
4394
|
//#region src/components/AppTextarea.jsx
|
|
4368
|
-
var
|
|
4395
|
+
var vt = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, helpLabel: s = "More information", id: c, name: l, rows: u = 4, className: d = "", fieldClassName: f = "", ...m }, h) {
|
|
4369
4396
|
let g = c || l, _ = [
|
|
4370
4397
|
"textarea",
|
|
4371
4398
|
i ? "error" : "",
|
|
@@ -4379,11 +4406,11 @@ var gt = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
4379
4406
|
htmlFor: g,
|
|
4380
4407
|
children: [
|
|
4381
4408
|
e,
|
|
4382
|
-
o && /* @__PURE__ */ t(
|
|
4409
|
+
o && /* @__PURE__ */ t(Y, {
|
|
4383
4410
|
label: s,
|
|
4384
4411
|
children: o
|
|
4385
4412
|
}),
|
|
4386
|
-
r && /* @__PURE__ */ t(
|
|
4413
|
+
r && /* @__PURE__ */ t(K, {})
|
|
4387
4414
|
]
|
|
4388
4415
|
}),
|
|
4389
4416
|
/* @__PURE__ */ t(p.Control, {
|
|
@@ -4408,7 +4435,7 @@ var gt = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
4408
4435
|
});
|
|
4409
4436
|
//#endregion
|
|
4410
4437
|
//#region src/components/AppTimeline.jsx
|
|
4411
|
-
function
|
|
4438
|
+
function yt({ items: e = [], className: r = "" }) {
|
|
4412
4439
|
return /* @__PURE__ */ t("ol", {
|
|
4413
4440
|
className: `timeline${r ? ` ${r}` : ""}`,
|
|
4414
4441
|
children: e.map((e, r) => /* @__PURE__ */ n("li", {
|
|
@@ -4446,4 +4473,4 @@ function _t({ items: e = [], className: r = "" }) {
|
|
|
4446
4473
|
});
|
|
4447
4474
|
}
|
|
4448
4475
|
//#endregion
|
|
4449
|
-
export { S as ActionIcon, C as AppAccordion, w as AppAlert, pe as AppAutocomplete, he as AppAvatar, ge as AppBadge,
|
|
4476
|
+
export { S as ActionIcon, C as AppAccordion, w as AppAlert, pe as AppAutocomplete, he as AppAvatar, ge as AppBadge, J as AppButton, ve as AppCallout, ye as AppCard, be as AppCheckbox, xe as AppChip, Se as AppChoiceCard, Ce as AppChoiceChip, we as AppColorField, Te as AppCompareTable, Oe as AppConfirmDialog, Re as AppDataTable, ze as AppDatePicker, Ve as AppDropdown, He as AppEmptyState, Ue as AppFileAttachment, Ke as AppFilePicker, qe as AppInfoList, Y as AppInfoTip, X as AppInput, Je as AppKpiTile, Ye as AppLogoPicker, Z as AppModal, Xe as AppMultiSelect, Ze as AppPageHeader, Qe as AppPhoneNumberInput, $e as AppPricingCard, et as AppRadio, tt as AppRepeater, nt as AppResourceCard, rt as AppSearch, it as AppSegmented, ot as AppSelect, Ne as AppSelectMini, st as AppShell, ut as AppSidebarMenu, ke as AppSkeleton, Me as AppSkeletonRows, dt as AppSpinner, ft as AppSplash, pt as AppStatusBadge, mt as AppStepper, ht as AppSwitch, gt as AppTableEmptyState, Fe as AppTablePagination, _t as AppTabs, vt as AppTextarea, yt as AppTimeline, x as Icon, De as MODAL_ICONS, K as RequiredMark, Ge as errorToast, $ as toast };
|