@osimatic/helpers-js 1.5.0 → 1.5.1
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 +4 -3
- package/open_street_map.js +2 -0
- package/package.json +1 -1
package/contact_details.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
const libphonenumber = require('libphonenumber-js/max');
|
|
3
|
+
const intlTelInput = require('intl-tel-input');
|
|
3
4
|
const { Country } = require('./location');
|
|
4
5
|
|
|
5
6
|
class PersonName {
|
|
@@ -173,7 +174,7 @@ class TelephoneNumber {
|
|
|
173
174
|
TelephoneNumber.localCountryCode = typeof TelephoneNumber.localCountryCode != 'undefined' ? TelephoneNumber.localCountryCode : null;
|
|
174
175
|
TelephoneNumber.intlTelInputUtilsPath = typeof TelephoneNumber.intlTelInputUtilsPath != 'undefined' ? TelephoneNumber.intlTelInputUtilsPath : null;
|
|
175
176
|
|
|
176
|
-
return
|
|
177
|
+
return intlTelInput(input[0], {
|
|
177
178
|
initialCountry: null != TelephoneNumber.localCountryCode ? TelephoneNumber.localCountryCode.toLowerCase() : null, // depuis version 19.x, le code pays doit être en minuscule
|
|
178
179
|
placeholderNumberType: placeholderNumberType || 'FIXED_LINE_OR_MOBILE',
|
|
179
180
|
utilsScript: TelephoneNumber.intlTelInputUtilsPath
|
|
@@ -181,11 +182,11 @@ class TelephoneNumber {
|
|
|
181
182
|
}
|
|
182
183
|
|
|
183
184
|
static getIntlTelInputInstance(input) {
|
|
184
|
-
return
|
|
185
|
+
return intlTelInput.getInstance(input[0]);
|
|
185
186
|
}
|
|
186
187
|
|
|
187
188
|
static getEnteredNumberInInternationalFormat(intlTelInput) {
|
|
188
|
-
return intlTelInput.getNumber(
|
|
189
|
+
return intlTelInput.getNumber(intlTelInput.utils.numberFormat.E164);
|
|
189
190
|
}
|
|
190
191
|
|
|
191
192
|
static formatNumberFromIntlTelInput(intlTelInput) {
|
package/open_street_map.js
CHANGED