@italia/transfer 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 +2 -0
- package/LICENSE +11 -0
- package/custom-elements.json +799 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +9 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/it-transfer-item.d.ts +21 -0
- package/dist/src/it-transfer-item.d.ts.map +1 -0
- package/dist/src/it-transfer-item.js +39 -0
- package/dist/src/it-transfer-item.js.map +1 -0
- package/dist/src/it-transfer.d.ts +59 -0
- package/dist/src/it-transfer.d.ts.map +1 -0
- package/dist/src/it-transfer.js +4099 -0
- package/dist/src/it-transfer.js.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 +17 -0
- package/dist/src/types.d.ts.map +1 -0
- package/package.json +75 -0
- package/styles/globals.scss +9 -0
|
@@ -0,0 +1,799 @@
|
|
|
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": "ItTransfer",
|
|
13
|
+
"declaration": {
|
|
14
|
+
"name": "ItTransfer",
|
|
15
|
+
"module": "./it-transfer.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"kind": "js",
|
|
20
|
+
"name": "ItTransferItem",
|
|
21
|
+
"declaration": {
|
|
22
|
+
"name": "ItTransferItem",
|
|
23
|
+
"module": "./it-transfer-item.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"kind": "js",
|
|
28
|
+
"name": "TransferItemData",
|
|
29
|
+
"declaration": {
|
|
30
|
+
"name": "TransferItemData",
|
|
31
|
+
"module": "./types.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"kind": "js",
|
|
36
|
+
"name": "TransferAction",
|
|
37
|
+
"declaration": {
|
|
38
|
+
"name": "TransferAction",
|
|
39
|
+
"module": "./types.js"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"kind": "js",
|
|
44
|
+
"name": "TransferEventDetail",
|
|
45
|
+
"declaration": {
|
|
46
|
+
"name": "TransferEventDetail",
|
|
47
|
+
"module": "./types.js"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"kind": "javascript-module",
|
|
54
|
+
"path": "src/it-transfer-item.ts",
|
|
55
|
+
"declarations": [
|
|
56
|
+
{
|
|
57
|
+
"kind": "class",
|
|
58
|
+
"description": "A single transferable item. Place as a direct child of `<it-transfer>`.\nThe element's text content is used as the item label.",
|
|
59
|
+
"name": "ItTransferItem",
|
|
60
|
+
"slots": [
|
|
61
|
+
{
|
|
62
|
+
"description": "The label text for this item.",
|
|
63
|
+
"name": ""
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"members": [
|
|
67
|
+
{
|
|
68
|
+
"kind": "field",
|
|
69
|
+
"name": "value",
|
|
70
|
+
"type": {
|
|
71
|
+
"text": "string"
|
|
72
|
+
},
|
|
73
|
+
"default": "''",
|
|
74
|
+
"description": "The value submitted as part of the transfer's form value when in the target list.",
|
|
75
|
+
"attribute": "value",
|
|
76
|
+
"reflects": true
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"kind": "field",
|
|
80
|
+
"name": "disabled",
|
|
81
|
+
"type": {
|
|
82
|
+
"text": "boolean"
|
|
83
|
+
},
|
|
84
|
+
"default": "false",
|
|
85
|
+
"description": "If set, the item cannot be transferred.",
|
|
86
|
+
"attribute": "disabled",
|
|
87
|
+
"reflects": true
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"kind": "field",
|
|
91
|
+
"name": "target",
|
|
92
|
+
"type": {
|
|
93
|
+
"text": "boolean"
|
|
94
|
+
},
|
|
95
|
+
"default": "false",
|
|
96
|
+
"description": "If set, the item starts in the target (right) list on initialisation.",
|
|
97
|
+
"attribute": "target",
|
|
98
|
+
"reflects": true
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"attributes": [
|
|
102
|
+
{
|
|
103
|
+
"name": "value",
|
|
104
|
+
"type": {
|
|
105
|
+
"text": "string"
|
|
106
|
+
},
|
|
107
|
+
"default": "''",
|
|
108
|
+
"description": "The value submitted as part of the transfer's form value when in the target list.",
|
|
109
|
+
"fieldName": "value"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "disabled",
|
|
113
|
+
"type": {
|
|
114
|
+
"text": "boolean"
|
|
115
|
+
},
|
|
116
|
+
"default": "false",
|
|
117
|
+
"description": "If set, the item cannot be transferred.",
|
|
118
|
+
"fieldName": "disabled"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"name": "target",
|
|
122
|
+
"type": {
|
|
123
|
+
"text": "boolean"
|
|
124
|
+
},
|
|
125
|
+
"default": "false",
|
|
126
|
+
"description": "If set, the item starts in the target (right) list on initialisation.",
|
|
127
|
+
"fieldName": "target"
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"superclass": {
|
|
131
|
+
"name": "LitElement",
|
|
132
|
+
"package": "lit"
|
|
133
|
+
},
|
|
134
|
+
"tagName": "it-transfer-item",
|
|
135
|
+
"customElement": true
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"exports": [
|
|
139
|
+
{
|
|
140
|
+
"kind": "js",
|
|
141
|
+
"name": "ItTransferItem",
|
|
142
|
+
"declaration": {
|
|
143
|
+
"name": "ItTransferItem",
|
|
144
|
+
"module": "src/it-transfer-item.ts"
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"kind": "custom-element-definition",
|
|
149
|
+
"name": "it-transfer-item",
|
|
150
|
+
"declaration": {
|
|
151
|
+
"name": "ItTransferItem",
|
|
152
|
+
"module": "src/it-transfer-item.ts"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"kind": "javascript-module",
|
|
159
|
+
"path": "src/it-transfer.ts",
|
|
160
|
+
"declarations": [
|
|
161
|
+
{
|
|
162
|
+
"kind": "class",
|
|
163
|
+
"description": "A dual-list transfer component that allows moving items between a source and a target list.\nIntegrates with native `<form>` elements via the FormControl API.",
|
|
164
|
+
"name": "ItTransfer",
|
|
165
|
+
"slots": [
|
|
166
|
+
{
|
|
167
|
+
"description": "One or more `<it-transfer-item>` elements.",
|
|
168
|
+
"name": ""
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
"members": [
|
|
172
|
+
{
|
|
173
|
+
"kind": "field",
|
|
174
|
+
"name": "formControlController",
|
|
175
|
+
"type": {
|
|
176
|
+
"text": "FormControlController"
|
|
177
|
+
},
|
|
178
|
+
"privacy": "protected",
|
|
179
|
+
"readonly": true,
|
|
180
|
+
"default": "new FormControlController(this, { value: (control) => (control as ItTransfer).value, name: (control) => (control as ItTransfer).name, checkValidity: (control) => (control as ItTransfer).checkValidity(), reportValidity: (control) => (control as ItTransfer).reportValidity(), setValue: (control, val) => { const t = control as ItTransfer; t._setFromFormValue(val as string); }, assumeInteractionOn: ['it-change'], })"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"kind": "field",
|
|
184
|
+
"name": "sourceLabel",
|
|
185
|
+
"type": {
|
|
186
|
+
"text": "string | undefined"
|
|
187
|
+
},
|
|
188
|
+
"description": "Override i18n label for the source (left) list header.",
|
|
189
|
+
"attribute": "source-label"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"kind": "field",
|
|
193
|
+
"name": "targetLabel",
|
|
194
|
+
"type": {
|
|
195
|
+
"text": "string | undefined"
|
|
196
|
+
},
|
|
197
|
+
"description": "Override i18n label for the target (right) list header.",
|
|
198
|
+
"attribute": "target-label"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"kind": "field",
|
|
202
|
+
"name": "transferLabel",
|
|
203
|
+
"type": {
|
|
204
|
+
"text": "string | undefined"
|
|
205
|
+
},
|
|
206
|
+
"description": "Override i18n aria-label for the transfer (→) button.",
|
|
207
|
+
"attribute": "transfer-label"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"kind": "field",
|
|
211
|
+
"name": "backtransferLabel",
|
|
212
|
+
"type": {
|
|
213
|
+
"text": "string | undefined"
|
|
214
|
+
},
|
|
215
|
+
"description": "Override i18n aria-label for the back-transfer (←) button.",
|
|
216
|
+
"attribute": "backtransfer-label"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"kind": "field",
|
|
220
|
+
"name": "resetLabel",
|
|
221
|
+
"type": {
|
|
222
|
+
"text": "string | undefined"
|
|
223
|
+
},
|
|
224
|
+
"description": "Override i18n aria-label for the reset (↺) button.",
|
|
225
|
+
"attribute": "reset-label"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"kind": "field",
|
|
229
|
+
"name": "_slottedItems",
|
|
230
|
+
"type": {
|
|
231
|
+
"text": "ItTransferItem[]"
|
|
232
|
+
},
|
|
233
|
+
"privacy": "private"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"kind": "field",
|
|
237
|
+
"name": "_sourceItems",
|
|
238
|
+
"type": {
|
|
239
|
+
"text": "TransferItemData[]"
|
|
240
|
+
},
|
|
241
|
+
"privacy": "private",
|
|
242
|
+
"default": "[]"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"kind": "field",
|
|
246
|
+
"name": "_targetItems",
|
|
247
|
+
"type": {
|
|
248
|
+
"text": "TransferItemData[]"
|
|
249
|
+
},
|
|
250
|
+
"privacy": "private",
|
|
251
|
+
"default": "[]"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"kind": "field",
|
|
255
|
+
"name": "_sourceChecked",
|
|
256
|
+
"type": {
|
|
257
|
+
"text": "Set<string>"
|
|
258
|
+
},
|
|
259
|
+
"privacy": "private",
|
|
260
|
+
"default": "new Set()"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"kind": "field",
|
|
264
|
+
"name": "_targetChecked",
|
|
265
|
+
"type": {
|
|
266
|
+
"text": "Set<string>"
|
|
267
|
+
},
|
|
268
|
+
"privacy": "private",
|
|
269
|
+
"default": "new Set()"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"kind": "field",
|
|
273
|
+
"name": "_initialSource",
|
|
274
|
+
"type": {
|
|
275
|
+
"text": "TransferItemData[]"
|
|
276
|
+
},
|
|
277
|
+
"privacy": "private",
|
|
278
|
+
"default": "[]",
|
|
279
|
+
"description": "Snapshot of the initial state for reset(). Set once on first slotchange."
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"kind": "field",
|
|
283
|
+
"name": "_initialTarget",
|
|
284
|
+
"type": {
|
|
285
|
+
"text": "TransferItemData[]"
|
|
286
|
+
},
|
|
287
|
+
"privacy": "private",
|
|
288
|
+
"default": "[]"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"kind": "field",
|
|
292
|
+
"name": "validity",
|
|
293
|
+
"type": {
|
|
294
|
+
"text": "ValidityState"
|
|
295
|
+
},
|
|
296
|
+
"readonly": true
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"kind": "method",
|
|
300
|
+
"name": "checkValidity",
|
|
301
|
+
"return": {
|
|
302
|
+
"type": {
|
|
303
|
+
"text": "boolean"
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"kind": "method",
|
|
309
|
+
"name": "reportValidity",
|
|
310
|
+
"return": {
|
|
311
|
+
"type": {
|
|
312
|
+
"text": "boolean"
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"kind": "method",
|
|
318
|
+
"name": "handleValidationMessages",
|
|
319
|
+
"privacy": "protected"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"kind": "method",
|
|
323
|
+
"name": "_setFromFormValue",
|
|
324
|
+
"privacy": "private",
|
|
325
|
+
"parameters": [
|
|
326
|
+
{
|
|
327
|
+
"name": "val",
|
|
328
|
+
"type": {
|
|
329
|
+
"text": "string"
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
]
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"kind": "method",
|
|
336
|
+
"name": "_syncValue",
|
|
337
|
+
"privacy": "private"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"kind": "method",
|
|
341
|
+
"name": "_handleSlotChange",
|
|
342
|
+
"privacy": "private"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"kind": "method",
|
|
346
|
+
"name": "_dispatch",
|
|
347
|
+
"privacy": "private",
|
|
348
|
+
"return": {
|
|
349
|
+
"type": {
|
|
350
|
+
"text": "boolean"
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
"parameters": [
|
|
354
|
+
{
|
|
355
|
+
"name": "action",
|
|
356
|
+
"type": {
|
|
357
|
+
"text": "TransferAction"
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
"name": "items",
|
|
362
|
+
"type": {
|
|
363
|
+
"text": "string[]"
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"name": "nextSource",
|
|
368
|
+
"type": {
|
|
369
|
+
"text": "TransferItemData[]"
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
"name": "nextTarget",
|
|
374
|
+
"type": {
|
|
375
|
+
"text": "TransferItemData[]"
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
]
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"kind": "method",
|
|
382
|
+
"name": "transfer",
|
|
383
|
+
"description": "Move checked source items to the target list."
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"kind": "method",
|
|
387
|
+
"name": "backtransfer",
|
|
388
|
+
"description": "Move checked target items back to the source list."
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"kind": "method",
|
|
392
|
+
"name": "reset",
|
|
393
|
+
"description": "Reset both lists to their initial state."
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"kind": "method",
|
|
397
|
+
"name": "_toggleItem",
|
|
398
|
+
"privacy": "private",
|
|
399
|
+
"parameters": [
|
|
400
|
+
{
|
|
401
|
+
"name": "side",
|
|
402
|
+
"type": {
|
|
403
|
+
"text": "'source' | 'target'"
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"name": "value",
|
|
408
|
+
"type": {
|
|
409
|
+
"text": "string"
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
"name": "checked",
|
|
414
|
+
"type": {
|
|
415
|
+
"text": "boolean"
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
]
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
"kind": "method",
|
|
422
|
+
"name": "_toggleAll",
|
|
423
|
+
"privacy": "private",
|
|
424
|
+
"parameters": [
|
|
425
|
+
{
|
|
426
|
+
"name": "side",
|
|
427
|
+
"type": {
|
|
428
|
+
"text": "'source' | 'target'"
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
"name": "selectAll",
|
|
433
|
+
"type": {
|
|
434
|
+
"text": "boolean"
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
]
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"kind": "method",
|
|
441
|
+
"name": "_getHeaderState",
|
|
442
|
+
"privacy": "private",
|
|
443
|
+
"parameters": [
|
|
444
|
+
{
|
|
445
|
+
"name": "items",
|
|
446
|
+
"type": {
|
|
447
|
+
"text": "TransferItemData[]"
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
"name": "checked",
|
|
452
|
+
"type": {
|
|
453
|
+
"text": "Set<string>"
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
]
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
"kind": "method",
|
|
460
|
+
"name": "_renderList",
|
|
461
|
+
"privacy": "private",
|
|
462
|
+
"parameters": [
|
|
463
|
+
{
|
|
464
|
+
"name": "side",
|
|
465
|
+
"type": {
|
|
466
|
+
"text": "'source' | 'target'"
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"name": "items",
|
|
471
|
+
"type": {
|
|
472
|
+
"text": "TransferItemData[]"
|
|
473
|
+
}
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
"name": "checked",
|
|
477
|
+
"type": {
|
|
478
|
+
"text": "Set<string>"
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"name": "listId",
|
|
483
|
+
"type": {
|
|
484
|
+
"text": "string"
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
]
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"kind": "method",
|
|
491
|
+
"name": "_renderButtons",
|
|
492
|
+
"privacy": "private"
|
|
493
|
+
}
|
|
494
|
+
],
|
|
495
|
+
"events": [
|
|
496
|
+
{
|
|
497
|
+
"name": "it-change",
|
|
498
|
+
"type": {
|
|
499
|
+
"text": "CustomEvent<{value: string, el: HTMLElement}>"
|
|
500
|
+
},
|
|
501
|
+
"description": "Fired after the target list changes."
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
"type": {
|
|
505
|
+
"text": "CustomEvent<TransferEventDetail>"
|
|
506
|
+
},
|
|
507
|
+
"description": "Fired (cancelable) before items are transferred/reset. Prevent default to cancel.",
|
|
508
|
+
"name": "it-transfer"
|
|
509
|
+
}
|
|
510
|
+
],
|
|
511
|
+
"attributes": [
|
|
512
|
+
{
|
|
513
|
+
"name": "source-label",
|
|
514
|
+
"type": {
|
|
515
|
+
"text": "string | undefined"
|
|
516
|
+
},
|
|
517
|
+
"description": "Override i18n label for the source (left) list header.",
|
|
518
|
+
"fieldName": "sourceLabel"
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
"name": "target-label",
|
|
522
|
+
"type": {
|
|
523
|
+
"text": "string | undefined"
|
|
524
|
+
},
|
|
525
|
+
"description": "Override i18n label for the target (right) list header.",
|
|
526
|
+
"fieldName": "targetLabel"
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
"name": "transfer-label",
|
|
530
|
+
"type": {
|
|
531
|
+
"text": "string | undefined"
|
|
532
|
+
},
|
|
533
|
+
"description": "Override i18n aria-label for the transfer (→) button.",
|
|
534
|
+
"fieldName": "transferLabel"
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
"name": "backtransfer-label",
|
|
538
|
+
"type": {
|
|
539
|
+
"text": "string | undefined"
|
|
540
|
+
},
|
|
541
|
+
"description": "Override i18n aria-label for the back-transfer (←) button.",
|
|
542
|
+
"fieldName": "backtransferLabel"
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"name": "reset-label",
|
|
546
|
+
"type": {
|
|
547
|
+
"text": "string | undefined"
|
|
548
|
+
},
|
|
549
|
+
"description": "Override i18n aria-label for the reset (↺) button.",
|
|
550
|
+
"fieldName": "resetLabel"
|
|
551
|
+
}
|
|
552
|
+
],
|
|
553
|
+
"superclass": {
|
|
554
|
+
"name": "FormControl",
|
|
555
|
+
"package": "@italia/globals"
|
|
556
|
+
},
|
|
557
|
+
"tagName": "it-transfer",
|
|
558
|
+
"customElement": true
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
"kind": "variable",
|
|
562
|
+
"name": "items"
|
|
563
|
+
}
|
|
564
|
+
],
|
|
565
|
+
"exports": [
|
|
566
|
+
{
|
|
567
|
+
"kind": "js",
|
|
568
|
+
"name": "ItTransfer",
|
|
569
|
+
"declaration": {
|
|
570
|
+
"name": "ItTransfer",
|
|
571
|
+
"module": "src/it-transfer.ts"
|
|
572
|
+
}
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
"kind": "custom-element-definition",
|
|
576
|
+
"name": "it-transfer",
|
|
577
|
+
"declaration": {
|
|
578
|
+
"name": "ItTransfer",
|
|
579
|
+
"module": "src/it-transfer.ts"
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
]
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
"kind": "javascript-module",
|
|
586
|
+
"path": "src/types.ts",
|
|
587
|
+
"declarations": [],
|
|
588
|
+
"exports": []
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
"kind": "javascript-module",
|
|
592
|
+
"path": "stories/it-transfer.stories.ts",
|
|
593
|
+
"declarations": [
|
|
594
|
+
{
|
|
595
|
+
"kind": "variable",
|
|
596
|
+
"name": "meta",
|
|
597
|
+
"type": {
|
|
598
|
+
"text": "Meta<TransferProps>"
|
|
599
|
+
},
|
|
600
|
+
"default": "{ title: 'Componenti/Form/Transfer', tags: ['a11y-ok', 'web-component', 'alpha'], component: 'it-transfer', args: { name: 'transfer-items', sourceLabel: '', targetLabel: '', disabled: false, required: false, customValidation: false, validityMessage: '', }, argTypes: { name: { control: 'text', description: 'Il nome del campo nel form, usato nella sottomissione.', }, sourceLabel: { control: 'text', description: 'Etichetta descrittiva per la lista sorgente (sinistra). Sovrascrive il default i18n.', name: 'source-label', table: { defaultValue: { summary: 'Sorgente' } }, }, targetLabel: { control: 'text', description: 'Etichetta descrittiva per la lista destinazione (destra). Sovrascrive il default i18n.', name: 'target-label', table: { defaultValue: { summary: 'Destinazione' } }, }, disabled: { control: 'boolean', description: 'Disabilita il componente.', table: { defaultValue: { summary: 'false' } }, }, required: { control: 'boolean', description: 'Rende il campo obbligatorio: la lista destinazione non può essere vuota alla sottomissione del form.', table: { defaultValue: { summary: 'false' } }, }, customValidation: { control: 'boolean', description: 'Disabilita la validazione nativa e usa `validity-message` per mostrare un errore personalizzato.', name: 'custom-validation', table: { defaultValue: { summary: 'false' } }, }, validityMessage: { control: 'text', description: 'Messaggio di errore personalizzato (richiede `custom-validation`).', name: 'validity-message', table: { defaultValue: { summary: '' } }, }, }, parameters: { layout: 'padded', pageLayout: 'w-100', docs: { canvas: { sourceState: 'shown' }, }, }, }"
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
"kind": "variable",
|
|
604
|
+
"name": "EsempioInterattivo",
|
|
605
|
+
"type": {
|
|
606
|
+
"text": "Story"
|
|
607
|
+
},
|
|
608
|
+
"default": "{ name: 'Esempio interattivo', tags: ['!dev'], render: (args) => renderTransfer(args), }"
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
"kind": "variable",
|
|
612
|
+
"name": "ConValoriPreimpostati",
|
|
613
|
+
"type": {
|
|
614
|
+
"text": "Story"
|
|
615
|
+
},
|
|
616
|
+
"default": "{ name: 'Con valori preimpostati', render: () => html` <it-transfer name=\"preset\"> <it-transfer-item value=\"item7\">Voce 7</it-transfer-item> <it-transfer-item value=\"item8\">Voce 8</it-transfer-item> <it-transfer-item value=\"item9\">Voce 9</it-transfer-item> <it-transfer-item value=\"item10\" target>Voce 10</it-transfer-item> <it-transfer-item value=\"item11\" target>Voce 11</it-transfer-item> <it-transfer-item value=\"item12\" target>Voce 12</it-transfer-item> </it-transfer> `, }"
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
"kind": "variable",
|
|
620
|
+
"name": "EtichettePersonalizzate",
|
|
621
|
+
"type": {
|
|
622
|
+
"text": "Story"
|
|
623
|
+
},
|
|
624
|
+
"default": "{ name: 'Etichette personalizzate', render: () => html` <it-transfer name=\"custom-labels\" source-label=\"Comuni disponibili\" target-label=\"Comuni selezionati\"> <it-transfer-item value=\"rm\">Roma</it-transfer-item> <it-transfer-item value=\"mi\">Milano</it-transfer-item> <it-transfer-item value=\"na\">Napoli</it-transfer-item> <it-transfer-item value=\"to\">Torino</it-transfer-item> </it-transfer> `, }"
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
"kind": "variable",
|
|
628
|
+
"name": "Disabilitato",
|
|
629
|
+
"type": {
|
|
630
|
+
"text": "Story"
|
|
631
|
+
},
|
|
632
|
+
"default": "{ render: () => html` <it-transfer name=\"disabled-example\" disabled> <it-transfer-item value=\"a\">Voce A</it-transfer-item> <it-transfer-item value=\"b\">Voce B</it-transfer-item> <it-transfer-item value=\"c\" target>Voce C</it-transfer-item> </it-transfer> `, }"
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
"kind": "variable",
|
|
636
|
+
"name": "ValidazioneNativa",
|
|
637
|
+
"type": {
|
|
638
|
+
"text": "Story"
|
|
639
|
+
},
|
|
640
|
+
"default": "{ name: 'Validazione nativa', args: { required: true }, render: (params) => html` <form> ${renderTransfer({ ...params, name: 'required-transfer' })} <div class=\"mt-3\"> <it-button type=\"submit\" variant=\"primary\">Invia</it-button> <it-button type=\"reset\" variant=\"secondary\" class=\"ms-2\">Reimposta</it-button> </div> </form> `, }"
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
"kind": "variable",
|
|
644
|
+
"name": "ElementoDisabilitato",
|
|
645
|
+
"type": {
|
|
646
|
+
"text": "Story"
|
|
647
|
+
},
|
|
648
|
+
"default": "{ name: 'Elemento singolo disabilitato', render: () => html` <it-transfer name=\"disabled-item\"> <it-transfer-item value=\"a\">Voce A</it-transfer-item> <it-transfer-item value=\"b\" disabled>Voce B (non trasferibile)</it-transfer-item> <it-transfer-item value=\"c\">Voce C</it-transfer-item> </it-transfer> `, }"
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
"kind": "variable",
|
|
652
|
+
"name": "ValidazioneCustom",
|
|
653
|
+
"type": {
|
|
654
|
+
"text": "Story"
|
|
655
|
+
},
|
|
656
|
+
"default": "{ name: 'Validazione custom', args: { customValidation: true, validityMessage: 'Questo campo è obbligatorio!!!' }, render: (params) => renderTransfer({ ...params, name: 'custom-validation-transfer' }), }"
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
"kind": "variable",
|
|
660
|
+
"name": "GestioneEventi",
|
|
661
|
+
"type": {
|
|
662
|
+
"text": "Story"
|
|
663
|
+
},
|
|
664
|
+
"default": "{ name: 'Gestione degli eventi', parameters: { docs: { description: { story: `Il componente Transfer emette due eventi principali: - \\`it-transfer\\`: emesso **prima** di ogni azione (trasferimento, ritrasferimento, ripristino). Annullabile con \\`event.preventDefault()\\`. - \\`it-change\\`: emesso **dopo** ogni modifica delle liste. Per bloccare un trasferimento dal listener: \\`\\`\\`js document.querySelector('it-transfer').addEventListener('it-transfer', (e) => { if (e.detail.action === 'transfer' && shouldBlock) { e.preventDefault(); // annulla il trasferimento } }); \\`\\`\\` Per intercettare ogni modifica delle liste: \\`\\`\\`js document.querySelector('it-transfer').addEventListener('it-change', (e) => { console.log('Lista destinazione aggiornata:', e.detail.value); }); \\`\\`\\``, }, }, }, render: () => html` <script> document.querySelector('it-transfer#event-transfer-example').addEventListener('it-transfer', (e) => { if (e.detail.action === 'transfer') { e.preventDefault(); // eslint-disable-next-line no-alert alert('Trasferimento bloccato dal listener it-transfer!'); } }); document.querySelector('it-transfer#event-transfer-example').addEventListener('it-change', (e) => { console.log('Lista destinazione:', e.detail.value); }); </script> <it-transfer id=\"event-transfer-example\" name=\"event-example\"> <it-transfer-item value=\"a\">Voce A</it-transfer-item> <it-transfer-item value=\"b\">Voce B</it-transfer-item> <it-transfer-item value=\"c\">Voce C</it-transfer-item> </it-transfer> `, }"
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
"kind": "variable",
|
|
668
|
+
"name": "I18n",
|
|
669
|
+
"type": {
|
|
670
|
+
"text": "Story"
|
|
671
|
+
},
|
|
672
|
+
"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)} \\`\\`\\` `, }, }, }, }"
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
"kind": "variable",
|
|
676
|
+
"name": "MetodiEPropPubblici",
|
|
677
|
+
"type": {
|
|
678
|
+
"text": "Story"
|
|
679
|
+
},
|
|
680
|
+
"default": "{ ...StoryFormControlMethodAndProps({ componentName: 'it-transfer', otherProps: `|\\`value\\`| Array JSON dei valori degli elementi presenti nella lista destinazione. |`, otherEvents: `|\\`it-transfer\\`| Emesso prima di ogni azione (transfer, backtransfer, reset). Annullabile con \\`event.preventDefault()\\`. Detail: \\`{ action, items, source, target }\\`. |`, }), tags: ['!dev'], }"
|
|
681
|
+
}
|
|
682
|
+
],
|
|
683
|
+
"exports": [
|
|
684
|
+
{
|
|
685
|
+
"kind": "js",
|
|
686
|
+
"name": "default",
|
|
687
|
+
"declaration": {
|
|
688
|
+
"name": "meta",
|
|
689
|
+
"module": "stories/it-transfer.stories.ts"
|
|
690
|
+
}
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
"kind": "js",
|
|
694
|
+
"name": "EsempioInterattivo",
|
|
695
|
+
"declaration": {
|
|
696
|
+
"name": "EsempioInterattivo",
|
|
697
|
+
"module": "stories/it-transfer.stories.ts"
|
|
698
|
+
}
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
"kind": "js",
|
|
702
|
+
"name": "ConValoriPreimpostati",
|
|
703
|
+
"declaration": {
|
|
704
|
+
"name": "ConValoriPreimpostati",
|
|
705
|
+
"module": "stories/it-transfer.stories.ts"
|
|
706
|
+
}
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
"kind": "js",
|
|
710
|
+
"name": "EtichettePersonalizzate",
|
|
711
|
+
"declaration": {
|
|
712
|
+
"name": "EtichettePersonalizzate",
|
|
713
|
+
"module": "stories/it-transfer.stories.ts"
|
|
714
|
+
}
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
"kind": "js",
|
|
718
|
+
"name": "Disabilitato",
|
|
719
|
+
"declaration": {
|
|
720
|
+
"name": "Disabilitato",
|
|
721
|
+
"module": "stories/it-transfer.stories.ts"
|
|
722
|
+
}
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
"kind": "js",
|
|
726
|
+
"name": "ValidazioneNativa",
|
|
727
|
+
"declaration": {
|
|
728
|
+
"name": "ValidazioneNativa",
|
|
729
|
+
"module": "stories/it-transfer.stories.ts"
|
|
730
|
+
}
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
"kind": "js",
|
|
734
|
+
"name": "ElementoDisabilitato",
|
|
735
|
+
"declaration": {
|
|
736
|
+
"name": "ElementoDisabilitato",
|
|
737
|
+
"module": "stories/it-transfer.stories.ts"
|
|
738
|
+
}
|
|
739
|
+
},
|
|
740
|
+
{
|
|
741
|
+
"kind": "js",
|
|
742
|
+
"name": "ValidazioneCustom",
|
|
743
|
+
"declaration": {
|
|
744
|
+
"name": "ValidazioneCustom",
|
|
745
|
+
"module": "stories/it-transfer.stories.ts"
|
|
746
|
+
}
|
|
747
|
+
},
|
|
748
|
+
{
|
|
749
|
+
"kind": "js",
|
|
750
|
+
"name": "GestioneEventi",
|
|
751
|
+
"declaration": {
|
|
752
|
+
"name": "GestioneEventi",
|
|
753
|
+
"module": "stories/it-transfer.stories.ts"
|
|
754
|
+
}
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
"kind": "js",
|
|
758
|
+
"name": "I18n",
|
|
759
|
+
"declaration": {
|
|
760
|
+
"name": "I18n",
|
|
761
|
+
"module": "stories/it-transfer.stories.ts"
|
|
762
|
+
}
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
"kind": "js",
|
|
766
|
+
"name": "MetodiEPropPubblici",
|
|
767
|
+
"declaration": {
|
|
768
|
+
"name": "MetodiEPropPubblici",
|
|
769
|
+
"module": "stories/it-transfer.stories.ts"
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
]
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
"kind": "javascript-module",
|
|
776
|
+
"path": "src/locales/it.ts",
|
|
777
|
+
"declarations": [
|
|
778
|
+
{
|
|
779
|
+
"kind": "variable",
|
|
780
|
+
"name": "translation",
|
|
781
|
+
"type": {
|
|
782
|
+
"text": "DefaultTranslation"
|
|
783
|
+
},
|
|
784
|
+
"default": "{ $code: 'it', $name: 'Italiano', $dir: 'ltr', transferSourceLabel: 'Sorgente', transferTargetLabel: 'Destinazione', transferLabel: 'Trasferisci selezionati a destra', transferBackLabel: 'Trasferisci selezionati a sinistra', transferResetLabel: 'Ripristina stato iniziale', transferItemsCount: '{count} elementi', transferSelectAll: 'Seleziona tutto', }"
|
|
785
|
+
}
|
|
786
|
+
],
|
|
787
|
+
"exports": [
|
|
788
|
+
{
|
|
789
|
+
"kind": "js",
|
|
790
|
+
"name": "default",
|
|
791
|
+
"declaration": {
|
|
792
|
+
"name": "translation",
|
|
793
|
+
"module": "src/locales/it.ts"
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
]
|
|
797
|
+
}
|
|
798
|
+
]
|
|
799
|
+
}
|