@alikhalilll/ui 1.2.0 → 1.2.1
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/dist/chunks/{ADrawerContent.vue_vue_type_script_setup_true_lang-BivIZvV1.mjs → ADrawerContent.vue_vue_type_script_setup_true_lang-W28CSzER.mjs} +15 -15
- package/dist/chunks/ADrawerContent.vue_vue_type_script_setup_true_lang-W28CSzER.mjs.map +1 -0
- package/dist/chunks/{APopoverContent.vue_vue_type_script_setup_true_lang-o1XhV9DM.mjs → APopoverContent.vue_vue_type_script_setup_true_lang-CjiJ12DR.mjs} +6 -6
- package/dist/chunks/APopoverContent.vue_vue_type_script_setup_true_lang-CjiJ12DR.mjs.map +1 -0
- package/dist/chunks/{AResponsivePopoverContent.vue_vue_type_script_setup_true_lang-BYEb5UBL.mjs → AResponsivePopoverContent.vue_vue_type_script_setup_true_lang-5YbO6FdM.mjs} +3 -3
- package/dist/chunks/{AResponsivePopoverContent.vue_vue_type_script_setup_true_lang-BYEb5UBL.mjs.map → AResponsivePopoverContent.vue_vue_type_script_setup_true_lang-5YbO6FdM.mjs.map} +1 -1
- package/dist/chunks/{ATellInput.vue_vue_type_script_setup_true_lang-Bv_lLV_l.mjs → ATellInput.vue_vue_type_script_setup_true_lang-D7hPj1g1.mjs} +318 -314
- package/dist/chunks/ATellInput.vue_vue_type_script_setup_true_lang-D7hPj1g1.mjs.map +1 -0
- package/dist/drawer.mjs +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.mjs +4 -4
- package/dist/popover.mjs +1 -1
- package/dist/responsive-popover.mjs +1 -1
- package/dist/tell-input.d.ts +9 -1
- package/dist/tell-input.mjs +1 -1
- package/entries/tell-input/README.md +1 -0
- package/package.json +1 -1
- package/dist/chunks/ADrawerContent.vue_vue_type_script_setup_true_lang-BivIZvV1.mjs.map +0 -1
- package/dist/chunks/APopoverContent.vue_vue_type_script_setup_true_lang-o1XhV9DM.mjs.map +0 -1
- package/dist/chunks/ATellInput.vue_vue_type_script_setup_true_lang-Bv_lLV_l.mjs.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as N, onMounted as be, defineComponent as _e, computed as C, watch as re, openBlock as B, createElementBlock as K, normalizeClass as V, unref as w, toDisplayString as M, renderSlot as h, createElementVNode as _, useModel as me, createBlock as he, withCtx as U, createVNode as F, createCommentVNode as H, withDirectives as He, vModelText as Ze, Fragment as pe, renderList as ke, mergeModels as De, useId as je, Transition as $e, createSlots as Je, normalizeProps as X, guardReactiveProps as ee } from "vue";
|
|
2
2
|
import { useDebounceFn as Ye } from "@vueuse/core";
|
|
3
|
-
import { ChevronDown as qe, Search as We, Check as
|
|
3
|
+
import { ChevronDown as qe, Search as We, Check as xe, CheckCircle2 as Qe, AlertCircle as Xe } from "lucide-vue-next";
|
|
4
4
|
import { isValidPhoneNumber as et, parsePhoneNumberFromString as de, getExampleNumber as tt } from "libphonenumber-js";
|
|
5
|
-
import { c as
|
|
5
|
+
import { c as R } from "./cn-B6yFEsav.mjs";
|
|
6
6
|
import { c as ae, d as W, b as Me, D as Pe } from "./sizes-B_9MfLkz.mjs";
|
|
7
7
|
import at from "libphonenumber-js/examples.mobile.json";
|
|
8
|
-
import { cva as
|
|
9
|
-
import { _ as
|
|
8
|
+
import { cva as lt } from "class-variance-authority";
|
|
9
|
+
import { _ as rt, b as nt, a as ot } from "./AResponsivePopoverContent.vue_vue_type_script_setup_true_lang-5YbO6FdM.mjs";
|
|
10
10
|
const st = [
|
|
11
11
|
{ name: "arabic-indic", base: 1632 },
|
|
12
12
|
// ٠١٢٣٤٥٦٧٨٩
|
|
@@ -18,35 +18,35 @@ const st = [
|
|
|
18
18
|
// ০১২৩৪৫৬৭৮৯
|
|
19
19
|
], it = (() => {
|
|
20
20
|
const t = /* @__PURE__ */ new Map();
|
|
21
|
-
for (const { base:
|
|
22
|
-
for (let e = 0; e <= 9; e++) t.set(
|
|
21
|
+
for (const { base: r } of st)
|
|
22
|
+
for (let e = 0; e <= 9; e++) t.set(r + e, String(e));
|
|
23
23
|
return t;
|
|
24
24
|
})();
|
|
25
25
|
function ce(t) {
|
|
26
|
-
const
|
|
26
|
+
const r = String(t ?? "");
|
|
27
27
|
let e = "";
|
|
28
|
-
for (const o of
|
|
28
|
+
for (const o of r) {
|
|
29
29
|
const p = o.codePointAt(0);
|
|
30
30
|
e += p != null && it.get(p) || o;
|
|
31
31
|
}
|
|
32
32
|
return e;
|
|
33
33
|
}
|
|
34
|
-
const
|
|
34
|
+
const Ee = "ali_ui_phone_countries_v1", ut = "https://restcountries.com/v3.1/all?fields=name,cca2,idd,flags", ct = at, Ie = () => typeof window < "u";
|
|
35
35
|
function Q(t) {
|
|
36
36
|
return ce(String(t ?? "")).replace(/\D/g, "");
|
|
37
37
|
}
|
|
38
|
-
function dt(t,
|
|
39
|
-
if (!
|
|
38
|
+
function dt(t, r) {
|
|
39
|
+
if (!r) return t;
|
|
40
40
|
try {
|
|
41
|
-
const e = new Intl.NumberFormat(
|
|
41
|
+
const e = new Intl.NumberFormat(r, { useGrouping: !1 });
|
|
42
42
|
return t.replace(/[0-9]/g, (o) => e.format(Number(o)));
|
|
43
43
|
} catch {
|
|
44
44
|
return t;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
const
|
|
49
|
-
return
|
|
47
|
+
function ye(t) {
|
|
48
|
+
const r = Q(t);
|
|
49
|
+
return r ? `+${r}` : "";
|
|
50
50
|
}
|
|
51
51
|
function ue(t) {
|
|
52
52
|
return String(t ?? "").trim().toUpperCase();
|
|
@@ -54,30 +54,30 @@ function ue(t) {
|
|
|
54
54
|
function Ue(t) {
|
|
55
55
|
return String(t ?? "").replace(/^0+/, "");
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
const e =
|
|
57
|
+
function le(t, r) {
|
|
58
|
+
const e = ye(t), o = Ue(Q(r));
|
|
59
59
|
return e && o ? `${e}${o}` : null;
|
|
60
60
|
}
|
|
61
61
|
function ft(t) {
|
|
62
|
-
const
|
|
63
|
-
if (!
|
|
64
|
-
const e =
|
|
62
|
+
const r = Q(t);
|
|
63
|
+
if (!r) return { min: null, max: null };
|
|
64
|
+
const e = r.length;
|
|
65
65
|
return { min: Math.max(4, e - 2), max: e + 2 };
|
|
66
66
|
}
|
|
67
67
|
function gt(t) {
|
|
68
|
-
const
|
|
69
|
-
if (!
|
|
70
|
-
const e = t?.suffixes?.[0]?.trim() ?? "", o = `${
|
|
68
|
+
const r = t?.root?.trim();
|
|
69
|
+
if (!r || !r.startsWith("+")) return null;
|
|
70
|
+
const e = t?.suffixes?.[0]?.trim() ?? "", o = `${r}${e}`;
|
|
71
71
|
return o.startsWith("+") ? o : null;
|
|
72
72
|
}
|
|
73
73
|
function fe(t) {
|
|
74
74
|
return String(t ?? "").toLowerCase().replace(/\s+/g, " ").trim().replace(/[^\p{L}\p{N}+ ]/gu, "");
|
|
75
75
|
}
|
|
76
|
-
function pt(t,
|
|
77
|
-
if (!
|
|
76
|
+
function pt(t, r) {
|
|
77
|
+
if (!r) return t;
|
|
78
78
|
let e;
|
|
79
79
|
try {
|
|
80
|
-
e = new Intl.DisplayNames([
|
|
80
|
+
e = new Intl.DisplayNames([r], { type: "region" });
|
|
81
81
|
} catch {
|
|
82
82
|
return t;
|
|
83
83
|
}
|
|
@@ -99,17 +99,17 @@ function pt(t, l) {
|
|
|
99
99
|
};
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
-
function A(t,
|
|
102
|
+
function A(t, r, e) {
|
|
103
103
|
const o = Q(e);
|
|
104
104
|
return {
|
|
105
|
-
label: `${
|
|
105
|
+
label: `${r} (+${o})`,
|
|
106
106
|
value: t,
|
|
107
|
-
search_key: fe(`${
|
|
107
|
+
search_key: fe(`${r} +${o} ${t}`),
|
|
108
108
|
raw_data: {
|
|
109
109
|
iso2: t,
|
|
110
110
|
dial_code: `+${o}`,
|
|
111
111
|
dial_digits: o,
|
|
112
|
-
name:
|
|
112
|
+
name: r,
|
|
113
113
|
flag: `https://flagcdn.com/w40/${t.toLowerCase()}.png`,
|
|
114
114
|
source: "fallback",
|
|
115
115
|
original: {}
|
|
@@ -141,7 +141,7 @@ const Le = [
|
|
|
141
141
|
A("ID", "Indonesia", "+62")
|
|
142
142
|
];
|
|
143
143
|
function Re() {
|
|
144
|
-
const t =
|
|
144
|
+
const t = N([]), r = N(!1), e = N(/* @__PURE__ */ new Map()), o = N(/* @__PURE__ */ new Map());
|
|
145
145
|
function p(v) {
|
|
146
146
|
const y = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
|
|
147
147
|
for (const a of v) {
|
|
@@ -157,10 +157,10 @@ function Re() {
|
|
|
157
157
|
function u(v) {
|
|
158
158
|
t.value = v, p(v);
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function z(v) {
|
|
161
161
|
const y = [];
|
|
162
162
|
for (const a of v) {
|
|
163
|
-
const c = a?.name?.common?.trim(), f = ue(a?.cca2), $ = gt(a?.idd),
|
|
163
|
+
const c = a?.name?.common?.trim(), f = ue(a?.cca2), $ = gt(a?.idd), L = a?.flags?.png?.trim() || a?.flags?.svg?.trim() || null;
|
|
164
164
|
if (!c || !f || !$) continue;
|
|
165
165
|
const E = Q($), P = fe(`${c} ${$} ${f} ${E}`);
|
|
166
166
|
y.push({
|
|
@@ -172,7 +172,7 @@ function Re() {
|
|
|
172
172
|
dial_code: $,
|
|
173
173
|
dial_digits: E,
|
|
174
174
|
name: c,
|
|
175
|
-
flag:
|
|
175
|
+
flag: L,
|
|
176
176
|
source: "restcountries",
|
|
177
177
|
original: a
|
|
178
178
|
}
|
|
@@ -193,9 +193,9 @@ function Re() {
|
|
|
193
193
|
async function j(v) {
|
|
194
194
|
const y = !!v?.force;
|
|
195
195
|
if (!y && t.value.length) return t.value;
|
|
196
|
-
if (!y &&
|
|
196
|
+
if (!y && Ie())
|
|
197
197
|
try {
|
|
198
|
-
const g = localStorage.getItem(
|
|
198
|
+
const g = localStorage.getItem(Ee);
|
|
199
199
|
if (g) {
|
|
200
200
|
const a = JSON.parse(g);
|
|
201
201
|
if (Array.isArray(a) && a.length)
|
|
@@ -203,24 +203,24 @@ function Re() {
|
|
|
203
203
|
}
|
|
204
204
|
} catch {
|
|
205
205
|
}
|
|
206
|
-
|
|
206
|
+
r.value = !0;
|
|
207
207
|
try {
|
|
208
208
|
const g = await fetch(ut);
|
|
209
209
|
if (!g.ok) throw new Error(`Failed to fetch countries: ${g.status}`);
|
|
210
|
-
const a = await g.json(), c =
|
|
211
|
-
if (u(c.length ? c : Le),
|
|
210
|
+
const a = await g.json(), c = z(a);
|
|
211
|
+
if (u(c.length ? c : Le), Ie())
|
|
212
212
|
try {
|
|
213
|
-
localStorage.setItem(
|
|
213
|
+
localStorage.setItem(Ee, JSON.stringify(t.value));
|
|
214
214
|
} catch {
|
|
215
215
|
}
|
|
216
216
|
return t.value;
|
|
217
217
|
} catch {
|
|
218
218
|
return u(Le), t.value;
|
|
219
219
|
} finally {
|
|
220
|
-
|
|
220
|
+
r.value = !1;
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function O(v, y = 50) {
|
|
224
224
|
const g = fe(v);
|
|
225
225
|
if (!g) return t.value.slice(0, y);
|
|
226
226
|
const a = [];
|
|
@@ -232,17 +232,17 @@ function Re() {
|
|
|
232
232
|
function Y(v) {
|
|
233
233
|
return e.value.get(ue(v)) ?? null;
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function I(v) {
|
|
236
236
|
return o.value.get(Q(v)) ?? [];
|
|
237
237
|
}
|
|
238
238
|
function k(v, y) {
|
|
239
239
|
const g = ue(v.iso2);
|
|
240
240
|
if (!g) return null;
|
|
241
241
|
try {
|
|
242
|
-
const a = tt(g, ct), c = a?.formatNational?.() ?? "", f = a?.format?.("E.164") ?? "", $ = ft(c),
|
|
242
|
+
const a = tt(g, ct), c = a?.formatNational?.() ?? "", f = a?.format?.("E.164") ?? "", $ = ft(c), L = v.dial_code ? ye(v.dial_code) : f ? `+${a?.countryCallingCode}` : "", E = Q(c);
|
|
243
243
|
return {
|
|
244
244
|
iso2: g,
|
|
245
|
-
dial_code:
|
|
245
|
+
dial_code: L,
|
|
246
246
|
placeholder: "",
|
|
247
247
|
example_national: c,
|
|
248
248
|
example_e164: f,
|
|
@@ -269,7 +269,7 @@ function Re() {
|
|
|
269
269
|
return {
|
|
270
270
|
ok: !1,
|
|
271
271
|
reason: "country_not_supported",
|
|
272
|
-
country: { iso2: g, dial_code:
|
|
272
|
+
country: { iso2: g, dial_code: ye(y.dial_code) },
|
|
273
273
|
phone: { raw: ("phone" in v ? v.phone : null) ?? null, digits: "" },
|
|
274
274
|
full_phone: null,
|
|
275
275
|
required: null
|
|
@@ -299,19 +299,19 @@ function Re() {
|
|
|
299
299
|
reason: "phone_has_non_digits",
|
|
300
300
|
country: { iso2: a.iso2, dial_code: a.dial_code },
|
|
301
301
|
phone: { raw: c, digits: f },
|
|
302
|
-
full_phone:
|
|
302
|
+
full_phone: le(a.dial_code, f),
|
|
303
303
|
required: a
|
|
304
304
|
};
|
|
305
|
-
const $ = Ue(f), { min:
|
|
306
|
-
if (
|
|
305
|
+
const $ = Ue(f), { min: L, max: E } = a.national_number_length;
|
|
306
|
+
if (L !== null && $.length < L)
|
|
307
307
|
return {
|
|
308
308
|
ok: !1,
|
|
309
309
|
reason: "too_short",
|
|
310
310
|
country: { iso2: a.iso2, dial_code: a.dial_code },
|
|
311
311
|
phone: { raw: c, digits: f },
|
|
312
|
-
full_phone:
|
|
312
|
+
full_phone: le(a.dial_code, f),
|
|
313
313
|
required: a,
|
|
314
|
-
details: { min:
|
|
314
|
+
details: { min: L, actual: $.length }
|
|
315
315
|
};
|
|
316
316
|
if (E !== null && $.length > E)
|
|
317
317
|
return {
|
|
@@ -319,11 +319,11 @@ function Re() {
|
|
|
319
319
|
reason: "too_long",
|
|
320
320
|
country: { iso2: a.iso2, dial_code: a.dial_code },
|
|
321
321
|
phone: { raw: c, digits: f },
|
|
322
|
-
full_phone:
|
|
322
|
+
full_phone: le(a.dial_code, f),
|
|
323
323
|
required: a,
|
|
324
324
|
details: { max: E, actual: $.length }
|
|
325
325
|
};
|
|
326
|
-
const P =
|
|
326
|
+
const P = le(a.dial_code, f) ?? String(c);
|
|
327
327
|
try {
|
|
328
328
|
if (!et(P, g)) {
|
|
329
329
|
const S = de(P, g);
|
|
@@ -341,34 +341,34 @@ function Re() {
|
|
|
341
341
|
}
|
|
342
342
|
};
|
|
343
343
|
}
|
|
344
|
-
const
|
|
344
|
+
const G = de(P, g);
|
|
345
345
|
return {
|
|
346
346
|
ok: !0,
|
|
347
347
|
reason: null,
|
|
348
348
|
country: { iso2: a.iso2, dial_code: a.dial_code },
|
|
349
349
|
phone: { raw: c, digits: f },
|
|
350
|
-
full_phone:
|
|
350
|
+
full_phone: G?.number ?? P,
|
|
351
351
|
required: a
|
|
352
352
|
};
|
|
353
|
-
} catch (
|
|
353
|
+
} catch (T) {
|
|
354
354
|
return {
|
|
355
355
|
ok: !1,
|
|
356
356
|
reason: "parse_failed",
|
|
357
357
|
country: { iso2: a.iso2, dial_code: a.dial_code },
|
|
358
358
|
phone: { raw: c, digits: f },
|
|
359
|
-
full_phone:
|
|
359
|
+
full_phone: le(a.dial_code, f),
|
|
360
360
|
required: a,
|
|
361
|
-
details: { error:
|
|
361
|
+
details: { error: T?.message ?? String(T) }
|
|
362
362
|
};
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
365
|
return {
|
|
366
366
|
countries: t,
|
|
367
|
-
isCountriesLoading:
|
|
367
|
+
isCountriesLoading: r,
|
|
368
368
|
getCountries: j,
|
|
369
|
-
searchCountries:
|
|
369
|
+
searchCountries: O,
|
|
370
370
|
getCountryByValue: Y,
|
|
371
|
-
getCountriesByDial:
|
|
371
|
+
getCountriesByDial: I,
|
|
372
372
|
getRequiredInfo: k,
|
|
373
373
|
validate: x
|
|
374
374
|
};
|
|
@@ -471,20 +471,20 @@ function mt() {
|
|
|
471
471
|
function ht() {
|
|
472
472
|
if (!ne()) return null;
|
|
473
473
|
try {
|
|
474
|
-
const
|
|
475
|
-
return
|
|
474
|
+
const r = (navigator.language ?? "").match(/^[a-z]{2,3}-([A-Z]{2})/);
|
|
475
|
+
return r ? r[1] : null;
|
|
476
476
|
} catch {
|
|
477
477
|
return null;
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
async function yt(t,
|
|
480
|
+
async function yt(t, r) {
|
|
481
481
|
if (!ne() || typeof fetch != "function") return null;
|
|
482
|
-
const e = new AbortController(), o = setTimeout(() => e.abort(),
|
|
482
|
+
const e = new AbortController(), o = setTimeout(() => e.abort(), r);
|
|
483
483
|
try {
|
|
484
484
|
const p = await fetch(t, { signal: e.signal, credentials: "omit" });
|
|
485
485
|
if (!p.ok) return null;
|
|
486
|
-
const u = await p.json(),
|
|
487
|
-
return /^[A-Z]{2}$/.test(
|
|
486
|
+
const u = await p.json(), z = (u.country_code ?? u.country ?? "").toString().toUpperCase();
|
|
487
|
+
return /^[A-Z]{2}$/.test(z) ? z : null;
|
|
488
488
|
} catch {
|
|
489
489
|
return null;
|
|
490
490
|
} finally {
|
|
@@ -500,7 +500,7 @@ function bt() {
|
|
|
500
500
|
return null;
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function Be(t) {
|
|
504
504
|
if (ne())
|
|
505
505
|
try {
|
|
506
506
|
sessionStorage.setItem(ze, t);
|
|
@@ -509,42 +509,42 @@ function Ie(t) {
|
|
|
509
509
|
}
|
|
510
510
|
async function Oe(t = {}) {
|
|
511
511
|
const {
|
|
512
|
-
strategy:
|
|
512
|
+
strategy: r = "auto",
|
|
513
513
|
ipEndpoint: e = "https://ipapi.co/json/",
|
|
514
514
|
defaultCountry: o = "US",
|
|
515
515
|
timeoutMs: p = 2e3,
|
|
516
516
|
cache: u = !0
|
|
517
517
|
} = t;
|
|
518
518
|
if (u) {
|
|
519
|
-
const
|
|
520
|
-
if (
|
|
519
|
+
const O = bt();
|
|
520
|
+
if (O) return O;
|
|
521
521
|
}
|
|
522
|
-
if (
|
|
522
|
+
if (r === "none")
|
|
523
523
|
return o.toUpperCase();
|
|
524
|
-
if (
|
|
525
|
-
const
|
|
526
|
-
if (
|
|
527
|
-
return u &&
|
|
524
|
+
if (r === "auto") {
|
|
525
|
+
const O = await yt(e, p);
|
|
526
|
+
if (O)
|
|
527
|
+
return u && Be(O), O;
|
|
528
528
|
}
|
|
529
529
|
const j = (mt() ?? ht() ?? o).toUpperCase();
|
|
530
|
-
return u &&
|
|
530
|
+
return u && Be(j), j;
|
|
531
531
|
}
|
|
532
532
|
function da(t = {}) {
|
|
533
|
-
const
|
|
533
|
+
const r = N(null), e = N(!1);
|
|
534
534
|
async function o() {
|
|
535
535
|
e.value = !0;
|
|
536
536
|
try {
|
|
537
|
-
|
|
537
|
+
r.value = await Oe(t);
|
|
538
538
|
} finally {
|
|
539
539
|
e.value = !1;
|
|
540
540
|
}
|
|
541
|
-
return
|
|
541
|
+
return r.value;
|
|
542
542
|
}
|
|
543
|
-
return
|
|
543
|
+
return be(() => {
|
|
544
544
|
o();
|
|
545
|
-
}), { country:
|
|
545
|
+
}), { country: r, isLoading: e, refresh: o };
|
|
546
546
|
}
|
|
547
|
-
const _t =
|
|
547
|
+
const _t = lt(
|
|
548
548
|
// items-center (not items-stretch) so #prefix/#suffix icons centre vertically without distortion.
|
|
549
549
|
// The country trigger button and the input element both carry `h-full`, so they still fill the
|
|
550
550
|
// field height regardless of this setting.
|
|
@@ -569,7 +569,7 @@ const _t = rt(
|
|
|
569
569
|
too_long: "Phone number is too long.",
|
|
570
570
|
invalid_phone: "Phone number is invalid.",
|
|
571
571
|
parse_failed: "Could not parse phone number."
|
|
572
|
-
},
|
|
572
|
+
}, Ne = {
|
|
573
573
|
searchPlaceholder: "Search country or +code…",
|
|
574
574
|
emptyText: "No countries found.",
|
|
575
575
|
loadingText: "Loading countries…",
|
|
@@ -582,15 +582,15 @@ const _t = rt(
|
|
|
582
582
|
};
|
|
583
583
|
function wt(t) {
|
|
584
584
|
return t ? {
|
|
585
|
-
...
|
|
585
|
+
...Ne,
|
|
586
586
|
...t,
|
|
587
587
|
errorMessages: { ...Fe, ...t.errorMessages }
|
|
588
|
-
} :
|
|
588
|
+
} : Ne;
|
|
589
589
|
}
|
|
590
|
-
function Ct(t,
|
|
591
|
-
return `https://flagcdn.com/w${
|
|
590
|
+
function Ct(t, r = 40) {
|
|
591
|
+
return `https://flagcdn.com/w${r}/${t.toLowerCase()}.png`;
|
|
592
592
|
}
|
|
593
|
-
const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */
|
|
593
|
+
const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ _e({
|
|
594
594
|
__name: "ACountryFlag",
|
|
595
595
|
props: {
|
|
596
596
|
iso2: {},
|
|
@@ -601,40 +601,40 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
601
601
|
class: { type: [Boolean, null, String, Object, Array] }
|
|
602
602
|
},
|
|
603
603
|
setup(t) {
|
|
604
|
-
const
|
|
605
|
-
|
|
604
|
+
const r = t, e = C(() => r.src ? r.src : r.iso2 ? (r.flagUrl ?? Ct)(r.iso2, r.width) : null), o = N(!1);
|
|
605
|
+
re(e, () => {
|
|
606
606
|
o.value = !1;
|
|
607
607
|
});
|
|
608
|
-
const p = C(() => (
|
|
609
|
-
return (u,
|
|
608
|
+
const p = C(() => (r.iso2 ?? "").slice(0, 2).toUpperCase());
|
|
609
|
+
return (u, z) => e.value && !o.value ? (B(), K("img", {
|
|
610
610
|
key: 0,
|
|
611
611
|
src: e.value,
|
|
612
|
-
alt:
|
|
612
|
+
alt: r.alt ?? `${r.iso2} flag`,
|
|
613
613
|
loading: "lazy",
|
|
614
614
|
"data-slot": "country-flag",
|
|
615
|
-
class:
|
|
616
|
-
onError:
|
|
617
|
-
}, null, 42, At)) : p.value ? (
|
|
615
|
+
class: V(w(R)("ring-border/40 inline-block h-4 w-6 rounded-sm object-cover ring-1", r.class)),
|
|
616
|
+
onError: z[0] || (z[0] = (j) => o.value = !0)
|
|
617
|
+
}, null, 42, At)) : p.value ? (B(), K("span", {
|
|
618
618
|
key: 1,
|
|
619
619
|
"data-slot": "country-flag-fallback",
|
|
620
|
-
"aria-label":
|
|
621
|
-
class:
|
|
622
|
-
w(
|
|
620
|
+
"aria-label": r.alt ?? `${r.iso2} flag`,
|
|
621
|
+
class: V(
|
|
622
|
+
w(R)(
|
|
623
623
|
"ring-border/40 bg-muted text-muted-foreground inline-flex h-4 w-6 items-center justify-center rounded-sm text-[8px] font-semibold leading-none tracking-tight ring-1",
|
|
624
|
-
|
|
624
|
+
r.class
|
|
625
625
|
)
|
|
626
626
|
)
|
|
627
|
-
},
|
|
627
|
+
}, M(p.value), 11, St)) : h(u.$slots, "empty", { key: 2 }, () => [
|
|
628
628
|
_("span", {
|
|
629
629
|
"data-slot": "country-flag-empty",
|
|
630
|
-
class:
|
|
630
|
+
class: V(w(R)("bg-muted inline-block h-4 w-6 rounded-sm", r.class))
|
|
631
631
|
}, null, 2)
|
|
632
632
|
]);
|
|
633
633
|
}
|
|
634
|
-
}), kt = ["disabled", "data-state", "aria-label"], $t = { class: "border-b p-1.5" }, xt = { class: "bg-muted/40 ring-border focus-within:ring-ring relative flex items-center rounded-md ring-1 transition-shadow
|
|
634
|
+
}), kt = ["disabled", "data-state", "aria-label"], $t = { class: "border-border/70 border-b p-1.5" }, xt = { class: "bg-muted/40 ring-border/70 focus-within:ring-ring/50 relative flex items-center rounded-md ring-1 transition-shadow" }, Et = ["placeholder"], It = {
|
|
635
635
|
key: 0,
|
|
636
636
|
class: "bg-background text-muted-foreground border-border absolute top-1/2 end-2 hidden -translate-y-1/2 items-center gap-0.5 rounded border px-1.5 py-0.5 font-mono text-[10px] tracking-tight md:inline-flex"
|
|
637
|
-
},
|
|
637
|
+
}, Lt = {
|
|
638
638
|
key: 1,
|
|
639
639
|
class: "bg-background text-muted-foreground border-border absolute top-1/2 end-2 hidden -translate-y-1/2 rounded border px-1.5 py-0.5 font-mono text-[10px] tracking-tight md:inline-block"
|
|
640
640
|
}, Bt = { class: "flex-1 overflow-y-auto" }, Nt = { class: "text-muted-foreground p-4 text-center text-sm" }, Tt = { class: "text-muted-foreground p-4 text-center text-sm" }, Dt = {
|
|
@@ -644,7 +644,7 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
644
644
|
}, Mt = { class: "text-muted-foreground bg-popover sticky top-0 z-10 px-3 py-1.5 text-[10px] font-medium tracking-wider uppercase" }, Pt = ["aria-label"], Ut = ["aria-selected", "aria-disabled"], Rt = ["disabled", "data-selected", "onClick"], zt = { class: "flex-1 truncate" }, Ot = { class: "text-muted-foreground tabular-nums" }, Ft = {
|
|
645
645
|
"data-slot": "country-select-group",
|
|
646
646
|
"data-group": "all"
|
|
647
|
-
}, Kt = { class: "text-muted-foreground bg-popover sticky top-0 z-10 px-3 py-1.5 text-[10px] font-medium tracking-wider uppercase" },
|
|
647
|
+
}, Kt = { class: "text-muted-foreground bg-popover sticky top-0 z-10 px-3 py-1.5 text-[10px] font-medium tracking-wider uppercase" }, Vt = ["aria-label"], Gt = ["aria-selected", "aria-disabled"], Ht = ["disabled", "data-selected", "onClick"], Zt = { class: "flex-1 truncate" }, jt = { class: "text-muted-foreground tabular-nums" }, Te = "ali_ui_country_recents_v1", Jt = /* @__PURE__ */ _e({
|
|
648
648
|
__name: "ACountrySelect",
|
|
649
649
|
props: /* @__PURE__ */ De({
|
|
650
650
|
class: { type: [Boolean, null, String, Object, Array] },
|
|
@@ -675,16 +675,16 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
675
675
|
selectedModifiers: {}
|
|
676
676
|
}),
|
|
677
677
|
emits: ["update:selected"],
|
|
678
|
-
setup(t, { expose:
|
|
678
|
+
setup(t, { expose: r }) {
|
|
679
679
|
const e = t, o = C(
|
|
680
680
|
() => `${Me[e.size]} ${W[e.size]}`
|
|
681
681
|
), p = me(t, "selected"), {
|
|
682
682
|
countries: u,
|
|
683
|
-
isCountriesLoading:
|
|
683
|
+
isCountriesLoading: z,
|
|
684
684
|
getCountries: j,
|
|
685
|
-
searchCountries:
|
|
685
|
+
searchCountries: O,
|
|
686
686
|
getCountryByValue: Y
|
|
687
|
-
} = Re(),
|
|
687
|
+
} = Re(), I = N(!1), k = N("");
|
|
688
688
|
j();
|
|
689
689
|
const x = C(
|
|
690
690
|
() => e.countries && e.countries.length ? e.countries : pt(u.value, e.locale)
|
|
@@ -694,11 +694,11 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
694
694
|
function y(s) {
|
|
695
695
|
return s ? v.value.get(s) ?? Y(s) : null;
|
|
696
696
|
}
|
|
697
|
-
const g =
|
|
697
|
+
const g = N([]);
|
|
698
698
|
function a() {
|
|
699
699
|
if (!(typeof window > "u"))
|
|
700
700
|
try {
|
|
701
|
-
const s = localStorage.getItem(
|
|
701
|
+
const s = localStorage.getItem(Te);
|
|
702
702
|
if (!s) return;
|
|
703
703
|
const m = JSON.parse(s);
|
|
704
704
|
if (!Array.isArray(m)) return;
|
|
@@ -711,100 +711,100 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
711
711
|
const m = [s, ...g.value.filter((n) => n !== s)].slice(0, 8);
|
|
712
712
|
g.value = m;
|
|
713
713
|
try {
|
|
714
|
-
localStorage.setItem(
|
|
714
|
+
localStorage.setItem(Te, JSON.stringify(m));
|
|
715
715
|
} catch {
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
|
-
|
|
718
|
+
be(a);
|
|
719
719
|
const f = C(() => k.value.trim().length > 0);
|
|
720
720
|
function $(s, m) {
|
|
721
721
|
return m.search_key.includes(s.toLowerCase());
|
|
722
722
|
}
|
|
723
|
-
const
|
|
723
|
+
const L = C(() => {
|
|
724
724
|
if (!f.value) return [];
|
|
725
725
|
if (!e.countries && !e.searcher && !e.locale)
|
|
726
|
-
return
|
|
726
|
+
return O(k.value, e.maxResults);
|
|
727
727
|
const s = k.value.trim(), m = e.searcher ?? $, n = [];
|
|
728
|
-
for (const
|
|
729
|
-
if (m(s,
|
|
728
|
+
for (const Z of x.value)
|
|
729
|
+
if (m(s, Z) && (n.push(Z), n.length >= e.maxResults))
|
|
730
730
|
break;
|
|
731
731
|
return n;
|
|
732
732
|
}), E = C(() => {
|
|
733
733
|
if (f.value) return [];
|
|
734
|
-
const s = /* @__PURE__ */ new Set(), m = [], n = (
|
|
735
|
-
if (!
|
|
736
|
-
const se = y(
|
|
737
|
-
se && (s.add(
|
|
734
|
+
const s = /* @__PURE__ */ new Set(), m = [], n = (D) => {
|
|
735
|
+
if (!D || s.has(D)) return;
|
|
736
|
+
const se = y(D);
|
|
737
|
+
se && (s.add(D), m.push(se));
|
|
738
738
|
};
|
|
739
739
|
n(p.value);
|
|
740
|
-
const
|
|
741
|
-
if (Array.isArray(
|
|
742
|
-
for (const
|
|
743
|
-
|
|
740
|
+
const Z = e.allowedDialCodes;
|
|
741
|
+
if (Array.isArray(Z) && Z.length > 0) {
|
|
742
|
+
for (const D of x.value)
|
|
743
|
+
Z.includes(D.raw_data.dial_digits) && n(D.value);
|
|
744
744
|
return m;
|
|
745
745
|
}
|
|
746
|
-
for (const
|
|
747
|
-
if (n(
|
|
746
|
+
for (const D of g.value)
|
|
747
|
+
if (n(D), m.length >= e.suggestedLimit) break;
|
|
748
748
|
return m.slice(0, e.suggestedLimit);
|
|
749
|
-
}), P = C(() => f.value ? [] : x.value),
|
|
750
|
-
function
|
|
749
|
+
}), P = C(() => f.value ? [] : x.value), T = C(() => y(p.value));
|
|
750
|
+
function G(s) {
|
|
751
751
|
const m = e.allowedDialCodes;
|
|
752
752
|
return !m || m.length === 0 ? !0 : m.includes(s.raw_data.dial_digits);
|
|
753
753
|
}
|
|
754
754
|
function S(s) {
|
|
755
|
-
|
|
755
|
+
G(s) && (p.value = s.value, c(s.value), I.value = !1);
|
|
756
756
|
}
|
|
757
|
-
return
|
|
757
|
+
return re(I, (s) => {
|
|
758
758
|
s || (k.value = "");
|
|
759
|
-
}),
|
|
760
|
-
open:
|
|
761
|
-
setOpen: (s) =>
|
|
759
|
+
}), r({
|
|
760
|
+
open: I,
|
|
761
|
+
setOpen: (s) => I.value = s,
|
|
762
762
|
search: k,
|
|
763
763
|
setSearch: (s) => k.value = s,
|
|
764
|
-
selectedCountry:
|
|
764
|
+
selectedCountry: T,
|
|
765
765
|
selectCountry: S,
|
|
766
766
|
countries: x,
|
|
767
767
|
recents: g
|
|
768
|
-
}), (s, m) => (
|
|
769
|
-
open:
|
|
770
|
-
"onUpdate:open": m[1] || (m[1] = (n) =>
|
|
768
|
+
}), (s, m) => (B(), he(w(rt), {
|
|
769
|
+
open: I.value,
|
|
770
|
+
"onUpdate:open": m[1] || (m[1] = (n) => I.value = n)
|
|
771
771
|
}, {
|
|
772
772
|
default: U(() => [
|
|
773
|
-
|
|
773
|
+
F(w(nt), { "as-child": "" }, {
|
|
774
774
|
default: U(() => [
|
|
775
775
|
h(s.$slots, "trigger", {
|
|
776
|
-
selectedCountry:
|
|
777
|
-
open:
|
|
776
|
+
selectedCountry: T.value,
|
|
777
|
+
open: I.value,
|
|
778
778
|
sizeClasses: o.value
|
|
779
779
|
}, () => [
|
|
780
780
|
_("button", {
|
|
781
781
|
type: "button",
|
|
782
782
|
disabled: e.disabled,
|
|
783
783
|
"data-slot": "country-select-trigger",
|
|
784
|
-
"data-state":
|
|
785
|
-
class:
|
|
786
|
-
w(
|
|
784
|
+
"data-state": I.value ? "open" : "closed",
|
|
785
|
+
class: V(
|
|
786
|
+
w(R)(
|
|
787
787
|
"bg-transparent hover:bg-muted focus-visible:bg-muted data-[state=open]:bg-muted focus-visible:ring-ring inline-flex h-full shrink-0 items-center gap-1.5 transition-colors focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
788
788
|
o.value,
|
|
789
789
|
e.triggerClass
|
|
790
790
|
)
|
|
791
791
|
),
|
|
792
|
-
"aria-label":
|
|
792
|
+
"aria-label": T.value ? `${e.countryLabel}: ${T.value.raw_data.name}` : e.selectCountryLabel
|
|
793
793
|
}, [
|
|
794
|
-
|
|
794
|
+
T.value ? h(s.$slots, "flag", {
|
|
795
795
|
key: 0,
|
|
796
|
-
country:
|
|
796
|
+
country: T.value,
|
|
797
797
|
context: "trigger"
|
|
798
798
|
}, () => [
|
|
799
|
-
|
|
800
|
-
iso2:
|
|
801
|
-
src:
|
|
799
|
+
F(ve, {
|
|
800
|
+
iso2: T.value.raw_data.iso2,
|
|
801
|
+
src: T.value.raw_data.flag,
|
|
802
802
|
"flag-url": e.flagUrl
|
|
803
803
|
}, null, 8, ["iso2", "src", "flag-url"])
|
|
804
|
-
]) :
|
|
805
|
-
h(s.$slots, "chevron", { open:
|
|
806
|
-
|
|
807
|
-
class:
|
|
804
|
+
]) : H("", !0),
|
|
805
|
+
h(s.$slots, "chevron", { open: I.value }, () => [
|
|
806
|
+
F(w(qe), {
|
|
807
|
+
class: V(["text-muted-foreground size-3.5 shrink-0 transition-transform duration-200", I.value && "rotate-180"])
|
|
808
808
|
}, null, 8, ["class"])
|
|
809
809
|
])
|
|
810
810
|
], 10, kt)
|
|
@@ -812,15 +812,15 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
812
812
|
]),
|
|
813
813
|
_: 3
|
|
814
814
|
}),
|
|
815
|
-
|
|
815
|
+
F(w(ot), {
|
|
816
816
|
align: "end",
|
|
817
817
|
"side-offset": 6,
|
|
818
|
-
class:
|
|
819
|
-
"popover-class": w(
|
|
818
|
+
class: V(w(R)("flex flex-col overflow-hidden p-0", e.contentClass)),
|
|
819
|
+
"popover-class": w(R)(
|
|
820
820
|
"w-[min(20rem,calc(100vw-2rem))] max-h-[min(22rem,var(--reka-popover-content-available-height))]",
|
|
821
821
|
e.popoverClass
|
|
822
822
|
),
|
|
823
|
-
"drawer-class": w(
|
|
823
|
+
"drawer-class": w(R)("max-h-[80vh] pb-4", e.drawerClass)
|
|
824
824
|
}, {
|
|
825
825
|
default: U(() => [
|
|
826
826
|
h(s.$slots, "search", {
|
|
@@ -831,140 +831,140 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
831
831
|
_("div", $t, [
|
|
832
832
|
_("div", xt, [
|
|
833
833
|
h(s.$slots, "search-icon", {}, () => [
|
|
834
|
-
|
|
834
|
+
F(w(We), { class: "text-muted-foreground absolute top-1/2 start-2.5 size-3.5 -translate-y-1/2" })
|
|
835
835
|
]),
|
|
836
836
|
He(_("input", {
|
|
837
837
|
"onUpdate:modelValue": m[0] || (m[0] = (n) => k.value = n),
|
|
838
838
|
type: "text",
|
|
839
839
|
"data-slot": "country-select-search",
|
|
840
840
|
placeholder: e.searchPlaceholder,
|
|
841
|
-
class: "placeholder:text-muted-foreground h-
|
|
841
|
+
class: "placeholder:text-muted-foreground h-10 w-full bg-transparent pe-14 ps-8 text-sm outline-none"
|
|
842
842
|
}, null, 8, Et), [
|
|
843
843
|
[Ze, k.value]
|
|
844
844
|
]),
|
|
845
|
-
!f.value && e.kbdOpen ? (
|
|
845
|
+
!f.value && e.kbdOpen ? (B(), K("kbd", It, M(e.kbdOpen), 1)) : f.value && e.kbdClose ? (B(), K("kbd", Lt, M(e.kbdClose), 1)) : H("", !0)
|
|
846
846
|
])
|
|
847
847
|
])
|
|
848
848
|
]),
|
|
849
849
|
_("div", Bt, [
|
|
850
|
-
w(
|
|
851
|
-
_("div", Nt,
|
|
852
|
-
]) : f.value &&
|
|
850
|
+
w(z) && x.value.length === 0 ? h(s.$slots, "loading", { key: 0 }, () => [
|
|
851
|
+
_("div", Nt, M(e.loadingText), 1)
|
|
852
|
+
]) : f.value && L.value.length === 0 ? h(s.$slots, "empty", {
|
|
853
853
|
key: 1,
|
|
854
854
|
query: k.value
|
|
855
855
|
}, () => [
|
|
856
|
-
_("div", Tt,
|
|
857
|
-
]) : (
|
|
858
|
-
E.value.length > 0 ? (
|
|
856
|
+
_("div", Tt, M(e.emptyText), 1)
|
|
857
|
+
]) : (B(), K(pe, { key: 2 }, [
|
|
858
|
+
E.value.length > 0 ? (B(), K("section", Dt, [
|
|
859
859
|
h(s.$slots, "group-header", {
|
|
860
860
|
label: e.suggestedLabel,
|
|
861
861
|
group: "suggested"
|
|
862
862
|
}, () => [
|
|
863
|
-
_("header", Mt,
|
|
863
|
+
_("header", Mt, M(e.suggestedLabel), 1)
|
|
864
864
|
]),
|
|
865
865
|
_("ul", {
|
|
866
866
|
role: "listbox",
|
|
867
867
|
"aria-label": e.suggestedLabel,
|
|
868
868
|
class: "pb-1"
|
|
869
869
|
}, [
|
|
870
|
-
(
|
|
870
|
+
(B(!0), K(pe, null, ke(E.value, (n) => (B(), K("li", {
|
|
871
871
|
key: `s-${n.value}`,
|
|
872
872
|
role: "option",
|
|
873
873
|
"aria-selected": n.value === p.value,
|
|
874
|
-
"aria-disabled": !
|
|
874
|
+
"aria-disabled": !G(n)
|
|
875
875
|
}, [
|
|
876
876
|
h(s.$slots, "item", {
|
|
877
877
|
country: n,
|
|
878
878
|
selected: n.value === p.value,
|
|
879
|
-
disabled: !
|
|
879
|
+
disabled: !G(n),
|
|
880
880
|
select: () => S(n)
|
|
881
881
|
}, () => [
|
|
882
882
|
_("button", {
|
|
883
883
|
type: "button",
|
|
884
|
-
disabled: !
|
|
884
|
+
disabled: !G(n),
|
|
885
885
|
"data-slot": "country-select-item",
|
|
886
886
|
"data-selected": n.value === p.value ? "" : void 0,
|
|
887
887
|
class: "hover:bg-muted/60 focus-visible:bg-muted/60 data-[selected]:bg-muted flex w-full items-center gap-3 px-3 py-2 text-left text-sm transition-colors focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent",
|
|
888
|
-
onClick: (
|
|
888
|
+
onClick: (Z) => S(n)
|
|
889
889
|
}, [
|
|
890
890
|
h(s.$slots, "flag", {
|
|
891
891
|
country: n,
|
|
892
892
|
context: "item"
|
|
893
893
|
}, () => [
|
|
894
|
-
|
|
894
|
+
F(ve, {
|
|
895
895
|
iso2: n.raw_data.iso2,
|
|
896
896
|
src: n.raw_data.flag,
|
|
897
897
|
"flag-url": e.flagUrl
|
|
898
898
|
}, null, 8, ["iso2", "src", "flag-url"])
|
|
899
899
|
]),
|
|
900
|
-
_("span", zt,
|
|
901
|
-
_("span", Ot,
|
|
900
|
+
_("span", zt, M(n.raw_data.name), 1),
|
|
901
|
+
_("span", Ot, M(n.raw_data.dial_code), 1),
|
|
902
902
|
n.value === p.value ? h(s.$slots, "item-check", {
|
|
903
903
|
key: 0,
|
|
904
904
|
country: n
|
|
905
905
|
}, () => [
|
|
906
|
-
|
|
907
|
-
]) :
|
|
906
|
+
F(w(xe), { class: "text-foreground size-3.5 shrink-0" })
|
|
907
|
+
]) : H("", !0)
|
|
908
908
|
], 8, Rt)
|
|
909
909
|
])
|
|
910
910
|
], 8, Ut))), 128))
|
|
911
911
|
], 8, Pt)
|
|
912
|
-
])) :
|
|
912
|
+
])) : H("", !0),
|
|
913
913
|
_("section", Ft, [
|
|
914
914
|
!f.value && P.value.length > 0 ? h(s.$slots, "group-header", {
|
|
915
915
|
key: 0,
|
|
916
916
|
label: e.allCountriesLabel,
|
|
917
917
|
group: "all"
|
|
918
918
|
}, () => [
|
|
919
|
-
_("header", Kt,
|
|
920
|
-
]) :
|
|
919
|
+
_("header", Kt, M(e.allCountriesLabel), 1)
|
|
920
|
+
]) : H("", !0),
|
|
921
921
|
_("ul", {
|
|
922
922
|
role: "listbox",
|
|
923
923
|
"aria-label": f.value ? e.searchPlaceholder : e.allCountriesLabel,
|
|
924
924
|
class: "pb-1"
|
|
925
925
|
}, [
|
|
926
|
-
(
|
|
926
|
+
(B(!0), K(pe, null, ke(f.value ? L.value : P.value, (n) => (B(), K("li", {
|
|
927
927
|
key: n.value,
|
|
928
928
|
role: "option",
|
|
929
929
|
"aria-selected": n.value === p.value,
|
|
930
|
-
"aria-disabled": !
|
|
930
|
+
"aria-disabled": !G(n)
|
|
931
931
|
}, [
|
|
932
932
|
h(s.$slots, "item", {
|
|
933
933
|
country: n,
|
|
934
934
|
selected: n.value === p.value,
|
|
935
|
-
disabled: !
|
|
935
|
+
disabled: !G(n),
|
|
936
936
|
select: () => S(n)
|
|
937
937
|
}, () => [
|
|
938
938
|
_("button", {
|
|
939
939
|
type: "button",
|
|
940
|
-
disabled: !
|
|
940
|
+
disabled: !G(n),
|
|
941
941
|
"data-slot": "country-select-item",
|
|
942
942
|
"data-selected": n.value === p.value ? "" : void 0,
|
|
943
943
|
class: "hover:bg-muted/60 focus-visible:bg-muted/60 data-[selected]:bg-muted flex w-full items-center gap-3 px-3 py-2 text-left text-sm transition-colors focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent",
|
|
944
|
-
onClick: (
|
|
944
|
+
onClick: (Z) => S(n)
|
|
945
945
|
}, [
|
|
946
946
|
h(s.$slots, "flag", {
|
|
947
947
|
country: n,
|
|
948
948
|
context: "item"
|
|
949
949
|
}, () => [
|
|
950
|
-
|
|
950
|
+
F(ve, {
|
|
951
951
|
iso2: n.raw_data.iso2,
|
|
952
952
|
src: n.raw_data.flag,
|
|
953
953
|
"flag-url": e.flagUrl
|
|
954
954
|
}, null, 8, ["iso2", "src", "flag-url"])
|
|
955
955
|
]),
|
|
956
|
-
_("span", Zt,
|
|
957
|
-
_("span", jt,
|
|
956
|
+
_("span", Zt, M(n.raw_data.name), 1),
|
|
957
|
+
_("span", jt, M(n.raw_data.dial_code), 1),
|
|
958
958
|
n.value === p.value ? h(s.$slots, "item-check", {
|
|
959
959
|
key: 0,
|
|
960
960
|
country: n
|
|
961
961
|
}, () => [
|
|
962
|
-
|
|
963
|
-
]) :
|
|
962
|
+
F(w(xe), { class: "text-foreground size-3.5 shrink-0" })
|
|
963
|
+
]) : H("", !0)
|
|
964
964
|
], 8, Ht)
|
|
965
965
|
])
|
|
966
|
-
], 8,
|
|
967
|
-
], 8,
|
|
966
|
+
], 8, Gt))), 128))
|
|
967
|
+
], 8, Vt)
|
|
968
968
|
])
|
|
969
969
|
], 64))
|
|
970
970
|
])
|
|
@@ -978,7 +978,7 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
978
978
|
}), Yt = ["dir"], qt = {
|
|
979
979
|
class: "flex items-center gap-2",
|
|
980
980
|
dir: "ltr"
|
|
981
|
-
}, Wt = ["data-state"], Qt = ["value", "disabled", "placeholder", "aria-label", "aria-invalid", "aria-describedby"], Xt = ["id"], ea = "ali_ui_country_recents_v1", fa = /* @__PURE__ */
|
|
981
|
+
}, Wt = ["data-state"], Qt = ["value", "disabled", "placeholder", "aria-label", "aria-invalid", "aria-describedby"], Xt = ["id"], ea = "ali_ui_country_recents_v1", fa = /* @__PURE__ */ _e({
|
|
982
982
|
__name: "ATellInput",
|
|
983
983
|
props: /* @__PURE__ */ De({
|
|
984
984
|
flagUrl: {},
|
|
@@ -1002,6 +1002,7 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
1002
1002
|
messages: {},
|
|
1003
1003
|
allowedDialCodes: {},
|
|
1004
1004
|
showValidation: { type: Boolean },
|
|
1005
|
+
showValidationIcon: { type: Boolean, default: !1 },
|
|
1005
1006
|
detectCountry: { default: "auto" },
|
|
1006
1007
|
defaultCountry: { default: "" },
|
|
1007
1008
|
ipEndpoint: { default: "https://ipapi.co/json/" },
|
|
@@ -1018,10 +1019,10 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
1018
1019
|
countryModifiers: {}
|
|
1019
1020
|
}),
|
|
1020
1021
|
emits: ["update:phone", "update:country"],
|
|
1021
|
-
setup(t, { expose:
|
|
1022
|
-
const e = t, o = me(t, "phone"), p = me(t, "country"), u =
|
|
1023
|
-
|
|
1024
|
-
const k =
|
|
1022
|
+
setup(t, { expose: r }) {
|
|
1023
|
+
const e = t, o = me(t, "phone"), p = me(t, "country"), u = N(""), { getCountries: z, validate: j, getRequiredInfo: O, getCountryByValue: Y, getCountriesByDial: I } = Re();
|
|
1024
|
+
z();
|
|
1025
|
+
const k = N(!1), x = N(!1), v = {
|
|
1025
1026
|
1: "US",
|
|
1026
1027
|
7: "RU",
|
|
1027
1028
|
20: "EG",
|
|
@@ -1082,31 +1083,31 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
1082
1083
|
973: "BH",
|
|
1083
1084
|
974: "QA"
|
|
1084
1085
|
};
|
|
1085
|
-
function y(
|
|
1086
|
-
const d = String(
|
|
1086
|
+
function y(l) {
|
|
1087
|
+
const d = String(l ?? "").trim();
|
|
1087
1088
|
if (!d) return "";
|
|
1088
1089
|
if (/^[A-Za-z]{2}$/.test(d)) return d.toUpperCase();
|
|
1089
1090
|
const i = d.replace(/^\+/, "");
|
|
1090
1091
|
if (!/^\d+$/.test(i)) return "";
|
|
1091
|
-
const b =
|
|
1092
|
+
const b = I(i)[0];
|
|
1092
1093
|
return b ? b.value : v[i] ?? "";
|
|
1093
1094
|
}
|
|
1094
|
-
const g =
|
|
1095
|
+
const g = N(y(e.defaultCountry));
|
|
1095
1096
|
function a() {
|
|
1096
1097
|
if (typeof window > "u") return [];
|
|
1097
1098
|
try {
|
|
1098
|
-
const
|
|
1099
|
-
if (!
|
|
1100
|
-
const d = JSON.parse(
|
|
1099
|
+
const l = localStorage.getItem(ea);
|
|
1100
|
+
if (!l) return [];
|
|
1101
|
+
const d = JSON.parse(l);
|
|
1101
1102
|
return Array.isArray(d) ? d.filter((i) => typeof i == "string") : [];
|
|
1102
1103
|
} catch {
|
|
1103
1104
|
return [];
|
|
1104
1105
|
}
|
|
1105
1106
|
}
|
|
1106
|
-
function c(
|
|
1107
|
-
if (!
|
|
1107
|
+
function c(l) {
|
|
1108
|
+
if (!l) return null;
|
|
1108
1109
|
try {
|
|
1109
|
-
const i = de(`+${
|
|
1110
|
+
const i = de(`+${l}`);
|
|
1110
1111
|
if (i?.country && i.countryCallingCode) {
|
|
1111
1112
|
const b = Y(i.country);
|
|
1112
1113
|
if (b)
|
|
@@ -1115,9 +1116,9 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
1115
1116
|
} catch {
|
|
1116
1117
|
}
|
|
1117
1118
|
const d = g.value;
|
|
1118
|
-
if (d &&
|
|
1119
|
+
if (d && l.length >= 4)
|
|
1119
1120
|
try {
|
|
1120
|
-
const i = de(
|
|
1121
|
+
const i = de(l, d);
|
|
1121
1122
|
if (i?.isValid()) {
|
|
1122
1123
|
const b = Y(i.country || d);
|
|
1123
1124
|
if (b)
|
|
@@ -1125,19 +1126,19 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
1125
1126
|
}
|
|
1126
1127
|
} catch {
|
|
1127
1128
|
}
|
|
1128
|
-
for (let i = Math.min(3,
|
|
1129
|
-
const b =
|
|
1129
|
+
for (let i = Math.min(3, l.length); i >= 1; i--) {
|
|
1130
|
+
const b = l.slice(0, i), q = I(b);
|
|
1130
1131
|
if (!q.length) continue;
|
|
1131
|
-
const ie =
|
|
1132
|
+
const ie = l.slice(b.length);
|
|
1132
1133
|
if (q.length === 1) return { country: q[0], nationalNumber: ie };
|
|
1133
|
-
const
|
|
1134
|
-
if (
|
|
1135
|
-
const
|
|
1136
|
-
return
|
|
1134
|
+
const Ae = u.value ? q.find((te) => te.value === u.value.toUpperCase()) : null;
|
|
1135
|
+
if (Ae) return { country: Ae, nationalNumber: ie };
|
|
1136
|
+
const Se = a().map((te) => q.find((Ge) => Ge.value === te)).find((te) => !!te);
|
|
1137
|
+
return Se ? { country: Se, nationalNumber: ie } : { country: q[0], nationalNumber: ie };
|
|
1137
1138
|
}
|
|
1138
1139
|
return null;
|
|
1139
1140
|
}
|
|
1140
|
-
|
|
1141
|
+
be(async () => {
|
|
1141
1142
|
if (u.value) return;
|
|
1142
1143
|
if (e.defaultCountry) {
|
|
1143
1144
|
const b = y(e.defaultCountry);
|
|
@@ -1146,7 +1147,7 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
1146
1147
|
return;
|
|
1147
1148
|
}
|
|
1148
1149
|
}
|
|
1149
|
-
const
|
|
1150
|
+
const l = {
|
|
1150
1151
|
strategy: e.detectCountry,
|
|
1151
1152
|
ipEndpoint: e.ipEndpoint,
|
|
1152
1153
|
defaultCountry: ""
|
|
@@ -1154,11 +1155,11 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
1154
1155
|
let d;
|
|
1155
1156
|
if (e.detector)
|
|
1156
1157
|
try {
|
|
1157
|
-
d = await e.detector(
|
|
1158
|
+
d = await e.detector(l);
|
|
1158
1159
|
} catch {
|
|
1159
1160
|
d = null;
|
|
1160
1161
|
}
|
|
1161
|
-
d || (d = await Oe(
|
|
1162
|
+
d || (d = await Oe(l));
|
|
1162
1163
|
const i = d ? d.toUpperCase() : "";
|
|
1163
1164
|
if (e.detectFromInput) {
|
|
1164
1165
|
if (g.value = i, o.value && !k.value && !u.value) {
|
|
@@ -1169,52 +1170,52 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
1169
1170
|
}
|
|
1170
1171
|
!u.value && i && (x.value = !0, u.value = i);
|
|
1171
1172
|
});
|
|
1172
|
-
function f(
|
|
1173
|
-
if (!
|
|
1174
|
-
const i = Y(
|
|
1173
|
+
function f(l) {
|
|
1174
|
+
if (!l) return null;
|
|
1175
|
+
const i = Y(l)?.raw_data?.dial_digits ?? Object.entries(v).find(([, q]) => q === l)?.[0];
|
|
1175
1176
|
if (!i) return null;
|
|
1176
1177
|
const b = Number(i);
|
|
1177
1178
|
return Number.isFinite(b) ? b : null;
|
|
1178
1179
|
}
|
|
1179
|
-
|
|
1180
|
+
re(
|
|
1180
1181
|
p,
|
|
1181
|
-
(
|
|
1182
|
-
if (
|
|
1182
|
+
(l) => {
|
|
1183
|
+
if (l == null) {
|
|
1183
1184
|
u.value && (u.value = "");
|
|
1184
1185
|
return;
|
|
1185
1186
|
}
|
|
1186
|
-
if (f(u.value) ===
|
|
1187
|
-
const d = y(String(
|
|
1187
|
+
if (f(u.value) === l) return;
|
|
1188
|
+
const d = y(String(l));
|
|
1188
1189
|
d && (u.value = d);
|
|
1189
1190
|
},
|
|
1190
1191
|
{ immediate: !0 }
|
|
1191
|
-
),
|
|
1192
|
+
), re(
|
|
1192
1193
|
u,
|
|
1193
|
-
(
|
|
1194
|
+
(l, d) => {
|
|
1194
1195
|
const i = x.value;
|
|
1195
1196
|
x.value = !1;
|
|
1196
|
-
const b = f(
|
|
1197
|
-
p.value !== b && (p.value = b), !i && e.detectFromInput &&
|
|
1197
|
+
const b = f(l);
|
|
1198
|
+
p.value !== b && (p.value = b), !i && e.detectFromInput && l && d !== l && (k.value = !0);
|
|
1198
1199
|
},
|
|
1199
1200
|
{ flush: "sync" }
|
|
1200
1201
|
);
|
|
1201
1202
|
const $ = Ye(
|
|
1202
1203
|
() => {
|
|
1203
1204
|
if (!e.detectFromInput || k.value || u.value) return;
|
|
1204
|
-
const
|
|
1205
|
-
if (!
|
|
1206
|
-
const d = c(
|
|
1205
|
+
const l = o.value;
|
|
1206
|
+
if (!l) return;
|
|
1207
|
+
const d = c(l);
|
|
1207
1208
|
d && (x.value = !0, u.value = d.country.value, o.value = d.nationalNumber);
|
|
1208
1209
|
},
|
|
1209
1210
|
C(() => Math.max(0, e.detectDebounceMs))
|
|
1210
|
-
),
|
|
1211
|
+
), L = N(String(o.value ?? ""));
|
|
1211
1212
|
let E = !1;
|
|
1212
|
-
function P(
|
|
1213
|
-
E = !0, o.value =
|
|
1213
|
+
function P(l) {
|
|
1214
|
+
E = !0, o.value = l;
|
|
1214
1215
|
}
|
|
1215
|
-
function
|
|
1216
|
-
const d =
|
|
1217
|
-
|
|
1216
|
+
function T(l) {
|
|
1217
|
+
const d = l.target;
|
|
1218
|
+
L.value = d.value;
|
|
1218
1219
|
const i = ce(d.value).replace(/\D/g, "");
|
|
1219
1220
|
if (e.detectFromInput) {
|
|
1220
1221
|
if (!i) {
|
|
@@ -1226,15 +1227,15 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
1226
1227
|
}
|
|
1227
1228
|
P(i);
|
|
1228
1229
|
}
|
|
1229
|
-
function
|
|
1230
|
-
const d =
|
|
1231
|
-
|
|
1230
|
+
function G(l) {
|
|
1231
|
+
const d = l.target;
|
|
1232
|
+
L.value = ce(d.value).replace(/\D/g, "");
|
|
1232
1233
|
}
|
|
1233
|
-
|
|
1234
|
+
re(
|
|
1234
1235
|
() => o.value,
|
|
1235
|
-
(
|
|
1236
|
-
const d = ce(String(
|
|
1237
|
-
if (d !==
|
|
1236
|
+
(l) => {
|
|
1237
|
+
const d = ce(String(l ?? "")).replace(/\D/g, "");
|
|
1238
|
+
if (d !== l) {
|
|
1238
1239
|
o.value = d;
|
|
1239
1240
|
return;
|
|
1240
1241
|
}
|
|
@@ -1242,80 +1243,82 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
1242
1243
|
E = !1;
|
|
1243
1244
|
return;
|
|
1244
1245
|
}
|
|
1245
|
-
|
|
1246
|
+
L.value = d;
|
|
1246
1247
|
},
|
|
1247
1248
|
{ flush: "post" }
|
|
1248
1249
|
);
|
|
1249
1250
|
const S = C(() => wt(e.messages)), s = C(
|
|
1250
1251
|
() => e.dir === "ltr" || e.dir === "rtl" ? e.dir : void 0
|
|
1251
1252
|
), m = C(
|
|
1252
|
-
() => u.value ?
|
|
1253
|
+
() => u.value ? O({ iso2: u.value }, e.locale) : null
|
|
1253
1254
|
), n = C(
|
|
1254
1255
|
() => j({
|
|
1255
1256
|
country: u.value ? { iso2: u.value } : null,
|
|
1256
1257
|
phone: o.value ?? "",
|
|
1257
1258
|
locale: e.locale
|
|
1258
1259
|
})
|
|
1259
|
-
),
|
|
1260
|
+
), Z = C(
|
|
1260
1261
|
() => e.placeholder || m.value?.format_hint || S.value.phoneInputLabel
|
|
1261
1262
|
), oe = C(() => {
|
|
1262
|
-
const
|
|
1263
|
-
return
|
|
1264
|
-
}),
|
|
1263
|
+
const l = n.value;
|
|
1264
|
+
return l.ok || !l.reason || !o.value ? null : e.errorMessages?.[l.reason] ?? S.value.errorMessages[l.reason];
|
|
1265
|
+
}), D = C(() => u.value ? Y(u.value)?.raw_data.dial_code ?? null : null), se = C(
|
|
1265
1266
|
() => `${Me[e.size]} ${W[e.size]}`
|
|
1266
|
-
), Ke = C(() => `px-2 ${W[e.size]}`), J = C(() => o.value ? n.value.ok ? "valid" : "error" : "idle"),
|
|
1267
|
-
return
|
|
1268
|
-
class:
|
|
1267
|
+
), Ke = C(() => `px-2 ${W[e.size]}`), J = C(() => o.value ? n.value.ok ? "valid" : "error" : "idle"), we = je(), ge = C(() => !!(e.showValidation && oe.value)), Ce = C(() => !ge.value && !o.value && !!m.value?.format_hint), Ve = C(() => ge.value || Ce.value ? we : void 0);
|
|
1268
|
+
return r({ validation: n, required: m, selectedDialCode: D, validationState: J }), (l, d) => (B(), K("div", {
|
|
1269
|
+
class: V(w(R)("flex w-full flex-col gap-1.5", l.$attrs.class)),
|
|
1269
1270
|
"data-slot": "tell-input",
|
|
1270
1271
|
dir: s.value
|
|
1271
1272
|
}, [
|
|
1272
1273
|
_("div", qt, [
|
|
1273
1274
|
_("div", {
|
|
1274
|
-
class:
|
|
1275
|
-
w(
|
|
1275
|
+
class: V(
|
|
1276
|
+
w(R)(
|
|
1276
1277
|
w(_t)({ size: e.size }),
|
|
1277
1278
|
"focus-within:ring-2 focus-within:ring-offset-0",
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
J.value === "
|
|
1279
|
+
// Validation field colors are an opt-in via `showValidation` — by default the
|
|
1280
|
+
// field stays neutral and the consumer drives error rendering from `validation`.
|
|
1281
|
+
(!e.showValidation || J.value === "idle") && "focus-within:ring-ring/40",
|
|
1282
|
+
e.showValidation && J.value === "valid" && "border-emerald-500/60 ring-1 ring-emerald-500/20 focus-within:ring-emerald-500/40",
|
|
1283
|
+
e.showValidation && J.value === "error" && "border-destructive/80 ring-1 ring-destructive/20 focus-within:ring-destructive/40",
|
|
1281
1284
|
e.class,
|
|
1282
1285
|
e.fieldClass
|
|
1283
1286
|
)
|
|
1284
1287
|
),
|
|
1285
1288
|
"data-state": J.value
|
|
1286
1289
|
}, [
|
|
1287
|
-
h(
|
|
1288
|
-
|
|
1290
|
+
h(l.$slots, "prefix"),
|
|
1291
|
+
D.value ? (B(), K("span", {
|
|
1289
1292
|
key: 0,
|
|
1290
1293
|
"data-slot": "tell-input-dial",
|
|
1291
1294
|
dir: "ltr",
|
|
1292
1295
|
"aria-hidden": "true",
|
|
1293
|
-
class:
|
|
1294
|
-
}, D
|
|
1296
|
+
class: V(w(R)("text-muted-foreground shrink-0 tabular-nums select-none", Ke.value))
|
|
1297
|
+
}, M(D.value), 3)) : H("", !0),
|
|
1295
1298
|
_("input", {
|
|
1296
|
-
value:
|
|
1299
|
+
value: L.value,
|
|
1297
1300
|
type: "tel",
|
|
1298
1301
|
inputmode: "numeric",
|
|
1299
1302
|
autocomplete: "tel",
|
|
1300
1303
|
dir: "ltr",
|
|
1301
1304
|
"data-slot": "tell-input-field",
|
|
1302
1305
|
disabled: e.disabled || e.loading,
|
|
1303
|
-
placeholder:
|
|
1306
|
+
placeholder: Z.value,
|
|
1304
1307
|
"aria-label": S.value.phoneInputLabel,
|
|
1305
1308
|
"aria-invalid": J.value === "error" || void 0,
|
|
1306
|
-
"aria-describedby":
|
|
1307
|
-
class:
|
|
1308
|
-
w(
|
|
1309
|
+
"aria-describedby": Ve.value,
|
|
1310
|
+
class: V(
|
|
1311
|
+
w(R)(
|
|
1309
1312
|
"placeholder:text-muted-foreground h-full w-full min-w-0 flex-1 bg-transparent tabular-nums outline-none disabled:cursor-not-allowed",
|
|
1310
1313
|
se.value,
|
|
1311
|
-
|
|
1314
|
+
D.value && "ps-1",
|
|
1312
1315
|
e.inputClass
|
|
1313
1316
|
)
|
|
1314
1317
|
),
|
|
1315
|
-
onInput:
|
|
1316
|
-
onChange:
|
|
1318
|
+
onInput: T,
|
|
1319
|
+
onChange: G
|
|
1317
1320
|
}, null, 42, Qt),
|
|
1318
|
-
|
|
1321
|
+
F($e, {
|
|
1319
1322
|
"enter-active-class": "transition-all duration-200 ease-out overflow-hidden",
|
|
1320
1323
|
"leave-active-class": "transition-all duration-150 ease-in overflow-hidden",
|
|
1321
1324
|
"enter-from-class": "opacity-0 max-w-0",
|
|
@@ -1324,7 +1327,7 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
1324
1327
|
"leave-from-class": "max-w-[12rem]"
|
|
1325
1328
|
}, {
|
|
1326
1329
|
default: U(() => [
|
|
1327
|
-
!e.detectFromInput || u.value ? (
|
|
1330
|
+
!e.detectFromInput || u.value ? (B(), he(Jt, {
|
|
1328
1331
|
key: 0,
|
|
1329
1332
|
selected: u.value,
|
|
1330
1333
|
"onUpdate:selected": d[0] || (d[0] = (i) => u.value = i),
|
|
@@ -1346,101 +1349,102 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
1346
1349
|
"popover-class": e.popoverClass,
|
|
1347
1350
|
"drawer-class": e.drawerClass
|
|
1348
1351
|
}, Je({ _: 2 }, [
|
|
1349
|
-
|
|
1352
|
+
l.$slots.trigger ? {
|
|
1350
1353
|
name: "trigger",
|
|
1351
1354
|
fn: U((i) => [
|
|
1352
|
-
h(
|
|
1355
|
+
h(l.$slots, "trigger", X(ee(i)))
|
|
1353
1356
|
]),
|
|
1354
1357
|
key: "0"
|
|
1355
1358
|
} : void 0,
|
|
1356
|
-
|
|
1359
|
+
l.$slots.chevron ? {
|
|
1357
1360
|
name: "chevron",
|
|
1358
1361
|
fn: U((i) => [
|
|
1359
|
-
h(
|
|
1362
|
+
h(l.$slots, "chevron", X(ee(i)))
|
|
1360
1363
|
]),
|
|
1361
1364
|
key: "1"
|
|
1362
1365
|
} : void 0,
|
|
1363
|
-
|
|
1366
|
+
l.$slots.flag ? {
|
|
1364
1367
|
name: "flag",
|
|
1365
1368
|
fn: U((i) => [
|
|
1366
|
-
h(
|
|
1369
|
+
h(l.$slots, "flag", X(ee(i)))
|
|
1367
1370
|
]),
|
|
1368
1371
|
key: "2"
|
|
1369
1372
|
} : void 0,
|
|
1370
|
-
|
|
1373
|
+
l.$slots.item ? {
|
|
1371
1374
|
name: "item",
|
|
1372
1375
|
fn: U((i) => [
|
|
1373
|
-
h(
|
|
1376
|
+
h(l.$slots, "item", X(ee(i)))
|
|
1374
1377
|
]),
|
|
1375
1378
|
key: "3"
|
|
1376
1379
|
} : void 0,
|
|
1377
|
-
|
|
1380
|
+
l.$slots["group-header"] ? {
|
|
1378
1381
|
name: "group-header",
|
|
1379
1382
|
fn: U((i) => [
|
|
1380
|
-
h(
|
|
1383
|
+
h(l.$slots, "group-header", X(ee(i)))
|
|
1381
1384
|
]),
|
|
1382
1385
|
key: "4"
|
|
1383
1386
|
} : void 0,
|
|
1384
|
-
|
|
1387
|
+
l.$slots.search ? {
|
|
1385
1388
|
name: "search",
|
|
1386
1389
|
fn: U((i) => [
|
|
1387
|
-
h(
|
|
1390
|
+
h(l.$slots, "search", X(ee(i)))
|
|
1388
1391
|
]),
|
|
1389
1392
|
key: "5"
|
|
1390
1393
|
} : void 0,
|
|
1391
|
-
|
|
1394
|
+
l.$slots.loading ? {
|
|
1392
1395
|
name: "loading",
|
|
1393
1396
|
fn: U(() => [
|
|
1394
|
-
h(
|
|
1397
|
+
h(l.$slots, "loading")
|
|
1395
1398
|
]),
|
|
1396
1399
|
key: "6"
|
|
1397
1400
|
} : void 0,
|
|
1398
|
-
|
|
1401
|
+
l.$slots.empty ? {
|
|
1399
1402
|
name: "empty",
|
|
1400
1403
|
fn: U((i) => [
|
|
1401
|
-
h(
|
|
1404
|
+
h(l.$slots, "empty", X(ee(i)))
|
|
1402
1405
|
]),
|
|
1403
1406
|
key: "7"
|
|
1404
1407
|
} : void 0
|
|
1405
|
-
]), 1032, ["selected", "allowed-dial-codes", "disabled", "size", "locale", "search-placeholder", "empty-text", "loading-text", "suggested-label", "all-countries-label", "country-label", "select-country-label", "flag-url", "searcher", "countries", "content-class", "popover-class", "drawer-class"])) :
|
|
1408
|
+
]), 1032, ["selected", "allowed-dial-codes", "disabled", "size", "locale", "search-placeholder", "empty-text", "loading-text", "suggested-label", "all-countries-label", "country-label", "select-country-label", "flag-url", "searcher", "countries", "content-class", "popover-class", "drawer-class"])) : H("", !0)
|
|
1406
1409
|
]),
|
|
1407
1410
|
_: 3
|
|
1408
1411
|
}),
|
|
1409
|
-
h(
|
|
1412
|
+
h(l.$slots, "suffix", {
|
|
1410
1413
|
validationState: J.value,
|
|
1411
1414
|
validation: n.value
|
|
1412
1415
|
})
|
|
1413
1416
|
], 10, Wt),
|
|
1414
|
-
|
|
1417
|
+
e.showValidationIcon ? (B(), he($e, {
|
|
1418
|
+
key: 0,
|
|
1415
1419
|
"enter-active-class": "transition duration-150 ease-out",
|
|
1416
1420
|
"leave-active-class": "transition duration-100 ease-in",
|
|
1417
1421
|
"enter-from-class": "opacity-0 scale-90",
|
|
1418
1422
|
"leave-to-class": "opacity-0 scale-90"
|
|
1419
1423
|
}, {
|
|
1420
1424
|
default: U(() => [
|
|
1421
|
-
J.value === "valid" ? h(
|
|
1422
|
-
|
|
1425
|
+
J.value === "valid" ? h(l.$slots, "valid-icon", { key: 0 }, () => [
|
|
1426
|
+
F(w(Qe), {
|
|
1423
1427
|
class: "size-5 shrink-0 text-emerald-500",
|
|
1424
1428
|
"aria-hidden": "true"
|
|
1425
1429
|
})
|
|
1426
|
-
]) : J.value === "error" ? h(
|
|
1430
|
+
]) : J.value === "error" ? h(l.$slots, "error-icon", {
|
|
1427
1431
|
key: 1,
|
|
1428
1432
|
reason: n.value.reason ?? ""
|
|
1429
1433
|
}, () => [
|
|
1430
|
-
|
|
1434
|
+
F(w(Xe), {
|
|
1431
1435
|
class: "text-destructive size-5 shrink-0",
|
|
1432
1436
|
"aria-hidden": "true"
|
|
1433
1437
|
})
|
|
1434
|
-
]) :
|
|
1438
|
+
]) : H("", !0)
|
|
1435
1439
|
]),
|
|
1436
1440
|
_: 3
|
|
1437
|
-
})
|
|
1441
|
+
})) : H("", !0)
|
|
1438
1442
|
]),
|
|
1439
1443
|
_("div", {
|
|
1440
|
-
id: w(
|
|
1444
|
+
id: w(we),
|
|
1441
1445
|
"aria-live": "polite"
|
|
1442
1446
|
}, [
|
|
1443
|
-
ge.value ? h(
|
|
1447
|
+
ge.value ? h(l.$slots, "error", {
|
|
1444
1448
|
key: 0,
|
|
1445
1449
|
message: oe.value,
|
|
1446
1450
|
reason: n.value.reason ?? "",
|
|
@@ -1448,10 +1452,10 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
1448
1452
|
}, () => [
|
|
1449
1453
|
_("p", {
|
|
1450
1454
|
"data-slot": "tell-input-error",
|
|
1451
|
-
class:
|
|
1455
|
+
class: V(w(R)("text-destructive text-xs", e.errorClass)),
|
|
1452
1456
|
role: "alert"
|
|
1453
|
-
},
|
|
1454
|
-
]) :
|
|
1457
|
+
}, M(oe.value), 3)
|
|
1458
|
+
]) : Ce.value ? h(l.$slots, "hint", {
|
|
1455
1459
|
key: 1,
|
|
1456
1460
|
country: u.value,
|
|
1457
1461
|
formatHint: m.value.format_hint,
|
|
@@ -1459,9 +1463,9 @@ const At = ["src", "alt"], St = ["aria-label"], ve = /* @__PURE__ */ be({
|
|
|
1459
1463
|
}, () => [
|
|
1460
1464
|
_("p", {
|
|
1461
1465
|
"data-slot": "tell-input-hint",
|
|
1462
|
-
class:
|
|
1463
|
-
},
|
|
1464
|
-
]) :
|
|
1466
|
+
class: V(w(R)("text-muted-foreground text-xs tabular-nums", e.hintClass))
|
|
1467
|
+
}, M(m.value.format_hint), 3)
|
|
1468
|
+
]) : H("", !0)
|
|
1465
1469
|
], 8, Xt)
|
|
1466
1470
|
], 10, Yt));
|
|
1467
1471
|
}
|
|
@@ -1472,7 +1476,7 @@ export {
|
|
|
1472
1476
|
ve as _,
|
|
1473
1477
|
Jt as a,
|
|
1474
1478
|
fa as b,
|
|
1475
|
-
|
|
1479
|
+
Ne as c,
|
|
1476
1480
|
_t as d,
|
|
1477
1481
|
Ct as e,
|
|
1478
1482
|
Oe as f,
|
|
@@ -1482,4 +1486,4 @@ export {
|
|
|
1482
1486
|
wt as r,
|
|
1483
1487
|
da as u
|
|
1484
1488
|
};
|
|
1485
|
-
//# sourceMappingURL=ATellInput.vue_vue_type_script_setup_true_lang-
|
|
1489
|
+
//# sourceMappingURL=ATellInput.vue_vue_type_script_setup_true_lang-D7hPj1g1.mjs.map
|