UNPKG

w-ui

Version:

A Vue.js 2.0 UI Toolkit for mobile

1 lines 3.84 kB
module.exports=function(t){function e(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var o={};return e.m=t,e.c=o,e.d=function(t,o,n){e.o(t,o)||Object.defineProperty(t,o,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=347)}({0:function(t,e){t.exports=function(t,e,o,n,r,i){var s,c=t=t||{},u=typeof t.default;"object"!==u&&"function"!==u||(s=t,c=t.default);var l="function"==typeof c?c.options:c;e&&(l.render=e.render,l.staticRenderFns=e.staticRenderFns,l._compiled=!0),o&&(l.functional=!0),r&&(l._scopeId=r);var d;if(i?(d=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},l._ssrRegister=d):n&&(d=n),d){var a=l.functional,h=a?l.render:l.beforeCreate;a?(l._injectStyles=d,l.render=function(t,e){return d.call(e),h(t,e)}):l.beforeCreate=h?[].concat(h,d):[d]}return{esModule:s,exports:c,options:l}}},312:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"body-scroll",data:function(){return{startY:0,startX:0,bodyHeight:0,maxScrollTop:0,scrollTop:0}},methods:{onTouchstart:function(t){var e=t.touches?t.touches[0]:t;this.startY=e.clientY,this.startX=e.clientX,this.scrollTop=document.documentElement.scrollTop||document.body.scrollTop,this.maxScrollTop=this.bodyHeight-window.innerHeight-this.barHight,t.preventDefault()},onTouchmove:function(t){var e=t.touches?t.touches[0]:t,o=e.clientX-this.startX,n=e.clientY-this.startY;if(Math.abs(n)>Math.abs(o)){t.preventDefault(),t.stopPropagation();var r=this.scrollTop-n;r>this.maxScrollTop&&(r=this.maxScrollTop),document.documentElement.scrollTop=r,document.body.scrollTop=r,this.maxScrollTop-r<=3?this.$emit("stickyChange",!0):this.$emit("stickyChange",!1)}},onTouchend:function(t){this.logDom.innerHTML+="<p>touchEnd:"+Date.now()+"</p>",this.logDom.scrollTop=999999999,this.maxScrollTop=this.bodyHeight-window.innerHeight-this.barHight;var e=document.documentElement.scrollTop||document.body.scrollTop;e>this.maxScrollTop&&(e=this.maxScrollTop),document.documentElement.scrollTop=e,document.body.scrollTop=e,this.maxScrollTop-e<=3?this.$emit("stickyChange",!0):this.$emit("stickyChange",!1)}},mounted:function(){var t=this;this.barHight=0,this.logDom=document.querySelector(".log"),this.$nextTick(function(){t.bodyHeight=document.body.offsetHeight,window.addEventListener("touchend",t.onTouchend,!1),window.addEventListener("mouseup",t.onTouchend,!1),window.addEventListener("scroll",t.onTouchend,!1)})},destroyed:function(){window.removeEventListener("touchend",this.onTouchend,!1),window.removeEventListener("mouseup",this.onTouchend,!1)}}},347:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IndexPicker=void 0;var n=o(348),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.IndexPicker=r.default},348:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(312),r=o.n(n);for(var i in n)"default"!==i&&function(t){o.d(e,t,function(){return n[t]})}(i);var s=o(349),c=o(0),u=c(r.a,s.a,!1,null,null,null);u.options.__file="packages/index-picker/src/indexpicker.vue",e.default=u.exports},349:function(t,e,o){"use strict";var n=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{ref:"scrollbody",on:{touchstart:t.onTouchstart,mousedown:t.onTouchstart,touchmove:t.onTouchmove,mousemove:t.onTouchmove}},[t._t("default")],2)},r=[];n._withStripped=!0;var i={render:n,staticRenderFns:r};e.a=i}});