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.10 to 0.5.0

5

CHANGELOG.md
## CHANGELOG
### 0.5.0
Support React 15.5.0 PropTypes [#58](https://github.com/souporserious/react-view-pager/pull/58)
Update react-motion and resize-observer-polyfill dependency version
### 0.5.0-prerelease.10

@@ -3,0 +8,0 @@ Fix build on NPM

6

dist/react-view-pager.min.js
/*!
* React View Pager 0.5.0-prerelease.10
* React View Pager 0.5.0
* https://github.com/souporserious/react-view-pager
* Copyright (c) 2017 React View Pager Authors
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("resize-observer-polyfill"),require("get-prefix"),require("react-dom"),require("react-motion")):"function"==typeof define&&define.amd?define(["react","resize-observer-polyfill","get-prefix","react-dom","react-motion"],t):"object"==typeof exports?exports.ReactViewPager=t(require("react"),require("resize-observer-polyfill"),require("get-prefix"),require("react-dom"),require("react-motion")):e.ReactViewPager=t(e.React,e.ResizeObserver,e.getPrefix,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(13),a=i(s),u=n(19),c=i(u),p=n(20),f=i(p),l=n(22),h=i(l),d=n(11),y=i(d);t.ViewPager=o.default,t.Frame=a.default,t.Track=c.default,t.View=f.default,t.AnimatedView=h.default,t.utils=y.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),d=i(h),y=n(6),v=i(y),g=n(9),w=i(g),b=n(10),m=i(b),_=n(11),x=n(12)("transform"),S="undefined"!=typeof window,O=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({},x,"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}(m.default),T=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.inBounds=!0,o.tabbableChildren=[],o.setCurrent(!1),o.setVisible(!1),o.setTarget(),o.setOrigin(),setTimeout(function(){o.tabbableChildren=(0,d.default)(o.node),o.setTabbableChildren()}),o}return u(t,e),p(t,[{key:"setCurrent",value:function(e){this.isCurrent=e}},{key:"setVisible",value:function(e){this.isVisible=e,this.setTabbableChildren()}},{key:"setTabbableChildren",value:function(){for(var e=0;e<this.tabbableChildren.length;e++)this.tabbableChildren[e].tabIndex=this.isCurrent?0:-1}},{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}(m.default),P={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},k=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,e),this.hydrate=function(){t.frame.setSize(),t.track.setSize(),t.views.forEach(function(e){e.setSize(),e.setTarget()}),t.setPositionValue(),t.setViewStyles(),t.emit("hydrated")};var i=(0,l.default)();this.on=i.on,this.emit=i.emit,this.off=i.off,this.views=[],this.currentIndex=0,this.currentView=null,this.currentTween=0,this.trackPosition=0,this.isSwiping=!1,this.options=c({},P,n),this.animationBus=new v.default({animations:this.options.animations,origin:function(e){return e.origin}}),S&&(this.resizeObserver=new w.default(function(){t.hydrate()}))}return p(e,[{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 m.default({node:e,pager:this})}},{key:"addTrack",value:function(e){this.track=new O({node:e,pager:this})}},{key:"addView",value:function(e){var t=this.views.length,n=new T({node:e,index:t,pager:this});return this.views.push(n),this.currentView||this.setCurrentView({index:t,suppressEvent:!0}),S&&this.resizeObserver.observe(e),this.emit("viewAdded"),n}},{key:"removeView",value:function(e){this.views=this.views.filter(function(t){return e!==t}),S&&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,_.clamp)(p,0,this.views.length-1),h=this.getView(f),d=this.getView(l);this.currentIndex=l,this.currentView=d,h.setCurrent(!1),d.setCurrent(!0);var y=l,v=l+u-1;(0,_.range)(y,v,this.views.length);this.views.forEach(function(e,t){e.setVisible(t===l)}),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,_.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,_.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,_.sum)(i):(0,_.max)(i),height:"y"===n?(0,_.sum)(r):(0,_.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,_.clamp)(o,0,this.views.length-r),s=(0,_.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,_.modulo)(u,this.views.length):(0,_.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,_.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,_.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,_.modulo)(this.currentIndex,this.views.length),suppressEvent:!0})}}]),e}();t.default=k,e.exports=t.default},function(e,t){"use strict";function n(e){function t(t){var n=t.toLowerCase();return e[n]||(e[n]=[])}return e=e||{},{on:function(e,n){t(e).push(n)},off:function(e,n){var i=t(e),r=i.indexOf(n);~r&&i.splice(r,1)},emit:function(e,n){t("*").concat(t(e)).forEach(function(e){e(n)})}}}e.exports=n},function(e,t){"use strict";function n(){function e(n,i){if(n===document.documentElement)return!1;for(var r=0,o=t.length;r<o;r++)if(t[r][0]===n)return t[r][1];i=i||window.getComputedStyle(n);var s=!1;return"none"===i.display?s=!0:n.parentNode&&(s=e(n.parentNode)),t.push([n,s]),s}var t=[];return function(t){if(t===document.documentElement)return!1;var n=window.getComputedStyle(t);return!!e(t,n)||"hidden"===n.visibility}}e.exports=function(e){for(var t,i,r=[],o=[],s=n(),a=["input","select","a[href]","textarea","button","[tabindex]"],u=e.querySelectorAll(a),c=0,p=u.length;c<p;c++)t=u[c],i=t.tabIndex,i<0||"INPUT"===t.tagName&&"hidden"===t.type||t.disabled||s(t)||(0===i?r.push(t):o.push({tabIndex:i,node:t}));var f=o.sort(function(e,t){return e.tabIndex-t.tabIndex}).map(function(e){return e.node});return Array.prototype.push.apply(f,r),f}},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(7),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(8),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,n){e.exports=t},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(1+t-e))).map(function(t){return r?i(e+t,r):e+t})}Object.defineProperty(t,"__esModule",{value:!0}),t.modulo=i,t.clamp=r,t.sum=o,t.max=s,t.range=a},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(14),l=(i(f),n(15)),h=n(3),d=i(h),y=n(16),v=i(y),g=n(17),w=i(g),b=n(18),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,t=this.props,n=t.autoSize,i=t.accessibility;e.setOptions({autoSize:n,accessibility:i}),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){var t=e.autoSize,n=e.accessibility;this.props.autoSize===t&&this.props.accessibility===n||(this.context.pager.setOptions({autoSize:t,accessibility:n}),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(d.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(11),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(14),d=(i(h),n(15)),y=n(3),v=i(y),g=n(20),w=(i(g),n(21)),b=i(w),m=n(18),_=i(m),x=function(){return null},S={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},O=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={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);T.propTypes=S,T.contextTypes={pager:f.PropTypes.instanceOf(v.default)};var P=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)),O(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,d.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(d.Motion,{style:this._getTrackStyle(),onRest:this._handleOnRest},function(e){var r=e.trackPosition;return(0,f.createElement)(T,(0,_.default)({trackPosition:r,tag:t,onScroll:n},i,S))})}}]),t}(f.Component);P.propTypes=S,P.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:d.presets.noWobble,onSwipeStart:x,onSwipeMove:x,onSwipeEnd:x,onScroll:x,onViewChange:x,onRest:x},P.contextTypes={pager:f.PropTypes.instanceOf(v.default)},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,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(14)),l=(i(f),n(3)),h=i(l),d=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);d.contextTypes={pager:p.PropTypes.instanceOf(h.default)},d.childContextTypes={view:p.PropTypes.any},d.propTypes={tag:p.PropTypes.any},d.defaultProps={tag:"div"},t.default=d,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(6)),l=i(f),h=n(3),d=i(h),y=n(18),v=i(y),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(d.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("resize-observer-polyfill"),require("get-prefix"),require("react-dom"),require("react-motion")):"function"==typeof define&&define.amd?define(["react","resize-observer-polyfill","get-prefix","react-dom","react-motion"],t):"object"==typeof exports?exports.ReactViewPager=t(require("react"),require("resize-observer-polyfill"),require("get-prefix"),require("react-dom"),require("react-motion")):e.ReactViewPager=t(e.React,e.ResizeObserver,e.getPrefix,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),a=n(13),s=i(a),u=n(19),c=i(u),f=n(21),l=i(f),p=n(22),h=i(p),d=n(11),v=i(d);t.ViewPager=o.default,t.Frame=s.default,t.Track=c.default,t.View=l.default,t.AnimatedView=h.default,t.utils=v.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 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 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 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),f=(i(c),n(!function(){var e=new Error('Cannot find module "prop-types"');throw e.code="MODULE_NOT_FOUND",e}())),l=i(f),p=n(3),h=i(p),d=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),i=new h.default,r=function(){return n.forceUpdate()};return i.on("viewChange",r),i.on("hydrated",r),n._pager=i,n}return s(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);d.childContextTypes={pager:l.default.instanceOf(h.default)},d.propTypes={tag:l.default.string},d.defaultProps={tag:"div"},t.default=d,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 a(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 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},f=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}}(),l=n(4),p=i(l),h=n(5),d=i(h),v=n(6),y=i(v),g=n(9),w=i(g),b=n(10),m=i(b),_=n(11),x=n(12)("transform"),S="undefined"!=typeof window,O=function(e){function t(){return a(this,t),s(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,e),f(t,[{key:"getStyles",value:function(e){var t=this.pager.getPositionValue(e),n=t.x,i=t.y,r=this.pager.getTrackSize(),a=o({},x,"translate3d("+n+"px, "+i+"px, 0)");if(r){var s=this.pager.options,u=s.axis,c=s.viewsToShow,f="x"===u?"width":"height";a[f]="auto"===c?r:this.pager.views.length/c*100+"%"}return a}}]),t}(m.default),k=function(e){function t(e){var n=e.index,i=r(e,["index"]);a(this,t);var o=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,i));return o.index=n,o.inBounds=!0,o.tabbableChildren=[],o.setCurrent(!1),o.setVisible(!1),o.setTarget(),o.setOrigin(),setTimeout(function(){o.tabbableChildren=(0,d.default)(o.node),o.setTabbableChildren()}),o}return u(t,e),f(t,[{key:"setCurrent",value:function(e){this.isCurrent=e}},{key:"setVisible",value:function(e){this.isVisible=e,this.setTabbableChildren()}},{key:"setTabbableChildren",value:function(){for(var e=0;e<this.tabbableChildren.length;e++)this.tabbableChildren[e].tabIndex=this.isCurrent?0:-1}},{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}(m.default),T={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},P=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(this,e),this.hydrate=function(){t.frame.setSize(),t.track.setSize(),t.views.forEach(function(e){e.setSize(),e.setTarget()}),t.setPositionValue(),t.setViewStyles(),t.emit("hydrated")};var i=(0,p.default)();this.on=i.on,this.emit=i.emit,this.off=i.off,this.views=[],this.currentIndex=0,this.currentView=null,this.currentTween=0,this.trackPosition=0,this.isSwiping=!1,this.options=c({},T,n),this.animationBus=new y.default({animations:this.options.animations,origin:function(e){return e.origin}}),S&&(this.resizeObserver=new w.default(function(){t.hydrate()}))}return f(e,[{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 m.default({node:e,pager:this})}},{key:"addTrack",value:function(e){this.track=new O({node:e,pager:this})}},{key:"addView",value:function(e){var t=this.views.length,n=new k({node:e,index:t,pager:this});return this.views.push(n),this.currentView||this.setCurrentView({index:t,suppressEvent:!0}),S&&this.resizeObserver.observe(e),this.emit("viewAdded"),n}},{key:"removeView",value:function(e){this.views=this.views.filter(function(t){return e!==t}),S&&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,a=void 0!==o&&o,s=this.options,u=s.viewsToMove,c=s.infinite,f=r+n*u,l=this.currentIndex,p=c?f:(0,_.clamp)(f,0,this.views.length-1),h=this.getView(l),d=this.getView(p);this.currentIndex=p,this.currentView=d,h.setCurrent(!1),d.setCurrent(!0);var v=p,y=p+u-1;(0,_.range)(v,y,this.views.length);this.views.forEach(function(e,t){e.setVisible(t===p)}),this.setPositionValue(),a||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,a=this.getTrackSize();if(r&&(e-=(Math.floor(this.currentIndex/this.views.length)||0)*a),o){var s="auto"===n&&i||n<=1?0:this.getFrameSize({autoSize:!1});e=(0,_.clamp)(e,s-a,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,_.modulo)(e,-r);this.views.reduce(function(t,a,s){var u=a.getSize(),c=t+u,f=t;return c+u*i<Math.abs(o)?(n&&(f+=r-t),a.inBounds=!1):a.inBounds=!0,a.setPosition(f),a.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,_.sum)(i):(0,_.max)(i),height:"y"===n?(0,_.sum)(r):(0,_.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,a=this.currentIndex+(r-1);if(n){o=(0,_.clamp)(o,0,this.views.length-r),a=(0,_.clamp)(a,0,this.views.length-1);for(var s=o;s<=a;s++)i.push(s)}else for(var u=o;u<=a;u++)i.push(t?(0,_.modulo)(u,this.views.length):(0,_.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 a=this.getCurrentIndicies();o=this.getMaxDimensions(a)}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,_.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,_.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,_.modulo)(this.currentIndex,this.views.length),suppressEvent:!0})}}]),e}();t.default=P,e.exports=t.default},function(e,t){"use strict";function n(e){function t(t){var n=t.toLowerCase();return e[n]||(e[n]=[])}return e=e||{},{on:function(e,n){t(e).push(n)},off:function(e,n){var i=t(e),r=i.indexOf(n);~r&&i.splice(r,1)},emit:function(e,n){t("*").concat(t(e)).forEach(function(e){e(n)})}}}e.exports=n},function(e,t){"use strict";function n(){function e(n,i){if(n===document.documentElement)return!1;for(var r=0,o=t.length;r<o;r++)if(t[r][0]===n)return t[r][1];i=i||window.getComputedStyle(n);var a=!1;return"none"===i.display?a=!0:n.parentNode&&(a=e(n.parentNode)),t.push([n,a]),a}var t=[];return function(t){if(t===document.documentElement)return!1;var n=window.getComputedStyle(t);return!!e(t,n)||"hidden"===n.visibility}}e.exports=function(e){for(var t,i,r=[],o=[],a=n(),s=["input","select","a[href]","textarea","button","[tabindex]"],u=e.querySelectorAll(s),c=0,f=u.length;c<f;c++)t=u[c],i=t.tabIndex,i<0||"INPUT"===t.tagName&&"hidden"===t.type||t.disabled||a(t)||(0===i?r.push(t):o.push({tabIndex:i,node:t}));var l=o.sort(function(e,t){return e.tabIndex-t.tabIndex}).map(function(e){return e.node});return Array.prototype.push.apply(l,r),l}},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}}(),a=n(7),s=i(a),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),f=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]||"",a=(0,s.default)(e.stops)(t);c.indexOf(r)>-1?n.push(r+"("+a+o+")"):i[r]=""+a+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=f,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=s(e,2),a=o[0],u=o[1];t.push(a),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":a(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 a="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)},s=function(){function e(e,t){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);i=!0);}catch(e){r=!0,o=e}finally{try{!i&&s.return&&s.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(8),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,n){e.exports=t},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,a=t.height;n(this,e),this.node=i,this.pager=r,this.x=this.y=0,this.setSize(o,a)}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 a(e){return Math.max.apply(null,e)}function s(e,t,r){return[].concat(n(Array(1+t-e))).map(function(t){return r?i(e+t,r):e+t})}Object.defineProperty(t,"__esModule",{value:!0}),t.modulo=i,t.clamp=r,t.sum=o,t.max=a,t.range=s},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 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 s=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),f=i(c),l=n(!function(){var e=new Error('Cannot find module "prop-types"');throw e.code="MODULE_NOT_FOUND",e}()),p=i(l),h=n(14),d=n(15),v=n(3),y=i(v),g=n(16),w=i(g),b=n(17),m=i(b),_=n(18),x=i(_),S={tag:p.default.any,autoSize:p.default.oneOf([!0,!1,"width","height"]),accessibility:p.default.bool,springConfig:p.default.objectOf(p.default.number)},O=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 a(t,e),u(t,[{key:"componentWillMount",value:function(){var e=this.context.pager,t=this.props,n=t.autoSize,i=t.accessibility;e.setOptions({autoSize:n,accessibility:i}),this._swipe=new w.default(e),this._keyboard=new m.default(e)}},{key:"componentDidMount",value:function(){var e=this.context.pager;e.addFrame((0,h.findDOMNode)(this)),this._setFrameSize(),e.on("viewChange",this._setFrameSize),e.on("hydrated",this._setFrameSize)}},{key:"componentWillReceiveProps",value:function(e){var t=e.autoSize,n=e.accessibility;this.props.autoSize===t&&this.props.accessibility===n||(this.context.pager.setOptions({autoSize:t,accessibility:n}),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,d.spring)(n,e),height:r?i:(0,d.spring)(i,e)}}},{key:"_renderFrame",value:function(e){var t=(this.context.pager,this.props),n=t.tag,i=t.accessibility,r=(0,x.default)(s({},this._swipe.getEvents(),this._keyboard.getEvents(),{tabIndex:i?0:null}),this.props,S);return(0,c.createElement)(n,s({},r,{style:s({},e,r.style)}))}},{key:"render",value:function(){var e=this,t=this.props.autoSize,n=(this.state.height,{position:"relative",overflow:"hidden"});return t?f.default.createElement(d.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);O.contextTypes={pager:p.default.instanceOf(y.default)},O.propTypes=S,O.defaultProps={tag:"div",autoSize:!1,accessibility:!0,springConfig:d.presets.noWobble},t.default=O,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,a=i(e),s=a.pageX,u=a.pageY;if(r._trackStart||(r._trackStart=r.pager.currentTween),r._swipeDiff={x:r._swipeStart.x-s,y:r._swipeStart.y-u},r._isSwipe(n)){e.preventDefault(),e.stopPropagation();var c=r._swipeDiff[o],f=r._trackStart-c;r.pager.setPositionValue(f),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(11),a=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=a,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 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 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 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},f=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}}(),l=n(2),p=i(l),h=n(!function(){var e=new Error('Cannot find module "prop-types"');throw e.code="MODULE_NOT_FOUND",e}()),d=i(h),v=n(14),y=n(15),g=n(3),w=i(g),b=n(20),m=i(b),_=n(18),x=i(_),S=function(){return null},O={tag:d.default.any,currentView:d.default.any,viewsToShow:d.default.oneOfType([d.default.number,d.default.oneOf(["auto"])]),viewsToMove:d.default.number,align:d.default.number,contain:d.default.bool,axis:d.default.oneOf(["x","y"]),animations:d.default.array,infinite:d.default.bool,instant:d.default.bool,swipe:d.default.oneOf([!0,!1,"mouse","touch"]),swipeThreshold:d.default.number,flickTimeout:d.default.number,springConfig:d.default.objectOf(d.default.number),onSwipeStart:d.default.func,onSwipeMove:d.default.func,onSwipeEnd:d.default.func,onScroll:d.default.func,onViewChange:d.default.func,onRest:d.default.func},k=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 s=arguments.length,u=Array(s),c=0;c<s;c++)u[c]=arguments[c];return n=i=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),i.state={x:0,y:0},r=n,a(i,r)}return s(t,e),f(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 l.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"])),a=c({},o.style);return e.track&&(a=c({},a,e.track.getStyles(i))),(0,l.createElement)(n,c({},o,{style:a}),this._renderViews())}}]),t}(l.Component);T.propTypes=O,T.contextTypes={pager:d.default.instanceOf(w.default)};var P=function(e){function t(){var e,n,i,r;o(this,t);for(var s=arguments.length,u=Array(s),c=0;c<s;c++)u[c]=arguments[c];return n=i=a(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,a(i,r)}return s(t,e),f(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,v.findDOMNode)(this)),this.scrollTo((0,m.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,m.default)(t,i)),k(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 p.default.createElement(y.Motion,{style:this._getTrackStyle(),onRest:this._handleOnRest},function(e){var r=e.trackPosition;return(0,l.createElement)(T,(0,x.default)({trackPosition:r,tag:t,onScroll:n},i,O))})}}]),t}(l.Component);P.propTypes=O,P.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},P.contextTypes={pager:d.default.instanceOf(w.default)},t.default=P,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 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 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 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}}(),f=n(2),l=(i(f),n(!function(){var e=new Error('Cannot find module "prop-types"');throw e.code="MODULE_NOT_FOUND",e}())),p=i(l),h=n(14),d=n(3),v=i(d),y=function(e){function t(){var e,n,i,r;o(this,t);for(var s=arguments.length,u=Array(s),c=0;c<s;c++)u[c]=arguments[c];return n=i=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),i._viewAdded=!1,i._viewInstance=null,r=n,a(i,r)}return s(t,e),c(t,[{key:"getChildContext",value:function(){return{view:this._viewInstance}}},{key:"componentDidMount",value:function(){this._viewInstance=this.context.pager.addView((0,h.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"])),a=u({},o.style);return this._viewAdded||(a.visibility="hidden",a.pointerEvents="none"),this._viewInstance&&(a=u({},a,this._viewInstance.getStyles())),(0,f.createElement)(i,u({},o,{style:a}))}}]),t}(f.Component);y.contextTypes={pager:p.default.instanceOf(v.default)},y.childContextTypes={view:p.default.any},y.propTypes={tag:p.default.any},y.defaultProps={tag:"div"},t.default=y,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 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 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 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}}(),f=n(2),l=(i(f),n(!function(){var e=new Error('Cannot find module "prop-types"');throw e.code="MODULE_NOT_FOUND",e}())),p=i(l),h=n(6),d=i(h),v=n(3),y=i(v),g=n(18),w=i(g),b={tag:p.default.string,index:p.default.number,animations:p.default.array},m=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,e),c(t,[{key:"componentWillMount",value:function(){var e=this.props.animations;e.length&&(this._animationBus=new d.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 a=this.context.view||this.context.pager.getView(n);a&&(o=u({},i.style,this._animationBus.getStyles(a)))}return(0,f.createElement)(t,(0,w.default)({style:o},this.props,b))}}]),t}(f.Component);m.contextTypes={pager:p.default.instanceOf(y.default),view:p.default.any},m.propTypes=b,m.defaultProps={tag:"div",animations:[]},t.default=m,e.exports=t.default}])});

@@ -15,2 +15,6 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _animationBus = require('animation-bus');

@@ -39,5 +43,5 @@

var checkedProps = {
tag: _react.PropTypes.string,
index: _react.PropTypes.number,
animations: _react.PropTypes.array
tag: _propTypes2.default.string,
index: _propTypes2.default.number,
animations: _propTypes2.default.array
};

@@ -94,4 +98,4 @@

AnimatedView.contextTypes = {
pager: _react.PropTypes.instanceOf(_Pager2.default),
view: _react.PropTypes.any
pager: _propTypes2.default.instanceOf(_Pager2.default),
view: _propTypes2.default.any
};

@@ -98,0 +102,0 @@ AnimatedView.propTypes = checkedProps;

@@ -15,6 +15,8 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactDom = require('react-dom');
var _reactDom2 = _interopRequireDefault(_reactDom);
var _reactMotion = require('react-motion');

@@ -47,6 +49,6 @@

var checkedProps = {
tag: _react.PropTypes.any,
autoSize: _react.PropTypes.oneOf([true, false, 'width', 'height']),
accessibility: _react.PropTypes.bool,
springConfig: _react.PropTypes.objectOf(_react.PropTypes.number)
tag: _propTypes2.default.any,
autoSize: _propTypes2.default.oneOf([true, false, 'width', 'height']),
accessibility: _propTypes2.default.bool,
springConfig: _propTypes2.default.objectOf(_propTypes2.default.number)
};

@@ -198,3 +200,3 @@

Frame.contextTypes = {
pager: _react.PropTypes.instanceOf(_Pager2.default)
pager: _propTypes2.default.instanceOf(_Pager2.default)
};

@@ -201,0 +203,0 @@ Frame.propTypes = checkedProps;

@@ -15,2 +15,6 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Pager = require('./Pager');

@@ -65,5 +69,5 @@

ImageView.contextTypes = {
pager: _react.PropTypes.instanceOf(_Pager2.default)
pager: _propTypes2.default.instanceOf(_Pager2.default)
};
exports.default = ImageView;
module.exports = exports['default'];

@@ -17,6 +17,8 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactDom = require('react-dom');
var _reactDom2 = _interopRequireDefault(_reactDom);
var _reactMotion = require('react-motion');

@@ -28,6 +30,2 @@

var _View = require('./View');
var _View2 = _interopRequireDefault(_View);
var _getIndex = require('./get-index');

@@ -55,24 +53,24 @@

var checkedProps = {
tag: _react.PropTypes.any,
currentView: _react.PropTypes.any,
viewsToShow: _react.PropTypes.oneOfType([_react.PropTypes.number, _react.PropTypes.oneOf(['auto'])]),
viewsToMove: _react.PropTypes.number,
align: _react.PropTypes.number,
contain: _react.PropTypes.bool,
axis: _react.PropTypes.oneOf(['x', 'y']),
animations: _react.PropTypes.array,
infinite: _react.PropTypes.bool,
instant: _react.PropTypes.bool,
swipe: _react.PropTypes.oneOf([true, false, 'mouse', 'touch']),
swipeThreshold: _react.PropTypes.number,
flickTimeout: _react.PropTypes.number,
tag: _propTypes2.default.any,
currentView: _propTypes2.default.any,
viewsToShow: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.oneOf(['auto'])]),
viewsToMove: _propTypes2.default.number,
align: _propTypes2.default.number,
contain: _propTypes2.default.bool,
axis: _propTypes2.default.oneOf(['x', 'y']),
animations: _propTypes2.default.array,
infinite: _propTypes2.default.bool,
instant: _propTypes2.default.bool,
swipe: _propTypes2.default.oneOf([true, false, 'mouse', 'touch']),
swipeThreshold: _propTypes2.default.number,
flickTimeout: _propTypes2.default.number,
// rightToLeft: PropTypes.bool,
// lazyLoad: PropTypes.bool,
springConfig: _react.PropTypes.objectOf(_react.PropTypes.number),
onSwipeStart: _react.PropTypes.func,
onSwipeMove: _react.PropTypes.func,
onSwipeEnd: _react.PropTypes.func,
onScroll: _react.PropTypes.func,
onViewChange: _react.PropTypes.func,
onRest: _react.PropTypes.func
springConfig: _propTypes2.default.objectOf(_propTypes2.default.number),
onSwipeStart: _propTypes2.default.func,
onSwipeMove: _propTypes2.default.func,
onSwipeEnd: _propTypes2.default.func,
onScroll: _propTypes2.default.func,
onViewChange: _propTypes2.default.func,
onRest: _propTypes2.default.func
};

@@ -165,3 +163,3 @@ var isNotEqual = function isNotEqual(current, next) {

TrackScroller.contextTypes = {
pager: _react.PropTypes.instanceOf(_Pager2.default)
pager: _propTypes2.default.instanceOf(_Pager2.default)
};

@@ -350,5 +348,5 @@

Track.contextTypes = {
pager: _react.PropTypes.instanceOf(_Pager2.default)
pager: _propTypes2.default.instanceOf(_Pager2.default)
};
exports.default = Track;
module.exports = exports['default'];

@@ -15,6 +15,8 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactDom = require('react-dom');
var _reactDom2 = _interopRequireDefault(_reactDom);
var _Pager = require('./Pager');

@@ -104,9 +106,9 @@

View.contextTypes = {
pager: _react.PropTypes.instanceOf(_Pager2.default)
pager: _propTypes2.default.instanceOf(_Pager2.default)
};
View.childContextTypes = {
view: _react.PropTypes.any
view: _propTypes2.default.any
};
View.propTypes = {
tag: _react.PropTypes.any
tag: _propTypes2.default.any
};

@@ -113,0 +115,0 @@ View.defaultProps = {

@@ -13,2 +13,6 @@ 'use strict';

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Pager = require('./Pager');

@@ -86,6 +90,6 @@

ViewPager.childContextTypes = {
pager: _react.PropTypes.instanceOf(_Pager2.default)
pager: _propTypes2.default.instanceOf(_Pager2.default)
};
ViewPager.propTypes = {
tag: _react.PropTypes.string
tag: _propTypes2.default.string
};

@@ -92,0 +96,0 @@ ViewPager.defaultProps = {

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

@@ -46,7 +46,8 @@ "main": "lib/react-view-pager.js",

"mitt": "^1.0.0",
"react-motion": "^0.4.5",
"resize-observer-polyfill": "^1.3.2",
"react-motion": "^0.4.8",
"resize-observer-polyfill": "^1.4.2",
"tabbable": "^1.0.5"
},
"peerDependencies": {
"prop-types": "^15.5.8",
"react": "^0.14.0 || ^15.0.0",

@@ -72,2 +73,3 @@ "react-dom": "^0.14.0 || ^15.0.0"

"postcss-loader": "^0.13.0",
"prop-types": "15.5.8",
"react": "15.3.2",

@@ -74,0 +76,0 @@ "react-addons-test-utils": "15.3.2",

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

## Note before using
Use at your own risk, API's are subject to change. It's been fairly stable these last few months, but still might change slightly. Once the outstanding issues are fixed I will release 1.0.0.
## Usage

@@ -11,0 +15,0 @@

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