@osimatic/helpers-js 1.0.3 → 1.0.6
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/array.js +3 -1
- package/index.js +30 -21
- package/network.js +3 -13
- package/number.js +2 -0
- package/package.json +1 -1
- package/paging.js +2 -0
- package/php.min.js +3 -1
- package/string.js +2 -0
- package/{button_loader.js → todos/button_loader.js} +0 -0
- package/{form_date.js → todos/form_date.js} +0 -0
- package/{google_charts.js → todos/google_charts.js} +0 -0
- package/{google_charts_mytime.js → todos/google_charts_mytime.js} +0 -0
- package/{google_recaptcha.js → todos/google_recaptcha.js} +0 -0
- package/{graphiques.js → todos/graphiques.js} +0 -0
- package/{jquery.js → todos/jquery.js} +0 -0
- package/{multiple_action_in_table.js → todos/multiple_action_in_table.js} +0 -0
- package/{select_all.js → todos/select_all.js} +0 -0
- package/{tree.js → todos/tree.js} +0 -0
- package/util.js +3 -1
package/array.js
CHANGED
package/index.js
CHANGED
|
@@ -1,26 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const {
|
|
5
|
-
const {
|
|
6
|
-
const {
|
|
7
|
-
const {
|
|
8
|
-
const {
|
|
9
|
-
const {
|
|
10
|
-
const {
|
|
11
|
-
const {
|
|
12
|
-
const {
|
|
13
|
-
const {
|
|
14
|
-
const {
|
|
15
|
-
const {
|
|
16
|
-
const {
|
|
17
|
-
const {
|
|
18
|
-
const {
|
|
1
|
+
//A noter : les réécritures de prototypes définies dans certains fichiers n'ont pas besoin d'être exportés depuis le module en question (exemple Array / Object dans array.js).
|
|
2
|
+
//Il faut uniquement appeler require() (sans récupérer le retour) et ajouter la/les classe(s) concernée(s) dans l'export ci-dessous (l'appel de require() applique l'extension).
|
|
3
|
+
|
|
4
|
+
const { HTTPRequest, Cookie, UrlAndQueryString } = require('./network');
|
|
5
|
+
const { IBAN } = require('./bank');
|
|
6
|
+
const { AudioMedia } = require('./media');
|
|
7
|
+
const { PersonName, Email, TelephoneNumber } = require('./contact_details');
|
|
8
|
+
const { CountDown } = require('./count_down');
|
|
9
|
+
const { DataTable } = require('./data_table');
|
|
10
|
+
const { DateTime, TimestampUnix, SqlDate, SqlTime, SqlDateTime, InputPeriod } = require('./date_time');
|
|
11
|
+
const { DetailsSubArray } = require('./details_sub_array');
|
|
12
|
+
const { Duration } = require('./duration');
|
|
13
|
+
const { File, CSV, Img } = require('./file');
|
|
14
|
+
const { FlashMessage } = require('./flash_message');
|
|
15
|
+
const { FormHelper } = require('./form_helper');
|
|
16
|
+
const { GoogleMap } = require('./google_maps');
|
|
17
|
+
const { ImportFromCsv } = require('./import_from_csv');
|
|
18
|
+
const { JwtToken, JwtSession } = require('./jwt');
|
|
19
|
+
const { ListBox } = require('./list_box');
|
|
20
|
+
const { COUNTRIES_LIST, Country, PostalAddress, Location } = require('./location');
|
|
21
|
+
const { SocialNetwork } = require('./social_network');
|
|
22
|
+
const { getValuesByKeyInArrayOfArrays, renameKeys, renameKeysByCallback } = require('./array');
|
|
23
|
+
const { NumberValue } = require('./number');
|
|
24
|
+
const { selectionnerContenuNode, copierTexte } = require('./string');
|
|
25
|
+
const { addBookmark, sleep, refresh } = require('./util');
|
|
26
|
+
const { chr, ord, trim, empty } = require('./php.min');
|
|
27
|
+
const { Pagination, activateTab } = require('./paging');
|
|
19
28
|
|
|
20
29
|
module.exports = {
|
|
21
30
|
HTTPRequest, Cookie, UrlAndQueryString, IBAN, AudioMedia, PersonName, Email, TelephoneNumber, CountDown, DataTable,
|
|
22
31
|
DateTime, TimestampUnix, SqlDate, SqlTime, SqlDateTime, InputPeriod, DetailsSubArray, Duration, File, CSV, Img,
|
|
23
|
-
FlashMessage, FormHelper, GoogleMap, ImportFromCsv, JwtToken, JwtSession, ListBox, Country, PostalAddress,
|
|
24
|
-
SocialNetwork,
|
|
25
|
-
|
|
32
|
+
FlashMessage, FormHelper, GoogleMap, ImportFromCsv, JwtToken, JwtSession, ListBox, COUNTRIES_LIST, Country, PostalAddress,
|
|
33
|
+
Location, SocialNetwork, Array, Object, getValuesByKeyInArrayOfArrays, renameKeys, renameKeysByCallback, Number, NumberValue,
|
|
34
|
+
String, selectionnerContenuNode, copierTexte, addBookmark, sleep, refresh, chr, ord, trim, empty, Pagination, activateTab
|
|
26
35
|
};
|
package/network.js
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
class HTTPRequest {
|
|
3
|
-
static getHttpHeaders() {
|
|
4
|
-
if (!JwtSession.isAnonymous()) { //on ne définit pas ce header si on ne trouve pas d'access_token
|
|
5
|
-
httpHeaders['Authorization'] = 'Bearer ' + JwtSession.getToken();
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
return httpHeaders;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
3
|
static async get(url, data, successCallback, errorCallback) {
|
|
12
4
|
if (data == null) {
|
|
13
5
|
data = '';
|
|
@@ -56,7 +48,7 @@ class HTTPRequest {
|
|
|
56
48
|
$.ajax({
|
|
57
49
|
type: 'GET',
|
|
58
50
|
url: url + (!url.includes('?') ? '?' : '') + data,
|
|
59
|
-
headers:
|
|
51
|
+
headers: httpHeaders,
|
|
60
52
|
dataType: 'json',
|
|
61
53
|
cache: false,
|
|
62
54
|
success: (data) => successCallback(data),
|
|
@@ -124,7 +116,7 @@ class HTTPRequest {
|
|
|
124
116
|
$.ajax({
|
|
125
117
|
type: 'GET',
|
|
126
118
|
url: url + (!url.includes('?') ? '?' : '') + data,
|
|
127
|
-
headers:
|
|
119
|
+
headers: httpHeaders,
|
|
128
120
|
cache: false,
|
|
129
121
|
xhrFields: {
|
|
130
122
|
responseType: 'blob'
|
|
@@ -191,7 +183,7 @@ class HTTPRequest {
|
|
|
191
183
|
$.ajax({
|
|
192
184
|
type: 'POST',
|
|
193
185
|
url: url,
|
|
194
|
-
headers:
|
|
186
|
+
headers: httpHeaders,
|
|
195
187
|
dataType: 'json', // 22/09/2020 : à voir si cette ligne pose pb (utilisé pour requete import et peut être d'autres
|
|
196
188
|
data: formData,
|
|
197
189
|
cache: false,
|
|
@@ -548,5 +540,3 @@ class UrlAndQueryString {
|
|
|
548
540
|
}
|
|
549
541
|
|
|
550
542
|
}
|
|
551
|
-
|
|
552
|
-
module.exports = { HTTPRequest, Cookie, UrlAndQueryString };
|
package/number.js
CHANGED
|
@@ -88,3 +88,5 @@ Number.prototype.formatAsPercent = function(locale, minimumFractionDigits) {
|
|
|
88
88
|
minimumFractionDigits = (typeof minimumFractionDigits != 'undefined'?minimumFractionDigits:0);
|
|
89
89
|
return new Intl.NumberFormat(locale, {style: 'percent', minimumFractionDigits:minimumFractionDigits}).format(this);
|
|
90
90
|
};
|
|
91
|
+
|
|
92
|
+
module.exports = { NumberValue };
|
package/package.json
CHANGED
package/paging.js
CHANGED
|
@@ -118,6 +118,8 @@ function activateTab(a) {
|
|
|
118
118
|
tabContent.find(a.attr('href')).addClass('active').addClass('show');
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
module.exports = { Pagination, activateTab };
|
|
122
|
+
|
|
121
123
|
// deprecated
|
|
122
124
|
function paginationAsList(nbResultatsTotal, nbResultatsParPage, urlPage, nomParamPage) {
|
|
123
125
|
var currentUrl = urlPage || window.location.href;
|
package/php.min.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
function chr(codePt){if(codePt>65535){codePt-=65536;return String.fromCharCode(55296+(codePt>>10),56320+(codePt&1023))}return String.fromCharCode(codePt)}
|
|
2
2
|
function ord(string){var str=string+"",code=str.charCodeAt(0);if(55296<=code&&code<=56319){var hi=code;if(str.length===1){return code}var low=str.charCodeAt(1);return((hi-55296)*1024)+(low-56320)+65536}if(56320<=code&&code<=57343){return code}return code}
|
|
3
3
|
function trim(str){return str.replace(/^\s+/g,"").replace(/\s+$/g,"")}
|
|
4
|
-
function empty(mixed_var){var key;if(mixed_var===""||mixed_var===0||mixed_var==="0"||mixed_var===null||mixed_var===false||typeof mixed_var==="undefined"){return true}if(typeof mixed_var=="object"){for(key in mixed_var){return false}return true}return false}
|
|
4
|
+
function empty(mixed_var){var key;if(mixed_var===""||mixed_var===0||mixed_var==="0"||mixed_var===null||mixed_var===false||typeof mixed_var==="undefined"){return true}if(typeof mixed_var=="object"){for(key in mixed_var){return false}return true}return false}
|
|
5
|
+
|
|
6
|
+
module.exports = { chr, ord, trim, empty };
|
package/string.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|