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/utils/StyleConfig.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
|
|
4
|
+
exports.Style = exports.State = exports.DEVICE_SIZES = exports.SIZE_MAP = exports.Size = void 0;
|
|
5
|
+
var Size = {
|
|
5
6
|
LARGE: 'large',
|
|
6
7
|
SMALL: 'small',
|
|
7
8
|
XSMALL: 'xsmall'
|
|
8
9
|
};
|
|
9
|
-
|
|
10
|
-
var SIZE_MAP =
|
|
10
|
+
exports.Size = Size;
|
|
11
|
+
var SIZE_MAP = {
|
|
11
12
|
large: 'lg',
|
|
12
13
|
medium: 'md',
|
|
13
14
|
small: 'sm',
|
|
@@ -17,19 +18,20 @@ var SIZE_MAP = exports.SIZE_MAP = {
|
|
|
17
18
|
sm: 'sm',
|
|
18
19
|
xs: 'xs'
|
|
19
20
|
};
|
|
20
|
-
|
|
21
|
-
var DEVICE_SIZES =
|
|
22
|
-
|
|
23
|
-
var State =
|
|
21
|
+
exports.SIZE_MAP = SIZE_MAP;
|
|
22
|
+
var DEVICE_SIZES = ['lg', 'md', 'sm', 'xs'];
|
|
23
|
+
exports.DEVICE_SIZES = DEVICE_SIZES;
|
|
24
|
+
var State = {
|
|
24
25
|
SUCCESS: 'success',
|
|
25
26
|
WARNING: 'warning',
|
|
26
27
|
DANGER: 'danger',
|
|
27
28
|
INFO: 'info'
|
|
28
29
|
};
|
|
29
|
-
|
|
30
|
-
var Style =
|
|
30
|
+
exports.State = State;
|
|
31
|
+
var Style = {
|
|
31
32
|
DEFAULT: 'default',
|
|
32
33
|
PRIMARY: 'primary',
|
|
33
34
|
LINK: 'link',
|
|
34
35
|
INVERSE: 'inverse'
|
|
35
|
-
};
|
|
36
|
+
};
|
|
37
|
+
exports.Style = Style;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.default = void 0;
|
|
6
7
|
|
|
7
|
-
var
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
// TODO: This module should be ElementChildren, and should use named exports.
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Iterates through children that are typically specified as `props.children`,
|
|
@@ -22,16 +23,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
22
23
|
*/
|
|
23
24
|
function map(children, func, context) {
|
|
24
25
|
var index = 0;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (!_react2.default.isValidElement(child)) {
|
|
26
|
+
return _react.default.Children.map(children, function (child) {
|
|
27
|
+
if (!_react.default.isValidElement(child)) {
|
|
28
28
|
return child;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
return func.call(context, child, index++);
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
|
|
35
34
|
/**
|
|
36
35
|
* Iterates through children that are "valid components".
|
|
37
36
|
*
|
|
@@ -42,31 +41,32 @@ function map(children, func, context) {
|
|
|
42
41
|
* @param {function(*, int)} func.
|
|
43
42
|
* @param {*} context Context for context.
|
|
44
43
|
*/
|
|
45
|
-
|
|
44
|
+
|
|
46
45
|
|
|
47
46
|
function forEach(children, func, context) {
|
|
48
47
|
var index = 0;
|
|
49
48
|
|
|
50
|
-
|
|
51
|
-
if (!
|
|
49
|
+
_react.default.Children.forEach(children, function (child) {
|
|
50
|
+
if (!_react.default.isValidElement(child)) {
|
|
52
51
|
return;
|
|
53
52
|
}
|
|
54
53
|
|
|
55
54
|
func.call(context, child, index++);
|
|
56
55
|
});
|
|
57
56
|
}
|
|
58
|
-
|
|
59
57
|
/**
|
|
60
58
|
* Count the number of "valid components" in the Children container.
|
|
61
59
|
*
|
|
62
60
|
* @param {?*} children Children tree container.
|
|
63
61
|
* @returns {number}
|
|
64
62
|
*/
|
|
63
|
+
|
|
64
|
+
|
|
65
65
|
function count(children) {
|
|
66
66
|
var result = 0;
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
if (!
|
|
68
|
+
_react.default.Children.forEach(children, function (child) {
|
|
69
|
+
if (!_react.default.isValidElement(child)) {
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -75,7 +75,6 @@ function count(children) {
|
|
|
75
75
|
|
|
76
76
|
return result;
|
|
77
77
|
}
|
|
78
|
-
|
|
79
78
|
/**
|
|
80
79
|
* Finds children that are typically specified as `props.children`,
|
|
81
80
|
* but only iterates over children that are "valid components".
|
|
@@ -88,12 +87,14 @@ function count(children) {
|
|
|
88
87
|
* @param {*} context Context for func.
|
|
89
88
|
* @returns {array} of children that meet the func return statement
|
|
90
89
|
*/
|
|
90
|
+
|
|
91
|
+
|
|
91
92
|
function filter(children, func, context) {
|
|
92
93
|
var index = 0;
|
|
93
94
|
var result = [];
|
|
94
95
|
|
|
95
|
-
|
|
96
|
-
if (!
|
|
96
|
+
_react.default.Children.forEach(children, function (child) {
|
|
97
|
+
if (!_react.default.isValidElement(child)) {
|
|
97
98
|
return;
|
|
98
99
|
}
|
|
99
100
|
|
|
@@ -107,13 +108,14 @@ function filter(children, func, context) {
|
|
|
107
108
|
|
|
108
109
|
function find(children, func, context) {
|
|
109
110
|
var index = 0;
|
|
110
|
-
var result
|
|
111
|
+
var result;
|
|
111
112
|
|
|
112
|
-
|
|
113
|
+
_react.default.Children.forEach(children, function (child) {
|
|
113
114
|
if (result) {
|
|
114
115
|
return;
|
|
115
116
|
}
|
|
116
|
-
|
|
117
|
+
|
|
118
|
+
if (!_react.default.isValidElement(child)) {
|
|
117
119
|
return;
|
|
118
120
|
}
|
|
119
121
|
|
|
@@ -129,11 +131,12 @@ function every(children, func, context) {
|
|
|
129
131
|
var index = 0;
|
|
130
132
|
var result = true;
|
|
131
133
|
|
|
132
|
-
|
|
134
|
+
_react.default.Children.forEach(children, function (child) {
|
|
133
135
|
if (!result) {
|
|
134
136
|
return;
|
|
135
137
|
}
|
|
136
|
-
|
|
138
|
+
|
|
139
|
+
if (!_react.default.isValidElement(child)) {
|
|
137
140
|
return;
|
|
138
141
|
}
|
|
139
142
|
|
|
@@ -149,11 +152,12 @@ function some(children, func, context) {
|
|
|
149
152
|
var index = 0;
|
|
150
153
|
var result = false;
|
|
151
154
|
|
|
152
|
-
|
|
155
|
+
_react.default.Children.forEach(children, function (child) {
|
|
153
156
|
if (result) {
|
|
154
157
|
return;
|
|
155
158
|
}
|
|
156
|
-
|
|
159
|
+
|
|
160
|
+
if (!_react.default.isValidElement(child)) {
|
|
157
161
|
return;
|
|
158
162
|
}
|
|
159
163
|
|
|
@@ -168,8 +172,8 @@ function some(children, func, context) {
|
|
|
168
172
|
function toArray(children) {
|
|
169
173
|
var result = [];
|
|
170
174
|
|
|
171
|
-
|
|
172
|
-
if (!
|
|
175
|
+
_react.default.Children.forEach(children, function (child) {
|
|
176
|
+
if (!_react.default.isValidElement(child)) {
|
|
173
177
|
return;
|
|
174
178
|
}
|
|
175
179
|
|
|
@@ -179,7 +183,7 @@ function toArray(children) {
|
|
|
179
183
|
return result;
|
|
180
184
|
}
|
|
181
185
|
|
|
182
|
-
|
|
186
|
+
var _default = {
|
|
183
187
|
map: map,
|
|
184
188
|
forEach: forEach,
|
|
185
189
|
count: count,
|
|
@@ -189,4 +193,5 @@ exports.default = {
|
|
|
189
193
|
some: some,
|
|
190
194
|
toArray: toArray
|
|
191
195
|
};
|
|
192
|
-
|
|
196
|
+
exports.default = _default;
|
|
197
|
+
module.exports = exports["default"];
|
|
@@ -1,67 +1,59 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
exports._curry = exports.bsSizes = exports.bsStyles = exports.bsClass = undefined;
|
|
5
|
-
|
|
6
|
-
var _entries = require('babel-runtime/core-js/object/entries');
|
|
7
|
-
|
|
8
|
-
var _entries2 = _interopRequireDefault(_entries);
|
|
9
|
-
|
|
10
|
-
var _extends2 = require('babel-runtime/helpers/extends');
|
|
11
|
-
|
|
12
|
-
var _extends3 = _interopRequireDefault(_extends2);
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
13
4
|
|
|
5
|
+
exports.__esModule = true;
|
|
14
6
|
exports.prefix = prefix;
|
|
15
7
|
exports.getClassSet = getClassSet;
|
|
16
8
|
exports.splitBsProps = splitBsProps;
|
|
17
9
|
exports.splitBsPropsAndOmit = splitBsPropsAndOmit;
|
|
18
10
|
exports.addStyle = addStyle;
|
|
11
|
+
exports._curry = exports.bsSizes = exports.bsStyles = exports.bsClass = void 0;
|
|
19
12
|
|
|
20
|
-
var
|
|
13
|
+
var _entries = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/entries"));
|
|
21
14
|
|
|
22
|
-
var
|
|
15
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/extends"));
|
|
23
16
|
|
|
24
|
-
var
|
|
17
|
+
var _invariant = _interopRequireDefault(require("invariant"));
|
|
25
18
|
|
|
26
|
-
var
|
|
19
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
20
|
|
|
28
|
-
var _StyleConfig = require(
|
|
29
|
-
|
|
30
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
var _StyleConfig = require("./StyleConfig");
|
|
31
22
|
|
|
23
|
+
// TODO: The publicly exposed parts of this should be in lib/BootstrapUtils.
|
|
32
24
|
function curry(fn) {
|
|
33
25
|
return function () {
|
|
34
|
-
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
26
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
35
27
|
args[_key] = arguments[_key];
|
|
36
28
|
}
|
|
37
29
|
|
|
38
30
|
var last = args[args.length - 1];
|
|
31
|
+
|
|
39
32
|
if (typeof last === 'function') {
|
|
40
|
-
return fn.apply(
|
|
33
|
+
return fn.apply(void 0, args);
|
|
41
34
|
}
|
|
35
|
+
|
|
42
36
|
return function (Component) {
|
|
43
|
-
return fn.apply(
|
|
37
|
+
return fn.apply(void 0, args.concat([Component]));
|
|
44
38
|
};
|
|
45
39
|
};
|
|
46
|
-
}
|
|
40
|
+
}
|
|
47
41
|
|
|
48
42
|
function prefix(props, variant) {
|
|
49
43
|
var bsClass = (props.bsClass || '').trim();
|
|
50
|
-
!(bsClass != null) ? process.env.NODE_ENV !==
|
|
51
|
-
return bsClass + (variant ?
|
|
44
|
+
!(bsClass != null) ? process.env.NODE_ENV !== "production" ? (0, _invariant.default)(false, 'A `bsClass` prop is required for this component') : invariant(false) : void 0;
|
|
45
|
+
return bsClass + (variant ? "-" + variant : '');
|
|
52
46
|
}
|
|
53
47
|
|
|
54
|
-
var bsClass =
|
|
48
|
+
var bsClass = curry(function (defaultClass, Component) {
|
|
55
49
|
var propTypes = Component.propTypes || (Component.propTypes = {});
|
|
56
50
|
var defaultProps = Component.defaultProps || (Component.defaultProps = {});
|
|
57
|
-
|
|
58
|
-
propTypes.bsClass = _propTypes2.default.string;
|
|
51
|
+
propTypes.bsClass = _propTypes.default.string;
|
|
59
52
|
defaultProps.bsClass = defaultClass;
|
|
60
|
-
|
|
61
53
|
return Component;
|
|
62
54
|
});
|
|
63
|
-
|
|
64
|
-
var bsStyles =
|
|
55
|
+
exports.bsClass = bsClass;
|
|
56
|
+
var bsStyles = curry(function (styles, defaultStyle, Component) {
|
|
65
57
|
if (typeof defaultStyle !== 'string') {
|
|
66
58
|
Component = defaultStyle;
|
|
67
59
|
defaultStyle = undefined;
|
|
@@ -69,20 +61,18 @@ var bsStyles = exports.bsStyles = curry(function (styles, defaultStyle, Componen
|
|
|
69
61
|
|
|
70
62
|
var existing = Component.STYLES || [];
|
|
71
63
|
var propTypes = Component.propTypes || {};
|
|
72
|
-
|
|
73
64
|
styles.forEach(function (style) {
|
|
74
65
|
if (existing.indexOf(style) === -1) {
|
|
75
66
|
existing.push(style);
|
|
76
67
|
}
|
|
77
68
|
});
|
|
78
69
|
|
|
79
|
-
var propType =
|
|
70
|
+
var propType = _propTypes.default.oneOf(existing); // expose the values on the propType function for documentation
|
|
71
|
+
|
|
80
72
|
|
|
81
|
-
// expose the values on the propType function for documentation
|
|
82
73
|
Component.STYLES = existing;
|
|
83
74
|
propType._values = existing;
|
|
84
|
-
|
|
85
|
-
Component.propTypes = (0, _extends3.default)({}, propTypes, {
|
|
75
|
+
Component.propTypes = (0, _extends2.default)({}, propTypes, {
|
|
86
76
|
bsStyle: propType
|
|
87
77
|
});
|
|
88
78
|
|
|
@@ -93,8 +83,8 @@ var bsStyles = exports.bsStyles = curry(function (styles, defaultStyle, Componen
|
|
|
93
83
|
|
|
94
84
|
return Component;
|
|
95
85
|
});
|
|
96
|
-
|
|
97
|
-
var bsSizes =
|
|
86
|
+
exports.bsStyles = bsStyles;
|
|
87
|
+
var bsSizes = curry(function (sizes, defaultSize, Component) {
|
|
98
88
|
if (typeof defaultSize !== 'string') {
|
|
99
89
|
Component = defaultSize;
|
|
100
90
|
defaultSize = undefined;
|
|
@@ -102,16 +92,15 @@ var bsSizes = exports.bsSizes = curry(function (sizes, defaultSize, Component) {
|
|
|
102
92
|
|
|
103
93
|
var existing = Component.SIZES || [];
|
|
104
94
|
var propTypes = Component.propTypes || {};
|
|
105
|
-
|
|
106
95
|
sizes.forEach(function (size) {
|
|
107
96
|
if (existing.indexOf(size) === -1) {
|
|
108
97
|
existing.push(size);
|
|
109
98
|
}
|
|
110
99
|
});
|
|
111
|
-
|
|
112
100
|
var values = [];
|
|
113
101
|
existing.forEach(function (size) {
|
|
114
102
|
var mappedSize = _StyleConfig.SIZE_MAP[size];
|
|
103
|
+
|
|
115
104
|
if (mappedSize && mappedSize !== size) {
|
|
116
105
|
values.push(mappedSize);
|
|
117
106
|
}
|
|
@@ -119,13 +108,12 @@ var bsSizes = exports.bsSizes = curry(function (sizes, defaultSize, Component) {
|
|
|
119
108
|
values.push(size);
|
|
120
109
|
});
|
|
121
110
|
|
|
122
|
-
var propType =
|
|
123
|
-
propType._values = values;
|
|
111
|
+
var propType = _propTypes.default.oneOf(values);
|
|
124
112
|
|
|
125
|
-
// expose the values on the propType function for documentation
|
|
126
|
-
Component.SIZES = existing;
|
|
113
|
+
propType._values = values; // expose the values on the propType function for documentation
|
|
127
114
|
|
|
128
|
-
Component.
|
|
115
|
+
Component.SIZES = existing;
|
|
116
|
+
Component.propTypes = (0, _extends2.default)({}, propTypes, {
|
|
129
117
|
bsSize: propType
|
|
130
118
|
});
|
|
131
119
|
|
|
@@ -133,11 +121,13 @@ var bsSizes = exports.bsSizes = curry(function (sizes, defaultSize, Component) {
|
|
|
133
121
|
if (!Component.defaultProps) {
|
|
134
122
|
Component.defaultProps = {};
|
|
135
123
|
}
|
|
124
|
+
|
|
136
125
|
Component.defaultProps.bsSize = defaultSize;
|
|
137
126
|
}
|
|
138
127
|
|
|
139
128
|
return Component;
|
|
140
129
|
});
|
|
130
|
+
exports.bsSizes = bsSizes;
|
|
141
131
|
|
|
142
132
|
function getClassSet(props) {
|
|
143
133
|
var _classes;
|
|
@@ -171,7 +161,7 @@ function isBsProp(propName) {
|
|
|
171
161
|
|
|
172
162
|
function splitBsProps(props) {
|
|
173
163
|
var elementProps = {};
|
|
174
|
-
(0,
|
|
164
|
+
(0, _entries.default)(props).forEach(function (_ref) {
|
|
175
165
|
var propName = _ref[0],
|
|
176
166
|
propValue = _ref[1];
|
|
177
167
|
|
|
@@ -179,7 +169,6 @@ function splitBsProps(props) {
|
|
|
179
169
|
elementProps[propName] = propValue;
|
|
180
170
|
}
|
|
181
171
|
});
|
|
182
|
-
|
|
183
172
|
return [getBsProps(props), elementProps];
|
|
184
173
|
}
|
|
185
174
|
|
|
@@ -188,9 +177,8 @@ function splitBsPropsAndOmit(props, omittedPropNames) {
|
|
|
188
177
|
omittedPropNames.forEach(function (propName) {
|
|
189
178
|
isOmittedProp[propName] = true;
|
|
190
179
|
});
|
|
191
|
-
|
|
192
180
|
var elementProps = {};
|
|
193
|
-
(0,
|
|
181
|
+
(0, _entries.default)(props).forEach(function (_ref2) {
|
|
194
182
|
var propName = _ref2[0],
|
|
195
183
|
propValue = _ref2[1];
|
|
196
184
|
|
|
@@ -198,20 +186,21 @@ function splitBsPropsAndOmit(props, omittedPropNames) {
|
|
|
198
186
|
elementProps[propName] = propValue;
|
|
199
187
|
}
|
|
200
188
|
});
|
|
201
|
-
|
|
202
189
|
return [getBsProps(props), elementProps];
|
|
203
190
|
}
|
|
204
|
-
|
|
205
191
|
/**
|
|
206
192
|
* Add a style variant to a Component. Mutates the propTypes of the component
|
|
207
193
|
* in order to validate the new variant.
|
|
208
194
|
*/
|
|
195
|
+
|
|
196
|
+
|
|
209
197
|
function addStyle(Component) {
|
|
210
|
-
for (var _len2 = arguments.length, styleVariant = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
198
|
+
for (var _len2 = arguments.length, styleVariant = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
211
199
|
styleVariant[_key2 - 1] = arguments[_key2];
|
|
212
200
|
}
|
|
213
201
|
|
|
214
202
|
bsStyles(styleVariant, Component);
|
|
215
203
|
}
|
|
216
204
|
|
|
217
|
-
var _curry =
|
|
205
|
+
var _curry = curry;
|
|
206
|
+
exports._curry = _curry;
|
package/lib/utils/capitalize.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
4
6
|
/**
|
|
5
7
|
* Safe chained function
|
|
6
8
|
*
|
|
@@ -11,7 +13,7 @@ exports.__esModule = true;
|
|
|
11
13
|
* @returns {function|null}
|
|
12
14
|
*/
|
|
13
15
|
function createChainedFunction() {
|
|
14
|
-
for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
|
|
16
|
+
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
15
17
|
funcs[_key] = arguments[_key];
|
|
16
18
|
}
|
|
17
19
|
|
|
@@ -27,7 +29,7 @@ function createChainedFunction() {
|
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
return function chainedFunction() {
|
|
30
|
-
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
32
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
31
33
|
args[_key2] = arguments[_key2];
|
|
32
34
|
}
|
|
33
35
|
|
|
@@ -37,5 +39,6 @@ function createChainedFunction() {
|
|
|
37
39
|
}, null);
|
|
38
40
|
}
|
|
39
41
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
var _default = createChainedFunction;
|
|
43
|
+
exports.default = _default;
|
|
44
|
+
module.exports = exports["default"];
|
|
@@ -1,43 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
|
6
|
-
|
|
7
|
-
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
8
|
-
|
|
9
|
-
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
|
10
|
-
|
|
11
|
-
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
12
|
-
|
|
13
|
-
var _inherits2 = require('babel-runtime/helpers/inherits');
|
|
14
|
-
|
|
15
|
-
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
16
|
-
|
|
17
|
-
var _typeof2 = require('babel-runtime/helpers/typeof');
|
|
18
|
-
|
|
19
|
-
var _typeof3 = _interopRequireDefault(_typeof2);
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
20
4
|
|
|
5
|
+
exports.__esModule = true;
|
|
21
6
|
exports._resetWarned = _resetWarned;
|
|
7
|
+
exports.default = void 0;
|
|
22
8
|
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
var _warning2 = _interopRequireDefault(_warning);
|
|
9
|
+
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inheritsLoose"));
|
|
26
10
|
|
|
27
|
-
|
|
11
|
+
var _warning = _interopRequireDefault(require("warning"));
|
|
28
12
|
|
|
29
13
|
var warned = {};
|
|
30
14
|
|
|
31
15
|
function deprecationWarning(oldname, newname, link) {
|
|
32
|
-
var message
|
|
16
|
+
var message;
|
|
33
17
|
|
|
34
|
-
if (
|
|
18
|
+
if (typeof oldname === 'object') {
|
|
35
19
|
message = oldname.message;
|
|
36
20
|
} else {
|
|
37
|
-
message = oldname +
|
|
21
|
+
message = oldname + " is deprecated. Use " + newname + " instead.";
|
|
38
22
|
|
|
39
23
|
if (link) {
|
|
40
|
-
message +=
|
|
24
|
+
message += "\nYou can read more about it at " + link;
|
|
41
25
|
}
|
|
42
26
|
}
|
|
43
27
|
|
|
@@ -45,42 +29,48 @@ function deprecationWarning(oldname, newname, link) {
|
|
|
45
29
|
return;
|
|
46
30
|
}
|
|
47
31
|
|
|
48
|
-
process.env.NODE_ENV !==
|
|
32
|
+
process.env.NODE_ENV !== "production" ? (0, _warning.default)(false, message) : void 0;
|
|
49
33
|
warned[message] = true;
|
|
50
34
|
}
|
|
51
35
|
|
|
52
36
|
deprecationWarning.wrapper = function (Component) {
|
|
53
|
-
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
37
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
54
38
|
args[_key - 1] = arguments[_key];
|
|
55
39
|
}
|
|
56
40
|
|
|
57
|
-
return
|
|
58
|
-
|
|
41
|
+
return (
|
|
42
|
+
/*#__PURE__*/
|
|
43
|
+
function (_Component) {
|
|
44
|
+
(0, _inheritsLoose2.default)(DeprecatedComponent, _Component);
|
|
59
45
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
46
|
+
function DeprecatedComponent() {
|
|
47
|
+
return _Component.apply(this, arguments) || this;
|
|
48
|
+
}
|
|
64
49
|
|
|
65
|
-
|
|
66
|
-
deprecationWarning.apply(undefined, args);
|
|
50
|
+
var _proto = DeprecatedComponent.prototype;
|
|
67
51
|
|
|
68
|
-
|
|
69
|
-
|
|
52
|
+
_proto.componentWillMount = function componentWillMount() {
|
|
53
|
+
deprecationWarning.apply(void 0, args);
|
|
70
54
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
55
|
+
if (_Component.prototype.componentWillMount) {
|
|
56
|
+
var _Component$prototype$;
|
|
74
57
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
58
|
+
for (var _len2 = arguments.length, methodArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
59
|
+
methodArgs[_key2] = arguments[_key2];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
(_Component$prototype$ = _Component.prototype.componentWillMount).call.apply(_Component$prototype$, [this].concat(methodArgs));
|
|
63
|
+
}
|
|
64
|
+
};
|
|
78
65
|
|
|
79
|
-
|
|
80
|
-
|
|
66
|
+
return DeprecatedComponent;
|
|
67
|
+
}(Component)
|
|
68
|
+
);
|
|
81
69
|
};
|
|
82
70
|
|
|
83
|
-
|
|
71
|
+
var _default = deprecationWarning;
|
|
72
|
+
exports.default = _default;
|
|
73
|
+
|
|
84
74
|
function _resetWarned() {
|
|
85
75
|
warned = {};
|
|
86
76
|
}
|
package/lib/utils/index.js
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
exports.ValidComponentChildren = exports.createChainedFunction = exports.bootstrapUtils = undefined;
|
|
5
|
-
|
|
6
|
-
var _bootstrapUtils2 = require('./bootstrapUtils');
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
7
4
|
|
|
8
|
-
var
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime-corejs2/helpers/interopRequireWildcard");
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
exports.__esModule = true;
|
|
8
|
+
exports.bootstrapUtils = void 0;
|
|
11
9
|
|
|
12
|
-
var
|
|
10
|
+
var _bootstrapUtils = _interopRequireWildcard(require("./bootstrapUtils"));
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
exports.bootstrapUtils = _bootstrapUtils;
|
|
15
13
|
|
|
16
|
-
var
|
|
14
|
+
var _createChainedFunction2 = _interopRequireDefault(require("./createChainedFunction"));
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
exports.createChainedFunction = _createChainedFunction2.default;
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
var _ValidComponentChildren2 = _interopRequireDefault(require("./ValidComponentChildren"));
|
|
21
19
|
|
|
22
|
-
exports.
|
|
23
|
-
exports.createChainedFunction = _createChainedFunction3.default;
|
|
24
|
-
exports.ValidComponentChildren = _ValidComponentChildren3.default;
|
|
20
|
+
exports.ValidComponentChildren = _ValidComponentChildren2.default;
|