@ds-autonomie/web-components 1.6.0 → 1.7.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/CHANGELOG.md +13 -0
- package/dist/chunks/chunk.2PA4QKLT.js +43 -0
- package/dist/chunks/{chunk.KFZV2L7L.js → chunk.4ABNA6LY.js} +1 -1
- package/dist/chunks/{chunk.7F5X7SQN.js → chunk.5LSEWF5M.js} +1 -1
- package/dist/chunks/{chunk.2SUJL5O6.js → chunk.5MXBL3PY.js} +1 -1
- package/dist/chunks/{chunk.WK3IHF2A.js → chunk.5T654YBW.js} +1 -1
- package/dist/chunks/chunk.672XI6OQ.js +108 -0
- package/dist/chunks/{chunk.7WQVFO44.js → chunk.6HEEXQ6Q.js} +11 -5
- package/dist/chunks/{chunk.RJBMUBMI.js → chunk.7FSWPNRP.js} +1 -1
- package/dist/chunks/{chunk.DUJFQEVS.js → chunk.7PKGNYXP.js} +1 -1
- package/dist/chunks/{chunk.ATDDIVPX.js → chunk.7RMRIPUN.js} +1 -1
- package/dist/chunks/{chunk.NMOENRSD.js → chunk.ADVUEL4K.js} +1 -1
- package/dist/chunks/{chunk.WLJH2IWB.js → chunk.AJ4QV4YB.js} +1 -1
- package/dist/chunks/chunk.CWMR6PEK.js +227 -0
- package/dist/chunks/chunk.D3IQERM5.js +92 -0
- package/dist/chunks/{chunk.OUVQZNJQ.js → chunk.D5MIBH2P.js} +6 -3
- package/dist/chunks/chunk.DWASAPA2.js +29 -0
- package/dist/chunks/chunk.DY7O23OC.js +49 -0
- package/dist/chunks/{chunk.6DSM44NV.js → chunk.EBCLOXNV.js} +1 -1
- package/dist/chunks/{chunk.HCI6BR7B.js → chunk.FKKOUYXE.js} +1 -1
- package/dist/chunks/{chunk.HDSA2CY2.js → chunk.GENB7E6Z.js} +1 -1
- package/dist/chunks/{chunk.M7UZ33WG.js → chunk.GS7HSU6O.js} +1 -1
- package/dist/chunks/{chunk.HPK6C7NJ.js → chunk.GXQ7CTJX.js} +7 -2
- package/dist/chunks/{chunk.CBFLGIED.js → chunk.IAKOROM4.js} +1 -1
- package/dist/chunks/chunk.JOIYVWUG.js +32 -0
- package/dist/chunks/{chunk.YS2LUMKB.js → chunk.KG6MIENB.js} +1 -1
- package/dist/chunks/{chunk.KGPFHLUW.js → chunk.L5HKY6WB.js} +4 -4
- package/dist/chunks/{chunk.5YABZV2L.js → chunk.MCMUWBT5.js} +1 -1
- package/dist/chunks/{chunk.XQZX6LVO.js → chunk.NIYQMA5Y.js} +1 -1
- package/dist/chunks/{chunk.RNLKSRKQ.js → chunk.NNL36YA6.js} +17 -7
- package/dist/chunks/chunk.NNNXN334.js +32 -0
- package/dist/chunks/chunk.O3CX2C5Y.js +62 -0
- package/dist/chunks/{chunk.CICCL52W.js → chunk.PCJUYERL.js} +1 -1
- package/dist/chunks/{chunk.NQSQUH4H.js → chunk.PQD7VKIK.js} +1 -1
- package/dist/chunks/{chunk.6Y5VNWAK.js → chunk.QBPZ6I5Q.js} +1 -1
- package/dist/chunks/chunk.R3Y3IVO2.js +56 -0
- package/dist/chunks/chunk.R5PR2MDK.js +256 -0
- package/dist/chunks/{chunk.FFFHQKNB.js → chunk.RBJL56T2.js} +1 -1
- package/dist/chunks/{chunk.VLRL3RJT.js → chunk.RC2LGXYT.js} +1 -1
- package/dist/chunks/chunk.RTNJV3ZL.js +52 -0
- package/dist/chunks/{chunk.CSQ2UP6E.js → chunk.SL4M42DS.js} +4 -4
- package/dist/chunks/{chunk.2FVPNPAG.js → chunk.SN4AILXB.js} +27 -6
- package/dist/chunks/chunk.SUFR3KIW.js +41 -0
- package/dist/chunks/{chunk.B5NS5VQR.js → chunk.TFMB54OO.js} +1 -1
- package/dist/chunks/{chunk.3QQPH6YB.js → chunk.UENLYHK4.js} +8 -1
- package/dist/chunks/{chunk.Z7QPOCQO.js → chunk.UTAUMIPE.js} +1 -1
- package/dist/chunks/{chunk.6SWOU4CL.js → chunk.WGN7OZLZ.js} +27 -1
- package/dist/chunks/{chunk.TMG7TJJO.js → chunk.X6ZGA6WS.js} +2 -2
- package/dist/chunks/{chunk.VFYKLPN2.js → chunk.XVDH3KHQ.js} +9 -0
- package/dist/chunks/{chunk.CKDL37GT.js → chunk.Y5M7ZKHX.js} +14 -0
- package/dist/chunks/chunk.YTZRADK4.js +31 -0
- package/dist/chunks/{chunk.RV652CSU.js → chunk.ZCKAXIC4.js} +2 -2
- package/dist/chunks/chunk.ZOKFJBTV.js +150 -0
- package/dist/chunks/{chunk.DDLGH65N.js → chunk.ZQQCFKOX.js} +1 -1
- package/dist/components/accordion/accordion.js +4 -4
- package/dist/components/alert/alert.d.ts +9 -0
- package/dist/components/alert/alert.js +4 -4
- package/dist/components/avatar/avatar.js +3 -3
- package/dist/components/breadcrumb/breadcrumb.js +4 -4
- package/dist/components/breadcrumb-item/breadcrumb-item.js +2 -2
- package/dist/components/button/button.js +5 -5
- package/dist/components/checkbox/checkbox.js +2 -2
- package/dist/components/checkbox-button/checkbox-button.d.ts +3 -0
- package/dist/components/checkbox-button/checkbox-button.js +4 -4
- package/dist/components/checkbox-button/checkbox-button.styles.js +1 -1
- package/dist/components/checkbox-group/checkbox-group.js +1 -1
- package/dist/components/combobox/combobox.js +6 -6
- package/dist/components/dialog/dialog.js +4 -4
- package/dist/components/download-card/download-card.js +2 -2
- package/dist/components/download-link/download-link.js +2 -2
- package/dist/components/drawer/drawer.js +4 -4
- package/dist/components/dropdown/dropdown.js +2 -2
- package/dist/components/error-message-panel/error-message-panel.js +2 -2
- package/dist/components/file-upload/file-upload.d.ts +65 -0
- package/dist/components/file-upload/file-upload.js +16 -0
- package/dist/components/file-upload/file-upload.styles.d.ts +2 -0
- package/dist/components/file-upload/file-upload.styles.js +9 -0
- package/dist/components/file-upload-item/file-upload-item.d.ts +33 -0
- package/dist/components/file-upload-item/file-upload-item.js +12 -0
- package/dist/components/file-upload-item/file-upload-item.styles.d.ts +2 -0
- package/dist/components/file-upload-item/file-upload-item.styles.js +8 -0
- package/dist/components/footer/footer.assets.d.ts +1 -0
- package/dist/components/footer/footer.assets.js +7 -0
- package/dist/components/footer/footer.d.ts +13 -0
- package/dist/components/footer/footer.js +14 -0
- package/dist/components/footer/footer.styles.d.ts +2 -0
- package/dist/components/footer/footer.styles.js +8 -0
- package/dist/components/footer-content-block/footer-content-block.d.ts +20 -0
- package/dist/components/footer-content-block/footer-content-block.js +12 -0
- package/dist/components/footer-content-block/footer-content-block.styles.d.ts +2 -0
- package/dist/components/footer-content-block/footer-content-block.styles.js +8 -0
- package/dist/components/footer-inline-divider/footer-inline-divider.d.ts +22 -0
- package/dist/components/footer-inline-divider/footer-inline-divider.js +12 -0
- package/dist/components/footer-inline-divider/footer-inline-divider.styles.d.ts +2 -0
- package/dist/components/footer-inline-divider/footer-inline-divider.styles.js +8 -0
- package/dist/components/footer-sitemap/footer-sitemap.d.ts +23 -0
- package/dist/components/footer-sitemap/footer-sitemap.js +11 -0
- package/dist/components/footer-sitemap/footer-sitemap.styles.d.ts +2 -0
- package/dist/components/footer-sitemap/footer-sitemap.styles.js +8 -0
- package/dist/components/footer-sitemap-item/footer-sitemap-item.d.ts +20 -0
- package/dist/components/footer-sitemap-item/footer-sitemap-item.js +12 -0
- package/dist/components/footer-sitemap-item/footer-sitemap-item.styles.d.ts +2 -0
- package/dist/components/footer-sitemap-item/footer-sitemap-item.styles.js +8 -0
- package/dist/components/format-bytes/format-bytes.js +2 -2
- package/dist/components/format-date/format-date.js +2 -2
- package/dist/components/format-number/format-number.js +2 -2
- package/dist/components/icon/icon.js +2 -2
- package/dist/components/icon-button/icon-button.js +2 -2
- package/dist/components/input/input.js +5 -5
- package/dist/components/input-mask/input-mask.js +3 -3
- package/dist/components/input-phone/input-phone.js +9 -9
- package/dist/components/menu-item/menu-item.js +2 -2
- package/dist/components/option/option.js +4 -4
- package/dist/components/progress-bar/progress-bar.js +2 -2
- package/dist/components/radio/radio.d.ts +2 -0
- package/dist/components/radio/radio.js +4 -4
- package/dist/components/radio/radio.styles.js +1 -1
- package/dist/components/radio-button/radio-button.d.ts +4 -2
- package/dist/components/radio-button/radio-button.js +2 -2
- package/dist/components/radio-button/radio-button.styles.js +1 -1
- package/dist/components/radio-group/radio-group.js +1 -1
- package/dist/components/relative-time/relative-time.js +2 -2
- package/dist/components/select/select.js +5 -5
- package/dist/components/spinner/spinner.js +2 -2
- package/dist/components/step/step.js +4 -4
- package/dist/components/tab/tab.js +2 -2
- package/dist/components/tab-group/tab-group.js +2 -2
- package/dist/components/tag/tag.js +4 -4
- package/dist/components/tooltip/tooltip.js +2 -2
- package/dist/components/tree/tree.js +6 -6
- package/dist/components/tree-item/tree-item.js +5 -5
- package/dist/custom-elements.json +4382 -3460
- package/dist/design-system.d.ts +7 -0
- package/dist/design-system.js +113 -77
- package/dist/events/dsa-file-upload.d.ts +9 -0
- package/dist/events/dsa-file-upload.js +1 -0
- package/dist/events/events.d.ts +1 -0
- package/dist/themes/dsa-wc-theme.css +93 -1
- package/dist/themes/dsa-wc-theme.min.css +1 -1
- package/dist/themes/dsa-wc-theme.styles.js +97 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/utilities/localize.d.ts +3 -0
- package/dist/utilities/localize.js +1 -1
- package/dist/vscode.html-custom-data.json +393 -245
- package/dist/web-types.json +1479 -1018
- package/package.json +1 -1
- package/dist/chunks/{chunk.M3FN3PFT.js → chunk.V7MYOBN4.js} +5 -5
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import {
|
|
2
|
+
file_upload_styles_default
|
|
3
|
+
} from "./chunk.CWMR6PEK.js";
|
|
4
|
+
import {
|
|
5
|
+
HasSlotController
|
|
6
|
+
} from "./chunk.YIY5RM53.js";
|
|
7
|
+
import {
|
|
8
|
+
watch
|
|
9
|
+
} from "./chunk.6IH66JBY.js";
|
|
10
|
+
import {
|
|
11
|
+
ifDefinedAndNotEmpty
|
|
12
|
+
} from "./chunk.ZQJVCRB2.js";
|
|
13
|
+
import {
|
|
14
|
+
ShoelaceElement
|
|
15
|
+
} from "./chunk.YCXTCVAZ.js";
|
|
16
|
+
import {
|
|
17
|
+
__decorateClass
|
|
18
|
+
} from "./chunk.6M63UXML.js";
|
|
19
|
+
|
|
20
|
+
// src/components/file-upload/file-upload.ts
|
|
21
|
+
import { html } from "lit";
|
|
22
|
+
import { customElement, property, query } from "lit/decorators.js";
|
|
23
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
24
|
+
import { LocalizeController } from "@shoelace-style/localize";
|
|
25
|
+
var DSAFileUpload = class extends ShoelaceElement {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
this.hasSlotController = new HasSlotController(
|
|
29
|
+
this,
|
|
30
|
+
"help-text",
|
|
31
|
+
"label",
|
|
32
|
+
"description"
|
|
33
|
+
);
|
|
34
|
+
this.localize = new LocalizeController(this);
|
|
35
|
+
this.size = "medium";
|
|
36
|
+
this.label = "";
|
|
37
|
+
this.description = "";
|
|
38
|
+
this.helpText = "";
|
|
39
|
+
this.disabled = false;
|
|
40
|
+
this.required = false;
|
|
41
|
+
this.accept = "";
|
|
42
|
+
this.multiple = false;
|
|
43
|
+
this.error = false;
|
|
44
|
+
this.errorMessage = "";
|
|
45
|
+
}
|
|
46
|
+
connectedCallback() {
|
|
47
|
+
super.connectedCallback();
|
|
48
|
+
const allFiles = this.getAllFiles();
|
|
49
|
+
allFiles.forEach((el) => el.setAttribute("size", this.size));
|
|
50
|
+
}
|
|
51
|
+
handleClick() {
|
|
52
|
+
this.fileUploadInput.click();
|
|
53
|
+
}
|
|
54
|
+
handleChange(event) {
|
|
55
|
+
const addedFiles = this.handleFileSelectedChange(event);
|
|
56
|
+
this.emit("dsa-file-upload", { detail: { files: addedFiles } });
|
|
57
|
+
}
|
|
58
|
+
handleFileSelectedChange(event) {
|
|
59
|
+
var _a, _b;
|
|
60
|
+
if (!this.accept || !/^(change|drop)$/.test(event.type)) {
|
|
61
|
+
return Array.from((_a = this.fileUploadInput.files) != null ? _a : []);
|
|
62
|
+
}
|
|
63
|
+
if (((_b = this.fileUploadInput) == null ? void 0 : _b.files) === null) {
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
const acceptedTypes = new Set(this.accept.split(", "));
|
|
67
|
+
return Array.prototype.filter.call(
|
|
68
|
+
this.fileUploadInput.files,
|
|
69
|
+
(file) => {
|
|
70
|
+
var _a2;
|
|
71
|
+
const fileExtensionRegExp = /\.[^.]+$/;
|
|
72
|
+
const hasFileExtension = fileExtensionRegExp.test(file.name);
|
|
73
|
+
const [fileExtension] = !hasFileExtension ? [void 0] : (_a2 = fileExtensionRegExp.exec(file.name)) != null ? _a2 : [];
|
|
74
|
+
return acceptedTypes.has(file.type) || fileExtension && acceptedTypes.has(fileExtension);
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
// Gets an array of all <dsa-file-upload-item> elements
|
|
79
|
+
getAllFiles() {
|
|
80
|
+
return [
|
|
81
|
+
...this.querySelectorAll("dsa-file-upload-item")
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
handleDefaultSlotChange() {
|
|
85
|
+
const allFiles = this.getAllFiles();
|
|
86
|
+
allFiles.forEach((el) => el.setAttribute("size", this.size));
|
|
87
|
+
}
|
|
88
|
+
handleBlur() {
|
|
89
|
+
this.emit("dsa-blur");
|
|
90
|
+
}
|
|
91
|
+
handleFocus() {
|
|
92
|
+
this.emit("dsa-focus");
|
|
93
|
+
}
|
|
94
|
+
handleSizeChange() {
|
|
95
|
+
const allFiles = this.getAllFiles();
|
|
96
|
+
allFiles.forEach((el) => el.setAttribute("size", this.size));
|
|
97
|
+
}
|
|
98
|
+
/** Sets focus on the control. */
|
|
99
|
+
focus(options) {
|
|
100
|
+
this.fileUploadButton.focus(options);
|
|
101
|
+
}
|
|
102
|
+
/** Removes focus from the control. */
|
|
103
|
+
blur() {
|
|
104
|
+
this.fileUploadButton.blur();
|
|
105
|
+
}
|
|
106
|
+
render() {
|
|
107
|
+
const hasLabelSlot = this.hasSlotController.test("label");
|
|
108
|
+
const hasHelpTextSlot = this.hasSlotController.test("help-text");
|
|
109
|
+
const hasDescriptionSlot = this.hasSlotController.test("description");
|
|
110
|
+
const hasLabel = this.label ? true : !!hasLabelSlot;
|
|
111
|
+
const hasHelpText = this.helpText ? true : !!hasHelpTextSlot;
|
|
112
|
+
const hasDescription = this.description ? true : !!hasDescriptionSlot;
|
|
113
|
+
return html`
|
|
114
|
+
<div
|
|
115
|
+
part="base"
|
|
116
|
+
class=${classMap({
|
|
117
|
+
"form-control": true,
|
|
118
|
+
"form-control--error": this.error && !this.disabled,
|
|
119
|
+
"form-control--disabled": this.disabled,
|
|
120
|
+
"form-control--small": this.size === "small",
|
|
121
|
+
"form-control--medium": this.size === "medium",
|
|
122
|
+
"form-control--large": this.size === "large",
|
|
123
|
+
"form-control--has-label": hasLabel,
|
|
124
|
+
"form-control--has-description": hasDescription,
|
|
125
|
+
"form-control--has-help-text": hasHelpText
|
|
126
|
+
})}
|
|
127
|
+
>
|
|
128
|
+
<label
|
|
129
|
+
id="label"
|
|
130
|
+
for="button"
|
|
131
|
+
part="file-upload-label"
|
|
132
|
+
class="form-control__label"
|
|
133
|
+
aria-hidden=${hasLabel ? "false" : "true"}
|
|
134
|
+
>
|
|
135
|
+
${this.required ? html`<span class="form-control__label-required">*</span>` : ""}
|
|
136
|
+
<slot name="label">${this.label}</slot>
|
|
137
|
+
</label>
|
|
138
|
+
<slot
|
|
139
|
+
part="file-upload-description"
|
|
140
|
+
id="description"
|
|
141
|
+
name="description"
|
|
142
|
+
class="form-control__description"
|
|
143
|
+
>${this.description}</slot
|
|
144
|
+
>
|
|
145
|
+
<div class="form-control__field">
|
|
146
|
+
<div class="button-container">
|
|
147
|
+
<button
|
|
148
|
+
part="file-upload-button"
|
|
149
|
+
id="button"
|
|
150
|
+
type="button"
|
|
151
|
+
class=${classMap({
|
|
152
|
+
button: true,
|
|
153
|
+
"button--small": this.size === "small",
|
|
154
|
+
"button--medium": this.size === "medium",
|
|
155
|
+
"button--large": this.size === "large",
|
|
156
|
+
"button--disabled": this.disabled
|
|
157
|
+
})}
|
|
158
|
+
?disabled=${this.disabled}
|
|
159
|
+
aria-disabled=${this.disabled ? "true" : "false"}
|
|
160
|
+
tabindex=${this.disabled ? "-1" : "0"}
|
|
161
|
+
aria-describedby=${this.error ? "error-text description help-text slot_files" : "description help-text slot_files"}
|
|
162
|
+
@click=${this.handleClick}
|
|
163
|
+
@blur=${this.handleBlur}
|
|
164
|
+
@focus=${this.handleFocus}
|
|
165
|
+
>
|
|
166
|
+
${this.localize.term("fileSelect", this.multiple)}
|
|
167
|
+
</button>
|
|
168
|
+
<input
|
|
169
|
+
part="input"
|
|
170
|
+
id="file"
|
|
171
|
+
type="file"
|
|
172
|
+
?disabled=${this.disabled}
|
|
173
|
+
?required=${this.required}
|
|
174
|
+
accept=${ifDefinedAndNotEmpty(this.accept)}
|
|
175
|
+
tabindex="-1"
|
|
176
|
+
aria-hidden="true"
|
|
177
|
+
?multiple=${this.multiple}
|
|
178
|
+
@change=${this.handleChange}
|
|
179
|
+
/>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
<slot
|
|
184
|
+
name="help-text"
|
|
185
|
+
id="help-text"
|
|
186
|
+
part="file-upload-help-text"
|
|
187
|
+
class="form-control__help-text"
|
|
188
|
+
aria-hidden=${hasHelpText ? "false" : "true"}
|
|
189
|
+
>
|
|
190
|
+
${this.helpText}
|
|
191
|
+
</slot>
|
|
192
|
+
${this.error && !this.disabled ? html`<dsa-error-text
|
|
193
|
+
id="error-text"
|
|
194
|
+
class="form-control__error-text"
|
|
195
|
+
>${this.errorMessage}</dsa-error-text
|
|
196
|
+
>` : ""}
|
|
197
|
+
<slot
|
|
198
|
+
id="slot_files"
|
|
199
|
+
part="slot_files"
|
|
200
|
+
@slotchange=${this.handleDefaultSlotChange}
|
|
201
|
+
>
|
|
202
|
+
</slot>
|
|
203
|
+
</div>
|
|
204
|
+
`;
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
DSAFileUpload.styles = file_upload_styles_default;
|
|
208
|
+
__decorateClass([
|
|
209
|
+
query("#file")
|
|
210
|
+
], DSAFileUpload.prototype, "fileUploadInput", 2);
|
|
211
|
+
__decorateClass([
|
|
212
|
+
query("#button")
|
|
213
|
+
], DSAFileUpload.prototype, "fileUploadButton", 2);
|
|
214
|
+
__decorateClass([
|
|
215
|
+
query(".drop-container")
|
|
216
|
+
], DSAFileUpload.prototype, "dropContainer", 2);
|
|
217
|
+
__decorateClass([
|
|
218
|
+
property()
|
|
219
|
+
], DSAFileUpload.prototype, "size", 2);
|
|
220
|
+
__decorateClass([
|
|
221
|
+
property()
|
|
222
|
+
], DSAFileUpload.prototype, "label", 2);
|
|
223
|
+
__decorateClass([
|
|
224
|
+
property({ attribute: "description" })
|
|
225
|
+
], DSAFileUpload.prototype, "description", 2);
|
|
226
|
+
__decorateClass([
|
|
227
|
+
property({ attribute: "help-text" })
|
|
228
|
+
], DSAFileUpload.prototype, "helpText", 2);
|
|
229
|
+
__decorateClass([
|
|
230
|
+
property({ type: Boolean, reflect: true })
|
|
231
|
+
], DSAFileUpload.prototype, "disabled", 2);
|
|
232
|
+
__decorateClass([
|
|
233
|
+
property({ type: Boolean, reflect: true })
|
|
234
|
+
], DSAFileUpload.prototype, "required", 2);
|
|
235
|
+
__decorateClass([
|
|
236
|
+
property()
|
|
237
|
+
], DSAFileUpload.prototype, "accept", 2);
|
|
238
|
+
__decorateClass([
|
|
239
|
+
property({ type: Boolean, reflect: true })
|
|
240
|
+
], DSAFileUpload.prototype, "multiple", 2);
|
|
241
|
+
__decorateClass([
|
|
242
|
+
property({ type: Boolean })
|
|
243
|
+
], DSAFileUpload.prototype, "error", 2);
|
|
244
|
+
__decorateClass([
|
|
245
|
+
property({ attribute: "error-message" })
|
|
246
|
+
], DSAFileUpload.prototype, "errorMessage", 2);
|
|
247
|
+
__decorateClass([
|
|
248
|
+
watch("size")
|
|
249
|
+
], DSAFileUpload.prototype, "handleSizeChange", 1);
|
|
250
|
+
DSAFileUpload = __decorateClass([
|
|
251
|
+
customElement("dsa-file-upload")
|
|
252
|
+
], DSAFileUpload);
|
|
253
|
+
|
|
254
|
+
export {
|
|
255
|
+
DSAFileUpload
|
|
256
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
component_styles_default
|
|
3
|
+
} from "./chunk.TUVJKY7S.js";
|
|
4
|
+
|
|
5
|
+
// src/components/footer-inline-divider/footer-inline-divider.styles.ts
|
|
6
|
+
import { css } from "lit";
|
|
7
|
+
var footer_inline_divider_styles_default = css`
|
|
8
|
+
${component_styles_default}
|
|
9
|
+
|
|
10
|
+
:host {
|
|
11
|
+
display: block;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
[part~='base'] {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
gap: var(--dsa-spacing-8);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
[part~='divider'] {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
[part~='divider'] {
|
|
25
|
+
--spacing-start: var(--dsa-wc-footer-inline-divider-spacing);
|
|
26
|
+
--spacing-end: var(--dsa-wc-footer-inline-divider-spacing);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[part~='text-left']::slotted(*),
|
|
30
|
+
[part~='text-right']::slotted(*) {
|
|
31
|
+
margin: var(--dsa-wc-footer-inline-divider-text-margin);
|
|
32
|
+
font: var(--dsa-wc-footer-inline-divider-text-font);
|
|
33
|
+
color: var(--dsa-wc-footer-inline-divider-text-color);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@media only screen and (min-width: 720px) {
|
|
37
|
+
[part~='base'] {
|
|
38
|
+
flex-direction: row;
|
|
39
|
+
align-items: center;
|
|
40
|
+
gap: 0px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
[part~='divider'] {
|
|
44
|
+
display: block;
|
|
45
|
+
height: var(--dsa-wc-footer-inline-divider-vertical-size);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
footer_inline_divider_styles_default
|
|
52
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
input_styles_default
|
|
3
|
+
} from "./chunk.AQC66RY2.js";
|
|
1
4
|
import {
|
|
2
5
|
getOverridenIconDetails,
|
|
3
6
|
isPrefixIconOverriden
|
|
4
7
|
} from "./chunk.KBT2EKLF.js";
|
|
5
|
-
import {
|
|
6
|
-
input_styles_default
|
|
7
|
-
} from "./chunk.AQC66RY2.js";
|
|
8
8
|
import {
|
|
9
9
|
defaultValue
|
|
10
10
|
} from "./chunk.CMJ2SRTL.js";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "./chunk.YIY5RM53.js";
|
|
17
17
|
import {
|
|
18
18
|
LocalizeController
|
|
19
|
-
} from "./chunk.
|
|
19
|
+
} from "./chunk.Y5M7ZKHX.js";
|
|
20
20
|
import {
|
|
21
21
|
watch
|
|
22
22
|
} from "./chunk.6IH66JBY.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
checkbox_button_styles_default
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.6HEEXQ6Q.js";
|
|
4
4
|
import {
|
|
5
5
|
HasSlotController
|
|
6
6
|
} from "./chunk.YIY5RM53.js";
|
|
@@ -27,6 +27,7 @@ var DSACheckboxButton = class extends ShoelaceElement {
|
|
|
27
27
|
this.checked = false;
|
|
28
28
|
this.disabled = false;
|
|
29
29
|
this.size = "medium";
|
|
30
|
+
this.error = false;
|
|
30
31
|
}
|
|
31
32
|
connectedCallback() {
|
|
32
33
|
super.connectedCallback();
|
|
@@ -49,10 +50,23 @@ var DSACheckboxButton = class extends ShoelaceElement {
|
|
|
49
50
|
this.emit("dsa-focus");
|
|
50
51
|
}
|
|
51
52
|
handleDisabledChange() {
|
|
52
|
-
this.setAttribute(
|
|
53
|
+
this.setAttribute(
|
|
54
|
+
"aria-disabled",
|
|
55
|
+
this.disabled || this.readonly ? "true" : "false"
|
|
56
|
+
);
|
|
53
57
|
}
|
|
54
58
|
handleReadonlyChange() {
|
|
55
|
-
this.
|
|
59
|
+
this.setAttribute(
|
|
60
|
+
"aria-disabled",
|
|
61
|
+
this.disabled || this.readonly ? "true" : "false"
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
handleErrorChange() {
|
|
65
|
+
if (this.error) {
|
|
66
|
+
this.setAttribute("aria-invalid", "true");
|
|
67
|
+
} else {
|
|
68
|
+
this.removeAttribute("aria-invalid");
|
|
69
|
+
}
|
|
56
70
|
}
|
|
57
71
|
/** Sets focus on the checbox button. */
|
|
58
72
|
focus(options) {
|
|
@@ -81,10 +95,11 @@ var DSACheckboxButton = class extends ShoelaceElement {
|
|
|
81
95
|
"button--disabled": this.disabled,
|
|
82
96
|
"button--focused": this.hasFocus,
|
|
83
97
|
// TODO: remove ?
|
|
84
|
-
"button--has-label": this.hasSlotController.test("[default]")
|
|
98
|
+
"button--has-label": this.hasSlotController.test("[default]"),
|
|
99
|
+
"button--error": this.error
|
|
85
100
|
})}
|
|
86
|
-
?disabled=${this.disabled}
|
|
87
|
-
aria-disabled=${this.disabled}
|
|
101
|
+
?disabled=${this.disabled || this.readonly}
|
|
102
|
+
aria-disabled=${this.disabled || this.readonly}
|
|
88
103
|
type="button"
|
|
89
104
|
value=${ifDefined(this.value)}
|
|
90
105
|
@blur=${this.handleBlur}
|
|
@@ -131,12 +146,18 @@ __decorateClass([
|
|
|
131
146
|
__decorateClass([
|
|
132
147
|
property({ type: Boolean })
|
|
133
148
|
], DSACheckboxButton.prototype, "readonly", 2);
|
|
149
|
+
__decorateClass([
|
|
150
|
+
property({ type: Boolean })
|
|
151
|
+
], DSACheckboxButton.prototype, "error", 2);
|
|
134
152
|
__decorateClass([
|
|
135
153
|
watch("disabled", { waitUntilFirstUpdate: true })
|
|
136
154
|
], DSACheckboxButton.prototype, "handleDisabledChange", 1);
|
|
137
155
|
__decorateClass([
|
|
138
156
|
watch("readonly")
|
|
139
157
|
], DSACheckboxButton.prototype, "handleReadonlyChange", 1);
|
|
158
|
+
__decorateClass([
|
|
159
|
+
watch("error")
|
|
160
|
+
], DSACheckboxButton.prototype, "handleErrorChange", 1);
|
|
140
161
|
DSACheckboxButton = __decorateClass([
|
|
141
162
|
customElement("dsa-checkbox-button")
|
|
142
163
|
], DSACheckboxButton);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
component_styles_default
|
|
3
|
+
} from "./chunk.TUVJKY7S.js";
|
|
4
|
+
|
|
5
|
+
// src/components/footer-content-block/footer-content-block.styles.ts
|
|
6
|
+
import { css } from "lit";
|
|
7
|
+
var footer_content_block_styles_default = css`
|
|
8
|
+
${component_styles_default}
|
|
9
|
+
|
|
10
|
+
:host {
|
|
11
|
+
display: block;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
[part~='base'] {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
gap: var(--dsa-wc-footer-content-block-spacing);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@media only screen and (min-width: 1440px) {
|
|
21
|
+
[part~='base'] {
|
|
22
|
+
max-width: var(--dsa-wc-footer-content-block-max-width);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[part~='title']::slotted(*) {
|
|
27
|
+
font: var(--dsa-wc-footer-content-block-title-font);
|
|
28
|
+
color: var(--dsa-wc-footer-content-block-title-color);
|
|
29
|
+
margin: var(--dsa-wc-footer-content-block-title-margin);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
[part~='content']::slotted(*) {
|
|
33
|
+
font: var(--dsa-wc-footer-content-block-content-font);
|
|
34
|
+
color: var(--dsa-wc-footer-content-block-content-color);
|
|
35
|
+
margin: var(--dsa-wc-footer-content-block-content-margin);
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
footer_content_block_styles_default
|
|
41
|
+
};
|
|
@@ -24,6 +24,7 @@ var radio_button_styles_default = css`
|
|
|
24
24
|
color: var(--dsa-wc-toggle-button-color);
|
|
25
25
|
border-width: 1px;
|
|
26
26
|
boder-style: solid;
|
|
27
|
+
font-weight: 400;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
.button--toggle:hover {
|
|
@@ -58,7 +59,7 @@ var radio_button_styles_default = css`
|
|
|
58
59
|
color: var(--dsa-wc-toggle-button-checked-active-color);
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
.button--toggle.button--readonly
|
|
62
|
+
.button--toggle.button--readonly {
|
|
62
63
|
background-color: var(--dsa-wc-toggle-button-read-only-background-color);
|
|
63
64
|
border-color: var(--dsa-wc-toggle-button-read-only-border-color);
|
|
64
65
|
color: var(--dsa-wc-toggle-button-read-only-color);
|
|
@@ -84,6 +85,12 @@ var radio_button_styles_default = css`
|
|
|
84
85
|
flex-shrink: 0;
|
|
85
86
|
}
|
|
86
87
|
|
|
88
|
+
.button--error {
|
|
89
|
+
background-color: var(--dsa-wc-toggle-button-error-background-color);
|
|
90
|
+
border-color: var(--dsa-wc-toggle-button-error-border-color);
|
|
91
|
+
color: var(--dsa-wc-toggle-button-error-color);
|
|
92
|
+
}
|
|
93
|
+
|
|
87
94
|
/* We use a hidden input so constraint validation errors work, since they don't appear to show when used with buttons.
|
|
88
95
|
We can't actually hide it, though, otherwise the messages will be suppressed by the browser. */
|
|
89
96
|
.hidden-input {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk.V7RJROLH.js";
|
|
12
12
|
import {
|
|
13
13
|
LocalizeController
|
|
14
|
-
} from "./chunk.
|
|
14
|
+
} from "./chunk.Y5M7ZKHX.js";
|
|
15
15
|
import {
|
|
16
16
|
watch
|
|
17
17
|
} from "./chunk.6IH66JBY.js";
|
|
@@ -39,13 +39,26 @@ var DSAAlert = class extends ShoelaceElement {
|
|
|
39
39
|
this.open = false;
|
|
40
40
|
this.closable = false;
|
|
41
41
|
this.variant = "primary";
|
|
42
|
+
this.duration = Infinity;
|
|
42
43
|
}
|
|
43
44
|
firstUpdated() {
|
|
44
45
|
this.base.hidden = !this.open;
|
|
45
46
|
}
|
|
47
|
+
restartAutoHide() {
|
|
48
|
+
clearTimeout(this.autoHideTimeout);
|
|
49
|
+
if (this.open && this.duration < Infinity) {
|
|
50
|
+
this.autoHideTimeout = window.setTimeout(
|
|
51
|
+
() => this.hide(),
|
|
52
|
+
this.duration
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
46
56
|
handleCloseClick() {
|
|
47
57
|
this.hide();
|
|
48
58
|
}
|
|
59
|
+
handleMouseMove() {
|
|
60
|
+
this.restartAutoHide();
|
|
61
|
+
}
|
|
49
62
|
getPrefixIconName() {
|
|
50
63
|
switch (this.variant) {
|
|
51
64
|
case "danger":
|
|
@@ -63,6 +76,9 @@ var DSAAlert = class extends ShoelaceElement {
|
|
|
63
76
|
async handleOpenChange() {
|
|
64
77
|
if (this.open) {
|
|
65
78
|
this.emit("dsa-show");
|
|
79
|
+
if (this.duration < Infinity) {
|
|
80
|
+
this.restartAutoHide();
|
|
81
|
+
}
|
|
66
82
|
await stopAnimations(this.base);
|
|
67
83
|
this.base.hidden = false;
|
|
68
84
|
const { keyframes, options } = getAnimation(this, "alert.show", {
|
|
@@ -82,6 +98,9 @@ var DSAAlert = class extends ShoelaceElement {
|
|
|
82
98
|
this.emit("dsa-after-hide");
|
|
83
99
|
}
|
|
84
100
|
}
|
|
101
|
+
handleDurationChange() {
|
|
102
|
+
this.restartAutoHide();
|
|
103
|
+
}
|
|
85
104
|
/** Shows the alert. */
|
|
86
105
|
async show() {
|
|
87
106
|
if (this.open) {
|
|
@@ -142,6 +161,7 @@ var DSAAlert = class extends ShoelaceElement {
|
|
|
142
161
|
})}
|
|
143
162
|
role="alert"
|
|
144
163
|
aria-hidden=${this.open ? "false" : "true"}
|
|
164
|
+
@mousemove=${this.handleMouseMove}
|
|
145
165
|
>
|
|
146
166
|
<dsa-icon
|
|
147
167
|
class="alert__icon"
|
|
@@ -180,9 +200,15 @@ __decorateClass([
|
|
|
180
200
|
__decorateClass([
|
|
181
201
|
property({ reflect: true })
|
|
182
202
|
], DSAAlert.prototype, "variant", 2);
|
|
203
|
+
__decorateClass([
|
|
204
|
+
property({ type: Number })
|
|
205
|
+
], DSAAlert.prototype, "duration", 2);
|
|
183
206
|
__decorateClass([
|
|
184
207
|
watch("open", { waitUntilFirstUpdate: true })
|
|
185
208
|
], DSAAlert.prototype, "handleOpenChange", 1);
|
|
209
|
+
__decorateClass([
|
|
210
|
+
watch("duration")
|
|
211
|
+
], DSAAlert.prototype, "handleDurationChange", 1);
|
|
186
212
|
DSAAlert = __decorateClass([
|
|
187
213
|
customElement("dsa-alert")
|
|
188
214
|
], DSAAlert);
|
|
@@ -89,7 +89,7 @@ var DSACheckboxGroup = class extends ShoelaceElement {
|
|
|
89
89
|
if (!target) {
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
|
-
if (target.disabled) {
|
|
92
|
+
if (target.disabled || "readonly" in target && target.readonly) {
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
95
|
const oldValue = this.value;
|
|
@@ -111,7 +111,7 @@ var DSACheckboxGroup = class extends ShoelaceElement {
|
|
|
111
111
|
const target = event.target;
|
|
112
112
|
if (event.key === " ") {
|
|
113
113
|
event.preventDefault();
|
|
114
|
-
if (target.disabled) {
|
|
114
|
+
if (target.disabled || "readonly" in target && target.readonly) {
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
target.checked = !target.checked;
|
|
@@ -137,6 +137,15 @@ var radio_styles_default = css`
|
|
|
137
137
|
.radio__label.radio__label--error {
|
|
138
138
|
color: var(--dsa-wc-input-label-color-error) !important;
|
|
139
139
|
}
|
|
140
|
+
|
|
141
|
+
/* Readonly */
|
|
142
|
+
.radio--readonly {
|
|
143
|
+
cursor: not-allowed;
|
|
144
|
+
}
|
|
145
|
+
.radio--readonly .radio__control {
|
|
146
|
+
border-color: var(--dsa-wc-radio-border-color-readonly);
|
|
147
|
+
color: var(--dsa-wc-radio-color-readonly);
|
|
148
|
+
}
|
|
140
149
|
`;
|
|
141
150
|
|
|
142
151
|
export {
|
|
@@ -44,6 +44,13 @@ var translation = {
|
|
|
44
44
|
stepInProgress: "\xC9tape en cours",
|
|
45
45
|
stepError: "\xC9tape en erreur",
|
|
46
46
|
errorMessagePanelCodePrefix: "Code d'erreur: ",
|
|
47
|
+
fileSelect: (multiple) => {
|
|
48
|
+
if (multiple)
|
|
49
|
+
return "S\xE9lect. fichiers";
|
|
50
|
+
return "Choisir un fichier";
|
|
51
|
+
},
|
|
52
|
+
clearFile: "Retirer le fichier",
|
|
53
|
+
uploadFileProgressBar: "Barre de progression pour le t\xE9l\xE9chargement de fichiers",
|
|
47
54
|
// countries
|
|
48
55
|
fr_FR: "France",
|
|
49
56
|
fr_GP: "Guadeloupe",
|
|
@@ -102,6 +109,13 @@ var translation2 = {
|
|
|
102
109
|
stepInProgress: "Step in progress",
|
|
103
110
|
stepError: "Step in error",
|
|
104
111
|
errorMessagePanelCodePrefix: "Error code: ",
|
|
112
|
+
fileSelect: (multiple) => {
|
|
113
|
+
if (multiple)
|
|
114
|
+
return "Select files";
|
|
115
|
+
return "Choose a file";
|
|
116
|
+
},
|
|
117
|
+
clearFile: "Remove file",
|
|
118
|
+
uploadFileProgressBar: "Upload file progress bar",
|
|
105
119
|
// countries
|
|
106
120
|
fr_FR: "France",
|
|
107
121
|
fr_GP: "Guadeloupe",
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
footer_content_block_styles_default
|
|
3
|
+
} from "./chunk.SUFR3KIW.js";
|
|
4
|
+
import {
|
|
5
|
+
ShoelaceElement
|
|
6
|
+
} from "./chunk.YCXTCVAZ.js";
|
|
7
|
+
import {
|
|
8
|
+
__decorateClass
|
|
9
|
+
} from "./chunk.6M63UXML.js";
|
|
10
|
+
|
|
11
|
+
// src/components/footer-content-block/footer-content-block.ts
|
|
12
|
+
import { html } from "lit";
|
|
13
|
+
import { customElement } from "lit/decorators.js";
|
|
14
|
+
var DSAFooterContentBlock = class extends ShoelaceElement {
|
|
15
|
+
render() {
|
|
16
|
+
return html`
|
|
17
|
+
<div part="base">
|
|
18
|
+
<slot part="title" name="title"></slot>
|
|
19
|
+
<slot part="content" name="content"></slot>
|
|
20
|
+
</div>
|
|
21
|
+
`;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
DSAFooterContentBlock.styles = footer_content_block_styles_default;
|
|
25
|
+
DSAFooterContentBlock = __decorateClass([
|
|
26
|
+
customElement("dsa-footer-content-block")
|
|
27
|
+
], DSAFooterContentBlock);
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
DSAFooterContentBlock
|
|
31
|
+
};
|