@stachelock/ui 0.6.12 → 0.6.13
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/inputs/PhoneInput.js +97 -93
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Pe, inject as Le, ref as f, computed as i, toRef as Re, watch as
|
|
1
|
+
import { defineComponent as Pe, inject as Le, ref as f, computed as i, toRef as Re, watch as B, nextTick as ie, onMounted as Te, onUnmounted as Ae, createBlock as R, openBlock as C, unref as b, withCtx as T, createElementVNode as u, normalizeClass as I, createVNode as D, createElementBlock as Y, createCommentVNode as U, renderSlot as Me, toDisplayString as W, Teleport as Be, Transition as De, normalizeStyle as Ue, withDirectives as Fe, withModifiers as Z, vModelText as He, Fragment as Ge, renderList as Ke, withKeys as qe } from "vue";
|
|
2
2
|
import { useField as Ye } from "vee-validate";
|
|
3
3
|
import { Listbox as je, ListboxButton as ze, ListboxOptions as $e, ListboxOption as _e } from "@headlessui/vue";
|
|
4
4
|
import { ChevronDownIcon as We, CheckIcon as Ze, ExclamationCircleIcon as Je, CheckCircleIcon as Xe } from "@heroicons/vue/20/solid";
|
|
@@ -74,12 +74,12 @@ const E = {
|
|
|
74
74
|
TR: { code: "TR", name: "Turkey", dialCode: "+90" },
|
|
75
75
|
PK: { code: "PK", name: "Pakistan", dialCode: "+92" }
|
|
76
76
|
}, ue = Object.values(E).sort(
|
|
77
|
-
(a,
|
|
77
|
+
(a, r) => a.name.localeCompare(r.name)
|
|
78
78
|
);
|
|
79
79
|
function sa(a) {
|
|
80
80
|
return E[a]?.dialCode ?? "+1";
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function V(a, r, v = {}) {
|
|
83
83
|
const { required: l = !1 } = v;
|
|
84
84
|
if (!a || a.trim() === "")
|
|
85
85
|
return l ? {
|
|
@@ -101,27 +101,27 @@ function T(a, s, v = {}) {
|
|
|
101
101
|
errorCode: "TOO_SHORT"
|
|
102
102
|
};
|
|
103
103
|
try {
|
|
104
|
-
const p = new X(
|
|
104
|
+
const p = new X(r);
|
|
105
105
|
p.input(n);
|
|
106
106
|
const y = p.getNumber();
|
|
107
107
|
if (!y)
|
|
108
108
|
return {
|
|
109
109
|
isValid: !1,
|
|
110
|
-
errorMessage: `Invalid format for ${E[
|
|
110
|
+
errorMessage: `Invalid format for ${E[r]?.name || "selected country"}`,
|
|
111
111
|
errorCode: "INVALID_FORMAT"
|
|
112
112
|
};
|
|
113
113
|
if (!y.isPossible())
|
|
114
114
|
return {
|
|
115
115
|
isValid: !1,
|
|
116
|
-
errorMessage: `Not a possible phone number for ${E[
|
|
116
|
+
errorMessage: `Not a possible phone number for ${E[r]?.name || "this country"}`,
|
|
117
117
|
errorCode: "NOT_POSSIBLE"
|
|
118
118
|
};
|
|
119
119
|
const w = la(
|
|
120
120
|
y.nationalNumber || n,
|
|
121
|
-
|
|
121
|
+
r
|
|
122
122
|
);
|
|
123
123
|
if (w) {
|
|
124
|
-
const S = E[
|
|
124
|
+
const S = E[r]?.name || "this country", k = {
|
|
125
125
|
INVALID_COUNTRY: { message: "Invalid country code", code: "INVALID_COUNTRY" },
|
|
126
126
|
TOO_SHORT: { message: `Phone number is too short for ${S}`, code: "TOO_SHORT" },
|
|
127
127
|
INVALID_LENGTH: { message: `Invalid phone number length for ${S}`, code: "INVALID_LENGTH" },
|
|
@@ -148,10 +148,10 @@ function T(a, s, v = {}) {
|
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
function ra(a,
|
|
151
|
+
function ra(a, r = "US") {
|
|
152
152
|
if (!a) return "";
|
|
153
153
|
try {
|
|
154
|
-
const v = new X(
|
|
154
|
+
const v = new X(r);
|
|
155
155
|
v.input(a);
|
|
156
156
|
const l = v.getNumber();
|
|
157
157
|
return l ? l.formatNational() : a.replace(/^\+[0-9]{1,3}/, "").trim();
|
|
@@ -159,11 +159,11 @@ function ra(a, s = "US") {
|
|
|
159
159
|
return console.error("Error formatting phone number:", v), a || "";
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
function J(a,
|
|
162
|
+
function J(a, r = "US") {
|
|
163
163
|
if (!a)
|
|
164
164
|
return { formatted: "", numberObject: void 0 };
|
|
165
165
|
try {
|
|
166
|
-
const v = a.replace(/(?!^\+)[^0-9]/g, ""), l = new X(
|
|
166
|
+
const v = a.replace(/(?!^\+)[^0-9]/g, ""), l = new X(r), n = l.input(v), h = l.getNumber();
|
|
167
167
|
return { formatted: n, numberObject: h };
|
|
168
168
|
} catch (v) {
|
|
169
169
|
return console.error("Error formatting phone number:", v), { formatted: a, numberObject: void 0 };
|
|
@@ -172,9 +172,9 @@ function J(a, s = "US") {
|
|
|
172
172
|
function ce(a) {
|
|
173
173
|
if (!(!a || !a.startsWith("+")))
|
|
174
174
|
try {
|
|
175
|
-
const
|
|
176
|
-
if (
|
|
177
|
-
return
|
|
175
|
+
const r = ta(a);
|
|
176
|
+
if (r?.country)
|
|
177
|
+
return r.country;
|
|
178
178
|
} catch {
|
|
179
179
|
}
|
|
180
180
|
}
|
|
@@ -278,10 +278,10 @@ const ia = ["src", "alt"], ua = { class: "sl-font-medium" }, ca = { class: "sl-b
|
|
|
278
278
|
}
|
|
279
279
|
},
|
|
280
280
|
emits: ["update:modelValue", "update:value", "update:country", "update-metadata", "submit", "focus", "blur", "validated"],
|
|
281
|
-
setup(a, { expose:
|
|
282
|
-
const l = a, n = v, h = Le("phoneInput", {}), p = f(null), y = f(null), w = f(null), S = f(null),
|
|
281
|
+
setup(a, { expose: r, emit: v }) {
|
|
282
|
+
const l = a, n = v, h = Le("phoneInput", {}), p = f(null), y = f(null), w = f(null), S = f(null), F = f({ top: 0, left: 0 }), k = i(() => ea(l.name)), j = Re(l, "name"), Q = i(() => l.modelValue ?? l.value ?? ""), s = f(
|
|
283
283
|
l.defaultCountry || h.defaultCountry || "US"
|
|
284
|
-
),
|
|
284
|
+
), O = f(""), c = f(""), m = f(""), H = f(""), N = f(!1), ee = f(!1), {
|
|
285
285
|
meta: A,
|
|
286
286
|
errorMessage: me,
|
|
287
287
|
handleBlur: fe,
|
|
@@ -289,34 +289,34 @@ const ia = ["src", "alt"], ua = { class: "sl-font-medium" }, ca = { class: "sl-b
|
|
|
289
289
|
setTouched: ve
|
|
290
290
|
} = Ye(j, l.rules, {
|
|
291
291
|
initialValue: Q.value
|
|
292
|
-
}), le = i(() => E[
|
|
292
|
+
}), le = i(() => E[s.value] || E.US), ge = i(() => l.required ? !1 : aa(l.rules)), z = i({
|
|
293
293
|
get: () => le.value,
|
|
294
294
|
set: (e) => {
|
|
295
|
-
e && e.code !==
|
|
295
|
+
e && e.code !== s.value && de(e.code);
|
|
296
296
|
}
|
|
297
|
-
}), he = i(() => sa(
|
|
298
|
-
top: `${
|
|
299
|
-
left: `${
|
|
297
|
+
}), he = i(() => sa(s.value)), pe = i(() => l.placeholder || da(s.value)), $ = i(() => H.value || me.value), G = i(() => !!$.value && (A.touched || l.showErrors)), Ce = i(() => (G.value || N.value && l.colorfulValidation) && (A.touched || l.showErrors)), te = i(() => N.value && !!c.value && !H.value && l.colorfulValidation), ye = i(() => l.disabled ? "sl-ring-gray-200 dark:sl-ring-slate-600" : G.value ? "sl-ring-red-500 focus-within:sl-ring-red-500" : te.value && l.colorfulValidation ? "sl-ring-green-500 focus-within:sl-ring-green-500" : "sl-ring-gray-300 dark:sl-ring-slate-600 focus-within:sl-ring-primary-600"), be = i(() => ({
|
|
298
|
+
top: `${F.value.top}px`,
|
|
299
|
+
left: `${F.value.left}px`
|
|
300
300
|
})), oe = async () => {
|
|
301
301
|
if (await ie(), w.value) {
|
|
302
302
|
const e = w.value.getBoundingClientRect();
|
|
303
|
-
|
|
303
|
+
F.value = {
|
|
304
304
|
top: e.bottom + window.scrollY + 4,
|
|
305
305
|
// 4px gap, account for scroll
|
|
306
306
|
left: e.left + window.scrollX
|
|
307
307
|
};
|
|
308
308
|
}
|
|
309
|
-
},
|
|
310
|
-
|
|
311
|
-
},
|
|
312
|
-
|
|
309
|
+
}, K = () => {
|
|
310
|
+
P.value && oe();
|
|
311
|
+
}, P = f(!1), we = () => {
|
|
312
|
+
P.value = !P.value, P.value && oe();
|
|
313
313
|
};
|
|
314
|
-
|
|
315
|
-
|
|
314
|
+
B(z, () => {
|
|
315
|
+
P.value = !1;
|
|
316
316
|
});
|
|
317
317
|
const se = (e) => {
|
|
318
318
|
const o = e.target;
|
|
319
|
-
w.value && !w.value.contains(o) && !o.closest('[role="listbox"]') && (
|
|
319
|
+
w.value && !w.value.contains(o) && !o.closest('[role="listbox"]') && (P.value = !1);
|
|
320
320
|
}, xe = i(() => {
|
|
321
321
|
const e = [];
|
|
322
322
|
return $.value && e.push(`${k.value}-error`), l.hint && e.push(`${k.value}-hint`), e.length > 0 ? e.join(" ") : void 0;
|
|
@@ -332,8 +332,8 @@ const ia = ["src", "alt"], ua = { class: "sl-font-medium" }, ca = { class: "sl-b
|
|
|
332
332
|
}
|
|
333
333
|
if (h.excludedCountries?.length && (e = e.filter(
|
|
334
334
|
(t) => !h.excludedCountries.includes(t.code)
|
|
335
|
-
)), !
|
|
336
|
-
const o =
|
|
335
|
+
)), !O.value) return e;
|
|
336
|
+
const o = O.value.toLowerCase();
|
|
337
337
|
return e.filter(
|
|
338
338
|
(t) => t.name.toLowerCase().includes(o) || t.dialCode.includes(o) || t.code.toLowerCase().includes(o)
|
|
339
339
|
);
|
|
@@ -341,22 +341,22 @@ const ia = ["src", "alt"], ua = { class: "sl-font-medium" }, ca = { class: "sl-b
|
|
|
341
341
|
const o = e.target;
|
|
342
342
|
o.src = 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239ca3af"%3E%3Cpath d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/%3E%3C/svg%3E';
|
|
343
343
|
}, de = (e) => {
|
|
344
|
-
if (
|
|
344
|
+
if (s.value = e, O.value = "", n("update:country", e), ee.value && c.value) {
|
|
345
345
|
const { formatted: o, numberObject: t } = J(c.value, e);
|
|
346
|
-
c.value = o, t?.number && (m.value = t.number,
|
|
347
|
-
const d =
|
|
348
|
-
|
|
346
|
+
c.value = o, t?.number && (m.value = t.number, L(t.number));
|
|
347
|
+
const d = V(c.value, e, { required: l.required });
|
|
348
|
+
M(d);
|
|
349
349
|
}
|
|
350
350
|
ie(() => {
|
|
351
351
|
p.value?.focus();
|
|
352
352
|
});
|
|
353
|
-
},
|
|
354
|
-
N.value = e.isValid,
|
|
353
|
+
}, M = (e) => {
|
|
354
|
+
N.value = e.isValid, H.value = e.errorMessage || "", n("validated", e), n("update-metadata", {
|
|
355
355
|
dirty: A.dirty,
|
|
356
356
|
valid: e.isValid,
|
|
357
357
|
e164: e.e164
|
|
358
358
|
});
|
|
359
|
-
},
|
|
359
|
+
}, L = (e) => {
|
|
360
360
|
n("update:modelValue", e), n("update:value", e);
|
|
361
361
|
}, Ee = (e) => {
|
|
362
362
|
const o = e.target, t = o.value;
|
|
@@ -364,66 +364,70 @@ const ia = ["src", "alt"], ua = { class: "sl-font-medium" }, ca = { class: "sl-b
|
|
|
364
364
|
(q) => q.name.toLowerCase() === t.toLowerCase() || q.code.toLowerCase() === t.toLowerCase()
|
|
365
365
|
)) return;
|
|
366
366
|
if (!t.trim()) {
|
|
367
|
-
c.value = "", m.value = "",
|
|
368
|
-
const q =
|
|
369
|
-
|
|
367
|
+
c.value = "", m.value = "", L(""), ae(e);
|
|
368
|
+
const q = V("", s.value, { required: l.required });
|
|
369
|
+
M(q);
|
|
370
370
|
return;
|
|
371
371
|
}
|
|
372
|
-
const { formatted: g, numberObject: x } = J(t,
|
|
373
|
-
c.value = g, o.value = g, x?.number ? (m.value = x.number,
|
|
374
|
-
const Oe =
|
|
375
|
-
|
|
372
|
+
const { formatted: g, numberObject: x } = J(t, s.value);
|
|
373
|
+
c.value = g, o.value = g, x?.number ? (m.value = x.number, L(x.number)) : (m.value = "", L(""));
|
|
374
|
+
const Oe = V(g, s.value, { required: l.required });
|
|
375
|
+
M(Oe), ae(e);
|
|
376
376
|
}, Se = async (e) => {
|
|
377
377
|
e.preventDefault();
|
|
378
378
|
const o = e.clipboardData?.getData("text") || "";
|
|
379
379
|
if (!o) return;
|
|
380
380
|
if (l.autoDetectCountry && o.startsWith("+")) {
|
|
381
381
|
const x = ce(o);
|
|
382
|
-
x && x !==
|
|
382
|
+
x && x !== s.value && (s.value = x, n("update:country", x));
|
|
383
383
|
}
|
|
384
|
-
const { formatted: t, numberObject: d } = J(o,
|
|
385
|
-
c.value = t, p.value && (p.value.value = t), d?.number ? (m.value = d.number,
|
|
386
|
-
const g =
|
|
387
|
-
|
|
384
|
+
const { formatted: t, numberObject: d } = J(o, s.value);
|
|
385
|
+
c.value = t, p.value && (p.value.value = t), d?.number ? (m.value = d.number, L(d.number)) : (m.value = "", L(""));
|
|
386
|
+
const g = V(t, s.value, { required: l.required });
|
|
387
|
+
M(g);
|
|
388
388
|
}, ke = (e) => {
|
|
389
|
-
fe(e), ve(!0),
|
|
389
|
+
if (fe(e), ve(!0), !c.value.trim()) {
|
|
390
|
+
const o = V("", s.value, { required: l.required });
|
|
391
|
+
M(o);
|
|
392
|
+
}
|
|
393
|
+
n("blur");
|
|
390
394
|
}, Ne = () => {
|
|
391
395
|
n("focus");
|
|
392
396
|
}, Ve = () => {
|
|
393
397
|
A.valid && N.value && m.value && n("submit");
|
|
394
398
|
}, _ = (e) => {
|
|
395
399
|
if (!e) {
|
|
396
|
-
c.value = "", m.value = "", N.value = !l.required,
|
|
400
|
+
c.value = "", m.value = "", N.value = !l.required, H.value = "";
|
|
397
401
|
return;
|
|
398
402
|
}
|
|
399
403
|
if (l.autoDetectCountry && e.startsWith("+")) {
|
|
400
404
|
const d = ce(e);
|
|
401
|
-
d && (
|
|
405
|
+
d && (s.value = d, n("update:country", d));
|
|
402
406
|
}
|
|
403
|
-
const o = ra(e,
|
|
407
|
+
const o = ra(e, s.value);
|
|
404
408
|
c.value = o, m.value = e.startsWith("+") ? e : "";
|
|
405
|
-
const t =
|
|
409
|
+
const t = V(o, s.value, { required: l.required });
|
|
406
410
|
N.value = t.isValid, t.e164 && (m.value = t.e164);
|
|
407
411
|
};
|
|
408
|
-
return
|
|
412
|
+
return r({
|
|
409
413
|
focus: () => p.value?.focus(),
|
|
410
414
|
blur: () => p.value?.blur(),
|
|
411
|
-
validate: () =>
|
|
415
|
+
validate: () => V(c.value, s.value, { required: l.required }),
|
|
412
416
|
getE164: () => m.value,
|
|
413
|
-
getCountry: () =>
|
|
417
|
+
getCountry: () => s.value,
|
|
414
418
|
setCountry: (e) => de(e)
|
|
415
419
|
}), Te(() => {
|
|
416
|
-
ee.value = !0, _(Q.value), window.addEventListener("scroll",
|
|
420
|
+
ee.value = !0, _(Q.value), window.addEventListener("scroll", K, !0), window.addEventListener("resize", K), document.addEventListener("click", se);
|
|
417
421
|
}), Ae(() => {
|
|
418
|
-
window.removeEventListener("scroll",
|
|
419
|
-
}),
|
|
422
|
+
window.removeEventListener("scroll", K, !0), window.removeEventListener("resize", K), document.removeEventListener("click", se);
|
|
423
|
+
}), B(() => l.modelValue, (e) => {
|
|
420
424
|
e !== m.value && _(e);
|
|
421
|
-
}, { immediate: !1 }),
|
|
425
|
+
}, { immediate: !1 }), B(() => l.value, (e) => {
|
|
422
426
|
e !== m.value && _(e);
|
|
423
|
-
}, { immediate: !1 }),
|
|
424
|
-
e && !c.value && (
|
|
425
|
-
}),
|
|
426
|
-
}), (e, o) => (C(),
|
|
427
|
+
}, { immediate: !1 }), B(() => l.defaultCountry, (e) => {
|
|
428
|
+
e && !c.value && (s.value = e);
|
|
429
|
+
}), B(O, () => {
|
|
430
|
+
}), (e, o) => (C(), R(Qe, {
|
|
427
431
|
id: k.value,
|
|
428
432
|
name: j.value,
|
|
429
433
|
label: a.label,
|
|
@@ -439,27 +443,27 @@ const ia = ["src", "alt"], ua = { class: "sl-font-medium" }, ca = { class: "sl-b
|
|
|
439
443
|
"disabled-message": a.disabledMessage,
|
|
440
444
|
"colorful-validation": a.colorfulValidation
|
|
441
445
|
}, {
|
|
442
|
-
default:
|
|
446
|
+
default: T(() => [
|
|
443
447
|
u("div", {
|
|
444
448
|
class: I(["sl-flex sl-rounded-md sl-ring-1 sl-ring-inset", [
|
|
445
449
|
ye.value,
|
|
446
450
|
a.disabled ? "sl-bg-gray-50 dark:sl-bg-slate-800 sl-shadow-none" : "sl-bg-white dark:sl-bg-slate-800 sl-shadow-sm focus-within:sl-ring-2 focus-within:sl-ring-inset"
|
|
447
451
|
]])
|
|
448
452
|
}, [
|
|
449
|
-
|
|
453
|
+
D(b(je), {
|
|
450
454
|
modelValue: z.value,
|
|
451
455
|
"onUpdate:modelValue": o[3] || (o[3] = (t) => z.value = t),
|
|
452
456
|
disabled: a.disabled,
|
|
453
457
|
as: "div",
|
|
454
458
|
class: "sl-relative sl-flex-shrink-0"
|
|
455
459
|
}, {
|
|
456
|
-
default:
|
|
460
|
+
default: T(() => [
|
|
457
461
|
u("div", {
|
|
458
462
|
ref_key: "countryButtonRef",
|
|
459
463
|
ref: w,
|
|
460
464
|
class: "sl-h-full"
|
|
461
465
|
}, [
|
|
462
|
-
|
|
466
|
+
D(b(ze), {
|
|
463
467
|
disabled: a.disabled,
|
|
464
468
|
class: I(["sl-flex sl-items-center sl-gap-1.5 sl-h-full sl-pl-3 sl-pr-2 sl-border-r sl-text-sm focus:sl-outline-none sl-transition-colors", [
|
|
465
469
|
a.disabled ? "sl-text-gray-400 dark:sl-text-gray-300 sl-cursor-not-allowed sl-border-gray-200 dark:sl-border-slate-600 sl-bg-transparent" : "sl-text-gray-700 dark:sl-text-gray-100 sl-border-gray-300 dark:sl-border-slate-600 hover:sl-bg-gray-50 dark:hover:sl-bg-slate-700 sl-cursor-pointer"
|
|
@@ -467,19 +471,19 @@ const ia = ["src", "alt"], ua = { class: "sl-font-medium" }, ca = { class: "sl-b
|
|
|
467
471
|
"data-testid": "country-selector",
|
|
468
472
|
onClick: we
|
|
469
473
|
}, {
|
|
470
|
-
default:
|
|
474
|
+
default: T(() => [
|
|
471
475
|
u("span", {
|
|
472
476
|
class: I(["sl-w-5 sl-h-5 sl-rounded-full sl-overflow-hidden sl-flex-shrink-0 sl-shadow-sm", a.disabled ? "sl-opacity-60 sl-bg-gray-200" : "sl-bg-gray-100"])
|
|
473
477
|
}, [
|
|
474
478
|
u("img", {
|
|
475
|
-
src: ne(
|
|
479
|
+
src: ne(s.value),
|
|
476
480
|
alt: le.value.name,
|
|
477
481
|
class: I(["sl-w-full sl-h-full sl-object-cover", { "sl-grayscale sl-opacity-75": a.disabled }]),
|
|
478
482
|
onError: Ie
|
|
479
483
|
}, null, 42, ia)
|
|
480
484
|
], 2),
|
|
481
485
|
u("span", ua, W(he.value), 1),
|
|
482
|
-
a.disabled ?
|
|
486
|
+
a.disabled ? U("", !0) : (C(), R(b(We), {
|
|
483
487
|
key: 0,
|
|
484
488
|
class: "sl-h-4 sl-w-4 sl-text-gray-400",
|
|
485
489
|
"aria-hidden": "true"
|
|
@@ -488,8 +492,8 @@ const ia = ["src", "alt"], ua = { class: "sl-font-medium" }, ca = { class: "sl-b
|
|
|
488
492
|
_: 1
|
|
489
493
|
}, 8, ["disabled", "class"])
|
|
490
494
|
], 512),
|
|
491
|
-
(C(),
|
|
492
|
-
|
|
495
|
+
(C(), R(Be, { to: "body" }, [
|
|
496
|
+
D(De, {
|
|
493
497
|
"enter-active-class": "sl-transition sl-duration-100 sl-ease-out",
|
|
494
498
|
"enter-from-class": "sl-transform sl-scale-95 sl-opacity-0",
|
|
495
499
|
"enter-to-class": "sl-transform sl-scale-100 sl-opacity-100",
|
|
@@ -497,19 +501,19 @@ const ia = ["src", "alt"], ua = { class: "sl-font-medium" }, ca = { class: "sl-b
|
|
|
497
501
|
"leave-from-class": "sl-transform sl-scale-100 sl-opacity-100",
|
|
498
502
|
"leave-to-class": "sl-transform sl-scale-95 sl-opacity-0"
|
|
499
503
|
}, {
|
|
500
|
-
default:
|
|
501
|
-
|
|
504
|
+
default: T(() => [
|
|
505
|
+
D(b($e), {
|
|
502
506
|
ref_key: "dropdownRef",
|
|
503
507
|
ref: S,
|
|
504
508
|
style: Ue([be.value, { "z-index": "9999" }]),
|
|
505
509
|
class: "sl-fixed sl-w-72 sl-rounded-lg sl-bg-white dark:sl-bg-slate-800 sl-text-sm sl-shadow-xl sl-ring-1 sl-ring-black dark:sl-ring-slate-600 sl-ring-opacity-5 focus:sl-outline-none sl-overflow-hidden"
|
|
506
510
|
}, {
|
|
507
|
-
default:
|
|
511
|
+
default: T(() => [
|
|
508
512
|
u("div", ca, [
|
|
509
513
|
Fe(u("input", {
|
|
510
514
|
ref_key: "searchInputRef",
|
|
511
515
|
ref: y,
|
|
512
|
-
"onUpdate:modelValue": o[0] || (o[0] = (t) =>
|
|
516
|
+
"onUpdate:modelValue": o[0] || (o[0] = (t) => O.value = t),
|
|
513
517
|
type: "text",
|
|
514
518
|
class: "sl-w-full sl-px-3 sl-py-1.5 sl-text-sm sl-border sl-border-gray-300 dark:sl-border-slate-600 sl-rounded-md sl-bg-white dark:sl-bg-slate-700 sl-text-gray-900 dark:sl-text-gray-100 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-primary-500 focus:sl-border-primary-500",
|
|
515
519
|
placeholder: "Search countries...",
|
|
@@ -518,16 +522,16 @@ const ia = ["src", "alt"], ua = { class: "sl-font-medium" }, ca = { class: "sl-b
|
|
|
518
522
|
onKeydown: o[2] || (o[2] = Z(() => {
|
|
519
523
|
}, ["stop"]))
|
|
520
524
|
}, null, 544), [
|
|
521
|
-
[He,
|
|
525
|
+
[He, O.value]
|
|
522
526
|
])
|
|
523
527
|
]),
|
|
524
528
|
u("div", ma, [
|
|
525
|
-
(C(!0), Y(Ge, null, Ke(re.value, (t) => (C(),
|
|
529
|
+
(C(!0), Y(Ge, null, Ke(re.value, (t) => (C(), R(b(_e), {
|
|
526
530
|
key: t.code,
|
|
527
531
|
value: t,
|
|
528
532
|
as: "template"
|
|
529
533
|
}, {
|
|
530
|
-
default:
|
|
534
|
+
default: T(({ active: d, selected: g }) => [
|
|
531
535
|
u("li", {
|
|
532
536
|
class: I([
|
|
533
537
|
"sl-relative sl-cursor-pointer sl-select-none sl-py-2 sl-pl-3 sl-pr-9",
|
|
@@ -556,16 +560,16 @@ const ia = ["src", "alt"], ua = { class: "sl-font-medium" }, ca = { class: "sl-b
|
|
|
556
560
|
d ? "sl-text-white" : "sl-text-primary-600"
|
|
557
561
|
])
|
|
558
562
|
}, [
|
|
559
|
-
|
|
563
|
+
D(b(Ze), {
|
|
560
564
|
class: "sl-h-5 sl-w-5",
|
|
561
565
|
"aria-hidden": "true"
|
|
562
566
|
})
|
|
563
|
-
], 2)) :
|
|
567
|
+
], 2)) : U("", !0)
|
|
564
568
|
], 2)
|
|
565
569
|
]),
|
|
566
570
|
_: 2
|
|
567
571
|
}, 1032, ["value"]))), 128)),
|
|
568
|
-
re.value.length === 0 ? (C(), Y("li", pa, " No countries found ")) :
|
|
572
|
+
re.value.length === 0 ? (C(), Y("li", pa, " No countries found ")) : U("", !0)
|
|
569
573
|
])
|
|
570
574
|
]),
|
|
571
575
|
_: 1
|
|
@@ -590,7 +594,7 @@ const ia = ["src", "alt"], ua = { class: "sl-font-medium" }, ca = { class: "sl-b
|
|
|
590
594
|
enterkeyhint: "go",
|
|
591
595
|
disabled: a.disabled,
|
|
592
596
|
"aria-describedby": xe.value,
|
|
593
|
-
"aria-invalid":
|
|
597
|
+
"aria-invalid": G.value,
|
|
594
598
|
class: I(["sl-block sl-flex-1 sl-min-w-0 sl-border-0 sl-bg-transparent sl-py-1.5 sl-pl-2 sl-pr-3 focus:sl-ring-0 focus:sl-outline-none sm:sl-text-sm sm:sl-leading-6", [
|
|
595
599
|
a.disabled ? "sl-text-gray-400 dark:sl-text-gray-300 sl-cursor-not-allowed placeholder:sl-text-gray-300 dark:placeholder:sl-text-slate-500" : "sl-text-gray-800 dark:sl-text-gray-100 placeholder:sl-text-gray-400 dark:placeholder:sl-text-slate-500"
|
|
596
600
|
]]),
|
|
@@ -602,25 +606,25 @@ const ia = ["src", "alt"], ua = { class: "sl-font-medium" }, ca = { class: "sl-b
|
|
|
602
606
|
"data-testid": "phone-input"
|
|
603
607
|
}, null, 42, Ca),
|
|
604
608
|
Ce.value ? (C(), Y("div", ya, [
|
|
605
|
-
|
|
609
|
+
G.value ? (C(), R(b(Je), {
|
|
606
610
|
key: 0,
|
|
607
611
|
class: "sl-h-5 sl-w-5 sl-text-red-500",
|
|
608
612
|
"aria-hidden": "true",
|
|
609
613
|
"data-testid": "error-icon"
|
|
610
|
-
})) : te.value ? (C(),
|
|
614
|
+
})) : te.value ? (C(), R(b(Xe), {
|
|
611
615
|
key: 1,
|
|
612
616
|
class: "sl-h-5 sl-w-5 sl-text-green-500",
|
|
613
617
|
"aria-hidden": "true",
|
|
614
618
|
"data-testid": "success-icon"
|
|
615
|
-
})) :
|
|
616
|
-
])) :
|
|
619
|
+
})) : U("", !0)
|
|
620
|
+
])) : U("", !0),
|
|
617
621
|
Me(e.$slots, "input-right", {}, void 0, !0)
|
|
618
622
|
], 2)
|
|
619
623
|
]),
|
|
620
624
|
_: 3
|
|
621
625
|
}, 8, ["id", "name", "label", "optional", "error-message", "success-message", "is-valid", "is-touched", "show-errors", "show-valid-check", "tertiary-label", "disabled", "disabled-message", "colorful-validation"]));
|
|
622
626
|
}
|
|
623
|
-
}), Ra = /* @__PURE__ */ oa(ba, [["__scopeId", "data-v-
|
|
627
|
+
}), Ra = /* @__PURE__ */ oa(ba, [["__scopeId", "data-v-a2738bc9"]]);
|
|
624
628
|
export {
|
|
625
629
|
Ra as default
|
|
626
630
|
};
|