react-country-kit-core 2.1.3 → 2.1.4
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/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +145 -137
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useCallback as k, useEffect as x, useMemo as C, useRef as w, useState as M } from "react";
|
|
2
|
-
function
|
|
2
|
+
function Pe(a) {
|
|
3
3
|
return [...a.toUpperCase()].map((o) => String.fromCodePoint(127462 + o.charCodeAt(0) - 65)).join("");
|
|
4
4
|
}
|
|
5
|
-
var
|
|
5
|
+
var de = [
|
|
6
6
|
{
|
|
7
7
|
name: "Afghanistan",
|
|
8
8
|
iso2: "AF",
|
|
@@ -4253,7 +4253,7 @@ var ce = [
|
|
|
4253
4253
|
date_separator: "/",
|
|
4254
4254
|
week_start: 0
|
|
4255
4255
|
}
|
|
4256
|
-
],
|
|
4256
|
+
], ue = [
|
|
4257
4257
|
{
|
|
4258
4258
|
name: "Badakhshan",
|
|
4259
4259
|
iso2: "BDS",
|
|
@@ -36538,7 +36538,7 @@ var ce = [
|
|
|
36538
36538
|
english_name: "Zulu",
|
|
36539
36539
|
native_name: "isizulu"
|
|
36540
36540
|
}
|
|
36541
|
-
],
|
|
36541
|
+
], ne = [
|
|
36542
36542
|
{
|
|
36543
36543
|
name: "Asia/Kabul",
|
|
36544
36544
|
offset: 16200,
|
|
@@ -39995,7 +39995,7 @@ var ce = [
|
|
|
39995
39995
|
tzName: "Central Africa Time",
|
|
39996
39996
|
countryCode: "ZW"
|
|
39997
39997
|
}
|
|
39998
|
-
],
|
|
39998
|
+
], Ce = [
|
|
39999
39999
|
{
|
|
40000
40000
|
countryCode: "AF",
|
|
40001
40001
|
iso2: "AF",
|
|
@@ -43891,7 +43891,7 @@ var ce = [
|
|
|
43891
43891
|
countryCode: "ZW",
|
|
43892
43892
|
precision: 2
|
|
43893
43893
|
}
|
|
43894
|
-
],
|
|
43894
|
+
], ie = [
|
|
43895
43895
|
{
|
|
43896
43896
|
countryCode: "AF",
|
|
43897
43897
|
format: "YYYY-MM-DD",
|
|
@@ -45392,46 +45392,46 @@ var ce = [
|
|
|
45392
45392
|
separator: "/",
|
|
45393
45393
|
weekStart: 0
|
|
45394
45394
|
}
|
|
45395
|
-
], P =
|
|
45396
|
-
function
|
|
45395
|
+
], P = de;
|
|
45396
|
+
function te() {
|
|
45397
45397
|
return P;
|
|
45398
45398
|
}
|
|
45399
45399
|
function Y(a) {
|
|
45400
45400
|
return P.find((o) => o.iso2.toLowerCase() === a.toLowerCase());
|
|
45401
45401
|
}
|
|
45402
|
-
function
|
|
45402
|
+
function Ye(a) {
|
|
45403
45403
|
return P.find((o) => o.iso3.toLowerCase() === a.toLowerCase());
|
|
45404
45404
|
}
|
|
45405
|
-
function
|
|
45405
|
+
function Be(a) {
|
|
45406
45406
|
return P.find((o) => o.name.toLowerCase().includes(a.toLowerCase()));
|
|
45407
45407
|
}
|
|
45408
|
-
var
|
|
45409
|
-
function
|
|
45408
|
+
var J = /* @__PURE__ */ new Map(), Q = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map();
|
|
45409
|
+
function le(a) {
|
|
45410
45410
|
if (!a.trim()) return P;
|
|
45411
|
-
const o = a.toLowerCase().trim(), e =
|
|
45411
|
+
const o = a.toLowerCase().trim(), e = J.get(o);
|
|
45412
45412
|
if (e) return e;
|
|
45413
45413
|
const i = P.filter((n) => n.name.toLowerCase().includes(o) || n.iso2.toLowerCase().includes(o) || n.iso3.toLowerCase().includes(o) || n.phone_code.includes(o));
|
|
45414
|
-
return W.set(o, i), i;
|
|
45415
|
-
}
|
|
45416
|
-
function le(a) {
|
|
45417
|
-
const o = a.toLowerCase(), e = J.get(o);
|
|
45418
|
-
if (e) return e;
|
|
45419
|
-
const i = de.filter((n) => n.countryCode.toLowerCase() === o);
|
|
45420
45414
|
return J.set(o, i), i;
|
|
45421
45415
|
}
|
|
45422
|
-
function
|
|
45416
|
+
function ye(a) {
|
|
45423
45417
|
const o = a.toLowerCase(), e = Q.get(o);
|
|
45424
45418
|
if (e) return e;
|
|
45425
|
-
const i =
|
|
45419
|
+
const i = ue.filter((n) => n.countryCode.toLowerCase() === o);
|
|
45426
45420
|
return Q.set(o, i), i;
|
|
45427
45421
|
}
|
|
45428
|
-
function
|
|
45422
|
+
function re(a) {
|
|
45423
|
+
const o = a.toLowerCase(), e = X.get(o);
|
|
45424
|
+
if (e) return e;
|
|
45425
|
+
const i = ne.filter((n) => n.countryCode.toLowerCase() === o);
|
|
45426
|
+
return X.set(o, i), i;
|
|
45427
|
+
}
|
|
45428
|
+
function pe(a) {
|
|
45429
45429
|
return H.find((o) => o.countryCode.toLowerCase() === a.toLowerCase());
|
|
45430
45430
|
}
|
|
45431
45431
|
function j(a) {
|
|
45432
|
-
return
|
|
45432
|
+
return Ce.find((o) => o.iso2.toLowerCase() === a.toLowerCase());
|
|
45433
45433
|
}
|
|
45434
|
-
function
|
|
45434
|
+
function me(a) {
|
|
45435
45435
|
const o = j(a);
|
|
45436
45436
|
if (!o || !o.possibleLengths) return {
|
|
45437
45437
|
min: void 0,
|
|
@@ -45458,13 +45458,13 @@ function re(a) {
|
|
|
45458
45458
|
max: n
|
|
45459
45459
|
};
|
|
45460
45460
|
}
|
|
45461
|
-
function
|
|
45461
|
+
function ze(a) {
|
|
45462
45462
|
return Y(a)?.tax_id_label || "Tax ID";
|
|
45463
45463
|
}
|
|
45464
|
-
function
|
|
45464
|
+
function Ae(a) {
|
|
45465
45465
|
return Y(a)?.tax_id_placeholder || "Enter tax ID";
|
|
45466
45466
|
}
|
|
45467
|
-
function
|
|
45467
|
+
function fe(a) {
|
|
45468
45468
|
return Y(a)?.postal_code_label || "Postal Code";
|
|
45469
45469
|
}
|
|
45470
45470
|
function N(a, o, e, i) {
|
|
@@ -45508,36 +45508,36 @@ function N(a, o, e, i) {
|
|
|
45508
45508
|
b
|
|
45509
45509
|
]);
|
|
45510
45510
|
}
|
|
45511
|
-
function
|
|
45512
|
-
const e = k((i, n) =>
|
|
45513
|
-
return N(
|
|
45511
|
+
function ke(a, o) {
|
|
45512
|
+
const e = k((i, n) => le(n), []);
|
|
45513
|
+
return N(te(), e, a, o);
|
|
45514
45514
|
}
|
|
45515
|
-
function
|
|
45516
|
-
return
|
|
45515
|
+
function Ne() {
|
|
45516
|
+
return ie;
|
|
45517
45517
|
}
|
|
45518
|
-
var
|
|
45518
|
+
var q = {
|
|
45519
45519
|
countryCode: "DEFAULT",
|
|
45520
45520
|
format: "DD/MM/YYYY",
|
|
45521
45521
|
separator: "/",
|
|
45522
45522
|
weekStart: 1
|
|
45523
45523
|
};
|
|
45524
45524
|
function U(a) {
|
|
45525
|
-
if (!a) return
|
|
45525
|
+
if (!a) return q;
|
|
45526
45526
|
const o = a.toUpperCase();
|
|
45527
|
-
return
|
|
45528
|
-
...
|
|
45527
|
+
return ie.find((e) => e.countryCode === o) ?? {
|
|
45528
|
+
...q,
|
|
45529
45529
|
countryCode: o
|
|
45530
45530
|
};
|
|
45531
45531
|
}
|
|
45532
|
-
function
|
|
45532
|
+
function se(a, o) {
|
|
45533
45533
|
if (!a || isNaN(a.getTime()) || !o) return "";
|
|
45534
45534
|
const e = String(a.getFullYear()), i = String(a.getMonth() + 1).padStart(2, "0"), n = String(a.getDate()).padStart(2, "0");
|
|
45535
45535
|
return o.replace(/YYYY/g, e).replace(/MM/g, i).replace(/DD/g, n);
|
|
45536
45536
|
}
|
|
45537
|
-
function
|
|
45538
|
-
return
|
|
45537
|
+
function Le(a, o) {
|
|
45538
|
+
return se(a, U(o).format);
|
|
45539
45539
|
}
|
|
45540
|
-
function
|
|
45540
|
+
function ce(a, o) {
|
|
45541
45541
|
if (!a || !o || a.length !== o.length) return null;
|
|
45542
45542
|
const e = o.indexOf("YYYY"), i = o.indexOf("MM"), n = o.indexOf("DD");
|
|
45543
45543
|
if (e === -1 || i === -1 || n === -1) return null;
|
|
@@ -45546,10 +45546,10 @@ function se(a, o) {
|
|
|
45546
45546
|
const c = new Date(t, r, m);
|
|
45547
45547
|
return c.getFullYear() !== t || c.getMonth() !== r || c.getDate() !== m ? null : c;
|
|
45548
45548
|
}
|
|
45549
|
-
function
|
|
45550
|
-
return
|
|
45549
|
+
function Re(a, o) {
|
|
45550
|
+
return ce(a, U(o).format);
|
|
45551
45551
|
}
|
|
45552
|
-
var
|
|
45552
|
+
var $ = /* @__PURE__ */ new Map(), _e = {
|
|
45553
45553
|
country: null,
|
|
45554
45554
|
divisions: [],
|
|
45555
45555
|
timezones: [],
|
|
@@ -45570,13 +45570,13 @@ var q = /* @__PURE__ */ new Map(), fe = {
|
|
|
45570
45570
|
function O(a) {
|
|
45571
45571
|
const o = C(() => a ? a === a.toUpperCase() ? a : a.toUpperCase() : null, [a]);
|
|
45572
45572
|
return C(() => {
|
|
45573
|
-
if (!o) return
|
|
45574
|
-
let e =
|
|
45573
|
+
if (!o) return _e;
|
|
45574
|
+
let e = $.get(o.length);
|
|
45575
45575
|
if (e) {
|
|
45576
45576
|
const f = e.get(o);
|
|
45577
45577
|
if (f) return f;
|
|
45578
45578
|
}
|
|
45579
|
-
const i = Y(o) ?? null, n =
|
|
45579
|
+
const i = Y(o) ?? null, n = ye(o), t = re(o), r = pe(o) ?? null, m = j(o) ?? null, c = me(o), z = m?.example !== void 0 ? String(m.example) : void 0, l = ze(o), y = Ae(o), p = fe(o), A = U(o), _ = {
|
|
45580
45580
|
country: i,
|
|
45581
45581
|
divisions: n,
|
|
45582
45582
|
timezones: t,
|
|
@@ -45591,33 +45591,33 @@ function O(a) {
|
|
|
45591
45591
|
postalCode: { label: p },
|
|
45592
45592
|
dateFormat: A
|
|
45593
45593
|
};
|
|
45594
|
-
return e || (e = /* @__PURE__ */ new Map(),
|
|
45594
|
+
return e || (e = /* @__PURE__ */ new Map(), $.set(o.length, e)), e.set(o, _), _;
|
|
45595
45595
|
}, [o]);
|
|
45596
45596
|
}
|
|
45597
|
-
var G = null,
|
|
45597
|
+
var G = null, ee = /* @__PURE__ */ new Map();
|
|
45598
45598
|
function F() {
|
|
45599
45599
|
if (G) return G;
|
|
45600
45600
|
const a = /* @__PURE__ */ new Set(), o = [];
|
|
45601
45601
|
for (const e of H) a.has(e.code) || (a.add(e.code), o.push(e));
|
|
45602
45602
|
return G = o.sort((e, i) => e.code.localeCompare(i.code)), G;
|
|
45603
45603
|
}
|
|
45604
|
-
function
|
|
45604
|
+
function Ie(a) {
|
|
45605
45605
|
const o = a.toLowerCase();
|
|
45606
45606
|
return F().find((e) => e.code.toLowerCase() === o);
|
|
45607
45607
|
}
|
|
45608
|
-
function
|
|
45608
|
+
function ge(a, o) {
|
|
45609
45609
|
let e = F();
|
|
45610
45610
|
if (o && (e = H.filter((m) => m.countryCode.toLowerCase() === o.toLowerCase())), !a.trim()) return e;
|
|
45611
|
-
const i = a.toLowerCase().trim(), n = `${o || ""}:${i}`, t =
|
|
45611
|
+
const i = a.toLowerCase().trim(), n = `${o || ""}:${i}`, t = ee.get(n);
|
|
45612
45612
|
if (t) return t;
|
|
45613
45613
|
const r = e.filter((m) => m.code.toLowerCase().includes(i) || m.name.toLowerCase().includes(i) || m.symbol.toLowerCase().includes(i));
|
|
45614
|
-
return
|
|
45614
|
+
return ee.set(n, r), r;
|
|
45615
45615
|
}
|
|
45616
|
-
function
|
|
45617
|
-
const e = k((i, n) =>
|
|
45616
|
+
function Ge(a, o) {
|
|
45617
|
+
const e = k((i, n) => ge(n), []);
|
|
45618
45618
|
return N(F(), e, a, o);
|
|
45619
45619
|
}
|
|
45620
|
-
function
|
|
45620
|
+
function ve(a, o, e) {
|
|
45621
45621
|
const i = O(a).divisions;
|
|
45622
45622
|
return N(i, k((n, t) => {
|
|
45623
45623
|
if (!t.trim()) return n;
|
|
@@ -45625,33 +45625,33 @@ function Ge(a, o, e) {
|
|
|
45625
45625
|
return n.filter((m) => m.name.toLowerCase().includes(r) || m.iso2.toLowerCase().includes(r));
|
|
45626
45626
|
}, []), o, e);
|
|
45627
45627
|
}
|
|
45628
|
-
var
|
|
45629
|
-
function
|
|
45628
|
+
var oe = /* @__PURE__ */ new Map();
|
|
45629
|
+
function Ee() {
|
|
45630
45630
|
return K;
|
|
45631
45631
|
}
|
|
45632
|
-
function
|
|
45632
|
+
function Ke(a) {
|
|
45633
45633
|
const o = a.toLowerCase();
|
|
45634
45634
|
return K.find((e) => e.code.toLowerCase() === o);
|
|
45635
45635
|
}
|
|
45636
|
-
function
|
|
45636
|
+
function Me(a) {
|
|
45637
45637
|
if (!a.trim()) return K;
|
|
45638
|
-
const o = a.toLowerCase().trim(), e =
|
|
45638
|
+
const o = a.toLowerCase().trim(), e = oe.get(o);
|
|
45639
45639
|
if (e) return e;
|
|
45640
45640
|
const i = K.filter((n) => n.english_name.toLowerCase().includes(o) || n.native_name.toLowerCase().includes(o) || n.code.toLowerCase().includes(o));
|
|
45641
|
-
return
|
|
45641
|
+
return oe.set(o, i), i;
|
|
45642
45642
|
}
|
|
45643
|
-
function
|
|
45644
|
-
const e = k((i, n) =>
|
|
45645
|
-
return N(
|
|
45643
|
+
function Ue(a, o) {
|
|
45644
|
+
const e = k((i, n) => Me(n), []);
|
|
45645
|
+
return N(Ee(), e, a, o);
|
|
45646
45646
|
}
|
|
45647
45647
|
var v = null;
|
|
45648
45648
|
function V() {
|
|
45649
45649
|
if (v) return v;
|
|
45650
45650
|
const a = /* @__PURE__ */ new Set(), o = [];
|
|
45651
|
-
for (const e of
|
|
45651
|
+
for (const e of ne) a.has(e.name) || (a.add(e.name), o.push(e));
|
|
45652
45652
|
return v = o.sort((e, i) => e.offset - i.offset), v;
|
|
45653
45653
|
}
|
|
45654
|
-
var
|
|
45654
|
+
var he = {
|
|
45655
45655
|
"US/Eastern": "America/New_York",
|
|
45656
45656
|
"US/Central": "America/Chicago",
|
|
45657
45657
|
"US/Mountain": "America/Denver",
|
|
@@ -45697,33 +45697,33 @@ var Me = {
|
|
|
45697
45697
|
"Europe/Belfast": "Europe/London",
|
|
45698
45698
|
"Europe/Tiraspol": "Europe/Chisinau"
|
|
45699
45699
|
};
|
|
45700
|
-
function
|
|
45700
|
+
function xe(a) {
|
|
45701
45701
|
if (!a) return;
|
|
45702
45702
|
const o = a.toLowerCase(), e = V(), i = e.find((t) => t.name.toLowerCase() === o);
|
|
45703
45703
|
if (i) return i;
|
|
45704
|
-
const n = Object.entries(
|
|
45704
|
+
const n = Object.entries(he).find(([t]) => t.toLowerCase() === o)?.[1];
|
|
45705
45705
|
if (n) return e.find((t) => t.name.toLowerCase() === n.toLowerCase());
|
|
45706
45706
|
}
|
|
45707
|
-
var
|
|
45708
|
-
function
|
|
45709
|
-
const e = o ?
|
|
45707
|
+
var ae = /* @__PURE__ */ new Map();
|
|
45708
|
+
function Se(a, o) {
|
|
45709
|
+
const e = o ? re(o) : V();
|
|
45710
45710
|
if (!a.trim()) return e;
|
|
45711
|
-
const i = a.toLowerCase().trim(), n = `${o || ""}:${i}`, t =
|
|
45711
|
+
const i = a.toLowerCase().trim(), n = `${o || ""}:${i}`, t = ae.get(n);
|
|
45712
45712
|
if (t) return t;
|
|
45713
45713
|
const r = e.filter((m) => m.name.toLowerCase().includes(i) || m.tzName.toLowerCase().includes(i) || m.abbreviation.toLowerCase().includes(i) || m.offset_name.toLowerCase().includes(i));
|
|
45714
|
-
return
|
|
45714
|
+
return ae.set(n, r), r;
|
|
45715
45715
|
}
|
|
45716
|
-
function
|
|
45716
|
+
function we(a, o, e) {
|
|
45717
45717
|
const i = O(e);
|
|
45718
|
-
return N(C(() => e ? i.timezones : V(), [e, i.timezones]), k((n, t) =>
|
|
45718
|
+
return N(C(() => e ? i.timezones : V(), [e, i.timezones]), k((n, t) => Se(t, e), [e]), a, o);
|
|
45719
45719
|
}
|
|
45720
45720
|
function B(a) {
|
|
45721
45721
|
const o = Y(a);
|
|
45722
45722
|
if (!o) return {};
|
|
45723
|
-
const e =
|
|
45723
|
+
const e = me(a), i = j(a);
|
|
45724
45724
|
let n = i?.example ? String(i.example) : void 0;
|
|
45725
45725
|
n?.startsWith("+") && (n = n.slice(1 + o.phone_code.length));
|
|
45726
|
-
const t = n ?
|
|
45726
|
+
const t = n ? Te(n, a) : void 0;
|
|
45727
45727
|
return {
|
|
45728
45728
|
minLength: e.min,
|
|
45729
45729
|
maxLength: e.max,
|
|
@@ -45733,7 +45733,7 @@ function B(a) {
|
|
|
45733
45733
|
nationalPrefix: i?.nationalPrefix
|
|
45734
45734
|
};
|
|
45735
45735
|
}
|
|
45736
|
-
function
|
|
45736
|
+
function Te(a, o) {
|
|
45737
45737
|
const e = a.replace(/\D/g, "");
|
|
45738
45738
|
if (o.toUpperCase() === "US" || o.toUpperCase() === "CA") {
|
|
45739
45739
|
if (e.length >= 10) return `(${e.slice(0, 3)}) ${e.slice(3, 6)}-${e.slice(6, 10)}`;
|
|
@@ -45751,7 +45751,7 @@ function Se(a, o) {
|
|
|
45751
45751
|
i[4]
|
|
45752
45752
|
].filter(Boolean).join(" ") : e;
|
|
45753
45753
|
}
|
|
45754
|
-
function
|
|
45754
|
+
function be(a, o, e) {
|
|
45755
45755
|
const i = [];
|
|
45756
45756
|
let n = o.replace(/\D/g, "");
|
|
45757
45757
|
const t = B(e);
|
|
@@ -45764,7 +45764,7 @@ function Te(a, o, e) {
|
|
|
45764
45764
|
errors: i
|
|
45765
45765
|
};
|
|
45766
45766
|
}
|
|
45767
|
-
function
|
|
45767
|
+
function He(a, o) {
|
|
45768
45768
|
const e = a.replace(/\D/g, "");
|
|
45769
45769
|
if (o.toUpperCase() === "US" || o.toUpperCase() === "CA") {
|
|
45770
45770
|
if (e.length >= 10) return `(${e.slice(0, 3)}) ${e.slice(3, 6)}-${e.slice(6, 10)}`;
|
|
@@ -45774,25 +45774,29 @@ function we(a, o) {
|
|
|
45774
45774
|
return `${e.slice(0, 3)} ${e.slice(3)}`;
|
|
45775
45775
|
return a;
|
|
45776
45776
|
}
|
|
45777
|
-
function
|
|
45777
|
+
function je(a, o, e) {
|
|
45778
45778
|
const i = a?.country ?? (e ? Y(e) ?? null : null), [n, t] = M(i), [r, m] = M(a?.number ?? ""), [c, z] = M(!1), [l, y] = M("");
|
|
45779
45779
|
x(() => {
|
|
45780
45780
|
a ? (t(a.country), m(a.number)) : (t(i), m(""));
|
|
45781
45781
|
}, [a, i]);
|
|
45782
45782
|
const p = w(o);
|
|
45783
45783
|
p.current = o;
|
|
45784
|
-
const A =
|
|
45784
|
+
const A = te(), _ = C(() => {
|
|
45785
45785
|
if (!l.trim()) return A;
|
|
45786
45786
|
const s = l.toLowerCase().trim().replace("+", "");
|
|
45787
45787
|
return A.filter((d) => d.name.toLowerCase().includes(s) || d.phone_code.includes(s) || d.iso2.toLowerCase().includes(s));
|
|
45788
45788
|
}, [A, l]), f = (s, d) => {
|
|
45789
45789
|
const u = B(s.iso2);
|
|
45790
45790
|
let T = d, Z = u;
|
|
45791
|
-
|
|
45792
|
-
|
|
45793
|
-
|
|
45794
|
-
|
|
45795
|
-
|
|
45791
|
+
if (u.nationalPrefix) {
|
|
45792
|
+
const W = d.startsWith(u.nationalPrefix);
|
|
45793
|
+
W && (T = d.slice(u.nationalPrefix.length)), Z = {
|
|
45794
|
+
...u,
|
|
45795
|
+
minLength: W ? u.minLength ? u.minLength + u.nationalPrefix.length : void 0 : u.minLength,
|
|
45796
|
+
maxLength: u.maxLength ? u.maxLength + u.nationalPrefix.length : u.maxLength
|
|
45797
|
+
};
|
|
45798
|
+
}
|
|
45799
|
+
return {
|
|
45796
45800
|
country: s,
|
|
45797
45801
|
dialCode: `+${s.phone_code}`,
|
|
45798
45802
|
number: d,
|
|
@@ -45806,7 +45810,7 @@ function He(a, o, e) {
|
|
|
45806
45810
|
const u = B(n?.iso2 ?? "");
|
|
45807
45811
|
let T = h.phoneLengths.max;
|
|
45808
45812
|
T && u.nationalPrefix && d.startsWith(u.nationalPrefix) && (T += u.nationalPrefix.length), T && d.length > T && (d = d.slice(0, T)), m(d), n && p.current?.(f(n, d));
|
|
45809
|
-
}, R = () => n ? r ?
|
|
45813
|
+
}, R = () => n ? r ? be(`+${n.phone_code}`, r, n.iso2) : {
|
|
45810
45814
|
isValid: !1,
|
|
45811
45815
|
errors: ["Phone number is required"]
|
|
45812
45816
|
} : {
|
|
@@ -45817,11 +45821,15 @@ function He(a, o, e) {
|
|
|
45817
45821
|
}, D = C(() => n ? f(n, r) : null, [n, r]), S = C(() => {
|
|
45818
45822
|
if (!n) return null;
|
|
45819
45823
|
const s = B(n.iso2);
|
|
45820
|
-
|
|
45821
|
-
|
|
45822
|
-
|
|
45823
|
-
|
|
45824
|
-
|
|
45824
|
+
if (s.nationalPrefix) {
|
|
45825
|
+
const d = r.startsWith(s.nationalPrefix);
|
|
45826
|
+
return {
|
|
45827
|
+
...s,
|
|
45828
|
+
minLength: d ? s.minLength ? s.minLength + s.nationalPrefix.length : void 0 : s.minLength,
|
|
45829
|
+
maxLength: s.maxLength ? s.maxLength + s.nationalPrefix.length : s.maxLength
|
|
45830
|
+
};
|
|
45831
|
+
}
|
|
45832
|
+
return s;
|
|
45825
45833
|
}, [n, r]);
|
|
45826
45834
|
return C(() => ({
|
|
45827
45835
|
country: n,
|
|
@@ -45848,7 +45856,7 @@ function He(a, o, e) {
|
|
|
45848
45856
|
_
|
|
45849
45857
|
]);
|
|
45850
45858
|
}
|
|
45851
|
-
function
|
|
45859
|
+
function Oe(a, o, e, i, n, t) {
|
|
45852
45860
|
const [r, m] = M(!1), [c, z] = M(""), [l, y] = M(i ?? []);
|
|
45853
45861
|
x(() => {
|
|
45854
45862
|
y(i ?? []);
|
|
@@ -45907,66 +45915,66 @@ function je(a, o, e, i, n, t) {
|
|
|
45907
45915
|
I
|
|
45908
45916
|
]);
|
|
45909
45917
|
}
|
|
45910
|
-
function
|
|
45918
|
+
function Fe(a) {
|
|
45911
45919
|
const o = C(() => a ? a === a.toUpperCase() ? a : a.toUpperCase() : null, [a]), e = C(() => o ? U(o) : null, [o]);
|
|
45912
45920
|
return {
|
|
45913
45921
|
dateFormat: e,
|
|
45914
|
-
formatDate: C(() => (i) => e ?
|
|
45915
|
-
parseDate: C(() => (i) => e ?
|
|
45922
|
+
formatDate: C(() => (i) => e ? se(i, e.format) : "", [e]),
|
|
45923
|
+
parseDate: C(() => (i) => e ? ce(i, e.format) : null, [e]),
|
|
45916
45924
|
placeholder: e?.format ?? "",
|
|
45917
45925
|
weekStart: e?.weekStart ?? 1
|
|
45918
45926
|
};
|
|
45919
45927
|
}
|
|
45920
45928
|
export {
|
|
45921
|
-
|
|
45929
|
+
de as COUNTRIES,
|
|
45922
45930
|
H as CURRENCIES,
|
|
45923
|
-
|
|
45924
|
-
|
|
45925
|
-
|
|
45926
|
-
|
|
45927
|
-
|
|
45928
|
-
|
|
45929
|
-
|
|
45930
|
-
|
|
45931
|
-
|
|
45931
|
+
ie as DATE_FORMATS,
|
|
45932
|
+
ue as DIVISIONS,
|
|
45933
|
+
Ce as PHONE_FORMATS,
|
|
45934
|
+
ne as TIMEZONES,
|
|
45935
|
+
Le as formatDateByCountry,
|
|
45936
|
+
se as formatDateWithPattern,
|
|
45937
|
+
Te as formatPhoneExample,
|
|
45938
|
+
He as formatPhoneNumber,
|
|
45939
|
+
te as getAllCountries,
|
|
45932
45940
|
F as getAllCurrencies,
|
|
45933
|
-
|
|
45934
|
-
|
|
45941
|
+
Ne as getAllDateFormats,
|
|
45942
|
+
Ee as getAllLanguages,
|
|
45935
45943
|
V as getAllTimezones,
|
|
45936
45944
|
Y as getCountryByIso2,
|
|
45937
|
-
|
|
45938
|
-
|
|
45939
|
-
|
|
45940
|
-
|
|
45945
|
+
Ye as getCountryByIso3,
|
|
45946
|
+
Be as getCountryByName,
|
|
45947
|
+
Ie as getCurrencyByCode,
|
|
45948
|
+
pe as getCurrencyByCountry,
|
|
45941
45949
|
U as getDateFormatByCountry,
|
|
45942
|
-
|
|
45943
|
-
|
|
45950
|
+
ye as getDivisionsByCountry,
|
|
45951
|
+
Ke as getLanguageByCode,
|
|
45944
45952
|
j as getPhoneFormatByCountry,
|
|
45945
|
-
|
|
45953
|
+
me as getPhoneLengths,
|
|
45946
45954
|
B as getPhoneValidation,
|
|
45947
|
-
|
|
45948
|
-
|
|
45949
|
-
|
|
45950
|
-
|
|
45951
|
-
|
|
45952
|
-
|
|
45953
|
-
|
|
45954
|
-
|
|
45955
|
-
|
|
45956
|
-
|
|
45957
|
-
|
|
45958
|
-
|
|
45955
|
+
fe as getPostalLabelByCountry,
|
|
45956
|
+
ze as getTaxLabelByCountry,
|
|
45957
|
+
Ae as getTaxPlaceholderByCountry,
|
|
45958
|
+
xe as getTimezoneByName,
|
|
45959
|
+
re as getTimezonesByCountry,
|
|
45960
|
+
Pe as iso2ToFlag,
|
|
45961
|
+
Re as parseDateByCountry,
|
|
45962
|
+
ce as parseDateWithPattern,
|
|
45963
|
+
le as searchCountries,
|
|
45964
|
+
ge as searchCurrencies,
|
|
45965
|
+
Me as searchLanguages,
|
|
45966
|
+
Se as searchTimezones,
|
|
45959
45967
|
N as useBasePicker,
|
|
45960
45968
|
O as useCountry,
|
|
45961
|
-
|
|
45962
|
-
|
|
45963
|
-
|
|
45964
|
-
|
|
45965
|
-
|
|
45966
|
-
|
|
45967
|
-
|
|
45968
|
-
|
|
45969
|
-
|
|
45969
|
+
ke as useCountryPicker,
|
|
45970
|
+
Ge as useCurrencyPicker,
|
|
45971
|
+
Fe as useDateFormat,
|
|
45972
|
+
ve as useDivisionPicker,
|
|
45973
|
+
Ue as useLanguagePicker,
|
|
45974
|
+
Oe as useMultiSelect,
|
|
45975
|
+
je as usePhoneInput,
|
|
45976
|
+
we as useTimezonePicker,
|
|
45977
|
+
be as validatePhoneNumber
|
|
45970
45978
|
};
|
|
45971
45979
|
|
|
45972
45980
|
//# sourceMappingURL=index.mjs.map
|