main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
1.7 KB
|
Line | |
---|
1 | import flat from 'array.prototype.flat';
|
---|
2 | import values from 'object.values';
|
---|
3 |
|
---|
4 | /**
|
---|
5 | * Common event handlers for JSX element event binding.
|
---|
6 | */
|
---|
7 |
|
---|
8 | const eventHandlersByType = {
|
---|
9 | clipboard: [
|
---|
10 | 'onCopy',
|
---|
11 | 'onCut',
|
---|
12 | 'onPaste',
|
---|
13 | ],
|
---|
14 | composition: [
|
---|
15 | 'onCompositionEnd',
|
---|
16 | 'onCompositionStart',
|
---|
17 | 'onCompositionUpdate',
|
---|
18 | ],
|
---|
19 | keyboard: [
|
---|
20 | 'onKeyDown',
|
---|
21 | 'onKeyPress',
|
---|
22 | 'onKeyUp',
|
---|
23 | ],
|
---|
24 | focus: [
|
---|
25 | 'onFocus',
|
---|
26 | 'onBlur',
|
---|
27 | ],
|
---|
28 | form: [
|
---|
29 | 'onChange',
|
---|
30 | 'onInput',
|
---|
31 | 'onSubmit',
|
---|
32 | ],
|
---|
33 | mouse: [
|
---|
34 | 'onClick',
|
---|
35 | 'onContextMenu',
|
---|
36 | 'onDblClick',
|
---|
37 | 'onDoubleClick',
|
---|
38 | 'onDrag',
|
---|
39 | 'onDragEnd',
|
---|
40 | 'onDragEnter',
|
---|
41 | 'onDragExit',
|
---|
42 | 'onDragLeave',
|
---|
43 | 'onDragOver',
|
---|
44 | 'onDragStart',
|
---|
45 | 'onDrop',
|
---|
46 | 'onMouseDown',
|
---|
47 | 'onMouseEnter',
|
---|
48 | 'onMouseLeave',
|
---|
49 | 'onMouseMove',
|
---|
50 | 'onMouseOut',
|
---|
51 | 'onMouseOver',
|
---|
52 | 'onMouseUp',
|
---|
53 | ],
|
---|
54 | selection: [
|
---|
55 | 'onSelect',
|
---|
56 | ],
|
---|
57 | touch: [
|
---|
58 | 'onTouchCancel',
|
---|
59 | 'onTouchEnd',
|
---|
60 | 'onTouchMove',
|
---|
61 | 'onTouchStart',
|
---|
62 | ],
|
---|
63 | ui: [
|
---|
64 | 'onScroll',
|
---|
65 | ],
|
---|
66 | wheel: [
|
---|
67 | 'onWheel',
|
---|
68 | ],
|
---|
69 | media: [
|
---|
70 | 'onAbort',
|
---|
71 | 'onCanPlay',
|
---|
72 | 'onCanPlayThrough',
|
---|
73 | 'onDurationChange',
|
---|
74 | 'onEmptied',
|
---|
75 | 'onEncrypted',
|
---|
76 | 'onEnded',
|
---|
77 | 'onError',
|
---|
78 | 'onLoadedData',
|
---|
79 | 'onLoadedMetadata',
|
---|
80 | 'onLoadStart',
|
---|
81 | 'onPause',
|
---|
82 | 'onPlay',
|
---|
83 | 'onPlaying',
|
---|
84 | 'onProgress',
|
---|
85 | 'onRateChange',
|
---|
86 | 'onSeeked',
|
---|
87 | 'onSeeking',
|
---|
88 | 'onStalled',
|
---|
89 | 'onSuspend',
|
---|
90 | 'onTimeUpdate',
|
---|
91 | 'onVolumeChange',
|
---|
92 | 'onWaiting',
|
---|
93 | ],
|
---|
94 | image: [
|
---|
95 | 'onLoad',
|
---|
96 | 'onError',
|
---|
97 | ],
|
---|
98 | animation: [
|
---|
99 | 'onAnimationStart',
|
---|
100 | 'onAnimationEnd',
|
---|
101 | 'onAnimationIteration',
|
---|
102 | ],
|
---|
103 | transition: [
|
---|
104 | 'onTransitionEnd',
|
---|
105 | ],
|
---|
106 | };
|
---|
107 |
|
---|
108 | export default flat(values(eventHandlersByType));
|
---|
109 |
|
---|
110 | export { eventHandlersByType };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.