@italia/upload 1.0.0-alpha.17 → 1.0.0-alpha.19
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/custom-elements.json +50 -15
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/it-upload-avatar.d.ts +0 -1
- package/dist/src/it-upload-avatar.d.ts.map +1 -1
- package/dist/src/it-upload-avatar.js +24 -26
- package/dist/src/it-upload-avatar.js.map +1 -1
- package/dist/src/it-upload-drag-drop.d.ts +4 -0
- package/dist/src/it-upload-drag-drop.d.ts.map +1 -1
- package/dist/src/it-upload-drag-drop.js +108 -53
- package/dist/src/it-upload-drag-drop.js.map +1 -1
- package/dist/src/it-upload.d.ts.map +1 -1
- package/dist/src/it-upload.js +61 -17
- package/dist/src/it-upload.js.map +1 -1
- package/dist/src/types.d.ts +2 -0
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +6 -6
package/custom-elements.json
CHANGED
|
@@ -322,6 +322,16 @@
|
|
|
322
322
|
"description": "Custom illustration URL. If not set, the built-in illustration is used.",
|
|
323
323
|
"attribute": "illustration"
|
|
324
324
|
},
|
|
325
|
+
{
|
|
326
|
+
"kind": "field",
|
|
327
|
+
"name": "headingLevel",
|
|
328
|
+
"type": {
|
|
329
|
+
"text": "DragDropHeadingLevel"
|
|
330
|
+
},
|
|
331
|
+
"default": "'h5'",
|
|
332
|
+
"description": "Heading level for the title element. Defaults to 'h5'; visual size stays at h5.",
|
|
333
|
+
"attribute": "heading-level"
|
|
334
|
+
},
|
|
325
335
|
{
|
|
326
336
|
"kind": "field",
|
|
327
337
|
"name": "_currentFile",
|
|
@@ -395,6 +405,16 @@
|
|
|
395
405
|
"privacy": "private",
|
|
396
406
|
"default": "false"
|
|
397
407
|
},
|
|
408
|
+
{
|
|
409
|
+
"kind": "method",
|
|
410
|
+
"name": "getHeadingLevel",
|
|
411
|
+
"privacy": "protected",
|
|
412
|
+
"return": {
|
|
413
|
+
"type": {
|
|
414
|
+
"text": "DragDropHeadingLevel"
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
},
|
|
398
418
|
{
|
|
399
419
|
"kind": "field",
|
|
400
420
|
"name": "_formClass",
|
|
@@ -562,18 +582,6 @@
|
|
|
562
582
|
}
|
|
563
583
|
],
|
|
564
584
|
"events": [
|
|
565
|
-
{
|
|
566
|
-
"name": "it-dd-start",
|
|
567
|
-
"type": {
|
|
568
|
-
"text": "CustomEvent"
|
|
569
|
-
}
|
|
570
|
-
},
|
|
571
|
-
{
|
|
572
|
-
"name": "it-dd-drop",
|
|
573
|
-
"type": {
|
|
574
|
-
"text": "CustomEvent"
|
|
575
|
-
}
|
|
576
|
-
},
|
|
577
585
|
{
|
|
578
586
|
"name": "it-change",
|
|
579
587
|
"type": {
|
|
@@ -597,6 +605,15 @@
|
|
|
597
605
|
},
|
|
598
606
|
"description": "Custom illustration URL. If not set, the built-in illustration is used.",
|
|
599
607
|
"fieldName": "illustration"
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
"name": "heading-level",
|
|
611
|
+
"type": {
|
|
612
|
+
"text": "DragDropHeadingLevel"
|
|
613
|
+
},
|
|
614
|
+
"default": "'h5'",
|
|
615
|
+
"description": "Heading level for the title element. Defaults to 'h5'; visual size stays at h5.",
|
|
616
|
+
"fieldName": "headingLevel"
|
|
600
617
|
}
|
|
601
618
|
],
|
|
602
619
|
"superclass": {
|
|
@@ -1114,8 +1131,26 @@
|
|
|
1114
1131
|
{
|
|
1115
1132
|
"kind": "javascript-module",
|
|
1116
1133
|
"path": "src/types.ts",
|
|
1117
|
-
"declarations": [
|
|
1118
|
-
|
|
1134
|
+
"declarations": [
|
|
1135
|
+
{
|
|
1136
|
+
"kind": "variable",
|
|
1137
|
+
"name": "DRAG_DROP_HEADING_LEVELS",
|
|
1138
|
+
"type": {
|
|
1139
|
+
"text": "['h2', 'h3', 'h4', 'h5', 'h6']"
|
|
1140
|
+
},
|
|
1141
|
+
"default": "['h2', 'h3', 'h4', 'h5', 'h6']"
|
|
1142
|
+
}
|
|
1143
|
+
],
|
|
1144
|
+
"exports": [
|
|
1145
|
+
{
|
|
1146
|
+
"kind": "js",
|
|
1147
|
+
"name": "DRAG_DROP_HEADING_LEVELS",
|
|
1148
|
+
"declaration": {
|
|
1149
|
+
"name": "DRAG_DROP_HEADING_LEVELS",
|
|
1150
|
+
"module": "src/types.ts"
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
]
|
|
1119
1154
|
},
|
|
1120
1155
|
{
|
|
1121
1156
|
"kind": "javascript-module",
|
|
@@ -1247,7 +1282,7 @@
|
|
|
1247
1282
|
"type": {
|
|
1248
1283
|
"text": "Story"
|
|
1249
1284
|
},
|
|
1250
|
-
"default": "{ name: 'Esempio interattivo Drag & Drop', tags: ['!autodocs', '!dev'], args: { accept: '', illustration: '', disabled: false, required: false, }, argTypes: { accept: { description: 'Tipi di file accettati, es. \"image/*,.pdf\".', control: 'text', }, illustration: { description: 'URL illustrazione personalizzata. Se omesso viene usata quella predefinita.', control: 'text', }, disabled: { description: 'Disabilita il componente.', control: 'boolean', table: { defaultValue: { summary: 'false' } }, }, required: { description: 'Rende il campo obbligatorio nella validazione del form.', control: 'boolean', table: { defaultValue: { summary: 'false' } }, }, }, parameters: { docs: { canvas: { sourceState: 'closed' }, }, }, render: (params) => renderUploadDragDrop(params as Partial<UploadDragDropProps>), }"
|
|
1285
|
+
"default": "{ name: 'Esempio interattivo Drag & Drop', tags: ['!autodocs', '!dev'], args: { accept: '', illustration: '', disabled: false, required: false, 'heading-level': 'h3', }, argTypes: { accept: { description: 'Tipi di file accettati, es. \"image/*,.pdf\".', control: 'text', }, illustration: { description: 'URL illustrazione personalizzata. Se omesso viene usata quella predefinita.', control: 'text', }, 'heading-level': { description: 'Livello del titolo semantico nella gerarchia della pagina. La dimensione visiva rimane h5.', control: { type: 'select' }, options: DRAG_DROP_HEADING_LEVELS, table: { defaultValue: { summary: 'h5' } }, }, disabled: { description: 'Disabilita il componente.', control: 'boolean', table: { defaultValue: { summary: 'false' } }, }, required: { description: 'Rende il campo obbligatorio nella validazione del form.', control: 'boolean', table: { defaultValue: { summary: 'false' } }, }, }, parameters: { docs: { canvas: { sourceState: 'closed' }, }, }, render: (params) => renderUploadDragDrop(params as Partial<UploadDragDropProps>), }"
|
|
1251
1286
|
},
|
|
1252
1287
|
{
|
|
1253
1288
|
"kind": "variable",
|
package/dist/src/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export { ItUpload } from './it-upload.js';
|
|
2
2
|
export { ItUploadAvatar } from './it-upload-avatar.js';
|
|
3
3
|
export { ItUploadDragDrop } from './it-upload-drag-drop.js';
|
|
4
|
-
import '../en-
|
|
4
|
+
import '../en-czXvriqi.js';
|
|
5
5
|
import 'lit/directive.js';
|
|
6
6
|
import 'lit';
|
|
7
7
|
import 'lit/decorators.js';
|
|
8
8
|
import 'lit/directives/if-defined.js';
|
|
9
9
|
import 'lit/directives/when.js';
|
|
10
10
|
import '../utils-xlxkOHqp.js';
|
|
11
|
+
import 'lit/static-html.js';
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -31,7 +31,6 @@ export declare class ItUploadAvatar extends FormControl {
|
|
|
31
31
|
private _currentFile;
|
|
32
32
|
connectedCallback(): void;
|
|
33
33
|
willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
34
|
-
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
35
34
|
private _handleFileChange;
|
|
36
35
|
render(): import("lit").TemplateResult<1>;
|
|
37
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"it-upload-avatar.d.ts","sourceRoot":"","sources":["../../src/it-upload-avatar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAarE,qBACa,cAAe,SAAQ,WAAW;IAC7C,MAAM,CAAC,MAAM,+BAAU;IAEvB,OAAgB,iBAAiB;;;;;;;MAG/B;IAIF,mBAA4B,qBAAqB,EAAE,qBAAqB,CAGrE;IAGM,YAAY,EAAG,gBAAgB,CAAC;IAEzC,uDAAuD;IAEvD,GAAG,SAAM;IAET,4CAA4C;IAE5C,GAAG,SAAM;IAET,6DAA6D;IAE7D,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAS;IAEvD,0CAA0C;IAE1C,MAAM,SAAa;IAEnB;;;OAGG;IAEH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,6CAA6C;IAE7C,QAAQ,UAAS;IAGjB,OAAO,CAAC,WAAW,CAAM;IAEzB,qEAAqE;IAErE,OAAO,CAAC,YAAY,CAAqB;IAEhC,iBAAiB;IAKjB,UAAU,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"it-upload-avatar.d.ts","sourceRoot":"","sources":["../../src/it-upload-avatar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAarE,qBACa,cAAe,SAAQ,WAAW;IAC7C,MAAM,CAAC,MAAM,+BAAU;IAEvB,OAAgB,iBAAiB;;;;;;;MAG/B;IAIF,mBAA4B,qBAAqB,EAAE,qBAAqB,CAGrE;IAGM,YAAY,EAAG,gBAAgB,CAAC;IAEzC,uDAAuD;IAEvD,GAAG,SAAM;IAET,4CAA4C;IAE5C,GAAG,SAAM;IAET,6DAA6D;IAE7D,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAS;IAEvD,0CAA0C;IAE1C,MAAM,SAAa;IAEnB;;;OAGG;IAEH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,6CAA6C;IAE7C,QAAQ,UAAS;IAGjB,OAAO,CAAC,WAAW,CAAM;IAEzB,qEAAqE;IAErE,OAAO,CAAC,YAAY,CAAqB;IAEhC,iBAAiB;IAKjB,UAAU,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC;IAsB7E,OAAO,CAAC,iBAAiB;IA0BhB,MAAM;CAsDhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerTranslation, t as translation, a as translation$1, F as FormControl, _ as __decorate, b as __metadata, c as FormControlController } from '../en-
|
|
1
|
+
import { r as registerTranslation, t as translation, a as translation$1, F as FormControl, _ as __decorate, b as __metadata, c as FormControlController } from '../en-czXvriqi.js';
|
|
2
2
|
import { css, nothing, html } from 'lit';
|
|
3
3
|
import { query, property, state, customElement } from 'lit/decorators.js';
|
|
4
4
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
@@ -1399,10 +1399,6 @@ select.just-validate-success-field {
|
|
|
1399
1399
|
display: inline-block;
|
|
1400
1400
|
}
|
|
1401
1401
|
|
|
1402
|
-
.it-form__control {
|
|
1403
|
-
display: none;
|
|
1404
|
-
}
|
|
1405
|
-
|
|
1406
1402
|
input.upload-avatar {
|
|
1407
1403
|
position: absolute;
|
|
1408
1404
|
z-index: 1;
|
|
@@ -1548,12 +1544,18 @@ let ItUploadAvatar = class ItUploadAvatar extends FormControl {
|
|
|
1548
1544
|
if (changedProperties.has('src') && !this._currentSrc) {
|
|
1549
1545
|
this._currentSrc = this.src;
|
|
1550
1546
|
}
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
//
|
|
1555
|
-
|
|
1556
|
-
|
|
1547
|
+
// Keep the displayed validation message in sync with the value here (pre-render) rather
|
|
1548
|
+
// than in updated(), so picking/clearing a file refreshes it without scheduling a second
|
|
1549
|
+
// render — avoids Lit's "scheduled an update after an update completed" warning. The native
|
|
1550
|
+
// `?required` attribute still drives checkValidity()/the constraint bubble. Guarded by
|
|
1551
|
+
// `hasUpdated` because `inputElement` only exists once the first render has produced the DOM.
|
|
1552
|
+
if (this.hasUpdated &&
|
|
1553
|
+
!this.customValidation &&
|
|
1554
|
+
(changedProperties.has('_currentFile') || changedProperties.has('_currentSrc'))) {
|
|
1555
|
+
const hasValue = Boolean(this._currentFile || this._currentSrc);
|
|
1556
|
+
const message = this.required && !hasValue ? this.$t('validityRequired') : '';
|
|
1557
|
+
this.inputElement?.setCustomValidity(message);
|
|
1558
|
+
this.validationMessage = message;
|
|
1557
1559
|
}
|
|
1558
1560
|
}
|
|
1559
1561
|
_handleFileChange(e) {
|
|
@@ -1576,13 +1578,14 @@ let ItUploadAvatar = class ItUploadAvatar extends FormControl {
|
|
|
1576
1578
|
composed: true,
|
|
1577
1579
|
}));
|
|
1578
1580
|
}
|
|
1579
|
-
// Forward wrapper clicks to the hidden file input.
|
|
1580
|
-
// If the click already originated from the label (which has a `for` association), skip to
|
|
1581
1581
|
render() {
|
|
1582
1582
|
const labelText = this.$t('upload_avatar_label');
|
|
1583
|
+
const fileInputLabel = this.required ? labelText : labelText;
|
|
1583
1584
|
const overlayText = this.overlayLabel ?? this.$t('upload_avatar_overlay_label');
|
|
1584
|
-
|
|
1585
|
+
// A pre-filled `src` or a freshly selected file both satisfy `required`.
|
|
1586
|
+
const hasValue = Boolean(this._currentFile || this._currentSrc);
|
|
1585
1587
|
const isInvalid = this.formControlController.submittedOnce && this.validationMessage.length > 0;
|
|
1588
|
+
const feedbackId = `invalid-feedback-${this._id}`;
|
|
1586
1589
|
return html `
|
|
1587
1590
|
<div class="avatar-upload-wrapper size-${this.size}">
|
|
1588
1591
|
<it-avatar
|
|
@@ -1596,11 +1599,15 @@ let ItUploadAvatar = class ItUploadAvatar extends FormControl {
|
|
|
1596
1599
|
<div class="upload-avatar-container">
|
|
1597
1600
|
<input
|
|
1598
1601
|
type="file"
|
|
1599
|
-
class="upload-avatar"
|
|
1602
|
+
class="upload-avatar it-form__control"
|
|
1600
1603
|
id="${this._id}"
|
|
1601
1604
|
accept="${this.accept}"
|
|
1602
1605
|
?disabled="${this.disabled}"
|
|
1603
|
-
|
|
1606
|
+
?required="${this.required && !hasValue}"
|
|
1607
|
+
aria-label="${fileInputLabel}"
|
|
1608
|
+
aria-required="${this.required ? 'true' : nothing}"
|
|
1609
|
+
aria-invalid="${isInvalid ? 'true' : nothing}"
|
|
1610
|
+
aria-describedby="${ifDefined(isInvalid ? feedbackId : undefined)}"
|
|
1604
1611
|
@change="${this._handleFileChange}"
|
|
1605
1612
|
/>
|
|
1606
1613
|
<label part="overlay-label" for="${this._id}" class="it-upload-avatar-label-container" aria-hidden="true">
|
|
@@ -1614,17 +1621,8 @@ let ItUploadAvatar = class ItUploadAvatar extends FormControl {
|
|
|
1614
1621
|
</div>
|
|
1615
1622
|
</div>
|
|
1616
1623
|
|
|
1617
|
-
<!-- Hidden proxy input: drives native required/validity checking via FormControl base class -->
|
|
1618
|
-
<input
|
|
1619
|
-
type="text"
|
|
1620
|
-
class="it-form__control"
|
|
1621
|
-
.value="${proxyValue}"
|
|
1622
|
-
?required="${this.required}"
|
|
1623
|
-
tabindex="-1"
|
|
1624
|
-
aria-hidden="true"
|
|
1625
|
-
/>
|
|
1626
|
-
|
|
1627
1624
|
<div
|
|
1625
|
+
id="${feedbackId}"
|
|
1628
1626
|
class="invalid-feedback form-feedback form-text just-validate-error-label"
|
|
1629
1627
|
role="alert"
|
|
1630
1628
|
?hidden=${!isInvalid}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"it-upload-avatar.js","sources":["../../../src/it-upload-avatar.ts"],"sourcesContent":["import { FormControl, FormControlController } from '@italia/globals';\nimport { registerTranslation } from '@italia/i18n';\nimport { html, nothing } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nimport it from './locales/it.js';\nimport en from './locales/en.js';\nimport styles from './upload-avatar.scss';\n\nregisterTranslation(it);\nregisterTranslation(en);\n\n@customElement('it-upload-avatar')\nexport class ItUploadAvatar extends FormControl {\n static styles = styles;\n\n static override shadowRootOptions = {\n ...FormControl.shadowRootOptions,\n delegatesFocus: true,\n };\n\n // Override the base FormControlController.\n // Value is the selected File, or falls back to the current src (pre-filled image satisfies required).\n protected override readonly formControlController: FormControlController = new FormControlController(this, {\n value: (el) => (el as ItUploadAvatar)._currentFile ?? ((el as ItUploadAvatar)._currentSrc || null),\n assumeInteractionOn: ['it-change'],\n });\n\n @query('.it-form__control')\n override inputElement!: HTMLInputElement;\n\n /** Current image source URL displayed in the avatar */\n @property({ type: String, reflect: true })\n src = '';\n\n /** Alt text for the current avatar image */\n @property({ type: String, reflect: true })\n alt = '';\n\n /** Size of the avatar. Accepts any BSI avatar size token. */\n @property({ type: String, reflect: true })\n size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' = 'xxl';\n\n /** Accepted file types, e.g. \"image/*\" */\n @property({ type: String })\n accept = 'image/*';\n\n /**\n * Text shown inside the desktop hover/focus overlay.\n * Defaults to the i18n key `upload_avatar_overlay_label` (\"Aggiorna\" / \"Update\").\n */\n @property({ type: String, attribute: 'overlay-label' })\n overlayLabel?: string;\n\n /** If true, the upload button is disabled */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n @state()\n private _currentSrc = '';\n\n /** The currently selected File (null until a new file is chosen). */\n @state()\n private _currentFile: File | null = null;\n\n override connectedCallback() {\n super.connectedCallback?.();\n this._currentSrc = this.src;\n }\n\n override willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n super.willUpdate?.(changedProperties);\n if (changedProperties.has('src') && !this._currentSrc) {\n this._currentSrc = this.src;\n }\n }\n\n override updated(changedProperties: Map<string | number | symbol, unknown>) {\n super.updated?.(changedProperties);\n // Re-evaluate validity whenever the form value changes.\n if (changedProperties.has('_currentFile') || changedProperties.has('_currentSrc')) {\n this.handleValidationMessages();\n }\n }\n\n private _handleFileChange(e: Event) {\n const input = e.target as HTMLInputElement;\n const file = input.files?.[0];\n if (!file) return;\n\n this._currentFile = file;\n\n const reader = new FileReader();\n reader.onload = (event) => {\n this._currentSrc = event.target?.result as string;\n this.requestUpdate();\n };\n reader.readAsDataURL(file);\n\n // Reset the native input\n input.value = '';\n\n this.dispatchEvent(\n new CustomEvent('it-change', {\n detail: { file, name: this.name, id: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n // Forward wrapper clicks to the hidden file input.\n // If the click already originated from the label (which has a `for` association), skip to\n\n override render() {\n const labelText = this.$t('upload_avatar_label');\n const overlayText = this.overlayLabel ?? this.$t('upload_avatar_overlay_label');\n const proxyValue = this._currentSrc || this._currentFile?.name || '';\n const isInvalid = this.formControlController.submittedOnce && this.validationMessage.length > 0;\n\n return html`\n <div class=\"avatar-upload-wrapper size-${this.size}\">\n <it-avatar\n type=\"image\"\n size=\"${this.size}\"\n src=\"${ifDefined(this._currentSrc || undefined)}\"\n alt=\"${this.alt}\"\n class=\"avatar-upload\"\n ></it-avatar>\n\n <div class=\"upload-avatar-container\">\n <input\n type=\"file\"\n class=\"upload-avatar\"\n id=\"${this._id!}\"\n accept=\"${this.accept}\"\n ?disabled=\"${this.disabled}\"\n aria-label=\"${labelText}\"\n @change=\"${this._handleFileChange}\"\n />\n <label part=\"overlay-label\" for=\"${this._id!}\" class=\"it-upload-avatar-label-container\" aria-hidden=\"true\">\n <it-icon name=\"it-camera\" size=\"sm\" color=\"inverse\" aria-hidden=\"true\"></it-icon>\n <span class=\"it-upload-avatar-label\">${overlayText}</span>\n </label>\n </div>\n\n <div class=\"avatar-upload-icon\" aria-hidden=\"true\">\n <it-icon name=\"it-camera\" size=\"${this.size === 'xl' ? 'xs' : 'sm'}\"></it-icon>\n </div>\n </div>\n\n <!-- Hidden proxy input: drives native required/validity checking via FormControl base class -->\n <input\n type=\"text\"\n class=\"it-form__control\"\n .value=\"${proxyValue}\"\n ?required=\"${this.required}\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n />\n\n <div\n class=\"invalid-feedback form-feedback form-text just-validate-error-label\"\n role=\"alert\"\n ?hidden=${!isInvalid}\n >\n ${isInvalid ? this.validationMessage : nothing}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-upload-avatar': ItUploadAvatar;\n }\n}\n"],"names":["it","en"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AACa,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAIvD,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;AACR,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAOnB,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;;AACjC,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AAItB,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAC1B,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAGT,UAAA,CAAA;AADP,IAAA,KAAK,EAAE;;AACiB,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAIjB,UAAA,CAAA;AADP,IAAA,KAAK,EAAE;;AACiC,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AAlD9B,cAAc,GAAA,UAAA,CAAA;IAD1B,aAAa,CAAC,kBAAkB;AACpB,CAAA,EAAA,cAAc,CA6J1B;;;;"}
|
|
1
|
+
{"version":3,"file":"it-upload-avatar.js","sources":["../../../src/it-upload-avatar.ts"],"sourcesContent":["import { FormControl, FormControlController } from '@italia/globals';\nimport { registerTranslation } from '@italia/i18n';\nimport { html, nothing } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nimport it from './locales/it.js';\nimport en from './locales/en.js';\nimport styles from './upload-avatar.scss';\n\nregisterTranslation(it);\nregisterTranslation(en);\n\n@customElement('it-upload-avatar')\nexport class ItUploadAvatar extends FormControl {\n static styles = styles;\n\n static override shadowRootOptions = {\n ...FormControl.shadowRootOptions,\n delegatesFocus: true,\n };\n\n // Override the base FormControlController.\n // Value is the selected File, or falls back to the current src (pre-filled image satisfies required).\n protected override readonly formControlController: FormControlController = new FormControlController(this, {\n value: (el) => (el as ItUploadAvatar)._currentFile ?? ((el as ItUploadAvatar)._currentSrc || null),\n assumeInteractionOn: ['it-change'],\n });\n\n @query('.it-form__control')\n override inputElement!: HTMLInputElement;\n\n /** Current image source URL displayed in the avatar */\n @property({ type: String, reflect: true })\n src = '';\n\n /** Alt text for the current avatar image */\n @property({ type: String, reflect: true })\n alt = '';\n\n /** Size of the avatar. Accepts any BSI avatar size token. */\n @property({ type: String, reflect: true })\n size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' = 'xxl';\n\n /** Accepted file types, e.g. \"image/*\" */\n @property({ type: String })\n accept = 'image/*';\n\n /**\n * Text shown inside the desktop hover/focus overlay.\n * Defaults to the i18n key `upload_avatar_overlay_label` (\"Aggiorna\" / \"Update\").\n */\n @property({ type: String, attribute: 'overlay-label' })\n overlayLabel?: string;\n\n /** If true, the upload button is disabled */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n @state()\n private _currentSrc = '';\n\n /** The currently selected File (null until a new file is chosen). */\n @state()\n private _currentFile: File | null = null;\n\n override connectedCallback() {\n super.connectedCallback?.();\n this._currentSrc = this.src;\n }\n\n override willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n super.willUpdate?.(changedProperties);\n if (changedProperties.has('src') && !this._currentSrc) {\n this._currentSrc = this.src;\n }\n // Keep the displayed validation message in sync with the value here (pre-render) rather\n // than in updated(), so picking/clearing a file refreshes it without scheduling a second\n // render — avoids Lit's \"scheduled an update after an update completed\" warning. The native\n // `?required` attribute still drives checkValidity()/the constraint bubble. Guarded by\n // `hasUpdated` because `inputElement` only exists once the first render has produced the DOM.\n if (\n this.hasUpdated &&\n !this.customValidation &&\n (changedProperties.has('_currentFile') || changedProperties.has('_currentSrc'))\n ) {\n const hasValue = Boolean(this._currentFile || this._currentSrc);\n const message = this.required && !hasValue ? this.$t('validityRequired') : '';\n this.inputElement?.setCustomValidity(message);\n this.validationMessage = message;\n }\n }\n\n private _handleFileChange(e: Event) {\n const input = e.target as HTMLInputElement;\n const file = input.files?.[0];\n if (!file) return;\n\n this._currentFile = file;\n\n const reader = new FileReader();\n reader.onload = (event) => {\n this._currentSrc = event.target?.result as string;\n this.requestUpdate();\n };\n reader.readAsDataURL(file);\n\n // Reset the native input\n input.value = '';\n\n this.dispatchEvent(\n new CustomEvent('it-change', {\n detail: { file, name: this.name, id: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n override render() {\n const labelText = this.$t('upload_avatar_label');\n const fileInputLabel = this.required ? labelText : labelText;\n const overlayText = this.overlayLabel ?? this.$t('upload_avatar_overlay_label');\n // A pre-filled `src` or a freshly selected file both satisfy `required`.\n const hasValue = Boolean(this._currentFile || this._currentSrc);\n const isInvalid = this.formControlController.submittedOnce && this.validationMessage.length > 0;\n const feedbackId = `invalid-feedback-${this._id}`;\n\n return html`\n <div class=\"avatar-upload-wrapper size-${this.size}\">\n <it-avatar\n type=\"image\"\n size=\"${this.size}\"\n src=\"${ifDefined(this._currentSrc || undefined)}\"\n alt=\"${this.alt}\"\n class=\"avatar-upload\"\n ></it-avatar>\n\n <div class=\"upload-avatar-container\">\n <input\n type=\"file\"\n class=\"upload-avatar it-form__control\"\n id=\"${this._id!}\"\n accept=\"${this.accept}\"\n ?disabled=\"${this.disabled}\"\n ?required=\"${this.required && !hasValue}\"\n aria-label=\"${fileInputLabel}\"\n aria-required=\"${this.required ? 'true' : nothing}\"\n aria-invalid=\"${isInvalid ? 'true' : nothing}\"\n aria-describedby=\"${ifDefined(isInvalid ? feedbackId : undefined)}\"\n @change=\"${this._handleFileChange}\"\n />\n <label part=\"overlay-label\" for=\"${this._id!}\" class=\"it-upload-avatar-label-container\" aria-hidden=\"true\">\n <it-icon name=\"it-camera\" size=\"sm\" color=\"inverse\" aria-hidden=\"true\"></it-icon>\n <span class=\"it-upload-avatar-label\">${overlayText}</span>\n </label>\n </div>\n\n <div class=\"avatar-upload-icon\" aria-hidden=\"true\">\n <it-icon name=\"it-camera\" size=\"${this.size === 'xl' ? 'xs' : 'sm'}\"></it-icon>\n </div>\n </div>\n\n <div\n id=\"${feedbackId}\"\n class=\"invalid-feedback form-feedback form-text just-validate-error-label\"\n role=\"alert\"\n ?hidden=${!isInvalid}\n >\n ${isInvalid ? this.validationMessage : nothing}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-upload-avatar': ItUploadAvatar;\n }\n}\n"],"names":["it","en"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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EAAA,aAAA,EAAA,MAAA,CAAA;AAIjB,UAAA,CAAA;AADP,IAAA,KAAK,EAAE;;AACiC,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AAlD9B,cAAc,GAAA,UAAA,CAAA;IAD1B,aAAa,CAAC,kBAAkB;AACpB,CAAA,EAAA,cAAc,CA+J1B;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FormControl, FormControlController } from '@italia/globals';
|
|
2
|
+
import { type DragDropHeadingLevel } from './types.js';
|
|
2
3
|
export declare class ItUploadDragDrop extends FormControl {
|
|
3
4
|
static styles: import("lit").CSSResultGroup;
|
|
4
5
|
protected readonly formControlController: FormControlController;
|
|
@@ -7,6 +8,8 @@ export declare class ItUploadDragDrop extends FormControl {
|
|
|
7
8
|
accept?: string;
|
|
8
9
|
/** Custom illustration URL. If not set, the built-in illustration is used. */
|
|
9
10
|
illustration?: string;
|
|
11
|
+
/** Heading level for the title element. Defaults to 'h5'; visual size stays at h5. */
|
|
12
|
+
headingLevel: DragDropHeadingLevel;
|
|
10
13
|
/** The currently selected File (null until file is chosen/dropped). */
|
|
11
14
|
private _currentFile;
|
|
12
15
|
private _state;
|
|
@@ -16,6 +19,7 @@ export declare class ItUploadDragDrop extends FormControl {
|
|
|
16
19
|
private _fileType;
|
|
17
20
|
private _indeterminate;
|
|
18
21
|
private _autoStarted;
|
|
22
|
+
protected getHeadingLevel(): DragDropHeadingLevel;
|
|
19
23
|
private get _formClass();
|
|
20
24
|
/** Advance the donut progress. Value must be between 0 and 1. */
|
|
21
25
|
progress(value: number): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"it-upload-drag-drop.d.ts","sourceRoot":"","sources":["../../src/it-upload-drag-drop.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"it-upload-drag-drop.d.ts","sourceRoot":"","sources":["../../src/it-upload-drag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AC;IACb,UAAU,qBAAqB;QAC7B,qBAAqB,EAAE,gBAAgB,CAAC;KACzC;CACF"}
|
|
@@ -1,10 +1,54 @@
|
|
|
1
|
-
import { r as registerTranslation, t as translation, a as translation$1, _ as __decorate, b as __metadata, F as FormControl, c as FormControlController } from '../en-
|
|
1
|
+
import { r as registerTranslation, t as translation, a as translation$1, _ as __decorate, b as __metadata, F as FormControl, c as FormControlController } from '../en-czXvriqi.js';
|
|
2
2
|
import { css, nothing, html } from 'lit';
|
|
3
|
+
import { unsafeStatic, html as html$1 } from 'lit/static-html.js';
|
|
3
4
|
import { query, property, state, customElement } from 'lit/decorators.js';
|
|
4
5
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
6
|
import { f as formatSize } from '../utils-xlxkOHqp.js';
|
|
6
7
|
import 'lit/directive.js';
|
|
7
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Dispatches a cancelable custom event and runs the provided default action
|
|
11
|
+
* only if the consumer did not call `event.preventDefault()`.
|
|
12
|
+
*
|
|
13
|
+
* This is the shared convention used across components (Tabs, Modal, Chip, Alert,
|
|
14
|
+
* Forward, Back) to provide a sensible default JavaScript behavior out of the box
|
|
15
|
+
* while letting consumers intercept and override it. Notification deliberately does
|
|
16
|
+
* NOT use this: its show/close are always caller-initiated (no default markup-driven
|
|
17
|
+
* trigger to override), so there was no real use case for blocking them — see
|
|
18
|
+
* it-notification.ts for the plain (non-cancelable) events it fires instead.
|
|
19
|
+
*
|
|
20
|
+
* ```js
|
|
21
|
+
* el.addEventListener('it-alert-close', (e) => {
|
|
22
|
+
* e.preventDefault(); // block the default removal
|
|
23
|
+
* fetchConfirmation().then((ok) => { // async logic runs after prevention
|
|
24
|
+
* if (ok) e.target.close();
|
|
25
|
+
* });
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* Note: `preventDefault()` must be called synchronously inside the listener.
|
|
30
|
+
* Async code can run afterward; call the component's public method when ready.
|
|
31
|
+
*
|
|
32
|
+
* @param host the element dispatching the event
|
|
33
|
+
* @param name the event name (kebab-case, `it-` prefixed)
|
|
34
|
+
* @param detail the event `detail` payload
|
|
35
|
+
* @param defaultAction the behavior executed when the event is not prevented
|
|
36
|
+
* @returns the dispatched event (inspect `defaultPrevented` if needed)
|
|
37
|
+
*/
|
|
38
|
+
function dispatchCancelable(host, name, detail, defaultAction) {
|
|
39
|
+
const event = new CustomEvent(name, {
|
|
40
|
+
bubbles: true,
|
|
41
|
+
composed: true,
|
|
42
|
+
cancelable: true,
|
|
43
|
+
detail,
|
|
44
|
+
});
|
|
45
|
+
host.dispatchEvent(event);
|
|
46
|
+
if (!event.defaultPrevented) {
|
|
47
|
+
defaultAction();
|
|
48
|
+
}
|
|
49
|
+
return event;
|
|
50
|
+
}
|
|
51
|
+
|
|
8
52
|
var styles = css`@charset "UTF-8";
|
|
9
53
|
*,
|
|
10
54
|
*::before,
|
|
@@ -1133,10 +1177,15 @@ blockquote.blockquote-card.dark .blockquote-footer,
|
|
|
1133
1177
|
display: inline-block;
|
|
1134
1178
|
}
|
|
1135
1179
|
|
|
1136
|
-
.
|
|
1180
|
+
.upload-dragdrop.loading .upload-dragdrop-select-wrap,
|
|
1181
|
+
.upload-dragdrop.success .upload-dragdrop-select-wrap {
|
|
1137
1182
|
display: none;
|
|
1138
1183
|
}
|
|
1139
1184
|
|
|
1185
|
+
.invalid-feedback:not([hidden]) {
|
|
1186
|
+
display: block;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1140
1189
|
.upload-dragdrop-loading it-progress {
|
|
1141
1190
|
display: block;
|
|
1142
1191
|
width: 100%;
|
|
@@ -1158,8 +1207,15 @@ blockquote.blockquote-card.dark .blockquote-footer,
|
|
|
1158
1207
|
display: flex;
|
|
1159
1208
|
align-items: center;
|
|
1160
1209
|
gap: var(--bsi-spacing-xxs, 8px);
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
.upload-dragdrop-text :is(h1, h2, h3, h4, h6) {
|
|
1213
|
+
margin: 0;
|
|
1214
|
+
color: var(--bsi-color-text-base);
|
|
1161
1215
|
}`;
|
|
1162
1216
|
|
|
1217
|
+
const DRAG_DROP_HEADING_LEVELS = ['h2', 'h3', 'h4', 'h5', 'h6'];
|
|
1218
|
+
|
|
1163
1219
|
registerTranslation(translation);
|
|
1164
1220
|
registerTranslation(translation$1);
|
|
1165
1221
|
// Base64‑encoded copy of bootstrap-italia/dist/assets/upload-drag-drop-icon.svg
|
|
@@ -1173,6 +1229,8 @@ let ItUploadDragDrop = class ItUploadDragDrop extends FormControl {
|
|
|
1173
1229
|
value: (el) => el._currentFile,
|
|
1174
1230
|
assumeInteractionOn: ['it-change'],
|
|
1175
1231
|
});
|
|
1232
|
+
/** Heading level for the title element. Defaults to 'h5'; visual size stays at h5. */
|
|
1233
|
+
this.headingLevel = 'h5';
|
|
1176
1234
|
/** The currently selected File (null until file is chosen/dropped). */
|
|
1177
1235
|
this._currentFile = null;
|
|
1178
1236
|
this._state = 'idle';
|
|
@@ -1183,6 +1241,9 @@ let ItUploadDragDrop = class ItUploadDragDrop extends FormControl {
|
|
|
1183
1241
|
this._indeterminate = false;
|
|
1184
1242
|
this._autoStarted = false;
|
|
1185
1243
|
}
|
|
1244
|
+
getHeadingLevel() {
|
|
1245
|
+
return DRAG_DROP_HEADING_LEVELS.includes(this.headingLevel) ? this.headingLevel : 'h5';
|
|
1246
|
+
}
|
|
1186
1247
|
get _formClass() {
|
|
1187
1248
|
return this.composeClass('upload-dragdrop', this._state === 'dragover' ? 'dragover' : '', this._state === 'loading' ? 'loading' : '', this._state === 'success' ? 'success' : '');
|
|
1188
1249
|
}
|
|
@@ -1223,17 +1284,11 @@ let ItUploadDragDrop = class ItUploadDragDrop extends FormControl {
|
|
|
1223
1284
|
this._preventEvent(e);
|
|
1224
1285
|
if (this.disabled || this._state === 'success' || this._state === 'loading')
|
|
1225
1286
|
return;
|
|
1226
|
-
const
|
|
1227
|
-
cancelable: true,
|
|
1228
|
-
bubbles: true,
|
|
1229
|
-
composed: true,
|
|
1230
|
-
detail: {},
|
|
1231
|
-
}));
|
|
1232
|
-
if (!cancelled) {
|
|
1287
|
+
const event = dispatchCancelable(this, 'it-dd-start', {}, () => {
|
|
1233
1288
|
this.start();
|
|
1234
1289
|
this._autoStarted = true;
|
|
1235
|
-
}
|
|
1236
|
-
|
|
1290
|
+
});
|
|
1291
|
+
if (event.defaultPrevented) {
|
|
1237
1292
|
this._state = 'dragover';
|
|
1238
1293
|
}
|
|
1239
1294
|
}
|
|
@@ -1276,17 +1331,11 @@ let ItUploadDragDrop = class ItUploadDragDrop extends FormControl {
|
|
|
1276
1331
|
this._fileWeight = formatSize(file.size);
|
|
1277
1332
|
this._fileType = this._extractFileType(file.name);
|
|
1278
1333
|
this._autoStarted = false;
|
|
1279
|
-
|
|
1280
|
-
cancelable: true,
|
|
1281
|
-
bubbles: true,
|
|
1282
|
-
composed: true,
|
|
1283
|
-
detail: { file, name: this.name, id: this.id },
|
|
1284
|
-
}));
|
|
1285
|
-
if (!dropCancelled) {
|
|
1334
|
+
dispatchCancelable(this, 'it-dd-drop', { file, name: this.name, id: this.id }, () => {
|
|
1286
1335
|
if (this._state !== 'loading')
|
|
1287
1336
|
this.start();
|
|
1288
1337
|
this._indeterminate = true;
|
|
1289
|
-
}
|
|
1338
|
+
});
|
|
1290
1339
|
this.dispatchEvent(new CustomEvent('it-change', {
|
|
1291
1340
|
detail: { file, name: this.name, id: this.id },
|
|
1292
1341
|
bubbles: true,
|
|
@@ -1303,16 +1352,10 @@ let ItUploadDragDrop = class ItUploadDragDrop extends FormControl {
|
|
|
1303
1352
|
this._fileWeight = formatSize(file.size);
|
|
1304
1353
|
this._fileType = this._extractFileType(file.name);
|
|
1305
1354
|
input.value = '';
|
|
1306
|
-
|
|
1307
|
-
cancelable: true,
|
|
1308
|
-
bubbles: true,
|
|
1309
|
-
composed: true,
|
|
1310
|
-
detail: { file, name: this.name, id: this.id },
|
|
1311
|
-
}));
|
|
1312
|
-
if (!dropCancelled) {
|
|
1355
|
+
dispatchCancelable(this, 'it-dd-drop', { file, name: this.name, id: this.id }, () => {
|
|
1313
1356
|
this.start();
|
|
1314
1357
|
this._indeterminate = true;
|
|
1315
|
-
}
|
|
1358
|
+
});
|
|
1316
1359
|
this.dispatchEvent(new CustomEvent('it-change', {
|
|
1317
1360
|
detail: { file, name: this.name, id: this.id },
|
|
1318
1361
|
bubbles: true,
|
|
@@ -1335,6 +1378,11 @@ let ItUploadDragDrop = class ItUploadDragDrop extends FormControl {
|
|
|
1335
1378
|
const hasFile = this._fileName.length > 0;
|
|
1336
1379
|
// Title: slot or default per state
|
|
1337
1380
|
const titleText = hasFile ? this._fileName : this.$t('upload_dd_title');
|
|
1381
|
+
const fileInputLabel = this.required ? this.$t('upload_label') : this.$t('upload_label');
|
|
1382
|
+
const canSelect = this._state === 'idle' || this._state === 'dragover';
|
|
1383
|
+
const isInvalid = this.formControlController.submittedOnce && this.validationMessage.length > 0;
|
|
1384
|
+
const feedbackId = `invalid-feedback-${this._id}`;
|
|
1385
|
+
const headingTag = unsafeStatic(this.getHeadingLevel());
|
|
1338
1386
|
return html `
|
|
1339
1387
|
<div class="upload-dragdrop-text">
|
|
1340
1388
|
${hasFile && this._fileWeight
|
|
@@ -1345,28 +1393,35 @@ let ItUploadDragDrop = class ItUploadDragDrop extends FormControl {
|
|
|
1345
1393
|
</p>
|
|
1346
1394
|
`
|
|
1347
1395
|
: nothing}
|
|
1348
|
-
|
|
1396
|
+
${html$1 `<${headingTag} class="h5">
|
|
1349
1397
|
<slot name="title">${titleText}</slot>
|
|
1350
|
-
|
|
1351
|
-
${this._state === 'idle' || this._state === 'dragover'
|
|
1398
|
+
</${headingTag}>`} ${canSelect
|
|
1352
1399
|
? html `
|
|
1353
1400
|
<p>
|
|
1354
1401
|
<slot name="description">${this.$t('upload_dd_description')}</slot>
|
|
1355
1402
|
</p>
|
|
1356
|
-
<p>
|
|
1357
|
-
<input
|
|
1358
|
-
type="file"
|
|
1359
|
-
class="upload-dragdrop-input"
|
|
1360
|
-
id="${this._id}"
|
|
1361
|
-
accept="${ifDefined(this.accept)}"
|
|
1362
|
-
?disabled="${this.disabled}"
|
|
1363
|
-
aria-label="${this.$t('upload_label')}"
|
|
1364
|
-
@change="${this._onFileInputChange}"
|
|
1365
|
-
/>
|
|
1366
|
-
<label for="${this._id}">${this.$t('upload_dd_select')}</label>
|
|
1367
|
-
</p>
|
|
1368
1403
|
`
|
|
1369
1404
|
: nothing}
|
|
1405
|
+
<!-- The file input is the form-control validity participant, so it must exist in every
|
|
1406
|
+
state for the FormControl base class to read its validity. It is the real focusable
|
|
1407
|
+
control native required/validity now anchors to (no hidden proxy). The select affordance
|
|
1408
|
+
(label) and this wrapper are hidden via CSS in loading/success states. -->
|
|
1409
|
+
<p class="upload-dragdrop-select-wrap">
|
|
1410
|
+
<input
|
|
1411
|
+
type="file"
|
|
1412
|
+
class="upload-dragdrop-input it-form__control"
|
|
1413
|
+
id="${this._id}"
|
|
1414
|
+
accept="${ifDefined(this.accept)}"
|
|
1415
|
+
?disabled="${this.disabled}"
|
|
1416
|
+
?required="${this.required && !this._currentFile}"
|
|
1417
|
+
aria-label="${fileInputLabel}"
|
|
1418
|
+
aria-required="${this.required ? 'true' : nothing}"
|
|
1419
|
+
aria-invalid="${isInvalid ? 'true' : nothing}"
|
|
1420
|
+
aria-describedby="${ifDefined(isInvalid ? feedbackId : undefined)}"
|
|
1421
|
+
@change="${this._onFileInputChange}"
|
|
1422
|
+
/>
|
|
1423
|
+
${canSelect ? html `<label for="${this._id}">${this.$t('upload_dd_select')}</label>` : nothing}
|
|
1424
|
+
</p>
|
|
1370
1425
|
${this._state === 'loading' ? html `<p>${this.$t('upload_dd_status_loading')}</p>` : nothing}
|
|
1371
1426
|
${this._state === 'success' ? html `<p>${this.$t('upload_dd_status_success')}</p>` : nothing}
|
|
1372
1427
|
</div>
|
|
@@ -1375,6 +1430,7 @@ let ItUploadDragDrop = class ItUploadDragDrop extends FormControl {
|
|
|
1375
1430
|
render() {
|
|
1376
1431
|
const statusText = this._getStatusText();
|
|
1377
1432
|
const isInvalid = this.formControlController.submittedOnce && this.validationMessage.length > 0;
|
|
1433
|
+
const feedbackId = `invalid-feedback-${this._id}`;
|
|
1378
1434
|
return html `
|
|
1379
1435
|
<div
|
|
1380
1436
|
part="drop-zone"
|
|
@@ -1408,17 +1464,12 @@ let ItUploadDragDrop = class ItUploadDragDrop extends FormControl {
|
|
|
1408
1464
|
<div role="status" aria-live="polite" aria-atomic="true" class="visually-hidden">${statusText}</div>
|
|
1409
1465
|
</div>
|
|
1410
1466
|
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
tabindex="-1"
|
|
1418
|
-
aria-hidden="true"
|
|
1419
|
-
/>
|
|
1420
|
-
|
|
1421
|
-
<div class="invalid-feedback form-feedback form-text just-validate-error-label" role="alert">
|
|
1467
|
+
<div
|
|
1468
|
+
id="${feedbackId}"
|
|
1469
|
+
class="invalid-feedback form-feedback form-text just-validate-error-label"
|
|
1470
|
+
role="alert"
|
|
1471
|
+
?hidden=${!isInvalid}
|
|
1472
|
+
>
|
|
1422
1473
|
${isInvalid ? this.validationMessage : nothing}
|
|
1423
1474
|
</div>
|
|
1424
1475
|
`;
|
|
@@ -1437,6 +1488,10 @@ __decorate([
|
|
|
1437
1488
|
property({ type: String }),
|
|
1438
1489
|
__metadata("design:type", String)
|
|
1439
1490
|
], ItUploadDragDrop.prototype, "illustration", void 0);
|
|
1491
|
+
__decorate([
|
|
1492
|
+
property({ type: String, attribute: 'heading-level' }),
|
|
1493
|
+
__metadata("design:type", String)
|
|
1494
|
+
], ItUploadDragDrop.prototype, "headingLevel", void 0);
|
|
1440
1495
|
__decorate([
|
|
1441
1496
|
state(),
|
|
1442
1497
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"it-upload-drag-drop.js","sources":["../../../src/it-upload-drag-drop.ts"],"sourcesContent":["/* eslint-disable class-methods-use-this */\nimport { FormControl, FormControlController } from '@italia/globals';\nimport { registerTranslation } from '@italia/i18n';\nimport { html, nothing } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nimport it from './locales/it.js';\nimport en from './locales/en.js';\nimport styles from './upload-drag-drop.scss';\nimport { formatSize } from './utils.js';\n\nregisterTranslation(it);\nregisterTranslation(en);\n\ntype DragDropState = 'idle' | 'dragover' | 'loading' | 'success';\n\n// Base64‑encoded copy of bootstrap-italia/dist/assets/upload-drag-drop-icon.svg\n// bundled inline so the component works standalone without a public assets path.\nconst DRAG_DROP_ICON_SRC =\n 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTgwcHgiIGhlaWdodD0iMTgwcHgiIHZpZXdCb3g9IjAgMCAxODAgMTgwIiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPHRpdGxlPmljb248L3RpdGxlPgogICAgPGcgaWQ9IlVwbG9hZCIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9IkFydGJvYXJkIj4KICAgICAgICAgICAgPGcgaWQ9Imljb24iPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZSIgZmlsbD0iI0QxRTdGRiIgeD0iMCIgeT0iMCIgd2lkdGg9IjE4MCIgaGVpZ2h0PSIxODAiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxnIGlkPSJHcm91cC02LUNvcHkiIHRyYW5zZm9ybT0idHJhbnNs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AgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+';\n\n@customElement('it-upload-drag-drop')\nexport class ItUploadDragDrop extends FormControl {\n static styles = styles;\n\n // Override the base FormControlController: value is the selected File.\n protected override readonly formControlController: FormControlController = new FormControlController(this, {\n value: (el) => (el as ItUploadDragDrop)._currentFile,\n assumeInteractionOn: ['it-change'],\n });\n\n @query('.it-form__control')\n override inputElement!: HTMLInputElement;\n\n /** Accepted file types, e.g. \"image/*,.pdf\" */\n @property({ type: String })\n accept?: string;\n\n /** Custom illustration URL. If not set, the built-in illustration is used. */\n @property({ type: String })\n illustration?: string;\n\n /** The currently selected File (null until file is chosen/dropped). */\n @state()\n private _currentFile: File | null = null;\n\n @state()\n private _state: DragDropState = 'idle';\n\n @state()\n private _progress = 0;\n\n @state()\n private _fileName = '';\n\n @state()\n private _fileWeight = '';\n\n @state()\n private _fileType = '';\n\n @state()\n private _indeterminate = false;\n\n private _autoStarted = false;\n\n private get _formClass(): string {\n return this.composeClass(\n 'upload-dragdrop',\n this._state === 'dragover' ? 'dragover' : '',\n this._state === 'loading' ? 'loading' : '',\n this._state === 'success' ? 'success' : '',\n );\n }\n\n /** Advance the donut progress. Value must be between 0 and 1. */\n public progress(value: number) {\n this._indeterminate = false;\n const clamped = Math.min(1, Math.max(0, value));\n this._progress = Math.round(clamped * 100);\n }\n\n /** Transition to the loading state, starting the progress animation. */\n public start() {\n this._state = 'loading';\n }\n\n /** Mark upload as successful. */\n public success() {\n this._state = 'success';\n }\n\n /** Reset to idle state with progress at 0. */\n public reset() {\n this._state = 'idle';\n this._progress = 0;\n this._indeterminate = false;\n this._autoStarted = false;\n this._fileName = '';\n this._fileWeight = '';\n this._fileType = '';\n this._currentFile = null;\n }\n\n private _extractFileType(fileName: string): string {\n const ext = fileName.split('.').pop();\n return ext ? ext.toUpperCase() : '';\n }\n\n private _preventEvent(e: DragEvent) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n private _onDragEnter(e: DragEvent) {\n this._preventEvent(e);\n if (this.disabled || this._state === 'success' || this._state === 'loading') return;\n const cancelled = !this.dispatchEvent(\n new CustomEvent('it-dd-start', {\n cancelable: true,\n bubbles: true,\n composed: true,\n detail: {},\n }),\n );\n if (!cancelled) {\n this.start();\n this._autoStarted = true;\n } else {\n this._state = 'dragover';\n }\n }\n\n private _onDragOver(e: DragEvent) {\n e.preventDefault();\n if (this.disabled || this._state === 'success') return;\n if (this._state === 'idle') this._state = 'dragover';\n }\n\n private _onDragLeave(e: DragEvent) {\n this._preventEvent(e);\n if (this.disabled) return;\n if (this._state === 'dragover') {\n this._state = 'idle';\n } else if (this._state === 'loading' && this._autoStarted && !this._currentFile) {\n this._state = 'idle';\n this._autoStarted = false;\n }\n }\n\n private _onDragEnd(e: DragEvent) {\n this._preventEvent(e);\n if (this.disabled) return;\n if (this._state === 'dragover') {\n this._state = 'idle';\n }\n }\n\n private _onDrop(e: DragEvent) {\n this._preventEvent(e);\n if (this.disabled || this._state === 'success') return;\n\n const file = e.dataTransfer?.files?.[0];\n if (!file) return;\n\n this._currentFile = file;\n this._fileName = file.name;\n this._fileWeight = formatSize(file.size);\n this._fileType = this._extractFileType(file.name);\n this._autoStarted = false;\n\n const dropCancelled = !this.dispatchEvent(\n new CustomEvent('it-dd-drop', {\n cancelable: true,\n bubbles: true,\n composed: true,\n detail: { file, name: this.name, id: this.id },\n }),\n );\n if (!dropCancelled) {\n if (this._state !== 'loading') this.start();\n this._indeterminate = true;\n }\n\n this.dispatchEvent(\n new CustomEvent('it-change', {\n detail: { file, name: this.name, id: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private _onFileInputChange(e: Event) {\n const input = e.target as HTMLInputElement;\n const file = input.files?.[0];\n if (!file) return;\n\n this._currentFile = file;\n this._fileName = file.name;\n this._fileWeight = formatSize(file.size);\n this._fileType = this._extractFileType(file.name);\n input.value = '';\n\n const dropCancelled = !this.dispatchEvent(\n new CustomEvent('it-dd-drop', {\n cancelable: true,\n bubbles: true,\n composed: true,\n detail: { file, name: this.name, id: this.id },\n }),\n );\n if (!dropCancelled) {\n this.start();\n this._indeterminate = true;\n }\n\n this.dispatchEvent(\n new CustomEvent('it-change', {\n detail: { file, name: this.name, id: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private _getStatusText(): string {\n switch (this._state) {\n case 'dragover':\n return this.$t('upload_dd_status_dragover');\n case 'loading':\n return this.$t('upload_dd_status_loading');\n case 'success':\n return this.$t('upload_dd_status_success');\n default:\n return '';\n }\n }\n\n private _renderTextContent() {\n const hasFile = this._fileName.length > 0;\n\n // Title: slot or default per state\n const titleText = hasFile ? this._fileName : this.$t('upload_dd_title');\n\n return html`\n <div class=\"upload-dragdrop-text\">\n ${hasFile && this._fileWeight\n ? html`\n <p class=\"upload-dragdrop-weight\">\n <it-icon name=\"it-file\" size=\"xs\" aria-hidden=\"true\" color=\"secondary\"></it-icon>\n <span>${this._fileType ? `${this._fileType} ` : ''}(${this._fileWeight})</span>\n </p>\n `\n : nothing}\n <h5>\n <slot name=\"title\">${titleText}</slot>\n </h5>\n ${this._state === 'idle' || this._state === 'dragover'\n ? html`\n <p>\n <slot name=\"description\">${this.$t('upload_dd_description')}</slot>\n </p>\n <p>\n <input\n type=\"file\"\n class=\"upload-dragdrop-input\"\n id=\"${this._id!}\"\n accept=\"${ifDefined(this.accept)}\"\n ?disabled=\"${this.disabled}\"\n aria-label=\"${this.$t('upload_label')}\"\n @change=\"${this._onFileInputChange}\"\n />\n <label for=\"${this._id!}\">${this.$t('upload_dd_select')}</label>\n </p>\n `\n : nothing}\n ${this._state === 'loading' ? html`<p>${this.$t('upload_dd_status_loading')}</p>` : nothing}\n ${this._state === 'success' ? html`<p>${this.$t('upload_dd_status_success')}</p>` : nothing}\n </div>\n `;\n }\n\n override render() {\n const statusText = this._getStatusText();\n const isInvalid = this.formControlController.submittedOnce && this.validationMessage.length > 0;\n\n return html`\n <div\n part=\"drop-zone\"\n class=\"${this._formClass}\"\n @drag=\"${this._preventEvent}\"\n @dragstart=\"${this._preventEvent}\"\n @dragend=\"${this._onDragEnd}\"\n @dragover=\"${this._onDragOver}\"\n @dragenter=\"${this._onDragEnter}\"\n @dragleave=\"${this._onDragLeave}\"\n @drop=\"${this._onDrop}\"\n >\n <div class=\"upload-dragdrop-image\">\n <img src=\"${this.illustration ?? DRAG_DROP_ICON_SRC}\" alt=\"\" aria-hidden=\"true\" width=\"180\" height=\"180\" />\n <div class=\"upload-dragdrop-loading\" aria-hidden=\"${this._state !== 'loading' ? 'true' : nothing}\">\n <it-progress\n type=\"donut\"\n .value=\"${this._indeterminate ? 0 : this._progress}\"\n it-aria-label=\"${this.$t('upload_dd_progress_label')}\"\n ?show-value=\"${!this._indeterminate}\"\n ></it-progress>\n </div>\n <div class=\"upload-dragdrop-success\" aria-hidden=\"${this._state !== 'success' ? 'true' : nothing}\">\n <it-icon name=\"it-check\" aria-hidden=\"true\" color=\"inverse\"></it-icon>\n </div>\n </div>\n\n ${this._renderTextContent()}\n\n <!-- Accessible live region for state announcements -->\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" class=\"visually-hidden\">${statusText}</div>\n </div>\n\n <!-- Hidden proxy input: drives native required/validity checking via FormControl base class -->\n <input\n type=\"text\"\n class=\"it-form__control\"\n .value=\"${this._currentFile?.name || ''}\"\n ?required=\"${this.required}\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n />\n\n <div class=\"invalid-feedback form-feedback form-text just-validate-error-label\" role=\"alert\">\n ${isInvalid ? this.validationMessage : nothing}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-upload-drag-drop': ItUploadDragDrop;\n }\n}\n"],"names":["it","en"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AACe,CAAA,EAAA,gBAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AAGf,UAAA,CAAA;AADP,IAAA,KAAK,EAAE;;AACuB,CAAA,EAAA,gBAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,MAAA,CAAA;AAxCpB,gBAAgB,GAAA,UAAA,CAAA;IAD5B,aAAa,CAAC,qBAAqB;AACvB,CAAA,EAAA,gBAAgB,CAyT5B;;;;"}
|
|
1
|
+
{"version":3,"file":"it-upload-drag-drop.js","sources":["../../../globals/dist/src/utils/dispatch-cancelable.js","../../../src/types.ts","../../../src/it-upload-drag-drop.ts"],"sourcesContent":["/**\n * Dispatches a cancelable custom event and runs the provided default action\n * only if the consumer did not call `event.preventDefault()`.\n *\n * This is the shared convention used across components (Tabs, Modal, Chip, Alert,\n * Forward, Back) to provide a sensible default JavaScript behavior out of the box\n * while letting consumers intercept and override it. Notification deliberately does\n * NOT use this: its show/close are always caller-initiated (no default markup-driven\n * trigger to override), so there was no real use case for blocking them — see\n * it-notification.ts for the plain (non-cancelable) events it fires instead.\n *\n * ```js\n * el.addEventListener('it-alert-close', (e) => {\n * e.preventDefault(); // block the default removal\n * fetchConfirmation().then((ok) => { // async logic runs after prevention\n * if (ok) e.target.close();\n * });\n * });\n * ```\n *\n * Note: `preventDefault()` must be called synchronously inside the listener.\n * Async code can run afterward; call the component's public method when ready.\n *\n * @param host the element dispatching the event\n * @param name the event name (kebab-case, `it-` prefixed)\n * @param detail the event `detail` payload\n * @param defaultAction the behavior executed when the event is not prevented\n * @returns the dispatched event (inspect `defaultPrevented` if needed)\n */\nexport function dispatchCancelable(host, name, detail, defaultAction) {\n const event = new CustomEvent(name, {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail,\n });\n host.dispatchEvent(event);\n if (!event.defaultPrevented) {\n defaultAction();\n }\n return event;\n}\n//# sourceMappingURL=dispatch-cancelable.js.map","export type UploadFileStatus = 'loading' | 'success' | 'error';\n\nexport const DRAG_DROP_HEADING_LEVELS = ['h2', 'h3', 'h4', 'h5', 'h6'] as const;\nexport type DragDropHeadingLevel = (typeof DRAG_DROP_HEADING_LEVELS)[number];\n\nexport type UploadVariant = 'default' | 'gallery';\n\nexport interface UploadFile {\n id: string;\n name: string;\n size: number;\n status: UploadFileStatus;\n progress?: number;\n thumbnail?: string;\n}\n\n/** Internal representation that also carries the raw File reference */\nexport interface UploadInternalFile extends UploadFile {\n _raw: File;\n}\n","/* eslint-disable class-methods-use-this */\nimport { FormControl, FormControlController, dispatchCancelable } from '@italia/globals';\nimport { registerTranslation } from '@italia/i18n';\nimport { html, nothing } from 'lit';\nimport { html as staticHtml, unsafeStatic } from 'lit/static-html.js';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nimport it from './locales/it.js';\nimport en from './locales/en.js';\nimport styles from './upload-drag-drop.scss';\nimport { formatSize } from './utils.js';\nimport { type DragDropHeadingLevel, DRAG_DROP_HEADING_LEVELS } from './types.js';\n\nregisterTranslation(it);\nregisterTranslation(en);\n\ntype DragDropState = 'idle' | 'dragover' | 'loading' | 'success';\n\n// Base64‑encoded copy of bootstrap-italia/dist/assets/upload-drag-drop-icon.svg\n// bundled inline so the component works standalone without a public assets path.\nconst DRAG_DROP_ICON_SRC =\n 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTgwcHgiIGhlaWdodD0iMTgwcHgiIHZpZXdCb3g9IjAgMCAxODAgMTgwIiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPHRpdGxlPmljb248L3RpdGxlPgogICAgPGcgaWQ9IlVwbG9hZCIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw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zMzLDMwLjY3MTkxNDYgQzk0LjE4MDU4OTQsMzAuNzY0Nzg1OSA4OS4xODY5MTEsMjUuOTIxNjgxNSA4OS4wOTQwMzk3LDE5Ljg1NDUzODIgQzg5LjA5MzE4MTgsMTkuNzk4NDg5NSA4OS4wOTI3NTI4LDE5Ljc0MjQzNTEgODkuMDkyNzUyOCwxOS42ODYzNzk5IEw4OS4wOTI3NTI4LDAuODQyNjY2NjQ3IFoiIGZpbGw9IiNGRkZGRkYiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+';\n\n@customElement('it-upload-drag-drop')\nexport class ItUploadDragDrop extends FormControl {\n static styles = styles;\n\n // Override the base FormControlController: value is the selected File.\n protected override readonly formControlController: FormControlController = new FormControlController(this, {\n value: (el) => (el as ItUploadDragDrop)._currentFile,\n assumeInteractionOn: ['it-change'],\n });\n\n @query('.it-form__control')\n override inputElement!: HTMLInputElement;\n\n /** Accepted file types, e.g. \"image/*,.pdf\" */\n @property({ type: String })\n accept?: string;\n\n /** Custom illustration URL. If not set, the built-in illustration is used. */\n @property({ type: String })\n illustration?: string;\n\n /** Heading level for the title element. Defaults to 'h5'; visual size stays at h5. */\n @property({ type: String, attribute: 'heading-level' })\n headingLevel: DragDropHeadingLevel = 'h5';\n\n /** The currently selected File (null until file is chosen/dropped). */\n @state()\n private _currentFile: File | null = null;\n\n @state()\n private _state: DragDropState = 'idle';\n\n @state()\n private _progress = 0;\n\n @state()\n private _fileName = '';\n\n @state()\n private _fileWeight = '';\n\n @state()\n private _fileType = '';\n\n @state()\n private _indeterminate = false;\n\n private _autoStarted = false;\n\n protected getHeadingLevel(): DragDropHeadingLevel {\n return DRAG_DROP_HEADING_LEVELS.includes(this.headingLevel) ? this.headingLevel : 'h5';\n }\n\n private get _formClass(): string {\n return this.composeClass(\n 'upload-dragdrop',\n this._state === 'dragover' ? 'dragover' : '',\n this._state === 'loading' ? 'loading' : '',\n this._state === 'success' ? 'success' : '',\n );\n }\n\n /** Advance the donut progress. Value must be between 0 and 1. */\n public progress(value: number) {\n this._indeterminate = false;\n const clamped = Math.min(1, Math.max(0, value));\n this._progress = Math.round(clamped * 100);\n }\n\n /** Transition to the loading state, starting the progress animation. */\n public start() {\n this._state = 'loading';\n }\n\n /** Mark upload as successful. */\n public success() {\n this._state = 'success';\n }\n\n /** Reset to idle state with progress at 0. */\n public reset() {\n this._state = 'idle';\n this._progress = 0;\n this._indeterminate = false;\n this._autoStarted = false;\n this._fileName = '';\n this._fileWeight = '';\n this._fileType = '';\n this._currentFile = null;\n }\n\n private _extractFileType(fileName: string): string {\n const ext = fileName.split('.').pop();\n return ext ? ext.toUpperCase() : '';\n }\n\n private _preventEvent(e: DragEvent) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n private _onDragEnter(e: DragEvent) {\n this._preventEvent(e);\n if (this.disabled || this._state === 'success' || this._state === 'loading') return;\n const event = dispatchCancelable(this, 'it-dd-start', {}, () => {\n this.start();\n this._autoStarted = true;\n });\n if (event.defaultPrevented) {\n this._state = 'dragover';\n }\n }\n\n private _onDragOver(e: DragEvent) {\n e.preventDefault();\n if (this.disabled || this._state === 'success') return;\n if (this._state === 'idle') this._state = 'dragover';\n }\n\n private _onDragLeave(e: DragEvent) {\n this._preventEvent(e);\n if (this.disabled) return;\n if (this._state === 'dragover') {\n this._state = 'idle';\n } else if (this._state === 'loading' && this._autoStarted && !this._currentFile) {\n this._state = 'idle';\n this._autoStarted = false;\n }\n }\n\n private _onDragEnd(e: DragEvent) {\n this._preventEvent(e);\n if (this.disabled) return;\n if (this._state === 'dragover') {\n this._state = 'idle';\n }\n }\n\n private _onDrop(e: DragEvent) {\n this._preventEvent(e);\n if (this.disabled || this._state === 'success') return;\n\n const file = e.dataTransfer?.files?.[0];\n if (!file) return;\n\n this._currentFile = file;\n this._fileName = file.name;\n this._fileWeight = formatSize(file.size);\n this._fileType = this._extractFileType(file.name);\n this._autoStarted = false;\n\n dispatchCancelable(this, 'it-dd-drop', { file, name: this.name, id: this.id }, () => {\n if (this._state !== 'loading') this.start();\n this._indeterminate = true;\n });\n\n this.dispatchEvent(\n new CustomEvent('it-change', {\n detail: { file, name: this.name, id: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private _onFileInputChange(e: Event) {\n const input = e.target as HTMLInputElement;\n const file = input.files?.[0];\n if (!file) return;\n\n this._currentFile = file;\n this._fileName = file.name;\n this._fileWeight = formatSize(file.size);\n this._fileType = this._extractFileType(file.name);\n input.value = '';\n\n dispatchCancelable(this, 'it-dd-drop', { file, name: this.name, id: this.id }, () => {\n this.start();\n this._indeterminate = true;\n });\n\n this.dispatchEvent(\n new CustomEvent('it-change', {\n detail: { file, name: this.name, id: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private _getStatusText(): string {\n switch (this._state) {\n case 'dragover':\n return this.$t('upload_dd_status_dragover');\n case 'loading':\n return this.$t('upload_dd_status_loading');\n case 'success':\n return this.$t('upload_dd_status_success');\n default:\n return '';\n }\n }\n\n private _renderTextContent() {\n const hasFile = this._fileName.length > 0;\n\n // Title: slot or default per state\n const titleText = hasFile ? this._fileName : this.$t('upload_dd_title');\n const fileInputLabel = this.required ? this.$t('upload_label') : this.$t('upload_label');\n const canSelect = this._state === 'idle' || this._state === 'dragover';\n const isInvalid = this.formControlController.submittedOnce && this.validationMessage.length > 0;\n const feedbackId = `invalid-feedback-${this._id}`;\n const headingTag = unsafeStatic(this.getHeadingLevel());\n\n return html`\n <div class=\"upload-dragdrop-text\">\n ${hasFile && this._fileWeight\n ? html`\n <p class=\"upload-dragdrop-weight\">\n <it-icon name=\"it-file\" size=\"xs\" aria-hidden=\"true\" color=\"secondary\"></it-icon>\n <span>${this._fileType ? `${this._fileType} ` : ''}(${this._fileWeight})</span>\n </p>\n `\n : nothing}\n ${staticHtml`<${headingTag} class=\"h5\">\n <slot name=\"title\">${titleText}</slot>\n </${headingTag}>`} ${canSelect\n ? html`\n <p>\n <slot name=\"description\">${this.$t('upload_dd_description')}</slot>\n </p>\n `\n : nothing}\n <!-- The file input is the form-control validity participant, so it must exist in every\n state for the FormControl base class to read its validity. It is the real focusable\n control native required/validity now anchors to (no hidden proxy). The select affordance\n (label) and this wrapper are hidden via CSS in loading/success states. -->\n <p class=\"upload-dragdrop-select-wrap\">\n <input\n type=\"file\"\n class=\"upload-dragdrop-input it-form__control\"\n id=\"${this._id!}\"\n accept=\"${ifDefined(this.accept)}\"\n ?disabled=\"${this.disabled}\"\n ?required=\"${this.required && !this._currentFile}\"\n aria-label=\"${fileInputLabel}\"\n aria-required=\"${this.required ? 'true' : nothing}\"\n aria-invalid=\"${isInvalid ? 'true' : nothing}\"\n aria-describedby=\"${ifDefined(isInvalid ? feedbackId : undefined)}\"\n @change=\"${this._onFileInputChange}\"\n />\n ${canSelect ? html`<label for=\"${this._id!}\">${this.$t('upload_dd_select')}</label>` : nothing}\n </p>\n ${this._state === 'loading' ? html`<p>${this.$t('upload_dd_status_loading')}</p>` : nothing}\n ${this._state === 'success' ? html`<p>${this.$t('upload_dd_status_success')}</p>` : nothing}\n </div>\n `;\n }\n\n override render() {\n const statusText = this._getStatusText();\n const isInvalid = this.formControlController.submittedOnce && this.validationMessage.length > 0;\n const feedbackId = `invalid-feedback-${this._id}`;\n\n return html`\n <div\n part=\"drop-zone\"\n class=\"${this._formClass}\"\n @drag=\"${this._preventEvent}\"\n @dragstart=\"${this._preventEvent}\"\n @dragend=\"${this._onDragEnd}\"\n @dragover=\"${this._onDragOver}\"\n @dragenter=\"${this._onDragEnter}\"\n @dragleave=\"${this._onDragLeave}\"\n @drop=\"${this._onDrop}\"\n >\n <div class=\"upload-dragdrop-image\">\n <img src=\"${this.illustration ?? DRAG_DROP_ICON_SRC}\" alt=\"\" aria-hidden=\"true\" width=\"180\" height=\"180\" />\n <div class=\"upload-dragdrop-loading\" aria-hidden=\"${this._state !== 'loading' ? 'true' : nothing}\">\n <it-progress\n type=\"donut\"\n .value=\"${this._indeterminate ? 0 : this._progress}\"\n it-aria-label=\"${this.$t('upload_dd_progress_label')}\"\n ?show-value=\"${!this._indeterminate}\"\n ></it-progress>\n </div>\n <div class=\"upload-dragdrop-success\" aria-hidden=\"${this._state !== 'success' ? 'true' : nothing}\">\n <it-icon name=\"it-check\" aria-hidden=\"true\" color=\"inverse\"></it-icon>\n </div>\n </div>\n\n ${this._renderTextContent()}\n\n <!-- Accessible live region for state announcements -->\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" class=\"visually-hidden\">${statusText}</div>\n </div>\n\n <div\n id=\"${feedbackId}\"\n class=\"invalid-feedback form-feedback form-text just-validate-error-label\"\n role=\"alert\"\n ?hidden=${!isInvalid}\n >\n ${isInvalid ? this.validationMessage : nothing}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-upload-drag-drop': ItUploadDragDrop;\n }\n}\n"],"names":["it","en","staticHtml"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE;AACtE,IAAI,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,IAAI,EAAE;AACxC,QAAQ,OAAO,EAAE,IAAI;AACrB,QAAQ,QAAQ,EAAE,IAAI;AACtB,QAAQ,UAAU,EAAE,IAAI;AACxB,QAAQ,MAAM;AACd,KAAK,CAAC;AACN,IAAI,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;AAC7B,IAAI,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE;AACjC,QAAQ,aAAa,EAAE;AACvB,IAAI;AACJ,IAAI,OAAO,KAAK;AAChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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9E,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAI5C,wDAAwD;IACxD,UAAU,CAAC,EAAE,EAAE,MAAM;IAKZ,iBAAiB;IAKjB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC;IAWjE,aAAa,IAAI,OAAO;IAIjC,iFAAiF;cAC9D,wBAAwB;IAI3C,OAAO,CAAC,cAAc;IAWtB,IAAa,QAAQ,IAAI,aAAa,CAErC;IAED,OAAO,CAAC,iBAAiB;IAyCzB,OAAO,CAAC,aAAa;IAkBrB,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,eAAe;IAmBvB,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,oBAAoB;IAI5B,OAAO,CAAC,eAAe;IA4EvB,OAAO,CAAC,kBAAkB;IAsB1B,OAAO,CAAC,eAAe;IAevB,OAAO,CAAC,kBAAkB;IAuDjB,MAAM;CAYhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
package/dist/src/it-upload.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerTranslation, t as translation, a as translation$1, _ as __decorate, b as __metadata, F as FormControl, c as FormControlController } from '../en-
|
|
1
|
+
import { r as registerTranslation, t as translation, a as translation$1, _ as __decorate, b as __metadata, F as FormControl, c as FormControlController } from '../en-czXvriqi.js';
|
|
2
2
|
import { css, html, nothing } from 'lit';
|
|
3
3
|
import { query, queryAssignedElements, property, state, customElement } from 'lit/decorators.js';
|
|
4
4
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
@@ -2122,14 +2122,32 @@ blockquote.blockquote-card.dark .blockquote-footer,
|
|
|
2122
2122
|
display: flex !important;
|
|
2123
2123
|
}
|
|
2124
2124
|
}
|
|
2125
|
-
.upload[type=file]
|
|
2125
|
+
label:has(.upload[type=file]) {
|
|
2126
2126
|
display: flex;
|
|
2127
|
+
overflow: hidden;
|
|
2127
2128
|
width: fit-content;
|
|
2128
2129
|
max-width: unset !important;
|
|
2129
2130
|
align-items: center;
|
|
2131
|
+
padding: var(--bsi-spacing-xs) var(--bsi-spacing-m);
|
|
2132
|
+
border-radius: var(--bsi-form-control-border-radius);
|
|
2133
|
+
margin-bottom: 0;
|
|
2134
|
+
background-color: var(--bsi-color-background-primary);
|
|
2135
|
+
color: var(--bsi-color-text-inverse);
|
|
2136
|
+
cursor: pointer;
|
|
2137
|
+
font-size: 1rem;
|
|
2138
|
+
font-weight: 700;
|
|
2130
2139
|
gap: var(--bsi-spacing-xxs, 8px);
|
|
2140
|
+
transition: background-color var(--bsi-transition-instant);
|
|
2141
|
+
}
|
|
2142
|
+
label:has(.upload[type=file]):hover {
|
|
2143
|
+
background-color: var(--bsi-color-background-primary-hover);
|
|
2131
2144
|
}
|
|
2132
2145
|
|
|
2146
|
+
@media (min-width: 576px) {
|
|
2147
|
+
label:has(.upload[type=file]) {
|
|
2148
|
+
font-size: var(--bsi-label-font-size-s);
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2133
2151
|
:host([required]) .upload-required-feedback {
|
|
2134
2152
|
display: block;
|
|
2135
2153
|
}
|
|
@@ -2147,7 +2165,7 @@ blockquote.blockquote-card.dark .blockquote-footer,
|
|
|
2147
2165
|
}
|
|
2148
2166
|
|
|
2149
2167
|
:focus-visible,
|
|
2150
|
-
.upload:focus-visible
|
|
2168
|
+
label:has(.upload[type=file]:focus-visible),
|
|
2151
2169
|
.upload-dragdrop-input:focus-visible[type=file] + label,
|
|
2152
2170
|
.avatar-upload:focus-within:focus-visible {
|
|
2153
2171
|
border-color: #000 !important;
|
|
@@ -2156,6 +2174,13 @@ blockquote.blockquote-card.dark .blockquote-footer,
|
|
|
2156
2174
|
outline-offset: 3px !important;
|
|
2157
2175
|
}
|
|
2158
2176
|
|
|
2177
|
+
.upload[type=file]:focus-visible {
|
|
2178
|
+
border-color: initial !important;
|
|
2179
|
+
box-shadow: none !important;
|
|
2180
|
+
outline: none !important;
|
|
2181
|
+
outline-offset: initial !important;
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2159
2184
|
.upload-file-actions {
|
|
2160
2185
|
display: flex;
|
|
2161
2186
|
align-items: center;
|
|
@@ -2181,11 +2206,23 @@ blockquote.blockquote-card.dark .blockquote-footer,
|
|
|
2181
2206
|
line-height: 1;
|
|
2182
2207
|
}
|
|
2183
2208
|
|
|
2184
|
-
.upload-pictures-wall .upload[type=file]
|
|
2209
|
+
.upload-pictures-wall label:has(.upload[type=file]) {
|
|
2185
2210
|
display: flex;
|
|
2211
|
+
width: 128px;
|
|
2212
|
+
height: 128px;
|
|
2186
2213
|
flex-direction: column;
|
|
2187
2214
|
align-items: center;
|
|
2188
2215
|
justify-content: center;
|
|
2216
|
+
padding: 0;
|
|
2217
|
+
border: 2px dashed var(--bsi-color-border-primary);
|
|
2218
|
+
border-radius: 0;
|
|
2219
|
+
background-color: var(--bsi-color-border-primary-lighter);
|
|
2220
|
+
color: var(--bsi-color-text-primary);
|
|
2221
|
+
font-weight: 600;
|
|
2222
|
+
transition: border-color var(--bsi-transition-instant);
|
|
2223
|
+
}
|
|
2224
|
+
.upload-pictures-wall label:has(.upload[type=file]):hover {
|
|
2225
|
+
border: 2px dashed var(--bsi-color-border-primary-hover);
|
|
2189
2226
|
}`;
|
|
2190
2227
|
|
|
2191
2228
|
registerTranslation(translation);
|
|
@@ -2488,19 +2525,13 @@ let ItUpload = class ItUpload extends FormControl {
|
|
|
2488
2525
|
const isInvalid = showValidation && this.validationMessage.length > 0;
|
|
2489
2526
|
return html `
|
|
2490
2527
|
<div class="form-group">
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
?disabled="${this.disabled}"
|
|
2499
|
-
?required="${this.required && this._files.length === 0}"
|
|
2500
|
-
aria-invalid="${isInvalid ? 'true' : 'false'}"
|
|
2501
|
-
aria-describedby="${ifDefined(isInvalid ? `invalid-feedback-${inputId}` : undefined)}"
|
|
2502
|
-
@change="${this._handleFileChange}"
|
|
2503
|
-
/>
|
|
2528
|
+
<!-- Wrapping pattern per Scott O'Hara "Styled File Uploads":
|
|
2529
|
+
https://scottaohara.github.io/a11y_styled_form_controls/src/file-upload/
|
|
2530
|
+
Input inside label instead of BSI's sibling pattern (0.1px ghost input +
|
|
2531
|
+
styled adjacent label). BSI's pattern makes VoiceOver visit the ghost as a
|
|
2532
|
+
confusing "small square group" before the real button. With wrapping, both
|
|
2533
|
+
stops are logical: label text → file upload control. No JS needed — click
|
|
2534
|
+
propagation to the file picker is handled natively by the label. -->
|
|
2504
2535
|
<label part="input-label" for="${inputId}">
|
|
2505
2536
|
<slot name="icon">
|
|
2506
2537
|
<it-icon
|
|
@@ -2511,6 +2542,19 @@ let ItUpload = class ItUpload extends FormControl {
|
|
|
2511
2542
|
></it-icon>
|
|
2512
2543
|
</slot>
|
|
2513
2544
|
<slot name="label">${labelText}</slot>
|
|
2545
|
+
<input
|
|
2546
|
+
type="file"
|
|
2547
|
+
class="upload it-form__control"
|
|
2548
|
+
id="${inputId}"
|
|
2549
|
+
name="${this.name}"
|
|
2550
|
+
?multiple="${this.multiple}"
|
|
2551
|
+
accept="${ifDefined(this.accept)}"
|
|
2552
|
+
?disabled="${this.disabled}"
|
|
2553
|
+
?required="${this.required && this._files.length === 0}"
|
|
2554
|
+
aria-invalid="${isInvalid ? 'true' : nothing}"
|
|
2555
|
+
aria-describedby="${ifDefined(isInvalid ? `invalid-feedback-${inputId}` : undefined)}"
|
|
2556
|
+
@change="${this._handleFileChange}"
|
|
2557
|
+
/>
|
|
2514
2558
|
</label>
|
|
2515
2559
|
|
|
2516
2560
|
${when(this.supportText, () => html `<small class="form-text">${this.supportText}</small>`)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"it-upload.js","sources":["../../../src/it-upload.ts"],"sourcesContent":["/* eslint-disable lit-a11y/no-redundant-role */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { FormControl, FormControlController } from '@italia/globals';\nimport { registerTranslation } from '@italia/i18n';\nimport { html, nothing } from 'lit';\nimport { customElement, property, query, queryAssignedElements, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { when } from 'lit/directives/when.js';\n\nimport type { UploadFile, UploadFileStatus, UploadVariant, UploadInternalFile } from './types.js';\nimport it from './locales/it.js';\nimport en from './locales/en.js';\nimport styles from './upload.scss';\nimport { formatSize } from './utils.js';\n\nregisterTranslation(it);\nregisterTranslation(en);\n\n@customElement('it-upload')\nexport class ItUpload extends FormControl {\n static styles = styles;\n\n // Override the base FormControlController to submit File[] instead of strings.\n // The base class field is declared as `protected readonly` but re-declaring here\n // shadows it cleanly via class field initialization order.\n protected override readonly formControlController: FormControlController = new FormControlController(this, {\n value: (el) => (el as ItUpload)._files.map((f) => f._raw),\n assumeInteractionOn: ['it-change'],\n });\n\n @query('.it-form__control')\n override inputElement!: HTMLInputElement;\n\n @queryAssignedElements({ slot: 'label' })\n labelElements!: HTMLElement[];\n\n get label(): string {\n if (this.labelElements.length > 0) {\n return this.labelElements[0].innerText.trim();\n }\n return '';\n }\n\n /** Allow multiple file selection */\n @property({ type: Boolean, reflect: true })\n multiple = false;\n\n /** Accepted file types, e.g. \"image/*,.pdf\" */\n @property({ type: String })\n accept?: string;\n\n /** Show image thumbnails in the file list */\n @property({ type: Boolean, attribute: 'image-preview' })\n imagePreview = false;\n\n /** Layout variant: 'default' shows a vertical file list, 'gallery' shows a pictures-wall grid */\n @property({ type: String, reflect: true })\n variant: UploadVariant = 'default';\n\n /** Support text displayed below the upload button */\n @property({ type: String, attribute: 'support-text' })\n supportText = '';\n\n /**\n * If true, files transition to 'success' automatically as soon as they are added\n * (useful for purely client-side scenarios).\n * Leave false (default) when you need to call setFileStatus() after a real HTTP upload.\n */\n @property({ type: Boolean, attribute: 'auto-success' })\n autoSuccess = false;\n\n @state()\n private _files: UploadInternalFile[] = [];\n\n /** Returns a copy of the current file list */\n get files(): UploadFile[] {\n return this._files.map(({ _raw: _, ...rest }) => rest);\n }\n\n /**\n * Programmatically add a file to the list with an initial status of 'loading'.\n * Returns the generated id for use with setFileStatus / removeFile.\n */\n addFile(file: File): string {\n const id = `upload-file-${Math.random().toString(36).slice(2)}`;\n const entry: UploadInternalFile = {\n id,\n name: file.name,\n size: file.size,\n status: 'loading',\n _raw: file,\n };\n this._files = [...this._files, entry];\n return id;\n }\n\n /** Update the status (and optional progress 0–100) of a file by id. No-op for unknown ids. */\n setFileStatus(id: string, status: UploadFileStatus, progress?: number) {\n this._files = this._files.map((f) => (f.id === id ? { ...f, status, progress: progress ?? f.progress } : f));\n }\n\n /** Set a thumbnail data URL for a file entry by id. No-op for unknown ids. */\n setFileThumbnail(id: string, dataUrl: string) {\n this._files = this._files.map((f) => (f.id === id ? { ...f, thumbnail: dataUrl } : f));\n }\n\n /** Remove a file entry by id. No-op for unknown ids. */\n removeFile(id: string) {\n this._files = this._files.filter((f) => f.id !== id);\n this._validateFiles();\n }\n\n override connectedCallback() {\n super.connectedCallback?.();\n this._handleReady();\n }\n\n override updated(changedProperties: Map<string | number | symbol, unknown>) {\n super.updated?.(changedProperties);\n\n if (!this.label && this.label?.length === 0) {\n this.logger.warn(\n `Label is required for accessibility. Define a <span slot=\"label\"> inside <it-upload name=\"${this.name}\">.`,\n );\n }\n }\n\n // Override FormControl.checkValidity — the native hidden input manages required state\n override checkValidity(): boolean {\n return this.inputElement?.checkValidity() ?? true;\n }\n\n /** Override to prevent string-level validation messages from FormControl base */\n protected override handleValidationMessages() {\n this._validateFiles();\n }\n\n private _validateFiles() {\n if (this.required && this._files.length === 0) {\n this.inputElement?.setCustomValidity(this.$t('validityRequired'));\n this.validationMessage = this.$t('validityRequired');\n } else {\n this.inputElement?.setCustomValidity('');\n this.validationMessage = '';\n }\n this.formControlController.updateValidity();\n }\n\n override get validity(): ValidityState {\n return this.inputElement?.validity;\n }\n\n private _handleFileChange(e: Event) {\n const input = e.target as HTMLInputElement;\n const fileList = input.files;\n if (!fileList || fileList.length === 0) return;\n\n const newFiles = Array.from(fileList);\n newFiles.forEach((file) => {\n const id = this.addFile(file);\n if (file.type.startsWith('image/') && (this.imagePreview || this.variant === 'gallery')) {\n const reader = new FileReader();\n reader.onload = (ev) => {\n this.setFileThumbnail(id, ev.target?.result as string);\n if (this.autoSuccess) this.setFileStatus(id, 'success');\n };\n reader.readAsDataURL(file);\n } else if (this.autoSuccess) {\n this.setFileStatus(id, 'success');\n }\n });\n\n // Reset the native input so the same file can be re-selected\n input.value = '';\n\n this._validateFiles();\n\n this.dispatchEvent(\n new CustomEvent('it-upload-add', {\n detail: { files: newFiles, name: this.name, id: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n this.dispatchEvent(\n new CustomEvent('it-change', {\n detail: { files: this._files.map((f) => f._raw), name: this.name, id: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private _handleRemove(id: string, name: string) {\n this.removeFile(id);\n this.dispatchEvent(\n new CustomEvent('it-upload-remove', {\n detail: { id, name, componentName: this.name, componentId: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n this.dispatchEvent(\n new CustomEvent('it-change', {\n detail: { files: this._files.map((f) => f._raw), name: this.name, id: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private _getStatusLabel(status: UploadFileStatus): string {\n switch (status) {\n case 'loading':\n return this.$t('upload_status_loading');\n case 'success':\n return this.$t('upload_status_success');\n case 'error':\n default:\n return this.$t('upload_status_error');\n }\n }\n\n private _getRemoveLabel(f: UploadInternalFile): string {\n let key: string;\n switch (f.status) {\n case 'loading':\n key = 'upload_remove_loading';\n break;\n case 'error':\n key = 'upload_remove_error';\n break;\n case 'success':\n default:\n key = 'upload_remove_done';\n break;\n }\n const template = this.$t(key);\n return template.replace('{name}', f.name);\n }\n\n // eslint-disable-next-line class-methods-use-this\n private _iconForStatus(status: UploadFileStatus) {\n switch (status) {\n case 'loading':\n case 'success':\n return 'it-file';\n case 'error':\n default:\n return 'it-close-circle';\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n private _colorForStatus(status: UploadFileStatus): string {\n switch (status) {\n case 'success':\n return 'success';\n case 'error':\n return 'danger';\n default:\n return 'secondary';\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n private _actionIconForStatus(status: UploadFileStatus): string {\n return status === 'success' ? 'it-check' : 'it-close';\n }\n\n private _renderFileItem(f: UploadInternalFile) {\n const liClass = this.composeClass('upload-file', f.status === 'loading' ? 'uploading' : f.status);\n\n const statusLabel = this._getStatusLabel(f.status);\n const removeLabel = this._getRemoveLabel(f);\n\n return html`\n <li class=\"${liClass}\" role=\"listitem\">\n ${when(\n this.imagePreview && f.thumbnail,\n () => html`\n <div class=\"upload-image\">\n <img src=\"${f.thumbnail!}\" alt=\"${f.name}\" />\n </div>\n `,\n () =>\n html`<it-icon\n name=\"${this._iconForStatus(f.status)}\"\n size=\"sm\"\n color=\"${this._colorForStatus(f.status)}\"\n aria-hidden=\"true\"\n ></it-icon>`,\n )}\n <p>\n <span class=\"visually-hidden\">${statusLabel}</span>${f.name}${when(\n f.status === 'success',\n () => html`<span class=\"upload-file-weight\">${formatSize(f.size)}</span>`,\n )}\n </p>\n\n ${when(\n f.status === 'success',\n () => html`\n <div class=\"upload-file-actions\" part=\"file-status-indicator\">\n <it-icon\n name=\"it-check\"\n size=\"xs\"\n color=\"success\"\n aria-hidden=\"true\"\n class=\"upload-file-success\"\n ></it-icon>\n <button\n part=\"file-remove-button\"\n type=\"button\"\n @click=\"${() => this._handleRemove(f.id, f.name)}\"\n ?disabled=\"${this.disabled}\"\n >\n <span class=\"visually-hidden\">${removeLabel}</span>\n <it-icon name=\"it-close\" aria-hidden=\"true\" color=\"secondary\"></it-icon>\n </button>\n </div>\n `,\n () => html`\n <button\n part=\"file-remove-button\"\n type=\"button\"\n @click=\"${() => this._handleRemove(f.id, f.name)}\"\n ?disabled=\"${this.disabled}\"\n >\n <span class=\"visually-hidden\">${removeLabel}</span>\n <it-icon\n name=\"${this._actionIconForStatus(f.status)}\"\n color=\"${this._colorForStatus(f.status)}\"\n aria-hidden=\"true\"\n ></it-icon>\n </button>\n `,\n )}\n ${when(\n f.status === 'loading',\n () => html` <it-progress type=\"line\" .value=\"${f.progress ?? 0}\" it-aria-label=\"${f.name}\"></it-progress> `,\n )}\n </li>\n `;\n }\n\n private _renderGalleryItem(f: UploadInternalFile) {\n // NOTE: BSI reference HTML does not include a remove button for gallery items.\n // Added here as a critical accessibility addition: without it there is no way\n // to remove a photo once added (WCAG 2.1 SC 3.3.4 Error Prevention).\n const removeLabel = this._getRemoveLabel(f);\n return html`\n <li class=\"upload-image\" role=\"listitem\">\n ${when(f.thumbnail, () => html`<img src=\"${f.thumbnail!}\" alt=\"${f.name}\" />`)}\n <button\n part=\"gallery-remove-button\"\n type=\"button\"\n class=\"btn btn-primary btn-icon btn-xs upload-image-remove\"\n @click=\"${() => this._handleRemove(f.id, f.name)}\"\n ?disabled=\"${this.disabled}\"\n >\n <span class=\"visually-hidden\">${removeLabel}</span>\n <it-icon name=\"it-close\" size=\"xs\" color=\"inverse\" aria-hidden=\"true\"></it-icon>\n </button>\n </li>\n `;\n }\n\n private _renderFileList() {\n if (this._files.length === 0) return nothing;\n\n if (this.variant === 'gallery') {\n return html` ${this._files.map((f) => this._renderGalleryItem(f))} `;\n }\n\n const listClass = this.composeClass('upload-file-list', this.imagePreview ? 'upload-file-list-image' : '');\n return html`\n <ul class=\"${listClass}\" aria-label=\"${this.$t('upload_file_list_label')}\" role=\"list\">\n ${this._files.map((f) => this._renderFileItem(f))}\n </ul>\n `;\n }\n\n private _renderUploadInput() {\n const inputId = this._id!;\n const labelText = this.variant === 'gallery' ? this.$t('upload_gallery_label') : this.$t('upload_label');\n\n const showValidation = this.formControlController.submittedOnce;\n const isInvalid = showValidation && this.validationMessage.length > 0;\n\n return html`\n <div class=\"form-group\">\n <input\n type=\"file\"\n class=\"upload it-form__control\"\n id=\"${inputId}\"\n name=\"${this.name}\"\n ?multiple=\"${this.multiple}\"\n accept=\"${ifDefined(this.accept)}\"\n ?disabled=\"${this.disabled}\"\n ?required=\"${this.required && this._files.length === 0}\"\n aria-invalid=\"${isInvalid ? 'true' : 'false'}\"\n aria-describedby=\"${ifDefined(isInvalid ? `invalid-feedback-${inputId}` : undefined)}\"\n @change=\"${this._handleFileChange}\"\n />\n <label part=\"input-label\" for=\"${inputId}\">\n <slot name=\"icon\">\n <it-icon\n name=\"${this.variant === 'gallery' ? 'it-plus' : 'it-upload'}\"\n size=\"${this.variant === 'gallery' ? 'lg' : 'sm'}\"\n aria-hidden=\"true\"\n color=\"${this.variant === 'gallery' ? 'primary' : 'inverse'}\"\n ></it-icon>\n </slot>\n <slot name=\"label\">${labelText}</slot>\n </label>\n\n ${when(this.supportText, () => html`<small class=\"form-text\">${this.supportText}</small>`)}\n\n <div\n role=\"alert\"\n id=\"invalid-feedback-${inputId}\"\n class=\"invalid-feedback form-feedback form-text just-validate-error-label\"\n ?hidden=${!isInvalid}\n >\n ${isInvalid ? html`<span class=\"visually-hidden\">${this.label}: </span>${this.validationMessage}` : nothing}\n </div>\n </div>\n `;\n }\n\n override render() {\n if (this.variant === 'gallery') {\n return html`\n <ul class=\"upload-pictures-wall\" role=\"list\">\n ${this._renderFileList()}\n <li>${this._renderUploadInput()}</li>\n </ul>\n `;\n }\n\n return html` ${this._renderUploadInput()} ${this._renderFileList()} `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-upload': ItUpload;\n }\n}\n"],"names":["it","en"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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EAAE,CAAC;;AACX,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAIhB,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;;AACnC,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AAIrB,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AACP,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAInC,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;;AACrC,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAQjB,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;;AACnC,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAGZ,UAAA,CAAA;AADP,IAAA,KAAK,EAAE;;AACkC,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AArD/B,QAAQ,GAAA,UAAA,CAAA;IADpB,aAAa,CAAC,WAAW;AACb,CAAA,EAAA,QAAQ,CAwapB;;;;"}
|
|
1
|
+
{"version":3,"file":"it-upload.js","sources":["../../../src/it-upload.ts"],"sourcesContent":["/* eslint-disable lit-a11y/no-redundant-role */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { FormControl, FormControlController } from '@italia/globals';\nimport { registerTranslation } from '@italia/i18n';\nimport { html, nothing } from 'lit';\nimport { customElement, property, query, queryAssignedElements, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { when } from 'lit/directives/when.js';\n\nimport type { UploadFile, UploadFileStatus, UploadVariant, UploadInternalFile } from './types.js';\nimport it from './locales/it.js';\nimport en from './locales/en.js';\nimport styles from './upload.scss';\nimport { formatSize } from './utils.js';\n\nregisterTranslation(it);\nregisterTranslation(en);\n\n@customElement('it-upload')\nexport class ItUpload extends FormControl {\n static styles = styles;\n\n // Override the base FormControlController to submit File[] instead of strings.\n // The base class field is declared as `protected readonly` but re-declaring here\n // shadows it cleanly via class field initialization order.\n protected override readonly formControlController: FormControlController = new FormControlController(this, {\n value: (el) => (el as ItUpload)._files.map((f) => f._raw),\n assumeInteractionOn: ['it-change'],\n });\n\n @query('.it-form__control')\n override inputElement!: HTMLInputElement;\n\n @queryAssignedElements({ slot: 'label' })\n labelElements!: HTMLElement[];\n\n get label(): string {\n if (this.labelElements.length > 0) {\n return this.labelElements[0].innerText.trim();\n }\n return '';\n }\n\n /** Allow multiple file selection */\n @property({ type: Boolean, reflect: true })\n multiple = false;\n\n /** Accepted file types, e.g. \"image/*,.pdf\" */\n @property({ type: String })\n accept?: string;\n\n /** Show image thumbnails in the file list */\n @property({ type: Boolean, attribute: 'image-preview' })\n imagePreview = false;\n\n /** Layout variant: 'default' shows a vertical file list, 'gallery' shows a pictures-wall grid */\n @property({ type: String, reflect: true })\n variant: UploadVariant = 'default';\n\n /** Support text displayed below the upload button */\n @property({ type: String, attribute: 'support-text' })\n supportText = '';\n\n /**\n * If true, files transition to 'success' automatically as soon as they are added\n * (useful for purely client-side scenarios).\n * Leave false (default) when you need to call setFileStatus() after a real HTTP upload.\n */\n @property({ type: Boolean, attribute: 'auto-success' })\n autoSuccess = false;\n\n @state()\n private _files: UploadInternalFile[] = [];\n\n /** Returns a copy of the current file list */\n get files(): UploadFile[] {\n return this._files.map(({ _raw: _, ...rest }) => rest);\n }\n\n /**\n * Programmatically add a file to the list with an initial status of 'loading'.\n * Returns the generated id for use with setFileStatus / removeFile.\n */\n addFile(file: File): string {\n const id = `upload-file-${Math.random().toString(36).slice(2)}`;\n const entry: UploadInternalFile = {\n id,\n name: file.name,\n size: file.size,\n status: 'loading',\n _raw: file,\n };\n this._files = [...this._files, entry];\n return id;\n }\n\n /** Update the status (and optional progress 0–100) of a file by id. No-op for unknown ids. */\n setFileStatus(id: string, status: UploadFileStatus, progress?: number) {\n this._files = this._files.map((f) => (f.id === id ? { ...f, status, progress: progress ?? f.progress } : f));\n }\n\n /** Set a thumbnail data URL for a file entry by id. No-op for unknown ids. */\n setFileThumbnail(id: string, dataUrl: string) {\n this._files = this._files.map((f) => (f.id === id ? { ...f, thumbnail: dataUrl } : f));\n }\n\n /** Remove a file entry by id. No-op for unknown ids. */\n removeFile(id: string) {\n this._files = this._files.filter((f) => f.id !== id);\n this._validateFiles();\n }\n\n override connectedCallback() {\n super.connectedCallback?.();\n this._handleReady();\n }\n\n override updated(changedProperties: Map<string | number | symbol, unknown>) {\n super.updated?.(changedProperties);\n\n if (!this.label && this.label?.length === 0) {\n this.logger.warn(\n `Label is required for accessibility. Define a <span slot=\"label\"> inside <it-upload name=\"${this.name}\">.`,\n );\n }\n }\n\n // Override FormControl.checkValidity — the native hidden input manages required state\n override checkValidity(): boolean {\n return this.inputElement?.checkValidity() ?? true;\n }\n\n /** Override to prevent string-level validation messages from FormControl base */\n protected override handleValidationMessages() {\n this._validateFiles();\n }\n\n private _validateFiles() {\n if (this.required && this._files.length === 0) {\n this.inputElement?.setCustomValidity(this.$t('validityRequired'));\n this.validationMessage = this.$t('validityRequired');\n } else {\n this.inputElement?.setCustomValidity('');\n this.validationMessage = '';\n }\n this.formControlController.updateValidity();\n }\n\n override get validity(): ValidityState {\n return this.inputElement?.validity;\n }\n\n private _handleFileChange(e: Event) {\n const input = e.target as HTMLInputElement;\n const fileList = input.files;\n if (!fileList || fileList.length === 0) return;\n\n const newFiles = Array.from(fileList);\n newFiles.forEach((file) => {\n const id = this.addFile(file);\n if (file.type.startsWith('image/') && (this.imagePreview || this.variant === 'gallery')) {\n const reader = new FileReader();\n reader.onload = (ev) => {\n this.setFileThumbnail(id, ev.target?.result as string);\n if (this.autoSuccess) this.setFileStatus(id, 'success');\n };\n reader.readAsDataURL(file);\n } else if (this.autoSuccess) {\n this.setFileStatus(id, 'success');\n }\n });\n\n // Reset the native input so the same file can be re-selected\n input.value = '';\n\n this._validateFiles();\n\n this.dispatchEvent(\n new CustomEvent('it-upload-add', {\n detail: { files: newFiles, name: this.name, id: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n this.dispatchEvent(\n new CustomEvent('it-change', {\n detail: { files: this._files.map((f) => f._raw), name: this.name, id: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private _handleRemove(id: string, name: string) {\n this.removeFile(id);\n this.dispatchEvent(\n new CustomEvent('it-upload-remove', {\n detail: { id, name, componentName: this.name, componentId: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n this.dispatchEvent(\n new CustomEvent('it-change', {\n detail: { files: this._files.map((f) => f._raw), name: this.name, id: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private _getStatusLabel(status: UploadFileStatus): string {\n switch (status) {\n case 'loading':\n return this.$t('upload_status_loading');\n case 'success':\n return this.$t('upload_status_success');\n case 'error':\n default:\n return this.$t('upload_status_error');\n }\n }\n\n private _getRemoveLabel(f: UploadInternalFile): string {\n let key: string;\n switch (f.status) {\n case 'loading':\n key = 'upload_remove_loading';\n break;\n case 'error':\n key = 'upload_remove_error';\n break;\n case 'success':\n default:\n key = 'upload_remove_done';\n break;\n }\n const template = this.$t(key);\n return template.replace('{name}', f.name);\n }\n\n // eslint-disable-next-line class-methods-use-this\n private _iconForStatus(status: UploadFileStatus) {\n switch (status) {\n case 'loading':\n case 'success':\n return 'it-file';\n case 'error':\n default:\n return 'it-close-circle';\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n private _colorForStatus(status: UploadFileStatus): string {\n switch (status) {\n case 'success':\n return 'success';\n case 'error':\n return 'danger';\n default:\n return 'secondary';\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n private _actionIconForStatus(status: UploadFileStatus): string {\n return status === 'success' ? 'it-check' : 'it-close';\n }\n\n private _renderFileItem(f: UploadInternalFile) {\n const liClass = this.composeClass('upload-file', f.status === 'loading' ? 'uploading' : f.status);\n\n const statusLabel = this._getStatusLabel(f.status);\n const removeLabel = this._getRemoveLabel(f);\n\n return html`\n <li class=\"${liClass}\" role=\"listitem\">\n ${when(\n this.imagePreview && f.thumbnail,\n () => html`\n <div class=\"upload-image\">\n <img src=\"${f.thumbnail!}\" alt=\"${f.name}\" />\n </div>\n `,\n () =>\n html`<it-icon\n name=\"${this._iconForStatus(f.status)}\"\n size=\"sm\"\n color=\"${this._colorForStatus(f.status)}\"\n aria-hidden=\"true\"\n ></it-icon>`,\n )}\n <p>\n <span class=\"visually-hidden\">${statusLabel}</span>${f.name}${when(\n f.status === 'success',\n () => html`<span class=\"upload-file-weight\">${formatSize(f.size)}</span>`,\n )}\n </p>\n\n ${when(\n f.status === 'success',\n () => html`\n <div class=\"upload-file-actions\" part=\"file-status-indicator\">\n <it-icon\n name=\"it-check\"\n size=\"xs\"\n color=\"success\"\n aria-hidden=\"true\"\n class=\"upload-file-success\"\n ></it-icon>\n <button\n part=\"file-remove-button\"\n type=\"button\"\n @click=\"${() => this._handleRemove(f.id, f.name)}\"\n ?disabled=\"${this.disabled}\"\n >\n <span class=\"visually-hidden\">${removeLabel}</span>\n <it-icon name=\"it-close\" aria-hidden=\"true\" color=\"secondary\"></it-icon>\n </button>\n </div>\n `,\n () => html`\n <button\n part=\"file-remove-button\"\n type=\"button\"\n @click=\"${() => this._handleRemove(f.id, f.name)}\"\n ?disabled=\"${this.disabled}\"\n >\n <span class=\"visually-hidden\">${removeLabel}</span>\n <it-icon\n name=\"${this._actionIconForStatus(f.status)}\"\n color=\"${this._colorForStatus(f.status)}\"\n aria-hidden=\"true\"\n ></it-icon>\n </button>\n `,\n )}\n ${when(\n f.status === 'loading',\n () => html` <it-progress type=\"line\" .value=\"${f.progress ?? 0}\" it-aria-label=\"${f.name}\"></it-progress> `,\n )}\n </li>\n `;\n }\n\n private _renderGalleryItem(f: UploadInternalFile) {\n // NOTE: BSI reference HTML does not include a remove button for gallery items.\n // Added here as a critical accessibility addition: without it there is no way\n // to remove a photo once added (WCAG 2.1 SC 3.3.4 Error Prevention).\n const removeLabel = this._getRemoveLabel(f);\n return html`\n <li class=\"upload-image\" role=\"listitem\">\n ${when(f.thumbnail, () => html`<img src=\"${f.thumbnail!}\" alt=\"${f.name}\" />`)}\n <button\n part=\"gallery-remove-button\"\n type=\"button\"\n class=\"btn btn-primary btn-icon btn-xs upload-image-remove\"\n @click=\"${() => this._handleRemove(f.id, f.name)}\"\n ?disabled=\"${this.disabled}\"\n >\n <span class=\"visually-hidden\">${removeLabel}</span>\n <it-icon name=\"it-close\" size=\"xs\" color=\"inverse\" aria-hidden=\"true\"></it-icon>\n </button>\n </li>\n `;\n }\n\n private _renderFileList() {\n if (this._files.length === 0) return nothing;\n\n if (this.variant === 'gallery') {\n return html` ${this._files.map((f) => this._renderGalleryItem(f))} `;\n }\n\n const listClass = this.composeClass('upload-file-list', this.imagePreview ? 'upload-file-list-image' : '');\n return html`\n <ul class=\"${listClass}\" aria-label=\"${this.$t('upload_file_list_label')}\" role=\"list\">\n ${this._files.map((f) => this._renderFileItem(f))}\n </ul>\n `;\n }\n\n private _renderUploadInput() {\n const inputId = this._id!;\n const labelText = this.variant === 'gallery' ? this.$t('upload_gallery_label') : this.$t('upload_label');\n\n const showValidation = this.formControlController.submittedOnce;\n const isInvalid = showValidation && this.validationMessage.length > 0;\n\n return html`\n <div class=\"form-group\">\n <!-- Wrapping pattern per Scott O'Hara \"Styled File Uploads\":\n https://scottaohara.github.io/a11y_styled_form_controls/src/file-upload/\n Input inside label instead of BSI's sibling pattern (0.1px ghost input +\n styled adjacent label). BSI's pattern makes VoiceOver visit the ghost as a\n confusing \"small square group\" before the real button. With wrapping, both\n stops are logical: label text → file upload control. No JS needed — click\n propagation to the file picker is handled natively by the label. -->\n <label part=\"input-label\" for=\"${inputId}\">\n <slot name=\"icon\">\n <it-icon\n name=\"${this.variant === 'gallery' ? 'it-plus' : 'it-upload'}\"\n size=\"${this.variant === 'gallery' ? 'lg' : 'sm'}\"\n aria-hidden=\"true\"\n color=\"${this.variant === 'gallery' ? 'primary' : 'inverse'}\"\n ></it-icon>\n </slot>\n <slot name=\"label\">${labelText}</slot>\n <input\n type=\"file\"\n class=\"upload it-form__control\"\n id=\"${inputId}\"\n name=\"${this.name}\"\n ?multiple=\"${this.multiple}\"\n accept=\"${ifDefined(this.accept)}\"\n ?disabled=\"${this.disabled}\"\n ?required=\"${this.required && this._files.length === 0}\"\n aria-invalid=\"${isInvalid ? 'true' : nothing}\"\n aria-describedby=\"${ifDefined(isInvalid ? `invalid-feedback-${inputId}` : undefined)}\"\n @change=\"${this._handleFileChange}\"\n />\n </label>\n\n ${when(this.supportText, () => html`<small class=\"form-text\">${this.supportText}</small>`)}\n\n <div\n role=\"alert\"\n id=\"invalid-feedback-${inputId}\"\n class=\"invalid-feedback form-feedback form-text just-validate-error-label\"\n ?hidden=${!isInvalid}\n >\n ${isInvalid ? html`<span class=\"visually-hidden\">${this.label}: </span>${this.validationMessage}` : nothing}\n </div>\n </div>\n `;\n }\n\n override render() {\n if (this.variant === 'gallery') {\n return html`\n <ul class=\"upload-pictures-wall\" role=\"list\">\n ${this._renderFileList()}\n <li>${this._renderUploadInput()}</li>\n </ul>\n `;\n }\n\n return html` ${this._renderUploadInput()} ${this._renderFileList()} `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-upload': ItUpload;\n }\n}\n"],"names":["it","en"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAM,EAAE,CAAC;;AACX,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAIhB,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;;AACnC,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AAIrB,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AACP,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAInC,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;;AACrC,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAQjB,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;;AACnC,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAGZ,UAAA,CAAA;AADP,IAAA,KAAK,EAAE;;AACkC,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AArD/B,QAAQ,GAAA,UAAA,CAAA;IADpB,aAAa,CAAC,WAAW;AACb,CAAA,EAAA,QAAQ,CA+apB;;;;"}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export type UploadFileStatus = 'loading' | 'success' | 'error';
|
|
2
|
+
export declare const DRAG_DROP_HEADING_LEVELS: readonly ["h2", "h3", "h4", "h5", "h6"];
|
|
3
|
+
export type DragDropHeadingLevel = (typeof DRAG_DROP_HEADING_LEVELS)[number];
|
|
2
4
|
export type UploadVariant = 'default' | 'gallery';
|
|
3
5
|
export interface UploadFile {
|
|
4
6
|
id: string;
|
package/dist/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAE/D,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,CAAC;AAElD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,uEAAuE;AACvE,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACpD,IAAI,EAAE,IAAI,CAAC;CACZ"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAE/D,eAAO,MAAM,wBAAwB,yCAA0C,CAAC;AAChF,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7E,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,CAAC;AAElD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,uEAAuE;AACvE,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACpD,IAAI,EAAE,IAAI,CAAC;CACZ"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@italia/upload",
|
|
3
3
|
"description": "Web components it-upload, it-upload-avatar, it-upload-drag-drop del Design system .italia",
|
|
4
|
-
"version": "1.0.0-alpha.
|
|
4
|
+
"version": "1.0.0-alpha.19",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"bootstrap-italia": "3.0.0-beta.1",
|
|
40
40
|
"lit": "^3.3.0",
|
|
41
|
-
"@italia/globals": "^1.0.0-alpha.
|
|
42
|
-
"@italia/i18n": "^1.0.0-alpha.
|
|
41
|
+
"@italia/globals": "^1.0.0-alpha.19",
|
|
42
|
+
"@italia/i18n": "^1.0.0-alpha.19"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@italia/icon": "^1.0.0-alpha.
|
|
46
|
-
"@italia/avatar": "^1.0.0-alpha.
|
|
47
|
-
"@italia/progress": "^1.0.0-alpha.
|
|
45
|
+
"@italia/icon": "^1.0.0-alpha.19",
|
|
46
|
+
"@italia/avatar": "^1.0.0-alpha.19",
|
|
47
|
+
"@italia/progress": "^1.0.0-alpha.19"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@custom-elements-manifest/analyzer": "^0.10.3",
|