@supersoniks/concorde 1.1.46 → 1.1.48
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/README.md +0 -0
- package/cli.js +0 -0
- package/concorde-core.bundle.js +19 -21
- package/concorde-core.es.js +802 -822
- package/core/_types/types.d.ts +0 -1
- package/core/components/functional/date/date.js +15 -7
- package/core/components/functional/fetch/fetch.d.ts +5 -0
- package/core/components/functional/list/list.d.ts +37 -18
- package/core/components/functional/list/list.js +12 -22
- package/core/components/functional/sdui/sdui.d.ts +5 -3
- package/core/components/functional/sdui/sdui.js +0 -3
- package/core/components/ui/_css/type.js +12 -12
- package/core/components/ui/badge/badge.js +3 -4
- package/core/components/ui/button/button.d.ts +5 -0
- package/core/components/ui/button/button.js +37 -12
- package/core/components/ui/form/checkbox/checkbox.d.ts +8 -0
- package/core/components/ui/form/css/form-control.js +7 -5
- package/core/components/ui/form/form-layout/form-layout.js +3 -1
- package/core/components/ui/form/input/input.d.ts +7 -1
- package/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +9 -0
- package/core/components/ui/form/input-autocomplete/input-autocomplete.js +37 -7
- package/core/components/ui/form/textarea/textarea.d.ts +4 -0
- package/core/components/ui/image/image.d.ts +2 -0
- package/core/components/ui/image/image.js +28 -0
- package/core/components/ui/modal/modal.d.ts +2 -0
- package/core/components/ui/modal/modal.js +6 -3
- package/core/components/ui/theme/css/tailwind.css +0 -0
- package/core/components/ui/theme/css/tailwind.d.ts +0 -0
- package/core/components/ui/theme/theme.js +8 -6
- package/core/components/ui/toast/toast.d.ts +1 -1
- package/core/components/ui/toast/types.d.ts +1 -1
- package/core/components/ui/ui.d.ts +0 -1
- package/core/components/ui/ui.js +0 -1
- package/core/decorators/Subscriber.d.ts +3 -0
- package/core/decorators/Subscriber.js +78 -0
- package/core/mixins/Fetcher.d.ts +8 -1
- package/core/mixins/Fetcher.js +9 -10
- package/core/mixins/FormCheckable.d.ts +4 -0
- package/core/mixins/FormInput.d.ts +5 -4
- package/core/mixins/Subscriber.d.ts +4 -0
- package/core/mixins/Subscriber.js +30 -4
- package/core/utils/LocationHandler.js +9 -3
- package/core/utils/PublisherProxy.d.ts +0 -1
- package/core/utils/PublisherProxy.js +0 -1
- package/img/concorde-logo.svg +0 -0
- package/img/concorde.png +0 -0
- package/img/concorde_def.png +0 -0
- package/mixins.d.ts +13 -0
- package/package.json +2 -2
- package/svg/regular/plane.svg +0 -0
- package/svg/solid/plane.svg +0 -0
package/core/_types/types.d.ts
CHANGED
|
@@ -26,6 +26,5 @@ export type CoreJSType = string | number | boolean | null | {
|
|
|
26
26
|
export type TypeAndRecordOfType<U> = U & Record<string | number, U>;
|
|
27
27
|
export type PublisherContentType = CoreJSType & {
|
|
28
28
|
__value?: CoreJSType;
|
|
29
|
-
_key_?: number;
|
|
30
29
|
};
|
|
31
30
|
export type HTMLFormControl = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
|
|
@@ -45,7 +45,9 @@ let SonicDate = class SonicDate extends Subscriber(TemplatesContainer(LitElement
|
|
|
45
45
|
}
|
|
46
46
|
set wording_billet_periode_validite(value) {
|
|
47
47
|
this._wording_billet_periode_validite = value;
|
|
48
|
-
this.duAu = this.wording_billet_periode_validite
|
|
48
|
+
this.duAu = this.wording_billet_periode_validite
|
|
49
|
+
.split("%s")
|
|
50
|
+
.map((str) => str.trim());
|
|
49
51
|
this.duAu.pop();
|
|
50
52
|
this.requestUpdate();
|
|
51
53
|
}
|
|
@@ -74,25 +76,31 @@ let SonicDate = class SonicDate extends Subscriber(TemplatesContainer(LitElement
|
|
|
74
76
|
}
|
|
75
77
|
const format = new Intl.DateTimeFormat(this.language || this.pageLanguage, options);
|
|
76
78
|
parts = format.formatRangeToParts(start, end);
|
|
77
|
-
//En mode design on cache les ","
|
|
78
|
-
if (this.designMode) {
|
|
79
|
-
parts.forEach((part) => (part.hidden = part.value.trim() == ","));
|
|
80
|
-
}
|
|
81
79
|
//on affiche du au uniquement si on a deux dates différentes
|
|
82
80
|
if (!isSameDay) {
|
|
83
|
-
const to = parts.find((part) => part.type == "literal" &&
|
|
81
|
+
const to = parts.find((part) => part.type == "literal" &&
|
|
82
|
+
part.source == "shared" &&
|
|
83
|
+
part.value.trim().length > 0);
|
|
84
84
|
if (to) {
|
|
85
85
|
to.value = " " + this.duAu[1] + " ";
|
|
86
86
|
to.type = "to";
|
|
87
87
|
}
|
|
88
88
|
if (!this.designMode)
|
|
89
|
-
parts.unshift({
|
|
89
|
+
parts.unshift({
|
|
90
|
+
type: "from",
|
|
91
|
+
value: this.duAu[0] + " ",
|
|
92
|
+
source: "shared",
|
|
93
|
+
});
|
|
90
94
|
}
|
|
91
95
|
}
|
|
92
96
|
else {
|
|
93
97
|
const format = new Intl.DateTimeFormat(this.language || this.pageLanguage, options);
|
|
94
98
|
parts = format.formatToParts(start);
|
|
95
99
|
}
|
|
100
|
+
//En mode design on cache les ","
|
|
101
|
+
if (this.designMode) {
|
|
102
|
+
parts.forEach((part) => (part.hidden = part.value.trim() == ","));
|
|
103
|
+
}
|
|
96
104
|
parts[0].value = Format.ucFirst(parts[0].value);
|
|
97
105
|
return parts.filter((p) => p.hidden !== true);
|
|
98
106
|
}
|
|
@@ -19,6 +19,7 @@ declare const Fetch_base: {
|
|
|
19
19
|
onInvalidate?: (() => void) | undefined;
|
|
20
20
|
disconnectedCallback(): void;
|
|
21
21
|
connectedCallback(): void;
|
|
22
|
+
lazyLoadSpan?: HTMLSpanElement | undefined;
|
|
22
23
|
handleLazyLoad(): void;
|
|
23
24
|
onIntersection(entries: IntersectionObserverEntry[]): void;
|
|
24
25
|
propertyMap: object;
|
|
@@ -46,6 +47,10 @@ declare const Fetch_base: {
|
|
|
46
47
|
getAttribute(name: string): string;
|
|
47
48
|
hasAttribute(attributeName: string): boolean;
|
|
48
49
|
getBoundingClientRect(): DOMRect;
|
|
50
|
+
onConnected(callback: (component: any) => void): void;
|
|
51
|
+
offConnected(callback: (component: any) => void): void;
|
|
52
|
+
onDisconnected(callback: (component: any) => void): void;
|
|
53
|
+
offDisconnected(callback: (component: any) => void): void;
|
|
49
54
|
};
|
|
50
55
|
} & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("../../../_types/types").CoreJSType>) & typeof LitElement;
|
|
51
56
|
/**
|
|
@@ -5,6 +5,38 @@ import "@supersoniks/concorde/core/components/functional/subscriber/subscriber";
|
|
|
5
5
|
import { DirectiveResult } from "lit/directive";
|
|
6
6
|
import { TemplateContentDirective } from "lit/directives/template-content.js";
|
|
7
7
|
import { TemplateResult } from "lit";
|
|
8
|
+
/**
|
|
9
|
+
* ### List boucle sur sa propriété "props" et crée des éléments a partir des données en bouclant également sur ses templates.
|
|
10
|
+
*
|
|
11
|
+
* Extends mixins : Fetcher, [Subscriber](./?path=/docs/miscallenous-🔔-subscriber--page)
|
|
12
|
+
*
|
|
13
|
+
* * Si le composant possède un attribut *fetch*, il charge un contenu via un appel d'api web.<br>
|
|
14
|
+
* Voir [fetcher](./?path=/docs/core-components-functional-fetch--basic) pour la configuration des autres attributs.
|
|
15
|
+
* * Chaque élément créé est englobé dans un objet [Subscriber](./?path=/docs/miscallenous-🔔-subscriber--page).<br>
|
|
16
|
+
* Un dataProvider y est associé a l'adresse suivante *dataProvider-de-la-liste$/*index-de-la-ligne-courante*
|
|
17
|
+
* Les données de la ligne sont donc disponible pour les élements internes (subscribers, data-binding)
|
|
18
|
+
* * Lors du chargement un objet loader inline est affiché.
|
|
19
|
+
* * Si le résultat de la requête est un objet, il est imbriqué dans un tableau pour garantir le fonctionnement.<br>
|
|
20
|
+
* Cependant, si l'attribut `extractValues` est présent, les valeurs des propriétés de l'objet sont mises dans dans un tableau pour le rendu.
|
|
21
|
+
* * La propriété _metadata_ est ajoutés à la donnée de chaque item. Elle contient les informations suivantes :
|
|
22
|
+
* * key : l'index de l'item dans la liste
|
|
23
|
+
* * even : true si l'index est pair
|
|
24
|
+
* * odd : true si l'index est impair
|
|
25
|
+
* * onlyChild : true si la liste ne contient qu'un seul item
|
|
26
|
+
* * firstChild : true si l'item est le premier de la liste
|
|
27
|
+
* * lastChild : true si l'item est le dernier de la liste
|
|
28
|
+
* * Si la liste ne contient aucun item, le template "no-item" est utilisé si il est défini.
|
|
29
|
+
* * On peut appler la methode invalidate() sur son publishe pour declencher le rechargement des données
|
|
30
|
+
* *
|
|
31
|
+
*/
|
|
32
|
+
export type ListItemMetadata = {
|
|
33
|
+
key?: string;
|
|
34
|
+
even?: boolean;
|
|
35
|
+
odd?: boolean;
|
|
36
|
+
onlyChild?: boolean;
|
|
37
|
+
firstChild?: boolean;
|
|
38
|
+
lastChild?: boolean;
|
|
39
|
+
};
|
|
8
40
|
declare const List_base: {
|
|
9
41
|
new (...args: any[]): {
|
|
10
42
|
api: import("../../../utils/api").default | null;
|
|
@@ -24,6 +56,7 @@ declare const List_base: {
|
|
|
24
56
|
onInvalidate?: (() => void) | undefined;
|
|
25
57
|
disconnectedCallback(): void;
|
|
26
58
|
connectedCallback(): void;
|
|
59
|
+
lazyLoadSpan?: HTMLSpanElement | undefined;
|
|
27
60
|
handleLazyLoad(): void;
|
|
28
61
|
onIntersection(entries: IntersectionObserverEntry[]): void;
|
|
29
62
|
propertyMap: object;
|
|
@@ -51,25 +84,12 @@ declare const List_base: {
|
|
|
51
84
|
getAttribute(name: string): string;
|
|
52
85
|
hasAttribute(attributeName: string): boolean;
|
|
53
86
|
getBoundingClientRect(): DOMRect;
|
|
87
|
+
onConnected(callback: (component: any) => void): void;
|
|
88
|
+
offConnected(callback: (component: any) => void): void;
|
|
89
|
+
onDisconnected(callback: (component: any) => void): void;
|
|
90
|
+
offDisconnected(callback: (component: any) => void): void;
|
|
54
91
|
};
|
|
55
92
|
} & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("../../../_types/types").CoreJSType>) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/TemplatesContainer").TemplatesContainerInterface) & typeof LitElement;
|
|
56
|
-
/**
|
|
57
|
-
* ### List boucle sur sa propriété "props" et crée des éléments a partir des données en bouclant également sur ses templates.
|
|
58
|
-
*
|
|
59
|
-
* Extends mixins : Fetcher, [Subscriber](./?path=/docs/miscallenous-🔔-subscriber--page)
|
|
60
|
-
*
|
|
61
|
-
* * Si le composant possède un attribut *fetch*, il charge un contenu via un appel d'api web.<br>
|
|
62
|
-
* Voir [fetcher](./?path=/docs/core-components-functional-fetch--basic) pour la configuration des autres attributs.
|
|
63
|
-
* * Chaque élément créé est englobé dans un objet [Subscriber](./?path=/docs/miscallenous-🔔-subscriber--page).<br>
|
|
64
|
-
* Un dataProvider y est associé a l'adresse suivante *dataProvider-de-la-liste$/*index-de-la-ligne-courante*
|
|
65
|
-
* Les données de la ligne sont donc disponible pour les élements internes (subscribers, data-binding)
|
|
66
|
-
* * Lors du chargement un objet loader inline est affiché.
|
|
67
|
-
* * Si le résultat de la requête est un objet, il est imbriqué dans un tableau pour garantir le fonctionnement.<br>
|
|
68
|
-
* Cependant, si l'attribut `extractValues` est présent, les valeurs des propriétés de l'objet sont mises dans dans un tableau pour le rendu.
|
|
69
|
-
* * La propriété _key_ est ajoutés à la donnée de chaque item. Elle contient l'index dans le cas d'un liste simple ou la clés associée à la valeur si `extractValues` est définit.
|
|
70
|
-
* * On peut appler la methode invalidate() sur son publishe pour declencher le rechargement des données
|
|
71
|
-
* *
|
|
72
|
-
*/
|
|
73
93
|
export declare class List extends List_base {
|
|
74
94
|
itemPropertyMap?: object;
|
|
75
95
|
/**
|
|
@@ -87,7 +107,6 @@ export declare class List extends List_base {
|
|
|
87
107
|
renderNoResultState(): TemplateResult<1>;
|
|
88
108
|
formatProps(): (import("../../../_types/types").CoreJSType[] & {
|
|
89
109
|
__value?: import("../../../_types/types").CoreJSType | undefined;
|
|
90
|
-
_key_?: number | undefined;
|
|
91
110
|
} & {
|
|
92
111
|
_sonic_http_response_?: Response | undefined;
|
|
93
112
|
text?: string | undefined;
|
|
@@ -14,23 +14,6 @@ import "@supersoniks/concorde/core/components/functional/subscriber/subscriber";
|
|
|
14
14
|
import Objects from "@supersoniks/concorde/core/utils/Objects";
|
|
15
15
|
import TemplatesContainer from "@supersoniks/concorde/core/mixins/TemplatesContainer";
|
|
16
16
|
const tagName = "sonic-list";
|
|
17
|
-
/**
|
|
18
|
-
* ### List boucle sur sa propriété "props" et crée des éléments a partir des données en bouclant également sur ses templates.
|
|
19
|
-
*
|
|
20
|
-
* Extends mixins : Fetcher, [Subscriber](./?path=/docs/miscallenous-🔔-subscriber--page)
|
|
21
|
-
*
|
|
22
|
-
* * Si le composant possède un attribut *fetch*, il charge un contenu via un appel d'api web.<br>
|
|
23
|
-
* Voir [fetcher](./?path=/docs/core-components-functional-fetch--basic) pour la configuration des autres attributs.
|
|
24
|
-
* * Chaque élément créé est englobé dans un objet [Subscriber](./?path=/docs/miscallenous-🔔-subscriber--page).<br>
|
|
25
|
-
* Un dataProvider y est associé a l'adresse suivante *dataProvider-de-la-liste$/*index-de-la-ligne-courante*
|
|
26
|
-
* Les données de la ligne sont donc disponible pour les élements internes (subscribers, data-binding)
|
|
27
|
-
* * Lors du chargement un objet loader inline est affiché.
|
|
28
|
-
* * Si le résultat de la requête est un objet, il est imbriqué dans un tableau pour garantir le fonctionnement.<br>
|
|
29
|
-
* Cependant, si l'attribut `extractValues` est présent, les valeurs des propriétés de l'objet sont mises dans dans un tableau pour le rendu.
|
|
30
|
-
* * La propriété _key_ est ajoutés à la donnée de chaque item. Elle contient l'index dans le cas d'un liste simple ou la clés associée à la valeur si `extractValues` est définit.
|
|
31
|
-
* * On peut appler la methode invalidate() sur son publishe pour declencher le rechargement des données
|
|
32
|
-
* *
|
|
33
|
-
*/
|
|
34
17
|
let List = class List extends Fetcher(Subscriber(TemplatesContainer(LitElement))) {
|
|
35
18
|
constructor() {
|
|
36
19
|
super(...arguments);
|
|
@@ -155,10 +138,17 @@ let List = class List extends Fetcher(Subscriber(TemplatesContainer(LitElement))
|
|
|
155
138
|
return nothing;
|
|
156
139
|
if (typeof key != "string" && typeof key != "number")
|
|
157
140
|
return nothing;
|
|
158
|
-
const
|
|
159
|
-
|
|
141
|
+
const isLastChild = index >= length - 1;
|
|
142
|
+
const indexMod2 = index % 2;
|
|
143
|
+
const childPublisher = this.publisher[key];
|
|
144
|
+
/**
|
|
145
|
+
* Ajout de metatdonnées au publisher de l'enfant
|
|
146
|
+
*/
|
|
147
|
+
//La prop key est gardée pour le moment pour compatibilité
|
|
148
|
+
//TODO : supprimer la prop key cquand c'est ok côté covoit.
|
|
149
|
+
childPublisher._key_ = key + "";
|
|
150
|
+
childPublisher._metadata_ = Object.assign(Object.assign({}, childPublisher._metadata_.get()), { key: key, even: indexMod2 == 0, odd: indexMod2 == 1, onlyChild: length == 1, firstChild: index == 0, lastChild: isLastChild });
|
|
160
151
|
counter++;
|
|
161
|
-
const isNotLast = index < length - 1;
|
|
162
152
|
if (templatePart)
|
|
163
153
|
counter = -1;
|
|
164
154
|
return (item &&
|
|
@@ -166,7 +156,7 @@ let List = class List extends Fetcher(Subscriber(TemplatesContainer(LitElement))
|
|
|
166
156
|
<sonic-subscriber
|
|
167
157
|
?debug=${this.defferedDebug === true}
|
|
168
158
|
.bindPublisher=${function () {
|
|
169
|
-
return
|
|
159
|
+
return childPublisher;
|
|
170
160
|
}}
|
|
171
161
|
.propertyMap?=${this.itemPropertyMap}
|
|
172
162
|
dataProvider="${this.dataProvider}/list-item/${key}"
|
|
@@ -175,7 +165,7 @@ let List = class List extends Fetcher(Subscriber(TemplatesContainer(LitElement))
|
|
|
175
165
|
? templateContent(templatePart)
|
|
176
166
|
: templateContent(this.templateList[counter % templateCount])}
|
|
177
167
|
</sonic-subscriber>
|
|
178
|
-
${separator &&
|
|
168
|
+
${separator && !isLastChild ? templateContent(separator) : nothing}
|
|
179
169
|
`);
|
|
180
170
|
})}
|
|
181
171
|
`;
|
|
@@ -19,6 +19,7 @@ declare const SonicSDUI_base: {
|
|
|
19
19
|
onInvalidate?: (() => void) | undefined;
|
|
20
20
|
disconnectedCallback(): void;
|
|
21
21
|
connectedCallback(): void;
|
|
22
|
+
lazyLoadSpan?: HTMLSpanElement | undefined;
|
|
22
23
|
handleLazyLoad(): void;
|
|
23
24
|
onIntersection(entries: IntersectionObserverEntry[]): void;
|
|
24
25
|
propertyMap: object;
|
|
@@ -46,6 +47,10 @@ declare const SonicSDUI_base: {
|
|
|
46
47
|
getAttribute(name: string): string;
|
|
47
48
|
hasAttribute(attributeName: string): boolean;
|
|
48
49
|
getBoundingClientRect(): DOMRect;
|
|
50
|
+
onConnected(callback: (component: any) => void): void;
|
|
51
|
+
offConnected(callback: (component: any) => void): void;
|
|
52
|
+
onDisconnected(callback: (component: any) => void): void;
|
|
53
|
+
offDisconnected(callback: (component: any) => void): void;
|
|
49
54
|
};
|
|
50
55
|
} & (new (...args: any[]) => import("../../../mixins/Subscriber").SubscriberInterface<import("../../../_types/types").CoreJSType>) & typeof LitElement;
|
|
51
56
|
/**
|
|
@@ -60,9 +65,6 @@ declare const SonicSDUI_base: {
|
|
|
60
65
|
* Son format est décrit par le type SDUITransformDescription
|
|
61
66
|
*
|
|
62
67
|
* * Si le résultat de la requête est un objet, il est imbriqué dans un tableau pour garantir le fonctionnement.<br>
|
|
63
|
-
* Cependant, si l'attribut `extractValues` est présent, les valeurs des propriétés de l'objet sont mises dans dans un tableau pour le rendu.
|
|
64
|
-
* * La propriété _key_ est ajoutés à la donnée de chaque item. Elle contient l'index dans le cas d'un liste simple ou la clés associée à la valeur si `extractValues` est définit.
|
|
65
|
-
* * On peut appler la methode invalidate() sur son publishe pour declencher le rechargement des données
|
|
66
68
|
* *
|
|
67
69
|
*/
|
|
68
70
|
export declare class SonicSDUI extends SonicSDUI_base {
|
|
@@ -32,9 +32,6 @@ const tagName = "sonic-sdui"; // For Astro.build
|
|
|
32
32
|
* Son format est décrit par le type SDUITransformDescription
|
|
33
33
|
*
|
|
34
34
|
* * Si le résultat de la requête est un objet, il est imbriqué dans un tableau pour garantir le fonctionnement.<br>
|
|
35
|
-
* Cependant, si l'attribut `extractValues` est présent, les valeurs des propriétés de l'objet sont mises dans dans un tableau pour le rendu.
|
|
36
|
-
* * La propriété _key_ est ajoutés à la donnée de chaque item. Elle contient l'index dans le cas d'un liste simple ou la clés associée à la valeur si `extractValues` est définit.
|
|
37
|
-
* * On peut appler la methode invalidate() sur son publishe pour declencher le rechargement des données
|
|
38
35
|
* *
|
|
39
36
|
*/
|
|
40
37
|
let SonicSDUI = class SonicSDUI extends Fetcher(Subscriber(LitElement)) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { css } from "lit";
|
|
2
2
|
export const typeColor = css `
|
|
3
|
-
:host{
|
|
4
|
-
--sc-color:inherit;
|
|
5
|
-
color:var(--sc-color);
|
|
3
|
+
:host {
|
|
4
|
+
--sc-color: inherit;
|
|
5
|
+
color: var(--sc-color);
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
:host([type="primary"]) {
|
|
@@ -21,16 +21,16 @@ export const typeColor = css `
|
|
|
21
21
|
--sc-color: var(--sc-success);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
.inherit-color{
|
|
25
|
-
color:var(--sc-color);
|
|
24
|
+
.inherit-color {
|
|
25
|
+
color: var(--sc-color);
|
|
26
26
|
}
|
|
27
27
|
`;
|
|
28
28
|
export const typesBg = css `
|
|
29
|
-
:host{
|
|
30
|
-
--sc-color:inherit;
|
|
31
|
-
--sc-bg:inherit;
|
|
32
|
-
color:var(--sc-color);
|
|
33
|
-
background:var(--sc-bg);
|
|
29
|
+
:host {
|
|
30
|
+
--sc-color: inherit;
|
|
31
|
+
--sc-bg: inherit;
|
|
32
|
+
color: var(--sc-color);
|
|
33
|
+
background: var(--sc-bg);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
:host([type="primary"]) {
|
|
@@ -54,7 +54,7 @@ export const typesBg = css `
|
|
|
54
54
|
--sc-bg: var(--sc-success);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
.inherit-bg{
|
|
58
|
-
color:inherit;
|
|
57
|
+
.inherit-bg {
|
|
58
|
+
color: inherit;
|
|
59
59
|
}
|
|
60
60
|
`;
|
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { html, LitElement, css } from "lit";
|
|
8
8
|
import { customElement, property } from "lit/decorators.js";
|
|
9
|
-
import { fontSize
|
|
9
|
+
import { fontSize } from "@supersoniks/concorde/core/components/ui/_css/size";
|
|
10
10
|
const tagName = "sonic-badge";
|
|
11
11
|
/**
|
|
12
12
|
* Un badge simple avec deux slots, un nommé prefix et un nomé suffix de manière à pouvoir mettre (par exemple) une icone avant ou après le contenu.
|
|
@@ -46,12 +46,11 @@ Badge.styles = [
|
|
|
46
46
|
--sc-fs: 1rem;
|
|
47
47
|
|
|
48
48
|
--sc-badge-color: var(--sc-base-content, #1f2937);
|
|
49
|
-
--sc-badge-bg: var(--sc-base-
|
|
49
|
+
--sc-badge-bg: var(--sc-base-100, #e5e7eb);
|
|
50
50
|
|
|
51
51
|
--sc-badge-border-with: var(--sc-form-border-width, 0.1rem);
|
|
52
52
|
--sc-badge-border-color: transparent;
|
|
53
|
-
--sc-badge-border: var(--sc-badge-border-with) solid
|
|
54
|
-
var(--sc-badge-border-color);
|
|
53
|
+
--sc-badge-border: var(--sc-badge-border-with) solid var(--sc-badge-border-color);
|
|
55
54
|
|
|
56
55
|
--sc-badge-rounded: 0.85em;
|
|
57
56
|
--sc-badge-fw: var(--sc-font-weight-base);
|
|
@@ -59,6 +59,10 @@ declare const Button_base: {
|
|
|
59
59
|
getAttribute(name: string): string;
|
|
60
60
|
hasAttribute(attributeName: string): boolean;
|
|
61
61
|
getBoundingClientRect(): DOMRect;
|
|
62
|
+
onConnected(callback: (component: any) => void): void;
|
|
63
|
+
offConnected(callback: (component: any) => void): void;
|
|
64
|
+
onDisconnected(callback: (component: any) => void): void;
|
|
65
|
+
offDisconnected(callback: (component: any) => void): void;
|
|
62
66
|
};
|
|
63
67
|
} & (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;
|
|
64
68
|
/**
|
|
@@ -151,6 +155,7 @@ export declare class Button extends Button_base {
|
|
|
151
155
|
private _location;
|
|
152
156
|
get location(): string;
|
|
153
157
|
set location(value: string);
|
|
158
|
+
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
154
159
|
render(): import("lit-html").TemplateResult<1>;
|
|
155
160
|
onSlotChange(): void;
|
|
156
161
|
}
|
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import LocationHandler from "@supersoniks/concorde/core/utils/LocationHandler";
|
|
8
8
|
import { html, LitElement, css } from "lit";
|
|
9
|
-
import { customElement, property, queryAssignedElements, state } from "lit/decorators.js";
|
|
9
|
+
import { customElement, property, queryAssignedElements, state, } from "lit/decorators.js";
|
|
10
10
|
import { styleMap } from "lit/directives/style-map.js";
|
|
11
11
|
import FormElement from "@supersoniks/concorde/core/mixins/FormElement";
|
|
12
12
|
import FormCheckable from "@supersoniks/concorde/core/mixins/FormCheckable";
|
|
@@ -88,7 +88,6 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
|
|
|
88
88
|
this._href = value;
|
|
89
89
|
if (this.href && this.href.indexOf("http") != 0) {
|
|
90
90
|
LocationHandler.onChange(this);
|
|
91
|
-
this.location = document.location.href.replace(document.location.origin, "");
|
|
92
91
|
}
|
|
93
92
|
else
|
|
94
93
|
LocationHandler.offChange(this);
|
|
@@ -113,7 +112,9 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
|
|
|
113
112
|
* On on veut pouvoir rest un autre form que celui qui contient le bouton
|
|
114
113
|
*/
|
|
115
114
|
const resetDataProvider = this.getAttribute("reset");
|
|
116
|
-
const formPublisher = resetDataProvider
|
|
115
|
+
const formPublisher = resetDataProvider
|
|
116
|
+
? PublisherManager.get(resetDataProvider)
|
|
117
|
+
: this.getFormPublisher();
|
|
117
118
|
if (formPublisher)
|
|
118
119
|
formPublisher.set({});
|
|
119
120
|
}
|
|
@@ -141,7 +142,14 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
|
|
|
141
142
|
}
|
|
142
143
|
set location(value) {
|
|
143
144
|
this._location = value;
|
|
144
|
-
|
|
145
|
+
this.requestUpdate();
|
|
146
|
+
}
|
|
147
|
+
updated(changedProperties) {
|
|
148
|
+
if (changedProperties.has("location") ||
|
|
149
|
+
changedProperties.has("href") ||
|
|
150
|
+
changedProperties.has("autoActive")) {
|
|
151
|
+
LocationHandler.updateComponentActiveState(this);
|
|
152
|
+
}
|
|
145
153
|
}
|
|
146
154
|
render() {
|
|
147
155
|
const btnStyles = {
|
|
@@ -160,10 +168,20 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
|
|
|
160
168
|
aria-labelledby=${ifDefined(this.ariaLabelledby)}
|
|
161
169
|
@click=${this.handleChange}
|
|
162
170
|
>
|
|
163
|
-
<slot
|
|
171
|
+
<slot
|
|
172
|
+
@slotchange=${this.onSlotChange}
|
|
173
|
+
part="prefix"
|
|
174
|
+
name="prefix"
|
|
175
|
+
></slot>
|
|
164
176
|
<slot part="main" class="main-slot"></slot>
|
|
165
|
-
<slot
|
|
166
|
-
|
|
177
|
+
<slot
|
|
178
|
+
@slotchange=${this.onSlotChange}
|
|
179
|
+
part="suffix"
|
|
180
|
+
name="suffix"
|
|
181
|
+
></slot>
|
|
182
|
+
${this.loading == true
|
|
183
|
+
? html `<sonic-icon name="loader" class="loader"></sonic-icon>`
|
|
184
|
+
: ""}
|
|
167
185
|
</button>
|
|
168
186
|
`;
|
|
169
187
|
return this.href
|
|
@@ -172,7 +190,9 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
|
|
|
172
190
|
target=${ifDefined(this.target)}
|
|
173
191
|
aria-label=${ifDefined(this.ariaLabel)}
|
|
174
192
|
aria-labelledby=${ifDefined(this.ariaLabelledby)}
|
|
175
|
-
@click=${this.pushState || this.goBack !== null
|
|
193
|
+
@click=${this.pushState || this.goBack !== null
|
|
194
|
+
? this.handleNavigation
|
|
195
|
+
: null}
|
|
176
196
|
>${btn}</a
|
|
177
197
|
>`
|
|
178
198
|
: html `${btn}`;
|
|
@@ -205,7 +225,10 @@ Button.styles = [
|
|
|
205
225
|
--sc-btn-border-width: var(--sc-form-border-width);
|
|
206
226
|
--sc-btn-border-color: transparent;
|
|
207
227
|
|
|
208
|
-
--btn-outline-bg-hover: var(
|
|
228
|
+
--btn-outline-bg-hover: var(
|
|
229
|
+
--sc-btn-outline-bg-hover,
|
|
230
|
+
var(--sc-base-100)
|
|
231
|
+
);
|
|
209
232
|
--sc-btn-ghost-bg-hover: var(--sc-base-100);
|
|
210
233
|
|
|
211
234
|
--sc-btn-active-color: var(--sc-base);
|
|
@@ -243,8 +266,8 @@ Button.styles = [
|
|
|
243
266
|
cursor: pointer;
|
|
244
267
|
text-align: center;
|
|
245
268
|
line-height: 1.1;
|
|
246
|
-
border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr)
|
|
247
|
-
var(--sc-item-rounded-bl);
|
|
269
|
+
border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr)
|
|
270
|
+
var(--sc-item-rounded-br) var(--sc-item-rounded-bl);
|
|
248
271
|
|
|
249
272
|
background: var(--btn-bg);
|
|
250
273
|
color: var(--btn-color);
|
|
@@ -254,7 +277,8 @@ Button.styles = [
|
|
|
254
277
|
padding-left: var(--sc-btn-px);
|
|
255
278
|
padding-right: var(--sc-btn-px);
|
|
256
279
|
|
|
257
|
-
border: var(--sc-btn-border-width) var(--sc-btn-border-style)
|
|
280
|
+
border: var(--sc-btn-border-width) var(--sc-btn-border-style)
|
|
281
|
+
var(--sc-btn-border-color);
|
|
258
282
|
min-height: var(--sc-btn-height);
|
|
259
283
|
}
|
|
260
284
|
|
|
@@ -471,6 +495,7 @@ Button.styles = [
|
|
|
471
495
|
/*BOUTON Avec icone seulement*/
|
|
472
496
|
:host([icon]) ::slotted(sonic-icon) {
|
|
473
497
|
font-size: 1.2em;
|
|
498
|
+
vertical-align: middle;
|
|
474
499
|
}
|
|
475
500
|
|
|
476
501
|
/*Tooltip ne joue pas sur le layout*/
|
|
@@ -60,6 +60,10 @@ declare const Checkbox_base: {
|
|
|
60
60
|
getAttribute(name: string): string;
|
|
61
61
|
hasAttribute(attributeName: string): boolean;
|
|
62
62
|
getBoundingClientRect(): DOMRect;
|
|
63
|
+
onConnected(callback: (component: any) => void): void;
|
|
64
|
+
offConnected(callback: (component: any) => void): void;
|
|
65
|
+
onDisconnected(callback: (component: any) => void): void;
|
|
66
|
+
offDisconnected(callback: (component: any) => void): void;
|
|
63
67
|
};
|
|
64
68
|
} & {
|
|
65
69
|
new (...args: any[]): {
|
|
@@ -138,6 +142,10 @@ declare const Checkbox_base: {
|
|
|
138
142
|
hasAttribute(attributeName: string): boolean;
|
|
139
143
|
disconnectedCallback(): void;
|
|
140
144
|
getBoundingClientRect(): DOMRect;
|
|
145
|
+
onConnected(callback: (component: any) => void): void;
|
|
146
|
+
offConnected(callback: (component: any) => void): void;
|
|
147
|
+
onDisconnected(callback: (component: any) => void): void;
|
|
148
|
+
offDisconnected(callback: (component: any) => void): void;
|
|
141
149
|
};
|
|
142
150
|
} & (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;
|
|
143
151
|
/**
|
|
@@ -67,12 +67,13 @@ export const formControl = css `
|
|
|
67
67
|
|
|
68
68
|
line-height: 1.1;
|
|
69
69
|
color: var(--sc-input-c);
|
|
70
|
-
border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr)
|
|
71
|
-
var(--sc-item-rounded-bl);
|
|
70
|
+
border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr)
|
|
71
|
+
var(--sc-item-rounded-br) var(--sc-item-rounded-bl);
|
|
72
72
|
|
|
73
73
|
font-family: var(--sc-input-ff);
|
|
74
74
|
background-color: var(--sc-input-background);
|
|
75
|
-
border: var(--sc-input-b-width) solid
|
|
75
|
+
border: var(--sc-input-b-width) solid
|
|
76
|
+
var(--sc-input-b-color, var(--sc-base-300, #aaa));
|
|
76
77
|
width: 100%;
|
|
77
78
|
font-size: var(--sc-input-fs);
|
|
78
79
|
|
|
@@ -167,6 +168,7 @@ export const formControl = css `
|
|
|
167
168
|
flex: 0 0 auto;
|
|
168
169
|
max-width: 100%;
|
|
169
170
|
max-width: 100%;
|
|
171
|
+
white-space: nowrap;
|
|
170
172
|
}
|
|
171
173
|
|
|
172
174
|
:host([inlineContent]) .has-suffix slot[name="suffix"] {
|
|
@@ -289,8 +291,8 @@ export const formControl = css `
|
|
|
289
291
|
}
|
|
290
292
|
input[type="color"]::-webkit-color-swatch {
|
|
291
293
|
border: none;
|
|
292
|
-
border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr)
|
|
293
|
-
var(--sc-item-rounded-bl);
|
|
294
|
+
border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr)
|
|
295
|
+
var(--sc-item-rounded-br) var(--sc-item-rounded-bl);
|
|
294
296
|
}
|
|
295
297
|
|
|
296
298
|
/*Input Image*/
|
|
@@ -59,7 +59,9 @@ FormLayout.styles = [
|
|
|
59
59
|
::slotted(sonic-textarea) {
|
|
60
60
|
grid-column: 1 / -1;
|
|
61
61
|
}*/
|
|
62
|
-
|
|
62
|
+
::slotted(sonic-submit) {
|
|
63
|
+
display: contents;
|
|
64
|
+
}
|
|
63
65
|
::slotted(:not(sonic-input):not(sonic-select):not(sonic-input-autocomplete):not(.form-item-container)) {
|
|
64
66
|
grid-column: 1 / -1;
|
|
65
67
|
}
|
|
@@ -54,8 +54,14 @@ declare const Input_base: {
|
|
|
54
54
|
requestUpdate(): void;
|
|
55
55
|
getAttribute(name: string): string;
|
|
56
56
|
hasAttribute(attributeName: string): boolean;
|
|
57
|
-
disconnectedCallback(): void;
|
|
57
|
+
disconnectedCallback(): void; /**
|
|
58
|
+
* Taille du composant, implique notamment des modifications de typo et de marge interne
|
|
59
|
+
*/
|
|
58
60
|
getBoundingClientRect(): DOMRect;
|
|
61
|
+
onConnected(callback: (component: any) => void): void;
|
|
62
|
+
offConnected(callback: (component: any) => void): void;
|
|
63
|
+
onDisconnected(callback: (component: any) => void): void;
|
|
64
|
+
offDisconnected(callback: (component: any) => void): void;
|
|
59
65
|
};
|
|
60
66
|
} & (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;
|
|
61
67
|
export declare class Input extends Input_base {
|
|
@@ -4,6 +4,7 @@ import "@supersoniks/concorde/core/components/ui/pop/pop";
|
|
|
4
4
|
import "@supersoniks/concorde/core/components/functional/queue/queue";
|
|
5
5
|
import "@supersoniks/concorde/core/components/ui/menu/menu-item";
|
|
6
6
|
import { Size } from "../../_css/size";
|
|
7
|
+
import { ResizeController } from "@lit-labs/observers/resize_controller.js";
|
|
7
8
|
type ListItem = Record<string, string>;
|
|
8
9
|
declare const InputAutocomplete_base: (new (...args: any[]) => import("../../../../mixins/TemplatesContainer").TemplatesContainerInterface) & {
|
|
9
10
|
new (...args: any[]): {
|
|
@@ -62,6 +63,10 @@ declare const InputAutocomplete_base: (new (...args: any[]) => import("../../../
|
|
|
62
63
|
hasAttribute(attributeName: string): boolean;
|
|
63
64
|
disconnectedCallback(): void;
|
|
64
65
|
getBoundingClientRect(): DOMRect;
|
|
66
|
+
onConnected(callback: (component: any) => void): void;
|
|
67
|
+
offConnected(callback: (component: any) => void): void;
|
|
68
|
+
onDisconnected(callback: (component: any) => void): void;
|
|
69
|
+
offDisconnected(callback: (component: any) => void): void;
|
|
65
70
|
};
|
|
66
71
|
} & (new (...args: any[]) => import("../../../../mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("../../../../mixins/Subscriber").SubscriberInterface<import("../../../../_types/types").CoreJSType>) & typeof LitElement;
|
|
67
72
|
/**
|
|
@@ -82,6 +87,9 @@ export declare class InputAutocomplete extends InputAutocomplete_base {
|
|
|
82
87
|
select?: boolean;
|
|
83
88
|
key: string;
|
|
84
89
|
searchParameter: string;
|
|
90
|
+
slotInputPrefixNodes: Array<Node>;
|
|
91
|
+
hasInputPrefix: boolean;
|
|
92
|
+
_resizeController: ResizeController<unknown>;
|
|
85
93
|
/**
|
|
86
94
|
* Les dataProviders
|
|
87
95
|
*/
|
|
@@ -97,6 +105,7 @@ export declare class InputAutocomplete extends InputAutocomplete_base {
|
|
|
97
105
|
/**
|
|
98
106
|
* Les fonctions de gestion
|
|
99
107
|
*/
|
|
108
|
+
hasSlotOrProps(): void;
|
|
100
109
|
private updateSearchParameter;
|
|
101
110
|
private initSearchParameter;
|
|
102
111
|
private selectListItem;
|