rc-banner-anim
Version:
banner-anim animation component for react
1,689 lines (1,468 loc) • 292 kB
JavaScript
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("react"), require("react-dom"));
else if(typeof define === 'function' && define.amd)
define(["react", "react-dom"], factory);
else if(typeof exports === 'object')
exports["rc-banner-anim"] = factory(require("react"), require("react-dom"));
else
root["rc-banner-anim"] = factory(root["React"], root["ReactDOM"]);
})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_29__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 67);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _assign = __webpack_require__(71);
var _assign2 = _interopRequireDefault(_assign);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _assign2.default || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
/***/ }),
/* 1 */
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_1__;
/***/ }),
/* 2 */
/***/ (function(module, exports) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self
// eslint-disable-next-line no-new-func
: Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
/***/ }),
/* 3 */
/***/ (function(module, exports) {
var core = module.exports = { version: '2.6.11' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
// Thank's IE8 for his funny defineProperty
module.exports = !__webpack_require__(21)(function () {
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
if (process.env.NODE_ENV !== 'production') {
var ReactIs = __webpack_require__(59);
// By explicitly using `prop-types` you are opting into new development behavior.
// http://fb.me/prop-types-in-prod
var throwOnDirectAccess = true;
module.exports = __webpack_require__(113)(ReactIs.isElement, throwOnDirectAccess);
} else {
// By explicitly using `prop-types` you are opting into new production behavior.
// http://fb.me/prop-types-in-prod
module.exports = __webpack_require__(116)();
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18)))
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(20);
var IE8_DOM_DEFINE = __webpack_require__(49);
var toPrimitive = __webpack_require__(32);
var dP = Object.defineProperty;
exports.f = __webpack_require__(4) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPrimitive(P, true);
anObject(Attributes);
if (IE8_DOM_DEFINE) try {
return dP(O, P, Attributes);
} catch (e) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
/***/ }),
/* 7 */
/***/ (function(module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
return hasOwnProperty.call(it, key);
};
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
exports.default = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _typeof2 = __webpack_require__(54);
var _typeof3 = _interopRequireDefault(_typeof2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function (self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;
};
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _defineProperty = __webpack_require__(101);
var _defineProperty2 = _interopRequireDefault(_defineProperty);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
(0, _defineProperty2.default)(target, descriptor.key, descriptor);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _setPrototypeOf = __webpack_require__(104);
var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);
var _create = __webpack_require__(108);
var _create2 = _interopRequireDefault(_create);
var _typeof2 = __webpack_require__(54);
var _typeof3 = _interopRequireDefault(_typeof2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function (subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));
}
subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;
};
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
exports.default = function (obj, keys) {
var target = {};
for (var i in obj) {
if (keys.indexOf(i) >= 0) continue;
if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
target[i] = obj[i];
}
return target;
};
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(2);
var core = __webpack_require__(3);
var ctx = __webpack_require__(48);
var hide = __webpack_require__(14);
var has = __webpack_require__(7);
var PROTOTYPE = 'prototype';
var $export = function (type, name, source) {
var IS_FORCED = type & $export.F;
var IS_GLOBAL = type & $export.G;
var IS_STATIC = type & $export.S;
var IS_PROTO = type & $export.P;
var IS_BIND = type & $export.B;
var IS_WRAP = type & $export.W;
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
var expProto = exports[PROTOTYPE];
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
var key, own, out;
if (IS_GLOBAL) source = name;
for (key in source) {
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
if (own && has(exports, key)) continue;
// export native or passed
out = own ? target[key] : source[key];
// prevent global pollution for namespaces
exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
// bind timers to global for call from export context
: IS_BIND && own ? ctx(out, global)
// wrap global constructors for prevent change them in library
: IS_WRAP && target[key] == out ? (function (C) {
var F = function (a, b, c) {
if (this instanceof C) {
switch (arguments.length) {
case 0: return new C();
case 1: return new C(a);
case 2: return new C(a, b);
} return new C(a, b, c);
} return C.apply(this, arguments);
};
F[PROTOTYPE] = C[PROTOTYPE];
return F;
// make static versions for prototype methods
})(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
// export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
if (IS_PROTO) {
(exports.virtual || (exports.virtual = {}))[key] = out;
// export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
}
}
};
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(6);
var createDesc = __webpack_require__(24);
module.exports = __webpack_require__(4) ? function (object, key, value) {
return dP.f(object, key, createDesc(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
/***/ }),
/* 15 */
/***/ (function(module, exports) {
module.exports = function (it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
/***/ }),
/* 16 */
/***/ (function(module, exports, __webpack_require__) {
// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = __webpack_require__(52);
var defined = __webpack_require__(33);
module.exports = function (it) {
return IObject(defined(it));
};
/***/ }),
/* 17 */
/***/ (function(module, exports, __webpack_require__) {
var store = __webpack_require__(36)('wks');
var uid = __webpack_require__(27);
var Symbol = __webpack_require__(2).Symbol;
var USE_SYMBOL = typeof Symbol == 'function';
var $exports = module.exports = function (name) {
return store[name] || (store[name] =
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
};
$exports.store = store;
/***/ }),
/* 18 */
/***/ (function(module, exports) {
// shim for using process in browser
var process = module.exports = {};
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
} ())
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;
process.listeners = function (name) { return [] }
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };
/***/ }),
/* 19 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["f"] = toArrayChildren;
/* harmony export (immutable) */ __webpack_exports__["c"] = dataToArray;
/* harmony export (immutable) */ __webpack_exports__["d"] = setAnimCompToTagComp;
/* harmony export (immutable) */ __webpack_exports__["b"] = currentScrollTop;
/* harmony export (immutable) */ __webpack_exports__["a"] = currentScrollLeft;
/* harmony export (immutable) */ __webpack_exports__["g"] = windowHeight;
/* harmony export (immutable) */ __webpack_exports__["e"] = switchChildren;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
function toArrayChildren(children) {
var ret = [];
__WEBPACK_IMPORTED_MODULE_0_react___default.a.Children.forEach(children, function (c) {
ret.push(c);
});
return ret;
}
function dataToArray(vars) {
if (!vars && vars !== 0) {
return [];
}
if (Array.isArray(vars)) {
return vars;
}
return [vars];
}
function setAnimCompToTagComp(item, i) {
if (!item) {
return null;
}
var itemProps = item.props;
if (!itemProps.component) {
return item;
}
var props = {};
props.key = item.key || i;
// dom global attributes
var domAttrArray = ['accesskey', 'classname', 'contenteditable', 'contextmenu', 'dir', 'draggable', 'dropzone', 'hidden', 'id', 'lang', 'spellcheck', 'style', 'tabindex', 'title'];
Object.keys(itemProps).forEach(function (key) {
if (domAttrArray.indexOf(key.toLocaleLowerCase()) >= 0 || key.match('data-')) {
props[key] = itemProps[key];
}
});
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(itemProps.component, props, itemProps.children);
}
setAnimCompToTagComp.propTypes = {
key: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string
};
function currentScrollTop() {
return window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
}
function currentScrollLeft() {
return window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft;
}
function windowHeight() {
return window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
}
function switchChildren(hideProps, item) {
if (!hideProps) {
return item;
}
if (item.type.isTweenOne) {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.cloneElement(item, { reverse: true });
}
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.cloneElement(item, item.props, null);
}
/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(15);
module.exports = function (it) {
if (!isObject(it)) throw TypeError(it + ' is not an object!');
return it;
};
/***/ }),
/* 21 */
/***/ (function(module, exports) {
module.exports = function (exec) {
try {
return !!exec();
} catch (e) {
return true;
}
};
/***/ }),
/* 22 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return windowIsUndefined; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return transformOrFilter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return styleValueToArray; });
/* harmony export (immutable) */ __webpack_exports__["j"] = toArrayChildren;
/* harmony export (immutable) */ __webpack_exports__["a"] = dataToArray;
/* harmony export (immutable) */ __webpack_exports__["f"] = objectEqual;
/* harmony export (immutable) */ __webpack_exports__["b"] = findChildInChildrenByKey;
/* harmony export (immutable) */ __webpack_exports__["e"] = mergeChildren;
/* harmony export (immutable) */ __webpack_exports__["k"] = transformArguments;
/* harmony export (immutable) */ __webpack_exports__["c"] = getChildrenFromProps;
/* harmony export (immutable) */ __webpack_exports__["h"] = startConvertToEndUnit;
/* harmony export (immutable) */ __webpack_exports__["g"] = parsePath;
/* harmony export (immutable) */ __webpack_exports__["d"] = getTransformValue;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
var windowIsUndefined = !(typeof window !== 'undefined' && window.document && window.document.createElement);
var transformOrFilter = {
transform: 1,
'-ms-transform': 1,
'-moz-transform': 1,
'-webkit-transform': 1,
'-o-transform': 1,
filter: 1,
'-webkit-filter': 1
};
var styleValueToArray = {
margin: 1,
padding: 1,
borderWidth: 1,
borderRadius: 1
};
function toArrayChildren(children) {
var ret = [];
__WEBPACK_IMPORTED_MODULE_0_react___default.a.Children.forEach(children, function (c) {
ret.push(c);
});
return ret;
}
function dataToArray(vars) {
if (!vars && vars !== 0) {
return [];
}
if (Array.isArray(vars)) {
return vars;
}
return [vars];
}
function deepEql(a, b) {
if (!a || !b) {
return false;
}
var $a = Object.keys(a);
var $b = Object.keys(b);
if ($a.length && $b.length && $a.length === $b.length) {
return !$a.some(function (key) {
var aa = a[key];
var bb = b[key];
if (Array.isArray(aa) && Array.isArray(bb)) {
var aaa = aa.join();
var bbb = bb.join();
if (aaa === bbb && !aaa.match(/\[object object\]/ig)) {
aa = aaa;
bb = bbb;
}
}
return aa !== bb;
});
}
return false;
}
function objectEqual(obj1, obj2) {
if (obj1 === obj2 || deepEql(obj1, obj2)) {
return true;
}
if (!obj1 || !obj2 || Object.keys(obj1).length !== Object.keys(obj2).length) {
return false;
}
// animation 写在标签上的进行判断是否相等, 判断每个参数有没有 function;
var equalBool = true;
var setEqualBool = function setEqualBool($a, $b) {
var objA = Object.keys($a).length > Object.keys($b).length ? $a : $b;
var objB = Object.keys($a).length > Object.keys($b).length ? $b : $a;
Object.keys(objA).forEach(function (key) {
// 如果前面有参数匹配不相同则直接返回;
if (!equalBool) {
return;
}
if (!(key in objB)) {
equalBool = false;
}
if (typeof objA[key] === 'object' && typeof objB[key] === 'object') {
equalBool = objectEqual(objA[key], objB[key]);
} else if (typeof objA[key] === 'function' && typeof objB[key] === 'function') {
if (objA[key].toString().replace(/\s+/g, '') !== objB[key].toString().replace(/\s+/g, '')) {
equalBool = false;
}
} else if (objA[key] !== objB[key]) {
equalBool = false;
}
});
};
if (Array.isArray(obj1) && Array.isArray(obj2)) {
if (obj1.length !== obj2.length) {
return false;
}
obj1.forEach(function (item, i) {
setEqualBool(item, obj2[i]);
});
} else {
setEqualBool(obj1, obj2);
}
return equalBool;
}
function findChildInChildrenByKey(children, key) {
var ret = null;
if (children) {
children.forEach(function (c) {
if (ret || !c) {
return;
}
if (c.key === key) {
ret = c;
}
});
}
return ret;
}
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 = [];
var followChildrenKey = void 0;
prev.forEach(function (c) {
if (!c) {
return;
}
if (findChildInChildrenByKey(next, c.key)) {
if (pendingChildren.length) {
nextChildrenPending[c.key] = pendingChildren;
pendingChildren = [];
}
followChildrenKey = c.key;
} else if (c.key) {
pendingChildren.push(c);
}
});
if (!followChildrenKey) {
ret = ret.concat(pendingChildren);
}
next.forEach(function (c) {
if (!c) {
return;
}
if (nextChildrenPending.hasOwnProperty(c.key)) {
// eslint-disable-line no-prototype-builtins
ret = ret.concat(nextChildrenPending[c.key]);
}
ret.push(c);
if (c.key === followChildrenKey) {
ret = ret.concat(pendingChildren);
}
});
return ret;
}
function transformArguments(arg, key, i) {
var result = void 0;
if (typeof arg === 'function') {
result = arg({
key: key,
index: i
});
} else {
result = arg;
}
return result;
}
function getChildrenFromProps(props) {
return props && props.children;
}
function startConvertToEndUnit(target, computedStyle, style, num, unit, dataUnit, fixed, isOriginWidth) {
if (windowIsUndefined) {
return num;
}
var horiz = /(?:Left|Right|Width|X)/i.test(style) || isOriginWidth;
horiz = style === 'padding' || style === 'marign' ? true : horiz;
var t = style.indexOf('border') !== -1 || style.indexOf('translate') !== -1 || style === 'transformOrigin' ? target : target.parentNode || document.body;
t = fixed ? document.body : t;
var pix = void 0;
var htmlComputedStyle = void 0;
// transform 在 safari 下会留着单位,chrome 下会全部转换成 px;
switch (unit) {
case '%':
pix = parseFloat(num) / 100 * (horiz ? t.clientWidth : t.clientHeight);
break;
case 'vw':
pix = parseFloat(num) * document.body.clientWidth / 100;
break;
case 'vh':
pix = parseFloat(num) * document.body.clientHeight / 100;
break;
case 'em':
pix = parseFloat(num) * parseFloat(computedStyle.fontSize);
break;
case 'rem':
{
htmlComputedStyle = window.getComputedStyle(document.getElementsByTagName('html')[0]);
pix = parseFloat(num) * parseFloat(htmlComputedStyle.fontSize);
break;
}
default:
pix = parseFloat(num);
break;
}
switch (dataUnit) {
case '%':
pix = pix ? pix * 100 / (horiz ? t.clientWidth : t.clientHeight) : 0;
break;
case 'vw':
pix = parseFloat(num) / document.body.clientWidth * 100;
break;
case 'vh':
pix = parseFloat(num) / document.body.clientHeight * 100;
break;
case 'em':
pix = parseFloat(num) / parseFloat(computedStyle.fontSize);
break;
case 'rem':
{
htmlComputedStyle = htmlComputedStyle || window.getComputedStyle(document.getElementsByTagName('html')[0]);
pix = parseFloat(num) / parseFloat(htmlComputedStyle.fontSize);
break;
}
default:
break;
}
return pix;
}
function parsePath(path) {
if (typeof path === 'string') {
if (path.charAt(0).match(/m/i)) {
var domPath = document.createElementNS('http://www.w3.org/2000/svg', 'path');
domPath.setAttributeNS(null, 'd', path);
return domPath;
}
return document.querySelector(path);
} else if (path.style) {
return path;
}
throw new Error('Error while parsing the path');
}
function getTransformValue(t) {
if (typeof t === 'string') {
return t;
}
var perspective = t.perspective;
var angle = t.rotate;
var rotateX = t.rotateX;
var rotateY = t.rotateY;
var sx = t.scaleX;
var sy = t.scaleY;
var sz = t.scaleZ;
var skx = t.skewX;
var sky = t.skewY;
var translateX = typeof t.translateX === 'string' ? t.translateX : t.translateX + 'px';
var translateY = typeof t.translateY === 'string' ? t.translateY : t.translateY + 'px';
var translateZ = typeof t.translateZ === 'string' ? t.translateZ : t.translateZ + 'px';
var sk = skx || sky ? 'skew(' + skx + 'deg,' + sky + 'deg)' : '';
var an = angle ? 'rotate(' + angle + 'deg)' : '';
var ss = sx !== 1 || sy !== 1 || sz !== 1 ? 'scale3d(' + sx + ',' + sy + ',' + sz + ')' : '';
var rX = rotateX ? 'rotateX(' + rotateX + 'deg)' : '';
var rY = rotateY ? 'rotateY(' + rotateY + 'deg)' : '';
var per = perspective ? 'perspective(' + perspective + 'px)' : '';
var defaultTranslate = ss || an || rX || rY || sk ? '' : 'translate(0px, 0px)';
var translate = t.translateZ ? 'translate3d(' + translateX + ',' + translateY + ',' + translateZ + ')' : (t.translateX || t.translateY) && 'translate(' + translateX + ',' + translateY + ')' || defaultTranslate;
return (per + ' ' + translate + ' ' + ss + ' ' + an + ' ' + rX + ' ' + rY + ' ' + sk).trim();
}
/***/ }),
/* 23 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return polyfill; });
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
function componentWillMount() {
// Call this.constructor.gDSFP to support sub-classes.
var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
if (state !== null && state !== undefined) {
this.setState(state);
}
}
function componentWillReceiveProps(nextProps) {
// Call this.constructor.gDSFP to support sub-classes.
// Use the setState() updater to ensure state isn't stale in certain edge cases.
function updater(prevState) {
var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
return state !== null && state !== undefined ? state : null;
}
// Binding "this" is important for shallow renderer support.
this.setState(updater.bind(this));
}
function componentWillUpdate(nextProps, nextState) {
try {
var prevProps = this.props;
var prevState = this.state;
this.props = nextProps;
this.state = nextState;
this.__reactInternalSnapshotFlag = true;
this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(
prevProps,
prevState
);
} finally {
this.props = prevProps;
this.state = prevState;
}
}
// React may warn about cWM/cWRP/cWU methods being deprecated.
// Add a flag to suppress these warnings for this special case.
componentWillMount.__suppressDeprecationWarning = true;
componentWillReceiveProps.__suppressDeprecationWarning = true;
componentWillUpdate.__suppressDeprecationWarning = true;
function polyfill(Component) {
var prototype = Component.prototype;
if (!prototype || !prototype.isReactComponent) {
throw new Error('Can only polyfill class components');
}
if (
typeof Component.getDerivedStateFromProps !== 'function' &&
typeof prototype.getSnapshotBeforeUpdate !== 'function'
) {
return Component;
}
// If new component APIs are defined, "unsafe" lifecycles won't be called.
// Error if any of these lifecycles are present,
// Because they would work differently between older and newer (16.3+) versions of React.
var foundWillMountName = null;
var foundWillReceivePropsName = null;
var foundWillUpdateName = null;
if (typeof prototype.componentWillMount === 'function') {
foundWillMountName = 'componentWillMount';
} else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
foundWillMountName = 'UNSAFE_componentWillMount';
}
if (typeof prototype.componentWillReceiveProps === 'function') {
foundWillReceivePropsName = 'componentWillReceiveProps';
} else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
}
if (typeof prototype.componentWillUpdate === 'function') {
foundWillUpdateName = 'componentWillUpdate';
} else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
foundWillUpdateName = 'UNSAFE_componentWillUpdate';
}
if (
foundWillMountName !== null ||
foundWillReceivePropsName !== null ||
foundWillUpdateName !== null
) {
var componentName = Component.displayName || Component.name;
var newApiName =
typeof Component.getDerivedStateFromProps === 'function'
? 'getDerivedStateFromProps()'
: 'getSnapshotBeforeUpdate()';
throw Error(
'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' +
componentName +
' uses ' +
newApiName +
' but also contains the following legacy lifecycles:' +
(foundWillMountName !== null ? '\n ' + foundWillMountName : '') +
(foundWillReceivePropsName !== null
? '\n ' + foundWillReceivePropsName
: '') +
(foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') +
'\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' +
'https://fb.me/react-async-component-lifecycle-hooks'
);
}
// React <= 16.2 does not support static getDerivedStateFromProps.
// As a workaround, use cWM and cWRP to invoke the new static lifecycle.
// Newer versions of React will ignore these lifecycles if gDSFP exists.
if (typeof Component.getDerivedStateFromProps === 'function') {
prototype.componentWillMount = componentWillMount;
prototype.componentWillReceiveProps = componentWillReceiveProps;
}
// React <= 16.2 does not support getSnapshotBeforeUpdate.
// As a workaround, use cWU to invoke the new lifecycle.
// Newer versions of React will ignore that lifecycle if gSBU exists.
if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
if (typeof prototype.componentDidUpdate !== 'function') {
throw new Error(
'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype'
);
}
prototype.componentWillUpdate = componentWillUpdate;
var componentDidUpdate = prototype.componentDidUpdate;
prototype.componentDidUpdate = function componentDidUpdatePolyfill(
prevProps,
prevState,
maybeSnapshot
) {
// 16.3+ will not execute our will-update method;
// It will pass a snapshot value to did-update though.
// Older versions will require our polyfilled will-update value.
// We need to handle both cases, but can't just check for the presence of "maybeSnapshot",
// Because for <= 15.x versions this might be a "prevContext" object.
// We also can't just check "__reactInternalSnapshot",
// Because get-snapshot might return a falsy value.
// So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.
var snapshot = this.__reactInternalSnapshotFlag
? this.__reactInternalSnapshot
: maybeSnapshot;
componentDidUpdate.call(this, prevProps, prevState, snapshot);
};
}
return Component;
}
/***/ }),
/* 24 */
/***/ (function(module, exports) {
module.exports = function (bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
/***/ }),
/* 25 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = __webpack_require__(51);
var enumBugKeys = __webpack_require__(37);
module.exports = Object.keys || function keys(O) {
return $keys(O, enumBugKeys);
};
/***/ }),
/* 26 */
/***/ (function(module, exports) {
module.exports = true;
/***/ }),
/* 27 */
/***/ (function(module, exports) {
var id = 0;
var px = Math.random();
module.exports = function (key) {
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};
/***/ }),
/* 28 */
/***/ (function(module, exports) {
exports.f = {}.propertyIsEnumerable;
/***/ }),
/* 29 */
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_29__;
/***/ }),
/* 30 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.toCssLowerCase = toCssLowerCase;
exports.toStyleUpperCase = toStyleUpperCase;
exports.toFixed = toFixed;
exports.createMatrix = createMatrix;
exports.checkStyleName = checkStyleName;
exports.getGsapType = getGsapType;
exports.parseColor = parseColor;
exports.parseShadow = parseShadow;
exports.getColor = getColor;
exports.isTransform = isTransform;
exports.isConvert = isConvert;
exports.splitFilterToObject = splitFilterToObject;
exports.getMatrix = getMatrix;
exports.getTransform = getTransform;
exports.stylesToCss = stylesToCss;
exports.getUnit = getUnit;
exports.getValues = getValues;
exports.findStyleByName = findStyleByName;
exports.mergeStyle = mergeStyle;
var isUnitlessNumber = {
animationIterationCount: true,
borderImageOutset: true,
borderImageSlice: true,
borderImageWidth: true,
boxFlex: true,
boxFlexGroup: true,
boxOrdinalGroup: true,
columnCount: true,
flex: true,
flexGrow: true,
flexPositive: true,
flexShrink: true,
flexNegative: true,
flexOrder: true,
gridRow: true,
gridColumn: true,
fontWeight: true,
lineClamp: true,
lineHeight: true,
opacity: true,
order: true,
orphans: true,
tabSize: true,
widows: true,
zIndex: true,
zoom: true,
// SVG-related properties
fillOpacity: true,
floodOpacity: true,
stopOpacity: true,
strokeDasharray: true,
strokeDashoffset: true,
strokeMiterlimit: true,
strokeOpacity: true,
strokeWidth: true
};
var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
function prefixKey(prefix, key) {
return prefix + key.charAt(0).toUpperCase() + key.substring(1);
}
Object.keys(isUnitlessNumber).forEach(function (prop) {
prefixes.forEach(function (prefix) {
isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
});
});
var unquotedContentValueRegex = /^(normal|none|(\b(url\([^)]*\)|chapter_counter|attr\([^)]*\)|(no-)?(open|close)-quote|inherit)((\b\s*)|$|\s+))+)$/;
var IE = function () {
if (typeof document === 'undefined') {
return false;
}
if (navigator && (navigator.userAgent.indexOf("MSIE 8.0") > 0 || navigator.userAgent.indexOf("MSIE 9.0") > 0)) {
return true;
}
return false;
}();
var rnd = 100000;
var colorLookup = {
aqua: [0, 255, 255],
lime: [0, 255, 0],
silver: [192, 192, 192],
black: [0, 0, 0],
maroon: [128, 0, 0],
teal: [0, 128, 128],
blue: [0, 0, 255],
navy: [0, 0, 128],
white: [255, 255, 255],
fuchsia: [255, 0, 255],
olive: [128, 128, 0],
yellow: [255, 255, 0],
orange: [255, 165, 0],
gray: [128, 128, 128],
purple: [128, 0, 128],
green: [0, 128, 0],
red: [255, 0, 0],
pink: [255, 192, 203],
cyan: [0, 255, 255],
transparent: [255, 255, 255, 0]
};
var _hue = function _hue(hh, m1, m2) {
var h = hh > 1 ? hh - 1 : hh;
h = hh < 0 ? hh + 1 : h;
var a = h * 3 < 2 ? m1 + (m2 - m1) * (2 / 3 - h) * 6 : m1;
var b = h < 0.5 ? m2 : a;
var c = h * 6 < 1 ? m1 + (m2 - m1) * h * 6 : b;
return c * 255 + 0.5 | 0;
};
var DEG2RAD = Math.PI / 180;
var RAD2DEG = 180 / Math.PI;
var $cssList = {
_lists: {
transformsBase: ['translate', 'translateX', 'translateY', 'scale', 'scaleX', 'scaleY', 'skewX', 'skewY', 'rotateZ', 'rotate'],
transforms3D: ['translate3d', 'translateZ', 'scaleZ', 'rotateX', 'rotateY', 'perspective']
},
transformGroup: { translate: 1, translate3d: 1, scale: 1, scale3d: 1, rotate: 1, rotate3d: 1, skew: 1 },
filter: ['grayScale', 'sepia', 'hueRotate', 'invert', 'brightness', 'contrast', 'blur'],
filterConvert: { grayScale: 'grayscale', hueRotate: 'hue-rotate' }
};
$cssList._lists.transformsBase = !IE ? $cssList._lists.transformsBase.concat($cssList._lists.transforms3D) : $cssList._lists.transformsBase;
var cssList = exports.cssList = $cssList;
function toCssLowerCase(d) {
return d.replace(/[A-Z]/, function ($1) {
return '-' + $1.toLocaleLowerCase();
});
}
function toStyleUpperCase(d) {
return d.replace(/-(.?)/g, function ($1) {
return $1.replace('-', '').toLocaleUpperCase();
});
}
function toFixed(num, length) {
var _rnd = length ? Math.pow(10, length) : rnd;
var n = num | 0;
var dec = num - n;
var fixed = num;
if (dec) {
var r = (dec * _rnd + (num < 0 ? -0.5 : 0.5) | 0) / _rnd;
var t = r | 0;
var str = r.toString();
var decStr = str.split('.')[1] || '';
fixed = '' + (num < 0 && !(n + t) ? '-' : '') + (n + t) + '.' + decStr;
}
return parseFloat(fixed);
}
function createMatrix(style) {
if (typeof document === 'undefined') {
return null;
}
var matrixs = ['WebKitCSS', 'MozCSS', 'DOM', 'MsCSS', 'MSCSS', 'OCSS', 'CSS'].filter(function (key) {
return key + 'Matrix' in window;
});
if (matrixs.length) {
return new window[matrixs[0] + 'Matrix'](style);
}
console.warn('Browsers do not support matrix.');
return '';
}
function checkStyleName(p) {
if (typeof document === 'undefined') {
return null;
}
var a = ['O', 'Moz', 'ms', 'Ms', 'Webkit'];
if (p !== 'filter' && p in document.body.style) {
return p;
}
var _p = p.charAt(0).toUpperCase() + p.substr(1);
var prefixCss = a.filter(function (key) {
return '' + key + _p in document.body.style;
});
return prefixCss[0] ? '' + prefixCss[0] + _p : null;
}
function getGsapType(_p) {
var p = _p;
p = p === 'x' ? 'translateX' : p;
p = p === 'y' ? 'translateY' : p;
p = p === 'z' ? 'translateZ' : p;
// p = p === 'r' ? 'rotate' : p;
return p;
}
function parseColor(_v) {
var a = void 0;
var r = void 0;
var g = void 0;
var b = void 0;
var h = void 0;
var s = void 0;
var l = void 0;
var v = _v;
var _numExp = /(?:\d|\-\d|\.\d|\-\.\d)+/g;
if (!v) {
a = colorLookup.black;
} else if (typeof v === 'number') {
a = [v >> 16, v >> 8 & 255, v & 255];
} else {
if (v.charAt(v.length - 1) === ',') {
v = v.substr(0, v.length - 1);
}
if (colorLookup[v]) {
a = colorLookup[v];
} else if (v.charAt(0) === '#') {
// is #FFF
if (v.length === 4) {
r = v.charAt(1);
g = v.charAt(2);
b = v.charAt(3);
v = '#' + r + r + g + g + b + b;
}
v = parseInt(v.substr(1), 16);
a = [v >> 16, v >> 8 & 255, v & 255];
} else if (v.substr(0, 3) === 'hsl') {
a = v.match(_numExp);
h = Number(a[0]) % 360 / 360;
s = Number(a[1]) / 100;
l = Number(a[2]) / 100;
g = l <= 0.5 ? l * (s + 1) : l + s - l * s;
r = l * 2 - g;
if (a.length > 3) {
a[3] = Number(a[3]);
}
a[0] = _hue(h + 1 / 3, r, g);
a[1] = _hue(h, r, g);
a[2] = _hue(h - 1 / 3, r, g);
} else {
a = v.match(_numExp) || colorLookup.transparent;
}
a[0] = Number(a[0]);
a[1] = Number(a[1]);
a[2] = Number(a[2]);
if (a.length > 3) {
a[3] = Number(a[3]);
}
}
return a;
}
function parseShadow(v) {
if (!v) {
return [0, 0, 0, 0, 0, 0, 0];
}
var inset = void 0;
if (v.indexOf('rgb') >= 0) {
var t = v.match(/rgb+(?:a)?\((.*)\)/);
var s = v.replace(t[0], '').trim().split(/\s+/);
inset = s.indexOf('inset');
if (inset >= 0) {
s.splice(inset, 1);
}
var c = t[1].replace(/\s+/g, '').split(',');
if (c.length === 3) {
c.push(1);
}
return s.concat(c, inset >= 0 ? ['inset'] : []);
}
var vArr = v.split(/\s+/);
inset = vArr.indexOf('inset');
if (inset >= 0) {
vArr.splice(inset, 1);
}
var color = parseColor(vArr[vArr.length - 1]);
color[3] = typeof color[3] === 'number' ? color[3] : 1;
vArr = vArr.splice(0, vArr.length - 1);
return vArr.concat(color, inset >= 0 ? ['inset'] : []);
}
function getColor(v) {
var rgba = v.length === 4 ? 'rgba' : 'rgb';
var _vars = v.map(function (d, i) {
return i < 3 ? Math.round(d) : d;
});
return rgba + '(' + _vars.join(',') + ')';
}
function isTransform(p) {
return cssList._lists.transformsBase.indexOf(p) >= 0 ? 'transform' : p;
}
function isConvert(p) {
var cssName = isTransform(p);
return cssList.filter.indexOf(cssName) >= 0 ? 'filter' : cssName;
}
function splitFilterToObject(data) {
if (data === 'none' || !data || data === '') {
return null;
}
var filter = data.replace(' ', '').split(')').filter(function (item) {
return item;
});
var startData = {};
filter.forEach(function (item) {
var dataArr = item.split('(');
startData[dataArr[0]] = dataArr[1];
});
return startData;
}
function getMatrix(t) {
var arr = t.match(/(?:\-|\b)[\d\-\.e]+\b/gi);
var m = {};
if (arr.length === 6) {
m.m11 = parseFloat(arr[0]);
m.m12 = parseFloat(arr[1]);
m.m13 = 0;
m.m14 = 0;
m.m21 = parseFloat(arr[2]);
m.m22 = parseFloat(arr[3]);
m.m23 = 0;
m.m24 = 0;
m.m31 = 0;
m.m32 = 0;
m.m33 = 1;
m.m34 = 0;
m.m41 = parseFloat(arr[4]);
m.m42 = parseFloat(arr[5]);
m.m43 = 0;
m.m44 = 0;
} else {
arr.forEach(function (item, i) {
var ii = i % 4 + 1;
var j = Math.floor(i / 4) + 1;
m['m' + j + ii] = parseFloat(item);
});
}
return m;
}
function transformNoMatrix(transform) {
var tm = {};
tm.translateX = 0;
tm.translateY = 0;
tm.translateZ = 0;
tm.rotate = 0;
tm.rotateX = 0;
tm.rotateY = 0;
tm.scaleX = 1;
tm.scaleY = 1;
tm.scaleZ = 1;
tm.skewX = 0;
tm.skewY = 0;
tm.perspective = 0;
(transform.trim().match(/(\w+)\([^\)]+\)/ig) || []).forEach(function (str) {
var strArray = str.split('(');
var key = strArray[0].trim();
var value = strArray[1].replace(')', '').trim();
if (value.match(/%|em|rem/ig)) {
console.warn('value(' + value + ') must be absolute, not relative, has been converted to absolute.');
}
value = value.replace(/px|deg|\)/ig, '');
if (cssList.transformGroup[key] && key !== 'rotate') {
value = value.split(',').map(function (num) {
return parseFloat(num);
});
if (key === 'scale3d' || key === 'translate3d') {
['X', 'Y', 'Z'].forEach(function (s, i) {
var $key = key.substring(0, key.length - 2);
tm['' + $key + s] = value[i] || tm['' + $key + s];
});
} else if (key === 'rotate3d') {
tm.rotateX = value[0] && value[3] || tm.rotateX;
tm.rotateY = value[1] && value[3] || tm.rotateY;
tm.rotate = value[2] && value[3] || tm.rotate;
} else {
['X', 'Y'].forEach(function (s, i) {
tm['' + key + s] = value[i] || tm['' + key + s];
});
}
} else {
if (key === 'rotateZ') {
tm.rotate = parseFloat(value) || tm.rotate;
} else {
tm[key] = parseFloat(value) || tm[key];
}
}
});
return tm;
}
function getTransform(transform) {
var _transform = !transform || transform === 'none' || transform === '' ? 'matrix(1, 0, 0, 1, 0, 0)' : transform;
if (!_transform.match('matrix')) {
return transformNoMatrix(transform);
}
var m = getMatrix(_transform);
var m11 = m.m11;
var m12 = m.m12;
var m13 = m.m13;
var m14 = m.m14;
var m21 = m.m21;
var m22 = m.m22;
var m23 = m.m23;