react-bootstrap 0.32.0 → 0.32.4
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 +38 -0
- package/README.md +11 -7
- package/dist/react-bootstrap.js +13464 -13723
- package/dist/react-bootstrap.min.js +10 -18464
- package/es/Accordion.js +13 -16
- package/es/Alert.js +26 -31
- package/es/Badge.js +21 -31
- package/es/Breadcrumb.js +17 -20
- package/es/BreadcrumbItem.js +30 -30
- package/es/Button.js +23 -27
- package/es/ButtonGroup.js +20 -22
- package/es/ButtonToolbar.js +16 -18
- package/es/Carousel.js +120 -157
- package/es/CarouselCaption.js +18 -21
- package/es/CarouselItem.js +34 -33
- package/es/Checkbox.js +43 -54
- package/es/Clearfix.js +24 -24
- package/es/CloseButton.js +21 -30
- package/es/Col.js +42 -26
- package/es/Collapse.js +68 -68
- package/es/ControlLabel.js +19 -24
- package/es/Dropdown.js +93 -91
- package/es/DropdownButton.js +25 -35
- package/es/DropdownMenu.js +65 -65
- package/es/DropdownToggle.js +28 -40
- package/es/Fade.js +26 -29
- package/es/Form.js +22 -22
- package/es/FormControl.js +32 -33
- package/es/FormControlFeedback.js +21 -21
- package/es/FormControlStatic.js +18 -21
- package/es/FormGroup.js +27 -34
- package/es/Glyphicon.js +18 -19
- package/es/Grid.js +20 -22
- package/es/HelpBlock.js +17 -17
- package/es/Image.js +19 -24
- package/es/InputGroup.js +17 -18
- package/es/InputGroupAddon.js +17 -17
- package/es/InputGroupButton.js +17 -17
- package/es/Jumbotron.js +18 -21
- package/es/Label.js +21 -27
- package/es/ListGroup.js +24 -29
- package/es/ListGroupItem.js +30 -48
- package/es/Media.js +18 -22
- package/es/MediaBody.js +19 -22
- package/es/MediaHeading.js +18 -21
- package/es/MediaLeft.js +18 -19
- package/es/MediaList.js +17 -17
- package/es/MediaListItem.js +17 -17
- package/es/MediaRight.js +18 -19
- package/es/MenuItem.js +44 -49
- package/es/Modal.js +63 -74
- package/es/ModalBody.js +18 -21
- package/es/ModalDialog.js +31 -39
- package/es/ModalFooter.js +18 -21
- package/es/ModalHeader.js +25 -35
- package/es/ModalTitle.js +18 -21
- package/es/Nav.js +73 -92
- package/es/NavDropdown.js +40 -52
- package/es/NavItem.js +34 -38
- package/es/Navbar.js +62 -73
- package/es/NavbarBrand.js +20 -24
- package/es/NavbarCollapse.js +21 -28
- package/es/NavbarHeader.js +19 -20
- package/es/NavbarToggle.js +30 -38
- package/es/Overlay.js +21 -25
- package/es/OverlayTrigger.js +71 -68
- package/es/PageHeader.js +18 -26
- package/es/PageItem.js +0 -1
- package/es/Pager.js +23 -30
- package/es/PagerItem.js +36 -40
- package/es/Pagination.js +18 -24
- package/es/PaginationItem.js +47 -57
- package/es/Panel.js +51 -54
- package/es/PanelBody.js +18 -29
- package/es/PanelCollapse.js +20 -23
- package/es/PanelFooter.js +16 -23
- package/es/PanelGroup.js +44 -45
- package/es/PanelHeading.js +19 -28
- package/es/PanelTitle.js +22 -34
- package/es/PanelToggle.js +21 -24
- package/es/Popover.js +36 -46
- package/es/ProgressBar.js +59 -62
- package/es/Radio.js +43 -54
- package/es/ResponsiveEmbed.js +27 -32
- package/es/Row.js +18 -21
- package/es/SafeAnchor.js +32 -32
- package/es/SplitButton.js +33 -46
- package/es/SplitToggle.js +14 -13
- package/es/Tab.js +12 -18
- package/es/TabContainer.js +24 -30
- package/es/TabContent.js +36 -43
- package/es/TabPane.js +58 -68
- package/es/Table.js +25 -29
- package/es/Tabs.js +56 -71
- package/es/Thumbnail.js +34 -34
- package/es/ToggleButton.js +32 -37
- package/es/ToggleButtonGroup.js +45 -57
- package/es/Tooltip.js +33 -40
- package/es/Well.js +17 -17
- package/es/index.js +2 -0
- package/es/utils/PropTypes.js +13 -19
- package/es/utils/StyleConfig.js +0 -4
- package/es/utils/ValidComponentChildren.js +11 -20
- package/es/utils/bootstrapUtils.js +17 -31
- package/es/utils/createChainedFunction.js +2 -2
- package/es/utils/deprecationWarning.js +28 -30
- package/es/utils/splitComponentProps.js +1 -2
- package/lib/Accordion.js +23 -36
- package/lib/Alert.js +43 -65
- package/lib/Badge.js +36 -56
- package/lib/Breadcrumb.js +32 -47
- package/lib/BreadcrumbItem.js +48 -63
- package/lib/Button.js +49 -71
- package/lib/ButtonGroup.js +39 -57
- package/lib/ButtonToolbar.js +29 -42
- package/lib/Carousel.js +161 -214
- package/lib/CarouselCaption.js +32 -46
- package/lib/CarouselItem.js +54 -73
- package/lib/Checkbox.js +64 -87
- package/lib/Clearfix.js +45 -58
- package/lib/CloseButton.js +33 -50
- package/lib/Col.js +78 -73
- package/lib/Collapse.js +104 -125
- package/lib/ControlLabel.js +38 -59
- package/lib/Dropdown.js +153 -192
- package/lib/DropdownButton.js +44 -70
- package/lib/DropdownMenu.js +96 -120
- package/lib/DropdownToggle.js +48 -77
- package/lib/Fade.js +49 -68
- package/lib/Form.js +39 -52
- package/lib/FormControl.js +58 -79
- package/lib/FormControlFeedback.js +42 -54
- package/lib/FormControlStatic.js +32 -46
- package/lib/FormGroup.js +47 -67
- package/lib/Glyphicon.js +33 -46
- package/lib/Grid.js +36 -51
- package/lib/HelpBlock.js +29 -40
- package/lib/Image.js +37 -53
- package/lib/InputGroup.js +34 -49
- package/lib/InputGroupAddon.js +29 -40
- package/lib/InputGroupButton.js +29 -40
- package/lib/Jumbotron.js +32 -46
- package/lib/Label.js +35 -53
- package/lib/ListGroup.js +45 -61
- package/lib/ListGroupItem.js +55 -85
- package/lib/Media.js +43 -70
- package/lib/MediaBody.js +37 -55
- package/lib/MediaHeading.js +32 -46
- package/lib/MediaLeft.js +34 -48
- package/lib/MediaList.js +29 -40
- package/lib/MediaListItem.js +29 -40
- package/lib/MediaRight.js +34 -48
- package/lib/MenuItem.js +70 -92
- package/lib/Modal.js +130 -186
- package/lib/ModalBody.js +32 -46
- package/lib/ModalDialog.js +47 -69
- package/lib/ModalFooter.js +32 -46
- package/lib/ModalHeader.js +43 -70
- package/lib/ModalTitle.js +32 -46
- package/lib/Nav.js +122 -160
- package/lib/NavDropdown.js +63 -97
- package/lib/NavItem.js +54 -77
- package/lib/Navbar.js +115 -152
- package/lib/NavbarBrand.js +37 -55
- package/lib/NavbarCollapse.js +36 -57
- package/lib/NavbarHeader.js +33 -48
- package/lib/NavbarToggle.js +52 -77
- package/lib/Overlay.js +50 -75
- package/lib/OverlayTrigger.js +114 -129
- package/lib/PageHeader.js +30 -49
- package/lib/PageItem.js +9 -10
- package/lib/Pager.js +41 -63
- package/lib/PagerItem.js +55 -78
- package/lib/Pagination.js +32 -50
- package/lib/PaginationItem.js +67 -91
- package/lib/Panel.js +93 -127
- package/lib/PanelBody.js +35 -57
- package/lib/PanelCollapse.js +44 -56
- package/lib/PanelFooter.js +31 -48
- package/lib/PanelGroup.js +73 -88
- package/lib/PanelHeading.js +37 -59
- package/lib/PanelTitle.js +41 -68
- package/lib/PanelToggle.js +45 -66
- package/lib/Popover.js +59 -84
- package/lib/ProgressBar.js +86 -103
- package/lib/Radio.js +64 -87
- package/lib/ResponsiveEmbed.js +45 -63
- package/lib/Row.js +32 -46
- package/lib/SafeAnchor.js +53 -69
- package/lib/SplitButton.js +57 -90
- package/lib/SplitToggle.js +25 -34
- package/lib/Tab.js +32 -55
- package/lib/TabContainer.js +45 -61
- package/lib/TabContent.js +67 -87
- package/lib/TabPane.js +103 -131
- package/lib/Table.js +44 -59
- package/lib/Tabs.js +82 -119
- package/lib/Thumbnail.js +55 -67
- package/lib/ToggleButton.js +49 -68
- package/lib/ToggleButtonGroup.js +67 -104
- package/lib/Tooltip.js +55 -77
- package/lib/Well.js +30 -41
- package/lib/index.js +147 -214
- package/lib/utils/PropTypes.js +24 -31
- package/lib/utils/StyleConfig.js +13 -11
- package/lib/utils/ValidComponentChildren.js +34 -29
- package/lib/utils/bootstrapUtils.js +41 -52
- package/lib/utils/capitalize.js +2 -0
- package/lib/utils/createChainedFunction.js +8 -5
- package/lib/utils/deprecationWarning.js +37 -47
- package/lib/utils/index.js +11 -15
- package/lib/utils/splitComponentProps.js +5 -10
- package/package.json +58 -50
package/es/TabPane.js
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
import _extends from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import _inherits from 'babel-runtime/helpers/inherits';
|
|
1
|
+
import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
|
4
|
+
import _assertThisInitialized from "@babel/runtime-corejs2/helpers/esm/assertThisInitialized";
|
|
6
5
|
import classNames from 'classnames';
|
|
7
6
|
import React from 'react';
|
|
8
7
|
import PropTypes from 'prop-types';
|
|
9
8
|
import elementType from 'prop-types-extra/lib/elementType';
|
|
10
9
|
import warning from 'warning';
|
|
11
|
-
|
|
12
10
|
import { bsClass, getClassSet, prefix, splitBsPropsAndOmit } from './utils/bootstrapUtils';
|
|
13
11
|
import createChainedFunction from './utils/createChainedFunction';
|
|
14
|
-
|
|
15
12
|
import Fade from './Fade';
|
|
16
|
-
|
|
17
13
|
var propTypes = {
|
|
18
14
|
/**
|
|
19
15
|
* Uniquely identify the `<TabPane>` among its siblings.
|
|
@@ -80,7 +76,6 @@ var propTypes = {
|
|
|
80
76
|
*/
|
|
81
77
|
unmountOnExit: PropTypes.bool
|
|
82
78
|
};
|
|
83
|
-
|
|
84
79
|
var contextTypes = {
|
|
85
80
|
$bs_tabContainer: PropTypes.shape({
|
|
86
81
|
getTabId: PropTypes.func,
|
|
@@ -97,44 +92,46 @@ var contextTypes = {
|
|
|
97
92
|
exiting: PropTypes.bool.isRequired
|
|
98
93
|
})
|
|
99
94
|
};
|
|
100
|
-
|
|
101
95
|
/**
|
|
102
96
|
* We override the `<TabContainer>` context so `<Nav>`s in `<TabPane>`s don't
|
|
103
97
|
* conflict with the top level one.
|
|
104
98
|
*/
|
|
99
|
+
|
|
105
100
|
var childContextTypes = {
|
|
106
101
|
$bs_tabContainer: PropTypes.oneOf([null])
|
|
107
102
|
};
|
|
108
103
|
|
|
109
|
-
var TabPane =
|
|
110
|
-
|
|
104
|
+
var TabPane =
|
|
105
|
+
/*#__PURE__*/
|
|
106
|
+
function (_React$Component) {
|
|
107
|
+
_inheritsLoose(TabPane, _React$Component);
|
|
111
108
|
|
|
112
109
|
function TabPane(props, context) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
|
|
116
|
-
|
|
117
|
-
_this.handleEnter = _this.handleEnter.bind(_this);
|
|
118
|
-
_this.handleExited = _this.handleExited.bind(_this);
|
|
110
|
+
var _this;
|
|
119
111
|
|
|
112
|
+
_this = _React$Component.call(this, props, context) || this;
|
|
113
|
+
_this.handleEnter = _this.handleEnter.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
114
|
+
_this.handleExited = _this.handleExited.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
120
115
|
_this.in = false;
|
|
121
116
|
return _this;
|
|
122
117
|
}
|
|
123
118
|
|
|
124
|
-
TabPane.prototype
|
|
119
|
+
var _proto = TabPane.prototype;
|
|
120
|
+
|
|
121
|
+
_proto.getChildContext = function getChildContext() {
|
|
125
122
|
return {
|
|
126
123
|
$bs_tabContainer: null
|
|
127
124
|
};
|
|
128
125
|
};
|
|
129
126
|
|
|
130
|
-
|
|
127
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
131
128
|
if (this.shouldBeIn()) {
|
|
132
129
|
// In lieu of the action event firing.
|
|
133
130
|
this.handleEnter();
|
|
134
131
|
}
|
|
135
132
|
};
|
|
136
133
|
|
|
137
|
-
|
|
134
|
+
_proto.componentDidUpdate = function componentDidUpdate() {
|
|
138
135
|
if (this.in) {
|
|
139
136
|
if (!this.shouldBeIn()) {
|
|
140
137
|
// We shouldn't be active any more. Notify the parent.
|
|
@@ -146,14 +143,14 @@ var TabPane = function (_React$Component) {
|
|
|
146
143
|
}
|
|
147
144
|
};
|
|
148
145
|
|
|
149
|
-
|
|
146
|
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
150
147
|
if (this.in) {
|
|
151
148
|
// In lieu of the action event firing.
|
|
152
149
|
this.handleExited();
|
|
153
150
|
}
|
|
154
151
|
};
|
|
155
152
|
|
|
156
|
-
|
|
153
|
+
_proto.getAnimation = function getAnimation() {
|
|
157
154
|
if (this.props.animation != null) {
|
|
158
155
|
return this.props.animation;
|
|
159
156
|
}
|
|
@@ -162,8 +159,9 @@ var TabPane = function (_React$Component) {
|
|
|
162
159
|
return tabContent && tabContent.animation;
|
|
163
160
|
};
|
|
164
161
|
|
|
165
|
-
|
|
162
|
+
_proto.handleEnter = function handleEnter() {
|
|
166
163
|
var tabContent = this.context.$bs_tabContent;
|
|
164
|
+
|
|
167
165
|
if (!tabContent) {
|
|
168
166
|
return;
|
|
169
167
|
}
|
|
@@ -171,8 +169,9 @@ var TabPane = function (_React$Component) {
|
|
|
171
169
|
this.in = tabContent.onPaneEnter(this, this.props.eventKey);
|
|
172
170
|
};
|
|
173
171
|
|
|
174
|
-
|
|
172
|
+
_proto.handleExited = function handleExited() {
|
|
175
173
|
var tabContent = this.context.$bs_tabContent;
|
|
174
|
+
|
|
176
175
|
if (!tabContent) {
|
|
177
176
|
return;
|
|
178
177
|
}
|
|
@@ -181,34 +180,33 @@ var TabPane = function (_React$Component) {
|
|
|
181
180
|
this.in = false;
|
|
182
181
|
};
|
|
183
182
|
|
|
184
|
-
|
|
183
|
+
_proto.isActive = function isActive() {
|
|
185
184
|
var tabContent = this.context.$bs_tabContent;
|
|
186
185
|
var activeKey = tabContent && tabContent.activeKey;
|
|
187
|
-
|
|
188
186
|
return this.props.eventKey === activeKey;
|
|
189
187
|
};
|
|
190
188
|
|
|
191
|
-
|
|
189
|
+
_proto.shouldBeIn = function shouldBeIn() {
|
|
192
190
|
return this.getAnimation() && this.isActive();
|
|
193
191
|
};
|
|
194
192
|
|
|
195
|
-
|
|
196
|
-
var
|
|
197
|
-
eventKey =
|
|
198
|
-
className =
|
|
199
|
-
onEnter =
|
|
200
|
-
onEntering =
|
|
201
|
-
onEntered =
|
|
202
|
-
onExit =
|
|
203
|
-
onExiting =
|
|
204
|
-
onExited =
|
|
205
|
-
propsMountOnEnter =
|
|
206
|
-
propsUnmountOnExit =
|
|
207
|
-
props =
|
|
208
|
-
|
|
209
|
-
var
|
|
210
|
-
tabContent =
|
|
211
|
-
tabContainer =
|
|
193
|
+
_proto.render = function render() {
|
|
194
|
+
var _this$props = this.props,
|
|
195
|
+
eventKey = _this$props.eventKey,
|
|
196
|
+
className = _this$props.className,
|
|
197
|
+
onEnter = _this$props.onEnter,
|
|
198
|
+
onEntering = _this$props.onEntering,
|
|
199
|
+
onEntered = _this$props.onEntered,
|
|
200
|
+
onExit = _this$props.onExit,
|
|
201
|
+
onExiting = _this$props.onExiting,
|
|
202
|
+
onExited = _this$props.onExited,
|
|
203
|
+
propsMountOnEnter = _this$props.mountOnEnter,
|
|
204
|
+
propsUnmountOnExit = _this$props.unmountOnExit,
|
|
205
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["eventKey", "className", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "mountOnEnter", "unmountOnExit"]);
|
|
206
|
+
|
|
207
|
+
var _this$context = this.context,
|
|
208
|
+
tabContent = _this$context.$bs_tabContent,
|
|
209
|
+
tabContainer = _this$context.$bs_tabContainer;
|
|
212
210
|
|
|
213
211
|
var _splitBsPropsAndOmit = splitBsPropsAndOmit(props, ['animation']),
|
|
214
212
|
bsProps = _splitBsPropsAndOmit[0],
|
|
@@ -216,7 +214,6 @@ var TabPane = function (_React$Component) {
|
|
|
216
214
|
|
|
217
215
|
var active = this.isActive();
|
|
218
216
|
var animation = this.getAnimation();
|
|
219
|
-
|
|
220
217
|
var mountOnEnter = propsMountOnEnter != null ? propsMountOnEnter : tabContent && tabContent.mountOnEnter;
|
|
221
218
|
var unmountOnExit = propsUnmountOnExit != null ? propsUnmountOnExit : tabContent && tabContent.unmountOnExit;
|
|
222
219
|
|
|
@@ -235,36 +232,30 @@ var TabPane = function (_React$Component) {
|
|
|
235
232
|
});
|
|
236
233
|
|
|
237
234
|
if (tabContainer) {
|
|
238
|
-
process.env.NODE_ENV !==
|
|
239
|
-
|
|
235
|
+
process.env.NODE_ENV !== "production" ? warning(!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;
|
|
240
236
|
elementProps.id = tabContainer.getPaneId(eventKey);
|
|
241
237
|
elementProps['aria-labelledby'] = tabContainer.getTabId(eventKey);
|
|
242
238
|
}
|
|
243
239
|
|
|
244
|
-
var pane = React.createElement(
|
|
245
|
-
role:
|
|
246
|
-
|
|
240
|
+
var pane = React.createElement("div", _extends({}, elementProps, {
|
|
241
|
+
role: "tabpanel",
|
|
242
|
+
"aria-hidden": !active,
|
|
247
243
|
className: classNames(className, classes)
|
|
248
244
|
}));
|
|
249
245
|
|
|
250
246
|
if (Transition) {
|
|
251
247
|
var exiting = tabContent && tabContent.exiting;
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
mountOnEnter: mountOnEnter,
|
|
264
|
-
unmountOnExit: unmountOnExit
|
|
265
|
-
},
|
|
266
|
-
pane
|
|
267
|
-
);
|
|
248
|
+
return React.createElement(Transition, {
|
|
249
|
+
in: active && !exiting,
|
|
250
|
+
onEnter: createChainedFunction(this.handleEnter, onEnter),
|
|
251
|
+
onEntering: onEntering,
|
|
252
|
+
onEntered: onEntered,
|
|
253
|
+
onExit: onExit,
|
|
254
|
+
onExiting: onExiting,
|
|
255
|
+
onExited: createChainedFunction(this.handleExited, onExited),
|
|
256
|
+
mountOnEnter: mountOnEnter,
|
|
257
|
+
unmountOnExit: unmountOnExit
|
|
258
|
+
}, pane);
|
|
268
259
|
}
|
|
269
260
|
|
|
270
261
|
return pane;
|
|
@@ -276,5 +267,4 @@ var TabPane = function (_React$Component) {
|
|
|
276
267
|
TabPane.propTypes = propTypes;
|
|
277
268
|
TabPane.contextTypes = contextTypes;
|
|
278
269
|
TabPane.childContextTypes = childContextTypes;
|
|
279
|
-
|
|
280
270
|
export default bsClass('tab-pane', TabPane);
|
package/es/Table.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import _extends from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
5
|
-
import _inherits from 'babel-runtime/helpers/inherits';
|
|
1
|
+
import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
|
6
4
|
import classNames from 'classnames';
|
|
7
5
|
import React from 'react';
|
|
8
6
|
import PropTypes from 'prop-types';
|
|
9
|
-
|
|
10
7
|
import { bsClass, getClassSet, prefix, splitBsProps } from './utils/bootstrapUtils';
|
|
11
|
-
|
|
12
8
|
var propTypes = {
|
|
13
9
|
striped: PropTypes.bool,
|
|
14
10
|
bordered: PropTypes.bool,
|
|
@@ -16,7 +12,6 @@ var propTypes = {
|
|
|
16
12
|
hover: PropTypes.bool,
|
|
17
13
|
responsive: PropTypes.bool
|
|
18
14
|
};
|
|
19
|
-
|
|
20
15
|
var defaultProps = {
|
|
21
16
|
bordered: false,
|
|
22
17
|
condensed: false,
|
|
@@ -25,26 +20,28 @@ var defaultProps = {
|
|
|
25
20
|
striped: false
|
|
26
21
|
};
|
|
27
22
|
|
|
28
|
-
var Table =
|
|
29
|
-
|
|
23
|
+
var Table =
|
|
24
|
+
/*#__PURE__*/
|
|
25
|
+
function (_React$Component) {
|
|
26
|
+
_inheritsLoose(Table, _React$Component);
|
|
30
27
|
|
|
31
28
|
function Table() {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
29
|
+
return _React$Component.apply(this, arguments) || this;
|
|
35
30
|
}
|
|
36
31
|
|
|
37
|
-
Table.prototype
|
|
32
|
+
var _proto = Table.prototype;
|
|
33
|
+
|
|
34
|
+
_proto.render = function render() {
|
|
38
35
|
var _extends2;
|
|
39
36
|
|
|
40
|
-
var
|
|
41
|
-
striped =
|
|
42
|
-
bordered =
|
|
43
|
-
condensed =
|
|
44
|
-
hover =
|
|
45
|
-
responsive =
|
|
46
|
-
className =
|
|
47
|
-
props =
|
|
37
|
+
var _this$props = this.props,
|
|
38
|
+
striped = _this$props.striped,
|
|
39
|
+
bordered = _this$props.bordered,
|
|
40
|
+
condensed = _this$props.condensed,
|
|
41
|
+
hover = _this$props.hover,
|
|
42
|
+
responsive = _this$props.responsive,
|
|
43
|
+
className = _this$props.className,
|
|
44
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["striped", "bordered", "condensed", "hover", "responsive", "className"]);
|
|
48
45
|
|
|
49
46
|
var _splitBsProps = splitBsProps(props),
|
|
50
47
|
bsProps = _splitBsProps[0],
|
|
@@ -52,14 +49,14 @@ var Table = function (_React$Component) {
|
|
|
52
49
|
|
|
53
50
|
var classes = _extends({}, getClassSet(bsProps), (_extends2 = {}, _extends2[prefix(bsProps, 'striped')] = striped, _extends2[prefix(bsProps, 'bordered')] = bordered, _extends2[prefix(bsProps, 'condensed')] = condensed, _extends2[prefix(bsProps, 'hover')] = hover, _extends2));
|
|
54
51
|
|
|
55
|
-
var table = React.createElement(
|
|
52
|
+
var table = React.createElement("table", _extends({}, elementProps, {
|
|
53
|
+
className: classNames(className, classes)
|
|
54
|
+
}));
|
|
56
55
|
|
|
57
56
|
if (responsive) {
|
|
58
|
-
return React.createElement(
|
|
59
|
-
'
|
|
60
|
-
|
|
61
|
-
table
|
|
62
|
-
);
|
|
57
|
+
return React.createElement("div", {
|
|
58
|
+
className: prefix(bsProps, 'responsive')
|
|
59
|
+
}, table);
|
|
63
60
|
}
|
|
64
61
|
|
|
65
62
|
return table;
|
|
@@ -70,5 +67,4 @@ var Table = function (_React$Component) {
|
|
|
70
67
|
|
|
71
68
|
Table.propTypes = propTypes;
|
|
72
69
|
Table.defaultProps = defaultProps;
|
|
73
|
-
|
|
74
70
|
export default bsClass('table', Table);
|
package/es/Tabs.js
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import _extends from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
5
|
-
import _inherits from 'babel-runtime/helpers/inherits';
|
|
1
|
+
import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
|
6
4
|
import React from 'react';
|
|
7
5
|
import PropTypes from 'prop-types';
|
|
8
6
|
import requiredForA11y from 'prop-types-extra/lib/isRequiredForA11y';
|
|
9
7
|
import uncontrollable from 'uncontrollable';
|
|
10
|
-
|
|
8
|
+
import elementType from 'prop-types-extra/lib/elementType';
|
|
11
9
|
import Nav from './Nav';
|
|
12
10
|
import NavItem from './NavItem';
|
|
13
11
|
import UncontrolledTabContainer from './TabContainer';
|
|
14
12
|
import TabContent from './TabContent';
|
|
15
13
|
import { bsClass as setBsClass } from './utils/bootstrapUtils';
|
|
16
14
|
import ValidComponentChildren from './utils/ValidComponentChildren';
|
|
17
|
-
|
|
18
15
|
var TabContainer = UncontrolledTabContainer.ControlledComponent;
|
|
19
|
-
|
|
20
16
|
var propTypes = {
|
|
21
17
|
/**
|
|
22
18
|
* Mark the Tab with a matching `eventKey` as active.
|
|
@@ -30,8 +26,12 @@ var propTypes = {
|
|
|
30
26
|
*/
|
|
31
27
|
bsStyle: PropTypes.oneOf(['tabs', 'pills']),
|
|
32
28
|
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Sets a default animation strategy. Use `false` to disable, `true`
|
|
31
|
+
* to enable the default `<Fade>` animation, or a react-transition-group
|
|
32
|
+
* v2 `<Transition/>` component.
|
|
33
|
+
*/
|
|
34
|
+
animation: PropTypes.oneOfType([PropTypes.bool, elementType]),
|
|
35
35
|
id: requiredForA11y(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
|
|
36
36
|
|
|
37
37
|
/**
|
|
@@ -58,7 +58,6 @@ var propTypes = {
|
|
|
58
58
|
*/
|
|
59
59
|
unmountOnExit: PropTypes.bool
|
|
60
60
|
};
|
|
61
|
-
|
|
62
61
|
var defaultProps = {
|
|
63
62
|
bsStyle: 'tabs',
|
|
64
63
|
animation: true,
|
|
@@ -67,26 +66,27 @@ var defaultProps = {
|
|
|
67
66
|
};
|
|
68
67
|
|
|
69
68
|
function getDefaultActiveKey(children) {
|
|
70
|
-
var defaultActiveKey
|
|
69
|
+
var defaultActiveKey;
|
|
71
70
|
ValidComponentChildren.forEach(children, function (child) {
|
|
72
71
|
if (defaultActiveKey == null) {
|
|
73
72
|
defaultActiveKey = child.props.eventKey;
|
|
74
73
|
}
|
|
75
74
|
});
|
|
76
|
-
|
|
77
75
|
return defaultActiveKey;
|
|
78
76
|
}
|
|
79
77
|
|
|
80
|
-
var Tabs =
|
|
81
|
-
|
|
78
|
+
var Tabs =
|
|
79
|
+
/*#__PURE__*/
|
|
80
|
+
function (_React$Component) {
|
|
81
|
+
_inheritsLoose(Tabs, _React$Component);
|
|
82
82
|
|
|
83
83
|
function Tabs() {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
84
|
+
return _React$Component.apply(this, arguments) || this;
|
|
87
85
|
}
|
|
88
86
|
|
|
89
|
-
Tabs.prototype
|
|
87
|
+
var _proto = Tabs.prototype;
|
|
88
|
+
|
|
89
|
+
_proto.renderTab = function renderTab(child) {
|
|
90
90
|
var _child$props = child.props,
|
|
91
91
|
title = _child$props.title,
|
|
92
92
|
eventKey = _child$props.eventKey,
|
|
@@ -97,57 +97,42 @@ var Tabs = function (_React$Component) {
|
|
|
97
97
|
return null;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
return React.createElement(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
);
|
|
100
|
+
return React.createElement(NavItem, {
|
|
101
|
+
eventKey: eventKey,
|
|
102
|
+
disabled: disabled,
|
|
103
|
+
className: tabClassName
|
|
104
|
+
}, title);
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
var
|
|
109
|
-
id =
|
|
110
|
-
onSelect =
|
|
111
|
-
animation =
|
|
112
|
-
mountOnEnter =
|
|
113
|
-
unmountOnExit =
|
|
114
|
-
bsClass =
|
|
115
|
-
className =
|
|
116
|
-
style =
|
|
117
|
-
children =
|
|
118
|
-
|
|
119
|
-
activeKey =
|
|
120
|
-
props =
|
|
121
|
-
|
|
122
|
-
return React.createElement(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
_extends({}, props, { role: 'tablist' }),
|
|
137
|
-
ValidComponentChildren.map(children, this.renderTab)
|
|
138
|
-
),
|
|
139
|
-
React.createElement(
|
|
140
|
-
TabContent,
|
|
141
|
-
{
|
|
142
|
-
bsClass: bsClass,
|
|
143
|
-
animation: animation,
|
|
144
|
-
mountOnEnter: mountOnEnter,
|
|
145
|
-
unmountOnExit: unmountOnExit
|
|
146
|
-
},
|
|
147
|
-
children
|
|
148
|
-
)
|
|
149
|
-
)
|
|
150
|
-
);
|
|
107
|
+
_proto.render = function render() {
|
|
108
|
+
var _this$props = this.props,
|
|
109
|
+
id = _this$props.id,
|
|
110
|
+
onSelect = _this$props.onSelect,
|
|
111
|
+
animation = _this$props.animation,
|
|
112
|
+
mountOnEnter = _this$props.mountOnEnter,
|
|
113
|
+
unmountOnExit = _this$props.unmountOnExit,
|
|
114
|
+
bsClass = _this$props.bsClass,
|
|
115
|
+
className = _this$props.className,
|
|
116
|
+
style = _this$props.style,
|
|
117
|
+
children = _this$props.children,
|
|
118
|
+
_this$props$activeKey = _this$props.activeKey,
|
|
119
|
+
activeKey = _this$props$activeKey === void 0 ? getDefaultActiveKey(children) : _this$props$activeKey,
|
|
120
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["id", "onSelect", "animation", "mountOnEnter", "unmountOnExit", "bsClass", "className", "style", "children", "activeKey"]);
|
|
121
|
+
|
|
122
|
+
return React.createElement(TabContainer, {
|
|
123
|
+
id: id,
|
|
124
|
+
activeKey: activeKey,
|
|
125
|
+
onSelect: onSelect,
|
|
126
|
+
className: className,
|
|
127
|
+
style: style
|
|
128
|
+
}, React.createElement("div", null, React.createElement(Nav, _extends({}, props, {
|
|
129
|
+
role: "tablist"
|
|
130
|
+
}), ValidComponentChildren.map(children, this.renderTab)), React.createElement(TabContent, {
|
|
131
|
+
bsClass: bsClass,
|
|
132
|
+
animation: animation,
|
|
133
|
+
mountOnEnter: mountOnEnter,
|
|
134
|
+
unmountOnExit: unmountOnExit
|
|
135
|
+
}, children)));
|
|
151
136
|
};
|
|
152
137
|
|
|
153
138
|
return Tabs;
|
|
@@ -155,7 +140,7 @@ var Tabs = function (_React$Component) {
|
|
|
155
140
|
|
|
156
141
|
Tabs.propTypes = propTypes;
|
|
157
142
|
Tabs.defaultProps = defaultProps;
|
|
158
|
-
|
|
159
143
|
setBsClass('tab', Tabs);
|
|
160
|
-
|
|
161
|
-
|
|
144
|
+
export default uncontrollable(Tabs, {
|
|
145
|
+
activeKey: 'onSelect'
|
|
146
|
+
});
|
package/es/Thumbnail.js
CHANGED
|
@@ -1,58 +1,60 @@
|
|
|
1
|
-
import _extends from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
5
|
-
import _inherits from 'babel-runtime/helpers/inherits';
|
|
6
|
-
/* eslint-disable jsx-a11y/alt-text */
|
|
1
|
+
import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
|
7
4
|
|
|
5
|
+
/* eslint-disable jsx-a11y/alt-text */
|
|
8
6
|
import classNames from 'classnames';
|
|
9
7
|
import React from 'react';
|
|
10
8
|
import PropTypes from 'prop-types';
|
|
11
|
-
|
|
12
9
|
import SafeAnchor from './SafeAnchor';
|
|
13
10
|
import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
|
|
14
|
-
|
|
15
11
|
var propTypes = {
|
|
16
12
|
/**
|
|
17
13
|
* src property that is passed down to the image inside this component
|
|
18
14
|
*/
|
|
19
15
|
src: PropTypes.string,
|
|
16
|
+
|
|
20
17
|
/**
|
|
21
18
|
* alt property that is passed down to the image inside this component
|
|
22
19
|
*/
|
|
23
20
|
alt: PropTypes.string,
|
|
21
|
+
|
|
24
22
|
/**
|
|
25
23
|
* href property that is passed down to the image inside this component
|
|
26
24
|
*/
|
|
27
25
|
href: PropTypes.string,
|
|
26
|
+
|
|
28
27
|
/**
|
|
29
28
|
* onError callback that is passed down to the image inside this component
|
|
30
29
|
*/
|
|
31
30
|
onError: PropTypes.func,
|
|
31
|
+
|
|
32
32
|
/**
|
|
33
33
|
* onLoad callback that is passed down to the image inside this component
|
|
34
34
|
*/
|
|
35
35
|
onLoad: PropTypes.func
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
var Thumbnail =
|
|
39
|
-
|
|
38
|
+
var Thumbnail =
|
|
39
|
+
/*#__PURE__*/
|
|
40
|
+
function (_React$Component) {
|
|
41
|
+
_inheritsLoose(Thumbnail, _React$Component);
|
|
40
42
|
|
|
41
43
|
function Thumbnail() {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
44
|
+
return _React$Component.apply(this, arguments) || this;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
Thumbnail.prototype
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
var _proto = Thumbnail.prototype;
|
|
48
|
+
|
|
49
|
+
_proto.render = function render() {
|
|
50
|
+
var _this$props = this.props,
|
|
51
|
+
src = _this$props.src,
|
|
52
|
+
alt = _this$props.alt,
|
|
53
|
+
onError = _this$props.onError,
|
|
54
|
+
onLoad = _this$props.onLoad,
|
|
55
|
+
className = _this$props.className,
|
|
56
|
+
children = _this$props.children,
|
|
57
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["src", "alt", "onError", "onLoad", "className", "children"]);
|
|
56
58
|
|
|
57
59
|
var _splitBsProps = splitBsProps(props),
|
|
58
60
|
bsProps = _splitBsProps[0],
|
|
@@ -60,22 +62,20 @@ var Thumbnail = function (_React$Component) {
|
|
|
60
62
|
|
|
61
63
|
var Component = elementProps.href ? SafeAnchor : 'div';
|
|
62
64
|
var classes = getClassSet(bsProps);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
);
|
|
65
|
+
return React.createElement(Component, _extends({}, elementProps, {
|
|
66
|
+
className: classNames(className, classes)
|
|
67
|
+
}), React.createElement("img", {
|
|
68
|
+
src: src,
|
|
69
|
+
alt: alt,
|
|
70
|
+
onError: onError,
|
|
71
|
+
onLoad: onLoad
|
|
72
|
+
}), children && React.createElement("div", {
|
|
73
|
+
className: "caption"
|
|
74
|
+
}, children));
|
|
74
75
|
};
|
|
75
76
|
|
|
76
77
|
return Thumbnail;
|
|
77
78
|
}(React.Component);
|
|
78
79
|
|
|
79
80
|
Thumbnail.propTypes = propTypes;
|
|
80
|
-
|
|
81
81
|
export default bsClass('thumbnail', Thumbnail);
|