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 { MDCChipInteractionEventDetail, MDCChipNavigationEventDetail, MDCChipRemovalEventDetail, MDCChipSelectionEventDetail } from '../chip/types';
|
25 | import { MDCChipSetAdapter } from './adapter';
|
26 | export declare class MDCChipSetFoundation extends MDCFoundation<MDCChipSetAdapter> {
|
27 | static get strings(): {
|
28 | CHIP_SELECTOR: string;
|
29 | };
|
30 | static get cssClasses(): {
|
31 | CHOICE: string;
|
32 | FILTER: string;
|
33 | };
|
34 | static get defaultAdapter(): MDCChipSetAdapter;
|
35 | |
36 |
|
37 |
|
38 | private selectedChipIds;
|
39 | constructor(adapter?: Partial<MDCChipSetAdapter>);
|
40 | /**
|
41 | * Returns an array of the IDs of all selected chips.
|
42 | */
|
43 | getSelectedChipIds(): ReadonlyArray<string>;
|
44 | /**
|
45 | * Selects the chip with the given id. Deselects all other chips if the chip set is of the choice variant.
|
46 | * Does not notify clients of the updated selection state.
|
47 | */
|
48 | select(chipId: string): void;
|
49 | /**
|
50 | * Handles a chip interaction event
|
51 | */
|
52 | handleChipInteraction({ chipId }: MDCChipInteractionEventDetail): void;
|
53 | /**
|
54 | * Handles a chip selection event, used to handle discrepancy when selection state is set directly on the Chip.
|
55 | */
|
56 | handleChipSelection({ chipId, selected, shouldIgnore }: MDCChipSelectionEventDetail): void;
|
57 | /**
|
58 | * Handles the event when a chip is removed.
|
59 | */
|
60 | handleChipRemoval({ chipId, removedAnnouncement }: MDCChipRemovalEventDetail): void;
|
61 | /**
|
62 | * Handles a chip navigation event.
|
63 | */
|
64 | handleChipNavigation({ chipId, key, source }: MDCChipNavigationEventDetail): void;
|
65 | private focusChipAction;
|
66 | private getDirection;
|
67 | /**
|
68 | * Deselects the chip with the given id and optionally notifies clients.
|
69 | */
|
70 | private deselectImpl;
|
71 | /**
|
72 | * Deselects the chip with the given id and notifies clients.
|
73 | */
|
74 | private deselectAndNotifyClients;
|
75 | /**
|
76 | * Toggles selection of the chip with the given id.
|
77 | */
|
78 | private toggleSelect;
|
79 | private removeFocusFromChipsExcept;
|
80 | private selectAndNotifyClients;
|
81 | private selectImpl;
|
82 | }
|
83 | export default MDCChipSetFoundation;
|