@italia/globals 0.1.0-alpha.2 → 1.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +348 -8
- package/dist/src/base-component/base-component.d.ts +19 -7
- package/dist/src/base-component/base-component.d.ts.map +1 -1
- package/dist/src/controllers/focus-trap-controller.d.ts +72 -0
- package/dist/src/controllers/focus-trap-controller.d.ts.map +1 -0
- package/dist/src/controllers/focus-trap-controller.js +271 -0
- package/dist/src/controllers/focus-trap-controller.js.map +1 -0
- package/dist/src/form/form-control.d.ts +2 -1
- package/dist/src/form/form-control.d.ts.map +1 -1
- package/dist/src/form/form-control.js +15 -7
- package/dist/src/form/form-control.js.map +1 -1
- package/dist/src/form/form-controller.d.ts +2 -0
- package/dist/src/form/form-controller.d.ts.map +1 -1
- package/dist/src/form/form-controller.js +35 -1
- package/dist/src/form/form-controller.js.map +1 -1
- package/dist/src/form/locales/it.d.ts.map +1 -1
- package/dist/src/form/locales/it.js +1 -0
- package/dist/src/form/locales/it.js.map +1 -1
- package/dist/src/index.d.ts +8 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +8 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/mixins/validity.d.ts +18 -6
- package/dist/src/mixins/validity.d.ts.map +1 -1
- package/dist/src/stories/formControlReusableStories.d.ts.map +1 -1
- package/dist/src/stories/formControlReusableStories.js +5 -4
- package/dist/src/stories/formControlReusableStories.js.map +1 -1
- package/dist/src/window-manager.d.ts +13 -0
- package/dist/src/window-manager.d.ts.map +1 -1
- package/dist/src/window-manager.js +31 -0
- package/dist/src/window-manager.js.map +1 -1
- package/package.json +2 -2
package/custom-elements.json
CHANGED
|
@@ -111,6 +111,22 @@
|
|
|
111
111
|
"module": "./controllers/collapse-controller.js"
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
|
+
{
|
|
115
|
+
"kind": "js",
|
|
116
|
+
"name": "FocusTrapController",
|
|
117
|
+
"declaration": {
|
|
118
|
+
"name": "FocusTrapController",
|
|
119
|
+
"module": "./controllers/focus-trap-controller.js"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"kind": "js",
|
|
124
|
+
"name": "FocusTrapConfig",
|
|
125
|
+
"declaration": {
|
|
126
|
+
"name": "FocusTrapConfig",
|
|
127
|
+
"module": "./controllers/focus-trap-controller.js"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
114
130
|
{
|
|
115
131
|
"kind": "js",
|
|
116
132
|
"name": "FormControl",
|
|
@@ -251,6 +267,26 @@
|
|
|
251
267
|
"static": true,
|
|
252
268
|
"default": "false"
|
|
253
269
|
},
|
|
270
|
+
{
|
|
271
|
+
"kind": "field",
|
|
272
|
+
"name": "scrollLockCount",
|
|
273
|
+
"type": {
|
|
274
|
+
"text": "number"
|
|
275
|
+
},
|
|
276
|
+
"privacy": "private",
|
|
277
|
+
"static": true,
|
|
278
|
+
"default": "0"
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"kind": "field",
|
|
282
|
+
"name": "scrollbarWidth",
|
|
283
|
+
"type": {
|
|
284
|
+
"text": "number"
|
|
285
|
+
},
|
|
286
|
+
"privacy": "private",
|
|
287
|
+
"static": true,
|
|
288
|
+
"default": "0"
|
|
289
|
+
},
|
|
254
290
|
{
|
|
255
291
|
"kind": "method",
|
|
256
292
|
"name": "init",
|
|
@@ -307,6 +343,39 @@
|
|
|
307
343
|
}
|
|
308
344
|
}
|
|
309
345
|
]
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"kind": "method",
|
|
349
|
+
"name": "lockBodyScroll",
|
|
350
|
+
"static": true,
|
|
351
|
+
"return": {
|
|
352
|
+
"type": {
|
|
353
|
+
"text": "void"
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
"description": "Blocca lo scroll del body. Usa ref counting per gestire modal nested.\nChiamare unlockBodyScroll() per ogni lockBodyScroll()."
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"kind": "method",
|
|
360
|
+
"name": "unlockBodyScroll",
|
|
361
|
+
"static": true,
|
|
362
|
+
"return": {
|
|
363
|
+
"type": {
|
|
364
|
+
"text": "void"
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
"description": "Sblocca lo scroll del body. Rimuove il lock solo quando tutti i consumer hanno chiamato unlock."
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"kind": "method",
|
|
371
|
+
"name": "getScrollbarWidth",
|
|
372
|
+
"static": true,
|
|
373
|
+
"return": {
|
|
374
|
+
"type": {
|
|
375
|
+
"text": "number"
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
"description": "Ritorna la larghezza della scrollbar (utile per compensazioni)"
|
|
310
379
|
}
|
|
311
380
|
]
|
|
312
381
|
}
|
|
@@ -735,6 +804,247 @@
|
|
|
735
804
|
}
|
|
736
805
|
]
|
|
737
806
|
},
|
|
807
|
+
{
|
|
808
|
+
"kind": "javascript-module",
|
|
809
|
+
"path": "src/controllers/focus-trap-controller.ts",
|
|
810
|
+
"declarations": [
|
|
811
|
+
{
|
|
812
|
+
"kind": "class",
|
|
813
|
+
"description": "Controller per gestire il focus trap all'interno di un elemento.\nImplementa le linee guida WAI-ARIA per i dialog modali.\n\n\n```",
|
|
814
|
+
"name": "FocusTrapController",
|
|
815
|
+
"members": [
|
|
816
|
+
{
|
|
817
|
+
"kind": "field",
|
|
818
|
+
"name": "host",
|
|
819
|
+
"type": {
|
|
820
|
+
"text": "ReactiveControllerHost & HTMLElement"
|
|
821
|
+
},
|
|
822
|
+
"privacy": "private",
|
|
823
|
+
"default": "host"
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
"kind": "field",
|
|
827
|
+
"name": "config",
|
|
828
|
+
"type": {
|
|
829
|
+
"text": "FocusTrapConfig"
|
|
830
|
+
},
|
|
831
|
+
"privacy": "private",
|
|
832
|
+
"default": "config"
|
|
833
|
+
},
|
|
834
|
+
{
|
|
835
|
+
"kind": "field",
|
|
836
|
+
"name": "observer",
|
|
837
|
+
"type": {
|
|
838
|
+
"text": "MutationObserver | null"
|
|
839
|
+
},
|
|
840
|
+
"privacy": "private",
|
|
841
|
+
"default": "null"
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
"kind": "field",
|
|
845
|
+
"name": "_isActive",
|
|
846
|
+
"type": {
|
|
847
|
+
"text": "boolean"
|
|
848
|
+
},
|
|
849
|
+
"privacy": "private",
|
|
850
|
+
"default": "false"
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
"kind": "field",
|
|
854
|
+
"name": "_previousActiveElement",
|
|
855
|
+
"type": {
|
|
856
|
+
"text": "HTMLElement | null"
|
|
857
|
+
},
|
|
858
|
+
"privacy": "private",
|
|
859
|
+
"default": "null"
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
"kind": "field",
|
|
863
|
+
"name": "_focusableElements",
|
|
864
|
+
"type": {
|
|
865
|
+
"text": "any[]"
|
|
866
|
+
},
|
|
867
|
+
"privacy": "private",
|
|
868
|
+
"default": "[]"
|
|
869
|
+
},
|
|
870
|
+
{
|
|
871
|
+
"kind": "field",
|
|
872
|
+
"name": "_first",
|
|
873
|
+
"type": {
|
|
874
|
+
"text": "any"
|
|
875
|
+
},
|
|
876
|
+
"privacy": "private"
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
"kind": "field",
|
|
880
|
+
"name": "_last",
|
|
881
|
+
"type": {
|
|
882
|
+
"text": "any"
|
|
883
|
+
},
|
|
884
|
+
"privacy": "private"
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
"kind": "field",
|
|
888
|
+
"name": "FOCUSABLE_SELECTORS",
|
|
889
|
+
"privacy": "private",
|
|
890
|
+
"static": true,
|
|
891
|
+
"readonly": true
|
|
892
|
+
},
|
|
893
|
+
{
|
|
894
|
+
"kind": "method",
|
|
895
|
+
"name": "isFocusable",
|
|
896
|
+
"privacy": "private",
|
|
897
|
+
"static": true,
|
|
898
|
+
"return": {
|
|
899
|
+
"type": {
|
|
900
|
+
"text": "boolean"
|
|
901
|
+
}
|
|
902
|
+
},
|
|
903
|
+
"parameters": [
|
|
904
|
+
{
|
|
905
|
+
"name": "el",
|
|
906
|
+
"type": {
|
|
907
|
+
"text": "HTMLElement"
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
],
|
|
911
|
+
"description": "Verifica se un elemento è effettivamente focusabile e tabbabile.\nElementi con tabindex=\"-1\" sono focusabili programmaticamente ma non tabbabili."
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
"kind": "method",
|
|
915
|
+
"name": "hostConnected"
|
|
916
|
+
},
|
|
917
|
+
{
|
|
918
|
+
"kind": "method",
|
|
919
|
+
"name": "hostDisconnected"
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
"kind": "field",
|
|
923
|
+
"name": "isActive",
|
|
924
|
+
"type": {
|
|
925
|
+
"text": "boolean"
|
|
926
|
+
},
|
|
927
|
+
"description": "Indica se il focus trap è attivo",
|
|
928
|
+
"readonly": true
|
|
929
|
+
},
|
|
930
|
+
{
|
|
931
|
+
"kind": "method",
|
|
932
|
+
"name": "activate",
|
|
933
|
+
"return": {
|
|
934
|
+
"type": {
|
|
935
|
+
"text": "void"
|
|
936
|
+
}
|
|
937
|
+
},
|
|
938
|
+
"description": "Attiva il focus trap.\nSalva l'elemento attivo corrente e attiva i listener.\nNOTA: chiamare updateFocusableElements() e focusFirst() separatamente quando necessario."
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
"kind": "method",
|
|
942
|
+
"name": "deactivate",
|
|
943
|
+
"return": {
|
|
944
|
+
"type": {
|
|
945
|
+
"text": "void"
|
|
946
|
+
}
|
|
947
|
+
},
|
|
948
|
+
"description": "Disattiva il focus trap.\nRipristina il focus all'elemento precedentemente attivo."
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
"kind": "method",
|
|
952
|
+
"name": "updateFocusableElements",
|
|
953
|
+
"return": {
|
|
954
|
+
"type": {
|
|
955
|
+
"text": "void"
|
|
956
|
+
}
|
|
957
|
+
},
|
|
958
|
+
"description": "Aggiorna la lista degli elementi focusabili.\nChiamare dopo modifiche al DOM."
|
|
959
|
+
},
|
|
960
|
+
{
|
|
961
|
+
"kind": "method",
|
|
962
|
+
"name": "focusFirst",
|
|
963
|
+
"return": {
|
|
964
|
+
"type": {
|
|
965
|
+
"text": "void"
|
|
966
|
+
}
|
|
967
|
+
},
|
|
968
|
+
"description": "Sposta il focus sul primo elemento focusabile"
|
|
969
|
+
},
|
|
970
|
+
{
|
|
971
|
+
"kind": "method",
|
|
972
|
+
"name": "focusLast",
|
|
973
|
+
"return": {
|
|
974
|
+
"type": {
|
|
975
|
+
"text": "void"
|
|
976
|
+
}
|
|
977
|
+
},
|
|
978
|
+
"description": "Sposta il focus sull'ultimo elemento focusabile"
|
|
979
|
+
},
|
|
980
|
+
{
|
|
981
|
+
"kind": "method",
|
|
982
|
+
"name": "getActiveElement",
|
|
983
|
+
"static": true,
|
|
984
|
+
"return": {
|
|
985
|
+
"type": {
|
|
986
|
+
"text": "HTMLElement | null"
|
|
987
|
+
}
|
|
988
|
+
},
|
|
989
|
+
"description": "Ritorna l'elemento attivo corrente, attraversando shadow DOM e slot"
|
|
990
|
+
},
|
|
991
|
+
{
|
|
992
|
+
"kind": "method",
|
|
993
|
+
"name": "focusInitial",
|
|
994
|
+
"return": {
|
|
995
|
+
"type": {
|
|
996
|
+
"text": "void"
|
|
997
|
+
}
|
|
998
|
+
},
|
|
999
|
+
"description": "Metti a fuoco l'elemento iniziale specificato nella config, se presente.\nSe non è fornito, fallback sul primo elemento tabbabile."
|
|
1000
|
+
},
|
|
1001
|
+
{
|
|
1002
|
+
"kind": "field",
|
|
1003
|
+
"name": "_handleKeyDown",
|
|
1004
|
+
"privacy": "private"
|
|
1005
|
+
},
|
|
1006
|
+
{
|
|
1007
|
+
"kind": "method",
|
|
1008
|
+
"name": "_handleTab",
|
|
1009
|
+
"privacy": "private",
|
|
1010
|
+
"return": {
|
|
1011
|
+
"type": {
|
|
1012
|
+
"text": "void"
|
|
1013
|
+
}
|
|
1014
|
+
},
|
|
1015
|
+
"parameters": [
|
|
1016
|
+
{
|
|
1017
|
+
"name": "event",
|
|
1018
|
+
"type": {
|
|
1019
|
+
"text": "KeyboardEvent"
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
]
|
|
1023
|
+
},
|
|
1024
|
+
{
|
|
1025
|
+
"kind": "method",
|
|
1026
|
+
"name": "_restoreFocus",
|
|
1027
|
+
"privacy": "private",
|
|
1028
|
+
"return": {
|
|
1029
|
+
"type": {
|
|
1030
|
+
"text": "void"
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
]
|
|
1035
|
+
}
|
|
1036
|
+
],
|
|
1037
|
+
"exports": [
|
|
1038
|
+
{
|
|
1039
|
+
"kind": "js",
|
|
1040
|
+
"name": "FocusTrapController",
|
|
1041
|
+
"declaration": {
|
|
1042
|
+
"name": "FocusTrapController",
|
|
1043
|
+
"module": "src/controllers/focus-trap-controller.ts"
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
]
|
|
1047
|
+
},
|
|
738
1048
|
{
|
|
739
1049
|
"kind": "javascript-module",
|
|
740
1050
|
"path": "src/controllers/roving-tabindex-controller.ts",
|
|
@@ -1125,6 +1435,16 @@
|
|
|
1125
1435
|
"attribute": "required",
|
|
1126
1436
|
"reflects": true
|
|
1127
1437
|
},
|
|
1438
|
+
{
|
|
1439
|
+
"kind": "field",
|
|
1440
|
+
"name": "isInGroup",
|
|
1441
|
+
"type": {
|
|
1442
|
+
"text": "boolean"
|
|
1443
|
+
},
|
|
1444
|
+
"privacy": "protected",
|
|
1445
|
+
"default": "false",
|
|
1446
|
+
"attribute": "isInGroup"
|
|
1447
|
+
},
|
|
1128
1448
|
{
|
|
1129
1449
|
"kind": "field",
|
|
1130
1450
|
"name": "validity",
|
|
@@ -1146,24 +1466,24 @@
|
|
|
1146
1466
|
},
|
|
1147
1467
|
{
|
|
1148
1468
|
"kind": "method",
|
|
1149
|
-
"name": "
|
|
1469
|
+
"name": "getForm",
|
|
1150
1470
|
"privacy": "public",
|
|
1151
1471
|
"return": {
|
|
1152
1472
|
"type": {
|
|
1153
|
-
"text": "
|
|
1473
|
+
"text": "HTMLFormElement | null"
|
|
1154
1474
|
}
|
|
1155
|
-
}
|
|
1475
|
+
},
|
|
1476
|
+
"description": "Gets the associated form, if one exists."
|
|
1156
1477
|
},
|
|
1157
1478
|
{
|
|
1158
1479
|
"kind": "method",
|
|
1159
|
-
"name": "
|
|
1480
|
+
"name": "checkValidity",
|
|
1160
1481
|
"privacy": "public",
|
|
1161
1482
|
"return": {
|
|
1162
1483
|
"type": {
|
|
1163
|
-
"text": "
|
|
1484
|
+
"text": "boolean"
|
|
1164
1485
|
}
|
|
1165
|
-
}
|
|
1166
|
-
"description": "Gets the associated form, if one exists."
|
|
1486
|
+
}
|
|
1167
1487
|
},
|
|
1168
1488
|
{
|
|
1169
1489
|
"kind": "method",
|
|
@@ -1426,6 +1746,14 @@
|
|
|
1426
1746
|
"default": "false",
|
|
1427
1747
|
"description": "If the input is required.",
|
|
1428
1748
|
"fieldName": "required"
|
|
1749
|
+
},
|
|
1750
|
+
{
|
|
1751
|
+
"name": "isInGroup",
|
|
1752
|
+
"type": {
|
|
1753
|
+
"text": "boolean"
|
|
1754
|
+
},
|
|
1755
|
+
"default": "false",
|
|
1756
|
+
"fieldName": "isInGroup"
|
|
1429
1757
|
}
|
|
1430
1758
|
],
|
|
1431
1759
|
"superclass": {
|
|
@@ -1484,6 +1812,14 @@
|
|
|
1484
1812
|
},
|
|
1485
1813
|
"default": "{ form: (input) => { // If there's a form attribute, use it to find the target form by id // Controls may not always reflect the 'form' property. For example, `<it-button>` doesn't reflect. const formId = input.form; if (formId) { const root = input.getRootNode() as Document | ShadowRoot | HTMLElement; const form = root.querySelector(`#${formId}`); if (form) { return form as HTMLFormElement; } } return input.closest('form'); }, name: (input) => input.name, value: (input) => input.value, disabled: (input) => input.disabled ?? false, reportValidity: (input: FormControl) => typeof input.reportValidity === 'function' ? input.reportValidity() : true, checkValidity: (input: FormControl) => (typeof input.checkValidity === 'function' ? input.checkValidity() : true), setValue: (input, value) => { // eslint-disable-next-line no-param-reassign input.value = value as string; }, assumeInteractionOn: ['it-input'], ...options, }"
|
|
1486
1814
|
},
|
|
1815
|
+
{
|
|
1816
|
+
"kind": "field",
|
|
1817
|
+
"name": "submittedOnce",
|
|
1818
|
+
"type": {
|
|
1819
|
+
"text": "boolean"
|
|
1820
|
+
},
|
|
1821
|
+
"default": "false"
|
|
1822
|
+
},
|
|
1487
1823
|
{
|
|
1488
1824
|
"kind": "method",
|
|
1489
1825
|
"name": "hostConnected"
|
|
@@ -1630,6 +1966,10 @@
|
|
|
1630
1966
|
],
|
|
1631
1967
|
"description": "Synchronously sets the form control's validity. Call this when you know the future validity but need to update\nthe host element immediately, i.e. before Lit updates the component in the next update."
|
|
1632
1968
|
},
|
|
1969
|
+
{
|
|
1970
|
+
"kind": "method",
|
|
1971
|
+
"name": "userInteracted"
|
|
1972
|
+
},
|
|
1633
1973
|
{
|
|
1634
1974
|
"kind": "method",
|
|
1635
1975
|
"name": "updateValidity",
|
|
@@ -2070,7 +2410,7 @@
|
|
|
2070
2410
|
"type": {
|
|
2071
2411
|
"text": "DefaultTranslation"
|
|
2072
2412
|
},
|
|
2073
|
-
"default": "{ $code: 'it', $name: 'Italiano', $dir: 'ltr', validityRequired: 'Questo campo è obbligatorio.', validityPattern: 'Il valore non corrisponde al formato richiesto.', validityMinlength: 'Il valore deve essere lungo almeno {minlength} caratteri.', validityMaxlength: 'Il valore deve essere lungo al massimo {maxlength} caratteri.', }"
|
|
2413
|
+
"default": "{ $code: 'it', $name: 'Italiano', $dir: 'ltr', validityRequired: 'Questo campo è obbligatorio.', validityGroupRequired: \"Scegli almeno un'opzione\", validityPattern: 'Il valore non corrisponde al formato richiesto.', validityMinlength: 'Il valore deve essere lungo almeno {minlength} caratteri.', validityMaxlength: 'Il valore deve essere lungo al massimo {maxlength} caratteri.', }"
|
|
2074
2414
|
}
|
|
2075
2415
|
],
|
|
2076
2416
|
"exports": [
|
|
@@ -26,7 +26,7 @@ export declare class BaseComponent extends LitElement {
|
|
|
26
26
|
}
|
|
27
27
|
export declare const BaseLocalizedComponent: (new (...args: any[]) => {
|
|
28
28
|
localize: import("@italia/i18n").LocalizeController;
|
|
29
|
-
|
|
29
|
+
get $localize(): import("@italia/i18n").LocalizeController<import("@italia/i18n").DefaultTranslation>;
|
|
30
30
|
$t(t: string): string;
|
|
31
31
|
$d(d: Date | string, p: Intl.DateTimeFormatOptions): string;
|
|
32
32
|
$n(d: number, p: Intl.NumberFormatOptions): string;
|
|
@@ -37,6 +37,7 @@ export declare const BaseLocalizedComponent: (new (...args: any[]) => {
|
|
|
37
37
|
accessKey: string;
|
|
38
38
|
readonly accessKeyLabel: string;
|
|
39
39
|
autocapitalize: string;
|
|
40
|
+
autocorrect: boolean;
|
|
40
41
|
dir: string;
|
|
41
42
|
draggable: boolean;
|
|
42
43
|
hidden: boolean;
|
|
@@ -144,6 +145,8 @@ export declare const BaseLocalizedComponent: (new (...args: any[]) => {
|
|
|
144
145
|
setPointerCapture(pointerId: number): void;
|
|
145
146
|
toggleAttribute(qualifiedName: string, force?: boolean): boolean;
|
|
146
147
|
webkitMatchesSelector(selectors: string): boolean;
|
|
148
|
+
get textContent(): string;
|
|
149
|
+
set textContent(value: string | null): any;
|
|
147
150
|
readonly baseURI: string;
|
|
148
151
|
readonly childNodes: NodeListOf<ChildNode>;
|
|
149
152
|
readonly firstChild: ChildNode | null;
|
|
@@ -156,7 +159,6 @@ export declare const BaseLocalizedComponent: (new (...args: any[]) => {
|
|
|
156
159
|
readonly parentElement: HTMLElement | null;
|
|
157
160
|
readonly parentNode: ParentNode | null;
|
|
158
161
|
readonly previousSibling: ChildNode | null;
|
|
159
|
-
textContent: string | null;
|
|
160
162
|
appendChild<T_1 extends Node>(node: T_1): T_1;
|
|
161
163
|
cloneNode(subtree?: boolean): Node;
|
|
162
164
|
compareDocumentPosition(other: Node): number;
|
|
@@ -191,6 +193,7 @@ export declare const BaseLocalizedComponent: (new (...args: any[]) => {
|
|
|
191
193
|
readonly DOCUMENT_POSITION_CONTAINED_BY: 16;
|
|
192
194
|
readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32;
|
|
193
195
|
dispatchEvent(event: Event): boolean;
|
|
196
|
+
ariaActiveDescendantElement: Element | null;
|
|
194
197
|
ariaAtomic: string | null;
|
|
195
198
|
ariaAutoComplete: string | null;
|
|
196
199
|
ariaBrailleLabel: string | null;
|
|
@@ -201,21 +204,28 @@ export declare const BaseLocalizedComponent: (new (...args: any[]) => {
|
|
|
201
204
|
ariaColIndex: string | null;
|
|
202
205
|
ariaColIndexText: string | null;
|
|
203
206
|
ariaColSpan: string | null;
|
|
207
|
+
ariaControlsElements: ReadonlyArray<Element> | null;
|
|
204
208
|
ariaCurrent: string | null;
|
|
209
|
+
ariaDescribedByElements: ReadonlyArray<Element> | null;
|
|
205
210
|
ariaDescription: string | null;
|
|
211
|
+
ariaDetailsElements: ReadonlyArray<Element> | null;
|
|
206
212
|
ariaDisabled: string | null;
|
|
213
|
+
ariaErrorMessageElements: ReadonlyArray<Element> | null;
|
|
207
214
|
ariaExpanded: string | null;
|
|
215
|
+
ariaFlowToElements: ReadonlyArray<Element> | null;
|
|
208
216
|
ariaHasPopup: string | null;
|
|
209
217
|
ariaHidden: string | null;
|
|
210
218
|
ariaInvalid: string | null;
|
|
211
219
|
ariaKeyShortcuts: string | null;
|
|
212
220
|
ariaLabel: string | null;
|
|
221
|
+
ariaLabelledByElements: ReadonlyArray<Element> | null;
|
|
213
222
|
ariaLevel: string | null;
|
|
214
223
|
ariaLive: string | null;
|
|
215
224
|
ariaModal: string | null;
|
|
216
225
|
ariaMultiLine: string | null;
|
|
217
226
|
ariaMultiSelectable: string | null;
|
|
218
227
|
ariaOrientation: string | null;
|
|
228
|
+
ariaOwnsElements: ReadonlyArray<Element> | null;
|
|
219
229
|
ariaPlaceholder: string | null;
|
|
220
230
|
ariaPosInSet: string | null;
|
|
221
231
|
ariaPressed: string | null;
|
|
@@ -273,18 +283,19 @@ export declare const BaseLocalizedComponent: (new (...args: any[]) => {
|
|
|
273
283
|
onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
274
284
|
onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
275
285
|
onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
276
|
-
onauxclick: ((this: GlobalEventHandlers, ev:
|
|
286
|
+
onauxclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
277
287
|
onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null;
|
|
278
|
-
|
|
288
|
+
onbeforematch: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
289
|
+
onbeforetoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
|
|
279
290
|
onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
|
|
280
291
|
oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
281
292
|
oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
282
293
|
oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
283
294
|
onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
284
|
-
onclick: ((this: GlobalEventHandlers, ev:
|
|
295
|
+
onclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
285
296
|
onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
286
297
|
oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
287
|
-
oncontextmenu: ((this: GlobalEventHandlers, ev:
|
|
298
|
+
oncontextmenu: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
288
299
|
oncontextrestored: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
289
300
|
oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
|
|
290
301
|
oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
@@ -332,6 +343,7 @@ export declare const BaseLocalizedComponent: (new (...args: any[]) => {
|
|
|
332
343
|
onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
333
344
|
onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
334
345
|
onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
346
|
+
onpointerrawupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
335
347
|
onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
336
348
|
onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;
|
|
337
349
|
onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
@@ -350,7 +362,7 @@ export declare const BaseLocalizedComponent: (new (...args: any[]) => {
|
|
|
350
362
|
onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
|
|
351
363
|
onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
352
364
|
ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
353
|
-
ontoggle: ((this: GlobalEventHandlers, ev:
|
|
365
|
+
ontoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
|
|
354
366
|
ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
355
367
|
ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
356
368
|
ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-component.d.ts","sourceRoot":"","sources":["../../../src/base-component/base-component.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAI5C,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IACrC,YAAY,EAAE,OAAO,IAAI,CAAC;CAC3B;AAED,MAAM,MAAM,iBAAiB,GAAG,OAAO,UAAU,GAAG,WAAW,CAAC,sBAAsB,CAAC,CAAC;AAExF;;;GAGG;AAEH,qBAAa,aAAc,SAAQ,UAAU;IAC3C,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IAEzB,SAAS,CAAC,YAAY,cAAQ;IAE9B,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;;IAOvB,SAAS,KAAK,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUtD;IAGD,UAAU,CAAC,MAAM,EAAE,MAAM;IAKzB,QAAQ,CAAC,OAAO,EAAE,WAAW;IAK7B,SAAS,CAAC,gBAAgB,CAAC,CAAC,SAAS,WAAW,KAAK,CAAC,GAAG,IAAI;IAQ7D,IAAI,YAAY,IAAI,WAAW,GAAG,IAAI,CAErC;IAGD,SAAS,KAAK,oBAAoB,IAAI,OAAO,CAE5C;IAED,iBAAiB;CAOlB;AAED,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"base-component.d.ts","sourceRoot":"","sources":["../../../src/base-component/base-component.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAI5C,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IACrC,YAAY,EAAE,OAAO,IAAI,CAAC;CAC3B;AAED,MAAM,MAAM,iBAAiB,GAAG,OAAO,UAAU,GAAG,WAAW,CAAC,sBAAsB,CAAC,CAAC;AAExF;;;GAGG;AAEH,qBAAa,aAAc,SAAQ,UAAU;IAC3C,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IAEzB,SAAS,CAAC,YAAY,cAAQ;IAE9B,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;;IAOvB,SAAS,KAAK,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUtD;IAGD,UAAU,CAAC,MAAM,EAAE,MAAM;IAKzB,QAAQ,CAAC,OAAO,EAAE,WAAW;IAK7B,SAAS,CAAC,gBAAgB,CAAC,CAAC,SAAS,WAAW,KAAK,CAAC,GAAG,IAAI;IAQ7D,IAAI,YAAY,IAAI,WAAW,GAAG,IAAI,CAErC;IAGD,SAAS,KAAK,oBAAoB,IAAI,OAAO,CAE5C;IAED,iBAAiB;CAOlB;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBACi6E,CAAC;4IAAqK,CAAC;wFAAwI,CAAC;+IAA+L,CAAC;2FAAwI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAA8nC,CAAC;;;;;;;;;;;;;;;;;;;;;;;mBAA0jE,CAAC;;;;;;;;;;;;;6BAA4xB,CAAC;8BAAuE,CAAC;kBAA4D,CAAC;;oBAA8F,CAAC;;sBAAkG,CAAC;oBAAkE,CAAC;;;;;;;;gDAAme,CAAC;;;;;;;;;;;;;;;;;qBAA4vB,CAAC;;;uBAAkJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EAAiiH,CAAC;yBAA8E,CAAC;UAAoD,GAAG;WAAgD,GAAG;;gBAA6E,GAAG;;;;;;;WAA4V,GAAG;YAAiD,GAAG;;;;;;;;;;;oBAAupC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAiiO,CAAC;cAA6F,CAAC;eAA8F,CAAC;gBAA+F,CAAC;;;;;;;;;;;;;;SAAulC,CAAC;;;iBAA+E,CAAC;yBAD/gtB,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
export interface FocusTrapConfig {
|
|
3
|
+
/** Funzione che ritorna l'elemento contenitore del trap */
|
|
4
|
+
getContainer: () => HTMLElement | ShadowRoot | null;
|
|
5
|
+
/** Funzione che ritorna l'elemento trigger che ha attivato il focus trap */
|
|
6
|
+
getTrigger: () => HTMLElement | ShadowRoot | null;
|
|
7
|
+
/** Opzionale: funzione che ritorna l'elemento da mettere a fuoco all'apertura (può essere tabindex -1) */
|
|
8
|
+
initialFocus?: () => HTMLElement | null;
|
|
9
|
+
/** Callback quando viene premuto Escape */
|
|
10
|
+
onEscape?: () => void;
|
|
11
|
+
/** Se true, non chiude con Escape */
|
|
12
|
+
disableEscape?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Controller per gestire il focus trap all'interno di un elemento.
|
|
16
|
+
* Implementa le linee guida WAI-ARIA per i dialog modali.
|
|
17
|
+
*
|
|
18
|
+
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare class FocusTrapController implements ReactiveController {
|
|
22
|
+
private host;
|
|
23
|
+
private config;
|
|
24
|
+
private observer;
|
|
25
|
+
private _isActive;
|
|
26
|
+
private _previousActiveElement;
|
|
27
|
+
private _focusableElements;
|
|
28
|
+
private _first;
|
|
29
|
+
private _last;
|
|
30
|
+
private static readonly FOCUSABLE_SELECTORS;
|
|
31
|
+
/**
|
|
32
|
+
* Verifica se un elemento è effettivamente focusabile e tabbabile.
|
|
33
|
+
* Elementi con tabindex="-1" sono focusabili programmaticamente ma non tabbabili.
|
|
34
|
+
*/
|
|
35
|
+
private static isFocusable;
|
|
36
|
+
constructor(host: ReactiveControllerHost & HTMLElement, config: FocusTrapConfig);
|
|
37
|
+
hostConnected(): void;
|
|
38
|
+
hostDisconnected(): void;
|
|
39
|
+
/** Indica se il focus trap è attivo */
|
|
40
|
+
get isActive(): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Attiva il focus trap.
|
|
43
|
+
* Salva l'elemento attivo corrente e attiva i listener.
|
|
44
|
+
* NOTA: chiamare updateFocusableElements() e focusFirst() separatamente quando necessario.
|
|
45
|
+
*/
|
|
46
|
+
activate(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Disattiva il focus trap.
|
|
49
|
+
* Ripristina il focus all'elemento precedentemente attivo.
|
|
50
|
+
*/
|
|
51
|
+
deactivate(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Aggiorna la lista degli elementi focusabili.
|
|
54
|
+
* Chiamare dopo modifiche al DOM.
|
|
55
|
+
*/
|
|
56
|
+
updateFocusableElements(): void;
|
|
57
|
+
/** Sposta il focus sul primo elemento focusabile */
|
|
58
|
+
focusFirst(): void;
|
|
59
|
+
/** Sposta il focus sull'ultimo elemento focusabile */
|
|
60
|
+
focusLast(): void;
|
|
61
|
+
/** Ritorna l'elemento attivo corrente, attraversando shadow DOM e slot */
|
|
62
|
+
static getActiveElement(): HTMLElement | null;
|
|
63
|
+
/**
|
|
64
|
+
* Metti a fuoco l'elemento iniziale specificato nella config, se presente.
|
|
65
|
+
* Se non è fornito, fallback sul primo elemento tabbabile.
|
|
66
|
+
*/
|
|
67
|
+
focusInitial(): void;
|
|
68
|
+
private _handleKeyDown;
|
|
69
|
+
private _handleTab;
|
|
70
|
+
private _restoreFocus;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=focus-trap-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focus-trap-controller.d.ts","sourceRoot":"","sources":["../../../src/controllers/focus-trap-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,KAAK,CAAC;AAEjE,MAAM,WAAW,eAAe;IAC9B,2DAA2D;IAC3D,YAAY,EAAE,MAAM,WAAW,GAAG,UAAU,GAAG,IAAI,CAAC;IACpD,4EAA4E;IAC5E,UAAU,EAAE,MAAM,WAAW,GAAG,UAAU,GAAG,IAAI,CAAC;IAClD,0GAA0G;IAC1G,YAAY,CAAC,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;IACxC,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,qCAAqC;IACrC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;GAMG;AACH,qBAAa,mBAAoB,YAAW,kBAAkB;IAC5D,OAAO,CAAC,IAAI,CAAuC;IAEnD,OAAO,CAAC,MAAM,CAAkB;IAEhC,OAAO,CAAC,QAAQ,CAAiC;IAEjD,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAO,CAAC,sBAAsB,CAA4B;IAE1D,OAAO,CAAC,kBAAkB,CAAa;IAEvC,OAAO,CAAC,MAAM,CAAM;IAEpB,OAAO,CAAC,KAAK,CAAM;IAEnB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAU/B;IAEZ;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;gBAwCd,IAAI,EAAE,sBAAsB,GAAG,WAAW,EAAE,MAAM,EAAE,eAAe;IAO/E,aAAa;IAYb,gBAAgB;IAQhB,uCAAuC;IACvC,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED;;;;OAIG;IACH,QAAQ,IAAI,IAAI;IAYhB;;;OAGG;IACH,UAAU,IAAI,IAAI;IAQlB;;;OAGG;IACH,uBAAuB,IAAI,IAAI;IA+C/B,oDAAoD;IACpD,UAAU,IAAI,IAAI;IAMlB,sDAAsD;IACtD,SAAS,IAAI,IAAI;IAMjB,0EAA0E;IAC1E,MAAM,CAAC,gBAAgB,IAAI,WAAW,GAAG,IAAI;IAQ7C;;;OAGG;IACH,YAAY,IAAI,IAAI;IAYpB,OAAO,CAAC,cAAc,CAgBpB;IAEF,OAAO,CAAC,UAAU;IAgDlB,OAAO,CAAC,aAAa;CAMtB"}
|