@supersoniks/concorde 1.1.8 → 1.1.11
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/core/components/functional/configuration/configuration.d.ts +5 -0
- package/core/components/functional/configuration/configuration.js +21 -0
- package/core/components/functional/date/date.d.ts +2 -1
- package/core/components/functional/date/date.js +9 -2
- package/core/components/functional/fetch/fetch.d.ts +32 -11
- package/core/components/functional/fetch/fetch.js +28 -12
- package/core/components/functional/functional.d.ts +1 -0
- package/core/components/functional/functional.js +1 -0
- package/core/components/functional/list/list.d.ts +15 -7
- package/core/components/functional/list/list.js +50 -20
- package/core/components/functional/sonic-scope/sonic-scope.d.ts +5 -0
- package/core/components/functional/sonic-scope/sonic-scope.js +20 -0
- package/core/components/functional/states/states.js +0 -2
- package/core/components/functional/submit/submit.d.ts +2 -0
- package/core/components/functional/submit/submit.js +23 -8
- package/core/components/ui/badge/badge.js +0 -1
- package/core/components/ui/button/button.d.ts +9 -2
- package/core/components/ui/button/button.js +11 -13
- package/core/components/ui/card/card-footer.d.ts +5 -0
- package/core/components/ui/card/card-footer.js +27 -0
- package/core/components/ui/card/card-header-descripton.d.ts +5 -0
- package/core/components/ui/card/card-header-descripton.js +33 -0
- package/core/components/ui/card/card-header.d.ts +8 -0
- package/core/components/ui/card/card-header.js +67 -0
- package/core/components/ui/card/card-main.d.ts +5 -0
- package/core/components/ui/card/card-main.js +29 -0
- package/core/components/ui/card/card.d.ts +12 -0
- package/core/components/ui/card/card.js +90 -0
- package/core/components/ui/form/checkbox/checkbox.d.ts +4 -4
- package/core/components/ui/form/checkbox/checkbox.js +3 -4
- package/core/components/ui/form/css/form-control.js +2 -0
- package/core/components/ui/form/fieldset/fieldset.js +1 -1
- package/core/components/ui/form/fieldset/legend-description.d.ts +5 -0
- package/core/components/ui/form/fieldset/legend-description.js +35 -0
- package/core/components/ui/form/fieldset/legend.d.ts +4 -5
- package/core/components/ui/form/fieldset/legend.js +21 -25
- package/core/components/ui/form/input/input.d.ts +3 -3
- package/core/components/ui/form/input/input.js +3 -3
- package/core/components/ui/form/textarea/textarea.d.ts +2 -2
- package/core/components/ui/form/textarea/textarea.js +2 -2
- package/core/components/ui/link/link.d.ts +7 -0
- package/core/components/ui/link/link.js +10 -0
- package/core/components/ui/progress/progress.d.ts +7 -0
- package/core/components/ui/progress/progress.js +63 -0
- package/core/components/ui/table/table-caption.d.ts +5 -0
- package/core/components/ui/table/table-caption.js +24 -0
- package/core/components/ui/table/table-tbody.d.ts +5 -0
- package/core/components/ui/table/table-tbody.js +37 -0
- package/core/components/ui/table/table-td.d.ts +7 -0
- package/core/components/ui/table/table-td.js +45 -0
- package/core/components/ui/table/table-tfoot.d.ts +5 -0
- package/core/components/ui/table/table-tfoot.js +23 -0
- package/core/components/ui/table/table-th.d.ts +6 -0
- package/core/components/ui/table/table-th.js +43 -0
- package/core/components/ui/table/table-thead.d.ts +5 -0
- package/core/components/ui/table/table-thead.js +24 -0
- package/core/components/ui/table/table-tr.d.ts +5 -0
- package/core/components/ui/table/table-tr.js +24 -0
- package/core/components/ui/table/table.d.ts +16 -0
- package/core/components/ui/table/table.js +88 -0
- package/core/components/ui/theme/theme-collection/core-variables.js +1 -1
- package/core/components/ui/theme/theme-collection/dark.js +3 -2
- package/core/components/ui/theme/theme-collection/light.js +1 -0
- package/core/components/ui/tooltip/tooltip.d.ts +1 -1
- package/core/components/ui/tooltip/tooltip.js +4 -4
- package/core/components/ui/ui.d.ts +3 -0
- package/core/components/ui/ui.js +3 -0
- package/core/mixins/Fetcher.d.ts +11 -9
- package/core/mixins/Fetcher.js +22 -4
- package/core/mixins/FormCheckable.d.ts +2 -2
- package/core/mixins/FormInput.d.ts +2 -2
- package/core/mixins/Subscriber.d.ts +2 -2
- package/core/mixins/Subscriber.js +0 -15
- package/core/utils/LocationHandler.d.ts +2 -1
- package/core/utils/LocationHandler.js +10 -2
- package/core/utils/Objects.d.ts +2 -1
- package/core/utils/Objects.js +8 -2
- package/core/utils/PublisherProxy.mjs +42 -12
- package/core/utils/api.js +1 -1
- package/package.json +38 -1
package/core/mixins/Fetcher.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
1
7
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
8
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
9
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -12,6 +18,7 @@ import { SonicToast } from "../components/ui/toast/toast";
|
|
|
12
18
|
import API from "@supersoniks/concorde/core/utils/api";
|
|
13
19
|
import "../components/ui/button/button";
|
|
14
20
|
import Objects from "../utils/Objects";
|
|
21
|
+
import { property } from "lit/decorators.js";
|
|
15
22
|
const Fetcher = (superClass) => {
|
|
16
23
|
class FetcherElement extends superClass {
|
|
17
24
|
constructor(...args) {
|
|
@@ -43,9 +50,18 @@ const Fetcher = (superClass) => {
|
|
|
43
50
|
* Cela est le cas pour le composant sonic-list qui ne fetch que si l'attribut fetch est renseigné
|
|
44
51
|
*/
|
|
45
52
|
this.isFetchEnabled = true;
|
|
53
|
+
this._endPoint = "";
|
|
46
54
|
args;
|
|
47
55
|
this.dataProvider = "";
|
|
48
56
|
}
|
|
57
|
+
set endPoint(value) {
|
|
58
|
+
this._endPoint = value;
|
|
59
|
+
if (this.isConnected)
|
|
60
|
+
this._fetchData();
|
|
61
|
+
}
|
|
62
|
+
get endPoint() {
|
|
63
|
+
return this._endPoint;
|
|
64
|
+
}
|
|
49
65
|
/**
|
|
50
66
|
*
|
|
51
67
|
* C'est ici que les données sont chargées via l'utilitaire API
|
|
@@ -59,8 +75,7 @@ const Fetcher = (superClass) => {
|
|
|
59
75
|
this.api = new API(this.getApiConfiguration());
|
|
60
76
|
if (!this.api)
|
|
61
77
|
return;
|
|
62
|
-
if (!this.dataProvider)
|
|
63
|
-
return;
|
|
78
|
+
// if (!this.dataProvider) return;
|
|
64
79
|
this.dispatchEvent(new CustomEvent("loading", { detail: this }));
|
|
65
80
|
this.isLoading = true;
|
|
66
81
|
this.requestUpdate();
|
|
@@ -68,7 +83,7 @@ const Fetcher = (superClass) => {
|
|
|
68
83
|
let hasLoader = this.isDefaultLoaderEnabled && !this.hasAttribute("noLoader");
|
|
69
84
|
if (hasLoader)
|
|
70
85
|
Loader.show();
|
|
71
|
-
data = yield this.api.get(this.
|
|
86
|
+
data = yield this.api.get(this.endPoint || this.dataProvider || "");
|
|
72
87
|
if (!data) {
|
|
73
88
|
SonicToast.add({ text: "Network Error", status: "error" });
|
|
74
89
|
this.isLoading = false;
|
|
@@ -79,7 +94,7 @@ const Fetcher = (superClass) => {
|
|
|
79
94
|
if (hasLoader)
|
|
80
95
|
Loader.hide();
|
|
81
96
|
if (this.key) {
|
|
82
|
-
data = Objects.traverse(data, this.key.split("."));
|
|
97
|
+
data = Objects.traverse(data, this.key.split("."), false);
|
|
83
98
|
}
|
|
84
99
|
this.props = data;
|
|
85
100
|
this.dispatchEvent(new CustomEvent("load", { detail: this }));
|
|
@@ -148,6 +163,9 @@ const Fetcher = (superClass) => {
|
|
|
148
163
|
}
|
|
149
164
|
}
|
|
150
165
|
}
|
|
166
|
+
__decorate([
|
|
167
|
+
property({ type: String })
|
|
168
|
+
], FetcherElement.prototype, "endPoint", null);
|
|
151
169
|
return FetcherElement; // as Constructor<SubscriberInterface> & T;
|
|
152
170
|
};
|
|
153
171
|
export default Fetcher;
|
|
@@ -47,15 +47,15 @@ declare const Form: <T extends Constructor<FormElementInterface>>(superClass: T)
|
|
|
47
47
|
required: true | null;
|
|
48
48
|
formDataProvider: string;
|
|
49
49
|
props: any;
|
|
50
|
+
isConnected: boolean;
|
|
50
51
|
getAncestorAttributeValue(attributeName: string): string;
|
|
51
52
|
hasAncestorAttribute(attributeName: string): boolean;
|
|
52
53
|
querySelectorAll(selector: string): NodeListOf<Element>;
|
|
53
54
|
publisher: any;
|
|
54
|
-
dataProvider:
|
|
55
|
+
dataProvider: string | null;
|
|
55
56
|
noShadowDom: string | null;
|
|
56
57
|
debug: HTMLElement | null;
|
|
57
58
|
defferedDebug: boolean | null;
|
|
58
|
-
makeShadow(props: Record<string, any>, value: any): any;
|
|
59
59
|
dispatchEvent(event: Event): void;
|
|
60
60
|
setAttribute(name: string, value: string): void;
|
|
61
61
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
@@ -23,15 +23,15 @@ declare const Form: <T extends Constructor<FormElementInterface>>(superClass: T)
|
|
|
23
23
|
_name: string;
|
|
24
24
|
name: string;
|
|
25
25
|
props: any;
|
|
26
|
+
isConnected: boolean;
|
|
26
27
|
getAncestorAttributeValue(attributeName: string): string;
|
|
27
28
|
hasAncestorAttribute(attributeName: string): boolean;
|
|
28
29
|
querySelectorAll(selector: string): NodeListOf<Element>;
|
|
29
30
|
publisher: any;
|
|
30
|
-
dataProvider:
|
|
31
|
+
dataProvider: string | null;
|
|
31
32
|
noShadowDom: string | null;
|
|
32
33
|
debug: HTMLElement | null;
|
|
33
34
|
defferedDebug: boolean | null;
|
|
34
|
-
makeShadow(props: Record<string, any>, value: any): any;
|
|
35
35
|
dispatchEvent(event: Event): void;
|
|
36
36
|
setAttribute(name: string, value: string): void;
|
|
37
37
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
@@ -4,15 +4,15 @@ import { APIConfiguration } from "@supersoniks/concorde/core/utils/api";
|
|
|
4
4
|
declare type Constructor<T> = new (...args: any[]) => T;
|
|
5
5
|
export interface SubscriberInterface {
|
|
6
6
|
props: any;
|
|
7
|
+
isConnected: boolean;
|
|
7
8
|
getAncestorAttributeValue(attributeName: string): string;
|
|
8
9
|
hasAncestorAttribute(attributeName: string): boolean;
|
|
9
10
|
querySelectorAll(selector: string): NodeListOf<Element>;
|
|
10
11
|
publisher: any;
|
|
11
|
-
dataProvider:
|
|
12
|
+
dataProvider: string | null;
|
|
12
13
|
noShadowDom: string | null;
|
|
13
14
|
debug: HTMLElement | null;
|
|
14
15
|
defferedDebug: boolean | null;
|
|
15
|
-
makeShadow(props: Record<string, any>, value: any): any;
|
|
16
16
|
dispatchEvent(event: Event): void;
|
|
17
17
|
setAttribute(name: string, value: string): void;
|
|
18
18
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -92,21 +92,6 @@ const Subscriber = (superClass) => {
|
|
|
92
92
|
this.onAssign = null;
|
|
93
93
|
this.args = args;
|
|
94
94
|
}
|
|
95
|
-
/**
|
|
96
|
-
* retourne un objet contenant les propriétés de value + celle de props si elle ne sont pas déjà dans value.
|
|
97
|
-
*/
|
|
98
|
-
makeShadow(props, value) {
|
|
99
|
-
if (typeof value == "object" && value !== null) {
|
|
100
|
-
let newValue = Array.isArray(value) ? [] : {};
|
|
101
|
-
Object.assign(newValue, value);
|
|
102
|
-
value = newValue;
|
|
103
|
-
for (let key in props) {
|
|
104
|
-
if (!value[key])
|
|
105
|
-
value[key] = props[key];
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
return value;
|
|
109
|
-
}
|
|
110
95
|
/**
|
|
111
96
|
* va de parent en parent pour trouver un attribut
|
|
112
97
|
* @param attributeName nom de l'attribut
|
|
@@ -4,6 +4,7 @@ declare type Listener = {
|
|
|
4
4
|
declare type ActivableLink = {
|
|
5
5
|
location: string;
|
|
6
6
|
href: string;
|
|
7
|
+
autoActive: "strict" | "partial" | "disabled";
|
|
7
8
|
setAttribute(name: string, value: string): void;
|
|
8
9
|
removeAttribute(name: string): void;
|
|
9
10
|
};
|
|
@@ -37,7 +38,7 @@ export default class LocationHandler {
|
|
|
37
38
|
/**
|
|
38
39
|
*
|
|
39
40
|
* @param component ActivableLink
|
|
40
|
-
* Ajoute l'attribut "active" à l'élément si l'url correspond à la location
|
|
41
|
+
* Ajoute l'attribut "active" à l'élément si l'url correspond à la location en donction du mode d'activation
|
|
41
42
|
*/
|
|
42
43
|
static updateComponentActiveState(component: ActivableLink): void;
|
|
43
44
|
}
|
|
@@ -78,13 +78,21 @@ export default class LocationHandler {
|
|
|
78
78
|
/**
|
|
79
79
|
*
|
|
80
80
|
* @param component ActivableLink
|
|
81
|
-
* Ajoute l'attribut "active" à l'élément si l'url correspond à la location
|
|
81
|
+
* Ajoute l'attribut "active" à l'élément si l'url correspond à la location en donction du mode d'activation
|
|
82
82
|
*/
|
|
83
83
|
static updateComponentActiveState(component) {
|
|
84
|
+
if (component.autoActive == "disabled")
|
|
85
|
+
return;
|
|
84
86
|
if (component.href && component.href.indexOf("http") != 0) {
|
|
85
87
|
let url1 = new URL(component.href, document.location.href);
|
|
86
88
|
let url2 = new URL(component.location, document.location.origin);
|
|
87
|
-
|
|
89
|
+
let isActive = false;
|
|
90
|
+
if (component.autoActive == "strict") {
|
|
91
|
+
isActive = url1.pathname == url2.pathname && url1.hash == url2.hash && url1.search == url2.search;
|
|
92
|
+
}
|
|
93
|
+
else
|
|
94
|
+
isActive = url2.href.indexOf(url1.href) == 0;
|
|
95
|
+
if (isActive)
|
|
88
96
|
component.setAttribute("active", "true");
|
|
89
97
|
else
|
|
90
98
|
component.removeAttribute("active");
|
package/core/utils/Objects.d.ts
CHANGED
|
@@ -17,7 +17,8 @@ declare class Objects {
|
|
|
17
17
|
static isUndefindOrNull(object: any): boolean;
|
|
18
18
|
/**
|
|
19
19
|
* traverse l'objet pour obtenir la valeur a l'adresse donnée via le tableau de clés pathArray.
|
|
20
|
+
* Si extendValues = true, les propriétés des objets parents sont copiées au fur et a mesure de la descente dans la hierarchie, avant l'assignation des propriétés de l'objet lui même.
|
|
20
21
|
*/
|
|
21
|
-
static traverse(obj: any, pathArray: string[]): any;
|
|
22
|
+
static traverse(obj: any, pathArray: string[], extendValues?: boolean): any;
|
|
22
23
|
}
|
|
23
24
|
export default Objects;
|
package/core/utils/Objects.js
CHANGED
|
@@ -48,14 +48,20 @@ class Objects {
|
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
50
|
* traverse l'objet pour obtenir la valeur a l'adresse donnée via le tableau de clés pathArray.
|
|
51
|
+
* Si extendValues = true, les propriétés des objets parents sont copiées au fur et a mesure de la descente dans la hierarchie, avant l'assignation des propriétés de l'objet lui même.
|
|
51
52
|
*/
|
|
52
|
-
static traverse(obj, pathArray) {
|
|
53
|
+
static traverse(obj, pathArray, extendValues = false) {
|
|
53
54
|
for (let key of pathArray) {
|
|
54
55
|
let newObj = obj[key];
|
|
55
56
|
if (newObj === undefined) {
|
|
56
57
|
return undefined;
|
|
57
58
|
}
|
|
58
|
-
|
|
59
|
+
if (extendValues && Objects.isObject(newObj)) {
|
|
60
|
+
obj = Object.assign(Array.isArray(newObj) ? [] : {}, obj, newObj);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
obj = obj[key];
|
|
64
|
+
}
|
|
59
65
|
}
|
|
60
66
|
return obj;
|
|
61
67
|
}
|
|
@@ -59,7 +59,7 @@ export class PublisherProxy {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
_publishAssignement_(lockInternalMutationsTransmission = false) {
|
|
62
|
-
this._assignListeners_.forEach((handler) => handler(this.
|
|
62
|
+
this._assignListeners_.forEach((handler) => handler(this.get()));
|
|
63
63
|
this._publishInternalMutation_(lockInternalMutationsTransmission);
|
|
64
64
|
}
|
|
65
65
|
_publishInvalidation_() {
|
|
@@ -93,7 +93,7 @@ export class PublisherProxy {
|
|
|
93
93
|
if (typeof handler != "function")
|
|
94
94
|
return;
|
|
95
95
|
this._assignListeners_.add(handler);
|
|
96
|
-
handler(this.
|
|
96
|
+
handler(this.get());
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
99
|
* Stop les appels de la fonction "handler" (passée en paramettre) lorsque la valeur gérée par le proxy change par assignation
|
|
@@ -181,6 +181,9 @@ 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
|
+
/**
|
|
185
|
+
* On retounre tout de suite si la valeur n'a pas changé
|
|
186
|
+
*/
|
|
184
187
|
if (this._value_ === newValue)
|
|
185
188
|
return true;
|
|
186
189
|
if (this._value_.hasOwnProperty("__value") &&
|
|
@@ -188,24 +191,45 @@ export class PublisherProxy {
|
|
|
188
191
|
this._value_.__value === newValue.__value) {
|
|
189
192
|
return true;
|
|
190
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
* On assigne la nouvelle valeur
|
|
196
|
+
*/
|
|
191
197
|
this._value_ = newValue;
|
|
192
|
-
|
|
198
|
+
/**
|
|
199
|
+
* 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
|
+
* On publie juste et on sen va.
|
|
201
|
+
*/
|
|
202
|
+
const isPrimitiveValue = (this._value_.hasOwnProperty("__value"));
|
|
203
|
+
if (isPrimitiveValue) {
|
|
193
204
|
this._publishAssignement_(lockInternalMutationsTransmission);
|
|
194
205
|
return true;
|
|
195
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* On fait la diff sur l'existant.
|
|
209
|
+
* On maintient les proxys à supprimer et ceux à ajouter.
|
|
210
|
+
* On met à jour leur valeur interne
|
|
211
|
+
* On publie les maj au fur et a mesure de modifications
|
|
212
|
+
*/
|
|
196
213
|
Array.from(this._proxies_.keys()).forEach((key) => {
|
|
197
|
-
|
|
214
|
+
/**
|
|
215
|
+
* On supprime les proxys qui ne sont plus dans la nouvelle valeur si ils n'on pas d'écouteurs
|
|
216
|
+
**/
|
|
198
217
|
if (!this._value_[key] && this._proxies_.has(key) && !this._proxies_.get(key).hasListener()) {
|
|
199
218
|
this._proxies_.delete(key);
|
|
200
219
|
}
|
|
201
220
|
});
|
|
221
|
+
/**
|
|
222
|
+
* Si la donnée est complexe (objet, tableau)
|
|
223
|
+
* on crée les proxys pour les sous-éléments qui n'en on pas
|
|
224
|
+
* On renseigne les nouvelles valeurs internes des proxies
|
|
225
|
+
*/
|
|
202
226
|
if (isComplex(this._value_)) {
|
|
203
227
|
for (let key in this._value_) {
|
|
204
228
|
let v = newValue[key];
|
|
205
229
|
let isVComplex = isComplex(v);
|
|
206
230
|
let valueV = isVComplex ? v : { __value: v };
|
|
207
231
|
if (!this._proxies_.has(key)) {
|
|
208
|
-
let newPublisher = new Publisher(
|
|
232
|
+
let newPublisher = new Publisher({}, this);
|
|
209
233
|
this._proxies_.set(key, newPublisher, true);
|
|
210
234
|
newPublisher._proxies_.set("_parent_", this);
|
|
211
235
|
}
|
|
@@ -213,6 +237,9 @@ export class PublisherProxy {
|
|
|
213
237
|
this._publishDynamicFilling_(key, v);
|
|
214
238
|
}
|
|
215
239
|
}
|
|
240
|
+
/**
|
|
241
|
+
* On prévient les écouteurs que la valeur a changé
|
|
242
|
+
*/
|
|
216
243
|
this._publishAssignement_();
|
|
217
244
|
return true;
|
|
218
245
|
}
|
|
@@ -220,8 +247,10 @@ export class PublisherProxy {
|
|
|
220
247
|
* Extraire la valeur actuelle du proxy
|
|
221
248
|
*/
|
|
222
249
|
get() {
|
|
223
|
-
if (this._value_.hasOwnProperty("__value"))
|
|
224
|
-
|
|
250
|
+
if (this._value_.hasOwnProperty("__value")) {
|
|
251
|
+
let v = this._value_.__value;
|
|
252
|
+
return v != undefined ? v : null;
|
|
253
|
+
}
|
|
225
254
|
return this._value_;
|
|
226
255
|
}
|
|
227
256
|
}
|
|
@@ -344,24 +373,25 @@ export default class Publisher extends PublisherProxy {
|
|
|
344
373
|
* Les gestionnairs associés sopnt déclenchés en conséquence de manière profonde et remontante si nécessaire.
|
|
345
374
|
*/
|
|
346
375
|
set: function (oTarget, sKey, vValue) {
|
|
376
|
+
//Fonctionnement pour la donnée interne pas de dispatch;
|
|
347
377
|
if (sKey == "_value_") {
|
|
348
378
|
oTarget._value_ = vValue;
|
|
349
379
|
return oTarget._value_;
|
|
350
380
|
}
|
|
351
|
-
|
|
381
|
+
//Création du publisher si il n'existe pas
|
|
352
382
|
if (!that._proxies_.has(sKey)) {
|
|
353
|
-
let newPublisher = new Publisher(
|
|
383
|
+
let newPublisher = new Publisher({}, that);
|
|
354
384
|
newPublisher._proxies_.set("_parent_", thisProxy);
|
|
355
385
|
that._proxies_.set(sKey, newPublisher);
|
|
356
386
|
}
|
|
357
|
-
|
|
358
|
-
return vValue;
|
|
387
|
+
//mis à jour et publication de la donnée si elle a changé
|
|
359
388
|
const prevValue = that._value_[sKey];
|
|
360
389
|
if (prevValue !== vValue) {
|
|
361
390
|
that._value_[sKey] = vValue;
|
|
362
391
|
that._publishDynamicFilling_(sKey, vValue);
|
|
392
|
+
that._proxies_.get(sKey).set(isComplex(vValue) ? vValue : { __value: vValue });
|
|
363
393
|
}
|
|
364
|
-
|
|
394
|
+
//on retourne le proxy pour pouvoir chainer les assignements
|
|
365
395
|
return that._proxies_.get(sKey);
|
|
366
396
|
},
|
|
367
397
|
/**
|
package/core/utils/api.js
CHANGED
|
@@ -84,7 +84,7 @@ class API {
|
|
|
84
84
|
* Concatène le serviceURL et le endpoint donné en paramètre
|
|
85
85
|
*/
|
|
86
86
|
computeURL(path) {
|
|
87
|
-
return this.serviceURL + "/" + path;
|
|
87
|
+
return (this.serviceURL + "/" + path).replace(/([^(https?\:)])\/{2,}/g, "$1/");
|
|
88
88
|
}
|
|
89
89
|
/*
|
|
90
90
|
* Envoie des données au endPoint passé en paramètre. par défaut en POST
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supersoniks/concorde",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.11",
|
|
4
4
|
"customElements": "custom-elements.json",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@lit-labs/motion": "^1.0.1",
|
|
11
11
|
"@lit-labs/observers": "^1.0.1",
|
|
12
|
+
"chart.js": "^3.9.1",
|
|
13
|
+
"jsbarcode": "^3.11.5",
|
|
12
14
|
"lit": "^2.2.3",
|
|
13
15
|
"url-pattern": "^1.0.3"
|
|
14
16
|
},
|
|
@@ -23,6 +25,8 @@
|
|
|
23
25
|
"vite": "^2.6.14"
|
|
24
26
|
},
|
|
25
27
|
"exports": {
|
|
28
|
+
"./core/components/functional/configuration/configuration": "./core/components/functional/configuration/configuration",
|
|
29
|
+
"./functional/configuration": "./core/components/functional/configuration/configuration",
|
|
26
30
|
"./core/components/functional/date/date": "./core/components/functional/date/date",
|
|
27
31
|
"./functional/date": "./core/components/functional/date/date",
|
|
28
32
|
"./core/components/functional/example/example": "./core/components/functional/example/example",
|
|
@@ -41,6 +45,8 @@
|
|
|
41
45
|
"./functional/router/redirect": "./core/components/functional/router/redirect",
|
|
42
46
|
"./core/components/functional/router/router": "./core/components/functional/router/router",
|
|
43
47
|
"./functional/router": "./core/components/functional/router/router",
|
|
48
|
+
"./core/components/functional/sonic-scope/sonic-scope": "./core/components/functional/sonic-scope/sonic-scope",
|
|
49
|
+
"./functional/sonic-scope": "./core/components/functional/sonic-scope/sonic-scope",
|
|
44
50
|
"./core/components/functional/states/states": "./core/components/functional/states/states",
|
|
45
51
|
"./functional/states": "./core/components/functional/states/states",
|
|
46
52
|
"./core/components/functional/submit/submit": "./core/components/functional/submit/submit",
|
|
@@ -53,6 +59,16 @@
|
|
|
53
59
|
"./ui/badge": "./core/components/ui/badge/badge",
|
|
54
60
|
"./core/components/ui/button/button": "./core/components/ui/button/button",
|
|
55
61
|
"./ui/button": "./core/components/ui/button/button",
|
|
62
|
+
"./core/components/ui/card/card-footer": "./core/components/ui/card/card-footer",
|
|
63
|
+
"./ui/card/card-footer": "./core/components/ui/card/card-footer",
|
|
64
|
+
"./core/components/ui/card/card-header-descripton": "./core/components/ui/card/card-header-descripton",
|
|
65
|
+
"./ui/card/card-header-descripton": "./core/components/ui/card/card-header-descripton",
|
|
66
|
+
"./core/components/ui/card/card-header": "./core/components/ui/card/card-header",
|
|
67
|
+
"./ui/card/card-header": "./core/components/ui/card/card-header",
|
|
68
|
+
"./core/components/ui/card/card-main": "./core/components/ui/card/card-main",
|
|
69
|
+
"./ui/card/card-main": "./core/components/ui/card/card-main",
|
|
70
|
+
"./core/components/ui/card/card": "./core/components/ui/card/card",
|
|
71
|
+
"./ui/card": "./core/components/ui/card/card",
|
|
56
72
|
"./core/components/ui/divider/divider": "./core/components/ui/divider/divider",
|
|
57
73
|
"./ui/divider": "./core/components/ui/divider/divider",
|
|
58
74
|
"./core/components/ui/form/checkbox/checkbox": "./core/components/ui/form/checkbox/checkbox",
|
|
@@ -61,6 +77,8 @@
|
|
|
61
77
|
"./ui/form/css/form-control": "./core/components/ui/form/css/form-control",
|
|
62
78
|
"./core/components/ui/form/fieldset/fieldset": "./core/components/ui/form/fieldset/fieldset",
|
|
63
79
|
"./ui/form/fieldset": "./core/components/ui/form/fieldset/fieldset",
|
|
80
|
+
"./core/components/ui/form/fieldset/legend-description": "./core/components/ui/form/fieldset/legend-description",
|
|
81
|
+
"./ui/form/fieldset/legend-description": "./core/components/ui/form/fieldset/legend-description",
|
|
64
82
|
"./core/components/ui/form/fieldset/legend": "./core/components/ui/form/fieldset/legend",
|
|
65
83
|
"./ui/form/fieldset/legend": "./core/components/ui/form/fieldset/legend",
|
|
66
84
|
"./core/components/ui/form/form-layout/form-actions": "./core/components/ui/form/form-layout/form-actions",
|
|
@@ -109,6 +127,24 @@
|
|
|
109
127
|
"./ui/modal": "./core/components/ui/modal/modal",
|
|
110
128
|
"./core/components/ui/pop/pop": "./core/components/ui/pop/pop",
|
|
111
129
|
"./ui/pop": "./core/components/ui/pop/pop",
|
|
130
|
+
"./core/components/ui/progress/progress": "./core/components/ui/progress/progress",
|
|
131
|
+
"./ui/progress": "./core/components/ui/progress/progress",
|
|
132
|
+
"./core/components/ui/table/table-caption": "./core/components/ui/table/table-caption",
|
|
133
|
+
"./ui/table/table-caption": "./core/components/ui/table/table-caption",
|
|
134
|
+
"./core/components/ui/table/table-tbody": "./core/components/ui/table/table-tbody",
|
|
135
|
+
"./ui/table/table-tbody": "./core/components/ui/table/table-tbody",
|
|
136
|
+
"./core/components/ui/table/table-td": "./core/components/ui/table/table-td",
|
|
137
|
+
"./ui/table/table-td": "./core/components/ui/table/table-td",
|
|
138
|
+
"./core/components/ui/table/table-tfoot": "./core/components/ui/table/table-tfoot",
|
|
139
|
+
"./ui/table/table-tfoot": "./core/components/ui/table/table-tfoot",
|
|
140
|
+
"./core/components/ui/table/table-th": "./core/components/ui/table/table-th",
|
|
141
|
+
"./ui/table/table-th": "./core/components/ui/table/table-th",
|
|
142
|
+
"./core/components/ui/table/table-thead": "./core/components/ui/table/table-thead",
|
|
143
|
+
"./ui/table/table-thead": "./core/components/ui/table/table-thead",
|
|
144
|
+
"./core/components/ui/table/table-tr": "./core/components/ui/table/table-tr",
|
|
145
|
+
"./ui/table/table-tr": "./core/components/ui/table/table-tr",
|
|
146
|
+
"./core/components/ui/table/table": "./core/components/ui/table/table",
|
|
147
|
+
"./ui/table": "./core/components/ui/table/table",
|
|
112
148
|
"./core/components/ui/tabs/tab": "./core/components/ui/tabs/tab",
|
|
113
149
|
"./ui/tabs/tab": "./core/components/ui/tabs/tab",
|
|
114
150
|
"./core/components/ui/tabs/tabs": "./core/components/ui/tabs/tabs",
|
|
@@ -167,6 +203,7 @@
|
|
|
167
203
|
"./utils/PublisherProxy.mjs": "./core/utils/PublisherProxy",
|
|
168
204
|
"./core/utils/api": "./core/utils/api",
|
|
169
205
|
"./utils/api": "./core/utils/api",
|
|
206
|
+
"./index-shared": "./index-shared",
|
|
170
207
|
"./index": "./index"
|
|
171
208
|
},
|
|
172
209
|
"bin": "./bin/cli.js"
|