-
Notifications
You must be signed in to change notification settings - Fork 933
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/gregnb/mui-datatables int…
…o enhancement/issue-857-server-side-filters # Conflicts: # README.md # test/MUIDataTable.test.js # webpack.config.js
- Loading branch information
Showing
47 changed files
with
492 additions
and
182 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import {Link} from "react-router-dom"; | ||
import {Card, CardContent, Grid, Typography} from "@material-ui/core"; | ||
import React from "react"; | ||
import examples from "../examples"; | ||
import {withStyles} from "@material-ui/core/styles/index"; | ||
|
||
const styles = { | ||
container: { | ||
flexGrow: 1, | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
marginTop: 16, | ||
}, | ||
card: { | ||
'&:hover': { | ||
background: 'lightgrey', | ||
fontWeight: 500, | ||
} | ||
}, | ||
cardContent: { | ||
'&:last-child': { | ||
padding: 8, | ||
} | ||
}, | ||
link: { | ||
textDecoration: 'none', | ||
}, | ||
label: { | ||
fontWeight: 'inherit' | ||
} | ||
}; | ||
|
||
function ExamplesGrid(props) { | ||
const {classes} = props; | ||
|
||
// Sort Examples alphabetically | ||
const examplesSorted = {}; | ||
Object.keys(examples).sort().forEach(function (key) { | ||
examplesSorted[key] = examples[key]; | ||
}); | ||
|
||
const examplesSortedKeys = Object.keys(examplesSorted); | ||
|
||
return <React.Fragment> | ||
<Typography variant="h5" align="center">Choose an Example</Typography> | ||
<Typography variant="subtitle2" align="center">({examplesSortedKeys.length}) Examples</Typography> | ||
<Grid container className={classes.container} spacing={16}> | ||
{examplesSortedKeys.map((label, index) => ( | ||
<Grid key={index} item md={2}> | ||
<Link className={classes.link} to={`/${label.replace(/\s+/g, '-').toLowerCase()}`}> | ||
<Card className={classes.card}> | ||
<CardContent className={classes.cardContent}> | ||
<Typography variant="subtitle1" className={classes.label} align="center">{label}</Typography> | ||
</CardContent> | ||
</Card> | ||
</Link> | ||
</Grid> | ||
))} | ||
</Grid> | ||
</React.Fragment>; | ||
} | ||
|
||
export default withStyles(styles)(ExamplesGrid); |
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,36 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import {HashRouter as Router, Route, Switch} from 'react-router-dom'; | ||
import {withStyles} from "@material-ui/core/styles/index"; | ||
import ExamplesGrid from "./ExamplesGrid"; | ||
import examples from "../examples"; | ||
|
||
const styles = { | ||
root: { | ||
display: 'flex', | ||
justifyContent: 'center', | ||
}, | ||
contentWrapper: { | ||
width: '100%', | ||
}, | ||
}; | ||
|
||
function Examples(props) { | ||
const {classes} = props; | ||
return <main className={classes.root}> | ||
<div className={classes.contentWrapper}> | ||
<Router hashType="noslash"> | ||
<Switch> | ||
<Route path="/" exact render={() => <ExamplesGrid examples={examples}/>}/> | ||
{Object.keys(examples).map((label, index) => ( | ||
<Route key={index} path={`/${label.replace(/\s+/g, '-').toLowerCase()}`} exact component={examples[label]}/> | ||
))} | ||
</Switch> | ||
</Router> | ||
</div> | ||
</main>; | ||
} | ||
|
||
const StyledExamples = withStyles(styles)(Examples); | ||
|
||
ReactDOM.render(<StyledExamples/>, document.getElementById('app-root')); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import ArrayValueColumns from "./array-value-columns"; | ||
import ColumnFilters from "./column-filters"; | ||
import ColumnOptionsUpdate from "./column-options-update"; | ||
import Component from "./component"; | ||
import CSVExport from "./csv-export"; | ||
import CustomActionColumns from "./custom-action-columns"; | ||
import CustomizeColumns from "./customize-columns"; | ||
import CustomizeFilter from "./customize-filter"; | ||
import CustomizeFooter from "./customize-footer"; | ||
import CustomizeRows from "./customize-rows"; | ||
import CustomizeSearch from "./customize-search"; | ||
import CustomizeSearchRender from "./customize-search-render"; | ||
import CustomizeSorting from "./customize-sorting"; | ||
import CustomizeStyling from "./customize-styling"; | ||
import CustomizeToolbar from "./customize-toolbar"; | ||
import CustomizeToolbarSelect from "./customize-toolbarselect"; | ||
import DataAsObjects from "./data-as-objects"; | ||
import ExpandableRows from "./expandable-rows"; | ||
import FixedHeader from "./fixed-header"; | ||
import HideColumnsPrint from "./hide-columns-print"; | ||
import OnDownload from "./on-download"; | ||
import OnTableInit from "./on-table-init"; | ||
import ResizableColumns from "./resizable-columns"; | ||
import SelectableRows from "./selectable-rows"; | ||
import ServerSideOptions from "./serverside-options"; | ||
import ServerSidePagination from "./serverside-pagination"; | ||
import Simple from "./simple"; | ||
import SimpleNoToolbar from "./simple-no-toolbar"; | ||
import TextLocalization from "./text-localization"; | ||
import Themes from "./themes"; | ||
|
||
/** | ||
* Here you can add any extra examples with the Card label as the key, and the component to render as the value | ||
*/ | ||
export default { | ||
'Array Value Columns': ArrayValueColumns, | ||
'Column Filters': ColumnFilters, | ||
'Column Option Update': ColumnOptionsUpdate, | ||
'Component': Component, | ||
'CSV Export': CSVExport, | ||
'Custom ActionColumns': CustomActionColumns, | ||
'Customize columns': CustomizeColumns, | ||
'Customize Filter': CustomizeFilter, | ||
'Customize Footer': CustomizeFooter, | ||
'Customize Rows': CustomizeRows, | ||
'Customize Search': CustomizeSearch, | ||
'Customize Search Render': CustomizeSearchRender, | ||
'Customize Sorting': CustomizeSorting, | ||
'Customize Styling': CustomizeStyling, | ||
'Customize Toolbar': CustomizeToolbar, | ||
'Customize Toolbar Select': CustomizeToolbarSelect, | ||
'Data As Objects': DataAsObjects, | ||
'expandableRows': ExpandableRows, | ||
'fixedHeader': FixedHeader, | ||
'Hide Columns Print': HideColumnsPrint, | ||
'OnDownload': OnDownload, | ||
'OnTableInit': OnTableInit, | ||
'resizableColumns': ResizableColumns, | ||
'selectableRows': SelectableRows, | ||
'serverSide Options': ServerSideOptions, | ||
'serverSide Pagination': ServerSidePagination, | ||
'Simple': Simple, | ||
'Simple No Toolbar': SimpleNoToolbar, | ||
'Text Localization': TextLocalization, | ||
'Themes': Themes, | ||
}; |
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
Oops, something went wrong.