@webority/ui-react 0.6.6 → 0.6.8
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.
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import '@webority/ui-elements';
|
|
2
|
+
/**
|
|
3
|
+
* Code entry — MFA, email/phone verification, backup codes. Thin React wrapper over the
|
|
4
|
+
* shared `<wui-otp>` element, in the standard `.field` shell.
|
|
5
|
+
*
|
|
6
|
+
* It is ONE input with the segment boxes drawn underneath, not N inputs. That is what makes
|
|
7
|
+
* OS autofill work (iOS/Android hand an SMS code to the focused field, whole — six inputs
|
|
8
|
+
* get all six digits in box one or just the first, depending on version) and what makes a
|
|
9
|
+
* screen reader announce one labelled field instead of six unlabelled boxes. Paste is not a
|
|
10
|
+
* special case for the same reason.
|
|
11
|
+
*
|
|
12
|
+
* Scope is the INPUT, not the screen: resend timers, "didn't get a code" copy, masked
|
|
13
|
+
* destination text, lockout after N attempts and where to go on success are all product
|
|
14
|
+
* decisions and stay in the product.
|
|
15
|
+
*
|
|
16
|
+
* @param {object} props
|
|
17
|
+
* @param {string} [props.value]
|
|
18
|
+
* @param {(value: string) => void} [props.onChange]
|
|
19
|
+
* @param {(value: string) => void} [props.onComplete] Fires once, when the last character
|
|
20
|
+
* lands — so a form can submit itself without polling the value.
|
|
21
|
+
* @param {number} [props.length=6] Characters in the code. TOTP is 6; backup codes are often 8.
|
|
22
|
+
* @param {"numeric"|"alphanumeric"} [props.mode="numeric"] Drives the on-screen keyboard and
|
|
23
|
+
* what the field will accept.
|
|
24
|
+
* @param {string} [props.label]
|
|
25
|
+
* @param {boolean} [props.required=false]
|
|
26
|
+
* @param {string} [props.hint]
|
|
27
|
+
* @param {string} [props.error]
|
|
28
|
+
* @param {boolean} [props.disabled=false]
|
|
29
|
+
* @param {string} [props.name]
|
|
30
|
+
* @param {string} [props.id]
|
|
31
|
+
* @param {string} [props.className]
|
|
32
|
+
* @param {import('react').Ref<HTMLElement>} [ref]
|
|
33
|
+
*/
|
|
34
|
+
declare const AppOtpInput: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
|
|
35
|
+
export default AppOtpInput;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import '@webority/ui-elements';
|
|
2
|
-
export default function AppSelect({ value, onChange, options, placeholder, searchPlaceholder, searchable, disabled, label, required, error, hint, help, helpLabel, id, name, fieldClassName, ...rest }: {
|
|
2
|
+
export default function AppSelect({ value, onChange, options, placeholder, searchPlaceholder, searchable, clearable, size, floatingLabel, disabled, label, required, error, hint, help, helpLabel, id, name, className, fieldClassName, ...rest }: {
|
|
3
3
|
[x: string]: any;
|
|
4
|
+
className?: string;
|
|
5
|
+
clearable?: boolean;
|
|
4
6
|
disabled: any;
|
|
5
7
|
error: any;
|
|
6
8
|
fieldClassName?: string;
|
|
9
|
+
floatingLabel?: boolean;
|
|
7
10
|
help: any;
|
|
8
11
|
helpLabel?: string;
|
|
9
12
|
hint: any;
|
|
@@ -16,5 +19,6 @@ export default function AppSelect({ value, onChange, options, placeholder, searc
|
|
|
16
19
|
required?: boolean;
|
|
17
20
|
searchPlaceholder?: string;
|
|
18
21
|
searchable?: boolean;
|
|
22
|
+
size: any;
|
|
19
23
|
value: any;
|
|
20
24
|
}): import("react").JSX.Element;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export { default as AppKpiTile } from './components/AppKpiTile.jsx';
|
|
|
27
27
|
export { default as AppLogoPicker } from './components/AppLogoPicker.jsx';
|
|
28
28
|
export { default as AppModal } from './components/AppModal.jsx';
|
|
29
29
|
export { default as AppMultiSelect } from './components/AppMultiSelect.jsx';
|
|
30
|
+
export { default as AppOtpInput } from './components/AppOtpInput.jsx';
|
|
30
31
|
export { default as AppPageHeader } from './components/AppPageHeader.jsx';
|
|
31
32
|
export { default as AppPhoneNumberInput } from './components/AppPhoneNumberInput.jsx';
|
|
32
33
|
export { default as AppPricingCard } from './components/AppPricingCard.jsx';
|
package/dist/ui-react.js
CHANGED
|
@@ -550,6 +550,12 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
550
550
|
<div class="datepicker-grid">${s}</div>
|
|
551
551
|
<div class="datepicker-foot"><button type="button" class="datepicker-link" data-clear>Clear</button></div>`;
|
|
552
552
|
}
|
|
553
|
+
_position(e, t) {
|
|
554
|
+
let n = e.getBoundingClientRect(), r = t.offsetHeight, i = window.innerHeight - n.bottom, a = i < r + 4 && n.top > i;
|
|
555
|
+
t.classList.toggle("drop-up", a), t.style.position = "fixed", t.style.top = a ? `${Math.max(4, n.top - r - 4)}px` : `${n.bottom + 4}px`;
|
|
556
|
+
let o = t.offsetWidth, s = Math.min(n.left, window.innerWidth - o - 4);
|
|
557
|
+
t.style.left = `${Math.max(4, s)}px`;
|
|
558
|
+
}
|
|
553
559
|
_wire() {
|
|
554
560
|
let e = this.querySelector(".datepicker-trigger"), t = this.querySelector(".datepicker-pop");
|
|
555
561
|
if (!e || !t) return;
|
|
@@ -558,7 +564,7 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
558
564
|
let e = /* @__PURE__ */ new Date();
|
|
559
565
|
this._viewY = e.getFullYear(), this._viewM = e.getMonth();
|
|
560
566
|
}
|
|
561
|
-
this._renderMonth(), t.hidden = !1, e.setAttribute("aria-expanded", "true");
|
|
567
|
+
this._renderMonth(), t.hidden = !1, this._position(e, t), e.setAttribute("aria-expanded", "true");
|
|
562
568
|
}, i = () => {
|
|
563
569
|
t.hidden = !0, e.setAttribute("aria-expanded", "false");
|
|
564
570
|
};
|
|
@@ -739,7 +745,103 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
739
745
|
disconnectedCallback() {
|
|
740
746
|
this._onDocClick && document.removeEventListener("click", this._onDocClick);
|
|
741
747
|
}
|
|
742
|
-
}, W = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), G = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), oe = [
|
|
748
|
+
}, W = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), G = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), oe = /[^0-9]/g, se = /[^0-9a-zA-Z]/g, ce = class extends HTMLElement {
|
|
749
|
+
static get observedAttributes() {
|
|
750
|
+
return [
|
|
751
|
+
"value",
|
|
752
|
+
"length",
|
|
753
|
+
"mode",
|
|
754
|
+
"disabled",
|
|
755
|
+
"aria-label"
|
|
756
|
+
];
|
|
757
|
+
}
|
|
758
|
+
get length() {
|
|
759
|
+
let e = Number.parseInt(this.getAttribute("length") ?? "6", 10);
|
|
760
|
+
return Number.isFinite(e) && e > 0 ? e : 6;
|
|
761
|
+
}
|
|
762
|
+
set length(e) {
|
|
763
|
+
this.setAttribute("length", String(e));
|
|
764
|
+
}
|
|
765
|
+
get mode() {
|
|
766
|
+
return this.getAttribute("mode") === "alphanumeric" ? "alphanumeric" : "numeric";
|
|
767
|
+
}
|
|
768
|
+
set mode(e) {
|
|
769
|
+
this.setAttribute("mode", String(e ?? "numeric"));
|
|
770
|
+
}
|
|
771
|
+
get value() {
|
|
772
|
+
return this._value ?? "";
|
|
773
|
+
}
|
|
774
|
+
set value(e) {
|
|
775
|
+
this._value = this._clean(e), P(this, this._value), this._paint();
|
|
776
|
+
}
|
|
777
|
+
_clean(e) {
|
|
778
|
+
return (e == null ? "" : String(e)).replace(this.mode === "alphanumeric" ? se : oe, "").slice(0, this.length);
|
|
779
|
+
}
|
|
780
|
+
connectedCallback() {
|
|
781
|
+
this._rendered || this.render();
|
|
782
|
+
}
|
|
783
|
+
attributeChangedCallback(e, t, n) {
|
|
784
|
+
this._rendered && (e === "value" ? (this._value = this._clean(n), P(this, this._value), this._paint()) : this.render());
|
|
785
|
+
}
|
|
786
|
+
render() {
|
|
787
|
+
this._value = this._clean(this.getAttribute("value") ?? this._value);
|
|
788
|
+
let e = this.length, t = this.mode === "numeric", n = this.hasAttribute("disabled"), r = Array.from({ length: e }, () => "<span class=\"otp-slot\" aria-hidden=\"true\"></span>").join(""), i = this.getAttribute("aria-label"), a = i ? ` aria-label="${i.replace(/"/g, """)}"` : "";
|
|
789
|
+
this.innerHTML = `
|
|
790
|
+
<div class="otp">
|
|
791
|
+
<input
|
|
792
|
+
class="otp-field"
|
|
793
|
+
type="text"
|
|
794
|
+
autocomplete="one-time-code"
|
|
795
|
+
inputmode="${t ? "numeric" : "text"}"
|
|
796
|
+
${t ? "pattern=\"[0-9]*\"" : ""}${a}
|
|
797
|
+
autocapitalize="off"
|
|
798
|
+
autocorrect="off"
|
|
799
|
+
spellcheck="false"
|
|
800
|
+
${n ? "disabled" : ""} />
|
|
801
|
+
<div class="otp-slots" aria-hidden="true">${r}</div>
|
|
802
|
+
</div>`, this._rendered = !0, P(this, this._value), this._wire(), this._paint();
|
|
803
|
+
}
|
|
804
|
+
_refs() {
|
|
805
|
+
return {
|
|
806
|
+
input: this.querySelector(".otp-field"),
|
|
807
|
+
slots: [...this.querySelectorAll(".otp-slot")]
|
|
808
|
+
};
|
|
809
|
+
}
|
|
810
|
+
_paint() {
|
|
811
|
+
let { input: e, slots: t } = this._refs();
|
|
812
|
+
if (!e || !t.length) return;
|
|
813
|
+
e.value !== this._value && (e.value = this._value);
|
|
814
|
+
let n = e.selectionStart ?? this._value.length, r = Math.min(n, t.length - 1), i = document.activeElement === e;
|
|
815
|
+
t.forEach((e, t) => {
|
|
816
|
+
e.textContent = this._value[t] ?? "", e.classList.toggle("filled", !!this._value[t]), e.classList.toggle("active", i && t === r);
|
|
817
|
+
});
|
|
818
|
+
}
|
|
819
|
+
_wire() {
|
|
820
|
+
let { input: e } = this._refs();
|
|
821
|
+
if (!e) return;
|
|
822
|
+
let t = (e) => {
|
|
823
|
+
let t = this._clean(e), n = t !== this._value;
|
|
824
|
+
this._value = t, P(this, this._value), this._paint(), n && this.dispatchEvent(new Event("change", { bubbles: !0 })), n && t.length === this.length && this.dispatchEvent(new CustomEvent("complete", {
|
|
825
|
+
bubbles: !0,
|
|
826
|
+
detail: t
|
|
827
|
+
}));
|
|
828
|
+
};
|
|
829
|
+
e.addEventListener("input", () => t(e.value)), e.addEventListener("paste", (e) => {
|
|
830
|
+
let n = e.clipboardData?.getData("text");
|
|
831
|
+
n != null && (e.preventDefault(), t(n));
|
|
832
|
+
});
|
|
833
|
+
for (let t of [
|
|
834
|
+
"keyup",
|
|
835
|
+
"click",
|
|
836
|
+
"focus",
|
|
837
|
+
"blur",
|
|
838
|
+
"select"
|
|
839
|
+
]) e.addEventListener(t, () => this._paint());
|
|
840
|
+
document.addEventListener("selectionchange", () => {
|
|
841
|
+
document.activeElement === e && this._paint();
|
|
842
|
+
});
|
|
843
|
+
}
|
|
844
|
+
}, le = [
|
|
743
845
|
[
|
|
744
846
|
"AF",
|
|
745
847
|
"Afghanistan",
|
|
@@ -1965,11 +2067,11 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
1965
2067
|
"Zimbabwe",
|
|
1966
2068
|
"263"
|
|
1967
2069
|
]
|
|
1968
|
-
], K = (e) => (
|
|
2070
|
+
], K = (e) => (le.find((t) => t[0] === e) || [
|
|
1969
2071
|
"",
|
|
1970
2072
|
"",
|
|
1971
2073
|
""
|
|
1972
|
-
])[2], q = (e) => `wui-flag wui-flag-${String(e).toLowerCase()}`,
|
|
2074
|
+
])[2], q = (e) => `wui-flag wui-flag-${String(e).toLowerCase()}`, ue = class extends HTMLElement {
|
|
1973
2075
|
static get observedAttributes() {
|
|
1974
2076
|
return [
|
|
1975
2077
|
"value",
|
|
@@ -1999,7 +2101,7 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
1999
2101
|
render() {
|
|
2000
2102
|
let e = this.getAttribute("placeholder") || "Enter phone number";
|
|
2001
2103
|
this._country = this.getAttribute("country") || this._country;
|
|
2002
|
-
let t =
|
|
2104
|
+
let t = le.map(([e, t, n]) => `<button type="button" role="option" class="country-dropdown-item${e === this._country ? " selected" : ""}" data-iso="${e}"><span class="${q(e)}" aria-hidden="true"></span><span class="country-name-text">${t}<span class="country-code-text">+${n}</span></span></button>`).join("");
|
|
2003
2105
|
this.innerHTML = `
|
|
2004
2106
|
<div class="phone-input-wrap">
|
|
2005
2107
|
<div class="phone-country-adornment">
|
|
@@ -2013,7 +2115,7 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2013
2115
|
<div class="country-list-scroll">${t}<div class="country-empty" hidden>No countries found</div></div>
|
|
2014
2116
|
</div>
|
|
2015
2117
|
</div>
|
|
2016
|
-
<input type="tel" class="input" placeholder="${
|
|
2118
|
+
<input type="tel" class="input" placeholder="${de(e)}" value="${de(this._national)}"${this.hasAttribute("disabled") ? " disabled" : ""} />
|
|
2017
2119
|
</div>`, this._rendered = !0, P(this, this.value), this._wire();
|
|
2018
2120
|
}
|
|
2019
2121
|
_wire() {
|
|
@@ -2054,7 +2156,7 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2054
2156
|
disconnectedCallback() {
|
|
2055
2157
|
this._reposition && (window.removeEventListener("scroll", this._reposition, !0), window.removeEventListener("resize", this._reposition)), this._onDocClick && document.removeEventListener("click", this._onDocClick);
|
|
2056
2158
|
}
|
|
2057
|
-
},
|
|
2159
|
+
}, de = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), fe = class extends HTMLElement {
|
|
2058
2160
|
static get observedAttributes() {
|
|
2059
2161
|
return [
|
|
2060
2162
|
"value",
|
|
@@ -2063,6 +2165,8 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2063
2165
|
"searchable",
|
|
2064
2166
|
"disabled",
|
|
2065
2167
|
"compact",
|
|
2168
|
+
"size",
|
|
2169
|
+
"clearable",
|
|
2066
2170
|
"aria-label"
|
|
2067
2171
|
];
|
|
2068
2172
|
}
|
|
@@ -2082,7 +2186,7 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2082
2186
|
return this._value;
|
|
2083
2187
|
}
|
|
2084
2188
|
set value(e) {
|
|
2085
|
-
this._value = e == null ? "" : String(e), P(this, this._value), this._syncSelected();
|
|
2189
|
+
this._value = e == null ? "" : String(e), P(this, this._value), this._syncSelected(), this._syncReset();
|
|
2086
2190
|
}
|
|
2087
2191
|
set options(e) {
|
|
2088
2192
|
this._optionsProp = Array.isArray(e) ? e : null, this.isConnected && this.render();
|
|
@@ -2105,29 +2209,31 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2105
2209
|
}
|
|
2106
2210
|
render() {
|
|
2107
2211
|
this._snapshotDeclared();
|
|
2108
|
-
let e = this._readOptions(), t = this.hasAttribute("searchable"), n = this.getAttribute("placeholder") || "Select...",
|
|
2109
|
-
|
|
2110
|
-
let
|
|
2212
|
+
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...", o = this.getAttribute("search-placeholder") || "Search...", s = e.find((e) => String(e.value) === String(this._value)) || e.find((e) => e.selected);
|
|
2213
|
+
s && (this._value = String(s.value)), P(this, this._value);
|
|
2214
|
+
let c = e.map((e) => {
|
|
2111
2215
|
let t = String(e.value) === String(this._value);
|
|
2112
2216
|
return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${J(e.value)}" aria-selected="${t}">${L(e)}</button>`;
|
|
2113
2217
|
}).join("");
|
|
2114
2218
|
this.innerHTML = `
|
|
2115
|
-
<div class="search-select${this.hasAttribute("compact") ? " search-select-compact" : ""}">
|
|
2219
|
+
<div class="search-select${this.hasAttribute("compact") ? " search-select-compact" : ""}${i}">
|
|
2116
2220
|
<button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false" aria-label="${J(this._accessibleName())}"${this.hasAttribute("disabled") ? " disabled" : ""}>
|
|
2117
|
-
<span class="${
|
|
2221
|
+
<span class="${s ? "" : "search-select-placeholder"}" data-label>${s ? L(s) : I(a)}</span>
|
|
2222
|
+
${n ? "<span class=\"search-select-reset\" role=\"button\" aria-label=\"Clear selection\" hidden><i class=\"bi bi-x-lg\" aria-hidden=\"true\"></i></span>" : ""}
|
|
2118
2223
|
<i class="bi bi-chevron-down search-select-caret" aria-hidden="true"></i>
|
|
2119
2224
|
</button>
|
|
2120
2225
|
<div class="search-select-menu search-select-menu-fixed" role="listbox" tabindex="-1" hidden>
|
|
2121
|
-
${t ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${J(
|
|
2122
|
-
<div class="search-select-options">${
|
|
2226
|
+
${t ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${J(o)}" 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>` : ""}
|
|
2227
|
+
<div class="search-select-options">${c}<div class="search-select-empty" hidden>No matches</div></div>
|
|
2123
2228
|
</div>
|
|
2124
|
-
</div>`, this._rendered = !0, P(this, this._value), this._wire();
|
|
2229
|
+
</div>`, this._rendered = !0, P(this, this._value), this._wire(), this._syncReset();
|
|
2125
2230
|
}
|
|
2126
2231
|
_refs() {
|
|
2127
2232
|
return {
|
|
2128
2233
|
control: this.querySelector(".search-select-control"),
|
|
2129
2234
|
menu: this.querySelector(".search-select-menu"),
|
|
2130
2235
|
label: this.querySelector("[data-label]"),
|
|
2236
|
+
reset: this.querySelector(".search-select-reset"),
|
|
2131
2237
|
search: this.querySelector(".search-select-input"),
|
|
2132
2238
|
clear: this.querySelector(".search-select-clear"),
|
|
2133
2239
|
empty: this.querySelector(".search-select-empty"),
|
|
@@ -2148,6 +2254,10 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2148
2254
|
}
|
|
2149
2255
|
e && (e.innerHTML = t ? L(t) : e.innerHTML, e.classList.toggle("search-select-placeholder", !t));
|
|
2150
2256
|
}
|
|
2257
|
+
_syncReset() {
|
|
2258
|
+
let { reset: e } = this._refs();
|
|
2259
|
+
e && (e.hidden = !(this.hasAttribute("clearable") && this._value !== "" && !this.hasAttribute("disabled")));
|
|
2260
|
+
}
|
|
2151
2261
|
_wire() {
|
|
2152
2262
|
let e = this._refs();
|
|
2153
2263
|
if (!e.control || !e.menu) return;
|
|
@@ -2176,7 +2286,9 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2176
2286
|
let r = this._visible();
|
|
2177
2287
|
t.key === "ArrowDown" ? (t.preventDefault(), n(Math.min(this._active + 1, r.length - 1))) : t.key === "ArrowUp" ? (t.preventDefault(), n(Math.max(this._active - 1, 0))) : t.key === "Enter" ? (t.preventDefault(), r[this._active] && s(r[this._active])) : t.key === "Escape" && (o(), e.control.focus());
|
|
2178
2288
|
};
|
|
2179
|
-
e.
|
|
2289
|
+
e.reset?.addEventListener("click", (t) => {
|
|
2290
|
+
t.stopPropagation(), this.value = "", this.dispatchEvent(new Event("change", { bubbles: !0 })), e.control.focus();
|
|
2291
|
+
}), e.control.addEventListener("click", () => i() ? o() : a()), e.control.addEventListener("keydown", (e) => {
|
|
2180
2292
|
if (i()) {
|
|
2181
2293
|
c(e);
|
|
2182
2294
|
return;
|
|
@@ -2188,7 +2300,7 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2188
2300
|
}), e.optionsWrap.addEventListener("mousemove", (e) => {
|
|
2189
2301
|
let t = e.target.closest(".search-select-option");
|
|
2190
2302
|
t && n(this._visible().indexOf(t));
|
|
2191
|
-
}), e.search?.addEventListener("input", () => {
|
|
2303
|
+
}), e.optionsWrap.addEventListener("mouseleave", () => n(-1)), e.search?.addEventListener("input", () => {
|
|
2192
2304
|
r(e.search.value), n(-1);
|
|
2193
2305
|
}), e.search?.addEventListener("keydown", c), e.clear?.addEventListener("click", () => {
|
|
2194
2306
|
e.search.value = "", r(""), e.search.focus();
|
|
@@ -2201,14 +2313,14 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2201
2313
|
disconnectedCallback() {
|
|
2202
2314
|
this._onDocClick && document.removeEventListener("click", this._onDocClick);
|
|
2203
2315
|
}
|
|
2204
|
-
}, J = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"),
|
|
2316
|
+
}, J = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), pe = "image/png,image/jpeg,image/webp", me = {
|
|
2205
2317
|
"image/png": [".png"],
|
|
2206
2318
|
"image/jpeg": [".jpg", ".jpeg"],
|
|
2207
2319
|
"image/webp": [".webp"],
|
|
2208
2320
|
"image/gif": [".gif"],
|
|
2209
2321
|
"image/svg+xml": [".svg"],
|
|
2210
2322
|
"application/pdf": [".pdf"]
|
|
2211
|
-
},
|
|
2323
|
+
}, he = {
|
|
2212
2324
|
"image/png": "PNG",
|
|
2213
2325
|
"image/jpeg": "JPG",
|
|
2214
2326
|
"image/webp": "WEBP",
|
|
@@ -2222,33 +2334,33 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2222
2334
|
".gif": "GIF",
|
|
2223
2335
|
".svg": "SVG",
|
|
2224
2336
|
".pdf": "PDF"
|
|
2225
|
-
},
|
|
2226
|
-
function
|
|
2337
|
+
}, ge = (e) => String(e || "").split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
|
|
2338
|
+
function _e(e) {
|
|
2227
2339
|
let t = [];
|
|
2228
|
-
for (let n of
|
|
2229
|
-
let e =
|
|
2340
|
+
for (let n of ge(e)) {
|
|
2341
|
+
let e = he[n] || (n.startsWith(".") ? n.slice(1).toUpperCase() : n.toUpperCase());
|
|
2230
2342
|
t.includes(e) || t.push(e);
|
|
2231
2343
|
}
|
|
2232
2344
|
return t.length <= 1 ? t[0] || "supported" : `${t.slice(0, -1).join(", ")} or ${t[t.length - 1]}`;
|
|
2233
2345
|
}
|
|
2234
|
-
function
|
|
2235
|
-
let n =
|
|
2346
|
+
function ve(e, t) {
|
|
2347
|
+
let n = ge(t);
|
|
2236
2348
|
if (!n.length) return !0;
|
|
2237
2349
|
let r = (e.type || "").toLowerCase(), i = (e.name || "").toLowerCase();
|
|
2238
|
-
return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (
|
|
2350
|
+
return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (me[e] || []).some((e) => i.endsWith(e)));
|
|
2239
2351
|
}
|
|
2240
|
-
function
|
|
2352
|
+
function ye(e, t = {}) {
|
|
2241
2353
|
if (!e) return null;
|
|
2242
|
-
let n = t.accept === void 0 ?
|
|
2243
|
-
return
|
|
2354
|
+
let n = t.accept === void 0 ? pe : t.accept, r = t.maxSizeMb || 5;
|
|
2355
|
+
return ve(e, n) ? e.size > r * 1024 * 1024 ? `Keep the file under ${r} MB.` : null : `Choose a ${_e(n)} file.`;
|
|
2244
2356
|
}
|
|
2245
2357
|
var Y = (e, t) => {
|
|
2246
2358
|
typeof customElements < "u" && !customElements.get(e) && customElements.define(e, t);
|
|
2247
2359
|
};
|
|
2248
|
-
function
|
|
2249
|
-
Y("wui-select",
|
|
2360
|
+
function be() {
|
|
2361
|
+
Y("wui-select", fe), Y("wui-phone", ue), Y("wui-datepicker", ie), Y("wui-autocomplete", te), Y("wui-multiselect", ae), Y("wui-otp", ce), Y("wui-status-icon", N);
|
|
2250
2362
|
}
|
|
2251
|
-
|
|
2363
|
+
be();
|
|
2252
2364
|
//#endregion
|
|
2253
2365
|
//#region src/components/RequiredMark.jsx
|
|
2254
2366
|
function X() {
|
|
@@ -2260,7 +2372,7 @@ function X() {
|
|
|
2260
2372
|
}
|
|
2261
2373
|
//#endregion
|
|
2262
2374
|
//#region src/components/AppAutocomplete.jsx
|
|
2263
|
-
function
|
|
2375
|
+
function xe({ value: e, onChange: r, options: i, loadOptions: o, placeholder: s = "Search…", minChars: l, debounce: u, disabled: d = !1, name: f, label: p, error: m, hint: h, required: g = !1, fieldClassName: _ = "", ...v }) {
|
|
2264
2376
|
T("AppAutocomplete", v);
|
|
2265
2377
|
let y = c(null), b = typeof o == "function";
|
|
2266
2378
|
return a(() => {
|
|
@@ -2321,13 +2433,13 @@ function ve({ value: e, onChange: r, options: i, loadOptions: o, placeholder: s
|
|
|
2321
2433
|
}
|
|
2322
2434
|
//#endregion
|
|
2323
2435
|
//#region src/components/AppAvatar.jsx
|
|
2324
|
-
function
|
|
2436
|
+
function Se(e) {
|
|
2325
2437
|
let t = (e || "").trim();
|
|
2326
2438
|
if (!t) return "?";
|
|
2327
2439
|
let n = t.split(/\s+/).filter(Boolean);
|
|
2328
2440
|
return n.length === 1 ? n[0].slice(0, 2).toUpperCase() : (n[0][0] + n[n.length - 1][0]).toUpperCase();
|
|
2329
2441
|
}
|
|
2330
|
-
function
|
|
2442
|
+
function Ce({ name: e, src: n, className: r = "", ...i }) {
|
|
2331
2443
|
T("AppAvatar", i);
|
|
2332
2444
|
let a = ["avatar", r].filter(Boolean).join(" ");
|
|
2333
2445
|
return n ? /* @__PURE__ */ t("span", {
|
|
@@ -2341,12 +2453,12 @@ function be({ name: e, src: n, className: r = "", ...i }) {
|
|
|
2341
2453
|
className: a,
|
|
2342
2454
|
role: "img",
|
|
2343
2455
|
"aria-label": e,
|
|
2344
|
-
children:
|
|
2456
|
+
children: Se(e)
|
|
2345
2457
|
});
|
|
2346
2458
|
}
|
|
2347
2459
|
//#endregion
|
|
2348
2460
|
//#region src/components/AppBadge.jsx
|
|
2349
|
-
function
|
|
2461
|
+
function we({ children: e, tone: n, dot: r = !1, className: i = "", ...a }) {
|
|
2350
2462
|
return T("AppBadge", a), /* @__PURE__ */ t(d, {
|
|
2351
2463
|
bg: !1,
|
|
2352
2464
|
className: [
|
|
@@ -2360,14 +2472,14 @@ function xe({ children: e, tone: n, dot: r = !1, className: i = "", ...a }) {
|
|
|
2360
2472
|
}
|
|
2361
2473
|
//#endregion
|
|
2362
2474
|
//#region src/components/AppButton.jsx
|
|
2363
|
-
var
|
|
2475
|
+
var Te = {
|
|
2364
2476
|
primary: "primary",
|
|
2365
2477
|
secondary: "secondary",
|
|
2366
2478
|
outline: "outline-primary",
|
|
2367
2479
|
ghost: "link",
|
|
2368
2480
|
danger: "danger"
|
|
2369
2481
|
};
|
|
2370
|
-
function
|
|
2482
|
+
function Ee(e, n) {
|
|
2371
2483
|
if (!e) return null;
|
|
2372
2484
|
let r = n === "left" ? "me-2" : "ms-2";
|
|
2373
2485
|
return typeof e == "string" ? /* @__PURE__ */ t(O, {
|
|
@@ -2384,7 +2496,7 @@ function Z({ children: e, variant: r = "primary", size: i = "md", type: a = "but
|
|
|
2384
2496
|
let m = [c ? "w-100" : "", d].filter(Boolean).join(" ");
|
|
2385
2497
|
return /* @__PURE__ */ n(f, {
|
|
2386
2498
|
type: (p.as === void 0 || p.as === "button") && p.href === void 0 ? a : void 0,
|
|
2387
|
-
variant:
|
|
2499
|
+
variant: Te[r] ?? "primary",
|
|
2388
2500
|
size: i === "md" ? void 0 : i,
|
|
2389
2501
|
disabled: s || o,
|
|
2390
2502
|
className: m || void 0,
|
|
@@ -2394,15 +2506,15 @@ function Z({ children: e, variant: r = "primary", size: i = "md", type: a = "but
|
|
|
2394
2506
|
className: "spinner-border spinner-border-sm me-2",
|
|
2395
2507
|
"aria-hidden": "true"
|
|
2396
2508
|
}),
|
|
2397
|
-
!o &&
|
|
2509
|
+
!o && Ee(l, "left"),
|
|
2398
2510
|
e,
|
|
2399
|
-
!o &&
|
|
2511
|
+
!o && Ee(u, "right")
|
|
2400
2512
|
]
|
|
2401
2513
|
});
|
|
2402
2514
|
}
|
|
2403
2515
|
//#endregion
|
|
2404
2516
|
//#region src/components/AppCallout.jsx
|
|
2405
|
-
function
|
|
2517
|
+
function De({ children: e, icon: r = "info", className: i = "", ...a }) {
|
|
2406
2518
|
return T("AppCallout", a), /* @__PURE__ */ n("div", {
|
|
2407
2519
|
className: `info-callout${i ? ` ${i}` : ""}`,
|
|
2408
2520
|
children: [r && /* @__PURE__ */ t("span", {
|
|
@@ -2416,7 +2528,7 @@ function we({ children: e, icon: r = "info", className: i = "", ...a }) {
|
|
|
2416
2528
|
}
|
|
2417
2529
|
//#endregion
|
|
2418
2530
|
//#region src/components/AppCard.jsx
|
|
2419
|
-
function
|
|
2531
|
+
function Oe({ 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 }) {
|
|
2420
2532
|
T("AppCard", h);
|
|
2421
2533
|
let g = a != null || r != null || o != null || s != null;
|
|
2422
2534
|
return /* @__PURE__ */ n(p, {
|
|
@@ -2441,7 +2553,7 @@ function Te({ title: r, titleClassName: i = "", header: a, headerExtra: o, heade
|
|
|
2441
2553
|
}
|
|
2442
2554
|
//#endregion
|
|
2443
2555
|
//#region src/components/AppCheckbox.jsx
|
|
2444
|
-
var
|
|
2556
|
+
var ke = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
2445
2557
|
T("AppCheckbox", s);
|
|
2446
2558
|
let l = o(), u = r || i || l;
|
|
2447
2559
|
return /* @__PURE__ */ n("div", {
|
|
@@ -2462,7 +2574,7 @@ var Ee = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
|
2462
2574
|
});
|
|
2463
2575
|
//#endregion
|
|
2464
2576
|
//#region src/components/AppChip.jsx
|
|
2465
|
-
function
|
|
2577
|
+
function Ae({ 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 }) {
|
|
2466
2578
|
T("AppChip", m);
|
|
2467
2579
|
let h = r ?? i, g = [
|
|
2468
2580
|
"chip",
|
|
@@ -2514,7 +2626,7 @@ function De({ label: r, children: i, tone: a = "neutral", size: o = "md", leadin
|
|
|
2514
2626
|
}
|
|
2515
2627
|
//#endregion
|
|
2516
2628
|
//#region src/components/AppChoiceCard.jsx
|
|
2517
|
-
function
|
|
2629
|
+
function je({ 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 }) {
|
|
2518
2630
|
return T("AppChoiceCard", y), /* @__PURE__ */ n("label", {
|
|
2519
2631
|
className: `struct-card${d ? " struct-card-img-card" : ""}${o ? " checked" : ""}${v ? ` ${v}` : ""}`,
|
|
2520
2632
|
children: [
|
|
@@ -2562,7 +2674,7 @@ function Oe({ name: r, multiple: i = !1, value: a, checked: o, onChange: s, icon
|
|
|
2562
2674
|
}
|
|
2563
2675
|
//#endregion
|
|
2564
2676
|
//#region src/components/AppChoiceChip.jsx
|
|
2565
|
-
function
|
|
2677
|
+
function Me({ multiple: e = !0, label: r, name: i, value: a, checked: o, onChange: s, children: c, count: l, className: u = "", ...d }) {
|
|
2566
2678
|
return T("AppChoiceChip", d), /* @__PURE__ */ n("label", {
|
|
2567
2679
|
className: `choice-chip${o ? " checked" : ""}${u ? ` ${u}` : ""}`,
|
|
2568
2680
|
children: [
|
|
@@ -2583,7 +2695,7 @@ function ke({ multiple: e = !0, label: r, name: i, value: a, checked: o, onChang
|
|
|
2583
2695
|
}
|
|
2584
2696
|
//#endregion
|
|
2585
2697
|
//#region src/components/AppColorField.jsx
|
|
2586
|
-
function
|
|
2698
|
+
function Ne({ value: e = "#000000", onChange: r, label: i, required: a = !1, error: o, hint: s, name: c, id: l, disabled: u = !1, className: d = "", ...f }) {
|
|
2587
2699
|
T("AppColorField", f);
|
|
2588
2700
|
let p = l || c;
|
|
2589
2701
|
return /* @__PURE__ */ n("div", {
|
|
@@ -2631,7 +2743,7 @@ function Ae({ value: e = "#000000", onChange: r, label: i, required: a = !1, err
|
|
|
2631
2743
|
}
|
|
2632
2744
|
//#endregion
|
|
2633
2745
|
//#region src/components/AppCompareTable.jsx
|
|
2634
|
-
function
|
|
2746
|
+
function Pe({ columns: e = [], rows: r = [], caption: i, className: a = "", ...o }) {
|
|
2635
2747
|
T("AppCompareTable", o);
|
|
2636
2748
|
let s = (e) => e === !0 ? /* @__PURE__ */ t("span", {
|
|
2637
2749
|
className: "compare-yes",
|
|
@@ -2714,7 +2826,7 @@ function Q({ label: e, children: r, ...i }) {
|
|
|
2714
2826
|
}
|
|
2715
2827
|
//#endregion
|
|
2716
2828
|
//#region src/components/AppInput.jsx
|
|
2717
|
-
var
|
|
2829
|
+
var Fe = 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) {
|
|
2718
2830
|
T("AppInput", j);
|
|
2719
2831
|
let [N, ee] = l(!1), P = v || y, F = u === "password", I = F && N ? "text" : u, L = c(null), te = (e) => {
|
|
2720
2832
|
L.current = e, typeof M == "function" ? M(e) : M && (M.current = e);
|
|
@@ -2863,15 +2975,15 @@ var Me = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
2863
2975
|
})
|
|
2864
2976
|
]
|
|
2865
2977
|
});
|
|
2866
|
-
}),
|
|
2867
|
-
function
|
|
2978
|
+
}), Ie = "a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])";
|
|
2979
|
+
function Le({ 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 }) {
|
|
2868
2980
|
T("AppModal", v);
|
|
2869
2981
|
let y = c(null);
|
|
2870
2982
|
a(() => {
|
|
2871
2983
|
if (!e) return;
|
|
2872
2984
|
let t = y.current?.closest(".modal-content");
|
|
2873
2985
|
if (!t) return;
|
|
2874
|
-
let n = () => Array.from(t.querySelectorAll(
|
|
2986
|
+
let n = () => Array.from(t.querySelectorAll(Ie));
|
|
2875
2987
|
(t.querySelector("[data-autofocus]") || n().find((e) => !e.classList.contains("lx-modal-close")) || n()[0] || t).focus?.();
|
|
2876
2988
|
}, [e]);
|
|
2877
2989
|
let b = ["lx-modal-shell", f ? "is-side" : ""].filter(Boolean).join(" "), x = [
|
|
@@ -2956,7 +3068,7 @@ var $ = (e) => function({ size: n = 72 }) {
|
|
|
2956
3068
|
tone: e,
|
|
2957
3069
|
size: n
|
|
2958
3070
|
});
|
|
2959
|
-
},
|
|
3071
|
+
}, Re = {
|
|
2960
3072
|
success: $("success"),
|
|
2961
3073
|
error: $("error"),
|
|
2962
3074
|
warning: $("warning"),
|
|
@@ -2965,14 +3077,14 @@ var $ = (e) => function({ size: n = 72 }) {
|
|
|
2965
3077
|
};
|
|
2966
3078
|
//#endregion
|
|
2967
3079
|
//#region src/components/AppConfirmDialog.jsx
|
|
2968
|
-
function
|
|
3080
|
+
function ze({ open: r, title: i, message: o, confirmLabel: s = "Confirm", cancelLabel: c = "Cancel", danger: u = !1, tone: d, confirmPhrase: f, onConfirm: p, onClose: m, ...h }) {
|
|
2969
3081
|
T("AppConfirmDialog", h);
|
|
2970
3082
|
let [g, _] = l("");
|
|
2971
3083
|
if (a(() => {
|
|
2972
3084
|
r || _("");
|
|
2973
3085
|
}, [r]), !r) return null;
|
|
2974
|
-
let v = !!f && g.trim() !== f, y =
|
|
2975
|
-
return /* @__PURE__ */ t(
|
|
3086
|
+
let v = !!f && g.trim() !== f, y = Re[d || (u ? "delete" : "info")];
|
|
3087
|
+
return /* @__PURE__ */ t(Le, {
|
|
2976
3088
|
open: r,
|
|
2977
3089
|
hideHeader: !0,
|
|
2978
3090
|
title: i,
|
|
@@ -3008,7 +3120,7 @@ function Ie({ open: r, title: i, message: o, confirmLabel: s = "Confirm", cancel
|
|
|
3008
3120
|
className: "lx-confirm-msg",
|
|
3009
3121
|
children: o
|
|
3010
3122
|
}),
|
|
3011
|
-
f && /* @__PURE__ */ t(
|
|
3123
|
+
f && /* @__PURE__ */ t(Fe, {
|
|
3012
3124
|
fieldClassName: "mt-3 mb-0 w-100 text-start",
|
|
3013
3125
|
label: /* @__PURE__ */ n(e, { children: [
|
|
3014
3126
|
"Type ",
|
|
@@ -3025,7 +3137,7 @@ function Ie({ open: r, title: i, message: o, confirmLabel: s = "Confirm", cancel
|
|
|
3025
3137
|
}
|
|
3026
3138
|
//#endregion
|
|
3027
3139
|
//#region src/components/AppSkeleton.jsx
|
|
3028
|
-
function
|
|
3140
|
+
function Be({ width: e = "100%", height: n = 14, radius: r = 6, className: i = "", style: a, ...o }) {
|
|
3029
3141
|
return T("AppSkeleton", o), /* @__PURE__ */ t("span", {
|
|
3030
3142
|
className: `skeleton${i ? ` ${i}` : ""}`,
|
|
3031
3143
|
"aria-hidden": "true",
|
|
@@ -3037,7 +3149,7 @@ function Le({ width: e = "100%", height: n = 14, radius: r = 6, className: i = "
|
|
|
3037
3149
|
}
|
|
3038
3150
|
});
|
|
3039
3151
|
}
|
|
3040
|
-
var
|
|
3152
|
+
var Ve = [
|
|
3041
3153
|
"r0",
|
|
3042
3154
|
"r1",
|
|
3043
3155
|
"r2",
|
|
@@ -3046,7 +3158,7 @@ var Re = [
|
|
|
3046
3158
|
"r5",
|
|
3047
3159
|
"r6",
|
|
3048
3160
|
"r7"
|
|
3049
|
-
],
|
|
3161
|
+
], He = [
|
|
3050
3162
|
"c0",
|
|
3051
3163
|
"c1",
|
|
3052
3164
|
"c2",
|
|
@@ -3056,15 +3168,15 @@ var Re = [
|
|
|
3056
3168
|
"c6",
|
|
3057
3169
|
"c7"
|
|
3058
3170
|
];
|
|
3059
|
-
function
|
|
3060
|
-
return
|
|
3171
|
+
function Ue({ rows: e = 4, cols: n = 5 }) {
|
|
3172
|
+
return Ve.slice(0, e).map((e) => /* @__PURE__ */ t("tr", { children: He.slice(0, n).map((e, n) => /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(Be, {
|
|
3061
3173
|
width: n === 0 ? "70%" : "50%",
|
|
3062
3174
|
height: 12
|
|
3063
3175
|
}) }, e)) }, e));
|
|
3064
3176
|
}
|
|
3065
3177
|
//#endregion
|
|
3066
3178
|
//#region src/components/AppSelectMini.jsx
|
|
3067
|
-
function
|
|
3179
|
+
function We({ value: e, onChange: n, options: r = [], placeholder: i = "Select...", name: o, ariaLabel: s, id: l, disabled: u, className: d, ...f }) {
|
|
3068
3180
|
T("AppSelectMini", f);
|
|
3069
3181
|
let p = c(null);
|
|
3070
3182
|
return a(() => {
|
|
@@ -3093,19 +3205,19 @@ function Ve({ value: e, onChange: n, options: r = [], placeholder: i = "Select..
|
|
|
3093
3205
|
}
|
|
3094
3206
|
//#endregion
|
|
3095
3207
|
//#region src/components/AppTablePagination.jsx
|
|
3096
|
-
var
|
|
3208
|
+
var Ge = [
|
|
3097
3209
|
5,
|
|
3098
3210
|
10,
|
|
3099
3211
|
25,
|
|
3100
3212
|
50
|
|
3101
3213
|
];
|
|
3102
|
-
function
|
|
3214
|
+
function Ke({ page: e, totalPages: r, pageSize: i, total: a, firstRow: o, lastRow: s, onPageChange: c, onPageSizeChange: l, pageSizes: u = Ge, ...d }) {
|
|
3103
3215
|
return T("AppTablePagination", d), /* @__PURE__ */ n("div", {
|
|
3104
3216
|
className: "table-pagination",
|
|
3105
3217
|
children: [
|
|
3106
3218
|
/* @__PURE__ */ n("span", {
|
|
3107
3219
|
className: "tpg-rows",
|
|
3108
|
-
children: ["Rows per page:", /* @__PURE__ */ t(
|
|
3220
|
+
children: ["Rows per page:", /* @__PURE__ */ t(We, {
|
|
3109
3221
|
value: i,
|
|
3110
3222
|
onChange: (e) => l(Number(e)),
|
|
3111
3223
|
ariaLabel: "Rows per page",
|
|
@@ -3154,13 +3266,13 @@ function Ue({ page: e, totalPages: r, pageSize: i, total: a, firstRow: o, lastRo
|
|
|
3154
3266
|
}
|
|
3155
3267
|
//#endregion
|
|
3156
3268
|
//#region src/components/AppDataTable.jsx
|
|
3157
|
-
function
|
|
3269
|
+
function qe(e) {
|
|
3158
3270
|
return e === "end" ? "lx-cell-end" : e === "num" ? "num" : e === "center" ? "text-center" : "";
|
|
3159
3271
|
}
|
|
3160
|
-
function
|
|
3272
|
+
function Je(e) {
|
|
3161
3273
|
return e == null || e === "" ? "—" : e;
|
|
3162
3274
|
}
|
|
3163
|
-
function
|
|
3275
|
+
function Ye({ 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 }) {
|
|
3164
3276
|
T("AppDataTable", S);
|
|
3165
3277
|
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) => {
|
|
3166
3278
|
e && (e.indeterminate = D);
|
|
@@ -3185,7 +3297,7 @@ function Ke({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3185
3297
|
r.map((e, r) => {
|
|
3186
3298
|
let i = !!(e.sortable && s), a = o && o.key === e.key;
|
|
3187
3299
|
return /* @__PURE__ */ n("th", {
|
|
3188
|
-
className: (i ? "sortable " : "") + (r === 0 ? "lx-name-cell " : "") +
|
|
3300
|
+
className: (i ? "sortable " : "") + (r === 0 ? "lx-name-cell " : "") + qe(e.align),
|
|
3189
3301
|
style: e.width ? { width: e.width } : void 0,
|
|
3190
3302
|
tabIndex: i ? 0 : void 0,
|
|
3191
3303
|
"aria-sort": a ? o.dir === "asc" ? "ascending" : "descending" : i ? "none" : void 0,
|
|
@@ -3212,7 +3324,7 @@ function Ke({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3212
3324
|
children: "Actions"
|
|
3213
3325
|
})
|
|
3214
3326
|
}))
|
|
3215
|
-
] }) }), /* @__PURE__ */ t("tbody", { children: c ? /* @__PURE__ */ t(
|
|
3327
|
+
] }) }), /* @__PURE__ */ t("tbody", { children: c ? /* @__PURE__ */ t(Ue, {
|
|
3216
3328
|
rows: l,
|
|
3217
3329
|
cols: C
|
|
3218
3330
|
}) : i?.length ? i.map((e) => {
|
|
@@ -3231,8 +3343,8 @@ function Ke({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3231
3343
|
})
|
|
3232
3344
|
}),
|
|
3233
3345
|
r.map((n, r) => /* @__PURE__ */ t("td", {
|
|
3234
|
-
className: (r === 0 ? "lx-name-cell " : "") +
|
|
3235
|
-
children: n.render ? n.render(e) :
|
|
3346
|
+
className: (r === 0 ? "lx-name-cell " : "") + qe(n.align) + (n.cellClassName ? ` ${n.cellClassName}` : ""),
|
|
3347
|
+
children: n.render ? n.render(e) : Je(e[n.key])
|
|
3236
3348
|
}, n.key)),
|
|
3237
3349
|
p && /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t("div", {
|
|
3238
3350
|
className: "u-row-actions",
|
|
@@ -3246,7 +3358,7 @@ function Ke({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3246
3358
|
children: A
|
|
3247
3359
|
}) }) })]
|
|
3248
3360
|
})
|
|
3249
|
-
}), h && !c && h.total > 0 && /* @__PURE__ */ t(
|
|
3361
|
+
}), h && !c && h.total > 0 && /* @__PURE__ */ t(Ke, {
|
|
3250
3362
|
page: h.page,
|
|
3251
3363
|
totalPages: h.totalPages,
|
|
3252
3364
|
pageSize: h.pageSize,
|
|
@@ -3259,7 +3371,7 @@ function Ke({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3259
3371
|
}
|
|
3260
3372
|
//#endregion
|
|
3261
3373
|
//#region src/components/AppDatePicker.jsx
|
|
3262
|
-
function
|
|
3374
|
+
function Xe({ 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, id: g, ariaLabel: _, className: v = "", ...y }) {
|
|
3263
3375
|
T("AppDatePicker", y);
|
|
3264
3376
|
let b = c(null), x = o(), S = g || d || x;
|
|
3265
3377
|
a(() => {
|
|
@@ -3309,7 +3421,7 @@ function qe({ value: e, onChange: r, label: i, required: s = !1, hint: l, error:
|
|
|
3309
3421
|
}
|
|
3310
3422
|
//#endregion
|
|
3311
3423
|
//#region src/components/AppDropdown.jsx
|
|
3312
|
-
var
|
|
3424
|
+
var Ze = r(function({ icon: e, iconSize: n = 20, btnClassName: r = "topbar-icon-btn", label: i, align: a = "end", "aria-label": o, className: s, ...c }, l) {
|
|
3313
3425
|
return /* @__PURE__ */ t("button", {
|
|
3314
3426
|
ref: l,
|
|
3315
3427
|
type: "button",
|
|
@@ -3323,11 +3435,11 @@ var Je = r(function({ icon: e, iconSize: n = 20, btnClassName: r = "topbar-icon-
|
|
|
3323
3435
|
})
|
|
3324
3436
|
});
|
|
3325
3437
|
});
|
|
3326
|
-
function
|
|
3438
|
+
function Qe({ icon: e, iconSize: r, toggleClassName: i = "topbar-icon-btn", label: a, ariaLabel: o, align: s = "end", items: c = [], menuClassName: l = "", linkComponent: u, ...d }) {
|
|
3327
3439
|
return T("AppDropdown", d), /* @__PURE__ */ n(_, {
|
|
3328
3440
|
align: s,
|
|
3329
3441
|
children: [/* @__PURE__ */ t(_.Toggle, {
|
|
3330
|
-
as:
|
|
3442
|
+
as: Ze,
|
|
3331
3443
|
icon: e,
|
|
3332
3444
|
iconSize: r,
|
|
3333
3445
|
btnClassName: i,
|
|
@@ -3365,7 +3477,7 @@ function Ye({ icon: e, iconSize: r, toggleClassName: i = "topbar-icon-btn", labe
|
|
|
3365
3477
|
}
|
|
3366
3478
|
//#endregion
|
|
3367
3479
|
//#region src/components/AppEmptyState.jsx
|
|
3368
|
-
function
|
|
3480
|
+
function $e({ icon: e, iconSize: r = 24, size: i = "md", title: a, text: o, action: s, className: c = "", style: l, ...u }) {
|
|
3369
3481
|
return T("AppEmptyState", u), /* @__PURE__ */ n("div", {
|
|
3370
3482
|
className: [
|
|
3371
3483
|
"empty-state",
|
|
@@ -3398,7 +3510,7 @@ function Xe({ icon: e, iconSize: r = 24, size: i = "md", title: a, text: o, acti
|
|
|
3398
3510
|
}
|
|
3399
3511
|
//#endregion
|
|
3400
3512
|
//#region src/components/AppFileAttachment.jsx
|
|
3401
|
-
function
|
|
3513
|
+
function et({ label: r = "Attachment", value: i, name: s, onChange: c, accept: u = pe, maxSizeMb: d = 5, optional: f = !1, error: p, id: m, ...h }) {
|
|
3402
3514
|
T("AppFileAttachment", h);
|
|
3403
3515
|
let g = o(), _ = m || s || g, [v, y] = l(null), [b, x] = l("");
|
|
3404
3516
|
a(() => {
|
|
@@ -3411,7 +3523,7 @@ function Ze({ label: r = "Attachment", value: i, name: s, onChange: c, accept: u
|
|
|
3411
3523
|
function S(e) {
|
|
3412
3524
|
let t = e.target.files?.[0];
|
|
3413
3525
|
if (e.target.value = "", !t) return;
|
|
3414
|
-
let n =
|
|
3526
|
+
let n = ye(t, {
|
|
3415
3527
|
accept: u,
|
|
3416
3528
|
maxSizeMb: d
|
|
3417
3529
|
});
|
|
@@ -3510,22 +3622,22 @@ function Ze({ label: r = "Attachment", value: i, name: s, onChange: c, accept: u
|
|
|
3510
3622
|
}
|
|
3511
3623
|
//#endregion
|
|
3512
3624
|
//#region src/components/toast.js
|
|
3513
|
-
var
|
|
3625
|
+
var tt = /* @__PURE__ */ new Set([
|
|
3514
3626
|
"success",
|
|
3515
3627
|
"info",
|
|
3516
3628
|
"warning",
|
|
3517
3629
|
"error"
|
|
3518
3630
|
]);
|
|
3519
|
-
function
|
|
3520
|
-
let n =
|
|
3631
|
+
function nt(e, t = "success") {
|
|
3632
|
+
let n = tt.has(t) ? t : "success";
|
|
3521
3633
|
v[n](e, { toastId: `${n}:${e}` });
|
|
3522
3634
|
}
|
|
3523
|
-
function
|
|
3635
|
+
function rt(e) {
|
|
3524
3636
|
v.error(e, { toastId: `error:${e}` });
|
|
3525
3637
|
}
|
|
3526
3638
|
//#endregion
|
|
3527
3639
|
//#region src/components/AppFilePicker.jsx
|
|
3528
|
-
function
|
|
3640
|
+
function it({ label: e, value: r, name: i, onPick: s, accept: u = ".jpg,.jpeg,.png", maxSizeMb: d = 5, required: f, error: p, ...m }) {
|
|
3529
3641
|
T("AppFilePicker", m);
|
|
3530
3642
|
let [h, g] = l(null), [_, v] = l(!1), y = c(null), b = o(), x = i || b;
|
|
3531
3643
|
a(() => {
|
|
@@ -3536,11 +3648,11 @@ function tt({ label: e, value: r, name: i, onPick: s, accept: u = ".jpg,.jpeg,.p
|
|
|
3536
3648
|
g(null);
|
|
3537
3649
|
}, [r]);
|
|
3538
3650
|
let S = r?.url || h, C = (e) => {
|
|
3539
|
-
let t =
|
|
3651
|
+
let t = ye(e, {
|
|
3540
3652
|
accept: u,
|
|
3541
3653
|
maxSizeMb: d
|
|
3542
3654
|
});
|
|
3543
|
-
return t ? (
|
|
3655
|
+
return t ? (nt(t, "error"), !1) : (s(e), !0);
|
|
3544
3656
|
}, w = (e) => {
|
|
3545
3657
|
let t = e.target.files?.[0] || null;
|
|
3546
3658
|
t && (C(t) || (e.target.value = ""));
|
|
@@ -3651,7 +3763,7 @@ function tt({ label: e, value: r, name: i, onPick: s, accept: u = ".jpg,.jpeg,.p
|
|
|
3651
3763
|
}
|
|
3652
3764
|
//#endregion
|
|
3653
3765
|
//#region src/components/AppInfoList.jsx
|
|
3654
|
-
function
|
|
3766
|
+
function at({ items: r = [], className: i = "", ...a }) {
|
|
3655
3767
|
return T("AppInfoList", a), /* @__PURE__ */ t("div", {
|
|
3656
3768
|
className: `info-list${i ? ` ${i}` : ""}`,
|
|
3657
3769
|
children: r.map((r, i) => {
|
|
@@ -3684,7 +3796,7 @@ function nt({ items: r = [], className: i = "", ...a }) {
|
|
|
3684
3796
|
}
|
|
3685
3797
|
//#endregion
|
|
3686
3798
|
//#region src/components/AppKpiTile.jsx
|
|
3687
|
-
function
|
|
3799
|
+
function ot({ label: e, value: r, icon: i, delta: a, deltaDirection: o = "flat", inline: s = !1, className: c = "", ...l }) {
|
|
3688
3800
|
T("AppKpiTile", l);
|
|
3689
3801
|
let u = `kpi${s ? " kpi-inline" : ""}${c ? ` ${c}` : ""}`, d = o === "up" ? "arrow-up" : o === "down" ? "arrow-down" : null;
|
|
3690
3802
|
return /* @__PURE__ */ n("div", {
|
|
@@ -3717,7 +3829,7 @@ function rt({ label: e, value: r, icon: i, delta: a, deltaDirection: o = "flat",
|
|
|
3717
3829
|
}
|
|
3718
3830
|
//#endregion
|
|
3719
3831
|
//#region src/components/AppLogoPicker.jsx
|
|
3720
|
-
function
|
|
3832
|
+
function st({ 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 }) {
|
|
3721
3833
|
T("AppLogoPicker", m);
|
|
3722
3834
|
let h = c(null);
|
|
3723
3835
|
return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("button", {
|
|
@@ -3763,12 +3875,12 @@ function it({ value: r, fallback: i, name: a, onPick: o, loading: s = !1, accept
|
|
|
3763
3875
|
onChange: (e) => {
|
|
3764
3876
|
let t = e.target.files?.[0];
|
|
3765
3877
|
if (e.target.value = "", !t) return;
|
|
3766
|
-
let n =
|
|
3878
|
+
let n = ye(t, {
|
|
3767
3879
|
accept: l,
|
|
3768
3880
|
maxSizeMb: u
|
|
3769
3881
|
});
|
|
3770
3882
|
if (n) {
|
|
3771
|
-
|
|
3883
|
+
nt(n, "error");
|
|
3772
3884
|
return;
|
|
3773
3885
|
}
|
|
3774
3886
|
o(t);
|
|
@@ -3778,7 +3890,7 @@ function it({ value: r, fallback: i, name: a, onPick: o, loading: s = !1, accept
|
|
|
3778
3890
|
}
|
|
3779
3891
|
//#endregion
|
|
3780
3892
|
//#region src/components/AppMultiSelect.jsx
|
|
3781
|
-
function
|
|
3893
|
+
function ct({ values: e, onChange: r, options: i, placeholder: o = "Select…", searchPlaceholder: s = "Search…", searchable: l = !0, disabled: u = !1, name: d, label: f, error: p, hint: m, required: h = !1, fieldClassName: g = "", ..._ }) {
|
|
3782
3894
|
T("AppMultiSelect", _);
|
|
3783
3895
|
let v = c(null);
|
|
3784
3896
|
return a(() => {
|
|
@@ -3824,8 +3936,61 @@ function at({ values: e, onChange: r, options: i, placeholder: o = "Select…",
|
|
|
3824
3936
|
});
|
|
3825
3937
|
}
|
|
3826
3938
|
//#endregion
|
|
3939
|
+
//#region src/components/AppOtpInput.jsx
|
|
3940
|
+
var lt = 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) {
|
|
3941
|
+
T("AppOtpInput", v);
|
|
3942
|
+
let b = c(null), x = o(), S = g || h || x, C = (e) => {
|
|
3943
|
+
b.current = e, typeof y == "function" ? y(e) : y && (y.current = e);
|
|
3944
|
+
};
|
|
3945
|
+
a(() => {
|
|
3946
|
+
let t = b.current;
|
|
3947
|
+
t && String(t.value ?? "") !== String(e ?? "") && (t.value = e ?? "");
|
|
3948
|
+
}, [e]), a(() => {
|
|
3949
|
+
let e = b.current;
|
|
3950
|
+
if (!e) return;
|
|
3951
|
+
let t = () => r?.(e.value), n = (e) => i?.(e.detail);
|
|
3952
|
+
return e.addEventListener("change", t), e.addEventListener("complete", n), () => {
|
|
3953
|
+
e.removeEventListener("change", t), e.removeEventListener("complete", n);
|
|
3954
|
+
};
|
|
3955
|
+
}, [r, i]);
|
|
3956
|
+
let w = /* @__PURE__ */ t("wui-otp", {
|
|
3957
|
+
"aria-label": typeof u == "string" ? u : void 0,
|
|
3958
|
+
ref: C,
|
|
3959
|
+
id: S,
|
|
3960
|
+
name: h,
|
|
3961
|
+
length: String(s),
|
|
3962
|
+
mode: l,
|
|
3963
|
+
"aria-invalid": p ? "true" : void 0,
|
|
3964
|
+
disabled: m ? "" : void 0,
|
|
3965
|
+
required: d ? "" : void 0
|
|
3966
|
+
});
|
|
3967
|
+
return !u && !p && !f ? w : /* @__PURE__ */ n("div", {
|
|
3968
|
+
className: `field${_ ? ` ${_}` : ""}`,
|
|
3969
|
+
children: [
|
|
3970
|
+
u && /* @__PURE__ */ n("label", {
|
|
3971
|
+
className: "label",
|
|
3972
|
+
htmlFor: S,
|
|
3973
|
+
children: [u, d && /* @__PURE__ */ t("span", {
|
|
3974
|
+
className: "required",
|
|
3975
|
+
"aria-hidden": "true",
|
|
3976
|
+
children: "*"
|
|
3977
|
+
})]
|
|
3978
|
+
}),
|
|
3979
|
+
w,
|
|
3980
|
+
p && /* @__PURE__ */ t("div", {
|
|
3981
|
+
className: "field-error",
|
|
3982
|
+
children: p
|
|
3983
|
+
}),
|
|
3984
|
+
!p && f && /* @__PURE__ */ t("div", {
|
|
3985
|
+
className: "field-hint",
|
|
3986
|
+
children: f
|
|
3987
|
+
})
|
|
3988
|
+
]
|
|
3989
|
+
});
|
|
3990
|
+
});
|
|
3991
|
+
//#endregion
|
|
3827
3992
|
//#region src/components/AppPageHeader.jsx
|
|
3828
|
-
function
|
|
3993
|
+
function ut({ title: e, subtitle: r, actions: i, className: a = "", ...o }) {
|
|
3829
3994
|
return T("AppPageHeader", o), /* @__PURE__ */ n("div", {
|
|
3830
3995
|
className: `page-header${i ? " d-flex align-items-end justify-content-between" : ""}${a ? ` ${a}` : ""}`,
|
|
3831
3996
|
children: [/* @__PURE__ */ n("div", { children: [/* @__PURE__ */ t("div", {
|
|
@@ -3842,7 +4007,7 @@ function ot({ title: e, subtitle: r, actions: i, className: a = "", ...o }) {
|
|
|
3842
4007
|
}
|
|
3843
4008
|
//#endregion
|
|
3844
4009
|
//#region src/components/AppPhoneNumberInput.jsx
|
|
3845
|
-
function
|
|
4010
|
+
function dt({ 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 }) {
|
|
3846
4011
|
T("AppPhoneNumberInput", m);
|
|
3847
4012
|
let h = c(null);
|
|
3848
4013
|
return a(() => {
|
|
@@ -3877,7 +4042,7 @@ function st({ value: e, onChange: r, country: i, disabled: o = !1, name: s, labe
|
|
|
3877
4042
|
}
|
|
3878
4043
|
//#endregion
|
|
3879
4044
|
//#region src/components/AppPricingCard.jsx
|
|
3880
|
-
function
|
|
4045
|
+
function ft({ 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 }) {
|
|
3881
4046
|
return T("AppPricingCard", f), /* @__PURE__ */ n("div", {
|
|
3882
4047
|
className: [
|
|
3883
4048
|
"plan-card",
|
|
@@ -3930,7 +4095,7 @@ function ct({ name: e, price: r, unit: i, tagline: a, features: o = [], cta: s,
|
|
|
3930
4095
|
}
|
|
3931
4096
|
//#endregion
|
|
3932
4097
|
//#region src/components/AppRadio.jsx
|
|
3933
|
-
var
|
|
4098
|
+
var pt = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
3934
4099
|
T("AppRadio", s);
|
|
3935
4100
|
let l = o(), u = r || i || l;
|
|
3936
4101
|
return /* @__PURE__ */ n("div", {
|
|
@@ -3951,7 +4116,7 @@ var lt = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
|
3951
4116
|
});
|
|
3952
4117
|
//#endregion
|
|
3953
4118
|
//#region src/components/AppRepeater.jsx
|
|
3954
|
-
function
|
|
4119
|
+
function mt({ 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 }) {
|
|
3955
4120
|
T("AppRepeater", p);
|
|
3956
4121
|
let m = typeof u == "number" && e.length >= u, h = !!a && e.length > l;
|
|
3957
4122
|
return /* @__PURE__ */ n("div", {
|
|
@@ -3995,7 +4160,7 @@ function ut({ rows: e = [], renderRow: r, onAdd: i, onRemove: a, addLabel: o = "
|
|
|
3995
4160
|
}
|
|
3996
4161
|
//#endregion
|
|
3997
4162
|
//#region src/components/AppResourceCard.jsx
|
|
3998
|
-
function
|
|
4163
|
+
function ht({ icon: r, title: i, text: a, href: o, external: s = !1, linkComponent: c, className: l = "", ...u }) {
|
|
3999
4164
|
T("AppResourceCard", u);
|
|
4000
4165
|
let d = /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", {
|
|
4001
4166
|
className: "res-card-icon",
|
|
@@ -4027,7 +4192,7 @@ function dt({ icon: r, title: i, text: a, href: o, external: s = !1, linkCompone
|
|
|
4027
4192
|
}
|
|
4028
4193
|
//#endregion
|
|
4029
4194
|
//#region src/components/AppSearch.jsx
|
|
4030
|
-
function
|
|
4195
|
+
function gt({ value: e, onValueChange: r, placeholder: i, ariaLabel: a, iconSize: o = 18, className: s = "", ...c }) {
|
|
4031
4196
|
return T("AppSearch", c), /* @__PURE__ */ n("div", {
|
|
4032
4197
|
className: [
|
|
4033
4198
|
"search-wrap",
|
|
@@ -4064,7 +4229,7 @@ function ft({ value: e, onValueChange: r, placeholder: i, ariaLabel: a, iconSize
|
|
|
4064
4229
|
}
|
|
4065
4230
|
//#endregion
|
|
4066
4231
|
//#region src/components/AppSegmented.jsx
|
|
4067
|
-
function
|
|
4232
|
+
function _t({ options: e = [], value: r, onChange: i, label: a, name: s, size: c = "md", className: l = "", ...u }) {
|
|
4068
4233
|
T("AppSegmented", u);
|
|
4069
4234
|
let d = o(), f = s || d;
|
|
4070
4235
|
return /* @__PURE__ */ t("div", {
|
|
@@ -4093,66 +4258,79 @@ function pt({ options: e = [], value: r, onChange: i, label: a, name: s, size: c
|
|
|
4093
4258
|
}
|
|
4094
4259
|
//#endregion
|
|
4095
4260
|
//#region src/components/AppSelect.jsx
|
|
4096
|
-
var
|
|
4097
|
-
function
|
|
4098
|
-
T("AppSelect",
|
|
4099
|
-
let
|
|
4261
|
+
var vt = (e) => e == null ? "" : e.label ?? e.text ?? "";
|
|
4262
|
+
function yt({ value: e, onChange: r, options: i = [], placeholder: o = "Select...", searchPlaceholder: s = "Search...", searchable: l = !1, clearable: u = !1, size: d, floatingLabel: f = !1, disabled: p, label: m, required: h = !1, error: g, hint: _, help: v, helpLabel: y = "More information", id: b, name: x, className: S = "", fieldClassName: C = "", ...w }) {
|
|
4263
|
+
T("AppSelect", w);
|
|
4264
|
+
let E = c(null);
|
|
4100
4265
|
a(() => {
|
|
4101
|
-
|
|
4266
|
+
E.current && (E.current.options = i.map((e) => ({
|
|
4102
4267
|
value: e.value,
|
|
4103
|
-
label:
|
|
4268
|
+
label: vt(e)
|
|
4104
4269
|
})));
|
|
4105
4270
|
}, [i]), a(() => {
|
|
4106
|
-
let t =
|
|
4271
|
+
let t = E.current;
|
|
4107
4272
|
t && String(t.value ?? "") !== String(e ?? "") && (t.value = e ?? "");
|
|
4108
4273
|
}, [e]), a(() => {
|
|
4109
|
-
let e =
|
|
4274
|
+
let e = E.current;
|
|
4110
4275
|
if (!e) return;
|
|
4111
4276
|
let t = () => r?.(e.value);
|
|
4112
4277
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
4113
4278
|
}, [r]);
|
|
4114
|
-
let
|
|
4115
|
-
"aria-label": typeof
|
|
4116
|
-
ref:
|
|
4117
|
-
id:
|
|
4118
|
-
name:
|
|
4119
|
-
placeholder: o,
|
|
4279
|
+
let D = /* @__PURE__ */ t("wui-select", {
|
|
4280
|
+
"aria-label": typeof m == "string" ? m : void 0,
|
|
4281
|
+
ref: E,
|
|
4282
|
+
id: b || x,
|
|
4283
|
+
name: x,
|
|
4284
|
+
placeholder: f ? " " : o,
|
|
4120
4285
|
"search-placeholder": s,
|
|
4121
4286
|
searchable: l ? "" : void 0,
|
|
4122
|
-
|
|
4123
|
-
|
|
4287
|
+
clearable: u ? "" : void 0,
|
|
4288
|
+
size: d || void 0,
|
|
4289
|
+
disabled: p ? "" : void 0,
|
|
4290
|
+
required: h ? "" : void 0
|
|
4124
4291
|
});
|
|
4125
|
-
if (!
|
|
4126
|
-
let
|
|
4292
|
+
if (!m && !g && !_) return D;
|
|
4293
|
+
let O = b || x, k = f && m;
|
|
4127
4294
|
return /* @__PURE__ */ n("div", {
|
|
4128
|
-
className:
|
|
4295
|
+
className: [
|
|
4296
|
+
"field",
|
|
4297
|
+
S,
|
|
4298
|
+
C
|
|
4299
|
+
].filter(Boolean).join(" "),
|
|
4129
4300
|
children: [
|
|
4130
|
-
|
|
4301
|
+
m && !k && /* @__PURE__ */ n("label", {
|
|
4131
4302
|
className: "label",
|
|
4132
|
-
htmlFor:
|
|
4303
|
+
htmlFor: O,
|
|
4133
4304
|
children: [
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
label:
|
|
4138
|
-
children:
|
|
4305
|
+
m,
|
|
4306
|
+
h && /* @__PURE__ */ t(X, {}),
|
|
4307
|
+
v && /* @__PURE__ */ t(Q, {
|
|
4308
|
+
label: y,
|
|
4309
|
+
children: v
|
|
4139
4310
|
})
|
|
4140
4311
|
]
|
|
4141
4312
|
}),
|
|
4142
|
-
|
|
4143
|
-
|
|
4313
|
+
k ? /* @__PURE__ */ n("div", {
|
|
4314
|
+
className: "field-float",
|
|
4315
|
+
children: [D, /* @__PURE__ */ n("label", {
|
|
4316
|
+
className: "float-label",
|
|
4317
|
+
htmlFor: O,
|
|
4318
|
+
children: [m, h && /* @__PURE__ */ t(X, {})]
|
|
4319
|
+
})]
|
|
4320
|
+
}) : D,
|
|
4321
|
+
g ? /* @__PURE__ */ t("div", {
|
|
4144
4322
|
className: "field-error",
|
|
4145
|
-
children:
|
|
4146
|
-
}) :
|
|
4323
|
+
children: g
|
|
4324
|
+
}) : _ ? /* @__PURE__ */ t("div", {
|
|
4147
4325
|
className: "field-hint",
|
|
4148
|
-
children:
|
|
4326
|
+
children: _
|
|
4149
4327
|
}) : null
|
|
4150
4328
|
]
|
|
4151
4329
|
});
|
|
4152
4330
|
}
|
|
4153
4331
|
//#endregion
|
|
4154
4332
|
//#region src/components/AppShell.jsx
|
|
4155
|
-
function
|
|
4333
|
+
function bt({ 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 = "", ..._ }) {
|
|
4156
4334
|
T("AppShell", _);
|
|
4157
4335
|
let [v, y] = l(!1), [b, x] = l(!1), [S, C] = l(!1), w = d ?? v;
|
|
4158
4336
|
return a(() => {
|
|
@@ -4188,7 +4366,7 @@ function gt({ groups: e = [], brand: r, sidebarFooter: i, topbarStart: o, topbar
|
|
|
4188
4366
|
children: [e.label && /* @__PURE__ */ t("div", {
|
|
4189
4367
|
className: "app-nav-group-label",
|
|
4190
4368
|
children: e.label
|
|
4191
|
-
}), e.items.map((e) => /* @__PURE__ */ t(
|
|
4369
|
+
}), e.items.map((e) => /* @__PURE__ */ t(xt, {
|
|
4192
4370
|
item: e,
|
|
4193
4371
|
linkComponent: h,
|
|
4194
4372
|
onNavigate: () => x(!1)
|
|
@@ -4258,7 +4436,7 @@ function gt({ groups: e = [], brand: r, sidebarFooter: i, topbarStart: o, topbar
|
|
|
4258
4436
|
]
|
|
4259
4437
|
});
|
|
4260
4438
|
}
|
|
4261
|
-
function
|
|
4439
|
+
function xt({ item: r, linkComponent: i, onNavigate: a }) {
|
|
4262
4440
|
let o = `app-nav-item${r.active ? " active" : ""}`, s = /* @__PURE__ */ n(e, { children: [
|
|
4263
4441
|
r.icon && /* @__PURE__ */ t("span", {
|
|
4264
4442
|
className: "app-nav-icon",
|
|
@@ -4292,7 +4470,7 @@ function _t({ item: r, linkComponent: i, onNavigate: a }) {
|
|
|
4292
4470
|
}
|
|
4293
4471
|
//#endregion
|
|
4294
4472
|
//#region src/components/AppSidebarMenu.jsx
|
|
4295
|
-
var
|
|
4473
|
+
var St = {
|
|
4296
4474
|
left: "start",
|
|
4297
4475
|
right: "end",
|
|
4298
4476
|
start: "start",
|
|
@@ -4300,11 +4478,11 @@ var vt = {
|
|
|
4300
4478
|
top: "top",
|
|
4301
4479
|
bottom: "bottom"
|
|
4302
4480
|
};
|
|
4303
|
-
function
|
|
4481
|
+
function Ct({ 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 }) {
|
|
4304
4482
|
return T("AppSidebarMenu", b), /* @__PURE__ */ n(y, {
|
|
4305
4483
|
show: e,
|
|
4306
4484
|
onHide: r,
|
|
4307
|
-
placement:
|
|
4485
|
+
placement: St[i] || "end",
|
|
4308
4486
|
backdrop: d,
|
|
4309
4487
|
scroll: f,
|
|
4310
4488
|
keyboard: p,
|
|
@@ -4348,7 +4526,7 @@ function yt({ show: e, onHide: r, side: i = "right", title: a, titleIcon: o, hea
|
|
|
4348
4526
|
}
|
|
4349
4527
|
//#endregion
|
|
4350
4528
|
//#region src/components/AppSpinner.jsx
|
|
4351
|
-
function
|
|
4529
|
+
function wt({ size: e = "md", label: n = "Loading", className: r = "", ...i }) {
|
|
4352
4530
|
return T("AppSpinner", i), /* @__PURE__ */ t("span", {
|
|
4353
4531
|
className: `spinner-border${e === "sm" ? " spinner-border-sm" : ""}${r ? ` ${r}` : ""}`,
|
|
4354
4532
|
role: "status",
|
|
@@ -4357,7 +4535,7 @@ function bt({ size: e = "md", label: n = "Loading", className: r = "", ...i }) {
|
|
|
4357
4535
|
}
|
|
4358
4536
|
//#endregion
|
|
4359
4537
|
//#region src/components/AppSplash.jsx
|
|
4360
|
-
function
|
|
4538
|
+
function Tt({ logo: e, initials: r, text: i, label: a = "Loading", className: o = "", ...s }) {
|
|
4361
4539
|
return T("AppSplash", s), /* @__PURE__ */ t("div", {
|
|
4362
4540
|
className: `splash${o ? ` ${o}` : ""}`,
|
|
4363
4541
|
role: "status",
|
|
@@ -4384,7 +4562,7 @@ function xt({ logo: e, initials: r, text: i, label: a = "Loading", className: o
|
|
|
4384
4562
|
}
|
|
4385
4563
|
//#endregion
|
|
4386
4564
|
//#region src/components/AppStatusBadge.jsx
|
|
4387
|
-
function
|
|
4565
|
+
function Et({ label: e, tone: n = "neutral", className: r = "", ...i }) {
|
|
4388
4566
|
return T("AppStatusBadge", i), e == null || e === "" ? "—" : /* @__PURE__ */ t("span", {
|
|
4389
4567
|
className: `status-label ${n}${r ? ` ${r}` : ""}`,
|
|
4390
4568
|
children: e
|
|
@@ -4392,7 +4570,7 @@ function St({ label: e, tone: n = "neutral", className: r = "", ...i }) {
|
|
|
4392
4570
|
}
|
|
4393
4571
|
//#endregion
|
|
4394
4572
|
//#region src/components/AppStepper.jsx
|
|
4395
|
-
function
|
|
4573
|
+
function Dt({ steps: r = [], variant: i = "steps", label: a = "Progress", linkComponent: o, className: s = "", ...c }) {
|
|
4396
4574
|
return T("AppStepper", c), /* @__PURE__ */ t("nav", {
|
|
4397
4575
|
className: [i === "journey" ? "stepper stepper-journey" : "stepper", s].filter(Boolean).join(" "),
|
|
4398
4576
|
"aria-label": a,
|
|
@@ -4439,7 +4617,7 @@ function Ct({ steps: r = [], variant: i = "steps", label: a = "Progress", linkCo
|
|
|
4439
4617
|
}
|
|
4440
4618
|
//#endregion
|
|
4441
4619
|
//#region src/components/AppSwitch.jsx
|
|
4442
|
-
var
|
|
4620
|
+
var Ot = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
4443
4621
|
T("AppSwitch", s);
|
|
4444
4622
|
let l = o(), u = r || i || l;
|
|
4445
4623
|
return /* @__PURE__ */ n("div", {
|
|
@@ -4460,7 +4638,7 @@ var wt = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
|
4460
4638
|
});
|
|
4461
4639
|
//#endregion
|
|
4462
4640
|
//#region src/components/AppTableEmptyState.jsx
|
|
4463
|
-
function
|
|
4641
|
+
function kt({ icon: e, title: r, text: i, action: a, ...o }) {
|
|
4464
4642
|
return T("AppTableEmptyState", o), /* @__PURE__ */ n("div", {
|
|
4465
4643
|
className: "tbl-empty",
|
|
4466
4644
|
children: [
|
|
@@ -4488,7 +4666,7 @@ function Tt({ icon: e, title: r, text: i, action: a, ...o }) {
|
|
|
4488
4666
|
}
|
|
4489
4667
|
//#endregion
|
|
4490
4668
|
//#region src/components/AppTabs.jsx
|
|
4491
|
-
function
|
|
4669
|
+
function At({ tabs: e, value: r, onChange: i, variant: a = "underline", ariaLabel: o, className: s = "", ...l }) {
|
|
4492
4670
|
T("AppTabs", l);
|
|
4493
4671
|
let u = c(null);
|
|
4494
4672
|
function d(t) {
|
|
@@ -4532,7 +4710,7 @@ function Et({ tabs: e, value: r, onChange: i, variant: a = "underline", ariaLabe
|
|
|
4532
4710
|
}
|
|
4533
4711
|
//#endregion
|
|
4534
4712
|
//#region src/components/AppTextarea.jsx
|
|
4535
|
-
var
|
|
4713
|
+
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) {
|
|
4536
4714
|
T("AppTextarea", v);
|
|
4537
4715
|
let b = d || f, x = [
|
|
4538
4716
|
"textarea",
|
|
@@ -4594,7 +4772,7 @@ var Dt = r(function({ label: e, required: r = !1, error: a, hint: o, help: l, he
|
|
|
4594
4772
|
});
|
|
4595
4773
|
//#endregion
|
|
4596
4774
|
//#region src/components/AppTimeline.jsx
|
|
4597
|
-
function
|
|
4775
|
+
function Mt({ items: e = [], className: r = "", ...i }) {
|
|
4598
4776
|
return T("AppTimeline", i), /* @__PURE__ */ t("ol", {
|
|
4599
4777
|
className: `timeline${r ? ` ${r}` : ""}`,
|
|
4600
4778
|
children: e.map((e, r) => /* @__PURE__ */ n("li", {
|
|
@@ -4632,4 +4810,4 @@ function Ot({ items: e = [], className: r = "", ...i }) {
|
|
|
4632
4810
|
});
|
|
4633
4811
|
}
|
|
4634
4812
|
//#endregion
|
|
4635
|
-
export { k as ActionIcon, A as AppAccordion, j as AppAlert,
|
|
4813
|
+
export { k as ActionIcon, A as AppAccordion, j as AppAlert, xe as AppAutocomplete, Ce as AppAvatar, we as AppBadge, Z as AppButton, De as AppCallout, Oe as AppCard, ke as AppCheckbox, Ae as AppChip, je as AppChoiceCard, Me as AppChoiceChip, Ne as AppColorField, Pe as AppCompareTable, ze as AppConfirmDialog, Ye as AppDataTable, Xe as AppDatePicker, Qe as AppDropdown, $e as AppEmptyState, et as AppFileAttachment, it as AppFilePicker, at as AppInfoList, Q as AppInfoTip, Fe as AppInput, ot as AppKpiTile, st as AppLogoPicker, Le as AppModal, ct as AppMultiSelect, lt as AppOtpInput, ut as AppPageHeader, dt as AppPhoneNumberInput, ft as AppPricingCard, pt as AppRadio, mt as AppRepeater, ht as AppResourceCard, gt as AppSearch, _t as AppSegmented, yt as AppSelect, We as AppSelectMini, bt as AppShell, Ct as AppSidebarMenu, Be as AppSkeleton, Ue as AppSkeletonRows, wt as AppSpinner, Tt as AppSplash, Et as AppStatusBadge, Dt as AppStepper, Ot as AppSwitch, kt as AppTableEmptyState, Ke as AppTablePagination, At as AppTabs, jt as AppTextarea, Mt as AppTimeline, O as Icon, Re as MODAL_ICONS, X as RequiredMark, rt as errorToast, D as iconNames, nt as toast };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-react",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.8",
|
|
4
4
|
"description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"sideEffects": false,
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"react-toastify": "^11.1.0",
|
|
32
|
-
"@webority/theme": "^0.6.
|
|
33
|
-
"@webority/ui-elements": "^0.6.
|
|
32
|
+
"@webority/theme": "^0.6.8",
|
|
33
|
+
"@webority/ui-elements": "^0.6.8"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"bootstrap": "5.3.3",
|