PluginProbe
Code Snippets / trunk
Code Snippets vtrunk
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
← 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,