Socket
Socket
Sign inDemoInstall

react-view-pager

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-view-pager - npm Package Compare versions

Comparing version 0.5.0-prerelease.7 to 0.5.0-prerelease.8

3

CHANGELOG.md
## CHANGELOG
### 0.5.0-prerelease.8
Use `ResizeObserver.default` if available. Fixes [#48](https://github.com/souporserious/react-view-pager/issues/48)
### 0.5.0-prerelease.7

@@ -3,0 +6,0 @@ Only require `ResizeObserver` polyfill when `window` is available

6

dist/react-view-pager.min.js
/*!
* React View Pager 0.5.0-prerelease.7
* React View Pager 0.5.0-prerelease.8
* https://github.com/souporserious/react-view-pager
* Copyright (c) 2016 React View Pager Authors
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("get-prefix"),require("resize-observer-polyfill"),require("react-dom"),require("react-motion")):"function"==typeof define&&define.amd?define(["react","get-prefix","resize-observer-polyfill","react-dom","react-motion"],t):"object"==typeof exports?exports.ReactViewPager=t(require("react"),require("get-prefix"),require("resize-observer-polyfill"),require("react-dom"),require("react-motion")):e.ReactViewPager=t(e.React,e.getPrefix,e.ResizeObserver,e.ReactDOM,e.ReactMotion)}(this,function(e,t,n,i,r){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return e[i].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="dist/",t(0)}([function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.AnimatedView=t.View=t.Track=t.Frame=t.ViewPager=void 0;var r=n(1),o=i(r),s=n(12),a=i(s),u=n(18),c=i(u),p=n(19),f=i(p),l=n(21),h=i(l),y=n(9),d=i(y);t.ViewPager=o.default,t.Frame=a.default,t.Track=c.default,t.View=f.default,t.AnimatedView=h.default,t.utils=d.default},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),c=n(2),p=(i(c),n(3)),f=i(p),l=function(e){function t(e){o(this,t);var n=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),i=new f.default,r=function(){return n.forceUpdate()};return i.on("viewChange",r),i.on("hydrated",r),n._pager=i,n}return a(t,e),u(t,[{key:"getChildContext",value:function(){return{pager:this._pager}}},{key:"componentDidMount",value:function(){var e=this;requestAnimationFrame(function(){e._pager.hydrate()})}},{key:"getInstance",value:function(){return this._pager}},{key:"render",value:function(){var e=this.props,t=e.tag,n=r(e,["tag"]);return(0,c.createElement)(t,n)}}]),t}(c.Component);l.childContextTypes={pager:c.PropTypes.instanceOf(f.default)},l.propTypes={tag:c.PropTypes.string},l.defaultProps={tag:"div"},t.default=l,e.exports=t.default},function(t,n){t.exports=e},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},p=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),f=n(4),l=i(f),h=n(5),y=i(h),d=n(8),v=i(d),g=n(9),w=n(10)("transform"),b="undefined"!=typeof window;b&&!window.ResizeObserver&&(window.ResizeObserver=n(11));var m=function(e){function t(){return s(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,e),p(t,[{key:"getStyles",value:function(e){var t=this.pager.getPositionValue(e),n=t.x,i=t.y,r=this.pager.getTrackSize(),s=o({},w,"translate3d("+n+"px, "+i+"px, 0)");if(r){var a=this.pager.options,u=a.axis,c=a.viewsToShow,p="x"===u?"width":"height";s[p]="auto"===c?r:this.pager.views.length/c*100+"%"}return s}}]),t}(v.default),_=function(e){function t(e){var n=e.index,i=r(e,["index"]);s(this,t);var o=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,i));return o.index=n,o.isCurrent=!1,o.inBounds=!0,o.setTarget(),o.setOrigin(),o}return u(t,e),p(t,[{key:"setTarget",value:function(){var e=this.pager.options,t=e.align,n=(e.viewsToShow,this.pager.getStartCoords(this.index));t&&(n+=this.pager.getAlignOffset(this)),this.target=n}},{key:"setOrigin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pager.trackPosition;this.origin=this.target-e}},{key:"getStyles",value:function(){var e=this.pager.options,t=e.axis,n=e.viewsToShow,i=e.infinite,r={};return"x"===t&&(r.display="inline-block",r.verticalAlign="top"),"auto"!==n&&(r["x"===t?"width":"height"]=100/this.pager.views.length+"%"),i&&!this.inBounds&&(r.position="relative",r["y"===t?"top":"left"]=this.getPosition()),c({},r,this.pager.animationBus.getStyles(this))}}]),t}(v.default),x=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.hydrate=function(){n.frame.setSize(),n.track.setSize(),n.views.forEach(function(e){e.setSize(),e.setTarget()}),n.setPositionValue(),n.setViewStyles(),n.emit("hydrated")},n.options=c({viewsToShow:1,viewsToMove:1,align:0,contain:!1,axis:"x",autoSize:!1,animations:[],infinite:!1,instant:!1,swipe:!0,swipeThreshold:.5,flickTimeout:300,accessibility:!0},e),n.views=[],n.currentIndex=0,n.currentView=null,n.currentTween=0,n.trackPosition=0,n.isSwiping=!1,n.animationBus=new y.default({animations:n.options.animations,origin:function(e){return e.origin}}),b&&(n.resizeObserver=new ResizeObserver(function(){n.hydrate()})),n}return u(t,e),p(t,[{key:"setOptions",value:function(e){var t=this.options;this.options=c({},this.options,e),this.animationBus.animations=this.options.animations,t.viewsToShow!==this.options.viewsToShow&&this.emit("viewChange",this.getCurrentIndicies())}},{key:"addFrame",value:function(e){this.frame=new v.default({node:e,pager:this})}},{key:"addTrack",value:function(e){this.track=new m({node:e,pager:this})}},{key:"addView",value:function(e){var t=this.views.length,n=new _({node:e,index:t,pager:this});return this.views.push(n),this.currentView||this.setCurrentView({index:t,suppressEvent:!0}),b&&this.resizeObserver.observe(e),this.emit("viewAdded"),n}},{key:"removeView",value:function(e){this.views=this.views.filter(function(t){return e!==t}),b&&this.resizeObserver.disconnect(e.node),this.emit("viewRemoved")}},{key:"prev",value:function(){this.setCurrentView({direction:-1})}},{key:"next",value:function(){this.setCurrentView({direction:1})}},{key:"setCurrentView",value:function(e){var t=e.direction,n=void 0===t?0:t,i=e.index,r=void 0===i?this.currentIndex:i,o=e.suppressEvent,s=void 0!==o&&o,a=this.options,u=a.viewsToMove,c=a.infinite,p=r+n*u,f=this.currentIndex,l=c?p:(0,g.clamp)(p,0,this.views.length-1),h=this.getView(f),y=this.getView(l);this.currentIndex=l,this.currentView=y,h.isCurrent=!1,y.isCurrent=!0,this.setPositionValue(),s||this.emit("viewChange",this.getCurrentIndicies())}},{key:"setPositionValue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentView?this.currentView.target:0;if(!this.isSwiping){var t=this.options,n=t.viewsToShow,i=t.autoSize,r=t.infinite,o=t.contain,s=this.getTrackSize();if(r&&(e-=(Math.floor(this.currentIndex/this.views.length)||0)*s),o){var a="auto"===n&&i||n<=1?0:this.getFrameSize({autoSize:!1});e=(0,g.clamp)(e,a-s,0)}}this.trackPosition=e}},{key:"setViewStyles",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.options,n=t.infinite,i=t.align,r=(this.getFrameSize(),this.getTrackSize()),o=(0,g.modulo)(e,-r);this.views.reduce(function(t,s,a){var u=s.getSize(),c=t+u,p=t;return c+u*i<Math.abs(o)?(n&&(p+=r-t),s.inBounds=!1):s.inBounds=!0,s.setPosition(p),s.setOrigin(e),c},0)}},{key:"getNumericViewsToShow",value:function(){return isNaN(this.options.viewsToShow)?1:this.options.viewsToShow}},{key:"getMaxDimensions",value:function(e){var t=this,n=this.options.axis,i=[],r=[];return e.forEach(function(e){var n=isNaN(e)?e:t.getView(e);i.push(n.getSize("width")),r.push(n.getSize("height"))}),{width:"x"===n?(0,g.sum)(i):(0,g.max)(i),height:"y"===n?(0,g.sum)(r):(0,g.max)(r)}}},{key:"getCurrentIndicies",value:function(){var e=this.options,t=e.infinite,n=e.contain,i=[],r=isNaN(this.options.viewsToShow)?1:this.options.viewsToShow,o=this.currentIndex,s=this.currentIndex+(r-1);if(n){o=(0,g.clamp)(o,0,this.views.length-r),s=(0,g.clamp)(s,0,this.views.length-1);for(var a=o;a<=s;a++)i.push(a)}else for(var u=o;u<=s;u++)i.push(t?(0,g.modulo)(u,this.views.length):(0,g.clamp)(u,0,this.views.length-1));return i}},{key:"getFrameSize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.autoSize,n=void 0===t?this.options.autoSize:t,i=e.fullSize,r=void 0!==i&&i,o={width:0,height:0};if(this.views.length)if(n){var s=this.getCurrentIndicies();o=this.getMaxDimensions(s)}else this.frame&&(o={width:this.frame.getSize("width"),height:this.frame.getSize("height")});return r?o:o["x"===this.options.axis?"width":"height"]}},{key:"getTrackSize",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?this.views.length:this.views.length-1,n=0;return this.views.slice(0,t).forEach(function(e){n+=e.getSize()}),n}},{key:"getView",value:function(e){return this.views[(0,g.modulo)(e,this.views.length)]}},{key:"getStartCoords",value:function(e){var t=0;return this.views.slice(0,e).forEach(function(e){t-=e.getSize()}),t}},{key:"getAlignOffset",value:function(e){var t=this.getFrameSize({autoSize:!1}),n=e.getSize();return(t-n)*this.options.align}},{key:"getPositionValue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.trackPosition,t=this.options,n=t.infinite,i=(t.contain,{x:0,y:0});if(this.currentTween=e,n){var r=this.getTrackSize();e=(0,g.modulo)(e,-r)||0}return this.emit("scroll",{progress:e/this.getTrackSize(!1),position:e}),i[this.options.axis]=e,i}},{key:"resetViewIndex",value:function(){this.setCurrentView({index:(0,g.modulo)(this.currentIndex,this.views.length),suppressEvent:!0})}}]),t}(l.default);t.default=x,e.exports=t.default},function(e,t){"use strict";e.exports=function(e){var t={},n=[];e=e||this,e.on=function(e,n,i){(t[e]=t[e]||[]).push([n,i])},e.off=function(e,i){e||(t={});for(var r=t[e]||n,o=r.length=i?r.length:0;o--;)i==r[o][0]&&r.splice(o,1)},e.emit=function(e){for(var i,r=t[e]||n,o=r.length>0?r.slice(0,r.length):r,s=0;i=o[s++];)i[0].apply(i[1],n.slice.call(arguments,1))}}},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=n(6),a=i(s),u={perspective:"px",rotate:"deg",rotateX:"deg",rotateY:"deg",rotateZ:"deg",scale:"",scaleX:"",scaleY:"",scaleZ:"",skew:"deg",skewX:"deg",skewY:"deg",translateX:"px",translateY:"px",translateZ:"px"},c=Object.keys(u),p=function(){function e(t){var n=t.animations,i=t.element,o=t.origin;r(this,e),this.animations=n,this.element=i,this.origin=o}return o(e,[{key:"getStyles",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.element,t=this.origin(e),n=[],i={};return this.animations.forEach(function(e){var r=e.prop,o=e.unit||u[r]||"",s=(0,a.default)(e.stops)(t);c.indexOf(r)>-1?n.push(r+"("+s+o+")"):i[r]=""+s+o}),n.length&&(i.transform=n.join(" ")),i}},{key:"applyStyles",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.element,t=this.getStyles(e);Object.keys(t).forEach(function(n){return e.style[n]=t[n]})}}]),e}();t.default=p,e.exports=t.default},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){var t=[],n=[],i=[],r=[];e.forEach(function(e){var o=a(e,2),s=o[0],u=o[1];t.push(s),isNaN(u)?(n.push(parseInt(u.substr(1,2),16)),i.push(parseInt(u.substr(3,2),16)),r.push(parseInt(u.substr(5,2),16))):n.push(u)});var o=(0,c.default)(t,n);if(!i.length||!r.length)return function(e){return o(e)};var u=function(){var e=(0,c.default)(t,i),n=(0,c.default)(t,r);return{v:function(t){return"rgb("+Math.round(o(t))+", "+Math.round(e(t))+", "+Math.round(n(t))+")"}}}();return"object"===("undefined"==typeof u?"undefined":s(u))?u.v:void 0}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return"undefined"==typeof e?"undefined":o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":"undefined"==typeof e?"undefined":o(e)},a=function(){function e(e,t){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){r=!0,o=e}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.default=r;var u=n(7),c=i(u);e.exports=t.default},function(e,t){"use strict";function n(e,t){return function(n){if(n<=e[0])return t[0];if(n>=e[e.length-1])return t[e.length-1];for(var i=0,r=e.length-1;r-i>1;){var o=i+r>>1;n<e[o]?r=o:i=o}return t[i]+(t[r]-t[i])/(e[r]-e[i])*(n-e[i])}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=function(){function e(t){var i=t.node,r=t.pager,o=t.width,s=t.height;n(this,e),this.node=i,this.pager=r,this.x=this.y=0,this.setSize(o,s)}return i(e,[{key:"setSize",value:function(e,t){this.width=e||this.node.offsetWidth,this.height=t||this.node.offsetHeight}},{key:"setPosition",value:function(e){this[this.pager.options.axis]=e}},{key:"getSize",value:function(e){if("width"===e||"height"===e)return this[e];var t=this.pager.options.axis;return this["x"===t?"width":"height"]}},{key:"getPosition",value:function(){return this[this.pager.options.axis]}}]),e}();t.default=r,e.exports=t.default},function(e,t){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e,t){return(e%t+t)%t}function r(e,t,n){return Math.min(Math.max(t,e),n)}function o(e){return e.reduce(function(e,t){return e+t},0)}function s(e){return Math.max.apply(null,e)}function a(e,t,r){return[].concat(n(Array(t-e))).map(function(t,n){return i(e+n,r)})}Object.defineProperty(t,"__esModule",{value:!0}),t.modulo=i,t.clamp=r,t.sum=o,t.max=s,t.range=a},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),c=n(2),p=i(c),f=n(13),l=(i(f),n(14)),h=n(3),y=i(h),d=n(15),v=i(d),g=n(16),w=i(g),b=n(17),m=i(b),_={tag:c.PropTypes.any,autoSize:c.PropTypes.oneOf([!0,!1,"width","height"]),accessibility:c.PropTypes.bool,springConfig:c.PropTypes.objectOf(c.PropTypes.number)},x=function(e){function t(e){r(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._setFrameSize=function(){var e=n.context.pager.getFrameSize({fullSize:!0});e.width&&e.height&&n.setState(e,function(){n.state.instant&&n.setState({instant:!1})})},n.state={width:0,height:0,instant:!0},n._hydrate=!1,n}return s(t,e),u(t,[{key:"componentWillMount",value:function(){var e=this.context.pager;e.setOptions(this.props),this._swipe=new v.default(e),this._keyboard=new w.default(e)}},{key:"componentDidMount",value:function(){var e=this.context.pager;e.addFrame((0,f.findDOMNode)(this)),this._setFrameSize(),e.on("viewChange",this._setFrameSize),e.on("hydrated",this._setFrameSize)}},{key:"componentWillReceiveProps",value:function(e){this.props.autoSize===e.autoSize&&this.props.accessibility===e.accessibility||(this.context.pager.setOptions(e),this._hydrate=!0)}},{key:"componentDidUpdate",value:function(e){this._hydrate&&(this.context.pager.hydrate(),this._hydrate=!1)}},{key:"_getFrameStyle",value:function(){var e=this.props.springConfig,t=this.state,n=t.width,i=t.height,r=t.instant;return{maxWidth:r?n:(0,l.spring)(n,e),height:r?i:(0,l.spring)(i,e)}}},{key:"_renderFrame",value:function(e){var t=(this.context.pager,this.props),n=t.tag,i=t.accessibility,r=(0,m.default)(a({},this._swipe.getEvents(),this._keyboard.getEvents(),{tabIndex:i?0:null}),this.props,_);return(0,c.createElement)(n,a({},r,{style:a({},e,r.style)}))}},{key:"render",value:function(){var e=this,t=this.props.autoSize,n=(this.state.height,{position:"relative",overflow:"hidden"});return t?p.default.createElement(l.Motion,{style:this._getFrameStyle()},function(i){return t!==!0&&"width"!==t||!i.maxWidth||(n.maxWidth=i.maxWidth),t!==!0&&"height"!==t||!i.height||(n.height=i.height),e._renderFrame(n)}):this._renderFrame(n)}}]),t}(c.Component);x.contextTypes={pager:c.PropTypes.instanceOf(y.default)},x.propTypes=_,x.defaultProps={tag:"div",autoSize:!1,accessibility:!0,springConfig:l.presets.noWobble},t.default=x,e.exports=t.default},function(e,t){e.exports=i},function(e,t){e.exports=r},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){return e.touches&&e.touches[0]||e}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=function(){function e(t){var r=this;n(this,e),this._onSwipeStart=function(e){var t=i(e),n=t.pageX,o=t.pageY;r.pager.isSwiping=!0,r._swipeStart={x:n,y:o},r._swipeDiff={x:0,y:0},r._isFlick=!0,setTimeout(function(){r._isFlick=!1},r.pager.options.flickTimeout),r.pager.emit("swipeStart")},this._onSwipeMove=function(e){if(r.pager.isSwiping){var t=r.pager.options,n=t.swipeThreshold,o=t.axis,s=i(e),a=s.pageX,u=s.pageY;if(r._trackStart||(r._trackStart=r.pager.currentTween),r._swipeDiff={x:r._swipeStart.x-a,y:r._swipeStart.y-u},r._isSwipe(n)){e.preventDefault(),e.stopPropagation();var c=r._swipeDiff[o],p=r._trackStart-c;r.pager.setPositionValue(p),r.pager.emit("swipeMove")}}},this._onSwipeEnd=function(){var e=r.pager.options,t=e.swipeThreshold,n=e.viewsToMove,i=e.axis,o=(e.infinite,r._isFlick?t:r.pager.currentView.getSize()*n*t);r.pager.isSwiping=!1,r._trackStart=!1,(r._swipeDiff.x||r._swipeDiff.y)&&(r._isSwipe(o)?r._swipeDiff[i]<0?r.pager.prev():r.pager.next():r.pager.setPositionValue()),r.pager.emit("swipeEnd")},this._onSwipePast=function(){r.pager.isSwiping&&r._onSwipeEnd()},this.pager=t,this._trackStart=!1,this._swipeStart=this._swipeDiff={x:0,y:0}}return r(e,[{key:"_isSwipe",value:function(e){var t=this._swipeDiff,n=t.x,i=t.y;return"x"===this.pager.options.axis?Math.abs(n)>Math.max(e,Math.abs(i)):Math.abs(n)<Math.max(e,Math.abs(i))}},{key:"getEvents",value:function(){var e=this.pager.options.swipe,t={};return e!==!0&&"mouse"!==e||(t.onMouseDown=this._onSwipeStart,t.onMouseMove=this._onSwipeMove,t.onMouseUp=this._onSwipeEnd,t.onMouseLeave=this._onSwipePast),e!==!0&&"touch"!==e||(t.onTouchStart=this._onSwipeStart,t.onTouchMove=this._onSwipeMove,t.onTouchEnd=this._onSwipeEnd),t}}]),e}();t.default=o,e.exports=t.default},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(9),s=function(){function e(t){var n=this;i(this,e),this._handleKeyDown=function(e){switch(e.key){case"ArrowUp":case"ArrowLeft":return void n.pager.prev();case"ArrowDown":case"ArrowRight":case" ":return void n.pager.next();case"Home":return void n.pager.setCurrentView({index:0});case"End":return void n.pager.setCurrentView({index:n.pager.views.length-1})}for(var t=(0,o.clamp)(n.pager.views.length,0,9),i=1;i<=t;i++)+e.key===i&&n.pager.setCurrentView({index:i-1})},this.pager=t}return r(e,[{key:"getEvents",value:function(){var e={};return this.pager.options.accessibility&&(e.onKeyDown=this._handleKeyDown),e}}]),e}();t.default=s,e.exports=t.default},function(e,t){"use strict";function n(e,t,n){for(var i in t)t.hasOwnProperty(i)&&!n[i]&&(e[i]=t[i]);return e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},p=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),f=n(2),l=i(f),h=n(13),y=(i(h),n(14)),d=n(3),v=i(d),g=n(19),w=(i(g),n(20)),b=i(w),m=n(17),_=i(m),x=function(e){function t(){var e,n,i,r;o(this,t);for(var a=arguments.length,u=Array(a),c=0;c<a;c++)u[c]=arguments[c];return n=i=s(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),i.state={x:0,y:0},r=n,s(i,r)}return a(t,e),p(t,[{key:"componentWillReceiveProps",value:function(e){var t=this,n=e.trackPosition,i=this.context.pager;i.setViewStyles(n),this.props.trackPosition!==n&&requestAnimationFrame(function(){return t.props.onScroll(n/i.getTrackSize(!1)*-1,n)})}},{key:"_renderViews",value:function(){return f.Children.map(this.props.children,function(e){return e})}},{key:"render",value:function(){var e=this.context.pager,t=this.props,n=t.tag,i=t.trackPosition,o=(t.children,r(t,["tag","trackPosition","children"])),s=c({},o.style);return e.track&&(s=c({},s,e.track.getStyles(i))),(0,f.createElement)(n,c({},o,{style:s}),this._renderViews())}}]),t}(f.Component);x.propTypes=O,x.contextTypes={pager:f.PropTypes.instanceOf(v.default)};var S=function(){return null},O={tag:f.PropTypes.any,currentView:f.PropTypes.any,viewsToShow:f.PropTypes.oneOfType([f.PropTypes.number,f.PropTypes.oneOf(["auto"])]),viewsToMove:f.PropTypes.number,align:f.PropTypes.number,contain:f.PropTypes.bool,axis:f.PropTypes.oneOf(["x","y"]),animations:f.PropTypes.array,infinite:f.PropTypes.bool,instant:f.PropTypes.bool,swipe:f.PropTypes.oneOf([!0,!1,"mouse","touch"]),swipeThreshold:f.PropTypes.number,flickTimeout:f.PropTypes.number,springConfig:f.PropTypes.objectOf(f.PropTypes.number),onSwipeStart:f.PropTypes.func,onSwipeMove:f.PropTypes.func,onSwipeEnd:f.PropTypes.func,onScroll:f.PropTypes.func,onViewChange:f.PropTypes.func,onRest:f.PropTypes.func},P=function(e,t){return e.viewsToShow!==t.viewsToShow||e.viewsToMove!==t.viewsToMove||e.align!==t.align||e.axis!==t.axis||e.animations!==t.animations||e.infinite!==t.infinite||e.swipe!==t.swipe||e.swipeThreshold!==t.swipeThreshold||e.flickTimeout!==t.flickTimeout},T=function(e){function t(){var e,n,i,r;o(this,t);for(var a=arguments.length,u=Array(a),c=0;c<a;c++)u[c]=arguments[c];return n=i=s(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),i.state={instant:!1},i._currentTween=0,i._hydrate=!1,i._handleOnRest=function(){i.props.infinite&&!i.state.instant&&(i.context.pager.resetViewIndex(),i._setValueInstantly(!0,!0)),i.props.onRest()},r=n,s(i,r)}return a(t,e),p(t,[{key:"componentWillMount",value:function(){this.context.pager.setOptions(this.props)}},{key:"componentDidMount",value:function(){var e=this,t=this.context.pager;t.addTrack((0,h.findDOMNode)(this)),this.scrollTo((0,b.default)(this.props.currentView,this.props.children)),t.on("hydrated",function(){return e._setValueInstantly(!0,!0)}),t.on("swipeMove",function(){return e._setValueInstantly(!0)}),t.on("swipeEnd",function(){return e._setValueInstantly(!1)}),t.on("swipeStart",this.props.onSwipeStart),t.on("swipeMove",this.props.onSwipeMove),t.on("swipeEnd",this.props.onSwipeEnd),t.on("viewChange",this.props.onViewChange)}},{key:"componentWillReceiveProps",value:function(e){var t=e.currentView,n=e.instant,i=e.children;this.props.instant!==n&&this._setValueInstantly(n),void 0!==("undefined"==typeof t?"undefined":u(t))&&this.props.currentView!==t&&this.scrollTo((0,b.default)(t,i)),P(this.props,e)&&(this.context.pager.setOptions(e),this._hydrate=!0)}},{key:"componentDidUpdate",value:function(e){this._hydrate&&(this.context.pager.hydrate(),this._hydrate=!1)}},{key:"prev",value:function(){this.context.pager.prev()}},{key:"next",value:function(){this.context.pager.next()}},{key:"scrollTo",value:function(e){this.context.pager.setCurrentView({index:e})}},{key:"_setValueInstantly",value:function(e,t){var n=this;this.setState({instant:e},function(){t&&n.setState({instant:!1})})}},{key:"_getTrackStyle",value:function(){var e=this.context.pager.trackPosition;return this.state.instant||(e=(0,y.spring)(e,this.props.springConfig)),{trackPosition:e}}},{key:"render",value:function(){var e=this.props,t=e.tag,n=e.onScroll,i=r(e,["tag","onScroll"]);return l.default.createElement(y.Motion,{style:this._getTrackStyle(),onRest:this._handleOnRest},function(e){var r=e.trackPosition;return(0,f.createElement)(x,(0,_.default)({trackPosition:r,tag:t,onScroll:n},i,O))})}}]),t}(f.Component);T.propTypes=O,T.defaultProps={tag:"div",currentView:0,viewsToShow:1,viewsToMove:1,align:0,contain:!1,axis:"x",infinite:!1,instant:!1,swipe:!0,swipeThreshold:.5,flickTimeout:300,springConfig:y.presets.noWobble,onSwipeStart:S,onSwipeMove:S,onSwipeEnd:S,onScroll:S,onViewChange:S,onRest:S},T.contextTypes={pager:f.PropTypes.instanceOf(v.default)},t.default=T,e.exports=t.default},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),p=n(2),f=(i(p),n(13)),l=(i(f),n(3)),h=i(l),y=function(e){function t(){var e,n,i,r;o(this,t);for(var a=arguments.length,u=Array(a),c=0;c<a;c++)u[c]=arguments[c];return n=i=s(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),i._viewAdded=!1,i._viewInstance=null,r=n,s(i,r)}return a(t,e),c(t,[{key:"getChildContext",value:function(){return{view:this._viewInstance}}},{key:"componentDidMount",value:function(){this._viewInstance=this.context.pager.addView((0,f.findDOMNode)(this)),this._viewAdded=!0,this.forceUpdate()}},{key:"componentWillUnmount",value:function(){this.context.pager.removeView(this._viewInstance)}},{key:"render",value:function(){var e=this.context.pager,t=e.options,n=(t.viewsToShow,t.axis,this.props),i=n.tag,o=(n.trackSize,r(n,["tag","trackSize"])),s=u({},o.style);return this._viewAdded||(s.visibility="hidden",s.pointerEvents="none"),this._viewInstance&&(s=u({},s,this._viewInstance.getStyles())),(0,p.createElement)(i,u({},o,{style:s}))}}]),t}(p.Component);y.contextTypes={
pager:p.PropTypes.instanceOf(h.default)},y.childContextTypes={view:p.PropTypes.any},y.propTypes={tag:p.PropTypes.any},y.defaultProps={tag:"div"},t.default=y,e.exports=t.default},function(e,t,n){"use strict";function i(e,t){var n=null;return r.Children.forEach(t,function(t,i){if(t.key===e||i===e)return void(n=i)}),n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var r=n(2);e.exports=t.default},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),p=n(2),f=(i(p),n(5)),l=i(f),h=n(3),y=i(h),d=n(17),v=i(d),g={tag:p.PropTypes.string,index:p.PropTypes.number,animations:p.PropTypes.array},w=function(e){function t(){return o(this,t),s(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),c(t,[{key:"componentWillMount",value:function(){var e=this.props.animations;e.length&&(this._animationBus=new l.default({animations:e,origin:function(e){return e.origin}}))}},{key:"render",value:function(){var e=this.props,t=e.tag,n=e.index,i=r(e,["tag","index"]),o=u({},i.style);if(this._animationBus){var s=this.context.view||this.context.pager.getView(n);s&&(o=u({},i.style,this._animationBus.getStyles(s)))}return(0,p.createElement)(t,(0,v.default)({style:o},this.props,g))}}]),t}(p.Component);w.contextTypes={pager:p.PropTypes.instanceOf(y.default),view:p.PropTypes.any},w.propTypes=g,w.defaultProps={tag:"div",animations:[]},t.default=w,e.exports=t.default}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("get-prefix"),require("resize-observer-polyfill"),require("react-dom"),require("react-motion")):"function"==typeof define&&define.amd?define(["react","get-prefix","resize-observer-polyfill","react-dom","react-motion"],t):"object"==typeof exports?exports.ReactViewPager=t(require("react"),require("get-prefix"),require("resize-observer-polyfill"),require("react-dom"),require("react-motion")):e.ReactViewPager=t(e.React,e.getPrefix,e.ResizeObserver,e.ReactDOM,e.ReactMotion)}(this,function(e,t,n,i,r){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return e[i].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="dist/",t(0)}([function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.AnimatedView=t.View=t.Track=t.Frame=t.ViewPager=void 0;var r=n(1),o=i(r),s=n(12),a=i(s),u=n(18),c=i(u),p=n(19),f=i(p),l=n(21),h=i(l),y=n(9),d=i(y);t.ViewPager=o.default,t.Frame=a.default,t.Track=c.default,t.View=f.default,t.AnimatedView=h.default,t.utils=d.default},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),c=n(2),p=(i(c),n(3)),f=i(p),l=function(e){function t(e){o(this,t);var n=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),i=new f.default,r=function(){return n.forceUpdate()};return i.on("viewChange",r),i.on("hydrated",r),n._pager=i,n}return a(t,e),u(t,[{key:"getChildContext",value:function(){return{pager:this._pager}}},{key:"componentDidMount",value:function(){var e=this;requestAnimationFrame(function(){e._pager.hydrate()})}},{key:"getInstance",value:function(){return this._pager}},{key:"render",value:function(){var e=this.props,t=e.tag,n=r(e,["tag"]);return(0,c.createElement)(t,n)}}]),t}(c.Component);l.childContextTypes={pager:c.PropTypes.instanceOf(f.default)},l.propTypes={tag:c.PropTypes.string},l.defaultProps={tag:"div"},t.default=l,e.exports=t.default},function(t,n){t.exports=e},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},p=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),f=n(4),l=i(f),h=n(5),y=i(h),d=n(8),v=i(d),g=n(9),w=n(10)("transform"),b="undefined"!=typeof window;if(b&&!window.ResizeObserver){var m=n(11);window.ResizeObserver=m.default||m}var _=function(e){function t(){return s(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,e),p(t,[{key:"getStyles",value:function(e){var t=this.pager.getPositionValue(e),n=t.x,i=t.y,r=this.pager.getTrackSize(),s=o({},w,"translate3d("+n+"px, "+i+"px, 0)");if(r){var a=this.pager.options,u=a.axis,c=a.viewsToShow,p="x"===u?"width":"height";s[p]="auto"===c?r:this.pager.views.length/c*100+"%"}return s}}]),t}(v.default),x=function(e){function t(e){var n=e.index,i=r(e,["index"]);s(this,t);var o=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,i));return o.index=n,o.isCurrent=!1,o.inBounds=!0,o.setTarget(),o.setOrigin(),o}return u(t,e),p(t,[{key:"setTarget",value:function(){var e=this.pager.options,t=e.align,n=(e.viewsToShow,this.pager.getStartCoords(this.index));t&&(n+=this.pager.getAlignOffset(this)),this.target=n}},{key:"setOrigin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pager.trackPosition;this.origin=this.target-e}},{key:"getStyles",value:function(){var e=this.pager.options,t=e.axis,n=e.viewsToShow,i=e.infinite,r={};return"x"===t&&(r.display="inline-block",r.verticalAlign="top"),"auto"!==n&&(r["x"===t?"width":"height"]=100/this.pager.views.length+"%"),i&&!this.inBounds&&(r.position="relative",r["y"===t?"top":"left"]=this.getPosition()),c({},r,this.pager.animationBus.getStyles(this))}}]),t}(v.default),S=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.hydrate=function(){n.frame.setSize(),n.track.setSize(),n.views.forEach(function(e){e.setSize(),e.setTarget()}),n.setPositionValue(),n.setViewStyles(),n.emit("hydrated")},n.options=c({viewsToShow:1,viewsToMove:1,align:0,contain:!1,axis:"x",autoSize:!1,animations:[],infinite:!1,instant:!1,swipe:!0,swipeThreshold:.5,flickTimeout:300,accessibility:!0},e),n.views=[],n.currentIndex=0,n.currentView=null,n.currentTween=0,n.trackPosition=0,n.isSwiping=!1,n.animationBus=new y.default({animations:n.options.animations,origin:function(e){return e.origin}}),b&&(n.resizeObserver=new ResizeObserver(function(){n.hydrate()})),n}return u(t,e),p(t,[{key:"setOptions",value:function(e){var t=this.options;this.options=c({},this.options,e),this.animationBus.animations=this.options.animations,t.viewsToShow!==this.options.viewsToShow&&this.emit("viewChange",this.getCurrentIndicies())}},{key:"addFrame",value:function(e){this.frame=new v.default({node:e,pager:this})}},{key:"addTrack",value:function(e){this.track=new _({node:e,pager:this})}},{key:"addView",value:function(e){var t=this.views.length,n=new x({node:e,index:t,pager:this});return this.views.push(n),this.currentView||this.setCurrentView({index:t,suppressEvent:!0}),b&&this.resizeObserver.observe(e),this.emit("viewAdded"),n}},{key:"removeView",value:function(e){this.views=this.views.filter(function(t){return e!==t}),b&&this.resizeObserver.disconnect(e.node),this.emit("viewRemoved")}},{key:"prev",value:function(){this.setCurrentView({direction:-1})}},{key:"next",value:function(){this.setCurrentView({direction:1})}},{key:"setCurrentView",value:function(e){var t=e.direction,n=void 0===t?0:t,i=e.index,r=void 0===i?this.currentIndex:i,o=e.suppressEvent,s=void 0!==o&&o,a=this.options,u=a.viewsToMove,c=a.infinite,p=r+n*u,f=this.currentIndex,l=c?p:(0,g.clamp)(p,0,this.views.length-1),h=this.getView(f),y=this.getView(l);this.currentIndex=l,this.currentView=y,h.isCurrent=!1,y.isCurrent=!0,this.setPositionValue(),s||this.emit("viewChange",this.getCurrentIndicies())}},{key:"setPositionValue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentView?this.currentView.target:0;if(!this.isSwiping){var t=this.options,n=t.viewsToShow,i=t.autoSize,r=t.infinite,o=t.contain,s=this.getTrackSize();if(r&&(e-=(Math.floor(this.currentIndex/this.views.length)||0)*s),o){var a="auto"===n&&i||n<=1?0:this.getFrameSize({autoSize:!1});e=(0,g.clamp)(e,a-s,0)}}this.trackPosition=e}},{key:"setViewStyles",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.options,n=t.infinite,i=t.align,r=(this.getFrameSize(),this.getTrackSize()),o=(0,g.modulo)(e,-r);this.views.reduce(function(t,s,a){var u=s.getSize(),c=t+u,p=t;return c+u*i<Math.abs(o)?(n&&(p+=r-t),s.inBounds=!1):s.inBounds=!0,s.setPosition(p),s.setOrigin(e),c},0)}},{key:"getNumericViewsToShow",value:function(){return isNaN(this.options.viewsToShow)?1:this.options.viewsToShow}},{key:"getMaxDimensions",value:function(e){var t=this,n=this.options.axis,i=[],r=[];return e.forEach(function(e){var n=isNaN(e)?e:t.getView(e);i.push(n.getSize("width")),r.push(n.getSize("height"))}),{width:"x"===n?(0,g.sum)(i):(0,g.max)(i),height:"y"===n?(0,g.sum)(r):(0,g.max)(r)}}},{key:"getCurrentIndicies",value:function(){var e=this.options,t=e.infinite,n=e.contain,i=[],r=isNaN(this.options.viewsToShow)?1:this.options.viewsToShow,o=this.currentIndex,s=this.currentIndex+(r-1);if(n){o=(0,g.clamp)(o,0,this.views.length-r),s=(0,g.clamp)(s,0,this.views.length-1);for(var a=o;a<=s;a++)i.push(a)}else for(var u=o;u<=s;u++)i.push(t?(0,g.modulo)(u,this.views.length):(0,g.clamp)(u,0,this.views.length-1));return i}},{key:"getFrameSize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.autoSize,n=void 0===t?this.options.autoSize:t,i=e.fullSize,r=void 0!==i&&i,o={width:0,height:0};if(this.views.length)if(n){var s=this.getCurrentIndicies();o=this.getMaxDimensions(s)}else this.frame&&(o={width:this.frame.getSize("width"),height:this.frame.getSize("height")});return r?o:o["x"===this.options.axis?"width":"height"]}},{key:"getTrackSize",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?this.views.length:this.views.length-1,n=0;return this.views.slice(0,t).forEach(function(e){n+=e.getSize()}),n}},{key:"getView",value:function(e){return this.views[(0,g.modulo)(e,this.views.length)]}},{key:"getStartCoords",value:function(e){var t=0;return this.views.slice(0,e).forEach(function(e){t-=e.getSize()}),t}},{key:"getAlignOffset",value:function(e){var t=this.getFrameSize({autoSize:!1}),n=e.getSize();return(t-n)*this.options.align}},{key:"getPositionValue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.trackPosition,t=this.options,n=t.infinite,i=(t.contain,{x:0,y:0});if(this.currentTween=e,n){var r=this.getTrackSize();e=(0,g.modulo)(e,-r)||0}return this.emit("scroll",{progress:e/this.getTrackSize(!1),position:e}),i[this.options.axis]=e,i}},{key:"resetViewIndex",value:function(){this.setCurrentView({index:(0,g.modulo)(this.currentIndex,this.views.length),suppressEvent:!0})}}]),t}(l.default);t.default=S,e.exports=t.default},function(e,t){"use strict";e.exports=function(e){var t={},n=[];e=e||this,e.on=function(e,n,i){(t[e]=t[e]||[]).push([n,i])},e.off=function(e,i){e||(t={});for(var r=t[e]||n,o=r.length=i?r.length:0;o--;)i==r[o][0]&&r.splice(o,1)},e.emit=function(e){for(var i,r=t[e]||n,o=r.length>0?r.slice(0,r.length):r,s=0;i=o[s++];)i[0].apply(i[1],n.slice.call(arguments,1))}}},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=n(6),a=i(s),u={perspective:"px",rotate:"deg",rotateX:"deg",rotateY:"deg",rotateZ:"deg",scale:"",scaleX:"",scaleY:"",scaleZ:"",skew:"deg",skewX:"deg",skewY:"deg",translateX:"px",translateY:"px",translateZ:"px"},c=Object.keys(u),p=function(){function e(t){var n=t.animations,i=t.element,o=t.origin;r(this,e),this.animations=n,this.element=i,this.origin=o}return o(e,[{key:"getStyles",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.element,t=this.origin(e),n=[],i={};return this.animations.forEach(function(e){var r=e.prop,o=e.unit||u[r]||"",s=(0,a.default)(e.stops)(t);c.indexOf(r)>-1?n.push(r+"("+s+o+")"):i[r]=""+s+o}),n.length&&(i.transform=n.join(" ")),i}},{key:"applyStyles",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.element,t=this.getStyles(e);Object.keys(t).forEach(function(n){return e.style[n]=t[n]})}}]),e}();t.default=p,e.exports=t.default},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){var t=[],n=[],i=[],r=[];e.forEach(function(e){var o=a(e,2),s=o[0],u=o[1];t.push(s),isNaN(u)?(n.push(parseInt(u.substr(1,2),16)),i.push(parseInt(u.substr(3,2),16)),r.push(parseInt(u.substr(5,2),16))):n.push(u)});var o=(0,c.default)(t,n);if(!i.length||!r.length)return function(e){return o(e)};var u=function(){var e=(0,c.default)(t,i),n=(0,c.default)(t,r);return{v:function(t){return"rgb("+Math.round(o(t))+", "+Math.round(e(t))+", "+Math.round(n(t))+")"}}}();return"object"===("undefined"==typeof u?"undefined":s(u))?u.v:void 0}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return"undefined"==typeof e?"undefined":o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":"undefined"==typeof e?"undefined":o(e)},a=function(){function e(e,t){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){r=!0,o=e}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.default=r;var u=n(7),c=i(u);e.exports=t.default},function(e,t){"use strict";function n(e,t){return function(n){if(n<=e[0])return t[0];if(n>=e[e.length-1])return t[e.length-1];for(var i=0,r=e.length-1;r-i>1;){var o=i+r>>1;n<e[o]?r=o:i=o}return t[i]+(t[r]-t[i])/(e[r]-e[i])*(n-e[i])}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=function(){function e(t){var i=t.node,r=t.pager,o=t.width,s=t.height;n(this,e),this.node=i,this.pager=r,this.x=this.y=0,this.setSize(o,s)}return i(e,[{key:"setSize",value:function(e,t){this.width=e||this.node.offsetWidth,this.height=t||this.node.offsetHeight}},{key:"setPosition",value:function(e){this[this.pager.options.axis]=e}},{key:"getSize",value:function(e){if("width"===e||"height"===e)return this[e];var t=this.pager.options.axis;return this["x"===t?"width":"height"]}},{key:"getPosition",value:function(){return this[this.pager.options.axis]}}]),e}();t.default=r,e.exports=t.default},function(e,t){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e,t){return(e%t+t)%t}function r(e,t,n){return Math.min(Math.max(t,e),n)}function o(e){return e.reduce(function(e,t){return e+t},0)}function s(e){return Math.max.apply(null,e)}function a(e,t,r){return[].concat(n(Array(t-e))).map(function(t,n){return i(e+n,r)})}Object.defineProperty(t,"__esModule",{value:!0}),t.modulo=i,t.clamp=r,t.sum=o,t.max=s,t.range=a},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),c=n(2),p=i(c),f=n(13),l=(i(f),n(14)),h=n(3),y=i(h),d=n(15),v=i(d),g=n(16),w=i(g),b=n(17),m=i(b),_={tag:c.PropTypes.any,autoSize:c.PropTypes.oneOf([!0,!1,"width","height"]),accessibility:c.PropTypes.bool,springConfig:c.PropTypes.objectOf(c.PropTypes.number)},x=function(e){function t(e){r(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._setFrameSize=function(){var e=n.context.pager.getFrameSize({fullSize:!0});e.width&&e.height&&n.setState(e,function(){n.state.instant&&n.setState({instant:!1})})},n.state={width:0,height:0,instant:!0},n._hydrate=!1,n}return s(t,e),u(t,[{key:"componentWillMount",value:function(){var e=this.context.pager;e.setOptions(this.props),this._swipe=new v.default(e),this._keyboard=new w.default(e)}},{key:"componentDidMount",value:function(){var e=this.context.pager;e.addFrame((0,f.findDOMNode)(this)),this._setFrameSize(),e.on("viewChange",this._setFrameSize),e.on("hydrated",this._setFrameSize)}},{key:"componentWillReceiveProps",value:function(e){this.props.autoSize===e.autoSize&&this.props.accessibility===e.accessibility||(this.context.pager.setOptions(e),this._hydrate=!0)}},{key:"componentDidUpdate",value:function(e){this._hydrate&&(this.context.pager.hydrate(),this._hydrate=!1)}},{key:"_getFrameStyle",value:function(){var e=this.props.springConfig,t=this.state,n=t.width,i=t.height,r=t.instant;return{maxWidth:r?n:(0,l.spring)(n,e),height:r?i:(0,l.spring)(i,e)}}},{key:"_renderFrame",value:function(e){var t=(this.context.pager,this.props),n=t.tag,i=t.accessibility,r=(0,m.default)(a({},this._swipe.getEvents(),this._keyboard.getEvents(),{tabIndex:i?0:null}),this.props,_);return(0,c.createElement)(n,a({},r,{style:a({},e,r.style)}))}},{key:"render",value:function(){var e=this,t=this.props.autoSize,n=(this.state.height,{position:"relative",overflow:"hidden"});return t?p.default.createElement(l.Motion,{style:this._getFrameStyle()},function(i){return t!==!0&&"width"!==t||!i.maxWidth||(n.maxWidth=i.maxWidth),t!==!0&&"height"!==t||!i.height||(n.height=i.height),e._renderFrame(n)}):this._renderFrame(n)}}]),t}(c.Component);x.contextTypes={pager:c.PropTypes.instanceOf(y.default)},x.propTypes=_,x.defaultProps={tag:"div",autoSize:!1,accessibility:!0,springConfig:l.presets.noWobble},t.default=x,e.exports=t.default},function(e,t){e.exports=i},function(e,t){e.exports=r},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){return e.touches&&e.touches[0]||e}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=function(){function e(t){var r=this;n(this,e),this._onSwipeStart=function(e){var t=i(e),n=t.pageX,o=t.pageY;r.pager.isSwiping=!0,r._swipeStart={x:n,y:o},r._swipeDiff={x:0,y:0},r._isFlick=!0,setTimeout(function(){r._isFlick=!1},r.pager.options.flickTimeout),r.pager.emit("swipeStart")},this._onSwipeMove=function(e){if(r.pager.isSwiping){var t=r.pager.options,n=t.swipeThreshold,o=t.axis,s=i(e),a=s.pageX,u=s.pageY;if(r._trackStart||(r._trackStart=r.pager.currentTween),r._swipeDiff={x:r._swipeStart.x-a,y:r._swipeStart.y-u},r._isSwipe(n)){e.preventDefault(),e.stopPropagation();var c=r._swipeDiff[o],p=r._trackStart-c;r.pager.setPositionValue(p),r.pager.emit("swipeMove")}}},this._onSwipeEnd=function(){var e=r.pager.options,t=e.swipeThreshold,n=e.viewsToMove,i=e.axis,o=(e.infinite,r._isFlick?t:r.pager.currentView.getSize()*n*t);r.pager.isSwiping=!1,r._trackStart=!1,(r._swipeDiff.x||r._swipeDiff.y)&&(r._isSwipe(o)?r._swipeDiff[i]<0?r.pager.prev():r.pager.next():r.pager.setPositionValue()),r.pager.emit("swipeEnd")},this._onSwipePast=function(){r.pager.isSwiping&&r._onSwipeEnd()},this.pager=t,this._trackStart=!1,this._swipeStart=this._swipeDiff={x:0,y:0}}return r(e,[{key:"_isSwipe",value:function(e){var t=this._swipeDiff,n=t.x,i=t.y;return"x"===this.pager.options.axis?Math.abs(n)>Math.max(e,Math.abs(i)):Math.abs(n)<Math.max(e,Math.abs(i))}},{key:"getEvents",value:function(){var e=this.pager.options.swipe,t={};return e!==!0&&"mouse"!==e||(t.onMouseDown=this._onSwipeStart,t.onMouseMove=this._onSwipeMove,t.onMouseUp=this._onSwipeEnd,t.onMouseLeave=this._onSwipePast),e!==!0&&"touch"!==e||(t.onTouchStart=this._onSwipeStart,t.onTouchMove=this._onSwipeMove,t.onTouchEnd=this._onSwipeEnd),t}}]),e}();t.default=o,e.exports=t.default},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(9),s=function(){function e(t){var n=this;i(this,e),this._handleKeyDown=function(e){switch(e.key){case"ArrowUp":case"ArrowLeft":return void n.pager.prev();case"ArrowDown":case"ArrowRight":case" ":return void n.pager.next();case"Home":return void n.pager.setCurrentView({index:0});case"End":return void n.pager.setCurrentView({index:n.pager.views.length-1})}for(var t=(0,o.clamp)(n.pager.views.length,0,9),i=1;i<=t;i++)+e.key===i&&n.pager.setCurrentView({index:i-1})},this.pager=t}return r(e,[{key:"getEvents",value:function(){var e={};return this.pager.options.accessibility&&(e.onKeyDown=this._handleKeyDown),e}}]),e}();t.default=s,e.exports=t.default},function(e,t){"use strict";function n(e,t,n){for(var i in t)t.hasOwnProperty(i)&&!n[i]&&(e[i]=t[i]);return e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},p=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),f=n(2),l=i(f),h=n(13),y=(i(h),n(14)),d=n(3),v=i(d),g=n(19),w=(i(g),n(20)),b=i(w),m=n(17),_=i(m),x=function(e){function t(){var e,n,i,r;o(this,t);for(var a=arguments.length,u=Array(a),c=0;c<a;c++)u[c]=arguments[c];return n=i=s(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),i.state={x:0,y:0},r=n,s(i,r)}return a(t,e),p(t,[{key:"componentWillReceiveProps",value:function(e){var t=this,n=e.trackPosition,i=this.context.pager;i.setViewStyles(n),this.props.trackPosition!==n&&requestAnimationFrame(function(){return t.props.onScroll(n/i.getTrackSize(!1)*-1,n)})}},{key:"_renderViews",value:function(){return f.Children.map(this.props.children,function(e){return e})}},{key:"render",value:function(){var e=this.context.pager,t=this.props,n=t.tag,i=t.trackPosition,o=(t.children,r(t,["tag","trackPosition","children"])),s=c({},o.style);return e.track&&(s=c({},s,e.track.getStyles(i))),(0,f.createElement)(n,c({},o,{style:s}),this._renderViews())}}]),t}(f.Component);x.propTypes=O,x.contextTypes={pager:f.PropTypes.instanceOf(v.default)};var S=function(){return null},O={tag:f.PropTypes.any,currentView:f.PropTypes.any,viewsToShow:f.PropTypes.oneOfType([f.PropTypes.number,f.PropTypes.oneOf(["auto"])]),viewsToMove:f.PropTypes.number,align:f.PropTypes.number,contain:f.PropTypes.bool,axis:f.PropTypes.oneOf(["x","y"]),animations:f.PropTypes.array,infinite:f.PropTypes.bool,instant:f.PropTypes.bool,swipe:f.PropTypes.oneOf([!0,!1,"mouse","touch"]),swipeThreshold:f.PropTypes.number,flickTimeout:f.PropTypes.number,springConfig:f.PropTypes.objectOf(f.PropTypes.number),onSwipeStart:f.PropTypes.func,onSwipeMove:f.PropTypes.func,onSwipeEnd:f.PropTypes.func,onScroll:f.PropTypes.func,onViewChange:f.PropTypes.func,onRest:f.PropTypes.func},P=function(e,t){return e.viewsToShow!==t.viewsToShow||e.viewsToMove!==t.viewsToMove||e.align!==t.align||e.axis!==t.axis||e.animations!==t.animations||e.infinite!==t.infinite||e.swipe!==t.swipe||e.swipeThreshold!==t.swipeThreshold||e.flickTimeout!==t.flickTimeout},T=function(e){function t(){var e,n,i,r;o(this,t);for(var a=arguments.length,u=Array(a),c=0;c<a;c++)u[c]=arguments[c];return n=i=s(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),i.state={instant:!1},i._currentTween=0,i._hydrate=!1,i._handleOnRest=function(){i.props.infinite&&!i.state.instant&&(i.context.pager.resetViewIndex(),i._setValueInstantly(!0,!0)),i.props.onRest()},r=n,s(i,r)}return a(t,e),p(t,[{key:"componentWillMount",value:function(){this.context.pager.setOptions(this.props)}},{key:"componentDidMount",value:function(){var e=this,t=this.context.pager;t.addTrack((0,h.findDOMNode)(this)),this.scrollTo((0,b.default)(this.props.currentView,this.props.children)),t.on("hydrated",function(){return e._setValueInstantly(!0,!0)}),t.on("swipeMove",function(){return e._setValueInstantly(!0)}),t.on("swipeEnd",function(){return e._setValueInstantly(!1)}),t.on("swipeStart",this.props.onSwipeStart),t.on("swipeMove",this.props.onSwipeMove),t.on("swipeEnd",this.props.onSwipeEnd),t.on("viewChange",this.props.onViewChange)}},{key:"componentWillReceiveProps",value:function(e){var t=e.currentView,n=e.instant,i=e.children;this.props.instant!==n&&this._setValueInstantly(n),void 0!==("undefined"==typeof t?"undefined":u(t))&&this.props.currentView!==t&&this.scrollTo((0,b.default)(t,i)),P(this.props,e)&&(this.context.pager.setOptions(e),this._hydrate=!0)}},{key:"componentDidUpdate",value:function(e){this._hydrate&&(this.context.pager.hydrate(),this._hydrate=!1)}},{key:"prev",value:function(){this.context.pager.prev()}},{key:"next",value:function(){this.context.pager.next()}},{key:"scrollTo",value:function(e){this.context.pager.setCurrentView({index:e})}},{key:"_setValueInstantly",value:function(e,t){var n=this;this.setState({instant:e},function(){t&&n.setState({instant:!1})})}},{key:"_getTrackStyle",value:function(){var e=this.context.pager.trackPosition;return this.state.instant||(e=(0,y.spring)(e,this.props.springConfig)),{trackPosition:e}}},{key:"render",value:function(){var e=this.props,t=e.tag,n=e.onScroll,i=r(e,["tag","onScroll"]);return l.default.createElement(y.Motion,{style:this._getTrackStyle(),onRest:this._handleOnRest},function(e){var r=e.trackPosition;return(0,f.createElement)(x,(0,_.default)({trackPosition:r,tag:t,onScroll:n},i,O))})}}]),t}(f.Component);T.propTypes=O,T.defaultProps={tag:"div",currentView:0,viewsToShow:1,viewsToMove:1,align:0,contain:!1,axis:"x",infinite:!1,instant:!1,swipe:!0,swipeThreshold:.5,flickTimeout:300,springConfig:y.presets.noWobble,onSwipeStart:S,onSwipeMove:S,onSwipeEnd:S,onScroll:S,onViewChange:S,onRest:S},T.contextTypes={pager:f.PropTypes.instanceOf(v.default)},t.default=T,e.exports=t.default},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),p=n(2),f=(i(p),n(13)),l=(i(f),n(3)),h=i(l),y=function(e){function t(){var e,n,i,r;o(this,t);for(var a=arguments.length,u=Array(a),c=0;c<a;c++)u[c]=arguments[c];return n=i=s(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),i._viewAdded=!1,i._viewInstance=null,r=n,s(i,r)}return a(t,e),c(t,[{key:"getChildContext",value:function(){return{view:this._viewInstance}}},{key:"componentDidMount",value:function(){this._viewInstance=this.context.pager.addView((0,f.findDOMNode)(this)),this._viewAdded=!0,this.forceUpdate()}},{key:"componentWillUnmount",value:function(){this.context.pager.removeView(this._viewInstance)}},{key:"render",value:function(){var e=this.context.pager,t=e.options,n=(t.viewsToShow,t.axis,this.props),i=n.tag,o=(n.trackSize,r(n,["tag","trackSize"])),s=u({},o.style);return this._viewAdded||(s.visibility="hidden",s.pointerEvents="none"),this._viewInstance&&(s=u({},s,this._viewInstance.getStyles())),(0,p.createElement)(i,u({},o,{style:s}))}}]),
t}(p.Component);y.contextTypes={pager:p.PropTypes.instanceOf(h.default)},y.childContextTypes={view:p.PropTypes.any},y.propTypes={tag:p.PropTypes.any},y.defaultProps={tag:"div"},t.default=y,e.exports=t.default},function(e,t,n){"use strict";function i(e,t){var n=null;return r.Children.forEach(t,function(t,i){if(t.key===e||i===e)return void(n=i)}),n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var r=n(2);e.exports=t.default},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),p=n(2),f=(i(p),n(5)),l=i(f),h=n(3),y=i(h),d=n(17),v=i(d),g={tag:p.PropTypes.string,index:p.PropTypes.number,animations:p.PropTypes.array},w=function(e){function t(){return o(this,t),s(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),c(t,[{key:"componentWillMount",value:function(){var e=this.props.animations;e.length&&(this._animationBus=new l.default({animations:e,origin:function(e){return e.origin}}))}},{key:"render",value:function(){var e=this.props,t=e.tag,n=e.index,i=r(e,["tag","index"]),o=u({},i.style);if(this._animationBus){var s=this.context.view||this.context.pager.getView(n);s&&(o=u({},i.style,this._animationBus.getStyles(s)))}return(0,p.createElement)(t,(0,v.default)({style:o},this.props,g))}}]),t}(p.Component);w.contextTypes={pager:p.PropTypes.instanceOf(y.default),view:p.PropTypes.any},w.propTypes=g,w.defaultProps={tag:"div",animations:[]},t.default=w,e.exports=t.default}])});

@@ -42,3 +42,4 @@ 'use strict';

if (isWindowDefined && !window.ResizeObserver) {
window.ResizeObserver = require('resize-observer-polyfill');
var _ResizeObserver = require('resize-observer-polyfill');
window.ResizeObserver = _ResizeObserver.default || _ResizeObserver;
}

@@ -45,0 +46,0 @@

{
"name": "react-view-pager",
"version": "0.5.0-prerelease.7",
"version": "0.5.0-prerelease.8",
"description": "View-Pager/Slider/Carousel powered by React Motion.",

@@ -5,0 +5,0 @@ "main": "lib/react-view-pager.js",

@@ -17,6 +17,6 @@ ## React View Pager (Prerelease)

<script src="https://unpkg.com/react-view-pager/dist/react-view-pager.js"></script>
(UMD library exposed as `Reactpager`)
(UMD library exposed as `ReactViewPager`)
```
## Example Usage
## Example
```js

@@ -23,0 +23,0 @@ import { ViewPager, Frame, Track, View } from 'react-view-pager'

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc