@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.
@@ -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 window.intlTelInput(input[0], {
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 window.intlTelInput.getInstance(input[0]);
185
+ return intlTelInput.getInstance(input[0]);
185
186
  }
186
187
 
187
188
  static getEnteredNumberInInternationalFormat(intlTelInput) {
188
- return intlTelInput.getNumber(window.intlTelInput.utils.numberFormat.E164);
189
+ return intlTelInput.getNumber(intlTelInput.utils.numberFormat.E164);
189
190
  }
190
191
 
191
192
  static formatNumberFromIntlTelInput(intlTelInput) {
@@ -1,3 +1,5 @@
1
+ const L = require('leaflet');
2
+
1
3
  /**
2
4
  * https://leafletjs.com/
3
5
  * https://switch2osm.org/the-basics/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osimatic/helpers-js",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "main": "main.js",
5
5
  "scripts": {
6
6
  "test": "jest",