46.11455b40.js 9.8 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([[46],{443:function(e,t,n){"use strict";var r=n(435),o=function(){function e(e){this.ancestors=[],this.descendants=[],this.hooksManager=[],this.analyzed=!1,this.selfScroll=e}return e.create=function(t){return new e(t)},e.prototype.hasAncestors=function(e){return Object(r.u)(this.ancestors,(function(t){return t[0]===e}))>-1},e.prototype.hasDescendants=function(e){return Object(r.u)(this.descendants,(function(t){return t[0]===e}))>-1},e.prototype.addAncestor=function(e,t){var n=this.ancestors;n.push([e,t]),n.sort((function(e,t){return e[1]-t[1]}))},e.prototype.addDescendant=function(e,t){var n=this.descendants;n.push([e,t]),n.sort((function(e,t){return e[1]-t[1]}))},e.prototype.removeAncestor=function(e){var t=this.ancestors;if(t.length){var n=Object(r.u)(this.ancestors,(function(t){return t[0]===e}));if(n>-1)return t.splice(n,1)}},e.prototype.removeDescendant=function(e){var t=this.descendants;if(t.length){var n=Object(r.u)(this.descendants,(function(t){return t[0]===e}));if(n>-1)return t.splice(n,1)}},e.prototype.registerHooks=function(e,t,n){e.on(t,n),this.hooksManager.push([e,t,n])},e.prototype.setAnalyzed=function(e){void 0===e&&(e=!1),this.analyzed=e},e.prototype.purge=function(){var e=this;this.ancestors.forEach((function(t){t[0].removeDescendant(e)})),this.descendants.forEach((function(t){t[0].removeAncestor(e)})),this.hooksManager.forEach((function(e){var t=e[0],n=e[1],r=e[2];t.off(n,r)})),this.hooksManager=[]},e}(),l=[{key:"purgeNestedScroll",name:"purgeNestedScroll"}].map((function(e){return{key:e.key,sourceKey:"plugins.nestedScroll."+e.name}})),s=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var l=arguments[t],s=0,i=l.length;s<i;s++,o++)r[o]=l[s];return r},i=function(e){e.forEach((function(e){e.enable()}))},c=function(e,t){e.forEach((function(e){e.hasHorizontalScroll!==t.hasHorizontalScroll&&e.hasVerticalScroll!==t.hasVerticalScroll||e.disable()}))},a=function(e,t){for(var n=0,r=e.parentNode;r&&r!==t;)n++,r=r.parentNode;return n},u=function(){function e(t){var n=this.handleOptions(t),r=e.instancesMap[n];return r||((r=e.instancesMap[n]=this).store=[],r.hooksFn=[]),r.init(t),r}return e.getAllNestedScrolls=function(){var t=e.instancesMap;return Object.keys(t).map((function(e){return t[e]}))},e.purgeAllNestedScrolls=function(){e.getAllNestedScrolls().forEach((function(e){return e.purgeNestedScroll()}))},e.prototype.handleOptions=function(e){var t=!0===e.options.nestedScroll?{}:e.options.nestedScroll,n={groupId:"INTERNAL_NESTED_SCROLL"};this.options=Object(r.t)(n,t);var o=typeof this.options.groupId;return"string"!==o&&"number"!==o&&Object(r.S)("groupId must be string or number for NestedScroll plugin"),this.options.groupId},e.prototype.init=function(e){e.proxy(l),this.addBScroll(e),this.buildBScrollGraph(),this.analyzeBScrollGraph(),this.ensureEventInvokeSequence(),this.handleHooks(e)},e.prototype.handleHooks=function(e){var t=this;this.registerHooks(e.hooks,e.hooks.eventTypes.destroy,(function(){t.deleteScroll(e)}))},e.prototype.deleteScroll=function(e){e.wrapper.isBScrollContainer=void 0;var t=this.store,n=this.hooksFn,o=Object(r.u)(t,(function(t){return t.selfScroll===e}));o>-1&&(t[o].purge(),t.splice(o,1));var l=Object(r.u)(n,(function(t){return t[0]===e.hooks}));if(l>-1){var s=n[l],i=s[0],c=s[1],a=s[2];i.off(c,a),n.splice(l,1)}},e.prototype.addBScroll=function(e){this.store.push(o.create(e))},e.prototype.buildBScrollGraph=function(){for(var e,t,n,r,o=this.store,l=this.store.length,s=0;s<l;s++){n=(e=o[s]).selfScroll.wrapper;for(var i=0;i<l;i++)if(r=(t=o[i]).selfScroll.wrapper,e!==t&&n.contains(r)){var c=a(r,n);e.hasDescendants(t)||e.addDescendant(t,c),t.hasAncestors(e)||t.addAncestor(e,c)}}},e.prototype.analyzeBScrollGraph=function(){this.store.forEach((function(e){if(!e.analyzed){var t=e.ancestors,n=e.descendants,o=e.selfScroll;e.registerHooks(o,o.eventTypes.beforeScrollStart,(function(){var e,r,l,i,a,u,d,f,h,p,S=t.map((function(e){return e[0].selfScroll})),v=n.map((function(e){return e[0].selfScroll}));s(S,v).forEach((function(e){e.pending&&(e.stop(),e.resetPosition())})),r=(e=o).hasHorizontalScroll,l=e.hasVerticalScroll,i=e.x,a=e.y,u=e.minScrollX,d=e.maxScrollX,f=e.minScrollY,h=e.maxScrollY,p=!1,l?p=a>f||a<h:r&&(p=i>u||i<d),p&&function(e){e.scroller.reflow(),e.resetPosition(0)}(o),function(e){e.forEach((function(e){var t=e.scroller,n=t.actions,r=t.scrollBehaviorX,o=t.scrollBehaviorY;n.fingerMoved=!0,n.contentMoved=!1,n.directionLockAction.reset(),r.start(),o.start(),r.resetStartPos(),o.resetStartPos(),n.startTime=+new Date}))}(S),c(S,o)})),e.registerHooks(o,o.eventTypes.touchEnd,(function(){var e=t.map((function(e){return e[0].selfScroll})),r=n.map((function(e){return e[0].selfScroll}));i(s(e,r))}));var l=o.scroller.actions.hooks;e.registerHooks(l,l.eventTypes.detectMovingDirection,(function(){var e,n,l,s,a,u,d,f,h,p,S,v,m,k,g,y,b=t.map((function(e){return e[0].selfScroll})),C=b[0],w=b.slice(1),E=o.scroller.actions.contentMoved,D=0===b.length;if(E)c(b,o);else if(!D&&(n=(e=o).hasHorizontalScroll,l=e.hasVerticalScroll,s=e.x,a=e.y,u=e.minScrollX,d=e.maxScrollX,f=e.minScrollY,h=e.maxScrollY,p=e.movingDirectionX,S=e.movingDirectionY,v=!1,m=s>=u&&p===r.b.Negative,k=s<=d&&p===r.b.Positive,g=a>=f&&S===r.b.Negative,y=a<=h&&S===r.b.Positive,l?v=g||y:n&&(v=m||k),v))return c([o],o),C&&i([C]),c(w,o),!0})),e.setAnalyzed(!0)}}))},e.prototype.ensureEventInvokeSequence=function(){this.store.slice().sort((function(e,t){return e.descendants.length-t.descendants.length})).forEach((function(e){e.selfScroll.scroller.actionsHandler.rebindDOMEvents()}))},e.prototype.registerHooks=function(e,t,n){e.on(t,n,this),this.hooksFn.push([e,t,n])},e.prototype.purgeNestedScroll=function(){var t=this.options.groupId;this.store.forEach((function(e){e.purge()})),this.store=[],this.hooksFn.forEach((function(e){var t=e[0],n=e[1],r=e[2];t.off(n,r)})),this.hooksFn=[],delete e.instancesMap[t]},e.pluginName="nestedScroll",e.instancesMap={},e}();t.a=u},536:function(e,t,n){},699:function(e,t,n){"use strict";n(536)},760:function(e,t,n){"use strict";n.r(t);var r=n(436),o=n(443);r.a.use(o.a);var l=["----Outer Start----","๐Ÿ‘†๐Ÿป outer scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿ™‚ ๐Ÿค” ๐Ÿ˜„ ๐Ÿคจ ๐Ÿ˜ ๐Ÿ™ƒ ","๐Ÿ‘†๐Ÿป outer scroll ๐Ÿ‘‡๐Ÿป "],s=["๐Ÿ‘†๐Ÿป outer scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿ™‚ ๐Ÿค” ๐Ÿ˜„ ๐Ÿคจ ๐Ÿ˜ ๐Ÿ™ƒ ","๐Ÿ‘†๐Ÿป outer scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿ˜” ๐Ÿ˜• ๐Ÿ™ƒ ๐Ÿค‘ ๐Ÿ˜ฒ ๐Ÿ˜ฒ ","๐Ÿ™‚ ๐Ÿค” ๐Ÿ˜„ ๐Ÿคจ ๐Ÿ˜ ๐Ÿ™ƒ ","๐Ÿ‘†๐Ÿป outer scroll ๐Ÿ‘‡๐Ÿป ","----Outer End----"],i=["----Middle Start----","๐Ÿ‘†๐Ÿป middle scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿฃ ๐Ÿฃ ๐Ÿฃ ๐Ÿฃ ๐Ÿฃ ๐Ÿฃ "],c=["๐Ÿ‘†๐Ÿป middle scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿค“ ๐Ÿค“ ๐Ÿค“ ๐Ÿค“ ๐Ÿค“ ๐Ÿค“ ","๐Ÿ‘†๐Ÿป middle scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿฆ” ๐Ÿฆ” ๐Ÿฆ” ๐Ÿฆ” ๐Ÿฆ” ๐Ÿฆ” ","๐Ÿ‘†๐Ÿป middle scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿ™ˆ ๐Ÿ™ˆ ๐Ÿ™ˆ ๐Ÿ™ˆ ๐Ÿ™ˆ ๐Ÿ™ˆ ","๐Ÿ‘†๐Ÿป middle scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿš– ๐Ÿš– ๐Ÿš– ๐Ÿš– ๐Ÿš– ๐Ÿš– ","๐Ÿ‘†๐Ÿป middle scroll ๐Ÿ‘‡๐Ÿป ","โœŒ๐Ÿป โœŒ๐Ÿป โœŒ๐Ÿป โœŒ๐Ÿป โœŒ๐Ÿป โœŒ๐Ÿป ","----Middle End----"],a=["------Inner Start-----","๐Ÿ˜€ ๐Ÿ˜ ๐Ÿ˜‚ ๐Ÿคฃ ๐Ÿ˜ƒ ๐Ÿ™ƒ ","๐Ÿ‘†๐Ÿป inner scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿ™‚ ๐Ÿค” ๐Ÿ˜„ ๐Ÿคจ ๐Ÿ˜ ๐Ÿ™ƒ ","๐Ÿ‘†๐Ÿป inner scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿ˜” ๐Ÿ˜• ๐Ÿ™ƒ ๐Ÿค‘ ๐Ÿ˜ฒ ๐Ÿ˜ ๐Ÿ™ƒ ","๐Ÿ‘†๐Ÿป inner scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿฃ ๐Ÿฃ ๐Ÿฃ ๐Ÿฃ ๐Ÿฃ ๐Ÿฃ ","๐Ÿ‘†๐Ÿป inner scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿฅ ๐Ÿฅ ๐Ÿฅ ๐Ÿฅ ๐Ÿฅ ๐Ÿฅ ","๐Ÿ‘†๐Ÿป inner scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿค“ ๐Ÿค“ ๐Ÿค“ ๐Ÿค“ ๐Ÿค“ ๐Ÿค“ ","๐Ÿ‘†๐Ÿป inner scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿฆ” ๐Ÿฆ” ๐Ÿฆ” ๐Ÿฆ” ๐Ÿฆ” ๐Ÿฆ” ","๐Ÿ‘†๐Ÿป inner scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿ™ˆ ๐Ÿ™ˆ ๐Ÿ™ˆ ๐Ÿ™ˆ ๐Ÿ™ˆ ๐Ÿ™ˆ ","๐Ÿ‘†๐Ÿป inner scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿš– ๐Ÿš– ๐Ÿš– ๐Ÿš– ๐Ÿš– ๐Ÿš– ","๐Ÿ‘†๐Ÿป inner scroll ๐Ÿ‘‡๐Ÿป ","โœŒ๐Ÿป โœŒ๐Ÿป โœŒ๐Ÿป โœŒ๐Ÿป โœŒ๐Ÿป โœŒ๐Ÿป ","-----Inner End-----"],u={data:function(){return{outerOpenData:l,outerCloseData:s,middleOpenData:i,middleCloseData:c,innerData:a}},mounted:function(){this.initBScroll()},beforeDestroy:function(){this.outerScroll.destroy(),this.middleScroll.destroy(),this.innerScroll.destroy()},methods:{handleOuterClick:function(){window.alert("clicked outer item")},handleMiddleClick:function(){window.alert("clicked middle item")},handleInnerClick:function(){window.alert("clicked inner item")},initBScroll:function(){this.outerScroll=this.outerScroll=new r.a(this.$refs.outerScroll,{nestedScroll:{groupId:"triple-nested-scroll"},click:!0}),this.innerScroll=new r.a(this.$refs.innerScroll,{nestedScroll:{groupId:"triple-nested-scroll"},probeType:2,click:!0}),this.innerScroll.on("scroll",(function(){console.log("innerScroll scroll")})),this.innerScroll.on("scrollEnd",(function(){console.log("innerScroll scrollEnd")})),this.middleScroll=new r.a(this.$refs.middleScroll,{nestedScroll:{groupId:"triple-nested-scroll"},probeType:2,click:!0}),this.middleScroll.on("scroll",(function(){console.log("middleScroll scroll")}))}}},d=(n(699),n(41)),f=Object(d.a)(u,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"container"},[t("div",{ref:"outerScroll",staticClass:"outer-wrapper"},[t("div",{staticClass:"outer-content"},[t("ul",e._l(e.outerOpenData,(function(n,r){return t("li",{key:r,staticClass:"outer-list-item",on:{click:e.handleOuterClick}},[e._v(e._s(n))])})),0),e._v(" "),t("div",{ref:"middleScroll",staticClass:"middle-wrapper"},[t("div",{staticClass:"middle-content"},[t("ul",e._l(e.middleOpenData,(function(n,r){return t("li",{key:r,staticClass:"middle-list-item",on:{click:e.handleMiddleClick}},[e._v(e._s(n))])})),0),e._v(" "),t("div",{ref:"innerScroll",staticClass:"inner-wrapper"},[t("ul",{staticClass:"inner-content"},e._l(e.innerData,(function(n,r){return t("li",{key:r,staticClass:"inner-list-item",on:{click:e.handleInnerClick}},[e._v(e._s(n))])})),0)]),e._v(" "),t("ul",e._l(e.middleCloseData,(function(n,r){return t("li",{key:r+100,staticClass:"middle-list-item",on:{click:e.handleMiddleClick}},[e._v(e._s(n))])})),0)])]),e._v(" "),t("ul",e._l(e.outerCloseData,(function(n,r){return t("li",{key:r+100,staticClass:"outer-list-item",on:{click:e.handleOuterClick}},[e._v(e._s(n))])})),0)])])])}),[],!1,null,"0d6a4906",null);t.default=f.exports}}]);