@supersoniks/concorde 1.1.45 → 1.1.47
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 +36 -23
- package/concorde-core.es.js +1156 -864
- package/concorde-customer.bundle.js +129 -0
- package/concorde-customer.es.js +22004 -0
- package/core/_types/types.d.ts +0 -1
- package/core/components/functional/date/date.js +15 -7
- package/core/components/functional/fetch/fetch.d.ts +3 -1
- package/core/components/functional/list/list.d.ts +36 -19
- package/core/components/functional/list/list.js +15 -23
- package/core/components/functional/queue/queue.d.ts +6 -1
- package/core/components/functional/queue/queue.js +92 -54
- package/core/components/functional/sdui/sdui.d.ts +3 -4
- package/core/components/functional/sdui/sdui.js +0 -3
- package/core/components/ui/_css/type.js +12 -12
- package/core/components/ui/alert/alert.d.ts +3 -0
- package/core/components/ui/alert/alert.js +33 -1
- package/core/components/ui/badge/badge.d.ts +1 -1
- package/core/components/ui/badge/badge.js +9 -3
- package/core/components/ui/button/button.d.ts +2 -0
- package/core/components/ui/button/button.js +37 -12
- package/core/components/ui/form/checkbox/checkbox.d.ts +3 -0
- package/core/components/ui/form/checkbox/checkbox.js +14 -3
- package/core/components/ui/form/css/form-control.d.ts +1 -0
- package/core/components/ui/form/css/form-control.js +17 -0
- package/core/components/ui/form/input/input.d.ts +4 -3
- package/core/components/ui/form/input/input.js +38 -1
- package/core/components/ui/form/textarea/textarea.d.ts +1 -0
- package/core/components/ui/icon/icon.js +1 -1
- package/core/components/ui/image/image.d.ts +2 -0
- package/core/components/ui/image/image.js +28 -0
- package/core/components/ui/modal/modal-close.js +2 -3
- package/core/components/ui/modal/modal-content.js +1 -0
- package/core/components/ui/modal/modal.d.ts +8 -0
- package/core/components/ui/modal/modal.js +34 -6
- package/core/components/ui/pop/pop.js +1 -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-collection/core-variables.js +18 -9
- package/core/components/ui/theme/theme.js +15 -8
- package/core/components/ui/toast/toast.d.ts +1 -1
- package/core/components/ui/toast/types.d.ts +1 -1
- package/core/components/ui/ui.d.ts +0 -1
- package/core/components/ui/ui.js +0 -1
- package/core/mixins/Fetcher.d.ts +3 -1
- package/core/mixins/Fetcher.js +45 -14
- package/core/mixins/FormCheckable.d.ts +1 -0
- package/core/mixins/FormInput.d.ts +1 -0
- package/core/mixins/Subscriber.d.ts +1 -0
- package/core/mixins/Subscriber.js +12 -7
- package/core/utils/LocationHandler.js +9 -3
- package/core/utils/PublisherProxy.d.ts +30 -4
- package/core/utils/PublisherProxy.js +218 -7
- package/core/utils/api.d.ts +3 -0
- package/core/utils/api.js +3 -1
- 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 -1
- package/package.json +5 -1
- package/svg/regular/plane.svg +0 -0
- package/svg/solid/plane.svg +0 -0
|
@@ -27,22 +27,34 @@ let Alert = class Alert extends LitElement {
|
|
|
27
27
|
* Titre du message d'erreur
|
|
28
28
|
*/
|
|
29
29
|
this.label = "";
|
|
30
|
+
this.noIcon = false;
|
|
30
31
|
/**
|
|
31
32
|
* Peut être renseigné dans le slot pour créer des messages plus complexes
|
|
32
33
|
*/
|
|
33
34
|
this.text = "";
|
|
35
|
+
this.dismissible = false;
|
|
34
36
|
this.background = false;
|
|
35
37
|
this.status = "default";
|
|
36
38
|
}
|
|
37
39
|
render() {
|
|
38
40
|
return html `<div part="alert" class="alert">
|
|
39
|
-
|
|
41
|
+
${!this.noIcon
|
|
42
|
+
? html `<div>${this.status && html `<sonic-icon name=${icon[this.status]}></sonic-icon>`}</div>`
|
|
43
|
+
: nothing}
|
|
40
44
|
<div>
|
|
41
45
|
${this.label ? html `<span class="label">${unsafeHTML(this.label)}</span>` : nothing}
|
|
42
46
|
<slot>${this.text}</slot>
|
|
43
47
|
</div>
|
|
48
|
+
${this.dismissible
|
|
49
|
+
? html `<sonic-button @click=${this.close} class="close-btn" variant="unstyled" shape="circle">
|
|
50
|
+
<sonic-icon name="cancel" size="lg"></sonic-icon>
|
|
51
|
+
</sonic-button>`
|
|
52
|
+
: nothing}
|
|
44
53
|
</div>`;
|
|
45
54
|
}
|
|
55
|
+
close() {
|
|
56
|
+
this.remove();
|
|
57
|
+
}
|
|
46
58
|
};
|
|
47
59
|
Alert.styles = [
|
|
48
60
|
fontSize,
|
|
@@ -84,10 +96,12 @@ Alert.styles = [
|
|
|
84
96
|
}
|
|
85
97
|
|
|
86
98
|
/*background*/
|
|
99
|
+
:host([dismissible]) .alert,
|
|
87
100
|
:host([background]) .alert {
|
|
88
101
|
background: var(--sc-base);
|
|
89
102
|
padding: 0.8em 1.15em;
|
|
90
103
|
}
|
|
104
|
+
:host([dismissible]) .alert:before,
|
|
91
105
|
:host([background]) .alert:before {
|
|
92
106
|
background-color: currentColor;
|
|
93
107
|
content: "";
|
|
@@ -101,6 +115,7 @@ Alert.styles = [
|
|
|
101
115
|
border-radius: var(--sc-alert-rounded);
|
|
102
116
|
pointer-events: none;
|
|
103
117
|
}
|
|
118
|
+
:host([dismissible]) > div,
|
|
104
119
|
:host([background]) > div {
|
|
105
120
|
z-index: 2;
|
|
106
121
|
position: relative;
|
|
@@ -117,17 +132,34 @@ Alert.styles = [
|
|
|
117
132
|
:host([size="sm"]) .alert {
|
|
118
133
|
--sc-alert-rounded: var(--sc-rounded-sm);
|
|
119
134
|
}
|
|
135
|
+
|
|
136
|
+
/*Dismissible*/
|
|
137
|
+
:host([dismissible]) .alert {
|
|
138
|
+
padding-right: 3rem;
|
|
139
|
+
}
|
|
140
|
+
:host([dismissible]) .close-btn {
|
|
141
|
+
padding: 0.5em;
|
|
142
|
+
position: absolute;
|
|
143
|
+
top: 0.25rem;
|
|
144
|
+
right: 0.25rem;
|
|
145
|
+
}
|
|
120
146
|
`,
|
|
121
147
|
];
|
|
122
148
|
__decorate([
|
|
123
149
|
property({ type: String })
|
|
124
150
|
], Alert.prototype, "label", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
property({ type: Boolean, reflect: true })
|
|
153
|
+
], Alert.prototype, "noIcon", void 0);
|
|
125
154
|
__decorate([
|
|
126
155
|
property({ type: String })
|
|
127
156
|
], Alert.prototype, "text", void 0);
|
|
128
157
|
__decorate([
|
|
129
158
|
property({ type: String, reflect: true })
|
|
130
159
|
], Alert.prototype, "size", void 0);
|
|
160
|
+
__decorate([
|
|
161
|
+
property({ type: Boolean, reflect: true })
|
|
162
|
+
], Alert.prototype, "dismissible", void 0);
|
|
131
163
|
__decorate([
|
|
132
164
|
property({ type: Boolean, reflect: true })
|
|
133
165
|
], Alert.prototype, "background", void 0);
|
|
@@ -10,7 +10,7 @@ export declare class Badge extends LitElement {
|
|
|
10
10
|
/**
|
|
11
11
|
* Le type change surtout la couleur composant
|
|
12
12
|
*/
|
|
13
|
-
type: "default" | "primary" | "warning" | "danger" | "success" | "info";
|
|
13
|
+
type: "default" | "primary" | "warning" | "danger" | "success" | "info" | "neutral";
|
|
14
14
|
/**
|
|
15
15
|
* Le composant par defaut sans se paramètre à forte afordance
|
|
16
16
|
* * gost : composant super léger visuellement
|
|
@@ -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 } from "lit/decorators.js";
|
|
9
|
-
import { fontSize } from "@supersoniks/concorde/core/components/ui/_css/size";
|
|
9
|
+
import { fontSize, } from "@supersoniks/concorde/core/components/ui/_css/size";
|
|
10
10
|
const tagName = "sonic-badge";
|
|
11
11
|
/**
|
|
12
12
|
* Un badge simple avec deux slots, un nommé prefix et un nomé suffix de manière à pouvoir mettre (par exemple) une icone avant ou après le contenu.
|
|
@@ -50,9 +50,10 @@ Badge.styles = [
|
|
|
50
50
|
|
|
51
51
|
--sc-badge-border-with: var(--sc-form-border-width, 0.1rem);
|
|
52
52
|
--sc-badge-border-color: transparent;
|
|
53
|
-
--sc-badge-border: var(--sc-badge-border-with) solid
|
|
53
|
+
--sc-badge-border: var(--sc-badge-border-with) solid
|
|
54
|
+
var(--sc-badge-border-color);
|
|
54
55
|
|
|
55
|
-
--sc-badge-rounded:
|
|
56
|
+
--sc-badge-rounded: 0.85em;
|
|
56
57
|
--sc-badge-fw: var(--sc-font-weight-base);
|
|
57
58
|
|
|
58
59
|
display: inline-flex;
|
|
@@ -129,6 +130,11 @@ Badge.styles = [
|
|
|
129
130
|
--sc-badge-gap: 0.5em;
|
|
130
131
|
}
|
|
131
132
|
|
|
133
|
+
:host([contrast]) {
|
|
134
|
+
--sc-badge-color: var(--sc-contrast-content);
|
|
135
|
+
--sc-badge-bg: var(--sc-contrast);
|
|
136
|
+
}
|
|
137
|
+
|
|
132
138
|
/*OUTLINE*/
|
|
133
139
|
:host([variant="outline"][type]) {
|
|
134
140
|
border-width: var(--sc-badge-border-with) !important;
|
|
@@ -58,6 +58,7 @@ declare const Button_base: {
|
|
|
58
58
|
requestUpdate(): void;
|
|
59
59
|
getAttribute(name: string): string;
|
|
60
60
|
hasAttribute(attributeName: string): boolean;
|
|
61
|
+
getBoundingClientRect(): DOMRect;
|
|
61
62
|
};
|
|
62
63
|
} & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("../../../_types/types").CoreJSType>) & typeof LitElement;
|
|
63
64
|
/**
|
|
@@ -150,6 +151,7 @@ export declare class Button extends Button_base {
|
|
|
150
151
|
private _location;
|
|
151
152
|
get location(): string;
|
|
152
153
|
set location(value: string);
|
|
154
|
+
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
153
155
|
render(): import("lit-html").TemplateResult<1>;
|
|
154
156
|
onSlotChange(): void;
|
|
155
157
|
}
|
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import LocationHandler from "@supersoniks/concorde/core/utils/LocationHandler";
|
|
8
8
|
import { html, LitElement, css } from "lit";
|
|
9
|
-
import { customElement, property, queryAssignedElements, state } from "lit/decorators.js";
|
|
9
|
+
import { customElement, property, queryAssignedElements, state, } from "lit/decorators.js";
|
|
10
10
|
import { styleMap } from "lit/directives/style-map.js";
|
|
11
11
|
import FormElement from "@supersoniks/concorde/core/mixins/FormElement";
|
|
12
12
|
import FormCheckable from "@supersoniks/concorde/core/mixins/FormCheckable";
|
|
@@ -88,7 +88,6 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
|
|
|
88
88
|
this._href = value;
|
|
89
89
|
if (this.href && this.href.indexOf("http") != 0) {
|
|
90
90
|
LocationHandler.onChange(this);
|
|
91
|
-
this.location = document.location.href.replace(document.location.origin, "");
|
|
92
91
|
}
|
|
93
92
|
else
|
|
94
93
|
LocationHandler.offChange(this);
|
|
@@ -113,7 +112,9 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
|
|
|
113
112
|
* On on veut pouvoir rest un autre form que celui qui contient le bouton
|
|
114
113
|
*/
|
|
115
114
|
const resetDataProvider = this.getAttribute("reset");
|
|
116
|
-
const formPublisher = resetDataProvider
|
|
115
|
+
const formPublisher = resetDataProvider
|
|
116
|
+
? PublisherManager.get(resetDataProvider)
|
|
117
|
+
: this.getFormPublisher();
|
|
117
118
|
if (formPublisher)
|
|
118
119
|
formPublisher.set({});
|
|
119
120
|
}
|
|
@@ -141,7 +142,14 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
|
|
|
141
142
|
}
|
|
142
143
|
set location(value) {
|
|
143
144
|
this._location = value;
|
|
144
|
-
|
|
145
|
+
this.requestUpdate();
|
|
146
|
+
}
|
|
147
|
+
updated(changedProperties) {
|
|
148
|
+
if (changedProperties.has("location") ||
|
|
149
|
+
changedProperties.has("href") ||
|
|
150
|
+
changedProperties.has("autoActive")) {
|
|
151
|
+
LocationHandler.updateComponentActiveState(this);
|
|
152
|
+
}
|
|
145
153
|
}
|
|
146
154
|
render() {
|
|
147
155
|
const btnStyles = {
|
|
@@ -160,10 +168,20 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
|
|
|
160
168
|
aria-labelledby=${ifDefined(this.ariaLabelledby)}
|
|
161
169
|
@click=${this.handleChange}
|
|
162
170
|
>
|
|
163
|
-
<slot
|
|
171
|
+
<slot
|
|
172
|
+
@slotchange=${this.onSlotChange}
|
|
173
|
+
part="prefix"
|
|
174
|
+
name="prefix"
|
|
175
|
+
></slot>
|
|
164
176
|
<slot part="main" class="main-slot"></slot>
|
|
165
|
-
<slot
|
|
166
|
-
|
|
177
|
+
<slot
|
|
178
|
+
@slotchange=${this.onSlotChange}
|
|
179
|
+
part="suffix"
|
|
180
|
+
name="suffix"
|
|
181
|
+
></slot>
|
|
182
|
+
${this.loading == true
|
|
183
|
+
? html `<sonic-icon name="loader" class="loader"></sonic-icon>`
|
|
184
|
+
: ""}
|
|
167
185
|
</button>
|
|
168
186
|
`;
|
|
169
187
|
return this.href
|
|
@@ -172,7 +190,9 @@ let Button = class Button extends FormCheckable(FormElement(Subscriber(LitElemen
|
|
|
172
190
|
target=${ifDefined(this.target)}
|
|
173
191
|
aria-label=${ifDefined(this.ariaLabel)}
|
|
174
192
|
aria-labelledby=${ifDefined(this.ariaLabelledby)}
|
|
175
|
-
@click=${this.pushState || this.goBack !== null
|
|
193
|
+
@click=${this.pushState || this.goBack !== null
|
|
194
|
+
? this.handleNavigation
|
|
195
|
+
: null}
|
|
176
196
|
>${btn}</a
|
|
177
197
|
>`
|
|
178
198
|
: html `${btn}`;
|
|
@@ -205,7 +225,10 @@ Button.styles = [
|
|
|
205
225
|
--sc-btn-border-width: var(--sc-form-border-width);
|
|
206
226
|
--sc-btn-border-color: transparent;
|
|
207
227
|
|
|
208
|
-
--btn-outline-bg-hover: var(
|
|
228
|
+
--btn-outline-bg-hover: var(
|
|
229
|
+
--sc-btn-outline-bg-hover,
|
|
230
|
+
var(--sc-base-100)
|
|
231
|
+
);
|
|
209
232
|
--sc-btn-ghost-bg-hover: var(--sc-base-100);
|
|
210
233
|
|
|
211
234
|
--sc-btn-active-color: var(--sc-base);
|
|
@@ -243,8 +266,8 @@ Button.styles = [
|
|
|
243
266
|
cursor: pointer;
|
|
244
267
|
text-align: center;
|
|
245
268
|
line-height: 1.1;
|
|
246
|
-
border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr)
|
|
247
|
-
var(--sc-item-rounded-bl);
|
|
269
|
+
border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr)
|
|
270
|
+
var(--sc-item-rounded-br) var(--sc-item-rounded-bl);
|
|
248
271
|
|
|
249
272
|
background: var(--btn-bg);
|
|
250
273
|
color: var(--btn-color);
|
|
@@ -254,7 +277,8 @@ Button.styles = [
|
|
|
254
277
|
padding-left: var(--sc-btn-px);
|
|
255
278
|
padding-right: var(--sc-btn-px);
|
|
256
279
|
|
|
257
|
-
border: var(--sc-btn-border-width) var(--sc-btn-border-style)
|
|
280
|
+
border: var(--sc-btn-border-width) var(--sc-btn-border-style)
|
|
281
|
+
var(--sc-btn-border-color);
|
|
258
282
|
min-height: var(--sc-btn-height);
|
|
259
283
|
}
|
|
260
284
|
|
|
@@ -471,6 +495,7 @@ Button.styles = [
|
|
|
471
495
|
/*BOUTON Avec icone seulement*/
|
|
472
496
|
:host([icon]) ::slotted(sonic-icon) {
|
|
473
497
|
font-size: 1.2em;
|
|
498
|
+
vertical-align: middle;
|
|
474
499
|
}
|
|
475
500
|
|
|
476
501
|
/*Tooltip ne joue pas sur le layout*/
|
|
@@ -59,6 +59,7 @@ declare const Checkbox_base: {
|
|
|
59
59
|
requestUpdate(): void;
|
|
60
60
|
getAttribute(name: string): string;
|
|
61
61
|
hasAttribute(attributeName: string): boolean;
|
|
62
|
+
getBoundingClientRect(): DOMRect;
|
|
62
63
|
};
|
|
63
64
|
} & {
|
|
64
65
|
new (...args: any[]): {
|
|
@@ -136,6 +137,7 @@ declare const Checkbox_base: {
|
|
|
136
137
|
getAttribute(name: string): string;
|
|
137
138
|
hasAttribute(attributeName: string): boolean;
|
|
138
139
|
disconnectedCallback(): void;
|
|
140
|
+
getBoundingClientRect(): DOMRect;
|
|
139
141
|
};
|
|
140
142
|
} & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("../../../../_types/types").CoreJSType>) & typeof LitElement;
|
|
141
143
|
/**
|
|
@@ -163,6 +165,7 @@ export declare class Checkbox extends Checkbox_base {
|
|
|
163
165
|
touched: boolean;
|
|
164
166
|
iconName: string;
|
|
165
167
|
indeterminateIconName: string;
|
|
168
|
+
showAsIndeterminate: boolean;
|
|
166
169
|
hasDescription: boolean;
|
|
167
170
|
hasLabel: boolean;
|
|
168
171
|
slotLabelNodes: Array<Node>;
|
|
@@ -41,6 +41,7 @@ let Checkbox = class Checkbox extends FormCheckable(FormInput(FormElement(Subscr
|
|
|
41
41
|
this.touched = false;
|
|
42
42
|
this.iconName = "check";
|
|
43
43
|
this.indeterminateIconName = "minus-small";
|
|
44
|
+
this.showAsIndeterminate = false;
|
|
44
45
|
this.hasDescription = false;
|
|
45
46
|
this.hasLabel = false;
|
|
46
47
|
}
|
|
@@ -56,7 +57,8 @@ let Checkbox = class Checkbox extends FormCheckable(FormInput(FormElement(Subscr
|
|
|
56
57
|
hasSlotOrProps() {
|
|
57
58
|
var _a, _b;
|
|
58
59
|
this.hasLabel = this.label || ((_a = this.slotLabelNodes) === null || _a === void 0 ? void 0 : _a.length) ? true : false;
|
|
59
|
-
this.hasDescription =
|
|
60
|
+
this.hasDescription =
|
|
61
|
+
this.description || ((_b = this.slotDescriptionNodes) === null || _b === void 0 ? void 0 : _b.length) ? true : false;
|
|
60
62
|
}
|
|
61
63
|
render() {
|
|
62
64
|
//let labelStarSuffix = this.label && this.required && this.label.indexOf("*") == -1 ? " *" : "";
|
|
@@ -69,6 +71,7 @@ let Checkbox = class Checkbox extends FormCheckable(FormInput(FormElement(Subscr
|
|
|
69
71
|
@click=${this.handleChange}
|
|
70
72
|
@blur=${this.handleBlur}
|
|
71
73
|
?required=${this.required}
|
|
74
|
+
?data-indeterminate=${this.showAsIndeterminate}
|
|
72
75
|
.disabled=${ifDefined(this.disabled)}
|
|
73
76
|
.checked=${ifDefined(this.checked)}
|
|
74
77
|
.name=${this.name}
|
|
@@ -77,7 +80,9 @@ let Checkbox = class Checkbox extends FormCheckable(FormInput(FormElement(Subscr
|
|
|
77
80
|
aria-label=${ifDefined(this.ariaLabel)}
|
|
78
81
|
aria-labelledby=${ifDefined(this.ariaLabelledby)}
|
|
79
82
|
/>
|
|
80
|
-
<sonic-icon name="${this.checked == "indeterminate"
|
|
83
|
+
<sonic-icon name="${this.checked == "indeterminate" || this.showAsIndeterminate
|
|
84
|
+
? this.indeterminateIconName
|
|
85
|
+
: this.iconName}" class="sc-input-icon"></sonic-icon>
|
|
81
86
|
</span>
|
|
82
87
|
|
|
83
88
|
<div class="checkbox-text ${!this.hasDescription && !this.hasLabel ? "hidden" : "checkbox-text"}">
|
|
@@ -134,7 +139,8 @@ Checkbox.styles = [
|
|
|
134
139
|
outline: none;
|
|
135
140
|
margin: 0;
|
|
136
141
|
background-color: var(--sc-checkbox-bg);
|
|
137
|
-
border: var(--sc-checkbox-border-width) solid
|
|
142
|
+
border: var(--sc-checkbox-border-width) solid
|
|
143
|
+
var(--sc-checkbox-border-color);
|
|
138
144
|
}
|
|
139
145
|
|
|
140
146
|
input:focus,
|
|
@@ -169,11 +175,13 @@ Checkbox.styles = [
|
|
|
169
175
|
|
|
170
176
|
/*Active */
|
|
171
177
|
input:checked,
|
|
178
|
+
input[data-indeterminate],
|
|
172
179
|
input[checked] {
|
|
173
180
|
--sc-checkbox-border-color: var(--sc-primary);
|
|
174
181
|
--sc-checkbox-bg: var(--sc-primary);
|
|
175
182
|
}
|
|
176
183
|
input:checked + sonic-icon,
|
|
184
|
+
input[data-indeterminate] + sonic-icon,
|
|
177
185
|
input[checked] + sonic-icon {
|
|
178
186
|
--sc-checkbox-color: var(--sc-primary-content);
|
|
179
187
|
transform: translateX(-50%) translateY(-50%) scale(1);
|
|
@@ -228,6 +236,9 @@ __decorate([
|
|
|
228
236
|
__decorate([
|
|
229
237
|
property({ type: String })
|
|
230
238
|
], Checkbox.prototype, "indeterminateIconName", void 0);
|
|
239
|
+
__decorate([
|
|
240
|
+
property({ type: Boolean })
|
|
241
|
+
], Checkbox.prototype, "showAsIndeterminate", void 0);
|
|
231
242
|
__decorate([
|
|
232
243
|
property({ type: Boolean })
|
|
233
244
|
], Checkbox.prototype, "hasDescription", void 0);
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { css } from "lit";
|
|
2
|
+
export const passwordToggle = css `
|
|
3
|
+
.password-toggle {
|
|
4
|
+
color: var(--sc-input-c);
|
|
5
|
+
font-size: var(--sc-input-fs);
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
margin-right: calc(-0.5 * var(--sc-input-px));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:host([inlineContent]) .has-suffix .password-toggle {
|
|
11
|
+
margin-right: 0;
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
2
14
|
export const label = css `
|
|
3
15
|
:host {
|
|
4
16
|
--sc-label-fs: var(--sc-fs, 1rem);
|
|
@@ -168,6 +180,11 @@ export const formControl = css `
|
|
|
168
180
|
margin-left: auto;
|
|
169
181
|
}
|
|
170
182
|
|
|
183
|
+
:host([inlineContent]) .no-suffix slot[name="suffix"],
|
|
184
|
+
:host([inlineContent]) .no-prefix slot[name="prefix"] {
|
|
185
|
+
display: none;
|
|
186
|
+
}
|
|
187
|
+
|
|
171
188
|
/* :host([inlineContent]) .input {
|
|
172
189
|
|
|
173
190
|
}*/
|
|
@@ -50,14 +50,12 @@ declare const Input_base: {
|
|
|
50
50
|
removeAttribute(name: string): void;
|
|
51
51
|
initPublisher(): void;
|
|
52
52
|
getApiConfiguration(): import("../../../../utils/api").APIConfiguration;
|
|
53
|
-
/**
|
|
54
|
-
* Taille du composant, implique notamment des modifications de typo et de marge interne
|
|
55
|
-
*/
|
|
56
53
|
connectedCallback(): void;
|
|
57
54
|
requestUpdate(): void;
|
|
58
55
|
getAttribute(name: string): string;
|
|
59
56
|
hasAttribute(attributeName: string): boolean;
|
|
60
57
|
disconnectedCallback(): void;
|
|
58
|
+
getBoundingClientRect(): DOMRect;
|
|
61
59
|
};
|
|
62
60
|
} & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("../../../../_types/types").CoreJSType>) & typeof LitElement;
|
|
63
61
|
export declare class Input extends Input_base {
|
|
@@ -78,6 +76,7 @@ export declare class Input extends Input_base {
|
|
|
78
76
|
src?: string;
|
|
79
77
|
inlineContent: boolean;
|
|
80
78
|
disableInlineContentFocus: boolean;
|
|
79
|
+
showPasswordToggle: boolean;
|
|
81
80
|
slotLabelNodes: Array<Node>;
|
|
82
81
|
slotDescriptionNodes: Array<Node>;
|
|
83
82
|
slotSuffixNodes: Array<Node>;
|
|
@@ -87,6 +86,7 @@ export declare class Input extends Input_base {
|
|
|
87
86
|
hasLabel: boolean;
|
|
88
87
|
hasSuffix: boolean;
|
|
89
88
|
hasPrefix: boolean;
|
|
89
|
+
isPassword: boolean;
|
|
90
90
|
sameValueAsHandle?: (v: string) => void;
|
|
91
91
|
sameValueAsName?: string;
|
|
92
92
|
connectedCallback(): void;
|
|
@@ -96,6 +96,7 @@ export declare class Input extends Input_base {
|
|
|
96
96
|
inlineContentFocus(): void;
|
|
97
97
|
changeTimeoutId?: ReturnType<typeof setTimeout>;
|
|
98
98
|
handleChange(e?: Event): void;
|
|
99
|
+
togglePasswordVisibility(): void;
|
|
99
100
|
render(): import("lit-html").TemplateResult<1>;
|
|
100
101
|
}
|
|
101
102
|
export {};
|
|
@@ -8,7 +8,7 @@ import { html, LitElement, css } from "lit";
|
|
|
8
8
|
import { customElement, property, queryAssignedNodes, state } from "lit/decorators.js";
|
|
9
9
|
import { query } from "lit/decorators/query.js";
|
|
10
10
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
11
|
-
import { formControl, label, description } from "@supersoniks/concorde/core/components/ui/form/css/form-control";
|
|
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";
|
|
@@ -32,10 +32,12 @@ let Input = class Input extends FormInput(FormElement(Subscriber(LitElement))) {
|
|
|
32
32
|
this.readonly = false;
|
|
33
33
|
this.inlineContent = false;
|
|
34
34
|
this.disableInlineContentFocus = false;
|
|
35
|
+
this.showPasswordToggle = false;
|
|
35
36
|
this.hasDescription = false;
|
|
36
37
|
this.hasLabel = false;
|
|
37
38
|
this.hasSuffix = false;
|
|
38
39
|
this.hasPrefix = false;
|
|
40
|
+
this.isPassword = false;
|
|
39
41
|
}
|
|
40
42
|
connectedCallback() {
|
|
41
43
|
super.connectedCallback();
|
|
@@ -48,6 +50,11 @@ let Input = class Input extends FormInput(FormElement(Subscriber(LitElement))) {
|
|
|
48
50
|
return;
|
|
49
51
|
formPublisher[this.sameValueAsName].onAssign(this.sameValueAsHandle);
|
|
50
52
|
}
|
|
53
|
+
if (this.type == "password") {
|
|
54
|
+
this.isPassword = true;
|
|
55
|
+
this.showPasswordToggle = true;
|
|
56
|
+
this.inlineContent = true;
|
|
57
|
+
}
|
|
51
58
|
}
|
|
52
59
|
disconnectedCallback() {
|
|
53
60
|
super.disconnectedCallback();
|
|
@@ -84,10 +91,19 @@ let Input = class Input extends FormInput(FormElement(Subscriber(LitElement))) {
|
|
|
84
91
|
clearTimeout(this.changeTimeoutId);
|
|
85
92
|
this.changeTimeoutId = setTimeout(() => super.handleChange(e), parseInt(this.getAttribute("inputDelayMs")));
|
|
86
93
|
}
|
|
94
|
+
// toggle password visibility
|
|
95
|
+
togglePasswordVisibility() {
|
|
96
|
+
this.isPassword = !this.isPassword;
|
|
97
|
+
this._type = this.isPassword ? "password" : "text";
|
|
98
|
+
console.log(this.isPassword);
|
|
99
|
+
// this.type = this.isPassword ? "password" : "text";
|
|
100
|
+
}
|
|
87
101
|
render() {
|
|
88
102
|
const slotClasses = {
|
|
89
103
|
"has-prefix": this.hasPrefix,
|
|
90
104
|
"has-suffix": this.hasSuffix,
|
|
105
|
+
"no-suffix": !this.hasSuffix,
|
|
106
|
+
"no-prefix": !this.hasPrefix,
|
|
91
107
|
};
|
|
92
108
|
//let labelStarSuffix = this.label && this.required && this.label.indexOf("*") == -1 ? " *" : "";
|
|
93
109
|
return html `
|
|
@@ -128,6 +144,17 @@ let Input = class Input extends FormInput(FormElement(Subscriber(LitElement))) {
|
|
|
128
144
|
.name=${this.name}
|
|
129
145
|
.value=${this.value}
|
|
130
146
|
/>
|
|
147
|
+
${this.showPasswordToggle
|
|
148
|
+
? html `<sonic-button
|
|
149
|
+
shape="circle"
|
|
150
|
+
class="password-toggle"
|
|
151
|
+
@click=${this.togglePasswordVisibility}
|
|
152
|
+
aria-label="Toggle password visibility"
|
|
153
|
+
variant="unstyled"
|
|
154
|
+
>
|
|
155
|
+
<sonic-icon library="heroicons" name=${this.isPassword ? "eye" : "eye-slash"}></sonic-icon>
|
|
156
|
+
</sonic-button>`
|
|
157
|
+
: ""}
|
|
131
158
|
<slot name="suffix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
132
159
|
</div>
|
|
133
160
|
</div>
|
|
@@ -148,11 +175,15 @@ Input.styles = [
|
|
|
148
175
|
formControl,
|
|
149
176
|
label,
|
|
150
177
|
description,
|
|
178
|
+
passwordToggle,
|
|
151
179
|
css `
|
|
152
180
|
:host([type="hidden"]) {
|
|
153
181
|
appearance: none !important;
|
|
154
182
|
display: none !important;
|
|
155
183
|
}
|
|
184
|
+
:host > .form-control {
|
|
185
|
+
position: relative;
|
|
186
|
+
}
|
|
156
187
|
`,
|
|
157
188
|
];
|
|
158
189
|
__decorate([
|
|
@@ -194,6 +225,9 @@ __decorate([
|
|
|
194
225
|
__decorate([
|
|
195
226
|
property({ type: Boolean })
|
|
196
227
|
], Input.prototype, "disableInlineContentFocus", void 0);
|
|
228
|
+
__decorate([
|
|
229
|
+
property({ type: Boolean })
|
|
230
|
+
], Input.prototype, "showPasswordToggle", void 0);
|
|
197
231
|
__decorate([
|
|
198
232
|
queryAssignedNodes({ slot: "label" })
|
|
199
233
|
], Input.prototype, "slotLabelNodes", void 0);
|
|
@@ -221,6 +255,9 @@ __decorate([
|
|
|
221
255
|
__decorate([
|
|
222
256
|
state()
|
|
223
257
|
], Input.prototype, "hasPrefix", void 0);
|
|
258
|
+
__decorate([
|
|
259
|
+
state()
|
|
260
|
+
], Input.prototype, "isPassword", void 0);
|
|
224
261
|
Input = __decorate([
|
|
225
262
|
customElement(tagName)
|
|
226
263
|
], Input);
|
|
@@ -55,6 +55,7 @@ declare const Textarea_base: {
|
|
|
55
55
|
getAttribute(name: string): string;
|
|
56
56
|
hasAttribute(attributeName: string): boolean;
|
|
57
57
|
disconnectedCallback(): void;
|
|
58
|
+
getBoundingClientRect(): DOMRect;
|
|
58
59
|
};
|
|
59
60
|
} & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("../../../../_types/types").CoreJSType>) & typeof LitElement;
|
|
60
61
|
export declare class Textarea extends Textarea_base {
|
|
@@ -44,7 +44,7 @@ let Icon = class Icon extends LitElement {
|
|
|
44
44
|
return;
|
|
45
45
|
this.renderId++;
|
|
46
46
|
const frameRenderId = this.renderId;
|
|
47
|
-
window.requestAnimationFrame(() => __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
(window.queueMicrotask || window.requestAnimationFrame)(() => __awaiter(this, void 0, void 0, function* () {
|
|
48
48
|
if (frameRenderId != this.renderId) {
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
@@ -5,9 +5,11 @@ export declare class Image extends LitElement {
|
|
|
5
5
|
src: string;
|
|
6
6
|
alt: string;
|
|
7
7
|
loading: "eager" | "lazy";
|
|
8
|
+
transition?: "fade" | "fade-scale-out";
|
|
8
9
|
ratio: string;
|
|
9
10
|
objectPosition: string;
|
|
10
11
|
imageRendering: string;
|
|
11
12
|
cover: boolean;
|
|
13
|
+
firstUpdated(): void;
|
|
12
14
|
render(): import("lit-html").TemplateResult<1>;
|
|
13
15
|
}
|
|
@@ -20,6 +20,17 @@ let Image = class Image extends LitElement {
|
|
|
20
20
|
this.imageRendering = "auto";
|
|
21
21
|
this.cover = false;
|
|
22
22
|
}
|
|
23
|
+
firstUpdated() {
|
|
24
|
+
var _a;
|
|
25
|
+
if (this.transition) {
|
|
26
|
+
const img = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("img");
|
|
27
|
+
if (!img)
|
|
28
|
+
return;
|
|
29
|
+
img.onload = function () {
|
|
30
|
+
img.classList.add("loaded");
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
23
34
|
render() {
|
|
24
35
|
const imgStyles = {
|
|
25
36
|
aspectRatio: this.cover ? "auto" : this.ratio,
|
|
@@ -93,6 +104,20 @@ Image.styles = [
|
|
|
93
104
|
height: 100% !important;
|
|
94
105
|
width: 100% !important;
|
|
95
106
|
}
|
|
107
|
+
|
|
108
|
+
:host([transition]) img {
|
|
109
|
+
opacity: 0;
|
|
110
|
+
transition: 0.25s;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:host([transition="fade-scale-out"]) img {
|
|
114
|
+
scale: 1.08;
|
|
115
|
+
transition: opacity 0.3s linear, scale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
|
116
|
+
}
|
|
117
|
+
:host([transition]) img.loaded {
|
|
118
|
+
opacity: 1;
|
|
119
|
+
scale: 1;
|
|
120
|
+
}
|
|
96
121
|
`,
|
|
97
122
|
];
|
|
98
123
|
__decorate([
|
|
@@ -107,6 +132,9 @@ __decorate([
|
|
|
107
132
|
__decorate([
|
|
108
133
|
property({ type: String })
|
|
109
134
|
], Image.prototype, "loading", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
property({ type: String, reflect: true })
|
|
137
|
+
], Image.prototype, "transition", void 0);
|
|
110
138
|
__decorate([
|
|
111
139
|
property({ type: String })
|
|
112
140
|
], Image.prototype, "ratio", void 0);
|
|
@@ -26,9 +26,8 @@ ModalClose.styles = [
|
|
|
26
26
|
display: block;
|
|
27
27
|
align-self: flex-end;
|
|
28
28
|
height: 0;
|
|
29
|
-
top: 0;
|
|
30
|
-
|
|
31
|
-
padding-right: 0.5rem;
|
|
29
|
+
top: 0.5rem;
|
|
30
|
+
right: 0.5rem;
|
|
32
31
|
transform: translate3d(calc(var(--sc-modal-px)), calc(-1 * var(--sc-modal-py)), 0);
|
|
33
32
|
z-index: 20;
|
|
34
33
|
}
|
|
@@ -6,17 +6,25 @@ import "@supersoniks/concorde/core/components/ui/modal/modal-subtitle";
|
|
|
6
6
|
import "@supersoniks/concorde/core/components/ui/modal/modal-title";
|
|
7
7
|
declare type ModalCreateOptions = {
|
|
8
8
|
content?: string;
|
|
9
|
+
zIndex?: string;
|
|
10
|
+
paddingX?: string;
|
|
11
|
+
paddingY?: string;
|
|
12
|
+
width?: string;
|
|
13
|
+
maxWidth?: string;
|
|
14
|
+
removeOnHide?: boolean;
|
|
9
15
|
};
|
|
10
16
|
declare const Modal_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("@supersoniks/concorde/core/_types/types").CoreJSType>) & typeof LitElement;
|
|
11
17
|
export declare class Modal extends Modal_base {
|
|
12
18
|
static styles: import("lit").CSSResult[];
|
|
13
19
|
forceAction: boolean;
|
|
20
|
+
removeOnHide: boolean;
|
|
14
21
|
align: "center" | "right" | "left";
|
|
15
22
|
padding: string;
|
|
16
23
|
maxWidth: string;
|
|
17
24
|
maxHeight: string;
|
|
18
25
|
width: string;
|
|
19
26
|
height: string;
|
|
27
|
+
zIndex: string;
|
|
20
28
|
fullScreen: boolean;
|
|
21
29
|
visible: boolean;
|
|
22
30
|
modalWrapper: HTMLDivElement;
|