react-bootstrap
Advanced tools
Comparing version 0.23.1 to 0.23.2
@@ -0,1 +1,12 @@ | ||
v0.23.2 - Mon, 08 Jun 2015 18:56:48 GMT | ||
--------------------------------------- | ||
- [7211dcb](../../commit/7211dcb) [added] Add prevIcon and nextIcon props as node proptypes to Carousel | ||
- [5734ec3](../../commit/5734ec3) [added] Pagination component | ||
- [2f8c454](../../commit/2f8c454) [changed] Assert ProgressBar children can be ProgressBar only. | ||
- [2c46820](../../commit/2c46820) [added] `createSelectedEvent` for consistent onSelect handling | ||
- [c2ff9ad](../../commit/c2ff9ad) [added] property disabled on MenuItem | ||
v0.23.1 - Tue, 02 Jun 2015 16:57:57 GMT | ||
@@ -2,0 +13,0 @@ --------------------------------------- |
@@ -27,2 +27,6 @@ 'use strict'; | ||
var _Glyphicon = require('./Glyphicon'); | ||
var _Glyphicon2 = _interopRequireDefault(_Glyphicon); | ||
var Carousel = _react2['default'].createClass({ | ||
@@ -44,3 +48,5 @@ displayName: 'Carousel', | ||
defaultActiveIndex: _react2['default'].PropTypes.number, | ||
direction: _react2['default'].PropTypes.oneOf(['prev', 'next']) | ||
direction: _react2['default'].PropTypes.oneOf(['prev', 'next']), | ||
prevIcon: _react2['default'].PropTypes.node, | ||
nextIcon: _react2['default'].PropTypes.node | ||
}, | ||
@@ -55,3 +61,5 @@ | ||
indicators: true, | ||
controls: true | ||
controls: true, | ||
prevIcon: _react2['default'].createElement(_Glyphicon2['default'], { glyph: 'chevron-left' }), | ||
nextIcon: _react2['default'].createElement(_Glyphicon2['default'], { glyph: 'chevron-right' }) | ||
}; | ||
@@ -185,3 +193,3 @@ }, | ||
{ className: 'left carousel-control', href: '#prev', key: 0, onClick: this.prev }, | ||
_react2['default'].createElement('span', { className: 'glyphicon glyphicon-chevron-left' }) | ||
this.props.prevIcon | ||
); | ||
@@ -194,3 +202,3 @@ }, | ||
{ className: 'right carousel-control', href: '#next', key: 1, onClick: this.next }, | ||
_react2['default'].createElement('span', { className: 'glyphicon glyphicon-chevron-right' }) | ||
this.props.nextIcon | ||
); | ||
@@ -197,0 +205,0 @@ }, |
@@ -145,2 +145,6 @@ 'use strict'; | ||
var _Pagination = require('./Pagination'); | ||
var _Pagination2 = _interopRequireDefault(_Pagination); | ||
var _Popover = require('./Popover'); | ||
@@ -260,2 +264,4 @@ | ||
Pagination: _Pagination2['default'], | ||
Popover: _Popover2['default'], | ||
@@ -262,0 +268,0 @@ |
@@ -157,2 +157,6 @@ 'use strict'; | ||
var _Pagination = require('./Pagination'); | ||
var _Pagination2 = _interopRequireDefault(_Pagination); | ||
var _Panel = require('./Panel'); | ||
@@ -268,2 +272,3 @@ | ||
Pager: _Pager2['default'], | ||
Pagination: _Pagination2['default'], | ||
Popover: _Popover2['default'], | ||
@@ -270,0 +275,0 @@ ProgressBar: _ProgressBar2['default'], |
@@ -30,3 +30,4 @@ 'use strict'; | ||
eventKey: _react2['default'].PropTypes.any, | ||
active: _react2['default'].PropTypes.bool | ||
active: _react2['default'].PropTypes.bool, | ||
disabled: _react2['default'].PropTypes.bool | ||
}, | ||
@@ -42,2 +43,6 @@ | ||
handleClick: function handleClick(e) { | ||
if (this.props.disabled) { | ||
e.preventDefault(); | ||
return; | ||
} | ||
if (this.props.onSelect) { | ||
@@ -61,3 +66,4 @@ e.preventDefault(); | ||
'divider': this.props.divider, | ||
'active': this.props.active | ||
'active': this.props.active, | ||
'disabled': this.props.disabled | ||
}; | ||
@@ -64,0 +70,0 @@ |
@@ -0,1 +1,4 @@ | ||
/* eslint react/prop-types: [1, {ignore: ["className", "bsStyle"]}]*/ | ||
/* BootstrapMixin contains `bsStyle` type validation */ | ||
'use strict'; | ||
@@ -35,9 +38,12 @@ | ||
propTypes: { | ||
min: _react2['default'].PropTypes.number, | ||
now: _react2['default'].PropTypes.number, | ||
max: _react2['default'].PropTypes.number, | ||
label: _react2['default'].PropTypes.node, | ||
srOnly: _react2['default'].PropTypes.bool, | ||
striped: _react2['default'].PropTypes.bool, | ||
active: _react2['default'].PropTypes.bool | ||
min: _react.PropTypes.number, | ||
now: _react.PropTypes.number, | ||
max: _react.PropTypes.number, | ||
label: _react.PropTypes.node, | ||
srOnly: _react.PropTypes.bool, | ||
striped: _react.PropTypes.bool, | ||
active: _react.PropTypes.bool, | ||
children: onlyProgressBar, | ||
interpolateClass: _react.PropTypes.node, | ||
isChild: _react.PropTypes.bool | ||
}, | ||
@@ -61,30 +67,25 @@ | ||
render: function render() { | ||
if (this.props.isChild) { | ||
return this.renderProgressBar(); | ||
} | ||
var classes = { | ||
progress: true | ||
active: this.props.active, | ||
progress: true, | ||
'progress-striped': this.props.active || this.props.striped | ||
}; | ||
if (this.props.active) { | ||
classes['progress-striped'] = true; | ||
classes.active = true; | ||
} else if (this.props.striped) { | ||
classes['progress-striped'] = true; | ||
} | ||
var content = undefined; | ||
if (!_utilsValidComponentChildren2['default'].hasValidComponent(this.props.children)) { | ||
if (!this.props.isChild) { | ||
return _react2['default'].createElement( | ||
'div', | ||
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), | ||
this.renderProgressBar() | ||
); | ||
} else { | ||
return this.renderProgressBar(); | ||
} | ||
if (this.props.children) { | ||
content = _utilsValidComponentChildren2['default'].map(this.props.children, this.renderChildBar); | ||
} else { | ||
return _react2['default'].createElement( | ||
'div', | ||
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), | ||
_utilsValidComponentChildren2['default'].map(this.props.children, this.renderChildBar) | ||
); | ||
content = this.renderProgressBar(); | ||
} | ||
return _react2['default'].createElement( | ||
'div', | ||
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }), | ||
content | ||
); | ||
}, | ||
@@ -106,3 +107,3 @@ | ||
label = this.renderLabel(percentage); | ||
} else if (this.props.label) { | ||
} else { | ||
label = this.props.label; | ||
@@ -112,10 +113,14 @@ } | ||
if (this.props.srOnly) { | ||
label = this.renderScreenReaderOnlyLabel(label); | ||
label = _react2['default'].createElement( | ||
'span', | ||
{ className: 'sr-only' }, | ||
label | ||
); | ||
} | ||
var classes = this.getBsClassSet(); | ||
return _react2['default'].createElement( | ||
'div', | ||
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes), role: 'progressbar', | ||
_extends({}, this.props, { | ||
className: (0, _classnames2['default'])(this.props.className, this.getBsClassSet()), | ||
role: 'progressbar', | ||
style: { width: percentage + '%' }, | ||
@@ -142,14 +147,31 @@ 'aria-valuenow': this.props.now, | ||
); | ||
}, | ||
renderScreenReaderOnlyLabel: function renderScreenReaderOnlyLabel(label) { | ||
return _react2['default'].createElement( | ||
'span', | ||
{ className: 'sr-only' }, | ||
label | ||
); | ||
} | ||
}); | ||
/** | ||
* Custom propTypes checker | ||
*/ | ||
function onlyProgressBar(props, propName, componentName) { | ||
if (props[propName]) { | ||
var _ret = (function () { | ||
var error = undefined, | ||
childIdentifier = undefined; | ||
_react2['default'].Children.forEach(props[propName], function (child) { | ||
if (child.type !== ProgressBar) { | ||
childIdentifier = child.type.displayName ? child.type.displayName : child.type; | ||
error = new Error('Children of ' + componentName + ' can contain only ProgressBar components. Found ' + childIdentifier); | ||
} | ||
}); | ||
return { | ||
v: error | ||
}; | ||
})(); | ||
if (typeof _ret === 'object') return _ret.v; | ||
} | ||
} | ||
exports['default'] = ProgressBar; | ||
module.exports = exports['default']; |
@@ -21,2 +21,3 @@ 'use strict'; | ||
'panel-group': 'panel-group', | ||
'pagination': 'pagination', | ||
'progress-bar': 'progress-bar', | ||
@@ -23,0 +24,0 @@ 'nav': 'nav', |
{ | ||
"name": "react-bootstrap", | ||
"version": "0.23.1", | ||
"version": "0.23.2", | ||
"description": "Bootstrap 3 components build with React", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -6,7 +6,10 @@ # react-bootstrap | ||
[![Travis Build Status][build-badge]][build] | ||
[![NPM version][npm-badge]][npm] | ||
[![Bower version][bower-badge]][bower] | ||
[![Build status][appveyor-badge]][appveyor] | ||
[![HuBoard][huboard-badge]][huboard] | ||
[![Gitter][gitter-badge]][gitter] | ||
[![NPM version][npm-badge]][npm] | ||
[![Bower version][bower-badge]][bower] | ||
[![Dependency Status][deps-badge]][deps] | ||
@@ -77,2 +80,2 @@ [![devDependency Status][dev-deps-badge]][dev-deps] | ||
[appveyor-badge]: https://ci.appveyor.com/api/projects/status/ylitpyo6n5yq1s6i/branch/master?svg=true | ||
[appveyor]: https://ci.appveyor.com/project/mtscout6/react-bootstrap/branch/master | ||
[appveyor]: https://ci.appveyor.com/project/react-bootstrap/react-bootstrap/branch/master |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1201521
125
12722
80