1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | import { MDCFoundation } from '@material/base/foundation';
|
24 | import { MDCMenuAdapter } from './adapter';
|
25 | import { DefaultFocusState } from './constants';
|
26 | export declare class MDCMenuFoundation extends MDCFoundation<MDCMenuAdapter> {
|
27 | static get cssClasses(): {
|
28 | MENU_SELECTED_LIST_ITEM: string;
|
29 | MENU_SELECTION_GROUP: string;
|
30 | ROOT: string;
|
31 | };
|
32 | static get strings(): {
|
33 | ARIA_CHECKED_ATTR: string;
|
34 | ARIA_DISABLED_ATTR: string;
|
35 | CHECKBOX_SELECTOR: string;
|
36 | LIST_SELECTOR: string;
|
37 | SELECTED_EVENT: string;
|
38 | SKIP_RESTORE_FOCUS: string;
|
39 | };
|
40 | static get numbers(): {
|
41 | FOCUS_ROOT_INDEX: number;
|
42 | };
|
43 | private closeAnimationEndTimerId;
|
44 | private defaultFocusState;
|
45 | private selectedIndex;
|
46 | |
47 |
|
48 |
|
49 | static get defaultAdapter(): MDCMenuAdapter;
|
50 | constructor(adapter?: Partial<MDCMenuAdapter>);
|
51 | destroy(): void;
|
52 | handleKeydown(evt: KeyboardEvent): void;
|
53 | handleItemAction(listItem: Element): void;
|
54 | handleMenuSurfaceOpened(): void;
|
55 | /**
|
56 | * Sets default focus state where the menu should focus every time when menu
|
57 | * is opened. Focuses the list root (`DefaultFocusState.LIST_ROOT`) element by
|
58 | * default.
|
59 | */
|
60 | setDefaultFocusState(focusState: DefaultFocusState): void;
|
61 | /** @return Index of the currently selected list item within the menu. */
|
62 | getSelectedIndex(): number;
|
63 | /**
|
64 | * Selects the list item at `index` within the menu.
|
65 | * @param index Index of list item within the menu.
|
66 | */
|
67 | setSelectedIndex(index: number): void;
|
68 | /**
|
69 | * Sets the enabled state to isEnabled for the menu item at the given index.
|
70 | * @param index Index of the menu item
|
71 | * @param isEnabled The desired enabled state of the menu item.
|
72 | */
|
73 | setEnabled(index: number, isEnabled: boolean): void;
|
74 | private validatedIndex;
|
75 | }
|
76 | export default MDCMenuFoundation;
|