Common enums used in the project -DRY
This is not all of them, just those found during the select rework.
This commit is contained in:
parent
899ad697b0
commit
16bfce1652
1 changed files with 40 additions and 0 deletions
40
src/utils/enums.js
Normal file
40
src/utils/enums.js
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
import {
|
||||||
|
BOTTOM,
|
||||||
|
DEFAULT,
|
||||||
|
LARGE,
|
||||||
|
SMALL,
|
||||||
|
TOP
|
||||||
|
} from './constants';
|
||||||
|
import {
|
||||||
|
ALT,
|
||||||
|
ARROWLEFT,
|
||||||
|
ARROWRIGHT,
|
||||||
|
CAPSLOCK,
|
||||||
|
CONTROL,
|
||||||
|
ENTER,
|
||||||
|
META,
|
||||||
|
SHIFT,
|
||||||
|
TAB,
|
||||||
|
} from './kbEventKeys';
|
||||||
|
|
||||||
|
export const PLACEMENT_LIST = Object.freeze([BOTTOM, TOP]);
|
||||||
|
export const PLACEMENT_MAP = Object.freeze({
|
||||||
|
[BOTTOM]: TOP,
|
||||||
|
[TOP]: BOTTOM,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const SMALL_LARGE_DEFAULT_LIST = Object.freeze([SMALL, LARGE, DEFAULT]);
|
||||||
|
export const STRING_NUMBER_LIST = Object.freeze([String, Number]);
|
||||||
|
export const STRING_NUMBER_ARRAY_LIST = Object.freeze([String, Number, Array]);
|
||||||
|
|
||||||
|
export const IGNORE_KEY_LIST = Object.freeze([
|
||||||
|
ALT,
|
||||||
|
ARROWLEFT,
|
||||||
|
ARROWRIGHT,
|
||||||
|
CAPSLOCK,
|
||||||
|
CONTROL,
|
||||||
|
ENTER,
|
||||||
|
META,
|
||||||
|
SHIFT,
|
||||||
|
TAB,
|
||||||
|
]);
|
Loading…
Add table
Reference in a new issue