@incodetech/web 0.0.0-dev-20260318-deddf15 → 0.0.0-dev-20260318-aab03c7
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/{AsYouType-CpH-Rmtj.js → AsYouType-DoYUSTc1.js} +2 -1
- package/dist/{countries-C9bhJe4u.js → countries-CM1cm_kP.js} +4 -3
- package/dist/{ekycModule-CzPxqzT6.js → ekycModule-DBCar_-Z.js} +1 -1
- package/dist/extensibility.es.js +2 -2
- package/dist/flow/flow.es.js +3 -3
- package/dist/phone/phone.es.js +1 -1
- package/dist/{phoneInput-Duuochsh.js → phoneInput-D4yirBZy.js} +2 -2
- package/dist/phoneInputComposed-BG1BANDW.js +184 -0
- package/package.json +2 -2
- package/dist/phoneInputComposed-CwtJKvGh.js +0 -160
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as g,
|
|
1
|
+
import { M as g, d as et, i as j, v as zt, e as Jt, w as Zt, m as Qt } from "./countries-CM1cm_kP.js";
|
|
2
2
|
function U(t, r, e) {
|
|
3
3
|
return te(t, r, void 0, e);
|
|
4
4
|
}
|
|
@@ -2602,5 +2602,6 @@ tt.prototype = Object.create(Kt.prototype, {});
|
|
|
2602
2602
|
tt.prototype.constructor = tt;
|
|
2603
2603
|
export {
|
|
2604
2604
|
tt as A,
|
|
2605
|
+
Gt as P,
|
|
2605
2606
|
si as p
|
|
2606
2607
|
};
|
|
@@ -10,7 +10,7 @@ import { D as ee } from "./dropdownComposed-B5ZuQS8C.js";
|
|
|
10
10
|
import { P as T } from "./page-BVHG3h0V.js";
|
|
11
11
|
import { S as re } from "./spinner-Cx3FPUCD.js";
|
|
12
12
|
import { r as oe } from "./incodeModule-aE-LkKwM.js";
|
|
13
|
-
import { P as te } from "./phoneInputComposed-
|
|
13
|
+
import { P as te } from "./phoneInputComposed-BG1BANDW.js";
|
|
14
14
|
const ae = ({ config: p, onFinish: s }) => {
|
|
15
15
|
const { t: l } = $(), [a, d] = G(() => z({ config: p }));
|
|
16
16
|
return q(() => {
|
package/dist/extensibility.es.js
CHANGED
|
@@ -12,14 +12,14 @@ import { a as Oe, I as je } from "./inputComposed-BHi-MSpP.js";
|
|
|
12
12
|
import { O as qe } from "./otpInput-DdkvlvCS.js";
|
|
13
13
|
import { D as f, d as W, A as $, y as R, q as O } from "./vendor-preact-BXf0bkEs.js";
|
|
14
14
|
import { E as w } from "./errorIcon-BL647nVh.js";
|
|
15
|
-
import { P as Ne } from "./phoneInputComposed-
|
|
15
|
+
import { P as Ne } from "./phoneInputComposed-BG1BANDW.js";
|
|
16
16
|
import { D as Ge, S as Je } from "./dropdownComposed-B5ZuQS8C.js";
|
|
17
17
|
import { C as Qe, D as Xe } from "./dateInputComposed-CvFmQpJ0.js";
|
|
18
18
|
import { S as j } from "./successIcon-BybULRRU.js";
|
|
19
19
|
import { B as _e, L as ea, P as aa } from "./permissions-BDElyTL4.js";
|
|
20
20
|
import { C as oa } from "./chevronDown-BUaOuf9J.js";
|
|
21
21
|
import { C as ta } from "./closeIcon-BM7WLbKp.js";
|
|
22
|
-
import { c as ca,
|
|
22
|
+
import { c as ca, b as da, g as ia } from "./countries-CM1cm_kP.js";
|
|
23
23
|
import { C as pa, T as ha } from "./tutorial-D8y4KZtv.js";
|
|
24
24
|
import { a as ua, C as ma, b as xa, I as Ia, F as ba, T as fa } from "./flipAnimation-CSNIRlbv.js";
|
|
25
25
|
const U = ({ size: a = 28 }) => /* @__PURE__ */ e(
|
package/dist/flow/flow.es.js
CHANGED
|
@@ -7,7 +7,7 @@ import { r as Tt } from "../incodeModule-aE-LkKwM.js";
|
|
|
7
7
|
import { S as x } from "../spinner-Cx3FPUCD.js";
|
|
8
8
|
import { createRedirectToMobileManager as Jt } from "@incodetech/core/redirect-to-mobile";
|
|
9
9
|
import { S as Mt } from "../successIcon-BybULRRU.js";
|
|
10
|
-
import {
|
|
10
|
+
import { b as xt } from "../countries-CM1cm_kP.js";
|
|
11
11
|
import { T as Qt } from "../Trans-CA9a3vKp.js";
|
|
12
12
|
import { ekybMachine as Wt } from "@incodetech/core/ekyb";
|
|
13
13
|
import { ekycMachine as Xt } from "@incodetech/core/ekyc";
|
|
@@ -1672,7 +1672,7 @@ const _n = ({
|
|
|
1672
1672
|
) })
|
|
1673
1673
|
] });
|
|
1674
1674
|
}, Vn = jt(
|
|
1675
|
-
() => import("../phoneInput-
|
|
1675
|
+
() => import("../phoneInput-D4yirBZy.js").then((e) => ({ default: e.PhoneInput }))
|
|
1676
1676
|
), zn = ({
|
|
1677
1677
|
countryCode: e,
|
|
1678
1678
|
phonePrefix: t,
|
|
@@ -2000,7 +2000,7 @@ const Pe = () => import("../id/id.es.js").then((e) => e.Id), ke = {
|
|
|
2000
2000
|
(e) => e.GovernmentValidation
|
|
2001
2001
|
),
|
|
2002
2002
|
GEOLOCATION: () => import("../geolocation/geolocation.es.js").then((e) => e.Geolocation),
|
|
2003
|
-
EXTERNAL_VERIFICATION: () => import("../ekycModule-
|
|
2003
|
+
EXTERNAL_VERIFICATION: () => import("../ekycModule-DBCar_-Z.js").then((e) => e.EkycModule),
|
|
2004
2004
|
EKYB: () => import("../ekybModule-9m8cnkfH.js").then((e) => e.EkybModule),
|
|
2005
2005
|
DOCUMENT_CAPTURE: () => import("../documentCapture-PdKA2frR.js").then(
|
|
2006
2006
|
(e) => e.DocumentCapture
|
package/dist/phone/phone.es.js
CHANGED
|
@@ -6,7 +6,7 @@ import "@incodetech/core";
|
|
|
6
6
|
import { O as y } from "../otpInput-DdkvlvCS.js";
|
|
7
7
|
import { P as m } from "../page-BVHG3h0V.js";
|
|
8
8
|
import { r as w } from "../incodeModule-aE-LkKwM.js";
|
|
9
|
-
import { PhoneInput as k } from "../phoneInput-
|
|
9
|
+
import { PhoneInput as k } from "../phoneInput-D4yirBZy.js";
|
|
10
10
|
const B = ({
|
|
11
11
|
config: n,
|
|
12
12
|
manager: r,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { u as n, S } from "./button-Ca1tRSTI.js";
|
|
2
2
|
import { d as p, A as D, y as u, k as $ } from "./vendor-preact-BXf0bkEs.js";
|
|
3
|
-
import { g as b, c as g } from "./countries-
|
|
3
|
+
import { g as b, c as g } from "./countries-CM1cm_kP.js";
|
|
4
4
|
import { C as z } from "./chevronDown-BUaOuf9J.js";
|
|
5
|
-
import { p as k, A } from "./AsYouType-
|
|
5
|
+
import { p as k, A } from "./AsYouType-DoYUSTc1.js";
|
|
6
6
|
const M = ({
|
|
7
7
|
countryCode: P,
|
|
8
8
|
prefilledPhone: a,
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { u as t } from "./button-Ca1tRSTI.js";
|
|
2
|
+
import { D as J, d as b, A as x, T as f, y as Q, q as A } from "./vendor-preact-BXf0bkEs.js";
|
|
3
|
+
import { w as X, g as C, c as j, a as z } from "./countries-CM1cm_kP.js";
|
|
4
|
+
import { D as k } from "./dropdownComposed-B5ZuQS8C.js";
|
|
5
|
+
import { E as q } from "./errorIcon-BL647nVh.js";
|
|
6
|
+
import { S as _ } from "./successIcon-BybULRRU.js";
|
|
7
|
+
import { I as e2 } from "./inputComposed-BHi-MSpP.js";
|
|
8
|
+
import { P as o2, p as L, A as y } from "./AsYouType-DoYUSTc1.js";
|
|
9
|
+
function n2(n, r, s) {
|
|
10
|
+
if (r[n])
|
|
11
|
+
return new o2(n, r[n], s);
|
|
12
|
+
}
|
|
13
|
+
function t2() {
|
|
14
|
+
return X(n2, arguments);
|
|
15
|
+
}
|
|
16
|
+
const r2 = { AC: "40123", AD: "312345", AE: "501234567", AF: "701234567", AG: "2684641234", AI: "2642351234", AL: "672123456", AM: "77123456", AO: "923123456", AR: "91123456789", AS: "6847331234", AT: "664123456", AU: "412345678", AW: "5601234", AX: "412345678", AZ: "401234567", BA: "61123456", BB: "2462501234", BD: "1812345678", BE: "470123456", BF: "70123456", BG: "43012345", BH: "36001234", BI: "79561234", BJ: "0195123456", BL: "690001234", BM: "4413701234", BN: "7123456", BO: "71234567", BQ: "3181234", BR: "11961234567", BS: "2423591234", BT: "17123456", BW: "71123456", BY: "294911911", BZ: "6221234", CA: "5062345678", CC: "412345678", CD: "991234567", CF: "70012345", CG: "061234567", CH: "781234567", CI: "0123456789", CK: "71234", CL: "221234567", CM: "671234567", CN: "13123456789", CO: "3211234567", CR: "83123456", CU: "51234567", CV: "9911234", CW: "95181234", CX: "412345678", CY: "96123456", CZ: "601123456", DE: "15123456789", DJ: "77831001", DK: "34412345", DM: "7672251234", DO: "8092345678", DZ: "551234567", EC: "991234567", EE: "51234567", EG: "1001234567", EH: "650123456", ER: "7123456", ES: "612345678", ET: "911234567", FI: "412345678", FJ: "7012345", FK: "51234", FM: "3501234", FO: "211234", FR: "612345678", GA: "06031234", GB: "7400123456", GD: "4734031234", GE: "555123456", GF: "694201234", GG: "7781123456", GH: "231234567", GI: "57123456", GL: "221234", GM: "3012345", GN: "601123456", GP: "690001234", GQ: "222123456", GR: "6912345678", GT: "51234567", GU: "6713001234", GW: "955012345", GY: "6091234", HK: "51234567", HN: "91234567", HR: "921234567", HT: "34101234", HU: "201234567", ID: "812345678", IE: "850123456", IL: "502345678", IM: "7924123456", IN: "8123456789", IO: "3801234", IQ: "7912345678", IR: "9123456789", IS: "6111234", IT: "3123456789", JE: "7797712345", JM: "8762101234", JO: "790123456", JP: "9012345678", KE: "712123456", KG: "700123456", KH: "91234567", KI: "72001234", KM: "3212345", KN: "8697652917", KP: "1921234567", KR: "1020000000", KW: "50012345", KY: "3453231234", KZ: "7710009998", LA: "2023123456", LB: "71123456", LC: "7582845678", LI: "660234567", LK: "712345678", LR: "770123456", LS: "50123456", LT: "61234567", LU: "628123456", LV: "21234567", LY: "912345678", MA: "650123456", MC: "612345678", MD: "62112345", ME: "60123456", MF: "690001234", MG: "321234567", MH: "2351234", MK: "72345678", ML: "65012345", MM: "92123456", MN: "88123456", MO: "66123456", MP: "6702345678", MQ: "696201234", MR: "22123456", MS: "6644923456", MT: "96961234", MU: "52512345", MV: "7712345", MW: "991234567", MX: "2221234567", MY: "123456789", MZ: "821234567", NA: "811234567", NC: "751234", NE: "93123456", NF: "381234", NG: "8021234567", NI: "81234567", NL: "612345678", NO: "40612345", NP: "9841234567", NR: "5551234", NU: "8884012", NZ: "211234567", OM: "92123456", PA: "61234567", PE: "912345678", PF: "87123456", PG: "70123456", PH: "9051234567", PK: "3012345678", PL: "512345678", PM: "551234", PR: "7872345678", PS: "599123456", PT: "912345678", PW: "6201234", PY: "961456789", QA: "33123456", RE: "692123456", RO: "712034567", RS: "601234567", RU: "9123456789", RW: "720123456", SA: "512345678", SB: "7421234", SC: "2510123", SD: "911231234", SE: "701234567", SG: "81234567", SH: "51234", SI: "31234567", SJ: "41234567", SK: "912123456", SL: "25123456", SM: "66661212", SN: "701234567", SO: "71123456", SR: "7412345", SS: "977123456", ST: "9812345", SV: "70123456", SX: "7215205678", SY: "944567890", SZ: "76123456", TA: "8999", TC: "6492311234", TD: "63012345", TG: "90112345", TH: "812345678", TJ: "917123456", TK: "7290", TL: "77212345", TM: "66123456", TN: "20123456", TO: "7715123", TR: "5012345678", TT: "8682911234", TV: "901234", TW: "912345678", TZ: "621234567", UA: "501234567", UG: "712345678", US: "2015550123", UY: "94231234", UZ: "912345678", VA: "3123456789", VC: "7844301234", VE: "4121234567", VG: "2843001234", VI: "3406421234", VN: "912345678", VU: "5912345", WF: "821234", WS: "7212345", XK: "43201234", YE: "712345678", YT: "639012345", ZA: "711234567", ZM: "955123456", ZW: "712345678" };
|
|
17
|
+
function K(n, r, s) {
|
|
18
|
+
return new y(s).input(`${r}${n}`).replace(r, "").trimStart();
|
|
19
|
+
}
|
|
20
|
+
function s2(n) {
|
|
21
|
+
const r = t2(n, r2);
|
|
22
|
+
if (!r) return "";
|
|
23
|
+
const s = `+${z(n)}`;
|
|
24
|
+
return K(r.nationalNumber, s, n);
|
|
25
|
+
}
|
|
26
|
+
const a2 = J(
|
|
27
|
+
({
|
|
28
|
+
id: n,
|
|
29
|
+
label: r,
|
|
30
|
+
countryCode: s = "US",
|
|
31
|
+
value: l,
|
|
32
|
+
placeholder: I,
|
|
33
|
+
error: i,
|
|
34
|
+
helper: h,
|
|
35
|
+
showErrorIcon: R,
|
|
36
|
+
showHelperIcon: D,
|
|
37
|
+
disabled: N = !1,
|
|
38
|
+
disableCountrySelector: $ = !1,
|
|
39
|
+
required: P,
|
|
40
|
+
onChange: M,
|
|
41
|
+
"aria-labelledby": g,
|
|
42
|
+
"data-testid": W,
|
|
43
|
+
...F
|
|
44
|
+
}, H) => {
|
|
45
|
+
const [a, G] = b(s), [p, S] = b(""), T = x(!1), U = f(
|
|
46
|
+
() => j.map((o) => ({
|
|
47
|
+
value: o.code,
|
|
48
|
+
label: `${o.emoji} ${o.callingCode} ${o.name}`
|
|
49
|
+
})),
|
|
50
|
+
[]
|
|
51
|
+
), c = f(
|
|
52
|
+
() => C(a) ?? C("US"),
|
|
53
|
+
[a]
|
|
54
|
+
), O = f(
|
|
55
|
+
() => I ?? s2(a),
|
|
56
|
+
[I, a]
|
|
57
|
+
);
|
|
58
|
+
Q(() => {
|
|
59
|
+
if (T.current || !l || !c) return;
|
|
60
|
+
T.current = !0;
|
|
61
|
+
const o = l.startsWith("+") ? l : `+${l}`, e = L(o);
|
|
62
|
+
if (e?.isValid() && e.country) {
|
|
63
|
+
e.country !== a && G(e.country);
|
|
64
|
+
const d = new y(e.country);
|
|
65
|
+
S(d.input(e.nationalNumber));
|
|
66
|
+
}
|
|
67
|
+
}, [l, c, a]);
|
|
68
|
+
const u = A(
|
|
69
|
+
(o, e) => {
|
|
70
|
+
const d = `${e.callingCode}${o.replace(/\D/g, "")}`;
|
|
71
|
+
try {
|
|
72
|
+
const Y = L(d, e.code);
|
|
73
|
+
M?.(d, Y?.isValid() ?? !1);
|
|
74
|
+
} catch {
|
|
75
|
+
M?.(d, !1);
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
[M]
|
|
79
|
+
), V = A(
|
|
80
|
+
(o) => {
|
|
81
|
+
G(o);
|
|
82
|
+
const e = C(o);
|
|
83
|
+
e && p && u(p, e);
|
|
84
|
+
},
|
|
85
|
+
[p, u]
|
|
86
|
+
), Z = A(
|
|
87
|
+
(o) => {
|
|
88
|
+
const e = o.target.value;
|
|
89
|
+
if (!c) {
|
|
90
|
+
S(e);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const d = K(
|
|
94
|
+
e,
|
|
95
|
+
c.callingCode,
|
|
96
|
+
c.code
|
|
97
|
+
);
|
|
98
|
+
S(d), u(e, c);
|
|
99
|
+
},
|
|
100
|
+
[c, u]
|
|
101
|
+
), v = `${n}-country`, m = `${n}-phone`, E = `${m}-helper`, B = `${m}-error`, w = [h ? E : null, i ? B : null].filter(Boolean).join(" ");
|
|
102
|
+
return /* @__PURE__ */ t("div", { class: "IncodePhoneInputComposed", children: [
|
|
103
|
+
r && /* @__PURE__ */ t(
|
|
104
|
+
"label",
|
|
105
|
+
{
|
|
106
|
+
class: "IncodePhoneInputComposedLabel",
|
|
107
|
+
htmlFor: m,
|
|
108
|
+
"data-testid": `${n}-label`,
|
|
109
|
+
children: [
|
|
110
|
+
r,
|
|
111
|
+
P && /* @__PURE__ */ t("span", { class: "IncodePhoneInputComposedRequired", children: " *" })
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
/* @__PURE__ */ t(
|
|
116
|
+
k,
|
|
117
|
+
{
|
|
118
|
+
id: v,
|
|
119
|
+
options: U,
|
|
120
|
+
value: a,
|
|
121
|
+
onChange: V,
|
|
122
|
+
disabled: N || $,
|
|
123
|
+
required: P,
|
|
124
|
+
searchable: !0,
|
|
125
|
+
searchPlaceholder: "Search countries...",
|
|
126
|
+
suppressMessages: !0,
|
|
127
|
+
"aria-label": "Select country code",
|
|
128
|
+
renderSelectedLabel: (o) => {
|
|
129
|
+
const e = C(o.value);
|
|
130
|
+
return e ? `${e.emoji} ${e.callingCode}` : o.label;
|
|
131
|
+
},
|
|
132
|
+
class: "IncodePhoneInputComposedDropdown",
|
|
133
|
+
siblingElement: /* @__PURE__ */ t(
|
|
134
|
+
e2,
|
|
135
|
+
{
|
|
136
|
+
id: m,
|
|
137
|
+
ref: H,
|
|
138
|
+
type: "tel",
|
|
139
|
+
value: p,
|
|
140
|
+
onInput: Z,
|
|
141
|
+
placeholder: O,
|
|
142
|
+
error: i,
|
|
143
|
+
disabled: N,
|
|
144
|
+
required: P,
|
|
145
|
+
suppressMessages: !0,
|
|
146
|
+
"aria-label": r ? void 0 : "Phone number",
|
|
147
|
+
"aria-labelledby": g,
|
|
148
|
+
"aria-describedby": w || void 0,
|
|
149
|
+
"aria-invalid": i ? "true" : void 0,
|
|
150
|
+
"data-testid": W,
|
|
151
|
+
...F
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
i && /* @__PURE__ */ t(
|
|
157
|
+
"div",
|
|
158
|
+
{
|
|
159
|
+
class: "IncodePhoneInputComposedErrorWrapper",
|
|
160
|
+
"data-testid": `${n}-error-wrapper`,
|
|
161
|
+
children: [
|
|
162
|
+
R && /* @__PURE__ */ t("div", { class: "IncodePhoneInputComposedIconWrapper", children: /* @__PURE__ */ t(q, { size: 16 }) }),
|
|
163
|
+
/* @__PURE__ */ t("p", { id: B, class: "IncodePhoneInputComposedError", children: i })
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
),
|
|
167
|
+
h && !i && /* @__PURE__ */ t(
|
|
168
|
+
"div",
|
|
169
|
+
{
|
|
170
|
+
class: "IncodePhoneInputComposedHelperWrapper",
|
|
171
|
+
"data-testid": `${n}-helper-wrapper`,
|
|
172
|
+
children: [
|
|
173
|
+
D && /* @__PURE__ */ t("div", { class: "IncodePhoneInputComposedIconWrapper", children: /* @__PURE__ */ t(_, { size: 16 }) }),
|
|
174
|
+
/* @__PURE__ */ t("p", { id: E, class: "IncodePhoneInputComposedHelper", children: h })
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
)
|
|
178
|
+
] });
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
a2.displayName = "PhoneInputComposed";
|
|
182
|
+
export {
|
|
183
|
+
a2 as P
|
|
184
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@incodetech/web",
|
|
3
|
-
"version": "0.0.0-dev-20260318-
|
|
3
|
+
"version": "0.0.0-dev-20260318-aab03c7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.es.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"preact-custom-element": "^4.6.0",
|
|
120
120
|
"qrcode": "^1.5.4",
|
|
121
121
|
"tailwindcss": "^4.1.17",
|
|
122
|
-
"@incodetech/core": "0.0.0-dev-20260318-
|
|
122
|
+
"@incodetech/core": "0.0.0-dev-20260318-aab03c7"
|
|
123
123
|
},
|
|
124
124
|
"devDependencies": {
|
|
125
125
|
"@microsoft/api-extractor": "^7.53.3",
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import { u as n } from "./button-Ca1tRSTI.js";
|
|
2
|
-
import { D as Y, d as S, A as k, T as D, y as q, q as y } from "./vendor-preact-BXf0bkEs.js";
|
|
3
|
-
import { g as u, c as G } from "./countries-C9bhJe4u.js";
|
|
4
|
-
import { D as J } from "./dropdownComposed-B5ZuQS8C.js";
|
|
5
|
-
import { E as K } from "./errorIcon-BL647nVh.js";
|
|
6
|
-
import { S as Q } from "./successIcon-BybULRRU.js";
|
|
7
|
-
import { I as X } from "./inputComposed-BHi-MSpP.js";
|
|
8
|
-
import { A as E, p as W } from "./AsYouType-CpH-Rmtj.js";
|
|
9
|
-
const Z = Y(
|
|
10
|
-
({
|
|
11
|
-
id: a,
|
|
12
|
-
label: m,
|
|
13
|
-
countryCode: A = "US",
|
|
14
|
-
value: c,
|
|
15
|
-
placeholder: N = "(123) 123-6789",
|
|
16
|
-
error: r,
|
|
17
|
-
helper: h,
|
|
18
|
-
showErrorIcon: j,
|
|
19
|
-
showHelperIcon: B,
|
|
20
|
-
disabled: P = !1,
|
|
21
|
-
disableCountrySelector: L = !1,
|
|
22
|
-
required: I,
|
|
23
|
-
onChange: f,
|
|
24
|
-
"aria-labelledby": T,
|
|
25
|
-
"data-testid": x,
|
|
26
|
-
...z
|
|
27
|
-
}, F) => {
|
|
28
|
-
const [d, b] = S(A), [l, C] = S(""), $ = k(!1), H = D(
|
|
29
|
-
() => G.map((o) => ({
|
|
30
|
-
value: o.code,
|
|
31
|
-
label: `${o.emoji} ${o.callingCode} ${o.name}`
|
|
32
|
-
})),
|
|
33
|
-
[]
|
|
34
|
-
), t = D(
|
|
35
|
-
() => u(d) ?? u("US"),
|
|
36
|
-
[d]
|
|
37
|
-
);
|
|
38
|
-
q(() => {
|
|
39
|
-
if ($.current || !c || !t) return;
|
|
40
|
-
$.current = !0;
|
|
41
|
-
const o = c.startsWith("+") ? c : `+${c}`, e = W(o);
|
|
42
|
-
if (e?.isValid() && e.country) {
|
|
43
|
-
e.country !== d && b(e.country);
|
|
44
|
-
const s = new E(e.country);
|
|
45
|
-
C(s.input(e.nationalNumber));
|
|
46
|
-
}
|
|
47
|
-
}, [c, t, d]);
|
|
48
|
-
const p = y(
|
|
49
|
-
(o, e) => {
|
|
50
|
-
const s = `${e.callingCode}${o.replace(/\D/g, "")}`;
|
|
51
|
-
try {
|
|
52
|
-
const w = W(s, e.code);
|
|
53
|
-
f?.(s, w?.isValid() ?? !1);
|
|
54
|
-
} catch {
|
|
55
|
-
f?.(s, !1);
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
[f]
|
|
59
|
-
), M = y(
|
|
60
|
-
(o) => {
|
|
61
|
-
b(o);
|
|
62
|
-
const e = u(o);
|
|
63
|
-
e && l && p(l, e);
|
|
64
|
-
},
|
|
65
|
-
[l, p]
|
|
66
|
-
), U = y(
|
|
67
|
-
(o) => {
|
|
68
|
-
const e = o.target.value;
|
|
69
|
-
if (!t) {
|
|
70
|
-
C(e);
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
const s = `${t.callingCode}${e}`, R = new E(t.code).input(s).replace(t.callingCode, "").trimStart();
|
|
74
|
-
C(R), p(e, t);
|
|
75
|
-
},
|
|
76
|
-
[t, p]
|
|
77
|
-
), V = `${a}-country`, i = `${a}-phone`, g = `${i}-helper`, v = `${i}-error`, O = [h ? g : null, r ? v : null].filter(Boolean).join(" ");
|
|
78
|
-
return /* @__PURE__ */ n("div", { class: "IncodePhoneInputComposed", children: [
|
|
79
|
-
m && /* @__PURE__ */ n(
|
|
80
|
-
"label",
|
|
81
|
-
{
|
|
82
|
-
class: "IncodePhoneInputComposedLabel",
|
|
83
|
-
htmlFor: i,
|
|
84
|
-
"data-testid": `${a}-label`,
|
|
85
|
-
children: [
|
|
86
|
-
m,
|
|
87
|
-
I && /* @__PURE__ */ n("span", { class: "IncodePhoneInputComposedRequired", children: " *" })
|
|
88
|
-
]
|
|
89
|
-
}
|
|
90
|
-
),
|
|
91
|
-
/* @__PURE__ */ n(
|
|
92
|
-
J,
|
|
93
|
-
{
|
|
94
|
-
id: V,
|
|
95
|
-
options: H,
|
|
96
|
-
value: d,
|
|
97
|
-
onChange: M,
|
|
98
|
-
disabled: P || L,
|
|
99
|
-
required: I,
|
|
100
|
-
searchable: !0,
|
|
101
|
-
searchPlaceholder: "Search countries...",
|
|
102
|
-
suppressMessages: !0,
|
|
103
|
-
"aria-label": "Select country code",
|
|
104
|
-
renderSelectedLabel: (o) => {
|
|
105
|
-
const e = u(o.value);
|
|
106
|
-
return e ? `${e.emoji} ${e.callingCode}` : o.label;
|
|
107
|
-
},
|
|
108
|
-
class: "IncodePhoneInputComposedDropdown",
|
|
109
|
-
siblingElement: /* @__PURE__ */ n(
|
|
110
|
-
X,
|
|
111
|
-
{
|
|
112
|
-
id: i,
|
|
113
|
-
ref: F,
|
|
114
|
-
type: "tel",
|
|
115
|
-
value: l,
|
|
116
|
-
onInput: U,
|
|
117
|
-
placeholder: N,
|
|
118
|
-
error: r,
|
|
119
|
-
disabled: P,
|
|
120
|
-
required: I,
|
|
121
|
-
suppressMessages: !0,
|
|
122
|
-
"aria-label": m ? void 0 : "Phone number",
|
|
123
|
-
"aria-labelledby": T,
|
|
124
|
-
"aria-describedby": O || void 0,
|
|
125
|
-
"aria-invalid": r ? "true" : void 0,
|
|
126
|
-
"data-testid": x,
|
|
127
|
-
...z
|
|
128
|
-
}
|
|
129
|
-
)
|
|
130
|
-
}
|
|
131
|
-
),
|
|
132
|
-
r && /* @__PURE__ */ n(
|
|
133
|
-
"div",
|
|
134
|
-
{
|
|
135
|
-
class: "IncodePhoneInputComposedErrorWrapper",
|
|
136
|
-
"data-testid": `${a}-error-wrapper`,
|
|
137
|
-
children: [
|
|
138
|
-
j && /* @__PURE__ */ n("div", { class: "IncodePhoneInputComposedIconWrapper", children: /* @__PURE__ */ n(K, { size: 16 }) }),
|
|
139
|
-
/* @__PURE__ */ n("p", { id: v, class: "IncodePhoneInputComposedError", children: r })
|
|
140
|
-
]
|
|
141
|
-
}
|
|
142
|
-
),
|
|
143
|
-
h && !r && /* @__PURE__ */ n(
|
|
144
|
-
"div",
|
|
145
|
-
{
|
|
146
|
-
class: "IncodePhoneInputComposedHelperWrapper",
|
|
147
|
-
"data-testid": `${a}-helper-wrapper`,
|
|
148
|
-
children: [
|
|
149
|
-
B && /* @__PURE__ */ n("div", { class: "IncodePhoneInputComposedIconWrapper", children: /* @__PURE__ */ n(Q, { size: 16 }) }),
|
|
150
|
-
/* @__PURE__ */ n("p", { id: g, class: "IncodePhoneInputComposedHelper", children: h })
|
|
151
|
-
]
|
|
152
|
-
}
|
|
153
|
-
)
|
|
154
|
-
] });
|
|
155
|
-
}
|
|
156
|
-
);
|
|
157
|
-
Z.displayName = "PhoneInputComposed";
|
|
158
|
-
export {
|
|
159
|
-
Z as P
|
|
160
|
-
};
|