my-phone-input-global 1.0.0
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/LICENSE +21 -0
- package/README.md +100 -0
- package/dist/my-phone.css +1 -0
- package/dist/my-phone.js +6 -0
- package/dist/my-phone.mjs +697 -0
- package/dist/my-phone.umd.js +6 -0
- package/package.json +36 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alejandro-ux359
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# my-phone-input-global
|
|
2
|
+
|
|
3
|
+
Un componente React reutilizable para ingresar **teléfonos con selección de país**, mostrando **bandera**, **prefijo** y con **soporte completo de estilos personalizables**.
|
|
4
|
+
|
|
5
|
+
Ideal para empaquetar y usar en cualquier proyecto React.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 📦 Instalación
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install my-phone-input-global
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
yarn add my-phone-input-global
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
import React, { useState } from "react";
|
|
21
|
+
import { MyPhone } from "my-phone-input-global";
|
|
22
|
+
|
|
23
|
+
export default function App() {
|
|
24
|
+
const [phone, setPhone] = useState("");
|
|
25
|
+
return <MyPhone value={phone} onChange={setPhone} />;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
| Prop | Tipo | Descripción |
|
|
31
|
+
| ------------------ | ------------------------- | ------------------------------------------------------- |
|
|
32
|
+
| `value` | `string` | Valor del teléfono (controlado) |
|
|
33
|
+
| `onChange` | `(value: string) => void` | Función que se ejecuta al cambiar el teléfono |
|
|
34
|
+
| `selectedCountry` | `string` | Código ISO2 del país seleccionado |
|
|
35
|
+
| `onCountryChange` | `(iso2: string) => void` | Función que se ejecuta al cambiar el país |
|
|
36
|
+
| `placeholder` | `string` | Placeholder del input (default: `"Número de teléfono"`) |
|
|
37
|
+
| `disabled` | `boolean` | Deshabilita el input y el selector |
|
|
38
|
+
| `className` | `string` | Clase para el contenedor principal |
|
|
39
|
+
| `inputClassName` | `string` | Clase para el input de teléfono |
|
|
40
|
+
| `countryClassName` | `string` | Clase para el selector de país |
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# clases-personalizadas
|
|
44
|
+
|
|
45
|
+
<MyPhone
|
|
46
|
+
className="mi-componente"
|
|
47
|
+
inputClassName="mi-input"
|
|
48
|
+
countryClassName="mi-pais"
|
|
49
|
+
/>
|
|
50
|
+
|
|
51
|
+
.mi-componente { font-size: 16px; }
|
|
52
|
+
.mi-input { border-color: green; padding: 12px; }
|
|
53
|
+
.mi-pais { background: #f0f0f0; }
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
# CSS Variables (opcional)
|
|
58
|
+
.my-phone {
|
|
59
|
+
--border-color: #ccc;
|
|
60
|
+
--background: white;
|
|
61
|
+
--font-size: 14px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.my-phone__selected {
|
|
65
|
+
border-color: var(--border-color);
|
|
66
|
+
background: var(--background);
|
|
67
|
+
font-size: var(--font-size);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
# Y en tu proyecto consumidor:
|
|
72
|
+
|
|
73
|
+
.mi-tema .my-phone {
|
|
74
|
+
--border-color: #4ade80;
|
|
75
|
+
--background: #000;
|
|
76
|
+
--font-size: 16px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
# Ejemplo completo con control de estado
|
|
80
|
+
|
|
81
|
+
import React, { useState } from "react";
|
|
82
|
+
import { MyPhone } from "my-phone-input";
|
|
83
|
+
|
|
84
|
+
export default function Example() {
|
|
85
|
+
const [phone, setPhone] = useState("");
|
|
86
|
+
const [country, setCountry] = useState("us");
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<MyPhone
|
|
90
|
+
value={phone}
|
|
91
|
+
onChange={setPhone}
|
|
92
|
+
selectedCountry={country}
|
|
93
|
+
onCountryChange={setCountry}
|
|
94
|
+
placeholder="Tu teléfono"
|
|
95
|
+
className="mi-componente"
|
|
96
|
+
inputClassName="mi-input"
|
|
97
|
+
countryClassName="mi-pais"
|
|
98
|
+
/>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.my-phone{display:flex;align-items:center;font-family:inherit}.my-phone__country{position:relative}.my-phone__selected{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:0 10px;width:110px;height:42px;border:1px solid #ccc;border-right:none;border-radius:8px 0 0 8px;background:#fff;cursor:pointer;font-size:14px;box-sizing:border-box}.flag{font-size:30px;line-height:1;display:flex;align-items:center;justify-content:center}.code{flex:1;text-align:center}.arrow{font-size:10px;opacity:.6}.my-phone__select{position:absolute;inset:0;opacity:0;cursor:pointer}.my-phone input{width:200px;height:42px;padding:0 10px;border:1px solid #ccc;border-radius:0 8px 8px 0;font-size:14px;outline:none;box-sizing:border-box}.my-phone:focus-within .my-phone__selected,.my-phone:focus-within input{border-color:#000}
|
package/dist/my-phone.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";const w=require("react");var P={exports:{}},T={};var $;function te(){if($)return T;$=1;var i=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function m(c,n,r){var d=null;if(r!==void 0&&(d=""+r),n.key!==void 0&&(d=""+n.key),"key"in n){r={};for(var p in n)p!=="key"&&(r[p]=n[p])}else r=n;return n=r.ref,{$$typeof:i,type:c,key:d,ref:n!==void 0?n:null,props:r}}return T.Fragment=u,T.jsx=m,T.jsxs=m,T}var C={};var J;function oe(){return J||(J=1,process.env.NODE_ENV!=="production"&&(function(){function i(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case R:return"Fragment";case x:return"Profiler";case j:return"StrictMode";case X:return"Suspense";case Z:return"SuspenseList";case ee:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case S:return"Portal";case b:return e.displayName||"Context";case o:return(e._context.displayName||"Context")+".Consumer";case M:var a=e.render;return e=e.displayName,e||(e=a.displayName||a.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Q:return a=e.displayName||null,a!==null?a:i(e.type)||"Memo";case I:a=e._payload,e=e._init;try{return i(e(a))}catch{}}return null}function u(e){return""+e}function m(e){try{u(e);var a=!1}catch{a=!0}if(a){a=console;var t=a.error,s=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(a,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",s),u(e)}}function c(e){if(e===R)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===I)return"<...>";try{var a=i(e);return a?"<"+a+">":"<...>"}catch{return"<...>"}}function n(){var e=O.A;return e===null?null:e.getOwner()}function r(){return Error("react-stack-top-frame")}function d(e){if(F.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function p(e,a){function t(){q||(q=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",a))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function _(){var e=i(this.type);return D[e]||(D[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function f(e,a,t,s,N,B){var l=t.ref;return e={$$typeof:A,type:e,key:a,props:t,_owner:s},(l!==void 0?l:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:_}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:N}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:B}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function h(e,a,t,s,N,B){var l=a.children;if(l!==void 0)if(s)if(re(l)){for(s=0;s<l.length;s++)v(l[s]);Object.freeze&&Object.freeze(l)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else v(l);if(F.call(a,"key")){l=i(e);var k=Object.keys(a).filter(function(ne){return ne!=="key"});s=0<k.length?"{key: someKey, "+k.join(": ..., ")+": ...}":"{key: someKey}",U[l+s]||(k=0<k.length?"{"+k.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
|
+
let props = %s;
|
|
3
|
+
<%s {...props} />
|
|
4
|
+
React keys must be passed directly to JSX without using spread:
|
|
5
|
+
let props = %s;
|
|
6
|
+
<%s key={someKey} {...props} />`,s,l,k,l),U[l+s]=!0)}if(l=null,t!==void 0&&(m(t),l=""+t),d(a)&&(m(a.key),l=""+a.key),"key"in a){t={};for(var G in a)G!=="key"&&(t[G]=a[G])}else t=a;return l&&p(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),f(e,l,t,n(),N,B)}function v(e){E(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===I&&(e._payload.status==="fulfilled"?E(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function E(e){return typeof e=="object"&&e!==null&&e.$$typeof===A}var y=w,A=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),b=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),ae=Symbol.for("react.client.reference"),O=y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,re=Array.isArray,z=console.createTask?console.createTask:function(){return null};y={react_stack_bottom_frame:function(e){return e()}};var q,D={},V=y.react_stack_bottom_frame.bind(y,r)(),Y=z(c(r)),U={};C.Fragment=R,C.jsx=function(e,a,t){var s=1e4>O.recentlyCreatedOwnerStacks++;return h(e,a,t,!1,s?Error("react-stack-top-frame"):V,s?z(c(e)):Y)},C.jsxs=function(e,a,t){var s=1e4>O.recentlyCreatedOwnerStacks++;return h(e,a,t,!0,s?Error("react-stack-top-frame"):V,s?z(c(e)):Y)}})()),C}var K;function ie(){return K||(K=1,process.env.NODE_ENV==="production"?P.exports=te():P.exports=oe()),P.exports}var g=ie(),L,W;function se(){if(W)return L;W=1;for(var i=[["Afghanistan (افغانستان)","af","93","+..-..-...-...."],["Åland Islands","ax","358",""],["Albania (Shqipëri)","al","355","+...(...)...-..."],["Algeria (الجزائر)","dz","213","+...-..-...-...."],["American Samoa","as","1684","+.(...)...-...."],["Andorra","ad","376","+...-...-..."],["Angola","ao","244","+...(...)...-..."],["Anguilla","ai","1264","+.(...)...-...."],["Antarctica","aq","672",""],["Antigua and Barbuda","ag","1268","+.(...)...-...."],["Argentina","ar","54","+..(...)...-...."],["Armenia (Հայաստան)","am","374","+...-..-...-..."],["Aruba","aw","297","+...-...-...."],["Australia","au","61","+.. ... ... ..."],["Austria (Österreich)","at","43","+..(...)...-...."],["Azerbaijan (Azərbaycan)","az","994","+...-..-...-..-.."],["Bahamas","bs","1242","+.(...)...-...."],["Bahrain (البحرين)","bh","973","+...-....-...."],["Bangladesh (বাংলাদেশ)","bd","880","+...-..-...-..."],["Barbados","bb","1246","+.(...)...-...."],["Belarus (Беларусь)","by","375","+...(..)...-..-.."],["Belgium (België)","be","32","+.. ... .. .. .."],["Belize","bz","501","+...-...-...."],["Benin (Bénin)","bj","229","+...-..-..-...."],["Bermuda","bm","1441","+.(...)...-...."],["Bhutan (འབྲུག)","bt","975","+...-.-...-..."],["Bolivia","bo","591","+...-.-...-...."],["Bosnia and Herzegovina (Босна и Херцеговина)","ba","387","+...-..-...."],["Botswana","bw","267","+...-..-...-..."],["Bouvet Island","bv","47",""],["Brazil (Brasil)","br","55","+..-..-....-...."],["British Indian Ocean Territory","io","246","+...-...-...."],["British Virgin Islands","vg","1284","+.(...)...-...."],["Brunei","bn","673","+...-...-...."],["Bulgaria (България)","bg","359","+...(...)...-..."],["Burkina Faso","bf","226","+...-..-..-...."],["Burundi (Uburundi)","bi","257","+...-..-..-...."],["Cambodia (កម្ពុជា)","kh","855","+...-..-...-..."],["Cameroon (Cameroun)","cm","237","+...-....-...."],["Canada","ca","1","+. (...) ...-....",1,["204","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)","cv","238","+...(...)..-.."],["Caribbean Netherlands","bq","599","+...-...-....",1],["Cayman Islands","ky","1345","+.(...)...-...."],["Central African Republic (République centrafricaine)","cf","236","+...-..-..-...."],["Chad (Tchad)","td","235","+...-..-..-..-.."],["Chile","cl","56","+..-.-....-...."],["China (中国)","cn","86","+.. ..-........"],["Christmas Island","cx","61",""],["Cocos (Keeling) Islands","cc","61",""],["Colombia","co","57","+..(...)...-...."],["Comoros (جزر القمر)","km","269","+...-..-....."],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)","cd","243","+...(...)...-..."],["Congo (Republic) (Congo-Brazzaville)","cg","242","+...-..-...-...."],["Cook Islands","ck","682","+...-..-..."],["Costa Rica","cr","506","+... ....-...."],["Côte d’Ivoire","ci","225","+...-..-...-..."],["Croatia (Hrvatska)","hr","385","+...-..-...-..."],["Cuba","cu","53","+..-.-...-...."],["Curaçao","cw","599","+...-...-....",0],["Cyprus (Κύπρος)","cy","357","+...-..-...-..."],["Czech Republic (Česká republika)","cz","420","+...(...)...-..."],["Denmark (Danmark)","dk","45","+.. .. .. .. .."],["Djibouti","dj","253","+...-..-..-..-.."],["Dominica","dm","1767","+.(...)...-...."],["Dominican Republic (República Dominicana)","do","1","+.(...)...-....",2,["809","829","849"]],["Ecuador","ec","593","+...-.-...-...."],["Egypt (مصر)","eg","20","+..(...)...-...."],["El Salvador","sv","503","+... ....-...."],["Equatorial Guinea (Guinea Ecuatorial)","gq","240","+...-..-...-...."],["Eritrea","er","291","+...-.-...-..."],["Estonia (Eesti)","ee","372","+...-...-...."],["Ethiopia","et","251","+...-..-...-...."],["Falkland Islands (Islas Malvinas)","fk","500","+...-....."],["Faroe Islands (Føroyar)","fo","298","+...-...-..."],["Fiji","fj","679","+...-..-....."],["Finland (Suomi)","fi","358","+... .. .... ...."],["France","fr","33","+.. . .. .. .. .."],["French Guiana (Guyane française)","gf","594","+...-.....-...."],["French Polynesia (Polynésie française)","pf","689","+...-..-..-.."],["French Southern and Antarctic Lands","tf","262",""],["Gabon","ga","241","+...-.-..-..-.."],["Gambia","gm","220","+...(...)..-.."],["Georgia (საქართველო)","ge","995","+...(...)...-..."],["Germany (Deutschland)","de","49","+.. ... ......."],["Ghana (Gaana)","gh","233","+...(...)...-..."],["Gibraltar","gi","350","+...-...-....."],["Greece (Ελλάδα)","gr","30","+..(...)...-...."],["Greenland (Kalaallit Nunaat)","gl","299","+...-..-..-.."],["Grenada","gd","1473","+.(...)...-...."],["Guadeloupe","gp","590","",0],["Guam","gu","1671","+.(...)...-...."],["Guatemala","gt","502","+... ....-...."],["Guernsey","gg","44",""],["Guinea (Guinée)","gn","224","+...-..-...-..."],["Guinea-Bissau (Guiné Bissau)","gw","245","+...-.-......"],["Guyana","gy","592","+...-...-...."],["Haiti","ht","509","+... ....-...."],["Heard Island and McDonald Islands","hm","672",""],["Honduras","hn","504","+...-....-...."],["Hong Kong (香港)","hk","852","+... .... ...."],["Hungary (Magyarország)","hu","36","+..(...)...-..."],["Iceland (Ísland)","is","354","+... ... ...."],["India (भारत)","in","91","+.. .....-....."],["Indonesia","id","62","+..-..-...-.."],["Iran (ایران)","ir","98","+..(...)...-...."],["Iraq (العراق)","iq","964","+...(...)...-...."],["Ireland","ie","353","+... .. ......."],["Isle of Man","im","44",""],["Israel (ישראל)","il","972","+...-.-...-...."],["Italy (Italia)","it","39","+.. ... ......",0],["Jamaica","jm","1876","+.(...)...-...."],["Japan (日本)","jp","81","+.. ... .. ...."],["Jersey","je","44",""],["Jordan (الأردن)","jo","962","+...-.-....-...."],["Kazakhstan (Казахстан)","kz","7","+. ... ...-..-..",1],["Kenya","ke","254","+...-...-......"],["Kiribati","ki","686","+...-..-..."],["Kosovo","xk","383",""],["Kuwait (الكويت)","kw","965","+...-....-...."],["Kyrgyzstan (Кыргызстан)","kg","996","+...(...)...-..."],["Laos (ລາວ)","la","856","+...-..-...-..."],["Latvia (Latvija)","lv","371","+...-..-...-..."],["Lebanon (لبنان)","lb","961","+...-.-...-..."],["Lesotho","ls","266","+...-.-...-...."],["Liberia","lr","231","+...-..-...-..."],["Libya (ليبيا)","ly","218","+...-..-...-..."],["Liechtenstein","li","423","+...(...)...-...."],["Lithuania (Lietuva)","lt","370","+...(...)..-..."],["Luxembourg","lu","352","+...(...)...-..."],["Macau (澳門)","mo","853","+...-....-...."],["Macedonia (FYROM) (Македонија)","mk","389","+...-..-...-..."],["Madagascar (Madagasikara)","mg","261","+...-..-..-....."],["Malawi","mw","265","+...-.-....-...."],["Malaysia","my","60","+.. ..-....-...."],["Maldives","mv","960","+...-...-...."],["Mali","ml","223","+...-..-..-...."],["Malta","mt","356","+...-....-...."],["Marshall Islands","mh","692","+...-...-...."],["Martinique","mq","596","+...(...)..-..-.."],["Mauritania (موريتانيا)","mr","222","+...-..-..-...."],["Mauritius (Moris)","mu","230","+...-...-...."],["Mayotte","yt","262",""],["Mexico (México)","mx","52","+..-..-..-...."],["Micronesia","fm","691","+...-...-...."],["Moldova (Republica Moldova)","md","373","+...-....-...."],["Monaco","mc","377","+...-..-...-..."],["Mongolia (Монгол)","mn","976","+...-..-..-...."],["Montenegro (Crna Gora)","me","382","+...-..-...-..."],["Montserrat","ms","1664","+.(...)...-...."],["Morocco (المغرب)","ma","212","+...-..-....-..."],["Mozambique (Moçambique)","mz","258","+...-..-...-..."],["Myanmar (Burma) (မြန်မာ)","mm","95","+..-...-..."],["Namibia (Namibië)","na","264","+...-..-...-...."],["Nauru","nr","674","+...-...-...."],["Nepal (नेपाल)","np","977","+...-..-...-..."],["Netherlands (Nederland)","nl","31","+.. .. ........"],["New Caledonia (Nouvelle-Calédonie)","nc","687","+...-..-...."],["New Zealand","nz","64","+.. ...-...-...."],["Nicaragua","ni","505","+...-....-...."],["Niger (Nijar)","ne","227","+...-..-..-...."],["Nigeria","ng","234","+...-..-...-.."],["Niue","nu","683","+...-...."],["Norfolk Island","nf","672","+...-...-..."],["North Korea (조선 민주주의 인민 공화국)","kp","850","+...-...-..."],["Northern Mariana Islands","mp","1670","+.(...)...-...."],["Norway (Norge)","no","47","+.. ... .. ..."],["Oman (عُمان)","om","968","+...-..-...-..."],["Pakistan (پاکستان)","pk","92","+.. ...-......."],["Palau","pw","680","+...-...-...."],["Palestine (فلسطين)","ps","970","+...-..-...-...."],["Panama (Panamá)","pa","507","+...-...-...."],["Papua New Guinea","pg","675","+...(...)..-..."],["Paraguay","py","595","+...(...)...-..."],["Peru (Perú)","pe","51","+..(...)...-..."],["Philippines","ph","63","+.. ... ...."],["Pitcairn Islands","pn","64",""],["Poland (Polska)","pl","48","+.. ...-...-..."],["Portugal","pt","351","+...-..-...-...."],["Puerto Rico","pr","1","+. (...) ...-....",3,["787","939"]],["Qatar (قطر)","qa","974","+...-....-...."],["Réunion (La Réunion)","re","262","+...-.....-...."],["Romania (România)","ro","40","+..-..-...-...."],["Russia (Россия)","ru","7","+. ... ...-..-..",0],["Rwanda","rw","250","+...(...)...-..."],["Saint Barthélemy (Saint-Barthélemy)","bl","590","",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1869","+.(...)...-...."],["Saint Lucia","lc","1758","+.(...)...-...."],["Saint Martin (Saint-Martin (partie française))","mf","590","",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)","pm","508"],["Saint Vincent and the Grenadines","vc","1784","+.(...)...-...."],["Samoa","ws","685","+...-..-...."],["San Marino","sm","378","+...-....-......"],["São Tomé and Príncipe (São Tomé e Príncipe)","st","239","+...-..-....."],["Saudi Arabia (المملكة العربية السعودية)","sa","966","+...-..-...-...."],["Senegal (Sénégal)","sn","221","+...-..-...-...."],["Serbia (Србија)","rs","381","+...-..-...-...."],["Seychelles","sc","248","+...-.-...-..."],["Sierra Leone","sl","232","+...-..-......"],["Singapore","sg","65","+.. ....-...."],["Sint Maarten","sx","1721","+.(...)...-...."],["Slovakia (Slovensko)","sk","421","+...(...)...-..."],["Slovenia (Slovenija)","si","386","+...-..-...-..."],["Solomon Islands","sb","677","+...-....."],["Somalia (Soomaaliya)","so","252","+...-.-...-..."],["South Africa","za","27","+..-..-...-...."],["South Georgia and the South Sandwich Islands","gs","500",""],["South Korea (대한민국)","kr","82","+..-..-...-...."],["South Sudan (جنوب السودان)","ss","211","+...-..-...-...."],["Spain (España)","es","34","+.. ... ... ..."],["Sri Lanka (ශ්රී ලංකාව)","lk","94","+..-..-...-...."],["Sudan (السودان)","sd","249","+...-..-...-...."],["Suriname","sr","597","+...-...-..."],["Svalbard and Jan Mayen","sj","47",""],["Swaziland","sz","268","+...-..-..-...."],["Sweden (Sverige)","se","46","+.. .. ... .. .."],["Switzerland (Schweiz)","ch","41","+.. .. ... .. .."],["Syria (سوريا)","sy","963","+...-..-....-..."],["Taiwan (台灣)","tw","886","+...-....-...."],["Tajikistan","tj","992","+...-..-...-...."],["Tanzania","tz","255","+...-..-...-...."],["Thailand (ไทย)","th","66","+..-..-...-..."],["Timor-Leste","tl","670","+...-...-...."],["Togo","tg","228","+...-..-...-..."],["Tokelau","tk","690","+...-...."],["Tonga","to","676","+...-....."],["Trinidad and Tobago","tt","1868","+.(...)...-...."],["Tunisia (تونس)","tn","216","+...-..-...-..."],["Turkey (Türkiye)","tr","90","+.. ... ... .. .."],["Turkmenistan","tm","993","+...-.-...-...."],["Turks and Caicos Islands","tc","1649","+.(...)...-...."],["Tuvalu","tv","688","+...-....."],["U.S. Virgin Islands","vi","1340","+.(...)...-...."],["Uganda","ug","256","+...(...)...-..."],["Ukraine (Україна)","ua","380","+...(..)...-..-.."],["United Arab Emirates (الإمارات العربية المتحدة)","ae","971","+...-.-...-...."],["United Kingdom","gb","44","+.. .... ......"],["United States","us","1","+. (...) ...-....",0],["United States Minor Outlying Islands","um","1","",2],["Uruguay","uy","598","+...-.-...-..-.."],["Uzbekistan (Oʻzbekiston)","uz","998","+...-..-...-...."],["Vanuatu","vu","678","+...-....."],["Vatican City (Città del Vaticano)","va","39","+.. .. .... ....",1],["Venezuela","ve","58","+..(...)...-...."],["Vietnam (Việt Nam)","vn","84","+..-..-....-..."],["Wallis and Futuna","wf","681","+...-..-...."],["Western Sahara","eh","212","+...-..-...."],["Yemen (اليمن)","ye","967","+...-.-...-..."],["Zambia","zm","260","+...-..-...-...."],["Zimbabwe","zw","263","+...-.-......"]],u={},m={},c=function(_,f,h){f in u||(u[f]=[]);var v=h||0;u[f][v]=_},n=0;n<i.length;n++){var r=i[n];if(i[n]={name:r[0],iso2:r[1],dialCode:r[2],priority:r[4]||0},r[3]&&(i[n].format=r[3]),r[5]){i[n].hasAreaCodes=!0;for(var d=0;d<r[5].length;d++){var p=r[2]+r[5][d];c(r[1],p)}}m[i[n].iso2]=n,c(r[1],r[2],r[4])}return L={allCountries:i,iso2Lookup:m,allCountryCodes:u},L}var le=se();function H(i){return i.toUpperCase().replace(/./g,u=>String.fromCodePoint(127397+u.charCodeAt(0)))}function ue({value:i,onChange:u,selectedCountry:m,onCountryChange:c,placeholder:n="Número de teléfono",disabled:r=!1,className:d,inputClassName:p,countryClassName:_}){const[f,h]=w.useState([]),[v,E]=w.useState(null),[y,A]=w.useState("");w.useEffect(()=>{const o=le.allCountries.map(b=>({name:b.name,iso2:b.iso2,dialCode:b.dialCode}));h(o),E(o[0])},[]);const S=f.find(o=>o.iso2===m)||v||f[0]||null,R=i!==void 0?i:y,j=o=>{if(c)c(o);else{const b=f.find(M=>M.iso2===o)||null;E(b)}},x=o=>{const b=o.replace(/\D/g,"");u?u(b):A(b)};return g.jsxs("div",{className:`my-phone ${d??""}`,children:[g.jsxs("div",{className:"my-phone__country",children:[S&&g.jsxs("div",{className:`my-phone__selected ${_??""}`,children:[g.jsx("span",{className:"flag",children:H(S.iso2)}),g.jsxs("span",{className:"code",children:["+",S.dialCode]}),g.jsx("span",{className:"arrow",children:"▾"})]}),g.jsx("select",{className:"my-phone__select",value:S?.iso2,onChange:o=>j(o.target.value),disabled:r,children:f.map(o=>g.jsxs("option",{value:o.iso2,children:[H(o.iso2)," ",o.name," +",o.dialCode]},o.iso2))})]}),g.jsx("input",{type:"tel",className:p,value:R,onChange:o=>x(o.target.value),placeholder:n,disabled:r})]})}module.exports=ue;
|
|
@@ -0,0 +1,697 @@
|
|
|
1
|
+
import ta, { useState as G, useEffect as oa } from "react";
|
|
2
|
+
var N = { exports: {} }, T = {};
|
|
3
|
+
var $;
|
|
4
|
+
function ia() {
|
|
5
|
+
if ($) return T;
|
|
6
|
+
$ = 1;
|
|
7
|
+
var i = /* @__PURE__ */ Symbol.for("react.transitional.element"), u = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
8
|
+
function m(c, n, r) {
|
|
9
|
+
var d = null;
|
|
10
|
+
if (r !== void 0 && (d = "" + r), n.key !== void 0 && (d = "" + n.key), "key" in n) {
|
|
11
|
+
r = {};
|
|
12
|
+
for (var p in n)
|
|
13
|
+
p !== "key" && (r[p] = n[p]);
|
|
14
|
+
} else r = n;
|
|
15
|
+
return n = r.ref, {
|
|
16
|
+
$$typeof: i,
|
|
17
|
+
type: c,
|
|
18
|
+
key: d,
|
|
19
|
+
ref: n !== void 0 ? n : null,
|
|
20
|
+
props: r
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return T.Fragment = u, T.jsx = m, T.jsxs = m, T;
|
|
24
|
+
}
|
|
25
|
+
var C = {};
|
|
26
|
+
var J;
|
|
27
|
+
function sa() {
|
|
28
|
+
return J || (J = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
29
|
+
function i(a) {
|
|
30
|
+
if (a == null) return null;
|
|
31
|
+
if (typeof a == "function")
|
|
32
|
+
return a.$$typeof === ea ? null : a.displayName || a.name || null;
|
|
33
|
+
if (typeof a == "string") return a;
|
|
34
|
+
switch (a) {
|
|
35
|
+
case R:
|
|
36
|
+
return "Fragment";
|
|
37
|
+
case j:
|
|
38
|
+
return "Profiler";
|
|
39
|
+
case P:
|
|
40
|
+
return "StrictMode";
|
|
41
|
+
case X:
|
|
42
|
+
return "Suspense";
|
|
43
|
+
case Z:
|
|
44
|
+
return "SuspenseList";
|
|
45
|
+
case aa:
|
|
46
|
+
return "Activity";
|
|
47
|
+
}
|
|
48
|
+
if (typeof a == "object")
|
|
49
|
+
switch (typeof a.tag == "number" && console.error(
|
|
50
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
51
|
+
), a.$$typeof) {
|
|
52
|
+
case S:
|
|
53
|
+
return "Portal";
|
|
54
|
+
case b:
|
|
55
|
+
return a.displayName || "Context";
|
|
56
|
+
case o:
|
|
57
|
+
return (a._context.displayName || "Context") + ".Consumer";
|
|
58
|
+
case x:
|
|
59
|
+
var e = a.render;
|
|
60
|
+
return a = a.displayName, a || (a = e.displayName || e.name || "", a = a !== "" ? "ForwardRef(" + a + ")" : "ForwardRef"), a;
|
|
61
|
+
case Q:
|
|
62
|
+
return e = a.displayName || null, e !== null ? e : i(a.type) || "Memo";
|
|
63
|
+
case M:
|
|
64
|
+
e = a._payload, a = a._init;
|
|
65
|
+
try {
|
|
66
|
+
return i(a(e));
|
|
67
|
+
} catch {
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
function u(a) {
|
|
73
|
+
return "" + a;
|
|
74
|
+
}
|
|
75
|
+
function m(a) {
|
|
76
|
+
try {
|
|
77
|
+
u(a);
|
|
78
|
+
var e = !1;
|
|
79
|
+
} catch {
|
|
80
|
+
e = !0;
|
|
81
|
+
}
|
|
82
|
+
if (e) {
|
|
83
|
+
e = console;
|
|
84
|
+
var t = e.error, s = typeof Symbol == "function" && Symbol.toStringTag && a[Symbol.toStringTag] || a.constructor.name || "Object";
|
|
85
|
+
return t.call(
|
|
86
|
+
e,
|
|
87
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
88
|
+
s
|
|
89
|
+
), u(a);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function c(a) {
|
|
93
|
+
if (a === R) return "<>";
|
|
94
|
+
if (typeof a == "object" && a !== null && a.$$typeof === M)
|
|
95
|
+
return "<...>";
|
|
96
|
+
try {
|
|
97
|
+
var e = i(a);
|
|
98
|
+
return e ? "<" + e + ">" : "<...>";
|
|
99
|
+
} catch {
|
|
100
|
+
return "<...>";
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function n() {
|
|
104
|
+
var a = I.A;
|
|
105
|
+
return a === null ? null : a.getOwner();
|
|
106
|
+
}
|
|
107
|
+
function r() {
|
|
108
|
+
return Error("react-stack-top-frame");
|
|
109
|
+
}
|
|
110
|
+
function d(a) {
|
|
111
|
+
if (F.call(a, "key")) {
|
|
112
|
+
var e = Object.getOwnPropertyDescriptor(a, "key").get;
|
|
113
|
+
if (e && e.isReactWarning) return !1;
|
|
114
|
+
}
|
|
115
|
+
return a.key !== void 0;
|
|
116
|
+
}
|
|
117
|
+
function p(a, e) {
|
|
118
|
+
function t() {
|
|
119
|
+
q || (q = !0, console.error(
|
|
120
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
121
|
+
e
|
|
122
|
+
));
|
|
123
|
+
}
|
|
124
|
+
t.isReactWarning = !0, Object.defineProperty(a, "key", {
|
|
125
|
+
get: t,
|
|
126
|
+
configurable: !0
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function _() {
|
|
130
|
+
var a = i(this.type);
|
|
131
|
+
return D[a] || (D[a] = !0, console.error(
|
|
132
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
133
|
+
)), a = this.props.ref, a !== void 0 ? a : null;
|
|
134
|
+
}
|
|
135
|
+
function f(a, e, t, s, A, z) {
|
|
136
|
+
var l = t.ref;
|
|
137
|
+
return a = {
|
|
138
|
+
$$typeof: w,
|
|
139
|
+
type: a,
|
|
140
|
+
key: e,
|
|
141
|
+
props: t,
|
|
142
|
+
_owner: s
|
|
143
|
+
}, (l !== void 0 ? l : null) !== null ? Object.defineProperty(a, "ref", {
|
|
144
|
+
enumerable: !1,
|
|
145
|
+
get: _
|
|
146
|
+
}) : Object.defineProperty(a, "ref", { enumerable: !1, value: null }), a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
147
|
+
configurable: !1,
|
|
148
|
+
enumerable: !1,
|
|
149
|
+
writable: !0,
|
|
150
|
+
value: 0
|
|
151
|
+
}), Object.defineProperty(a, "_debugInfo", {
|
|
152
|
+
configurable: !1,
|
|
153
|
+
enumerable: !1,
|
|
154
|
+
writable: !0,
|
|
155
|
+
value: null
|
|
156
|
+
}), Object.defineProperty(a, "_debugStack", {
|
|
157
|
+
configurable: !1,
|
|
158
|
+
enumerable: !1,
|
|
159
|
+
writable: !0,
|
|
160
|
+
value: A
|
|
161
|
+
}), Object.defineProperty(a, "_debugTask", {
|
|
162
|
+
configurable: !1,
|
|
163
|
+
enumerable: !1,
|
|
164
|
+
writable: !0,
|
|
165
|
+
value: z
|
|
166
|
+
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
167
|
+
}
|
|
168
|
+
function h(a, e, t, s, A, z) {
|
|
169
|
+
var l = e.children;
|
|
170
|
+
if (l !== void 0)
|
|
171
|
+
if (s)
|
|
172
|
+
if (ra(l)) {
|
|
173
|
+
for (s = 0; s < l.length; s++)
|
|
174
|
+
v(l[s]);
|
|
175
|
+
Object.freeze && Object.freeze(l);
|
|
176
|
+
} else
|
|
177
|
+
console.error(
|
|
178
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
179
|
+
);
|
|
180
|
+
else v(l);
|
|
181
|
+
if (F.call(e, "key")) {
|
|
182
|
+
l = i(a);
|
|
183
|
+
var k = Object.keys(e).filter(function(na) {
|
|
184
|
+
return na !== "key";
|
|
185
|
+
});
|
|
186
|
+
s = 0 < k.length ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}", U[l + s] || (k = 0 < k.length ? "{" + k.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
187
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
188
|
+
let props = %s;
|
|
189
|
+
<%s {...props} />
|
|
190
|
+
React keys must be passed directly to JSX without using spread:
|
|
191
|
+
let props = %s;
|
|
192
|
+
<%s key={someKey} {...props} />`,
|
|
193
|
+
s,
|
|
194
|
+
l,
|
|
195
|
+
k,
|
|
196
|
+
l
|
|
197
|
+
), U[l + s] = !0);
|
|
198
|
+
}
|
|
199
|
+
if (l = null, t !== void 0 && (m(t), l = "" + t), d(e) && (m(e.key), l = "" + e.key), "key" in e) {
|
|
200
|
+
t = {};
|
|
201
|
+
for (var B in e)
|
|
202
|
+
B !== "key" && (t[B] = e[B]);
|
|
203
|
+
} else t = e;
|
|
204
|
+
return l && p(
|
|
205
|
+
t,
|
|
206
|
+
typeof a == "function" ? a.displayName || a.name || "Unknown" : a
|
|
207
|
+
), f(
|
|
208
|
+
a,
|
|
209
|
+
l,
|
|
210
|
+
t,
|
|
211
|
+
n(),
|
|
212
|
+
A,
|
|
213
|
+
z
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
function v(a) {
|
|
217
|
+
E(a) ? a._store && (a._store.validated = 1) : typeof a == "object" && a !== null && a.$$typeof === M && (a._payload.status === "fulfilled" ? E(a._payload.value) && a._payload.value._store && (a._payload.value._store.validated = 1) : a._store && (a._store.validated = 1));
|
|
218
|
+
}
|
|
219
|
+
function E(a) {
|
|
220
|
+
return typeof a == "object" && a !== null && a.$$typeof === w;
|
|
221
|
+
}
|
|
222
|
+
var y = ta, w = /* @__PURE__ */ Symbol.for("react.transitional.element"), S = /* @__PURE__ */ Symbol.for("react.portal"), R = /* @__PURE__ */ Symbol.for("react.fragment"), P = /* @__PURE__ */ Symbol.for("react.strict_mode"), j = /* @__PURE__ */ Symbol.for("react.profiler"), o = /* @__PURE__ */ Symbol.for("react.consumer"), b = /* @__PURE__ */ Symbol.for("react.context"), x = /* @__PURE__ */ Symbol.for("react.forward_ref"), X = /* @__PURE__ */ Symbol.for("react.suspense"), Z = /* @__PURE__ */ Symbol.for("react.suspense_list"), Q = /* @__PURE__ */ Symbol.for("react.memo"), M = /* @__PURE__ */ Symbol.for("react.lazy"), aa = /* @__PURE__ */ Symbol.for("react.activity"), ea = /* @__PURE__ */ Symbol.for("react.client.reference"), I = y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, ra = Array.isArray, O = console.createTask ? console.createTask : function() {
|
|
223
|
+
return null;
|
|
224
|
+
};
|
|
225
|
+
y = {
|
|
226
|
+
react_stack_bottom_frame: function(a) {
|
|
227
|
+
return a();
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
var q, D = {}, V = y.react_stack_bottom_frame.bind(
|
|
231
|
+
y,
|
|
232
|
+
r
|
|
233
|
+
)(), Y = O(c(r)), U = {};
|
|
234
|
+
C.Fragment = R, C.jsx = function(a, e, t) {
|
|
235
|
+
var s = 1e4 > I.recentlyCreatedOwnerStacks++;
|
|
236
|
+
return h(
|
|
237
|
+
a,
|
|
238
|
+
e,
|
|
239
|
+
t,
|
|
240
|
+
!1,
|
|
241
|
+
s ? Error("react-stack-top-frame") : V,
|
|
242
|
+
s ? O(c(a)) : Y
|
|
243
|
+
);
|
|
244
|
+
}, C.jsxs = function(a, e, t) {
|
|
245
|
+
var s = 1e4 > I.recentlyCreatedOwnerStacks++;
|
|
246
|
+
return h(
|
|
247
|
+
a,
|
|
248
|
+
e,
|
|
249
|
+
t,
|
|
250
|
+
!0,
|
|
251
|
+
s ? Error("react-stack-top-frame") : V,
|
|
252
|
+
s ? O(c(a)) : Y
|
|
253
|
+
);
|
|
254
|
+
};
|
|
255
|
+
})()), C;
|
|
256
|
+
}
|
|
257
|
+
var K;
|
|
258
|
+
function la() {
|
|
259
|
+
return K || (K = 1, process.env.NODE_ENV === "production" ? N.exports = ia() : N.exports = sa()), N.exports;
|
|
260
|
+
}
|
|
261
|
+
var g = la(), L, W;
|
|
262
|
+
function ua() {
|
|
263
|
+
if (W) return L;
|
|
264
|
+
W = 1;
|
|
265
|
+
for (var i = [
|
|
266
|
+
["Afghanistan (افغانستان)", "af", "93", "+..-..-...-...."],
|
|
267
|
+
["Åland Islands", "ax", "358", ""],
|
|
268
|
+
["Albania (Shqipëri)", "al", "355", "+...(...)...-..."],
|
|
269
|
+
["Algeria (الجزائر)", "dz", "213", "+...-..-...-...."],
|
|
270
|
+
["American Samoa", "as", "1684", "+.(...)...-...."],
|
|
271
|
+
["Andorra", "ad", "376", "+...-...-..."],
|
|
272
|
+
["Angola", "ao", "244", "+...(...)...-..."],
|
|
273
|
+
["Anguilla", "ai", "1264", "+.(...)...-...."],
|
|
274
|
+
["Antarctica", "aq", "672", ""],
|
|
275
|
+
["Antigua and Barbuda", "ag", "1268", "+.(...)...-...."],
|
|
276
|
+
["Argentina", "ar", "54", "+..(...)...-...."],
|
|
277
|
+
["Armenia (Հայաստան)", "am", "374", "+...-..-...-..."],
|
|
278
|
+
["Aruba", "aw", "297", "+...-...-...."],
|
|
279
|
+
["Australia", "au", "61", "+.. ... ... ..."],
|
|
280
|
+
["Austria (Österreich)", "at", "43", "+..(...)...-...."],
|
|
281
|
+
["Azerbaijan (Azərbaycan)", "az", "994", "+...-..-...-..-.."],
|
|
282
|
+
["Bahamas", "bs", "1242", "+.(...)...-...."],
|
|
283
|
+
["Bahrain (البحرين)", "bh", "973", "+...-....-...."],
|
|
284
|
+
["Bangladesh (বাংলাদেশ)", "bd", "880", "+...-..-...-..."],
|
|
285
|
+
["Barbados", "bb", "1246", "+.(...)...-...."],
|
|
286
|
+
["Belarus (Беларусь)", "by", "375", "+...(..)...-..-.."],
|
|
287
|
+
["Belgium (België)", "be", "32", "+.. ... .. .. .."],
|
|
288
|
+
["Belize", "bz", "501", "+...-...-...."],
|
|
289
|
+
["Benin (Bénin)", "bj", "229", "+...-..-..-...."],
|
|
290
|
+
["Bermuda", "bm", "1441", "+.(...)...-...."],
|
|
291
|
+
["Bhutan (འབྲུག)", "bt", "975", "+...-.-...-..."],
|
|
292
|
+
["Bolivia", "bo", "591", "+...-.-...-...."],
|
|
293
|
+
["Bosnia and Herzegovina (Босна и Херцеговина)", "ba", "387", "+...-..-...."],
|
|
294
|
+
["Botswana", "bw", "267", "+...-..-...-..."],
|
|
295
|
+
["Bouvet Island", "bv", "47", ""],
|
|
296
|
+
["Brazil (Brasil)", "br", "55", "+..-..-....-...."],
|
|
297
|
+
["British Indian Ocean Territory", "io", "246", "+...-...-...."],
|
|
298
|
+
["British Virgin Islands", "vg", "1284", "+.(...)...-...."],
|
|
299
|
+
["Brunei", "bn", "673", "+...-...-...."],
|
|
300
|
+
["Bulgaria (България)", "bg", "359", "+...(...)...-..."],
|
|
301
|
+
["Burkina Faso", "bf", "226", "+...-..-..-...."],
|
|
302
|
+
["Burundi (Uburundi)", "bi", "257", "+...-..-..-...."],
|
|
303
|
+
["Cambodia (កម្ពុជា)", "kh", "855", "+...-..-...-..."],
|
|
304
|
+
["Cameroon (Cameroun)", "cm", "237", "+...-....-...."],
|
|
305
|
+
[
|
|
306
|
+
"Canada",
|
|
307
|
+
"ca",
|
|
308
|
+
"1",
|
|
309
|
+
"+. (...) ...-....",
|
|
310
|
+
1,
|
|
311
|
+
[
|
|
312
|
+
"204",
|
|
313
|
+
"236",
|
|
314
|
+
"249",
|
|
315
|
+
"250",
|
|
316
|
+
"289",
|
|
317
|
+
"306",
|
|
318
|
+
"343",
|
|
319
|
+
"365",
|
|
320
|
+
"387",
|
|
321
|
+
"403",
|
|
322
|
+
"416",
|
|
323
|
+
"418",
|
|
324
|
+
"431",
|
|
325
|
+
"437",
|
|
326
|
+
"438",
|
|
327
|
+
"450",
|
|
328
|
+
"506",
|
|
329
|
+
"514",
|
|
330
|
+
"519",
|
|
331
|
+
"548",
|
|
332
|
+
"579",
|
|
333
|
+
"581",
|
|
334
|
+
"587",
|
|
335
|
+
"604",
|
|
336
|
+
"613",
|
|
337
|
+
"639",
|
|
338
|
+
"647",
|
|
339
|
+
"672",
|
|
340
|
+
"705",
|
|
341
|
+
"709",
|
|
342
|
+
"742",
|
|
343
|
+
"778",
|
|
344
|
+
"780",
|
|
345
|
+
"782",
|
|
346
|
+
"807",
|
|
347
|
+
"819",
|
|
348
|
+
"825",
|
|
349
|
+
"867",
|
|
350
|
+
"873",
|
|
351
|
+
"902",
|
|
352
|
+
"905"
|
|
353
|
+
]
|
|
354
|
+
],
|
|
355
|
+
["Cape Verde (Kabu Verdi)", "cv", "238", "+...(...)..-.."],
|
|
356
|
+
["Caribbean Netherlands", "bq", "599", "+...-...-....", 1],
|
|
357
|
+
["Cayman Islands", "ky", "1345", "+.(...)...-...."],
|
|
358
|
+
[
|
|
359
|
+
"Central African Republic (République centrafricaine)",
|
|
360
|
+
"cf",
|
|
361
|
+
"236",
|
|
362
|
+
"+...-..-..-...."
|
|
363
|
+
],
|
|
364
|
+
["Chad (Tchad)", "td", "235", "+...-..-..-..-.."],
|
|
365
|
+
["Chile", "cl", "56", "+..-.-....-...."],
|
|
366
|
+
["China (中国)", "cn", "86", "+.. ..-........"],
|
|
367
|
+
["Christmas Island", "cx", "61", ""],
|
|
368
|
+
["Cocos (Keeling) Islands", "cc", "61", ""],
|
|
369
|
+
["Colombia", "co", "57", "+..(...)...-...."],
|
|
370
|
+
["Comoros (جزر القمر)", "km", "269", "+...-..-....."],
|
|
371
|
+
[
|
|
372
|
+
"Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)",
|
|
373
|
+
"cd",
|
|
374
|
+
"243",
|
|
375
|
+
"+...(...)...-..."
|
|
376
|
+
],
|
|
377
|
+
["Congo (Republic) (Congo-Brazzaville)", "cg", "242", "+...-..-...-...."],
|
|
378
|
+
["Cook Islands", "ck", "682", "+...-..-..."],
|
|
379
|
+
["Costa Rica", "cr", "506", "+... ....-...."],
|
|
380
|
+
["Côte d’Ivoire", "ci", "225", "+...-..-...-..."],
|
|
381
|
+
["Croatia (Hrvatska)", "hr", "385", "+...-..-...-..."],
|
|
382
|
+
["Cuba", "cu", "53", "+..-.-...-...."],
|
|
383
|
+
["Curaçao", "cw", "599", "+...-...-....", 0],
|
|
384
|
+
["Cyprus (Κύπρος)", "cy", "357", "+...-..-...-..."],
|
|
385
|
+
["Czech Republic (Česká republika)", "cz", "420", "+...(...)...-..."],
|
|
386
|
+
["Denmark (Danmark)", "dk", "45", "+.. .. .. .. .."],
|
|
387
|
+
["Djibouti", "dj", "253", "+...-..-..-..-.."],
|
|
388
|
+
["Dominica", "dm", "1767", "+.(...)...-...."],
|
|
389
|
+
[
|
|
390
|
+
"Dominican Republic (República Dominicana)",
|
|
391
|
+
"do",
|
|
392
|
+
"1",
|
|
393
|
+
"+.(...)...-....",
|
|
394
|
+
2,
|
|
395
|
+
["809", "829", "849"]
|
|
396
|
+
],
|
|
397
|
+
["Ecuador", "ec", "593", "+...-.-...-...."],
|
|
398
|
+
["Egypt (مصر)", "eg", "20", "+..(...)...-...."],
|
|
399
|
+
["El Salvador", "sv", "503", "+... ....-...."],
|
|
400
|
+
["Equatorial Guinea (Guinea Ecuatorial)", "gq", "240", "+...-..-...-...."],
|
|
401
|
+
["Eritrea", "er", "291", "+...-.-...-..."],
|
|
402
|
+
["Estonia (Eesti)", "ee", "372", "+...-...-...."],
|
|
403
|
+
["Ethiopia", "et", "251", "+...-..-...-...."],
|
|
404
|
+
["Falkland Islands (Islas Malvinas)", "fk", "500", "+...-....."],
|
|
405
|
+
["Faroe Islands (Føroyar)", "fo", "298", "+...-...-..."],
|
|
406
|
+
["Fiji", "fj", "679", "+...-..-....."],
|
|
407
|
+
["Finland (Suomi)", "fi", "358", "+... .. .... ...."],
|
|
408
|
+
["France", "fr", "33", "+.. . .. .. .. .."],
|
|
409
|
+
["French Guiana (Guyane française)", "gf", "594", "+...-.....-...."],
|
|
410
|
+
["French Polynesia (Polynésie française)", "pf", "689", "+...-..-..-.."],
|
|
411
|
+
["French Southern and Antarctic Lands", "tf", "262", ""],
|
|
412
|
+
["Gabon", "ga", "241", "+...-.-..-..-.."],
|
|
413
|
+
["Gambia", "gm", "220", "+...(...)..-.."],
|
|
414
|
+
["Georgia (საქართველო)", "ge", "995", "+...(...)...-..."],
|
|
415
|
+
["Germany (Deutschland)", "de", "49", "+.. ... ......."],
|
|
416
|
+
["Ghana (Gaana)", "gh", "233", "+...(...)...-..."],
|
|
417
|
+
["Gibraltar", "gi", "350", "+...-...-....."],
|
|
418
|
+
["Greece (Ελλάδα)", "gr", "30", "+..(...)...-...."],
|
|
419
|
+
["Greenland (Kalaallit Nunaat)", "gl", "299", "+...-..-..-.."],
|
|
420
|
+
["Grenada", "gd", "1473", "+.(...)...-...."],
|
|
421
|
+
["Guadeloupe", "gp", "590", "", 0],
|
|
422
|
+
["Guam", "gu", "1671", "+.(...)...-...."],
|
|
423
|
+
["Guatemala", "gt", "502", "+... ....-...."],
|
|
424
|
+
["Guernsey", "gg", "44", ""],
|
|
425
|
+
["Guinea (Guinée)", "gn", "224", "+...-..-...-..."],
|
|
426
|
+
["Guinea-Bissau (Guiné Bissau)", "gw", "245", "+...-.-......"],
|
|
427
|
+
["Guyana", "gy", "592", "+...-...-...."],
|
|
428
|
+
["Haiti", "ht", "509", "+... ....-...."],
|
|
429
|
+
["Heard Island and McDonald Islands", "hm", "672", ""],
|
|
430
|
+
["Honduras", "hn", "504", "+...-....-...."],
|
|
431
|
+
["Hong Kong (香港)", "hk", "852", "+... .... ...."],
|
|
432
|
+
["Hungary (Magyarország)", "hu", "36", "+..(...)...-..."],
|
|
433
|
+
["Iceland (Ísland)", "is", "354", "+... ... ...."],
|
|
434
|
+
["India (भारत)", "in", "91", "+.. .....-....."],
|
|
435
|
+
["Indonesia", "id", "62", "+..-..-...-.."],
|
|
436
|
+
["Iran (ایران)", "ir", "98", "+..(...)...-...."],
|
|
437
|
+
["Iraq (العراق)", "iq", "964", "+...(...)...-...."],
|
|
438
|
+
["Ireland", "ie", "353", "+... .. ......."],
|
|
439
|
+
["Isle of Man", "im", "44", ""],
|
|
440
|
+
["Israel (ישראל)", "il", "972", "+...-.-...-...."],
|
|
441
|
+
["Italy (Italia)", "it", "39", "+.. ... ......", 0],
|
|
442
|
+
["Jamaica", "jm", "1876", "+.(...)...-...."],
|
|
443
|
+
["Japan (日本)", "jp", "81", "+.. ... .. ...."],
|
|
444
|
+
["Jersey", "je", "44", ""],
|
|
445
|
+
["Jordan (الأردن)", "jo", "962", "+...-.-....-...."],
|
|
446
|
+
["Kazakhstan (Казахстан)", "kz", "7", "+. ... ...-..-..", 1],
|
|
447
|
+
["Kenya", "ke", "254", "+...-...-......"],
|
|
448
|
+
["Kiribati", "ki", "686", "+...-..-..."],
|
|
449
|
+
["Kosovo", "xk", "383", ""],
|
|
450
|
+
["Kuwait (الكويت)", "kw", "965", "+...-....-...."],
|
|
451
|
+
["Kyrgyzstan (Кыргызстан)", "kg", "996", "+...(...)...-..."],
|
|
452
|
+
["Laos (ລາວ)", "la", "856", "+...-..-...-..."],
|
|
453
|
+
["Latvia (Latvija)", "lv", "371", "+...-..-...-..."],
|
|
454
|
+
["Lebanon (لبنان)", "lb", "961", "+...-.-...-..."],
|
|
455
|
+
["Lesotho", "ls", "266", "+...-.-...-...."],
|
|
456
|
+
["Liberia", "lr", "231", "+...-..-...-..."],
|
|
457
|
+
["Libya (ليبيا)", "ly", "218", "+...-..-...-..."],
|
|
458
|
+
["Liechtenstein", "li", "423", "+...(...)...-...."],
|
|
459
|
+
["Lithuania (Lietuva)", "lt", "370", "+...(...)..-..."],
|
|
460
|
+
["Luxembourg", "lu", "352", "+...(...)...-..."],
|
|
461
|
+
["Macau (澳門)", "mo", "853", "+...-....-...."],
|
|
462
|
+
["Macedonia (FYROM) (Македонија)", "mk", "389", "+...-..-...-..."],
|
|
463
|
+
["Madagascar (Madagasikara)", "mg", "261", "+...-..-..-....."],
|
|
464
|
+
["Malawi", "mw", "265", "+...-.-....-...."],
|
|
465
|
+
["Malaysia", "my", "60", "+.. ..-....-...."],
|
|
466
|
+
["Maldives", "mv", "960", "+...-...-...."],
|
|
467
|
+
["Mali", "ml", "223", "+...-..-..-...."],
|
|
468
|
+
["Malta", "mt", "356", "+...-....-...."],
|
|
469
|
+
["Marshall Islands", "mh", "692", "+...-...-...."],
|
|
470
|
+
["Martinique", "mq", "596", "+...(...)..-..-.."],
|
|
471
|
+
["Mauritania (موريتانيا)", "mr", "222", "+...-..-..-...."],
|
|
472
|
+
["Mauritius (Moris)", "mu", "230", "+...-...-...."],
|
|
473
|
+
["Mayotte", "yt", "262", ""],
|
|
474
|
+
["Mexico (México)", "mx", "52", "+..-..-..-...."],
|
|
475
|
+
["Micronesia", "fm", "691", "+...-...-...."],
|
|
476
|
+
["Moldova (Republica Moldova)", "md", "373", "+...-....-...."],
|
|
477
|
+
["Monaco", "mc", "377", "+...-..-...-..."],
|
|
478
|
+
["Mongolia (Монгол)", "mn", "976", "+...-..-..-...."],
|
|
479
|
+
["Montenegro (Crna Gora)", "me", "382", "+...-..-...-..."],
|
|
480
|
+
["Montserrat", "ms", "1664", "+.(...)...-...."],
|
|
481
|
+
["Morocco (المغرب)", "ma", "212", "+...-..-....-..."],
|
|
482
|
+
["Mozambique (Moçambique)", "mz", "258", "+...-..-...-..."],
|
|
483
|
+
["Myanmar (Burma) (မြန်မာ)", "mm", "95", "+..-...-..."],
|
|
484
|
+
["Namibia (Namibië)", "na", "264", "+...-..-...-...."],
|
|
485
|
+
["Nauru", "nr", "674", "+...-...-...."],
|
|
486
|
+
["Nepal (नेपाल)", "np", "977", "+...-..-...-..."],
|
|
487
|
+
["Netherlands (Nederland)", "nl", "31", "+.. .. ........"],
|
|
488
|
+
["New Caledonia (Nouvelle-Calédonie)", "nc", "687", "+...-..-...."],
|
|
489
|
+
["New Zealand", "nz", "64", "+.. ...-...-...."],
|
|
490
|
+
["Nicaragua", "ni", "505", "+...-....-...."],
|
|
491
|
+
["Niger (Nijar)", "ne", "227", "+...-..-..-...."],
|
|
492
|
+
["Nigeria", "ng", "234", "+...-..-...-.."],
|
|
493
|
+
["Niue", "nu", "683", "+...-...."],
|
|
494
|
+
["Norfolk Island", "nf", "672", "+...-...-..."],
|
|
495
|
+
["North Korea (조선 민주주의 인민 공화국)", "kp", "850", "+...-...-..."],
|
|
496
|
+
["Northern Mariana Islands", "mp", "1670", "+.(...)...-...."],
|
|
497
|
+
["Norway (Norge)", "no", "47", "+.. ... .. ..."],
|
|
498
|
+
["Oman (عُمان)", "om", "968", "+...-..-...-..."],
|
|
499
|
+
["Pakistan (پاکستان)", "pk", "92", "+.. ...-......."],
|
|
500
|
+
["Palau", "pw", "680", "+...-...-...."],
|
|
501
|
+
["Palestine (فلسطين)", "ps", "970", "+...-..-...-...."],
|
|
502
|
+
["Panama (Panamá)", "pa", "507", "+...-...-...."],
|
|
503
|
+
["Papua New Guinea", "pg", "675", "+...(...)..-..."],
|
|
504
|
+
["Paraguay", "py", "595", "+...(...)...-..."],
|
|
505
|
+
["Peru (Perú)", "pe", "51", "+..(...)...-..."],
|
|
506
|
+
["Philippines", "ph", "63", "+.. ... ...."],
|
|
507
|
+
["Pitcairn Islands", "pn", "64", ""],
|
|
508
|
+
["Poland (Polska)", "pl", "48", "+.. ...-...-..."],
|
|
509
|
+
["Portugal", "pt", "351", "+...-..-...-...."],
|
|
510
|
+
["Puerto Rico", "pr", "1", "+. (...) ...-....", 3, ["787", "939"]],
|
|
511
|
+
["Qatar (قطر)", "qa", "974", "+...-....-...."],
|
|
512
|
+
["Réunion (La Réunion)", "re", "262", "+...-.....-...."],
|
|
513
|
+
["Romania (România)", "ro", "40", "+..-..-...-...."],
|
|
514
|
+
["Russia (Россия)", "ru", "7", "+. ... ...-..-..", 0],
|
|
515
|
+
["Rwanda", "rw", "250", "+...(...)...-..."],
|
|
516
|
+
["Saint Barthélemy (Saint-Barthélemy)", "bl", "590", "", 1],
|
|
517
|
+
["Saint Helena", "sh", "290"],
|
|
518
|
+
["Saint Kitts and Nevis", "kn", "1869", "+.(...)...-...."],
|
|
519
|
+
["Saint Lucia", "lc", "1758", "+.(...)...-...."],
|
|
520
|
+
["Saint Martin (Saint-Martin (partie française))", "mf", "590", "", 2],
|
|
521
|
+
["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)", "pm", "508"],
|
|
522
|
+
["Saint Vincent and the Grenadines", "vc", "1784", "+.(...)...-...."],
|
|
523
|
+
["Samoa", "ws", "685", "+...-..-...."],
|
|
524
|
+
["San Marino", "sm", "378", "+...-....-......"],
|
|
525
|
+
["São Tomé and Príncipe (São Tomé e Príncipe)", "st", "239", "+...-..-....."],
|
|
526
|
+
[
|
|
527
|
+
"Saudi Arabia (المملكة العربية السعودية)",
|
|
528
|
+
"sa",
|
|
529
|
+
"966",
|
|
530
|
+
"+...-..-...-...."
|
|
531
|
+
],
|
|
532
|
+
["Senegal (Sénégal)", "sn", "221", "+...-..-...-...."],
|
|
533
|
+
["Serbia (Србија)", "rs", "381", "+...-..-...-...."],
|
|
534
|
+
["Seychelles", "sc", "248", "+...-.-...-..."],
|
|
535
|
+
["Sierra Leone", "sl", "232", "+...-..-......"],
|
|
536
|
+
["Singapore", "sg", "65", "+.. ....-...."],
|
|
537
|
+
["Sint Maarten", "sx", "1721", "+.(...)...-...."],
|
|
538
|
+
["Slovakia (Slovensko)", "sk", "421", "+...(...)...-..."],
|
|
539
|
+
["Slovenia (Slovenija)", "si", "386", "+...-..-...-..."],
|
|
540
|
+
["Solomon Islands", "sb", "677", "+...-....."],
|
|
541
|
+
["Somalia (Soomaaliya)", "so", "252", "+...-.-...-..."],
|
|
542
|
+
["South Africa", "za", "27", "+..-..-...-...."],
|
|
543
|
+
["South Georgia and the South Sandwich Islands", "gs", "500", ""],
|
|
544
|
+
["South Korea (대한민국)", "kr", "82", "+..-..-...-...."],
|
|
545
|
+
["South Sudan (جنوب السودان)", "ss", "211", "+...-..-...-...."],
|
|
546
|
+
["Spain (España)", "es", "34", "+.. ... ... ..."],
|
|
547
|
+
["Sri Lanka (ශ්රී ලංකාව)", "lk", "94", "+..-..-...-...."],
|
|
548
|
+
["Sudan (السودان)", "sd", "249", "+...-..-...-...."],
|
|
549
|
+
["Suriname", "sr", "597", "+...-...-..."],
|
|
550
|
+
["Svalbard and Jan Mayen", "sj", "47", ""],
|
|
551
|
+
["Swaziland", "sz", "268", "+...-..-..-...."],
|
|
552
|
+
["Sweden (Sverige)", "se", "46", "+.. .. ... .. .."],
|
|
553
|
+
["Switzerland (Schweiz)", "ch", "41", "+.. .. ... .. .."],
|
|
554
|
+
["Syria (سوريا)", "sy", "963", "+...-..-....-..."],
|
|
555
|
+
["Taiwan (台灣)", "tw", "886", "+...-....-...."],
|
|
556
|
+
["Tajikistan", "tj", "992", "+...-..-...-...."],
|
|
557
|
+
["Tanzania", "tz", "255", "+...-..-...-...."],
|
|
558
|
+
["Thailand (ไทย)", "th", "66", "+..-..-...-..."],
|
|
559
|
+
["Timor-Leste", "tl", "670", "+...-...-...."],
|
|
560
|
+
["Togo", "tg", "228", "+...-..-...-..."],
|
|
561
|
+
["Tokelau", "tk", "690", "+...-...."],
|
|
562
|
+
["Tonga", "to", "676", "+...-....."],
|
|
563
|
+
["Trinidad and Tobago", "tt", "1868", "+.(...)...-...."],
|
|
564
|
+
["Tunisia (تونس)", "tn", "216", "+...-..-...-..."],
|
|
565
|
+
["Turkey (Türkiye)", "tr", "90", "+.. ... ... .. .."],
|
|
566
|
+
["Turkmenistan", "tm", "993", "+...-.-...-...."],
|
|
567
|
+
["Turks and Caicos Islands", "tc", "1649", "+.(...)...-...."],
|
|
568
|
+
["Tuvalu", "tv", "688", "+...-....."],
|
|
569
|
+
["U.S. Virgin Islands", "vi", "1340", "+.(...)...-...."],
|
|
570
|
+
["Uganda", "ug", "256", "+...(...)...-..."],
|
|
571
|
+
["Ukraine (Україна)", "ua", "380", "+...(..)...-..-.."],
|
|
572
|
+
[
|
|
573
|
+
"United Arab Emirates (الإمارات العربية المتحدة)",
|
|
574
|
+
"ae",
|
|
575
|
+
"971",
|
|
576
|
+
"+...-.-...-...."
|
|
577
|
+
],
|
|
578
|
+
["United Kingdom", "gb", "44", "+.. .... ......"],
|
|
579
|
+
["United States", "us", "1", "+. (...) ...-....", 0],
|
|
580
|
+
["United States Minor Outlying Islands", "um", "1", "", 2],
|
|
581
|
+
["Uruguay", "uy", "598", "+...-.-...-..-.."],
|
|
582
|
+
["Uzbekistan (Oʻzbekiston)", "uz", "998", "+...-..-...-...."],
|
|
583
|
+
["Vanuatu", "vu", "678", "+...-....."],
|
|
584
|
+
["Vatican City (Città del Vaticano)", "va", "39", "+.. .. .... ....", 1],
|
|
585
|
+
["Venezuela", "ve", "58", "+..(...)...-...."],
|
|
586
|
+
["Vietnam (Việt Nam)", "vn", "84", "+..-..-....-..."],
|
|
587
|
+
["Wallis and Futuna", "wf", "681", "+...-..-...."],
|
|
588
|
+
["Western Sahara", "eh", "212", "+...-..-...."],
|
|
589
|
+
["Yemen (اليمن)", "ye", "967", "+...-.-...-..."],
|
|
590
|
+
["Zambia", "zm", "260", "+...-..-...-...."],
|
|
591
|
+
["Zimbabwe", "zw", "263", "+...-.-......"]
|
|
592
|
+
], u = {}, m = {}, c = function(_, f, h) {
|
|
593
|
+
f in u || (u[f] = []);
|
|
594
|
+
var v = h || 0;
|
|
595
|
+
u[f][v] = _;
|
|
596
|
+
}, n = 0; n < i.length; n++) {
|
|
597
|
+
var r = i[n];
|
|
598
|
+
if (i[n] = {
|
|
599
|
+
name: r[0],
|
|
600
|
+
iso2: r[1],
|
|
601
|
+
dialCode: r[2],
|
|
602
|
+
priority: r[4] || 0
|
|
603
|
+
}, r[3] && (i[n].format = r[3]), r[5]) {
|
|
604
|
+
i[n].hasAreaCodes = !0;
|
|
605
|
+
for (var d = 0; d < r[5].length; d++) {
|
|
606
|
+
var p = r[2] + r[5][d];
|
|
607
|
+
c(r[1], p);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
m[i[n].iso2] = n, c(r[1], r[2], r[4]);
|
|
611
|
+
}
|
|
612
|
+
return L = {
|
|
613
|
+
allCountries: i,
|
|
614
|
+
iso2Lookup: m,
|
|
615
|
+
allCountryCodes: u
|
|
616
|
+
}, L;
|
|
617
|
+
}
|
|
618
|
+
var ca = ua();
|
|
619
|
+
function H(i) {
|
|
620
|
+
return i.toUpperCase().replace(/./g, (u) => String.fromCodePoint(127397 + u.charCodeAt(0)));
|
|
621
|
+
}
|
|
622
|
+
function ma({
|
|
623
|
+
value: i,
|
|
624
|
+
onChange: u,
|
|
625
|
+
selectedCountry: m,
|
|
626
|
+
onCountryChange: c,
|
|
627
|
+
placeholder: n = "Número de teléfono",
|
|
628
|
+
disabled: r = !1,
|
|
629
|
+
className: d,
|
|
630
|
+
inputClassName: p,
|
|
631
|
+
countryClassName: _
|
|
632
|
+
}) {
|
|
633
|
+
const [f, h] = G([]), [v, E] = G(
|
|
634
|
+
null
|
|
635
|
+
), [y, w] = G("");
|
|
636
|
+
oa(() => {
|
|
637
|
+
const o = ca.allCountries.map((b) => ({
|
|
638
|
+
name: b.name,
|
|
639
|
+
iso2: b.iso2,
|
|
640
|
+
dialCode: b.dialCode
|
|
641
|
+
}));
|
|
642
|
+
h(o), E(o[0]);
|
|
643
|
+
}, []);
|
|
644
|
+
const S = f.find((o) => o.iso2 === m) || v || f[0] || null, R = i !== void 0 ? i : y, P = (o) => {
|
|
645
|
+
if (c)
|
|
646
|
+
c(o);
|
|
647
|
+
else {
|
|
648
|
+
const b = f.find((x) => x.iso2 === o) || null;
|
|
649
|
+
E(b);
|
|
650
|
+
}
|
|
651
|
+
}, j = (o) => {
|
|
652
|
+
const b = o.replace(/\D/g, "");
|
|
653
|
+
u ? u(b) : w(b);
|
|
654
|
+
};
|
|
655
|
+
return /* @__PURE__ */ g.jsxs("div", { className: `my-phone ${d ?? ""}`, children: [
|
|
656
|
+
/* @__PURE__ */ g.jsxs("div", { className: "my-phone__country", children: [
|
|
657
|
+
S && /* @__PURE__ */ g.jsxs("div", { className: `my-phone__selected ${_ ?? ""}`, children: [
|
|
658
|
+
/* @__PURE__ */ g.jsx("span", { className: "flag", children: H(S.iso2) }),
|
|
659
|
+
/* @__PURE__ */ g.jsxs("span", { className: "code", children: [
|
|
660
|
+
"+",
|
|
661
|
+
S.dialCode
|
|
662
|
+
] }),
|
|
663
|
+
/* @__PURE__ */ g.jsx("span", { className: "arrow", children: "▾" })
|
|
664
|
+
] }),
|
|
665
|
+
/* @__PURE__ */ g.jsx(
|
|
666
|
+
"select",
|
|
667
|
+
{
|
|
668
|
+
className: "my-phone__select",
|
|
669
|
+
value: S?.iso2,
|
|
670
|
+
onChange: (o) => P(o.target.value),
|
|
671
|
+
disabled: r,
|
|
672
|
+
children: f.map((o) => /* @__PURE__ */ g.jsxs("option", { value: o.iso2, children: [
|
|
673
|
+
H(o.iso2),
|
|
674
|
+
" ",
|
|
675
|
+
o.name,
|
|
676
|
+
" +",
|
|
677
|
+
o.dialCode
|
|
678
|
+
] }, o.iso2))
|
|
679
|
+
}
|
|
680
|
+
)
|
|
681
|
+
] }),
|
|
682
|
+
/* @__PURE__ */ g.jsx(
|
|
683
|
+
"input",
|
|
684
|
+
{
|
|
685
|
+
type: "tel",
|
|
686
|
+
className: p,
|
|
687
|
+
value: R,
|
|
688
|
+
onChange: (o) => j(o.target.value),
|
|
689
|
+
placeholder: n,
|
|
690
|
+
disabled: r
|
|
691
|
+
}
|
|
692
|
+
)
|
|
693
|
+
] });
|
|
694
|
+
}
|
|
695
|
+
export {
|
|
696
|
+
ma as default
|
|
697
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
(function(m,v){typeof exports=="object"&&typeof module<"u"?module.exports=v(require("react")):typeof define=="function"&&define.amd?define(["react"],v):(m=typeof globalThis<"u"?globalThis:m||self,m.MyPhone=v(m.React))})(this,(function(m){"use strict";var v={exports:{}},R={};var F;function X(){if(F)return R;F=1;var i=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function f(c,n,r){var d=null;if(r!==void 0&&(d=""+r),n.key!==void 0&&(d=""+n.key),"key"in n){r={};for(var g in n)g!=="key"&&(r[g]=n[g])}else r=n;return n=r.ref,{$$typeof:i,type:c,key:d,ref:n!==void 0?n:null,props:r}}return R.Fragment=u,R.jsx=f,R.jsxs=f,R}var T={};var D;function Z(){return D||(D=1,process.env.NODE_ENV!=="production"&&(function(){function i(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case M:return"Profiler";case x:return"StrictMode";case ne:return"Suspense";case te:return"SuspenseList";case ie:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case _:return"Portal";case b:return e.displayName||"Context";case o:return(e._context.displayName||"Context")+".Consumer";case I:var a=e.render;return e=e.displayName,e||(e=a.displayName||a.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case oe:return a=e.displayName||null,a!==null?a:i(e.type)||"Memo";case O:a=e._payload,e=e._init;try{return i(e(a))}catch{}}return null}function u(e){return""+e}function f(e){try{u(e);var a=!1}catch{a=!0}if(a){a=console;var t=a.error,s=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(a,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",s),u(e)}}function c(e){if(e===A)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===O)return"<...>";try{var a=i(e);return a?"<"+a+">":"<...>"}catch{return"<...>"}}function n(){var e=z.A;return e===null?null:e.getOwner()}function r(){return Error("react-stack-top-frame")}function d(e){if(U.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function g(e,a){function t(){J||(J=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",a))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function C(){var e=i(this.type);return K[e]||(K[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function p(e,a,t,s,N,G){var l=t.ref;return e={$$typeof:P,type:e,key:a,props:t,_owner:s},(l!==void 0?l:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:C}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:N}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:G}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function y(e,a,t,s,N,G){var l=a.children;if(l!==void 0)if(s)if(le(l)){for(s=0;s<l.length;s++)S(l[s]);Object.freeze&&Object.freeze(l)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else S(l);if(U.call(a,"key")){l=i(e);var E=Object.keys(a).filter(function(ue){return ue!=="key"});s=0<E.length?"{key: someKey, "+E.join(": ..., ")+": ...}":"{key: someKey}",$[l+s]||(E=0<E.length?"{"+E.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
|
+
let props = %s;
|
|
3
|
+
<%s {...props} />
|
|
4
|
+
React keys must be passed directly to JSX without using spread:
|
|
5
|
+
let props = %s;
|
|
6
|
+
<%s key={someKey} {...props} />`,s,l,E,l),$[l+s]=!0)}if(l=null,t!==void 0&&(f(t),l=""+t),d(a)&&(f(a.key),l=""+a.key),"key"in a){t={};for(var L in a)L!=="key"&&(t[L]=a[L])}else t=a;return l&&g(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),p(e,l,t,n(),N,G)}function S(e){w(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===O&&(e._payload.status==="fulfilled"?w(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function w(e){return typeof e=="object"&&e!==null&&e.$$typeof===P}var k=m,P=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),b=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),ne=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),oe=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),ie=Symbol.for("react.activity"),se=Symbol.for("react.client.reference"),z=k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=Object.prototype.hasOwnProperty,le=Array.isArray,B=console.createTask?console.createTask:function(){return null};k={react_stack_bottom_frame:function(e){return e()}};var J,K={},W=k.react_stack_bottom_frame.bind(k,r)(),H=B(c(r)),$={};T.Fragment=A,T.jsx=function(e,a,t){var s=1e4>z.recentlyCreatedOwnerStacks++;return y(e,a,t,!1,s?Error("react-stack-top-frame"):W,s?B(c(e)):H)},T.jsxs=function(e,a,t){var s=1e4>z.recentlyCreatedOwnerStacks++;return y(e,a,t,!0,s?Error("react-stack-top-frame"):W,s?B(c(e)):H)}})()),T}var V;function Q(){return V||(V=1,process.env.NODE_ENV==="production"?v.exports=X():v.exports=Z()),v.exports}var h=Q(),j,Y;function ee(){if(Y)return j;Y=1;for(var i=[["Afghanistan (افغانستان)","af","93","+..-..-...-...."],["Åland Islands","ax","358",""],["Albania (Shqipëri)","al","355","+...(...)...-..."],["Algeria (الجزائر)","dz","213","+...-..-...-...."],["American Samoa","as","1684","+.(...)...-...."],["Andorra","ad","376","+...-...-..."],["Angola","ao","244","+...(...)...-..."],["Anguilla","ai","1264","+.(...)...-...."],["Antarctica","aq","672",""],["Antigua and Barbuda","ag","1268","+.(...)...-...."],["Argentina","ar","54","+..(...)...-...."],["Armenia (Հայաստան)","am","374","+...-..-...-..."],["Aruba","aw","297","+...-...-...."],["Australia","au","61","+.. ... ... ..."],["Austria (Österreich)","at","43","+..(...)...-...."],["Azerbaijan (Azərbaycan)","az","994","+...-..-...-..-.."],["Bahamas","bs","1242","+.(...)...-...."],["Bahrain (البحرين)","bh","973","+...-....-...."],["Bangladesh (বাংলাদেশ)","bd","880","+...-..-...-..."],["Barbados","bb","1246","+.(...)...-...."],["Belarus (Беларусь)","by","375","+...(..)...-..-.."],["Belgium (België)","be","32","+.. ... .. .. .."],["Belize","bz","501","+...-...-...."],["Benin (Bénin)","bj","229","+...-..-..-...."],["Bermuda","bm","1441","+.(...)...-...."],["Bhutan (འབྲུག)","bt","975","+...-.-...-..."],["Bolivia","bo","591","+...-.-...-...."],["Bosnia and Herzegovina (Босна и Херцеговина)","ba","387","+...-..-...."],["Botswana","bw","267","+...-..-...-..."],["Bouvet Island","bv","47",""],["Brazil (Brasil)","br","55","+..-..-....-...."],["British Indian Ocean Territory","io","246","+...-...-...."],["British Virgin Islands","vg","1284","+.(...)...-...."],["Brunei","bn","673","+...-...-...."],["Bulgaria (България)","bg","359","+...(...)...-..."],["Burkina Faso","bf","226","+...-..-..-...."],["Burundi (Uburundi)","bi","257","+...-..-..-...."],["Cambodia (កម្ពុជា)","kh","855","+...-..-...-..."],["Cameroon (Cameroun)","cm","237","+...-....-...."],["Canada","ca","1","+. (...) ...-....",1,["204","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)","cv","238","+...(...)..-.."],["Caribbean Netherlands","bq","599","+...-...-....",1],["Cayman Islands","ky","1345","+.(...)...-...."],["Central African Republic (République centrafricaine)","cf","236","+...-..-..-...."],["Chad (Tchad)","td","235","+...-..-..-..-.."],["Chile","cl","56","+..-.-....-...."],["China (中国)","cn","86","+.. ..-........"],["Christmas Island","cx","61",""],["Cocos (Keeling) Islands","cc","61",""],["Colombia","co","57","+..(...)...-...."],["Comoros (جزر القمر)","km","269","+...-..-....."],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)","cd","243","+...(...)...-..."],["Congo (Republic) (Congo-Brazzaville)","cg","242","+...-..-...-...."],["Cook Islands","ck","682","+...-..-..."],["Costa Rica","cr","506","+... ....-...."],["Côte d’Ivoire","ci","225","+...-..-...-..."],["Croatia (Hrvatska)","hr","385","+...-..-...-..."],["Cuba","cu","53","+..-.-...-...."],["Curaçao","cw","599","+...-...-....",0],["Cyprus (Κύπρος)","cy","357","+...-..-...-..."],["Czech Republic (Česká republika)","cz","420","+...(...)...-..."],["Denmark (Danmark)","dk","45","+.. .. .. .. .."],["Djibouti","dj","253","+...-..-..-..-.."],["Dominica","dm","1767","+.(...)...-...."],["Dominican Republic (República Dominicana)","do","1","+.(...)...-....",2,["809","829","849"]],["Ecuador","ec","593","+...-.-...-...."],["Egypt (مصر)","eg","20","+..(...)...-...."],["El Salvador","sv","503","+... ....-...."],["Equatorial Guinea (Guinea Ecuatorial)","gq","240","+...-..-...-...."],["Eritrea","er","291","+...-.-...-..."],["Estonia (Eesti)","ee","372","+...-...-...."],["Ethiopia","et","251","+...-..-...-...."],["Falkland Islands (Islas Malvinas)","fk","500","+...-....."],["Faroe Islands (Føroyar)","fo","298","+...-...-..."],["Fiji","fj","679","+...-..-....."],["Finland (Suomi)","fi","358","+... .. .... ...."],["France","fr","33","+.. . .. .. .. .."],["French Guiana (Guyane française)","gf","594","+...-.....-...."],["French Polynesia (Polynésie française)","pf","689","+...-..-..-.."],["French Southern and Antarctic Lands","tf","262",""],["Gabon","ga","241","+...-.-..-..-.."],["Gambia","gm","220","+...(...)..-.."],["Georgia (საქართველო)","ge","995","+...(...)...-..."],["Germany (Deutschland)","de","49","+.. ... ......."],["Ghana (Gaana)","gh","233","+...(...)...-..."],["Gibraltar","gi","350","+...-...-....."],["Greece (Ελλάδα)","gr","30","+..(...)...-...."],["Greenland (Kalaallit Nunaat)","gl","299","+...-..-..-.."],["Grenada","gd","1473","+.(...)...-...."],["Guadeloupe","gp","590","",0],["Guam","gu","1671","+.(...)...-...."],["Guatemala","gt","502","+... ....-...."],["Guernsey","gg","44",""],["Guinea (Guinée)","gn","224","+...-..-...-..."],["Guinea-Bissau (Guiné Bissau)","gw","245","+...-.-......"],["Guyana","gy","592","+...-...-...."],["Haiti","ht","509","+... ....-...."],["Heard Island and McDonald Islands","hm","672",""],["Honduras","hn","504","+...-....-...."],["Hong Kong (香港)","hk","852","+... .... ...."],["Hungary (Magyarország)","hu","36","+..(...)...-..."],["Iceland (Ísland)","is","354","+... ... ...."],["India (भारत)","in","91","+.. .....-....."],["Indonesia","id","62","+..-..-...-.."],["Iran (ایران)","ir","98","+..(...)...-...."],["Iraq (العراق)","iq","964","+...(...)...-...."],["Ireland","ie","353","+... .. ......."],["Isle of Man","im","44",""],["Israel (ישראל)","il","972","+...-.-...-...."],["Italy (Italia)","it","39","+.. ... ......",0],["Jamaica","jm","1876","+.(...)...-...."],["Japan (日本)","jp","81","+.. ... .. ...."],["Jersey","je","44",""],["Jordan (الأردن)","jo","962","+...-.-....-...."],["Kazakhstan (Казахстан)","kz","7","+. ... ...-..-..",1],["Kenya","ke","254","+...-...-......"],["Kiribati","ki","686","+...-..-..."],["Kosovo","xk","383",""],["Kuwait (الكويت)","kw","965","+...-....-...."],["Kyrgyzstan (Кыргызстан)","kg","996","+...(...)...-..."],["Laos (ລາວ)","la","856","+...-..-...-..."],["Latvia (Latvija)","lv","371","+...-..-...-..."],["Lebanon (لبنان)","lb","961","+...-.-...-..."],["Lesotho","ls","266","+...-.-...-...."],["Liberia","lr","231","+...-..-...-..."],["Libya (ليبيا)","ly","218","+...-..-...-..."],["Liechtenstein","li","423","+...(...)...-...."],["Lithuania (Lietuva)","lt","370","+...(...)..-..."],["Luxembourg","lu","352","+...(...)...-..."],["Macau (澳門)","mo","853","+...-....-...."],["Macedonia (FYROM) (Македонија)","mk","389","+...-..-...-..."],["Madagascar (Madagasikara)","mg","261","+...-..-..-....."],["Malawi","mw","265","+...-.-....-...."],["Malaysia","my","60","+.. ..-....-...."],["Maldives","mv","960","+...-...-...."],["Mali","ml","223","+...-..-..-...."],["Malta","mt","356","+...-....-...."],["Marshall Islands","mh","692","+...-...-...."],["Martinique","mq","596","+...(...)..-..-.."],["Mauritania (موريتانيا)","mr","222","+...-..-..-...."],["Mauritius (Moris)","mu","230","+...-...-...."],["Mayotte","yt","262",""],["Mexico (México)","mx","52","+..-..-..-...."],["Micronesia","fm","691","+...-...-...."],["Moldova (Republica Moldova)","md","373","+...-....-...."],["Monaco","mc","377","+...-..-...-..."],["Mongolia (Монгол)","mn","976","+...-..-..-...."],["Montenegro (Crna Gora)","me","382","+...-..-...-..."],["Montserrat","ms","1664","+.(...)...-...."],["Morocco (المغرب)","ma","212","+...-..-....-..."],["Mozambique (Moçambique)","mz","258","+...-..-...-..."],["Myanmar (Burma) (မြန်မာ)","mm","95","+..-...-..."],["Namibia (Namibië)","na","264","+...-..-...-...."],["Nauru","nr","674","+...-...-...."],["Nepal (नेपाल)","np","977","+...-..-...-..."],["Netherlands (Nederland)","nl","31","+.. .. ........"],["New Caledonia (Nouvelle-Calédonie)","nc","687","+...-..-...."],["New Zealand","nz","64","+.. ...-...-...."],["Nicaragua","ni","505","+...-....-...."],["Niger (Nijar)","ne","227","+...-..-..-...."],["Nigeria","ng","234","+...-..-...-.."],["Niue","nu","683","+...-...."],["Norfolk Island","nf","672","+...-...-..."],["North Korea (조선 민주주의 인민 공화국)","kp","850","+...-...-..."],["Northern Mariana Islands","mp","1670","+.(...)...-...."],["Norway (Norge)","no","47","+.. ... .. ..."],["Oman (عُمان)","om","968","+...-..-...-..."],["Pakistan (پاکستان)","pk","92","+.. ...-......."],["Palau","pw","680","+...-...-...."],["Palestine (فلسطين)","ps","970","+...-..-...-...."],["Panama (Panamá)","pa","507","+...-...-...."],["Papua New Guinea","pg","675","+...(...)..-..."],["Paraguay","py","595","+...(...)...-..."],["Peru (Perú)","pe","51","+..(...)...-..."],["Philippines","ph","63","+.. ... ...."],["Pitcairn Islands","pn","64",""],["Poland (Polska)","pl","48","+.. ...-...-..."],["Portugal","pt","351","+...-..-...-...."],["Puerto Rico","pr","1","+. (...) ...-....",3,["787","939"]],["Qatar (قطر)","qa","974","+...-....-...."],["Réunion (La Réunion)","re","262","+...-.....-...."],["Romania (România)","ro","40","+..-..-...-...."],["Russia (Россия)","ru","7","+. ... ...-..-..",0],["Rwanda","rw","250","+...(...)...-..."],["Saint Barthélemy (Saint-Barthélemy)","bl","590","",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1869","+.(...)...-...."],["Saint Lucia","lc","1758","+.(...)...-...."],["Saint Martin (Saint-Martin (partie française))","mf","590","",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)","pm","508"],["Saint Vincent and the Grenadines","vc","1784","+.(...)...-...."],["Samoa","ws","685","+...-..-...."],["San Marino","sm","378","+...-....-......"],["São Tomé and Príncipe (São Tomé e Príncipe)","st","239","+...-..-....."],["Saudi Arabia (المملكة العربية السعودية)","sa","966","+...-..-...-...."],["Senegal (Sénégal)","sn","221","+...-..-...-...."],["Serbia (Србија)","rs","381","+...-..-...-...."],["Seychelles","sc","248","+...-.-...-..."],["Sierra Leone","sl","232","+...-..-......"],["Singapore","sg","65","+.. ....-...."],["Sint Maarten","sx","1721","+.(...)...-...."],["Slovakia (Slovensko)","sk","421","+...(...)...-..."],["Slovenia (Slovenija)","si","386","+...-..-...-..."],["Solomon Islands","sb","677","+...-....."],["Somalia (Soomaaliya)","so","252","+...-.-...-..."],["South Africa","za","27","+..-..-...-...."],["South Georgia and the South Sandwich Islands","gs","500",""],["South Korea (대한민국)","kr","82","+..-..-...-...."],["South Sudan (جنوب السودان)","ss","211","+...-..-...-...."],["Spain (España)","es","34","+.. ... ... ..."],["Sri Lanka (ශ්රී ලංකාව)","lk","94","+..-..-...-...."],["Sudan (السودان)","sd","249","+...-..-...-...."],["Suriname","sr","597","+...-...-..."],["Svalbard and Jan Mayen","sj","47",""],["Swaziland","sz","268","+...-..-..-...."],["Sweden (Sverige)","se","46","+.. .. ... .. .."],["Switzerland (Schweiz)","ch","41","+.. .. ... .. .."],["Syria (سوريا)","sy","963","+...-..-....-..."],["Taiwan (台灣)","tw","886","+...-....-...."],["Tajikistan","tj","992","+...-..-...-...."],["Tanzania","tz","255","+...-..-...-...."],["Thailand (ไทย)","th","66","+..-..-...-..."],["Timor-Leste","tl","670","+...-...-...."],["Togo","tg","228","+...-..-...-..."],["Tokelau","tk","690","+...-...."],["Tonga","to","676","+...-....."],["Trinidad and Tobago","tt","1868","+.(...)...-...."],["Tunisia (تونس)","tn","216","+...-..-...-..."],["Turkey (Türkiye)","tr","90","+.. ... ... .. .."],["Turkmenistan","tm","993","+...-.-...-...."],["Turks and Caicos Islands","tc","1649","+.(...)...-...."],["Tuvalu","tv","688","+...-....."],["U.S. Virgin Islands","vi","1340","+.(...)...-...."],["Uganda","ug","256","+...(...)...-..."],["Ukraine (Україна)","ua","380","+...(..)...-..-.."],["United Arab Emirates (الإمارات العربية المتحدة)","ae","971","+...-.-...-...."],["United Kingdom","gb","44","+.. .... ......"],["United States","us","1","+. (...) ...-....",0],["United States Minor Outlying Islands","um","1","",2],["Uruguay","uy","598","+...-.-...-..-.."],["Uzbekistan (Oʻzbekiston)","uz","998","+...-..-...-...."],["Vanuatu","vu","678","+...-....."],["Vatican City (Città del Vaticano)","va","39","+.. .. .... ....",1],["Venezuela","ve","58","+..(...)...-...."],["Vietnam (Việt Nam)","vn","84","+..-..-....-..."],["Wallis and Futuna","wf","681","+...-..-...."],["Western Sahara","eh","212","+...-..-...."],["Yemen (اليمن)","ye","967","+...-.-...-..."],["Zambia","zm","260","+...-..-...-...."],["Zimbabwe","zw","263","+...-.-......"]],u={},f={},c=function(C,p,y){p in u||(u[p]=[]);var S=y||0;u[p][S]=C},n=0;n<i.length;n++){var r=i[n];if(i[n]={name:r[0],iso2:r[1],dialCode:r[2],priority:r[4]||0},r[3]&&(i[n].format=r[3]),r[5]){i[n].hasAreaCodes=!0;for(var d=0;d<r[5].length;d++){var g=r[2]+r[5][d];c(r[1],g)}}f[i[n].iso2]=n,c(r[1],r[2],r[4])}return j={allCountries:i,iso2Lookup:f,allCountryCodes:u},j}var ae=ee();function q(i){return i.toUpperCase().replace(/./g,u=>String.fromCodePoint(127397+u.charCodeAt(0)))}function re({value:i,onChange:u,selectedCountry:f,onCountryChange:c,placeholder:n="Número de teléfono",disabled:r=!1,className:d,inputClassName:g,countryClassName:C}){const[p,y]=m.useState([]),[S,w]=m.useState(null),[k,P]=m.useState("");m.useEffect(()=>{const o=ae.allCountries.map(b=>({name:b.name,iso2:b.iso2,dialCode:b.dialCode}));y(o),w(o[0])},[]);const _=p.find(o=>o.iso2===f)||S||p[0]||null,A=i!==void 0?i:k,x=o=>{if(c)c(o);else{const b=p.find(I=>I.iso2===o)||null;w(b)}},M=o=>{const b=o.replace(/\D/g,"");u?u(b):P(b)};return h.jsxs("div",{className:`my-phone ${d??""}`,children:[h.jsxs("div",{className:"my-phone__country",children:[_&&h.jsxs("div",{className:`my-phone__selected ${C??""}`,children:[h.jsx("span",{className:"flag",children:q(_.iso2)}),h.jsxs("span",{className:"code",children:["+",_.dialCode]}),h.jsx("span",{className:"arrow",children:"▾"})]}),h.jsx("select",{className:"my-phone__select",value:_?.iso2,onChange:o=>x(o.target.value),disabled:r,children:p.map(o=>h.jsxs("option",{value:o.iso2,children:[q(o.iso2)," ",o.name," +",o.dialCode]},o.iso2))})]}),h.jsx("input",{type:"tel",className:g,value:A,onChange:o=>M(o.target.value),placeholder:n,disabled:r})]})}return re}));
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "my-phone-input-global",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "dist/my-phone.cjs.js",
|
|
5
|
+
"module": "dist/my-phone.es.js",
|
|
6
|
+
"types": "dist/MyPhone.d.ts",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"keywords": ["phone", "input", "flags", "typescript"],
|
|
12
|
+
"author": "Alejandro Rodríguez <aprendisajedeprogramacion0321@gmail.com>",
|
|
13
|
+
"scripts": {
|
|
14
|
+
"dev": "vite",
|
|
15
|
+
"build": "tsc && vite build",
|
|
16
|
+
"preview": "vite preview"
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"react": "^18.0.0",
|
|
22
|
+
"react-dom": "^18.0.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/react": "^19.2.13",
|
|
26
|
+
"@types/react-dom": "^19.2.3",
|
|
27
|
+
"typescript": "~5.9.3",
|
|
28
|
+
"vite": "^7.2.4",
|
|
29
|
+
"@vitejs/plugin-react": "^4.0.0"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"country-telephone-data": "^0.6.3",
|
|
33
|
+
"react": "^19.2.4",
|
|
34
|
+
"react-dom": "^19.2.4"
|
|
35
|
+
}
|
|
36
|
+
}
|