@supersoniks/concorde 1.1.42 → 1.1.43
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/components.js +2 -3
- package/concorde-core.bundle.js +37 -35
- package/concorde-core.es.js +5081 -4317
- package/core/_types/types.d.ts +26 -0
- package/core/_types/types.js +1 -0
- package/core/components/functional/date/date.d.ts +13 -5
- package/core/components/functional/date/date.js +48 -29
- package/core/components/functional/example/example.d.ts +1 -1
- package/core/components/functional/example/example.js +1 -1
- package/core/components/functional/fetch/fetch.d.ts +40 -3
- package/core/components/functional/fetch/fetch.js +2 -6
- package/core/components/functional/functional.d.ts +2 -0
- package/core/components/functional/functional.js +2 -0
- package/core/components/functional/if/if.d.ts +3 -0
- package/core/components/functional/if/if.js +6 -12
- package/core/components/functional/if/if.test.d.ts +1 -0
- package/core/components/functional/if/if.test.js +44 -0
- package/core/components/functional/list/list.d.ts +32 -8
- package/core/components/functional/list/list.js +33 -40
- package/core/components/functional/mix/mix.d.ts +22 -0
- package/core/components/functional/mix/mix.js +99 -0
- package/core/components/functional/queue/queue.d.ts +16 -3
- package/core/components/functional/queue/queue.js +71 -15
- package/core/components/functional/router/redirect.d.ts +10 -1
- package/core/components/functional/router/redirect.js +5 -6
- package/core/components/functional/router/router.d.ts +15 -1
- package/core/components/functional/router/router.js +1 -6
- package/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts +1 -1
- package/core/components/functional/sdui/SDUIDescriptorTransformer.js +24 -12
- package/core/components/functional/sdui/default-library.json +108 -0
- package/core/components/functional/sdui/sdui-utils.d.ts +5 -0
- package/core/components/functional/sdui/sdui-utils.js +63 -0
- package/core/components/functional/sdui/sdui.d.ts +16 -9
- package/core/components/functional/sdui/sdui.js +52 -25
- package/core/components/functional/sdui/types.d.ts +4 -2
- package/core/components/functional/states/states.d.ts +19 -3
- package/core/components/functional/states/states.js +7 -12
- package/core/components/functional/submit/submit.d.ts +16 -1
- package/core/components/functional/submit/submit.js +87 -17
- package/core/components/functional/subscriber/subscriber.d.ts +4 -1
- package/core/components/functional/subscriber/subscriber.js +1 -6
- package/core/components/functional/value/value.d.ts +7 -0
- package/core/components/functional/value/value.js +26 -0
- package/core/components/ui/_css/scroll.js +6 -7
- package/core/components/ui/_css/size.d.ts +1 -0
- package/core/components/ui/_css/size.js +3 -1
- package/core/components/ui/alert/alert.d.ts +2 -2
- package/core/components/ui/alert/alert.js +11 -16
- package/core/components/ui/badge/badge.d.ts +3 -1
- package/core/components/ui/badge/badge.js +36 -22
- package/core/components/ui/button/button.d.ts +23 -20
- package/core/components/ui/button/button.js +59 -42
- package/core/components/ui/captcha/captcha.d.ts +14 -2
- package/core/components/ui/captcha/captcha.js +17 -12
- package/core/components/ui/card/card-footer.js +1 -8
- package/core/components/ui/card/card-header-descripton.js +3 -9
- package/core/components/ui/card/card-header.js +1 -6
- package/core/components/ui/card/card-main.js +0 -5
- package/core/components/ui/card/card.d.ts +1 -1
- package/core/components/ui/card/card.js +28 -12
- package/core/components/ui/divider/divider.d.ts +2 -0
- package/core/components/ui/divider/divider.js +43 -16
- package/core/components/ui/form/checkbox/checkbox.d.ts +53 -16
- package/core/components/ui/form/checkbox/checkbox.js +53 -28
- package/core/components/ui/form/css/form-control.d.ts +2 -0
- package/core/components/ui/form/css/form-control.js +145 -67
- package/core/components/ui/form/fieldset/fieldset.d.ts +8 -1
- package/core/components/ui/form/fieldset/fieldset.js +45 -8
- package/core/components/ui/form/fieldset/legend-description.js +0 -5
- package/core/components/ui/form/fieldset/legend.js +3 -6
- package/core/components/ui/form/form-actions/form-actions.d.ts +2 -0
- package/core/components/ui/form/form-actions/form-actions.js +26 -11
- package/core/components/ui/form/form-layout/form-layout.d.ts +5 -2
- package/core/components/ui/form/form-layout/form-layout.js +31 -9
- package/core/components/ui/form/input/input.d.ts +15 -18
- package/core/components/ui/form/input/input.js +87 -52
- package/core/components/ui/form/input/password-helper.d.ts +1 -1
- package/core/components/ui/form/input/password-helper.js +3 -2
- package/core/components/ui/form/input/same-value-helper.d.ts +1 -1
- package/core/components/ui/form/input/same-value-helper.js +1 -0
- package/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +2 -3
- package/core/components/ui/form/input-autocomplete/input-autocomplete.js +2 -6
- package/core/components/ui/form/radio/radio.d.ts +6 -0
- package/core/components/ui/form/radio/radio.js +7 -12
- package/core/components/ui/form/select/select.d.ts +23 -7
- package/core/components/ui/form/select/select.js +69 -38
- package/core/components/ui/form/textarea/textarea.d.ts +13 -13
- package/core/components/ui/form/textarea/textarea.js +29 -36
- package/core/components/ui/group/group.d.ts +11 -1
- package/core/components/ui/group/group.js +79 -17
- package/core/components/ui/icon/icon.d.ts +10 -3
- package/core/components/ui/icon/icon.js +16 -15
- package/core/components/ui/icon/icons.js +11 -8
- package/core/components/ui/icon/icons.json +1 -1
- package/core/components/ui/image/image.js +0 -5
- package/core/components/ui/link/link.d.ts +1 -1
- package/core/components/ui/link/link.js +2 -6
- package/core/components/ui/loader/loader.js +2 -8
- package/core/components/ui/menu/menu-item.js +4 -9
- package/core/components/ui/menu/menu.d.ts +9 -1
- package/core/components/ui/menu/menu.js +183 -27
- package/core/components/ui/modal/modal-actions.js +1 -6
- package/core/components/ui/modal/modal-close.d.ts +1 -0
- package/core/components/ui/modal/modal-close.js +14 -10
- package/core/components/ui/modal/modal-content.js +0 -5
- package/core/components/ui/modal/modal-subtitle.js +2 -6
- package/core/components/ui/modal/modal-title.js +0 -5
- package/core/components/ui/modal/modal.d.ts +7 -7
- package/core/components/ui/modal/modal.js +36 -36
- package/core/components/ui/pop/pop.d.ts +6 -5
- package/core/components/ui/pop/pop.js +44 -44
- package/core/components/ui/progress/progress.js +34 -32
- package/core/components/ui/table/table-caption.js +5 -10
- package/core/components/ui/table/table-tbody.js +10 -14
- package/core/components/ui/table/table-td.d.ts +2 -0
- package/core/components/ui/table/table-td.js +8 -5
- package/core/components/ui/table/table-tfoot.js +5 -7
- package/core/components/ui/table/table-th.d.ts +2 -0
- package/core/components/ui/table/table-th.js +12 -9
- package/core/components/ui/table/table-thead.js +1 -6
- package/core/components/ui/table/table-tr.js +4 -6
- package/core/components/ui/table/table.d.ts +0 -3
- package/core/components/ui/table/table.js +14 -31
- package/core/components/ui/taxonomy/taxonomy.d.ts +6 -3
- package/core/components/ui/taxonomy/taxonomy.js +9 -9
- package/core/components/ui/theme/theme-collection/core-variables.js +13 -11
- package/core/components/ui/theme/theme-collection/dark.js +1 -1
- package/core/components/ui/theme/theme.d.ts +1 -6
- package/core/components/ui/theme/theme.js +7 -36
- package/core/components/ui/toast/message-subscriber.d.ts +13 -7
- package/core/components/ui/toast/toast-item.js +1 -1
- package/core/components/ui/toast/toast.d.ts +2 -1
- package/core/components/ui/toast/toast.js +29 -14
- package/core/components/ui/tooltip/tooltip.d.ts +1 -0
- package/core/components/ui/tooltip/tooltip.js +35 -14
- package/core/components/ui/ui.js +0 -3
- package/core/core.js +5 -6
- package/core/mixins/Fetcher.d.ts +19 -10
- package/core/mixins/Fetcher.js +26 -10
- package/core/mixins/FormCheckable.d.ts +17 -8
- package/core/mixins/FormCheckable.js +177 -22
- package/core/mixins/FormElement.d.ts +12 -7
- package/core/mixins/FormElement.js +42 -26
- package/core/mixins/FormInput.d.ts +8 -4
- package/core/mixins/FormInput.js +4 -3
- package/core/mixins/Subscriber.d.ts +7 -5
- package/core/mixins/Subscriber.js +34 -32
- package/core/utils/Arrays.d.ts +15 -15
- package/core/utils/DataBindObserver.d.ts +16 -9
- package/core/utils/DataBindObserver.js +23 -28
- package/core/utils/Electron.d.ts +5 -1
- package/core/utils/Electron.js +4 -2
- package/core/utils/HTML.d.ts +9 -2
- package/core/utils/HTML.js +22 -3
- package/core/utils/LocationHandler.d.ts +6 -5
- package/core/utils/LocationHandler.js +19 -8
- package/core/utils/Objects.d.ts +7 -4
- package/core/utils/Objects.js +28 -6
- package/core/utils/{PublisherProxy.d.mts → PublisherProxy.d.ts} +40 -31
- package/core/utils/{PublisherProxy.mjs → PublisherProxy.js} +54 -28
- package/core/utils/Utils.d.ts +3 -0
- package/core/utils/Utils.js +18 -0
- package/core/utils/api.d.ts +39 -7
- package/core/utils/api.js +45 -32
- package/img/concorde-logo.svg +1 -0
- package/img/concorde.png +0 -0
- package/img/concorde_def.png +0 -0
- package/mixins.d.ts +36 -18
- package/mixins.js +3 -4
- package/package.json +45 -10
- package/svg/regular/plane.svg +1 -0
- package/svg/solid/plane.svg +1 -0
- package/test-utils/TestUtils.d.ts +4 -0
- package/test-utils/TestUtils.js +12 -0
- package/utils.d.ts +3 -1
- package/utils.js +7 -5
- package/core/components/functional/configuration/configuration.d.ts +0 -5
- package/core/components/functional/configuration/configuration.js +0 -22
- package/core/components/ui/tabs/tab.d.ts +0 -6
- package/core/components/ui/tabs/tab.js +0 -46
- package/core/components/ui/tabs/tabs.d.ts +0 -15
- package/core/components/ui/tabs/tabs.js +0 -129
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
3
|
-
* Merci de laisser ce fichier sans la moindre dépendance.
|
|
4
|
-
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
5
|
-
* **/
|
|
6
1
|
function isComplex(value) {
|
|
7
2
|
return typeof value === "object" && value != null;
|
|
8
3
|
}
|
|
@@ -10,17 +5,18 @@ function isComplex(value) {
|
|
|
10
5
|
* Custom Proxy contient les méthodes des publishers retournés par PublisherManager.get(publisherId) qui seront utilisées couramment
|
|
11
6
|
*/
|
|
12
7
|
export class PublisherProxy {
|
|
13
|
-
constructor(target, parentProxPub
|
|
8
|
+
constructor(target, parentProxPub) {
|
|
14
9
|
this._proxies_ = new Map();
|
|
15
|
-
this.
|
|
10
|
+
this._key_ = "";
|
|
16
11
|
this._invalidateListeners_ = new Set();
|
|
17
12
|
this._assignListeners_ = new Set();
|
|
18
13
|
this._mutationListeners_ = new Set();
|
|
19
14
|
this._fillListeners_ = new Set();
|
|
20
15
|
this._templateFillListeners_ = new Set();
|
|
21
16
|
this._lockInternalMutationPublishing_ = false;
|
|
22
|
-
this.parent = parentProxPub;
|
|
23
17
|
this.root = this;
|
|
18
|
+
this._value_ = target;
|
|
19
|
+
this.parent = parentProxPub || null;
|
|
24
20
|
while (this.root.parent) {
|
|
25
21
|
this.root = this.root.parent;
|
|
26
22
|
}
|
|
@@ -75,7 +71,7 @@ export class PublisherProxy {
|
|
|
75
71
|
_publishTemplateFilling_(key, value) {
|
|
76
72
|
this._templateFillListeners_.forEach((handler) => {
|
|
77
73
|
let desc = Object.getOwnPropertyDescriptor(handler, key);
|
|
78
|
-
if (desc && !desc.set)
|
|
74
|
+
if (desc && !desc.set && !desc.writable)
|
|
79
75
|
return;
|
|
80
76
|
if (handler.propertyMap && handler.propertyMap[key]) {
|
|
81
77
|
key = handler.propertyMap[key];
|
|
@@ -113,12 +109,14 @@ export class PublisherProxy {
|
|
|
113
109
|
* Stop les appels de la fonction "handler" (passée en paramettre) lorsque la donnée est flaggée comme invalide
|
|
114
110
|
*/
|
|
115
111
|
offInvalidate(handler) {
|
|
112
|
+
if (typeof handler != "function")
|
|
113
|
+
return;
|
|
116
114
|
this._invalidateListeners_.delete(handler);
|
|
117
115
|
}
|
|
118
116
|
/**
|
|
119
117
|
* Flag les données comme étant invalides
|
|
120
118
|
*/
|
|
121
|
-
invalidate(
|
|
119
|
+
invalidate() {
|
|
122
120
|
this._publishInvalidation_();
|
|
123
121
|
}
|
|
124
122
|
/**
|
|
@@ -135,6 +133,8 @@ export class PublisherProxy {
|
|
|
135
133
|
* Stop les Appels de la fonction "handler" (passée en paramettre) lorsque quelque chose change la valeur gérée par le proxy quelque soit la profondeur de la donnée
|
|
136
134
|
*/
|
|
137
135
|
offInternalMutation(handler) {
|
|
136
|
+
if (typeof handler != "function")
|
|
137
|
+
return;
|
|
138
138
|
this._mutationListeners_.delete(handler);
|
|
139
139
|
}
|
|
140
140
|
/**
|
|
@@ -181,12 +181,14 @@ export class PublisherProxy {
|
|
|
181
181
|
* Assigne une nouvelle valeur au proxy ce qui déclenche la transmission de la donnée en fonction des "écouteurs" associés
|
|
182
182
|
*/
|
|
183
183
|
set(newValue, lockInternalMutationsTransmission = false) {
|
|
184
|
+
var _a;
|
|
184
185
|
/**
|
|
185
186
|
* On retounre tout de suite si la valeur n'a pas changé
|
|
186
187
|
*/
|
|
187
188
|
if (this._value_ === newValue)
|
|
188
189
|
return true;
|
|
189
|
-
if (this._value_
|
|
190
|
+
if ("hasOwnProperty" in this._value_ &&
|
|
191
|
+
this._value_.hasOwnProperty("__value") &&
|
|
190
192
|
newValue.hasOwnProperty("__value") &&
|
|
191
193
|
this._value_.__value === newValue.__value) {
|
|
192
194
|
return true;
|
|
@@ -194,7 +196,8 @@ export class PublisherProxy {
|
|
|
194
196
|
/**
|
|
195
197
|
* On assigne la nouvelle valeur
|
|
196
198
|
*/
|
|
197
|
-
this._value_
|
|
199
|
+
const prevValue = this._value_;
|
|
200
|
+
this._value_ = isComplex(newValue) ? newValue : { __value: newValue };
|
|
198
201
|
/**
|
|
199
202
|
* Si il s'agit d'une valeur primitive (un entier, une chaine ) la valeure en renseignée par un objet contenant la vaeur {__value}
|
|
200
203
|
* On publie juste et on sen va.
|
|
@@ -210,14 +213,31 @@ export class PublisherProxy {
|
|
|
210
213
|
* On met à jour leur valeur interne
|
|
211
214
|
* On publie les maj au fur et a mesure de modifications
|
|
212
215
|
*/
|
|
216
|
+
for (let key in this._value_) {
|
|
217
|
+
if (typeof this._value_[key] === "undefined")
|
|
218
|
+
delete this._value_[key];
|
|
219
|
+
}
|
|
213
220
|
Array.from(this._proxies_.keys()).forEach((key) => {
|
|
214
221
|
/**
|
|
215
222
|
* On supprime les proxys qui ne sont plus dans la nouvelle valeur si ils n'on pas d'écouteurs
|
|
216
223
|
**/
|
|
217
|
-
if (
|
|
218
|
-
this._proxies_.
|
|
224
|
+
if (typeof this._value_[key] === "undefined" && this._proxies_.has(key)) {
|
|
225
|
+
const subProxy = this._proxies_.get(key);
|
|
226
|
+
if (!(subProxy === null || subProxy === void 0 ? void 0 : subProxy.hasListener())) {
|
|
227
|
+
this._proxies_.delete(key);
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
if (key != "_parent_") {
|
|
231
|
+
if (prevValue[key])
|
|
232
|
+
this._value_[key] = null;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
219
235
|
}
|
|
220
236
|
});
|
|
237
|
+
/**
|
|
238
|
+
* On prévient les écouteurs que la valeur a changé
|
|
239
|
+
*/
|
|
240
|
+
this._publishAssignement_();
|
|
221
241
|
/**
|
|
222
242
|
* Si la donnée est complexe (objet, tableau)
|
|
223
243
|
* on crée les proxys pour les sous-éléments qui n'en on pas
|
|
@@ -230,17 +250,13 @@ export class PublisherProxy {
|
|
|
230
250
|
let valueV = isVComplex ? v : { __value: v };
|
|
231
251
|
if (!this._proxies_.has(key)) {
|
|
232
252
|
let newPublisher = new Publisher({}, this);
|
|
233
|
-
this._proxies_.set(key, newPublisher
|
|
253
|
+
this._proxies_.set(key, newPublisher);
|
|
234
254
|
newPublisher._proxies_.set("_parent_", this);
|
|
235
255
|
}
|
|
236
|
-
this._proxies_.get(key).set(valueV, true);
|
|
256
|
+
(_a = this._proxies_.get(key)) === null || _a === void 0 ? void 0 : _a.set(valueV, true);
|
|
237
257
|
this._publishDynamicFilling_(key, v);
|
|
238
258
|
}
|
|
239
259
|
}
|
|
240
|
-
/**
|
|
241
|
-
* On prévient les écouteurs que la valeur a changé
|
|
242
|
-
*/
|
|
243
|
-
this._publishAssignement_();
|
|
244
260
|
return true;
|
|
245
261
|
}
|
|
246
262
|
/**
|
|
@@ -261,10 +277,10 @@ export class PublisherProxy {
|
|
|
261
277
|
*/
|
|
262
278
|
export class PublisherManager {
|
|
263
279
|
constructor() {
|
|
280
|
+
this.publishers = new Map();
|
|
264
281
|
if (PublisherManager.instance != null)
|
|
265
282
|
throw "Singleton / use getInstance";
|
|
266
283
|
PublisherManager.instance = this;
|
|
267
|
-
this.publishers = new Map();
|
|
268
284
|
}
|
|
269
285
|
/**
|
|
270
286
|
* PublisherManager est un singleton
|
|
@@ -309,8 +325,8 @@ export class PublisherManager {
|
|
|
309
325
|
delete(id) {
|
|
310
326
|
if (!this.publishers.has(id))
|
|
311
327
|
return false;
|
|
312
|
-
const publisher = this.publishers.get(id);
|
|
313
328
|
this.publishers.delete(id);
|
|
329
|
+
return true;
|
|
314
330
|
}
|
|
315
331
|
}
|
|
316
332
|
PublisherManager.instance = null;
|
|
@@ -328,6 +344,7 @@ export default class Publisher extends PublisherProxy {
|
|
|
328
344
|
* Sinon un autre proxy qui a comme valeur interne la valeur corespondante à la clef dans l'objet.
|
|
329
345
|
*/
|
|
330
346
|
get: function (oTarget, sKey) {
|
|
347
|
+
oTarget;
|
|
331
348
|
if ([
|
|
332
349
|
"invalidate",
|
|
333
350
|
"onInvalidate",
|
|
@@ -373,6 +390,7 @@ export default class Publisher extends PublisherProxy {
|
|
|
373
390
|
* Les gestionnairs associés sopnt déclenchés en conséquence de manière profonde et remontante si nécessaire.
|
|
374
391
|
*/
|
|
375
392
|
set: function (oTarget, sKey, vValue) {
|
|
393
|
+
var _a;
|
|
376
394
|
//Fonctionnement pour la donnée interne pas de dispatch;
|
|
377
395
|
if (sKey == "_value_") {
|
|
378
396
|
oTarget._value_ = vValue;
|
|
@@ -389,7 +407,7 @@ export default class Publisher extends PublisherProxy {
|
|
|
389
407
|
if (prevValue !== vValue) {
|
|
390
408
|
that._value_[sKey] = vValue;
|
|
391
409
|
that._publishDynamicFilling_(sKey, vValue);
|
|
392
|
-
that._proxies_.get(sKey).set(isComplex(vValue) ? vValue : { __value: vValue });
|
|
410
|
+
(_a = that._proxies_.get(sKey)) === null || _a === void 0 ? void 0 : _a.set(isComplex(vValue) ? vValue : { __value: vValue });
|
|
393
411
|
}
|
|
394
412
|
//on retourne le proxy pour pouvoir chainer les assignements
|
|
395
413
|
return that._proxies_.get(sKey);
|
|
@@ -398,38 +416,46 @@ export default class Publisher extends PublisherProxy {
|
|
|
398
416
|
* Autres propriétés classiques d'un objet implémentées par le proxy
|
|
399
417
|
*/
|
|
400
418
|
deleteProperty: function (oTarget, sKey) {
|
|
419
|
+
oTarget;
|
|
401
420
|
// that._proxies_.get(sKey).set(null);
|
|
402
421
|
that._publishDynamicFilling_(sKey, null);
|
|
403
422
|
that._proxies_.delete(sKey);
|
|
404
423
|
return delete that._value_[sKey];
|
|
405
424
|
},
|
|
406
|
-
enumerate: function (oTarget, sKey) {
|
|
407
|
-
|
|
408
|
-
},
|
|
425
|
+
// enumerate: function (oTarget, sKey): any {
|
|
426
|
+
// return that._value_.keys();
|
|
427
|
+
// },
|
|
409
428
|
has: function (oTarget, sKey) {
|
|
429
|
+
oTarget;
|
|
410
430
|
return sKey in that._value_ && sKey != "_lockInternalMutationPublishing_";
|
|
411
431
|
},
|
|
412
432
|
defineProperty: function (oTarget, sKey, oDesc) {
|
|
433
|
+
oTarget;
|
|
413
434
|
if (oDesc && "value" in oDesc) {
|
|
414
435
|
that._value_[sKey] = oDesc.value;
|
|
415
436
|
}
|
|
416
437
|
return that._value_;
|
|
417
438
|
},
|
|
418
439
|
getOwnPropertyDescriptor: function (oTarget, sKey) {
|
|
419
|
-
|
|
440
|
+
oTarget;
|
|
441
|
+
sKey;
|
|
420
442
|
return {
|
|
421
443
|
enumerable: true,
|
|
422
444
|
configurable: true,
|
|
423
445
|
};
|
|
424
446
|
},
|
|
425
447
|
ownKeys: function (target) {
|
|
448
|
+
target;
|
|
426
449
|
if (that._value_.__value)
|
|
427
|
-
return Object.keys(
|
|
450
|
+
return Object.keys(that._value_.__value);
|
|
428
451
|
return Object.keys(that._value_);
|
|
429
452
|
},
|
|
430
453
|
});
|
|
431
454
|
return thisProxy;
|
|
432
455
|
}
|
|
456
|
+
getProperty(o, propertyName) {
|
|
457
|
+
return o[propertyName]; // o[propertyName] is of type T[K]
|
|
458
|
+
}
|
|
433
459
|
}
|
|
434
460
|
if (typeof module != "undefined")
|
|
435
461
|
module.exports = { Publisher: Publisher, PublisherManager: PublisherManager };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
export default class Utils {
|
|
11
|
+
static delayPromise(timeoutMs) {
|
|
12
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
13
|
+
return new Promise((resolve) => {
|
|
14
|
+
setTimeout(resolve, timeoutMs);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
package/core/utils/api.d.ts
CHANGED
|
@@ -4,8 +4,12 @@ export declare type APIConfiguration = {
|
|
|
4
4
|
userName: string | null;
|
|
5
5
|
password: string | null;
|
|
6
6
|
tokenProvider: string | null;
|
|
7
|
+
addHTTPResponse?: boolean;
|
|
8
|
+
credentials?: RequestCredentials;
|
|
7
9
|
};
|
|
8
|
-
declare class API {
|
|
10
|
+
declare class API<ResultType = any & {
|
|
11
|
+
_sonic_http_response_?: Response;
|
|
12
|
+
}, SendType = any> {
|
|
9
13
|
/**
|
|
10
14
|
* Ce tableau static permet de ne pas appeler plusieurs fois le même service lors d'appel concurrents en GET.
|
|
11
15
|
*/
|
|
@@ -30,16 +34,29 @@ declare class API {
|
|
|
30
34
|
* Le endPoint pour obtenir le bearer token qui sera concaténé à l'url du service
|
|
31
35
|
*/
|
|
32
36
|
tokenProvider: string | null;
|
|
37
|
+
/**
|
|
38
|
+
* credentials
|
|
39
|
+
*/
|
|
40
|
+
credentials?: RequestCredentials;
|
|
33
41
|
/**
|
|
34
42
|
* Tableau static des tokens stokés en memoire vive (comportement à revoir à l'occasion)
|
|
35
43
|
*/
|
|
36
44
|
static tokens: Map<string | null, string | null | undefined>;
|
|
45
|
+
/**
|
|
46
|
+
* Le endPoint pour obtenir le bearer token qui sera concaténé à l'url du service
|
|
47
|
+
*/
|
|
48
|
+
addHTTPResponse: Boolean;
|
|
49
|
+
lastResult?: Response;
|
|
37
50
|
constructor(config: APIConfiguration);
|
|
51
|
+
handleResult(fetchResult: Response): Promise<ResultType & {
|
|
52
|
+
_sonic_http_response_?: Response | undefined;
|
|
53
|
+
text?: string | undefined;
|
|
54
|
+
}>;
|
|
38
55
|
/**
|
|
39
56
|
* Basic auth
|
|
40
57
|
*/
|
|
41
58
|
auth(): Promise<void>;
|
|
42
|
-
get(path: String, additionalHeaders?: HeadersInit): Promise<
|
|
59
|
+
get(path: String, additionalHeaders?: HeadersInit): Promise<ResultType>;
|
|
43
60
|
/**
|
|
44
61
|
* Création du header, avec authentification si besoin
|
|
45
62
|
* ajout du language via le header accept-language qui contient le langue du navigateur
|
|
@@ -49,22 +66,37 @@ declare class API {
|
|
|
49
66
|
* Concatène le serviceURL et le endpoint donné en paramètre
|
|
50
67
|
*/
|
|
51
68
|
computeURL(path: String): string;
|
|
52
|
-
send(path: String, data:
|
|
69
|
+
send(path: String, data: SendType, method?: string, additionalHeaders?: HeadersInit): Promise<ResultType & {
|
|
70
|
+
_sonic_http_response_?: Response | undefined;
|
|
71
|
+
text?: string | undefined;
|
|
72
|
+
}>;
|
|
53
73
|
/**
|
|
54
74
|
* Agit comme une soumission de formulaire, mais attends un json en réponse
|
|
55
75
|
*/
|
|
56
|
-
submitFormData(path: String, data:
|
|
76
|
+
submitFormData(path: String, data: SendType | Record<string, string | Blob>, method?: string, additionalHeaders?: HeadersInit): Promise<ResultType & {
|
|
77
|
+
_sonic_http_response_?: Response | undefined;
|
|
78
|
+
text?: string | undefined;
|
|
79
|
+
}>;
|
|
57
80
|
/**
|
|
58
81
|
* Appel send en utilisant le méthode PUT
|
|
59
82
|
*/
|
|
60
|
-
put(path: String, data:
|
|
83
|
+
put(path: String, data: SendType, additionalHeaders?: HeadersInit): Promise<ResultType & {
|
|
84
|
+
_sonic_http_response_?: Response | undefined;
|
|
85
|
+
text?: string | undefined;
|
|
86
|
+
}>;
|
|
61
87
|
/**
|
|
62
88
|
* Appel send en utilisant le méthode POST
|
|
63
89
|
*/
|
|
64
|
-
post(path: String, data:
|
|
90
|
+
post(path: String, data: SendType, additionalHeaders?: HeadersInit): Promise<ResultType & {
|
|
91
|
+
_sonic_http_response_?: Response | undefined;
|
|
92
|
+
text?: string | undefined;
|
|
93
|
+
}>;
|
|
65
94
|
/**
|
|
66
95
|
* Appel send en utilisant le méthode delete
|
|
67
96
|
*/
|
|
68
|
-
delete(path: String, data:
|
|
97
|
+
delete(path: String, data: SendType, additionalHeaders?: HeadersInit): Promise<ResultType & {
|
|
98
|
+
_sonic_http_response_?: Response | undefined;
|
|
99
|
+
text?: string | undefined;
|
|
100
|
+
}>;
|
|
69
101
|
}
|
|
70
102
|
export default API;
|
package/core/utils/api.js
CHANGED
|
@@ -8,9 +8,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import HTML from "@supersoniks/concorde/core/utils/HTML";
|
|
11
|
-
import Objects from "
|
|
11
|
+
import Objects from "@supersoniks/concorde/core/utils/Objects";
|
|
12
12
|
class API {
|
|
13
13
|
constructor(config) {
|
|
14
|
+
/**
|
|
15
|
+
* Le endPoint pour obtenir le bearer token qui sera concaténé à l'url du service
|
|
16
|
+
*/
|
|
17
|
+
this.addHTTPResponse = false;
|
|
14
18
|
this.serviceURL = config.serviceURL;
|
|
15
19
|
if (!this.serviceURL)
|
|
16
20
|
this.serviceURL = document.location.origin;
|
|
@@ -18,6 +22,32 @@ class API {
|
|
|
18
22
|
this.password = config.password;
|
|
19
23
|
this.token = config.token;
|
|
20
24
|
this.tokenProvider = config.tokenProvider;
|
|
25
|
+
this.addHTTPResponse = config.addHTTPResponse || false;
|
|
26
|
+
this.credentials = config.credentials;
|
|
27
|
+
}
|
|
28
|
+
handleResult(fetchResult) {
|
|
29
|
+
var _a;
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
this.lastResult = fetchResult;
|
|
32
|
+
const contentType = (_a = fetchResult.headers.get("content-type")) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
33
|
+
let result = {};
|
|
34
|
+
if (contentType && contentType.indexOf("text/") == 0) {
|
|
35
|
+
let str = yield fetchResult.text();
|
|
36
|
+
result = { text: str };
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
try {
|
|
40
|
+
result = yield fetchResult.json();
|
|
41
|
+
}
|
|
42
|
+
catch (e) {
|
|
43
|
+
result = {};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (this.addHTTPResponse && Objects.isObject(result)) {
|
|
47
|
+
result._sonic_http_response_ = fetchResult;
|
|
48
|
+
}
|
|
49
|
+
return result;
|
|
50
|
+
});
|
|
21
51
|
}
|
|
22
52
|
/**
|
|
23
53
|
* Basic auth
|
|
@@ -35,7 +65,10 @@ class API {
|
|
|
35
65
|
let headers = {
|
|
36
66
|
Authorization: "Basic " + window.btoa(unescape(encodeURIComponent(this.userName + ":" + this.password))),
|
|
37
67
|
};
|
|
38
|
-
let result = yield fetch(this.computeURL(this.tokenProvider), {
|
|
68
|
+
let result = yield fetch(this.computeURL(this.tokenProvider), {
|
|
69
|
+
headers: headers,
|
|
70
|
+
credentials: this.credentials,
|
|
71
|
+
});
|
|
39
72
|
try {
|
|
40
73
|
let json = yield result.json();
|
|
41
74
|
this.token = json.token;
|
|
@@ -50,17 +83,9 @@ class API {
|
|
|
50
83
|
const url = this.computeURL(path);
|
|
51
84
|
if (!API.loadingGetPromises.has(url)) {
|
|
52
85
|
let promise = new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
let result = yield fetch(url, { headers: headers });
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (Objects.isObject(json)) {
|
|
57
|
-
json._sonic_http_response_ = result;
|
|
58
|
-
}
|
|
59
|
-
resolve(json);
|
|
60
|
-
}
|
|
61
|
-
catch (e) {
|
|
62
|
-
resolve({ _sonic_http_response_: result });
|
|
63
|
-
}
|
|
86
|
+
let result = yield fetch(url, { headers: headers, credentials: this.credentials });
|
|
87
|
+
let handledResult = yield this.handleResult(result);
|
|
88
|
+
resolve(handledResult);
|
|
64
89
|
}));
|
|
65
90
|
API.loadingGetPromises.set(url, promise);
|
|
66
91
|
}
|
|
@@ -79,7 +104,6 @@ class API {
|
|
|
79
104
|
let headers = {};
|
|
80
105
|
if (this.token)
|
|
81
106
|
headers.Authorization = "Bearer " + this.token;
|
|
82
|
-
headers.credentials = "include";
|
|
83
107
|
headers["Accept-Language"] = HTML.getLanguage();
|
|
84
108
|
if (additionalHeaders) {
|
|
85
109
|
Object.assign(headers, additionalHeaders);
|
|
@@ -103,17 +127,11 @@ class API {
|
|
|
103
127
|
headers["Content-Type"] = "application/json";
|
|
104
128
|
let result = yield fetch(this.computeURL(path), {
|
|
105
129
|
headers: headers,
|
|
130
|
+
credentials: this.credentials,
|
|
106
131
|
method: method,
|
|
107
132
|
body: JSON.stringify(data),
|
|
108
133
|
});
|
|
109
|
-
|
|
110
|
-
let json = yield result.json();
|
|
111
|
-
json._sonic_http_response_ = result;
|
|
112
|
-
return json;
|
|
113
|
-
}
|
|
114
|
-
catch (e) {
|
|
115
|
-
return { _sonic_http_response_: result };
|
|
116
|
-
}
|
|
134
|
+
return yield this.handleResult(result);
|
|
117
135
|
});
|
|
118
136
|
}
|
|
119
137
|
/**
|
|
@@ -124,21 +142,16 @@ class API {
|
|
|
124
142
|
let headers = yield this.createHeaders(additionalHeaders);
|
|
125
143
|
headers["Accept"] = "application/json";
|
|
126
144
|
let formData = new FormData();
|
|
127
|
-
|
|
128
|
-
|
|
145
|
+
const dynamicData = data;
|
|
146
|
+
for (let z in dynamicData)
|
|
147
|
+
formData.set(z, dynamicData[z]);
|
|
129
148
|
let result = yield fetch(this.computeURL(path), {
|
|
130
149
|
headers: headers,
|
|
150
|
+
credentials: this.credentials,
|
|
131
151
|
method: method,
|
|
132
152
|
body: formData,
|
|
133
153
|
});
|
|
134
|
-
|
|
135
|
-
let json = yield result.json();
|
|
136
|
-
json._sonic_http_response_ = result;
|
|
137
|
-
return json;
|
|
138
|
-
}
|
|
139
|
-
catch (e) {
|
|
140
|
-
return { _sonic_http_response_: result };
|
|
141
|
-
}
|
|
154
|
+
return yield this.handleResult(result);
|
|
142
155
|
});
|
|
143
156
|
}
|
|
144
157
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="222.442" height="47.558" viewBox="0 0 222.442 47.558"><g transform="translate(-51.885 -25)"><path d="M11.045.384A9.984,9.984,0,0,1,5.862-.9,8.546,8.546,0,0,1,2.538-4.474,11.519,11.519,0,0,1,1.381-9.741a11.462,11.462,0,0,1,1.17-5.3,8.651,8.651,0,0,1,3.33-3.567,9.872,9.872,0,0,1,5.139-1.285,10.228,10.228,0,0,1,4.5.933,7.522,7.522,0,0,1,3.055,2.621,7.7,7.7,0,0,1,1.24,3.963H14.676a4.017,4.017,0,0,0-1.144-2.371,3.328,3.328,0,0,0-2.423-.9,3.647,3.647,0,0,0-2.205.684A4.416,4.416,0,0,0,7.44-12.976a8.472,8.472,0,0,0-.524,3.158,8.75,8.75,0,0,0,.518,3.2A4.393,4.393,0,0,0,8.9-4.615a3.651,3.651,0,0,0,2.212.69,3.63,3.63,0,0,0,1.681-.384,3.279,3.279,0,0,0,1.24-1.119A4.261,4.261,0,0,0,14.676-7.2h5.139a8.049,8.049,0,0,1-1.221,3.957A7.443,7.443,0,0,1,15.584-.575,10.038,10.038,0,0,1,11.045.384Zm19.7,0A9.985,9.985,0,0,1,25.6-.888a8.6,8.6,0,0,1-3.343-3.554,11.411,11.411,0,0,1-1.176-5.3,11.469,11.469,0,0,1,1.176-5.325A8.6,8.6,0,0,1,25.6-18.62a9.985,9.985,0,0,1,5.146-1.272A9.985,9.985,0,0,1,35.9-18.62a8.6,8.6,0,0,1,3.343,3.554,11.469,11.469,0,0,1,1.176,5.325,11.411,11.411,0,0,1-1.176,5.3A8.6,8.6,0,0,1,35.9-.888,9.985,9.985,0,0,1,30.75.384Zm.026-4.219a3.367,3.367,0,0,0,2.263-.773,4.757,4.757,0,0,0,1.374-2.116A9.279,9.279,0,0,0,34.88-9.78a9.279,9.279,0,0,0-.467-3.055,4.8,4.8,0,0,0-1.374-2.122,3.35,3.35,0,0,0-2.263-.78,3.443,3.443,0,0,0-2.295.78,4.726,4.726,0,0,0-1.393,2.122,9.279,9.279,0,0,0-.467,3.055,9.279,9.279,0,0,0,.467,3.055,4.681,4.681,0,0,0,1.393,2.116A3.461,3.461,0,0,0,30.776-3.835Zm17.2-7.517V0H42.529V-19.636h5.19v3.464h.23a5.512,5.512,0,0,1,2.186-2.717,6.647,6.647,0,0,1,3.72-1A6.906,6.906,0,0,1,57.423-19a6.091,6.091,0,0,1,2.365,2.55,8.589,8.589,0,0,1,.844,3.944V0H55.185V-11.531a3.968,3.968,0,0,0-.92-2.819,3.315,3.315,0,0,0-2.57-1.016,3.87,3.87,0,0,0-1.937.473,3.253,3.253,0,0,0-1.3,1.374A4.769,4.769,0,0,0,47.975-11.352ZM72.346.384A9.985,9.985,0,0,1,67.162-.9a8.546,8.546,0,0,1-3.324-3.573,11.519,11.519,0,0,1-1.157-5.267,11.462,11.462,0,0,1,1.17-5.3,8.651,8.651,0,0,1,3.33-3.567,9.872,9.872,0,0,1,5.139-1.285,10.228,10.228,0,0,1,4.5.933,7.522,7.522,0,0,1,3.055,2.621,7.7,7.7,0,0,1,1.24,3.963H75.977a4.017,4.017,0,0,0-1.144-2.371,3.328,3.328,0,0,0-2.423-.9,3.647,3.647,0,0,0-2.205.684,4.416,4.416,0,0,0-1.464,1.988,8.472,8.472,0,0,0-.524,3.158,8.75,8.75,0,0,0,.518,3.2A4.393,4.393,0,0,0,70.2-4.615a3.651,3.651,0,0,0,2.212.69,3.63,3.63,0,0,0,1.681-.384,3.279,3.279,0,0,0,1.24-1.119A4.261,4.261,0,0,0,75.977-7.2h5.139A8.049,8.049,0,0,1,79.9-3.241,7.443,7.443,0,0,1,76.885-.575,10.038,10.038,0,0,1,72.346.384Zm19.7,0A9.985,9.985,0,0,1,86.905-.888a8.6,8.6,0,0,1-3.343-3.554,11.411,11.411,0,0,1-1.176-5.3,11.469,11.469,0,0,1,1.176-5.325,8.6,8.6,0,0,1,3.343-3.554,9.985,9.985,0,0,1,5.146-1.272A9.985,9.985,0,0,1,97.2-18.62a8.6,8.6,0,0,1,3.343,3.554,11.469,11.469,0,0,1,1.176,5.325,11.411,11.411,0,0,1-1.176,5.3A8.6,8.6,0,0,1,97.2-.888,9.985,9.985,0,0,1,92.051.384Zm.026-4.219a3.367,3.367,0,0,0,2.263-.773,4.757,4.757,0,0,0,1.374-2.116A9.279,9.279,0,0,0,96.18-9.78a9.279,9.279,0,0,0-.467-3.055,4.8,4.8,0,0,0-1.374-2.122,3.35,3.35,0,0,0-2.263-.78,3.443,3.443,0,0,0-2.295.78,4.726,4.726,0,0,0-1.393,2.122,9.278,9.278,0,0,0-.467,3.055,9.278,9.278,0,0,0,.467,3.055,4.681,4.681,0,0,0,1.393,2.116A3.461,3.461,0,0,0,92.077-3.835ZM103.83,0V-19.636h5.28v3.426h.2a5.1,5.1,0,0,1,1.8-2.768,4.76,4.76,0,0,1,2.915-.94,8.238,8.238,0,0,1,.882.051,6.212,6.212,0,0,1,.831.141v4.832a7.115,7.115,0,0,0-1.061-.2,9.532,9.532,0,0,0-1.24-.089,4.363,4.363,0,0,0-2.141.518,3.847,3.847,0,0,0-1.483,1.438,4.1,4.1,0,0,0-.543,2.122V0Zm19.59.32a7.351,7.351,0,0,1-4.046-1.157,7.876,7.876,0,0,1-2.864-3.413,13.041,13.041,0,0,1-1.055-5.542,12.858,12.858,0,0,1,1.087-5.619,7.829,7.829,0,0,1,2.9-3.362,7.4,7.4,0,0,1,3.969-1.119,6.1,6.1,0,0,1,2.755.556,5.484,5.484,0,0,1,1.79,1.381,7.22,7.22,0,0,1,1.042,1.617h.166v-9.844h5.433V0h-5.369V-3.145h-.23a7,7,0,0,1-1.08,1.617,5.443,5.443,0,0,1-1.8,1.323A6.249,6.249,0,0,1,123.42.32Zm1.726-4.334a3.487,3.487,0,0,0,2.231-.722,4.56,4.56,0,0,0,1.406-2.026,8.637,8.637,0,0,0,.492-3.055,8.632,8.632,0,0,0-.486-3.043,4.367,4.367,0,0,0-1.406-1.994,3.577,3.577,0,0,0-2.237-.7,3.532,3.532,0,0,0-2.263.729,4.456,4.456,0,0,0-1.393,2.02,8.677,8.677,0,0,0-.473,2.991,8.776,8.776,0,0,0,.479,3.023,4.56,4.56,0,0,0,1.393,2.045A3.485,3.485,0,0,0,125.146-4.014Zm21.418,4.4a10.412,10.412,0,0,1-5.21-1.234A8.345,8.345,0,0,1,138-4.353a11.538,11.538,0,0,1-1.176-5.376A11.479,11.479,0,0,1,138-15.047a8.681,8.681,0,0,1,3.317-3.567,9.628,9.628,0,0,1,5.031-1.278,10.393,10.393,0,0,1,3.624.62,8.169,8.169,0,0,1,2.94,1.86,8.473,8.473,0,0,1,1.962,3.113,12.434,12.434,0,0,1,.7,4.379v1.5H139V-11.8H150.45a4.172,4.172,0,0,0-.511-2.084,3.721,3.721,0,0,0-1.413-1.425,4.122,4.122,0,0,0-2.09-.518,4.193,4.193,0,0,0-2.192.569,4.08,4.08,0,0,0-1.489,1.521,4.333,4.333,0,0,0-.55,2.116v3.209a5.462,5.462,0,0,0,.543,2.518,3.889,3.889,0,0,0,1.54,1.636,4.653,4.653,0,0,0,2.365.575,5.15,5.15,0,0,0,1.662-.256,3.449,3.449,0,0,0,1.291-.767,3.335,3.335,0,0,0,.818-1.253l5.037.332A6.866,6.866,0,0,1,153.9-2.461a7.868,7.868,0,0,1-3.043,2.1A11.435,11.435,0,0,1,146.563.384Zm14.31-.051a2.954,2.954,0,0,1-2.167-.9,2.954,2.954,0,0,1-.9-2.167,2.919,2.919,0,0,1,.9-2.148,2.965,2.965,0,0,1,2.167-.895,2.985,2.985,0,0,1,2.148.895,2.889,2.889,0,0,1,.92,2.148,2.884,2.884,0,0,1-.428,1.54,3.286,3.286,0,0,1-1.119,1.112A2.9,2.9,0,0,1,160.873.332Z" transform="translate(110.385 62)" fill="#2a282d"/><g transform="translate(51.885 25)"><g transform="translate(2.6 2.209)"><path d="M52.661,65.423h-1.4l-.091-.468h-.208l-.078.351-.078.065H49.646l-.065-.169-.091-.338h-.221v.208l-.118.065-3.859-.326L44.5,64.4v-.871a7.436,7.436,0,0,1,.156-1.079c.182-.883.546-1.962,2.833-5.224s3.08-4.481,4.665-10.3l.078-.324c.468-1.975.806-3.132.936-3.547V34.524a25.625,25.625,0,0,1,.312-2.82h0c.143-.923.312-1.754.468-2.4a21.623,21.623,0,0,0,.195,43.218,41.171,41.171,0,0,1-.845-6.8.668.668,0,0,0-.637-.3Z" transform="translate(-33.181 -29.3)" fill="#2a282d"/><path d="M34.658,65.423h1.4l.091-.468h.209l.078.351.078.065h1.157l.065-.169.091-.338h.221v.208l.118.065,3.857-.326.793-.416v-.871a7.436,7.436,0,0,0-.156-1.079c-.182-.883-.546-1.962-2.833-5.224s-3.08-4.481-4.665-10.3l-.078-.324c-.468-1.975-.806-3.132-.936-3.547V34.524a25.63,25.63,0,0,0-.312-2.82h0c-.143-.923-.312-1.754-.468-2.4a21.623,21.623,0,0,1-.195,43.218,41.171,41.171,0,0,0,.845-6.8.668.668,0,0,1,.637-.3Z" transform="translate(-11.738 -29.3)" fill="#2a282d"/></g><path d="M23.779,1.169a22.61,22.61,0,1,0,22.61,22.61,22.61,22.61,0,0,0-22.61-22.61m0-1.169A23.779,23.779,0,1,1,0,23.779,23.779,23.779,0,0,1,23.779,0Z" transform="translate(0 0)" fill="#2a282d"/></g></g></svg>
|
package/img/concorde.png
ADDED
|
Binary file
|
|
Binary file
|
package/mixins.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
export declare const Fetcher: <PropsType = any, T extends new (...args: any[]) => mySubscriber.SubscriberInterface<PropsType> = any>(superClass: T, propsType?: PropsType | undefined) => {
|
|
2
3
|
new (...args: any[]): {
|
|
3
|
-
api: import("./core/utils/api").default | null;
|
|
4
|
+
api: import("./core/utils/api").default<any, any> | null;
|
|
4
5
|
key: String;
|
|
5
6
|
isFirstLoad: boolean;
|
|
6
7
|
isLoading: boolean;
|
|
@@ -9,13 +10,16 @@ export declare const Fetcher: <T extends new (...args: any[]) => mySubscriber.Su
|
|
|
9
10
|
isFetchEnabled: boolean;
|
|
10
11
|
_endPoint: string;
|
|
11
12
|
endPoint: string;
|
|
13
|
+
requestId: number;
|
|
14
|
+
refetchEveryMs: number;
|
|
15
|
+
refetchTimeOutId?: NodeJS.Timeout | undefined;
|
|
12
16
|
_fetchData(): Promise<void>;
|
|
13
|
-
onInvalidate
|
|
17
|
+
onInvalidate?: (() => void) | undefined;
|
|
14
18
|
disconnectedCallback(): void;
|
|
15
19
|
connectedCallback(): void;
|
|
16
20
|
firstUpdated(): void;
|
|
17
21
|
onIntersection(entries: IntersectionObserverEntry[]): void;
|
|
18
|
-
props:
|
|
22
|
+
props: PropsType | null;
|
|
19
23
|
propertyMap: Object;
|
|
20
24
|
isConnected: boolean;
|
|
21
25
|
getAncestorAttributeValue(attributeName: string): string;
|
|
@@ -27,6 +31,7 @@ export declare const Fetcher: <T extends new (...args: any[]) => mySubscriber.Su
|
|
|
27
31
|
debug: HTMLElement | null;
|
|
28
32
|
defferedDebug: boolean | null;
|
|
29
33
|
displayContents: boolean;
|
|
34
|
+
shadowRoot?: ShadowRoot | undefined;
|
|
30
35
|
dispatchEvent(event: Event): void;
|
|
31
36
|
setAttribute(name: string, value: string): void;
|
|
32
37
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
@@ -46,22 +51,32 @@ export declare const FormCheckable: <T extends new (...args: any[]) => myFormEle
|
|
|
46
51
|
forceAutoFill: boolean;
|
|
47
52
|
unique: true | null;
|
|
48
53
|
radio: true | null;
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
unCheckOnDisconnect: boolean;
|
|
55
|
+
_checked: true | "indeterminate" | null;
|
|
56
|
+
checked: true | "indeterminate" | null;
|
|
51
57
|
validateFormElement(): void;
|
|
52
|
-
|
|
58
|
+
checksAll(): boolean;
|
|
59
|
+
setCheckedValue(checked: true | "indeterminate" | null): void;
|
|
53
60
|
handleChange(): void;
|
|
54
61
|
getValueForFormPublisher(): any;
|
|
55
|
-
setFormValueFromPublisher(value:
|
|
56
|
-
|
|
62
|
+
setFormValueFromPublisher(value: string | (string | null)[] | null): void;
|
|
63
|
+
getCheckAllPublisher(): any;
|
|
64
|
+
updateAllChecked: () => void;
|
|
65
|
+
onChecksAllRequest: (value: string) => void;
|
|
66
|
+
disconnectedCallback(): void;
|
|
67
|
+
connectedCallback(): void;
|
|
57
68
|
getFormPublisher(): any;
|
|
58
69
|
updateDataValue(): void;
|
|
59
|
-
handleBlur(e?:
|
|
70
|
+
handleBlur(e?: Event | undefined): void;
|
|
71
|
+
focus?: (() => void) | undefined;
|
|
72
|
+
shadowRoot?: ShadowRoot | undefined;
|
|
60
73
|
error: boolean;
|
|
61
74
|
autofocus: boolean;
|
|
62
75
|
required: boolean;
|
|
63
76
|
disabled: true | null;
|
|
64
77
|
formDataProvider: string;
|
|
78
|
+
ariaLabelledby?: string | undefined;
|
|
79
|
+
ariaLabel?: string | undefined;
|
|
65
80
|
_name: string;
|
|
66
81
|
name: string;
|
|
67
82
|
props: any;
|
|
@@ -81,16 +96,15 @@ export declare const FormCheckable: <T extends new (...args: any[]) => myFormEle
|
|
|
81
96
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
82
97
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
|
|
83
98
|
removeAttribute(name: string): void;
|
|
99
|
+
initPublisher(): void;
|
|
84
100
|
getApiConfiguration(): import("./core/utils/api").APIConfiguration;
|
|
85
|
-
connectedCallback(): void;
|
|
86
101
|
requestUpdate(): void;
|
|
87
102
|
getAttribute(name: string): string;
|
|
88
103
|
hasAttribute(attributeName: String): boolean;
|
|
89
|
-
disconnectedCallback(): void;
|
|
90
104
|
};
|
|
91
105
|
} & T;
|
|
92
106
|
import * as myFormElement from "@supersoniks/concorde/core/mixins/FormElement";
|
|
93
|
-
export declare const FormElement: <T extends new (...args: any[]) => mySubscriber.SubscriberInterface
|
|
107
|
+
export declare const FormElement: <T extends new (...args: any[]) => mySubscriber.SubscriberInterface<any>>(superClass: T) => (new (...args: any[]) => myFormElement.FormElementInterface) & T;
|
|
94
108
|
export declare const FormInput: <T extends new (...args: any[]) => myFormElement.FormElementInterface>(superClass: T) => {
|
|
95
109
|
new (...args: any[]): {
|
|
96
110
|
validateFormElement(): void;
|
|
@@ -105,16 +119,20 @@ export declare const FormInput: <T extends new (...args: any[]) => myFormElement
|
|
|
105
119
|
autocomplete?: "url" | "name" | "language" | "on" | "tel" | "email" | "honorific-prefix" | "given-name" | "additional-name" | "family-name" | "honorific-suffix" | "nickname" | "username" | "new-password" | "current-password" | "one-time-code" | "organization-title" | "organization" | "street-address" | "address-line1" | "address-line2" | "address-line3" | "address-level4" | "address-level3" | "address-level2" | "address-level1" | "country" | "country-name" | "postal-code" | "cc-name" | "cc-given-name" | "cc-additional-name" | "cc-family-name" | "cc-number" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-csc" | "cc-type" | "transaction-currency" | "transaction-amount" | "bday" | "bday-day" | "bday-month" | "bday-year" | "sex" | "tel-country-code" | "tel-national" | "tel-area-code" | "tel-local" | "tel-extension" | "impp" | "photo" | undefined;
|
|
106
120
|
getFormPublisher(): any;
|
|
107
121
|
updateDataValue(): void;
|
|
108
|
-
handleChange(e?:
|
|
109
|
-
handleBlur(e?:
|
|
122
|
+
handleChange(e?: Event | undefined): void;
|
|
123
|
+
handleBlur(e?: Event | undefined): void;
|
|
110
124
|
getValueForFormPublisher(): any;
|
|
125
|
+
focus?: (() => void) | undefined;
|
|
126
|
+
shadowRoot?: ShadowRoot | undefined;
|
|
111
127
|
error: boolean;
|
|
112
128
|
autofocus: boolean;
|
|
113
129
|
required: boolean;
|
|
114
130
|
disabled: true | null;
|
|
115
131
|
formDataProvider: string;
|
|
116
|
-
|
|
117
|
-
|
|
132
|
+
ariaLabelledby?: string | undefined;
|
|
133
|
+
ariaLabel?: string | undefined;
|
|
134
|
+
_value: string | null;
|
|
135
|
+
value: string | null;
|
|
118
136
|
_name: string;
|
|
119
137
|
name: string;
|
|
120
138
|
props: any;
|
|
@@ -144,6 +162,6 @@ export declare const FormInput: <T extends new (...args: any[]) => myFormElement
|
|
|
144
162
|
};
|
|
145
163
|
} & T;
|
|
146
164
|
import * as mySubscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
147
|
-
export declare const Subscriber: <T extends new (...args: any[]) => import("lit").LitElement>(superClass: T) => (new (...args: any[]) => mySubscriber.SubscriberInterface) & T;
|
|
165
|
+
export declare const Subscriber: <PropsType = any, T extends new (...args: any[]) => import("lit").LitElement = any>(superClass: T, type?: PropsType | undefined) => (new (...args: any[]) => mySubscriber.SubscriberInterface<PropsType>) & T;
|
|
148
166
|
import * as myTemplatesContainer from "@supersoniks/concorde/core/mixins/TemplatesContainer";
|
|
149
167
|
export declare const TemplatesContainer: <T extends new (...args: any[]) => import("lit").LitElement>(superClass: T) => (new (...args: any[]) => myTemplatesContainer.TemplatesContainerInterface) & T;
|
package/mixins.js
CHANGED
|
@@ -11,13 +11,12 @@ import * as mySubscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
|
11
11
|
export const Subscriber = mySubscriber.default;
|
|
12
12
|
import * as myTemplatesContainer from "@supersoniks/concorde/core/mixins/TemplatesContainer";
|
|
13
13
|
export const TemplatesContainer = myTemplatesContainer.default;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
win["concorde-mixins"] = {
|
|
14
|
+
window["concorde-mixins"] = window["concorde-mixins"] || {};
|
|
15
|
+
window["concorde-mixins"] = {
|
|
17
16
|
Fetcher: Fetcher,
|
|
18
17
|
FormCheckable: FormCheckable,
|
|
19
18
|
FormElement: FormElement,
|
|
20
19
|
FormInput: FormInput,
|
|
21
20
|
Subscriber: Subscriber,
|
|
22
|
-
TemplatesContainer: TemplatesContainer
|
|
21
|
+
TemplatesContainer: TemplatesContainer,
|
|
23
22
|
};
|