forked from mui/mui-x
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TreeView] Add support for checkbox selection (mui#11452)
- Loading branch information
1 parent
5d76933
commit 9178430
Showing
49 changed files
with
930 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
docs/data/tree-view/rich-tree-view/selection/CheckboxMultiSelection.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import { RichTreeView } from '@mui/x-tree-view'; | ||
|
||
const MUI_X_PRODUCTS = [ | ||
{ | ||
id: 'grid', | ||
label: 'Data Grid', | ||
children: [ | ||
{ id: 'grid-community', label: '@mui/x-data-grid' }, | ||
{ id: 'grid-pro', label: '@mui/x-data-grid-pro' }, | ||
{ id: 'grid-premium', label: '@mui/x-data-grid-premium' }, | ||
], | ||
}, | ||
{ | ||
id: 'pickers', | ||
label: 'Date and Time Pickers', | ||
children: [ | ||
{ id: 'pickers-community', label: '@mui/x-date-pickers' }, | ||
{ id: 'pickers-pro', label: '@mui/x-date-pickers-pro' }, | ||
], | ||
}, | ||
{ | ||
id: 'charts', | ||
label: 'Charts', | ||
children: [{ id: 'charts-community', label: '@mui/x-charts' }], | ||
}, | ||
{ | ||
id: 'tree-view', | ||
label: 'Tree View', | ||
children: [{ id: 'tree-view-community', label: '@mui/x-tree-view' }], | ||
}, | ||
]; | ||
|
||
export default function CheckboxMultiSelection() { | ||
return ( | ||
<Box sx={{ height: 264, flexGrow: 1, maxWidth: 400 }}> | ||
<RichTreeView multiSelect checkboxSelection items={MUI_X_PRODUCTS} /> | ||
</Box> | ||
); | ||
} |
41 changes: 41 additions & 0 deletions
41
docs/data/tree-view/rich-tree-view/selection/CheckboxMultiSelection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import { RichTreeView, TreeViewBaseItem } from '@mui/x-tree-view'; | ||
|
||
const MUI_X_PRODUCTS: TreeViewBaseItem[] = [ | ||
{ | ||
id: 'grid', | ||
label: 'Data Grid', | ||
children: [ | ||
{ id: 'grid-community', label: '@mui/x-data-grid' }, | ||
{ id: 'grid-pro', label: '@mui/x-data-grid-pro' }, | ||
{ id: 'grid-premium', label: '@mui/x-data-grid-premium' }, | ||
], | ||
}, | ||
{ | ||
id: 'pickers', | ||
label: 'Date and Time Pickers', | ||
children: [ | ||
{ id: 'pickers-community', label: '@mui/x-date-pickers' }, | ||
{ id: 'pickers-pro', label: '@mui/x-date-pickers-pro' }, | ||
], | ||
}, | ||
{ | ||
id: 'charts', | ||
label: 'Charts', | ||
children: [{ id: 'charts-community', label: '@mui/x-charts' }], | ||
}, | ||
{ | ||
id: 'tree-view', | ||
label: 'Tree View', | ||
children: [{ id: 'tree-view-community', label: '@mui/x-tree-view' }], | ||
}, | ||
]; | ||
|
||
export default function CheckboxMultiSelection() { | ||
return ( | ||
<Box sx={{ height: 264, flexGrow: 1, maxWidth: 400 }}> | ||
<RichTreeView multiSelect checkboxSelection items={MUI_X_PRODUCTS} /> | ||
</Box> | ||
); | ||
} |
1 change: 1 addition & 0 deletions
1
docs/data/tree-view/rich-tree-view/selection/CheckboxMultiSelection.tsx.preview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<RichTreeView multiSelect checkboxSelection items={MUI_X_PRODUCTS} /> |
41 changes: 41 additions & 0 deletions
41
docs/data/tree-view/rich-tree-view/selection/CheckboxSelection.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import { RichTreeView } from '@mui/x-tree-view'; | ||
|
||
const MUI_X_PRODUCTS = [ | ||
{ | ||
id: 'grid', | ||
label: 'Data Grid', | ||
children: [ | ||
{ id: 'grid-community', label: '@mui/x-data-grid' }, | ||
{ id: 'grid-pro', label: '@mui/x-data-grid-pro' }, | ||
{ id: 'grid-premium', label: '@mui/x-data-grid-premium' }, | ||
], | ||
}, | ||
{ | ||
id: 'pickers', | ||
label: 'Date and Time Pickers', | ||
children: [ | ||
{ id: 'pickers-community', label: '@mui/x-date-pickers' }, | ||
{ id: 'pickers-pro', label: '@mui/x-date-pickers-pro' }, | ||
], | ||
}, | ||
{ | ||
id: 'charts', | ||
label: 'Charts', | ||
children: [{ id: 'charts-community', label: '@mui/x-charts' }], | ||
}, | ||
{ | ||
id: 'tree-view', | ||
label: 'Tree View', | ||
children: [{ id: 'tree-view-community', label: '@mui/x-tree-view' }], | ||
}, | ||
]; | ||
|
||
export default function CheckboxSelection() { | ||
return ( | ||
<Box sx={{ height: 264, flexGrow: 1, maxWidth: 400 }}> | ||
<RichTreeView checkboxSelection items={MUI_X_PRODUCTS} /> | ||
</Box> | ||
); | ||
} |
41 changes: 41 additions & 0 deletions
41
docs/data/tree-view/rich-tree-view/selection/CheckboxSelection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import { RichTreeView, TreeViewBaseItem } from '@mui/x-tree-view'; | ||
|
||
const MUI_X_PRODUCTS: TreeViewBaseItem[] = [ | ||
{ | ||
id: 'grid', | ||
label: 'Data Grid', | ||
children: [ | ||
{ id: 'grid-community', label: '@mui/x-data-grid' }, | ||
{ id: 'grid-pro', label: '@mui/x-data-grid-pro' }, | ||
{ id: 'grid-premium', label: '@mui/x-data-grid-premium' }, | ||
], | ||
}, | ||
{ | ||
id: 'pickers', | ||
label: 'Date and Time Pickers', | ||
children: [ | ||
{ id: 'pickers-community', label: '@mui/x-date-pickers' }, | ||
{ id: 'pickers-pro', label: '@mui/x-date-pickers-pro' }, | ||
], | ||
}, | ||
{ | ||
id: 'charts', | ||
label: 'Charts', | ||
children: [{ id: 'charts-community', label: '@mui/x-charts' }], | ||
}, | ||
{ | ||
id: 'tree-view', | ||
label: 'Tree View', | ||
children: [{ id: 'tree-view-community', label: '@mui/x-tree-view' }], | ||
}, | ||
]; | ||
|
||
export default function CheckboxSelection() { | ||
return ( | ||
<Box sx={{ height: 264, flexGrow: 1, maxWidth: 400 }}> | ||
<RichTreeView checkboxSelection items={MUI_X_PRODUCTS} /> | ||
</Box> | ||
); | ||
} |
1 change: 1 addition & 0 deletions
1
docs/data/tree-view/rich-tree-view/selection/CheckboxSelection.tsx.preview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<RichTreeView checkboxSelection items={MUI_X_PRODUCTS} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
docs/data/tree-view/simple-tree-view/selection/CheckboxMultiSelection.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import { SimpleTreeView } from '@mui/x-tree-view/SimpleTreeView'; | ||
import { TreeItem } from '@mui/x-tree-view/TreeItem'; | ||
|
||
export default function CheckboxMultiSelection() { | ||
return ( | ||
<Box sx={{ height: 264, flexGrow: 1, maxWidth: 400 }}> | ||
<SimpleTreeView multiSelect checkboxSelection> | ||
<TreeItem itemId="grid" label="Data Grid"> | ||
<TreeItem itemId="grid-community" label="@mui/x-data-grid" /> | ||
<TreeItem itemId="grid-pro" label="@mui/x-data-grid-pro" /> | ||
<TreeItem itemId="grid-premium" label="@mui/x-data-grid-premium" /> | ||
</TreeItem> | ||
<TreeItem itemId="pickers" label="Date and Time Pickers"> | ||
<TreeItem itemId="pickers-community" label="@mui/x-date-pickers" /> | ||
<TreeItem itemId="pickers-pro" label="@mui/x-date-pickers-pro" /> | ||
</TreeItem> | ||
<TreeItem itemId="charts" label="Charts"> | ||
<TreeItem itemId="charts-community" label="@mui/x-charts" /> | ||
</TreeItem> | ||
<TreeItem itemId="tree-view" label="Tree View"> | ||
<TreeItem itemId="tree-view-community" label="@mui/x-tree-view" /> | ||
</TreeItem> | ||
</SimpleTreeView> | ||
</Box> | ||
); | ||
} |
28 changes: 28 additions & 0 deletions
28
docs/data/tree-view/simple-tree-view/selection/CheckboxMultiSelection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import { SimpleTreeView } from '@mui/x-tree-view/SimpleTreeView'; | ||
import { TreeItem } from '@mui/x-tree-view/TreeItem'; | ||
|
||
export default function CheckboxMultiSelection() { | ||
return ( | ||
<Box sx={{ height: 264, flexGrow: 1, maxWidth: 400 }}> | ||
<SimpleTreeView multiSelect checkboxSelection> | ||
<TreeItem itemId="grid" label="Data Grid"> | ||
<TreeItem itemId="grid-community" label="@mui/x-data-grid" /> | ||
<TreeItem itemId="grid-pro" label="@mui/x-data-grid-pro" /> | ||
<TreeItem itemId="grid-premium" label="@mui/x-data-grid-premium" /> | ||
</TreeItem> | ||
<TreeItem itemId="pickers" label="Date and Time Pickers"> | ||
<TreeItem itemId="pickers-community" label="@mui/x-date-pickers" /> | ||
<TreeItem itemId="pickers-pro" label="@mui/x-date-pickers-pro" /> | ||
</TreeItem> | ||
<TreeItem itemId="charts" label="Charts"> | ||
<TreeItem itemId="charts-community" label="@mui/x-charts" /> | ||
</TreeItem> | ||
<TreeItem itemId="tree-view" label="Tree View"> | ||
<TreeItem itemId="tree-view-community" label="@mui/x-tree-view" /> | ||
</TreeItem> | ||
</SimpleTreeView> | ||
</Box> | ||
); | ||
} |
Oops, something went wrong.