@@ -32,11 +32,11 @@ export interface TableColumnResizeState<T> {
32
32
* Called to update the state that a resize event has occurred.
33
33
* Returns the new widths for all columns based on the resized column.
34
34
*/
35
- onColumnResize : ( key : Key , width : number ) => Map < Key , ColumnSize > ,
35
+ updateResizedColumns : ( key : Key , width : number ) => Map < Key , ColumnSize > ,
36
36
/** Callback for when onColumnResize has started. */
37
- onColumnResizeStart : ( key : Key ) => void ,
37
+ startResize : ( key : Key ) => void ,
38
38
/** Callback for when onColumnResize has ended. */
39
- onColumnResizeEnd : ( ) => void ,
39
+ endResize : ( ) => void ,
40
40
/** Gets the current width for the specified column. */
41
41
getColumnWidth : ( key : Key ) => number ,
42
42
/** Gets the current minWidth for the specified column. */
@@ -87,11 +87,11 @@ export function useTableColumnResizeState<T>(props: TableColumnResizeStateProps<
87
87
columnLayout . recombineColumns ( state . collection . columns , uncontrolledWidths , uncontrolledColumns , controlledColumns )
88
88
, [ state . collection . columns , uncontrolledWidths , uncontrolledColumns , controlledColumns , columnLayout ] ) ;
89
89
90
- let onColumnResizeStart = useCallback ( ( key : Key ) => {
90
+ let startResize = useCallback ( ( key : Key ) => {
91
91
setResizingColumn ( key ) ;
92
92
} , [ setResizingColumn ] ) ;
93
93
94
- let onColumnResize = useCallback ( ( key : Key , width : number ) : Map < Key , ColumnSize > => {
94
+ let updateResizedColumns = useCallback ( ( key : Key , width : number ) : Map < Key , ColumnSize > => {
95
95
let newControlled = new Map ( Array . from ( controlledColumns ) . map ( ( [ key , entry ] ) => [ key , entry . props . width ] ) ) ;
96
96
let newSizes = columnLayout . resizeColumnWidth ( tableWidth , state . collection , newControlled , uncontrolledWidths , key , width ) ;
97
97
@@ -101,7 +101,7 @@ export function useTableColumnResizeState<T>(props: TableColumnResizeStateProps<
101
101
return newSizes ;
102
102
} , [ controlledColumns , uncontrolledColumns , setUncontrolledWidths , tableWidth , columnLayout , state . collection , uncontrolledWidths ] ) ;
103
103
104
- let onColumnResizeEnd = useCallback ( ( ) => {
104
+ let endResize = useCallback ( ( ) => {
105
105
setResizingColumn ( null ) ;
106
106
} , [ setResizingColumn ] ) ;
107
107
@@ -111,9 +111,9 @@ export function useTableColumnResizeState<T>(props: TableColumnResizeStateProps<
111
111
112
112
return useMemo ( ( ) => ( {
113
113
resizingColumn,
114
- onColumnResize ,
115
- onColumnResizeStart ,
116
- onColumnResizeEnd ,
114
+ updateResizedColumns ,
115
+ startResize ,
116
+ endResize ,
117
117
getColumnWidth : ( key : Key ) =>
118
118
columnLayout . getColumnWidth ( key ) ,
119
119
getColumnMinWidth : ( key : Key ) =>
@@ -125,9 +125,9 @@ export function useTableColumnResizeState<T>(props: TableColumnResizeStateProps<
125
125
} ) , [
126
126
columnLayout ,
127
127
resizingColumn ,
128
- onColumnResize ,
129
- onColumnResizeStart ,
130
- onColumnResizeEnd ,
128
+ updateResizedColumns ,
129
+ startResize ,
130
+ endResize ,
131
131
columnWidths ,
132
132
state
133
133
] ) ;
0 commit comments