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
package/components/chunks/{MazPhoneNumberInput-C0cflJBV.mjs → MazPhoneNumberInput-DibUhBpk.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../assets/MazPhoneNumberInput.css';var Je = Object.defineProperty;
|
|
2
2
|
var Ze = (a, o, e) => o in a ? Je(a, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[o] = e;
|
|
3
|
-
var
|
|
4
|
-
import { computed as h, useId as Xe, inject as xe, defineComponent as ne, defineAsyncComponent as q, withDirectives as ze, openBlock as y, createElementBlock as P, normalizeClass as
|
|
3
|
+
var ee = (a, o, e) => Ze(a, typeof o != "symbol" ? o + "" : o, e);
|
|
4
|
+
import { computed as h, useId as Xe, inject as xe, defineComponent as ne, defineAsyncComponent as q, withDirectives as ze, openBlock as y, createElementBlock as P, normalizeClass as T, normalizeStyle as oe, Fragment as be, renderList as Be, createElementVNode as Y, mergeProps as le, createVNode as U, unref as k, createCommentVNode as $, renderSlot as N, ref as E, onMounted as Ie, useSlots as _e, toDisplayString as te, createBlock as K, resolveDynamicComponent as ke, toHandlers as eo, vModelDynamic as oo, createTextVNode as to, withModifiers as se, withCtx as J, onBeforeMount as Oe, nextTick as ue, Transition as lo, mergeModels as Pe, useModel as ao, provide as so, watch as he } from "vue";
|
|
5
5
|
import { getCountries as Me, getCountryCallingCode as ce, isSupportedCountry as no, parsePhoneNumberFromString as ro, getExampleNumber as io, AsYouType as uo } from "libphonenumber-js";
|
|
6
6
|
function Ae({
|
|
7
7
|
componentName: a,
|
|
@@ -37,12 +37,12 @@ const mo = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAA
|
|
|
37
37
|
};
|
|
38
38
|
class fo {
|
|
39
39
|
constructor(o = {}) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
ee(this, "observers", []);
|
|
41
|
+
ee(this, "defaultOptions", po);
|
|
42
|
+
ee(this, "options");
|
|
43
|
+
ee(this, "onImgLoadedCallback");
|
|
44
|
+
ee(this, "onImgErrorCallback");
|
|
45
|
+
ee(this, "hasImgLoaded", !1);
|
|
46
46
|
this.options = this.buildOptions(o), this.onImgLoadedCallback = this.imageIsLoaded.bind(this), this.onImgErrorCallback = this.imageHasError.bind(this);
|
|
47
47
|
}
|
|
48
48
|
async loadErrorPhoto() {
|
|
@@ -224,36 +224,36 @@ const ho = {
|
|
|
224
224
|
},
|
|
225
225
|
emits: ["intersecting", "loading", "loaded", "error"],
|
|
226
226
|
setup(a) {
|
|
227
|
-
const o = a, e = q(() => import("./MazSpinner-
|
|
227
|
+
const o = a, e = q(() => import("./MazSpinner-EAz0nFxC.mjs")), t = h(() => o.image || o.src), r = h(() => {
|
|
228
228
|
var u;
|
|
229
229
|
return typeof t.value == "string" ? [{ srcset: t.value }] : (u = t.value) == null ? void 0 : u.sources;
|
|
230
230
|
});
|
|
231
231
|
return (u, v) => ze((y(), P(
|
|
232
232
|
"picture",
|
|
233
233
|
{
|
|
234
|
-
class:
|
|
235
|
-
style:
|
|
234
|
+
class: T(["m-lazy-img-component", [{ "--use-loader": !u.noLoader, "--height-full": u.imageHeightFull, "--block": u.block }, o.class]]),
|
|
235
|
+
style: oe(u.style)
|
|
236
236
|
},
|
|
237
237
|
[
|
|
238
238
|
(y(!0), P(
|
|
239
239
|
be,
|
|
240
240
|
null,
|
|
241
|
-
Be(r.value, ({ srcset: p, media:
|
|
242
|
-
key:
|
|
241
|
+
Be(r.value, ({ srcset: p, media: B }, L) => (y(), P("source", {
|
|
242
|
+
key: L,
|
|
243
243
|
"data-lazy-srcset": p,
|
|
244
|
-
media:
|
|
244
|
+
media: B
|
|
245
245
|
}, null, 8, vo))),
|
|
246
246
|
128
|
|
247
247
|
/* KEYED_FRAGMENT */
|
|
248
248
|
)),
|
|
249
|
-
Y("img",
|
|
249
|
+
Y("img", le(u.$attrs, {
|
|
250
250
|
src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
|
|
251
251
|
loading: "lazy",
|
|
252
252
|
alt: u.alt,
|
|
253
253
|
class: u.imgClass
|
|
254
254
|
}), null, 16, yo),
|
|
255
|
-
u.noLoader ?
|
|
256
|
-
|
|
255
|
+
u.noLoader ? $("v-if", !0) : (y(), P("div", go, [
|
|
256
|
+
U(k(e), { size: "2em" })
|
|
257
257
|
])),
|
|
258
258
|
N(u.$slots, "default", {}, void 0, !0)
|
|
259
259
|
],
|
|
@@ -382,18 +382,18 @@ function ve(a, o, e = 0.75) {
|
|
|
382
382
|
};
|
|
383
383
|
}
|
|
384
384
|
function Ne(a, o, e) {
|
|
385
|
-
var v;
|
|
385
|
+
var v, p;
|
|
386
386
|
a.stopPropagation();
|
|
387
387
|
const t = typeof e.value == "function" ? e.value : e.value.handler, r = typeof e.value == "object" ? e.value.exclude : void 0;
|
|
388
388
|
let u = !1;
|
|
389
389
|
if (r && r.length > 0) {
|
|
390
|
-
for (const
|
|
390
|
+
for (const B of r)
|
|
391
391
|
if (!u && a.target instanceof HTMLElement) {
|
|
392
|
-
const
|
|
393
|
-
u = a.target.getAttribute("id") ===
|
|
392
|
+
const L = (v = document.querySelector(B)) == null ? void 0 : v.getAttribute("id");
|
|
393
|
+
u = (a.target.getAttribute("id") === L || ((p = document.querySelector(B)) == null ? void 0 : p.contains(a.target))) ?? !1;
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
|
-
!o.contains(a.target) && !u && (t == null || t());
|
|
396
|
+
!o.contains(a.target) && !u && (t == null || t(a));
|
|
397
397
|
}
|
|
398
398
|
function Ke() {
|
|
399
399
|
return document.ontouchstart === null ? "touchstart" : "click";
|
|
@@ -414,7 +414,11 @@ const So = {
|
|
|
414
414
|
mounted: wo,
|
|
415
415
|
unmounted: Ao
|
|
416
416
|
};
|
|
417
|
+
let ye = null;
|
|
417
418
|
function Vo(a, o) {
|
|
419
|
+
ye && clearTimeout(ye), ye = setTimeout(a, o);
|
|
420
|
+
}
|
|
421
|
+
function ko(a, o) {
|
|
418
422
|
let e;
|
|
419
423
|
return function(...t) {
|
|
420
424
|
clearTimeout(e), e = setTimeout(() => {
|
|
@@ -422,10 +426,6 @@ function Vo(a, o) {
|
|
|
422
426
|
}, o);
|
|
423
427
|
};
|
|
424
428
|
}
|
|
425
|
-
let ye = null;
|
|
426
|
-
function ko(a, o) {
|
|
427
|
-
ye && clearTimeout(ye), ye = setTimeout(a, o);
|
|
428
|
-
}
|
|
429
429
|
const Po = ["for"], Lo = {
|
|
430
430
|
key: 0,
|
|
431
431
|
class: "m-input-wrapper-left"
|
|
@@ -472,7 +472,7 @@ const Po = ["for"], Lo = {
|
|
|
472
472
|
},
|
|
473
473
|
emits: ["update:model-value", "focus", "blur", "click", "change", "input"],
|
|
474
474
|
setup(a, { emit: o }) {
|
|
475
|
-
const e = a, t = o, r = q(() => import("./MazBtn-
|
|
475
|
+
const e = a, t = o, r = q(() => import("./MazBtn-D4NOcykx.mjs")), u = q(() => import("./MazIcon-CaXpmvN2.mjs")), v = q(() => import("./eye-slash-BoO00xzs.mjs")), p = q(() => import("./eye-f8zAUc30.mjs")), B = q(() => import("./check-C9Q_W85g.mjs")), L = E(!1), g = E(!1), A = E(), i = Ae({
|
|
476
476
|
componentName: "MazInput",
|
|
477
477
|
providedId: e.id
|
|
478
478
|
});
|
|
@@ -480,7 +480,7 @@ const Po = ["for"], Lo = {
|
|
|
480
480
|
var s;
|
|
481
481
|
e.autoFocus && ((s = A.value) == null || s.focus());
|
|
482
482
|
});
|
|
483
|
-
const f = h(() => e.type === "password"), z = h(() =>
|
|
483
|
+
const f = h(() => e.type === "password"), z = h(() => L.value ? "text" : e.type), w = h(() => {
|
|
484
484
|
if (!e.noBorder) {
|
|
485
485
|
if (e.error)
|
|
486
486
|
return "maz-border-danger";
|
|
@@ -508,11 +508,11 @@ const Po = ["for"], Lo = {
|
|
|
508
508
|
}
|
|
509
509
|
return "--default-border";
|
|
510
510
|
}
|
|
511
|
-
}),
|
|
511
|
+
}), H = _e(), j = h(() => {
|
|
512
512
|
const { required: s, placeholder: F } = e;
|
|
513
513
|
if (F)
|
|
514
514
|
return s ? `${F} *` : F;
|
|
515
|
-
}),
|
|
515
|
+
}), Z = h(() => C.value !== void 0 && C.value !== ""), b = ko(
|
|
516
516
|
(s) => {
|
|
517
517
|
t("update:model-value", s);
|
|
518
518
|
},
|
|
@@ -526,33 +526,33 @@ const Po = ["for"], Lo = {
|
|
|
526
526
|
const C = h({
|
|
527
527
|
get: () => e.modelValue,
|
|
528
528
|
set: (s) => S(s)
|
|
529
|
-
}), W = h(() => (!!e.label || !!e.hint) && (g.value || !!
|
|
529
|
+
}), W = h(() => (!!e.label || !!e.hint) && (g.value || !!Z.value || !!e.placeholder || ["date", "month", "week"].includes(e.type))), X = h(() => !!e.label || !!e.hint);
|
|
530
530
|
function n() {
|
|
531
|
-
return !!
|
|
531
|
+
return !!H["right-icon"] || f.value || !!H["valid-button"] || e.validButton || !!e.rightIcon;
|
|
532
532
|
}
|
|
533
533
|
function V() {
|
|
534
|
-
return !!
|
|
534
|
+
return !!H["left-icon"] || !!e.leftIcon;
|
|
535
535
|
}
|
|
536
|
-
function
|
|
536
|
+
function D(s) {
|
|
537
537
|
t("focus", s), g.value = !0;
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function M(s) {
|
|
540
540
|
t("blur", s), g.value = !1;
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function Q(s) {
|
|
543
543
|
return t("change", s);
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function x(s) {
|
|
546
546
|
return t("input", s);
|
|
547
547
|
}
|
|
548
548
|
return (s, F) => (y(), P(
|
|
549
549
|
"div",
|
|
550
550
|
{
|
|
551
|
-
class:
|
|
551
|
+
class: T(["m-input", [
|
|
552
552
|
{
|
|
553
553
|
"--is-focused": g.value || s.borderActive,
|
|
554
554
|
"--should-up": W.value,
|
|
555
|
-
"--has-label":
|
|
555
|
+
"--has-label": X.value,
|
|
556
556
|
"--is-disabled": s.disabled,
|
|
557
557
|
"--is-readonly": s.readonly,
|
|
558
558
|
"--has-z-2": s.error || s.warning || s.success,
|
|
@@ -562,18 +562,18 @@ const Po = ["for"], Lo = {
|
|
|
562
562
|
e.class,
|
|
563
563
|
`--${s.color}`
|
|
564
564
|
]]),
|
|
565
|
-
style:
|
|
565
|
+
style: oe(s.style)
|
|
566
566
|
},
|
|
567
567
|
[
|
|
568
568
|
s.topLabel ? (y(), P("label", {
|
|
569
569
|
key: 0,
|
|
570
570
|
for: k(i),
|
|
571
571
|
class: "m-input-top-label"
|
|
572
|
-
},
|
|
572
|
+
}, te(s.topLabel), 9, Po)) : $("v-if", !0),
|
|
573
573
|
Y(
|
|
574
574
|
"div",
|
|
575
575
|
{
|
|
576
|
-
class:
|
|
576
|
+
class: T(["m-input-wrapper", [
|
|
577
577
|
s.inputClasses,
|
|
578
578
|
w.value,
|
|
579
579
|
s.roundedSize ? `--rounded-${s.roundedSize}` : { "maz-rounded": !s.noRadius },
|
|
@@ -583,27 +583,27 @@ const Po = ["for"], Lo = {
|
|
|
583
583
|
[
|
|
584
584
|
V() ? (y(), P("div", Lo, [
|
|
585
585
|
s.$slots["left-icon"] || s.leftIcon ? N(s.$slots, "left-icon", { key: 0 }, () => [
|
|
586
|
-
typeof s.leftIcon == "string" ? (y(),
|
|
586
|
+
typeof s.leftIcon == "string" ? (y(), K(k(u), {
|
|
587
587
|
key: 0,
|
|
588
588
|
name: s.leftIcon,
|
|
589
589
|
class: "maz-text-xl maz-text-muted"
|
|
590
|
-
}, null, 8, ["name"])) : s.leftIcon ? (y(),
|
|
590
|
+
}, null, 8, ["name"])) : s.leftIcon ? (y(), K(ke(s.leftIcon), {
|
|
591
591
|
key: 1,
|
|
592
592
|
class: "maz-text-xl maz-text-muted"
|
|
593
|
-
})) :
|
|
594
|
-
], !0) :
|
|
595
|
-
])) :
|
|
593
|
+
})) : $("v-if", !0)
|
|
594
|
+
], !0) : $("v-if", !0)
|
|
595
|
+
])) : $("v-if", !0),
|
|
596
596
|
Y(
|
|
597
597
|
"div",
|
|
598
598
|
{
|
|
599
|
-
class:
|
|
599
|
+
class: T(["m-input-wrapper-input", [`--${s.size}`, { "--top-label": !!s.topLabel }]])
|
|
600
600
|
},
|
|
601
601
|
[
|
|
602
|
-
ze(Y("input",
|
|
602
|
+
ze(Y("input", le({
|
|
603
603
|
id: k(i),
|
|
604
604
|
ref_key: "input",
|
|
605
605
|
ref: A,
|
|
606
|
-
"onUpdate:modelValue": F[0] || (F[0] = (
|
|
606
|
+
"onUpdate:modelValue": F[0] || (F[0] = (_) => C.value = _),
|
|
607
607
|
type: z.value,
|
|
608
608
|
name: s.name
|
|
609
609
|
}, s.$attrs, {
|
|
@@ -615,12 +615,12 @@ const Po = ["for"], Lo = {
|
|
|
615
615
|
required: s.required,
|
|
616
616
|
class: "m-input-input"
|
|
617
617
|
}, eo({
|
|
618
|
-
blur:
|
|
619
|
-
focus:
|
|
620
|
-
change:
|
|
621
|
-
input:
|
|
618
|
+
blur: M,
|
|
619
|
+
focus: D,
|
|
620
|
+
change: Q,
|
|
621
|
+
input: x
|
|
622
622
|
}, !0), {
|
|
623
|
-
onClick: F[1] || (F[1] = (
|
|
623
|
+
onClick: F[1] || (F[1] = (_) => s.$emit("click", _))
|
|
624
624
|
}), null, 16, Eo), [
|
|
625
625
|
[oo, C.value]
|
|
626
626
|
]),
|
|
@@ -628,7 +628,7 @@ const Po = ["for"], Lo = {
|
|
|
628
628
|
"span",
|
|
629
629
|
{
|
|
630
630
|
key: 0,
|
|
631
|
-
class:
|
|
631
|
+
class: T(["m-input-label", [
|
|
632
632
|
{
|
|
633
633
|
"maz-text-danger-600": s.error,
|
|
634
634
|
"maz-text-success-600": s.success,
|
|
@@ -638,51 +638,51 @@ const Po = ["for"], Lo = {
|
|
|
638
638
|
},
|
|
639
639
|
[
|
|
640
640
|
to(
|
|
641
|
-
|
|
641
|
+
te(s.hint || s.label) + " ",
|
|
642
642
|
1
|
|
643
643
|
/* TEXT */
|
|
644
644
|
),
|
|
645
|
-
s.required ? (y(), P("sup", $o, "*")) :
|
|
645
|
+
s.required ? (y(), P("sup", $o, "*")) : $("v-if", !0)
|
|
646
646
|
],
|
|
647
647
|
2
|
|
648
648
|
/* CLASS */
|
|
649
|
-
)) :
|
|
649
|
+
)) : $("v-if", !0)
|
|
650
650
|
],
|
|
651
651
|
2
|
|
652
652
|
/* CLASS */
|
|
653
653
|
),
|
|
654
654
|
n() ? (y(), P("div", Bo, [
|
|
655
655
|
s.$slots["right-icon"] || s.rightIcon ? N(s.$slots, "right-icon", { key: 0 }, () => [
|
|
656
|
-
typeof s.rightIcon == "string" ? (y(),
|
|
656
|
+
typeof s.rightIcon == "string" ? (y(), K(k(u), {
|
|
657
657
|
key: 0,
|
|
658
658
|
name: s.rightIcon,
|
|
659
659
|
class: "maz-text-xl maz-text-muted"
|
|
660
|
-
}, null, 8, ["name"])) : s.rightIcon ? (y(),
|
|
660
|
+
}, null, 8, ["name"])) : s.rightIcon ? (y(), K(ke(s.rightIcon), {
|
|
661
661
|
key: 1,
|
|
662
662
|
class: "maz-text-xl maz-text-muted"
|
|
663
|
-
})) :
|
|
664
|
-
], !0) :
|
|
665
|
-
f.value ? (y(),
|
|
663
|
+
})) : $("v-if", !0)
|
|
664
|
+
], !0) : $("v-if", !0),
|
|
665
|
+
f.value ? (y(), K(k(r), {
|
|
666
666
|
key: 1,
|
|
667
667
|
color: "transparent",
|
|
668
668
|
tabindex: "-1",
|
|
669
669
|
size: "mini",
|
|
670
|
-
onClick: F[2] || (F[2] = se((
|
|
670
|
+
onClick: F[2] || (F[2] = se((_) => L.value = !L.value, ["stop"]))
|
|
671
671
|
}, {
|
|
672
|
-
default:
|
|
673
|
-
|
|
672
|
+
default: J(() => [
|
|
673
|
+
L.value ? (y(), K(k(v), {
|
|
674
674
|
key: 0,
|
|
675
675
|
class: "maz-text-xl maz-text-muted"
|
|
676
|
-
})) : (y(),
|
|
676
|
+
})) : (y(), K(k(p), {
|
|
677
677
|
key: 1,
|
|
678
678
|
class: "maz-text-xl maz-text-muted"
|
|
679
679
|
}))
|
|
680
680
|
]),
|
|
681
681
|
_: 1
|
|
682
682
|
/* STABLE */
|
|
683
|
-
})) :
|
|
683
|
+
})) : $("v-if", !0),
|
|
684
684
|
s.$slots["valid-button"] || s.validButton ? N(s.$slots, "valid-button", { key: 2 }, () => [
|
|
685
|
-
|
|
685
|
+
U(k(r), {
|
|
686
686
|
color: "transparent",
|
|
687
687
|
disabled: s.disabled,
|
|
688
688
|
tabindex: "-1",
|
|
@@ -691,14 +691,14 @@ const Po = ["for"], Lo = {
|
|
|
691
691
|
size: "mini",
|
|
692
692
|
type: "submit"
|
|
693
693
|
}, {
|
|
694
|
-
default:
|
|
695
|
-
|
|
694
|
+
default: J(() => [
|
|
695
|
+
U(k(B), { class: "maz-text-2xl maz-text-normal" })
|
|
696
696
|
]),
|
|
697
697
|
_: 1
|
|
698
698
|
/* STABLE */
|
|
699
699
|
}, 8, ["disabled", "loading"])
|
|
700
|
-
], !0) :
|
|
701
|
-
])) :
|
|
700
|
+
], !0) : $("v-if", !0)
|
|
701
|
+
])) : $("v-if", !0)
|
|
702
702
|
],
|
|
703
703
|
2
|
|
704
704
|
/* CLASS */
|
|
@@ -707,7 +707,7 @@ const Po = ["for"], Lo = {
|
|
|
707
707
|
"div",
|
|
708
708
|
{
|
|
709
709
|
key: 1,
|
|
710
|
-
class:
|
|
710
|
+
class: T(["m-input-bottom-text", [
|
|
711
711
|
{
|
|
712
712
|
"maz-text-danger-600": s.error,
|
|
713
713
|
"maz-text-success-600": s.success,
|
|
@@ -716,10 +716,10 @@ const Po = ["for"], Lo = {
|
|
|
716
716
|
}
|
|
717
717
|
]])
|
|
718
718
|
},
|
|
719
|
-
|
|
719
|
+
te(s.assistiveText),
|
|
720
720
|
3
|
|
721
721
|
/* TEXT, CLASS */
|
|
722
|
-
)) :
|
|
722
|
+
)) : $("v-if", !0)
|
|
723
723
|
],
|
|
724
724
|
6
|
|
725
725
|
/* CLASS, STYLE */
|
|
@@ -762,14 +762,14 @@ const Po = ["for"], Lo = {
|
|
|
762
762
|
},
|
|
763
763
|
emits: ["close", "open", "blur", "focus", "change", "input", "update:model-value", "selected-option"],
|
|
764
764
|
setup(a, { expose: o, emit: e }) {
|
|
765
|
-
const t = a, r = e, u = q(() => import("./MazCheckbox-
|
|
765
|
+
const t = a, r = e, u = q(() => import("./MazCheckbox-B5ZcWc3y.mjs")), v = q(() => import("./magnifying-glass--nBiyXot.mjs")), p = q(() => import("./chevron-down-BkvtON3b.mjs")), B = q(() => import("./no-symbol-CIgKzsrB.mjs"));
|
|
766
766
|
o({
|
|
767
767
|
/** Method to open the option list */
|
|
768
768
|
openList: ie,
|
|
769
769
|
/** Method to close the option list */
|
|
770
770
|
closeList: ae
|
|
771
771
|
});
|
|
772
|
-
const
|
|
772
|
+
const L = E(!1), g = E(), A = h(
|
|
773
773
|
() => ["black", "transparent", "white"].includes(t.color)
|
|
774
774
|
), i = h(
|
|
775
775
|
() => A.value ? "var(--maz-color-black)" : `var(--maz-color-${t.color}-800)`
|
|
@@ -777,7 +777,7 @@ const Po = ["for"], Lo = {
|
|
|
777
777
|
() => A.value ? "var(--maz-color-muted)" : `var(--maz-color-${t.color}-100)`
|
|
778
778
|
), z = h(
|
|
779
779
|
() => A.value ? "var(--maz-color-muted)" : `var(--maz-color-${t.color}-200)`
|
|
780
|
-
), w = h(() =>
|
|
780
|
+
), w = h(() => L.value || t.open), H = Ae({
|
|
781
781
|
componentName: "MazSelect",
|
|
782
782
|
providedId: t.id
|
|
783
783
|
});
|
|
@@ -788,7 +788,7 @@ const Po = ["for"], Lo = {
|
|
|
788
788
|
[t.optionInputValueKey]: l
|
|
789
789
|
};
|
|
790
790
|
}
|
|
791
|
-
function
|
|
791
|
+
function Z(l) {
|
|
792
792
|
return {
|
|
793
793
|
...l,
|
|
794
794
|
[t.optionValueKey]: l[t.optionValueKey],
|
|
@@ -797,135 +797,135 @@ const Po = ["for"], Lo = {
|
|
|
797
797
|
};
|
|
798
798
|
}
|
|
799
799
|
const b = h(() => {
|
|
800
|
-
var
|
|
800
|
+
var c;
|
|
801
801
|
const l = [];
|
|
802
|
-
if (!((
|
|
802
|
+
if (!((c = t.options) != null && c.length))
|
|
803
803
|
return [];
|
|
804
|
-
for (const
|
|
805
|
-
typeof
|
|
806
|
-
{ label:
|
|
807
|
-
...
|
|
808
|
-
(
|
|
804
|
+
for (const d of t.options)
|
|
805
|
+
typeof d == "string" || typeof d == "number" || typeof d == "boolean" ? l.push(j(d)) : typeof d == "object" && "options" in d && Array.isArray(d.options) ? l.push(
|
|
806
|
+
{ label: d.label, isOptGroup: !0 },
|
|
807
|
+
...d.options.map(
|
|
808
|
+
(m) => typeof m == "string" || typeof m == "number" || typeof m == "boolean" ? j(m) : Z(m)
|
|
809
809
|
)
|
|
810
|
-
) : l.push(
|
|
810
|
+
) : l.push(Z(d));
|
|
811
811
|
return l;
|
|
812
812
|
}), S = h(
|
|
813
813
|
() => {
|
|
814
814
|
var l;
|
|
815
|
-
return ((l = b.value) == null ? void 0 : l.filter((
|
|
815
|
+
return ((l = b.value) == null ? void 0 : l.filter((c) => t.multiple ? Array.isArray(t.modelValue) ? t.modelValue.includes(c[t.optionValueKey]) && !V(c[t.optionValueKey]) : !1 : t.modelValue === c[t.optionValueKey] && !V(c[t.optionValueKey]))) ?? [];
|
|
816
816
|
}
|
|
817
817
|
);
|
|
818
818
|
Oe(() => {
|
|
819
819
|
var l;
|
|
820
820
|
(l = t.options) != null && l.length || console.warn("[maz-ui](MazSelect) you must provide options"), fe();
|
|
821
821
|
});
|
|
822
|
-
const C =
|
|
822
|
+
const C = E(), W = E(), X = E(), n = E();
|
|
823
823
|
function V(l) {
|
|
824
824
|
return l == null;
|
|
825
825
|
}
|
|
826
|
-
function
|
|
827
|
-
var
|
|
828
|
-
return (((
|
|
829
|
-
(
|
|
826
|
+
function D(l) {
|
|
827
|
+
var d;
|
|
828
|
+
return (((d = S.value) == null ? void 0 : d.some(
|
|
829
|
+
(m) => m[t.optionValueKey] === l[t.optionValueKey]
|
|
830
830
|
)) ?? !1) && !V(l[t.optionValueKey]);
|
|
831
831
|
}
|
|
832
|
-
const
|
|
833
|
-
var
|
|
832
|
+
const M = h(() => {
|
|
833
|
+
var c;
|
|
834
834
|
if (t.multiple && t.modelValue && Array.isArray(t.modelValue))
|
|
835
835
|
return t.modelValue.map(
|
|
836
|
-
(
|
|
837
|
-
var
|
|
838
|
-
return (I = (
|
|
836
|
+
(d) => {
|
|
837
|
+
var m, I;
|
|
838
|
+
return (I = (m = b.value) == null ? void 0 : m.find((O) => O[t.optionValueKey] === d)) == null ? void 0 : I[t.optionInputValueKey];
|
|
839
839
|
}
|
|
840
840
|
).join(", ");
|
|
841
|
-
const l = (
|
|
842
|
-
(
|
|
841
|
+
const l = (c = b.value) == null ? void 0 : c.find(
|
|
842
|
+
(d) => d[t.optionValueKey] === t.modelValue
|
|
843
843
|
);
|
|
844
844
|
return V(t.modelValue) || l == null ? void 0 : l[t.optionInputValueKey];
|
|
845
|
-
}),
|
|
845
|
+
}), Q = h(
|
|
846
846
|
() => t.listPosition.includes("bottom") ? "maz-slide" : "maz-slideinvert"
|
|
847
|
-
),
|
|
848
|
-
function F(l,
|
|
849
|
-
return
|
|
847
|
+
), x = E(""), s = E("");
|
|
848
|
+
function F(l, c) {
|
|
849
|
+
return c && l && me(l).includes(me(c));
|
|
850
850
|
}
|
|
851
|
-
function
|
|
852
|
-
var
|
|
853
|
-
return l ? (
|
|
854
|
-
const
|
|
855
|
-
return F(
|
|
851
|
+
function _(l) {
|
|
852
|
+
var c;
|
|
853
|
+
return l ? (c = b.value) == null ? void 0 : c.filter((d) => {
|
|
854
|
+
const m = d[t.optionLabelKey], I = d[t.optionValueKey], O = d[t.optionInputValueKey], R = t.searchThreshold;
|
|
855
|
+
return F(m, l) || F(O, l) || F(I, l) || typeof m == "string" && ve(m, l, R).isMatching.value || typeof O == "string" && ve(O, l, R).isMatching.value || typeof I == "string" && ve(I, l, R).isMatching.value;
|
|
856
856
|
}) : b.value;
|
|
857
857
|
}
|
|
858
|
-
const
|
|
858
|
+
const G = h(() => _(x.value));
|
|
859
859
|
async function ae(l) {
|
|
860
|
-
var
|
|
860
|
+
var d, m;
|
|
861
861
|
if (!w.value)
|
|
862
862
|
return;
|
|
863
|
-
if (l && ("relatedTarget" in l && ((
|
|
863
|
+
if (l && ("relatedTarget" in l && ((d = C.value) != null && d.contains(l.relatedTarget)) || l.type === "keydown"))
|
|
864
864
|
return l.preventDefault();
|
|
865
|
-
const
|
|
866
|
-
if ((
|
|
865
|
+
const c = l && "relatedTarget" in l && l.relatedTarget instanceof HTMLElement && l.relatedTarget.getAttribute("id");
|
|
866
|
+
if ((m = t.excludeSelectors) != null && m.includes(`#${c}`))
|
|
867
867
|
return l == null ? void 0 : l.preventDefault();
|
|
868
|
-
await ue(),
|
|
868
|
+
await ue(), L.value = !1, g.value = 0, r("close", l);
|
|
869
869
|
}
|
|
870
870
|
async function ie(l) {
|
|
871
|
-
t.disabled || w.value || (l == null || l.preventDefault(),
|
|
871
|
+
t.disabled || w.value || (l == null || l.preventDefault(), L.value = !0, await pe(), r("focus", l), r("open", L.value));
|
|
872
872
|
}
|
|
873
873
|
function we() {
|
|
874
|
-
var l,
|
|
875
|
-
(
|
|
874
|
+
var l, c;
|
|
875
|
+
(c = ((l = W.value) == null ? void 0 : l.$el).querySelector("input")) == null || c.focus();
|
|
876
876
|
}
|
|
877
877
|
function Re() {
|
|
878
|
-
var l,
|
|
879
|
-
(
|
|
878
|
+
var l, c;
|
|
879
|
+
(c = ((l = W.value) == null ? void 0 : l.$el).querySelector("input")) == null || c.dispatchEvent(new Event("input"));
|
|
880
880
|
}
|
|
881
881
|
function qe(l) {
|
|
882
|
-
|
|
882
|
+
L.value ? ae(l) : we();
|
|
883
883
|
}
|
|
884
884
|
function Ye(l) {
|
|
885
|
-
var
|
|
886
|
-
|
|
885
|
+
var c, d;
|
|
886
|
+
x.value = l, (d = ((c = X.value) == null ? void 0 : c.$el).querySelector("input")) == null || d.focus();
|
|
887
887
|
}
|
|
888
888
|
function je(l) {
|
|
889
|
-
var
|
|
889
|
+
var d;
|
|
890
890
|
l === "Backspace" && s.value.length > 0 ? s.value = s.value.slice(0, -1) : s.value += l;
|
|
891
|
-
const
|
|
892
|
-
|
|
893
|
-
(
|
|
894
|
-
), typeof g.value == "number" && g.value >= 0 && pe(g.value)),
|
|
891
|
+
const c = _(s.value);
|
|
892
|
+
c != null && c.length && (g.value = (d = G.value) == null ? void 0 : d.findIndex(
|
|
893
|
+
(m) => m[t.optionValueKey] === c[0][t.optionValueKey]
|
|
894
|
+
), typeof g.value == "number" && g.value >= 0 && pe(g.value)), Vo(() => {
|
|
895
895
|
s.value = "";
|
|
896
896
|
}, 1e3);
|
|
897
897
|
}
|
|
898
898
|
function We(l) {
|
|
899
|
-
const
|
|
900
|
-
/^[\dA-Za-z\u0400-\u04FF]$/.test(
|
|
899
|
+
const c = l.key;
|
|
900
|
+
/^[\dA-Za-z\u0400-\u04FF]$/.test(c) ? (l.preventDefault(), ie(l), t.search ? Ye(c) : je(c)) : Se(l);
|
|
901
901
|
}
|
|
902
|
-
function Se(l,
|
|
903
|
-
const
|
|
904
|
-
|
|
902
|
+
function Se(l, c = !0) {
|
|
903
|
+
const d = l.code, m = ["ArrowUp", "ArrowDown"].includes(d), I = (c ? ["Enter", "Space"] : ["Enter"]).includes(d), O = d === "Escape" && w.value;
|
|
904
|
+
m ? Qe(l, g.value) : I ? Ge(l, g.value) : O && ae(l);
|
|
905
905
|
}
|
|
906
|
-
function Qe(l,
|
|
906
|
+
function Qe(l, c) {
|
|
907
907
|
var I;
|
|
908
908
|
l.preventDefault();
|
|
909
|
-
const
|
|
909
|
+
const d = l.code;
|
|
910
910
|
w.value || ie(l);
|
|
911
|
-
const
|
|
912
|
-
|
|
911
|
+
const m = (I = G.value) == null ? void 0 : I.length;
|
|
912
|
+
m && (typeof c == "number" ? c === m - 1 && d === "ArrowDown" ? g.value = 0 : c === 0 && d === "ArrowUp" ? g.value = m - 1 : g.value = d === "ArrowDown" ? c + 1 : c - 1 : g.value = d === "ArrowDown" ? 0 : m - 1, pe(g.value));
|
|
913
913
|
}
|
|
914
|
-
function Ge(l,
|
|
915
|
-
var
|
|
914
|
+
function Ge(l, c) {
|
|
915
|
+
var m, I, O;
|
|
916
916
|
if (!w.value)
|
|
917
917
|
return;
|
|
918
918
|
l.preventDefault();
|
|
919
|
-
const
|
|
920
|
-
V(
|
|
919
|
+
const d = c ? ((m = G.value) == null ? void 0 : m[c]) ?? ((I = G.value) == null ? void 0 : I[0]) : (O = G.value) == null ? void 0 : O[0];
|
|
920
|
+
V(d) || Ve(d);
|
|
921
921
|
}
|
|
922
922
|
async function pe(l) {
|
|
923
|
-
var
|
|
923
|
+
var d, m;
|
|
924
924
|
await ue(), typeof l != "number" && fe();
|
|
925
|
-
const
|
|
926
|
-
if (typeof
|
|
927
|
-
const I = (
|
|
928
|
-
(
|
|
925
|
+
const c = l ?? g.value;
|
|
926
|
+
if (typeof c == "number" && c >= 0) {
|
|
927
|
+
const I = (d = n.value) == null ? void 0 : d.querySelectorAll(".m-select-list-item");
|
|
928
|
+
(m = I == null ? void 0 : I[c]) == null || m.scrollIntoView({
|
|
929
929
|
behavior: "auto",
|
|
930
930
|
block: "nearest",
|
|
931
931
|
inline: "start"
|
|
@@ -933,204 +933,201 @@ const Po = ["for"], Lo = {
|
|
|
933
933
|
}
|
|
934
934
|
}
|
|
935
935
|
function fe(l) {
|
|
936
|
-
var
|
|
937
|
-
const
|
|
938
|
-
var I,
|
|
939
|
-
return t.multiple && Array.isArray(t.modelValue) ? l ? l[t.optionValueKey] ===
|
|
936
|
+
var d;
|
|
937
|
+
const c = (d = G.value) == null ? void 0 : d.findIndex((m) => {
|
|
938
|
+
var I, O;
|
|
939
|
+
return t.multiple && Array.isArray(t.modelValue) ? l ? l[t.optionValueKey] === m[t.optionValueKey] : [...t.modelValue].reverse()[0] === m[t.optionValueKey] : ((O = (I = S.value) == null ? void 0 : I[0]) == null ? void 0 : O[t.optionValueKey]) === m[t.optionValueKey];
|
|
940
940
|
});
|
|
941
|
-
g.value =
|
|
941
|
+
g.value = c && c >= 0 ? c : 0;
|
|
942
942
|
}
|
|
943
|
-
function Ve(l,
|
|
944
|
-
var
|
|
945
|
-
|
|
946
|
-
const
|
|
943
|
+
function Ve(l, c = !0) {
|
|
944
|
+
var O;
|
|
945
|
+
c && !t.multiple && ue(() => ae()), x.value = "";
|
|
946
|
+
const d = (O = S.value) == null ? void 0 : O.some(
|
|
947
947
|
(R) => R[t.optionValueKey] === l[t.optionValueKey]
|
|
948
948
|
);
|
|
949
|
-
let
|
|
950
|
-
|
|
949
|
+
let m = S.value;
|
|
950
|
+
d && t.multiple ? m = m == null ? void 0 : m.filter(
|
|
951
951
|
(R) => R[t.optionValueKey] !== l[t.optionValueKey]
|
|
952
|
-
) : t.multiple ?
|
|
953
|
-
const I =
|
|
952
|
+
) : t.multiple ? m.push(l) : m = [l];
|
|
953
|
+
const I = m.map((R) => R[t.optionValueKey]);
|
|
954
954
|
r("update:model-value", t.multiple ? I : I[0]), r("selected-option", l), Re(), fe(l), we();
|
|
955
955
|
}
|
|
956
|
-
return (l,
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
"
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
class
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
956
|
+
return (l, c) => ze((y(), P(
|
|
957
|
+
"div",
|
|
958
|
+
{
|
|
959
|
+
ref_key: "mazSelectElement",
|
|
960
|
+
ref: C,
|
|
961
|
+
class: T(["m-select", [
|
|
962
|
+
{ "--is-open": w.value, "--disabled": l.disabled, "--block": l.block },
|
|
963
|
+
t.class,
|
|
964
|
+
`--${l.size}`
|
|
965
|
+
]]),
|
|
966
|
+
style: oe([l.style, { "--keyboard-selected-bg-color": z.value, "--selected-bg-color": f.value, "--selected-text-color": i.value }])
|
|
967
|
+
},
|
|
968
|
+
[
|
|
969
|
+
U(Ce, le({
|
|
970
|
+
id: k(H),
|
|
971
|
+
ref_key: "mazInputComponent",
|
|
972
|
+
ref: W,
|
|
973
|
+
class: "m-select-input"
|
|
974
|
+
}, l.$attrs, {
|
|
975
|
+
required: l.required,
|
|
976
|
+
"border-active": L.value,
|
|
977
|
+
color: l.color,
|
|
978
|
+
"model-value": M.value,
|
|
979
|
+
size: l.size,
|
|
980
|
+
block: "",
|
|
981
|
+
autocomplete: l.autocomplete,
|
|
982
|
+
disabled: l.disabled,
|
|
983
|
+
onFocus: se(ie, ["prevent", "stop"]),
|
|
984
|
+
onBlur: se(ae, ["prevent", "stop"]),
|
|
985
|
+
onClick: se(ie, ["prevent", "stop"]),
|
|
986
|
+
onChange: c[0] || (c[0] = (d) => r("change", d)),
|
|
987
|
+
onInput: c[1] || (c[1] = (d) => r("input", d)),
|
|
988
|
+
onKeydown: We
|
|
989
|
+
}), {
|
|
990
|
+
"right-icon": J(() => [
|
|
991
|
+
Y("button", {
|
|
992
|
+
tabindex: "-1",
|
|
993
|
+
type: "button",
|
|
994
|
+
class: "m-select-input__toggle-button maz-custom",
|
|
995
|
+
"aria-label": `${w.value ? "collapse" : "expand"} list of options`,
|
|
996
|
+
onClick: se(qe, ["stop"])
|
|
997
|
+
}, [
|
|
998
|
+
U(k(p), { class: "m-select-chevron maz-text-xl" })
|
|
999
|
+
], 8, Mo)
|
|
1000
|
+
]),
|
|
1001
|
+
_: 1
|
|
1002
|
+
/* STABLE */
|
|
1003
|
+
}, 16, ["id", "required", "border-active", "color", "model-value", "size", "autocomplete", "disabled"]),
|
|
1004
|
+
U(lo, { name: Q.value }, {
|
|
1005
|
+
default: J(() => [
|
|
1006
|
+
w.value ? (y(), P(
|
|
1007
|
+
"div",
|
|
1008
|
+
{
|
|
1009
|
+
key: 0,
|
|
1010
|
+
ref_key: "optionsListElement",
|
|
1011
|
+
ref: n,
|
|
1012
|
+
class: T(["m-select-list", {
|
|
1013
|
+
"--top": l.listPosition.includes("top"),
|
|
1014
|
+
"--left": l.listPosition.includes("left"),
|
|
1015
|
+
"--right": l.listPosition.includes("right"),
|
|
1016
|
+
"--bottom": l.listPosition.includes("bottom")
|
|
1017
|
+
}]),
|
|
1018
|
+
style: oe({
|
|
1019
|
+
maxHeight: `${l.maxListHeight}px`,
|
|
1020
|
+
maxWidth: `${l.maxListWidth}px`,
|
|
1021
|
+
minHeight: `${l.minListHeight}px`,
|
|
1022
|
+
minWidth: `${l.minListWidth}px`
|
|
1023
|
+
})
|
|
1024
|
+
},
|
|
1025
|
+
[
|
|
1026
|
+
l.search ? (y(), K(Ce, {
|
|
1011
1027
|
key: 0,
|
|
1012
|
-
ref_key: "
|
|
1013
|
-
ref:
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
name: "search",
|
|
1041
|
-
inputmode: "search",
|
|
1042
|
-
block: "",
|
|
1043
|
-
autocomplete: "off",
|
|
1044
|
-
tabindex: "-1",
|
|
1045
|
-
class: "m-select-list__search-input maz-flex-none",
|
|
1046
|
-
"left-icon": k(v),
|
|
1047
|
-
onKeydown: d[3] || (d[3] = (c) => Se(c, !1))
|
|
1048
|
-
}, null, 8, ["modelValue", "color", "placeholder", "left-icon"])) : E("v-if", !0),
|
|
1049
|
-
!Q.value || Q.value.length <= 0 ? N(l.$slots, "no-results", { key: 1 }, () => [
|
|
1050
|
-
Y("span", To, [
|
|
1051
|
-
H(k(O), { class: "maz-h-6 maz-w-6 maz-text-normal" })
|
|
1052
|
-
])
|
|
1053
|
-
], !0) : (y(), P("div", Fo, [
|
|
1054
|
-
(y(!0), P(
|
|
1028
|
+
ref_key: "searchInputComponent",
|
|
1029
|
+
ref: X,
|
|
1030
|
+
modelValue: x.value,
|
|
1031
|
+
"onUpdate:modelValue": [
|
|
1032
|
+
c[2] || (c[2] = (d) => x.value = d),
|
|
1033
|
+
c[4] || (c[4] = (d) => g.value = 0)
|
|
1034
|
+
],
|
|
1035
|
+
size: "sm",
|
|
1036
|
+
color: l.color,
|
|
1037
|
+
placeholder: l.searchPlaceholder,
|
|
1038
|
+
name: "search",
|
|
1039
|
+
inputmode: "search",
|
|
1040
|
+
block: "",
|
|
1041
|
+
autocomplete: "off",
|
|
1042
|
+
tabindex: "-1",
|
|
1043
|
+
class: "m-select-list__search-input maz-flex-none",
|
|
1044
|
+
"left-icon": k(v),
|
|
1045
|
+
onKeydown: c[3] || (c[3] = (d) => Se(d, !1))
|
|
1046
|
+
}, null, 8, ["modelValue", "color", "placeholder", "left-icon"])) : $("v-if", !0),
|
|
1047
|
+
!G.value || G.value.length <= 0 ? N(l.$slots, "no-results", { key: 1 }, () => [
|
|
1048
|
+
Y("span", To, [
|
|
1049
|
+
U(k(B), { class: "maz-h-6 maz-w-6 maz-text-normal" })
|
|
1050
|
+
])
|
|
1051
|
+
], !0) : (y(), P("div", Fo, [
|
|
1052
|
+
(y(!0), P(
|
|
1053
|
+
be,
|
|
1054
|
+
null,
|
|
1055
|
+
Be(G.value, (d, m) => (y(), P(
|
|
1055
1056
|
be,
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1057
|
+
{ key: m },
|
|
1058
|
+
[
|
|
1059
|
+
d.label && d.isOptGroup ? N(l.$slots, "optgroup", {
|
|
1060
|
+
key: 0,
|
|
1061
|
+
label: d.label
|
|
1062
|
+
}, () => [
|
|
1063
|
+
Y(
|
|
1064
|
+
"span",
|
|
1065
|
+
No,
|
|
1066
|
+
te(d.label),
|
|
1067
|
+
1
|
|
1068
|
+
/* TEXT */
|
|
1069
|
+
)
|
|
1070
|
+
], !0) : (y(), P("button", {
|
|
1071
|
+
key: 1,
|
|
1072
|
+
tabindex: "-1",
|
|
1073
|
+
type: "button",
|
|
1074
|
+
class: T(["m-select-list-item maz-custom maz-flex-none", [
|
|
1075
|
+
{
|
|
1076
|
+
"--is-keyboard-selected": g.value === m,
|
|
1077
|
+
"--is-selected": D(d),
|
|
1078
|
+
"--is-none-value": V(d[l.optionValueKey])
|
|
1079
|
+
}
|
|
1080
|
+
]]),
|
|
1081
|
+
style: oe(l.itemHeight ? { height: `${l.itemHeight}px` } : void 0),
|
|
1082
|
+
onClick: se((I) => Ve(d), ["prevent", "stop"])
|
|
1083
|
+
}, [
|
|
1084
|
+
l.multiple ? (y(), K(k(u), {
|
|
1062
1085
|
key: 0,
|
|
1063
|
-
|
|
1086
|
+
tabindex: "-1",
|
|
1087
|
+
"model-value": D(d),
|
|
1088
|
+
size: "sm",
|
|
1089
|
+
color: l.color
|
|
1090
|
+
}, null, 8, ["model-value", "color"])) : $("v-if", !0),
|
|
1091
|
+
N(l.$slots, "default", {
|
|
1092
|
+
option: d,
|
|
1093
|
+
isSelected: D(d)
|
|
1064
1094
|
}, () => [
|
|
1065
1095
|
Y(
|
|
1066
1096
|
"span",
|
|
1067
|
-
|
|
1068
|
-
|
|
1097
|
+
null,
|
|
1098
|
+
te(d[l.optionLabelKey]),
|
|
1069
1099
|
1
|
|
1070
1100
|
/* TEXT */
|
|
1071
1101
|
)
|
|
1072
|
-
], !0)
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
null,
|
|
1100
|
-
oe(c[l.optionLabelKey]),
|
|
1101
|
-
1
|
|
1102
|
-
/* TEXT */
|
|
1103
|
-
)
|
|
1104
|
-
], !0)
|
|
1105
|
-
], 14, Ko))
|
|
1106
|
-
],
|
|
1107
|
-
64
|
|
1108
|
-
/* STABLE_FRAGMENT */
|
|
1109
|
-
))),
|
|
1110
|
-
128
|
|
1111
|
-
/* KEYED_FRAGMENT */
|
|
1112
|
-
))
|
|
1113
|
-
]))
|
|
1114
|
-
],
|
|
1115
|
-
6
|
|
1116
|
-
/* CLASS, STYLE */
|
|
1117
|
-
)) : E("v-if", !0)
|
|
1118
|
-
]),
|
|
1119
|
-
_: 3
|
|
1120
|
-
/* FORWARDED */
|
|
1121
|
-
}, 8, ["name"])
|
|
1122
|
-
],
|
|
1123
|
-
6
|
|
1124
|
-
/* CLASS, STYLE */
|
|
1125
|
-
)), [
|
|
1126
|
-
[k(So), {
|
|
1127
|
-
exclude: (m = l.excludeSelectors) != null && m.length ? l.excludeSelectors : [],
|
|
1128
|
-
handler: ae
|
|
1129
|
-
}]
|
|
1130
|
-
]);
|
|
1131
|
-
};
|
|
1102
|
+
], !0)
|
|
1103
|
+
], 14, Ko))
|
|
1104
|
+
],
|
|
1105
|
+
64
|
|
1106
|
+
/* STABLE_FRAGMENT */
|
|
1107
|
+
))),
|
|
1108
|
+
128
|
|
1109
|
+
/* KEYED_FRAGMENT */
|
|
1110
|
+
))
|
|
1111
|
+
]))
|
|
1112
|
+
],
|
|
1113
|
+
6
|
|
1114
|
+
/* CLASS, STYLE */
|
|
1115
|
+
)) : $("v-if", !0)
|
|
1116
|
+
]),
|
|
1117
|
+
_: 3
|
|
1118
|
+
/* FORWARDED */
|
|
1119
|
+
}, 8, ["name"])
|
|
1120
|
+
],
|
|
1121
|
+
6
|
|
1122
|
+
/* CLASS, STYLE */
|
|
1123
|
+
)), [
|
|
1124
|
+
[k(So), {
|
|
1125
|
+
exclude: l.excludeSelectors,
|
|
1126
|
+
handler: ae
|
|
1127
|
+
}]
|
|
1128
|
+
]);
|
|
1132
1129
|
}
|
|
1133
|
-
}), Ho = /* @__PURE__ */ re(Uo, [["__scopeId", "data-v-
|
|
1130
|
+
}), Ho = /* @__PURE__ */ re(Uo, [["__scopeId", "data-v-07cbef8c"]]);
|
|
1134
1131
|
function Ue() {
|
|
1135
1132
|
if (typeof window > "u")
|
|
1136
1133
|
return;
|
|
@@ -1221,7 +1218,7 @@ const jo = ["id"], Wo = {
|
|
|
1221
1218
|
},
|
|
1222
1219
|
emits: ["update:model-value"],
|
|
1223
1220
|
setup(a) {
|
|
1224
|
-
const o = a, { phoneNumber: e } = Te("data"), t =
|
|
1221
|
+
const o = a, { phoneNumber: e } = Te("data"), t = E(), { getCountriesList: r } = He(), u = h(() => r(o.countryLocale, o.customCountriesList)), v = h(
|
|
1225
1222
|
() => {
|
|
1226
1223
|
var i;
|
|
1227
1224
|
return (i = u.value) == null ? void 0 : i.filter((f) => {
|
|
@@ -1237,7 +1234,7 @@ const jo = ["id"], Wo = {
|
|
|
1237
1234
|
return (z = v.value) == null ? void 0 : z.find((w) => w.iso2.includes(f));
|
|
1238
1235
|
}
|
|
1239
1236
|
);
|
|
1240
|
-
}),
|
|
1237
|
+
}), B = h(
|
|
1241
1238
|
() => {
|
|
1242
1239
|
var i;
|
|
1243
1240
|
return (i = v.value) == null ? void 0 : i.filter((f) => {
|
|
@@ -1245,12 +1242,12 @@ const jo = ["id"], Wo = {
|
|
|
1245
1242
|
return !((z = o.preferredCountries) != null && z.includes(f.iso2));
|
|
1246
1243
|
});
|
|
1247
1244
|
}
|
|
1248
|
-
),
|
|
1249
|
-
() => o.preferredCountries ? [...p.value ?? [], ...
|
|
1245
|
+
), L = h(
|
|
1246
|
+
() => o.preferredCountries ? [...p.value ?? [], ...B.value ?? []] : o.onlyCountries ? p.value : v.value
|
|
1250
1247
|
), g = h(
|
|
1251
1248
|
() => {
|
|
1252
1249
|
var i;
|
|
1253
|
-
return (i =
|
|
1250
|
+
return (i = L.value) == null ? void 0 : i.map(
|
|
1254
1251
|
(f) => f ? {
|
|
1255
1252
|
...f,
|
|
1256
1253
|
dialCode: `+${f.dialCode}`
|
|
@@ -1259,20 +1256,20 @@ const jo = ["id"], Wo = {
|
|
|
1259
1256
|
}
|
|
1260
1257
|
);
|
|
1261
1258
|
function A() {
|
|
1262
|
-
var i
|
|
1263
|
-
(
|
|
1259
|
+
var i;
|
|
1260
|
+
(i = t.value) == null || i.openList();
|
|
1264
1261
|
}
|
|
1265
1262
|
return (i, f) => (y(), P(
|
|
1266
1263
|
"div",
|
|
1267
1264
|
{
|
|
1268
|
-
class:
|
|
1269
|
-
style:
|
|
1265
|
+
class: T(["m-country-selector", [o.class, { "--no-flags": i.noFlags }]]),
|
|
1266
|
+
style: oe(i.style)
|
|
1270
1267
|
},
|
|
1271
1268
|
[
|
|
1272
1269
|
i.modelValue && !i.noFlags ? (y(), P("button", {
|
|
1273
1270
|
key: 0,
|
|
1274
1271
|
id: `country-selector-flag-button-${i.id}`,
|
|
1275
|
-
class:
|
|
1272
|
+
class: T(["m-country-selector__country-flag", {
|
|
1276
1273
|
"--should-have-bottom-flag": i.locales.countrySelector.placeholder.length > 0
|
|
1277
1274
|
}]),
|
|
1278
1275
|
tabindex: "-1",
|
|
@@ -1280,7 +1277,7 @@ const jo = ["id"], Wo = {
|
|
|
1280
1277
|
onClick: A
|
|
1281
1278
|
}, [
|
|
1282
1279
|
N(i.$slots, "selector-flag", { countryCode: i.modelValue }, () => [
|
|
1283
|
-
|
|
1280
|
+
U(Ee, {
|
|
1284
1281
|
src: k(Le)(i.modelValue, "h20"),
|
|
1285
1282
|
alt: i.modelValue,
|
|
1286
1283
|
width: "20",
|
|
@@ -1288,8 +1285,8 @@ const jo = ["id"], Wo = {
|
|
|
1288
1285
|
"img-class": "maz-w-5 maz-h-4 maz-rounded-sm"
|
|
1289
1286
|
}, null, 8, ["src", "alt"])
|
|
1290
1287
|
], !0)
|
|
1291
|
-
], 10, jo)) :
|
|
1292
|
-
|
|
1288
|
+
], 10, jo)) : $("v-if", !0),
|
|
1289
|
+
U(Ho, le({
|
|
1293
1290
|
id: `country-selector-${i.id}`,
|
|
1294
1291
|
ref_key: "CountrySelectorRef",
|
|
1295
1292
|
ref: t,
|
|
@@ -1321,14 +1318,14 @@ const jo = ["id"], Wo = {
|
|
|
1321
1318
|
"exclude-selectors": [`#country-selector-flag-button-${i.id}`, ...i.excludeSelectors ?? []],
|
|
1322
1319
|
"onUpdate:modelValue": f[0] || (f[0] = (z) => i.$emit("update:model-value", z))
|
|
1323
1320
|
}), {
|
|
1324
|
-
"no-results":
|
|
1321
|
+
"no-results": J(() => [
|
|
1325
1322
|
N(i.$slots, "no-results", {}, void 0, !0)
|
|
1326
1323
|
]),
|
|
1327
|
-
default:
|
|
1324
|
+
default: J(({ option: z, isSelected: w }) => [
|
|
1328
1325
|
Y(
|
|
1329
1326
|
"div",
|
|
1330
1327
|
{
|
|
1331
|
-
class:
|
|
1328
|
+
class: T(["m-country-selector__select__item", {
|
|
1332
1329
|
"m-country-selector__select__item--selected": w
|
|
1333
1330
|
}])
|
|
1334
1331
|
},
|
|
@@ -1339,7 +1336,7 @@ const jo = ["id"], Wo = {
|
|
|
1339
1336
|
option: z,
|
|
1340
1337
|
isSelected: w
|
|
1341
1338
|
}, () => [
|
|
1342
|
-
|
|
1339
|
+
U(Ee, {
|
|
1343
1340
|
src: k(Le)(z.iso2, "h20"),
|
|
1344
1341
|
alt: `${z.name} flag`,
|
|
1345
1342
|
width: "20",
|
|
@@ -1347,23 +1344,23 @@ const jo = ["id"], Wo = {
|
|
|
1347
1344
|
"img-class": "maz-rounded-full maz-w-5 maz-h-5"
|
|
1348
1345
|
}, null, 8, ["src", "alt"])
|
|
1349
1346
|
], !0)
|
|
1350
|
-
])) :
|
|
1347
|
+
])) : $("v-if", !0),
|
|
1351
1348
|
i.showCodeOnList ? (y(), P(
|
|
1352
1349
|
"span",
|
|
1353
1350
|
{
|
|
1354
1351
|
key: 1,
|
|
1355
|
-
class:
|
|
1352
|
+
class: T(["maz-w-9 maz-flex-none", { "maz-text-muted": !w }])
|
|
1356
1353
|
},
|
|
1357
|
-
|
|
1354
|
+
te(z.dialCode),
|
|
1358
1355
|
3
|
|
1359
1356
|
/* TEXT, CLASS */
|
|
1360
|
-
)) :
|
|
1357
|
+
)) : $("v-if", !0),
|
|
1361
1358
|
Y(
|
|
1362
1359
|
"span",
|
|
1363
1360
|
{
|
|
1364
|
-
class:
|
|
1361
|
+
class: T(["maz-flex-1 maz-truncate", { "maz-font-semibold": w }])
|
|
1365
1362
|
},
|
|
1366
|
-
|
|
1363
|
+
te(z.name),
|
|
1367
1364
|
3
|
|
1368
1365
|
/* TEXT, CLASS */
|
|
1369
1366
|
)
|
|
@@ -1380,7 +1377,7 @@ const jo = ["id"], Wo = {
|
|
|
1380
1377
|
/* CLASS, STYLE */
|
|
1381
1378
|
));
|
|
1382
1379
|
}
|
|
1383
|
-
}), Go = /* @__PURE__ */ re(Qo, [["__scopeId", "data-v-
|
|
1380
|
+
}), Go = /* @__PURE__ */ re(Qo, [["__scopeId", "data-v-e2fee821"]]), Jo = {
|
|
1384
1381
|
countrySelector: {
|
|
1385
1382
|
placeholder: "Country code",
|
|
1386
1383
|
error: "Choose country",
|
|
@@ -1409,10 +1406,10 @@ function Xo({
|
|
|
1409
1406
|
isValid: !1,
|
|
1410
1407
|
countryCode: o
|
|
1411
1408
|
};
|
|
1412
|
-
const e = ro(a, o ?? void 0);
|
|
1409
|
+
const e = ro(a, o ?? void 0), t = (e == null ? void 0 : e.isValid()) ?? !1;
|
|
1413
1410
|
return {
|
|
1414
|
-
countryCode:
|
|
1415
|
-
isValid:
|
|
1411
|
+
countryCode: e == null ? void 0 : e.country,
|
|
1412
|
+
isValid: t,
|
|
1416
1413
|
isPossible: e == null ? void 0 : e.isPossible(),
|
|
1417
1414
|
countryCallingCode: e == null ? void 0 : e.countryCallingCode,
|
|
1418
1415
|
nationalNumber: e == null ? void 0 : e.nationalNumber,
|
|
@@ -1422,6 +1419,7 @@ function Xo({
|
|
|
1422
1419
|
uri: e == null ? void 0 : e.getURI(),
|
|
1423
1420
|
e164: e == null ? void 0 : e.format("E.164"),
|
|
1424
1421
|
rfc3966: e == null ? void 0 : e.format("RFC3966"),
|
|
1422
|
+
possibleCountries: e == null ? void 0 : e.getPossibleCountries(),
|
|
1425
1423
|
phoneNumber: a
|
|
1426
1424
|
};
|
|
1427
1425
|
} catch (e) {
|
|
@@ -1484,7 +1482,7 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1484
1482
|
}),
|
|
1485
1483
|
emits: /* @__PURE__ */ Pe(["update:model-value"], ["update:modelValue"]),
|
|
1486
1484
|
setup(a, { emit: o }) {
|
|
1487
|
-
const e = a, t = o, r = ao(a, "modelValue"), { getPhoneNumberExamplesFile: u, getPhoneNumberExample: v } = De(), { selectionRange: p, results:
|
|
1485
|
+
const e = a, t = o, r = ao(a, "modelValue"), { getPhoneNumberExamplesFile: u, getPhoneNumberExample: v } = De(), { selectionRange: p, results: B, selectedCountry: L } = Te("data"), g = E(), A = E(!1);
|
|
1488
1486
|
function i(b, S) {
|
|
1489
1487
|
const C = v(b, S);
|
|
1490
1488
|
return C ? `${e.locales.phoneInput.example} ${C}` : void 0;
|
|
@@ -1497,15 +1495,15 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1497
1495
|
if (e.noExample || !g.value)
|
|
1498
1496
|
return b;
|
|
1499
1497
|
{
|
|
1500
|
-
const C = i(g.value,
|
|
1501
|
-
return (S =
|
|
1498
|
+
const C = i(g.value, L.value);
|
|
1499
|
+
return (S = B.value) != null && S.isValid || !C ? b : C;
|
|
1502
1500
|
}
|
|
1503
1501
|
}), z = h(() => e.placeholder ? {
|
|
1504
1502
|
placeholder: f.value
|
|
1505
1503
|
} : {
|
|
1506
1504
|
label: f.value
|
|
1507
|
-
}), w =
|
|
1508
|
-
async function
|
|
1505
|
+
}), w = E();
|
|
1506
|
+
async function H() {
|
|
1509
1507
|
try {
|
|
1510
1508
|
if (g.value)
|
|
1511
1509
|
return;
|
|
@@ -1515,15 +1513,15 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1515
1513
|
}
|
|
1516
1514
|
}
|
|
1517
1515
|
async function j(b) {
|
|
1518
|
-
w.value && b &&
|
|
1516
|
+
w.value && b && Z(w.value, b), await ue(), t("update:model-value", b);
|
|
1519
1517
|
}
|
|
1520
|
-
function
|
|
1518
|
+
function Z(b, S) {
|
|
1521
1519
|
const C = b.$el.querySelector("input");
|
|
1522
1520
|
p.value.start = C == null ? void 0 : C.selectionStart, p.value.end = C == null ? void 0 : C.selectionEnd, p.value.cursorAtEnd = S && typeof p.value.start == "number" && S.length > 0 ? p.value.start >= S.length : !0;
|
|
1523
1521
|
}
|
|
1524
1522
|
return Ie(() => {
|
|
1525
|
-
e.noExample ||
|
|
1526
|
-
}), (b, S) => (y(),
|
|
1523
|
+
e.noExample || H();
|
|
1524
|
+
}), (b, S) => (y(), K(Ce, le({
|
|
1527
1525
|
id: b.id,
|
|
1528
1526
|
ref_key: "PhoneInputRef",
|
|
1529
1527
|
ref: w,
|
|
@@ -1537,7 +1535,7 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1537
1535
|
class: ["m-phone-input", [
|
|
1538
1536
|
{
|
|
1539
1537
|
"--border-radius": b.hasRadius,
|
|
1540
|
-
"--error": b.error || !k(
|
|
1538
|
+
"--error": b.error || !k(B).isValid,
|
|
1541
1539
|
"--focused": A.value
|
|
1542
1540
|
}
|
|
1543
1541
|
]],
|
|
@@ -1546,7 +1544,7 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1546
1544
|
"onUpdate:modelValue": S[2] || (S[2] = (C) => j(C))
|
|
1547
1545
|
}), null, 16, ["id", "model-value", "disabled", "color", "error", "size", "success", "class"]));
|
|
1548
1546
|
}
|
|
1549
|
-
}), tt = /* @__PURE__ */ re(ot, [["__scopeId", "data-v-
|
|
1547
|
+
}), tt = /* @__PURE__ */ re(ot, [["__scopeId", "data-v-fcb760a8"]]), lt = /* @__PURE__ */ ne({
|
|
1550
1548
|
name: "MazPhoneNumberInput",
|
|
1551
1549
|
inheritAttrs: !1,
|
|
1552
1550
|
__name: "MazPhoneNumberInput",
|
|
@@ -1601,13 +1599,13 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1601
1599
|
},
|
|
1602
1600
|
emits: ["update:model-value", "country-code", "update:country-code", "update", "data"],
|
|
1603
1601
|
setup(a, { emit: o }) {
|
|
1604
|
-
const e = a, t = o, { fetchCountryCode: r, sanitizePhoneNumber: u, getBrowserLocale: v } = He(), { isCountryAvailable: p, getPhoneNumberResults:
|
|
1602
|
+
const e = a, t = o, { fetchCountryCode: r, sanitizePhoneNumber: u, getBrowserLocale: v } = He(), { isCountryAvailable: p, getPhoneNumberResults: B, getAsYouTypeFormat: L } = De(), g = Ae({
|
|
1605
1603
|
componentName: "MazPhoneNumberInput",
|
|
1606
1604
|
providedId: e.id
|
|
1607
|
-
}), A =
|
|
1605
|
+
}), A = E(), i = E(), f = E({
|
|
1608
1606
|
isValid: !1,
|
|
1609
1607
|
countryCode: void 0
|
|
1610
|
-
}), z =
|
|
1608
|
+
}), z = E(), w = E({
|
|
1611
1609
|
start: 0,
|
|
1612
1610
|
end: 0,
|
|
1613
1611
|
cursorAtEnd: !0
|
|
@@ -1618,7 +1616,7 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1618
1616
|
results: f,
|
|
1619
1617
|
selectionRange: w
|
|
1620
1618
|
});
|
|
1621
|
-
const
|
|
1619
|
+
const H = h(() => ({
|
|
1622
1620
|
...Jo,
|
|
1623
1621
|
...e.translations
|
|
1624
1622
|
}));
|
|
@@ -1634,24 +1632,24 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1634
1632
|
C(V);
|
|
1635
1633
|
}
|
|
1636
1634
|
});
|
|
1637
|
-
const j =
|
|
1638
|
-
function
|
|
1635
|
+
const j = E();
|
|
1636
|
+
function Z() {
|
|
1639
1637
|
var n;
|
|
1640
1638
|
return (n = j.value) == null ? void 0 : n.$el.querySelector("input");
|
|
1641
1639
|
}
|
|
1642
1640
|
async function b() {
|
|
1643
1641
|
var n;
|
|
1644
|
-
await ue(), (n =
|
|
1642
|
+
await ue(), (n = Z()) == null || n.select();
|
|
1645
1643
|
}
|
|
1646
1644
|
function S(n) {
|
|
1647
|
-
|
|
1645
|
+
X({
|
|
1648
1646
|
countryCode: n
|
|
1649
1647
|
}), b();
|
|
1650
1648
|
}
|
|
1651
1649
|
function C(n) {
|
|
1652
1650
|
if (n) {
|
|
1653
1651
|
if (!p(n)) {
|
|
1654
|
-
i.value = void 0;
|
|
1652
|
+
console.warn(`[MazPhoneNumberInput] Country code not available: "${n}"`), i.value = void 0;
|
|
1655
1653
|
return;
|
|
1656
1654
|
}
|
|
1657
1655
|
i.value = n;
|
|
@@ -1659,23 +1657,24 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1659
1657
|
}
|
|
1660
1658
|
function W({
|
|
1661
1659
|
newPhoneNumber: n,
|
|
1662
|
-
updateResults: V = !0
|
|
1660
|
+
updateResults: V = !0,
|
|
1661
|
+
updateCountry: D = !0
|
|
1663
1662
|
}) {
|
|
1664
|
-
const
|
|
1665
|
-
if (V && (f.value =
|
|
1666
|
-
phoneNumber:
|
|
1663
|
+
const M = u(n);
|
|
1664
|
+
if (V && (f.value = B({
|
|
1665
|
+
phoneNumber: M,
|
|
1667
1666
|
countryCode: i.value
|
|
1668
1667
|
})), w.value.cursorAtEnd && !e.noFormattingAsYouType && e.autoFormat) {
|
|
1669
|
-
const
|
|
1670
|
-
z.value =
|
|
1668
|
+
const Q = f.value.isValid ? f.value.formatNational : M;
|
|
1669
|
+
z.value = L(i.value, Q), A.value = z.value || Q;
|
|
1671
1670
|
} else
|
|
1672
|
-
A.value =
|
|
1673
|
-
f.value.countryCode && f.value.countryCode !== i.value &&
|
|
1671
|
+
A.value = f.value.isValid ? f.value.formatNational : M;
|
|
1672
|
+
D && f.value.countryCode && f.value.countryCode !== i.value && X({
|
|
1674
1673
|
countryCode: f.value.countryCode,
|
|
1675
1674
|
updateResults: !1
|
|
1676
1675
|
});
|
|
1677
1676
|
}
|
|
1678
|
-
function
|
|
1677
|
+
function X({
|
|
1679
1678
|
countryCode: n,
|
|
1680
1679
|
updateResults: V = !0
|
|
1681
1680
|
}) {
|
|
@@ -1683,12 +1682,13 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1683
1682
|
i.value = void 0;
|
|
1684
1683
|
return;
|
|
1685
1684
|
}
|
|
1686
|
-
n !== i.value && C(n), V && (f.value =
|
|
1685
|
+
n !== i.value && C(n), V && (f.value = B({
|
|
1687
1686
|
phoneNumber: A.value,
|
|
1688
1687
|
countryCode: n
|
|
1689
1688
|
})), W({
|
|
1690
1689
|
newPhoneNumber: A.value,
|
|
1691
|
-
updateResults: !1
|
|
1690
|
+
updateResults: !1,
|
|
1691
|
+
updateCountry: !1
|
|
1692
1692
|
});
|
|
1693
1693
|
}
|
|
1694
1694
|
return he(
|
|
@@ -1704,7 +1704,7 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1704
1704
|
), he(
|
|
1705
1705
|
() => e.countryCode ?? e.defaultCountryCode,
|
|
1706
1706
|
(n, V) => {
|
|
1707
|
-
n && n !== V && n !== i.value &&
|
|
1707
|
+
n && n !== V && n !== i.value && X({
|
|
1708
1708
|
countryCode: n
|
|
1709
1709
|
});
|
|
1710
1710
|
},
|
|
@@ -1720,15 +1720,15 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1720
1720
|
immediate: !0
|
|
1721
1721
|
}
|
|
1722
1722
|
), (n, V) => {
|
|
1723
|
-
var
|
|
1723
|
+
var D;
|
|
1724
1724
|
return y(), P(
|
|
1725
1725
|
"div",
|
|
1726
1726
|
{
|
|
1727
|
-
class:
|
|
1728
|
-
style:
|
|
1727
|
+
class: T(["m-phone-number-input", [e.class, { "--block": n.block }, n.orientation ? `--${n.orientation}` : void 0]]),
|
|
1728
|
+
style: oe(n.style)
|
|
1729
1729
|
},
|
|
1730
1730
|
[
|
|
1731
|
-
n.noCountrySelector ?
|
|
1731
|
+
n.noCountrySelector ? $("v-if", !0) : (y(), K(Go, le({
|
|
1732
1732
|
key: 0,
|
|
1733
1733
|
id: k(g)
|
|
1734
1734
|
}, n.countrySelectAttributes, {
|
|
@@ -1744,8 +1744,8 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1744
1744
|
"no-search": n.noSearch,
|
|
1745
1745
|
"exclude-selectors": n.excludeSelectors,
|
|
1746
1746
|
error: n.error || (n.noValidationError ? !1 : !!A.value && !i.value),
|
|
1747
|
-
success: n.success || (n.noValidationSuccess ? !1 : (
|
|
1748
|
-
locales:
|
|
1747
|
+
success: n.success || (n.noValidationSuccess ? !1 : (D = f.value) == null ? void 0 : D.isValid),
|
|
1748
|
+
locales: H.value,
|
|
1749
1749
|
disabled: n.disabled,
|
|
1750
1750
|
"search-threshold": n.searchThreshold,
|
|
1751
1751
|
"show-code-on-list": n.showCodeOnList,
|
|
@@ -1754,28 +1754,28 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1754
1754
|
width: n.countrySelectorWidth,
|
|
1755
1755
|
"onUpdate:modelValue": S
|
|
1756
1756
|
}), {
|
|
1757
|
-
"no-results":
|
|
1757
|
+
"no-results": J(() => [
|
|
1758
1758
|
N(n.$slots, "no-results", {}, void 0, !0)
|
|
1759
1759
|
]),
|
|
1760
|
-
"selector-flag":
|
|
1761
|
-
N(n.$slots, "selector-flag", { countryCode:
|
|
1760
|
+
"selector-flag": J(({ countryCode: M }) => [
|
|
1761
|
+
N(n.$slots, "selector-flag", { countryCode: M }, void 0, !0)
|
|
1762
1762
|
]),
|
|
1763
|
-
"country-list-flag":
|
|
1763
|
+
"country-list-flag": J(({ isSelected: M, option: Q }) => [
|
|
1764
1764
|
N(n.$slots, "country-list-flag", {
|
|
1765
|
-
countryCode:
|
|
1766
|
-
option:
|
|
1767
|
-
isSelected:
|
|
1765
|
+
countryCode: Q.iso2,
|
|
1766
|
+
option: Q,
|
|
1767
|
+
isSelected: M
|
|
1768
1768
|
}, void 0, !0)
|
|
1769
1769
|
]),
|
|
1770
1770
|
_: 3
|
|
1771
1771
|
/* FORWARDED */
|
|
1772
1772
|
}, 16, ["id", "model-value", "color", "size", "country-locale", "country-selector-display-name", "custom-countries-list", "ignored-countries", "list-position", "no-flags", "no-search", "exclude-selectors", "error", "success", "locales", "disabled", "search-threshold", "show-code-on-list", "only-countries", "preferred-countries", "width"])),
|
|
1773
|
-
|
|
1773
|
+
U(tt, le({
|
|
1774
1774
|
id: k(g),
|
|
1775
1775
|
ref_key: "PhoneInputRef",
|
|
1776
1776
|
ref: j,
|
|
1777
1777
|
modelValue: A.value,
|
|
1778
|
-
"onUpdate:modelValue": V[0] || (V[0] = (
|
|
1778
|
+
"onUpdate:modelValue": V[0] || (V[0] = (M) => A.value = M)
|
|
1779
1779
|
}, { ...n.$attrs, ...n.phoneInputAttributes }, {
|
|
1780
1780
|
color: n.color,
|
|
1781
1781
|
size: n.size,
|
|
@@ -1785,13 +1785,13 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1785
1785
|
"has-radius": !n.noCountrySelector,
|
|
1786
1786
|
success: n.success || (n.noValidationSuccess ? !1 : f.value.isValid),
|
|
1787
1787
|
error: n.error || (n.noValidationError ? !1 : !!A.value && !f.value.isValid),
|
|
1788
|
-
locales:
|
|
1788
|
+
locales: H.value,
|
|
1789
1789
|
"no-formatting-as-you-type": n.noFormattingAsYouType,
|
|
1790
1790
|
"auto-format": n.autoFormat,
|
|
1791
1791
|
label: n.label,
|
|
1792
1792
|
placeholder: n.placeholder,
|
|
1793
|
-
"onUpdate:modelValue": V[1] || (V[1] = (
|
|
1794
|
-
newPhoneNumber:
|
|
1793
|
+
"onUpdate:modelValue": V[1] || (V[1] = (M) => W({
|
|
1794
|
+
newPhoneNumber: M
|
|
1795
1795
|
}))
|
|
1796
1796
|
}), null, 16, ["id", "modelValue", "color", "size", "no-example", "disabled", "has-radius", "success", "error", "locales", "no-formatting-as-you-type", "auto-format", "label", "placeholder"])
|
|
1797
1797
|
],
|
|
@@ -1800,7 +1800,7 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1800
1800
|
);
|
|
1801
1801
|
};
|
|
1802
1802
|
}
|
|
1803
|
-
}), rt = /* @__PURE__ */ re(lt, [["__scopeId", "data-v-
|
|
1803
|
+
}), rt = /* @__PURE__ */ re(lt, [["__scopeId", "data-v-71810071"]]);
|
|
1804
1804
|
export {
|
|
1805
1805
|
rt as M,
|
|
1806
1806
|
re as _,
|