diff --git a/CHANGELOG.md b/CHANGELOG.md index baf4d77..f881539 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ The following is a list of notable changes to the Mantine DataTable component. Minor versions that are not listed in the changelog are bug fixes and small improvements. +## 6.0.8 (2024-01-17) + +- Fix unhandled runtime error when using column dragging/toggling (PR [#14](https://github.com/icflorescu/mantine-datatable-v6/pull/14)) +- Update dev deps + ## 6.0.7 (2024-01-10) - Fix default toggling and double click on column to reset the width (see PR [#11](https://github.com/icflorescu/mantine-datatable-v6/pull/11) by [Giovambattista Fazioli](https://github.com/gfazioli)) diff --git a/docs/examples/TogglingExample.tsx b/docs/examples/TogglingExample.tsx index a2dd0d1..3f91642 100644 --- a/docs/examples/TogglingExample.tsx +++ b/docs/examples/TogglingExample.tsx @@ -1,4 +1,5 @@ import { Button, Group, Stack } from '@mantine/core'; +import { IconMap } from '@tabler/icons-react'; import { DataTable, useDataTableColumns } from 'mantine-datatable'; import { companies } from '~/data'; @@ -11,7 +12,11 @@ export default function TogglingExample() { { accessor: 'name', width: '40%', toggleable: true, defaultToggle: false }, { accessor: 'streetAddress', width: '60%', toggleable: true }, { accessor: 'city', width: 160, toggleable: true }, - { accessor: 'state' }, + { + accessor: 'state', + width: 40, + title: , + }, ], }); diff --git a/docs/package.json b/docs/package.json index cce58b8..cfed6c5 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "mantine-datatable-docs", - "version": "6.0.7", + "version": "6.0.8", "description": "Docs website for mantine-datatable; see ../package/package.json for more info", "private": true, "scripts": { @@ -10,7 +10,7 @@ }, "dependencies": { "@docsearch/react": "^3.5.2", - "@ducanh2912/next-pwa": "^10.1.0", + "@ducanh2912/next-pwa": "^10.2.2", "@emotion/react": "^11.11.3", "@emotion/server": "^11.11.0", "@faker-js/faker": "^8.3.1", @@ -22,7 +22,7 @@ "@mantine/next": "^6.0.21", "@mantine/notifications": "^6.0.21", "@mantine/prism": "^6.0.21", - "@tabler/icons-react": "^2.45.0", + "@tabler/icons-react": "^2.46.0", "@tanstack/react-query": "^4.36.1", "dayjs": "^1.11.10", "lodash": "^4.17.21", @@ -34,8 +34,8 @@ }, "devDependencies": { "@types/lodash": "^4.14.202", - "@types/node": "^20.10.8", - "@types/react": "^18.2.47", + "@types/node": "^20.11.5", + "@types/react": "^18.2.48", "typescript": "^5.3.3", "webpack": "^5.89.0" } diff --git a/package.json b/package.json index 66830d5..0cfa80c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mantine-datatable-turborepo", - "version": "6.0.7", + "version": "6.0.8", "description": "Monorepo for mantine-datatable; see package/package.json for more info", "private": true, "workspaces": [ @@ -27,15 +27,15 @@ "@testing-library/react-hooks": "^8.0.1", "@testing-library/user-event": "^14.5.2", "@types/jest": "^29.5.11", - "@typescript-eslint/eslint-plugin": "^6.18.1", - "@typescript-eslint/parser": "^6.18.1", + "@typescript-eslint/eslint-plugin": "^6.19.0", + "@typescript-eslint/parser": "^6.19.0", "babel-jest": "^29.7.0", "eslint": "^8.56.0", "eslint-config-next": "^14.0.4", "eslint-config-prettier": "^9.1.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", - "prettier": "^3.1.1", + "prettier": "^3.2.4", "turbo": "^1.11.3", "typescript": "^5.3.3" }, diff --git a/package/hooks.ts b/package/hooks.ts index 5b82d08..a973d40 100644 --- a/package/hooks.ts +++ b/package/hooks.ts @@ -109,7 +109,6 @@ export function useElementOuterSize() { export type DataTableColumnToggle = { accessor: string; - title: string | undefined; defaultToggle: boolean; toggleable: boolean; toggled: boolean; @@ -137,7 +136,6 @@ export const useDataTableColumns = ({ columns.map((column) => ({ accessor: column.accessor, defaultToggle: column.defaultToggle || true, - title: column.title, toggleable: column.toggleable, toggled: column.defaultToggle === undefined ? true : column.defaultToggle, })); diff --git a/package/package.json b/package/package.json index 6ebb49c..86e019f 100644 --- a/package/package.json +++ b/package/package.json @@ -1,6 +1,6 @@ { "name": "mantine-datatable", - "version": "6.0.7", + "version": "6.0.8", "description": "The dependency-free 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": [ "mantine", @@ -58,8 +58,8 @@ "devDependencies": { "@mantine/core": "^6.0.21", "@mantine/hooks": "^6.0.21", - "@tabler/icons-react": "^2.45.0", - "@types/react": "^18.2.47", + "@tabler/icons-react": "^2.46.0", + "@types/react": "^18.2.48", "@types/react-dom": "^18.2.18", "esbuild": "^0.19.11", "react": "^18.2.0", diff --git a/yarn.lock b/yarn.lock index 3030745..dcb13b6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1368,10 +1368,10 @@ "@docsearch/css" "3.5.2" algoliasearch "^4.19.1" -"@ducanh2912/next-pwa@^10.1.0": - version "10.1.0" - resolved "https://registry.yarnpkg.com/@ducanh2912/next-pwa/-/next-pwa-10.1.0.tgz#5ca377402ed37938fac756683b6a1c9cf74636ac" - integrity sha512-4jrV+bEiiqP2CQGqRQ3Gx4rpYjRai4bAkTUZLdAMTFXVPFEy825IOL55mj7BESdRQXb4YtpUULr80gREm7sXIA== +"@ducanh2912/next-pwa@^10.2.2": + version "10.2.2" + resolved "https://registry.yarnpkg.com/@ducanh2912/next-pwa/-/next-pwa-10.2.2.tgz#b72880bfaf791b4135a72803861cfc83bebbd256" + integrity sha512-4WCMTI8aGQlLbxBVmXlGQuTTvSkAUdxvZl6o18znW1jcOd64K7SmJcMbh+MdJDw6s5eqG/uAKfbmA0JMC/c9iQ== dependencies: clean-webpack-plugin "4.0.0" fast-glob "3.3.2" @@ -2312,18 +2312,18 @@ dependencies: tslib "^2.4.0" -"@tabler/icons-react@^2.45.0": - version "2.45.0" - resolved "https://registry.yarnpkg.com/@tabler/icons-react/-/icons-react-2.45.0.tgz#5d5ae78782b403b9115fbc37be1ba4756847ae8e" - integrity sha512-1vSBsHnBi9AfMILeJQrQo1XIHtFOxuWNGOeIvNHpDcBXyFTfVvDuh64PjMl57xCh5y/PlQlu3Hpx9vSkpSYXYQ== +"@tabler/icons-react@^2.46.0": + version "2.46.0" + resolved "https://registry.yarnpkg.com/@tabler/icons-react/-/icons-react-2.46.0.tgz#a24cf737687a18cdf1b0e1189ef69462e82dbd89" + integrity sha512-X8MRxuslIOFqMjAo+GvUZDpjlOwNYNJTuOsHXf/NBvVI6ygqUf0FUNsDLLA5fQ6k6KtRwxMlgGB+eR8ZG1UP0g== dependencies: - "@tabler/icons" "2.45.0" + "@tabler/icons" "2.46.0" prop-types "^15.7.2" -"@tabler/icons@2.45.0": - version "2.45.0" - resolved "https://registry.yarnpkg.com/@tabler/icons/-/icons-2.45.0.tgz#c6dff8df5b33492b832a65b778e8be4b45eed739" - integrity sha512-J10UDghOni9wlrj5CpKAzychDCABCKYq897mGg0wGFsd+tYLaUdz0dt/HZeGnV8gZJo0hIiTPLGwBp5EW42Qsg== +"@tabler/icons@2.46.0": + version "2.46.0" + resolved "https://registry.yarnpkg.com/@tabler/icons/-/icons-2.46.0.tgz#e629df8901b799372914c694000cc2ea3d45bb6b" + integrity sha512-Q5G8Pj5IO+Uhc6pszpu5/hGYY018JwEzzvmuqr+gKJtfIvAHA3umpwUilMRLEy89p+WCP+YsDhicMhfBCCv1qA== "@tanstack/query-core@4.36.1": version "4.36.1" @@ -2533,10 +2533,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.9.tgz#c7164e0f8d3f12dfae336af0b1f7fdec8c6b204f" integrity sha512-8e2HYcg7ohnTUbHk8focoklEQYvemQmu9M/f43DZVx43kHn0tE3BY/6gSDxS7k0SprtS0NHvj+L80cGLnoOUcQ== -"@types/node@^20.10.8": - version "20.10.8" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.8.tgz#f1e223cbde9e25696661d167a5b93a9b2a5d57c7" - integrity sha512-f8nQs3cLxbAFc00vEU59yf9UyGUftkPaLGfvbVOIDdx2i1b8epBqj2aNGyP19fiyXWvlmZ7qC1XLjAzw/OKIeA== +"@types/node@^20.11.5": + version "20.11.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.5.tgz#be10c622ca7fcaa3cf226cf80166abc31389d86e" + integrity sha512-g557vgQjUUfN76MZAN/dt1z3dzcUsimuysco0KeluHgrPdJXkP/XdAURgyO2W9fZWHRtRBiVKzKn8vyOAwlG+w== dependencies: undici-types "~5.26.4" @@ -2573,10 +2573,10 @@ "@types/scheduler" "*" csstype "^3.0.2" -"@types/react@^18.2.47": - version "18.2.47" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.47.tgz#85074b27ab563df01fbc3f68dc64bf7050b0af40" - integrity sha512-xquNkkOirwyCgoClNk85BjP+aqnIS+ckAJ8i37gAbDs14jfW/J23f2GItAf33oiUPQnqNMALiFeoM9Y5mbjpVQ== +"@types/react@^18.2.48": + version "18.2.48" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.48.tgz#11df5664642d0bd879c1f58bc1d37205b064e8f1" + integrity sha512-qboRCl6Ie70DQQG9hhNREz81jqC1cs9EVNcjQ1AU+jH6NFfSAhVVbrrY/+nSF+Bsk4AOwm9Qa61InvMCyV+H3w== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" @@ -2626,16 +2626,16 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^6.18.1": - version "6.18.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.18.1.tgz#0df881a47da1c1a9774f39495f5f7052f86b72e0" - integrity sha512-nISDRYnnIpk7VCFrGcu1rnZfM1Dh9LRHnfgdkjcbi/l7g16VYRri3TjXi9Ir4lOZSw5N/gnV/3H7jIPQ8Q4daA== +"@typescript-eslint/eslint-plugin@^6.19.0": + version "6.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.19.0.tgz#db03f3313b57a30fbbdad2e6929e88fc7feaf9ba" + integrity sha512-DUCUkQNklCQYnrBSSikjVChdc84/vMPDQSgJTHBZ64G9bA9w0Crc0rd2diujKbTdp6w2J47qkeHQLoi0rpLCdg== dependencies: "@eslint-community/regexpp" "^4.5.1" - "@typescript-eslint/scope-manager" "6.18.1" - "@typescript-eslint/type-utils" "6.18.1" - "@typescript-eslint/utils" "6.18.1" - "@typescript-eslint/visitor-keys" "6.18.1" + "@typescript-eslint/scope-manager" "6.19.0" + "@typescript-eslint/type-utils" "6.19.0" + "@typescript-eslint/utils" "6.19.0" + "@typescript-eslint/visitor-keys" "6.19.0" debug "^4.3.4" graphemer "^1.4.0" ignore "^5.2.4" @@ -2654,24 +2654,24 @@ "@typescript-eslint/visitor-keys" "6.3.0" debug "^4.3.4" -"@typescript-eslint/parser@^6.18.1": - version "6.18.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.18.1.tgz#3c3987e186b38c77b30b6bfa5edf7c98ae2ec9d3" - integrity sha512-zct/MdJnVaRRNy9e84XnVtRv9Vf91/qqe+hZJtKanjojud4wAVy/7lXxJmMyX6X6J+xc6c//YEWvpeif8cAhWA== +"@typescript-eslint/parser@^6.19.0": + version "6.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.19.0.tgz#80344086f362181890ade7e94fc35fe0480bfdf5" + integrity sha512-1DyBLG5SH7PYCd00QlroiW60YJ4rWMuUGa/JBV0iZuqi4l4IK3twKPq5ZkEebmGqRjXWVgsUzfd3+nZveewgow== dependencies: - "@typescript-eslint/scope-manager" "6.18.1" - "@typescript-eslint/types" "6.18.1" - "@typescript-eslint/typescript-estree" "6.18.1" - "@typescript-eslint/visitor-keys" "6.18.1" + "@typescript-eslint/scope-manager" "6.19.0" + "@typescript-eslint/types" "6.19.0" + "@typescript-eslint/typescript-estree" "6.19.0" + "@typescript-eslint/visitor-keys" "6.19.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@6.18.1": - version "6.18.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.18.1.tgz#28c31c60f6e5827996aa3560a538693cb4bd3848" - integrity sha512-BgdBwXPFmZzaZUuw6wKiHKIovms97a7eTImjkXCZE04TGHysG+0hDQPmygyvgtkoB/aOQwSM/nWv3LzrOIQOBw== +"@typescript-eslint/scope-manager@6.19.0": + version "6.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.19.0.tgz#b6d2abb825b29ab70cb542d220e40c61c1678116" + integrity sha512-dO1XMhV2ehBI6QN8Ufi7I10wmUovmLU0Oru3n5LVlM2JuzB4M+dVphCPLkVpKvGij2j/pHBWuJ9piuXx+BhzxQ== dependencies: - "@typescript-eslint/types" "6.18.1" - "@typescript-eslint/visitor-keys" "6.18.1" + "@typescript-eslint/types" "6.19.0" + "@typescript-eslint/visitor-keys" "6.19.0" "@typescript-eslint/scope-manager@6.3.0": version "6.3.0" @@ -2681,33 +2681,33 @@ "@typescript-eslint/types" "6.3.0" "@typescript-eslint/visitor-keys" "6.3.0" -"@typescript-eslint/type-utils@6.18.1": - version "6.18.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.18.1.tgz#115cf535f8b39db8301677199ce51151e2daee96" - integrity sha512-wyOSKhuzHeU/5pcRDP2G2Ndci+4g653V43gXTpt4nbyoIOAASkGDA9JIAgbQCdCkcr1MvpSYWzxTz0olCn8+/Q== +"@typescript-eslint/type-utils@6.19.0": + version "6.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.19.0.tgz#522a494ef0d3e9fdc5e23a7c22c9331bbade0101" + integrity sha512-mcvS6WSWbjiSxKCwBcXtOM5pRkPQ6kcDds/juxcy/727IQr3xMEcwr/YLHW2A2+Fp5ql6khjbKBzOyjuPqGi/w== dependencies: - "@typescript-eslint/typescript-estree" "6.18.1" - "@typescript-eslint/utils" "6.18.1" + "@typescript-eslint/typescript-estree" "6.19.0" + "@typescript-eslint/utils" "6.19.0" debug "^4.3.4" ts-api-utils "^1.0.1" -"@typescript-eslint/types@6.18.1": - version "6.18.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.18.1.tgz#91617d8080bcd99ac355d9157079970d1d49fefc" - integrity sha512-4TuMAe+tc5oA7wwfqMtB0Y5OrREPF1GeJBAjqwgZh1lEMH5PJQgWgHGfYufVB51LtjD+peZylmeyxUXPfENLCw== +"@typescript-eslint/types@6.19.0": + version "6.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.19.0.tgz#689b0498c436272a6a2059b09f44bcbd90de294a" + integrity sha512-lFviGV/vYhOy3m8BJ/nAKoAyNhInTdXpftonhWle66XHAtT1ouBlkjL496b5H5hb8dWXHwtypTqgtb/DEa+j5A== "@typescript-eslint/types@6.3.0": version "6.3.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.3.0.tgz#84517f1427923e714b8418981e493b6635ab4c9d" integrity sha512-K6TZOvfVyc7MO9j60MkRNWyFSf86IbOatTKGrpTQnzarDZPYPVy0oe3myTMq7VjhfsUAbNUW8I5s+2lZvtx1gg== -"@typescript-eslint/typescript-estree@6.18.1": - version "6.18.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.18.1.tgz#a12b6440175b4cbc9d09ab3c4966c6b245215ab4" - integrity sha512-fv9B94UAhywPRhUeeV/v+3SBDvcPiLxRZJw/xZeeGgRLQZ6rLMG+8krrJUyIf6s1ecWTzlsbp0rlw7n9sjufHA== +"@typescript-eslint/typescript-estree@6.19.0": + version "6.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.19.0.tgz#0813ba364a409afb4d62348aec0202600cb468fa" + integrity sha512-o/zefXIbbLBZ8YJ51NlkSAt2BamrK6XOmuxSR3hynMIzzyMY33KuJ9vuMdFSXW+H0tVvdF9qBPTHA91HDb4BIQ== dependencies: - "@typescript-eslint/types" "6.18.1" - "@typescript-eslint/visitor-keys" "6.18.1" + "@typescript-eslint/types" "6.19.0" + "@typescript-eslint/visitor-keys" "6.19.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" @@ -2728,25 +2728,25 @@ semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/utils@6.18.1": - version "6.18.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.18.1.tgz#3451cfe2e56babb6ac657e10b6703393d4b82955" - integrity sha512-zZmTuVZvD1wpoceHvoQpOiewmWu3uP9FuTWo8vqpy2ffsmfCE8mklRPi+vmnIYAIk9t/4kOThri2QCDgor+OpQ== +"@typescript-eslint/utils@6.19.0": + version "6.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.19.0.tgz#557b72c3eeb4f73bef8037c85dae57b21beb1a4b" + integrity sha512-QR41YXySiuN++/dC9UArYOg4X86OAYP83OWTewpVx5ct1IZhjjgTLocj7QNxGhWoTqknsgpl7L+hGygCO+sdYw== dependencies: "@eslint-community/eslint-utils" "^4.4.0" "@types/json-schema" "^7.0.12" "@types/semver" "^7.5.0" - "@typescript-eslint/scope-manager" "6.18.1" - "@typescript-eslint/types" "6.18.1" - "@typescript-eslint/typescript-estree" "6.18.1" + "@typescript-eslint/scope-manager" "6.19.0" + "@typescript-eslint/types" "6.19.0" + "@typescript-eslint/typescript-estree" "6.19.0" semver "^7.5.4" -"@typescript-eslint/visitor-keys@6.18.1": - version "6.18.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.18.1.tgz#704d789bda2565a15475e7d22f145b8fe77443f4" - integrity sha512-/kvt0C5lRqGoCfsbmm7/CwMqoSkY3zzHLIjdhHZQW3VFrnz7ATecOHR7nb7V+xn4286MBxfnQfQhAmCI0u+bJA== +"@typescript-eslint/visitor-keys@6.19.0": + version "6.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.19.0.tgz#4565e0ecd63ca1f81b96f1dd76e49f746c6b2b49" + integrity sha512-hZaUCORLgubBvtGpp1JEFEazcuEdfxta9j4iUwdSAr7mEsYYAp3EAUyCZk3VEEqGj6W+AV4uWyrDGtrlawAsgQ== dependencies: - "@typescript-eslint/types" "6.18.1" + "@typescript-eslint/types" "6.19.0" eslint-visitor-keys "^3.4.1" "@typescript-eslint/visitor-keys@6.3.0": @@ -6353,10 +6353,10 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.1.tgz#6ba9f23165d690b6cbdaa88cb0807278f7019848" - integrity sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw== +prettier@^3.2.4: + version "3.2.4" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.4.tgz#4723cadeac2ce7c9227de758e5ff9b14e075f283" + integrity sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ== pretty-bytes@^5.3.0, pretty-bytes@^5.4.1: version "5.6.0"