diff --git a/apps/material-react-table-docs/package.json b/apps/material-react-table-docs/package.json index 636edc6cf..4c7ab1322 100644 --- a/apps/material-react-table-docs/package.json +++ b/apps/material-react-table-docs/package.json @@ -30,7 +30,7 @@ "dayjs": "^1.11.7", "export-to-csv": "^0.2.1", "material-react-table": "workspace:*", - "next": "13.1.6", + "next": "13.1.0", "next-sitemap": "^3.1.54", "prism-react-renderer": "^1.3.5", "react": "18.2.0", diff --git a/apps/material-react-table-docs/pages/changelog.mdx b/apps/material-react-table-docs/pages/changelog.mdx index 6c6a17c71..6e68f36f2 100644 --- a/apps/material-react-table-docs/pages/changelog.mdx +++ b/apps/material-react-table-docs/pages/changelog.mdx @@ -12,6 +12,10 @@ import Head from 'next/head'; ### Version 1 (Latest) +#### v1.8.4 (2023-03-02) + +- Fixed column resizing issues with nested column groups + #### v1.8.3 (2023-02-27) - Add back support for custom edit and filter textfield children diff --git a/packages/material-react-table/package.json b/packages/material-react-table/package.json index 27d86f21a..aa681a782 100644 --- a/packages/material-react-table/package.json +++ b/packages/material-react-table/package.json @@ -1,5 +1,5 @@ { - "version": "1.8.3", + "version": "1.8.4", "license": "MIT", "name": "material-react-table", "description": "A fully featured Material UI V5 implementation of TanStack React Table V8, written from the ground up in TypeScript.", diff --git a/packages/material-react-table/src/column.utils.ts b/packages/material-react-table/src/column.utils.ts index 5edb60ae3..b4332a1ae 100644 --- a/packages/material-react-table/src/column.utils.ts +++ b/packages/material-react-table/src/column.utils.ts @@ -307,10 +307,10 @@ export const getCommonCellStyles = ({ ...(tableCellProps?.sx instanceof Function ? tableCellProps.sx(theme) : (tableCellProps?.sx as any)), - minWidth: `max(calc(var(--col-${parseCSSVarId( + minWidth: `max(calc(var(--${header ? 'header' : 'col'}-${parseCSSVarId( header?.id ?? column.id, )}-size) * 1px), ${column.columnDef.minSize ?? 30}px)`, - width: `calc(var(--col-${parseCSSVarId( + width: `calc(var(--${header ? 'header' : 'col'}-${parseCSSVarId( header?.id ?? column.id, )}-size) * 1px)`, }); diff --git a/packages/material-react-table/src/table/MRT_Table.tsx b/packages/material-react-table/src/table/MRT_Table.tsx index 3dfb49e95..c5a0dddbe 100644 --- a/packages/material-react-table/src/table/MRT_Table.tsx +++ b/packages/material-react-table/src/table/MRT_Table.tsx @@ -59,9 +59,9 @@ export const MRT_Table = ({ table }: Props) => { const colSizes: { [key: string]: number } = {}; for (let i = 0; i < headers.length; i++) { const header = headers[i]; - const colSize = header.getSize(); - colSizes[`--header-${parseCSSVarId(header.id)}-size`] = colSize; - colSizes[`--col-${parseCSSVarId(header.column.id)}-size`] = colSize; + colSizes[`--header-${parseCSSVarId(header.id)}-size`] = header.getSize(); + colSizes[`--col-${parseCSSVarId(header.column.id)}-size`] = + header.column.getSize(); } return colSizes; }, [columns, columnSizing, columnSizingInfo, columnVisibility]); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f90d29543..79a680613 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -35,7 +35,7 @@ importers: eslint-config-next: 13.2.1 export-to-csv: ^0.2.1 material-react-table: workspace:* - next: 13.1.6 + next: 13.1.0 next-plausible: ^3.7.2 next-sitemap: ^3.1.54 prism-react-renderer: ^1.3.5 @@ -62,8 +62,8 @@ importers: dayjs: 1.11.7 export-to-csv: 0.2.1 material-react-table: link:../../packages/material-react-table - next: 13.1.6_biqbaboplfbrettd7655fr4n2y - next-sitemap: 3.1.54_next@13.1.6 + next: 13.1.0_biqbaboplfbrettd7655fr4n2y + next-sitemap: 3.1.54_next@13.1.0 prism-react-renderer: 1.3.5_react@18.2.0 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 @@ -73,7 +73,7 @@ importers: '@types/react-dom': 18.0.11 eslint: 8.35.0 eslint-config-next: 13.2.1_ycpbpc6yetojsgtrx3mwntkhsu - next-plausible: 3.7.2_3vryta7zmbcsw4rrqf4axjqggm + next-plausible: 3.7.2_s75y6mxmikaw2mhqmuko6w7njm raw-loader: 4.0.2 typescript: 4.9.5 @@ -2819,8 +2819,8 @@ packages: rifm: 0.12.1_react@18.2.0 dev: false - /@next/env/13.1.6: - resolution: {integrity: sha512-s+W9Fdqh5MFk6ECrbnVmmAOwxKQuhGMT7xXHrkYIBMBcTiOqNWhv5KbJIboKR5STXxNXl32hllnvKaffzFaWQg==} + /@next/env/13.1.0: + resolution: {integrity: sha512-6iNixFzCndH+Bl4FetQzOMjxCJqg8fs0LAlZviig1K6mIjOWH2m2oPcHcOg1Ta5VCe7Bx5KG1Hs+NrWDUkBt9A==} /@next/eslint-plugin-next/13.2.1: resolution: {integrity: sha512-r0i5rcO6SMAZtqiGarUVMr3k256X0R0j6pEkKg4PxqUW+hG0qgMxRVAJsuoRG5OBFkCOlSfWZJ0mP9fQdCcyNg==} @@ -2844,104 +2844,104 @@ packages: source-map: 0.7.4 dev: false - /@next/swc-android-arm-eabi/13.1.6: - resolution: {integrity: sha512-F3/6Z8LH/pGlPzR1AcjPFxx35mPqjE5xZcf+IL+KgbW9tMkp7CYi1y7qKrEWU7W4AumxX/8OINnDQWLiwLasLQ==} + /@next/swc-android-arm-eabi/13.1.0: + resolution: {integrity: sha512-ANBZZRjZBV+Sii11ZVxbxSvfIi6dZwu4w+XnJBDmz+0/wtAigpjYWyMkuWZ/RCD7INdusOlU4EgJ99WzWGIDjA==} engines: {node: '>= 10'} cpu: [arm] os: [android] requiresBuild: true optional: true - /@next/swc-android-arm64/13.1.6: - resolution: {integrity: sha512-cMwQjnB8vrYkWyK/H0Rf2c2pKIH4RGjpKUDvbjVAit6SbwPDpmaijLio0LWFV3/tOnY6kvzbL62lndVA0mkYpw==} + /@next/swc-android-arm64/13.1.0: + resolution: {integrity: sha512-nPwbkS3aZjCIe61wztgjXjIeylijOP8uGtDGjjJVUF3B/5GLVx3ngZu6tjPTMEgaLM0u//HuGK+aZolWUQWE4g==} engines: {node: '>= 10'} cpu: [arm64] os: [android] requiresBuild: true optional: true - /@next/swc-darwin-arm64/13.1.6: - resolution: {integrity: sha512-KKRQH4DDE4kONXCvFMNBZGDb499Hs+xcFAwvj+rfSUssIDrZOlyfJNy55rH5t2Qxed1e4K80KEJgsxKQN1/fyw==} + /@next/swc-darwin-arm64/13.1.0: + resolution: {integrity: sha512-0hUydiAW18jK2uGPnZRdnRQtdB/3ZoPo84A6zH7MJHxAWw9lzVsv3kMg9kgVBBlrivzqdNN8rdgA+eYNxzXU9w==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] requiresBuild: true optional: true - /@next/swc-darwin-x64/13.1.6: - resolution: {integrity: sha512-/uOky5PaZDoaU99ohjtNcDTJ6ks/gZ5ykTQDvNZDjIoCxFe3+t06bxsTPY6tAO6uEAw5f6vVFX5H5KLwhrkZCA==} + /@next/swc-darwin-x64/13.1.0: + resolution: {integrity: sha512-3S3iQqJIysklj0Q9gnanuYMzF8H9p+fUVhvSHxVVLcKH4HsE8EGddNkXsaOyznL1kC6vGKw7h6uz1ojaXEafCA==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] requiresBuild: true optional: true - /@next/swc-freebsd-x64/13.1.6: - resolution: {integrity: sha512-qaEALZeV7to6weSXk3Br80wtFQ7cFTpos/q+m9XVRFggu+8Ib895XhMWdJBzew6aaOcMvYR6KQ6JmHA2/eMzWw==} + /@next/swc-freebsd-x64/13.1.0: + resolution: {integrity: sha512-wAgzwm/em48GIuWq3OYr0BpncMy7c+UA3hsyX+xKh/vb/sOIpQly7JTa+GNdk17s7kprhMfsgzPG3da36NLpkA==} engines: {node: '>= 10'} cpu: [x64] os: [freebsd] requiresBuild: true optional: true - /@next/swc-linux-arm-gnueabihf/13.1.6: - resolution: {integrity: sha512-OybkbC58A1wJ+JrJSOjGDvZzrVEQA4sprJejGqMwiZyLqhr9Eo8FXF0y6HL+m1CPCpPhXEHz/2xKoYsl16kNqw==} + /@next/swc-linux-arm-gnueabihf/13.1.0: + resolution: {integrity: sha512-Cr2hzL7ad+4nj9KrR1Cz1RDcsWa61X6I7gc6PToRYIY4gL480Sijq19xo7dlXQPnr1viVzbNiNnNXZASHv7uvw==} engines: {node: '>= 10'} cpu: [arm] os: [linux] requiresBuild: true optional: true - /@next/swc-linux-arm64-gnu/13.1.6: - resolution: {integrity: sha512-yCH+yDr7/4FDuWv6+GiYrPI9kcTAO3y48UmaIbrKy8ZJpi7RehJe3vIBRUmLrLaNDH3rY1rwoHi471NvR5J5NQ==} + /@next/swc-linux-arm64-gnu/13.1.0: + resolution: {integrity: sha512-EjCIKfeZB9h72evL2yGNwBvE5Im96Zn7o2zxImlvCiUYb/xXDqn4hzhck035BSP3g3sGDLfijFTE1wKRyXIk4w==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] requiresBuild: true optional: true - /@next/swc-linux-arm64-musl/13.1.6: - resolution: {integrity: sha512-ECagB8LGX25P9Mrmlc7Q/TQBb9rGScxHbv/kLqqIWs2fIXy6Y/EiBBiM72NTwuXUFCNrWR4sjUPSooVBJJ3ESQ==} + /@next/swc-linux-arm64-musl/13.1.0: + resolution: {integrity: sha512-WAsZtCtPXlz/7/bnW9ryw856xEun+c6xSwZwbcvrMxtcSiW3z0LD91Nsj3AkexsjRtBjeEpNeVtDExqF2VKKSA==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] requiresBuild: true optional: true - /@next/swc-linux-x64-gnu/13.1.6: - resolution: {integrity: sha512-GT5w2mruk90V/I5g6ScuueE7fqj/d8Bui2qxdw6lFxmuTgMeol5rnzAv4uAoVQgClOUO/MULilzlODg9Ib3Y4Q==} + /@next/swc-linux-x64-gnu/13.1.0: + resolution: {integrity: sha512-Tjd5gieI3X9vPce5yF+GsQxOl0jwUkyOrTR1g5PQr+bT/9Qos/yPL48H1L5ayEp0hxgLVPW7skGal7lVnAoVEQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] requiresBuild: true optional: true - /@next/swc-linux-x64-musl/13.1.6: - resolution: {integrity: sha512-keFD6KvwOPzmat4TCnlnuxJCQepPN+8j3Nw876FtULxo8005Y9Ghcl7ACcR8GoiKoddAq8gxNBrpjoxjQRHeAQ==} + /@next/swc-linux-x64-musl/13.1.0: + resolution: {integrity: sha512-H9UMEQv40e9pkgdX4mCms0dDf2dimmZ6WXhDTWF/yIh9icgcsHaP73BJ9IFlgvh80wLiUgWZ3LAX4vXnXzidmg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] requiresBuild: true optional: true - /@next/swc-win32-arm64-msvc/13.1.6: - resolution: {integrity: sha512-OwertslIiGQluFvHyRDzBCIB07qJjqabAmINlXUYt7/sY7Q7QPE8xVi5beBxX/rxTGPIbtyIe3faBE6Z2KywhQ==} + /@next/swc-win32-arm64-msvc/13.1.0: + resolution: {integrity: sha512-LFFIKjW/cPl4wvG8HF/6oYPJZ+Jy32G3FUflC8UW1Od6W9yOSEvadhk9fMyDZN4cgsNOcVc3uVSMpcuuCpbDGw==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] requiresBuild: true optional: true - /@next/swc-win32-ia32-msvc/13.1.6: - resolution: {integrity: sha512-g8zowiuP8FxUR9zslPmlju7qYbs2XBtTLVSxVikPtUDQedhcls39uKYLvOOd1JZg0ehyhopobRoH1q+MHlIN/w==} + /@next/swc-win32-ia32-msvc/13.1.0: + resolution: {integrity: sha512-MBLaoHZSenMdxhB3Ww1VNEhjyPT3uLjzAi5Ygk48LLLbOGu5KxQolhINRrqGuJWqJRNWSJ9JSFBfJrZwQzrUew==} engines: {node: '>= 10'} cpu: [ia32] os: [win32] requiresBuild: true optional: true - /@next/swc-win32-x64-msvc/13.1.6: - resolution: {integrity: sha512-Ls2OL9hi3YlJKGNdKv8k3X/lLgc3VmLG3a/DeTkAd+lAituJp8ZHmRmm9f9SL84fT3CotlzcgbdaCDfFwFA6bA==} + /@next/swc-win32-x64-msvc/13.1.0: + resolution: {integrity: sha512-fFTfIQvnmpbKoyh4v3ezlGqtERlgc2Sx8qJwPuYqoVi0V08wCx9wp2Iq1CINxP3UMHkEeNX7gYpDOd+9Cw9EiQ==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -11227,19 +11227,19 @@ packages: resolution: {integrity: sha512-FlZ7oN9ICt+fbcJ4ag2IsALIcalfE/E16ttdSA8peBiHJI+oEKdOcafqDnUbeUe5NwWGn/m9zZGO9qrAGzfesg==} dev: true - /next-plausible/3.7.2_3vryta7zmbcsw4rrqf4axjqggm: + /next-plausible/3.7.2_s75y6mxmikaw2mhqmuko6w7njm: resolution: {integrity: sha512-9PqFiVtD1kZO5gHFYTcgilHhg2WhMzD6I4NK/RUh9DGavD1N11IhNAvyGLFmvB3f4FtHC9IoAsauYDtQBt+riA==} peerDependencies: next: ^11.1.0 || ^12.0.0 || ^13.0.0 react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 dependencies: - next: 13.1.6_biqbaboplfbrettd7655fr4n2y + next: 13.1.0_biqbaboplfbrettd7655fr4n2y react: 18.2.0 react-dom: 18.2.0_react@18.2.0 dev: true - /next-sitemap/3.1.54_next@13.1.6: + /next-sitemap/3.1.54_next@13.1.0: resolution: {integrity: sha512-/uzk8hjHU5o6ZelzkLt/LJw9MyFhRiz9VKIst9EhZfF1C/Bw4OCGzLmA+8ImUnTzSxFyuiWr6P1sjFJxKBhjAA==} engines: {node: '>=14.18'} hasBin: true @@ -11249,11 +11249,11 @@ packages: dependencies: '@corex/deepmerge': 4.0.37 minimist: 1.2.8 - next: 13.1.6_biqbaboplfbrettd7655fr4n2y + next: 13.1.0_biqbaboplfbrettd7655fr4n2y dev: false - /next/13.1.6_biqbaboplfbrettd7655fr4n2y: - resolution: {integrity: sha512-hHlbhKPj9pW+Cymvfzc15lvhaOZ54l+8sXDXJWm3OBNBzgrVj6hwGPmqqsXg40xO1Leq+kXpllzRPuncpC0Phw==} + /next/13.1.0_biqbaboplfbrettd7655fr4n2y: + resolution: {integrity: sha512-lQMZH1V94L5IL/WaihQkTYabSY73aqgrkGPJB5uz+2O3ES4I3losV/maXLY7l7x5e+oNyE9N81upNQ8uRsR5/A==} engines: {node: '>=14.6.0'} hasBin: true peerDependencies: @@ -11270,7 +11270,7 @@ packages: sass: optional: true dependencies: - '@next/env': 13.1.6 + '@next/env': 13.1.0 '@swc/helpers': 0.4.14 caniuse-lite: 1.0.30001458 postcss: 8.4.14 @@ -11278,19 +11278,19 @@ packages: react-dom: 18.2.0_react@18.2.0 styled-jsx: 5.1.1_react@18.2.0 optionalDependencies: - '@next/swc-android-arm-eabi': 13.1.6 - '@next/swc-android-arm64': 13.1.6 - '@next/swc-darwin-arm64': 13.1.6 - '@next/swc-darwin-x64': 13.1.6 - '@next/swc-freebsd-x64': 13.1.6 - '@next/swc-linux-arm-gnueabihf': 13.1.6 - '@next/swc-linux-arm64-gnu': 13.1.6 - '@next/swc-linux-arm64-musl': 13.1.6 - '@next/swc-linux-x64-gnu': 13.1.6 - '@next/swc-linux-x64-musl': 13.1.6 - '@next/swc-win32-arm64-msvc': 13.1.6 - '@next/swc-win32-ia32-msvc': 13.1.6 - '@next/swc-win32-x64-msvc': 13.1.6 + '@next/swc-android-arm-eabi': 13.1.0 + '@next/swc-android-arm64': 13.1.0 + '@next/swc-darwin-arm64': 13.1.0 + '@next/swc-darwin-x64': 13.1.0 + '@next/swc-freebsd-x64': 13.1.0 + '@next/swc-linux-arm-gnueabihf': 13.1.0 + '@next/swc-linux-arm64-gnu': 13.1.0 + '@next/swc-linux-arm64-musl': 13.1.0 + '@next/swc-linux-x64-gnu': 13.1.0 + '@next/swc-linux-x64-musl': 13.1.0 + '@next/swc-win32-arm64-msvc': 13.1.0 + '@next/swc-win32-ia32-msvc': 13.1.0 + '@next/swc-win32-x64-msvc': 13.1.0 transitivePeerDependencies: - '@babel/core' - babel-plugin-macros