44.5437344c.js 8.3 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([[44],{443:function(t,e,n){"use strict";var o=n(435),r=function(){function t(t){this.ancestors=[],this.descendants=[],this.hooksManager=[],this.analyzed=!1,this.selfScroll=t}return t.create=function(e){return new t(e)},t.prototype.hasAncestors=function(t){return Object(o.u)(this.ancestors,(function(e){return e[0]===t}))>-1},t.prototype.hasDescendants=function(t){return Object(o.u)(this.descendants,(function(e){return e[0]===t}))>-1},t.prototype.addAncestor=function(t,e){var n=this.ancestors;n.push([t,e]),n.sort((function(t,e){return t[1]-e[1]}))},t.prototype.addDescendant=function(t,e){var n=this.descendants;n.push([t,e]),n.sort((function(t,e){return t[1]-e[1]}))},t.prototype.removeAncestor=function(t){var e=this.ancestors;if(e.length){var n=Object(o.u)(this.ancestors,(function(e){return e[0]===t}));if(n>-1)return e.splice(n,1)}},t.prototype.removeDescendant=function(t){var e=this.descendants;if(e.length){var n=Object(o.u)(this.descendants,(function(e){return e[0]===t}));if(n>-1)return e.splice(n,1)}},t.prototype.registerHooks=function(t,e,n){t.on(e,n),this.hooksManager.push([t,e,n])},t.prototype.setAnalyzed=function(t){void 0===t&&(t=!1),this.analyzed=t},t.prototype.purge=function(){var t=this;this.ancestors.forEach((function(e){e[0].removeDescendant(t)})),this.descendants.forEach((function(e){e[0].removeAncestor(t)})),this.hooksManager.forEach((function(t){var e=t[0],n=t[1],o=t[2];e.off(n,o)})),this.hooksManager=[]},t}(),s=[{key:"purgeNestedScroll",name:"purgeNestedScroll"}].map((function(t){return{key:t.key,sourceKey:"plugins.nestedScroll."+t.name}})),i=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var o=Array(t),r=0;for(e=0;e<n;e++)for(var s=arguments[e],i=0,c=s.length;i<c;i++,r++)o[r]=s[i];return o},c=function(t){t.forEach((function(t){t.enable()}))},l=function(t,e){t.forEach((function(t){t.hasHorizontalScroll!==e.hasHorizontalScroll&&t.hasVerticalScroll!==e.hasVerticalScroll||t.disable()}))},a=function(t,e){for(var n=0,o=t.parentNode;o&&o!==e;)n++,o=o.parentNode;return n},u=function(){function t(e){var n=this.handleOptions(e),o=t.instancesMap[n];return o||((o=t.instancesMap[n]=this).store=[],o.hooksFn=[]),o.init(e),o}return t.getAllNestedScrolls=function(){var e=t.instancesMap;return Object.keys(e).map((function(t){return e[t]}))},t.purgeAllNestedScrolls=function(){t.getAllNestedScrolls().forEach((function(t){return t.purgeNestedScroll()}))},t.prototype.handleOptions=function(t){var e=!0===t.options.nestedScroll?{}:t.options.nestedScroll,n={groupId:"INTERNAL_NESTED_SCROLL"};this.options=Object(o.t)(n,e);var r=typeof this.options.groupId;return"string"!==r&&"number"!==r&&Object(o.S)("groupId must be string or number for NestedScroll plugin"),this.options.groupId},t.prototype.init=function(t){t.proxy(s),this.addBScroll(t),this.buildBScrollGraph(),this.analyzeBScrollGraph(),this.ensureEventInvokeSequence(),this.handleHooks(t)},t.prototype.handleHooks=function(t){var e=this;this.registerHooks(t.hooks,t.hooks.eventTypes.destroy,(function(){e.deleteScroll(t)}))},t.prototype.deleteScroll=function(t){t.wrapper.isBScrollContainer=void 0;var e=this.store,n=this.hooksFn,r=Object(o.u)(e,(function(e){return e.selfScroll===t}));r>-1&&(e[r].purge(),e.splice(r,1));var s=Object(o.u)(n,(function(e){return e[0]===t.hooks}));if(s>-1){var i=n[s],c=i[0],l=i[1],a=i[2];c.off(l,a),n.splice(s,1)}},t.prototype.addBScroll=function(t){this.store.push(r.create(t))},t.prototype.buildBScrollGraph=function(){for(var t,e,n,o,r=this.store,s=this.store.length,i=0;i<s;i++){n=(t=r[i]).selfScroll.wrapper;for(var c=0;c<s;c++)if(o=(e=r[c]).selfScroll.wrapper,t!==e&&n.contains(o)){var l=a(o,n);t.hasDescendants(e)||t.addDescendant(e,l),e.hasAncestors(t)||e.addAncestor(t,l)}}},t.prototype.analyzeBScrollGraph=function(){this.store.forEach((function(t){if(!t.analyzed){var e=t.ancestors,n=t.descendants,r=t.selfScroll;t.registerHooks(r,r.eventTypes.beforeScrollStart,(function(){var t,o,s,c,a,u,f,h,d,p,v=e.map((function(t){return t[0].selfScroll})),S=n.map((function(t){return t[0].selfScroll}));i(v,S).forEach((function(t){t.pending&&(t.stop(),t.resetPosition())})),o=(t=r).hasHorizontalScroll,s=t.hasVerticalScroll,c=t.x,a=t.y,u=t.minScrollX,f=t.maxScrollX,h=t.minScrollY,d=t.maxScrollY,p=!1,s?p=a>h||a<d:o&&(p=c>u||c<f),p&&function(t){t.scroller.reflow(),t.resetPosition(0)}(r),function(t){t.forEach((function(t){var e=t.scroller,n=e.actions,o=e.scrollBehaviorX,r=e.scrollBehaviorY;n.fingerMoved=!0,n.contentMoved=!1,n.directionLockAction.reset(),o.start(),r.start(),o.resetStartPos(),r.resetStartPos(),n.startTime=+new Date}))}(v),l(v,r)})),t.registerHooks(r,r.eventTypes.touchEnd,(function(){var t=e.map((function(t){return t[0].selfScroll})),o=n.map((function(t){return t[0].selfScroll}));c(i(t,o))}));var s=r.scroller.actions.hooks;t.registerHooks(s,s.eventTypes.detectMovingDirection,(function(){var t,n,s,i,a,u,f,h,d,p,v,S,g,k,y,m,b=e.map((function(t){return t[0].selfScroll})),w=b[0],E=b.slice(1),_=r.scroller.actions.contentMoved,C=0===b.length;if(_)l(b,r);else if(!C&&(n=(t=r).hasHorizontalScroll,s=t.hasVerticalScroll,i=t.x,a=t.y,u=t.minScrollX,f=t.maxScrollX,h=t.minScrollY,d=t.maxScrollY,p=t.movingDirectionX,v=t.movingDirectionY,S=!1,g=i>=u&&p===o.b.Negative,k=i<=f&&p===o.b.Positive,y=a>=h&&v===o.b.Negative,m=a<=d&&v===o.b.Positive,s?S=y||m:n&&(S=g||k),S))return l([r],r),w&&c([w]),l(E,r),!0})),t.setAnalyzed(!0)}}))},t.prototype.ensureEventInvokeSequence=function(){this.store.slice().sort((function(t,e){return t.descendants.length-e.descendants.length})).forEach((function(t){t.selfScroll.scroller.actionsHandler.rebindDOMEvents()}))},t.prototype.registerHooks=function(t,e,n){t.on(e,n,this),this.hooksFn.push([t,e,n])},t.prototype.purgeNestedScroll=function(){var e=this.options.groupId;this.store.forEach((function(t){t.purge()})),this.store=[],this.hooksFn.forEach((function(t){var e=t[0],n=t[1],o=t[2];e.off(n,o)})),this.hooksFn=[],delete t.instancesMap[e]},t.pluginName="nestedScroll",t.instancesMap={},t}();e.a=u},534:function(t,e,n){},697:function(t,e,n){"use strict";n(534)},758:function(t,e,n){"use strict";n.r(e);var o=n(436),r=n(443),s=n(446);o.a.use(r.a),o.a.use(s.a);var i=["๐Ÿ˜€ ๐Ÿ˜ ๐Ÿ˜‚ ๐Ÿคฃ ๐Ÿ˜ƒ ๐Ÿ™ƒ ","๐Ÿ‘†๐Ÿป vertical scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿ™‚ ๐Ÿค” ๐Ÿ˜„ ๐Ÿคจ ๐Ÿ˜ ๐Ÿ™ƒ "],c=["๐Ÿ˜€ ๐Ÿ˜ ๐Ÿ˜‚ ๐Ÿคฃ ๐Ÿ˜ƒ ๐Ÿ™ƒ ","๐Ÿ‘†๐Ÿป vertical scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿ™‚ ๐Ÿค” ๐Ÿ˜„ ๐Ÿคจ ๐Ÿ˜ ๐Ÿ™ƒ ","๐Ÿ‘†๐Ÿป vertical scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿ˜” ๐Ÿ˜• ๐Ÿ™ƒ ๐Ÿคฃ ๐Ÿ˜ฒ ๐Ÿ™ƒ ๐Ÿคฃ","๐Ÿ™‚ ๐Ÿค” ๐Ÿ˜„ ๐Ÿคจ ๐Ÿ˜ ๐Ÿ™ƒ ","๐Ÿ‘†๐Ÿป vertical scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿ˜” ๐Ÿ˜• ๐Ÿ™ƒ ๐Ÿคฃ ๐Ÿ˜ฒ ๐Ÿ™ƒ ๐Ÿคฃ","๐Ÿ‘†๐Ÿป vertical scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿ˜” ๐Ÿ˜• ๐Ÿ™ƒ ๐Ÿคฃ ๐Ÿ˜ฒ ๐Ÿ™ƒ ๐Ÿคฃ","๐Ÿ™‚ ๐Ÿค” ๐Ÿ˜„ ๐Ÿคจ ๐Ÿ˜ ๐Ÿ™ƒ ","๐Ÿ‘†๐Ÿป vertical scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿ˜” ๐Ÿ˜• ๐Ÿ™ƒ ๐Ÿคฃ ๐Ÿ˜ฒ ๐Ÿ™ƒ ๐Ÿคฃ","๐Ÿ‘†๐Ÿป vertical scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿ˜” ๐Ÿ˜• ๐Ÿ™ƒ ๐Ÿคฃ ๐Ÿ˜ฒ ๐Ÿ™ƒ ๐Ÿคฃ","๐Ÿ™‚ ๐Ÿค” ๐Ÿ˜„ ๐Ÿคจ ๐Ÿ˜ ๐Ÿ™ƒ ","๐Ÿ‘†๐Ÿป vertical scroll ๐Ÿ‘‡๐Ÿป ","๐Ÿ˜” ๐Ÿ˜• ๐Ÿ™ƒ ๐Ÿคฃ ๐Ÿ˜ฒ ๐Ÿ™ƒ ๐Ÿคฃ"],l={data:function(){return{list1:i,list2:c}},mounted:function(){this.initScroll()},methods:{handleOuterClick:function(){window.alert("clicked outer item")},handleInnerClick:function(){window.alert("clicked inner item")},initScroll:function(){new o.a(this.$refs.outerScroll,{nestedScroll:{groupId:"mixed-nested-scroll"},click:!0}),new o.a(this.$refs.innerScroll,{nestedScroll:{groupId:"mixed-nested-scroll"},scrollX:!0,scrollY:!1,slide:{loop:!1,autoplay:!1,threshold:100},momentum:!1,bounce:!1,click:!0})}}},a=(n(697),n(41)),u=Object(a.a)(l,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"horizontal-in-vertical-container"},[e("div",{ref:"outerScroll",staticClass:"vertical-wrapper"},[e("div",{staticClass:"vertical-content"},[t._l(t.list1,(function(n,o){return e("div",{key:o,staticClass:"vertical-item",on:{click:t.handleOuterClick}},[t._v(t._s(n))])})),t._v(" "),e("div",{ref:"innerScroll",staticClass:"horizontal-wrapper"},[e("div",{staticClass:"slide-banner-content",on:{click:t.handleInnerClick}},[e("div",{staticClass:"slide-item page1"},[t._v("horizontal scroll 1")]),t._v(" "),e("div",{staticClass:"slide-item page2"},[t._v("horizontal scroll 2")]),t._v(" "),e("div",{staticClass:"slide-item page3"},[t._v("horizontal scroll 3")]),t._v(" "),e("div",{staticClass:"slide-item page4"},[t._v("horizontal scroll 4")])])]),t._v(" "),t._l(t.list2,(function(n,o){return e("div",{key:o+10,staticClass:"vertical-item",on:{click:t.handleOuterClick}},[t._v(t._s(n))])}))],2)])])}),[],!1,null,"6858ec2f",null);e.default=u.exports}}]);