Skip to content

Commit

Permalink
Merge pull request #296 from icflorescu/next
Browse files Browse the repository at this point in the history
Improve the default sort behavior
  • Loading branch information
icflorescu authored May 17, 2023
2 parents 88419ae + 86f2de6 commit 1629191
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 171 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.5.0 (2023-05-17)

- Slight change in the default sorting behavior (issue #295)

## 2.4.9 (2023-04-24)

- Implement column footers (issue #252)
Expand Down
20 changes: 10 additions & 10 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mantine-datatable-docs",
"version": "2.4.18",
"version": "2.5.0",
"description": "Docs website for mantine-datatable; see ../package/package.json for more info",
"private": true,
"scripts": {
Expand All @@ -11,15 +11,15 @@
"dependencies": {
"@emotion/react": "^11.11.0",
"@emotion/server": "^11.11.0",
"@faker-js/faker": "^8.0.0",
"@faker-js/faker": "^8.0.1",
"@formkit/auto-animate": "^1.0.0-beta.6",
"@mantine/core": "^6.0.10",
"@mantine/hooks": "^6.0.10",
"@mantine/modals": "^6.0.10",
"@mantine/next": "^6.0.10",
"@mantine/notifications": "^6.0.10",
"@mantine/prism": "^6.0.10",
"@tabler/icons-react": "^2.18.0",
"@mantine/core": "^6.0.11",
"@mantine/hooks": "^6.0.11",
"@mantine/modals": "^6.0.11",
"@mantine/next": "^6.0.11",
"@mantine/notifications": "^6.0.11",
"@mantine/prism": "^6.0.11",
"@tabler/icons-react": "^2.19.0",
"@tanstack/react-query": "^4.29.7",
"dayjs": "^1.11.7",
"lodash": "^4.17.21",
Expand All @@ -33,7 +33,7 @@
"devDependencies": {
"@types/lodash": "^4.14.194",
"@types/mixpanel-browser": "^2.38.1",
"@types/node": "^20.1.4",
"@types/node": "^20.1.7",
"@types/react": "^18.2.6",
"mixpanel-browser": "^2.47.0",
"typescript": "^5.0.4"
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mantine-datatable-turborepo",
"version": "2.4.18",
"version": "2.5.0",
"description": "This is a monorepo; see package/package.json for more info",
"private": true,
"workspaces": [
Expand All @@ -21,22 +21,22 @@
"devDependencies": {
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.21.5",
"@faker-js/faker": "^8.0.0",
"@faker-js/faker": "^8.0.1",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.4.3",
"@types/jest": "^29.5.1",
"@typescript-eslint/eslint-plugin": "^5.59.5",
"@typescript-eslint/parser": "^5.59.5",
"@typescript-eslint/eslint-plugin": "^5.59.6",
"@typescript-eslint/parser": "^5.59.6",
"babel-jest": "^29.5.0",
"eslint": "^8.40.0",
"eslint-config-next": "^13.4.2",
"eslint-config-prettier": "^8.8.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"prettier": "^2.8.8",
"turbo": "^1.9.4",
"turbo": "^1.9.6",
"typescript": "^5.0.4"
},
"engines": {
Expand Down
7 changes: 6 additions & 1 deletion package/DataTableHeaderCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ export default function DataTableHeaderCell<T>({
? () => {
onSortStatusChange({
columnAccessor: accessor,
direction: sortStatus?.direction === 'asc' ? 'desc' : 'asc',
direction:
sortStatus?.columnAccessor === accessor
? sortStatus.direction === 'asc'
? 'desc'
: 'asc'
: sortStatus?.direction ?? 'asc',
});
}
: undefined;
Expand Down
12 changes: 6 additions & 6 deletions package/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mantine-datatable",
"version": "2.4.18",
"version": "2.5.0",
"description": "Datatable component for Mantine UI, featuring asynchronous data loading support, pagination, multple rows selection, column sorting, custom cell data rendering, row context menu, row expansion and more",
"keywords": [
"ui",
Expand Down Expand Up @@ -49,18 +49,18 @@
"test:watch": "jest --watch"
},
"devDependencies": {
"@mantine/core": "^6.0.10",
"@mantine/hooks": "^6.0.10",
"@tabler/icons-react": "^2.18.0",
"@mantine/core": "^6.0.11",
"@mantine/hooks": "^6.0.11",
"@tabler/icons-react": "^2.19.0",
"@types/react": "^18.2.6",
"@types/react-dom": "^18.2.4",
"esbuild": "^0.17.19",
"react": "^18.2.0",
"typescript": "^5.0.4"
},
"peerDependencies": {
"@mantine/core": "^6.0.10",
"@mantine/hooks": "^6.0.10",
"@mantine/core": "^6.0.11",
"@mantine/hooks": "^6.0.11",
"react": "^18.2.0"
}
}
Loading

0 comments on commit 1629191

Please sign in to comment.