@italia/tabs 0.0.0 → 1.0.0-alpha.11
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 +2 -2
- package/custom-elements.json +1188 -27
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +6 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/it-tab-panel.d.ts +44 -0
- package/dist/src/it-tab-panel.d.ts.map +1 -0
- package/dist/src/it-tab-panel.js +149 -0
- package/dist/src/it-tab-panel.js.map +1 -0
- package/dist/src/it-tab.d.ts +94 -0
- package/dist/src/it-tab.d.ts.map +1 -0
- package/dist/src/it-tab.js +400 -0
- package/dist/src/it-tab.js.map +1 -0
- package/dist/src/it-tabs.d.ts +241 -5
- package/dist/src/it-tabs.d.ts.map +1 -1
- package/dist/src/it-tabs.js +1323 -51
- package/dist/src/it-tabs.js.map +1 -1
- package/dist/src/locales/en.d.ts +4 -0
- package/dist/src/locales/en.d.ts.map +1 -0
- package/dist/src/locales/it.d.ts +4 -0
- package/dist/src/locales/it.d.ts.map +1 -0
- package/dist/src/types.d.ts +30 -0
- package/dist/src/types.d.ts.map +1 -0
- package/package.json +18 -9
package/custom-elements.json
CHANGED
|
@@ -14,82 +14,1243 @@
|
|
|
14
14
|
"name": "ItTabs",
|
|
15
15
|
"module": "./it-tabs.js"
|
|
16
16
|
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"kind": "js",
|
|
20
|
+
"name": "ItTab",
|
|
21
|
+
"declaration": {
|
|
22
|
+
"name": "ItTab",
|
|
23
|
+
"module": "./it-tab.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"kind": "js",
|
|
28
|
+
"name": "ItTabPanel",
|
|
29
|
+
"declaration": {
|
|
30
|
+
"name": "ItTabPanel",
|
|
31
|
+
"module": "./it-tab-panel.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"kind": "js",
|
|
36
|
+
"name": "TabPlacement",
|
|
37
|
+
"declaration": {
|
|
38
|
+
"name": "TabPlacement",
|
|
39
|
+
"module": "./types.js"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"kind": "js",
|
|
44
|
+
"name": "ItTabCloseEventDetail",
|
|
45
|
+
"declaration": {
|
|
46
|
+
"name": "ItTabCloseEventDetail",
|
|
47
|
+
"module": "./types.js"
|
|
48
|
+
}
|
|
17
49
|
}
|
|
18
50
|
]
|
|
19
51
|
},
|
|
20
52
|
{
|
|
21
53
|
"kind": "javascript-module",
|
|
22
|
-
"path": "src/it-
|
|
54
|
+
"path": "src/it-tab-panel.ts",
|
|
23
55
|
"declarations": [
|
|
24
56
|
{
|
|
25
57
|
"kind": "class",
|
|
26
|
-
"description": "",
|
|
27
|
-
"name": "
|
|
58
|
+
"description": "`it-tab-panel` rappresenta il pannello di contenuto associato a un `it-tab`.\n\nIl contenuto dello slot diventa il corpo del pannello, visibile solo quando\nil tab corrispondente è selezionato.\n\nL'attributo `name` deve corrispondere all'attributo `panel` dell'`it-tab` collegato.",
|
|
59
|
+
"name": "ItTabPanel",
|
|
60
|
+
"cssParts": [
|
|
61
|
+
{
|
|
62
|
+
"description": "Il `div` contenitore interno del pannello",
|
|
63
|
+
"name": "panel"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"slots": [
|
|
67
|
+
{
|
|
68
|
+
"description": "Contenuto del pannello",
|
|
69
|
+
"name": ""
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"members": [
|
|
73
|
+
{
|
|
74
|
+
"kind": "field",
|
|
75
|
+
"name": "name",
|
|
76
|
+
"type": {
|
|
77
|
+
"text": "string"
|
|
78
|
+
},
|
|
79
|
+
"default": "''",
|
|
80
|
+
"description": "Identificatore del pannello. Deve corrispondere all'attributo `panel`\ndell'`it-tab` associato. Viene usato anche come `id` dell'elemento host\nper il collegamento ARIA tramite `aria-controls`.",
|
|
81
|
+
"attribute": "name",
|
|
82
|
+
"reflects": true
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"kind": "field",
|
|
86
|
+
"name": "active",
|
|
87
|
+
"type": {
|
|
88
|
+
"text": "boolean"
|
|
89
|
+
},
|
|
90
|
+
"default": "false",
|
|
91
|
+
"description": "Stato attivo del pannello. Gestito dall'`it-tabs` padre.\nQuando `true`, il pannello è visibile.",
|
|
92
|
+
"attribute": "active",
|
|
93
|
+
"reflects": true
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"kind": "field",
|
|
97
|
+
"name": "fade",
|
|
98
|
+
"type": {
|
|
99
|
+
"text": "boolean"
|
|
100
|
+
},
|
|
101
|
+
"default": "false",
|
|
102
|
+
"description": "Attiva l'animazione \"a comparsa\" (fade-in) sul pannello al momento\ndell'attivazione, usando la Web Animations API (opacity 0→1, 150 ms).\nRispetta automaticamente `prefers-reduced-motion`: se l'utente ha\nrichiesto animazioni ridotte l'effetto viene completamente saltato.\nDa usare su tutti i pannelli dello stesso `it-tabs` per coerenza visiva.",
|
|
103
|
+
"attribute": "fade",
|
|
104
|
+
"reflects": true
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"attributes": [
|
|
108
|
+
{
|
|
109
|
+
"name": "name",
|
|
110
|
+
"type": {
|
|
111
|
+
"text": "string"
|
|
112
|
+
},
|
|
113
|
+
"default": "''",
|
|
114
|
+
"description": "Identificatore del pannello. Deve corrispondere all'attributo `panel`\ndell'`it-tab` associato. Viene usato anche come `id` dell'elemento host\nper il collegamento ARIA tramite `aria-controls`.",
|
|
115
|
+
"fieldName": "name"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "active",
|
|
119
|
+
"type": {
|
|
120
|
+
"text": "boolean"
|
|
121
|
+
},
|
|
122
|
+
"default": "false",
|
|
123
|
+
"description": "Stato attivo del pannello. Gestito dall'`it-tabs` padre.\nQuando `true`, il pannello è visibile.",
|
|
124
|
+
"fieldName": "active"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "fade",
|
|
128
|
+
"type": {
|
|
129
|
+
"text": "boolean"
|
|
130
|
+
},
|
|
131
|
+
"default": "false",
|
|
132
|
+
"description": "Attiva l'animazione \"a comparsa\" (fade-in) sul pannello al momento\ndell'attivazione, usando la Web Animations API (opacity 0→1, 150 ms).\nRispetta automaticamente `prefers-reduced-motion`: se l'utente ha\nrichiesto animazioni ridotte l'effetto viene completamente saltato.\nDa usare su tutti i pannelli dello stesso `it-tabs` per coerenza visiva.",
|
|
133
|
+
"fieldName": "fade"
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
"superclass": {
|
|
137
|
+
"name": "BaseComponent",
|
|
138
|
+
"package": "@italia/globals"
|
|
139
|
+
},
|
|
140
|
+
"tagName": "it-tab-panel",
|
|
141
|
+
"customElement": true
|
|
142
|
+
}
|
|
143
|
+
],
|
|
144
|
+
"exports": [
|
|
145
|
+
{
|
|
146
|
+
"kind": "js",
|
|
147
|
+
"name": "ItTabPanel",
|
|
148
|
+
"declaration": {
|
|
149
|
+
"name": "ItTabPanel",
|
|
150
|
+
"module": "src/it-tab-panel.ts"
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"kind": "custom-element-definition",
|
|
155
|
+
"name": "it-tab-panel",
|
|
156
|
+
"declaration": {
|
|
157
|
+
"name": "ItTabPanel",
|
|
158
|
+
"module": "src/it-tab-panel.ts"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"kind": "javascript-module",
|
|
165
|
+
"path": "src/it-tab.ts",
|
|
166
|
+
"declarations": [
|
|
167
|
+
{
|
|
168
|
+
"kind": "class",
|
|
169
|
+
"description": "`it-tab` rappresenta il singolo tab (trigger) all'interno di un componente `it-tabs`.\n\nL'host stesso è l'elemento interattivo: porta `role=\"tab\"`, `tabIndex` e tutti\ngli attributi ARIA direttamente nel light DOM. Lo shadow DOM contiene solo\n`<slot>` per il contenuto — nessun elemento interattivo annidato (no nested-interactive).\n\n## Accessibilità dismissible\n\nQuando `dismissible` è attivo, il componente imposta automaticamente sull'host:\n\n- `aria-keyshortcuts=\"Delete Backspace\"` — annuncia le scorciatoie da tastiera\n agli screen reader desktop (NVDA, JAWS, VoiceOver+Mac).\n- `aria-description=\"Attiva di nuovo per chiudere.\"` (testo localizzato) — presente\n **solo** quando il tab è anche `active`; informa l'utente di screen reader mobile\n (VoiceOver+iOS, TalkBack+Android) che può chiudere il tab ri-attivando l'elemento\n (doppio tap nel DOM virtuale), senza bisogno di shortcut tastiera.\n\nIl click sull'host quando `active && dismissible` emette `it-tab-close-request`\n**solo** se il gesto viene da touch o pen (doppio tap SR mobile).\nUn click mouse sull'host non chiude il tab: l'utente usa la × esplicita.",
|
|
170
|
+
"name": "ItTab",
|
|
171
|
+
"slots": [
|
|
172
|
+
{
|
|
173
|
+
"description": "Etichetta del tab: testo, icona o icona+testo",
|
|
174
|
+
"name": ""
|
|
175
|
+
}
|
|
176
|
+
],
|
|
28
177
|
"members": [
|
|
29
178
|
{
|
|
30
179
|
"kind": "field",
|
|
31
|
-
"name": "
|
|
180
|
+
"name": "panel",
|
|
181
|
+
"type": {
|
|
182
|
+
"text": "string"
|
|
183
|
+
},
|
|
184
|
+
"default": "''",
|
|
185
|
+
"description": "Nome del pannello `it-tab-panel` associato.\nDeve corrispondere all'attributo `name` dell'`it-tab-panel` collegato.",
|
|
186
|
+
"attribute": "panel",
|
|
187
|
+
"reflects": true
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"kind": "field",
|
|
191
|
+
"name": "disabled",
|
|
192
|
+
"type": {
|
|
193
|
+
"text": "boolean"
|
|
194
|
+
},
|
|
195
|
+
"default": "false",
|
|
196
|
+
"description": "Se `true`, il tab è disabilitato e non interagibile.",
|
|
197
|
+
"attribute": "disabled",
|
|
198
|
+
"reflects": true
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"kind": "field",
|
|
202
|
+
"name": "active",
|
|
203
|
+
"type": {
|
|
204
|
+
"text": "boolean"
|
|
205
|
+
},
|
|
206
|
+
"default": "false",
|
|
207
|
+
"description": "Stato attivo. Gestito dall'`it-tabs` padre.\nQuando `true` il tab è selezionato e `tabIndex` dell'host è `0`.",
|
|
208
|
+
"attribute": "active",
|
|
209
|
+
"reflects": true
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"kind": "field",
|
|
213
|
+
"name": "cards",
|
|
214
|
+
"type": {
|
|
215
|
+
"text": "boolean"
|
|
216
|
+
},
|
|
217
|
+
"default": "false",
|
|
218
|
+
"description": "In variante card: impostato automaticamente dall'`it-tabs` padre quando `cards` è attivo.\nPorta gli stili card direttamente su :host([cards]) in it-tab.scss.",
|
|
219
|
+
"attribute": "cards",
|
|
220
|
+
"reflects": true
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"kind": "field",
|
|
224
|
+
"name": "dismissible",
|
|
225
|
+
"type": {
|
|
226
|
+
"text": "boolean"
|
|
227
|
+
},
|
|
228
|
+
"default": "false",
|
|
229
|
+
"description": "Mostra il pulsante × per chiudere il tab.\nImpostato automaticamente dall'`it-tabs` padre (da `dismissible` sul container);\nnon richiede manipolazione del light DOM (il bottone vive nello shadow DOM di `it-tab`).\nAl click emette `it-tab-close-request` (bubbles + composed) verso `it-tabs`.",
|
|
230
|
+
"attribute": "dismissible",
|
|
231
|
+
"reflects": true
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"kind": "field",
|
|
235
|
+
"name": "tabId",
|
|
32
236
|
"type": {
|
|
33
237
|
"text": "string"
|
|
34
238
|
},
|
|
35
|
-
"
|
|
36
|
-
"
|
|
239
|
+
"description": "Restituisce l'`id` dell'host, usato dall'`it-tabs` padre per\nimpostare `aria-labelledby` sul pannello associato (tutto in light DOM,\nnessun cross-shadow ARIA necessario).",
|
|
240
|
+
"readonly": true
|
|
37
241
|
},
|
|
38
242
|
{
|
|
39
243
|
"kind": "field",
|
|
40
|
-
"name": "
|
|
244
|
+
"name": "_lastPointerType",
|
|
41
245
|
"type": {
|
|
42
|
-
"text": "
|
|
246
|
+
"text": "string"
|
|
247
|
+
},
|
|
248
|
+
"privacy": "private",
|
|
249
|
+
"default": "''",
|
|
250
|
+
"description": "Tipo di pointer dell'ultimo pointerdown: 'mouse' | 'touch' | 'pen' | ''"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"kind": "method",
|
|
254
|
+
"name": "focusTab",
|
|
255
|
+
"return": {
|
|
256
|
+
"type": {
|
|
257
|
+
"text": "void"
|
|
258
|
+
}
|
|
43
259
|
},
|
|
44
|
-
"
|
|
45
|
-
"attribute": "counter"
|
|
260
|
+
"description": "Porta il focus sull'host. Chiamato dal `RovingTabindexController`."
|
|
46
261
|
},
|
|
47
262
|
{
|
|
48
263
|
"kind": "method",
|
|
49
|
-
"name": "
|
|
264
|
+
"name": "_updateDismissibleAria",
|
|
265
|
+
"privacy": "private",
|
|
266
|
+
"return": {
|
|
267
|
+
"type": {
|
|
268
|
+
"text": "void"
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
"description": "Aggiorna gli attributi ARIA legati alla funzionalità dismissible:\n\n- `aria-keyshortcuts=\"Delete Backspace\"` — presente sempre quando il tab è dismissibile;\n annuncia la scorciatoia da tastiera agli screen reader (NVDA, JAWS, VoiceOver+Mac).\n\n- `aria-description` — presente solo quando il tab è **sia attivo sia dismissibile**;\n contiene il testo localizzato (es. \"Attiva di nuovo per chiudere.\") che informa\n l'utente mobile (VoiceOver/TalkBack) che può chiudere ri-attivando l'elemento\n (doppio tap), oltre ai tasti Delete/Backspace già coperti da aria-keyshortcuts."
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"kind": "field",
|
|
275
|
+
"name": "_handlePointerDown",
|
|
276
|
+
"privacy": "private"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"kind": "field",
|
|
280
|
+
"name": "_handleClick",
|
|
281
|
+
"privacy": "private"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"kind": "field",
|
|
285
|
+
"name": "_handleKeydown",
|
|
286
|
+
"privacy": "private"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"kind": "field",
|
|
290
|
+
"name": "_handleCloseClick",
|
|
291
|
+
"privacy": "private"
|
|
292
|
+
}
|
|
293
|
+
],
|
|
294
|
+
"events": [
|
|
295
|
+
{
|
|
296
|
+
"description": "Emesso al click (non disabilitato, non già attivo+dismissibile). `detail.panel` contiene il nome del pannello associato.",
|
|
297
|
+
"name": "it-tab-select"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"description": "Emesso al doppio-tap touch/pen quando `active && dismissible` (SR mobile), oppure dal pulsante × interno. `detail.panel` e `detail.type` (`'click'`) propagano verso `it-tabs`.",
|
|
301
|
+
"name": "it-tab-close-request"
|
|
50
302
|
}
|
|
51
303
|
],
|
|
52
304
|
"attributes": [
|
|
53
305
|
{
|
|
54
|
-
"name": "
|
|
306
|
+
"name": "panel",
|
|
55
307
|
"type": {
|
|
56
308
|
"text": "string"
|
|
57
309
|
},
|
|
58
|
-
"default": "'
|
|
59
|
-
"
|
|
310
|
+
"default": "''",
|
|
311
|
+
"description": "Nome del pannello `it-tab-panel` associato.\nDeve corrispondere all'attributo `name` dell'`it-tab-panel` collegato.",
|
|
312
|
+
"fieldName": "panel"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"name": "disabled",
|
|
316
|
+
"type": {
|
|
317
|
+
"text": "boolean"
|
|
318
|
+
},
|
|
319
|
+
"default": "false",
|
|
320
|
+
"description": "Se `true`, il tab è disabilitato e non interagibile.",
|
|
321
|
+
"fieldName": "disabled"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"name": "active",
|
|
325
|
+
"type": {
|
|
326
|
+
"text": "boolean"
|
|
327
|
+
},
|
|
328
|
+
"default": "false",
|
|
329
|
+
"description": "Stato attivo. Gestito dall'`it-tabs` padre.\nQuando `true` il tab è selezionato e `tabIndex` dell'host è `0`.",
|
|
330
|
+
"fieldName": "active"
|
|
60
331
|
},
|
|
61
332
|
{
|
|
62
|
-
"name": "
|
|
333
|
+
"name": "cards",
|
|
63
334
|
"type": {
|
|
64
|
-
"text": "
|
|
335
|
+
"text": "boolean"
|
|
65
336
|
},
|
|
66
|
-
"default": "
|
|
67
|
-
"
|
|
337
|
+
"default": "false",
|
|
338
|
+
"description": "In variante card: impostato automaticamente dall'`it-tabs` padre quando `cards` è attivo.\nPorta gli stili card direttamente su :host([cards]) in it-tab.scss.",
|
|
339
|
+
"fieldName": "cards"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"name": "dismissible",
|
|
343
|
+
"type": {
|
|
344
|
+
"text": "boolean"
|
|
345
|
+
},
|
|
346
|
+
"default": "false",
|
|
347
|
+
"description": "Mostra il pulsante × per chiudere il tab.\nImpostato automaticamente dall'`it-tabs` padre (da `dismissible` sul container);\nnon richiede manipolazione del light DOM (il bottone vive nello shadow DOM di `it-tab`).\nAl click emette `it-tab-close-request` (bubbles + composed) verso `it-tabs`.",
|
|
348
|
+
"fieldName": "dismissible"
|
|
68
349
|
}
|
|
69
350
|
],
|
|
70
351
|
"superclass": {
|
|
71
|
-
"name": "
|
|
72
|
-
"package": "
|
|
352
|
+
"name": "BaseLocalizedComponent",
|
|
353
|
+
"package": "@italia/globals"
|
|
73
354
|
},
|
|
74
|
-
"tagName": "it-
|
|
355
|
+
"tagName": "it-tab",
|
|
75
356
|
"customElement": true
|
|
76
357
|
}
|
|
77
358
|
],
|
|
78
359
|
"exports": [
|
|
79
360
|
{
|
|
80
361
|
"kind": "js",
|
|
81
|
-
"name": "
|
|
362
|
+
"name": "ItTab",
|
|
82
363
|
"declaration": {
|
|
83
|
-
"name": "
|
|
84
|
-
"module": "src/it-
|
|
364
|
+
"name": "ItTab",
|
|
365
|
+
"module": "src/it-tab.ts"
|
|
85
366
|
}
|
|
86
367
|
},
|
|
87
368
|
{
|
|
88
369
|
"kind": "custom-element-definition",
|
|
89
|
-
"name": "it-
|
|
370
|
+
"name": "it-tab",
|
|
90
371
|
"declaration": {
|
|
91
|
-
"name": "
|
|
92
|
-
"module": "src/it-
|
|
372
|
+
"name": "ItTab",
|
|
373
|
+
"module": "src/it-tab.ts"
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
]
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"kind": "javascript-module",
|
|
380
|
+
"path": "src/it-tabs.ts",
|
|
381
|
+
"declarations": [
|
|
382
|
+
{
|
|
383
|
+
"kind": "class",
|
|
384
|
+
"description": "`it-tabs` è il componente contenitore per un'interfaccia a schede (tab).\n\nGestisce la selezione, la navigazione da tastiera (roving tabindex, frecce, Home, End)\ne i collegamenti ARIA tra trigger e pannelli.\n\n## Struttura attesa\n\n```html\n<it-tabs label=\"Navigazione\">\n <it-tab slot=\"tab\" panel=\"p1\">Tab 1</it-tab>\n <it-tab slot=\"tab\" panel=\"p2\">Tab 2</it-tab>\n\n <it-tab-panel name=\"p1\">Contenuto del primo pannello</it-tab-panel>\n <it-tab-panel name=\"p2\">Contenuto del secondo pannello</it-tab-panel>\n</it-tabs>\n```",
|
|
385
|
+
"name": "ItTabs",
|
|
386
|
+
"cssProperties": [
|
|
387
|
+
{
|
|
388
|
+
"description": "Larghezza (flex-basis) della tablist in modalità verticale (`placement=start|end`). Accetta qualsiasi valore CSS valido per `flex-basis` (es. `200px`, `25%`, `12rem`). Non ha effetto in modalità orizzontale.",
|
|
389
|
+
"name": "--it-tabs-nav-size",
|
|
390
|
+
"default": "auto"
|
|
391
|
+
}
|
|
392
|
+
],
|
|
393
|
+
"slots": [
|
|
394
|
+
{
|
|
395
|
+
"description": "Slot nominato per gli elementi `it-tab` (trigger della lista)",
|
|
396
|
+
"name": "tab"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"description": "Slot opzionale per elementi aggiuntivi dopo la lista di tab (es. pulsante \"aggiungi\"). Appare alla fine della tablist visivamente allineato ai tab.",
|
|
400
|
+
"name": "after-tablist"
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
"description": "Slot di default per gli elementi `it-tab-panel` (contenuto)",
|
|
404
|
+
"name": ""
|
|
405
|
+
}
|
|
406
|
+
],
|
|
407
|
+
"members": [
|
|
408
|
+
{
|
|
409
|
+
"kind": "field",
|
|
410
|
+
"name": "shadowRootOptions",
|
|
411
|
+
"type": {
|
|
412
|
+
"text": "object"
|
|
413
|
+
},
|
|
414
|
+
"static": true,
|
|
415
|
+
"default": "{ ...BaseComponent.shadowRootOptions, delegatesFocus: true }"
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"kind": "field",
|
|
419
|
+
"name": "label",
|
|
420
|
+
"type": {
|
|
421
|
+
"text": "string"
|
|
422
|
+
},
|
|
423
|
+
"default": "''",
|
|
424
|
+
"description": "Testo dell'`aria-label` per la tablist.\nObbligatorio quando non è presente un'intestazione visiva adiacente.",
|
|
425
|
+
"attribute": "label",
|
|
426
|
+
"reflects": true
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
"kind": "field",
|
|
430
|
+
"name": "auto",
|
|
431
|
+
"type": {
|
|
432
|
+
"text": "boolean"
|
|
433
|
+
},
|
|
434
|
+
"default": "false",
|
|
435
|
+
"description": "Tab a tutta larghezza: i tab occupano l'intera larghezza disponibile.\nCorrisponde alla classe Bootstrap Italia `.auto` sulla tablist.",
|
|
436
|
+
"attribute": "auto",
|
|
437
|
+
"reflects": true
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"kind": "field",
|
|
441
|
+
"name": "hideScrollbar",
|
|
442
|
+
"type": {
|
|
443
|
+
"text": "boolean"
|
|
444
|
+
},
|
|
445
|
+
"default": "false",
|
|
446
|
+
"description": "Nasconde visivamente la scrollbar orizzontale della tablist su viewport intermedi\n(≥ 768px e < 1200px), dove Bootstrap Italia mostra normalmente il tab overflow con scrollbar.\nSu mobile (< 768px) e su desktop wide (≥ 1200px) il meccanismo viene disattivato automaticamente.\n\nIl meccanismo BSI: il wrapper `.nav-row` riceve `overflow: hidden` + altezza fissa che\nstoppa la scrollbar; `.nav-tabs` riceve `padding-bottom: 20px` che spinge il\ntrack della scrollbar sotto il bordo di clip, rendendola invisibile ma preservando lo scroll.\n\nCorrisponde alla classe Bootstrap Italia `.nav-tabs-hidescroll` sul wrapper.\nIgnorato nei layout verticali (`placement=\"start\"` / `placement=\"end\"`) e con `cards`.\nUsato tipicamente insieme ad `auto`.",
|
|
447
|
+
"attribute": "hide-scrollbar",
|
|
448
|
+
"reflects": true
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
"kind": "field",
|
|
452
|
+
"name": "verticalBackground",
|
|
453
|
+
"type": {
|
|
454
|
+
"text": "boolean"
|
|
455
|
+
},
|
|
456
|
+
"default": "false",
|
|
457
|
+
"description": "Sfondo primario chiaro sul tab selezionato (solo in layout verticale: `placement=\"start\"` o `placement=\"end\"`).\nCorrisponde alla classe Bootstrap Italia `.nav-tabs-vertical-background`.",
|
|
458
|
+
"attribute": "vertical-background",
|
|
459
|
+
"reflects": true
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
"kind": "field",
|
|
463
|
+
"name": "dark",
|
|
464
|
+
"type": {
|
|
465
|
+
"text": "boolean"
|
|
466
|
+
},
|
|
467
|
+
"default": "false",
|
|
468
|
+
"description": "Variante con sfondo scuro per la tablist.\nCorrisponde alla classe Bootstrap Italia `.nav-dark`.\nIgnorato quando `cards` è attivo: le due varianti non sono compatibili.",
|
|
469
|
+
"attribute": "dark",
|
|
470
|
+
"reflects": true
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"kind": "field",
|
|
474
|
+
"name": "cards",
|
|
475
|
+
"type": {
|
|
476
|
+
"text": "boolean"
|
|
477
|
+
},
|
|
478
|
+
"default": "false",
|
|
479
|
+
"description": "Stile \"card\" per i tab.\nCorrisponde alla classe Bootstrap Italia `.nav-tabs-cards`.",
|
|
480
|
+
"attribute": "cards",
|
|
481
|
+
"reflects": true
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
"kind": "field",
|
|
485
|
+
"name": "dismissible",
|
|
486
|
+
"type": {
|
|
487
|
+
"text": "boolean"
|
|
488
|
+
},
|
|
489
|
+
"default": "false",
|
|
490
|
+
"description": "Abilita la chiusura dei tab tramite il pulsante × e i tasti Delete/Backspace.\nIndipendente da `cards`: può essere usato con qualsiasi variante di tab.\nQuando attivo, ogni `it-tab` mostra il pulsante × e risponde\nai tasti Delete/Backspace con l'evento cancelable `it-tab-close`.",
|
|
491
|
+
"attribute": "dismissible",
|
|
492
|
+
"reflects": true
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
"kind": "field",
|
|
496
|
+
"name": "fade",
|
|
497
|
+
"type": {
|
|
498
|
+
"text": "boolean"
|
|
499
|
+
},
|
|
500
|
+
"default": "false",
|
|
501
|
+
"description": "Attiva l'animazione \"a comparsa\" (fade in/out) sui pannelli.\nEquivale alla classe `.fade` di Bootstrap Italia su ogni `.tab-pane`.",
|
|
502
|
+
"attribute": "fade",
|
|
503
|
+
"reflects": true
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
"kind": "field",
|
|
507
|
+
"name": "placement",
|
|
508
|
+
"type": {
|
|
509
|
+
"text": "TabPlacement"
|
|
510
|
+
},
|
|
511
|
+
"default": "'top'",
|
|
512
|
+
"description": "Posizione della tablist rispetto ai pannelli.\n- `top` (default): tablist sopra il contenuto\n- `bottom`: tablist sotto il contenuto\n- `start`: tablist a sinistra (layout verticale)\n- `end`: tablist a destra (layout verticale)",
|
|
513
|
+
"attribute": "placement",
|
|
514
|
+
"reflects": true
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
"kind": "field",
|
|
518
|
+
"name": "_hasIcons",
|
|
519
|
+
"type": {
|
|
520
|
+
"text": "boolean"
|
|
521
|
+
},
|
|
522
|
+
"privacy": "private",
|
|
523
|
+
"default": "false",
|
|
524
|
+
"description": "Traccia se almeno uno dei tab contiene un elemento `it-icon`.\nDetermina se applicare la classe `.nav-tabs-icon-text` per ottimizzare\nlo spazio tra icona e testo."
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
"kind": "field",
|
|
528
|
+
"name": "_tabs",
|
|
529
|
+
"type": {
|
|
530
|
+
"text": "ItTab[]"
|
|
531
|
+
},
|
|
532
|
+
"privacy": "private"
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
"kind": "field",
|
|
536
|
+
"name": "_panels",
|
|
537
|
+
"type": {
|
|
538
|
+
"text": "ItTabPanel[]"
|
|
539
|
+
},
|
|
540
|
+
"privacy": "private"
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
"kind": "field",
|
|
544
|
+
"name": "_isVertical",
|
|
545
|
+
"type": {
|
|
546
|
+
"text": "boolean"
|
|
547
|
+
},
|
|
548
|
+
"privacy": "private",
|
|
549
|
+
"description": "Determina se la tablist è in orientamento verticale.\nUsato sia per il layout che per la direzione della navigazione da tastiera.",
|
|
550
|
+
"readonly": true
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
"kind": "field",
|
|
554
|
+
"name": "rovingTabindex",
|
|
555
|
+
"privacy": "protected",
|
|
556
|
+
"default": "new RovingTabindexController<ItTab>(this, { getItems: () => this._tabs, onSelect: (tab) => this._selectTab(tab), selectOnFocus: true, // Home/End should activate tabs per WAI-ARIA for this component. selectOnHomeEnd: true, direction: 'both', skipItem: (tab) => tab.disabled, })",
|
|
557
|
+
"description": "Roving tabindex controller: gestisce tabindex e navigazione da tastiera\ntra gli elementi `it-tab` secondo il pattern WAI-ARIA.\n\nLa direzione è dinamica: `'horizontal'` per layout orizzontali,\n`'vertical'` per layout verticali (placement start/end)."
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
"kind": "method",
|
|
561
|
+
"name": "_initTabs",
|
|
562
|
+
"privacy": "private",
|
|
563
|
+
"return": {
|
|
564
|
+
"type": {
|
|
565
|
+
"text": "void"
|
|
566
|
+
}
|
|
567
|
+
},
|
|
568
|
+
"description": "Inizializza i tab: attiva il primo tab non disabilitato se nessuno è già attivo,\ncollega i tab ai pannelli via ARIA e allinea il roving tabindex controller."
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
"kind": "field",
|
|
572
|
+
"name": "_onTabCloseRequest",
|
|
573
|
+
"privacy": "private",
|
|
574
|
+
"description": "Intercetta `it-tab-close-request` emesso dal bottone × nello shadow DOM di `it-tab`.\nPrima di dispatchiare `it-tab-close` all'esterno, sposta il focus su un tab adiacente\nin modo che l'utente da tastiera non perda il punto di navigazione."
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
"kind": "method",
|
|
578
|
+
"name": "_executeClose",
|
|
579
|
+
"privacy": "private",
|
|
580
|
+
"return": {
|
|
581
|
+
"type": {
|
|
582
|
+
"text": "void"
|
|
583
|
+
}
|
|
584
|
+
},
|
|
585
|
+
"parameters": [
|
|
586
|
+
{
|
|
587
|
+
"name": "closingTab",
|
|
588
|
+
"type": {
|
|
589
|
+
"text": "ItTab"
|
|
590
|
+
}
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
"name": "moveFocus",
|
|
594
|
+
"type": {
|
|
595
|
+
"text": "boolean"
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
],
|
|
599
|
+
"description": "Esegue la chiusura fisica senza emettere eventi:\ntrasferisce lo stato `active` al tab adiacente,\nsposta il focus (solo se `moveFocus`) e rimuove dal DOM.\n\nChiamato sia come default action di `_closeTabWithFocusShift`\nsia direttamente dal metodo pubblico `close()`."
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
"kind": "method",
|
|
603
|
+
"name": "_closeTabWithFocusShift",
|
|
604
|
+
"privacy": "private",
|
|
605
|
+
"return": {
|
|
606
|
+
"type": {
|
|
607
|
+
"text": "void"
|
|
608
|
+
}
|
|
609
|
+
},
|
|
610
|
+
"parameters": [
|
|
611
|
+
{
|
|
612
|
+
"name": "closingTab",
|
|
613
|
+
"type": {
|
|
614
|
+
"text": "ItTab"
|
|
615
|
+
}
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"name": "moveFocus",
|
|
619
|
+
"type": {
|
|
620
|
+
"text": "boolean"
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
],
|
|
624
|
+
"description": "Dispatcha `it-tab-close` (cancelable) e — se non viene chiamato `preventDefault()` —\nesegue la chiusura standard tramite `_executeClose`.\n\nIl consumer che chiama `e.preventDefault()` può poi invocare\n`itTabs.close(e.detail.panel)` per eseguire la chiusura standard."
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
"kind": "method",
|
|
628
|
+
"name": "close",
|
|
629
|
+
"return": {
|
|
630
|
+
"type": {
|
|
631
|
+
"text": "void"
|
|
632
|
+
}
|
|
633
|
+
},
|
|
634
|
+
"parameters": [
|
|
635
|
+
{
|
|
636
|
+
"name": "panel",
|
|
637
|
+
"type": {
|
|
638
|
+
"text": "string"
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
],
|
|
642
|
+
"description": "Chiude il tab associato al pannello `panel`, trasferendo lo stato `active`\nal tab adiacente e rimuovendo `it-tab` + `it-tab-panel` dal DOM.\n\nMetodo pubblico pensato per essere chiamato dopo aver intercettato\n`it-tab-close` con `e.preventDefault()` — ad esempio al termine di\nuna conferma asincrona:\n\n```js\nitTabs.addEventListener('it-tab-close', async (e) => {\n e.preventDefault();\n if (await myModal.confirm('Chiudere?')) itTabs.close(e.detail.panel);\n});\n```\n\nNoop se `dismissible` non è attivo o il pannello non esiste.\nNon ri-emette `it-tab-close`."
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
"kind": "method",
|
|
646
|
+
"name": "addTab",
|
|
647
|
+
"return": {
|
|
648
|
+
"type": {
|
|
649
|
+
"text": "void"
|
|
650
|
+
}
|
|
651
|
+
},
|
|
652
|
+
"parameters": [
|
|
653
|
+
{
|
|
654
|
+
"name": "tab",
|
|
655
|
+
"type": {
|
|
656
|
+
"text": "ItTab"
|
|
657
|
+
}
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
"name": "panel",
|
|
661
|
+
"type": {
|
|
662
|
+
"text": "ItTabPanel"
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
],
|
|
666
|
+
"description": "Aggiunge un `it-tab` e il relativo `it-tab-panel` al componente.\n\nIl tab viene inserito prima dell'elemento `slot=\"after-tablist\"` se presente\n(in modo da restare all'interno della tablist prima del pulsante aggiungi),\naltrimenti in fondo alla lista. Il pannello è sempre appeso in fondo.\n\n```js\nconst tab = document.createElement('it-tab');\ntab.setAttribute('slot', 'tab');\ntab.setAttribute('panel', 'p5');\ntab.textContent = 'Tab 5';\nconst panel = document.createElement('it-tab-panel');\npanel.setAttribute('name', 'p5');\npanel.textContent = 'Contenuto 5';\nitTabs.addTab(tab, panel);\n```"
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
"kind": "method",
|
|
670
|
+
"name": "_selectTab",
|
|
671
|
+
"privacy": "private",
|
|
672
|
+
"return": {
|
|
673
|
+
"type": {
|
|
674
|
+
"text": "void"
|
|
675
|
+
}
|
|
676
|
+
},
|
|
677
|
+
"parameters": [
|
|
678
|
+
{
|
|
679
|
+
"name": "targetTab",
|
|
680
|
+
"type": {
|
|
681
|
+
"text": "ItTab"
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
],
|
|
685
|
+
"description": "Seleziona il tab indicato e aggiorna tutti gli stati (tab attivo, pannello visibile,\ntabindex sul roving controller)."
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
"kind": "field",
|
|
689
|
+
"name": "_onTabSelect",
|
|
690
|
+
"privacy": "private"
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
"kind": "field",
|
|
694
|
+
"name": "_onKeyDown",
|
|
695
|
+
"privacy": "private",
|
|
696
|
+
"description": "Navigazione da tastiera nella tablist (WAI-ARIA tabs pattern).\n\nOrizzontale: ArrowLeft / ArrowRight / Home / End\nVerticale: ArrowUp / ArrowDown / Home / End\n\nLa logica di navigazione viene delegata al `RovingTabindexController`\nche gestisce wrap-around, skip dei disabilitati e aggiornamento dei tabindex."
|
|
697
|
+
},
|
|
698
|
+
{
|
|
699
|
+
"kind": "method",
|
|
700
|
+
"name": "_onTabSlotChange",
|
|
701
|
+
"privacy": "private",
|
|
702
|
+
"return": {
|
|
703
|
+
"type": {
|
|
704
|
+
"text": "void"
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
"kind": "method",
|
|
710
|
+
"name": "_onPanelSlotChange",
|
|
711
|
+
"privacy": "private",
|
|
712
|
+
"return": {
|
|
713
|
+
"type": {
|
|
714
|
+
"text": "void"
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
],
|
|
719
|
+
"events": [
|
|
720
|
+
{
|
|
721
|
+
"name": "it-tabs-change",
|
|
722
|
+
"type": {
|
|
723
|
+
"text": "CustomEvent"
|
|
724
|
+
},
|
|
725
|
+
"description": "Emesso quando cambia il pannello attivo. `detail.panel` contiene il nome del pannello attivato."
|
|
726
|
+
},
|
|
727
|
+
{
|
|
728
|
+
"description": "Emesso (quando `dismissible` è attivo) quando si clicca il pulsante ×, si preme Delete/Backspace, o si ri-attiva il tab già selezionato (doppio tap mobile SR). Il `detail` è tipizzato come {@link ItTabCloseEventDetail}: `detail.panel` e `detail.type`. L'evento è **cancelable**: chiamare `e.preventDefault()` blocca la rimozione automatica. Per eseguire la chiusura standard in un momento a scelta (es. dopo conferma asincrona) richiamare il metodo pubblico `itTabs.close(e.detail.panel)`.",
|
|
729
|
+
"name": "it-tab-close"
|
|
730
|
+
}
|
|
731
|
+
],
|
|
732
|
+
"attributes": [
|
|
733
|
+
{
|
|
734
|
+
"name": "label",
|
|
735
|
+
"type": {
|
|
736
|
+
"text": "string"
|
|
737
|
+
},
|
|
738
|
+
"default": "''",
|
|
739
|
+
"description": "Testo dell'`aria-label` per la tablist.\nObbligatorio quando non è presente un'intestazione visiva adiacente.",
|
|
740
|
+
"fieldName": "label"
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
"name": "auto",
|
|
744
|
+
"type": {
|
|
745
|
+
"text": "boolean"
|
|
746
|
+
},
|
|
747
|
+
"default": "false",
|
|
748
|
+
"description": "Tab a tutta larghezza: i tab occupano l'intera larghezza disponibile.\nCorrisponde alla classe Bootstrap Italia `.auto` sulla tablist.",
|
|
749
|
+
"fieldName": "auto"
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
"name": "hide-scrollbar",
|
|
753
|
+
"type": {
|
|
754
|
+
"text": "boolean"
|
|
755
|
+
},
|
|
756
|
+
"default": "false",
|
|
757
|
+
"description": "Nasconde visivamente la scrollbar orizzontale della tablist su viewport intermedi\n(≥ 768px e < 1200px), dove Bootstrap Italia mostra normalmente il tab overflow con scrollbar.\nSu mobile (< 768px) e su desktop wide (≥ 1200px) il meccanismo viene disattivato automaticamente.\n\nIl meccanismo BSI: il wrapper `.nav-row` riceve `overflow: hidden` + altezza fissa che\nstoppa la scrollbar; `.nav-tabs` riceve `padding-bottom: 20px` che spinge il\ntrack della scrollbar sotto il bordo di clip, rendendola invisibile ma preservando lo scroll.\n\nCorrisponde alla classe Bootstrap Italia `.nav-tabs-hidescroll` sul wrapper.\nIgnorato nei layout verticali (`placement=\"start\"` / `placement=\"end\"`) e con `cards`.\nUsato tipicamente insieme ad `auto`.",
|
|
758
|
+
"fieldName": "hideScrollbar"
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
"name": "vertical-background",
|
|
762
|
+
"type": {
|
|
763
|
+
"text": "boolean"
|
|
764
|
+
},
|
|
765
|
+
"default": "false",
|
|
766
|
+
"description": "Sfondo primario chiaro sul tab selezionato (solo in layout verticale: `placement=\"start\"` o `placement=\"end\"`).\nCorrisponde alla classe Bootstrap Italia `.nav-tabs-vertical-background`.",
|
|
767
|
+
"fieldName": "verticalBackground"
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
"name": "dark",
|
|
771
|
+
"type": {
|
|
772
|
+
"text": "boolean"
|
|
773
|
+
},
|
|
774
|
+
"default": "false",
|
|
775
|
+
"description": "Variante con sfondo scuro per la tablist.\nCorrisponde alla classe Bootstrap Italia `.nav-dark`.\nIgnorato quando `cards` è attivo: le due varianti non sono compatibili.",
|
|
776
|
+
"fieldName": "dark"
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
"name": "cards",
|
|
780
|
+
"type": {
|
|
781
|
+
"text": "boolean"
|
|
782
|
+
},
|
|
783
|
+
"default": "false",
|
|
784
|
+
"description": "Stile \"card\" per i tab.\nCorrisponde alla classe Bootstrap Italia `.nav-tabs-cards`.",
|
|
785
|
+
"fieldName": "cards"
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
"name": "dismissible",
|
|
789
|
+
"type": {
|
|
790
|
+
"text": "boolean"
|
|
791
|
+
},
|
|
792
|
+
"default": "false",
|
|
793
|
+
"description": "Abilita la chiusura dei tab tramite il pulsante × e i tasti Delete/Backspace.\nIndipendente da `cards`: può essere usato con qualsiasi variante di tab.\nQuando attivo, ogni `it-tab` mostra il pulsante × e risponde\nai tasti Delete/Backspace con l'evento cancelable `it-tab-close`.",
|
|
794
|
+
"fieldName": "dismissible"
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
"name": "fade",
|
|
798
|
+
"type": {
|
|
799
|
+
"text": "boolean"
|
|
800
|
+
},
|
|
801
|
+
"default": "false",
|
|
802
|
+
"description": "Attiva l'animazione \"a comparsa\" (fade in/out) sui pannelli.\nEquivale alla classe `.fade` di Bootstrap Italia su ogni `.tab-pane`.",
|
|
803
|
+
"fieldName": "fade"
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
"name": "placement",
|
|
807
|
+
"type": {
|
|
808
|
+
"text": "TabPlacement"
|
|
809
|
+
},
|
|
810
|
+
"default": "'top'",
|
|
811
|
+
"description": "Posizione della tablist rispetto ai pannelli.\n- `top` (default): tablist sopra il contenuto\n- `bottom`: tablist sotto il contenuto\n- `start`: tablist a sinistra (layout verticale)\n- `end`: tablist a destra (layout verticale)",
|
|
812
|
+
"fieldName": "placement"
|
|
813
|
+
}
|
|
814
|
+
],
|
|
815
|
+
"superclass": {
|
|
816
|
+
"name": "BaseComponent",
|
|
817
|
+
"package": "@italia/globals"
|
|
818
|
+
},
|
|
819
|
+
"tagName": "it-tabs",
|
|
820
|
+
"customElement": true
|
|
821
|
+
}
|
|
822
|
+
],
|
|
823
|
+
"exports": [
|
|
824
|
+
{
|
|
825
|
+
"kind": "js",
|
|
826
|
+
"name": "ItTabs",
|
|
827
|
+
"declaration": {
|
|
828
|
+
"name": "ItTabs",
|
|
829
|
+
"module": "src/it-tabs.ts"
|
|
830
|
+
}
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
"kind": "custom-element-definition",
|
|
834
|
+
"name": "it-tabs",
|
|
835
|
+
"declaration": {
|
|
836
|
+
"name": "ItTabs",
|
|
837
|
+
"module": "src/it-tabs.ts"
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
]
|
|
841
|
+
},
|
|
842
|
+
{
|
|
843
|
+
"kind": "javascript-module",
|
|
844
|
+
"path": "src/types.ts",
|
|
845
|
+
"declarations": [
|
|
846
|
+
{
|
|
847
|
+
"kind": "variable",
|
|
848
|
+
"name": "TAB_PLACEMENTS",
|
|
849
|
+
"type": {
|
|
850
|
+
"text": "['top', 'bottom', 'start', 'end']"
|
|
851
|
+
},
|
|
852
|
+
"default": "['top', 'bottom', 'start', 'end']"
|
|
853
|
+
}
|
|
854
|
+
],
|
|
855
|
+
"exports": [
|
|
856
|
+
{
|
|
857
|
+
"kind": "js",
|
|
858
|
+
"name": "TAB_PLACEMENTS",
|
|
859
|
+
"declaration": {
|
|
860
|
+
"name": "TAB_PLACEMENTS",
|
|
861
|
+
"module": "src/types.ts"
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
]
|
|
865
|
+
},
|
|
866
|
+
{
|
|
867
|
+
"kind": "javascript-module",
|
|
868
|
+
"path": "stories/it-tabs.stories.ts",
|
|
869
|
+
"declarations": [
|
|
870
|
+
{
|
|
871
|
+
"kind": "variable",
|
|
872
|
+
"name": "meta",
|
|
873
|
+
"type": {
|
|
874
|
+
"text": "Meta<TabsProps>"
|
|
875
|
+
},
|
|
876
|
+
"default": "{ title: 'Componenti/Tabs', tags: ['alpha', 'a11y-ok', 'web-component'], component: 'it-tabs', args: { label: 'Navigazione principale', auto: false, hideScrollbar: false, verticalBackground: false, dark: false, cards: false, dismissible: false, placement: 'top', }, argTypes: { label: { control: 'text', description: \"Testo dell'`aria-label` per la tablist. Consigliato quando non è presente un'intestazione visiva adiacente al componente.\", name: 'label', table: { defaultValue: { summary: '' } }, }, auto: { control: 'boolean', description: \"Se `true`, i tab si espandono per occupare l'intera larghezza disponibile.\", name: 'auto', table: { defaultValue: { summary: 'false' } }, }, hideScrollbar: { control: 'boolean', description: 'Se `true`, nasconde visivamente la scrollbar orizzontale. **Effetto visibile solo con `auto: true` in viewport intermedi (≥768px e <1200px).**', name: 'hide-scrollbar', table: { defaultValue: { summary: 'false' } }, }, verticalBackground: { control: 'boolean', description: 'Se `true`, applica uno sfondo primario chiaro sul tab selezionato. **Effetto visibile solo in layout verticale: `placement=\"start\"` o `placement=\"end\"`**.', name: 'vertical-background', table: { defaultValue: { summary: 'false' } }, }, dark: { control: 'boolean', description: 'Se `true`, abilita la variante con sfondo scuro per la tablist. **Ignorato quando `cards: true`, le due varianti non sono compatibili.**', name: 'dark', table: { defaultValue: { summary: 'false' } }, }, cards: { control: 'boolean', description: 'Se `true`, applica lo stile \"card\". Nota: `dismissible` è disponibile solo con `cards: true`.', name: 'cards', table: { defaultValue: { summary: 'false' } }, }, dismissible: { control: 'boolean', description: 'Se `true`, abilita la chiusura dei tab tramite pulsante × e tasti Delete/Backspace. **Funziona solo con `cards: true`, altrimenti non ha effetto.**', name: 'dismissible', table: { defaultValue: { summary: 'false' } }, }, placement: { control: 'select', options: TAB_PLACEMENTS, description: 'Posizione della tablist rispetto ai pannelli. `start`/`end` attivano automaticamente il layout verticale.', name: 'placement', table: { defaultValue: { summary: 'top' } }, }, }, parameters: { layout: 'padded', pageLayout: 'w-100', }, decorators: [ (Story) => html` <div style=\"min-height:250px; backgrond-color: #ececec; margin: auto;\">${Story()}</div> `, ], }"
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
"kind": "variable",
|
|
880
|
+
"name": "EsempioInterattivo",
|
|
881
|
+
"type": {
|
|
882
|
+
"text": "Story"
|
|
883
|
+
},
|
|
884
|
+
"default": "{ name: 'Esempio interattivo', tags: ['!autodocs', '!dev'], parameters: { docs: { canvas: { sourceState: 'hidden' } }, }, render: (args) => renderTabs(args, defaultTabs), }"
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
"kind": "variable",
|
|
888
|
+
"name": "TabOrizzontale",
|
|
889
|
+
"type": {
|
|
890
|
+
"text": "Story"
|
|
891
|
+
},
|
|
892
|
+
"default": "{ name: 'Tab orizzontali', render: () => html` <it-tabs label=\"Navigazione principale\"> <it-tab slot=\"tab\" panel=\"o1\">Tab 1</it-tab> <it-tab slot=\"tab\" panel=\"o2\">Tab 2</it-tab> <it-tab slot=\"tab\" panel=\"o3\">Tab 3</it-tab> <it-tab slot=\"tab\" panel=\"o4\" disabled>Tab 4 Disabilitato</it-tab> <it-tab-panel name=\"o1\">${panelContent(1)}</it-tab-panel> <it-tab-panel name=\"o2\">${panelContent(2)}</it-tab-panel> <it-tab-panel name=\"o3\">${panelContent(3)}</it-tab-panel> <it-tab-panel name=\"o4\">${panelContent(4)}</it-tab-panel> </it-tabs> `, }"
|
|
893
|
+
},
|
|
894
|
+
{
|
|
895
|
+
"kind": "variable",
|
|
896
|
+
"name": "TabATuttaLarghezza",
|
|
897
|
+
"type": {
|
|
898
|
+
"text": "Story"
|
|
899
|
+
},
|
|
900
|
+
"default": "{ name: 'Tab a tutta larghezza', render: () => html` <it-tabs auto label=\"Navigazione a tutta larghezza\"> <it-tab slot=\"tab\" panel=\"a1\">Tab 1 Attivo</it-tab> <it-tab slot=\"tab\" panel=\"a2\">Link</it-tab> <it-tab slot=\"tab\" panel=\"a3\">Link</it-tab> <it-tab slot=\"tab\" panel=\"a4\" disabled>Disabilitato</it-tab> <it-tab-panel name=\"a1\">${panelContent(1)}</it-tab-panel> <it-tab-panel name=\"a2\">${panelContent(2)}</it-tab-panel> <it-tab-panel name=\"a3\">${panelContent(3)}</it-tab-panel> <it-tab-panel name=\"a4\">${panelContent(4)}</it-tab-panel> </it-tabs> `, }"
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
"kind": "variable",
|
|
904
|
+
"name": "TabScrollbarNascosta",
|
|
905
|
+
"type": {
|
|
906
|
+
"text": "Story"
|
|
907
|
+
},
|
|
908
|
+
"default": "{ name: 'Tab con scrollbar nascosta', render: () => html` <it-tabs auto hide-scrollbar label=\"Navigazione con scrollbar nascosta\"> <it-tab slot=\"tab\" panel=\"hs1\">Voce di menu 1</it-tab> <it-tab slot=\"tab\" panel=\"hs2\">Voce di menu 2</it-tab> <it-tab slot=\"tab\" panel=\"hs3\">Voce di menu 3</it-tab> <it-tab slot=\"tab\" panel=\"hs4\">Voce di menu 4</it-tab> <it-tab slot=\"tab\" panel=\"hs5\">Voce di menu 5</it-tab> <it-tab slot=\"tab\" panel=\"hs6\" disabled>Disabilitato</it-tab> <it-tab-panel name=\"hs1\">${panelContent(1)}</it-tab-panel> <it-tab-panel name=\"hs2\">${panelContent(2)}</it-tab-panel> <it-tab-panel name=\"hs3\">${panelContent(3)}</it-tab-panel> <it-tab-panel name=\"hs4\">${panelContent(4)}</it-tab-panel> <it-tab-panel name=\"hs5\">${panelContent(5)}</it-tab-panel> <it-tab-panel name=\"hs6\">${panelContent(6)}</it-tab-panel> </it-tabs> `, }"
|
|
909
|
+
},
|
|
910
|
+
{
|
|
911
|
+
"kind": "variable",
|
|
912
|
+
"name": "TabConIcona",
|
|
913
|
+
"type": {
|
|
914
|
+
"text": "Story"
|
|
915
|
+
},
|
|
916
|
+
"default": "{ name: 'Tab con icona', render: () => html` <it-tabs label=\"Navigazione con icona\"> <it-tab slot=\"tab\" panel=\"i1\"> <it-icon name=\"it-star-outline\" class=\"icon icon-sm\"></it-icon> <span class=\"visually-hidden\">Tab titolo 1</span> </it-tab> <it-tab slot=\"tab\" panel=\"i2\"> <it-icon name=\"it-mail\" class=\"icon icon-sm\"></it-icon> <span class=\"visually-hidden\">Tab titolo 2</span> </it-tab> <it-tab slot=\"tab\" panel=\"i3\"> <it-icon name=\"it-settings\" class=\"icon icon-sm\"></it-icon> <span class=\"visually-hidden\">Tab titolo 3</span> </it-tab> <it-tab slot=\"tab\" panel=\"i4\" disabled> <it-icon name=\"it-close\" class=\"icon icon-sm\"></it-icon> <span class=\"visually-hidden\">Tab titolo 4 (disabilitato)</span> </it-tab> <it-tab-panel name=\"i1\">${panelContent(1)}</it-tab-panel> <it-tab-panel name=\"i2\">${panelContent(2)}</it-tab-panel> <it-tab-panel name=\"i3\">${panelContent(3)}</it-tab-panel> <it-tab-panel name=\"i4\">${panelContent(4)}</it-tab-panel> </it-tabs> `, }"
|
|
917
|
+
},
|
|
918
|
+
{
|
|
919
|
+
"kind": "variable",
|
|
920
|
+
"name": "TabConTestoEIcona",
|
|
921
|
+
"type": {
|
|
922
|
+
"text": "Story"
|
|
923
|
+
},
|
|
924
|
+
"default": "{ name: 'Tab con testo e icona', render: () => html` <it-tabs label=\"Navigazione con icona e testo\"> <it-tab slot=\"tab\" panel=\"it1\"> <it-icon name=\"it-star-outline\" class=\"icon icon-sm\"></it-icon> Tab 1 </it-tab> <it-tab slot=\"tab\" panel=\"it2\"> <it-icon name=\"it-mail\" class=\"icon icon-sm\"></it-icon> Tab 2 </it-tab> <it-tab slot=\"tab\" panel=\"it3\"> <it-icon name=\"it-settings\" class=\"icon icon-sm\"></it-icon> Tab 3 </it-tab> <it-tab slot=\"tab\" panel=\"it4\" disabled> <it-icon name=\"it-close\" class=\"icon icon-sm\"></it-icon> Tab 4 Disabilitato </it-tab> <it-tab-panel name=\"it1\">${panelContent(1)}</it-tab-panel> <it-tab-panel name=\"it2\">${panelContent(2)}</it-tab-panel> <it-tab-panel name=\"it3\">${panelContent(3)}</it-tab-panel> <it-tab-panel name=\"it4\">${panelContent(4)}</it-tab-panel> </it-tabs> `, }"
|
|
925
|
+
},
|
|
926
|
+
{
|
|
927
|
+
"kind": "variable",
|
|
928
|
+
"name": "TabVerticale",
|
|
929
|
+
"type": {
|
|
930
|
+
"text": "Story"
|
|
931
|
+
},
|
|
932
|
+
"default": "{ name: 'Tab verticali', render: () => html` <it-tabs placement=\"start\" label=\"Navigazione verticale\"> <it-tab slot=\"tab\" panel=\"v1\">Tab 1</it-tab> <it-tab slot=\"tab\" panel=\"v2\">Tab 2</it-tab> <it-tab slot=\"tab\" panel=\"v3\">Tab 3</it-tab> <it-tab-panel name=\"v1\">${panelContent(1)}</it-tab-panel> <it-tab-panel name=\"v2\">${panelContent(2)}</it-tab-panel> <it-tab-panel name=\"v3\">${panelContent(3)}</it-tab-panel> </it-tabs> `, }"
|
|
933
|
+
},
|
|
934
|
+
{
|
|
935
|
+
"kind": "variable",
|
|
936
|
+
"name": "TabVerticaleConSfondo",
|
|
937
|
+
"type": {
|
|
938
|
+
"text": "Story"
|
|
939
|
+
},
|
|
940
|
+
"default": "{ name: 'Tab verticali con sfondo', render: () => html` <it-tabs placement=\"start\" vertical-background label=\"Navigazione verticale con sfondo\"> <it-tab slot=\"tab\" panel=\"vb1\">Tab 1</it-tab> <it-tab slot=\"tab\" panel=\"vb2\">Tab 2</it-tab> <it-tab slot=\"tab\" panel=\"vb3\">Tab 3</it-tab> <it-tab-panel name=\"vb1\">${panelContent(1)}</it-tab-panel> <it-tab-panel name=\"vb2\">${panelContent(2)}</it-tab-panel> <it-tab-panel name=\"vb3\">${panelContent(3)}</it-tab-panel> </it-tabs> `, }"
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
"kind": "variable",
|
|
944
|
+
"name": "TabCard",
|
|
945
|
+
"type": {
|
|
946
|
+
"text": "Story"
|
|
947
|
+
},
|
|
948
|
+
"default": "{ name: 'Tab tipo card', render: () => html` <it-tabs cards label=\"Navigazione card\"> <it-tab slot=\"tab\" panel=\"c1\">Tab 1</it-tab> <it-tab slot=\"tab\" panel=\"c2\">Tab 2</it-tab> <it-tab slot=\"tab\" panel=\"c3\">Tab 3</it-tab> <it-tab slot=\"tab\" panel=\"c4\" disabled>Tab 4 Disabilitato</it-tab> <it-tab-panel name=\"c1\">${panelContent(1)}</it-tab-panel> <it-tab-panel name=\"c2\">${panelContent(2)}</it-tab-panel> <it-tab-panel name=\"c3\">${panelContent(3)}</it-tab-panel> <it-tab-panel name=\"c4\">${panelContent(4)}</it-tab-panel> </it-tabs> `, }"
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
"kind": "variable",
|
|
952
|
+
"name": "TabScuro",
|
|
953
|
+
"type": {
|
|
954
|
+
"text": "Story"
|
|
955
|
+
},
|
|
956
|
+
"default": "{ name: 'Tab con sfondo scuro', render: () => html` <it-tabs dark auto label=\"Navigazione scura\"> <it-tab slot=\"tab\" panel=\"d1\">Tab 1 Attivo</it-tab> <it-tab slot=\"tab\" panel=\"d2\">Tab 2</it-tab> <it-tab slot=\"tab\" panel=\"d3\">Tab 3</it-tab> <it-tab slot=\"tab\" panel=\"d4\" disabled>Tab 4 Disabilitato</it-tab> <it-tab-panel name=\"d1\">${panelContent(1)}</it-tab-panel> <it-tab-panel name=\"d2\">${panelContent(2)}</it-tab-panel> <it-tab-panel name=\"d3\">${panelContent(3)}</it-tab-panel> <it-tab-panel name=\"d4\">${panelContent(4)}</it-tab-panel> </it-tabs> `, }"
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
"kind": "variable",
|
|
960
|
+
"name": "TabScuroVerticale",
|
|
961
|
+
"type": {
|
|
962
|
+
"text": "Story"
|
|
963
|
+
},
|
|
964
|
+
"default": "{ name: 'Tab scuri verticali', render: () => html` <it-tabs dark placement=\"start\" label=\"Navigazione scura verticale\"> <it-tab slot=\"tab\" panel=\"dv1\"> Tab 1 <it-icon name=\"it-star-outline\" class=\"icon icon-sm\"></it-icon> </it-tab> <it-tab slot=\"tab\" panel=\"dv2\"> Tab 2 <it-icon name=\"it-mail\" class=\"icon icon-sm\"></it-icon> </it-tab> <it-tab slot=\"tab\" panel=\"dv3\"> Tab 3 <it-icon name=\"it-settings\" class=\"icon icon-sm\"></it-icon> </it-tab> <it-tab-panel name=\"dv1\">${panelContent(1)}</it-tab-panel> <it-tab-panel name=\"dv2\">${panelContent(2)}</it-tab-panel> <it-tab-panel name=\"dv3\">${panelContent(3)}</it-tab-panel> </it-tabs> `, }"
|
|
965
|
+
},
|
|
966
|
+
{
|
|
967
|
+
"kind": "variable",
|
|
968
|
+
"name": "PosizionamentoBasso",
|
|
969
|
+
"type": {
|
|
970
|
+
"text": "Story"
|
|
971
|
+
},
|
|
972
|
+
"default": "{ name: 'Tab in basso', render: () => html` <it-tabs placement=\"bottom\" label=\"Navigazione in basso\"> <it-tab slot=\"tab\" panel=\"b1\">Tab 1</it-tab> <it-tab slot=\"tab\" panel=\"b2\">Tab 2</it-tab> <it-tab slot=\"tab\" panel=\"b3\">Tab 3</it-tab> <it-tab slot=\"tab\" panel=\"b4\" disabled>Disabilitato</it-tab> <it-tab-panel name=\"b1\">${panelContent(1)}</it-tab-panel> <it-tab-panel name=\"b2\">${panelContent(2)}</it-tab-panel> <it-tab-panel name=\"b3\">${panelContent(3)}</it-tab-panel> <it-tab-panel name=\"b4\">${panelContent(4)}</it-tab-panel> </it-tabs> `, }"
|
|
973
|
+
},
|
|
974
|
+
{
|
|
975
|
+
"kind": "variable",
|
|
976
|
+
"name": "PosizionamentoSinistra",
|
|
977
|
+
"type": {
|
|
978
|
+
"text": "Story"
|
|
979
|
+
},
|
|
980
|
+
"default": "{ name: 'Tab a sinistra', render: () => html` <it-tabs placement=\"start\" label=\"Navigazione a sinistra\"> <it-tab slot=\"tab\" panel=\"s1\">Tab 1</it-tab> <it-tab slot=\"tab\" panel=\"s2\">Tab 2</it-tab> <it-tab slot=\"tab\" panel=\"s3\">Tab 3</it-tab> <it-tab-panel name=\"s1\">${panelContent(1)}</it-tab-panel> <it-tab-panel name=\"s2\">${panelContent(2)}</it-tab-panel> <it-tab-panel name=\"s3\">${panelContent(3)}</it-tab-panel> </it-tabs> `, }"
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
"kind": "variable",
|
|
984
|
+
"name": "PosizionamentoDestra",
|
|
985
|
+
"type": {
|
|
986
|
+
"text": "Story"
|
|
987
|
+
},
|
|
988
|
+
"default": "{ name: 'Tab a destra', render: () => html` <it-tabs placement=\"end\" label=\"Navigazione a destra\"> <it-tab slot=\"tab\" panel=\"e1\"> Tab 1 <it-icon name=\"it-star-outline\" class=\"icon icon-sm\"></it-icon> </it-tab> <it-tab slot=\"tab\" panel=\"e2\"> Tab 2 <it-icon name=\"it-mail\" class=\"icon icon-sm\"></it-icon> </it-tab> <it-tab slot=\"tab\" panel=\"e3\"> Tab 3 <it-icon name=\"it-settings\" class=\"icon icon-sm\"></it-icon> </it-tab> <it-tab-panel name=\"e1\">${panelContent(1)}</it-tab-panel> <it-tab-panel name=\"e2\">${panelContent(2)}</it-tab-panel> <it-tab-panel name=\"e3\">${panelContent(3)}</it-tab-panel> </it-tabs> `, }"
|
|
989
|
+
},
|
|
990
|
+
{
|
|
991
|
+
"kind": "variable",
|
|
992
|
+
"name": "LarghezzaTablistVerticale",
|
|
993
|
+
"type": {
|
|
994
|
+
"text": "Story"
|
|
995
|
+
},
|
|
996
|
+
"default": "{ name: 'Larghezza tablist verticale (--it-tabs-nav-size)', decorators: [ (Story) => html` <div style=\"min-height: 300px; display: flex; flex-direction: column; gap: 2rem; margin: auto;\">${Story()}</div> `, ], render: () => html` <div> <p style=\"margin-bottom: 0.5rem; font-weight: 600;\"><code>--it-tabs-nav-size: 220px</code> — larghezza fissa</p> <it-tabs placement=\"start\" label=\"Nav size fissa\" style=\"--it-tabs-nav-size: 220px;\"> <it-tab slot=\"tab\" panel=\"ns1\">Tab 1</it-tab> <it-tab slot=\"tab\" panel=\"ns2\">Tab 2</it-tab> <it-tab slot=\"tab\" panel=\"ns3\">Tab 3</it-tab> <it-tab-panel name=\"ns1\">${panelContent(1)}</it-tab-panel> <it-tab-panel name=\"ns2\">${panelContent(2)}</it-tab-panel> <it-tab-panel name=\"ns3\">${panelContent(3)}</it-tab-panel> </it-tabs> </div> <div> <p style=\"margin-bottom: 0.5rem; font-weight: 600;\"> <code>--it-tabs-nav-size: 50%</code> — larghezza proporzionale (placement start) </p> <it-tabs placement=\"start\" label=\"Nav size proporzionale\" style=\"--it-tabs-nav-size: 50%;\"> <it-tab slot=\"tab\" panel=\"np1\">Tab 1 con etichetta lunga</it-tab> <it-tab slot=\"tab\" panel=\"np2\">Tab 2</it-tab> <it-tab slot=\"tab\" panel=\"np3\">Tab 3</it-tab> <it-tab-panel name=\"np1\">${panelContent(1)}</it-tab-panel> <it-tab-panel name=\"np2\">${panelContent(2)}</it-tab-panel> <it-tab-panel name=\"np3\">${panelContent(3)}</it-tab-panel> </it-tabs> </div> `, }"
|
|
997
|
+
},
|
|
998
|
+
{
|
|
999
|
+
"kind": "variable",
|
|
1000
|
+
"name": "TabFade",
|
|
1001
|
+
"type": {
|
|
1002
|
+
"text": "Story"
|
|
1003
|
+
},
|
|
1004
|
+
"default": "{ name: 'Effetto fade', render: () => html` <it-tabs label=\"Tab con effetto fade\"> <it-tab slot=\"tab\" panel=\"f1\">Tab 1</it-tab> <it-tab slot=\"tab\" panel=\"f2\">Tab 2</it-tab> <it-tab slot=\"tab\" panel=\"f3\">Tab 3</it-tab> <it-tab-panel fade name=\"f1\">Pannello 1 — contenuto con dissolvenza in entrata.</it-tab-panel> <it-tab-panel fade name=\"f2\">Pannello 2 — contenuto con dissolvenza in entrata.</it-tab-panel> <it-tab-panel fade name=\"f3\">Pannello 3 — contenuto con dissolvenza in entrata.</it-tab-panel> </it-tabs> `, }"
|
|
1005
|
+
},
|
|
1006
|
+
{
|
|
1007
|
+
"kind": "variable",
|
|
1008
|
+
"name": "TabCardConPulsanti",
|
|
1009
|
+
"type": {
|
|
1010
|
+
"text": "Story"
|
|
1011
|
+
},
|
|
1012
|
+
"default": "{ name: 'Tab card con pulsanti aggiungi/elimina', args: { auto: true, }, render: () => { let counter = 5; const onAdd = (e: Event) => { const addBtn = e.currentTarget as Element; const itTabs = addBtn.closest('it-tabs')! as ItTabs; const n = counter++; const tab = document.createElement('it-tab') as ItTab; tab.setAttribute('slot', 'tab'); tab.setAttribute('panel', `et${n}`); tab.textContent = `Tab ${n}`; const panel = document.createElement('it-tab-panel') as ItTabPanel; panel.setAttribute('name', `et${n}`); panel.innerHTML = `Contenuto del pannello <strong>Tab ${n}</strong>`; itTabs.addTab(tab, panel); }; return html` <it-tabs cards dismissible label=\"Tab card con pulsanti\"> <it-tab slot=\"tab\" panel=\"et1\">Tab 1</it-tab> <it-tab slot=\"tab\" panel=\"et2\">Tab 2</it-tab> <it-tab slot=\"tab\" panel=\"et3\">Tab 3</it-tab> <it-tab slot=\"tab\" panel=\"et4\" disabled>Tab 4 Disabilitato</it-tab> <it-tab-panel name=\"et1\">Contenuto del pannello <strong>Tab 1</strong></it-tab-panel> <it-tab-panel name=\"et2\">Contenuto del pannello <strong>Tab 2</strong></it-tab-panel> <it-tab-panel name=\"et3\">Contenuto del pannello <strong>Tab 3</strong></it-tab-panel> <it-tab-panel name=\"et4\">Contenuto del pannello <strong>Tab 4 Disabilitato</strong></it-tab-panel> <it-button slot=\"after-tablist\" class=\"after-tablist\" variant=\"link\" icon size=\"sm\" it-aria-label=\"Aggiungi tab\" @click=${onAdd} > <it-icon name=\"it-plus-circle\" color=\"primary\" size=\"sm\"></it-icon> </it-button> </it-tabs> `; }, }"
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
"kind": "variable",
|
|
1016
|
+
"name": "TabCardConPulsantiCustomClose",
|
|
1017
|
+
"type": {
|
|
1018
|
+
"text": "Story"
|
|
1019
|
+
},
|
|
1020
|
+
"default": "{ name: 'Tab card con chiusura personalizzata', render: () => { let counter = 5; const onClose = (e: CustomEvent<ItTabCloseEventDetail>) => { e.preventDefault(); const itTabs = e.currentTarget as ItTabs; const label = itTabs.querySelector(`it-tab[panel=\"${e.detail.panel}\"]`)?.textContent?.trim(); if (confirm(`Chiudere \"${label}\"?`)) itTabs.close(e.detail.panel); }; const onAdd = (e: Event) => { const addBtn = e.currentTarget as Element; const itTabs = addBtn.closest('it-tabs')! as ItTabs; const n = counter++; const tab = document.createElement('it-tab') as ItTab; tab.setAttribute('slot', 'tab'); tab.setAttribute('panel', `cp${n}`); tab.textContent = `Tab ${n}`; const panel = document.createElement('it-tab-panel') as ItTabPanel; panel.setAttribute('name', `cp${n}`); panel.innerHTML = `Contenuto del pannello <strong>Tab ${n}</strong>`; itTabs.addTab(tab, panel); }; return html` <it-tabs cards dismissible label=\"Tab card con chiusura personalizzata\" @it-tab-close=${onClose}> <it-tab slot=\"tab\" panel=\"cp1\">Tab 1</it-tab> <it-tab slot=\"tab\" panel=\"cp2\">Tab 2</it-tab> <it-tab slot=\"tab\" panel=\"cp3\">Tab 3</it-tab> <it-tab slot=\"tab\" panel=\"cp4\" disabled>Tab 4 Disabilitato</it-tab> <it-tab-panel name=\"cp1\">Contenuto del pannello <strong>Tab 1</strong></it-tab-panel> <it-tab-panel name=\"cp2\">Contenuto del pannello <strong>Tab 2</strong></it-tab-panel> <it-tab-panel name=\"cp3\">Contenuto del pannello <strong>Tab 3</strong></it-tab-panel> <it-tab-panel name=\"cp4\">Contenuto del pannello <strong>Tab 4 Disabilitato</strong></it-tab-panel> <it-button slot=\"after-tablist\" class=\"after-tablist\" variant=\"link\" icon size=\"sm\" it-aria-label=\"Aggiungi tab\" @click=${onAdd} > <it-icon name=\"it-plus-circle\" color=\"primary\" size=\"sm\"></it-icon> </it-button> </it-tabs> `; }, }"
|
|
1021
|
+
},
|
|
1022
|
+
{
|
|
1023
|
+
"kind": "variable",
|
|
1024
|
+
"name": "TabCardConPulsantiCustomCloseJS",
|
|
1025
|
+
"type": {
|
|
1026
|
+
"text": "Story"
|
|
1027
|
+
},
|
|
1028
|
+
"default": "{ name: 'Tab card con chiusura personalizzata (JS source)', parameters: { docs: { source: { language: 'html', code: `<it-tabs id=\"editable-tabs\" cards dismissible label=\"Tab card con chiusura personalizzata\"> <it-tab slot=\"tab\" panel=\"cj1\">Tab 1</it-tab> <it-tab slot=\"tab\" panel=\"cj2\">Tab 2</it-tab> <it-tab slot=\"tab\" panel=\"cj3\">Tab 3</it-tab> <it-tab slot=\"tab\" panel=\"cj4\" disabled>Tab 4 Disabilitato</it-tab> <it-tab-panel name=\"cj1\">Contenuto del pannello <strong>Tab 1</strong></it-tab-panel> <it-tab-panel name=\"cj2\">Contenuto del pannello <strong>Tab 2</strong></it-tab-panel> <it-tab-panel name=\"cj3\">Contenuto del pannello <strong>Tab 3</strong></it-tab-panel> <it-tab-panel name=\"cj4\">Contenuto del pannello <strong>Tab 4 Disabilitato</strong></it-tab-panel> <it-button slot=\"after-tablist\" id=\"add-tab-btn\" variant=\"link\" icon size=\"sm\" it-aria-label=\"Aggiungi tab\"> <it-icon name=\"it-plus-circle\" color=\"primary\" size=\"sm\"></it-icon> </it-button> </it-tabs> <script> const host = document.getElementById('editable-tabs'); let counter = 5; host.addEventListener('it-tab-close', (e) => { e.preventDefault(); const label = host.querySelector('it-tab[panel=\"' + e.detail.panel + '\"]')?.textContent.trim(); if (confirm('Chiudere \"' + label + '\"?')) host.close(e.detail.panel); }); document.getElementById('add-tab-btn').addEventListener('click', () => { const n = counter++; const tab = document.createElement('it-tab'); tab.setAttribute('slot', 'tab'); tab.setAttribute('panel', 'cj' + n); tab.textContent = 'Tab ' + n; const panel = document.createElement('it-tab-panel'); panel.setAttribute('name', 'cj' + n); panel.innerHTML = 'Contenuto del pannello <strong>Tab ' + n + '</strong>'; host.addTab(tab, panel); }); </script>`, }, canvas: { sourceState: 'shown' }, }, }, render: () => { let counter = 5; const onClose = (e: CustomEvent<ItTabCloseEventDetail>) => { e.preventDefault(); const itTabs = e.currentTarget as ItTabs; const label = itTabs.querySelector(`it-tab[panel=\"${e.detail.panel}\"]`)?.textContent?.trim(); if (confirm(`Chiudere \"${label}\"?`)) itTabs.close(e.detail.panel); }; const onAdd = (e: Event) => { const itTabs = (e.currentTarget as Element).closest('it-tabs')! as ItTabs; const n = counter++; const tab = document.createElement('it-tab') as ItTab; tab.setAttribute('slot', 'tab'); tab.setAttribute('panel', `cj${n}`); tab.textContent = `Tab ${n}`; const panel = document.createElement('it-tab-panel') as ItTabPanel; panel.setAttribute('name', `cj${n}`); panel.innerHTML = `Contenuto del pannello <strong>Tab ${n}</strong>`; itTabs.addTab(tab, panel); }; return html` <it-tabs cards dismissible label=\"Tab card con chiusura personalizzata\" @it-tab-close=${onClose}> <it-tab slot=\"tab\" panel=\"cj1\">Tab 1</it-tab> <it-tab slot=\"tab\" panel=\"cj2\">Tab 2</it-tab> <it-tab slot=\"tab\" panel=\"cj3\">Tab 3</it-tab> <it-tab slot=\"tab\" panel=\"cj4\" disabled>Tab 4 Disabilitato</it-tab> <it-tab-panel name=\"cj1\">Contenuto del pannello <strong>Tab 1</strong></it-tab-panel> <it-tab-panel name=\"cj2\">Contenuto del pannello <strong>Tab 2</strong></it-tab-panel> <it-tab-panel name=\"cj3\">Contenuto del pannello <strong>Tab 3</strong></it-tab-panel> <it-tab-panel name=\"cj4\">Contenuto del pannello <strong>Tab 4 Disabilitato</strong></it-tab-panel> <it-button slot=\"after-tablist\" class=\"after-tablist\" variant=\"link\" icon size=\"sm\" it-aria-label=\"Aggiungi tab\" @click=${onAdd} > <it-icon name=\"it-plus-circle\" color=\"primary\" size=\"sm\"></it-icon> </it-button> </it-tabs> `; }, }"
|
|
1029
|
+
},
|
|
1030
|
+
{
|
|
1031
|
+
"kind": "variable",
|
|
1032
|
+
"name": "I18n",
|
|
1033
|
+
"type": {
|
|
1034
|
+
"text": "Story"
|
|
1035
|
+
},
|
|
1036
|
+
"default": "{ name: 'i18n', tags: ['!dev'], render: () => html`<div class=\"hide-preview\"></div>`, parameters: { viewMode: 'docs', docs: { description: { story: ` Per questo componente sono disponibili alcune stringhe traducibili tramite l'[utility di internazionalizzazione](/docs/i18n-internazionalizzazione--documentazione). \\`\\`\\`js const translation = ${JSON.stringify(i18nIT, null, 2)} \\`\\`\\` `, }, }, }, }"
|
|
1037
|
+
}
|
|
1038
|
+
],
|
|
1039
|
+
"exports": [
|
|
1040
|
+
{
|
|
1041
|
+
"kind": "js",
|
|
1042
|
+
"name": "default",
|
|
1043
|
+
"declaration": {
|
|
1044
|
+
"name": "meta",
|
|
1045
|
+
"module": "stories/it-tabs.stories.ts"
|
|
1046
|
+
}
|
|
1047
|
+
},
|
|
1048
|
+
{
|
|
1049
|
+
"kind": "js",
|
|
1050
|
+
"name": "EsempioInterattivo",
|
|
1051
|
+
"declaration": {
|
|
1052
|
+
"name": "EsempioInterattivo",
|
|
1053
|
+
"module": "stories/it-tabs.stories.ts"
|
|
1054
|
+
}
|
|
1055
|
+
},
|
|
1056
|
+
{
|
|
1057
|
+
"kind": "js",
|
|
1058
|
+
"name": "TabOrizzontale",
|
|
1059
|
+
"declaration": {
|
|
1060
|
+
"name": "TabOrizzontale",
|
|
1061
|
+
"module": "stories/it-tabs.stories.ts"
|
|
1062
|
+
}
|
|
1063
|
+
},
|
|
1064
|
+
{
|
|
1065
|
+
"kind": "js",
|
|
1066
|
+
"name": "TabATuttaLarghezza",
|
|
1067
|
+
"declaration": {
|
|
1068
|
+
"name": "TabATuttaLarghezza",
|
|
1069
|
+
"module": "stories/it-tabs.stories.ts"
|
|
1070
|
+
}
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
"kind": "js",
|
|
1074
|
+
"name": "TabScrollbarNascosta",
|
|
1075
|
+
"declaration": {
|
|
1076
|
+
"name": "TabScrollbarNascosta",
|
|
1077
|
+
"module": "stories/it-tabs.stories.ts"
|
|
1078
|
+
}
|
|
1079
|
+
},
|
|
1080
|
+
{
|
|
1081
|
+
"kind": "js",
|
|
1082
|
+
"name": "TabConIcona",
|
|
1083
|
+
"declaration": {
|
|
1084
|
+
"name": "TabConIcona",
|
|
1085
|
+
"module": "stories/it-tabs.stories.ts"
|
|
1086
|
+
}
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
"kind": "js",
|
|
1090
|
+
"name": "TabConTestoEIcona",
|
|
1091
|
+
"declaration": {
|
|
1092
|
+
"name": "TabConTestoEIcona",
|
|
1093
|
+
"module": "stories/it-tabs.stories.ts"
|
|
1094
|
+
}
|
|
1095
|
+
},
|
|
1096
|
+
{
|
|
1097
|
+
"kind": "js",
|
|
1098
|
+
"name": "TabVerticale",
|
|
1099
|
+
"declaration": {
|
|
1100
|
+
"name": "TabVerticale",
|
|
1101
|
+
"module": "stories/it-tabs.stories.ts"
|
|
1102
|
+
}
|
|
1103
|
+
},
|
|
1104
|
+
{
|
|
1105
|
+
"kind": "js",
|
|
1106
|
+
"name": "TabVerticaleConSfondo",
|
|
1107
|
+
"declaration": {
|
|
1108
|
+
"name": "TabVerticaleConSfondo",
|
|
1109
|
+
"module": "stories/it-tabs.stories.ts"
|
|
1110
|
+
}
|
|
1111
|
+
},
|
|
1112
|
+
{
|
|
1113
|
+
"kind": "js",
|
|
1114
|
+
"name": "TabCard",
|
|
1115
|
+
"declaration": {
|
|
1116
|
+
"name": "TabCard",
|
|
1117
|
+
"module": "stories/it-tabs.stories.ts"
|
|
1118
|
+
}
|
|
1119
|
+
},
|
|
1120
|
+
{
|
|
1121
|
+
"kind": "js",
|
|
1122
|
+
"name": "TabScuro",
|
|
1123
|
+
"declaration": {
|
|
1124
|
+
"name": "TabScuro",
|
|
1125
|
+
"module": "stories/it-tabs.stories.ts"
|
|
1126
|
+
}
|
|
1127
|
+
},
|
|
1128
|
+
{
|
|
1129
|
+
"kind": "js",
|
|
1130
|
+
"name": "TabScuroVerticale",
|
|
1131
|
+
"declaration": {
|
|
1132
|
+
"name": "TabScuroVerticale",
|
|
1133
|
+
"module": "stories/it-tabs.stories.ts"
|
|
1134
|
+
}
|
|
1135
|
+
},
|
|
1136
|
+
{
|
|
1137
|
+
"kind": "js",
|
|
1138
|
+
"name": "PosizionamentoBasso",
|
|
1139
|
+
"declaration": {
|
|
1140
|
+
"name": "PosizionamentoBasso",
|
|
1141
|
+
"module": "stories/it-tabs.stories.ts"
|
|
1142
|
+
}
|
|
1143
|
+
},
|
|
1144
|
+
{
|
|
1145
|
+
"kind": "js",
|
|
1146
|
+
"name": "PosizionamentoSinistra",
|
|
1147
|
+
"declaration": {
|
|
1148
|
+
"name": "PosizionamentoSinistra",
|
|
1149
|
+
"module": "stories/it-tabs.stories.ts"
|
|
1150
|
+
}
|
|
1151
|
+
},
|
|
1152
|
+
{
|
|
1153
|
+
"kind": "js",
|
|
1154
|
+
"name": "PosizionamentoDestra",
|
|
1155
|
+
"declaration": {
|
|
1156
|
+
"name": "PosizionamentoDestra",
|
|
1157
|
+
"module": "stories/it-tabs.stories.ts"
|
|
1158
|
+
}
|
|
1159
|
+
},
|
|
1160
|
+
{
|
|
1161
|
+
"kind": "js",
|
|
1162
|
+
"name": "LarghezzaTablistVerticale",
|
|
1163
|
+
"declaration": {
|
|
1164
|
+
"name": "LarghezzaTablistVerticale",
|
|
1165
|
+
"module": "stories/it-tabs.stories.ts"
|
|
1166
|
+
}
|
|
1167
|
+
},
|
|
1168
|
+
{
|
|
1169
|
+
"kind": "js",
|
|
1170
|
+
"name": "TabFade",
|
|
1171
|
+
"declaration": {
|
|
1172
|
+
"name": "TabFade",
|
|
1173
|
+
"module": "stories/it-tabs.stories.ts"
|
|
1174
|
+
}
|
|
1175
|
+
},
|
|
1176
|
+
{
|
|
1177
|
+
"kind": "js",
|
|
1178
|
+
"name": "TabCardConPulsanti",
|
|
1179
|
+
"declaration": {
|
|
1180
|
+
"name": "TabCardConPulsanti",
|
|
1181
|
+
"module": "stories/it-tabs.stories.ts"
|
|
1182
|
+
}
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
"kind": "js",
|
|
1186
|
+
"name": "TabCardConPulsantiCustomClose",
|
|
1187
|
+
"declaration": {
|
|
1188
|
+
"name": "TabCardConPulsantiCustomClose",
|
|
1189
|
+
"module": "stories/it-tabs.stories.ts"
|
|
1190
|
+
}
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
"kind": "js",
|
|
1194
|
+
"name": "TabCardConPulsantiCustomCloseJS",
|
|
1195
|
+
"declaration": {
|
|
1196
|
+
"name": "TabCardConPulsantiCustomCloseJS",
|
|
1197
|
+
"module": "stories/it-tabs.stories.ts"
|
|
1198
|
+
}
|
|
1199
|
+
},
|
|
1200
|
+
{
|
|
1201
|
+
"kind": "js",
|
|
1202
|
+
"name": "I18n",
|
|
1203
|
+
"declaration": {
|
|
1204
|
+
"name": "I18n",
|
|
1205
|
+
"module": "stories/it-tabs.stories.ts"
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
]
|
|
1209
|
+
},
|
|
1210
|
+
{
|
|
1211
|
+
"kind": "javascript-module",
|
|
1212
|
+
"path": "src/locales/en.ts",
|
|
1213
|
+
"declarations": [
|
|
1214
|
+
{
|
|
1215
|
+
"kind": "variable",
|
|
1216
|
+
"name": "translation",
|
|
1217
|
+
"type": {
|
|
1218
|
+
"text": "DefaultTranslation"
|
|
1219
|
+
},
|
|
1220
|
+
"default": "{ $code: 'en', $name: 'English', $dir: 'ltr', /** * A11y hint announced by screen readers on the active + dismissible tab. * Tells the user they can close the tab by re-activating it * (double-tap on VoiceOver/TalkBack, Enter/Space on keyboard) * or by pressing Delete/Backspace on a physical keyboard. */ closeActiveTabHint: 'You can close this tab by pressing Delete or Backspace on your keyboard. On touch devices, double tap to close this tab.', }"
|
|
1221
|
+
}
|
|
1222
|
+
],
|
|
1223
|
+
"exports": [
|
|
1224
|
+
{
|
|
1225
|
+
"kind": "js",
|
|
1226
|
+
"name": "default",
|
|
1227
|
+
"declaration": {
|
|
1228
|
+
"name": "translation",
|
|
1229
|
+
"module": "src/locales/en.ts"
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
]
|
|
1233
|
+
},
|
|
1234
|
+
{
|
|
1235
|
+
"kind": "javascript-module",
|
|
1236
|
+
"path": "src/locales/it.ts",
|
|
1237
|
+
"declarations": [
|
|
1238
|
+
{
|
|
1239
|
+
"kind": "variable",
|
|
1240
|
+
"name": "translation",
|
|
1241
|
+
"type": {
|
|
1242
|
+
"text": "DefaultTranslation"
|
|
1243
|
+
},
|
|
1244
|
+
"default": "{ $code: 'it', $name: 'Italiano', $dir: 'ltr', /** * Suggerimento a11y annunciato dallo screen reader sul tab attivo e dismissibile. * Informa l'utente che può chiudere il tab riattivando l'elemento * (doppio tap con VoiceOver/TalkBack, Invio/Spazio con tastiera) * oppure premendo Delete/Backspace sulla tastiera fisica. */ closeActiveTabHint: 'Puoi chiudere questo tab premendo Delete o Backspace da tastiera. Su dispositivi touch, doppio tap per chiudere questo tab.', }"
|
|
1245
|
+
}
|
|
1246
|
+
],
|
|
1247
|
+
"exports": [
|
|
1248
|
+
{
|
|
1249
|
+
"kind": "js",
|
|
1250
|
+
"name": "default",
|
|
1251
|
+
"declaration": {
|
|
1252
|
+
"name": "translation",
|
|
1253
|
+
"module": "src/locales/it.ts"
|
|
93
1254
|
}
|
|
94
1255
|
}
|
|
95
1256
|
]
|