Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V0.11 #1410

Merged
merged 25 commits into from
Aug 13, 2015
Merged

V0.11 #1410

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5ec2fce
Converted TableHeader to be composible.
jkruder Jul 10, 2015
1a1a0d3
Make table compisble.
jkruder Jul 12, 2015
a1a0d0d
Fixed rebase issues.
jkruder Jul 12, 2015
fbc216e
Updated onRowSelection so that it returns 'all' when all rows are cur…
jkruder Jul 12, 2015
6e99f82
Small code structure change.
jkruder Jul 12, 2015
0226132
Add dangling commas after ...other
jkruder Jul 12, 2015
88a0b01
Updated table docs.
jkruder Jul 13, 2015
0f27542
[SlideInTransitionGroup] Added delay and style props.
hai-cea Jul 16, 2015
b6a5aa3
Merge pull request #1199 from jkruder/table-composible
hai-cea Jul 20, 2015
25ef1ce
Merge branch 'master' into v0.11
hai-cea Jul 21, 2015
91ce3a7
Added Controllability to Tabs Component
Zadielerick Jul 21, 2015
ecda1c4
ESlint Error
Zadielerick Jul 21, 2015
af34e49
Merge pull request #1232 from Zadielerick/NewTabsv0.11
hai-cea Jul 21, 2015
3d976f1
Added support for linkedState mixin in Tabs
Zadielerick Jul 22, 2015
af0e470
Merge pull request #1235 from Zadielerick/NewTabsv0.11
hai-cea Jul 22, 2015
fd41eec
Added InkBar Color prop
Zadielerick Jul 22, 2015
19c1229
Merge pull request #1244 from Zadielerick/inkBarColor
hai-cea Jul 22, 2015
4c13c4d
Upgraded Docs site to use Tabs instead of Left Nav
Zadielerick Jul 27, 2015
a347273
Merge pull request #1246 from Zadielerick/DocsUpgradev0.11
hai-cea Jul 27, 2015
81f2d98
Merge branch 'master' into v0.11
hai-cea Jul 29, 2015
ca36f4f
work towards row selection update
hiddentao Aug 3, 2015
8559e7f
eshint fixes
hiddentao Aug 3, 2015
19107c9
fix selection update bug
hiddentao Aug 10, 2015
534b23d
Merge pull request #1325 from hiddentao/v0.11-row-selection
hai-cea Aug 13, 2015
e92854d
Merge branch 'master' into v0.11
hai-cea Aug 13, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
198 changes: 179 additions & 19 deletions docs/src/app/components/master.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,28 @@ let React = require('react');
let Router = require('react-router');
let AppLeftNav = require('./app-left-nav');
let FullWidthSection = require('./full-width-section');
let { AppBar, AppCanvas, IconButton, Menu, Styles } = require('material-ui');
let { AppBar,
AppCanvas,
FontIcon,
IconButton,
EnhancedButton,
Menu,
Mixins,
RaisedButton,
Styles,
Tab,
Tabs,
Paper} = require('material-ui');

let RouteHandler = Router.RouteHandler;
let { Colors, Typography } = Styles;
let { Colors, Spacing, Typography } = Styles;
let ThemeManager = new Styles.ThemeManager();


class Master extends React.Component {

constructor() {
super();
this._onLeftIconButtonTouchTap = this._onLeftIconButtonTouchTap.bind(this);
}

getChildContext() {
Expand All @@ -34,16 +44,41 @@ class Master extends React.Component {
},
p: {
margin: '0 auto',
padding: '0',
padding: 0,
color: Colors.lightWhite,
maxWidth: '335px'
maxWidth: 335
},
iconButton: {
github: {
position: 'fixed',
right: Spacing.desktopGutter/2,
top: 8,
zIndex: 5,
color: 'white'
},
iconButton: {
color: darkWhite
}
},
};
}

componentWillMount(){
ThemeManager.setComponentThemes({
inkBar: {
backgroundColor: Colors.yellow200,
},
});
this.setState({tabIndex: this._getSelectedIndex()});
let setTabsState = function() {
this.setState({renderTabs: !(document.body.clientWidth <= 647)});
}.bind(this);
setTabsState();
window.onresize = setTabsState;
}

