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.
Files changed (189) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +1 -0
  3. package/dist/react-bootstrap.js +14493 -17076
  4. package/dist/react-bootstrap.min.js +18479 -16
  5. package/es/Alert.js +1 -4
  6. package/es/Badge.js +1 -3
  7. package/es/ButtonGroup.js +1 -3
  8. package/es/Carousel.js +79 -79
  9. package/es/CarouselCaption.js +1 -3
  10. package/es/CarouselItem.js +3 -9
  11. package/es/Checkbox.js +7 -1
  12. package/es/Clearfix.js +1 -3
  13. package/es/CloseButton.js +1 -5
  14. package/es/Col.js +1 -3
  15. package/es/Collapse.js +58 -65
  16. package/es/Dropdown.js +66 -55
  17. package/es/DropdownButton.js +2 -8
  18. package/es/DropdownMenu.js +28 -28
  19. package/es/Fade.js +25 -10
  20. package/es/Form.js +1 -3
  21. package/es/FormControl.js +1 -2
  22. package/es/FormControlStatic.js +1 -3
  23. package/es/FormGroup.js +1 -3
  24. package/es/Glyphicon.js +1 -3
  25. package/es/Grid.js +1 -3
  26. package/es/HelpBlock.js +1 -3
  27. package/es/InputGroup.js +1 -3
  28. package/es/InputGroupAddon.js +1 -3
  29. package/es/InputGroupButton.js +1 -3
  30. package/es/Jumbotron.js +1 -3
  31. package/es/Label.js +1 -3
  32. package/es/ListGroup.js +1 -3
  33. package/es/Media.js +1 -3
  34. package/es/MediaBody.js +16 -5
  35. package/es/MediaHeading.js +1 -3
  36. package/es/MediaLeft.js +1 -3
  37. package/es/MediaList.js +1 -3
  38. package/es/MediaListItem.js +1 -3
  39. package/es/MediaRight.js +1 -3
  40. package/es/Modal.js +30 -19
  41. package/es/ModalBody.js +1 -3
  42. package/es/ModalFooter.js +1 -3
  43. package/es/ModalHeader.js +2 -4
  44. package/es/ModalTitle.js +1 -3
  45. package/es/Nav.js +44 -44
  46. package/es/NavDropdown.js +2 -0
  47. package/es/NavItem.js +5 -4
  48. package/es/Navbar.js +5 -7
  49. package/es/Overlay.js +1 -3
  50. package/es/OverlayTrigger.js +43 -43
  51. package/es/PageHeader.js +1 -3
  52. package/es/Pager.js +1 -3
  53. package/es/PagerItem.js +1 -4
  54. package/es/Pagination.js +15 -224
  55. package/es/PaginationItem.js +102 -0
  56. package/es/Panel.js +114 -173
  57. package/es/PanelBody.js +84 -0
  58. package/es/PanelCollapse.js +94 -0
  59. package/es/PanelFooter.js +53 -0
  60. package/es/PanelGroup.js +95 -52
  61. package/es/PanelHeading.js +75 -0
  62. package/es/PanelTitle.js +83 -0
  63. package/es/PanelToggle.js +94 -0
  64. package/es/ProgressBar.js +12 -8
  65. package/es/Radio.js +7 -1
  66. package/es/Row.js +1 -3
  67. package/es/SplitButton.js +1 -4
  68. package/es/SplitToggle.js +1 -4
  69. package/es/TabContent.js +7 -7
  70. package/es/TabPane.js +18 -18
  71. package/es/Table.js +1 -3
  72. package/es/Tabs.js +4 -10
  73. package/es/Thumbnail.js +3 -3
  74. package/es/ToggleButton.js +1 -4
  75. package/es/Well.js +1 -3
  76. package/es/index.js +0 -2
  77. package/es/utils/PropTypes.js +26 -4
  78. package/es/utils/ValidComponentChildren.js +1 -1
  79. package/es/utils/bootstrapUtils.js +5 -3
  80. package/lib/Accordion.js +9 -9
  81. package/lib/Alert.js +14 -17
  82. package/lib/Badge.js +12 -14
  83. package/lib/Breadcrumb.js +10 -10
  84. package/lib/BreadcrumbItem.js +14 -14
  85. package/lib/Button.js +20 -20
  86. package/lib/ButtonGroup.js +12 -14
  87. package/lib/ButtonToolbar.js +9 -9
  88. package/lib/Carousel.js +121 -121
  89. package/lib/CarouselCaption.js +9 -11
  90. package/lib/CarouselItem.js +17 -22
  91. package/lib/Checkbox.js +25 -21
  92. package/lib/Clearfix.js +14 -16
  93. package/lib/CloseButton.js +12 -16
  94. package/lib/Col.js +29 -31
  95. package/lib/Collapse.js +84 -92
  96. package/lib/ControlLabel.js +14 -14
  97. package/lib/Dropdown.js +106 -95
  98. package/lib/DropdownButton.js +22 -28
  99. package/lib/DropdownMenu.js +51 -51
  100. package/lib/DropdownToggle.js +16 -16
  101. package/lib/Fade.js +43 -25
  102. package/lib/Form.js +11 -13
  103. package/lib/FormControl.js +17 -17
  104. package/lib/FormControlFeedback.js +13 -13
  105. package/lib/FormControlStatic.js +9 -11
  106. package/lib/FormGroup.js +14 -16
  107. package/lib/Glyphicon.js +10 -12
  108. package/lib/Grid.js +10 -12
  109. package/lib/HelpBlock.js +8 -10
  110. package/lib/Image.js +13 -13
  111. package/lib/InputGroup.js +10 -12
  112. package/lib/InputGroupAddon.js +8 -10
  113. package/lib/InputGroupButton.js +8 -10
  114. package/lib/Jumbotron.js +9 -11
  115. package/lib/Label.js +11 -13
  116. package/lib/ListGroup.js +15 -17
  117. package/lib/ListGroupItem.js +22 -22
  118. package/lib/Media.js +15 -17
  119. package/lib/MediaBody.js +28 -11
  120. package/lib/MediaHeading.js +9 -11
  121. package/lib/MediaLeft.js +10 -12
  122. package/lib/MediaList.js +8 -10
  123. package/lib/MediaListItem.js +8 -10
  124. package/lib/MediaRight.js +10 -12
  125. package/lib/MenuItem.js +23 -23
  126. package/lib/Modal.js +80 -69
  127. package/lib/ModalBody.js +9 -11
  128. package/lib/ModalDialog.js +16 -16
  129. package/lib/ModalFooter.js +9 -11
  130. package/lib/ModalHeader.js +20 -22
  131. package/lib/ModalTitle.js +9 -11
  132. package/lib/Nav.js +81 -81
  133. package/lib/NavDropdown.js +27 -25
  134. package/lib/NavItem.js +23 -22
  135. package/lib/Navbar.js +46 -48
  136. package/lib/NavbarBrand.js +14 -14
  137. package/lib/NavbarCollapse.js +14 -14
  138. package/lib/NavbarHeader.js +10 -10
  139. package/lib/NavbarToggle.js +22 -22
  140. package/lib/Overlay.js +25 -27
  141. package/lib/OverlayTrigger.js +79 -79
  142. package/lib/PageHeader.js +10 -12
  143. package/lib/PageItem.js +2 -2
  144. package/lib/Pager.js +13 -15
  145. package/lib/PagerItem.js +18 -21
  146. package/lib/Pagination.js +25 -240
  147. package/lib/PaginationItem.js +135 -0
  148. package/lib/Panel.js +142 -180
  149. package/lib/PanelBody.js +114 -0
  150. package/lib/PanelCollapse.js +120 -0
  151. package/lib/PanelFooter.js +80 -0
  152. package/lib/PanelGroup.js +111 -70
  153. package/lib/PanelHeading.js +107 -0
  154. package/lib/PanelTitle.js +118 -0
  155. package/lib/PanelToggle.js +130 -0
  156. package/lib/Popover.js +22 -22
  157. package/lib/ProgressBar.js +39 -35
  158. package/lib/Radio.js +25 -21
  159. package/lib/ResponsiveEmbed.js +17 -17
  160. package/lib/Row.js +9 -11
  161. package/lib/SafeAnchor.js +17 -17
  162. package/lib/SplitButton.js +26 -29
  163. package/lib/SplitToggle.js +8 -11
  164. package/lib/Tab.js +15 -15
  165. package/lib/TabContainer.js +17 -17
  166. package/lib/TabContent.js +31 -31
  167. package/lib/TabPane.js +59 -59
  168. package/lib/Table.js +15 -17
  169. package/lib/Tabs.js +29 -35
  170. package/lib/Thumbnail.js +18 -20
  171. package/lib/ToggleButton.js +17 -20
  172. package/lib/ToggleButtonGroup.js +20 -20
  173. package/lib/Tooltip.js +20 -20
  174. package/lib/Well.js +8 -10
  175. package/lib/index.js +74 -79
  176. package/lib/utils/PropTypes.js +35 -9
  177. package/lib/utils/ValidComponentChildren.js +19 -19
  178. package/lib/utils/bootstrapUtils.js +13 -11
  179. package/lib/utils/capitalize.js +1 -1
  180. package/lib/utils/createChainedFunction.js +1 -1
  181. package/lib/utils/deprecationWarning.js +7 -7
  182. package/lib/utils/index.js +4 -4
  183. package/lib/utils/splitComponentProps.js +3 -3
  184. package/package.json +54 -64
  185. package/dist/react-bootstrap.min.js.map +0 -1
  186. package/es/PaginationButton.js +0 -98
  187. package/es/utils/TransitionEvents.js +0 -109
  188. package/lib/PaginationButton.js +0 -137
  189. package/lib/utils/TransitionEvents.js +0 -113
