react-bootstrap 0.31.1 → 0.31.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/dist/react-bootstrap.js +4811 -4179
- package/dist/react-bootstrap.min.js +9 -9
- package/dist/react-bootstrap.min.js.map +1 -1
- package/es/ButtonToolbar.js +2 -3
- package/es/Carousel.js +85 -77
- package/es/Checkbox.js +2 -0
- package/es/CloseButton.js +1 -1
- package/es/Collapse.js +18 -18
- package/es/Dropdown.js +50 -50
- package/es/DropdownMenu.js +28 -28
- package/es/Fade.js +2 -2
- package/es/FormControl.js +1 -2
- package/es/MediaBody.js +15 -2
- package/es/Modal.js +23 -15
- package/es/Nav.js +44 -44
- package/es/Navbar.js +4 -4
- package/es/OverlayTrigger.js +39 -39
- package/es/Panel.js +44 -44
- package/es/Radio.js +2 -0
- package/es/SafeAnchor.js +15 -2
- package/es/TabContent.js +5 -5
- package/es/TabPane.js +16 -16
- package/es/Tabs.js +2 -2
- package/es/Thumbnail.js +2 -0
- package/es/ToggleButton.js +8 -0
- package/es/ToggleButtonGroup.js +11 -6
- package/es/index.js +4 -0
- package/es/utils/TransitionEvents.js +11 -10
- package/es/utils/ValidComponentChildren.js +1 -1
- package/es/utils/bootstrapUtils.js +2 -1
- package/lib/Accordion.js +9 -9
- package/lib/Alert.js +14 -14
- package/lib/Badge.js +13 -13
- package/lib/Breadcrumb.js +10 -10
- package/lib/BreadcrumbItem.js +14 -14
- package/lib/Button.js +20 -20
- package/lib/ButtonGroup.js +13 -13
- package/lib/ButtonToolbar.js +9 -13
- package/lib/Carousel.js +127 -119
- package/lib/CarouselCaption.js +10 -10
- package/lib/CarouselItem.js +16 -16
- package/lib/Checkbox.js +21 -21
- package/lib/Clearfix.js +15 -15
- package/lib/CloseButton.js +12 -14
- package/lib/Col.js +30 -30
- package/lib/Collapse.js +47 -47
- package/lib/ControlLabel.js +14 -14
- package/lib/Dropdown.js +92 -92
- package/lib/DropdownButton.js +22 -22
- package/lib/DropdownMenu.js +51 -51
- package/lib/DropdownToggle.js +16 -16
- package/lib/Fade.js +20 -20
- package/lib/Form.js +12 -12
- package/lib/FormControl.js +17 -17
- package/lib/FormControlFeedback.js +13 -13
- package/lib/FormControlStatic.js +10 -10
- package/lib/FormGroup.js +15 -15
- package/lib/Glyphicon.js +11 -11
- package/lib/Grid.js +11 -11
- package/lib/HelpBlock.js +9 -9
- package/lib/Image.js +13 -13
- package/lib/InputGroup.js +11 -11
- package/lib/InputGroupAddon.js +9 -9
- package/lib/InputGroupButton.js +9 -9
- package/lib/Jumbotron.js +10 -10
- package/lib/Label.js +12 -12
- package/lib/ListGroup.js +16 -16
- package/lib/ListGroupItem.js +22 -22
- package/lib/Media.js +16 -16
- package/lib/MediaBody.js +29 -10
- package/lib/MediaHeading.js +10 -10
- package/lib/MediaLeft.js +11 -11
- package/lib/MediaList.js +9 -9
- package/lib/MediaListItem.js +9 -9
- package/lib/MediaRight.js +11 -11
- package/lib/MenuItem.js +23 -23
- package/lib/Modal.js +73 -65
- package/lib/ModalBody.js +10 -10
- package/lib/ModalDialog.js +16 -16
- package/lib/ModalFooter.js +10 -10
- package/lib/ModalHeader.js +17 -17
- package/lib/ModalTitle.js +10 -10
- package/lib/Nav.js +81 -81
- package/lib/NavDropdown.js +25 -25
- package/lib/NavItem.js +18 -18
- package/lib/Navbar.js +47 -47
- package/lib/NavbarBrand.js +14 -14
- package/lib/NavbarCollapse.js +14 -14
- package/lib/NavbarHeader.js +10 -10
- package/lib/NavbarToggle.js +22 -22
- package/lib/Overlay.js +25 -25
- package/lib/OverlayTrigger.js +75 -75
- package/lib/PageHeader.js +11 -11
- package/lib/PageItem.js +2 -2
- package/lib/Pager.js +14 -14
- package/lib/PagerItem.js +17 -17
- package/lib/Pagination.js +52 -52
- package/lib/PaginationButton.js +20 -20
- package/lib/Panel.js +76 -76
- package/lib/PanelGroup.js +18 -18
- package/lib/Popover.js +22 -22
- package/lib/ProgressBar.js +29 -29
- package/lib/Radio.js +21 -21
- package/lib/ResponsiveEmbed.js +17 -17
- package/lib/Row.js +10 -10
- package/lib/SafeAnchor.js +31 -16
- package/lib/SplitButton.js +26 -26
- package/lib/SplitToggle.js +8 -8
- package/lib/Tab.js +15 -15
- package/lib/TabContainer.js +17 -17
- package/lib/TabContent.js +29 -29
- package/lib/TabPane.js +57 -57
- package/lib/Table.js +16 -16
- package/lib/Tabs.js +28 -28
- package/lib/Thumbnail.js +19 -19
- package/lib/ToggleButton.js +23 -16
- package/lib/ToggleButtonGroup.js +38 -26
- package/lib/Tooltip.js +20 -20
- package/lib/Well.js +9 -9
- package/lib/index.js +83 -73
- package/lib/utils/PropTypes.js +5 -5
- package/lib/utils/TransitionEvents.js +12 -11
- package/lib/utils/ValidComponentChildren.js +19 -19
- package/lib/utils/bootstrapUtils.js +11 -10
- package/lib/utils/capitalize.js +1 -1
- package/lib/utils/createChainedFunction.js +1 -1
- package/lib/utils/deprecationWarning.js +7 -7
- package/lib/utils/index.js +4 -4
- package/lib/utils/splitComponentProps.js +3 -3
- package/package.json +20 -18
package/lib/DropdownButton.js
CHANGED
|
@@ -38,29 +38,29 @@ var _splitComponentProps2 = require('./utils/splitComponentProps');
|
|
|
38
38
|
|
|
39
39
|
var _splitComponentProps3 = _interopRequireDefault(_splitComponentProps2);
|
|
40
40
|
|
|
41
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
41
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
42
42
|
|
|
43
|
-
var propTypes = (0, _extends3
|
|
43
|
+
var propTypes = (0, _extends3.default)({}, _Dropdown2.default.propTypes, {
|
|
44
44
|
|
|
45
45
|
// Toggle props.
|
|
46
|
-
bsStyle: _propTypes2
|
|
47
|
-
bsSize: _propTypes2
|
|
48
|
-
title: _propTypes2
|
|
49
|
-
noCaret: _propTypes2
|
|
46
|
+
bsStyle: _propTypes2.default.string,
|
|
47
|
+
bsSize: _propTypes2.default.string,
|
|
48
|
+
title: _propTypes2.default.node.isRequired,
|
|
49
|
+
noCaret: _propTypes2.default.bool,
|
|
50
50
|
|
|
51
51
|
// Override generated docs from <Dropdown>.
|
|
52
52
|
/**
|
|
53
53
|
* @private
|
|
54
54
|
*/
|
|
55
|
-
children: _propTypes2
|
|
55
|
+
children: _propTypes2.default.node
|
|
56
56
|
});
|
|
57
57
|
|
|
58
58
|
var DropdownButton = function (_React$Component) {
|
|
59
|
-
(0, _inherits3
|
|
59
|
+
(0, _inherits3.default)(DropdownButton, _React$Component);
|
|
60
60
|
|
|
61
61
|
function DropdownButton() {
|
|
62
|
-
(0, _classCallCheck3
|
|
63
|
-
return (0, _possibleConstructorReturn3
|
|
62
|
+
(0, _classCallCheck3.default)(this, DropdownButton);
|
|
63
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
DropdownButton.prototype.render = function render() {
|
|
@@ -69,28 +69,28 @@ var DropdownButton = function (_React$Component) {
|
|
|
69
69
|
bsStyle = _props.bsStyle,
|
|
70
70
|
title = _props.title,
|
|
71
71
|
children = _props.children,
|
|
72
|
-
props = (0, _objectWithoutProperties3
|
|
72
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['bsSize', 'bsStyle', 'title', 'children']);
|
|
73
73
|
|
|
74
|
-
var _splitComponentProps = (0, _splitComponentProps3
|
|
74
|
+
var _splitComponentProps = (0, _splitComponentProps3.default)(props, _Dropdown2.default.ControlledComponent),
|
|
75
75
|
dropdownProps = _splitComponentProps[0],
|
|
76
76
|
toggleProps = _splitComponentProps[1];
|
|
77
77
|
|
|
78
|
-
return _react2
|
|
79
|
-
_Dropdown2
|
|
80
|
-
(0, _extends3
|
|
78
|
+
return _react2.default.createElement(
|
|
79
|
+
_Dropdown2.default,
|
|
80
|
+
(0, _extends3.default)({}, dropdownProps, {
|
|
81
81
|
bsSize: bsSize,
|
|
82
82
|
bsStyle: bsStyle
|
|
83
83
|
}),
|
|
84
|
-
_react2
|
|
85
|
-
_Dropdown2
|
|
86
|
-
(0, _extends3
|
|
84
|
+
_react2.default.createElement(
|
|
85
|
+
_Dropdown2.default.Toggle,
|
|
86
|
+
(0, _extends3.default)({}, toggleProps, {
|
|
87
87
|
bsSize: bsSize,
|
|
88
88
|
bsStyle: bsStyle
|
|
89
89
|
}),
|
|
90
90
|
title
|
|
91
91
|
),
|
|
92
|
-
_react2
|
|
93
|
-
_Dropdown2
|
|
92
|
+
_react2.default.createElement(
|
|
93
|
+
_Dropdown2.default.Menu,
|
|
94
94
|
null,
|
|
95
95
|
children
|
|
96
96
|
)
|
|
@@ -98,9 +98,9 @@ var DropdownButton = function (_React$Component) {
|
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
return DropdownButton;
|
|
101
|
-
}(_react2
|
|
101
|
+
}(_react2.default.Component);
|
|
102
102
|
|
|
103
103
|
DropdownButton.propTypes = propTypes;
|
|
104
104
|
|
|
105
|
-
exports
|
|
105
|
+
exports.default = DropdownButton;
|
|
106
106
|
module.exports = exports['default'];
|
package/lib/DropdownMenu.js
CHANGED
|
@@ -60,15 +60,15 @@ var _ValidComponentChildren = require('./utils/ValidComponentChildren');
|
|
|
60
60
|
|
|
61
61
|
var _ValidComponentChildren2 = _interopRequireDefault(_ValidComponentChildren);
|
|
62
62
|
|
|
63
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
63
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
64
64
|
|
|
65
65
|
var propTypes = {
|
|
66
|
-
open: _propTypes2
|
|
67
|
-
pullRight: _propTypes2
|
|
68
|
-
onClose: _propTypes2
|
|
69
|
-
labelledBy: _propTypes2
|
|
70
|
-
onSelect: _propTypes2
|
|
71
|
-
rootCloseEvent: _propTypes2
|
|
66
|
+
open: _propTypes2.default.bool,
|
|
67
|
+
pullRight: _propTypes2.default.bool,
|
|
68
|
+
onClose: _propTypes2.default.func,
|
|
69
|
+
labelledBy: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
|
|
70
|
+
onSelect: _propTypes2.default.func,
|
|
71
|
+
rootCloseEvent: _propTypes2.default.oneOf(['click', 'mousedown'])
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
var defaultProps = {
|
|
@@ -77,38 +77,25 @@ var defaultProps = {
|
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
var DropdownMenu = function (_React$Component) {
|
|
80
|
-
(0, _inherits3
|
|
80
|
+
(0, _inherits3.default)(DropdownMenu, _React$Component);
|
|
81
81
|
|
|
82
82
|
function DropdownMenu(props) {
|
|
83
|
-
(0, _classCallCheck3
|
|
83
|
+
(0, _classCallCheck3.default)(this, DropdownMenu);
|
|
84
84
|
|
|
85
|
-
var _this = (0, _possibleConstructorReturn3
|
|
85
|
+
var _this = (0, _possibleConstructorReturn3.default)(this, _React$Component.call(this, props));
|
|
86
86
|
|
|
87
87
|
_this.handleRootClose = _this.handleRootClose.bind(_this);
|
|
88
88
|
_this.handleKeyDown = _this.handleKeyDown.bind(_this);
|
|
89
89
|
return _this;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
DropdownMenu.prototype.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
DropdownMenu.prototype.handleKeyDown = function handleKeyDown(event) {
|
|
97
|
-
switch (event.keyCode) {
|
|
98
|
-
case _keycode2['default'].codes.down:
|
|
99
|
-
this.focusNext();
|
|
100
|
-
event.preventDefault();
|
|
101
|
-
break;
|
|
102
|
-
case _keycode2['default'].codes.up:
|
|
103
|
-
this.focusPrevious();
|
|
104
|
-
event.preventDefault();
|
|
105
|
-
break;
|
|
106
|
-
case _keycode2['default'].codes.esc:
|
|
107
|
-
case _keycode2['default'].codes.tab:
|
|
108
|
-
this.props.onClose(event, { source: 'keydown' });
|
|
109
|
-
break;
|
|
110
|
-
default:
|
|
92
|
+
DropdownMenu.prototype.getFocusableMenuItems = function getFocusableMenuItems() {
|
|
93
|
+
var node = _reactDom2.default.findDOMNode(this);
|
|
94
|
+
if (!node) {
|
|
95
|
+
return [];
|
|
111
96
|
}
|
|
97
|
+
|
|
98
|
+
return (0, _from2.default)(node.querySelectorAll('[tabIndex="-1"]'));
|
|
112
99
|
};
|
|
113
100
|
|
|
114
101
|
DropdownMenu.prototype.getItemsAndActiveIndex = function getItemsAndActiveIndex() {
|
|
@@ -118,15 +105,6 @@ var DropdownMenu = function (_React$Component) {
|
|
|
118
105
|
return { items: items, activeIndex: activeIndex };
|
|
119
106
|
};
|
|
120
107
|
|
|
121
|
-
DropdownMenu.prototype.getFocusableMenuItems = function getFocusableMenuItems() {
|
|
122
|
-
var node = _reactDom2['default'].findDOMNode(this);
|
|
123
|
-
if (!node) {
|
|
124
|
-
return [];
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return (0, _from2['default'])(node.querySelectorAll('[tabIndex="-1"]'));
|
|
128
|
-
};
|
|
129
|
-
|
|
130
108
|
DropdownMenu.prototype.focusNext = function focusNext() {
|
|
131
109
|
var _getItemsAndActiveInd = this.getItemsAndActiveIndex(),
|
|
132
110
|
items = _getItemsAndActiveInd.items,
|
|
@@ -153,6 +131,28 @@ var DropdownMenu = function (_React$Component) {
|
|
|
153
131
|
items[prevIndex].focus();
|
|
154
132
|
};
|
|
155
133
|
|
|
134
|
+
DropdownMenu.prototype.handleKeyDown = function handleKeyDown(event) {
|
|
135
|
+
switch (event.keyCode) {
|
|
136
|
+
case _keycode2.default.codes.down:
|
|
137
|
+
this.focusNext();
|
|
138
|
+
event.preventDefault();
|
|
139
|
+
break;
|
|
140
|
+
case _keycode2.default.codes.up:
|
|
141
|
+
this.focusPrevious();
|
|
142
|
+
event.preventDefault();
|
|
143
|
+
break;
|
|
144
|
+
case _keycode2.default.codes.esc:
|
|
145
|
+
case _keycode2.default.codes.tab:
|
|
146
|
+
this.props.onClose(event, { source: 'keydown' });
|
|
147
|
+
break;
|
|
148
|
+
default:
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
DropdownMenu.prototype.handleRootClose = function handleRootClose(event) {
|
|
153
|
+
this.props.onClose(event, { source: 'rootClose' });
|
|
154
|
+
};
|
|
155
|
+
|
|
156
156
|
DropdownMenu.prototype.render = function render() {
|
|
157
157
|
var _extends2,
|
|
158
158
|
_this2 = this;
|
|
@@ -165,32 +165,32 @@ var DropdownMenu = function (_React$Component) {
|
|
|
165
165
|
className = _props.className,
|
|
166
166
|
rootCloseEvent = _props.rootCloseEvent,
|
|
167
167
|
children = _props.children,
|
|
168
|
-
props = (0, _objectWithoutProperties3
|
|
168
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['open', 'pullRight', 'labelledBy', 'onSelect', 'className', 'rootCloseEvent', 'children']);
|
|
169
169
|
|
|
170
170
|
var _splitBsPropsAndOmit = (0, _bootstrapUtils.splitBsPropsAndOmit)(props, ['onClose']),
|
|
171
171
|
bsProps = _splitBsPropsAndOmit[0],
|
|
172
172
|
elementProps = _splitBsPropsAndOmit[1];
|
|
173
173
|
|
|
174
|
-
var classes = (0, _extends4
|
|
174
|
+
var classes = (0, _extends4.default)({}, (0, _bootstrapUtils.getClassSet)(bsProps), (_extends2 = {}, _extends2[(0, _bootstrapUtils.prefix)(bsProps, 'right')] = pullRight, _extends2));
|
|
175
175
|
|
|
176
|
-
return _react2
|
|
177
|
-
_RootCloseWrapper2
|
|
176
|
+
return _react2.default.createElement(
|
|
177
|
+
_RootCloseWrapper2.default,
|
|
178
178
|
{
|
|
179
179
|
disabled: !open,
|
|
180
180
|
onRootClose: this.handleRootClose,
|
|
181
181
|
event: rootCloseEvent
|
|
182
182
|
},
|
|
183
|
-
_react2
|
|
183
|
+
_react2.default.createElement(
|
|
184
184
|
'ul',
|
|
185
|
-
(0, _extends4
|
|
185
|
+
(0, _extends4.default)({}, elementProps, {
|
|
186
186
|
role: 'menu',
|
|
187
|
-
className: (0, _classnames2
|
|
187
|
+
className: (0, _classnames2.default)(className, classes),
|
|
188
188
|
'aria-labelledby': labelledBy
|
|
189
189
|
}),
|
|
190
|
-
_ValidComponentChildren2
|
|
191
|
-
return _react2
|
|
192
|
-
onKeyDown: (0, _createChainedFunction2
|
|
193
|
-
onSelect: (0, _createChainedFunction2
|
|
190
|
+
_ValidComponentChildren2.default.map(children, function (child) {
|
|
191
|
+
return _react2.default.cloneElement(child, {
|
|
192
|
+
onKeyDown: (0, _createChainedFunction2.default)(child.props.onKeyDown, _this2.handleKeyDown),
|
|
193
|
+
onSelect: (0, _createChainedFunction2.default)(child.props.onSelect, onSelect)
|
|
194
194
|
});
|
|
195
195
|
})
|
|
196
196
|
)
|
|
@@ -198,10 +198,10 @@ var DropdownMenu = function (_React$Component) {
|
|
|
198
198
|
};
|
|
199
199
|
|
|
200
200
|
return DropdownMenu;
|
|
201
|
-
}(_react2
|
|
201
|
+
}(_react2.default.Component);
|
|
202
202
|
|
|
203
203
|
DropdownMenu.propTypes = propTypes;
|
|
204
204
|
DropdownMenu.defaultProps = defaultProps;
|
|
205
205
|
|
|
206
|
-
exports
|
|
206
|
+
exports.default = (0, _bootstrapUtils.bsClass)('dropdown-menu', DropdownMenu);
|
|
207
207
|
module.exports = exports['default'];
|
package/lib/DropdownToggle.js
CHANGED
|
@@ -44,13 +44,13 @@ var _SafeAnchor2 = _interopRequireDefault(_SafeAnchor);
|
|
|
44
44
|
|
|
45
45
|
var _bootstrapUtils = require('./utils/bootstrapUtils');
|
|
46
46
|
|
|
47
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
47
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
48
48
|
|
|
49
49
|
var propTypes = {
|
|
50
|
-
noCaret: _propTypes2
|
|
51
|
-
open: _propTypes2
|
|
52
|
-
title: _propTypes2
|
|
53
|
-
useAnchor: _propTypes2
|
|
50
|
+
noCaret: _propTypes2.default.bool,
|
|
51
|
+
open: _propTypes2.default.bool,
|
|
52
|
+
title: _propTypes2.default.string,
|
|
53
|
+
useAnchor: _propTypes2.default.bool
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
var defaultProps = {
|
|
@@ -60,11 +60,11 @@ var defaultProps = {
|
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
var DropdownToggle = function (_React$Component) {
|
|
63
|
-
(0, _inherits3
|
|
63
|
+
(0, _inherits3.default)(DropdownToggle, _React$Component);
|
|
64
64
|
|
|
65
65
|
function DropdownToggle() {
|
|
66
|
-
(0, _classCallCheck3
|
|
67
|
-
return (0, _possibleConstructorReturn3
|
|
66
|
+
(0, _classCallCheck3.default)(this, DropdownToggle);
|
|
67
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
DropdownToggle.prototype.render = function render() {
|
|
@@ -75,12 +75,12 @@ var DropdownToggle = function (_React$Component) {
|
|
|
75
75
|
bsClass = _props.bsClass,
|
|
76
76
|
className = _props.className,
|
|
77
77
|
children = _props.children,
|
|
78
|
-
props = (0, _objectWithoutProperties3
|
|
78
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['noCaret', 'open', 'useAnchor', 'bsClass', 'className', 'children']);
|
|
79
79
|
|
|
80
80
|
|
|
81
81
|
delete props.bsRole;
|
|
82
82
|
|
|
83
|
-
var Component = useAnchor ? _SafeAnchor2
|
|
83
|
+
var Component = useAnchor ? _SafeAnchor2.default : _Button2.default;
|
|
84
84
|
var useCaret = !noCaret;
|
|
85
85
|
|
|
86
86
|
// This intentionally forwards bsSize and bsStyle (if set) to the
|
|
@@ -88,25 +88,25 @@ var DropdownToggle = function (_React$Component) {
|
|
|
88
88
|
|
|
89
89
|
// FIXME: Should this really fall back to `title` as children?
|
|
90
90
|
|
|
91
|
-
return _react2
|
|
91
|
+
return _react2.default.createElement(
|
|
92
92
|
Component,
|
|
93
|
-
(0, _extends3
|
|
93
|
+
(0, _extends3.default)({}, props, {
|
|
94
94
|
role: 'button',
|
|
95
|
-
className: (0, _classnames2
|
|
95
|
+
className: (0, _classnames2.default)(className, bsClass),
|
|
96
96
|
'aria-haspopup': true,
|
|
97
97
|
'aria-expanded': open
|
|
98
98
|
}),
|
|
99
99
|
children || props.title,
|
|
100
100
|
useCaret && ' ',
|
|
101
|
-
useCaret && _react2
|
|
101
|
+
useCaret && _react2.default.createElement('span', { className: 'caret' })
|
|
102
102
|
);
|
|
103
103
|
};
|
|
104
104
|
|
|
105
105
|
return DropdownToggle;
|
|
106
|
-
}(_react2
|
|
106
|
+
}(_react2.default.Component);
|
|
107
107
|
|
|
108
108
|
DropdownToggle.propTypes = propTypes;
|
|
109
109
|
DropdownToggle.defaultProps = defaultProps;
|
|
110
110
|
|
|
111
|
-
exports
|
|
111
|
+
exports.default = (0, _bootstrapUtils.bsClass)('dropdown-toggle', DropdownToggle);
|
|
112
112
|
module.exports = exports['default'];
|
package/lib/Fade.js
CHANGED
|
@@ -34,65 +34,65 @@ var _Transition = require('react-overlays/lib/Transition');
|
|
|
34
34
|
|
|
35
35
|
var _Transition2 = _interopRequireDefault(_Transition);
|
|
36
36
|
|
|
37
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
37
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
38
38
|
|
|
39
39
|
var propTypes = {
|
|
40
40
|
/**
|
|
41
41
|
* Show the component; triggers the fade in or fade out animation
|
|
42
42
|
*/
|
|
43
|
-
|
|
43
|
+
in: _propTypes2.default.bool,
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* Wait until the first "enter" transition to mount the component (add it to the DOM)
|
|
47
47
|
*/
|
|
48
|
-
mountOnEnter: _propTypes2
|
|
48
|
+
mountOnEnter: _propTypes2.default.bool,
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* Unmount the component (remove it from the DOM) when it is faded out
|
|
52
52
|
*/
|
|
53
|
-
unmountOnExit: _propTypes2
|
|
53
|
+
unmountOnExit: _propTypes2.default.bool,
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* Run the fade in animation when the component mounts, if it is initially
|
|
57
57
|
* shown
|
|
58
58
|
*/
|
|
59
|
-
transitionAppear: _propTypes2
|
|
59
|
+
transitionAppear: _propTypes2.default.bool,
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* Duration of the fade animation in milliseconds, to ensure that finishing
|
|
63
63
|
* callbacks are fired even if the original browser transition end events are
|
|
64
64
|
* canceled
|
|
65
65
|
*/
|
|
66
|
-
timeout: _propTypes2
|
|
66
|
+
timeout: _propTypes2.default.number,
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* Callback fired before the component fades in
|
|
70
70
|
*/
|
|
71
|
-
onEnter: _propTypes2
|
|
71
|
+
onEnter: _propTypes2.default.func,
|
|
72
72
|
/**
|
|
73
73
|
* Callback fired after the component starts to fade in
|
|
74
74
|
*/
|
|
75
|
-
onEntering: _propTypes2
|
|
75
|
+
onEntering: _propTypes2.default.func,
|
|
76
76
|
/**
|
|
77
77
|
* Callback fired after the has component faded in
|
|
78
78
|
*/
|
|
79
|
-
onEntered: _propTypes2
|
|
79
|
+
onEntered: _propTypes2.default.func,
|
|
80
80
|
/**
|
|
81
81
|
* Callback fired before the component fades out
|
|
82
82
|
*/
|
|
83
|
-
onExit: _propTypes2
|
|
83
|
+
onExit: _propTypes2.default.func,
|
|
84
84
|
/**
|
|
85
85
|
* Callback fired after the component starts to fade out
|
|
86
86
|
*/
|
|
87
|
-
onExiting: _propTypes2
|
|
87
|
+
onExiting: _propTypes2.default.func,
|
|
88
88
|
/**
|
|
89
89
|
* Callback fired after the component has faded out
|
|
90
90
|
*/
|
|
91
|
-
onExited: _propTypes2
|
|
91
|
+
onExited: _propTypes2.default.func
|
|
92
92
|
};
|
|
93
93
|
|
|
94
94
|
var defaultProps = {
|
|
95
|
-
|
|
95
|
+
in: false,
|
|
96
96
|
timeout: 300,
|
|
97
97
|
mountOnEnter: false,
|
|
98
98
|
unmountOnExit: false,
|
|
@@ -100,26 +100,26 @@ var defaultProps = {
|
|
|
100
100
|
};
|
|
101
101
|
|
|
102
102
|
var Fade = function (_React$Component) {
|
|
103
|
-
(0, _inherits3
|
|
103
|
+
(0, _inherits3.default)(Fade, _React$Component);
|
|
104
104
|
|
|
105
105
|
function Fade() {
|
|
106
|
-
(0, _classCallCheck3
|
|
107
|
-
return (0, _possibleConstructorReturn3
|
|
106
|
+
(0, _classCallCheck3.default)(this, Fade);
|
|
107
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
Fade.prototype.render = function render() {
|
|
111
|
-
return _react2
|
|
112
|
-
className: (0, _classnames2
|
|
111
|
+
return _react2.default.createElement(_Transition2.default, (0, _extends3.default)({}, this.props, {
|
|
112
|
+
className: (0, _classnames2.default)(this.props.className, 'fade'),
|
|
113
113
|
enteredClassName: 'in',
|
|
114
114
|
enteringClassName: 'in'
|
|
115
115
|
}));
|
|
116
116
|
};
|
|
117
117
|
|
|
118
118
|
return Fade;
|
|
119
|
-
}(_react2
|
|
119
|
+
}(_react2.default.Component);
|
|
120
120
|
|
|
121
121
|
Fade.propTypes = propTypes;
|
|
122
122
|
Fade.defaultProps = defaultProps;
|
|
123
123
|
|
|
124
|
-
exports
|
|
124
|
+
exports.default = Fade;
|
|
125
125
|
module.exports = exports['default'];
|
package/lib/Form.js
CHANGED
|
@@ -40,12 +40,12 @@ var _elementType2 = _interopRequireDefault(_elementType);
|
|
|
40
40
|
|
|
41
41
|
var _bootstrapUtils = require('./utils/bootstrapUtils');
|
|
42
42
|
|
|
43
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
43
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
44
44
|
|
|
45
45
|
var propTypes = {
|
|
46
|
-
horizontal: _propTypes2
|
|
47
|
-
inline: _propTypes2
|
|
48
|
-
componentClass: _elementType2
|
|
46
|
+
horizontal: _propTypes2.default.bool,
|
|
47
|
+
inline: _propTypes2.default.bool,
|
|
48
|
+
componentClass: _elementType2.default
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
var defaultProps = {
|
|
@@ -55,11 +55,11 @@ var defaultProps = {
|
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
var Form = function (_React$Component) {
|
|
58
|
-
(0, _inherits3
|
|
58
|
+
(0, _inherits3.default)(Form, _React$Component);
|
|
59
59
|
|
|
60
60
|
function Form() {
|
|
61
|
-
(0, _classCallCheck3
|
|
62
|
-
return (0, _possibleConstructorReturn3
|
|
61
|
+
(0, _classCallCheck3.default)(this, Form);
|
|
62
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
Form.prototype.render = function render() {
|
|
@@ -68,7 +68,7 @@ var Form = function (_React$Component) {
|
|
|
68
68
|
inline = _props.inline,
|
|
69
69
|
Component = _props.componentClass,
|
|
70
70
|
className = _props.className,
|
|
71
|
-
props = (0, _objectWithoutProperties3
|
|
71
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['horizontal', 'inline', 'componentClass', 'className']);
|
|
72
72
|
|
|
73
73
|
var _splitBsProps = (0, _bootstrapUtils.splitBsProps)(props),
|
|
74
74
|
bsProps = _splitBsProps[0],
|
|
@@ -82,16 +82,16 @@ var Form = function (_React$Component) {
|
|
|
82
82
|
classes.push((0, _bootstrapUtils.prefix)(bsProps, 'inline'));
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
return _react2
|
|
86
|
-
className: (0, _classnames2
|
|
85
|
+
return _react2.default.createElement(Component, (0, _extends3.default)({}, elementProps, {
|
|
86
|
+
className: (0, _classnames2.default)(className, classes)
|
|
87
87
|
}));
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
return Form;
|
|
91
|
-
}(_react2
|
|
91
|
+
}(_react2.default.Component);
|
|
92
92
|
|
|
93
93
|
Form.propTypes = propTypes;
|
|
94
94
|
Form.defaultProps = defaultProps;
|
|
95
95
|
|
|
96
|
-
exports
|
|
96
|
+
exports.default = (0, _bootstrapUtils.bsClass)('form', Form);
|
|
97
97
|
module.exports = exports['default'];
|
package/lib/FormControl.js
CHANGED
|
@@ -54,18 +54,18 @@ var _bootstrapUtils = require('./utils/bootstrapUtils');
|
|
|
54
54
|
|
|
55
55
|
var _StyleConfig = require('./utils/StyleConfig');
|
|
56
56
|
|
|
57
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
57
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
58
58
|
|
|
59
59
|
var propTypes = {
|
|
60
|
-
componentClass: _elementType2
|
|
60
|
+
componentClass: _elementType2.default,
|
|
61
61
|
/**
|
|
62
62
|
* Only relevant if `componentClass` is `'input'`.
|
|
63
63
|
*/
|
|
64
|
-
type: _propTypes2
|
|
64
|
+
type: _propTypes2.default.string,
|
|
65
65
|
/**
|
|
66
66
|
* Uses `controlId` from `<FormGroup>` if not explicitly specified.
|
|
67
67
|
*/
|
|
68
|
-
id: _propTypes2
|
|
68
|
+
id: _propTypes2.default.string,
|
|
69
69
|
/**
|
|
70
70
|
* Attaches a ref to the `<input>` element. Only functions can be used here.
|
|
71
71
|
*
|
|
@@ -73,7 +73,7 @@ var propTypes = {
|
|
|
73
73
|
* <FormControl inputRef={ref => { this.input = ref; }} />
|
|
74
74
|
* ```
|
|
75
75
|
*/
|
|
76
|
-
inputRef: _propTypes2
|
|
76
|
+
inputRef: _propTypes2.default.func
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
var defaultProps = {
|
|
@@ -81,15 +81,15 @@ var defaultProps = {
|
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
var contextTypes = {
|
|
84
|
-
$bs_formGroup: _propTypes2
|
|
84
|
+
$bs_formGroup: _propTypes2.default.object
|
|
85
85
|
};
|
|
86
86
|
|
|
87
87
|
var FormControl = function (_React$Component) {
|
|
88
|
-
(0, _inherits3
|
|
88
|
+
(0, _inherits3.default)(FormControl, _React$Component);
|
|
89
89
|
|
|
90
90
|
function FormControl() {
|
|
91
|
-
(0, _classCallCheck3
|
|
92
|
-
return (0, _possibleConstructorReturn3
|
|
91
|
+
(0, _classCallCheck3.default)(this, FormControl);
|
|
92
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
FormControl.prototype.render = function render() {
|
|
@@ -104,13 +104,13 @@ var FormControl = function (_React$Component) {
|
|
|
104
104
|
inputRef = _props.inputRef,
|
|
105
105
|
className = _props.className,
|
|
106
106
|
bsSize = _props.bsSize,
|
|
107
|
-
props = (0, _objectWithoutProperties3
|
|
107
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['componentClass', 'type', 'id', 'inputRef', 'className', 'bsSize']);
|
|
108
108
|
|
|
109
109
|
var _splitBsProps = (0, _bootstrapUtils.splitBsProps)(props),
|
|
110
110
|
bsProps = _splitBsProps[0],
|
|
111
111
|
elementProps = _splitBsProps[1];
|
|
112
112
|
|
|
113
|
-
process.env.NODE_ENV !== 'production' ? (0, _warning2
|
|
113
|
+
process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(controlId == null || id === controlId, '`controlId` is ignored on `<FormControl>` when `id` is specified.') : void 0;
|
|
114
114
|
|
|
115
115
|
// input[type="file"] should not have .form-control.
|
|
116
116
|
var classes = void 0;
|
|
@@ -125,23 +125,23 @@ var FormControl = function (_React$Component) {
|
|
|
125
125
|
classes[(0, _bootstrapUtils.prefix)({ bsClass: 'input' }, size)] = true;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
return _react2
|
|
128
|
+
return _react2.default.createElement(Component, (0, _extends3.default)({}, elementProps, {
|
|
129
129
|
type: type,
|
|
130
130
|
id: id,
|
|
131
131
|
ref: inputRef,
|
|
132
|
-
className: (0, _classnames2
|
|
132
|
+
className: (0, _classnames2.default)(className, classes)
|
|
133
133
|
}));
|
|
134
134
|
};
|
|
135
135
|
|
|
136
136
|
return FormControl;
|
|
137
|
-
}(_react2
|
|
137
|
+
}(_react2.default.Component);
|
|
138
138
|
|
|
139
139
|
FormControl.propTypes = propTypes;
|
|
140
140
|
FormControl.defaultProps = defaultProps;
|
|
141
141
|
FormControl.contextTypes = contextTypes;
|
|
142
142
|
|
|
143
|
-
FormControl.Feedback = _FormControlFeedback2
|
|
144
|
-
FormControl.Static = _FormControlStatic2
|
|
143
|
+
FormControl.Feedback = _FormControlFeedback2.default;
|
|
144
|
+
FormControl.Static = _FormControlStatic2.default;
|
|
145
145
|
|
|
146
|
-
exports
|
|
146
|
+
exports.default = (0, _bootstrapUtils.bsClass)('form-control', (0, _bootstrapUtils.bsSizes)([_StyleConfig.Size.SMALL, _StyleConfig.Size.LARGE], FormControl));
|
|
147
147
|
module.exports = exports['default'];
|