mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-04-01 09:27:14 +08:00
committed by
Nicolas Gallagher
parent
9d5a41c702
commit
b144992f51
@@ -7,24 +7,68 @@
|
||||
* @flow
|
||||
*/
|
||||
|
||||
import { oneOf, string } from 'prop-types';
|
||||
import { oneOf, oneOfType, string } from 'prop-types';
|
||||
|
||||
const cursorEnum = [
|
||||
'auto',
|
||||
'default',
|
||||
'none',
|
||||
'context-menu',
|
||||
'help',
|
||||
'pointer',
|
||||
'progress',
|
||||
'wait',
|
||||
'cell',
|
||||
'crosshair',
|
||||
'text',
|
||||
'vertical-text',
|
||||
'alias',
|
||||
'copy',
|
||||
'move',
|
||||
'no-drop',
|
||||
'not-allowed',
|
||||
'e-resize',
|
||||
'n-resize',
|
||||
'ne-resize',
|
||||
'nw-resize',
|
||||
's-resize',
|
||||
'se-resize',
|
||||
'sw-resize',
|
||||
'w-resize',
|
||||
'ew-resize',
|
||||
'ns-resize',
|
||||
'nesw-resize',
|
||||
'nwse-resize',
|
||||
'col-resize',
|
||||
'row-resize',
|
||||
'all-scroll',
|
||||
'zoom-in',
|
||||
'zoom-out',
|
||||
'grab',
|
||||
'grabbing '
|
||||
];
|
||||
const touchActionEnum = [
|
||||
'auto',
|
||||
'inherit',
|
||||
'manipulation',
|
||||
'none',
|
||||
'pan-down',
|
||||
'pan-left',
|
||||
'pan-right',
|
||||
'pan-up',
|
||||
'pan-x',
|
||||
'pan-y',
|
||||
'pinch-zoom'
|
||||
];
|
||||
const userSelectEnum = ['auto', 'text', 'none', 'contain', 'all'];
|
||||
|
||||
const InteractionPropTypes = {
|
||||
cursor: string,
|
||||
touchAction: oneOf([
|
||||
'auto',
|
||||
'inherit',
|
||||
'manipulation',
|
||||
'none',
|
||||
'pan-down',
|
||||
'pan-left',
|
||||
'pan-right',
|
||||
'pan-up',
|
||||
'pan-x',
|
||||
'pan-y',
|
||||
'pinch-zoom'
|
||||
]),
|
||||
userSelect: string,
|
||||
// https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Formal_syntax
|
||||
cursor: oneOfType([string, oneOf(cursorEnum)]),
|
||||
// https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action#Formal_syntax
|
||||
touchAction: oneOf(touchActionEnum),
|
||||
// https://developer.mozilla.org/en-US/docs/Web/CSS/user-select#Formal_syntax_2
|
||||
userSelect: oneOf(userSelectEnum),
|
||||
willChange: string
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user