@@ -1,98 +0,0 @@
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 classNames from 'classnames';
7
- import React from 'react';
8
- import PropTypes from 'prop-types';
9
- import elementType from 'prop-types-extra/lib/elementType';
10
-
11
- import SafeAnchor from './SafeAnchor';
12
- import createChainedFunction from './utils/createChainedFunction';
13
-
14
- // TODO: This should be `<Pagination.Item>`.
15
-
16
- // TODO: This should use `componentClass` like other components.
17
-
18
- var propTypes = {
19
- componentClass: elementType,
20
- className: PropTypes.string,
21
- eventKey: PropTypes.any,
22
- onSelect: PropTypes.func,
23
- disabled: PropTypes.bool,
24
- active: PropTypes.bool,
25
- onClick: PropTypes.func
26
- };
27
-
28
- var defaultProps = {
29
- componentClass: SafeAnchor,
30
- active: false,
31
- disabled: false
32
- };
33
-
34
- var PaginationButton = function (_React$Component) {
35
- _inherits(PaginationButton, _React$Component);
36
-
37
- function PaginationButton(props, context) {
38
- _classCallCheck(this, PaginationButton);
39
-
40
- var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
41
-
42
- _this.handleClick = _this.handleClick.bind(_this);
43
- return _this;
44
- }
45
-
46
- PaginationButton.prototype.handleClick = function handleClick(event) {
47
- var _props = this.props,
48
- disabled = _props.disabled,
49
- onSelect = _props.onSelect,
50
- eventKey = _props.eventKey;
51
-
52
-
53
- if (disabled) {
54
- return;
55
- }
56
-
57
- if (onSelect) {
58
- onSelect(eventKey, event);
59
- }
60
- };
61
-
62
- PaginationButton.prototype.render = function render() {
63
- var _props2 = this.props,
64
- Component = _props2.componentClass,
65
- active = _props2.active,
66
- disabled = _props2.disabled,
67
- onClick = _props2.onClick,
68
- className = _props2.className,
69
- style = _props2.style,
70
- props = _objectWithoutProperties(_props2, ['componentClass', 'active', 'disabled', 'onClick', 'className', 'style']);
71
-
72
- if (Component === SafeAnchor) {
73
- // Assume that custom components want `eventKey`.
74
- delete props.eventKey;
75
- }
76
-
77
- delete props.onSelect;
78
-
79
- return React.createElement(
80
- 'li',
81
- {
82
- className: classNames(className, { active: active, disabled: disabled }),
83
- style: style
84
- },
85
- React.createElement(Component, _extends({}, props, {
86
- disabled: disabled,
87
- onClick: createChainedFunction(onClick, this.handleClick)
88
- }))
89
- );
90
- };
91
-
92
- return PaginationButton;
93
- }(React.Component);
94
-
95
- PaginationButton.propTypes = propTypes;
96
- PaginationButton.defaultProps = defaultProps;
97
-
98
- export default PaginationButton;
@@ -1,109 +0,0 @@
1
- /**
2
- * Copyright 2013-2014, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This file contains a modified version of:
6
- * https://github.com/facebook/react/blob/v0.12.0/src/addons/transitions/ReactTransitionEvents.js
7
- *
8
- * This source code is licensed under the BSD-style license found here:
9
- * https://github.com/facebook/react/blob/v0.12.0/LICENSE
10
- * An additional grant of patent rights can be found here:
11
- * https://github.com/facebook/react/blob/v0.12.0/PATENTS
12
- */
13
-
14
- var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
15
-
16
- /**
17
- * EVENT_NAME_MAP is used to determine which event fired when a
18
- * transition/animation ends, based on the style property used to
19
- * define that event.
20
- */
21
- var EVENT_NAME_MAP = {
22
- transitionend: {
23
- 'transition': 'transitionend',
24
- 'WebkitTransition': 'webkitTransitionEnd',
25
- 'MozTransition': 'mozTransitionEnd',
26
- 'OTransition': 'oTransitionEnd',
27
- 'msTransition': 'MSTransitionEnd'
28
- },
29
-
30
- animationend: {
31
- 'animation': 'animationend',
32
- 'WebkitAnimation': 'webkitAnimationEnd',
33
- 'MozAnimation': 'mozAnimationEnd',
34
- 'OAnimation': 'oAnimationEnd',
35
- 'msAnimation': 'MSAnimationEnd'
36
- }
37
- };
38
-
39
- var endEvents = [];
40
-
41
- function detectEvents() {
42
- var testEl = document.createElement('div');
43
- var style = testEl.style;
44
-
45
- // On some platforms, in particular some releases of Android 4.x,
46
- // the un-prefixed "animation" and "transition" properties are defined on the
47
- // style object but the events that fire will still be prefixed, so we need
48
- // to check if the un-prefixed events are useable, and if not remove them
49
- // from the map
50
- if (!('AnimationEvent' in window)) {
51
- delete EVENT_NAME_MAP.animationend.animation;
52
- }
53
-
54
- if (!('TransitionEvent' in window)) {
55
- delete EVENT_NAME_MAP.transitionend.transition;
56
- }
57
-
58
- for (var baseEventName in EVENT_NAME_MAP) {
59
- // eslint-disable-line guard-for-in
60
- var baseEvents = EVENT_NAME_MAP[baseEventName];
61
- for (var styleName in baseEvents) {
62
- if (styleName in style) {
63
- endEvents.push(baseEvents[styleName]);
64
- break;
65
- }
66
- }
67
- }
68
- }
69
-
70
- if (canUseDOM) {
71
- detectEvents();
72
- }
73
-
74
- // We use the raw {add|remove}EventListener() call because EventListener
75
- // does not know how to remove event listeners and we really should
76
- // clean up. Also, these events are not triggered in older browsers
77
- // so we should be A-OK here.
78
-
79
- function addEventListener(node, eventName, eventListener) {
80
- node.addEventListener(eventName, eventListener, false);
81
- }
82
-
83
- function removeEventListener(node, eventName, eventListener) {
84
- node.removeEventListener(eventName, eventListener, false);
85
- }
86
-
87
- var ReactTransitionEvents = {
88
- addEndEventListener: function addEndEventListener(node, eventListener) {
89
- if (endEvents.length === 0) {
90
- // If CSS transitions are not supported, trigger an "end animation"
91
- // event immediately.
92
- window.setTimeout(eventListener, 0);
93
- return;
94
- }
95
- endEvents.forEach(function (endEvent) {
96
- addEventListener(node, endEvent, eventListener);
97
- });
98
- },
99
- removeEndEventListener: function removeEndEventListener(node, eventListener) {
100
- if (endEvents.length === 0) {
101
- return;
102
- }
103
- endEvents.forEach(function (endEvent) {
104
- removeEventListener(node, endEvent, eventListener);
105
- });
106
- }
107
- };
108
-
109
- export default ReactTransitionEvents;
@@ -1,137 +0,0 @@
1
- 'use strict';
2
-
3
- exports.__esModule = true;
4
-
5
- var _extends2 = require('babel-runtime/helpers/extends');
6
-
7
- var _extends3 = _interopRequireDefault(_extends2);
8
-
9
- var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
10
-
11
- var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
12
-
13
- var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
14
-
15
- var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
16
-
17
- var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
18
-
19
- var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
20
-
21
- var _inherits2 = require('babel-runtime/helpers/inherits');
22
-
23
- var _inherits3 = _interopRequireDefault(_inherits2);
24
-
25
- var _classnames = require('classnames');
26
-
27
- var _classnames2 = _interopRequireDefault(_classnames);
28
-
29
- var _react = require('react');
30
-
31
- var _react2 = _interopRequireDefault(_react);
32
-
33
- var _propTypes = require('prop-types');
34
-
35
- var _propTypes2 = _interopRequireDefault(_propTypes);
36
-
37
- var _elementType = require('prop-types-extra/lib/elementType');
38
-
39
- var _elementType2 = _interopRequireDefault(_elementType);
40
-
41
- var _SafeAnchor = require('./SafeAnchor');
42
-
43
- var _SafeAnchor2 = _interopRequireDefault(_SafeAnchor);
44
-
45
- var _createChainedFunction = require('./utils/createChainedFunction');
46
-
47
- var _createChainedFunction2 = _interopRequireDefault(_createChainedFunction);
48
-
49
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
50
-
51
- // TODO: This should be `<Pagination.Item>`.
52
-
53
- // TODO: This should use `componentClass` like other components.
54
-
55
- var propTypes = {
56
- componentClass: _elementType2['default'],
57
- className: _propTypes2['default'].string,
58
- eventKey: _propTypes2['default'].any,
59
- onSelect: _propTypes2['default'].func,
60
- disabled: _propTypes2['default'].bool,
61
- active: _propTypes2['default'].bool,
62
- onClick: _propTypes2['default'].func
63
- };
64
-
65
- var defaultProps = {
66
- componentClass: _SafeAnchor2['default'],
67
- active: false,
68
- disabled: false
69
- };
70
-
71
- var PaginationButton = function (_React$Component) {
72
- (0, _inherits3['default'])(PaginationButton, _React$Component);
73
-
74
- function PaginationButton(props, context) {
75
- (0, _classCallCheck3['default'])(this, PaginationButton);
76
-
77
- var _this = (0, _possibleConstructorReturn3['default'])(this, _React$Component.call(this, props, context));
78
-
79
- _this.handleClick = _this.handleClick.bind(_this);
80
- return _this;
81
- }
82
-
83
- PaginationButton.prototype.handleClick = function handleClick(event) {
84
- var _props = this.props,
85
- disabled = _props.disabled,
86
- onSelect = _props.onSelect,
87
- eventKey = _props.eventKey;
88
-
89
-
90
- if (disabled) {
91
- return;
92
- }
93
-
94
- if (onSelect) {
95
- onSelect(eventKey, event);
96
- }
97
- };
98
-
99
- PaginationButton.prototype.render = function render() {
100
- var _props2 = this.props,
101
- Component = _props2.componentClass,
102
- active = _props2.active,
103
- disabled = _props2.disabled,
104
- onClick = _props2.onClick,
105
- className = _props2.className,
106
- style = _props2.style,
107
- props = (0, _objectWithoutProperties3['default'])(_props2, ['componentClass', 'active', 'disabled', 'onClick', 'className', 'style']);
108
-
109
-
110
- if (Component === _SafeAnchor2['default']) {
111
- // Assume that custom components want `eventKey`.
112
- delete props.eventKey;
113
- }
114
-
115
- delete props.onSelect;
116
-
117
- return _react2['default'].createElement(
118
- 'li',
119
- {
120
- className: (0, _classnames2['default'])(className, { active: active, disabled: disabled }),
121
- style: style
122
- },
123
- _react2['default'].createElement(Component, (0, _extends3['default'])({}, props, {
124
- disabled: disabled,
125
- onClick: (0, _createChainedFunction2['default'])(onClick, this.handleClick)
126
- }))
127
- );
128
- };
129
-
130
- return PaginationButton;
131
- }(_react2['default'].Component);
132
-
133
- PaginationButton.propTypes = propTypes;
134
- PaginationButton.defaultProps = defaultProps;
135
-
136
- exports['default'] = PaginationButton;
137
- module.exports = exports['default'];
@@ -1,113 +0,0 @@
1
- 'use strict';
2
-
3
- exports.__esModule = true;
4
- /**
5
- * Copyright 2013-2014, Facebook, Inc.
6
- * All rights reserved.
7
- *
8
- * This file contains a modified version of:
9
- * https://github.com/facebook/react/blob/v0.12.0/src/addons/transitions/ReactTransitionEvents.js
10
- *
11
- * This source code is licensed under the BSD-style license found here:
12
- * https://github.com/facebook/react/blob/v0.12.0/LICENSE
13
- * An additional grant of patent rights can be found here:
14
- * https://github.com/facebook/react/blob/v0.12.0/PATENTS
15
- */
16
-
17
- var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
18
-
19
- /**
20
- * EVENT_NAME_MAP is used to determine which event fired when a
21
- * transition/animation ends, based on the style property used to
22
- * define that event.
23
- */
24
- var EVENT_NAME_MAP = {
25
- transitionend: {
26
- 'transition': 'transitionend',
27
- 'WebkitTransition': 'webkitTransitionEnd',
28
- 'MozTransition': 'mozTransitionEnd',
29
- 'OTransition': 'oTransitionEnd',
30
- 'msTransition': 'MSTransitionEnd'
31
- },
32
-
33
- animationend: {
34
- 'animation': 'animationend',
35
- 'WebkitAnimation': 'webkitAnimationEnd',
36
- 'MozAnimation': 'mozAnimationEnd',
37
- 'OAnimation': 'oAnimationEnd',
38
- 'msAnimation': 'MSAnimationEnd'
39
- }
40
- };
41
-
42
- var endEvents = [];
43
-
44
- function detectEvents() {
45
- var testEl = document.createElement('div');
46
- var style = testEl.style;
47
-
48
- // On some platforms, in particular some releases of Android 4.x,
49
- // the un-prefixed "animation" and "transition" properties are defined on the
50
- // style object but the events that fire will still be prefixed, so we need
51
- // to check if the un-prefixed events are useable, and if not remove them
52
- // from the map
53
- if (!('AnimationEvent' in window)) {
54
- delete EVENT_NAME_MAP.animationend.animation;
55
- }
56
-
57
- if (!('TransitionEvent' in window)) {
58
- delete EVENT_NAME_MAP.transitionend.transition;
59
- }
60
-
61
- for (var baseEventName in EVENT_NAME_MAP) {
62
- // eslint-disable-line guard-for-in
63
- var baseEvents = EVENT_NAME_MAP[baseEventName];
64
- for (var styleName in baseEvents) {
65
- if (styleName in style) {
66
- endEvents.push(baseEvents[styleName]);
67
- break;
68
- }
69
- }
70
- }
71
- }
72
-
73
- if (canUseDOM) {
74
- detectEvents();
75
- }
76
-
77
- // We use the raw {add|remove}EventListener() call because EventListener
78
- // does not know how to remove event listeners and we really should
79
- // clean up. Also, these events are not triggered in older browsers
80
- // so we should be A-OK here.
81
-
82
- function addEventListener(node, eventName, eventListener) {
83
- node.addEventListener(eventName, eventListener, false);
84
- }
85
-
86
- function removeEventListener(node, eventName, eventListener) {
87
- node.removeEventListener(eventName, eventListener, false);
88
- }
89
-
90
- var ReactTransitionEvents = {
91
- addEndEventListener: function addEndEventListener(node, eventListener) {
92
- if (endEvents.length === 0) {
93
- // If CSS transitions are not supported, trigger an "end animation"
94
- // event immediately.
95
- window.setTimeout(eventListener, 0);
96
- return;
97
- }
98
- endEvents.forEach(function (endEvent) {
99
- addEventListener(node, endEvent, eventListener);
100
- });
101
- },
102
- removeEndEventListener: function removeEndEventListener(node, eventListener) {
103
- if (endEvents.length === 0) {
104
- return;
105
- }
106
- endEvents.forEach(function (endEvent) {
107
- removeEventListener(node, endEvent, eventListener);
108
- });
109
- }
110
- };
111
-
112
- exports['default'] = ReactTransitionEvents;
113
- module.exports = exports['default'];