diff --git a/david-docs/src/app/AppRoutes.js b/david-docs/src/app/AppRoutes.js index 50fd139fc04755..170e1c56842bb8 100644 --- a/david-docs/src/app/AppRoutes.js +++ b/david-docs/src/app/AppRoutes.js @@ -66,6 +66,9 @@ import RelatedProjects from './components/pages/discover-more/RelatedProjects'; import StepperPage from './components/pages/components/Stepper/Page'; + +import UserPage from './components/pages/users/Page' + /** * Routes: https://github.com/reactjs/react-router/blob/master/docs/API.md#route * @@ -143,6 +146,9 @@ const AppRoutes = ( + + + ); diff --git a/david-docs/src/app/components/AppNavDrawer.js b/david-docs/src/app/components/AppNavDrawer.js index f291b4252a1e3d..e9f0885c44925d 100644 --- a/david-docs/src/app/components/AppNavDrawer.js +++ b/david-docs/src/app/components/AppNavDrawer.js @@ -422,6 +422,24 @@ class AppNavDrawer extends Component { value="https://www.google.com/design/spec/material-design/introduction.html" /> + + + Store Management System + , + ]} + /> + ); } diff --git a/david-docs/src/app/components/pages/users/ExampleComplex.js b/david-docs/src/app/components/pages/users/ExampleComplex.js new file mode 100644 index 00000000000000..30cda4ddc53baa --- /dev/null +++ b/david-docs/src/app/components/pages/users/ExampleComplex.js @@ -0,0 +1,203 @@ +import React from 'react'; +import {Table, TableBody, TableFooter, TableHeader, TableHeaderColumn, TableRow, TableRowColumn} + from 'material-ui/Table'; +import TextField from 'material-ui/TextField'; +import Toggle from 'material-ui/Toggle'; + +const styles = { + propContainer: { + width: 200, + overflow: 'hidden', + margin: '20px auto 0', + }, + propToggleHeader: { + margin: '20px auto 10px', + }, +}; + +const tableData = [ + { + name: 'John Smith', + status: 'Employed', + selected: true, + }, + { + name: 'Randal White', + status: 'Unemployed', + }, + { + name: 'Stephanie Sanders', + status: 'Employed', + selected: true, + }, + { + name: 'Steve Brown', + status: 'Employed', + }, + { + name: 'Joyce Whitten', + status: 'Employed', + }, + { + name: 'Samuel Roberts', + status: 'Employed', + }, + { + name: 'Adam Moore', + status: 'Employed', + }, +]; + +export default class TableExampleComplex extends React.Component { + + constructor(props) { + super(props); + + this.state = { + fixedHeader: true, + fixedFooter: true, + stripedRows: false, + showRowHover: false, + selectable: true, + multiSelectable: false, + enableSelectAll: false, + deselectOnClickaway: true, + showCheckboxes: true, + height: '300px', + }; + } + + handleToggle = (event, toggled) => { + this.setState({ + [event.target.name]: toggled, + }); + }; + + handleChange = (event) => { + this.setState({height: event.target.value}); + }; + + render() { + return ( +
+ + + + + Super Header + + + + ID + Name + Status + + + + {tableData.map( (row, index) => ( + + {index} + {row.name} + {row.status} + + ))} + + + + ID + Name + Status + + + + Super Footer + + + +
+ +
+

Table Properties

+ + + + + + +

TableBody Properties

+ + + +

Multiple Properties

+ +
+
+ ); + } +} diff --git a/david-docs/src/app/components/pages/users/ExampleSimple.js b/david-docs/src/app/components/pages/users/ExampleSimple.js new file mode 100644 index 00000000000000..759e7901adfc58 --- /dev/null +++ b/david-docs/src/app/components/pages/users/ExampleSimple.js @@ -0,0 +1,39 @@ +import React from 'react'; +import {Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn} from 'material-ui/Table'; + + +const TableExampleSimple = () => ( + + + + ID + Name + Status + + + + + 1 + John Smith + Employed + + + 2 + Randal White + Unemployed + + + 3 + Stephanie Sanders + Employed + + + 4 + Steve Brown + Employed + + +
+); + +export default TableExampleSimple; diff --git a/david-docs/src/app/components/pages/users/Page.js b/david-docs/src/app/components/pages/users/Page.js new file mode 100644 index 00000000000000..fef6bef6dda1fc --- /dev/null +++ b/david-docs/src/app/components/pages/users/Page.js @@ -0,0 +1,55 @@ +import React from 'react'; +import Title from 'react-title-component'; + +import CodeExample from '../../CodeExample'; +import PropTypeDescription from '../../PropTypeDescription'; +import MarkdownElement from '../../MarkdownElement'; + +import tableReadmeText from './README'; +import TableExampleSimple from './ExampleSimple'; +import tableExampleSimpleCode from '!raw!./ExampleSimple'; +import TableExampleComplex from './ExampleComplex'; +import tableExampleComplexCode from '!raw!./ExampleComplex'; + +import tableCode from '!raw!material-ui/Table/Table'; +import tableRowCode from '!raw!material-ui/Table/TableRow'; +import tableRowColumnCode from '!raw!material-ui/Table/TableRowColumn'; +import tableHeaderCode from '!raw!material-ui/Table/TableHeader'; +import tableHeaderColumnCode from '!raw!material-ui/Table/TableHeaderColumn'; +import tableBodyCode from '!raw!material-ui/Table/TableBody'; +import tableFooterCode from '!raw!material-ui/Table/TableFooter'; + +const descriptions = { + simple: 'A simple table demonstrating the hierarchy of the `Table` component and its sub-components.', + complex: 'A more complex example, allowing the table height to be set, and key boolean properties to be toggled.', +}; + +const UserPage = () => ( +
+ `Table - ${previousTitle}`} /> + <MarkdownElement text={tableReadmeText} /> + <CodeExample + title="Simple example" + description={descriptions.simple} + code={tableExampleSimpleCode} + > + <TableExampleSimple /> + </CodeExample> + <CodeExample + title="Complex example" + description={descriptions.complex} + code={tableExampleComplexCode} + > + <TableExampleComplex /> + </CodeExample> + <PropTypeDescription code={tableCode} header="### Table Properties" /> + <PropTypeDescription code={tableRowCode} header="### TableRow Properties" /> + <PropTypeDescription code={tableRowColumnCode} header="### TableRowColumn Properties" /> + <PropTypeDescription code={tableHeaderCode} header="### TableHeader Properties" /> + <PropTypeDescription code={tableHeaderColumnCode} header="### TableHeaderColumn Properties" /> + <PropTypeDescription code={tableBodyCode} header="### TableBody Properties" /> + <PropTypeDescription code={tableFooterCode} header="### TableFooter Properties" /> + </div> +); + +export default UserPage; diff --git a/david-docs/src/app/components/pages/users/README.md b/david-docs/src/app/components/pages/users/README.md new file mode 100644 index 00000000000000..9076a782c79d8b --- /dev/null +++ b/david-docs/src/app/components/pages/users/README.md @@ -0,0 +1,6 @@ +## Table + +[Tables](https://www.google.com/design/spec/components/data-tables.html) +are used to display data and to organize it. + +### Examples