@supersoniks/concorde 1.1.24 → 1.1.26
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 +25 -31
- package/concorde-core.es.js +25 -31
- package/core/components/functional/configuration/configuration.js +2 -1
- package/core/components/functional/date/date.js +2 -1
- package/core/components/functional/example/example.js +2 -1
- package/core/components/functional/fetch/fetch.d.ts +0 -31
- package/core/components/functional/fetch/fetch.js +3 -2
- package/core/components/functional/if/if.d.ts +0 -3
- package/core/components/functional/if/if.js +3 -2
- package/core/components/functional/list/list.d.ts +3 -17
- package/core/components/functional/list/list.js +4 -3
- package/core/components/functional/queue/queue.d.ts +1 -8
- package/core/components/functional/queue/queue.js +10 -2
- package/core/components/functional/router/redirect.d.ts +0 -9
- package/core/components/functional/router/redirect.js +3 -2
- package/core/components/functional/router/router.d.ts +0 -14
- package/core/components/functional/router/router.js +3 -2
- package/core/components/functional/sonic-scope/sonic-scope.js +2 -1
- package/core/components/functional/states/states.d.ts +0 -15
- package/core/components/functional/states/states.js +3 -2
- package/core/components/functional/submit/submit.d.ts +0 -11
- package/core/components/functional/submit/submit.js +3 -2
- package/core/components/functional/subscriber/subscriber.d.ts +0 -3
- package/core/components/functional/subscriber/subscriber.js +3 -2
- package/core/components/ui/_css/scroll.d.ts +1 -0
- package/core/components/ui/_css/scroll.js +22 -0
- package/core/components/ui/_css/types.d.ts +2 -0
- package/core/components/ui/_css/types.js +60 -0
- package/core/components/ui/alert/alert.js +12 -12
- package/core/components/ui/badge/badge.js +3 -2
- package/core/components/ui/button/button.d.ts +4 -9
- package/core/components/ui/button/button.js +16 -13
- package/core/components/ui/card/card-footer.d.ts +0 -1
- package/core/components/ui/card/card-footer.js +14 -10
- package/core/components/ui/card/card-header-descripton.js +6 -1
- package/core/components/ui/card/card-header.js +7 -1
- package/core/components/ui/card/card-main.d.ts +0 -1
- package/core/components/ui/card/card-main.js +14 -10
- package/core/components/ui/card/card.js +7 -1
- package/core/components/ui/divider/divider.js +2 -1
- package/core/components/ui/form/checkbox/checkbox.d.ts +1 -20
- package/core/components/ui/form/checkbox/checkbox.js +23 -3
- package/core/components/ui/form/css/form-control.js +36 -33
- package/core/components/ui/form/fieldset/fieldset.d.ts +1 -1
- package/core/components/ui/form/fieldset/fieldset.js +5 -7
- package/core/components/ui/form/fieldset/legend.d.ts +5 -4
- package/core/components/ui/form/fieldset/legend.js +24 -20
- package/core/components/ui/form/form-actions/form-actions.d.ts +5 -0
- package/core/components/ui/form/{form-layout → form-actions}/form-actions.js +13 -5
- package/core/components/ui/form/form-layout/form-layout.js +3 -2
- package/core/components/ui/form/input/input.d.ts +3 -10
- package/core/components/ui/form/input/input.js +3 -2
- package/core/components/ui/form/radio/radio.d.ts +0 -6
- package/core/components/ui/form/radio/radio.js +3 -2
- package/core/components/ui/form/select/select.d.ts +0 -7
- package/core/components/ui/form/select/select.js +6 -4
- package/core/components/ui/form/textarea/textarea.js +10 -2
- package/core/components/ui/group/group.js +3 -2
- package/core/components/ui/icon/icon.d.ts +0 -4
- package/core/components/ui/icon/icon.js +9 -5
- package/core/components/ui/icon/icons.js +43 -17
- package/core/components/ui/icon/icons.json +1 -1
- package/core/components/ui/image/image.js +3 -2
- package/core/components/ui/link/link.js +6 -1
- package/core/components/ui/loader/loader.js +3 -2
- package/core/components/ui/menu/menu-item.js +5 -4
- package/core/components/ui/menu/menu.d.ts +2 -1
- package/core/components/ui/menu/menu.js +18 -13
- package/core/components/ui/modal/modal-actions.js +3 -2
- package/core/components/ui/modal/modal-close.js +4 -3
- package/core/components/ui/modal/modal-content.js +3 -2
- package/core/components/ui/modal/modal-subtitle.js +3 -2
- package/core/components/ui/modal/modal-title.js +3 -2
- package/core/components/ui/modal/modal.js +11 -24
- package/core/components/ui/pop/pop.js +3 -2
- package/core/components/ui/progress/progress.js +29 -7
- package/core/components/ui/table/table-caption.js +11 -2
- package/core/components/ui/table/table-tbody.js +8 -2
- package/core/components/ui/table/table-td.d.ts +4 -2
- package/core/components/ui/table/table-td.js +30 -13
- package/core/components/ui/table/table-tfoot.js +7 -1
- package/core/components/ui/table/table-th.d.ts +4 -1
- package/core/components/ui/table/table-th.js +41 -13
- package/core/components/ui/table/table-thead.js +8 -2
- package/core/components/ui/table/table-tr.js +9 -1
- package/core/components/ui/table/table.d.ts +2 -0
- package/core/components/ui/table/table.js +38 -3
- package/core/components/ui/tabs/tabs.js +3 -4
- package/core/components/ui/taxonomy/taxonomy.js +2 -1
- package/core/components/ui/theme/theme-collection/core-variables.js +12 -8
- package/core/components/ui/theme/theme-collection/dark.js +0 -4
- package/core/components/ui/theme/theme-collection/light.js +0 -1
- package/core/components/ui/theme/theme.d.ts +0 -1
- package/core/components/ui/theme/theme.js +3 -6
- package/core/components/ui/toast/message-subscriber.js +2 -1
- package/core/components/ui/toast/toast-item.d.ts +1 -0
- package/core/components/ui/toast/toast-item.js +51 -31
- package/core/components/ui/toast/toast.js +7 -6
- package/core/components/ui/tooltip/tooltip.js +7 -1
- package/core/components/ui/ui.d.ts +1 -0
- package/core/components/ui/ui.js +1 -0
- package/core/mixins/Fetcher.d.ts +3 -1
- package/core/mixins/Fetcher.js +3 -1
- package/core/mixins/FormElement.js +4 -0
- package/core/utils/api.d.ts +2 -2
- package/core/utils/api.js +7 -7
- package/package.json +7 -3
- package/core/components/ui/form/form-layout/form-actions.d.ts +0 -6
|
@@ -8,6 +8,7 @@ import { html, LitElement, css } from "lit";
|
|
|
8
8
|
import { customElement, property } from "lit/decorators.js";
|
|
9
9
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
10
10
|
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
11
|
+
const tagName = "sonic-fieldset";
|
|
11
12
|
let Fieldset = class Fieldset extends Subscriber(LitElement) {
|
|
12
13
|
constructor() {
|
|
13
14
|
super(...arguments);
|
|
@@ -16,10 +17,6 @@ let Fieldset = class Fieldset extends Subscriber(LitElement) {
|
|
|
16
17
|
* Désactiver le fieldset
|
|
17
18
|
*/
|
|
18
19
|
this.disabled = false;
|
|
19
|
-
/**
|
|
20
|
-
* Lier à un formulaire qui ne serait pas parent du fieldset
|
|
21
|
-
*/
|
|
22
|
-
this.form = "";
|
|
23
20
|
}
|
|
24
21
|
render() {
|
|
25
22
|
return html `<fieldset form="${ifDefined(this.form)}" ?disabled="${this.disabled}">
|
|
@@ -31,7 +28,7 @@ Fieldset.styles = [
|
|
|
31
28
|
css `
|
|
32
29
|
:host {
|
|
33
30
|
--sc-fieldset-mt: 0;
|
|
34
|
-
--sc-fieldset-mb:
|
|
31
|
+
--sc-fieldset-mb: 1rem;
|
|
35
32
|
--sc-fieldset-border-color: var(--sc-base-200);
|
|
36
33
|
--sc-fieldset-border-width: var(--sc-form-border-width);
|
|
37
34
|
|
|
@@ -47,6 +44,7 @@ Fieldset.styles = [
|
|
|
47
44
|
all: unset;
|
|
48
45
|
display: contents;
|
|
49
46
|
}
|
|
47
|
+
|
|
50
48
|
::slotted(sonic-legend) {
|
|
51
49
|
margin-bottom: 1.5rem;
|
|
52
50
|
display: block;
|
|
@@ -60,11 +58,11 @@ __decorate([
|
|
|
60
58
|
property({ type: String })
|
|
61
59
|
], Fieldset.prototype, "form", void 0);
|
|
62
60
|
Fieldset = __decorate([
|
|
63
|
-
customElement(
|
|
61
|
+
customElement(tagName)
|
|
64
62
|
], Fieldset);
|
|
65
63
|
export { Fieldset };
|
|
66
64
|
//Ajout pour la creation du cem notamment pour Storybook
|
|
67
65
|
try {
|
|
68
|
-
customElements.define(
|
|
66
|
+
customElements.define(tagName, Fieldset);
|
|
69
67
|
}
|
|
70
68
|
catch (e) { }
|
|
@@ -2,9 +2,10 @@ import { LitElement } from "lit";
|
|
|
2
2
|
import "@supersoniks/concorde/core/components/ui/form/fieldset/legend-description";
|
|
3
3
|
export declare class Legend extends LitElement {
|
|
4
4
|
static styles: import("lit").CSSResult[];
|
|
5
|
-
description
|
|
6
|
-
label
|
|
7
|
-
iconName
|
|
8
|
-
|
|
5
|
+
description?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
iconName?: string;
|
|
8
|
+
iconLibrary?: string;
|
|
9
|
+
iconPrefix?: string;
|
|
9
10
|
render(): import("lit-html").TemplateResult<1>;
|
|
10
11
|
}
|
|
@@ -7,33 +7,34 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { html, LitElement, css } from "lit";
|
|
8
8
|
import { customElement, property } from "lit/decorators.js";
|
|
9
9
|
import "@supersoniks/concorde/core/components/ui/form/fieldset/legend-description";
|
|
10
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
11
|
+
const tagName = "sonic-legend";
|
|
10
12
|
let Legend = class Legend extends LitElement {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.description = "";
|
|
14
|
-
this.label = "";
|
|
15
|
-
this.iconName = "";
|
|
16
|
-
this.iconPrefix = "";
|
|
17
|
-
}
|
|
18
13
|
render() {
|
|
19
14
|
return html `<legend part="legend">
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
${this.iconName
|
|
16
|
+
? html `<div class="icon">
|
|
17
|
+
<sonic-icon
|
|
18
|
+
name=${this.iconName}
|
|
19
|
+
prefix=${ifDefined(this.iconPrefix)}
|
|
20
|
+
library=${ifDefined(this.iconLibrary)}></sonic-icon>
|
|
21
|
+
</div>`
|
|
22
|
+
: ""}
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
<div class="legend-content">
|
|
25
|
+
${this.label}
|
|
26
|
+
${this.description ? html `<sonic-legend-description>${this.description}</sonic-legend-description>` : ""}
|
|
27
|
+
<slot></slot>
|
|
28
|
+
</div>
|
|
29
|
+
<slot name="suffix"></slot>
|
|
30
|
+
</legend>`;
|
|
30
31
|
}
|
|
31
32
|
};
|
|
32
33
|
Legend.styles = [
|
|
33
34
|
css `
|
|
34
35
|
:host {
|
|
35
|
-
--sc-legend-font-size: 1.
|
|
36
|
-
--sc-legend-font-weight: var(--sc-
|
|
36
|
+
--sc-legend-font-size: 1.75rem;
|
|
37
|
+
--sc-legend-font-weight: var(--sc-font-weight-base);
|
|
37
38
|
--sc-legend-font-style: var(--sc-headings-font-style);
|
|
38
39
|
--sc-legend-family: var(--sc-headings-font-family);
|
|
39
40
|
--sc-legend-line-height: var(--sc-headings-line-height);
|
|
@@ -74,15 +75,18 @@ __decorate([
|
|
|
74
75
|
__decorate([
|
|
75
76
|
property({ type: String })
|
|
76
77
|
], Legend.prototype, "iconName", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
property({ type: String })
|
|
80
|
+
], Legend.prototype, "iconLibrary", void 0);
|
|
77
81
|
__decorate([
|
|
78
82
|
property({ type: String })
|
|
79
83
|
], Legend.prototype, "iconPrefix", void 0);
|
|
80
84
|
Legend = __decorate([
|
|
81
|
-
customElement(
|
|
85
|
+
customElement(tagName)
|
|
82
86
|
], Legend);
|
|
83
87
|
export { Legend };
|
|
84
88
|
//Ajout pour la creation du cem notamment pour Storybook
|
|
85
89
|
try {
|
|
86
|
-
customElements.define(
|
|
90
|
+
customElements.define(tagName, Legend);
|
|
87
91
|
}
|
|
88
92
|
catch (e) { }
|
|
@@ -4,20 +4,28 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { html, LitElement } from "lit";
|
|
7
|
+
import { html, LitElement, css } from "lit";
|
|
8
8
|
import { customElement } from "lit/decorators.js";
|
|
9
|
-
|
|
10
|
-
let FormActions = class FormActions extends
|
|
9
|
+
const tagName = "sonic-form-actions";
|
|
10
|
+
let FormActions = class FormActions extends LitElement {
|
|
11
11
|
render() {
|
|
12
12
|
return html `<slot></slot>`;
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
|
+
FormActions.styles = [
|
|
16
|
+
css `
|
|
17
|
+
:host{
|
|
18
|
+
display:flex;
|
|
19
|
+
gap:.3rem;
|
|
20
|
+
}
|
|
21
|
+
`
|
|
22
|
+
];
|
|
15
23
|
FormActions = __decorate([
|
|
16
|
-
customElement(
|
|
24
|
+
customElement(tagName)
|
|
17
25
|
], FormActions);
|
|
18
26
|
export { FormActions };
|
|
19
27
|
//Ajout pour la creation du cem notamment pour Storybook
|
|
20
28
|
try {
|
|
21
|
-
customElements.define(
|
|
29
|
+
customElements.define(tagName, FormActions);
|
|
22
30
|
}
|
|
23
31
|
catch (e) { }
|
|
@@ -8,6 +8,7 @@ import { html, LitElement, css } from "lit";
|
|
|
8
8
|
import { customElement } from "lit/decorators.js";
|
|
9
9
|
import { ResizeController } from "@lit-labs/observers/resize_controller.js";
|
|
10
10
|
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
11
|
+
const tagName = "sonic-form-layout";
|
|
11
12
|
let FormLayout = class FormLayout extends Subscriber(LitElement) {
|
|
12
13
|
constructor() {
|
|
13
14
|
super(...arguments);
|
|
@@ -48,11 +49,11 @@ FormLayout.styles = [
|
|
|
48
49
|
`,
|
|
49
50
|
];
|
|
50
51
|
FormLayout = __decorate([
|
|
51
|
-
customElement(
|
|
52
|
+
customElement(tagName)
|
|
52
53
|
], FormLayout);
|
|
53
54
|
export { FormLayout };
|
|
54
55
|
//Ajout pour la creation du cem notamment pour Storybook
|
|
55
56
|
try {
|
|
56
|
-
customElements.define(
|
|
57
|
+
customElements.define(tagName, FormLayout);
|
|
57
58
|
}
|
|
58
59
|
catch (e) { }
|
|
@@ -35,6 +35,9 @@ declare const Input_base: {
|
|
|
35
35
|
removeAttribute(name: string): void;
|
|
36
36
|
initPublisher(): void;
|
|
37
37
|
getApiConfiguration(): import("../../../../utils/api").APIConfiguration;
|
|
38
|
+
/**
|
|
39
|
+
* Taille du composant, implique notamment des modifications de typo et de marge interne
|
|
40
|
+
*/
|
|
38
41
|
connectedCallback(): void;
|
|
39
42
|
requestUpdate(): void;
|
|
40
43
|
getAttribute(name: string): string;
|
|
@@ -42,16 +45,6 @@ declare const Input_base: {
|
|
|
42
45
|
disconnectedCallback(): void;
|
|
43
46
|
};
|
|
44
47
|
} & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
|
|
45
|
-
/**
|
|
46
|
-
* ### Le composent sonic-input étend les mixins FormInput, FormElement et Subscriber
|
|
47
|
-
* **FormElement :**
|
|
48
|
-
* * La propriété value est remplie automatiquement a l'aide de l'attribut name renseigné, ceci en prenant la valeur de la propriété du même nom dans les données du dataprovider associé.
|
|
49
|
-
* * Par défault lorsque l'on édite l'input, la valeur est également mise à jour via le même dataprovider
|
|
50
|
-
* * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
|
|
51
|
-
* * Par conséquent on peut par exemple le lier à un composant *queue* (via sa propriété *dataFilterProvider*) de manière à appeller en auto une api avec des filtres.
|
|
52
|
-
* **FormInput :**
|
|
53
|
-
* Uniquement des propriétés classiques d'un input HTML.
|
|
54
|
-
*/
|
|
55
48
|
export declare class Input extends Input_base {
|
|
56
49
|
static styles: import("lit").CSSResult[];
|
|
57
50
|
/**
|
|
@@ -22,6 +22,7 @@ import { classMap } from "lit/directives/class-map.js";
|
|
|
22
22
|
* **FormInput :**
|
|
23
23
|
* Uniquement des propriétés classiques d'un input HTML.
|
|
24
24
|
*/
|
|
25
|
+
const tagName = "sonic-input";
|
|
25
26
|
let Input = class Input extends FormInput(FormElement(Subscriber(LitElement))) {
|
|
26
27
|
constructor() {
|
|
27
28
|
super(...arguments);
|
|
@@ -170,11 +171,11 @@ __decorate([
|
|
|
170
171
|
state()
|
|
171
172
|
], Input.prototype, "hasPrefix", void 0);
|
|
172
173
|
Input = __decorate([
|
|
173
|
-
customElement(
|
|
174
|
+
customElement(tagName)
|
|
174
175
|
], Input);
|
|
175
176
|
export { Input };
|
|
176
177
|
//Ajout pour Storybook
|
|
177
178
|
try {
|
|
178
|
-
customElements.define(
|
|
179
|
+
customElements.define(tagName, Input);
|
|
179
180
|
}
|
|
180
181
|
catch (e) { }
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { Checkbox } from "../checkbox/checkbox";
|
|
2
|
-
/**
|
|
3
|
-
* ### Le composant sonic-radio étend sonic-checkbox en assignant sa propriété radio à true.
|
|
4
|
-
*
|
|
5
|
-
* * Le type d'input html utilisé passe également de checkbox à radio.
|
|
6
|
-
* * Le comportement est donc similaire à un bouton radio classique mais avec les fonctionnalités de sonic-checkbox (ie : Subscriber / FormElement / FormCheckable).
|
|
7
|
-
*/
|
|
8
2
|
export declare class Radio extends Checkbox {
|
|
9
3
|
static styles: (import("lit").CSSResult | import("lit").CSSResultGroup[])[];
|
|
10
4
|
constructor();
|
|
@@ -13,6 +13,7 @@ import { Checkbox } from "../checkbox/checkbox";
|
|
|
13
13
|
* * Le type d'input html utilisé passe également de checkbox à radio.
|
|
14
14
|
* * Le comportement est donc similaire à un bouton radio classique mais avec les fonctionnalités de sonic-checkbox (ie : Subscriber / FormElement / FormCheckable).
|
|
15
15
|
*/
|
|
16
|
+
const tagName = "sonic-radio";
|
|
16
17
|
let Radio = class Radio extends Checkbox {
|
|
17
18
|
constructor() {
|
|
18
19
|
super();
|
|
@@ -45,11 +46,11 @@ Radio.styles = [
|
|
|
45
46
|
`,
|
|
46
47
|
];
|
|
47
48
|
Radio = __decorate([
|
|
48
|
-
customElement(
|
|
49
|
+
customElement(tagName)
|
|
49
50
|
], Radio);
|
|
50
51
|
export { Radio };
|
|
51
52
|
//Ajout pour Storybook
|
|
52
53
|
try {
|
|
53
|
-
customElements.define(
|
|
54
|
+
customElements.define(tagName, Radio);
|
|
54
55
|
}
|
|
55
56
|
catch (e) { }
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import "@supersoniks/concorde/core/components/ui/icon/icon";
|
|
3
3
|
declare const Select_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
|
|
4
|
-
/**
|
|
5
|
-
* #### FormElement :
|
|
6
|
-
* * La propriété value est remplie automatiquement a l'aide de l'attribut name renseigné, ceci en prenant la valeur de la propriété du même nom dans les données du dataprovider associé.
|
|
7
|
-
* * Par défault lorsque l'on édite l'input, la valeur est également mise à jour via le même dataprovider
|
|
8
|
-
* * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
|
|
9
|
-
* * Par conséquent on peut par exemple le lier à un composant *queue* (via sa propriété *dataFilterProvider*) de manière à appeller en auto une api avec des filtres.
|
|
10
|
-
*/
|
|
11
4
|
export declare class Select extends Select_base {
|
|
12
5
|
static styles: import("lit").CSSResult[];
|
|
13
6
|
valueKey: string;
|
|
@@ -21,6 +21,7 @@ import "@supersoniks/concorde/core/components/ui/icon/icon";
|
|
|
21
21
|
* * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
|
|
22
22
|
* * Par conséquent on peut par exemple le lier à un composant *queue* (via sa propriété *dataFilterProvider*) de manière à appeller en auto une api avec des filtres.
|
|
23
23
|
*/
|
|
24
|
+
const tagName = "sonic-select";
|
|
24
25
|
let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
25
26
|
constructor() {
|
|
26
27
|
super(...arguments);
|
|
@@ -131,7 +132,7 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
131
132
|
})}
|
|
132
133
|
<slot></slot>
|
|
133
134
|
</select>
|
|
134
|
-
<sonic-icon
|
|
135
|
+
<sonic-icon class="select-chevron" name="nav-arrow-down" size="${this.size}"></sonic-icon>
|
|
135
136
|
</div>
|
|
136
137
|
<slot name="suffix" @slotchange=${this.onSlotChange}></slot>
|
|
137
138
|
</div>
|
|
@@ -153,12 +154,14 @@ Select.styles = [
|
|
|
153
154
|
position: relative;
|
|
154
155
|
width: 100%;
|
|
155
156
|
}
|
|
157
|
+
|
|
156
158
|
sonic-icon {
|
|
157
159
|
position: absolute;
|
|
158
160
|
right: 1em;
|
|
159
161
|
top: 50%;
|
|
160
162
|
pointer-events: none;
|
|
161
163
|
transform: translateY(-50%);
|
|
164
|
+
color:var(--sc-input-color);
|
|
162
165
|
}
|
|
163
166
|
|
|
164
167
|
option {
|
|
@@ -166,7 +169,6 @@ Select.styles = [
|
|
|
166
169
|
color: var(--sc-base-content);
|
|
167
170
|
background: var(--sc-base);
|
|
168
171
|
}
|
|
169
|
-
|
|
170
172
|
|
|
171
173
|
`,
|
|
172
174
|
];
|
|
@@ -222,11 +224,11 @@ __decorate([
|
|
|
222
224
|
state()
|
|
223
225
|
], Select.prototype, "hasPrefix", void 0);
|
|
224
226
|
Select = __decorate([
|
|
225
|
-
customElement(
|
|
227
|
+
customElement(tagName)
|
|
226
228
|
], Select);
|
|
227
229
|
export { Select };
|
|
228
230
|
//Ajout pour Storybook
|
|
229
231
|
try {
|
|
230
|
-
customElements.define(
|
|
232
|
+
customElements.define(tagName, Select);
|
|
231
233
|
}
|
|
232
234
|
catch (e) { }
|
|
@@ -11,6 +11,8 @@ import { formControl } from "../css/form-control";
|
|
|
11
11
|
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
12
12
|
import FormElement from "@supersoniks/concorde/core/mixins/FormElement";
|
|
13
13
|
import FormInput from "@supersoniks/concorde/core/mixins/FormInput";
|
|
14
|
+
import { customScroll } from "@supersoniks/concorde/core/components/ui/_css/scroll";
|
|
15
|
+
const tagName = "sonic-textarea";
|
|
14
16
|
let Textarea = class Textarea extends FormInput(FormElement(Subscriber(LitElement))) {
|
|
15
17
|
constructor() {
|
|
16
18
|
super(...arguments);
|
|
@@ -76,7 +78,7 @@ let Textarea = class Textarea extends FormInput(FormElement(Subscriber(LitElemen
|
|
|
76
78
|
?readonly=${this.readonly}
|
|
77
79
|
spellcheck=${ifDefined(this.spellcheck)}
|
|
78
80
|
wrap=${ifDefined(this.wrap)}
|
|
79
|
-
class="form-element textarea"
|
|
81
|
+
class="form-element textarea custom-scroll"
|
|
80
82
|
placeholder="${this.placeholder}"
|
|
81
83
|
>
|
|
82
84
|
${this.value}</textarea
|
|
@@ -91,6 +93,7 @@ ${this.value}</textarea
|
|
|
91
93
|
};
|
|
92
94
|
Textarea.styles = [
|
|
93
95
|
formControl,
|
|
96
|
+
customScroll,
|
|
94
97
|
css `
|
|
95
98
|
textarea {
|
|
96
99
|
font-size: inherit;
|
|
@@ -155,6 +158,11 @@ __decorate([
|
|
|
155
158
|
property()
|
|
156
159
|
], Textarea.prototype, "slotClasses", void 0);
|
|
157
160
|
Textarea = __decorate([
|
|
158
|
-
customElement(
|
|
161
|
+
customElement(tagName)
|
|
159
162
|
], Textarea);
|
|
160
163
|
export { Textarea };
|
|
164
|
+
//Ajout pour Storybook
|
|
165
|
+
try {
|
|
166
|
+
customElements.define(tagName, Textarea);
|
|
167
|
+
}
|
|
168
|
+
catch (e) { }
|
|
@@ -6,6 +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 } from "lit/decorators.js";
|
|
9
|
+
const tagName = "sonic-group";
|
|
9
10
|
let Group = class Group extends LitElement {
|
|
10
11
|
updated() {
|
|
11
12
|
const children = this.querySelectorAll("sonic-input, sonic-button");
|
|
@@ -48,10 +49,10 @@ Group.styles = [
|
|
|
48
49
|
`,
|
|
49
50
|
];
|
|
50
51
|
Group = __decorate([
|
|
51
|
-
customElement(
|
|
52
|
+
customElement(tagName)
|
|
52
53
|
], Group);
|
|
53
54
|
export { Group };
|
|
54
55
|
try {
|
|
55
|
-
customElements.define(
|
|
56
|
+
customElements.define(tagName, Group);
|
|
56
57
|
}
|
|
57
58
|
catch (e) { }
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
-
/**
|
|
3
|
-
* Afficher l'icone choisie parmis une liste prédéfinie dans icons.json
|
|
4
|
-
* les tailles suivantes sont disponible via l'attribut *size* : 2xs,xs,sm,"",lg,xl,2xl
|
|
5
|
-
*/
|
|
6
2
|
export declare class Icon extends LitElement {
|
|
7
3
|
static styles: import("lit").CSSResult;
|
|
8
4
|
updateIcon(): Promise<void>;
|
|
@@ -14,14 +14,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
import { LitElement, css, nothing } from "lit";
|
|
17
|
-
import { property } from "lit/decorators.js";
|
|
17
|
+
import { customElement, property } from "lit/decorators.js";
|
|
18
18
|
import Icons from "./icons";
|
|
19
19
|
/**
|
|
20
20
|
* Afficher l'icone choisie parmis une liste prédéfinie dans icons.json
|
|
21
21
|
* les tailles suivantes sont disponible via l'attribut *size* : 2xs,xs,sm,"",lg,xl,2xl
|
|
22
22
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const tagName = "sonic-icon";
|
|
24
|
+
let Icon = class Icon extends LitElement {
|
|
25
25
|
constructor() {
|
|
26
26
|
super(...arguments);
|
|
27
27
|
this.iconText = "";
|
|
@@ -75,7 +75,7 @@ export class Icon extends LitElement {
|
|
|
75
75
|
this.style.removeProperty("display");
|
|
76
76
|
return this.iconText;
|
|
77
77
|
}
|
|
78
|
-
}
|
|
78
|
+
};
|
|
79
79
|
Icon.styles = css `
|
|
80
80
|
:host {
|
|
81
81
|
line-height: 0;
|
|
@@ -129,8 +129,12 @@ __decorate([
|
|
|
129
129
|
__decorate([
|
|
130
130
|
property({ type: String })
|
|
131
131
|
], Icon.prototype, "library", null);
|
|
132
|
+
Icon = __decorate([
|
|
133
|
+
customElement(tagName)
|
|
134
|
+
], Icon);
|
|
135
|
+
export { Icon };
|
|
132
136
|
//Ajout pour la creation du cem notamment pour Storybook
|
|
133
137
|
try {
|
|
134
|
-
customElements.define(
|
|
138
|
+
customElements.define(tagName, Icon);
|
|
135
139
|
}
|
|
136
140
|
catch (e) { }
|
|
@@ -21,12 +21,35 @@ const loadingGetPromises = new Map();
|
|
|
21
21
|
* la propriété library de sonic-icon correspond à une clef de librairies.
|
|
22
22
|
*/
|
|
23
23
|
const libraries = {
|
|
24
|
-
heroicons:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
heroicons: {
|
|
25
|
+
url: "https://cdn.jsdelivr.net/npm/heroicons@2.0.4/24/$prefix/$name.svg",
|
|
26
|
+
defaultPrefix: "outline",
|
|
27
|
+
},
|
|
28
|
+
iconoir: {
|
|
29
|
+
url: "https://cdnjs.cloudflare.com/ajax/libs/iconoir/5.1.4/icons/$name.svg",
|
|
30
|
+
},
|
|
31
|
+
feathers: {
|
|
32
|
+
url: "https://cdn.jsdelivr.net/npm/feather-icons@4.29.0/dist/icons/$name.svg",
|
|
33
|
+
},
|
|
34
|
+
material: {
|
|
35
|
+
url: "https://cdn.jsdelivr.net/npm/@material-icons/svg@1.0.5/svg/$name/$prefix.svg",
|
|
36
|
+
defaultPrefix: "regular",
|
|
37
|
+
},
|
|
38
|
+
fontAwesome: {
|
|
39
|
+
url: "https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.1/svgs/$prefix/$name.svg",
|
|
40
|
+
defaultPrefix: "regular",
|
|
41
|
+
},
|
|
29
42
|
};
|
|
43
|
+
let hasEnabledCustomLibrary = false;
|
|
44
|
+
function enableCustomLibrary() {
|
|
45
|
+
var _b, _c;
|
|
46
|
+
if (hasEnabledCustomLibrary)
|
|
47
|
+
return;
|
|
48
|
+
hasEnabledCustomLibrary = true;
|
|
49
|
+
libraries.custom = {};
|
|
50
|
+
libraries.custom.url = (_b = document.querySelector("[customIconLibraryPath]")) === null || _b === void 0 ? void 0 : _b.getAttribute("customIconLibraryPath");
|
|
51
|
+
libraries.custom.defaultPrefix = (_c = document.querySelector("[customIconDefaultPrefix]")) === null || _c === void 0 ? void 0 : _c.getAttribute("customIconDefaultPrefix");
|
|
52
|
+
}
|
|
30
53
|
export default class Icons {
|
|
31
54
|
static registerIcons(newIcons) {
|
|
32
55
|
const record = icons;
|
|
@@ -43,29 +66,32 @@ export default class Icons {
|
|
|
43
66
|
_a = Icons;
|
|
44
67
|
Icons.fontAwesomeNext = {
|
|
45
68
|
get: (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
46
|
-
var _b;
|
|
47
|
-
let prefix = ((_b = params.prefix) === null || _b === void 0 ? void 0 : _b.replace("far", "regular").replace("fas", "solid")) || "regular";
|
|
48
69
|
let library = params.library;
|
|
49
70
|
let name = params.name || "";
|
|
50
71
|
const iconsAsRecord = icons;
|
|
51
72
|
/**
|
|
52
73
|
* SVGS en ligne
|
|
53
74
|
*/
|
|
75
|
+
if (library == "custom") {
|
|
76
|
+
enableCustomLibrary();
|
|
77
|
+
}
|
|
54
78
|
if (library && libraries[library]) {
|
|
55
|
-
let
|
|
56
|
-
|
|
57
|
-
|
|
79
|
+
let libraryItem = libraries[library];
|
|
80
|
+
let prefix = params.prefix || libraryItem.defaultPrefix;
|
|
81
|
+
let libIcons = iconsAsRecord[library] || {};
|
|
82
|
+
let libIconsKey = prefix + "-" + name;
|
|
83
|
+
// if(!libIcons )libIcons = iconsAsRecord[library] = {};
|
|
58
84
|
/**
|
|
59
85
|
* Si l'icone a déjà été chargée on ne la recharge pas
|
|
60
86
|
*/
|
|
61
|
-
if (libIcons[
|
|
62
|
-
return unsafeHTML(libIcons[
|
|
63
|
-
let url =
|
|
87
|
+
if (libIcons[libIconsKey])
|
|
88
|
+
return unsafeHTML(libIcons[libIconsKey]);
|
|
89
|
+
let url = libraryItem.url.replace("$prefix", prefix).replace("$name", name);
|
|
64
90
|
/**
|
|
65
91
|
* on utilise une promise mutualisée pour ne pas faire plusieurs appels concurents d'une même icone
|
|
66
92
|
*/
|
|
67
|
-
if (libIcons[
|
|
68
|
-
return unsafeHTML(libIcons[
|
|
93
|
+
if (libIcons[libIconsKey])
|
|
94
|
+
return unsafeHTML(libIcons[libIconsKey]);
|
|
69
95
|
if (!loadingGetPromises.has(url)) {
|
|
70
96
|
let promise = new Promise((resolve) => __awaiter(void 0, void 0, void 0, function* () {
|
|
71
97
|
let result = yield fetch(url);
|
|
@@ -84,13 +110,13 @@ Icons.fontAwesomeNext = {
|
|
|
84
110
|
*/
|
|
85
111
|
let result = yield loadingGetPromises.get(url);
|
|
86
112
|
loadingGetPromises.delete(url);
|
|
87
|
-
libIcons[
|
|
113
|
+
libIcons[libIconsKey] = result;
|
|
88
114
|
return unsafeHTML(result);
|
|
89
115
|
}
|
|
90
116
|
/**
|
|
91
117
|
* svgs "locaux"
|
|
92
118
|
*/
|
|
93
|
-
return unsafeHTML(iconsAsRecord[
|
|
119
|
+
return unsafeHTML(iconsAsRecord["core"][params.name] || "");
|
|
94
120
|
}),
|
|
95
121
|
};
|
|
96
122
|
Icons.default = Icons.fontAwesomeNext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{
|
|
1
|
+
{}
|
|
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { html, LitElement, css } from "lit";
|
|
8
8
|
import { customElement, property } from "lit/decorators.js";
|
|
9
9
|
import { styleMap } from "lit/directives/style-map.js";
|
|
10
|
+
const tagName = "sonic-image";
|
|
10
11
|
let Image = class Image extends LitElement {
|
|
11
12
|
constructor() {
|
|
12
13
|
super(...arguments);
|
|
@@ -142,11 +143,11 @@ __decorate([
|
|
|
142
143
|
property({ type: Boolean, reflect: true })
|
|
143
144
|
], Image.prototype, "cover", void 0);
|
|
144
145
|
Image = __decorate([
|
|
145
|
-
customElement(
|
|
146
|
+
customElement(tagName)
|
|
146
147
|
], Image);
|
|
147
148
|
export { Image };
|
|
148
149
|
//Ajout pour la creation du cem notamment pour Storybook
|
|
149
150
|
try {
|
|
150
|
-
customElements.define(
|
|
151
|
+
customElements.define(tagName, Image);
|
|
151
152
|
}
|
|
152
153
|
catch (e) { }
|
|
@@ -9,6 +9,7 @@ import { html, LitElement, css } from "lit";
|
|
|
9
9
|
import { customElement, property } from "lit/decorators.js";
|
|
10
10
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
11
11
|
import Electron from "@supersoniks/concorde/core/utils/Electron";
|
|
12
|
+
const tagName = "sonic-link";
|
|
12
13
|
let Link = class Link extends LitElement {
|
|
13
14
|
constructor() {
|
|
14
15
|
super(...arguments);
|
|
@@ -89,6 +90,10 @@ __decorate([
|
|
|
89
90
|
property({ type: Boolean })
|
|
90
91
|
], Link.prototype, "pushState", void 0);
|
|
91
92
|
Link = __decorate([
|
|
92
|
-
customElement(
|
|
93
|
+
customElement(tagName)
|
|
93
94
|
], Link);
|
|
94
95
|
export { Link };
|
|
96
|
+
try {
|
|
97
|
+
customElements.define(tagName, Link);
|
|
98
|
+
}
|
|
99
|
+
catch (e) { }
|
|
@@ -9,6 +9,7 @@ import { html, LitElement, css } from "lit";
|
|
|
9
9
|
import { customElement, property } from "lit/decorators.js";
|
|
10
10
|
import { inline } from "./styles/inline";
|
|
11
11
|
import { fixed } from "./styles/fixed";
|
|
12
|
+
const tagName = "sonic-loader";
|
|
12
13
|
let Loader = Loader_1 = class Loader extends LitElement {
|
|
13
14
|
constructor() {
|
|
14
15
|
super(...arguments);
|
|
@@ -84,11 +85,11 @@ __decorate([
|
|
|
84
85
|
property({ type: String })
|
|
85
86
|
], Loader.prototype, "mode", void 0);
|
|
86
87
|
Loader = Loader_1 = __decorate([
|
|
87
|
-
customElement(
|
|
88
|
+
customElement(tagName)
|
|
88
89
|
], Loader);
|
|
89
90
|
export { Loader };
|
|
90
91
|
//Ajout pour la creation du cem notamment pour Storybook
|
|
91
92
|
try {
|
|
92
|
-
customElements.define(
|
|
93
|
+
customElements.define(tagName, Loader);
|
|
93
94
|
}
|
|
94
95
|
catch (e) { }
|