Skip to content

Commit 09ba8cb

Browse files
authored
Add col resize back (#3182)
Add col resize back
1 parent 761acda commit 09ba8cb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+489
-392
lines changed

packages/@react-aria/table/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export * from './useTableRow';
1616
export * from './useTableHeaderRow';
1717
export * from './useTableCell';
1818
export * from './useTableSelectionCheckbox';
19-
// export * from './useTableColumnResize';
19+
export * from './useTableColumnResize';
2020

2121
// Workaround for a Parcel bug where re-exports don't work in the CommonJS output format...
2222
// export {useGridRowGroup as useTableRowGroup} from '@react-aria/grid';

packages/@react-aria/table/src/useTableColumnHeader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ interface ColumnHeaderAria {
4242
*/
4343
export function useTableColumnHeader<T>(props: ColumnHeaderProps, state: TableState<T>, ref: RefObject<HTMLElement>): ColumnHeaderAria {
4444
let {node} = props;
45-
// let allowsResizing = node.props.allowsResizing;
45+
let allowsResizing = node.props.allowsResizing;
4646
let allowsSorting = node.props.allowsSorting;
4747
let {gridCellProps} = useGridCell(props, state, ref);
4848

4949
let isSelectionCellDisabled = node.props.isSelectionCell && state.selectionManager.selectionMode === 'single';
5050
let {pressProps} = usePress({
5151
// Disabled for allowsResizing because if resizing is allowed, a menu trigger is added to the column header.
52-
isDisabled: !allowsSorting || isSelectionCellDisabled, // || allowsResizing,
52+
isDisabled: !allowsSorting || isSelectionCellDisabled || allowsResizing,
5353
onPress() {
5454
state.sort(node.key);
5555
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"loading": "جارٍ التحميل...",
3-
"loadingMore": "جارٍ تحميل المزيد..."
3+
"loadingMore": "جارٍ تحميل المزيد...",
4+
"sortAscending": "Sort Ascending",
5+
"sortDescending": "Sort Descending",
6+
"resizeColumn": "Resize column"
47
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"loading": "Зареждане...",
3-
"loadingMore": "Зареждане на още..."
3+
"loadingMore": "Зареждане на още...",
4+
"sortAscending": "Sort Ascending",
5+
"sortDescending": "Sort Descending",
6+
"resizeColumn": "Resize column"
47
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"loading": "Načítání...",
3-
"loadingMore": "Načítání dalších..."
3+
"loadingMore": "Načítání dalších...",
4+
"sortAscending": "Sort Ascending",
5+
"sortDescending": "Sort Descending",
6+
"resizeColumn": "Resize column"
47
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"loading": "Indlæser ...",
3-
"loadingMore": "Indlæser flere ..."
3+
"loadingMore": "Indlæser flere ...",
4+
"sortAscending": "Sort Ascending",
5+
"sortDescending": "Sort Descending",
6+
"resizeColumn": "Resize column"
47
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"loading": "Laden...",
3-
"loadingMore": "Mehr laden ..."
3+
"loadingMore": "Mehr laden ...",
4+
"sortAscending": "Sort Ascending",
5+
"sortDescending": "Sort Descending",
6+
"resizeColumn": "Resize column"
47
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"loading": "Φόρτωση...",
3-
"loadingMore": "Φόρτωση περισσότερων..."
3+
"loadingMore": "Φόρτωση περισσότερων...",
4+
"sortAscending": "Sort Ascending",
5+
"sortDescending": "Sort Descending",
6+
"resizeColumn": "Resize column"
47
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"loading": "Loading…",
3-
"loadingMore": "Loading more…"
3+
"loadingMore": "Loading more…",
4+
"sortAscending": "Sort Ascending",
5+
"sortDescending": "Sort Descending",
6+
"resizeColumn": "Resize column"
47
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"loading": "Cargando…",
3-
"loadingMore": "Cargando más…"
3+
"loadingMore": "Cargando más…",
4+
"sortAscending": "Sort Ascending",
5+
"sortDescending": "Sort Descending",
6+
"resizeColumn": "Resize column"
47
}

0 commit comments

Comments
 (0)