@spectrum-web-components/menu 1.2.0-beta.9 → 1.2.0

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.
@@ -77,6 +77,15 @@
77
77
  }
78
78
  ],
79
79
  "members": [
80
+ {
81
+ "kind": "field",
82
+ "name": "shadowRootOptions",
83
+ "type": {
84
+ "text": "object"
85
+ },
86
+ "static": true,
87
+ "default": "{\n ...SpectrumElement.shadowRootOptions,\n delegatesFocus: true,\n }"
88
+ },
80
89
  {
81
90
  "kind": "field",
82
91
  "name": "isSubmenu",
@@ -86,6 +95,14 @@
86
95
  "privacy": "private",
87
96
  "readonly": true
88
97
  },
98
+ {
99
+ "kind": "field",
100
+ "name": "rovingTabindexController",
101
+ "type": {
102
+ "text": "RovingTabindexController<MenuItem> | undefined"
103
+ },
104
+ "privacy": "protected"
105
+ },
89
106
  {
90
107
  "kind": "field",
91
108
  "name": "label",
@@ -94,6 +111,7 @@
94
111
  },
95
112
  "privacy": "public",
96
113
  "default": "''",
114
+ "description": "label of the menu",
97
115
  "attribute": "label",
98
116
  "reflects": true
99
117
  },
@@ -105,6 +123,7 @@
105
123
  },
106
124
  "privacy": "public",
107
125
  "default": "false",
126
+ "description": "whether menu should be ignored by roving tabindex controller",
108
127
  "attribute": "ignore",
109
128
  "reflects": true
110
129
  },
@@ -115,6 +134,7 @@
115
134
  "text": "undefined | 'inherit' | 'single' | 'multiple'"
116
135
  },
117
136
  "privacy": "public",
137
+ "description": "how the menu allows selection of its items:\n- `undefined` (default): no selection is allowed\n- `\"inherit\"`: the selection behavior is managed from an ancestor\n- `\"single\"`: only one item can be selected at a time\n - `\"multiple\"`: multiple items can be selected",
118
138
  "attribute": "selects",
119
139
  "reflects": true
120
140
  },
@@ -126,6 +146,7 @@
126
146
  },
127
147
  "privacy": "public",
128
148
  "default": "''",
149
+ "description": "value of the selected item(s)",
129
150
  "attribute": "value"
130
151
  },
131
152
  {
@@ -144,7 +165,8 @@
144
165
  "type": {
145
166
  "text": "string[]"
146
167
  },
147
- "privacy": "public"
168
+ "privacy": "public",
169
+ "description": "selected items values as string"
148
170
  },
149
171
  {
150
172
  "kind": "field",
@@ -156,7 +178,8 @@
156
178
  "kind": "field",
157
179
  "name": "selectedItems",
158
180
  "privacy": "public",
159
- "default": "[]"
181
+ "default": "[]",
182
+ "description": "array of selected menu items"
160
183
  },
161
184
  {
162
185
  "kind": "field",
@@ -190,6 +213,24 @@
190
213
  "privacy": "public",
191
214
  "default": "0"
192
215
  },
216
+ {
217
+ "kind": "field",
218
+ "name": "focusInItem",
219
+ "type": {
220
+ "text": "MenuItem | undefined"
221
+ },
222
+ "privacy": "public",
223
+ "readonly": true
224
+ },
225
+ {
226
+ "kind": "field",
227
+ "name": "controlsRovingTabindex",
228
+ "type": {
229
+ "text": "boolean"
230
+ },
231
+ "privacy": "protected",
232
+ "readonly": true
233
+ },
193
234
  {
194
235
  "kind": "field",
195
236
  "name": "selectedItemsMap",
@@ -203,6 +244,7 @@
203
244
  "text": "MenuItem[]"
204
245
  },
205
246
  "privacy": "public",
247
+ "description": "child items managed by menu",
206
248
  "readonly": true
207
249
  },
208
250
  {
@@ -248,7 +290,8 @@
248
290
  "type": {
249
291
  "text": "SelectsType | undefined"
250
292
  },
251
- "privacy": "private"
293
+ "privacy": "private",
294
+ "description": "menuitem role based on selection type"
252
295
  },
253
296
  {
254
297
  "kind": "field",
@@ -256,7 +299,8 @@
256
299
  "type": {
257
300
  "text": "RoleType | undefined"
258
301
  },
259
- "privacy": "private"
302
+ "privacy": "private",
303
+ "description": "menu role based on selection type"
260
304
  },
261
305
  {
262
306
  "kind": "method",
@@ -334,7 +378,7 @@
334
378
  },
335
379
  {
336
380
  "kind": "method",
337
- "name": "focus",
381
+ "name": "focusOnFirstSelectedItem",
338
382
  "privacy": "public",
339
383
  "return": {
340
384
  "type": {
@@ -343,24 +387,19 @@
343
387
  },
344
388
  "parameters": [
345
389
  {
346
- "name": "{ preventScroll }",
390
+ "name": "{\n preventScroll,\n }",
347
391
  "default": "{}",
348
392
  "type": {
349
393
  "text": "FocusOptions"
350
394
  }
351
395
  }
352
- ]
353
- },
354
- {
355
- "kind": "field",
356
- "name": "pointerUpTarget",
357
- "privacy": "private",
358
- "default": "null"
396
+ ],
397
+ "description": "for picker elements, will set focus on first selected item"
359
398
  },
360
399
  {
361
400
  "kind": "method",
362
- "name": "handleClick",
363
- "privacy": "private",
401
+ "name": "focus",
402
+ "privacy": "public",
364
403
  "return": {
365
404
  "type": {
366
405
  "text": "void"
@@ -368,34 +407,33 @@
368
407
  },
369
408
  "parameters": [
370
409
  {
371
- "name": "event",
410
+ "name": "{ preventScroll }",
411
+ "default": "{}",
372
412
  "type": {
373
- "text": "Event"
413
+ "text": "FocusOptions"
374
414
  }
375
415
  }
376
416
  ]
377
417
  },
418
+ {
419
+ "kind": "field",
420
+ "name": "pointerUpTarget",
421
+ "privacy": "private",
422
+ "default": "null"
423
+ },
378
424
  {
379
425
  "kind": "method",
380
- "name": "handlePointerup",
426
+ "name": "handleFocusout",
381
427
  "privacy": "private",
382
428
  "return": {
383
429
  "type": {
384
430
  "text": "void"
385
431
  }
386
- },
387
- "parameters": [
388
- {
389
- "name": "event",
390
- "type": {
391
- "text": "Event"
392
- }
393
- }
394
- ]
432
+ }
395
433
  },
