eventHandlers.js 1.5 KB

1234567891011121314151617181920212223242526272829303132
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. /**
  6. * Common event handlers for JSX element event binding.
  7. */
  8. var eventHandlersByType = {
  9. clipboard: ['onCopy', 'onCut', 'onPaste'],
  10. composition: ['onCompositionEnd', 'onCompositionStart', 'onCompositionUpdate'],
  11. keyboard: ['onKeyDown', 'onKeyPress', 'onKeyUp'],
  12. focus: ['onFocus', 'onBlur'],
  13. form: ['onChange', 'onInput', 'onSubmit'],
  14. mouse: ['onClick', 'onContextMenu', 'onDblClick', 'onDoubleClick', 'onDrag', 'onDragEnd', 'onDragEnter', 'onDragExit', 'onDragLeave', 'onDragOver', 'onDragStart', 'onDrop', 'onMouseDown', 'onMouseEnter', 'onMouseLeave', 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp'],
  15. selection: ['onSelect'],
  16. touch: ['onTouchCancel', 'onTouchEnd', 'onTouchMove', 'onTouchStart'],
  17. ui: ['onScroll'],
  18. wheel: ['onWheel'],
  19. media: ['onAbort', 'onCanPlay', 'onCanPlayThrough', 'onDurationChange', 'onEmptied', 'onEncrypted', 'onEnded', 'onError', 'onLoadedData', 'onLoadedMetadata', 'onLoadStart', 'onPause', 'onPlay', 'onPlaying', 'onProgress', 'onRateChange', 'onSeeked', 'onSeeking', 'onStalled', 'onSuspend', 'onTimeUpdate', 'onVolumeChange', 'onWaiting'],
  20. image: ['onLoad', 'onError'],
  21. animation: ['onAnimationStart', 'onAnimationEnd', 'onAnimationIteration'],
  22. transition: ['onTransitionEnd']
  23. };
  24. var eventHandlers = Object.keys(eventHandlersByType).reduce(function (accumulator, type) {
  25. return accumulator.concat(eventHandlersByType[type]);
  26. }, []);
  27. exports.default = eventHandlers;
  28. exports.eventHandlersByType = eventHandlersByType;