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/lib/Tabs.js
CHANGED
|
@@ -1,85 +1,59 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _extends2 = require('babel-runtime/helpers/extends');
|
|
6
|
-
|
|
7
|
-
var _extends3 = _interopRequireDefault(_extends2);
|
|
8
|
-
|
|
9
|
-
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
|
|
10
|
-
|
|
11
|
-
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
|
|
12
|
-
|
|
13
|
-
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
|
14
|
-
|
|
15
|
-
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
16
|
-
|
|
17
|
-
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
|
18
|
-
|
|
19
|
-
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
20
|
-
|
|
21
|
-
var _inherits2 = require('babel-runtime/helpers/inherits');
|
|
22
|
-
|
|
23
|
-
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
24
|
-
|
|
25
|
-
var _react = require('react');
|
|
26
|
-
|
|
27
|
-
var _react2 = _interopRequireDefault(_react);
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
28
4
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
32
|
-
|
|
33
|
-
var _isRequiredForA11y = require('prop-types-extra/lib/isRequiredForA11y');
|
|
34
|
-
|
|
35
|
-
var _isRequiredForA11y2 = _interopRequireDefault(_isRequiredForA11y);
|
|
36
|
-
|
|
37
|
-
var _uncontrollable = require('uncontrollable');
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.default = void 0;
|
|
38
7
|
|
|
39
|
-
var
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/extends"));
|
|
40
9
|
|
|
41
|
-
var
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/objectWithoutPropertiesLoose"));
|
|
42
11
|
|
|
43
|
-
var
|
|
12
|
+
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inheritsLoose"));
|
|
44
13
|
|
|
45
|
-
var
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
46
15
|
|
|
47
|
-
var
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
48
17
|
|
|
49
|
-
var
|
|
18
|
+
var _isRequiredForA11y = _interopRequireDefault(require("prop-types-extra/lib/isRequiredForA11y"));
|
|
50
19
|
|
|
51
|
-
var
|
|
20
|
+
var _uncontrollable = _interopRequireDefault(require("uncontrollable"));
|
|
52
21
|
|
|
53
|
-
var
|
|
22
|
+
var _elementType = _interopRequireDefault(require("prop-types-extra/lib/elementType"));
|
|
54
23
|
|
|
55
|
-
var
|
|
24
|
+
var _Nav = _interopRequireDefault(require("./Nav"));
|
|
56
25
|
|
|
57
|
-
var
|
|
26
|
+
var _NavItem = _interopRequireDefault(require("./NavItem"));
|
|
58
27
|
|
|
59
|
-
var
|
|
28
|
+
var _TabContainer = _interopRequireDefault(require("./TabContainer"));
|
|
60
29
|
|
|
61
|
-
var
|
|
30
|
+
var _TabContent = _interopRequireDefault(require("./TabContent"));
|
|
62
31
|
|
|
63
|
-
|
|
32
|
+
var _bootstrapUtils = require("./utils/bootstrapUtils");
|
|
64
33
|
|
|
65
|
-
var
|
|
34
|
+
var _ValidComponentChildren = _interopRequireDefault(require("./utils/ValidComponentChildren"));
|
|
66
35
|
|
|
36
|
+
var TabContainer = _TabContainer.default.ControlledComponent;
|
|
67
37
|
var propTypes = {
|
|
68
38
|
/**
|
|
69
39
|
* Mark the Tab with a matching `eventKey` as active.
|
|
70
40
|
*
|
|
71
41
|
* @controllable onSelect
|
|
72
42
|
*/
|
|
73
|
-
activeKey:
|
|
43
|
+
activeKey: _propTypes.default.any,
|
|
74
44
|
|
|
75
45
|
/**
|
|
76
46
|
* Navigation style
|
|
77
47
|
*/
|
|
78
|
-
bsStyle:
|
|
79
|
-
|
|
80
|
-
animation: _propTypes2.default.bool,
|
|
48
|
+
bsStyle: _propTypes.default.oneOf(['tabs', 'pills']),
|
|
81
49
|
|
|
82
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Sets a default animation strategy. Use `false` to disable, `true`
|
|
52
|
+
* to enable the default `<Fade>` animation, or a react-transition-group
|
|
53
|
+
* v2 `<Transition/>` component.
|
|
54
|
+
*/
|
|
55
|
+
animation: _propTypes.default.oneOfType([_propTypes.default.bool, _elementType.default]),
|
|
56
|
+
id: (0, _isRequiredForA11y.default)(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])),
|
|
83
57
|
|
|
84
58
|
/**
|
|
85
59
|
* Callback fired when a Tab is selected.
|
|
@@ -93,19 +67,18 @@ var propTypes = {
|
|
|
93
67
|
*
|
|
94
68
|
* @controllable activeKey
|
|
95
69
|
*/
|
|
96
|
-
onSelect:
|
|
70
|
+
onSelect: _propTypes.default.func,
|
|
97
71
|
|
|
98
72
|
/**
|
|
99
73
|
* Wait until the first "enter" transition to mount tabs (add them to the DOM)
|
|
100
74
|
*/
|
|
101
|
-
mountOnEnter:
|
|
75
|
+
mountOnEnter: _propTypes.default.bool,
|
|
102
76
|
|
|
103
77
|
/**
|
|
104
78
|
* Unmount tabs (remove it from the DOM) when it is no longer visible
|
|
105
79
|
*/
|
|
106
|
-
unmountOnExit:
|
|
80
|
+
unmountOnExit: _propTypes.default.bool
|
|
107
81
|
};
|
|
108
|
-
|
|
109
82
|
var defaultProps = {
|
|
110
83
|
bsStyle: 'tabs',
|
|
111
84
|
animation: true,
|
|
@@ -114,8 +87,9 @@ var defaultProps = {
|
|
|
114
87
|
};
|
|
115
88
|
|
|
116
89
|
function getDefaultActiveKey(children) {
|
|
117
|
-
var defaultActiveKey
|
|
118
|
-
|
|
90
|
+
var defaultActiveKey;
|
|
91
|
+
|
|
92
|
+
_ValidComponentChildren.default.forEach(children, function (child) {
|
|
119
93
|
if (defaultActiveKey == null) {
|
|
120
94
|
defaultActiveKey = child.props.eventKey;
|
|
121
95
|
}
|
|
@@ -124,15 +98,18 @@ function getDefaultActiveKey(children) {
|
|
|
124
98
|
return defaultActiveKey;
|
|
125
99
|
}
|
|
126
100
|
|
|
127
|
-
var Tabs =
|
|
128
|
-
|
|
101
|
+
var Tabs =
|
|
102
|
+
/*#__PURE__*/
|
|
103
|
+
function (_React$Component) {
|
|
104
|
+
(0, _inheritsLoose2.default)(Tabs, _React$Component);
|
|
129
105
|
|
|
130
106
|
function Tabs() {
|
|
131
|
-
|
|
132
|
-
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
107
|
+
return _React$Component.apply(this, arguments) || this;
|
|
133
108
|
}
|
|
134
109
|
|
|
135
|
-
Tabs.prototype
|
|
110
|
+
var _proto = Tabs.prototype;
|
|
111
|
+
|
|
112
|
+
_proto.renderTab = function renderTab(child) {
|
|
136
113
|
var _child$props = child.props,
|
|
137
114
|
title = _child$props.title,
|
|
138
115
|
eventKey = _child$props.eventKey,
|
|
@@ -143,67 +120,53 @@ var Tabs = function (_React$Component) {
|
|
|
143
120
|
return null;
|
|
144
121
|
}
|
|
145
122
|
|
|
146
|
-
return
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
);
|
|
123
|
+
return _react.default.createElement(_NavItem.default, {
|
|
124
|
+
eventKey: eventKey,
|
|
125
|
+
disabled: disabled,
|
|
126
|
+
className: tabClassName
|
|
127
|
+
}, title);
|
|
151
128
|
};
|
|
152
129
|
|
|
153
|
-
|
|
154
|
-
var
|
|
155
|
-
id =
|
|
156
|
-
onSelect =
|
|
157
|
-
animation =
|
|
158
|
-
mountOnEnter =
|
|
159
|
-
unmountOnExit =
|
|
160
|
-
bsClass =
|
|
161
|
-
className =
|
|
162
|
-
style =
|
|
163
|
-
children =
|
|
164
|
-
|
|
165
|
-
activeKey =
|
|
166
|
-
props = (0,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
_react2.default.createElement(
|
|
182
|
-
_Nav2.default,
|
|
183
|
-
(0, _extends3.default)({}, props, { role: 'tablist' }),
|
|
184
|
-
_ValidComponentChildren2.default.map(children, this.renderTab)
|
|
185
|
-
),
|
|
186
|
-
_react2.default.createElement(
|
|
187
|
-
_TabContent2.default,
|
|
188
|
-
{
|
|
189
|
-
bsClass: bsClass,
|
|
190
|
-
animation: animation,
|
|
191
|
-
mountOnEnter: mountOnEnter,
|
|
192
|
-
unmountOnExit: unmountOnExit
|
|
193
|
-
},
|
|
194
|
-
children
|
|
195
|
-
)
|
|
196
|
-
)
|
|
197
|
-
);
|
|
130
|
+
_proto.render = function render() {
|
|
131
|
+
var _this$props = this.props,
|
|
132
|
+
id = _this$props.id,
|
|
133
|
+
onSelect = _this$props.onSelect,
|
|
134
|
+
animation = _this$props.animation,
|
|
135
|
+
mountOnEnter = _this$props.mountOnEnter,
|
|
136
|
+
unmountOnExit = _this$props.unmountOnExit,
|
|
137
|
+
bsClass = _this$props.bsClass,
|
|
138
|
+
className = _this$props.className,
|
|
139
|
+
style = _this$props.style,
|
|
140
|
+
children = _this$props.children,
|
|
141
|
+
_this$props$activeKey = _this$props.activeKey,
|
|
142
|
+
activeKey = _this$props$activeKey === void 0 ? getDefaultActiveKey(children) : _this$props$activeKey,
|
|
143
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_this$props, ["id", "onSelect", "animation", "mountOnEnter", "unmountOnExit", "bsClass", "className", "style", "children", "activeKey"]);
|
|
144
|
+
return _react.default.createElement(TabContainer, {
|
|
145
|
+
id: id,
|
|
146
|
+
activeKey: activeKey,
|
|
147
|
+
onSelect: onSelect,
|
|
148
|
+
className: className,
|
|
149
|
+
style: style
|
|
150
|
+
}, _react.default.createElement("div", null, _react.default.createElement(_Nav.default, (0, _extends2.default)({}, props, {
|
|
151
|
+
role: "tablist"
|
|
152
|
+
}), _ValidComponentChildren.default.map(children, this.renderTab)), _react.default.createElement(_TabContent.default, {
|
|
153
|
+
bsClass: bsClass,
|
|
154
|
+
animation: animation,
|
|
155
|
+
mountOnEnter: mountOnEnter,
|
|
156
|
+
unmountOnExit: unmountOnExit
|
|
157
|
+
}, children)));
|
|
198
158
|
};
|
|
199
159
|
|
|
200
160
|
return Tabs;
|
|
201
|
-
}(
|
|
161
|
+
}(_react.default.Component);
|
|
202
162
|
|
|
203
163
|
Tabs.propTypes = propTypes;
|
|
204
164
|
Tabs.defaultProps = defaultProps;
|
|
205
|
-
|
|
206
165
|
(0, _bootstrapUtils.bsClass)('tab', Tabs);
|
|
207
166
|
|
|
208
|
-
|
|
209
|
-
|
|
167
|
+
var _default = (0, _uncontrollable.default)(Tabs, {
|
|
168
|
+
activeKey: 'onSelect'
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
exports.default = _default;
|
|
172
|
+
module.exports = exports["default"];
|
package/lib/Thumbnail.js
CHANGED
|
@@ -1,111 +1,99 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _extends2 = require('babel-runtime/helpers/extends');
|
|
6
|
-
|
|
7
|
-
var _extends3 = _interopRequireDefault(_extends2);
|
|
8
|
-
|
|
9
|
-
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
|
|
10
|
-
|
|
11
|
-
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
|
|
12
|
-
|
|
13
|
-
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
|
14
|
-
|
|
15
|
-
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
16
|
-
|
|
17
|
-
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
|
18
|
-
|
|
19
|
-
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
20
|
-
|
|
21
|
-
var _inherits2 = require('babel-runtime/helpers/inherits');
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
22
4
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var _classnames = require('classnames');
|
|
26
|
-
|
|
27
|
-
var _classnames2 = _interopRequireDefault(_classnames);
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.default = void 0;
|
|
28
7
|
|
|
29
|
-
var
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/extends"));
|
|
30
9
|
|
|
31
|
-
var
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/objectWithoutPropertiesLoose"));
|
|
32
11
|
|
|
33
|
-
var
|
|
12
|
+
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inheritsLoose"));
|
|
34
13
|
|
|
35
|
-
var
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
36
15
|
|
|
37
|
-
var
|
|
16
|
+
var _react = _interopRequireDefault(require("react"));
|
|
38
17
|
|
|
39
|
-
var
|
|
18
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
40
19
|
|
|
41
|
-
var
|
|
20
|
+
var _SafeAnchor = _interopRequireDefault(require("./SafeAnchor"));
|
|
42
21
|
|
|
43
|
-
|
|
22
|
+
var _bootstrapUtils = require("./utils/bootstrapUtils");
|
|
44
23
|
|
|
24
|
+
/* eslint-disable jsx-a11y/alt-text */
|
|
45
25
|
var propTypes = {
|
|
46
26
|
/**
|
|
47
27
|
* src property that is passed down to the image inside this component
|
|
48
28
|
*/
|
|
49
|
-
src:
|
|
29
|
+
src: _propTypes.default.string,
|
|
30
|
+
|
|
50
31
|
/**
|
|
51
32
|
* alt property that is passed down to the image inside this component
|
|
52
33
|
*/
|
|
53
|
-
alt:
|
|
34
|
+
alt: _propTypes.default.string,
|
|
35
|
+
|
|
54
36
|
/**
|
|
55
37
|
* href property that is passed down to the image inside this component
|
|
56
38
|
*/
|
|
57
|
-
href:
|
|
39
|
+
href: _propTypes.default.string,
|
|
40
|
+
|
|
58
41
|
/**
|
|
59
42
|
* onError callback that is passed down to the image inside this component
|
|
60
43
|
*/
|
|
61
|
-
onError:
|
|
44
|
+
onError: _propTypes.default.func,
|
|
45
|
+
|
|
62
46
|
/**
|
|
63
47
|
* onLoad callback that is passed down to the image inside this component
|
|
64
48
|
*/
|
|
65
|
-
onLoad:
|
|
66
|
-
};
|
|
49
|
+
onLoad: _propTypes.default.func
|
|
50
|
+
};
|
|
67
51
|
|
|
68
|
-
var Thumbnail =
|
|
69
|
-
|
|
52
|
+
var Thumbnail =
|
|
53
|
+
/*#__PURE__*/
|
|
54
|
+
function (_React$Component) {
|
|
55
|
+
(0, _inheritsLoose2.default)(Thumbnail, _React$Component);
|
|
70
56
|
|
|
71
57
|
function Thumbnail() {
|
|
72
|
-
|
|
73
|
-
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
58
|
+
return _React$Component.apply(this, arguments) || this;
|
|
74
59
|
}
|
|
75
60
|
|
|
76
|
-
Thumbnail.prototype
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
61
|
+
var _proto = Thumbnail.prototype;
|
|
62
|
+
|
|
63
|
+
_proto.render = function render() {
|
|
64
|
+
var _this$props = this.props,
|
|
65
|
+
src = _this$props.src,
|
|
66
|
+
alt = _this$props.alt,
|
|
67
|
+
onError = _this$props.onError,
|
|
68
|
+
onLoad = _this$props.onLoad,
|
|
69
|
+
className = _this$props.className,
|
|
70
|
+
children = _this$props.children,
|
|
71
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_this$props, ["src", "alt", "onError", "onLoad", "className", "children"]);
|
|
85
72
|
|
|
86
73
|
var _splitBsProps = (0, _bootstrapUtils.splitBsProps)(props),
|
|
87
74
|
bsProps = _splitBsProps[0],
|
|
88
75
|
elementProps = _splitBsProps[1];
|
|
89
76
|
|
|
90
|
-
var Component = elementProps.href ?
|
|
77
|
+
var Component = elementProps.href ? _SafeAnchor.default : 'div';
|
|
91
78
|
var classes = (0, _bootstrapUtils.getClassSet)(bsProps);
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
);
|
|
79
|
+
return _react.default.createElement(Component, (0, _extends2.default)({}, elementProps, {
|
|
80
|
+
className: (0, _classnames.default)(className, classes)
|
|
81
|
+
}), _react.default.createElement("img", {
|
|
82
|
+
src: src,
|
|
83
|
+
alt: alt,
|
|
84
|
+
onError: onError,
|
|
85
|
+
onLoad: onLoad
|
|
86
|
+
}), children && _react.default.createElement("div", {
|
|
87
|
+
className: "caption"
|
|
88
|
+
}, children));
|
|
103
89
|
};
|
|
104
90
|
|
|
105
91
|
return Thumbnail;
|
|
106
|
-
}(
|
|
92
|
+
}(_react.default.Component);
|
|
107
93
|
|
|
108
94
|
Thumbnail.propTypes = propTypes;
|
|
109
95
|
|
|
110
|
-
|
|
111
|
-
|
|
96
|
+
var _default = (0, _bootstrapUtils.bsClass)('thumbnail', Thumbnail);
|
|
97
|
+
|
|
98
|
+
exports.default = _default;
|
|
99
|
+
module.exports = exports["default"];
|
package/lib/ToggleButton.js
CHANGED
|
@@ -1,114 +1,95 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _extends2 = require('babel-runtime/helpers/extends');
|
|
6
|
-
|
|
7
|
-
var _extends3 = _interopRequireDefault(_extends2);
|
|
8
|
-
|
|
9
|
-
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
|
|
10
|
-
|
|
11
|
-
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
|
|
12
|
-
|
|
13
|
-
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
|
14
|
-
|
|
15
|
-
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
16
|
-
|
|
17
|
-
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
18
4
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var _inherits2 = require('babel-runtime/helpers/inherits');
|
|
22
|
-
|
|
23
|
-
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
24
|
-
|
|
25
|
-
var _propTypes = require('prop-types');
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.default = void 0;
|
|
26
7
|
|
|
27
|
-
var
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/extends"));
|
|
28
9
|
|
|
29
|
-
var
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/objectWithoutPropertiesLoose"));
|
|
30
11
|
|
|
31
|
-
var
|
|
12
|
+
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inheritsLoose"));
|
|
32
13
|
|
|
33
|
-
var
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
34
15
|
|
|
35
|
-
var
|
|
16
|
+
var _react = _interopRequireDefault(require("react"));
|
|
36
17
|
|
|
37
|
-
|
|
18
|
+
var _Button = _interopRequireDefault(require("./Button"));
|
|
38
19
|
|
|
39
20
|
var propTypes = {
|
|
40
21
|
/**
|
|
41
22
|
* The `<input>` `type`
|
|
42
23
|
* @type {[type]}
|
|
43
24
|
*/
|
|
44
|
-
type:
|
|
25
|
+
type: _propTypes.default.oneOf(['checkbox', 'radio']),
|
|
45
26
|
|
|
46
27
|
/**
|
|
47
28
|
* The HTML input name, used to group like checkboxes or radio buttons together
|
|
48
29
|
* semantically
|
|
49
30
|
*/
|
|
50
|
-
name:
|
|
31
|
+
name: _propTypes.default.string,
|
|
51
32
|
|
|
52
33
|
/**
|
|
53
34
|
* The checked state of the input, managed by `<ToggleButtonGroup>`` automatically
|
|
54
35
|
*/
|
|
55
|
-
checked:
|
|
36
|
+
checked: _propTypes.default.bool,
|
|
56
37
|
|
|
57
38
|
/**
|
|
58
39
|
* The disabled state of both the label and input
|
|
59
40
|
*/
|
|
60
|
-
disabled:
|
|
41
|
+
disabled: _propTypes.default.bool,
|
|
61
42
|
|
|
62
43
|
/**
|
|
63
44
|
* [onChange description]
|
|
64
45
|
*/
|
|
65
|
-
onChange:
|
|
46
|
+
onChange: _propTypes.default.func,
|
|
47
|
+
|
|
66
48
|
/**
|
|
67
49
|
* The value of the input, and unique identifier in the ToggleButtonGroup
|
|
68
50
|
*/
|
|
69
|
-
value:
|
|
51
|
+
value: _propTypes.default.any.isRequired
|
|
70
52
|
};
|
|
71
53
|
|
|
72
|
-
var ToggleButton =
|
|
73
|
-
|
|
54
|
+
var ToggleButton =
|
|
55
|
+
/*#__PURE__*/
|
|
56
|
+
function (_React$Component) {
|
|
57
|
+
(0, _inheritsLoose2.default)(ToggleButton, _React$Component);
|
|
74
58
|
|
|
75
59
|
function ToggleButton() {
|
|
76
|
-
|
|
77
|
-
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
60
|
+
return _React$Component.apply(this, arguments) || this;
|
|
78
61
|
}
|
|
79
62
|
|
|
80
|
-
ToggleButton.prototype
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
63
|
+
var _proto = ToggleButton.prototype;
|
|
64
|
+
|
|
65
|
+
_proto.render = function render() {
|
|
66
|
+
var _this$props = this.props,
|
|
67
|
+
children = _this$props.children,
|
|
68
|
+
name = _this$props.name,
|
|
69
|
+
checked = _this$props.checked,
|
|
70
|
+
type = _this$props.type,
|
|
71
|
+
onChange = _this$props.onChange,
|
|
72
|
+
value = _this$props.value,
|
|
73
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_this$props, ["children", "name", "checked", "type", "onChange", "value"]);
|
|
90
74
|
var disabled = props.disabled;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}),
|
|
104
|
-
children
|
|
105
|
-
);
|
|
75
|
+
return _react.default.createElement(_Button.default, (0, _extends2.default)({}, props, {
|
|
76
|
+
active: !!checked,
|
|
77
|
+
componentClass: "label"
|
|
78
|
+
}), _react.default.createElement("input", {
|
|
79
|
+
name: name,
|
|
80
|
+
type: type,
|
|
81
|
+
autoComplete: "off",
|
|
82
|
+
value: value,
|
|
83
|
+
checked: !!checked,
|
|
84
|
+
disabled: !!disabled,
|
|
85
|
+
onChange: onChange
|
|
86
|
+
}), children);
|
|
106
87
|
};
|
|
107
88
|
|
|
108
89
|
return ToggleButton;
|
|
109
|
-
}(
|
|
90
|
+
}(_react.default.Component);
|
|
110
91
|
|
|
111
92
|
ToggleButton.propTypes = propTypes;
|
|
112
|
-
|
|
113
|
-
exports.default =
|
|
114
|
-
module.exports = exports[
|
|
93
|
+
var _default = ToggleButton;
|
|
94
|
+
exports.default = _default;
|
|
95
|
+
module.exports = exports["default"];
|