@supersoniks/concorde 1.1.43 → 1.1.44
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/concorde-core.bundle.js +18 -18
- package/concorde-core.es.js +805 -739
- package/core/_types/types.d.ts +13 -8
- package/core/_types/types.js +1 -0
- package/core/components/functional/date/date.d.ts +2 -2
- package/core/components/functional/date/date.js +10 -10
- package/core/components/functional/example/example.d.ts +1 -1
- package/core/components/functional/fetch/fetch.d.ts +8 -6
- package/core/components/functional/list/list.d.ts +16 -8
- package/core/components/functional/list/list.js +25 -13
- package/core/components/functional/mix/mix.d.ts +5 -5
- package/core/components/functional/mix/mix.js +11 -8
- package/core/components/functional/queue/queue.d.ts +12 -3
- package/core/components/functional/queue/queue.js +28 -22
- package/core/components/functional/router/redirect.d.ts +2 -2
- package/core/components/functional/router/redirect.js +2 -6
- package/core/components/functional/router/router.d.ts +1 -1
- package/core/components/functional/router/router.js +10 -10
- package/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts +0 -1
- package/core/components/functional/sdui/SDUIDescriptorTransformer.js +35 -36
- package/core/components/functional/sdui/sdui-utils.js +11 -11
- package/core/components/functional/sdui/sdui.d.ts +10 -9
- package/core/components/functional/sdui/sdui.js +32 -33
- package/core/components/functional/sdui/types.d.ts +8 -8
- package/core/components/functional/states/states.d.ts +3 -3
- package/core/components/functional/states/states.js +8 -8
- package/core/components/functional/submit/submit.d.ts +1 -1
- package/core/components/functional/submit/submit.js +16 -16
- package/core/components/functional/subscriber/subscriber.d.ts +1 -1
- package/core/components/functional/value/value.d.ts +1 -1
- package/core/components/ui/_css/size.d.ts +1 -1
- package/core/components/ui/button/button.d.ts +6 -4
- package/core/components/ui/button/button.js +2 -2
- package/core/components/ui/captcha/captcha.d.ts +2 -2
- package/core/components/ui/captcha/captcha.js +2 -2
- package/core/components/ui/card/card-header.js +5 -1
- package/core/components/ui/card/card.js +7 -5
- package/core/components/ui/form/checkbox/checkbox.d.ts +36 -12
- package/core/components/ui/form/fieldset/fieldset.d.ts +1 -1
- package/core/components/ui/form/form-layout/form-layout.d.ts +1 -1
- package/core/components/ui/form/input/input.d.ts +14 -9
- package/core/components/ui/form/input/input.js +2 -2
- package/core/components/ui/form/input/password-helper.d.ts +1 -1
- package/core/components/ui/form/input/password-helper.js +1 -1
- package/core/components/ui/form/input/same-value-helper.d.ts +1 -1
- package/core/components/ui/form/input/same-value-helper.js +2 -2
- package/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +1 -1
- package/core/components/ui/form/select/select.d.ts +5 -4
- package/core/components/ui/form/select/select.js +8 -8
- package/core/components/ui/form/textarea/textarea.d.ts +11 -9
- package/core/components/ui/form/textarea/textarea.js +1 -1
- package/core/components/ui/group/group.js +1 -1
- package/core/components/ui/icon/icons.js +15 -13
- package/core/components/ui/loader/loader.d.ts +1 -1
- package/core/components/ui/loader/loader.js +1 -1
- package/core/components/ui/menu/menu.js +15 -16
- package/core/components/ui/modal/modal.d.ts +1 -1
- package/core/components/ui/modal/modal.js +1 -1
- package/core/components/ui/pop/pop.d.ts +1 -1
- package/core/components/ui/pop/pop.js +13 -13
- package/core/components/ui/table/table-tbody.js +1 -1
- package/core/components/ui/theme/theme.js +15 -13
- package/core/components/ui/toast/message-subscriber.d.ts +12 -9
- package/core/components/ui/toast/message-subscriber.js +10 -8
- package/core/components/ui/toast/toast.d.ts +1 -1
- package/core/components/ui/toast/toast.js +7 -8
- package/core/components/ui/toast/types.d.ts +3 -2
- package/core/components/ui/tooltip/tooltip.js +1 -1
- package/core/components/ui/ui.d.ts +1 -1
- package/core/components/ui/ui.js +1 -1
- package/core/mixins/Fetcher.d.ts +15 -17
- package/core/mixins/Fetcher.js +19 -10
- package/core/mixins/FormCheckable.d.ts +8 -5
- package/core/mixins/FormCheckable.js +21 -19
- package/core/mixins/FormElement.d.ts +10 -7
- package/core/mixins/FormElement.js +24 -23
- package/core/mixins/FormInput.d.ts +16 -10
- package/core/mixins/FormInput.js +1 -1
- package/core/mixins/Subscriber.d.ts +8 -6
- package/core/mixins/Subscriber.js +19 -18
- package/core/mixins/TemplatesContainer.d.ts +2 -1
- package/core/mixins/TemplatesContainer.js +2 -2
- package/core/utils/Arrays.js +12 -9
- package/core/utils/DataBindObserver.d.ts +4 -4
- package/core/utils/DataBindObserver.js +26 -28
- package/core/utils/HTML.d.ts +1 -1
- package/core/utils/HTML.js +2 -2
- package/core/utils/LocationHandler.js +10 -10
- package/core/utils/Objects.js +10 -4
- package/core/utils/PublisherProxy.d.ts +21 -15
- package/core/utils/PublisherProxy.js +67 -63
- package/core/utils/api.d.ts +16 -31
- package/core/utils/api.js +26 -22
- package/mixins.d.ts +25 -19
- package/package.json +9 -5
- package/core/components/ui/taxonomy/taxonomy.d.ts +0 -44
- package/core/components/ui/taxonomy/taxonomy.js +0 -115
|
@@ -3,8 +3,8 @@ declare const Textarea_base: {
|
|
|
3
3
|
new (...args: any[]): {
|
|
4
4
|
validateFormElement(): void;
|
|
5
5
|
forceAutoFill: boolean;
|
|
6
|
-
_type: "number" | "search" | "file" | "button" | "
|
|
7
|
-
type: "number" | "search" | "file" | "button" | "
|
|
6
|
+
_type: "number" | "search" | "file" | "button" | "url" | "color" | "hidden" | "time" | "image" | "text" | "reset" | "submit" | "month" | "week" | "checkbox" | "radio" | "range" | "tel" | "email" | "date" | "datetime-local" | "password";
|
|
7
|
+
type: "number" | "search" | "file" | "button" | "url" | "color" | "hidden" | "time" | "image" | "text" | "reset" | "submit" | "month" | "week" | "checkbox" | "radio" | "range" | "tel" | "email" | "date" | "datetime-local" | "password";
|
|
8
8
|
_description?: string | undefined;
|
|
9
9
|
description: string | undefined;
|
|
10
10
|
_label?: string | undefined;
|
|
@@ -15,7 +15,7 @@ declare const Textarea_base: {
|
|
|
15
15
|
updateDataValue(): void;
|
|
16
16
|
handleChange(e?: Event | undefined): void;
|
|
17
17
|
handleBlur(e?: Event | undefined): void;
|
|
18
|
-
getValueForFormPublisher():
|
|
18
|
+
getValueForFormPublisher(): string | object | string[] | null | undefined;
|
|
19
19
|
focus?: (() => void) | undefined;
|
|
20
20
|
shadowRoot?: ShadowRoot | undefined;
|
|
21
21
|
error: boolean;
|
|
@@ -25,13 +25,15 @@ declare const Textarea_base: {
|
|
|
25
25
|
formDataProvider: string;
|
|
26
26
|
ariaLabelledby?: string | undefined;
|
|
27
27
|
ariaLabel?: string | undefined;
|
|
28
|
-
_value: string | null;
|
|
29
|
-
value: string | null;
|
|
28
|
+
_value: string | object | string[] | null | undefined;
|
|
29
|
+
value: string | object | string[] | null | undefined;
|
|
30
30
|
_name: string;
|
|
31
31
|
name: string;
|
|
32
|
-
props:
|
|
33
|
-
propertyMap:
|
|
32
|
+
props: import("../../../../_types/types").CoreJSType;
|
|
33
|
+
propertyMap: object;
|
|
34
34
|
isConnected: boolean;
|
|
35
|
+
children: HTMLCollection;
|
|
36
|
+
appendChild(node: Node): Node;
|
|
35
37
|
getAncestorAttributeValue(attributeName: string): string;
|
|
36
38
|
hasAncestorAttribute(attributeName: string): boolean;
|
|
37
39
|
querySelectorAll(selector: string): NodeListOf<Element>;
|
|
@@ -51,10 +53,10 @@ declare const Textarea_base: {
|
|
|
51
53
|
connectedCallback(): void;
|
|
52
54
|
requestUpdate(): void;
|
|
53
55
|
getAttribute(name: string): string;
|
|
54
|
-
hasAttribute(attributeName:
|
|
56
|
+
hasAttribute(attributeName: string): boolean;
|
|
55
57
|
disconnectedCallback(): void;
|
|
56
58
|
};
|
|
57
|
-
} & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<
|
|
59
|
+
} & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("../../../../_types/types").CoreJSType>) & typeof LitElement;
|
|
58
60
|
export declare class Textarea extends Textarea_base {
|
|
59
61
|
static styles: import("lit").CSSResult[];
|
|
60
62
|
size: "" | "xs" | "sm" | "lg";
|
|
@@ -44,7 +44,7 @@ let Textarea = class Textarea extends FormInput(FormElement(Subscriber(LitElemen
|
|
|
44
44
|
const textarea = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("textarea");
|
|
45
45
|
if (!textarea || textarea.checkValidity())
|
|
46
46
|
return;
|
|
47
|
-
|
|
47
|
+
const formPublisher = this.getFormPublisher();
|
|
48
48
|
if (formPublisher) {
|
|
49
49
|
formPublisher.isFormValid = false;
|
|
50
50
|
}
|
|
@@ -55,7 +55,7 @@ let Group = class Group extends LitElement {
|
|
|
55
55
|
this.hasDescription = this.description || ((_b = this.slotDescriptionNodes) === null || _b === void 0 ? void 0 : _b.length) ? true : false;
|
|
56
56
|
}
|
|
57
57
|
render() {
|
|
58
|
-
|
|
58
|
+
const slotStyle = {
|
|
59
59
|
alignItems: this.alignItems,
|
|
60
60
|
};
|
|
61
61
|
return html `<span class="${this.hasLabel ? "form-label" : "hidden"}"
|
|
@@ -8,6 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
var _a;
|
|
11
|
+
// ici on désactive un regle de eslint exceptionnelement pour ce fichier
|
|
12
|
+
/* eslint no-async-promise-executor: 0 */ // --> OFF
|
|
11
13
|
import icons from "@supersoniks/concorde/core/components/ui/icon/icons.json";
|
|
12
14
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
13
15
|
/**
|
|
@@ -57,10 +59,10 @@ function enableCustomLibrary() {
|
|
|
57
59
|
export default class Icons {
|
|
58
60
|
static registerIcons(newIcons) {
|
|
59
61
|
const record = icons;
|
|
60
|
-
for (
|
|
62
|
+
for (const prefix in newIcons) {
|
|
61
63
|
const newObj = newIcons[prefix];
|
|
62
64
|
const currentRecord = record[prefix] || {};
|
|
63
|
-
for (
|
|
65
|
+
for (const name in newObj) {
|
|
64
66
|
currentRecord[name] = newObj[name];
|
|
65
67
|
}
|
|
66
68
|
record[prefix] = currentRecord;
|
|
@@ -70,8 +72,8 @@ export default class Icons {
|
|
|
70
72
|
_a = Icons;
|
|
71
73
|
Icons.fontAwesomeNext = {
|
|
72
74
|
get: (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
const library = params.library;
|
|
76
|
+
const name = params.name || "";
|
|
75
77
|
const iconsAsRecord = icons;
|
|
76
78
|
/**
|
|
77
79
|
* SVGS en ligne
|
|
@@ -80,30 +82,30 @@ Icons.fontAwesomeNext = {
|
|
|
80
82
|
enableCustomLibrary();
|
|
81
83
|
}
|
|
82
84
|
if (library && libraries[library]) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
const libraryItem = libraries[library];
|
|
86
|
+
const prefix = params.prefix || libraryItem.defaultPrefix || "";
|
|
87
|
+
const libIcons = iconsAsRecord[library] || {};
|
|
86
88
|
iconsAsRecord[library] = libIcons;
|
|
87
|
-
|
|
89
|
+
const libIconsKey = prefix + "-" + name;
|
|
88
90
|
// if(!libIcons )libIcons = iconsAsRecord[library] = {};
|
|
89
91
|
/**
|
|
90
92
|
* Si l'icone a déjà été chargée on ne la recharge pas
|
|
91
93
|
*/
|
|
92
94
|
if (libIcons[libIconsKey])
|
|
93
95
|
return unsafeHTML(libIcons[libIconsKey]);
|
|
94
|
-
|
|
96
|
+
const url = libraryItem.url.replace("$prefix", prefix).replace("$name", name);
|
|
95
97
|
/**
|
|
96
98
|
* on utilise une promise mutualisée pour ne pas faire plusieurs appels concurents d'une même icone
|
|
97
99
|
*/
|
|
98
100
|
if (!loadingGetPromises.has(url)) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
const promise = new Promise((resolve) => __awaiter(void 0, void 0, void 0, function* () {
|
|
102
|
+
const result = yield fetch(url);
|
|
101
103
|
if (!result.ok) {
|
|
102
104
|
resolve(`<b title="Erreur ${result.status}">😶</b>`);
|
|
103
105
|
return;
|
|
104
106
|
}
|
|
105
107
|
try {
|
|
106
|
-
|
|
108
|
+
const text = yield result.text();
|
|
107
109
|
resolve(text);
|
|
108
110
|
}
|
|
109
111
|
catch (e) {
|
|
@@ -115,7 +117,7 @@ Icons.fontAwesomeNext = {
|
|
|
115
117
|
/**
|
|
116
118
|
* Chargement de l'icone.
|
|
117
119
|
*/
|
|
118
|
-
|
|
120
|
+
const result = yield loadingGetPromises.get(url);
|
|
119
121
|
loadingGetPromises.delete(url);
|
|
120
122
|
libIcons[libIconsKey] = result || "";
|
|
121
123
|
return unsafeHTML(result);
|
|
@@ -23,7 +23,7 @@ let Loader = Loader_1 = class Loader extends LitElement {
|
|
|
23
23
|
static show(conf) {
|
|
24
24
|
if (!Loader_1.loader)
|
|
25
25
|
Loader_1.loader = document.createElement("sonic-loader");
|
|
26
|
-
|
|
26
|
+
const loader = Loader_1.loader;
|
|
27
27
|
if (!conf)
|
|
28
28
|
conf = {};
|
|
29
29
|
if (conf.mode)
|
|
@@ -75,39 +75,38 @@ let MenuItems = class MenuItems extends LitElement {
|
|
|
75
75
|
super.disconnectedCallback();
|
|
76
76
|
}
|
|
77
77
|
initScrollable() {
|
|
78
|
-
const tabsMenu = this;
|
|
79
78
|
let isDown = false;
|
|
80
79
|
let startX;
|
|
81
80
|
let scrollLeft;
|
|
82
81
|
if (this.scrollable) {
|
|
83
|
-
|
|
82
|
+
this.addEventListener("mousedown", (e) => {
|
|
84
83
|
isDown = true;
|
|
85
|
-
|
|
86
|
-
startX = e.pageX -
|
|
87
|
-
scrollLeft =
|
|
84
|
+
this.classList.add("active");
|
|
85
|
+
startX = e.pageX - this.offsetLeft;
|
|
86
|
+
scrollLeft = this.scrollLeft;
|
|
88
87
|
});
|
|
89
|
-
|
|
88
|
+
this.addEventListener("mouseleave", () => {
|
|
90
89
|
isDown = false;
|
|
91
|
-
|
|
90
|
+
this.classList.remove("active");
|
|
92
91
|
});
|
|
93
|
-
|
|
92
|
+
this.addEventListener("mouseup", () => {
|
|
94
93
|
isDown = false;
|
|
95
|
-
|
|
94
|
+
this.classList.remove("active");
|
|
96
95
|
});
|
|
97
|
-
|
|
96
|
+
this.addEventListener("mousemove", (e) => {
|
|
98
97
|
if (!isDown)
|
|
99
98
|
return;
|
|
100
99
|
e.preventDefault();
|
|
101
|
-
const x = e.pageX -
|
|
100
|
+
const x = e.pageX - this.offsetLeft;
|
|
102
101
|
const walk = (x - startX) * 1.5; //scroll-fast
|
|
103
|
-
|
|
104
|
-
this.setScrollShadow(
|
|
102
|
+
this.scrollLeft = scrollLeft - walk;
|
|
103
|
+
this.setScrollShadow(this, this.direction);
|
|
105
104
|
});
|
|
106
|
-
|
|
105
|
+
this.addEventListener("scroll", (e) => {
|
|
107
106
|
e.preventDefault();
|
|
108
107
|
// const delta = Math.sign(e.deltaY);
|
|
109
|
-
//
|
|
110
|
-
this.setScrollShadow(
|
|
108
|
+
// this.scrollLeft += delta * 50;
|
|
109
|
+
this.setScrollShadow(this, this.direction);
|
|
111
110
|
});
|
|
112
111
|
}
|
|
113
112
|
}
|
|
@@ -7,7 +7,7 @@ import "@supersoniks/concorde/core/components/ui/modal/modal-title";
|
|
|
7
7
|
declare type ModalCreateOptions = {
|
|
8
8
|
content?: string;
|
|
9
9
|
};
|
|
10
|
-
declare const Modal_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<
|
|
10
|
+
declare const Modal_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("@supersoniks/concorde/core/_types/types").CoreJSType>) & typeof LitElement;
|
|
11
11
|
export declare class Modal extends Modal_base {
|
|
12
12
|
static styles: import("lit").CSSResult[];
|
|
13
13
|
forceAction: boolean;
|
|
@@ -34,7 +34,7 @@ let Modal = class Modal extends Subscriber(LitElement) {
|
|
|
34
34
|
const modal = document.createElement(tagName);
|
|
35
35
|
modal.innerHTML =
|
|
36
36
|
`<sonic-modal-close></sonic-modal-close><sonic-modal-content>${options.content}</sonic-modal-content>` || "";
|
|
37
|
-
|
|
37
|
+
const container = document.querySelector("sonic-theme") || document.body;
|
|
38
38
|
container.appendChild(modal);
|
|
39
39
|
modal.show();
|
|
40
40
|
return modal;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
-
|
|
2
|
+
type PopPlacement = "bottom" | "top" | "right" | "left";
|
|
3
3
|
export declare class Pop extends LitElement {
|
|
4
4
|
static pops: Set<Pop>;
|
|
5
5
|
static styles: import("lit").CSSResult[];
|
|
@@ -57,8 +57,8 @@ let Pop = Pop_1 = class Pop extends LitElement {
|
|
|
57
57
|
this.positioningRuns = false;
|
|
58
58
|
}
|
|
59
59
|
_handleClosePop(e) {
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
const path = e.composedPath();
|
|
61
|
+
const target = path[0];
|
|
62
62
|
Pop_1.pops.forEach((pop) => {
|
|
63
63
|
const popContainsTarget = path.includes(pop);
|
|
64
64
|
const popContentContainsTarget = path.includes(pop.querySelector('[slot="content"]'));
|
|
@@ -94,14 +94,14 @@ let Pop = Pop_1 = class Pop extends LitElement {
|
|
|
94
94
|
const thisRect = this.getBoundingClientRect();
|
|
95
95
|
if (!this.offsetParent)
|
|
96
96
|
return;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
const bodyRect = this.offsetParent.getBoundingClientRect();
|
|
98
|
+
const x0 = thisRect.left - bodyRect.left;
|
|
99
|
+
const y0 = thisRect.top - bodyRect.top;
|
|
100
100
|
let x = x0, y = y0;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
const yTop = y0 - contentRect.height - padding;
|
|
102
|
+
const xLeft = x0 - contentRect.width - 2 * padding;
|
|
103
|
+
const xRight = x0 + thisRect.width + 2 * padding;
|
|
104
|
+
const yBottom = y0 + thisRect.height + padding;
|
|
105
105
|
switch (placement) {
|
|
106
106
|
case "bottom":
|
|
107
107
|
y = yBottom;
|
|
@@ -116,20 +116,20 @@ let Pop = Pop_1 = class Pop extends LitElement {
|
|
|
116
116
|
x = xRight;
|
|
117
117
|
break;
|
|
118
118
|
}
|
|
119
|
-
|
|
119
|
+
const dxRight = window.innerWidth - xRight - bodyRect.left - contentRect.width - shiftPadding;
|
|
120
120
|
if (dxRight < 0 && placement === "right")
|
|
121
121
|
x = xLeft;
|
|
122
122
|
if (dxRight < 0 && ["top", "bottom"].includes(placement))
|
|
123
123
|
x = Math.max(x + dxRight, xLeft + thisRect.width);
|
|
124
|
-
|
|
124
|
+
const dxLeft = -bodyRect.left - xLeft;
|
|
125
125
|
if (dxLeft > shiftPadding && placement === "left")
|
|
126
126
|
x = xRight;
|
|
127
|
-
|
|
127
|
+
const dyBottom = window.innerHeight - yBottom - bodyRect.top - contentRect.height - shiftPadding;
|
|
128
128
|
if (dyBottom < 0 && placement === "bottom")
|
|
129
129
|
y = yTop;
|
|
130
130
|
if (dyBottom < 0 && ["left", "right"].includes(placement))
|
|
131
131
|
y = Math.max(y + dyBottom, yTop + thisRect.height);
|
|
132
|
-
|
|
132
|
+
const dyTop = -bodyRect.top - yTop;
|
|
133
133
|
if (dyTop > -shiftPadding && placement === "top")
|
|
134
134
|
y = yBottom;
|
|
135
135
|
this.lastContentX = x;
|
|
@@ -27,9 +27,9 @@ let Theme = Theme_1 = class Theme extends LitElement {
|
|
|
27
27
|
postCSSVars() {
|
|
28
28
|
const stylesheets = document.styleSheets;
|
|
29
29
|
const ssLength = stylesheets.length;
|
|
30
|
-
|
|
30
|
+
const fontUrls = [];
|
|
31
31
|
for (let i = 0; i < ssLength; i++) {
|
|
32
|
-
|
|
32
|
+
const ss = stylesheets[i];
|
|
33
33
|
if (ss.href && (ss.href.includes("googleapis") || ss.href.includes("typekit.net")))
|
|
34
34
|
fontUrls.push(ss.href);
|
|
35
35
|
}
|
|
@@ -43,34 +43,36 @@ let Theme = Theme_1 = class Theme extends LitElement {
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
receiveMessage(event) {
|
|
46
|
-
|
|
46
|
+
const data = event.data;
|
|
47
47
|
if (!data.type || data.type != "GetSonicTheme")
|
|
48
48
|
return;
|
|
49
49
|
this.postCSSVars();
|
|
50
50
|
}
|
|
51
51
|
getCssVariables() {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
for (
|
|
52
|
+
const names = [];
|
|
53
|
+
const stylesheets = [...Theme_1.styles.map((s) => s.styleSheet), ...Array.from(document.styleSheets)];
|
|
54
|
+
for (const stylesheet of stylesheets) {
|
|
55
55
|
try {
|
|
56
56
|
if (!stylesheet)
|
|
57
57
|
continue;
|
|
58
|
-
|
|
59
|
-
for (
|
|
58
|
+
const rules = stylesheet.cssRules;
|
|
59
|
+
for (const rule of rules) {
|
|
60
60
|
if (!("style" in rule))
|
|
61
61
|
continue;
|
|
62
|
-
|
|
63
|
-
for (
|
|
62
|
+
const style = rule.style;
|
|
63
|
+
for (const name of style) {
|
|
64
64
|
if (names.includes(name) || name.indexOf("--sc") !== 0)
|
|
65
65
|
continue;
|
|
66
66
|
names.push(name);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
catch (e) {
|
|
70
|
+
catch (e) {
|
|
71
|
+
console.log("Erreur lors de la récupération des variables CSS");
|
|
72
|
+
}
|
|
71
73
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
const style = window.getComputedStyle(this);
|
|
75
|
+
const result = {};
|
|
74
76
|
names.forEach((name) => (result[name] = style.getPropertyValue(name)));
|
|
75
77
|
return result;
|
|
76
78
|
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { Message } from "@supersoniks/concorde/la-billetterie/_types/swagger";
|
|
3
|
+
type APIResult = {
|
|
4
|
+
data?: object | string;
|
|
5
|
+
message?: string;
|
|
6
|
+
public_message?: string;
|
|
7
|
+
success?: boolean;
|
|
8
|
+
messages?: Message[];
|
|
9
|
+
status?: boolean;
|
|
7
10
|
};
|
|
8
|
-
declare const MessageSubscriber_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<
|
|
11
|
+
declare const MessageSubscriber_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<APIResult>) & typeof LitElement;
|
|
9
12
|
export declare class MessageSubscriber extends MessageSubscriber_base {
|
|
10
13
|
_messages: Array<Message>;
|
|
11
14
|
success: boolean | null;
|
|
@@ -15,9 +18,9 @@ export declare class MessageSubscriber extends MessageSubscriber_base {
|
|
|
15
18
|
_message: string;
|
|
16
19
|
get message(): string;
|
|
17
20
|
set message(value: string);
|
|
18
|
-
_data:
|
|
19
|
-
get data(): string |
|
|
20
|
-
set data(value: string |
|
|
21
|
+
_data: object | string;
|
|
22
|
+
get data(): string | object;
|
|
23
|
+
set data(value: string | object);
|
|
21
24
|
render(): symbol;
|
|
22
25
|
}
|
|
23
26
|
export {};
|
|
@@ -10,7 +10,7 @@ import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
|
10
10
|
import { SonicToast } from "@supersoniks/concorde/core/components/ui/toast/toast";
|
|
11
11
|
const tagName = "sonic-toast-message-subscriber";
|
|
12
12
|
//Superbe mix de multples versions d'api.
|
|
13
|
-
let MessageSubscriber = class MessageSubscriber extends Subscriber(LitElement) {
|
|
13
|
+
let MessageSubscriber = class MessageSubscriber extends Subscriber(LitElement, {}) {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
16
|
this._messages = [];
|
|
@@ -28,19 +28,20 @@ let MessageSubscriber = class MessageSubscriber extends Subscriber(LitElement) {
|
|
|
28
28
|
return;
|
|
29
29
|
value.forEach((message) => {
|
|
30
30
|
if (message.type == "public")
|
|
31
|
-
SonicToast.add({ text: message.content, status: message.status });
|
|
31
|
+
SonicToast.add({ text: message.content || "", status: message.status });
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
get message() {
|
|
35
35
|
return this._message;
|
|
36
36
|
}
|
|
37
37
|
set message(value) {
|
|
38
|
+
var _a, _b;
|
|
38
39
|
this._message = value;
|
|
39
40
|
if (!this.message)
|
|
40
41
|
return;
|
|
41
|
-
if (this.props.success !== false)
|
|
42
|
+
if (((_a = this.props) === null || _a === void 0 ? void 0 : _a.success) !== false)
|
|
42
43
|
return;
|
|
43
|
-
if (this.props.public_message)
|
|
44
|
+
if ((_b = this.props) === null || _b === void 0 ? void 0 : _b.public_message)
|
|
44
45
|
return;
|
|
45
46
|
//OUi OUi il faut afficher "message" que si success est parfaitement égal à false et qu'il n'y a rien dans public_message.
|
|
46
47
|
SonicToast.add({ text: this.message, status: "error" });
|
|
@@ -49,15 +50,16 @@ let MessageSubscriber = class MessageSubscriber extends Subscriber(LitElement) {
|
|
|
49
50
|
return this._data;
|
|
50
51
|
}
|
|
51
52
|
set data(value) {
|
|
53
|
+
var _a, _b, _c, _d;
|
|
52
54
|
this._data = value;
|
|
53
55
|
const toastOptions = { text: "Votre produit a bien été ajouté", status: "success" };
|
|
54
|
-
if (Array.isArray(this.data) && this.props.success === true)
|
|
56
|
+
if (Array.isArray(this.data) && ((_a = this.props) === null || _a === void 0 ? void 0 : _a.success) === true)
|
|
55
57
|
SonicToast.add(toastOptions);
|
|
56
|
-
if (this.data == "" && this.props.status === true)
|
|
58
|
+
if (this.data == "" && ((_b = this.props) === null || _b === void 0 ? void 0 : _b.status) === true)
|
|
57
59
|
SonicToast.add(toastOptions);
|
|
58
|
-
if (this.props.success !== false)
|
|
60
|
+
if (((_c = this.props) === null || _c === void 0 ? void 0 : _c.success) !== false)
|
|
59
61
|
return;
|
|
60
|
-
if (this.props.public_message)
|
|
62
|
+
if ((_d = this.props) === null || _d === void 0 ? void 0 : _d.public_message)
|
|
61
63
|
return;
|
|
62
64
|
SonicToast.add({ text: this.data, status: "error" });
|
|
63
65
|
}
|
|
@@ -11,7 +11,7 @@ export declare class SonicToast extends LitElement {
|
|
|
11
11
|
id: number;
|
|
12
12
|
text: string;
|
|
13
13
|
title: string | undefined;
|
|
14
|
-
status: import("@supersoniks/concorde/core/components/ui/toast/types").ToastStatus
|
|
14
|
+
status: import("@supersoniks/concorde/core/components/ui/toast/types").ToastStatus;
|
|
15
15
|
preserve: boolean | undefined;
|
|
16
16
|
ghost: boolean | undefined;
|
|
17
17
|
dismissForever: boolean | undefined;
|
|
@@ -72,7 +72,7 @@ let SonicToast = class SonicToast extends LitElement {
|
|
|
72
72
|
</div>`;
|
|
73
73
|
}
|
|
74
74
|
static removeAll() {
|
|
75
|
-
|
|
75
|
+
const toastComponent = document.querySelector("sonic-toast");
|
|
76
76
|
if (!toastComponent)
|
|
77
77
|
return;
|
|
78
78
|
toastComponent.toasts = toastComponent.toasts.filter((item) => item.ghost);
|
|
@@ -82,12 +82,12 @@ let SonicToast = class SonicToast extends LitElement {
|
|
|
82
82
|
var _a;
|
|
83
83
|
// Init toast area si absente (au <sonic-theme> ou <body< à défaut)
|
|
84
84
|
if (!document.querySelector("sonic-toast")) {
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
const toastComponent = document.createElement("sonic-toast");
|
|
86
|
+
const container = document.querySelector("sonic-theme") || document.body;
|
|
87
87
|
container.prepend(toastComponent);
|
|
88
88
|
}
|
|
89
89
|
// Ajoute le toast à la liste
|
|
90
|
-
|
|
90
|
+
const toastComponent = document.querySelector("sonic-toast");
|
|
91
91
|
const nextId = (_a = conf.id) !== null && _a !== void 0 ? _a : new Date().valueOf();
|
|
92
92
|
const interactiveRegExp = new RegExp("</a>|</.*?button>|</.*?input>|</.*?textarea>|</.*?select>");
|
|
93
93
|
const hasInteractive = interactiveRegExp.test(conf.text);
|
|
@@ -109,9 +109,9 @@ let SonicToast = class SonicToast extends LitElement {
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
if (toastComponent.toasts.length > 0) {
|
|
112
|
-
|
|
112
|
+
const toastA = Object.assign({}, currentToast);
|
|
113
113
|
for (const toast of toastComponent.toasts) {
|
|
114
|
-
|
|
114
|
+
const toastB = Object.assign({}, toast);
|
|
115
115
|
toastA.id = toastB.id = 0;
|
|
116
116
|
if ( /*!currentToast.preserve && */Objects.shallowEqual(toastA, toastB)) {
|
|
117
117
|
return null;
|
|
@@ -122,10 +122,9 @@ let SonicToast = class SonicToast extends LitElement {
|
|
|
122
122
|
return currentToast;
|
|
123
123
|
}
|
|
124
124
|
static removeItem(toastToRemove) {
|
|
125
|
-
|
|
125
|
+
const toastComponent = document.querySelector("sonic-toast");
|
|
126
126
|
if (!toastComponent)
|
|
127
127
|
return;
|
|
128
|
-
console.log(toastToRemove);
|
|
129
128
|
toastComponent.removeItem(toastToRemove);
|
|
130
129
|
}
|
|
131
130
|
// Remove Toast
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import { Message } from "@supersoniks/concorde/la-billetterie/_types/swagger";
|
|
2
|
+
export type ToastStatus = Message["status"] | "" | "success";
|
|
3
|
+
export type Toast = {
|
|
3
4
|
id?: number;
|
|
4
5
|
text: string;
|
|
5
6
|
title?: string;
|
|
@@ -14,7 +14,7 @@ let Tooltip = class Tooltip extends LitElement {
|
|
|
14
14
|
this.disabled = false;
|
|
15
15
|
}
|
|
16
16
|
render() {
|
|
17
|
-
|
|
17
|
+
const disabledClass = this.disabled || this.label == "" ? "disabled" : "";
|
|
18
18
|
return html `<div data-tooltip-text="${this.label.trim().replace(" ", " ")}" class="tooltip ${disabledClass}">
|
|
19
19
|
<slot></slot>
|
|
20
20
|
</div>`;
|
|
@@ -19,7 +19,7 @@ import "./group/group";
|
|
|
19
19
|
import "./icon/icon";
|
|
20
20
|
import "./image/image";
|
|
21
21
|
import "./loader/loader";
|
|
22
|
-
import "
|
|
22
|
+
import "../../../la-billetterie/components/event/atoms/taxonomy/taxonomy";
|
|
23
23
|
import "./menu/menu";
|
|
24
24
|
import "./modal/modal";
|
|
25
25
|
import "./alert/alert";
|
package/core/components/ui/ui.js
CHANGED
|
@@ -23,7 +23,7 @@ import "./group/group";
|
|
|
23
23
|
import "./icon/icon";
|
|
24
24
|
import "./image/image";
|
|
25
25
|
import "./loader/loader";
|
|
26
|
-
import "
|
|
26
|
+
import "../../../la-billetterie/components/event/atoms/taxonomy/taxonomy";
|
|
27
27
|
//Menu
|
|
28
28
|
import "./menu/menu";
|
|
29
29
|
// Misc
|