@webority/ui-react 0.6.10 → 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/types/components/AppAutocomplete.d.ts +3 -1
- package/dist/types/components/AppDatePicker.d.ts +5 -1
- package/dist/types/components/AppDateRangePicker.d.ts +53 -0
- package/dist/types/components/AppMultiSelect.d.ts +8 -1
- package/dist/types/components/AppSearch.d.ts +8 -2
- package/dist/types/components/AppSegmented.d.ts +9 -4
- package/dist/types/components/AppSelect.d.ts +2 -1
- package/dist/types/components/AppSelectMini.d.ts +4 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/ui-react.js +952 -376
- package/package.json +3 -3
package/dist/ui-react.js
CHANGED
|
@@ -281,18 +281,32 @@ function F(e, t, n = {}) {
|
|
|
281
281
|
let s = t.offsetWidth, c = Math.min(r.left, window.innerWidth - s - P);
|
|
282
282
|
t.style.left = `${Math.max(P, c)}px`;
|
|
283
283
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
284
|
+
function I(e, t) {
|
|
285
|
+
L(e), e._reanchor = t, window.addEventListener("resize", e._reanchor), window.addEventListener("scroll", e._reanchor, !0);
|
|
286
|
+
}
|
|
287
|
+
function L(e) {
|
|
288
|
+
e?._reanchor && (window.removeEventListener("resize", e._reanchor), window.removeEventListener("scroll", e._reanchor, !0), e._reanchor = null);
|
|
289
|
+
}
|
|
290
|
+
var R = "data-wui-mirror";
|
|
291
|
+
function z(e, t) {
|
|
292
|
+
let n = e.getAttribute("name"), r = e.querySelector(`:scope > input[${R}]`);
|
|
287
293
|
if (!n) {
|
|
288
294
|
r?.remove();
|
|
289
295
|
return;
|
|
290
296
|
}
|
|
291
|
-
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);
|
|
292
298
|
for (let t of e.attributes) t.name.startsWith("data-val") && r.setAttribute(t.name, t.value);
|
|
293
299
|
r.disabled = e.hasAttribute("disabled");
|
|
294
300
|
}
|
|
295
|
-
var
|
|
301
|
+
var B = Symbol("wui.trustedHtml"), V = (e) => String(e ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), ee = (e) => {
|
|
302
|
+
if (!e) return "";
|
|
303
|
+
let t = String(e).toLowerCase().replace(/[^a-z0-9-]/g, "");
|
|
304
|
+
return t ? `<i class="bi bi-${t}" aria-hidden="true"></i>` : "";
|
|
305
|
+
}, H = (e) => {
|
|
306
|
+
if (e == null) return "";
|
|
307
|
+
let t = e[B] ? String(e.label ?? "") : V(e.label), n = ee(e.icon);
|
|
308
|
+
return n ? `<span class="wui-opt-label">${n}${t}</span>` : t;
|
|
309
|
+
}, te = class extends HTMLElement {
|
|
296
310
|
_accessibleName() {
|
|
297
311
|
return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Select";
|
|
298
312
|
}
|
|
@@ -304,6 +318,7 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
304
318
|
"min-chars",
|
|
305
319
|
"debounce",
|
|
306
320
|
"remote",
|
|
321
|
+
"size",
|
|
307
322
|
"aria-label"
|
|
308
323
|
];
|
|
309
324
|
}
|
|
@@ -320,9 +335,9 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
320
335
|
return this._value;
|
|
321
336
|
}
|
|
322
337
|
set value(e) {
|
|
323
|
-
this._value = e == null ? "" : String(e),
|
|
338
|
+
this._value = e == null ? "" : String(e), z(this, this._value);
|
|
324
339
|
let t = this._readOptions().find((e) => String(e.value) === this._value);
|
|
325
|
-
t && (this._label =
|
|
340
|
+
t && (this._label = re(t.label)), this._syncInput();
|
|
326
341
|
}
|
|
327
342
|
set options(e) {
|
|
328
343
|
this._optionsProp = Array.isArray(e) ? e : [], this._renderOptions();
|
|
@@ -352,7 +367,8 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
352
367
|
e.length && (this._declared = e.map((e) => ({
|
|
353
368
|
value: e.getAttribute("value") ?? e.textContent.trim(),
|
|
354
369
|
label: e.innerHTML,
|
|
355
|
-
|
|
370
|
+
icon: e.getAttribute("icon") || void 0,
|
|
371
|
+
[B]: !0,
|
|
356
372
|
selected: e.hasAttribute("selected")
|
|
357
373
|
})));
|
|
358
374
|
}
|
|
@@ -361,11 +377,11 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
361
377
|
}
|
|
362
378
|
render() {
|
|
363
379
|
this._snapshotDeclared();
|
|
364
|
-
let e = this.getAttribute("placeholder") || "Search…";
|
|
380
|
+
let e = this.getAttribute("placeholder") || "Search…", t = this.getAttribute("size"), n = t === "sm" ? " search-select-sm" : t === "lg" ? " search-select-lg" : "";
|
|
365
381
|
this.innerHTML = `
|
|
366
|
-
<div class="search-select">
|
|
367
|
-
<div class="input search-select-control search-select-ac" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-label="${
|
|
368
|
-
<input class="search-select-input search-select-ac-input" placeholder="${
|
|
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="${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" : ""} />
|
|
369
385
|
<span class="search-select-spinner spinner-border spinner-border-sm" role="status" aria-hidden="true" hidden></span>
|
|
370
386
|
<button type="button" class="search-select-clear" aria-label="Clear" hidden><i class="bi bi-x" aria-hidden="true"></i></button>
|
|
371
387
|
</div>
|
|
@@ -374,7 +390,7 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
374
390
|
<div class="search-select-empty" hidden>No matches</div>
|
|
375
391
|
<div class="search-select-hint" hidden>Type to search…</div>
|
|
376
392
|
</div>
|
|
377
|
-
</div>`, this._rendered = !0,
|
|
393
|
+
</div>`, this._rendered = !0, z(this, this._value), this._wire(), this._syncInput(), this._renderOptions();
|
|
378
394
|
}
|
|
379
395
|
_refs() {
|
|
380
396
|
return {
|
|
@@ -403,9 +419,9 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
403
419
|
let t = this._refs();
|
|
404
420
|
if (!t.optionsWrap) return;
|
|
405
421
|
let n = (e ?? (t.input ? t.input.value : "")).trim().toLowerCase(), r = this._readOptions();
|
|
406
|
-
!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) => {
|
|
407
423
|
let t = String(e.value) === String(this._value);
|
|
408
|
-
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>`;
|
|
409
425
|
}).join(""), this._active = -1;
|
|
410
426
|
let i = n.length < this._minChars;
|
|
411
427
|
t.hint && (t.hint.hidden = !(this._remote && i && !r.length)), t.empty && (t.empty.hidden = this._loading || r.length > 0 || this._remote && i);
|
|
@@ -423,7 +439,7 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
423
439
|
}, o = () => {
|
|
424
440
|
e.menu.hidden = !0, e.control.setAttribute("aria-expanded", "false"), e.control.classList.remove("open"), r(-1), this._syncInput();
|
|
425
441
|
}, s = (t) => {
|
|
426
|
-
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();
|
|
427
443
|
};
|
|
428
444
|
e.input.addEventListener("focus", () => a()), e.input.addEventListener("input", () => {
|
|
429
445
|
let t = e.input.value;
|
|
@@ -445,18 +461,18 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
445
461
|
}), e.optionsWrap.addEventListener("mousemove", (e) => {
|
|
446
462
|
let t = e.target.closest(".search-select-option");
|
|
447
463
|
t && r(this._optionEls().indexOf(t));
|
|
448
|
-
}), e.clear?.addEventListener("click", () => {
|
|
449
|
-
this._value = "", this._label = "",
|
|
464
|
+
}), e.optionsWrap.addEventListener("mouseleave", () => r(-1)), e.clear?.addEventListener("click", () => {
|
|
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();
|
|
450
466
|
}), this._onDocClick = (e) => {
|
|
451
467
|
i() && !this.contains(e.target) && o();
|
|
452
|
-
}, document.addEventListener("click", this._onDocClick),
|
|
468
|
+
}, document.addEventListener("click", this._onDocClick), I(this, () => {
|
|
453
469
|
i() && t();
|
|
454
470
|
});
|
|
455
471
|
}
|
|
456
472
|
disconnectedCallback() {
|
|
457
|
-
this._onDocClick && document.removeEventListener("click", this._onDocClick), clearTimeout(this._timer);
|
|
473
|
+
this._onDocClick && document.removeEventListener("click", this._onDocClick), L(this), clearTimeout(this._timer);
|
|
458
474
|
}
|
|
459
|
-
},
|
|
475
|
+
}, ne = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), re = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), ie = [
|
|
460
476
|
"January",
|
|
461
477
|
"February",
|
|
462
478
|
"March",
|
|
@@ -469,7 +485,7 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
469
485
|
"October",
|
|
470
486
|
"November",
|
|
471
487
|
"December"
|
|
472
|
-
],
|
|
488
|
+
], ae = [
|
|
473
489
|
"Su",
|
|
474
490
|
"Mo",
|
|
475
491
|
"Tu",
|
|
@@ -477,121 +493,532 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
477
493
|
"Th",
|
|
478
494
|
"Fr",
|
|
479
495
|
"Sa"
|
|
480
|
-
],
|
|
496
|
+
], U = (e) => String(e).padStart(2, "0"), W = (e, t, n) => `${e}-${U(t + 1)}-${U(n)}`, G = (e) => {
|
|
481
497
|
let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e || "");
|
|
482
498
|
return t ? {
|
|
483
499
|
y: +t[1],
|
|
484
500
|
m: t[2] - 1,
|
|
485
501
|
d: +t[3]
|
|
486
502
|
} : null;
|
|
487
|
-
},
|
|
503
|
+
}, oe = (e) => {
|
|
488
504
|
let t = G(e);
|
|
489
|
-
return t ? `${
|
|
490
|
-
}, q =
|
|
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 {
|
|
491
514
|
static get observedAttributes() {
|
|
492
515
|
return [
|
|
493
516
|
"value",
|
|
494
517
|
"min",
|
|
495
518
|
"max",
|
|
496
519
|
"placeholder",
|
|
497
|
-
"disabled"
|
|
520
|
+
"disabled",
|
|
521
|
+
"first-day",
|
|
522
|
+
"size"
|
|
498
523
|
];
|
|
499
524
|
}
|
|
500
525
|
constructor() {
|
|
501
526
|
super(), this._value = "";
|
|
502
527
|
let e = new Date(2e3, 0, 1);
|
|
503
|
-
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 = "";
|
|
504
529
|
}
|
|
505
530
|
connectedCallback() {
|
|
506
531
|
this._rendered || this.render();
|
|
507
532
|
}
|
|
508
533
|
attributeChangedCallback(e, t, n) {
|
|
509
|
-
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());
|
|
510
535
|
}
|
|
511
536
|
get value() {
|
|
512
537
|
return this._value;
|
|
513
538
|
}
|
|
514
539
|
set value(e) {
|
|
515
|
-
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;
|
|
516
545
|
}
|
|
517
546
|
render() {
|
|
518
547
|
this._value = this.getAttribute("value") || this._value;
|
|
519
548
|
let e = this.getAttribute("placeholder") || "Enter Date", t = G(this._value);
|
|
520
|
-
t && (this._viewY = t.y, this._viewM = t.m)
|
|
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 = `
|
|
521
552
|
<div class="datepicker">
|
|
522
|
-
<button type="button" class="input datepicker-trigger" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}>
|
|
523
|
-
<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>
|
|
524
555
|
<i class="bi bi-calendar3" aria-hidden="true"></i>
|
|
525
556
|
</button>
|
|
526
|
-
<div class="datepicker-pop" role="dialog" hidden></div>
|
|
527
|
-
</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();
|
|
528
559
|
}
|
|
529
560
|
_syncFormValue() {
|
|
530
|
-
|
|
561
|
+
z(this, this._value);
|
|
531
562
|
}
|
|
532
563
|
_syncTrigger() {
|
|
533
|
-
let e = this.querySelector("[data-trigger-label]");
|
|
534
|
-
if (!
|
|
535
|
-
let
|
|
536
|
-
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
let e = this.
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
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 `
|
|
549
610
|
<div class="datepicker-head">
|
|
550
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>
|
|
551
|
-
<
|
|
612
|
+
<button type="button" class="datepicker-month" data-view="months" aria-label="Choose month and year">${ie[this._viewM]} ${this._viewY}</button>
|
|
552
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>
|
|
553
614
|
</div>
|
|
554
|
-
<div class="datepicker-weekdays">${
|
|
555
|
-
<div class="datepicker-grid">${
|
|
556
|
-
<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();
|
|
557
661
|
}
|
|
558
662
|
_position(e, t) {
|
|
559
663
|
F(e, t);
|
|
560
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
|
+
}
|
|
561
714
|
_wire() {
|
|
562
|
-
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");
|
|
563
716
|
if (!e || !t) return;
|
|
564
|
-
let
|
|
717
|
+
let r = () => !t.hidden;
|
|
718
|
+
this._open = () => {
|
|
565
719
|
if (!G(this._value) && !this._viewNavigated) {
|
|
566
720
|
let e = /* @__PURE__ */ new Date();
|
|
567
721
|
this._viewY = e.getFullYear(), this._viewM = e.getMonth();
|
|
568
722
|
}
|
|
569
|
-
this.
|
|
570
|
-
|
|
571
|
-
|
|
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
|
|
572
879
|
};
|
|
573
|
-
|
|
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;
|
|
915
|
+
};
|
|
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;
|
|
574
994
|
let t = e.target.closest("[data-nav]");
|
|
575
995
|
if (t) {
|
|
576
|
-
|
|
996
|
+
let e = me(this._viewY, this._viewM + Number(t.dataset.nav));
|
|
997
|
+
this._viewY = e.y, this._viewM = e.m, this._renderView();
|
|
577
998
|
return;
|
|
578
999
|
}
|
|
579
1000
|
if (e.target.closest("[data-clear]")) {
|
|
580
|
-
this.
|
|
1001
|
+
this._start = "", this._end = "", this._hover = "", this._syncTrigger(), this._syncMirrors(), this._renderView(), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
581
1002
|
return;
|
|
582
1003
|
}
|
|
583
1004
|
let n = e.target.closest(".datepicker-day[data-iso]");
|
|
584
|
-
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());
|
|
585
1009
|
}), this._onDocClick = (e) => {
|
|
586
|
-
|
|
1010
|
+
let t = this._popClick;
|
|
1011
|
+
this._popClick = !1, r() && !t && !this.contains(e.target) && this._close();
|
|
587
1012
|
}, document.addEventListener("click", this._onDocClick), this._onDocKey = (e) => {
|
|
588
|
-
|
|
589
|
-
}, document.addEventListener("keydown", this._onDocKey), this
|
|
1013
|
+
r() && e.key === "Escape" && this._close();
|
|
1014
|
+
}, document.addEventListener("keydown", this._onDocKey), I(this, () => {
|
|
1015
|
+
r() && this._position(e, t);
|
|
1016
|
+
}), this._syncMirrors();
|
|
590
1017
|
}
|
|
591
1018
|
disconnectedCallback() {
|
|
592
|
-
this._onDocClick && document.removeEventListener("click", this._onDocClick), this._onDocKey && document.removeEventListener("keydown", this._onDocKey);
|
|
1019
|
+
this._onDocClick && document.removeEventListener("click", this._onDocClick), this._onDocKey && document.removeEventListener("keydown", this._onDocKey), L(this);
|
|
593
1020
|
}
|
|
594
|
-
},
|
|
1021
|
+
}, ge = class extends HTMLElement {
|
|
595
1022
|
_accessibleName() {
|
|
596
1023
|
return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Select";
|
|
597
1024
|
}
|
|
@@ -601,6 +1028,9 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
601
1028
|
"search-placeholder",
|
|
602
1029
|
"searchable",
|
|
603
1030
|
"disabled",
|
|
1031
|
+
"icon",
|
|
1032
|
+
"size",
|
|
1033
|
+
"collapse-chips",
|
|
604
1034
|
"aria-label"
|
|
605
1035
|
];
|
|
606
1036
|
}
|
|
@@ -623,7 +1053,7 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
623
1053
|
return this._values.slice();
|
|
624
1054
|
}
|
|
625
1055
|
set values(e) {
|
|
626
|
-
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();
|
|
627
1057
|
}
|
|
628
1058
|
set options(e) {
|
|
629
1059
|
this._optionsProp = Array.isArray(e) ? e : null, this.isConnected && this.render();
|
|
@@ -637,7 +1067,8 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
637
1067
|
e.length && (this._declared = e.map((e) => ({
|
|
638
1068
|
value: e.getAttribute("value") ?? e.textContent.trim(),
|
|
639
1069
|
label: e.innerHTML,
|
|
640
|
-
|
|
1070
|
+
icon: e.getAttribute("icon") || void 0,
|
|
1071
|
+
[B]: !0,
|
|
641
1072
|
selected: e.hasAttribute("selected")
|
|
642
1073
|
})));
|
|
643
1074
|
}
|
|
@@ -650,47 +1081,68 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
650
1081
|
}
|
|
651
1082
|
_labelHtmlFor(e) {
|
|
652
1083
|
let t = this._readOptions().find((t) => String(t.value) === String(e));
|
|
653
|
-
return t ?
|
|
1084
|
+
return t ? H(t) : V(e);
|
|
654
1085
|
}
|
|
655
1086
|
render() {
|
|
656
1087
|
this._snapshotDeclared();
|
|
657
|
-
let e = this.hasAttribute("searchable"), t = this.getAttribute("search-placeholder") || "Search…";
|
|
658
|
-
|
|
659
|
-
<div class="search-select">
|
|
660
|
-
<div class="input search-select-control search-select-multi" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-label="${
|
|
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" : "";
|
|
1089
|
+
z(this, this._values.join(",")), this.innerHTML = `
|
|
1090
|
+
<div class="search-select${i}">
|
|
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>` : ""}
|
|
661
1093
|
<div class="ms-chips" data-chips></div>
|
|
662
1094
|
<i class="bi bi-chevron-down search-select-caret" aria-hidden="true"></i>
|
|
663
1095
|
</div>
|
|
664
1096
|
<div class="search-select-menu search-select-menu-fixed" role="listbox" aria-multiselectable="true" tabindex="-1" hidden>
|
|
665
|
-
${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>` : ""}
|
|
666
1098
|
<div class="search-select-options"></div>
|
|
667
1099
|
<div class="search-select-empty" hidden>No matches</div>
|
|
668
1100
|
</div>
|
|
669
|
-
</div>`, this._rendered = !0,
|
|
1101
|
+
</div>`, this._rendered = !0, z(this, this._values.join(",")), this._renderControl(), this._renderOptions(), this._wire();
|
|
670
1102
|
}
|
|
671
1103
|
_renderControl() {
|
|
672
1104
|
let e = this.querySelector("[data-chips]");
|
|
673
1105
|
if (!e) return;
|
|
674
1106
|
let t = this.getAttribute("placeholder") || "Select…";
|
|
675
1107
|
if (!this._values.length) {
|
|
676
|
-
e.innerHTML = `<span class="search-select-placeholder">${
|
|
1108
|
+
e.innerHTML = `<span class="search-select-placeholder">${V(t)}</span>`;
|
|
677
1109
|
return;
|
|
678
1110
|
}
|
|
679
|
-
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();
|
|
1112
|
+
}
|
|
1113
|
+
_collapseChips() {
|
|
1114
|
+
let e = this.querySelector("[data-chips]");
|
|
1115
|
+
if (!e || !this.hasAttribute("collapse-chips") || !this._values.length) return;
|
|
1116
|
+
e.querySelector(".chip-more")?.remove();
|
|
1117
|
+
let t = [...e.querySelectorAll(":scope > .chip:not(.chip-more)")];
|
|
1118
|
+
for (let e of t) e.style.display = "";
|
|
1119
|
+
if (!t.length) return;
|
|
1120
|
+
let n = e.clientWidth, r = (e) => e.offsetLeft + e.offsetWidth;
|
|
1121
|
+
if (r(t[t.length - 1]) <= n) return;
|
|
1122
|
+
let i = document.createElement("span");
|
|
1123
|
+
i.className = "chip chip-sm chip-more", i.textContent = `+${t.length}`, e.appendChild(i);
|
|
1124
|
+
let a = i.offsetWidth + 6, o = 0;
|
|
1125
|
+
for (let e of t) if (r(e) <= n - a) o += 1;
|
|
1126
|
+
else break;
|
|
1127
|
+
o < 1 && (o = 1);
|
|
1128
|
+
for (let e = o; e < t.length; e += 1) t[e].style.display = "none";
|
|
1129
|
+
i.textContent = `+${t.length - o}`;
|
|
680
1130
|
}
|
|
681
1131
|
_renderOptions(e) {
|
|
682
1132
|
let t = this.querySelector(".search-select-options"), n = this.querySelector(".search-select-empty");
|
|
683
1133
|
if (!t) return;
|
|
684
1134
|
let r = (e || "").trim().toLowerCase(), i = this._readOptions();
|
|
685
|
-
r && (i = i.filter((e) =>
|
|
1135
|
+
r && (i = i.filter((e) => _e(e.label).toLowerCase().includes(r))), t.innerHTML = i.map((e) => {
|
|
686
1136
|
let t = this._values.includes(String(e.value));
|
|
687
|
-
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>`;
|
|
688
1138
|
}).join(""), n && (n.hidden = i.length > 0), this._active = -1;
|
|
689
1139
|
}
|
|
690
1140
|
_wire() {
|
|
691
1141
|
let e = this.querySelector(".search-select-control"), t = this.querySelector(".search-select-menu"), n = this.querySelector(".search-select-input"), r = this.querySelector(".search-select-clear"), i = this.querySelector(".search-select-options");
|
|
692
1142
|
if (!e || !t) return;
|
|
693
|
-
let a = () => this.hasAttribute("disabled")
|
|
1143
|
+
let a = () => this.hasAttribute("disabled");
|
|
1144
|
+
!this._ro && typeof ResizeObserver < "u" && (this._ro = new ResizeObserver(() => this._collapseChips()), this._ro.observe(this));
|
|
1145
|
+
let o = () => F(e, t, { matchWidth: !0 }), s = () => [...this.querySelectorAll(".search-select-option")], c = () => s().filter((e) => !e.hidden), l = (e) => {
|
|
694
1146
|
let t = c();
|
|
695
1147
|
this._active = e;
|
|
696
1148
|
for (let e of s()) e.classList.remove("is-active");
|
|
@@ -700,7 +1152,7 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
700
1152
|
}, f = () => {
|
|
701
1153
|
t.hidden = !0, e.setAttribute("aria-expanded", "false"), e.classList.remove("open"), l(-1);
|
|
702
1154
|
}, p = () => {
|
|
703
|
-
|
|
1155
|
+
z(this, this._values.join(",")), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
704
1156
|
}, m = (e) => {
|
|
705
1157
|
let t = String(e);
|
|
706
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();
|
|
@@ -720,7 +1172,7 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
720
1172
|
}), i.addEventListener("mousemove", (e) => {
|
|
721
1173
|
let t = e.target.closest(".search-select-option");
|
|
722
1174
|
t && l(c().indexOf(t));
|
|
723
|
-
}), n?.addEventListener("input", () => {
|
|
1175
|
+
}), i.addEventListener("mouseleave", () => l(-1)), n?.addEventListener("input", () => {
|
|
724
1176
|
this._renderOptions(n.value), r && (r.hidden = !n.value), l(-1);
|
|
725
1177
|
});
|
|
726
1178
|
let g = (t) => {
|
|
@@ -737,14 +1189,14 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
737
1189
|
(e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") && (e.preventDefault(), d());
|
|
738
1190
|
}), this._onDocClick = (e) => {
|
|
739
1191
|
u() && !this.contains(e.target) && f();
|
|
740
|
-
}, document.addEventListener("click", this._onDocClick),
|
|
1192
|
+
}, document.addEventListener("click", this._onDocClick), I(this, () => {
|
|
741
1193
|
u() && o();
|
|
742
1194
|
});
|
|
743
1195
|
}
|
|
744
1196
|
disconnectedCallback() {
|
|
745
|
-
this._onDocClick && document.removeEventListener("click", this._onDocClick);
|
|
1197
|
+
this._onDocClick && document.removeEventListener("click", this._onDocClick), L(this), this._ro?.disconnect(), this._ro = null;
|
|
746
1198
|
}
|
|
747
|
-
},
|
|
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 {
|
|
748
1200
|
static get observedAttributes() {
|
|
749
1201
|
return [
|
|
750
1202
|
"value",
|
|
@@ -771,16 +1223,16 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
771
1223
|
return this._value ?? "";
|
|
772
1224
|
}
|
|
773
1225
|
set value(e) {
|
|
774
|
-
this._value = this._clean(e),
|
|
1226
|
+
this._value = this._clean(e), z(this, this._value), this._paint();
|
|
775
1227
|
}
|
|
776
1228
|
_clean(e) {
|
|
777
|
-
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);
|
|
778
1230
|
}
|
|
779
1231
|
connectedCallback() {
|
|
780
1232
|
this._rendered || this.render();
|
|
781
1233
|
}
|
|
782
1234
|
attributeChangedCallback(e, t, n) {
|
|
783
|
-
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());
|
|
784
1236
|
}
|
|
785
1237
|
render() {
|
|
786
1238
|
this._value = this._clean(this.getAttribute("value") ?? this._value);
|
|
@@ -798,7 +1250,7 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
798
1250
|
spellcheck="false"
|
|
799
1251
|
${n ? "disabled" : ""} />
|
|
800
1252
|
<div class="otp-slots" aria-hidden="true">${r}</div>
|
|
801
|
-
</div>`, this._rendered = !0,
|
|
1253
|
+
</div>`, this._rendered = !0, z(this, this._value), this._wire(), this._paint();
|
|
802
1254
|
}
|
|
803
1255
|
_refs() {
|
|
804
1256
|
return {
|
|
@@ -820,7 +1272,7 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
820
1272
|
if (!e) return;
|
|
821
1273
|
let t = (e) => {
|
|
822
1274
|
let t = this._clean(e), n = t !== this._value;
|
|
823
|
-
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", {
|
|
824
1276
|
bubbles: !0,
|
|
825
1277
|
detail: t
|
|
826
1278
|
}));
|
|
@@ -840,7 +1292,7 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
840
1292
|
document.activeElement === e && this._paint();
|
|
841
1293
|
});
|
|
842
1294
|
}
|
|
843
|
-
},
|
|
1295
|
+
}, xe = [
|
|
844
1296
|
[
|
|
845
1297
|
"AF",
|
|
846
1298
|
"Afghanistan",
|
|
@@ -2066,11 +2518,11 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2066
2518
|
"Zimbabwe",
|
|
2067
2519
|
"263"
|
|
2068
2520
|
]
|
|
2069
|
-
],
|
|
2521
|
+
], Se = (e) => (xe.find((t) => t[0] === e) || [
|
|
2070
2522
|
"",
|
|
2071
2523
|
"",
|
|
2072
2524
|
""
|
|
2073
|
-
])[2],
|
|
2525
|
+
])[2], Ce = (e) => `wui-flag wui-flag-${String(e).toLowerCase()}`, we = class extends HTMLElement {
|
|
2074
2526
|
static get observedAttributes() {
|
|
2075
2527
|
return [
|
|
2076
2528
|
"value",
|
|
@@ -2089,33 +2541,33 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2089
2541
|
this._rendered && (e === "country" && (this._country = n || "IN"), this.render());
|
|
2090
2542
|
}
|
|
2091
2543
|
get value() {
|
|
2092
|
-
return `+${
|
|
2544
|
+
return `+${Se(this._country)}${this._national}`;
|
|
2093
2545
|
}
|
|
2094
2546
|
set value(e) {
|
|
2095
2547
|
this._national = String(e ?? "").replace(/[^0-9]/g, ""), this._commit();
|
|
2096
2548
|
}
|
|
2097
2549
|
_commit() {
|
|
2098
|
-
|
|
2550
|
+
z(this, this.value), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2099
2551
|
}
|
|
2100
2552
|
render() {
|
|
2101
2553
|
let e = this.getAttribute("placeholder") || "Enter phone number";
|
|
2102
2554
|
this._country = this.getAttribute("country") || this._country;
|
|
2103
|
-
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("");
|
|
2104
2556
|
this.innerHTML = `
|
|
2105
2557
|
<div class="phone-input-wrap">
|
|
2106
2558
|
<div class="phone-country-adornment">
|
|
2107
2559
|
<button type="button" class="country-toggle" aria-haspopup="listbox" aria-expanded="false"${this.hasAttribute("disabled") ? " disabled" : ""}>
|
|
2108
|
-
<span class="${
|
|
2560
|
+
<span class="${Ce(this._country)}" data-flag aria-hidden="true"></span>
|
|
2109
2561
|
<i class="bi bi-chevron-down phone-chevron" aria-hidden="true"></i>
|
|
2110
|
-
<span class="phone-dial" data-dial>+${
|
|
2562
|
+
<span class="phone-dial" data-dial>+${Se(this._country)}</span>
|
|
2111
2563
|
</button>
|
|
2112
2564
|
<div class="country-dropdown-menu" role="listbox" hidden>
|
|
2113
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>
|
|
2114
2566
|
<div class="country-list-scroll">${t}<div class="country-empty" hidden>No countries found</div></div>
|
|
2115
2567
|
</div>
|
|
2116
2568
|
</div>
|
|
2117
|
-
<input type="tel" class="input" placeholder="${
|
|
2118
|
-
</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();
|
|
2119
2571
|
}
|
|
2120
2572
|
_wire() {
|
|
2121
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]");
|
|
@@ -2139,7 +2591,7 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2139
2591
|
}
|
|
2140
2592
|
i && (i.hidden = n > 0);
|
|
2141
2593
|
}, p = (e) => {
|
|
2142
|
-
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)}`);
|
|
2143
2595
|
for (let t of r.querySelectorAll(".country-dropdown-item")) t.classList.toggle("selected", t.dataset.iso === e);
|
|
2144
2596
|
d(), this._commit();
|
|
2145
2597
|
};
|
|
@@ -2150,12 +2602,12 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2150
2602
|
this._national = a.value.replace(/[^0-9]/g, ""), this._commit();
|
|
2151
2603
|
}), this._onDocClick = (e) => {
|
|
2152
2604
|
c() && !this.contains(e.target) && d();
|
|
2153
|
-
}, document.addEventListener("click", this._onDocClick),
|
|
2605
|
+
}, document.addEventListener("click", this._onDocClick), z(this, this.value);
|
|
2154
2606
|
}
|
|
2155
2607
|
disconnectedCallback() {
|
|
2156
2608
|
this._reposition && (window.removeEventListener("scroll", this._reposition, !0), window.removeEventListener("resize", this._reposition)), this._onDocClick && document.removeEventListener("click", this._onDocClick);
|
|
2157
2609
|
}
|
|
2158
|
-
},
|
|
2610
|
+
}, Te = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), Ee = class extends HTMLElement {
|
|
2159
2611
|
static get observedAttributes() {
|
|
2160
2612
|
return [
|
|
2161
2613
|
"value",
|
|
@@ -2166,6 +2618,8 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2166
2618
|
"compact",
|
|
2167
2619
|
"size",
|
|
2168
2620
|
"clearable",
|
|
2621
|
+
"icon",
|
|
2622
|
+
"prefix",
|
|
2169
2623
|
"aria-label"
|
|
2170
2624
|
];
|
|
2171
2625
|
}
|
|
@@ -2185,7 +2639,7 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2185
2639
|
return this._value;
|
|
2186
2640
|
}
|
|
2187
2641
|
set value(e) {
|
|
2188
|
-
this._value = e == null ? "" : String(e),
|
|
2642
|
+
this._value = e == null ? "" : String(e), z(this, this._value), this._syncSelected(), this._syncReset();
|
|
2189
2643
|
}
|
|
2190
2644
|
set options(e) {
|
|
2191
2645
|
this._optionsProp = Array.isArray(e) ? e : null, this.isConnected && this.render();
|
|
@@ -2199,7 +2653,8 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2199
2653
|
e.length && (this._declared = e.map((e) => ({
|
|
2200
2654
|
value: e.getAttribute("value") ?? e.textContent.trim(),
|
|
2201
2655
|
label: e.innerHTML,
|
|
2202
|
-
|
|
2656
|
+
icon: e.getAttribute("icon") || void 0,
|
|
2657
|
+
[B]: !0,
|
|
2203
2658
|
selected: e.hasAttribute("selected")
|
|
2204
2659
|
})));
|
|
2205
2660
|
}
|
|
@@ -2208,24 +2663,26 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2208
2663
|
}
|
|
2209
2664
|
render() {
|
|
2210
2665
|
this._snapshotDeclared();
|
|
2211
|
-
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("placeholder") || "Select...",
|
|
2212
|
-
|
|
2213
|
-
let
|
|
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);
|
|
2667
|
+
l && (this._value = String(l.value)), z(this, this._value);
|
|
2668
|
+
let u = e.map((e) => {
|
|
2214
2669
|
let t = String(e.value) === String(this._value);
|
|
2215
|
-
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>`;
|
|
2216
2671
|
}).join("");
|
|
2217
2672
|
this.innerHTML = `
|
|
2218
2673
|
<div class="search-select${this.hasAttribute("compact") ? " search-select-compact" : ""}${i}">
|
|
2219
|
-
<button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false" aria-label="${
|
|
2220
|
-
|
|
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>
|
|
2221
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>" : ""}
|
|
2222
2679
|
<i class="bi bi-chevron-down search-select-caret" aria-hidden="true"></i>
|
|
2223
2680
|
</button>
|
|
2224
2681
|
<div class="search-select-menu search-select-menu-fixed" role="listbox" tabindex="-1" hidden>
|
|
2225
|
-
${t ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${
|
|
2226
|
-
<div class="search-select-options">${
|
|
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>` : ""}
|
|
2683
|
+
<div class="search-select-options">${u}<div class="search-select-empty" hidden>No matches</div></div>
|
|
2227
2684
|
</div>
|
|
2228
|
-
</div>`, this._rendered = !0,
|
|
2685
|
+
</div>`, this._rendered = !0, z(this, this._value), this._wire(), this._syncReset();
|
|
2229
2686
|
}
|
|
2230
2687
|
_refs() {
|
|
2231
2688
|
return {
|
|
@@ -2251,7 +2708,7 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2251
2708
|
let t = e.dataset.value === String(this._value);
|
|
2252
2709
|
e.classList.toggle("selected", t), e.setAttribute("aria-selected", String(t));
|
|
2253
2710
|
}
|
|
2254
|
-
e && (e.innerHTML = t ?
|
|
2711
|
+
e && (e.innerHTML = t ? H(t) : e.innerHTML, e.classList.toggle("search-select-placeholder", !t));
|
|
2255
2712
|
}
|
|
2256
2713
|
_syncReset() {
|
|
2257
2714
|
let { reset: e } = this._refs();
|
|
@@ -2260,7 +2717,12 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2260
2717
|
_wire() {
|
|
2261
2718
|
let e = this._refs();
|
|
2262
2719
|
if (!e.control || !e.menu) return;
|
|
2263
|
-
let t = () =>
|
|
2720
|
+
let t = () => {
|
|
2721
|
+
if (this.hasAttribute("compact")) {
|
|
2722
|
+
let t = e.control.getBoundingClientRect();
|
|
2723
|
+
e.menu.style.width = "max-content", e.menu.style.minWidth = `${t.width}px`, e.menu.style.maxWidth = "280px", F(e.control, e.menu);
|
|
2724
|
+
} else F(e.control, e.menu, { matchWidth: !0 });
|
|
2725
|
+
}, n = (e) => {
|
|
2264
2726
|
let t = this._visible();
|
|
2265
2727
|
this._active = e;
|
|
2266
2728
|
for (let e of this._optionEls()) e.classList.remove("is-active");
|
|
@@ -2302,21 +2764,21 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2302
2764
|
e.search.value = "", r(""), e.search.focus();
|
|
2303
2765
|
}), e.menu.addEventListener("keydown", c), this._onDocClick = (e) => {
|
|
2304
2766
|
i() && !this.contains(e.target) && o();
|
|
2305
|
-
}, document.addEventListener("click", this._onDocClick),
|
|
2767
|
+
}, document.addEventListener("click", this._onDocClick), I(this, () => {
|
|
2306
2768
|
i() && t();
|
|
2307
2769
|
});
|
|
2308
2770
|
}
|
|
2309
2771
|
disconnectedCallback() {
|
|
2310
|
-
this._onDocClick && document.removeEventListener("click", this._onDocClick);
|
|
2772
|
+
this._onDocClick && document.removeEventListener("click", this._onDocClick), L(this);
|
|
2311
2773
|
}
|
|
2312
|
-
},
|
|
2774
|
+
}, De = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), Oe = "image/png,image/jpeg,image/webp", ke = {
|
|
2313
2775
|
"image/png": [".png"],
|
|
2314
2776
|
"image/jpeg": [".jpg", ".jpeg"],
|
|
2315
2777
|
"image/webp": [".webp"],
|
|
2316
2778
|
"image/gif": [".gif"],
|
|
2317
2779
|
"image/svg+xml": [".svg"],
|
|
2318
2780
|
"application/pdf": [".pdf"]
|
|
2319
|
-
},
|
|
2781
|
+
}, Ae = {
|
|
2320
2782
|
"image/png": "PNG",
|
|
2321
2783
|
"image/jpeg": "JPG",
|
|
2322
2784
|
"image/webp": "WEBP",
|
|
@@ -2330,36 +2792,36 @@ var R = Symbol("wui.trustedHtml"), z = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2330
2792
|
".gif": "GIF",
|
|
2331
2793
|
".svg": "SVG",
|
|
2332
2794
|
".pdf": "PDF"
|
|
2333
|
-
},
|
|
2334
|
-
function
|
|
2795
|
+
}, je = (e) => String(e || "").split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
|
|
2796
|
+
function Me(e) {
|
|
2335
2797
|
let t = [];
|
|
2336
|
-
for (let n of
|
|
2337
|
-
let e =
|
|
2798
|
+
for (let n of je(e)) {
|
|
2799
|
+
let e = Ae[n] || (n.startsWith(".") ? n.slice(1).toUpperCase() : n.toUpperCase());
|
|
2338
2800
|
t.includes(e) || t.push(e);
|
|
2339
2801
|
}
|
|
2340
2802
|
return t.length <= 1 ? t[0] || "supported" : `${t.slice(0, -1).join(", ")} or ${t[t.length - 1]}`;
|
|
2341
2803
|
}
|
|
2342
|
-
function
|
|
2343
|
-
let n =
|
|
2804
|
+
function Ne(e, t) {
|
|
2805
|
+
let n = je(t);
|
|
2344
2806
|
if (!n.length) return !0;
|
|
2345
2807
|
let r = (e.type || "").toLowerCase(), i = (e.name || "").toLowerCase();
|
|
2346
|
-
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)));
|
|
2347
2809
|
}
|
|
2348
|
-
function
|
|
2810
|
+
function Pe(e, t = {}) {
|
|
2349
2811
|
if (!e) return null;
|
|
2350
|
-
let n = t.accept === void 0 ?
|
|
2351
|
-
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.`;
|
|
2352
2814
|
}
|
|
2353
|
-
var
|
|
2815
|
+
var X = (e, t) => {
|
|
2354
2816
|
typeof customElements < "u" && !customElements.get(e) && customElements.define(e, t);
|
|
2355
2817
|
};
|
|
2356
|
-
function
|
|
2357
|
-
|
|
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);
|
|
2358
2820
|
}
|
|
2359
|
-
|
|
2821
|
+
Fe();
|
|
2360
2822
|
//#endregion
|
|
2361
2823
|
//#region src/components/RequiredMark.jsx
|
|
2362
|
-
function
|
|
2824
|
+
function Z() {
|
|
2363
2825
|
return /* @__PURE__ */ t("span", {
|
|
2364
2826
|
className: "required",
|
|
2365
2827
|
"aria-hidden": "true",
|
|
@@ -2368,23 +2830,23 @@ function X() {
|
|
|
2368
2830
|
}
|
|
2369
2831
|
//#endregion
|
|
2370
2832
|
//#region src/components/AppAutocomplete.jsx
|
|
2371
|
-
function
|
|
2372
|
-
T("AppAutocomplete",
|
|
2373
|
-
let
|
|
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 }) {
|
|
2834
|
+
T("AppAutocomplete", y);
|
|
2835
|
+
let b = c(null), x = typeof o == "function";
|
|
2374
2836
|
return a(() => {
|
|
2375
|
-
let e =
|
|
2376
|
-
e && !
|
|
2377
|
-
}, [i,
|
|
2378
|
-
let t =
|
|
2837
|
+
let e = b.current;
|
|
2838
|
+
e && !x && (e.options = i || []);
|
|
2839
|
+
}, [i, x]), a(() => {
|
|
2840
|
+
let t = b.current;
|
|
2379
2841
|
t && t.value !== (e ?? "") && (t.value = e ?? "");
|
|
2380
2842
|
}, [e]), a(() => {
|
|
2381
|
-
let e =
|
|
2843
|
+
let e = b.current;
|
|
2382
2844
|
if (!e) return;
|
|
2383
2845
|
let t = () => r?.(e.value);
|
|
2384
2846
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
2385
2847
|
}, [r]), a(() => {
|
|
2386
|
-
let e =
|
|
2387
|
-
if (!e || !
|
|
2848
|
+
let e = b.current;
|
|
2849
|
+
if (!e || !x) return;
|
|
2388
2850
|
let t = !1, n = async (n) => {
|
|
2389
2851
|
e.loading = !0;
|
|
2390
2852
|
try {
|
|
@@ -2397,45 +2859,46 @@ function Ce({ value: e, onChange: r, options: i, loadOptions: o, placeholder: s
|
|
|
2397
2859
|
return e.addEventListener("search", n), () => {
|
|
2398
2860
|
t = !0, e.removeEventListener("search", n);
|
|
2399
2861
|
};
|
|
2400
|
-
}, [
|
|
2401
|
-
className: `field${
|
|
2862
|
+
}, [x, o]), /* @__PURE__ */ n("div", {
|
|
2863
|
+
className: `field${v ? ` ${v}` : ""}`,
|
|
2402
2864
|
children: [
|
|
2403
|
-
|
|
2865
|
+
m && /* @__PURE__ */ n("label", {
|
|
2404
2866
|
className: "label",
|
|
2405
|
-
htmlFor:
|
|
2406
|
-
children: [
|
|
2867
|
+
htmlFor: p,
|
|
2868
|
+
children: [m, _ && /* @__PURE__ */ t(Z, {})]
|
|
2407
2869
|
}),
|
|
2408
2870
|
/* @__PURE__ */ t("wui-autocomplete", {
|
|
2409
|
-
"aria-label": typeof
|
|
2410
|
-
id:
|
|
2411
|
-
ref:
|
|
2412
|
-
name:
|
|
2871
|
+
"aria-label": typeof m == "string" ? m : void 0,
|
|
2872
|
+
id: p,
|
|
2873
|
+
ref: b,
|
|
2874
|
+
name: p,
|
|
2413
2875
|
placeholder: s,
|
|
2414
|
-
remote:
|
|
2876
|
+
remote: x ? "" : void 0,
|
|
2415
2877
|
"min-chars": l == null ? void 0 : String(l),
|
|
2416
2878
|
debounce: u == null ? void 0 : String(u),
|
|
2879
|
+
size: f || void 0,
|
|
2417
2880
|
disabled: d ? "" : void 0,
|
|
2418
|
-
required:
|
|
2881
|
+
required: _ ? "" : void 0
|
|
2419
2882
|
}),
|
|
2420
|
-
|
|
2883
|
+
h ? /* @__PURE__ */ t("div", {
|
|
2421
2884
|
className: "field-error",
|
|
2422
|
-
children: m
|
|
2423
|
-
}) : h ? /* @__PURE__ */ t("div", {
|
|
2424
|
-
className: "field-hint",
|
|
2425
2885
|
children: h
|
|
2886
|
+
}) : g ? /* @__PURE__ */ t("div", {
|
|
2887
|
+
className: "field-hint",
|
|
2888
|
+
children: g
|
|
2426
2889
|
}) : null
|
|
2427
2890
|
]
|
|
2428
2891
|
});
|
|
2429
2892
|
}
|
|
2430
2893
|
//#endregion
|
|
2431
2894
|
//#region src/components/AppAvatar.jsx
|
|
2432
|
-
function
|
|
2895
|
+
function Le(e) {
|
|
2433
2896
|
let t = (e || "").trim();
|
|
2434
2897
|
if (!t) return "?";
|
|
2435
2898
|
let n = t.split(/\s+/).filter(Boolean);
|
|
2436
2899
|
return n.length === 1 ? n[0].slice(0, 2).toUpperCase() : (n[0][0] + n[n.length - 1][0]).toUpperCase();
|
|
2437
2900
|
}
|
|
2438
|
-
function
|
|
2901
|
+
function Re({ name: e, src: n, className: r = "", ...i }) {
|
|
2439
2902
|
T("AppAvatar", i);
|
|
2440
2903
|
let a = ["avatar", r].filter(Boolean).join(" ");
|
|
2441
2904
|
return n ? /* @__PURE__ */ t("span", {
|
|
@@ -2449,12 +2912,12 @@ function Te({ name: e, src: n, className: r = "", ...i }) {
|
|
|
2449
2912
|
className: a,
|
|
2450
2913
|
role: "img",
|
|
2451
2914
|
"aria-label": e,
|
|
2452
|
-
children:
|
|
2915
|
+
children: Le(e)
|
|
2453
2916
|
});
|
|
2454
2917
|
}
|
|
2455
2918
|
//#endregion
|
|
2456
2919
|
//#region src/components/AppBadge.jsx
|
|
2457
|
-
function
|
|
2920
|
+
function ze({ children: e, tone: n, dot: r = !1, className: i = "", ...a }) {
|
|
2458
2921
|
return T("AppBadge", a), /* @__PURE__ */ t(d, {
|
|
2459
2922
|
bg: !1,
|
|
2460
2923
|
className: [
|
|
@@ -2468,14 +2931,14 @@ function Ee({ children: e, tone: n, dot: r = !1, className: i = "", ...a }) {
|
|
|
2468
2931
|
}
|
|
2469
2932
|
//#endregion
|
|
2470
2933
|
//#region src/components/AppButton.jsx
|
|
2471
|
-
var
|
|
2934
|
+
var Be = {
|
|
2472
2935
|
primary: "primary",
|
|
2473
2936
|
secondary: "secondary",
|
|
2474
2937
|
outline: "outline-primary",
|
|
2475
2938
|
ghost: "link",
|
|
2476
2939
|
danger: "danger"
|
|
2477
2940
|
};
|
|
2478
|
-
function
|
|
2941
|
+
function Ve(e, n) {
|
|
2479
2942
|
if (!e) return null;
|
|
2480
2943
|
let r = n === "left" ? "me-2" : "ms-2";
|
|
2481
2944
|
return typeof e == "string" ? /* @__PURE__ */ t(O, {
|
|
@@ -2487,12 +2950,12 @@ function Oe(e, n) {
|
|
|
2487
2950
|
children: e
|
|
2488
2951
|
});
|
|
2489
2952
|
}
|
|
2490
|
-
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 }) {
|
|
2491
2954
|
T("AppButton", p);
|
|
2492
2955
|
let m = [c ? "w-100" : "", d].filter(Boolean).join(" ");
|
|
2493
2956
|
return /* @__PURE__ */ n(f, {
|
|
2494
2957
|
type: (p.as === void 0 || p.as === "button") && p.href === void 0 ? a : void 0,
|
|
2495
|
-
variant:
|
|
2958
|
+
variant: Be[r] ?? "primary",
|
|
2496
2959
|
size: i === "md" ? void 0 : i,
|
|
2497
2960
|
disabled: s || o,
|
|
2498
2961
|
className: m || void 0,
|
|
@@ -2502,15 +2965,15 @@ function Z({ children: e, variant: r = "primary", size: i = "md", type: a = "but
|
|
|
2502
2965
|
className: "spinner-border spinner-border-sm me-2",
|
|
2503
2966
|
"aria-hidden": "true"
|
|
2504
2967
|
}),
|
|
2505
|
-
!o &&
|
|
2968
|
+
!o && Ve(l, "left"),
|
|
2506
2969
|
e,
|
|
2507
|
-
!o &&
|
|
2970
|
+
!o && Ve(u, "right")
|
|
2508
2971
|
]
|
|
2509
2972
|
});
|
|
2510
2973
|
}
|
|
2511
2974
|
//#endregion
|
|
2512
2975
|
//#region src/components/AppCallout.jsx
|
|
2513
|
-
function
|
|
2976
|
+
function He({ children: e, icon: r = "info", className: i = "", ...a }) {
|
|
2514
2977
|
return T("AppCallout", a), /* @__PURE__ */ n("div", {
|
|
2515
2978
|
className: `info-callout${i ? ` ${i}` : ""}`,
|
|
2516
2979
|
children: [r && /* @__PURE__ */ t("span", {
|
|
@@ -2524,7 +2987,7 @@ function ke({ children: e, icon: r = "info", className: i = "", ...a }) {
|
|
|
2524
2987
|
}
|
|
2525
2988
|
//#endregion
|
|
2526
2989
|
//#region src/components/AppCard.jsx
|
|
2527
|
-
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 }) {
|
|
2528
2991
|
T("AppCard", h);
|
|
2529
2992
|
let g = a != null || r != null || o != null || s != null;
|
|
2530
2993
|
return /* @__PURE__ */ n(p, {
|
|
@@ -2549,7 +3012,7 @@ function Ae({ title: r, titleClassName: i = "", header: a, headerExtra: o, heade
|
|
|
2549
3012
|
}
|
|
2550
3013
|
//#endregion
|
|
2551
3014
|
//#region src/components/AppCheckbox.jsx
|
|
2552
|
-
var
|
|
3015
|
+
var We = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
2553
3016
|
T("AppCheckbox", s);
|
|
2554
3017
|
let l = o(), u = r || i || l;
|
|
2555
3018
|
return /* @__PURE__ */ n("div", {
|
|
@@ -2570,7 +3033,7 @@ var je = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
|
2570
3033
|
});
|
|
2571
3034
|
//#endregion
|
|
2572
3035
|
//#region src/components/AppChip.jsx
|
|
2573
|
-
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 }) {
|
|
2574
3037
|
T("AppChip", m);
|
|
2575
3038
|
let h = r ?? i, g = [
|
|
2576
3039
|
"chip",
|
|
@@ -2622,7 +3085,7 @@ function Me({ label: r, children: i, tone: a = "neutral", size: o = "md", leadin
|
|
|
2622
3085
|
}
|
|
2623
3086
|
//#endregion
|
|
2624
3087
|
//#region src/components/AppChoiceCard.jsx
|
|
2625
|
-
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 }) {
|
|
2626
3089
|
return T("AppChoiceCard", y), /* @__PURE__ */ n("label", {
|
|
2627
3090
|
className: `struct-card${d ? " struct-card-img-card" : ""}${o ? " checked" : ""}${v ? ` ${v}` : ""}`,
|
|
2628
3091
|
children: [
|
|
@@ -2670,7 +3133,7 @@ function Ne({ name: r, multiple: i = !1, value: a, checked: o, onChange: s, icon
|
|
|
2670
3133
|
}
|
|
2671
3134
|
//#endregion
|
|
2672
3135
|
//#region src/components/AppChoiceChip.jsx
|
|
2673
|
-
function
|
|
3136
|
+
function qe({ multiple: e = !0, label: r, name: i, value: a, checked: o, onChange: s, children: c, count: l, className: u = "", ...d }) {
|
|
2674
3137
|
return T("AppChoiceChip", d), /* @__PURE__ */ n("label", {
|
|
2675
3138
|
className: `choice-chip${o ? " checked" : ""}${u ? ` ${u}` : ""}`,
|
|
2676
3139
|
children: [
|
|
@@ -2691,7 +3154,7 @@ function Pe({ multiple: e = !0, label: r, name: i, value: a, checked: o, onChang
|
|
|
2691
3154
|
}
|
|
2692
3155
|
//#endregion
|
|
2693
3156
|
//#region src/components/AppColorField.jsx
|
|
2694
|
-
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 }) {
|
|
2695
3158
|
T("AppColorField", f);
|
|
2696
3159
|
let p = l || c;
|
|
2697
3160
|
return /* @__PURE__ */ n("div", {
|
|
@@ -2700,7 +3163,7 @@ function Fe({ value: e = "#000000", onChange: r, label: i, required: a = !1, err
|
|
|
2700
3163
|
i && /* @__PURE__ */ n("label", {
|
|
2701
3164
|
className: "label",
|
|
2702
3165
|
htmlFor: p,
|
|
2703
|
-
children: [i, a && /* @__PURE__ */ t(
|
|
3166
|
+
children: [i, a && /* @__PURE__ */ t(Z, {})]
|
|
2704
3167
|
}),
|
|
2705
3168
|
/* @__PURE__ */ n("div", {
|
|
2706
3169
|
className: "color-field",
|
|
@@ -2739,7 +3202,7 @@ function Fe({ value: e = "#000000", onChange: r, label: i, required: a = !1, err
|
|
|
2739
3202
|
}
|
|
2740
3203
|
//#endregion
|
|
2741
3204
|
//#region src/components/AppCompareTable.jsx
|
|
2742
|
-
function
|
|
3205
|
+
function Ye({ columns: e = [], rows: r = [], caption: i, className: a = "", ...o }) {
|
|
2743
3206
|
T("AppCompareTable", o);
|
|
2744
3207
|
let s = (e) => e === !0 ? /* @__PURE__ */ t("span", {
|
|
2745
3208
|
className: "compare-yes",
|
|
@@ -2775,7 +3238,7 @@ function Ie({ columns: e = [], rows: r = [], caption: i, className: a = "", ...o
|
|
|
2775
3238
|
}
|
|
2776
3239
|
//#endregion
|
|
2777
3240
|
//#region src/components/AppInfoTip.jsx
|
|
2778
|
-
function
|
|
3241
|
+
function Xe({ label: e, children: r, ...i }) {
|
|
2779
3242
|
T("AppInfoTip", i);
|
|
2780
3243
|
let [a, u] = l(!1), [d, f] = l(null), p = c(null), m = c(null), g = o();
|
|
2781
3244
|
return s(() => {
|
|
@@ -2822,29 +3285,29 @@ function Q({ label: e, children: r, ...i }) {
|
|
|
2822
3285
|
}
|
|
2823
3286
|
//#endregion
|
|
2824
3287
|
//#region src/components/AppInput.jsx
|
|
2825
|
-
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) {
|
|
2826
3289
|
T("AppInput", j);
|
|
2827
3290
|
let [N, P] = l(!1), F = v || y, I = u === "password", L = I && N ? "text" : u, R = c(null), z = (e) => {
|
|
2828
3291
|
R.current = e, typeof M == "function" ? M(e) : M && (M.current = e);
|
|
2829
|
-
}, B = String(j.value ?? j.defaultValue ?? ""), [
|
|
2830
|
-
|
|
2831
|
-
},
|
|
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", {
|
|
2832
3295
|
type: "button",
|
|
2833
3296
|
className: "input-clear",
|
|
2834
3297
|
onClick: () => {
|
|
2835
3298
|
let e = R.current;
|
|
2836
3299
|
if (!e) return;
|
|
2837
3300
|
let t = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set;
|
|
2838
|
-
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();
|
|
2839
3302
|
},
|
|
2840
3303
|
"aria-label": "Clear",
|
|
2841
3304
|
tabIndex: -1,
|
|
2842
|
-
hidden: !
|
|
3305
|
+
hidden: !V,
|
|
2843
3306
|
children: /* @__PURE__ */ t(O, {
|
|
2844
3307
|
name: "x",
|
|
2845
3308
|
size: 16
|
|
2846
3309
|
})
|
|
2847
|
-
}) : null,
|
|
3310
|
+
}) : null, U = [
|
|
2848
3311
|
"input",
|
|
2849
3312
|
d === "sm" ? "input-sm" : "",
|
|
2850
3313
|
d === "lg" ? "input-lg" : "",
|
|
@@ -2853,11 +3316,11 @@ var Le = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
2853
3316
|
_ ? "num-input" : "",
|
|
2854
3317
|
C ? "has-clear" : "",
|
|
2855
3318
|
b
|
|
2856
|
-
].filter(Boolean).join(" "),
|
|
3319
|
+
].filter(Boolean).join(" "), W = /* @__PURE__ */ t(m.Control, {
|
|
2857
3320
|
id: F,
|
|
2858
3321
|
name: y,
|
|
2859
3322
|
type: L,
|
|
2860
|
-
className:
|
|
3323
|
+
className: U,
|
|
2861
3324
|
disabled: S,
|
|
2862
3325
|
required: r,
|
|
2863
3326
|
"aria-invalid": i ? "true" : "false",
|
|
@@ -2865,14 +3328,14 @@ var Le = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
2865
3328
|
...j,
|
|
2866
3329
|
placeholder: A ? " " : j.placeholder,
|
|
2867
3330
|
ref: z,
|
|
2868
|
-
onInput:
|
|
2869
|
-
}),
|
|
2870
|
-
return
|
|
3331
|
+
onInput: re ? ie : j.onInput
|
|
3332
|
+
}), G;
|
|
3333
|
+
return G = A && e ? /* @__PURE__ */ n("div", {
|
|
2871
3334
|
className: "field-float",
|
|
2872
|
-
children: [
|
|
3335
|
+
children: [W, /* @__PURE__ */ n("label", {
|
|
2873
3336
|
className: "float-label",
|
|
2874
3337
|
htmlFor: F,
|
|
2875
|
-
children: [e, r && /* @__PURE__ */ t(
|
|
3338
|
+
children: [e, r && /* @__PURE__ */ t(Z, {})]
|
|
2876
3339
|
})]
|
|
2877
3340
|
}) : D || k ? /* @__PURE__ */ n("div", {
|
|
2878
3341
|
className: "input-affixed",
|
|
@@ -2881,7 +3344,7 @@ var Le = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
2881
3344
|
className: "affix affix-pre",
|
|
2882
3345
|
children: D
|
|
2883
3346
|
}),
|
|
2884
|
-
|
|
3347
|
+
W,
|
|
2885
3348
|
k != null && /* @__PURE__ */ t("span", {
|
|
2886
3349
|
className: "affix affix-suf",
|
|
2887
3350
|
children: k
|
|
@@ -2889,13 +3352,13 @@ var Le = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
2889
3352
|
]
|
|
2890
3353
|
}) : _ ? /* @__PURE__ */ n("div", {
|
|
2891
3354
|
className: "input-with-unit",
|
|
2892
|
-
children: [
|
|
3355
|
+
children: [W, /* @__PURE__ */ t("span", {
|
|
2893
3356
|
className: "unit",
|
|
2894
3357
|
children: _
|
|
2895
3358
|
})]
|
|
2896
3359
|
}) : I ? /* @__PURE__ */ n("div", {
|
|
2897
3360
|
className: "input-wrap",
|
|
2898
|
-
children: [
|
|
3361
|
+
children: [W, /* @__PURE__ */ t("button", {
|
|
2899
3362
|
type: "button",
|
|
2900
3363
|
className: "pw-toggle",
|
|
2901
3364
|
onClick: () => P((e) => !e),
|
|
@@ -2908,7 +3371,7 @@ var Le = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
2908
3371
|
})]
|
|
2909
3372
|
}) : p ? /* @__PURE__ */ n("div", {
|
|
2910
3373
|
className: "input-wrap",
|
|
2911
|
-
children: [
|
|
3374
|
+
children: [W, /* @__PURE__ */ t("button", {
|
|
2912
3375
|
type: "button",
|
|
2913
3376
|
className: "pw-toggle",
|
|
2914
3377
|
onClick: h,
|
|
@@ -2930,8 +3393,8 @@ var Le = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
2930
3393
|
size: 16
|
|
2931
3394
|
})
|
|
2932
3395
|
}),
|
|
2933
|
-
|
|
2934
|
-
|
|
3396
|
+
W,
|
|
3397
|
+
ae
|
|
2935
3398
|
]
|
|
2936
3399
|
}) : f ? /* @__PURE__ */ n("div", {
|
|
2937
3400
|
className: "input-icon",
|
|
@@ -2941,8 +3404,8 @@ var Le = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
2941
3404
|
name: f,
|
|
2942
3405
|
size: 16
|
|
2943
3406
|
})
|
|
2944
|
-
}),
|
|
2945
|
-
}) :
|
|
3407
|
+
}), W]
|
|
3408
|
+
}) : W, /* @__PURE__ */ n(m.Group, {
|
|
2946
3409
|
className: `field${x ? ` ${x}` : ""}`,
|
|
2947
3410
|
children: [
|
|
2948
3411
|
e && !A && /* @__PURE__ */ n(m.Label, {
|
|
@@ -2950,14 +3413,14 @@ var Le = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
2950
3413
|
htmlFor: F,
|
|
2951
3414
|
children: [
|
|
2952
3415
|
e,
|
|
2953
|
-
r && /* @__PURE__ */ t(
|
|
2954
|
-
o && /* @__PURE__ */ t(
|
|
3416
|
+
r && /* @__PURE__ */ t(Z, {}),
|
|
3417
|
+
o && /* @__PURE__ */ t(Xe, {
|
|
2955
3418
|
label: s,
|
|
2956
3419
|
children: o
|
|
2957
3420
|
})
|
|
2958
3421
|
]
|
|
2959
3422
|
}),
|
|
2960
|
-
|
|
3423
|
+
G,
|
|
2961
3424
|
i ? /* @__PURE__ */ t("div", {
|
|
2962
3425
|
className: "field-error",
|
|
2963
3426
|
children: i
|
|
@@ -2971,15 +3434,15 @@ var Le = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
2971
3434
|
})
|
|
2972
3435
|
]
|
|
2973
3436
|
});
|
|
2974
|
-
}),
|
|
2975
|
-
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 }) {
|
|
2976
3439
|
T("AppModal", v);
|
|
2977
3440
|
let y = c(null);
|
|
2978
3441
|
a(() => {
|
|
2979
3442
|
if (!e) return;
|
|
2980
3443
|
let t = y.current?.closest(".modal-content");
|
|
2981
3444
|
if (!t) return;
|
|
2982
|
-
let n = () => Array.from(t.querySelectorAll(
|
|
3445
|
+
let n = () => Array.from(t.querySelectorAll(Qe));
|
|
2983
3446
|
(t.querySelector("[data-autofocus]") || n().find((e) => !e.classList.contains("lx-modal-close")) || n()[0] || t).focus?.();
|
|
2984
3447
|
}, [e]);
|
|
2985
3448
|
let b = ["lx-modal-shell", f ? "is-side" : ""].filter(Boolean).join(" "), x = [
|
|
@@ -3064,7 +3527,7 @@ var $ = (e) => function({ size: n = 72 }) {
|
|
|
3064
3527
|
tone: e,
|
|
3065
3528
|
size: n
|
|
3066
3529
|
});
|
|
3067
|
-
},
|
|
3530
|
+
}, et = {
|
|
3068
3531
|
success: $("success"),
|
|
3069
3532
|
error: $("error"),
|
|
3070
3533
|
warning: $("warning"),
|
|
@@ -3073,14 +3536,14 @@ var $ = (e) => function({ size: n = 72 }) {
|
|
|
3073
3536
|
};
|
|
3074
3537
|
//#endregion
|
|
3075
3538
|
//#region src/components/AppConfirmDialog.jsx
|
|
3076
|
-
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 }) {
|
|
3077
3540
|
T("AppConfirmDialog", h);
|
|
3078
3541
|
let [g, _] = l("");
|
|
3079
3542
|
if (a(() => {
|
|
3080
3543
|
r || _("");
|
|
3081
3544
|
}, [r]), !r) return null;
|
|
3082
|
-
let v = !!f && g.trim() !== f, y =
|
|
3083
|
-
return /* @__PURE__ */ t(
|
|
3545
|
+
let v = !!f && g.trim() !== f, y = et[d || (u ? "delete" : "info")];
|
|
3546
|
+
return /* @__PURE__ */ t($e, {
|
|
3084
3547
|
open: r,
|
|
3085
3548
|
hideHeader: !0,
|
|
3086
3549
|
title: i,
|
|
@@ -3088,11 +3551,11 @@ function Ve({ open: r, title: i, message: o, confirmLabel: s = "Confirm", cancel
|
|
|
3088
3551
|
className: "lx-confirm",
|
|
3089
3552
|
footer: /* @__PURE__ */ n("div", {
|
|
3090
3553
|
className: "lx-confirm-actions",
|
|
3091
|
-
children: [/* @__PURE__ */ t(
|
|
3554
|
+
children: [/* @__PURE__ */ t(Q, {
|
|
3092
3555
|
variant: "secondary",
|
|
3093
3556
|
onClick: m,
|
|
3094
3557
|
children: c
|
|
3095
|
-
}), /* @__PURE__ */ t(
|
|
3558
|
+
}), /* @__PURE__ */ t(Q, {
|
|
3096
3559
|
variant: u ? "danger" : "primary",
|
|
3097
3560
|
disabled: v,
|
|
3098
3561
|
onClick: p,
|
|
@@ -3116,7 +3579,7 @@ function Ve({ open: r, title: i, message: o, confirmLabel: s = "Confirm", cancel
|
|
|
3116
3579
|
className: "lx-confirm-msg",
|
|
3117
3580
|
children: o
|
|
3118
3581
|
}),
|
|
3119
|
-
f && /* @__PURE__ */ t(
|
|
3582
|
+
f && /* @__PURE__ */ t(Ze, {
|
|
3120
3583
|
fieldClassName: "mt-3 mb-0 w-100 text-start",
|
|
3121
3584
|
label: /* @__PURE__ */ n(e, { children: [
|
|
3122
3585
|
"Type ",
|
|
@@ -3133,7 +3596,7 @@ function Ve({ open: r, title: i, message: o, confirmLabel: s = "Confirm", cancel
|
|
|
3133
3596
|
}
|
|
3134
3597
|
//#endregion
|
|
3135
3598
|
//#region src/components/AppSkeleton.jsx
|
|
3136
|
-
function
|
|
3599
|
+
function nt({ width: e = "100%", height: n = 14, radius: r = 6, className: i = "", style: a, ...o }) {
|
|
3137
3600
|
return T("AppSkeleton", o), /* @__PURE__ */ t("span", {
|
|
3138
3601
|
className: `skeleton${i ? ` ${i}` : ""}`,
|
|
3139
3602
|
"aria-hidden": "true",
|
|
@@ -3145,7 +3608,7 @@ function He({ width: e = "100%", height: n = 14, radius: r = 6, className: i = "
|
|
|
3145
3608
|
}
|
|
3146
3609
|
});
|
|
3147
3610
|
}
|
|
3148
|
-
var
|
|
3611
|
+
var rt = [
|
|
3149
3612
|
"r0",
|
|
3150
3613
|
"r1",
|
|
3151
3614
|
"r2",
|
|
@@ -3154,7 +3617,7 @@ var Ue = [
|
|
|
3154
3617
|
"r5",
|
|
3155
3618
|
"r6",
|
|
3156
3619
|
"r7"
|
|
3157
|
-
],
|
|
3620
|
+
], it = [
|
|
3158
3621
|
"c0",
|
|
3159
3622
|
"c1",
|
|
3160
3623
|
"c2",
|
|
@@ -3164,56 +3627,61 @@ var Ue = [
|
|
|
3164
3627
|
"c6",
|
|
3165
3628
|
"c7"
|
|
3166
3629
|
];
|
|
3167
|
-
function
|
|
3168
|
-
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, {
|
|
3169
3632
|
width: n === 0 ? "70%" : "50%",
|
|
3170
3633
|
height: 12
|
|
3171
3634
|
}) }, e)) }, e));
|
|
3172
3635
|
}
|
|
3173
3636
|
//#endregion
|
|
3174
3637
|
//#region src/components/AppSelectMini.jsx
|
|
3175
|
-
function
|
|
3176
|
-
T("AppSelectMini",
|
|
3177
|
-
let
|
|
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 }) {
|
|
3639
|
+
T("AppSelectMini", h);
|
|
3640
|
+
let g = c(null);
|
|
3178
3641
|
return a(() => {
|
|
3179
|
-
|
|
3642
|
+
g.current && (g.current.options = r.map((e) => ({
|
|
3180
3643
|
value: e.value,
|
|
3181
|
-
label: e.label ?? e.text ?? ""
|
|
3644
|
+
label: e.label ?? e.text ?? "",
|
|
3645
|
+
icon: e.icon
|
|
3182
3646
|
})));
|
|
3183
3647
|
}, [r]), a(() => {
|
|
3184
|
-
let t =
|
|
3648
|
+
let t = g.current;
|
|
3185
3649
|
t && String(t.value ?? "") !== String(e ?? "") && (t.value = e ?? "");
|
|
3186
3650
|
}, [e]), a(() => {
|
|
3187
|
-
let e =
|
|
3651
|
+
let e = g.current;
|
|
3188
3652
|
if (!e) return;
|
|
3189
3653
|
let t = () => n?.(e.value);
|
|
3190
3654
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
3191
|
-
}, [n]),
|
|
3192
|
-
|
|
3655
|
+
}, [n]), a(() => {
|
|
3656
|
+
let e = g.current;
|
|
3657
|
+
if (e) for (let [t, n] of [["icon", f], ["prefix", p]]) n == null || n === "" ? e.removeAttribute(t) : e.setAttribute(t, n);
|
|
3658
|
+
}, [f, p]), /* @__PURE__ */ t("wui-select", {
|
|
3659
|
+
ref: g,
|
|
3193
3660
|
name: o,
|
|
3194
3661
|
compact: "",
|
|
3195
3662
|
id: l,
|
|
3196
3663
|
placeholder: i,
|
|
3197
3664
|
"aria-label": s,
|
|
3665
|
+
size: d || void 0,
|
|
3198
3666
|
disabled: u ? "" : void 0,
|
|
3199
|
-
className:
|
|
3667
|
+
className: m
|
|
3200
3668
|
});
|
|
3201
3669
|
}
|
|
3202
3670
|
//#endregion
|
|
3203
3671
|
//#region src/components/AppTablePagination.jsx
|
|
3204
|
-
var
|
|
3672
|
+
var st = [
|
|
3205
3673
|
5,
|
|
3206
3674
|
10,
|
|
3207
3675
|
25,
|
|
3208
3676
|
50
|
|
3209
3677
|
];
|
|
3210
|
-
function
|
|
3678
|
+
function ct({ page: e, totalPages: r, pageSize: i, total: a, firstRow: o, lastRow: s, onPageChange: c, onPageSizeChange: l, pageSizes: u = st, ...d }) {
|
|
3211
3679
|
return T("AppTablePagination", d), /* @__PURE__ */ n("div", {
|
|
3212
3680
|
className: "table-pagination",
|
|
3213
3681
|
children: [
|
|
3214
3682
|
/* @__PURE__ */ n("span", {
|
|
3215
3683
|
className: "tpg-rows",
|
|
3216
|
-
children: ["Rows per page:", /* @__PURE__ */ t(
|
|
3684
|
+
children: ["Rows per page:", /* @__PURE__ */ t(ot, {
|
|
3217
3685
|
value: i,
|
|
3218
3686
|
onChange: (e) => l(Number(e)),
|
|
3219
3687
|
ariaLabel: "Rows per page",
|
|
@@ -3262,13 +3730,13 @@ function Je({ page: e, totalPages: r, pageSize: i, total: a, firstRow: o, lastRo
|
|
|
3262
3730
|
}
|
|
3263
3731
|
//#endregion
|
|
3264
3732
|
//#region src/components/AppDataTable.jsx
|
|
3265
|
-
function
|
|
3733
|
+
function lt(e) {
|
|
3266
3734
|
return e === "end" ? "lx-cell-end" : e === "num" ? "num" : e === "center" ? "text-center" : "";
|
|
3267
3735
|
}
|
|
3268
|
-
function
|
|
3736
|
+
function ut(e) {
|
|
3269
3737
|
return e == null || e === "" ? "—" : e;
|
|
3270
3738
|
}
|
|
3271
|
-
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 }) {
|
|
3272
3740
|
T("AppDataTable", S);
|
|
3273
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) => {
|
|
3274
3742
|
e && (e.indeterminate = D);
|
|
@@ -3293,7 +3761,7 @@ function Ze({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3293
3761
|
r.map((e, r) => {
|
|
3294
3762
|
let i = !!(e.sortable && s), a = o && o.key === e.key;
|
|
3295
3763
|
return /* @__PURE__ */ n("th", {
|
|
3296
|
-
className: (i ? "sortable " : "") + (r === 0 ? "lx-name-cell " : "") +
|
|
3764
|
+
className: (i ? "sortable " : "") + (r === 0 ? "lx-name-cell " : "") + lt(e.align),
|
|
3297
3765
|
style: e.width ? { width: e.width } : void 0,
|
|
3298
3766
|
tabIndex: i ? 0 : void 0,
|
|
3299
3767
|
"aria-sort": a ? o.dir === "asc" ? "ascending" : "descending" : i ? "none" : void 0,
|
|
@@ -3320,7 +3788,7 @@ function Ze({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3320
3788
|
children: "Actions"
|
|
3321
3789
|
})
|
|
3322
3790
|
}))
|
|
3323
|
-
] }) }), /* @__PURE__ */ t("tbody", { children: c ? /* @__PURE__ */ t(
|
|
3791
|
+
] }) }), /* @__PURE__ */ t("tbody", { children: c ? /* @__PURE__ */ t(at, {
|
|
3324
3792
|
rows: l,
|
|
3325
3793
|
cols: C
|
|
3326
3794
|
}) : i?.length ? i.map((e) => {
|
|
@@ -3339,8 +3807,8 @@ function Ze({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3339
3807
|
})
|
|
3340
3808
|
}),
|
|
3341
3809
|
r.map((n, r) => /* @__PURE__ */ t("td", {
|
|
3342
|
-
className: (r === 0 ? "lx-name-cell " : "") +
|
|
3343
|
-
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])
|
|
3344
3812
|
}, n.key)),
|
|
3345
3813
|
p && /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t("div", {
|
|
3346
3814
|
className: "u-row-actions",
|
|
@@ -3354,7 +3822,7 @@ function Ze({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3354
3822
|
children: A
|
|
3355
3823
|
}) }) })]
|
|
3356
3824
|
})
|
|
3357
|
-
}), h && !c && h.total > 0 && /* @__PURE__ */ t(
|
|
3825
|
+
}), h && !c && h.total > 0 && /* @__PURE__ */ t(ct, {
|
|
3358
3826
|
page: h.page,
|
|
3359
3827
|
totalPages: h.totalPages,
|
|
3360
3828
|
pageSize: h.pageSize,
|
|
@@ -3367,43 +3835,46 @@ function Ze({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3367
3835
|
}
|
|
3368
3836
|
//#endregion
|
|
3369
3837
|
//#region src/components/AppDatePicker.jsx
|
|
3370
|
-
function
|
|
3371
|
-
T("AppDatePicker",
|
|
3372
|
-
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;
|
|
3373
3841
|
a(() => {
|
|
3374
|
-
let t =
|
|
3842
|
+
let t = S.current;
|
|
3375
3843
|
t && t.value !== (e ?? "") && (t.value = e ?? "");
|
|
3376
3844
|
}, [e]), a(() => {
|
|
3377
|
-
let e =
|
|
3845
|
+
let e = S.current;
|
|
3378
3846
|
if (!e) return;
|
|
3379
3847
|
let t = () => r?.(e.value);
|
|
3380
3848
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
3381
3849
|
}, [r]);
|
|
3382
|
-
let
|
|
3383
|
-
ref:
|
|
3384
|
-
id:
|
|
3850
|
+
let E = !i && !u && !l, D = /* @__PURE__ */ t("wui-datepicker", {
|
|
3851
|
+
ref: S,
|
|
3852
|
+
id: w,
|
|
3385
3853
|
name: d,
|
|
3386
3854
|
min: f,
|
|
3387
3855
|
max: p,
|
|
3388
3856
|
placeholder: m,
|
|
3389
|
-
|
|
3857
|
+
size: g || void 0,
|
|
3858
|
+
"first-day": _ == null ? void 0 : String(_),
|
|
3859
|
+
"aria-label": y,
|
|
3390
3860
|
"aria-invalid": u ? "true" : void 0,
|
|
3391
3861
|
disabled: h ? "" : void 0,
|
|
3392
|
-
required: s ? "" : void 0
|
|
3862
|
+
required: s ? "" : void 0,
|
|
3863
|
+
className: E && b || void 0
|
|
3393
3864
|
});
|
|
3394
|
-
return
|
|
3395
|
-
className: `field${
|
|
3865
|
+
return E ? D : /* @__PURE__ */ n("div", {
|
|
3866
|
+
className: `field${b ? ` ${b}` : ""}`,
|
|
3396
3867
|
children: [
|
|
3397
3868
|
i && /* @__PURE__ */ n("label", {
|
|
3398
3869
|
className: "label",
|
|
3399
|
-
htmlFor:
|
|
3870
|
+
htmlFor: w,
|
|
3400
3871
|
children: [i, s && /* @__PURE__ */ t("span", {
|
|
3401
3872
|
className: "required",
|
|
3402
3873
|
"aria-hidden": "true",
|
|
3403
3874
|
children: "*"
|
|
3404
3875
|
})]
|
|
3405
3876
|
}),
|
|
3406
|
-
|
|
3877
|
+
D,
|
|
3407
3878
|
u && /* @__PURE__ */ t("div", {
|
|
3408
3879
|
className: "field-error",
|
|
3409
3880
|
children: u
|
|
@@ -3416,8 +3887,65 @@ function Qe({ value: e, onChange: r, label: i, required: s = !1, hint: l, error:
|
|
|
3416
3887
|
});
|
|
3417
3888
|
}
|
|
3418
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
|
|
3419
3947
|
//#region src/components/AppDropdown.jsx
|
|
3420
|
-
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) {
|
|
3421
3949
|
return /* @__PURE__ */ t("button", {
|
|
3422
3950
|
ref: l,
|
|
3423
3951
|
type: "button",
|
|
@@ -3431,11 +3959,11 @@ var $e = r(function({ icon: e, iconSize: n = 20, btnClassName: r = "topbar-icon-
|
|
|
3431
3959
|
})
|
|
3432
3960
|
});
|
|
3433
3961
|
});
|
|
3434
|
-
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 }) {
|
|
3435
3963
|
return T("AppDropdown", d), /* @__PURE__ */ n(_, {
|
|
3436
3964
|
align: s,
|
|
3437
3965
|
children: [/* @__PURE__ */ t(_.Toggle, {
|
|
3438
|
-
as:
|
|
3966
|
+
as: mt,
|
|
3439
3967
|
icon: e,
|
|
3440
3968
|
iconSize: r,
|
|
3441
3969
|
btnClassName: i,
|
|
@@ -3473,7 +4001,7 @@ function et({ icon: e, iconSize: r, toggleClassName: i = "topbar-icon-btn", labe
|
|
|
3473
4001
|
}
|
|
3474
4002
|
//#endregion
|
|
3475
4003
|
//#region src/components/AppEmptyState.jsx
|
|
3476
|
-
function
|
|
4004
|
+
function gt({ icon: e, iconSize: r = 24, size: i = "md", title: a, text: o, action: s, className: c = "", style: l, ...u }) {
|
|
3477
4005
|
return T("AppEmptyState", u), /* @__PURE__ */ n("div", {
|
|
3478
4006
|
className: [
|
|
3479
4007
|
"empty-state",
|
|
@@ -3506,7 +4034,7 @@ function tt({ icon: e, iconSize: r = 24, size: i = "md", title: a, text: o, acti
|
|
|
3506
4034
|
}
|
|
3507
4035
|
//#endregion
|
|
3508
4036
|
//#region src/components/AppFileAttachment.jsx
|
|
3509
|
-
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 }) {
|
|
3510
4038
|
T("AppFileAttachment", h);
|
|
3511
4039
|
let g = o(), _ = m || s || g, [v, y] = l(null), [b, x] = l("");
|
|
3512
4040
|
a(() => {
|
|
@@ -3519,7 +4047,7 @@ function nt({ label: r = "Attachment", value: i, name: s, onChange: c, accept: u
|
|
|
3519
4047
|
function S(e) {
|
|
3520
4048
|
let t = e.target.files?.[0];
|
|
3521
4049
|
if (e.target.value = "", !t) return;
|
|
3522
|
-
let n =
|
|
4050
|
+
let n = Pe(t, {
|
|
3523
4051
|
accept: u,
|
|
3524
4052
|
maxSizeMb: d
|
|
3525
4053
|
});
|
|
@@ -3618,22 +4146,22 @@ function nt({ label: r = "Attachment", value: i, name: s, onChange: c, accept: u
|
|
|
3618
4146
|
}
|
|
3619
4147
|
//#endregion
|
|
3620
4148
|
//#region src/components/toast.js
|
|
3621
|
-
var
|
|
4149
|
+
var vt = /* @__PURE__ */ new Set([
|
|
3622
4150
|
"success",
|
|
3623
4151
|
"info",
|
|
3624
4152
|
"warning",
|
|
3625
4153
|
"error"
|
|
3626
4154
|
]);
|
|
3627
|
-
function
|
|
3628
|
-
let n =
|
|
4155
|
+
function yt(e, t = "success") {
|
|
4156
|
+
let n = vt.has(t) ? t : "success";
|
|
3629
4157
|
v[n](e, { toastId: `${n}:${e}` });
|
|
3630
4158
|
}
|
|
3631
|
-
function
|
|
4159
|
+
function bt(e) {
|
|
3632
4160
|
v.error(e, { toastId: `error:${e}` });
|
|
3633
4161
|
}
|
|
3634
4162
|
//#endregion
|
|
3635
4163
|
//#region src/components/AppFilePicker.jsx
|
|
3636
|
-
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 }) {
|
|
3637
4165
|
T("AppFilePicker", m);
|
|
3638
4166
|
let [h, g] = l(null), [_, v] = l(!1), y = c(null), b = o(), x = i || b;
|
|
3639
4167
|
a(() => {
|
|
@@ -3644,11 +4172,11 @@ function ot({ label: e, value: r, name: i, onPick: s, accept: u = ".jpg,.jpeg,.p
|
|
|
3644
4172
|
g(null);
|
|
3645
4173
|
}, [r]);
|
|
3646
4174
|
let S = r?.url || h, C = (e) => {
|
|
3647
|
-
let t =
|
|
4175
|
+
let t = Pe(e, {
|
|
3648
4176
|
accept: u,
|
|
3649
4177
|
maxSizeMb: d
|
|
3650
4178
|
});
|
|
3651
|
-
return t ? (
|
|
4179
|
+
return t ? (yt(t, "error"), !1) : (s(e), !0);
|
|
3652
4180
|
}, w = (e) => {
|
|
3653
4181
|
let t = e.target.files?.[0] || null;
|
|
3654
4182
|
t && (C(t) || (e.target.value = ""));
|
|
@@ -3674,7 +4202,7 @@ function ot({ label: e, value: r, name: i, onPick: s, accept: u = ".jpg,.jpeg,.p
|
|
|
3674
4202
|
/* @__PURE__ */ n("label", {
|
|
3675
4203
|
className: "label",
|
|
3676
4204
|
htmlFor: x,
|
|
3677
|
-
children: [e, f && /* @__PURE__ */ t(
|
|
4205
|
+
children: [e, f && /* @__PURE__ */ t(Z, {})]
|
|
3678
4206
|
}),
|
|
3679
4207
|
S ? /* @__PURE__ */ n("div", {
|
|
3680
4208
|
className: `file-preview${p ? " error" : ""}`,
|
|
@@ -3759,7 +4287,7 @@ function ot({ label: e, value: r, name: i, onPick: s, accept: u = ".jpg,.jpeg,.p
|
|
|
3759
4287
|
}
|
|
3760
4288
|
//#endregion
|
|
3761
4289
|
//#region src/components/AppInfoList.jsx
|
|
3762
|
-
function
|
|
4290
|
+
function St({ items: r = [], className: i = "", ...a }) {
|
|
3763
4291
|
return T("AppInfoList", a), /* @__PURE__ */ t("div", {
|
|
3764
4292
|
className: `info-list${i ? ` ${i}` : ""}`,
|
|
3765
4293
|
children: r.map((r, i) => {
|
|
@@ -3792,7 +4320,7 @@ function st({ items: r = [], className: i = "", ...a }) {
|
|
|
3792
4320
|
}
|
|
3793
4321
|
//#endregion
|
|
3794
4322
|
//#region src/components/AppKpiTile.jsx
|
|
3795
|
-
function
|
|
4323
|
+
function Ct({ label: e, value: r, icon: i, delta: a, deltaDirection: o = "flat", inline: s = !1, className: c = "", ...l }) {
|
|
3796
4324
|
T("AppKpiTile", l);
|
|
3797
4325
|
let u = `kpi${s ? " kpi-inline" : ""}${c ? ` ${c}` : ""}`, d = o === "up" ? "arrow-up" : o === "down" ? "arrow-down" : null;
|
|
3798
4326
|
return /* @__PURE__ */ n("div", {
|
|
@@ -3825,7 +4353,7 @@ function ct({ label: e, value: r, icon: i, delta: a, deltaDirection: o = "flat",
|
|
|
3825
4353
|
}
|
|
3826
4354
|
//#endregion
|
|
3827
4355
|
//#region src/components/AppLogoPicker.jsx
|
|
3828
|
-
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 }) {
|
|
3829
4357
|
T("AppLogoPicker", m);
|
|
3830
4358
|
let h = c(null);
|
|
3831
4359
|
return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("button", {
|
|
@@ -3871,12 +4399,12 @@ function lt({ value: r, fallback: i, name: a, onPick: o, loading: s = !1, accept
|
|
|
3871
4399
|
onChange: (e) => {
|
|
3872
4400
|
let t = e.target.files?.[0];
|
|
3873
4401
|
if (e.target.value = "", !t) return;
|
|
3874
|
-
let n =
|
|
4402
|
+
let n = Pe(t, {
|
|
3875
4403
|
accept: l,
|
|
3876
4404
|
maxSizeMb: u
|
|
3877
4405
|
});
|
|
3878
4406
|
if (n) {
|
|
3879
|
-
|
|
4407
|
+
yt(n, "error");
|
|
3880
4408
|
return;
|
|
3881
4409
|
}
|
|
3882
4410
|
o(t);
|
|
@@ -3886,54 +4414,57 @@ function lt({ value: r, fallback: i, name: a, onPick: o, loading: s = !1, accept
|
|
|
3886
4414
|
}
|
|
3887
4415
|
//#endregion
|
|
3888
4416
|
//#region src/components/AppMultiSelect.jsx
|
|
3889
|
-
function
|
|
3890
|
-
T("AppMultiSelect",
|
|
3891
|
-
let
|
|
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 }) {
|
|
4418
|
+
T("AppMultiSelect", b);
|
|
4419
|
+
let x = c(null);
|
|
3892
4420
|
return a(() => {
|
|
3893
|
-
let e =
|
|
4421
|
+
let e = x.current;
|
|
3894
4422
|
e && (e.options = i || []);
|
|
3895
4423
|
}, [i]), a(() => {
|
|
3896
|
-
let t =
|
|
4424
|
+
let t = x.current;
|
|
3897
4425
|
if (!t) return;
|
|
3898
4426
|
let n = e || [], r = t.values || [];
|
|
3899
4427
|
n.join(",") !== r.join(",") && (t.values = n);
|
|
3900
4428
|
}, [e]), a(() => {
|
|
3901
|
-
let e =
|
|
4429
|
+
let e = x.current;
|
|
3902
4430
|
if (!e) return;
|
|
3903
4431
|
let t = () => r?.(e.values);
|
|
3904
4432
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
3905
4433
|
}, [r]), /* @__PURE__ */ n("div", {
|
|
3906
|
-
className: `field${
|
|
4434
|
+
className: `field${y ? ` ${y}` : ""}`,
|
|
3907
4435
|
children: [
|
|
3908
|
-
|
|
4436
|
+
h && /* @__PURE__ */ n("label", {
|
|
3909
4437
|
className: "label",
|
|
3910
|
-
htmlFor:
|
|
3911
|
-
children: [
|
|
4438
|
+
htmlFor: m,
|
|
4439
|
+
children: [h, v && /* @__PURE__ */ t(Z, {})]
|
|
3912
4440
|
}),
|
|
3913
4441
|
/* @__PURE__ */ t("wui-multiselect", {
|
|
3914
|
-
"aria-label": typeof
|
|
3915
|
-
id:
|
|
3916
|
-
ref:
|
|
3917
|
-
name:
|
|
4442
|
+
"aria-label": typeof h == "string" ? h : void 0,
|
|
4443
|
+
id: m,
|
|
4444
|
+
ref: x,
|
|
4445
|
+
name: m,
|
|
3918
4446
|
placeholder: o,
|
|
3919
4447
|
"search-placeholder": s,
|
|
4448
|
+
icon: d || void 0,
|
|
4449
|
+
size: f || void 0,
|
|
4450
|
+
"collapse-chips": p ? "" : void 0,
|
|
3920
4451
|
searchable: l ? "" : void 0,
|
|
3921
4452
|
disabled: u ? "" : void 0,
|
|
3922
|
-
required:
|
|
4453
|
+
required: v ? "" : void 0
|
|
3923
4454
|
}),
|
|
3924
|
-
|
|
4455
|
+
g ? /* @__PURE__ */ t("div", {
|
|
3925
4456
|
className: "field-error",
|
|
3926
|
-
children:
|
|
3927
|
-
}) :
|
|
4457
|
+
children: g
|
|
4458
|
+
}) : _ ? /* @__PURE__ */ t("div", {
|
|
3928
4459
|
className: "field-hint",
|
|
3929
|
-
children:
|
|
4460
|
+
children: _
|
|
3930
4461
|
}) : null
|
|
3931
4462
|
]
|
|
3932
4463
|
});
|
|
3933
4464
|
}
|
|
3934
4465
|
//#endregion
|
|
3935
4466
|
//#region src/components/AppOtpInput.jsx
|
|
3936
|
-
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) {
|
|
3937
4468
|
T("AppOtpInput", v);
|
|
3938
4469
|
let b = c(null), x = o(), S = g || h || x, C = (e) => {
|
|
3939
4470
|
b.current = e, typeof y == "function" ? y(e) : y && (y.current = e);
|
|
@@ -3986,7 +4517,7 @@ var dt = r(function({ value: e, onChange: r, onComplete: i, length: s = 6, mode:
|
|
|
3986
4517
|
});
|
|
3987
4518
|
//#endregion
|
|
3988
4519
|
//#region src/components/AppPageHeader.jsx
|
|
3989
|
-
function
|
|
4520
|
+
function Dt({ title: e, subtitle: r, actions: i, className: a = "", ...o }) {
|
|
3990
4521
|
return T("AppPageHeader", o), /* @__PURE__ */ n("div", {
|
|
3991
4522
|
className: `page-header${i ? " d-flex align-items-end justify-content-between" : ""}${a ? ` ${a}` : ""}`,
|
|
3992
4523
|
children: [/* @__PURE__ */ n("div", { children: [/* @__PURE__ */ t("div", {
|
|
@@ -4003,7 +4534,7 @@ function ft({ title: e, subtitle: r, actions: i, className: a = "", ...o }) {
|
|
|
4003
4534
|
}
|
|
4004
4535
|
//#endregion
|
|
4005
4536
|
//#region src/components/AppPhoneNumberInput.jsx
|
|
4006
|
-
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 }) {
|
|
4007
4538
|
T("AppPhoneNumberInput", m);
|
|
4008
4539
|
let h = c(null);
|
|
4009
4540
|
return a(() => {
|
|
@@ -4020,7 +4551,7 @@ function pt({ value: e, onChange: r, country: i, disabled: o = !1, name: s, labe
|
|
|
4020
4551
|
l && /* @__PURE__ */ n("label", {
|
|
4021
4552
|
className: "label",
|
|
4022
4553
|
htmlFor: s,
|
|
4023
|
-
children: [l, d && /* @__PURE__ */ t(
|
|
4554
|
+
children: [l, d && /* @__PURE__ */ t(Z, {})]
|
|
4024
4555
|
}),
|
|
4025
4556
|
/* @__PURE__ */ t("wui-phone", {
|
|
4026
4557
|
ref: h,
|
|
@@ -4038,7 +4569,7 @@ function pt({ value: e, onChange: r, country: i, disabled: o = !1, name: s, labe
|
|
|
4038
4569
|
}
|
|
4039
4570
|
//#endregion
|
|
4040
4571
|
//#region src/components/AppPricingCard.jsx
|
|
4041
|
-
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 }) {
|
|
4042
4573
|
return T("AppPricingCard", f), /* @__PURE__ */ n("div", {
|
|
4043
4574
|
className: [
|
|
4044
4575
|
"plan-card",
|
|
@@ -4091,9 +4622,9 @@ function mt({ name: e, price: r, unit: i, tagline: a, features: o = [], cta: s,
|
|
|
4091
4622
|
}
|
|
4092
4623
|
//#endregion
|
|
4093
4624
|
//#region src/components/AppRadio.jsx
|
|
4094
|
-
var
|
|
4625
|
+
var At = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
4095
4626
|
T("AppRadio", s);
|
|
4096
|
-
let l = o(), u = r ||
|
|
4627
|
+
let l = o(), u = r || l;
|
|
4097
4628
|
return /* @__PURE__ */ n("div", {
|
|
4098
4629
|
className: `form-check${a ? ` ${a}` : ""}`,
|
|
4099
4630
|
children: [/* @__PURE__ */ t("input", {
|
|
@@ -4112,7 +4643,7 @@ var ht = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
|
4112
4643
|
});
|
|
4113
4644
|
//#endregion
|
|
4114
4645
|
//#region src/components/AppRepeater.jsx
|
|
4115
|
-
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 }) {
|
|
4116
4647
|
T("AppRepeater", p);
|
|
4117
4648
|
let m = typeof u == "number" && e.length >= u, h = !!a && e.length > l;
|
|
4118
4649
|
return /* @__PURE__ */ n("div", {
|
|
@@ -4142,7 +4673,7 @@ function gt({ rows: e = [], renderRow: r, onAdd: i, onRemove: a, addLabel: o = "
|
|
|
4142
4673
|
})
|
|
4143
4674
|
]
|
|
4144
4675
|
}, e.id ?? i)),
|
|
4145
|
-
/* @__PURE__ */ t(
|
|
4676
|
+
/* @__PURE__ */ t(Q, {
|
|
4146
4677
|
variant: "secondary",
|
|
4147
4678
|
size: "sm",
|
|
4148
4679
|
leftIcon: "plus",
|
|
@@ -4156,7 +4687,7 @@ function gt({ rows: e = [], renderRow: r, onAdd: i, onRemove: a, addLabel: o = "
|
|
|
4156
4687
|
}
|
|
4157
4688
|
//#endregion
|
|
4158
4689
|
//#region src/components/AppResourceCard.jsx
|
|
4159
|
-
function
|
|
4690
|
+
function Mt({ icon: r, title: i, text: a, href: o, external: s = !1, linkComponent: c, className: l = "", ...u }) {
|
|
4160
4691
|
T("AppResourceCard", u);
|
|
4161
4692
|
let d = /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", {
|
|
4162
4693
|
className: "res-card-icon",
|
|
@@ -4188,14 +4719,20 @@ function _t({ icon: r, title: i, text: a, href: o, external: s = !1, linkCompone
|
|
|
4188
4719
|
}
|
|
4189
4720
|
//#endregion
|
|
4190
4721
|
//#region src/components/AppSearch.jsx
|
|
4191
|
-
function
|
|
4192
|
-
return T("AppSearch",
|
|
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 }) {
|
|
4723
|
+
return T("AppSearch", d), /* @__PURE__ */ n("div", {
|
|
4193
4724
|
className: [
|
|
4194
4725
|
"search-wrap",
|
|
4195
4726
|
e ? "has-value" : "",
|
|
4196
|
-
s
|
|
4727
|
+
s === "sm" ? "search-sm" : s === "lg" ? "search-lg" : "",
|
|
4728
|
+
c ? "is-loading" : "",
|
|
4729
|
+
u
|
|
4197
4730
|
].filter(Boolean).join(" "),
|
|
4198
4731
|
children: [
|
|
4732
|
+
c && /* @__PURE__ */ t("span", {
|
|
4733
|
+
className: "search-spinner",
|
|
4734
|
+
"aria-hidden": "true"
|
|
4735
|
+
}),
|
|
4199
4736
|
/* @__PURE__ */ t(O, {
|
|
4200
4737
|
name: "search",
|
|
4201
4738
|
size: o,
|
|
@@ -4208,9 +4745,10 @@ function vt({ value: e, onValueChange: r, placeholder: i, ariaLabel: a, iconSize
|
|
|
4208
4745
|
value: e,
|
|
4209
4746
|
onChange: (e) => r(e.target.value),
|
|
4210
4747
|
"aria-label": a,
|
|
4211
|
-
|
|
4748
|
+
disabled: l,
|
|
4749
|
+
...d
|
|
4212
4750
|
}),
|
|
4213
|
-
|
|
4751
|
+
!l && /* @__PURE__ */ t("button", {
|
|
4214
4752
|
type: "button",
|
|
4215
4753
|
className: "search-clear",
|
|
4216
4754
|
"aria-label": "Clear search",
|
|
@@ -4225,22 +4763,58 @@ function vt({ value: e, onValueChange: r, placeholder: i, ariaLabel: a, iconSize
|
|
|
4225
4763
|
}
|
|
4226
4764
|
//#endregion
|
|
4227
4765
|
//#region src/components/AppSegmented.jsx
|
|
4228
|
-
function
|
|
4229
|
-
T("AppSegmented",
|
|
4230
|
-
let
|
|
4231
|
-
|
|
4232
|
-
|
|
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,
|
|
4233
4801
|
role: "radiogroup",
|
|
4234
|
-
"aria-label":
|
|
4235
|
-
|
|
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", {
|
|
4236
4809
|
className: "segmented-option",
|
|
4237
4810
|
children: [
|
|
4238
4811
|
/* @__PURE__ */ t("input", {
|
|
4239
4812
|
type: "radio",
|
|
4240
4813
|
className: "segmented-input",
|
|
4241
|
-
name:
|
|
4814
|
+
name: _,
|
|
4242
4815
|
value: e.value,
|
|
4243
4816
|
checked: e.value === r,
|
|
4817
|
+
disabled: p || e.disabled,
|
|
4244
4818
|
onChange: () => i?.(e.value)
|
|
4245
4819
|
}),
|
|
4246
4820
|
e.icon && /* @__PURE__ */ t(O, {
|
|
@@ -4249,84 +4823,86 @@ function yt({ options: e = [], value: r, onChange: i, label: a, name: s, size: c
|
|
|
4249
4823
|
}),
|
|
4250
4824
|
e.label
|
|
4251
4825
|
]
|
|
4252
|
-
}, e.value))
|
|
4826
|
+
}, e.value))]
|
|
4253
4827
|
});
|
|
4254
4828
|
}
|
|
4255
4829
|
//#endregion
|
|
4256
4830
|
//#region src/components/AppSelect.jsx
|
|
4257
|
-
var
|
|
4258
|
-
function
|
|
4259
|
-
T("AppSelect",
|
|
4260
|
-
let
|
|
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 }) {
|
|
4833
|
+
T("AppSelect", E);
|
|
4834
|
+
let D = c(null);
|
|
4261
4835
|
a(() => {
|
|
4262
|
-
|
|
4836
|
+
D.current && (D.current.options = i.map((e) => ({
|
|
4263
4837
|
value: e.value,
|
|
4264
|
-
label:
|
|
4838
|
+
label: Ft(e),
|
|
4839
|
+
icon: e.icon
|
|
4265
4840
|
})));
|
|
4266
4841
|
}, [i]), a(() => {
|
|
4267
|
-
let t =
|
|
4842
|
+
let t = D.current;
|
|
4268
4843
|
t && String(t.value ?? "") !== String(e ?? "") && (t.value = e ?? "");
|
|
4269
4844
|
}, [e]), a(() => {
|
|
4270
|
-
let e =
|
|
4845
|
+
let e = D.current;
|
|
4271
4846
|
if (!e) return;
|
|
4272
4847
|
let t = () => r?.(e.value);
|
|
4273
4848
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
4274
4849
|
}, [r]);
|
|
4275
|
-
let
|
|
4276
|
-
"aria-label": typeof
|
|
4277
|
-
ref:
|
|
4278
|
-
id:
|
|
4279
|
-
name:
|
|
4280
|
-
placeholder:
|
|
4850
|
+
let O = /* @__PURE__ */ t("wui-select", {
|
|
4851
|
+
"aria-label": typeof h == "string" ? h : void 0,
|
|
4852
|
+
ref: D,
|
|
4853
|
+
id: x || S,
|
|
4854
|
+
name: S,
|
|
4855
|
+
placeholder: p ? " " : o,
|
|
4281
4856
|
"search-placeholder": s,
|
|
4282
4857
|
searchable: l ? "" : void 0,
|
|
4283
4858
|
clearable: u ? "" : void 0,
|
|
4284
4859
|
size: d || void 0,
|
|
4285
|
-
|
|
4286
|
-
|
|
4860
|
+
icon: f || void 0,
|
|
4861
|
+
disabled: m ? "" : void 0,
|
|
4862
|
+
required: g ? "" : void 0
|
|
4287
4863
|
});
|
|
4288
|
-
if (!
|
|
4289
|
-
let
|
|
4864
|
+
if (!h && !_ && !v) return O;
|
|
4865
|
+
let k = x || S, A = p && h;
|
|
4290
4866
|
return /* @__PURE__ */ n("div", {
|
|
4291
4867
|
className: [
|
|
4292
4868
|
"field",
|
|
4293
|
-
|
|
4294
|
-
|
|
4869
|
+
C,
|
|
4870
|
+
w
|
|
4295
4871
|
].filter(Boolean).join(" "),
|
|
4296
4872
|
children: [
|
|
4297
|
-
|
|
4873
|
+
h && !A && /* @__PURE__ */ n("label", {
|
|
4298
4874
|
className: "label",
|
|
4299
|
-
htmlFor:
|
|
4875
|
+
htmlFor: k,
|
|
4300
4876
|
children: [
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
label:
|
|
4305
|
-
children:
|
|
4877
|
+
h,
|
|
4878
|
+
g && /* @__PURE__ */ t(Z, {}),
|
|
4879
|
+
y && /* @__PURE__ */ t(Xe, {
|
|
4880
|
+
label: b,
|
|
4881
|
+
children: y
|
|
4306
4882
|
})
|
|
4307
4883
|
]
|
|
4308
4884
|
}),
|
|
4309
|
-
|
|
4885
|
+
A ? /* @__PURE__ */ n("div", {
|
|
4310
4886
|
className: "field-float",
|
|
4311
|
-
children: [
|
|
4887
|
+
children: [O, /* @__PURE__ */ n("label", {
|
|
4312
4888
|
className: "float-label",
|
|
4313
|
-
htmlFor:
|
|
4314
|
-
children: [
|
|
4889
|
+
htmlFor: k,
|
|
4890
|
+
children: [h, g && /* @__PURE__ */ t(Z, {})]
|
|
4315
4891
|
})]
|
|
4316
|
-
}) :
|
|
4317
|
-
|
|
4892
|
+
}) : O,
|
|
4893
|
+
_ ? /* @__PURE__ */ t("div", {
|
|
4318
4894
|
className: "field-error",
|
|
4319
|
-
children: g
|
|
4320
|
-
}) : _ ? /* @__PURE__ */ t("div", {
|
|
4321
|
-
className: "field-hint",
|
|
4322
4895
|
children: _
|
|
4896
|
+
}) : v ? /* @__PURE__ */ t("div", {
|
|
4897
|
+
className: "field-hint",
|
|
4898
|
+
children: v
|
|
4323
4899
|
}) : null
|
|
4324
4900
|
]
|
|
4325
4901
|
});
|
|
4326
4902
|
}
|
|
4327
4903
|
//#endregion
|
|
4328
4904
|
//#region src/components/AppShell.jsx
|
|
4329
|
-
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 = "", ..._ }) {
|
|
4330
4906
|
T("AppShell", _);
|
|
4331
4907
|
let [v, y] = l(!1), [b, x] = l(!1), [S, C] = l(!1), w = d ?? v;
|
|
4332
4908
|
return a(() => {
|
|
@@ -4362,7 +4938,7 @@ function St({ groups: e = [], brand: r, sidebarFooter: i, topbarStart: o, topbar
|
|
|
4362
4938
|
children: [e.label && /* @__PURE__ */ t("div", {
|
|
4363
4939
|
className: "app-nav-group-label",
|
|
4364
4940
|
children: e.label
|
|
4365
|
-
}), e.items.map((e) => /* @__PURE__ */ t(
|
|
4941
|
+
}), e.items.map((e) => /* @__PURE__ */ t(Rt, {
|
|
4366
4942
|
item: e,
|
|
4367
4943
|
linkComponent: h,
|
|
4368
4944
|
onNavigate: () => x(!1)
|
|
@@ -4432,7 +5008,7 @@ function St({ groups: e = [], brand: r, sidebarFooter: i, topbarStart: o, topbar
|
|
|
4432
5008
|
]
|
|
4433
5009
|
});
|
|
4434
5010
|
}
|
|
4435
|
-
function
|
|
5011
|
+
function Rt({ item: r, linkComponent: i, onNavigate: a }) {
|
|
4436
5012
|
let o = `app-nav-item${r.active ? " active" : ""}`, s = /* @__PURE__ */ n(e, { children: [
|
|
4437
5013
|
r.icon && /* @__PURE__ */ t("span", {
|
|
4438
5014
|
className: "app-nav-icon",
|
|
@@ -4466,7 +5042,7 @@ function Ct({ item: r, linkComponent: i, onNavigate: a }) {
|
|
|
4466
5042
|
}
|
|
4467
5043
|
//#endregion
|
|
4468
5044
|
//#region src/components/AppSidebarMenu.jsx
|
|
4469
|
-
var
|
|
5045
|
+
var zt = {
|
|
4470
5046
|
left: "start",
|
|
4471
5047
|
right: "end",
|
|
4472
5048
|
start: "start",
|
|
@@ -4474,11 +5050,11 @@ var wt = {
|
|
|
4474
5050
|
top: "top",
|
|
4475
5051
|
bottom: "bottom"
|
|
4476
5052
|
};
|
|
4477
|
-
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 }) {
|
|
4478
5054
|
return T("AppSidebarMenu", b), /* @__PURE__ */ n(y, {
|
|
4479
5055
|
show: e,
|
|
4480
5056
|
onHide: r,
|
|
4481
|
-
placement:
|
|
5057
|
+
placement: zt[i] || "end",
|
|
4482
5058
|
backdrop: d,
|
|
4483
5059
|
scroll: f,
|
|
4484
5060
|
keyboard: p,
|
|
@@ -4498,7 +5074,7 @@ function Tt({ show: e, onHide: r, side: i = "right", title: a, titleIcon: o, hea
|
|
|
4498
5074
|
size: 18
|
|
4499
5075
|
})
|
|
4500
5076
|
}), a]
|
|
4501
|
-
}), m && /* @__PURE__ */ t(
|
|
5077
|
+
}), m && /* @__PURE__ */ t(Q, {
|
|
4502
5078
|
variant: "ghost",
|
|
4503
5079
|
className: "btn-icon",
|
|
4504
5080
|
onClick: r,
|
|
@@ -4522,7 +5098,7 @@ function Tt({ show: e, onHide: r, side: i = "right", title: a, titleIcon: o, hea
|
|
|
4522
5098
|
}
|
|
4523
5099
|
//#endregion
|
|
4524
5100
|
//#region src/components/AppSpinner.jsx
|
|
4525
|
-
function
|
|
5101
|
+
function Vt({ size: e = "md", label: n = "Loading", className: r = "", ...i }) {
|
|
4526
5102
|
return T("AppSpinner", i), /* @__PURE__ */ t("span", {
|
|
4527
5103
|
className: `spinner-border${e === "sm" ? " spinner-border-sm" : ""}${r ? ` ${r}` : ""}`,
|
|
4528
5104
|
role: "status",
|
|
@@ -4531,7 +5107,7 @@ function Et({ size: e = "md", label: n = "Loading", className: r = "", ...i }) {
|
|
|
4531
5107
|
}
|
|
4532
5108
|
//#endregion
|
|
4533
5109
|
//#region src/components/AppSplash.jsx
|
|
4534
|
-
function
|
|
5110
|
+
function Ht({ logo: e, initials: r, text: i, label: a = "Loading", className: o = "", ...s }) {
|
|
4535
5111
|
return T("AppSplash", s), /* @__PURE__ */ t("div", {
|
|
4536
5112
|
className: `splash${o ? ` ${o}` : ""}`,
|
|
4537
5113
|
role: "status",
|
|
@@ -4558,7 +5134,7 @@ function Dt({ logo: e, initials: r, text: i, label: a = "Loading", className: o
|
|
|
4558
5134
|
}
|
|
4559
5135
|
//#endregion
|
|
4560
5136
|
//#region src/components/AppStatusBadge.jsx
|
|
4561
|
-
function
|
|
5137
|
+
function Ut({ label: e, tone: n = "neutral", className: r = "", ...i }) {
|
|
4562
5138
|
return T("AppStatusBadge", i), e == null || e === "" ? "—" : /* @__PURE__ */ t("span", {
|
|
4563
5139
|
className: `status-label ${n}${r ? ` ${r}` : ""}`,
|
|
4564
5140
|
children: e
|
|
@@ -4566,7 +5142,7 @@ function Ot({ label: e, tone: n = "neutral", className: r = "", ...i }) {
|
|
|
4566
5142
|
}
|
|
4567
5143
|
//#endregion
|
|
4568
5144
|
//#region src/components/AppStepper.jsx
|
|
4569
|
-
function
|
|
5145
|
+
function Wt({ steps: r = [], variant: i = "steps", label: a = "Progress", linkComponent: o, className: s = "", ...c }) {
|
|
4570
5146
|
return T("AppStepper", c), /* @__PURE__ */ t("nav", {
|
|
4571
5147
|
className: [i === "journey" ? "stepper stepper-journey" : "stepper", s].filter(Boolean).join(" "),
|
|
4572
5148
|
"aria-label": a,
|
|
@@ -4613,7 +5189,7 @@ function kt({ steps: r = [], variant: i = "steps", label: a = "Progress", linkCo
|
|
|
4613
5189
|
}
|
|
4614
5190
|
//#endregion
|
|
4615
5191
|
//#region src/components/AppSwitch.jsx
|
|
4616
|
-
var
|
|
5192
|
+
var Gt = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
4617
5193
|
T("AppSwitch", s);
|
|
4618
5194
|
let l = o(), u = r || i || l;
|
|
4619
5195
|
return /* @__PURE__ */ n("div", {
|
|
@@ -4634,7 +5210,7 @@ var At = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
|
4634
5210
|
});
|
|
4635
5211
|
//#endregion
|
|
4636
5212
|
//#region src/components/AppTableEmptyState.jsx
|
|
4637
|
-
function
|
|
5213
|
+
function Kt({ icon: e, title: r, text: i, action: a, ...o }) {
|
|
4638
5214
|
return T("AppTableEmptyState", o), /* @__PURE__ */ n("div", {
|
|
4639
5215
|
className: "tbl-empty",
|
|
4640
5216
|
children: [
|
|
@@ -4662,7 +5238,7 @@ function jt({ icon: e, title: r, text: i, action: a, ...o }) {
|
|
|
4662
5238
|
}
|
|
4663
5239
|
//#endregion
|
|
4664
5240
|
//#region src/components/AppTabs.jsx
|
|
4665
|
-
function
|
|
5241
|
+
function qt({ tabs: e, value: r, onChange: i, variant: a = "underline", ariaLabel: o, className: s = "", ...l }) {
|
|
4666
5242
|
T("AppTabs", l);
|
|
4667
5243
|
let u = c(null);
|
|
4668
5244
|
function d(t) {
|
|
@@ -4706,7 +5282,7 @@ function Mt({ tabs: e, value: r, onChange: i, variant: a = "underline", ariaLabe
|
|
|
4706
5282
|
}
|
|
4707
5283
|
//#endregion
|
|
4708
5284
|
//#region src/components/AppTextarea.jsx
|
|
4709
|
-
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) {
|
|
4710
5286
|
T("AppTextarea", v);
|
|
4711
5287
|
let b = d || f, x = [
|
|
4712
5288
|
"textarea",
|
|
@@ -4737,8 +5313,8 @@ var Nt = r(function({ label: e, required: r = !1, error: a, hint: o, help: l, he
|
|
|
4737
5313
|
htmlFor: b,
|
|
4738
5314
|
children: [
|
|
4739
5315
|
e,
|
|
4740
|
-
r && /* @__PURE__ */ t(
|
|
4741
|
-
l && /* @__PURE__ */ t(
|
|
5316
|
+
r && /* @__PURE__ */ t(Z, {}),
|
|
5317
|
+
l && /* @__PURE__ */ t(Xe, {
|
|
4742
5318
|
label: u,
|
|
4743
5319
|
children: l
|
|
4744
5320
|
})
|
|
@@ -4768,7 +5344,7 @@ var Nt = r(function({ label: e, required: r = !1, error: a, hint: o, help: l, he
|
|
|
4768
5344
|
});
|
|
4769
5345
|
//#endregion
|
|
4770
5346
|
//#region src/components/AppTimeline.jsx
|
|
4771
|
-
function
|
|
5347
|
+
function Yt({ items: e = [], className: r = "", ...i }) {
|
|
4772
5348
|
return T("AppTimeline", i), /* @__PURE__ */ t("ol", {
|
|
4773
5349
|
className: `timeline${r ? ` ${r}` : ""}`,
|
|
4774
5350
|
children: e.map((e, r) => /* @__PURE__ */ n("li", {
|
|
@@ -4806,4 +5382,4 @@ function Pt({ items: e = [], className: r = "", ...i }) {
|
|
|
4806
5382
|
});
|
|
4807
5383
|
}
|
|
4808
5384
|
//#endregion
|
|
4809
|
-
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 };
|