forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Treeview] Add node selection support (mui#18357)
- Loading branch information
1 parent
52a81e2
commit 4380774
Showing
19 changed files
with
1,500 additions
and
622 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
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
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/src/pages/components/tree-view/MultiSelectTreeView.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 React from 'react'; | ||
import { makeStyles } from '@material-ui/core/styles'; | ||
import TreeView from '@material-ui/lab/TreeView'; | ||
import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; | ||
import ChevronRightIcon from '@material-ui/icons/ChevronRight'; | ||
import TreeItem from '@material-ui/lab/TreeItem'; | ||
|
||
const useStyles = makeStyles({ | ||
root: { | ||
height: 216, | ||
flexGrow: 1, | ||
maxWidth: 400, | ||
}, | ||
}); | ||
|
||
export default function MultiSelectTreeView() { | ||
const classes = useStyles(); | ||
|
||
return ( | ||
<TreeView | ||
className={classes.root} | ||
defaultCollapseIcon={<ExpandMoreIcon />} | ||
defaultExpandIcon={<ChevronRightIcon />} | ||
multiSelect | ||
> | ||
<TreeItem nodeId="1" label="Applications"> | ||
<TreeItem nodeId="2" label="Calendar" /> | ||
<TreeItem nodeId="3" label="Chrome" /> | ||
<TreeItem nodeId="4" label="Webstorm" /> | ||
</TreeItem> | ||
<TreeItem nodeId="5" label="Documents"> | ||
<TreeItem nodeId="6" label="Material-UI"> | ||
<TreeItem nodeId="7" label="src"> | ||
<TreeItem nodeId="8" label="index.js" /> | ||
<TreeItem nodeId="9" label="tree-view.js" /> | ||
</TreeItem> | ||
</TreeItem> | ||
</TreeItem> | ||
</TreeView> | ||
); | ||
} |
41 changes: 41 additions & 0 deletions
41
docs/src/pages/components/tree-view/MultiSelectTreeView.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 React from 'react'; | ||
import { makeStyles } from '@material-ui/core/styles'; | ||
import TreeView from '@material-ui/lab/TreeView'; | ||
import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; | ||
import ChevronRightIcon from '@material-ui/icons/ChevronRight'; | ||
import TreeItem from '@material-ui/lab/TreeItem'; | ||
|
||
const useStyles = makeStyles({ | ||
root: { | ||
height: 216, | ||
flexGrow: 1, | ||
maxWidth: 400, | ||
}, | ||
}); | ||
|
||
export default function MultiSelectTreeView() { | ||
const classes = useStyles(); | ||
|
||
return ( | ||
<TreeView | ||
className={classes.root} | ||
defaultCollapseIcon={<ExpandMoreIcon />} | ||
defaultExpandIcon={<ChevronRightIcon />} | ||
multiSelect | ||
> | ||
<TreeItem nodeId="1" label="Applications"> | ||
<TreeItem nodeId="2" label="Calendar" /> | ||
<TreeItem nodeId="3" label="Chrome" /> | ||
<TreeItem nodeId="4" label="Webstorm" /> | ||
</TreeItem> | ||
<TreeItem nodeId="5" label="Documents"> | ||
<TreeItem nodeId="6" label="Material-UI"> | ||
<TreeItem nodeId="7" label="src"> | ||
<TreeItem nodeId="8" label="index.js" /> | ||
<TreeItem nodeId="9" label="tree-view.js" /> | ||
</TreeItem> | ||
</TreeItem> | ||
</TreeItem> | ||
</TreeView> | ||
); | ||
} |
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
Oops, something went wrong.