From d4864ac6e9438b8a172e71f3a4f26a0876cd3b26 Mon Sep 17 00:00:00 2001 From: Amelia Wattenberger Date: Fri, 25 Mar 2022 15:26:29 -0700 Subject: [PATCH 1/5] feat: add number of columns fixes #26 --- src/components/grid.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/grid.tsx b/src/components/grid.tsx index 133bb43..d2fcbb9 100644 --- a/src/components/grid.tsx +++ b/src/components/grid.tsx @@ -527,7 +527,7 @@ export function Grid(props: GridProps) {
Showing {filteredData.length.toLocaleString()} {isFiltered && ` of ${data.length.toLocaleString()}`} row - {(isFiltered ? filteredData : data).length === 1 ? '' : 's'} + {data.length === 1 ? '' : 's'} × {columnNames.length.toLocaleString()} column{columnNames.length === 1 ? '' : 's'}
From 97f767948fbde49cbd9bf3b68a8fe9ee6ba247f8 Mon Sep 17 00:00:00 2001 From: Amelia Wattenberger Date: Fri, 25 Mar 2022 15:27:28 -0700 Subject: [PATCH 2/5] v0.14.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0ef174e..5f86648 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "0.13.5", + "version": "0.14.0", "license": "MIT", "main": "dist/index.js", "typings": "dist/index.d.ts", From 6dff1ef76b1fe52c8392fbac42194ce9a66b4cbb Mon Sep 17 00:00:00 2001 From: Amelia Wattenberger Date: Thu, 5 May 2022 13:36:40 -0700 Subject: [PATCH 3/5] fix: handle getCellIndicies when child is undefined --- src/components/sticky-grid.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/sticky-grid.tsx b/src/components/sticky-grid.tsx index 06d7d46..dfcce35 100644 --- a/src/components/sticky-grid.tsx +++ b/src/components/sticky-grid.tsx @@ -6,7 +6,10 @@ import tw from 'twin.macro'; import { FilterValue } from '../types'; function getCellIndicies(child) { - return { row: child.props.rowIndex, column: child.props.columnIndex }; + return { + row: child?.props.rowIndex || 0, + column: child?.props.columnIndex || 0 + }; } function getShownIndicies(children) { From 261d676352230fe2ed20e670cb22d30a3480aaf1 Mon Sep 17 00:00:00 2001 From: Amelia Wattenberger Date: Thu, 5 May 2022 13:40:42 -0700 Subject: [PATCH 4/5] v0.14.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5f86648..e05b812 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "0.14.0", + "version": "0.14.1", "license": "MIT", "main": "dist/index.js", "typings": "dist/index.d.ts", From cfd8b6ef8817c511f2e794518eedfb4ed32bda89 Mon Sep 17 00:00:00 2001 From: Viktor Persson Date: Mon, 6 Jun 2022 20:23:05 +0200 Subject: [PATCH 5/5] Update readme; fix docs on defaultSort. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f12af83..f967a86 100644 --- a/README.md +++ b/README.md @@ -88,9 +88,9 @@ The user can interact with the table and update the filters, but the table will ### defaultSort -`string` +`array` -The name of the column you want the table to initialize sorting by. The user can interact with the table and update the sort, but the table will use the default sort when `defaultSort` or `data` changes. +The name of the column and the order you want the table to initialize sorting by (e.g. `["Location", "desc"]`). The user can interact with the table and update the sort, but the table will use the default sort when `defaultSort` or `data` changes. ### defaultStickyColumnName