maz-ui 3.37.0 → 3.37.2

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.
Files changed (74) hide show
  1. package/components/MazCheckbox.d.ts +4 -0
  2. package/components/MazCheckbox.mjs +31 -24
  3. package/components/MazInput.d.ts +2 -0
  4. package/components/MazInput.mjs +1 -1
  5. package/components/MazInputNumber.d.ts +2 -0
  6. package/components/MazInputNumber.mjs +1 -1
  7. package/components/MazInputPrice.d.ts +8 -0
  8. package/components/MazInputPrice.mjs +1 -1
  9. package/components/MazInputTags.d.ts +2 -0
  10. package/components/MazInputTags.mjs +1 -1
  11. package/components/MazPhoneNumberInput.d.ts +2 -0
  12. package/components/MazPhoneNumberInput.mjs +1 -1
  13. package/components/MazPicker.d.ts +2 -0
  14. package/components/MazPicker.mjs +1 -1
  15. package/components/MazRadio.d.ts +9 -0
  16. package/components/MazRadio.mjs +44 -37
  17. package/components/MazSelect.d.ts +2 -0
  18. package/components/MazSelect.mjs +1 -1
  19. package/components/MazTable.mjs +1 -1
  20. package/components/MazTextarea.mjs +1 -1
  21. package/components/assets/MazCheckbox.css +1 -1
  22. package/components/assets/MazInput.css +1 -1
  23. package/components/assets/MazInputNumber.css +1 -1
  24. package/components/assets/MazInputPrice.css +1 -1
  25. package/components/assets/MazInputTags.css +1 -1
  26. package/components/assets/MazPhoneNumberInput.css +1 -1
  27. package/components/assets/MazPicker.css +1 -1
  28. package/components/assets/MazRadio.css +1 -1
  29. package/components/assets/MazSelect.css +1 -1
  30. package/components/assets/MazTable.css +1 -1
  31. package/components/assets/MazTextarea.css +1 -1
  32. package/components/chunks/{MazBtn-C3z_znl5.mjs → MazBtn-Bo51KtKY.mjs} +2 -2
  33. package/components/chunks/{MazBtn-CuYCQCM2.mjs → MazBtn-CDQAW3fg.mjs} +2 -2
  34. package/components/chunks/MazBtn-D-Axz-X0.mjs +151 -0
  35. package/components/chunks/{MazBtn-D7b2VFGB.mjs → MazBtn-Koayc6g_.mjs} +2 -2
  36. package/components/chunks/{MazBtn-CS2F1-mC.mjs → MazBtn-pLRsSxug.mjs} +2 -2
  37. package/components/chunks/{MazCheckbox-BTM3Xpxz.mjs → MazCheckbox-CXVe5vda.mjs} +30 -23
  38. package/components/chunks/{MazCheckbox-COTppi08.mjs → MazCheckbox-DBlQwP82.mjs} +30 -23
  39. package/components/chunks/{MazIcon-Bspx_Ojq.mjs → MazIcon-BTsi1M-S.mjs} +1 -1
  40. package/components/chunks/{MazInput-C1r0b8BB.mjs → MazInput-Caas-0Nk.mjs} +19 -17
  41. package/components/chunks/{MazInputNumber-DJWxTvJ0.mjs → MazInputNumber-CnoCQQzg.mjs} +85 -81
  42. package/components/chunks/{MazInputPrice-CmX_rC0L.mjs → MazInputPrice---5nCUKm.mjs} +57 -53
  43. package/components/chunks/{MazInputTags-pm_5HtHM.mjs → MazInputTags-CipoVBP2.mjs} +83 -79
  44. package/components/chunks/{MazPhoneNumberInput-CVz5eTvG.mjs → MazPhoneNumberInput-CsX6Kqob.mjs} +402 -395
  45. package/components/chunks/{MazPicker-DP1zd8tt.mjs → MazPicker-CfhI75aw.mjs} +67 -62
  46. package/components/chunks/{MazPickerCalendar-qjcDNw86.mjs → MazPickerCalendar-DnkNE-Am.mjs} +3 -3
  47. package/components/chunks/{MazPickerHeader-CozeYkFf.mjs → MazPickerHeader-Vt86yzXS.mjs} +1 -1
  48. package/components/chunks/{MazPickerMonthSwitcher-aaUELZpE.mjs → MazPickerMonthSwitcher-zfKhsjW1.mjs} +2 -2
  49. package/components/chunks/{MazPickerShortcuts-ppox8lXf.mjs → MazPickerShortcuts-DUIKfOO8.mjs} +2 -2
  50. package/components/chunks/{MazPickerTime-DmpypIWr.mjs → MazPickerTime-B2znRxr2.mjs} +2 -2
  51. package/components/chunks/{MazPickerYearSwitcher-BNBvipzs.mjs → MazPickerYearSwitcher-CB339kof.mjs} +3 -3
  52. package/components/chunks/{MazSelect-DGEof7R3.mjs → MazSelect-DZeXglR8.mjs} +117 -109
  53. package/components/chunks/{MazSpinner-CTdeHHNH.mjs → MazSpinner-BAhgxOgg.mjs} +1 -1
  54. package/components/chunks/{MazSpinner-DmFFdtxB.mjs → MazSpinner-CJaSrYbQ.mjs} +1 -1
  55. package/components/chunks/{MazSpinner-KKcK5-QF.mjs → MazSpinner-CORsBFCP.mjs} +1 -1
  56. package/components/chunks/{MazSpinner-DTZHIIMh.mjs → MazSpinner-CVBVegaS.mjs} +1 -1
  57. package/components/chunks/MazSpinner-CkdjTE0y.mjs +38 -0
  58. package/components/chunks/{MazSpinner-DZTqt2Yn.mjs → MazSpinner-DECa8Pby.mjs} +1 -1
  59. package/components/chunks/{MazSpinner-DUVEeU4h.mjs → MazSpinner-Dq4o-_GM.mjs} +1 -1
  60. package/components/chunks/{MazSpinner-CiPbsWOG.mjs → MazSpinner-DqXjnLKa.mjs} +1 -1
  61. package/components/chunks/{MazTable-BhDfeDU1.mjs → MazTable-DrFqDO-J.mjs} +214 -199
  62. package/nuxt/index.json +1 -1
  63. package/package.json +1 -1
  64. package/types/components/MazCheckbox.vue.d.ts +4 -0
  65. package/types/components/MazInput.vue.d.ts +2 -0
  66. package/types/components/MazInputNumber.vue.d.ts +2 -0
  67. package/types/components/MazInputPrice.vue.d.ts +8 -0
  68. package/types/components/MazInputTags.vue.d.ts +2 -0
  69. package/types/components/MazPhoneNumberInput.vue.d.ts +2 -0
  70. package/types/components/MazPicker.vue.d.ts +2 -0
  71. package/types/components/MazRadio.vue.d.ts +9 -0
  72. package/types/components/MazSelect.vue.d.ts +2 -0
  73. package/components/chunks/MazBtn-OUDBhJKd.mjs +0 -151
  74. package/components/chunks/MazSpinner-yPD_Biya.mjs +0 -38
@@ -1,27 +1,27 @@
1
1
  import '../assets/MazPhoneNumberInput.css';
2
- import { getCurrentInstance as to, computed as v, defineComponent as re, defineAsyncComponent as U, ref as S, onMounted as Ve, useSlots as no, openBlock as C, createElementBlock as $, normalizeClass as E, normalizeStyle as _, createElementVNode as R, createCommentVNode as V, renderSlot as H, createBlock as K, unref as b, resolveDynamicComponent as Pe, withDirectives as Ne, mergeProps as pe, toHandlers as lo, vModelDynamic as ao, createTextVNode as Ce, toDisplayString as G, withModifiers as x, withCtx as ae, createVNode as q, nextTick as ee, useCssVars as ro, onBeforeMount as so, Transition as uo, Fragment as Fe, renderList as io, reactive as co, mergeModels as Ae, useModel as po, resolveComponent as fo, watch as he } from "vue";
3
- import { getCountries as Te, getCountryCallingCode as de, getExampleNumber as mo, isSupportedCountry as yo, parsePhoneNumberFromString as vo, AsYouType as ho } from "libphonenumber-js";
4
- function bo(t, n) {
2
+ import { getCurrentInstance as to, computed as v, defineComponent as re, defineAsyncComponent as U, ref as I, onMounted as we, useSlots as lo, openBlock as C, createElementBlock as P, normalizeClass as E, normalizeStyle as _, createElementVNode as R, createCommentVNode as V, renderSlot as H, createBlock as K, unref as b, resolveDynamicComponent as Fe, withDirectives as Ne, mergeProps as pe, toHandlers as no, vModelDynamic as ao, createTextVNode as Ce, toDisplayString as G, withModifiers as x, withCtx as ae, createVNode as q, nextTick as ee, useCssVars as ro, onBeforeMount as so, Transition as uo, Fragment as Ae, renderList as io, reactive as co, mergeModels as Le, useModel as po, watch as he } from "vue";
3
+ import { getCountries as Te, getCountryCallingCode as de, getExampleNumber as fo, isSupportedCountry as mo, parsePhoneNumberFromString as yo, AsYouType as vo } from "libphonenumber-js";
4
+ function ho(t, l) {
5
5
  let o;
6
6
  return function(...c) {
7
7
  clearTimeout(o), o = setTimeout(() => {
8
8
  t.apply(this, c);
9
- }, n);
9
+ }, l);
10
10
  };
11
11
  }
