@italia/modal 1.0.0-alpha.10
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/AUTHORS +3 -0
- package/LICENSE +11 -0
- package/README.md +59 -0
- package/custom-elements.json +1028 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +13 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/it-modal.d.ts +78 -0
- package/dist/src/it-modal.d.ts.map +1 -0
- package/dist/src/it-modal.js +3160 -0
- package/dist/src/it-modal.js.map +1 -0
- package/dist/src/types.d.ts +11 -0
- package/dist/src/types.d.ts.map +1 -0
- package/package.json +74 -0
- package/styles/globals.scss +33 -0
|
@@ -0,0 +1,1028 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0.0",
|
|
3
|
+
"readme": "",
|
|
4
|
+
"modules": [
|
|
5
|
+
{
|
|
6
|
+
"kind": "javascript-module",
|
|
7
|
+
"path": "src/index.ts",
|
|
8
|
+
"declarations": [],
|
|
9
|
+
"exports": [
|
|
10
|
+
{
|
|
11
|
+
"kind": "js",
|
|
12
|
+
"name": "ItModal",
|
|
13
|
+
"declaration": {
|
|
14
|
+
"name": "ItModal",
|
|
15
|
+
"module": "./it-modal.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"kind": "js",
|
|
20
|
+
"name": "*",
|
|
21
|
+
"declaration": {
|
|
22
|
+
"name": "*",
|
|
23
|
+
"module": "src/types.js"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"kind": "javascript-module",
|
|
30
|
+
"path": "src/it-modal.ts",
|
|
31
|
+
"declarations": [
|
|
32
|
+
{
|
|
33
|
+
"kind": "class",
|
|
34
|
+
"description": "",
|
|
35
|
+
"name": "ItModal",
|
|
36
|
+
"members": [
|
|
37
|
+
{
|
|
38
|
+
"kind": "field",
|
|
39
|
+
"name": "shadowRootOptions",
|
|
40
|
+
"type": {
|
|
41
|
+
"text": "object"
|
|
42
|
+
},
|
|
43
|
+
"static": true,
|
|
44
|
+
"default": "{ ...BaseComponent.shadowRootOptions, delegatesFocus: true }"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"kind": "field",
|
|
48
|
+
"name": "open",
|
|
49
|
+
"type": {
|
|
50
|
+
"text": "boolean | undefined"
|
|
51
|
+
},
|
|
52
|
+
"default": "undefined",
|
|
53
|
+
"attribute": "open",
|
|
54
|
+
"reflects": true
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"kind": "field",
|
|
58
|
+
"name": "modalTitle",
|
|
59
|
+
"type": {
|
|
60
|
+
"text": "string"
|
|
61
|
+
},
|
|
62
|
+
"default": "''",
|
|
63
|
+
"attribute": "modal-title",
|
|
64
|
+
"reflects": true
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"kind": "field",
|
|
68
|
+
"name": "modalDescription",
|
|
69
|
+
"type": {
|
|
70
|
+
"text": "string"
|
|
71
|
+
},
|
|
72
|
+
"default": "''",
|
|
73
|
+
"attribute": "modal-description",
|
|
74
|
+
"reflects": true
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"kind": "field",
|
|
78
|
+
"name": "customHeader",
|
|
79
|
+
"type": {
|
|
80
|
+
"text": "boolean"
|
|
81
|
+
},
|
|
82
|
+
"default": "false",
|
|
83
|
+
"attribute": "custom-header",
|
|
84
|
+
"reflects": true
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"kind": "field",
|
|
88
|
+
"name": "size",
|
|
89
|
+
"type": {
|
|
90
|
+
"text": "ModalSize"
|
|
91
|
+
},
|
|
92
|
+
"default": "''",
|
|
93
|
+
"attribute": "size",
|
|
94
|
+
"reflects": true
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"kind": "field",
|
|
98
|
+
"name": "position",
|
|
99
|
+
"type": {
|
|
100
|
+
"text": "ModalPosition | undefined"
|
|
101
|
+
},
|
|
102
|
+
"attribute": "position",
|
|
103
|
+
"reflects": true
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"kind": "field",
|
|
107
|
+
"name": "scrollable",
|
|
108
|
+
"type": {
|
|
109
|
+
"text": "boolean"
|
|
110
|
+
},
|
|
111
|
+
"default": "false",
|
|
112
|
+
"attribute": "scrollable",
|
|
113
|
+
"reflects": true
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"kind": "field",
|
|
117
|
+
"name": "staticBackdrop",
|
|
118
|
+
"type": {
|
|
119
|
+
"text": "boolean"
|
|
120
|
+
},
|
|
121
|
+
"default": "false",
|
|
122
|
+
"attribute": "static-backdrop",
|
|
123
|
+
"reflects": true
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"kind": "field",
|
|
127
|
+
"name": "hideCloseButton",
|
|
128
|
+
"type": {
|
|
129
|
+
"text": "boolean"
|
|
130
|
+
},
|
|
131
|
+
"default": "false",
|
|
132
|
+
"attribute": "hide-close-button",
|
|
133
|
+
"reflects": true
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"kind": "field",
|
|
137
|
+
"name": "closeButtonPlacement",
|
|
138
|
+
"type": {
|
|
139
|
+
"text": "| 'header'\n | 'backdrop'"
|
|
140
|
+
},
|
|
141
|
+
"default": "'header'",
|
|
142
|
+
"attribute": "close-button-placement",
|
|
143
|
+
"reflects": true
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"kind": "field",
|
|
147
|
+
"name": "variant",
|
|
148
|
+
"type": {
|
|
149
|
+
"text": "ModalVariant | undefined"
|
|
150
|
+
},
|
|
151
|
+
"attribute": "variant",
|
|
152
|
+
"reflects": true
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"kind": "field",
|
|
156
|
+
"name": "itAriaLabel",
|
|
157
|
+
"type": {
|
|
158
|
+
"text": "string"
|
|
159
|
+
},
|
|
160
|
+
"default": "''",
|
|
161
|
+
"attribute": "it-aria-label"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"kind": "field",
|
|
165
|
+
"name": "closeLabel",
|
|
166
|
+
"type": {
|
|
167
|
+
"text": "string"
|
|
168
|
+
},
|
|
169
|
+
"default": "''",
|
|
170
|
+
"attribute": "close-label",
|
|
171
|
+
"reflects": true
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"kind": "field",
|
|
175
|
+
"name": "disableAnimation",
|
|
176
|
+
"type": {
|
|
177
|
+
"text": "boolean"
|
|
178
|
+
},
|
|
179
|
+
"default": "false",
|
|
180
|
+
"attribute": "disable-animation",
|
|
181
|
+
"reflects": true
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"kind": "field",
|
|
185
|
+
"name": "footerShadow",
|
|
186
|
+
"type": {
|
|
187
|
+
"text": "boolean"
|
|
188
|
+
},
|
|
189
|
+
"default": "false",
|
|
190
|
+
"attribute": "footer-shadow",
|
|
191
|
+
"reflects": true
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"kind": "field",
|
|
195
|
+
"name": "_modalElement",
|
|
196
|
+
"type": {
|
|
197
|
+
"text": "HTMLElement"
|
|
198
|
+
},
|
|
199
|
+
"privacy": "private"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"kind": "field",
|
|
203
|
+
"name": "_triggerSlot",
|
|
204
|
+
"type": {
|
|
205
|
+
"text": "HTMLSlotElement"
|
|
206
|
+
},
|
|
207
|
+
"privacy": "private"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"kind": "field",
|
|
211
|
+
"name": "_headerSlot",
|
|
212
|
+
"type": {
|
|
213
|
+
"text": "HTMLSlotElement"
|
|
214
|
+
},
|
|
215
|
+
"privacy": "private"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"kind": "field",
|
|
219
|
+
"name": "_descriptionSlot",
|
|
220
|
+
"type": {
|
|
221
|
+
"text": "HTMLSlotElement"
|
|
222
|
+
},
|
|
223
|
+
"privacy": "private"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"kind": "field",
|
|
227
|
+
"name": "_backdropElement",
|
|
228
|
+
"type": {
|
|
229
|
+
"text": "HTMLElement"
|
|
230
|
+
},
|
|
231
|
+
"privacy": "private"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"kind": "field",
|
|
235
|
+
"name": "_dialogElement",
|
|
236
|
+
"type": {
|
|
237
|
+
"text": "HTMLElement"
|
|
238
|
+
},
|
|
239
|
+
"privacy": "private"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"kind": "field",
|
|
243
|
+
"name": "_titleId",
|
|
244
|
+
"type": {
|
|
245
|
+
"text": "string"
|
|
246
|
+
},
|
|
247
|
+
"privacy": "private",
|
|
248
|
+
"default": "''"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"kind": "field",
|
|
252
|
+
"name": "_triggerId",
|
|
253
|
+
"type": {
|
|
254
|
+
"text": "string"
|
|
255
|
+
},
|
|
256
|
+
"privacy": "private",
|
|
257
|
+
"default": "''"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"kind": "field",
|
|
261
|
+
"name": "_descriptionId",
|
|
262
|
+
"type": {
|
|
263
|
+
"text": "string"
|
|
264
|
+
},
|
|
265
|
+
"privacy": "private",
|
|
266
|
+
"default": "''"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"kind": "field",
|
|
270
|
+
"name": "isAnimating",
|
|
271
|
+
"type": {
|
|
272
|
+
"text": "boolean"
|
|
273
|
+
},
|
|
274
|
+
"privacy": "private",
|
|
275
|
+
"default": "false"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"kind": "field",
|
|
279
|
+
"name": "_isSelfClosing",
|
|
280
|
+
"type": {
|
|
281
|
+
"text": "boolean"
|
|
282
|
+
},
|
|
283
|
+
"privacy": "private",
|
|
284
|
+
"default": "false"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"kind": "field",
|
|
288
|
+
"name": "_originalTrigger",
|
|
289
|
+
"type": {
|
|
290
|
+
"text": "HTMLElement | null"
|
|
291
|
+
},
|
|
292
|
+
"privacy": "private",
|
|
293
|
+
"default": "null"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"kind": "field",
|
|
297
|
+
"name": "_safariMouseInteraction",
|
|
298
|
+
"type": {
|
|
299
|
+
"text": "boolean"
|
|
300
|
+
},
|
|
301
|
+
"privacy": "private",
|
|
302
|
+
"default": "false"
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"kind": "field",
|
|
306
|
+
"name": "_dialogAnimation",
|
|
307
|
+
"type": {
|
|
308
|
+
"text": "Animation | undefined"
|
|
309
|
+
},
|
|
310
|
+
"privacy": "private"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"kind": "field",
|
|
314
|
+
"name": "_backdropAnimation",
|
|
315
|
+
"type": {
|
|
316
|
+
"text": "Animation | undefined"
|
|
317
|
+
},
|
|
318
|
+
"privacy": "private"
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"kind": "field",
|
|
322
|
+
"name": "_dialogAnimationDuration",
|
|
323
|
+
"type": {
|
|
324
|
+
"text": "number"
|
|
325
|
+
},
|
|
326
|
+
"privacy": "private",
|
|
327
|
+
"readonly": true,
|
|
328
|
+
"default": "300"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"kind": "field",
|
|
332
|
+
"name": "_backdropAnimationDuration",
|
|
333
|
+
"type": {
|
|
334
|
+
"text": "number"
|
|
335
|
+
},
|
|
336
|
+
"privacy": "private",
|
|
337
|
+
"readonly": true,
|
|
338
|
+
"default": "150"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"kind": "field",
|
|
342
|
+
"name": "_inertElements",
|
|
343
|
+
"type": {
|
|
344
|
+
"text": "HTMLElement[]"
|
|
345
|
+
},
|
|
346
|
+
"privacy": "private",
|
|
347
|
+
"default": "[]"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"kind": "field",
|
|
351
|
+
"name": "_triggerPointerBefore",
|
|
352
|
+
"type": {
|
|
353
|
+
"text": "string | null"
|
|
354
|
+
},
|
|
355
|
+
"privacy": "private",
|
|
356
|
+
"default": "null"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"kind": "field",
|
|
360
|
+
"name": "_restoreFocusTimer",
|
|
361
|
+
"type": {
|
|
362
|
+
"text": "ReturnType<typeof setTimeout> | null"
|
|
363
|
+
},
|
|
364
|
+
"privacy": "private",
|
|
365
|
+
"default": "null",
|
|
366
|
+
"description": "Timer ID for the focus-restore call in finishHide. Cancelled on reconnect/unmount\nto prevent a stale focus from a previous close cycle firing during a new open."
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"kind": "field",
|
|
370
|
+
"name": "_focusTrap",
|
|
371
|
+
"type": {
|
|
372
|
+
"text": "FocusTrapController"
|
|
373
|
+
},
|
|
374
|
+
"privacy": "private",
|
|
375
|
+
"default": "new FocusTrapController(this, { getContainer: () => this._modalElement, initialFocus: () => this._modalElement, getTrigger: () => this._triggerElement, onEscape: () => { this._safariMouseInteraction = false; this.hide(); }, })"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"kind": "field",
|
|
379
|
+
"name": "_triggerElement",
|
|
380
|
+
"type": {
|
|
381
|
+
"text": "HTMLElement | null"
|
|
382
|
+
},
|
|
383
|
+
"readonly": true
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"kind": "method",
|
|
387
|
+
"name": "show",
|
|
388
|
+
"privacy": "public",
|
|
389
|
+
"return": {
|
|
390
|
+
"type": {
|
|
391
|
+
"text": "void"
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"kind": "method",
|
|
397
|
+
"name": "hide",
|
|
398
|
+
"privacy": "public",
|
|
399
|
+
"return": {
|
|
400
|
+
"type": {
|
|
401
|
+
"text": "void"
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"kind": "method",
|
|
407
|
+
"name": "toggle",
|
|
408
|
+
"privacy": "public",
|
|
409
|
+
"return": {
|
|
410
|
+
"type": {
|
|
411
|
+
"text": "void"
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
"kind": "method",
|
|
417
|
+
"name": "_applyInert",
|
|
418
|
+
"privacy": "private",
|
|
419
|
+
"return": {
|
|
420
|
+
"type": {
|
|
421
|
+
"text": "void"
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
"kind": "method",
|
|
427
|
+
"name": "_removeInert",
|
|
428
|
+
"privacy": "private",
|
|
429
|
+
"return": {
|
|
430
|
+
"type": {
|
|
431
|
+
"text": "void"
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
"kind": "field",
|
|
437
|
+
"name": "_handleDialogClick",
|
|
438
|
+
"privacy": "private"
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
"kind": "field",
|
|
442
|
+
"name": "_handleBackdropClick",
|
|
443
|
+
"privacy": "private"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"kind": "method",
|
|
447
|
+
"name": "_showModal",
|
|
448
|
+
"privacy": "private",
|
|
449
|
+
"return": {
|
|
450
|
+
"type": {
|
|
451
|
+
"text": "Promise<void>"
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
"kind": "method",
|
|
457
|
+
"name": "_hideModal",
|
|
458
|
+
"privacy": "private",
|
|
459
|
+
"return": {
|
|
460
|
+
"type": {
|
|
461
|
+
"text": "void"
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
"kind": "method",
|
|
467
|
+
"name": "_cleanupAnimations",
|
|
468
|
+
"privacy": "private",
|
|
469
|
+
"return": {
|
|
470
|
+
"type": {
|
|
471
|
+
"text": "void"
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
"kind": "field",
|
|
477
|
+
"name": "_onTriggerSlotChange",
|
|
478
|
+
"privacy": "private"
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
"kind": "field",
|
|
482
|
+
"name": "_onHeaderSlotChange",
|
|
483
|
+
"privacy": "private"
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"kind": "method",
|
|
487
|
+
"name": "_setupTriggerListeners",
|
|
488
|
+
"privacy": "private",
|
|
489
|
+
"return": {
|
|
490
|
+
"type": {
|
|
491
|
+
"text": "void"
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
"kind": "method",
|
|
497
|
+
"name": "_removeTriggerListeners",
|
|
498
|
+
"privacy": "private",
|
|
499
|
+
"return": {
|
|
500
|
+
"type": {
|
|
501
|
+
"text": "void"
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
"kind": "field",
|
|
507
|
+
"name": "_onTriggerClick",
|
|
508
|
+
"privacy": "private"
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
"kind": "field",
|
|
512
|
+
"name": "_onTriggerKeydown",
|
|
513
|
+
"privacy": "private"
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
"kind": "field",
|
|
517
|
+
"name": "_modalClasses",
|
|
518
|
+
"privacy": "private",
|
|
519
|
+
"readonly": true
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
"kind": "field",
|
|
523
|
+
"name": "_modalBodyClasses",
|
|
524
|
+
"privacy": "private",
|
|
525
|
+
"readonly": true
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
"kind": "method",
|
|
529
|
+
"name": "_renderCloseButton",
|
|
530
|
+
"privacy": "private"
|
|
531
|
+
}
|
|
532
|
+
],
|
|
533
|
+
"events": [
|
|
534
|
+
{
|
|
535
|
+
"name": "it-modal-open",
|
|
536
|
+
"type": {
|
|
537
|
+
"text": "CustomEvent"
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
"name": "it-modal-close",
|
|
542
|
+
"type": {
|
|
543
|
+
"text": "CustomEvent"
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
],
|
|
547
|
+
"attributes": [
|
|
548
|
+
{
|
|
549
|
+
"name": "open",
|
|
550
|
+
"type": {
|
|
551
|
+
"text": "boolean | undefined"
|
|
552
|
+
},
|
|
553
|
+
"default": "undefined",
|
|
554
|
+
"fieldName": "open"
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
"name": "modal-title",
|
|
558
|
+
"type": {
|
|
559
|
+
"text": "string"
|
|
560
|
+
},
|
|
561
|
+
"default": "''",
|
|
562
|
+
"fieldName": "modalTitle"
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
"name": "modal-description",
|
|
566
|
+
"type": {
|
|
567
|
+
"text": "string"
|
|
568
|
+
},
|
|
569
|
+
"default": "''",
|
|
570
|
+
"fieldName": "modalDescription"
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
"name": "custom-header",
|
|
574
|
+
"type": {
|
|
575
|
+
"text": "boolean"
|
|
576
|
+
},
|
|
577
|
+
"default": "false",
|
|
578
|
+
"fieldName": "customHeader"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"name": "size",
|
|
582
|
+
"type": {
|
|
583
|
+
"text": "ModalSize"
|
|
584
|
+
},
|
|
585
|
+
"default": "''",
|
|
586
|
+
"fieldName": "size"
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
"name": "position",
|
|
590
|
+
"type": {
|
|
591
|
+
"text": "ModalPosition | undefined"
|
|
592
|
+
},
|
|
593
|
+
"fieldName": "position"
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
"name": "scrollable",
|
|
597
|
+
"type": {
|
|
598
|
+
"text": "boolean"
|
|
599
|
+
},
|
|
600
|
+
"default": "false",
|
|
601
|
+
"fieldName": "scrollable"
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
"name": "static-backdrop",
|
|
605
|
+
"type": {
|
|
606
|
+
"text": "boolean"
|
|
607
|
+
},
|
|
608
|
+
"default": "false",
|
|
609
|
+
"fieldName": "staticBackdrop"
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
"name": "hide-close-button",
|
|
613
|
+
"type": {
|
|
614
|
+
"text": "boolean"
|
|
615
|
+
},
|
|
616
|
+
"default": "false",
|
|
617
|
+
"fieldName": "hideCloseButton"
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
"name": "close-button-placement",
|
|
621
|
+
"type": {
|
|
622
|
+
"text": "| 'header'\n | 'backdrop'"
|
|
623
|
+
},
|
|
624
|
+
"default": "'header'",
|
|
625
|
+
"fieldName": "closeButtonPlacement"
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
"name": "variant",
|
|
629
|
+
"type": {
|
|
630
|
+
"text": "ModalVariant | undefined"
|
|
631
|
+
},
|
|
632
|
+
"fieldName": "variant"
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
"name": "it-aria-label",
|
|
636
|
+
"type": {
|
|
637
|
+
"text": "string"
|
|
638
|
+
},
|
|
639
|
+
"default": "''",
|
|
640
|
+
"fieldName": "itAriaLabel"
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
"name": "close-label",
|
|
644
|
+
"type": {
|
|
645
|
+
"text": "string"
|
|
646
|
+
},
|
|
647
|
+
"default": "''",
|
|
648
|
+
"fieldName": "closeLabel"
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
"name": "disable-animation",
|
|
652
|
+
"type": {
|
|
653
|
+
"text": "boolean"
|
|
654
|
+
},
|
|
655
|
+
"default": "false",
|
|
656
|
+
"fieldName": "disableAnimation"
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
"name": "footer-shadow",
|
|
660
|
+
"type": {
|
|
661
|
+
"text": "boolean"
|
|
662
|
+
},
|
|
663
|
+
"default": "false",
|
|
664
|
+
"fieldName": "footerShadow"
|
|
665
|
+
}
|
|
666
|
+
],
|
|
667
|
+
"superclass": {
|
|
668
|
+
"name": "BaseComponent",
|
|
669
|
+
"package": "@italia/globals"
|
|
670
|
+
},
|
|
671
|
+
"tagName": "it-modal",
|
|
672
|
+
"customElement": true
|
|
673
|
+
}
|
|
674
|
+
],
|
|
675
|
+
"exports": [
|
|
676
|
+
{
|
|
677
|
+
"kind": "js",
|
|
678
|
+
"name": "ItModal",
|
|
679
|
+
"declaration": {
|
|
680
|
+
"name": "ItModal",
|
|
681
|
+
"module": "src/it-modal.ts"
|
|
682
|
+
}
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
"kind": "custom-element-definition",
|
|
686
|
+
"name": "it-modal",
|
|
687
|
+
"declaration": {
|
|
688
|
+
"name": "ItModal",
|
|
689
|
+
"module": "src/it-modal.ts"
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
]
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
"kind": "javascript-module",
|
|
696
|
+
"path": "src/types.ts",
|
|
697
|
+
"declarations": [
|
|
698
|
+
{
|
|
699
|
+
"kind": "variable",
|
|
700
|
+
"name": "MODAL_SIZES",
|
|
701
|
+
"type": {
|
|
702
|
+
"text": "['sm', 'lg', 'xl']"
|
|
703
|
+
},
|
|
704
|
+
"default": "['sm', 'lg', 'xl']"
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
"kind": "variable",
|
|
708
|
+
"name": "MODAL_POSITIONS",
|
|
709
|
+
"type": {
|
|
710
|
+
"text": "['center', 'left', 'right']"
|
|
711
|
+
},
|
|
712
|
+
"default": "['center', 'left', 'right']"
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
"kind": "variable",
|
|
716
|
+
"name": "MODAL_VARIANTS",
|
|
717
|
+
"type": {
|
|
718
|
+
"text": "['alert', 'popconfirm', 'link-list']"
|
|
719
|
+
},
|
|
720
|
+
"default": "['alert', 'popconfirm', 'link-list']"
|
|
721
|
+
}
|
|
722
|
+
],
|
|
723
|
+
"exports": [
|
|
724
|
+
{
|
|
725
|
+
"kind": "js",
|
|
726
|
+
"name": "MODAL_SIZES",
|
|
727
|
+
"declaration": {
|
|
728
|
+
"name": "MODAL_SIZES",
|
|
729
|
+
"module": "src/types.ts"
|
|
730
|
+
}
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
"kind": "js",
|
|
734
|
+
"name": "MODAL_POSITIONS",
|
|
735
|
+
"declaration": {
|
|
736
|
+
"name": "MODAL_POSITIONS",
|
|
737
|
+
"module": "src/types.ts"
|
|
738
|
+
}
|
|
739
|
+
},
|
|
740
|
+
{
|
|
741
|
+
"kind": "js",
|
|
742
|
+
"name": "MODAL_VARIANTS",
|
|
743
|
+
"declaration": {
|
|
744
|
+
"name": "MODAL_VARIANTS",
|
|
745
|
+
"module": "src/types.ts"
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
]
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
"kind": "javascript-module",
|
|
752
|
+
"path": "stories/it-modal.stories.ts",
|
|
753
|
+
"declarations": [
|
|
754
|
+
{
|
|
755
|
+
"kind": "variable",
|
|
756
|
+
"name": "meta",
|
|
757
|
+
"default": "{ title: 'Componenti/Modal', component: 'it-modal', tags: ['alpha', 'a11y-ok', 'web-component'], parameters: { layout: 'fullscreen', docs: { story: { inline: false, iframeHeight: 420, }, }, }, args: { 'modal-title': 'Titolo modale', 'modal-description': 'Descrizione della modale', 'custom-header': false, size: '', position: undefined, scrollable: false, 'static-backdrop': false, 'hide-close-button': false, 'close-button-placement': 'header', variant: '', 'close-label': 'Chiudi finestra modale', 'disable-animation': false, 'footer-shadow': false, triggerLabel: 'Apri modale', bodyContent: 'Contenuto della modale. Può includere testo, form, o qualsiasi altro elemento.', }, argTypes: { 'modal-title': { control: 'text', description: 'Titolo della modale (usa slot `header` per contenuto custom)', }, 'modal-description': { control: 'text', description: 'Descrizione della modale (usa slot `description` per contenuto custom), verrrà inserita in un elemento visivamente nascosto per i lettori di schermo.', }, 'custom-header': { control: 'boolean', description: \"Abilita header custom. In questo modo è possibile inserire un header personalizzato tramite slot, altrimenti lo slot header verrà inserito all'interno di un `h2` con classi predefinite per garantire la corretta semantica e accessibilità.\", table: { defaultValue: { summary: 'false' } }, }, size: { control: 'select', options: MODAL_SIZES, description: 'Dimensione della modale', table: { defaultValue: { summary: undefined } }, }, position: { control: 'select', options: MODAL_POSITIONS, description: 'Posizionamento della modale', table: { defaultValue: { summary: undefined } }, }, scrollable: { control: 'boolean', description: 'Abilita scroll interno al body', table: { defaultValue: { summary: 'false' } }, }, 'static-backdrop': { control: 'boolean', description: 'Disabilita chiusura su click backdrop', table: { defaultValue: { summary: 'false' } }, }, 'hide-close-button': { control: 'boolean', description: 'Nasconde il pulsante di chiusura', }, 'close-button-placement': { control: 'select', options: ['header', 'backdrop'], description: 'Posizione del pulsante di chiusura: `header` (default) o `backdrop`', table: { defaultValue: { summary: 'header' } }, }, variant: { control: 'select', options: MODAL_VARIANTS, description: 'Variante della modale', table: { defaultValue: { summary: undefined } }, }, 'close-label': { control: 'text', description: 'Etichetta accessibile per il pulsante di chiusura', table: { defaultValue: { summary: 'Chiudi finestra modale' } }, }, 'disable-animation': { control: 'boolean', description: 'Disabilita animazione fade', }, 'footer-shadow': { control: 'boolean', description: 'Ombra sul footer per contenuti lunghi', table: { defaultValue: { summary: 'false' } }, }, triggerLabel: { table: { disable: true }, }, bodyContent: { table: { disable: true }, }, }, } satisfies Meta<ModalProps>"
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
"kind": "variable",
|
|
761
|
+
"name": "EsempioInterattivo",
|
|
762
|
+
"type": {
|
|
763
|
+
"text": "Story"
|
|
764
|
+
},
|
|
765
|
+
"default": "{ name: 'Esempio interattivo', tags: ['!dev'], parameters: { docs: { canvas: { sourceState: 'hidden' }, }, }, render: (args) => html` <it-modal ?hide-close-button=\"${args['hide-close-button']}\" ?disable-animation=\"${args['disable-animation']}\" size=\"${ifDefined(args.size || undefined)}\" position=\"${args.position}\" variant=\"${ifDefined(args.variant || undefined)}\" ?scrollable=\"${args.scrollable}\" ?static-backdrop=\"${args['static-backdrop']}\" ?footer-shadow=\"${args['footer-shadow']}\" close-label=\"${args['close-label']}\" close-button-placement=\"${args['close-button-placement']}\" modal-title=\"${args['modal-title']}\" modal-description=\"${args['modal-description']}\" custom-header=\"${args['custom-header']}\" > <it-button variant=\"primary\" slot=\"trigger\">Lancia la demo della modale</it-button> <span slot=\"header\">${args['modal-title']}</span> <span slot=\"description\">${args['modal-description']}</span> <p slot=\"content\">${args.bodyContent}</p> <it-button slot=\"footer\" variant=\"outline-primary\" @click=\"${closeModal}\">Annulla</it-button> <it-button slot=\"footer\" variant=\"primary\" @click=\"${closeModal}\">Conferma</it-button> </it-modal> `, }"
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
"kind": "variable",
|
|
769
|
+
"name": "ModaleBase",
|
|
770
|
+
"type": {
|
|
771
|
+
"text": "Story"
|
|
772
|
+
},
|
|
773
|
+
"default": "{ name: 'Con pulsante di chiusura', render: () => html` <div class=\"d-flex gap-4\"> <it-modal close-label=\"Chiudi finestra modale\" modal-description=\"Descrizione della modale\"> <it-button variant=\"primary\" slot=\"trigger\">Lancia la demo della modale</it-button> <span slot=\"header\">Titolo modale</span> <p slot=\"content\">Testo che descrive lo scopo della modale e quali sono le azioni richieste all'utente.</p> <it-button slot=\"footer\" variant=\"outline-primary\" @click=\"${closeModal}\">Annulla</it-button> <it-button slot=\"footer\" variant=\"primary\" @click=\"${closeModal}\">Conferma</it-button> </it-modal> <it-modal hide-close-button> <it-button variant=\"primary\" slot=\"trigger\">Lancia la demo della modale senza close button</it-button> <span slot=\"header\">Titolo modale</span> <p slot=\"content\">Testo che descrive lo scopo della modale e quali sono le azioni richieste all'utente.</p> <it-button slot=\"footer\" variant=\"outline-primary\" @click=\"${closeModal}\">Annulla</it-button> <it-button slot=\"footer\" variant=\"primary\" @click=\"${closeModal}\">Conferma</it-button> </it-modal> </div> `, }"
|
|
774
|
+
},
|
|
775
|
+
{
|
|
776
|
+
"kind": "variable",
|
|
777
|
+
"name": "ConIcona",
|
|
778
|
+
"type": {
|
|
779
|
+
"text": "Story"
|
|
780
|
+
},
|
|
781
|
+
"default": "{ name: 'Con icona', render: () => html` <it-modal variant=\"alert\" close-label=\"Chiudi finestra modale\"> <it-button variant=\"primary\" slot=\"trigger\">Lancia la demo della modale</it-button> <it-icon slot=\"header-icon\" name=\"it-warning-circle\" size=\"lg\" color=\"warning\"></it-icon> <span slot=\"header\">Questo è un messaggio di notifica</span> <p slot=\"content\">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.</p> <it-button slot=\"footer\" variant=\"primary\" @click=\"${closeModal}\">Conferma</it-button> </it-modal> `, }"
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
"kind": "variable",
|
|
785
|
+
"name": "FooterCustom",
|
|
786
|
+
"type": {
|
|
787
|
+
"text": "Story"
|
|
788
|
+
},
|
|
789
|
+
"default": "{ name: 'Modale con footer personalizzato', render: () => html` <it-modal close-label=\"Chiudi finestra modale\"> <it-button variant=\"primary\" slot=\"trigger\">Lancia la demo della modale</it-button> <span slot=\"header\">Con footer personalizzato</span> <p slot=\"content\">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.</p> <div slot=\"footer\" class=\"d-flex justify-content-between gap-2 align-items-center\" style=\"width:100%;\"> <a href=\"#\">Link di supporto</a> <div class=\"d-flex justify-content-end gap-2\"> <it-button variant=\"outline-primary\" @click=\"${closeModal}\">Annulla</it-button> <it-button variant=\"primary\" @click=\"${closeModal}\">Conferma</it-button> </div> </div> </it-modal> `, }"
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
"kind": "variable",
|
|
793
|
+
"name": "ConForm",
|
|
794
|
+
"type": {
|
|
795
|
+
"text": "Story"
|
|
796
|
+
},
|
|
797
|
+
"default": "{ name: 'Modale con elementi form', render: () => html` <it-modal close-label=\"Chiudi finestra modale\"> <it-button variant=\"primary\" slot=\"trigger\">Lancia la demo della modale</it-button> <span slot=\"header\">Seleziona un'opzione dal form</span> <div slot=\"content\"> <it-radio-group name=\"gruppo1\"> <span slot=\"label\">Esempio interattivo</span> <it-radio id=\"radio1\" value=\"opzione1\"> <span slot=\"label\">Radio di esempio 1</span> </it-radio> <it-radio id=\"radio2\" value=\"opzione2\"> <span slot=\"label\">Radio di esempio 2</span> </it-radio> <it-radio id=\"radio3\" value=\"opzione3\"> <span slot=\"label\">Radio di esempio 3</span> </it-radio> </it-radio-group> </div> <it-button slot=\"footer\" variant=\"primary\" @click=\"${closeModal}\">Conferma</it-button> </it-modal> `, }"
|
|
798
|
+
},
|
|
799
|
+
{
|
|
800
|
+
"kind": "variable",
|
|
801
|
+
"name": "ConLinkList",
|
|
802
|
+
"type": {
|
|
803
|
+
"text": "Story"
|
|
804
|
+
},
|
|
805
|
+
"default": "{ name: 'Modale con Link List', render: () => html` <it-modal variant=\"link-list\" close-label=\"Chiudi finestra modale\"> <it-button variant=\"primary\" slot=\"trigger\">Lancia la demo della modale</it-button> <span slot=\"header\" >Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt</span > <div class=\"link-list-wrapper\" slot=\"content\"> <ul class=\"link-list\"> <li> <a class=\"list-item icon-left\" href=\"#\"> <span>Link lista 1</span> </a> </li> <li> <a class=\"list-item icon-left\" href=\"#\"> <span>Link lista 2</span> </a> </li> <li> <a class=\"list-item icon-left\" href=\"#\"> <span>Link lista 3</span> </a> </li> </ul> </div> <it-button slot=\"footer\" variant=\"primary\" @click=\"${closeModal}\">Conferma</it-button> </it-modal> `, }"
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
"kind": "variable",
|
|
809
|
+
"name": "Popconfirm",
|
|
810
|
+
"type": {
|
|
811
|
+
"text": "Story"
|
|
812
|
+
},
|
|
813
|
+
"default": "{ render: () => html` <div class=\"d-flex gap-3\"> <it-modal variant=\"popconfirm\"> <it-button variant=\"primary\" slot=\"trigger\">Popconfirm basico</it-button> <p slot=\"content\">Breve messaggio di conferma inserito nella modale</p> <it-button slot=\"footer\" variant=\"outline-primary\" @click=\"${closeModal}\">Azione 1</it-button> <it-button slot=\"footer\" variant=\"primary\" @click=\"${closeModal}\">Azione 2</it-button> </it-modal> <it-modal variant=\"popconfirm\"> <it-button variant=\"primary\" slot=\"trigger\">Popconfirm con header</it-button> <span slot=\"header\">Titolo modale</span> <p slot=\"content\">Breve messaggio di conferma inserito nella modale</p> <it-button slot=\"footer\" variant=\"outline-primary\" @click=\"${closeModal}\">Azione 1</it-button> <it-button slot=\"footer\" variant=\"primary\" @click=\"${closeModal}\">Azione 2</it-button> </it-modal> </div> `, }"
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
"kind": "variable",
|
|
817
|
+
"name": "ScrollLungo",
|
|
818
|
+
"type": {
|
|
819
|
+
"text": "Story"
|
|
820
|
+
},
|
|
821
|
+
"default": "{ parameters: { docs: { story: { iframeHeight: 600, }, }, }, name: 'Scroll di contenuti lunghi', render: () => html` <it-modal footer-shadow close-label=\"Chiudi finestra modale\"> <it-button variant=\"primary\" slot=\"trigger\">Lancia la demo della modale</it-button> <span slot=\"header\">Scroll di contenuti lunghi</span> <div slot=\"content\"> ${Array(20) .fill(0) .map( () => html` <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p> `, )} </div> <it-button slot=\"footer\" variant=\"outline-primary\" @click=\"${closeModal}\">Annulla</it-button> <it-button slot=\"footer\" variant=\"primary\" @click=\"${closeModal}\">Conferma</it-button> </it-modal> `, }"
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
"kind": "variable",
|
|
825
|
+
"name": "ScrollInterno",
|
|
826
|
+
"type": {
|
|
827
|
+
"text": "Story"
|
|
828
|
+
},
|
|
829
|
+
"default": "{ parameters: { docs: { story: { iframeHeight: 600, }, }, }, name: 'Scroll interno alla modale', render: () => html` <it-modal scrollable footer-shadow close-label=\"Chiudi finestra modale\"> <it-button variant=\"primary\" slot=\"trigger\">Lancia la demo della modale</it-button> <span slot=\"header\">Modale con scroll interno</span> <div slot=\"content\"> ${Array(20) .fill(0) .map( () => html` <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p> `, )} </div> <it-button slot=\"footer\" variant=\"outline-primary\" @click=\"${closeModal}\">Annulla</it-button> <it-button slot=\"footer\" variant=\"primary\" @click=\"${closeModal}\">Conferma</it-button> </it-modal> `, }"
|
|
830
|
+
},
|
|
831
|
+
{
|
|
832
|
+
"kind": "variable",
|
|
833
|
+
"name": "CentraturaVerticale",
|
|
834
|
+
"type": {
|
|
835
|
+
"text": "Story"
|
|
836
|
+
},
|
|
837
|
+
"default": "{ name: 'Centratura verticale', render: () => html` <it-modal position=\"center\" close-label=\"Chiudi finestra modale\"> <it-button variant=\"primary\" slot=\"trigger\">Lancia la demo della modale</it-button> <span slot=\"header\">Centratura verticale</span> <div slot=\"content\"> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p> </div> <it-button slot=\"footer\" variant=\"outline-primary\" @click=\"${closeModal}\">Annulla</it-button> <it-button slot=\"footer\" variant=\"primary\" @click=\"${closeModal}\">Conferma</it-button> </it-modal> `, }"
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
"kind": "variable",
|
|
841
|
+
"name": "AllineamentoSinistra",
|
|
842
|
+
"type": {
|
|
843
|
+
"text": "Story"
|
|
844
|
+
},
|
|
845
|
+
"default": "{ parameters: { docs: { story: { iframeHeight: 600, }, }, }, name: 'Allineamento a sinistra', render: () => html` <it-modal position=\"left\" close-label=\"Chiudi finestra modale\" scrollable> <it-button variant=\"primary\" slot=\"trigger\">Lancia la demo della modale</it-button> <span slot=\"header\">Modale allineata a sinistra</span> <p slot=\"content\"> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.. </p> <it-button slot=\"footer\" variant=\"outline-primary\" @click=\"${closeModal}\">Annulla</it-button> <it-button slot=\"footer\" variant=\"primary\" @click=\"${closeModal}\">Conferma</it-button> </it-modal> `, }"
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
"kind": "variable",
|
|
849
|
+
"name": "AllineamentoDestra",
|
|
850
|
+
"type": {
|
|
851
|
+
"text": "Story"
|
|
852
|
+
},
|
|
853
|
+
"default": "{ parameters: { docs: { story: { iframeHeight: 600, }, }, }, decorators: [(story) => html` <div style=\"display:flex; height:100%; align-items:center;\">${story()}</div> `], name: 'Allineamento a destra', render: () => html` <it-modal position=\"right\" close-label=\"Chiudi finestra modale\" scrollable> <it-button variant=\"primary\" slot=\"trigger\">Lancia la demo della modale</it-button> <span slot=\"header\">Modale allineata a destra</span> <p slot=\"content\"> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p> <it-button slot=\"footer\" variant=\"outline-primary\" @click=\"${closeModal}\">Annulla</it-button> <it-button slot=\"footer\" variant=\"primary\" @click=\"${closeModal}\">Conferma</it-button> </it-modal> `, }"
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
"kind": "variable",
|
|
857
|
+
"name": "DimensioniOpzionali",
|
|
858
|
+
"type": {
|
|
859
|
+
"text": "Story"
|
|
860
|
+
},
|
|
861
|
+
"default": "{ parameters: { docs: { story: { iframeHeight: 600, }, }, }, name: 'Dimensioni opzionali', render: () => html` <div class=\"d-flex gap-3 flex-wrap\"> <it-modal size=\"sm\" close-label=\"Chiudi finestra modale\"> <it-button slot=\"trigger\" variant=\"primary\">Modale piccola</it-button> <span slot=\"header\">Modale piccola</span> <p slot=\"content\"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla lobortis felis tortor, ultrices congue orci ultricies sed. In hac habitasse platea dictumst. Ut placerat ligula sed tincidunt dictum. Pellentesque dapibus nisl vel varius dignissim. Aliquam leo ligula, dapibus vitae porttitor sed, laoreet in massa. Aliquam interdum sollicitudin libero, consectetur lacinia enim aliquet pretium. Vestibulum sit amet ornare velit, ac efficitur nisi. In leo mauris, ultrices in turpis sit amet, tempus placerat neque. Cras in dolor sit amet ante pharetra commodo. Aliquam cursus euismod velit, ut condimentum ipsum imperdiet ac.. </p> <it-button slot=\"footer\" variant=\"primary\" @click=\"${closeModal}\">Chiudi</it-button> </it-modal> <it-modal size=\"lg\" close-label=\"Chiudi finestra modale\"> <it-button slot=\"trigger\" variant=\"primary\">Modale grande</it-button> <span slot=\"header\">Modale grande</span> <p slot=\"content\"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla lobortis felis tortor, ultrices congue orci ultricies sed. In hac habitasse platea dictumst. Ut placerat ligula sed tincidunt dictum. Pellentesque dapibus nisl vel varius dignissim. Aliquam leo ligula, dapibus vitae porttitor sed, laoreet in massa. Aliquam interdum sollicitudin libero, consectetur lacinia enim aliquet pretium. Vestibulum sit amet ornare velit, ac efficitur nisi. In leo mauris, ultrices in turpis sit amet, tempus placerat neque. Cras in dolor sit amet ante pharetra commodo. Aliquam cursus euismod velit, ut condimentum ipsum imperdiet ac. </p> <it-button slot=\"footer\" variant=\"primary\" @click=\"${closeModal}\">Chiudi</it-button> </it-modal> <it-modal size=\"xl\" close-label=\"Chiudi finestra modale\"> <it-button slot=\"trigger\" variant=\"primary\">Modale molto grande</it-button> <span slot=\"header\">Modale molto grande</span> <p slot=\"content\"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla lobortis felis tortor, ultrices congue orci ultricies sed. In hac habitasse platea dictumst. Ut placerat ligula sed tincidunt dictum. Pellentesque dapibus nisl vel varius dignissim. Aliquam leo ligula, dapibus vitae porttitor sed, laoreet in massa. Aliquam interdum sollicitudin libero, consectetur lacinia enim aliquet pretium. Vestibulum sit amet ornare velit, ac efficitur nisi. In leo mauris, ultrices in turpis sit amet, tempus placerat neque. Cras in dolor sit amet ante pharetra commodo. Aliquam cursus euismod velit, ut condimentum ipsum imperdiet ac. </p> <it-button slot=\"footer\" variant=\"primary\" @click=\"${closeModal}\">Chiudi</it-button> </it-modal> </div> `, }"
|
|
862
|
+
},
|
|
863
|
+
{
|
|
864
|
+
"kind": "variable",
|
|
865
|
+
"name": "BackdropStatico",
|
|
866
|
+
"type": {
|
|
867
|
+
"text": "Story"
|
|
868
|
+
},
|
|
869
|
+
"default": "{ name: 'Backdrop statico', render: () => html` <it-modal static-backdrop close-label=\"Chiudi finestra modale\"> <it-button slot=\"trigger\" variant=\"primary\">Apri modale con backdrop statico</it-button> <span slot=\"header\">Modale con backdrop statico</span> <p slot=\"content\">Questa modale non si chiude cliccando sullo sfondo.</p> <it-button slot=\"footer\" variant=\"outline-primary\" @click=\"${closeModal}\">Annulla</it-button> <it-button slot=\"footer\" variant=\"primary\" @click=\"${closeModal}\">Conferma</it-button> </it-modal> `, }"
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
"kind": "variable",
|
|
873
|
+
"name": "SenzaAnimazione",
|
|
874
|
+
"type": {
|
|
875
|
+
"text": "Story"
|
|
876
|
+
},
|
|
877
|
+
"default": "{ name: 'Rimuovere l’animazione', render: () => html` <it-modal disable-animation close-label=\"Chiudi finestra modale\"> <it-button slot=\"trigger\" variant=\"primary\">Apri modale senza animazione</it-button> <span slot=\"header\">Modale senza animazione</span> <p slot=\"content\">Questa modale appare immediatamente senza animazione di dissolvenza.</p> <it-button slot=\"footer\" variant=\"outline-primary\" @click=\"${closeModal}\">Annulla</it-button> <it-button slot=\"footer\" variant=\"primary\" @click=\"${closeModal}\">Conferma</it-button> </it-modal> `, }"
|
|
878
|
+
},
|
|
879
|
+
{
|
|
880
|
+
"kind": "variable",
|
|
881
|
+
"name": "AttivazioneViaJS",
|
|
882
|
+
"type": {
|
|
883
|
+
"text": "Story"
|
|
884
|
+
},
|
|
885
|
+
"default": "{ name: 'Attivazione manuale via JS', decorators: [ (story) => html` <div style=\"display:flex; height:100%; align-items:center; gap:2rem;\">${story()}</div> `, ], parameters: { docs: { source: { excludeDecorators: true, code: ` <it-modal disable-animation close-label=\"Chiudi finestra modale\"> <it-button slot=\"trigger\" variant=\"primary\">Modale con apertura manuale (show)</it-button> <span slot=\"header\">Modale con apertura manuale</span> <p slot=\"content\">Questa modale appare immediatamente senza animazione di dissolvenza.</p> <it-button slot=\"footer\" variant=\"outline-primary\">Annulla</it-button> <it-button slot=\"footer\" variant=\"primary\">Conferma</it-button> </it-modal> <it-modal disable-animation close-label=\"Chiudi finestra modale\"> <it-button slot=\"trigger\" variant=\"primary\">Modale con apertura manuale (toggle)</it-button > <span slot=\"header\">Modale con toggle manuale</span> <p slot=\"content\">Questa modale appare immediatamente senza animazione di dissolvenza.</p> <it-button slot=\"footer\" variant=\"outline-primary\">Annulla</it-button> <it-button slot=\"footer\" variant=\"primary\">Conferma</it-button> </it-modal> <script> // Script di esempio per mostrare come attivare la modale via JS utilizzando i metodi show(), hide() e toggle() const modals = document.querySelectorAll('it-modal'); const [modalShow, modalToggle] = modals; const openModal = (event) => { const el = event.currentTarget; const modal = el.closest('it-modal'); console.log('openModal -> modal', modal); modal?.show(); }; const closeModal = (event) => { const el = event.currentTarget; const modal = el.closest('it-modal'); console.log('closeModal -> modal', modal); modal?.hide(); }; const toggleModal = (event) => { const el = event.currentTarget; const modal = el.closest('it-modal'); console.log('toggleModal -> modal', modal); modal?.toggle(); }; // Assegna gli event listener ai bottoni di trigger e footer modalShow.querySelector('[slot=\"trigger\"]').addEventListener('click', openModal); modalShow.querySelectorAll('[slot=\"footer\"] it-button').forEach((btn) => btn.addEventListener('click', closeModal)); modalToggle.querySelector('[slot=\"trigger\"]').addEventListener('click', toggleModal); modalToggle.querySelectorAll('[slot=\"footer\"] it-button').forEach((btn) => btn.addEventListener('click', toggleModal)); </script> `, }, }, }, render: () => html` <it-modal disable-animation close-label=\"Chiudi finestra modale\"> <it-button slot=\"trigger\" variant=\"primary\" @click=\"${openModal}\">Modale con apertura manuale (show)</it-button> <span slot=\"header\">Modale con apertura manuale</span> <p slot=\"content\">Questa modale appare immediatamente senza animazione di dissolvenza.</p> <it-button slot=\"footer\" variant=\"outline-primary\" @click=\"${closeModal}\">Annulla</it-button> <it-button slot=\"footer\" variant=\"primary\" @click=\"${closeModal}\">Conferma</it-button> </it-modal> <it-modal disable-animation close-label=\"Chiudi finestra modale\"> <it-button slot=\"trigger\" variant=\"primary\" @click=\"${toggleModal}\" >Modale con apertura manuale (toggle)</it-button > <span slot=\"header\">Modale con toggle manuale</span> <p slot=\"content\">Questa modale appare immediatamente senza animazione di dissolvenza.</p> <it-button slot=\"footer\" variant=\"outline-primary\" @click=\"${toggleModal}\">Annulla</it-button> <it-button slot=\"footer\" variant=\"primary\" @click=\"${toggleModal}\">Conferma</it-button> </it-modal> `, }"
|
|
886
|
+
}
|
|
887
|
+
],
|
|
888
|
+
"exports": [
|
|
889
|
+
{
|
|
890
|
+
"kind": "js",
|
|
891
|
+
"name": "default",
|
|
892
|
+
"declaration": {
|
|
893
|
+
"name": "meta",
|
|
894
|
+
"module": "stories/it-modal.stories.ts"
|
|
895
|
+
}
|
|
896
|
+
},
|
|
897
|
+
{
|
|
898
|
+
"kind": "js",
|
|
899
|
+
"name": "EsempioInterattivo",
|
|
900
|
+
"declaration": {
|
|
901
|
+
"name": "EsempioInterattivo",
|
|
902
|
+
"module": "stories/it-modal.stories.ts"
|
|
903
|
+
}
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
"kind": "js",
|
|
907
|
+
"name": "ModaleBase",
|
|
908
|
+
"declaration": {
|
|
909
|
+
"name": "ModaleBase",
|
|
910
|
+
"module": "stories/it-modal.stories.ts"
|
|
911
|
+
}
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
"kind": "js",
|
|
915
|
+
"name": "ConIcona",
|
|
916
|
+
"declaration": {
|
|
917
|
+
"name": "ConIcona",
|
|
918
|
+
"module": "stories/it-modal.stories.ts"
|
|
919
|
+
}
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
"kind": "js",
|
|
923
|
+
"name": "FooterCustom",
|
|
924
|
+
"declaration": {
|
|
925
|
+
"name": "FooterCustom",
|
|
926
|
+
"module": "stories/it-modal.stories.ts"
|
|
927
|
+
}
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
"kind": "js",
|
|
931
|
+
"name": "ConForm",
|
|
932
|
+
"declaration": {
|
|
933
|
+
"name": "ConForm",
|
|
934
|
+
"module": "stories/it-modal.stories.ts"
|
|
935
|
+
}
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
"kind": "js",
|
|
939
|
+
"name": "ConLinkList",
|
|
940
|
+
"declaration": {
|
|
941
|
+
"name": "ConLinkList",
|
|
942
|
+
"module": "stories/it-modal.stories.ts"
|
|
943
|
+
}
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
"kind": "js",
|
|
947
|
+
"name": "Popconfirm",
|
|
948
|
+
"declaration": {
|
|
949
|
+
"name": "Popconfirm",
|
|
950
|
+
"module": "stories/it-modal.stories.ts"
|
|
951
|
+
}
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
"kind": "js",
|
|
955
|
+
"name": "ScrollLungo",
|
|
956
|
+
"declaration": {
|
|
957
|
+
"name": "ScrollLungo",
|
|
958
|
+
"module": "stories/it-modal.stories.ts"
|
|
959
|
+
}
|
|
960
|
+
},
|
|
961
|
+
{
|
|
962
|
+
"kind": "js",
|
|
963
|
+
"name": "ScrollInterno",
|
|
964
|
+
"declaration": {
|
|
965
|
+
"name": "ScrollInterno",
|
|
966
|
+
"module": "stories/it-modal.stories.ts"
|
|
967
|
+
}
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
"kind": "js",
|
|
971
|
+
"name": "CentraturaVerticale",
|
|
972
|
+
"declaration": {
|
|
973
|
+
"name": "CentraturaVerticale",
|
|
974
|
+
"module": "stories/it-modal.stories.ts"
|
|
975
|
+
}
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
"kind": "js",
|
|
979
|
+
"name": "AllineamentoSinistra",
|
|
980
|
+
"declaration": {
|
|
981
|
+
"name": "AllineamentoSinistra",
|
|
982
|
+
"module": "stories/it-modal.stories.ts"
|
|
983
|
+
}
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
"kind": "js",
|
|
987
|
+
"name": "AllineamentoDestra",
|
|
988
|
+
"declaration": {
|
|
989
|
+
"name": "AllineamentoDestra",
|
|
990
|
+
"module": "stories/it-modal.stories.ts"
|
|
991
|
+
}
|
|
992
|
+
},
|
|
993
|
+
{
|
|
994
|
+
"kind": "js",
|
|
995
|
+
"name": "DimensioniOpzionali",
|
|
996
|
+
"declaration": {
|
|
997
|
+
"name": "DimensioniOpzionali",
|
|
998
|
+
"module": "stories/it-modal.stories.ts"
|
|
999
|
+
}
|
|
1000
|
+
},
|
|
1001
|
+
{
|
|
1002
|
+
"kind": "js",
|
|
1003
|
+
"name": "BackdropStatico",
|
|
1004
|
+
"declaration": {
|
|
1005
|
+
"name": "BackdropStatico",
|
|
1006
|
+
"module": "stories/it-modal.stories.ts"
|
|
1007
|
+
}
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
"kind": "js",
|
|
1011
|
+
"name": "SenzaAnimazione",
|
|
1012
|
+
"declaration": {
|
|
1013
|
+
"name": "SenzaAnimazione",
|
|
1014
|
+
"module": "stories/it-modal.stories.ts"
|
|
1015
|
+
}
|
|
1016
|
+
},
|
|
1017
|
+
{
|
|
1018
|
+
"kind": "js",
|
|
1019
|
+
"name": "AttivazioneViaJS",
|
|
1020
|
+
"declaration": {
|
|
1021
|
+
"name": "AttivazioneViaJS",
|
|
1022
|
+
"module": "stories/it-modal.stories.ts"
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
]
|
|
1026
|
+
}
|
|
1027
|
+
]
|
|
1028
|
+
}
|