396
434
  {
397
435
  "kind": "method",
398
- "name": "handlePointerBasedSelection",
436
+ "name": "handleClick",
399
437
  "privacy": "private",
400
438
  "return": {
401
439
  "type": {
@@ -413,8 +451,8 @@
413
451
  },
414
452
  {
415
453
  "kind": "method",
416
- "name": "handleFocusin",
417
- "privacy": "public",
454
+ "name": "handlePointerup",
455
+ "privacy": "private",
418
456
  "return": {
419
457
  "type": {
420
458
  "text": "void"
@@ -424,25 +462,15 @@
424
462
  {
425
463
  "name": "event",
426
464
  "type": {
427
- "text": "FocusEvent"
465
+ "text": "Event"
428
466
  }
429
467
  }
430
468
  ]
431
469
  },
432
470
  {
433
471
  "kind": "method",
434
- "name": "startListeningToKeyboard",
435
- "privacy": "public",
436
- "return": {
437
- "type": {
438
- "text": "void"
439
- }
440
- }
441
- },
442
- {
443
- "kind": "method",
444
- "name": "handleBlur",
445
- "privacy": "public",
472
+ "name": "handlePointerBasedSelection",
473
+ "privacy": "private",
446
474
  "return": {
447
475
  "type": {
448
476
  "text": "void"
@@ -452,21 +480,11 @@
452
480
  {
453
481
  "name": "event",
454
482
  "type": {
455
- "text": "FocusEvent"
483
+ "text": "Event"
456
484
  }
457
485
  }
458
486
  ]
459
487
  },
460
- {
461
- "kind": "method",
462
- "name": "stopListeningToKeyboard",
463
- "privacy": "public",
464
- "return": {
465
- "type": {
466
- "text": "void"
467
- }
468
- }
469
- },
470
488
  {
471
489
  "kind": "field",
472
490
  "name": "descendentOverlays",
@@ -514,43 +532,53 @@
514
532
  "name": "handleSubmenuClosed",
515
533
  "privacy": "public"
516
534
  },
517
- {
518
- "kind": "field",
519
- "name": "handleSubmenuOpened",
520
- "privacy": "public"
521
- },
522
535
  {
523
536
  "kind": "method",
524
- "name": "selectOrToggleItem",
537
+ "name": "getNeighboringFocusableElement",
525
538
  "privacy": "public",
526
539
  "return": {
527
540
  "type": {
528
- "text": "Promise<void>"
541
+ "text": "MenuItem"
529
542
  }
530
543
  },
531
544
  "parameters": [
532
545
  {
533
- "name": "targetItem",
546
+ "name": "menuItem",
547
+ "optional": true,
534
548
  "type": {
535
549
  "text": "MenuItem"
536
550
  }
551
+ },
552
+ {
553
+ "name": "before",
554
+ "default": "false",
555
+ "description": "return the item before; default is false",
556
+ "type": {
557
+ "text": "boolean"
558
+ }
537
559
  }
538
- ]
560
+ ],
561
+ "description": "given a menu item, returns the next focusable menu item before or after it;\nif no menu item is provided, returns the first focusable menu item"
562
+ },
563
+ {
564
+ "kind": "field",
565
+ "name": "handleSubmenuOpened",
566
+ "privacy": "public"
539
567
  },
540
568
  {
541
569
  "kind": "method",
542
- "name": "navigateWithinMenu",
543
- "privacy": "protected",
570
+ "name": "selectOrToggleItem",
571
+ "privacy": "public",
544
572
  "return": {
545
573
  "type": {
546
- "text": "void"
574
+ "text": "Promise<void>"
547
575
  }
548
576
  },
549
577
  "parameters": [
550
578
  {
551
- "name": "event",
579
+ "name": "targetItem",
552
580
  "type": {
553
- "text": "KeyboardEvent"
581
+ "text": "MenuItem"
554
582
  }
555
583
  }
556
584
  ]
@@ -568,7 +596,7 @@
568
596
  {
569
597
  "name": "event",
570
598
  "type": {
571
- "text": "KeyboardEvent"
599
+ "text": "MenuItemKeydownEvent"
572
600
  }
573
601
  }
574
602
  ]
@@ -586,28 +614,19 @@
586
614
  {
587
615
  "name": "event",
588
616
  "type": {
589
- "text": "KeyboardEvent"
617
+ "text": "Event"
590
618
  }
591
619
  }
592
620
  ]
593
621
  },
594
622
  {
595
- "kind": "method",
596
- "name": "focusMenuItemByOffset",
597
- "privacy": "public",
598
- "return": {
599
- "type": {
600
- "text": "MenuItem"
601
- }
623
+ "kind": "field",
624
+ "name": "_hasUpdatedSelectedItemIndex",
625
+ "type": {
626
+ "text": "boolean"
602
627
  },
603
- "parameters": [
604
- {
605
- "name": "offset",
606
- "type": {
607
- "text": "number"
608
- }
609
- }
610
- ]
628
+ "privacy": "private",
629
+ "default": "false"
611
630
  },
612
631
  {
613
632
  "kind": "method",
@@ -617,16 +636,8 @@
617
636
  "type": {
618
637
  "text": "void"
619
638
  }
620
- }
621
- },
622
- {
623
- "kind": "field",
624
- "name": "_hasUpdatedSelectedItemIndex",
625
- "type": {
626
- "text": "boolean"
627
639
  },
628
- "privacy": "private",
629
- "default": "false"
640
+ "description": "on focus, removes focus from focus styling item, and updates the selected item index"
630
641
  },
631
642
  {
632
643
  "kind": "method",
@@ -647,6 +658,14 @@
647
658
  "privacy": "private",
648
659
  "default": "false"
649
660
  },
661
+ {
662
+ "kind": "field",
663
+ "name": "_updateFocus",
664
+ "type": {
665
+ "text": "MenuItem | undefined"
666
+ },
667
+ "privacy": "private"
668
+ },
650
669
  {
651
670
  "kind": "method",
652
671
  "name": "handleItemsChanged",
@@ -687,24 +706,6 @@
687
706
  }
688
707
  }
