@italia/upload 1.0.0-alpha.9 → 1.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # <it-upload>
2
+
3
+ This package is part of [dev-kit-italia](https://italia.github.io/dev-kit-italia), a Web Components kit for the **.italia** design-system.
4
+
5
+ ## Installation and usage
6
+
7
+ Most users want to install the full kit by installing [`@italia/dev-kit-italia`](https://npmjs.com/package/@italia/dev-kit-italia), but you have the option of installing this single Web Component separately if needed. Please find detailed installation and usage instructions in the [official documentation](https://italia.github.io/dev-kit-italia/?path=/docs/introduzione--documentazione).
8
+
9
+ ## Documentation
10
+
11
+ Find the usage instructions for this specific component in its [dedicated documentation page](https://italia.github.io/dev-kit-italia/?path=/docs/componenti-form-upload--documentazione).
@@ -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
- "exports": []
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",
@@ -1231,7 +1266,7 @@
1231
1266
  "type": {
1232
1267
  "text": "Story"
1233
1268
  },
1234
- "default": "{ name: 'Esempio interattivo', tags: ['!autodocs', '!dev'], args: { variant: 'default', multiple: false, 'image-preview': false, accept: '', 'support-text': '', disabled: false, required: false, 'auto-success': true, }, argTypes: { variant: { description: 'Layout del componente.', control: { type: 'select' }, options: ['default', 'gallery'], table: { defaultValue: { summary: 'default' } }, }, multiple: { description: 'Consente la selezione multipla di file.', control: 'boolean', table: { defaultValue: { summary: 'false' } }, }, 'image-preview': { description: \"Mostra un'anteprima thumbnail per le immagini caricate.\", control: 'boolean', table: { defaultValue: { summary: 'false' } }, }, accept: { description: 'Tipi di file accettati, es. \"image/*,.pdf\".', control: 'text', }, 'support-text': { description: 'Testo di supporto visualizzato sotto il pulsante.', 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' } }, }, 'auto-success': { description: 'I file passano automaticamente allo stato success appena selezionati.', control: 'boolean', table: { defaultValue: { summary: 'false' } }, }, }, parameters: { docs: { canvas: { sourceState: 'closed' }, }, }, render: (params) => renderUpload(params as Partial<UploadProps>), }"
1269
+ "default": "{ name: 'Esempio interattivo', tags: ['!autodocs', '!dev'], args: { variant: 'default', multiple: false, 'image-preview': false, accept: '', 'support-text': '', disabled: false, required: false, 'auto-success': true, 'custom-validation': false, 'validity-message': '', }, argTypes: { variant: { description: 'Layout del componente.', control: { type: 'select' }, options: ['default', 'gallery'], table: { defaultValue: { summary: 'default' } }, }, multiple: { description: 'Consente la selezione multipla di file.', control: 'boolean', table: { defaultValue: { summary: 'false' } }, }, 'image-preview': { description: \"Mostra un'anteprima thumbnail per le immagini caricate.\", control: 'boolean', table: { defaultValue: { summary: 'false' } }, }, accept: { description: 'Tipi di file accettati, es. \"image/*,.pdf\".', control: 'text', }, 'support-text': { description: 'Testo di supporto visualizzato sotto il pulsante.', 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' } }, }, 'auto-success': { description: 'I file passano automaticamente allo stato success appena selezionati.', control: 'boolean', table: { defaultValue: { summary: 'false' } }, }, 'custom-validation': { description: 'Attiva la validazione personalizzata. Se abilitato, disabilita la validazione nativa del browser.', control: 'boolean', table: { defaultValue: { summary: 'false' } }, }, 'validity-message': { description: 'Messaggio di validazione personalizzato da mostrare quando custom-validation è attivo.', control: 'text', }, }, parameters: { docs: { canvas: { sourceState: 'closed' }, }, }, render: (params) => renderUpload(params as Partial<UploadProps>), }"
1235
1270
  },
1236
1271
  {
1237
1272
  "kind": "variable",
@@ -1239,7 +1274,7 @@
1239
1274
  "type": {
1240
1275
  "text": "Story"
1241
1276
  },
1242
- "default": "{ name: 'Esempio interattivo Avatar', tags: ['!autodocs', '!dev'], args: { src: 'https://randomuser.me/api/portraits/men/21.jpg', alt: 'Mario Rossi', size: 'xxl' as AvatarSize, disabled: false, required: false, }, argTypes: { src: { description: \"URL dell'immagine avatar corrente.\", control: 'text', }, alt: { description: \"Testo alternativo per l'immagine.\", control: 'text', }, size: { description: 'Dimensione del componente.', control: { type: 'select' }, options: ['xl', 'xxl'], table: { defaultValue: { summary: 'xxl' } }, }, disabled: { description: 'Disabilita il componente.', control: 'boolean', table: { defaultValue: { summary: 'false' } }, }, required: { description: 'Rende il campo obbligatorio nella validazione del form. Se src è già valorizzato, il requisito è soddisfatto.', control: 'boolean', table: { defaultValue: { summary: 'false' } }, }, }, parameters: { docs: { canvas: { sourceState: 'closed' }, }, }, render: (params) => renderUploadAvatar(params as Partial<UploadAvatarProps>), }"
1277
+ "default": "{ name: 'Esempio interattivo Avatar', tags: ['!autodocs', '!dev'], args: { src: 'https://randomuser.me/api/portraits/men/21.jpg', alt: 'Mario Rossi', size: 'xxl' as AvatarSize, disabled: false, required: false, 'custom-validation': false, 'validity-message': '', }, argTypes: { src: { description: \"URL dell'immagine avatar corrente.\", control: 'text', }, alt: { description: \"Testo alternativo per l'immagine.\", control: 'text', }, size: { description: 'Dimensione del componente.', control: { type: 'select' }, options: ['xl', 'xxl'], table: { defaultValue: { summary: 'xxl' } }, }, disabled: { description: 'Disabilita il componente.', control: 'boolean', table: { defaultValue: { summary: 'false' } }, }, required: { description: 'Rende il campo obbligatorio nella validazione del form. Se src è già valorizzato, il requisito è soddisfatto.', control: 'boolean', table: { defaultValue: { summary: 'false' } }, }, 'custom-validation': { description: 'Attiva la validazione personalizzata. Se abilitato, disabilita la validazione nativa del browser.', control: 'boolean', table: { defaultValue: { summary: 'false' } }, }, 'validity-message': { description: 'Messaggio di validazione personalizzato da mostrare quando custom-validation è attivo.', control: 'text', }, }, parameters: { docs: { canvas: { sourceState: 'closed' }, }, }, render: (params) => renderUploadAvatar(params as Partial<UploadAvatarProps>), }"
1243
1278
  },
1244
1279
  {
1245
1280
  "kind": "variable",
@@ -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', 'custom-validation': false, 'validity-message': '', }, 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' } }, }, 'custom-validation': { description: 'Attiva la validazione personalizzata. Se abilitato, disabilita la validazione nativa del browser.', control: 'boolean', table: { defaultValue: { summary: 'false' } }, }, 'validity-message': { description: 'Messaggio di validazione personalizzato da mostrare quando custom-validation è attivo.', control: 'text', }, }, 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-A2XDPVTm.js';
4
+ import '../en-BVfEYZab.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
@@ -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,MAA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