react-bootstrap 0.31.1 → 0.31.5

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.
Files changed (131) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/dist/react-bootstrap.js +4811 -4179
  3. package/dist/react-bootstrap.min.js +9 -9
  4. package/dist/react-bootstrap.min.js.map +1 -1
  5. package/es/ButtonToolbar.js +2 -3
  6. package/es/Carousel.js +85 -77
  7. package/es/Checkbox.js +2 -0
  8. package/es/CloseButton.js +1 -1
  9. package/es/Collapse.js +18 -18
  10. package/es/Dropdown.js +50 -50
  11. package/es/DropdownMenu.js +28 -28
  12. package/es/Fade.js +2 -2
  13. package/es/FormControl.js +1 -2
  14. package/es/MediaBody.js +15 -2
  15. package/es/Modal.js +23 -15
  16. package/es/Nav.js +44 -44
  17. package/es/Navbar.js +4 -4
  18. package/es/OverlayTrigger.js +39 -39
  19. package/es/Panel.js +44 -44
  20. package/es/Radio.js +2 -0
  21. package/es/SafeAnchor.js +15 -2
  22. package/es/TabContent.js +5 -5
  23. package/es/TabPane.js +16 -16
  24. package/es/Tabs.js +2 -2
  25. package/es/Thumbnail.js +2 -0
  26. package/es/ToggleButton.js +8 -0
  27. package/es/ToggleButtonGroup.js +11 -6
  28. package/es/index.js +4 -0
  29. package/es/utils/TransitionEvents.js +11 -10
  30. package/es/utils/ValidComponentChildren.js +1 -1
  31. package/es/utils/bootstrapUtils.js +2 -1
  32. package/lib/Accordion.js +9 -9
  33. package/lib/Alert.js +14 -14
  34. package/lib/Badge.js +13 -13
  35. package/lib/Breadcrumb.js +10 -10
  36. package/lib/BreadcrumbItem.js +14 -14
  37. package/lib/Button.js +20 -20
  38. package/lib/ButtonGroup.js +13 -13
  39. package/lib/ButtonToolbar.js +9 -13
  40. package/lib/Carousel.js +127 -119
  41. package/lib/CarouselCaption.js +10 -10
  42. package/lib/CarouselItem.js +16 -16
  43. package/lib/Checkbox.js +21 -21
  44. package/lib/Clearfix.js +15 -15
  45. package/lib/CloseButton.js +12 -14
  46. package/lib/Col.js +30 -30
  47. package/lib/Collapse.js +47 -47
  48. package/lib/ControlLabel.js +14 -14
  49. package/lib/Dropdown.js +92 -92
  50. package/lib/DropdownButton.js +22 -22
  51. package/lib/DropdownMenu.js +51 -51
  52. package/lib/DropdownToggle.js +16 -16
  53. package/lib/Fade.js +20 -20
  54. package/lib/Form.js +12 -12
  55. package/lib/FormControl.js +17 -17
  56. package/lib/FormControlFeedback.js +13 -13
  57. package/lib/FormControlStatic.js +10 -10
  58. package/lib/FormGroup.js +15 -15
  59. package/lib/Glyphicon.js +11 -11
  60. package/lib/Grid.js +11 -11
  61. package/lib/HelpBlock.js +9 -9
  62. package/lib/Image.js +13 -13
  63. package/lib/InputGroup.js +11 -11
  64. package/lib/InputGroupAddon.js +9 -9
  65. package/lib/InputGroupButton.js +9 -9
  66. package/lib/Jumbotron.js +10 -10
  67. package/lib/Label.js +12 -12
  68. package/lib/ListGroup.js +16 -16
  69. package/lib/ListGroupItem.js +22 -22
  70. package/lib/Media.js +16 -16
  71. package/lib/MediaBody.js +29 -10
  72. package/lib/MediaHeading.js +10 -10
  73. package/lib/MediaLeft.js +11 -11
  74. package/lib/MediaList.js +9 -9
  75. package/lib/MediaListItem.js +9 -9
  76. package/lib/MediaRight.js +11 -11
  77. package/lib/MenuItem.js +23 -23
  78. package/lib/Modal.js +73 -65
  79. package/lib/ModalBody.js +10 -10
  80. package/lib/ModalDialog.js +16 -16
  81. package/lib/ModalFooter.js +10 -10
  82. package/lib/ModalHeader.js +17 -17
  83. package/lib/ModalTitle.js +10 -10
  84. package/lib/Nav.js +81 -81
  85. package/lib/NavDropdown.js +25 -25
  86. package/lib/NavItem.js +18 -18
  87. package/lib/Navbar.js +47 -47
  88. package/lib/NavbarBrand.js +14 -14
  89. package/lib/NavbarCollapse.js +14 -14
  90. package/lib/NavbarHeader.js +10 -10
  91. package/lib/NavbarToggle.js +22 -22
  92. package/lib/Overlay.js +25 -25
  93. package/lib/OverlayTrigger.js +75 -75
  94. package/lib/PageHeader.js +11 -11
  95. package/lib/PageItem.js +2 -2
  96. package/lib/Pager.js +14 -14
  97. package/lib/PagerItem.js +17 -17
  98. package/lib/Pagination.js +52 -52
  99. package/lib/PaginationButton.js +20 -20
  100. package/lib/Panel.js +76 -76
  101. package/lib/PanelGroup.js +18 -18
  102. package/lib/Popover.js +22 -22
  103. package/lib/ProgressBar.js +29 -29
  104. package/lib/Radio.js +21 -21
  105. package/lib/ResponsiveEmbed.js +17 -17
  106. package/lib/Row.js +10 -10
  107. package/lib/SafeAnchor.js +31 -16
  108. package/lib/SplitButton.js +26 -26
  109. package/lib/SplitToggle.js +8 -8
  110. package/lib/Tab.js +15 -15
  111. package/lib/TabContainer.js +17 -17
  112. package/lib/TabContent.js +29 -29
  113. package/lib/TabPane.js +57 -57
  114. package/lib/Table.js +16 -16
  115. package/lib/Tabs.js +28 -28
  116. package/lib/Thumbnail.js +19 -19
  117. package/lib/ToggleButton.js +23 -16
  118. package/lib/ToggleButtonGroup.js +38 -26
  119. package/lib/Tooltip.js +20 -20
  120. package/lib/Well.js +9 -9
  121. package/lib/index.js +83 -73
  122. package/lib/utils/PropTypes.js +5 -5
  123. package/lib/utils/TransitionEvents.js +12 -11
  124. package/lib/utils/ValidComponentChildren.js +19 -19
  125. package/lib/utils/bootstrapUtils.js +11 -10
  126. package/lib/utils/capitalize.js +1 -1
  127. package/lib/utils/createChainedFunction.js +1 -1
  128. package/lib/utils/deprecationWarning.js +7 -7
  129. package/lib/utils/index.js +4 -4
  130. package/lib/utils/splitComponentProps.js +3 -3
  131. package/package.json +20 -18
