Commit 16bfce165211ebeda7a67aa8a7d9ecd19bc42bfa
1 parent
899ad697
Common enums used in the project -DRY
This is not all of them, just those found during the select rework.
Showing
1 changed file
with
40 additions
and
0 deletions
Show diff stats
1 | +import { | |
2 | + BOTTOM, | |
3 | + DEFAULT, | |
4 | + LARGE, | |
5 | + SMALL, | |
6 | + TOP | |
7 | +} from './constants'; | |
8 | +import { | |
9 | + ALT, | |
10 | + ARROWLEFT, | |
11 | + ARROWRIGHT, | |
12 | + CAPSLOCK, | |
13 | + CONTROL, | |
14 | + ENTER, | |
15 | + META, | |
16 | + SHIFT, | |
17 | + TAB, | |
18 | +} from './kbEventKeys'; | |
19 | + | |
20 | +export const PLACEMENT_LIST = Object.freeze([BOTTOM, TOP]); | |
21 | +export const PLACEMENT_MAP = Object.freeze({ | |
22 | + [BOTTOM]: TOP, | |
23 | + [TOP]: BOTTOM, | |
24 | +}); | |
25 | + | |
26 | +export const SMALL_LARGE_DEFAULT_LIST = Object.freeze([SMALL, LARGE, DEFAULT]); | |
27 | +export const STRING_NUMBER_LIST = Object.freeze([String, Number]); | |
28 | +export const STRING_NUMBER_ARRAY_LIST = Object.freeze([String, Number, Array]); | |
29 | + | |
30 | +export const IGNORE_KEY_LIST = Object.freeze([ | |
31 | + ALT, | |
32 | + ARROWLEFT, | |
33 | + ARROWRIGHT, | |
34 | + CAPSLOCK, | |
35 | + CONTROL, | |
36 | + ENTER, | |
37 | + META, | |
38 | + SHIFT, | |
39 | + TAB, | |
40 | +]); | ... | ... |