-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2120 from oliviertassinari/inline
[DatePicker] Add inline property
- Loading branch information
Showing
5 changed files
with
99 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
const React = require('react'); | ||
const Paper = require('../paper'); | ||
|
||
const DatePickerInline = React.createClass({ | ||
|
||
propTypes: { | ||
open: React.PropTypes.bool, | ||
}, | ||
|
||
getDefaultProps() { | ||
return { | ||
open: false, | ||
}; | ||
}, | ||
|
||
render() { | ||
const { | ||
actions, | ||
children, | ||
open, | ||
style, | ||
...other, | ||
} = this.props; | ||
|
||
if (!open) { | ||
return <span />; | ||
} | ||
|
||
const styles = { | ||
actions: { | ||
marginRight: 8, | ||
paddingBottom: 12, | ||
textAlign: 'right', | ||
}, | ||
container: { | ||
zIndex: 3, | ||
width: '100%', | ||
position: 'relative', | ||
display: 'block', | ||
}, | ||
subContainer: { | ||
position: 'absolute', | ||
height: 'auto', | ||
}, | ||
}; | ||
return ( | ||
<div style={styles.container}> | ||
<div style={styles.subContainer}> | ||
<Paper {...other}> | ||
{children} | ||
<div style={styles.actions}> | ||
{actions} | ||
</div> | ||
</Paper> | ||
</div> | ||
</div> | ||
); | ||
}, | ||
|
||
}); | ||
|
||
module.exports = DatePickerInline; |
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
type: 'one of: dialog, inline',
?