@@ -38,21 +38,21 @@ var _bootstrapUtils = require('./utils/bootstrapUtils');
38
38
 
39
39
  var _StyleConfig = require('./utils/StyleConfig');
40
40
 
41
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
41
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
42
42
 
43
43
  var propTypes = {
44
44
  /**
45
45
  * A css class to apply to the Modal dialog DOM node.
46
46
  */
47
- dialogClassName: _propTypes2['default'].string
47
+ dialogClassName: _propTypes2.default.string
48
48
  };
49
49
 
50
50
  var ModalDialog = function (_React$Component) {
51
- (0, _inherits3['default'])(ModalDialog, _React$Component);
51
+ (0, _inherits3.default)(ModalDialog, _React$Component);
52
52
 
53
53
  function ModalDialog() {
54
- (0, _classCallCheck3['default'])(this, ModalDialog);
55
- return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments));
54
+ (0, _classCallCheck3.default)(this, ModalDialog);
55
+ return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
56
56
  }
57
57
 
58
58
  ModalDialog.prototype.render = function render() {
@@ -63,7 +63,7 @@ var ModalDialog = function (_React$Component) {
63
63
  className = _props.className,
64
64
  style = _props.style,
65
65
  children = _props.children,
66
- props = (0, _objectWithoutProperties3['default'])(_props, ['dialogClassName', 'className', 'style', 'children']);
66
+ props = (0, _objectWithoutProperties3.default)(_props, ['dialogClassName', 'className', 'style', 'children']);
67
67
 
68
68
  var _splitBsProps = (0, _bootstrapUtils.splitBsProps)(props),
69
69
  bsProps = _splitBsProps[0],
@@ -71,22 +71,22 @@ var ModalDialog = function (_React$Component) {
71
71
 
72
72
  var bsClassName = (0, _bootstrapUtils.prefix)(bsProps);
73
73
 
74
- var modalStyle = (0, _extends4['default'])({ display: 'block' }, style);
74
+ var modalStyle = (0, _extends4.default)({ display: 'block' }, style);
75
75
 
76
- var dialogClasses = (0, _extends4['default'])({}, (0, _bootstrapUtils.getClassSet)(bsProps), (_extends2 = {}, _extends2[bsClassName] = false, _extends2[(0, _bootstrapUtils.prefix)(bsProps, 'dialog')] = true, _extends2));
76
+ var dialogClasses = (0, _extends4.default)({}, (0, _bootstrapUtils.getClassSet)(bsProps), (_extends2 = {}, _extends2[bsClassName] = false, _extends2[(0, _bootstrapUtils.prefix)(bsProps, 'dialog')] = true, _extends2));
77
77
 
78
- return _react2['default'].createElement(
78
+ return _react2.default.createElement(
79
79
  'div',
80
- (0, _extends4['default'])({}, elementProps, {
80
+ (0, _extends4.default)({}, elementProps, {
81
81
  tabIndex: '-1',
82
82
  role: 'dialog',
83
83
  style: modalStyle,
84
- className: (0, _classnames2['default'])(className, bsClassName)
84
+ className: (0, _classnames2.default)(className, bsClassName)
85
85
  }),
86
- _react2['default'].createElement(
86
+ _react2.default.createElement(
87
87
  'div',
88
- { className: (0, _classnames2['default'])(dialogClassName, dialogClasses) },
89
- _react2['default'].createElement(
88
+ { className: (0, _classnames2.default)(dialogClassName, dialogClasses) },
89
+ _react2.default.createElement(
90
90
  'div',
91
91
  { className: (0, _bootstrapUtils.prefix)(bsProps, 'content'), role: 'document' },
92
92
  children
@@ -96,9 +96,9 @@ var ModalDialog = function (_React$Component) {
96
96
  };
97
97
 
98
98
  return ModalDialog;
99
- }(_react2['default'].Component);
99
+ }(_react2.default.Component);
100
100
 
101
101
  ModalDialog.propTypes = propTypes;
102
102
 
103
- exports['default'] = (0, _bootstrapUtils.bsClass)('modal', (0, _bootstrapUtils.bsSizes)([_StyleConfig.Size.LARGE, _StyleConfig.Size.SMALL], ModalDialog));
103
+ exports.default = (0, _bootstrapUtils.bsClass)('modal', (0, _bootstrapUtils.bsSizes)([_StyleConfig.Size.LARGE, _StyleConfig.Size.SMALL], ModalDialog));
104
104
  module.exports = exports['default'];
@@ -36,10 +36,10 @@ var _elementType2 = _interopRequireDefault(_elementType);
36
36
 
37
37
  var _bootstrapUtils = require('./utils/bootstrapUtils');
38
38
 
39
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
39
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
40
40
 
41
41
  var propTypes = {
42
- componentClass: _elementType2['default']
42
+ componentClass: _elementType2.default
43
43
  };
44
44
 
45
45
  var defaultProps = {
@@ -47,18 +47,18 @@ var defaultProps = {
47
47
  };
48
48
 
49
49
  var ModalFooter = function (_React$Component) {
50
- (0, _inherits3['default'])(ModalFooter, _React$Component);
50
+ (0, _inherits3.default)(ModalFooter, _React$Component);
51
51
 
52
52
  function ModalFooter() {
53
- (0, _classCallCheck3['default'])(this, ModalFooter);
54
- return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments));
53
+ (0, _classCallCheck3.default)(this, ModalFooter);
54
+ return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
55
55
  }
56
56
 
57
57
  ModalFooter.prototype.render = function render() {
58
58
  var _props = this.props,
59
59
  Component = _props.componentClass,
60
60
  className = _props.className,
61
- props = (0, _objectWithoutProperties3['default'])(_props, ['componentClass', 'className']);
61
+ props = (0, _objectWithoutProperties3.default)(_props, ['componentClass', 'className']);
62
62
 
63
63
  var _splitBsProps = (0, _bootstrapUtils.splitBsProps)(props),
64
64
  bsProps = _splitBsProps[0],
@@ -66,16 +66,16 @@ var ModalFooter = function (_React$Component) {
66
66
 
67
67
  var classes = (0, _bootstrapUtils.getClassSet)(bsProps);
68
68
 
69
- return _react2['default'].createElement(Component, (0, _extends3['default'])({}, elementProps, {
70
- className: (0, _classnames2['default'])(className, classes)
69
+ return _react2.default.createElement(Component, (0, _extends3.default)({}, elementProps, {
70
+ className: (0, _classnames2.default)(className, classes)
71
71
  }));
72
72
  };
73
73
 
74
74
  return ModalFooter;
75
- }(_react2['default'].Component);
75
+ }(_react2.default.Component);
76
76
 
77
77
  ModalFooter.propTypes = propTypes;
78
78
  ModalFooter.defaultProps = defaultProps;
79
79
 
80
- exports['default'] = (0, _bootstrapUtils.bsClass)('modal-footer', ModalFooter);
80
+ exports.default = (0, _bootstrapUtils.bsClass)('modal-footer', ModalFooter);
81
81
  module.exports = exports['default'];
@@ -44,7 +44,7 @@ var _CloseButton = require('./CloseButton');
44
44
 
45
45
  var _CloseButton2 = _interopRequireDefault(_CloseButton);
46
46
 
47
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
47
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
48
48
 
49
49
  // TODO: `aria-label` should be `closeLabel`.
50
50
 
@@ -54,19 +54,19 @@ var propTypes = {
54
54
  * button. It is used for Assistive Technology when the label text is not
55
55
  * readable.
56
56
  */
57
- closeLabel: _propTypes2['default'].string,
57
+ closeLabel: _propTypes2.default.string,
58
58
 
59
59
  /**
60
60
  * Specify whether the Component should contain a close button
61
61
  */
62
- closeButton: _propTypes2['default'].bool,
62
+ closeButton: _propTypes2.default.bool,
63
63
 
64
64
  /**
65
65
  * A Callback fired when the close button is clicked. If used directly inside
66
66
  * a Modal component, the onHide will automatically be propagated up to the
67
67
  * parent Modal `onHide`.
68
68
  */
69
- onHide: _propTypes2['default'].func
69
+ onHide: _propTypes2.default.func
70
70
  };
71
71
 
72
72
  var defaultProps = {
@@ -75,17 +75,17 @@ var defaultProps = {
75
75
  };
76
76
 
77
77
  var contextTypes = {
78
- $bs_modal: _propTypes2['default'].shape({
79
- onHide: _propTypes2['default'].func
78
+ $bs_modal: _propTypes2.default.shape({
79
+ onHide: _propTypes2.default.func
80
80
  })
81
81
  };
82
82
 
83
83
  var ModalHeader = function (_React$Component) {
84
- (0, _inherits3['default'])(ModalHeader, _React$Component);
84
+ (0, _inherits3.default)(ModalHeader, _React$Component);
85
85
 
86
86
  function ModalHeader() {
87
- (0, _classCallCheck3['default'])(this, ModalHeader);
88
- return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments));
87
+ (0, _classCallCheck3.default)(this, ModalHeader);
88
+ return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
89
89
  }
90
90
 
91
91
  ModalHeader.prototype.render = function render() {
@@ -95,7 +95,7 @@ var ModalHeader = function (_React$Component) {
95
95
  onHide = _props.onHide,
96
96
  className = _props.className,
97
97
  children = _props.children,
98
- props = (0, _objectWithoutProperties3['default'])(_props, ['closeLabel', 'closeButton', 'onHide', 'className', 'children']);
98
+ props = (0, _objectWithoutProperties3.default)(_props, ['closeLabel', 'closeButton', 'onHide', 'className', 'children']);
99
99
 
100
100
 
101
101
  var modal = this.context.$bs_modal;
@@ -106,25 +106,25 @@ var ModalHeader = function (_React$Component) {
106
106
 
107
107
  var classes = (0, _bootstrapUtils.getClassSet)(bsProps);
108
108
 
109
- return _react2['default'].createElement(
109
+ return _react2.default.createElement(
110
110
  'div',
111
- (0, _extends3['default'])({}, elementProps, {
112
- className: (0, _classnames2['default'])(className, classes)
111
+ (0, _extends3.default)({}, elementProps, {
112
+ className: (0, _classnames2.default)(className, classes)
113
113
  }),
114
- closeButton && _react2['default'].createElement(_CloseButton2['default'], {
114
+ closeButton && _react2.default.createElement(_CloseButton2.default, {
115
115
  label: closeLabel,
116
- onClick: (0, _createChainedFunction2['default'])(modal && modal.onHide, onHide)
116
+ onClick: (0, _createChainedFunction2.default)(modal && modal.onHide, onHide)
117
117
  }),
118
118
  children
119
119
  );
120
120
  };
121
121
 
122
122
  return ModalHeader;
123
- }(_react2['default'].Component);
123
+ }(_react2.default.Component);
124
124
 
125
125
  ModalHeader.propTypes = propTypes;
126
126
  ModalHeader.defaultProps = defaultProps;
127
127
  ModalHeader.contextTypes = contextTypes;
128
128
 
129
- exports['default'] = (0, _bootstrapUtils.bsClass)('modal-header', ModalHeader);
129
+ exports.default = (0, _bootstrapUtils.bsClass)('modal-header', ModalHeader);
130
130
  module.exports = exports['default'];
package/lib/ModalTitle.js CHANGED
@@ -36,10 +36,10 @@ var _elementType2 = _interopRequireDefault(_elementType);
36
36
 
37
37
  var _bootstrapUtils = require('./utils/bootstrapUtils');
38
38
 
39
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
39
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
40
40
 
41
41
  var propTypes = {
42
- componentClass: _elementType2['default']
42
+ componentClass: _elementType2.default
43
43
  };
44
44
 
45
45
  var defaultProps = {
@@ -47,18 +47,18 @@ var defaultProps = {
47
47
  };
48
48
 
49
49
  var ModalTitle = function (_React$Component) {
50
- (0, _inherits3['default'])(ModalTitle, _React$Component);
50
+ (0, _inherits3.default)(ModalTitle, _React$Component);
51
51
 
52
52
  function ModalTitle() {
53
- (0, _classCallCheck3['default'])(this, ModalTitle);
54
- return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments));
53
+ (0, _classCallCheck3.default)(this, ModalTitle);
54
+ return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
55
55
  }
56
56
 
57
57
  ModalTitle.prototype.render = function render() {
58
58
  var _props = this.props,
59
59
  Component = _props.componentClass,
60
60
  className = _props.className,
61
- props = (0, _objectWithoutProperties3['default'])(_props, ['componentClass', 'className']);
61
+ props = (0, _objectWithoutProperties3.default)(_props, ['componentClass', 'className']);
62
62
 
63
63
  var _splitBsProps = (0, _bootstrapUtils.splitBsProps)(props),
64
64
  bsProps = _splitBsProps[0],
@@ -66,16 +66,16 @@ var ModalTitle = function (_React$Component) {
66
66
 
67
67
  var classes = (0, _bootstrapUtils.getClassSet)(bsProps);
68
68
 
69
- return _react2['default'].createElement(Component, (0, _extends3['default'])({}, elementProps, {
70
- className: (0, _classnames2['default'])(className, classes)
69
+ return _react2.default.createElement(Component, (0, _extends3.default)({}, elementProps, {
70
+ className: (0, _classnames2.default)(className, classes)
71
71
  }));
72
72
  };
73
73
 
74
74
  return ModalTitle;
75
- }(_react2['default'].Component);
75
+ }(_react2.default.Component);
76
76
 
77
77
  ModalTitle.propTypes = propTypes;
78
78
  ModalTitle.defaultProps = defaultProps;
79
79
 
80
- exports['default'] = (0, _bootstrapUtils.bsClass)('modal-title', ModalTitle);
80
+ exports.default = (0, _bootstrapUtils.bsClass)('modal-title', ModalTitle);
81
81
  module.exports = exports['default'];
package/lib/Nav.js CHANGED
@@ -60,7 +60,7 @@ var _ValidComponentChildren = require('./utils/ValidComponentChildren');
60
60
 
61
61
  var _ValidComponentChildren2 = _interopRequireDefault(_ValidComponentChildren);
62
62
 
63
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
63
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
64
64
 
65
65
  // TODO: Should we expose `<NavItem>` as `<Nav.Item>`?
66
66
 
@@ -74,19 +74,19 @@ var propTypes = {
74
74
  * Marks the NavItem with a matching `eventKey` as active. Has a
75
75
  * higher precedence over `activeHref`.
76
76
  */
77
- activeKey: _propTypes2['default'].any,
77
+ activeKey: _propTypes2.default.any,
78
78
 
79
79
  /**
80
80
  * Marks the child NavItem with a matching `href` prop as active.
81
81
  */
82
- activeHref: _propTypes2['default'].string,
82
+ activeHref: _propTypes2.default.string,
83
83
 
84
84
  /**
85
85
  * NavItems are be positioned vertically.
86
86
  */
87
- stacked: _propTypes2['default'].bool,
87
+ stacked: _propTypes2.default.bool,
88
88
 
89
- justified: (0, _all2['default'])(_propTypes2['default'].bool, function (_ref) {
89
+ justified: (0, _all2.default)(_propTypes2.default.bool, function (_ref) {
90
90
  var justified = _ref.justified,
91
91
  navbar = _ref.navbar;
92
92
  return justified && navbar ? Error('justified navbar `Nav`s are not supported') : null;
@@ -97,12 +97,12 @@ var propTypes = {
97
97
  *
98
98
  * ```js
99
99
  * function (
100
- * Any eventKey,
101
- * SyntheticEvent event?
100
+ * Any eventKey,
101
+ * SyntheticEvent event?
102
102
  * )
103
103
  * ```
104
104
  */
105
- onSelect: _propTypes2['default'].func,
105
+ onSelect: _propTypes2.default.func,
106
106
 
107
107
  /**
108
108
  * ARIA role for the Nav, in the context of a TabContainer, the default will
@@ -112,25 +112,25 @@ var propTypes = {
112
112
  * the ARIA authoring practices for tabs:
113
113
  * https://www.w3.org/TR/2013/WD-wai-aria-practices-20130307/#tabpanel
114
114
  */
115
- role: _propTypes2['default'].string,
115
+ role: _propTypes2.default.string,
116
116
 
117
117
  /**
118
118
  * Apply styling an alignment for use in a Navbar. This prop will be set
119
119
  * automatically when the Nav is used inside a Navbar.
120
120
  */
121
- navbar: _propTypes2['default'].bool,
121
+ navbar: _propTypes2.default.bool,
122
122
 
123
123
  /**
124
124
  * Float the Nav to the right. When `navbar` is `true` the appropriate
125
125
  * contextual classes are added as well.
126
126
  */
127
- pullRight: _propTypes2['default'].bool,
127
+ pullRight: _propTypes2.default.bool,
128
128
 
129
129
  /**
130
130
  * Float the Nav to the left. When `navbar` is `true` the appropriate
131
131
  * contextual classes are added as well.
132
132
  */
133
- pullLeft: _propTypes2['default'].bool
133
+ pullLeft: _propTypes2.default.bool
134
134
  };
135
135
 
136
136
  var defaultProps = {
@@ -141,25 +141,25 @@ var defaultProps = {
141
141
  };
142
142
 
143
143
  var contextTypes = {
144
- $bs_navbar: _propTypes2['default'].shape({
145
- bsClass: _propTypes2['default'].string,
146
- onSelect: _propTypes2['default'].func
144
+ $bs_navbar: _propTypes2.default.shape({
145
+ bsClass: _propTypes2.default.string,
146
+ onSelect: _propTypes2.default.func
147
147
  }),
148
148
 
149
- $bs_tabContainer: _propTypes2['default'].shape({
150
- activeKey: _propTypes2['default'].any,
151
- onSelect: _propTypes2['default'].func.isRequired,
152
- getTabId: _propTypes2['default'].func.isRequired,
153
- getPaneId: _propTypes2['default'].func.isRequired
149
+ $bs_tabContainer: _propTypes2.default.shape({
150
+ activeKey: _propTypes2.default.any,
151
+ onSelect: _propTypes2.default.func.isRequired,
152
+ getTabId: _propTypes2.default.func.isRequired,
153
+ getPaneId: _propTypes2.default.func.isRequired
154
154
  })
155
155
  };
156
156
 
157
157
  var Nav = function (_React$Component) {
158
- (0, _inherits3['default'])(Nav, _React$Component);
158
+ (0, _inherits3.default)(Nav, _React$Component);
159
159
 
160
160
  function Nav() {
161
- (0, _classCallCheck3['default'])(this, Nav);
162
- return (0, _possibleConstructorReturn3['default'])(this, _React$Component.apply(this, arguments));
161
+ (0, _classCallCheck3.default)(this, Nav);
162
+ return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
163
163
  }
164
164
 
165
165
  Nav.prototype.componentDidUpdate = function componentDidUpdate() {
@@ -177,14 +177,14 @@ var Nav = function (_React$Component) {
177
177
  activeKey = _getActiveProps.activeKey,
178
178
  activeHref = _getActiveProps.activeHref;
179
179
 
180
- var activeChild = _ValidComponentChildren2['default'].find(children, function (child) {
180
+ var activeChild = _ValidComponentChildren2.default.find(children, function (child) {
181
181
  return _this2.isActive(child, activeKey, activeHref);
182
182
  });
183
183
 
184
- var childrenArray = _ValidComponentChildren2['default'].toArray(children);
184
+ var childrenArray = _ValidComponentChildren2.default.toArray(children);
185
185
  var activeChildIndex = childrenArray.indexOf(activeChild);
186
186
 
187
- var childNodes = _reactDom2['default'].findDOMNode(this).children;
187
+ var childNodes = _reactDom2.default.findDOMNode(this).children;
188
188
  var activeNode = childNodes && childNodes[activeChildIndex];
189
189
 
190
190
  if (!activeNode || !activeNode.firstChild) {
@@ -194,30 +194,16 @@ var Nav = function (_React$Component) {
194
194
  activeNode.firstChild.focus();
195
195
  };
196
196
 
197
- Nav.prototype.handleTabKeyDown = function handleTabKeyDown(onSelect, event) {
198
- var nextActiveChild = void 0;
199
-
200
- switch (event.keyCode) {
201
- case _keycode2['default'].codes.left:
202
- case _keycode2['default'].codes.up:
203
- nextActiveChild = this.getNextActiveChild(-1);
204
- break;
205
- case _keycode2['default'].codes.right:
206
- case _keycode2['default'].codes.down:
207
- nextActiveChild = this.getNextActiveChild(1);
208
- break;
209
- default:
210
- // It was a different key; don't handle this keypress.
211
- return;
212
- }
197
+ Nav.prototype.getActiveProps = function getActiveProps() {
198
+ var tabContainer = this.context.$bs_tabContainer;
213
199
 
214
- event.preventDefault();
200
+ if (tabContainer) {
201
+ process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(this.props.activeKey == null && !this.props.activeHref, 'Specifying a `<Nav>` `activeKey` or `activeHref` in the context of ' + 'a `<TabContainer>` is not supported. Instead use `<TabContainer ' + ('activeKey={' + this.props.activeKey + '} />`.')) : void 0;
215
202
 
216
- if (onSelect && nextActiveChild && nextActiveChild.props.eventKey != null) {
217
- onSelect(nextActiveChild.props.eventKey);
203
+ return tabContainer;
218
204
  }
219
205
 
220
- this._needsRefocus = true;
206
+ return this.props;
221
207
  };
222
208
 
223
209
  Nav.prototype.getNextActiveChild = function getNextActiveChild(offset) {
@@ -233,7 +219,7 @@ var Nav = function (_React$Component) {
233
219
  activeKey = _getActiveProps2.activeKey,
234
220
  activeHref = _getActiveProps2.activeHref;
235
221
 
236
- var activeChild = _ValidComponentChildren2['default'].find(children, function (child) {
222
+ var activeChild = _ValidComponentChildren2.default.find(children, function (child) {
237
223
  return _this3.isActive(child, activeKey, activeHref);
238
224
  });
239
225
 
@@ -256,28 +242,6 @@ var Nav = function (_React$Component) {
256
242
  return validChildren[nextIndex];
257
243
  };
258
244
 
259
- Nav.prototype.getActiveProps = function getActiveProps() {
260
- var tabContainer = this.context.$bs_tabContainer;
261
-
262
- if (tabContainer) {
263
- process.env.NODE_ENV !== 'production' ? (0, _warning2['default'])(this.props.activeKey == null && !this.props.activeHref, 'Specifying a `<Nav>` `activeKey` or `activeHref` in the context of ' + 'a `<TabContainer>` is not supported. Instead use `<TabContainer ' + ('activeKey={' + this.props.activeKey + '} />`.')) : void 0;
264
-
265
- return tabContainer;
266
- }
267
-
268
- return this.props;
269
- };
270
-
271
- Nav.prototype.isActive = function isActive(_ref2, activeKey, activeHref) {
272
- var props = _ref2.props;
273
-
274
- if (props.active || activeKey != null && props.eventKey === activeKey || activeHref && props.href === activeHref) {
275
- return true;
276
- }
277
-
278
- return props.active;
279
- };
280
-
281
245
  Nav.prototype.getTabProps = function getTabProps(child, tabContainer, navRole, active, onSelect) {
282
246
  var _this4 = this;
283
247
 
@@ -296,7 +260,7 @@ var Nav = function (_React$Component) {
296
260
 
297
261
 
298
262
  if (tabContainer) {
299
- process.env.NODE_ENV !== 'production' ? (0, _warning2['default'])(!id && !controls, 'In the context of a `<TabContainer>`, `<NavItem>`s are given ' + 'generated `id` and `aria-controls` attributes for the sake of ' + 'proper component accessibility. Any provided ones will be ignored. ' + 'To control these attributes directly, provide a `generateChildId` ' + 'prop to the parent `<TabContainer>`.') : void 0;
263
+ process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(!id && !controls, 'In the context of a `<TabContainer>`, `<NavItem>`s are given ' + 'generated `id` and `aria-controls` attributes for the sake of ' + 'proper component accessibility. Any provided ones will be ignored. ' + 'To control these attributes directly, provide a `generateChildId` ' + 'prop to the parent `<TabContainer>`.') : void 0;
300
264
 
301
265
  id = tabContainer.getTabId(eventKey);
302
266
  controls = tabContainer.getPaneId(eventKey);
@@ -304,7 +268,7 @@ var Nav = function (_React$Component) {
304
268
 
305
269
  if (navRole === 'tablist') {
306
270
  role = role || 'tab';
307
- onKeyDown = (0, _createChainedFunction2['default'])(function (event) {
271
+ onKeyDown = (0, _createChainedFunction2.default)(function (event) {
308
272
  return _this4.handleTabKeyDown(onSelect, event);
309
273
  }, onKeyDown);
310
274
  tabIndex = active ? tabIndex : -1;
@@ -319,6 +283,42 @@ var Nav = function (_React$Component) {
319
283
  };
320
284
  };
321
285
 
286
+ Nav.prototype.handleTabKeyDown = function handleTabKeyDown(onSelect, event) {
287
+ var nextActiveChild = void 0;
288
+
289
+ switch (event.keyCode) {
290
+ case _keycode2.default.codes.left:
291
+ case _keycode2.default.codes.up:
292
+ nextActiveChild = this.getNextActiveChild(-1);
293
+ break;
294
+ case _keycode2.default.codes.right:
295
+ case _keycode2.default.codes.down:
296
+ nextActiveChild = this.getNextActiveChild(1);
297
+ break;
298
+ default:
299
+ // It was a different key; don't handle this keypress.
300
+ return;
301
+ }
302
+
303
+ event.preventDefault();
304
+
305
+ if (onSelect && nextActiveChild && nextActiveChild.props.eventKey != null) {
306
+ onSelect(nextActiveChild.props.eventKey);
307
+ }
308
+
309
+ this._needsRefocus = true;
310
+ };
311
+
312
+ Nav.prototype.isActive = function isActive(_ref2, activeKey, activeHref) {
313
+ var props = _ref2.props;
314
+
315
+ if (props.active || activeKey != null && props.eventKey === activeKey || activeHref && props.href === activeHref) {
316
+ return true;
317
+ }
318
+
319
+ return props.active;
320
+ };
321
+
322
322
  Nav.prototype.render = function render() {
323
323
  var _extends2,
324
324
  _this5 = this;
@@ -333,7 +333,7 @@ var Nav = function (_React$Component) {
333
333
  pullLeft = _props.pullLeft,
334
334
  className = _props.className,
335
335
  children = _props.children,
336
- props = (0, _objectWithoutProperties3['default'])(_props, ['stacked', 'justified', 'onSelect', 'role', 'navbar', 'pullRight', 'pullLeft', 'className', 'children']);
336
+ props = (0, _objectWithoutProperties3.default)(_props, ['stacked', 'justified', 'onSelect', 'role', 'navbar', 'pullRight', 'pullLeft', 'className', 'children']);
337
337
 
338
338
 
339
339
  var tabContainer = this.context.$bs_tabContainer;
@@ -350,7 +350,7 @@ var Nav = function (_React$Component) {
350
350
  bsProps = _splitBsProps[0],
351
351
  elementProps = _splitBsProps[1];
352
352
 
353
- var classes = (0, _extends4['default'])({}, (0, _bootstrapUtils.getClassSet)(bsProps), (_extends2 = {}, _extends2[(0, _bootstrapUtils.prefix)(bsProps, 'stacked')] = stacked, _extends2[(0, _bootstrapUtils.prefix)(bsProps, 'justified')] = justified, _extends2));
353
+ var classes = (0, _extends4.default)({}, (0, _bootstrapUtils.getClassSet)(bsProps), (_extends2 = {}, _extends2[(0, _bootstrapUtils.prefix)(bsProps, 'stacked')] = stacked, _extends2[(0, _bootstrapUtils.prefix)(bsProps, 'justified')] = justified, _extends2));
354
354
 
355
355
  var navbar = propsNavbar != null ? propsNavbar : this.context.$bs_navbar;
356
356
  var pullLeftClassName = void 0;
@@ -371,17 +371,17 @@ var Nav = function (_React$Component) {
371
371
  classes[pullRightClassName] = pullRight;
372
372
  classes[pullLeftClassName] = pullLeft;
373
373
 
374
- return _react2['default'].createElement(
374
+ return _react2.default.createElement(
375
375
  'ul',
376
- (0, _extends4['default'])({}, elementProps, {
376
+ (0, _extends4.default)({}, elementProps, {
377
377
  role: role,
378
- className: (0, _classnames2['default'])(className, classes)
378
+ className: (0, _classnames2.default)(className, classes)
379
379
  }),
380
- _ValidComponentChildren2['default'].map(children, function (child) {
380
+ _ValidComponentChildren2.default.map(children, function (child) {
381
381
  var active = _this5.isActive(child, activeKey, activeHref);
382
- var childOnSelect = (0, _createChainedFunction2['default'])(child.props.onSelect, onSelect, navbar && navbar.onSelect, tabContainer && tabContainer.onSelect);
382
+ var childOnSelect = (0, _createChainedFunction2.default)(child.props.onSelect, onSelect, navbar && navbar.onSelect, tabContainer && tabContainer.onSelect);
383
383
 
384
- return (0, _react.cloneElement)(child, (0, _extends4['default'])({}, _this5.getTabProps(child, tabContainer, role, active, childOnSelect), {
384
+ return (0, _react.cloneElement)(child, (0, _extends4.default)({}, _this5.getTabProps(child, tabContainer, role, active, childOnSelect), {
385
385
  active: active,
386
386
  activeKey: activeKey,
387
387
  activeHref: activeHref,
@@ -392,11 +392,11 @@ var Nav = function (_React$Component) {
392
392
  };
393
393
 
394
394
  return Nav;
395
- }(_react2['default'].Component);
395
+ }(_react2.default.Component);
396
396
 
397
397
  Nav.propTypes = propTypes;
398
398
  Nav.defaultProps = defaultProps;
399
399
  Nav.contextTypes = contextTypes;
400
400
 
401
- exports['default'] = (0, _bootstrapUtils.bsClass)('nav', (0, _bootstrapUtils.bsStyles)(['tabs', 'pills'], Nav));
401
+ exports.default = (0, _bootstrapUtils.bsClass)('nav', (0, _bootstrapUtils.bsStyles)(['tabs', 'pills'], Nav));
402
402
  module.exports = exports['default'];