[
  {
    "path": ".gitignore",
    "content": ".idea\nnode_modules\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2016 威老\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "[![npm](https://img.shields.io/npm/l/vue-swiper.svg?maxAge=2592000)](https://raw.githubusercontent.com/weilao/vue-swiper/master/LICENSE)\n[![npm](https://img.shields.io/npm/v/vue-swiper.svg?maxAge=2592000)](https://www.npmjs.com/package/vue-swiper)\n[![GitHub release](https://img.shields.io/github/release/weilao/vue-swiper.svg?maxAge=2592000)](https://github.com/weilao/vue-swiper/releases)\n[![GitHub issues](https://img.shields.io/github/issues/weilao/vue-swiper.svg?maxAge=2592000)](https://github.com/weilao/vue-swiper/issues)\n[![GitHub stars](https://img.shields.io/github/stars/weilao/vue-swiper.svg?style=social&label=Star&maxAge=2592000)](https://github.com/weilao/vue-swiper) \n\n[![NPM](https://nodei.co/npm/vue-swiper.png?downloads=true&downloadRank=true)](https://nodei.co/npm/vue-swiper/)\n\n# vue-swiper\nSwiper component. Easy to use.\n\n## Examples\n[basic demo](http://weilao.github.io/vue-swiper/demo)\n\n## Install\n```\nnpm i vue-swiper -S\n```\n\n## Usage\n\n```js\nimport Vue from 'vue'\nimport Swiper from 'vue-swiper'\n\nnew Vue({\n    el: 'body',\n    components: {Swiper},\n    methods: {\n        onSlideChangeStart (currentPage) {\n            console.log('onSlideChangeStart', currentPage);\n        },\n        onSlideChangeEnd (currentPage) {\n            console.log('onSlideChangeEnd', currentPage);\n        }\n    }\n});\n```\n\n```html\n<swiper v-ref:swiper\n        direction=\"horizontal\"\n        :mousewheel-control=\"true\"\n        :performance-mode=\"false\"\n        :pagination-visible=\"true\"\n        :pagination-clickable=\"true\"\n        :loop=\"true\"\n        @slide-change-start=\"onSlideChangeStart\"\n        @slide-change-end=\"onSlideChangeEnd\">\n    <div>Page 1</div>\n    <div>Page 2</div>\n    <div>Page 3</div>\n</swiper>\n```\n\n## Api\n### Properties\n| Name                 | Type      | Default      | Description                                                        |\n|----------------------|-----------|--------------|--------------------------------------------------------------------|\n| direction            | `String`  | `\"vertical\"` | Could be 'horizontal' or 'vertical' (for vertical slider).         |\n| mousewheel-control   | `Boolean` | `true`       | Set to true to enable navigation through slides using mouse wheel. |\n| pagination-visible   | `Boolean` | `false`      | Toggle (hide/true) pagination container visibility when click on Slider's container    |\n| pagination-clickable | `Boolean` | `false`      | If true then clicking on pagination button will cause transition to appropriate slide. |\n| performace-mode      | `Boolean` | `false`      | Disable advance effect for better performance.                     |\n| loop                 | `Boolean` | `false`      | Set to true to enable continuous loop mode                         |\n| ==================== | ========= | ============ | =================== |\n\n### Methods\n| Method            | Description              |\n|-------------------|--------------------------|\n| next()            | Go next page.            |\n| prev()            | Go previous page.        |\n| setPage(`Number`) | Set current page number. |\n\n### Events\n| Name                            | Parameters | Description                                                                                                                                                  |\n|--------------------|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| slide-change-start | `pageNumber`     | Fire in the beginning of animation to other slide (next or previous).                                                                                        |\n| slide-change-end   | `pageNumber`     | Will be fired after animation to other slide (next or previous).                                                                                             |\n| slide-revert-start | `pageNumber`     | Fire in the beginning of animation to revert slide (no change).                                                                                              |\n| slide-revert-end   | `pageNumber`     | Will be fired after animation to revert slide (no change).                                                                                                   |\n| slider-move        | `offset`         | Callback function, will be executed when user touch and move finger over Swiper and move it. Receives swiper instance and 'touchmove' event as an arguments. |\n| ================== | ================ | ============================ |\n"
  },
  {
    "path": "demo/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>vue-swiper DEMO</title>\n    <meta name=\"viewport\"\n          content=\"width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0\">\n    <style>\n        [v-cloak] {\n            display: none;\n        }\n\n        html, body {\n            margin: 0;\n        }\n\n        h2, h3 {\n            text-align: center;\n        }\n\n        button {\n            background-color: skyblue;\n            color: white;\n            padding: 0.5rem 1.2rem;\n            font-size: 1rem;\n            border-radius: 0.3rem;\n            transition: all 0.25s ease;\n            box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);\n            outline: none;\n            appearance: none;\n            border: none;\n            cursor: pointer;\n        }\n\n        button:hover {\n            background-color: #fff;\n            color: #000;\n            box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);\n            transform: scale(1.05);\n        }\n\n        button:active {\n            background-color: #ddd;\n            color: #333;\n            box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);\n            transform: scale(1);\n        }\n\n        .swiper {\n            height: 200px;\n            margin-bottom: 80px;\n        }\n\n        .swiper-wrap > div {\n            display: flex;\n            justify-content: center;\n            align-items: center;\n            text-align: center;\n            font-size: 48px;\n            color: #fff;\n        }\n\n        .swiper-wrap > div:nth-child(3n) {\n            background-color: skyblue;\n        }\n\n        .swiper-wrap > div:nth-child(3n + 1) {\n            background-color: yellowgreen;\n        }\n\n        .swiper-wrap > div:nth-child(3n + 2) {\n            background-color: rosybrown;\n        }\n\n        #append_child {\n            text-align: center;\n            margin-bottom: 80px;\n        }\n\n        #swiper_children_size {\n            height: 400px;\n        }\n\n        #swiper_children_size .slide-1 {\n            height: 200px;\n        }\n\n        #swiper_children_size .slide-2 {\n            height: 150px;\n        }\n\n        #swiper_children_size .slide-3 {\n            height: 100px;\n        }\n\n        #swiper_children_size .slide-4 {\n            height: 350px;\n        }\n\n        .swiper-nested-inner {\n            width: 100%;\n            height: 100%;\n            margin-bottom: 0;\n        }\n\n\n    </style>\n</head>\n<body v-cloak>\n<h2>vue-swiper demo</h2>\n<h3>Vertical</h3>\n<swiper id=\"swiper_vertical\"\n        :pagination-visible=\"true\"\n        @slide-change-start=\"onSlideChangeStart\"\n        @slide-change-end=\"onSlideChangeEnd\"\n        @slide-revert-start=\"onSlideRevertStart\"\n        @slide-revert-end=\"onSlideRevertEnd\"\n        @slider-move=\"onSliderMove\">\n    <div class=\"slide-1\">↑<br>o<br>↓</div>\n    <div v-for=\"n in [2,3]\">Page {{n}}</div>\n</swiper>\n<h3>Horizontal</h3>\n<swiper id=\"swiper_horizontal\"\n        :pagination-visible=\"true\"\n        direction=\"horizontal\">\n    <div v-for=\"slideText in slides\" track-by=\"$index\">{{slideText}}</div>\n</swiper>\n<h3>Loop Mode / Infinite Loop</h3>\n<swiper id=\"swiper_loop\"\n        :loop=\"true\"\n        :pagination-visible=\"true\"\n        direction=\"horizontal\">\n    <div v-for=\"slideText in slides\" track-by=\"$index\">{{slideText}}</div>\n</swiper>\n<h3>Append Child</h3>\n<div id=\"append_child\">\n    <button @click=\"appendSlide('New Page!')\">Append child to the horizontal slider</button>\n</div>\n<h3>Different children size</h3>\n<swiper id=\"swiper_children_size\">\n    <div class=\"slide-1\">↑<br>o<br>↓</div>\n    <div v-for=\"n in [2,3,4]\" class=\"slide-{{n}}\">Page {{n}}</div>\n</swiper>\n<!-- Nested swiper no supported yet-->\n<!--<h3>Nested</h3>-->\n<!--<swiper id=\"swiper_nested\"-->\n<!--direction=\"horizontal\"-->\n<!--@slide-change-start=\"onSlideChangeStart\"-->\n<!--@slide-change-end=\"onSlideChangeEnd\">-->\n<!--<div class=\"slide-1\">-->\n<!--<swiper class=\"swiper-nested-inner\"-->\n<!--direction=\"vertical\">-->\n<!--<div class=\"slide-1\">1-1</div>-->\n<!--<div class=\"slide-2\">1-2</div>-->\n<!--<div class=\"slide-3\">1-3</div>-->\n<!--</swiper>-->\n<!--</div>-->\n<!--<div class=\"slide-2\">-->\n<!--<swiper class=\"swiper-nested-inner\"-->\n<!--direction=\"vertical\">-->\n<!--<div class=\"slide-1\">2-1</div>-->\n<!--<div class=\"slide-2\">2-2</div>-->\n<!--<div class=\"slide-3\">2-3</div>-->\n<!--</swiper>-->\n<!--</div>-->\n<!--<div class=\"slide-3\">-->\n<!--<swiper class=\"swiper-nested-inner\"-->\n<!--direction=\"vertical\">-->\n<!--<div class=\"slide-1\">3-1</div>-->\n<!--<div class=\"slide-2\">3-2</div>-->\n<!--<div class=\"slide-3\">3-3</div>-->\n<!--</swiper>-->\n<!--</div>-->\n<!--</swiper>-->\n<script src=\"//cdnjs.cloudflare.com/ajax/libs/vue/1.0.24/vue.min.js\"></script>\n<script src=\"../dist/vue-swiper.js\"></script>\n<script>\n    new Vue({\n        el: 'body',\n        components: {swiper: VueSwiper},\n        data: {\n            slides: ['← o →', 'Page 2', 'Page 3']\n        },\n        methods: {\n            onSlideChangeStart: function (currentPage) {\n                console.log('onSlideChangeStart', currentPage);\n            },\n            onSlideChangeEnd: function (currentPage) {\n                console.log('onSlideChangeEnd', currentPage);\n            },\n            onSlideRevertStart: function (currentPage) {\n                console.log('onSlideRevertStart', currentPage);\n            },\n            onSlideRevertEnd: function (currentPage) {\n                console.log('onSlideRevertEnd', currentPage);\n            },\n            onSliderMove: function (offset) {\n                console.log('onSliderMove', offset);\n            },\n            prependSlide: function (slideText) {\n                this.slides.unshift(slideText);\n            },\n            appendSlide: function (slideText) {\n                this.slides.push(slideText);\n            },\n            removeSlide: function () {\n\n            }\n        }\n    });\n</script>\n</body>\n</html>\n"
  },
  {
    "path": "dist/vue-swiper.js",
    "content": "/*!\n * vue-swiper v0.5.0\n * Swiper component. Easy to use.\n * https://github.com/weilao/vue-swiper\n * @author weilao\n */\n!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.VueSwiper=e():t.VueSwiper=e()}(this,function(){return function(t){function e(n){if(i[n])return i[n].exports;var s=i[n]={exports:{},id:n,loaded:!1};return t[n].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var i={};return e.m=t,e.c=i,e.p=\"/\",e(0)}([function(t,e,i){var n,s;i(1),n=i(5),s=i(6),t.exports=n||{},t.exports.__esModule&&(t.exports=t.exports[\"default\"]),s&&((\"function\"==typeof t.exports?t.exports.options||(t.exports.options={}):t.exports).template=s)},function(t,e,i){var n=i(2);\"string\"==typeof n&&(n=[[t.id,n,\"\"]]);i(4)(n,{});n.locals&&(t.exports=n.locals)},function(t,e,i){e=t.exports=i(3)(),e.push([t.id,\".swiper{position:relative;overflow:hidden}.swiper .swiper-wrap{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;height:100%;-webkit-transition:all 0ms ease;transition:all 0ms ease}.swiper .swiper-wrap>div{overflow:hidden;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;width:100%;height:100%}.swiper.horizontal .swiper-wrap{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row}.swiper.vertical .swiper-wrap{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.swiper .swiper-pagination{position:absolute}.swiper .swiper-pagination .swiper-pagination-bullet{width:8px;height:8px;border-radius:50%;background-color:#000;opacity:.2;-webkit-transition:all .5s ease;transition:all .5s ease}.swiper .swiper-pagination .swiper-pagination-bullet.active{background:#007aff;opacity:1}.swiper.vertical .swiper-pagination{right:10px;top:50%;-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.swiper.vertical .swiper-pagination .swiper-pagination-bullet{display:block;margin:6px 0}.swiper.horizontal .swiper-pagination{bottom:10px;width:100%;text-align:center}.swiper.horizontal .swiper-pagination .swiper-pagination-bullet{display:inline-block;margin:0 3px}\",\"\"])},function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e<this.length;e++){var i=this[e];i[2]?t.push(\"@media \"+i[2]+\"{\"+i[1]+\"}\"):t.push(i[1])}return t.join(\"\")},t.i=function(e,i){\"string\"==typeof e&&(e=[[null,e,\"\"]]);for(var n={},s=0;s<this.length;s++){var r=this[s][0];\"number\"==typeof r&&(n[r]=!0)}for(s=0;s<e.length;s++){var o=e[s];\"number\"==typeof o[0]&&n[o[0]]||(i&&!o[2]?o[2]=i:i&&(o[2]=\"(\"+o[2]+\") and (\"+i+\")\"),t.push(o))}},t}},function(t,e,i){function n(t,e){for(var i=0;i<t.length;i++){var n=t[i],s=d[n.id];if(s){s.refs++;for(var r=0;r<s.parts.length;r++)s.parts[r](n.parts[r]);for(;r<n.parts.length;r++)s.parts.push(l(n.parts[r],e))}else{for(var o=[],r=0;r<n.parts.length;r++)o.push(l(n.parts[r],e));d[n.id]={id:n.id,refs:1,parts:o}}}}function s(t){for(var e=[],i={},n=0;n<t.length;n++){var s=t[n],r=s[0],o=s[1],a=s[2],l=s[3],h={css:o,media:a,sourceMap:l};i[r]?i[r].parts.push(h):e.push(i[r]={id:r,parts:[h]})}return e}function r(t,e){var i=f(),n=m[m.length-1];if(\"top\"===t.insertAt)n?n.nextSibling?i.insertBefore(e,n.nextSibling):i.appendChild(e):i.insertBefore(e,i.firstChild),m.push(e);else{if(\"bottom\"!==t.insertAt)throw new Error(\"Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.\");i.appendChild(e)}}function o(t){t.parentNode.removeChild(t);var e=m.indexOf(t);e>=0&&m.splice(e,1)}function a(t){var e=document.createElement(\"style\");return e.type=\"text/css\",r(t,e),e}function l(t,e){var i,n,s;if(e.singleton){var r=v++;i=g||(g=a(e)),n=h.bind(null,i,r,!1),s=h.bind(null,i,r,!0)}else i=a(e),n=u.bind(null,i),s=function(){o(i)};return n(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;n(t=e)}else s()}}function h(t,e,i,n){var s=i?\"\":n.css;if(t.styleSheet)t.styleSheet.cssText=w(e,s);else{var r=document.createTextNode(s),o=t.childNodes;o[e]&&t.removeChild(o[e]),o.length?t.insertBefore(r,o[e]):t.appendChild(r)}}function u(t,e){var i=e.css,n=e.media,s=e.sourceMap;if(n&&t.setAttribute(\"media\",n),s&&(i+=\"\\n/*# sourceURL=\"+s.sources[0]+\" */\",i+=\"\\n/*# sourceMappingURL=data:application/json;base64,\"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+\" */\"),t.styleSheet)t.styleSheet.cssText=i;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(i))}}var d={},c=function(t){var e;return function(){return\"undefined\"==typeof e&&(e=t.apply(this,arguments)),e}},p=c(function(){return/msie [6-9]\\b/.test(window.navigator.userAgent.toLowerCase())}),f=c(function(){return document.head||document.getElementsByTagName(\"head\")[0]}),g=null,v=0,m=[];t.exports=function(t,e){e=e||{},\"undefined\"==typeof e.singleton&&(e.singleton=p()),\"undefined\"==typeof e.insertAt&&(e.insertAt=\"bottom\");var i=s(t);return n(i,e),function(t){for(var r=[],o=0;o<i.length;o++){var a=i[o],l=d[a.id];l.refs--,r.push(l)}if(t){var h=s(t);n(h,e)}for(var o=0;o<r.length;o++){var l=r[o];if(0===l.refs){for(var u=0;u<l.parts.length;u++)l.parts[u]();delete d[l.id]}}}};var w=function(){var t=[];return function(e,i){return t[e]=i,t.filter(Boolean).join(\"\\n\")}}()},function(t,e){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var i=\"vertical\",n=\"horizontal\";e[\"default\"]={props:{direction:{type:String,\"default\":i,validator:function(t){return[i,n].indexOf(t)>-1}},mousewheelControl:{type:Boolean,\"default\":!0},performanceMode:{type:Boolean,\"default\":!1},paginationVisible:{type:Boolean,\"default\":!1},paginationClickable:{type:Boolean,\"default\":!1},loop:{type:Boolean,\"default\":!1},speed:{type:Number,\"default\":500}},data:function(){return{currentPage:1,lastPage:1,translateX:0,translateY:0,startTranslate:0,delta:0,dragging:!1,startPos:null,transitioning:!1,slideEls:[],translateOffset:0,transitionDuration:0}},ready:function(){this._onTouchMove=this._onTouchMove.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this.slideEls=[].map.call(this.$els.swiperWrap.children,function(t){return t}),this.loop?this.$nextTick(function(){this._createLoop(),this.setPage(this.currentPage,!0)}):this.setPage(this.currentPage)},methods:{next:function(){var t=this.currentPage;t<this.slideEls.length||this.loop?this.setPage(t+1):this._revert()},prev:function(){var t=this.currentPage;t>1||this.loop?this.setPage(t-1):this._revert()},setPage:function(t,e){var i=this;if(this.lastPage=this.currentPage,0===t?this.currentPage=this.slideEls.length:t===this.slideEls.length+1?this.currentPage=1:this.currentPage=t,this.loop)0===this.delta&&this._setTranslate(i._getTranslateOfPage(this.lastPage)),setTimeout(function(){i._setTranslate(i._getTranslateOfPage(t)),e||i._onTransitionStart()},0);else{if(this._setTranslate(this._getTranslateOfPage(t)),e)return;this._onTransitionStart()}},isHorizontal:function(){return this.direction===n},isVertical:function(){return this.direction===i},_onTouchStart:function(t){this.startPos=this._getTouchPos(t),this.delta=0,this.startTranslate=this._getTranslateOfPage(this.currentPage),this.startTime=(new Date).getTime(),this.dragging=!0,this.transitionDuration=0,document.addEventListener(\"touchmove\",this._onTouchMove,!1),document.addEventListener(\"touchend\",this._onTouchEnd,!1),document.addEventListener(\"mousemove\",this._onTouchMove,!1),document.addEventListener(\"mouseup\",this._onTouchEnd,!1)},_onTouchMove:function(t){this.delta=this._getTouchPos(t)-this.startPos,this.performanceMode||(this._setTranslate(this.startTranslate+this.delta),this.$emit(\"slider-move\",this._getTranslate())),(this.isVertical()||this.isHorizontal()&&Math.abs(this.delta)>0)&&t.preventDefault()},_onTouchEnd:function(t){this.dragging=!1,this.transitionDuration=this.speed;var e=(new Date).getTime()-this.startTime<1e3;this.delta<-100||e&&this.delta<-15?this.next():this.delta>100||e&&this.delta>15?this.prev():this._revert(),document.removeEventListener(\"touchmove\",this._onTouchMove),document.removeEventListener(\"touchend\",this._onTouchEnd),document.removeEventListener(\"mousemove\",this._onTouchMove),document.removeEventListener(\"mouseup\",this._onTouchEnd)},_onWheel:function(t){this.mousewheelControl&&(this.transitioning||(t.deltaY>0?this.next():this.prev()),this._isPageChanged()&&t.preventDefault())},_revert:function(){this.setPage(this.currentPage)},_getTouchPos:function(t){var e=this.isHorizontal()?\"pageX\":\"pageY\";return t.changedTouches?t.changedTouches[0][e]:t[e]},_onTransitionStart:function(){this.transitioning=!0,this.transitionDuration=this.speed,this._isPageChanged()?this.$emit(\"slide-change-start\",this.currentPage):this.$emit(\"slide-revert-start\",this.currentPage)},_onTransitionEnd:function(){this.transitioning=!1,this.transitionDuration=0,this.delta=0,this._isPageChanged()?this.$emit(\"slide-change-end\",this.currentPage):this.$emit(\"slide-revert-end\",this.currentPage)},_isPageChanged:function(){return this.lastPage!==this.currentPage},_setTranslate:function(t){var e=this.isHorizontal()?\"translateX\":\"translateY\";this[e]=t},_getTranslate:function(){var t=this.isHorizontal()?\"translateX\":\"translateY\";return this[t]},_getTranslateOfPage:function(t){if(0===t)return 0;var e=this.isHorizontal()?\"clientWidth\":\"clientHeight\";return-[].reduce.call(this.slideEls,function(i,n,s){return s>t-2?i:i+n[e]},0)+this.translateOffset},_createLoop:function(){var t=this.isHorizontal()?\"clientWidth\":\"clientHeight\",e=this.$els.swiperWrap,i=e.firstElementChild.cloneNode(!0),n=e.lastElementChild.cloneNode(!0);e.insertBefore(n,e.firstElementChild),e.appendChild(i),this.translateOffset=-n[t]}}}},function(t,e){t.exports=\"<div class=swiper :class=\\\"[direction, {'dragging': dragging}]\\\" @touchstart=_onTouchStart @mousedown=_onTouchStart @wheel=_onWheel> <div class=swiper-wrap v-el:swiper-wrap :style=\\\"{\\n            'transform' : 'translate3d(' + translateX + 'px,' + translateY + 'px, 0)',\\n            'transition-duration': transitionDuration + 'ms'\\n         }\\\" @transitionend=_onTransitionEnd> <slot></slot> </div> <div class=swiper-pagination v-show=paginationVisible> <span class=swiper-pagination-bullet :class=\\\"{'active': $index+1===currentPage}\\\" v-for=\\\"slide in slideEls\\\" @click=\\\"paginationClickable && setPage($index+1)\\\"></span> </div> </div>\"}])});"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"vue-swiper\",\n  \"version\": \"0.5.0\",\n  \"description\": \"Swiper component. Easy to use.\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/weilao/vue-swiper.git\"\n  },\n  \"author\": \"weilao\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/weilao/vue-swiper/issues\"\n  },\n  \"homepage\": \"https://github.com/weilao/vue-swiper\",\n  \"main\": \"dist/vue-swiper.js\",\n  \"scripts\": {\n    \"dev\": \"NODE_ENV=dev webpack-dev-server --inline --hot --host 0.0.0.0 --config webpack.config.js\",\n    \"build\": \"webpack\"\n  },\n  \"devDependencies\": {\n    \"autoprefixer\": \"^6.3.6\",\n    \"babel-core\": \"^6.8.0\",\n    \"babel-loader\": \"^6.2.4\",\n    \"babel-plugin-transform-runtime\": \"^6.8.0\",\n    \"babel-preset-es2015\": \"^6.6.0\",\n    \"babel-runtime\": \"^6.6.1\",\n    \"css-loader\": \"^0.23.1\",\n    \"less\": \"^2.7.0\",\n    \"less-loader\": \"^2.2.3\",\n    \"vue-hot-reload-api\": \"^1.3.2\",\n    \"vue-html-loader\": \"^1.2.2\",\n    \"vue-loader\": \"^8.3.1\",\n    \"vue-style-loader\": \"^1.0.0\",\n    \"webpack\": \"^1.13.0\",\n    \"webpack-dev-server\": \"^1.14.1\"\n  }\n}\n"
  },
  {
    "path": "src/vue-swiper.less",
    "content": ".swiper {\n  position: relative;\n  overflow: hidden;\n\n  .swiper-wrap {\n    display: flex;\n    width: 100%;\n    height: 100%;\n    transition: all 0ms ease;\n\n    > div {\n      overflow: hidden;\n      flex-shrink: 0;\n      width: 100%;\n      height: 100%;\n    }\n  }\n\n  &.horizontal .swiper-wrap {\n    flex-direction: row;\n  }\n\n  &.vertical .swiper-wrap {\n    flex-direction: column;\n  }\n\n  .swiper-pagination {\n    position: absolute;\n\n    .swiper-pagination-bullet {\n      width: 8px;\n      height: 8px;\n      border-radius: 50%;\n      background-color: #000000;\n      opacity: .2;\n      transition: all .5s ease;\n    }\n\n    .swiper-pagination-bullet.active {\n      background: #007aff;\n      opacity: 1;\n    }\n  }\n\n  &.vertical .swiper-pagination {\n    right: 10px;\n    top: 50%;\n    transform: translate3d(0, -50%, 0);\n\n    .swiper-pagination-bullet {\n      display: block;\n      margin: 6px 0;\n    }\n  }\n\n  &.horizontal .swiper-pagination {\n    bottom: 10px;\n    width: 100%;\n    text-align: center;\n\n    .swiper-pagination-bullet {\n      display: inline-block;\n      margin: 0 3px;\n    }\n  }\n}\n"
  },
  {
    "path": "src/vue-swiper.vue",
    "content": "<template>\n    <div class=\"swiper\"\n         :class=\"[direction, {'dragging': dragging}]\"\n         @touchstart=\"_onTouchStart\"\n         @mousedown=\"_onTouchStart\"\n         @wheel=\"_onWheel\">\n        <div class=\"swiper-wrap\"\n             v-el:swiper-wrap\n             :style=\"{\n                'transform' : 'translate3d(' + translateX + 'px,' + translateY + 'px, 0)',\n                'transition-duration': transitionDuration + 'ms'\n             }\"\n             @transitionend=\"_onTransitionEnd\">\n            <slot></slot>\n        </div>\n        <div class=\"swiper-pagination\"\n             v-show=\"paginationVisible\">\n            <span class=\"swiper-pagination-bullet\"\n                  :class=\"{'active': $index+1===currentPage}\"\n                  v-for=\"slide in slideEls\"\n                  @click=\"paginationClickable && setPage($index+1)\"></span>\n        </div>\n    </div>\n</template>\n<style lang=\"less\" src=\"./vue-swiper.less\"></style>\n<script type=\"text/babel\">\n    const VERTICAL = 'vertical';\n    const HORIZONTAL = 'horizontal';\n\n    export default {\n        props: {\n            direction: {\n                type: String,\n                default: VERTICAL,\n                validator: (value) => [VERTICAL, HORIZONTAL].indexOf(value) > -1\n            },\n            mousewheelControl: {\n                type: Boolean,\n                default: true\n            },\n            performanceMode: {\n                type: Boolean,\n                default: false\n            },\n            paginationVisible: {\n                type: Boolean,\n                default: false\n            },\n            paginationClickable: {\n                type: Boolean,\n                default: false\n            },\n            loop: {\n                type: Boolean,\n                default: false\n            },\n            speed: {\n                type: Number,\n                default: 500\n            }\n        },\n        data() {\n            return {\n                currentPage: 1,\n                lastPage: 1,\n                translateX: 0,\n                translateY: 0,\n                startTranslate: 0,\n                delta: 0,\n                dragging: false,\n                startPos: null,\n                transitioning: false,\n                slideEls: [],\n                translateOffset: 0,\n                transitionDuration: 0\n            };\n        },\n        ready() {\n            this._onTouchMove = this._onTouchMove.bind(this);\n            this._onTouchEnd = this._onTouchEnd.bind(this);\n            this.slideEls = [].map.call(this.$els.swiperWrap.children, el => el);\n            if (this.loop) {\n                this.$nextTick(function () {\n                    this._createLoop();\n                    this.setPage(this.currentPage, true);\n                });\n            } else {\n                this.setPage(this.currentPage);\n            }\n        },\n        methods: {\n            next() {\n                var page = this.currentPage;\n                if (page < this.slideEls.length || this.loop) {\n                    this.setPage(page + 1);\n                } else {\n                    this._revert();\n                }\n            },\n            prev() {\n                var page = this.currentPage;\n                if (page > 1 || this.loop) {\n                    this.setPage(page - 1);\n                } else {\n                    this._revert();\n                }\n            },\n            setPage(page, noAnimation) {\n                var self = this;\n                this.lastPage = this.currentPage;\n                if (page === 0) {\n                    this.currentPage = this.slideEls.length;\n                } else if (page === this.slideEls.length + 1) {\n                    this.currentPage = 1;\n                } else {\n                    this.currentPage = page;\n                }\n\n                if (this.loop) {\n                    if (this.delta === 0) {\n                        this._setTranslate(self._getTranslateOfPage(this.lastPage));\n                    }\n                    setTimeout(function () {\n                        self._setTranslate(self._getTranslateOfPage(page));\n                        if (noAnimation) return;\n                        self._onTransitionStart();\n                    }, 0);\n                } else {\n                    this._setTranslate(this._getTranslateOfPage(page));\n                    if (noAnimation) return;\n                    this._onTransitionStart();\n                }\n            },\n            isHorizontal() {\n                return this.direction === HORIZONTAL;\n            },\n            isVertical() {\n                return this.direction === VERTICAL;\n            },\n            _onTouchStart(e) {\n                this.startPos = this._getTouchPos(e);\n                this.delta = 0;\n                this.startTranslate = this._getTranslateOfPage(this.currentPage);\n                this.startTime = new Date().getTime();\n                this.dragging = true;\n                this.transitionDuration = 0;\n\n                document.addEventListener('touchmove', this._onTouchMove, false);\n                document.addEventListener('touchend', this._onTouchEnd, false);\n                document.addEventListener('mousemove', this._onTouchMove, false);\n                document.addEventListener('mouseup', this._onTouchEnd, false);\n            },\n            _onTouchMove(e) {\n                this.delta = this._getTouchPos(e) - this.startPos;\n\n                if (!this.performanceMode) {\n                    this._setTranslate(this.startTranslate + this.delta);\n                    this.$emit('slider-move', this._getTranslate());\n                }\n\n                if (this.isVertical() || this.isHorizontal() && Math.abs(this.delta) > 0) {\n                    e.preventDefault();\n                }\n            },\n            _onTouchEnd(e) {\n                if (this.delta === 0) {\n                    return;\n                }\n                \n                this.dragging = false;\n                this.transitionDuration = this.speed;\n                var isQuickAction = new Date().getTime() - this.startTime < 1000;\n                if (this.delta < -100 || (isQuickAction && this.delta < -15)) {\n                    this.next();\n                } else if (this.delta > 100 || (isQuickAction && this.delta > 15)) {\n                    this.prev();\n                } else {\n                    this._revert();\n                }\n\n                document.removeEventListener('touchmove', this._onTouchMove);\n                document.removeEventListener('touchend', this._onTouchEnd);\n                document.removeEventListener('mousemove', this._onTouchMove);\n                document.removeEventListener('mouseup', this._onTouchEnd);\n            },\n            _onWheel(e) {\n                if (this.mousewheelControl) {\n                    // TODO Support apple magic mouse and trackpad.\n                    if (!this.transitioning) {\n                        if (e.deltaY > 0) {\n                            this.next();\n                        } else {\n                            this.prev();\n                        }\n                    }\n                    if (this._isPageChanged()) e.preventDefault();\n\n                }\n            },\n            _revert() {\n                this.setPage(this.currentPage);\n            },\n            _getTouchPos(e) {\n                var key = this.isHorizontal() ? 'pageX' : 'pageY';\n                return e.changedTouches ? e.changedTouches[0][key] : e[key];\n            },\n            _onTransitionStart() {\n                this.transitioning = true;\n                this.transitionDuration = this.speed;\n                if (this._isPageChanged()) {\n                    this.$emit('slide-change-start', this.currentPage);\n                } else {\n                    this.$emit('slide-revert-start', this.currentPage);\n                }\n            },\n            _onTransitionEnd() {\n                this.transitioning = false;\n                this.transitionDuration = 0;\n                this.delta = 0;\n                if (this._isPageChanged()) {\n                    this.$emit('slide-change-end', this.currentPage);\n                } else {\n                    this.$emit('slide-revert-end', this.currentPage);\n                }\n            },\n            _isPageChanged() {\n                return this.lastPage !== this.currentPage;\n            },\n            _setTranslate(value) {\n                var translateName = this.isHorizontal() ? 'translateX' : 'translateY';\n                this[translateName] = value;\n            },\n            _getTranslate(){\n                var translateName = this.isHorizontal() ? 'translateX' : 'translateY';\n                return this[translateName];\n            },\n            _getTranslateOfPage(page) {\n                if (page === 0) return 0;\n\n                var propName = this.isHorizontal() ? 'clientWidth' : 'clientHeight';\n                return -[].reduce.call(this.slideEls, function (total, el, i) {\n                        return i > page - 2 ? total : total + el[propName];\n                    }, 0) + this.translateOffset;\n            },\n            _createLoop() {\n                var propName = this.isHorizontal() ? 'clientWidth' : 'clientHeight';\n                var swiperWrapEl = this.$els.swiperWrap;\n                var duplicateFirstChild = swiperWrapEl.firstElementChild.cloneNode(true);\n                var duplicateLastChild = swiperWrapEl.lastElementChild.cloneNode(true);\n                swiperWrapEl.insertBefore(duplicateLastChild, swiperWrapEl.firstElementChild);\n                swiperWrapEl.appendChild(duplicateFirstChild);\n                this.translateOffset = -duplicateLastChild[propName];\n            }\n        }\n    };\n</script>\n"
  },
  {
    "path": "webpack.config.js",
    "content": "var path = require('path');\nvar webpack = require('webpack');\nvar autoprefixer = require('autoprefixer');\nvar pkg = require('./package.json');\nvar banner = `${pkg.name} v${pkg.version}\\n${pkg.description}\\n${pkg.homepage}\\n@author ${pkg.author}`;\nmodule.exports = {\n    entry: {\n        'vue-swiper': path.join(__dirname, 'src/vue-swiper.vue')\n    },\n    output: {\n        path: path.join(__dirname, 'dist'),\n        publicPath: '/',\n        library: 'VueSwiper',\n        libraryTarget: 'umd',\n        filename: \"[name].js\"\n    },\n    module: {\n        loaders: [\n            {test: /\\.js$/, loader: 'babel', exclude: /node_modules/},\n            {test: /\\.vue$/, loader: 'vue'},\n            {test: /\\.less$/, loader: \"css?sourceMap!postcss!less?sourceMap\"}\n        ]\n    },\n    postcss: [autoprefixer({browsers: ['last 2 versions', 'Android 2.3']})],\n    babel: {\n        \"presets\": [\"es2015\"]\n    },\n    plugins: []\n};\n\nif (process.env.NODE_ENV === 'dev') {\n    module.exports.devtool = '#eval-source-map';\n} else {\n    module.exports.plugins.push(new webpack.optimize.UglifyJsPlugin());\n    module.exports.plugins.push(new webpack.BannerPlugin(banner));\n}\n"
  }
]