Latest updates from IceHrmPro
This commit is contained in:
15
web/node_modules/css-animation/HISTORY.md
generated
vendored
Normal file
15
web/node_modules/css-animation/HISTORY.md
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# History
|
||||
----
|
||||
|
||||
## 1.5.0 / 2018-11-12
|
||||
|
||||
- support startEventListenter
|
||||
|
||||
## 1.4.0 / 2017-08-16
|
||||
|
||||
- add es version
|
||||
|
||||
## 1.3.0 / 2016-08-01
|
||||
|
||||
- support animationName as object
|
||||
|
||||
9
web/node_modules/css-animation/LICENSE.md
generated
vendored
Normal file
9
web/node_modules/css-animation/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.
|
||||
92
web/node_modules/css-animation/README.md
generated
vendored
Normal file
92
web/node_modules/css-animation/README.md
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
# css-animation
|
||||
---
|
||||
|
||||
make css animation easier
|
||||
|
||||
[![NPM version][npm-image]][npm-url]
|
||||
|
||||
[npm-image]: http://img.shields.io/npm/v/css-animation.svg?style=flat-square
|
||||
[npm-url]: http://npmjs.org/package/css-animation
|
||||
|
||||
## Development
|
||||
|
||||
```
|
||||
npm install
|
||||
npm start
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
http://localhost:9001/examples/
|
||||
|
||||
online example: http://yiminghe.github.io/css-animation/
|
||||
|
||||
|
||||
## Feature
|
||||
|
||||
* support ie8,ie8+,chrome,firefox,safari
|
||||
|
||||
## install
|
||||
|
||||
[](https://npmjs.org/package/css-animation)
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var anim = require('css-animation');
|
||||
anim(el,animationName,function(){});
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### void anim(el:DOMElement, animationName:String, callback:Function)
|
||||
|
||||
<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>el</td>
|
||||
<td>DOMElement</td>
|
||||
<td></td>
|
||||
<td>dom element to be animated</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>animationName</td>
|
||||
<td>String|Object</td>
|
||||
<td></td>
|
||||
<td>will add animationName (if string) or animationName.name (if object) as class to el, then setTimeout 0 to add ${animationName}-active (if string) or animationName.active (if object) to el</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>callback</td>
|
||||
<td>Function</td>
|
||||
<td></td>
|
||||
<td>triggered when anim caused by animationName is done</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## Test Case
|
||||
|
||||
```
|
||||
npm test
|
||||
npm run chrome-test
|
||||
```
|
||||
|
||||
## Coverage
|
||||
|
||||
```
|
||||
npm run coverage
|
||||
```
|
||||
|
||||
open coverage/ dir
|
||||
|
||||
## License
|
||||
|
||||
css-animation is released under the MIT license.
|
||||
129
web/node_modules/css-animation/es/Event.js
generated
vendored
Normal file
129
web/node_modules/css-animation/es/Event.js
generated
vendored
Normal file
@@ -0,0 +1,129 @@
|
||||
var START_EVENT_NAME_MAP = {
|
||||
transitionstart: {
|
||||
transition: 'transitionstart',
|
||||
WebkitTransition: 'webkitTransitionStart',
|
||||
MozTransition: 'mozTransitionStart',
|
||||
OTransition: 'oTransitionStart',
|
||||
msTransition: 'MSTransitionStart'
|
||||
},
|
||||
|
||||
animationstart: {
|
||||
animation: 'animationstart',
|
||||
WebkitAnimation: 'webkitAnimationStart',
|
||||
MozAnimation: 'mozAnimationStart',
|
||||
OAnimation: 'oAnimationStart',
|
||||
msAnimation: 'MSAnimationStart'
|
||||
}
|
||||
};
|
||||
|
||||
var END_EVENT_NAME_MAP = {
|
||||
transitionend: {
|
||||
transition: 'transitionend',
|
||||
WebkitTransition: 'webkitTransitionEnd',
|
||||
MozTransition: 'mozTransitionEnd',
|
||||
OTransition: 'oTransitionEnd',
|
||||
msTransition: 'MSTransitionEnd'
|
||||
},
|
||||
|
||||
animationend: {
|
||||
animation: 'animationend',
|
||||
WebkitAnimation: 'webkitAnimationEnd',
|
||||
MozAnimation: 'mozAnimationEnd',
|
||||
OAnimation: 'oAnimationEnd',
|
||||
msAnimation: 'MSAnimationEnd'
|
||||
}
|
||||
};
|
||||
|
||||
var startEvents = [];
|
||||
var endEvents = [];
|
||||
|
||||
function detectEvents() {
|
||||
var testEl = document.createElement('div');
|
||||
var style = testEl.style;
|
||||
|
||||
if (!('AnimationEvent' in window)) {
|
||||
delete START_EVENT_NAME_MAP.animationstart.animation;
|
||||
delete END_EVENT_NAME_MAP.animationend.animation;
|
||||
}
|
||||
|
||||
if (!('TransitionEvent' in window)) {
|
||||
delete START_EVENT_NAME_MAP.transitionstart.transition;
|
||||
delete END_EVENT_NAME_MAP.transitionend.transition;
|
||||
}
|
||||
|
||||
function process(EVENT_NAME_MAP, events) {
|
||||
for (var baseEventName in EVENT_NAME_MAP) {
|
||||
if (EVENT_NAME_MAP.hasOwnProperty(baseEventName)) {
|
||||
var baseEvents = EVENT_NAME_MAP[baseEventName];
|
||||
for (var styleName in baseEvents) {
|
||||
if (styleName in style) {
|
||||
events.push(baseEvents[styleName]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
process(START_EVENT_NAME_MAP, startEvents);
|
||||
process(END_EVENT_NAME_MAP, endEvents);
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
||||
detectEvents();
|
||||
}
|
||||
|
||||
function addEventListener(node, eventName, eventListener) {
|
||||
node.addEventListener(eventName, eventListener, false);
|
||||
}
|
||||
|
||||
function removeEventListener(node, eventName, eventListener) {
|
||||
node.removeEventListener(eventName, eventListener, false);
|
||||
}
|
||||
|
||||
var TransitionEvents = {
|
||||
// Start events
|
||||
startEvents: startEvents,
|
||||
|
||||
addStartEventListener: function addStartEventListener(node, eventListener) {
|
||||
if (startEvents.length === 0) {
|
||||
window.setTimeout(eventListener, 0);
|
||||
return;
|
||||
}
|
||||
startEvents.forEach(function (startEvent) {
|
||||
addEventListener(node, startEvent, eventListener);
|
||||
});
|
||||
},
|
||||
removeStartEventListener: function removeStartEventListener(node, eventListener) {
|
||||
if (startEvents.length === 0) {
|
||||
return;
|
||||
}
|
||||
startEvents.forEach(function (startEvent) {
|
||||
removeEventListener(node, startEvent, eventListener);
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// End events
|
||||
endEvents: endEvents,
|
||||
|
||||
addEndEventListener: function addEndEventListener(node, eventListener) {
|
||||
if (endEvents.length === 0) {
|
||||
window.setTimeout(eventListener, 0);
|
||||
return;
|
||||
}
|
||||
endEvents.forEach(function (endEvent) {
|
||||
addEventListener(node, endEvent, eventListener);
|
||||
});
|
||||
},
|
||||
removeEndEventListener: function removeEndEventListener(node, eventListener) {
|
||||
if (endEvents.length === 0) {
|
||||
return;
|
||||
}
|
||||
endEvents.forEach(function (endEvent) {
|
||||
removeEventListener(node, endEvent, eventListener);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export default TransitionEvents;
|
||||
175
web/node_modules/css-animation/es/index.js
generated
vendored
Normal file
175
web/node_modules/css-animation/es/index.js
generated
vendored
Normal file
@@ -0,0 +1,175 @@
|
||||
import _typeof from 'babel-runtime/helpers/typeof';
|
||||
import Event from './Event';
|
||||
import classes from 'component-classes';
|
||||
|
||||
var isCssAnimationSupported = Event.endEvents.length !== 0;
|
||||
var capitalPrefixes = ['Webkit', 'Moz', 'O',
|
||||
// ms is special .... !
|
||||
'ms'];
|
||||
var prefixes = ['-webkit-', '-moz-', '-o-', 'ms-', ''];
|
||||
|
||||
function getStyleProperty(node, name) {
|
||||
// old ff need null, https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle
|
||||
var style = window.getComputedStyle(node, null);
|
||||
var ret = '';
|
||||
for (var i = 0; i < prefixes.length; i++) {
|
||||
ret = style.getPropertyValue(prefixes[i] + name);
|
||||
if (ret) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
function fixBrowserByTimeout(node) {
|
||||
if (isCssAnimationSupported) {
|
||||
var transitionDelay = parseFloat(getStyleProperty(node, 'transition-delay')) || 0;
|
||||
var transitionDuration = parseFloat(getStyleProperty(node, 'transition-duration')) || 0;
|
||||
var animationDelay = parseFloat(getStyleProperty(node, 'animation-delay')) || 0;
|
||||
var animationDuration = parseFloat(getStyleProperty(node, 'animation-duration')) || 0;
|
||||
var time = Math.max(transitionDuration + transitionDelay, animationDuration + animationDelay);
|
||||
// sometimes, browser bug
|
||||
node.rcEndAnimTimeout = setTimeout(function () {
|
||||
node.rcEndAnimTimeout = null;
|
||||
if (node.rcEndListener) {
|
||||
node.rcEndListener();
|
||||
}
|
||||
}, time * 1000 + 200);
|
||||
}
|
||||
}
|
||||
|
||||
function clearBrowserBugTimeout(node) {
|
||||
if (node.rcEndAnimTimeout) {
|
||||
clearTimeout(node.rcEndAnimTimeout);
|
||||
node.rcEndAnimTimeout = null;
|
||||
}
|
||||
}
|
||||
|
||||
var cssAnimation = function cssAnimation(node, transitionName, endCallback) {
|
||||
var nameIsObj = (typeof transitionName === 'undefined' ? 'undefined' : _typeof(transitionName)) === 'object';
|
||||
var className = nameIsObj ? transitionName.name : transitionName;
|
||||
var activeClassName = nameIsObj ? transitionName.active : transitionName + '-active';
|
||||
var end = endCallback;
|
||||
var start = void 0;
|
||||
var active = void 0;
|
||||
var nodeClasses = classes(node);
|
||||
|
||||
if (endCallback && Object.prototype.toString.call(endCallback) === '[object Object]') {
|
||||
end = endCallback.end;
|
||||
start = endCallback.start;
|
||||
active = endCallback.active;
|
||||
}
|
||||
|
||||
if (node.rcEndListener) {
|
||||
node.rcEndListener();
|
||||
}
|
||||
|
||||
node.rcEndListener = function (e) {
|
||||
if (e && e.target !== node) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (node.rcAnimTimeout) {
|
||||
clearTimeout(node.rcAnimTimeout);
|
||||
node.rcAnimTimeout = null;
|
||||
}
|
||||
|
||||
clearBrowserBugTimeout(node);
|
||||
|
||||
nodeClasses.remove(className);
|
||||
nodeClasses.remove(activeClassName);
|
||||
|
||||
Event.removeEndEventListener(node, node.rcEndListener);
|
||||
node.rcEndListener = null;
|
||||
|
||||
// Usually this optional end is used for informing an owner of
|
||||
// a leave animation and telling it to remove the child.
|
||||
if (end) {
|
||||
end();
|
||||
}
|
||||
};
|
||||
|
||||
Event.addEndEventListener(node, node.rcEndListener);
|
||||
|
||||
if (start) {
|
||||
start();
|
||||
}
|
||||
nodeClasses.add(className);
|
||||
|
||||
node.rcAnimTimeout = setTimeout(function () {
|
||||
node.rcAnimTimeout = null;
|
||||
nodeClasses.add(activeClassName);
|
||||
if (active) {
|
||||
setTimeout(active, 0);
|
||||
}
|
||||
fixBrowserByTimeout(node);
|
||||
// 30ms for firefox
|
||||
}, 30);
|
||||
|
||||
return {
|
||||
stop: function stop() {
|
||||
if (node.rcEndListener) {
|
||||
node.rcEndListener();
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
cssAnimation.style = function (node, style, callback) {
|
||||
if (node.rcEndListener) {
|
||||
node.rcEndListener();
|
||||
}
|
||||
|
||||
node.rcEndListener = function (e) {
|
||||
if (e && e.target !== node) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (node.rcAnimTimeout) {
|
||||
clearTimeout(node.rcAnimTimeout);
|
||||
node.rcAnimTimeout = null;
|
||||
}
|
||||
|
||||
clearBrowserBugTimeout(node);
|
||||
|
||||
Event.removeEndEventListener(node, node.rcEndListener);
|
||||
node.rcEndListener = null;
|
||||
|
||||
// Usually this optional callback is used for informing an owner of
|
||||
// a leave animation and telling it to remove the child.
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
Event.addEndEventListener(node, node.rcEndListener);
|
||||
|
||||
node.rcAnimTimeout = setTimeout(function () {
|
||||
for (var s in style) {
|
||||
if (style.hasOwnProperty(s)) {
|
||||
node.style[s] = style[s];
|
||||
}
|
||||
}
|
||||
node.rcAnimTimeout = null;
|
||||
fixBrowserByTimeout(node);
|
||||
}, 0);
|
||||
};
|
||||
|
||||
cssAnimation.setTransition = function (node, p, value) {
|
||||
var property = p;
|
||||
var v = value;
|
||||
if (value === undefined) {
|
||||
v = property;
|
||||
property = '';
|
||||
}
|
||||
property = property || '';
|
||||
capitalPrefixes.forEach(function (prefix) {
|
||||
node.style[prefix + 'Transition' + property] = v;
|
||||
});
|
||||
};
|
||||
|
||||
cssAnimation.isCssAnimationSupported = isCssAnimationSupported;
|
||||
|
||||
export { isCssAnimationSupported };
|
||||
|
||||
export default cssAnimation;
|
||||
135
web/node_modules/css-animation/lib/Event.js
generated
vendored
Normal file
135
web/node_modules/css-animation/lib/Event.js
generated
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var START_EVENT_NAME_MAP = {
|
||||
transitionstart: {
|
||||
transition: 'transitionstart',
|
||||
WebkitTransition: 'webkitTransitionStart',
|
||||
MozTransition: 'mozTransitionStart',
|
||||
OTransition: 'oTransitionStart',
|
||||
msTransition: 'MSTransitionStart'
|
||||
},
|
||||
|
||||
animationstart: {
|
||||
animation: 'animationstart',
|
||||
WebkitAnimation: 'webkitAnimationStart',
|
||||
MozAnimation: 'mozAnimationStart',
|
||||
OAnimation: 'oAnimationStart',
|
||||
msAnimation: 'MSAnimationStart'
|
||||
}
|
||||
};
|
||||
|
||||
var END_EVENT_NAME_MAP = {
|
||||
transitionend: {
|
||||
transition: 'transitionend',
|
||||
WebkitTransition: 'webkitTransitionEnd',
|
||||
MozTransition: 'mozTransitionEnd',
|
||||
OTransition: 'oTransitionEnd',
|
||||
msTransition: 'MSTransitionEnd'
|
||||
},
|
||||
|
||||
animationend: {
|
||||
animation: 'animationend',
|
||||
WebkitAnimation: 'webkitAnimationEnd',
|
||||
MozAnimation: 'mozAnimationEnd',
|
||||
OAnimation: 'oAnimationEnd',
|
||||
msAnimation: 'MSAnimationEnd'
|
||||
}
|
||||
};
|
||||
|
||||
var startEvents = [];
|
||||
var endEvents = [];
|
||||
|
||||
function detectEvents() {
|
||||
var testEl = document.createElement('div');
|
||||
var style = testEl.style;
|
||||
|
||||
if (!('AnimationEvent' in window)) {
|
||||
delete START_EVENT_NAME_MAP.animationstart.animation;
|
||||
delete END_EVENT_NAME_MAP.animationend.animation;
|
||||
}
|
||||
|
||||
if (!('TransitionEvent' in window)) {
|
||||
delete START_EVENT_NAME_MAP.transitionstart.transition;
|
||||
delete END_EVENT_NAME_MAP.transitionend.transition;
|
||||
}
|
||||
|
||||
function process(EVENT_NAME_MAP, events) {
|
||||
for (var baseEventName in EVENT_NAME_MAP) {
|
||||
if (EVENT_NAME_MAP.hasOwnProperty(baseEventName)) {
|
||||
var baseEvents = EVENT_NAME_MAP[baseEventName];
|
||||
for (var styleName in baseEvents) {
|
||||
if (styleName in style) {
|
||||
events.push(baseEvents[styleName]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
process(START_EVENT_NAME_MAP, startEvents);
|
||||
process(END_EVENT_NAME_MAP, endEvents);
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
||||
detectEvents();
|
||||
}
|
||||
|
||||
function addEventListener(node, eventName, eventListener) {
|
||||
node.addEventListener(eventName, eventListener, false);
|
||||
}
|
||||
|
||||
function removeEventListener(node, eventName, eventListener) {
|
||||
node.removeEventListener(eventName, eventListener, false);
|
||||
}
|
||||
|
||||
var TransitionEvents = {
|
||||
// Start events
|
||||
startEvents: startEvents,
|
||||
|
||||
addStartEventListener: function addStartEventListener(node, eventListener) {
|
||||
if (startEvents.length === 0) {
|
||||
window.setTimeout(eventListener, 0);
|
||||
return;
|
||||
}
|
||||
startEvents.forEach(function (startEvent) {
|
||||
addEventListener(node, startEvent, eventListener);
|
||||
});
|
||||
},
|
||||
removeStartEventListener: function removeStartEventListener(node, eventListener) {
|
||||
if (startEvents.length === 0) {
|
||||
return;
|
||||
}
|
||||
startEvents.forEach(function (startEvent) {
|
||||
removeEventListener(node, startEvent, eventListener);
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// End events
|
||||
endEvents: endEvents,
|
||||
|
||||
addEndEventListener: function addEndEventListener(node, eventListener) {
|
||||
if (endEvents.length === 0) {
|
||||
window.setTimeout(eventListener, 0);
|
||||
return;
|
||||
}
|
||||
endEvents.forEach(function (endEvent) {
|
||||
addEventListener(node, endEvent, eventListener);
|
||||
});
|
||||
},
|
||||
removeEndEventListener: function removeEndEventListener(node, eventListener) {
|
||||
if (endEvents.length === 0) {
|
||||
return;
|
||||
}
|
||||
endEvents.forEach(function (endEvent) {
|
||||
removeEventListener(node, endEvent, eventListener);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
exports['default'] = TransitionEvents;
|
||||
module.exports = exports['default'];
|
||||
191
web/node_modules/css-animation/lib/index.js
generated
vendored
Normal file
191
web/node_modules/css-animation/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,191 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.isCssAnimationSupported = undefined;
|
||||
|
||||
var _typeof2 = require('babel-runtime/helpers/typeof');
|
||||
|
||||
var _typeof3 = _interopRequireDefault(_typeof2);
|
||||
|
||||
var _Event = require('./Event');
|
||||
|
||||
var _Event2 = _interopRequireDefault(_Event);
|
||||
|
||||
var _componentClasses = require('component-classes');
|
||||
|
||||
var _componentClasses2 = _interopRequireDefault(_componentClasses);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
var isCssAnimationSupported = _Event2['default'].endEvents.length !== 0;
|
||||
var capitalPrefixes = ['Webkit', 'Moz', 'O',
|
||||
// ms is special .... !
|
||||
'ms'];
|
||||
var prefixes = ['-webkit-', '-moz-', '-o-', 'ms-', ''];
|
||||
|
||||
function getStyleProperty(node, name) {
|
||||
// old ff need null, https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle
|
||||
var style = window.getComputedStyle(node, null);
|
||||
var ret = '';
|
||||
for (var i = 0; i < prefixes.length; i++) {
|
||||
ret = style.getPropertyValue(prefixes[i] + name);
|
||||
if (ret) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
function fixBrowserByTimeout(node) {
|
||||
if (isCssAnimationSupported) {
|
||||
var transitionDelay = parseFloat(getStyleProperty(node, 'transition-delay')) || 0;
|
||||
var transitionDuration = parseFloat(getStyleProperty(node, 'transition-duration')) || 0;
|
||||
var animationDelay = parseFloat(getStyleProperty(node, 'animation-delay')) || 0;
|
||||
var animationDuration = parseFloat(getStyleProperty(node, 'animation-duration')) || 0;
|
||||
var time = Math.max(transitionDuration + transitionDelay, animationDuration + animationDelay);
|
||||
// sometimes, browser bug
|
||||
node.rcEndAnimTimeout = setTimeout(function () {
|
||||
node.rcEndAnimTimeout = null;
|
||||
if (node.rcEndListener) {
|
||||
node.rcEndListener();
|
||||
}
|
||||
}, time * 1000 + 200);
|
||||
}
|
||||
}
|
||||
|
||||
function clearBrowserBugTimeout(node) {
|
||||
if (node.rcEndAnimTimeout) {
|
||||
clearTimeout(node.rcEndAnimTimeout);
|
||||
node.rcEndAnimTimeout = null;
|
||||
}
|
||||
}
|
||||
|
||||
var cssAnimation = function cssAnimation(node, transitionName, endCallback) {
|
||||
var nameIsObj = (typeof transitionName === 'undefined' ? 'undefined' : (0, _typeof3['default'])(transitionName)) === 'object';
|
||||
var className = nameIsObj ? transitionName.name : transitionName;
|
||||
var activeClassName = nameIsObj ? transitionName.active : transitionName + '-active';
|
||||
var end = endCallback;
|
||||
var start = void 0;
|
||||
var active = void 0;
|
||||
var nodeClasses = (0, _componentClasses2['default'])(node);
|
||||
|
||||
if (endCallback && Object.prototype.toString.call(endCallback) === '[object Object]') {
|
||||
end = endCallback.end;
|
||||
start = endCallback.start;
|
||||
active = endCallback.active;
|
||||
}
|
||||
|
||||
if (node.rcEndListener) {
|
||||
node.rcEndListener();
|
||||
}
|
||||
|
||||
node.rcEndListener = function (e) {
|
||||
if (e && e.target !== node) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (node.rcAnimTimeout) {
|
||||
clearTimeout(node.rcAnimTimeout);
|
||||
node.rcAnimTimeout = null;
|
||||
}
|
||||
|
||||
clearBrowserBugTimeout(node);
|
||||
|
||||
nodeClasses.remove(className);
|
||||
nodeClasses.remove(activeClassName);
|
||||
|
||||
_Event2['default'].removeEndEventListener(node, node.rcEndListener);
|
||||
node.rcEndListener = null;
|
||||
|
||||
// Usually this optional end is used for informing an owner of
|
||||
// a leave animation and telling it to remove the child.
|
||||
if (end) {
|
||||
end();
|
||||
}
|
||||
};
|
||||
|
||||
_Event2['default'].addEndEventListener(node, node.rcEndListener);
|
||||
|
||||
if (start) {
|
||||
start();
|
||||
}
|
||||
nodeClasses.add(className);
|
||||
|
||||
node.rcAnimTimeout = setTimeout(function () {
|
||||
node.rcAnimTimeout = null;
|
||||
nodeClasses.add(activeClassName);
|
||||
if (active) {
|
||||
setTimeout(active, 0);
|
||||
}
|
||||
fixBrowserByTimeout(node);
|
||||
// 30ms for firefox
|
||||
}, 30);
|
||||
|
||||
return {
|
||||
stop: function stop() {
|
||||
if (node.rcEndListener) {
|
||||
node.rcEndListener();
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
cssAnimation.style = function (node, style, callback) {
|
||||
if (node.rcEndListener) {
|
||||
node.rcEndListener();
|
||||
}
|
||||
|
||||
node.rcEndListener = function (e) {
|
||||
if (e && e.target !== node) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (node.rcAnimTimeout) {
|
||||
clearTimeout(node.rcAnimTimeout);
|
||||
node.rcAnimTimeout = null;
|
||||
}
|
||||
|
||||
clearBrowserBugTimeout(node);
|
||||
|
||||
_Event2['default'].removeEndEventListener(node, node.rcEndListener);
|
||||
node.rcEndListener = null;
|
||||
|
||||
// Usually this optional callback is used for informing an owner of
|
||||
// a leave animation and telling it to remove the child.
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
_Event2['default'].addEndEventListener(node, node.rcEndListener);
|
||||
|
||||
node.rcAnimTimeout = setTimeout(function () {
|
||||
for (var s in style) {
|
||||
if (style.hasOwnProperty(s)) {
|
||||
node.style[s] = style[s];
|
||||
}
|
||||
}
|
||||
node.rcAnimTimeout = null;
|
||||
fixBrowserByTimeout(node);
|
||||
}, 0);
|
||||
};
|
||||
|
||||
cssAnimation.setTransition = function (node, p, value) {
|
||||
var property = p;
|
||||
var v = value;
|
||||
if (value === undefined) {
|
||||
v = property;
|
||||
property = '';
|
||||
}
|
||||
property = property || '';
|
||||
capitalPrefixes.forEach(function (prefix) {
|
||||
node.style[prefix + 'Transition' + property] = v;
|
||||
});
|
||||
};
|
||||
|
||||
cssAnimation.isCssAnimationSupported = isCssAnimationSupported;
|
||||
|
||||
exports.isCssAnimationSupported = isCssAnimationSupported;
|
||||
exports['default'] = cssAnimation;
|
||||
82
web/node_modules/css-animation/package.json
generated
vendored
Normal file
82
web/node_modules/css-animation/package.json
generated
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"_from": "css-animation@^1.5.0",
|
||||
"_id": "css-animation@1.6.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-/48+/BaEaHRY6kNQ2OIPzKf9A6g8WjZYjhiNDNuIVbsm5tXCGIAsHDjB4Xu1C4vXJtUWZo26O68OQkDpNBaPog==",
|
||||
"_location": "/css-animation",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "css-animation@^1.5.0",
|
||||
"name": "css-animation",
|
||||
"escapedName": "css-animation",
|
||||
"rawSpec": "^1.5.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.5.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/antd",
|
||||
"/rc-animate",
|
||||
"/rc-collapse"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/css-animation/-/css-animation-1.6.1.tgz",
|
||||
"_shasum": "162064a3b0d51f958b7ff37b3d6d4de18e17039e",
|
||||
"_spec": "css-animation@^1.5.0",
|
||||
"_where": "/Users/thilina/TestProjects/icehrm-pro/web/node_modules/antd",
|
||||
"author": "",
|
||||
"bugs": {
|
||||
"url": "http://github.com/yiminghe/css-animation/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"config": {
|
||||
"port": 9001,
|
||||
"entry": {
|
||||
"css-animation": [
|
||||
"./src/index.js"
|
||||
]
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"babel-runtime": "6.x",
|
||||
"component-classes": "^1.2.5"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "css-animation",
|
||||
"devDependencies": {
|
||||
"expect.js": "0.3.x",
|
||||
"pre-commit": "1.x",
|
||||
"rc-tools": "6.x",
|
||||
"react": "15.x",
|
||||
"react-dom": "15.x"
|
||||
},
|
||||
"files": [
|
||||
"lib",
|
||||
"es"
|
||||
],
|
||||
"homepage": "http://github.com/yiminghe/css-animation",
|
||||
"keywords": [
|
||||
"css-animation"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./lib/index",
|
||||
"module": "./es/index",
|
||||
"name": "css-animation",
|
||||
"pre-commit": [
|
||||
"lint"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/yiminghe/css-animation.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rc-tools run build",
|
||||
"compile": "rc-tools run compile --babel-runtime",
|
||||
"dist": "rc-tools run dist --babel-runtime",
|
||||
"gh-pages": "rc-tools run gh-pages",
|
||||
"lint": "rc-tools run lint",
|
||||
"pub": "rc-tools run pub --babel-runtime",
|
||||
"start": "rc-tools run server"
|
||||
},
|
||||
"version": "1.6.1"
|
||||
}
|
||||
Reference in New Issue
Block a user