← All changes
|
js/components/common/ListTable/ColumnHeadings.tsx
+7
-7
4.0.0-beta.1
→
trunk
View file →
| @@ -1,9 +1,9 @@ | ||
| 1 | 1 | import React from 'react' |
| 2 | 2 | import classnames from 'classnames' |
| 3 | 3 | import { __ } from '@wordpress/i18n' |
| 4 | 4 | import type { ListTableColumn, ListTableSortDirection } from './ListTable' |
| 5 | -import type { Dispatch, Key, SetStateAction, ThHTMLAttributes } from 'react' | |
| 5 | +import type { Key, ThHTMLAttributes } from 'react' | |
| 6 | 6 | |
| 7 | 7 | interface SortableHeadingCellProps<T> { |
| 8 | 8 | column: ListTableColumn<T> |
| 9 | 9 | cellProps: ThHTMLAttributes<HTMLTableCellElement> |
| @@ -8,10 +8,10 @@ | ||
| 8 | 8 | column: ListTableColumn<T> |
| 9 | 9 | cellProps: ThHTMLAttributes<HTMLTableCellElement> |
| 10 | 10 | sortColumn: ListTableColumn<T> | undefined |
| 11 | 11 | sortDirection: ListTableSortDirection |
| 12 | - setSortColumn: Dispatch<SetStateAction<ListTableColumn<T> | undefined>> | |
| 13 | - setSortDirection: Dispatch<SetStateAction<ListTableSortDirection>> | |
| 12 | + setSortColumn: (column: ListTableColumn<T> | undefined) => void | |
| 13 | + setSortDirection: (direction: ListTableSortDirection) => void | |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | const SortableHeadingCell = <T, >({ |
| 17 | 17 | column, |
| @@ -42,9 +42,9 @@ | ||
| 42 | 42 | setSortColumn(column) |
| 43 | 43 | setSortDirection(nextSortDirection) |
| 44 | 44 | }} |
| 45 | 45 | > |
| 46 | - <span>{column.title}</span> | |
| 46 | + <span className="sortable-column-title">{column.title}</span> | |
| 47 | 47 | <span className="sorting-indicators"> |
| 48 | 48 | <span className="sorting-indicator asc" aria-hidden="true"></span> |
| 49 | 49 | <span className="sorting-indicator desc" aria-hidden="true"></span> |
| 50 | 50 | </span> |
| @@ -64,12 +64,12 @@ | ||
| 64 | 64 | getKey: (item: T) => K |
| 65 | 65 | columns: ListTableColumn<T>[] |
| 66 | 66 | selected: Set<K> |
| 67 | 67 | sortColumn: ListTableColumn<T> | undefined |
| 68 | - setSelected: Dispatch<SetStateAction<Set<K>>> | |
| 68 | + setSelected: (selected: Set<K>) => void | |
| 69 | 69 | sortDirection: ListTableSortDirection |
| 70 | - setSortColumn: Dispatch<SetStateAction<ListTableColumn<T> | undefined>> | |
| 71 | - setSortDirection: Dispatch<SetStateAction<ListTableSortDirection>> | |
| 70 | + setSortColumn: (column: ListTableColumn<T> | undefined) => void | |
| 71 | + setSortDirection: (direction: ListTableSortDirection) => void | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | export const ColumnHeadings = <T, K extends Key>({ |
| 75 | 75 | items, |