@supersoniks/concorde 1.0.7 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -8
- package/cli.js +69 -0
- package/core/components/functional/date/date.d.ts +34 -0
- package/core/components/functional/date/date.js +187 -0
- package/core/components/functional/example/example.d.ts +7 -0
- package/core/components/functional/example/example.js +25 -0
- package/core/components/functional/fetch/fetch.d.ts +49 -0
- package/core/components/functional/fetch/fetch.js +38 -0
- package/core/components/functional/functional.d.ts +11 -0
- package/core/components/functional/functional.js +11 -0
- package/core/components/functional/if/if.d.ts +12 -0
- package/core/components/functional/if/if.js +43 -0
- package/core/components/functional/list/list.d.ts +67 -0
- package/core/components/functional/list/list.js +132 -0
- package/core/components/functional/queue/queue.d.ts +42 -0
- package/core/components/functional/queue/queue.js +184 -0
- package/core/components/functional/router/redirect.d.ts +18 -0
- package/core/components/functional/router/redirect.js +57 -0
- package/core/components/functional/router/router.d.ts +26 -0
- package/core/components/functional/router/router.js +104 -0
- package/core/components/functional/states/states.d.ts +28 -0
- package/core/components/functional/states/states.js +139 -0
- package/core/components/functional/submit/submit.d.ts +24 -0
- package/core/components/functional/submit/submit.js +108 -0
- package/{types/core/components → core/components/functional/subscriber}/subscriber.d.ts +5 -1
- package/core/components/functional/subscriber/subscriber.js +30 -0
- package/core/components/ui/alert/alert.d.ts +20 -0
- package/core/components/ui/alert/alert.js +150 -0
- package/core/components/ui/badge/badge.d.ts +24 -0
- package/core/components/ui/badge/badge.js +177 -0
- package/core/components/ui/button/button.d.ts +125 -0
- package/core/components/ui/button/button.js +558 -0
- package/core/components/ui/divider/divider.d.ts +11 -0
- package/core/components/ui/divider/divider.js +144 -0
- package/core/components/ui/form/checkbox/checkbox.d.ts +120 -0
- package/core/components/ui/form/checkbox/checkbox.js +203 -0
- package/core/components/ui/form/css/form-control.d.ts +1 -0
- package/core/components/ui/form/css/form-control.js +219 -0
- package/core/components/ui/form/fieldset/fieldset.d.ts +15 -0
- package/core/components/ui/form/fieldset/fieldset.js +70 -0
- package/core/components/ui/form/fieldset/legend.d.ts +11 -0
- package/core/components/ui/form/fieldset/legend.js +92 -0
- package/core/components/ui/form/form-layout/form-actions.d.ts +6 -0
- package/core/components/ui/form/form-layout/form-actions.js +23 -0
- package/core/components/ui/form/form-layout/form-layout.d.ts +9 -0
- package/core/components/ui/form/form-layout/form-layout.js +58 -0
- package/core/components/ui/form/input/input.d.ts +84 -0
- package/core/components/ui/form/input/input.js +180 -0
- package/core/components/ui/form/radio/radio.d.ts +12 -0
- package/core/components/ui/form/radio/radio.js +55 -0
- package/core/components/ui/form/select/select.d.ts +39 -0
- package/core/components/ui/form/select/select.js +220 -0
- package/core/components/ui/form/textarea/textarea.d.ts +69 -0
- package/core/components/ui/form/textarea/textarea.js +150 -0
- package/core/components/ui/group/group.d.ts +6 -0
- package/core/components/ui/group/group.js +57 -0
- package/core/components/ui/icon/icon.d.ts +17 -0
- package/core/components/ui/icon/icon.js +93 -0
- package/core/components/ui/icon/icons.d.ts +13 -0
- package/core/components/ui/icon/icons.js +25 -0
- package/core/components/ui/icon/icons.json +1 -0
- package/core/components/ui/image/image.d.ts +14 -0
- package/core/components/ui/image/image.js +152 -0
- package/core/components/ui/link/link.d.ts +16 -0
- package/core/components/ui/link/link.js +70 -0
- package/core/components/ui/loader/loader.d.ts +20 -0
- package/core/components/ui/loader/loader.js +94 -0
- package/{types → core}/components/ui/loader/styles/fixed.d.ts +0 -0
- package/core/components/ui/loader/styles/fixed.js +57 -0
- package/{types → core}/components/ui/loader/styles/inline.d.ts +0 -0
- package/core/components/ui/loader/styles/inline.js +71 -0
- package/core/components/ui/menu/menu-item.d.ts +5 -0
- package/core/components/ui/menu/menu-item.js +37 -0
- package/core/components/ui/menu/menu.d.ts +26 -0
- package/core/components/ui/menu/menu.js +125 -0
- package/core/components/ui/modal/modal-actions.d.ts +7 -0
- package/core/components/ui/modal/modal-actions.js +46 -0
- package/core/components/ui/modal/modal-close.d.ts +6 -0
- package/core/components/ui/modal/modal-close.js +38 -0
- package/core/components/ui/modal/modal-content.d.ts +5 -0
- package/core/components/ui/modal/modal-content.js +29 -0
- package/core/components/ui/modal/modal-subtitle.d.ts +5 -0
- package/core/components/ui/modal/modal-subtitle.js +33 -0
- package/core/components/ui/modal/modal-title.d.ts +5 -0
- package/core/components/ui/modal/modal-title.js +33 -0
- package/core/components/ui/modal/modal.d.ts +36 -0
- package/core/components/ui/modal/modal.js +325 -0
- package/core/components/ui/pop/pop.d.ts +28 -0
- package/core/components/ui/pop/pop.js +223 -0
- package/core/components/ui/tabs/tab.d.ts +6 -0
- package/core/components/ui/tabs/tab.js +46 -0
- package/core/components/ui/tabs/tabs.d.ts +14 -0
- package/core/components/ui/tabs/tabs.js +127 -0
- package/core/components/ui/taxonomy/taxonomy.d.ts +41 -0
- package/core/components/ui/taxonomy/taxonomy.js +113 -0
- package/core/components/ui/theme/css/tailwind.css +3 -0
- package/core/components/ui/theme/css/tailwind.d.ts +2 -0
- package/core/components/ui/theme/theme-collection/core-variables.d.ts +1 -0
- package/core/components/ui/theme/theme-collection/core-variables.js +50 -0
- package/{types/components → core/components/ui}/theme/theme-collection/dark.d.ts +0 -0
- package/core/components/ui/theme/theme-collection/dark.js +41 -0
- package/{types/components → core/components/ui}/theme/theme-collection/light.d.ts +0 -0
- package/core/components/ui/theme/theme-collection/light.js +35 -0
- package/core/components/ui/theme/theme.d.ts +11 -0
- package/core/components/ui/theme/theme.js +105 -0
- package/core/components/ui/toast/message-subscriber.d.ts +17 -0
- package/core/components/ui/toast/message-subscriber.js +85 -0
- package/{types → core}/components/ui/toast/toast.d.ts +10 -8
- package/core/components/ui/toast/toast.js +260 -0
- package/core/components/ui/tooltip/tooltip.d.ts +7 -0
- package/core/components/ui/tooltip/tooltip.js +68 -0
- package/core/components/ui/ui.d.ts +27 -0
- package/core/components/ui/ui.js +34 -0
- package/core/core.d.ts +3 -0
- package/core/core.js +7 -0
- package/core/mixins/Fetcher.d.ts +69 -0
- package/core/mixins/Fetcher.js +147 -0
- package/core/mixins/FormCheckable.d.ts +72 -0
- package/core/mixins/FormCheckable.js +144 -0
- package/core/mixins/FormElement.d.ts +21 -0
- package/core/mixins/FormElement.js +229 -0
- package/core/mixins/FormInput.d.ts +49 -0
- package/core/mixins/FormInput.js +33 -0
- package/core/mixins/Subscriber.d.ts +30 -0
- package/core/mixins/Subscriber.js +379 -0
- package/core/mixins/TemplatesContainer.d.ts +12 -0
- package/core/mixins/TemplatesContainer.js +60 -0
- package/core/mixins/mixins.d.ts +6 -0
- package/core/mixins/mixins.js +6 -0
- package/core/utils/Arrays.d.ts +97 -0
- package/core/utils/Arrays.js +136 -0
- package/core/utils/DataBindObserver.d.ts +74 -0
- package/core/utils/DataBindObserver.js +252 -0
- package/core/utils/Format.d.ts +11 -0
- package/core/utils/Format.js +22 -0
- package/core/utils/HTML.d.ts +13 -0
- package/core/utils/HTML.js +26 -0
- package/core/utils/LocationHandler.d.ts +44 -0
- package/core/utils/LocationHandler.js +96 -0
- package/core/utils/Objects.d.ts +23 -0
- package/core/utils/Objects.js +63 -0
- package/core/utils/PublisherProxy.d.mts +110 -0
- package/core/utils/PublisherProxy.mjs +371 -0
- package/core/utils/api.d.ts +66 -0
- package/core/utils/api.js +145 -0
- package/package.json +159 -21
- package/LICENSE +0 -43
- package/dist/concorde.bundle.js +0 -3620
- package/types/components/event/event-card/event-card.d.ts +0 -10
- package/types/components/event/event-title/event-title.d.ts +0 -7
- package/types/components/event/event.d.ts +0 -8
- package/types/components/giftcards/giftcard/giftcard.d.ts +0 -15
- package/types/components/illustration/illustration.d.ts +0 -16
- package/types/components/product/prices-form/price-button/price-button.d.ts +0 -25
- package/types/components/product/prices-form/prices-form.d.ts +0 -23
- package/types/components/theme/theme-collection/bootstrap5.d.ts +0 -1
- package/types/components/theme/theme-collection/dracula.d.ts +0 -1
- package/types/components/theme/theme.d.ts +0 -8
- package/types/components/ui/button/button.d.ts +0 -13
- package/types/components/ui/loader/loader.d.ts +0 -15
- package/types/components/ui/modal/modal.d.ts +0 -17
- package/types/components/ui/tooltip/tooltip.d.ts +0 -9
- package/types/core/components/fetch.d.ts +0 -6
- package/types/core/components/list.d.ts +0 -9
- package/types/core/components/queue.d.ts +0 -15
- package/types/core/components/taxonomy.d.ts +0 -13
- package/types/core/components/text-formatted.d.ts +0 -15
- package/types/core/components/text.d.ts +0 -9
- package/types/core/core.d.ts +0 -7
- package/types/core/mixins/Fetcher.d.ts +0 -9
- package/types/core/mixins/Subscriber.d.ts +0 -13
- package/types/core/utils/api.d.ts +0 -16
- package/types/index.d.ts +0 -12
- package/types/styles/button/button.d.ts +0 -1
- package/types/styles/prose/prose.d.ts +0 -2
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, LitElement, css } from "lit";
|
|
8
|
+
import { customElement, property } from "lit/decorators.js";
|
|
9
|
+
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
10
|
+
let Legend = class Legend extends Subscriber(LitElement) {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.iconName = "check";
|
|
14
|
+
this.iconPrefix = "";
|
|
15
|
+
this.description = "";
|
|
16
|
+
this.label = "";
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
return html `<legend part="legend">
|
|
20
|
+
<div class="legend-content">
|
|
21
|
+
${this.label}<slot></slot>
|
|
22
|
+
<slot name="description" class="description"> ${this.description ? html `${this.description}` : ""}</slot>
|
|
23
|
+
</div>
|
|
24
|
+
<slot name="suffix"></slot>
|
|
25
|
+
</legend>`;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
Legend.styles = [
|
|
29
|
+
css `
|
|
30
|
+
:host {
|
|
31
|
+
--sc-legend-font-size: 1.875rem;
|
|
32
|
+
--sc-legend-font-weight: var(--sc-headings-font-weight);
|
|
33
|
+
--sc-legend-font-style: var(--sc-headings-font-style);
|
|
34
|
+
--sc-legend-family: var(--sc-headings-font-family);
|
|
35
|
+
--sc-legend-line-height: var(--sc-headings-line-height);
|
|
36
|
+
display: flex;
|
|
37
|
+
width: 100%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
legend {
|
|
41
|
+
font-size: var(--sc-legend-font-size);
|
|
42
|
+
font-weight: var(--sc-legend-font-weight);
|
|
43
|
+
font-style: var(--sc-legend-font-style);
|
|
44
|
+
font-family: var(--sc-legend-font-family);
|
|
45
|
+
line-height: var(--sc-legend-line-height);
|
|
46
|
+
padding: 0;
|
|
47
|
+
display: flex;
|
|
48
|
+
width: 100%;
|
|
49
|
+
align-items: center;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
slot[name="suffix"]:not(:empty) {
|
|
53
|
+
display: block;
|
|
54
|
+
margin-left: auto;
|
|
55
|
+
flex-shrink: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.description {
|
|
59
|
+
color: var(--sc-neutral-500);
|
|
60
|
+
font-size: 1.25rem;
|
|
61
|
+
line-height: 1.2;
|
|
62
|
+
display: block;
|
|
63
|
+
font-weight: normal;
|
|
64
|
+
font-style: normal;
|
|
65
|
+
margin-top: 0.25eem;
|
|
66
|
+
}
|
|
67
|
+
.legend-content {
|
|
68
|
+
flex-grow: 1;
|
|
69
|
+
}
|
|
70
|
+
`,
|
|
71
|
+
];
|
|
72
|
+
__decorate([
|
|
73
|
+
property({ type: String })
|
|
74
|
+
], Legend.prototype, "iconName", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
property({ type: String })
|
|
77
|
+
], Legend.prototype, "iconPrefix", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
property({ type: String })
|
|
80
|
+
], Legend.prototype, "description", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
property({ type: String })
|
|
83
|
+
], Legend.prototype, "label", void 0);
|
|
84
|
+
Legend = __decorate([
|
|
85
|
+
customElement("sonic-legend")
|
|
86
|
+
], Legend);
|
|
87
|
+
export { Legend };
|
|
88
|
+
//Ajout pour la creation du cem notamment pour Storybook
|
|
89
|
+
try {
|
|
90
|
+
customElements.define("sonic-legend", Legend);
|
|
91
|
+
}
|
|
92
|
+
catch (e) { }
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
declare const FormActions_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
|
|
3
|
+
export declare class FormActions extends FormActions_base {
|
|
4
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
5
|
+
}
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, LitElement } from "lit";
|
|
8
|
+
import { customElement } from "lit/decorators.js";
|
|
9
|
+
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
10
|
+
let FormActions = class FormActions extends Subscriber(LitElement) {
|
|
11
|
+
render() {
|
|
12
|
+
return html `<slot></slot>`;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
FormActions = __decorate([
|
|
16
|
+
customElement("sonic-form-actions")
|
|
17
|
+
], FormActions);
|
|
18
|
+
export { FormActions };
|
|
19
|
+
//Ajout pour la creation du cem notamment pour Storybook
|
|
20
|
+
try {
|
|
21
|
+
customElements.define("sonic-form-actions", FormActions);
|
|
22
|
+
}
|
|
23
|
+
catch (e) { }
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
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;
|
|
4
|
+
export declare class FormLayout extends FormLayout_base {
|
|
5
|
+
static styles: import("lit").CSSResult[];
|
|
6
|
+
_resizeController: ResizeController;
|
|
7
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
8
|
+
}
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, LitElement, css } from "lit";
|
|
8
|
+
import { customElement } from "lit/decorators.js";
|
|
9
|
+
import { ResizeController } from "@lit-labs/observers/resize_controller.js";
|
|
10
|
+
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
11
|
+
let FormLayout = class FormLayout extends Subscriber(LitElement) {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this._resizeController = new ResizeController(this, {});
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
return html `<div class=${this.offsetWidth > 440 ? "cq--md" : ""}><slot></slot></div>`;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
FormLayout.styles = [
|
|
21
|
+
css `
|
|
22
|
+
:host {
|
|
23
|
+
display: block;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
div {
|
|
27
|
+
display: grid;
|
|
28
|
+
grid-gap: 1.5rem;
|
|
29
|
+
align-items: flex-start;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.cq--md {
|
|
33
|
+
grid-gap: 1.75rem;
|
|
34
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
::slotted(sonic-radio),
|
|
38
|
+
::slotted(sonic-checkbox),
|
|
39
|
+
::slotted(sonic-form-actions),
|
|
40
|
+
::slotted(sonic-divider),
|
|
41
|
+
::slotted(sonic-textarea) {
|
|
42
|
+
grid-column: 1 / -1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
::slotted(sonic-divider) {
|
|
46
|
+
--sc-divider-my: 0;
|
|
47
|
+
}
|
|
48
|
+
`,
|
|
49
|
+
];
|
|
50
|
+
FormLayout = __decorate([
|
|
51
|
+
customElement("sonic-form-layout")
|
|
52
|
+
], FormLayout);
|
|
53
|
+
export { FormLayout };
|
|
54
|
+
//Ajout pour la creation du cem notamment pour Storybook
|
|
55
|
+
try {
|
|
56
|
+
customElements.define("sonic-form-layout", FormLayout);
|
|
57
|
+
}
|
|
58
|
+
catch (e) { }
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
declare const Input_base: {
|
|
3
|
+
new (...args: any[]): {
|
|
4
|
+
type: "number" | "search" | "file" | "button" | "password" | "url" | "color" | "hidden" | "time" | "image" | "text" | "reset" | "submit" | "month" | "week" | "checkbox" | "radio" | "range" | "tel" | "email" | "date" | "datetime-local";
|
|
5
|
+
tabindex: string | null;
|
|
6
|
+
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" | null;
|
|
7
|
+
getFormPublisher(): any;
|
|
8
|
+
updateDataValue(): void;
|
|
9
|
+
handleChange(e?: any): void;
|
|
10
|
+
getValueForFormPublisher(): any;
|
|
11
|
+
error: true | null;
|
|
12
|
+
autofocus: true | null;
|
|
13
|
+
disabled: true | null;
|
|
14
|
+
required: true | null;
|
|
15
|
+
formDataProvider: string;
|
|
16
|
+
_value: any;
|
|
17
|
+
value: any;
|
|
18
|
+
_name: string;
|
|
19
|
+
name: string;
|
|
20
|
+
props: any;
|
|
21
|
+
getAncestorAttributeValue(attributeName: string): string;
|
|
22
|
+
hasAncestorAttribute(attributeName: string): boolean;
|
|
23
|
+
querySelectorAll(selector: string): NodeListOf<Element>;
|
|
24
|
+
publisher: any;
|
|
25
|
+
dataProvider: String;
|
|
26
|
+
noShadowDom: string | null;
|
|
27
|
+
debug: HTMLElement | null;
|
|
28
|
+
defferedDebug: boolean | null;
|
|
29
|
+
makeShadow(props: Record<string, any>, value: any): any;
|
|
30
|
+
dispatchEvent(event: Event): void;
|
|
31
|
+
setAttribute(name: string, value: string): void;
|
|
32
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
33
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
|
|
34
|
+
removeAttribute(name: string): void;
|
|
35
|
+
initPublisher(): void;
|
|
36
|
+
getApiConfiguration(): import("../../../../utils/api").APIConfiguration;
|
|
37
|
+
connectedCallback(): void;
|
|
38
|
+
requestUpdate(): void;
|
|
39
|
+
getAttribute(name: string): string;
|
|
40
|
+
hasAttribute(attributeName: String): boolean;
|
|
41
|
+
disconnectedCallback(): void;
|
|
42
|
+
};
|
|
43
|
+
} & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
|
|
44
|
+
/**
|
|
45
|
+
* ### Le composent sonic-input étend les mixins FormInput, FormElement et Subscriber
|
|
46
|
+
* **FormElement :**
|
|
47
|
+
* * 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é.
|
|
48
|
+
* * Par défault lorsque l'on édite l'input, la valeur est également mise à jour via le même dataprovider
|
|
49
|
+
* * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
|
|
50
|
+
* * 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.
|
|
51
|
+
* **FormInput :**
|
|
52
|
+
* Uniquement des propriétés classiques d'un input HTML.
|
|
53
|
+
*/
|
|
54
|
+
export declare class Input extends Input_base {
|
|
55
|
+
static styles: import("lit").CSSResult[];
|
|
56
|
+
/**
|
|
57
|
+
* Taille du composant, implique notamment des modifications de typo et de marge interne
|
|
58
|
+
*/
|
|
59
|
+
size: "" | "xs" | "sm" | "lg";
|
|
60
|
+
list: "" | null;
|
|
61
|
+
placeholder: string;
|
|
62
|
+
readonly: boolean | null;
|
|
63
|
+
pattern: string | null;
|
|
64
|
+
min: string | null;
|
|
65
|
+
max: string | null;
|
|
66
|
+
step: string | null;
|
|
67
|
+
minlength: string | null;
|
|
68
|
+
maxlength: string | null;
|
|
69
|
+
label: string;
|
|
70
|
+
description: string;
|
|
71
|
+
inlineContent: boolean;
|
|
72
|
+
slotLabelNodes: Array<Node>;
|
|
73
|
+
slotDescriptionNodes: Array<Node>;
|
|
74
|
+
slotSuffixNodes: Array<Node>;
|
|
75
|
+
slotPrefixNodes: Array<Node>;
|
|
76
|
+
hasDescription: true | false;
|
|
77
|
+
hasLabel: true | false;
|
|
78
|
+
hasSuffix: true | false;
|
|
79
|
+
hasPrefix: true | false;
|
|
80
|
+
updated(): void;
|
|
81
|
+
onSlotChange(): void;
|
|
82
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
83
|
+
}
|
|
84
|
+
export {};
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, LitElement } from "lit";
|
|
8
|
+
import { customElement, property, queryAssignedNodes, state } from "lit/decorators.js";
|
|
9
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
10
|
+
import { formControl } from "../css/form-control";
|
|
11
|
+
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
12
|
+
import FormElement from "@supersoniks/concorde/core/mixins/FormElement";
|
|
13
|
+
import FormInput from "@supersoniks/concorde/core/mixins/FormInput";
|
|
14
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
15
|
+
/**
|
|
16
|
+
* ### Le composent sonic-input étend les mixins FormInput, FormElement et Subscriber
|
|
17
|
+
* **FormElement :**
|
|
18
|
+
* * 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é.
|
|
19
|
+
* * Par défault lorsque l'on édite l'input, la valeur est également mise à jour via le même dataprovider
|
|
20
|
+
* * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
|
|
21
|
+
* * 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.
|
|
22
|
+
* **FormInput :**
|
|
23
|
+
* Uniquement des propriétés classiques d'un input HTML.
|
|
24
|
+
*/
|
|
25
|
+
let Input = class Input extends FormInput(FormElement(Subscriber(LitElement))) {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
/**
|
|
29
|
+
* Taille du composant, implique notamment des modifications de typo et de marge interne
|
|
30
|
+
*/
|
|
31
|
+
this.size = "";
|
|
32
|
+
this.list = null;
|
|
33
|
+
this.placeholder = "";
|
|
34
|
+
this.readonly = null;
|
|
35
|
+
this.pattern = null;
|
|
36
|
+
this.min = null;
|
|
37
|
+
this.max = null;
|
|
38
|
+
this.step = null;
|
|
39
|
+
this.minlength = null;
|
|
40
|
+
this.maxlength = null;
|
|
41
|
+
/*
|
|
42
|
+
* TODO
|
|
43
|
+
* Mutualiser avec le composant select
|
|
44
|
+
*/
|
|
45
|
+
this.label = "";
|
|
46
|
+
this.description = "";
|
|
47
|
+
this.inlineContent = false;
|
|
48
|
+
this.hasDescription = false;
|
|
49
|
+
this.hasLabel = false;
|
|
50
|
+
this.hasSuffix = false;
|
|
51
|
+
this.hasPrefix = false;
|
|
52
|
+
}
|
|
53
|
+
updated() {
|
|
54
|
+
var _a, _b, _c, _d;
|
|
55
|
+
this.hasLabel = this.label || ((_a = this.slotLabelNodes) === null || _a === void 0 ? void 0 : _a.length) ? true : false;
|
|
56
|
+
this.hasDescription = this.description || ((_b = this.slotDescriptionNodes) === null || _b === void 0 ? void 0 : _b.length) ? true : false;
|
|
57
|
+
this.hasSuffix = ((_c = this.slotSuffixNodes) === null || _c === void 0 ? void 0 : _c.length) ? true : false;
|
|
58
|
+
this.hasPrefix = ((_d = this.slotPrefixNodes) === null || _d === void 0 ? void 0 : _d.length) ? true : false;
|
|
59
|
+
}
|
|
60
|
+
onSlotChange() {
|
|
61
|
+
this.requestUpdate();
|
|
62
|
+
}
|
|
63
|
+
render() {
|
|
64
|
+
const slotClasses = {
|
|
65
|
+
"has-prefix": this.hasPrefix,
|
|
66
|
+
"has-suffix": this.hasSuffix,
|
|
67
|
+
};
|
|
68
|
+
return html `
|
|
69
|
+
<label for="form-element" class="${this.hasLabel ? "form-label" : "hidden"}"
|
|
70
|
+
>${this.label ? this.label : ""}<slot name="label" @slotchange=${this.onSlotChange}></slot
|
|
71
|
+
></label>
|
|
72
|
+
|
|
73
|
+
<div class="form-control ${classMap(slotClasses)}">
|
|
74
|
+
<div class=" ${this.inlineContent ? "form-element form-element-wrapper" : "contents"}">
|
|
75
|
+
<slot name="prefix" @slotchange=${this.onSlotChange}></slot>
|
|
76
|
+
<input
|
|
77
|
+
id="form-element"
|
|
78
|
+
part="input"
|
|
79
|
+
class="form-element input"
|
|
80
|
+
type=${this.type}
|
|
81
|
+
@input=${this.handleChange}
|
|
82
|
+
disabled="${ifDefined(this.disabled)}"
|
|
83
|
+
list=${ifDefined(this.list)}
|
|
84
|
+
readonly=${ifDefined(this.readonly)}
|
|
85
|
+
autofocus=${ifDefined(this.autofocus)}
|
|
86
|
+
required=${ifDefined(this.required)}
|
|
87
|
+
tabindex=${ifDefined(this.tabindex)}
|
|
88
|
+
pattern=${ifDefined(this.pattern)}
|
|
89
|
+
min=${ifDefined(this.min)}
|
|
90
|
+
max=${ifDefined(this.max)}
|
|
91
|
+
step=${ifDefined(this.step)}
|
|
92
|
+
minlength=${ifDefined(this.minlength)}
|
|
93
|
+
maxlength=${ifDefined(this.maxlength)}
|
|
94
|
+
placeholder="${this.placeholder}"
|
|
95
|
+
.name=${this.name}
|
|
96
|
+
.value=${this.value}
|
|
97
|
+
autocomplete=${ifDefined(this.autocomplete)}
|
|
98
|
+
/>
|
|
99
|
+
<slot name="suffix" @slotchange=${this.onSlotChange}></slot>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
<slot name="description" class=" ${this.hasDescription ? "form-description" : "hidden"}">
|
|
103
|
+
${this.description ? html `${this.description}` : ""}
|
|
104
|
+
</slot>
|
|
105
|
+
`;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
Input.styles = [formControl];
|
|
109
|
+
__decorate([
|
|
110
|
+
property({ type: String })
|
|
111
|
+
], Input.prototype, "size", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
property({ type: String })
|
|
114
|
+
], Input.prototype, "list", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
property({ type: String })
|
|
117
|
+
], Input.prototype, "placeholder", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
property({ type: Boolean })
|
|
120
|
+
], Input.prototype, "readonly", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
property({ type: String })
|
|
123
|
+
], Input.prototype, "pattern", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
property({ type: String })
|
|
126
|
+
], Input.prototype, "min", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
property({ type: String })
|
|
129
|
+
], Input.prototype, "max", void 0);
|
|
130
|
+
__decorate([
|
|
131
|
+
property({ type: String })
|
|
132
|
+
], Input.prototype, "step", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
property({ type: String })
|
|
135
|
+
], Input.prototype, "minlength", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
property({ type: String })
|
|
138
|
+
], Input.prototype, "maxlength", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
property({ type: String })
|
|
141
|
+
], Input.prototype, "label", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
property({ type: String })
|
|
144
|
+
], Input.prototype, "description", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
property({ type: Boolean, reflect: true })
|
|
147
|
+
], Input.prototype, "inlineContent", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
queryAssignedNodes({ slot: "label" })
|
|
150
|
+
], Input.prototype, "slotLabelNodes", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
queryAssignedNodes({ slot: "description" })
|
|
153
|
+
], Input.prototype, "slotDescriptionNodes", void 0);
|
|
154
|
+
__decorate([
|
|
155
|
+
queryAssignedNodes({ slot: "suffix" })
|
|
156
|
+
], Input.prototype, "slotSuffixNodes", void 0);
|
|
157
|
+
__decorate([
|
|
158
|
+
queryAssignedNodes({ slot: "prefix" })
|
|
159
|
+
], Input.prototype, "slotPrefixNodes", void 0);
|
|
160
|
+
__decorate([
|
|
161
|
+
state()
|
|
162
|
+
], Input.prototype, "hasDescription", void 0);
|
|
163
|
+
__decorate([
|
|
164
|
+
state()
|
|
165
|
+
], Input.prototype, "hasLabel", void 0);
|
|
166
|
+
__decorate([
|
|
167
|
+
state()
|
|
168
|
+
], Input.prototype, "hasSuffix", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
state()
|
|
171
|
+
], Input.prototype, "hasPrefix", void 0);
|
|
172
|
+
Input = __decorate([
|
|
173
|
+
customElement("sonic-input")
|
|
174
|
+
], Input);
|
|
175
|
+
export { Input };
|
|
176
|
+
//Ajout pour Storybook
|
|
177
|
+
try {
|
|
178
|
+
customElements.define("sonic-input", Input);
|
|
179
|
+
}
|
|
180
|
+
catch (e) { }
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Checkbox } from "../checkbox/checkbox";
|
|
2
|
+
/**
|
|
3
|
+
* ### Le composant sonic-radio étend sonic-checkbox en assignant sa propriété radio à true.
|
|
4
|
+
*
|
|
5
|
+
* * Le type d'input html utilisé passe également de checkbox à radio.
|
|
6
|
+
* * Le comportement est donc similaire à un bouton radio classique mais avec les fonctionnalités de sonic-checkbox (ie : Subscriber / FormElement / FormCheckable).
|
|
7
|
+
*/
|
|
8
|
+
export declare class Radio extends Checkbox {
|
|
9
|
+
static styles: (import("lit").CSSResult | import("lit").CSSResultGroup[])[];
|
|
10
|
+
constructor();
|
|
11
|
+
connectedCallback(): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { css } from "lit";
|
|
8
|
+
import { customElement } from "lit/decorators.js";
|
|
9
|
+
import { Checkbox } from "../checkbox/checkbox";
|
|
10
|
+
/**
|
|
11
|
+
* ### Le composant sonic-radio étend sonic-checkbox en assignant sa propriété radio à true.
|
|
12
|
+
*
|
|
13
|
+
* * Le type d'input html utilisé passe également de checkbox à radio.
|
|
14
|
+
* * Le comportement est donc similaire à un bouton radio classique mais avec les fonctionnalités de sonic-checkbox (ie : Subscriber / FormElement / FormCheckable).
|
|
15
|
+
*/
|
|
16
|
+
let Radio = class Radio extends Checkbox {
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
}
|
|
20
|
+
connectedCallback() {
|
|
21
|
+
this.radio = true;
|
|
22
|
+
// this.iconName = "circle-small";
|
|
23
|
+
// this.iconPrefix = "solid";
|
|
24
|
+
super.connectedCallback();
|
|
25
|
+
this.type = "radio";
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
Radio.styles = [
|
|
29
|
+
Checkbox.styles,
|
|
30
|
+
css `
|
|
31
|
+
:host input {
|
|
32
|
+
border-radius: 50%;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host sonic-icon {
|
|
36
|
+
border-radius: 50%;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
background-color:var(--sc-primary-content);
|
|
39
|
+
line-height:0;
|
|
40
|
+
display:block;
|
|
41
|
+
font-size:0;
|
|
42
|
+
height:10px;
|
|
43
|
+
width:10px;
|
|
44
|
+
}
|
|
45
|
+
`,
|
|
46
|
+
];
|
|
47
|
+
Radio = __decorate([
|
|
48
|
+
customElement("sonic-radio")
|
|
49
|
+
], Radio);
|
|
50
|
+
export { Radio };
|
|
51
|
+
//Ajout pour Storybook
|
|
52
|
+
try {
|
|
53
|
+
customElements.define("sonic-radio", Radio);
|
|
54
|
+
}
|
|
55
|
+
catch (e) { }
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import "@supersoniks/concorde/core/components/ui/icon/icon";
|
|
3
|
+
declare const Select_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
|
|
4
|
+
/**
|
|
5
|
+
* #### FormElement :
|
|
6
|
+
* * La propriété value est remplie automatiquement a l'aide de l'attribut name renseigné, ceci en prenant la valeur de la propriété du même nom dans les données du dataprovider associé.
|
|
7
|
+
* * Par défault lorsque l'on édite l'input, la valeur est également mise à jour via le même dataprovider
|
|
8
|
+
* * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
|
|
9
|
+
* * Par conséquent on peut par exemple le lier à un composant *queue* (via sa propriété *dataFilterProvider*) de manière à appeller en auto une api avec des filtres.
|
|
10
|
+
*/
|
|
11
|
+
export declare class Select extends Select_base {
|
|
12
|
+
static styles: import("lit").CSSResult[];
|
|
13
|
+
valueKey: string;
|
|
14
|
+
wordingKey: string;
|
|
15
|
+
multiple: null;
|
|
16
|
+
size: "" | "xs" | "sm" | "lg";
|
|
17
|
+
selectSize: string | null;
|
|
18
|
+
private _options;
|
|
19
|
+
set options(value: Array<any>);
|
|
20
|
+
get options(): Array<any>;
|
|
21
|
+
_value: string;
|
|
22
|
+
get value(): string;
|
|
23
|
+
set value(value: string);
|
|
24
|
+
connectedCallback(): void;
|
|
25
|
+
label: string;
|
|
26
|
+
description: string;
|
|
27
|
+
slotLabelNodes: Array<Node>;
|
|
28
|
+
slotDescriptionNodes: Array<Node>;
|
|
29
|
+
slotSuffixNodes: Array<Node>;
|
|
30
|
+
slotPrefixNodes: Array<Node>;
|
|
31
|
+
hasDescription: true | false;
|
|
32
|
+
hasLabel: true | false;
|
|
33
|
+
hasSuffix: true | false;
|
|
34
|
+
hasPrefix: true | false;
|
|
35
|
+
updated(): void;
|
|
36
|
+
onSlotChange(): void;
|
|
37
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
38
|
+
}
|
|
39
|
+
export {};
|