File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed
src/components/MTableCell Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -6,22 +6,32 @@ import { getRenderValue, getStyle } from './utils';
6
6
/* eslint-enable no-unused-vars */
7
7
8
8
function MTableCell ( props ) {
9
+ const {
10
+ forwardedRef,
11
+ scrollWidth,
12
+ rowData,
13
+ onCellEditStarted,
14
+ cellEditable,
15
+ columnDef,
16
+ errorState,
17
+ ...spreadProps
18
+ } = props ;
9
19
const handleClickCell = ( e ) => {
10
20
if ( props . columnDef . disableClick ) {
11
21
e . stopPropagation ( ) ;
12
22
}
13
23
} ;
14
24
15
25
const cellAlignment =
16
- props . columnDef . align !== undefined
17
- ? props . columnDef . align
18
- : [ 'numeric' , 'currency' ] . indexOf ( props . columnDef . type ) !== - 1
26
+ columnDef . align !== undefined
27
+ ? columnDef . align
28
+ : [ 'numeric' , 'currency' ] . indexOf ( columnDef . type ) !== - 1
19
29
? 'right'
20
30
: 'left' ;
21
31
22
32
let renderValue = getRenderValue ( props ) ;
23
33
24
- if ( props . cellEditable ) {
34
+ if ( cellEditable ) {
25
35
renderValue = (
26
36
< div
27
37
style = { {
@@ -31,7 +41,7 @@ function MTableCell(props) {
31
41
} }
32
42
onClick = { ( e ) => {
33
43
e . stopPropagation ( ) ;
34
- props . onCellEditStarted ( props . rowData , props . columnDef ) ;
44
+ onCellEditStarted ( rowData , columnDef ) ;
35
45
} }
36
46
>
37
47
{ renderValue }
@@ -41,13 +51,13 @@ function MTableCell(props) {
41
51
42
52
return (
43
53
< TableCell
44
- { ...props }
54
+ { ...spreadProps }
45
55
size = { props . size }
46
56
value = { props . value }
47
57
style = { getStyle ( props ) }
48
58
align = { cellAlignment }
49
59
onClick = { handleClickCell }
50
- ref = { props . forwardedRef }
60
+ ref = { forwardedRef }
51
61
colSpan = { props . colSpan }
52
62
>
53
63
{ props . children }
You can’t perform that action at this time.
0 commit comments