maz-ui 3.47.2-beta.0 → 3.47.2-beta.3
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 +36 -37
- package/components/MazAnimatedCounter.mjs +14 -16
- package/components/MazBottomSheet.mjs +1 -1
- package/components/MazBtn.mjs +1 -1
- package/components/MazCard.mjs +1 -1
- package/components/MazCarousel.mjs +1 -1
- package/components/MazChart.mjs +23 -32
- package/components/MazChecklist.mjs +1 -1
- package/components/MazCircularProgressBar.mjs +66 -71
- package/components/MazDialog.mjs +1 -1
- package/components/MazDialogPromise.mjs +1 -1
- package/components/MazDrawer.mjs +1 -1
- package/components/MazDropdown.mjs +162 -185
- package/components/MazExpandAnimation.mjs +20 -21
- package/components/MazGallery.mjs +1 -1
- package/components/MazInput.mjs +1 -1
- package/components/MazInputCode.mjs +30 -31
- package/components/MazInputNumber.mjs +1 -1
- package/components/MazInputPrice.mjs +1 -1
- package/components/MazInputTags.mjs +1 -1
- package/components/MazLink.mjs +18 -30
- package/components/MazPagination.mjs +1 -1
- package/components/MazPhoneNumberInput.mjs +1 -1
- package/components/MazPicker.mjs +1 -1
- package/components/MazRadio.mjs +37 -42
- package/components/MazRadioButtons.mjs +61 -66
- package/components/MazSelect.mjs +1 -1
- package/components/MazSlider.mjs +107 -116
- package/components/MazStepper.mjs +1 -1
- package/components/MazSwitch.mjs +24 -28
- package/components/MazTable.d.ts +6 -6
- package/components/MazTable.mjs +1 -1
- package/components/MazTabsBar.mjs +1 -1
- package/components/MazTextarea.mjs +32 -34
- package/components/assets/MazLink.css +1 -1
- package/components/assets/MazTable.css +1 -1
- package/components/chunks/{MazBadge-CvIiiTdM.mjs → MazBadge-CqppWg2j.mjs} +1 -1
- package/components/chunks/{MazBottomSheet-DqK0EOsq.mjs → MazBottomSheet-CGRvZmGd.mjs} +28 -29
- package/{modules/chunks/MazBtn-BSnVxud6.mjs → components/chunks/MazBtn-2VKM1wZu.mjs} +37 -49
- package/components/chunks/{MazBtn-DVkwISlp.mjs → MazBtn-40lm8-AL.mjs} +37 -49
- package/components/chunks/{MazBtn-DzBXfedt.mjs → MazBtn-BB1FyYWv.mjs} +35 -44
- package/components/chunks/{MazBtn-BO3G90L3.mjs → MazBtn-BMYXMZuX.mjs} +37 -49
- package/components/chunks/{MazBtn-DJOUeES7.mjs → MazBtn-BijEMn4r.mjs} +37 -49
- package/components/chunks/MazBtn-BmrcK2af.mjs +106 -0
- package/components/chunks/MazBtn-C72_1uvu.mjs +106 -0
- package/components/chunks/MazBtn-CWloP6MI.mjs +111 -0
- package/components/chunks/MazBtn-CcyV4DCc.mjs +106 -0
- package/components/chunks/MazBtn-DENEMy-c.mjs +106 -0
- package/components/chunks/MazBtn-DfqRZvbB.mjs +106 -0
- package/components/chunks/MazBtn-UnZQuu6P.mjs +106 -0
- package/components/chunks/MazBtn-cDJlUVVY.mjs +106 -0
- package/components/chunks/MazBtn-hUslV7wO.mjs +106 -0
- package/components/chunks/{MazCard-FSXmHyhj.mjs → MazCard-BYB8y1_u.mjs} +18 -19
- package/components/chunks/{MazCarousel-BEl86YGW.mjs → MazCarousel-DccWVW8H.mjs} +20 -21
- package/components/chunks/{MazCheckbox-2G4VkxDz.mjs → MazCheckbox-B22OcHt8.mjs} +1 -1
- package/components/chunks/{MazCheckbox-Cq9gpTEw.mjs → MazCheckbox-DMogZVHl.mjs} +1 -1
- package/components/chunks/{MazCheckbox-BmnqBHaY.mjs → MazCheckbox-Db6sPUbV.mjs} +1 -1
- package/components/chunks/{MazChecklist-CY1Cv70T.mjs → MazChecklist-C95Y4Hb-.mjs} +112 -118
- package/components/chunks/{MazDialog-CPgFpAlq.mjs → MazDialog-khofH-7I.mjs} +66 -81
- package/components/chunks/MazDialogPromise-ZRA2ZrO4.mjs +488 -0
- package/components/chunks/{MazExpandAnimation-Bkw_wFTi.mjs → MazExpandAnimation-MDimlZGj.mjs} +7 -8
- package/components/chunks/{MazGallery-BknvUeo1.mjs → MazGallery-CXQiXWFr.mjs} +32 -33
- package/components/chunks/{MazGallery-CZOokGAt.mjs → MazGallery-VTZUhBKC.mjs} +33 -34
- package/components/chunks/{MazIcon-z-jTiuyI.mjs → MazIcon-BF5TFzse.mjs} +1 -1
- package/components/chunks/{MazInput-oOA7gdLO.mjs → MazInput-DC3S-CVu.mjs} +44 -53
- package/components/chunks/{MazInput-BQoQSRyL.mjs → MazInput-DzWkS-g8.mjs} +40 -49
- package/components/chunks/{MazInput-CJQB68c-.mjs → MazInput-NE6H-10w.mjs} +42 -51
- package/components/chunks/{MazInputNumber-B4mQJcVB.mjs → MazInputNumber-DRXQXHRv.mjs} +168 -189
- package/components/chunks/{MazInputPrice-BrxE5WVf.mjs → MazInputPrice-DoTnDDIN.mjs} +49 -58
- package/components/chunks/{MazInputTags-BVCej_gW.mjs → MazInputTags-Dj3sW-e5.mjs} +181 -202
- package/components/chunks/{MazLink-Dl9ePCGm.mjs → MazLink-C_3Wya94.mjs} +19 -31
- package/components/chunks/{MazLoadingBar-Dwf55oHy.mjs → MazLoadingBar-DdjHRC7g.mjs} +1 -1
- package/components/chunks/MazPagination-BkT4_LLW.mjs +330 -0
- package/components/chunks/{MazPhoneNumberInput-Cd25AzXc.mjs → MazPhoneNumberInput-BbssOUzo.mjs} +500 -544
- package/components/chunks/{MazPicker-C78yxilJ.mjs → MazPicker-DwWiIYAR.mjs} +243 -264
- package/components/chunks/{MazPickerMonthSwitcher-CyHYx8TT.mjs → MazPickerMonthSwitcher-CmFFQoPA.mjs} +1 -1
- package/components/chunks/{MazPickerShortcuts-Bsi8cnox.mjs → MazPickerShortcuts-DaELz7aq.mjs} +1 -1
- package/components/chunks/{MazPickerYearSwitcher-DLUSMAtz.mjs → MazPickerYearSwitcher-m1_KXnpA.mjs} +1 -1
- package/components/chunks/{MazSelect-CQDoUpgp.mjs → MazSelect-BJ07NVXQ.mjs} +149 -170
- package/components/chunks/{MazSelect-uCJPMXF-.mjs → MazSelect-CDV9Fx6m.mjs} +124 -136
- package/components/chunks/{MazSpinner-Bvb-lKER.mjs → MazSpinner-Bb3f2t6w.mjs} +1 -1
- package/components/chunks/{MazSpinner-Cqp-BMvL.mjs → MazSpinner-BcB0szZB.mjs} +1 -1
- package/components/chunks/{MazSpinner-BT_717pD.mjs → MazSpinner-BpkPcfCt.mjs} +1 -1
- package/components/chunks/{MazSpinner-CAbYLlEZ.mjs → MazSpinner-BsYJDmi9.mjs} +1 -1
- package/components/chunks/{MazSpinner-B9OwpEP_.mjs → MazSpinner-BymqEMBk.mjs} +1 -1
- package/components/chunks/MazSpinner-C-64WJje.mjs +34 -0
- package/components/chunks/MazSpinner-CEFbkZkM.mjs +34 -0
- package/components/chunks/{MazSpinner-EFo8dM46.mjs → MazSpinner-CfiIXW8y.mjs} +1 -1
- package/components/chunks/MazSpinner-CykRbNHD.mjs +34 -0
- package/components/chunks/{MazSpinner-C-z3-68w.mjs → MazSpinner-D3-pqOh3.mjs} +1 -1
- package/components/chunks/MazSpinner-DS58mtzm.mjs +34 -0
- package/components/chunks/{MazSpinner-2D0ZmAQz.mjs → MazSpinner-DmiLBQgR.mjs} +1 -1
- package/components/chunks/{MazSpinner-C1Ip-Dwh.mjs → MazSpinner-Dmkr_r9u.mjs} +1 -1
- package/components/chunks/MazSpinner-DoRGA1RI.mjs +34 -0
- package/components/chunks/MazSpinner-eC03bFP5.mjs +34 -0
- package/components/chunks/{MazSpinner-Cb3_S0zT.mjs → MazSpinner-edxn0ncQ.mjs} +1 -1
- package/components/chunks/MazSpinner-f2Mc2eRO.mjs +34 -0
- package/components/chunks/MazSpinner-n4Dp5ZsH.mjs +34 -0
- package/components/chunks/MazStepper-BREfkpUb.mjs +213 -0
- package/components/chunks/{MazTable-Cuz5QI08.mjs → MazTable-BJDPdIJB.mjs} +183 -227
- package/components/chunks/{MazTableCell-D_OTOJiy.mjs → MazTableCell-DILuUCTe.mjs} +1 -1
- package/components/chunks/{MazTableRow-BTcVAyOy.mjs → MazTableRow-D6H6-c8J.mjs} +1 -1
- package/components/chunks/{MazTableTitle-BDA9G6Zw.mjs → MazTableTitle-Ch-nyY1E.mjs} +1 -1
- package/components/chunks/MazTabsBar-CM-w7V97.mjs +193 -0
- package/components/chunks/{MazTransitionExpand-C-FHhOGB.mjs → MazTransitionExpand-PmUDa51_.mjs} +1 -1
- package/modules/chunks/MazBtn-QVmZ90t5.mjs +106 -0
- package/modules/chunks/MazBtn-R7z-Hxp-.cjs +1 -0
- package/modules/chunks/{MazIcon-dhyR9Q8a.cjs → MazIcon-CKCoY05P.cjs} +1 -1
- package/modules/chunks/{MazIcon-DllGg8tw.mjs → MazIcon-DJfEPmBG.mjs} +1 -1
- package/modules/chunks/{MazSpinner-bdGjxsu6.mjs → MazSpinner-C95OqwKl.mjs} +1 -1
- package/modules/chunks/{MazSpinner-CiIyZ8gs.cjs → MazSpinner-DYT43E6e.cjs} +1 -1
- package/modules/chunks/{index-x2F1l5sr.mjs → index-CjsYU5rv.mjs} +191 -226
- package/modules/chunks/{index-BPqjUr5e.cjs → index-oVi9-l4o.cjs} +2 -27
- 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/MazTable.vue.d.ts +6 -6
- package/types/modules/composables/useFormValidator/types.d.ts +5 -1
- package/types/modules/composables/useFormValidator/useFormField.d.ts +3 -3
- package/types/modules/composables/useFormValidator/useFormValidator.d.ts +2 -2
- package/types/modules/composables/useFormValidator/utils.d.ts +12 -12
- package/components/chunks/MazBtn-BRUaoP8j.mjs +0 -126
- package/components/chunks/MazBtn-BhnOApJu.mjs +0 -118
- package/components/chunks/MazBtn-C28vKP_v.mjs +0 -118
- package/components/chunks/MazBtn-C87UEsVs.mjs +0 -118
- package/components/chunks/MazBtn-C_l3xuAh.mjs +0 -118
- package/components/chunks/MazBtn-CweCwE_4.mjs +0 -118
- package/components/chunks/MazBtn-D7IKoL2c.mjs +0 -118
- package/components/chunks/MazBtn-DadFupkY.mjs +0 -118
- package/components/chunks/MazBtn-GGcGrIH4.mjs +0 -118
- package/components/chunks/MazBtn-Mu18egu5.mjs +0 -118
- package/components/chunks/MazDialogPromise-BCCdkrea.mjs +0 -522
- package/components/chunks/MazPagination-CHTMRRqE.mjs +0 -362
- package/components/chunks/MazSpinner-C23CZ_Za.mjs +0 -34
- package/components/chunks/MazSpinner-CViChjTw.mjs +0 -34
- package/components/chunks/MazSpinner-CZMBhCOJ.mjs +0 -34
- package/components/chunks/MazSpinner-D4C84xZe.mjs +0 -34
- package/components/chunks/MazSpinner-Dyf9yb51.mjs +0 -34
- package/components/chunks/MazSpinner-QHjOczon.mjs +0 -34
- package/components/chunks/MazSpinner-u8WQTgUR.mjs +0 -34
- package/components/chunks/MazSpinner-w-S5uCxg.mjs +0 -34
- package/components/chunks/MazStepper-DRWtYHZR.mjs +0 -232
- package/components/chunks/MazTabsBar-JkRzMDM6.mjs +0 -203
- package/modules/chunks/MazBtn-Bf9Cq5M7.cjs +0 -9
package/components/chunks/{MazPhoneNumberInput-Cd25AzXc.mjs → MazPhoneNumberInput-BbssOUzo.mjs}
RENAMED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import '../assets/MazPhoneNumberInput.css';var Ge = Object.defineProperty;
|
|
2
|
-
var Je = (
|
|
3
|
-
var _ = (
|
|
4
|
-
import { useId as Ze, computed as h, inject as Xe, defineComponent as
|
|
2
|
+
var Je = (a, o, e) => o in a ? Ge(a, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[o] = e;
|
|
3
|
+
var _ = (a, o, e) => Je(a, typeof o != "symbol" ? o + "" : o, e);
|
|
4
|
+
import { useId as Ze, computed as h, inject as Xe, defineComponent as ne, defineAsyncComponent as q, withDirectives as ze, openBlock as b, createElementBlock as E, normalizeClass as F, normalizeStyle as ee, Fragment as be, renderList as Be, createElementVNode as j, mergeProps as oe, createVNode as H, unref as P, createCommentVNode as $, renderSlot as N, ref as k, onMounted as Ie, useSlots as xe, createBlock as U, resolveDynamicComponent as Pe, toHandlers as _e, vModelDynamic as eo, createTextVNode as oo, toDisplayString as ue, withModifiers as se, withCtx as G, useCssVars as to, onBeforeMount as lo, nextTick as ie, Transition as ao, mergeModels as ke, useModel as so, provide as no, watch as he } from "vue";
|
|
5
5
|
import { getCountries as Oe, getCountryCallingCode as ce, isSupportedCountry as ro, parsePhoneNumberFromString as io, AsYouType as uo, getExampleNumber as co } from "libphonenumber-js";
|
|
6
6
|
function Ae({
|
|
7
|
-
componentName:
|
|
7
|
+
componentName: a,
|
|
8
8
|
providedId: o
|
|
9
9
|
}) {
|
|
10
10
|
const e = Ze();
|
|
11
|
-
return h(() => o ?? `${
|
|
11
|
+
return h(() => o ?? `${a}-${e}`);
|
|
12
12
|
}
|
|
13
|
-
function Ee(
|
|
14
|
-
return `https://flagcdn.com/${o}/${
|
|
13
|
+
function Ee(a, o = "20x15") {
|
|
14
|
+
return `https://flagcdn.com/${o}/${a.toLowerCase()}.png`;
|
|
15
15
|
}
|
|
16
|
-
function Me(
|
|
17
|
-
const e = Xe(
|
|
16
|
+
function Me(a, o) {
|
|
17
|
+
const e = Xe(a, o);
|
|
18
18
|
if (!e)
|
|
19
|
-
throw new TypeError(`[maz-ui](injectStrict) Could not resolve ${
|
|
19
|
+
throw new TypeError(`[maz-ui](injectStrict) Could not resolve ${a}`);
|
|
20
20
|
return e;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
return !!
|
|
22
|
+
function mo(a) {
|
|
23
|
+
return !!a;
|
|
24
24
|
}
|
|
25
|
-
const
|
|
25
|
+
const fo = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", po = {
|
|
26
26
|
baseClass: "m-lazy-img",
|
|
27
27
|
loadedClass: "m-lazy-loaded",
|
|
28
28
|
loadingClass: "m-lazy-loading",
|
|
@@ -39,7 +39,7 @@ const mo = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAA
|
|
|
39
39
|
class ho {
|
|
40
40
|
constructor(o = {}) {
|
|
41
41
|
_(this, "observers", []);
|
|
42
|
-
_(this, "defaultOptions",
|
|
42
|
+
_(this, "defaultOptions", po);
|
|
43
43
|
_(this, "options");
|
|
44
44
|
_(this, "onImgLoadedCallback");
|
|
45
45
|
_(this, "onImgErrorCallback");
|
|
@@ -149,18 +149,18 @@ class ho {
|
|
|
149
149
|
t.src = e;
|
|
150
150
|
}
|
|
151
151
|
handleIntersectionObserver(o, e, t, r) {
|
|
152
|
-
var u,
|
|
152
|
+
var u, v;
|
|
153
153
|
this.observers.push(r);
|
|
154
|
-
for (const
|
|
155
|
-
if (
|
|
156
|
-
if ((
|
|
154
|
+
for (const f of t)
|
|
155
|
+
if (f.isIntersecting) {
|
|
156
|
+
if ((v = (u = this.options).onIntersecting) == null || v.call(u, f.target), this.options.observerOnce && r.unobserve(o), this.options.loadOnce && this.hasImgLoaded)
|
|
157
157
|
return;
|
|
158
158
|
this.loadImage(o, e);
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
createObserver(o, e) {
|
|
162
|
-
const t = (
|
|
163
|
-
this.handleIntersectionObserver(o, e,
|
|
162
|
+
const t = (v, f) => {
|
|
163
|
+
this.handleIntersectionObserver(o, e, v, f);
|
|
164
164
|
}, r = this.options.observerOptions;
|
|
165
165
|
new IntersectionObserver(t, r).observe(o);
|
|
166
166
|
}
|
|
@@ -177,7 +177,7 @@ class ho {
|
|
|
177
177
|
async add(o, e) {
|
|
178
178
|
if (this.hasBgImgMode(e) && this.isPictureElement(o))
|
|
179
179
|
throw new Error(`[MazLazyImg] You can't use the "bg-image" mode with "<picture />" element`);
|
|
180
|
-
setTimeout(() => this.setBaseClass(o), 0), o.getAttribute("src") || this.setImgSrc(o,
|
|
180
|
+
setTimeout(() => this.setBaseClass(o), 0), o.getAttribute("src") || this.setImgSrc(o, fo), await this.bindUpdateHandler(o, e, "bind");
|
|
181
181
|
}
|
|
182
182
|
async update(o, e) {
|
|
183
183
|
e.value !== e.oldValue && (this.hasImgLoaded = !1, this.removeAllStateClasses(o), await this.bindUpdateHandler(o, e, "update"));
|
|
@@ -190,21 +190,21 @@ class ho {
|
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
let de;
|
|
193
|
-
const
|
|
194
|
-
created(
|
|
193
|
+
const vo = {
|
|
194
|
+
created(a, o) {
|
|
195
195
|
const e = typeof o.value == "object" ? o.value : {};
|
|
196
|
-
de = new ho(e), de.add(
|
|
196
|
+
de = new ho(e), de.add(a, o);
|
|
197
197
|
},
|
|
198
|
-
updated(
|
|
199
|
-
de.update(
|
|
198
|
+
updated(a, o) {
|
|
199
|
+
de.update(a, o);
|
|
200
200
|
},
|
|
201
|
-
unmounted(
|
|
202
|
-
de.remove(
|
|
201
|
+
unmounted(a, o) {
|
|
202
|
+
de.remove(a, o);
|
|
203
203
|
}
|
|
204
|
-
},
|
|
204
|
+
}, yo = ["data-lazy-srcset", "media"], go = ["alt"], bo = {
|
|
205
205
|
key: 0,
|
|
206
206
|
class: "m-lazy-img-component-loader"
|
|
207
|
-
}, Co = /* @__PURE__ */
|
|
207
|
+
}, Co = /* @__PURE__ */ ne({
|
|
208
208
|
inheritAttrs: !1,
|
|
209
209
|
__name: "MazLazyImg",
|
|
210
210
|
props: {
|
|
@@ -224,26 +224,26 @@ const yo = {
|
|
|
224
224
|
block: { type: Boolean }
|
|
225
225
|
},
|
|
226
226
|
emits: ["intersecting", "loading", "loaded", "error"],
|
|
227
|
-
setup(
|
|
228
|
-
const o =
|
|
227
|
+
setup(a) {
|
|
228
|
+
const o = a, e = q(() => import("./MazSpinner-CEFbkZkM.mjs")), t = h(() => o.image || o.src), r = h(() => {
|
|
229
229
|
var u;
|
|
230
230
|
return typeof t.value == "string" ? [{ srcset: t.value }] : (u = t.value) == null ? void 0 : u.sources;
|
|
231
231
|
});
|
|
232
|
-
return (u,
|
|
232
|
+
return (u, v) => ze((b(), E(
|
|
233
233
|
"picture",
|
|
234
234
|
{
|
|
235
235
|
class: F(["m-lazy-img-component", [{ "--use-loader": !u.noLoader, "--height-full": u.imageHeightFull, "--block": u.block }, o.class]]),
|
|
236
236
|
style: ee(u.style)
|
|
237
237
|
},
|
|
238
238
|
[
|
|
239
|
-
(b(!0),
|
|
239
|
+
(b(!0), E(
|
|
240
240
|
be,
|
|
241
241
|
null,
|
|
242
|
-
Be(r.value, ({ srcset:
|
|
243
|
-
key:
|
|
244
|
-
"data-lazy-srcset":
|
|
242
|
+
Be(r.value, ({ srcset: f, media: O }, L) => (b(), E("source", {
|
|
243
|
+
key: L,
|
|
244
|
+
"data-lazy-srcset": f,
|
|
245
245
|
media: O
|
|
246
|
-
}, null, 8,
|
|
246
|
+
}, null, 8, yo))),
|
|
247
247
|
128
|
|
248
248
|
/* KEYED_FRAGMENT */
|
|
249
249
|
)),
|
|
@@ -253,29 +253,29 @@ const yo = {
|
|
|
253
253
|
alt: u.alt,
|
|
254
254
|
class: u.imgClass
|
|
255
255
|
}), null, 16, go),
|
|
256
|
-
u.noLoader ?
|
|
257
|
-
H(
|
|
256
|
+
u.noLoader ? $("v-if", !0) : (b(), E("div", bo, [
|
|
257
|
+
H(P(e), { size: "2em" })
|
|
258
258
|
])),
|
|
259
259
|
N(u.$slots, "default", {}, void 0, !0)
|
|
260
260
|
],
|
|
261
261
|
6
|
|
262
262
|
/* CLASS, STYLE */
|
|
263
263
|
)), [
|
|
264
|
-
[
|
|
264
|
+
[P(vo), {
|
|
265
265
|
noPhoto: u.noPhoto,
|
|
266
266
|
loadOnce: u.loadOnce,
|
|
267
267
|
observerOptions: u.observerOptions,
|
|
268
268
|
fallbackSrc: u.fallbackSrc,
|
|
269
269
|
observerOnce: !u.noObserverOnce,
|
|
270
|
-
onIntersecting: (
|
|
271
|
-
onLoading: (
|
|
272
|
-
onLoaded: (
|
|
273
|
-
onError: (
|
|
270
|
+
onIntersecting: (f) => u.$emit("intersecting", f),
|
|
271
|
+
onLoading: (f) => u.$emit("loading", f),
|
|
272
|
+
onLoaded: (f) => u.$emit("loaded", f),
|
|
273
|
+
onError: (f) => u.$emit("error", f)
|
|
274
274
|
}]
|
|
275
275
|
]);
|
|
276
276
|
}
|
|
277
|
-
}), re = (
|
|
278
|
-
const e =
|
|
277
|
+
}), re = (a, o) => {
|
|
278
|
+
const e = a.__vccOpts || a;
|
|
279
279
|
for (const [t, r] of o)
|
|
280
280
|
e[t] = r;
|
|
281
281
|
return e;
|
|
@@ -289,7 +289,7 @@ const yo = {
|
|
|
289
289
|
removeNumbers: !1,
|
|
290
290
|
customNormalizationForms: ["NFC", "NFKD"]
|
|
291
291
|
};
|
|
292
|
-
function
|
|
292
|
+
function me(a, o) {
|
|
293
293
|
const e = { ...zo, ...o }, t = {
|
|
294
294
|
À: "A",
|
|
295
295
|
Á: "A",
|
|
@@ -339,93 +339,93 @@ function pe(n, o) {
|
|
|
339
339
|
ñ: "n",
|
|
340
340
|
ó: "o"
|
|
341
341
|
};
|
|
342
|
-
let r =
|
|
342
|
+
let r = a.toString();
|
|
343
343
|
if (e.trim && (r = r.trim()), e.normalizeSpaces && (r = r.replaceAll(/\s+/g, " ")), e.replaceSpaces && (r = r.replaceAll(" ", "-")), e.removeNumbers && (r = r.replaceAll(/\d/g, "")), e.removeAccents && (r = r.replaceAll(/[ÀÁÂÃÄÅÇÈÉÊËÎÏÑÔÕÖØÙÚÛÜàáâãäåçèéêëíîïñóôõöøùúûüÿ]/g, (u) => t[u] || u), r = r.replaceAll(/[\u0300-\u036F]/g, "")), e.caseSensitive === !1 && (r = r.toLowerCase()), e.removeSpecialCharacters && (r = r.replaceAll(/[^\dA-Z-]/gi, "")), e.trim && (r = r.trim()), e.customNormalizationForms)
|
|
344
344
|
for (const u of e.customNormalizationForms)
|
|
345
345
|
r = r.normalize(u);
|
|
346
346
|
return r;
|
|
347
347
|
}
|
|
348
|
-
function Io(
|
|
349
|
-
const e =
|
|
348
|
+
function Io(a, o) {
|
|
349
|
+
const e = a.length, t = o.length, r = [];
|
|
350
350
|
for (let u = 0; u <= e; u++)
|
|
351
351
|
r[u] = [u];
|
|
352
352
|
for (let u = 0; u <= t; u++)
|
|
353
353
|
r[0][u] = u;
|
|
354
354
|
for (let u = 1; u <= e; u++)
|
|
355
|
-
for (let
|
|
356
|
-
const
|
|
357
|
-
r[u][
|
|
358
|
-
r[u - 1][
|
|
359
|
-
r[u][
|
|
360
|
-
r[u - 1][
|
|
355
|
+
for (let v = 1; v <= t; v++) {
|
|
356
|
+
const f = a[u - 1] === o[v - 1] ? 0 : 1;
|
|
357
|
+
r[u][v] = Math.min(
|
|
358
|
+
r[u - 1][v] + 1,
|
|
359
|
+
r[u][v - 1] + 1,
|
|
360
|
+
r[u - 1][v - 1] + f
|
|
361
361
|
);
|
|
362
362
|
}
|
|
363
363
|
return r[e][t];
|
|
364
364
|
}
|
|
365
|
-
function Te(
|
|
366
|
-
const e = Io(
|
|
365
|
+
function Te(a, o) {
|
|
366
|
+
const e = Io(a, o), t = Math.max(a.length, o.length);
|
|
367
367
|
return 1 - e / t;
|
|
368
368
|
}
|
|
369
|
-
function Ao(
|
|
370
|
-
return Te(
|
|
369
|
+
function Ao(a, o, e = 0.75) {
|
|
370
|
+
return Te(a, o) >= e;
|
|
371
371
|
}
|
|
372
|
-
function
|
|
372
|
+
function ve(a, o, e = 0.75) {
|
|
373
373
|
const t = h(
|
|
374
|
-
() =>
|
|
374
|
+
() => me(typeof a == "string" ? a : a.value)
|
|
375
375
|
), r = h(
|
|
376
|
-
() =>
|
|
377
|
-
), u = h(() => typeof e == "number" ? e : e.value),
|
|
376
|
+
() => me(typeof o == "string" ? o : o.value)
|
|
377
|
+
), u = h(() => typeof e == "number" ? e : e.value), v = h(() => Te(t.value, r.value));
|
|
378
378
|
return {
|
|
379
379
|
isMatching: h(
|
|
380
380
|
() => Ao(t.value, r.value, u.value)
|
|
381
381
|
),
|
|
382
|
-
score:
|
|
382
|
+
score: v
|
|
383
383
|
};
|
|
384
384
|
}
|
|
385
|
-
function Fe(
|
|
386
|
-
var
|
|
387
|
-
|
|
385
|
+
function Fe(a, o, e) {
|
|
386
|
+
var v;
|
|
387
|
+
a.stopPropagation();
|
|
388
388
|
const t = typeof e.value == "function" ? e.value : e.value.handler, r = typeof e.value == "object" ? e.value.exclude : void 0;
|
|
389
389
|
let u = !1;
|
|
390
390
|
if (r && r.length > 0) {
|
|
391
|
-
for (const
|
|
392
|
-
if (!u &&
|
|
393
|
-
const O = (
|
|
394
|
-
u =
|
|
391
|
+
for (const f of r)
|
|
392
|
+
if (!u && a.target instanceof HTMLElement) {
|
|
393
|
+
const O = (v = document.querySelector(f)) == null ? void 0 : v.getAttribute("id");
|
|
394
|
+
u = a.target.getAttribute("id") === O;
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
-
!o.contains(
|
|
397
|
+
!o.contains(a.target) && !u && (t == null || t());
|
|
398
398
|
}
|
|
399
399
|
function Ne() {
|
|
400
400
|
return document.ontouchstart === null ? "touchstart" : "click";
|
|
401
401
|
}
|
|
402
|
-
function wo(
|
|
402
|
+
function wo(a, o) {
|
|
403
403
|
const e = Ne();
|
|
404
|
-
document.removeEventListener(e, (t) => Fe(t,
|
|
404
|
+
document.removeEventListener(e, (t) => Fe(t, a, o));
|
|
405
405
|
}
|
|
406
|
-
function So(
|
|
406
|
+
function So(a, o) {
|
|
407
407
|
if (typeof o.value != "function" && typeof o.value == "object" && typeof o.value.handler != "function") {
|
|
408
408
|
console.error("[maz-ui](vClosable) v-closable directive requires a handler function");
|
|
409
409
|
return;
|
|
410
410
|
}
|
|
411
411
|
const e = Ne();
|
|
412
|
-
document.addEventListener(e, (t) => Fe(t,
|
|
412
|
+
document.addEventListener(e, (t) => Fe(t, a, o));
|
|
413
413
|
}
|
|
414
414
|
const Vo = {
|
|
415
415
|
mounted: So,
|
|
416
416
|
unmounted: wo
|
|
417
417
|
};
|
|
418
|
-
function Po(
|
|
418
|
+
function Po(a, o) {
|
|
419
419
|
let e;
|
|
420
420
|
return function(...t) {
|
|
421
421
|
clearTimeout(e), e = setTimeout(() => {
|
|
422
|
-
|
|
422
|
+
a.apply(this, t);
|
|
423
423
|
}, o);
|
|
424
424
|
};
|
|
425
425
|
}
|
|
426
|
-
let
|
|
427
|
-
function ko(
|
|
428
|
-
|
|
426
|
+
let ye = null;
|
|
427
|
+
function ko(a, o) {
|
|
428
|
+
ye && clearTimeout(ye), ye = setTimeout(a, o);
|
|
429
429
|
}
|
|
430
430
|
const Eo = {
|
|
431
431
|
key: 0,
|
|
@@ -433,7 +433,7 @@ const Eo = {
|
|
|
433
433
|
}, Lo = { class: "m-input-wrapper-input" }, $o = ["id", "type", "name", "inputmode", "placeholder", "aria-label", "disabled", "readonly", "required"], Bo = { key: 0 }, Oo = {
|
|
434
434
|
key: 1,
|
|
435
435
|
class: "m-input-wrapper-right"
|
|
436
|
-
}, Mo = /* @__PURE__ */
|
|
436
|
+
}, Mo = /* @__PURE__ */ ne({
|
|
437
437
|
inheritAttrs: !1,
|
|
438
438
|
__name: "MazInput",
|
|
439
439
|
props: {
|
|
@@ -470,16 +470,16 @@ const Eo = {
|
|
|
470
470
|
block: { type: Boolean }
|
|
471
471
|
},
|
|
472
472
|
emits: ["update:model-value", "focus", "blur", "click", "change", "input"],
|
|
473
|
-
setup(
|
|
474
|
-
const e =
|
|
473
|
+
setup(a, { emit: o }) {
|
|
474
|
+
const e = a, t = o, r = q(() => import("./MazBtn-2VKM1wZu.mjs")), u = q(() => import("./MazIcon-BF5TFzse.mjs")), v = q(() => import("./eye-slash-BoO00xzs.mjs")), f = q(() => import("./eye-f8zAUc30.mjs")), O = q(() => import("./check-C9Q_W85g.mjs")), L = k(!1), y = k(!1), V = k(), i = Ae({
|
|
475
475
|
componentName: "MazInput",
|
|
476
476
|
providedId: e.id
|
|
477
477
|
});
|
|
478
478
|
Ie(() => {
|
|
479
|
-
var
|
|
480
|
-
e.autoFocus && ((
|
|
479
|
+
var n;
|
|
480
|
+
e.autoFocus && ((n = V.value) == null || n.focus());
|
|
481
481
|
});
|
|
482
|
-
const
|
|
482
|
+
const p = h(() => e.type === "password"), z = h(() => L.value ? "text" : e.type), w = h(() => {
|
|
483
483
|
if (!e.noBorder) {
|
|
484
484
|
if (e.error)
|
|
485
485
|
return "maz-border-danger";
|
|
@@ -487,7 +487,7 @@ const Eo = {
|
|
|
487
487
|
return "maz-border-success";
|
|
488
488
|
if (e.warning)
|
|
489
489
|
return "maz-border-warning";
|
|
490
|
-
if (
|
|
490
|
+
if (y.value || e.borderActive) {
|
|
491
491
|
if (e.color === "black")
|
|
492
492
|
return "maz-border-black";
|
|
493
493
|
if (e.color === "danger")
|
|
@@ -507,104 +507,101 @@ const Eo = {
|
|
|
507
507
|
}
|
|
508
508
|
return "--default-border";
|
|
509
509
|
}
|
|
510
|
-
}),
|
|
511
|
-
const { required:
|
|
510
|
+
}), D = xe(), Y = h(() => {
|
|
511
|
+
const { required: n, placeholder: M } = e;
|
|
512
512
|
if (M)
|
|
513
|
-
return
|
|
513
|
+
return n ? `${M} *` : M;
|
|
514
514
|
}), J = h(() => C.value !== void 0 && C.value !== ""), g = Po(
|
|
515
|
-
(
|
|
516
|
-
t("update:model-value",
|
|
515
|
+
(n) => {
|
|
516
|
+
t("update:model-value", n);
|
|
517
517
|
},
|
|
518
518
|
typeof e.debounce == "number" ? e.debounce : e.debounceDelay ?? 500
|
|
519
519
|
);
|
|
520
|
-
function
|
|
520
|
+
function S(n) {
|
|
521
521
|
if (e.debounce)
|
|
522
|
-
return g(
|
|
523
|
-
t("update:model-value",
|
|
522
|
+
return g(n);
|
|
523
|
+
t("update:model-value", n);
|
|
524
524
|
}
|
|
525
525
|
const C = h({
|
|
526
526
|
get: () => e.modelValue,
|
|
527
|
-
set: (
|
|
528
|
-
}), W = h(() => (!!e.label || !!e.hint) && (
|
|
529
|
-
function
|
|
530
|
-
return !!
|
|
527
|
+
set: (n) => S(n)
|
|
528
|
+
}), W = h(() => (!!e.label || !!e.hint) && (y.value || !!J.value || !!e.placeholder || ["date", "month", "week"].includes(e.type))), Z = h(() => !!e.label || !!e.hint);
|
|
529
|
+
function s() {
|
|
530
|
+
return !!D["right-icon"] || p.value || !!D["valid-button"] || e.validButton || !!e.rightIcon;
|
|
531
531
|
}
|
|
532
|
-
function
|
|
533
|
-
return !!
|
|
532
|
+
function A() {
|
|
533
|
+
return !!D["left-icon"] || !!e.leftIcon;
|
|
534
534
|
}
|
|
535
|
-
function K(
|
|
536
|
-
t("focus",
|
|
535
|
+
function K(n) {
|
|
536
|
+
t("focus", n), y.value = !0;
|
|
537
537
|
}
|
|
538
|
-
function T(
|
|
539
|
-
t("blur",
|
|
538
|
+
function T(n) {
|
|
539
|
+
t("blur", n), y.value = !1;
|
|
540
540
|
}
|
|
541
|
-
function te(
|
|
542
|
-
return t("change",
|
|
541
|
+
function te(n) {
|
|
542
|
+
return t("change", n);
|
|
543
543
|
}
|
|
544
|
-
function X(
|
|
545
|
-
return t("input",
|
|
544
|
+
function X(n) {
|
|
545
|
+
return t("input", n);
|
|
546
546
|
}
|
|
547
|
-
return (
|
|
547
|
+
return (n, M) => (b(), E(
|
|
548
548
|
"div",
|
|
549
549
|
{
|
|
550
550
|
class: F(["m-input", [
|
|
551
551
|
{
|
|
552
|
-
"--is-focused":
|
|
552
|
+
"--is-focused": y.value || n.borderActive,
|
|
553
553
|
"--should-up": W.value,
|
|
554
554
|
"--has-label": Z.value,
|
|
555
|
-
"--is-disabled":
|
|
556
|
-
"--is-readonly":
|
|
557
|
-
"--has-z-2":
|
|
558
|
-
"--has-state":
|
|
559
|
-
"--block":
|
|
555
|
+
"--is-disabled": n.disabled,
|
|
556
|
+
"--is-readonly": n.readonly,
|
|
557
|
+
"--has-z-2": n.error || n.warning || n.success,
|
|
558
|
+
"--has-state": n.error || n.warning || n.success,
|
|
559
|
+
"--block": n.block
|
|
560
560
|
},
|
|
561
561
|
e.class,
|
|
562
|
-
`--${
|
|
563
|
-
`--${
|
|
562
|
+
`--${n.color}`,
|
|
563
|
+
`--${n.size}`
|
|
564
564
|
]]),
|
|
565
|
-
style: ee(
|
|
565
|
+
style: ee(n.style)
|
|
566
566
|
},
|
|
567
567
|
[
|
|
568
568
|
j(
|
|
569
569
|
"div",
|
|
570
570
|
{
|
|
571
571
|
class: F(["m-input-wrapper", [
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
572
|
+
n.inputClasses,
|
|
573
|
+
w.value,
|
|
574
|
+
n.roundedSize ? `--rounded-${n.roundedSize}` : { "maz-rounded": !n.noRadius }
|
|
575
575
|
]])
|
|
576
576
|
},
|
|
577
577
|
[
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
`),
|
|
582
|
-
s.$slots["left-icon"] || s.leftIcon ? N(s.$slots, "left-icon", { key: 0 }, () => [
|
|
583
|
-
typeof s.leftIcon == "string" ? (b(), U(k(u), {
|
|
578
|
+
A() ? (b(), E("div", Eo, [
|
|
579
|
+
n.$slots["left-icon"] || n.leftIcon ? N(n.$slots, "left-icon", { key: 0 }, () => [
|
|
580
|
+
typeof n.leftIcon == "string" ? (b(), U(P(u), {
|
|
584
581
|
key: 0,
|
|
585
|
-
name:
|
|
582
|
+
name: n.leftIcon,
|
|
586
583
|
class: "maz-text-xl maz-text-muted"
|
|
587
|
-
}, null, 8, ["name"])) :
|
|
584
|
+
}, null, 8, ["name"])) : n.leftIcon ? (b(), U(Pe(n.leftIcon), {
|
|
588
585
|
key: 1,
|
|
589
586
|
class: "maz-text-xl maz-text-muted"
|
|
590
|
-
})) :
|
|
591
|
-
], !0) :
|
|
592
|
-
])) :
|
|
587
|
+
})) : $("v-if", !0)
|
|
588
|
+
], !0) : $("v-if", !0)
|
|
589
|
+
])) : $("v-if", !0),
|
|
593
590
|
j("div", Lo, [
|
|
594
591
|
ze(j("input", oe({
|
|
595
|
-
id:
|
|
592
|
+
id: P(i),
|
|
596
593
|
ref_key: "input",
|
|
597
|
-
ref:
|
|
594
|
+
ref: V,
|
|
598
595
|
"onUpdate:modelValue": M[0] || (M[0] = (x) => C.value = x),
|
|
599
|
-
type:
|
|
600
|
-
name:
|
|
601
|
-
},
|
|
602
|
-
inputmode:
|
|
596
|
+
type: z.value,
|
|
597
|
+
name: n.name
|
|
598
|
+
}, n.$attrs, {
|
|
599
|
+
inputmode: n.inputmode,
|
|
603
600
|
placeholder: Y.value,
|
|
604
|
-
"aria-label":
|
|
605
|
-
disabled:
|
|
606
|
-
readonly:
|
|
607
|
-
required:
|
|
601
|
+
"aria-label": n.label || n.placeholder,
|
|
602
|
+
disabled: n.disabled,
|
|
603
|
+
readonly: n.readonly,
|
|
604
|
+
required: n.required,
|
|
608
605
|
class: "m-input-input"
|
|
609
606
|
}, _e({
|
|
610
607
|
blur: T,
|
|
@@ -612,88 +609,82 @@ const Eo = {
|
|
|
612
609
|
change: te,
|
|
613
610
|
input: X
|
|
614
611
|
}, !0), {
|
|
615
|
-
onClick: M[1] || (M[1] = (x) =>
|
|
612
|
+
onClick: M[1] || (M[1] = (x) => n.$emit("click", x))
|
|
616
613
|
}), null, 16, $o), [
|
|
617
614
|
[eo, C.value]
|
|
618
615
|
]),
|
|
619
|
-
|
|
616
|
+
n.label || n.hint ? (b(), E(
|
|
620
617
|
"span",
|
|
621
618
|
{
|
|
622
619
|
key: 0,
|
|
623
620
|
class: F(["m-input-label", [
|
|
624
621
|
{
|
|
625
|
-
"maz-text-danger-600":
|
|
626
|
-
"maz-text-success-600":
|
|
627
|
-
"maz-text-warning-600":
|
|
622
|
+
"maz-text-danger-600": n.error,
|
|
623
|
+
"maz-text-success-600": n.success,
|
|
624
|
+
"maz-text-warning-600": n.warning
|
|
628
625
|
}
|
|
629
626
|
]])
|
|
630
627
|
},
|
|
631
628
|
[
|
|
632
629
|
oo(
|
|
633
|
-
ue(
|
|
630
|
+
ue(n.hint || n.label) + " ",
|
|
634
631
|
1
|
|
635
632
|
/* TEXT */
|
|
636
633
|
),
|
|
637
|
-
|
|
634
|
+
n.required ? (b(), E("sup", Bo, "*")) : $("v-if", !0)
|
|
638
635
|
],
|
|
639
636
|
2
|
|
640
637
|
/* CLASS */
|
|
641
|
-
)) :
|
|
638
|
+
)) : $("v-if", !0)
|
|
642
639
|
]),
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
`),
|
|
647
|
-
s.$slots["right-icon"] || s.rightIcon ? N(s.$slots, "right-icon", { key: 0 }, () => [
|
|
648
|
-
typeof s.rightIcon == "string" ? (b(), U(k(u), {
|
|
640
|
+
s() ? (b(), E("div", Oo, [
|
|
641
|
+
n.$slots["right-icon"] || n.rightIcon ? N(n.$slots, "right-icon", { key: 0 }, () => [
|
|
642
|
+
typeof n.rightIcon == "string" ? (b(), U(P(u), {
|
|
649
643
|
key: 0,
|
|
650
|
-
name:
|
|
644
|
+
name: n.rightIcon,
|
|
651
645
|
class: "maz-text-xl maz-text-muted"
|
|
652
|
-
}, null, 8, ["name"])) :
|
|
646
|
+
}, null, 8, ["name"])) : n.rightIcon ? (b(), U(Pe(n.rightIcon), {
|
|
653
647
|
key: 1,
|
|
654
648
|
class: "maz-text-xl maz-text-muted"
|
|
655
|
-
})) :
|
|
656
|
-
], !0) :
|
|
657
|
-
|
|
649
|
+
})) : $("v-if", !0)
|
|
650
|
+
], !0) : $("v-if", !0),
|
|
651
|
+
p.value ? (b(), U(P(r), {
|
|
658
652
|
key: 1,
|
|
659
653
|
color: "transparent",
|
|
660
654
|
tabindex: "-1",
|
|
661
655
|
size: "mini",
|
|
662
|
-
onClick: M[2] || (M[2] =
|
|
656
|
+
onClick: M[2] || (M[2] = se((x) => L.value = !L.value, ["stop"]))
|
|
663
657
|
}, {
|
|
664
658
|
default: G(() => [
|
|
665
|
-
|
|
659
|
+
L.value ? (b(), U(P(v), {
|
|
666
660
|
key: 0,
|
|
667
661
|
class: "maz-text-xl maz-text-muted"
|
|
668
|
-
})) : (b(), U(
|
|
662
|
+
})) : (b(), U(P(f), {
|
|
669
663
|
key: 1,
|
|
670
664
|
class: "maz-text-xl maz-text-muted"
|
|
671
665
|
}))
|
|
672
666
|
]),
|
|
673
667
|
_: 1
|
|
674
668
|
/* STABLE */
|
|
675
|
-
})) :
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
`),
|
|
679
|
-
s.$slots["valid-button"] || s.validButton ? N(s.$slots, "valid-button", { key: 2 }, () => [
|
|
680
|
-
H(k(r), {
|
|
669
|
+
})) : $("v-if", !0),
|
|
670
|
+
n.$slots["valid-button"] || n.validButton ? N(n.$slots, "valid-button", { key: 2 }, () => [
|
|
671
|
+
H(P(r), {
|
|
681
672
|
color: "transparent",
|
|
682
|
-
disabled:
|
|
673
|
+
disabled: n.disabled,
|
|
683
674
|
tabindex: "-1",
|
|
684
|
-
loading:
|
|
675
|
+
loading: n.validButtonLoading,
|
|
685
676
|
class: "m-input-valid-button",
|
|
686
677
|
size: "mini",
|
|
687
678
|
type: "submit"
|
|
688
679
|
}, {
|
|
689
680
|
default: G(() => [
|
|
690
|
-
H(
|
|
681
|
+
H(P(O), { class: "maz-text-2xl maz-text-normal" })
|
|
691
682
|
]),
|
|
692
683
|
_: 1
|
|
693
684
|
/* STABLE */
|
|
694
685
|
}, 8, ["disabled", "loading"])
|
|
695
|
-
], !0) :
|
|
696
|
-
])) :
|
|
686
|
+
], !0) : $("v-if", !0)
|
|
687
|
+
])) : $("v-if", !0)
|
|
697
688
|
],
|
|
698
689
|
2
|
|
699
690
|
/* CLASS */
|
|
@@ -707,7 +698,7 @@ const Eo = {
|
|
|
707
698
|
key: 2,
|
|
708
699
|
class: "m-select-list__scroll-wrapper",
|
|
709
700
|
tabindex: "-1"
|
|
710
|
-
}, Ko = { class: "m-select-list-optgroup" }, Uo = ["onClick"], Ho = /* @__PURE__ */
|
|
701
|
+
}, Ko = { class: "m-select-list-optgroup" }, Uo = ["onClick"], Ho = /* @__PURE__ */ ne({
|
|
711
702
|
inheritAttrs: !1,
|
|
712
703
|
__name: "MazSelect",
|
|
713
704
|
props: {
|
|
@@ -739,28 +730,28 @@ const Eo = {
|
|
|
739
730
|
autocomplete: { default: "off" }
|
|
740
731
|
},
|
|
741
732
|
emits: ["close", "open", "blur", "focus", "change", "input", "update:model-value", "selected-option"],
|
|
742
|
-
setup(
|
|
733
|
+
setup(a, { expose: o, emit: e }) {
|
|
743
734
|
to((l) => ({
|
|
744
|
-
cb149e58:
|
|
735
|
+
cb149e58: z.value,
|
|
745
736
|
"215ff493": i.value,
|
|
746
|
-
"64d6cfbb":
|
|
737
|
+
"64d6cfbb": p.value
|
|
747
738
|
}));
|
|
748
|
-
const t =
|
|
739
|
+
const t = a, r = e, u = q(() => import("./MazCheckbox-B22OcHt8.mjs")), v = q(() => import("./magnifying-glass--nBiyXot.mjs")), f = q(() => import("./chevron-down-BkvtON3b.mjs")), O = q(() => import("./no-symbol-CIgKzsrB.mjs"));
|
|
749
740
|
o({
|
|
750
741
|
/** Method to open the option list */
|
|
751
|
-
openList:
|
|
742
|
+
openList: ae,
|
|
752
743
|
/** Method to close the option list */
|
|
753
744
|
closeList: le
|
|
754
745
|
});
|
|
755
|
-
const
|
|
746
|
+
const L = k(!1), y = k(), V = h(
|
|
756
747
|
() => ["black", "transparent", "white"].includes(t.color)
|
|
757
748
|
), i = h(
|
|
758
|
-
() =>
|
|
759
|
-
),
|
|
760
|
-
() =>
|
|
761
|
-
),
|
|
762
|
-
() =>
|
|
763
|
-
),
|
|
749
|
+
() => V.value ? "var(--maz-color-black)" : `var(--maz-color-${t.color}-800)`
|
|
750
|
+
), p = h(
|
|
751
|
+
() => V.value ? "var(--maz-color-muted)" : `var(--maz-color-${t.color}-100)`
|
|
752
|
+
), z = h(
|
|
753
|
+
() => V.value ? "var(--maz-color-muted)" : `var(--maz-color-${t.color}-200)`
|
|
754
|
+
), w = h(() => L.value || t.open), D = Ae({
|
|
764
755
|
componentName: "MazSelect",
|
|
765
756
|
providedId: t.id
|
|
766
757
|
});
|
|
@@ -784,166 +775,166 @@ const Eo = {
|
|
|
784
775
|
const l = [];
|
|
785
776
|
if (!((d = t.options) != null && d.length))
|
|
786
777
|
return [];
|
|
787
|
-
for (const
|
|
788
|
-
typeof
|
|
789
|
-
{ label:
|
|
790
|
-
...
|
|
778
|
+
for (const m of t.options)
|
|
779
|
+
typeof m == "string" || typeof m == "number" || typeof m == "boolean" ? l.push(Y(m)) : typeof m == "object" && "options" in m && Array.isArray(m.options) ? l.push(
|
|
780
|
+
{ label: m.label, isOptGroup: !0 },
|
|
781
|
+
...m.options.map(
|
|
791
782
|
(c) => typeof c == "string" || typeof c == "number" || typeof c == "boolean" ? Y(c) : J(c)
|
|
792
783
|
)
|
|
793
|
-
) : l.push(J(
|
|
784
|
+
) : l.push(J(m));
|
|
794
785
|
return l;
|
|
795
|
-
}),
|
|
786
|
+
}), S = h(
|
|
796
787
|
() => {
|
|
797
788
|
var l;
|
|
798
|
-
return ((l = g.value) == null ? void 0 : l.filter((d) => t.multiple ? Array.isArray(t.modelValue) ? t.modelValue.includes(d[t.optionValueKey]) && !
|
|
789
|
+
return ((l = g.value) == null ? void 0 : l.filter((d) => t.multiple ? Array.isArray(t.modelValue) ? t.modelValue.includes(d[t.optionValueKey]) && !A(d[t.optionValueKey]) : !1 : t.modelValue === d[t.optionValueKey] && !A(d[t.optionValueKey]))) ?? [];
|
|
799
790
|
}
|
|
800
791
|
);
|
|
801
792
|
lo(() => {
|
|
802
793
|
var l;
|
|
803
|
-
(l = t.options) != null && l.length || console.warn("[maz-ui](MazSelect) you must provide options"),
|
|
794
|
+
(l = t.options) != null && l.length || console.warn("[maz-ui](MazSelect) you must provide options"), pe();
|
|
804
795
|
});
|
|
805
|
-
const C =
|
|
806
|
-
function
|
|
796
|
+
const C = k(), W = k(), Z = k(), s = k();
|
|
797
|
+
function A(l) {
|
|
807
798
|
return l == null;
|
|
808
799
|
}
|
|
809
800
|
function K(l) {
|
|
810
|
-
var
|
|
811
|
-
return (((
|
|
801
|
+
var m;
|
|
802
|
+
return (((m = S.value) == null ? void 0 : m.some(
|
|
812
803
|
(c) => c[t.optionValueKey] === l[t.optionValueKey]
|
|
813
|
-
)) ?? !1) && !
|
|
804
|
+
)) ?? !1) && !A(l[t.optionValueKey]);
|
|
814
805
|
}
|
|
815
806
|
const T = h(() => {
|
|
816
807
|
var d;
|
|
817
808
|
if (t.multiple && t.modelValue && Array.isArray(t.modelValue))
|
|
818
809
|
return t.modelValue.map(
|
|
819
|
-
(
|
|
820
|
-
var c,
|
|
821
|
-
return (
|
|
810
|
+
(m) => {
|
|
811
|
+
var c, I;
|
|
812
|
+
return (I = (c = g.value) == null ? void 0 : c.find((B) => B[t.optionValueKey] === m)) == null ? void 0 : I[t.optionInputValueKey];
|
|
822
813
|
}
|
|
823
814
|
).join(", ");
|
|
824
815
|
const l = (d = g.value) == null ? void 0 : d.find(
|
|
825
|
-
(
|
|
816
|
+
(m) => m[t.optionValueKey] === t.modelValue
|
|
826
817
|
);
|
|
827
|
-
return
|
|
818
|
+
return A(t.modelValue) || l == null ? void 0 : l[t.optionInputValueKey];
|
|
828
819
|
}), te = h(
|
|
829
820
|
() => t.listPosition.includes("bottom") ? "maz-slide" : "maz-slideinvert"
|
|
830
|
-
), X =
|
|
821
|
+
), X = k(""), n = k("");
|
|
831
822
|
function M(l, d) {
|
|
832
|
-
return d && l &&
|
|
823
|
+
return d && l && me(l).includes(me(d));
|
|
833
824
|
}
|
|
834
825
|
function x(l) {
|
|
835
826
|
var d;
|
|
836
|
-
return l ? (d = g.value) == null ? void 0 : d.filter((
|
|
837
|
-
const c =
|
|
838
|
-
return M(c, l) || M(B, l) || M(
|
|
827
|
+
return l ? (d = g.value) == null ? void 0 : d.filter((m) => {
|
|
828
|
+
const c = m[t.optionLabelKey], I = m[t.optionValueKey], B = m[t.optionInputValueKey], R = t.searchThreshold;
|
|
829
|
+
return M(c, l) || M(B, l) || M(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;
|
|
839
830
|
}) : g.value;
|
|
840
831
|
}
|
|
841
832
|
const Q = h(() => x(X.value));
|
|
842
833
|
async function le(l) {
|
|
843
|
-
var
|
|
844
|
-
if (!
|
|
834
|
+
var m, c;
|
|
835
|
+
if (!w.value)
|
|
845
836
|
return;
|
|
846
|
-
if (l && ("relatedTarget" in l && ((
|
|
837
|
+
if (l && ("relatedTarget" in l && ((m = C.value) != null && m.contains(l.relatedTarget)) || l.type === "keydown"))
|
|
847
838
|
return l.preventDefault();
|
|
848
839
|
const d = l && "relatedTarget" in l && l.relatedTarget instanceof HTMLElement && l.relatedTarget.getAttribute("id");
|
|
849
840
|
if ((c = t.excludeSelectors) != null && c.includes(`#${d}`))
|
|
850
841
|
return l == null ? void 0 : l.preventDefault();
|
|
851
|
-
await ie(),
|
|
842
|
+
await ie(), L.value = !1, y.value = 0, r("close", l);
|
|
852
843
|
}
|
|
853
|
-
async function
|
|
854
|
-
t.disabled ||
|
|
844
|
+
async function ae(l) {
|
|
845
|
+
t.disabled || w.value || (l == null || l.preventDefault(), L.value = !0, await fe(), r("focus", l), r("open", L.value));
|
|
855
846
|
}
|
|
856
847
|
function we() {
|
|
857
848
|
var l, d;
|
|
858
849
|
(d = ((l = W.value) == null ? void 0 : l.$el).querySelector("input")) == null || d.focus();
|
|
859
850
|
}
|
|
860
|
-
function
|
|
851
|
+
function De() {
|
|
861
852
|
var l, d;
|
|
862
853
|
(d = ((l = W.value) == null ? void 0 : l.$el).querySelector("input")) == null || d.dispatchEvent(new Event("input"));
|
|
863
854
|
}
|
|
864
|
-
function
|
|
865
|
-
|
|
855
|
+
function Re(l) {
|
|
856
|
+
L.value ? le(l) : we();
|
|
866
857
|
}
|
|
867
858
|
function qe(l) {
|
|
868
|
-
var d,
|
|
869
|
-
X.value = l, (
|
|
859
|
+
var d, m;
|
|
860
|
+
X.value = l, (m = ((d = Z.value) == null ? void 0 : d.$el).querySelector("input")) == null || m.focus();
|
|
870
861
|
}
|
|
871
862
|
function je(l) {
|
|
872
|
-
var
|
|
873
|
-
l === "Backspace" &&
|
|
874
|
-
const d = x(
|
|
875
|
-
d != null && d.length && (
|
|
863
|
+
var m;
|
|
864
|
+
l === "Backspace" && n.value.length > 0 ? n.value = n.value.slice(0, -1) : n.value += l;
|
|
865
|
+
const d = x(n.value);
|
|
866
|
+
d != null && d.length && (y.value = (m = Q.value) == null ? void 0 : m.findIndex(
|
|
876
867
|
(c) => c[t.optionValueKey] === d[0][t.optionValueKey]
|
|
877
|
-
), typeof
|
|
878
|
-
|
|
868
|
+
), typeof y.value == "number" && y.value >= 0 && fe(y.value)), ko(() => {
|
|
869
|
+
n.value = "";
|
|
879
870
|
}, 1e3);
|
|
880
871
|
}
|
|
881
872
|
function Ye(l) {
|
|
882
873
|
const d = l.key;
|
|
883
|
-
/^[\dA-Za-z\u0400-\u04FF]$/.test(d) ? (l.preventDefault(),
|
|
874
|
+
/^[\dA-Za-z\u0400-\u04FF]$/.test(d) ? (l.preventDefault(), ae(l), t.search ? qe(d) : je(d)) : Se(l);
|
|
884
875
|
}
|
|
885
876
|
function Se(l, d = !0) {
|
|
886
|
-
const
|
|
887
|
-
c ? We(l,
|
|
877
|
+
const m = l.code, c = ["ArrowUp", "ArrowDown"].includes(m), I = (d ? ["Enter", "Space"] : ["Enter"]).includes(m), B = m === "Escape" && w.value;
|
|
878
|
+
c ? We(l, y.value) : I ? Qe(l, y.value) : B && le(l);
|
|
888
879
|
}
|
|
889
880
|
function We(l, d) {
|
|
890
|
-
var
|
|
881
|
+
var I;
|
|
891
882
|
l.preventDefault();
|
|
892
|
-
const
|
|
893
|
-
|
|
894
|
-
const c = (
|
|
895
|
-
c && (typeof d == "number" ? d === c - 1 &&
|
|
883
|
+
const m = l.code;
|
|
884
|
+
w.value || ae(l);
|
|
885
|
+
const c = (I = Q.value) == null ? void 0 : I.length;
|
|
886
|
+
c && (typeof d == "number" ? d === c - 1 && m === "ArrowDown" ? y.value = 0 : d === 0 && m === "ArrowUp" ? y.value = c - 1 : y.value = m === "ArrowDown" ? d + 1 : d - 1 : y.value = m === "ArrowDown" ? 0 : c - 1, fe(y.value));
|
|
896
887
|
}
|
|
897
888
|
function Qe(l, d) {
|
|
898
|
-
var c,
|
|
899
|
-
if (l.preventDefault(), !
|
|
900
|
-
return
|
|
901
|
-
const
|
|
902
|
-
|
|
889
|
+
var c, I, B;
|
|
890
|
+
if (l.preventDefault(), !w.value)
|
|
891
|
+
return ae(l);
|
|
892
|
+
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];
|
|
893
|
+
A(m) || Ve(m);
|
|
903
894
|
}
|
|
904
|
-
async function
|
|
905
|
-
var
|
|
906
|
-
await ie(), typeof l != "number" &&
|
|
907
|
-
const d = l ??
|
|
895
|
+
async function fe(l) {
|
|
896
|
+
var m, c;
|
|
897
|
+
await ie(), typeof l != "number" && pe();
|
|
898
|
+
const d = l ?? y.value;
|
|
908
899
|
if (typeof d == "number" && d >= 0) {
|
|
909
|
-
const
|
|
910
|
-
(c =
|
|
900
|
+
const I = (m = s.value) == null ? void 0 : m.querySelectorAll(".m-select-list-item");
|
|
901
|
+
(c = I == null ? void 0 : I[d]) == null || c.scrollIntoView({
|
|
911
902
|
behavior: "auto",
|
|
912
903
|
block: "nearest",
|
|
913
904
|
inline: "start"
|
|
914
905
|
});
|
|
915
906
|
}
|
|
916
907
|
}
|
|
917
|
-
function
|
|
918
|
-
var
|
|
919
|
-
const d = (
|
|
920
|
-
var
|
|
921
|
-
return t.multiple && Array.isArray(t.modelValue) ? l ? l[t.optionValueKey] === c[t.optionValueKey] : [...t.modelValue].reverse()[0] === c[t.optionValueKey] : ((B = (
|
|
908
|
+
function pe(l) {
|
|
909
|
+
var m;
|
|
910
|
+
const d = (m = Q.value) == null ? void 0 : m.findIndex((c) => {
|
|
911
|
+
var I, B;
|
|
912
|
+
return t.multiple && Array.isArray(t.modelValue) ? l ? l[t.optionValueKey] === c[t.optionValueKey] : [...t.modelValue].reverse()[0] === c[t.optionValueKey] : ((B = (I = S.value) == null ? void 0 : I[0]) == null ? void 0 : B[t.optionValueKey]) === c[t.optionValueKey];
|
|
922
913
|
});
|
|
923
|
-
|
|
914
|
+
y.value = d && d >= 0 ? d : 0;
|
|
924
915
|
}
|
|
925
916
|
function Ve(l, d = !0) {
|
|
926
917
|
var B;
|
|
927
918
|
d && !t.multiple && ie(() => le()), X.value = "";
|
|
928
|
-
const
|
|
929
|
-
(
|
|
919
|
+
const m = (B = S.value) == null ? void 0 : B.some(
|
|
920
|
+
(R) => R[t.optionValueKey] === l[t.optionValueKey]
|
|
930
921
|
);
|
|
931
|
-
let c =
|
|
932
|
-
|
|
933
|
-
(
|
|
922
|
+
let c = S.value;
|
|
923
|
+
m && t.multiple ? c = c == null ? void 0 : c.filter(
|
|
924
|
+
(R) => R[t.optionValueKey] !== l[t.optionValueKey]
|
|
934
925
|
) : t.multiple ? c.push(l) : c = [l];
|
|
935
|
-
const
|
|
936
|
-
r("update:model-value", t.multiple ?
|
|
926
|
+
const I = c.map((R) => R[t.optionValueKey]);
|
|
927
|
+
r("update:model-value", t.multiple ? I : I[0]), r("selected-option", l), De(), pe(l), we();
|
|
937
928
|
}
|
|
938
929
|
return (l, d) => {
|
|
939
|
-
var
|
|
940
|
-
return ze((b(),
|
|
930
|
+
var m;
|
|
931
|
+
return ze((b(), E(
|
|
941
932
|
"div",
|
|
942
933
|
{
|
|
943
934
|
ref_key: "mazSelectElement",
|
|
944
935
|
ref: C,
|
|
945
936
|
class: F(["m-select", [
|
|
946
|
-
{ "--is-open":
|
|
937
|
+
{ "--is-open": w.value, "--disabled": l.disabled, "--block": l.block },
|
|
947
938
|
t.class,
|
|
948
939
|
`--${l.size}`
|
|
949
940
|
]]),
|
|
@@ -951,22 +942,22 @@ const Eo = {
|
|
|
951
942
|
},
|
|
952
943
|
[
|
|
953
944
|
H(Ce, oe({
|
|
954
|
-
id:
|
|
945
|
+
id: P(D),
|
|
955
946
|
ref_key: "mazInputComponent",
|
|
956
947
|
ref: W,
|
|
957
948
|
class: "m-select-input"
|
|
958
949
|
}, l.$attrs, {
|
|
959
950
|
required: l.required,
|
|
960
|
-
"border-active":
|
|
951
|
+
"border-active": L.value,
|
|
961
952
|
color: l.color,
|
|
962
953
|
"model-value": T.value,
|
|
963
954
|
size: l.size,
|
|
964
955
|
block: "",
|
|
965
956
|
autocomplete: l.autocomplete,
|
|
966
957
|
disabled: l.disabled,
|
|
967
|
-
onFocus: ae
|
|
968
|
-
onBlur:
|
|
969
|
-
onClick: ae
|
|
958
|
+
onFocus: se(ae, ["prevent", "stop"]),
|
|
959
|
+
onBlur: se(le, ["prevent", "stop"]),
|
|
960
|
+
onClick: se(ae, ["prevent", "stop"]),
|
|
970
961
|
onChange: d[0] || (d[0] = (c) => r("change", c)),
|
|
971
962
|
onInput: d[1] || (d[1] = (c) => r("input", c)),
|
|
972
963
|
onKeydown: Ye
|
|
@@ -976,23 +967,23 @@ const Eo = {
|
|
|
976
967
|
tabindex: "-1",
|
|
977
968
|
type: "button",
|
|
978
969
|
class: "m-select-input__toggle-button maz-custom",
|
|
979
|
-
"aria-label": `${
|
|
980
|
-
onClick:
|
|
970
|
+
"aria-label": `${w.value ? "collapse" : "expand"} list of options`,
|
|
971
|
+
onClick: se(Re, ["stop"])
|
|
981
972
|
}, [
|
|
982
|
-
H(
|
|
973
|
+
H(P(f), { class: "m-select-chevron maz-text-xl" })
|
|
983
974
|
], 8, To)
|
|
984
975
|
]),
|
|
985
976
|
_: 1
|
|
986
977
|
/* STABLE */
|
|
987
978
|
}, 16, ["id", "required", "border-active", "color", "model-value", "size", "autocomplete", "disabled"]),
|
|
988
|
-
H(
|
|
979
|
+
H(ao, { name: te.value }, {
|
|
989
980
|
default: G(() => [
|
|
990
|
-
|
|
981
|
+
w.value ? (b(), E(
|
|
991
982
|
"div",
|
|
992
983
|
{
|
|
993
984
|
key: 0,
|
|
994
985
|
ref_key: "optionsListElement",
|
|
995
|
-
ref:
|
|
986
|
+
ref: s,
|
|
996
987
|
class: F(["m-select-list", {
|
|
997
988
|
"--top": l.listPosition.includes("top"),
|
|
998
989
|
"--left": l.listPosition.includes("left"),
|
|
@@ -1014,7 +1005,7 @@ const Eo = {
|
|
|
1014
1005
|
modelValue: X.value,
|
|
1015
1006
|
"onUpdate:modelValue": [
|
|
1016
1007
|
d[2] || (d[2] = (c) => X.value = c),
|
|
1017
|
-
d[4] || (d[4] = (c) =>
|
|
1008
|
+
d[4] || (d[4] = (c) => y.value = 0)
|
|
1018
1009
|
],
|
|
1019
1010
|
size: "sm",
|
|
1020
1011
|
color: l.color,
|
|
@@ -1024,28 +1015,21 @@ const Eo = {
|
|
|
1024
1015
|
autocomplete: "off",
|
|
1025
1016
|
tabindex: "-1",
|
|
1026
1017
|
class: "m-select-list__search-input maz-flex-none",
|
|
1027
|
-
"left-icon":
|
|
1018
|
+
"left-icon": P(v),
|
|
1028
1019
|
onKeydown: d[3] || (d[3] = (c) => Se(c, !1))
|
|
1029
|
-
}, null, 8, ["modelValue", "color", "placeholder", "left-icon"])) :
|
|
1030
|
-
z(`
|
|
1031
|
-
@slot No results slot - Displayed when no results corresponding with search query
|
|
1032
|
-
`),
|
|
1020
|
+
}, null, 8, ["modelValue", "color", "placeholder", "left-icon"])) : $("v-if", !0),
|
|
1033
1021
|
!Q.value || Q.value.length <= 0 ? N(l.$slots, "no-results", { key: 1 }, () => [
|
|
1034
1022
|
j("span", Fo, [
|
|
1035
|
-
H(
|
|
1023
|
+
H(P(O), { class: "maz-h-6 maz-w-6 maz-text-normal" })
|
|
1036
1024
|
])
|
|
1037
|
-
], !0) : (b(),
|
|
1038
|
-
(b(!0),
|
|
1025
|
+
], !0) : (b(), E("div", No, [
|
|
1026
|
+
(b(!0), E(
|
|
1039
1027
|
be,
|
|
1040
1028
|
null,
|
|
1041
|
-
Be(Q.value, (c,
|
|
1029
|
+
Be(Q.value, (c, I) => (b(), E(
|
|
1042
1030
|
be,
|
|
1043
|
-
{ key:
|
|
1031
|
+
{ key: I },
|
|
1044
1032
|
[
|
|
1045
|
-
z(`
|
|
1046
|
-
@slot Custom optgroup label
|
|
1047
|
-
@binding {String} label - the label of the optgroup
|
|
1048
|
-
`),
|
|
1049
1033
|
c.label && c.isOptGroup ? N(l.$slots, "optgroup", {
|
|
1050
1034
|
key: 0,
|
|
1051
1035
|
label: c.label
|
|
@@ -1057,32 +1041,27 @@ const Eo = {
|
|
|
1057
1041
|
1
|
|
1058
1042
|
/* TEXT */
|
|
1059
1043
|
)
|
|
1060
|
-
], !0) : (b(),
|
|
1044
|
+
], !0) : (b(), E("button", {
|
|
1061
1045
|
key: 1,
|
|
1062
1046
|
tabindex: "-1",
|
|
1063
1047
|
type: "button",
|
|
1064
1048
|
class: F(["m-select-list-item maz-custom maz-flex-none", [
|
|
1065
1049
|
{
|
|
1066
|
-
"--is-keyboard-selected":
|
|
1050
|
+
"--is-keyboard-selected": y.value === I,
|
|
1067
1051
|
"--is-selected": K(c),
|
|
1068
|
-
"--is-none-value":
|
|
1052
|
+
"--is-none-value": A(c[l.optionValueKey])
|
|
1069
1053
|
}
|
|
1070
1054
|
]]),
|
|
1071
1055
|
style: ee(l.itemHeight ? { height: `${l.itemHeight}px` } : void 0),
|
|
1072
|
-
onClick:
|
|
1056
|
+
onClick: se((B) => Ve(c), ["prevent", "stop"])
|
|
1073
1057
|
}, [
|
|
1074
|
-
l.multiple ? (b(), U(
|
|
1058
|
+
l.multiple ? (b(), U(P(u), {
|
|
1075
1059
|
key: 0,
|
|
1076
1060
|
tabindex: "-1",
|
|
1077
1061
|
"model-value": K(c),
|
|
1078
1062
|
size: "sm",
|
|
1079
1063
|
color: l.color
|
|
1080
|
-
}, null, 8, ["model-value", "color"])) :
|
|
1081
|
-
z(`
|
|
1082
|
-
@slot Custom option
|
|
1083
|
-
@binding {Object} option - the option object
|
|
1084
|
-
@binding {Boolean} is-selected - if the option is selected
|
|
1085
|
-
`),
|
|
1064
|
+
}, null, 8, ["model-value", "color"])) : $("v-if", !0),
|
|
1086
1065
|
N(l.$slots, "default", {
|
|
1087
1066
|
option: c,
|
|
1088
1067
|
isSelected: K(c)
|
|
@@ -1107,7 +1086,7 @@ const Eo = {
|
|
|
1107
1086
|
],
|
|
1108
1087
|
6
|
|
1109
1088
|
/* CLASS, STYLE */
|
|
1110
|
-
)) :
|
|
1089
|
+
)) : $("v-if", !0)
|
|
1111
1090
|
]),
|
|
1112
1091
|
_: 3
|
|
1113
1092
|
/* FORWARDED */
|
|
@@ -1116,63 +1095,63 @@ const Eo = {
|
|
|
1116
1095
|
6
|
|
1117
1096
|
/* CLASS, STYLE */
|
|
1118
1097
|
)), [
|
|
1119
|
-
[
|
|
1120
|
-
exclude: (
|
|
1098
|
+
[P(Vo), {
|
|
1099
|
+
exclude: (m = l.excludeSelectors) != null && m.length ? l.excludeSelectors : [],
|
|
1121
1100
|
handler: le
|
|
1122
1101
|
}]
|
|
1123
1102
|
]);
|
|
1124
1103
|
};
|
|
1125
1104
|
}
|
|
1126
|
-
}),
|
|
1105
|
+
}), Do = /* @__PURE__ */ re(Ho, [["__scopeId", "data-v-e35a36a6"]]);
|
|
1127
1106
|
function Ke() {
|
|
1128
1107
|
if (typeof window > "u")
|
|
1129
1108
|
return;
|
|
1130
|
-
const
|
|
1131
|
-
if (!
|
|
1109
|
+
const a = window.navigator.language;
|
|
1110
|
+
if (!a)
|
|
1132
1111
|
return;
|
|
1133
|
-
let o =
|
|
1134
|
-
return o === "" && (o =
|
|
1112
|
+
let o = a.slice(3, 7).toUpperCase();
|
|
1113
|
+
return o === "" && (o = a.slice(0, 2).toUpperCase()), o === "EN" && (o = "US"), o === "JA" && (o = "JP"), {
|
|
1135
1114
|
locale: o,
|
|
1136
|
-
browserLocale:
|
|
1115
|
+
browserLocale: a
|
|
1137
1116
|
};
|
|
1138
1117
|
}
|
|
1139
1118
|
let ge, $e;
|
|
1140
|
-
function
|
|
1141
|
-
return e != null && e[o] ? e[o] : (($e !==
|
|
1119
|
+
function Ro(a, o, e) {
|
|
1120
|
+
return e != null && e[o] ? e[o] : (($e !== a || !ge) && ($e = a, ge = new Intl.DisplayNames([a], { type: "region" })), ge.of(o));
|
|
1142
1121
|
}
|
|
1143
|
-
function qo(
|
|
1122
|
+
function qo(a, o) {
|
|
1144
1123
|
var r;
|
|
1145
1124
|
const e = [], t = Oe();
|
|
1146
|
-
|
|
1125
|
+
a = a ?? ((r = Ke()) == null ? void 0 : r.browserLocale) ?? "en-US";
|
|
1147
1126
|
for (const u of t) {
|
|
1148
|
-
const
|
|
1149
|
-
if (
|
|
1127
|
+
const v = Ro(a, u, o);
|
|
1128
|
+
if (v)
|
|
1150
1129
|
try {
|
|
1151
|
-
const
|
|
1130
|
+
const f = ce(u);
|
|
1152
1131
|
e.push({
|
|
1153
1132
|
iso2: u,
|
|
1154
|
-
dialCode:
|
|
1155
|
-
name:
|
|
1133
|
+
dialCode: f,
|
|
1134
|
+
name: v
|
|
1156
1135
|
});
|
|
1157
|
-
} catch (
|
|
1158
|
-
console.error(`[MazPhoneNumberInput](getCountryCallingCode) ${
|
|
1136
|
+
} catch (f) {
|
|
1137
|
+
console.error(`[MazPhoneNumberInput](getCountryCallingCode) ${f}`);
|
|
1159
1138
|
}
|
|
1160
1139
|
}
|
|
1161
1140
|
return e;
|
|
1162
1141
|
}
|
|
1163
1142
|
async function jo() {
|
|
1164
1143
|
try {
|
|
1165
|
-
const
|
|
1144
|
+
const a = await fetch("https://ipwho.is"), { country_code: o } = await a.json();
|
|
1166
1145
|
return o;
|
|
1167
|
-
} catch (
|
|
1168
|
-
throw new Error(`[MazPhoneNumberInput](fetchCountryCode) ${
|
|
1146
|
+
} catch (a) {
|
|
1147
|
+
throw new Error(`[MazPhoneNumberInput](fetchCountryCode) ${a}`);
|
|
1169
1148
|
}
|
|
1170
1149
|
}
|
|
1171
|
-
function Yo(
|
|
1172
|
-
if (!
|
|
1150
|
+
function Yo(a) {
|
|
1151
|
+
if (!a)
|
|
1173
1152
|
return "";
|
|
1174
1153
|
const o = new RegExp(/[^\d ()+-]/g);
|
|
1175
|
-
return
|
|
1154
|
+
return a.replaceAll(o, "").trim();
|
|
1176
1155
|
}
|
|
1177
1156
|
function Ue() {
|
|
1178
1157
|
return {
|
|
@@ -1185,7 +1164,7 @@ function Ue() {
|
|
|
1185
1164
|
const Wo = ["id"], Qo = {
|
|
1186
1165
|
key: 0,
|
|
1187
1166
|
class: "m-country-selector__select__item__flag-container"
|
|
1188
|
-
}, Go = /* @__PURE__ */
|
|
1167
|
+
}, Go = /* @__PURE__ */ ne({
|
|
1189
1168
|
__name: "CountrySelector",
|
|
1190
1169
|
props: {
|
|
1191
1170
|
style: { default: void 0 },
|
|
@@ -1213,56 +1192,56 @@ const Wo = ["id"], Qo = {
|
|
|
1213
1192
|
excludeSelectors: { default: void 0 }
|
|
1214
1193
|
},
|
|
1215
1194
|
emits: ["update:model-value"],
|
|
1216
|
-
setup(
|
|
1217
|
-
const o =
|
|
1195
|
+
setup(a) {
|
|
1196
|
+
const o = a, { phoneNumber: e } = Me("data"), t = k(), { getCountriesList: r } = Ue(), u = h(() => r(o.countryLocale, o.customCountriesList)), v = h(
|
|
1218
1197
|
() => {
|
|
1219
1198
|
var i;
|
|
1220
|
-
return (i = u.value) == null ? void 0 : i.filter((
|
|
1221
|
-
var
|
|
1222
|
-
return !((
|
|
1199
|
+
return (i = u.value) == null ? void 0 : i.filter((p) => {
|
|
1200
|
+
var z;
|
|
1201
|
+
return !((z = o.ignoredCountries) != null && z.includes(p.iso2));
|
|
1223
1202
|
});
|
|
1224
1203
|
}
|
|
1225
|
-
),
|
|
1204
|
+
), f = h(() => {
|
|
1226
1205
|
const i = o.onlyCountries || o.preferredCountries;
|
|
1227
1206
|
return i == null ? void 0 : i.map(
|
|
1228
|
-
(
|
|
1229
|
-
var
|
|
1230
|
-
return (
|
|
1207
|
+
(p) => {
|
|
1208
|
+
var z;
|
|
1209
|
+
return (z = v.value) == null ? void 0 : z.find((w) => w.iso2.includes(p));
|
|
1231
1210
|
}
|
|
1232
1211
|
);
|
|
1233
1212
|
}), O = h(
|
|
1234
1213
|
() => {
|
|
1235
1214
|
var i;
|
|
1236
|
-
return (i =
|
|
1237
|
-
var
|
|
1238
|
-
return !((
|
|
1215
|
+
return (i = v.value) == null ? void 0 : i.filter((p) => {
|
|
1216
|
+
var z;
|
|
1217
|
+
return !((z = o.preferredCountries) != null && z.includes(p.iso2));
|
|
1239
1218
|
});
|
|
1240
1219
|
}
|
|
1241
|
-
),
|
|
1242
|
-
() => o.preferredCountries ? [...
|
|
1243
|
-
),
|
|
1220
|
+
), L = h(
|
|
1221
|
+
() => o.preferredCountries ? [...f.value ?? [], ...O.value ?? []] : o.onlyCountries ? f.value : v.value
|
|
1222
|
+
), y = h(
|
|
1244
1223
|
() => {
|
|
1245
1224
|
var i;
|
|
1246
|
-
return (i =
|
|
1247
|
-
(
|
|
1248
|
-
...
|
|
1249
|
-
dialCode: `+${
|
|
1225
|
+
return (i = L.value) == null ? void 0 : i.map(
|
|
1226
|
+
(p) => p ? {
|
|
1227
|
+
...p,
|
|
1228
|
+
dialCode: `+${p.dialCode}`
|
|
1250
1229
|
} : void 0
|
|
1251
|
-
).filter(
|
|
1230
|
+
).filter(mo);
|
|
1252
1231
|
}
|
|
1253
1232
|
);
|
|
1254
|
-
async function
|
|
1255
|
-
var i,
|
|
1256
|
-
(
|
|
1233
|
+
async function V() {
|
|
1234
|
+
var i, p;
|
|
1235
|
+
(p = (i = t.value) == null ? void 0 : i.$el.querySelector("input")) == null || p.focus();
|
|
1257
1236
|
}
|
|
1258
|
-
return (i,
|
|
1237
|
+
return (i, p) => (b(), E(
|
|
1259
1238
|
"div",
|
|
1260
1239
|
{
|
|
1261
1240
|
class: F(["m-country-selector", [o.class, { "--no-flags": i.noFlags }]]),
|
|
1262
1241
|
style: ee(i.style)
|
|
1263
1242
|
},
|
|
1264
1243
|
[
|
|
1265
|
-
i.modelValue && !i.noFlags ? (b(),
|
|
1244
|
+
i.modelValue && !i.noFlags ? (b(), E("button", {
|
|
1266
1245
|
key: 0,
|
|
1267
1246
|
id: `country-selector-flag-button-${i.id}`,
|
|
1268
1247
|
class: F(["m-country-selector__country-flag", {
|
|
@@ -1270,23 +1249,19 @@ const Wo = ["id"], Qo = {
|
|
|
1270
1249
|
}]),
|
|
1271
1250
|
tabindex: "-1",
|
|
1272
1251
|
type: "button",
|
|
1273
|
-
onClick:
|
|
1252
|
+
onClick: V
|
|
1274
1253
|
}, [
|
|
1275
|
-
z(`
|
|
1276
|
-
@slot Country selector flag
|
|
1277
|
-
@binding {String} country-code - current selected country code - Ex: \`"FR"\`
|
|
1278
|
-
`),
|
|
1279
1254
|
N(i.$slots, "selector-flag", { countryCode: i.modelValue }, () => [
|
|
1280
1255
|
H(Le, {
|
|
1281
|
-
src:
|
|
1256
|
+
src: P(Ee)(i.modelValue, "h20"),
|
|
1282
1257
|
alt: i.modelValue,
|
|
1283
1258
|
width: "20",
|
|
1284
1259
|
height: "20",
|
|
1285
1260
|
"img-class": "maz-w-5 maz-h-4 maz-rounded-sm"
|
|
1286
1261
|
}, null, 8, ["src", "alt"])
|
|
1287
1262
|
], !0)
|
|
1288
|
-
], 10, Wo)) :
|
|
1289
|
-
H(
|
|
1263
|
+
], 10, Wo)) : $("v-if", !0),
|
|
1264
|
+
H(Do, oe({
|
|
1290
1265
|
id: `country-selector-${i.id}`,
|
|
1291
1266
|
ref_key: "CountrySelectorRef",
|
|
1292
1267
|
ref: t,
|
|
@@ -1308,64 +1283,58 @@ const Wo = ["id"], Qo = {
|
|
|
1308
1283
|
search: !i.noSearch,
|
|
1309
1284
|
"search-placeholder": i.locales.countrySelector.searchPlaceholder,
|
|
1310
1285
|
"search-threshold": i.searchThreshold,
|
|
1311
|
-
options:
|
|
1312
|
-
hint:
|
|
1286
|
+
options: y.value,
|
|
1287
|
+
hint: P(e) && !i.modelValue ? i.locales.countrySelector.error : void 0,
|
|
1313
1288
|
label: i.locales.countrySelector.placeholder,
|
|
1314
1289
|
style: {
|
|
1315
1290
|
width: i.width
|
|
1316
1291
|
},
|
|
1317
1292
|
"exclude-selectors": [`#country-selector-flag-button-${i.id}`, ...i.excludeSelectors ?? []],
|
|
1318
|
-
"onUpdate:modelValue":
|
|
1293
|
+
"onUpdate:modelValue": p[0] || (p[0] = (z) => i.$emit("update:model-value", z))
|
|
1319
1294
|
}), {
|
|
1320
1295
|
"no-results": G(() => [
|
|
1321
1296
|
N(i.$slots, "no-results", {}, void 0, !0)
|
|
1322
1297
|
]),
|
|
1323
|
-
default: G(({ option:
|
|
1298
|
+
default: G(({ option: z, isSelected: w }) => [
|
|
1324
1299
|
j(
|
|
1325
1300
|
"div",
|
|
1326
1301
|
{
|
|
1327
1302
|
class: F(["m-country-selector__select__item", {
|
|
1328
|
-
"m-country-selector__select__item--selected":
|
|
1303
|
+
"m-country-selector__select__item--selected": w
|
|
1329
1304
|
}])
|
|
1330
1305
|
},
|
|
1331
1306
|
[
|
|
1332
|
-
!i.noFlags && typeof
|
|
1333
|
-
z(`
|
|
1334
|
-
@slot Country list flag
|
|
1335
|
-
@binding {String} country-code - country code of option - Ex: \`"FR"\`
|
|
1336
|
-
@binding {{ iso2: string; dialCode: string; name: string; }} option - country data
|
|
1337
|
-
@binding {Boolean} is-selected - \`true\` if option is selected
|
|
1338
|
-
`),
|
|
1307
|
+
!i.noFlags && typeof z.iso2 == "string" ? (b(), E("span", Qo, [
|
|
1339
1308
|
N(i.$slots, "country-list-flag", {
|
|
1340
|
-
countryCode:
|
|
1341
|
-
option:
|
|
1342
|
-
isSelected:
|
|
1309
|
+
countryCode: z.iso2,
|
|
1310
|
+
option: z,
|
|
1311
|
+
isSelected: w
|
|
1343
1312
|
}, () => [
|
|
1344
1313
|
H(Le, {
|
|
1345
|
-
src:
|
|
1346
|
-
alt: `${
|
|
1314
|
+
src: P(Ee)(z.iso2, "h20"),
|
|
1315
|
+
alt: `${z.name} flag`,
|
|
1347
1316
|
width: "20",
|
|
1348
1317
|
height: "20",
|
|
1349
1318
|
"img-class": "maz-rounded-full maz-w-5 maz-h-5"
|
|
1350
1319
|
}, null, 8, ["src", "alt"])
|
|
1351
1320
|
], !0)
|
|
1352
|
-
])) :
|
|
1353
|
-
i.showCodeOnList ? (b(),
|
|
1321
|
+
])) : $("v-if", !0),
|
|
1322
|
+
i.showCodeOnList ? (b(), E(
|
|
1354
1323
|
"span",
|
|
1355
1324
|
{
|
|
1356
1325
|
key: 1,
|
|
1357
|
-
class: F(["maz-w-9 maz-flex-none", { "maz-text-muted": !
|
|
1326
|
+
class: F(["maz-w-9 maz-flex-none", { "maz-text-muted": !w }])
|
|
1358
1327
|
},
|
|
1359
|
-
ue(
|
|
1328
|
+
ue(z.dialCode),
|
|
1360
1329
|
3
|
|
1361
1330
|
/* TEXT, CLASS */
|
|
1362
|
-
)) :
|
|
1331
|
+
)) : $("v-if", !0),
|
|
1363
1332
|
j(
|
|
1364
1333
|
"span",
|
|
1365
1334
|
{
|
|
1366
|
-
class: F(["maz-flex-1 maz-truncate", { "maz-font-semibold":
|
|
1335
|
+
class: F(["maz-flex-1 maz-truncate", { "maz-font-semibold": w }])
|
|
1367
1336
|
},
|
|
1368
|
-
ue(
|
|
1337
|
+
ue(z.name),
|
|
1369
1338
|
3
|
|
1370
1339
|
/* TEXT, CLASS */
|
|
1371
1340
|
)
|
|
@@ -1393,25 +1362,25 @@ const Wo = ["id"], Qo = {
|
|
|
1393
1362
|
example: "Example:"
|
|
1394
1363
|
}
|
|
1395
1364
|
};
|
|
1396
|
-
function Xo(
|
|
1365
|
+
function Xo(a) {
|
|
1397
1366
|
try {
|
|
1398
|
-
const o = ro(
|
|
1399
|
-
return o || (console.error(`[maz-ui](MazPhoneNumberInput) The code country "${
|
|
1367
|
+
const o = ro(a);
|
|
1368
|
+
return o || (console.error(`[maz-ui](MazPhoneNumberInput) The code country "${a}" is not available`), !1);
|
|
1400
1369
|
} catch (o) {
|
|
1401
1370
|
return console.error(`[maz-ui](MazPhoneNumberInput) ${o}`), !1;
|
|
1402
1371
|
}
|
|
1403
1372
|
}
|
|
1404
1373
|
function xo({
|
|
1405
|
-
phoneNumber:
|
|
1374
|
+
phoneNumber: a,
|
|
1406
1375
|
countryCode: o
|
|
1407
1376
|
}) {
|
|
1408
1377
|
try {
|
|
1409
|
-
if (!
|
|
1378
|
+
if (!a)
|
|
1410
1379
|
return {
|
|
1411
1380
|
isValid: !1,
|
|
1412
1381
|
countryCode: o
|
|
1413
1382
|
};
|
|
1414
|
-
const e = io(
|
|
1383
|
+
const e = io(a, o);
|
|
1415
1384
|
return {
|
|
1416
1385
|
countryCode: (e == null ? void 0 : e.country) ?? o,
|
|
1417
1386
|
isValid: (e == null ? void 0 : e.isValid()) ?? !1,
|
|
@@ -1424,33 +1393,33 @@ function xo({
|
|
|
1424
1393
|
uri: e == null ? void 0 : e.getURI(),
|
|
1425
1394
|
e164: e == null ? void 0 : e.format("E.164"),
|
|
1426
1395
|
rfc3966: e == null ? void 0 : e.format("RFC3966"),
|
|
1427
|
-
phoneNumber:
|
|
1396
|
+
phoneNumber: a
|
|
1428
1397
|
};
|
|
1429
1398
|
} catch (e) {
|
|
1430
1399
|
throw new Error(`[MazPhoneNumberInput](getResultsFromPhoneNumber) ${e}`);
|
|
1431
1400
|
}
|
|
1432
1401
|
}
|
|
1433
|
-
function _o(
|
|
1402
|
+
function _o(a, o) {
|
|
1434
1403
|
try {
|
|
1435
|
-
return o ? new uo(
|
|
1404
|
+
return o ? new uo(a).input(o) : "";
|
|
1436
1405
|
} catch (e) {
|
|
1437
1406
|
throw new Error(`[MazPhoneNumberInput](getAsYouTypeFormat) ${e}`);
|
|
1438
1407
|
}
|
|
1439
1408
|
}
|
|
1440
1409
|
async function et() {
|
|
1441
|
-
const { default:
|
|
1442
|
-
return
|
|
1410
|
+
const { default: a } = await import("./examples.mobile.json-JpNGylGv.mjs");
|
|
1411
|
+
return a;
|
|
1443
1412
|
}
|
|
1444
|
-
function ot(
|
|
1413
|
+
function ot(a, o) {
|
|
1445
1414
|
var e;
|
|
1446
1415
|
try {
|
|
1447
|
-
return
|
|
1416
|
+
return a && o ? (e = co(o, a)) == null ? void 0 : e.formatNational() : void 0;
|
|
1448
1417
|
} catch (t) {
|
|
1449
1418
|
console.error(`[maz-ui](MazPhoneNumberInput) ${t}`);
|
|
1450
1419
|
}
|
|
1451
1420
|
}
|
|
1452
1421
|
function He() {
|
|
1453
|
-
function
|
|
1422
|
+
function a(o, e) {
|
|
1454
1423
|
return ce(o) === ce(e);
|
|
1455
1424
|
}
|
|
1456
1425
|
return {
|
|
@@ -1458,13 +1427,13 @@ function He() {
|
|
|
1458
1427
|
getPhoneNumberResults: xo,
|
|
1459
1428
|
getPhoneNumberExamplesFile: et,
|
|
1460
1429
|
getPhoneNumberExample: ot,
|
|
1461
|
-
isSameCountryCallingCode:
|
|
1430
|
+
isSameCountryCallingCode: a,
|
|
1462
1431
|
isCountryAvailable: Xo,
|
|
1463
1432
|
getCountries: Oe,
|
|
1464
1433
|
getCountryCallingCode: ce
|
|
1465
1434
|
};
|
|
1466
1435
|
}
|
|
1467
|
-
const tt = /* @__PURE__ */
|
|
1436
|
+
const tt = /* @__PURE__ */ ne({
|
|
1468
1437
|
__name: "PhoneInput",
|
|
1469
1438
|
props: /* @__PURE__ */ ke({
|
|
1470
1439
|
id: {},
|
|
@@ -1485,52 +1454,52 @@ const tt = /* @__PURE__ */ se({
|
|
|
1485
1454
|
modelModifiers: {}
|
|
1486
1455
|
}),
|
|
1487
1456
|
emits: /* @__PURE__ */ ke(["update:model-value"], ["update:modelValue"]),
|
|
1488
|
-
setup(
|
|
1489
|
-
const e =
|
|
1490
|
-
function i(g,
|
|
1491
|
-
const C =
|
|
1457
|
+
setup(a, { emit: o }) {
|
|
1458
|
+
const e = a, t = o, r = so(a, "modelValue"), { getPhoneNumberExamplesFile: u, getPhoneNumberExample: v } = He(), { selectionRange: f, results: O, selectedCountry: L } = Me("data"), y = k(), V = k(!1);
|
|
1459
|
+
function i(g, S) {
|
|
1460
|
+
const C = v(g, S);
|
|
1492
1461
|
return C ? `${e.locales.phoneInput.example} ${C}` : void 0;
|
|
1493
1462
|
}
|
|
1494
|
-
const
|
|
1495
|
-
var
|
|
1463
|
+
const p = h(() => {
|
|
1464
|
+
var S;
|
|
1496
1465
|
if (e.label || e.placeholder)
|
|
1497
1466
|
return e.label || e.placeholder;
|
|
1498
1467
|
const g = e.locales.phoneInput.placeholder;
|
|
1499
|
-
if (e.noExample || !
|
|
1468
|
+
if (e.noExample || !y.value)
|
|
1500
1469
|
return g;
|
|
1501
1470
|
{
|
|
1502
|
-
const C = i(
|
|
1503
|
-
return (
|
|
1471
|
+
const C = i(y.value, L.value);
|
|
1472
|
+
return (S = O.value) != null && S.isValid || !C ? g : C;
|
|
1504
1473
|
}
|
|
1505
|
-
}),
|
|
1506
|
-
placeholder:
|
|
1474
|
+
}), z = h(() => e.placeholder ? {
|
|
1475
|
+
placeholder: p.value
|
|
1507
1476
|
} : {
|
|
1508
|
-
label:
|
|
1509
|
-
}),
|
|
1510
|
-
async function
|
|
1477
|
+
label: p.value
|
|
1478
|
+
}), w = k();
|
|
1479
|
+
async function D() {
|
|
1511
1480
|
try {
|
|
1512
|
-
if (
|
|
1481
|
+
if (y.value)
|
|
1513
1482
|
return;
|
|
1514
|
-
|
|
1483
|
+
y.value = await u();
|
|
1515
1484
|
} catch (g) {
|
|
1516
1485
|
console.error("[maz-ui](MazPhoneNumberInput) while loading phone number examples file", g);
|
|
1517
1486
|
}
|
|
1518
1487
|
}
|
|
1519
1488
|
async function Y(g) {
|
|
1520
|
-
|
|
1489
|
+
w.value && g && J(w.value, g), await ie(), t("update:model-value", g);
|
|
1521
1490
|
}
|
|
1522
|
-
function J(g,
|
|
1491
|
+
function J(g, S) {
|
|
1523
1492
|
const C = g.$el.querySelector("input");
|
|
1524
|
-
|
|
1493
|
+
f.value.start = C == null ? void 0 : C.selectionStart, f.value.end = C == null ? void 0 : C.selectionEnd, f.value.cursorAtEnd = S && typeof f.value.start == "number" && S.length > 0 ? f.value.start >= S.length : !0;
|
|
1525
1494
|
}
|
|
1526
1495
|
return Ie(() => {
|
|
1527
|
-
e.noExample ||
|
|
1528
|
-
}), (g,
|
|
1496
|
+
e.noExample || D();
|
|
1497
|
+
}), (g, S) => (b(), U(Ce, oe({
|
|
1529
1498
|
id: g.id,
|
|
1530
1499
|
ref_key: "PhoneInputRef",
|
|
1531
|
-
ref:
|
|
1500
|
+
ref: w,
|
|
1532
1501
|
"model-value": r.value
|
|
1533
|
-
}, { ...g.$attrs, ...
|
|
1502
|
+
}, { ...g.$attrs, ...z.value }, {
|
|
1534
1503
|
disabled: g.disabled,
|
|
1535
1504
|
color: g.color,
|
|
1536
1505
|
error: g.error,
|
|
@@ -1539,16 +1508,16 @@ const tt = /* @__PURE__ */ se({
|
|
|
1539
1508
|
class: ["m-phone-input", [
|
|
1540
1509
|
{
|
|
1541
1510
|
"--border-radius": g.hasRadius,
|
|
1542
|
-
"--error": g.error || !
|
|
1543
|
-
"--focused":
|
|
1511
|
+
"--error": g.error || !P(O).isValid,
|
|
1512
|
+
"--focused": V.value
|
|
1544
1513
|
}
|
|
1545
1514
|
]],
|
|
1546
|
-
onFocus:
|
|
1547
|
-
onBlur:
|
|
1548
|
-
"onUpdate:modelValue":
|
|
1515
|
+
onFocus: S[0] || (S[0] = (C) => V.value = !0),
|
|
1516
|
+
onBlur: S[1] || (S[1] = (C) => V.value = !1),
|
|
1517
|
+
"onUpdate:modelValue": S[2] || (S[2] = (C) => Y(C))
|
|
1549
1518
|
}), null, 16, ["id", "model-value", "disabled", "color", "error", "size", "success", "class"]));
|
|
1550
1519
|
}
|
|
1551
|
-
}), lt = /* @__PURE__ */ re(tt, [["__scopeId", "data-v-ebe8f08f"]]),
|
|
1520
|
+
}), lt = /* @__PURE__ */ re(tt, [["__scopeId", "data-v-ebe8f08f"]]), at = /* @__PURE__ */ ne({
|
|
1552
1521
|
name: "MazPhoneNumberInput",
|
|
1553
1522
|
inheritAttrs: !1,
|
|
1554
1523
|
__name: "MazPhoneNumberInput",
|
|
@@ -1602,100 +1571,100 @@ const tt = /* @__PURE__ */ se({
|
|
|
1602
1571
|
}) }
|
|
1603
1572
|
},
|
|
1604
1573
|
emits: ["update:model-value", "country-code", "update:country-code", "update", "data"],
|
|
1605
|
-
setup(
|
|
1606
|
-
const e =
|
|
1574
|
+
setup(a, { emit: o }) {
|
|
1575
|
+
const e = a, t = o, { fetchCountryCode: r, sanitizePhoneNumber: u, getBrowserLocale: v } = Ue(), { isCountryAvailable: f, getPhoneNumberResults: O, getAsYouTypeFormat: L } = He(), y = Ae({
|
|
1607
1576
|
componentName: "MazPhoneNumberInput",
|
|
1608
1577
|
providedId: e.id
|
|
1609
|
-
}),
|
|
1578
|
+
}), V = k(""), i = k(), p = k({
|
|
1610
1579
|
isValid: !1,
|
|
1611
1580
|
countryCode: void 0
|
|
1612
|
-
}),
|
|
1581
|
+
}), z = k(), w = k({
|
|
1613
1582
|
start: 0,
|
|
1614
1583
|
end: 0,
|
|
1615
1584
|
cursorAtEnd: !0
|
|
1616
1585
|
});
|
|
1617
|
-
|
|
1586
|
+
no("data", {
|
|
1618
1587
|
selectedCountry: i,
|
|
1619
|
-
phoneNumber:
|
|
1620
|
-
results:
|
|
1621
|
-
selectionRange:
|
|
1588
|
+
phoneNumber: V,
|
|
1589
|
+
results: p,
|
|
1590
|
+
selectionRange: w
|
|
1622
1591
|
});
|
|
1623
|
-
const
|
|
1592
|
+
const D = h(() => ({
|
|
1624
1593
|
...Zo,
|
|
1625
1594
|
...e.translations
|
|
1626
1595
|
}));
|
|
1627
1596
|
Ie(async () => {
|
|
1628
|
-
var
|
|
1597
|
+
var s;
|
|
1629
1598
|
if (C(e.countryCode ?? e.defaultCountryCode), e.fetchCountry && !i.value) {
|
|
1630
|
-
const
|
|
1631
|
-
C(
|
|
1599
|
+
const A = await r();
|
|
1600
|
+
C(A);
|
|
1632
1601
|
}
|
|
1633
1602
|
if (!e.defaultCountryCode && !e.noUseBrowserLocale && !i.value) {
|
|
1634
|
-
const
|
|
1635
|
-
C(
|
|
1603
|
+
const A = (s = v()) == null ? void 0 : s.locale;
|
|
1604
|
+
C(A);
|
|
1636
1605
|
}
|
|
1637
1606
|
});
|
|
1638
|
-
const Y =
|
|
1607
|
+
const Y = k();
|
|
1639
1608
|
function J() {
|
|
1640
|
-
var
|
|
1641
|
-
return (
|
|
1609
|
+
var s;
|
|
1610
|
+
return (s = Y.value) == null ? void 0 : s.$el.querySelector("input");
|
|
1642
1611
|
}
|
|
1643
1612
|
async function g() {
|
|
1644
|
-
var
|
|
1645
|
-
await ie(), (
|
|
1613
|
+
var s;
|
|
1614
|
+
await ie(), (s = J()) == null || s.select();
|
|
1646
1615
|
}
|
|
1647
|
-
function
|
|
1616
|
+
function S(s) {
|
|
1648
1617
|
Z({
|
|
1649
|
-
countryCode:
|
|
1618
|
+
countryCode: s
|
|
1650
1619
|
}), g();
|
|
1651
1620
|
}
|
|
1652
|
-
function C(
|
|
1653
|
-
if (
|
|
1654
|
-
if (!
|
|
1621
|
+
function C(s) {
|
|
1622
|
+
if (s) {
|
|
1623
|
+
if (!f(s)) {
|
|
1655
1624
|
i.value = void 0;
|
|
1656
1625
|
return;
|
|
1657
1626
|
}
|
|
1658
|
-
i.value =
|
|
1627
|
+
i.value = s;
|
|
1659
1628
|
}
|
|
1660
1629
|
}
|
|
1661
1630
|
function W({
|
|
1662
|
-
newPhoneNumber:
|
|
1663
|
-
updateResults:
|
|
1631
|
+
newPhoneNumber: s,
|
|
1632
|
+
updateResults: A = !0
|
|
1664
1633
|
}) {
|
|
1665
|
-
const K = u(
|
|
1666
|
-
if (
|
|
1634
|
+
const K = u(s);
|
|
1635
|
+
if (A && (p.value = O({
|
|
1667
1636
|
phoneNumber: K,
|
|
1668
1637
|
countryCode: i.value
|
|
1669
|
-
})),
|
|
1670
|
-
const T =
|
|
1671
|
-
|
|
1638
|
+
})), w.value.cursorAtEnd && !e.noFormattingAsYouType && e.autoFormat) {
|
|
1639
|
+
const T = p.value.isValid ? p.value.formatNational : K;
|
|
1640
|
+
z.value = L(i.value, T), V.value = z.value;
|
|
1672
1641
|
}
|
|
1673
|
-
|
|
1674
|
-
countryCode:
|
|
1642
|
+
p.value.countryCode && p.value.countryCode !== i.value && Z({
|
|
1643
|
+
countryCode: p.value.countryCode,
|
|
1675
1644
|
updateResults: !1
|
|
1676
1645
|
});
|
|
1677
1646
|
}
|
|
1678
1647
|
function Z({
|
|
1679
|
-
countryCode:
|
|
1680
|
-
updateResults:
|
|
1648
|
+
countryCode: s,
|
|
1649
|
+
updateResults: A = !0
|
|
1681
1650
|
}) {
|
|
1682
|
-
if (!
|
|
1651
|
+
if (!s) {
|
|
1683
1652
|
i.value = void 0;
|
|
1684
1653
|
return;
|
|
1685
1654
|
}
|
|
1686
|
-
|
|
1687
|
-
phoneNumber:
|
|
1688
|
-
countryCode:
|
|
1655
|
+
s !== i.value && C(s), A && (p.value = O({
|
|
1656
|
+
phoneNumber: V.value,
|
|
1657
|
+
countryCode: s
|
|
1689
1658
|
})), W({
|
|
1690
|
-
newPhoneNumber:
|
|
1659
|
+
newPhoneNumber: V.value,
|
|
1691
1660
|
updateResults: !1
|
|
1692
1661
|
});
|
|
1693
1662
|
}
|
|
1694
1663
|
return he(
|
|
1695
1664
|
() => e.modelValue ?? e.defaultPhoneNumber,
|
|
1696
|
-
(
|
|
1697
|
-
|
|
1698
|
-
newPhoneNumber:
|
|
1665
|
+
(s, A) => {
|
|
1666
|
+
s !== A && s !== V.value && W({
|
|
1667
|
+
newPhoneNumber: s
|
|
1699
1668
|
});
|
|
1700
1669
|
},
|
|
1701
1670
|
{
|
|
@@ -1703,78 +1672,65 @@ const tt = /* @__PURE__ */ se({
|
|
|
1703
1672
|
}
|
|
1704
1673
|
), he(
|
|
1705
1674
|
() => e.countryCode ?? e.defaultCountryCode,
|
|
1706
|
-
(
|
|
1707
|
-
|
|
1708
|
-
countryCode:
|
|
1675
|
+
(s, A) => {
|
|
1676
|
+
s && s !== A && s !== i.value && Z({
|
|
1677
|
+
countryCode: s
|
|
1709
1678
|
});
|
|
1710
1679
|
},
|
|
1711
1680
|
{
|
|
1712
1681
|
immediate: !0
|
|
1713
1682
|
}
|
|
1714
1683
|
), he(
|
|
1715
|
-
|
|
1716
|
-
(
|
|
1717
|
-
t("update",
|
|
1684
|
+
p,
|
|
1685
|
+
(s) => {
|
|
1686
|
+
t("update", s), t("data", s), s.e164 && s.isValid ? t("update:model-value", s.e164) : t("update:model-value", V.value), t("country-code", i.value), t("update:country-code", i.value);
|
|
1718
1687
|
},
|
|
1719
1688
|
{
|
|
1720
1689
|
immediate: !0
|
|
1721
1690
|
}
|
|
1722
|
-
), (
|
|
1691
|
+
), (s, A) => {
|
|
1723
1692
|
var K;
|
|
1724
|
-
return b(),
|
|
1693
|
+
return b(), E(
|
|
1725
1694
|
"div",
|
|
1726
1695
|
{
|
|
1727
|
-
class: F(["m-phone-number-input", [e.class, { "--block":
|
|
1728
|
-
style: ee(
|
|
1696
|
+
class: F(["m-phone-number-input", [e.class, { "--block": s.block }, s.orientation ? `--${s.orientation}` : void 0]]),
|
|
1697
|
+
style: ee(s.style)
|
|
1729
1698
|
},
|
|
1730
1699
|
[
|
|
1731
|
-
|
|
1700
|
+
s.noCountrySelector ? $("v-if", !0) : (b(), U(Jo, oe({
|
|
1732
1701
|
key: 0,
|
|
1733
|
-
id:
|
|
1734
|
-
},
|
|
1702
|
+
id: P(y)
|
|
1703
|
+
}, s.countrySelectAttributes, {
|
|
1735
1704
|
"model-value": i.value,
|
|
1736
|
-
color:
|
|
1737
|
-
size:
|
|
1738
|
-
"country-locale":
|
|
1739
|
-
"country-selector-display-name":
|
|
1740
|
-
"custom-countries-list":
|
|
1741
|
-
"ignored-countries":
|
|
1742
|
-
"list-position":
|
|
1743
|
-
"no-flags":
|
|
1744
|
-
"no-search":
|
|
1745
|
-
"exclude-selectors":
|
|
1746
|
-
error:
|
|
1747
|
-
success:
|
|
1748
|
-
locales:
|
|
1749
|
-
disabled:
|
|
1750
|
-
"search-threshold":
|
|
1751
|
-
"show-code-on-list":
|
|
1752
|
-
"only-countries":
|
|
1753
|
-
"preferred-countries":
|
|
1754
|
-
width:
|
|
1755
|
-
"onUpdate:modelValue":
|
|
1705
|
+
color: s.color,
|
|
1706
|
+
size: s.size,
|
|
1707
|
+
"country-locale": s.countryLocale,
|
|
1708
|
+
"country-selector-display-name": s.countrySelectorDisplayName,
|
|
1709
|
+
"custom-countries-list": s.customCountriesList,
|
|
1710
|
+
"ignored-countries": s.ignoredCountries,
|
|
1711
|
+
"list-position": s.listPosition,
|
|
1712
|
+
"no-flags": s.noFlags,
|
|
1713
|
+
"no-search": s.noSearch,
|
|
1714
|
+
"exclude-selectors": s.excludeSelectors,
|
|
1715
|
+
error: s.error || (s.noValidationError ? !1 : !!V.value && !i.value),
|
|
1716
|
+
success: s.success || (s.noValidationSuccess ? !1 : (K = p.value) == null ? void 0 : K.isValid),
|
|
1717
|
+
locales: D.value,
|
|
1718
|
+
disabled: s.disabled,
|
|
1719
|
+
"search-threshold": s.searchThreshold,
|
|
1720
|
+
"show-code-on-list": s.showCodeOnList,
|
|
1721
|
+
"only-countries": s.onlyCountries,
|
|
1722
|
+
"preferred-countries": s.preferredCountries,
|
|
1723
|
+
width: s.countrySelectorWidth,
|
|
1724
|
+
"onUpdate:modelValue": S
|
|
1756
1725
|
}), {
|
|
1757
1726
|
"no-results": G(() => [
|
|
1758
|
-
|
|
1759
|
-
@slot Replace the "no results" icon in the country selector list
|
|
1760
|
-
`),
|
|
1761
|
-
N(a.$slots, "no-results", {}, void 0, !0)
|
|
1727
|
+
N(s.$slots, "no-results", {}, void 0, !0)
|
|
1762
1728
|
]),
|
|
1763
1729
|
"selector-flag": G(({ countryCode: T }) => [
|
|
1764
|
-
|
|
1765
|
-
@slot Country selector flag
|
|
1766
|
-
@binding {String} country-code - current selected country code - Ex: \`"FR"\`
|
|
1767
|
-
`),
|
|
1768
|
-
N(a.$slots, "selector-flag", { countryCode: T }, void 0, !0)
|
|
1730
|
+
N(s.$slots, "selector-flag", { countryCode: T }, void 0, !0)
|
|
1769
1731
|
]),
|
|
1770
1732
|
"country-list-flag": G(({ isSelected: T, option: te }) => [
|
|
1771
|
-
|
|
1772
|
-
@slot Country list flag
|
|
1773
|
-
@binding {String} country-code - country code of option - Ex: \`"FR"\`
|
|
1774
|
-
@binding {{ iso2: string; dialCode: string; name: string; }} option - country data
|
|
1775
|
-
@binding {Boolean} is-selected - \`true\` if option is selected
|
|
1776
|
-
`),
|
|
1777
|
-
N(a.$slots, "country-list-flag", {
|
|
1733
|
+
N(s.$slots, "country-list-flag", {
|
|
1778
1734
|
countryCode: te.iso2,
|
|
1779
1735
|
option: te,
|
|
1780
1736
|
isSelected: T
|
|
@@ -1784,26 +1740,26 @@ const tt = /* @__PURE__ */ se({
|
|
|
1784
1740
|
/* FORWARDED */
|
|
1785
1741
|
}, 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"])),
|
|
1786
1742
|
H(lt, oe({
|
|
1787
|
-
id:
|
|
1743
|
+
id: P(y),
|
|
1788
1744
|
ref_key: "PhoneInputRef",
|
|
1789
1745
|
ref: Y,
|
|
1790
|
-
modelValue:
|
|
1791
|
-
"onUpdate:modelValue":
|
|
1792
|
-
}, { ...
|
|
1793
|
-
color:
|
|
1794
|
-
size:
|
|
1795
|
-
"no-example":
|
|
1746
|
+
modelValue: V.value,
|
|
1747
|
+
"onUpdate:modelValue": A[0] || (A[0] = (T) => V.value = T)
|
|
1748
|
+
}, { ...s.$attrs, ...s.phoneInputAttributes }, {
|
|
1749
|
+
color: s.color,
|
|
1750
|
+
size: s.size,
|
|
1751
|
+
"no-example": s.noExample,
|
|
1796
1752
|
block: "",
|
|
1797
|
-
disabled:
|
|
1798
|
-
"has-radius": !
|
|
1799
|
-
success:
|
|
1800
|
-
error:
|
|
1801
|
-
locales:
|
|
1802
|
-
"no-formatting-as-you-type":
|
|
1803
|
-
"auto-format":
|
|
1804
|
-
label:
|
|
1805
|
-
placeholder:
|
|
1806
|
-
"onUpdate:modelValue":
|
|
1753
|
+
disabled: s.disabled,
|
|
1754
|
+
"has-radius": !s.noCountrySelector,
|
|
1755
|
+
success: s.success || (s.noValidationSuccess ? !1 : p.value.isValid),
|
|
1756
|
+
error: s.error || (s.noValidationError ? !1 : !!V.value && !p.value.isValid),
|
|
1757
|
+
locales: D.value,
|
|
1758
|
+
"no-formatting-as-you-type": s.noFormattingAsYouType,
|
|
1759
|
+
"auto-format": s.autoFormat,
|
|
1760
|
+
label: s.label,
|
|
1761
|
+
placeholder: s.placeholder,
|
|
1762
|
+
"onUpdate:modelValue": A[1] || (A[1] = (T) => W({
|
|
1807
1763
|
newPhoneNumber: T
|
|
1808
1764
|
}))
|
|
1809
1765
|
}), null, 16, ["id", "modelValue", "color", "size", "no-example", "disabled", "has-radius", "success", "error", "locales", "no-formatting-as-you-type", "auto-format", "label", "placeholder"])
|
|
@@ -1813,7 +1769,7 @@ const tt = /* @__PURE__ */ se({
|
|
|
1813
1769
|
);
|
|
1814
1770
|
};
|
|
1815
1771
|
}
|
|
1816
|
-
}), it = /* @__PURE__ */ re(
|
|
1772
|
+
}), it = /* @__PURE__ */ re(at, [["__scopeId", "data-v-420d6d4a"]]);
|
|
1817
1773
|
export {
|
|
1818
1774
|
it as M,
|
|
1819
1775
|
re as _,
|