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/PaginationButton.js
DELETED
|
@@ -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;
|
package/lib/PaginationButton.js
DELETED
|
@@ -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'];
|