Latest updates from IceHrmPro
This commit is contained in:
38
web/node_modules/rc-animate/HISTORY.md
generated
vendored
Normal file
38
web/node_modules/rc-animate/HISTORY.md
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
# History
|
||||
----
|
||||
|
||||
## 2.10.2 / 2019-11-09
|
||||
|
||||
- There should not be any lifecycle warning now!
|
||||
|
||||
## 2.10.0 / 2019-08-27
|
||||
|
||||
- CSSMotionList support `component` to be `false` to render nothing
|
||||
|
||||
## 2.9.0 / 2019-07-09
|
||||
|
||||
- CSSMotion support forward ref to render props
|
||||
|
||||
## 2.8.0 / 2019-04-29
|
||||
|
||||
- `keys` on CSSMotionList can be an object
|
||||
|
||||
## 2.7.0 / 2019-04-29
|
||||
|
||||
- add CSSMotionList component
|
||||
|
||||
## 2.6.0 / 2018-11-26
|
||||
|
||||
- add CSSMotion component
|
||||
|
||||
## 2.3.0 / 2016-07-05
|
||||
|
||||
- support null/undefined child: https://github.com/react-component/animate/pull/11
|
||||
|
||||
## 2.2.0 / 2016-06-28
|
||||
|
||||
- support transitionName as object
|
||||
|
||||
## 2.1.0 / 2016-06-16
|
||||
|
||||
- make onEnter/onLeave/onAppear async
|
||||
9
web/node_modules/rc-animate/LICENSE.md
generated
vendored
Normal file
9
web/node_modules/rc-animate/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-present yiminghe
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
188
web/node_modules/rc-animate/README.md
generated
vendored
Normal file
188
web/node_modules/rc-animate/README.md
generated
vendored
Normal file
@@ -0,0 +1,188 @@
|
||||
# rc-animate
|
||||
---
|
||||
|
||||
animate react element easily
|
||||
|
||||
[![NPM version][npm-image]][npm-url]
|
||||
[![build status][travis-image]][travis-url]
|
||||
[![Test coverage][coveralls-image]][coveralls-url]
|
||||
[![gemnasium deps][gemnasium-image]][gemnasium-url]
|
||||
[![node version][node-image]][node-url]
|
||||
[![npm download][download-image]][download-url]
|
||||
|
||||
[npm-image]: http://img.shields.io/npm/v/rc-animate.svg?style=flat-square
|
||||
[npm-url]: http://npmjs.org/package/rc-animate
|
||||
[travis-image]: https://img.shields.io/travis/react-component/animate.svg?style=flat-square
|
||||
[travis-url]: https://travis-ci.org/react-component/animate
|
||||
[coveralls-image]: https://img.shields.io/coveralls/react-component/animate.svg?style=flat-square
|
||||
[coveralls-url]: https://coveralls.io/r/react-component/animate?branch=master
|
||||
[gemnasium-image]: http://img.shields.io/gemnasium/react-component/animate.svg?style=flat-square
|
||||
[gemnasium-url]: https://gemnasium.com/react-component/animate
|
||||
[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square
|
||||
[node-url]: http://nodejs.org/download/
|
||||
[download-image]: https://img.shields.io/npm/dm/rc-animate.svg?style=flat-square
|
||||
[download-url]: https://npmjs.org/package/rc-animate
|
||||
|
||||
## Feature
|
||||
|
||||
* support ie8,ie8+,chrome,firefox,safari
|
||||
|
||||
## install
|
||||
|
||||
[](https://npmjs.org/package/rc-animate)
|
||||
|
||||
## Usage
|
||||
|
||||
```jsx
|
||||
import Animate from 'rc-animate';
|
||||
|
||||
ReactDOM.render(
|
||||
<Animate animation={{ ... }}>
|
||||
<p key="1">1</p>
|
||||
<p key="2">2</p>
|
||||
</Animate>
|
||||
, mountNode);
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### props
|
||||
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 100px;">name</th>
|
||||
<th style="width: 50px;">type</th>
|
||||
<th style="width: 50px;">default</th>
|
||||
<th>description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>component</td>
|
||||
<td>React.Element/String</td>
|
||||
<td>'span'</td>
|
||||
<td>wrap dom node or component for children. set to '' if you do not wrap for only one child</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>componentProps</td>
|
||||
<td>Object</td>
|
||||
<td>{}</td>
|
||||
<td>extra props that will be passed to component</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>showProp</td>
|
||||
<td>String</td>
|
||||
<td></td>
|
||||
<td>using prop for show and hide. [demo](http://react-component.github.io/animate/examples/hide-todo.html) </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>exclusive</td>
|
||||
<td>Boolean</td>
|
||||
<td></td>
|
||||
<td>whether allow only one set of animations(enter and leave) at the same time. </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>transitionName</td>
|
||||
<td>String|Object</td>
|
||||
<td></td>
|
||||
<td>specify corresponding css, see ReactCSSTransitionGroup</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>transitionAppear</td>
|
||||
<td>Boolean</td>
|
||||
<td>false</td>
|
||||
<td>whether support transition appear anim</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>transitionEnter</td>
|
||||
<td>Boolean</td>
|
||||
<td>true</td>
|
||||
<td>whether support transition enter anim</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>transitionLeave</td>
|
||||
<td>Boolean</td>
|
||||
<td>true</td>
|
||||
<td>whether support transition leave anim</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>onEnd</td>
|
||||
<td>function(key:String, exists:Boolean)</td>
|
||||
<td>true</td>
|
||||
<td>animation end callback</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>animation</td>
|
||||
<td>Object</td>
|
||||
<td>{}</td>
|
||||
<td>
|
||||
to animate with js. see animation format below.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### animation format
|
||||
|
||||
with appear, enter and leave as keys. for example:
|
||||
|
||||
```js
|
||||
{
|
||||
appear: function(node, done){
|
||||
node.style.display='none';
|
||||
$(node).slideUp(done);
|
||||
return {
|
||||
stop:function(){
|
||||
// jq will call done on finish
|
||||
$(node).stop(true);
|
||||
}
|
||||
};
|
||||
},
|
||||
enter: function(){
|
||||
this.appear.apply(this,arguments);
|
||||
},
|
||||
leave: function(node, done){
|
||||
node.style.display='';
|
||||
$(node).slideDown(done);
|
||||
return {
|
||||
stop:function(){
|
||||
// jq will call done on finish
|
||||
$(node).stop(true);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
```
|
||||
npm install
|
||||
npm start
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
http://localhost:8200/examples/index.md
|
||||
|
||||
online example: http://react-component.github.io/animate/examples/
|
||||
|
||||
## Test Case
|
||||
|
||||
```
|
||||
npm test
|
||||
npm run chrome-test
|
||||
```
|
||||
|
||||
## Coverage
|
||||
|
||||
```
|
||||
npm run coverage
|
||||
```
|
||||
|
||||
open coverage/ dir
|
||||
|
||||
## License
|
||||
|
||||
rc-animate is released under the MIT license.
|
||||
354
web/node_modules/rc-animate/es/Animate.js
generated
vendored
Normal file
354
web/node_modules/rc-animate/es/Animate.js
generated
vendored
Normal file
@@ -0,0 +1,354 @@
|
||||
import _extends from 'babel-runtime/helpers/extends';
|
||||
import _defineProperty from 'babel-runtime/helpers/defineProperty';
|
||||
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
||||
import _createClass from 'babel-runtime/helpers/createClass';
|
||||
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
||||
import _inherits from 'babel-runtime/helpers/inherits';
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import unsafeLifecyclesPolyfill from 'rc-util/es/unsafeLifecyclesPolyfill';
|
||||
import { toArrayChildren, mergeChildren, findShownChildInChildrenByKey, findChildInChildrenByKey, isSameChildren } from './ChildrenUtils';
|
||||
import AnimateChild from './AnimateChild';
|
||||
import animUtil from './util/animate';
|
||||
|
||||
var defaultKey = 'rc_animate_' + Date.now();
|
||||
|
||||
function getChildrenFromProps(props) {
|
||||
var children = props.children;
|
||||
if (React.isValidElement(children)) {
|
||||
if (!children.key) {
|
||||
return React.cloneElement(children, {
|
||||
key: defaultKey
|
||||
});
|
||||
}
|
||||
}
|
||||
return children;
|
||||
}
|
||||
|
||||
function noop() {}
|
||||
|
||||
var Animate = function (_React$Component) {
|
||||
_inherits(Animate, _React$Component);
|
||||
|
||||
// eslint-disable-line
|
||||
|
||||
function Animate(props) {
|
||||
_classCallCheck(this, Animate);
|
||||
|
||||
var _this = _possibleConstructorReturn(this, (Animate.__proto__ || Object.getPrototypeOf(Animate)).call(this, props));
|
||||
|
||||
_initialiseProps.call(_this);
|
||||
|
||||
_this.currentlyAnimatingKeys = {};
|
||||
_this.keysToEnter = [];
|
||||
_this.keysToLeave = [];
|
||||
|
||||
_this.state = {
|
||||
children: toArrayChildren(getChildrenFromProps(props))
|
||||
};
|
||||
|
||||
_this.childrenRefs = {};
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(Animate, [{
|
||||
key: 'componentDidMount',
|
||||
value: function componentDidMount() {
|
||||
var _this2 = this;
|
||||
|
||||
var showProp = this.props.showProp;
|
||||
var children = this.state.children;
|
||||
if (showProp) {
|
||||
children = children.filter(function (child) {
|
||||
return !!child.props[showProp];
|
||||
});
|
||||
}
|
||||
children.forEach(function (child) {
|
||||
if (child) {
|
||||
_this2.performAppear(child.key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: 'componentWillReceiveProps',
|
||||
value: function componentWillReceiveProps(nextProps) {
|
||||
var _this3 = this;
|
||||
|
||||
this.nextProps = nextProps;
|
||||
var nextChildren = toArrayChildren(getChildrenFromProps(nextProps));
|
||||
var props = this.props;
|
||||
// exclusive needs immediate response
|
||||
if (props.exclusive) {
|
||||
Object.keys(this.currentlyAnimatingKeys).forEach(function (key) {
|
||||
_this3.stop(key);
|
||||
});
|
||||
}
|
||||
var showProp = props.showProp;
|
||||
var currentlyAnimatingKeys = this.currentlyAnimatingKeys;
|
||||
// last props children if exclusive
|
||||
var currentChildren = props.exclusive ? toArrayChildren(getChildrenFromProps(props)) : this.state.children;
|
||||
// in case destroy in showProp mode
|
||||
var newChildren = [];
|
||||
if (showProp) {
|
||||
currentChildren.forEach(function (currentChild) {
|
||||
var nextChild = currentChild && findChildInChildrenByKey(nextChildren, currentChild.key);
|
||||
var newChild = void 0;
|
||||
if ((!nextChild || !nextChild.props[showProp]) && currentChild.props[showProp]) {
|
||||
newChild = React.cloneElement(nextChild || currentChild, _defineProperty({}, showProp, true));
|
||||
} else {
|
||||
newChild = nextChild;
|
||||
}
|
||||
if (newChild) {
|
||||
newChildren.push(newChild);
|
||||
}
|
||||
});
|
||||
nextChildren.forEach(function (nextChild) {
|
||||
if (!nextChild || !findChildInChildrenByKey(currentChildren, nextChild.key)) {
|
||||
newChildren.push(nextChild);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
newChildren = mergeChildren(currentChildren, nextChildren);
|
||||
}
|
||||
|
||||
// need render to avoid update
|
||||
this.setState({
|
||||
children: newChildren
|
||||
});
|
||||
|
||||
nextChildren.forEach(function (child) {
|
||||
var key = child && child.key;
|
||||
if (child && currentlyAnimatingKeys[key]) {
|
||||
return;
|
||||
}
|
||||
var hasPrev = child && findChildInChildrenByKey(currentChildren, key);
|
||||
if (showProp) {
|
||||
var showInNext = child.props[showProp];
|
||||
if (hasPrev) {
|
||||
var showInNow = findShownChildInChildrenByKey(currentChildren, key, showProp);
|
||||
if (!showInNow && showInNext) {
|
||||
_this3.keysToEnter.push(key);
|
||||
}
|
||||
} else if (showInNext) {
|
||||
_this3.keysToEnter.push(key);
|
||||
}
|
||||
} else if (!hasPrev) {
|
||||
_this3.keysToEnter.push(key);
|
||||
}
|
||||
});
|
||||
|
||||
currentChildren.forEach(function (child) {
|
||||
var key = child && child.key;
|
||||
if (child && currentlyAnimatingKeys[key]) {
|
||||
return;
|
||||
}
|
||||
var hasNext = child && findChildInChildrenByKey(nextChildren, key);
|
||||
if (showProp) {
|
||||
var showInNow = child.props[showProp];
|
||||
if (hasNext) {
|
||||
var showInNext = findShownChildInChildrenByKey(nextChildren, key, showProp);
|
||||
if (!showInNext && showInNow) {
|
||||
_this3.keysToLeave.push(key);
|
||||
}
|
||||
} else if (showInNow) {
|
||||
_this3.keysToLeave.push(key);
|
||||
}
|
||||
} else if (!hasNext) {
|
||||
_this3.keysToLeave.push(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: 'componentDidUpdate',
|
||||
value: function componentDidUpdate() {
|
||||
var keysToEnter = this.keysToEnter;
|
||||
this.keysToEnter = [];
|
||||
keysToEnter.forEach(this.performEnter);
|
||||
var keysToLeave = this.keysToLeave;
|
||||
this.keysToLeave = [];
|
||||
keysToLeave.forEach(this.performLeave);
|
||||
}
|
||||
}, {
|
||||
key: 'isValidChildByKey',
|
||||
value: function isValidChildByKey(currentChildren, key) {
|
||||
var showProp = this.props.showProp;
|
||||
if (showProp) {
|
||||
return findShownChildInChildrenByKey(currentChildren, key, showProp);
|
||||
}
|
||||
return findChildInChildrenByKey(currentChildren, key);
|
||||
}
|
||||
}, {
|
||||
key: 'stop',
|
||||
value: function stop(key) {
|
||||
delete this.currentlyAnimatingKeys[key];
|
||||
var component = this.childrenRefs[key];
|
||||
if (component) {
|
||||
component.stop();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'render',
|
||||
value: function render() {
|
||||
var _this4 = this;
|
||||
|
||||
var props = this.props;
|
||||
this.nextProps = props;
|
||||
var stateChildren = this.state.children;
|
||||
var children = null;
|
||||
if (stateChildren) {
|
||||
children = stateChildren.map(function (child) {
|
||||
if (child === null || child === undefined) {
|
||||
return child;
|
||||
}
|
||||
if (!child.key) {
|
||||
throw new Error('must set key for <rc-animate> children');
|
||||
}
|
||||
return React.createElement(
|
||||
AnimateChild,
|
||||
{
|
||||
key: child.key,
|
||||
ref: function ref(node) {
|
||||
_this4.childrenRefs[child.key] = node;
|
||||
},
|
||||
animation: props.animation,
|
||||
transitionName: props.transitionName,
|
||||
transitionEnter: props.transitionEnter,
|
||||
transitionAppear: props.transitionAppear,
|
||||
transitionLeave: props.transitionLeave
|
||||
},
|
||||
child
|
||||
);
|
||||
});
|
||||
}
|
||||
var Component = props.component;
|
||||
if (Component) {
|
||||
var passedProps = props;
|
||||
if (typeof Component === 'string') {
|
||||
passedProps = _extends({
|
||||
className: props.className,
|
||||
style: props.style
|
||||
}, props.componentProps);
|
||||
}
|
||||
return React.createElement(
|
||||
Component,
|
||||
passedProps,
|
||||
children
|
||||
);
|
||||
}
|
||||
return children[0] || null;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Animate;
|
||||
}(React.Component);
|
||||
|
||||
Animate.isAnimate = true;
|
||||
Animate.propTypes = {
|
||||
className: PropTypes.string,
|
||||
style: PropTypes.object,
|
||||
component: PropTypes.any,
|
||||
componentProps: PropTypes.object,
|
||||
animation: PropTypes.object,
|
||||
transitionName: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
||||
transitionEnter: PropTypes.bool,
|
||||
transitionAppear: PropTypes.bool,
|
||||
exclusive: PropTypes.bool,
|
||||
transitionLeave: PropTypes.bool,
|
||||
onEnd: PropTypes.func,
|
||||
onEnter: PropTypes.func,
|
||||
onLeave: PropTypes.func,
|
||||
onAppear: PropTypes.func,
|
||||
showProp: PropTypes.string,
|
||||
children: PropTypes.node
|
||||
};
|
||||
Animate.defaultProps = {
|
||||
animation: {},
|
||||
component: 'span',
|
||||
componentProps: {},
|
||||
transitionEnter: true,
|
||||
transitionLeave: true,
|
||||
transitionAppear: false,
|
||||
onEnd: noop,
|
||||
onEnter: noop,
|
||||
onLeave: noop,
|
||||
onAppear: noop
|
||||
};
|
||||
|
||||
var _initialiseProps = function _initialiseProps() {
|
||||
var _this5 = this;
|
||||
|
||||
this.performEnter = function (key) {
|
||||
// may already remove by exclusive
|
||||
if (_this5.childrenRefs[key]) {
|
||||
_this5.currentlyAnimatingKeys[key] = true;
|
||||
_this5.childrenRefs[key].componentWillEnter(_this5.handleDoneAdding.bind(_this5, key, 'enter'));
|
||||
}
|
||||
};
|
||||
|
||||
this.performAppear = function (key) {
|
||||
if (_this5.childrenRefs[key]) {
|
||||
_this5.currentlyAnimatingKeys[key] = true;
|
||||
_this5.childrenRefs[key].componentWillAppear(_this5.handleDoneAdding.bind(_this5, key, 'appear'));
|
||||
}
|
||||
};
|
||||
|
||||
this.handleDoneAdding = function (key, type) {
|
||||
var props = _this5.props;
|
||||
delete _this5.currentlyAnimatingKeys[key];
|
||||
// if update on exclusive mode, skip check
|
||||
if (props.exclusive && props !== _this5.nextProps) {
|
||||
return;
|
||||
}
|
||||
var currentChildren = toArrayChildren(getChildrenFromProps(props));
|
||||
if (!_this5.isValidChildByKey(currentChildren, key)) {
|
||||
// exclusive will not need this
|
||||
_this5.performLeave(key);
|
||||
} else if (type === 'appear') {
|
||||
if (animUtil.allowAppearCallback(props)) {
|
||||
props.onAppear(key);
|
||||
props.onEnd(key, true);
|
||||
}
|
||||
} else if (animUtil.allowEnterCallback(props)) {
|
||||
props.onEnter(key);
|
||||
props.onEnd(key, true);
|
||||
}
|
||||
};
|
||||
|
||||
this.performLeave = function (key) {
|
||||
// may already remove by exclusive
|
||||
if (_this5.childrenRefs[key]) {
|
||||
_this5.currentlyAnimatingKeys[key] = true;
|
||||
_this5.childrenRefs[key].componentWillLeave(_this5.handleDoneLeaving.bind(_this5, key));
|
||||
}
|
||||
};
|
||||
|
||||
this.handleDoneLeaving = function (key) {
|
||||
var props = _this5.props;
|
||||
delete _this5.currentlyAnimatingKeys[key];
|
||||
// if update on exclusive mode, skip check
|
||||
if (props.exclusive && props !== _this5.nextProps) {
|
||||
return;
|
||||
}
|
||||
var currentChildren = toArrayChildren(getChildrenFromProps(props));
|
||||
// in case state change is too fast
|
||||
if (_this5.isValidChildByKey(currentChildren, key)) {
|
||||
_this5.performEnter(key);
|
||||
} else {
|
||||
var end = function end() {
|
||||
if (animUtil.allowLeaveCallback(props)) {
|
||||
props.onLeave(key);
|
||||
props.onEnd(key, false);
|
||||
}
|
||||
};
|
||||
if (!isSameChildren(_this5.state.children, currentChildren, props.showProp)) {
|
||||
_this5.setState({
|
||||
children: currentChildren
|
||||
}, end);
|
||||
} else {
|
||||
end();
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export default unsafeLifecyclesPolyfill(Animate);
|
||||
113
web/node_modules/rc-animate/es/AnimateChild.js
generated
vendored
Normal file
113
web/node_modules/rc-animate/es/AnimateChild.js
generated
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
||||
import _createClass from 'babel-runtime/helpers/createClass';
|
||||
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
||||
import _inherits from 'babel-runtime/helpers/inherits';
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import PropTypes from 'prop-types';
|
||||
import cssAnimate, { isCssAnimationSupported } from 'css-animation';
|
||||
import animUtil from './util/animate';
|
||||
|
||||
var transitionMap = {
|
||||
enter: 'transitionEnter',
|
||||
appear: 'transitionAppear',
|
||||
leave: 'transitionLeave'
|
||||
};
|
||||
|
||||
var AnimateChild = function (_React$Component) {
|
||||
_inherits(AnimateChild, _React$Component);
|
||||
|
||||
function AnimateChild() {
|
||||
_classCallCheck(this, AnimateChild);
|
||||
|
||||
return _possibleConstructorReturn(this, (AnimateChild.__proto__ || Object.getPrototypeOf(AnimateChild)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(AnimateChild, [{
|
||||
key: 'componentWillUnmount',
|
||||
value: function componentWillUnmount() {
|
||||
this.stop();
|
||||
}
|
||||
}, {
|
||||
key: 'componentWillEnter',
|
||||
value: function componentWillEnter(done) {
|
||||
if (animUtil.isEnterSupported(this.props)) {
|
||||
this.transition('enter', done);
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'componentWillAppear',
|
||||
value: function componentWillAppear(done) {
|
||||
if (animUtil.isAppearSupported(this.props)) {
|
||||
this.transition('appear', done);
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'componentWillLeave',
|
||||
value: function componentWillLeave(done) {
|
||||
if (animUtil.isLeaveSupported(this.props)) {
|
||||
this.transition('leave', done);
|
||||
} else {
|
||||
// always sync, do not interupt with react component life cycle
|
||||
// update hidden -> animate hidden ->
|
||||
// didUpdate -> animate leave -> unmount (if animate is none)
|
||||
done();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'transition',
|
||||
value: function transition(animationType, finishCallback) {
|
||||
var _this2 = this;
|
||||
|
||||
var node = ReactDOM.findDOMNode(this);
|
||||
var props = this.props;
|
||||
var transitionName = props.transitionName;
|
||||
var nameIsObj = typeof transitionName === 'object';
|
||||
this.stop();
|
||||
var end = function end() {
|
||||
_this2.stopper = null;
|
||||
finishCallback();
|
||||
};
|
||||
if ((isCssAnimationSupported || !props.animation[animationType]) && transitionName && props[transitionMap[animationType]]) {
|
||||
var name = nameIsObj ? transitionName[animationType] : transitionName + '-' + animationType;
|
||||
var activeName = name + '-active';
|
||||
if (nameIsObj && transitionName[animationType + 'Active']) {
|
||||
activeName = transitionName[animationType + 'Active'];
|
||||
}
|
||||
this.stopper = cssAnimate(node, {
|
||||
name: name,
|
||||
active: activeName
|
||||
}, end);
|
||||
} else {
|
||||
this.stopper = props.animation[animationType](node, end);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'stop',
|
||||
value: function stop() {
|
||||
var stopper = this.stopper;
|
||||
if (stopper) {
|
||||
this.stopper = null;
|
||||
stopper.stop();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'render',
|
||||
value: function render() {
|
||||
return this.props.children;
|
||||
}
|
||||
}]);
|
||||
|
||||
return AnimateChild;
|
||||
}(React.Component);
|
||||
|
||||
AnimateChild.propTypes = {
|
||||
children: PropTypes.any,
|
||||
animation: PropTypes.any,
|
||||
transitionName: PropTypes.any
|
||||
};
|
||||
export default AnimateChild;
|
||||
343
web/node_modules/rc-animate/es/CSSMotion.js
generated
vendored
Normal file
343
web/node_modules/rc-animate/es/CSSMotion.js
generated
vendored
Normal file
@@ -0,0 +1,343 @@
|
||||
import _defineProperty from 'babel-runtime/helpers/defineProperty';
|
||||
import _extends from 'babel-runtime/helpers/extends';
|
||||
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
||||
import _createClass from 'babel-runtime/helpers/createClass';
|
||||
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
||||
import _inherits from 'babel-runtime/helpers/inherits';
|
||||
/* eslint-disable react/default-props-match-prop-types, react/no-multi-comp */
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { polyfill } from 'react-lifecycles-compat';
|
||||
import findDOMNode from 'rc-util/es/Dom/findDOMNode';
|
||||
import classNames from 'classnames';
|
||||
import raf from 'raf';
|
||||
import { getTransitionName, animationEndName, transitionEndName, supportTransition } from './util/motion';
|
||||
|
||||
var STATUS_NONE = 'none';
|
||||
var STATUS_APPEAR = 'appear';
|
||||
var STATUS_ENTER = 'enter';
|
||||
var STATUS_LEAVE = 'leave';
|
||||
|
||||
export var MotionPropTypes = {
|
||||
eventProps: PropTypes.object, // Internal usage. Only pass by CSSMotionList
|
||||
visible: PropTypes.bool,
|
||||
children: PropTypes.func,
|
||||
motionName: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
||||
motionAppear: PropTypes.bool,
|
||||
motionEnter: PropTypes.bool,
|
||||
motionLeave: PropTypes.bool,
|
||||
motionLeaveImmediately: PropTypes.bool, // Trigger leave motion immediately
|
||||
removeOnLeave: PropTypes.bool,
|
||||
leavedClassName: PropTypes.string,
|
||||
onAppearStart: PropTypes.func,
|
||||
onAppearActive: PropTypes.func,
|
||||
onAppearEnd: PropTypes.func,
|
||||
onEnterStart: PropTypes.func,
|
||||
onEnterActive: PropTypes.func,
|
||||
onEnterEnd: PropTypes.func,
|
||||
onLeaveStart: PropTypes.func,
|
||||
onLeaveActive: PropTypes.func,
|
||||
onLeaveEnd: PropTypes.func
|
||||
};
|
||||
|
||||
/**
|
||||
* `transitionSupport` is used for none transition test case.
|
||||
* Default we use browser transition event support check.
|
||||
*/
|
||||
export function genCSSMotion(config) {
|
||||
var transitionSupport = config;
|
||||
var forwardRef = !!React.forwardRef;
|
||||
|
||||
if (typeof config === 'object') {
|
||||
transitionSupport = config.transitionSupport;
|
||||
forwardRef = 'forwardRef' in config ? config.forwardRef : forwardRef;
|
||||
}
|
||||
|
||||
function isSupportTransition(props) {
|
||||
return !!(props.motionName && transitionSupport);
|
||||
}
|
||||
|
||||
var CSSMotion = function (_React$Component) {
|
||||
_inherits(CSSMotion, _React$Component);
|
||||
|
||||
function CSSMotion() {
|
||||
_classCallCheck(this, CSSMotion);
|
||||
|
||||
var _this = _possibleConstructorReturn(this, (CSSMotion.__proto__ || Object.getPrototypeOf(CSSMotion)).call(this));
|
||||
|
||||
_this.onDomUpdate = function () {
|
||||
var _this$state = _this.state,
|
||||
status = _this$state.status,
|
||||
newStatus = _this$state.newStatus;
|
||||
var _this$props = _this.props,
|
||||
onAppearStart = _this$props.onAppearStart,
|
||||
onEnterStart = _this$props.onEnterStart,
|
||||
onLeaveStart = _this$props.onLeaveStart,
|
||||
onAppearActive = _this$props.onAppearActive,
|
||||
onEnterActive = _this$props.onEnterActive,
|
||||
onLeaveActive = _this$props.onLeaveActive,
|
||||
motionAppear = _this$props.motionAppear,
|
||||
motionEnter = _this$props.motionEnter,
|
||||
motionLeave = _this$props.motionLeave;
|
||||
|
||||
|
||||
if (!isSupportTransition(_this.props)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Event injection
|
||||
var $ele = _this.getElement();
|
||||
if (_this.$cacheEle !== $ele) {
|
||||
_this.removeEventListener(_this.$cacheEle);
|
||||
_this.addEventListener($ele);
|
||||
_this.$cacheEle = $ele;
|
||||
}
|
||||
|
||||
// Init status
|
||||
if (newStatus && status === STATUS_APPEAR && motionAppear) {
|
||||
_this.updateStatus(onAppearStart, null, null, function () {
|
||||
_this.updateActiveStatus(onAppearActive, STATUS_APPEAR);
|
||||
});
|
||||
} else if (newStatus && status === STATUS_ENTER && motionEnter) {
|
||||
_this.updateStatus(onEnterStart, null, null, function () {
|
||||
_this.updateActiveStatus(onEnterActive, STATUS_ENTER);
|
||||
});
|
||||
} else if (newStatus && status === STATUS_LEAVE && motionLeave) {
|
||||
_this.updateStatus(onLeaveStart, null, null, function () {
|
||||
_this.updateActiveStatus(onLeaveActive, STATUS_LEAVE);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
_this.onMotionEnd = function (event) {
|
||||
var _this$state2 = _this.state,
|
||||
status = _this$state2.status,
|
||||
statusActive = _this$state2.statusActive;
|
||||
var _this$props2 = _this.props,
|
||||
onAppearEnd = _this$props2.onAppearEnd,
|
||||
onEnterEnd = _this$props2.onEnterEnd,
|
||||
onLeaveEnd = _this$props2.onLeaveEnd;
|
||||
|
||||
if (status === STATUS_APPEAR && statusActive) {
|
||||
_this.updateStatus(onAppearEnd, { status: STATUS_NONE }, event);
|
||||
} else if (status === STATUS_ENTER && statusActive) {
|
||||
_this.updateStatus(onEnterEnd, { status: STATUS_NONE }, event);
|
||||
} else if (status === STATUS_LEAVE && statusActive) {
|
||||
_this.updateStatus(onLeaveEnd, { status: STATUS_NONE }, event);
|
||||
}
|
||||
};
|
||||
|
||||
_this.setNodeRef = function (node) {
|
||||
var internalRef = _this.props.internalRef;
|
||||
|
||||
_this.node = node;
|
||||
|
||||
if (typeof internalRef === 'function') {
|
||||
internalRef(node);
|
||||
} else if (internalRef && 'current' in internalRef) {
|
||||
internalRef.current = node;
|
||||
}
|
||||
};
|
||||
|
||||
_this.getElement = function () {
|
||||
return findDOMNode(_this.node || _this);
|
||||
};
|
||||
|
||||
_this.addEventListener = function ($ele) {
|
||||
if (!$ele) return;
|
||||
|
||||
$ele.addEventListener(transitionEndName, _this.onMotionEnd);
|
||||
$ele.addEventListener(animationEndName, _this.onMotionEnd);
|
||||
};
|
||||
|
||||
_this.removeEventListener = function ($ele) {
|
||||
if (!$ele) return;
|
||||
|
||||
$ele.removeEventListener(transitionEndName, _this.onMotionEnd);
|
||||
$ele.removeEventListener(animationEndName, _this.onMotionEnd);
|
||||
};
|
||||
|
||||
_this.updateStatus = function (styleFunc, additionalState, event, callback) {
|
||||
var statusStyle = styleFunc ? styleFunc(_this.getElement(), event) : null;
|
||||
|
||||
if (statusStyle === false || _this._destroyed) return;
|
||||
|
||||
var nextStep = void 0;
|
||||
if (callback) {
|
||||
nextStep = function nextStep() {
|
||||
_this.nextFrame(callback);
|
||||
};
|
||||
}
|
||||
|
||||
_this.setState(_extends({
|
||||
statusStyle: typeof statusStyle === 'object' ? statusStyle : null,
|
||||
newStatus: false
|
||||
}, additionalState), nextStep); // Trigger before next frame & after `componentDidMount`
|
||||
};
|
||||
|
||||
_this.updateActiveStatus = function (styleFunc, currentStatus) {
|
||||
// `setState` use `postMessage` to trigger at the end of frame.
|
||||
// Let's use requestAnimationFrame to update new state in next frame.
|
||||
_this.nextFrame(function () {
|
||||
var status = _this.state.status;
|
||||
|
||||
if (status !== currentStatus) return;
|
||||
|
||||
_this.updateStatus(styleFunc, { statusActive: true });
|
||||
});
|
||||
};
|
||||
|
||||
_this.nextFrame = function (func) {
|
||||
_this.cancelNextFrame();
|
||||
_this.raf = raf(func);
|
||||
};
|
||||
|
||||
_this.cancelNextFrame = function () {
|
||||
if (_this.raf) {
|
||||
raf.cancel(_this.raf);
|
||||
_this.raf = null;
|
||||
}
|
||||
};
|
||||
|
||||
_this.state = {
|
||||
status: STATUS_NONE,
|
||||
statusActive: false,
|
||||
newStatus: false,
|
||||
statusStyle: null
|
||||
};
|
||||
_this.$cacheEle = null;
|
||||
_this.node = null;
|
||||
_this.raf = null;
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(CSSMotion, [{
|
||||
key: 'componentDidMount',
|
||||
value: function componentDidMount() {
|
||||
this.onDomUpdate();
|
||||
}
|
||||
}, {
|
||||
key: 'componentDidUpdate',
|
||||
value: function componentDidUpdate() {
|
||||
this.onDomUpdate();
|
||||
}
|
||||
}, {
|
||||
key: 'componentWillUnmount',
|
||||
value: function componentWillUnmount() {
|
||||
this._destroyed = true;
|
||||
this.removeEventListener(this.$cacheEle);
|
||||
this.cancelNextFrame();
|
||||
}
|
||||
}, {
|
||||
key: 'render',
|
||||
value: function render() {
|
||||
var _classNames;
|
||||
|
||||
var _state = this.state,
|
||||
status = _state.status,
|
||||
statusActive = _state.statusActive,
|
||||
statusStyle = _state.statusStyle;
|
||||
var _props = this.props,
|
||||
children = _props.children,
|
||||
motionName = _props.motionName,
|
||||
visible = _props.visible,
|
||||
removeOnLeave = _props.removeOnLeave,
|
||||
leavedClassName = _props.leavedClassName,
|
||||
eventProps = _props.eventProps;
|
||||
|
||||
|
||||
if (!children) return null;
|
||||
|
||||
if (status === STATUS_NONE || !isSupportTransition(this.props)) {
|
||||
if (visible) {
|
||||
return children(_extends({}, eventProps), this.setNodeRef);
|
||||
} else if (!removeOnLeave) {
|
||||
return children(_extends({}, eventProps, { className: leavedClassName }), this.setNodeRef);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return children(_extends({}, eventProps, {
|
||||
className: classNames((_classNames = {}, _defineProperty(_classNames, getTransitionName(motionName, status), status !== STATUS_NONE), _defineProperty(_classNames, getTransitionName(motionName, status + '-active'), status !== STATUS_NONE && statusActive), _defineProperty(_classNames, motionName, typeof motionName === 'string'), _classNames)),
|
||||
style: statusStyle
|
||||
}), this.setNodeRef);
|
||||
}
|
||||
}], [{
|
||||
key: 'getDerivedStateFromProps',
|
||||
value: function getDerivedStateFromProps(props, _ref) {
|
||||
var prevProps = _ref.prevProps,
|
||||
prevStatus = _ref.status;
|
||||
|
||||
if (!isSupportTransition(props)) return {};
|
||||
|
||||
var visible = props.visible,
|
||||
motionAppear = props.motionAppear,
|
||||
motionEnter = props.motionEnter,
|
||||
motionLeave = props.motionLeave,
|
||||
motionLeaveImmediately = props.motionLeaveImmediately;
|
||||
|
||||
var newState = {
|
||||
prevProps: props
|
||||
};
|
||||
|
||||
// Clean up status if prop set to false
|
||||
if (prevStatus === STATUS_APPEAR && !motionAppear || prevStatus === STATUS_ENTER && !motionEnter || prevStatus === STATUS_LEAVE && !motionLeave) {
|
||||
newState.status = STATUS_NONE;
|
||||
newState.statusActive = false;
|
||||
newState.newStatus = false;
|
||||
}
|
||||
|
||||
// Appear
|
||||
if (!prevProps && visible && motionAppear) {
|
||||
newState.status = STATUS_APPEAR;
|
||||
newState.statusActive = false;
|
||||
newState.newStatus = true;
|
||||
}
|
||||
|
||||
// Enter
|
||||
if (prevProps && !prevProps.visible && visible && motionEnter) {
|
||||
newState.status = STATUS_ENTER;
|
||||
newState.statusActive = false;
|
||||
newState.newStatus = true;
|
||||
}
|
||||
|
||||
// Leave
|
||||
if (prevProps && prevProps.visible && !visible && motionLeave || !prevProps && motionLeaveImmediately && !visible && motionLeave) {
|
||||
newState.status = STATUS_LEAVE;
|
||||
newState.statusActive = false;
|
||||
newState.newStatus = true;
|
||||
}
|
||||
|
||||
return newState;
|
||||
}
|
||||
}]);
|
||||
|
||||
return CSSMotion;
|
||||
}(React.Component);
|
||||
|
||||
CSSMotion.propTypes = _extends({}, MotionPropTypes, {
|
||||
|
||||
internalRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func])
|
||||
});
|
||||
CSSMotion.defaultProps = {
|
||||
visible: true,
|
||||
motionEnter: true,
|
||||
motionAppear: true,
|
||||
motionLeave: true,
|
||||
removeOnLeave: true
|
||||
};
|
||||
|
||||
|
||||
polyfill(CSSMotion);
|
||||
|
||||
if (!forwardRef) {
|
||||
return CSSMotion;
|
||||
}
|
||||
|
||||
return React.forwardRef(function (props, ref) {
|
||||
return React.createElement(CSSMotion, _extends({ internalRef: ref }, props));
|
||||
});
|
||||
}
|
||||
|
||||
export default genCSSMotion(supportTransition);
|
||||
156
web/node_modules/rc-animate/es/CSSMotionList.js
generated
vendored
Normal file
156
web/node_modules/rc-animate/es/CSSMotionList.js
generated
vendored
Normal file
@@ -0,0 +1,156 @@
|
||||
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
||||
import _extends from 'babel-runtime/helpers/extends';
|
||||
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
||||
import _createClass from 'babel-runtime/helpers/createClass';
|
||||
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
||||
import _inherits from 'babel-runtime/helpers/inherits';
|
||||
import React from 'react';
|
||||
import { polyfill } from 'react-lifecycles-compat';
|
||||
import PropTypes from 'prop-types';
|
||||
import OriginCSSMotion, { MotionPropTypes } from './CSSMotion';
|
||||
import { supportTransition } from './util/motion';
|
||||
import { STATUS_ADD, STATUS_KEEP, STATUS_REMOVE, STATUS_REMOVED, diffKeys, parseKeys } from './util/diff';
|
||||
|
||||
var MOTION_PROP_NAMES = Object.keys(MotionPropTypes);
|
||||
|
||||
export function genCSSMotionList(transitionSupport) {
|
||||
var CSSMotion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : OriginCSSMotion;
|
||||
|
||||
var CSSMotionList = function (_React$Component) {
|
||||
_inherits(CSSMotionList, _React$Component);
|
||||
|
||||
function CSSMotionList() {
|
||||
var _ref;
|
||||
|
||||
var _temp, _this, _ret;
|
||||
|
||||
_classCallCheck(this, CSSMotionList);
|
||||
|
||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = CSSMotionList.__proto__ || Object.getPrototypeOf(CSSMotionList)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
||||
keyEntities: []
|
||||
}, _this.removeKey = function (removeKey) {
|
||||
_this.setState(function (_ref2) {
|
||||
var keyEntities = _ref2.keyEntities;
|
||||
return {
|
||||
keyEntities: keyEntities.map(function (entity) {
|
||||
if (entity.key !== removeKey) return entity;
|
||||
return _extends({}, entity, {
|
||||
status: STATUS_REMOVED
|
||||
});
|
||||
})
|
||||
};
|
||||
});
|
||||
}, _temp), _possibleConstructorReturn(_this, _ret);
|
||||
}
|
||||
|
||||
_createClass(CSSMotionList, [{
|
||||
key: 'render',
|
||||
value: function render() {
|
||||
var _this2 = this;
|
||||
|
||||
var keyEntities = this.state.keyEntities;
|
||||
|
||||
var _props = this.props,
|
||||
component = _props.component,
|
||||
children = _props.children,
|
||||
restProps = _objectWithoutProperties(_props, ['component', 'children']);
|
||||
|
||||
var Component = component || React.Fragment;
|
||||
|
||||
var motionProps = {};
|
||||
MOTION_PROP_NAMES.forEach(function (prop) {
|
||||
motionProps[prop] = restProps[prop];
|
||||
delete restProps[prop];
|
||||
});
|
||||
delete restProps.keys;
|
||||
|
||||
return React.createElement(
|
||||
Component,
|
||||
restProps,
|
||||
keyEntities.map(function (_ref3) {
|
||||
var status = _ref3.status,
|
||||
eventProps = _objectWithoutProperties(_ref3, ['status']);
|
||||
|
||||
var visible = status === STATUS_ADD || status === STATUS_KEEP;
|
||||
return React.createElement(
|
||||
CSSMotion,
|
||||
_extends({}, motionProps, {
|
||||
key: eventProps.key,
|
||||
visible: visible,
|
||||
eventProps: eventProps,
|
||||
onLeaveEnd: function onLeaveEnd() {
|
||||
if (motionProps.onLeaveEnd) {
|
||||
motionProps.onLeaveEnd.apply(motionProps, arguments);
|
||||
}
|
||||
_this2.removeKey(eventProps.key);
|
||||
}
|
||||
}),
|
||||
children
|
||||
);
|
||||
})
|
||||
);
|
||||
}
|
||||
}], [{
|
||||
key: 'getDerivedStateFromProps',
|
||||
value: function getDerivedStateFromProps(_ref4, _ref5) {
|
||||
var keys = _ref4.keys;
|
||||
var keyEntities = _ref5.keyEntities;
|
||||
|
||||
var parsedKeyObjects = parseKeys(keys);
|
||||
|
||||
// Always as keep when motion not support
|
||||
if (!transitionSupport) {
|
||||
return {
|
||||
keyEntities: parsedKeyObjects.map(function (obj) {
|
||||
return _extends({}, obj, { status: STATUS_KEEP });
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
var mixedKeyEntities = diffKeys(keyEntities, parsedKeyObjects);
|
||||
|
||||
var keyEntitiesLen = keyEntities.length;
|
||||
return {
|
||||
keyEntities: mixedKeyEntities.filter(function (entity) {
|
||||
// IE 9 not support Array.prototype.find
|
||||
var prevEntity = null;
|
||||
for (var i = 0; i < keyEntitiesLen; i += 1) {
|
||||
var currentEntity = keyEntities[i];
|
||||
if (currentEntity.key === entity.key) {
|
||||
prevEntity = currentEntity;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove if already mark as removed
|
||||
if (prevEntity && prevEntity.status === STATUS_REMOVED && entity.status === STATUS_REMOVE) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
})
|
||||
};
|
||||
}
|
||||
}]);
|
||||
|
||||
return CSSMotionList;
|
||||
}(React.Component);
|
||||
|
||||
CSSMotionList.propTypes = _extends({}, CSSMotion.propTypes, {
|
||||
component: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
||||
keys: PropTypes.array
|
||||
});
|
||||
CSSMotionList.defaultProps = {
|
||||
component: 'div'
|
||||
};
|
||||
|
||||
|
||||
polyfill(CSSMotionList);
|
||||
|
||||
return CSSMotionList;
|
||||
}
|
||||
|
||||
export default genCSSMotionList(supportTransition);
|
||||
101
web/node_modules/rc-animate/es/ChildrenUtils.js
generated
vendored
Normal file
101
web/node_modules/rc-animate/es/ChildrenUtils.js
generated
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
import React from 'react';
|
||||
|
||||
export function toArrayChildren(children) {
|
||||
var ret = [];
|
||||
React.Children.forEach(children, function (child) {
|
||||
ret.push(child);
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
|
||||
export function findChildInChildrenByKey(children, key) {
|
||||
var ret = null;
|
||||
if (children) {
|
||||
children.forEach(function (child) {
|
||||
if (ret) {
|
||||
return;
|
||||
}
|
||||
if (child && child.key === key) {
|
||||
ret = child;
|
||||
}
|
||||
});
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
export function findShownChildInChildrenByKey(children, key, showProp) {
|
||||
var ret = null;
|
||||
if (children) {
|
||||
children.forEach(function (child) {
|
||||
if (child && child.key === key && child.props[showProp]) {
|
||||
if (ret) {
|
||||
throw new Error('two child with same key for <rc-animate> children');
|
||||
}
|
||||
ret = child;
|
||||
}
|
||||
});
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
export function findHiddenChildInChildrenByKey(children, key, showProp) {
|
||||
var found = 0;
|
||||
if (children) {
|
||||
children.forEach(function (child) {
|
||||
if (found) {
|
||||
return;
|
||||
}
|
||||
found = child && child.key === key && !child.props[showProp];
|
||||
});
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
export function isSameChildren(c1, c2, showProp) {
|
||||
var same = c1.length === c2.length;
|
||||
if (same) {
|
||||
c1.forEach(function (child, index) {
|
||||
var child2 = c2[index];
|
||||
if (child && child2) {
|
||||
if (child && !child2 || !child && child2) {
|
||||
same = false;
|
||||
} else if (child.key !== child2.key) {
|
||||
same = false;
|
||||
} else if (showProp && child.props[showProp] !== child2.props[showProp]) {
|
||||
same = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return same;
|
||||
}
|
||||
|
||||
export function mergeChildren(prev, next) {
|
||||
var ret = [];
|
||||
|
||||
// For each key of `next`, the list of keys to insert before that key in
|
||||
// the combined list
|
||||
var nextChildrenPending = {};
|
||||
var pendingChildren = [];
|
||||
prev.forEach(function (child) {
|
||||
if (child && findChildInChildrenByKey(next, child.key)) {
|
||||
if (pendingChildren.length) {
|
||||
nextChildrenPending[child.key] = pendingChildren;
|
||||
pendingChildren = [];
|
||||
}
|
||||
} else {
|
||||
pendingChildren.push(child);
|
||||
}
|
||||
});
|
||||
|
||||
next.forEach(function (child) {
|
||||
if (child && Object.prototype.hasOwnProperty.call(nextChildrenPending, child.key)) {
|
||||
ret = ret.concat(nextChildrenPending[child.key]);
|
||||
}
|
||||
ret.push(child);
|
||||
});
|
||||
|
||||
ret = ret.concat(pendingChildren);
|
||||
|
||||
return ret;
|
||||
}
|
||||
21
web/node_modules/rc-animate/es/util/animate.js
generated
vendored
Normal file
21
web/node_modules/rc-animate/es/util/animate.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
var util = {
|
||||
isAppearSupported: function isAppearSupported(props) {
|
||||
return props.transitionName && props.transitionAppear || props.animation.appear;
|
||||
},
|
||||
isEnterSupported: function isEnterSupported(props) {
|
||||
return props.transitionName && props.transitionEnter || props.animation.enter;
|
||||
},
|
||||
isLeaveSupported: function isLeaveSupported(props) {
|
||||
return props.transitionName && props.transitionLeave || props.animation.leave;
|
||||
},
|
||||
allowAppearCallback: function allowAppearCallback(props) {
|
||||
return props.transitionAppear || props.animation.appear;
|
||||
},
|
||||
allowEnterCallback: function allowEnterCallback(props) {
|
||||
return props.transitionEnter || props.animation.enter;
|
||||
},
|
||||
allowLeaveCallback: function allowLeaveCallback(props) {
|
||||
return props.transitionLeave || props.animation.leave;
|
||||
}
|
||||
};
|
||||
export default util;
|
||||
105
web/node_modules/rc-animate/es/util/diff.js
generated
vendored
Normal file
105
web/node_modules/rc-animate/es/util/diff.js
generated
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
import _extends from 'babel-runtime/helpers/extends';
|
||||
export var STATUS_ADD = 'add';
|
||||
export var STATUS_KEEP = 'keep';
|
||||
export var STATUS_REMOVE = 'remove';
|
||||
export var STATUS_REMOVED = 'removed';
|
||||
|
||||
export function wrapKeyToObject(key) {
|
||||
var keyObj = void 0;
|
||||
if (key && typeof key === 'object' && 'key' in key) {
|
||||
keyObj = key;
|
||||
} else {
|
||||
keyObj = { key: key };
|
||||
}
|
||||
return _extends({}, keyObj, {
|
||||
key: String(keyObj.key)
|
||||
});
|
||||
}
|
||||
|
||||
export function parseKeys() {
|
||||
var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
|
||||
return keys.map(wrapKeyToObject);
|
||||
}
|
||||
|
||||
export function diffKeys() {
|
||||
var prevKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
var currentKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
||||
|
||||
var list = [];
|
||||
var currentIndex = 0;
|
||||
var currentLen = currentKeys.length;
|
||||
|
||||
var prevKeyObjects = parseKeys(prevKeys);
|
||||
var currentKeyObjects = parseKeys(currentKeys);
|
||||
|
||||
// Check prev keys to insert or keep
|
||||
prevKeyObjects.forEach(function (keyObj) {
|
||||
var hit = false;
|
||||
|
||||
for (var i = currentIndex; i < currentLen; i += 1) {
|
||||
var currentKeyObj = currentKeyObjects[i];
|
||||
if (currentKeyObj.key === keyObj.key) {
|
||||
// New added keys should add before current key
|
||||
if (currentIndex < i) {
|
||||
list = list.concat(currentKeyObjects.slice(currentIndex, i).map(function (obj) {
|
||||
return _extends({}, obj, { status: STATUS_ADD });
|
||||
}));
|
||||
currentIndex = i;
|
||||
}
|
||||
list.push(_extends({}, currentKeyObj, {
|
||||
status: STATUS_KEEP
|
||||
}));
|
||||
currentIndex += 1;
|
||||
|
||||
hit = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If not hit, it means key is removed
|
||||
if (!hit) {
|
||||
list.push(_extends({}, keyObj, {
|
||||
status: STATUS_REMOVE
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
// Add rest to the list
|
||||
if (currentIndex < currentLen) {
|
||||
list = list.concat(currentKeyObjects.slice(currentIndex).map(function (obj) {
|
||||
return _extends({}, obj, { status: STATUS_ADD });
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge same key when it remove and add again:
|
||||
* [1 - add, 2 - keep, 1 - remove] -> [1 - keep, 2 - keep]
|
||||
*/
|
||||
var keys = {};
|
||||
list.forEach(function (_ref) {
|
||||
var key = _ref.key;
|
||||
|
||||
keys[key] = (keys[key] || 0) + 1;
|
||||
});
|
||||
var duplicatedKeys = Object.keys(keys).filter(function (key) {
|
||||
return keys[key] > 1;
|
||||
});
|
||||
duplicatedKeys.forEach(function (matchKey) {
|
||||
// Remove `STATUS_REMOVE` node.
|
||||
list = list.filter(function (_ref2) {
|
||||
var key = _ref2.key,
|
||||
status = _ref2.status;
|
||||
return key !== matchKey || status !== STATUS_REMOVE;
|
||||
});
|
||||
|
||||
// Update `STATUS_ADD` to `STATUS_KEEP`
|
||||
list.forEach(function (node) {
|
||||
if (node.key === matchKey) {
|
||||
node.status = STATUS_KEEP;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return list;
|
||||
}
|
||||
83
web/node_modules/rc-animate/es/util/motion.js
generated
vendored
Normal file
83
web/node_modules/rc-animate/es/util/motion.js
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
||||
|
||||
// ================= Transition =================
|
||||
// Event wrapper. Copy from react source code
|
||||
function makePrefixMap(styleProp, eventName) {
|
||||
var prefixes = {};
|
||||
|
||||
prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
|
||||
prefixes['Webkit' + styleProp] = 'webkit' + eventName;
|
||||
prefixes['Moz' + styleProp] = 'moz' + eventName;
|
||||
prefixes['ms' + styleProp] = 'MS' + eventName;
|
||||
prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();
|
||||
|
||||
return prefixes;
|
||||
}
|
||||
|
||||
export function getVendorPrefixes(domSupport, win) {
|
||||
var prefixes = {
|
||||
animationend: makePrefixMap('Animation', 'AnimationEnd'),
|
||||
transitionend: makePrefixMap('Transition', 'TransitionEnd')
|
||||
};
|
||||
|
||||
if (domSupport) {
|
||||
if (!('AnimationEvent' in win)) {
|
||||
delete prefixes.animationend.animation;
|
||||
}
|
||||
|
||||
if (!('TransitionEvent' in win)) {
|
||||
delete prefixes.transitionend.transition;
|
||||
}
|
||||
}
|
||||
|
||||
return prefixes;
|
||||
}
|
||||
|
||||
var vendorPrefixes = getVendorPrefixes(canUseDOM, typeof window !== 'undefined' ? window : {});
|
||||
|
||||
var style = {};
|
||||
|
||||
if (canUseDOM) {
|
||||
style = document.createElement('div').style;
|
||||
}
|
||||
|
||||
var prefixedEventNames = {};
|
||||
|
||||
export function getVendorPrefixedEventName(eventName) {
|
||||
if (prefixedEventNames[eventName]) {
|
||||
return prefixedEventNames[eventName];
|
||||
}
|
||||
|
||||
var prefixMap = vendorPrefixes[eventName];
|
||||
|
||||
if (prefixMap) {
|
||||
var stylePropList = Object.keys(prefixMap);
|
||||
var len = stylePropList.length;
|
||||
for (var i = 0; i < len; i += 1) {
|
||||
var styleProp = stylePropList[i];
|
||||
if (Object.prototype.hasOwnProperty.call(prefixMap, styleProp) && styleProp in style) {
|
||||
prefixedEventNames[eventName] = prefixMap[styleProp];
|
||||
return prefixedEventNames[eventName];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
export var animationEndName = getVendorPrefixedEventName('animationend');
|
||||
export var transitionEndName = getVendorPrefixedEventName('transitionend');
|
||||
export var supportTransition = !!(animationEndName && transitionEndName);
|
||||
|
||||
export function getTransitionName(transitionName, transitionType) {
|
||||
if (!transitionName) return null;
|
||||
|
||||
if (typeof transitionName === 'object') {
|
||||
var type = transitionType.replace(/-\w/g, function (match) {
|
||||
return match[1].toUpperCase();
|
||||
});
|
||||
return transitionName[type];
|
||||
}
|
||||
|
||||
return transitionName + '-' + transitionType;
|
||||
}
|
||||
395
web/node_modules/rc-animate/lib/Animate.js
generated
vendored
Normal file
395
web/node_modules/rc-animate/lib/Animate.js
generated
vendored
Normal file
@@ -0,0 +1,395 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _extends2 = require('babel-runtime/helpers/extends');
|
||||
|
||||
var _extends3 = _interopRequireDefault(_extends2);
|
||||
|
||||
var _defineProperty2 = require('babel-runtime/helpers/defineProperty');
|
||||
|
||||
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
|
||||
|
||||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
||||
|
||||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
||||
|
||||
var _createClass2 = require('babel-runtime/helpers/createClass');
|
||||
|
||||
var _createClass3 = _interopRequireDefault(_createClass2);
|
||||
|
||||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
||||
|
||||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
||||
|
||||
var _inherits2 = require('babel-runtime/helpers/inherits');
|
||||
|
||||
var _inherits3 = _interopRequireDefault(_inherits2);
|
||||
|
||||
var _react = require('react');
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _propTypes = require('prop-types');
|
||||
|
||||
var _propTypes2 = _interopRequireDefault(_propTypes);
|
||||
|
||||
var _unsafeLifecyclesPolyfill = require('rc-util/lib/unsafeLifecyclesPolyfill');
|
||||
|
||||
var _unsafeLifecyclesPolyfill2 = _interopRequireDefault(_unsafeLifecyclesPolyfill);
|
||||
|
||||
var _ChildrenUtils = require('./ChildrenUtils');
|
||||
|
||||
var _AnimateChild = require('./AnimateChild');
|
||||
|
||||
var _AnimateChild2 = _interopRequireDefault(_AnimateChild);
|
||||
|
||||
var _animate = require('./util/animate');
|
||||
|
||||
var _animate2 = _interopRequireDefault(_animate);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
var defaultKey = 'rc_animate_' + Date.now();
|
||||
|
||||
function getChildrenFromProps(props) {
|
||||
var children = props.children;
|
||||
if (_react2['default'].isValidElement(children)) {
|
||||
if (!children.key) {
|
||||
return _react2['default'].cloneElement(children, {
|
||||
key: defaultKey
|
||||
});
|
||||
}
|
||||
}
|
||||
return children;
|
||||
}
|
||||
|
||||
function noop() {}
|
||||
|
||||
var Animate = function (_React$Component) {
|
||||
(0, _inherits3['default'])(Animate, _React$Component);
|
||||
|
||||
// eslint-disable-line
|
||||
|
||||
function Animate(props) {
|
||||
(0, _classCallCheck3['default'])(this, Animate);
|
||||
|
||||
var _this = (0, _possibleConstructorReturn3['default'])(this, (Animate.__proto__ || Object.getPrototypeOf(Animate)).call(this, props));
|
||||
|
||||
_initialiseProps.call(_this);
|
||||
|
||||
_this.currentlyAnimatingKeys = {};
|
||||
_this.keysToEnter = [];
|
||||
_this.keysToLeave = [];
|
||||
|
||||
_this.state = {
|
||||
children: (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props))
|
||||
};
|
||||
|
||||
_this.childrenRefs = {};
|
||||
return _this;
|
||||
}
|
||||
|
||||
(0, _createClass3['default'])(Animate, [{
|
||||
key: 'componentDidMount',
|
||||
value: function componentDidMount() {
|
||||
var _this2 = this;
|
||||
|
||||
var showProp = this.props.showProp;
|
||||
var children = this.state.children;
|
||||
if (showProp) {
|
||||
children = children.filter(function (child) {
|
||||
return !!child.props[showProp];
|
||||
});
|
||||
}
|
||||
children.forEach(function (child) {
|
||||
if (child) {
|
||||
_this2.performAppear(child.key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: 'componentWillReceiveProps',
|
||||
value: function componentWillReceiveProps(nextProps) {
|
||||
var _this3 = this;
|
||||
|
||||
this.nextProps = nextProps;
|
||||
var nextChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(nextProps));
|
||||
var props = this.props;
|
||||
// exclusive needs immediate response
|
||||
if (props.exclusive) {
|
||||
Object.keys(this.currentlyAnimatingKeys).forEach(function (key) {
|
||||
_this3.stop(key);
|
||||
});
|
||||
}
|
||||
var showProp = props.showProp;
|
||||
var currentlyAnimatingKeys = this.currentlyAnimatingKeys;
|
||||
// last props children if exclusive
|
||||
var currentChildren = props.exclusive ? (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props)) : this.state.children;
|
||||
// in case destroy in showProp mode
|
||||
var newChildren = [];
|
||||
if (showProp) {
|
||||
currentChildren.forEach(function (currentChild) {
|
||||
var nextChild = currentChild && (0, _ChildrenUtils.findChildInChildrenByKey)(nextChildren, currentChild.key);
|
||||
var newChild = void 0;
|
||||
if ((!nextChild || !nextChild.props[showProp]) && currentChild.props[showProp]) {
|
||||
newChild = _react2['default'].cloneElement(nextChild || currentChild, (0, _defineProperty3['default'])({}, showProp, true));
|
||||
} else {
|
||||
newChild = nextChild;
|
||||
}
|
||||
if (newChild) {
|
||||
newChildren.push(newChild);
|
||||
}
|
||||
});
|
||||
nextChildren.forEach(function (nextChild) {
|
||||
if (!nextChild || !(0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, nextChild.key)) {
|
||||
newChildren.push(nextChild);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
newChildren = (0, _ChildrenUtils.mergeChildren)(currentChildren, nextChildren);
|
||||
}
|
||||
|
||||
// need render to avoid update
|
||||
this.setState({
|
||||
children: newChildren
|
||||
});
|
||||
|
||||
nextChildren.forEach(function (child) {
|
||||
var key = child && child.key;
|
||||
if (child && currentlyAnimatingKeys[key]) {
|
||||
return;
|
||||
}
|
||||
var hasPrev = child && (0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, key);
|
||||
if (showProp) {
|
||||
var showInNext = child.props[showProp];
|
||||
if (hasPrev) {
|
||||
var showInNow = (0, _ChildrenUtils.findShownChildInChildrenByKey)(currentChildren, key, showProp);
|
||||
if (!showInNow && showInNext) {
|
||||
_this3.keysToEnter.push(key);
|
||||
}
|
||||
} else if (showInNext) {
|
||||
_this3.keysToEnter.push(key);
|
||||
}
|
||||
} else if (!hasPrev) {
|
||||
_this3.keysToEnter.push(key);
|
||||
}
|
||||
});
|
||||
|
||||
currentChildren.forEach(function (child) {
|
||||
var key = child && child.key;
|
||||
if (child && currentlyAnimatingKeys[key]) {
|
||||
return;
|
||||
}
|
||||
var hasNext = child && (0, _ChildrenUtils.findChildInChildrenByKey)(nextChildren, key);
|
||||
if (showProp) {
|
||||
var showInNow = child.props[showProp];
|
||||
if (hasNext) {
|
||||
var showInNext = (0, _ChildrenUtils.findShownChildInChildrenByKey)(nextChildren, key, showProp);
|
||||
if (!showInNext && showInNow) {
|
||||
_this3.keysToLeave.push(key);
|
||||
}
|
||||
} else if (showInNow) {
|
||||
_this3.keysToLeave.push(key);
|
||||
}
|
||||
} else if (!hasNext) {
|
||||
_this3.keysToLeave.push(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: 'componentDidUpdate',
|
||||
value: function componentDidUpdate() {
|
||||
var keysToEnter = this.keysToEnter;
|
||||
this.keysToEnter = [];
|
||||
keysToEnter.forEach(this.performEnter);
|
||||
var keysToLeave = this.keysToLeave;
|
||||
this.keysToLeave = [];
|
||||
keysToLeave.forEach(this.performLeave);
|
||||
}
|
||||
}, {
|
||||
key: 'isValidChildByKey',
|
||||
value: function isValidChildByKey(currentChildren, key) {
|
||||
var showProp = this.props.showProp;
|
||||
if (showProp) {
|
||||
return (0, _ChildrenUtils.findShownChildInChildrenByKey)(currentChildren, key, showProp);
|
||||
}
|
||||
return (0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, key);
|
||||
}
|
||||
}, {
|
||||
key: 'stop',
|
||||
value: function stop(key) {
|
||||
delete this.currentlyAnimatingKeys[key];
|
||||
var component = this.childrenRefs[key];
|
||||
if (component) {
|
||||
component.stop();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'render',
|
||||
value: function render() {
|
||||
var _this4 = this;
|
||||
|
||||
var props = this.props;
|
||||
this.nextProps = props;
|
||||
var stateChildren = this.state.children;
|
||||
var children = null;
|
||||
if (stateChildren) {
|
||||
children = stateChildren.map(function (child) {
|
||||
if (child === null || child === undefined) {
|
||||
return child;
|
||||
}
|
||||
if (!child.key) {
|
||||
throw new Error('must set key for <rc-animate> children');
|
||||
}
|
||||
return _react2['default'].createElement(
|
||||
_AnimateChild2['default'],
|
||||
{
|
||||
key: child.key,
|
||||
ref: function ref(node) {
|
||||
_this4.childrenRefs[child.key] = node;
|
||||
},
|
||||
animation: props.animation,
|
||||
transitionName: props.transitionName,
|
||||
transitionEnter: props.transitionEnter,
|
||||
transitionAppear: props.transitionAppear,
|
||||
transitionLeave: props.transitionLeave
|
||||
},
|
||||
child
|
||||
);
|
||||
});
|
||||
}
|
||||
var Component = props.component;
|
||||
if (Component) {
|
||||
var passedProps = props;
|
||||
if (typeof Component === 'string') {
|
||||
passedProps = (0, _extends3['default'])({
|
||||
className: props.className,
|
||||
style: props.style
|
||||
}, props.componentProps);
|
||||
}
|
||||
return _react2['default'].createElement(
|
||||
Component,
|
||||
passedProps,
|
||||
children
|
||||
);
|
||||
}
|
||||
return children[0] || null;
|
||||
}
|
||||
}]);
|
||||
return Animate;
|
||||
}(_react2['default'].Component);
|
||||
|
||||
Animate.isAnimate = true;
|
||||
Animate.propTypes = {
|
||||
className: _propTypes2['default'].string,
|
||||
style: _propTypes2['default'].object,
|
||||
component: _propTypes2['default'].any,
|
||||
componentProps: _propTypes2['default'].object,
|
||||
animation: _propTypes2['default'].object,
|
||||
transitionName: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].object]),
|
||||
transitionEnter: _propTypes2['default'].bool,
|
||||
transitionAppear: _propTypes2['default'].bool,
|
||||
exclusive: _propTypes2['default'].bool,
|
||||
transitionLeave: _propTypes2['default'].bool,
|
||||
onEnd: _propTypes2['default'].func,
|
||||
onEnter: _propTypes2['default'].func,
|
||||
onLeave: _propTypes2['default'].func,
|
||||
onAppear: _propTypes2['default'].func,
|
||||
showProp: _propTypes2['default'].string,
|
||||
children: _propTypes2['default'].node
|
||||
};
|
||||
Animate.defaultProps = {
|
||||
animation: {},
|
||||
component: 'span',
|
||||
componentProps: {},
|
||||
transitionEnter: true,
|
||||
transitionLeave: true,
|
||||
transitionAppear: false,
|
||||
onEnd: noop,
|
||||
onEnter: noop,
|
||||
onLeave: noop,
|
||||
onAppear: noop
|
||||
};
|
||||
|
||||
var _initialiseProps = function _initialiseProps() {
|
||||
var _this5 = this;
|
||||
|
||||
this.performEnter = function (key) {
|
||||
// may already remove by exclusive
|
||||
if (_this5.childrenRefs[key]) {
|
||||
_this5.currentlyAnimatingKeys[key] = true;
|
||||
_this5.childrenRefs[key].componentWillEnter(_this5.handleDoneAdding.bind(_this5, key, 'enter'));
|
||||
}
|
||||
};
|
||||
|
||||
this.performAppear = function (key) {
|
||||
if (_this5.childrenRefs[key]) {
|
||||
_this5.currentlyAnimatingKeys[key] = true;
|
||||
_this5.childrenRefs[key].componentWillAppear(_this5.handleDoneAdding.bind(_this5, key, 'appear'));
|
||||
}
|
||||
};
|
||||
|
||||
this.handleDoneAdding = function (key, type) {
|
||||
var props = _this5.props;
|
||||
delete _this5.currentlyAnimatingKeys[key];
|
||||
// if update on exclusive mode, skip check
|
||||
if (props.exclusive && props !== _this5.nextProps) {
|
||||
return;
|
||||
}
|
||||
var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props));
|
||||
if (!_this5.isValidChildByKey(currentChildren, key)) {
|
||||
// exclusive will not need this
|
||||
_this5.performLeave(key);
|
||||
} else if (type === 'appear') {
|
||||
if (_animate2['default'].allowAppearCallback(props)) {
|
||||
props.onAppear(key);
|
||||
props.onEnd(key, true);
|
||||
}
|
||||
} else if (_animate2['default'].allowEnterCallback(props)) {
|
||||
props.onEnter(key);
|
||||
props.onEnd(key, true);
|
||||
}
|
||||
};
|
||||
|
||||
this.performLeave = function (key) {
|
||||
// may already remove by exclusive
|
||||
if (_this5.childrenRefs[key]) {
|
||||
_this5.currentlyAnimatingKeys[key] = true;
|
||||
_this5.childrenRefs[key].componentWillLeave(_this5.handleDoneLeaving.bind(_this5, key));
|
||||
}
|
||||
};
|
||||
|
||||
this.handleDoneLeaving = function (key) {
|
||||
var props = _this5.props;
|
||||
delete _this5.currentlyAnimatingKeys[key];
|
||||
// if update on exclusive mode, skip check
|
||||
if (props.exclusive && props !== _this5.nextProps) {
|
||||
return;
|
||||
}
|
||||
var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props));
|
||||
// in case state change is too fast
|
||||
if (_this5.isValidChildByKey(currentChildren, key)) {
|
||||
_this5.performEnter(key);
|
||||
} else {
|
||||
var end = function end() {
|
||||
if (_animate2['default'].allowLeaveCallback(props)) {
|
||||
props.onLeave(key);
|
||||
props.onEnd(key, false);
|
||||
}
|
||||
};
|
||||
if (!(0, _ChildrenUtils.isSameChildren)(_this5.state.children, currentChildren, props.showProp)) {
|
||||
_this5.setState({
|
||||
children: currentChildren
|
||||
}, end);
|
||||
} else {
|
||||
end();
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
exports['default'] = (0, _unsafeLifecyclesPolyfill2['default'])(Animate);
|
||||
module.exports = exports['default'];
|
||||
146
web/node_modules/rc-animate/lib/AnimateChild.js
generated
vendored
Normal file
146
web/node_modules/rc-animate/lib/AnimateChild.js
generated
vendored
Normal file
@@ -0,0 +1,146 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
||||
|
||||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
||||
|
||||
var _createClass2 = require('babel-runtime/helpers/createClass');
|
||||
|
||||
var _createClass3 = _interopRequireDefault(_createClass2);
|
||||
|
||||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
||||
|
||||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
||||
|
||||
var _inherits2 = require('babel-runtime/helpers/inherits');
|
||||
|
||||
var _inherits3 = _interopRequireDefault(_inherits2);
|
||||
|
||||
var _react = require('react');
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _reactDom = require('react-dom');
|
||||
|
||||
var _reactDom2 = _interopRequireDefault(_reactDom);
|
||||
|
||||
var _propTypes = require('prop-types');
|
||||
|
||||
var _propTypes2 = _interopRequireDefault(_propTypes);
|
||||
|
||||
var _cssAnimation = require('css-animation');
|
||||
|
||||
var _cssAnimation2 = _interopRequireDefault(_cssAnimation);
|
||||
|
||||
var _animate = require('./util/animate');
|
||||
|
||||
var _animate2 = _interopRequireDefault(_animate);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
var transitionMap = {
|
||||
enter: 'transitionEnter',
|
||||
appear: 'transitionAppear',
|
||||
leave: 'transitionLeave'
|
||||
};
|
||||
|
||||
var AnimateChild = function (_React$Component) {
|
||||
(0, _inherits3['default'])(AnimateChild, _React$Component);
|
||||
|
||||
function AnimateChild() {
|
||||
(0, _classCallCheck3['default'])(this, AnimateChild);
|
||||
return (0, _possibleConstructorReturn3['default'])(this, (AnimateChild.__proto__ || Object.getPrototypeOf(AnimateChild)).apply(this, arguments));
|
||||
}
|
||||
|
||||
(0, _createClass3['default'])(AnimateChild, [{
|
||||
key: 'componentWillUnmount',
|
||||
value: function componentWillUnmount() {
|
||||
this.stop();
|
||||
}
|
||||
}, {
|
||||
key: 'componentWillEnter',
|
||||
value: function componentWillEnter(done) {
|
||||
if (_animate2['default'].isEnterSupported(this.props)) {
|
||||
this.transition('enter', done);
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'componentWillAppear',
|
||||
value: function componentWillAppear(done) {
|
||||
if (_animate2['default'].isAppearSupported(this.props)) {
|
||||
this.transition('appear', done);
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'componentWillLeave',
|
||||
value: function componentWillLeave(done) {
|
||||
if (_animate2['default'].isLeaveSupported(this.props)) {
|
||||
this.transition('leave', done);
|
||||
} else {
|
||||
// always sync, do not interupt with react component life cycle
|
||||
// update hidden -> animate hidden ->
|
||||
// didUpdate -> animate leave -> unmount (if animate is none)
|
||||
done();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'transition',
|
||||
value: function transition(animationType, finishCallback) {
|
||||
var _this2 = this;
|
||||
|
||||
var node = _reactDom2['default'].findDOMNode(this);
|
||||
var props = this.props;
|
||||
var transitionName = props.transitionName;
|
||||
var nameIsObj = typeof transitionName === 'object';
|
||||
this.stop();
|
||||
var end = function end() {
|
||||
_this2.stopper = null;
|
||||
finishCallback();
|
||||
};
|
||||
if ((_cssAnimation.isCssAnimationSupported || !props.animation[animationType]) && transitionName && props[transitionMap[animationType]]) {
|
||||
var name = nameIsObj ? transitionName[animationType] : transitionName + '-' + animationType;
|
||||
var activeName = name + '-active';
|
||||
if (nameIsObj && transitionName[animationType + 'Active']) {
|
||||
activeName = transitionName[animationType + 'Active'];
|
||||
}
|
||||
this.stopper = (0, _cssAnimation2['default'])(node, {
|
||||
name: name,
|
||||
active: activeName
|
||||
}, end);
|
||||
} else {
|
||||
this.stopper = props.animation[animationType](node, end);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'stop',
|
||||
value: function stop() {
|
||||
var stopper = this.stopper;
|
||||
if (stopper) {
|
||||
this.stopper = null;
|
||||
stopper.stop();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'render',
|
||||
value: function render() {
|
||||
return this.props.children;
|
||||
}
|
||||
}]);
|
||||
return AnimateChild;
|
||||
}(_react2['default'].Component);
|
||||
|
||||
AnimateChild.propTypes = {
|
||||
children: _propTypes2['default'].any,
|
||||
animation: _propTypes2['default'].any,
|
||||
transitionName: _propTypes2['default'].any
|
||||
};
|
||||
exports['default'] = AnimateChild;
|
||||
module.exports = exports['default'];
|
||||
387
web/node_modules/rc-animate/lib/CSSMotion.js
generated
vendored
Normal file
387
web/node_modules/rc-animate/lib/CSSMotion.js
generated
vendored
Normal file
@@ -0,0 +1,387 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.MotionPropTypes = undefined;
|
||||
|
||||
var _defineProperty2 = require('babel-runtime/helpers/defineProperty');
|
||||
|
||||
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
|
||||
|
||||
var _extends2 = require('babel-runtime/helpers/extends');
|
||||
|
||||
var _extends3 = _interopRequireDefault(_extends2);
|
||||
|
||||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
||||
|
||||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
||||
|
||||
var _createClass2 = require('babel-runtime/helpers/createClass');
|
||||
|
||||
var _createClass3 = _interopRequireDefault(_createClass2);
|
||||
|
||||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
||||
|
||||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
||||
|
||||
var _inherits2 = require('babel-runtime/helpers/inherits');
|
||||
|
||||
var _inherits3 = _interopRequireDefault(_inherits2);
|
||||
|
||||
exports.genCSSMotion = genCSSMotion;
|
||||
|
||||
var _react = require('react');
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _propTypes = require('prop-types');
|
||||
|
||||
var _propTypes2 = _interopRequireDefault(_propTypes);
|
||||
|
||||
var _reactLifecyclesCompat = require('react-lifecycles-compat');
|
||||
|
||||
var _findDOMNode = require('rc-util/lib/Dom/findDOMNode');
|
||||
|
||||
var _findDOMNode2 = _interopRequireDefault(_findDOMNode);
|
||||
|
||||
var _classnames = require('classnames');
|
||||
|
||||
var _classnames2 = _interopRequireDefault(_classnames);
|
||||
|
||||
var _raf = require('raf');
|
||||
|
||||
var _raf2 = _interopRequireDefault(_raf);
|
||||
|
||||
var _motion = require('./util/motion');
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
var STATUS_NONE = 'none'; /* eslint-disable react/default-props-match-prop-types, react/no-multi-comp */
|
||||
|
||||
var STATUS_APPEAR = 'appear';
|
||||
var STATUS_ENTER = 'enter';
|
||||
var STATUS_LEAVE = 'leave';
|
||||
|
||||
var MotionPropTypes = exports.MotionPropTypes = {
|
||||
eventProps: _propTypes2['default'].object, // Internal usage. Only pass by CSSMotionList
|
||||
visible: _propTypes2['default'].bool,
|
||||
children: _propTypes2['default'].func,
|
||||
motionName: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].object]),
|
||||
motionAppear: _propTypes2['default'].bool,
|
||||
motionEnter: _propTypes2['default'].bool,
|
||||
motionLeave: _propTypes2['default'].bool,
|
||||
motionLeaveImmediately: _propTypes2['default'].bool, // Trigger leave motion immediately
|
||||
removeOnLeave: _propTypes2['default'].bool,
|
||||
leavedClassName: _propTypes2['default'].string,
|
||||
onAppearStart: _propTypes2['default'].func,
|
||||
onAppearActive: _propTypes2['default'].func,
|
||||
onAppearEnd: _propTypes2['default'].func,
|
||||
onEnterStart: _propTypes2['default'].func,
|
||||
onEnterActive: _propTypes2['default'].func,
|
||||
onEnterEnd: _propTypes2['default'].func,
|
||||
onLeaveStart: _propTypes2['default'].func,
|
||||
onLeaveActive: _propTypes2['default'].func,
|
||||
onLeaveEnd: _propTypes2['default'].func
|
||||
};
|
||||
|
||||
/**
|
||||
* `transitionSupport` is used for none transition test case.
|
||||
* Default we use browser transition event support check.
|
||||
*/
|
||||
function genCSSMotion(config) {
|
||||
var transitionSupport = config;
|
||||
var forwardRef = !!_react2['default'].forwardRef;
|
||||
|
||||
if (typeof config === 'object') {
|
||||
transitionSupport = config.transitionSupport;
|
||||
forwardRef = 'forwardRef' in config ? config.forwardRef : forwardRef;
|
||||
}
|
||||
|
||||
function isSupportTransition(props) {
|
||||
return !!(props.motionName && transitionSupport);
|
||||
}
|
||||
|
||||
var CSSMotion = function (_React$Component) {
|
||||
(0, _inherits3['default'])(CSSMotion, _React$Component);
|
||||
|
||||
function CSSMotion() {
|
||||
(0, _classCallCheck3['default'])(this, CSSMotion);
|
||||
|
||||
var _this = (0, _possibleConstructorReturn3['default'])(this, (CSSMotion.__proto__ || Object.getPrototypeOf(CSSMotion)).call(this));
|
||||
|
||||
_this.onDomUpdate = function () {
|
||||
var _this$state = _this.state,
|
||||
status = _this$state.status,
|
||||
newStatus = _this$state.newStatus;
|
||||
var _this$props = _this.props,
|
||||
onAppearStart = _this$props.onAppearStart,
|
||||
onEnterStart = _this$props.onEnterStart,
|
||||
onLeaveStart = _this$props.onLeaveStart,
|
||||
onAppearActive = _this$props.onAppearActive,
|
||||
onEnterActive = _this$props.onEnterActive,
|
||||
onLeaveActive = _this$props.onLeaveActive,
|
||||
motionAppear = _this$props.motionAppear,
|
||||
motionEnter = _this$props.motionEnter,
|
||||
motionLeave = _this$props.motionLeave;
|
||||
|
||||
|
||||
if (!isSupportTransition(_this.props)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Event injection
|
||||
var $ele = _this.getElement();
|
||||
if (_this.$cacheEle !== $ele) {
|
||||
_this.removeEventListener(_this.$cacheEle);
|
||||
_this.addEventListener($ele);
|
||||
_this.$cacheEle = $ele;
|
||||
}
|
||||
|
||||
// Init status
|
||||
if (newStatus && status === STATUS_APPEAR && motionAppear) {
|
||||
_this.updateStatus(onAppearStart, null, null, function () {
|
||||
_this.updateActiveStatus(onAppearActive, STATUS_APPEAR);
|
||||
});
|
||||
} else if (newStatus && status === STATUS_ENTER && motionEnter) {
|
||||
_this.updateStatus(onEnterStart, null, null, function () {
|
||||
_this.updateActiveStatus(onEnterActive, STATUS_ENTER);
|
||||
});
|
||||
} else if (newStatus && status === STATUS_LEAVE && motionLeave) {
|
||||
_this.updateStatus(onLeaveStart, null, null, function () {
|
||||
_this.updateActiveStatus(onLeaveActive, STATUS_LEAVE);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
_this.onMotionEnd = function (event) {
|
||||
var _this$state2 = _this.state,
|
||||
status = _this$state2.status,
|
||||
statusActive = _this$state2.statusActive;
|
||||
var _this$props2 = _this.props,
|
||||
onAppearEnd = _this$props2.onAppearEnd,
|
||||
onEnterEnd = _this$props2.onEnterEnd,
|
||||
onLeaveEnd = _this$props2.onLeaveEnd;
|
||||
|
||||
if (status === STATUS_APPEAR && statusActive) {
|
||||
_this.updateStatus(onAppearEnd, { status: STATUS_NONE }, event);
|
||||
} else if (status === STATUS_ENTER && statusActive) {
|
||||
_this.updateStatus(onEnterEnd, { status: STATUS_NONE }, event);
|
||||
} else if (status === STATUS_LEAVE && statusActive) {
|
||||
_this.updateStatus(onLeaveEnd, { status: STATUS_NONE }, event);
|
||||
}
|
||||
};
|
||||
|
||||
_this.setNodeRef = function (node) {
|
||||
var internalRef = _this.props.internalRef;
|
||||
|
||||
_this.node = node;
|
||||
|
||||
if (typeof internalRef === 'function') {
|
||||
internalRef(node);
|
||||
} else if (internalRef && 'current' in internalRef) {
|
||||
internalRef.current = node;
|
||||
}
|
||||
};
|
||||
|
||||
_this.getElement = function () {
|
||||
return (0, _findDOMNode2['default'])(_this.node || _this);
|
||||
};
|
||||
|
||||
_this.addEventListener = function ($ele) {
|
||||
if (!$ele) return;
|
||||
|
||||
$ele.addEventListener(_motion.transitionEndName, _this.onMotionEnd);
|
||||
$ele.addEventListener(_motion.animationEndName, _this.onMotionEnd);
|
||||
};
|
||||
|
||||
_this.removeEventListener = function ($ele) {
|
||||
if (!$ele) return;
|
||||
|
||||
$ele.removeEventListener(_motion.transitionEndName, _this.onMotionEnd);
|
||||
$ele.removeEventListener(_motion.animationEndName, _this.onMotionEnd);
|
||||
};
|
||||
|
||||
_this.updateStatus = function (styleFunc, additionalState, event, callback) {
|
||||
var statusStyle = styleFunc ? styleFunc(_this.getElement(), event) : null;
|
||||
|
||||
if (statusStyle === false || _this._destroyed) return;
|
||||
|
||||
var nextStep = void 0;
|
||||
if (callback) {
|
||||
nextStep = function nextStep() {
|
||||
_this.nextFrame(callback);
|
||||
};
|
||||
}
|
||||
|
||||
_this.setState((0, _extends3['default'])({
|
||||
statusStyle: typeof statusStyle === 'object' ? statusStyle : null,
|
||||
newStatus: false
|
||||
}, additionalState), nextStep); // Trigger before next frame & after `componentDidMount`
|
||||
};
|
||||
|
||||
_this.updateActiveStatus = function (styleFunc, currentStatus) {
|
||||
// `setState` use `postMessage` to trigger at the end of frame.
|
||||
// Let's use requestAnimationFrame to update new state in next frame.
|
||||
_this.nextFrame(function () {
|
||||
var status = _this.state.status;
|
||||
|
||||
if (status !== currentStatus) return;
|
||||
|
||||
_this.updateStatus(styleFunc, { statusActive: true });
|
||||
});
|
||||
};
|
||||
|
||||
_this.nextFrame = function (func) {
|
||||
_this.cancelNextFrame();
|
||||
_this.raf = (0, _raf2['default'])(func);
|
||||
};
|
||||
|
||||
_this.cancelNextFrame = function () {
|
||||
if (_this.raf) {
|
||||
_raf2['default'].cancel(_this.raf);
|
||||
_this.raf = null;
|
||||
}
|
||||
};
|
||||
|
||||
_this.state = {
|
||||
status: STATUS_NONE,
|
||||
statusActive: false,
|
||||
newStatus: false,
|
||||
statusStyle: null
|
||||
};
|
||||
_this.$cacheEle = null;
|
||||
_this.node = null;
|
||||
_this.raf = null;
|
||||
return _this;
|
||||
}
|
||||
|
||||
(0, _createClass3['default'])(CSSMotion, [{
|
||||
key: 'componentDidMount',
|
||||
value: function componentDidMount() {
|
||||
this.onDomUpdate();
|
||||
}
|
||||
}, {
|
||||
key: 'componentDidUpdate',
|
||||
value: function componentDidUpdate() {
|
||||
this.onDomUpdate();
|
||||
}
|
||||
}, {
|
||||
key: 'componentWillUnmount',
|
||||
value: function componentWillUnmount() {
|
||||
this._destroyed = true;
|
||||
this.removeEventListener(this.$cacheEle);
|
||||
this.cancelNextFrame();
|
||||
}
|
||||
}, {
|
||||
key: 'render',
|
||||
value: function render() {
|
||||
var _classNames;
|
||||
|
||||
var _state = this.state,
|
||||
status = _state.status,
|
||||
statusActive = _state.statusActive,
|
||||
statusStyle = _state.statusStyle;
|
||||
var _props = this.props,
|
||||
children = _props.children,
|
||||
motionName = _props.motionName,
|
||||
visible = _props.visible,
|
||||
removeOnLeave = _props.removeOnLeave,
|
||||
leavedClassName = _props.leavedClassName,
|
||||
eventProps = _props.eventProps;
|
||||
|
||||
|
||||
if (!children) return null;
|
||||
|
||||
if (status === STATUS_NONE || !isSupportTransition(this.props)) {
|
||||
if (visible) {
|
||||
return children((0, _extends3['default'])({}, eventProps), this.setNodeRef);
|
||||
} else if (!removeOnLeave) {
|
||||
return children((0, _extends3['default'])({}, eventProps, { className: leavedClassName }), this.setNodeRef);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return children((0, _extends3['default'])({}, eventProps, {
|
||||
className: (0, _classnames2['default'])((_classNames = {}, (0, _defineProperty3['default'])(_classNames, (0, _motion.getTransitionName)(motionName, status), status !== STATUS_NONE), (0, _defineProperty3['default'])(_classNames, (0, _motion.getTransitionName)(motionName, status + '-active'), status !== STATUS_NONE && statusActive), (0, _defineProperty3['default'])(_classNames, motionName, typeof motionName === 'string'), _classNames)),
|
||||
style: statusStyle
|
||||
}), this.setNodeRef);
|
||||
}
|
||||
}], [{
|
||||
key: 'getDerivedStateFromProps',
|
||||
value: function getDerivedStateFromProps(props, _ref) {
|
||||
var prevProps = _ref.prevProps,
|
||||
prevStatus = _ref.status;
|
||||
|
||||
if (!isSupportTransition(props)) return {};
|
||||
|
||||
var visible = props.visible,
|
||||
motionAppear = props.motionAppear,
|
||||
motionEnter = props.motionEnter,
|
||||
motionLeave = props.motionLeave,
|
||||
motionLeaveImmediately = props.motionLeaveImmediately;
|
||||
|
||||
var newState = {
|
||||
prevProps: props
|
||||
};
|
||||
|
||||
// Clean up status if prop set to false
|
||||
if (prevStatus === STATUS_APPEAR && !motionAppear || prevStatus === STATUS_ENTER && !motionEnter || prevStatus === STATUS_LEAVE && !motionLeave) {
|
||||
newState.status = STATUS_NONE;
|
||||
newState.statusActive = false;
|
||||
newState.newStatus = false;
|
||||
}
|
||||
|
||||
// Appear
|
||||
if (!prevProps && visible && motionAppear) {
|
||||
newState.status = STATUS_APPEAR;
|
||||
newState.statusActive = false;
|
||||
newState.newStatus = true;
|
||||
}
|
||||
|
||||
// Enter
|
||||
if (prevProps && !prevProps.visible && visible && motionEnter) {
|
||||
newState.status = STATUS_ENTER;
|
||||
newState.statusActive = false;
|
||||
newState.newStatus = true;
|
||||
}
|
||||
|
||||
// Leave
|
||||
if (prevProps && prevProps.visible && !visible && motionLeave || !prevProps && motionLeaveImmediately && !visible && motionLeave) {
|
||||
newState.status = STATUS_LEAVE;
|
||||
newState.statusActive = false;
|
||||
newState.newStatus = true;
|
||||
}
|
||||
|
||||
return newState;
|
||||
}
|
||||
}]);
|
||||
return CSSMotion;
|
||||
}(_react2['default'].Component);
|
||||
|
||||
CSSMotion.propTypes = (0, _extends3['default'])({}, MotionPropTypes, {
|
||||
|
||||
internalRef: _propTypes2['default'].oneOfType([_propTypes2['default'].object, _propTypes2['default'].func])
|
||||
});
|
||||
CSSMotion.defaultProps = {
|
||||
visible: true,
|
||||
motionEnter: true,
|
||||
motionAppear: true,
|
||||
motionLeave: true,
|
||||
removeOnLeave: true
|
||||
};
|
||||
|
||||
|
||||
(0, _reactLifecyclesCompat.polyfill)(CSSMotion);
|
||||
|
||||
if (!forwardRef) {
|
||||
return CSSMotion;
|
||||
}
|
||||
|
||||
return _react2['default'].forwardRef(function (props, ref) {
|
||||
return _react2['default'].createElement(CSSMotion, (0, _extends3['default'])({ internalRef: ref }, props));
|
||||
});
|
||||
}
|
||||
|
||||
exports['default'] = genCSSMotion(_motion.supportTransition);
|
||||
194
web/node_modules/rc-animate/lib/CSSMotionList.js
generated
vendored
Normal file
194
web/node_modules/rc-animate/lib/CSSMotionList.js
generated
vendored
Normal file
@@ -0,0 +1,194 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
|
||||
|
||||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
|
||||
|
||||
var _extends2 = require('babel-runtime/helpers/extends');
|
||||
|
||||
var _extends3 = _interopRequireDefault(_extends2);
|
||||
|
||||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
||||
|
||||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
||||
|
||||
var _createClass2 = require('babel-runtime/helpers/createClass');
|
||||
|
||||
var _createClass3 = _interopRequireDefault(_createClass2);
|
||||
|
||||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
||||
|
||||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
||||
|
||||
var _inherits2 = require('babel-runtime/helpers/inherits');
|
||||
|
||||
var _inherits3 = _interopRequireDefault(_inherits2);
|
||||
|
||||
exports.genCSSMotionList = genCSSMotionList;
|
||||
|
||||
var _react = require('react');
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _reactLifecyclesCompat = require('react-lifecycles-compat');
|
||||
|
||||
var _propTypes = require('prop-types');
|
||||
|
||||
var _propTypes2 = _interopRequireDefault(_propTypes);
|
||||
|
||||
var _CSSMotion = require('./CSSMotion');
|
||||
|
||||
var _CSSMotion2 = _interopRequireDefault(_CSSMotion);
|
||||
|
||||
var _motion = require('./util/motion');
|
||||
|
||||
var _diff = require('./util/diff');
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
var MOTION_PROP_NAMES = Object.keys(_CSSMotion.MotionPropTypes);
|
||||
|
||||
function genCSSMotionList(transitionSupport) {
|
||||
var CSSMotion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _CSSMotion2['default'];
|
||||
|
||||
var CSSMotionList = function (_React$Component) {
|
||||
(0, _inherits3['default'])(CSSMotionList, _React$Component);
|
||||
|
||||
function CSSMotionList() {
|
||||
var _ref;
|
||||
|
||||
var _temp, _this, _ret;
|
||||
|
||||
(0, _classCallCheck3['default'])(this, CSSMotionList);
|
||||
|
||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3['default'])(this, (_ref = CSSMotionList.__proto__ || Object.getPrototypeOf(CSSMotionList)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
||||
keyEntities: []
|
||||
}, _this.removeKey = function (removeKey) {
|
||||
_this.setState(function (_ref2) {
|
||||
var keyEntities = _ref2.keyEntities;
|
||||
return {
|
||||
keyEntities: keyEntities.map(function (entity) {
|
||||
if (entity.key !== removeKey) return entity;
|
||||
return (0, _extends3['default'])({}, entity, {
|
||||
status: _diff.STATUS_REMOVED
|
||||
});
|
||||
})
|
||||
};
|
||||
});
|
||||
}, _temp), (0, _possibleConstructorReturn3['default'])(_this, _ret);
|
||||
}
|
||||
|
||||
(0, _createClass3['default'])(CSSMotionList, [{
|
||||
key: 'render',
|
||||
value: function render() {
|
||||
var _this2 = this;
|
||||
|
||||
var keyEntities = this.state.keyEntities;
|
||||
var _props = this.props,
|
||||
component = _props.component,
|
||||
children = _props.children,
|
||||
restProps = (0, _objectWithoutProperties3['default'])(_props, ['component', 'children']);
|
||||
|
||||
|
||||
var Component = component || _react2['default'].Fragment;
|
||||
|
||||
var motionProps = {};
|
||||
MOTION_PROP_NAMES.forEach(function (prop) {
|
||||
motionProps[prop] = restProps[prop];
|
||||
delete restProps[prop];
|
||||
});
|
||||
delete restProps.keys;
|
||||
|
||||
return _react2['default'].createElement(
|
||||
Component,
|
||||
restProps,
|
||||
keyEntities.map(function (_ref3) {
|
||||
var status = _ref3.status,
|
||||
eventProps = (0, _objectWithoutProperties3['default'])(_ref3, ['status']);
|
||||
|
||||
var visible = status === _diff.STATUS_ADD || status === _diff.STATUS_KEEP;
|
||||
return _react2['default'].createElement(
|
||||
CSSMotion,
|
||||
(0, _extends3['default'])({}, motionProps, {
|
||||
key: eventProps.key,
|
||||
visible: visible,
|
||||
eventProps: eventProps,
|
||||
onLeaveEnd: function onLeaveEnd() {
|
||||
if (motionProps.onLeaveEnd) {
|
||||
motionProps.onLeaveEnd.apply(motionProps, arguments);
|
||||
}
|
||||
_this2.removeKey(eventProps.key);
|
||||
}
|
||||
}),
|
||||
children
|
||||
);
|
||||
})
|
||||
);
|
||||
}
|
||||
}], [{
|
||||
key: 'getDerivedStateFromProps',
|
||||
value: function getDerivedStateFromProps(_ref4, _ref5) {
|
||||
var keys = _ref4.keys;
|
||||
var keyEntities = _ref5.keyEntities;
|
||||
|
||||
var parsedKeyObjects = (0, _diff.parseKeys)(keys);
|
||||
|
||||
// Always as keep when motion not support
|
||||
if (!transitionSupport) {
|
||||
return {
|
||||
keyEntities: parsedKeyObjects.map(function (obj) {
|
||||
return (0, _extends3['default'])({}, obj, { status: _diff.STATUS_KEEP });
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
var mixedKeyEntities = (0, _diff.diffKeys)(keyEntities, parsedKeyObjects);
|
||||
|
||||
var keyEntitiesLen = keyEntities.length;
|
||||
return {
|
||||
keyEntities: mixedKeyEntities.filter(function (entity) {
|
||||
// IE 9 not support Array.prototype.find
|
||||
var prevEntity = null;
|
||||
for (var i = 0; i < keyEntitiesLen; i += 1) {
|
||||
var currentEntity = keyEntities[i];
|
||||
if (currentEntity.key === entity.key) {
|
||||
prevEntity = currentEntity;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove if already mark as removed
|
||||
if (prevEntity && prevEntity.status === _diff.STATUS_REMOVED && entity.status === _diff.STATUS_REMOVE) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
})
|
||||
};
|
||||
}
|
||||
}]);
|
||||
return CSSMotionList;
|
||||
}(_react2['default'].Component);
|
||||
|
||||
CSSMotionList.propTypes = (0, _extends3['default'])({}, CSSMotion.propTypes, {
|
||||
component: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].bool]),
|
||||
keys: _propTypes2['default'].array
|
||||
});
|
||||
CSSMotionList.defaultProps = {
|
||||
component: 'div'
|
||||
};
|
||||
|
||||
|
||||
(0, _reactLifecyclesCompat.polyfill)(CSSMotionList);
|
||||
|
||||
return CSSMotionList;
|
||||
}
|
||||
|
||||
exports['default'] = genCSSMotionList(_motion.supportTransition);
|
||||
117
web/node_modules/rc-animate/lib/ChildrenUtils.js
generated
vendored
Normal file
117
web/node_modules/rc-animate/lib/ChildrenUtils.js
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.toArrayChildren = toArrayChildren;
|
||||
exports.findChildInChildrenByKey = findChildInChildrenByKey;
|
||||
exports.findShownChildInChildrenByKey = findShownChildInChildrenByKey;
|
||||
exports.findHiddenChildInChildrenByKey = findHiddenChildInChildrenByKey;
|
||||
exports.isSameChildren = isSameChildren;
|
||||
exports.mergeChildren = mergeChildren;
|
||||
|
||||
var _react = require('react');
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
function toArrayChildren(children) {
|
||||
var ret = [];
|
||||
_react2['default'].Children.forEach(children, function (child) {
|
||||
ret.push(child);
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
|
||||
function findChildInChildrenByKey(children, key) {
|
||||
var ret = null;
|
||||
if (children) {
|
||||
children.forEach(function (child) {
|
||||
if (ret) {
|
||||
return;
|
||||
}
|
||||
if (child && child.key === key) {
|
||||
ret = child;
|
||||
}
|
||||
});
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
function findShownChildInChildrenByKey(children, key, showProp) {
|
||||
var ret = null;
|
||||
if (children) {
|
||||
children.forEach(function (child) {
|
||||
if (child && child.key === key && child.props[showProp]) {
|
||||
if (ret) {
|
||||
throw new Error('two child with same key for <rc-animate> children');
|
||||
}
|
||||
ret = child;
|
||||
}
|
||||
});
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
function findHiddenChildInChildrenByKey(children, key, showProp) {
|
||||
var found = 0;
|
||||
if (children) {
|
||||
children.forEach(function (child) {
|
||||
if (found) {
|
||||
return;
|
||||
}
|
||||
found = child && child.key === key && !child.props[showProp];
|
||||
});
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
function isSameChildren(c1, c2, showProp) {
|
||||
var same = c1.length === c2.length;
|
||||
if (same) {
|
||||
c1.forEach(function (child, index) {
|
||||
var child2 = c2[index];
|
||||
if (child && child2) {
|
||||
if (child && !child2 || !child && child2) {
|
||||
same = false;
|
||||
} else if (child.key !== child2.key) {
|
||||
same = false;
|
||||
} else if (showProp && child.props[showProp] !== child2.props[showProp]) {
|
||||
same = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return same;
|
||||
}
|
||||
|
||||
function mergeChildren(prev, next) {
|
||||
var ret = [];
|
||||
|
||||
// For each key of `next`, the list of keys to insert before that key in
|
||||
// the combined list
|
||||
var nextChildrenPending = {};
|
||||
var pendingChildren = [];
|
||||
prev.forEach(function (child) {
|
||||
if (child && findChildInChildrenByKey(next, child.key)) {
|
||||
if (pendingChildren.length) {
|
||||
nextChildrenPending[child.key] = pendingChildren;
|
||||
pendingChildren = [];
|
||||
}
|
||||
} else {
|
||||
pendingChildren.push(child);
|
||||
}
|
||||
});
|
||||
|
||||
next.forEach(function (child) {
|
||||
if (child && Object.prototype.hasOwnProperty.call(nextChildrenPending, child.key)) {
|
||||
ret = ret.concat(nextChildrenPending[child.key]);
|
||||
}
|
||||
ret.push(child);
|
||||
});
|
||||
|
||||
ret = ret.concat(pendingChildren);
|
||||
|
||||
return ret;
|
||||
}
|
||||
27
web/node_modules/rc-animate/lib/util/animate.js
generated
vendored
Normal file
27
web/node_modules/rc-animate/lib/util/animate.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var util = {
|
||||
isAppearSupported: function isAppearSupported(props) {
|
||||
return props.transitionName && props.transitionAppear || props.animation.appear;
|
||||
},
|
||||
isEnterSupported: function isEnterSupported(props) {
|
||||
return props.transitionName && props.transitionEnter || props.animation.enter;
|
||||
},
|
||||
isLeaveSupported: function isLeaveSupported(props) {
|
||||
return props.transitionName && props.transitionLeave || props.animation.leave;
|
||||
},
|
||||
allowAppearCallback: function allowAppearCallback(props) {
|
||||
return props.transitionAppear || props.animation.appear;
|
||||
},
|
||||
allowEnterCallback: function allowEnterCallback(props) {
|
||||
return props.transitionEnter || props.animation.enter;
|
||||
},
|
||||
allowLeaveCallback: function allowLeaveCallback(props) {
|
||||
return props.transitionLeave || props.animation.leave;
|
||||
}
|
||||
};
|
||||
exports["default"] = util;
|
||||
module.exports = exports['default'];
|
||||
121
web/node_modules/rc-animate/lib/util/diff.js
generated
vendored
Normal file
121
web/node_modules/rc-animate/lib/util/diff.js
generated
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.STATUS_REMOVED = exports.STATUS_REMOVE = exports.STATUS_KEEP = exports.STATUS_ADD = undefined;
|
||||
|
||||
var _extends2 = require('babel-runtime/helpers/extends');
|
||||
|
||||
var _extends3 = _interopRequireDefault(_extends2);
|
||||
|
||||
exports.wrapKeyToObject = wrapKeyToObject;
|
||||
exports.parseKeys = parseKeys;
|
||||
exports.diffKeys = diffKeys;
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
var STATUS_ADD = exports.STATUS_ADD = 'add';
|
||||
var STATUS_KEEP = exports.STATUS_KEEP = 'keep';
|
||||
var STATUS_REMOVE = exports.STATUS_REMOVE = 'remove';
|
||||
var STATUS_REMOVED = exports.STATUS_REMOVED = 'removed';
|
||||
|
||||
function wrapKeyToObject(key) {
|
||||
var keyObj = void 0;
|
||||
if (key && typeof key === 'object' && 'key' in key) {
|
||||
keyObj = key;
|
||||
} else {
|
||||
keyObj = { key: key };
|
||||
}
|
||||
return (0, _extends3['default'])({}, keyObj, {
|
||||
key: String(keyObj.key)
|
||||
});
|
||||
}
|
||||
|
||||
function parseKeys() {
|
||||
var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
|
||||
return keys.map(wrapKeyToObject);
|
||||
}
|
||||
|
||||
function diffKeys() {
|
||||
var prevKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
var currentKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
||||
|
||||
var list = [];
|
||||
var currentIndex = 0;
|
||||
var currentLen = currentKeys.length;
|
||||
|
||||
var prevKeyObjects = parseKeys(prevKeys);
|
||||
var currentKeyObjects = parseKeys(currentKeys);
|
||||
|
||||
// Check prev keys to insert or keep
|
||||
prevKeyObjects.forEach(function (keyObj) {
|
||||
var hit = false;
|
||||
|
||||
for (var i = currentIndex; i < currentLen; i += 1) {
|
||||
var currentKeyObj = currentKeyObjects[i];
|
||||
if (currentKeyObj.key === keyObj.key) {
|
||||
// New added keys should add before current key
|
||||
if (currentIndex < i) {
|
||||
list = list.concat(currentKeyObjects.slice(currentIndex, i).map(function (obj) {
|
||||
return (0, _extends3['default'])({}, obj, { status: STATUS_ADD });
|
||||
}));
|
||||
currentIndex = i;
|
||||
}
|
||||
list.push((0, _extends3['default'])({}, currentKeyObj, {
|
||||
status: STATUS_KEEP
|
||||
}));
|
||||
currentIndex += 1;
|
||||
|
||||
hit = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If not hit, it means key is removed
|
||||
if (!hit) {
|
||||
list.push((0, _extends3['default'])({}, keyObj, {
|
||||
status: STATUS_REMOVE
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
// Add rest to the list
|
||||
if (currentIndex < currentLen) {
|
||||
list = list.concat(currentKeyObjects.slice(currentIndex).map(function (obj) {
|
||||
return (0, _extends3['default'])({}, obj, { status: STATUS_ADD });
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge same key when it remove and add again:
|
||||
* [1 - add, 2 - keep, 1 - remove] -> [1 - keep, 2 - keep]
|
||||
*/
|
||||
var keys = {};
|
||||
list.forEach(function (_ref) {
|
||||
var key = _ref.key;
|
||||
|
||||
keys[key] = (keys[key] || 0) + 1;
|
||||
});
|
||||
var duplicatedKeys = Object.keys(keys).filter(function (key) {
|
||||
return keys[key] > 1;
|
||||
});
|
||||
duplicatedKeys.forEach(function (matchKey) {
|
||||
// Remove `STATUS_REMOVE` node.
|
||||
list = list.filter(function (_ref2) {
|
||||
var key = _ref2.key,
|
||||
status = _ref2.status;
|
||||
return key !== matchKey || status !== STATUS_REMOVE;
|
||||
});
|
||||
|
||||
// Update `STATUS_ADD` to `STATUS_KEEP`
|
||||
list.forEach(function (node) {
|
||||
if (node.key === matchKey) {
|
||||
node.status = STATUS_KEEP;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return list;
|
||||
}
|
||||
91
web/node_modules/rc-animate/lib/util/motion.js
generated
vendored
Normal file
91
web/node_modules/rc-animate/lib/util/motion.js
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getVendorPrefixes = getVendorPrefixes;
|
||||
exports.getVendorPrefixedEventName = getVendorPrefixedEventName;
|
||||
exports.getTransitionName = getTransitionName;
|
||||
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
||||
|
||||
// ================= Transition =================
|
||||
// Event wrapper. Copy from react source code
|
||||
function makePrefixMap(styleProp, eventName) {
|
||||
var prefixes = {};
|
||||
|
||||
prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
|
||||
prefixes['Webkit' + styleProp] = 'webkit' + eventName;
|
||||
prefixes['Moz' + styleProp] = 'moz' + eventName;
|
||||
prefixes['ms' + styleProp] = 'MS' + eventName;
|
||||
prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();
|
||||
|
||||
return prefixes;
|
||||
}
|
||||
|
||||
function getVendorPrefixes(domSupport, win) {
|
||||
var prefixes = {
|
||||
animationend: makePrefixMap('Animation', 'AnimationEnd'),
|
||||
transitionend: makePrefixMap('Transition', 'TransitionEnd')
|
||||
};
|
||||
|
||||
if (domSupport) {
|
||||
if (!('AnimationEvent' in win)) {
|
||||
delete prefixes.animationend.animation;
|
||||
}
|
||||
|
||||
if (!('TransitionEvent' in win)) {
|
||||
delete prefixes.transitionend.transition;
|
||||
}
|
||||
}
|
||||
|
||||
return prefixes;
|
||||
}
|
||||
|
||||
var vendorPrefixes = getVendorPrefixes(canUseDOM, typeof window !== 'undefined' ? window : {});
|
||||
|
||||
var style = {};
|
||||
|
||||
if (canUseDOM) {
|
||||
style = document.createElement('div').style;
|
||||
}
|
||||
|
||||
var prefixedEventNames = {};
|
||||
|
||||
function getVendorPrefixedEventName(eventName) {
|
||||
if (prefixedEventNames[eventName]) {
|
||||
return prefixedEventNames[eventName];
|
||||
}
|
||||
|
||||
var prefixMap = vendorPrefixes[eventName];
|
||||
|
||||
if (prefixMap) {
|
||||
var stylePropList = Object.keys(prefixMap);
|
||||
var len = stylePropList.length;
|
||||
for (var i = 0; i < len; i += 1) {
|
||||
var styleProp = stylePropList[i];
|
||||
if (Object.prototype.hasOwnProperty.call(prefixMap, styleProp) && styleProp in style) {
|
||||
prefixedEventNames[eventName] = prefixMap[styleProp];
|
||||
return prefixedEventNames[eventName];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
var animationEndName = exports.animationEndName = getVendorPrefixedEventName('animationend');
|
||||
var transitionEndName = exports.transitionEndName = getVendorPrefixedEventName('transitionend');
|
||||
var supportTransition = exports.supportTransition = !!(animationEndName && transitionEndName);
|
||||
|
||||
function getTransitionName(transitionName, transitionType) {
|
||||
if (!transitionName) return null;
|
||||
|
||||
if (typeof transitionName === 'object') {
|
||||
var type = transitionType.replace(/-\w/g, function (match) {
|
||||
return match[1].toUpperCase();
|
||||
});
|
||||
return transitionName[type];
|
||||
}
|
||||
|
||||
return transitionName + '-' + transitionType;
|
||||
}
|
||||
99
web/node_modules/rc-animate/package.json
generated
vendored
Normal file
99
web/node_modules/rc-animate/package.json
generated
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
{
|
||||
"_from": "rc-animate@~2.10.2",
|
||||
"_id": "rc-animate@2.10.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-A9qQ5Y8BLlM7EhuCO3fWb/dChndlbWtY/P5QvPqBU7h4r5Q2QsvsbpTGgdYZATRDZbTRnJXXfVk9UtlyS7MBLg==",
|
||||
"_location": "/rc-animate",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "rc-animate@~2.10.2",
|
||||
"name": "rc-animate",
|
||||
"escapedName": "rc-animate",
|
||||
"rawSpec": "~2.10.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~2.10.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/antd",
|
||||
"/rc-collapse",
|
||||
"/rc-dialog",
|
||||
"/rc-menu",
|
||||
"/rc-notification",
|
||||
"/rc-select",
|
||||
"/rc-tree",
|
||||
"/rc-trigger"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/rc-animate/-/rc-animate-2.10.3.tgz",
|
||||
"_shasum": "163d5e29281a4ff82d53ee7918eeeac856b756f9",
|
||||
"_spec": "rc-animate@~2.10.2",
|
||||
"_where": "/Users/thilina/TestProjects/icehrm-pro/web/node_modules/antd",
|
||||
"author": "",
|
||||
"bugs": {
|
||||
"url": "http://github.com/react-component/animate/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"config": {
|
||||
"port": 8201
|
||||
},
|
||||
"dependencies": {
|
||||
"babel-runtime": "6.x",
|
||||
"classnames": "^2.2.6",
|
||||
"css-animation": "^1.3.2",
|
||||
"prop-types": "15.x",
|
||||
"raf": "^3.4.0",
|
||||
"rc-util": "^4.15.3",
|
||||
"react-lifecycles-compat": "^3.0.4"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "css-transition ui component for react",
|
||||
"devDependencies": {
|
||||
"core-js": "^2.5.1",
|
||||
"expect.js": "0.3.x",
|
||||
"jquery": "^3.3.1",
|
||||
"pre-commit": "1.x",
|
||||
"rc-test": "6.x",
|
||||
"rc-tools": "8.x",
|
||||
"react": "^16.0.0",
|
||||
"react-dom": "^16.0.0",
|
||||
"velocity-animate": "~1.2.2"
|
||||
},
|
||||
"files": [
|
||||
"es",
|
||||
"lib"
|
||||
],
|
||||
"homepage": "https://github.com/react-component/animate",
|
||||
"keywords": [
|
||||
"react",
|
||||
"react-component",
|
||||
"react-animate",
|
||||
"animate"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./lib/Animate",
|
||||
"module": "./es/Animate",
|
||||
"name": "rc-animate",
|
||||
"pre-commit": [
|
||||
"lint"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/react-component/animate.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rc-tools run build",
|
||||
"chrome-test": "rc-test run chrome-test",
|
||||
"coverage": "rc-test run coverage",
|
||||
"gh-pages": "rc-tools run gh-pages",
|
||||
"karma": "rc-test run karma",
|
||||
"lint": "rc-tools run lint",
|
||||
"now-build": "npm run build",
|
||||
"prepublish": "rc-tools run guard",
|
||||
"pub": "rc-tools run pub --babel-runtime",
|
||||
"saucelabs": "rc-test run saucelabs",
|
||||
"start": "rc-tools run server",
|
||||
"test": "rc-test run test"
|
||||
},
|
||||
"version": "2.10.3"
|
||||
}
|
||||
Reference in New Issue
Block a user