Skip to content

Commit 975a1d3

Browse files
authored
Merge pull request #601 from icflorescu/next
Update deps, changelog, fix #593, release next version
2 parents 9fd783d + 795d38a commit 975a1d3

File tree

8 files changed

+395
-375
lines changed

8 files changed

+395
-375
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
The following is a list of notable changes to the Mantine DataTable component.
44
Minor versions that are not listed in the changelog are bug fixes and small improvements.
55

6+
## 7.10.1 (2024-06-03)
7+
8+
- Update dev dependencies to ensure compatibility with Mantine 7.10.1
9+
- Add support for sorting by nested property in columns (see PR [#600](https://github.com/icflorescu/mantine-datatable/pull/600))
10+
- Fix issue [#593](https://github.com/icflorescu/mantine-datatable/issues/593) (`cursor: pointer` not showing when using `onRowClick`)
11+
612
## 7.9.1 (2024-05-10)
713

814
- Update dev dependencies to ensure compatibility with Mantine 7.9.1

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mantine-datatable",
3-
"version": "7.9.1",
3+
"version": "7.10.1",
44
"description": "The lightweight, dependency-free, dark-theme aware table component for your Mantine UI data-rich applications, featuring asynchronous data loading support, pagination, intuitive Gmail-style additive batch rows selection, column sorting, custom cell data rendering, row expansion, nesting, context menus, and much more",
55
"keywords": [
66
"mantine",
@@ -75,40 +75,40 @@
7575
"@ducanh2912/next-pwa": "^10.2.7",
7676
"@faker-js/faker": "^8.4.1",
7777
"@formkit/auto-animate": "^0.8.2",
78-
"@mantine/code-highlight": "^7.9.1",
79-
"@mantine/core": "^7.9.1",
80-
"@mantine/dates": "^7.9.1",
81-
"@mantine/hooks": "^7.9.1",
82-
"@mantine/modals": "^7.9.1",
83-
"@mantine/notifications": "^7.9.1",
84-
"@tabler/icons-react": "^3.3.0",
85-
"@tanstack/react-query": "^5.35.1",
86-
"@types/lodash": "^4.17.1",
87-
"@types/node": "^20.12.11",
88-
"@types/react": "^18.3.1",
78+
"@mantine/code-highlight": "^7.10.1",
79+
"@mantine/core": "^7.10.1",
80+
"@mantine/dates": "^7.10.1",
81+
"@mantine/hooks": "^7.10.1",
82+
"@mantine/modals": "^7.10.1",
83+
"@mantine/notifications": "^7.10.1",
84+
"@tabler/icons-react": "^3.5.0",
85+
"@tanstack/react-query": "^5.40.0",
86+
"@types/lodash": "^4.17.4",
87+
"@types/node": "^20.14.0",
88+
"@types/react": "^18.3.3",
8989
"@types/react-dom": "^18.3.0",
90-
"@typescript-eslint/eslint-plugin": "^7.8.0",
91-
"@typescript-eslint/parser": "^7.8.0",
90+
"@typescript-eslint/eslint-plugin": "^7.12.0",
91+
"@typescript-eslint/parser": "^7.12.0",
9292
"clsx": "^2.1.1",
9393
"cssnano": "^7.0.1",
9494
"dayjs": "^1.11.11",
9595
"eslint": "^8",
9696
"eslint-config-next": "^14.2.3",
9797
"eslint-config-prettier": "^9.1.0",
9898
"lodash": "^4.17.21",
99-
"mantine-contextmenu": "^7.9.1",
99+
"mantine-contextmenu": "^7.10.1",
100100
"next": "^14.2.3",
101101
"postcss": "^8.4.38",
102102
"postcss-cli": "^11.0.0",
103103
"postcss-import": "^16.1.0",
104104
"postcss-preset-mantine": "^1.15.0",
105105
"postcss-simple-vars": "^7.0.1",
106-
"prettier": "^3.2.5",
106+
"prettier": "^3.3.0",
107107
"react": "^18.3.1",
108108
"react-dom": "^18.3.1",
109-
"sharp": "^0.33.3",
109+
"sharp": "^0.33.4",
110110
"swr": "^2.2.5",
111-
"tsup": "^8.0.2",
111+
"tsup": "^8.1.0",
112112
"typescript": "^5.4.5",
113113
"webpack": "^5.91.0"
114114
},

package/DataTableHeader.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ export const DataTableHeader = forwardRef(function DataTableHeader<T>(
128128
titleStyle,
129129
filter,
130130
filtering,
131+
sortKey,
131132
} = { ...defaultColumnProps, ...columnProps };
132133

133134
return (
@@ -148,6 +149,7 @@ export const DataTableHeader = forwardRef(function DataTableHeader<T>(
148149
resizable={resizable && index < columns.length - 1}
149150
sortStatus={sortStatus}
150151
sortIcons={sortIcons}
152+
sortKey={sortKey}
151153
onSortStatusChange={onSortStatusChange}
152154
filter={filter}
153155
filtering={filtering}

package/DataTableHeaderCell.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,16 @@ type DataTableHeaderCellProps<T> = {
2323
onSortStatusChange: DataTableSortProps<T>['onSortStatusChange'];
2424
} & Pick<
2525
DataTableColumn<T>,
26-
'accessor' | 'sortable' | 'draggable' | 'toggleable' | 'resizable' | 'textAlign' | 'width' | 'filter' | 'filtering'
26+
| 'accessor'
27+
| 'sortable'
28+
| 'draggable'
29+
| 'toggleable'
30+
| 'resizable'
31+
| 'textAlign'
32+
| 'width'
33+
| 'filter'
34+
| 'filtering'
35+
| 'sortKey'
2736
>;
2837

2938
export function DataTableHeaderCell<T>({
@@ -43,6 +52,7 @@ export function DataTableHeaderCell<T>({
4352
onSortStatusChange,
4453
filter,
4554
filtering,
55+
sortKey,
4656
}: DataTableHeaderCellProps<T>) {
4757
const { setSourceColumn, setTargetColumn, swapColumns, setColumnsToggle } = useDataTableColumnsContext();
4858
const [dragOver, setDragOver] = useState<boolean>(false);
@@ -58,6 +68,7 @@ export function DataTableHeaderCell<T>({
5868
if (e?.defaultPrevented) return;
5969

6070
onSortStatusChange({
71+
sortKey,
6172
columnAccessor: accessor,
6273
direction:
6374
sortStatus?.columnAccessor === accessor

package/DataTableRow.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ export function DataTableRow<T>({
8484
<TableTr
8585
className={clsx(
8686
'mantine-datatable-row',
87-
{ [POINTER_CURSOR]: expansion?.isExpandable({ record, index }) && (onClick || onDoubleClick || expansion?.expandOnClick) },
87+
{
88+
[POINTER_CURSOR]:
89+
onClick || onDoubleClick || (expansion?.isExpandable({ record, index }) && expansion?.expandOnClick),
90+
},
8891
{ [CONTEXT_MENU_CURSOR]: onContextMenu },
8992
typeof className === 'function' ? className(record, index) : className
9093
)}

package/types/DataTableColumn.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export type DataTableColumn<T = Record<string, unknown>> = {
3333
* If true, column will be sortable.
3434
*/
3535
sortable?: boolean;
36+
sortKey?: string;
3637

3738
/**
3839
* If set to true, the column can be dragged.

package/types/DataTableSortStatus.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
export type DataTableSortStatus<T = Record<string, unknown>> = {
2+
/**
3+
* Sort column key for nested values.
4+
* @type {string}
5+
*/
6+
sortKey?: string;
27
/**
38
* Sort column accessor.
49
* You can use dot-notation for nested objects property drilling

0 commit comments

Comments
 (0)