@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
|
@@ -4,10 +4,11 @@ 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, css } from "lit";
|
|
7
|
+
import { html, LitElement, css, nothing } 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
|
+
import "./legend";
|
|
11
12
|
const tagName = "sonic-fieldset";
|
|
12
13
|
let Fieldset = class Fieldset extends Subscriber(LitElement) {
|
|
13
14
|
constructor() {
|
|
@@ -17,9 +18,19 @@ let Fieldset = class Fieldset extends Subscriber(LitElement) {
|
|
|
17
18
|
* Désactiver le fieldset
|
|
18
19
|
*/
|
|
19
20
|
this.disabled = false;
|
|
21
|
+
this.variant = "default";
|
|
20
22
|
}
|
|
21
23
|
render() {
|
|
22
24
|
return html `<fieldset form="${ifDefined(this.form)}" ?disabled="${this.disabled}">
|
|
25
|
+
${this.label
|
|
26
|
+
? html ` <sonic-legend
|
|
27
|
+
label=${ifDefined(this.label)}
|
|
28
|
+
description=${ifDefined(this.description)}
|
|
29
|
+
iconName=${ifDefined(this.iconName)}
|
|
30
|
+
iconPrefix=${ifDefined(this.iconPrefix)}
|
|
31
|
+
iconLibrary=${ifDefined(this.iconLibrary)}
|
|
32
|
+
></sonic-legend>`
|
|
33
|
+
: nothing}
|
|
23
34
|
<slot></slot>
|
|
24
35
|
</fieldset>`;
|
|
25
36
|
}
|
|
@@ -29,7 +40,7 @@ Fieldset.styles = [
|
|
|
29
40
|
:host {
|
|
30
41
|
--sc-fieldset-mt: 0;
|
|
31
42
|
--sc-fieldset-mb: 1rem;
|
|
32
|
-
--sc-fieldset-border-color: var(--sc-
|
|
43
|
+
--sc-fieldset-border-color: var(--sc-border-color);
|
|
33
44
|
--sc-fieldset-border-width: var(--sc-form-border-width);
|
|
34
45
|
|
|
35
46
|
margin-top: var(--sc-fieldset-mt);
|
|
@@ -44,11 +55,24 @@ Fieldset.styles = [
|
|
|
44
55
|
all: unset;
|
|
45
56
|
display: contents;
|
|
46
57
|
}
|
|
47
|
-
|
|
58
|
+
:host([variant="shadow"]),
|
|
59
|
+
:host([variant="ghost"]) {
|
|
60
|
+
--sc-fieldset-border-color: transparent;
|
|
61
|
+
}
|
|
62
|
+
:host([variant="shadow"]) {
|
|
63
|
+
--sc-fieldset-border-color: transparent;
|
|
64
|
+
box-shadow: var(--sc-shadow-lg);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
sonic-legend,
|
|
48
68
|
::slotted(sonic-legend) {
|
|
49
69
|
margin-bottom: 1.5rem;
|
|
50
70
|
display: block;
|
|
51
71
|
}
|
|
72
|
+
|
|
73
|
+
::slotted(sonic-legend:last-child) {
|
|
74
|
+
margin-bottom: 0;
|
|
75
|
+
}
|
|
52
76
|
`,
|
|
53
77
|
];
|
|
54
78
|
__decorate([
|
|
@@ -57,12 +81,25 @@ __decorate([
|
|
|
57
81
|
__decorate([
|
|
58
82
|
property({ type: String })
|
|
59
83
|
], Fieldset.prototype, "form", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
property({ type: String })
|
|
86
|
+
], Fieldset.prototype, "label", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
property({ type: String })
|
|
89
|
+
], Fieldset.prototype, "description", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
property({ type: String })
|
|
92
|
+
], Fieldset.prototype, "iconName", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
property({ type: String })
|
|
95
|
+
], Fieldset.prototype, "iconLibrary", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
property({ type: String })
|
|
98
|
+
], Fieldset.prototype, "iconPrefix", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
property({ type: String, reflect: true })
|
|
101
|
+
], Fieldset.prototype, "variant", void 0);
|
|
60
102
|
Fieldset = __decorate([
|
|
61
103
|
customElement(tagName)
|
|
62
104
|
], Fieldset);
|
|
63
105
|
export { Fieldset };
|
|
64
|
-
//Ajout pour la creation du cem notamment pour Storybook
|
|
65
|
-
try {
|
|
66
|
-
customElements.define(tagName, Fieldset);
|
|
67
|
-
}
|
|
68
|
-
catch (e) { }
|
|
@@ -28,8 +28,3 @@ LegendDescription = __decorate([
|
|
|
28
28
|
customElement("sonic-legend-description")
|
|
29
29
|
], LegendDescription);
|
|
30
30
|
export { LegendDescription };
|
|
31
|
-
//Ajout pour la creation du cem notamment pour Storybook
|
|
32
|
-
try {
|
|
33
|
-
customElements.define("sonic-legend-description", LegendDescription);
|
|
34
|
-
}
|
|
35
|
-
catch (e) { }
|
|
@@ -59,11 +59,12 @@ let Legend = class Legend extends LitElement {
|
|
|
59
59
|
Legend.styles = [
|
|
60
60
|
css `
|
|
61
61
|
:host {
|
|
62
|
-
--sc-legend-font-size: 1.
|
|
62
|
+
--sc-legend-font-size: 1.5rem;
|
|
63
63
|
--sc-legend-font-weight: var(--sc-font-weight-base);
|
|
64
64
|
--sc-legend-font-style: var(--sc-headings-font-style);
|
|
65
65
|
--sc-legend-family: var(--sc-headings-font-family);
|
|
66
66
|
--sc-legend-line-height: var(--sc-headings-line-height);
|
|
67
|
+
--sc-legend-color: var(--sc-base-content);
|
|
67
68
|
display: flex;
|
|
68
69
|
width: 100%;
|
|
69
70
|
}
|
|
@@ -74,6 +75,7 @@ Legend.styles = [
|
|
|
74
75
|
font-style: var(--sc-legend-font-style);
|
|
75
76
|
font-family: var(--sc-legend-font-family);
|
|
76
77
|
line-height: var(--sc-legend-line-height);
|
|
78
|
+
color: var(--sc-legend-color);
|
|
77
79
|
padding: 0;
|
|
78
80
|
display: flex;
|
|
79
81
|
width: 100%;
|
|
@@ -114,8 +116,3 @@ Legend = __decorate([
|
|
|
114
116
|
customElement(tagName)
|
|
115
117
|
], Legend);
|
|
116
118
|
export { Legend };
|
|
117
|
-
//Ajout pour la creation du cem notamment pour Storybook
|
|
118
|
-
try {
|
|
119
|
-
customElements.define(tagName, Legend);
|
|
120
|
-
}
|
|
121
|
-
catch (e) { }
|
|
@@ -5,27 +5,42 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { html, LitElement, css } from "lit";
|
|
8
|
-
import { customElement } from "lit/decorators.js";
|
|
8
|
+
import { customElement, property } from "lit/decorators.js";
|
|
9
|
+
import { styleMap } from "lit/directives/style-map.js";
|
|
9
10
|
const tagName = "sonic-form-actions";
|
|
10
11
|
let FormActions = class FormActions extends LitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.direction = "row";
|
|
15
|
+
this.justify = "flex-start";
|
|
16
|
+
}
|
|
11
17
|
render() {
|
|
12
|
-
|
|
18
|
+
const styles = {
|
|
19
|
+
flexDirection: this.direction,
|
|
20
|
+
justifyContent: this.justify,
|
|
21
|
+
};
|
|
22
|
+
return html `<slot style=${styleMap(styles)}></slot>`;
|
|
13
23
|
}
|
|
14
24
|
};
|
|
15
25
|
FormActions.styles = [
|
|
16
26
|
css `
|
|
17
|
-
:host{
|
|
18
|
-
display:
|
|
19
|
-
|
|
27
|
+
:host {
|
|
28
|
+
display: block;
|
|
29
|
+
}
|
|
30
|
+
slot {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-wrap: wrap;
|
|
33
|
+
gap: 0.3rem;
|
|
20
34
|
}
|
|
21
|
-
|
|
35
|
+
`,
|
|
22
36
|
];
|
|
37
|
+
__decorate([
|
|
38
|
+
property({ type: String })
|
|
39
|
+
], FormActions.prototype, "direction", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
property({ type: String })
|
|
42
|
+
], FormActions.prototype, "justify", void 0);
|
|
23
43
|
FormActions = __decorate([
|
|
24
44
|
customElement(tagName)
|
|
25
45
|
], FormActions);
|
|
26
46
|
export { FormActions };
|
|
27
|
-
//Ajout pour la creation du cem notamment pour Storybook
|
|
28
|
-
try {
|
|
29
|
-
customElements.define(tagName, FormActions);
|
|
30
|
-
}
|
|
31
|
-
catch (e) { }
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { ResizeController } from "@lit-labs/observers/resize_controller.js";
|
|
3
|
-
declare const FormLayout_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
|
|
3
|
+
declare const FormLayout_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<any>) & typeof LitElement;
|
|
4
4
|
export declare class FormLayout extends FormLayout_base {
|
|
5
5
|
static styles: import("lit").CSSResult[];
|
|
6
|
-
_resizeController: ResizeController
|
|
6
|
+
_resizeController: ResizeController<unknown>;
|
|
7
|
+
slottedElements: HTMLElement[];
|
|
8
|
+
oneFormElement: boolean;
|
|
9
|
+
onSlotChange(): void;
|
|
7
10
|
render(): import("lit-html").TemplateResult<1>;
|
|
8
11
|
}
|
|
9
12
|
export {};
|
|
@@ -5,17 +5,32 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { html, LitElement, css } from "lit";
|
|
8
|
-
import { customElement } from "lit/decorators.js";
|
|
8
|
+
import { customElement, property, queryAssignedElements } from "lit/decorators.js";
|
|
9
9
|
import { ResizeController } from "@lit-labs/observers/resize_controller.js";
|
|
10
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
10
11
|
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
11
12
|
const tagName = "sonic-form-layout";
|
|
12
13
|
let FormLayout = class FormLayout extends Subscriber(LitElement) {
|
|
13
14
|
constructor() {
|
|
14
15
|
super(...arguments);
|
|
15
16
|
this._resizeController = new ResizeController(this, {});
|
|
17
|
+
this.oneFormElement = false;
|
|
18
|
+
}
|
|
19
|
+
onSlotChange() {
|
|
20
|
+
let elements = this.slottedElements;
|
|
21
|
+
const formElementColumns = ["sonic-input", "sonic-select", "sonic-input-autocomplete", ".form-item-container"];
|
|
22
|
+
// keep only form elements
|
|
23
|
+
elements = elements.filter((elt) => formElementColumns.includes(elt.nodeName.toLowerCase()));
|
|
24
|
+
this.oneFormElement = elements.length == 1;
|
|
16
25
|
}
|
|
17
26
|
render() {
|
|
18
|
-
|
|
27
|
+
const classes = {
|
|
28
|
+
"cq--md": this.offsetWidth > 440,
|
|
29
|
+
"one-form-element": this.oneFormElement,
|
|
30
|
+
};
|
|
31
|
+
return html `<div class=${classMap(classes)}>
|
|
32
|
+
<slot @slotchange=${this.onSlotChange}></slot>
|
|
33
|
+
</div>`;
|
|
19
34
|
}
|
|
20
35
|
};
|
|
21
36
|
FormLayout.styles = [
|
|
@@ -34,13 +49,19 @@ FormLayout.styles = [
|
|
|
34
49
|
grid-gap: 1.75rem;
|
|
35
50
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
36
51
|
}
|
|
37
|
-
|
|
38
|
-
|
|
52
|
+
.one-form-element {
|
|
53
|
+
grid-template-columns: 1fr;
|
|
54
|
+
}
|
|
55
|
+
/*::slotted(sonic-radio),
|
|
39
56
|
::slotted(sonic-checkbox),
|
|
40
57
|
::slotted(sonic-form-actions),
|
|
41
58
|
::slotted(sonic-divider),
|
|
42
59
|
::slotted(sonic-textarea) {
|
|
43
60
|
grid-column: 1 / -1;
|
|
61
|
+
}*/
|
|
62
|
+
|
|
63
|
+
::slotted(:not(sonic-input):not(sonic-select):not(sonic-input-autocomplete):not(.form-item-container)) {
|
|
64
|
+
grid-column: 1 / -1;
|
|
44
65
|
}
|
|
45
66
|
|
|
46
67
|
::slotted(sonic-divider) {
|
|
@@ -48,12 +69,13 @@ FormLayout.styles = [
|
|
|
48
69
|
}
|
|
49
70
|
`,
|
|
50
71
|
];
|
|
72
|
+
__decorate([
|
|
73
|
+
queryAssignedElements({ flatten: true })
|
|
74
|
+
], FormLayout.prototype, "slottedElements", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
property({ type: Boolean })
|
|
77
|
+
], FormLayout.prototype, "oneFormElement", void 0);
|
|
51
78
|
FormLayout = __decorate([
|
|
52
79
|
customElement(tagName)
|
|
53
80
|
], FormLayout);
|
|
54
81
|
export { FormLayout };
|
|
55
|
-
//Ajout pour la creation du cem notamment pour Storybook
|
|
56
|
-
try {
|
|
57
|
-
customElements.define(tagName, FormLayout);
|
|
58
|
-
}
|
|
59
|
-
catch (e) { }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement } from "lit";
|
|
1
|
+
import { LitElement, PropertyValues } from "lit";
|
|
2
2
|
declare const Input_base: {
|
|
3
3
|
new (...args: any[]): {
|
|
4
4
|
validateFormElement(): void;
|
|
@@ -13,26 +13,20 @@ declare const Input_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
|
-
|
|
27
|
-
|
|
28
|
-
* **FormElement :**
|
|
29
|
-
* * 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é.
|
|
30
|
-
* * Par défault lorsque l'on édite l'input, la valeur est également mise à jour via le même dataprovider
|
|
31
|
-
* * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
|
|
32
|
-
* * 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.
|
|
33
|
-
* **FormInput :**
|
|
34
|
-
* Uniquement des propriétés classiques d'un input HTML.
|
|
35
|
-
*/
|
|
26
|
+
ariaLabelledby?: string | undefined;
|
|
27
|
+
ariaLabel?: string | undefined;
|
|
28
|
+
_value: string | null;
|
|
29
|
+
value: string | null;
|
|
36
30
|
_name: string;
|
|
37
31
|
name: string;
|
|
38
32
|
props: any;
|
|
@@ -60,7 +54,7 @@ declare const Input_base: {
|
|
|
60
54
|
hasAttribute(attributeName: String): boolean;
|
|
61
55
|
disconnectedCallback(): void;
|
|
62
56
|
};
|
|
63
|
-
} & (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;
|
|
64
58
|
export declare class Input extends Input_base {
|
|
65
59
|
static styles: import("lit").CSSResult[];
|
|
66
60
|
/**
|
|
@@ -78,6 +72,7 @@ export declare class Input extends Input_base {
|
|
|
78
72
|
maxlength?: number;
|
|
79
73
|
src?: string;
|
|
80
74
|
inlineContent: boolean;
|
|
75
|
+
disableInlineContentFocus: boolean;
|
|
81
76
|
slotLabelNodes: Array<Node>;
|
|
82
77
|
slotDescriptionNodes: Array<Node>;
|
|
83
78
|
slotSuffixNodes: Array<Node>;
|
|
@@ -87,13 +82,15 @@ export declare class Input extends Input_base {
|
|
|
87
82
|
hasLabel: boolean;
|
|
88
83
|
hasSuffix: boolean;
|
|
89
84
|
hasPrefix: boolean;
|
|
90
|
-
updated(): void;
|
|
91
85
|
sameValueAsHandle?: (v: string) => void;
|
|
92
86
|
sameValueAsName?: string;
|
|
93
87
|
connectedCallback(): void;
|
|
94
88
|
disconnectedCallback(): void;
|
|
95
|
-
|
|
89
|
+
willUpdate(changedProperties: PropertyValues): void;
|
|
90
|
+
hasSlotOrProps(): void;
|
|
96
91
|
inlineContentFocus(): void;
|
|
92
|
+
changeTimeoutId?: ReturnType<typeof setTimeout>;
|
|
93
|
+
handleChange(e?: Event): void;
|
|
97
94
|
render(): import("lit-html").TemplateResult<1>;
|
|
98
95
|
}
|
|
99
96
|
export {};
|
|
@@ -4,11 +4,11 @@ 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, property, queryAssignedNodes, state } from "lit/decorators.js";
|
|
9
9
|
import { query } from "lit/decorators/query.js";
|
|
10
10
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
11
|
-
import { formControl } from "@supersoniks/concorde/core/components/ui/form/css/form-control";
|
|
11
|
+
import { formControl, label, description } from "@supersoniks/concorde/core/components/ui/form/css/form-control";
|
|
12
12
|
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
13
13
|
import FormElement from "@supersoniks/concorde/core/mixins/FormElement";
|
|
14
14
|
import FormInput from "@supersoniks/concorde/core/mixins/FormInput";
|
|
@@ -31,41 +31,59 @@ let Input = class Input extends FormInput(FormElement(Subscriber(LitElement))) {
|
|
|
31
31
|
super(...arguments);
|
|
32
32
|
this.readonly = false;
|
|
33
33
|
this.inlineContent = false;
|
|
34
|
+
this.disableInlineContentFocus = false;
|
|
34
35
|
this.hasDescription = false;
|
|
35
36
|
this.hasLabel = false;
|
|
36
37
|
this.hasSuffix = false;
|
|
37
38
|
this.hasPrefix = false;
|
|
38
39
|
}
|
|
39
|
-
updated() {
|
|
40
|
-
var _a, _b, _c, _d;
|
|
41
|
-
this.hasLabel = this.label || ((_a = this.slotLabelNodes) === null || _a === void 0 ? void 0 : _a.length) ? true : false;
|
|
42
|
-
this.hasDescription = this.description || ((_b = this.slotDescriptionNodes) === null || _b === void 0 ? void 0 : _b.length) ? true : false;
|
|
43
|
-
this.hasSuffix = ((_c = this.slotSuffixNodes) === null || _c === void 0 ? void 0 : _c.length) ? true : false;
|
|
44
|
-
this.hasPrefix = ((_d = this.slotPrefixNodes) === null || _d === void 0 ? void 0 : _d.length) ? true : false;
|
|
45
|
-
}
|
|
46
40
|
connectedCallback() {
|
|
47
41
|
super.connectedCallback();
|
|
42
|
+
this.hasSlotOrProps();
|
|
48
43
|
if (this.hasAttribute("sameValueAs")) {
|
|
49
44
|
this.sameValueAsName = this.getAttribute("sameValueAs");
|
|
50
45
|
this.sameValueAsHandle = (v) => (this.pattern = v);
|
|
51
|
-
this.getFormPublisher()
|
|
46
|
+
let formPublisher = this.getFormPublisher();
|
|
47
|
+
if (!formPublisher)
|
|
48
|
+
return;
|
|
49
|
+
formPublisher[this.sameValueAsName].onAssign(this.sameValueAsHandle);
|
|
52
50
|
}
|
|
53
51
|
}
|
|
54
52
|
disconnectedCallback() {
|
|
55
53
|
super.disconnectedCallback();
|
|
56
54
|
if (this.hasAttribute("sameValueAs") && this.sameValueAsName) {
|
|
57
|
-
this.getFormPublisher()
|
|
55
|
+
let formPublisher = this.getFormPublisher();
|
|
56
|
+
if (!formPublisher)
|
|
57
|
+
return;
|
|
58
|
+
formPublisher[this.sameValueAsName].offAssign(this.sameValueAsHandle);
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
|
-
|
|
61
|
-
this.
|
|
61
|
+
willUpdate(changedProperties) {
|
|
62
|
+
this.hasSlotOrProps();
|
|
63
|
+
super.willUpdate(changedProperties);
|
|
64
|
+
}
|
|
65
|
+
hasSlotOrProps() {
|
|
66
|
+
var _a, _b, _c, _d;
|
|
67
|
+
this.hasLabel = this.label || ((_a = this.slotLabelNodes) === null || _a === void 0 ? void 0 : _a.length) ? true : false;
|
|
68
|
+
this.hasDescription = this.description || ((_b = this.slotDescriptionNodes) === null || _b === void 0 ? void 0 : _b.length) ? true : false;
|
|
69
|
+
this.hasSuffix = ((_c = this.slotSuffixNodes) === null || _c === void 0 ? void 0 : _c.length) ? true : false;
|
|
70
|
+
this.hasPrefix = ((_d = this.slotPrefixNodes) === null || _d === void 0 ? void 0 : _d.length) ? true : false;
|
|
62
71
|
}
|
|
63
72
|
inlineContentFocus() {
|
|
64
73
|
var _a;
|
|
65
|
-
if (!this.inlineContent)
|
|
74
|
+
if (!this.inlineContent || this.disableInlineContentFocus)
|
|
66
75
|
return;
|
|
67
76
|
(_a = this.input) === null || _a === void 0 ? void 0 : _a.focus();
|
|
68
77
|
}
|
|
78
|
+
handleChange(e) {
|
|
79
|
+
if (!this.hasAttribute("inputDelayMs")) {
|
|
80
|
+
super.handleChange(e);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (this.changeTimeoutId)
|
|
84
|
+
clearTimeout(this.changeTimeoutId);
|
|
85
|
+
this.changeTimeoutId = setTimeout(() => super.handleChange(e), parseInt(this.getAttribute("inputDelayMs")));
|
|
86
|
+
}
|
|
69
87
|
render() {
|
|
70
88
|
const slotClasses = {
|
|
71
89
|
"has-prefix": this.hasPrefix,
|
|
@@ -76,48 +94,67 @@ let Input = class Input extends FormInput(FormElement(Subscriber(LitElement))) {
|
|
|
76
94
|
<label for="form-element" class="${this.hasLabel ? "form-label" : "hidden"}"
|
|
77
95
|
>${this.label ? unsafeHTML(this.label /*+ labelStarSuffix*/) : ""}<slot
|
|
78
96
|
name="label"
|
|
79
|
-
@slotchange=${this.
|
|
97
|
+
@slotchange=${this.hasSlotOrProps}
|
|
80
98
|
></slot
|
|
81
99
|
></label>
|
|
82
100
|
|
|
83
101
|
<div @click=${this.inlineContentFocus} class="form-control ${classMap(slotClasses)}">
|
|
84
|
-
<div class="
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
102
|
+
<div class="${this.inlineContent ? "form-element form-element-wrapper" : "contents"}">
|
|
103
|
+
<slot name="prefix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
104
|
+
<input
|
|
105
|
+
id="form-element"
|
|
106
|
+
part="input"
|
|
107
|
+
class="form-element input"
|
|
108
|
+
@input=${this.handleChange}
|
|
109
|
+
@blur=${this.handleBlur}
|
|
110
|
+
type=${this.type}
|
|
111
|
+
disabled=${ifDefined(this.disabled)}
|
|
112
|
+
?readonly=${this.readonly}
|
|
113
|
+
?autofocus=${this.autofocus}
|
|
114
|
+
list=${ifDefined(this.list)}
|
|
115
|
+
tabindex=${ifDefined(this.tabindex)}
|
|
116
|
+
pattern=${ifDefined(this.pattern)}
|
|
117
|
+
min=${ifDefined(this.min)}
|
|
118
|
+
max=${ifDefined(this.max)}
|
|
119
|
+
step=${ifDefined(this.step)}
|
|
120
|
+
src=${ifDefined(this.src)}
|
|
121
|
+
minlength=${ifDefined(this.minlength)}
|
|
122
|
+
maxlength=${ifDefined(this.maxlength)}
|
|
123
|
+
placeholder=${ifDefined(this.placeholder)}
|
|
124
|
+
required=${ifDefined(this.required)}
|
|
125
|
+
autocomplete=${ifDefined(this.autocomplete)}
|
|
126
|
+
aria-label=${ifDefined(this.ariaLabel)}
|
|
127
|
+
aria-labelledby=${ifDefined(this.ariaLabelledby)}
|
|
128
|
+
.name=${this.name}
|
|
129
|
+
.value=${this.value}
|
|
130
|
+
/>
|
|
131
|
+
<slot name="suffix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
132
|
+
</div>
|
|
112
133
|
</div>
|
|
134
|
+
<slot
|
|
135
|
+
name="description"
|
|
136
|
+
@slotchange=${this.hasSlotOrProps}
|
|
137
|
+
class="${this.hasDescription ? "form-description" : "hidden"}"
|
|
138
|
+
>
|
|
139
|
+
${this.description ? html `${unsafeHTML(this.description)}` : ""}
|
|
140
|
+
</slot>
|
|
141
|
+
<slot name="list"></slot>
|
|
113
142
|
</div>
|
|
114
|
-
<slot name="description" class="${this.hasDescription ? "form-description" : "hidden"}">
|
|
115
|
-
${this.description ? html `${unsafeHTML(this.description)}` : ""}
|
|
116
|
-
</slot>
|
|
117
143
|
`;
|
|
118
144
|
}
|
|
119
145
|
};
|
|
120
|
-
Input.styles = [
|
|
146
|
+
Input.styles = [
|
|
147
|
+
fontSize,
|
|
148
|
+
formControl,
|
|
149
|
+
label,
|
|
150
|
+
description,
|
|
151
|
+
css `
|
|
152
|
+
:host([type="hidden"]) {
|
|
153
|
+
appearance: none !important;
|
|
154
|
+
display: none !important;
|
|
155
|
+
}
|
|
156
|
+
`,
|
|
157
|
+
];
|
|
121
158
|
__decorate([
|
|
122
159
|
property({ type: String, reflect: true })
|
|
123
160
|
], Input.prototype, "size", void 0);
|
|
@@ -154,6 +191,9 @@ __decorate([
|
|
|
154
191
|
__decorate([
|
|
155
192
|
property({ type: Boolean, reflect: true })
|
|
156
193
|
], Input.prototype, "inlineContent", void 0);
|
|
194
|
+
__decorate([
|
|
195
|
+
property({ type: Boolean })
|
|
196
|
+
], Input.prototype, "disableInlineContentFocus", void 0);
|
|
157
197
|
__decorate([
|
|
158
198
|
queryAssignedNodes({ slot: "label" })
|
|
159
199
|
], Input.prototype, "slotLabelNodes", void 0);
|
|
@@ -185,8 +225,3 @@ Input = __decorate([
|
|
|
185
225
|
customElement(tagName)
|
|
186
226
|
], Input);
|
|
187
227
|
export { Input };
|
|
188
|
-
//Ajout pour Storybook
|
|
189
|
-
try {
|
|
190
|
-
customElements.define(tagName, Input);
|
|
191
|
-
}
|
|
192
|
-
catch (e) { }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement, nothing } from "lit";
|
|
2
2
|
import "@supersoniks/concorde/core/components/ui/icon/icon";
|
|
3
|
-
declare const SonicComponent_base: (new (...args: any[]) => import("../../../../mixins/Subscriber").SubscriberInterface) & typeof LitElement;
|
|
3
|
+
declare const SonicComponent_base: (new (...args: any[]) => import("../../../../mixins/Subscriber").SubscriberInterface<any>) & typeof LitElement;
|
|
4
4
|
export declare class SonicComponent extends SonicComponent_base {
|
|
5
5
|
name?: string;
|
|
6
6
|
minChars: number;
|
|
@@ -51,11 +51,12 @@ let SonicComponent = class SonicComponent extends Subscriber(LitElement) {
|
|
|
51
51
|
if (this.checkValue && this.name) {
|
|
52
52
|
PublisherManager.get(this.getAncestorAttributeValue("formDataProvider"))[this.name].offAssign(this.checkValue);
|
|
53
53
|
}
|
|
54
|
+
super.disconnectedCallback();
|
|
54
55
|
}
|
|
55
56
|
getIcon(test) {
|
|
56
57
|
return test
|
|
57
|
-
? html `<sonic-icon library="heroicons"
|
|
58
|
-
: html `<sonic-icon library="heroicons"
|
|
58
|
+
? html `<sonic-icon library="heroicons" name="face-smile"></sonic-icon>`
|
|
59
|
+
: html `<sonic-icon library="heroicons" name="x-mark"></sonic-icon>`;
|
|
59
60
|
}
|
|
60
61
|
render() {
|
|
61
62
|
if (this.hasNoChar)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement, nothing } from "lit";
|
|
2
2
|
import "@supersoniks/concorde/core/components/ui/icon/icon";
|
|
3
|
-
declare const SonicComponent_base: (new (...args: any[]) => import("../../../../mixins/Subscriber").SubscriberInterface) & typeof LitElement;
|
|
3
|
+
declare const SonicComponent_base: (new (...args: any[]) => import("../../../../mixins/Subscriber").SubscriberInterface<any>) & typeof LitElement;
|
|
4
4
|
export declare class SonicComponent extends SonicComponent_base {
|
|
5
5
|
name?: string;
|
|
6
6
|
sameValueAs?: string;
|
|
@@ -42,6 +42,7 @@ let SonicComponent = class SonicComponent extends Subscriber(LitElement) {
|
|
|
42
42
|
formDataProvider[this.name].offAssign(this.checkValue);
|
|
43
43
|
formDataProvider[this.sameValueAs].offAssign(this.checkValue);
|
|
44
44
|
}
|
|
45
|
+
super.disconnectedCallback();
|
|
45
46
|
}
|
|
46
47
|
//TODO Multilangue
|
|
47
48
|
render() {
|
|
@@ -3,9 +3,8 @@ import "@supersoniks/concorde/core/components/ui/form/input/input";
|
|
|
3
3
|
import "@supersoniks/concorde/core/components/ui/pop/pop";
|
|
4
4
|
import "@supersoniks/concorde/core/components/functional/queue/queue";
|
|
5
5
|
import "@supersoniks/concorde/core/components/ui/menu/menu-item";
|
|
6
|
-
declare const InputAutocomplete_base: (new (...args: any[]) => import("../../../../mixins/TemplatesContainer").TemplatesContainerInterface) & (new (...args: any[]) => import("../../../../mixins/Subscriber").SubscriberInterface) & typeof LitElement;
|
|
6
|
+
declare const InputAutocomplete_base: (new (...args: any[]) => import("../../../../mixins/TemplatesContainer").TemplatesContainerInterface) & (new (...args: any[]) => import("../../../../mixins/Subscriber").SubscriberInterface<any>) & typeof LitElement;
|
|
7
7
|
/**
|
|
8
|
-
* TODO Améliorer et valider le fonctionnement avec JB et Julien. Puis possiblement merger sur concorde
|
|
9
8
|
* Input avec autocomplete. Propose des valeurs à partir d'un sonic-queue.
|
|
10
9
|
* L'input permet de filtrer les choix de valeurs dans le sonic-pop.
|
|
11
10
|
* La valeur de cet input est ensuite retransmit au premier via un dataProvider.
|
|
@@ -28,8 +27,8 @@ export declare class InputAutocomplete extends InputAutocomplete_base {
|
|
|
28
27
|
dataProviderExpression: string;
|
|
29
28
|
key: string;
|
|
30
29
|
value: string;
|
|
31
|
-
formDataProvider: string;
|
|
32
30
|
connectedCallback(): void;
|
|
31
|
+
formDataProvider: string;
|
|
33
32
|
render(): import("lit-html").TemplateResult<1>;
|
|
34
33
|
}
|
|
35
34
|
export {};
|