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/es/PanelGroup.js
CHANGED
|
@@ -1,78 +1,132 @@
|
|
|
1
|
-
import _extends from 'babel-runtime/helpers/extends';
|
|
2
|
-
import _Object$assign from 'babel-runtime/core-js/object/assign';
|
|
3
1
|
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
|
2
|
+
import _extends from 'babel-runtime/helpers/extends';
|
|
4
3
|
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
|
5
4
|
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
6
5
|
import _inherits from 'babel-runtime/helpers/inherits';
|
|
7
6
|
import classNames from 'classnames';
|
|
8
|
-
import React, { cloneElement } from 'react';
|
|
9
7
|
import PropTypes from 'prop-types';
|
|
8
|
+
import React, { cloneElement } from 'react';
|
|
9
|
+
import uncontrollable from 'uncontrollable';
|
|
10
10
|
|
|
11
11
|
import { bsClass, getClassSet, splitBsPropsAndOmit } from './utils/bootstrapUtils';
|
|
12
|
-
import createChainedFunction from './utils/createChainedFunction';
|
|
13
12
|
import ValidComponentChildren from './utils/ValidComponentChildren';
|
|
13
|
+
import { generatedId } from './utils/PropTypes';
|
|
14
14
|
|
|
15
15
|
var propTypes = {
|
|
16
16
|
accordion: PropTypes.bool,
|
|
17
|
+
/**
|
|
18
|
+
* When `accordion` is enabled, `activeKey` controls the which child `Panel` is expanded. `activeKey` should
|
|
19
|
+
* match a child Panel `eventKey` prop exactly.
|
|
20
|
+
*
|
|
21
|
+
* @controllable onSelect
|
|
22
|
+
*/
|
|
17
23
|
activeKey: PropTypes.any,
|
|
18
|
-
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A callback fired when a child Panel collapse state changes. It's called with the next expanded `activeKey`
|
|
27
|
+
*
|
|
28
|
+
* @controllable activeKey
|
|
29
|
+
*/
|
|
19
30
|
onSelect: PropTypes.func,
|
|
20
|
-
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* An HTML role attribute
|
|
34
|
+
*/
|
|
35
|
+
role: PropTypes.string,
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A function that takes an eventKey and type and returns a
|
|
39
|
+
* unique id for each Panel heading and Panel Collapse. The function _must_ be a pure function,
|
|
40
|
+
* meaning it should always return the _same_ id for the same set of inputs. The default
|
|
41
|
+
* value requires that an `id` to be set for the PanelGroup.
|
|
42
|
+
*
|
|
43
|
+
* The `type` argument will either be `"body"` or `"heading"`.
|
|
44
|
+
*
|
|
45
|
+
* @defaultValue (eventKey, type) => `${this.props.id}-${type}-${key}`
|
|
46
|
+
*/
|
|
47
|
+
generateChildId: PropTypes.func,
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* HTML id attribute, required if no `generateChildId` prop
|
|
51
|
+
* is specified.
|
|
52
|
+
*/
|
|
53
|
+
id: generatedId('PanelGroup')
|
|
21
54
|
};
|
|
22
55
|
|
|
23
56
|
var defaultProps = {
|
|
24
57
|
accordion: false
|
|
25
58
|
};
|
|
26
59
|
|
|
27
|
-
|
|
60
|
+
var childContextTypes = {
|
|
61
|
+
$bs_panelGroup: PropTypes.shape({
|
|
62
|
+
getId: PropTypes.func,
|
|
63
|
+
headerRole: PropTypes.string,
|
|
64
|
+
panelRole: PropTypes.string,
|
|
65
|
+
activeKey: PropTypes.any,
|
|
66
|
+
onToggle: PropTypes.func
|
|
67
|
+
})
|
|
68
|
+
};
|
|
28
69
|
|
|
29
70
|
var PanelGroup = function (_React$Component) {
|
|
30
71
|
_inherits(PanelGroup, _React$Component);
|
|
31
72
|
|
|
32
|
-
function PanelGroup(
|
|
33
|
-
|
|
73
|
+
function PanelGroup() {
|
|
74
|
+
var _temp, _this, _ret;
|
|
34
75
|
|
|
35
|
-
|
|
76
|
+
_classCallCheck(this, PanelGroup);
|
|
36
77
|
|
|
37
|
-
|
|
78
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
79
|
+
args[_key] = arguments[_key];
|
|
80
|
+
}
|
|
38
81
|
|
|
39
|
-
_this.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
82
|
+
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleSelect = function (key, expanded, e) {
|
|
83
|
+
if (expanded) {
|
|
84
|
+
_this.props.onSelect(key, e);
|
|
85
|
+
} else if (_this.props.activeKey === key) {
|
|
86
|
+
_this.props.onSelect(null, e);
|
|
87
|
+
}
|
|
88
|
+
}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
43
89
|
}
|
|
44
90
|
|
|
45
|
-
PanelGroup.prototype.
|
|
46
|
-
|
|
91
|
+
PanelGroup.prototype.getChildContext = function getChildContext() {
|
|
92
|
+
var _props = this.props,
|
|
93
|
+
activeKey = _props.activeKey,
|
|
94
|
+
accordion = _props.accordion,
|
|
95
|
+
generateChildId = _props.generateChildId,
|
|
96
|
+
id = _props.id;
|
|
47
97
|
|
|
48
|
-
|
|
49
|
-
this.props.onSelect(key, e);
|
|
50
|
-
}
|
|
98
|
+
var getId = null;
|
|
51
99
|
|
|
52
|
-
if (
|
|
53
|
-
|
|
100
|
+
if (accordion) {
|
|
101
|
+
getId = generateChildId || function (key, type) {
|
|
102
|
+
return id ? id + '-' + type + '-' + key : null;
|
|
103
|
+
};
|
|
54
104
|
}
|
|
55
105
|
|
|
56
|
-
|
|
106
|
+
return {
|
|
107
|
+
$bs_panelGroup: _extends({
|
|
108
|
+
getId: getId,
|
|
109
|
+
headerRole: 'tab',
|
|
110
|
+
panelRole: 'tabpanel'
|
|
111
|
+
}, accordion && {
|
|
112
|
+
activeKey: activeKey,
|
|
113
|
+
onToggle: this.handleSelect
|
|
114
|
+
})
|
|
115
|
+
};
|
|
57
116
|
};
|
|
58
117
|
|
|
59
118
|
PanelGroup.prototype.render = function render() {
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
className = _props.className,
|
|
66
|
-
children = _props.children,
|
|
67
|
-
props = _objectWithoutProperties(_props, ['accordion', 'activeKey', 'className', 'children']);
|
|
119
|
+
var _props2 = this.props,
|
|
120
|
+
accordion = _props2.accordion,
|
|
121
|
+
className = _props2.className,
|
|
122
|
+
children = _props2.children,
|
|
123
|
+
props = _objectWithoutProperties(_props2, ['accordion', 'className', 'children']);
|
|
68
124
|
|
|
69
|
-
var _splitBsPropsAndOmit = splitBsPropsAndOmit(props, ['
|
|
125
|
+
var _splitBsPropsAndOmit = splitBsPropsAndOmit(props, ['onSelect', 'activeKey']),
|
|
70
126
|
bsProps = _splitBsPropsAndOmit[0],
|
|
71
127
|
elementProps = _splitBsPropsAndOmit[1];
|
|
72
128
|
|
|
73
|
-
var activeKey = void 0;
|
|
74
129
|
if (accordion) {
|
|
75
|
-
activeKey = propsActiveKey != null ? propsActiveKey : this.state.activeKey;
|
|
76
130
|
elementProps.role = elementProps.role || 'tablist';
|
|
77
131
|
}
|
|
78
132
|
|
|
@@ -80,25 +134,11 @@ var PanelGroup = function (_React$Component) {
|
|
|
80
134
|
|
|
81
135
|
return React.createElement(
|
|
82
136
|
'div',
|
|
83
|
-
_extends({}, elementProps, {
|
|
84
|
-
className: classNames(className, classes)
|
|
85
|
-
}),
|
|
137
|
+
_extends({}, elementProps, { className: classNames(className, classes) }),
|
|
86
138
|
ValidComponentChildren.map(children, function (child) {
|
|
87
|
-
|
|
139
|
+
return cloneElement(child, {
|
|
88
140
|
bsStyle: child.props.bsStyle || bsProps.bsStyle
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
if (accordion) {
|
|
92
|
-
_Object$assign(childProps, {
|
|
93
|
-
headerRole: 'tab',
|
|
94
|
-
panelRole: 'tabpanel',
|
|
95
|
-
collapsible: true,
|
|
96
|
-
expanded: child.props.eventKey === activeKey,
|
|
97
|
-
onSelect: createChainedFunction(_this2.handleSelect, child.props.onSelect)
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return cloneElement(child, childProps);
|
|
141
|
+
});
|
|
102
142
|
})
|
|
103
143
|
);
|
|
104
144
|
};
|
|
@@ -108,5 +148,8 @@ var PanelGroup = function (_React$Component) {
|
|
|
108
148
|
|
|
109
149
|
PanelGroup.propTypes = propTypes;
|
|
110
150
|
PanelGroup.defaultProps = defaultProps;
|
|
151
|
+
PanelGroup.childContextTypes = childContextTypes;
|
|
111
152
|
|
|
112
|
-
export default bsClass('panel-group', PanelGroup)
|
|
153
|
+
export default uncontrollable(bsClass('panel-group', PanelGroup), {
|
|
154
|
+
activeKey: 'onSelect'
|
|
155
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import _extends from 'babel-runtime/helpers/extends';
|
|
2
|
+
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
|
3
|
+
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
|
4
|
+
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
5
|
+
import _inherits from 'babel-runtime/helpers/inherits';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import cn from 'classnames';
|
|
9
|
+
import elementType from 'react-prop-types/lib/elementType';
|
|
10
|
+
|
|
11
|
+
import { prefix, bsClass, splitBsProps } from './utils/bootstrapUtils';
|
|
12
|
+
|
|
13
|
+
var propTypes = {
|
|
14
|
+
componentClass: elementType
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
var defaultProps = {
|
|
18
|
+
componentClass: 'div'
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
var contextTypes = {
|
|
22
|
+
$bs_panel: PropTypes.shape({
|
|
23
|
+
headingId: PropTypes.string,
|
|
24
|
+
bsClass: PropTypes.string
|
|
25
|
+
})
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
var PanelHeading = function (_React$Component) {
|
|
29
|
+
_inherits(PanelHeading, _React$Component);
|
|
30
|
+
|
|
31
|
+
function PanelHeading() {
|
|
32
|
+
_classCallCheck(this, PanelHeading);
|
|
33
|
+
|
|
34
|
+
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
PanelHeading.prototype.render = function render() {
|
|
38
|
+
var _props = this.props,
|
|
39
|
+
children = _props.children,
|
|
40
|
+
className = _props.className,
|
|
41
|
+
Component = _props.componentClass,
|
|
42
|
+
props = _objectWithoutProperties(_props, ['children', 'className', 'componentClass']);
|
|
43
|
+
|
|
44
|
+
var _ref = this.context.$bs_panel || {},
|
|
45
|
+
headingId = _ref.headingId,
|
|
46
|
+
_bsClass = _ref.bsClass;
|
|
47
|
+
|
|
48
|
+
var _splitBsProps = splitBsProps(props),
|
|
49
|
+
bsProps = _splitBsProps[0],
|
|
50
|
+
elementProps = _splitBsProps[1];
|
|
51
|
+
|
|
52
|
+
bsProps.bsClass = _bsClass || bsProps.bsClass;
|
|
53
|
+
|
|
54
|
+
if (headingId) {
|
|
55
|
+
elementProps.role = elementProps.role || 'tab';
|
|
56
|
+
elementProps.id = headingId;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return React.createElement(
|
|
60
|
+
Component,
|
|
61
|
+
_extends({}, elementProps, {
|
|
62
|
+
className: cn(className, prefix(bsProps, 'heading'))
|
|
63
|
+
}),
|
|
64
|
+
children
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
return PanelHeading;
|
|
69
|
+
}(React.Component);
|
|
70
|
+
|
|
71
|
+
PanelHeading.propTypes = propTypes;
|
|
72
|
+
PanelHeading.defaultProps = defaultProps;
|
|
73
|
+
PanelHeading.contextTypes = contextTypes;
|
|
74
|
+
|
|
75
|
+
export default bsClass('panel', PanelHeading);
|
package/es/PanelTitle.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import _extends from 'babel-runtime/helpers/extends';
|
|
2
|
+
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
|
3
|
+
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
|
4
|
+
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
5
|
+
import _inherits from 'babel-runtime/helpers/inherits';
|
|
6
|
+
import cn from 'classnames';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import elementType from 'react-prop-types/lib/elementType';
|
|
10
|
+
|
|
11
|
+
import { prefix, splitBsProps, bsClass } from './utils/bootstrapUtils';
|
|
12
|
+
import PanelToggle from './PanelToggle';
|
|
13
|
+
|
|
14
|
+
var propTypes = {
|
|
15
|
+
componentClass: elementType,
|
|
16
|
+
/**
|
|
17
|
+
* A convenience prop that renders the Panel.Title as a panel collapse toggle component
|
|
18
|
+
* for the common use-case.
|
|
19
|
+
*/
|
|
20
|
+
toggle: PropTypes.bool
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
var contextTypes = {
|
|
24
|
+
$bs_panel: PropTypes.shape({
|
|
25
|
+
bsClass: PropTypes.string
|
|
26
|
+
})
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var defaultProps = {
|
|
30
|
+
componentClass: 'div'
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
var PanelTitle = function (_React$Component) {
|
|
34
|
+
_inherits(PanelTitle, _React$Component);
|
|
35
|
+
|
|
36
|
+
function PanelTitle() {
|
|
37
|
+
_classCallCheck(this, PanelTitle);
|
|
38
|
+
|
|
39
|
+
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
PanelTitle.prototype.render = function render() {
|
|
43
|
+
var _props = this.props,
|
|
44
|
+
children = _props.children,
|
|
45
|
+
className = _props.className,
|
|
46
|
+
toggle = _props.toggle,
|
|
47
|
+
Component = _props.componentClass,
|
|
48
|
+
props = _objectWithoutProperties(_props, ['children', 'className', 'toggle', 'componentClass']);
|
|
49
|
+
|
|
50
|
+
var _ref = this.context.$bs_panel || {},
|
|
51
|
+
_bsClass = _ref.bsClass;
|
|
52
|
+
|
|
53
|
+
var _splitBsProps = splitBsProps(props),
|
|
54
|
+
bsProps = _splitBsProps[0],
|
|
55
|
+
elementProps = _splitBsProps[1];
|
|
56
|
+
|
|
57
|
+
bsProps.bsClass = _bsClass || bsProps.bsClass;
|
|
58
|
+
|
|
59
|
+
if (toggle) {
|
|
60
|
+
children = React.createElement(
|
|
61
|
+
PanelToggle,
|
|
62
|
+
null,
|
|
63
|
+
children
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return React.createElement(
|
|
68
|
+
Component,
|
|
69
|
+
_extends({}, elementProps, {
|
|
70
|
+
className: cn(className, prefix(bsProps, 'title'))
|
|
71
|
+
}),
|
|
72
|
+
children
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
return PanelTitle;
|
|
77
|
+
}(React.Component);
|
|
78
|
+
|
|
79
|
+
PanelTitle.propTypes = propTypes;
|
|
80
|
+
PanelTitle.defaultProps = defaultProps;
|
|
81
|
+
PanelTitle.contextTypes = contextTypes;
|
|
82
|
+
|
|
83
|
+
export default bsClass('panel', PanelTitle);
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
|
2
|
+
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
|
3
|
+
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
4
|
+
import _inherits from 'babel-runtime/helpers/inherits';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
import elementType from 'react-prop-types/lib/elementType';
|
|
9
|
+
import SafeAnchor from './SafeAnchor';
|
|
10
|
+
import createChainedFunction from './utils/createChainedFunction';
|
|
11
|
+
|
|
12
|
+
var propTypes = {
|
|
13
|
+
/**
|
|
14
|
+
* only here to satisfy linting, just the html onClick handler.
|
|
15
|
+
*
|
|
16
|
+
* @private
|
|
17
|
+
*/
|
|
18
|
+
onClick: PropTypes.func,
|
|
19
|
+
/**
|
|
20
|
+
* You can use a custom element for this component
|
|
21
|
+
*/
|
|
22
|
+
componentClass: elementType
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var defaultProps = {
|
|
26
|
+
componentClass: SafeAnchor
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var contextTypes = {
|
|
30
|
+
$bs_panel: PropTypes.shape({
|
|
31
|
+
bodyId: PropTypes.string,
|
|
32
|
+
onToggle: PropTypes.func,
|
|
33
|
+
expanded: PropTypes.bool
|
|
34
|
+
})
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var PanelToggle = function (_React$Component) {
|
|
38
|
+
_inherits(PanelToggle, _React$Component);
|
|
39
|
+
|
|
40
|
+
function PanelToggle() {
|
|
41
|
+
_classCallCheck(this, PanelToggle);
|
|
42
|
+
|
|
43
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
44
|
+
args[_key] = arguments[_key];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
var _this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args)));
|
|
48
|
+
|
|
49
|
+
_this.handleToggle = _this.handleToggle.bind(_this);
|
|
50
|
+
return _this;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
PanelToggle.prototype.handleToggle = function handleToggle(event) {
|
|
54
|
+
var _ref = this.context.$bs_panel || {},
|
|
55
|
+
onToggle = _ref.onToggle;
|
|
56
|
+
|
|
57
|
+
if (onToggle) {
|
|
58
|
+
onToggle(event);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
PanelToggle.prototype.render = function render() {
|
|
63
|
+
var _props = this.props,
|
|
64
|
+
onClick = _props.onClick,
|
|
65
|
+
className = _props.className,
|
|
66
|
+
componentClass = _props.componentClass,
|
|
67
|
+
props = _objectWithoutProperties(_props, ['onClick', 'className', 'componentClass']);
|
|
68
|
+
|
|
69
|
+
var _ref2 = this.context.$bs_panel || {},
|
|
70
|
+
expanded = _ref2.expanded,
|
|
71
|
+
bodyId = _ref2.bodyId;
|
|
72
|
+
|
|
73
|
+
var Component = componentClass;
|
|
74
|
+
|
|
75
|
+
props.onClick = createChainedFunction(onClick, this.handleToggle);
|
|
76
|
+
|
|
77
|
+
props['aria-expanded'] = expanded;
|
|
78
|
+
props.className = classNames(className, !expanded && 'collapsed');
|
|
79
|
+
|
|
80
|
+
if (bodyId) {
|
|
81
|
+
props['aria-controls'] = bodyId;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return React.createElement(Component, props);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
return PanelToggle;
|
|
88
|
+
}(React.Component);
|
|
89
|
+
|
|
90
|
+
PanelToggle.propTypes = propTypes;
|
|
91
|
+
PanelToggle.defaultProps = defaultProps;
|
|
92
|
+
PanelToggle.contextTypes = contextTypes;
|
|
93
|
+
|
|
94
|
+
export default PanelToggle;
|
package/es/ProgressBar.js
CHANGED
|
@@ -30,10 +30,8 @@ function onlyProgressBar(props, propName, componentName) {
|
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
33
|
+
// eslint-disable-next-line no-use-before-define
|
|
34
|
+
if (child.type === ProgressBar) return;
|
|
37
35
|
|
|
38
36
|
var childIdentifier = React.isValidElement(child) ? child.type.displayName || child.type.name || child.type : child;
|
|
39
37
|
error = new Error('Children of ' + componentName + ' can contain only ProgressBar ' + ('components. Found ' + childIdentifier + '.'));
|
|
@@ -145,13 +143,19 @@ var ProgressBar = function (_React$Component) {
|
|
|
145
143
|
|
|
146
144
|
return React.createElement(
|
|
147
145
|
'div',
|
|
148
|
-
_extends({}, wrapperProps, {
|
|
149
|
-
className: classNames(className, 'progress')
|
|
150
|
-
}),
|
|
146
|
+
_extends({}, wrapperProps, { className: classNames(className, 'progress') }),
|
|
151
147
|
children ? ValidComponentChildren.map(children, function (child) {
|
|
152
148
|
return cloneElement(child, { isChild: true });
|
|
153
149
|
}) : this.renderProgressBar({
|
|
154
|
-
min: min,
|
|
150
|
+
min: min,
|
|
151
|
+
now: now,
|
|
152
|
+
max: max,
|
|
153
|
+
label: label,
|
|
154
|
+
srOnly: srOnly,
|
|
155
|
+
striped: striped,
|
|
156
|
+
active: active,
|
|
157
|
+
bsClass: bsClass,
|
|
158
|
+
bsStyle: bsStyle
|
|
155
159
|
})
|
|
156
160
|
);
|
|
157
161
|
};
|
package/es/Radio.js
CHANGED
|
@@ -3,6 +3,8 @@ import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutPropert
|
|
|
3
3
|
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
|
4
4
|
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
5
5
|
import _inherits from 'babel-runtime/helpers/inherits';
|
|
6
|
+
/* eslint-disable jsx-a11y/label-has-for */
|
|
7
|
+
|
|
6
8
|
import classNames from 'classnames';
|
|
7
9
|
import React from 'react';
|
|
8
10
|
import PropTypes from 'prop-types';
|
|
@@ -76,7 +78,11 @@ var Radio = function (_React$Component) {
|
|
|
76
78
|
|
|
77
79
|
return React.createElement(
|
|
78
80
|
'label',
|
|
79
|
-
{
|
|
81
|
+
{
|
|
82
|
+
className: classNames(className, _classes),
|
|
83
|
+
style: style,
|
|
84
|
+
title: title
|
|
85
|
+
},
|
|
80
86
|
input,
|
|
81
87
|
children
|
|
82
88
|
);
|
package/es/Row.js
CHANGED
|
@@ -38,9 +38,7 @@ var Row = function (_React$Component) {
|
|
|
38
38
|
|
|
39
39
|
var classes = getClassSet(bsProps);
|
|
40
40
|
|
|
41
|
-
return React.createElement(Component, _extends({}, elementProps, {
|
|
42
|
-
className: classNames(className, classes)
|
|
43
|
-
}));
|
|
41
|
+
return React.createElement(Component, _extends({}, elementProps, { className: classNames(className, classes) }));
|
|
44
42
|
};
|
|
45
43
|
|
|
46
44
|
return Row;
|
package/es/SplitButton.js
CHANGED
|
@@ -58,10 +58,7 @@ var SplitButton = function (_React$Component) {
|
|
|
58
58
|
|
|
59
59
|
return React.createElement(
|
|
60
60
|
Dropdown,
|
|
61
|
-
_extends({}, dropdownProps, {
|
|
62
|
-
bsSize: bsSize,
|
|
63
|
-
bsStyle: bsStyle
|
|
64
|
-
}),
|
|
61
|
+
_extends({}, dropdownProps, { bsSize: bsSize, bsStyle: bsStyle }),
|
|
65
62
|
React.createElement(
|
|
66
63
|
Button,
|
|
67
64
|
_extends({}, buttonProps, {
|
package/es/SplitToggle.js
CHANGED
|
@@ -16,10 +16,7 @@ var SplitToggle = function (_React$Component) {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
SplitToggle.prototype.render = function render() {
|
|
19
|
-
return React.createElement(DropdownToggle, _extends({}, this.props, {
|
|
20
|
-
useAnchor: false,
|
|
21
|
-
noCaret: false
|
|
22
|
-
}));
|
|
19
|
+
return React.createElement(DropdownToggle, _extends({}, this.props, { useAnchor: false, noCaret: false }));
|
|
23
20
|
};
|
|
24
21
|
|
|
25
22
|
return SplitToggle;
|
package/es/TabContent.js
CHANGED
|
@@ -15,8 +15,8 @@ var propTypes = {
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Sets a default animation strategy for all children `<TabPane>`s. Use
|
|
18
|
-
* `false` to disable, `true` to enable the default `<Fade>` animation or
|
|
19
|
-
* `<Transition
|
|
18
|
+
* `false` to disable, `true` to enable the default `<Fade>` animation or
|
|
19
|
+
* a react-transition-group v2 `<Transition/>` component.
|
|
20
20
|
*/
|
|
21
21
|
animation: PropTypes.oneOfType([PropTypes.bool, elementType]),
|
|
22
22
|
|
|
@@ -116,6 +116,11 @@ var TabContent = function (_React$Component) {
|
|
|
116
116
|
this.isUnmounted = true;
|
|
117
117
|
};
|
|
118
118
|
|
|
119
|
+
TabContent.prototype.getContainerActiveKey = function getContainerActiveKey() {
|
|
120
|
+
var tabContainer = this.context.$bs_tabContainer;
|
|
121
|
+
return tabContainer && tabContainer.activeKey;
|
|
122
|
+
};
|
|
123
|
+
|
|
119
124
|
TabContent.prototype.handlePaneEnter = function handlePaneEnter(child, childKey) {
|
|
120
125
|
if (!this.props.animation) {
|
|
121
126
|
return false;
|
|
@@ -154,11 +159,6 @@ var TabContent = function (_React$Component) {
|
|
|
154
159
|
});
|
|
155
160
|
};
|
|
156
161
|
|
|
157
|
-
TabContent.prototype.getContainerActiveKey = function getContainerActiveKey() {
|
|
158
|
-
var tabContainer = this.context.$bs_tabContainer;
|
|
159
|
-
return tabContainer && tabContainer.activeKey;
|
|
160
|
-
};
|
|
161
|
-
|
|
162
162
|
TabContent.prototype.render = function render() {
|
|
163
163
|
var _props2 = this.props,
|
|
164
164
|
Component = _props2.componentClass,
|
package/es/TabPane.js
CHANGED
|
@@ -22,15 +22,15 @@ var propTypes = {
|
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Use animation when showing or hiding `<TabPane>`s. Use `false` to disable,
|
|
25
|
-
* `true` to enable the default `<Fade>` animation or
|
|
26
|
-
* component.
|
|
25
|
+
* `true` to enable the default `<Fade>` animation or
|
|
26
|
+
* a react-transition-group v2 `<Transition/>` component.
|
|
27
27
|
*/
|
|
28
28
|
animation: PropTypes.oneOfType([PropTypes.bool, elementType]),
|
|
29
29
|
|
|
30
|
-
/** @private
|
|
30
|
+
/** @private * */
|
|
31
31
|
id: PropTypes.string,
|
|
32
32
|
|
|
33
|
-
/** @private
|
|
33
|
+
/** @private * */
|
|
34
34
|
'aria-labelledby': PropTypes.string,
|
|
35
35
|
|
|
36
36
|
/**
|
|
@@ -117,7 +117,7 @@ var TabPane = function (_React$Component) {
|
|
|
117
117
|
_this.handleEnter = _this.handleEnter.bind(_this);
|
|
118
118
|
_this.handleExited = _this.handleExited.bind(_this);
|
|
119
119
|
|
|
120
|
-
_this
|
|
120
|
+
_this.in = false;
|
|
121
121
|
return _this;
|
|
122
122
|
}
|
|
123
123
|
|
|
@@ -135,7 +135,7 @@ var TabPane = function (_React$Component) {
|
|
|
135
135
|
};
|
|
136
136
|
|
|
137
137
|
TabPane.prototype.componentDidUpdate = function componentDidUpdate() {
|
|
138
|
-
if (this
|
|
138
|
+
if (this.in) {
|
|
139
139
|
if (!this.shouldBeIn()) {
|
|
140
140
|
// We shouldn't be active any more. Notify the parent.
|
|
141
141
|
this.handleExited();
|
|
@@ -147,19 +147,28 @@ var TabPane = function (_React$Component) {
|
|
|
147
147
|
};
|
|
148
148
|
|
|
149
149
|
TabPane.prototype.componentWillUnmount = function componentWillUnmount() {
|
|
150
|
-
if (this
|
|
150
|
+
if (this.in) {
|
|
151
151
|
// In lieu of the action event firing.
|
|
152
152
|
this.handleExited();
|
|
153
153
|
}
|
|
154
154
|
};
|
|
155
155
|
|
|
156
|
+
TabPane.prototype.getAnimation = function getAnimation() {
|
|
157
|
+
if (this.props.animation != null) {
|
|
158
|
+
return this.props.animation;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
var tabContent = this.context.$bs_tabContent;
|
|
162
|
+
return tabContent && tabContent.animation;
|
|
163
|
+
};
|
|
164
|
+
|
|
156
165
|
TabPane.prototype.handleEnter = function handleEnter() {
|
|
157
166
|
var tabContent = this.context.$bs_tabContent;
|
|
158
167
|
if (!tabContent) {
|
|
159
168
|
return;
|
|
160
169
|
}
|
|
161
170
|
|
|
162
|
-
this
|
|
171
|
+
this.in = tabContent.onPaneEnter(this, this.props.eventKey);
|
|
163
172
|
};
|
|
164
173
|
|
|
165
174
|
TabPane.prototype.handleExited = function handleExited() {
|
|
@@ -169,16 +178,7 @@ var TabPane = function (_React$Component) {
|
|
|
169
178
|
}
|
|
170
179
|
|
|
171
180
|
tabContent.onPaneExited(this);
|
|
172
|
-
this
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
TabPane.prototype.getAnimation = function getAnimation() {
|
|
176
|
-
if (this.props.animation != null) {
|
|
177
|
-
return this.props.animation;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
var tabContent = this.context.$bs_tabContent;
|
|
181
|
-
return tabContent && tabContent.animation;
|
|
181
|
+
this.in = false;
|
|
182
182
|
};
|
|
183
183
|
|
|
184
184
|
TabPane.prototype.isActive = function isActive() {
|
package/es/Table.js
CHANGED
|
@@ -52,9 +52,7 @@ var Table = function (_React$Component) {
|
|
|
52
52
|
|
|
53
53
|
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
54
|
|
|
55
|
-
var table = React.createElement('table', _extends({}, elementProps, {
|
|
56
|
-
className: classNames(className, classes)
|
|
57
|
-
}));
|
|
55
|
+
var table = React.createElement('table', _extends({}, elementProps, { className: classNames(className, classes) }));
|
|
58
56
|
|
|
59
57
|
if (responsive) {
|
|
60
58
|
return React.createElement(
|