Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/@react-spectrum/table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
},
"dependencies": {
"@react-aria/button": "^3.7.0",
"@react-aria/dnd": "^3.1.0",
"@react-aria/focus": "^3.11.0",
"@react-aria/grid": "^3.6.1",
"@react-aria/i18n": "^3.7.0",
Expand All @@ -55,7 +54,6 @@
"@react-spectrum/tooltip": "^3.4.0",
"@react-spectrum/utils": "^3.9.0",
"@react-stately/collections": "^3.6.0",
"@react-stately/dnd": "^3.1.0",
"@react-stately/grid": "^3.5.0",
"@react-stately/layout": "^3.11.0",
"@react-stately/table": "^3.8.0",
Expand All @@ -67,7 +65,9 @@
"@swc/helpers": "^0.4.14"
},
"devDependencies": {
"@adobe/spectrum-css-temp": "3.0.0-alpha.1"
"@adobe/spectrum-css-temp": "3.0.0-alpha.1",
"@react-aria/dnd": "^3.1.0",
"@react-stately/dnd": "^3.1.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/@react-spectrum/table/src/TableView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import {
useUnwrapDOMRef
} from '@react-spectrum/utils';
import {ColumnSize, SpectrumColumnProps, TableProps} from '@react-types/table';
import {DragAndDropHooks} from '@react-spectrum/dnd';
import {DraggableCollectionState, DroppableCollectionState} from '@react-stately/dnd';
import {DraggableItemResult, DropIndicatorAria, DroppableCollectionResult, DroppableItemResult} from '@react-aria/dnd';
import type {DragAndDropHooks} from '@react-spectrum/dnd';
import type {DraggableCollectionState, DroppableCollectionState} from '@react-stately/dnd';
import type {DraggableItemResult, DropIndicatorAria, DroppableCollectionResult, DroppableItemResult} from '@react-aria/dnd';
import {FocusRing, FocusScope, useFocusRing} from '@react-aria/focus';
import {getInteractionModality, useHover, usePress} from '@react-aria/interactions';
import {GridNode} from '@react-types/grid';
Expand Down
3 changes: 0 additions & 3 deletions packages/@react-stately/table/src/useTableState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ export interface TableState<T> extends GridState<T, ITableCollection<T>> {
collection: ITableCollection<T>,
/** Whether the row selection checkboxes should be displayed. */
showSelectionCheckboxes: boolean,
/** Whether the row drag button should be displayed. */
showDragButtons: boolean,
/** The current sorted column and direction. */
sortDescriptor: SortDescriptor,
/** Calls the provided onSortChange handler with the provided column key and sort direction. */
Expand Down Expand Up @@ -88,7 +86,6 @@ export function useTableState<T extends object>(props: TableStateProps<T>): Tabl
disabledKeys,
selectionManager,
showSelectionCheckboxes: props.showSelectionCheckboxes || false,
showDragButtons: props.showDragButtons || false,
sortDescriptor: props.sortDescriptor,
isKeyboardNavigationDisabled: collection.size === 0 || isKeyboardNavigationDisabled,
setKeyboardNavigationDisabled,
Expand Down
39 changes: 38 additions & 1 deletion packages/@react-types/table/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* governing permissions and limitations under the License.
*/

import {AsyncLoadable, CollectionChildren, LoadingState, MultipleSelection, Sortable} from '@react-types/shared';
import {AriaLabelingProps, AsyncLoadable, CollectionChildren, DOMProps, LoadingState, MultipleSelection, Sortable, SpectrumSelectionProps, StyleProps} from '@react-types/shared';
import {GridCollection, GridNode} from '@react-types/grid';
import {Key, ReactElement, ReactNode} from 'react';

Expand All @@ -32,6 +32,43 @@ export interface TableProps<T> extends MultipleSelection, Sortable {
disabledKeys?: Iterable<Key>
}

/**
* @deprecated - use SpectrumTableProps from '@adobe/react-spectrum' instead.
*/
export interface SpectrumTableProps<T> extends TableProps<T>, SpectrumSelectionProps, DOMProps, AriaLabelingProps, StyleProps {
/**
* Sets the amount of vertical padding within each cell.
* @default 'regular'
*/
density?: 'compact' | 'regular' | 'spacious',
/**
* Sets the overflow behavior for the cell contents.
* @default 'truncate'
*/
overflowMode?: 'wrap' | 'truncate',
/** Whether the TableView should be displayed with a quiet style. */
isQuiet?: boolean,
/** Sets what the TableView should render when there is no content to display. */
renderEmptyState?: () => JSX.Element,
/** Handler that is called when a user performs an action on a row. */
onAction?: (key: Key) => void,
/**
* Handler that is called when a user starts a column resize.
*/
onResizeStart?: (widths: Map<Key, ColumnSize>) => void,
/**
* Handler that is called when a user performs a column resize.
* Can be used with the width property on columns to put the column widths into
* a controlled state.
*/
onResize?: (widths: Map<Key, ColumnSize>) => void,
/**
* Handler that is called after a user performs a column resize.
* Can be used to store the widths of columns for another future session.
*/
onResizeEnd?: (widths: Map<Key, ColumnSize>) => void
}

export interface TableHeaderProps<T> {
/** A list of table columns. */
columns?: T[],
Expand Down