react-bootstrap
Advanced tools
Comparing version 0.24.0-alpha.0 to 0.24.0-alpha.1
@@ -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 @@ --------------------------------------- |
@@ -53,3 +53,4 @@ 'use strict'; | ||
active: this.props.active, | ||
'btn-block': this.props.block }, classes); | ||
'btn-block': this.props.block | ||
}, classes); | ||
@@ -56,0 +57,0 @@ if (this.props.navItem) { |
@@ -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'); | ||
@@ -264,2 +268,4 @@ | ||
Pagination: _Pagination2['default'], | ||
Popover: _Popover2['default'], | ||
@@ -287,3 +293,5 @@ | ||
Well: _Well2['default'] }; | ||
Well: _Well2['default'] | ||
}; | ||
module.exports = exports['default']; |
@@ -157,2 +157,6 @@ 'use strict'; | ||
var _Pagination = require('./Pagination'); | ||
var _Pagination2 = _interopRequireDefault(_Pagination); | ||
var _Panel = require('./Panel'); | ||
@@ -272,2 +276,3 @@ | ||
Pager: _Pager2['default'], | ||
Pagination: _Pagination2['default'], | ||
Popover: _Popover2['default'], | ||
@@ -274,0 +279,0 @@ ProgressBar: _ProgressBar2['default'], |
@@ -34,3 +34,4 @@ 'use strict'; | ||
eventKey: _react2['default'].PropTypes.any, | ||
active: _react2['default'].PropTypes.bool | ||
active: _react2['default'].PropTypes.bool, | ||
disabled: _react2['default'].PropTypes.bool | ||
}, | ||
@@ -45,2 +46,6 @@ | ||
handleClick: function handleClick(e) { | ||
if (this.props.disabled) { | ||
e.preventDefault(); | ||
return; | ||
} | ||
if (this.props.onSelect) { | ||
@@ -64,3 +69,4 @@ e.preventDefault(); | ||
'divider': this.props.divider, | ||
'active': this.props.active | ||
'active': this.props.active, | ||
'disabled': this.props.disabled | ||
}; | ||
@@ -67,0 +73,0 @@ |
@@ -55,3 +55,4 @@ 'use strict'; | ||
var classes = (_classes = { | ||
'popover': true }, _defineProperty(_classes, this.props.placement, true), _defineProperty(_classes, 'in', !this.props.animation && (this.props.positionLeft != null || this.props.positionTop != null)), _defineProperty(_classes, 'fade', this.props.animation), _classes); | ||
'popover': true | ||
}, _defineProperty(_classes, this.props.placement, true), _defineProperty(_classes, 'in', !this.props.animation && (this.props.positionLeft != null || this.props.positionTop != null)), _defineProperty(_classes, 'fade', this.props.animation), _classes); | ||
@@ -58,0 +59,0 @@ var style = { |
@@ -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', |
@@ -74,4 +74,2 @@ 'use strict'; | ||
isChildActive: function isChildActive(child) { | ||
var _this = this; | ||
if (child.props.active) { | ||
@@ -90,17 +88,11 @@ return true; | ||
if (child.props.children) { | ||
var _ret = (function () { | ||
var isActive = false; | ||
var isActive = false; | ||
_utilsValidComponentChildren2['default'].forEach(child.props.children, function (grandchild) { | ||
if (this.isChildActive(grandchild)) { | ||
isActive = true; | ||
} | ||
}, _this); | ||
_utilsValidComponentChildren2['default'].forEach(child.props.children, function (grandchild) { | ||
if (this.isChildActive(grandchild)) { | ||
isActive = true; | ||
} | ||
}, this); | ||
return { | ||
v: isActive | ||
}; | ||
})(); | ||
if (typeof _ret === 'object') return _ret.v; | ||
return isActive; | ||
} | ||
@@ -107,0 +99,0 @@ |
@@ -54,3 +54,4 @@ 'use strict'; | ||
var classes = (_classes = { | ||
'tooltip': true }, _defineProperty(_classes, this.props.placement, true), _defineProperty(_classes, 'in', !this.props.animation && (this.props.positionLeft != null || this.props.positionTop != null)), _defineProperty(_classes, 'fade', this.props.animation), _classes); | ||
'tooltip': true | ||
}, _defineProperty(_classes, this.props.placement, true), _defineProperty(_classes, 'in', !this.props.animation && (this.props.positionLeft != null || this.props.positionTop != null)), _defineProperty(_classes, 'fade', this.props.animation), _classes); | ||
@@ -57,0 +58,0 @@ var style = { |
{ | ||
"name": "react-bootstrap", | ||
"version": "0.24.0-alpha.0", | ||
"version": "0.24.0-alpha.1", | ||
"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
1218447
127
12840
80