@osimatic/helpers-js 1.1.74 → 1.1.76

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/http_client.js CHANGED
@@ -54,11 +54,11 @@ class HTTPClient {
54
54
  }
55
55
 
56
56
  if (asObject) {
57
- return HTTPClient.headers;
57
+ return httpHeadersData;
58
58
  }
59
59
 
60
60
  let httpHeaders = new Headers();
61
- Object.entries(HTTPClient.headers).forEach(([key, value]) => {
61
+ Object.entries(httpHeadersData).forEach(([key, value]) => {
62
62
  httpHeaders.append(key, value);
63
63
  });
64
64
  return httpHeaders;
package/location.js CHANGED
@@ -7,9 +7,12 @@ class Country {
7
7
  return '<span><img src="'+Country.getFlagPath(countryCode)+'" alt="" title="'+Country.getCountryName(countryCode)+'" class="flag" /></span>'
8
8
  }
9
9
 
10
- static fillCountrySelect(select, defaultValue=null) {
10
+ static fillCountrySelect(select, defaultValue=null, countriesList=null, addNoneValue=false, noneLabel='- Aucun -') {
11
11
  if (select.children().length === 0) {
12
- Object.entries(Country.getCountries()).forEach(([countryCode, countryName]) => select.append('<option value="' + countryCode + '">' + countryName + '</option>'));
12
+ if (addNoneValue) {
13
+ select.append('<option value="">'+noneLabel+'</option>');
14
+ }
15
+ Object.entries(null != countriesList ? countriesList : Country.getCountries()).forEach(([countryCode, countryName]) => select.append('<option value="' + countryCode + '">' + countryName + '</option>'));
13
16
  }
14
17
  if (null != defaultValue) {
15
18
  select.val(defaultValue);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osimatic/helpers-js",
3
- "version": "1.1.74",
3
+ "version": "1.1.76",
4
4
  "main": "main.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"