Skip to content

Commit 805227d

Browse files
committed
release v2.11.0
1 parent 99ff761 commit 805227d

File tree

22 files changed

+155
-92
lines changed

22 files changed

+155
-92
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ _All features can easily be enabled/disabled_
6868

6969
_**Fully Fleshed out [Docs](https://www.material-react-table.com/docs/guides#guides) are available for all features**_
7070

71-
- [x] 43-53kb gzipped - [Bundlephobia](https://bundlephobia.com/package/material-react-table)
71+
- [x] 30-54kb gzipped - [Bundlephobia](https://bundlephobia.com/package/material-react-table)
7272
- [x] Advanced TypeScript Generics Support (TypeScript Optional)
7373
- [x] Aggregation and Grouping (Sum, Average, Count, etc.)
74+
- [x] Cell Actions (Right-click Context Menu)
7475
- [x] Click To Copy Cell Values
7576
- [x] Column Action Dropdown Menu
7677
- [x] Column Hiding
@@ -79,7 +80,7 @@ _**Fully Fleshed out [Docs](https://www.material-react-table.com/docs/guides#gui
7980
- [x] Column Resizing
8081
- [x] Customize Icons
8182
- [x] Customize Styling of internal Mui Components
82-
- [x] Data Editing (4 different editing modes)
83+
- [x] Data Editing and Creating (5 different editing modes)
8384
- [x] Density Toggle
8485
- [x] Detail Panels (Expansion)
8586
- [x] Faceted Value Generation for Filter Options

apps/material-react-table-docs/components/navigation/TopBar.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export const TopBar = ({ navOpen, setNavOpen }: Props) => {
194194
target="_blank"
195195
>
196196
<IconButton aria-label="Github" size="small">
197-
<GitHubIcon fontSize={isMobile ? 'medium' : 'large'} />
197+
<GitHubIcon />
198198
</IconButton>
199199
</a>
200200
</Tooltip>
@@ -207,7 +207,7 @@ export const TopBar = ({ navOpen, setNavOpen }: Props) => {
207207
<IconButton aria-label="Discord" size="small">
208208
<img
209209
alt="Discord"
210-
height={isMobile ? 20 : 25}
210+
height={20}
211211
style={{
212212
padding: '-3px',
213213
borderRadius: '50%',
@@ -228,11 +228,7 @@ export const TopBar = ({ navOpen, setNavOpen }: Props) => {
228228
}}
229229
size="small"
230230
>
231-
{isLightTheme ? (
232-
<LightModeIcon fontSize={isMobile ? 'medium' : 'large'} />
233-
) : (
234-
<DarkModeIcon fontSize={isMobile ? 'medium' : 'large'} />
235-
)}
231+
{isLightTheme ? <LightModeIcon /> : <DarkModeIcon />}
236232
</IconButton>
237233
</Tooltip>
238234
</Box>

apps/material-react-table-docs/examples/custom-headless/sandbox/src/JS.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,16 @@ const Example = () => {
9999
))}
100100
</TableHead>
101101
<TableBody>
102-
{table.getRowModel().rows.map((row) => (
102+
{table.getRowModel().rows.map((row, rowIndex) => (
103103
<TableRow key={row.id} selected={row.getIsSelected()}>
104-
{row.getVisibleCells().map((cell) => (
104+
{row.getVisibleCells().map((cell, _columnIndex) => (
105105
<TableCell align="center" variant="body" key={cell.id}>
106106
{/* Use MRT's cell renderer that provides better logic than flexRender */}
107-
<MRT_TableBodyCellValue cell={cell} table={table} />
107+
<MRT_TableBodyCellValue
108+
cell={cell}
109+
table={table}
110+
staticRowIndex={rowIndex} //just for batch row selection to work
111+
/>
108112
</TableCell>
109113
))}
110114
</TableRow>

apps/material-react-table-docs/examples/custom-headless/sandbox/src/TS.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,16 @@ const Example = () => {
100100
))}
101101
</TableHead>
102102
<TableBody>
103-
{table.getRowModel().rows.map((row) => (
103+
{table.getRowModel().rows.map((row, rowIndex) => (
104104
<TableRow key={row.id} selected={row.getIsSelected()}>
105-
{row.getVisibleCells().map((cell) => (
105+
{row.getVisibleCells().map((cell, _columnIndex) => (
106106
<TableCell align="center" variant="body" key={cell.id}>
107107
{/* Use MRT's cell renderer that provides better logic than flexRender */}
108-
<MRT_TableBodyCellValue cell={cell} table={table} />
108+
<MRT_TableBodyCellValue
109+
cell={cell}
110+
table={table}
111+
staticRowIndex={rowIndex} //just for batch row selection to work
112+
/>
109113
</TableCell>
110114
))}
111115
</TableRow>

apps/material-react-table-docs/examples/manual-selection/sandbox/src/JS.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const Example = () => {
7171
onClick: () =>
7272
setRowSelection((prev) => ({
7373
...prev,
74-
[row.id]: !prev[row.id],
74+
[row.id]: !prev[row.id], //this is a simple toggle implementation
7575
})),
7676
selected: rowSelection[row.id],
7777
sx: {

apps/material-react-table-docs/examples/manual-selection/sandbox/src/TS.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const Example = () => {
8585
onClick: () =>
8686
setRowSelection((prev) => ({
8787
...prev,
88-
[row.id]: !prev[row.id],
88+
[row.id]: !prev[row.id], //this is a simple toggle implementation
8989
})),
9090
selected: rowSelection[row.id],
9191
sx: {

apps/material-react-table-docs/pages/changelog.mdx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ import Head from 'next/head';
1212

1313
### Version 2
1414

15+
#### Version 2.11.0 - 2024-02-05
16+
17+
- Added new `enableBatchRowSelection` table option that is enabled by default that allows users to select multiple rows at once by holding down the shift key and clicking on a row
18+
- Added small "Clear selection" button to the toolbar alert banner selected message by default when rows are selected
19+
- Now exporting all `MRT_*Props` component prop types
20+
- Added new override option for passing in custom spinner while loading data with the `muiCircularProgressProps.Component` prop
21+
- Fixed Autocomplete filter showing filter values instead of display labels once value is selected
22+
- Removed default Header html title attribute on all header cells
23+
1524
#### Version 2.10.0 - 2024-01-31
1625

1726
- Added automatic column order state recalculation for dynamic columns and dynamic MRT display columns being enabled/disabled
@@ -20,7 +29,7 @@ import Head from 'next/head';
2029
- Added new Cell Actions features which will show a MUI context menu when a cell is right-clicked
2130
- New `enableCellActions` table option
2231
- New `renderCellActionMenuItems` table and column options
23-
- New `MRT_ActionMenuItem` component to make styling all MRT menu items consistently (icons, text, spacing) easier to be consistent.
32+
- New `MRT_ActionMenuItem` component to make styling all MRT menu items consistently (icons, text, spacing) easier to be consistent
2433
- Fixed bug where the show all columns action menu item ignored the `enableHiding` column option
2534

2635
#### Version 2.9.2 - 2024-01-25

apps/material-react-table-docs/pages/docs/guides/async-loading.mdx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,25 @@ return <MaterialReactTable table={table} />;
114114

115115
<LoadingExample />
116116

117-
#### Only Show Progress Bars or Skeletons
117+
#### Custom Loading Spinner component
118+
119+
> New in v2.11.0
120+
121+
If you need to use a custom loading spinner component other than the built-in MUI one, you can now pass in custom component in the `muiCircularProgressProps` `Component` prop.
122+
123+
```jsx
124+
import { MyCustomSpinner } from './MyCustomSpinner';
125+
126+
const table = useMaterialReactTable({
127+
columns,
128+
data,
129+
muiCircularProgressProps: {
130+
Component: <MyCustomSpinner />,
131+
},
132+
});
133+
```
134+
135+
### Only Show Progress Bars or Skeletons
118136

119137
If you do not want both progress bars and cell skeletons to show, you can use the `showProgressBars` and `showSkeletons` states, instead.
120138

apps/material-react-table-docs/pages/docs/guides/column-filtering.mdx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import CustomizeFilterVariantsExample from '../../../examples/customize-filter-v
88
import CustomizeFilterModesExample from '../../../examples/customize-filter-modes';
99
import CustomizeFilterComponentsExample from '../../../examples/customize-filter-components';
1010
import EnableColumnFacetValuesExample from '../../../examples/enable-filter-facet-values';
11-
import RemoteExample from '../../../examples/remote';
1211

1312
<Head>
1413
<title>{'Column Filtering Guide - Material React Table V2 Docs'}</title>
@@ -353,9 +352,7 @@ return <MaterialReactTable table={table} />;
353352

354353
> Specifying `manualFiltering` turns off all client-side filtering and assumes that the `data` you pass to `<MaterialReactTable />` is already filtered.
355354
356-
Here is the full Remote Data example featuring server-side **filtering**, pagination, and sorting.
357-
358-
<RemoteExample />
355+
See either the [React Query](/docs/examples/react-query) or [useEffect fetching](/docs/examples/remote) examples to see fully server-side **filtering**, pagination, and sorting in action.
359356

360357
### Customize Material UI Filter components
361358

apps/material-react-table-docs/pages/docs/guides/row-selection.mdx

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,30 +58,30 @@ const table = useMaterialReactTable({
5858
return <MaterialReactTable table={table} />;
5959
```
6060

61-
### Batch Row Selection
62-
63-
> New in v2.11.0
61+
#### Enable Row Selection Conditionally Per Row
6462

65-
By default, when the user holds down the <kbd>Shift</kbd> key and clicks a row, all rows between the last selected row and the clicked row will be selected. This can be disabled with the `enableBatchRowSelection` table option.
63+
You can also enable row selection conditionally per row with the same `enableRowSelection` table option, but with a callback function instead of a boolean.
6664

6765
```jsx
68-
const table = useMantineReactTable({
66+
const table = useMaterialReactTable({
6967
columns,
7068
data,
71-
enableRowSelection: true,
72-
enableBatchRowSelection: false, //disable batch row selection with shift key
69+
enableRowSelection: (row) => row.original.age > 18, //disable row selection for rows with age <= 18
7370
});
7471
```
7572

76-
#### Enable Row Selection Conditionally Per Row
73+
### Batch Row Selection
7774

78-
You can also enable row selection conditionally per row with the same `enableRowSelection` table option, but with a callback function instead of a boolean.
75+
> New in v2.11.0
76+
77+
By default, when the user holds down the <kbd>Shift</kbd> key and clicks a row, all rows between the last selected row and the clicked row will be selected. This can be disabled with the `enableBatchRowSelection` table option.
7978

8079
```jsx
81-
const table = useMaterialReactTable({
80+
const table = useMantineReactTable({
8281
columns,
8382
data,
84-
enableRowSelection: (row) => row.original.age > 18, //disable row selection for rows with age <= 18
83+
enableRowSelection: true,
84+
enableBatchRowSelection: false, //disable batch row selection with shift key
8585
});
8686
```
8787

@@ -174,8 +174,9 @@ const table = useMaterialReactTable({
174174
data,
175175
enableRowSelection: true,
176176
//clicking anywhere on the row will select it
177-
muiTableBodyRowProps: ({ row }) => ({
178-
onClick: row.getToggleSelectedHandler(),
177+
muiTableBodyRowProps: ({ row, staticRowIndex, table }) => ({
178+
onClick: (event) =>
179+
getMRT_RowSelectionHandler()({ event, row, staticRowIndex, table }), //import this helper function from material-react-table
179180
sx: { cursor: 'pointer' },
180181
}),
181182
});

0 commit comments

Comments
 (0)