689
708
  },
690
- {
691
- "kind": "method",
692
- "name": "forwardFocusVisibleToItem",
693
- "privacy": "private",
694
- "return": {
695
- "type": {
696
- "text": "void"
697
- }
698
- },
699
- "parameters": [
700
- {
701
- "name": "item",
702
- "type": {
703
- "text": "MenuItem"
704
- }
705
- }
706
- ]
707
- },
708
709
  {
709
710
  "kind": "method",
710
711
  "name": "handleSlotchange",
@@ -743,6 +744,24 @@
743
744
  }
744
745
  }
745
746
  },
747
+ {
748
+ "kind": "method",
749
+ "name": "isFocusableElement",
750
+ "privacy": "private",
751
+ "return": {
752
+ "type": {
753
+ "text": "boolean"
754
+ }
755
+ },
756
+ "parameters": [
757
+ {
758
+ "name": "el",
759
+ "type": {
760
+ "text": "MenuItem"
761
+ }
762
+ }
763
+ ]
764
+ },
746
765
  {
747
766
  "kind": "field",
748
767
  "name": "childItemsUpdated",
@@ -789,7 +808,7 @@
789
808
  ],
790
809
  "attributes": [
791
810
  {
792
- "description": "whether the element has a specific selection algorithm that it applies to its item descendants. `single` allows only one descendent to be selected at a time. `multiple` allows many descendants to be selected. `inherit` will be applied dynamically when an ancestor of this element is actively managing the selection of its descendents. When the `selects` attribute is not present a `value` will not be maintained and the Menu Item children of this Menu will not have their `selected` state managed.",
811
+ "description": "how the menu allows selection of its items:\n- `undefined` (default): no selection is allowed\n- `\"inherit\"`: the selection behavior is managed from an ancestor\n- `\"single\"`: only one item can be selected at a time\n - `\"multiple\"`: multiple items can be selected",
793
812
  "name": "selects",
794
813
  "type": {
795
814
  "text": "undefined | 'inherit' | 'single' | 'multiple'"
@@ -802,6 +821,7 @@
802
821
  "text": "string"
803
822
  },
804
823
  "default": "''",
824
+ "description": "label of the menu",
805
825
  "fieldName": "label"
806
826
  },
807
827
  {
@@ -810,6 +830,7 @@
810
830
  "text": "boolean"
811
831
  },
812
832
  "default": "false",
833
+ "description": "whether menu should be ignored by roving tabindex controller",
813
834
  "fieldName": "ignore"
814
835
  },
815
836
  {
@@ -818,6 +839,7 @@
818
839
  "text": "string"
819
840
  },
820
841
  "default": "''",
842
+ "description": "value of the selected item(s)",
821
843
  "fieldName": "value"
822
844
  },
823
845
  {
@@ -944,6 +966,21 @@
944
966
  },
945
967
  "privacy": "protected",
946
968
  "readonly": true,
969
+ "description": "a menu group must have the role `group`\nand should never function as a menu",
970
+ "inheritedFrom": {
971
+ "name": "Menu",
972
+ "module": "src/Menu.js"
973
+ }
974
+ },
975
+ {
976
+ "kind": "field",
977
+ "name": "controlsRovingTabindex",
978
+ "type": {
979
+ "text": "boolean"
980
+ },
981
+ "privacy": "protected",
982
+ "readonly": true,
983
+ "description": "only a menu controls roving tabindex;\ngroups should defer navigation to parent menu",
947
984
  "inheritedFrom": {
948
985
  "name": "Menu",
949
986
  "module": "src/Menu.js"
@@ -959,6 +996,19 @@
959
996
  }
960
997
  }
961
998
  },
999
+ {
1000
+ "kind": "field",
1001
+ "name": "shadowRootOptions",
1002
+ "type": {
1003
+ "text": "object"
1004
+ },
1005
+ "static": true,
1006
+ "default": "{\n ...SpectrumElement.shadowRootOptions,\n delegatesFocus: true,\n }",
1007
+ "inheritedFrom": {
1008
+ "name": "Menu",
1009
+ "module": "src/Menu.js"
1010
+ }
1011
+ },
962
1012
  {
963
1013
  "kind": "field",
964
1014
  "name": "isSubmenu",
@@ -972,6 +1022,18 @@
972
1022
  "module": "src/Menu.js"
973
1023
  }
974
1024
  },
1025
+ {
1026
+ "kind": "field",
1027
+ "name": "rovingTabindexController",
1028
+ "type": {
1029
+ "text": "RovingTabindexController<MenuItem> | undefined"
1030
+ },
1031
+ "privacy": "protected",
1032
+ "inheritedFrom": {
1033
+ "name": "Menu",
1034
+ "module": "src/Menu.js"
1035
+ }
1036
+ },
975
1037
  {
976
1038
  "kind": "field",
977
1039
  "name": "label",
@@ -980,6 +1042,7 @@
980
1042
  },
981
1043
  "privacy": "public",
982
1044
  "default": "''",
1045
+ "description": "label of the menu",
983
1046
  "attribute": "label",
984
1047
  "reflects": true,
985
1048
  "inheritedFrom": {
@@ -995,6 +1058,7 @@
995
1058
  },
996
1059
  "privacy": "public",
997
1060
  "default": "false",
1061
+ "description": "whether menu should be ignored by roving tabindex controller",
998
1062
  "attribute": "ignore",
999
1063
  "reflects": true,
1000
1064
  "inheritedFrom": {
@@ -1009,6 +1073,7 @@
1009
1073
  "text": "undefined | 'inherit' | 'single' | 'multiple'"
1010
1074
  },
1011
1075
  "privacy": "public",
1076
+ "description": "how the menu allows selection of its items:\n- `undefined` (default): no selection is allowed\n- `\"inherit\"`: the selection behavior is managed from an ancestor\n- `\"single\"`: only one item can be selected at a time\n - `\"multiple\"`: multiple items can be selected",
1012
1077
  "attribute": "selects",
1013
1078
  "reflects": true,
1014
1079
  "inheritedFrom": {
@@ -1024,6 +1089,7 @@
1024
1089
  },
