@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
|
@@ -13,6 +13,7 @@ const icon = {
|
|
|
13
13
|
info: "info-empty",
|
|
14
14
|
default: "info-empty",
|
|
15
15
|
};
|
|
16
|
+
const tagName = 'sonic-alert';
|
|
16
17
|
/**
|
|
17
18
|
* Affiche un message en ligne.
|
|
18
19
|
* Soit par ses simples attributs "label" et "text", soit par son slot pour des messages plus complexes.
|
|
@@ -35,11 +36,11 @@ let Alert = class Alert extends LitElement {
|
|
|
35
36
|
render() {
|
|
36
37
|
return html `<div part="alert" class="alert">
|
|
37
38
|
<div>
|
|
38
|
-
${this.status && html `<sonic-icon
|
|
39
|
+
${this.status && html `<sonic-icon name=${icon[this.status]}></sonic-icon>`}
|
|
39
40
|
</div>
|
|
40
41
|
<div >
|
|
41
|
-
${this.label ? html `<span class="
|
|
42
|
-
${this.text} <slot
|
|
42
|
+
${this.label ? html `<span class="label">${this.label} :</span>` : nothing}
|
|
43
|
+
${this.text} <slot></slot>
|
|
43
44
|
</div>
|
|
44
45
|
</div>`;
|
|
45
46
|
}
|
|
@@ -52,7 +53,7 @@ Alert.styles = [
|
|
|
52
53
|
--sc-alert-fw: var(--sc-font-weight-base);
|
|
53
54
|
--sc-alert-fst: var(--sc-font-style-base);
|
|
54
55
|
--sc-alert-fs: 1rem;
|
|
55
|
-
--sc-alert-
|
|
56
|
+
--sc-alert-label-fw: bold;
|
|
56
57
|
|
|
57
58
|
display: block;
|
|
58
59
|
font-size: var(--sc-alert-fs);
|
|
@@ -69,8 +70,8 @@ Alert.styles = [
|
|
|
69
70
|
border-radius: var(--sc-alert-rounded);
|
|
70
71
|
}
|
|
71
72
|
|
|
72
|
-
.
|
|
73
|
-
font-weight: var(--sc-alert-
|
|
73
|
+
.label {
|
|
74
|
+
font-weight: var(--sc-alert-label-fw);
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
:host([status="warning"]) {
|
|
@@ -102,14 +103,13 @@ Alert.styles = [
|
|
|
102
103
|
bottom: 0;
|
|
103
104
|
opacity: 0.08;
|
|
104
105
|
border-radius: var(--sc-alert-rounded);
|
|
105
|
-
pointer-events:none;
|
|
106
|
+
pointer-events: none;
|
|
106
107
|
}
|
|
107
108
|
:host([background]) > div {
|
|
108
|
-
z-index:2;
|
|
109
|
-
position:relative;
|
|
109
|
+
z-index: 2;
|
|
110
|
+
position: relative;
|
|
110
111
|
}
|
|
111
112
|
|
|
112
|
-
|
|
113
113
|
/*SIZE*/
|
|
114
114
|
:host([size="xs"]) {
|
|
115
115
|
--sc-alert-fs: 0.75rem;
|
|
@@ -146,10 +146,10 @@ __decorate([
|
|
|
146
146
|
property({ type: String, reflect: true })
|
|
147
147
|
], Alert.prototype, "status", void 0);
|
|
148
148
|
Alert = __decorate([
|
|
149
|
-
customElement(
|
|
149
|
+
customElement(tagName)
|
|
150
150
|
], Alert);
|
|
151
151
|
export { Alert };
|
|
152
152
|
try {
|
|
153
|
-
customElements.define(
|
|
153
|
+
customElements.define(tagName, Alert);
|
|
154
154
|
}
|
|
155
155
|
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, property } from "lit/decorators.js";
|
|
9
|
+
const tagName = 'sonic-badge';
|
|
9
10
|
/**
|
|
10
11
|
* 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.
|
|
11
12
|
* * Le badge est comparable au bouton car il possèdent tous les deux les propriétés *type* (primary...), *variant*(outline, ghost), size(xs...)...
|
|
@@ -166,11 +167,11 @@ __decorate([
|
|
|
166
167
|
property({ type: String, reflect: true })
|
|
167
168
|
], Badge.prototype, "size", void 0);
|
|
168
169
|
Badge = __decorate([
|
|
169
|
-
customElement(
|
|
170
|
+
customElement(tagName)
|
|
170
171
|
], Badge);
|
|
171
172
|
export { Badge };
|
|
172
173
|
//Ajout pour la creation du cem notamment pour Storybook
|
|
173
174
|
try {
|
|
174
|
-
customElements.define(
|
|
175
|
+
customElements.define(tagName, Badge);
|
|
175
176
|
}
|
|
176
177
|
catch (e) { }
|
|
@@ -19,12 +19,7 @@ declare const Button_base: {
|
|
|
19
19
|
updateDataValue(): void;
|
|
20
20
|
error: true | null;
|
|
21
21
|
autofocus: true | null;
|
|
22
|
-
disabled: true | null;
|
|
23
|
-
* Un bouton simple avec deux slots, un nommé préfix et un nomé suffix de manière à pouvoir mettre (par exemple) une icone avant ou après le contenu.
|
|
24
|
-
* * L'objet et ses slot sont en display flex avec direction / alignement et justifications configurables
|
|
25
|
-
* * Le bouton est comparable au badge car il possèdent tous les deux les propriétés *type* (primary...), *variant*(outline, ghost), size(xs...)...
|
|
26
|
-
* * Le bouton possède cependant et notamment une propriété href contrairement à un badge
|
|
27
|
-
*/
|
|
22
|
+
disabled: true | null;
|
|
28
23
|
required: true | null;
|
|
29
24
|
formDataProvider: string;
|
|
30
25
|
props: any;
|
|
@@ -83,7 +78,7 @@ export declare class Button extends Button_base {
|
|
|
83
78
|
/**
|
|
84
79
|
* Propriété align-items de *flex* appliquée à l'élément contenant les *slots*
|
|
85
80
|
*/
|
|
86
|
-
|
|
81
|
+
alignItems: string;
|
|
87
82
|
/**
|
|
88
83
|
* Propriété justify-content de *flex* appliquée à l'élément contenant les *slots*
|
|
89
84
|
*/
|
|
@@ -91,7 +86,7 @@ export declare class Button extends Button_base {
|
|
|
91
86
|
/**
|
|
92
87
|
* Propriété text-align du bouton
|
|
93
88
|
*/
|
|
94
|
-
|
|
89
|
+
align: "" | "right" | "left" | "center";
|
|
95
90
|
/**
|
|
96
91
|
* Propriété min-width du bouton
|
|
97
92
|
*/
|
|
@@ -115,7 +110,7 @@ export declare class Button extends Button_base {
|
|
|
115
110
|
/**
|
|
116
111
|
* target
|
|
117
112
|
*/
|
|
118
|
-
target
|
|
113
|
+
target?: "_self" | "_blank" | "_parent" | "_top";
|
|
119
114
|
/**
|
|
120
115
|
* L'url
|
|
121
116
|
*/
|
|
@@ -12,6 +12,7 @@ import FormElement from "@supersoniks/concorde/core/mixins/FormElement";
|
|
|
12
12
|
import FormCheckable from "@supersoniks/concorde/core/mixins/FormCheckable";
|
|
13
13
|
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
14
14
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
15
|
+
const tagName = 'sonic-button';
|
|
15
16
|
/**
|
|
16
17
|
* Un bouton simple avec deux slots, un nommé préfix et un nomé suffix de manière à pouvoir mettre (par exemple) une icone avant ou après le contenu.
|
|
17
18
|
* * L'objet et ses slot sont en display flex avec direction / alignement et justifications configurables
|
|
@@ -46,7 +47,7 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
|
|
|
46
47
|
/**
|
|
47
48
|
* Propriété align-items de *flex* appliquée à l'élément contenant les *slots*
|
|
48
49
|
*/
|
|
49
|
-
this.
|
|
50
|
+
this.alignItems = "center";
|
|
50
51
|
/**
|
|
51
52
|
* Propriété justify-content de *flex* appliquée à l'élément contenant les *slots*
|
|
52
53
|
*/
|
|
@@ -54,7 +55,7 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
|
|
|
54
55
|
/**
|
|
55
56
|
* Propriété text-align du bouton
|
|
56
57
|
*/
|
|
57
|
-
this.
|
|
58
|
+
this.align = "center";
|
|
58
59
|
/**
|
|
59
60
|
* Propriété min-width du bouton
|
|
60
61
|
*/
|
|
@@ -73,10 +74,6 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
|
|
|
73
74
|
this.loading = false;
|
|
74
75
|
this.hasPrefix = false;
|
|
75
76
|
this.hasSuffix = false;
|
|
76
|
-
/**
|
|
77
|
-
* target
|
|
78
|
-
*/
|
|
79
|
-
this.target = null;
|
|
80
77
|
/**
|
|
81
78
|
* L'url
|
|
82
79
|
*/
|
|
@@ -142,9 +139,9 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
|
|
|
142
139
|
render() {
|
|
143
140
|
const btnStyles = {
|
|
144
141
|
flexDirection: this.direction,
|
|
145
|
-
alignItems: this.
|
|
142
|
+
alignItems: this.alignItems,
|
|
146
143
|
justifyContent: this.justify,
|
|
147
|
-
textAlign: this.
|
|
144
|
+
textAlign: this.align,
|
|
148
145
|
minWidth: this.minWidth,
|
|
149
146
|
};
|
|
150
147
|
const btn = html `
|
|
@@ -152,7 +149,7 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
|
|
|
152
149
|
<slot @slotchange=${this.onSlotChange} part="prefix" name="prefix"></slot>
|
|
153
150
|
<slot part="main" class="main-slot"></slot>
|
|
154
151
|
<slot @slotchange=${this.onSlotChange} part="suffix" name="suffix"></slot>
|
|
155
|
-
${this.loading == true ? html `<sonic-icon
|
|
152
|
+
${this.loading == true ? html `<sonic-icon name="loader" class="loader"></sonic-icon>` : ""}
|
|
156
153
|
</button>
|
|
157
154
|
`;
|
|
158
155
|
return this.href
|
|
@@ -363,6 +360,8 @@ Button.styles = [
|
|
|
363
360
|
/*OUTLINE*/
|
|
364
361
|
:host([variant="link"]) {
|
|
365
362
|
vertical-align: baseline;
|
|
363
|
+
margin-left:.25em;
|
|
364
|
+
margin-right:.25em;
|
|
366
365
|
}
|
|
367
366
|
|
|
368
367
|
:host([variant="link"]) button {
|
|
@@ -436,6 +435,10 @@ Button.styles = [
|
|
|
436
435
|
justify-content: center;*/
|
|
437
436
|
}
|
|
438
437
|
|
|
438
|
+
:host([minWidth]) .main-slot {
|
|
439
|
+
flex-grow:0;
|
|
440
|
+
}
|
|
441
|
+
|
|
439
442
|
slot[name="suffix"],
|
|
440
443
|
slot[name="prefix"] {
|
|
441
444
|
flex-shrink: 0;
|
|
@@ -517,13 +520,13 @@ __decorate([
|
|
|
517
520
|
], Button.prototype, "direction", void 0);
|
|
518
521
|
__decorate([
|
|
519
522
|
property({ type: String, reflect: true })
|
|
520
|
-
], Button.prototype, "
|
|
523
|
+
], Button.prototype, "alignItems", void 0);
|
|
521
524
|
__decorate([
|
|
522
525
|
property({ type: String })
|
|
523
526
|
], Button.prototype, "justify", void 0);
|
|
524
527
|
__decorate([
|
|
525
528
|
property({ type: String, reflect: true })
|
|
526
|
-
], Button.prototype, "
|
|
529
|
+
], Button.prototype, "align", void 0);
|
|
527
530
|
__decorate([
|
|
528
531
|
property({ type: String })
|
|
529
532
|
], Button.prototype, "minWidth", void 0);
|
|
@@ -561,12 +564,12 @@ __decorate([
|
|
|
561
564
|
property({ type: Boolean, reflect: true })
|
|
562
565
|
], Button.prototype, "active", void 0);
|
|
563
566
|
Button = __decorate([
|
|
564
|
-
customElement(
|
|
567
|
+
customElement(tagName)
|
|
565
568
|
], Button);
|
|
566
569
|
export { Button };
|
|
567
570
|
//Ajout pour Storybook
|
|
568
571
|
try {
|
|
569
|
-
customElements.define(
|
|
572
|
+
customElements.define(tagName, Button);
|
|
570
573
|
}
|
|
571
574
|
catch (e) { }
|
|
572
575
|
export const SonicButton = Button;
|
|
@@ -4,24 +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
|
|
7
|
+
import { html, LitElement } from "lit";
|
|
8
8
|
import { customElement } from "lit/decorators.js";
|
|
9
|
+
const tagName = "sonic-card-footer";
|
|
9
10
|
let CardFooter = class CardFooter extends LitElement {
|
|
11
|
+
// static styles = [
|
|
12
|
+
// css`
|
|
13
|
+
// :host {
|
|
14
|
+
// }
|
|
15
|
+
// `
|
|
16
|
+
// ];
|
|
10
17
|
render() {
|
|
11
18
|
return html `
|
|
12
19
|
<slot></slot>
|
|
13
20
|
`;
|
|
14
21
|
}
|
|
15
22
|
};
|
|
16
|
-
CardFooter.styles = [
|
|
17
|
-
css `
|
|
18
|
-
:host {
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
`
|
|
23
|
-
];
|
|
24
23
|
CardFooter = __decorate([
|
|
25
|
-
customElement(
|
|
24
|
+
customElement(tagName)
|
|
26
25
|
], CardFooter);
|
|
27
26
|
export { CardFooter };
|
|
27
|
+
//Ajout pour Storybook
|
|
28
|
+
try {
|
|
29
|
+
customElements.define(tagName, CardFooter);
|
|
30
|
+
}
|
|
31
|
+
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-card-header-description";
|
|
9
10
|
let CardHeaderDescription = class CardHeaderDescription extends LitElement {
|
|
10
11
|
render() {
|
|
11
12
|
return html `
|
|
@@ -28,6 +29,10 @@ CardHeaderDescription.styles = [
|
|
|
28
29
|
`
|
|
29
30
|
];
|
|
30
31
|
CardHeaderDescription = __decorate([
|
|
31
|
-
customElement(
|
|
32
|
+
customElement(tagName)
|
|
32
33
|
], CardHeaderDescription);
|
|
33
34
|
export { CardHeaderDescription };
|
|
35
|
+
try {
|
|
36
|
+
customElements.define(tagName, CardHeaderDescription);
|
|
37
|
+
}
|
|
38
|
+
catch (e) { }
|
|
@@ -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 '@supersoniks/concorde/core/components/ui/card/card-header-descripton';
|
|
10
|
+
const tagName = "sonic-card-header";
|
|
10
11
|
let CardHeader = class CardHeader extends LitElement {
|
|
11
12
|
render() {
|
|
12
13
|
return html `
|
|
@@ -62,6 +63,11 @@ __decorate([
|
|
|
62
63
|
property()
|
|
63
64
|
], CardHeader.prototype, "description", void 0);
|
|
64
65
|
CardHeader = __decorate([
|
|
65
|
-
customElement(
|
|
66
|
+
customElement(tagName)
|
|
66
67
|
], CardHeader);
|
|
67
68
|
export { CardHeader };
|
|
69
|
+
//Ajout pour Storybook
|
|
70
|
+
try {
|
|
71
|
+
customElements.define(tagName, CardHeader);
|
|
72
|
+
}
|
|
73
|
+
catch (e) { }
|
|
@@ -4,9 +4,16 @@ 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
|
|
7
|
+
import { html, LitElement } from "lit";
|
|
8
8
|
import { customElement } from "lit/decorators.js";
|
|
9
|
+
const tagName = "sonic-card-main";
|
|
9
10
|
let CardMain = class CardMain extends LitElement {
|
|
11
|
+
// static styles = [
|
|
12
|
+
// css`
|
|
13
|
+
// :host {
|
|
14
|
+
// }
|
|
15
|
+
// `
|
|
16
|
+
// ];
|
|
10
17
|
render() {
|
|
11
18
|
return html `
|
|
12
19
|
<div>
|
|
@@ -15,15 +22,12 @@ let CardMain = class CardMain extends LitElement {
|
|
|
15
22
|
`;
|
|
16
23
|
}
|
|
17
24
|
};
|
|
18
|
-
CardMain.styles = [
|
|
19
|
-
css `
|
|
20
|
-
:host {
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
`
|
|
25
|
-
];
|
|
26
25
|
CardMain = __decorate([
|
|
27
|
-
customElement(
|
|
26
|
+
customElement(tagName)
|
|
28
27
|
], CardMain);
|
|
29
28
|
export { CardMain };
|
|
29
|
+
//Ajout pour Storybook
|
|
30
|
+
try {
|
|
31
|
+
customElements.define(tagName, CardMain);
|
|
32
|
+
}
|
|
33
|
+
catch (e) { }
|
|
@@ -9,6 +9,7 @@ import { customElement, property } from "lit/decorators.js";
|
|
|
9
9
|
import "@supersoniks/concorde/core/components/ui/card/card-header";
|
|
10
10
|
import "@supersoniks/concorde/core/components/ui/card/card-main";
|
|
11
11
|
import "@supersoniks/concorde/core/components/ui/card/card-footer";
|
|
12
|
+
const tagName = "sonic-card";
|
|
12
13
|
let Card = class Card extends LitElement {
|
|
13
14
|
constructor() {
|
|
14
15
|
super(...arguments);
|
|
@@ -85,6 +86,11 @@ __decorate([
|
|
|
85
86
|
property({ type: String, reflect: true })
|
|
86
87
|
], Card.prototype, "type", void 0);
|
|
87
88
|
Card = __decorate([
|
|
88
|
-
customElement(
|
|
89
|
+
customElement(tagName)
|
|
89
90
|
], Card);
|
|
90
91
|
export { Card };
|
|
92
|
+
//Ajout pour Storybook
|
|
93
|
+
try {
|
|
94
|
+
customElements.define(tagName, Card);
|
|
95
|
+
}
|
|
96
|
+
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, property, queryAssignedNodes, query } from "lit/decorators.js";
|
|
9
|
+
const tagName = "sonic-divider";
|
|
9
10
|
let Divider = class Divider extends LitElement {
|
|
10
11
|
constructor() {
|
|
11
12
|
super(...arguments);
|
|
@@ -139,6 +140,6 @@ Divider = __decorate([
|
|
|
139
140
|
], Divider);
|
|
140
141
|
export { Divider };
|
|
141
142
|
try {
|
|
142
|
-
customElements.define(
|
|
143
|
+
customElements.define(tagName, Divider);
|
|
143
144
|
}
|
|
144
145
|
catch (e) { }
|
|
@@ -88,28 +88,9 @@ declare const Checkbox_base: {
|
|
|
88
88
|
disconnectedCallback(): void;
|
|
89
89
|
};
|
|
90
90
|
} & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
|
|
91
|
-
/**
|
|
92
|
-
* ### Le composent sonic-checkbox étend les mixins FormCheckable, FormInput, FormElement et Subscriber
|
|
93
|
-
* **FormElement :**
|
|
94
|
-
* * 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é.
|
|
95
|
-
* * Par défault lorsque modifie l'input, la valeur est également mise à jour via le même dataprovider
|
|
96
|
-
* * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
|
|
97
|
-
* * 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.
|
|
98
|
-
* * **FormInput **
|
|
99
|
-
* Uniquement des propriétés classiques d'un input HTML. La prise en compte est ici partielle, par exemple les propriétés *placeholder*, *readonly*, *pattern*, *min* et *max* n'ont pas de sens pour un checkbox.
|
|
100
|
-
* **FormCheckable :**
|
|
101
|
-
* * La propriété checked mise à true si la valeur de la propriété du même nom dans les données du dataprovider associé contient un propriété checked.
|
|
102
|
-
* **Comportements :**
|
|
103
|
-
* * multiple (par défaut):
|
|
104
|
-
* - on peut cocher plusieurs checkbox ayant le même *name*.
|
|
105
|
-
* - la valeur enregistrée dans la propriété nommé du même nom dans formDataProvider est un tableau avec les *value* des cases cochées ayant le même *name*.
|
|
106
|
-
* * unique (Ajouter l'attribute unique au composant a l'intégration):
|
|
107
|
-
* - on ne peut cocher qu'une seule checkbox ayant le même *name*.
|
|
108
|
-
* * radio (Ajouter l'attribute radio au composant a l'intégration):
|
|
109
|
-
* Comme unique, mais on ne peut pas décocher la case sauf en en cochant une autre, comme un bouton radio.
|
|
110
|
-
*/
|
|
111
91
|
export declare class Checkbox extends Checkbox_base {
|
|
112
92
|
static styles: CSSResultGroup[];
|
|
93
|
+
touched: boolean;
|
|
113
94
|
iconName: string;
|
|
114
95
|
description: string;
|
|
115
96
|
label: string;
|
|
@@ -32,9 +32,11 @@ import "@supersoniks/concorde/core/components/ui/icon/icon";
|
|
|
32
32
|
* * radio (Ajouter l'attribute radio au composant a l'intégration):
|
|
33
33
|
* Comme unique, mais on ne peut pas décocher la case sauf en en cochant une autre, comme un bouton radio.
|
|
34
34
|
*/
|
|
35
|
+
const tagName = "sonic-checkbox";
|
|
35
36
|
let Checkbox = class Checkbox extends FormCheckable(FormInput(FormElement(Subscriber(LitElement)))) {
|
|
36
37
|
constructor() {
|
|
37
38
|
super(...arguments);
|
|
39
|
+
this.touched = false;
|
|
38
40
|
this.iconName = "check";
|
|
39
41
|
this.description = "";
|
|
40
42
|
this.label = "";
|
|
@@ -63,7 +65,7 @@ let Checkbox = class Checkbox extends FormCheckable(FormInput(FormElement(Subscr
|
|
|
63
65
|
autofocus=${ifDefined(this.autofocus)}
|
|
64
66
|
|
|
65
67
|
/>
|
|
66
|
-
<sonic-icon
|
|
68
|
+
<sonic-icon
|
|
67
69
|
name="${this.iconName}" class="sc-input-icon"></sonic-icon>
|
|
68
70
|
</span>
|
|
69
71
|
<div class="checkbox-text">
|
|
@@ -79,6 +81,11 @@ let Checkbox = class Checkbox extends FormCheckable(FormInput(FormElement(Subscr
|
|
|
79
81
|
};
|
|
80
82
|
Checkbox.styles = [
|
|
81
83
|
css `
|
|
84
|
+
|
|
85
|
+
:host{
|
|
86
|
+
--sc-checkbox-border-width: var(--sc-form-border-width);
|
|
87
|
+
--sc-checkbox-border-color: transparent;
|
|
88
|
+
}
|
|
82
89
|
* {
|
|
83
90
|
box-sizing: border-box;
|
|
84
91
|
}
|
|
@@ -108,6 +115,7 @@ Checkbox.styles = [
|
|
|
108
115
|
outline: none;
|
|
109
116
|
margin: 0;
|
|
110
117
|
background-color: var(--sc-base-200);
|
|
118
|
+
border:var(--sc-checkbox-border-width) solid var(--sc-checkbox-border-color);
|
|
111
119
|
}
|
|
112
120
|
|
|
113
121
|
input:focus,
|
|
@@ -174,8 +182,20 @@ Checkbox.styles = [
|
|
|
174
182
|
.hidden {
|
|
175
183
|
display: none;
|
|
176
184
|
}
|
|
185
|
+
|
|
186
|
+
/*ERROR*/
|
|
187
|
+
:host([touched]) .checkbox-container:has(input:not(:focus):invalid) {
|
|
188
|
+
--sc-checkbox-border-color:var(--sc-danger);
|
|
189
|
+
}
|
|
190
|
+
:host([touched]) .checkbox-container:has(input:not(:focus):invalid) .checkbox-text{
|
|
191
|
+
color:var(--sc-danger);
|
|
192
|
+
}
|
|
193
|
+
|
|
177
194
|
`,
|
|
178
195
|
];
|
|
196
|
+
__decorate([
|
|
197
|
+
property({ type: Boolean, reflect: true })
|
|
198
|
+
], Checkbox.prototype, "touched", void 0);
|
|
179
199
|
__decorate([
|
|
180
200
|
property({ type: String })
|
|
181
201
|
], Checkbox.prototype, "iconName", void 0);
|
|
@@ -192,11 +212,11 @@ __decorate([
|
|
|
192
212
|
property({ type: Boolean })
|
|
193
213
|
], Checkbox.prototype, "hasDescription", void 0);
|
|
194
214
|
Checkbox = __decorate([
|
|
195
|
-
customElement(
|
|
215
|
+
customElement(tagName)
|
|
196
216
|
], Checkbox);
|
|
197
217
|
export { Checkbox };
|
|
198
218
|
//Ajout pour Storybook
|
|
199
219
|
try {
|
|
200
|
-
customElements.define(
|
|
220
|
+
customElements.define(tagName, Checkbox);
|
|
201
221
|
}
|
|
202
222
|
catch (e) { }
|
|
@@ -6,8 +6,7 @@ export const formControl = css `
|
|
|
6
6
|
|
|
7
7
|
:host {
|
|
8
8
|
--sc-input-height: var(--sc-form-height, 2.5em);
|
|
9
|
-
--sc-input-border-
|
|
10
|
-
--sc-input-border: var(--sc-input-border-with) solid var(--sc-input-border-color, var(--sc-base-300, #aaa));
|
|
9
|
+
--sc-input-border-width: var(--sc-form-border-width, 0.1rem);
|
|
11
10
|
--sc-input-color: var(--sc-base-content, #1f2937);
|
|
12
11
|
|
|
13
12
|
--sc-item-rounded-tr: var(--sc-input-rounded, var(--sc-rounded));
|
|
@@ -42,7 +41,7 @@ export const formControl = css `
|
|
|
42
41
|
|
|
43
42
|
font-family: var(--sc-input-ff);
|
|
44
43
|
background-color: var(--sc-input-bg, var(--sc-base, #fff));
|
|
45
|
-
border: var(--sc-input-border);
|
|
44
|
+
border: var(--sc-input-border-width) solid var(--sc-input-border-color, var(--sc-base-300, #aaa));
|
|
46
45
|
width: 100%;
|
|
47
46
|
font-size: var(--sc-input-fs);
|
|
48
47
|
|
|
@@ -83,16 +82,16 @@ export const formControl = css `
|
|
|
83
82
|
border-radius: var(--sc-item-rounded-tl) 0 0 var(--sc-item-rounded-bl);
|
|
84
83
|
background-color: var(--sc-input-prefix-bg);
|
|
85
84
|
color: var(--sc-input-prefix-color);
|
|
86
|
-
border: var(--sc-input-border-
|
|
87
|
-
margin-right: calc(-1 * var(--sc-input-border-
|
|
85
|
+
border: var(--sc-input-border-width) solid var(--sc-input-prefix-border-color);
|
|
86
|
+
margin-right: calc(-1 * var(--sc-input-border-width));
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
:host(:not([inlineContent])) slot[name="suffix"] {
|
|
91
90
|
border-radius: 0 var(--sc-item-rounded-tr) var(--sc-item-rounded-br) 0;
|
|
92
91
|
background-color: var(--sc-input-suffix-bg);
|
|
93
92
|
color: var(--sc-input-suffix-color);
|
|
94
|
-
border: var(--sc-input-border-
|
|
95
|
-
margin-left: calc(-1 * var(--sc-input-border-
|
|
93
|
+
border: var(--sc-input-border-width) solid var(--sc-input-suffix-border-color);
|
|
94
|
+
margin-left: calc(-1 * var(--sc-input-border-width));
|
|
96
95
|
}
|
|
97
96
|
|
|
98
97
|
:host(:not([inlineContent])) .has-prefix .form-element {
|
|
@@ -140,14 +139,7 @@ export const formControl = css `
|
|
|
140
139
|
--sc-input-bg: transparent;
|
|
141
140
|
}
|
|
142
141
|
|
|
143
|
-
|
|
144
|
-
:host([error]) {
|
|
145
|
-
--sc-input-border-color: var(--sc-danger);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
:host :not(select):not(textarea):not([value=""]):not(:focus):invalid {
|
|
149
|
-
--sc-input-color: var(--sc-danger);
|
|
150
|
-
}
|
|
142
|
+
|
|
151
143
|
|
|
152
144
|
/*Disbaled*/
|
|
153
145
|
:host([disabled]) .form-element {
|
|
@@ -192,30 +184,41 @@ export const formControl = css `
|
|
|
192
184
|
all: unset !important;
|
|
193
185
|
}
|
|
194
186
|
|
|
195
|
-
/*
|
|
196
|
-
|
|
197
|
-
|
|
187
|
+
/*Utilitaires*/
|
|
188
|
+
.hidden {
|
|
189
|
+
display: none;
|
|
198
190
|
}
|
|
199
|
-
|
|
200
|
-
|
|
191
|
+
.contents {
|
|
192
|
+
display: contents;
|
|
201
193
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
/*ERROR*/
|
|
197
|
+
:host([error]) {
|
|
198
|
+
--sc-input-border-color: var(--sc-danger);
|
|
206
199
|
}
|
|
207
|
-
|
|
208
|
-
|
|
200
|
+
|
|
201
|
+
:host input:visited{
|
|
202
|
+
display:none;
|
|
209
203
|
}
|
|
210
|
-
|
|
211
|
-
|
|
204
|
+
|
|
205
|
+
:host([touched]) :not(:focus):invalid {
|
|
206
|
+
--sc-input-border-color: var(--sc-danger);
|
|
207
|
+
--sc-input-color: var(--sc-danger);
|
|
212
208
|
}
|
|
213
209
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
display: none;
|
|
210
|
+
:host([touched]) :not(:focus):invalid + .select-chevron{
|
|
211
|
+
--sc-input-color: var(--sc-danger);
|
|
217
212
|
}
|
|
218
|
-
|
|
219
|
-
|
|
213
|
+
|
|
214
|
+
/*VALID*/
|
|
215
|
+
:host([touched]) :not([value=""]):not(:focus):valid {
|
|
216
|
+
--sc-input-border-color: var(--sc-success);
|
|
217
|
+
--sc-input-color: var(--sc-success);
|
|
220
218
|
}
|
|
219
|
+
|
|
220
|
+
:host([touched]) :not(:focus):valid + .select-chevron{
|
|
221
|
+
--sc-input-color: var(--sc-success);
|
|
222
|
+
}
|
|
223
|
+
|
|
221
224
|
`;
|