@@ -329,12 +329,7 @@ export const SingleGridFullHeight = {
329
329
< ToolbarAutomaticTitleItem />
330
330
</ StackToolbar >
331
331
< StackMainContent fullHeight >
332
- < DataGrid
333
- columns = { columns }
334
- rows = { rows }
335
- loading = { loading }
336
- slots = { { toolbar : GridToolbar } }
337
- showToolbar />
332
+ < DataGrid columns = { columns } rows = { rows } loading = { loading } slots = { { toolbar : GridToolbar } } showToolbar />
338
333
</ StackMainContent >
339
334
</ >
340
335
) ;
@@ -366,13 +361,7 @@ export const SingleGridAutoHeight = {
366
361
< ToolbarAutomaticTitleItem />
367
362
</ StackToolbar >
368
363
< StackMainContent >
369
- < DataGrid
370
- columns = { columns }
371
- rows = { rows }
372
- loading = { loading }
373
- slots = { { toolbar : GridToolbar } }
374
- autoHeight
375
- showToolbar />
364
+ < DataGrid columns = { columns } rows = { rows } loading = { loading } slots = { { toolbar : GridToolbar } } autoHeight showToolbar />
376
365
</ StackMainContent >
377
366
</ >
378
367
) ;
@@ -442,12 +431,7 @@ export const GridWithFormInADialog = {
442
431
< ToolbarAutomaticTitleItem />
443
432
</ StackToolbar >
444
433
< StackMainContent fullHeight >
445
- < DataGrid
446
- rows = { rows }
447
- columns = { columns }
448
- loading = { loading }
449
- slots = { { toolbar : GridToolbar } }
450
- showToolbar />
434
+ < DataGrid rows = { rows } columns = { columns } loading = { loading } slots = { { toolbar : GridToolbar } } showToolbar />
451
435
</ StackMainContent >
452
436
< EditDialog title = { mode === "add" ? "Add new item" : `${ rows . find ( ( row ) => row . id === selectedId ) ?. title } ` } >
453
437
< DialogContent >
@@ -533,12 +517,7 @@ export const GridWithFormOnAPage = {
533
517
< ToolbarAutomaticTitleItem />
534
518
</ StackToolbar >
535
519
< StackMainContent fullHeight >
536
- < DataGrid
537
- rows = { rows }
538
- columns = { columns }
539
- loading = { loading }
540
- slots = { { toolbar : GridToolbar } }
541
- showToolbar />
520
+ < DataGrid rows = { rows } columns = { columns } loading = { loading } slots = { { toolbar : GridToolbar } } showToolbar />
542
521
</ StackMainContent >
543
522
</ StackPage >
544
523
< StackPage name = "add" >
@@ -651,12 +630,7 @@ export const NestedGridsAndFormsWithTabs = {
651
630
< ToolbarAutomaticTitleItem />
652
631
</ StackToolbar >
653
632
< StackMainContent fullHeight >
654
- < DataGrid
655
- rows = { rows }
656
- columns = { columns }
657
- loading = { loading }
658
- slots = { { toolbar : GridToolbar } }
659
- showToolbar />
633
+ < DataGrid rows = { rows } columns = { columns } loading = { loading } slots = { { toolbar : GridToolbar } } showToolbar />
660
634
</ StackMainContent >
661
635
</ StackPage >
662
636
< StackPage name = "edit" >
@@ -769,12 +743,7 @@ export const NestedFormInGridInTabsInGrid = {
769
743
< ToolbarAutomaticTitleItem />
770
744
</ StackToolbar >
771
745
< StackMainContent fullHeight >
772
- < DataGrid
773
- rows = { rows }
774
- columns = { columns }
775
- loading = { loading }
776
- slots = { { toolbar : GridToolbar } }
777
- showToolbar />
746
+ < DataGrid rows = { rows } columns = { columns } loading = { loading } slots = { { toolbar : GridToolbar } } showToolbar />
778
747
</ StackMainContent >
779
748
</ StackPage >
780
749
< StackPage name = "edit" >
@@ -834,7 +803,7 @@ export const NestedFormInGridInTabsInGrid = {
834
803
export const GridWithSelectionAndMoreActionsMenu = {
835
804
render : ( ) => {
836
805
const [ selectionModel , setSelectionModel ] = useState < GridRowSelectionModel > ( {
837
- type : ' include' ,
806
+ type : " include" ,
838
807
ids : new Set ( [ ] ) ,
839
808
} ) ;
840
809
const { rows, loading } = useData ( ) ;
@@ -847,7 +816,7 @@ export const GridWithSelectionAndMoreActionsMenu = {
847
816
< FillSpace />
848
817
< CrudMoreActionsMenu
849
818
slotProps = { { button : { responsive : true } } }
850
- selectionSize = { selectionModel . length }
819
+ selectionSize = { selectionModel . ids . size }
851
820
overallActions = { [
852
821
{
853
822
label : "Log all items to the console" ,
@@ -894,7 +863,8 @@ export const GridWithSelectionAndMoreActionsMenu = {
894
863
checkboxSelection
895
864
rowSelectionModel = { selectionModel }
896
865
onRowSelectionModelChange = { setSelectionModel }
897
- showToolbar />
866
+ showToolbar
867
+ />
898
868
</ StackMainContent >
899
869
</ >
900
870
) ;
@@ -904,7 +874,7 @@ export const GridWithSelectionAndMoreActionsMenu = {
904
874
export const GridWithSelectionInDialog = {
905
875
render : ( ) => {
906
876
const [ selectionModel , setSelectionModel ] = useState < GridRowSelectionModel > ( {
907
- type : ' include' ,
877
+ type : " include" ,
908
878
ids : new Set ( [ ] ) ,
909
879
} ) ;
910
880
const { rows, loading } = useData ( ) ;
@@ -938,13 +908,13 @@ export const GridWithSelectionInDialog = {
938
908
</ ToolbarActions >
939
909
</ StackToolbar >
940
910
< StackMainContent >
941
- { selectionModel . length > 0 ? (
911
+ { selectionModel . ids . size > 0 ? (
942
912
< >
943
913
< Typography variant = "h4" gutterBottom >
944
914
Selected items
945
915
</ Typography >
946
916
947
- { selectionModel . map ( ( id ) => {
917
+ { Array . from ( selectionModel . ids ) . map ( ( id ) => {
948
918
const row = rows . find ( ( row ) => row . id === id ) ;
949
919
950
920
return (
@@ -970,7 +940,8 @@ export const GridWithSelectionInDialog = {
970
940
autoHeight
971
941
rowSelectionModel = { selectionModel }
972
942
onRowSelectionModelChange = { setSelectionModel }
973
- showToolbar />
943
+ showToolbar
944
+ />
974
945
</ EditDialog >
975
946
</ >
976
947
) ;
0 commit comments