@supersoniks/concorde 1.1.48 → 2.0.0
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 +0 -0
- package/cli.js +0 -0
- package/concorde-core.bundle.js +3288 -36
- package/concorde-core.es.js +13152 -9425
- package/core/components/functional/fetch/fetch.d.ts +2 -0
- package/core/components/functional/if/if.test.js +12 -21
- package/core/components/functional/list/list.d.ts +4 -0
- package/core/components/functional/list/list.js +24 -11
- package/core/components/functional/queue/queue.js +38 -70
- package/core/components/functional/router/router.js +1 -2
- package/core/components/functional/sdui/SDUIDescriptorTransformer.js +28 -43
- package/core/components/functional/sdui/sdui.d.ts +2 -0
- package/core/components/functional/sdui/sdui.js +24 -40
- package/core/components/functional/sonic-scope/sonic-scope.d.ts +1 -1
- package/core/components/functional/states/states.js +2 -4
- package/core/components/functional/submit/submit.js +106 -121
- package/core/components/ui/button/button.d.ts +2 -2
- package/core/components/ui/button/button.js +24 -41
- package/core/components/ui/captcha/captcha.js +3 -5
- package/core/components/ui/divider/divider.d.ts +1 -1
- package/core/components/ui/divider/divider.js +6 -6
- package/core/components/ui/form/checkbox/checkbox.d.ts +3 -23
- package/core/components/ui/form/checkbox/checkbox.js +7 -12
- package/core/components/ui/form/form-layout/form-layout.d.ts +1 -1
- package/core/components/ui/form/form-layout/form-layout.js +1 -1
- package/core/components/ui/form/input/input.d.ts +4 -6
- package/core/components/ui/form/input/input.js +12 -18
- package/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +4 -4
- package/core/components/ui/form/input-autocomplete/input-autocomplete.js +23 -50
- package/core/components/ui/form/select/select.d.ts +1 -1
- package/core/components/ui/form/select/select.js +15 -25
- package/core/components/ui/form/textarea/textarea.d.ts +3 -3
- package/core/components/ui/form/textarea/textarea.js +8 -17
- package/core/components/ui/group/group.js +7 -15
- package/core/components/ui/icon/icon.d.ts +6 -12
- package/core/components/ui/icon/icon.js +20 -53
- package/core/components/ui/icon/icons.js +28 -22
- package/core/components/ui/image/image.d.ts +1 -1
- package/core/components/ui/image/image.js +3 -3
- package/core/components/ui/menu/menu.js +2 -4
- package/core/components/ui/modal/modal-actions.d.ts +1 -1
- package/core/components/ui/modal/modal-actions.js +4 -4
- package/core/components/ui/modal/modal.js +10 -12
- package/core/components/ui/pop/pop.js +3 -4
- package/core/components/ui/table/table-td.js +5 -6
- package/core/components/ui/table/table-th.js +5 -6
- package/core/components/ui/table/table-tr.js +8 -1
- package/core/components/ui/table/table.d.ts +1 -0
- package/core/components/ui/table/table.js +9 -1
- package/core/components/ui/theme/css/tailwind.css +0 -0
- package/core/components/ui/theme/css/tailwind.d.ts +0 -0
- package/core/components/ui/theme/theme.js +5 -6
- package/core/components/ui/toast/message-subscriber.js +6 -8
- package/core/components/ui/toast/toast.js +15 -6
- package/core/components/ui/tooltip/tooltip.d.ts +1 -1
- package/core/core.js +9 -0
- package/core/decorators/Subscriber.d.ts +2 -1
- package/core/decorators/Subscriber.js +65 -19
- package/core/directives/DataProvider.d.ts +18 -0
- package/core/directives/DataProvider.js +87 -0
- package/core/mixins/Fetcher.d.ts +3 -3
- package/core/mixins/Fetcher.js +71 -82
- package/core/mixins/FormCheckable.js +2 -3
- package/core/mixins/FormElement.js +5 -7
- package/core/mixins/FormInput.d.ts +1 -1
- package/core/mixins/FormInput.js +1 -2
- package/core/mixins/Subscriber.js +43 -54
- package/core/utils/Arrays.js +2 -1
- package/core/utils/DataBindObserver.js +5 -6
- package/core/utils/Electron.js +1 -1
- package/core/utils/HTML.js +18 -31
- package/core/utils/LocationHandler.js +8 -13
- package/core/utils/PublisherProxy.d.ts +6 -1
- package/core/utils/PublisherProxy.js +129 -134
- package/core/utils/Utils.js +3 -14
- package/core/utils/api.js +137 -165
- package/img/concorde-logo.svg +0 -0
- package/img/concorde.png +0 -0
- package/img/concorde_def.png +0 -0
- package/mixins.d.ts +5 -3
- package/package.json +14 -12
- package/svg/regular/plane.svg +0 -0
- package/svg/solid/plane.svg +0 -0
|
@@ -69,38 +69,18 @@ declare const Checkbox_base: {
|
|
|
69
69
|
new (...args: any[]): {
|
|
70
70
|
validateFormElement(): void;
|
|
71
71
|
forceAutoFill: boolean;
|
|
72
|
-
_type: "number" | "search" | "file" | "button" | "url" | "color" | "hidden" | "
|
|
73
|
-
type: "number" | "search" | "file" | "button" | "url" | "color" | "hidden" | "
|
|
72
|
+
_type: "number" | "search" | "time" | "file" | "button" | "url" | "color" | "hidden" | "image" | "text" | "reset" | "submit" | "email" | "tel" | "month" | "week" | "checkbox" | "radio" | "range" | "date" | "datetime-local" | "password";
|
|
73
|
+
type: "number" | "search" | "time" | "file" | "button" | "url" | "color" | "hidden" | "image" | "text" | "reset" | "submit" | "email" | "tel" | "month" | "week" | "checkbox" | "radio" | "range" | "date" | "datetime-local" | "password";
|
|
74
74
|
_description?: string | undefined;
|
|
75
75
|
description: string | undefined;
|
|
76
76
|
_label?: string | undefined;
|
|
77
77
|
label: string | undefined;
|
|
78
78
|
tabindex?: number | undefined;
|
|
79
|
-
autocomplete?: "url" | "name" | "
|
|
79
|
+
autocomplete?: "url" | "name" | "on" | "additional-name" | "address-level1" | "address-level2" | "address-level3" | "address-level4" | "address-line1" | "address-line2" | "address-line3" | "bday-day" | "bday-month" | "bday-year" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-family-name" | "cc-given-name" | "cc-name" | "cc-number" | "cc-type" | "country" | "country-name" | "current-password" | "family-name" | "given-name" | "honorific-prefix" | "honorific-suffix" | "new-password" | "one-time-code" | "organization" | "postal-code" | "street-address" | "transaction-amount" | "transaction-currency" | "username" | "email" | "tel" | "tel-area-code" | "tel-country-code" | "tel-extension" | "tel-local" | "tel-national" | "language" | "nickname" | "organization-title" | "cc-additional-name" | "bday" | "sex" | "impp" | "photo" | undefined;
|
|
80
80
|
getFormPublisher(): any;
|
|
81
81
|
updateDataValue(): void;
|
|
82
82
|
handleChange(e?: Event | undefined): void;
|
|
83
83
|
handleBlur(e?: Event | undefined): void;
|
|
84
|
-
/**
|
|
85
|
-
* ### Le composent sonic-checkbox étend les mixins FormCheckable, FormInput, FormElement et Subscriber
|
|
86
|
-
* **FormElement :**
|
|
87
|
-
* * 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é.
|
|
88
|
-
* * Par défault lorsque modifie l'input, la valeur est également mise à jour via le même dataprovider
|
|
89
|
-
* * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
|
|
90
|
-
* * 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.
|
|
91
|
-
* * **FormInput **
|
|
92
|
-
* Uniquement des propriétés classiques d'un input HTML. La prise en compte est ici partielle, par exemple les propriétés *placeholder*, *readonly*, *pattern*, *min* et *max* n'ont pas de sens pour un checkbox.
|
|
93
|
-
* **FormCheckable :**
|
|
94
|
-
* * La propriété checked mise à true si la valeur de la propriété du même nom dans les données du dataprovider associé contient un propriété checked.
|
|
95
|
-
* **Comportements :**
|
|
96
|
-
* * multiple (par défaut):
|
|
97
|
-
* - on peut cocher plusieurs checkbox ayant le même *name*.
|
|
98
|
-
* - la valeur enregistrée dans la propriété nommé du même nom dans formDataProvider est un tableau avec les *value* des cases cochées ayant le même *name*.
|
|
99
|
-
* * unique (Ajouter l'attribute unique au composant a l'intégration):
|
|
100
|
-
* - on ne peut cocher qu'une seule checkbox ayant le même *name*.
|
|
101
|
-
* * radio (Ajouter l'attribute radio au composant a l'intégration):
|
|
102
|
-
* Comme unique, mais on ne peut pas décocher la case sauf en en cochant une autre, comme un bouton radio.
|
|
103
|
-
*/
|
|
104
84
|
getValueForFormPublisher(): string | object | string[] | null | undefined;
|
|
105
85
|
focus?: (() => void) | undefined;
|
|
106
86
|
shadowRoot?: ShadowRoot | undefined;
|
|
@@ -5,7 +5,7 @@ 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, property,
|
|
8
|
+
import { customElement, property, queryAssignedElements } 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
11
|
import FormElement from "@supersoniks/concorde/core/mixins/FormElement";
|
|
@@ -55,10 +55,8 @@ let Checkbox = class Checkbox extends FormCheckable(FormInput(FormElement(Subscr
|
|
|
55
55
|
super.willUpdate(changedProperties);
|
|
56
56
|
}
|
|
57
57
|
hasSlotOrProps() {
|
|
58
|
-
|
|
59
|
-
this.
|
|
60
|
-
this.hasDescription =
|
|
61
|
-
this.description || ((_b = this.slotDescriptionNodes) === null || _b === void 0 ? void 0 : _b.length) ? true : false;
|
|
58
|
+
this.hasLabel = this.label || this.slotLabelNodes?.length ? true : false;
|
|
59
|
+
this.hasDescription = this.description || this.slotDescriptionNodes?.length ? true : false;
|
|
62
60
|
}
|
|
63
61
|
render() {
|
|
64
62
|
//let labelStarSuffix = this.label && this.required && this.label.indexOf("*") == -1 ? " *" : "";
|
|
@@ -80,9 +78,7 @@ let Checkbox = class Checkbox extends FormCheckable(FormInput(FormElement(Subscr
|
|
|
80
78
|
aria-label=${ifDefined(this.ariaLabel)}
|
|
81
79
|
aria-labelledby=${ifDefined(this.ariaLabelledby)}
|
|
82
80
|
/>
|
|
83
|
-
<sonic-icon name="${this.checked == "indeterminate" || this.showAsIndeterminate
|
|
84
|
-
? this.indeterminateIconName
|
|
85
|
-
: this.iconName}" class="sc-input-icon"></sonic-icon>
|
|
81
|
+
<sonic-icon name="${this.checked == "indeterminate" || this.showAsIndeterminate ? this.indeterminateIconName : this.iconName}" class="sc-input-icon"></sonic-icon>
|
|
86
82
|
</span>
|
|
87
83
|
|
|
88
84
|
<div class="checkbox-text ${!this.hasDescription && !this.hasLabel ? "hidden" : "checkbox-text"}">
|
|
@@ -139,8 +135,7 @@ Checkbox.styles = [
|
|
|
139
135
|
outline: none;
|
|
140
136
|
margin: 0;
|
|
141
137
|
background-color: var(--sc-checkbox-bg);
|
|
142
|
-
border: var(--sc-checkbox-border-width) solid
|
|
143
|
-
var(--sc-checkbox-border-color);
|
|
138
|
+
border: var(--sc-checkbox-border-width) solid var(--sc-checkbox-border-color);
|
|
144
139
|
}
|
|
145
140
|
|
|
146
141
|
input:focus,
|
|
@@ -246,10 +241,10 @@ __decorate([
|
|
|
246
241
|
property({ type: Boolean })
|
|
247
242
|
], Checkbox.prototype, "hasLabel", void 0);
|
|
248
243
|
__decorate([
|
|
249
|
-
|
|
244
|
+
queryAssignedElements({ flatten: true })
|
|
250
245
|
], Checkbox.prototype, "slotLabelNodes", void 0);
|
|
251
246
|
__decorate([
|
|
252
|
-
|
|
247
|
+
queryAssignedElements({ slot: "description", flatten: true })
|
|
253
248
|
], Checkbox.prototype, "slotDescriptionNodes", void 0);
|
|
254
249
|
Checkbox = __decorate([
|
|
255
250
|
customElement(tagName)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
-
import { ResizeController } from "@lit-labs/observers/
|
|
2
|
+
import { ResizeController } from "@lit-labs/observers/resize-controller.js";
|
|
3
3
|
declare const FormLayout_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("../../../../_types/types").CoreJSType>) & typeof LitElement;
|
|
4
4
|
export declare class FormLayout extends FormLayout_base {
|
|
5
5
|
static styles: import("lit").CSSResult[];
|
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { html, LitElement, css } from "lit";
|
|
8
8
|
import { customElement, property, queryAssignedElements } from "lit/decorators.js";
|
|
9
|
-
import { ResizeController } from "@lit-labs/observers/
|
|
9
|
+
import { ResizeController } from "@lit-labs/observers/resize-controller.js";
|
|
10
10
|
import { classMap } from "lit/directives/class-map.js";
|
|
11
11
|
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
12
12
|
const tagName = "sonic-form-layout";
|
|
@@ -3,14 +3,14 @@ declare const Input_base: {
|
|
|
3
3
|
new (...args: any[]): {
|
|
4
4
|
validateFormElement(): void;
|
|
5
5
|
forceAutoFill: boolean;
|
|
6
|
-
_type: "number" | "search" | "file" | "button" | "url" | "color" | "hidden" | "
|
|
7
|
-
type: "number" | "search" | "file" | "button" | "url" | "color" | "hidden" | "
|
|
6
|
+
_type: "number" | "search" | "time" | "file" | "button" | "url" | "color" | "hidden" | "image" | "text" | "reset" | "submit" | "email" | "tel" | "month" | "week" | "checkbox" | "radio" | "range" | "date" | "datetime-local" | "password";
|
|
7
|
+
type: "number" | "search" | "time" | "file" | "button" | "url" | "color" | "hidden" | "image" | "text" | "reset" | "submit" | "email" | "tel" | "month" | "week" | "checkbox" | "radio" | "range" | "date" | "datetime-local" | "password";
|
|
8
8
|
_description?: string | undefined;
|
|
9
9
|
description: string | undefined;
|
|
10
10
|
_label?: string | undefined;
|
|
11
11
|
label: string | undefined;
|
|
12
12
|
tabindex?: number | undefined;
|
|
13
|
-
autocomplete?: "url" | "name" | "
|
|
13
|
+
autocomplete?: "url" | "name" | "on" | "additional-name" | "address-level1" | "address-level2" | "address-level3" | "address-level4" | "address-line1" | "address-line2" | "address-line3" | "bday-day" | "bday-month" | "bday-year" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-family-name" | "cc-given-name" | "cc-name" | "cc-number" | "cc-type" | "country" | "country-name" | "current-password" | "family-name" | "given-name" | "honorific-prefix" | "honorific-suffix" | "new-password" | "one-time-code" | "organization" | "postal-code" | "street-address" | "transaction-amount" | "transaction-currency" | "username" | "email" | "tel" | "tel-area-code" | "tel-country-code" | "tel-extension" | "tel-local" | "tel-national" | "language" | "nickname" | "organization-title" | "cc-additional-name" | "bday" | "sex" | "impp" | "photo" | undefined;
|
|
14
14
|
getFormPublisher(): any;
|
|
15
15
|
updateDataValue(): void;
|
|
16
16
|
handleChange(e?: Event | undefined): void;
|
|
@@ -54,9 +54,7 @@ declare const Input_base: {
|
|
|
54
54
|
requestUpdate(): void;
|
|
55
55
|
getAttribute(name: string): string;
|
|
56
56
|
hasAttribute(attributeName: string): boolean;
|
|
57
|
-
disconnectedCallback(): void;
|
|
58
|
-
* Taille du composant, implique notamment des modifications de typo et de marge interne
|
|
59
|
-
*/
|
|
57
|
+
disconnectedCallback(): void;
|
|
60
58
|
getBoundingClientRect(): DOMRect;
|
|
61
59
|
onConnected(callback: (component: any) => void): void;
|
|
62
60
|
offConnected(callback: (component: any) => void): void;
|
|
@@ -5,10 +5,10 @@ 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, property,
|
|
8
|
+
import { customElement, property, queryAssignedElements, 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, label, description, passwordToggle
|
|
11
|
+
import { formControl, label, description, passwordToggle } 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";
|
|
@@ -73,18 +73,15 @@ let Input = class Input extends FormInput(FormElement(Subscriber(LitElement))) {
|
|
|
73
73
|
this.input.setSelectionRange(start, end);
|
|
74
74
|
}
|
|
75
75
|
hasSlotOrProps() {
|
|
76
|
-
|
|
77
|
-
this.
|
|
78
|
-
this.
|
|
79
|
-
|
|
80
|
-
this.hasSuffix = ((_c = this.slotSuffixNodes) === null || _c === void 0 ? void 0 : _c.length) ? true : false;
|
|
81
|
-
this.hasPrefix = ((_d = this.slotPrefixNodes) === null || _d === void 0 ? void 0 : _d.length) ? true : false;
|
|
76
|
+
this.hasLabel = this.label || this.slotLabelNodes?.length ? true : false;
|
|
77
|
+
this.hasDescription = this.description || this.slotDescriptionNodes?.length ? true : false;
|
|
78
|
+
this.hasSuffix = this.slotSuffixNodes?.length ? true : false;
|
|
79
|
+
this.hasPrefix = this.slotPrefixNodes?.length ? true : false;
|
|
82
80
|
}
|
|
83
81
|
inlineContentFocus() {
|
|
84
|
-
var _a;
|
|
85
82
|
if (!this.inlineContent || this.disableInlineContentFocus)
|
|
86
83
|
return;
|
|
87
|
-
|
|
84
|
+
this.input?.focus();
|
|
88
85
|
}
|
|
89
86
|
handleChange(e) {
|
|
90
87
|
if (!this.hasAttribute("inputDelayMs")) {
|
|
@@ -156,10 +153,7 @@ let Input = class Input extends FormInput(FormElement(Subscriber(LitElement))) {
|
|
|
156
153
|
aria-label="Toggle password visibility"
|
|
157
154
|
variant="unstyled"
|
|
158
155
|
>
|
|
159
|
-
<sonic-icon
|
|
160
|
-
library="heroicons"
|
|
161
|
-
name=${this.isPassword ? "eye" : "eye-slash"}
|
|
162
|
-
></sonic-icon>
|
|
156
|
+
<sonic-icon library="heroicons" name=${this.isPassword ? "eye" : "eye-slash"}></sonic-icon>
|
|
163
157
|
</sonic-button>`
|
|
164
158
|
: ""}
|
|
165
159
|
<slot name="suffix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
@@ -236,16 +230,16 @@ __decorate([
|
|
|
236
230
|
property({ type: Boolean })
|
|
237
231
|
], Input.prototype, "showPasswordToggle", void 0);
|
|
238
232
|
__decorate([
|
|
239
|
-
|
|
233
|
+
queryAssignedElements({ slot: "label", flatten: true })
|
|
240
234
|
], Input.prototype, "slotLabelNodes", void 0);
|
|
241
235
|
__decorate([
|
|
242
|
-
|
|
236
|
+
queryAssignedElements({ slot: "description", flatten: true })
|
|
243
237
|
], Input.prototype, "slotDescriptionNodes", void 0);
|
|
244
238
|
__decorate([
|
|
245
|
-
|
|
239
|
+
queryAssignedElements({ slot: "suffix", flatten: true })
|
|
246
240
|
], Input.prototype, "slotSuffixNodes", void 0);
|
|
247
241
|
__decorate([
|
|
248
|
-
|
|
242
|
+
queryAssignedElements({ slot: "prefix", flatten: true })
|
|
249
243
|
], Input.prototype, "slotPrefixNodes", void 0);
|
|
250
244
|
__decorate([
|
|
251
245
|
query("input")
|
|
@@ -4,20 +4,20 @@ 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
6
|
import { Size } from "../../_css/size";
|
|
7
|
-
import { ResizeController } from "@lit-labs/observers/
|
|
7
|
+
import { ResizeController } from "@lit-labs/observers/resize-controller.js";
|
|
8
8
|
type ListItem = Record<string, string>;
|
|
9
9
|
declare const InputAutocomplete_base: (new (...args: any[]) => import("../../../../mixins/TemplatesContainer").TemplatesContainerInterface) & {
|
|
10
10
|
new (...args: any[]): {
|
|
11
11
|
validateFormElement(): void;
|
|
12
12
|
forceAutoFill: boolean;
|
|
13
|
-
_type: "number" | "search" | "file" | "button" | "url" | "color" | "hidden" | "
|
|
14
|
-
type: "number" | "search" | "file" | "button" | "url" | "color" | "hidden" | "
|
|
13
|
+
_type: "number" | "search" | "time" | "file" | "button" | "url" | "color" | "hidden" | "image" | "text" | "reset" | "submit" | "email" | "tel" | "month" | "week" | "checkbox" | "radio" | "range" | "date" | "datetime-local" | "password";
|
|
14
|
+
type: "number" | "search" | "time" | "file" | "button" | "url" | "color" | "hidden" | "image" | "text" | "reset" | "submit" | "email" | "tel" | "month" | "week" | "checkbox" | "radio" | "range" | "date" | "datetime-local" | "password";
|
|
15
15
|
_description?: string | undefined;
|
|
16
16
|
description: string | undefined;
|
|
17
17
|
_label?: string | undefined;
|
|
18
18
|
label: string | undefined;
|
|
19
19
|
tabindex?: number | undefined;
|
|
20
|
-
autocomplete?: "url" | "name" | "
|
|
20
|
+
autocomplete?: "url" | "name" | "on" | "additional-name" | "address-level1" | "address-level2" | "address-level3" | "address-level4" | "address-line1" | "address-line2" | "address-line3" | "bday-day" | "bday-month" | "bday-year" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-family-name" | "cc-given-name" | "cc-name" | "cc-number" | "cc-type" | "country" | "country-name" | "current-password" | "family-name" | "given-name" | "honorific-prefix" | "honorific-suffix" | "new-password" | "one-time-code" | "organization" | "postal-code" | "street-address" | "transaction-amount" | "transaction-currency" | "username" | "email" | "tel" | "tel-area-code" | "tel-country-code" | "tel-extension" | "tel-local" | "tel-national" | "language" | "nickname" | "organization-title" | "cc-additional-name" | "bday" | "sex" | "impp" | "photo" | undefined;
|
|
21
21
|
getFormPublisher(): any;
|
|
22
22
|
updateDataValue(): void;
|
|
23
23
|
handleChange(e?: Event | undefined): void;
|
|
@@ -5,8 +5,8 @@ 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, nothing } from "lit";
|
|
8
|
-
import { customElement, property,
|
|
9
|
-
import { FormInput, FormElement, Subscriber, TemplatesContainer
|
|
8
|
+
import { customElement, property, queryAssignedElements, state } from "lit/decorators.js";
|
|
9
|
+
import { FormInput, FormElement, Subscriber, TemplatesContainer } from "@supersoniks/concorde/mixins";
|
|
10
10
|
import "@supersoniks/concorde/core/components/ui/form/input/input";
|
|
11
11
|
import "@supersoniks/concorde/core/components/ui/pop/pop";
|
|
12
12
|
import "@supersoniks/concorde/core/components/functional/queue/queue";
|
|
@@ -14,7 +14,7 @@ import "@supersoniks/concorde/core/components/ui/menu/menu-item";
|
|
|
14
14
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
15
15
|
import { PublisherManager } from "@supersoniks/concorde/utils";
|
|
16
16
|
import { customScroll } from "@supersoniks/concorde/core/components/ui/_css/scroll";
|
|
17
|
-
import { ResizeController } from "@lit-labs/observers/
|
|
17
|
+
import { ResizeController } from "@lit-labs/observers/resize-controller.js";
|
|
18
18
|
/**
|
|
19
19
|
* Input avec autocomplete. Propose des valeurs à partir d'un sonic-queue.
|
|
20
20
|
* L'input permet de filtrer les choix de valeurs dans le sonic-pop.
|
|
@@ -54,29 +54,22 @@ let InputAutocomplete = class InputAutocomplete extends TemplatesContainer(FormI
|
|
|
54
54
|
this.queryQueueListItem(this.initQueueDataProvider, this.findSelection, this.setSearchFromSelection);
|
|
55
55
|
};
|
|
56
56
|
this.selectListItem = (listItem) => {
|
|
57
|
-
|
|
58
|
-
(_a = this.formValuePublisher) === null || _a === void 0 ? void 0 : _a.set(listItem[this.name]);
|
|
57
|
+
this.formValuePublisher?.set(listItem[this.name]);
|
|
59
58
|
};
|
|
60
59
|
this.findSearchedItem = (listItem) => {
|
|
61
|
-
|
|
62
|
-
return (listItem[this.searchParameter || this.name] == ((_a = this.searchPublisher) === null || _a === void 0 ? void 0 : _a.get()));
|
|
60
|
+
return listItem[this.searchParameter || this.name] == this.searchPublisher?.get();
|
|
63
61
|
};
|
|
64
62
|
this.findSelection = (listItem) => {
|
|
65
63
|
return listItem[this.name] == this.value;
|
|
66
64
|
};
|
|
67
65
|
this.setSearchFromSelection = (listItem) => {
|
|
68
|
-
var _a;
|
|
69
66
|
this.lastValidSearch = listItem[this.searchParameter || this.name];
|
|
70
|
-
|
|
67
|
+
this.searchPublisher?.set(this.lastValidSearch);
|
|
71
68
|
};
|
|
72
69
|
this.updateActiveSelection = () => {
|
|
73
|
-
var _a, _b, _c;
|
|
74
70
|
this.queryQueueListItem(this.queueDataProvider, this.findSearchedItem, this.selectListItem);
|
|
75
|
-
if (!this.select &&
|
|
76
|
-
this.
|
|
77
|
-
this.lastValidSearch != ((_a = this.searchPublisher) === null || _a === void 0 ? void 0 : _a.get()) &&
|
|
78
|
-
((_b = this.formValuePublisher) === null || _b === void 0 ? void 0 : _b.get())) {
|
|
79
|
-
(_c = this.formValuePublisher) === null || _c === void 0 ? void 0 : _c.set("");
|
|
71
|
+
if (!this.select && this.lastValidSearch && this.lastValidSearch != this.searchPublisher?.get() && this.formValuePublisher?.get()) {
|
|
72
|
+
this.formValuePublisher?.set("");
|
|
80
73
|
}
|
|
81
74
|
};
|
|
82
75
|
}
|
|
@@ -84,11 +77,9 @@ let InputAutocomplete = class InputAutocomplete extends TemplatesContainer(FormI
|
|
|
84
77
|
* Les fonctions de gestion
|
|
85
78
|
*/
|
|
86
79
|
hasSlotOrProps() {
|
|
87
|
-
|
|
88
|
-
this.hasInputPrefix = !!((_a = this.slotInputPrefixNodes) === null || _a === void 0 ? void 0 : _a.length);
|
|
80
|
+
this.hasInputPrefix = !!this.slotInputPrefixNodes?.length;
|
|
89
81
|
}
|
|
90
82
|
connectedCallback() {
|
|
91
|
-
var _a, _b, _c;
|
|
92
83
|
super.connectedCallback();
|
|
93
84
|
/**
|
|
94
85
|
* Nom de la valeur de recherche
|
|
@@ -119,23 +110,22 @@ let InputAutocomplete = class InputAutocomplete extends TemplatesContainer(FormI
|
|
|
119
110
|
if (this.value) {
|
|
120
111
|
PublisherManager.get(this.initSearchDataProvider)[this.name] = this.value;
|
|
121
112
|
}
|
|
122
|
-
|
|
113
|
+
this.initCountPublisher?.onAssign(this.initSearchParameter);
|
|
123
114
|
/**
|
|
124
115
|
* Lorsque la sélection change, on met à jour la valeur de recherche
|
|
125
116
|
*/
|
|
126
|
-
|
|
117
|
+
this.formValuePublisher?.onAssign(this.updateSearchParameter);
|
|
127
118
|
/**
|
|
128
119
|
* Lorsque La valeur de recherche change, que le composant n'est pas en mode select
|
|
129
120
|
* et qu'elle est différente de la derniere recherche valide on désactive la selection
|
|
130
121
|
*/
|
|
131
|
-
|
|
122
|
+
this.countPublisher?.onAssign(this.updateActiveSelection);
|
|
132
123
|
}
|
|
133
124
|
disconnectedCallback() {
|
|
134
|
-
var _a, _b, _c;
|
|
135
125
|
super.disconnectedCallback();
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
126
|
+
this.initCountPublisher?.offAssign(this.initSearchParameter);
|
|
127
|
+
this.formValuePublisher?.offAssign(this.updateSearchParameter);
|
|
128
|
+
this.countPublisher?.offAssign(this.updateActiveSelection);
|
|
139
129
|
const getPublisher = PublisherManager.get;
|
|
140
130
|
getPublisher(this.initSearchDataProvider).delete();
|
|
141
131
|
getPublisher(this.initQueueDataProvider).delete();
|
|
@@ -162,19 +152,17 @@ let InputAutocomplete = class InputAutocomplete extends TemplatesContainer(FormI
|
|
|
162
152
|
}
|
|
163
153
|
}
|
|
164
154
|
setSelectionRange(start, end) {
|
|
165
|
-
|
|
166
|
-
(_a = this.querySelector("sonic-input")) === null || _a === void 0 ? void 0 : _a.setSelectionRange(start, end);
|
|
155
|
+
this.querySelector("sonic-input")?.setSelectionRange(start, end);
|
|
167
156
|
}
|
|
168
157
|
handleHide() {
|
|
169
|
-
var _a, _b, _c;
|
|
170
158
|
if (!this.select)
|
|
171
159
|
return;
|
|
172
|
-
if (
|
|
160
|
+
if (this.searchPublisher?.get() == "") {
|
|
173
161
|
this.lastValidSearch = "";
|
|
174
|
-
|
|
162
|
+
this.formValuePublisher?.set("");
|
|
175
163
|
return;
|
|
176
164
|
}
|
|
177
|
-
|
|
165
|
+
this.searchPublisher?.set(this.lastValidSearch);
|
|
178
166
|
}
|
|
179
167
|
render() {
|
|
180
168
|
return html `
|
|
@@ -194,28 +182,13 @@ let InputAutocomplete = class InputAutocomplete extends TemplatesContainer(FormI
|
|
|
194
182
|
inlineContent
|
|
195
183
|
size=${this.size}
|
|
196
184
|
>
|
|
197
|
-
<slot
|
|
198
|
-
name="prefix"
|
|
199
|
-
slot="prefix"
|
|
200
|
-
@slotchange=${this.hasSlotOrProps}
|
|
201
|
-
></slot>
|
|
185
|
+
<slot name="prefix" slot="prefix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
202
186
|
|
|
203
187
|
${this.select
|
|
204
|
-
? html `
|
|
205
|
-
<sonic-icon
|
|
206
|
-
slot="suffix"
|
|
207
|
-
class="select-chevron"
|
|
208
|
-
name="nav-arrow-down"
|
|
209
|
-
.size=${this.size}
|
|
210
|
-
></sonic-icon>
|
|
211
|
-
`
|
|
188
|
+
? html ` <sonic-icon slot="suffix" class="select-chevron" name="nav-arrow-down" .size=${this.size}></sonic-icon> `
|
|
212
189
|
: nothing}
|
|
213
190
|
</sonic-input>
|
|
214
|
-
<sonic-menu
|
|
215
|
-
slot="content"
|
|
216
|
-
class="custom-scroll"
|
|
217
|
-
style="${this.offsetWidth ? `width: ${this.offsetWidth}px` : ""}"
|
|
218
|
-
>
|
|
191
|
+
<sonic-menu slot="content" class="custom-scroll" style="${this.offsetWidth ? `width: ${this.offsetWidth}px` : ""}">
|
|
219
192
|
<sonic-queue
|
|
220
193
|
dataProvider="${this.queueDataProvider}"
|
|
221
194
|
filteredFields=${this.filteredFields}
|
|
@@ -281,7 +254,7 @@ __decorate([
|
|
|
281
254
|
property({ type: String })
|
|
282
255
|
], InputAutocomplete.prototype, "searchParameter", void 0);
|
|
283
256
|
__decorate([
|
|
284
|
-
|
|
257
|
+
queryAssignedElements({ slot: "prefix", flatten: true })
|
|
285
258
|
], InputAutocomplete.prototype, "slotInputPrefixNodes", void 0);
|
|
286
259
|
__decorate([
|
|
287
260
|
state()
|
|
@@ -26,7 +26,7 @@ export declare class Select extends Select_base {
|
|
|
26
26
|
set options(options: Array<SelectOption>);
|
|
27
27
|
get options(): Array<SelectOption>;
|
|
28
28
|
hasDoneFirstUpdate: boolean;
|
|
29
|
-
protected firstUpdated(): void;
|
|
29
|
+
protected firstUpdated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
30
30
|
_value: string;
|
|
31
31
|
set value(value: string);
|
|
32
32
|
get value(): string;
|
|
@@ -5,7 +5,7 @@ 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, property,
|
|
8
|
+
import { customElement, property, queryAssignedElements, state } from "lit/decorators.js";
|
|
9
9
|
import { classMap } from "lit/directives/class-map.js";
|
|
10
10
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
11
11
|
import { repeat } from "lit/directives/repeat.js";
|
|
@@ -58,8 +58,9 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
58
58
|
get options() {
|
|
59
59
|
return this._options;
|
|
60
60
|
}
|
|
61
|
-
firstUpdated() {
|
|
61
|
+
firstUpdated(changedProperties) {
|
|
62
62
|
this.hasDoneFirstUpdate = true;
|
|
63
|
+
super.firstUpdated(changedProperties);
|
|
63
64
|
}
|
|
64
65
|
set value(value) {
|
|
65
66
|
if (value == null && !this.hasDoneFirstUpdate)
|
|
@@ -118,15 +119,13 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
118
119
|
super.willUpdate(changedProperties);
|
|
119
120
|
}
|
|
120
121
|
hasSlotOrProps() {
|
|
121
|
-
|
|
122
|
-
this.
|
|
123
|
-
this.
|
|
124
|
-
this.
|
|
125
|
-
this.hasPrefix = ((_d = this.slotPrefixNodes) === null || _d === void 0 ? void 0 : _d.length) ? true : false;
|
|
122
|
+
this.hasLabel = this.label || this.slotLabelNodes?.length ? true : false;
|
|
123
|
+
this.hasDescription = this.description || this.slotDescriptionNodes?.length ? true : false;
|
|
124
|
+
this.hasSuffix = this.slotSuffixNodes?.length ? true : false;
|
|
125
|
+
this.hasPrefix = this.slotPrefixNodes?.length ? true : false;
|
|
126
126
|
}
|
|
127
127
|
validateFormElement() {
|
|
128
|
-
|
|
129
|
-
const select = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("select");
|
|
128
|
+
const select = this.shadowRoot?.querySelector("select");
|
|
130
129
|
if (!select || select.checkValidity())
|
|
131
130
|
return;
|
|
132
131
|
const formPublisher = this.getFormPublisher();
|
|
@@ -143,10 +142,7 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
143
142
|
//let labelStarSuffix = this.label && this.required && this.label.indexOf("*") == -1 ? " *" : "";
|
|
144
143
|
return html `
|
|
145
144
|
<label for="form-element" class="${this.hasLabel ? "form-label" : "hidden"}"
|
|
146
|
-
>${this.label ? unsafeHTML(this.label /*+ labelStarSuffix*/) : ""}<slot
|
|
147
|
-
name="label"
|
|
148
|
-
@slotchange=${this.hasSlotOrProps}
|
|
149
|
-
></slot
|
|
145
|
+
>${this.label ? unsafeHTML(this.label /*+ labelStarSuffix*/) : ""}<slot name="label" @slotchange=${this.hasSlotOrProps}></slot
|
|
150
146
|
></label>
|
|
151
147
|
|
|
152
148
|
<div class="form-control ${classMap(slotClasses)}">
|
|
@@ -168,9 +164,7 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
168
164
|
>
|
|
169
165
|
${repeat(this.options, (option) => option[this.valueKey], (option) => {
|
|
170
166
|
const isSelected = this.value == option[this.valueKey] ? true : false;
|
|
171
|
-
return html `<option ?selected=${isSelected} value="${option[this.valueKey]}"
|
|
172
|
-
${option[this.wordingKey]}
|
|
173
|
-
</option>`;
|
|
167
|
+
return html `<option ?selected=${isSelected} value="${option[this.valueKey]}">${option[this.wordingKey]}</option>`;
|
|
174
168
|
})}
|
|
175
169
|
<slot></slot>
|
|
176
170
|
</select>
|
|
@@ -179,11 +173,7 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
179
173
|
<slot name="suffix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
180
174
|
</div>
|
|
181
175
|
|
|
182
|
-
<slot
|
|
183
|
-
name="description"
|
|
184
|
-
@slotchange=${this.hasSlotOrProps}
|
|
185
|
-
class="${this.hasDescription ? "form-description" : "hidden"}"
|
|
186
|
-
>
|
|
176
|
+
<slot name="description" @slotchange=${this.hasSlotOrProps} class="${this.hasDescription ? "form-description" : "hidden"}">
|
|
187
177
|
${this.description ? html `${unsafeHTML(this.description)}` : ""}
|
|
188
178
|
</slot>
|
|
189
179
|
`;
|
|
@@ -272,16 +262,16 @@ __decorate([
|
|
|
272
262
|
property()
|
|
273
263
|
], Select.prototype, "label", null);
|
|
274
264
|
__decorate([
|
|
275
|
-
|
|
265
|
+
queryAssignedElements({ slot: "label", flatten: true })
|
|
276
266
|
], Select.prototype, "slotLabelNodes", void 0);
|
|
277
267
|
__decorate([
|
|
278
|
-
|
|
268
|
+
queryAssignedElements({ slot: "description", flatten: true })
|
|
279
269
|
], Select.prototype, "slotDescriptionNodes", void 0);
|
|
280
270
|
__decorate([
|
|
281
|
-
|
|
271
|
+
queryAssignedElements({ slot: "suffix", flatten: true })
|
|
282
272
|
], Select.prototype, "slotSuffixNodes", void 0);
|
|
283
273
|
__decorate([
|
|
284
|
-
|
|
274
|
+
queryAssignedElements({ slot: "prefix", flatten: true })
|
|
285
275
|
], Select.prototype, "slotPrefixNodes", void 0);
|
|
286
276
|
__decorate([
|
|
287
277
|
state()
|
|
@@ -3,14 +3,14 @@ declare const Textarea_base: {
|
|
|
3
3
|
new (...args: any[]): {
|
|
4
4
|
validateFormElement(): void;
|
|
5
5
|
forceAutoFill: boolean;
|
|
6
|
-
_type: "number" | "search" | "file" | "button" | "url" | "color" | "hidden" | "
|
|
7
|
-
type: "number" | "search" | "file" | "button" | "url" | "color" | "hidden" | "
|
|
6
|
+
_type: "number" | "search" | "time" | "file" | "button" | "url" | "color" | "hidden" | "image" | "text" | "reset" | "submit" | "email" | "tel" | "month" | "week" | "checkbox" | "radio" | "range" | "date" | "datetime-local" | "password";
|
|
7
|
+
type: "number" | "search" | "time" | "file" | "button" | "url" | "color" | "hidden" | "image" | "text" | "reset" | "submit" | "email" | "tel" | "month" | "week" | "checkbox" | "radio" | "range" | "date" | "datetime-local" | "password";
|
|
8
8
|
_description?: string | undefined;
|
|
9
9
|
description: string | undefined;
|
|
10
10
|
_label?: string | undefined;
|
|
11
11
|
label: string | undefined;
|
|
12
12
|
tabindex?: number | undefined;
|
|
13
|
-
autocomplete?: "url" | "name" | "
|
|
13
|
+
autocomplete?: "url" | "name" | "on" | "additional-name" | "address-level1" | "address-level2" | "address-level3" | "address-level4" | "address-line1" | "address-line2" | "address-line3" | "bday-day" | "bday-month" | "bday-year" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-family-name" | "cc-given-name" | "cc-name" | "cc-number" | "cc-type" | "country" | "country-name" | "current-password" | "family-name" | "given-name" | "honorific-prefix" | "honorific-suffix" | "new-password" | "one-time-code" | "organization" | "postal-code" | "street-address" | "transaction-amount" | "transaction-currency" | "username" | "email" | "tel" | "tel-area-code" | "tel-country-code" | "tel-extension" | "tel-local" | "tel-national" | "language" | "nickname" | "organization-title" | "cc-additional-name" | "bday" | "sex" | "impp" | "photo" | undefined;
|
|
14
14
|
getFormPublisher(): any;
|
|
15
15
|
updateDataValue(): void;
|
|
16
16
|
handleChange(e?: Event | undefined): void;
|