maz-ui 3.47.2-beta.13 → 3.47.2-beta.15
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/MazAccordion.mjs +34 -35
- package/components/MazBackdrop.mjs +1 -1
- package/components/MazBottomSheet.mjs +1 -1
- package/components/MazCard.mjs +1 -1
- package/components/MazCheckbox.mjs +35 -36
- package/components/MazChecklist.mjs +1 -1
- package/components/MazCircularProgressBar.mjs +15 -16
- package/components/MazDialog.mjs +1 -1
- package/components/MazDialogPromise.mjs +1 -1
- package/components/MazDrawer.mjs +1 -1
- package/components/MazDropdown.mjs +1 -1
- package/components/MazFullscreenLoader.mjs +7 -7
- package/components/MazGallery.mjs +1 -1
- package/components/MazInput.mjs +1 -1
- package/components/MazInputNumber.mjs +1 -1
- package/components/MazInputPrice.mjs +1 -1
- package/components/MazInputTags.mjs +1 -1
- package/components/MazPhoneNumberInput/CountrySelector.vue.d.ts +2 -2
- package/components/MazPhoneNumberInput/PhoneInput.vue.d.ts +3 -3
- package/components/MazPhoneNumberInput/types.d.ts +1 -1
- package/components/MazPhoneNumberInput/use-libphonenumber.d.ts +4 -4
- package/components/MazPhoneNumberInput/use-maz-phone-number-input.d.ts +1 -1
- package/components/MazPhoneNumberInput.d.ts +65 -24
- package/components/MazPhoneNumberInput.mjs +1 -1
- package/components/MazPicker.mjs +1 -1
- package/components/MazRadio.mjs +19 -20
- package/components/MazSelect.mjs +1 -1
- package/components/MazSwitch.mjs +15 -16
- package/components/MazTable.mjs +1 -1
- package/components/MazTabsBar.mjs +1 -1
- package/components/MazTabsContentItem.mjs +7 -7
- package/components/MazTextarea.mjs +2 -3
- package/components/assets/MazGallery.css +1 -1
- package/components/assets/MazPhoneNumberInput.css +1 -1
- package/components/assets/MazSelect.css +1 -1
- package/components/assets/MazTabsBar.css +1 -1
- package/components/assets/MazTabsContentItem.css +1 -1
- package/components/chunks/{MazBadge-CupQjB8D.mjs → MazBadge-DCzaExPj.mjs} +1 -1
- package/components/chunks/{MazBottomSheet-D9EPpEV8.mjs → MazBottomSheet-B1cqFZxd.mjs} +2 -2
- package/components/chunks/{MazBtn-CQq-U8qQ.mjs → MazBtn-BBjeD4hu.mjs} +2 -2
- package/components/chunks/MazBtn-BDrYYq_W.mjs +103 -0
- package/components/chunks/MazBtn-BQwIuO_Q.mjs +103 -0
- package/components/chunks/{MazBtn-Chk7DWOF.mjs → MazBtn-C4nwxs9T.mjs} +2 -2
- package/components/chunks/{MazBtn-BSgCMRt0.mjs → MazBtn-CElHmZjv.mjs} +2 -2
- package/components/chunks/{MazBtn-Br3xKJMD.mjs → MazBtn-D1jMqwE1.mjs} +2 -2
- package/components/chunks/MazBtn-Db6ai-Mv.mjs +103 -0
- package/components/chunks/{MazBtn-CB6xVwox.mjs → MazBtn-LssGZPPh.mjs} +2 -2
- package/components/chunks/{MazBtn-BfIn7glE.mjs → MazBtn-ZigrzA2_.mjs} +2 -2
- package/components/chunks/{MazBtn-DhSKmF01.mjs → MazBtn-oZhhJy09.mjs} +1 -1
- package/components/chunks/{MazBtn-DI80W9rl.mjs → MazBtn-u8A4zbVD.mjs} +2 -2
- package/components/chunks/{MazCard-XBaeDZkg.mjs → MazCard-98OuVlyK.mjs} +1 -1
- package/components/chunks/{MazCheckbox-DxfneUvu.mjs → MazCheckbox-CE_7EoUE.mjs} +1 -1
- package/components/chunks/{MazCheckbox-B-Sw22La.mjs → MazCheckbox-D2fkthdh.mjs} +1 -1
- package/components/chunks/{MazCheckbox-DjY15PA3.mjs → MazCheckbox-Df1bTvTA.mjs} +2 -2
- package/components/chunks/{MazChecklist-DaozZlNb.mjs → MazChecklist-BurPprmw.mjs} +2 -3
- package/components/chunks/{MazDialog-XiX9LEiz.mjs → MazDialog-C3h6Ydey.mjs} +2 -2
- package/components/chunks/{MazDialogPromise-B9_e3Ma9.mjs → MazDialogPromise-BZm1F0X2.mjs} +3 -3
- package/components/chunks/{MazDropdown-CKuIGitT.mjs → MazDropdown-0r445NfW.mjs} +3 -4
- package/components/chunks/{MazGallery-BooLoRWi.mjs → MazGallery-r8SBTCgJ.mjs} +6 -6
- package/components/chunks/{MazGallery-DUOQamrE.mjs → MazGallery-xPp1apvO.mjs} +65 -65
- package/components/chunks/MazIcon-BoTByt7n.mjs +4 -0
- package/components/chunks/{MazIcon-DFW4cVVf.mjs → MazIcon-Y4qVlKF1.mjs} +1 -1
- package/components/chunks/{MazInput-BWAWlxDa.mjs → MazInput-BCxcwHct.mjs} +3 -3
- package/components/chunks/{MazInput-HLPtw5QK.mjs → MazInput-BT-mbJfZ.mjs} +2 -2
- package/components/chunks/{MazInput-DIN1VAoX.mjs → MazInput-BfWJoPre.mjs} +3 -4
- package/components/chunks/{MazInputNumber-7Ku2ZcG-.mjs → MazInputNumber-R0RzDeyD.mjs} +20 -21
- package/components/chunks/{MazInputPrice-C5yErBFP.mjs → MazInputPrice-CKSdqO4X.mjs} +3 -4
- package/components/chunks/{MazInputTags-DvbQ2mK8.mjs → MazInputTags-D6jQ2-Ia.mjs} +2 -3
- package/components/chunks/{MazLink-mrqHeBS0.mjs → MazLink-tud3eDgU.mjs} +1 -1
- package/components/chunks/{MazLoadingBar-CNm3Yt6D.mjs → MazLoadingBar-Difme_hf.mjs} +1 -1
- package/components/chunks/{MazPhoneNumberInput-B5Up8CqL.mjs → MazPhoneNumberInput-Brc7mthM.mjs} +155 -153
- package/components/chunks/{MazPicker-CzYUZcLy.mjs → MazPicker-CwiuW5Pv.mjs} +4 -5
- package/components/chunks/{MazPickerMonthSwitcher-Ds5agR3Z.mjs → MazPickerMonthSwitcher-C65el7R0.mjs} +1 -1
- package/components/chunks/{MazPickerShortcuts-BP6CY9-c.mjs → MazPickerShortcuts-DbrOoszH.mjs} +1 -1
- package/components/chunks/{MazPickerYearSwitcher-PM8qZMzR.mjs → MazPickerYearSwitcher-D9lqntyR.mjs} +1 -1
- package/components/chunks/{MazSelect-DOexatNj.mjs → MazSelect-BTj-gsNu.mjs} +4 -5
- package/components/chunks/{MazSelect-DaDRzcT_.mjs → MazSelect-rBU47Yma.mjs} +4 -4
- package/components/chunks/{MazSpinner-Bsy1nA3c.mjs → MazSpinner-1F6A6qVD.mjs} +1 -1
- package/components/chunks/MazSpinner-4ja9Gafa.mjs +34 -0
- package/components/chunks/{MazSpinner-BJpv1muf.mjs → MazSpinner-BDda3YzZ.mjs} +1 -1
- package/components/chunks/{MazSpinner-CxyUHAvm.mjs → MazSpinner-C2-JMhVh.mjs} +1 -1
- package/components/chunks/MazSpinner-CS1_l-tv.mjs +34 -0
- package/components/chunks/{MazSpinner-ZPQe8ON_.mjs → MazSpinner-CbQ43lMx.mjs} +1 -1
- package/components/chunks/{MazSpinner-9M_EGMpy.mjs → MazSpinner-Cp_nPioh.mjs} +1 -1
- package/components/chunks/MazSpinner-CwmaAuL1.mjs +34 -0
- package/components/chunks/{MazSpinner-CDx6lo7l.mjs → MazSpinner-Dfj-lu-U.mjs} +1 -1
- package/components/chunks/MazSpinner-DqD51Fb6.mjs +34 -0
- package/components/chunks/{MazSpinner-C30YfScc.mjs → MazSpinner-DudoF-cG.mjs} +1 -1
- package/components/chunks/MazSpinner-DzFcVNs_.mjs +34 -0
- package/components/chunks/{MazSpinner-C_GueolV.mjs → MazSpinner-mtv0dluJ.mjs} +1 -1
- package/components/chunks/MazSpinner-wQasUhyI.mjs +34 -0
- package/components/chunks/{MazTable-Ci8nhgOP.mjs → MazTable-C0rcyl2r.mjs} +1 -1
- package/components/chunks/{MazTableCell-BIganK6X.mjs → MazTableCell-BhTwC2iX.mjs} +1 -1
- package/components/chunks/{MazTableRow-CIO-x6Lb.mjs → MazTableRow-BY_2wH3h.mjs} +1 -1
- package/components/chunks/{MazTableTitle-OEgTPQB3.mjs → MazTableTitle-DM_f1xmU.mjs} +1 -1
- package/components/chunks/{MazTabsBar-CT35SCIK.mjs → MazTabsBar--Xq_cpuz.mjs} +3 -3
- package/components/chunks/{MazTransitionExpand-Bcwdl9g2.mjs → MazTransitionExpand-Cedz9Ree.mjs} +1 -1
- package/components/chunks/useInstanceUniqId-BkOfxhk8.mjs +10 -0
- package/modules/assets/index.css +1 -1
- package/modules/chunks/{MazBtn-0CRjeBvn.mjs → MazBtn-5kChLyut.mjs} +2 -2
- package/modules/chunks/{MazBtn-DRqCRJD-.cjs → MazBtn-DDy5YiXc.cjs} +1 -1
- package/modules/chunks/{MazIcon-CeT6HK_q.mjs → MazIcon-COgM-qpZ.mjs} +1 -1
- package/modules/chunks/{MazIcon-D-Gna0vz.cjs → MazIcon-CQFeylgS.cjs} +1 -1
- package/modules/chunks/{MazSpinner-DV--lwdI.mjs → MazSpinner-bBkHNQ_l.mjs} +1 -1
- package/modules/chunks/{MazSpinner-DersvZQw.cjs → MazSpinner-y2YtVsZV.cjs} +1 -1
- package/modules/chunks/index-BsSNJt-B.cjs +124 -0
- package/modules/chunks/{index-Kry9j5uD.mjs → index-Bxs7y8eO.mjs} +12 -13
- package/modules/index.cjs +1 -1
- package/modules/index.mjs +1 -1
- package/nuxt/index.json +1 -1
- package/package.json +3 -3
- package/types/components/MazPhoneNumberInput/CountrySelector.vue.d.ts +2 -2
- package/types/components/MazPhoneNumberInput/PhoneInput.vue.d.ts +3 -3
- package/types/components/MazPhoneNumberInput/types.d.ts +1 -1
- package/types/components/MazPhoneNumberInput/use-libphonenumber.d.ts +4 -4
- package/types/components/MazPhoneNumberInput/use-maz-phone-number-input.d.ts +1 -1
- package/types/components/MazPhoneNumberInput.vue.d.ts +65 -24
- package/components/chunks/MazBtn-Ck84sP9a.mjs +0 -103
- package/components/chunks/MazBtn-DzwuLea3.mjs +0 -103
- package/components/chunks/MazBtn-tOUtVpek.mjs +0 -103
- package/components/chunks/MazIcon-BX2Gbz8R.mjs +0 -4
- package/components/chunks/MazSpinner-C5mnD76l.mjs +0 -34
- package/components/chunks/MazSpinner-Cgg2dkzQ.mjs +0 -34
- package/components/chunks/MazSpinner-CkKIUYXO.mjs +0 -34
- package/components/chunks/MazSpinner-DROgQW2M.mjs +0 -34
- package/components/chunks/MazSpinner-Dzs2W0kq.mjs +0 -34
- package/components/chunks/MazSpinner-NCtEpFMm.mjs +0 -34
- package/components/chunks/useInstanceUniqId-DW9jO1Sz.mjs +0 -11
- package/modules/chunks/index-DvromXrX.cjs +0 -124
package/components/chunks/{MazPhoneNumberInput-B5Up8CqL.mjs → MazPhoneNumberInput-Brc7mthM.mjs}
RENAMED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import '../assets/MazPhoneNumberInput.css';var
|
|
2
|
-
var
|
|
3
|
-
var _ = (a, o, e) =>
|
|
4
|
-
import {
|
|
5
|
-
import { getCountries as
|
|
1
|
+
import '../assets/MazPhoneNumberInput.css';var Je = Object.defineProperty;
|
|
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 _ = (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 M, normalizeStyle as ee, Fragment as be, renderList as Be, createElementVNode as Y, mergeProps as te, createVNode as H, unref as k, createCommentVNode as E, renderSlot as N, ref as L, onMounted as Ie, useSlots as _e, toDisplayString as oe, createBlock as U, resolveDynamicComponent as ke, toHandlers as eo, vModelDynamic as oo, createTextVNode as to, withModifiers as se, withCtx as G, onBeforeMount as Oe, nextTick as ue, Transition as lo, mergeModels as Pe, useModel as ao, provide as so, watch as he } from "vue";
|
|
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,
|
|
8
8
|
providedId: o
|
|
9
9
|
}) {
|
|
10
|
-
|
|
11
|
-
return h(() => o ?? `${a}-${e}`);
|
|
10
|
+
return h(() => o ?? `${a}-${Xe().replace(/:/g, "")}`);
|
|
12
11
|
}
|
|
13
12
|
function Le(a, o = "20x15") {
|
|
14
13
|
return `https://flagcdn.com/${o}/${a.toLowerCase()}.png`;
|
|
15
14
|
}
|
|
16
|
-
function
|
|
17
|
-
const e =
|
|
15
|
+
function Te(a, o) {
|
|
16
|
+
const e = xe(a, o);
|
|
18
17
|
if (!e)
|
|
19
18
|
throw new TypeError(`[maz-ui](injectStrict) Could not resolve ${a.toString()}`);
|
|
20
19
|
return e;
|
|
@@ -225,7 +224,7 @@ const ho = {
|
|
|
225
224
|
},
|
|
226
225
|
emits: ["intersecting", "loading", "loaded", "error"],
|
|
227
226
|
setup(a) {
|
|
228
|
-
const o = a, e = q(() => import("./MazSpinner-
|
|
227
|
+
const o = a, e = q(() => import("./MazSpinner-4ja9Gafa.mjs")), t = h(() => o.image || o.src), r = h(() => {
|
|
229
228
|
var u;
|
|
230
229
|
return typeof t.value == "string" ? [{ srcset: t.value }] : (u = t.value) == null ? void 0 : u.sources;
|
|
231
230
|
});
|
|
@@ -247,7 +246,7 @@ const ho = {
|
|
|
247
246
|
128
|
|
248
247
|
/* KEYED_FRAGMENT */
|
|
249
248
|
)),
|
|
250
|
-
|
|
249
|
+
Y("img", te(u.$attrs, {
|
|
251
250
|
src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
|
|
252
251
|
loading: "lazy",
|
|
253
252
|
alt: u.alt,
|
|
@@ -362,19 +361,19 @@ function zo(a, o) {
|
|
|
362
361
|
}
|
|
363
362
|
return r[e][t];
|
|
364
363
|
}
|
|
365
|
-
function
|
|
364
|
+
function Fe(a, o) {
|
|
366
365
|
const e = zo(a, o), t = Math.max(a.length, o.length);
|
|
367
366
|
return 1 - e / t;
|
|
368
367
|
}
|
|
369
368
|
function Io(a, o, e = 0.75) {
|
|
370
|
-
return
|
|
369
|
+
return Fe(a, o) >= e;
|
|
371
370
|
}
|
|
372
371
|
function ve(a, o, e = 0.75) {
|
|
373
372
|
const t = h(
|
|
374
373
|
() => me(typeof a == "string" ? a : a.value)
|
|
375
374
|
), r = h(
|
|
376
375
|
() => me(typeof o == "string" ? o : o.value)
|
|
377
|
-
), u = h(() => typeof e == "number" ? e : e.value), v = h(() =>
|
|
376
|
+
), u = h(() => typeof e == "number" ? e : e.value), v = h(() => Fe(t.value, r.value));
|
|
378
377
|
return {
|
|
379
378
|
isMatching: h(
|
|
380
379
|
() => Io(t.value, r.value, u.value)
|
|
@@ -382,7 +381,7 @@ function ve(a, o, e = 0.75) {
|
|
|
382
381
|
score: v
|
|
383
382
|
};
|
|
384
383
|
}
|
|
385
|
-
function
|
|
384
|
+
function Ne(a, o, e) {
|
|
386
385
|
var v;
|
|
387
386
|
a.stopPropagation();
|
|
388
387
|
const t = typeof e.value == "function" ? e.value : e.value.handler, r = typeof e.value == "object" ? e.value.exclude : void 0;
|
|
@@ -396,20 +395,20 @@ function Fe(a, o, e) {
|
|
|
396
395
|
}
|
|
397
396
|
!o.contains(a.target) && !u && (t == null || t());
|
|
398
397
|
}
|
|
399
|
-
function
|
|
398
|
+
function Ke() {
|
|
400
399
|
return document.ontouchstart === null ? "touchstart" : "click";
|
|
401
400
|
}
|
|
402
401
|
function Ao(a, o) {
|
|
403
|
-
const e =
|
|
404
|
-
document.removeEventListener(e, (t) =>
|
|
402
|
+
const e = Ke();
|
|
403
|
+
document.removeEventListener(e, (t) => Ne(t, a, o));
|
|
405
404
|
}
|
|
406
405
|
function wo(a, o) {
|
|
407
406
|
if (typeof o.value != "function" && typeof o.value == "object" && typeof o.value.handler != "function") {
|
|
408
407
|
console.error("[maz-ui](vClosable) v-closable directive requires a handler function");
|
|
409
408
|
return;
|
|
410
409
|
}
|
|
411
|
-
const e =
|
|
412
|
-
document.addEventListener(e, (t) =>
|
|
410
|
+
const e = Ke();
|
|
411
|
+
document.addEventListener(e, (t) => Ne(t, a, o));
|
|
413
412
|
}
|
|
414
413
|
const So = {
|
|
415
414
|
mounted: wo,
|
|
@@ -473,13 +472,13 @@ const Po = ["for"], Lo = {
|
|
|
473
472
|
},
|
|
474
473
|
emits: ["update:model-value", "focus", "blur", "click", "change", "input"],
|
|
475
474
|
setup(a, { emit: o }) {
|
|
476
|
-
const e = a, t = o, r = q(() => import("./MazBtn-
|
|
475
|
+
const e = a, t = o, r = q(() => import("./MazBtn-LssGZPPh.mjs")), u = q(() => import("./MazIcon-Y4qVlKF1.mjs")), v = q(() => import("./eye-slash-BoO00xzs.mjs")), p = q(() => import("./eye-f8zAUc30.mjs")), O = q(() => import("./check-C9Q_W85g.mjs")), $ = L(!1), g = L(!1), A = L(), i = Ae({
|
|
477
476
|
componentName: "MazInput",
|
|
478
477
|
providedId: e.id
|
|
479
478
|
});
|
|
480
479
|
Ie(() => {
|
|
481
480
|
var s;
|
|
482
|
-
e.autoFocus && ((s =
|
|
481
|
+
e.autoFocus && ((s = A.value) == null || s.focus());
|
|
483
482
|
});
|
|
484
483
|
const f = h(() => e.type === "password"), z = h(() => $.value ? "text" : e.type), w = h(() => {
|
|
485
484
|
if (!e.noBorder) {
|
|
@@ -509,10 +508,10 @@ const Po = ["for"], Lo = {
|
|
|
509
508
|
}
|
|
510
509
|
return "--default-border";
|
|
511
510
|
}
|
|
512
|
-
}), D =
|
|
513
|
-
const { required: s, placeholder:
|
|
514
|
-
if (
|
|
515
|
-
return s ? `${
|
|
511
|
+
}), D = _e(), j = h(() => {
|
|
512
|
+
const { required: s, placeholder: F } = e;
|
|
513
|
+
if (F)
|
|
514
|
+
return s ? `${F} *` : F;
|
|
516
515
|
}), J = h(() => C.value !== void 0 && C.value !== ""), b = Vo(
|
|
517
516
|
(s) => {
|
|
518
517
|
t("update:model-value", s);
|
|
@@ -531,13 +530,13 @@ const Po = ["for"], Lo = {
|
|
|
531
530
|
function n() {
|
|
532
531
|
return !!D["right-icon"] || f.value || !!D["valid-button"] || e.validButton || !!e.rightIcon;
|
|
533
532
|
}
|
|
534
|
-
function
|
|
533
|
+
function V() {
|
|
535
534
|
return !!D["left-icon"] || !!e.leftIcon;
|
|
536
535
|
}
|
|
537
536
|
function K(s) {
|
|
538
537
|
t("focus", s), g.value = !0;
|
|
539
538
|
}
|
|
540
|
-
function
|
|
539
|
+
function T(s) {
|
|
541
540
|
t("blur", s), g.value = !1;
|
|
542
541
|
}
|
|
543
542
|
function le(s) {
|
|
@@ -546,7 +545,7 @@ const Po = ["for"], Lo = {
|
|
|
546
545
|
function X(s) {
|
|
547
546
|
return t("input", s);
|
|
548
547
|
}
|
|
549
|
-
return (s,
|
|
548
|
+
return (s, F) => (y(), P(
|
|
550
549
|
"div",
|
|
551
550
|
{
|
|
552
551
|
class: M(["m-input", [
|
|
@@ -571,7 +570,7 @@ const Po = ["for"], Lo = {
|
|
|
571
570
|
for: k(i),
|
|
572
571
|
class: "m-input-top-label"
|
|
573
572
|
}, oe(s.topLabel), 9, Po)) : E("v-if", !0),
|
|
574
|
-
|
|
573
|
+
Y(
|
|
575
574
|
"div",
|
|
576
575
|
{
|
|
577
576
|
class: M(["m-input-wrapper", [
|
|
@@ -582,7 +581,7 @@ const Po = ["for"], Lo = {
|
|
|
582
581
|
]])
|
|
583
582
|
},
|
|
584
583
|
[
|
|
585
|
-
|
|
584
|
+
V() ? (y(), P("div", Lo, [
|
|
586
585
|
s.$slots["left-icon"] || s.leftIcon ? N(s.$slots, "left-icon", { key: 0 }, () => [
|
|
587
586
|
typeof s.leftIcon == "string" ? (y(), U(k(u), {
|
|
588
587
|
key: 0,
|
|
@@ -594,36 +593,36 @@ const Po = ["for"], Lo = {
|
|
|
594
593
|
})) : E("v-if", !0)
|
|
595
594
|
], !0) : E("v-if", !0)
|
|
596
595
|
])) : E("v-if", !0),
|
|
597
|
-
|
|
596
|
+
Y(
|
|
598
597
|
"div",
|
|
599
598
|
{
|
|
600
599
|
class: M(["m-input-wrapper-input", [`--${s.size}`, { "--top-label": !!s.topLabel }]])
|
|
601
600
|
},
|
|
602
601
|
[
|
|
603
|
-
ze(
|
|
602
|
+
ze(Y("input", te({
|
|
604
603
|
id: k(i),
|
|
605
604
|
ref_key: "input",
|
|
606
|
-
ref:
|
|
607
|
-
"onUpdate:modelValue":
|
|
605
|
+
ref: A,
|
|
606
|
+
"onUpdate:modelValue": F[0] || (F[0] = (x) => C.value = x),
|
|
608
607
|
type: z.value,
|
|
609
608
|
name: s.name
|
|
610
609
|
}, s.$attrs, {
|
|
611
610
|
inputmode: s.inputmode,
|
|
612
|
-
placeholder:
|
|
611
|
+
placeholder: j.value,
|
|
613
612
|
"aria-label": s.label || s.placeholder,
|
|
614
613
|
disabled: s.disabled,
|
|
615
614
|
readonly: s.readonly,
|
|
616
615
|
required: s.required,
|
|
617
616
|
class: "m-input-input"
|
|
618
|
-
},
|
|
619
|
-
blur:
|
|
617
|
+
}, eo({
|
|
618
|
+
blur: T,
|
|
620
619
|
focus: K,
|
|
621
620
|
change: le,
|
|
622
621
|
input: X
|
|
623
622
|
}, !0), {
|
|
624
|
-
onClick:
|
|
623
|
+
onClick: F[1] || (F[1] = (x) => s.$emit("click", x))
|
|
625
624
|
}), null, 16, Eo), [
|
|
626
|
-
[
|
|
625
|
+
[oo, C.value]
|
|
627
626
|
]),
|
|
628
627
|
s.label || s.hint ? (y(), P(
|
|
629
628
|
"span",
|
|
@@ -638,7 +637,7 @@ const Po = ["for"], Lo = {
|
|
|
638
637
|
]])
|
|
639
638
|
},
|
|
640
639
|
[
|
|
641
|
-
|
|
640
|
+
to(
|
|
642
641
|
oe(s.hint || s.label) + " ",
|
|
643
642
|
1
|
|
644
643
|
/* TEXT */
|
|
@@ -668,7 +667,7 @@ const Po = ["for"], Lo = {
|
|
|
668
667
|
color: "transparent",
|
|
669
668
|
tabindex: "-1",
|
|
670
669
|
size: "mini",
|
|
671
|
-
onClick:
|
|
670
|
+
onClick: F[2] || (F[2] = se((x) => $.value = !$.value, ["stop"]))
|
|
672
671
|
}, {
|
|
673
672
|
default: G(() => [
|
|
674
673
|
$.value ? (y(), U(k(v), {
|
|
@@ -763,26 +762,26 @@ const Po = ["for"], Lo = {
|
|
|
763
762
|
},
|
|
764
763
|
emits: ["close", "open", "blur", "focus", "change", "input", "update:model-value", "selected-option"],
|
|
765
764
|
setup(a, { expose: o, emit: e }) {
|
|
766
|
-
const t = a, r = e, u = q(() => import("./MazCheckbox-
|
|
765
|
+
const t = a, r = e, u = q(() => import("./MazCheckbox-D2fkthdh.mjs")), v = q(() => import("./magnifying-glass--nBiyXot.mjs")), p = q(() => import("./chevron-down-BkvtON3b.mjs")), O = q(() => import("./no-symbol-CIgKzsrB.mjs"));
|
|
767
766
|
o({
|
|
768
767
|
/** Method to open the option list */
|
|
769
768
|
openList: ie,
|
|
770
769
|
/** Method to close the option list */
|
|
771
770
|
closeList: ae
|
|
772
771
|
});
|
|
773
|
-
const $ = L(!1), g = L(),
|
|
772
|
+
const $ = L(!1), g = L(), A = h(
|
|
774
773
|
() => ["black", "transparent", "white"].includes(t.color)
|
|
775
774
|
), i = h(
|
|
776
|
-
() =>
|
|
775
|
+
() => A.value ? "var(--maz-color-black)" : `var(--maz-color-${t.color}-800)`
|
|
777
776
|
), f = h(
|
|
778
|
-
() =>
|
|
777
|
+
() => A.value ? "var(--maz-color-muted)" : `var(--maz-color-${t.color}-100)`
|
|
779
778
|
), z = h(
|
|
780
|
-
() =>
|
|
779
|
+
() => A.value ? "var(--maz-color-muted)" : `var(--maz-color-${t.color}-200)`
|
|
781
780
|
), w = h(() => $.value || t.open), D = Ae({
|
|
782
781
|
componentName: "MazSelect",
|
|
783
782
|
providedId: t.id
|
|
784
783
|
});
|
|
785
|
-
function
|
|
784
|
+
function j(l) {
|
|
786
785
|
return {
|
|
787
786
|
[t.optionValueKey]: l,
|
|
788
787
|
[t.optionLabelKey]: l,
|
|
@@ -803,34 +802,34 @@ const Po = ["for"], Lo = {
|
|
|
803
802
|
if (!((d = t.options) != null && d.length))
|
|
804
803
|
return [];
|
|
805
804
|
for (const m of t.options)
|
|
806
|
-
typeof m == "string" || typeof m == "number" || typeof m == "boolean" ? l.push(
|
|
805
|
+
typeof m == "string" || typeof m == "number" || typeof m == "boolean" ? l.push(j(m)) : typeof m == "object" && "options" in m && Array.isArray(m.options) ? l.push(
|
|
807
806
|
{ label: m.label, isOptGroup: !0 },
|
|
808
807
|
...m.options.map(
|
|
809
|
-
(c) => typeof c == "string" || typeof c == "number" || typeof c == "boolean" ?
|
|
808
|
+
(c) => typeof c == "string" || typeof c == "number" || typeof c == "boolean" ? j(c) : J(c)
|
|
810
809
|
)
|
|
811
810
|
) : l.push(J(m));
|
|
812
811
|
return l;
|
|
813
812
|
}), S = h(
|
|
814
813
|
() => {
|
|
815
814
|
var l;
|
|
816
|
-
return ((l = b.value) == null ? void 0 : l.filter((d) => t.multiple ? Array.isArray(t.modelValue) ? t.modelValue.includes(d[t.optionValueKey]) && !
|
|
815
|
+
return ((l = b.value) == null ? void 0 : l.filter((d) => t.multiple ? Array.isArray(t.modelValue) ? t.modelValue.includes(d[t.optionValueKey]) && !V(d[t.optionValueKey]) : !1 : t.modelValue === d[t.optionValueKey] && !V(d[t.optionValueKey]))) ?? [];
|
|
817
816
|
}
|
|
818
817
|
);
|
|
819
|
-
|
|
818
|
+
Oe(() => {
|
|
820
819
|
var l;
|
|
821
820
|
(l = t.options) != null && l.length || console.warn("[maz-ui](MazSelect) you must provide options"), fe();
|
|
822
821
|
});
|
|
823
822
|
const C = L(), W = L(), Z = L(), n = L();
|
|
824
|
-
function
|
|
823
|
+
function V(l) {
|
|
825
824
|
return l == null;
|
|
826
825
|
}
|
|
827
826
|
function K(l) {
|
|
828
827
|
var m;
|
|
829
828
|
return (((m = S.value) == null ? void 0 : m.some(
|
|
830
829
|
(c) => c[t.optionValueKey] === l[t.optionValueKey]
|
|
831
|
-
)) ?? !1) && !
|
|
830
|
+
)) ?? !1) && !V(l[t.optionValueKey]);
|
|
832
831
|
}
|
|
833
|
-
const
|
|
832
|
+
const T = h(() => {
|
|
834
833
|
var d;
|
|
835
834
|
if (t.multiple && t.modelValue && Array.isArray(t.modelValue))
|
|
836
835
|
return t.modelValue.map(
|
|
@@ -842,18 +841,18 @@ const Po = ["for"], Lo = {
|
|
|
842
841
|
const l = (d = b.value) == null ? void 0 : d.find(
|
|
843
842
|
(m) => m[t.optionValueKey] === t.modelValue
|
|
844
843
|
);
|
|
845
|
-
return
|
|
844
|
+
return V(t.modelValue) || l == null ? void 0 : l[t.optionInputValueKey];
|
|
846
845
|
}), le = h(
|
|
847
846
|
() => t.listPosition.includes("bottom") ? "maz-slide" : "maz-slideinvert"
|
|
848
847
|
), X = L(""), s = L("");
|
|
849
|
-
function
|
|
848
|
+
function F(l, d) {
|
|
850
849
|
return d && l && me(l).includes(me(d));
|
|
851
850
|
}
|
|
852
851
|
function x(l) {
|
|
853
852
|
var d;
|
|
854
853
|
return l ? (d = b.value) == null ? void 0 : d.filter((m) => {
|
|
855
854
|
const c = m[t.optionLabelKey], I = m[t.optionValueKey], B = m[t.optionInputValueKey], R = t.searchThreshold;
|
|
856
|
-
return
|
|
855
|
+
return F(c, l) || F(B, l) || F(I, l) || typeof c == "string" && ve(c, l, R).isMatching.value || typeof B == "string" && ve(B, l, R).isMatching.value || typeof I == "string" && ve(I, l, R).isMatching.value;
|
|
857
856
|
}) : b.value;
|
|
858
857
|
}
|
|
859
858
|
const Q = h(() => x(X.value));
|
|
@@ -875,14 +874,14 @@ const Po = ["for"], Lo = {
|
|
|
875
874
|
var l, d;
|
|
876
875
|
(d = ((l = W.value) == null ? void 0 : l.$el).querySelector("input")) == null || d.focus();
|
|
877
876
|
}
|
|
878
|
-
function
|
|
877
|
+
function Re() {
|
|
879
878
|
var l, d;
|
|
880
879
|
(d = ((l = W.value) == null ? void 0 : l.$el).querySelector("input")) == null || d.dispatchEvent(new Event("input"));
|
|
881
880
|
}
|
|
882
|
-
function
|
|
881
|
+
function qe(l) {
|
|
883
882
|
$.value ? ae(l) : we();
|
|
884
883
|
}
|
|
885
|
-
function
|
|
884
|
+
function Ye(l) {
|
|
886
885
|
var d, m;
|
|
887
886
|
X.value = l, (m = ((d = Z.value) == null ? void 0 : d.$el).querySelector("input")) == null || m.focus();
|
|
888
887
|
}
|
|
@@ -896,15 +895,15 @@ const Po = ["for"], Lo = {
|
|
|
896
895
|
s.value = "";
|
|
897
896
|
}, 1e3);
|
|
898
897
|
}
|
|
899
|
-
function
|
|
898
|
+
function We(l) {
|
|
900
899
|
const d = l.key;
|
|
901
|
-
/^[\dA-Za-z\u0400-\u04FF]$/.test(d) ? (l.preventDefault(), ie(l), t.search ?
|
|
900
|
+
/^[\dA-Za-z\u0400-\u04FF]$/.test(d) ? (l.preventDefault(), ie(l), t.search ? Ye(d) : je(d)) : Se(l);
|
|
902
901
|
}
|
|
903
902
|
function Se(l, d = !0) {
|
|
904
903
|
const m = l.code, c = ["ArrowUp", "ArrowDown"].includes(m), I = (d ? ["Enter", "Space"] : ["Enter"]).includes(m), B = m === "Escape" && w.value;
|
|
905
|
-
c ?
|
|
904
|
+
c ? Qe(l, g.value) : I ? Ge(l, g.value) : B && ae(l);
|
|
906
905
|
}
|
|
907
|
-
function
|
|
906
|
+
function Qe(l, d) {
|
|
908
907
|
var I;
|
|
909
908
|
l.preventDefault();
|
|
910
909
|
const m = l.code;
|
|
@@ -912,13 +911,13 @@ const Po = ["for"], Lo = {
|
|
|
912
911
|
const c = (I = Q.value) == null ? void 0 : I.length;
|
|
913
912
|
c && (typeof d == "number" ? d === c - 1 && m === "ArrowDown" ? g.value = 0 : d === 0 && m === "ArrowUp" ? g.value = c - 1 : g.value = m === "ArrowDown" ? d + 1 : d - 1 : g.value = m === "ArrowDown" ? 0 : c - 1, pe(g.value));
|
|
914
913
|
}
|
|
915
|
-
function
|
|
914
|
+
function Ge(l, d) {
|
|
916
915
|
var c, I, B;
|
|
917
916
|
if (!w.value)
|
|
918
917
|
return;
|
|
919
918
|
l.preventDefault();
|
|
920
919
|
const m = d ? ((c = Q.value) == null ? void 0 : c[d]) ?? ((I = Q.value) == null ? void 0 : I[0]) : (B = Q.value) == null ? void 0 : B[0];
|
|
921
|
-
|
|
920
|
+
V(m) || Ve(m);
|
|
922
921
|
}
|
|
923
922
|
async function pe(l) {
|
|
924
923
|
var m, c;
|
|
@@ -952,7 +951,7 @@ const Po = ["for"], Lo = {
|
|
|
952
951
|
(R) => R[t.optionValueKey] !== l[t.optionValueKey]
|
|
953
952
|
) : t.multiple ? c.push(l) : c = [l];
|
|
954
953
|
const I = c.map((R) => R[t.optionValueKey]);
|
|
955
|
-
r("update:model-value", t.multiple ? I : I[0]), r("selected-option", l),
|
|
954
|
+
r("update:model-value", t.multiple ? I : I[0]), r("selected-option", l), Re(), fe(l), we();
|
|
956
955
|
}
|
|
957
956
|
return (l, d) => {
|
|
958
957
|
var m;
|
|
@@ -978,7 +977,7 @@ const Po = ["for"], Lo = {
|
|
|
978
977
|
required: l.required,
|
|
979
978
|
"border-active": $.value,
|
|
980
979
|
color: l.color,
|
|
981
|
-
"model-value":
|
|
980
|
+
"model-value": T.value,
|
|
982
981
|
size: l.size,
|
|
983
982
|
block: "",
|
|
984
983
|
autocomplete: l.autocomplete,
|
|
@@ -988,15 +987,15 @@ const Po = ["for"], Lo = {
|
|
|
988
987
|
onClick: se(ie, ["prevent", "stop"]),
|
|
989
988
|
onChange: d[0] || (d[0] = (c) => r("change", c)),
|
|
990
989
|
onInput: d[1] || (d[1] = (c) => r("input", c)),
|
|
991
|
-
onKeydown:
|
|
990
|
+
onKeydown: We
|
|
992
991
|
}), {
|
|
993
992
|
"right-icon": G(() => [
|
|
994
|
-
|
|
993
|
+
Y("button", {
|
|
995
994
|
tabindex: "-1",
|
|
996
995
|
type: "button",
|
|
997
996
|
class: "m-select-input__toggle-button maz-custom",
|
|
998
997
|
"aria-label": `${w.value ? "collapse" : "expand"} list of options`,
|
|
999
|
-
onClick: se(
|
|
998
|
+
onClick: se(qe, ["stop"])
|
|
1000
999
|
}, [
|
|
1001
1000
|
H(k(p), { class: "m-select-chevron maz-text-xl" })
|
|
1002
1001
|
], 8, Mo)
|
|
@@ -1047,7 +1046,7 @@ const Po = ["for"], Lo = {
|
|
|
1047
1046
|
onKeydown: d[3] || (d[3] = (c) => Se(c, !1))
|
|
1048
1047
|
}, null, 8, ["modelValue", "color", "placeholder", "left-icon"])) : E("v-if", !0),
|
|
1049
1048
|
!Q.value || Q.value.length <= 0 ? N(l.$slots, "no-results", { key: 1 }, () => [
|
|
1050
|
-
|
|
1049
|
+
Y("span", To, [
|
|
1051
1050
|
H(k(O), { class: "maz-h-6 maz-w-6 maz-text-normal" })
|
|
1052
1051
|
])
|
|
1053
1052
|
], !0) : (y(), P("div", Fo, [
|
|
@@ -1062,7 +1061,7 @@ const Po = ["for"], Lo = {
|
|
|
1062
1061
|
key: 0,
|
|
1063
1062
|
label: c.label
|
|
1064
1063
|
}, () => [
|
|
1065
|
-
|
|
1064
|
+
Y(
|
|
1066
1065
|
"span",
|
|
1067
1066
|
No,
|
|
1068
1067
|
oe(c.label),
|
|
@@ -1077,7 +1076,7 @@ const Po = ["for"], Lo = {
|
|
|
1077
1076
|
{
|
|
1078
1077
|
"--is-keyboard-selected": g.value === I,
|
|
1079
1078
|
"--is-selected": K(c),
|
|
1080
|
-
"--is-none-value":
|
|
1079
|
+
"--is-none-value": V(c[l.optionValueKey])
|
|
1081
1080
|
}
|
|
1082
1081
|
]]),
|
|
1083
1082
|
style: ee(l.itemHeight ? { height: `${l.itemHeight}px` } : void 0),
|
|
@@ -1094,7 +1093,7 @@ const Po = ["for"], Lo = {
|
|
|
1094
1093
|
option: c,
|
|
1095
1094
|
isSelected: K(c)
|
|
1096
1095
|
}, () => [
|
|
1097
|
-
|
|
1096
|
+
Y(
|
|
1098
1097
|
"span",
|
|
1099
1098
|
null,
|
|
1100
1099
|
oe(c[l.optionLabelKey]),
|
|
@@ -1131,7 +1130,7 @@ const Po = ["for"], Lo = {
|
|
|
1131
1130
|
};
|
|
1132
1131
|
}
|
|
1133
1132
|
}), Ho = /* @__PURE__ */ re(Uo, [["__scopeId", "data-v-961aec79"]]);
|
|
1134
|
-
function
|
|
1133
|
+
function Ue() {
|
|
1135
1134
|
if (typeof window > "u")
|
|
1136
1135
|
return;
|
|
1137
1136
|
const a = window.navigator.language;
|
|
@@ -1149,8 +1148,8 @@ function Do(a, o, e) {
|
|
|
1149
1148
|
}
|
|
1150
1149
|
function Ro(a, o) {
|
|
1151
1150
|
var r;
|
|
1152
|
-
const e = [], t =
|
|
1153
|
-
a = a ?? ((r =
|
|
1151
|
+
const e = [], t = Me();
|
|
1152
|
+
a = a ?? ((r = Ue()) == null ? void 0 : r.browserLocale) ?? "en-US";
|
|
1154
1153
|
for (const u of t) {
|
|
1155
1154
|
const v = Do(a, u, o);
|
|
1156
1155
|
if (v)
|
|
@@ -1175,21 +1174,21 @@ async function qo() {
|
|
|
1175
1174
|
throw new Error(`[MazPhoneNumberInput](fetchCountryCode) ${a}`);
|
|
1176
1175
|
}
|
|
1177
1176
|
}
|
|
1178
|
-
function
|
|
1177
|
+
function Yo(a) {
|
|
1179
1178
|
if (!a)
|
|
1180
1179
|
return "";
|
|
1181
1180
|
const o = new RegExp(/[^\d ()+-]/g);
|
|
1182
1181
|
return a.replaceAll(o, "").trim();
|
|
1183
1182
|
}
|
|
1184
|
-
function
|
|
1183
|
+
function He() {
|
|
1185
1184
|
return {
|
|
1186
|
-
sanitizePhoneNumber:
|
|
1185
|
+
sanitizePhoneNumber: Yo,
|
|
1187
1186
|
fetchCountryCode: qo,
|
|
1188
|
-
getBrowserLocale:
|
|
1187
|
+
getBrowserLocale: Ue,
|
|
1189
1188
|
getCountriesList: Ro
|
|
1190
1189
|
};
|
|
1191
1190
|
}
|
|
1192
|
-
const
|
|
1191
|
+
const jo = ["id"], Wo = {
|
|
1193
1192
|
key: 0,
|
|
1194
1193
|
class: "m-country-selector__select__item__flag-container"
|
|
1195
1194
|
}, Qo = /* @__PURE__ */ ne({
|
|
@@ -1221,7 +1220,7 @@ const Yo = ["id"], Wo = {
|
|
|
1221
1220
|
},
|
|
1222
1221
|
emits: ["update:model-value"],
|
|
1223
1222
|
setup(a) {
|
|
1224
|
-
const o = a, { phoneNumber: e } =
|
|
1223
|
+
const o = a, { phoneNumber: e } = Te("data"), t = L(), { getCountriesList: r } = He(), u = h(() => r(o.countryLocale, o.customCountriesList)), v = h(
|
|
1225
1224
|
() => {
|
|
1226
1225
|
var i;
|
|
1227
1226
|
return (i = u.value) == null ? void 0 : i.filter((f) => {
|
|
@@ -1258,7 +1257,7 @@ const Yo = ["id"], Wo = {
|
|
|
1258
1257
|
).filter(co);
|
|
1259
1258
|
}
|
|
1260
1259
|
);
|
|
1261
|
-
|
|
1260
|
+
function A() {
|
|
1262
1261
|
var i, f;
|
|
1263
1262
|
(f = (i = t.value) == null ? void 0 : i.$el.querySelector("input")) == null || f.focus();
|
|
1264
1263
|
}
|
|
@@ -1277,7 +1276,7 @@ const Yo = ["id"], Wo = {
|
|
|
1277
1276
|
}]),
|
|
1278
1277
|
tabindex: "-1",
|
|
1279
1278
|
type: "button",
|
|
1280
|
-
onClick:
|
|
1279
|
+
onClick: A
|
|
1281
1280
|
}, [
|
|
1282
1281
|
N(i.$slots, "selector-flag", { countryCode: i.modelValue }, () => [
|
|
1283
1282
|
H(Ee, {
|
|
@@ -1288,7 +1287,7 @@ const Yo = ["id"], Wo = {
|
|
|
1288
1287
|
"img-class": "maz-w-5 maz-h-4 maz-rounded-sm"
|
|
1289
1288
|
}, null, 8, ["src", "alt"])
|
|
1290
1289
|
], !0)
|
|
1291
|
-
], 10,
|
|
1290
|
+
], 10, jo)) : E("v-if", !0),
|
|
1292
1291
|
H(Ho, te({
|
|
1293
1292
|
id: `country-selector-${i.id}`,
|
|
1294
1293
|
ref_key: "CountrySelectorRef",
|
|
@@ -1299,6 +1298,7 @@ const Yo = ["id"], Wo = {
|
|
|
1299
1298
|
"option-value-key": "iso2",
|
|
1300
1299
|
"option-label-key": "name",
|
|
1301
1300
|
"option-input-value-key": i.countrySelectorDisplayName ? "name" : "dialCode",
|
|
1301
|
+
name: "country",
|
|
1302
1302
|
"max-list-width": 250,
|
|
1303
1303
|
"min-list-width": 200,
|
|
1304
1304
|
disabled: i.disabled,
|
|
@@ -1324,7 +1324,7 @@ const Yo = ["id"], Wo = {
|
|
|
1324
1324
|
N(i.$slots, "no-results", {}, void 0, !0)
|
|
1325
1325
|
]),
|
|
1326
1326
|
default: G(({ option: z, isSelected: w }) => [
|
|
1327
|
-
|
|
1327
|
+
Y(
|
|
1328
1328
|
"div",
|
|
1329
1329
|
{
|
|
1330
1330
|
class: M(["m-country-selector__select__item", {
|
|
@@ -1357,7 +1357,7 @@ const Yo = ["id"], Wo = {
|
|
|
1357
1357
|
3
|
|
1358
1358
|
/* TEXT, CLASS */
|
|
1359
1359
|
)) : E("v-if", !0),
|
|
1360
|
-
|
|
1360
|
+
Y(
|
|
1361
1361
|
"span",
|
|
1362
1362
|
{
|
|
1363
1363
|
class: M(["maz-flex-1 maz-truncate", { "maz-font-semibold": w }])
|
|
@@ -1379,7 +1379,7 @@ const Yo = ["id"], Wo = {
|
|
|
1379
1379
|
/* CLASS, STYLE */
|
|
1380
1380
|
));
|
|
1381
1381
|
}
|
|
1382
|
-
}), Go = /* @__PURE__ */ re(Qo, [["__scopeId", "data-v-
|
|
1382
|
+
}), Go = /* @__PURE__ */ re(Qo, [["__scopeId", "data-v-5ab7f303"]]), Jo = {
|
|
1383
1383
|
countrySelector: {
|
|
1384
1384
|
placeholder: "Country code",
|
|
1385
1385
|
error: "Choose country",
|
|
@@ -1408,7 +1408,7 @@ function Xo({
|
|
|
1408
1408
|
isValid: !1,
|
|
1409
1409
|
countryCode: o
|
|
1410
1410
|
};
|
|
1411
|
-
const e = ro(a, o);
|
|
1411
|
+
const e = ro(a, o ?? void 0);
|
|
1412
1412
|
return {
|
|
1413
1413
|
countryCode: (e == null ? void 0 : e.country) ?? o,
|
|
1414
1414
|
isValid: (e == null ? void 0 : e.isValid()) ?? !1,
|
|
@@ -1427,37 +1427,37 @@ function Xo({
|
|
|
1427
1427
|
throw new Error(`[MazPhoneNumberInput](getResultsFromPhoneNumber) ${e}`);
|
|
1428
1428
|
}
|
|
1429
1429
|
}
|
|
1430
|
-
function xo(
|
|
1431
|
-
try {
|
|
1432
|
-
return o ? new io(a).input(o) : "";
|
|
1433
|
-
} catch (e) {
|
|
1434
|
-
throw new Error(`[MazPhoneNumberInput](getAsYouTypeFormat) ${e}`);
|
|
1435
|
-
}
|
|
1436
|
-
}
|
|
1437
|
-
async function _o() {
|
|
1430
|
+
async function xo() {
|
|
1438
1431
|
const { default: a } = await import("./examples.mobile.json-JpNGylGv.mjs");
|
|
1439
1432
|
return a;
|
|
1440
1433
|
}
|
|
1441
|
-
function
|
|
1434
|
+
function _o(a, o) {
|
|
1442
1435
|
var e;
|
|
1443
1436
|
try {
|
|
1444
|
-
return a && o ? (e =
|
|
1437
|
+
return a && o ? (e = io(o, a)) == null ? void 0 : e.formatNational() : void 0;
|
|
1445
1438
|
} catch (t) {
|
|
1446
1439
|
console.error(`[maz-ui](MazPhoneNumberInput) ${t}`);
|
|
1447
1440
|
}
|
|
1448
1441
|
}
|
|
1449
|
-
function
|
|
1442
|
+
function et(a, o) {
|
|
1443
|
+
try {
|
|
1444
|
+
return !o || !a ? void 0 : new uo(a).input(o);
|
|
1445
|
+
} catch (e) {
|
|
1446
|
+
throw new Error(`[MazPhoneNumberInput](getAsYouTypeFormat) ${e}`);
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
function De() {
|
|
1450
1450
|
function a(o, e) {
|
|
1451
1451
|
return ce(o) === ce(e);
|
|
1452
1452
|
}
|
|
1453
1453
|
return {
|
|
1454
|
-
getAsYouTypeFormat:
|
|
1454
|
+
getAsYouTypeFormat: et,
|
|
1455
1455
|
getPhoneNumberResults: Xo,
|
|
1456
|
-
getPhoneNumberExamplesFile:
|
|
1457
|
-
getPhoneNumberExample:
|
|
1456
|
+
getPhoneNumberExamplesFile: xo,
|
|
1457
|
+
getPhoneNumberExample: _o,
|
|
1458
1458
|
isSameCountryCallingCode: a,
|
|
1459
1459
|
isCountryAvailable: Zo,
|
|
1460
|
-
getCountries:
|
|
1460
|
+
getCountries: Me,
|
|
1461
1461
|
getCountryCallingCode: ce
|
|
1462
1462
|
};
|
|
1463
1463
|
}
|
|
@@ -1483,7 +1483,7 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1483
1483
|
}),
|
|
1484
1484
|
emits: /* @__PURE__ */ Pe(["update:model-value"], ["update:modelValue"]),
|
|
1485
1485
|
setup(a, { emit: o }) {
|
|
1486
|
-
const e = a, t = o, r = ao(a, "modelValue"), { getPhoneNumberExamplesFile: u, getPhoneNumberExample: v } =
|
|
1486
|
+
const e = a, t = o, r = ao(a, "modelValue"), { getPhoneNumberExamplesFile: u, getPhoneNumberExample: v } = De(), { selectionRange: p, results: O, selectedCountry: $ } = Te("data"), g = L(), A = L(!1);
|
|
1487
1487
|
function i(b, S) {
|
|
1488
1488
|
const C = v(b, S);
|
|
1489
1489
|
return C ? `${e.locales.phoneInput.example} ${C}` : void 0;
|
|
@@ -1513,7 +1513,7 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1513
1513
|
console.error("[maz-ui](MazPhoneNumberInput) while loading phone number examples file", b);
|
|
1514
1514
|
}
|
|
1515
1515
|
}
|
|
1516
|
-
async function
|
|
1516
|
+
async function j(b) {
|
|
1517
1517
|
w.value && b && J(w.value, b), await ue(), t("update:model-value", b);
|
|
1518
1518
|
}
|
|
1519
1519
|
function J(b, S) {
|
|
@@ -1537,15 +1537,15 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1537
1537
|
{
|
|
1538
1538
|
"--border-radius": b.hasRadius,
|
|
1539
1539
|
"--error": b.error || !k(O).isValid,
|
|
1540
|
-
"--focused":
|
|
1540
|
+
"--focused": A.value
|
|
1541
1541
|
}
|
|
1542
1542
|
]],
|
|
1543
|
-
onFocus: S[0] || (S[0] = (C) =>
|
|
1544
|
-
onBlur: S[1] || (S[1] = (C) =>
|
|
1545
|
-
"onUpdate:modelValue": S[2] || (S[2] = (C) =>
|
|
1543
|
+
onFocus: S[0] || (S[0] = (C) => A.value = !0),
|
|
1544
|
+
onBlur: S[1] || (S[1] = (C) => A.value = !1),
|
|
1545
|
+
"onUpdate:modelValue": S[2] || (S[2] = (C) => j(C))
|
|
1546
1546
|
}), null, 16, ["id", "model-value", "disabled", "color", "error", "size", "success", "class"]));
|
|
1547
1547
|
}
|
|
1548
|
-
}), tt = /* @__PURE__ */ re(ot, [["__scopeId", "data-v-
|
|
1548
|
+
}), tt = /* @__PURE__ */ re(ot, [["__scopeId", "data-v-044e8c19"]]), lt = /* @__PURE__ */ ne({
|
|
1549
1549
|
name: "MazPhoneNumberInput",
|
|
1550
1550
|
inheritAttrs: !1,
|
|
1551
1551
|
__name: "MazPhoneNumberInput",
|
|
@@ -1600,10 +1600,10 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1600
1600
|
},
|
|
1601
1601
|
emits: ["update:model-value", "country-code", "update:country-code", "update", "data"],
|
|
1602
1602
|
setup(a, { emit: o }) {
|
|
1603
|
-
const e = a, t = o, { fetchCountryCode: r, sanitizePhoneNumber: u, getBrowserLocale: v } =
|
|
1603
|
+
const e = a, t = o, { fetchCountryCode: r, sanitizePhoneNumber: u, getBrowserLocale: v } = He(), { isCountryAvailable: p, getPhoneNumberResults: O, getAsYouTypeFormat: $ } = De(), g = Ae({
|
|
1604
1604
|
componentName: "MazPhoneNumberInput",
|
|
1605
1605
|
providedId: e.id
|
|
1606
|
-
}),
|
|
1606
|
+
}), A = L(), i = L(), f = L({
|
|
1607
1607
|
isValid: !1,
|
|
1608
1608
|
countryCode: void 0
|
|
1609
1609
|
}), z = L(), w = L({
|
|
@@ -1613,7 +1613,7 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1613
1613
|
});
|
|
1614
1614
|
so("data", {
|
|
1615
1615
|
selectedCountry: i,
|
|
1616
|
-
phoneNumber:
|
|
1616
|
+
phoneNumber: A,
|
|
1617
1617
|
results: f,
|
|
1618
1618
|
selectionRange: w
|
|
1619
1619
|
});
|
|
@@ -1621,21 +1621,22 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1621
1621
|
...Jo,
|
|
1622
1622
|
...e.translations
|
|
1623
1623
|
}));
|
|
1624
|
-
|
|
1625
|
-
var n;
|
|
1624
|
+
Oe(async () => {
|
|
1626
1625
|
if (C(e.countryCode ?? e.defaultCountryCode), e.fetchCountry && !i.value) {
|
|
1627
|
-
const
|
|
1628
|
-
C(
|
|
1626
|
+
const n = await r();
|
|
1627
|
+
C(n);
|
|
1629
1628
|
}
|
|
1629
|
+
}), Ie(() => {
|
|
1630
|
+
var n;
|
|
1630
1631
|
if (!e.defaultCountryCode && !e.noUseBrowserLocale && !i.value) {
|
|
1631
|
-
const
|
|
1632
|
-
C(
|
|
1632
|
+
const V = (n = v()) == null ? void 0 : n.locale;
|
|
1633
|
+
C(V);
|
|
1633
1634
|
}
|
|
1634
1635
|
});
|
|
1635
|
-
const
|
|
1636
|
+
const j = L();
|
|
1636
1637
|
function J() {
|
|
1637
1638
|
var n;
|
|
1638
|
-
return (n =
|
|
1639
|
+
return (n = j.value) == null ? void 0 : n.$el.querySelector("input");
|
|
1639
1640
|
}
|
|
1640
1641
|
async function b() {
|
|
1641
1642
|
var n;
|
|
@@ -1657,16 +1658,17 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1657
1658
|
}
|
|
1658
1659
|
function W({
|
|
1659
1660
|
newPhoneNumber: n,
|
|
1660
|
-
updateResults:
|
|
1661
|
+
updateResults: V = !0
|
|
1661
1662
|
}) {
|
|
1662
1663
|
const K = u(n);
|
|
1663
|
-
if (
|
|
1664
|
+
if (V && (f.value = O({
|
|
1664
1665
|
phoneNumber: K,
|
|
1665
1666
|
countryCode: i.value
|
|
1666
1667
|
})), w.value.cursorAtEnd && !e.noFormattingAsYouType && e.autoFormat) {
|
|
1667
|
-
const
|
|
1668
|
-
z.value = $(i.value,
|
|
1669
|
-
}
|
|
1668
|
+
const T = f.value.isValid ? f.value.formatNational : K;
|
|
1669
|
+
z.value = $(i.value, T), A.value = z.value || T;
|
|
1670
|
+
} else
|
|
1671
|
+
A.value = e.modelValue || e.defaultPhoneNumber || K;
|
|
1670
1672
|
f.value.countryCode && f.value.countryCode !== i.value && Z({
|
|
1671
1673
|
countryCode: f.value.countryCode,
|
|
1672
1674
|
updateResults: !1
|
|
@@ -1674,24 +1676,24 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1674
1676
|
}
|
|
1675
1677
|
function Z({
|
|
1676
1678
|
countryCode: n,
|
|
1677
|
-
updateResults:
|
|
1679
|
+
updateResults: V = !0
|
|
1678
1680
|
}) {
|
|
1679
1681
|
if (!n) {
|
|
1680
1682
|
i.value = void 0;
|
|
1681
1683
|
return;
|
|
1682
1684
|
}
|
|
1683
|
-
n !== i.value && C(n),
|
|
1684
|
-
phoneNumber:
|
|
1685
|
+
n !== i.value && C(n), V && (f.value = O({
|
|
1686
|
+
phoneNumber: A.value,
|
|
1685
1687
|
countryCode: n
|
|
1686
1688
|
})), W({
|
|
1687
|
-
newPhoneNumber:
|
|
1689
|
+
newPhoneNumber: A.value,
|
|
1688
1690
|
updateResults: !1
|
|
1689
1691
|
});
|
|
1690
1692
|
}
|
|
1691
1693
|
return he(
|
|
1692
1694
|
() => e.modelValue ?? e.defaultPhoneNumber,
|
|
1693
|
-
(n,
|
|
1694
|
-
n !==
|
|
1695
|
+
(n, V) => {
|
|
1696
|
+
n !== V && n !== A.value && W({
|
|
1695
1697
|
newPhoneNumber: n
|
|
1696
1698
|
});
|
|
1697
1699
|
},
|
|
@@ -1700,8 +1702,8 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1700
1702
|
}
|
|
1701
1703
|
), he(
|
|
1702
1704
|
() => e.countryCode ?? e.defaultCountryCode,
|
|
1703
|
-
(n,
|
|
1704
|
-
n && n !==
|
|
1705
|
+
(n, V) => {
|
|
1706
|
+
n && n !== V && n !== i.value && Z({
|
|
1705
1707
|
countryCode: n
|
|
1706
1708
|
});
|
|
1707
1709
|
},
|
|
@@ -1711,12 +1713,12 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1711
1713
|
), he(
|
|
1712
1714
|
f,
|
|
1713
1715
|
(n) => {
|
|
1714
|
-
t("update", n), t("data", n), n.e164 && n.isValid ? t("update:model-value", n.e164) : t("update:model-value",
|
|
1716
|
+
t("update", n), t("data", n), n.e164 && n.isValid ? t("update:model-value", n.e164) : t("update:model-value", A.value), t("country-code", i.value), t("update:country-code", i.value);
|
|
1715
1717
|
},
|
|
1716
1718
|
{
|
|
1717
1719
|
immediate: !0
|
|
1718
1720
|
}
|
|
1719
|
-
), (n,
|
|
1721
|
+
), (n, V) => {
|
|
1720
1722
|
var K;
|
|
1721
1723
|
return y(), P(
|
|
1722
1724
|
"div",
|
|
@@ -1740,7 +1742,7 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1740
1742
|
"no-flags": n.noFlags,
|
|
1741
1743
|
"no-search": n.noSearch,
|
|
1742
1744
|
"exclude-selectors": n.excludeSelectors,
|
|
1743
|
-
error: n.error || (n.noValidationError ? !1 : !!
|
|
1745
|
+
error: n.error || (n.noValidationError ? !1 : !!A.value && !i.value),
|
|
1744
1746
|
success: n.success || (n.noValidationSuccess ? !1 : (K = f.value) == null ? void 0 : K.isValid),
|
|
1745
1747
|
locales: D.value,
|
|
1746
1748
|
disabled: n.disabled,
|
|
@@ -1754,14 +1756,14 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1754
1756
|
"no-results": G(() => [
|
|
1755
1757
|
N(n.$slots, "no-results", {}, void 0, !0)
|
|
1756
1758
|
]),
|
|
1757
|
-
"selector-flag": G(({ countryCode:
|
|
1758
|
-
N(n.$slots, "selector-flag", { countryCode:
|
|
1759
|
+
"selector-flag": G(({ countryCode: T }) => [
|
|
1760
|
+
N(n.$slots, "selector-flag", { countryCode: T }, void 0, !0)
|
|
1759
1761
|
]),
|
|
1760
|
-
"country-list-flag": G(({ isSelected:
|
|
1762
|
+
"country-list-flag": G(({ isSelected: T, option: le }) => [
|
|
1761
1763
|
N(n.$slots, "country-list-flag", {
|
|
1762
1764
|
countryCode: le.iso2,
|
|
1763
1765
|
option: le,
|
|
1764
|
-
isSelected:
|
|
1766
|
+
isSelected: T
|
|
1765
1767
|
}, void 0, !0)
|
|
1766
1768
|
]),
|
|
1767
1769
|
_: 3
|
|
@@ -1770,9 +1772,9 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1770
1772
|
H(tt, te({
|
|
1771
1773
|
id: k(g),
|
|
1772
1774
|
ref_key: "PhoneInputRef",
|
|
1773
|
-
ref:
|
|
1774
|
-
modelValue:
|
|
1775
|
-
"onUpdate:modelValue":
|
|
1775
|
+
ref: j,
|
|
1776
|
+
modelValue: A.value,
|
|
1777
|
+
"onUpdate:modelValue": V[0] || (V[0] = (T) => A.value = T)
|
|
1776
1778
|
}, { ...n.$attrs, ...n.phoneInputAttributes }, {
|
|
1777
1779
|
color: n.color,
|
|
1778
1780
|
size: n.size,
|
|
@@ -1781,14 +1783,14 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1781
1783
|
disabled: n.disabled,
|
|
1782
1784
|
"has-radius": !n.noCountrySelector,
|
|
1783
1785
|
success: n.success || (n.noValidationSuccess ? !1 : f.value.isValid),
|
|
1784
|
-
error: n.error || (n.noValidationError ? !1 : !!
|
|
1786
|
+
error: n.error || (n.noValidationError ? !1 : !!A.value && !f.value.isValid),
|
|
1785
1787
|
locales: D.value,
|
|
1786
1788
|
"no-formatting-as-you-type": n.noFormattingAsYouType,
|
|
1787
1789
|
"auto-format": n.autoFormat,
|
|
1788
1790
|
label: n.label,
|
|
1789
1791
|
placeholder: n.placeholder,
|
|
1790
|
-
"onUpdate:modelValue":
|
|
1791
|
-
newPhoneNumber:
|
|
1792
|
+
"onUpdate:modelValue": V[1] || (V[1] = (T) => W({
|
|
1793
|
+
newPhoneNumber: T
|
|
1792
1794
|
}))
|
|
1793
1795
|
}), null, 16, ["id", "modelValue", "color", "size", "no-example", "disabled", "has-radius", "success", "error", "locales", "no-formatting-as-you-type", "auto-format", "label", "placeholder"])
|
|
1794
1796
|
],
|
|
@@ -1797,10 +1799,10 @@ const ot = /* @__PURE__ */ ne({
|
|
|
1797
1799
|
);
|
|
1798
1800
|
};
|
|
1799
1801
|
}
|
|
1800
|
-
}), rt = /* @__PURE__ */ re(lt, [["__scopeId", "data-v-
|
|
1802
|
+
}), rt = /* @__PURE__ */ re(lt, [["__scopeId", "data-v-5b5bb57f"]]);
|
|
1801
1803
|
export {
|
|
1802
1804
|
rt as M,
|
|
1803
1805
|
re as _,
|
|
1804
|
-
|
|
1806
|
+
Te as i,
|
|
1805
1807
|
Ae as u
|
|
1806
1808
|
};
|