maz-ui 3.47.2-beta.17 → 3.47.2-beta.18
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/components/MazCircularProgressBar.d.ts +18 -0
- package/components/MazCircularProgressBar.mjs +37 -34
- package/components/MazPhoneNumberInput/types.d.ts +1 -0
- package/components/MazPhoneNumberInput.d.ts +2 -0
- package/components/MazPhoneNumberInput.mjs +1 -1
- package/components/MazSelect.d.ts +1 -1
- package/components/MazSelect.mjs +1 -1
- package/components/MazTable.mjs +1 -1
- package/components/assets/MazCircularProgressBar.css +1 -1
- package/components/assets/MazPhoneNumberInput.css +1 -1
- package/components/assets/MazSelect.css +1 -1
- package/components/chunks/{MazBtn-Ch1hDPN2.mjs → MazBtn-B5ioqwkK.mjs} +2 -2
- package/components/chunks/{MazBtn-CyFhG2dS.mjs → MazBtn-BrfhtojY.mjs} +2 -2
- package/components/chunks/{MazBtn-Dyd7nrjf.mjs → MazBtn-D4NOcykx.mjs} +2 -2
- package/components/chunks/{MazCheckbox-B52wtlPW.mjs → MazCheckbox-B5ZcWc3y.mjs} +1 -1
- package/components/chunks/{MazCheckbox-qdaBefm5.mjs → MazCheckbox-BDPgDiU3.mjs} +1 -1
- package/components/chunks/{MazCheckbox-rCMDIWsz.mjs → MazCheckbox-BeLByOEa.mjs} +1 -1
- package/components/chunks/{MazIcon-hS5hU9w4.mjs → MazIcon-CaXpmvN2.mjs} +1 -1
- package/components/chunks/{MazInput-BxyuzXco.mjs → MazInput-BTIdtLkD.mjs} +2 -2
- package/components/chunks/{MazLoadingBar-9Aj1kmiA.mjs → MazLoadingBar-D3pDBJSb.mjs} +1 -1
- package/components/chunks/{MazPhoneNumberInput-C0cflJBV.mjs → MazPhoneNumberInput-DibUhBpk.mjs} +407 -407
- package/components/chunks/MazSelect-CbT4tFqV.mjs +550 -0
- package/components/chunks/{MazSelect-BoEdSx_L.mjs → MazSelect-CyWAOXo4.mjs} +312 -316
- package/components/chunks/{MazSpinner-DgvAGKDI.mjs → MazSpinner-DYE8e9xl.mjs} +1 -1
- package/components/chunks/{MazSpinner-D3XO8GyD.mjs → MazSpinner-EAz0nFxC.mjs} +1 -1
- package/components/chunks/{MazSpinner-DQ-R-mx0.mjs → MazSpinner-N-1gjTUE.mjs} +1 -1
- package/components/chunks/{MazTable-CQy44tkb.mjs → MazTable-hA0HicaL.mjs} +1 -1
- package/components/chunks/{MazTableCell-DvTUWirp.mjs → MazTableCell-DkCidYWY.mjs} +1 -1
- package/components/chunks/{MazTableRow-Byhe0xaT.mjs → MazTableRow-BAl6Fzm8.mjs} +1 -1
- package/components/chunks/{MazTableTitle-CEbvvX5U.mjs → MazTableTitle-CY_LNDOk.mjs} +1 -1
- package/modules/assets/index.css +1 -1
- package/modules/chunks/{MazBtn-lQ32Gcgj.mjs → MazBtn-C2iBdVnK.mjs} +2 -2
- package/modules/chunks/{MazBtn-CrPOzYh7.cjs → MazBtn-DZ5uD4Ie.cjs} +1 -1
- package/modules/chunks/{MazIcon-Cbm35EPG.cjs → MazIcon-BYvF8LQu.cjs} +1 -1
- package/modules/chunks/{MazIcon-BDui-8Fj.mjs → MazIcon-trV1gyry.mjs} +1 -1
- package/modules/chunks/{MazSpinner-BryzC2lk.cjs → MazSpinner-2MEHiA8E.cjs} +1 -1
- package/modules/chunks/{MazSpinner-CFpKGT2w.mjs → MazSpinner-Dxfnhjcc.mjs} +1 -1
- package/modules/chunks/{index-DDjU2oMn.cjs → index-BjpJ5NSX.cjs} +2 -2
- package/modules/chunks/{index-0BVRC-nq.mjs → index-C3k5P1Gx.mjs} +111 -106
- package/modules/index.cjs +1 -1
- package/modules/index.mjs +1 -1
- package/nuxt/index.json +1 -1
- package/package.json +1 -1
- package/types/components/MazCircularProgressBar.vue.d.ts +18 -0
- package/types/components/MazPhoneNumberInput/types.d.ts +1 -0
- package/types/components/MazPhoneNumberInput.vue.d.ts +2 -0
- package/types/components/MazSelect.vue.d.ts +1 -1
- package/types/modules/composables/useFormValidator/types.d.ts +2 -2
- package/types/modules/directives/closable.d.ts +1 -1
- package/types/modules/directives/tooltip/index.d.ts +21 -0
- package/components/chunks/MazSelect-BL7FY5YH.mjs +0 -553
- /package/components/MazPhoneNumberInput/{use-libphonenumber.d.ts → useLibphonenumber.d.ts} +0 -0
- /package/components/MazPhoneNumberInput/{use-maz-phone-number-input.d.ts → useMazPhoneNumberInput.d.ts} +0 -0
- /package/types/components/MazPhoneNumberInput/{use-libphonenumber.d.ts → useLibphonenumber.d.ts} +0 -0
- /package/types/components/MazPhoneNumberInput/{use-maz-phone-number-input.d.ts → useMazPhoneNumberInput.d.ts} +0 -0
|
@@ -1,553 +0,0 @@
|
|
|
1
|
-
import { computed as f, defineComponent as Ie, defineAsyncComponent as T, ref as b, onBeforeMount as Le, nextTick as W, withDirectives as we, openBlock as g, createElementBlock as A, normalizeClass as q, normalizeStyle as j, createVNode as $, mergeProps as Ce, unref as I, withModifiers as M, withCtx as ne, createElementVNode as N, Transition as Me, createBlock as ie, createCommentVNode as Q, renderSlot as G, Fragment as se, renderList as Ee, toDisplayString as ue } from "vue";
|
|
2
|
-
import { u as Te } from "./useInstanceUniqId-BkOfxhk8.mjs";
|
|
3
|
-
import re from "./MazInput-BxyuzXco.mjs";
|
|
4
|
-
import { _ as $e } from "./MazTable-CQy44tkb.mjs";
|
|
5
|
-
import '../assets/MazSelect.css';const Ne = {
|
|
6
|
-
removeAccents: !0,
|
|
7
|
-
caseSensitive: !1,
|
|
8
|
-
replaceSpaces: !0,
|
|
9
|
-
removeSpecialCharacters: !1,
|
|
10
|
-
trim: !0,
|
|
11
|
-
normalizeSpaces: !0,
|
|
12
|
-
removeNumbers: !1,
|
|
13
|
-
customNormalizationForms: ["NFC", "NFKD"]
|
|
14
|
-
};
|
|
15
|
-
function O(r, c) {
|
|
16
|
-
const i = { ...Ne, ...c }, t = {
|
|
17
|
-
À: "A",
|
|
18
|
-
Á: "A",
|
|
19
|
-
Â: "A",
|
|
20
|
-
Ã: "A",
|
|
21
|
-
Ä: "A",
|
|
22
|
-
Å: "A",
|
|
23
|
-
à: "a",
|
|
24
|
-
á: "a",
|
|
25
|
-
â: "a",
|
|
26
|
-
ã: "a",
|
|
27
|
-
ä: "a",
|
|
28
|
-
å: "a",
|
|
29
|
-
È: "E",
|
|
30
|
-
É: "E",
|
|
31
|
-
Ê: "E",
|
|
32
|
-
Ë: "E",
|
|
33
|
-
è: "e",
|
|
34
|
-
é: "e",
|
|
35
|
-
ê: "e",
|
|
36
|
-
ë: "e",
|
|
37
|
-
Î: "I",
|
|
38
|
-
Ï: "I",
|
|
39
|
-
í: "I",
|
|
40
|
-
î: "i",
|
|
41
|
-
ï: "i",
|
|
42
|
-
Ô: "O",
|
|
43
|
-
Õ: "O",
|
|
44
|
-
Ö: "O",
|
|
45
|
-
Ø: "O",
|
|
46
|
-
ô: "o",
|
|
47
|
-
õ: "o",
|
|
48
|
-
ö: "o",
|
|
49
|
-
ø: "o",
|
|
50
|
-
Ù: "U",
|
|
51
|
-
Ú: "U",
|
|
52
|
-
Û: "U",
|
|
53
|
-
Ü: "U",
|
|
54
|
-
ù: "u",
|
|
55
|
-
ú: "u",
|
|
56
|
-
û: "u",
|
|
57
|
-
ü: "u",
|
|
58
|
-
Ç: "C",
|
|
59
|
-
ç: "c",
|
|
60
|
-
ÿ: "y",
|
|
61
|
-
Ñ: "N",
|
|
62
|
-
ñ: "n",
|
|
63
|
-
ó: "o"
|
|
64
|
-
};
|
|
65
|
-
let n = r.toString();
|
|
66
|
-
if (i.trim && (n = n.trim()), i.normalizeSpaces && (n = n.replaceAll(/\s+/g, " ")), i.replaceSpaces && (n = n.replaceAll(" ", "-")), i.removeNumbers && (n = n.replaceAll(/\d/g, "")), i.removeAccents && (n = n.replaceAll(/[ÀÁÂÃÄÅÇÈÉÊËÎÏÑÔÕÖØÙÚÛÜàáâãäåçèéêëíîïñóôõöøùúûüÿ]/g, (s) => t[s] || s), n = n.replaceAll(/[\u0300-\u036F]/g, "")), i.caseSensitive === !1 && (n = n.toLowerCase()), i.removeSpecialCharacters && (n = n.replaceAll(/[^\dA-Z-]/gi, "")), i.trim && (n = n.trim()), i.customNormalizationForms)
|
|
67
|
-
for (const s of i.customNormalizationForms)
|
|
68
|
-
n = n.normalize(s);
|
|
69
|
-
return n;
|
|
70
|
-
}
|
|
71
|
-
function Oe(r, c) {
|
|
72
|
-
const i = r.length, t = c.length, n = [];
|
|
73
|
-
for (let s = 0; s <= i; s++)
|
|
74
|
-
n[s] = [s];
|
|
75
|
-
for (let s = 0; s <= t; s++)
|
|
76
|
-
n[0][s] = s;
|
|
77
|
-
for (let s = 1; s <= i; s++)
|
|
78
|
-
for (let m = 1; m <= t; m++) {
|
|
79
|
-
const V = r[s - 1] === c[m - 1] ? 0 : 1;
|
|
80
|
-
n[s][m] = Math.min(
|
|
81
|
-
n[s - 1][m] + 1,
|
|
82
|
-
n[s][m - 1] + 1,
|
|
83
|
-
n[s - 1][m - 1] + V
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
return n[i][t];
|
|
87
|
-
}
|
|
88
|
-
function ce(r, c) {
|
|
89
|
-
const i = Oe(r, c), t = Math.max(r.length, c.length);
|
|
90
|
-
return 1 - i / t;
|
|
91
|
-
}
|
|
92
|
-
function xe(r, c, i = 0.75) {
|
|
93
|
-
return ce(r, c) >= i;
|
|
94
|
-
}
|
|
95
|
-
function Z(r, c, i = 0.75) {
|
|
96
|
-
const t = f(
|
|
97
|
-
() => O(typeof r == "string" ? r : r.value)
|
|
98
|
-
), n = f(
|
|
99
|
-
() => O(typeof c == "string" ? c : c.value)
|
|
100
|
-
), s = f(() => typeof i == "number" ? i : i.value), m = f(() => ce(t.value, n.value));
|
|
101
|
-
return {
|
|
102
|
-
isMatching: f(
|
|
103
|
-
() => xe(t.value, n.value, s.value)
|
|
104
|
-
),
|
|
105
|
-
score: m
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
function de(r, c, i) {
|
|
109
|
-
var m;
|
|
110
|
-
r.stopPropagation();
|
|
111
|
-
const t = typeof i.value == "function" ? i.value : i.value.handler, n = typeof i.value == "object" ? i.value.exclude : void 0;
|
|
112
|
-
let s = !1;
|
|
113
|
-
if (n && n.length > 0) {
|
|
114
|
-
for (const V of n)
|
|
115
|
-
if (!s && r.target instanceof HTMLElement) {
|
|
116
|
-
const x = (m = document.querySelector(V)) == null ? void 0 : m.getAttribute("id");
|
|
117
|
-
s = r.target.getAttribute("id") === x;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
!c.contains(r.target) && !s && (t == null || t());
|
|
121
|
-
}
|
|
122
|
-
function pe() {
|
|
123
|
-
return document.ontouchstart === null ? "touchstart" : "click";
|
|
124
|
-
}
|
|
125
|
-
function Be(r, c) {
|
|
126
|
-
const i = pe();
|
|
127
|
-
document.removeEventListener(i, (t) => de(t, r, c));
|
|
128
|
-
}
|
|
129
|
-
function De(r, c) {
|
|
130
|
-
if (typeof c.value != "function" && typeof c.value == "object" && typeof c.value.handler != "function") {
|
|
131
|
-
console.error("[maz-ui](vClosable) v-closable directive requires a handler function");
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
const i = pe();
|
|
135
|
-
document.addEventListener(i, (t) => de(t, r, c));
|
|
136
|
-
}
|
|
137
|
-
const He = {
|
|
138
|
-
mounted: De,
|
|
139
|
-
unmounted: Be
|
|
140
|
-
};
|
|
141
|
-
let R = null;
|
|
142
|
-
function Pe(r, c) {
|
|
143
|
-
R && clearTimeout(R), R = setTimeout(r, c);
|
|
144
|
-
}
|
|
145
|
-
const Fe = ["aria-label"], Ue = { class: "m-select-list__no-results" }, We = {
|
|
146
|
-
key: 2,
|
|
147
|
-
class: "m-select-list__scroll-wrapper",
|
|
148
|
-
tabindex: "-1"
|
|
149
|
-
}, qe = { class: "m-select-list-optgroup" }, je = ["onClick"], Qe = /* @__PURE__ */ Ie({
|
|
150
|
-
inheritAttrs: !1,
|
|
151
|
-
__name: "MazSelect",
|
|
152
|
-
props: {
|
|
153
|
-
style: { default: void 0 },
|
|
154
|
-
class: { default: void 0 },
|
|
155
|
-
id: { default: void 0 },
|
|
156
|
-
modelValue: { default: void 0 },
|
|
157
|
-
options: { default: void 0 },
|
|
158
|
-
optionValueKey: { default: "value" },
|
|
159
|
-
optionLabelKey: { default: "label" },
|
|
160
|
-
optionInputValueKey: { default: "label" },
|
|
161
|
-
listPosition: { default: "bottom left" },
|
|
162
|
-
itemHeight: { default: void 0 },
|
|
163
|
-
maxListHeight: { default: 240 },
|
|
164
|
-
maxListWidth: { default: void 0 },
|
|
165
|
-
minListHeight: { default: void 0 },
|
|
166
|
-
minListWidth: { default: void 0 },
|
|
167
|
-
size: { default: "md" },
|
|
168
|
-
color: { default: "primary" },
|
|
169
|
-
search: { type: Boolean },
|
|
170
|
-
searchPlaceholder: { default: "Search in options" },
|
|
171
|
-
searchThreshold: { default: 0.75 },
|
|
172
|
-
open: { type: Boolean },
|
|
173
|
-
multiple: { type: Boolean, default: void 0 },
|
|
174
|
-
required: { type: Boolean },
|
|
175
|
-
disabled: { type: Boolean },
|
|
176
|
-
block: { type: Boolean },
|
|
177
|
-
excludeSelectors: { default: void 0 },
|
|
178
|
-
autocomplete: { default: "off" }
|
|
179
|
-
},
|
|
180
|
-
emits: ["close", "open", "blur", "focus", "change", "input", "update:model-value", "selected-option"],
|
|
181
|
-
setup(r, { expose: c, emit: i }) {
|
|
182
|
-
const t = r, n = i, s = T(() => import("./MazCheckbox-rCMDIWsz.mjs")), m = T(() => import("./magnifying-glass--nBiyXot.mjs")), V = T(() => import("./chevron-down-BkvtON3b.mjs")), x = T(() => import("./no-symbol-CIgKzsrB.mjs"));
|
|
183
|
-
c({
|
|
184
|
-
/** Method to open the option list */
|
|
185
|
-
openList: C,
|
|
186
|
-
/** Method to close the option list */
|
|
187
|
-
closeList: S
|
|
188
|
-
});
|
|
189
|
-
const z = b(!1), p = b(), B = f(
|
|
190
|
-
() => ["black", "transparent", "white"].includes(t.color)
|
|
191
|
-
), fe = f(
|
|
192
|
-
() => B.value ? "var(--maz-color-black)" : `var(--maz-color-${t.color}-800)`
|
|
193
|
-
), me = f(
|
|
194
|
-
() => B.value ? "var(--maz-color-muted)" : `var(--maz-color-${t.color}-100)`
|
|
195
|
-
), ve = f(
|
|
196
|
-
() => B.value ? "var(--maz-color-muted)" : `var(--maz-color-${t.color}-200)`
|
|
197
|
-
), h = f(() => z.value || t.open), ye = Te({
|
|
198
|
-
componentName: "MazSelect",
|
|
199
|
-
providedId: t.id
|
|
200
|
-
});
|
|
201
|
-
function J(e) {
|
|
202
|
-
return {
|
|
203
|
-
[t.optionValueKey]: e,
|
|
204
|
-
[t.optionLabelKey]: e,
|
|
205
|
-
[t.optionInputValueKey]: e
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
function X(e) {
|
|
209
|
-
return {
|
|
210
|
-
...e,
|
|
211
|
-
[t.optionValueKey]: e[t.optionValueKey],
|
|
212
|
-
[t.optionLabelKey]: e[t.optionLabelKey],
|
|
213
|
-
[t.optionInputValueKey]: e[t.optionInputValueKey]
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
const L = f(() => {
|
|
217
|
-
var o;
|
|
218
|
-
const e = [];
|
|
219
|
-
if (!((o = t.options) != null && o.length))
|
|
220
|
-
return [];
|
|
221
|
-
for (const a of t.options)
|
|
222
|
-
typeof a == "string" || typeof a == "number" || typeof a == "boolean" ? e.push(J(a)) : typeof a == "object" && "options" in a && Array.isArray(a.options) ? e.push(
|
|
223
|
-
{ label: a.label, isOptGroup: !0 },
|
|
224
|
-
...a.options.map(
|
|
225
|
-
(l) => typeof l == "string" || typeof l == "number" || typeof l == "boolean" ? J(l) : X(l)
|
|
226
|
-
)
|
|
227
|
-
) : e.push(X(a));
|
|
228
|
-
return e;
|
|
229
|
-
}), E = f(
|
|
230
|
-
() => {
|
|
231
|
-
var e;
|
|
232
|
-
return ((e = L.value) == null ? void 0 : e.filter((o) => t.multiple ? Array.isArray(t.modelValue) ? t.modelValue.includes(o[t.optionValueKey]) && !K(o[t.optionValueKey]) : !1 : t.modelValue === o[t.optionValueKey] && !K(o[t.optionValueKey]))) ?? [];
|
|
233
|
-
}
|
|
234
|
-
);
|
|
235
|
-
Le(() => {
|
|
236
|
-
var e;
|
|
237
|
-
(e = t.options) != null && e.length || console.warn("[maz-ui](MazSelect) you must provide options"), U();
|
|
238
|
-
});
|
|
239
|
-
const Y = b(), D = b(), _ = b(), ee = b();
|
|
240
|
-
function K(e) {
|
|
241
|
-
return e == null;
|
|
242
|
-
}
|
|
243
|
-
function H(e) {
|
|
244
|
-
var a;
|
|
245
|
-
return (((a = E.value) == null ? void 0 : a.some(
|
|
246
|
-
(l) => l[t.optionValueKey] === e[t.optionValueKey]
|
|
247
|
-
)) ?? !1) && !K(e[t.optionValueKey]);
|
|
248
|
-
}
|
|
249
|
-
const he = f(() => {
|
|
250
|
-
var o;
|
|
251
|
-
if (t.multiple && t.modelValue && Array.isArray(t.modelValue))
|
|
252
|
-
return t.modelValue.map(
|
|
253
|
-
(a) => {
|
|
254
|
-
var l, u;
|
|
255
|
-
return (u = (l = L.value) == null ? void 0 : l.find((d) => d[t.optionValueKey] === a)) == null ? void 0 : u[t.optionInputValueKey];
|
|
256
|
-
}
|
|
257
|
-
).join(", ");
|
|
258
|
-
const e = (o = L.value) == null ? void 0 : o.find(
|
|
259
|
-
(a) => a[t.optionValueKey] === t.modelValue
|
|
260
|
-
);
|
|
261
|
-
return K(t.modelValue) || e == null ? void 0 : e[t.optionInputValueKey];
|
|
262
|
-
}), be = f(
|
|
263
|
-
() => t.listPosition.includes("bottom") ? "maz-slide" : "maz-slideinvert"
|
|
264
|
-
), w = b(""), k = b("");
|
|
265
|
-
function P(e, o) {
|
|
266
|
-
return o && e && O(e).includes(O(o));
|
|
267
|
-
}
|
|
268
|
-
function te(e) {
|
|
269
|
-
var o;
|
|
270
|
-
return e ? (o = L.value) == null ? void 0 : o.filter((a) => {
|
|
271
|
-
const l = a[t.optionLabelKey], u = a[t.optionValueKey], d = a[t.optionInputValueKey], v = t.searchThreshold;
|
|
272
|
-
return P(l, e) || P(d, e) || P(u, e) || typeof l == "string" && Z(l, e, v).isMatching.value || typeof d == "string" && Z(d, e, v).isMatching.value || typeof u == "string" && Z(u, e, v).isMatching.value;
|
|
273
|
-
}) : L.value;
|
|
274
|
-
}
|
|
275
|
-
const y = f(() => te(w.value));
|
|
276
|
-
async function S(e) {
|
|
277
|
-
var a, l;
|
|
278
|
-
if (!h.value)
|
|
279
|
-
return;
|
|
280
|
-
if (e && ("relatedTarget" in e && ((a = Y.value) != null && a.contains(e.relatedTarget)) || e.type === "keydown"))
|
|
281
|
-
return e.preventDefault();
|
|
282
|
-
const o = e && "relatedTarget" in e && e.relatedTarget instanceof HTMLElement && e.relatedTarget.getAttribute("id");
|
|
283
|
-
if ((l = t.excludeSelectors) != null && l.includes(`#${o}`))
|
|
284
|
-
return e == null ? void 0 : e.preventDefault();
|
|
285
|
-
await W(), z.value = !1, p.value = 0, n("close", e);
|
|
286
|
-
}
|
|
287
|
-
async function C(e) {
|
|
288
|
-
t.disabled || h.value || (e == null || e.preventDefault(), z.value = !0, await F(), n("focus", e), n("open", z.value));
|
|
289
|
-
}
|
|
290
|
-
function oe() {
|
|
291
|
-
var e, o;
|
|
292
|
-
(o = ((e = D.value) == null ? void 0 : e.$el).querySelector("input")) == null || o.focus();
|
|
293
|
-
}
|
|
294
|
-
function ge() {
|
|
295
|
-
var e, o;
|
|
296
|
-
(o = ((e = D.value) == null ? void 0 : e.$el).querySelector("input")) == null || o.dispatchEvent(new Event("input"));
|
|
297
|
-
}
|
|
298
|
-
function Ve(e) {
|
|
299
|
-
z.value ? S(e) : oe();
|
|
300
|
-
}
|
|
301
|
-
function ze(e) {
|
|
302
|
-
var o, a;
|
|
303
|
-
w.value = e, (a = ((o = _.value) == null ? void 0 : o.$el).querySelector("input")) == null || a.focus();
|
|
304
|
-
}
|
|
305
|
-
function Ke(e) {
|
|
306
|
-
var a;
|
|
307
|
-
e === "Backspace" && k.value.length > 0 ? k.value = k.value.slice(0, -1) : k.value += e;
|
|
308
|
-
const o = te(k.value);
|
|
309
|
-
o != null && o.length && (p.value = (a = y.value) == null ? void 0 : a.findIndex(
|
|
310
|
-
(l) => l[t.optionValueKey] === o[0][t.optionValueKey]
|
|
311
|
-
), typeof p.value == "number" && p.value >= 0 && F(p.value)), Pe(() => {
|
|
312
|
-
k.value = "";
|
|
313
|
-
}, 1e3);
|
|
314
|
-
}
|
|
315
|
-
function ke(e) {
|
|
316
|
-
const o = e.key;
|
|
317
|
-
/^[\dA-Za-z\u0400-\u04FF]$/.test(o) ? (e.preventDefault(), C(e), t.search ? ze(o) : Ke(o)) : le(e);
|
|
318
|
-
}
|
|
319
|
-
function le(e, o = !0) {
|
|
320
|
-
const a = e.code, l = ["ArrowUp", "ArrowDown"].includes(a), u = (o ? ["Enter", "Space"] : ["Enter"]).includes(a), d = a === "Escape" && h.value;
|
|
321
|
-
l ? Se(e, p.value) : u ? Ae(e, p.value) : d && S(e);
|
|
322
|
-
}
|
|
323
|
-
function Se(e, o) {
|
|
324
|
-
var u;
|
|
325
|
-
e.preventDefault();
|
|
326
|
-
const a = e.code;
|
|
327
|
-
h.value || C(e);
|
|
328
|
-
const l = (u = y.value) == null ? void 0 : u.length;
|
|
329
|
-
l && (typeof o == "number" ? o === l - 1 && a === "ArrowDown" ? p.value = 0 : o === 0 && a === "ArrowUp" ? p.value = l - 1 : p.value = a === "ArrowDown" ? o + 1 : o - 1 : p.value = a === "ArrowDown" ? 0 : l - 1, F(p.value));
|
|
330
|
-
}
|
|
331
|
-
function Ae(e, o) {
|
|
332
|
-
var l, u, d;
|
|
333
|
-
if (!h.value)
|
|
334
|
-
return;
|
|
335
|
-
e.preventDefault();
|
|
336
|
-
const a = o ? ((l = y.value) == null ? void 0 : l[o]) ?? ((u = y.value) == null ? void 0 : u[0]) : (d = y.value) == null ? void 0 : d[0];
|
|
337
|
-
K(a) || ae(a);
|
|
338
|
-
}
|
|
339
|
-
async function F(e) {
|
|
340
|
-
var a, l;
|
|
341
|
-
await W(), typeof e != "number" && U();
|
|
342
|
-
const o = e ?? p.value;
|
|
343
|
-
if (typeof o == "number" && o >= 0) {
|
|
344
|
-
const u = (a = ee.value) == null ? void 0 : a.querySelectorAll(".m-select-list-item");
|
|
345
|
-
(l = u == null ? void 0 : u[o]) == null || l.scrollIntoView({
|
|
346
|
-
behavior: "auto",
|
|
347
|
-
block: "nearest",
|
|
348
|
-
inline: "start"
|
|
349
|
-
});
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
function U(e) {
|
|
353
|
-
var a;
|
|
354
|
-
const o = (a = y.value) == null ? void 0 : a.findIndex((l) => {
|
|
355
|
-
var u, d;
|
|
356
|
-
return t.multiple && Array.isArray(t.modelValue) ? e ? e[t.optionValueKey] === l[t.optionValueKey] : [...t.modelValue].reverse()[0] === l[t.optionValueKey] : ((d = (u = E.value) == null ? void 0 : u[0]) == null ? void 0 : d[t.optionValueKey]) === l[t.optionValueKey];
|
|
357
|
-
});
|
|
358
|
-
p.value = o && o >= 0 ? o : 0;
|
|
359
|
-
}
|
|
360
|
-
function ae(e, o = !0) {
|
|
361
|
-
var d;
|
|
362
|
-
o && !t.multiple && W(() => S()), w.value = "";
|
|
363
|
-
const a = (d = E.value) == null ? void 0 : d.some(
|
|
364
|
-
(v) => v[t.optionValueKey] === e[t.optionValueKey]
|
|
365
|
-
);
|
|
366
|
-
let l = E.value;
|
|
367
|
-
a && t.multiple ? l = l == null ? void 0 : l.filter(
|
|
368
|
-
(v) => v[t.optionValueKey] !== e[t.optionValueKey]
|
|
369
|
-
) : t.multiple ? l.push(e) : l = [e];
|
|
370
|
-
const u = l.map((v) => v[t.optionValueKey]);
|
|
371
|
-
n("update:model-value", t.multiple ? u : u[0]), n("selected-option", e), ge(), U(e), oe();
|
|
372
|
-
}
|
|
373
|
-
return (e, o) => {
|
|
374
|
-
var a;
|
|
375
|
-
return we((g(), A(
|
|
376
|
-
"div",
|
|
377
|
-
{
|
|
378
|
-
ref_key: "mazSelectElement",
|
|
379
|
-
ref: Y,
|
|
380
|
-
class: q(["m-select", [
|
|
381
|
-
{ "--is-open": h.value, "--disabled": e.disabled, "--block": e.block },
|
|
382
|
-
t.class,
|
|
383
|
-
`--${e.size}`
|
|
384
|
-
]]),
|
|
385
|
-
style: j([e.style, { "--keyboard-selected-bg-color": ve.value, "--selected-bg-color": me.value, "--selected-text-color": fe.value }])
|
|
386
|
-
},
|
|
387
|
-
[
|
|
388
|
-
$(re, Ce({
|
|
389
|
-
id: I(ye),
|
|
390
|
-
ref_key: "mazInputComponent",
|
|
391
|
-
ref: D,
|
|
392
|
-
class: "m-select-input"
|
|
393
|
-
}, e.$attrs, {
|
|
394
|
-
required: e.required,
|
|
395
|
-
"border-active": z.value,
|
|
396
|
-
color: e.color,
|
|
397
|
-
"model-value": he.value,
|
|
398
|
-
size: e.size,
|
|
399
|
-
block: "",
|
|
400
|
-
autocomplete: e.autocomplete,
|
|
401
|
-
disabled: e.disabled,
|
|
402
|
-
onFocus: M(C, ["prevent", "stop"]),
|
|
403
|
-
onBlur: M(S, ["prevent", "stop"]),
|
|
404
|
-
onClick: M(C, ["prevent", "stop"]),
|
|
405
|
-
onChange: o[0] || (o[0] = (l) => n("change", l)),
|
|
406
|
-
onInput: o[1] || (o[1] = (l) => n("input", l)),
|
|
407
|
-
onKeydown: ke
|
|
408
|
-
}), {
|
|
409
|
-
"right-icon": ne(() => [
|
|
410
|
-
N("button", {
|
|
411
|
-
tabindex: "-1",
|
|
412
|
-
type: "button",
|
|
413
|
-
class: "m-select-input__toggle-button maz-custom",
|
|
414
|
-
"aria-label": `${h.value ? "collapse" : "expand"} list of options`,
|
|
415
|
-
onClick: M(Ve, ["stop"])
|
|
416
|
-
}, [
|
|
417
|
-
$(I(V), { class: "m-select-chevron maz-text-xl" })
|
|
418
|
-
], 8, Fe)
|
|
419
|
-
]),
|
|
420
|
-
_: 1
|
|
421
|
-
/* STABLE */
|
|
422
|
-
}, 16, ["id", "required", "border-active", "color", "model-value", "size", "autocomplete", "disabled"]),
|
|
423
|
-
$(Me, { name: be.value }, {
|
|
424
|
-
default: ne(() => [
|
|
425
|
-
h.value ? (g(), A(
|
|
426
|
-
"div",
|
|
427
|
-
{
|
|
428
|
-
key: 0,
|
|
429
|
-
ref_key: "optionsListElement",
|
|
430
|
-
ref: ee,
|
|
431
|
-
class: q(["m-select-list", {
|
|
432
|
-
"--top": e.listPosition.includes("top"),
|
|
433
|
-
"--left": e.listPosition.includes("left"),
|
|
434
|
-
"--right": e.listPosition.includes("right"),
|
|
435
|
-
"--bottom": e.listPosition.includes("bottom")
|
|
436
|
-
}]),
|
|
437
|
-
style: j({
|
|
438
|
-
maxHeight: `${e.maxListHeight}px`,
|
|
439
|
-
maxWidth: `${e.maxListWidth}px`,
|
|
440
|
-
minHeight: `${e.minListHeight}px`,
|
|
441
|
-
minWidth: `${e.minListWidth}px`
|
|
442
|
-
})
|
|
443
|
-
},
|
|
444
|
-
[
|
|
445
|
-
e.search ? (g(), ie(re, {
|
|
446
|
-
key: 0,
|
|
447
|
-
ref_key: "searchInputComponent",
|
|
448
|
-
ref: _,
|
|
449
|
-
modelValue: w.value,
|
|
450
|
-
"onUpdate:modelValue": [
|
|
451
|
-
o[2] || (o[2] = (l) => w.value = l),
|
|
452
|
-
o[4] || (o[4] = (l) => p.value = 0)
|
|
453
|
-
],
|
|
454
|
-
size: "sm",
|
|
455
|
-
color: e.color,
|
|
456
|
-
placeholder: e.searchPlaceholder,
|
|
457
|
-
name: "search",
|
|
458
|
-
inputmode: "search",
|
|
459
|
-
block: "",
|
|
460
|
-
autocomplete: "off",
|
|
461
|
-
tabindex: "-1",
|
|
462
|
-
class: "m-select-list__search-input maz-flex-none",
|
|
463
|
-
"left-icon": I(m),
|
|
464
|
-
onKeydown: o[3] || (o[3] = (l) => le(l, !1))
|
|
465
|
-
}, null, 8, ["modelValue", "color", "placeholder", "left-icon"])) : Q("v-if", !0),
|
|
466
|
-
!y.value || y.value.length <= 0 ? G(e.$slots, "no-results", { key: 1 }, () => [
|
|
467
|
-
N("span", Ue, [
|
|
468
|
-
$(I(x), { class: "maz-h-6 maz-w-6 maz-text-normal" })
|
|
469
|
-
])
|
|
470
|
-
], !0) : (g(), A("div", We, [
|
|
471
|
-
(g(!0), A(
|
|
472
|
-
se,
|
|
473
|
-
null,
|
|
474
|
-
Ee(y.value, (l, u) => (g(), A(
|
|
475
|
-
se,
|
|
476
|
-
{ key: u },
|
|
477
|
-
[
|
|
478
|
-
l.label && l.isOptGroup ? G(e.$slots, "optgroup", {
|
|
479
|
-
key: 0,
|
|
480
|
-
label: l.label
|
|
481
|
-
}, () => [
|
|
482
|
-
N(
|
|
483
|
-
"span",
|
|
484
|
-
qe,
|
|
485
|
-
ue(l.label),
|
|
486
|
-
1
|
|
487
|
-
/* TEXT */
|
|
488
|
-
)
|
|
489
|
-
], !0) : (g(), A("button", {
|
|
490
|
-
key: 1,
|
|
491
|
-
tabindex: "-1",
|
|
492
|
-
type: "button",
|
|
493
|
-
class: q(["m-select-list-item maz-custom maz-flex-none", [
|
|
494
|
-
{
|
|
495
|
-
"--is-keyboard-selected": p.value === u,
|
|
496
|
-
"--is-selected": H(l),
|
|
497
|
-
"--is-none-value": K(l[e.optionValueKey])
|
|
498
|
-
}
|
|
499
|
-
]]),
|
|
500
|
-
style: j(e.itemHeight ? { height: `${e.itemHeight}px` } : void 0),
|
|
501
|
-
onClick: M((d) => ae(l), ["prevent", "stop"])
|
|
502
|
-
}, [
|
|
503
|
-
e.multiple ? (g(), ie(I(s), {
|
|
504
|
-
key: 0,
|
|
505
|
-
tabindex: "-1",
|
|
506
|
-
"model-value": H(l),
|
|
507
|
-
size: "sm",
|
|
508
|
-
color: e.color
|
|
509
|
-
}, null, 8, ["model-value", "color"])) : Q("v-if", !0),
|
|
510
|
-
G(e.$slots, "default", {
|
|
511
|
-
option: l,
|
|
512
|
-
isSelected: H(l)
|
|
513
|
-
}, () => [
|
|
514
|
-
N(
|
|
515
|
-
"span",
|
|
516
|
-
null,
|
|
517
|
-
ue(l[e.optionLabelKey]),
|
|
518
|
-
1
|
|
519
|
-
/* TEXT */
|
|
520
|
-
)
|
|
521
|
-
], !0)
|
|
522
|
-
], 14, je))
|
|
523
|
-
],
|
|
524
|
-
64
|
|
525
|
-
/* STABLE_FRAGMENT */
|
|
526
|
-
))),
|
|
527
|
-
128
|
|
528
|
-
/* KEYED_FRAGMENT */
|
|
529
|
-
))
|
|
530
|
-
]))
|
|
531
|
-
],
|
|
532
|
-
6
|
|
533
|
-
/* CLASS, STYLE */
|
|
534
|
-
)) : Q("v-if", !0)
|
|
535
|
-
]),
|
|
536
|
-
_: 3
|
|
537
|
-
/* FORWARDED */
|
|
538
|
-
}, 8, ["name"])
|
|
539
|
-
],
|
|
540
|
-
6
|
|
541
|
-
/* CLASS, STYLE */
|
|
542
|
-
)), [
|
|
543
|
-
[I(He), {
|
|
544
|
-
exclude: (a = e.excludeSelectors) != null && a.length ? e.excludeSelectors : [],
|
|
545
|
-
handler: S
|
|
546
|
-
}]
|
|
547
|
-
]);
|
|
548
|
-
};
|
|
549
|
-
}
|
|
550
|
-
}), Xe = /* @__PURE__ */ $e(Qe, [["__scopeId", "data-v-576a5838"]]);
|
|
551
|
-
export {
|
|
552
|
-
Xe as default
|
|
553
|
-
};
|
|
File without changes
|
|
File without changes
|
/package/types/components/MazPhoneNumberInput/{use-libphonenumber.d.ts → useLibphonenumber.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|