12
- const we = ({
12
+ const ke = ({
13
13
  componentName: t,
14
- providedId: n
14
+ providedId: l
15
15
  }) => {
16
16
  const o = to();
17
- return v(() => n ?? `${t}-${o == null ? void 0 : o.uid}`);
18
- }, go = {
17
+ return v(() => l ?? `${t}-${o == null ? void 0 : o.uid}`);
18
+ }, bo = {
19
19
  key: 0,
20
20
  class: "m-input-wrapper-left"
21
- }, zo = { class: "m-input-wrapper-input" }, Co = ["id", "type", "name", "inputmode", "placeholder", "aria-label", "disabled", "readonly", "required"], Vo = { key: 0 }, wo = {
21
+ }, go = { class: "m-input-wrapper-input" }, zo = ["id", "type", "name", "inputmode", "placeholder", "aria-label", "disabled", "readonly", "required"], Co = { key: 0 }, Vo = {
22
22
  key: 1,
23
23
  class: "m-input-wrapper-right"
24
- }, Io = /* @__PURE__ */ re({
24
+ }, wo = /* @__PURE__ */ re({
25
25
  inheritAttrs: !1,
26
26
  __name: "MazInput",
27
27
  props: {
@@ -54,19 +54,20 @@ const we = ({
54
54
  borderActive: { type: Boolean, default: !1 },
55
55
  leftIcon: { default: void 0 },
56
56
  rightIcon: { default: void 0 },
57
- roundedSize: { default: void 0 }
57
+ roundedSize: { default: void 0 },
58
+ block: { type: Boolean }
58
59
  },
59
60
  emits: ["update:model-value", "focus", "blur", "click", "change"],
60
- setup(t, { emit: n }) {
61
- const o = U(() => import("./MazBtn-OUDBhJKd.mjs")), c = U(() => import("./MazIcon-Cxrv3_OK.mjs")), m = U(() => import("./eye-slash-tjfxO0LK.mjs")), f = U(() => import("./eye-DqO_Jx56.mjs")), l = U(() => import("./check-7UA4j2f2.mjs")), i = t, I = n, h = S(!1), B = S(!1), M = S(), d = we({
61
+ setup(t, { emit: l }) {
62
+ const o = U(() => import("./MazBtn-D-Axz-X0.mjs")), c = U(() => import("./MazIcon-Cxrv3_OK.mjs")), m = U(() => import("./eye-slash-tjfxO0LK.mjs")), f = U(() => import("./eye-DqO_Jx56.mjs")), n = U(() => import("./check-7UA4j2f2.mjs")), i = t, k = l, h = I(!1), B = I(!1), M = I(), d = ke({
62
63
  componentName: "MazInput",
63
64
  providedId: i.id
64
65
  });
65
- Ve(() => {
66
- var a;
67
- i.autoFocus && ((a = M.value) == null || a.focus());
66
+ we(() => {
67
+ var r;
68
+ i.autoFocus && ((r = M.value) == null || r.focus());
68
69
  });
69
- const g = v(() => i.type === "password"), y = v(() => h.value ? "text" : i.type), P = v(() => {
70
+ const g = v(() => i.type === "password"), y = v(() => h.value ? "text" : i.type), F = v(() => {
70
71
  if (!i.noBorder) {
71
72
  if (i.error)
72
73
  return "maz-border-danger";
@@ -94,143 +95,144 @@ const we = ({
94
95
  }
95
96
  return "--default-border";
96
97
  }
97
- }), z = no(), F = v(() => {
98
- const { required: a, placeholder: L } = i;
98
+ }), z = lo(), $ = v(() => {
99
+ const { required: r, placeholder: L } = i;
99
100
  if (L)
100
- return a ? `${L} *` : L;
101
- }), r = v(() => N.value !== void 0 && N.value !== ""), k = bo(
102
- (a) => {
103
- N.value = a;
101
+ return r ? `${L} *` : L;
102
+ }), a = v(() => N.value !== void 0 && N.value !== ""), S = ho(
103
+ (r) => {
104
+ N.value = r;
104
105
  },
105
106
  typeof i.debounce == "number" ? i.debounce : i.debounceDelay ?? 500
106
107
  ), N = v({
107
108
  get: () => i.modelValue,
108
- set: (a) => {
109
+ set: (r) => {
109
110
  if (i.debounce)
110
- return k(a);
111
- I("update:model-value", a);
111
+ return S(r);
112
+ k("update:model-value", r);
112
113
  }
113
- }), ue = v(() => (!!i.label || !!i.hint) && (B.value || !!r.value || !!i.placeholder || ["date", "month", "week"].includes(i.type))), ie = v(() => !!i.label || !!i.hint);
114
+ }), ue = v(() => (!!i.label || !!i.hint) && (B.value || !!a.value || !!i.placeholder || ["date", "month", "week"].includes(i.type))), ie = v(() => !!i.label || !!i.hint);
114
115
  function O() {
115
116
  return !!z["right-icon"] || g.value || !!z["valid-button"] || i.validButton || !!i.rightIcon;
116
117
  }
117
118
  function te() {
118
119
  return !!z["left-icon"] || !!i.leftIcon;
119
120
  }
120
- function fe(a) {
121
- I("focus", a), B.value = !0;
121
+ function fe(r) {
122
+ k("focus", r), B.value = !0;
122
123
  }
123
- function me(a) {
124
- I("blur", a), B.value = !1;
124
+ function me(r) {
125
+ k("blur", r), B.value = !1;
125
126
  }
126
- function j(a) {
127
- return I("change", a);
127
+ function j(r) {
128
+ return k("change", r);
128
129
  }
129
- return (a, L) => (C(), $(
130
+ return (r, L) => (C(), P(
130
131
  "div",
131
132
  {
132
133
  class: E(["m-input", [
133
134
  {
134
- "--is-focused": B.value || a.borderActive,
135
+ "--is-focused": B.value || r.borderActive,
135
136
  "--should-up": ue.value,
136
137
  "--has-label": ie.value,
137
- "--is-disabled": a.disabled,
138
- "--is-readonly": a.readonly,
139
- "--has-z-2": a.error || a.warning || a.success,
140
- "--has-state": a.error || a.warning || a.success
138
+ "--is-disabled": r.disabled,
139
+ "--is-readonly": r.readonly,
140
+ "--has-z-2": r.error || r.warning || r.success,
141
+ "--has-state": r.error || r.warning || r.success,
142
+ "--block": r.block
141
143
  },
142
144
  i.class,
143
- `--${a.color}`,
144
- `--${a.size}`
145
+ `--${r.color}`,
146
+ `--${r.size}`
145
147
  ]]),
146
- style: _(a.style)
148
+ style: _(r.style)
147
149
  },
148
150
  [
149
151
  R(
150
152
  "div",
151
153
  {
152
154
  class: E(["m-input-wrapper", [
153
- a.inputClasses,
154
- P.value,
155
- a.roundedSize ? `--rounded-${a.roundedSize}` : { "maz-rounded": !a.noRadius }
155
+ r.inputClasses,
156
+ F.value,
157
+ r.roundedSize ? `--rounded-${r.roundedSize}` : { "maz-rounded": !r.noRadius }
156
158
  ]])
157
159
  },
158
160
  [
159
- te() ? (C(), $("div", go, [
161
+ te() ? (C(), P("div", bo, [
160
162
  V(`
161
163
  @slot left-icon - The icon to display on the left of the input
162
164
  `),
163
- a.$slots["left-icon"] || a.leftIcon ? H(a.$slots, "left-icon", { key: 0 }, () => [
164
- typeof a.leftIcon == "string" ? (C(), K(b(c), {
165
+ r.$slots["left-icon"] || r.leftIcon ? H(r.$slots, "left-icon", { key: 0 }, () => [
166
+ typeof r.leftIcon == "string" ? (C(), K(b(c), {
165
167
  key: 0,
166
- name: a.leftIcon,
168
+ name: r.leftIcon,
167
169
  class: "maz-text-xl maz-text-muted"
168
- }, null, 8, ["name"])) : a.leftIcon ? (C(), K(Pe(a.leftIcon), {
170
+ }, null, 8, ["name"])) : r.leftIcon ? (C(), K(Fe(r.leftIcon), {
169
171
  key: 1,
170
172
  class: "maz-text-xl maz-text-muted"
171
173
  })) : V("v-if", !0)
172
174
  ], !0) : V("v-if", !0)
173
175
  ])) : V("v-if", !0),
174
- R("div", zo, [
176
+ R("div", go, [
175
177
  Ne(R("input", pe({
176
178
  id: b(d),
177
179
  ref_key: "input",
178
180
  ref: M,
179
181
  "onUpdate:modelValue": L[0] || (L[0] = (Y) => N.value = Y),
180
182
  type: y.value,
181
- name: a.name
182
- }, a.$attrs, {
183
- inputmode: a.inputmode,
184
- placeholder: F.value,
185
- "aria-label": a.label || a.placeholder,
186
- disabled: a.disabled,
187
- readonly: a.readonly,
188
- required: a.required,
183
+ name: r.name
184
+ }, r.$attrs, {
185
+ inputmode: r.inputmode,
186
+ placeholder: $.value,
187
+ "aria-label": r.label || r.placeholder,
188
+ disabled: r.disabled,
189
+ readonly: r.readonly,
190
+ required: r.required,
189
191
  class: "m-input-input"
190
- }, lo({
192
+ }, no({
191
193
  blur: me,
192
194
  focus: fe,
193
195
  change: j
194
196
  }, !0), {
195
- onClick: L[1] || (L[1] = (Y) => a.$emit("click", Y))
196
- }), null, 16, Co), [
197
+ onClick: L[1] || (L[1] = (Y) => r.$emit("click", Y))
198
+ }), null, 16, zo), [
197
199
  [ao, N.value]
198
200
  ]),
199
- a.label || a.hint ? (C(), $(
201
+ r.label || r.hint ? (C(), P(
200
202
  "span",
201
203
  {
202
204
  key: 0,
203
205
  ref: "label",
204
206
  class: E(["m-input-label", [
205
207
  {
206
- "maz-text-danger-600": a.error,
207
- "maz-text-success-600": a.success,
208
- "maz-text-warning-600": a.warning
208
+ "maz-text-danger-600": r.error,
209
+ "maz-text-success-600": r.success,
210
+ "maz-text-warning-600": r.warning
209
211
  }
210
212
  ]])
211
213
  },
212
214
  [
213
215
  Ce(
214
- G(a.hint || a.label) + " ",
216
+ G(r.hint || r.label) + " ",
215
217
  1
216
218
  /* TEXT */
217
219
  ),
218
- a.required ? (C(), $("sup", Vo, "*")) : V("v-if", !0)
220
+ r.required ? (C(), P("sup", Co, "*")) : V("v-if", !0)
219
221
  ],
220
222
  2
221
223
  /* CLASS */
222
224
  )) : V("v-if", !0)
223
225
  ]),
224
- O() ? (C(), $("div", wo, [
226
+ O() ? (C(), P("div", Vo, [
225
227
  V(`
226
228
  @slot right-icon - The icon to display on the right of the input
227
229
  `),
228
- a.$slots["right-icon"] || a.rightIcon ? H(a.$slots, "right-icon", { key: 0 }, () => [
229
- typeof a.rightIcon == "string" ? (C(), K(b(c), {
230
+ r.$slots["right-icon"] || r.rightIcon ? H(r.$slots, "right-icon", { key: 0 }, () => [
231
+ typeof r.rightIcon == "string" ? (C(), K(b(c), {
230
232
  key: 0,
231
- name: a.rightIcon,
233
+ name: r.rightIcon,
232
234
  class: "maz-text-xl maz-text-muted"
233
- }, null, 8, ["name"])) : a.rightIcon ? (C(), K(Pe(a.rightIcon), {
235
+ }, null, 8, ["name"])) : r.rightIcon ? (C(), K(Fe(r.rightIcon), {
234
236
  key: 1,
235
237
  class: "maz-text-xl maz-text-muted"
236
238
  })) : V("v-if", !0)
@@ -257,18 +259,18 @@ const we = ({
257
259
  V(`
258
260
  @slot valid-button - Replace the valid button by your own
259
261
  `),
260
- a.$slots["valid-button"] || a.validButton ? H(a.$slots, "valid-button", { key: 2 }, () => [
262
+ r.$slots["valid-button"] || r.validButton ? H(r.$slots, "valid-button", { key: 2 }, () => [
261
263
  q(b(o), {
262
264
  color: "transparent",
263
- disabled: a.disabled,
265
+ disabled: r.disabled,
264
266
  tabindex: "-1",
265
- loading: a.validButtonLoading,
267
+ loading: r.validButtonLoading,
266
268
  class: "m-input-valid-button",
267
269
  size: "mini",
268
270
  type: "submit"
269
271
  }, {
270
272
  default: ae(() => [
271
- q(b(l), { class: "maz-text-2xl maz-text-normal" })
273
+ q(b(n), { class: "maz-text-2xl maz-text-normal" })
272
274
  ]),
273
275
  _: 1
274
276
  /* STABLE */
@@ -284,26 +286,26 @@ const we = ({
284
286
  /* CLASS, STYLE */
285
287
  ));
286
288
  }
287
- }), se = (t, n) => {
289
+ }), se = (t, l) => {
288
290
  const o = t.__vccOpts || t;
289
- for (const [c, m] of n)
291
+ for (const [c, m] of l)
290
292
  o[c] = m;
291
293
  return o;
292
- }, Le = /* @__PURE__ */ se(Io, [["__scopeId", "data-v-f1c52a34"]]);
294
+ }, Ve = /* @__PURE__ */ se(wo, [["__scopeId", "data-v-78090be8"]]);
293
295
  let be = null;
294
- function ko(t, n) {
295
- be && clearTimeout(be), be = setTimeout(t, n);
296
+ function ko(t, l) {
297
+ be && clearTimeout(be), be = setTimeout(t, l);
296
298
  }
297
299
  const ce = "__maz-click-outside__", De = () => document.ontouchstart === null ? "touchstart" : "click";
298
- async function Ue(t, n) {
300
+ async function Ue(t, l) {
299
301
  try {
300
302
  Re(t);
301
- const o = n.instance, c = n.value, m = typeof c == "function";
303
+ const o = l.instance, c = l.value, m = typeof c == "function";
302
304
  if (!m)
303
305
  throw new Error("[maz-ui](vClickOutside) the callback should be a function");
304
- await ee(), t[ce] = (l) => {
305
- if ((!t || l.target && !t.contains(l.target)) && c && m)
306
- return c.call(o, l);
306
+ await ee(), t[ce] = (n) => {
307
+ if ((!t || n.target && !t.contains(n.target)) && c && m)
308
+ return c.call(o, n);
307
309
  };
308
310
  const f = De();
309
311
  document.addEventListener(f, t[ce], { passive: !0 });
@@ -313,39 +315,39 @@ async function Ue(t, n) {
313
315
  }
314
316
  function Re(t) {
315
317
  try {
316
- const n = De();
317
- document.removeEventListener(n, t[ce], !1), delete t[ce];
318
- } catch (n) {
319
- console.error("[maz-ui](vClickOutside)", n);
318
+ const l = De();
319
+ document.removeEventListener(l, t[ce], !1), delete t[ce];
320
+ } catch (l) {
321
+ console.error("[maz-ui](vClickOutside)", l);
320
322
  }
321
323
  }
322
- function So(t, n) {
324
+ function Io(t, l) {
323
325
  try {
324
- if (n.value === n.oldValue)
326
+ if (l.value === l.oldValue)
325
327
  return;
326
- Ue(t, n);
328
+ Ue(t, l);
327
329
  } catch (o) {
328
330
  console.error("[maz-ui](vClickOutside)", o);
329
331
  }
330
332
  }
331
- const Bo = {
333
+ const So = {
332
334
  mounted: Ue,
333
- updated: So,
335
+ updated: Io,
334
336
  unmounted: Re
335
337
  };
336
- function $o(t, n) {
337
- const o = t.length, c = n.length, m = [];
338
+ function Bo(t, l) {
339
+ const o = t.length, c = l.length, m = [];
338
340
  for (let f = 0; f <= o; f++)
339
341
  m[f] = [f];
340
342
  for (let f = 0; f <= c; f++)
341
343
  m[0][f] = f;
342
344
  for (let f = 1; f <= o; f++)
343
- for (let l = 1; l <= c; l++) {
344
- const i = t[f - 1] === n[l - 1] ? 0 : 1;
345
- m[f][l] = Math.min(
346
- m[f - 1][l] + 1,
347
- m[f][l - 1] + 1,
348
- m[f - 1][l - 1] + i
345
+ for (let n = 1; n <= c; n++) {
346
+ const i = t[f - 1] === l[n - 1] ? 0 : 1;
347
+ m[f][n] = Math.min(
348
+ m[f - 1][n] + 1,
349
+ m[f][n - 1] + 1,
350
+ m[f - 1][n - 1] + i
349
351
  );
350
352
  }
351
353
  return m[o][c];
@@ -353,31 +355,31 @@ function $o(t, n) {
353
355
  function Me(t) {
354
356
  return t.normalize("NFD").replaceAll(/[\u0300-\u036F]/g, "").toLowerCase();
355
357
  }
356
- function Oe(t, n) {
357
- const o = $o(t, n), c = Math.max(t.length, n.length);
358
+ function Oe(t, l) {
359
+ const o = Bo(t, l), c = Math.max(t.length, l.length);
358
360
  return 1 - o / c;
359
361
  }
360
- function Po(t, n, o = 0.75) {
361
- return Oe(t, n) >= o;
362
+ function $o(t, l, o = 0.75) {
363
+ return Oe(t, l) >= o;
362
364
  }
363
- function ge(t, n, o = 0.75) {
365
+ function ge(t, l, o = 0.75) {
364
366
  const c = v(
365
367
  () => Me(typeof t == "string" ? t : t.value)
366
368
  ), m = v(
367
- () => Me(typeof n == "string" ? n : n.value)
368
- ), f = v(() => typeof o == "number" ? o : o.value), l = v(() => Oe(c.value, m.value));
369
+ () => Me(typeof l == "string" ? l : l.value)
370
+ ), f = v(() => typeof o == "number" ? o : o.value), n = v(() => Oe(c.value, m.value));
369
371
  return {
370
372
  isMatching: v(
371
- () => Po(c.value, m.value, f.value)
373
+ () => $o(c.value, m.value, f.value)
372
374
  ),
373
- score: l
375
+ score: n
374
376
  };
375
377
  }
376
- const Fo = ["aria-label"], Ao = { class: "m-select-list__no-results" }, Lo = {
378
+ const Po = ["aria-label"], Fo = { class: "m-select-list__no-results" }, Ao = {
377
379
  key: 2,
378
380
  class: "m-select-list__scroll-wrapper",
379
381
  tabindex: "-1"
380
- }, Mo = { class: "m-select-list-optgroup" }, Eo = ["onClick"], Ko = /* @__PURE__ */ re({
382
+ }, Lo = { class: "m-select-list-optgroup" }, Mo = ["onClick"], Eo = /* @__PURE__ */ re({
381
383
  inheritAttrs: !1,
382
384
  __name: "MazSelect",
383
385
  props: {
@@ -400,119 +402,120 @@ const Fo = ["aria-label"], Ao = { class: "m-select-list__no-results" }, Lo = {
400
402
  open: { type: Boolean },
401
403
  multiple: { type: Boolean },
402
404
  required: { type: Boolean },
403
- disabled: { type: Boolean }
405
+ disabled: { type: Boolean },
406
+ block: { type: Boolean }
404
407
  },
405
408
  emits: ["close", "open", "blur", "focus", "change", "update:model-value", "selected-option"],
406
- setup(t, { emit: n }) {
409
+ setup(t, { emit: l }) {
407
410
  ro((e) => ({
408
- "6bda47a8": g.value,
409
- b7398b32: M.value,
410
- "1dd97a8f": d.value
411
+ "2223ba14": g.value,
412
+ "619dedd3": M.value,
413
+ "72c218fb": d.value
411
414
  }));
412
- const o = U(() => import("./MazCheckbox-COTppi08.mjs")), c = U(() => import("./magnifying-glass-DZGg7953.mjs")), m = U(() => import("./chevron-down-CzMH-gFW.mjs")), f = U(() => import("./no-symbol-QAqP9IlR.mjs")), l = t, i = n, I = S(!1), h = S(), B = v(
413
- () => ["black", "transparent", "white"].includes(l.color)
415
+ const o = U(() => import("./MazCheckbox-CXVe5vda.mjs")), c = U(() => import("./magnifying-glass-DZGg7953.mjs")), m = U(() => import("./chevron-down-CzMH-gFW.mjs")), f = U(() => import("./no-symbol-QAqP9IlR.mjs")), n = t, i = l, k = I(!1), h = I(), B = v(
416
+ () => ["black", "transparent", "white"].includes(n.color)
414
417
  ), M = v(
415
- () => B.value ? "var(--maz-color-black)" : `var(--maz-color-${l.color}-800)`
418
+ () => B.value ? "var(--maz-color-black)" : `var(--maz-color-${n.color}-800)`
416
419
  ), d = v(
417
- () => B.value ? "var(--maz-color-muted)" : `var(--maz-color-${l.color}-100)`
420
+ () => B.value ? "var(--maz-color-muted)" : `var(--maz-color-${n.color}-100)`
418
421
  ), g = v(
419
- () => B.value ? "var(--maz-color-muted)" : `var(--maz-color-${l.color}-200)`
420
- ), y = v(() => I.value || l.open), P = we({
422
+ () => B.value ? "var(--maz-color-muted)" : `var(--maz-color-${n.color}-200)`
423
+ ), y = v(() => k.value || n.open), F = ke({
421
424
  componentName: "MazSelect",
422
- providedId: l.id
425
+ providedId: n.id
423
426
  });
424
427
  function z(e) {
425
428
  return {
426
- [l.optionValueKey]: e,
427
- [l.optionLabelKey]: e,
428
- [l.optionInputValueKey]: e
429
+ [n.optionValueKey]: e,
430
+ [n.optionLabelKey]: e,
431
+ [n.optionInputValueKey]: e
429
432
  };
430
433
  }
431
- function F(e) {
434
+ function $(e) {
432
435
  return {
433
436
  ...e,
434
- [l.optionValueKey]: e[l.optionValueKey],
435
- [l.optionLabelKey]: e[l.optionLabelKey],
436
- [l.optionInputValueKey]: e[l.optionInputValueKey]
437
+ [n.optionValueKey]: e[n.optionValueKey],
438
+ [n.optionLabelKey]: e[n.optionLabelKey],
439
+ [n.optionInputValueKey]: e[n.optionInputValueKey]
437
440
  };
438
441
  }
439
- const r = v(() => {
442
+ const a = v(() => {
440
443
  var s;
441
444
  const e = [];
442
- if (!((s = l.options) != null && s.length))
445
+ if (!((s = n.options) != null && s.length))
443
446
  return [];
444
- for (const u of l.options)
447
+ for (const u of n.options)
445
448
  typeof u == "string" || typeof u == "number" || typeof u == "boolean" ? e.push(z(u)) : "options" in u && Array.isArray(u.options) ? e.push(
446
449
  { label: u.label, isOptGroup: !0 },
447
450
  ...u.options.map(
448
- (p) => typeof p == "string" || typeof p == "number" || typeof p == "boolean" ? z(p) : F(p)
451
+ (p) => typeof p == "string" || typeof p == "number" || typeof p == "boolean" ? z(p) : $(p)
449
452
  )
450
- ) : e.push(F(u));
453
+ ) : e.push($(u));
451
454
  return e;
452
- }), k = v(
455
+ }), S = v(
453
456
  () => {
454
457
  var e;
455
- return ((e = r.value) == null ? void 0 : e.filter((s) => l.multiple ? Array.isArray(l.modelValue) ? l.modelValue.includes(s[l.optionValueKey]) && !O(s[l.optionValueKey]) : !1 : l.modelValue === s[l.optionValueKey] && !O(s[l.optionValueKey]))) ?? [];
458
+ return ((e = a.value) == null ? void 0 : e.filter((s) => n.multiple ? Array.isArray(n.modelValue) ? n.modelValue.includes(s[n.optionValueKey]) && !O(s[n.optionValueKey]) : !1 : n.modelValue === s[n.optionValueKey] && !O(s[n.optionValueKey]))) ?? [];
456
459
  }
457
460
  );
458
461
  so(() => {
459
462
  var e;
460
- (e = l.options) != null && e.length || console.warn("[maz-ui](MazSelect) you must provide options"), ve();
463
+ (e = n.options) != null && e.length || console.warn("[maz-ui](MazSelect) you must provide options"), ve();
461
464
  });
462
- const Z = S(), N = S(), ue = S(), ie = S(), O = (e) => e == null;
465
+ const Z = I(), N = I(), ue = I(), ie = I(), O = (e) => e == null;
463
466
  function te(e) {
464
467
  var u;
465
- return (((u = k.value) == null ? void 0 : u.some(
466
- (p) => p[l.optionValueKey] === e[l.optionValueKey]
467
- )) ?? !1) && !O(e[l.optionValueKey]);
468
+ return (((u = S.value) == null ? void 0 : u.some(
469
+ (p) => p[n.optionValueKey] === e[n.optionValueKey]
470
+ )) ?? !1) && !O(e[n.optionValueKey]);
468
471
  }
469
472
  const fe = v(() => {
470
473
  var s;
471
- if (l.multiple && l.modelValue && Array.isArray(l.modelValue))
472
- return l.modelValue.map(
474
+ if (n.multiple && n.modelValue && Array.isArray(n.modelValue))
475
+ return n.modelValue.map(
473
476
  (u) => {
474
477
  var p, w;
475
- return (w = (p = r.value) == null ? void 0 : p.find((A) => A[l.optionValueKey] === u)) == null ? void 0 : w[l.optionInputValueKey];
478
+ return (w = (p = a.value) == null ? void 0 : p.find((A) => A[n.optionValueKey] === u)) == null ? void 0 : w[n.optionInputValueKey];
476
479
  }
477
480
  ).join(", ");
478
- const e = (s = r.value) == null ? void 0 : s.find(
479
- (u) => u[l.optionValueKey] === l.modelValue
481
+ const e = (s = a.value) == null ? void 0 : s.find(
482
+ (u) => u[n.optionValueKey] === n.modelValue
480
483
  );
481
- return O(l.modelValue) || e == null ? void 0 : e[l.optionInputValueKey];
484
+ return O(n.modelValue) || e == null ? void 0 : e[n.optionInputValueKey];
482
485
  }), me = v(
483
- () => l.listPosition.includes("bottom") ? "maz-slide" : "maz-slideinvert"
484
- ), j = S(""), a = S("");
486
+ () => n.listPosition.includes("bottom") ? "maz-slide" : "maz-slideinvert"
487
+ ), j = I(""), r = I("");
485
488
  function L(e) {
486
489
  return e.normalize("NFD").replaceAll(/[\u0300-\u036F]/g, "").replaceAll(/[^\dA-Za-z\u0400-\u04FF]/g, "");
487
490
  }
488
491
  const Y = (e, s) => s && e && L(e.toString().toLocaleLowerCase().trim()).includes(
489
492
  L(s.toLocaleLowerCase().trim())
490
493
  );
491
- function ke(e) {
494
+ function Se(e) {
492
495
  var s;
493
- return e ? (s = r.value) == null ? void 0 : s.filter((u) => {
494
- const p = u[l.optionLabelKey], w = u[l.optionValueKey], A = u[l.optionInputValueKey];
496
+ return e ? (s = a.value) == null ? void 0 : s.filter((u) => {
497
+ const p = u[n.optionLabelKey], w = u[n.optionValueKey], A = u[n.optionInputValueKey];
495
498
  return Y(p, e) || Y(A, e) || Y(w, e) || typeof p == "string" && ge(p, e).isMatching.value || typeof A == "string" && ge(A, e).isMatching.value || typeof w == "string" && ge(w, e).isMatching.value;
496
- }) : r.value;
499
+ }) : a.value;
497
500
  }
498
- const T = v(() => ke(j.value));
499
- async function ne(e) {
501
+ const T = v(() => Se(j.value));
502
+ async function le(e) {
500
503
  var s;
501
504
  if (y.value) {
502
505
  if (e && ("relatedTarget" in e && ((s = Z.value) != null && s.contains(e.relatedTarget)) || e.type === "keydown"))
503
506
  return e.preventDefault();
504
- await ee(), I.value = !1, h.value = 0, i("close", e);
507
+ await ee(), k.value = !1, h.value = 0, i("close", e);
505
508
  }
506
509
  }
507
- async function le(e) {
508
- l.disabled || y.value || (e == null || e.preventDefault(), I.value = !0, await ye(), i("focus", e), i("open", I.value));
510
+ async function ne(e) {
511
+ n.disabled || y.value || (e == null || e.preventDefault(), k.value = !0, await ye(), i("focus", e), i("open", k.value));
509
512
  }
510
- function Se() {
513
+ function Be() {
511
514
  var e, s;
512
515
  (s = ((e = N.value) == null ? void 0 : e.$el).querySelector("input")) == null || s.focus();
513
516
  }
514
517
  function Ze(e) {
515
- I.value ? ne(e) : Se();
518
+ k.value ? le(e) : Be();
516
519
  }
517
520
  function Xe(e) {
518
521
  var s, u;
@@ -520,33 +523,33 @@ const Fo = ["aria-label"], Ao = { class: "m-select-list__no-results" }, Lo = {
520
523
  }
521
524
  function xe(e) {
522
525
  var u;
523
- e === "Backspace" && a.value.length > 0 ? a.value = a.value.slice(0, -1) : a.value += e;
524
- const s = ke(a.value);
526
+ e === "Backspace" && r.value.length > 0 ? r.value = r.value.slice(0, -1) : r.value += e;
527
+ const s = Se(r.value);
525
528
  s != null && s.length && (h.value = (u = T.value) == null ? void 0 : u.findIndex(
526
- (p) => p[l.optionValueKey] === s[0][l.optionValueKey]
529
+ (p) => p[n.optionValueKey] === s[0][n.optionValueKey]
527
530
  ), typeof h.value == "number" && h.value >= 0 && ye(h.value)), ko(() => {
528
- a.value = "";
531
+ r.value = "";
529
532
  }, 1e3);
530
533
  }
531
534
  const _e = (e) => {
532
535
  const s = e.key;
533
- /^[\dA-Za-z\u0400-\u04FF]$/.test(s) ? (e.preventDefault(), le(e), l.search ? Xe(s) : xe(s)) : Be(e);
534
- }, Be = (e) => {
536
+ /^[\dA-Za-z\u0400-\u04FF]$/.test(s) ? (e.preventDefault(), ne(e), n.search ? Xe(s) : xe(s)) : $e(e);
537
+ }, $e = (e) => {
535
538
  const s = e.code, u = ["ArrowUp", "ArrowDown"].includes(s), p = ["Enter", "Space"].includes(s), w = s === "Escape" && y.value;
536
- u ? eo(e, h.value) : p ? oo(e, h.value) : w && ne();
539
+ u ? eo(e, h.value) : p ? oo(e, h.value) : w && le();
537
540
  }, eo = (e, s) => {
538
541
  var w;
539
542
  e.preventDefault();
540
543
  const u = e.code;
541
- y.value || le(e);
544
+ y.value || ne(e);
542
545
  const p = (w = T.value) == null ? void 0 : w.length;
543
546
  p && (typeof s == "number" ? s === p - 1 && u === "ArrowDown" ? h.value = 0 : s === 0 && u === "ArrowUp" ? h.value = p - 1 : h.value = u === "ArrowDown" ? s + 1 : s - 1 : h.value = u === "ArrowDown" ? 0 : p - 1, ye(h.value));
544
547
  }, oo = (e, s) => {
545
548
  var p, w, A;
546
549
  if (e.preventDefault(), !y.value)
547
- return le(e);
550
+ return ne(e);
548
551
  const u = s ? ((p = T.value) == null ? void 0 : p[s]) ?? ((w = T.value) == null ? void 0 : w[0]) : (A = T.value) == null ? void 0 : A[0];
549
- O(u) || $e(u);
552
+ O(u) || Pe(u);
550
553
  };
551
554
  async function ye(e) {
552
555
  var u, p;
@@ -562,48 +565,53 @@ const Fo = ["aria-label"], Ao = { class: "m-select-list__no-results" }, Lo = {
562
565
  var u;
563
566
  const s = (u = T.value) == null ? void 0 : u.findIndex((p) => {
564
567
  var w, A;
565
- return l.multiple && Array.isArray(l.modelValue) ? e ? e[l.optionValueKey] === p[l.optionValueKey] : [...l.modelValue].reverse()[0] === p[l.optionValueKey] : ((A = (w = k.value) == null ? void 0 : w[0]) == null ? void 0 : A[l.optionValueKey]) === p[l.optionValueKey];
568
+ return n.multiple && Array.isArray(n.modelValue) ? e ? e[n.optionValueKey] === p[n.optionValueKey] : [...n.modelValue].reverse()[0] === p[n.optionValueKey] : ((A = (w = S.value) == null ? void 0 : w[0]) == null ? void 0 : A[n.optionValueKey]) === p[n.optionValueKey];
566
569
  });
567
570
  h.value = s && s >= 0 ? s : 0;
568
571
  }
569
- const $e = (e, s = !0) => {
572
+ const Pe = (e, s = !0) => {
570
573
  var A;
571
- s && !l.multiple && ee(() => ne()), j.value = "";
572
- const u = (A = k.value) == null ? void 0 : A.some(
573
- (X) => X[l.optionValueKey] === e[l.optionValueKey]
574
+ s && !n.multiple && ee(() => le()), j.value = "";
575
+ const u = (A = S.value) == null ? void 0 : A.some(
576
+ (X) => X[n.optionValueKey] === e[n.optionValueKey]
574
577
  );
575
- let p = k.value;
576
- u && l.multiple ? p = p == null ? void 0 : p.filter(
577
- (X) => X[l.optionValueKey] !== e[l.optionValueKey]
578
- ) : l.multiple ? p.push(e) : p = [e];
579
- const w = p.map((X) => X[l.optionValueKey]);
580
- i("update:model-value", l.multiple ? w : w[0]), i("selected-option", e), ve(e), Se();
578
+ let p = S.value;
579
+ u && n.multiple ? p = p == null ? void 0 : p.filter(
580
+ (X) => X[n.optionValueKey] !== e[n.optionValueKey]
581
+ ) : n.multiple ? p.push(e) : p = [e];
582
+ const w = p.map((X) => X[n.optionValueKey]);
583
+ i("update:model-value", n.multiple ? w : w[0]), i("selected-option", e), ve(e), Be();
581
584
  };
582
- return (e, s) => Ne((C(), $(
585
+ return (e, s) => Ne((C(), P(
583
586
  "div",
584
587
  {
585
588
  ref_key: "mazSelectElement",
586
589
  ref: Z,
587
- class: E(["m-select", [{ "--is-open": y.value, "--disabled": e.disabled }, l.class, `--${e.size}`]]),
590
+ class: E(["m-select", [
591
+ { "--is-open": y.value, "--disabled": e.disabled, "--block": e.block },
592
+ n.class,
593
+ `--${e.size}`
594
+ ]]),
588
595
  style: _(e.style)
589
596
  },
590
597
  [
591
- q(Le, pe({
592
- id: b(P),
598
+ q(Ve, pe({
599
+ id: b(F),
593
600
  ref_key: "mazInputComponent",
594
601
  ref: N,
595
602
  class: "m-select-input"
596
603
  }, e.$attrs, {
597
604
  required: e.required,
598
- "border-active": I.value,
605
+ "border-active": k.value,
599
606
  color: e.color,
600
607
  "model-value": fe.value,
601
608
  autocomplete: "off",
602
609
  size: e.size,
610
+ block: "",
603
611
  disabled: e.disabled,
604
- onFocus: x(le, ["prevent", "stop"]),
605
- onClick: x(le, ["prevent", "stop"]),
606
- onBlur: x(ne, ["prevent", "stop"]),
612
+ onFocus: x(ne, ["prevent", "stop"]),
613
+ onClick: x(ne, ["prevent", "stop"]),
614
+ onBlur: x(le, ["prevent", "stop"]),
607
615
  onChange: s[0] || (s[0] = (u) => i("change", u)),
608
616
  onKeydown: _e
609
617
  }), {
@@ -616,14 +624,14 @@ const Fo = ["aria-label"], Ao = { class: "m-select-list__no-results" }, Lo = {
616
624
  onClick: x(Ze, ["stop"])
617
625
  }, [
618
626
  q(b(m), { class: "m-select-chevron maz-text-xl" })
619
- ], 8, Fo)
627
+ ], 8, Po)
620
628
  ]),
621
629
  _: 1
622
630
  /* STABLE */
623
631
  }, 16, ["id", "required", "border-active", "color", "model-value", "size", "disabled"]),
624
632
  q(uo, { name: me.value }, {
625
633
  default: ae(() => [
626
- y.value ? (C(), $(
634
+ y.value ? (C(), P(
627
635
  "div",
628
636
  {
629
637
  key: 0,
@@ -641,7 +649,7 @@ const Fo = ["aria-label"], Ao = { class: "m-select-list__no-results" }, Lo = {
641
649
  })
642
650
  },
643
651
  [
644
- e.search ? (C(), K(Le, {
652
+ e.search ? (C(), K(Ve, {
645
653
  key: 0,
646
654
  ref_key: "searchInputComponent",
647
655
  ref: ue,
@@ -658,21 +666,21 @@ const Fo = ["aria-label"], Ao = { class: "m-select-list__no-results" }, Lo = {
658
666
  tabindex: "-1",
659
667
  class: "m-select-list__search-input maz-flex-none",
660
668
  "left-icon": b(c),
661
- onKeydown: Be
669
+ onKeydown: $e
662
670
  }, null, 8, ["modelValue", "color", "placeholder", "left-icon"])) : V("v-if", !0),
663
671
  V(`
664
672
  @slot No results slot - Displayed when no results corresponding with search query
665
673
  `),
666
674
  !T.value || T.value.length <= 0 ? H(e.$slots, "no-results", { key: 1 }, () => [
667
- R("span", Ao, [
675
+ R("span", Fo, [
668
676
  q(b(f), { class: "maz-h-6 maz-w-6 maz-text-normal" })
669
677
  ])
670
- ], !0) : (C(), $("div", Lo, [
671
- (C(!0), $(
672
- Fe,
678
+ ], !0) : (C(), P("div", Ao, [
679
+ (C(!0), P(
680
+ Ae,
673
681
  null,
674
- io(T.value, (u, p) => (C(), $(
675
- Fe,
682
+ io(T.value, (u, p) => (C(), P(
683
+ Ae,
676
684
  { key: p },
677
685
  [
678
686
  V(`
@@ -685,12 +693,12 @@ const Fo = ["aria-label"], Ao = { class: "m-select-list__no-results" }, Lo = {
685
693
  }, () => [
686
694
  R(
687
695
  "span",
688
- Mo,
696
+ Lo,
689
697
  G(u.label),
690
698
  1
691
699
  /* TEXT */
692
700
  )
693
- ], !0) : (C(), $("button", {
701
+ ], !0) : (C(), P("button", {
694
702
  key: 1,
695
703
  tabindex: "-1",
696
704
  type: "button",
@@ -702,7 +710,7 @@ const Fo = ["aria-label"], Ao = { class: "m-select-list__no-results" }, Lo = {
702
710
  }
703
711
  ]]),
704
712
  style: _(e.itemHeight ? { height: `${e.itemHeight}px` } : void 0),
705
- onClick: x((w) => $e(u), ["prevent", "stop"])
713
+ onClick: x((w) => Pe(u), ["prevent", "stop"])
706
714
  }, [
707
715
  e.multiple ? (C(), K(b(o), {
708
716
  key: 0,
@@ -728,7 +736,7 @@ const Fo = ["aria-label"], Ao = { class: "m-select-list__no-results" }, Lo = {
728
736
  /* TEXT */
729
737
  )
730
738
  ], !0)
731
- ], 14, Eo))
739
+ ], 14, Mo))
732
740
  ],
733
741
  64
734
742
  /* STABLE_FRAGMENT */
@@ -749,58 +757,58 @@ const Fo = ["aria-label"], Ao = { class: "m-select-list__no-results" }, Lo = {
749
757
  6
750
758
  /* CLASS, STYLE */
751
759
  )), [
752
- [b(Bo), ne]
760
+ [b(So), le]
753
761
  ]);
754
762
  }
755
- }), No = /* @__PURE__ */ se(Ko, [["__scopeId", "data-v-b3157cda"]]);
763
+ }), Ko = /* @__PURE__ */ se(Eo, [["__scopeId", "data-v-7825a2da"]]);
756
764
  function Ye(t) {
757
765
  return !!t;
758
766
  }
759
767
  function Ee(t) {
760
- return [...t].map((n) => {
761
- const o = n.codePointAt(0);
768
+ return [...t].map((l) => {
769
+ const o = l.codePointAt(0);
762
770
  return o ? o % 32 + 127461 : void 0;
763
- }).filter(Ye).map((n) => String.fromCodePoint(n)).join("");
771
+ }).filter(Ye).map((l) => String.fromCodePoint(l)).join("");
764
772
  }
765
- const J = S();
766
- async function To() {
773
+ const J = I();
774
+ async function No() {
767
775
  if (J.value)
768
776
  return J.value;
769
777
  const { default: t } = await import("./examples.mobile.json-zD8w3Qhl.mjs");
770
778
  return J.value = t, J.value;
771
779
  }
772
- function Do(t, n) {
773
- return de(t) === de(n);
780
+ function To(t, l) {
781
+ return de(t) === de(l);
774
782
  }
775
- function Uo(t) {
776
- var n;
783
+ function Do(t) {
784
+ var l;
777
785
  try {
778
- return J.value && t ? (n = mo(t, J.value)) == null ? void 0 : n.formatNational() : void 0;
786
+ return J.value && t ? (l = fo(t, J.value)) == null ? void 0 : l.formatNational() : void 0;
779
787
  } catch (o) {
780
788
  console.error(`[maz-ui](MazPhoneNumberInput) ${o}`);
781
789
  }
782
790
  }
783
- function Ro(t) {
791
+ function Uo(t) {
784
792
  try {
785
- const n = yo(t);
786
- return n || (console.error(`[maz-ui](MazPhoneNumberInput) The code country "${t}" is not available`), !1);
787
- } catch (n) {
788
- return console.error(`[maz-ui](MazPhoneNumberInput) ${n}`), !1;
793
+ const l = mo(t);
794
+ return l || (console.error(`[maz-ui](MazPhoneNumberInput) The code country "${t}" is not available`), !1);
795
+ } catch (l) {
796
+ return console.error(`[maz-ui](MazPhoneNumberInput) ${l}`), !1;
789
797
  }
790
798
  }
791
- function Oo({
799
+ function Ro({
792
800
  phoneNumber: t,
793
- countryCode: n
801
+ countryCode: l
794
802
  }) {
795
803
  try {
796
804
  if (!t)
797
805
  return {
798
806
  isValid: !1,
799
- countryCode: n
807
+ countryCode: l
800
808
  };
801
- const o = vo(t, n);
809
+ const o = yo(t, l);
802
810
  return {
803
- countryCode: (o == null ? void 0 : o.country) ?? n,
811
+ countryCode: (o == null ? void 0 : o.country) ?? l,
804
812
  isValid: (o == null ? void 0 : o.isValid()) ?? !1,
805
813
  isPossible: o == null ? void 0 : o.isPossible(),
806
814
  countryCallingCode: o == null ? void 0 : o.countryCallingCode,
@@ -817,9 +825,9 @@ function Oo({
817
825
  throw new Error(`[MazPhoneNumberInput](getResultsFromPhoneNumber) ${o}`);
818
826
  }
819
827
  }
820
- function Yo(t, n) {
828
+ function Oo(t, l) {
821
829
  try {
822
- return n ? new ho(t).input(n) : "";
830
+ return l ? new vo(t).input(l) : "";
823
831
  } catch (o) {
824
832
  throw new Error(`[MazPhoneNumberInput](getAsYouTypeFormat) ${o}`);
825
833
  }
@@ -827,28 +835,28 @@ function Yo(t, n) {
827
835
  function qe() {
828
836
  return {
829
837
  examples: J,
830
- getAsYouTypeFormat: Yo,
831
- getPhoneNumberResults: Oo,
832
- loadPhoneNumberExamplesFile: To,
833
- getPhoneNumberExample: Uo,
834
- isSameCountryCallingCode: Do,
835
- isCountryAvailable: Ro,
838
+ getAsYouTypeFormat: Oo,
839
+ getPhoneNumberResults: Ro,
840
+ loadPhoneNumberExamplesFile: No,
841
+ getPhoneNumberExample: Do,
842
+ isSameCountryCallingCode: To,
843
+ isCountryAvailable: Uo,
836
844
  getCountries: Te,
837
845
  getCountryCallingCode: de
838
846
  };
839
847
  }
840
- const { isCountryAvailable: qo, getPhoneNumberResults: He, getAsYouTypeFormat: Ho } = qe(), oe = S(""), W = S(), Q = co({
848
+ const { isCountryAvailable: Yo, getPhoneNumberResults: He, getAsYouTypeFormat: qo } = qe(), oe = I(""), W = I(), Q = co({
841
849
  start: 0,
842
850
  end: 0,
843
851
  cursorAtEnd: !0
844
- }), D = S({
852
+ }), D = I({
845
853
  isValid: !1,
846
854
  countryCode: void 0
847
855
  });
848
- async function Wo() {
856
+ async function Ho() {
849
857
  try {
850
- const t = await fetch("https://ipwho.is"), { country_code: n } = await t.json();
851
- return n;
858
+ const t = await fetch("https://ipwho.is"), { country_code: l } = await t.json();
859
+ return l;
852
860
  } catch (t) {
853
861
  throw new Error(`[MazPhoneNumberInput](fetchCountryCode) ${t}`);
854
862
  }
@@ -856,16 +864,16 @@ async function Wo() {
856
864
  function We(t) {
857
865
  if (!t)
858
866
  return "";
859
- const n = new RegExp(/[^\d ()+-]/g);
860
- return t.replaceAll(n, "").trim();
867
+ const l = new RegExp(/[^\d ()+-]/g);
868
+ return t.replaceAll(l, "").trim();
861
869
  }
862
- function jo(t, n) {
870
+ function Wo(t, l) {
863
871
  const o = t == null ? void 0 : t.$el.querySelector("input");
864
- Q.start = o == null ? void 0 : o.selectionStart, Q.end = o == null ? void 0 : o.selectionEnd, Q.cursorAtEnd = n && typeof Q.start == "number" && n.length > 0 ? Q.start >= n.length : !0;
872
+ Q.start = o == null ? void 0 : o.selectionStart, Q.end = o == null ? void 0 : o.selectionEnd, Q.cursorAtEnd = l && typeof Q.start == "number" && l.length > 0 ? Q.start >= l.length : !0;
865
873
  }
866
874
  function je(t) {
867
875
  if (t) {
868
- if (!qo(t)) {
876
+ if (!Yo(t)) {
869
877
  W.value = void 0;
870
878
  return;
871
879
  }
@@ -874,7 +882,7 @@ function je(t) {
874
882
  }
875
883
  function Qe({
876
884
  newPhoneNumber: t,
877
- autoFormat: n,
885
+ autoFormat: l,
878
886
  noFormattingAsYouType: o,
879
887
  updateResults: c = !0
880
888
  }) {
@@ -882,23 +890,23 @@ function Qe({
882
890
  if (c && (D.value = He({
883
891
  phoneNumber: m,
884
892
  countryCode: W.value
885
- })), D.value.isValid && D.value.formatNational && n)
893
+ })), D.value.isValid && D.value.formatNational && l)
886
894
  oe.value = D.value.formatNational;
887
895
  else if (Q.cursorAtEnd && !o) {
888
- const f = Ho(W.value, m);
896
+ const f = qo(W.value, m);
889
897
  oe.value = f;
890
898
  } else
891
899
  oe.value = m;
892
900
  D.value.countryCode && D.value.countryCode !== W.value && Ge({
893
901
  countryCode: D.value.countryCode,
894
- autoFormat: n,
902
+ autoFormat: l,
895
903
  noFormattingAsYouType: o,
896
904
  updateResults: !1
897
905
  });
898
906
  }
899
907
  function Ge({
900
908
  countryCode: t,
901
- autoFormat: n,
909
+ autoFormat: l,
902
910
  noFormattingAsYouType: o,
903
911
  updateResults: c = !0
904
912
  }) {
@@ -911,7 +919,7 @@ function Ge({
911
919
  countryCode: t
912
920
  })), Qe({
913
921
  newPhoneNumber: oe.value,
914
- autoFormat: n,
922
+ autoFormat: l,
915
923
  noFormattingAsYouType: o,
916
924
  updateResults: !1
917
925
  });
@@ -922,29 +930,29 @@ function Je() {
922
930
  const t = window.navigator.language;
923
931
  if (!t)
924
932
  return;
925
- let n = t.slice(3, 7).toUpperCase();
926
- return n === "" && (n = t.slice(0, 2).toUpperCase()), n === "EN" && (n = "US"), n === "JA" && (n = "JP"), {
927
- locale: n,
933
+ let l = t.slice(3, 7).toUpperCase();
934
+ return l === "" && (l = t.slice(0, 2).toUpperCase()), l === "EN" && (l = "US"), l === "JA" && (l = "JP"), {
935
+ locale: l,
928
936
  browserLocale: t
929
937
  };
930
938
  }
931
939
  let ze, Ke;
932
- function Qo(t, n, o) {
933
- return o != null && o[n] ? o[n] : ((Ke !== t || !ze) && (Ke = t, ze = new Intl.DisplayNames([t], { type: "region" })), ze.of(n));
940
+ function jo(t, l, o) {
941
+ return o != null && o[l] ? o[l] : ((Ke !== t || !ze) && (Ke = t, ze = new Intl.DisplayNames([t], { type: "region" })), ze.of(l));
934
942
  }
935
- function Go(t, n) {
943
+ function Qo(t, l) {
936
944
  var m;
937
945
  const o = [], c = Te();
938
946
  t = t ?? ((m = Je()) == null ? void 0 : m.browserLocale) ?? "en-US";
939
947
  for (const f of c) {
940
- const l = Qo(t, f, n);
941
- if (l)
948
+ const n = jo(t, f, l);
949
+ if (n)
942
950
  try {
943
951
  const i = de(f);
944
952
  o.push({
945
953
  iso2: f,
946
954
  dialCode: i,
947
- name: l
955
+ name: n
948
956
  });
949
957
  } catch (i) {
950
958
  console.error(`[MazPhoneNumberInput](getCountryCallingCode) ${i}`);
@@ -957,21 +965,21 @@ function Ie() {
957
965
  setSelectedCountry: je,
958
966
  results: D,
959
967
  sanitizePhoneNumber: We,
960
- fetchCountryCode: Wo,
968
+ fetchCountryCode: Ho,
961
969
  selectedCountry: W,
962
970
  phoneNumber: oe,
963
971
  selectionRange: Q,
964
- saveCursorPosition: jo,
972
+ saveCursorPosition: Wo,
965
973
  onPhoneNumberChanged: Qe,
966
974
  onCountryChanged: Ge,
967
975
  getBrowserLocale: Je,
968
- getCountriesList: Go
976
+ getCountriesList: Qo
969
977
  };
970
978
  }
971
- const Jo = {
979
+ const Go = {
972
980
  key: 0,
973
981
  class: "maz-text-lg"
974
- }, Zo = /* @__PURE__ */ re({
982
+ }, Jo = /* @__PURE__ */ re({
975
983
  __name: "CountrySelector",
976
984
  props: {
977
985
  style: { default: void 0 },
@@ -998,27 +1006,27 @@ const Jo = {
998
1006
  },
999
1007
  emits: ["update:model-value"],
1000
1008
  setup(t) {
1001
- const n = t, o = S(), { phoneNumber: c, getCountriesList: m } = Ie(), f = v(() => m(n.countryLocale, n.customCountriesList)), l = v(() => {
1009
+ const l = t, o = I(), { phoneNumber: c, getCountriesList: m } = Ie(), f = v(() => m(l.countryLocale, l.customCountriesList)), n = v(() => {
1002
1010
  var d;
1003
1011
  return (d = f.value) == null ? void 0 : d.filter((g) => {
1004
1012
  var y;
1005
- return !((y = n.ignoredCountries) != null && y.includes(g.iso2));
1013
+ return !((y = l.ignoredCountries) != null && y.includes(g.iso2));
1006
1014
  });
1007
1015
  }), i = v(() => {
1008
- const d = n.onlyCountries || n.preferredCountries;
1016
+ const d = l.onlyCountries || l.preferredCountries;
1009
1017
  return d == null ? void 0 : d.map(
1010
1018
  (g) => {
1011
1019
  var y;
1012
- return (y = l.value) == null ? void 0 : y.find((P) => P.iso2.includes(g));
1020
+ return (y = n.value) == null ? void 0 : y.find((F) => F.iso2.includes(g));
1013
1021
  }
1014
1022
  );
1015
- }), I = v(() => {
1023
+ }), k = v(() => {
1016
1024
  var d;
1017
- return (d = l.value) == null ? void 0 : d.filter((g) => {
1025
+ return (d = n.value) == null ? void 0 : d.filter((g) => {
1018
1026
  var y;
1019
- return !((y = n.preferredCountries) != null && y.includes(g.iso2));
1027
+ return !((y = l.preferredCountries) != null && y.includes(g.iso2));
1020
1028
  });
1021
- }), h = v(() => n.preferredCountries ? [...i.value ?? [], ...I.value ?? []] : n.onlyCountries ? i.value : l.value), B = v(() => {
1029
+ }), h = v(() => l.preferredCountries ? [...i.value ?? [], ...k.value ?? []] : l.onlyCountries ? i.value : n.value), B = v(() => {
1022
1030
  var d;
1023
1031
  return (d = h.value) == null ? void 0 : d.map((g) => g ? {
1024
1032
  ...g,
@@ -1029,14 +1037,14 @@ const Jo = {
1029
1037
  var d, g;
1030
1038
  (g = (d = o.value) == null ? void 0 : d.$el.querySelector("input")) == null || g.focus();
1031
1039
  }
1032
- return (d, g) => (C(), $(
1040
+ return (d, g) => (C(), P(
1033
1041
  "div",
1034
1042
  {
1035
- class: E(["m-country-selector", [n.class, { "--no-flags": d.noFlags }]]),
1043
+ class: E(["m-country-selector", [l.class, { "--no-flags": d.noFlags }]]),
1036
1044
  style: _(d.style)
1037
1045
  },
1038
1046
  [
1039
- d.modelValue && !d.noFlags ? (C(), $(
1047
+ d.modelValue && !d.noFlags ? (C(), P(
1040
1048
  "button",
1041
1049
  {
1042
1050
  key: 0,
@@ -1063,7 +1071,7 @@ const Jo = {
1063
1071
  2
1064
1072
  /* CLASS */
1065
1073
  )) : V("v-if", !0),
1066
- q(No, pe({
1074
+ q(Ko, pe({
1067
1075
  id: `country-selector-${d.id}`,
1068
1076
  ref_key: "CountrySelectorRef",
1069
1077
  ref: o,
@@ -1091,16 +1099,16 @@ const Jo = {
1091
1099
  },
1092
1100
  "onUpdate:modelValue": g[0] || (g[0] = (y) => d.$emit("update:model-value", y))
1093
1101
  }), {
1094
- default: ae(({ option: y, isSelected: P }) => [
1102
+ default: ae(({ option: y, isSelected: F }) => [
1095
1103
  R(
1096
1104
  "div",
1097
1105
  {
1098
1106
  class: E(["m-country-selector__select__item maz-flex maz-items-center maz-gap-1 maz-truncate", {
1099
- "m-country-selector__select__item--selected": P
1107
+ "m-country-selector__select__item--selected": F
1100
1108
  }])
1101
1109
  },
1102
1110
  [
1103
- !d.noFlags && typeof y.iso2 == "string" ? (C(), $("span", Jo, [
1111
+ !d.noFlags && typeof y.iso2 == "string" ? (C(), P("span", Go, [
1104
1112
  V(`
1105
1113
  @slot Country list flag
1106
1114
  @binding {String} country-code - country code of option - Ex: \`"FR"\`
@@ -1110,7 +1118,7 @@ const Jo = {
1110
1118
  H(d.$slots, "country-list-flag", {
1111
1119
  countryCode: y.iso2,
1112
1120
  option: y,
1113
- isSelected: P
1121
+ isSelected: F
1114
1122
  }, () => [
1115
1123
  Ce(
1116
1124
  G(b(Ee)(y.iso2)),
@@ -1119,11 +1127,11 @@ const Jo = {
1119
1127
  )
1120
1128
  ], !0)
1121
1129
  ])) : V("v-if", !0),
1122
- d.showCodeOnList ? (C(), $(
1130
+ d.showCodeOnList ? (C(), P(
1123
1131
  "span",
1124
1132
  {
1125
1133
  key: 1,
1126
- class: E(["maz-w-9 maz-flex-none", { "maz-text-muted": !P }])
1134
+ class: E(["maz-w-9 maz-flex-none", { "maz-text-muted": !F }])
1127
1135
  },
1128
1136
  G(y.dialCode),
1129
1137
  3
@@ -1132,7 +1140,7 @@ const Jo = {
1132
1140
  R(
1133
1141
  "span",
1134
1142
  {
1135
- class: E(["maz-flex-1 maz-truncate", { "maz-font-semibold": P }])
1143
+ class: E(["maz-flex-1 maz-truncate", { "maz-font-semibold": F }])
1136
1144
  },
1137
1145
  G(y.name),
1138
1146
  3
@@ -1151,9 +1159,9 @@ const Jo = {
1151
1159
  /* CLASS, STYLE */
1152
1160
  ));
1153
1161
  }
1154
- }), Xo = /* @__PURE__ */ se(Zo, [["__scopeId", "data-v-e21defba"]]), xo = /* @__PURE__ */ re({
1162
+ }), Zo = /* @__PURE__ */ se(Jo, [["__scopeId", "data-v-e21defba"]]), Xo = /* @__PURE__ */ re({
1155
1163
  __name: "PhoneInput",
1156
- props: /* @__PURE__ */ Ae({
1164
+ props: /* @__PURE__ */ Le({
1157
1165
  id: {},
1158
1166
  color: {},
1159
1167
  size: {},
@@ -1170,20 +1178,20 @@ const Jo = {
1170
1178
  modelValue: {},
1171
1179
  modelModifiers: {}
1172
1180
  }),
1173
- emits: /* @__PURE__ */ Ae(["update:model-value"], ["update:modelValue"]),
1174
- setup(t, { emit: n }) {
1175
- const o = t, c = n, m = po(t, "modelValue"), { loadPhoneNumberExamplesFile: f, getPhoneNumberExample: l, examples: i } = qe(), { selectedCountry: I, results: h, saveCursorPosition: B } = Ie(), M = S(!1), d = v(() => {
1176
- var F;
1181
+ emits: /* @__PURE__ */ Le(["update:model-value"], ["update:modelValue"]),
1182
+ setup(t, { emit: l }) {
1183
+ const o = t, c = l, m = po(t, "modelValue"), { loadPhoneNumberExamplesFile: f, getPhoneNumberExample: n, examples: i } = qe(), { selectedCountry: k, results: h, saveCursorPosition: B } = Ie(), M = I(!1), d = v(() => {
1184
+ var $;
1177
1185
  if (o.label)
1178
1186
  return o.label;
1179
1187
  const z = o.locales.phoneInput.placeholder;
1180
1188
  if (o.noExample || !i.value)
1181
1189
  return z;
1182
1190
  {
1183
- const r = l(I.value);
1184
- return (F = h.value) != null && F.isValid || !r ? z : `${o.locales.phoneInput.example} ${r}`;
1191
+ const a = n(k.value);
1192
+ return ($ = h.value) != null && $.isValid || !a ? z : `${o.locales.phoneInput.example} ${a}`;
1185
1193
  }
1186
- }), g = S();
1194
+ }), g = I();
1187
1195
  async function y() {
1188
1196
  try {
1189
1197
  return f();
@@ -1191,39 +1199,36 @@ const Jo = {
1191
1199
  console.error("[maz-ui](MazPhoneNumberInput) while loading phone number examples file", z);
1192
1200
  }
1193
1201
  }
1194
- async function P(z) {
1202
+ async function F(z) {
1195
1203
  g.value && z && B(g.value, z), await ee(), c("update:model-value", z);
1196
1204
  }
1197
- return Ve(() => {
1205
+ return we(() => {
1198
1206
  o.noExample || y();
1199
- }), (z, F) => {
1200
- const r = fo("MazInput");
1201
- return C(), K(r, pe({
1202
- id: `phone-number-${z.id}`,
1203
- ref_key: "PhoneInputRef",
1204
- ref: g,
1205
- "model-value": m.value
1206
- }, z.$attrs, {
1207
- label: d.value,
1208
- disabled: z.disabled,
1209
- color: z.color,
1210
- error: z.error,
1211
- size: z.size,
1212
- success: z.success,
1213
- type: "tel",
1214
- inputmode: "tel",
1215
- class: ["m-phone-input", {
1216
- "--border-radius": z.hasRadius,
1217
- "--error": z.error || !b(h).isValid,
1218
- "--focused": M.value
1219
- }],
1220
- onFocus: F[0] || (F[0] = (k) => M.value = !0),
1221
- onBlur: F[1] || (F[1] = (k) => M.value = !1),
1222
- "onUpdate:modelValue": P
1223
- }), null, 16, ["id", "model-value", "label", "disabled", "color", "error", "size", "success", "class"]);
1224
- };
1207
+ }), (z, $) => (C(), K(Ve, pe({
1208
+ id: `phone-number-${z.id}`,
1209
+ ref_key: "PhoneInputRef",
1210
+ ref: g,
1211
+ "model-value": m.value
1212
+ }, z.$attrs, {
1213
+ label: d.value,
1214
+ disabled: z.disabled,
1215
+ color: z.color,
1216
+ error: z.error,
1217
+ size: z.size,
1218
+ success: z.success,
1219
+ type: "tel",
1220
+ inputmode: "tel",
1221
+ class: ["m-phone-input", {
1222
+ "--border-radius": z.hasRadius,
1223
+ "--error": z.error || !b(h).isValid,
1224
+ "--focused": M.value
1225
+ }],
1226
+ onFocus: $[0] || ($[0] = (a) => M.value = !0),
1227
+ onBlur: $[1] || ($[1] = (a) => M.value = !1),
1228
+ "onUpdate:modelValue": $[2] || ($[2] = (a) => F(a))
1229
+ }), null, 16, ["id", "model-value", "label", "disabled", "color", "error", "size", "success", "class"]));
1225
1230
  }
1226
- }), _o = /* @__PURE__ */ se(xo, [["__scopeId", "data-v-6ce648ce"]]), et = {
1231
+ }), xo = /* @__PURE__ */ se(Xo, [["__scopeId", "data-v-e2bf70df"]]), _o = {
1227
1232
  countrySelector: {
1228
1233
  placeholder: "Country code",
1229
1234
  error: "Choose country",
@@ -1233,7 +1238,7 @@ const Jo = {
1233
1238
  placeholder: "Phone number",
1234
1239
  example: "Example:"
1235
1240
  }
1236
- }, ot = /* @__PURE__ */ re({
1241
+ }, et = /* @__PURE__ */ re({
1237
1242
  inheritAttrs: !1,
1238
1243
  __name: "MazPhoneNumberInput",
1239
1244
  props: {
@@ -1269,58 +1274,59 @@ const Jo = {
1269
1274
  success: { type: Boolean },
1270
1275
  error: { type: Boolean },
1271
1276
  countrySelectorDisplayName: { type: Boolean },
1272
- countrySelectorWidth: { default: "9rem" }
1277
+ countrySelectorWidth: { default: "9rem" },
1278
+ block: { type: Boolean }
1273
1279
  },
1274
1280
  emits: ["update", "data", "country-code", "update:model-value", "update:country-code"],
1275
- setup(t, { emit: n }) {
1276
- const o = n, c = t, {
1281
+ setup(t, { emit: l }) {
1282
+ const o = l, c = t, {
1277
1283
  phoneNumber: m,
1278
1284
  selectedCountry: f,
1279
- results: l,
1285
+ results: n,
1280
1286
  fetchCountryCode: i,
1281
- setSelectedCountry: I,
1287
+ setSelectedCountry: k,
1282
1288
  onPhoneNumberChanged: h,
1283
1289
  onCountryChanged: B,
1284
1290
  getBrowserLocale: M
1285
- } = Ie(), d = we({
1291
+ } = Ie(), d = ke({
1286
1292
  componentName: "MazPhoneNumberInput",
1287
1293
  providedId: c.id
1288
1294
  }), g = v(() => ({
1289
- ...et,
1295
+ ..._o,
1290
1296
  ...c.translations
1291
1297
  }));
1292
- Ve(async () => {
1293
- var r;
1294
- if (I(c.countryCode ?? c.defaultCountryCode), c.fetchCountry && !f.value) {
1295
- const k = await i();
1296
- I(k);
1298
+ we(async () => {
1299
+ var a;
1300
+ if (k(c.countryCode ?? c.defaultCountryCode), c.fetchCountry && !f.value) {
1301
+ const S = await i();
1302
+ k(S);
1297
1303
  }
1298
1304
  if (!c.defaultCountryCode && !c.noUseBrowserLocale && !f.value) {
1299
- const k = (r = M()) == null ? void 0 : r.locale;
1300
- I(k);
1305
+ const S = (a = M()) == null ? void 0 : a.locale;
1306
+ k(S);
1301
1307
  }
1302
1308
  });
1303
- const y = S();
1304
- function P() {
1305
- var r;
1306
- return (r = y.value) == null ? void 0 : r.$el.querySelector("input");
1309
+ const y = I();
1310
+ function F() {
1311
+ var a;
1312
+ return (a = y.value) == null ? void 0 : a.$el.querySelector("input");
1307
1313
  }
1308
1314
  async function z() {
1309
- var r;
1310
- await ee(), (r = P()) == null || r.select();
1315
+ var a;
1316
+ await ee(), (a = F()) == null || a.select();
1311
1317
  }
1312
- function F(r) {
1318
+ function $(a) {
1313
1319
  B({
1314
- countryCode: r,
1320
+ countryCode: a,
1315
1321
  autoFormat: c.autoFormat,
1316
1322
  noFormattingAsYouType: c.noFormattingAsYouType
1317
1323
  }), z();
1318
1324
  }
1319
1325
  return he(
1320
1326
  () => c.modelValue ?? c.defaultPhoneNumber,
1321
- (r, k) => {
1322
- r && r !== k && r !== m.value && h({
1323
- newPhoneNumber: r,
1327
+ (a, S) => {
1328
+ a && a !== S && a !== m.value && h({
1329
+ newPhoneNumber: a,
1324
1330
  autoFormat: c.autoFormat,
1325
1331
  noFormattingAsYouType: c.noFormattingAsYouType
1326
1332
  });
@@ -1330,9 +1336,9 @@ const Jo = {
1330
1336
  }
1331
1337
  ), he(
1332
1338
  () => c.countryCode ?? c.defaultCountryCode,
1333
- (r, k) => {
1334
- r && r !== k && r !== f.value && B({
1335
- countryCode: r,
1339
+ (a, S) => {
1340
+ a && a !== S && a !== f.value && B({
1341
+ countryCode: a,
1336
1342
  autoFormat: c.autoFormat,
1337
1343
  noFormattingAsYouType: c.noFormattingAsYouType
1338
1344
  });
@@ -1341,65 +1347,66 @@ const Jo = {
1341
1347
  immediate: !0
1342
1348
  }
1343
1349
  ), he(
1344
- l,
1345
- (r) => {
1346
- o("update", r), o("data", r), r.e164 && r.isValid ? o("update:model-value", r.e164) : o("update:model-value", m.value), o("country-code", f.value), o("update:country-code", f.value);
1350
+ n,
1351
+ (a) => {
1352
+ o("update", a), o("data", a), a.e164 && a.isValid ? o("update:model-value", a.e164) : o("update:model-value", m.value), o("country-code", f.value), o("update:country-code", f.value);
1347
1353
  },
1348
1354
  {
1349
1355
  immediate: !0
1350
1356
  }
1351
- ), (r, k) => {
1357
+ ), (a, S) => {
1352
1358
  var Z;
1353
- return C(), $(
1359
+ return C(), P(
1354
1360
  "div",
1355
1361
  {
1356
- class: E(["m-phone-number-input", [c.class]]),
1357
- style: _(r.style)
1362
+ class: E(["m-phone-number-input", [c.class, { "--block": a.block }]]),
1363
+ style: _(a.style)
1358
1364
  },
1359
1365
  [
1360
- r.noCountrySelector ? V("v-if", !0) : (C(), K(Xo, {
1366
+ a.noCountrySelector ? V("v-if", !0) : (C(), K(Zo, {
1361
1367
  key: 0,
1362
1368
  id: b(d),
1363
1369
  "model-value": b(f),
1364
- color: r.color,
1365
- size: r.size,
1366
- "country-locale": r.countryLocale,
1367
- "country-selector-display-name": r.countrySelectorDisplayName,
1368
- "custom-countries-list": r.customCountriesList,
1369
- "ignored-countries": r.ignoredCountries,
1370
- "list-position": r.listPosition,
1371
- "no-flags": r.noFlags,
1372
- "no-search": r.noSearch,
1373
- error: r.error || (r.noValidationError ? !1 : !!b(m) && !b(f)),
1374
- success: r.success || (r.noValidationSuccess ? !1 : (Z = b(l)) == null ? void 0 : Z.isValid),
1370
+ color: a.color,
1371
+ size: a.size,
1372
+ "country-locale": a.countryLocale,
1373
+ "country-selector-display-name": a.countrySelectorDisplayName,
1374
+ "custom-countries-list": a.customCountriesList,
1375
+ "ignored-countries": a.ignoredCountries,
1376
+ "list-position": a.listPosition,
1377
+ "no-flags": a.noFlags,
1378
+ "no-search": a.noSearch,
1379
+ error: a.error || (a.noValidationError ? !1 : !!b(m) && !b(f)),
1380
+ success: a.success || (a.noValidationSuccess ? !1 : (Z = b(n)) == null ? void 0 : Z.isValid),
1375
1381
  locales: g.value,
1376
- disabled: r.disabled,
1377
- "show-code-on-list": r.showCodeOnList,
1378
- "only-countries": r.onlyCountries,
1379
- "preferred-countries": r.preferredCountries,
1380
- width: r.countrySelectorWidth,
1381
- "onUpdate:modelValue": F
1382
+ disabled: a.disabled,
1383
+ "show-code-on-list": a.showCodeOnList,
1384
+ "only-countries": a.onlyCountries,
1385
+ "preferred-countries": a.preferredCountries,
1386
+ width: a.countrySelectorWidth,
1387
+ "onUpdate:modelValue": $
1382
1388
  }, null, 8, ["id", "model-value", "color", "size", "country-locale", "country-selector-display-name", "custom-countries-list", "ignored-countries", "list-position", "no-flags", "no-search", "error", "success", "locales", "disabled", "show-code-on-list", "only-countries", "preferred-countries", "width"])),
1383
- q(_o, {
1389
+ q(xo, {
1384
1390
  id: b(d),
1385
1391
  ref_key: "PhoneInputRef",
1386
1392
  ref: y,
1387
1393
  "model-value": b(m),
1388
- color: r.color,
1389
- size: r.size,
1390
- "no-example": r.noExample,
1391
- disabled: r.disabled,
1392
- "has-radius": !r.noCountrySelector,
1393
- success: r.success || (r.noValidationSuccess ? !1 : b(l).isValid),
1394
- error: r.error || (r.noValidationError ? !1 : !!b(m) && !b(l).isValid),
1394
+ color: a.color,
1395
+ size: a.size,
1396
+ "no-example": a.noExample,
1397
+ block: "",
1398
+ disabled: a.disabled,
1399
+ "has-radius": !a.noCountrySelector,
1400
+ success: a.success || (a.noValidationSuccess ? !1 : b(n).isValid),
1401
+ error: a.error || (a.noValidationError ? !1 : !!b(m) && !b(n).isValid),
1395
1402
  locales: g.value,
1396
- "no-formatting-as-you-type": r.noFormattingAsYouType,
1397
- "auto-format": r.autoFormat,
1398
- label: r.placeholder,
1399
- "onUpdate:modelValue": k[0] || (k[0] = (N) => b(h)({
1403
+ "no-formatting-as-you-type": a.noFormattingAsYouType,
1404
+ "auto-format": a.autoFormat,
1405
+ label: a.placeholder,
1406
+ "onUpdate:modelValue": S[0] || (S[0] = (N) => b(h)({
1400
1407
  newPhoneNumber: N,
1401
- autoFormat: r.autoFormat,
1402
- noFormattingAsYouType: r.noFormattingAsYouType
1408
+ autoFormat: a.autoFormat,
1409
+ noFormattingAsYouType: a.noFormattingAsYouType
1403
1410
  }))
1404
1411
  }, null, 8, ["id", "model-value", "color", "size", "no-example", "disabled", "has-radius", "success", "error", "locales", "no-formatting-as-you-type", "auto-format", "label"])
1405
1412
  ],
@@ -1408,9 +1415,9 @@ const Jo = {
1408
1415
  );
1409
1416
  };
1410
1417
  }
1411
- }), lt = /* @__PURE__ */ se(ot, [["__scopeId", "data-v-bf4f204d"]]);
1418
+ }), lt = /* @__PURE__ */ se(et, [["__scopeId", "data-v-5481a936"]]);
1412
1419
  export {
1413
1420
  lt as M,
1414
1421
  se as _,
1415
- we as u
1422
+ ke as u
1416
1423
  };