Skip to content

Commit

Permalink
OA-18121: [GEM] Update libphonenumber to v18.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
arthutox committed Dec 12, 2023
1 parent 3cd8998 commit e9962f0
Show file tree
Hide file tree
Showing 3 changed files with 471 additions and 473 deletions.
30 changes: 14 additions & 16 deletions app/assets/javascripts/intl-tel-input.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* International Telephone Input v18.2.1
* International Telephone Input v18.3.3
* https://github.com/jackocnr/intl-tel-input.git
* Licensed under the MIT license
*/
Expand Down Expand Up @@ -161,6 +161,11 @@
separateDialCode: false,
// option to hide the flags - must be used with separateDialCode, or allowDropdown=false
showFlags: true,
// use full screen popup instead of dropdown for country list
useFullscreenPopup: // we cannot just test screen size as some smartphones/website meta tags will report desktop
// resolutions
// Note: to target Android Mobiles (and not Tablets), we must find 'Android' and 'Mobile'
/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 500,
// specify the path to the libphonenumber script to enable validation/formatting
utilsScript: ""
};
Expand Down Expand Up @@ -217,15 +222,9 @@
if (!this.options.showFlags && forceShowFlags) {
this.options.showFlags = true;
}
// we cannot just test screen size as some smartphones/website meta tags will report desktop
// resolutions
// Note: for some reason jasmine breaks if you put this in the main Plugin function with the
// rest of these declarations
// Note: to target Android Mobiles (and not Tablets), we must find 'Android' and 'Mobile'
this.isMobile = /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
if (this.isMobile) {
if (this.options.useFullscreenPopup) {
// trigger the mobile dropdown css
document.body.classList.add("iti-mobile");
document.body.classList.add("iti-fullscreen-popup");
// on mobile, we want a full screen dropdown, so we must append it to the body
if (!this.options.dropdownContainer) {
this.options.dropdownContainer = document.body;
Expand Down Expand Up @@ -494,8 +493,7 @@
this._appendListItems(this.preferredCountries, "iti__preferred", true);
this._createEl("li", {
"class": "iti__divider",
role: "separator",
"aria-disabled": "true"
"aria-hidden": "true"
}, this.countryList);
}
this._appendListItems(this.countries, "iti__standard");
Expand Down Expand Up @@ -825,7 +823,7 @@
if (this.options.dropdownContainer) {
this.options.dropdownContainer.appendChild(this.dropdown);
}
if (!this.isMobile) {
if (!this.options.useFullscreenPopup) {
var pos = this.telInput.getBoundingClientRect();
// windowTop from https://stackoverflow.com/a/14384091/217866
var windowTop = window.pageYOffset || document.documentElement.scrollTop;
Expand Down Expand Up @@ -1204,7 +1202,7 @@
this.countryList.removeEventListener("click", this._handleClickCountryList);
// remove menu from container
if (this.options.dropdownContainer) {
if (!this.isMobile) {
if (!this.options.useFullscreenPopup) {
window.removeEventListener("scroll", this._handleWindowScroll);
}
if (this.dropdown.parentNode) {
Expand Down Expand Up @@ -1494,8 +1492,8 @@
return Iti;
}();
/********************
* STATIC METHODS
********************/
* STATIC METHODS
********************/
// get the country data object
intlTelInputGlobals.getCountryData = function() {
return allCountries;
Expand Down Expand Up @@ -1543,7 +1541,7 @@
// default options
intlTelInputGlobals.defaults = defaults;
// version
intlTelInputGlobals.version = "18.2.1";
intlTelInputGlobals.version = "18.3.3";
var pluginName = "intlTelInput";
// A really lightweight plugin wrapper around the constructor,
// preventing against multiple instantiations
Expand Down
Loading

0 comments on commit e9962f0

Please sign in to comment.