telpick 1.0.6 → 1.0.8
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.
Potentially problematic release.
This version of telpick might be problematic. Click here for more details.
- package/dist/assets/country-code.json +94 -0
- package/dist/assets/flags/ad.webp +0 -0
- package/dist/assets/flags/ae.webp +0 -0
- package/dist/assets/flags/af.png +0 -0
- package/dist/assets/flags/ag.webp +0 -0
- package/dist/assets/flags/ai.webp +0 -0
- package/dist/assets/flags/al.webp +0 -0
- package/dist/assets/flags/am.webp +0 -0
- package/dist/assets/flags/ao.webp +0 -0
- package/dist/assets/flags/aq.webp +0 -0
- package/dist/assets/flags/ar.webp +0 -0
- package/dist/assets/flags/as.webp +0 -0
- package/dist/assets/flags/at.webp +0 -0
- package/dist/assets/flags/au.webp +0 -0
- package/dist/assets/flags/aw.webp +0 -0
- package/dist/assets/flags/ax.webp +0 -0
- package/dist/assets/flags/az.webp +0 -0
- package/dist/assets/flags/ba.webp +0 -0
- package/dist/assets/flags/bb.webp +0 -0
- package/dist/assets/flags/bd.webp +0 -0
- package/dist/assets/flags/be.webp +0 -0
- package/dist/assets/flags/bf.webp +0 -0
- package/dist/assets/flags/bg.webp +0 -0
- package/dist/assets/flags/bh.webp +0 -0
- package/dist/assets/flags/bi.webp +0 -0
- package/dist/assets/flags/bj.webp +0 -0
- package/dist/assets/flags/bl.webp +0 -0
- package/dist/assets/flags/bm.webp +0 -0
- package/dist/assets/flags/bn.webp +0 -0
- package/dist/assets/flags/bo.webp +0 -0
- package/dist/assets/flags/bq.webp +0 -0
- package/dist/assets/flags/br.webp +0 -0
- package/dist/assets/flags/bs.webp +0 -0
- package/dist/assets/flags/bt.webp +0 -0
- package/dist/assets/flags/bv.webp +0 -0
- package/dist/assets/flags/bw.webp +0 -0
- package/dist/assets/flags/by.webp +0 -0
- package/dist/assets/flags/bz.webp +0 -0
- package/dist/assets/flags/ca.webp +0 -0
- package/dist/assets/flags/cc.webp +0 -0
- package/dist/assets/flags/cd.webp +0 -0
- package/dist/assets/flags/cf.webp +0 -0
- package/dist/assets/flags/cg.webp +0 -0
- package/dist/assets/flags/ch.webp +0 -0
- package/dist/assets/flags/ci.webp +0 -0
- package/dist/assets/flags/ck.webp +0 -0
- package/dist/assets/flags/cl.webp +0 -0
- package/dist/assets/flags/cm.webp +0 -0
- package/dist/assets/flags/cn.webp +0 -0
- package/dist/assets/flags/co.webp +0 -0
- package/dist/assets/flags/cr.webp +0 -0
- package/dist/assets/flags/cu.webp +0 -0
- package/dist/assets/flags/cv.webp +0 -0
- package/dist/assets/flags/cw.webp +0 -0
- package/dist/assets/flags/cx.webp +0 -0
- package/dist/assets/flags/cy.webp +0 -0
- package/dist/assets/flags/cz.webp +0 -0
- package/dist/assets/flags/de.webp +0 -0
- package/dist/assets/flags/dj.webp +0 -0
- package/dist/assets/flags/dk.webp +0 -0
- package/dist/assets/flags/dm.webp +0 -0
- package/dist/assets/flags/do.webp +0 -0
- package/dist/assets/flags/dz.webp +0 -0
- package/dist/assets/flags/ec.webp +0 -0
- package/dist/assets/flags/ee.webp +0 -0
- package/dist/assets/flags/eg.webp +0 -0
- package/dist/assets/flags/eh.webp +0 -0
- package/dist/assets/flags/er.webp +0 -0
- package/dist/assets/flags/es.webp +0 -0
- package/dist/assets/flags/et.webp +0 -0
- package/dist/assets/flags/fi.webp +0 -0
- package/dist/assets/flags/fj.webp +0 -0
- package/dist/assets/flags/fk.webp +0 -0
- package/dist/assets/flags/fm.webp +0 -0
- package/dist/assets/flags/fo.webp +0 -0
- package/dist/assets/flags/fr.webp +0 -0
- package/dist/assets/flags/ga.webp +0 -0
- package/dist/assets/flags/gb-eng.webp +0 -0
- package/dist/assets/flags/gb-nir.webp +0 -0
- package/dist/assets/flags/gb-sct.webp +0 -0
- package/dist/assets/flags/gb-wls.webp +0 -0
- package/dist/assets/flags/gb.webp +0 -0
- package/dist/assets/flags/gd.webp +0 -0
- package/dist/assets/flags/ge.webp +0 -0
- package/dist/assets/flags/gf.webp +0 -0
- package/dist/assets/flags/gg.webp +0 -0
- package/dist/assets/flags/gh.webp +0 -0
- package/dist/assets/flags/gi.webp +0 -0
- package/dist/assets/flags/gl.webp +0 -0
- package/dist/assets/flags/gm.webp +0 -0
- package/dist/assets/flags/gn.webp +0 -0
- package/dist/assets/flags/gp.webp +0 -0
- package/dist/assets/flags/gq.webp +0 -0
- package/dist/assets/flags/gr.webp +0 -0
- package/dist/assets/flags/gs.webp +0 -0
- package/dist/assets/flags/gt.webp +0 -0
- package/dist/assets/flags/gu.webp +0 -0
- package/dist/assets/flags/gw.webp +0 -0
- package/dist/assets/flags/gy.webp +0 -0
- package/dist/assets/flags/hk.webp +0 -0
- package/dist/assets/flags/hm.webp +0 -0
- package/dist/assets/flags/hn.webp +0 -0
- package/dist/assets/flags/hr.webp +0 -0
- package/dist/assets/flags/ht.webp +0 -0
- package/dist/assets/flags/hu.webp +0 -0
- package/dist/assets/flags/id.webp +0 -0
- package/dist/assets/flags/ie.webp +0 -0
- package/dist/assets/flags/il.webp +0 -0
- package/dist/assets/flags/im.webp +0 -0
- package/dist/assets/flags/in.webp +0 -0
- package/dist/assets/flags/io.webp +0 -0
- package/dist/assets/flags/iq.webp +0 -0
- package/dist/assets/flags/ir.webp +0 -0
- package/dist/assets/flags/is.webp +0 -0
- package/dist/assets/flags/it.webp +0 -0
- package/dist/assets/flags/je.webp +0 -0
- package/dist/assets/flags/jm.webp +0 -0
- package/dist/assets/flags/jo.webp +0 -0
- package/dist/assets/flags/jp.webp +0 -0
- package/dist/assets/flags/ke.webp +0 -0
- package/dist/assets/flags/kg.webp +0 -0
- package/dist/assets/flags/kh.webp +0 -0
- package/dist/assets/flags/ki.webp +0 -0
- package/dist/assets/flags/km.webp +0 -0
- package/dist/assets/flags/kn.webp +0 -0
- package/dist/assets/flags/kp.webp +0 -0
- package/dist/assets/flags/kr.webp +0 -0
- package/dist/assets/flags/kw.webp +0 -0
- package/dist/assets/flags/ky.webp +0 -0
- package/dist/assets/flags/kz.webp +0 -0
- package/dist/assets/flags/la.webp +0 -0
- package/dist/assets/flags/lb.webp +0 -0
- package/dist/assets/flags/lc.webp +0 -0
- package/dist/assets/flags/li.webp +0 -0
- package/dist/assets/flags/lista.txt +0 -0
- package/dist/assets/flags/lk.webp +0 -0
- package/dist/assets/flags/lr.webp +0 -0
- package/dist/assets/flags/ls.webp +0 -0
- package/dist/assets/flags/lt.webp +0 -0
- package/dist/assets/flags/lu.webp +0 -0
- package/dist/assets/flags/lv.webp +0 -0
- package/dist/assets/flags/ly.webp +0 -0
- package/dist/assets/flags/ma.webp +0 -0
- package/dist/assets/flags/mc.webp +0 -0
- package/dist/assets/flags/md.webp +0 -0
- package/dist/assets/flags/me.webp +0 -0
- package/dist/assets/flags/mf.webp +0 -0
- package/dist/assets/flags/mg.webp +0 -0
- package/dist/assets/flags/mh.webp +0 -0
- package/dist/assets/flags/mk.webp +0 -0
- package/dist/assets/flags/ml.webp +0 -0
- package/dist/assets/flags/mm.webp +0 -0
- package/dist/assets/flags/mn.webp +0 -0
- package/dist/assets/flags/mo.webp +0 -0
- package/dist/assets/flags/mp.webp +0 -0
- package/dist/assets/flags/mq.webp +0 -0
- package/dist/assets/flags/mr.webp +0 -0
- package/dist/assets/flags/ms.webp +0 -0
- package/dist/assets/flags/mt.webp +0 -0
- package/dist/assets/flags/mu.webp +0 -0
- package/dist/assets/flags/mv.webp +0 -0
- package/dist/assets/flags/mw.webp +0 -0
- package/dist/assets/flags/mx.webp +0 -0
- package/dist/assets/flags/my.webp +0 -0
- package/dist/assets/flags/mz.webp +0 -0
- package/dist/assets/flags/na.webp +0 -0
- package/dist/assets/flags/nc.webp +0 -0
- package/dist/assets/flags/ne.webp +0 -0
- package/dist/assets/flags/nf.webp +0 -0
- package/dist/assets/flags/ng.webp +0 -0
- package/dist/assets/flags/ni.webp +0 -0
- package/dist/assets/flags/nl.webp +0 -0
- package/dist/assets/flags/no.webp +0 -0
- package/dist/assets/flags/np.webp +0 -0
- package/dist/assets/flags/nr.webp +0 -0
- package/dist/assets/flags/nu.webp +0 -0
- package/dist/assets/flags/nz.webp +0 -0
- package/dist/assets/flags/om.webp +0 -0
- package/dist/assets/flags/pa.webp +0 -0
- package/dist/assets/flags/pe.webp +0 -0
- package/dist/assets/flags/pf.webp +0 -0
- package/dist/assets/flags/pg.webp +0 -0
- package/dist/assets/flags/ph.webp +0 -0
- package/dist/assets/flags/pk.webp +0 -0
- package/dist/assets/flags/pl.webp +0 -0
- package/dist/assets/flags/pm.webp +0 -0
- package/dist/assets/flags/pn.webp +0 -0
- package/dist/assets/flags/pr.webp +0 -0
- package/dist/assets/flags/ps.webp +0 -0
- package/dist/assets/flags/pt.webp +0 -0
- package/dist/assets/flags/pw.webp +0 -0
- package/dist/assets/flags/py.webp +0 -0
- package/dist/assets/flags/qa.webp +0 -0
- package/dist/assets/flags/re.webp +0 -0
- package/dist/assets/flags/ro.webp +0 -0
- package/dist/assets/flags/rs.webp +0 -0
- package/dist/assets/flags/ru.webp +0 -0
- package/dist/assets/flags/rw.webp +0 -0
- package/dist/assets/flags/sa.webp +0 -0
- package/dist/assets/flags/sb.webp +0 -0
- package/dist/assets/flags/sc.webp +0 -0
- package/dist/assets/flags/sd.webp +0 -0
- package/dist/assets/flags/se (1).webp +0 -0
- package/dist/assets/flags/se.webp +0 -0
- package/dist/assets/flags/sg.webp +0 -0
- package/dist/assets/flags/sh.webp +0 -0
- package/dist/assets/flags/si.webp +0 -0
- package/dist/assets/flags/sj.webp +0 -0
- package/dist/assets/flags/sk.webp +0 -0
- package/dist/assets/flags/sl.webp +0 -0
- package/dist/assets/flags/sm.webp +0 -0
- package/dist/assets/flags/sn.webp +0 -0
- package/dist/assets/flags/so.webp +0 -0
- package/dist/assets/flags/sr.webp +0 -0
- package/dist/assets/flags/ss.webp +0 -0
- package/dist/assets/flags/st.webp +0 -0
- package/dist/assets/flags/sv.webp +0 -0
- package/dist/assets/flags/sx.webp +0 -0
- package/dist/assets/flags/sy.webp +0 -0
- package/dist/assets/flags/sz.webp +0 -0
- package/dist/assets/flags/tc.webp +0 -0
- package/dist/assets/flags/td.webp +0 -0
- package/dist/assets/flags/tf.webp +0 -0
- package/dist/assets/flags/tg.webp +0 -0
- package/dist/assets/flags/th.webp +0 -0
- package/dist/assets/flags/tj.webp +0 -0
- package/dist/assets/flags/tk.webp +0 -0
- package/dist/assets/flags/tl.webp +0 -0
- package/dist/assets/flags/tm.webp +0 -0
- package/dist/assets/flags/tn.webp +0 -0
- package/dist/assets/flags/to.webp +0 -0
- package/dist/assets/flags/tr.webp +0 -0
- package/dist/assets/flags/tt.webp +0 -0
- package/dist/assets/flags/tv.webp +0 -0
- package/dist/assets/flags/tw.webp +0 -0
- package/dist/assets/flags/tz.webp +0 -0
- package/dist/assets/flags/ua.webp +0 -0
- package/dist/assets/flags/ug.webp +0 -0
- package/dist/assets/flags/um.webp +0 -0
- package/dist/assets/flags/us.webp +0 -0
- package/dist/assets/flags/uy.webp +0 -0
- package/dist/assets/flags/uz.webp +0 -0
- package/dist/assets/flags/va.webp +0 -0
- package/dist/assets/flags/vc.webp +0 -0
- package/dist/assets/flags/ve.webp +0 -0
- package/dist/assets/flags/vg.webp +0 -0
- package/dist/assets/flags/vi.webp +0 -0
- package/dist/assets/flags/vn.webp +0 -0
- package/dist/assets/flags/vu.webp +0 -0
- package/dist/assets/flags/wf.webp +0 -0
- package/dist/assets/flags/ws.webp +0 -0
- package/dist/assets/flags/xk.webp +0 -0
- package/dist/assets/flags/ye.webp +0 -0
- package/dist/assets/flags/yt.webp +0 -0
- package/dist/assets/flags/za.webp +0 -0
- package/dist/assets/flags/zm.webp +0 -0
- package/dist/assets/flags/zw.webp +0 -0
- package/dist/telpick.es.js +642 -82
- package/dist/telpick.umd.js +1 -0
- package/dist/telpick.vue.es.js +22 -19
- package/package.json +3 -2
- package/src/telpick.js +16 -6
package/dist/telpick.es.js
CHANGED
|
@@ -1,57 +1,617 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const A = [
|
|
2
|
+
{
|
|
3
|
+
country: "Afganistán",
|
|
4
|
+
code: "+93",
|
|
5
|
+
flag: "/flags/af.png",
|
|
6
|
+
country_code: "AF"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
country: "Albania",
|
|
10
|
+
code: "+355",
|
|
11
|
+
flag: "/flags/al.webp",
|
|
12
|
+
country_code: "AL"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
country: "Alemania",
|
|
16
|
+
code: "+49",
|
|
17
|
+
flag: "/flags/de.webp",
|
|
18
|
+
country_code: "DE"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
country: "Andorra",
|
|
22
|
+
code: "+376",
|
|
23
|
+
flag: "/flags/ad.webp",
|
|
24
|
+
country_code: "AD"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
country: "Antigua y Barbuda",
|
|
28
|
+
code: "+1",
|
|
29
|
+
flag: "/flags/ag.webp",
|
|
30
|
+
country_code: "AG"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
country: "Arabia Saudita",
|
|
34
|
+
code: "+966",
|
|
35
|
+
flag: "/flags/sa.webp",
|
|
36
|
+
country_code: "SA"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
country: "Argentina",
|
|
40
|
+
code: "+54",
|
|
41
|
+
flag: "/flags/ar.webp",
|
|
42
|
+
country_code: "AR"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
country: "Australia",
|
|
46
|
+
code: "+61",
|
|
47
|
+
flag: "/flags/au.webp",
|
|
48
|
+
country_code: "AU"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
country: "Austria",
|
|
52
|
+
code: "+43",
|
|
53
|
+
flag: "/flags/at.webp",
|
|
54
|
+
country_code: "AT"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
country: "Bahamas",
|
|
58
|
+
code: "+1",
|
|
59
|
+
flag: "/flags/bs.webp",
|
|
60
|
+
country_code: "BS"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
country: "Bangladés",
|
|
64
|
+
code: "+880",
|
|
65
|
+
flag: "/flags/bd.webp",
|
|
66
|
+
country_code: "BD"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
country: "Barbados",
|
|
70
|
+
code: "+1",
|
|
71
|
+
flag: "/flags/bb.webp",
|
|
72
|
+
country_code: "BB"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
country: "Bélgica",
|
|
76
|
+
code: "+32",
|
|
77
|
+
flag: "/flags/be.webp",
|
|
78
|
+
country_code: "BE"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
country: "Belice",
|
|
82
|
+
code: "+501",
|
|
83
|
+
flag: "/flags/bz.webp",
|
|
84
|
+
country_code: "BZ"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
country: "Bielorrusia",
|
|
88
|
+
code: "+375",
|
|
89
|
+
flag: "/flags/by.webp",
|
|
90
|
+
country_code: "BY"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
country: "Bolivia",
|
|
94
|
+
code: "+591",
|
|
95
|
+
flag: "/flags/bo.webp",
|
|
96
|
+
country_code: "BO"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
country: "Bosnia y Herzegovina",
|
|
100
|
+
code: "+387",
|
|
101
|
+
flag: "/flags/ba.webp",
|
|
102
|
+
country_code: "BA"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
country: "Brasil",
|
|
106
|
+
code: "+55",
|
|
107
|
+
flag: "/flags/br.webp",
|
|
108
|
+
country_code: "BR"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
country: "Bulgaria",
|
|
112
|
+
code: "+359",
|
|
113
|
+
flag: "/flags/bg.webp",
|
|
114
|
+
country_code: "BG"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
country: "Canadá",
|
|
118
|
+
code: "+1",
|
|
119
|
+
flag: "/flags/ca.webp",
|
|
120
|
+
country_code: "CA"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
country: "Chile",
|
|
124
|
+
code: "+56",
|
|
125
|
+
flag: "/flags/cl.webp",
|
|
126
|
+
country_code: "CL"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
country: "China",
|
|
130
|
+
code: "+86",
|
|
131
|
+
flag: "/flags/cn.webp",
|
|
132
|
+
country_code: "CN"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
country: "Colombia",
|
|
136
|
+
code: "+57",
|
|
137
|
+
flag: "/flags/co.webp",
|
|
138
|
+
country_code: "CO"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
country: "Corea del Sur",
|
|
142
|
+
code: "+82",
|
|
143
|
+
flag: "/flags/kr.webp",
|
|
144
|
+
country_code: "KR"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
country: "Costa Rica",
|
|
148
|
+
code: "+506",
|
|
149
|
+
flag: "/flags/cr.webp",
|
|
150
|
+
country_code: "CR"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
country: "Croacia",
|
|
154
|
+
code: "+385",
|
|
155
|
+
flag: "/flags/hr.webp",
|
|
156
|
+
country_code: "HR"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
country: "Cuba",
|
|
160
|
+
code: "+53",
|
|
161
|
+
flag: "/flags/cu.webp",
|
|
162
|
+
country_code: "CU"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
country: "Dinamarca",
|
|
166
|
+
code: "+45",
|
|
167
|
+
flag: "/flags/dk.webp",
|
|
168
|
+
country_code: "DK"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
country: "Dominica",
|
|
172
|
+
code: "+1",
|
|
173
|
+
flag: "/flags/dm.webp",
|
|
174
|
+
country_code: "DM"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
country: "Ecuador",
|
|
178
|
+
code: "+593",
|
|
179
|
+
flag: "/flags/ec.webp",
|
|
180
|
+
country_code: "EC"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
country: "Egipto",
|
|
184
|
+
code: "+20",
|
|
185
|
+
flag: "/flags/eg.webp",
|
|
186
|
+
country_code: "EG"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
country: "El Salvador",
|
|
190
|
+
code: "+503",
|
|
191
|
+
flag: "/flags/sv.webp",
|
|
192
|
+
country_code: "SV"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
country: "España",
|
|
196
|
+
code: "+34",
|
|
197
|
+
flag: "/flags/es.webp",
|
|
198
|
+
country_code: "ES"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
country: "Estados Unidos",
|
|
202
|
+
code: "+1",
|
|
203
|
+
flag: "/flags/us.webp",
|
|
204
|
+
country_code: "US"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
country: "Estonia",
|
|
208
|
+
code: "+372",
|
|
209
|
+
flag: "/flags/ee.webp",
|
|
210
|
+
country_code: "EE"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
country: "Filipinas",
|
|
214
|
+
code: "+63",
|
|
215
|
+
flag: "/flags/ph.webp",
|
|
216
|
+
country_code: "PH"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
country: "Finlandia",
|
|
220
|
+
code: "+358",
|
|
221
|
+
flag: "/flags/fi.webp",
|
|
222
|
+
country_code: "FI"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
country: "Francia",
|
|
226
|
+
code: "+33",
|
|
227
|
+
flag: "/flags/fr.webp",
|
|
228
|
+
country_code: "FR"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
country: "Granada",
|
|
232
|
+
code: "+1",
|
|
233
|
+
flag: "/flags/gd.webp",
|
|
234
|
+
country_code: "GD"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
country: "Grecia",
|
|
238
|
+
code: "+30",
|
|
239
|
+
flag: "/flags/gr.webp",
|
|
240
|
+
country_code: "GR"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
country: "Guatemala",
|
|
244
|
+
code: "+502",
|
|
245
|
+
flag: "/flags/gt.webp",
|
|
246
|
+
country_code: "GT"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
country: "Guyana",
|
|
250
|
+
code: "+592",
|
|
251
|
+
flag: "/flags/gy.webp",
|
|
252
|
+
country_code: "GY"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
country: "Haití",
|
|
256
|
+
code: "+509",
|
|
257
|
+
flag: "/flags/ht.webp",
|
|
258
|
+
country_code: "HT"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
country: "Honduras",
|
|
262
|
+
code: "+504",
|
|
263
|
+
flag: "/flags/hn.webp",
|
|
264
|
+
country_code: "HN"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
country: "Hungría",
|
|
268
|
+
code: "+36",
|
|
269
|
+
flag: "/flags/hu.webp",
|
|
270
|
+
country_code: "HU"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
country: "India",
|
|
274
|
+
code: "+91",
|
|
275
|
+
flag: "/flags/in.webp",
|
|
276
|
+
country_code: "IN"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
country: "Indonesia",
|
|
280
|
+
code: "+62",
|
|
281
|
+
flag: "/flags/id.webp",
|
|
282
|
+
country_code: "ID"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
country: "Irak",
|
|
286
|
+
code: "+964",
|
|
287
|
+
flag: "/flags/iq.webp",
|
|
288
|
+
country_code: "IQ"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
country: "Irlanda",
|
|
292
|
+
code: "+353",
|
|
293
|
+
flag: "/flags/ie.webp",
|
|
294
|
+
country_code: "IE"
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
country: "Islandia",
|
|
298
|
+
code: "+354",
|
|
299
|
+
flag: "/flags/is.webp",
|
|
300
|
+
country_code: "IS"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
country: "Israel",
|
|
304
|
+
code: "+972",
|
|
305
|
+
flag: "/flags/il.webp",
|
|
306
|
+
country_code: "IL"
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
country: "Italia",
|
|
310
|
+
code: "+39",
|
|
311
|
+
flag: "/flags/it.webp",
|
|
312
|
+
country_code: "IT"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
country: "Jamaica",
|
|
316
|
+
code: "+1",
|
|
317
|
+
flag: "/flags/jm.webp",
|
|
318
|
+
country_code: "JM"
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
country: "Japón",
|
|
322
|
+
code: "+81",
|
|
323
|
+
flag: "/flags/jp.webp",
|
|
324
|
+
country_code: "JP"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
country: "Kenia",
|
|
328
|
+
code: "+254",
|
|
329
|
+
flag: "/flags/ke.webp",
|
|
330
|
+
country_code: "KE"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
country: "Letonia",
|
|
334
|
+
code: "+371",
|
|
335
|
+
flag: "/flags/lv.webp",
|
|
336
|
+
country_code: "LV"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
country: "Lituania",
|
|
340
|
+
code: "+370",
|
|
341
|
+
flag: "/flags/lt.webp",
|
|
342
|
+
country_code: "LT"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
country: "Luxemburgo",
|
|
346
|
+
code: "+352",
|
|
347
|
+
flag: "/flags/lu.webp",
|
|
348
|
+
country_code: "LU"
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
country: "Malasia",
|
|
352
|
+
code: "+60",
|
|
353
|
+
flag: "/flags/my.webp",
|
|
354
|
+
country_code: "MY"
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
country: "Malta",
|
|
358
|
+
code: "+356",
|
|
359
|
+
flag: "/flags/mt.webp",
|
|
360
|
+
country_code: "MT"
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
country: "México",
|
|
364
|
+
code: "+52",
|
|
365
|
+
flag: "/flags/mx.webp",
|
|
366
|
+
country_code: "MX"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
country: "Mónaco",
|
|
370
|
+
code: "+377",
|
|
371
|
+
flag: "/flags/mc.webp",
|
|
372
|
+
country_code: "MC"
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
country: "Nicaragua",
|
|
376
|
+
code: "+505",
|
|
377
|
+
flag: "/flags/ni.webp",
|
|
378
|
+
country_code: "NI"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
country: "Nigeria",
|
|
382
|
+
code: "+234",
|
|
383
|
+
flag: "/flags/ng.webp",
|
|
384
|
+
country_code: "NG"
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
country: "Noruega",
|
|
388
|
+
code: "+47",
|
|
389
|
+
flag: "/flags/no.webp",
|
|
390
|
+
country_code: "NO"
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
country: "Nueva Zelanda",
|
|
394
|
+
code: "+64",
|
|
395
|
+
flag: "/flags/nz.webp",
|
|
396
|
+
country_code: "NZ"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
country: "Países Bajos",
|
|
400
|
+
code: "+31",
|
|
401
|
+
flag: "/flags/nl.webp",
|
|
402
|
+
country_code: "NL"
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
country: "Pakistán",
|
|
406
|
+
code: "+92",
|
|
407
|
+
flag: "/flags/pk.webp",
|
|
408
|
+
country_code: "PK"
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
country: "Panamá",
|
|
412
|
+
code: "+507",
|
|
413
|
+
flag: "/flags/pa.webp",
|
|
414
|
+
country_code: "PA"
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
country: "Paraguay",
|
|
418
|
+
code: "+595",
|
|
419
|
+
flag: "/flags/py.webp",
|
|
420
|
+
country_code: "PY"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
country: "Perú",
|
|
424
|
+
code: "+51",
|
|
425
|
+
flag: "/flags/pe.webp",
|
|
426
|
+
country_code: "PE"
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
country: "Polonia",
|
|
430
|
+
code: "+48",
|
|
431
|
+
flag: "/flags/pl.webp",
|
|
432
|
+
country_code: "PL"
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
country: "Portugal",
|
|
436
|
+
code: "+351",
|
|
437
|
+
flag: "/flags/pt.webp",
|
|
438
|
+
country_code: "PT"
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
country: "Reino Unido",
|
|
442
|
+
code: "+44",
|
|
443
|
+
flag: "/flags/gb.webp",
|
|
444
|
+
country_code: "GB"
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
country: "República Checa",
|
|
448
|
+
code: "+420",
|
|
449
|
+
flag: "/flags/cz.webp",
|
|
450
|
+
country_code: "CZ"
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
country: "República Dominicana",
|
|
454
|
+
code: "+1",
|
|
455
|
+
flag: "/flags/do.webp",
|
|
456
|
+
country_code: "DO"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
country: "Rumanía",
|
|
460
|
+
code: "+40",
|
|
461
|
+
flag: "/flags/ro.webp",
|
|
462
|
+
country_code: "RO"
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
country: "Rusia",
|
|
466
|
+
code: "+7",
|
|
467
|
+
flag: "/flags/ru.webp",
|
|
468
|
+
country_code: "RU"
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
country: "San Cristóbal y Nieves",
|
|
472
|
+
code: "+1",
|
|
473
|
+
flag: "/flags/kn.webp",
|
|
474
|
+
country_code: "KN"
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
country: "San Vicente y las Granadinas",
|
|
478
|
+
code: "+1",
|
|
479
|
+
flag: "/flags/vc.webp",
|
|
480
|
+
country_code: "VC"
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
country: "Santa Lucía",
|
|
484
|
+
code: "+1",
|
|
485
|
+
flag: "/flags/lc.webp",
|
|
486
|
+
country_code: "LC"
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
country: "Singapur",
|
|
490
|
+
code: "+65",
|
|
491
|
+
flag: "/flags/sg.webp",
|
|
492
|
+
country_code: "SG"
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
country: "Sudáfrica",
|
|
496
|
+
code: "+27",
|
|
497
|
+
flag: "/flags/za.webp",
|
|
498
|
+
country_code: "ZA"
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
country: "Suecia",
|
|
502
|
+
code: "+46",
|
|
503
|
+
flag: "/flags/se.webp",
|
|
504
|
+
country_code: "SE"
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
country: "Suiza",
|
|
508
|
+
code: "+41",
|
|
509
|
+
flag: "/flags/ch.webp",
|
|
510
|
+
country_code: "CH"
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
country: "Surinam",
|
|
514
|
+
code: "+597",
|
|
515
|
+
flag: "/flags/sr.webp",
|
|
516
|
+
country_code: "SR"
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
country: "Tailandia",
|
|
520
|
+
code: "+66",
|
|
521
|
+
flag: "/flags/th.webp",
|
|
522
|
+
country_code: "TH"
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
country: "Trinidad y Tobago",
|
|
526
|
+
code: "+1",
|
|
527
|
+
flag: "/flags/tt.webp",
|
|
528
|
+
country_code: "TT"
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
country: "Ucrania",
|
|
532
|
+
code: "+380",
|
|
533
|
+
flag: "/flags/ua.webp",
|
|
534
|
+
country_code: "UA"
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
country: "Uruguay",
|
|
538
|
+
code: "+598",
|
|
539
|
+
flag: "/flags/uy.webp",
|
|
540
|
+
country_code: "UY"
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
country: "Venezuela",
|
|
544
|
+
code: "+58",
|
|
545
|
+
flag: "/flags/ve.webp",
|
|
546
|
+
country_code: "VE"
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
country: "Vietnam",
|
|
550
|
+
code: "+84",
|
|
551
|
+
flag: "/flags/vn.webp",
|
|
552
|
+
country_code: "VN"
|
|
5
553
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
554
|
+
];
|
|
555
|
+
class E {
|
|
556
|
+
constructor({ code: t = null, onChange: d = () => {
|
|
557
|
+
}, styleOverrides: c = {} } = {}) {
|
|
558
|
+
this.code = t, this.onChange = d, this.styleOverrides = c, this.codes = [], this.selectedCode = t, this.isDropdownOpen = !1, this.searchQuery = "", this.container = null, this.dropdown = null, this._outsideHandler = null;
|
|
559
|
+
}
|
|
560
|
+
_getAssetsBase() {
|
|
561
|
+
if (typeof import.meta < "u" && import.meta.url)
|
|
562
|
+
try {
|
|
563
|
+
return new URL("./assets", self.location).href + "/";
|
|
564
|
+
} catch {
|
|
565
|
+
}
|
|
566
|
+
return "";
|
|
567
|
+
}
|
|
568
|
+
async init(t) {
|
|
569
|
+
if (this.container = t, this.codes = [...A].sort((c, a) => c.country.localeCompare(a.country, "es")), this._assetsBase = this._getAssetsBase(), this.code) {
|
|
570
|
+
const c = this.codes.find((a) => a.country_code === this.code);
|
|
11
571
|
c && (this.selectedCode = c.country_code);
|
|
12
572
|
} else {
|
|
13
573
|
const c = [
|
|
14
574
|
async () => {
|
|
15
575
|
try {
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
18
|
-
return this.codes.find((
|
|
576
|
+
const e = await (await fetch("https://ip-api.com/json/?fields=countryCode")).json();
|
|
577
|
+
if (e.countryCode)
|
|
578
|
+
return this.codes.find((r) => r.country_code === e.countryCode);
|
|
19
579
|
} catch {
|
|
20
580
|
}
|
|
21
581
|
return null;
|
|
22
582
|
},
|
|
23
583
|
async () => {
|
|
24
584
|
try {
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
return this.codes.find((
|
|
585
|
+
const e = await (await fetch("https://get.geojs.io/v1/ip/country.json")).json();
|
|
586
|
+
if (e.country)
|
|
587
|
+
return this.codes.find((r) => r.country_code === e.country);
|
|
28
588
|
} catch {
|
|
29
589
|
}
|
|
30
590
|
return null;
|
|
31
591
|
},
|
|
32
592
|
async () => {
|
|
33
593
|
try {
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
-
return this.codes.find((
|
|
594
|
+
const e = await (await fetch("https://ipapi.co/json/")).json();
|
|
595
|
+
if (e.country_code)
|
|
596
|
+
return this.codes.find((r) => r.country_code === e.country_code);
|
|
37
597
|
} catch {
|
|
38
598
|
}
|
|
39
599
|
return null;
|
|
40
600
|
}
|
|
41
601
|
];
|
|
42
|
-
let
|
|
602
|
+
let a = null;
|
|
43
603
|
for (const n of c)
|
|
44
604
|
try {
|
|
45
|
-
if (
|
|
605
|
+
if (a = await Promise.race([
|
|
46
606
|
n(),
|
|
47
|
-
new Promise((
|
|
48
|
-
]),
|
|
607
|
+
new Promise((e) => setTimeout(() => e(null), 3e3))
|
|
608
|
+
]), a)
|
|
49
609
|
break;
|
|
50
610
|
} catch {
|
|
51
611
|
}
|
|
52
|
-
if (!
|
|
612
|
+
if (!a)
|
|
53
613
|
try {
|
|
54
|
-
const n = Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
614
|
+
const n = Intl.DateTimeFormat().resolvedOptions().timeZone, r = {
|
|
55
615
|
"America/Lima": "PE",
|
|
56
616
|
"America/Bogota": "CO",
|
|
57
617
|
"America/Mexico_City": "MX",
|
|
@@ -114,92 +674,92 @@ class _ {
|
|
|
114
674
|
"Africa/Nairobi": "KE",
|
|
115
675
|
"Africa/Lagos": "NG"
|
|
116
676
|
}[n];
|
|
117
|
-
|
|
677
|
+
r && (a = this.codes.find((m) => m.country_code === r));
|
|
118
678
|
} catch {
|
|
119
679
|
}
|
|
120
|
-
if (
|
|
121
|
-
this.selectedCode =
|
|
680
|
+
if (a)
|
|
681
|
+
this.selectedCode = a.country_code;
|
|
122
682
|
else {
|
|
123
|
-
const n = this.codes.find((
|
|
683
|
+
const n = this.codes.find((e) => e.country_code === "CO");
|
|
124
684
|
n && (this.selectedCode = n.country_code);
|
|
125
685
|
}
|
|
126
686
|
}
|
|
127
687
|
this.render();
|
|
128
|
-
const
|
|
129
|
-
|
|
688
|
+
const d = this.codes.find((c) => c.country_code === this.selectedCode);
|
|
689
|
+
d && this.onChange(d), this._setupOutsideClick();
|
|
130
690
|
}
|
|
131
691
|
render() {
|
|
132
692
|
this.container.innerHTML = "";
|
|
133
|
-
const
|
|
134
|
-
|
|
693
|
+
const t = document.createElement("button");
|
|
694
|
+
t.className = "telpick-btn", Object.assign(t.style, this.styleOverrides), t.onclick = () => {
|
|
135
695
|
this.isDropdownOpen = !this.isDropdownOpen, this.render();
|
|
136
696
|
};
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
if (
|
|
697
|
+
const d = document.createElement("div");
|
|
698
|
+
d.className = "telpick-flag";
|
|
699
|
+
const c = this.codes.find((e) => e.country_code === this.selectedCode) || { flag: "", code: "", country: "" };
|
|
700
|
+
if (c.flag) {
|
|
141
701
|
const e = document.createElement("img");
|
|
142
|
-
e.src = "src/assets" +
|
|
702
|
+
e.src = (this._assetsBase || "src/assets") + (c.flag.startsWith("/") ? c.flag : "/" + c.flag), e.className = "w-full h-full object-cover", e.alt = "flag", d.appendChild(e);
|
|
143
703
|
}
|
|
144
|
-
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
const
|
|
148
|
-
if (
|
|
149
|
-
this.dropdown = document.createElement("div"), this.dropdown.className = "telpick-dropdown", this.dropdown.onclick = (
|
|
704
|
+
t.appendChild(d);
|
|
705
|
+
const a = document.createElement("span");
|
|
706
|
+
a.textContent = c.code, t.appendChild(a);
|
|
707
|
+
const n = document.createElement("span");
|
|
708
|
+
if (n.className = "ml-auto", n.textContent = "▼", t.appendChild(n), this.container.appendChild(t), this.isDropdownOpen) {
|
|
709
|
+
this.dropdown = document.createElement("div"), this.dropdown.className = "telpick-dropdown", this.dropdown.onclick = (o) => o.stopPropagation(), this.dropdown.onmousedown = (o) => o.stopPropagation();
|
|
150
710
|
const e = document.createElement("input");
|
|
151
|
-
e.className = "telpick-search", e.type = "text", e.placeholder = "Buscar país...", e.value = this.searchQuery, e.oninput = (
|
|
152
|
-
var
|
|
153
|
-
|
|
154
|
-
const
|
|
711
|
+
e.className = "telpick-search", e.type = "text", e.placeholder = "Buscar país...", e.value = this.searchQuery, e.oninput = (o) => {
|
|
712
|
+
var g;
|
|
713
|
+
o.stopPropagation();
|
|
714
|
+
const l = o.target, y = l.selectionStart || 0, u = l.value;
|
|
155
715
|
this.searchQuery = u;
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
this.selectedCode =
|
|
716
|
+
const i = (g = this.dropdown) == null ? void 0 : g.querySelector("ul");
|
|
717
|
+
i ? (i.innerHTML = "", (this.searchQuery ? this.codes.filter((s) => s.country.toLowerCase().includes(this.searchQuery.toLowerCase())) : this.codes).forEach((s) => {
|
|
718
|
+
const f = document.createElement("li"), C = s.country_code === this.selectedCode && this.selectedCode !== null && this.selectedCode !== void 0;
|
|
719
|
+
f.className = `telpick-item ${C ? "telpick-item-selected" : ""}`, f.onclick = () => {
|
|
720
|
+
this.selectedCode = s.country_code, this.onChange(s), this.isDropdownOpen = !1, this.searchQuery = "", this.render();
|
|
161
721
|
};
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
|
|
722
|
+
const w = document.createElement("div");
|
|
723
|
+
w.className = "telpick-flag";
|
|
724
|
+
const h = document.createElement("img");
|
|
725
|
+
h.src = (this._assetsBase || "src/assets") + (s.flag.startsWith("/") ? s.flag : "/" + s.flag), h.className = "w-full h-full object-cover", h.alt = "flag", w.appendChild(h), f.appendChild(w);
|
|
726
|
+
const b = document.createElement("span");
|
|
727
|
+
b.textContent = s.country, f.appendChild(b);
|
|
728
|
+
const _ = document.createElement("span");
|
|
729
|
+
_.className = "ml-auto", _.textContent = s.code, f.appendChild(_), i.appendChild(f);
|
|
170
730
|
}), requestAnimationFrame(() => {
|
|
171
731
|
if (e) {
|
|
172
732
|
e.focus();
|
|
173
|
-
const
|
|
174
|
-
e.setSelectionRange(
|
|
733
|
+
const s = Math.min(y + 1, u.length);
|
|
734
|
+
e.setSelectionRange(s, s);
|
|
175
735
|
}
|
|
176
736
|
})) : this.render();
|
|
177
|
-
}, e.onclick = (
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
this.selectedCode =
|
|
737
|
+
}, e.onclick = (o) => o.stopPropagation(), e.onmousedown = (o) => o.stopPropagation(), this.dropdown.appendChild(e);
|
|
738
|
+
const r = document.createElement("ul");
|
|
739
|
+
r.style.maxHeight = "130px", r.style.overflowY = "auto", (this.searchQuery ? this.codes.filter((o) => o.country.toLowerCase().includes(this.searchQuery.toLowerCase())) : this.codes).forEach((o) => {
|
|
740
|
+
const l = document.createElement("li"), y = o.country_code === this.selectedCode && this.selectedCode !== null && this.selectedCode !== void 0;
|
|
741
|
+
l.className = `telpick-item ${y ? "telpick-item-selected" : ""}`, l.setAttribute("aria-selected", y), l.onclick = () => {
|
|
742
|
+
this.selectedCode = o.country_code, this.onChange(o), this.isDropdownOpen = !1, this.searchQuery = "", this.render();
|
|
183
743
|
};
|
|
184
744
|
const u = document.createElement("div");
|
|
185
745
|
u.className = "telpick-flag";
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
}), this.dropdown.appendChild(
|
|
746
|
+
const i = document.createElement("img");
|
|
747
|
+
i.src = (this._assetsBase || "src/assets") + (o.flag.startsWith("/") ? o.flag : "/" + o.flag), i.className = "w-full h-full object-cover", i.alt = "flag", u.appendChild(i), l.appendChild(u);
|
|
748
|
+
const g = document.createElement("span");
|
|
749
|
+
g.textContent = o.country, l.appendChild(g);
|
|
750
|
+
const p = document.createElement("span");
|
|
751
|
+
p.className = "ml-auto", p.textContent = o.code, l.appendChild(p), r.appendChild(l);
|
|
752
|
+
}), this.dropdown.appendChild(r), this.container.appendChild(this.dropdown), requestAnimationFrame(() => {
|
|
193
753
|
e && e.focus();
|
|
194
754
|
});
|
|
195
755
|
}
|
|
196
756
|
}
|
|
197
757
|
_setupOutsideClick() {
|
|
198
|
-
this._outsideHandler && document.removeEventListener("click", this._outsideHandler), this._outsideHandler = (
|
|
199
|
-
const
|
|
200
|
-
if (this.isDropdownOpen && this.container &&
|
|
201
|
-
const
|
|
202
|
-
!this.container.contains(
|
|
758
|
+
this._outsideHandler && document.removeEventListener("click", this._outsideHandler), this._outsideHandler = (t) => {
|
|
759
|
+
const d = t.target;
|
|
760
|
+
if (this.isDropdownOpen && this.container && d) {
|
|
761
|
+
const c = this.container.querySelector(".telpick-dropdown");
|
|
762
|
+
!this.container.contains(d) && (!c || !c.contains(d)) && (this.isDropdownOpen = !1, this.render());
|
|
203
763
|
}
|
|
204
764
|
}, document.addEventListener("click", this._outsideHandler, !0);
|
|
205
765
|
}
|
|
@@ -207,7 +767,7 @@ class _ {
|
|
|
207
767
|
this._outsideHandler && document.removeEventListener("mousedown", this._outsideHandler), this.container.innerHTML = "";
|
|
208
768
|
}
|
|
209
769
|
}
|
|
210
|
-
window.Telpick =
|
|
770
|
+
window.Telpick = E;
|
|
211
771
|
export {
|
|
212
|
-
|
|
772
|
+
E as Telpick
|
|
213
773
|
};
|