1025
1090
  "privacy": "public",
1026
1091
  "default": "''",
1092
+ "description": "value of the selected item(s)",
1027
1093
  "attribute": "value",
1028
1094
  "inheritedFrom": {
1029
1095
  "name": "Menu",
@@ -1051,6 +1117,7 @@
1051
1117
  "text": "string[]"
1052
1118
  },
1053
1119
  "privacy": "public",
1120
+ "description": "selected items values as string",
1054
1121
  "inheritedFrom": {
1055
1122
  "name": "Menu",
1056
1123
  "module": "src/Menu.js"
@@ -1071,6 +1138,7 @@
1071
1138
  "name": "selectedItems",
1072
1139
  "privacy": "public",
1073
1140
  "default": "[]",
1141
+ "description": "array of selected menu items",
1074
1142
  "inheritedFrom": {
1075
1143
  "name": "Menu",
1076
1144
  "module": "src/Menu.js"
@@ -1124,6 +1192,19 @@
1124
1192
  "module": "src/Menu.js"
1125
1193
  }
1126
1194
  },
1195
+ {
1196
+ "kind": "field",
1197
+ "name": "focusInItem",
1198
+ "type": {
1199
+ "text": "MenuItem | undefined"
1200
+ },
1201
+ "privacy": "public",
1202
+ "readonly": true,
1203
+ "inheritedFrom": {
1204
+ "name": "Menu",
1205
+ "module": "src/Menu.js"
1206
+ }
1207
+ },
1127
1208
  {
1128
1209
  "kind": "field",
1129
1210
  "name": "selectedItemsMap",
@@ -1141,6 +1222,7 @@
1141
1222
  "text": "MenuItem[]"
1142
1223
  },
1143
1224
  "privacy": "public",
1225
+ "description": "child items managed by menu",
1144
1226
  "readonly": true,
1145
1227
  "inheritedFrom": {
1146
1228
  "name": "Menu",
@@ -1194,6 +1276,7 @@
1194
1276
  "text": "SelectsType | undefined"
1195
1277
  },
1196
1278
  "privacy": "private",
1279
+ "description": "menuitem role based on selection type",
1197
1280
  "inheritedFrom": {
1198
1281
  "name": "Menu",
1199
1282
  "module": "src/Menu.js"
@@ -1206,6 +1289,7 @@
1206
1289
  "text": "RoleType | undefined"
1207
1290
  },
1208
1291
  "privacy": "private",
1292
+ "description": "menu role based on selection type",
1209
1293
  "inheritedFrom": {
1210
1294
  "name": "Menu",
1211
1295
  "module": "src/Menu.js"
@@ -1303,7 +1387,7 @@
1303
1387
  },
