-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Update column resizing stately function property names #4055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
}, [setResizingColumn]); | ||
|
||
let onColumnResize = useCallback((key: Key, width: number): Map<Key, ColumnSize> => { | ||
let computeResizedColumns = useCallback((key: Key, width: number): Map<Key, ColumnSize> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe updateResizedColumns
would be slightly better because this does have a side effect of updating the uncontrolled widths in addition to just computing the sizes...
…m into update-stately-names
Build successful! 🎉 |
Build successful! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the new names and resizing still works.
Build successful! 🎉 |
## API Changes
unknown top level export { type: 'identifier', name: 'Column' } @react-stately/layoutTableLayout TableLayout<T> {
addVisibleLayoutInfos: (Array<LayoutInfo>, LayoutNode, Rect) => void
binarySearch: (Array<LayoutNode>, Point, 'x' | 'y') => void
buildBody: (number) => LayoutNode
buildCell: (GridNode<T>, number, number) => LayoutNode
buildCollection: () => Array<LayoutNode>
buildColumn: (GridNode<T>, number, number) => LayoutNode
buildHeader: () => LayoutNode
buildHeaderRow: (GridNode<T>, number, number) => LayoutNode
buildNode: (GridNode<T>, number, number) => LayoutNode
buildPersistedIndices: () => void
buildRow: (GridNode<T>, number, number) => LayoutNode
collection: TableCollection<T>
columnLayout: TableColumnLayout<T>
columnWidths: Map<Key, number>
constructor: (TableLayoutOptions<T>) => void
controlledColumns: Map<Key, GridNode<unknown>>
+ endResize: () => void
getColumnMaxWidth: (Key) => number
getColumnMinWidth: (Key) => number
getColumnWidth: (Key) => number
getEstimatedHeight: (GridNode<T>, number, number, number) => void
getInitialLayoutInfo: (LayoutInfo) => void
getRenderedColumnWidth: (GridNode<T>) => void
getResizerPosition: () => Key
getVisibleLayoutInfos: (Rect) => void
isLoading: any
lastCollection: TableCollection<T>
lastPersistedKeys: Set<Key>
- onColumnResize: (Key, number) => Map<Key, ColumnSize>
- onColumnResizeEnd: () => void
- onColumnResizeStart: (Key) => void
persistedIndices: Map<Key, Array<number>>
resizingColumn: Key | null
setChildHeights: (Array<LayoutNode>, number) => void
+ startResize: (Key) => void
stickyColumnIndices: Array<number>
uncontrolledColumns: Map<Key, GridNode<unknown>>
uncontrolledWidths: Map<Key, ColumnSize>
+ updateResizedColumns: (Key, number) => Map<Key, ColumnSize>
wasLoading: any
} @react-stately/tableTableColumnResizeState TableColumnResizeState<T> {
+ endResize: () => void
getColumnMaxWidth: (Key) => number
getColumnMinWidth: (Key) => number
getColumnWidth: (Key) => number
- onColumnResize: (Key, number) => Map<Key, ColumnSize>
- onColumnResizeEnd: () => void
- onColumnResizeStart: (Key) => void
resizingColumn: Key | null
+ startResize: (Key) => void
tableState: TableState<T>
+ updateResizedColumns: (Key, number) => Map<Key, ColumnSize>
widths: Map<Key, number>
} it changed:
|
Closes
Found in audit. The function properties of a stately object shouldn't follow the
on*
pattern. Instead, they should be clear that they are going to do something, not cause a side effect.✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: