animated-number-react
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -1,2 +0,2 @@ | ||
!function(e,n){if("object"===typeof exports&&"object"===typeof module)module.exports=n(require("react"));else if("function"===typeof define&&define.amd)define(["react"],n);else{var t=n("object"===typeof exports?require("react"):e.react);for(var r in t)("object"===typeof exports?exports:e)[r]=t[r]}}(this,function(e){return function(e){function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}var t={};return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=0)}([function(e,n,t){e.exports=t(1)},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t(2);n.default=r.a},function(e,n,t){"use strict";function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function a(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!==typeof n&&"function"!==typeof n?e:n}function o(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}var u=t(3),i=t.n(u),c=t(4),f=t.n(c),s=t(9),l=t.n(s),p=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),d={animatedValue:0},m=function(){},v=function(e){function n(){var e,t,o,u;r(this,n);for(var i=arguments.length,c=Array(i),f=0;f<i;f++)c[f]=arguments[f];return t=o=a(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(c))),o.state={animatedValue:0},o.componentDidMount=function(){o.animateValue()},o.componentDidUpdate=function(e){e.value!==o.props.value&&o.animateValue()},o.updateValue=function(e){o.props.update(e);var n=d.animatedValue;o.setState({animatedValue:n})},o.animateValue=function(){var e=o.props,n=e.duration,t=e.begin,r=e.easing,a=e.complete,u=e.run,i=e.delay,c=e.value;l()({targets:d,animatedValue:c,duration:n,update:o.updateValue,easing:r,begin:t,complete:a,run:u,delay:i})},u=t,a(o,u)}return o(n,e),p(n,[{key:"render",value:function(){return i.a.createElement("span",{className:this.props.className},this.props.formatValue(Number(this.state.animatedValue)))}}]),n}(u.Component);v.propTypes={value:f.a.oneOfType([f.a.number,f.a.string]).isRequired,duration:f.a.number,delay:f.a.number,formatValue:f.a.func,begin:f.a.func,complete:f.a.func,run:f.a.func,update:f.a.func,easing:f.a.string,className:f.a.string},v.defaultProps={duration:1e3,formatValue:function(e){return e},easing:"linear",run:m,complete:m,update:m,begin:m,delay:0,className:null},n.a=v},function(n,t){n.exports=e},function(e,n,t){e.exports=t(5)()},function(e,n,t){"use strict";var r=t(6),a=t(7),o=t(8);e.exports=function(){function e(e,n,t,r,u,i){i!==o&&a(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function n(){return e}e.isRequired=e;var t={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:n,element:e,instanceOf:n,node:e,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n};return t.checkPropTypes=r,t.PropTypes=t,t}},function(e,n,t){"use strict";function r(e){return function(){return e}}var a=function(){};a.thatReturns=r,a.thatReturnsFalse=r(!1),a.thatReturnsTrue=r(!0),a.thatReturnsNull=r(null),a.thatReturnsThis=function(){return this},a.thatReturnsArgument=function(e){return e},e.exports=a},function(e,n,t){"use strict";function r(e,n,t,r,o,u,i,c){if(a(n),!e){var f;if(void 0===n)f=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[t,r,o,u,i,c],l=0;f=new Error(n.replace(/%s/g,function(){return s[l++]})),f.name="Invariant Violation"}throw f.framesToPop=1,f}}var a=function(e){};e.exports=r},function(e,n,t){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,n){var t=this;!function(n,r){e.exports=function(){function e(e,n){for(var t=e.length,r=arguments.length>=2?arguments[1]:void 0,a=[],o=0;o<t;o+=1)if(o in e){var u=e[o];n.call(r,u,o,e)&&a.push(u)}return a}function n(e){return e.reduce(function(e,t){return e.concat(T.arr(t)?n(t):t)},[])}function r(e){return[e]}function a(e){var n={};for(var t in e)n[t]=e[t];return n}function o(e,n){var t=a(e);for(var r in e)t[r]=n.hasOwnProperty(r)?n[r]:e[r];return t}function u(e,n){var t=a(e);for(var r in n)t[r]=T.und(e[r])?n[r]:e[r];return t}function i(e,n,t){return Math.min(Math.max(e,n),t)}function c(e,n){return T.fnc(e)?e(n.target,n.id,n.total):e}function f(e,n){if(null!=e[n])return"object"}function s(e,n){return e[n]||0}function l(e){var n=/-?\d*\.?\d+/g,t=""+e;return{original:t,numbers:t.match(n)?t.match(n).map(Number):[0],strings:[]}}function p(e){var n=r(e);return n.map(function(e,t){return{target:e,id:t,total:n.length}})}function d(e,n){var t=a(n);return r(e).map(function(e,t){var r=t?0:n.delay,a={value:e};return T.und(a.delay)&&(a.delay=r),a}).map(function(e){return u(e,t)})}function m(e,n,t){var r=[],a=u(e,n);return Object.keys(t).forEach(function(e){a.hasOwnProperty(e)||"targets"===e||r.push({name:e,offset:a.offset,tweens:d(t[e],n)})}),r}function v(e,n){var t={};return Object.keys(e).forEach(function(r){var a=c(e[r],n);T.arr(a)&&(a=a.map(function(e){return c(e,n)}),1===a.length&&(a=a[0])),t[r]=a}),t.duration=parseFloat(t.duration),t.delay=parseFloat(t.delay),t}function y(e,n){var t=void 0;return e.tweens.map(function(r){var a=v(r,n),o=a.value,u=n.target[e.name],c=t?t.to.original:u,f=T.arr(o)?o[0]:c,s=o;return a.from=l(f),a.to=l(s),a.start=t?t.end:e.offset,a.end=a.start+a.delay+a.duration,a.easing=j[a.easing],a.elasticity=(1e3-i(a.elasticity,1,999))/1e3,a.isColor&&(a.round=1),t=a,a})}function h(e,n){var t=f(e.target,n.name);if(t){var r=y(n,e);return{type:t,property:n.name,animatable:e,tweens:r,duration:r[r.length-1].end,delay:r[0].delay}}}function g(t,r){return e(n(t.map(function(e){return r.map(function(n){return h(e,n)})})),function(e){return!T.und(e)})}function b(e,n,t,r){var a="delay"===e;return n.length?(a?Math.min:Math.max).apply(Math,n.map(function(n){return n[e]})):a?r.delay:t.offset+r.delay+r.duration}function O(e){var n=o(x,e),t=o(P,e),r=p(e.targets),a=m(n,t,e),i=g(r,a);return u(n,{children:[],animatables:r,animations:i,duration:b("duration",i,n,t),delay:b("delay",i,n,t)})}function w(){function n(){return window.Promise&&new Promise(function(e){return m=e})}function t(){y.reversed=!y.reversed}function r(e){return y.reversed?y.duration-e:e}function a(e){var n=y.children,t=n.length;if(e>=y.currentTime)for(var r=0;r<t;r+=1)n[r].seek(e);else for(var a=t;a--;)n[a].seek(e)}function o(n){for(var t=0,r={},a=y.animations,o=a.length;t<o;){var u=a[t],c=u.animatable,f=u.tweens,s=f.length-1,l=f[s];s&&(l=e(f,function(e){return n<e.end})[0]||l);for(var p=i(n-l.start-l.delay,0,l.duration)/l.duration,d=isNaN(p)?1:l.easing(p,l.elasticity),m=[],v=void 0,h=l.to.numbers.length,g=0;g<h;g+=1){var b=void 0,O=l.to.numbers[g],w=l.from.numbers[g];b=w+d*(O-w),m.push(b)}v=m[0],E[u.type](c.target,u.property,v,r,c.id),u.currentValue=v,t+=1}y.currentTime=n,y.progress=n/y.duration*100}function u(e){y[e]&&y[e](y)}function c(){y.remaining&&!0!==y.remaining&&(y.remaining-=1)}function f(e){var i=y.duration,f=y.offset,s=f+y.delay,h=y.currentTime,g=y.reversed,b=r(e);y.children.length&&a(b),(b>=s||!i)&&(y.began||(y.began=!0,u("begin")),u("run")),b>f&&b<i?o(b):(b<=f&&0!==h&&(o(0),g&&c()),(b>=i&&h!==i||!i)&&(o(i),g||c())),u("update"),e>=i&&(y.remaining?(p=l,"alternate"===y.direction&&t()):(y.pause(),y.completed||(y.completed=!0,u("complete"),"Promise"in window&&(m(),v=n()))),d=0)}var s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=void 0,p=void 0,d=0,m=null,v=n(),y=O(s);return y.reset=function(){var e=y.direction,n=y.loop;y.currentTime=0,y.progress=0,y.paused=!0,y.began=!1,y.completed=!1,y.reversed="reverse"===e,y.remaining="alternate"===e&&1===n?2:n,o(0);for(var t=y.children.length;t--;)y.children[t].reset()},y.tick=function(e){l=e,p||(p=l),f((d+l-p)*w.speed)},y.seek=function(e){f(r(e))},y.pause=function(){var e=V.indexOf(y);e>-1&&V.splice(e,1),y.paused=!0},y.play=function(){y.paused&&(y.paused=!1,p=0,d=r(y.currentTime),V.push(y),k||M())},y.reverse=function(){t(),p=0,d=r(y.currentTime)},y.restart=function(){y.pause(),y.reset(),y.play()},y.finished=v,y.reset(),y.autoplay&&y.play(),y}var x={update:void 0,begin:void 0,run:void 0,complete:void 0,loop:1,direction:"normal",autoplay:!0,offset:0},P={duration:1e3,delay:0,easing:"easeOutElastic",elasticity:500,round:0},T={arr:function(e){return Array.isArray(e)},fnc:function(e){return"function"===typeof e},und:function(e){return"undefined"===typeof e}},_=function(){function e(e,n){return 1-3*n+3*e}function n(e,n){return 3*n-6*e}function t(e){return 3*e}function r(r,a,o){return((e(a,o)*r+n(a,o))*r+t(a))*r}function a(e,n,t,a){if(e>=0&&e<=1&&t>=0&&t<=1){var i=new Float32Array(o);if(e!==n||t!==a)for(var c=0;c<o;c+=1)i[c]=r(c*u,e,t);return function(r){return e===n&&t===a?r:0===r?0:1===r?1:void 0}}}var o=11,u=1/(o-1);return a}(),j=function(){function e(e,n){return 0===e||1===e?e:-Math.pow(2,10*(e-1))*Math.sin((e-1-n/(2*Math.PI)*Math.asin(1))*(2*Math.PI)/n)}var n=["Quad","Cubic","Quart","Quint","Sine","Expo","Circ","Back","Elastic"],r={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],e],Out:[[.25,.46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],function(n,t){return 1-e(1-n,t)}],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],function(n,t){return n<.5?e(2*n,t)/2:1-e(-2*n+2,t)/2}]},a={linear:_(.25,.25,.75,.75)};return Object.keys(r).forEach(function(e){r[e].forEach(function(r,o){a["ease"+e+n[o]]=T.fnc(r)?r:_.apply(t,r)})}),a}(),E={css:function(e,n,t){return e.style[n]=t},attribute:function(e,n,t){return e.setAttribute(n,t)},object:function(e,n,t){return e[n]=t},transform:function(e,n,t,r,a){r[a]||(r[a]=[]),r[a].push(n+"("+t+")")}},V=[],k=0,M=function(){function e(){k=requestAnimationFrame(n)}function n(n){var t=V.length;if(t){for(var r=0;r<t;)V[r]&&V[r].tick(n),r+=1;e()}else cancelAnimationFrame(k),k=0}return e}();return w.speed=1,w.running=V,w.getValue=s,w.bezier=_,w.easings=j,w}()}()}])}); | ||
!function(e,n){if("object"===typeof exports&&"object"===typeof module)module.exports=n(require("react"));else if("function"===typeof define&&define.amd)define(["react"],n);else{var t=n("object"===typeof exports?require("react"):e.react);for(var r in t)("object"===typeof exports?exports:e)[r]=t[r]}}(this,function(e){return function(e){function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}var t={};return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=0)}([function(e,n,t){e.exports=t(1)},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t(2);n.default=r.a},function(e,n,t){"use strict";function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function a(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!==typeof n&&"function"!==typeof n?e:n}function o(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}var u=t(3),i=t.n(u),c=t(4),f=t.n(c),s=t(9),l=t.n(s),p=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),d=function(){},m=function(e){function n(){var e,t,o,u;r(this,n);for(var i=arguments.length,c=Array(i),f=0;f<i;f++)c[f]=arguments[f];return t=o=a(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(c))),o.state={animatedValue:0},o.componentDidMount=function(){o.animateValue()},o.componentDidUpdate=function(e){e.value!==o.props.value&&o.animateValue()},o.target={animatedValue:0},o.updateValue=function(e){o.props.update(e);var n=o.target.animatedValue;o.setState({animatedValue:n})},o.animateValue=function(){var e=o.props,n=e.duration,t=e.begin,r=e.easing,a=e.complete,u=e.run,i=e.delay,c=e.value;l()({targets:o.target,animatedValue:c,duration:n,update:o.updateValue,easing:r,begin:t,complete:a,run:u,delay:i})},u=t,a(o,u)}return o(n,e),p(n,[{key:"render",value:function(){return i.a.createElement("span",{className:this.props.className},this.props.formatValue(Number(this.state.animatedValue)))}}]),n}(u.Component);m.propTypes={value:f.a.oneOfType([f.a.number,f.a.string]).isRequired,duration:f.a.number,delay:f.a.number,formatValue:f.a.func,begin:f.a.func,complete:f.a.func,run:f.a.func,update:f.a.func,easing:f.a.string,className:f.a.string},m.defaultProps={duration:1e3,formatValue:function(e){return e},easing:"linear",run:d,complete:d,update:d,begin:d,delay:0,className:null},n.a=m},function(n,t){n.exports=e},function(e,n,t){e.exports=t(5)()},function(e,n,t){"use strict";var r=t(6),a=t(7),o=t(8);e.exports=function(){function e(e,n,t,r,u,i){i!==o&&a(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function n(){return e}e.isRequired=e;var t={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:n,element:e,instanceOf:n,node:e,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n};return t.checkPropTypes=r,t.PropTypes=t,t}},function(e,n,t){"use strict";function r(e){return function(){return e}}var a=function(){};a.thatReturns=r,a.thatReturnsFalse=r(!1),a.thatReturnsTrue=r(!0),a.thatReturnsNull=r(null),a.thatReturnsThis=function(){return this},a.thatReturnsArgument=function(e){return e},e.exports=a},function(e,n,t){"use strict";function r(e,n,t,r,o,u,i,c){if(a(n),!e){var f;if(void 0===n)f=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[t,r,o,u,i,c],l=0;f=new Error(n.replace(/%s/g,function(){return s[l++]})),f.name="Invariant Violation"}throw f.framesToPop=1,f}}var a=function(e){};e.exports=r},function(e,n,t){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,n){var t=this;!function(n,r){e.exports=function(){function e(e,n){for(var t=e.length,r=arguments.length>=2?arguments[1]:void 0,a=[],o=0;o<t;o+=1)if(o in e){var u=e[o];n.call(r,u,o,e)&&a.push(u)}return a}function n(e){return e.reduce(function(e,t){return e.concat(T.arr(t)?n(t):t)},[])}function r(e){return[e]}function a(e){var n={};for(var t in e)n[t]=e[t];return n}function o(e,n){var t=a(e);for(var r in e)t[r]=n.hasOwnProperty(r)?n[r]:e[r];return t}function u(e,n){var t=a(e);for(var r in n)t[r]=T.und(e[r])?n[r]:e[r];return t}function i(e,n,t){return Math.min(Math.max(e,n),t)}function c(e,n){return T.fnc(e)?e(n.target,n.id,n.total):e}function f(e,n){if(null!=e[n])return"object"}function s(e,n){return e[n]||0}function l(e){var n=/-?\d*\.?\d+/g,t=""+e;return{original:t,numbers:t.match(n)?t.match(n).map(Number):[0],strings:[]}}function p(e){var n=r(e);return n.map(function(e,t){return{target:e,id:t,total:n.length}})}function d(e,n){var t=a(n);return r(e).map(function(e,t){var r=t?0:n.delay,a={value:e};return T.und(a.delay)&&(a.delay=r),a}).map(function(e){return u(e,t)})}function m(e,n,t){var r=[],a=u(e,n);return Object.keys(t).forEach(function(e){a.hasOwnProperty(e)||"targets"===e||r.push({name:e,offset:a.offset,tweens:d(t[e],n)})}),r}function v(e,n){var t={};return Object.keys(e).forEach(function(r){var a=c(e[r],n);T.arr(a)&&(a=a.map(function(e){return c(e,n)}),1===a.length&&(a=a[0])),t[r]=a}),t.duration=parseFloat(t.duration),t.delay=parseFloat(t.delay),t}function y(e,n){var t=void 0;return e.tweens.map(function(r){var a=v(r,n),o=a.value,u=n.target[e.name],c=t?t.to.original:u,f=T.arr(o)?o[0]:c,s=o;return a.from=l(f),a.to=l(s),a.start=t?t.end:e.offset,a.end=a.start+a.delay+a.duration,a.easing=j[a.easing],a.elasticity=(1e3-i(a.elasticity,1,999))/1e3,a.isColor&&(a.round=1),t=a,a})}function h(e,n){var t=f(e.target,n.name);if(t){var r=y(n,e);return{type:t,property:n.name,animatable:e,tweens:r,duration:r[r.length-1].end,delay:r[0].delay}}}function g(t,r){return e(n(t.map(function(e){return r.map(function(n){return h(e,n)})})),function(e){return!T.und(e)})}function b(e,n,t,r){var a="delay"===e;return n.length?(a?Math.min:Math.max).apply(Math,n.map(function(n){return n[e]})):a?r.delay:t.offset+r.delay+r.duration}function O(e){var n=o(x,e),t=o(P,e),r=p(e.targets),a=m(n,t,e),i=g(r,a);return u(n,{children:[],animatables:r,animations:i,duration:b("duration",i,n,t),delay:b("delay",i,n,t)})}function w(){function n(){return window.Promise&&new Promise(function(e){return m=e})}function t(){y.reversed=!y.reversed}function r(e){return y.reversed?y.duration-e:e}function a(e){var n=y.children,t=n.length;if(e>=y.currentTime)for(var r=0;r<t;r+=1)n[r].seek(e);else for(var a=t;a--;)n[a].seek(e)}function o(n){for(var t=0,r={},a=y.animations,o=a.length;t<o;){var u=a[t],c=u.animatable,f=u.tweens,s=f.length-1,l=f[s];s&&(l=e(f,function(e){return n<e.end})[0]||l);for(var p=i(n-l.start-l.delay,0,l.duration)/l.duration,d=isNaN(p)?1:l.easing(p,l.elasticity),m=[],v=void 0,h=l.to.numbers.length,g=0;g<h;g+=1){var b=void 0,O=l.to.numbers[g],w=l.from.numbers[g];b=w+d*(O-w),m.push(b)}v=m[0],E[u.type](c.target,u.property,v,r,c.id),u.currentValue=v,t+=1}y.currentTime=n,y.progress=n/y.duration*100}function u(e){y[e]&&y[e](y)}function c(){y.remaining&&!0!==y.remaining&&(y.remaining-=1)}function f(e){var i=y.duration,f=y.offset,s=f+y.delay,h=y.currentTime,g=y.reversed,b=r(e);y.children.length&&a(b),(b>=s||!i)&&(y.began||(y.began=!0,u("begin")),u("run")),b>f&&b<i?o(b):(b<=f&&0!==h&&(o(0),g&&c()),(b>=i&&h!==i||!i)&&(o(i),g||c())),u("update"),e>=i&&(y.remaining?(p=l,"alternate"===y.direction&&t()):(y.pause(),y.completed||(y.completed=!0,u("complete"),"Promise"in window&&(m(),v=n()))),d=0)}var s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=void 0,p=void 0,d=0,m=null,v=n(),y=O(s);return y.reset=function(){var e=y.direction,n=y.loop;y.currentTime=0,y.progress=0,y.paused=!0,y.began=!1,y.completed=!1,y.reversed="reverse"===e,y.remaining="alternate"===e&&1===n?2:n,o(0);for(var t=y.children.length;t--;)y.children[t].reset()},y.tick=function(e){l=e,p||(p=l),f((d+l-p)*w.speed)},y.seek=function(e){f(r(e))},y.pause=function(){var e=V.indexOf(y);e>-1&&V.splice(e,1),y.paused=!0},y.play=function(){y.paused&&(y.paused=!1,p=0,d=r(y.currentTime),V.push(y),k||M())},y.reverse=function(){t(),p=0,d=r(y.currentTime)},y.restart=function(){y.pause(),y.reset(),y.play()},y.finished=v,y.reset(),y.autoplay&&y.play(),y}var x={update:void 0,begin:void 0,run:void 0,complete:void 0,loop:1,direction:"normal",autoplay:!0,offset:0},P={duration:1e3,delay:0,easing:"easeOutElastic",elasticity:500,round:0},T={arr:function(e){return Array.isArray(e)},fnc:function(e){return"function"===typeof e},und:function(e){return"undefined"===typeof e}},_=function(){function e(e,n){return 1-3*n+3*e}function n(e,n){return 3*n-6*e}function t(e){return 3*e}function r(r,a,o){return((e(a,o)*r+n(a,o))*r+t(a))*r}function a(e,n,t,a){if(e>=0&&e<=1&&t>=0&&t<=1){var i=new Float32Array(o);if(e!==n||t!==a)for(var c=0;c<o;c+=1)i[c]=r(c*u,e,t);return function(r){return e===n&&t===a?r:0===r?0:1===r?1:void 0}}}var o=11,u=1/(o-1);return a}(),j=function(){function e(e,n){return 0===e||1===e?e:-Math.pow(2,10*(e-1))*Math.sin((e-1-n/(2*Math.PI)*Math.asin(1))*(2*Math.PI)/n)}var n=["Quad","Cubic","Quart","Quint","Sine","Expo","Circ","Back","Elastic"],r={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],e],Out:[[.25,.46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],function(n,t){return 1-e(1-n,t)}],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],function(n,t){return n<.5?e(2*n,t)/2:1-e(-2*n+2,t)/2}]},a={linear:_(.25,.25,.75,.75)};return Object.keys(r).forEach(function(e){r[e].forEach(function(r,o){a["ease"+e+n[o]]=T.fnc(r)?r:_.apply(t,r)})}),a}(),E={css:function(e,n,t){return e.style[n]=t},attribute:function(e,n,t){return e.setAttribute(n,t)},object:function(e,n,t){return e[n]=t},transform:function(e,n,t,r,a){r[a]||(r[a]=[]),r[a].push(n+"("+t+")")}},V=[],k=0,M=function(){function e(){k=requestAnimationFrame(n)}function n(n){var t=V.length;if(t){for(var r=0;r<t;)V[r]&&V[r].tick(n),r+=1;e()}else cancelAnimationFrame(k),k=0}return e}();return w.speed=1,w.running=V,w.getValue=s,w.bezier=_,w.easings=j,w}()}()}])}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "animated-number-react", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Super easy way to animate numbers with React", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
Sorry, the diff of this file is not supported yet
97942