1304
1388
  {
1305
1389
  "kind": "method",
1306
- "name": "focus",
1390
+ "name": "focusOnFirstSelectedItem",
1307
1391
  "privacy": "public",
1308
1392
  "return": {
1309
1393
  "type": {
@@ -1312,23 +1396,14 @@
1312
1396
  },
1313
1397
  "parameters": [
1314
1398
  {
1315
- "name": "{ preventScroll }",
1399
+ "name": "{\n preventScroll,\n }",
1316
1400
  "default": "{}",
1317
1401
  "type": {
1318
1402
  "text": "FocusOptions"
1319
1403
  }
1320
1404
  }
1321
1405
  ],
1322
- "inheritedFrom": {
1323
- "name": "Menu",
1324
- "module": "src/Menu.js"
1325
- }
1326
- },
1327
- {
1328
- "kind": "field",
1329
- "name": "pointerUpTarget",
1330
- "privacy": "private",
1331
- "default": "null",
1406
+ "description": "for picker elements, will set focus on first selected item",
1332
1407
  "inheritedFrom": {
1333
1408
  "name": "Menu",
1334
1409
  "module": "src/Menu.js"
@@ -1336,8 +1411,8 @@
1336
1411
  },
1337
1412
  {
1338
1413
  "kind": "method",
1339
- "name": "handleClick",
1340
- "privacy": "private",
1414
+ "name": "focus",
1415
+ "privacy": "public",
1341
1416
  "return": {
1342
1417
  "type": {
1343
1418
  "text": "void"
@@ -1345,9 +1420,10 @@
1345
1420
  },
1346
1421
  "parameters": [
1347
1422
  {
1348
- "name": "event",
1423
+ "name": "{ preventScroll }",
1424
+ "default": "{}",
1349
1425
  "type": {
1350
- "text": "Event"
1426
+ "text": "FocusOptions"
1351
1427
  }
1352
1428
  }
1353
1429
  ],
@@ -1356,23 +1432,25 @@
1356
1432
  "module": "src/Menu.js"
1357
1433
  }
1358
1434
  },
1435
+ {
1436
+ "kind": "field",
1437
+ "name": "pointerUpTarget",
1438
+ "privacy": "private",
1439
+ "default": "null",
1440
+ "inheritedFrom": {
1441
+ "name": "Menu",
1442
+ "module": "src/Menu.js"
1443
+ }
1444
+ },
1359
1445
  {
1360
1446
  "kind": "method",
1361
- "name": "handlePointerup",
1447
+ "name": "handleFocusout",
1362
1448
  "privacy": "private",
1363
1449
  "return": {
1364
1450
  "type": {
1365
1451
  "text": "void"
1366
1452
  }
1367
1453
  },
1368
- "parameters": [
1369
- {
1370
- "name": "event",
1371
- "type": {
1372
- "text": "Event"
1373
- }
1374
- }
1375
- ],
1376
1454
  "inheritedFrom": {
1377
1455
  "name": "Menu",
1378
1456
  "module": "src/Menu.js"
@@ -1380,7 +1458,7 @@
1380
1458
  },
1381
1459
  {
1382
1460
  "kind": "method",
1383
- "name": "handlePointerBasedSelection",
1461
+ "name": "handleClick",
1384
1462
  "privacy": "private",
1385
1463
  "return": {
1386
1464
  "type": {
@@ -1402,8 +1480,8 @@
1402
1480
  },
1403
1481
  {
1404
1482
  "kind": "method",
1405
- "name": "handleFocusin",
1406
- "privacy": "public",
1483
+ "name": "handlePointerup",
1484
+ "privacy": "private",
1407
1485
  "return": {
1408
1486
  "type": {
1409
1487
  "text": "void"
@@ -1413,7 +1491,7 @@
1413
1491
  {
1414
1492
  "name": "event",
1415
1493
  "type": {
1416
- "text": "FocusEvent"
1494
+ "text": "Event"
1417
1495
  }
1418
1496
  }
1419
1497
  ],
@@ -1424,22 +1502,8 @@
1424
1502
  },
1425
1503
  {
1426
1504
  "kind": "method",
1427
- "name": "startListeningToKeyboard",
1428
- "privacy": "public",
1429
- "return": {
1430
- "type": {
1431
- "text": "void"
1432
- }
1433
- },
1434
- "inheritedFrom": {
1435
- "name": "Menu",
1436
- "module": "src/Menu.js"
1437
- }
1438
- },
1439
- {
1440
- "kind": "method",
1441
- "name": "handleBlur",
1442
- "privacy": "public",
1505
+ "name": "handlePointerBasedSelection",
1506
+ "privacy": "private",
1443
1507
  "return": {
1444
1508
  "type": {
1445
1509
  "text": "void"
@@ -1449,7 +1513,7 @@
1449
1513
  {
1450
1514
  "name": "event",
1451
1515
  "type": {
1452
- "text": "FocusEvent"
1516
+ "text": "Event"
1453
1517
  }
1454
1518
  }
1455
1519
  ],
@@ -1458,20 +1522,6 @@
1458
1522
  "module": "src/Menu.js"
1459
1523
  }
1460
1524
  },
1461
- {
1462
- "kind": "method",
1463
- "name": "stopListeningToKeyboard",
1464
- "privacy": "public",
1465
- "return": {
1466
- "type": {
1467
- "text": "void"
1468
- }
1469
- },
1470
- "inheritedFrom": {
1471
- "name": "Menu",
1472
- "module": "src/Menu.js"
1473
- }
1474
- },
1475
1525
  {
1476
1526
  "kind": "field",
1477
1527
  "name": "descendentOverlays",
@@ -1535,32 +1585,42 @@
1535
1585
  "module": "src/Menu.js"
1536
1586
  }
1537
1587
  },
1538
- {
1539
- "kind": "field",
1540
- "name": "handleSubmenuOpened",
1541
- "privacy": "public",
1542
- "inheritedFrom": {
1543
- "name": "Menu",
1544
- "module": "src/Menu.js"
1545
- }
1546
- },
1547
1588
  {
1548
1589
  "kind": "method",
1549
- "name": "selectOrToggleItem",
1590
+ "name": "getNeighboringFocusableElement",
1550
1591
  "privacy": "public",
1551
1592
  "return": {
1552
1593
  "type": {
1553
- "text": "Promise<void>"
1594
+ "text": "MenuItem"
1554
1595
  }
1555
1596
  },
1556
1597
  "parameters": [
1557
1598
  {
1558
- "name": "targetItem",
1599
+ "name": "menuItem",
1600
+ "optional": true,
1559
1601
  "type": {
1560
1602
  "text": "MenuItem"
1561
1603
  }
1604
+ },
1605
+ {
1606
+ "name": "before",
1607
+ "default": "false",
1608
+ "description": "return the item before; default is false",
1609
+ "type": {
1610
+ "text": "boolean"
1611
+ }
1562
1612
  }
1563
1613
  ],
1614
+ "description": "given a menu item, returns the next focusable menu item before or after it;\nif no menu item is provided, returns the first focusable menu item",
1615
+ "inheritedFrom": {
1616
+ "name": "Menu",
1617
+ "module": "src/Menu.js"
1618
+ }
1619
+ },
1620
+ {
1621
+ "kind": "field",
1622
+ "name": "handleSubmenuOpened",
1623
+ "privacy": "public",
1564
1624
  "inheritedFrom": {
1565
1625
  "name": "Menu",
1566
1626
  "module": "src/Menu.js"
@@ -1568,18 +1628,18 @@
1568
1628
  },
1569
1629
  {
1570
1630
  "kind": "method",
1571
- "name": "navigateWithinMenu",
1572
- "privacy": "protected",
1631
+ "name": "selectOrToggleItem",
1632
+ "privacy": "public",
1573
1633
  "return": {
1574
1634
  "type": {
1575
- "text": "void"
1635
+ "text": "Promise<void>"
1576
1636
  }
1577
1637
  },
1578
1638
  "parameters": [
1579
1639
  {
1580
- "name": "event",
1640
+ "name": "targetItem",
1581
1641
  "type": {
1582
- "text": "KeyboardEvent"
1642
+ "text": "MenuItem"
1583
1643
  }
1584
1644
  }
1585
1645
  ],
@@ -1601,7 +1661,7 @@
1601
1661
  {
1602
1662
  "name": "event",
1603
1663
  "type": {
1604
- "text": "KeyboardEvent"
1664
+ "text": "MenuItemKeydownEvent"
1605
1665
  }
1606
1666
  }
1607
1667
  ],
@@ -1623,7 +1683,7 @@
1623
1683
  {
1624
1684
  "name": "event",
1625
1685
  "type": {
1626
- "text": "KeyboardEvent"
1686
+ "text": "Event"
1627
1687
  }
1628
1688
  }
1629
1689
  ],
@@ -1633,22 +1693,13 @@
1633
1693
  }
1634
1694
  },
1635
1695
  {
1636
- "kind": "method",
1637
- "name": "focusMenuItemByOffset",
1638
- "privacy": "public",
1639
- "return": {
1640
- "type": {
1641
- "text": "MenuItem"
1642
- }
1696
+ "kind": "field",
1697
+ "name": "_hasUpdatedSelectedItemIndex",
1698
+ "type": {
1699
+ "text": "boolean"
1643
1700
  },
1644
- "parameters": [
1645
- {
1646
- "name": "offset",
1647
- "type": {
1648
- "text": "number"
1649
- }
1650
- }
1651
- ],
1701
+ "privacy": "private",
1702
+ "default": "false",
1652
1703
  "inheritedFrom": {
1653
1704
  "name": "Menu",
1654
1705
  "module": "src/Menu.js"
@@ -1663,19 +1714,7 @@
1663
1714
  "text": "void"
1664
1715
  }
1665
1716
  },
1666
- "inheritedFrom": {
1667
- "name": "Menu",
1668
- "module": "src/Menu.js"
1669
- }
1670
- },
1671
- {
1672
- "kind": "field",
1673
- "name": "_hasUpdatedSelectedItemIndex",
1674
- "type": {
1675
- "text": "boolean"
1676
- },
1677
- "privacy": "private",
1678
- "default": "false",
1717
+ "description": "on focus, removes focus from focus styling item, and updates the selected item index",
1679
1718
  "inheritedFrom": {
1680
1719
  "name": "Menu",
1681
1720
  "module": "src/Menu.js"
@@ -1708,6 +1747,18 @@
1708
1747
  "module": "src/Menu.js"
1709
1748
  }
1710
1749
  },
1750
+ {
1751
+ "kind": "field",
1752
+ "name": "_updateFocus",
1753
+ "type": {
1754
+ "text": "MenuItem | undefined"
1755
+ },
1756
+ "privacy": "private",
1757
+ "inheritedFrom": {
1758
+ "name": "Menu",
1759
+ "module": "src/Menu.js"
1760
+ }
1761
+ },
1711
1762
  {
1712
1763
  "kind": "method",
1713
1764
  "name": "handleItemsChanged",
@@ -1766,7 +1817,7 @@
1766
1817
  },
1767
1818
  {
1768
1819
  "kind": "method",
1769
- "name": "forwardFocusVisibleToItem",
1820
+ "name": "handleSlotchange",
1770
1821
  "privacy": "private",
1771
1822
  "return": {
1772
1823
  "type": {
@@ -1775,9 +1826,9 @@
1775
1826
  },
1776
1827
  "parameters": [
1777
1828
  {
1778
- "name": "item",
1829
+ "name": "{\n target,\n }",
1779
1830
  "type": {
1780
- "text": "MenuItem"
1831
+ "text": "Event & { target: HTMLSlotElement }"
1781
1832
  }
1782
1833
  }
1783
1834
  ],
@@ -1788,21 +1839,13 @@
1788
1839
  },
1789
1840
  {
1790
1841
  "kind": "method",
1791
- "name": "handleSlotchange",
1792
- "privacy": "private",
1842
+ "name": "renderMenuItemSlot",
1843
+ "privacy": "protected",
1793
1844
  "return": {
1794
1845
  "type": {
1795
- "text": "void"
1846
+ "text": "TemplateResult"
1796
1847
  }
1797
1848
  },
1798
- "parameters": [
1799
- {
1800
- "name": "{\n target,\n }",
1801
- "type": {
1802
- "text": "Event & { target: HTMLSlotElement }"
1803
- }
1804
- }
1805
- ],
1806
1849
  "inheritedFrom": {
1807
1850
  "name": "Menu",
1808
1851
  "module": "src/Menu.js"
@@ -1810,11 +1853,11 @@
1810
1853
  },
1811
1854
  {
1812
1855
  "kind": "method",
1813
- "name": "renderMenuItemSlot",
1856
+ "name": "selectsChanged",
1814
1857
  "privacy": "protected",
1815
1858
  "return": {
1816
1859
  "type": {
1817
- "text": "TemplateResult"
1860
+ "text": "void"
1818
1861
  }
1819
1862
  },
1820
1863
  "inheritedFrom": {
@@ -1824,13 +1867,21 @@
1824
1867
  },
1825
1868
  {
1826
1869
  "kind": "method",
1827
- "name": "selectsChanged",
1828
- "privacy": "protected",
1870
+ "name": "isFocusableElement",
1871
+ "privacy": "private",
1829
1872
  "return": {
1830
1873
  "type": {
1831
- "text": "void"
1874
+ "text": "boolean"
1832
1875
  }
1833
1876
  },
1877
+ "parameters": [
1878
+ {
1879
+ "name": "el",
1880
+ "type": {
1881
+ "text": "MenuItem"
1882
+ }
1883
+ }
1884
+ ],
1834
1885
  "inheritedFrom": {
1835
1886
  "name": "Menu",
1836
1887
  "module": "src/Menu.js"
@@ -1889,7 +1940,7 @@
1889
1940
  "customElement": true,
1890
1941
  "attributes": [
1891
1942
  {
1892
- "description": "whether the element has a specific selection algorithm that it applies to its item descendants. `single` allows only one descendent to be selected at a time. `multiple` allows many descendants to be selected. `inherit` will be applied dynamically when an ancestor of this element is actively managing the selection of its descendents. When the `selects` attribute is not present a `value` will not be maintained and the Menu Item children of this Menu will not have their `selected` state managed.",
1943
+ "description": "how the menu allows selection of its items:\n- `undefined` (default): no selection is allowed\n- `\"inherit\"`: the selection behavior is managed from an ancestor\n- `\"single\"`: only one item can be selected at a time\n - `\"multiple\"`: multiple items can be selected",
1893
1944
  "name": "selects",
1894
1945
  "type": {
1895
1946
  "text": "undefined | 'inherit' | 'single' | 'multiple'"
@@ -1906,6 +1957,7 @@
1906
1957
  "text": "string"
1907
1958
  },
1908
1959
  "default": "''",
1960
+ "description": "label of the menu",
1909
1961
  "fieldName": "label",
1910
1962
  "inheritedFrom": {
1911
1963
  "name": "Menu",
@@ -1918,6 +1970,7 @@
1918
1970
  "text": "boolean"
1919
1971
  },
1920
1972
  "default": "false",
1973
+ "description": "whether menu should be ignored by roving tabindex controller",
1921
1974
  "fieldName": "ignore",
1922
1975
  "inheritedFrom": {
1923
1976
  "name": "Menu",
@@ -1930,6 +1983,7 @@
1930
1983
  "text": "string"
1931
1984
  },
1932
1985
  "default": "''",
1986
+ "description": "value of the selected item(s)",
1933
1987
  "fieldName": "value",
1934
1988
  "inheritedFrom": {
1935
1989
  "name": "Menu",
@@ -1991,7 +2045,7 @@
1991
2045
  "declarations": [
1992
2046
  {
1993
2047
  "kind": "class",
1994
- "description": "",
2048
+ "description": "Fires when a menu item is added or updated so that a parent menu can track it.",
1995
2049
  "name": "MenuItemAddedOrUpdatedEvent",
1996
2050
  "members": [
1997
2051
  {
@@ -2045,6 +2099,115 @@
2045
2099
  "module": "src/MenuItem.ts"
2046
2100
  }
2047
2101
  },
2102
+ {
2103
+ "kind": "class",
2104
+ "description": "Fires to forward keyboard event information to parent menu.",
2105
+ "name": "MenuItemKeydownEvent",
2106
+ "members": [
2107
+ {
2108
+ "kind": "field",
2109
+ "name": "root",
2110
+ "type": {
2111
+ "text": "MenuItem | undefined"
2112
+ },
2113
+ "default": "root"
2114
+ },
2115
+ {
2116
+ "kind": "field",
2117
+ "name": "_event",
2118
+ "type": {
2119
+ "text": "KeyboardEvent | undefined"
2120
+ },
2121
+ "privacy": "private",
2122
+ "default": "event"
2123
+ },
2124
+ {
2125
+ "kind": "field",
2126
+ "name": "altKey",
2127
+ "type": {
2128
+ "text": "boolean"
2129
+ },
2130
+ "privacy": "public",
2131
+ "readonly": true
2132
+ },
2133
+ {
2134
+ "kind": "field",
2135
+ "name": "code",
2136
+ "type": {
2137
+ "text": "string"
2138
+ },
2139
+ "privacy": "public",
2140
+ "readonly": true
2141
+ },
2142
+ {
2143
+ "kind": "field",
2144
+ "name": "ctrlKey",
2145
+ "type": {
2146
+ "text": "boolean"
2147
+ },
2148
+ "privacy": "public",
2149
+ "readonly": true
2150
+ },
2151
+ {
2152
+ "kind": "field",
2153
+ "name": "isComposing",
2154
+ "type": {
2155
+ "text": "boolean"
2156
+ },
2157
+ "privacy": "public",
2158
+ "readonly": true
2159
+ },
2160
+ {
2161
+ "kind": "field",
2162
+ "name": "key",
2163
+ "type": {
2164
+ "text": "string"
2165
+ },
2166
+ "privacy": "public",
2167
+ "readonly": true
2168
+ },
2169
+ {
2170
+ "kind": "field",
2171
+ "name": "location",
2172
+ "type": {
2173
+ "text": "number"
2174
+ },
2175
+ "privacy": "public",
2176
+ "readonly": true
2177
+ },
2178
+ {
2179
+ "kind": "field",
2180
+ "name": "metaKey",
2181
+ "type": {
2182
+ "text": "boolean"
2183
+ },
2184
+ "privacy": "public",
2185
+ "readonly": true
2186
+ },
2187
+ {
2188
+ "kind": "field",
2189
+ "name": "repeat",
2190
+ "type": {
2191
+ "text": "boolean"
2192
+ },
2193
+ "privacy": "public",
2194
+ "readonly": true
2195
+ },
2196
+ {
2197
+ "kind": "field",
2198
+ "name": "shiftKey",
2199
+ "type": {
2200
+ "text": "boolean"
2201
+ },
2202
+ "privacy": "public",
2203
+ "readonly": true
2204
+ }
2205
+ ],
2206
+ "superclass": {
2207
+ "name": "KeyboardEvent",
2208
+ "module": "src/MenuItem.ts"
2209
+ }
2210
+ },
2048
2211
  {
2049
2212
  "kind": "class",
2050
2213
  "description": "",
@@ -2087,6 +2250,7 @@
2087
2250
  },
2088
2251
  "privacy": "public",
2089
2252
  "default": "false",
2253
+ "description": "whether the menu item is active or has an active descendant",
2090
2254
  "attribute": "active",
2091
2255
  "reflects": true
2092
2256
  },
@@ -2104,6 +2268,7 @@
2104
2268
  },
2105
2269
  "privacy": "public",
2106
2270
  "default": "false",
2271
+ "description": "whether the menu item has keyboard focus",
2107
2272
  "attribute": "focused",
2108
2273
  "reflects": true
2109
2274
  },
@@ -2115,6 +2280,7 @@
2115
2280
  },
2116
2281
  "privacy": "public",
2117
2282
  "default": "false",
2283
+ "description": "whether the menu item is selected",
2118
2284
  "attribute": "selected",
2119
2285
  "reflects": true
2120
2286
  },
@@ -2125,6 +2291,7 @@
2125
2291
  "text": "string"
2126
2292
  },
2127
2293
  "privacy": "public",
2294
+ "description": "value of the menu item which is used for selection",
2128
2295
  "attribute": "value"
2129
2296
  },
2130
2297
  {
@@ -2153,6 +2320,7 @@
2153
2320
  },
2154
2321
  "privacy": "public",
2155
2322
  "default": "false",
2323
+ "description": "whether the menu item has a submenu",
2156
2324
  "attribute": "has-submenu",
2157
2325
  "reflects": true
2158
2326
  },
@@ -2178,6 +2346,7 @@
2178
2346
  },
2179
2347
  "privacy": "public",
2180
2348
  "default": "false",
2349
+ "description": "whether menu item text content should not wrap",
2181
2350
  "attribute": "no-wrap",
2182
2351
  "reflects": true
2183
2352
  },
@@ -2212,6 +2381,7 @@
2212
2381
  "text": "HTMLElement"
2213
2382
  },
2214
2383
  "privacy": "public",
2384
+ "description": "the focusable element of the menu item",
2215
2385
  "readonly": true
2216
2386
  },
2217
2387
  {
@@ -2248,19 +2418,10 @@
2248
2418
  },
2249
2419
  "privacy": "public",
2250
2420
  "default": "false",
2421
+ "description": "whether submenu is open",
2251
2422
  "attribute": "open",
2252
2423
  "reflects": true
2253
2424
  },
