eventHandlers.js 1.8 KB

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