@supersoniks/concorde 1.1.30 → 1.1.34
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 +102 -114
- package/concorde-core.es.js +7586 -54
- package/core/components/functional/date/date.js +8 -2
- package/core/components/functional/list/list.js +17 -11
- package/core/components/functional/queue/queue.d.ts +4 -1
- package/core/components/functional/queue/queue.js +16 -3
- package/core/components/functional/submit/submit.js +62 -33
- package/core/components/ui/_css/size.js +24 -24
- package/core/components/ui/alert/alert.js +1 -1
- package/core/components/ui/button/button.d.ts +3 -2
- package/core/components/ui/captcha/captcha.d.ts +17 -0
- package/core/components/ui/captcha/captcha.js +64 -0
- package/core/components/ui/form/checkbox/checkbox.d.ts +9 -4
- package/core/components/ui/form/checkbox/checkbox.js +28 -35
- package/core/components/ui/form/fieldset/legend.d.ts +7 -2
- package/core/components/ui/form/fieldset/legend.js +34 -8
- package/core/components/ui/form/input/input.d.ts +6 -2
- package/core/components/ui/form/input/input.js +4 -13
- package/core/components/ui/form/select/select.d.ts +7 -2
- package/core/components/ui/form/select/select.js +32 -7
- package/core/components/ui/form/textarea/textarea.d.ts +6 -2
- package/core/components/ui/form/textarea/textarea.js +2 -7
- package/core/components/ui/taxonomy/taxonomy.js +2 -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.d.ts +1 -0
- package/core/components/ui/theme/theme.js +5 -1
- package/core/components/ui/toast/toast-item.js +24 -6
- package/core/components/ui/toast/toast.js +6 -2
- package/core/components/ui/ui.d.ts +1 -0
- package/core/components/ui/ui.js +1 -0
- package/core/mixins/Fetcher.js +4 -0
- package/core/mixins/FormCheckable.d.ts +3 -8
- package/core/mixins/FormCheckable.js +4 -15
- package/core/mixins/FormElement.js +7 -0
- package/core/mixins/FormInput.d.ts +8 -9
- package/core/mixins/FormInput.js +39 -2
- package/core/mixins/Subscriber.js +4 -0
- package/core/utils/PublisherProxy.d.mts +1 -1
- package/core/utils/PublisherProxy.mjs +3 -3
- package/core/utils/api.d.ts +4 -0
- package/core/utils/api.js +29 -3
- package/mixins.d.ts +9 -2
- package/package.json +3 -1
|
@@ -10,14 +10,37 @@ import "@supersoniks/concorde/core/components/ui/form/fieldset/legend-descriptio
|
|
|
10
10
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
11
11
|
const tagName = "sonic-legend";
|
|
12
12
|
let Legend = class Legend extends LitElement {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.forceAutoFill = false;
|
|
16
|
+
}
|
|
17
|
+
get description() {
|
|
18
|
+
return this._description;
|
|
19
|
+
}
|
|
20
|
+
set description(value) {
|
|
21
|
+
if (this.hasAttribute("description") && !this.forceAutoFill)
|
|
22
|
+
value = this.getAttribute("description");
|
|
23
|
+
this._description = value;
|
|
24
|
+
this.requestUpdate();
|
|
25
|
+
}
|
|
26
|
+
get label() {
|
|
27
|
+
return this._label;
|
|
28
|
+
}
|
|
29
|
+
set label(value) {
|
|
30
|
+
if (this.hasAttribute("label") && !this.forceAutoFill)
|
|
31
|
+
value = this.getAttribute("label");
|
|
32
|
+
this._label = value;
|
|
33
|
+
this.requestUpdate();
|
|
34
|
+
}
|
|
13
35
|
render() {
|
|
14
36
|
return html `<legend part="legend">
|
|
15
37
|
${this.iconName
|
|
16
38
|
? html `<div class="icon">
|
|
17
|
-
<sonic-icon
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
39
|
+
<sonic-icon
|
|
40
|
+
name=${this.iconName}
|
|
41
|
+
prefix=${ifDefined(this.iconPrefix)}
|
|
42
|
+
library=${ifDefined(this.iconLibrary)}
|
|
43
|
+
></sonic-icon>
|
|
21
44
|
</div>`
|
|
22
45
|
: ""}
|
|
23
46
|
|
|
@@ -67,11 +90,14 @@ Legend.styles = [
|
|
|
67
90
|
`,
|
|
68
91
|
];
|
|
69
92
|
__decorate([
|
|
70
|
-
property({ type:
|
|
71
|
-
], Legend.prototype, "
|
|
93
|
+
property({ type: Boolean })
|
|
94
|
+
], Legend.prototype, "forceAutoFill", void 0);
|
|
72
95
|
__decorate([
|
|
73
|
-
property(
|
|
74
|
-
], Legend.prototype, "
|
|
96
|
+
property()
|
|
97
|
+
], Legend.prototype, "description", null);
|
|
98
|
+
__decorate([
|
|
99
|
+
property()
|
|
100
|
+
], Legend.prototype, "label", null);
|
|
75
101
|
__decorate([
|
|
76
102
|
property({ type: String })
|
|
77
103
|
], Legend.prototype, "iconName", void 0);
|
|
@@ -2,7 +2,13 @@ import { LitElement } from "lit";
|
|
|
2
2
|
declare const Input_base: {
|
|
3
3
|
new (...args: any[]): {
|
|
4
4
|
validateFormElement(): void;
|
|
5
|
+
forceAutoFill: boolean;
|
|
6
|
+
_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
7
|
type: "number" | "search" | "file" | "button" | "password" | "url" | "color" | "hidden" | "time" | "image" | "text" | "reset" | "submit" | "month" | "week" | "checkbox" | "radio" | "range" | "tel" | "email" | "date" | "datetime-local";
|
|
8
|
+
_description?: string | undefined;
|
|
9
|
+
description: string | undefined;
|
|
10
|
+
_label?: string | undefined;
|
|
11
|
+
label: string | undefined;
|
|
6
12
|
tabindex?: number | undefined;
|
|
7
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;
|
|
8
14
|
getFormPublisher(): any;
|
|
@@ -59,8 +65,6 @@ export declare class Input extends Input_base {
|
|
|
59
65
|
minlength?: number;
|
|
60
66
|
maxlength?: number;
|
|
61
67
|
src?: string;
|
|
62
|
-
label?: string;
|
|
63
|
-
description?: string;
|
|
64
68
|
inlineContent: boolean;
|
|
65
69
|
slotLabelNodes: Array<Node>;
|
|
66
70
|
slotDescriptionNodes: Array<Node>;
|
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { html, LitElement } from "lit";
|
|
8
8
|
import { customElement, property, queryAssignedNodes, state } from "lit/decorators.js";
|
|
9
|
-
import { query } from
|
|
9
|
+
import { query } from "lit/decorators/query.js";
|
|
10
10
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
11
11
|
import { formControl } from "@supersoniks/concorde/core/components/ui/form/css/form-control";
|
|
12
12
|
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
@@ -49,7 +49,7 @@ let Input = class Input extends FormInput(FormElement(Subscriber(LitElement))) {
|
|
|
49
49
|
var _a;
|
|
50
50
|
if (!this.inlineContent)
|
|
51
51
|
return;
|
|
52
|
-
console.log(
|
|
52
|
+
console.log("oypouaze");
|
|
53
53
|
(_a = this.input) === null || _a === void 0 ? void 0 : _a.focus();
|
|
54
54
|
}
|
|
55
55
|
render() {
|
|
@@ -99,10 +99,7 @@ let Input = class Input extends FormInput(FormElement(Subscriber(LitElement))) {
|
|
|
99
99
|
`;
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
|
-
Input.styles = [
|
|
103
|
-
fontSize,
|
|
104
|
-
formControl
|
|
105
|
-
];
|
|
102
|
+
Input.styles = [fontSize, formControl];
|
|
106
103
|
__decorate([
|
|
107
104
|
property({ type: String, reflect: true })
|
|
108
105
|
], Input.prototype, "size", void 0);
|
|
@@ -136,12 +133,6 @@ __decorate([
|
|
|
136
133
|
__decorate([
|
|
137
134
|
property({ type: String })
|
|
138
135
|
], Input.prototype, "src", 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
136
|
__decorate([
|
|
146
137
|
property({ type: Boolean, reflect: true })
|
|
147
138
|
], Input.prototype, "inlineContent", void 0);
|
|
@@ -158,7 +149,7 @@ __decorate([
|
|
|
158
149
|
queryAssignedNodes({ slot: "prefix" })
|
|
159
150
|
], Input.prototype, "slotPrefixNodes", void 0);
|
|
160
151
|
__decorate([
|
|
161
|
-
query(
|
|
152
|
+
query("input")
|
|
162
153
|
], Input.prototype, "input", void 0);
|
|
163
154
|
__decorate([
|
|
164
155
|
state()
|
|
@@ -15,8 +15,13 @@ export declare class Select extends Select_base {
|
|
|
15
15
|
get value(): string;
|
|
16
16
|
set value(value: string);
|
|
17
17
|
connectedCallback(): void;
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
forceAutoFill: boolean;
|
|
19
|
+
_description?: string;
|
|
20
|
+
get description(): string | undefined;
|
|
21
|
+
set description(value: string | undefined);
|
|
22
|
+
_label?: string;
|
|
23
|
+
get label(): string | undefined;
|
|
24
|
+
set label(value: string | undefined);
|
|
20
25
|
slotLabelNodes: Array<Node>;
|
|
21
26
|
slotDescriptionNodes: Array<Node>;
|
|
22
27
|
slotSuffixNodes: Array<Node>;
|
|
@@ -30,6 +30,11 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
30
30
|
this.multiple = false;
|
|
31
31
|
this._options = [];
|
|
32
32
|
this._value = "";
|
|
33
|
+
/*
|
|
34
|
+
* TODO
|
|
35
|
+
* Mutualiser avec le composant textarea / input
|
|
36
|
+
*/
|
|
37
|
+
this.forceAutoFill = false;
|
|
33
38
|
this.hasDescription = false;
|
|
34
39
|
this.hasLabel = false;
|
|
35
40
|
this.hasSuffix = false;
|
|
@@ -75,6 +80,24 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
75
80
|
});
|
|
76
81
|
}
|
|
77
82
|
}
|
|
83
|
+
get description() {
|
|
84
|
+
return this._description;
|
|
85
|
+
}
|
|
86
|
+
set description(value) {
|
|
87
|
+
if (this.hasAttribute("description") && !this.forceAutoFill)
|
|
88
|
+
value = this.getAttribute("description");
|
|
89
|
+
this._description = value;
|
|
90
|
+
this.requestUpdate();
|
|
91
|
+
}
|
|
92
|
+
get label() {
|
|
93
|
+
return this._label;
|
|
94
|
+
}
|
|
95
|
+
set label(value) {
|
|
96
|
+
if (this.hasAttribute("label") && !this.forceAutoFill)
|
|
97
|
+
value = this.getAttribute("label");
|
|
98
|
+
this._label = value;
|
|
99
|
+
this.requestUpdate();
|
|
100
|
+
}
|
|
78
101
|
updated() {
|
|
79
102
|
var _a, _b, _c, _d;
|
|
80
103
|
this.hasLabel = this.label || ((_a = this.slotLabelNodes) === null || _a === void 0 ? void 0 : _a.length) ? true : false;
|
|
@@ -126,7 +149,7 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
|
126
149
|
})}
|
|
127
150
|
<slot></slot>
|
|
128
151
|
</select>
|
|
129
|
-
<sonic-icon
|
|
152
|
+
<sonic-icon class="select-chevron" name="nav-arrow-down" size="${this.size}"></sonic-icon>
|
|
130
153
|
</div>
|
|
131
154
|
<slot name="suffix" @slotchange=${this.onSlotChange}></slot>
|
|
132
155
|
</div>
|
|
@@ -155,7 +178,7 @@ Select.styles = [
|
|
|
155
178
|
top: 50%;
|
|
156
179
|
pointer-events: none;
|
|
157
180
|
transform: translateY(-50%);
|
|
158
|
-
color:var(--sc-input-color);
|
|
181
|
+
color: var(--sc-input-color);
|
|
159
182
|
}
|
|
160
183
|
|
|
161
184
|
option {
|
|
@@ -163,7 +186,6 @@ Select.styles = [
|
|
|
163
186
|
color: var(--sc-base-content);
|
|
164
187
|
background: var(--sc-base);
|
|
165
188
|
}
|
|
166
|
-
|
|
167
189
|
`,
|
|
168
190
|
];
|
|
169
191
|
__decorate([
|
|
@@ -188,11 +210,14 @@ __decorate([
|
|
|
188
210
|
property()
|
|
189
211
|
], Select.prototype, "value", null);
|
|
190
212
|
__decorate([
|
|
191
|
-
property({ type:
|
|
192
|
-
], Select.prototype, "
|
|
213
|
+
property({ type: Boolean })
|
|
214
|
+
], Select.prototype, "forceAutoFill", void 0);
|
|
193
215
|
__decorate([
|
|
194
|
-
property(
|
|
195
|
-
], Select.prototype, "description",
|
|
216
|
+
property()
|
|
217
|
+
], Select.prototype, "description", null);
|
|
218
|
+
__decorate([
|
|
219
|
+
property()
|
|
220
|
+
], Select.prototype, "label", null);
|
|
196
221
|
__decorate([
|
|
197
222
|
queryAssignedNodes({ slot: "label" })
|
|
198
223
|
], Select.prototype, "slotLabelNodes", void 0);
|
|
@@ -2,7 +2,13 @@ import { LitElement } from "lit";
|
|
|
2
2
|
declare const Textarea_base: {
|
|
3
3
|
new (...args: any[]): {
|
|
4
4
|
validateFormElement(): void;
|
|
5
|
+
forceAutoFill: boolean;
|
|
6
|
+
_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
7
|
type: "number" | "search" | "file" | "button" | "password" | "url" | "color" | "hidden" | "time" | "image" | "text" | "reset" | "submit" | "month" | "week" | "checkbox" | "radio" | "range" | "tel" | "email" | "date" | "datetime-local";
|
|
8
|
+
_description?: string | undefined;
|
|
9
|
+
description: string | undefined;
|
|
10
|
+
_label?: string | undefined;
|
|
11
|
+
label: string | undefined;
|
|
6
12
|
tabindex?: number | undefined;
|
|
7
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;
|
|
8
14
|
getFormPublisher(): any;
|
|
@@ -53,8 +59,6 @@ export declare class Textarea extends Textarea_base {
|
|
|
53
59
|
wrap?: "hard" | "soft";
|
|
54
60
|
readonly: boolean;
|
|
55
61
|
placeholder?: string;
|
|
56
|
-
label?: string;
|
|
57
|
-
description?: string;
|
|
58
62
|
slotLabelNodes: Array<Node>;
|
|
59
63
|
slotDescriptionNodes: Array<Node>;
|
|
60
64
|
slotSuffixNodes: Array<Node>;
|
|
@@ -70,7 +70,8 @@ let Textarea = class Textarea extends FormInput(FormElement(Subscriber(LitElemen
|
|
|
70
70
|
wrap=${ifDefined(this.wrap)}
|
|
71
71
|
placeholder="${this.placeholder}"
|
|
72
72
|
class="form-element textarea custom-scroll"
|
|
73
|
-
|
|
73
|
+
>
|
|
74
|
+
${this.value}</textarea
|
|
74
75
|
>
|
|
75
76
|
</div>
|
|
76
77
|
|
|
@@ -113,12 +114,6 @@ __decorate([
|
|
|
113
114
|
__decorate([
|
|
114
115
|
property({ type: String })
|
|
115
116
|
], Textarea.prototype, "placeholder", void 0);
|
|
116
|
-
__decorate([
|
|
117
|
-
property({ type: String })
|
|
118
|
-
], Textarea.prototype, "label", void 0);
|
|
119
|
-
__decorate([
|
|
120
|
-
property({ type: String })
|
|
121
|
-
], Textarea.prototype, "description", void 0);
|
|
122
117
|
__decorate([
|
|
123
118
|
queryAssignedNodes({ slot: "label" })
|
|
124
119
|
], Textarea.prototype, "slotLabelNodes", void 0);
|
|
@@ -10,6 +10,7 @@ import { repeat } from "lit/directives/repeat.js";
|
|
|
10
10
|
import "@supersoniks/concorde/core/components/ui/icon/icon";
|
|
11
11
|
import "@supersoniks/concorde/core/components/ui/badge/badge";
|
|
12
12
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
13
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
13
14
|
const tagName = "sonic-taxonomy";
|
|
14
15
|
/**
|
|
15
16
|
* Le composant taxonomy crée un badge (*sonic-badge*) contenant une liste de termes préfixés par une icone (*sonic-icon*) optionelle séparées par une chaine html séparatrice (*separator*)
|
|
@@ -61,7 +62,7 @@ let Taxonomy = class Taxonomy extends LitElement {
|
|
|
61
62
|
this.style.removeProperty("display");
|
|
62
63
|
return html `
|
|
63
64
|
<sonic-badge type=${this.type} variant=${this.variant} size=${this.size}>
|
|
64
|
-
<sonic-icon slot="prefix"
|
|
65
|
+
<sonic-icon slot="prefix" library=${ifDefined(this.icon.library)} prefix=${ifDefined(this.icon.prefix)} name=${ifDefined(this.icon.name)} ></sonic-icon>
|
|
65
66
|
<span class="taxonomy-list">
|
|
66
67
|
${repeat(taxo, (item) => item[this.key + "_id"], (item) => {
|
|
67
68
|
return html `<span> ${item[this.key + "_name"]}</span
|
|
File without changes
|
|
File without changes
|
|
@@ -5,11 +5,15 @@ 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
|
var Theme_1;
|
|
8
|
-
import { html, LitElement, css } from "lit";
|
|
8
|
+
import { html, LitElement, css, unsafeCSS } from "lit";
|
|
9
9
|
import { customElement, property } from "lit/decorators.js";
|
|
10
10
|
import { coreVariables } from "@supersoniks/concorde/core/components/ui/theme/theme-collection/core-variables";
|
|
11
11
|
import { light } from "@supersoniks/concorde/core/components/ui/theme/theme-collection/light";
|
|
12
12
|
import { dark } from "@supersoniks/concorde/core/components/ui/theme/theme-collection/dark";
|
|
13
|
+
import tailwindImport from "./css/tailwind.css?inline";
|
|
14
|
+
export const tailwind = css `
|
|
15
|
+
${unsafeCSS(tailwindImport)}
|
|
16
|
+
`;
|
|
13
17
|
const tagName = "sonic-theme";
|
|
14
18
|
let Theme = Theme_1 = class Theme extends LitElement {
|
|
15
19
|
constructor() {
|
|
@@ -46,7 +46,7 @@ let SonicToastItem = class SonicToastItem extends LitElement {
|
|
|
46
46
|
>
|
|
47
47
|
|
|
48
48
|
<button aria-label="Close" class="sonic-toast-close" @click=${() => this.hide()}>
|
|
49
|
-
|
|
49
|
+
<sonic-icon name="cancel" size="lg"></sonic-icon>
|
|
50
50
|
</button>
|
|
51
51
|
<div class="sonic-toast-content custom-scroll" style="max-height: ${this.maxHeight} ;">
|
|
52
52
|
|
|
@@ -55,8 +55,8 @@ let SonicToastItem = class SonicToastItem extends LitElement {
|
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
<div class="sonic-toast-text">
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
${this.title ? html `<div class="sonic-toast-title">${this.title}</div>` : ""}
|
|
59
|
+
${this.text ? unsafeHTML(this.text) : ""}
|
|
60
60
|
<slot></slot>
|
|
61
61
|
</div>
|
|
62
62
|
|
|
@@ -136,15 +136,32 @@ SonicToastItem.styles = [
|
|
|
136
136
|
margin-top: auto;
|
|
137
137
|
margin-bottom: auto;
|
|
138
138
|
max-width:70ch;
|
|
139
|
+
line-height: 1.2;
|
|
139
140
|
}
|
|
140
141
|
|
|
141
|
-
::slotted(a),
|
|
142
|
+
::slotted(a:not(.btn)),
|
|
142
143
|
.sonic-toast-text a {
|
|
143
|
-
color: inherit;
|
|
144
|
-
text-decoration: underline;
|
|
144
|
+
color: inherit !important;
|
|
145
|
+
text-decoration: underline !important;
|
|
145
146
|
text-underline-offset: 0.15rem;
|
|
146
147
|
}
|
|
147
148
|
|
|
149
|
+
::slotted(:is(p, ul, ol, hr, h1, h2, h3, h4, h5, h6)),
|
|
150
|
+
.sonic-toast-text :is(p, ul, ol, hr, h1, h2, h3, h4, h5, h6) {
|
|
151
|
+
margin: 0 0 0.3em !important;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
::slotted(li),
|
|
155
|
+
.sonic-toast-text li {
|
|
156
|
+
margin-bottom: .15em !important;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
::slotted( :is(p, ul, ol, hr, h1, h2, h3, h4, h5, h6):last-child),
|
|
160
|
+
.sonic-toast-text > :is(p, ul, ol, hr, h1, h2, h3, h4, h5, h6):last-child {
|
|
161
|
+
margin-bottom: 0 !important;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
|
|
148
165
|
/*BUTTON CLOSE*/
|
|
149
166
|
.sonic-toast-close {
|
|
150
167
|
all: unset;
|
|
@@ -183,6 +200,7 @@ SonicToastItem.styles = [
|
|
|
183
200
|
font-weight: bold;
|
|
184
201
|
font-size: 1.15rem;
|
|
185
202
|
margin: 0.15em 0 0.25em;
|
|
203
|
+
line-height: 1.2;
|
|
186
204
|
}
|
|
187
205
|
|
|
188
206
|
/*STATUS*/
|
|
@@ -10,6 +10,7 @@ import { repeat } from "lit/directives/repeat.js";
|
|
|
10
10
|
import { animate } from "@lit-labs/motion";
|
|
11
11
|
import Objects from "@supersoniks/concorde/core/utils/Objects";
|
|
12
12
|
import "@supersoniks/concorde/core/components/ui/icon/icon";
|
|
13
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
13
14
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
14
15
|
import { styleMap } from "lit/directives/style-map.js";
|
|
15
16
|
import "@supersoniks/concorde/core/components/ui/toast/toast-item";
|
|
@@ -39,10 +40,12 @@ let SonicToast = class SonicToast extends LitElement {
|
|
|
39
40
|
return html `<div aria-live="polite" style=${styleMap(styles)}>
|
|
40
41
|
${repeat(this.toasts, (item) => item.id, (item) => html `
|
|
41
42
|
<sonic-toast-item maxHeight=${isIframe ? 'none' : '10rem'}
|
|
42
|
-
status=${item.status}
|
|
43
|
+
status=${ifDefined(item.status)}
|
|
44
|
+
title=${ifDefined(item.title)}
|
|
43
45
|
?ghost=${item.ghost}
|
|
44
46
|
?dismissForever=${item.dismissForever}
|
|
45
|
-
?preserve=${item.preserve}
|
|
47
|
+
?preserve=${item.preserve}
|
|
48
|
+
id=${ifDefined(item.id)}
|
|
46
49
|
@hide=${() => this.removeItem(item)}
|
|
47
50
|
${animate({
|
|
48
51
|
keyframeOptions: {
|
|
@@ -61,6 +64,7 @@ let SonicToast = class SonicToast extends LitElement {
|
|
|
61
64
|
stabilizeOut: true,
|
|
62
65
|
})}
|
|
63
66
|
>
|
|
67
|
+
<!-- Le texte est passé dans le slot et non pas en propriété pour contrer des problèmatiques de shadow-dom et d'appel exterieur (exemple: fancybox) -->
|
|
64
68
|
${item.text ? unsafeHTML(item.text) : ""}
|
|
65
69
|
</sonic-toast-item>
|
|
66
70
|
`)}
|
package/core/components/ui/ui.js
CHANGED
package/core/mixins/Fetcher.js
CHANGED
|
@@ -86,6 +86,7 @@ const Fetcher = (superClass) => {
|
|
|
86
86
|
Loader.show();
|
|
87
87
|
let headerData = PublisherManager.getInstance().get(this.getAncestorAttributeValue("headersDataProvider")).get();
|
|
88
88
|
data = yield this.api.get(this.endPoint || this.dataProvider || "", headerData);
|
|
89
|
+
// Je garde ça mais normalement ça n'arrive jamais
|
|
89
90
|
if (!data) {
|
|
90
91
|
SonicToast.add({ text: "Network Error", status: "error" });
|
|
91
92
|
this.isLoading = false;
|
|
@@ -96,7 +97,10 @@ const Fetcher = (superClass) => {
|
|
|
96
97
|
if (hasLoader)
|
|
97
98
|
Loader.hide();
|
|
98
99
|
if (this.key) {
|
|
100
|
+
let response = data._sonic_http_response_;
|
|
99
101
|
data = Objects.traverse(data, this.key.split("."), false);
|
|
102
|
+
if (data)
|
|
103
|
+
data._sonic_http_response_ = response;
|
|
100
104
|
}
|
|
101
105
|
this.props = data;
|
|
102
106
|
this.dispatchEvent(new CustomEvent("load", { detail: this }));
|
|
@@ -7,11 +7,7 @@ declare const Form: <T extends Constructor<FormElementInterface>>(superClass: T)
|
|
|
7
7
|
*/
|
|
8
8
|
_value: string | null;
|
|
9
9
|
value: string | null;
|
|
10
|
-
|
|
11
|
-
* Voir la mixin FormElement
|
|
12
|
-
*/
|
|
13
|
-
_name: string;
|
|
14
|
-
name: string;
|
|
10
|
+
forceAutoFill: boolean;
|
|
15
11
|
/**
|
|
16
12
|
* comme radio,mais peut être désélectionné après sélection
|
|
17
13
|
*/
|
|
@@ -48,6 +44,8 @@ declare const Form: <T extends Constructor<FormElementInterface>>(superClass: T)
|
|
|
48
44
|
required: boolean;
|
|
49
45
|
disabled: true | null;
|
|
50
46
|
formDataProvider: string;
|
|
47
|
+
_name: string;
|
|
48
|
+
name: string;
|
|
51
49
|
props: any;
|
|
52
50
|
isConnected: boolean;
|
|
53
51
|
getAncestorAttributeValue(attributeName: string): string;
|
|
@@ -68,9 +66,6 @@ declare const Form: <T extends Constructor<FormElementInterface>>(superClass: T)
|
|
|
68
66
|
requestUpdate(): void;
|
|
69
67
|
getAttribute(name: string): string;
|
|
70
68
|
hasAttribute(attributeName: String): boolean;
|
|
71
|
-
/**
|
|
72
|
-
* comme radio,mais peut être désélectionné après sélection
|
|
73
|
-
*/
|
|
74
69
|
disconnectedCallback(): void;
|
|
75
70
|
};
|
|
76
71
|
} & T;
|
|
@@ -21,10 +21,7 @@ const Form = (superClass) => {
|
|
|
21
21
|
* Voir la mixin FormElement.
|
|
22
22
|
*/
|
|
23
23
|
this._value = "";
|
|
24
|
-
|
|
25
|
-
* Voir la mixin FormElement
|
|
26
|
-
*/
|
|
27
|
-
this._name = "";
|
|
24
|
+
this.forceAutoFill = false;
|
|
28
25
|
/**
|
|
29
26
|
* comme radio,mais peut être désélectionné après sélection
|
|
30
27
|
*/
|
|
@@ -42,7 +39,7 @@ const Form = (superClass) => {
|
|
|
42
39
|
return this._value;
|
|
43
40
|
}
|
|
44
41
|
set value(value) {
|
|
45
|
-
if (this.hasAttribute("value"))
|
|
42
|
+
if (this.hasAttribute("value") && !this.forceAutoFill)
|
|
46
43
|
value = this.getAttribute("value");
|
|
47
44
|
if (this._value == value)
|
|
48
45
|
return;
|
|
@@ -50,14 +47,6 @@ const Form = (superClass) => {
|
|
|
50
47
|
this.updateDataValue();
|
|
51
48
|
this.requestUpdate();
|
|
52
49
|
}
|
|
53
|
-
get name() {
|
|
54
|
-
return this._name;
|
|
55
|
-
}
|
|
56
|
-
set name(value) {
|
|
57
|
-
if (this.hasAttribute("name"))
|
|
58
|
-
value = this.getAttribute("name");
|
|
59
|
-
this._name = value;
|
|
60
|
-
}
|
|
61
50
|
get checked() {
|
|
62
51
|
return this._checked;
|
|
63
52
|
}
|
|
@@ -71,7 +60,7 @@ const Form = (superClass) => {
|
|
|
71
60
|
if (!input || input.checkValidity())
|
|
72
61
|
return;
|
|
73
62
|
let value = this.getFormPublisher()[this.name].get();
|
|
74
|
-
if ((this.unique || this.radio) &&
|
|
63
|
+
if ((this.unique || this.radio) && value !== null && value.toString().length > 0)
|
|
75
64
|
return;
|
|
76
65
|
this.getFormPublisher().isFormValid = false;
|
|
77
66
|
input.reportValidity();
|
|
@@ -144,7 +133,7 @@ const Form = (superClass) => {
|
|
|
144
133
|
], FormCheckable.prototype, "value", null);
|
|
145
134
|
__decorate([
|
|
146
135
|
property()
|
|
147
|
-
], FormCheckable.prototype, "
|
|
136
|
+
], FormCheckable.prototype, "forceAutoFill", void 0);
|
|
148
137
|
__decorate([
|
|
149
138
|
property({ type: Boolean })
|
|
150
139
|
], FormCheckable.prototype, "unique", void 0);
|
|
@@ -24,6 +24,7 @@ const Form = (superClass) => {
|
|
|
24
24
|
this.error = false;
|
|
25
25
|
this.autofocus = false;
|
|
26
26
|
this.required = false;
|
|
27
|
+
this.forceAutoFill = false;
|
|
27
28
|
this.disabled = null;
|
|
28
29
|
this.onValueAssign = null;
|
|
29
30
|
this.onFormValueAssign = null;
|
|
@@ -55,7 +56,10 @@ const Form = (superClass) => {
|
|
|
55
56
|
return this._name;
|
|
56
57
|
}
|
|
57
58
|
set name(value) {
|
|
59
|
+
if (this.hasAttribute("name") && !this.forceAutoFill)
|
|
60
|
+
value = this.getAttribute("name");
|
|
58
61
|
this._name = value;
|
|
62
|
+
this.requestUpdate();
|
|
59
63
|
}
|
|
60
64
|
validateFormElement() { }
|
|
61
65
|
updateDataValue() {
|
|
@@ -235,6 +239,9 @@ const Form = (superClass) => {
|
|
|
235
239
|
__decorate([
|
|
236
240
|
property({ type: Boolean })
|
|
237
241
|
], FormElement.prototype, "required", void 0);
|
|
242
|
+
__decorate([
|
|
243
|
+
property()
|
|
244
|
+
], FormElement.prototype, "forceAutoFill", void 0);
|
|
238
245
|
__decorate([
|
|
239
246
|
property({ type: Boolean })
|
|
240
247
|
], FormElement.prototype, "disabled", void 0);
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { FormElementInterface } from "@supersoniks/concorde/core/mixins/FormElement";
|
|
2
2
|
declare type Constructor<T> = new (...args: any[]) => T;
|
|
3
|
+
declare type Type = "button" | "checkbox" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "image" | "month" | "number" | "password" | "radio" | "range" | "reset" | "search" | "submit" | "tel" | "text" | "time" | "url" | "week";
|
|
3
4
|
declare const Form: <T extends Constructor<FormElementInterface>>(superClass: T) => {
|
|
4
5
|
new (...args: any[]): {
|
|
5
6
|
validateFormElement(): void;
|
|
7
|
+
forceAutoFill: boolean;
|
|
6
8
|
/**
|
|
7
9
|
* Le type De l'input, comme en html cependant tous les types ne sont pas actuellements compatibles en raison du style en vigueur
|
|
8
10
|
* On peut essayer text, date, color, email par exemple, mais pas radio/checkbox/range a priori
|
|
9
11
|
*/
|
|
10
|
-
|
|
12
|
+
_type: Type;
|
|
13
|
+
type: Type;
|
|
14
|
+
_description?: string | undefined;
|
|
15
|
+
description: string | undefined;
|
|
16
|
+
_label?: string | undefined;
|
|
17
|
+
label: string | undefined;
|
|
11
18
|
tabindex?: number | undefined;
|
|
12
19
|
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;
|
|
13
20
|
getFormPublisher(): any;
|
|
@@ -20,20 +27,12 @@ declare const Form: <T extends Constructor<FormElementInterface>>(superClass: T)
|
|
|
20
27
|
required: boolean;
|
|
21
28
|
disabled: true | null;
|
|
22
29
|
formDataProvider: string;
|
|
23
|
-
/**
|
|
24
|
-
* Le type De l'input, comme en html cependant tous les types ne sont pas actuellements compatibles en raison du style en vigueur
|
|
25
|
-
* On peut essayer text, date, color, email par exemple, mais pas radio/checkbox/range a priori
|
|
26
|
-
*/
|
|
27
30
|
_value: any;
|
|
28
31
|
value: any;
|
|
29
32
|
_name: string;
|
|
30
33
|
name: string;
|
|
31
34
|
props: any;
|
|
32
35
|
isConnected: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Le type De l'input, comme en html cependant tous les types ne sont pas actuellements compatibles en raison du style en vigueur
|
|
35
|
-
* On peut essayer text, date, color, email par exemple, mais pas radio/checkbox/range a priori
|
|
36
|
-
*/
|
|
37
36
|
getAncestorAttributeValue(attributeName: string): string;
|
|
38
37
|
hasAncestorAttribute(attributeName: string): boolean;
|
|
39
38
|
querySelectorAll(selector: string): NodeListOf<Element>;
|