@supersoniks/concorde 1.1.42 → 1.1.43
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/components.js +2 -3
- package/concorde-core.bundle.js +37 -35
- package/concorde-core.es.js +5081 -4317
- package/core/_types/types.d.ts +26 -0
- package/core/_types/types.js +1 -0
- package/core/components/functional/date/date.d.ts +13 -5
- package/core/components/functional/date/date.js +48 -29
- package/core/components/functional/example/example.d.ts +1 -1
- package/core/components/functional/example/example.js +1 -1
- package/core/components/functional/fetch/fetch.d.ts +40 -3
- package/core/components/functional/fetch/fetch.js +2 -6
- package/core/components/functional/functional.d.ts +2 -0
- package/core/components/functional/functional.js +2 -0
- package/core/components/functional/if/if.d.ts +3 -0
- package/core/components/functional/if/if.js +6 -12
- package/core/components/functional/if/if.test.d.ts +1 -0
- package/core/components/functional/if/if.test.js +44 -0
- package/core/components/functional/list/list.d.ts +32 -8
- package/core/components/functional/list/list.js +33 -40
- package/core/components/functional/mix/mix.d.ts +22 -0
- package/core/components/functional/mix/mix.js +99 -0
- package/core/components/functional/queue/queue.d.ts +16 -3
- package/core/components/functional/queue/queue.js +71 -15
- package/core/components/functional/router/redirect.d.ts +10 -1
- package/core/components/functional/router/redirect.js +5 -6
- package/core/components/functional/router/router.d.ts +15 -1
- package/core/components/functional/router/router.js +1 -6
- package/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts +1 -1
- package/core/components/functional/sdui/SDUIDescriptorTransformer.js +24 -12
- package/core/components/functional/sdui/default-library.json +108 -0
- package/core/components/functional/sdui/sdui-utils.d.ts +5 -0
- package/core/components/functional/sdui/sdui-utils.js +63 -0
- package/core/components/functional/sdui/sdui.d.ts +16 -9
- package/core/components/functional/sdui/sdui.js +52 -25
- package/core/components/functional/sdui/types.d.ts +4 -2
- package/core/components/functional/states/states.d.ts +19 -3
- package/core/components/functional/states/states.js +7 -12
- package/core/components/functional/submit/submit.d.ts +16 -1
- package/core/components/functional/submit/submit.js +87 -17
- package/core/components/functional/subscriber/subscriber.d.ts +4 -1
- package/core/components/functional/subscriber/subscriber.js +1 -6
- package/core/components/functional/value/value.d.ts +7 -0
- package/core/components/functional/value/value.js +26 -0
- package/core/components/ui/_css/scroll.js +6 -7
- package/core/components/ui/_css/size.d.ts +1 -0
- package/core/components/ui/_css/size.js +3 -1
- package/core/components/ui/alert/alert.d.ts +2 -2
- package/core/components/ui/alert/alert.js +11 -16
- package/core/components/ui/badge/badge.d.ts +3 -1
- package/core/components/ui/badge/badge.js +36 -22
- package/core/components/ui/button/button.d.ts +23 -20
- package/core/components/ui/button/button.js +59 -42
- package/core/components/ui/captcha/captcha.d.ts +14 -2
- package/core/components/ui/captcha/captcha.js +17 -12
- package/core/components/ui/card/card-footer.js +1 -8
- package/core/components/ui/card/card-header-descripton.js +3 -9
- package/core/components/ui/card/card-header.js +1 -6
- package/core/components/ui/card/card-main.js +0 -5
- package/core/components/ui/card/card.d.ts +1 -1
- package/core/components/ui/card/card.js +28 -12
- package/core/components/ui/divider/divider.d.ts +2 -0
- package/core/components/ui/divider/divider.js +43 -16
- package/core/components/ui/form/checkbox/checkbox.d.ts +53 -16
- package/core/components/ui/form/checkbox/checkbox.js +53 -28
- package/core/components/ui/form/css/form-control.d.ts +2 -0
- package/core/components/ui/form/css/form-control.js +145 -67
- package/core/components/ui/form/fieldset/fieldset.d.ts +8 -1
- package/core/components/ui/form/fieldset/fieldset.js +45 -8
- package/core/components/ui/form/fieldset/legend-description.js +0 -5
- package/core/components/ui/form/fieldset/legend.js +3 -6
- package/core/components/ui/form/form-actions/form-actions.d.ts +2 -0
- package/core/components/ui/form/form-actions/form-actions.js +26 -11
- package/core/components/ui/form/form-layout/form-layout.d.ts +5 -2
- package/core/components/ui/form/form-layout/form-layout.js +31 -9
- package/core/components/ui/form/input/input.d.ts +15 -18
- package/core/components/ui/form/input/input.js +87 -52
- package/core/components/ui/form/input/password-helper.d.ts +1 -1
- package/core/components/ui/form/input/password-helper.js +3 -2
- package/core/components/ui/form/input/same-value-helper.d.ts +1 -1
- package/core/components/ui/form/input/same-value-helper.js +1 -0
- package/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +2 -3
- package/core/components/ui/form/input-autocomplete/input-autocomplete.js +2 -6
- package/core/components/ui/form/radio/radio.d.ts +6 -0
- package/core/components/ui/form/radio/radio.js +7 -12
- package/core/components/ui/form/select/select.d.ts +23 -7
- package/core/components/ui/form/select/select.js +69 -38
- package/core/components/ui/form/textarea/textarea.d.ts +13 -13
- package/core/components/ui/form/textarea/textarea.js +29 -36
- package/core/components/ui/group/group.d.ts +11 -1
- package/core/components/ui/group/group.js +79 -17
- package/core/components/ui/icon/icon.d.ts +10 -3
- package/core/components/ui/icon/icon.js +16 -15
- package/core/components/ui/icon/icons.js +11 -8
- package/core/components/ui/icon/icons.json +1 -1
- package/core/components/ui/image/image.js +0 -5
- package/core/components/ui/link/link.d.ts +1 -1
- package/core/components/ui/link/link.js +2 -6
- package/core/components/ui/loader/loader.js +2 -8
- package/core/components/ui/menu/menu-item.js +4 -9
- package/core/components/ui/menu/menu.d.ts +9 -1
- package/core/components/ui/menu/menu.js +183 -27
- package/core/components/ui/modal/modal-actions.js +1 -6
- package/core/components/ui/modal/modal-close.d.ts +1 -0
- package/core/components/ui/modal/modal-close.js +14 -10
- package/core/components/ui/modal/modal-content.js +0 -5
- package/core/components/ui/modal/modal-subtitle.js +2 -6
- package/core/components/ui/modal/modal-title.js +0 -5
- package/core/components/ui/modal/modal.d.ts +7 -7
- package/core/components/ui/modal/modal.js +36 -36
- package/core/components/ui/pop/pop.d.ts +6 -5
- package/core/components/ui/pop/pop.js +44 -44
- package/core/components/ui/progress/progress.js +34 -32
- package/core/components/ui/table/table-caption.js +5 -10
- package/core/components/ui/table/table-tbody.js +10 -14
- package/core/components/ui/table/table-td.d.ts +2 -0
- package/core/components/ui/table/table-td.js +8 -5
- package/core/components/ui/table/table-tfoot.js +5 -7
- package/core/components/ui/table/table-th.d.ts +2 -0
- package/core/components/ui/table/table-th.js +12 -9
- package/core/components/ui/table/table-thead.js +1 -6
- package/core/components/ui/table/table-tr.js +4 -6
- package/core/components/ui/table/table.d.ts +0 -3
- package/core/components/ui/table/table.js +14 -31
- package/core/components/ui/taxonomy/taxonomy.d.ts +6 -3
- package/core/components/ui/taxonomy/taxonomy.js +9 -9
- package/core/components/ui/theme/theme-collection/core-variables.js +13 -11
- package/core/components/ui/theme/theme-collection/dark.js +1 -1
- package/core/components/ui/theme/theme.d.ts +1 -6
- package/core/components/ui/theme/theme.js +7 -36
- package/core/components/ui/toast/message-subscriber.d.ts +13 -7
- package/core/components/ui/toast/toast-item.js +1 -1
- package/core/components/ui/toast/toast.d.ts +2 -1
- package/core/components/ui/toast/toast.js +29 -14
- package/core/components/ui/tooltip/tooltip.d.ts +1 -0
- package/core/components/ui/tooltip/tooltip.js +35 -14
- package/core/components/ui/ui.js +0 -3
- package/core/core.js +5 -6
- package/core/mixins/Fetcher.d.ts +19 -10
- package/core/mixins/Fetcher.js +26 -10
- package/core/mixins/FormCheckable.d.ts +17 -8
- package/core/mixins/FormCheckable.js +177 -22
- package/core/mixins/FormElement.d.ts +12 -7
- package/core/mixins/FormElement.js +42 -26
- package/core/mixins/FormInput.d.ts +8 -4
- package/core/mixins/FormInput.js +4 -3
- package/core/mixins/Subscriber.d.ts +7 -5
- package/core/mixins/Subscriber.js +34 -32
- package/core/utils/Arrays.d.ts +15 -15
- package/core/utils/DataBindObserver.d.ts +16 -9
- package/core/utils/DataBindObserver.js +23 -28
- package/core/utils/Electron.d.ts +5 -1
- package/core/utils/Electron.js +4 -2
- package/core/utils/HTML.d.ts +9 -2
- package/core/utils/HTML.js +22 -3
- package/core/utils/LocationHandler.d.ts +6 -5
- package/core/utils/LocationHandler.js +19 -8
- package/core/utils/Objects.d.ts +7 -4
- package/core/utils/Objects.js +28 -6
- package/core/utils/{PublisherProxy.d.mts → PublisherProxy.d.ts} +40 -31
- package/core/utils/{PublisherProxy.mjs → PublisherProxy.js} +54 -28
- package/core/utils/Utils.d.ts +3 -0
- package/core/utils/Utils.js +18 -0
- package/core/utils/api.d.ts +39 -7
- package/core/utils/api.js +45 -32
- package/img/concorde-logo.svg +1 -0
- package/img/concorde.png +0 -0
- package/img/concorde_def.png +0 -0
- package/mixins.d.ts +36 -18
- package/mixins.js +3 -4
- package/package.json +45 -10
- package/svg/regular/plane.svg +1 -0
- package/svg/solid/plane.svg +1 -0
- package/test-utils/TestUtils.d.ts +4 -0
- package/test-utils/TestUtils.js +12 -0
- package/utils.d.ts +3 -1
- package/utils.js +7 -5
- package/core/components/functional/configuration/configuration.d.ts +0 -5
- package/core/components/functional/configuration/configuration.js +0 -22
- package/core/components/ui/tabs/tab.d.ts +0 -6
- package/core/components/ui/tabs/tab.js +0 -46
- package/core/components/ui/tabs/tabs.d.ts +0 -15
- package/core/components/ui/tabs/tabs.js +0 -129
|
@@ -13,7 +13,6 @@ import "@supersoniks/concorde/core/components/functional/queue/queue";
|
|
|
13
13
|
import "@supersoniks/concorde/core/components/ui/menu/menu-item";
|
|
14
14
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
15
15
|
/**
|
|
16
|
-
* TODO Améliorer et valider le fonctionnement avec JB et Julien. Puis possiblement merger sur concorde
|
|
17
16
|
* Input avec autocomplete. Propose des valeurs à partir d'un sonic-queue.
|
|
18
17
|
* L'input permet de filtrer les choix de valeurs dans le sonic-pop.
|
|
19
18
|
* La valeur de cet input est ensuite retransmit au premier via un dataProvider.
|
|
@@ -67,12 +66,13 @@ let InputAutocomplete = class InputAutocomplete extends TemplatesContainer(Subsc
|
|
|
67
66
|
return html `
|
|
68
67
|
<sonic-pop toggle="false" style="display:block;">
|
|
69
68
|
<sonic-input
|
|
70
|
-
type="
|
|
69
|
+
type="search"
|
|
71
70
|
data-keyboard-nav="nav-autocomplete"
|
|
72
71
|
label="${ifDefined(this.label)}"
|
|
73
72
|
description="${ifDefined(this.description)}"
|
|
74
73
|
name="${ifDefined(this.name)}"
|
|
75
74
|
value="${ifDefined(this.value)}"
|
|
75
|
+
autocomplete="off"
|
|
76
76
|
clearable
|
|
77
77
|
></sonic-input>
|
|
78
78
|
<sonic-menu slot="content">
|
|
@@ -131,7 +131,3 @@ InputAutocomplete = __decorate([
|
|
|
131
131
|
customElement("sonic-input-autocomplete")
|
|
132
132
|
], InputAutocomplete);
|
|
133
133
|
export { InputAutocomplete };
|
|
134
|
-
// //Ajout pour custom-elements-manifest pour storybook notamment
|
|
135
|
-
// try {
|
|
136
|
-
// customElements.define("sonic-input-autocomplete", InputAutocomplete);
|
|
137
|
-
// } catch (e) {}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { Checkbox } from "@supersoniks/concorde/core/components/ui/form/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
|
+
*/
|
|
2
8
|
export declare class Radio extends Checkbox {
|
|
3
9
|
static styles: (import("lit").CSSResult | import("lit").CSSResultGroup[])[];
|
|
4
10
|
constructor();
|
|
@@ -7,13 +7,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { css } from "lit";
|
|
8
8
|
import { customElement } from "lit/decorators.js";
|
|
9
9
|
import { Checkbox } from "@supersoniks/concorde/core/components/ui/form/checkbox/checkbox";
|
|
10
|
+
const tagName = "sonic-radio";
|
|
10
11
|
/**
|
|
11
12
|
* ### Le composant sonic-radio étend sonic-checkbox en assignant sa propriété radio à true.
|
|
12
13
|
*
|
|
13
14
|
* * Le type d'input html utilisé passe également de checkbox à radio.
|
|
14
15
|
* * Le comportement est donc similaire à un bouton radio classique mais avec les fonctionnalités de sonic-checkbox (ie : Subscriber / FormElement / FormCheckable).
|
|
15
16
|
*/
|
|
16
|
-
const tagName = "sonic-radio";
|
|
17
17
|
let Radio = class Radio extends Checkbox {
|
|
18
18
|
constructor() {
|
|
19
19
|
super();
|
|
@@ -35,12 +35,12 @@ Radio.styles = [
|
|
|
35
35
|
:host sonic-icon {
|
|
36
36
|
border-radius: 50%;
|
|
37
37
|
overflow: hidden;
|
|
38
|
-
background-color:var(--sc-primary-content);
|
|
39
|
-
line-height:0;
|
|
40
|
-
display:block;
|
|
41
|
-
font-size:
|
|
42
|
-
height:
|
|
43
|
-
width:
|
|
38
|
+
background-color: var(--sc-primary-content);
|
|
39
|
+
line-height: 0;
|
|
40
|
+
display: block;
|
|
41
|
+
font-size: 1em;
|
|
42
|
+
height: 0.6em;
|
|
43
|
+
width: 0.6em;
|
|
44
44
|
}
|
|
45
45
|
`,
|
|
46
46
|
];
|
|
@@ -48,8 +48,3 @@ Radio = __decorate([
|
|
|
48
48
|
customElement(tagName)
|
|
49
49
|
], Radio);
|
|
50
50
|
export { Radio };
|
|
51
|
-
//Ajout pour Storybook
|
|
52
|
-
try {
|
|
53
|
-
customElements.define(tagName, Radio);
|
|
54
|
-
}
|
|
55
|
-
catch (e) { }
|
|
@@ -1,6 +1,19 @@
|
|
|
1
|
-
import { LitElement } from "lit";
|
|
1
|
+
import { LitElement, PropertyValues } from "lit";
|
|
2
2
|
import "@supersoniks/concorde/core/components/ui/icon/icon";
|
|
3
|
-
declare
|
|
3
|
+
export declare type SelectOption = {
|
|
4
|
+
value?: string;
|
|
5
|
+
wording?: string;
|
|
6
|
+
selected?: boolean;
|
|
7
|
+
hasAttribute?: (value: string) => boolean;
|
|
8
|
+
} & Record<string, string>;
|
|
9
|
+
declare const Select_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<any>) & typeof LitElement;
|
|
10
|
+
/**
|
|
11
|
+
* #### FormElement :
|
|
12
|
+
* * 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é.
|
|
13
|
+
* * Par défault lorsque l'on édite l'input, la valeur est également mise à jour via le même dataprovider
|
|
14
|
+
* * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
|
|
15
|
+
* * 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.
|
|
16
|
+
*/
|
|
4
17
|
export declare class Select extends Select_base {
|
|
5
18
|
static styles: import("lit").CSSResult[];
|
|
6
19
|
valueKey: string;
|
|
@@ -9,11 +22,14 @@ export declare class Select extends Select_base {
|
|
|
9
22
|
size?: "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
10
23
|
selectSize?: number;
|
|
11
24
|
private _options;
|
|
12
|
-
set options(
|
|
13
|
-
get options(): Array<
|
|
25
|
+
set options(options: Array<SelectOption>);
|
|
26
|
+
get options(): Array<SelectOption>;
|
|
27
|
+
hasDoneFirstUpdate: boolean;
|
|
28
|
+
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
14
29
|
_value: string;
|
|
15
|
-
get value(): string;
|
|
16
30
|
set value(value: string);
|
|
31
|
+
get value(): string;
|
|
32
|
+
updateFormPublisherValue(): void;
|
|
17
33
|
connectedCallback(): void;
|
|
18
34
|
forceAutoFill: boolean;
|
|
19
35
|
_description?: string;
|
|
@@ -30,8 +46,8 @@ export declare class Select extends Select_base {
|
|
|
30
46
|
hasLabel: boolean;
|
|
31
47
|
hasSuffix: boolean;
|
|
32
48
|
hasPrefix: boolean;
|
|
33
|
-
|
|
34
|
-
|
|
49
|
+
willUpdate(changedProperties: PropertyValues): void;
|
|
50
|
+
hasSlotOrProps(): void;
|
|
35
51
|
validateFormElement(): void;
|
|
36
52
|
render(): import("lit-html").TemplateResult<1>;
|
|
37
53
|
}
|
|
@@ -4,17 +4,18 @@ 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 { PublisherManager } from "@supersoniks/concorde/core/utils/PublisherProxy.mjs";
|
|
8
7
|
import { html, LitElement, css } from "lit";
|
|
9
8
|
import { customElement, property, queryAssignedNodes, state } from "lit/decorators.js";
|
|
10
9
|
import { classMap } from "lit/directives/class-map.js";
|
|
11
10
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
12
11
|
import { repeat } from "lit/directives/repeat.js";
|
|
13
|
-
import { formControl } from "@supersoniks/concorde/core/components/ui/form/css/form-control";
|
|
12
|
+
import { formControl, label, description } from "@supersoniks/concorde/core/components/ui/form/css/form-control";
|
|
14
13
|
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
15
14
|
import FormElement from "@supersoniks/concorde/core/mixins/FormElement";
|
|
16
15
|
import "@supersoniks/concorde/core/components/ui/icon/icon";
|
|
17
16
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
17
|
+
import { fontSize } from "@supersoniks/concorde/core/components/ui/_css/size";
|
|
18
|
+
const tagName = "sonic-select";
|
|
18
19
|
/**
|
|
19
20
|
* #### FormElement :
|
|
20
21
|
* * 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é.
|
|
@@ -22,7 +23,6 @@ import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
|
22
23
|
* * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
|
|
23
24
|
* * 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.
|
|
24
25
|
*/
|
|
25
|
-
const tagName = "sonic-select";
|
|
26
26
|
let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
27
27
|
constructor() {
|
|
28
28
|
super(...arguments);
|
|
@@ -30,6 +30,7 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
30
30
|
this.wordingKey = "wording";
|
|
31
31
|
this.multiple = false;
|
|
32
32
|
this._options = [];
|
|
33
|
+
this.hasDoneFirstUpdate = false;
|
|
33
34
|
this._value = "";
|
|
34
35
|
/*
|
|
35
36
|
* TODO
|
|
@@ -41,9 +42,15 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
41
42
|
this.hasSuffix = false;
|
|
42
43
|
this.hasPrefix = false;
|
|
43
44
|
}
|
|
44
|
-
set options(
|
|
45
|
-
this._options =
|
|
46
|
-
|
|
45
|
+
set options(options) {
|
|
46
|
+
this._options = options;
|
|
47
|
+
for (const option of options) {
|
|
48
|
+
if (option.selected) {
|
|
49
|
+
this.value = option.value || "";
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
let value = this.value || this.getAttribute("value");
|
|
53
|
+
if (!value && this._options.length > 0) {
|
|
47
54
|
this.value = this._options[0][this.valueKey];
|
|
48
55
|
}
|
|
49
56
|
this.requestUpdate();
|
|
@@ -51,32 +58,39 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
51
58
|
get options() {
|
|
52
59
|
return this._options;
|
|
53
60
|
}
|
|
54
|
-
|
|
55
|
-
|
|
61
|
+
firstUpdated(_changedProperties) {
|
|
62
|
+
this.hasDoneFirstUpdate = true;
|
|
56
63
|
}
|
|
57
64
|
set value(value) {
|
|
58
|
-
if (!
|
|
65
|
+
if (value == null && !this.hasDoneFirstUpdate)
|
|
59
66
|
return;
|
|
67
|
+
if (!value)
|
|
68
|
+
value = "";
|
|
60
69
|
if (this._value == value)
|
|
61
70
|
return;
|
|
62
71
|
this._value = value;
|
|
63
|
-
|
|
64
|
-
this.formDataProvider = this.getAncestorAttributeValue("formDataProvider");
|
|
65
|
-
if (this.formDataProvider) {
|
|
66
|
-
PublisherManager.getInstance().get(this.formDataProvider)[this._name] = value;
|
|
67
|
-
}
|
|
68
|
-
else if (this.publisher)
|
|
69
|
-
this.publisher[this._name] = value;
|
|
72
|
+
this.updateFormPublisherValue();
|
|
70
73
|
this.requestUpdate();
|
|
71
74
|
}
|
|
75
|
+
get value() {
|
|
76
|
+
return this._value;
|
|
77
|
+
}
|
|
78
|
+
updateFormPublisherValue() {
|
|
79
|
+
let formPublisher = this.getFormPublisher();
|
|
80
|
+
if (formPublisher) {
|
|
81
|
+
formPublisher[this.name] = this.value;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
72
84
|
connectedCallback() {
|
|
73
85
|
super.connectedCallback();
|
|
86
|
+
this.hasSlotOrProps();
|
|
74
87
|
let options = this.querySelectorAll("option");
|
|
75
88
|
if (options.length > 0) {
|
|
76
89
|
this.options = Array.from(options).map((option) => {
|
|
77
90
|
return {
|
|
78
91
|
value: option.value,
|
|
79
92
|
wording: option.text,
|
|
93
|
+
selected: option.hasAttribute("selected"),
|
|
80
94
|
};
|
|
81
95
|
});
|
|
82
96
|
}
|
|
@@ -99,23 +113,26 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
99
113
|
this._label = value;
|
|
100
114
|
this.requestUpdate();
|
|
101
115
|
}
|
|
102
|
-
|
|
116
|
+
willUpdate(changedProperties) {
|
|
117
|
+
this.hasSlotOrProps();
|
|
118
|
+
super.willUpdate(changedProperties);
|
|
119
|
+
}
|
|
120
|
+
hasSlotOrProps() {
|
|
103
121
|
var _a, _b, _c, _d;
|
|
104
122
|
this.hasLabel = this.label || ((_a = this.slotLabelNodes) === null || _a === void 0 ? void 0 : _a.length) ? true : false;
|
|
105
123
|
this.hasDescription = this.description || ((_b = this.slotDescriptionNodes) === null || _b === void 0 ? void 0 : _b.length) ? true : false;
|
|
106
124
|
this.hasSuffix = ((_c = this.slotSuffixNodes) === null || _c === void 0 ? void 0 : _c.length) ? true : false;
|
|
107
125
|
this.hasPrefix = ((_d = this.slotPrefixNodes) === null || _d === void 0 ? void 0 : _d.length) ? true : false;
|
|
108
126
|
}
|
|
109
|
-
onSlotChange() {
|
|
110
|
-
this.requestUpdate();
|
|
111
|
-
}
|
|
112
127
|
validateFormElement() {
|
|
113
128
|
var _a;
|
|
114
|
-
const
|
|
115
|
-
const select = (_a = that.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("select");
|
|
129
|
+
const select = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("select");
|
|
116
130
|
if (!select || select.checkValidity())
|
|
117
131
|
return;
|
|
118
|
-
this.getFormPublisher()
|
|
132
|
+
let formPublisher = this.getFormPublisher();
|
|
133
|
+
if (formPublisher) {
|
|
134
|
+
formPublisher.isFormValid = false;
|
|
135
|
+
}
|
|
119
136
|
select.reportValidity();
|
|
120
137
|
}
|
|
121
138
|
render() {
|
|
@@ -128,23 +145,26 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
128
145
|
<label for="form-element" class="${this.hasLabel ? "form-label" : "hidden"}"
|
|
129
146
|
>${this.label ? unsafeHTML(this.label /*+ labelStarSuffix*/) : ""}<slot
|
|
130
147
|
name="label"
|
|
131
|
-
@slotchange=${this.
|
|
148
|
+
@slotchange=${this.hasSlotOrProps}
|
|
132
149
|
></slot
|
|
133
150
|
></label>
|
|
134
151
|
|
|
135
152
|
<div class="form-control ${classMap(slotClasses)}">
|
|
136
|
-
<slot name="prefix" @slotchange=${this.
|
|
153
|
+
<slot name="prefix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
137
154
|
<div class="form-select-wrapper">
|
|
138
155
|
<select
|
|
156
|
+
id="form-element"
|
|
139
157
|
@change=${this.handleChange}
|
|
140
158
|
@blur=${this.handleBlur}
|
|
141
|
-
disabled=${ifDefined(this.disabled)}
|
|
159
|
+
?disabled=${ifDefined(this.disabled)}
|
|
142
160
|
?required=${this.required}
|
|
143
161
|
?multiple=${this.multiple}
|
|
144
162
|
size=${ifDefined(this.selectSize)}
|
|
145
163
|
?autofocus=${this.autofocus}
|
|
146
164
|
.value="${this.value}"
|
|
147
165
|
class="form-element"
|
|
166
|
+
aria-label=${ifDefined(this.ariaLabel)}
|
|
167
|
+
aria-labelledby=${ifDefined(this.ariaLabelledby)}
|
|
148
168
|
>
|
|
149
169
|
${repeat(this.options, (option) => option[this.valueKey], (option) => {
|
|
150
170
|
const isSelected = this.value == option[this.valueKey] ? "selected" : null;
|
|
@@ -154,24 +174,40 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
154
174
|
})}
|
|
155
175
|
<slot></slot>
|
|
156
176
|
</select>
|
|
157
|
-
<sonic-icon class="select-chevron" name="nav-arrow-down" size
|
|
177
|
+
<sonic-icon class="select-chevron" name="nav-arrow-down" .size=${this.size}></sonic-icon>
|
|
158
178
|
</div>
|
|
159
|
-
<slot name="suffix" @slotchange=${this.
|
|
179
|
+
<slot name="suffix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
160
180
|
</div>
|
|
161
181
|
|
|
162
|
-
<slot
|
|
182
|
+
<slot
|
|
183
|
+
name="description"
|
|
184
|
+
@slotchange=${this.hasSlotOrProps}
|
|
185
|
+
class="${this.hasDescription ? "form-description" : "hidden"}"
|
|
186
|
+
>
|
|
163
187
|
${this.description ? html `${unsafeHTML(this.description)}` : ""}
|
|
164
188
|
</slot>
|
|
165
189
|
`;
|
|
166
190
|
}
|
|
167
191
|
};
|
|
168
192
|
Select.styles = [
|
|
193
|
+
fontSize,
|
|
169
194
|
formControl,
|
|
195
|
+
label,
|
|
196
|
+
description,
|
|
170
197
|
css `
|
|
171
198
|
.form-element {
|
|
172
199
|
appearance: none;
|
|
173
|
-
padding-right: 2.5em;
|
|
174
200
|
}
|
|
201
|
+
|
|
202
|
+
:host([disabled]) sonic-icon {
|
|
203
|
+
opacity: 0;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* Désactive padding right pour les sélecteur désactivé avec une option*/
|
|
207
|
+
:host(:not([disabled])) .form-element:not(:has(option:only-child)) {
|
|
208
|
+
padding-right: max(1em, calc(0.8 * var(--sc-input-px)));
|
|
209
|
+
}
|
|
210
|
+
|
|
175
211
|
.form-select-wrapper {
|
|
176
212
|
position: relative;
|
|
177
213
|
width: 100%;
|
|
@@ -179,11 +215,11 @@ Select.styles = [
|
|
|
179
215
|
|
|
180
216
|
sonic-icon {
|
|
181
217
|
position: absolute;
|
|
182
|
-
right:
|
|
218
|
+
right: calc(0.8 * var(--sc-input-px));
|
|
183
219
|
top: 50%;
|
|
184
220
|
pointer-events: none;
|
|
185
221
|
transform: translateY(-50%);
|
|
186
|
-
color: var(--sc-input-
|
|
222
|
+
color: var(--sc-input-c);
|
|
187
223
|
}
|
|
188
224
|
|
|
189
225
|
option {
|
|
@@ -212,7 +248,7 @@ __decorate([
|
|
|
212
248
|
property({ type: Array })
|
|
213
249
|
], Select.prototype, "options", null);
|
|
214
250
|
__decorate([
|
|
215
|
-
property()
|
|
251
|
+
property({ reflect: true })
|
|
216
252
|
], Select.prototype, "value", null);
|
|
217
253
|
__decorate([
|
|
218
254
|
property({ type: Boolean })
|
|
@@ -251,8 +287,3 @@ Select = __decorate([
|
|
|
251
287
|
customElement(tagName)
|
|
252
288
|
], Select);
|
|
253
289
|
export { Select };
|
|
254
|
-
//Ajout pour Storybook
|
|
255
|
-
try {
|
|
256
|
-
customElements.define(tagName, Select);
|
|
257
|
-
}
|
|
258
|
-
catch (e) { }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement } from "lit";
|
|
1
|
+
import { LitElement, PropertyValues } from "lit";
|
|
2
2
|
declare const Textarea_base: {
|
|
3
3
|
new (...args: any[]): {
|
|
4
4
|
validateFormElement(): void;
|
|
@@ -13,16 +13,20 @@ declare const Textarea_base: {
|
|
|
13
13
|
autocomplete?: "url" | "name" | "language" | "on" | "tel" | "email" | "honorific-prefix" | "given-name" | "additional-name" | "family-name" | "honorific-suffix" | "nickname" | "username" | "new-password" | "current-password" | "one-time-code" | "organization-title" | "organization" | "street-address" | "address-line1" | "address-line2" | "address-line3" | "address-level4" | "address-level3" | "address-level2" | "address-level1" | "country" | "country-name" | "postal-code" | "cc-name" | "cc-given-name" | "cc-additional-name" | "cc-family-name" | "cc-number" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-csc" | "cc-type" | "transaction-currency" | "transaction-amount" | "bday" | "bday-day" | "bday-month" | "bday-year" | "sex" | "tel-country-code" | "tel-national" | "tel-area-code" | "tel-local" | "tel-extension" | "impp" | "photo" | undefined;
|
|
14
14
|
getFormPublisher(): any;
|
|
15
15
|
updateDataValue(): void;
|
|
16
|
-
handleChange(e?:
|
|
17
|
-
handleBlur(e?:
|
|
16
|
+
handleChange(e?: Event | undefined): void;
|
|
17
|
+
handleBlur(e?: Event | undefined): void;
|
|
18
18
|
getValueForFormPublisher(): any;
|
|
19
|
+
focus?: (() => void) | undefined;
|
|
20
|
+
shadowRoot?: ShadowRoot | undefined;
|
|
19
21
|
error: boolean;
|
|
20
22
|
autofocus: boolean;
|
|
21
23
|
required: boolean;
|
|
22
24
|
disabled: true | null;
|
|
23
25
|
formDataProvider: string;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
ariaLabelledby?: string | undefined;
|
|
27
|
+
ariaLabel?: string | undefined;
|
|
28
|
+
_value: string | null;
|
|
29
|
+
value: string | null;
|
|
26
30
|
_name: string;
|
|
27
31
|
name: string;
|
|
28
32
|
props: any;
|
|
@@ -50,7 +54,7 @@ declare const Textarea_base: {
|
|
|
50
54
|
hasAttribute(attributeName: String): boolean;
|
|
51
55
|
disconnectedCallback(): void;
|
|
52
56
|
};
|
|
53
|
-
} & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
|
|
57
|
+
} & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<any>) & typeof LitElement;
|
|
54
58
|
export declare class Textarea extends Textarea_base {
|
|
55
59
|
static styles: import("lit").CSSResult[];
|
|
56
60
|
size: "" | "xs" | "sm" | "lg";
|
|
@@ -63,15 +67,11 @@ export declare class Textarea extends Textarea_base {
|
|
|
63
67
|
placeholder?: string;
|
|
64
68
|
slotLabelNodes: Array<Node>;
|
|
65
69
|
slotDescriptionNodes: Array<Node>;
|
|
66
|
-
slotSuffixNodes: Array<Node>;
|
|
67
|
-
slotPrefixNodes: Array<Node>;
|
|
68
70
|
hasDescription: boolean;
|
|
69
71
|
hasLabel: boolean;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
updated(): void;
|
|
74
|
-
onSlotChange(): void;
|
|
72
|
+
connectedCallback(): void;
|
|
73
|
+
willUpdate(changedProperties: PropertyValues): void;
|
|
74
|
+
hasSlotOrProps(): void;
|
|
75
75
|
validateFormElement(): void;
|
|
76
76
|
render(): import("lit-html").TemplateResult<1>;
|
|
77
77
|
}
|
|
@@ -7,12 +7,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { html, LitElement, css } from "lit";
|
|
8
8
|
import { customElement, property, state, queryAssignedNodes } from "lit/decorators.js";
|
|
9
9
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
10
|
-
import { formControl } from "@supersoniks/concorde/core/components/ui/form/css/form-control";
|
|
10
|
+
import { formControl, label, description } from "@supersoniks/concorde/core/components/ui/form/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
14
|
import { customScroll } from "@supersoniks/concorde/core/components/ui/_css/scroll";
|
|
15
15
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
16
|
+
import { fontSize } from "@supersoniks/concorde/core/components/ui/_css/size";
|
|
16
17
|
const tagName = "sonic-textarea";
|
|
17
18
|
let Textarea = class Textarea extends FormInput(FormElement(Subscriber(LitElement))) {
|
|
18
19
|
constructor() {
|
|
@@ -24,27 +25,29 @@ let Textarea = class Textarea extends FormInput(FormElement(Subscriber(LitElemen
|
|
|
24
25
|
this.readonly = false;
|
|
25
26
|
this.hasDescription = false;
|
|
26
27
|
this.hasLabel = false;
|
|
27
|
-
this.hasSuffix = false;
|
|
28
|
-
this.hasPrefix = false;
|
|
29
|
-
this.slotClasses = {};
|
|
30
28
|
}
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
connectedCallback() {
|
|
30
|
+
super.connectedCallback();
|
|
31
|
+
this.hasSlotOrProps();
|
|
32
|
+
}
|
|
33
|
+
willUpdate(changedProperties) {
|
|
34
|
+
this.hasSlotOrProps();
|
|
35
|
+
super.willUpdate(changedProperties);
|
|
36
|
+
}
|
|
37
|
+
hasSlotOrProps() {
|
|
38
|
+
var _a, _b;
|
|
33
39
|
this.hasLabel = this.label || ((_a = this.slotLabelNodes) === null || _a === void 0 ? void 0 : _a.length) ? true : false;
|
|
34
40
|
this.hasDescription = this.description || ((_b = this.slotDescriptionNodes) === null || _b === void 0 ? void 0 : _b.length) ? true : false;
|
|
35
|
-
this.hasSuffix = ((_c = this.slotSuffixNodes) === null || _c === void 0 ? void 0 : _c.length) ? true : false;
|
|
36
|
-
this.hasPrefix = ((_d = this.slotPrefixNodes) === null || _d === void 0 ? void 0 : _d.length) ? true : false;
|
|
37
|
-
}
|
|
38
|
-
onSlotChange() {
|
|
39
|
-
this.requestUpdate();
|
|
40
41
|
}
|
|
41
42
|
validateFormElement() {
|
|
42
43
|
var _a;
|
|
43
|
-
const
|
|
44
|
-
const textarea = (_a = that.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("textarea");
|
|
44
|
+
const textarea = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("textarea");
|
|
45
45
|
if (!textarea || textarea.checkValidity())
|
|
46
46
|
return;
|
|
47
|
-
this.getFormPublisher()
|
|
47
|
+
let formPublisher = this.getFormPublisher();
|
|
48
|
+
if (formPublisher) {
|
|
49
|
+
formPublisher.isFormValid = false;
|
|
50
|
+
}
|
|
48
51
|
textarea.reportValidity();
|
|
49
52
|
}
|
|
50
53
|
render() {
|
|
@@ -53,12 +56,13 @@ let Textarea = class Textarea extends FormInput(FormElement(Subscriber(LitElemen
|
|
|
53
56
|
<label for="form-element" class="${this.hasLabel ? "form-label" : "hidden"}"
|
|
54
57
|
>${this.label ? unsafeHTML(this.label /*+ labelStarSuffix*/) : ""}<slot
|
|
55
58
|
name="label"
|
|
56
|
-
@slotchange=${this.
|
|
59
|
+
@slotchange=${this.hasSlotOrProps}
|
|
57
60
|
></slot
|
|
58
61
|
></label>
|
|
59
62
|
|
|
60
63
|
<div class="form-control">
|
|
61
64
|
<textarea
|
|
65
|
+
id="form-element"
|
|
62
66
|
@input=${this.handleChange}
|
|
63
67
|
@blur=${this.handleBlur}
|
|
64
68
|
disabled=${ifDefined(this.disabled)}
|
|
@@ -75,19 +79,28 @@ let Textarea = class Textarea extends FormInput(FormElement(Subscriber(LitElemen
|
|
|
75
79
|
wrap=${ifDefined(this.wrap)}
|
|
76
80
|
placeholder="${this.placeholder}"
|
|
77
81
|
class="form-element textarea custom-scroll"
|
|
82
|
+
aria-label=${ifDefined(this.ariaLabel)}
|
|
83
|
+
aria-labelledby=${ifDefined(this.ariaLabelledby)}
|
|
78
84
|
>
|
|
79
85
|
${this.value}</textarea
|
|
80
86
|
>
|
|
81
87
|
</div>
|
|
82
88
|
|
|
83
|
-
<slot
|
|
89
|
+
<slot
|
|
90
|
+
name="description"
|
|
91
|
+
@slotchange=${this.hasSlotOrProps}
|
|
92
|
+
class="${this.hasDescription ? "form-description" : "hidden"}"
|
|
93
|
+
>
|
|
84
94
|
${this.description ? html `${unsafeHTML(this.description)}` : ""}
|
|
85
95
|
</slot>
|
|
86
96
|
`;
|
|
87
97
|
}
|
|
88
98
|
};
|
|
89
99
|
Textarea.styles = [
|
|
100
|
+
fontSize,
|
|
90
101
|
formControl,
|
|
102
|
+
label,
|
|
103
|
+
description,
|
|
91
104
|
customScroll,
|
|
92
105
|
css `
|
|
93
106
|
textarea {
|
|
@@ -125,33 +138,13 @@ __decorate([
|
|
|
125
138
|
__decorate([
|
|
126
139
|
queryAssignedNodes({ slot: "description" })
|
|
127
140
|
], Textarea.prototype, "slotDescriptionNodes", void 0);
|
|
128
|
-
__decorate([
|
|
129
|
-
queryAssignedNodes({ slot: "suffix" })
|
|
130
|
-
], Textarea.prototype, "slotSuffixNodes", void 0);
|
|
131
|
-
__decorate([
|
|
132
|
-
queryAssignedNodes({ slot: "prefix" })
|
|
133
|
-
], Textarea.prototype, "slotPrefixNodes", void 0);
|
|
134
141
|
__decorate([
|
|
135
142
|
state()
|
|
136
143
|
], Textarea.prototype, "hasDescription", void 0);
|
|
137
144
|
__decorate([
|
|
138
145
|
state()
|
|
139
146
|
], Textarea.prototype, "hasLabel", void 0);
|
|
140
|
-
__decorate([
|
|
141
|
-
state()
|
|
142
|
-
], Textarea.prototype, "hasSuffix", void 0);
|
|
143
|
-
__decorate([
|
|
144
|
-
state()
|
|
145
|
-
], Textarea.prototype, "hasPrefix", void 0);
|
|
146
|
-
__decorate([
|
|
147
|
-
property()
|
|
148
|
-
], Textarea.prototype, "slotClasses", void 0);
|
|
149
147
|
Textarea = __decorate([
|
|
150
148
|
customElement(tagName)
|
|
151
149
|
], Textarea);
|
|
152
150
|
export { Textarea };
|
|
153
|
-
//Ajout pour Storybook
|
|
154
|
-
try {
|
|
155
|
-
customElements.define(tagName, Textarea);
|
|
156
|
-
}
|
|
157
|
-
catch (e) { }
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
import { LitElement } from "lit";
|
|
1
|
+
import { LitElement, PropertyValues } from "lit";
|
|
2
2
|
export declare class Group extends LitElement {
|
|
3
|
+
alignItems: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
slotLabelNodes: Array<Node>;
|
|
7
|
+
slotDescriptionNodes: Array<Node>;
|
|
8
|
+
hasDescription: boolean;
|
|
9
|
+
hasLabel: boolean;
|
|
3
10
|
static styles: import("lit").CSSResult[];
|
|
4
11
|
updated(): void;
|
|
12
|
+
connectedCallback(): void;
|
|
13
|
+
willUpdate(changedProperties: PropertyValues): void;
|
|
14
|
+
hasSlotOrProps(): void;
|
|
5
15
|
render(): import("lit-html").TemplateResult<1>;
|
|
6
16
|
}
|