@@ -2,12 +2,14 @@ import React, { PropTypes } from 'react';
22import { Input } from './Input' ;
33import { gridConfig } from './../../../../../constants/GridConstants' ;
44import { prefix } from './../../../../../util/prefix' ;
5+ import { fireEvent } from './../../../../../util/fire' ;
56import { nameFromDataIndex } from './../../../../../util/getData' ;
67
78export const Editor = ( {
89 cellData,
910 columns,
1011 editorState,
12+ events,
1113 rawValue,
1214 index,
1315 isEditable,
@@ -58,6 +60,26 @@ export const Editor = ({
5860 invalid ? CLASS_NAMES . EDITOR . INVALID : ''
5961 ) ;
6062
63+ const onFocus = ( ) => fireEvent (
64+ 'HANDLE_EDITOR_FOCUS' ,
65+ events ,
66+ {
67+ column : columns [ index ] ,
68+ rowId,
69+ editor : editorData
70+ }
71+ ) ;
72+
73+ const onBlur = ( ) => fireEvent (
74+ 'HANDLE_EDITOR_BLUR' ,
75+ events ,
76+ {
77+ column : columns [ index ] ,
78+ rowId,
79+ editor : editorData
80+ }
81+ ) ;
82+
6183 if ( isEditable
6284 && columns [ index ]
6385 && columns [ index ] . editor
@@ -73,6 +95,8 @@ export const Editor = ({
7395 columns,
7496 store,
7597 rowId,
98+ onFocus,
99+ onBlur,
76100 row : editorData && editorData . values && editorData . toJS
77101 ? { ...row , ...cleanProps ( editorData . values . toJS ( ) ) }
78102 : { key : rowId , ...row } ,
@@ -104,6 +128,8 @@ export const Editor = ({
104128 column = { columns [ index ] }
105129 columns = { columns }
106130 editorState = { editorState }
131+ onBlur = { onBlur }
132+ onFocus = { onFocus }
107133 rowId = { rowId }
108134 stateKey = { stateKey }
109135 store = { store }
@@ -130,6 +156,7 @@ Editor.propTypes = {
130156 cellData : any ,
131157 columns : array ,
132158 editorState : object ,
159+ events : object ,
133160 index : number ,
134161 isEditable : bool ,
135162 isRowSelected : bool ,
0 commit comments