@osimatic/helpers-js 1.5.18 → 1.5.19
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/contact_details.js +0 -6
- package/location.js +3 -0
- package/package.json +1 -1
- package/paging.js +7 -0
package/contact_details.js
CHANGED
|
@@ -56,10 +56,6 @@ class TelephoneNumber {
|
|
|
56
56
|
TelephoneNumber.localCountryCode = countryCode;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
static setIntlTelInputUtilsPath(path) {
|
|
60
|
-
TelephoneNumber.intlTelInputUtilsPath = path;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
59
|
static getCountryIsoCode(phoneNumber, localCountryIsoCode=TelephoneNumber.localCountryCode) {
|
|
64
60
|
try {
|
|
65
61
|
const number = libphonenumber.parsePhoneNumber(phoneNumber, localCountryIsoCode.toUpperCase());
|
|
@@ -172,12 +168,10 @@ class TelephoneNumber {
|
|
|
172
168
|
|
|
173
169
|
static setIntlTelInput(input, placeholderNumberType) {
|
|
174
170
|
TelephoneNumber.localCountryCode = typeof TelephoneNumber.localCountryCode != 'undefined' ? TelephoneNumber.localCountryCode : null;
|
|
175
|
-
TelephoneNumber.intlTelInputUtilsPath = typeof TelephoneNumber.intlTelInputUtilsPath != 'undefined' ? TelephoneNumber.intlTelInputUtilsPath : null;
|
|
176
171
|
|
|
177
172
|
return intlTelInputLib(input[0], {
|
|
178
173
|
initialCountry: null != TelephoneNumber.localCountryCode ? TelephoneNumber.localCountryCode.toLowerCase() : null, // depuis version 19.x, le code pays doit être en minuscule
|
|
179
174
|
placeholderNumberType: placeholderNumberType || 'FIXED_LINE_OR_MOBILE',
|
|
180
|
-
utilsScript: TelephoneNumber.intlTelInputUtilsPath
|
|
181
175
|
});
|
|
182
176
|
}
|
|
183
177
|
|
package/location.js
CHANGED
|
@@ -17,6 +17,9 @@ class Country {
|
|
|
17
17
|
|
|
18
18
|
static fillCountrySelect(select, defaultValue=null, countriesList=null, addNoneValue=false, noneLabel='- Aucun -') {
|
|
19
19
|
select = toEl(select);
|
|
20
|
+
if (!select) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
20
23
|
if (select.children.length === 0) {
|
|
21
24
|
if (addNoneValue) {
|
|
22
25
|
select.insertAdjacentHTML('beforeend', '<option value="">'+noneLabel+'</option>');
|
package/package.json
CHANGED
package/paging.js
CHANGED
|
@@ -133,7 +133,14 @@ class Pagination {
|
|
|
133
133
|
|
|
134
134
|
class Navigation {
|
|
135
135
|
static activateTab(a) {
|
|
136
|
+
a = toEl(a);
|
|
137
|
+
if (!a) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
136
140
|
let ulNav = a.closest('.nav');
|
|
141
|
+
if (!ulNav) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
137
144
|
let tabContent = ulNav.parentElement.querySelector('.tab-content');
|
|
138
145
|
|
|
139
146
|
ulNav.querySelectorAll('a.nav-link').forEach(navLink => {
|