@webority/ui-react 0.6.6 → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -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
|
@@ -739,7 +739,103 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
739
739
|
disconnectedCallback() {
|
|
740
740
|
this._onDocClick && document.removeEventListener("click", this._onDocClick);
|
|
741
741
|
}
|
|
742
|
-
}, W = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), G = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), oe = [
|
|
742
|
+
}, 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 {
|
|
743
|
+
static get observedAttributes() {
|
|
744
|
+
return [
|
|
745
|
+
"value",
|
|
746
|
+
"length",
|
|
747
|
+
"mode",
|
|
748
|
+
"disabled",
|
|
749
|
+
"aria-label"
|
|
750
|
+
];
|
|
751
|
+
}
|
|
752
|
+
get length() {
|
|
753
|
+
let e = Number.parseInt(this.getAttribute("length") ?? "6", 10);
|
|
754
|
+
return Number.isFinite(e) && e > 0 ? e : 6;
|
|
755
|
+
}
|
|
756
|
+
set length(e) {
|
|
757
|
+
this.setAttribute("length", String(e));
|
|
758
|
+
}
|
|
759
|
+
get mode() {
|
|
760
|
+
return this.getAttribute("mode") === "alphanumeric" ? "alphanumeric" : "numeric";
|
|
761
|
+
}
|
|
762
|
+
set mode(e) {
|
|
763
|
+
this.setAttribute("mode", String(e ?? "numeric"));
|
|
764
|
+
}
|
|
765
|
+
get value() {
|
|
766
|
+
return this._value ?? "";
|
|
767
|
+
}
|
|
768
|
+
set value(e) {
|
|
769
|
+
this._value = this._clean(e), P(this, this._value), this._paint();
|
|
770
|
+
}
|
|
771
|
+
_clean(e) {
|
|
772
|
+
return (e == null ? "" : String(e)).replace(this.mode === "alphanumeric" ? se : oe, "").slice(0, this.length);
|
|
773
|
+
}
|
|
774
|
+
connectedCallback() {
|
|
775
|
+
this._rendered || this.render();
|
|
776
|
+
}
|
|
777
|
+
attributeChangedCallback(e, t, n) {
|
|
778
|
+
this._rendered && (e === "value" ? (this._value = this._clean(n), P(this, this._value), this._paint()) : this.render());
|
|
779
|
+
}
|
|
780
|
+
render() {
|
|
781
|
+
this._value = this._clean(this.getAttribute("value") ?? this._value);
|
|
782
|
+
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, """)}"` : "";
|
|
783
|
+
this.innerHTML = `
|
|
784
|
+
<div class="otp">
|
|
785
|
+
<input
|
|
786
|
+
class="otp-field"
|
|
787
|
+
type="text"
|
|
788
|
+
autocomplete="one-time-code"
|
|
789
|
+
inputmode="${t ? "numeric" : "text"}"
|
|
790
|
+
${t ? "pattern=\"[0-9]*\"" : ""}${a}
|
|
791
|
+
autocapitalize="off"
|
|
792
|
+
autocorrect="off"
|
|
793
|
+
spellcheck="false"
|
|
794
|
+
${n ? "disabled" : ""} />
|
|
795
|
+
<div class="otp-slots" aria-hidden="true">${r}</div>
|
|
796
|
+
</div>`, this._rendered = !0, P(this, this._value), this._wire(), this._paint();
|
|
797
|
+
}
|
|
798
|
+
_refs() {
|
|
799
|
+
return {
|
|
800
|
+
input: this.querySelector(".otp-field"),
|
|
801
|
+
slots: [...this.querySelectorAll(".otp-slot")]
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
_paint() {
|
|
805
|
+
let { input: e, slots: t } = this._refs();
|
|
806
|
+
if (!e || !t.length) return;
|
|
807
|
+
e.value !== this._value && (e.value = this._value);
|
|
808
|
+
let n = e.selectionStart ?? this._value.length, r = Math.min(n, t.length - 1), i = document.activeElement === e;
|
|
809
|
+
t.forEach((e, t) => {
|
|
810
|
+
e.textContent = this._value[t] ?? "", e.classList.toggle("filled", !!this._value[t]), e.classList.toggle("active", i && t === r);
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
_wire() {
|
|
814
|
+
let { input: e } = this._refs();
|
|
815
|
+
if (!e) return;
|
|
816
|
+
let t = (e) => {
|
|
817
|
+
let t = this._clean(e), n = t !== this._value;
|
|
818
|
+
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", {
|
|
819
|
+
bubbles: !0,
|
|
820
|
+
detail: t
|
|
821
|
+
}));
|
|
822
|
+
};
|
|
823
|
+
e.addEventListener("input", () => t(e.value)), e.addEventListener("paste", (e) => {
|
|
824
|
+
let n = e.clipboardData?.getData("text");
|
|
825
|
+
n != null && (e.preventDefault(), t(n));
|
|
826
|
+
});
|
|
827
|
+
for (let t of [
|
|
828
|
+
"keyup",
|
|
829
|
+
"click",
|
|
830
|
+
"focus",
|
|
831
|
+
"blur",
|
|
832
|
+
"select"
|
|
833
|
+
]) e.addEventListener(t, () => this._paint());
|
|
834
|
+
document.addEventListener("selectionchange", () => {
|
|
835
|
+
document.activeElement === e && this._paint();
|
|
836
|
+
});
|
|
837
|
+
}
|
|
838
|
+
}, le = [
|
|
743
839
|
[
|
|
744
840
|
"AF",
|
|
745
841
|
"Afghanistan",
|
|
@@ -1965,11 +2061,11 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
1965
2061
|
"Zimbabwe",
|
|
1966
2062
|
"263"
|
|
1967
2063
|
]
|
|
1968
|
-
], K = (e) => (
|
|
2064
|
+
], K = (e) => (le.find((t) => t[0] === e) || [
|
|
1969
2065
|
"",
|
|
1970
2066
|
"",
|
|
1971
2067
|
""
|
|
1972
|
-
])[2], q = (e) => `wui-flag wui-flag-${String(e).toLowerCase()}`,
|
|
2068
|
+
])[2], q = (e) => `wui-flag wui-flag-${String(e).toLowerCase()}`, ue = class extends HTMLElement {
|
|
1973
2069
|
static get observedAttributes() {
|
|
1974
2070
|
return [
|
|
1975
2071
|
"value",
|
|
@@ -1999,7 +2095,7 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
1999
2095
|
render() {
|
|
2000
2096
|
let e = this.getAttribute("placeholder") || "Enter phone number";
|
|
2001
2097
|
this._country = this.getAttribute("country") || this._country;
|
|
2002
|
-
let t =
|
|
2098
|
+
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
2099
|
this.innerHTML = `
|
|
2004
2100
|
<div class="phone-input-wrap">
|
|
2005
2101
|
<div class="phone-country-adornment">
|
|
@@ -2013,7 +2109,7 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2013
2109
|
<div class="country-list-scroll">${t}<div class="country-empty" hidden>No countries found</div></div>
|
|
2014
2110
|
</div>
|
|
2015
2111
|
</div>
|
|
2016
|
-
<input type="tel" class="input" placeholder="${
|
|
2112
|
+
<input type="tel" class="input" placeholder="${de(e)}" value="${de(this._national)}"${this.hasAttribute("disabled") ? " disabled" : ""} />
|
|
2017
2113
|
</div>`, this._rendered = !0, P(this, this.value), this._wire();
|
|
2018
2114
|
}
|
|
2019
2115
|
_wire() {
|
|
@@ -2054,7 +2150,7 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2054
2150
|
disconnectedCallback() {
|
|
2055
2151
|
this._reposition && (window.removeEventListener("scroll", this._reposition, !0), window.removeEventListener("resize", this._reposition)), this._onDocClick && document.removeEventListener("click", this._onDocClick);
|
|
2056
2152
|
}
|
|
2057
|
-
},
|
|
2153
|
+
}, de = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), fe = class extends HTMLElement {
|
|
2058
2154
|
static get observedAttributes() {
|
|
2059
2155
|
return [
|
|
2060
2156
|
"value",
|
|
@@ -2063,6 +2159,8 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2063
2159
|
"searchable",
|
|
2064
2160
|
"disabled",
|
|
2065
2161
|
"compact",
|
|
2162
|
+
"size",
|
|
2163
|
+
"clearable",
|
|
2066
2164
|
"aria-label"
|
|
2067
2165
|
];
|
|
2068
2166
|
}
|
|
@@ -2082,7 +2180,7 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2082
2180
|
return this._value;
|
|
2083
2181
|
}
|
|
2084
2182
|
set value(e) {
|
|
2085
|
-
this._value = e == null ? "" : String(e), P(this, this._value), this._syncSelected();
|
|
2183
|
+
this._value = e == null ? "" : String(e), P(this, this._value), this._syncSelected(), this._syncReset();
|
|
2086
2184
|
}
|
|
2087
2185
|
set options(e) {
|
|
2088
2186
|
this._optionsProp = Array.isArray(e) ? e : null, this.isConnected && this.render();
|
|
@@ -2105,29 +2203,31 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2105
2203
|
}
|
|
2106
2204
|
render() {
|
|
2107
2205
|
this._snapshotDeclared();
|
|
2108
|
-
let e = this._readOptions(), t = this.hasAttribute("searchable"), n = this.getAttribute("placeholder") || "Select...",
|
|
2109
|
-
|
|
2110
|
-
let
|
|
2206
|
+
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);
|
|
2207
|
+
s && (this._value = String(s.value)), P(this, this._value);
|
|
2208
|
+
let c = e.map((e) => {
|
|
2111
2209
|
let t = String(e.value) === String(this._value);
|
|
2112
2210
|
return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${J(e.value)}" aria-selected="${t}">${L(e)}</button>`;
|
|
2113
2211
|
}).join("");
|
|
2114
2212
|
this.innerHTML = `
|
|
2115
|
-
<div class="search-select${this.hasAttribute("compact") ? " search-select-compact" : ""}">
|
|
2213
|
+
<div class="search-select${this.hasAttribute("compact") ? " search-select-compact" : ""}${i}">
|
|
2116
2214
|
<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="${
|
|
2215
|
+
<span class="${s ? "" : "search-select-placeholder"}" data-label>${s ? L(s) : I(a)}</span>
|
|
2216
|
+
${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
2217
|
<i class="bi bi-chevron-down search-select-caret" aria-hidden="true"></i>
|
|
2119
2218
|
</button>
|
|
2120
2219
|
<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">${
|
|
2220
|
+
${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>` : ""}
|
|
2221
|
+
<div class="search-select-options">${c}<div class="search-select-empty" hidden>No matches</div></div>
|
|
2123
2222
|
</div>
|
|
2124
|
-
</div>`, this._rendered = !0, P(this, this._value), this._wire();
|
|
2223
|
+
</div>`, this._rendered = !0, P(this, this._value), this._wire(), this._syncReset();
|
|
2125
2224
|
}
|
|
2126
2225
|
_refs() {
|
|
2127
2226
|
return {
|
|
2128
2227
|
control: this.querySelector(".search-select-control"),
|
|
2129
2228
|
menu: this.querySelector(".search-select-menu"),
|
|
2130
2229
|
label: this.querySelector("[data-label]"),
|
|
2230
|
+
reset: this.querySelector(".search-select-reset"),
|
|
2131
2231
|
search: this.querySelector(".search-select-input"),
|
|
2132
2232
|
clear: this.querySelector(".search-select-clear"),
|
|
2133
2233
|
empty: this.querySelector(".search-select-empty"),
|
|
@@ -2148,6 +2248,10 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2148
2248
|
}
|
|
2149
2249
|
e && (e.innerHTML = t ? L(t) : e.innerHTML, e.classList.toggle("search-select-placeholder", !t));
|
|
2150
2250
|
}
|
|
2251
|
+
_syncReset() {
|
|
2252
|
+
let { reset: e } = this._refs();
|
|
2253
|
+
e && (e.hidden = !(this.hasAttribute("clearable") && this._value !== "" && !this.hasAttribute("disabled")));
|
|
2254
|
+
}
|
|
2151
2255
|
_wire() {
|
|
2152
2256
|
let e = this._refs();
|
|
2153
2257
|
if (!e.control || !e.menu) return;
|
|
@@ -2176,7 +2280,9 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2176
2280
|
let r = this._visible();
|
|
2177
2281
|
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
2282
|
};
|
|
2179
|
-
e.
|
|
2283
|
+
e.reset?.addEventListener("click", (t) => {
|
|
2284
|
+
t.stopPropagation(), this.value = "", this.dispatchEvent(new Event("change", { bubbles: !0 })), e.control.focus();
|
|
2285
|
+
}), e.control.addEventListener("click", () => i() ? o() : a()), e.control.addEventListener("keydown", (e) => {
|
|
2180
2286
|
if (i()) {
|
|
2181
2287
|
c(e);
|
|
2182
2288
|
return;
|
|
@@ -2188,7 +2294,7 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2188
2294
|
}), e.optionsWrap.addEventListener("mousemove", (e) => {
|
|
2189
2295
|
let t = e.target.closest(".search-select-option");
|
|
2190
2296
|
t && n(this._visible().indexOf(t));
|
|
2191
|
-
}), e.search?.addEventListener("input", () => {
|
|
2297
|
+
}), e.optionsWrap.addEventListener("mouseleave", () => n(-1)), e.search?.addEventListener("input", () => {
|
|
2192
2298
|
r(e.search.value), n(-1);
|
|
2193
2299
|
}), e.search?.addEventListener("keydown", c), e.clear?.addEventListener("click", () => {
|
|
2194
2300
|
e.search.value = "", r(""), e.search.focus();
|
|
@@ -2201,14 +2307,14 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2201
2307
|
disconnectedCallback() {
|
|
2202
2308
|
this._onDocClick && document.removeEventListener("click", this._onDocClick);
|
|
2203
2309
|
}
|
|
2204
|
-
}, J = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"),
|
|
2310
|
+
}, J = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), pe = "image/png,image/jpeg,image/webp", me = {
|
|
2205
2311
|
"image/png": [".png"],
|
|
2206
2312
|
"image/jpeg": [".jpg", ".jpeg"],
|
|
2207
2313
|
"image/webp": [".webp"],
|
|
2208
2314
|
"image/gif": [".gif"],
|
|
2209
2315
|
"image/svg+xml": [".svg"],
|
|
2210
2316
|
"application/pdf": [".pdf"]
|
|
2211
|
-
},
|
|
2317
|
+
}, he = {
|
|
2212
2318
|
"image/png": "PNG",
|
|
2213
2319
|
"image/jpeg": "JPG",
|
|
2214
2320
|
"image/webp": "WEBP",
|
|
@@ -2222,33 +2328,33 @@ var F = Symbol("wui.trustedHtml"), I = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
2222
2328
|
".gif": "GIF",
|
|
2223
2329
|
".svg": "SVG",
|
|
2224
2330
|
".pdf": "PDF"
|
|
2225
|
-
},
|
|
2226
|
-
function
|
|
2331
|
+
}, ge = (e) => String(e || "").split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
|
|
2332
|
+
function _e(e) {
|
|
2227
2333
|
let t = [];
|
|
2228
|
-
for (let n of
|
|
2229
|
-
let e =
|
|
2334
|
+
for (let n of ge(e)) {
|
|
2335
|
+
let e = he[n] || (n.startsWith(".") ? n.slice(1).toUpperCase() : n.toUpperCase());
|
|
2230
2336
|
t.includes(e) || t.push(e);
|
|
2231
2337
|
}
|
|
2232
2338
|
return t.length <= 1 ? t[0] || "supported" : `${t.slice(0, -1).join(", ")} or ${t[t.length - 1]}`;
|
|
2233
2339
|
}
|
|
2234
|
-
function
|
|
2235
|
-
let n =
|
|
2340
|
+
function ve(e, t) {
|
|
2341
|
+
let n = ge(t);
|
|
2236
2342
|
if (!n.length) return !0;
|
|
2237
2343
|
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 && (
|
|
2344
|
+
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
2345
|
}
|
|
2240
|
-
function
|
|
2346
|
+
function ye(e, t = {}) {
|
|
2241
2347
|
if (!e) return null;
|
|
2242
|
-
let n = t.accept === void 0 ?
|
|
2243
|
-
return
|
|
2348
|
+
let n = t.accept === void 0 ? pe : t.accept, r = t.maxSizeMb || 5;
|
|
2349
|
+
return ve(e, n) ? e.size > r * 1024 * 1024 ? `Keep the file under ${r} MB.` : null : `Choose a ${_e(n)} file.`;
|
|
2244
2350
|
}
|
|
2245
2351
|
var Y = (e, t) => {
|
|
2246
2352
|
typeof customElements < "u" && !customElements.get(e) && customElements.define(e, t);
|
|
2247
2353
|
};
|
|
2248
|
-
function
|
|
2249
|
-
Y("wui-select",
|
|
2354
|
+
function be() {
|
|
2355
|
+
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
2356
|
}
|
|
2251
|
-
|
|
2357
|
+
be();
|
|
2252
2358
|
//#endregion
|
|
2253
2359
|
//#region src/components/RequiredMark.jsx
|
|
2254
2360
|
function X() {
|
|
@@ -2260,7 +2366,7 @@ function X() {
|
|
|
2260
2366
|
}
|
|
2261
2367
|
//#endregion
|
|
2262
2368
|
//#region src/components/AppAutocomplete.jsx
|
|
2263
|
-
function
|
|
2369
|
+
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
2370
|
T("AppAutocomplete", v);
|
|
2265
2371
|
let y = c(null), b = typeof o == "function";
|
|
2266
2372
|
return a(() => {
|
|
@@ -2321,13 +2427,13 @@ function ve({ value: e, onChange: r, options: i, loadOptions: o, placeholder: s
|
|
|
2321
2427
|
}
|
|
2322
2428
|
//#endregion
|
|
2323
2429
|
//#region src/components/AppAvatar.jsx
|
|
2324
|
-
function
|
|
2430
|
+
function Se(e) {
|
|
2325
2431
|
let t = (e || "").trim();
|
|
2326
2432
|
if (!t) return "?";
|
|
2327
2433
|
let n = t.split(/\s+/).filter(Boolean);
|
|
2328
2434
|
return n.length === 1 ? n[0].slice(0, 2).toUpperCase() : (n[0][0] + n[n.length - 1][0]).toUpperCase();
|
|
2329
2435
|
}
|
|
2330
|
-
function
|
|
2436
|
+
function Ce({ name: e, src: n, className: r = "", ...i }) {
|
|
2331
2437
|
T("AppAvatar", i);
|
|
2332
2438
|
let a = ["avatar", r].filter(Boolean).join(" ");
|
|
2333
2439
|
return n ? /* @__PURE__ */ t("span", {
|
|
@@ -2341,12 +2447,12 @@ function be({ name: e, src: n, className: r = "", ...i }) {
|
|
|
2341
2447
|
className: a,
|
|
2342
2448
|
role: "img",
|
|
2343
2449
|
"aria-label": e,
|
|
2344
|
-
children:
|
|
2450
|
+
children: Se(e)
|
|
2345
2451
|
});
|
|
2346
2452
|
}
|
|
2347
2453
|
//#endregion
|
|
2348
2454
|
//#region src/components/AppBadge.jsx
|
|
2349
|
-
function
|
|
2455
|
+
function we({ children: e, tone: n, dot: r = !1, className: i = "", ...a }) {
|
|
2350
2456
|
return T("AppBadge", a), /* @__PURE__ */ t(d, {
|
|
2351
2457
|
bg: !1,
|
|
2352
2458
|
className: [
|
|
@@ -2360,14 +2466,14 @@ function xe({ children: e, tone: n, dot: r = !1, className: i = "", ...a }) {
|
|
|
2360
2466
|
}
|
|
2361
2467
|
//#endregion
|
|
2362
2468
|
//#region src/components/AppButton.jsx
|
|
2363
|
-
var
|
|
2469
|
+
var Te = {
|
|
2364
2470
|
primary: "primary",
|
|
2365
2471
|
secondary: "secondary",
|
|
2366
2472
|
outline: "outline-primary",
|
|
2367
2473
|
ghost: "link",
|
|
2368
2474
|
danger: "danger"
|
|
2369
2475
|
};
|
|
2370
|
-
function
|
|
2476
|
+
function Ee(e, n) {
|
|
2371
2477
|
if (!e) return null;
|
|
2372
2478
|
let r = n === "left" ? "me-2" : "ms-2";
|
|
2373
2479
|
return typeof e == "string" ? /* @__PURE__ */ t(O, {
|
|
@@ -2384,7 +2490,7 @@ function Z({ children: e, variant: r = "primary", size: i = "md", type: a = "but
|
|
|
2384
2490
|
let m = [c ? "w-100" : "", d].filter(Boolean).join(" ");
|
|
2385
2491
|
return /* @__PURE__ */ n(f, {
|
|
2386
2492
|
type: (p.as === void 0 || p.as === "button") && p.href === void 0 ? a : void 0,
|
|
2387
|
-
variant:
|
|
2493
|
+
variant: Te[r] ?? "primary",
|
|
2388
2494
|
size: i === "md" ? void 0 : i,
|
|
2389
2495
|
disabled: s || o,
|
|
2390
2496
|
className: m || void 0,
|
|
@@ -2394,15 +2500,15 @@ function Z({ children: e, variant: r = "primary", size: i = "md", type: a = "but
|
|
|
2394
2500
|
className: "spinner-border spinner-border-sm me-2",
|
|
2395
2501
|
"aria-hidden": "true"
|
|
2396
2502
|
}),
|
|
2397
|
-
!o &&
|
|
2503
|
+
!o && Ee(l, "left"),
|
|
2398
2504
|
e,
|
|
2399
|
-
!o &&
|
|
2505
|
+
!o && Ee(u, "right")
|
|
2400
2506
|
]
|
|
2401
2507
|
});
|
|
2402
2508
|
}
|
|
2403
2509
|
//#endregion
|
|
2404
2510
|
//#region src/components/AppCallout.jsx
|
|
2405
|
-
function
|
|
2511
|
+
function De({ children: e, icon: r = "info", className: i = "", ...a }) {
|
|
2406
2512
|
return T("AppCallout", a), /* @__PURE__ */ n("div", {
|
|
2407
2513
|
className: `info-callout${i ? ` ${i}` : ""}`,
|
|
2408
2514
|
children: [r && /* @__PURE__ */ t("span", {
|
|
@@ -2416,7 +2522,7 @@ function we({ children: e, icon: r = "info", className: i = "", ...a }) {
|
|
|
2416
2522
|
}
|
|
2417
2523
|
//#endregion
|
|
2418
2524
|
//#region src/components/AppCard.jsx
|
|
2419
|
-
function
|
|
2525
|
+
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
2526
|
T("AppCard", h);
|
|
2421
2527
|
let g = a != null || r != null || o != null || s != null;
|
|
2422
2528
|
return /* @__PURE__ */ n(p, {
|
|
@@ -2441,7 +2547,7 @@ function Te({ title: r, titleClassName: i = "", header: a, headerExtra: o, heade
|
|
|
2441
2547
|
}
|
|
2442
2548
|
//#endregion
|
|
2443
2549
|
//#region src/components/AppCheckbox.jsx
|
|
2444
|
-
var
|
|
2550
|
+
var ke = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
2445
2551
|
T("AppCheckbox", s);
|
|
2446
2552
|
let l = o(), u = r || i || l;
|
|
2447
2553
|
return /* @__PURE__ */ n("div", {
|
|
@@ -2462,7 +2568,7 @@ var Ee = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
|
2462
2568
|
});
|
|
2463
2569
|
//#endregion
|
|
2464
2570
|
//#region src/components/AppChip.jsx
|
|
2465
|
-
function
|
|
2571
|
+
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
2572
|
T("AppChip", m);
|
|
2467
2573
|
let h = r ?? i, g = [
|
|
2468
2574
|
"chip",
|
|
@@ -2514,7 +2620,7 @@ function De({ label: r, children: i, tone: a = "neutral", size: o = "md", leadin
|
|
|
2514
2620
|
}
|
|
2515
2621
|
//#endregion
|
|
2516
2622
|
//#region src/components/AppChoiceCard.jsx
|
|
2517
|
-
function
|
|
2623
|
+
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
2624
|
return T("AppChoiceCard", y), /* @__PURE__ */ n("label", {
|
|
2519
2625
|
className: `struct-card${d ? " struct-card-img-card" : ""}${o ? " checked" : ""}${v ? ` ${v}` : ""}`,
|
|
2520
2626
|
children: [
|
|
@@ -2562,7 +2668,7 @@ function Oe({ name: r, multiple: i = !1, value: a, checked: o, onChange: s, icon
|
|
|
2562
2668
|
}
|
|
2563
2669
|
//#endregion
|
|
2564
2670
|
//#region src/components/AppChoiceChip.jsx
|
|
2565
|
-
function
|
|
2671
|
+
function Me({ multiple: e = !0, label: r, name: i, value: a, checked: o, onChange: s, children: c, count: l, className: u = "", ...d }) {
|
|
2566
2672
|
return T("AppChoiceChip", d), /* @__PURE__ */ n("label", {
|
|
2567
2673
|
className: `choice-chip${o ? " checked" : ""}${u ? ` ${u}` : ""}`,
|
|
2568
2674
|
children: [
|
|
@@ -2583,7 +2689,7 @@ function ke({ multiple: e = !0, label: r, name: i, value: a, checked: o, onChang
|
|
|
2583
2689
|
}
|
|
2584
2690
|
//#endregion
|
|
2585
2691
|
//#region src/components/AppColorField.jsx
|
|
2586
|
-
function
|
|
2692
|
+
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
2693
|
T("AppColorField", f);
|
|
2588
2694
|
let p = l || c;
|
|
2589
2695
|
return /* @__PURE__ */ n("div", {
|
|
@@ -2631,7 +2737,7 @@ function Ae({ value: e = "#000000", onChange: r, label: i, required: a = !1, err
|
|
|
2631
2737
|
}
|
|
2632
2738
|
//#endregion
|
|
2633
2739
|
//#region src/components/AppCompareTable.jsx
|
|
2634
|
-
function
|
|
2740
|
+
function Pe({ columns: e = [], rows: r = [], caption: i, className: a = "", ...o }) {
|
|
2635
2741
|
T("AppCompareTable", o);
|
|
2636
2742
|
let s = (e) => e === !0 ? /* @__PURE__ */ t("span", {
|
|
2637
2743
|
className: "compare-yes",
|
|
@@ -2714,7 +2820,7 @@ function Q({ label: e, children: r, ...i }) {
|
|
|
2714
2820
|
}
|
|
2715
2821
|
//#endregion
|
|
2716
2822
|
//#region src/components/AppInput.jsx
|
|
2717
|
-
var
|
|
2823
|
+
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
2824
|
T("AppInput", j);
|
|
2719
2825
|
let [N, ee] = l(!1), P = v || y, F = u === "password", I = F && N ? "text" : u, L = c(null), te = (e) => {
|
|
2720
2826
|
L.current = e, typeof M == "function" ? M(e) : M && (M.current = e);
|
|
@@ -2863,15 +2969,15 @@ var Me = r(function({ label: e, required: r = !1, error: i, hint: a, help: o, he
|
|
|
2863
2969
|
})
|
|
2864
2970
|
]
|
|
2865
2971
|
});
|
|
2866
|
-
}),
|
|
2867
|
-
function
|
|
2972
|
+
}), Ie = "a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])";
|
|
2973
|
+
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
2974
|
T("AppModal", v);
|
|
2869
2975
|
let y = c(null);
|
|
2870
2976
|
a(() => {
|
|
2871
2977
|
if (!e) return;
|
|
2872
2978
|
let t = y.current?.closest(".modal-content");
|
|
2873
2979
|
if (!t) return;
|
|
2874
|
-
let n = () => Array.from(t.querySelectorAll(
|
|
2980
|
+
let n = () => Array.from(t.querySelectorAll(Ie));
|
|
2875
2981
|
(t.querySelector("[data-autofocus]") || n().find((e) => !e.classList.contains("lx-modal-close")) || n()[0] || t).focus?.();
|
|
2876
2982
|
}, [e]);
|
|
2877
2983
|
let b = ["lx-modal-shell", f ? "is-side" : ""].filter(Boolean).join(" "), x = [
|
|
@@ -2956,7 +3062,7 @@ var $ = (e) => function({ size: n = 72 }) {
|
|
|
2956
3062
|
tone: e,
|
|
2957
3063
|
size: n
|
|
2958
3064
|
});
|
|
2959
|
-
},
|
|
3065
|
+
}, Re = {
|
|
2960
3066
|
success: $("success"),
|
|
2961
3067
|
error: $("error"),
|
|
2962
3068
|
warning: $("warning"),
|
|
@@ -2965,14 +3071,14 @@ var $ = (e) => function({ size: n = 72 }) {
|
|
|
2965
3071
|
};
|
|
2966
3072
|
//#endregion
|
|
2967
3073
|
//#region src/components/AppConfirmDialog.jsx
|
|
2968
|
-
function
|
|
3074
|
+
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
3075
|
T("AppConfirmDialog", h);
|
|
2970
3076
|
let [g, _] = l("");
|
|
2971
3077
|
if (a(() => {
|
|
2972
3078
|
r || _("");
|
|
2973
3079
|
}, [r]), !r) return null;
|
|
2974
|
-
let v = !!f && g.trim() !== f, y =
|
|
2975
|
-
return /* @__PURE__ */ t(
|
|
3080
|
+
let v = !!f && g.trim() !== f, y = Re[d || (u ? "delete" : "info")];
|
|
3081
|
+
return /* @__PURE__ */ t(Le, {
|
|
2976
3082
|
open: r,
|
|
2977
3083
|
hideHeader: !0,
|
|
2978
3084
|
title: i,
|
|
@@ -3008,7 +3114,7 @@ function Ie({ open: r, title: i, message: o, confirmLabel: s = "Confirm", cancel
|
|
|
3008
3114
|
className: "lx-confirm-msg",
|
|
3009
3115
|
children: o
|
|
3010
3116
|
}),
|
|
3011
|
-
f && /* @__PURE__ */ t(
|
|
3117
|
+
f && /* @__PURE__ */ t(Fe, {
|
|
3012
3118
|
fieldClassName: "mt-3 mb-0 w-100 text-start",
|
|
3013
3119
|
label: /* @__PURE__ */ n(e, { children: [
|
|
3014
3120
|
"Type ",
|
|
@@ -3025,7 +3131,7 @@ function Ie({ open: r, title: i, message: o, confirmLabel: s = "Confirm", cancel
|
|
|
3025
3131
|
}
|
|
3026
3132
|
//#endregion
|
|
3027
3133
|
//#region src/components/AppSkeleton.jsx
|
|
3028
|
-
function
|
|
3134
|
+
function Be({ width: e = "100%", height: n = 14, radius: r = 6, className: i = "", style: a, ...o }) {
|
|
3029
3135
|
return T("AppSkeleton", o), /* @__PURE__ */ t("span", {
|
|
3030
3136
|
className: `skeleton${i ? ` ${i}` : ""}`,
|
|
3031
3137
|
"aria-hidden": "true",
|
|
@@ -3037,7 +3143,7 @@ function Le({ width: e = "100%", height: n = 14, radius: r = 6, className: i = "
|
|
|
3037
3143
|
}
|
|
3038
3144
|
});
|
|
3039
3145
|
}
|
|
3040
|
-
var
|
|
3146
|
+
var Ve = [
|
|
3041
3147
|
"r0",
|
|
3042
3148
|
"r1",
|
|
3043
3149
|
"r2",
|
|
@@ -3046,7 +3152,7 @@ var Re = [
|
|
|
3046
3152
|
"r5",
|
|
3047
3153
|
"r6",
|
|
3048
3154
|
"r7"
|
|
3049
|
-
],
|
|
3155
|
+
], He = [
|
|
3050
3156
|
"c0",
|
|
3051
3157
|
"c1",
|
|
3052
3158
|
"c2",
|
|
@@ -3056,15 +3162,15 @@ var Re = [
|
|
|
3056
3162
|
"c6",
|
|
3057
3163
|
"c7"
|
|
3058
3164
|
];
|
|
3059
|
-
function
|
|
3060
|
-
return
|
|
3165
|
+
function Ue({ rows: e = 4, cols: n = 5 }) {
|
|
3166
|
+
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
3167
|
width: n === 0 ? "70%" : "50%",
|
|
3062
3168
|
height: 12
|
|
3063
3169
|
}) }, e)) }, e));
|
|
3064
3170
|
}
|
|
3065
3171
|
//#endregion
|
|
3066
3172
|
//#region src/components/AppSelectMini.jsx
|
|
3067
|
-
function
|
|
3173
|
+
function We({ value: e, onChange: n, options: r = [], placeholder: i = "Select...", name: o, ariaLabel: s, id: l, disabled: u, className: d, ...f }) {
|
|
3068
3174
|
T("AppSelectMini", f);
|
|
3069
3175
|
let p = c(null);
|
|
3070
3176
|
return a(() => {
|
|
@@ -3093,19 +3199,19 @@ function Ve({ value: e, onChange: n, options: r = [], placeholder: i = "Select..
|
|
|
3093
3199
|
}
|
|
3094
3200
|
//#endregion
|
|
3095
3201
|
//#region src/components/AppTablePagination.jsx
|
|
3096
|
-
var
|
|
3202
|
+
var Ge = [
|
|
3097
3203
|
5,
|
|
3098
3204
|
10,
|
|
3099
3205
|
25,
|
|
3100
3206
|
50
|
|
3101
3207
|
];
|
|
3102
|
-
function
|
|
3208
|
+
function Ke({ page: e, totalPages: r, pageSize: i, total: a, firstRow: o, lastRow: s, onPageChange: c, onPageSizeChange: l, pageSizes: u = Ge, ...d }) {
|
|
3103
3209
|
return T("AppTablePagination", d), /* @__PURE__ */ n("div", {
|
|
3104
3210
|
className: "table-pagination",
|
|
3105
3211
|
children: [
|
|
3106
3212
|
/* @__PURE__ */ n("span", {
|
|
3107
3213
|
className: "tpg-rows",
|
|
3108
|
-
children: ["Rows per page:", /* @__PURE__ */ t(
|
|
3214
|
+
children: ["Rows per page:", /* @__PURE__ */ t(We, {
|
|
3109
3215
|
value: i,
|
|
3110
3216
|
onChange: (e) => l(Number(e)),
|
|
3111
3217
|
ariaLabel: "Rows per page",
|
|
@@ -3154,13 +3260,13 @@ function Ue({ page: e, totalPages: r, pageSize: i, total: a, firstRow: o, lastRo
|
|
|
3154
3260
|
}
|
|
3155
3261
|
//#endregion
|
|
3156
3262
|
//#region src/components/AppDataTable.jsx
|
|
3157
|
-
function
|
|
3263
|
+
function qe(e) {
|
|
3158
3264
|
return e === "end" ? "lx-cell-end" : e === "num" ? "num" : e === "center" ? "text-center" : "";
|
|
3159
3265
|
}
|
|
3160
|
-
function
|
|
3266
|
+
function Je(e) {
|
|
3161
3267
|
return e == null || e === "" ? "—" : e;
|
|
3162
3268
|
}
|
|
3163
|
-
function
|
|
3269
|
+
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
3270
|
T("AppDataTable", S);
|
|
3165
3271
|
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
3272
|
e && (e.indeterminate = D);
|
|
@@ -3185,7 +3291,7 @@ function Ke({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3185
3291
|
r.map((e, r) => {
|
|
3186
3292
|
let i = !!(e.sortable && s), a = o && o.key === e.key;
|
|
3187
3293
|
return /* @__PURE__ */ n("th", {
|
|
3188
|
-
className: (i ? "sortable " : "") + (r === 0 ? "lx-name-cell " : "") +
|
|
3294
|
+
className: (i ? "sortable " : "") + (r === 0 ? "lx-name-cell " : "") + qe(e.align),
|
|
3189
3295
|
style: e.width ? { width: e.width } : void 0,
|
|
3190
3296
|
tabIndex: i ? 0 : void 0,
|
|
3191
3297
|
"aria-sort": a ? o.dir === "asc" ? "ascending" : "descending" : i ? "none" : void 0,
|
|
@@ -3212,7 +3318,7 @@ function Ke({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3212
3318
|
children: "Actions"
|
|
3213
3319
|
})
|
|
3214
3320
|
}))
|
|
3215
|
-
] }) }), /* @__PURE__ */ t("tbody", { children: c ? /* @__PURE__ */ t(
|
|
3321
|
+
] }) }), /* @__PURE__ */ t("tbody", { children: c ? /* @__PURE__ */ t(Ue, {
|
|
3216
3322
|
rows: l,
|
|
3217
3323
|
cols: C
|
|
3218
3324
|
}) : i?.length ? i.map((e) => {
|
|
@@ -3231,8 +3337,8 @@ function Ke({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3231
3337
|
})
|
|
3232
3338
|
}),
|
|
3233
3339
|
r.map((n, r) => /* @__PURE__ */ t("td", {
|
|
3234
|
-
className: (r === 0 ? "lx-name-cell " : "") +
|
|
3235
|
-
children: n.render ? n.render(e) :
|
|
3340
|
+
className: (r === 0 ? "lx-name-cell " : "") + qe(n.align) + (n.cellClassName ? ` ${n.cellClassName}` : ""),
|
|
3341
|
+
children: n.render ? n.render(e) : Je(e[n.key])
|
|
3236
3342
|
}, n.key)),
|
|
3237
3343
|
p && /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t("div", {
|
|
3238
3344
|
className: "u-row-actions",
|
|
@@ -3246,7 +3352,7 @@ function Ke({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3246
3352
|
children: A
|
|
3247
3353
|
}) }) })]
|
|
3248
3354
|
})
|
|
3249
|
-
}), h && !c && h.total > 0 && /* @__PURE__ */ t(
|
|
3355
|
+
}), h && !c && h.total > 0 && /* @__PURE__ */ t(Ke, {
|
|
3250
3356
|
page: h.page,
|
|
3251
3357
|
totalPages: h.totalPages,
|
|
3252
3358
|
pageSize: h.pageSize,
|
|
@@ -3259,7 +3365,7 @@ function Ke({ columns: r, rows: i, rowKey: a = (e) => e.id, sort: o, onSort: s,
|
|
|
3259
3365
|
}
|
|
3260
3366
|
//#endregion
|
|
3261
3367
|
//#region src/components/AppDatePicker.jsx
|
|
3262
|
-
function
|
|
3368
|
+
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
3369
|
T("AppDatePicker", y);
|
|
3264
3370
|
let b = c(null), x = o(), S = g || d || x;
|
|
3265
3371
|
a(() => {
|
|
@@ -3309,7 +3415,7 @@ function qe({ value: e, onChange: r, label: i, required: s = !1, hint: l, error:
|
|
|
3309
3415
|
}
|
|
3310
3416
|
//#endregion
|
|
3311
3417
|
//#region src/components/AppDropdown.jsx
|
|
3312
|
-
var
|
|
3418
|
+
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
3419
|
return /* @__PURE__ */ t("button", {
|
|
3314
3420
|
ref: l,
|
|
3315
3421
|
type: "button",
|
|
@@ -3323,11 +3429,11 @@ var Je = r(function({ icon: e, iconSize: n = 20, btnClassName: r = "topbar-icon-
|
|
|
3323
3429
|
})
|
|
3324
3430
|
});
|
|
3325
3431
|
});
|
|
3326
|
-
function
|
|
3432
|
+
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
3433
|
return T("AppDropdown", d), /* @__PURE__ */ n(_, {
|
|
3328
3434
|
align: s,
|
|
3329
3435
|
children: [/* @__PURE__ */ t(_.Toggle, {
|
|
3330
|
-
as:
|
|
3436
|
+
as: Ze,
|
|
3331
3437
|
icon: e,
|
|
3332
3438
|
iconSize: r,
|
|
3333
3439
|
btnClassName: i,
|
|
@@ -3365,7 +3471,7 @@ function Ye({ icon: e, iconSize: r, toggleClassName: i = "topbar-icon-btn", labe
|
|
|
3365
3471
|
}
|
|
3366
3472
|
//#endregion
|
|
3367
3473
|
//#region src/components/AppEmptyState.jsx
|
|
3368
|
-
function
|
|
3474
|
+
function $e({ icon: e, iconSize: r = 24, size: i = "md", title: a, text: o, action: s, className: c = "", style: l, ...u }) {
|
|
3369
3475
|
return T("AppEmptyState", u), /* @__PURE__ */ n("div", {
|
|
3370
3476
|
className: [
|
|
3371
3477
|
"empty-state",
|
|
@@ -3398,7 +3504,7 @@ function Xe({ icon: e, iconSize: r = 24, size: i = "md", title: a, text: o, acti
|
|
|
3398
3504
|
}
|
|
3399
3505
|
//#endregion
|
|
3400
3506
|
//#region src/components/AppFileAttachment.jsx
|
|
3401
|
-
function
|
|
3507
|
+
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
3508
|
T("AppFileAttachment", h);
|
|
3403
3509
|
let g = o(), _ = m || s || g, [v, y] = l(null), [b, x] = l("");
|
|
3404
3510
|
a(() => {
|
|
@@ -3411,7 +3517,7 @@ function Ze({ label: r = "Attachment", value: i, name: s, onChange: c, accept: u
|
|
|
3411
3517
|
function S(e) {
|
|
3412
3518
|
let t = e.target.files?.[0];
|
|
3413
3519
|
if (e.target.value = "", !t) return;
|
|
3414
|
-
let n =
|
|
3520
|
+
let n = ye(t, {
|
|
3415
3521
|
accept: u,
|
|
3416
3522
|
maxSizeMb: d
|
|
3417
3523
|
});
|
|
@@ -3510,22 +3616,22 @@ function Ze({ label: r = "Attachment", value: i, name: s, onChange: c, accept: u
|
|
|
3510
3616
|
}
|
|
3511
3617
|
//#endregion
|
|
3512
3618
|
//#region src/components/toast.js
|
|
3513
|
-
var
|
|
3619
|
+
var tt = /* @__PURE__ */ new Set([
|
|
3514
3620
|
"success",
|
|
3515
3621
|
"info",
|
|
3516
3622
|
"warning",
|
|
3517
3623
|
"error"
|
|
3518
3624
|
]);
|
|
3519
|
-
function
|
|
3520
|
-
let n =
|
|
3625
|
+
function nt(e, t = "success") {
|
|
3626
|
+
let n = tt.has(t) ? t : "success";
|
|
3521
3627
|
v[n](e, { toastId: `${n}:${e}` });
|
|
3522
3628
|
}
|
|
3523
|
-
function
|
|
3629
|
+
function rt(e) {
|
|
3524
3630
|
v.error(e, { toastId: `error:${e}` });
|
|
3525
3631
|
}
|
|
3526
3632
|
//#endregion
|
|
3527
3633
|
//#region src/components/AppFilePicker.jsx
|
|
3528
|
-
function
|
|
3634
|
+
function it({ label: e, value: r, name: i, onPick: s, accept: u = ".jpg,.jpeg,.png", maxSizeMb: d = 5, required: f, error: p, ...m }) {
|
|
3529
3635
|
T("AppFilePicker", m);
|
|
3530
3636
|
let [h, g] = l(null), [_, v] = l(!1), y = c(null), b = o(), x = i || b;
|
|
3531
3637
|
a(() => {
|
|
@@ -3536,11 +3642,11 @@ function tt({ label: e, value: r, name: i, onPick: s, accept: u = ".jpg,.jpeg,.p
|
|
|
3536
3642
|
g(null);
|
|
3537
3643
|
}, [r]);
|
|
3538
3644
|
let S = r?.url || h, C = (e) => {
|
|
3539
|
-
let t =
|
|
3645
|
+
let t = ye(e, {
|
|
3540
3646
|
accept: u,
|
|
3541
3647
|
maxSizeMb: d
|
|
3542
3648
|
});
|
|
3543
|
-
return t ? (
|
|
3649
|
+
return t ? (nt(t, "error"), !1) : (s(e), !0);
|
|
3544
3650
|
}, w = (e) => {
|
|
3545
3651
|
let t = e.target.files?.[0] || null;
|
|
3546
3652
|
t && (C(t) || (e.target.value = ""));
|
|
@@ -3651,7 +3757,7 @@ function tt({ label: e, value: r, name: i, onPick: s, accept: u = ".jpg,.jpeg,.p
|
|
|
3651
3757
|
}
|
|
3652
3758
|
//#endregion
|
|
3653
3759
|
//#region src/components/AppInfoList.jsx
|
|
3654
|
-
function
|
|
3760
|
+
function at({ items: r = [], className: i = "", ...a }) {
|
|
3655
3761
|
return T("AppInfoList", a), /* @__PURE__ */ t("div", {
|
|
3656
3762
|
className: `info-list${i ? ` ${i}` : ""}`,
|
|
3657
3763
|
children: r.map((r, i) => {
|
|
@@ -3684,7 +3790,7 @@ function nt({ items: r = [], className: i = "", ...a }) {
|
|
|
3684
3790
|
}
|
|
3685
3791
|
//#endregion
|
|
3686
3792
|
//#region src/components/AppKpiTile.jsx
|
|
3687
|
-
function
|
|
3793
|
+
function ot({ label: e, value: r, icon: i, delta: a, deltaDirection: o = "flat", inline: s = !1, className: c = "", ...l }) {
|
|
3688
3794
|
T("AppKpiTile", l);
|
|
3689
3795
|
let u = `kpi${s ? " kpi-inline" : ""}${c ? ` ${c}` : ""}`, d = o === "up" ? "arrow-up" : o === "down" ? "arrow-down" : null;
|
|
3690
3796
|
return /* @__PURE__ */ n("div", {
|
|
@@ -3717,7 +3823,7 @@ function rt({ label: e, value: r, icon: i, delta: a, deltaDirection: o = "flat",
|
|
|
3717
3823
|
}
|
|
3718
3824
|
//#endregion
|
|
3719
3825
|
//#region src/components/AppLogoPicker.jsx
|
|
3720
|
-
function
|
|
3826
|
+
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
3827
|
T("AppLogoPicker", m);
|
|
3722
3828
|
let h = c(null);
|
|
3723
3829
|
return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("button", {
|
|
@@ -3763,12 +3869,12 @@ function it({ value: r, fallback: i, name: a, onPick: o, loading: s = !1, accept
|
|
|
3763
3869
|
onChange: (e) => {
|
|
3764
3870
|
let t = e.target.files?.[0];
|
|
3765
3871
|
if (e.target.value = "", !t) return;
|
|
3766
|
-
let n =
|
|
3872
|
+
let n = ye(t, {
|
|
3767
3873
|
accept: l,
|
|
3768
3874
|
maxSizeMb: u
|
|
3769
3875
|
});
|
|
3770
3876
|
if (n) {
|
|
3771
|
-
|
|
3877
|
+
nt(n, "error");
|
|
3772
3878
|
return;
|
|
3773
3879
|
}
|
|
3774
3880
|
o(t);
|
|
@@ -3778,7 +3884,7 @@ function it({ value: r, fallback: i, name: a, onPick: o, loading: s = !1, accept
|
|
|
3778
3884
|
}
|
|
3779
3885
|
//#endregion
|
|
3780
3886
|
//#region src/components/AppMultiSelect.jsx
|
|
3781
|
-
function
|
|
3887
|
+
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
3888
|
T("AppMultiSelect", _);
|
|
3783
3889
|
let v = c(null);
|
|
3784
3890
|
return a(() => {
|
|
@@ -3824,8 +3930,61 @@ function at({ values: e, onChange: r, options: i, placeholder: o = "Select…",
|
|
|
3824
3930
|
});
|
|
3825
3931
|
}
|
|
3826
3932
|
//#endregion
|
|
3933
|
+
//#region src/components/AppOtpInput.jsx
|
|
3934
|
+
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) {
|
|
3935
|
+
T("AppOtpInput", v);
|
|
3936
|
+
let b = c(null), x = o(), S = g || h || x, C = (e) => {
|
|
3937
|
+
b.current = e, typeof y == "function" ? y(e) : y && (y.current = e);
|
|
3938
|
+
};
|
|
3939
|
+
a(() => {
|
|
3940
|
+
let t = b.current;
|
|
3941
|
+
t && String(t.value ?? "") !== String(e ?? "") && (t.value = e ?? "");
|
|
3942
|
+
}, [e]), a(() => {
|
|
3943
|
+
let e = b.current;
|
|
3944
|
+
if (!e) return;
|
|
3945
|
+
let t = () => r?.(e.value), n = (e) => i?.(e.detail);
|
|
3946
|
+
return e.addEventListener("change", t), e.addEventListener("complete", n), () => {
|
|
3947
|
+
e.removeEventListener("change", t), e.removeEventListener("complete", n);
|
|
3948
|
+
};
|
|
3949
|
+
}, [r, i]);
|
|
3950
|
+
let w = /* @__PURE__ */ t("wui-otp", {
|
|
3951
|
+
"aria-label": typeof u == "string" ? u : void 0,
|
|
3952
|
+
ref: C,
|
|
3953
|
+
id: S,
|
|
3954
|
+
name: h,
|
|
3955
|
+
length: String(s),
|
|
3956
|
+
mode: l,
|
|
3957
|
+
"aria-invalid": p ? "true" : void 0,
|
|
3958
|
+
disabled: m ? "" : void 0,
|
|
3959
|
+
required: d ? "" : void 0
|
|
3960
|
+
});
|
|
3961
|
+
return !u && !p && !f ? w : /* @__PURE__ */ n("div", {
|
|
3962
|
+
className: `field${_ ? ` ${_}` : ""}`,
|
|
3963
|
+
children: [
|
|
3964
|
+
u && /* @__PURE__ */ n("label", {
|
|
3965
|
+
className: "label",
|
|
3966
|
+
htmlFor: S,
|
|
3967
|
+
children: [u, d && /* @__PURE__ */ t("span", {
|
|
3968
|
+
className: "required",
|
|
3969
|
+
"aria-hidden": "true",
|
|
3970
|
+
children: "*"
|
|
3971
|
+
})]
|
|
3972
|
+
}),
|
|
3973
|
+
w,
|
|
3974
|
+
p && /* @__PURE__ */ t("div", {
|
|
3975
|
+
className: "field-error",
|
|
3976
|
+
children: p
|
|
3977
|
+
}),
|
|
3978
|
+
!p && f && /* @__PURE__ */ t("div", {
|
|
3979
|
+
className: "field-hint",
|
|
3980
|
+
children: f
|
|
3981
|
+
})
|
|
3982
|
+
]
|
|
3983
|
+
});
|
|
3984
|
+
});
|
|
3985
|
+
//#endregion
|
|
3827
3986
|
//#region src/components/AppPageHeader.jsx
|
|
3828
|
-
function
|
|
3987
|
+
function ut({ title: e, subtitle: r, actions: i, className: a = "", ...o }) {
|
|
3829
3988
|
return T("AppPageHeader", o), /* @__PURE__ */ n("div", {
|
|
3830
3989
|
className: `page-header${i ? " d-flex align-items-end justify-content-between" : ""}${a ? ` ${a}` : ""}`,
|
|
3831
3990
|
children: [/* @__PURE__ */ n("div", { children: [/* @__PURE__ */ t("div", {
|
|
@@ -3842,7 +4001,7 @@ function ot({ title: e, subtitle: r, actions: i, className: a = "", ...o }) {
|
|
|
3842
4001
|
}
|
|
3843
4002
|
//#endregion
|
|
3844
4003
|
//#region src/components/AppPhoneNumberInput.jsx
|
|
3845
|
-
function
|
|
4004
|
+
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
4005
|
T("AppPhoneNumberInput", m);
|
|
3847
4006
|
let h = c(null);
|
|
3848
4007
|
return a(() => {
|
|
@@ -3877,7 +4036,7 @@ function st({ value: e, onChange: r, country: i, disabled: o = !1, name: s, labe
|
|
|
3877
4036
|
}
|
|
3878
4037
|
//#endregion
|
|
3879
4038
|
//#region src/components/AppPricingCard.jsx
|
|
3880
|
-
function
|
|
4039
|
+
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
4040
|
return T("AppPricingCard", f), /* @__PURE__ */ n("div", {
|
|
3882
4041
|
className: [
|
|
3883
4042
|
"plan-card",
|
|
@@ -3930,7 +4089,7 @@ function ct({ name: e, price: r, unit: i, tagline: a, features: o = [], cta: s,
|
|
|
3930
4089
|
}
|
|
3931
4090
|
//#endregion
|
|
3932
4091
|
//#region src/components/AppRadio.jsx
|
|
3933
|
-
var
|
|
4092
|
+
var pt = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
3934
4093
|
T("AppRadio", s);
|
|
3935
4094
|
let l = o(), u = r || i || l;
|
|
3936
4095
|
return /* @__PURE__ */ n("div", {
|
|
@@ -3951,7 +4110,7 @@ var lt = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
|
3951
4110
|
});
|
|
3952
4111
|
//#endregion
|
|
3953
4112
|
//#region src/components/AppRepeater.jsx
|
|
3954
|
-
function
|
|
4113
|
+
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
4114
|
T("AppRepeater", p);
|
|
3956
4115
|
let m = typeof u == "number" && e.length >= u, h = !!a && e.length > l;
|
|
3957
4116
|
return /* @__PURE__ */ n("div", {
|
|
@@ -3995,7 +4154,7 @@ function ut({ rows: e = [], renderRow: r, onAdd: i, onRemove: a, addLabel: o = "
|
|
|
3995
4154
|
}
|
|
3996
4155
|
//#endregion
|
|
3997
4156
|
//#region src/components/AppResourceCard.jsx
|
|
3998
|
-
function
|
|
4157
|
+
function ht({ icon: r, title: i, text: a, href: o, external: s = !1, linkComponent: c, className: l = "", ...u }) {
|
|
3999
4158
|
T("AppResourceCard", u);
|
|
4000
4159
|
let d = /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", {
|
|
4001
4160
|
className: "res-card-icon",
|
|
@@ -4027,7 +4186,7 @@ function dt({ icon: r, title: i, text: a, href: o, external: s = !1, linkCompone
|
|
|
4027
4186
|
}
|
|
4028
4187
|
//#endregion
|
|
4029
4188
|
//#region src/components/AppSearch.jsx
|
|
4030
|
-
function
|
|
4189
|
+
function gt({ value: e, onValueChange: r, placeholder: i, ariaLabel: a, iconSize: o = 18, className: s = "", ...c }) {
|
|
4031
4190
|
return T("AppSearch", c), /* @__PURE__ */ n("div", {
|
|
4032
4191
|
className: [
|
|
4033
4192
|
"search-wrap",
|
|
@@ -4064,7 +4223,7 @@ function ft({ value: e, onValueChange: r, placeholder: i, ariaLabel: a, iconSize
|
|
|
4064
4223
|
}
|
|
4065
4224
|
//#endregion
|
|
4066
4225
|
//#region src/components/AppSegmented.jsx
|
|
4067
|
-
function
|
|
4226
|
+
function _t({ options: e = [], value: r, onChange: i, label: a, name: s, size: c = "md", className: l = "", ...u }) {
|
|
4068
4227
|
T("AppSegmented", u);
|
|
4069
4228
|
let d = o(), f = s || d;
|
|
4070
4229
|
return /* @__PURE__ */ t("div", {
|
|
@@ -4093,66 +4252,79 @@ function pt({ options: e = [], value: r, onChange: i, label: a, name: s, size: c
|
|
|
4093
4252
|
}
|
|
4094
4253
|
//#endregion
|
|
4095
4254
|
//#region src/components/AppSelect.jsx
|
|
4096
|
-
var
|
|
4097
|
-
function
|
|
4098
|
-
T("AppSelect",
|
|
4099
|
-
let
|
|
4255
|
+
var vt = (e) => e == null ? "" : e.label ?? e.text ?? "";
|
|
4256
|
+
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 }) {
|
|
4257
|
+
T("AppSelect", w);
|
|
4258
|
+
let E = c(null);
|
|
4100
4259
|
a(() => {
|
|
4101
|
-
|
|
4260
|
+
E.current && (E.current.options = i.map((e) => ({
|
|
4102
4261
|
value: e.value,
|
|
4103
|
-
label:
|
|
4262
|
+
label: vt(e)
|
|
4104
4263
|
})));
|
|
4105
4264
|
}, [i]), a(() => {
|
|
4106
|
-
let t =
|
|
4265
|
+
let t = E.current;
|
|
4107
4266
|
t && String(t.value ?? "") !== String(e ?? "") && (t.value = e ?? "");
|
|
4108
4267
|
}, [e]), a(() => {
|
|
4109
|
-
let e =
|
|
4268
|
+
let e = E.current;
|
|
4110
4269
|
if (!e) return;
|
|
4111
4270
|
let t = () => r?.(e.value);
|
|
4112
4271
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
4113
4272
|
}, [r]);
|
|
4114
|
-
let
|
|
4115
|
-
"aria-label": typeof
|
|
4116
|
-
ref:
|
|
4117
|
-
id:
|
|
4118
|
-
name:
|
|
4119
|
-
placeholder: o,
|
|
4273
|
+
let D = /* @__PURE__ */ t("wui-select", {
|
|
4274
|
+
"aria-label": typeof m == "string" ? m : void 0,
|
|
4275
|
+
ref: E,
|
|
4276
|
+
id: b || x,
|
|
4277
|
+
name: x,
|
|
4278
|
+
placeholder: f ? " " : o,
|
|
4120
4279
|
"search-placeholder": s,
|
|
4121
4280
|
searchable: l ? "" : void 0,
|
|
4122
|
-
|
|
4123
|
-
|
|
4281
|
+
clearable: u ? "" : void 0,
|
|
4282
|
+
size: d || void 0,
|
|
4283
|
+
disabled: p ? "" : void 0,
|
|
4284
|
+
required: h ? "" : void 0
|
|
4124
4285
|
});
|
|
4125
|
-
if (!
|
|
4126
|
-
let
|
|
4286
|
+
if (!m && !g && !_) return D;
|
|
4287
|
+
let O = b || x, k = f && m;
|
|
4127
4288
|
return /* @__PURE__ */ n("div", {
|
|
4128
|
-
className:
|
|
4289
|
+
className: [
|
|
4290
|
+
"field",
|
|
4291
|
+
S,
|
|
4292
|
+
C
|
|
4293
|
+
].filter(Boolean).join(" "),
|
|
4129
4294
|
children: [
|
|
4130
|
-
|
|
4295
|
+
m && !k && /* @__PURE__ */ n("label", {
|
|
4131
4296
|
className: "label",
|
|
4132
|
-
htmlFor:
|
|
4297
|
+
htmlFor: O,
|
|
4133
4298
|
children: [
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
label:
|
|
4138
|
-
children:
|
|
4299
|
+
m,
|
|
4300
|
+
h && /* @__PURE__ */ t(X, {}),
|
|
4301
|
+
v && /* @__PURE__ */ t(Q, {
|
|
4302
|
+
label: y,
|
|
4303
|
+
children: v
|
|
4139
4304
|
})
|
|
4140
4305
|
]
|
|
4141
4306
|
}),
|
|
4142
|
-
|
|
4143
|
-
|
|
4307
|
+
k ? /* @__PURE__ */ n("div", {
|
|
4308
|
+
className: "field-float",
|
|
4309
|
+
children: [D, /* @__PURE__ */ n("label", {
|
|
4310
|
+
className: "float-label",
|
|
4311
|
+
htmlFor: O,
|
|
4312
|
+
children: [m, h && /* @__PURE__ */ t(X, {})]
|
|
4313
|
+
})]
|
|
4314
|
+
}) : D,
|
|
4315
|
+
g ? /* @__PURE__ */ t("div", {
|
|
4144
4316
|
className: "field-error",
|
|
4145
|
-
children:
|
|
4146
|
-
}) :
|
|
4317
|
+
children: g
|
|
4318
|
+
}) : _ ? /* @__PURE__ */ t("div", {
|
|
4147
4319
|
className: "field-hint",
|
|
4148
|
-
children:
|
|
4320
|
+
children: _
|
|
4149
4321
|
}) : null
|
|
4150
4322
|
]
|
|
4151
4323
|
});
|
|
4152
4324
|
}
|
|
4153
4325
|
//#endregion
|
|
4154
4326
|
//#region src/components/AppShell.jsx
|
|
4155
|
-
function
|
|
4327
|
+
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
4328
|
T("AppShell", _);
|
|
4157
4329
|
let [v, y] = l(!1), [b, x] = l(!1), [S, C] = l(!1), w = d ?? v;
|
|
4158
4330
|
return a(() => {
|
|
@@ -4188,7 +4360,7 @@ function gt({ groups: e = [], brand: r, sidebarFooter: i, topbarStart: o, topbar
|
|
|
4188
4360
|
children: [e.label && /* @__PURE__ */ t("div", {
|
|
4189
4361
|
className: "app-nav-group-label",
|
|
4190
4362
|
children: e.label
|
|
4191
|
-
}), e.items.map((e) => /* @__PURE__ */ t(
|
|
4363
|
+
}), e.items.map((e) => /* @__PURE__ */ t(xt, {
|
|
4192
4364
|
item: e,
|
|
4193
4365
|
linkComponent: h,
|
|
4194
4366
|
onNavigate: () => x(!1)
|
|
@@ -4258,7 +4430,7 @@ function gt({ groups: e = [], brand: r, sidebarFooter: i, topbarStart: o, topbar
|
|
|
4258
4430
|
]
|
|
4259
4431
|
});
|
|
4260
4432
|
}
|
|
4261
|
-
function
|
|
4433
|
+
function xt({ item: r, linkComponent: i, onNavigate: a }) {
|
|
4262
4434
|
let o = `app-nav-item${r.active ? " active" : ""}`, s = /* @__PURE__ */ n(e, { children: [
|
|
4263
4435
|
r.icon && /* @__PURE__ */ t("span", {
|
|
4264
4436
|
className: "app-nav-icon",
|
|
@@ -4292,7 +4464,7 @@ function _t({ item: r, linkComponent: i, onNavigate: a }) {
|
|
|
4292
4464
|
}
|
|
4293
4465
|
//#endregion
|
|
4294
4466
|
//#region src/components/AppSidebarMenu.jsx
|
|
4295
|
-
var
|
|
4467
|
+
var St = {
|
|
4296
4468
|
left: "start",
|
|
4297
4469
|
right: "end",
|
|
4298
4470
|
start: "start",
|
|
@@ -4300,11 +4472,11 @@ var vt = {
|
|
|
4300
4472
|
top: "top",
|
|
4301
4473
|
bottom: "bottom"
|
|
4302
4474
|
};
|
|
4303
|
-
function
|
|
4475
|
+
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
4476
|
return T("AppSidebarMenu", b), /* @__PURE__ */ n(y, {
|
|
4305
4477
|
show: e,
|
|
4306
4478
|
onHide: r,
|
|
4307
|
-
placement:
|
|
4479
|
+
placement: St[i] || "end",
|
|
4308
4480
|
backdrop: d,
|
|
4309
4481
|
scroll: f,
|
|
4310
4482
|
keyboard: p,
|
|
@@ -4348,7 +4520,7 @@ function yt({ show: e, onHide: r, side: i = "right", title: a, titleIcon: o, hea
|
|
|
4348
4520
|
}
|
|
4349
4521
|
//#endregion
|
|
4350
4522
|
//#region src/components/AppSpinner.jsx
|
|
4351
|
-
function
|
|
4523
|
+
function wt({ size: e = "md", label: n = "Loading", className: r = "", ...i }) {
|
|
4352
4524
|
return T("AppSpinner", i), /* @__PURE__ */ t("span", {
|
|
4353
4525
|
className: `spinner-border${e === "sm" ? " spinner-border-sm" : ""}${r ? ` ${r}` : ""}`,
|
|
4354
4526
|
role: "status",
|
|
@@ -4357,7 +4529,7 @@ function bt({ size: e = "md", label: n = "Loading", className: r = "", ...i }) {
|
|
|
4357
4529
|
}
|
|
4358
4530
|
//#endregion
|
|
4359
4531
|
//#region src/components/AppSplash.jsx
|
|
4360
|
-
function
|
|
4532
|
+
function Tt({ logo: e, initials: r, text: i, label: a = "Loading", className: o = "", ...s }) {
|
|
4361
4533
|
return T("AppSplash", s), /* @__PURE__ */ t("div", {
|
|
4362
4534
|
className: `splash${o ? ` ${o}` : ""}`,
|
|
4363
4535
|
role: "status",
|
|
@@ -4384,7 +4556,7 @@ function xt({ logo: e, initials: r, text: i, label: a = "Loading", className: o
|
|
|
4384
4556
|
}
|
|
4385
4557
|
//#endregion
|
|
4386
4558
|
//#region src/components/AppStatusBadge.jsx
|
|
4387
|
-
function
|
|
4559
|
+
function Et({ label: e, tone: n = "neutral", className: r = "", ...i }) {
|
|
4388
4560
|
return T("AppStatusBadge", i), e == null || e === "" ? "—" : /* @__PURE__ */ t("span", {
|
|
4389
4561
|
className: `status-label ${n}${r ? ` ${r}` : ""}`,
|
|
4390
4562
|
children: e
|
|
@@ -4392,7 +4564,7 @@ function St({ label: e, tone: n = "neutral", className: r = "", ...i }) {
|
|
|
4392
4564
|
}
|
|
4393
4565
|
//#endregion
|
|
4394
4566
|
//#region src/components/AppStepper.jsx
|
|
4395
|
-
function
|
|
4567
|
+
function Dt({ steps: r = [], variant: i = "steps", label: a = "Progress", linkComponent: o, className: s = "", ...c }) {
|
|
4396
4568
|
return T("AppStepper", c), /* @__PURE__ */ t("nav", {
|
|
4397
4569
|
className: [i === "journey" ? "stepper stepper-journey" : "stepper", s].filter(Boolean).join(" "),
|
|
4398
4570
|
"aria-label": a,
|
|
@@ -4439,7 +4611,7 @@ function Ct({ steps: r = [], variant: i = "steps", label: a = "Progress", linkCo
|
|
|
4439
4611
|
}
|
|
4440
4612
|
//#endregion
|
|
4441
4613
|
//#region src/components/AppSwitch.jsx
|
|
4442
|
-
var
|
|
4614
|
+
var Ot = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
4443
4615
|
T("AppSwitch", s);
|
|
4444
4616
|
let l = o(), u = r || i || l;
|
|
4445
4617
|
return /* @__PURE__ */ n("div", {
|
|
@@ -4460,7 +4632,7 @@ var wt = r(function({ label: e, id: r, name: i, className: a = "", ...s }, c) {
|
|
|
4460
4632
|
});
|
|
4461
4633
|
//#endregion
|
|
4462
4634
|
//#region src/components/AppTableEmptyState.jsx
|
|
4463
|
-
function
|
|
4635
|
+
function kt({ icon: e, title: r, text: i, action: a, ...o }) {
|
|
4464
4636
|
return T("AppTableEmptyState", o), /* @__PURE__ */ n("div", {
|
|
4465
4637
|
className: "tbl-empty",
|
|
4466
4638
|
children: [
|
|
@@ -4488,7 +4660,7 @@ function Tt({ icon: e, title: r, text: i, action: a, ...o }) {
|
|
|
4488
4660
|
}
|
|
4489
4661
|
//#endregion
|
|
4490
4662
|
//#region src/components/AppTabs.jsx
|
|
4491
|
-
function
|
|
4663
|
+
function At({ tabs: e, value: r, onChange: i, variant: a = "underline", ariaLabel: o, className: s = "", ...l }) {
|
|
4492
4664
|
T("AppTabs", l);
|
|
4493
4665
|
let u = c(null);
|
|
4494
4666
|
function d(t) {
|
|
@@ -4532,7 +4704,7 @@ function Et({ tabs: e, value: r, onChange: i, variant: a = "underline", ariaLabe
|
|
|
4532
4704
|
}
|
|
4533
4705
|
//#endregion
|
|
4534
4706
|
//#region src/components/AppTextarea.jsx
|
|
4535
|
-
var
|
|
4707
|
+
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
4708
|
T("AppTextarea", v);
|
|
4537
4709
|
let b = d || f, x = [
|
|
4538
4710
|
"textarea",
|
|
@@ -4594,7 +4766,7 @@ var Dt = r(function({ label: e, required: r = !1, error: a, hint: o, help: l, he
|
|
|
4594
4766
|
});
|
|
4595
4767
|
//#endregion
|
|
4596
4768
|
//#region src/components/AppTimeline.jsx
|
|
4597
|
-
function
|
|
4769
|
+
function Mt({ items: e = [], className: r = "", ...i }) {
|
|
4598
4770
|
return T("AppTimeline", i), /* @__PURE__ */ t("ol", {
|
|
4599
4771
|
className: `timeline${r ? ` ${r}` : ""}`,
|
|
4600
4772
|
children: e.map((e, r) => /* @__PURE__ */ n("li", {
|
|
@@ -4632,4 +4804,4 @@ function Ot({ items: e = [], className: r = "", ...i }) {
|
|
|
4632
4804
|
});
|
|
4633
4805
|
}
|
|
4634
4806
|
//#endregion
|
|
4635
|
-
export { k as ActionIcon, A as AppAccordion, j as AppAlert,
|
|
4807
|
+
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.7",
|
|
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.7",
|
|
33
|
+
"@webority/ui-elements": "^0.6.7"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"bootstrap": "5.3.3",
|