@webority/ui-react 0.6.11 → 0.6.12
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/ui-react.js
CHANGED
|
@@ -287,26 +287,26 @@ function I(e, t) {
|
|
|
287
287
|
function L(e) {
|
|
288
288
|
e?._reanchor && (window.removeEventListener("resize", e._reanchor), window.removeEventListener("scroll", e._reanchor, !0), e._reanchor = null);
|
|
289
289
|
}
|
|
290
|
-
var
|
|
291
|
-
function
|
|
292
|
-
let n = e.getAttribute("name"), r = e.querySelector(`:scope > input[${
|
|
290
|
+
var R = "data-wui-mirror";
|
|
291
|
+
function z(e, t) {
|
|
292
|
+
let n = e.getAttribute("name"), r = e.querySelector(`:scope > input[${R}]`);
|
|
293
293
|
if (!n) {
|
|
294
294
|
r?.remove();
|
|
295
295
|
return;
|
|
296
296
|
}
|
|
297
|
-
r || (r = document.createElement("input"), r.type = "hidden", r.setAttribute(
|
|
297
|
+
r || (r = document.createElement("input"), r.type = "hidden", r.setAttribute(R, ""), e.appendChild(r)), r.name = n, r.value = t == null ? "" : String(t);
|
|
298
298
|
for (let t of e.attributes) t.name.startsWith("data-val") && r.setAttribute(t.name, t.value);
|
|
299
299
|
r.disabled = e.hasAttribute("disabled");
|
|
300
300
|
}
|
|
301
|
-
var
|
|
301
|
+
var B = Symbol("wui.trustedHtml"), V = (e) => String(e ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), ee = (e) => {
|
|
302
302
|
if (!e) return "";
|
|
303
303
|
let t = String(e).toLowerCase().replace(/[^a-z0-9-]/g, "");
|
|
304
304
|
return t ? `<i class="bi bi-${t}" aria-hidden="true"></i>` : "";
|
|
305
|
-
},
|
|
305
|
+
}, H = (e) => {
|
|
306
306
|
if (e == null) return "";
|
|
307
|
-
let t = e[
|
|
307
|
+
let t = e[B] ? String(e.label ?? "") : V(e.label), n = ee(e.icon);
|
|
308
308
|
return n ? `<span class="wui-opt-label">${n}${t}</span>` : t;
|
|
309
|
-
},
|
|
309
|
+
}, te = class extends HTMLElement {
|
|
310
310
|
_accessibleName() {
|
|
311
311
|
return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Select";
|
|
312
312
|
}
|
|
@@ -335,9 +335,9 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
335
335
|
return this._value;
|
|
336
336
|
}
|
|
337
337
|
set value(e) {
|
|
338
|
-
this._value = e == null ? "" : String(e),
|
|
338
|
+
this._value = e == null ? "" : String(e), z(this, this._value);
|
|
339
339
|
let t = this._readOptions().find((e) => String(e.value) === this._value);
|
|
340
|
-
t && (this._label =
|
|
340
|
+
t && (this._label = re(t.label)), this._syncInput();
|
|
341
341
|
}
|
|
342
342
|
set options(e) {
|
|
343
343
|
this._optionsProp = Array.isArray(e) ? e : [], this._renderOptions();
|
|
@@ -368,7 +368,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
368
368
|
value: e.getAttribute("value") ?? e.textContent.trim(),
|
|
369
369
|
label: e.innerHTML,
|
|
370
370
|
icon: e.getAttribute("icon") || void 0,
|
|
371
|
-
[
|
|
371
|
+
[B]: !0,
|
|
372
372
|
selected: e.hasAttribute("selected")
|
|
373
373
|
})));
|
|
374
374
|
}
|
|
@@ -380,8 +380,8 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
380
380
|
let e = this.getAttribute("placeholder") || "Search…", t = this.getAttribute("size"), n = t === "sm" ? " search-select-sm" : t === "lg" ? " search-select-lg" : "";
|
|
381
381
|
this.innerHTML = `
|
|
382
382
|
<div class="search-select${n}">
|
|
383
|
-
<div class="input search-select-control search-select-ac" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-label="${
|
|
384
|
-
<input class="search-select-input search-select-ac-input" placeholder="${
|
|
383
|
+
<div class="input search-select-control search-select-ac" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-label="${ne(this._accessibleName())}">
|
|
384
|
+
<input class="search-select-input search-select-ac-input" placeholder="${ne(e)}" aria-autocomplete="list" autocomplete="off"${this.hasAttribute("disabled") ? " disabled" : ""} />
|
|
385
385
|
<span class="search-select-spinner spinner-border spinner-border-sm" role="status" aria-hidden="true" hidden></span>
|
|
386
386
|
<button type="button" class="search-select-clear" aria-label="Clear" hidden><i class="bi bi-x" aria-hidden="true"></i></button>
|
|
387
387
|
</div>
|
|
@@ -390,7 +390,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
390
390
|
<div class="search-select-empty" hidden>No matches</div>
|
|
391
391
|
<div class="search-select-hint" hidden>Type to search…</div>
|
|
392
392
|
</div>
|
|
393
|
-
</div>`, this._rendered = !0,
|
|
393
|
+
</div>`, this._rendered = !0, z(this, this._value), this._wire(), this._syncInput(), this._renderOptions();
|
|
394
394
|
}
|
|
395
395
|
_refs() {
|
|
396
396
|
return {
|
|
@@ -419,9 +419,9 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
419
419
|
let t = this._refs();
|
|
420
420
|
if (!t.optionsWrap) return;
|
|
421
421
|
let n = (e ?? (t.input ? t.input.value : "")).trim().toLowerCase(), r = this._readOptions();
|
|
422
|
-
!this._remote && n && (r = r.filter((e) =>
|
|
422
|
+
!this._remote && n && (r = r.filter((e) => re(e.label).toLowerCase().includes(n))), t.optionsWrap.innerHTML = r.map((e) => {
|
|
423
423
|
let t = String(e.value) === String(this._value);
|
|
424
|
-
return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${
|
|
424
|
+
return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${ne(e.value)}" aria-selected="${t}">${H(e)}</button>`;
|
|
425
425
|
}).join(""), this._active = -1;
|
|
426
426
|
let i = n.length < this._minChars;
|
|
427
427
|
t.hint && (t.hint.hidden = !(this._remote && i && !r.length)), t.empty && (t.empty.hidden = this._loading || r.length > 0 || this._remote && i);
|
|
@@ -439,7 +439,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
439
439
|
}, o = () => {
|
|
440
440
|
e.menu.hidden = !0, e.control.setAttribute("aria-expanded", "false"), e.control.classList.remove("open"), r(-1), this._syncInput();
|
|
441
441
|
}, s = (t) => {
|
|
442
|
-
this._value = t.dataset.value, this._label =
|
|
442
|
+
this._value = t.dataset.value, this._label = re(t.innerHTML), z(this, this._value), e.input.value = this._label, this.dispatchEvent(new Event("change", { bubbles: !0 })), o(), e.input.focus();
|
|
443
443
|
};
|
|
444
444
|
e.input.addEventListener("focus", () => a()), e.input.addEventListener("input", () => {
|
|
445
445
|
let t = e.input.value;
|
|
@@ -462,7 +462,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
462
462
|
let t = e.target.closest(".search-select-option");
|
|
463
463
|
t && r(this._optionEls().indexOf(t));
|
|
464
464
|
}), e.optionsWrap.addEventListener("mouseleave", () => r(-1)), e.clear?.addEventListener("click", () => {
|
|
465
|
-
this._value = "", this._label = "",
|
|
465
|
+
this._value = "", this._label = "", z(this, ""), e.input.value = "", e.clear.hidden = !0, this._renderOptions(""), this.dispatchEvent(new Event("change", { bubbles: !0 })), e.input.focus();
|
|
466
466
|
}), this._onDocClick = (e) => {
|
|
467
467
|
i() && !this.contains(e.target) && o();
|
|
468
468
|
}, document.addEventListener("click", this._onDocClick), I(this, () => {
|
|
@@ -472,7 +472,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
472
472
|
disconnectedCallback() {
|
|
473
473
|
this._onDocClick && document.removeEventListener("click", this._onDocClick), L(this), clearTimeout(this._timer);
|
|
474
474
|
}
|
|
475
|
-
},
|
|
475
|
+
}, ne = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), re = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), ie = [
|
|
476
476
|
"January",
|
|
477
477
|
"February",
|
|
478
478
|
"March",
|
|
@@ -485,7 +485,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
485
485
|
"October",
|
|
486
486
|
"November",
|
|
487
487
|
"December"
|
|
488
|
-
],
|
|
488
|
+
], ae = [
|
|
489
489
|
"Su",
|
|
490
490
|
"Mo",
|
|
491
491
|
"Tu",
|
|
@@ -493,123 +493,532 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
493
493
|
"Th",
|
|
494
494
|
"Fr",
|
|
495
495
|
"Sa"
|
|
496
|
-
],
|
|
496
|
+
], U = (e) => String(e).padStart(2, "0"), W = (e, t, n) => `${e}-${U(t + 1)}-${U(n)}`, G = (e) => {
|
|
497
497
|
let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e || "");
|
|
498
498
|
return t ? {
|
|
499
499
|
y: +t[1],
|
|
500
500
|
m: t[2] - 1,
|
|
501
501
|
d: +t[3]
|
|
502
502
|
} : null;
|
|
503
|
-
},
|
|
504
|
-
let t =
|
|
505
|
-
return t ? `${
|
|
506
|
-
},
|
|
503
|
+
}, oe = (e) => {
|
|
504
|
+
let t = G(e);
|
|
505
|
+
return t ? `${U(t.d)} ${ie[t.m].slice(0, 3)} ${t.y}` : "";
|
|
506
|
+
}, K = (e, t) => new Date(e, t + 1, 0).getDate(), q = (e, t) => {
|
|
507
|
+
for (; t < 0;) t += 12, --e;
|
|
508
|
+
for (; t > 11;) t -= 12, e += 1;
|
|
509
|
+
return {
|
|
510
|
+
y: e,
|
|
511
|
+
m: t
|
|
512
|
+
};
|
|
513
|
+
}, se = class extends HTMLElement {
|
|
507
514
|
static get observedAttributes() {
|
|
508
515
|
return [
|
|
509
516
|
"value",
|
|
510
517
|
"min",
|
|
511
518
|
"max",
|
|
512
519
|
"placeholder",
|
|
513
|
-
"disabled"
|
|
520
|
+
"disabled",
|
|
521
|
+
"first-day",
|
|
522
|
+
"size"
|
|
514
523
|
];
|
|
515
524
|
}
|
|
516
525
|
constructor() {
|
|
517
526
|
super(), this._value = "";
|
|
518
527
|
let e = new Date(2e3, 0, 1);
|
|
519
|
-
this._viewY = e.getFullYear(), this._viewM = e.getMonth();
|
|
528
|
+
this._viewY = e.getFullYear(), this._viewM = e.getMonth(), this._mode = "days", this._focus = null, this._slide = "";
|
|
520
529
|
}
|
|
521
530
|
connectedCallback() {
|
|
522
531
|
this._rendered || this.render();
|
|
523
532
|
}
|
|
524
533
|
attributeChangedCallback(e, t, n) {
|
|
525
|
-
this._rendered && (e === "value" ? (this._value = n || "", this._syncTrigger()) : this.render());
|
|
534
|
+
this._rendered && (e === "value" ? (this._value = n || "", this._syncTrigger()) : e === "first-day" ? this.querySelector(".datepicker-pop")?.hidden || this._renderView() : this.render());
|
|
526
535
|
}
|
|
527
536
|
get value() {
|
|
528
537
|
return this._value;
|
|
529
538
|
}
|
|
530
539
|
set value(e) {
|
|
531
|
-
this._value = e || "",
|
|
540
|
+
this._value = e || "", z(this, this._value), this._syncTrigger(), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
541
|
+
}
|
|
542
|
+
_firstDay() {
|
|
543
|
+
let e = Number.parseInt(this.getAttribute("first-day") ?? "", 10);
|
|
544
|
+
return Number.isInteger(e) && e >= 0 && e <= 6 ? e : 0;
|
|
532
545
|
}
|
|
533
546
|
render() {
|
|
534
547
|
this._value = this.getAttribute("value") || this._value;
|
|
535
|
-
let e = this.getAttribute("placeholder") || "Enter Date", t =
|
|
536
|
-
t && (this._viewY = t.y, this._viewM = t.m)
|
|
548
|
+
let e = this.getAttribute("placeholder") || "Enter Date", t = G(this._value);
|
|
549
|
+
t && (this._viewY = t.y, this._viewM = t.m);
|
|
550
|
+
let n = this.getAttribute("size"), r = n === "sm" ? " input-sm" : n === "lg" ? " input-lg" : "";
|
|
551
|
+
this.innerHTML = `
|
|
537
552
|
<div class="datepicker">
|
|
538
|
-
<button type="button" class="input datepicker-trigger" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}>
|
|
539
|
-
<span data-trigger-label class="${t ? "" : "search-select-placeholder"}">${t ?
|
|
553
|
+
<button type="button" class="input datepicker-trigger${r}${t ? " has-value" : ""}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}>
|
|
554
|
+
<span data-trigger-label class="${t ? "" : "search-select-placeholder"}">${t ? oe(this._value) : e}</span>
|
|
540
555
|
<i class="bi bi-calendar3" aria-hidden="true"></i>
|
|
541
556
|
</button>
|
|
542
|
-
<div class="datepicker-pop" role="dialog" hidden></div>
|
|
543
|
-
</div>`, this._rendered = !0,
|
|
557
|
+
<div class="datepicker-pop" role="dialog" aria-modal="false" hidden></div>
|
|
558
|
+
</div>`, this._rendered = !0, z(this, this._value), this._wire();
|
|
544
559
|
}
|
|
545
560
|
_syncFormValue() {
|
|
546
|
-
|
|
561
|
+
z(this, this._value);
|
|
547
562
|
}
|
|
548
563
|
_syncTrigger() {
|
|
549
|
-
let e = this.querySelector("[data-trigger-label]");
|
|
550
|
-
if (!
|
|
551
|
-
let
|
|
552
|
-
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
let e = this.
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
564
|
+
let e = this.querySelector(".datepicker-trigger"), t = this.querySelector("[data-trigger-label]");
|
|
565
|
+
if (!t) return;
|
|
566
|
+
let n = G(this._value);
|
|
567
|
+
t.textContent = n ? oe(this._value) : this.getAttribute("placeholder") || "Enter Date", t.classList.toggle("search-select-placeholder", !n), e?.classList.toggle("has-value", !!n);
|
|
568
|
+
}
|
|
569
|
+
_limits() {
|
|
570
|
+
let e = G(this.getAttribute("min")), t = G(this.getAttribute("max")), n = e ? new Date(e.y, e.m, e.d).getTime() : -Infinity, r = t ? new Date(t.y, t.m, t.d).getTime() : Infinity;
|
|
571
|
+
return {
|
|
572
|
+
dayDisabled: (e, t, i) => {
|
|
573
|
+
let a = new Date(e, t, i).getTime();
|
|
574
|
+
return a < n || a > r;
|
|
575
|
+
},
|
|
576
|
+
monthDisabled: (e, t) => {
|
|
577
|
+
let i = new Date(e, t, 1).getTime();
|
|
578
|
+
return new Date(e, t, K(e, t)).getTime() < n || i > r;
|
|
579
|
+
},
|
|
580
|
+
yearDisabled: (e) => {
|
|
581
|
+
let t = new Date(e, 0, 1).getTime();
|
|
582
|
+
return new Date(e, 11, 31).getTime() < n || t > r;
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
_renderView() {
|
|
587
|
+
let e = this.querySelector(".datepicker-pop");
|
|
588
|
+
e && (this._mode === "months" ? e.innerHTML = this._monthsHtml() : this._mode === "years" ? e.innerHTML = this._yearsHtml() : e.innerHTML = this._daysHtml(), this._focusActive());
|
|
589
|
+
}
|
|
590
|
+
_daysHtml() {
|
|
591
|
+
let e = this._firstDay(), t = (new Date(this._viewY, this._viewM, 1).getDay() - e + 7) % 7, n = K(this._viewY, this._viewM), r = G(this._value), i = /* @__PURE__ */ new Date(), { dayDisabled: a } = this._limits(), o = this._focus || r || {
|
|
592
|
+
y: this._viewY,
|
|
593
|
+
m: this._viewM,
|
|
594
|
+
d: 1
|
|
595
|
+
}, s = (e, t, n, s) => {
|
|
596
|
+
let c = W(e, t, n), l = r && r.y === e && r.m === t && r.d === n, u = i.getFullYear() === e && i.getMonth() === t && i.getDate() === n, d = o.y === e && o.m === t && o.d === n, f = a(e, t, n);
|
|
597
|
+
return `<button type="button" class="${[
|
|
598
|
+
"datepicker-day",
|
|
599
|
+
s ? "is-outside" : "",
|
|
600
|
+
u ? "is-today" : "",
|
|
601
|
+
l ? "is-selected" : ""
|
|
602
|
+
].filter(Boolean).join(" ")}" data-iso="${c}" role="gridcell" tabindex="${d && !f ? "0" : "-1"}"${l ? " aria-selected=\"true\"" : ""}${f ? " disabled aria-disabled=\"true\"" : ""}>${n}</button>`;
|
|
603
|
+
}, c = "", l = q(this._viewY, this._viewM - 1), u = K(l.y, l.m);
|
|
604
|
+
for (let e = t - 1; e >= 0; e--) c += s(l.y, l.m, u - e, !0);
|
|
605
|
+
for (let e = 1; e <= n; e++) c += s(this._viewY, this._viewM, e, !1);
|
|
606
|
+
let d = q(this._viewY, this._viewM + 1), f = (7 - (t + n) % 7) % 7;
|
|
607
|
+
for (let e = 1; e <= f; e++) c += s(d.y, d.m, e, !0);
|
|
608
|
+
let p = ae.map((t, n) => ae[(n + e) % 7]).map((e) => `<span>${e}</span>`).join("");
|
|
609
|
+
return `
|
|
565
610
|
<div class="datepicker-head">
|
|
566
611
|
<button type="button" class="datepicker-nav-btn" data-nav="-1" aria-label="Previous month"><i class="bi bi-chevron-left" aria-hidden="true"></i></button>
|
|
567
|
-
<
|
|
612
|
+
<button type="button" class="datepicker-month" data-view="months" aria-label="Choose month and year">${ie[this._viewM]} ${this._viewY}</button>
|
|
568
613
|
<button type="button" class="datepicker-nav-btn" data-nav="1" aria-label="Next month"><i class="bi bi-chevron-right" aria-hidden="true"></i></button>
|
|
569
614
|
</div>
|
|
570
|
-
<div class="datepicker-weekdays">${
|
|
571
|
-
<div class="datepicker-grid">${
|
|
572
|
-
<div class="datepicker-foot"
|
|
615
|
+
<div class="datepicker-weekdays">${p}</div>
|
|
616
|
+
<div class="datepicker-grid${this._slide ? ` ${this._slide}` : ""}" role="grid">${c}</div>
|
|
617
|
+
<div class="datepicker-foot">
|
|
618
|
+
<button type="button" class="datepicker-link" data-today>Today</button>
|
|
619
|
+
<button type="button" class="datepicker-link" data-clear>Clear</button>
|
|
620
|
+
</div>`;
|
|
621
|
+
}
|
|
622
|
+
_monthsHtml() {
|
|
623
|
+
let e = G(this._value), t = /* @__PURE__ */ new Date(), { monthDisabled: n } = this._limits(), r = "";
|
|
624
|
+
for (let i = 0; i < 12; i++) {
|
|
625
|
+
let a = e && e.y === this._viewY && e.m === i, o = t.getFullYear() === this._viewY && t.getMonth() === i, s = n(this._viewY, i), c = [
|
|
626
|
+
"datepicker-cell",
|
|
627
|
+
o ? "is-today" : "",
|
|
628
|
+
a ? "is-selected" : ""
|
|
629
|
+
].filter(Boolean).join(" ");
|
|
630
|
+
r += `<button type="button" class="${c}" data-month="${i}"${s ? " disabled" : ""}>${ie[i].slice(0, 3)}</button>`;
|
|
631
|
+
}
|
|
632
|
+
return `
|
|
633
|
+
<div class="datepicker-head">
|
|
634
|
+
<button type="button" class="datepicker-nav-btn" data-nav-year="-1" aria-label="Previous year"><i class="bi bi-chevron-left" aria-hidden="true"></i></button>
|
|
635
|
+
<button type="button" class="datepicker-month" data-view="years" aria-label="Choose year">${this._viewY}</button>
|
|
636
|
+
<button type="button" class="datepicker-nav-btn" data-nav-year="1" aria-label="Next year"><i class="bi bi-chevron-right" aria-hidden="true"></i></button>
|
|
637
|
+
</div>
|
|
638
|
+
<div class="datepicker-cells">${r}</div>`;
|
|
639
|
+
}
|
|
640
|
+
_yearsHtml() {
|
|
641
|
+
let e = G(this._value), t = (/* @__PURE__ */ new Date()).getFullYear(), { yearDisabled: n } = this._limits(), r = this._viewY - (this._viewY % 10 + 10) % 10 - 1, i = "";
|
|
642
|
+
for (let a = 0; a < 12; a++) {
|
|
643
|
+
let o = r + a, s = e && e.y === o, c = t === o, l = n(o), u = [
|
|
644
|
+
"datepicker-cell",
|
|
645
|
+
c ? "is-today" : "",
|
|
646
|
+
s ? "is-selected" : ""
|
|
647
|
+
].filter(Boolean).join(" ");
|
|
648
|
+
i += `<button type="button" class="${u}" data-year="${o}"${l ? " disabled" : ""}>${o}</button>`;
|
|
649
|
+
}
|
|
650
|
+
return `
|
|
651
|
+
<div class="datepicker-head">
|
|
652
|
+
<button type="button" class="datepicker-nav-btn" data-nav-decade="-1" aria-label="Previous decade"><i class="bi bi-chevron-left" aria-hidden="true"></i></button>
|
|
653
|
+
<span class="datepicker-month">${r + 1} – ${r + 10}</span>
|
|
654
|
+
<button type="button" class="datepicker-nav-btn" data-nav-decade="1" aria-label="Next decade"><i class="bi bi-chevron-right" aria-hidden="true"></i></button>
|
|
655
|
+
</div>
|
|
656
|
+
<div class="datepicker-cells">${i}</div>`;
|
|
657
|
+
}
|
|
658
|
+
_focusActive() {
|
|
659
|
+
let e = this.querySelector(".datepicker-pop"), t = e?.querySelector("[tabindex=\"0\"]") || e?.querySelector(".is-selected") || e?.querySelector(".datepicker-day:not(:disabled), .datepicker-cell:not(:disabled)");
|
|
660
|
+
t && e.contains(document.activeElement) && t.focus();
|
|
573
661
|
}
|
|
574
662
|
_position(e, t) {
|
|
575
663
|
F(e, t);
|
|
576
664
|
}
|
|
665
|
+
_setFocus(e, t, n, r) {
|
|
666
|
+
let { y: i, m: a } = q(e, t);
|
|
667
|
+
this._focus = {
|
|
668
|
+
y: i,
|
|
669
|
+
m: a,
|
|
670
|
+
d: n
|
|
671
|
+
};
|
|
672
|
+
let o = i !== this._viewY || a !== this._viewM;
|
|
673
|
+
this._viewY = i, this._viewM = a, this._slide = o && r || "", this._renderView(), this._slide = "", this.querySelector(`.datepicker-day[data-iso="${W(i, a, n)}"]`)?.focus();
|
|
674
|
+
}
|
|
675
|
+
_onKey(e) {
|
|
676
|
+
if (this._mode !== "days") {
|
|
677
|
+
e.key === "Escape" && this._close();
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
let t = this._focus || G(this._value) || {
|
|
681
|
+
y: this._viewY,
|
|
682
|
+
m: this._viewM,
|
|
683
|
+
d: 1
|
|
684
|
+
}, n = (n, r) => {
|
|
685
|
+
e.preventDefault();
|
|
686
|
+
let i = new Date(t.y, t.m, t.d + n);
|
|
687
|
+
this._setFocus(i.getFullYear(), i.getMonth(), i.getDate(), r);
|
|
688
|
+
};
|
|
689
|
+
switch (e.key) {
|
|
690
|
+
case "ArrowLeft": return n(-1, "slide-prev");
|
|
691
|
+
case "ArrowRight": return n(1, "slide-next");
|
|
692
|
+
case "ArrowUp": return n(-7, "slide-prev");
|
|
693
|
+
case "ArrowDown": return n(7, "slide-next");
|
|
694
|
+
case "Home": return n(-((new Date(t.y, t.m, t.d).getDay() - this._firstDay() + 7) % 7), "slide-prev");
|
|
695
|
+
case "End": return n(6 - (new Date(t.y, t.m, t.d).getDay() - this._firstDay() + 7) % 7, "slide-next");
|
|
696
|
+
case "PageUp": {
|
|
697
|
+
e.preventDefault();
|
|
698
|
+
let n = q(t.y, t.m - (e.shiftKey ? 12 : 1));
|
|
699
|
+
return this._setFocus(n.y, n.m, Math.min(t.d, K(n.y, n.m)), "slide-prev");
|
|
700
|
+
}
|
|
701
|
+
case "PageDown": {
|
|
702
|
+
e.preventDefault();
|
|
703
|
+
let n = q(t.y, t.m + (e.shiftKey ? 12 : 1));
|
|
704
|
+
return this._setFocus(n.y, n.m, Math.min(t.d, K(n.y, n.m)), "slide-next");
|
|
705
|
+
}
|
|
706
|
+
case "Enter":
|
|
707
|
+
case " ":
|
|
708
|
+
e.preventDefault(), this._limits().dayDisabled(t.y, t.m, t.d) || (this.value = W(t.y, t.m, t.d), this._close());
|
|
709
|
+
return;
|
|
710
|
+
case "Escape": return this._close();
|
|
711
|
+
default:
|
|
712
|
+
}
|
|
713
|
+
}
|
|
577
714
|
_wire() {
|
|
578
|
-
let e = this.querySelector(".datepicker-trigger"), t = this.querySelector(".datepicker-pop");
|
|
715
|
+
let e = this.querySelector(".datepicker-trigger"), t = this.querySelector(".datepicker-pop"), n = this.querySelector(".datepicker");
|
|
579
716
|
if (!e || !t) return;
|
|
580
|
-
let
|
|
581
|
-
|
|
717
|
+
let r = () => !t.hidden;
|
|
718
|
+
this._open = () => {
|
|
719
|
+
if (!G(this._value) && !this._viewNavigated) {
|
|
582
720
|
let e = /* @__PURE__ */ new Date();
|
|
583
721
|
this._viewY = e.getFullYear(), this._viewM = e.getMonth();
|
|
584
722
|
}
|
|
585
|
-
this.
|
|
586
|
-
|
|
587
|
-
|
|
723
|
+
let r = G(this._value), i = /* @__PURE__ */ new Date();
|
|
724
|
+
this._mode = "days", this._focus = r || {
|
|
725
|
+
y: this._viewY,
|
|
726
|
+
m: this._viewM,
|
|
727
|
+
d: i.getFullYear() === this._viewY && i.getMonth() === this._viewM ? i.getDate() : 1
|
|
728
|
+
}, this._renderView(), t.hidden = !1, n?.classList.add("open"), this._position(e, t), e.setAttribute("aria-expanded", "true"), t.querySelector("[tabindex=\"0\"]")?.focus();
|
|
729
|
+
}, this._close = () => {
|
|
730
|
+
t.hidden = !0, n?.classList.remove("open"), e.setAttribute("aria-expanded", "false"), e.focus();
|
|
731
|
+
}, e.addEventListener("click", () => r() ? this._close() : this._open()), t.addEventListener("click", (e) => {
|
|
732
|
+
this._popClick = !0;
|
|
733
|
+
let t = e.target.closest("[data-nav]");
|
|
734
|
+
if (t) {
|
|
735
|
+
this._viewNavigated = !0, this._slide = Number(t.dataset.nav) < 0 ? "slide-prev" : "slide-next";
|
|
736
|
+
let e = q(this._viewY, this._viewM + Number(t.dataset.nav));
|
|
737
|
+
this._viewY = e.y, this._viewM = e.m, this._focus = {
|
|
738
|
+
y: e.y,
|
|
739
|
+
m: e.m,
|
|
740
|
+
d: 1
|
|
741
|
+
}, this._renderView(), this._slide = "";
|
|
742
|
+
return;
|
|
743
|
+
}
|
|
744
|
+
let n = e.target.closest("[data-nav-year]");
|
|
745
|
+
if (n) {
|
|
746
|
+
this._viewY += Number(n.dataset.navYear), this._renderView();
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
749
|
+
let r = e.target.closest("[data-nav-decade]");
|
|
750
|
+
if (r) {
|
|
751
|
+
this._viewY += Number(r.dataset.navDecade) * 10, this._renderView();
|
|
752
|
+
return;
|
|
753
|
+
}
|
|
754
|
+
let i = e.target.closest("[data-view]");
|
|
755
|
+
if (i) {
|
|
756
|
+
this._mode = i.dataset.view, this._renderView();
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
let a = e.target.closest("[data-month]");
|
|
760
|
+
if (a && !a.disabled) {
|
|
761
|
+
this._viewNavigated = !0, this._viewM = Number(a.dataset.month), this._mode = "days", this._focus = {
|
|
762
|
+
y: this._viewY,
|
|
763
|
+
m: this._viewM,
|
|
764
|
+
d: 1
|
|
765
|
+
}, this._renderView();
|
|
766
|
+
return;
|
|
767
|
+
}
|
|
768
|
+
let o = e.target.closest("[data-year]");
|
|
769
|
+
if (o && !o.disabled) {
|
|
770
|
+
this._viewNavigated = !0, this._viewY = Number(o.dataset.year), this._mode = "months", this._renderView();
|
|
771
|
+
return;
|
|
772
|
+
}
|
|
773
|
+
if (e.target.closest("[data-today]")) {
|
|
774
|
+
let e = /* @__PURE__ */ new Date();
|
|
775
|
+
this.value = W(e.getFullYear(), e.getMonth(), e.getDate()), this._close();
|
|
776
|
+
return;
|
|
777
|
+
}
|
|
778
|
+
if (e.target.closest("[data-clear]")) {
|
|
779
|
+
this.value = "", this._close();
|
|
780
|
+
return;
|
|
781
|
+
}
|
|
782
|
+
let s = e.target.closest(".datepicker-day[data-iso]");
|
|
783
|
+
s && !s.disabled && (this.value = s.dataset.iso, this._close());
|
|
784
|
+
}), this._onKeyBound = (e) => {
|
|
785
|
+
r() && this._onKey(e);
|
|
786
|
+
}, t.addEventListener("keydown", this._onKeyBound), this._onDocClick = (e) => {
|
|
787
|
+
let t = this._popClick;
|
|
788
|
+
this._popClick = !1, r() && !t && !this.contains(e.target) && this._close();
|
|
789
|
+
}, document.addEventListener("click", this._onDocClick), I(this, () => {
|
|
790
|
+
r() && this._position(e, t);
|
|
791
|
+
}), this._syncFormValue();
|
|
792
|
+
}
|
|
793
|
+
disconnectedCallback() {
|
|
794
|
+
this._onDocClick && document.removeEventListener("click", this._onDocClick), L(this);
|
|
795
|
+
}
|
|
796
|
+
}, ce = [
|
|
797
|
+
"January",
|
|
798
|
+
"February",
|
|
799
|
+
"March",
|
|
800
|
+
"April",
|
|
801
|
+
"May",
|
|
802
|
+
"June",
|
|
803
|
+
"July",
|
|
804
|
+
"August",
|
|
805
|
+
"September",
|
|
806
|
+
"October",
|
|
807
|
+
"November",
|
|
808
|
+
"December"
|
|
809
|
+
], le = [
|
|
810
|
+
"Su",
|
|
811
|
+
"Mo",
|
|
812
|
+
"Tu",
|
|
813
|
+
"We",
|
|
814
|
+
"Th",
|
|
815
|
+
"Fr",
|
|
816
|
+
"Sa"
|
|
817
|
+
], ue = (e) => String(e).padStart(2, "0"), de = (e, t, n) => `${e}-${ue(t + 1)}-${ue(n)}`, J = (e) => {
|
|
818
|
+
let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e || "");
|
|
819
|
+
return t ? {
|
|
820
|
+
y: +t[1],
|
|
821
|
+
m: t[2] - 1,
|
|
822
|
+
d: +t[3]
|
|
823
|
+
} : null;
|
|
824
|
+
}, fe = (e) => {
|
|
825
|
+
let t = J(e);
|
|
826
|
+
return t ? `${ue(t.d)} ${ce[t.m].slice(0, 3)} ${t.y}` : "";
|
|
827
|
+
}, pe = (e, t) => new Date(e, t + 1, 0).getDate(), me = (e, t) => {
|
|
828
|
+
for (; t < 0;) t += 12, --e;
|
|
829
|
+
for (; t > 11;) t -= 12, e += 1;
|
|
830
|
+
return {
|
|
831
|
+
y: e,
|
|
832
|
+
m: t
|
|
833
|
+
};
|
|
834
|
+
}, he = class extends HTMLElement {
|
|
835
|
+
static get observedAttributes() {
|
|
836
|
+
return [
|
|
837
|
+
"start",
|
|
838
|
+
"end",
|
|
839
|
+
"min",
|
|
840
|
+
"max",
|
|
841
|
+
"placeholder",
|
|
842
|
+
"disabled",
|
|
843
|
+
"first-day",
|
|
844
|
+
"size"
|
|
845
|
+
];
|
|
846
|
+
}
|
|
847
|
+
constructor() {
|
|
848
|
+
super(), this._start = "", this._end = "", this._hover = "";
|
|
849
|
+
let e = new Date(2e3, 0, 1);
|
|
850
|
+
this._viewY = e.getFullYear(), this._viewM = e.getMonth();
|
|
851
|
+
}
|
|
852
|
+
connectedCallback() {
|
|
853
|
+
this._rendered || this.render();
|
|
854
|
+
}
|
|
855
|
+
attributeChangedCallback(e, t, n) {
|
|
856
|
+
this._rendered && (e === "start" || e === "end" ? (this._start = this.getAttribute("start") || "", this._end = this.getAttribute("end") || "", this._syncTrigger(), this._syncMirrors()) : this.render());
|
|
857
|
+
}
|
|
858
|
+
get value() {
|
|
859
|
+
return {
|
|
860
|
+
start: this._start,
|
|
861
|
+
end: this._end
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
set value(e) {
|
|
865
|
+
this._start = e?.start || "", this._end = e?.end || "", this._syncTrigger(), this._syncMirrors(), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
866
|
+
}
|
|
867
|
+
_firstDay() {
|
|
868
|
+
let e = Number.parseInt(this.getAttribute("first-day") ?? "", 10);
|
|
869
|
+
return Number.isInteger(e) && e >= 0 && e <= 6 ? e : 0;
|
|
870
|
+
}
|
|
871
|
+
_label() {
|
|
872
|
+
let e = this.getAttribute("placeholder") || "Start – End";
|
|
873
|
+
return !this._start && !this._end ? {
|
|
874
|
+
text: e,
|
|
875
|
+
empty: !0
|
|
876
|
+
} : {
|
|
877
|
+
text: `${fe(this._start) || "Start"} – ${fe(this._end) || "End"}`,
|
|
878
|
+
empty: !1
|
|
879
|
+
};
|
|
880
|
+
}
|
|
881
|
+
render() {
|
|
882
|
+
this._start = this.getAttribute("start") || this._start, this._end = this.getAttribute("end") || this._end;
|
|
883
|
+
let e = J(this._start);
|
|
884
|
+
e && (this._viewY = e.y, this._viewM = e.m);
|
|
885
|
+
let t = this.getAttribute("size"), n = t === "sm" ? " input-sm" : t === "lg" ? " input-lg" : "", { text: r, empty: i } = this._label();
|
|
886
|
+
this.innerHTML = `
|
|
887
|
+
<div class="daterange">
|
|
888
|
+
<button type="button" class="input daterange-trigger${n}${i ? "" : " has-value"}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}>
|
|
889
|
+
<span data-range-label class="${i ? "search-select-placeholder" : ""}">${r}</span>
|
|
890
|
+
<i class="bi bi-calendar-range" aria-hidden="true"></i>
|
|
891
|
+
</button>
|
|
892
|
+
<div class="daterange-pop" role="dialog" aria-modal="false" hidden></div>
|
|
893
|
+
</div>`, this._rendered = !0, this._syncMirrors(), this._wire();
|
|
894
|
+
}
|
|
895
|
+
_syncTrigger() {
|
|
896
|
+
let e = this.querySelector(".daterange-trigger"), t = this.querySelector("[data-range-label]");
|
|
897
|
+
if (!t) return;
|
|
898
|
+
let { text: n, empty: r } = this._label();
|
|
899
|
+
t.textContent = n, t.classList.toggle("search-select-placeholder", r), e?.classList.toggle("has-value", !r);
|
|
900
|
+
}
|
|
901
|
+
_syncMirrors() {
|
|
902
|
+
let e = this.getAttribute("start-name") || this.getAttribute("name"), t = this.getAttribute("end-name");
|
|
903
|
+
this._mirror("start", e, this._start), this._mirror("end", t, this._end);
|
|
904
|
+
}
|
|
905
|
+
_mirror(e, t, n) {
|
|
906
|
+
if (!t) return;
|
|
907
|
+
let r = this.querySelector(`input[type="hidden"][data-range-mirror="${e}"]`);
|
|
908
|
+
r || (r = document.createElement("input"), r.type = "hidden", r.setAttribute("data-range-mirror", e), this.appendChild(r)), r.name = t, r.value = n || "";
|
|
909
|
+
}
|
|
910
|
+
_limits() {
|
|
911
|
+
let e = J(this.getAttribute("min")), t = J(this.getAttribute("max")), n = e ? new Date(e.y, e.m, e.d).getTime() : -Infinity, r = t ? new Date(t.y, t.m, t.d).getTime() : Infinity;
|
|
912
|
+
return (e, t, i) => {
|
|
913
|
+
let a = new Date(e, t, i).getTime();
|
|
914
|
+
return a < n || a > r;
|
|
588
915
|
};
|
|
589
|
-
|
|
916
|
+
}
|
|
917
|
+
_monthHtml(e, t) {
|
|
918
|
+
let n = this._firstDay(), r = (new Date(e, t, 1).getDay() - n + 7) % 7, i = pe(e, t), a = this._limits(), o = le.map((e, t) => le[(t + n) % 7]).map((e) => `<span>${e}</span>`).join(""), s = (e, t, n, r) => {
|
|
919
|
+
let i = de(e, t, n), o = a(e, t, n);
|
|
920
|
+
return `<button type="button" class="${["datepicker-day", r ? "is-outside" : ""].filter(Boolean).join(" ")}" data-iso="${i}"${o ? " disabled" : ""}>${n}</button>`;
|
|
921
|
+
}, c = "", l = me(e, t - 1), u = pe(l.y, l.m);
|
|
922
|
+
for (let e = r - 1; e >= 0; e--) c += s(l.y, l.m, u - e, !0);
|
|
923
|
+
for (let n = 1; n <= i; n++) c += s(e, t, n, !1);
|
|
924
|
+
let d = me(e, t + 1), f = (7 - (r + i) % 7) % 7;
|
|
925
|
+
for (let e = 1; e <= f; e++) c += s(d.y, d.m, e, !0);
|
|
926
|
+
return `
|
|
927
|
+
<div class="daterange-cal">
|
|
928
|
+
<div class="datepicker-month-label">${ce[t]} ${e}</div>
|
|
929
|
+
<div class="datepicker-weekdays">${o}</div>
|
|
930
|
+
<div class="datepicker-grid" role="grid">${c}</div>
|
|
931
|
+
</div>`;
|
|
932
|
+
}
|
|
933
|
+
_renderView() {
|
|
934
|
+
let e = this.querySelector(".daterange-pop");
|
|
935
|
+
if (!e) return;
|
|
936
|
+
let t = me(this._viewY, this._viewM + 1);
|
|
937
|
+
e.innerHTML = `
|
|
938
|
+
<div class="daterange-head">
|
|
939
|
+
<button type="button" class="datepicker-nav-btn" data-nav="-1" aria-label="Previous month"><i class="bi bi-chevron-left" aria-hidden="true"></i></button>
|
|
940
|
+
<button type="button" class="datepicker-nav-btn" data-nav="1" aria-label="Next month"><i class="bi bi-chevron-right" aria-hidden="true"></i></button>
|
|
941
|
+
</div>
|
|
942
|
+
<div class="daterange-cals">
|
|
943
|
+
${this._monthHtml(this._viewY, this._viewM)}
|
|
944
|
+
${this._monthHtml(t.y, t.m)}
|
|
945
|
+
</div>
|
|
946
|
+
<div class="datepicker-foot">
|
|
947
|
+
<span class="daterange-hint" data-range-hint></span>
|
|
948
|
+
<button type="button" class="datepicker-link" data-clear>Clear</button>
|
|
949
|
+
</div>`, this._paint();
|
|
950
|
+
}
|
|
951
|
+
_paint() {
|
|
952
|
+
let e = this.querySelector(".daterange-pop");
|
|
953
|
+
if (!e) return;
|
|
954
|
+
let t = this._start ? new Date(this._start).getTime() : null, n = this._end;
|
|
955
|
+
t && !this._end && this._hover && new Date(this._hover).getTime() >= t && (n = this._hover);
|
|
956
|
+
let r = n ? new Date(n).getTime() : null;
|
|
957
|
+
for (let n of e.querySelectorAll(".datepicker-day[data-iso]")) {
|
|
958
|
+
let e = new Date(n.dataset.iso).getTime(), i = t != null && e === t, a = r != null && e === r, o = t != null && r != null && e > t && e < r;
|
|
959
|
+
n.classList.toggle("is-range-start", i), n.classList.toggle("is-range-end", a), n.classList.toggle("in-range", o);
|
|
960
|
+
}
|
|
961
|
+
let i = e.querySelector("[data-range-hint]");
|
|
962
|
+
i && (i.textContent = this._start ? this._end ? `${fe(this._start)} – ${fe(this._end)}` : "Pick an end date" : "Pick a start date");
|
|
963
|
+
}
|
|
964
|
+
_position(e, t) {
|
|
965
|
+
F(e, t);
|
|
966
|
+
}
|
|
967
|
+
_pick(e) {
|
|
968
|
+
if (!this._start || this._start && this._end) {
|
|
969
|
+
this._start = e, this._end = "", this._hover = "", this._syncTrigger(), this._syncMirrors(), this._paint();
|
|
970
|
+
return;
|
|
971
|
+
}
|
|
972
|
+
if (new Date(e).getTime() < new Date(this._start).getTime()) {
|
|
973
|
+
this._start = e, this._paint();
|
|
974
|
+
return;
|
|
975
|
+
}
|
|
976
|
+
this._end = e, this._syncTrigger(), this._syncMirrors(), this._paint(), this.dispatchEvent(new Event("change", { bubbles: !0 })), this._close();
|
|
977
|
+
}
|
|
978
|
+
_wire() {
|
|
979
|
+
let e = this.querySelector(".daterange-trigger"), t = this.querySelector(".daterange-pop"), n = this.querySelector(".daterange");
|
|
980
|
+
if (!e || !t) return;
|
|
981
|
+
let r = () => !t.hidden;
|
|
982
|
+
this._open = () => {
|
|
983
|
+
let r = J(this._start);
|
|
984
|
+
if (r) this._viewY = r.y, this._viewM = r.m;
|
|
985
|
+
else {
|
|
986
|
+
let e = /* @__PURE__ */ new Date();
|
|
987
|
+
this._viewY = e.getFullYear(), this._viewM = e.getMonth();
|
|
988
|
+
}
|
|
989
|
+
this._renderView(), t.hidden = !1, n?.classList.add("open"), this._position(e, t), e.setAttribute("aria-expanded", "true");
|
|
990
|
+
}, this._close = () => {
|
|
991
|
+
t.hidden = !0, this._hover = "", n?.classList.remove("open"), e.setAttribute("aria-expanded", "false");
|
|
992
|
+
}, e.addEventListener("click", () => r() ? this._close() : this._open()), t.addEventListener("click", (e) => {
|
|
993
|
+
this._popClick = !0;
|
|
590
994
|
let t = e.target.closest("[data-nav]");
|
|
591
995
|
if (t) {
|
|
592
|
-
|
|
996
|
+
let e = me(this._viewY, this._viewM + Number(t.dataset.nav));
|
|
997
|
+
this._viewY = e.y, this._viewM = e.m, this._renderView();
|
|
593
998
|
return;
|
|
594
999
|
}
|
|
595
1000
|
if (e.target.closest("[data-clear]")) {
|
|
596
|
-
this.
|
|
1001
|
+
this._start = "", this._end = "", this._hover = "", this._syncTrigger(), this._syncMirrors(), this._renderView(), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
597
1002
|
return;
|
|
598
1003
|
}
|
|
599
1004
|
let n = e.target.closest(".datepicker-day[data-iso]");
|
|
600
|
-
n && !n.disabled &&
|
|
1005
|
+
n && !n.disabled && this._pick(n.dataset.iso);
|
|
1006
|
+
}), t.addEventListener("mouseover", (e) => {
|
|
1007
|
+
let t = e.target.closest(".datepicker-day[data-iso]");
|
|
1008
|
+
t && this._start && !this._end && (this._hover = t.dataset.iso, this._paint());
|
|
601
1009
|
}), this._onDocClick = (e) => {
|
|
602
|
-
|
|
1010
|
+
let t = this._popClick;
|
|
1011
|
+
this._popClick = !1, r() && !t && !this.contains(e.target) && this._close();
|
|
603
1012
|
}, document.addEventListener("click", this._onDocClick), this._onDocKey = (e) => {
|
|
604
|
-
|
|
1013
|
+
r() && e.key === "Escape" && this._close();
|
|
605
1014
|
}, document.addEventListener("keydown", this._onDocKey), I(this, () => {
|
|
606
|
-
|
|
607
|
-
}), this.
|
|
1015
|
+
r() && this._position(e, t);
|
|
1016
|
+
}), this._syncMirrors();
|
|
608
1017
|
}
|
|
609
1018
|
disconnectedCallback() {
|
|
610
1019
|
this._onDocClick && document.removeEventListener("click", this._onDocClick), this._onDocKey && document.removeEventListener("keydown", this._onDocKey), L(this);
|
|
611
1020
|
}
|
|
612
|
-
},
|
|
1021
|
+
}, ge = class extends HTMLElement {
|
|
613
1022
|
_accessibleName() {
|
|
614
1023
|
return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Select";
|
|
615
1024
|
}
|
|
@@ -644,7 +1053,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
644
1053
|
return this._values.slice();
|
|
645
1054
|
}
|
|
646
1055
|
set values(e) {
|
|
647
|
-
this._values = Array.isArray(e) ? e.map(String) : [],
|
|
1056
|
+
this._values = Array.isArray(e) ? e.map(String) : [], z(this, this._values.join(",")), this._rendered && this._renderControl();
|
|
648
1057
|
}
|
|
649
1058
|
set options(e) {
|
|
650
1059
|
this._optionsProp = Array.isArray(e) ? e : null, this.isConnected && this.render();
|
|
@@ -659,7 +1068,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
659
1068
|
value: e.getAttribute("value") ?? e.textContent.trim(),
|
|
660
1069
|
label: e.innerHTML,
|
|
661
1070
|
icon: e.getAttribute("icon") || void 0,
|
|
662
|
-
[
|
|
1071
|
+
[B]: !0,
|
|
663
1072
|
selected: e.hasAttribute("selected")
|
|
664
1073
|
})));
|
|
665
1074
|
}
|
|
@@ -672,34 +1081,34 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
672
1081
|
}
|
|
673
1082
|
_labelHtmlFor(e) {
|
|
674
1083
|
let t = this._readOptions().find((t) => String(t.value) === String(e));
|
|
675
|
-
return t ?
|
|
1084
|
+
return t ? H(t) : V(e);
|
|
676
1085
|
}
|
|
677
1086
|
render() {
|
|
678
1087
|
this._snapshotDeclared();
|
|
679
1088
|
let e = this.hasAttribute("searchable"), t = this.getAttribute("search-placeholder") || "Search…", n = this.getAttribute("icon"), r = this.getAttribute("size"), i = r === "sm" ? " search-select-sm" : r === "lg" ? " search-select-lg" : "";
|
|
680
|
-
|
|
1089
|
+
z(this, this._values.join(",")), this.innerHTML = `
|
|
681
1090
|
<div class="search-select${i}">
|
|
682
|
-
<div class="input search-select-control search-select-multi" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-label="${
|
|
683
|
-
${n ? `<i class="bi bi-${
|
|
1091
|
+
<div class="input search-select-control search-select-multi" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-label="${Y(this._accessibleName())}"${this.hasAttribute("disabled") ? " aria-disabled=\"true\"" : ""}>
|
|
1092
|
+
${n ? `<i class="bi bi-${Y(n)} search-select-icon" aria-hidden="true"></i>` : ""}
|
|
684
1093
|
<div class="ms-chips" data-chips></div>
|
|
685
1094
|
<i class="bi bi-chevron-down search-select-caret" aria-hidden="true"></i>
|
|
686
1095
|
</div>
|
|
687
1096
|
<div class="search-select-menu search-select-menu-fixed" role="listbox" aria-multiselectable="true" tabindex="-1" hidden>
|
|
688
|
-
${e ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${
|
|
1097
|
+
${e ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${Y(t)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden><i class="bi bi-x" aria-hidden="true"></i></button></div>` : ""}
|
|
689
1098
|
<div class="search-select-options"></div>
|
|
690
1099
|
<div class="search-select-empty" hidden>No matches</div>
|
|
691
1100
|
</div>
|
|
692
|
-
</div>`, this._rendered = !0,
|
|
1101
|
+
</div>`, this._rendered = !0, z(this, this._values.join(",")), this._renderControl(), this._renderOptions(), this._wire();
|
|
693
1102
|
}
|
|
694
1103
|
_renderControl() {
|
|
695
1104
|
let e = this.querySelector("[data-chips]");
|
|
696
1105
|
if (!e) return;
|
|
697
1106
|
let t = this.getAttribute("placeholder") || "Select…";
|
|
698
1107
|
if (!this._values.length) {
|
|
699
|
-
e.innerHTML = `<span class="search-select-placeholder">${
|
|
1108
|
+
e.innerHTML = `<span class="search-select-placeholder">${V(t)}</span>`;
|
|
700
1109
|
return;
|
|
701
1110
|
}
|
|
702
|
-
e.innerHTML = this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${this._labelHtmlFor(e)}</span><button type="button" class="chip-remove" data-remove="${
|
|
1111
|
+
e.innerHTML = this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${this._labelHtmlFor(e)}</span><button type="button" class="chip-remove" data-remove="${Y(e)}" aria-label="Remove"><i class="bi bi-x" aria-hidden="true"></i></button></span>`).join(""), this._collapseChips();
|
|
703
1112
|
}
|
|
704
1113
|
_collapseChips() {
|
|
705
1114
|
let e = this.querySelector("[data-chips]");
|
|
@@ -723,9 +1132,9 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
723
1132
|
let t = this.querySelector(".search-select-options"), n = this.querySelector(".search-select-empty");
|
|
724
1133
|
if (!t) return;
|
|
725
1134
|
let r = (e || "").trim().toLowerCase(), i = this._readOptions();
|
|
726
|
-
r && (i = i.filter((e) =>
|
|
1135
|
+
r && (i = i.filter((e) => _e(e.label).toLowerCase().includes(r))), t.innerHTML = i.map((e) => {
|
|
727
1136
|
let t = this._values.includes(String(e.value));
|
|
728
|
-
return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${
|
|
1137
|
+
return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${Y(e.value)}" aria-selected="${t}"><span class="ms-opt-label">${H(e)}</span><span class="ms-check"><i class="bi bi-check" aria-hidden="true"></i></span></button>`;
|
|
729
1138
|
}).join(""), n && (n.hidden = i.length > 0), this._active = -1;
|
|
730
1139
|
}
|
|
731
1140
|
_wire() {
|
|
@@ -743,7 +1152,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
743
1152
|
}, f = () => {
|
|
744
1153
|
t.hidden = !0, e.setAttribute("aria-expanded", "false"), e.classList.remove("open"), l(-1);
|
|
745
1154
|
}, p = () => {
|
|
746
|
-
|
|
1155
|
+
z(this, this._values.join(",")), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
747
1156
|
}, m = (e) => {
|
|
748
1157
|
let t = String(e);
|
|
749
1158
|
this._values.includes(t) ? this._values = this._values.filter((e) => e !== t) : this._values = [...this._values, t], this._renderControl(), this._renderOptions(n ? n.value : ""), p();
|
|
@@ -787,7 +1196,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
787
1196
|
disconnectedCallback() {
|
|
788
1197
|
this._onDocClick && document.removeEventListener("click", this._onDocClick), L(this), this._ro?.disconnect(), this._ro = null;
|
|
789
1198
|
}
|
|
790
|
-
},
|
|
1199
|
+
}, Y = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), _e = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), ve = /[^0-9]/g, ye = /[^0-9a-zA-Z]/g, be = class extends HTMLElement {
|
|
791
1200
|
static get observedAttributes() {
|
|
792
1201
|
return [
|
|
793
1202
|
"value",
|
|
@@ -814,16 +1223,16 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
814
1223
|
return this._value ?? "";
|
|
815
1224
|
}
|
|
816
1225
|
set value(e) {
|
|
817
|
-
this._value = this._clean(e),
|
|
1226
|
+
this._value = this._clean(e), z(this, this._value), this._paint();
|
|
818
1227
|
}
|
|
819
1228
|
_clean(e) {
|
|
820
|
-
return (e == null ? "" : String(e)).replace(this.mode === "alphanumeric" ?
|
|
1229
|
+
return (e == null ? "" : String(e)).replace(this.mode === "alphanumeric" ? ye : ve, "").slice(0, this.length);
|
|
821
1230
|
}
|
|
822
1231
|
connectedCallback() {
|
|
823
1232
|
this._rendered || this.render();
|
|
824
1233
|
}
|
|
825
1234
|
attributeChangedCallback(e, t, n) {
|
|
826
|
-
this._rendered && (e === "value" ? (this._value = this._clean(n),
|
|
1235
|
+
this._rendered && (e === "value" ? (this._value = this._clean(n), z(this, this._value), this._paint()) : this.render());
|
|
827
1236
|
}
|
|
828
1237
|
render() {
|
|
829
1238
|
this._value = this._clean(this.getAttribute("value") ?? this._value);
|
|
@@ -841,7 +1250,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
841
1250
|
spellcheck="false"
|
|
842
1251
|
${n ? "disabled" : ""} />
|
|
843
1252
|
<div class="otp-slots" aria-hidden="true">${r}</div>
|
|
844
|
-
</div>`, this._rendered = !0,
|
|
1253
|
+
</div>`, this._rendered = !0, z(this, this._value), this._wire(), this._paint();
|
|
845
1254
|
}
|
|
846
1255
|
_refs() {
|
|
847
1256
|
return {
|
|
@@ -863,7 +1272,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
863
1272
|
if (!e) return;
|
|
864
1273
|
let t = (e) => {
|
|
865
1274
|
let t = this._clean(e), n = t !== this._value;
|
|
866
|
-
this._value = t,
|
|
1275
|
+
this._value = t, z(this, this._value), this._paint(), n && this.dispatchEvent(new Event("change", { bubbles: !0 })), n && t.length === this.length && this.dispatchEvent(new CustomEvent("complete", {
|
|
867
1276
|
bubbles: !0,
|
|
868
1277
|
detail: t
|
|
869
1278
|
}));
|
|
@@ -883,7 +1292,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
883
1292
|
document.activeElement === e && this._paint();
|
|
884
1293
|
});
|
|
885
1294
|
}
|
|
886
|
-
},
|
|
1295
|
+
}, xe = [
|
|
887
1296
|
[
|
|
888
1297
|
"AF",
|
|
889
1298
|
"Afghanistan",
|
|
@@ -2109,11 +2518,11 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2109
2518
|
"Zimbabwe",
|
|
2110
2519
|
"263"
|
|
2111
2520
|
]
|
|
2112
|
-
],
|
|
2521
|
+
], Se = (e) => (xe.find((t) => t[0] === e) || [
|
|
2113
2522
|
"",
|
|
2114
2523
|
"",
|
|
2115
2524
|
""
|
|
2116
|
-
])[2],
|
|
2525
|
+
])[2], Ce = (e) => `wui-flag wui-flag-${String(e).toLowerCase()}`, we = class extends HTMLElement {
|
|
2117
2526
|
static get observedAttributes() {
|
|
2118
2527
|
return [
|
|
2119
2528
|
"value",
|
|
@@ -2132,33 +2541,33 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2132
2541
|
this._rendered && (e === "country" && (this._country = n || "IN"), this.render());
|
|
2133
2542
|
}
|
|
2134
2543
|
get value() {
|
|
2135
|
-
return `+${
|
|
2544
|
+
return `+${Se(this._country)}${this._national}`;
|
|
2136
2545
|
}
|
|
2137
2546
|
set value(e) {
|
|
2138
2547
|
this._national = String(e ?? "").replace(/[^0-9]/g, ""), this._commit();
|
|
2139
2548
|
}
|
|
2140
2549
|
_commit() {
|
|
2141
|
-
|
|
2550
|
+
z(this, this.value), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2142
2551
|
}
|
|
2143
2552
|
render() {
|
|
2144
2553
|
let e = this.getAttribute("placeholder") || "Enter phone number";
|
|
2145
2554
|
this._country = this.getAttribute("country") || this._country;
|
|
2146
|
-
let t =
|
|
2555
|
+
let t = xe.map(([e, t, n]) => `<button type="button" role="option" class="country-dropdown-item${e === this._country ? " selected" : ""}" data-iso="${e}"><span class="${Ce(e)}" aria-hidden="true"></span><span class="country-name-text">${t}<span class="country-code-text">+${n}</span></span></button>`).join("");
|
|
2147
2556
|
this.innerHTML = `
|
|
2148
2557
|
<div class="phone-input-wrap">
|
|
2149
2558
|
<div class="phone-country-adornment">
|
|
2150
2559
|
<button type="button" class="country-toggle" aria-haspopup="listbox" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}>
|
|
2151
|
-
<span class="${
|
|
2560
|
+
<span class="${Ce(this._country)}" data-flag aria-hidden="true"></span>
|
|
2152
2561
|
<i class="bi bi-chevron-down phone-chevron" aria-hidden="true"></i>
|
|
2153
|
-
<span class="phone-dial" data-dial>+${
|
|
2562
|
+
<span class="phone-dial" data-dial>+${Se(this._country)}</span>
|
|
2154
2563
|
</button>
|
|
2155
2564
|
<div class="country-dropdown-menu" role="listbox" hidden>
|
|
2156
2565
|
<div class="dropdown-search-wrapper"><span class="dropdown-search-icon"><i class="bi bi-search" aria-hidden="true"></i></span><input type="text" class="dropdown-search-input" placeholder="Search country or code" aria-label="Search countries" /></div>
|
|
2157
2566
|
<div class="country-list-scroll">${t}<div class="country-empty" hidden>No countries found</div></div>
|
|
2158
2567
|
</div>
|
|
2159
2568
|
</div>
|
|
2160
|
-
<input type="tel" class="input" placeholder="${
|
|
2161
|
-
</div>`, this._rendered = !0,
|
|
2569
|
+
<input type="tel" class="input" placeholder="${Te(e)}" value="${Te(this._national)}"${this.hasAttribute("disabled") ? " disabled" : ""} />
|
|
2570
|
+
</div>`, this._rendered = !0, z(this, this.value), this._wire();
|
|
2162
2571
|
}
|
|
2163
2572
|
_wire() {
|
|
2164
2573
|
let e = this.querySelector(".country-toggle"), t = this.querySelector(".country-dropdown-menu"), n = this.querySelector(".dropdown-search-input"), r = this.querySelector(".country-list-scroll"), i = this.querySelector(".country-empty"), a = this.querySelector("input[type=tel]"), o = this.querySelector("[data-flag]"), s = this.querySelector("[data-dial]");
|
|
@@ -2182,7 +2591,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2182
2591
|
}
|
|
2183
2592
|
i && (i.hidden = n > 0);
|
|
2184
2593
|
}, p = (e) => {
|
|
2185
|
-
this._country = e, this.setAttribute("country", e), o && (o.className =
|
|
2594
|
+
this._country = e, this.setAttribute("country", e), o && (o.className = Ce(e)), s && (s.textContent = `+${Se(e)}`);
|
|
2186
2595
|
for (let t of r.querySelectorAll(".country-dropdown-item")) t.classList.toggle("selected", t.dataset.iso === e);
|
|
2187
2596
|
d(), this._commit();
|
|
2188
2597
|
};
|
|
@@ -2193,12 +2602,12 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2193
2602
|
this._national = a.value.replace(/[^0-9]/g, ""), this._commit();
|
|
2194
2603
|
}), this._onDocClick = (e) => {
|
|
2195
2604
|
c() && !this.contains(e.target) && d();
|
|
2196
|
-
}, document.addEventListener("click", this._onDocClick),
|
|
2605
|
+
}, document.addEventListener("click", this._onDocClick), z(this, this.value);
|
|
2197
2606
|
}
|
|
2198
2607
|
disconnectedCallback() {
|
|
2199
2608
|
this._reposition && (window.removeEventListener("scroll", this._reposition, !0), window.removeEventListener("resize", this._reposition)), this._onDocClick && document.removeEventListener("click", this._onDocClick);
|
|
2200
2609
|
}
|
|
2201
|
-
},
|
|
2610
|
+
}, Te = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), Ee = class extends HTMLElement {
|
|
2202
2611
|
static get observedAttributes() {
|
|
2203
2612
|
return [
|
|
2204
2613
|
"value",
|
|
@@ -2230,7 +2639,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2230
2639
|
return this._value;
|
|
2231
2640
|
}
|
|
2232
2641
|
set value(e) {
|
|
2233
|
-
this._value = e == null ? "" : String(e),
|
|
2642
|
+
this._value = e == null ? "" : String(e), z(this, this._value), this._syncSelected(), this._syncReset();
|
|
2234
2643
|
}
|
|
2235
2644
|
set options(e) {
|
|
2236
2645
|
this._optionsProp = Array.isArray(e) ? e : null, this.isConnected && this.render();
|
|
@@ -2245,7 +2654,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2245
2654
|
value: e.getAttribute("value") ?? e.textContent.trim(),
|
|
2246
2655
|
label: e.innerHTML,
|
|
2247
2656
|
icon: e.getAttribute("icon") || void 0,
|
|
2248
|
-
[
|
|
2657
|
+
[B]: !0,
|
|
2249
2658
|
selected: e.hasAttribute("selected")
|
|
2250
2659
|
})));
|
|
2251
2660
|
}
|
|
@@ -2255,25 +2664,25 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2255
2664
|
render() {
|
|
2256
2665
|
this._snapshotDeclared();
|
|
2257
2666
|
let e = this._readOptions(), t = this.hasAttribute("searchable"), n = this.hasAttribute("clearable"), r = this.getAttribute("size"), i = r === "sm" ? " search-select-sm" : r === "lg" ? " search-select-lg" : "", a = this.getAttribute("icon"), o = this.getAttribute("prefix"), s = this.getAttribute("placeholder") || "Select...", c = this.getAttribute("search-placeholder") || "Search...", l = e.find((e) => String(e.value) === String(this._value)) || e.find((e) => e.selected);
|
|
2258
|
-
l && (this._value = String(l.value)),
|
|
2667
|
+
l && (this._value = String(l.value)), z(this, this._value);
|
|
2259
2668
|
let u = e.map((e) => {
|
|
2260
2669
|
let t = String(e.value) === String(this._value);
|
|
2261
|
-
return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${
|
|
2670
|
+
return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${De(e.value)}" aria-selected="${t}">${H(e)}</button>`;
|
|
2262
2671
|
}).join("");
|
|
2263
2672
|
this.innerHTML = `
|
|
2264
2673
|
<div class="search-select${this.hasAttribute("compact") ? " search-select-compact" : ""}${i}">
|
|
2265
|
-
<button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false" aria-label="${
|
|
2266
|
-
${a ? `<i class="bi bi-${
|
|
2267
|
-
${o ? `<span class="search-select-prefix">${
|
|
2268
|
-
<span class="${l ? "" : "search-select-placeholder"}" data-label>${l ?
|
|
2674
|
+
<button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false" aria-label="${De(this._accessibleName())}"${this.hasAttribute("disabled") ? " disabled" : ""}>
|
|
2675
|
+
${a ? `<i class="bi bi-${De(a)} search-select-icon" aria-hidden="true"></i>` : ""}
|
|
2676
|
+
${o ? `<span class="search-select-prefix">${V(o)}</span>` : ""}
|
|
2677
|
+
<span class="${l ? "" : "search-select-placeholder"}" data-label>${l ? H(l) : V(s)}</span>
|
|
2269
2678
|
${n ? "<span class=\"search-select-reset\" role=\"button\" aria-label=\"Clear selection\" hidden><i class=\"bi bi-x-lg\" aria-hidden=\"true\"></i></span>" : ""}
|
|
2270
2679
|
<i class="bi bi-chevron-down search-select-caret" aria-hidden="true"></i>
|
|
2271
2680
|
</button>
|
|
2272
2681
|
<div class="search-select-menu search-select-menu-fixed" role="listbox" tabindex="-1" hidden>
|
|
2273
|
-
${t ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${
|
|
2682
|
+
${t ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${De(c)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden><i class="bi bi-x" aria-hidden="true"></i></button></div>` : ""}
|
|
2274
2683
|
<div class="search-select-options">${u}<div class="search-select-empty" hidden>No matches</div></div>
|
|
2275
2684
|
</div>
|
|
2276
|
-
</div>`, this._rendered = !0,
|
|
2685
|
+
</div>`, this._rendered = !0, z(this, this._value), this._wire(), this._syncReset();
|
|
2277
2686
|
}
|
|
2278
2687
|
_refs() {
|
|
2279
2688
|
return {
|
|
@@ -2299,7 +2708,7 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2299
2708
|
let t = e.dataset.value === String(this._value);
|
|
2300
2709
|
e.classList.toggle("selected", t), e.setAttribute("aria-selected", String(t));
|
|
2301
2710
|
}
|
|
2302
|
-
e && (e.innerHTML = t ?
|
|
2711
|
+
e && (e.innerHTML = t ? H(t) : e.innerHTML, e.classList.toggle("search-select-placeholder", !t));
|
|
2303
2712
|
}
|
|
2304
2713
|
_syncReset() {
|
|
2305
2714
|
let { reset: e } = this._refs();
|
|
@@ -2362,14 +2771,14 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2362
2771
|
disconnectedCallback() {
|
|
2363
2772
|
this._onDocClick && document.removeEventListener("click", this._onDocClick), L(this);
|
|
2364
2773
|
}
|
|
2365
|
-
},
|
|
2774
|
+
}, De = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), Oe = "image/png,image/jpeg,image/webp", ke = {
|
|
2366
2775
|
"image/png": [".png"],
|
|
2367
2776
|
"image/jpeg": [".jpg", ".jpeg"],
|
|
2368
2777
|
"image/webp": [".webp"],
|
|
2369
2778
|
"image/gif": [".gif"],
|
|
2370
2779
|
"image/svg+xml": [".svg"],
|
|
2371
2780
|
"application/pdf": [".pdf"]
|
|
2372
|
-
},
|
|
2781
|
+
}, Ae = {
|
|
2373
2782
|
"image/png": "PNG",
|
|
2374
2783
|
"image/jpeg": "JPG",
|
|
2375
2784
|
"image/webp": "WEBP",
|
|
@@ -2383,36 +2792,36 @@ var z = Symbol("wui.trustedHtml"), B = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2383
2792
|
".gif": "GIF",
|
|
2384
2793
|
".svg": "SVG",
|
|
2385
2794
|
".pdf": "PDF"
|
|
2386
|
-
},
|
|
2387
|
-
function
|
|
2795
|
+
}, je = (e) => String(e || "").split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
|
|
2796
|
+
function Me(e) {
|
|
2388
2797
|
let t = [];
|
|
2389
|
-
for (let n of
|
|
2390
|
-
let e =
|
|
2798
|
+
for (let n of je(e)) {
|
|
2799
|
+
let e = Ae[n] || (n.startsWith(".") ? n.slice(1).toUpperCase() : n.toUpperCase());
|
|
2391
2800
|
t.includes(e) || t.push(e);
|
|
2392
2801
|
}
|
|
2393
2802
|
return t.length <= 1 ? t[0] || "supported" : `${t.slice(0, -1).join(", ")} or ${t[t.length - 1]}`;
|
|
2394
2803
|
}
|
|
2395
|
-
function
|
|
2396
|
-
let n =
|
|
2804
|
+
function Ne(e, t) {
|
|
2805
|
+
let n = je(t);
|
|
2397
2806
|
if (!n.length) return !0;
|
|
2398
2807
|
let r = (e.type || "").toLowerCase(), i = (e.name || "").toLowerCase();
|
|
2399
|
-
return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (
|
|
2808
|
+
return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (ke[e] || []).some((e) => i.endsWith(e)));
|
|
2400
2809
|
}
|
|
2401
|
-
function
|
|
2810
|
+
function Pe(e, t = {}) {
|
|
2402
2811
|
if (!e) return null;
|
|
2403
|
-
let n = t.accept === void 0 ?
|
|
2404
|
-
return
|
|
2812
|
+
let n = t.accept === void 0 ? Oe : t.accept, r = t.maxSizeMb || 5;
|
|
2813
|
+
return Ne(e, n) ? e.size > r * 1024 * 1024 ? `Keep the file under ${r} MB.` : null : `Choose a ${Me(n)} file.`;
|
|
2405
2814
|
}
|
|
2406
|
-
var
|
|
2815
|
+
var X = (e, t) => {
|
|
2407
2816
|
typeof customElements < "u" && !customElements.get(e) && customElements.define(e, t);
|
|
2408
2817
|
};
|
|
2409
|
-
function
|
|
2410
|
-
|
|
2818
|
+
function Fe() {
|
|
2819
|
+
X("wui-select", Ee), X("wui-phone", we), X("wui-datepicker", se), X("wui-date-range", he), X("wui-autocomplete", te), X("wui-multiselect", ge), X("wui-otp", be), X("wui-status-icon", N);
|
|
2411
2820
|
}
|
|
2412
|
-
|
|
2821
|
+
Fe();
|
|
2413
2822
|
//#endregion
|
|
2414
2823
|
//#region src/components/RequiredMark.jsx
|
|
2415
|
-
function
|
|
2824
|
+
function Z() {
|
|
2416
2825
|
return /* @__PURE__ */ t("span", {
|
|
2417
2826
|
className: "required",
|
|
2418
2827
|
"aria-hidden": "true",
|
|
@@ -2421,7 +2830,7 @@ function X() {
|
|
|
2421
2830
|
}
|
|
2422
2831
|
//#endregion
|
|
2423
2832
|
//#region src/components/AppAutocomplete.jsx
|
|
2424
|
-
function
|
|
2833
|
+
function Ie({ value: e, onChange: r, options: i, loadOptions: o, placeholder: s = "Search…", minChars: l, debounce: u, disabled: d = !1, size: f, name: p, label: m, error: h, hint: g, required: _ = !1, fieldClassName: v = "", ...y }) {
|
|
2425
2834
|
T("AppAutocomplete", y);
|
|
2426
2835
|
let b = c(null), x = typeof o == "function";
|
|
2427
2836
|
return a(() => {
|
|
@@ -2456,7 +2865,7 @@ function Ee({ value: e, onChange: r, options: i, loadOptions: o, placeholder: s
|
|
|
2456
2865
|
m && /* @__PURE__ */ n("label", {
|
|
2457
2866
|
className: "label",
|
|
2458
2867
|
htmlFor: p,
|
|
2459
|
-
children: [m, _ && /* @__PURE__ */ t(
|
|
2868
|
+
children: [m, _ && /* @__PURE__ */ t(Z, {})]
|
|
2460
2869
|
}),
|
|
2461
2870
|
/* @__PURE__ */ t("wui-autocomplete", {
|
|
2462
2871
|
"aria-label": typeof m == "string" ? m : void 0,
|
|
@@ -2483,13 +2892,13 @@ function Ee({ value: e, onChange: r, options: i, loadOptions: o, placeholder: s
|
|
|
2483
2892
|
}
|
|
2484
2893
|
//#endregion
|
|
2485
2894
|
//#region src/components/AppAvatar.jsx
|
|
2486
|
-
function
|
|
2895
|
+
function Le(e) {
|
|
2487
2896
|
let t = (e || "").trim();
|
|
2488
2897
|
if (!t) return "?";
|
|
2489
2898
|
let n = t.split(/\s+/).filter(Boolean);
|
|
2490
2899
|
return n.length === 1 ? n[0].slice(0, 2).toUpperCase() : (n[0][0] + n[n.length - 1][0]).toUpperCase();
|
|
2491
2900
|
}
|
|
2492
|
-
function
|
|
2901
|
+
function Re({ name: e, src: n, className: r = "", ...i }) {
|
|
2493
2902
|
T("AppAvatar", i);
|
|
2494
2903
|
let a = ["avatar", r].filter(Boolean).join(" ");
|
|
2495
2904
|
return n ? /* @__PURE__ */ t("span", {
|
|
@@ -2503,12 +2912,12 @@ function Oe({ name: e, src: n, className: r = "", ...i }) {
|
|
|
2503
2912
|
className: a,
|
|
2504
2913
|
role: "img",
|
|
2505
2914
|
"aria-label": e,
|
|
2506
|
-
children:
|
|
2915
|
+
children: Le(e)
|
|
2507
2916
|
});
|
|
2508
2917
|
}
|
|
2509
2918
|
//#endregion
|
|
2510
2919
|
//#region src/components/AppBadge.jsx
|
|
2511
|
-
function
|
|
2920
|
+
function ze({ children: e, tone: n, dot: r = !1, className: i = "", ...a }) {
|
|
2512
2921
|
return T("AppBadge", a), /* @__PURE__ */ t(d, {
|
|
2513
2922
|
bg: !1,
|
|
2514
2923
|
className: [
|
|
@@ -2522,14 +2931,14 @@ function ke({ children: e, tone: n, dot: r = !1, className: i = "", ...a }) {
|
|
|
2522
2931
|
}
|
|
2523
2932
|
//#endregion
|
|
2524
2933
|
//#region src/components/AppButton.jsx
|
|
2525
|
-
var
|
|
2934
|
+
var Be = {
|
|
2526
2935
|
primary: "primary",
|
|
2527
2936
|
secondary: "secondary",
|
|
2528
2937
|
outline: "outline-primary",
|
|
2529
2938
|
ghost: "link",
|
|
2530
2939
|
danger: "danger"
|
|
2531
2940
|
};
|
|
2532
|
-
function
|
|
2941
|
+
function Ve(e, n) {
|
|
2533
2942
|
if (!e) return null;
|
|
2534
2943
|
let r = n === "left" ? "me-2" : "ms-2";
|
|
2535
2944
|
return typeof e == "string" ? /* @__PURE__ */ t(O, {
|
|
@@ -2541,12 +2950,12 @@ function je(e, n) {
|
|
|
2541
2950
|
children: e
|
|
2542
2951
|
});
|
|
2543
2952
|
}
|
|
2544
|
-
function
|
|
2953
|
+
function Q({ children: e, variant: r = "primary", size: i = "md", type: a = "button", loading: o = !1, disabled: s = !1, block: c = !1, leftIcon: l = null, rightIcon: u = null, className: d = "", ...p }) {
|
|
2545
2954
|
T("AppButton", p);
|
|
2546
2955
|
let m = [c ? "w-100" : "", d].filter(Boolean).join(" ");
|
|
2547
2956
|
return /* @__PURE__ */ n(f, {
|
|
2548
2957
|
type: (p.as === void 0 || p.as === "button") && p.href === void 0 ? a : void 0,
|
|
2549
|
-
variant:
|
|
2958
|
+
variant: Be[r] ?? "primary",
|
|
2550
2959
|
size: i === "md" ? void 0 : i,
|
|
2551
2960
|
disabled: s || o,
|
|
2552
2961
|
className: m || void 0,
|
|
@@ -2556,15 +2965,15 @@ function Z({ children: e, variant: r = "primary", size: i = "md", type: a = "but
|
|
|
2556
2965
|
className: "spinner-border spinner-border-sm me-2",
|
|
2557
2966
|
"aria-hidden": "true"
|
|
2558
2967
|
}),
|
|
2559
|
-
!o &&
|
|
2968
|
+
!o && Ve(l, "left"),
|
|
2560
2969
|
e,
|
|
2561
|
-
!o &&
|
|
2970
|
+
!o && Ve(u, "right")
|
|
2562
2971
|
]
|
|
2563
2972
|
});
|
|
2564
2973
|
}
|
|
2565
2974
|
//#endregion
|
|
2566
2975
|
//#region src/components/AppCallout.jsx
|
|
2567
|
-
function
|
|
2976
|
+
function He({ children: e, icon: r = "info", className: i = "", ...a }) {
|
|
2568
2977
|
return T("AppCallout", a), /* @__PURE__ */ n("div", {
|
|
2569
2978
|
className: `info-callout${i ? ` ${i}` : ""}`,
|
|
2570
2979
|
children: [r && /* @__PURE__ */ t("span", {
|
|
@@ -2578,7 +2987,7 @@ function Me({ children: e, icon: r = "info", className: i = "", ...a }) {
|
|
|
2578
2987
|
}
|
|
2579
2988
|
//#endregion
|
|
2580
2989
|
//#region src/components/AppCard.jsx
|
|
2581
|
-
function
|
|
2990
|
+
function Ue({ title: r, titleClassName: i = "", header: a, headerExtra: o, headerActions: s, children: c, className: l = "", bodyClassName: u = "", headerClassName: d = "", body: f = !0, lifted: m = !1, ...h }) {
|
|
2582
2991
|
T("AppCard", h);
|
|
2583
2992
|
let g = a != null || r != null || o != null || s != null;
|
|
2584
2993
|
return /* @__PURE__ */ n(p, {
|
|
@@ -2603,7 +3012,7 @@ function Ne({ title: r, titleClassName: i = "", header: a, headerExtra: o, heade
|
|
|
2603
3012
|
}
|
|
2604
3013
|
//#endregion
|
|
2605
3014
|
//#region src/components/AppCheckbox.jsx
|
|
2606
|
-
var
|
|
3015
|
+
var We = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
2607
3016
|
T("AppCheckbox", s);
|
|
2608
3017
|
let l = o(), u = r || i || l;
|
|
2609
3018
|
return /* @__PURE__ */ n("div", {
|
|
@@ -2624,7 +3033,7 @@ var Pe = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
|
2624
3033
|
});
|
|
2625
3034
|
//#endregion
|
|
2626
3035
|
//#region src/components/AppChip.jsx
|
|
2627
|
-
function
|
|
3036
|
+
function Ge({ label: r, children: i, tone: a = "neutral", size: o = "md", leadingIcon: s, avatar: c, onRemove: l, onClick: u, disabled: d = !1, removeLabel: f, className: p = "", ...m }) {
|
|
2628
3037
|
T("AppChip", m);
|
|
2629
3038
|
let h = r ?? i, g = [
|
|
2630
3039
|
"chip",
|
|
@@ -2676,7 +3085,7 @@ function Fe({ label: r, children: i, tone: a = "neutral", size: o = "md", leadin
|
|
|
2676
3085
|
}
|
|
2677
3086
|
//#endregion
|
|
2678
3087
|
//#region src/components/AppChoiceCard.jsx
|
|
2679
|
-
function
|
|
3088
|
+
function Ke({ name: r, multiple: i = !1, value: a, checked: o, onChange: s, icon: c, iconNode: l, iconSize: u = 18, image: d, imageAlt: f = "", children: p, title: m, description: h, checkIcon: g = "check", checkSize: _ = 12, className: v = "", ...y }) {
|
|
2680
3089
|
return T("AppChoiceCard", y), /* @__PURE__ */ n("label", {
|
|
2681
3090
|
className: `struct-card${d ? " struct-card-img-card" : ""}${o ? " checked" : ""}${v ? ` ${v}` : ""}`,
|
|
2682
3091
|
children: [
|
|
@@ -2724,7 +3133,7 @@ function Ie({ name: r, multiple: i = !1, value: a, checked: o, onChange: s, icon
|
|
|
2724
3133
|
}
|
|
2725
3134
|
//#endregion
|
|
2726
3135
|
//#region src/components/AppChoiceChip.jsx
|
|
2727
|
-
function
|
|
3136
|
+
function qe({ multiple: e = !0, label: r, name: i, value: a, checked: o, onChange: s, children: c, count: l, className: u = "", ...d }) {
|
|
2728
3137
|
return T("AppChoiceChip", d), /* @__PURE__ */ n("label", {
|
|
2729
3138
|
className: `choice-chip${o ? " checked" : ""}${u ? ` ${u}` : ""}`,
|
|
2730
3139
|
children: [
|
|
@@ -2745,7 +3154,7 @@ function Le({ multiple: e = !0, label: r, name: i, value: a, checked: o, onChang
|
|
|
2745
3154
|
}
|
|
2746
3155
|
//#endregion
|
|
2747
3156
|
//#region src/components/AppColorField.jsx
|
|
2748
|
-
function
|
|
3157
|
+
function Je({ value: e = "#000000", onChange: r, label: i, required: a = !1, error: o, hint: s, name: c, id: l, disabled: u = !1, className: d = "", ...f }) {
|
|
2749
3158
|
T("AppColorField", f);
|
|
2750
3159
|
let p = l || c;
|
|
2751
3160
|
return /* @__PURE__ */ n("div", {
|
|
@@ -2754,7 +3163,7 @@ function Re({ value: e = "#000000", onChange: r, label: i, required: a = !1, err
|
|
|
2754
3163
|
i && /* @__PURE__ */ n("label", {
|
|
2755
3164
|
className: "label",
|
|
2756
3165
|
htmlFor: p,
|
|
2757
|
-
children: [i, a && /* @__PURE__ */ t(
|
|
3166
|
+
children: [i, a && /* @__PURE__ */ t(Z, {})]
|
|
2758
3167
|
}),
|
|
2759
3168
|
/* @__PURE__ */ n("div", {
|
|
2760
3169
|
className: "color-field",
|
|
@@ -2793,7 +3202,7 @@ function Re({ value: e = "#000000", onChange: r, label: i, required: a = !1, err
|
|
|
2793
3202
|
}
|
|
2794
3203
|
//#endregion
|
|
2795
3204
|
//#region src/components/AppCompareTable.jsx
|
|
2796
|
-
function
|
|
3205
|
+
function Ye({ columns: e = [], rows: r = [], caption: i, className: a = "", ...o }) {
|
|
2797
3206
|
T("AppCompareTable", o);
|
|
2798
3207
|
let s = (e) => e === !0 ? /* @__PURE__ */ t("span", {
|
|
2799
3208
|
className: "compare-yes",
|
|
@@ -2829,7 +3238,7 @@ function ze({ columns: e = [], rows: r = [], caption: i, className: a = "", ...o
|
|
|
2829
3238
|
}
|
|
2830
3239
|
//#endregion
|
|
2831
3240
|
//#region src/components/AppInfoTip.jsx
|
|
2832
|
-
function
|
|
3241
|
+
function Xe({ label: e, children: r, ...i }) {
|
|
2833
3242
|
T("AppInfoTip", i);
|
|
2834
3243
|
let [a, u] = l(!1), [d, f] = l(null), p = c(null), m = c(null), g = o();
|
|
2835
3244
|
return s(() => {
|
|
@@ -2876,29 +3285,29 @@ function Q({ label: e, children: r, ...i }) {
|
|
|
2876
3285
|
}
|
|
2877
3286
|
//#endregion
|
|
2878
3287
|
//#region src/components/AppInput.jsx
|
|
2879
|
-
var
|
|
3288
|
+
var Ze = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, helpLabel: s = "More information", type: u = "text", size: d = "md", leftIcon: f, rightIcon: p, onRightIconClick: h, rightIconLabel: g, unit: _, id: v, name: y, className: b = "", fieldClassName: x = "", disabled: S = !1, clearable: C = !1, showCount: w = !1, maxLength: E, prefix: D, suffix: k, floatingLabel: A = !1, ...j }, M) {
|
|
2880
3289
|
T("AppInput", j);
|
|
2881
|
-
let [N, P] = l(!1), F = v || y, I = u === "password", L = I && N ? "text" : u,
|
|
2882
|
-
|
|
2883
|
-
},
|
|
2884
|
-
|
|
2885
|
-
},
|
|
3290
|
+
let [N, P] = l(!1), F = v || y, I = u === "password", L = I && N ? "text" : u, R = c(null), z = (e) => {
|
|
3291
|
+
R.current = e, typeof M == "function" ? M(e) : M && (M.current = e);
|
|
3292
|
+
}, B = String(j.value ?? j.defaultValue ?? ""), [V, ee] = l(() => !!B), [H, te] = l(() => B.length), ne = C && !S, re = C || w, ie = (e) => {
|
|
3293
|
+
ee(!!e.target.value), te(e.target.value.length), j.onInput?.(e);
|
|
3294
|
+
}, ae = ne ? /* @__PURE__ */ t("button", {
|
|
2886
3295
|
type: "button",
|
|
2887
3296
|
className: "input-clear",
|
|
2888
3297
|
onClick: () => {
|
|
2889
|
-
let e =
|
|
3298
|
+
let e = R.current;
|
|
2890
3299
|
if (!e) return;
|
|
2891
3300
|
let t = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set;
|
|
2892
|
-
t ? t.call(e, "") : e.value = "", e.dispatchEvent(new Event("input", { bubbles: !0 })),
|
|
3301
|
+
t ? t.call(e, "") : e.value = "", e.dispatchEvent(new Event("input", { bubbles: !0 })), ee(!1), e.focus();
|
|
2893
3302
|
},
|
|
2894
3303
|
"aria-label": "Clear",
|
|
2895
3304
|
tabIndex: -1,
|
|
2896
|
-
hidden: !
|
|
3305
|
+
hidden: !V,
|
|
2897
3306
|
children: /* @__PURE__ */ t(O, {
|
|
2898
3307
|
name: "x",
|
|
2899
3308
|
size: 16
|
|
2900
3309
|
})
|
|
2901
|
-
}) : null,
|
|
3310
|
+
}) : null, U = [
|
|
2902
3311
|
"input",
|
|
2903
3312
|
d === "sm" ? "input-sm" : "",
|
|
2904
3313
|
d === "lg" ? "input-lg" : "",
|
|
@@ -2907,26 +3316,26 @@ var Be = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
2907
3316
|
_ ? "num-input" : "",
|
|
2908
3317
|
C ? "has-clear" : "",
|
|
2909
3318
|
b
|
|
2910
|
-
].filter(Boolean).join(" "),
|
|
3319
|
+
].filter(Boolean).join(" "), W = /* @__PURE__ */ t(m.Control, {
|
|
2911
3320
|
id: F,
|
|
2912
3321
|
name: y,
|
|
2913
3322
|
type: L,
|
|
2914
|
-
className:
|
|
3323
|
+
className: U,
|
|
2915
3324
|
disabled: S,
|
|
2916
3325
|
required: r,
|
|
2917
3326
|
"aria-invalid": i ? "true" : "false",
|
|
2918
3327
|
maxLength: E,
|
|
2919
3328
|
...j,
|
|
2920
3329
|
placeholder: A ? " " : j.placeholder,
|
|
2921
|
-
ref:
|
|
2922
|
-
onInput:
|
|
2923
|
-
}),
|
|
2924
|
-
return
|
|
3330
|
+
ref: z,
|
|
3331
|
+
onInput: re ? ie : j.onInput
|
|
3332
|
+
}), G;
|
|
3333
|
+
return G = A && e ? /* @__PURE__ */ n("div", {
|
|
2925
3334
|
className: "field-float",
|
|
2926
|
-
children: [
|
|
3335
|
+
children: [W, /* @__PURE__ */ n("label", {
|
|
2927
3336
|
className: "float-label",
|
|
2928
3337
|
htmlFor: F,
|
|
2929
|
-
children: [e, r && /* @__PURE__ */ t(
|
|
3338
|
+
children: [e, r && /* @__PURE__ */ t(Z, {})]
|
|
2930
3339
|
})]
|
|
2931
3340
|
}) : D || k ? /* @__PURE__ */ n("div", {
|
|
2932
3341
|
className: "input-affixed",
|
|
@@ -2935,7 +3344,7 @@ var Be = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
2935
3344
|
className: "affix affix-pre",
|
|
2936
3345
|
children: D
|
|
2937
3346
|
}),
|
|
2938
|
-
|
|
3347
|
+
W,
|
|
2939
3348
|
k != null && /* @__PURE__ */ t("span", {
|
|
2940
3349
|
className: "affix affix-suf",
|
|
2941
3350
|
children: k
|
|
@@ -2943,13 +3352,13 @@ var Be = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
2943
3352
|
]
|
|
2944
3353
|
}) : _ ? /* @__PURE__ */ n("div", {
|
|
2945
3354
|
className: "input-with-unit",
|
|
2946
|
-
children: [
|
|
3355
|
+
children: [W, /* @__PURE__ */ t("span", {
|
|
2947
3356
|
className: "unit",
|
|
2948
3357
|
children: _
|
|
2949
3358
|
})]
|
|
2950
3359
|
}) : I ? /* @__PURE__ */ n("div", {
|
|
2951
3360
|
className: "input-wrap",
|
|
2952
|
-
children: [
|
|
3361
|
+
children: [W, /* @__PURE__ */ t("button", {
|
|
2953
3362
|
type: "button",
|
|
2954
3363
|
className: "pw-toggle",
|
|
2955
3364
|
onClick: () => P((e) => !e),
|
|
@@ -2962,7 +3371,7 @@ var Be = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
2962
3371
|
})]
|
|
2963
3372
|
}) : p ? /* @__PURE__ */ n("div", {
|
|
2964
3373
|
className: "input-wrap",
|
|
2965
|
-
children: [
|
|
3374
|
+
children: [W, /* @__PURE__ */ t("button", {
|
|
2966
3375
|
type: "button",
|
|
2967
3376
|
className: "pw-toggle",
|
|
2968
3377
|
onClick: h,
|
|
@@ -2984,8 +3393,8 @@ var Be = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
2984
3393
|
size: 16
|
|
2985
3394
|
})
|
|
2986
3395
|
}),
|
|
2987
|
-
|
|
2988
|
-
|
|
3396
|
+
W,
|
|
3397
|
+
ae
|
|
2989
3398
|
]
|
|
2990
3399
|
}) : f ? /* @__PURE__ */ n("div", {
|
|
2991
3400
|
className: "input-icon",
|
|
@@ -2995,8 +3404,8 @@ var Be = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
2995
3404
|
name: f,
|
|
2996
3405
|
size: 16
|
|
2997
3406
|
})
|
|
2998
|
-
}),
|
|
2999
|
-
}) :
|
|
3407
|
+
}), W]
|
|
3408
|
+
}) : W, /* @__PURE__ */ n(m.Group, {
|
|
3000
3409
|
className: `field${x ? ` ${x}` : ""}`,
|
|
3001
3410
|
children: [
|
|
3002
3411
|
e && !A && /* @__PURE__ */ n(m.Label, {
|
|
@@ -3004,14 +3413,14 @@ var Be = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
3004
3413
|
htmlFor: F,
|
|
3005
3414
|
children: [
|
|
3006
3415
|
e,
|
|
3007
|
-
r && /* @__PURE__ */ t(
|
|
3008
|
-
o && /* @__PURE__ */ t(
|
|
3416
|
+
r && /* @__PURE__ */ t(Z, {}),
|
|
3417
|
+
o && /* @__PURE__ */ t(Xe, {
|
|
3009
3418
|
label: s,
|
|
3010
3419
|
children: o
|
|
3011
3420
|
})
|
|
3012
3421
|
]
|
|
3013
3422
|
}),
|
|
3014
|
-
|
|
3423
|
+
G,
|
|
3015
3424
|
i ? /* @__PURE__ */ t("div", {
|
|
3016
3425
|
className: "field-error",
|
|
3017
3426
|
children: i
|
|
@@ -3020,20 +3429,20 @@ var Be = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
3020
3429
|
children: a
|
|
3021
3430
|
}) : null,
|
|
3022
3431
|
w && /* @__PURE__ */ n("div", {
|
|
3023
|
-
className: `field-count${E &&
|
|
3024
|
-
children: [
|
|
3432
|
+
className: `field-count${E && H >= E ? " at-limit" : ""}`,
|
|
3433
|
+
children: [H, E ? ` / ${E}` : ""]
|
|
3025
3434
|
})
|
|
3026
3435
|
]
|
|
3027
3436
|
});
|
|
3028
|
-
}),
|
|
3029
|
-
function
|
|
3437
|
+
}), Qe = "a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])";
|
|
3438
|
+
function $e({ open: e, title: r, subtitle: i, headerIcon: o, onClose: s, footer: l, size: u, wide: d = !1, side: f = !1, maxWidth: p, hideHeader: m = !1, className: h = "", children: _, ...v }) {
|
|
3030
3439
|
T("AppModal", v);
|
|
3031
3440
|
let y = c(null);
|
|
3032
3441
|
a(() => {
|
|
3033
3442
|
if (!e) return;
|
|
3034
3443
|
let t = y.current?.closest(".modal-content");
|
|
3035
3444
|
if (!t) return;
|
|
3036
|
-
let n = () => Array.from(t.querySelectorAll(
|
|
3445
|
+
let n = () => Array.from(t.querySelectorAll(Qe));
|
|
3037
3446
|
(t.querySelector("[data-autofocus]") || n().find((e) => !e.classList.contains("lx-modal-close")) || n()[0] || t).focus?.();
|
|
3038
3447
|
}, [e]);
|
|
3039
3448
|
let b = ["lx-modal-shell", f ? "is-side" : ""].filter(Boolean).join(" "), x = [
|
|
@@ -3118,7 +3527,7 @@ var $ = (e) => function({ size: n = 72 }) {
|
|
|
3118
3527
|
tone: e,
|
|
3119
3528
|
size: n
|
|
3120
3529
|
});
|
|
3121
|
-
},
|
|
3530
|
+
}, et = {
|
|
3122
3531
|
success: $("success"),
|
|
3123
3532
|
error: $("error"),
|
|
3124
3533
|
warning: $("warning"),
|
|
@@ -3127,14 +3536,14 @@ var $ = (e) => function({ size: n = 72 }) {
|
|
|
3127
3536
|
};
|
|
3128
3537
|
//#endregion
|
|
3129
3538
|
//#region src/components/AppConfirmDialog.jsx
|
|
3130
|
-
function
|
|
3539
|
+
function tt({ open: r, title: i, message: o, confirmLabel: s = "Confirm", cancelLabel: c = "Cancel", danger: u = !1, tone: d, confirmPhrase: f, onConfirm: p, onClose: m, ...h }) {
|
|
3131
3540
|
T("AppConfirmDialog", h);
|
|
3132
3541
|
let [g, _] = l("");
|
|
3133
3542
|
if (a(() => {
|
|
3134
3543
|
r || _("");
|
|
3135
3544
|
}, [r]), !r) return null;
|
|
3136
|
-
let v = !!f && g.trim() !== f, y =
|
|
3137
|
-
return /* @__PURE__ */ t(
|
|
3545
|
+
let v = !!f && g.trim() !== f, y = et[d || (u ? "delete" : "info")];
|
|
3546
|
+
return /* @__PURE__ */ t($e, {
|
|
3138
3547
|
open: r,
|
|
3139
3548
|
hideHeader: !0,
|
|
3140
3549
|
title: i,
|
|
@@ -3142,11 +3551,11 @@ function We({ open: r, title: i, message: o, confirmLabel: s = "Confirm", cancel
|
|
|
3142
3551
|
className: "lx-confirm",
|
|
3143
3552
|
footer: /* @__PURE__ */ n("div", {
|
|
3144
3553
|
className: "lx-confirm-actions",
|
|
3145
|
-
children: [/* @__PURE__ */ t(
|
|
3554
|
+
children: [/* @__PURE__ */ t(Q, {
|
|
3146
3555
|
variant: "secondary",
|
|
3147
3556
|
onClick: m,
|
|
3148
3557
|
children: c
|
|
3149
|
-
}), /* @__PURE__ */ t(
|
|
3558
|
+
}), /* @__PURE__ */ t(Q, {
|
|
3150
3559
|
variant: u ? "danger" : "primary",
|
|
3151
3560
|
disabled: v,
|
|
3152
3561
|
onClick: p,
|
|
@@ -3170,7 +3579,7 @@ function We({ open: r, title: i, message: o, confirmLabel: s = "Confirm", cancel
|
|
|
3170
3579
|
className: "lx-confirm-msg",
|
|
3171
3580
|
children: o
|
|
3172
3581
|
}),
|
|
3173
|
-
f && /* @__PURE__ */ t(
|
|
3582
|
+
f && /* @__PURE__ */ t(Ze, {
|
|
3174
3583
|
fieldClassName: "mt-3 mb-0 w-100 text-start",
|
|
3175
3584
|
label: /* @__PURE__ */ n(e, { children: [
|
|
3176
3585
|
"Type ",
|
|
@@ -3187,7 +3596,7 @@ function We({ open: r, title: i, message: o, confirmLabel: s = "Confirm", cancel
|
|
|
3187
3596
|
}
|
|
3188
3597
|
//#endregion
|
|
3189
3598
|
//#region src/components/AppSkeleton.jsx
|
|
3190
|
-
function
|
|
3599
|
+
function nt({ width: e = "100%", height: n = 14, radius: r = 6, className: i = "", style: a, ...o }) {
|
|
3191
3600
|
return T("AppSkeleton", o), /* @__PURE__ */ t("span", {
|
|
3192
3601
|
className: `skeleton${i ? ` ${i}` : ""}`,
|
|
3193
3602
|
"aria-hidden": "true",
|
|
@@ -3199,7 +3608,7 @@ function Ge({ width: e = "100%", height: n = 14, radius: r = 6, className: i = "
|
|
|
3199
3608
|
}
|
|
3200
3609
|
});
|
|
3201
3610
|
}
|
|
3202
|
-
var
|
|
3611
|
+
var rt = [
|
|
3203
3612
|
"r0",
|
|
3204
3613
|
"r1",
|
|
3205
3614
|
"r2",
|
|
@@ -3208,7 +3617,7 @@ var Ke = [
|
|
|
3208
3617
|
"r5",
|
|
3209
3618
|
"r6",
|
|
3210
3619
|
"r7"
|
|
3211
|
-
],
|
|
3620
|
+
], it = [
|
|
3212
3621
|
"c0",
|
|
3213
3622
|
"c1",
|
|
3214
3623
|
"c2",
|
|
@@ -3218,15 +3627,15 @@ var Ke = [
|
|
|
3218
3627
|
"c6",
|
|
3219
3628
|
"c7"
|
|
3220
3629
|
];
|
|
3221
|
-
function
|
|
3222
|
-
return
|
|
3630
|
+
function at({ rows: e = 4, cols: n = 5 }) {
|
|
3631
|
+
return rt.slice(0, e).map((e) => /* @__PURE__ */ t("tr", { children: it.slice(0, n).map((e, n) => /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(nt, {
|
|
3223
3632
|
width: n === 0 ? "70%" : "50%",
|
|
3224
3633
|
height: 12
|
|
3225
3634
|
}) }, e)) }, e));
|
|
3226
3635
|
}
|
|
3227
3636
|
//#endregion
|
|
3228
3637
|
//#region src/components/AppSelectMini.jsx
|
|
3229
|
-
function
|
|
3638
|
+
function ot({ value: e, onChange: n, options: r = [], placeholder: i = "Select...", name: o, ariaLabel: s, id: l, disabled: u, size: d, icon: f, prefix: p, className: m, ...h }) {
|
|
3230
3639
|
T("AppSelectMini", h);
|
|
3231
3640
|
let g = c(null);
|
|
3232
3641
|
return a(() => {
|
|
@@ -3260,19 +3669,19 @@ function Ye({ value: e, onChange: n, options: r = [], placeholder: i = "Select..
|
|
|
3260
3669
|
}
|
|
3261
3670
|
//#endregion
|
|
3262
3671
|
//#region src/components/AppTablePagination.jsx
|
|
3263
|
-
var
|
|
3672
|
+
var st = [
|
|
3264
3673
|
5,
|
|
3265
3674
|
10,
|
|
3266
3675
|
25,
|
|
3267
3676
|
50
|
|
3268
3677
|
];
|
|
3269
|
-
function
|
|
3678
|
+
function ct({ page: e, totalPages: r, pageSize: i, total: a, firstRow: o, lastRow: s, onPageChange: c, onPageSizeChange: l, pageSizes: u = st, ...d }) {
|
|
3270
3679
|
return T("AppTablePagination", d), /* @__PURE__ */ n("div", {
|
|
3271
3680
|
className: "table-pagination",
|
|
3272
3681
|
children: [
|
|
3273
3682
|
/* @__PURE__ */ n("span", {
|
|
3274
3683
|
className: "tpg-rows",
|
|
3275
|
-
children: ["Rows per page:", /* @__PURE__ */ t(
|
|
3684
|
+
children: ["Rows per page:", /* @__PURE__ */ t(ot, {
|
|
3276
3685
|
value: i,
|
|
3277
3686
|
onChange: (e) => l(Number(e)),
|
|
3278
3687
|
ariaLabel: "Rows per page",
|
|
@@ -3321,13 +3730,13 @@ function Ze({ page: e, totalPages: r, pageSize: i, total: a, firstRow: o, lastRo
|
|
|
3321
3730
|
}
|
|
3322
3731
|
//#endregion
|
|
3323
3732
|
//#region src/components/AppDataTable.jsx
|
|
3324
|
-
function
|
|
3733
|
+
function lt(e) {
|
|
3325
3734
|
return e === "end" ? "lx-cell-end" : e === "num" ? "num" : e === "center" ? "text-center" : "";
|
|
3326
3735
|
}
|
|
3327
|
-
function
|
|
3736
|
+
function ut(e) {
|
|
3328
3737
|
return e == null || e === "" ? "—" : e;
|
|
3329
3738
|
}
|
|
3330
|
-
function
|
|
3739
|
+
function dt({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s, loading: c = !1, skeletonRows: l = 5, empty: u = "No records found.", emptyFiltered: d, sourceCount: f, rowActions: p, rowActionsLabel: m, pagination: h, ariaLabel: g, className: _ = "", selectable: v = !1, selectedIds: y, onToggleRow: b, onToggleAll: x, ...S }) {
|
|
3331
3740
|
T("AppDataTable", S);
|
|
3332
3741
|
let C = Math.max(1, r.length + +!!p + +!!v), w = v && i ? i.reduce((e, t) => e + +!!y?.has(a(t)), 0) : 0, E = v && i && i.length > 0 && w === i.length, D = w > 0 && !E, k = (e) => {
|
|
3333
3742
|
e && (e.indeterminate = D);
|
|
@@ -3352,7 +3761,7 @@ function et({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3352
3761
|
r.map((e, r) => {
|
|
3353
3762
|
let i = !!(e.sortable && s), a = o && o.key === e.key;
|
|
3354
3763
|
return /* @__PURE__ */ n("th", {
|
|
3355
|
-
className: (i ? "sortable " : "") + (r === 0 ? "lx-name-cell " : "") +
|
|
3764
|
+
className: (i ? "sortable " : "") + (r === 0 ? "lx-name-cell " : "") + lt(e.align),
|
|
3356
3765
|
style: e.width ? { width: e.width } : void 0,
|
|
3357
3766
|
tabIndex: i ? 0 : void 0,
|
|
3358
3767
|
"aria-sort": a ? o.dir === "asc" ? "ascending" : "descending" : i ? "none" : void 0,
|
|
@@ -3379,7 +3788,7 @@ function et({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3379
3788
|
children: "Actions"
|
|
3380
3789
|
})
|
|
3381
3790
|
}))
|
|
3382
|
-
] }) }), /* @__PURE__ */ t("tbody", { children: c ? /* @__PURE__ */ t(
|
|
3791
|
+
] }) }), /* @__PURE__ */ t("tbody", { children: c ? /* @__PURE__ */ t(at, {
|
|
3383
3792
|
rows: l,
|
|
3384
3793
|
cols: C
|
|
3385
3794
|
}) : i?.length ? i.map((e) => {
|
|
@@ -3398,8 +3807,8 @@ function et({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3398
3807
|
})
|
|
3399
3808
|
}),
|
|
3400
3809
|
r.map((n, r) => /* @__PURE__ */ t("td", {
|
|
3401
|
-
className: (r === 0 ? "lx-name-cell " : "") +
|
|
3402
|
-
children: n.render ? n.render(e) :
|
|
3810
|
+
className: (r === 0 ? "lx-name-cell " : "") + lt(n.align) + (n.cellClassName ? ` ${n.cellClassName}` : ""),
|
|
3811
|
+
children: n.render ? n.render(e) : ut(e[n.key])
|
|
3403
3812
|
}, n.key)),
|
|
3404
3813
|
p && /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t("div", {
|
|
3405
3814
|
className: "u-row-actions",
|
|
@@ -3413,7 +3822,7 @@ function et({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3413
3822
|
children: A
|
|
3414
3823
|
}) }) })]
|
|
3415
3824
|
})
|
|
3416
|
-
}), h && !c && h.total > 0 && /* @__PURE__ */ t(
|
|
3825
|
+
}), h && !c && h.total > 0 && /* @__PURE__ */ t(ct, {
|
|
3417
3826
|
page: h.page,
|
|
3418
3827
|
totalPages: h.totalPages,
|
|
3419
3828
|
pageSize: h.pageSize,
|
|
@@ -3426,43 +3835,46 @@ function et({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3426
3835
|
}
|
|
3427
3836
|
//#endregion
|
|
3428
3837
|
//#region src/components/AppDatePicker.jsx
|
|
3429
|
-
function
|
|
3430
|
-
T("AppDatePicker",
|
|
3431
|
-
let
|
|
3838
|
+
function ft({ value: e, onChange: r, label: i, required: s = !1, hint: l, error: u, name: d, min: f, max: p, placeholder: m = "Enter Date", disabled: h, size: g, firstDay: _, id: v, ariaLabel: y, className: b = "", ...x }) {
|
|
3839
|
+
T("AppDatePicker", x);
|
|
3840
|
+
let S = c(null), C = o(), w = v || d || C;
|
|
3432
3841
|
a(() => {
|
|
3433
|
-
let t =
|
|
3842
|
+
let t = S.current;
|
|
3434
3843
|
t && t.value !== (e ?? "") && (t.value = e ?? "");
|
|
3435
3844
|
}, [e]), a(() => {
|
|
3436
|
-
let e =
|
|
3845
|
+
let e = S.current;
|
|
3437
3846
|
if (!e) return;
|
|
3438
3847
|
let t = () => r?.(e.value);
|
|
3439
3848
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
3440
3849
|
}, [r]);
|
|
3441
|
-
let
|
|
3442
|
-
ref:
|
|
3443
|
-
id:
|
|
3850
|
+
let E = !i && !u && !l, D = /* @__PURE__ */ t("wui-datepicker", {
|
|
3851
|
+
ref: S,
|
|
3852
|
+
id: w,
|
|
3444
3853
|
name: d,
|
|
3445
3854
|
min: f,
|
|
3446
3855
|
max: p,
|
|
3447
3856
|
placeholder: m,
|
|
3448
|
-
|
|
3857
|
+
size: g || void 0,
|
|
3858
|
+
"first-day": _ == null ? void 0 : String(_),
|
|
3859
|
+
"aria-label": y,
|
|
3449
3860
|
"aria-invalid": u ? "true" : void 0,
|
|
3450
3861
|
disabled: h ? "" : void 0,
|
|
3451
|
-
required: s ? "" : void 0
|
|
3862
|
+
required: s ? "" : void 0,
|
|
3863
|
+
className: E && b || void 0
|
|
3452
3864
|
});
|
|
3453
|
-
return
|
|
3454
|
-
className: `field${
|
|
3865
|
+
return E ? D : /* @__PURE__ */ n("div", {
|
|
3866
|
+
className: `field${b ? ` ${b}` : ""}`,
|
|
3455
3867
|
children: [
|
|
3456
3868
|
i && /* @__PURE__ */ n("label", {
|
|
3457
3869
|
className: "label",
|
|
3458
|
-
htmlFor:
|
|
3870
|
+
htmlFor: w,
|
|
3459
3871
|
children: [i, s && /* @__PURE__ */ t("span", {
|
|
3460
3872
|
className: "required",
|
|
3461
3873
|
"aria-hidden": "true",
|
|
3462
3874
|
children: "*"
|
|
3463
3875
|
})]
|
|
3464
3876
|
}),
|
|
3465
|
-
|
|
3877
|
+
D,
|
|
3466
3878
|
u && /* @__PURE__ */ t("div", {
|
|
3467
3879
|
className: "field-error",
|
|
3468
3880
|
children: u
|
|
@@ -3475,8 +3887,65 @@ function tt({ value: e, onChange: r, label: i, required: s = !1, hint: l, error:
|
|
|
3475
3887
|
});
|
|
3476
3888
|
}
|
|
3477
3889
|
//#endregion
|
|
3890
|
+
//#region src/components/AppDateRangePicker.jsx
|
|
3891
|
+
function pt({ start: e, end: r, onChange: i, label: s, required: l = !1, hint: u, error: d, startName: f, endName: p, min: m, max: h, placeholder: g = "Start – End", disabled: _, size: v, firstDay: y, id: b, ariaLabel: x, className: S = "", ...C }) {
|
|
3892
|
+
T("AppDateRangePicker", C);
|
|
3893
|
+
let w = c(null), E = o(), D = b || f || E;
|
|
3894
|
+
a(() => {
|
|
3895
|
+
let t = w.current;
|
|
3896
|
+
t && t.value.start !== (e ?? "") && t.setAttribute("start", e ?? "");
|
|
3897
|
+
}, [e]), a(() => {
|
|
3898
|
+
let e = w.current;
|
|
3899
|
+
e && e.value.end !== (r ?? "") && e.setAttribute("end", r ?? "");
|
|
3900
|
+
}, [r]), a(() => {
|
|
3901
|
+
let e = w.current;
|
|
3902
|
+
if (!e) return;
|
|
3903
|
+
let t = () => i?.(e.value);
|
|
3904
|
+
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
3905
|
+
}, [i]);
|
|
3906
|
+
let O = !s && !d && !u, k = /* @__PURE__ */ t("wui-date-range", {
|
|
3907
|
+
ref: w,
|
|
3908
|
+
id: D,
|
|
3909
|
+
"start-name": f,
|
|
3910
|
+
"end-name": p,
|
|
3911
|
+
min: m,
|
|
3912
|
+
max: h,
|
|
3913
|
+
placeholder: g,
|
|
3914
|
+
size: v || void 0,
|
|
3915
|
+
"first-day": y == null ? void 0 : String(y),
|
|
3916
|
+
"aria-label": x,
|
|
3917
|
+
"aria-invalid": d ? "true" : void 0,
|
|
3918
|
+
disabled: _ ? "" : void 0,
|
|
3919
|
+
required: l ? "" : void 0,
|
|
3920
|
+
className: O && S || void 0
|
|
3921
|
+
});
|
|
3922
|
+
return O ? k : /* @__PURE__ */ n("div", {
|
|
3923
|
+
className: `field${S ? ` ${S}` : ""}`,
|
|
3924
|
+
children: [
|
|
3925
|
+
s && /* @__PURE__ */ n("label", {
|
|
3926
|
+
className: "label",
|
|
3927
|
+
htmlFor: D,
|
|
3928
|
+
children: [s, l && /* @__PURE__ */ t("span", {
|
|
3929
|
+
className: "required",
|
|
3930
|
+
"aria-hidden": "true",
|
|
3931
|
+
children: "*"
|
|
3932
|
+
})]
|
|
3933
|
+
}),
|
|
3934
|
+
k,
|
|
3935
|
+
d && /* @__PURE__ */ t("div", {
|
|
3936
|
+
className: "field-error",
|
|
3937
|
+
children: d
|
|
3938
|
+
}),
|
|
3939
|
+
!d && u && /* @__PURE__ */ t("div", {
|
|
3940
|
+
className: "field-hint",
|
|
3941
|
+
children: u
|
|
3942
|
+
})
|
|
3943
|
+
]
|
|
3944
|
+
});
|
|
3945
|
+
}
|
|
3946
|
+
//#endregion
|
|
3478
3947
|
//#region src/components/AppDropdown.jsx
|
|
3479
|
-
var
|
|
3948
|
+
var mt = r(function({ icon: e, iconSize: n = 20, btnClassName: r = "topbar-icon-btn", label: i, align: a = "end", "aria-label": o, className: s, ...c }, l) {
|
|
3480
3949
|
return /* @__PURE__ */ t("button", {
|
|
3481
3950
|
ref: l,
|
|
3482
3951
|
type: "button",
|
|
@@ -3490,11 +3959,11 @@ var nt = r(function({ icon: e, iconSize: n = 20, btnClassName: r = "topbar-icon-
|
|
|
3490
3959
|
})
|
|
3491
3960
|
});
|
|
3492
3961
|
});
|
|
3493
|
-
function
|
|
3962
|
+
function ht({ icon: e, iconSize: r, toggleClassName: i = "topbar-icon-btn", label: a, ariaLabel: o, align: s = "end", items: c = [], menuClassName: l = "", linkComponent: u, ...d }) {
|
|
3494
3963
|
return T("AppDropdown", d), /* @__PURE__ */ n(_, {
|
|
3495
3964
|
align: s,
|
|
3496
3965
|
children: [/* @__PURE__ */ t(_.Toggle, {
|
|
3497
|
-
as:
|
|
3966
|
+
as: mt,
|
|
3498
3967
|
icon: e,
|
|
3499
3968
|
iconSize: r,
|
|
3500
3969
|
btnClassName: i,
|
|
@@ -3532,7 +4001,7 @@ function rt({ icon: e, iconSize: r, toggleClassName: i = "topbar-icon-btn", labe
|
|
|
3532
4001
|
}
|
|
3533
4002
|
//#endregion
|
|
3534
4003
|
//#region src/components/AppEmptyState.jsx
|
|
3535
|
-
function
|
|
4004
|
+
function gt({ icon: e, iconSize: r = 24, size: i = "md", title: a, text: o, action: s, className: c = "", style: l, ...u }) {
|
|
3536
4005
|
return T("AppEmptyState", u), /* @__PURE__ */ n("div", {
|
|
3537
4006
|
className: [
|
|
3538
4007
|
"empty-state",
|
|
@@ -3565,7 +4034,7 @@ function it({ icon: e, iconSize: r = 24, size: i = "md", title: a, text: o, acti
|
|
|
3565
4034
|
}
|
|
3566
4035
|
//#endregion
|
|
3567
4036
|
//#region src/components/AppFileAttachment.jsx
|
|
3568
|
-
function
|
|
4037
|
+
function _t({ label: r = "Attachment", value: i, name: s, onChange: c, accept: u = Oe, maxSizeMb: d = 5, optional: f = !1, error: p, id: m, ...h }) {
|
|
3569
4038
|
T("AppFileAttachment", h);
|
|
3570
4039
|
let g = o(), _ = m || s || g, [v, y] = l(null), [b, x] = l("");
|
|
3571
4040
|
a(() => {
|
|
@@ -3578,7 +4047,7 @@ function at({ label: r = "Attachment", value: i, name: s, onChange: c, accept: u
|
|
|
3578
4047
|
function S(e) {
|
|
3579
4048
|
let t = e.target.files?.[0];
|
|
3580
4049
|
if (e.target.value = "", !t) return;
|
|
3581
|
-
let n =
|
|
4050
|
+
let n = Pe(t, {
|
|
3582
4051
|
accept: u,
|
|
3583
4052
|
maxSizeMb: d
|
|
3584
4053
|
});
|
|
@@ -3677,22 +4146,22 @@ function at({ label: r = "Attachment", value: i, name: s, onChange: c, accept: u
|
|
|
3677
4146
|
}
|
|
3678
4147
|
//#endregion
|
|
3679
4148
|
//#region src/components/toast.js
|
|
3680
|
-
var
|
|
4149
|
+
var vt = /* @__PURE__ */ new Set([
|
|
3681
4150
|
"success",
|
|
3682
4151
|
"info",
|
|
3683
4152
|
"warning",
|
|
3684
4153
|
"error"
|
|
3685
4154
|
]);
|
|
3686
|
-
function
|
|
3687
|
-
let n =
|
|
4155
|
+
function yt(e, t = "success") {
|
|
4156
|
+
let n = vt.has(t) ? t : "success";
|
|
3688
4157
|
v[n](e, { toastId: `${n}:${e}` });
|
|
3689
4158
|
}
|
|
3690
|
-
function
|
|
4159
|
+
function bt(e) {
|
|
3691
4160
|
v.error(e, { toastId: `error:${e}` });
|
|
3692
4161
|
}
|
|
3693
4162
|
//#endregion
|
|
3694
4163
|
//#region src/components/AppFilePicker.jsx
|
|
3695
|
-
function
|
|
4164
|
+
function xt({ label: e, value: r, name: i, onPick: s, accept: u = ".jpg,.jpeg,.png", maxSizeMb: d = 5, required: f, error: p, ...m }) {
|
|
3696
4165
|
T("AppFilePicker", m);
|
|
3697
4166
|
let [h, g] = l(null), [_, v] = l(!1), y = c(null), b = o(), x = i || b;
|
|
3698
4167
|
a(() => {
|
|
@@ -3703,11 +4172,11 @@ function lt({ label: e, value: r, name: i, onPick: s, accept: u = ".jpg,.jpeg,.p
|
|
|
3703
4172
|
g(null);
|
|
3704
4173
|
}, [r]);
|
|
3705
4174
|
let S = r?.url || h, C = (e) => {
|
|
3706
|
-
let t =
|
|
4175
|
+
let t = Pe(e, {
|
|
3707
4176
|
accept: u,
|
|
3708
4177
|
maxSizeMb: d
|
|
3709
4178
|
});
|
|
3710
|
-
return t ? (
|
|
4179
|
+
return t ? (yt(t, "error"), !1) : (s(e), !0);
|
|
3711
4180
|
}, w = (e) => {
|
|
3712
4181
|
let t = e.target.files?.[0] || null;
|
|
3713
4182
|
t && (C(t) || (e.target.value = ""));
|
|
@@ -3733,7 +4202,7 @@ function lt({ label: e, value: r, name: i, onPick: s, accept: u = ".jpg,.jpeg,.p
|
|
|
3733
4202
|
/* @__PURE__ */ n("label", {
|
|
3734
4203
|
className: "label",
|
|
3735
4204
|
htmlFor: x,
|
|
3736
|
-
children: [e, f && /* @__PURE__ */ t(
|
|
4205
|
+
children: [e, f && /* @__PURE__ */ t(Z, {})]
|
|
3737
4206
|
}),
|
|
3738
4207
|
S ? /* @__PURE__ */ n("div", {
|
|
3739
4208
|
className: `file-preview${p ? " error" : ""}`,
|
|
@@ -3818,7 +4287,7 @@ function lt({ label: e, value: r, name: i, onPick: s, accept: u = ".jpg,.jpeg,.p
|
|
|
3818
4287
|
}
|
|
3819
4288
|
//#endregion
|
|
3820
4289
|
//#region src/components/AppInfoList.jsx
|
|
3821
|
-
function
|
|
4290
|
+
function St({ items: r = [], className: i = "", ...a }) {
|
|
3822
4291
|
return T("AppInfoList", a), /* @__PURE__ */ t("div", {
|
|
3823
4292
|
className: `info-list${i ? ` ${i}` : ""}`,
|
|
3824
4293
|
children: r.map((r, i) => {
|
|
@@ -3851,7 +4320,7 @@ function ut({ items: r = [], className: i = "", ...a }) {
|
|
|
3851
4320
|
}
|
|
3852
4321
|
//#endregion
|
|
3853
4322
|
//#region src/components/AppKpiTile.jsx
|
|
3854
|
-
function
|
|
4323
|
+
function Ct({ label: e, value: r, icon: i, delta: a, deltaDirection: o = "flat", inline: s = !1, className: c = "", ...l }) {
|
|
3855
4324
|
T("AppKpiTile", l);
|
|
3856
4325
|
let u = `kpi${s ? " kpi-inline" : ""}${c ? ` ${c}` : ""}`, d = o === "up" ? "arrow-up" : o === "down" ? "arrow-down" : null;
|
|
3857
4326
|
return /* @__PURE__ */ n("div", {
|
|
@@ -3884,7 +4353,7 @@ function dt({ label: e, value: r, icon: i, delta: a, deltaDirection: o = "flat",
|
|
|
3884
4353
|
}
|
|
3885
4354
|
//#endregion
|
|
3886
4355
|
//#region src/components/AppLogoPicker.jsx
|
|
3887
|
-
function
|
|
4356
|
+
function wt({ value: r, fallback: i, name: a, onPick: o, loading: s = !1, accept: l = "image/png,image/jpeg", maxSizeMb: u = 5, overlayIcon: d = "image", overlayLabel: f = "Update photo", ariaLabel: p = "Upload photo", ...m }) {
|
|
3888
4357
|
T("AppLogoPicker", m);
|
|
3889
4358
|
let h = c(null);
|
|
3890
4359
|
return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("button", {
|
|
@@ -3930,12 +4399,12 @@ function ft({ value: r, fallback: i, name: a, onPick: o, loading: s = !1, accept
|
|
|
3930
4399
|
onChange: (e) => {
|
|
3931
4400
|
let t = e.target.files?.[0];
|
|
3932
4401
|
if (e.target.value = "", !t) return;
|
|
3933
|
-
let n =
|
|
4402
|
+
let n = Pe(t, {
|
|
3934
4403
|
accept: l,
|
|
3935
4404
|
maxSizeMb: u
|
|
3936
4405
|
});
|
|
3937
4406
|
if (n) {
|
|
3938
|
-
|
|
4407
|
+
yt(n, "error");
|
|
3939
4408
|
return;
|
|
3940
4409
|
}
|
|
3941
4410
|
o(t);
|
|
@@ -3945,7 +4414,7 @@ function ft({ value: r, fallback: i, name: a, onPick: o, loading: s = !1, accept
|
|
|
3945
4414
|
}
|
|
3946
4415
|
//#endregion
|
|
3947
4416
|
//#region src/components/AppMultiSelect.jsx
|
|
3948
|
-
function
|
|
4417
|
+
function Tt({ values: e, onChange: r, options: i, placeholder: o = "Select…", searchPlaceholder: s = "Search…", searchable: l = !0, disabled: u = !1, icon: d, size: f, collapseChips: p = !1, name: m, label: h, error: g, hint: _, required: v = !1, fieldClassName: y = "", ...b }) {
|
|
3949
4418
|
T("AppMultiSelect", b);
|
|
3950
4419
|
let x = c(null);
|
|
3951
4420
|
return a(() => {
|
|
@@ -3967,7 +4436,7 @@ function pt({ values: e, onChange: r, options: i, placeholder: o = "Select…",
|
|
|
3967
4436
|
h && /* @__PURE__ */ n("label", {
|
|
3968
4437
|
className: "label",
|
|
3969
4438
|
htmlFor: m,
|
|
3970
|
-
children: [h, v && /* @__PURE__ */ t(
|
|
4439
|
+
children: [h, v && /* @__PURE__ */ t(Z, {})]
|
|
3971
4440
|
}),
|
|
3972
4441
|
/* @__PURE__ */ t("wui-multiselect", {
|
|
3973
4442
|
"aria-label": typeof h == "string" ? h : void 0,
|
|
@@ -3995,7 +4464,7 @@ function pt({ values: e, onChange: r, options: i, placeholder: o = "Select…",
|
|
|
3995
4464
|
}
|
|
3996
4465
|
//#endregion
|
|
3997
4466
|
//#region src/components/AppOtpInput.jsx
|
|
3998
|
-
var
|
|
4467
|
+
var Et = r(function({ value: e, onChange: r, onComplete: i, length: s = 6, mode: l = "numeric", label: u, required: d = !1, hint: f, error: p, disabled: m = !1, name: h, id: g, className: _ = "", ...v }, y) {
|
|
3999
4468
|
T("AppOtpInput", v);
|
|
4000
4469
|
let b = c(null), x = o(), S = g || h || x, C = (e) => {
|
|
4001
4470
|
b.current = e, typeof y == "function" ? y(e) : y && (y.current = e);
|
|
@@ -4048,7 +4517,7 @@ var mt = r(function({ value: e, onChange: r, onComplete: i, length: s = 6, mode:
|
|
|
4048
4517
|
});
|
|
4049
4518
|
//#endregion
|
|
4050
4519
|
//#region src/components/AppPageHeader.jsx
|
|
4051
|
-
function
|
|
4520
|
+
function Dt({ title: e, subtitle: r, actions: i, className: a = "", ...o }) {
|
|
4052
4521
|
return T("AppPageHeader", o), /* @__PURE__ */ n("div", {
|
|
4053
4522
|
className: `page-header${i ? " d-flex align-items-end justify-content-between" : ""}${a ? ` ${a}` : ""}`,
|
|
4054
4523
|
children: [/* @__PURE__ */ n("div", { children: [/* @__PURE__ */ t("div", {
|
|
@@ -4065,7 +4534,7 @@ function ht({ title: e, subtitle: r, actions: i, className: a = "", ...o }) {
|
|
|
4065
4534
|
}
|
|
4066
4535
|
//#endregion
|
|
4067
4536
|
//#region src/components/AppPhoneNumberInput.jsx
|
|
4068
|
-
function
|
|
4537
|
+
function Ot({ value: e, onChange: r, country: i, disabled: o = !1, name: s, label: l = "Phone number", placeholder: u = "Enter phone number", required: d = !1, error: f, fieldClassName: p = "", ...m }) {
|
|
4069
4538
|
T("AppPhoneNumberInput", m);
|
|
4070
4539
|
let h = c(null);
|
|
4071
4540
|
return a(() => {
|
|
@@ -4082,7 +4551,7 @@ function gt({ value: e, onChange: r, country: i, disabled: o = !1, name: s, labe
|
|
|
4082
4551
|
l && /* @__PURE__ */ n("label", {
|
|
4083
4552
|
className: "label",
|
|
4084
4553
|
htmlFor: s,
|
|
4085
|
-
children: [l, d && /* @__PURE__ */ t(
|
|
4554
|
+
children: [l, d && /* @__PURE__ */ t(Z, {})]
|
|
4086
4555
|
}),
|
|
4087
4556
|
/* @__PURE__ */ t("wui-phone", {
|
|
4088
4557
|
ref: h,
|
|
@@ -4100,7 +4569,7 @@ function gt({ value: e, onChange: r, country: i, disabled: o = !1, name: s, labe
|
|
|
4100
4569
|
}
|
|
4101
4570
|
//#endregion
|
|
4102
4571
|
//#region src/components/AppPricingCard.jsx
|
|
4103
|
-
function
|
|
4572
|
+
function kt({ name: e, price: r, unit: i, tagline: a, features: o = [], cta: s, featured: c = !1, current: l = !1, badge: u = "Most popular", className: d = "", ...f }) {
|
|
4104
4573
|
return T("AppPricingCard", f), /* @__PURE__ */ n("div", {
|
|
4105
4574
|
className: [
|
|
4106
4575
|
"plan-card",
|
|
@@ -4153,7 +4622,7 @@ function _t({ name: e, price: r, unit: i, tagline: a, features: o = [], cta: s,
|
|
|
4153
4622
|
}
|
|
4154
4623
|
//#endregion
|
|
4155
4624
|
//#region src/components/AppRadio.jsx
|
|
4156
|
-
var
|
|
4625
|
+
var At = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
4157
4626
|
T("AppRadio", s);
|
|
4158
4627
|
let l = o(), u = r || l;
|
|
4159
4628
|
return /* @__PURE__ */ n("div", {
|
|
@@ -4174,7 +4643,7 @@ var vt = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
|
4174
4643
|
});
|
|
4175
4644
|
//#endregion
|
|
4176
4645
|
//#region src/components/AppRepeater.jsx
|
|
4177
|
-
function
|
|
4646
|
+
function jt({ rows: e = [], renderRow: r, onAdd: i, onRemove: a, addLabel: o = "Add another", removeLabel: s = "Remove row", emptyText: c, min: l = 0, max: u, numbered: d = !0, className: f = "", ...p }) {
|
|
4178
4647
|
T("AppRepeater", p);
|
|
4179
4648
|
let m = typeof u == "number" && e.length >= u, h = !!a && e.length > l;
|
|
4180
4649
|
return /* @__PURE__ */ n("div", {
|
|
@@ -4204,7 +4673,7 @@ function yt({ rows: e = [], renderRow: r, onAdd: i, onRemove: a, addLabel: o = "
|
|
|
4204
4673
|
})
|
|
4205
4674
|
]
|
|
4206
4675
|
}, e.id ?? i)),
|
|
4207
|
-
/* @__PURE__ */ t(
|
|
4676
|
+
/* @__PURE__ */ t(Q, {
|
|
4208
4677
|
variant: "secondary",
|
|
4209
4678
|
size: "sm",
|
|
4210
4679
|
leftIcon: "plus",
|
|
@@ -4218,7 +4687,7 @@ function yt({ rows: e = [], renderRow: r, onAdd: i, onRemove: a, addLabel: o = "
|
|
|
4218
4687
|
}
|
|
4219
4688
|
//#endregion
|
|
4220
4689
|
//#region src/components/AppResourceCard.jsx
|
|
4221
|
-
function
|
|
4690
|
+
function Mt({ icon: r, title: i, text: a, href: o, external: s = !1, linkComponent: c, className: l = "", ...u }) {
|
|
4222
4691
|
T("AppResourceCard", u);
|
|
4223
4692
|
let d = /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", {
|
|
4224
4693
|
className: "res-card-icon",
|
|
@@ -4250,7 +4719,7 @@ function bt({ icon: r, title: i, text: a, href: o, external: s = !1, linkCompone
|
|
|
4250
4719
|
}
|
|
4251
4720
|
//#endregion
|
|
4252
4721
|
//#region src/components/AppSearch.jsx
|
|
4253
|
-
function
|
|
4722
|
+
function Nt({ value: e, onValueChange: r, placeholder: i = "Search…", ariaLabel: a, iconSize: o = 18, size: s, loading: c = !1, disabled: l = !1, className: u = "", ...d }) {
|
|
4254
4723
|
return T("AppSearch", d), /* @__PURE__ */ n("div", {
|
|
4255
4724
|
className: [
|
|
4256
4725
|
"search-wrap",
|
|
@@ -4294,22 +4763,58 @@ function xt({ value: e, onValueChange: r, placeholder: i = "Search…", ariaLabe
|
|
|
4294
4763
|
}
|
|
4295
4764
|
//#endregion
|
|
4296
4765
|
//#region src/components/AppSegmented.jsx
|
|
4297
|
-
function
|
|
4298
|
-
T("AppSegmented",
|
|
4299
|
-
let
|
|
4300
|
-
|
|
4301
|
-
|
|
4766
|
+
function Pt({ options: e = [], value: r, onChange: i, label: l, name: u, size: d = "md", fullWidth: f = !1, disabled: p = !1, className: m = "", ...h }) {
|
|
4767
|
+
T("AppSegmented", h);
|
|
4768
|
+
let g = o(), _ = u || g, v = c(null), y = c(null), b = [
|
|
4769
|
+
"segmented",
|
|
4770
|
+
d === "sm" ? "segmented-sm" : d === "lg" ? "segmented-lg" : "",
|
|
4771
|
+
f ? "segmented-full" : "",
|
|
4772
|
+
p ? "is-disabled" : "",
|
|
4773
|
+
m
|
|
4774
|
+
].filter(Boolean).join(" ");
|
|
4775
|
+
return s(() => {
|
|
4776
|
+
let e = v.current, t = y.current;
|
|
4777
|
+
if (!e || !t) return;
|
|
4778
|
+
let n = () => {
|
|
4779
|
+
let n = e.querySelector(".segmented-option:has(.segmented-input:checked)");
|
|
4780
|
+
if (!n) {
|
|
4781
|
+
t.style.opacity = "0";
|
|
4782
|
+
return;
|
|
4783
|
+
}
|
|
4784
|
+
let r = e.getBoundingClientRect(), i = n.getBoundingClientRect(), a = Number.parseFloat(getComputedStyle(e).borderLeftWidth) || 0;
|
|
4785
|
+
t.style.width = `${i.width}px`, t.style.transform = `translateX(${i.left - r.left - a}px)`;
|
|
4786
|
+
};
|
|
4787
|
+
n();
|
|
4788
|
+
let r = typeof ResizeObserver < "u" ? new ResizeObserver(n) : null;
|
|
4789
|
+
return r?.observe(e), () => r?.disconnect();
|
|
4790
|
+
}, [
|
|
4791
|
+
r,
|
|
4792
|
+
e,
|
|
4793
|
+
d,
|
|
4794
|
+
f
|
|
4795
|
+
]), a(() => {
|
|
4796
|
+
let e = requestAnimationFrame(() => v.current?.classList.add("is-animated"));
|
|
4797
|
+
return () => cancelAnimationFrame(e);
|
|
4798
|
+
}, []), /* @__PURE__ */ n("div", {
|
|
4799
|
+
ref: v,
|
|
4800
|
+
className: b,
|
|
4302
4801
|
role: "radiogroup",
|
|
4303
|
-
"aria-label":
|
|
4304
|
-
|
|
4802
|
+
"aria-label": l,
|
|
4803
|
+
"aria-disabled": p || void 0,
|
|
4804
|
+
children: [/* @__PURE__ */ t("span", {
|
|
4805
|
+
className: "segmented-thumb",
|
|
4806
|
+
ref: y,
|
|
4807
|
+
"aria-hidden": "true"
|
|
4808
|
+
}), e.map((e) => /* @__PURE__ */ n("label", {
|
|
4305
4809
|
className: "segmented-option",
|
|
4306
4810
|
children: [
|
|
4307
4811
|
/* @__PURE__ */ t("input", {
|
|
4308
4812
|
type: "radio",
|
|
4309
4813
|
className: "segmented-input",
|
|
4310
|
-
name:
|
|
4814
|
+
name: _,
|
|
4311
4815
|
value: e.value,
|
|
4312
4816
|
checked: e.value === r,
|
|
4817
|
+
disabled: p || e.disabled,
|
|
4313
4818
|
onChange: () => i?.(e.value)
|
|
4314
4819
|
}),
|
|
4315
4820
|
e.icon && /* @__PURE__ */ t(O, {
|
|
@@ -4318,19 +4823,19 @@ function St({ options: e = [], value: r, onChange: i, label: a, name: s, size: c
|
|
|
4318
4823
|
}),
|
|
4319
4824
|
e.label
|
|
4320
4825
|
]
|
|
4321
|
-
}, e.value))
|
|
4826
|
+
}, e.value))]
|
|
4322
4827
|
});
|
|
4323
4828
|
}
|
|
4324
4829
|
//#endregion
|
|
4325
4830
|
//#region src/components/AppSelect.jsx
|
|
4326
|
-
var
|
|
4327
|
-
function
|
|
4831
|
+
var Ft = (e) => e == null ? "" : e.label ?? e.text ?? "";
|
|
4832
|
+
function It({ value: e, onChange: r, options: i = [], placeholder: o = "Select...", searchPlaceholder: s = "Search...", searchable: l = !1, clearable: u = !1, size: d, icon: f, floatingLabel: p = !1, disabled: m, label: h, required: g = !1, error: _, hint: v, help: y, helpLabel: b = "More information", id: x, name: S, className: C = "", fieldClassName: w = "", ...E }) {
|
|
4328
4833
|
T("AppSelect", E);
|
|
4329
4834
|
let D = c(null);
|
|
4330
4835
|
a(() => {
|
|
4331
4836
|
D.current && (D.current.options = i.map((e) => ({
|
|
4332
4837
|
value: e.value,
|
|
4333
|
-
label:
|
|
4838
|
+
label: Ft(e),
|
|
4334
4839
|
icon: e.icon
|
|
4335
4840
|
})));
|
|
4336
4841
|
}, [i]), a(() => {
|
|
@@ -4370,8 +4875,8 @@ function wt({ value: e, onChange: r, options: i = [], placeholder: o = "Select..
|
|
|
4370
4875
|
htmlFor: k,
|
|
4371
4876
|
children: [
|
|
4372
4877
|
h,
|
|
4373
|
-
g && /* @__PURE__ */ t(
|
|
4374
|
-
y && /* @__PURE__ */ t(
|
|
4878
|
+
g && /* @__PURE__ */ t(Z, {}),
|
|
4879
|
+
y && /* @__PURE__ */ t(Xe, {
|
|
4375
4880
|
label: b,
|
|
4376
4881
|
children: y
|
|
4377
4882
|
})
|
|
@@ -4382,7 +4887,7 @@ function wt({ value: e, onChange: r, options: i = [], placeholder: o = "Select..
|
|
|
4382
4887
|
children: [O, /* @__PURE__ */ n("label", {
|
|
4383
4888
|
className: "float-label",
|
|
4384
4889
|
htmlFor: k,
|
|
4385
|
-
children: [h, g && /* @__PURE__ */ t(
|
|
4890
|
+
children: [h, g && /* @__PURE__ */ t(Z, {})]
|
|
4386
4891
|
})]
|
|
4387
4892
|
}) : O,
|
|
4388
4893
|
_ ? /* @__PURE__ */ t("div", {
|
|
@@ -4397,7 +4902,7 @@ function wt({ value: e, onChange: r, options: i = [], placeholder: o = "Select..
|
|
|
4397
4902
|
}
|
|
4398
4903
|
//#endregion
|
|
4399
4904
|
//#region src/components/AppShell.jsx
|
|
4400
|
-
function
|
|
4905
|
+
function Lt({ groups: e = [], brand: r, sidebarFooter: i, topbarStart: o, topbarEnd: s, footer: c, children: u, collapsed: d, onCollapsedChange: f, noSidebar: p = !1, navLabel: m = "Main navigation", linkComponent: h, className: g = "", ..._ }) {
|
|
4401
4906
|
T("AppShell", _);
|
|
4402
4907
|
let [v, y] = l(!1), [b, x] = l(!1), [S, C] = l(!1), w = d ?? v;
|
|
4403
4908
|
return a(() => {
|
|
@@ -4433,7 +4938,7 @@ function Tt({ groups: e = [], brand: r, sidebarFooter: i, topbarStart: o, topbar
|
|
|
4433
4938
|
children: [e.label && /* @__PURE__ */ t("div", {
|
|
4434
4939
|
className: "app-nav-group-label",
|
|
4435
4940
|
children: e.label
|
|
4436
|
-
}), e.items.map((e) => /* @__PURE__ */ t(
|
|
4941
|
+
}), e.items.map((e) => /* @__PURE__ */ t(Rt, {
|
|
4437
4942
|
item: e,
|
|
4438
4943
|
linkComponent: h,
|
|
4439
4944
|
onNavigate: () => x(!1)
|
|
@@ -4503,7 +5008,7 @@ function Tt({ groups: e = [], brand: r, sidebarFooter: i, topbarStart: o, topbar
|
|
|
4503
5008
|
]
|
|
4504
5009
|
});
|
|
4505
5010
|
}
|
|
4506
|
-
function
|
|
5011
|
+
function Rt({ item: r, linkComponent: i, onNavigate: a }) {
|
|
4507
5012
|
let o = `app-nav-item${r.active ? " active" : ""}`, s = /* @__PURE__ */ n(e, { children: [
|
|
4508
5013
|
r.icon && /* @__PURE__ */ t("span", {
|
|
4509
5014
|
className: "app-nav-icon",
|
|
@@ -4537,7 +5042,7 @@ function Et({ item: r, linkComponent: i, onNavigate: a }) {
|
|
|
4537
5042
|
}
|
|
4538
5043
|
//#endregion
|
|
4539
5044
|
//#region src/components/AppSidebarMenu.jsx
|
|
4540
|
-
var
|
|
5045
|
+
var zt = {
|
|
4541
5046
|
left: "start",
|
|
4542
5047
|
right: "end",
|
|
4543
5048
|
start: "start",
|
|
@@ -4545,11 +5050,11 @@ var Dt = {
|
|
|
4545
5050
|
top: "top",
|
|
4546
5051
|
bottom: "bottom"
|
|
4547
5052
|
};
|
|
4548
|
-
function
|
|
5053
|
+
function Bt({ show: e, onHide: r, side: i = "right", title: a, titleIcon: o, header: s, children: c, footer: l, width: u, backdrop: d = !0, scroll: f = !1, keyboard: p = !0, closeButton: m = !0, responsive: h, className: g = "", bodyClassName: _ = "", ariaLabel: v, ...b }) {
|
|
4549
5054
|
return T("AppSidebarMenu", b), /* @__PURE__ */ n(y, {
|
|
4550
5055
|
show: e,
|
|
4551
5056
|
onHide: r,
|
|
4552
|
-
placement:
|
|
5057
|
+
placement: zt[i] || "end",
|
|
4553
5058
|
backdrop: d,
|
|
4554
5059
|
scroll: f,
|
|
4555
5060
|
keyboard: p,
|
|
@@ -4569,7 +5074,7 @@ function Ot({ show: e, onHide: r, side: i = "right", title: a, titleIcon: o, hea
|
|
|
4569
5074
|
size: 18
|
|
4570
5075
|
})
|
|
4571
5076
|
}), a]
|
|
4572
|
-
}), m && /* @__PURE__ */ t(
|
|
5077
|
+
}), m && /* @__PURE__ */ t(Q, {
|
|
4573
5078
|
variant: "ghost",
|
|
4574
5079
|
className: "btn-icon",
|
|
4575
5080
|
onClick: r,
|
|
@@ -4593,7 +5098,7 @@ function Ot({ show: e, onHide: r, side: i = "right", title: a, titleIcon: o, hea
|
|
|
4593
5098
|
}
|
|
4594
5099
|
//#endregion
|
|
4595
5100
|
//#region src/components/AppSpinner.jsx
|
|
4596
|
-
function
|
|
5101
|
+
function Vt({ size: e = "md", label: n = "Loading", className: r = "", ...i }) {
|
|
4597
5102
|
return T("AppSpinner", i), /* @__PURE__ */ t("span", {
|
|
4598
5103
|
className: `spinner-border${e === "sm" ? " spinner-border-sm" : ""}${r ? ` ${r}` : ""}`,
|
|
4599
5104
|
role: "status",
|
|
@@ -4602,7 +5107,7 @@ function kt({ size: e = "md", label: n = "Loading", className: r = "", ...i }) {
|
|
|
4602
5107
|
}
|
|
4603
5108
|
//#endregion
|
|
4604
5109
|
//#region src/components/AppSplash.jsx
|
|
4605
|
-
function
|
|
5110
|
+
function Ht({ logo: e, initials: r, text: i, label: a = "Loading", className: o = "", ...s }) {
|
|
4606
5111
|
return T("AppSplash", s), /* @__PURE__ */ t("div", {
|
|
4607
5112
|
className: `splash${o ? ` ${o}` : ""}`,
|
|
4608
5113
|
role: "status",
|
|
@@ -4629,7 +5134,7 @@ function At({ logo: e, initials: r, text: i, label: a = "Loading", className: o
|
|
|
4629
5134
|
}
|
|
4630
5135
|
//#endregion
|
|
4631
5136
|
//#region src/components/AppStatusBadge.jsx
|
|
4632
|
-
function
|
|
5137
|
+
function Ut({ label: e, tone: n = "neutral", className: r = "", ...i }) {
|
|
4633
5138
|
return T("AppStatusBadge", i), e == null || e === "" ? "—" : /* @__PURE__ */ t("span", {
|
|
4634
5139
|
className: `status-label ${n}${r ? ` ${r}` : ""}`,
|
|
4635
5140
|
children: e
|
|
@@ -4637,7 +5142,7 @@ function jt({ label: e, tone: n = "neutral", className: r = "", ...i }) {
|
|
|
4637
5142
|
}
|
|
4638
5143
|
//#endregion
|
|
4639
5144
|
//#region src/components/AppStepper.jsx
|
|
4640
|
-
function
|
|
5145
|
+
function Wt({ steps: r = [], variant: i = "steps", label: a = "Progress", linkComponent: o, className: s = "", ...c }) {
|
|
4641
5146
|
return T("AppStepper", c), /* @__PURE__ */ t("nav", {
|
|
4642
5147
|
className: [i === "journey" ? "stepper stepper-journey" : "stepper", s].filter(Boolean).join(" "),
|
|
4643
5148
|
"aria-label": a,
|
|
@@ -4684,7 +5189,7 @@ function Mt({ steps: r = [], variant: i = "steps", label: a = "Progress", linkCo
|
|
|
4684
5189
|
}
|
|
4685
5190
|
//#endregion
|
|
4686
5191
|
//#region src/components/AppSwitch.jsx
|
|
4687
|
-
var
|
|
5192
|
+
var Gt = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
4688
5193
|
T("AppSwitch", s);
|
|
4689
5194
|
let l = o(), u = r || i || l;
|
|
4690
5195
|
return /* @__PURE__ */ n("div", {
|
|
@@ -4705,7 +5210,7 @@ var Nt = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
|
4705
5210
|
});
|
|
4706
5211
|
//#endregion
|
|
4707
5212
|
//#region src/components/AppTableEmptyState.jsx
|
|
4708
|
-
function
|
|
5213
|
+
function Kt({ icon: e, title: r, text: i, action: a, ...o }) {
|
|
4709
5214
|
return T("AppTableEmptyState", o), /* @__PURE__ */ n("div", {
|
|
4710
5215
|
className: "tbl-empty",
|
|
4711
5216
|
children: [
|
|
@@ -4733,7 +5238,7 @@ function Pt({ icon: e, title: r, text: i, action: a, ...o }) {
|
|
|
4733
5238
|
}
|
|
4734
5239
|
//#endregion
|
|
4735
5240
|
//#region src/components/AppTabs.jsx
|
|
4736
|
-
function
|
|
5241
|
+
function qt({ tabs: e, value: r, onChange: i, variant: a = "underline", ariaLabel: o, className: s = "", ...l }) {
|
|
4737
5242
|
T("AppTabs", l);
|
|
4738
5243
|
let u = c(null);
|
|
4739
5244
|
function d(t) {
|
|
@@ -4777,7 +5282,7 @@ function Ft({ tabs: e, value: r, onChange: i, variant: a = "underline", ariaLabe
|
|
|
4777
5282
|
}
|
|
4778
5283
|
//#endregion
|
|
4779
5284
|
//#region src/components/AppTextarea.jsx
|
|
4780
|
-
var
|
|
5285
|
+
var Jt = r(function({ label: e, required: r = !1, error: a, hint: o, help: l, helpLabel: u = "More information", id: d, name: f, rows: p = 4, autoGrow: h = !1, className: g = "", fieldClassName: _ = "", ...v }, y) {
|
|
4781
5286
|
T("AppTextarea", v);
|
|
4782
5287
|
let b = d || f, x = [
|
|
4783
5288
|
"textarea",
|
|
@@ -4808,8 +5313,8 @@ var It = r(function({ label: e, required: r = !1, error: a, hint: o, help: l, he
|
|
|
4808
5313
|
htmlFor: b,
|
|
4809
5314
|
children: [
|
|
4810
5315
|
e,
|
|
4811
|
-
r && /* @__PURE__ */ t(
|
|
4812
|
-
l && /* @__PURE__ */ t(
|
|
5316
|
+
r && /* @__PURE__ */ t(Z, {}),
|
|
5317
|
+
l && /* @__PURE__ */ t(Xe, {
|
|
4813
5318
|
label: u,
|
|
4814
5319
|
children: l
|
|
4815
5320
|
})
|
|
@@ -4839,7 +5344,7 @@ var It = r(function({ label: e, required: r = !1, error: a, hint: o, help: l, he
|
|
|
4839
5344
|
});
|
|
4840
5345
|
//#endregion
|
|
4841
5346
|
//#region src/components/AppTimeline.jsx
|
|
4842
|
-
function
|
|
5347
|
+
function Yt({ items: e = [], className: r = "", ...i }) {
|
|
4843
5348
|
return T("AppTimeline", i), /* @__PURE__ */ t("ol", {
|
|
4844
5349
|
className: `timeline${r ? ` ${r}` : ""}`,
|
|
4845
5350
|
children: e.map((e, r) => /* @__PURE__ */ n("li", {
|
|
@@ -4877,4 +5382,4 @@ function Lt({ items: e = [], className: r = "", ...i }) {
|
|
|
4877
5382
|
});
|
|
4878
5383
|
}
|
|
4879
5384
|
//#endregion
|
|
4880
|
-
export { k as ActionIcon, A as AppAccordion, j as AppAlert,
|
|
5385
|
+
export { k as ActionIcon, A as AppAccordion, j as AppAlert, Ie as AppAutocomplete, Re as AppAvatar, ze as AppBadge, Q as AppButton, He as AppCallout, Ue as AppCard, We as AppCheckbox, Ge as AppChip, Ke as AppChoiceCard, qe as AppChoiceChip, Je as AppColorField, Ye as AppCompareTable, tt as AppConfirmDialog, dt as AppDataTable, ft as AppDatePicker, pt as AppDateRangePicker, ht as AppDropdown, gt as AppEmptyState, _t as AppFileAttachment, xt as AppFilePicker, St as AppInfoList, Xe as AppInfoTip, Ze as AppInput, Ct as AppKpiTile, wt as AppLogoPicker, $e as AppModal, Tt as AppMultiSelect, Et as AppOtpInput, Dt as AppPageHeader, Ot as AppPhoneNumberInput, kt as AppPricingCard, At as AppRadio, jt as AppRepeater, Mt as AppResourceCard, Nt as AppSearch, Pt as AppSegmented, It as AppSelect, ot as AppSelectMini, Lt as AppShell, Bt as AppSidebarMenu, nt as AppSkeleton, at as AppSkeletonRows, Vt as AppSpinner, Ht as AppSplash, Ut as AppStatusBadge, Wt as AppStepper, Gt as AppSwitch, Kt as AppTableEmptyState, ct as AppTablePagination, qt as AppTabs, Jt as AppTextarea, Yt as AppTimeline, O as Icon, et as MODAL_ICONS, Z as RequiredMark, bt as errorToast, D as iconNames, yt as toast };
|