componentWillReceiveProps() {
this.setState({tabIndex: this._getSelectedIndex()});
}

render() {
let styles = this.getStyles();
let title =
Expand All @@ -56,34 +91,159 @@ class Master extends React.Component {
iconStyle={styles.iconButton}
iconClassName="muidocs-icon-custom-github"
href="https://github.com/callemall/material-ui"
linkButton={true} />
linkButton={true}
style={styles.github} />
);

let githubButton2 = (
<IconButton
iconStyle={styles.iconButton}
iconClassName="muidocs-icon-custom-github"
href="https://github.com/callemall/material-ui"
linkButton={true}/>
);

return (
<AppCanvas>

<AppBar
onLeftIconButtonTouchTap={this._onLeftIconButtonTouchTap}
title={title}
zDepth={0}
iconElementRight={githubButton}/>

<AppLeftNav ref="leftNav" />
{githubButton}
{this.state.renderTabs ? this._getTabs(): this._getAppBar()}

<RouteHandler />

<AppLeftNav ref="leftNav" />
<FullWidthSection style={styles.footer}>
<p style={styles.p}>
Hand crafted with love by the engineers at <a style={styles.a} href="http://call-em-all.com">Call-Em-All</a> and our
awesome <a style={styles.a} href="https://github.com/callemall/material-ui/graphs/contributors">contributors</a>.
</p>
{githubButton}
{githubButton2}
</FullWidthSection>

</AppCanvas>
);
}

_getTabs() {
let styles = {
root: {
backgroundColor: Colors.cyan500,
position: 'fixed',
height: 64,
top: 0,
right: 0,
zIndex: 4,
width: '100%',
},
container: {
position: 'absolute',
right: (Spacing.desktopGutter/2) + 48,
bottom: 0,
},
span: {
color: Colors.white,
fontWeight: Typography.fontWeightLight,
left: 45,
top: 22,
position: 'absolute',
fontSize: 26,
},
svgLogoContainer: {
position: 'fixed',
width: 300,
left: Spacing.desktopGutter,
},
svgLogo: {
width: 65,
backgroundColor: Colors.cyan500,
position: 'absolute',
top: 20,
},
tabs: {
width: 425,
bottom:0,
},
tab: {
height: 64
}

};

let materialIcon= this.state.tabIndex !== '0' ? (
<EnhancedButton
style={styles.svgLogoContainer}
linkButton={true}
href="/#/home">
<img style={styles.svgLogo} src="images/material-ui-logo.svg"/>
<span style={styles.span}>material ui</span>
</EnhancedButton>) : null;

return(
<div>
<Paper
zDepth={0}
rounded={false}
style={styles.root}>
{materialIcon}
<div style={styles.container}>
<Tabs
style={styles.tabs}
value={this.state.tabIndex}
onChange={this._handleTabChange.bind(this)}>
<Tab
value="1"
label="GETTING STARTED"
style={styles.tab}
route="get-started" />
<Tab
value="2"
label="CUSTOMIZATION"
style={styles.tab}
route="customization"/>
<Tab
value="3"
label="COMPONENTS"
style={styles.tab}
route="components"/>
</Tabs>
</div>
</Paper>
</div>
);
}

_getSelectedIndex() {
return this.context.router.isActive('get-started') ? '1' :
this.context.router.isActive('customization') ? '2' :
this.context.router.isActive('components') ? '3' : '0';
}

_handleTabChange(value, e, tab) {
this.context.router.transitionTo(tab.props.route);
this.setState({tabIndex: this._getSelectedIndex()});
}

_getAppBar() {
let title =
this.context.router.isActive('get-started') ? 'Get Started' :
this.context.router.isActive('customization') ? 'Customization' :
this.context.router.isActive('components') ? 'Components' : '';

let githubButton = (
<IconButton
iconClassName="muidocs-icon-custom-github"
href="https://github.com/callemall/material-ui"
linkButton={true}/>
);

return (
<div>
<AppBar
onLeftIconButtonTouchTap={this._onLeftIconButtonTouchTap.bind(this)}
title={title}
zDepth={0}
iconElementRight={githubButton}
style={{position: 'absolute', top: 0}}/>
</div>);
}

_onLeftIconButtonTouchTap() {
this.refs.leftNav.toggle();
}
Expand Down
Loading