react-bootstrap 0.30.6 → 0.30.10
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 +64 -0
- package/LICENSE +2 -2
- package/dist/react-bootstrap.js +3161 -1664
- package/dist/react-bootstrap.min.js +9 -9
- package/dist/react-bootstrap.min.js.map +1 -1
- package/es/Alert.js +3 -2
- package/es/Badge.js +2 -1
- package/es/BreadcrumbItem.js +5 -4
- package/es/Button.js +7 -6
- package/es/ButtonGroup.js +4 -3
- package/es/Carousel.js +17 -16
- package/es/CarouselItem.js +7 -6
- package/es/Checkbox.js +5 -4
- package/es/Clearfix.js +5 -4
- package/es/Col.js +21 -20
- package/es/Collapse.js +20 -13
- package/es/ControlLabel.js +4 -3
- package/es/Dropdown.js +34 -22
- package/es/DropdownButton.js +6 -5
- package/es/DropdownMenu.js +19 -14
- package/es/DropdownToggle.js +5 -4
- package/es/Fade.js +17 -10
- package/es/Form.js +3 -2
- package/es/FormControl.js +27 -6
- package/es/FormControlFeedback.js +2 -1
- package/es/FormGroup.js +4 -3
- package/es/Glyphicon.js +3 -2
- package/es/Grid.js +2 -1
- package/es/Image.js +5 -4
- package/es/ListGroupItem.js +8 -7
- package/es/MediaLeft.js +2 -1
- package/es/MediaRight.js +2 -1
- package/es/MenuItem.js +9 -8
- package/es/Modal.js +22 -15
- package/es/ModalBody.js +15 -2
- package/es/ModalDialog.js +2 -1
- package/es/ModalFooter.js +15 -2
- package/es/ModalHeader.js +7 -6
- package/es/ModalTitle.js +15 -2
- package/es/Nav.js +20 -19
- package/es/NavDropdown.js +5 -4
- package/es/NavItem.js +8 -7
- package/es/Navbar.js +17 -15
- package/es/NavbarBrand.js +3 -2
- package/es/NavbarCollapse.js +2 -1
- package/es/NavbarHeader.js +3 -2
- package/es/NavbarToggle.js +2 -1
- package/es/Overlay.js +18 -11
- package/es/OverlayTrigger.js +20 -18
- package/es/Pager.js +2 -1
- package/es/PagerItem.js +7 -6
- package/es/Pagination.js +54 -60
- package/es/PaginationButton.js +7 -6
- package/es/Panel.js +17 -20
- package/es/PanelGroup.js +6 -5
- package/es/Popover.js +8 -7
- package/es/ProgressBar.js +2 -1
- package/es/Radio.js +5 -4
- package/es/ResponsiveEmbed.js +2 -1
- package/es/SafeAnchor.js +6 -5
- package/es/SplitButton.js +8 -7
- package/es/Tab.js +4 -3
- package/es/TabContainer.js +3 -2
- package/es/TabContent.js +12 -2
- package/es/TabPane.js +15 -5
- package/es/Table.js +6 -5
- package/es/Tabs.js +16 -7
- package/es/Thumbnail.js +4 -3
- package/es/Tooltip.js +7 -6
- package/es/index.js +2 -0
- package/es/utils/bootstrapUtils.js +1 -1
- package/lib/Alert.js +6 -2
- package/lib/Badge.js +5 -1
- package/lib/BreadcrumbItem.js +8 -4
- package/lib/Button.js +10 -6
- package/lib/ButtonGroup.js +7 -3
- package/lib/Carousel.js +20 -16
- package/lib/CarouselItem.js +10 -6
- package/lib/Checkbox.js +8 -4
- package/lib/Clearfix.js +8 -4
- package/lib/Col.js +24 -20
- package/lib/Collapse.js +23 -13
- package/lib/ControlLabel.js +7 -3
- package/lib/Dropdown.js +37 -22
- package/lib/DropdownButton.js +9 -5
- package/lib/DropdownMenu.js +21 -13
- package/lib/DropdownToggle.js +8 -4
- package/lib/Fade.js +20 -10
- package/lib/Form.js +6 -2
- package/lib/FormControl.js +29 -5
- package/lib/FormControlFeedback.js +5 -1
- package/lib/FormGroup.js +7 -3
- package/lib/Glyphicon.js +6 -2
- package/lib/Grid.js +5 -1
- package/lib/Image.js +8 -4
- package/lib/ListGroupItem.js +11 -7
- package/lib/MediaLeft.js +5 -1
- package/lib/MediaRight.js +5 -1
- package/lib/MenuItem.js +12 -8
- package/lib/Modal.js +25 -15
- package/lib/ModalBody.js +18 -2
- package/lib/ModalDialog.js +5 -1
- package/lib/ModalFooter.js +18 -2
- package/lib/ModalHeader.js +10 -6
- package/lib/ModalTitle.js +18 -2
- package/lib/Nav.js +23 -19
- package/lib/NavDropdown.js +8 -4
- package/lib/NavItem.js +11 -7
- package/lib/Navbar.js +27 -25
- package/lib/NavbarBrand.js +6 -2
- package/lib/NavbarCollapse.js +7 -3
- package/lib/NavbarHeader.js +6 -2
- package/lib/NavbarToggle.js +10 -6
- package/lib/Overlay.js +21 -11
- package/lib/OverlayTrigger.js +23 -18
- package/lib/Pager.js +5 -1
- package/lib/PagerItem.js +10 -6
- package/lib/Pagination.js +58 -61
- package/lib/PaginationButton.js +10 -6
- package/lib/Panel.js +20 -20
- package/lib/PanelGroup.js +9 -5
- package/lib/Popover.js +11 -7
- package/lib/ProgressBar.js +12 -8
- package/lib/Radio.js +8 -4
- package/lib/ResponsiveEmbed.js +7 -3
- package/lib/SafeAnchor.js +9 -5
- package/lib/SplitButton.js +11 -7
- package/lib/Tab.js +7 -3
- package/lib/TabContainer.js +13 -9
- package/lib/TabContent.js +26 -13
- package/lib/TabPane.js +38 -25
- package/lib/Table.js +9 -5
- package/lib/Tabs.js +19 -7
- package/lib/Thumbnail.js +7 -3
- package/lib/Tooltip.js +10 -6
- package/lib/index.js +6 -1
- package/lib/utils/bootstrapUtils.js +6 -4
- package/package.json +10 -8
package/lib/CarouselItem.js
CHANGED
|
@@ -30,6 +30,10 @@ var _react = require('react');
|
|
|
30
30
|
|
|
31
31
|
var _react2 = _interopRequireDefault(_react);
|
|
32
32
|
|
|
33
|
+
var _propTypes = require('prop-types');
|
|
34
|
+
|
|
35
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
36
|
+
|
|
33
37
|
var _reactDom = require('react-dom');
|
|
34
38
|
|
|
35
39
|
var _reactDom2 = _interopRequireDefault(_reactDom);
|
|
@@ -44,12 +48,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'd
|
|
|
44
48
|
// not wait until transition end to trigger continuing animations.
|
|
45
49
|
|
|
46
50
|
var propTypes = {
|
|
47
|
-
direction:
|
|
48
|
-
onAnimateOutEnd:
|
|
49
|
-
active:
|
|
50
|
-
animateIn:
|
|
51
|
-
animateOut:
|
|
52
|
-
index:
|
|
51
|
+
direction: _propTypes2['default'].oneOf(['prev', 'next']),
|
|
52
|
+
onAnimateOutEnd: _propTypes2['default'].func,
|
|
53
|
+
active: _propTypes2['default'].bool,
|
|
54
|
+
animateIn: _propTypes2['default'].bool,
|
|
55
|
+
animateOut: _propTypes2['default'].bool,
|
|
56
|
+
index: _propTypes2['default'].number
|
|
53
57
|
};
|
|
54
58
|
|
|
55
59
|
var defaultProps = {
|
package/lib/Checkbox.js
CHANGED
|
@@ -30,6 +30,10 @@ var _react = require('react');
|
|
|
30
30
|
|
|
31
31
|
var _react2 = _interopRequireDefault(_react);
|
|
32
32
|
|
|
33
|
+
var _propTypes = require('prop-types');
|
|
34
|
+
|
|
35
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
36
|
+
|
|
33
37
|
var _warning = require('warning');
|
|
34
38
|
|
|
35
39
|
var _warning2 = _interopRequireDefault(_warning);
|
|
@@ -39,12 +43,12 @@ var _bootstrapUtils = require('./utils/bootstrapUtils');
|
|
|
39
43
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
40
44
|
|
|
41
45
|
var propTypes = {
|
|
42
|
-
inline:
|
|
43
|
-
disabled:
|
|
46
|
+
inline: _propTypes2['default'].bool,
|
|
47
|
+
disabled: _propTypes2['default'].bool,
|
|
44
48
|
/**
|
|
45
49
|
* Only valid if `inline` is not set.
|
|
46
50
|
*/
|
|
47
|
-
validationState:
|
|
51
|
+
validationState: _propTypes2['default'].oneOf(['success', 'warning', 'error', null]),
|
|
48
52
|
/**
|
|
49
53
|
* Attaches a ref to the `<input>` element. Only functions can be used here.
|
|
50
54
|
*
|
|
@@ -52,7 +56,7 @@ var propTypes = {
|
|
|
52
56
|
* <Checkbox inputRef={ref => { this.input = ref; }} />
|
|
53
57
|
* ```
|
|
54
58
|
*/
|
|
55
|
-
inputRef:
|
|
59
|
+
inputRef: _propTypes2['default'].func
|
|
56
60
|
};
|
|
57
61
|
|
|
58
62
|
var defaultProps = {
|
package/lib/Clearfix.js
CHANGED
|
@@ -30,6 +30,10 @@ var _react = require('react');
|
|
|
30
30
|
|
|
31
31
|
var _react2 = _interopRequireDefault(_react);
|
|
32
32
|
|
|
33
|
+
var _propTypes = require('prop-types');
|
|
34
|
+
|
|
35
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
36
|
+
|
|
33
37
|
var _elementType = require('react-prop-types/lib/elementType');
|
|
34
38
|
|
|
35
39
|
var _elementType2 = _interopRequireDefault(_elementType);
|
|
@@ -54,7 +58,7 @@ var propTypes = {
|
|
|
54
58
|
*
|
|
55
59
|
* adds class `visible-xs-block`
|
|
56
60
|
*/
|
|
57
|
-
visibleXsBlock:
|
|
61
|
+
visibleXsBlock: _propTypes2['default'].bool,
|
|
58
62
|
/**
|
|
59
63
|
* Apply clearfix
|
|
60
64
|
*
|
|
@@ -62,7 +66,7 @@ var propTypes = {
|
|
|
62
66
|
*
|
|
63
67
|
* adds class `visible-sm-block`
|
|
64
68
|
*/
|
|
65
|
-
visibleSmBlock:
|
|
69
|
+
visibleSmBlock: _propTypes2['default'].bool,
|
|
66
70
|
/**
|
|
67
71
|
* Apply clearfix
|
|
68
72
|
*
|
|
@@ -70,7 +74,7 @@ var propTypes = {
|
|
|
70
74
|
*
|
|
71
75
|
* adds class `visible-md-block`
|
|
72
76
|
*/
|
|
73
|
-
visibleMdBlock:
|
|
77
|
+
visibleMdBlock: _propTypes2['default'].bool,
|
|
74
78
|
/**
|
|
75
79
|
* Apply clearfix
|
|
76
80
|
*
|
|
@@ -78,7 +82,7 @@ var propTypes = {
|
|
|
78
82
|
*
|
|
79
83
|
* adds class `visible-lg-block`
|
|
80
84
|
*/
|
|
81
|
-
visibleLgBlock:
|
|
85
|
+
visibleLgBlock: _propTypes2['default'].bool
|
|
82
86
|
};
|
|
83
87
|
|
|
84
88
|
var defaultProps = {
|
package/lib/Col.js
CHANGED
|
@@ -30,6 +30,10 @@ var _react = require('react');
|
|
|
30
30
|
|
|
31
31
|
var _react2 = _interopRequireDefault(_react);
|
|
32
32
|
|
|
33
|
+
var _propTypes = require('prop-types');
|
|
34
|
+
|
|
35
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
36
|
+
|
|
33
37
|
var _elementType = require('react-prop-types/lib/elementType');
|
|
34
38
|
|
|
35
39
|
var _elementType2 = _interopRequireDefault(_elementType);
|
|
@@ -50,7 +54,7 @@ var propTypes = {
|
|
|
50
54
|
*
|
|
51
55
|
* class-prefix `col-xs-`
|
|
52
56
|
*/
|
|
53
|
-
xs:
|
|
57
|
+
xs: _propTypes2['default'].number,
|
|
54
58
|
/**
|
|
55
59
|
* The number of columns you wish to span
|
|
56
60
|
*
|
|
@@ -58,7 +62,7 @@ var propTypes = {
|
|
|
58
62
|
*
|
|
59
63
|
* class-prefix `col-sm-`
|
|
60
64
|
*/
|
|
61
|
-
sm:
|
|
65
|
+
sm: _propTypes2['default'].number,
|
|
62
66
|
/**
|
|
63
67
|
* The number of columns you wish to span
|
|
64
68
|
*
|
|
@@ -66,7 +70,7 @@ var propTypes = {
|
|
|
66
70
|
*
|
|
67
71
|
* class-prefix `col-md-`
|
|
68
72
|
*/
|
|
69
|
-
md:
|
|
73
|
+
md: _propTypes2['default'].number,
|
|
70
74
|
/**
|
|
71
75
|
* The number of columns you wish to span
|
|
72
76
|
*
|
|
@@ -74,7 +78,7 @@ var propTypes = {
|
|
|
74
78
|
*
|
|
75
79
|
* class-prefix `col-lg-`
|
|
76
80
|
*/
|
|
77
|
-
lg:
|
|
81
|
+
lg: _propTypes2['default'].number,
|
|
78
82
|
/**
|
|
79
83
|
* Hide column
|
|
80
84
|
*
|
|
@@ -82,7 +86,7 @@ var propTypes = {
|
|
|
82
86
|
*
|
|
83
87
|
* adds class `hidden-xs`
|
|
84
88
|
*/
|
|
85
|
-
xsHidden:
|
|
89
|
+
xsHidden: _propTypes2['default'].bool,
|
|
86
90
|
/**
|
|
87
91
|
* Hide column
|
|
88
92
|
*
|
|
@@ -90,7 +94,7 @@ var propTypes = {
|
|
|
90
94
|
*
|
|
91
95
|
* adds class `hidden-sm`
|
|
92
96
|
*/
|
|
93
|
-
smHidden:
|
|
97
|
+
smHidden: _propTypes2['default'].bool,
|
|
94
98
|
/**
|
|
95
99
|
* Hide column
|
|
96
100
|
*
|
|
@@ -98,7 +102,7 @@ var propTypes = {
|
|
|
98
102
|
*
|
|
99
103
|
* adds class `hidden-md`
|
|
100
104
|
*/
|
|
101
|
-
mdHidden:
|
|
105
|
+
mdHidden: _propTypes2['default'].bool,
|
|
102
106
|
/**
|
|
103
107
|
* Hide column
|
|
104
108
|
*
|
|
@@ -106,7 +110,7 @@ var propTypes = {
|
|
|
106
110
|
*
|
|
107
111
|
* adds class `hidden-lg`
|
|
108
112
|
*/
|
|
109
|
-
lgHidden:
|
|
113
|
+
lgHidden: _propTypes2['default'].bool,
|
|
110
114
|
/**
|
|
111
115
|
* Move columns to the right
|
|
112
116
|
*
|
|
@@ -114,7 +118,7 @@ var propTypes = {
|
|
|
114
118
|
*
|
|
115
119
|
* class-prefix `col-xs-offset-`
|
|
116
120
|
*/
|
|
117
|
-
xsOffset:
|
|
121
|
+
xsOffset: _propTypes2['default'].number,
|
|
118
122
|
/**
|
|
119
123
|
* Move columns to the right
|
|
120
124
|
*
|
|
@@ -122,7 +126,7 @@ var propTypes = {
|
|
|
122
126
|
*
|
|
123
127
|
* class-prefix `col-sm-offset-`
|
|
124
128
|
*/
|
|
125
|
-
smOffset:
|
|
129
|
+
smOffset: _propTypes2['default'].number,
|
|
126
130
|
/**
|
|
127
131
|
* Move columns to the right
|
|
128
132
|
*
|
|
@@ -130,7 +134,7 @@ var propTypes = {
|
|
|
130
134
|
*
|
|
131
135
|
* class-prefix `col-md-offset-`
|
|
132
136
|
*/
|
|
133
|
-
mdOffset:
|
|
137
|
+
mdOffset: _propTypes2['default'].number,
|
|
134
138
|
/**
|
|
135
139
|
* Move columns to the right
|
|
136
140
|
*
|
|
@@ -138,7 +142,7 @@ var propTypes = {
|
|
|
138
142
|
*
|
|
139
143
|
* class-prefix `col-lg-offset-`
|
|
140
144
|
*/
|
|
141
|
-
lgOffset:
|
|
145
|
+
lgOffset: _propTypes2['default'].number,
|
|
142
146
|
/**
|
|
143
147
|
* Change the order of grid columns to the right
|
|
144
148
|
*
|
|
@@ -146,7 +150,7 @@ var propTypes = {
|
|
|
146
150
|
*
|
|
147
151
|
* class-prefix `col-xs-push-`
|
|
148
152
|
*/
|
|
149
|
-
xsPush:
|
|
153
|
+
xsPush: _propTypes2['default'].number,
|
|
150
154
|
/**
|
|
151
155
|
* Change the order of grid columns to the right
|
|
152
156
|
*
|
|
@@ -154,7 +158,7 @@ var propTypes = {
|
|
|
154
158
|
*
|
|
155
159
|
* class-prefix `col-sm-push-`
|
|
156
160
|
*/
|
|
157
|
-
smPush:
|
|
161
|
+
smPush: _propTypes2['default'].number,
|
|
158
162
|
/**
|
|
159
163
|
* Change the order of grid columns to the right
|
|
160
164
|
*
|
|
@@ -162,7 +166,7 @@ var propTypes = {
|
|
|
162
166
|
*
|
|
163
167
|
* class-prefix `col-md-push-`
|
|
164
168
|
*/
|
|
165
|
-
mdPush:
|
|
169
|
+
mdPush: _propTypes2['default'].number,
|
|
166
170
|
/**
|
|
167
171
|
* Change the order of grid columns to the right
|
|
168
172
|
*
|
|
@@ -170,7 +174,7 @@ var propTypes = {
|
|
|
170
174
|
*
|
|
171
175
|
* class-prefix `col-lg-push-`
|
|
172
176
|
*/
|
|
173
|
-
lgPush:
|
|
177
|
+
lgPush: _propTypes2['default'].number,
|
|
174
178
|
/**
|
|
175
179
|
* Change the order of grid columns to the left
|
|
176
180
|
*
|
|
@@ -178,7 +182,7 @@ var propTypes = {
|
|
|
178
182
|
*
|
|
179
183
|
* class-prefix `col-xs-pull-`
|
|
180
184
|
*/
|
|
181
|
-
xsPull:
|
|
185
|
+
xsPull: _propTypes2['default'].number,
|
|
182
186
|
/**
|
|
183
187
|
* Change the order of grid columns to the left
|
|
184
188
|
*
|
|
@@ -186,7 +190,7 @@ var propTypes = {
|
|
|
186
190
|
*
|
|
187
191
|
* class-prefix `col-sm-pull-`
|
|
188
192
|
*/
|
|
189
|
-
smPull:
|
|
193
|
+
smPull: _propTypes2['default'].number,
|
|
190
194
|
/**
|
|
191
195
|
* Change the order of grid columns to the left
|
|
192
196
|
*
|
|
@@ -194,7 +198,7 @@ var propTypes = {
|
|
|
194
198
|
*
|
|
195
199
|
* class-prefix `col-md-pull-`
|
|
196
200
|
*/
|
|
197
|
-
mdPull:
|
|
201
|
+
mdPull: _propTypes2['default'].number,
|
|
198
202
|
/**
|
|
199
203
|
* Change the order of grid columns to the left
|
|
200
204
|
*
|
|
@@ -202,7 +206,7 @@ var propTypes = {
|
|
|
202
206
|
*
|
|
203
207
|
* class-prefix `col-lg-pull-`
|
|
204
208
|
*/
|
|
205
|
-
lgPull:
|
|
209
|
+
lgPull: _propTypes2['default'].number
|
|
206
210
|
};
|
|
207
211
|
|
|
208
212
|
var defaultProps = {
|
package/lib/Collapse.js
CHANGED
|
@@ -34,6 +34,10 @@ var _react = require('react');
|
|
|
34
34
|
|
|
35
35
|
var _react2 = _interopRequireDefault(_react);
|
|
36
36
|
|
|
37
|
+
var _propTypes = require('prop-types');
|
|
38
|
+
|
|
39
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
40
|
+
|
|
37
41
|
var _Transition = require('react-overlays/lib/Transition');
|
|
38
42
|
|
|
39
43
|
var _Transition2 = _interopRequireDefault(_Transition);
|
|
@@ -70,50 +74,55 @@ var propTypes = {
|
|
|
70
74
|
/**
|
|
71
75
|
* Show the component; triggers the expand or collapse animation
|
|
72
76
|
*/
|
|
73
|
-
'in':
|
|
77
|
+
'in': _propTypes2['default'].bool,
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Wait until the first "enter" transition to mount the component (add it to the DOM)
|
|
81
|
+
*/
|
|
82
|
+
mountOnEnter: _propTypes2['default'].bool,
|
|
74
83
|
|
|
75
84
|
/**
|
|
76
85
|
* Unmount the component (remove it from the DOM) when it is collapsed
|
|
77
86
|
*/
|
|
78
|
-
unmountOnExit:
|
|
87
|
+
unmountOnExit: _propTypes2['default'].bool,
|
|
79
88
|
|
|
80
89
|
/**
|
|
81
90
|
* Run the expand animation when the component mounts, if it is initially
|
|
82
91
|
* shown
|
|
83
92
|
*/
|
|
84
|
-
transitionAppear:
|
|
93
|
+
transitionAppear: _propTypes2['default'].bool,
|
|
85
94
|
|
|
86
95
|
/**
|
|
87
96
|
* Duration of the collapse animation in milliseconds, to ensure that
|
|
88
97
|
* finishing callbacks are fired even if the original browser transition end
|
|
89
98
|
* events are canceled
|
|
90
99
|
*/
|
|
91
|
-
timeout:
|
|
100
|
+
timeout: _propTypes2['default'].number,
|
|
92
101
|
|
|
93
102
|
/**
|
|
94
103
|
* Callback fired before the component expands
|
|
95
104
|
*/
|
|
96
|
-
onEnter:
|
|
105
|
+
onEnter: _propTypes2['default'].func,
|
|
97
106
|
/**
|
|
98
107
|
* Callback fired after the component starts to expand
|
|
99
108
|
*/
|
|
100
|
-
onEntering:
|
|
109
|
+
onEntering: _propTypes2['default'].func,
|
|
101
110
|
/**
|
|
102
111
|
* Callback fired after the component has expanded
|
|
103
112
|
*/
|
|
104
|
-
onEntered:
|
|
113
|
+
onEntered: _propTypes2['default'].func,
|
|
105
114
|
/**
|
|
106
115
|
* Callback fired before the component collapses
|
|
107
116
|
*/
|
|
108
|
-
onExit:
|
|
117
|
+
onExit: _propTypes2['default'].func,
|
|
109
118
|
/**
|
|
110
119
|
* Callback fired after the component starts to collapse
|
|
111
120
|
*/
|
|
112
|
-
onExiting:
|
|
121
|
+
onExiting: _propTypes2['default'].func,
|
|
113
122
|
/**
|
|
114
123
|
* Callback fired after the component has collapsed
|
|
115
124
|
*/
|
|
116
|
-
onExited:
|
|
125
|
+
onExited: _propTypes2['default'].func,
|
|
117
126
|
|
|
118
127
|
/**
|
|
119
128
|
* The dimension used when collapsing, or a function that returns the
|
|
@@ -122,7 +131,7 @@ var propTypes = {
|
|
|
122
131
|
* _Note: Bootstrap only partially supports 'width'!
|
|
123
132
|
* You will need to supply your own CSS animation for the `.width` CSS class._
|
|
124
133
|
*/
|
|
125
|
-
dimension:
|
|
134
|
+
dimension: _propTypes2['default'].oneOfType([_propTypes2['default'].oneOf(['height', 'width']), _propTypes2['default'].func]),
|
|
126
135
|
|
|
127
136
|
/**
|
|
128
137
|
* Function that returns the height or width of the animating DOM node
|
|
@@ -131,17 +140,18 @@ var propTypes = {
|
|
|
131
140
|
* should animate in its specified dimension. Called with the current
|
|
132
141
|
* dimension prop value and the DOM node.
|
|
133
142
|
*/
|
|
134
|
-
getDimensionValue:
|
|
143
|
+
getDimensionValue: _propTypes2['default'].func,
|
|
135
144
|
|
|
136
145
|
/**
|
|
137
146
|
* ARIA role of collapsible element
|
|
138
147
|
*/
|
|
139
|
-
role:
|
|
148
|
+
role: _propTypes2['default'].string
|
|
140
149
|
};
|
|
141
150
|
|
|
142
151
|
var defaultProps = {
|
|
143
152
|
'in': false,
|
|
144
153
|
timeout: 300,
|
|
154
|
+
mountOnEnter: false,
|
|
145
155
|
unmountOnExit: false,
|
|
146
156
|
transitionAppear: false,
|
|
147
157
|
|
package/lib/ControlLabel.js
CHANGED
|
@@ -30,6 +30,10 @@ var _react = require('react');
|
|
|
30
30
|
|
|
31
31
|
var _react2 = _interopRequireDefault(_react);
|
|
32
32
|
|
|
33
|
+
var _propTypes = require('prop-types');
|
|
34
|
+
|
|
35
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
36
|
+
|
|
33
37
|
var _warning = require('warning');
|
|
34
38
|
|
|
35
39
|
var _warning2 = _interopRequireDefault(_warning);
|
|
@@ -42,8 +46,8 @@ var propTypes = {
|
|
|
42
46
|
/**
|
|
43
47
|
* Uses `controlId` from `<FormGroup>` if not explicitly specified.
|
|
44
48
|
*/
|
|
45
|
-
htmlFor:
|
|
46
|
-
srOnly:
|
|
49
|
+
htmlFor: _propTypes2['default'].string,
|
|
50
|
+
srOnly: _propTypes2['default'].bool
|
|
47
51
|
};
|
|
48
52
|
|
|
49
53
|
var defaultProps = {
|
|
@@ -51,7 +55,7 @@ var defaultProps = {
|
|
|
51
55
|
};
|
|
52
56
|
|
|
53
57
|
var contextTypes = {
|
|
54
|
-
$bs_formGroup:
|
|
58
|
+
$bs_formGroup: _propTypes2['default'].object
|
|
55
59
|
};
|
|
56
60
|
|
|
57
61
|
var ControlLabel = function (_React$Component) {
|
package/lib/Dropdown.js
CHANGED
|
@@ -42,6 +42,10 @@ var _react = require('react');
|
|
|
42
42
|
|
|
43
43
|
var _react2 = _interopRequireDefault(_react);
|
|
44
44
|
|
|
45
|
+
var _propTypes = require('prop-types');
|
|
46
|
+
|
|
47
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
48
|
+
|
|
45
49
|
var _reactDom = require('react-dom');
|
|
46
50
|
|
|
47
51
|
var _reactDom2 = _interopRequireDefault(_reactDom);
|
|
@@ -99,14 +103,14 @@ var propTypes = {
|
|
|
99
103
|
/**
|
|
100
104
|
* The menu will open above the dropdown button, instead of below it.
|
|
101
105
|
*/
|
|
102
|
-
dropup:
|
|
106
|
+
dropup: _propTypes2['default'].bool,
|
|
103
107
|
|
|
104
108
|
/**
|
|
105
109
|
* An html id attribute, necessary for assistive technologies, such as screen readers.
|
|
106
110
|
* @type {string|number}
|
|
107
111
|
* @required
|
|
108
112
|
*/
|
|
109
|
-
id: (0, _isRequiredForA11y2['default'])(
|
|
113
|
+
id: (0, _isRequiredForA11y2['default'])(_propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].number])),
|
|
110
114
|
|
|
111
115
|
componentClass: _elementType2['default'],
|
|
112
116
|
|
|
@@ -119,35 +123,35 @@ var propTypes = {
|
|
|
119
123
|
/**
|
|
120
124
|
* Whether or not component is disabled.
|
|
121
125
|
*/
|
|
122
|
-
disabled:
|
|
126
|
+
disabled: _propTypes2['default'].bool,
|
|
123
127
|
|
|
124
128
|
/**
|
|
125
129
|
* Align the menu to the right side of the Dropdown toggle
|
|
126
130
|
*/
|
|
127
|
-
pullRight:
|
|
131
|
+
pullRight: _propTypes2['default'].bool,
|
|
128
132
|
|
|
129
133
|
/**
|
|
130
134
|
* Whether or not the Dropdown is visible.
|
|
131
135
|
*
|
|
132
136
|
* @controllable onToggle
|
|
133
137
|
*/
|
|
134
|
-
open:
|
|
138
|
+
open: _propTypes2['default'].bool,
|
|
135
139
|
|
|
136
140
|
/**
|
|
137
141
|
* A callback fired when the Dropdown closes.
|
|
138
142
|
*/
|
|
139
|
-
onClose:
|
|
143
|
+
onClose: _propTypes2['default'].func,
|
|
140
144
|
|
|
141
145
|
/**
|
|
142
146
|
* A callback fired when the Dropdown wishes to change visibility. Called with the requested
|
|
143
|
-
* `open` value
|
|
147
|
+
* `open` value, the DOM event, and the source that fired it: `'click'`,`'keydown'`,`'rootClose'`, or `'select'`.
|
|
144
148
|
*
|
|
145
149
|
* ```js
|
|
146
|
-
* function(Boolean isOpen) {}
|
|
150
|
+
* function(Boolean isOpen, Object event, { String source }) {}
|
|
147
151
|
* ```
|
|
148
152
|
* @controllable open
|
|
149
153
|
*/
|
|
150
|
-
onToggle:
|
|
154
|
+
onToggle: _propTypes2['default'].func,
|
|
151
155
|
|
|
152
156
|
/**
|
|
153
157
|
* A callback fired when a menu item is selected.
|
|
@@ -156,18 +160,27 @@ var propTypes = {
|
|
|
156
160
|
* (eventKey: any, event: Object) => any
|
|
157
161
|
* ```
|
|
158
162
|
*/
|
|
159
|
-
onSelect:
|
|
163
|
+
onSelect: _propTypes2['default'].func,
|
|
160
164
|
|
|
161
165
|
/**
|
|
162
166
|
* If `'menuitem'`, causes the dropdown to behave like a menu item rather than
|
|
163
167
|
* a menu button.
|
|
164
168
|
*/
|
|
165
|
-
role:
|
|
169
|
+
role: _propTypes2['default'].string,
|
|
166
170
|
|
|
167
171
|
/**
|
|
168
172
|
* Which event when fired outside the component will cause it to be closed
|
|
169
173
|
*/
|
|
170
|
-
rootCloseEvent:
|
|
174
|
+
rootCloseEvent: _propTypes2['default'].oneOf(['click', 'mousedown']),
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* @private
|
|
178
|
+
*/
|
|
179
|
+
onMouseEnter: _propTypes2['default'].func,
|
|
180
|
+
/**
|
|
181
|
+
* @private
|
|
182
|
+
*/
|
|
183
|
+
onMouseLeave: _propTypes2['default'].func
|
|
171
184
|
};
|
|
172
185
|
|
|
173
186
|
var defaultProps = {
|
|
@@ -220,12 +233,12 @@ var Dropdown = function (_React$Component) {
|
|
|
220
233
|
}
|
|
221
234
|
};
|
|
222
235
|
|
|
223
|
-
Dropdown.prototype.handleClick = function handleClick() {
|
|
236
|
+
Dropdown.prototype.handleClick = function handleClick(event) {
|
|
224
237
|
if (this.props.disabled) {
|
|
225
238
|
return;
|
|
226
239
|
}
|
|
227
240
|
|
|
228
|
-
this.toggleOpen('click');
|
|
241
|
+
this.toggleOpen(event, { source: 'click' });
|
|
229
242
|
};
|
|
230
243
|
|
|
231
244
|
Dropdown.prototype.handleKeyDown = function handleKeyDown(event) {
|
|
@@ -236,7 +249,7 @@ var Dropdown = function (_React$Component) {
|
|
|
236
249
|
switch (event.keyCode) {
|
|
237
250
|
case _keycode2['default'].codes.down:
|
|
238
251
|
if (!this.props.open) {
|
|
239
|
-
this.toggleOpen('keydown');
|
|
252
|
+
this.toggleOpen(event, { source: 'keydown' });
|
|
240
253
|
} else if (this.menu.focusNext) {
|
|
241
254
|
this.menu.focusNext();
|
|
242
255
|
}
|
|
@@ -244,30 +257,30 @@ var Dropdown = function (_React$Component) {
|
|
|
244
257
|
break;
|
|
245
258
|
case _keycode2['default'].codes.esc:
|
|
246
259
|
case _keycode2['default'].codes.tab:
|
|
247
|
-
this.handleClose(event);
|
|
260
|
+
this.handleClose(event, { source: 'keydown' });
|
|
248
261
|
break;
|
|
249
262
|
default:
|
|
250
263
|
}
|
|
251
264
|
};
|
|
252
265
|
|
|
253
|
-
Dropdown.prototype.toggleOpen = function toggleOpen(
|
|
266
|
+
Dropdown.prototype.toggleOpen = function toggleOpen(event, eventDetails) {
|
|
254
267
|
var open = !this.props.open;
|
|
255
268
|
|
|
256
269
|
if (open) {
|
|
257
|
-
this.lastOpenEventType =
|
|
270
|
+
this.lastOpenEventType = eventDetails.source;
|
|
258
271
|
}
|
|
259
272
|
|
|
260
273
|
if (this.props.onToggle) {
|
|
261
|
-
this.props.onToggle(open);
|
|
274
|
+
this.props.onToggle(open, event, eventDetails);
|
|
262
275
|
}
|
|
263
276
|
};
|
|
264
277
|
|
|
265
|
-
Dropdown.prototype.handleClose = function handleClose() {
|
|
278
|
+
Dropdown.prototype.handleClose = function handleClose(event, eventDetails) {
|
|
266
279
|
if (!this.props.open) {
|
|
267
280
|
return;
|
|
268
281
|
}
|
|
269
282
|
|
|
270
|
-
this.toggleOpen(
|
|
283
|
+
this.toggleOpen(event, eventDetails);
|
|
271
284
|
};
|
|
272
285
|
|
|
273
286
|
Dropdown.prototype.focusNextOnOpen = function focusNextOnOpen() {
|
|
@@ -335,7 +348,9 @@ var Dropdown = function (_React$Component) {
|
|
|
335
348
|
labelledBy: id,
|
|
336
349
|
bsClass: (0, _bootstrapUtils.prefix)(props, 'menu'),
|
|
337
350
|
onClose: (0, _createChainedFunction2['default'])(child.props.onClose, onClose, this.handleClose),
|
|
338
|
-
onSelect: (0, _createChainedFunction2['default'])(child.props.onSelect, onSelect,
|
|
351
|
+
onSelect: (0, _createChainedFunction2['default'])(child.props.onSelect, onSelect, function (key, event) {
|
|
352
|
+
return _this3.handleClose(event, { source: 'select' });
|
|
353
|
+
}),
|
|
339
354
|
rootCloseEvent: rootCloseEvent
|
|
340
355
|
}));
|
|
341
356
|
};
|
package/lib/DropdownButton.js
CHANGED
|
@@ -26,6 +26,10 @@ var _react = require('react');
|
|
|
26
26
|
|
|
27
27
|
var _react2 = _interopRequireDefault(_react);
|
|
28
28
|
|
|
29
|
+
var _propTypes = require('prop-types');
|
|
30
|
+
|
|
31
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
32
|
+
|
|
29
33
|
var _Dropdown = require('./Dropdown');
|
|
30
34
|
|
|
31
35
|
var _Dropdown2 = _interopRequireDefault(_Dropdown);
|
|
@@ -39,16 +43,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'd
|
|
|
39
43
|
var propTypes = (0, _extends3['default'])({}, _Dropdown2['default'].propTypes, {
|
|
40
44
|
|
|
41
45
|
// Toggle props.
|
|
42
|
-
bsStyle:
|
|
43
|
-
bsSize:
|
|
44
|
-
title:
|
|
45
|
-
noCaret:
|
|
46
|
+
bsStyle: _propTypes2['default'].string,
|
|
47
|
+
bsSize: _propTypes2['default'].string,
|
|
48
|
+
title: _propTypes2['default'].node.isRequired,
|
|
49
|
+
noCaret: _propTypes2['default'].bool,
|
|
46
50
|
|
|
47
51
|
// Override generated docs from <Dropdown>.
|
|
48
52
|
/**
|
|
49
53
|
* @private
|
|
50
54
|
*/
|
|
51
|
-
children:
|
|
55
|
+
children: _propTypes2['default'].node
|
|
52
56
|
});
|
|
53
57
|
|
|
54
58
|
var DropdownButton = function (_React$Component) {
|