intl-tel-input 24.3.0 → 24.3.2
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/README.md +5 -5
- package/build/css/demo.css +15 -0
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/intlTelInput.js +16 -8
- package/build/js/intlTelInput.min.js +2 -2
- package/build/js/intlTelInputWithUtils.js +25 -16
- package/build/js/intlTelInputWithUtils.min.js +2 -2
- package/build/js/utils.js +6 -6
- package/package.json +1 -1
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +15 -7
- package/react/build/IntlTelInput.js +15 -7
- package/react/build/IntlTelInputWithUtils.cjs +24 -15
- package/react/build/IntlTelInputWithUtils.js +24 -15
package/build/js/utils.js
CHANGED
|
@@ -518,12 +518,12 @@ function vb(a){for(var b=a.g.toString(),c=a.j.length,d=0;d<c;++d){var e=a.j[d],f
|
|
|
518
518
|
function tb(a){var b=a.g.toString();if(3<=b.length){for(var c=a.ca&&0==a.o.length&&0<x(a.l,20)?u(a.l,20):u(a.l,19),d=c.length,e=0;e<d;++e){var f=c[e];0<a.o.length&&Za(w(f,4))&&!r(f,6)&&!q(f,5)||(0!=a.o.length||a.ca||Za(w(f,4))||r(f,6))&&kb.test(w(f,2))&&a.j.push(f)}nb(a,b);b=vb(a);return 0<b.length?b:mb(a)?wb(a):a.s.toString()}return Y(a,b)}function wb(a){var b=a.g.toString(),c=b.length;if(0<c){for(var d="",e=0;e<c;e++)d=ub(a,b.charAt(e));return a.u?Y(a,d):a.s.toString()}return a.h.toString()}
|
|
519
519
|
function sb(a){var b=a.g.toString(),c=0;if(1!=r(a.l,10))var d=!1;else d=a.g.toString(),d="1"==d.charAt(0)&&"0"!=d.charAt(1)&&"1"!=d.charAt(1);d?(c=1,a.h.g("1").g(" "),a.ca=!0):q(a.l,15)&&(d=new RegExp("^(?:"+r(a.l,15)+")"),d=b.match(d),null!=d&&null!=d[0]&&0<d[0].length&&(a.ca=!0,c=d[0].length,a.h.g(b.substring(0,c))));D(a.g);a.g.g(b.substring(c));return b.substring(0,c)}
|
|
520
520
|
function pb(a){var b=a.ba.toString(),c=new RegExp("^(?:\\+|"+r(a.l,11)+")");c=b.match(c);return null!=c&&null!=c[0]&&0<c[0].length?(a.ca=!0,c=c[0].length,D(a.g),a.g.g(b.substring(c)),D(a.h),a.h.g(b.substring(0,c)),"+"!=b.charAt(0)&&a.h.g(" "),!0):!1}function qb(a){if(0==a.g.h.length)return!1;var b=new C,c=db(a.g,b);if(0==c)return!1;D(a.g);a.g.g(b.toString());b=R(c);"001"==b?a.l=S(a.ga,""+c):b!=a.ka&&(a.l=ib(a,b));a.h.g(""+c).g(" ");a.o="";return!0}
|
|
521
|
-
function ub(a,b){var c=a.v.toString();if(0<=c.substring(a.$).search(a.fa)){var d=c.search(a.fa);b=c.replace(a.fa,b);D(a.v);a.v.g(b);a.$=d;return b.substring(0,a.$+1)}1==a.j.length&&(a.u=!1);a.da="";return a.s.toString()};const Z={FIXED_LINE:0,MOBILE:1,FIXED_LINE_OR_MOBILE:2,TOLL_FREE:3,PREMIUM_RATE:4,SHARED_COST:5,VOIP:6,PERSONAL_NUMBER:7,PAGER:8,UAN:9,VOICEMAIL:10,UNKNOWN:-1};m("intlTelInputUtilsTemp",{});m("intlTelInputUtilsTemp.formatNumberAsYouType",(a,b)=>{try{const c=a.replace(/[^+0-9]/g,""),d=new hb(b);b="";for(let e=0;e<c.length;e++)d.ja=ob(d,c.charAt(e)),b=d.ja;return b}catch
|
|
522
|
-
m("intlTelInputUtilsTemp.formatNumber",(a,b,c)=>{try{const e=J.g(),f=X(e,a,b);var d=W(e,f,-1);return 0==d||4==d?e.format(f,"undefined"===typeof c?0:c):a}catch
|
|
523
|
-
m("intlTelInputUtilsTemp.getNumberType",(a,b)=>{try{const g=J.g(),h=X(g,a,b);var c=bb(g,h),d=Q(g,w(h,1),c);if(null==d)var e=-1;else{var f=P(h);e=ab(f,d)}return e}catch
|
|
524
|
-
m("intlTelInputUtilsTemp.getValidationError",(a,b)=>{try{const c=J.g(),d=X(c,a,b);return W(c,d,-1)}catch(c){return"Invalid country calling code"===c.message?1:3>=a.length||"Phone number too short after IDD"===c.message||"The string supplied is too short to be a phone number"===c.message?2:"The string supplied is too long to be a phone number"===c.message?3:-99}});
|
|
525
|
-
m("intlTelInputUtilsTemp.isValidNumber",(a,b)=>{try{const l=J.g();var c=X(l,a,b),d=bb(l,c);a=l;var e=w(c,1),f=Q(a,e,d);if(null==f||"001"!=d&&e!=cb(a,d))var g=!1;else{var h=P(c);g=-1!=ab(h,f)}return g}catch
|
|
526
|
-
m("intlTelInputUtilsTemp.getCoreNumber",(a,b)=>{try{return r(X(J.g(),a,b),2).toString()}catch
|
|
521
|
+
function ub(a,b){var c=a.v.toString();if(0<=c.substring(a.$).search(a.fa)){var d=c.search(a.fa);b=c.replace(a.fa,b);D(a.v);a.v.g(b);a.$=d;return b.substring(0,a.$+1)}1==a.j.length&&(a.u=!1);a.da="";return a.s.toString()};const Z={FIXED_LINE:0,MOBILE:1,FIXED_LINE_OR_MOBILE:2,TOLL_FREE:3,PREMIUM_RATE:4,SHARED_COST:5,VOIP:6,PERSONAL_NUMBER:7,PAGER:8,UAN:9,VOICEMAIL:10,UNKNOWN:-1};m("intlTelInputUtilsTemp",{});m("intlTelInputUtilsTemp.formatNumberAsYouType",(a,b)=>{try{const c=a.replace(/[^+0-9]/g,""),d=new hb(b);b="";for(let e=0;e<c.length;e++)d.ja=ob(d,c.charAt(e)),b=d.ja;return b}catch{return a}});
|
|
522
|
+
m("intlTelInputUtilsTemp.formatNumber",(a,b,c)=>{try{const e=J.g(),f=X(e,a,b);var d=W(e,f,-1);return 0==d||4==d?e.format(f,"undefined"===typeof c?0:c):a}catch{return a}});m("intlTelInputUtilsTemp.getExampleNumber",(a,b,c,d)=>{try{const l=J.g();a:{var e=l;if(O(a)){var f=T(S(e,a),c);try{if(q(f,6)){var g=r(f,6);var h=gb(e,g,a,!1);break a}}catch(A){}}h=null}return l.format(h,d?0:b?2:1)}catch{return""}});m("intlTelInputUtilsTemp.getExtension",(a,b)=>{try{return r(X(J.g(),a,b),3)}catch{return""}});
|
|
523
|
+
m("intlTelInputUtilsTemp.getNumberType",(a,b)=>{try{const g=J.g(),h=X(g,a,b);var c=bb(g,h),d=Q(g,w(h,1),c);if(null==d)var e=-1;else{var f=P(h);e=ab(f,d)}return e}catch{return-99}});
|
|
524
|
+
m("intlTelInputUtilsTemp.getValidationError",(a,b)=>{if(!b)return 1;try{const c=J.g(),d=X(c,a,b);return W(c,d,-1)}catch(c){return"Invalid country calling code"===c.message?1:3>=a.length||"Phone number too short after IDD"===c.message||"The string supplied is too short to be a phone number"===c.message?2:"The string supplied is too long to be a phone number"===c.message?3:-99}});
|
|
525
|
+
m("intlTelInputUtilsTemp.isValidNumber",(a,b)=>{try{const l=J.g();var c=X(l,a,b),d=bb(l,c);a=l;var e=w(c,1),f=Q(a,e,d);if(null==f||"001"!=d&&e!=cb(a,d))var g=!1;else{var h=P(c);g=-1!=ab(h,f)}return g}catch{return!1}});m("intlTelInputUtilsTemp.isPossibleNumber",(a,b,c)=>{try{const d=J.g(),e=X(d,a,b);if(c){const f=0===W(d,e,Z[c]);if("FIXED_LINE_OR_MOBILE"===c){const g=0===W(d,e,Z.MOBILE),h=0===W(d,e,Z.FIXED_LINE);return g||h||f}return f}return 0===W(d,e,-1)}catch{return!1}});
|
|
526
|
+
m("intlTelInputUtilsTemp.getCoreNumber",(a,b)=>{try{return r(X(J.g(),a,b),2).toString()}catch{return""}});m("intlTelInputUtilsTemp.numberFormat",{E164:0,INTERNATIONAL:1,NATIONAL:2,RFC3966:3});m("intlTelInputUtilsTemp.numberType",Z);m("intlTelInputUtilsTemp.validationError",{IS_POSSIBLE:0,INVALID_COUNTRY_CODE:1,TOO_SHORT:2,TOO_LONG:3,IS_POSSIBLE_LOCAL_ONLY:4,INVALID_LENGTH:5});})();
|
|
527
527
|
const utils = window.intlTelInputUtilsTemp;
|
|
528
528
|
delete window.intlTelInputUtilsTemp;
|
|
529
529
|
export default utils;
|
package/package.json
CHANGED
package/react/README.md
CHANGED
|
@@ -29,7 +29,7 @@ import "intl-tel-input/styles";
|
|
|
29
29
|
|
|
30
30
|
See the [Validation demo](https://github.com/jackocnr/intl-tel-input/blob/master/react/demo/ValidationApp.tsx) for a more fleshed-out example of how to handle validation.
|
|
31
31
|
|
|
32
|
-
A note on the utils script (~260KB): if you're lazy loading the IntlTelInput chunk (and so less worried about filesize) then you can just import IntlTelInput from `"intl-tel-input/reactWithUtils"` instead, to include the utils script. Alternatively, if you use the main `"intl-tel-input/react"` import, then you should couple this with the `utilsScript` initialisation option - you will need to host the [utils.js](https://github.com/jackocnr/intl-tel-input/blob/master/build/js/utils.js) file, and then set the `utilsScript` option to that URL, or alternatively just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@24.3.
|
|
32
|
+
A note on the utils script (~260KB): if you're lazy loading the IntlTelInput chunk (and so less worried about filesize) then you can just import IntlTelInput from `"intl-tel-input/reactWithUtils"` instead, to include the utils script. Alternatively, if you use the main `"intl-tel-input/react"` import, then you should couple this with the `utilsScript` initialisation option - you will need to host the [utils.js](https://github.com/jackocnr/intl-tel-input/blob/master/build/js/utils.js) file, and then set the `utilsScript` option to that URL, or alternatively just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@24.3.2/build/js/utils.js"`.
|
|
33
33
|
|
|
34
34
|
## Props
|
|
35
35
|
Here's a list of all of the current props you can pass to the IntlTelInput react component.
|
|
@@ -2634,12 +2634,14 @@ var Iti = class {
|
|
|
2634
2634
|
}
|
|
2635
2635
|
//* Update the input padding to make space for the selected country/dial code.
|
|
2636
2636
|
_updateInputPadding() {
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
this.
|
|
2641
|
-
|
|
2642
|
-
|
|
2637
|
+
if (this.selectedCountry) {
|
|
2638
|
+
const selectedCountryWidth = this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth();
|
|
2639
|
+
const inputPadding = selectedCountryWidth + 6;
|
|
2640
|
+
if (this.showSelectedCountryOnLeft) {
|
|
2641
|
+
this.telInput.style.paddingLeft = `${inputPadding}px`;
|
|
2642
|
+
} else {
|
|
2643
|
+
this.telInput.style.paddingRight = `${inputPadding}px`;
|
|
2644
|
+
}
|
|
2643
2645
|
}
|
|
2644
2646
|
}
|
|
2645
2647
|
//* Update the maximum valid number length for the currently selected country.
|
|
@@ -2987,6 +2989,9 @@ var Iti = class {
|
|
|
2987
2989
|
}
|
|
2988
2990
|
//* Validate the input val
|
|
2989
2991
|
isValidNumber() {
|
|
2992
|
+
if (!this.selectedCountryData.iso2) {
|
|
2993
|
+
return false;
|
|
2994
|
+
}
|
|
2990
2995
|
const val = this._getFullNumber();
|
|
2991
2996
|
const alphaCharPosition = val.search(/\p{L}/u);
|
|
2992
2997
|
if (alphaCharPosition > -1) {
|
|
@@ -3002,6 +3007,9 @@ var Iti = class {
|
|
|
3002
3007
|
}
|
|
3003
3008
|
//* Validate the input val (precise)
|
|
3004
3009
|
isValidNumberPrecise() {
|
|
3010
|
+
if (!this.selectedCountryData.iso2) {
|
|
3011
|
+
return false;
|
|
3012
|
+
}
|
|
3005
3013
|
const val = this._getFullNumber();
|
|
3006
3014
|
const alphaCharPosition = val.search(/\p{L}/u);
|
|
3007
3015
|
if (alphaCharPosition > -1) {
|
|
@@ -3091,7 +3099,7 @@ var intlTelInput = Object.assign(
|
|
|
3091
3099
|
//* A map from instance ID to instance object.
|
|
3092
3100
|
instances: {},
|
|
3093
3101
|
loadUtils,
|
|
3094
|
-
version: "24.3.
|
|
3102
|
+
version: "24.3.2"
|
|
3095
3103
|
}
|
|
3096
3104
|
);
|
|
3097
3105
|
var intl_tel_input_default = intlTelInput;
|
|
@@ -2598,12 +2598,14 @@ var Iti = class {
|
|
|
2598
2598
|
}
|
|
2599
2599
|
//* Update the input padding to make space for the selected country/dial code.
|
|
2600
2600
|
_updateInputPadding() {
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
this.
|
|
2605
|
-
|
|
2606
|
-
|
|
2601
|
+
if (this.selectedCountry) {
|
|
2602
|
+
const selectedCountryWidth = this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth();
|
|
2603
|
+
const inputPadding = selectedCountryWidth + 6;
|
|
2604
|
+
if (this.showSelectedCountryOnLeft) {
|
|
2605
|
+
this.telInput.style.paddingLeft = `${inputPadding}px`;
|
|
2606
|
+
} else {
|
|
2607
|
+
this.telInput.style.paddingRight = `${inputPadding}px`;
|
|
2608
|
+
}
|
|
2607
2609
|
}
|
|
2608
2610
|
}
|
|
2609
2611
|
//* Update the maximum valid number length for the currently selected country.
|
|
@@ -2951,6 +2953,9 @@ var Iti = class {
|
|
|
2951
2953
|
}
|
|
2952
2954
|
//* Validate the input val
|
|
2953
2955
|
isValidNumber() {
|
|
2956
|
+
if (!this.selectedCountryData.iso2) {
|
|
2957
|
+
return false;
|
|
2958
|
+
}
|
|
2954
2959
|
const val = this._getFullNumber();
|
|
2955
2960
|
const alphaCharPosition = val.search(/\p{L}/u);
|
|
2956
2961
|
if (alphaCharPosition > -1) {
|
|
@@ -2966,6 +2971,9 @@ var Iti = class {
|
|
|
2966
2971
|
}
|
|
2967
2972
|
//* Validate the input val (precise)
|
|
2968
2973
|
isValidNumberPrecise() {
|
|
2974
|
+
if (!this.selectedCountryData.iso2) {
|
|
2975
|
+
return false;
|
|
2976
|
+
}
|
|
2969
2977
|
const val = this._getFullNumber();
|
|
2970
2978
|
const alphaCharPosition = val.search(/\p{L}/u);
|
|
2971
2979
|
if (alphaCharPosition > -1) {
|
|
@@ -3055,7 +3063,7 @@ var intlTelInput = Object.assign(
|
|
|
3055
3063
|
//* A map from instance ID to instance object.
|
|
3056
3064
|
instances: {},
|
|
3057
3065
|
loadUtils,
|
|
3058
|
-
version: "24.3.
|
|
3066
|
+
version: "24.3.2"
|
|
3059
3067
|
}
|
|
3060
3068
|
);
|
|
3061
3069
|
var intl_tel_input_default = intlTelInput;
|
|
@@ -2634,12 +2634,14 @@ var Iti = class {
|
|
|
2634
2634
|
}
|
|
2635
2635
|
//* Update the input padding to make space for the selected country/dial code.
|
|
2636
2636
|
_updateInputPadding() {
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
this.
|
|
2641
|
-
|
|
2642
|
-
|
|
2637
|
+
if (this.selectedCountry) {
|
|
2638
|
+
const selectedCountryWidth = this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth();
|
|
2639
|
+
const inputPadding = selectedCountryWidth + 6;
|
|
2640
|
+
if (this.showSelectedCountryOnLeft) {
|
|
2641
|
+
this.telInput.style.paddingLeft = `${inputPadding}px`;
|
|
2642
|
+
} else {
|
|
2643
|
+
this.telInput.style.paddingRight = `${inputPadding}px`;
|
|
2644
|
+
}
|
|
2643
2645
|
}
|
|
2644
2646
|
}
|
|
2645
2647
|
//* Update the maximum valid number length for the currently selected country.
|
|
@@ -2987,6 +2989,9 @@ var Iti = class {
|
|
|
2987
2989
|
}
|
|
2988
2990
|
//* Validate the input val
|
|
2989
2991
|
isValidNumber() {
|
|
2992
|
+
if (!this.selectedCountryData.iso2) {
|
|
2993
|
+
return false;
|
|
2994
|
+
}
|
|
2990
2995
|
const val = this._getFullNumber();
|
|
2991
2996
|
const alphaCharPosition = val.search(/\p{L}/u);
|
|
2992
2997
|
if (alphaCharPosition > -1) {
|
|
@@ -3002,6 +3007,9 @@ var Iti = class {
|
|
|
3002
3007
|
}
|
|
3003
3008
|
//* Validate the input val (precise)
|
|
3004
3009
|
isValidNumberPrecise() {
|
|
3010
|
+
if (!this.selectedCountryData.iso2) {
|
|
3011
|
+
return false;
|
|
3012
|
+
}
|
|
3005
3013
|
const val = this._getFullNumber();
|
|
3006
3014
|
const alphaCharPosition = val.search(/\p{L}/u);
|
|
3007
3015
|
if (alphaCharPosition > -1) {
|
|
@@ -3091,7 +3099,7 @@ var intlTelInput = Object.assign(
|
|
|
3091
3099
|
//* A map from instance ID to instance object.
|
|
3092
3100
|
instances: {},
|
|
3093
3101
|
loadUtils,
|
|
3094
|
-
version: "24.3.
|
|
3102
|
+
version: "24.3.2"
|
|
3095
3103
|
}
|
|
3096
3104
|
);
|
|
3097
3105
|
var intl_tel_input_default = intlTelInput;
|
|
@@ -9234,7 +9242,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9234
9242
|
b = "";
|
|
9235
9243
|
for (let e = 0; e < c.length; e++) d.ja = ob(d, c.charAt(e)), b = d.ja;
|
|
9236
9244
|
return b;
|
|
9237
|
-
} catch
|
|
9245
|
+
} catch {
|
|
9238
9246
|
return a;
|
|
9239
9247
|
}
|
|
9240
9248
|
});
|
|
@@ -9243,7 +9251,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9243
9251
|
const e = J.g(), f = X(e, a, b);
|
|
9244
9252
|
var d = W(e, f, -1);
|
|
9245
9253
|
return 0 == d || 4 == d ? e.format(f, "undefined" === typeof c ? 0 : c) : a;
|
|
9246
|
-
} catch
|
|
9254
|
+
} catch {
|
|
9247
9255
|
return a;
|
|
9248
9256
|
}
|
|
9249
9257
|
});
|
|
@@ -9266,14 +9274,14 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9266
9274
|
h = null;
|
|
9267
9275
|
}
|
|
9268
9276
|
return l.format(h, d ? 0 : b ? 2 : 1);
|
|
9269
|
-
} catch
|
|
9277
|
+
} catch {
|
|
9270
9278
|
return "";
|
|
9271
9279
|
}
|
|
9272
9280
|
});
|
|
9273
9281
|
m("intlTelInputUtilsTemp.getExtension", (a, b) => {
|
|
9274
9282
|
try {
|
|
9275
9283
|
return r(X(J.g(), a, b), 3);
|
|
9276
|
-
} catch
|
|
9284
|
+
} catch {
|
|
9277
9285
|
return "";
|
|
9278
9286
|
}
|
|
9279
9287
|
});
|
|
@@ -9287,11 +9295,12 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9287
9295
|
e = ab(f, d);
|
|
9288
9296
|
}
|
|
9289
9297
|
return e;
|
|
9290
|
-
} catch
|
|
9298
|
+
} catch {
|
|
9291
9299
|
return -99;
|
|
9292
9300
|
}
|
|
9293
9301
|
});
|
|
9294
9302
|
m("intlTelInputUtilsTemp.getValidationError", (a, b) => {
|
|
9303
|
+
if (!b) return 1;
|
|
9295
9304
|
try {
|
|
9296
9305
|
const c = J.g(), d = X(c, a, b);
|
|
9297
9306
|
return W(c, d, -1);
|
|
@@ -9311,7 +9320,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9311
9320
|
g = -1 != ab(h, f);
|
|
9312
9321
|
}
|
|
9313
9322
|
return g;
|
|
9314
|
-
} catch
|
|
9323
|
+
} catch {
|
|
9315
9324
|
return false;
|
|
9316
9325
|
}
|
|
9317
9326
|
});
|
|
@@ -9327,14 +9336,14 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9327
9336
|
return f;
|
|
9328
9337
|
}
|
|
9329
9338
|
return 0 === W(d, e, -1);
|
|
9330
|
-
} catch
|
|
9339
|
+
} catch {
|
|
9331
9340
|
return false;
|
|
9332
9341
|
}
|
|
9333
9342
|
});
|
|
9334
9343
|
m("intlTelInputUtilsTemp.getCoreNumber", (a, b) => {
|
|
9335
9344
|
try {
|
|
9336
9345
|
return r(X(J.g(), a, b), 2).toString();
|
|
9337
|
-
} catch
|
|
9346
|
+
} catch {
|
|
9338
9347
|
return "";
|
|
9339
9348
|
}
|
|
9340
9349
|
});
|
|
@@ -2598,12 +2598,14 @@ var Iti = class {
|
|
|
2598
2598
|
}
|
|
2599
2599
|
//* Update the input padding to make space for the selected country/dial code.
|
|
2600
2600
|
_updateInputPadding() {
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
this.
|
|
2605
|
-
|
|
2606
|
-
|
|
2601
|
+
if (this.selectedCountry) {
|
|
2602
|
+
const selectedCountryWidth = this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth();
|
|
2603
|
+
const inputPadding = selectedCountryWidth + 6;
|
|
2604
|
+
if (this.showSelectedCountryOnLeft) {
|
|
2605
|
+
this.telInput.style.paddingLeft = `${inputPadding}px`;
|
|
2606
|
+
} else {
|
|
2607
|
+
this.telInput.style.paddingRight = `${inputPadding}px`;
|
|
2608
|
+
}
|
|
2607
2609
|
}
|
|
2608
2610
|
}
|
|
2609
2611
|
//* Update the maximum valid number length for the currently selected country.
|
|
@@ -2951,6 +2953,9 @@ var Iti = class {
|
|
|
2951
2953
|
}
|
|
2952
2954
|
//* Validate the input val
|
|
2953
2955
|
isValidNumber() {
|
|
2956
|
+
if (!this.selectedCountryData.iso2) {
|
|
2957
|
+
return false;
|
|
2958
|
+
}
|
|
2954
2959
|
const val = this._getFullNumber();
|
|
2955
2960
|
const alphaCharPosition = val.search(/\p{L}/u);
|
|
2956
2961
|
if (alphaCharPosition > -1) {
|
|
@@ -2966,6 +2971,9 @@ var Iti = class {
|
|
|
2966
2971
|
}
|
|
2967
2972
|
//* Validate the input val (precise)
|
|
2968
2973
|
isValidNumberPrecise() {
|
|
2974
|
+
if (!this.selectedCountryData.iso2) {
|
|
2975
|
+
return false;
|
|
2976
|
+
}
|
|
2969
2977
|
const val = this._getFullNumber();
|
|
2970
2978
|
const alphaCharPosition = val.search(/\p{L}/u);
|
|
2971
2979
|
if (alphaCharPosition > -1) {
|
|
@@ -3055,7 +3063,7 @@ var intlTelInput = Object.assign(
|
|
|
3055
3063
|
//* A map from instance ID to instance object.
|
|
3056
3064
|
instances: {},
|
|
3057
3065
|
loadUtils,
|
|
3058
|
-
version: "24.3.
|
|
3066
|
+
version: "24.3.2"
|
|
3059
3067
|
}
|
|
3060
3068
|
);
|
|
3061
3069
|
var intl_tel_input_default = intlTelInput;
|
|
@@ -9198,7 +9206,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9198
9206
|
b = "";
|
|
9199
9207
|
for (let e = 0; e < c.length; e++) d.ja = ob(d, c.charAt(e)), b = d.ja;
|
|
9200
9208
|
return b;
|
|
9201
|
-
} catch
|
|
9209
|
+
} catch {
|
|
9202
9210
|
return a;
|
|
9203
9211
|
}
|
|
9204
9212
|
});
|
|
@@ -9207,7 +9215,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9207
9215
|
const e = J.g(), f = X(e, a, b);
|
|
9208
9216
|
var d = W(e, f, -1);
|
|
9209
9217
|
return 0 == d || 4 == d ? e.format(f, "undefined" === typeof c ? 0 : c) : a;
|
|
9210
|
-
} catch
|
|
9218
|
+
} catch {
|
|
9211
9219
|
return a;
|
|
9212
9220
|
}
|
|
9213
9221
|
});
|
|
@@ -9230,14 +9238,14 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9230
9238
|
h = null;
|
|
9231
9239
|
}
|
|
9232
9240
|
return l.format(h, d ? 0 : b ? 2 : 1);
|
|
9233
|
-
} catch
|
|
9241
|
+
} catch {
|
|
9234
9242
|
return "";
|
|
9235
9243
|
}
|
|
9236
9244
|
});
|
|
9237
9245
|
m("intlTelInputUtilsTemp.getExtension", (a, b) => {
|
|
9238
9246
|
try {
|
|
9239
9247
|
return r(X(J.g(), a, b), 3);
|
|
9240
|
-
} catch
|
|
9248
|
+
} catch {
|
|
9241
9249
|
return "";
|
|
9242
9250
|
}
|
|
9243
9251
|
});
|
|
@@ -9251,11 +9259,12 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9251
9259
|
e = ab(f, d);
|
|
9252
9260
|
}
|
|
9253
9261
|
return e;
|
|
9254
|
-
} catch
|
|
9262
|
+
} catch {
|
|
9255
9263
|
return -99;
|
|
9256
9264
|
}
|
|
9257
9265
|
});
|
|
9258
9266
|
m("intlTelInputUtilsTemp.getValidationError", (a, b) => {
|
|
9267
|
+
if (!b) return 1;
|
|
9259
9268
|
try {
|
|
9260
9269
|
const c = J.g(), d = X(c, a, b);
|
|
9261
9270
|
return W(c, d, -1);
|
|
@@ -9275,7 +9284,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9275
9284
|
g = -1 != ab(h, f);
|
|
9276
9285
|
}
|
|
9277
9286
|
return g;
|
|
9278
|
-
} catch
|
|
9287
|
+
} catch {
|
|
9279
9288
|
return false;
|
|
9280
9289
|
}
|
|
9281
9290
|
});
|
|
@@ -9291,14 +9300,14 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9291
9300
|
return f;
|
|
9292
9301
|
}
|
|
9293
9302
|
return 0 === W(d, e, -1);
|
|
9294
|
-
} catch
|
|
9303
|
+
} catch {
|
|
9295
9304
|
return false;
|
|
9296
9305
|
}
|
|
9297
9306
|
});
|
|
9298
9307
|
m("intlTelInputUtilsTemp.getCoreNumber", (a, b) => {
|
|
9299
9308
|
try {
|
|
9300
9309
|
return r(X(J.g(), a, b), 2).toString();
|
|
9301
|
-
} catch
|
|
9310
|
+
} catch {
|
|
9302
9311
|
return "";
|
|
9303
9312
|
}
|
|
9304
9313
|
});
|