@webority/ui-elements 0.9.19 → 0.9.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui-elements.global.js +52 -52
- package/dist/ui-elements.js +74 -53
- package/package.json +1 -1
package/dist/ui-elements.js
CHANGED
|
@@ -22,16 +22,24 @@ var e = {
|
|
|
22
22
|
}, r = 4, i = 300, a = 400;
|
|
23
23
|
function o(e, t, n = {}) {
|
|
24
24
|
if (!e || !t) return;
|
|
25
|
-
let o = e.getBoundingClientRect(), s =
|
|
26
|
-
|
|
27
|
-
let
|
|
28
|
-
t.style.
|
|
25
|
+
let o = e.getBoundingClientRect(), s = n.clampHeight ? t.scrollTop : 0;
|
|
26
|
+
n.clampHeight && (t.style.maxHeight = "");
|
|
27
|
+
let c = t.offsetHeight, l = window.innerHeight - o.bottom, u = l < c + r && o.top > l;
|
|
28
|
+
if (t.classList.toggle("drop-up", u), t.style.position = "fixed", t.style.top = u ? `${Math.max(r, o.top - c - r)}px` : `${o.bottom + r}px`, n.clampHeight) {
|
|
29
|
+
let e = u ? o.top - r * 2 : window.innerHeight - o.bottom - r * 2;
|
|
30
|
+
e < c && (t.style.maxHeight = `${Math.max(e, 0)}px`), t.scrollTop = s;
|
|
31
|
+
}
|
|
32
|
+
n.matchWidth && (o.width >= i ? (t.style.minWidth = `${o.width}px`, t.style.width = `${o.width}px`, t.style.maxWidth = `${o.width}px`) : (t.style.minWidth = `${o.width}px`, t.style.width = "max-content", t.style.maxWidth = `${Math.min(a, window.innerWidth - r * 2)}px`));
|
|
33
|
+
let d = t.offsetWidth, f = Math.min(o.left, window.innerWidth - d - r);
|
|
34
|
+
t.style.left = `${Math.max(r, f)}px`;
|
|
29
35
|
}
|
|
30
36
|
function s(e, t) {
|
|
31
|
-
c(e), e._reanchor = t,
|
|
37
|
+
c(e), e._reanchor = t, e._reanchorScroll = (n) => {
|
|
38
|
+
n.target instanceof Node && typeof e.contains == "function" && e.contains(n.target) || t();
|
|
39
|
+
}, window.addEventListener("resize", e._reanchor), window.addEventListener("scroll", e._reanchorScroll, !0);
|
|
32
40
|
}
|
|
33
41
|
function c(e) {
|
|
34
|
-
e?._reanchor && (window.removeEventListener("resize", e._reanchor), window.removeEventListener("scroll", e.
|
|
42
|
+
e?._reanchor && (window.removeEventListener("resize", e._reanchor), window.removeEventListener("scroll", e._reanchorScroll, !0), e._reanchor = null, e._reanchorScroll = null);
|
|
35
43
|
}
|
|
36
44
|
//#endregion
|
|
37
45
|
//#region src/formMirror.js
|
|
@@ -86,6 +94,8 @@ var d = {
|
|
|
86
94
|
"chevron-left": "<path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-miterlimit=\"10\" stroke-width=\"1.5\" d=\"M15 19.92L8.48 13.4c-.77-.77-.77-2.03 0-2.8L15 4.08\"></path>",
|
|
87
95
|
"chevron-right": "<path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-miterlimit=\"10\" stroke-width=\"1.5\" d=\"M8.91 19.92l6.52-6.52c.77-.77.77-2.03 0-2.8L8.91 4.08\"></path>",
|
|
88
96
|
"chevron-up": "<path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-miterlimit=\"10\" stroke-width=\"1.5\" d=\"M19.92 15.05L13.4 8.53c-.77-.77-2.03-.77-2.8 0l-6.52 6.52\"></path>",
|
|
97
|
+
"chevrons-left": "<path d=\"M12.7071 6.70711C13.0976 6.31658 13.0976 5.68342 12.7071 5.29289C12.3166 4.90237 11.6834 4.90237 11.2929 5.29289L5.29289 11.2929C4.91431 11.6715 4.90107 12.2811 5.26285 12.6757L10.7628 18.6757C11.136 19.0828 11.7686 19.1103 12.1757 18.7372C12.5828 18.364 12.6103 17.7314 12.2372 17.3243L7.38414 12.0301L12.7071 6.70711Z\" fill=\"currentColor\"/><path opacity=\"0.3\" d=\"M19.7071 6.70711C20.0976 6.31658 20.0976 5.68342 19.7071 5.29289C19.3166 4.90237 18.6834 4.90237 18.2929 5.29289L12.2929 11.2929C11.9143 11.6715 11.9011 12.2811 12.2628 12.6757L17.7628 18.6757C18.136 19.0828 18.7686 19.1103 19.1757 18.7372C19.5828 18.364 19.6103 17.7314 19.2372 17.3243L14.3841 12.0301L19.7071 6.70711Z\" fill=\"currentColor\"/>",
|
|
98
|
+
"chevrons-right": "<path d=\"M11.2929 6.70711C10.9024 6.31658 10.9024 5.68342 11.2929 5.29289C11.6834 4.90237 12.3166 4.90237 12.7071 5.29289L18.7071 11.2929C19.0857 11.6715 19.0989 12.2811 18.7372 12.6757L13.2372 18.6757C12.864 19.0828 12.2314 19.1103 11.8243 18.7372C11.4172 18.364 11.3897 17.7314 11.7628 17.3243L16.6159 12.0301L11.2929 6.70711Z\" fill=\"currentColor\"/><path opacity=\"0.3\" d=\"M4.29289 6.70711C3.90237 6.31658 3.90237 5.68342 4.29289 5.29289C4.68342 4.90237 5.31658 4.90237 5.70711 5.29289L11.7071 11.2929C12.0857 11.6715 12.0989 12.2811 11.7372 12.6757L6.23715 18.6757C5.86396 19.0828 5.23139 19.1103 4.82428 18.7372C4.41716 18.364 4.38965 17.7314 4.76285 17.3243L9.61586 12.0301L4.29289 6.70711Z\" fill=\"currentColor\"/>",
|
|
89
99
|
"chevrons-up-down": "<path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-miterlimit=\"10\" stroke-width=\"1.5\" d=\"M9.01 20.5l-5.02-5.01M9.01 3.5v17M14.99 3.5l5.02 5.01M14.99 20.5v-17\"></path>",
|
|
90
100
|
circle: "<path d=\"M11.97 22c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10Z\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path><path d=\"M12 16.23a4.23 4.23 0 1 0 0-8.46 4.23 4.23 0 0 0 0 8.46Z\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>",
|
|
91
101
|
"circle-help": "<path d=\"M17 18.43h-4l-4.45 2.96A.997.997 0 0 1 7 20.56v-2.13c-3 0-5-2-5-5v-6c0-3 2-5 5-5h10c3 0 5 2 5 5v6c0 3-2 5-5 5Z\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path><path d=\"M12 11.36v-.21c0-.68.42-1.04.84-1.33.41-.28.82-.64.82-1.3 0-.92-.74-1.66-1.66-1.66-.92 0-1.66.74-1.66 1.66M11.995 13.75h.01\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>",
|
|
@@ -717,7 +727,7 @@ var m = Symbol("wui.trustedHtml"), h = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
717
727
|
t && e.contains(document.activeElement) && t.focus();
|
|
718
728
|
}
|
|
719
729
|
_position(e, t) {
|
|
720
|
-
o(e, t);
|
|
730
|
+
o(e, t, { clampHeight: !0 });
|
|
721
731
|
}
|
|
722
732
|
_setFocus(e, t, n, r) {
|
|
723
733
|
let { y: i, m: a } = O(e, t);
|
|
@@ -1009,7 +1019,7 @@ var m = Symbol("wui.trustedHtml"), h = (e) => String(e ?? "").replace(/&/g, "&am
|
|
|
1009
1019
|
i && (i.textContent = this._start ? this._end ? `${E(this._start)} – ${E(this._end)}` : "Pick an end date" : "Pick a start date");
|
|
1010
1020
|
}
|
|
1011
1021
|
_position(e, t) {
|
|
1012
|
-
o(e, t);
|
|
1022
|
+
o(e, t, { clampHeight: !0 });
|
|
1013
1023
|
}
|
|
1014
1024
|
_pick(e) {
|
|
1015
1025
|
if (!this._start || this._start && this._end) {
|
|
@@ -2907,6 +2917,12 @@ function R(e, t) {
|
|
|
2907
2917
|
return t;
|
|
2908
2918
|
}
|
|
2909
2919
|
}
|
|
2920
|
+
function me(e, t) {
|
|
2921
|
+
if (t <= 0) return 0;
|
|
2922
|
+
let n = 0;
|
|
2923
|
+
for (let r = 0; r < e.length; r++) if (/[0-9]/.test(e[r]) && (n += 1, n === t)) return r + 1;
|
|
2924
|
+
return e.length;
|
|
2925
|
+
}
|
|
2910
2926
|
function z(e) {
|
|
2911
2927
|
if (!I) return null;
|
|
2912
2928
|
try {
|
|
@@ -2925,7 +2941,7 @@ function B(e) {
|
|
|
2925
2941
|
return null;
|
|
2926
2942
|
}
|
|
2927
2943
|
}
|
|
2928
|
-
function
|
|
2944
|
+
function he(e) {
|
|
2929
2945
|
if (!I) return null;
|
|
2930
2946
|
try {
|
|
2931
2947
|
let t = I.getExampleNumber(e, I.examples);
|
|
@@ -3113,10 +3129,15 @@ var H = class extends HTMLElement {
|
|
|
3113
3129
|
};
|
|
3114
3130
|
l.addEventListener("input", (e) => {
|
|
3115
3131
|
e.stopPropagation();
|
|
3116
|
-
let t = l.value.replace(/[^0-9]/g, ""),
|
|
3117
|
-
|
|
3118
|
-
let
|
|
3119
|
-
|
|
3132
|
+
let t = l.selectionStart ?? l.value.length, n = l.value.slice(0, t).replace(/[^0-9]/g, "").length, r = l.value.replace(/[^0-9]/g, ""), i = he(this._country);
|
|
3133
|
+
i && r.length > i && (r = r.slice(0, i)), this._national = r;
|
|
3134
|
+
let a = R(this._country, this._national);
|
|
3135
|
+
if (l.value !== a) {
|
|
3136
|
+
l.value = a;
|
|
3137
|
+
let e = me(a, Math.min(n, r.length));
|
|
3138
|
+
l.setSelectionRange(e, e);
|
|
3139
|
+
}
|
|
3140
|
+
this._syncMirror(), this._emitInput(), l.classList.contains("is-invalid") && (!this._national || B(this.value) === !0) && x(!1);
|
|
3120
3141
|
}), l.addEventListener("change", (e) => e.stopPropagation()), l.addEventListener("blur", () => {
|
|
3121
3142
|
x(this._national.length > 0 && B(this.value) === !1), this.value !== this._committedValue && this._emitChange();
|
|
3122
3143
|
}), l.addEventListener("paste", (e) => {
|
|
@@ -3143,7 +3164,7 @@ var H = class extends HTMLElement {
|
|
|
3143
3164
|
disconnectedCallback() {
|
|
3144
3165
|
this._teardown();
|
|
3145
3166
|
}
|
|
3146
|
-
}, U = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"),
|
|
3167
|
+
}, U = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), ge = class extends HTMLElement {
|
|
3147
3168
|
static formAssociated = !0;
|
|
3148
3169
|
static get observedAttributes() {
|
|
3149
3170
|
return [
|
|
@@ -3349,7 +3370,7 @@ var H = class extends HTMLElement {
|
|
|
3349
3370
|
disconnectedCallback() {
|
|
3350
3371
|
this._teardown();
|
|
3351
3372
|
}
|
|
3352
|
-
}, W = (e) => String(e ?? "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<"),
|
|
3373
|
+
}, W = (e) => String(e ?? "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<"), _e = class extends HTMLElement {
|
|
3353
3374
|
static formAssociated = !0;
|
|
3354
3375
|
static get observedAttributes() {
|
|
3355
3376
|
return [
|
|
@@ -3491,7 +3512,7 @@ var H = class extends HTMLElement {
|
|
|
3491
3512
|
aria-valuenow="${this._value}"
|
|
3492
3513
|
aria-valuetext="${this._formatValue(this._value)}"
|
|
3493
3514
|
${a ? "disabled" : ""}
|
|
3494
|
-
aria-label="${
|
|
3515
|
+
aria-label="${ve(this.getAttribute("aria-label") || "Value")}"
|
|
3495
3516
|
></button>
|
|
3496
3517
|
`}
|
|
3497
3518
|
${this.hasAttribute("show-value") ? n ? `<span class="slider-value">${this._formatValue(this._start)} – ${this._formatValue(this._end)}</span>` : `<span class="slider-value">${this._formatValue(this._value)}</span>` : ""}
|
|
@@ -3594,7 +3615,7 @@ var H = class extends HTMLElement {
|
|
|
3594
3615
|
}, G = (e, t) => {
|
|
3595
3616
|
let n = Number.parseFloat(e);
|
|
3596
3617
|
return Number.isFinite(n) ? n : t;
|
|
3597
|
-
},
|
|
3618
|
+
}, ve = (e) => String(e ?? "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<"), ye = class extends HTMLElement {
|
|
3598
3619
|
static formAssociated = !0;
|
|
3599
3620
|
_accessibleName() {
|
|
3600
3621
|
return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Add tags";
|
|
@@ -3679,7 +3700,7 @@ var H = class extends HTMLElement {
|
|
|
3679
3700
|
e.innerHTML = "";
|
|
3680
3701
|
return;
|
|
3681
3702
|
}
|
|
3682
|
-
e.innerHTML = this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${
|
|
3703
|
+
e.innerHTML = this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${be(e)}</span><button type="button" class="chip-remove" data-remove="${K(e)}" aria-label="Remove ${K(e)}">${f("x")}</button></span>`).join("");
|
|
3683
3704
|
}
|
|
3684
3705
|
}
|
|
3685
3706
|
_wire() {
|
|
@@ -3750,7 +3771,7 @@ var H = class extends HTMLElement {
|
|
|
3750
3771
|
disconnectedCallback() {
|
|
3751
3772
|
this._teardown();
|
|
3752
3773
|
}
|
|
3753
|
-
},
|
|
3774
|
+
}, be = (e) => String(e ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), K = (e) => String(e ?? "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<"), q = (e) => String(e).padStart(2, "0"), xe = (e, t) => `${q(e)}:${q(t)}`, J = (e) => {
|
|
3754
3775
|
let t = /^(\d{2}):(\d{2})$/.exec(e || "");
|
|
3755
3776
|
return t ? {
|
|
3756
3777
|
h: +t[1],
|
|
@@ -3758,10 +3779,10 @@ var H = class extends HTMLElement {
|
|
|
3758
3779
|
} : null;
|
|
3759
3780
|
}, Y = (e, t = "24") => {
|
|
3760
3781
|
if (!e) return "";
|
|
3761
|
-
if (t === "24") return
|
|
3782
|
+
if (t === "24") return xe(e.h, e.m);
|
|
3762
3783
|
let n = e.h % 12 || 12, r = e.h >= 12 ? "PM" : "AM";
|
|
3763
3784
|
return `${n}:${q(e.m)} ${r}`;
|
|
3764
|
-
},
|
|
3785
|
+
}, Se = class extends HTMLElement {
|
|
3765
3786
|
static formAssociated = !0;
|
|
3766
3787
|
static get observedAttributes() {
|
|
3767
3788
|
return [
|
|
@@ -3846,7 +3867,7 @@ var H = class extends HTMLElement {
|
|
|
3846
3867
|
if (!e) return;
|
|
3847
3868
|
let t = this.getAttribute("format") || "24", n = this._buildTimes(), r = J(this._value), i = this._focus, a = "";
|
|
3848
3869
|
for (let e = 0; e < n.length; e++) {
|
|
3849
|
-
let o = n[e], s =
|
|
3870
|
+
let o = n[e], s = xe(o.h, o.m), c = r && r.h === o.h && r.m === o.m;
|
|
3850
3871
|
a += `<button type="button" class="timepicker-option${c ? " is-selected" : ""}" data-hm="${s}" role="option" tabindex="${i === e ? "0" : "-1"}"${c ? " aria-selected=\"true\"" : ""}>${Y(o, t)}</button>`;
|
|
3851
3872
|
}
|
|
3852
3873
|
e.innerHTML = a, this._focusActive();
|
|
@@ -3945,7 +3966,7 @@ var H = class extends HTMLElement {
|
|
|
3945
3966
|
disconnectedCallback() {
|
|
3946
3967
|
this._teardown();
|
|
3947
3968
|
}
|
|
3948
|
-
},
|
|
3969
|
+
}, Ce = "wui-wizard-step", we = class extends HTMLElement {
|
|
3949
3970
|
static get observedAttributes() {
|
|
3950
3971
|
return [
|
|
3951
3972
|
"active",
|
|
@@ -3979,7 +4000,7 @@ var H = class extends HTMLElement {
|
|
|
3979
4000
|
this._beforeNext = typeof e == "function" ? e : null;
|
|
3980
4001
|
}
|
|
3981
4002
|
get _steps() {
|
|
3982
|
-
return [...this.querySelectorAll(`:scope > ${
|
|
4003
|
+
return [...this.querySelectorAll(`:scope > ${Ce}`)];
|
|
3983
4004
|
}
|
|
3984
4005
|
refresh() {
|
|
3985
4006
|
this._rendered && this._renderChrome();
|
|
@@ -4112,7 +4133,7 @@ var H = class extends HTMLElement {
|
|
|
4112
4133
|
_reflectActive(e) {
|
|
4113
4134
|
this._reflecting = !0, this.setAttribute("active", String(e)), this._reflecting = !1;
|
|
4114
4135
|
}
|
|
4115
|
-
}, X = (e) => String(e ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"),
|
|
4136
|
+
}, X = (e) => String(e ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), Te = class extends HTMLElement {
|
|
4116
4137
|
static get observedAttributes() {
|
|
4117
4138
|
return [
|
|
4118
4139
|
"label",
|
|
@@ -4126,8 +4147,8 @@ var H = class extends HTMLElement {
|
|
|
4126
4147
|
let e = this.closest("wui-wizard");
|
|
4127
4148
|
e && typeof e.refresh == "function" && e.refresh();
|
|
4128
4149
|
}
|
|
4129
|
-
},
|
|
4130
|
-
async function
|
|
4150
|
+
}, Ee = 2e3;
|
|
4151
|
+
async function De(e) {
|
|
4131
4152
|
try {
|
|
4132
4153
|
if (navigator.clipboard?.writeText) return await navigator.clipboard.writeText(e), !0;
|
|
4133
4154
|
} catch {}
|
|
@@ -4142,14 +4163,14 @@ async function Ee(e) {
|
|
|
4142
4163
|
}
|
|
4143
4164
|
//#endregion
|
|
4144
4165
|
//#region src/fileValidation.js
|
|
4145
|
-
var
|
|
4166
|
+
var Oe = "image/png,image/jpeg,image/webp", ke = 5, Ae = {
|
|
4146
4167
|
"image/png": [".png"],
|
|
4147
4168
|
"image/jpeg": [".jpg", ".jpeg"],
|
|
4148
4169
|
"image/webp": [".webp"],
|
|
4149
4170
|
"image/gif": [".gif"],
|
|
4150
4171
|
"image/svg+xml": [".svg"],
|
|
4151
4172
|
"application/pdf": [".pdf"]
|
|
4152
|
-
},
|
|
4173
|
+
}, je = {
|
|
4153
4174
|
"image/png": "PNG",
|
|
4154
4175
|
"image/jpeg": "JPG",
|
|
4155
4176
|
"image/webp": "WEBP",
|
|
@@ -4163,7 +4184,7 @@ var De = "image/png,image/jpeg,image/webp", Oe = 5, ke = {
|
|
|
4163
4184
|
".gif": "GIF",
|
|
4164
4185
|
".svg": "SVG",
|
|
4165
4186
|
".pdf": "PDF"
|
|
4166
|
-
}, Z = (e) => String(e || "").split(",").map((e) => e.trim().toLowerCase()).filter(Boolean),
|
|
4187
|
+
}, Z = (e) => String(e || "").split(",").map((e) => e.trim().toLowerCase()).filter(Boolean), Me = [
|
|
4167
4188
|
".png",
|
|
4168
4189
|
".jpg",
|
|
4169
4190
|
".jpeg",
|
|
@@ -4174,35 +4195,35 @@ var De = "image/png,image/jpeg,image/webp", Oe = 5, ke = {
|
|
|
4174
4195
|
".avif",
|
|
4175
4196
|
".heic"
|
|
4176
4197
|
];
|
|
4177
|
-
function
|
|
4198
|
+
function Ne(e) {
|
|
4178
4199
|
if (!e) return !1;
|
|
4179
4200
|
let t = typeof e == "object" && e.type ? String(e.type).toLowerCase() : "";
|
|
4180
4201
|
if (t) return t.startsWith("image/");
|
|
4181
4202
|
let n = typeof e == "string" ? e : e.name || e.url || "", r = String(n).toLowerCase();
|
|
4182
|
-
return
|
|
4203
|
+
return Me.some((e) => r.endsWith(e));
|
|
4183
4204
|
}
|
|
4184
|
-
function
|
|
4205
|
+
function Pe(e) {
|
|
4185
4206
|
let t = Z(e);
|
|
4186
|
-
return t.length ? t.every((e) => e.startsWith(".") ?
|
|
4207
|
+
return t.length ? t.every((e) => e.startsWith(".") ? Me.includes(e) : e === "image/*" || e.startsWith("image/")) : !1;
|
|
4187
4208
|
}
|
|
4188
|
-
function
|
|
4209
|
+
function Fe(e) {
|
|
4189
4210
|
let t = [];
|
|
4190
4211
|
for (let n of Z(e)) {
|
|
4191
|
-
let e =
|
|
4212
|
+
let e = je[n] || (n.startsWith(".") ? n.slice(1).toUpperCase() : n.toUpperCase());
|
|
4192
4213
|
t.includes(e) || t.push(e);
|
|
4193
4214
|
}
|
|
4194
4215
|
return t.length <= 1 ? t[0] || "supported" : `${t.slice(0, -1).join(", ")} or ${t[t.length - 1]}`;
|
|
4195
4216
|
}
|
|
4196
|
-
function
|
|
4217
|
+
function Ie(e, t) {
|
|
4197
4218
|
let n = Z(t);
|
|
4198
4219
|
if (!n.length) return !0;
|
|
4199
4220
|
let r = (e.type || "").toLowerCase(), i = (e.name || "").toLowerCase();
|
|
4200
|
-
return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (
|
|
4221
|
+
return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (Ae[e] || []).some((e) => i.endsWith(e)));
|
|
4201
4222
|
}
|
|
4202
|
-
function
|
|
4223
|
+
function Le(e, t = {}) {
|
|
4203
4224
|
if (!e) return null;
|
|
4204
|
-
let n = t.accept === void 0 ?
|
|
4205
|
-
return
|
|
4225
|
+
let n = t.accept === void 0 ? Oe : t.accept, r = t.maxSizeMb || 5;
|
|
4226
|
+
return Ie(e, n) ? e.size > r * 1024 * 1024 ? `Keep the file under ${r} MB.` : null : `Choose a ${Fe(n)} file.`;
|
|
4206
4227
|
}
|
|
4207
4228
|
//#endregion
|
|
4208
4229
|
//#region src/passwordRules.js
|
|
@@ -4213,15 +4234,15 @@ var Q = {
|
|
|
4213
4234
|
digit: !0,
|
|
4214
4235
|
special: !0,
|
|
4215
4236
|
uniqueChars: 0
|
|
4216
|
-
},
|
|
4217
|
-
function
|
|
4237
|
+
}, Re = "Password Requirements";
|
|
4238
|
+
function ze(e) {
|
|
4218
4239
|
return e === !0 || e == null ? { ...Q } : {
|
|
4219
4240
|
...Q,
|
|
4220
4241
|
...e
|
|
4221
4242
|
};
|
|
4222
4243
|
}
|
|
4223
|
-
function
|
|
4224
|
-
let t =
|
|
4244
|
+
function Be(e) {
|
|
4245
|
+
let t = ze(e), n = [];
|
|
4225
4246
|
if (t.minLength > 0 && n.push({
|
|
4226
4247
|
key: "length",
|
|
4227
4248
|
label: `At least ${t.minLength} characters long`,
|
|
@@ -4252,25 +4273,25 @@ function ze(e) {
|
|
|
4252
4273
|
}
|
|
4253
4274
|
return n;
|
|
4254
4275
|
}
|
|
4255
|
-
function
|
|
4276
|
+
function Ve(e, t) {
|
|
4256
4277
|
let n = e == null ? "" : String(e);
|
|
4257
|
-
return
|
|
4278
|
+
return Be(t).map((e) => ({
|
|
4258
4279
|
key: e.key,
|
|
4259
4280
|
label: e.label,
|
|
4260
4281
|
met: e.test(n)
|
|
4261
4282
|
}));
|
|
4262
4283
|
}
|
|
4263
|
-
function
|
|
4264
|
-
return
|
|
4284
|
+
function He(e, t) {
|
|
4285
|
+
return Ve(e, t).every((e) => e.met);
|
|
4265
4286
|
}
|
|
4266
4287
|
//#endregion
|
|
4267
4288
|
//#region src/index.js
|
|
4268
4289
|
var $ = (e, t) => {
|
|
4269
4290
|
typeof customElements < "u" && !customElements.get(e) && customElements.define(e, t);
|
|
4270
4291
|
};
|
|
4271
|
-
function
|
|
4272
|
-
$("wui-select",
|
|
4292
|
+
function Ue() {
|
|
4293
|
+
$("wui-select", ge), $("wui-phone", H), $("wui-datepicker", ee), $("wui-date-range", te), $("wui-dock", ne), $("wui-feedback", oe), $("wui-slider", _e), $("wui-timepicker", Se), $("wui-autocomplete", v), $("wui-multiselect", le), $("wui-taginput", ye), $("wui-otp", N), $("wui-status-icon", n), $("wui-wizard-step", Te), $("wui-wizard", we);
|
|
4273
4294
|
}
|
|
4274
|
-
|
|
4295
|
+
Ue();
|
|
4275
4296
|
//#endregion
|
|
4276
|
-
export {
|
|
4297
|
+
export { Ee as COPY_FEEDBACK_MS, Oe as DEFAULT_IMAGE_ACCEPT, ke as DEFAULT_MAX_SIZE_MB, Q as DEFAULT_PASSWORD_RULES, Re as DEFAULT_REQUIREMENTS_TITLE, t as STATUS_TONES, v as WuiAutocomplete, ee as WuiDatePicker, te as WuiDateRange, ne as WuiDock, oe as WuiFeedback, le as WuiMultiSelect, N as WuiOtp, H as WuiPhone, ge as WuiSelect, _e as WuiSlider, n as WuiStatusIcon, ye as WuiTagInput, Se as WuiTimePicker, we as WuiWizard, Te as WuiWizardStep, Fe as acceptLabel, Be as buildPasswordRules, De as copyTextToClipboard, Ue as defineWeborityElements, Ve as evaluatePassword, f as glyphSvg, Ne as isImageFile, Pe as isImageOnlyAccept, Ie as matchesAccept, He as passwordSatisfies, Le as validateFile };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-elements",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.21",
|
|
4
4
|
"description": "Webority framework-agnostic UI custom elements (<wui-*>) — the single implementation of the interactive components, styled by @webority/theme. Used natively in Razor and wrapped by @webority/ui-react.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|