2254
- {
2255
- "kind": "method",
2256
- "name": "click",
2257
- "privacy": "public",
2258
- "return": {
2259
- "type": {
2260
- "text": "void"
2261
- }
2262
- }
2263
- },
2264
2425
  {
2265
2426
  "kind": "method",
2266
2427
  "name": "handleClickCapture",
@@ -2335,7 +2496,8 @@
2335
2496
  "text": "Event & { target: HTMLSlotElement }"
2336
2497
  }
2337
2498
  }
2338
- ]
2499
+ ],
2500
+ "description": "determines if item has a submenu and updates the `aria-haspopup` attribute"
2339
2501
  },
2340
2502
  {
2341
2503
  "kind": "method",
@@ -2355,6 +2517,11 @@
2355
2517
  }
2356
2518
  ]
2357
2519
  },
2520
+ {
2521
+ "kind": "field",
2522
+ "name": "handleKeydown",
2523
+ "description": "forward key info from keydown event to parent menu"
2524
+ },
2358
2525
  {
2359
2526
  "kind": "method",
2360
2527
  "name": "closeOverlaysForRoot",
@@ -2365,6 +2532,42 @@
2365
2532
  }
2366
2533
  }
2367
2534
  },
2535
+ {
2536
+ "kind": "method",
2537
+ "name": "handleFocus",
2538
+ "privacy": "protected",
2539
+ "return": {
2540
+ "type": {
2541
+ "text": "void"
2542
+ }
2543
+ },
2544
+ "parameters": [
2545
+ {
2546
+ "name": "event",
2547
+ "type": {
2548
+ "text": "FocusEvent"
2549
+ }
2550
+ }
2551
+ ]
2552
+ },
2553
+ {
2554
+ "kind": "method",
2555
+ "name": "handleBlur",
2556
+ "privacy": "protected",
2557
+ "return": {
2558
+ "type": {
2559
+ "text": "void"
2560
+ }
2561
+ },
2562
+ "parameters": [
2563
+ {
2564
+ "name": "event",
2565
+ "type": {
2566
+ "text": "FocusEvent"
2567
+ }
2568
+ }
2569
+ ]
2570
+ },
2368
2571
  {
2369
2572
  "kind": "method",
2370
2573
  "name": "handleSubmenuClick",
@@ -2565,6 +2768,26 @@
2565
2768
  }
