UNPKG

4.25 kBJavaScriptView Raw
1/**
2 * @license
3 * Copyright 2016 Google Inc.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 * THE SOFTWARE.
22 */
23export var Direction;
24(function (Direction) {
25 Direction["LEFT"] = "left";
26 Direction["RIGHT"] = "right";
27})(Direction || (Direction = {}));
28export var EventSource;
29(function (EventSource) {
30 EventSource["PRIMARY"] = "primary";
31 EventSource["TRAILING"] = "trailing";
32 EventSource["NONE"] = "none";
33})(EventSource || (EventSource = {}));
34export var strings = {
35 ADDED_ANNOUNCEMENT_ATTRIBUTE: 'data-mdc-chip-added-announcement',
36 ARIA_CHECKED: 'aria-checked',
37 ARROW_DOWN_KEY: 'ArrowDown',
38 ARROW_LEFT_KEY: 'ArrowLeft',
39 ARROW_RIGHT_KEY: 'ArrowRight',
40 ARROW_UP_KEY: 'ArrowUp',
41 BACKSPACE_KEY: 'Backspace',
42 CHECKMARK_SELECTOR: '.mdc-chip__checkmark',
43 DELETE_KEY: 'Delete',
44 END_KEY: 'End',
45 ENTER_KEY: 'Enter',
46 ENTRY_ANIMATION_NAME: 'mdc-chip-entry',
47 HOME_KEY: 'Home',
48 IE_ARROW_DOWN_KEY: 'Down',
49 IE_ARROW_LEFT_KEY: 'Left',
50 IE_ARROW_RIGHT_KEY: 'Right',
51 IE_ARROW_UP_KEY: 'Up',
52 IE_DELETE_KEY: 'Del',
53 INTERACTION_EVENT: 'MDCChip:interaction',
54 LEADING_ICON_SELECTOR: '.mdc-chip__icon--leading',
55 NAVIGATION_EVENT: 'MDCChip:navigation',
56 PRIMARY_ACTION_SELECTOR: '.mdc-chip__primary-action',
57 REMOVED_ANNOUNCEMENT_ATTRIBUTE: 'data-mdc-chip-removed-announcement',
58 REMOVAL_EVENT: 'MDCChip:removal',
59 SELECTION_EVENT: 'MDCChip:selection',
60 SPACEBAR_KEY: ' ',
61 TAB_INDEX: 'tabindex',
62 TRAILING_ACTION_SELECTOR: '.mdc-chip-trailing-action',
63 TRAILING_ICON_INTERACTION_EVENT: 'MDCChip:trailingIconInteraction',
64 TRAILING_ICON_SELECTOR: '.mdc-chip__icon--trailing',
65};
66export var cssClasses = {
67 CHECKMARK: 'mdc-chip__checkmark',
68 CHIP_EXIT: 'mdc-chip--exit',
69 DELETABLE: 'mdc-chip--deletable',
70 EDITABLE: 'mdc-chip--editable',
71 EDITING: 'mdc-chip--editing',
72 HIDDEN_LEADING_ICON: 'mdc-chip__icon--leading-hidden',
73 LEADING_ICON: 'mdc-chip__icon--leading',
74 PRIMARY_ACTION: 'mdc-chip__primary-action',
75 PRIMARY_ACTION_FOCUSED: 'mdc-chip--primary-action-focused',
76 SELECTED: 'mdc-chip--selected',
77 TEXT: 'mdc-chip__text',
78 TRAILING_ACTION: 'mdc-chip__trailing-action',
79 TRAILING_ICON: 'mdc-chip__icon--trailing',
80};
81export var navigationKeys = new Set();
82// IE11 has no support for new Set with iterable so we need to initialize this by hand
83navigationKeys.add(strings.ARROW_LEFT_KEY);
84navigationKeys.add(strings.ARROW_RIGHT_KEY);
85navigationKeys.add(strings.ARROW_DOWN_KEY);
86navigationKeys.add(strings.ARROW_UP_KEY);
87navigationKeys.add(strings.END_KEY);
88navigationKeys.add(strings.HOME_KEY);
89navigationKeys.add(strings.IE_ARROW_LEFT_KEY);
90navigationKeys.add(strings.IE_ARROW_RIGHT_KEY);
91navigationKeys.add(strings.IE_ARROW_DOWN_KEY);
92navigationKeys.add(strings.IE_ARROW_UP_KEY);
93export var jumpChipKeys = new Set();
94// IE11 has no support for new Set with iterable so we need to initialize this by hand
95jumpChipKeys.add(strings.ARROW_UP_KEY);
96jumpChipKeys.add(strings.ARROW_DOWN_KEY);
97jumpChipKeys.add(strings.HOME_KEY);
98jumpChipKeys.add(strings.END_KEY);
99jumpChipKeys.add(strings.IE_ARROW_UP_KEY);
100jumpChipKeys.add(strings.IE_ARROW_DOWN_KEY);
101//# sourceMappingURL=constants.js.map
\No newline at end of file