react-bootstrap 0.31.3 → 0.32.1
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 +57 -0
- package/README.md +1 -0
- package/dist/react-bootstrap.js +14493 -17076
- package/dist/react-bootstrap.min.js +18479 -16
- package/es/Alert.js +1 -4
- package/es/Badge.js +1 -3
- package/es/ButtonGroup.js +1 -3
- package/es/Carousel.js +79 -79
- package/es/CarouselCaption.js +1 -3
- package/es/CarouselItem.js +3 -9
- package/es/Checkbox.js +7 -1
- package/es/Clearfix.js +1 -3
- package/es/CloseButton.js +1 -5
- package/es/Col.js +1 -3
- package/es/Collapse.js +58 -65
- package/es/Dropdown.js +66 -55
- package/es/DropdownButton.js +2 -8
- package/es/DropdownMenu.js +28 -28
- package/es/Fade.js +25 -10
- package/es/Form.js +1 -3
- package/es/FormControl.js +1 -2
- package/es/FormControlStatic.js +1 -3
- package/es/FormGroup.js +1 -3
- package/es/Glyphicon.js +1 -3
- package/es/Grid.js +1 -3
- package/es/HelpBlock.js +1 -3
- package/es/InputGroup.js +1 -3
- package/es/InputGroupAddon.js +1 -3
- package/es/InputGroupButton.js +1 -3
- package/es/Jumbotron.js +1 -3
- package/es/Label.js +1 -3
- package/es/ListGroup.js +1 -3
- package/es/Media.js +1 -3
- package/es/MediaBody.js +16 -5
- package/es/MediaHeading.js +1 -3
- package/es/MediaLeft.js +1 -3
- package/es/MediaList.js +1 -3
- package/es/MediaListItem.js +1 -3
- package/es/MediaRight.js +1 -3
- package/es/Modal.js +30 -19
- package/es/ModalBody.js +1 -3
- package/es/ModalFooter.js +1 -3
- package/es/ModalHeader.js +2 -4
- package/es/ModalTitle.js +1 -3
- package/es/Nav.js +44 -44
- package/es/NavDropdown.js +2 -0
- package/es/NavItem.js +5 -4
- package/es/Navbar.js +5 -7
- package/es/Overlay.js +1 -3
- package/es/OverlayTrigger.js +43 -43
- package/es/PageHeader.js +1 -3
- package/es/Pager.js +1 -3
- package/es/PagerItem.js +1 -4
- package/es/Pagination.js +15 -224
- package/es/PaginationItem.js +102 -0
- package/es/Panel.js +114 -173
- package/es/PanelBody.js +84 -0
- package/es/PanelCollapse.js +94 -0
- package/es/PanelFooter.js +53 -0
- package/es/PanelGroup.js +95 -52
- package/es/PanelHeading.js +75 -0
- package/es/PanelTitle.js +83 -0
- package/es/PanelToggle.js +94 -0
- package/es/ProgressBar.js +12 -8
- package/es/Radio.js +7 -1
- package/es/Row.js +1 -3
- package/es/SplitButton.js +1 -4
- package/es/SplitToggle.js +1 -4
- package/es/TabContent.js +7 -7
- package/es/TabPane.js +18 -18
- package/es/Table.js +1 -3
- package/es/Tabs.js +4 -10
- package/es/Thumbnail.js +3 -3
- package/es/ToggleButton.js +1 -4
- package/es/Well.js +1 -3
- package/es/index.js +0 -2
- package/es/utils/PropTypes.js +26 -4
- package/es/utils/ValidComponentChildren.js +1 -1
- package/es/utils/bootstrapUtils.js +5 -3
- package/lib/Accordion.js +9 -9
- package/lib/Alert.js +14 -17
- package/lib/Badge.js +12 -14
- package/lib/Breadcrumb.js +10 -10
- package/lib/BreadcrumbItem.js +14 -14
- package/lib/Button.js +20 -20
- package/lib/ButtonGroup.js +12 -14
- package/lib/ButtonToolbar.js +9 -9
- package/lib/Carousel.js +121 -121
- package/lib/CarouselCaption.js +9 -11
- package/lib/CarouselItem.js +17 -22
- package/lib/Checkbox.js +25 -21
- package/lib/Clearfix.js +14 -16
- package/lib/CloseButton.js +12 -16
- package/lib/Col.js +29 -31
- package/lib/Collapse.js +84 -92
- package/lib/ControlLabel.js +14 -14
- package/lib/Dropdown.js +106 -95
- package/lib/DropdownButton.js +22 -28
- package/lib/DropdownMenu.js +51 -51
- package/lib/DropdownToggle.js +16 -16
- package/lib/Fade.js +43 -25
- package/lib/Form.js +11 -13
- package/lib/FormControl.js +17 -17
- package/lib/FormControlFeedback.js +13 -13
- package/lib/FormControlStatic.js +9 -11
- package/lib/FormGroup.js +14 -16
- package/lib/Glyphicon.js +10 -12
- package/lib/Grid.js +10 -12
- package/lib/HelpBlock.js +8 -10
- package/lib/Image.js +13 -13
- package/lib/InputGroup.js +10 -12
- package/lib/InputGroupAddon.js +8 -10
- package/lib/InputGroupButton.js +8 -10
- package/lib/Jumbotron.js +9 -11
- package/lib/Label.js +11 -13
- package/lib/ListGroup.js +15 -17
- package/lib/ListGroupItem.js +22 -22
- package/lib/Media.js +15 -17
- package/lib/MediaBody.js +28 -11
- package/lib/MediaHeading.js +9 -11
- package/lib/MediaLeft.js +10 -12
- package/lib/MediaList.js +8 -10
- package/lib/MediaListItem.js +8 -10
- package/lib/MediaRight.js +10 -12
- package/lib/MenuItem.js +23 -23
- package/lib/Modal.js +80 -69
- package/lib/ModalBody.js +9 -11
- package/lib/ModalDialog.js +16 -16
- package/lib/ModalFooter.js +9 -11
- package/lib/ModalHeader.js +20 -22
- package/lib/ModalTitle.js +9 -11
- package/lib/Nav.js +81 -81
- package/lib/NavDropdown.js +27 -25
- package/lib/NavItem.js +23 -22
- package/lib/Navbar.js +46 -48
- 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 -27
- package/lib/OverlayTrigger.js +79 -79
- package/lib/PageHeader.js +10 -12
- package/lib/PageItem.js +2 -2
- package/lib/Pager.js +13 -15
- package/lib/PagerItem.js +18 -21
- package/lib/Pagination.js +25 -240
- package/lib/PaginationItem.js +135 -0
- package/lib/Panel.js +142 -180
- package/lib/PanelBody.js +114 -0
- package/lib/PanelCollapse.js +120 -0
- package/lib/PanelFooter.js +80 -0
- package/lib/PanelGroup.js +111 -70
- package/lib/PanelHeading.js +107 -0
- package/lib/PanelTitle.js +118 -0
- package/lib/PanelToggle.js +130 -0
- package/lib/Popover.js +22 -22
- package/lib/ProgressBar.js +39 -35
- package/lib/Radio.js +25 -21
- package/lib/ResponsiveEmbed.js +17 -17
- package/lib/Row.js +9 -11
- package/lib/SafeAnchor.js +17 -17
- package/lib/SplitButton.js +26 -29
- package/lib/SplitToggle.js +8 -11
- package/lib/Tab.js +15 -15
- package/lib/TabContainer.js +17 -17
- package/lib/TabContent.js +31 -31
- package/lib/TabPane.js +59 -59
- package/lib/Table.js +15 -17
- package/lib/Tabs.js +29 -35
- package/lib/Thumbnail.js +18 -20
- package/lib/ToggleButton.js +17 -20
- package/lib/ToggleButtonGroup.js +20 -20
- package/lib/Tooltip.js +20 -20
- package/lib/Well.js +8 -10
- package/lib/index.js +74 -79
- package/lib/utils/PropTypes.js +35 -9
- package/lib/utils/ValidComponentChildren.js +19 -19
- package/lib/utils/bootstrapUtils.js +13 -11
- 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 +54 -64
- package/dist/react-bootstrap.min.js.map +0 -1
- package/es/PaginationButton.js +0 -98
- package/es/utils/TransitionEvents.js +0 -109
- package/lib/PaginationButton.js +0 -137
- package/lib/utils/TransitionEvents.js +0 -113
package/lib/TabPane.js
CHANGED
|
@@ -52,89 +52,89 @@ var _Fade = require('./Fade');
|
|
|
52
52
|
|
|
53
53
|
var _Fade2 = _interopRequireDefault(_Fade);
|
|
54
54
|
|
|
55
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
55
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
56
56
|
|
|
57
57
|
var propTypes = {
|
|
58
58
|
/**
|
|
59
59
|
* Uniquely identify the `<TabPane>` among its siblings.
|
|
60
60
|
*/
|
|
61
|
-
eventKey: _propTypes2
|
|
61
|
+
eventKey: _propTypes2.default.any,
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
64
|
* Use animation when showing or hiding `<TabPane>`s. Use `false` to disable,
|
|
65
|
-
* `true` to enable the default `<Fade>` animation or
|
|
66
|
-
* component.
|
|
65
|
+
* `true` to enable the default `<Fade>` animation or
|
|
66
|
+
* a react-transition-group v2 `<Transition/>` component.
|
|
67
67
|
*/
|
|
68
|
-
animation: _propTypes2
|
|
68
|
+
animation: _propTypes2.default.oneOfType([_propTypes2.default.bool, _elementType2.default]),
|
|
69
69
|
|
|
70
|
-
/** @private
|
|
71
|
-
id: _propTypes2
|
|
70
|
+
/** @private * */
|
|
71
|
+
id: _propTypes2.default.string,
|
|
72
72
|
|
|
73
|
-
/** @private
|
|
74
|
-
'aria-labelledby': _propTypes2
|
|
73
|
+
/** @private * */
|
|
74
|
+
'aria-labelledby': _propTypes2.default.string,
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* If not explicitly specified and rendered in the context of a
|
|
78
78
|
* `<TabContent>`, the `bsClass` of the `<TabContent>` suffixed by `-pane`.
|
|
79
79
|
* If otherwise not explicitly specified, `tab-pane`.
|
|
80
80
|
*/
|
|
81
|
-
bsClass: _propTypes2
|
|
81
|
+
bsClass: _propTypes2.default.string,
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
84
|
* Transition onEnter callback when animation is not `false`
|
|
85
85
|
*/
|
|
86
|
-
onEnter: _propTypes2
|
|
86
|
+
onEnter: _propTypes2.default.func,
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
89
|
* Transition onEntering callback when animation is not `false`
|
|
90
90
|
*/
|
|
91
|
-
onEntering: _propTypes2
|
|
91
|
+
onEntering: _propTypes2.default.func,
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
94
|
* Transition onEntered callback when animation is not `false`
|
|
95
95
|
*/
|
|
96
|
-
onEntered: _propTypes2
|
|
96
|
+
onEntered: _propTypes2.default.func,
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
99
|
* Transition onExit callback when animation is not `false`
|
|
100
100
|
*/
|
|
101
|
-
onExit: _propTypes2
|
|
101
|
+
onExit: _propTypes2.default.func,
|
|
102
102
|
|
|
103
103
|
/**
|
|
104
104
|
* Transition onExiting callback when animation is not `false`
|
|
105
105
|
*/
|
|
106
|
-
onExiting: _propTypes2
|
|
106
|
+
onExiting: _propTypes2.default.func,
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
109
|
* Transition onExited callback when animation is not `false`
|
|
110
110
|
*/
|
|
111
|
-
onExited: _propTypes2
|
|
111
|
+
onExited: _propTypes2.default.func,
|
|
112
112
|
|
|
113
113
|
/**
|
|
114
114
|
* Wait until the first "enter" transition to mount the tab (add it to the DOM)
|
|
115
115
|
*/
|
|
116
|
-
mountOnEnter: _propTypes2
|
|
116
|
+
mountOnEnter: _propTypes2.default.bool,
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
119
|
* Unmount the tab (remove it from the DOM) when it is no longer visible
|
|
120
120
|
*/
|
|
121
|
-
unmountOnExit: _propTypes2
|
|
121
|
+
unmountOnExit: _propTypes2.default.bool
|
|
122
122
|
};
|
|
123
123
|
|
|
124
124
|
var contextTypes = {
|
|
125
|
-
$bs_tabContainer: _propTypes2
|
|
126
|
-
getTabId: _propTypes2
|
|
127
|
-
getPaneId: _propTypes2
|
|
125
|
+
$bs_tabContainer: _propTypes2.default.shape({
|
|
126
|
+
getTabId: _propTypes2.default.func,
|
|
127
|
+
getPaneId: _propTypes2.default.func
|
|
128
128
|
}),
|
|
129
|
-
$bs_tabContent: _propTypes2
|
|
130
|
-
bsClass: _propTypes2
|
|
131
|
-
animation: _propTypes2
|
|
132
|
-
activeKey: _propTypes2
|
|
133
|
-
mountOnEnter: _propTypes2
|
|
134
|
-
unmountOnExit: _propTypes2
|
|
135
|
-
onPaneEnter: _propTypes2
|
|
136
|
-
onPaneExited: _propTypes2
|
|
137
|
-
exiting: _propTypes2
|
|
129
|
+
$bs_tabContent: _propTypes2.default.shape({
|
|
130
|
+
bsClass: _propTypes2.default.string,
|
|
131
|
+
animation: _propTypes2.default.oneOfType([_propTypes2.default.bool, _elementType2.default]),
|
|
132
|
+
activeKey: _propTypes2.default.any,
|
|
133
|
+
mountOnEnter: _propTypes2.default.bool,
|
|
134
|
+
unmountOnExit: _propTypes2.default.bool,
|
|
135
|
+
onPaneEnter: _propTypes2.default.func.isRequired,
|
|
136
|
+
onPaneExited: _propTypes2.default.func.isRequired,
|
|
137
|
+
exiting: _propTypes2.default.bool.isRequired
|
|
138
138
|
})
|
|
139
139
|
};
|
|
140
140
|
|
|
@@ -143,21 +143,21 @@ var contextTypes = {
|
|
|
143
143
|
* conflict with the top level one.
|
|
144
144
|
*/
|
|
145
145
|
var childContextTypes = {
|
|
146
|
-
$bs_tabContainer: _propTypes2
|
|
146
|
+
$bs_tabContainer: _propTypes2.default.oneOf([null])
|
|
147
147
|
};
|
|
148
148
|
|
|
149
149
|
var TabPane = function (_React$Component) {
|
|
150
|
-
(0, _inherits3
|
|
150
|
+
(0, _inherits3.default)(TabPane, _React$Component);
|
|
151
151
|
|
|
152
152
|
function TabPane(props, context) {
|
|
153
|
-
(0, _classCallCheck3
|
|
153
|
+
(0, _classCallCheck3.default)(this, TabPane);
|
|
154
154
|
|
|
155
|
-
var _this = (0, _possibleConstructorReturn3
|
|
155
|
+
var _this = (0, _possibleConstructorReturn3.default)(this, _React$Component.call(this, props, context));
|
|
156
156
|
|
|
157
157
|
_this.handleEnter = _this.handleEnter.bind(_this);
|
|
158
158
|
_this.handleExited = _this.handleExited.bind(_this);
|
|
159
159
|
|
|
160
|
-
_this
|
|
160
|
+
_this.in = false;
|
|
161
161
|
return _this;
|
|
162
162
|
}
|
|
163
163
|
|
|
@@ -175,7 +175,7 @@ var TabPane = function (_React$Component) {
|
|
|
175
175
|
};
|
|
176
176
|
|
|
177
177
|
TabPane.prototype.componentDidUpdate = function componentDidUpdate() {
|
|
178
|
-
if (this
|
|
178
|
+
if (this.in) {
|
|
179
179
|
if (!this.shouldBeIn()) {
|
|
180
180
|
// We shouldn't be active any more. Notify the parent.
|
|
181
181
|
this.handleExited();
|
|
@@ -187,19 +187,28 @@ var TabPane = function (_React$Component) {
|
|
|
187
187
|
};
|
|
188
188
|
|
|
189
189
|
TabPane.prototype.componentWillUnmount = function componentWillUnmount() {
|
|
190
|
-
if (this
|
|
190
|
+
if (this.in) {
|
|
191
191
|
// In lieu of the action event firing.
|
|
192
192
|
this.handleExited();
|
|
193
193
|
}
|
|
194
194
|
};
|
|
195
195
|
|
|
196
|
+
TabPane.prototype.getAnimation = function getAnimation() {
|
|
197
|
+
if (this.props.animation != null) {
|
|
198
|
+
return this.props.animation;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
var tabContent = this.context.$bs_tabContent;
|
|
202
|
+
return tabContent && tabContent.animation;
|
|
203
|
+
};
|
|
204
|
+
|
|
196
205
|
TabPane.prototype.handleEnter = function handleEnter() {
|
|
197
206
|
var tabContent = this.context.$bs_tabContent;
|
|
198
207
|
if (!tabContent) {
|
|
199
208
|
return;
|
|
200
209
|
}
|
|
201
210
|
|
|
202
|
-
this
|
|
211
|
+
this.in = tabContent.onPaneEnter(this, this.props.eventKey);
|
|
203
212
|
};
|
|
204
213
|
|
|
205
214
|
TabPane.prototype.handleExited = function handleExited() {
|
|
@@ -209,16 +218,7 @@ var TabPane = function (_React$Component) {
|
|
|
209
218
|
}
|
|
210
219
|
|
|
211
220
|
tabContent.onPaneExited(this);
|
|
212
|
-
this
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
TabPane.prototype.getAnimation = function getAnimation() {
|
|
216
|
-
if (this.props.animation != null) {
|
|
217
|
-
return this.props.animation;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
var tabContent = this.context.$bs_tabContent;
|
|
221
|
-
return tabContent && tabContent.animation;
|
|
221
|
+
this.in = false;
|
|
222
222
|
};
|
|
223
223
|
|
|
224
224
|
TabPane.prototype.isActive = function isActive() {
|
|
@@ -244,7 +244,7 @@ var TabPane = function (_React$Component) {
|
|
|
244
244
|
onExited = _props.onExited,
|
|
245
245
|
propsMountOnEnter = _props.mountOnEnter,
|
|
246
246
|
propsUnmountOnExit = _props.unmountOnExit,
|
|
247
|
-
props = (0, _objectWithoutProperties3
|
|
247
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['eventKey', 'className', 'onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited', 'mountOnEnter', 'unmountOnExit']);
|
|
248
248
|
var _context = this.context,
|
|
249
249
|
tabContent = _context.$bs_tabContent,
|
|
250
250
|
tabContainer = _context.$bs_tabContainer;
|
|
@@ -263,42 +263,42 @@ var TabPane = function (_React$Component) {
|
|
|
263
263
|
return null;
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
-
var Transition = animation === true ? _Fade2
|
|
266
|
+
var Transition = animation === true ? _Fade2.default : animation || null;
|
|
267
267
|
|
|
268
268
|
if (tabContent) {
|
|
269
269
|
bsProps.bsClass = (0, _bootstrapUtils.prefix)(tabContent, 'pane');
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
-
var classes = (0, _extends3
|
|
272
|
+
var classes = (0, _extends3.default)({}, (0, _bootstrapUtils.getClassSet)(bsProps), {
|
|
273
273
|
active: active
|
|
274
274
|
});
|
|
275
275
|
|
|
276
276
|
if (tabContainer) {
|
|
277
|
-
process.env.NODE_ENV !== 'production' ? (0, _warning2
|
|
277
|
+
process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(!elementProps.id && !elementProps['aria-labelledby'], 'In the context of a `<TabContainer>`, `<TabPanes>` are given ' + 'generated `id` and `aria-labelledby` attributes for the sake of ' + 'proper component accessibility. Any provided ones will be ignored. ' + 'To control these attributes directly provide a `generateChildId` ' + 'prop to the parent `<TabContainer>`.') : void 0;
|
|
278
278
|
|
|
279
279
|
elementProps.id = tabContainer.getPaneId(eventKey);
|
|
280
280
|
elementProps['aria-labelledby'] = tabContainer.getTabId(eventKey);
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
var pane = _react2
|
|
283
|
+
var pane = _react2.default.createElement('div', (0, _extends3.default)({}, elementProps, {
|
|
284
284
|
role: 'tabpanel',
|
|
285
285
|
'aria-hidden': !active,
|
|
286
|
-
className: (0, _classnames2
|
|
286
|
+
className: (0, _classnames2.default)(className, classes)
|
|
287
287
|
}));
|
|
288
288
|
|
|
289
289
|
if (Transition) {
|
|
290
290
|
var exiting = tabContent && tabContent.exiting;
|
|
291
291
|
|
|
292
|
-
return _react2
|
|
292
|
+
return _react2.default.createElement(
|
|
293
293
|
Transition,
|
|
294
294
|
{
|
|
295
295
|
'in': active && !exiting,
|
|
296
|
-
onEnter: (0, _createChainedFunction2
|
|
296
|
+
onEnter: (0, _createChainedFunction2.default)(this.handleEnter, onEnter),
|
|
297
297
|
onEntering: onEntering,
|
|
298
298
|
onEntered: onEntered,
|
|
299
299
|
onExit: onExit,
|
|
300
300
|
onExiting: onExiting,
|
|
301
|
-
onExited: (0, _createChainedFunction2
|
|
301
|
+
onExited: (0, _createChainedFunction2.default)(this.handleExited, onExited),
|
|
302
302
|
mountOnEnter: mountOnEnter,
|
|
303
303
|
unmountOnExit: unmountOnExit
|
|
304
304
|
},
|
|
@@ -310,11 +310,11 @@ var TabPane = function (_React$Component) {
|
|
|
310
310
|
};
|
|
311
311
|
|
|
312
312
|
return TabPane;
|
|
313
|
-
}(_react2
|
|
313
|
+
}(_react2.default.Component);
|
|
314
314
|
|
|
315
315
|
TabPane.propTypes = propTypes;
|
|
316
316
|
TabPane.contextTypes = contextTypes;
|
|
317
317
|
TabPane.childContextTypes = childContextTypes;
|
|
318
318
|
|
|
319
|
-
exports
|
|
319
|
+
exports.default = (0, _bootstrapUtils.bsClass)('tab-pane', TabPane);
|
|
320
320
|
module.exports = exports['default'];
|
package/lib/Table.js
CHANGED
|
@@ -36,14 +36,14 @@ var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
|
36
36
|
|
|
37
37
|
var _bootstrapUtils = require('./utils/bootstrapUtils');
|
|
38
38
|
|
|
39
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
39
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
40
40
|
|
|
41
41
|
var propTypes = {
|
|
42
|
-
striped: _propTypes2
|
|
43
|
-
bordered: _propTypes2
|
|
44
|
-
condensed: _propTypes2
|
|
45
|
-
hover: _propTypes2
|
|
46
|
-
responsive: _propTypes2
|
|
42
|
+
striped: _propTypes2.default.bool,
|
|
43
|
+
bordered: _propTypes2.default.bool,
|
|
44
|
+
condensed: _propTypes2.default.bool,
|
|
45
|
+
hover: _propTypes2.default.bool,
|
|
46
|
+
responsive: _propTypes2.default.bool
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
var defaultProps = {
|
|
@@ -55,11 +55,11 @@ var defaultProps = {
|
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
var Table = function (_React$Component) {
|
|
58
|
-
(0, _inherits3
|
|
58
|
+
(0, _inherits3.default)(Table, _React$Component);
|
|
59
59
|
|
|
60
60
|
function Table() {
|
|
61
|
-
(0, _classCallCheck3
|
|
62
|
-
return (0, _possibleConstructorReturn3
|
|
61
|
+
(0, _classCallCheck3.default)(this, Table);
|
|
62
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
Table.prototype.render = function render() {
|
|
@@ -72,20 +72,18 @@ var Table = function (_React$Component) {
|
|
|
72
72
|
hover = _props.hover,
|
|
73
73
|
responsive = _props.responsive,
|
|
74
74
|
className = _props.className,
|
|
75
|
-
props = (0, _objectWithoutProperties3
|
|
75
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['striped', 'bordered', 'condensed', 'hover', 'responsive', 'className']);
|
|
76
76
|
|
|
77
77
|
var _splitBsProps = (0, _bootstrapUtils.splitBsProps)(props),
|
|
78
78
|
bsProps = _splitBsProps[0],
|
|
79
79
|
elementProps = _splitBsProps[1];
|
|
80
80
|
|
|
81
|
-
var classes = (0, _extends4
|
|
81
|
+
var classes = (0, _extends4.default)({}, (0, _bootstrapUtils.getClassSet)(bsProps), (_extends2 = {}, _extends2[(0, _bootstrapUtils.prefix)(bsProps, 'striped')] = striped, _extends2[(0, _bootstrapUtils.prefix)(bsProps, 'bordered')] = bordered, _extends2[(0, _bootstrapUtils.prefix)(bsProps, 'condensed')] = condensed, _extends2[(0, _bootstrapUtils.prefix)(bsProps, 'hover')] = hover, _extends2));
|
|
82
82
|
|
|
83
|
-
var table = _react2
|
|
84
|
-
className: (0, _classnames2['default'])(className, classes)
|
|
85
|
-
}));
|
|
83
|
+
var table = _react2.default.createElement('table', (0, _extends4.default)({}, elementProps, { className: (0, _classnames2.default)(className, classes) }));
|
|
86
84
|
|
|
87
85
|
if (responsive) {
|
|
88
|
-
return _react2
|
|
86
|
+
return _react2.default.createElement(
|
|
89
87
|
'div',
|
|
90
88
|
{ className: (0, _bootstrapUtils.prefix)(bsProps, 'responsive') },
|
|
91
89
|
table
|
|
@@ -96,10 +94,10 @@ var Table = function (_React$Component) {
|
|
|
96
94
|
};
|
|
97
95
|
|
|
98
96
|
return Table;
|
|
99
|
-
}(_react2
|
|
97
|
+
}(_react2.default.Component);
|
|
100
98
|
|
|
101
99
|
Table.propTypes = propTypes;
|
|
102
100
|
Table.defaultProps = defaultProps;
|
|
103
101
|
|
|
104
|
-
exports
|
|
102
|
+
exports.default = (0, _bootstrapUtils.bsClass)('table', Table);
|
|
105
103
|
module.exports = exports['default'];
|
package/lib/Tabs.js
CHANGED
|
@@ -60,9 +60,9 @@ 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
|
-
var TabContainer = _TabContainer2
|
|
65
|
+
var TabContainer = _TabContainer2.default.ControlledComponent;
|
|
66
66
|
|
|
67
67
|
var propTypes = {
|
|
68
68
|
/**
|
|
@@ -70,40 +70,40 @@ var propTypes = {
|
|
|
70
70
|
*
|
|
71
71
|
* @controllable onSelect
|
|
72
72
|
*/
|
|
73
|
-
activeKey: _propTypes2
|
|
73
|
+
activeKey: _propTypes2.default.any,
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* Navigation style
|
|
77
77
|
*/
|
|
78
|
-
bsStyle: _propTypes2
|
|
78
|
+
bsStyle: _propTypes2.default.oneOf(['tabs', 'pills']),
|
|
79
79
|
|
|
80
|
-
animation: _propTypes2
|
|
80
|
+
animation: _propTypes2.default.bool,
|
|
81
81
|
|
|
82
|
-
id: (0, _isRequiredForA11y2
|
|
82
|
+
id: (0, _isRequiredForA11y2.default)(_propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number])),
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* Callback fired when a Tab is selected.
|
|
86
86
|
*
|
|
87
87
|
* ```js
|
|
88
88
|
* function (
|
|
89
|
-
*
|
|
90
|
-
*
|
|
89
|
+
* Any eventKey,
|
|
90
|
+
* SyntheticEvent event?
|
|
91
91
|
* )
|
|
92
92
|
* ```
|
|
93
93
|
*
|
|
94
94
|
* @controllable activeKey
|
|
95
95
|
*/
|
|
96
|
-
onSelect: _propTypes2
|
|
96
|
+
onSelect: _propTypes2.default.func,
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
99
|
* Wait until the first "enter" transition to mount tabs (add them to the DOM)
|
|
100
100
|
*/
|
|
101
|
-
mountOnEnter: _propTypes2
|
|
101
|
+
mountOnEnter: _propTypes2.default.bool,
|
|
102
102
|
|
|
103
103
|
/**
|
|
104
104
|
* Unmount tabs (remove it from the DOM) when it is no longer visible
|
|
105
105
|
*/
|
|
106
|
-
unmountOnExit: _propTypes2
|
|
106
|
+
unmountOnExit: _propTypes2.default.bool
|
|
107
107
|
};
|
|
108
108
|
|
|
109
109
|
var defaultProps = {
|
|
@@ -115,7 +115,7 @@ var defaultProps = {
|
|
|
115
115
|
|
|
116
116
|
function getDefaultActiveKey(children) {
|
|
117
117
|
var defaultActiveKey = void 0;
|
|
118
|
-
_ValidComponentChildren2
|
|
118
|
+
_ValidComponentChildren2.default.forEach(children, function (child) {
|
|
119
119
|
if (defaultActiveKey == null) {
|
|
120
120
|
defaultActiveKey = child.props.eventKey;
|
|
121
121
|
}
|
|
@@ -125,11 +125,11 @@ function getDefaultActiveKey(children) {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
var Tabs = function (_React$Component) {
|
|
128
|
-
(0, _inherits3
|
|
128
|
+
(0, _inherits3.default)(Tabs, _React$Component);
|
|
129
129
|
|
|
130
130
|
function Tabs() {
|
|
131
|
-
(0, _classCallCheck3
|
|
132
|
-
return (0, _possibleConstructorReturn3
|
|
131
|
+
(0, _classCallCheck3.default)(this, Tabs);
|
|
132
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
Tabs.prototype.renderTab = function renderTab(child) {
|
|
@@ -143,13 +143,9 @@ var Tabs = function (_React$Component) {
|
|
|
143
143
|
return null;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
return _react2
|
|
147
|
-
_NavItem2
|
|
148
|
-
{
|
|
149
|
-
eventKey: eventKey,
|
|
150
|
-
disabled: disabled,
|
|
151
|
-
className: tabClassName
|
|
152
|
-
},
|
|
146
|
+
return _react2.default.createElement(
|
|
147
|
+
_NavItem2.default,
|
|
148
|
+
{ eventKey: eventKey, disabled: disabled, className: tabClassName },
|
|
153
149
|
title
|
|
154
150
|
);
|
|
155
151
|
};
|
|
@@ -167,10 +163,10 @@ var Tabs = function (_React$Component) {
|
|
|
167
163
|
children = _props.children,
|
|
168
164
|
_props$activeKey = _props.activeKey,
|
|
169
165
|
activeKey = _props$activeKey === undefined ? getDefaultActiveKey(children) : _props$activeKey,
|
|
170
|
-
props = (0, _objectWithoutProperties3
|
|
166
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['id', 'onSelect', 'animation', 'mountOnEnter', 'unmountOnExit', 'bsClass', 'className', 'style', 'children', 'activeKey']);
|
|
171
167
|
|
|
172
168
|
|
|
173
|
-
return _react2
|
|
169
|
+
return _react2.default.createElement(
|
|
174
170
|
TabContainer,
|
|
175
171
|
{
|
|
176
172
|
id: id,
|
|
@@ -179,18 +175,16 @@ var Tabs = function (_React$Component) {
|
|
|
179
175
|
className: className,
|
|
180
176
|
style: style
|
|
181
177
|
},
|
|
182
|
-
_react2
|
|
178
|
+
_react2.default.createElement(
|
|
183
179
|
'div',
|
|
184
180
|
null,
|
|
185
|
-
_react2
|
|
186
|
-
_Nav2
|
|
187
|
-
(0, _extends3
|
|
188
|
-
|
|
189
|
-
}),
|
|
190
|
-
_ValidComponentChildren2['default'].map(children, this.renderTab)
|
|
181
|
+
_react2.default.createElement(
|
|
182
|
+
_Nav2.default,
|
|
183
|
+
(0, _extends3.default)({}, props, { role: 'tablist' }),
|
|
184
|
+
_ValidComponentChildren2.default.map(children, this.renderTab)
|
|
191
185
|
),
|
|
192
|
-
_react2
|
|
193
|
-
_TabContent2
|
|
186
|
+
_react2.default.createElement(
|
|
187
|
+
_TabContent2.default,
|
|
194
188
|
{
|
|
195
189
|
bsClass: bsClass,
|
|
196
190
|
animation: animation,
|
|
@@ -204,12 +198,12 @@ var Tabs = function (_React$Component) {
|
|
|
204
198
|
};
|
|
205
199
|
|
|
206
200
|
return Tabs;
|
|
207
|
-
}(_react2
|
|
201
|
+
}(_react2.default.Component);
|
|
208
202
|
|
|
209
203
|
Tabs.propTypes = propTypes;
|
|
210
204
|
Tabs.defaultProps = defaultProps;
|
|
211
205
|
|
|
212
206
|
(0, _bootstrapUtils.bsClass)('tab', Tabs);
|
|
213
207
|
|
|
214
|
-
exports
|
|
208
|
+
exports.default = (0, _uncontrollable2.default)(Tabs, { activeKey: 'onSelect' });
|
|
215
209
|
module.exports = exports['default'];
|
package/lib/Thumbnail.js
CHANGED
|
@@ -40,37 +40,37 @@ var _SafeAnchor2 = _interopRequireDefault(_SafeAnchor);
|
|
|
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
46
|
/**
|
|
47
47
|
* src property that is passed down to the image inside this component
|
|
48
48
|
*/
|
|
49
|
-
src: _propTypes2
|
|
49
|
+
src: _propTypes2.default.string,
|
|
50
50
|
/**
|
|
51
51
|
* alt property that is passed down to the image inside this component
|
|
52
52
|
*/
|
|
53
|
-
alt: _propTypes2
|
|
53
|
+
alt: _propTypes2.default.string,
|
|
54
54
|
/**
|
|
55
55
|
* href property that is passed down to the image inside this component
|
|
56
56
|
*/
|
|
57
|
-
href: _propTypes2
|
|
57
|
+
href: _propTypes2.default.string,
|
|
58
58
|
/**
|
|
59
59
|
* onError callback that is passed down to the image inside this component
|
|
60
60
|
*/
|
|
61
|
-
onError: _propTypes2
|
|
61
|
+
onError: _propTypes2.default.func,
|
|
62
62
|
/**
|
|
63
63
|
* onLoad callback that is passed down to the image inside this component
|
|
64
64
|
*/
|
|
65
|
-
onLoad: _propTypes2
|
|
66
|
-
};
|
|
65
|
+
onLoad: _propTypes2.default.func
|
|
66
|
+
}; /* eslint-disable jsx-a11y/alt-text */
|
|
67
67
|
|
|
68
68
|
var Thumbnail = function (_React$Component) {
|
|
69
|
-
(0, _inherits3
|
|
69
|
+
(0, _inherits3.default)(Thumbnail, _React$Component);
|
|
70
70
|
|
|
71
71
|
function Thumbnail() {
|
|
72
|
-
(0, _classCallCheck3
|
|
73
|
-
return (0, _possibleConstructorReturn3
|
|
72
|
+
(0, _classCallCheck3.default)(this, Thumbnail);
|
|
73
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
Thumbnail.prototype.render = function render() {
|
|
@@ -81,22 +81,20 @@ var Thumbnail = function (_React$Component) {
|
|
|
81
81
|
onLoad = _props.onLoad,
|
|
82
82
|
className = _props.className,
|
|
83
83
|
children = _props.children,
|
|
84
|
-
props = (0, _objectWithoutProperties3
|
|
84
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['src', 'alt', 'onError', 'onLoad', 'className', 'children']);
|
|
85
85
|
|
|
86
86
|
var _splitBsProps = (0, _bootstrapUtils.splitBsProps)(props),
|
|
87
87
|
bsProps = _splitBsProps[0],
|
|
88
88
|
elementProps = _splitBsProps[1];
|
|
89
89
|
|
|
90
|
-
var Component = elementProps.href ? _SafeAnchor2
|
|
90
|
+
var Component = elementProps.href ? _SafeAnchor2.default : 'div';
|
|
91
91
|
var classes = (0, _bootstrapUtils.getClassSet)(bsProps);
|
|
92
92
|
|
|
93
|
-
return _react2
|
|
93
|
+
return _react2.default.createElement(
|
|
94
94
|
Component,
|
|
95
|
-
(0, _extends3
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
_react2['default'].createElement('img', { src: src, alt: alt, onError: onError, onLoad: onLoad }),
|
|
99
|
-
children && _react2['default'].createElement(
|
|
95
|
+
(0, _extends3.default)({}, elementProps, { className: (0, _classnames2.default)(className, classes) }),
|
|
96
|
+
_react2.default.createElement('img', { src: src, alt: alt, onError: onError, onLoad: onLoad }),
|
|
97
|
+
children && _react2.default.createElement(
|
|
100
98
|
'div',
|
|
101
99
|
{ className: 'caption' },
|
|
102
100
|
children
|
|
@@ -105,9 +103,9 @@ var Thumbnail = function (_React$Component) {
|
|
|
105
103
|
};
|
|
106
104
|
|
|
107
105
|
return Thumbnail;
|
|
108
|
-
}(_react2
|
|
106
|
+
}(_react2.default.Component);
|
|
109
107
|
|
|
110
108
|
Thumbnail.propTypes = propTypes;
|
|
111
109
|
|
|
112
|
-
exports
|
|
110
|
+
exports.default = (0, _bootstrapUtils.bsClass)('thumbnail', Thumbnail);
|
|
113
111
|
module.exports = exports['default'];
|