2566
2769
  }
2567
2770
  },
2771
+ {
2772
+ "kind": "method",
2773
+ "name": "focus",
2774
+ "privacy": "public",
2775
+ "return": {
2776
+ "type": {
2777
+ "text": "void"
2778
+ }
2779
+ }
2780
+ },
2781
+ {
2782
+ "kind": "method",
2783
+ "name": "blur",
2784
+ "privacy": "public",
2785
+ "return": {
2786
+ "type": {
2787
+ "text": "void"
2788
+ }
2789
+ }
2790
+ },
2568
2791
  {
2569
2792
  "kind": "method",
2570
2793
  "name": "dispatchUpdate",
@@ -2582,10 +2805,22 @@
2582
2805
  "text": "{\n focusRoot?: Menu;\n parentMenu?: Menu;\n selectionRoot?: Menu;\n cleanupSteps: ((item: MenuItem) => void)[];\n }"
2583
2806
  },
2584
2807
  "privacy": "public",
2585
- "default": "{\n focusRoot: undefined,\n parentMenu: undefined,\n selectionRoot: undefined,\n cleanupSteps: [],\n }"
2808
+ "default": "{\n // menu that controls ArrowUp/ArrowDown navigation\n focusRoot: undefined,\n parentMenu: undefined,\n // menu or menu group that controls selection\n selectionRoot: undefined,\n cleanupSteps: [],\n }"
2586
2809
  }
2587
2810
  ],
2588
2811
  "events": [
2812
+ {
2813
+ "name": "focus",
2814
+ "type": {
2815
+ "text": "FocusEvent"
2816
+ }
2817
+ },
2818
+ {
2819
+ "name": "blur",
2820
+ "type": {
2821
+ "text": "FocusEvent"
2822
+ }
2823
+ },
2589
2824
  {
2590
2825
  "type": {
2591
2826
  "text": "MenuItemAddedOrUpdatedEvent"
@@ -2603,6 +2838,7 @@
2603
2838
  "text": "boolean"
2604
2839
  },
2605
2840
  "default": "false",
2841
+ "description": "whether the menu item is active or has an active descendant",
2606
2842
  "fieldName": "active"
2607
2843
  },
2608
2844
  {
@@ -2611,6 +2847,7 @@
2611
2847
  "text": "boolean"
2612
2848
  },
2613
2849
  "default": "false",
2850
+ "description": "whether the menu item has keyboard focus",
2614
2851
  "fieldName": "focused"
2615
2852
  },
2616
2853
  {
@@ -2619,6 +2856,7 @@
2619
2856
  "text": "boolean"
2620
2857
  },
2621
2858
  "default": "false",
2859
+ "description": "whether the menu item is selected",
2622
2860
  "fieldName": "selected"
2623
2861
  },
2624
2862
  {
@@ -2626,6 +2864,7 @@
2626
2864
  "type": {
2627
2865
  "text": "string"
2628
2866
  },
2867
+ "description": "value of the menu item which is used for selection",
2629
2868
  "fieldName": "value"
2630
2869
  },
2631
2870
  {
@@ -2634,6 +2873,7 @@
2634
2873
  "text": "boolean"
2635
2874
  },
2636
2875
  "default": "false",
2876
+ "description": "whether the menu item has a submenu",
2637
2877
  "fieldName": "hasSubmenu"
2638
2878
  },
2639
2879
  {
@@ -2642,6 +2882,7 @@
2642
2882
  "text": "boolean"
2643
2883
  },
2644
2884
  "default": "false",
2885
+ "description": "whether menu item text content should not wrap",
2645
2886
  "fieldName": "noWrap"
2646
2887
  },
2647
2888
  {
@@ -2650,6 +2891,7 @@
2650
2891
  "text": "boolean"
2651
2892
  },
2652
2893
  "default": "false",
2894
+ "description": "whether submenu is open",
2653
2895
  "fieldName": "open"
2654
2896
  }
2655
2897
  ],
@@ -2684,6 +2926,14 @@
2684
2926
  "module": "src/MenuItem.js"
2685
2927
  }
2686
2928
  },
2929
+ {
2930
+ "kind": "js",
2931
+ "name": "MenuItemKeydownEvent",
2932
+ "declaration": {
2933
+ "name": "MenuItemKeydownEvent",
2934
+ "module": "src/MenuItem.js"
2935
+ }
2936
+ },
2687
2937
  {
2688
2938
  "kind": "js",
2689
2939
  "name": "MenuItem",