@3dwayfinder/wayfinder-vue-components 1.0.90 → 1.0.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1873,6 +1873,10 @@ const __vue_component__$e = /*#__PURE__*/normalizeComponent({
1873
1873
  var script$d = {
1874
1874
  name: 'GroupsMenu',
1875
1875
  props: {
1876
+ parent: {
1877
+ type: Number,
1878
+ default: -1
1879
+ },
1876
1880
  showPOICount: {
1877
1881
  type: Boolean,
1878
1882
  default: false
@@ -1927,12 +1931,15 @@ var script$d = {
1927
1931
  let arr = []; // Copy arr for sorting
1928
1932
 
1929
1933
  let topic;
1934
+ let groups = this.poiGroups;
1930
1935
 
1931
- for (let i in this.poiGroups) {
1932
- topic = this.poiGroups[i];
1936
+ for (let i in groups) {
1937
+ topic = groups[i];
1933
1938
 
1934
1939
  if (topic && topic.getShowInMenu() && topic.getName(this.language)) {
1935
- arr.push(topic);
1940
+ if (!(this.parent > -1 && parseInt(topic.parent_id) !== this.parent)) {
1941
+ arr.push(topic);
1942
+ }
1936
1943
  }
1937
1944
  }
1938
1945
 
@@ -2039,6 +2046,8 @@ var __vue_render__$d = function () {
2039
2046
  }), _vm._v(" "), _vm.showPOICount ? _c('label', {
2040
2047
  staticClass: "count"
2041
2048
  }, [_vm._v(_vm._s(topic.pois.length))]) : _vm._e()];
2049
+ }, {
2050
+ "group": topic
2042
2051
  })], 2), _vm._v(" "), topic.childGroups.length > 0 && _vm.showSubGroups ? _c('ul', {
2043
2052
  directives: [{
2044
2053
  name: "show",
@@ -2058,6 +2067,8 @@ var __vue_render__$d = function () {
2058
2067
  }), _vm._v(" "), _vm.showPOICount ? _c('label', {
2059
2068
  staticClass: "count"
2060
2069
  }, [_vm._v(_vm._s(subtopic.pois.length))]) : _vm._e()];
2070
+ }, {
2071
+ "group": subtopic
2061
2072
  })], 2);
2062
2073
  }), 0) : _vm._e(), _vm._v(" "), topic.pois.length > 0 && _vm.showPOIs ? _c('ul', {
2063
2074
  directives: [{
@@ -2102,8 +2113,8 @@ var __vue_staticRenderFns__$d = [];
2102
2113
 
2103
2114
  const __vue_inject_styles__$d = function (inject) {
2104
2115
  if (!inject) return;
2105
- inject("data-v-746c33b6_0", {
2106
- source: ".az-menu[data-v-746c33b6]{overflow:hidden;user-select:none}.az-menu .list-item[data-v-746c33b6]{list-style:none}.az-menu ul[data-v-746c33b6]{margin:0;padding:0}",
2116
+ inject("data-v-616120b3_0", {
2117
+ source: ".az-menu[data-v-616120b3]{overflow:hidden;user-select:none}.az-menu .list-item[data-v-616120b3]{list-style:none}.az-menu ul[data-v-616120b3]{margin:0;padding:0}",
2107
2118
  map: undefined,
2108
2119
  media: undefined
2109
2120
  });
@@ -2111,7 +2122,7 @@ const __vue_inject_styles__$d = function (inject) {
2111
2122
  /* scoped */
2112
2123
 
2113
2124
 
2114
- const __vue_scope_id__$d = "data-v-746c33b6";
2125
+ const __vue_scope_id__$d = "data-v-616120b3";
2115
2126
  /* module identifier */
2116
2127
 
2117
2128
  const __vue_module_identifier__$d = undefined;
@@ -3306,3228 +3317,81 @@ const __vue_component__$3 = /*#__PURE__*/normalizeComponent({
3306
3317
  staticRenderFns: __vue_staticRenderFns__$3
3307
3318
  }, __vue_inject_styles__$3, __vue_script__$3, __vue_scope_id__$3, __vue_is_functional_template__$3, __vue_module_identifier__$3, false, createInjector, undefined, undefined);
3308
3319
 
3309
- /*!
3310
- * better-scroll / core
3311
- * (c) 2016-2019 ustbhuangyi
3312
- * Released under the MIT License.
3313
- */
3314
- /*! *****************************************************************************
3315
- Copyright (c) Microsoft Corporation. All rights reserved.
3316
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
3317
- this file except in compliance with the License. You may obtain a copy of the
3318
- License at http://www.apache.org/licenses/LICENSE-2.0
3319
-
3320
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
3321
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
3322
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
3323
- MERCHANTABLITY OR NON-INFRINGEMENT.
3324
-
3325
- See the Apache Version 2.0 License for specific language governing permissions
3326
- and limitations under the License.
3327
- ***************************************************************************** */
3328
- /* global Reflect, Promise */
3329
-
3330
- var extendStatics = function(d, b) {
3331
- extendStatics = Object.setPrototypeOf ||
3332
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
3333
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
3334
- return extendStatics(d, b);
3335
- };
3320
+ var scrollarea_common = createCommonjsModule(function (module) {
3321
+ module.exports=function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n});},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0});},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=1)}([function(t,e){t.exports={create:function(){return [0,0]},clone:function(t){var e=new Array(2);return e[0]=t[0],e[1]=t[1],e},fromValues:function(t,e){var i=new Array(2);return i[0]=t,i[1]=e,i},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t},set:function(t,e,i){return t[0]=e,t[1]=i,t},add:function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t},sub:function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t},mul:function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t},div:function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t},min:function(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t},max:function(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t},scale:function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t},dist:function(t,e){var i=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(i*i+n*n)},sqrDist:function(t,e){var i=e[0]-t[0],n=e[1]-t[1];return i*i+n*n},len:function(t){var e=t[0],i=t[1];return Math.sqrt(e*e+i*i)},length:function(t){var e=t[0],i=t[1];return Math.sqrt(e*e+i*i)},sqrLen:function(t){var e=t[0],i=t[1];return e*e+i*i},negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t},normalize:function(t,e){var i=e[0],n=e[1],s=i*i+n*n;return s>0&&(s=1/Math.sqrt(s),t[0]=e[0]*s,t[1]=e[1]*s),t},dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},cross:function(t,e,i){var n=e[0]*i[1]-e[1]*i[0];return t[0]=t[1]=0,t[2]=n,t},lerp:function(t,e,i,n){var s=e[0],o=e[1];return t[0]=s+n*(i[0]-s),t[1]=o+n*(i[1]-o),t},transformMat2:function(t,e,i){var n=e[0],s=e[1];return t[0]=n*i[0]+s*i[1],t[1]=n*i[2]+s*i[3],t},str:function(t){return "this("+t[0]+", "+t[1]+")"}};},function(t,e,i){i.r(e),i.d(e,"ScrollArea",(function(){return a}));var n=i(0),s=i.n(n);class o{constructor(t,e){this.position=s.a.create(),this.contentSize=t,this.viewSize=e,this._maxPosition=s.a.create(),this._minPosition=s.a.create(),this._vec2cache=s.a.create();}getViewPosition(){return this.position}getContentPosition(){return this.position}clampPosition(){s.a.max(this._maxPosition,this.getViewSize(),this.getContentSize()),s.a.min(this._minPosition,this.getViewSize(),this.getContentSize()),s.a.sub(this._maxPosition,this._maxPosition,this._minPosition),this.position=this.clamp(this.position,s.a.create(),this._maxPosition);}setViewPosition(t){!isNaN(parseFloat(t[0]))&&isFinite(t[0])&&!isNaN(parseFloat(t[1]))&&isFinite(t[1])&&(this.position=t,this.clampPosition());}move(t){t&&this.setViewPosition(s.a.add(t,this.getViewPosition(),t));}setViewSize(t,e){this.viewSize=s.a.fromValues(t,e),this.clampPosition();}setContentSize(t,e){this.contentSize=s.a.fromValues(t,e),this.clampPosition();}isContentLonger(){return this.viewSize[1]<=this.contentSize[1]}isContentWider(){return this.viewSize[0]<=this.contentSize[0]}getContentSize(){return this.contentSize}getViewSize(){return this.viewSize}clamp(t,e,i){var n=s.a.clone(t);return s.a.max(n,n,e),s.a.min(n,n,i),n}getPercentagePosition(){return s.a.div(s.a.create(),this.position,this.viewSize)}getRelativePosition(){return s.a.sub(this._vec2cache,this.getViewSize(),this.getContentSize()),0!==s.a.len(this._vec2cache)&&s.a.div(this._vec2cache,this.getViewPosition(),s.a.sub(this._vec2cache,this.getViewSize(),this.getContentSize())),this._vec2cache}}class r{constructor(t,e,i){this.vertical=void 0===i||!i,this.position=0,this.containerSize=1,this.contentSize=1,this.mouseDelta=s.a.create(),this.onScroll=!1,this.parentElement=t,this.element=document.createElement("div"),this.element.classList.add("sa-scrollbar"),this.element.classList.add("sa-scrollbar-position-"+e),this.element.style.position="absolute",this.element.style.right="0",this.element.style.top="0",this.element.style.bottom="0",this.bar=document.createElement("div"),this.bar.style.minWidth="1px",this.bar.classList.add("sa-bar"),this.element.appendChild(this.bar),t.appendChild(this.element),this.attachEvents(this.element),this.view=new o(s.a.fromValues(this.bar.clientWidth,this.bar.clientHeight),s.a.fromValues(this.element.clientWidth,this.element.clientHeight));}attachEvents(t){if(t.addEventListener("mousedown",t=>{this.mousedown=!0,t.stopPropagation(),t.preventDefault();}),window.addEventListener("mousemove",t=>{if(this.mousedown){var e=s.a.fromValues(t.movementX,t.movementY);this.deltaMove=e,this.lastTime=Date.now(),this.getOption("reverse"),this.scroll(e);}}),window.addEventListener("mouseup",t=>{this.onEndDrag(this.deltaMove,Date.now()-this.lastTime),this.mousedown=!1;}),t.addEventListener("touchstart",t=>{t.touches&&t.touches.length>0&&(this.lastTouch=s.a.fromValues(t.touches[0].screenX,t.touches[0].screenY));},!1),window.addEventListener("touchend",t=>{this.lastTouch=null;},!1),window.addEventListener("touchcancel",t=>{this.lastTouch=null;},!1),window.addEventListener("touchmove",t=>{if(console.log("touchmove",t),t.touches&&t.touches.length>0){if(this.lastTouch){var e=s.a.fromValues(t.touches[0].screenX,t.touches[0].screenY);this.getOption("reverse")?this.scroll(s.a.sub(e,this.lastTouch,e)):this.scroll(s.a.sub(e,e,this.lastTouch));}this.lastTouch=s.a.fromValues(t.touches[0].screenX,t.touches[0].screenY);}},!1),"undefined"!=typeof ResizeObserver&&t){var e=this;this.resizeObserver=new ResizeObserver((function(){e.resize();})),this.resizeObserver.observe(t);}}scroll(t){var e=this;window.requestAnimationFrame((function(){e.view.move(t),t=s.a.clone(e.view.getContentPosition()),e.setPosition(t),e.updateCallback&&"function"==typeof e.updateCallback&&e.updateCallback(me);}));}setPosition(t){var e=1;this.getOption("swapContainers")&&(e=-1),this.bar.style.transform="translate("+t[0]*e+"px,"+t[1]*e+"px)",this.scrolling=!1,this.checkContentPosition();}checkContentPosition(){var t=this.view.getRelativePosition(),e=[];0===t[0]&&e.push("on-left"),0===t[1]&&e.push("on-top"),1===t[0]&&e.push("on-right"),1===t[1]&&e.push("on-bottom"),e!==this.positionClassNames&&(this.container.classList.remove(...this.positionClassNames),e&&e.length>0&&this.container.classList.add(...e),this.positionClassNames=e);}clear(){this.position=0,this.setPosition(0);}getBarLength(){return this.vertical?parseInt(this.bar.height()):parseInt(this.bar.width())}getViewLength(){return this.vertical?this.view.getViewSize()[1]:this.view.getViewSize()[0]}getContentLength(){return this.vertical?this.view.getContentSize()[1]:this.view.getContentSize()[0]}setContentPosition(t){var e=s.a.create(),i=this.containerSize/this.contentSize;s.a.scale(e,t,i),this.view.setViewPosition(e),this.setPosition(this.view.getContentPosition());}getPercentage(){return s.a.len(this.view.getViewPosition())/this.getViewLength()}resize(){this.view.setViewSize(parseInt(this.element.clientWidth),parseInt(this.bar.clientHeight)),this.view.setContentSize(parseInt(this.element.clientWidth),parseInt(this.bar.clientHeight)),this.checkIfScrollIsNeeded();}checkIfScrollIsNeeded(){this.view.isContentLonger()&&this.element.classList.add("content-longer"),this.view.isContentWider()&&this.element.classList.add("content-wider");}}class a{constructor(t,e,i){this.container=null,this.content=null,this.options={smooth:!0,reverse:!0,swapContainers:!0,updateInterval:10,wheelSpeed:50},void 0!==i&&i&&(this.options=this.chooseOptions(this.options,i)),console.log("vec2",s.a,s.a.create),this.setContainer(t),this.events={change:[],layout:[],ready:[]},this.lastTouch=null,this.deltaMove=s.a.create(),this.lastTime=0,this.smoothDistance=null,this.timeout=null,this.smoothCoeficent=s.a.fromValues(11,11),this.positionClassNames=[],this.mousedown=!1,this.touchstart=!1,this._vec2cache=s.a.create();this.container;this.getOption("swapContainers")?this.view=new o(s.a.fromValues(this.container.clientWidth,this.container.clientHeight),s.a.fromValues(this.content.clientWidth,this.content.clientHeight)):(this.content,this.view=new o(s.a.fromValues(this.content.clientWidth,this.content.clientHeight),s.a.fromValues(this.container.clientWidth,this.container.clientHeight))),this.container.style.position="relative",this.container.style.overflow="hidden",this.container.style.overflow="hidden",this.container.style.userSelect="none",this.attachEvents(this.container),this.scrollbar=new r(this.container,"right"),this.construct();}attachEvents(t){if(t.addEventListener("mousewheel",(function(t){var i=0;t.originalEvent&&(t=t.originalEvent),i="wheelDelta"in t?t.wheelDelta<0?1:t.wheelDelta>0?-1:1:t.deltaY>0?1:t.deltaY<0?-1:1,e.scroll(s.a.fromValues(0,e.getOption("wheelSpeed")*i));})),t.addEventListener("mousedown",t=>{this.mousedown=!0,t.stopPropagation(),t.preventDefault();}),window.addEventListener("mousemove",t=>{if(this.mousedown){var e=s.a.fromValues(t.movementX,t.movementY);this.deltaMove=e,this.lastTime=Date.now(),this.getOption("reverse"),this.scroll(e);}}),window.addEventListener("mouseup",t=>{this.mousedown=!1;}),t.addEventListener("touchstart",t=>{t.touches&&t.touches.length>0&&(this.lastTouch=s.a.fromValues(t.touches[0].screenX,t.touches[0].screenY));},!1),window.addEventListener("touchend",t=>{this.lastTouch=null;},!1),window.addEventListener("touchcancel",t=>{this.lastTouch=null;},!1),window.addEventListener("touchmove",t=>{if(console.log("touchmove",t),t.touches&&t.touches.length>0){if(this.lastTouch){var e=s.a.fromValues(t.touches[0].screenX,t.touches[0].screenY);this.getOption("reverse")?this.scroll(s.a.sub(e,this.lastTouch,e)):this.scroll(s.a.sub(e,e,this.lastTouch));}this.lastTouch=s.a.fromValues(t.touches[0].screenX,t.touches[0].screenY);}},!1),"undefined"!=typeof ResizeObserver&&t){var e=this;this.resizeObserver=new ResizeObserver((function(){e.resize();})),this.resizeObserver.observe(t);}}onEndDrag(t,e){var i=s.a.div(0,Math.abs(event.velocity));if(this.getOption("smooth")&&sqrLen(i)>.3){var n=fromValues(event.deltaX,event.deltaY),o=s.a.create();s.a.multiply(o,n,i),this.getOption("reverse");var r=this;this.stop();var a=create(),h=function(){div(a,o,r.smoothCoeficent),sqrLen(a)>3?(sub(o,o,a),requestAnimFrame(h,r.getOption("updateInterval")),negate(a,a),r.scroll(a)):r.scrolling=!1;};this.timeout=requestAnimFrame(h,r.updateInterval);}else this.scrolling=!1;}resize(){console.log("resize",this.content.clientWidth,this.content.clientHeight,"container",this.container.clientWidth,this.container.clientHeight),this.getOption("swapContainers")?(this.view.setViewSize(parseInt(this.content.clientWidth),parseInt(this.content.clientHeight)),this.view.setContentSize(parseInt(this.container.clientWidth),parseInt(this.container.clientHeight))):(this.view.setViewSize(parseInt(this.container.clientWidth),parseInt(this.container.clientHeight)),this.view.setContentSize(parseInt(this.content.clientWidth),parseInt(this.content.clientHeight))),this.checkIfScrollIsNeeded();}checkIfScrollIsNeeded(){this.view.isContentLonger()&&this.container.classList.add("content-longer"),this.view.isContentWider()&&this.container.classList.add("content-wider");}chooseOptions(t,e){for(var i in e)t[i]&&(t[i]=e[i]);return t}setContainer(t){switch(typeof t){case"undefined":this.container=document.createElement("div"),this.container.classList.add("keyboard"),document.body.appendChild(this.container);break;case"string":this.container=document.getElementById(t);break;default:this.container=t;}this.container&&(this.content=this.container.firstElementChild);}getOption(t){return this.options[t]}on(t,e){"object"!=typeof this.events[t]&&(this.events[t]=[]),this.events[t].push(e);}trigger(){let t=Array.prototype.slice.call(arguments);if(t.length>0){let e=t[0];if(t.shift(),this.events[e]){let i;for(let n=0,s=this.events[e].length;n<s;n++)i=this.events[e][n],"function"==typeof i&&i.apply(this,t);}}}clear(){}construct(){this.clear(),this.resize();}scroll(t){var e=this;window.requestAnimationFrame((function(){e.view.move(t),t=s.a.clone(e.view.getContentPosition()),e.setContentOffset(t),e.updateCallback&&"function"==typeof e.updateCallback&&e.updateCallback(me);}));}setContentOffset(t){var e=1;this.getOption("swapContainers")&&(e=-1),this.content.style.transform="translate("+t[0]*e+"px,"+t[1]*e+"px)",this.scrolling=!1,this.checkContentPosition();}checkContentPosition(){var t=this.view.getRelativePosition(),e=[];0===t[0]&&e.push("on-left"),0===t[1]&&e.push("on-top"),1===t[0]&&e.push("on-right"),1===t[1]&&e.push("on-bottom"),e!==this.positionClassNames&&(this.container.classList.remove(...this.positionClassNames),e&&e.length>0&&this.container.classList.add(...e),this.positionClassNames=e);}}}]).ScrollArea;
3322
+ });
3336
3323
 
3337
- function __extends(d, b) {
3338
- extendStatics(d, b);
3339
- function __() { this.constructor = d; }
3340
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3341
- }
3324
+ //
3325
+ var script$2 = {
3326
+ name: 'ScrollableArea',
3327
+ data: () => ({
3328
+ scroll: null
3329
+ }),
3342
3330
 
3343
- var __assign = function() {
3344
- __assign = Object.assign || function __assign(t) {
3345
- for (var s, i = 1, n = arguments.length; i < n; i++) {
3346
- s = arguments[i];
3347
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
3348
- }
3349
- return t;
3350
- };
3351
- return __assign.apply(this, arguments);
3352
- };
3331
+ updated() {
3332
+ this.$nextTick(() => {
3333
+ if (this.scroll) {
3334
+ this.scroll.resize();
3335
+ }
3336
+ });
3337
+ },
3353
3338
 
3354
- function warn$2(msg) {
3355
- console.error("[BScroll warn]: " + msg);
3356
- }
3339
+ mounted() {
3340
+ this.$nextTick(() => {
3341
+ if (!this.scroll) {
3342
+ this.scroll = new scrollarea_common(this.$refs.area);
3343
+ }
3344
+ });
3345
+ },
3357
3346
 
3358
- // ssr support
3359
- var inBrowser$2 = typeof window !== 'undefined';
3360
- var ua$2 = inBrowser$2 && navigator.userAgent.toLowerCase();
3361
- ua$2 && /wechatdevtools/.test(ua$2);
3362
- var isAndroid = ua$2 && ua$2.indexOf('android') > 0;
3347
+ methods: {
3348
+ activate() {
3349
+ this.makeScroll();
3350
+ },
3363
3351
 
3364
- function getNow() {
3365
- return window.performance && window.performance.now
3366
- ? window.performance.now() + window.performance.timing.navigationStart
3367
- : +new Date();
3368
- }
3369
- function extend$1(target) {
3370
- var rest = [];
3371
- for (var _i = 1; _i < arguments.length; _i++) {
3372
- rest[_i - 1] = arguments[_i];
3373
- }
3374
- for (var i = 0; i < rest.length; i++) {
3375
- var source = rest[i];
3376
- for (var key in source) {
3377
- target[key] = source[key];
3352
+ reset() {
3353
+ this.$nextTick(() => {
3354
+ if (this.scroll) {
3355
+ this.scroll.refresh();
3378
3356
  }
3357
+ });
3379
3358
  }
3380
- return target;
3381
- }
3382
- function isUndef(v) {
3383
- return v === undefined || v === null;
3384
- }
3385
3359
 
3386
- var elementStyle$2 = (inBrowser$2 &&
3387
- document.createElement('div').style);
3388
- var vendor$2 = (function () {
3389
- if (!inBrowser$2) {
3390
- return false;
3391
- }
3392
- var transformNames = {
3393
- webkit: 'webkitTransform',
3394
- Moz: 'MozTransform',
3395
- O: 'OTransform',
3396
- ms: 'msTransform',
3397
- standard: 'transform'
3398
- };
3399
- for (var key in transformNames) {
3400
- if (elementStyle$2[transformNames[key]] !== undefined) {
3401
- return key;
3402
- }
3403
- }
3404
- return false;
3405
- })();
3406
- function prefixStyle$2(style) {
3407
- if (vendor$2 === false) {
3408
- return style;
3409
- }
3410
- if (vendor$2 === 'standard') {
3411
- if (style === 'transitionEnd') {
3412
- return 'transitionend';
3413
- }
3414
- return style;
3415
- }
3416
- return vendor$2 + style.charAt(0).toUpperCase() + style.substr(1);
3417
- }
3418
- function getElement(el) {
3419
- return (typeof el === 'string'
3420
- ? document.querySelector(el)
3421
- : el);
3422
- }
3423
- function addEvent$2(el, type, fn, capture) {
3424
- el.addEventListener(type, fn, {
3425
- passive: false,
3426
- capture: !!capture
3427
- });
3428
- }
3429
- function removeEvent$2(el, type, fn, capture) {
3430
- el.removeEventListener(type, fn, {
3431
- capture: !!capture
3432
- });
3433
- }
3434
- function offset(el) {
3435
- var left = 0;
3436
- var top = 0;
3437
- while (el) {
3438
- left -= el.offsetLeft;
3439
- top -= el.offsetTop;
3440
- el = el.offsetParent;
3441
- }
3442
- return {
3443
- left: left,
3444
- top: top
3445
- };
3446
- }
3447
- vendor$2 && vendor$2 !== 'standard' ? '-' + vendor$2.toLowerCase() + '-' : '';
3448
- var transform$2 = prefixStyle$2('transform');
3449
- var transition$2 = prefixStyle$2('transition');
3450
- var hasPerspective = inBrowser$2 && prefixStyle$2('perspective') in elementStyle$2;
3451
- // fix issue #361
3452
- var hasTransition = inBrowser$2 && transition$2 in elementStyle$2;
3453
- var style$1 = {
3454
- transform: transform$2,
3455
- transition: transition$2,
3456
- transitionTimingFunction: prefixStyle$2('transitionTimingFunction'),
3457
- transitionDuration: prefixStyle$2('transitionDuration'),
3458
- transitionDelay: prefixStyle$2('transitionDelay'),
3459
- transformOrigin: prefixStyle$2('transformOrigin'),
3460
- transitionEnd: prefixStyle$2('transitionEnd')
3461
- };
3462
- var eventTypeMap = {
3463
- touchstart: 1,
3464
- touchmove: 1,
3465
- touchend: 1,
3466
- mousedown: 2,
3467
- mousemove: 2,
3468
- mouseup: 2
3360
+ }
3469
3361
  };
3470
- function getRect(el) {
3471
- if (el instanceof window.SVGElement) {
3472
- var rect = el.getBoundingClientRect();
3473
- return {
3474
- top: rect.top,
3475
- left: rect.left,
3476
- width: rect.width,
3477
- height: rect.height
3478
- };
3479
- }
3480
- else {
3481
- return {
3482
- top: el.offsetTop,
3483
- left: el.offsetLeft,
3484
- width: el.offsetWidth,
3485
- height: el.offsetHeight
3486
- };
3487
- }
3488
- }
3489
- function preventDefaultExceptionFn$1(el, exceptions) {
3490
- for (var i in exceptions) {
3491
- if (exceptions[i].test(el[i])) {
3492
- return true;
3493
- }
3494
- }
3495
- return false;
3496
- }
3497
- var tagExceptionFn = preventDefaultExceptionFn$1;
3498
- function tap(e, eventName) {
3499
- var ev = document.createEvent('Event');
3500
- ev.initEvent(eventName, true, true);
3501
- ev.pageX = e.pageX;
3502
- ev.pageY = e.pageY;
3503
- e.target.dispatchEvent(ev);
3504
- }
3505
- function click(e, event) {
3506
- if (event === void 0) { event = 'click'; }
3507
- var eventSource;
3508
- if (e.type === 'mouseup') {
3509
- eventSource = e;
3510
- }
3511
- else if (e.type === 'touchend' || e.type === 'touchcancel') {
3512
- eventSource = e.changedTouches[0];
3513
- }
3514
- var posSrc = {};
3515
- if (eventSource) {
3516
- posSrc.screenX = eventSource.screenX || 0;
3517
- posSrc.screenY = eventSource.screenY || 0;
3518
- posSrc.clientX = eventSource.clientX || 0;
3519
- posSrc.clientY = eventSource.clientY || 0;
3520
- }
3521
- var ev;
3522
- var bubbles = true;
3523
- var cancelable = true;
3524
- if (typeof MouseEvent !== 'undefined') {
3525
- try {
3526
- ev = new MouseEvent(event, extend$1({
3527
- bubbles: bubbles,
3528
- cancelable: cancelable
3529
- }, posSrc));
3530
- }
3531
- catch (e) {
3532
- createEvent();
3533
- }
3534
- }
3535
- else {
3536
- createEvent();
3537
- }
3538
- function createEvent() {
3539
- ev = document.createEvent('Event');
3540
- ev.initEvent(event, bubbles, cancelable);
3541
- extend$1(ev, posSrc);
3542
- }
3543
- // forwardedTouchEvent set to true in case of the conflict with fastclick
3544
- ev.forwardedTouchEvent = true;
3545
- ev._constructed = true;
3546
- e.target.dispatchEvent(ev);
3547
- }
3548
- function dblclick(e) {
3549
- click(e, 'dblclick');
3550
- }
3551
3362
 
3552
- var ease = {
3553
- // easeOutQuint
3554
- swipe: {
3555
- style: 'cubic-bezier(0.23, 1, 0.32, 1)',
3556
- fn: function (t) {
3557
- return 1 + --t * t * t * t * t;
3558
- }
3559
- },
3560
- // easeOutQuard
3561
- swipeBounce: {
3562
- style: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',
3563
- fn: function (t) {
3564
- return t * (2 - t);
3565
- }
3566
- },
3567
- // easeOutQuart
3568
- bounce: {
3569
- style: 'cubic-bezier(0.165, 0.84, 0.44, 1)',
3570
- fn: function (t) {
3571
- return 1 - --t * t * t * t;
3572
- }
3573
- }
3574
- };
3363
+ /* script */
3364
+ const __vue_script__$2 = script$2;
3365
+ /* template */
3575
3366
 
3576
- var DEFAULT_INTERVAL = 100 / 60;
3577
- var windowCompat = inBrowser$2 && window;
3578
- function noop() { }
3579
- var requestAnimationFrame = (function () {
3580
- if (!inBrowser$2) {
3581
- /* istanbul ignore if */
3582
- return noop;
3583
- }
3584
- return (windowCompat.requestAnimationFrame ||
3585
- windowCompat.webkitRequestAnimationFrame ||
3586
- windowCompat.mozRequestAnimationFrame ||
3587
- windowCompat.oRequestAnimationFrame ||
3588
- // if all else fails, use setTimeout
3589
- function (callback) {
3590
- return window.setTimeout(callback, (callback.interval || DEFAULT_INTERVAL) / 2); // make interval as precise as possible.
3591
- });
3592
- })();
3593
- var cancelAnimationFrame = (function () {
3594
- if (!inBrowser$2) {
3595
- /* istanbul ignore if */
3596
- return noop;
3597
- }
3598
- return (windowCompat.cancelAnimationFrame ||
3599
- windowCompat.webkitCancelAnimationFrame ||
3600
- windowCompat.mozCancelAnimationFrame ||
3601
- windowCompat.oCancelAnimationFrame ||
3602
- function (id) {
3603
- window.clearTimeout(id);
3604
- });
3605
- })();
3606
-
3607
- var noop$1 = function (val) { };
3608
- var sharedPropertyDefinition = {
3609
- enumerable: true,
3610
- configurable: true,
3611
- get: noop$1,
3612
- set: noop$1
3613
- };
3614
- var getProperty = function (obj, key) {
3615
- var keys = key.split('.');
3616
- for (var i = 0; i < keys.length - 1; i++) {
3617
- obj = obj[keys[i]];
3618
- if (typeof obj !== 'object' || !obj)
3619
- return;
3620
- }
3621
- var lastKey = keys.pop();
3622
- if (typeof obj[lastKey] === 'function') {
3623
- return function () {
3624
- return obj[lastKey].apply(obj, arguments);
3625
- };
3626
- }
3627
- else {
3628
- return obj[lastKey];
3629
- }
3630
- };
3631
- var setProperty = function (obj, key, value) {
3632
- var keys = key.split('.');
3633
- var temp;
3634
- for (var i = 0; i < keys.length - 1; i++) {
3635
- temp = keys[i];
3636
- if (!obj[temp])
3637
- obj[temp] = {};
3638
- obj = obj[temp];
3639
- }
3640
- obj[keys.pop()] = value;
3641
- };
3642
- function propertiesProxy(target, sourceKey, key) {
3643
- sharedPropertyDefinition.get = function proxyGetter() {
3644
- return getProperty(this, sourceKey);
3645
- };
3646
- sharedPropertyDefinition.set = function proxySetter(val) {
3647
- setProperty(this, sourceKey, val);
3648
- };
3649
- Object.defineProperty(target, key, sharedPropertyDefinition);
3650
- }
3367
+ var __vue_render__$2 = function () {
3368
+ var _vm = this;
3651
3369
 
3652
- var EventEmitter$1 = /** @class */ (function () {
3653
- function EventEmitter(names) {
3654
- this.events = {};
3655
- this.eventTypes = {};
3656
- this.registerType(names);
3657
- }
3658
- EventEmitter.prototype.on = function (type, fn, context) {
3659
- if (context === void 0) { context = this; }
3660
- this._checkInTypes(type);
3661
- if (!this.events[type]) {
3662
- this.events[type] = [];
3663
- }
3664
- this.events[type].push([fn, context]);
3665
- return this;
3666
- };
3667
- EventEmitter.prototype.once = function (type, fn, context) {
3668
- var _this = this;
3669
- if (context === void 0) { context = this; }
3670
- this._checkInTypes(type);
3671
- var magic = function () {
3672
- var args = [];
3673
- for (var _i = 0; _i < arguments.length; _i++) {
3674
- args[_i] = arguments[_i];
3675
- }
3676
- _this.off(type, magic);
3677
- fn.apply(context, args);
3678
- };
3679
- magic.fn = fn;
3680
- this.on(type, magic);
3681
- return this;
3682
- };
3683
- EventEmitter.prototype.off = function (type, fn) {
3684
- if (!type && !fn) {
3685
- this.events = {};
3686
- return this;
3687
- }
3688
- if (type) {
3689
- this._checkInTypes(type);
3690
- if (!fn) {
3691
- this.events[type] = [];
3692
- return this;
3693
- }
3694
- var events = this.events[type];
3695
- if (!events) {
3696
- return this;
3697
- }
3698
- var count = events.length;
3699
- while (count--) {
3700
- if (events[count][0] === fn ||
3701
- (events[count][0] && events[count][0].fn === fn)) {
3702
- events.splice(count, 1);
3703
- }
3704
- }
3705
- return this;
3706
- }
3707
- };
3708
- EventEmitter.prototype.trigger = function (type) {
3709
- var args = [];
3710
- for (var _i = 1; _i < arguments.length; _i++) {
3711
- args[_i - 1] = arguments[_i];
3712
- }
3713
- this._checkInTypes(type);
3714
- var events = this.events[type];
3715
- if (!events) {
3716
- return;
3717
- }
3718
- var len = events.length;
3719
- var eventsCopy = events.slice();
3720
- var ret;
3721
- for (var i = 0; i < len; i++) {
3722
- var event_1 = eventsCopy[i];
3723
- var fn = event_1[0], context = event_1[1];
3724
- if (fn) {
3725
- ret = fn.apply(context, args);
3726
- if (ret === true) {
3727
- return ret;
3728
- }
3729
- }
3730
- }
3731
- };
3732
- EventEmitter.prototype.registerType = function (names) {
3733
- var _this = this;
3734
- names.forEach(function (type) {
3735
- _this.eventTypes[type] = type;
3736
- });
3737
- };
3738
- EventEmitter.prototype.destroy = function () {
3739
- this.events = {};
3740
- this.eventTypes = {};
3741
- };
3742
- EventEmitter.prototype._checkInTypes = function (type) {
3743
- var types = this.eventTypes;
3744
- var inTypes = types[type] === type;
3745
- if (!inTypes) {
3746
- warn$2("EventEmitter has used unknown event type: \"" + type + "\", should be oneof [" + Object.keys(types) + "]");
3747
- }
3748
- };
3749
- return EventEmitter;
3750
- }());
3751
-
3752
- var Direction;
3753
- (function (Direction) {
3754
- Direction[Direction["Positive"] = 1] = "Positive";
3755
- Direction[Direction["Negative"] = -1] = "Negative";
3756
- Direction[Direction["Default"] = 0] = "Default";
3757
- })(Direction || (Direction = {}));
3758
-
3759
- var DirectionLock;
3760
- (function (DirectionLock) {
3761
- DirectionLock["Default"] = "";
3762
- DirectionLock["Horizontal"] = "horizontal";
3763
- DirectionLock["Vertical"] = "vertical";
3764
- DirectionLock["None"] = "none";
3765
- })(DirectionLock || (DirectionLock = {}));
3766
-
3767
- var EventPassthrough;
3768
- (function (EventPassthrough) {
3769
- EventPassthrough["None"] = "";
3770
- EventPassthrough["Horizontal"] = "horizontal";
3771
- EventPassthrough["Vertical"] = "vertical";
3772
- })(EventPassthrough || (EventPassthrough = {}));
3773
-
3774
- var EventType;
3775
- (function (EventType) {
3776
- EventType[EventType["Touch"] = 1] = "Touch";
3777
- EventType[EventType["Mouse"] = 2] = "Mouse";
3778
- })(EventType || (EventType = {}));
3779
-
3780
- var MouseButton;
3781
- (function (MouseButton) {
3782
- MouseButton[MouseButton["Left"] = 0] = "Left";
3783
- MouseButton[MouseButton["Middle"] = 1] = "Middle";
3784
- MouseButton[MouseButton["Right"] = 2] = "Right";
3785
- })(MouseButton || (MouseButton = {}));
3786
-
3787
- var Probe;
3788
- (function (Probe) {
3789
- Probe[Probe["Default"] = 0] = "Default";
3790
- Probe[Probe["Throttle"] = 1] = "Throttle";
3791
- Probe[Probe["Normal"] = 2] = "Normal";
3792
- Probe[Probe["Realtime"] = 3] = "Realtime";
3793
- })(Probe || (Probe = {}));
3794
-
3795
- var Options = /** @class */ (function () {
3796
- function Options() {
3797
- this.startX = 0;
3798
- this.startY = 0;
3799
- this.scrollX = false;
3800
- this.scrollY = true;
3801
- this.freeScroll = false;
3802
- this.directionLockThreshold = 5;
3803
- this.eventPassthrough = EventPassthrough.None;
3804
- this.click = false;
3805
- this.dblclick = false;
3806
- this.tap = '';
3807
- this.bounce = {
3808
- top: true,
3809
- bottom: true,
3810
- left: true,
3811
- right: true
3812
- };
3813
- this.bounceTime = 800;
3814
- this.momentum = true;
3815
- this.momentumLimitTime = 300;
3816
- this.momentumLimitDistance = 15;
3817
- this.swipeTime = 2500;
3818
- this.swipeBounceTime = 500;
3819
- this.deceleration = 0.0015;
3820
- this.flickLimitTime = 200;
3821
- this.flickLimitDistance = 100;
3822
- this.resizePolling = 60;
3823
- this.probeType = Probe.Default;
3824
- this.stopPropagation = false;
3825
- this.preventDefault = true;
3826
- this.preventDefaultException = {
3827
- tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT|AUDIO)$/
3828
- };
3829
- this.tagException = {
3830
- tagName: /^TEXTAREA$/
3831
- };
3832
- this.HWCompositing = true;
3833
- this.useTransition = true;
3834
- this.bindToWrapper = false;
3835
- this.autoBlur = true;
3836
- }
3837
- Options.prototype.merge = function (options) {
3838
- if (!options)
3839
- return this;
3840
- for (var key in options) {
3841
- this[key] = options[key];
3842
- }
3843
- return this;
3844
- };
3845
- Options.prototype.process = function () {
3846
- this.translateZ =
3847
- this.HWCompositing && hasPerspective ? ' translateZ(0)' : '';
3848
- this.useTransition = this.useTransition && hasTransition;
3849
- this.preventDefault = !this.eventPassthrough && this.preventDefault;
3850
- // If you want eventPassthrough I have to lock one of the axes
3851
- this.scrollX =
3852
- this.eventPassthrough === EventPassthrough.Horizontal
3853
- ? false
3854
- : this.scrollX;
3855
- this.scrollY =
3856
- this.eventPassthrough === EventPassthrough.Vertical ? false : this.scrollY;
3857
- // With eventPassthrough we also need lockDirection mechanism
3858
- this.freeScroll = this.freeScroll && !this.eventPassthrough;
3859
- // force true when freeScroll is true
3860
- this.scrollX = this.freeScroll ? true : this.scrollX;
3861
- this.scrollY = this.freeScroll ? true : this.scrollY;
3862
- this.directionLockThreshold = this.eventPassthrough
3863
- ? 0
3864
- : this.directionLockThreshold;
3865
- return this;
3866
- };
3867
- return Options;
3868
- }());
3869
-
3870
- var EventRegister$2 = /** @class */ (function () {
3871
- function EventRegister(wrapper, events) {
3872
- this.wrapper = wrapper;
3873
- this.events = events;
3874
- this.addDOMEvents();
3875
- }
3876
- EventRegister.prototype.destroy = function () {
3877
- this.removeDOMEvents();
3878
- this.events = [];
3879
- };
3880
- EventRegister.prototype.addDOMEvents = function () {
3881
- this.handleDOMEvents(addEvent$2);
3882
- };
3883
- EventRegister.prototype.removeDOMEvents = function () {
3884
- this.handleDOMEvents(removeEvent$2);
3885
- };
3886
- EventRegister.prototype.handleDOMEvents = function (eventOperation) {
3887
- var _this = this;
3888
- var wrapper = this.wrapper;
3889
- this.events.forEach(function (event) {
3890
- eventOperation(wrapper, event.name, _this, !!event.capture);
3891
- });
3892
- };
3893
- EventRegister.prototype.handleEvent = function (e) {
3894
- var eventType = e.type;
3895
- this.events.some(function (event) {
3896
- if (event.name === eventType) {
3897
- event.handler(e);
3898
- return true;
3899
- }
3900
- return false;
3901
- });
3902
- };
3903
- return EventRegister;
3904
- }());
3905
-
3906
- var ActionsHandler = /** @class */ (function () {
3907
- function ActionsHandler(wrapper, options) {
3908
- this.wrapper = wrapper;
3909
- this.options = options;
3910
- this.hooks = new EventEmitter$1([
3911
- 'beforeStart',
3912
- 'start',
3913
- 'move',
3914
- 'end',
3915
- 'click'
3916
- ]);
3917
- this.handleDOMEvents();
3918
- }
3919
- ActionsHandler.prototype.handleDOMEvents = function () {
3920
- var _a = this.options, bindToWrapper = _a.bindToWrapper;
3921
- var wrapper = this.wrapper;
3922
- var target = bindToWrapper ? wrapper : window;
3923
- this.startClickRegister = new EventRegister$2(wrapper, [
3924
- {
3925
- name: 'mousedown',
3926
- handler: this.start.bind(this)
3927
- },
3928
- {
3929
- name: 'touchstart',
3930
- handler: this.start.bind(this)
3931
- },
3932
- {
3933
- name: 'click',
3934
- handler: this.click.bind(this),
3935
- capture: true
3936
- }
3937
- ]);
3938
- this.moveEndRegister = new EventRegister$2(target, [
3939
- {
3940
- name: 'mousemove',
3941
- handler: this.move.bind(this)
3942
- },
3943
- {
3944
- name: 'touchmove',
3945
- handler: this.move.bind(this)
3946
- },
3947
- {
3948
- name: 'mouseup',
3949
- handler: this.end.bind(this)
3950
- },
3951
- {
3952
- name: 'touchend',
3953
- handler: this.end.bind(this)
3954
- },
3955
- {
3956
- name: 'mouseup',
3957
- handler: this.end.bind(this)
3958
- },
3959
- {
3960
- name: 'touchcancel',
3961
- handler: this.end.bind(this)
3962
- }
3963
- ]);
3964
- };
3965
- ActionsHandler.prototype.beforeHandler = function (e, type) {
3966
- var _a = this.options, preventDefault = _a.preventDefault, stopPropagation = _a.stopPropagation, preventDefaultException = _a.preventDefaultException;
3967
- var preventDefaultConditions = {
3968
- start: function () {
3969
- return (preventDefault &&
3970
- !preventDefaultExceptionFn$1(e.target, preventDefaultException));
3971
- },
3972
- end: function () {
3973
- return (preventDefault &&
3974
- !preventDefaultExceptionFn$1(e.target, preventDefaultException));
3975
- },
3976
- move: function () {
3977
- return preventDefault;
3978
- }
3979
- };
3980
- if (preventDefaultConditions[type]()) {
3981
- e.preventDefault();
3982
- }
3983
- if (stopPropagation) {
3984
- e.stopPropagation();
3985
- }
3986
- };
3987
- ActionsHandler.prototype.setInitiated = function (type) {
3988
- if (type === void 0) { type = 0; }
3989
- this.initiated = type;
3990
- };
3991
- ActionsHandler.prototype.start = function (e) {
3992
- var _eventType = eventTypeMap[e.type];
3993
- if (this.initiated && this.initiated !== _eventType) {
3994
- return;
3995
- }
3996
- this.setInitiated(_eventType);
3997
- // if textarea or other html tags in options.tagException is manipulated
3998
- // do not make bs scroll
3999
- if (tagExceptionFn(e.target, this.options.tagException)) {
4000
- this.setInitiated();
4001
- return;
4002
- }
4003
- // no mouse left button
4004
- if (_eventType === EventType.Mouse && e.button !== MouseButton.Left)
4005
- return;
4006
- if (this.hooks.trigger(this.hooks.eventTypes.beforeStart, e)) {
4007
- return;
4008
- }
4009
- this.beforeHandler(e, 'start');
4010
- var point = (e.touches ? e.touches[0] : e);
4011
- this.pointX = point.pageX;
4012
- this.pointY = point.pageY;
4013
- this.hooks.trigger(this.hooks.eventTypes.start, e);
4014
- };
4015
- ActionsHandler.prototype.move = function (e) {
4016
- if (eventTypeMap[e.type] !== this.initiated) {
4017
- return;
4018
- }
4019
- this.beforeHandler(e, 'move');
4020
- var point = (e.touches ? e.touches[0] : e);
4021
- var deltaX = point.pageX - this.pointX;
4022
- var deltaY = point.pageY - this.pointY;
4023
- this.pointX = point.pageX;
4024
- this.pointY = point.pageY;
4025
- if (this.hooks.trigger(this.hooks.eventTypes.move, {
4026
- deltaX: deltaX,
4027
- deltaY: deltaY,
4028
- e: e
4029
- })) {
4030
- return;
4031
- }
4032
- // auto end when out of wrapper
4033
- var scrollLeft = document.documentElement.scrollLeft ||
4034
- window.pageXOffset ||
4035
- document.body.scrollLeft;
4036
- var scrollTop = document.documentElement.scrollTop ||
4037
- window.pageYOffset ||
4038
- document.body.scrollTop;
4039
- var pX = this.pointX - scrollLeft;
4040
- var pY = this.pointY - scrollTop;
4041
- if (pX >
4042
- document.documentElement.clientWidth -
4043
- this.options.momentumLimitDistance ||
4044
- pX < this.options.momentumLimitDistance ||
4045
- pY < this.options.momentumLimitDistance ||
4046
- pY >
4047
- document.documentElement.clientHeight -
4048
- this.options.momentumLimitDistance) {
4049
- this.end(e);
4050
- }
4051
- };
4052
- ActionsHandler.prototype.end = function (e) {
4053
- if (eventTypeMap[e.type] !== this.initiated) {
4054
- return;
4055
- }
4056
- this.setInitiated();
4057
- this.beforeHandler(e, 'end');
4058
- this.hooks.trigger(this.hooks.eventTypes.end, e);
4059
- };
4060
- ActionsHandler.prototype.click = function (e) {
4061
- this.hooks.trigger(this.hooks.eventTypes.click, e);
4062
- };
4063
- ActionsHandler.prototype.destroy = function () {
4064
- this.startClickRegister.destroy();
4065
- this.moveEndRegister.destroy();
4066
- this.hooks.destroy();
4067
- };
4068
- return ActionsHandler;
4069
- }());
3370
+ var _h = _vm.$createElement;
4070
3371
 
4071
- var translaterMetaData = {
4072
- x: ['translateX', 'px'],
4073
- y: ['translateY', 'px']
3372
+ var _c = _vm._self._c || _h;
3373
+
3374
+ return _c('div', {
3375
+ ref: "area",
3376
+ staticClass: "wf-component wf-scrollable"
3377
+ }, [_vm._t("default")], 2);
4074
3378
  };
4075
- var Translater = /** @class */ (function () {
4076
- function Translater(content) {
4077
- this.content = content;
4078
- this.style = content.style;
4079
- this.hooks = new EventEmitter$1(['beforeTranslate', 'translate']);
4080
- }
4081
- Translater.prototype.getComputedPosition = function () {
4082
- var cssStyle = window.getComputedStyle(this.content, null);
4083
- var matrix = cssStyle[style$1.transform].split(')')[0].split(', ');
4084
- var x = +(matrix[12] || matrix[4]);
4085
- var y = +(matrix[13] || matrix[5]);
4086
- return {
4087
- x: x,
4088
- y: y
4089
- };
4090
- };
4091
- Translater.prototype.translate = function (point) {
4092
- var transformStyle = [];
4093
- Object.keys(point).forEach(function (key) {
4094
- if (!translaterMetaData[key]) {
4095
- return;
4096
- }
4097
- var transformFnName = translaterMetaData[key][0];
4098
- if (transformFnName) {
4099
- var transformFnArgUnit = translaterMetaData[key][1];
4100
- var transformFnArg = point[key];
4101
- transformStyle.push(transformFnName + "(" + transformFnArg + transformFnArgUnit + ")");
4102
- }
4103
- });
4104
- this.hooks.trigger(this.hooks.eventTypes.beforeTranslate, transformStyle, point);
4105
- this.style[style$1.transform] = "" + transformStyle.join(' ');
4106
- this.hooks.trigger(this.hooks.eventTypes.translate, point);
4107
- };
4108
- Translater.prototype.destroy = function () {
4109
- this.hooks.destroy();
4110
- };
4111
- return Translater;
4112
- }());
4113
-
4114
- var Base = /** @class */ (function () {
4115
- function Base(content, translater, options) {
4116
- this.content = content;
4117
- this.translater = translater;
4118
- this.options = options;
4119
- this.hooks = new EventEmitter$1([
4120
- 'move',
4121
- 'end',
4122
- 'beforeForceStop',
4123
- 'forceStop',
4124
- 'time',
4125
- 'timeFunction'
4126
- ]);
4127
- this.style = content.style;
4128
- }
4129
- Base.prototype.translate = function (endPoint) {
4130
- this.translater.translate(endPoint);
4131
- };
4132
- Base.prototype.setPending = function (pending) {
4133
- this.pending = pending;
4134
- };
4135
- Base.prototype.setForceStopped = function (forceStopped) {
4136
- this.forceStopped = forceStopped;
4137
- };
4138
- Base.prototype.destroy = function () {
4139
- this.hooks.destroy();
4140
- cancelAnimationFrame(this.timer);
4141
- };
4142
- return Base;
4143
- }());
4144
3379
 
4145
- var Transition = /** @class */ (function (_super) {
4146
- __extends(Transition, _super);
4147
- function Transition() {
4148
- return _super !== null && _super.apply(this, arguments) || this;
4149
- }
4150
- Transition.prototype.startProbe = function () {
4151
- var _this = this;
4152
- var probe = function () {
4153
- var pos = _this.translater.getComputedPosition();
4154
- _this.hooks.trigger(_this.hooks.eventTypes.move, pos);
4155
- // excute when transition ends
4156
- if (!_this.pending) {
4157
- _this.hooks.trigger(_this.hooks.eventTypes.end, pos);
4158
- return;
4159
- }
4160
- _this.timer = requestAnimationFrame(probe);
4161
- };
4162
- cancelAnimationFrame(this.timer);
4163
- this.timer = requestAnimationFrame(probe);
4164
- };
4165
- Transition.prototype.transitionTime = function (time) {
4166
- if (time === void 0) { time = 0; }
4167
- this.style[style$1.transitionDuration] = time + 'ms';
4168
- this.hooks.trigger(this.hooks.eventTypes.time, time);
4169
- };
4170
- Transition.prototype.transitionTimingFunction = function (easing) {
4171
- this.style[style$1.transitionTimingFunction] = easing;
4172
- this.hooks.trigger(this.hooks.eventTypes.timeFunction, easing);
4173
- };
4174
- Transition.prototype.move = function (startPoint, endPoint, time, easingFn, isSlient) {
4175
- this.setPending(time > 0 && (startPoint.x !== endPoint.x || startPoint.y !== endPoint.y));
4176
- this.transitionTimingFunction(easingFn);
4177
- this.transitionTime(time);
4178
- this.translate(endPoint);
4179
- if (time && this.options.probeType === Probe.Realtime) {
4180
- this.startProbe();
4181
- }
4182
- // if we change content's transformY in a tick
4183
- // such as: 0 -> 50px -> 0
4184
- // transitionend will not be triggered
4185
- // so we forceupdate by reflow
4186
- if (!time) {
4187
- this._reflow = this.content.offsetHeight;
4188
- }
4189
- // no need to dispatch move and end when slient
4190
- if (!time && !isSlient) {
4191
- this.hooks.trigger(this.hooks.eventTypes.move, endPoint);
4192
- this.hooks.trigger(this.hooks.eventTypes.end, endPoint);
4193
- }
4194
- };
4195
- Transition.prototype.stop = function () {
4196
- // still in transition
4197
- if (this.pending) {
4198
- this.setPending(false);
4199
- cancelAnimationFrame(this.timer);
4200
- var _a = this.translater.getComputedPosition(), x = _a.x, y = _a.y;
4201
- this.transitionTime();
4202
- this.translate({ x: x, y: y });
4203
- this.setForceStopped(true);
4204
- if (this.hooks.trigger(this.hooks.eventTypes.beforeForceStop, { x: x, y: y })) {
4205
- return;
4206
- }
4207
- this.hooks.trigger(this.hooks.eventTypes.forceStop, { x: x, y: y });
4208
- }
4209
- };
4210
- return Transition;
4211
- }(Base));
3380
+ var __vue_staticRenderFns__$2 = [];
3381
+ /* style */
4212
3382
 
4213
- var Animation = /** @class */ (function (_super) {
4214
- __extends(Animation, _super);
4215
- function Animation() {
4216
- return _super !== null && _super.apply(this, arguments) || this;
4217
- }
4218
- Animation.prototype.move = function (startPoint, endPoint, time, easingFn, isSlient) {
4219
- // time is 0
4220
- if (!time) {
4221
- this.translate(endPoint);
4222
- // if we change content's transformY in a tick
4223
- // such as: 0 -> 50px -> 0
4224
- // transitionend will not be triggered
4225
- // so we forceupdate by reflow
4226
- this._reflow = this.content.offsetHeight;
4227
- // no need to dispatch move and end when slient
4228
- if (isSlient)
4229
- return;
4230
- this.hooks.trigger(this.hooks.eventTypes.move, endPoint);
4231
- this.hooks.trigger(this.hooks.eventTypes.end, endPoint);
4232
- return;
4233
- }
4234
- this.animate(startPoint, endPoint, time, easingFn);
4235
- };
4236
- Animation.prototype.animate = function (startPoint, endPoint, duration, easingFn) {
4237
- var _this = this;
4238
- var startTime = getNow();
4239
- var destTime = startTime + duration;
4240
- var step = function () {
4241
- var now = getNow();
4242
- // js animation end
4243
- if (now >= destTime) {
4244
- _this.translate(endPoint);
4245
- _this.hooks.trigger(_this.hooks.eventTypes.move, endPoint);
4246
- _this.hooks.trigger(_this.hooks.eventTypes.end, endPoint);
4247
- return;
4248
- }
4249
- now = (now - startTime) / duration;
4250
- var easing = easingFn(now);
4251
- var newPoint = {};
4252
- Object.keys(endPoint).forEach(function (key) {
4253
- var startValue = startPoint[key];
4254
- var endValue = endPoint[key];
4255
- newPoint[key] = (endValue - startValue) * easing + startValue;
4256
- });
4257
- _this.translate(newPoint);
4258
- if (_this.pending) {
4259
- _this.timer = requestAnimationFrame(step);
4260
- }
4261
- if (_this.options.probeType === Probe.Realtime) {
4262
- _this.hooks.trigger(_this.hooks.eventTypes.move, newPoint);
4263
- }
4264
- };
4265
- this.setPending(true);
4266
- cancelAnimationFrame(this.timer);
4267
- step();
4268
- };
4269
- Animation.prototype.stop = function () {
4270
- // still in requestFrameAnimation
4271
- if (this.pending) {
4272
- this.setPending(false);
4273
- cancelAnimationFrame(this.timer);
4274
- var pos = this.translater.getComputedPosition();
4275
- this.setForceStopped(true);
4276
- if (this.hooks.trigger(this.hooks.eventTypes.beforeForceStop, pos)) {
4277
- return;
4278
- }
4279
- this.hooks.trigger(this.hooks.eventTypes.forceStop, pos);
4280
- }
4281
- };
4282
- return Animation;
4283
- }(Base));
4284
-
4285
- function createAnimater(element, translater, options) {
4286
- var useTransition = options.useTransition;
4287
- var animaterOptions = {};
4288
- Object.defineProperty(animaterOptions, 'probeType', {
4289
- enumerable: true,
4290
- configurable: false,
4291
- get: function () {
4292
- return options.probeType;
4293
- }
4294
- });
4295
- if (useTransition) {
4296
- return new Transition(element, translater, animaterOptions);
4297
- }
4298
- else {
4299
- return new Animation(element, translater, animaterOptions);
4300
- }
4301
- }
3383
+ const __vue_inject_styles__$2 = undefined;
3384
+ /* scoped */
4302
3385
 
4303
- var Behavior = /** @class */ (function () {
4304
- function Behavior(wrapper, options) {
4305
- this.wrapper = wrapper;
4306
- this.options = options;
4307
- this.hooks = new EventEmitter$1(['momentum', 'end']);
4308
- this.content = this.wrapper.children[0];
4309
- this.currentPos = 0;
4310
- this.startPos = 0;
4311
- }
4312
- Behavior.prototype.start = function () {
4313
- this.direction = Direction.Default;
4314
- this.movingDirection = Direction.Default;
4315
- this.dist = 0;
4316
- };
4317
- Behavior.prototype.move = function (delta) {
4318
- delta = this.hasScroll ? delta : 0;
4319
- this.movingDirection =
4320
- delta > 0
4321
- ? Direction.Negative
4322
- : delta < 0
4323
- ? Direction.Positive
4324
- : Direction.Default;
4325
- var newPos = this.currentPos + delta;
4326
- // Slow down or stop if outside of the boundaries
4327
- if (newPos > this.minScrollPos || newPos < this.maxScrollPos) {
4328
- if ((newPos > this.minScrollPos && this.options.bounces[0]) ||
4329
- (newPos < this.maxScrollPos && this.options.bounces[1])) {
4330
- newPos = this.currentPos + delta / 3;
4331
- }
4332
- else {
4333
- newPos =
4334
- newPos > this.minScrollPos ? this.minScrollPos : this.maxScrollPos;
4335
- }
4336
- }
4337
- return newPos;
4338
- };
4339
- Behavior.prototype.end = function (duration) {
4340
- var momentumInfo = {
4341
- duration: 0
4342
- };
4343
- var absDist = Math.abs(this.currentPos - this.startPos);
4344
- // start momentum animation if needed
4345
- if (this.options.momentum &&
4346
- duration < this.options.momentumLimitTime &&
4347
- absDist > this.options.momentumLimitDistance) {
4348
- var wrapperSize = (this.direction === Direction.Negative && this.options.bounces[0]) ||
4349
- (this.direction === Direction.Positive && this.options.bounces[1])
4350
- ? this.wrapperSize
4351
- : 0;
4352
- momentumInfo = this.hasScroll
4353
- ? this.momentum(this.currentPos, this.startPos, duration, this.maxScrollPos, this.minScrollPos, wrapperSize, this.options)
4354
- : { destination: this.currentPos, duration: 0 };
4355
- }
4356
- else {
4357
- this.hooks.trigger(this.hooks.eventTypes.end, momentumInfo);
4358
- }
4359
- return momentumInfo;
4360
- };
4361
- Behavior.prototype.momentum = function (current, start, time, lowerMargin, upperMargin, wrapperSize, options) {
4362
- if (options === void 0) { options = this.options; }
4363
- var distance = current - start;
4364
- var speed = Math.abs(distance) / time;
4365
- var deceleration = options.deceleration, swipeBounceTime = options.swipeBounceTime, swipeTime = options.swipeTime;
4366
- var momentumData = {
4367
- destination: current + (speed / deceleration) * (distance < 0 ? -1 : 1),
4368
- duration: swipeTime,
4369
- rate: 15
4370
- };
4371
- this.hooks.trigger(this.hooks.eventTypes.momentum, momentumData, distance);
4372
- if (momentumData.destination < lowerMargin) {
4373
- momentumData.destination = wrapperSize
4374
- ? Math.max(lowerMargin - wrapperSize / 4, lowerMargin - (wrapperSize / momentumData.rate) * speed)
4375
- : lowerMargin;
4376
- momentumData.duration = swipeBounceTime;
4377
- }
4378
- else if (momentumData.destination > upperMargin) {
4379
- momentumData.destination = wrapperSize
4380
- ? Math.min(upperMargin + wrapperSize / 4, upperMargin + (wrapperSize / momentumData.rate) * speed)
4381
- : upperMargin;
4382
- momentumData.duration = swipeBounceTime;
4383
- }
4384
- momentumData.destination = Math.round(momentumData.destination);
4385
- return momentumData;
4386
- };
4387
- Behavior.prototype.updateDirection = function () {
4388
- var absDist = Math.round(this.currentPos) - this.absStartPos;
4389
- this.direction =
4390
- absDist > 0
4391
- ? Direction.Negative
4392
- : absDist < 0
4393
- ? Direction.Positive
4394
- : Direction.Default;
4395
- };
4396
- Behavior.prototype.refresh = function () {
4397
- var _a = this.options.rect, size = _a.size, position = _a.position;
4398
- var isWrapperStatic = window.getComputedStyle(this.wrapper, null).position === 'static';
4399
- var wrapperRect = getRect(this.wrapper);
4400
- this.wrapperSize = wrapperRect[size];
4401
- var contentRect = getRect(this.content);
4402
- this.contentSize = contentRect[size];
4403
- this.relativeOffset = contentRect[position];
4404
- if (isWrapperStatic) {
4405
- this.relativeOffset -= wrapperRect[position];
4406
- }
4407
- this.minScrollPos = 0;
4408
- this.maxScrollPos = this.wrapperSize - this.contentSize;
4409
- if (this.maxScrollPos < 0) {
4410
- this.maxScrollPos -= this.relativeOffset;
4411
- this.minScrollPos = -this.relativeOffset;
4412
- }
4413
- this.hasScroll =
4414
- this.options.scrollable && this.maxScrollPos < this.minScrollPos;
4415
- if (!this.hasScroll) {
4416
- this.maxScrollPos = this.minScrollPos;
4417
- this.contentSize = this.wrapperSize;
4418
- }
4419
- this.direction = 0;
4420
- };
4421
- Behavior.prototype.updatePosition = function (pos) {
4422
- this.currentPos = pos;
4423
- };
4424
- Behavior.prototype.getCurrentPos = function () {
4425
- return Math.round(this.currentPos);
4426
- };
4427
- Behavior.prototype.checkInBoundary = function () {
4428
- var position = this.adjustPosition(this.currentPos);
4429
- var inBoundary = position === this.getCurrentPos();
4430
- return {
4431
- position: position,
4432
- inBoundary: inBoundary
4433
- };
4434
- };
4435
- // adjust position when out of boundary
4436
- Behavior.prototype.adjustPosition = function (pos) {
4437
- var roundPos = Math.round(pos);
4438
- if (!this.hasScroll || roundPos > this.minScrollPos) {
4439
- roundPos = this.minScrollPos;
4440
- }
4441
- else if (roundPos < this.maxScrollPos) {
4442
- roundPos = this.maxScrollPos;
4443
- }
4444
- return roundPos;
4445
- };
4446
- Behavior.prototype.updateStartPos = function () {
4447
- this.startPos = this.currentPos;
4448
- };
4449
- Behavior.prototype.updateAbsStartPos = function () {
4450
- this.absStartPos = this.currentPos;
4451
- };
4452
- Behavior.prototype.resetStartPos = function () {
4453
- this.updateStartPos();
4454
- this.updateAbsStartPos();
4455
- };
4456
- Behavior.prototype.getAbsDist = function (delta) {
4457
- this.dist += delta;
4458
- return Math.abs(this.dist);
4459
- };
4460
- Behavior.prototype.destroy = function () {
4461
- this.hooks.destroy();
4462
- };
4463
- return Behavior;
4464
- }());
4465
-
4466
- var _a, _b, _c, _d;
4467
- var Passthrough;
4468
- (function (Passthrough) {
4469
- Passthrough["Yes"] = "yes";
4470
- Passthrough["No"] = "no";
4471
- })(Passthrough || (Passthrough = {}));
4472
- var PassthroughHandlers = (_a = {},
4473
- _a[Passthrough.Yes] = function (e) {
4474
- return true;
4475
- },
4476
- _a[Passthrough.No] = function (e) {
4477
- e.preventDefault();
4478
- return false;
4479
- },
4480
- _a);
4481
- var DirectionMap = (_b = {},
4482
- _b[DirectionLock.Horizontal] = (_c = {},
4483
- _c[Passthrough.Yes] = EventPassthrough.Horizontal,
4484
- _c[Passthrough.No] = EventPassthrough.Vertical,
4485
- _c),
4486
- _b[DirectionLock.Vertical] = (_d = {},
4487
- _d[Passthrough.Yes] = EventPassthrough.Vertical,
4488
- _d[Passthrough.No] = EventPassthrough.Horizontal,
4489
- _d),
4490
- _b);
4491
- var DirectionLockAction = /** @class */ (function () {
4492
- function DirectionLockAction(directionLockThreshold, freeScroll, eventPassthrough) {
4493
- this.directionLockThreshold = directionLockThreshold;
4494
- this.freeScroll = freeScroll;
4495
- this.eventPassthrough = eventPassthrough;
4496
- this.reset();
4497
- }
4498
- DirectionLockAction.prototype.reset = function () {
4499
- this.directionLocked = DirectionLock.Default;
4500
- };
4501
- DirectionLockAction.prototype.checkMovingDirection = function (absDistX, absDistY, e) {
4502
- this.computeDirectionLock(absDistX, absDistY);
4503
- return this.handleEventPassthrough(e);
4504
- };
4505
- DirectionLockAction.prototype.adjustDelta = function (deltaX, deltaY) {
4506
- if (this.directionLocked === DirectionLock.Horizontal) {
4507
- deltaY = 0;
4508
- }
4509
- else if (this.directionLocked === DirectionLock.Vertical) {
4510
- deltaX = 0;
4511
- }
4512
- return {
4513
- deltaX: deltaX,
4514
- deltaY: deltaY
4515
- };
4516
- };
4517
- DirectionLockAction.prototype.computeDirectionLock = function (absDistX, absDistY) {
4518
- // If you are scrolling in one direction, lock it
4519
- if (this.directionLocked === DirectionLock.Default && !this.freeScroll) {
4520
- if (absDistX > absDistY + this.directionLockThreshold) {
4521
- this.directionLocked = DirectionLock.Horizontal; // lock horizontally
4522
- }
4523
- else if (absDistY >= absDistX + this.directionLockThreshold) {
4524
- this.directionLocked = DirectionLock.Vertical; // lock vertically
4525
- }
4526
- else {
4527
- this.directionLocked = DirectionLock.None; // no lock
4528
- }
4529
- }
4530
- };
4531
- DirectionLockAction.prototype.handleEventPassthrough = function (e) {
4532
- var handleMap = DirectionMap[this.directionLocked];
4533
- if (handleMap) {
4534
- if (this.eventPassthrough === handleMap[Passthrough.Yes]) {
4535
- return PassthroughHandlers[Passthrough.Yes](e);
4536
- }
4537
- else if (this.eventPassthrough === handleMap[Passthrough.No]) {
4538
- return PassthroughHandlers[Passthrough.No](e);
4539
- }
4540
- }
4541
- return false;
4542
- };
4543
- return DirectionLockAction;
4544
- }());
4545
-
4546
- var ScrollerActions = /** @class */ (function () {
4547
- function ScrollerActions(scrollBehaviorX, scrollBehaviorY, actionsHandler, animater, options) {
4548
- this.hooks = new EventEmitter$1([
4549
- 'start',
4550
- 'beforeMove',
4551
- 'scrollStart',
4552
- 'scroll',
4553
- 'beforeEnd',
4554
- 'end',
4555
- 'scrollEnd'
4556
- ]);
4557
- this.scrollBehaviorX = scrollBehaviorX;
4558
- this.scrollBehaviorY = scrollBehaviorY;
4559
- this.actionsHandler = actionsHandler;
4560
- this.animater = animater;
4561
- this.options = options;
4562
- this.directionLockAction = new DirectionLockAction(options.directionLockThreshold, options.freeScroll, options.eventPassthrough);
4563
- this.enabled = true;
4564
- this.bindActionsHandler();
4565
- }
4566
- ScrollerActions.prototype.bindActionsHandler = function () {
4567
- var _this = this;
4568
- // [mouse|touch]start event
4569
- this.actionsHandler.hooks.on(this.actionsHandler.hooks.eventTypes.start, function (e) {
4570
- if (!_this.enabled)
4571
- return true;
4572
- return _this.handleStart(e);
4573
- });
4574
- // [mouse|touch]move event
4575
- this.actionsHandler.hooks.on(this.actionsHandler.hooks.eventTypes.move, function (_a) {
4576
- var deltaX = _a.deltaX, deltaY = _a.deltaY, e = _a.e;
4577
- if (!_this.enabled)
4578
- return true;
4579
- return _this.handleMove(deltaX, deltaY, e);
4580
- });
4581
- // [mouse|touch]end event
4582
- this.actionsHandler.hooks.on(this.actionsHandler.hooks.eventTypes.end, function (e) {
4583
- if (!_this.enabled)
4584
- return true;
4585
- return _this.handleEnd(e);
4586
- });
4587
- // click
4588
- this.actionsHandler.hooks.on(this.actionsHandler.hooks.eventTypes.click, function (e) {
4589
- // handle native click event
4590
- if (_this.enabled && !e._constructed) {
4591
- _this.handleClick(e);
4592
- }
4593
- });
4594
- };
4595
- ScrollerActions.prototype.handleStart = function (e) {
4596
- var timestamp = getNow();
4597
- this.moved = false;
4598
- this.startTime = timestamp;
4599
- this.directionLockAction.reset();
4600
- this.scrollBehaviorX.start();
4601
- this.scrollBehaviorY.start();
4602
- // force stopping last transition or animation
4603
- this.animater.stop();
4604
- this.scrollBehaviorX.resetStartPos();
4605
- this.scrollBehaviorY.resetStartPos();
4606
- this.hooks.trigger(this.hooks.eventTypes.start, e);
4607
- };
4608
- ScrollerActions.prototype.handleMove = function (deltaX, deltaY, e) {
4609
- if (this.hooks.trigger(this.hooks.eventTypes.beforeMove, e)) {
4610
- return;
4611
- }
4612
- var absDistX = this.scrollBehaviorX.getAbsDist(deltaX);
4613
- var absDistY = this.scrollBehaviorY.getAbsDist(deltaY);
4614
- var timestamp = getNow();
4615
- // We need to move at least momentumLimitDistance pixels
4616
- // for the scrolling to initiate
4617
- if (this.checkMomentum(absDistX, absDistY, timestamp)) {
4618
- return true;
4619
- }
4620
- if (this.directionLockAction.checkMovingDirection(absDistX, absDistY, e)) {
4621
- this.actionsHandler.setInitiated();
4622
- return true;
4623
- }
4624
- var delta = this.directionLockAction.adjustDelta(deltaX, deltaY);
4625
- var newX = this.scrollBehaviorX.move(delta.deltaX);
4626
- var newY = this.scrollBehaviorY.move(delta.deltaY);
4627
- if (!this.moved) {
4628
- this.moved = true;
4629
- this.hooks.trigger(this.hooks.eventTypes.scrollStart);
4630
- }
4631
- this.animater.translate({
4632
- x: newX,
4633
- y: newY
4634
- });
4635
- this.dispatchScroll(timestamp);
4636
- };
4637
- ScrollerActions.prototype.dispatchScroll = function (timestamp) {
4638
- // dispatch scroll in interval time
4639
- if (timestamp - this.startTime > this.options.momentumLimitTime) {
4640
- // refresh time and starting position to initiate a momentum
4641
- this.startTime = timestamp;
4642
- this.scrollBehaviorX.updateStartPos();
4643
- this.scrollBehaviorY.updateStartPos();
4644
- if (this.options.probeType === Probe.Throttle) {
4645
- this.hooks.trigger(this.hooks.eventTypes.scroll, this.getCurrentPos());
4646
- }
4647
- }
4648
- // dispatch scroll all the time
4649
- if (this.options.probeType > Probe.Throttle) {
4650
- this.hooks.trigger(this.hooks.eventTypes.scroll, this.getCurrentPos());
4651
- }
4652
- };
4653
- ScrollerActions.prototype.checkMomentum = function (absDistX, absDistY, timestamp) {
4654
- return (timestamp - this.endTime > this.options.momentumLimitTime &&
4655
- absDistY < this.options.momentumLimitDistance &&
4656
- absDistX < this.options.momentumLimitDistance);
4657
- };
4658
- ScrollerActions.prototype.handleEnd = function (e) {
4659
- if (this.hooks.trigger(this.hooks.eventTypes.beforeEnd, e)) {
4660
- return;
4661
- }
4662
- var currentPos = this.getCurrentPos();
4663
- this.scrollBehaviorX.updateDirection();
4664
- this.scrollBehaviorY.updateDirection();
4665
- if (this.hooks.trigger(this.hooks.eventTypes.end, e, currentPos)) {
4666
- return true;
4667
- }
4668
- this.animater.translate(currentPos);
4669
- this.endTime = getNow();
4670
- var duration = this.endTime - this.startTime;
4671
- this.hooks.trigger(this.hooks.eventTypes.scrollEnd, currentPos, duration);
4672
- };
4673
- ScrollerActions.prototype.handleClick = function (e) {
4674
- if (!preventDefaultExceptionFn$1(e.target, this.options.preventDefaultException)) {
4675
- e.preventDefault();
4676
- e.stopPropagation();
4677
- }
4678
- };
4679
- ScrollerActions.prototype.getCurrentPos = function () {
4680
- return {
4681
- x: this.scrollBehaviorX.getCurrentPos(),
4682
- y: this.scrollBehaviorY.getCurrentPos()
4683
- };
4684
- };
4685
- ScrollerActions.prototype.refresh = function () {
4686
- this.endTime = 0;
4687
- };
4688
- ScrollerActions.prototype.destroy = function () {
4689
- this.hooks.destroy();
4690
- };
4691
- return ScrollerActions;
4692
- }());
4693
-
4694
- function createActionsHandlerOptions(bsOptions) {
4695
- var options = [
4696
- 'click',
4697
- 'bindToWrapper',
4698
- 'preventDefault',
4699
- 'stopPropagation',
4700
- 'tagException',
4701
- 'preventDefaultException'
4702
- ].reduce(function (prev, cur) {
4703
- prev[cur] = bsOptions[cur];
4704
- return prev;
4705
- }, {});
4706
- return options;
4707
- }
4708
- function createBehaviorOptions(bsOptions, extraProp, bounces, rect) {
4709
- var options = [
4710
- 'momentum',
4711
- 'momentumLimitTime',
4712
- 'momentumLimitDistance',
4713
- 'deceleration',
4714
- 'swipeBounceTime',
4715
- 'swipeTime'
4716
- ].reduce(function (prev, cur) {
4717
- prev[cur] = bsOptions[cur];
4718
- return prev;
4719
- }, {});
4720
- // add extra property
4721
- options.scrollable = bsOptions[extraProp];
4722
- options.bounces = bounces;
4723
- options.rect = rect;
4724
- return options;
4725
- }
4726
-
4727
- function bubbling(source, target, events) {
4728
- events.forEach(function (event) {
4729
- var sourceEvent;
4730
- var targetEvent;
4731
- if (typeof event === 'string') {
4732
- sourceEvent = targetEvent = event;
4733
- }
4734
- else {
4735
- sourceEvent = event.source;
4736
- targetEvent = event.target;
4737
- }
4738
- source.on(sourceEvent, function () {
4739
- var args = [];
4740
- for (var _i = 0; _i < arguments.length; _i++) {
4741
- args[_i] = arguments[_i];
4742
- }
4743
- return target.trigger.apply(target, [targetEvent].concat(args));
4744
- });
4745
- });
4746
- }
4747
-
4748
- var Scroller = /** @class */ (function () {
4749
- function Scroller(wrapper, options) {
4750
- this.hooks = new EventEmitter$1([
4751
- 'beforeStart',
4752
- 'beforeMove',
4753
- 'beforeScrollStart',
4754
- 'scrollStart',
4755
- 'scroll',
4756
- 'beforeEnd',
4757
- 'scrollEnd',
4758
- 'refresh',
4759
- 'touchEnd',
4760
- 'end',
4761
- 'flick',
4762
- 'scrollCancel',
4763
- 'momentum',
4764
- 'scrollTo',
4765
- 'ignoreDisMoveForSamePos',
4766
- 'scrollToElement'
4767
- ]);
4768
- this.wrapper = wrapper;
4769
- this.content = wrapper.children[0];
4770
- this.options = options;
4771
- var _a = this
4772
- .options.bounce, _b = _a.left, left = _b === void 0 ? true : _b, _c = _a.right, right = _c === void 0 ? true : _c, _d = _a.top, top = _d === void 0 ? true : _d, _e = _a.bottom, bottom = _e === void 0 ? true : _e;
4773
- // direction X
4774
- this.scrollBehaviorX = new Behavior(wrapper, createBehaviorOptions(options, 'scrollX', [left, right], {
4775
- size: 'width',
4776
- position: 'left'
4777
- }));
4778
- // direction Y
4779
- this.scrollBehaviorY = new Behavior(wrapper, createBehaviorOptions(options, 'scrollY', [top, bottom], {
4780
- size: 'height',
4781
- position: 'top'
4782
- }));
4783
- this.translater = new Translater(this.content);
4784
- this.animater = createAnimater(this.content, this.translater, this.options);
4785
- this.actionsHandler = new ActionsHandler(wrapper, createActionsHandlerOptions(this.options));
4786
- this.actions = new ScrollerActions(this.scrollBehaviorX, this.scrollBehaviorY, this.actionsHandler, this.animater, this.options);
4787
- var resizeHandler = this.resize.bind(this);
4788
- this.resizeRegister = new EventRegister$2(window, [
4789
- {
4790
- name: 'orientationchange',
4791
- handler: resizeHandler
4792
- },
4793
- {
4794
- name: 'resize',
4795
- handler: resizeHandler
4796
- }
4797
- ]);
4798
- this.transitionEndRegister = new EventRegister$2(this.content, [
4799
- {
4800
- name: style$1.transitionEnd,
4801
- handler: this.transitionEnd.bind(this)
4802
- }
4803
- ]);
4804
- this.init();
4805
- }
4806
- Scroller.prototype.init = function () {
4807
- var _this = this;
4808
- this.bindTranslater();
4809
- this.bindAnimater();
4810
- this.bindActions();
4811
- // enable pointer events when scrolling ends
4812
- this.hooks.on(this.hooks.eventTypes.scrollEnd, function () {
4813
- _this.togglePointerEvents(true);
4814
- });
4815
- };
4816
- Scroller.prototype.bindTranslater = function () {
4817
- var _this = this;
4818
- var hooks = this.translater.hooks;
4819
- hooks.on(hooks.eventTypes.beforeTranslate, function (transformStyle) {
4820
- if (_this.options.translateZ) {
4821
- transformStyle.push(_this.options.translateZ);
4822
- }
4823
- });
4824
- // disable pointer events when scrolling
4825
- hooks.on(hooks.eventTypes.translate, function (pos) {
4826
- _this.updatePositions(pos);
4827
- _this.togglePointerEvents(false);
4828
- });
4829
- };
4830
- Scroller.prototype.bindAnimater = function () {
4831
- var _this = this;
4832
- // reset position
4833
- this.animater.hooks.on(this.animater.hooks.eventTypes.end, function (pos) {
4834
- if (!_this.resetPosition(_this.options.bounceTime)) {
4835
- _this.animater.setPending(false);
4836
- _this.hooks.trigger(_this.hooks.eventTypes.scrollEnd, pos);
4837
- }
4838
- });
4839
- bubbling(this.animater.hooks, this.hooks, [
4840
- {
4841
- source: this.animater.hooks.eventTypes.move,
4842
- target: this.hooks.eventTypes.scroll
4843
- },
4844
- {
4845
- source: this.animater.hooks.eventTypes.forceStop,
4846
- target: this.hooks.eventTypes.scrollEnd
4847
- }
4848
- ]);
4849
- };
4850
- Scroller.prototype.bindActions = function () {
4851
- var _this = this;
4852
- var actions = this.actions;
4853
- bubbling(actions.hooks, this.hooks, [
4854
- {
4855
- source: actions.hooks.eventTypes.start,
4856
- target: this.hooks.eventTypes.beforeStart
4857
- },
4858
- {
4859
- source: actions.hooks.eventTypes.start,
4860
- target: this.hooks.eventTypes.beforeScrollStart // just for event api
4861
- },
4862
- {
4863
- source: actions.hooks.eventTypes.beforeMove,
4864
- target: this.hooks.eventTypes.beforeMove
4865
- },
4866
- {
4867
- source: actions.hooks.eventTypes.scrollStart,
4868
- target: this.hooks.eventTypes.scrollStart
4869
- },
4870
- {
4871
- source: actions.hooks.eventTypes.scroll,
4872
- target: this.hooks.eventTypes.scroll
4873
- },
4874
- {
4875
- source: actions.hooks.eventTypes.beforeEnd,
4876
- target: this.hooks.eventTypes.beforeEnd
4877
- }
4878
- ]);
4879
- actions.hooks.on(actions.hooks.eventTypes.end, function (e, pos) {
4880
- _this.hooks.trigger(_this.hooks.eventTypes.touchEnd, pos);
4881
- if (_this.hooks.trigger(_this.hooks.eventTypes.end, pos)) {
4882
- return true;
4883
- }
4884
- // check if it is a click operation
4885
- if (!actions.moved && _this.checkClick(e)) {
4886
- _this.animater.setForceStopped(false);
4887
- _this.hooks.trigger(_this.hooks.eventTypes.scrollCancel);
4888
- return true;
4889
- }
4890
- _this.animater.setForceStopped(false);
4891
- // reset if we are outside of the boundaries
4892
- if (_this.resetPosition(_this.options.bounceTime, ease.bounce)) {
4893
- return true;
4894
- }
4895
- });
4896
- actions.hooks.on(actions.hooks.eventTypes.scrollEnd, function (pos, duration) {
4897
- var deltaX = Math.abs(pos.x - _this.scrollBehaviorX.startPos);
4898
- var deltaY = Math.abs(pos.y - _this.scrollBehaviorY.startPos);
4899
- if (_this.checkFlick(duration, deltaX, deltaY)) {
4900
- _this.hooks.trigger(_this.hooks.eventTypes.flick);
4901
- return;
4902
- }
4903
- if (_this.momentum(pos, duration)) {
4904
- return;
4905
- }
4906
- _this.hooks.trigger(_this.hooks.eventTypes.scrollEnd, pos);
4907
- });
4908
- };
4909
- Scroller.prototype.checkFlick = function (duration, deltaX, deltaY) {
4910
- // flick
4911
- if (this.hooks.events.flick.length > 1 &&
4912
- duration < this.options.flickLimitTime &&
4913
- deltaX < this.options.flickLimitDistance &&
4914
- deltaY < this.options.flickLimitDistance) {
4915
- return true;
4916
- }
4917
- };
4918
- Scroller.prototype.momentum = function (pos, duration) {
4919
- var meta = {
4920
- time: 0,
4921
- easing: ease.swiper,
4922
- newX: pos.x,
4923
- newY: pos.y
4924
- };
4925
- // start momentum animation if needed
4926
- var momentumX = this.scrollBehaviorX.end(duration);
4927
- var momentumY = this.scrollBehaviorY.end(duration);
4928
- meta.newX = isUndef(momentumX.destination)
4929
- ? meta.newX
4930
- : momentumX.destination;
4931
- meta.newY = isUndef(momentumY.destination)
4932
- ? meta.newY
4933
- : momentumY.destination;
4934
- meta.time = Math.max(momentumX.duration, momentumY.duration);
4935
- this.hooks.trigger(this.hooks.eventTypes.momentum, meta, this);
4936
- // when x or y changed, do momentum animation now!
4937
- if (meta.newX !== pos.x || meta.newY !== pos.y) {
4938
- // change easing function when scroller goes out of the boundaries
4939
- if (meta.newX > this.scrollBehaviorX.minScrollPos ||
4940
- meta.newX < this.scrollBehaviorX.maxScrollPos ||
4941
- meta.newY > this.scrollBehaviorY.minScrollPos ||
4942
- meta.newY < this.scrollBehaviorY.maxScrollPos) {
4943
- meta.easing = ease.swipeBounce;
4944
- }
4945
- this.scrollTo(meta.newX, meta.newY, meta.time, meta.easing);
4946
- return true;
4947
- }
4948
- };
4949
- Scroller.prototype.checkClick = function (e) {
4950
- // when in the process of pulling down, it should not prevent click
4951
- var cancelable = {
4952
- preventClick: this.animater.forceStopped
4953
- };
4954
- // we scrolled less than momentumLimitDistance pixels
4955
- if (this.hooks.trigger(this.hooks.eventTypes.checkClick))
4956
- return true;
4957
- if (!cancelable.preventClick) {
4958
- var _dblclick = this.options.dblclick;
4959
- var dblclickTrigged = false;
4960
- if (_dblclick && this.lastClickTime) {
4961
- var _a = _dblclick.delay, delay = _a === void 0 ? 300 : _a;
4962
- if (getNow() - this.lastClickTime < delay) {
4963
- dblclickTrigged = true;
4964
- dblclick(e);
4965
- }
4966
- }
4967
- if (this.options.tap) {
4968
- tap(e, this.options.tap);
4969
- }
4970
- if (this.options.click &&
4971
- !preventDefaultExceptionFn$1(e.target, this.options.preventDefaultException)) {
4972
- click(e);
4973
- }
4974
- this.lastClickTime = dblclickTrigged ? null : getNow();
4975
- return true;
4976
- }
4977
- return false;
4978
- };
4979
- Scroller.prototype.resize = function () {
4980
- var _this = this;
4981
- if (!this.actions.enabled) {
4982
- return;
4983
- }
4984
- // fix a scroll problem under Android condition
4985
- if (isAndroid) {
4986
- this.wrapper.scrollTop = 0;
4987
- }
4988
- clearTimeout(this.resizeTimeout);
4989
- this.resizeTimeout = window.setTimeout(function () {
4990
- _this.refresh();
4991
- }, this.options.resizePolling);
4992
- };
4993
- Scroller.prototype.transitionEnd = function (e) {
4994
- if (e.target !== this.content || !this.animater.pending) {
4995
- return;
4996
- }
4997
- var animater = this.animater;
4998
- animater.transitionTime();
4999
- if (!this.resetPosition(this.options.bounceTime, ease.bounce)) {
5000
- this.animater.setPending(false);
5001
- if (this.options.probeType !== Probe.Realtime) {
5002
- this.hooks.trigger(this.hooks.eventTypes.scrollEnd, this.getCurrentPos());
5003
- }
5004
- }
5005
- };
5006
- Scroller.prototype.togglePointerEvents = function (enabled) {
5007
- if (enabled === void 0) { enabled = true; }
5008
- var el = this.content.children.length
5009
- ? this.content.children
5010
- : [this.content];
5011
- var pointerEvents = enabled ? 'auto' : 'none';
5012
- for (var i = 0; i < el.length; i++) {
5013
- el[i].style.pointerEvents = pointerEvents;
5014
- }
5015
- };
5016
- Scroller.prototype.refresh = function () {
5017
- this.scrollBehaviorX.refresh();
5018
- this.scrollBehaviorY.refresh();
5019
- this.actions.refresh();
5020
- this.wrapperOffset = offset(this.wrapper);
5021
- };
5022
- Scroller.prototype.scrollBy = function (deltaX, deltaY, time, easing) {
5023
- if (time === void 0) { time = 0; }
5024
- var _a = this.getCurrentPos(), x = _a.x, y = _a.y;
5025
- easing = !easing ? ease.bounce : easing;
5026
- deltaX += x;
5027
- deltaY += y;
5028
- this.scrollTo(deltaX, deltaY, time, easing);
5029
- };
5030
- Scroller.prototype.scrollTo = function (x, y, time, easing, extraTransform, isSilent) {
5031
- if (time === void 0) { time = 0; }
5032
- if (extraTransform === void 0) { extraTransform = {
5033
- start: {},
5034
- end: {}
5035
- }; }
5036
- easing = !easing ? ease.bounce : easing;
5037
- var easingFn = this.options.useTransition ? easing.style : easing.fn;
5038
- var currentPos = this.getCurrentPos();
5039
- var startPoint = __assign({ x: currentPos.x, y: currentPos.y }, extraTransform.start);
5040
- var endPoint = __assign({ x: x,
5041
- y: y }, extraTransform.end);
5042
- this.hooks.trigger(this.hooks.eventTypes.scrollTo, endPoint);
5043
- if (!this.hooks.trigger(this.hooks.eventTypes.ignoreDisMoveForSamePos)) {
5044
- // it is an useless move
5045
- if (startPoint.x === endPoint.x && startPoint.y === endPoint.y) {
5046
- return;
5047
- }
5048
- }
5049
- this.animater.move(startPoint, endPoint, time, easingFn, isSilent);
5050
- };
5051
- Scroller.prototype.scrollToElement = function (el, time, offsetX, offsetY, easing) {
5052
- var targetEle = getElement(el);
5053
- var pos = offset(targetEle);
5054
- var getOffset = function (offset, size, wrapperSize) {
5055
- if (typeof offset === 'number') {
5056
- return offset;
5057
- }
5058
- // if offsetX/Y are true we center the element to the screen
5059
- return offset ? Math.round(size / 2 - wrapperSize / 2) : 0;
5060
- };
5061
- offsetX = getOffset(offsetX, targetEle.offsetWidth, this.wrapper.offsetWidth);
5062
- offsetY = getOffset(offsetY, targetEle.offsetHeight, this.wrapper.offsetHeight);
5063
- var getPos = function (pos, wrapperPos, offset, scrollBehavior) {
5064
- pos -= wrapperPos;
5065
- pos = scrollBehavior.adjustPosition(pos - offset);
5066
- return pos;
5067
- };
5068
- pos.left = getPos(pos.left, this.wrapperOffset.left, offsetX, this.scrollBehaviorX);
5069
- pos.top = getPos(pos.top, this.wrapperOffset.top, offsetY, this.scrollBehaviorY);
5070
- if (this.hooks.trigger(this.hooks.eventTypes.scrollToElement, targetEle, pos)) {
5071
- return;
5072
- }
5073
- this.scrollTo(pos.left, pos.top, time, easing);
5074
- };
5075
- Scroller.prototype.resetPosition = function (time, easing) {
5076
- if (time === void 0) { time = 0; }
5077
- easing = !easing ? ease.bounce : easing;
5078
- var _a = this.scrollBehaviorX.checkInBoundary(), x = _a.position, xInBoundary = _a.inBoundary;
5079
- var _b = this.scrollBehaviorY.checkInBoundary(), y = _b.position, yInBoundary = _b.inBoundary;
5080
- if (xInBoundary && yInBoundary) {
5081
- return false;
5082
- }
5083
- // out of boundary
5084
- this.scrollTo(x, y, time, easing);
5085
- return true;
5086
- };
5087
- Scroller.prototype.updatePositions = function (pos) {
5088
- this.scrollBehaviorX.updatePosition(pos.x);
5089
- this.scrollBehaviorY.updatePosition(pos.y);
5090
- };
5091
- Scroller.prototype.getCurrentPos = function () {
5092
- return this.actions.getCurrentPos();
5093
- };
5094
- Scroller.prototype.enable = function () {
5095
- this.actions.enabled = true;
5096
- };
5097
- Scroller.prototype.disable = function () {
5098
- cancelAnimationFrame(this.animater.timer);
5099
- this.actions.enabled = false;
5100
- };
5101
- Scroller.prototype.destroy = function () {
5102
- var _this = this;
5103
- var keys = [
5104
- 'resizeRegister',
5105
- 'transitionEndRegister',
5106
- 'actionsHandler',
5107
- 'actions',
5108
- 'hooks',
5109
- 'animater',
5110
- 'translater',
5111
- 'scrollBehaviorX',
5112
- 'scrollBehaviorY'
5113
- ];
5114
- keys.forEach(function (key) { return _this[key].destroy(); });
5115
- };
5116
- return Scroller;
5117
- }());
5118
-
5119
- var propertiesConfig = [
5120
- {
5121
- sourceKey: 'scroller.scrollBehaviorX.currentPos',
5122
- key: 'x'
5123
- },
5124
- {
5125
- sourceKey: 'scroller.scrollBehaviorY.currentPos',
5126
- key: 'y'
5127
- },
5128
- {
5129
- sourceKey: 'scroller.scrollBehaviorX.hasScroll',
5130
- key: 'hasHorizontalScroll'
5131
- },
5132
- {
5133
- sourceKey: 'scroller.scrollBehaviorY.hasScroll',
5134
- key: 'hasVerticalScroll'
5135
- },
5136
- {
5137
- sourceKey: 'scroller.scrollBehaviorX.contentSize',
5138
- key: 'scrollerWidth'
5139
- },
5140
- {
5141
- sourceKey: 'scroller.scrollBehaviorY.contentSize',
5142
- key: 'scrollerHeight'
5143
- },
5144
- {
5145
- sourceKey: 'scroller.scrollBehaviorX.maxScrollPos',
5146
- key: 'maxScrollX'
5147
- },
5148
- {
5149
- sourceKey: 'scroller.scrollBehaviorY.maxScrollPos',
5150
- key: 'maxScrollY'
5151
- },
5152
- {
5153
- sourceKey: 'scroller.scrollBehaviorX.minScrollPos',
5154
- key: 'minScrollX'
5155
- },
5156
- {
5157
- sourceKey: 'scroller.scrollBehaviorY.minScrollPos',
5158
- key: 'minScrollY'
5159
- },
5160
- {
5161
- sourceKey: 'scroller.scrollBehaviorX.movingDirection',
5162
- key: 'movingDirectionX'
5163
- },
5164
- {
5165
- sourceKey: 'scroller.scrollBehaviorY.movingDirection',
5166
- key: 'movingDirectionY'
5167
- },
5168
- {
5169
- sourceKey: 'scroller.scrollBehaviorX.direction',
5170
- key: 'directionX'
5171
- },
5172
- {
5173
- sourceKey: 'scroller.scrollBehaviorY.direction',
5174
- key: 'directionY'
5175
- },
5176
- {
5177
- sourceKey: 'scroller.actions.enabled',
5178
- key: 'enabled'
5179
- },
5180
- {
5181
- sourceKey: 'scroller.animater.pending',
5182
- key: 'pending'
5183
- },
5184
- {
5185
- sourceKey: 'scroller.scrollTo',
5186
- key: 'scrollTo'
5187
- },
5188
- {
5189
- sourceKey: 'scroller.scrollBy',
5190
- key: 'scrollBy'
5191
- },
5192
- {
5193
- sourceKey: 'scroller.scrollToElement',
5194
- key: 'scrollToElement'
5195
- },
5196
- {
5197
- sourceKey: 'scroller.resetPosition',
5198
- key: 'resetPosition'
5199
- }
5200
- ];
5201
-
5202
- var EnforceOrder;
5203
- (function (EnforceOrder) {
5204
- EnforceOrder["Pre"] = "pre";
5205
- EnforceOrder["Post"] = "post";
5206
- })(EnforceOrder || (EnforceOrder = {}));
5207
-
5208
- var BScroll = /** @class */ (function (_super) {
5209
- __extends(BScroll, _super);
5210
- function BScroll(el, options) {
5211
- var _this = _super.call(this, [
5212
- 'refresh',
5213
- 'enable',
5214
- 'disable',
5215
- 'beforeScrollStart',
5216
- 'scrollStart',
5217
- 'scroll',
5218
- 'scrollEnd',
5219
- 'scrollCancel',
5220
- 'touchEnd',
5221
- 'flick',
5222
- 'destroy'
5223
- ]) || this;
5224
- var wrapper = getElement(el);
5225
- if (!wrapper) {
5226
- warn$2('Can not resolve the wrapper DOM.');
5227
- return _this;
5228
- }
5229
- var content = wrapper.children[0];
5230
- if (!content) {
5231
- warn$2('The wrapper need at least one child element to be scroller.');
5232
- return _this;
5233
- }
5234
- _this.plugins = {};
5235
- _this.options = new Options().merge(options).process();
5236
- _this.hooks = new EventEmitter$1([
5237
- 'init',
5238
- 'refresh',
5239
- 'enable',
5240
- 'disable',
5241
- 'destroy'
5242
- ]);
5243
- _this.init(wrapper);
5244
- return _this;
5245
- }
5246
- BScroll.use = function (ctor) {
5247
- var name = ctor.pluginName;
5248
- var installed = this.plugins.some(function (plugin) { return ctor === plugin.ctor; });
5249
- if (installed)
5250
- return this;
5251
- if (isUndef(name)) {
5252
- warn$2("Plugin Class must specify plugin's name in static property by 'pluginName' field.");
5253
- return this;
5254
- }
5255
- if (this.pluginsMap[name]) {
5256
- warn$2("This plugin has been registered, maybe you need change plugin's name");
5257
- return this;
5258
- }
5259
- this.pluginsMap[name] = true;
5260
- this.plugins.push({
5261
- name: name,
5262
- enforce: ctor.enforce,
5263
- ctor: ctor
5264
- });
5265
- return this;
5266
- };
5267
- BScroll.prototype.init = function (wrapper) {
5268
- this.wrapper = wrapper;
5269
- this.scroller = new Scroller(wrapper, this.options);
5270
- this.eventBubbling();
5271
- this.handleAutoBlur();
5272
- this.innerRefresh();
5273
- this.scroller.scrollTo(this.options.startX, this.options.startY);
5274
- this.enable();
5275
- this.proxy(propertiesConfig);
5276
- this.applyPlugins();
5277
- };
5278
- BScroll.prototype.applyPlugins = function () {
5279
- var _this = this;
5280
- var options = this.options;
5281
- this.constructor.plugins
5282
- .sort(function (a, b) {
5283
- var _a;
5284
- var enforeOrderMap = (_a = {},
5285
- _a[EnforceOrder.Pre] = -1,
5286
- _a[EnforceOrder.Post] = 1,
5287
- _a);
5288
- var aOrder = a.enforce ? enforeOrderMap[a.enforce] : 0;
5289
- var bOrder = b.enforce ? enforeOrderMap[b.enforce] : 0;
5290
- return aOrder - bOrder;
5291
- })
5292
- .forEach(function (item) {
5293
- var ctor = item.ctor;
5294
- if (options[item.name] && typeof ctor === 'function') {
5295
- _this.plugins[item.name] = new ctor(_this);
5296
- }
5297
- });
5298
- };
5299
- BScroll.prototype.handleAutoBlur = function () {
5300
- if (this.options.autoBlur) {
5301
- this.on(this.eventTypes.beforeScrollStart, function () {
5302
- var activeElement = document.activeElement;
5303
- if (activeElement &&
5304
- (activeElement.tagName === 'INPUT' ||
5305
- activeElement.tagName === 'TEXTAREA')) {
5306
- activeElement.blur();
5307
- }
5308
- });
5309
- }
5310
- };
5311
- BScroll.prototype.eventBubbling = function () {
5312
- bubbling(this.scroller.hooks, this, [
5313
- 'beforeScrollStart',
5314
- 'scrollStart',
5315
- 'scroll',
5316
- 'scrollEnd',
5317
- 'scrollCancel',
5318
- 'touchEnd',
5319
- 'flick'
5320
- ]);
5321
- };
5322
- BScroll.prototype.innerRefresh = function () {
5323
- this.scroller.refresh();
5324
- this.hooks.trigger(this.hooks.eventTypes.refresh);
5325
- this.trigger(this.eventTypes.refresh);
5326
- };
5327
- BScroll.prototype.proxy = function (propertiesConfig) {
5328
- var _this = this;
5329
- propertiesConfig.forEach(function (_a) {
5330
- var key = _a.key, sourceKey = _a.sourceKey;
5331
- propertiesProxy(_this, sourceKey, key);
5332
- });
5333
- };
5334
- BScroll.prototype.refresh = function () {
5335
- this.innerRefresh();
5336
- this.scroller.resetPosition();
5337
- };
5338
- BScroll.prototype.enable = function () {
5339
- this.scroller.enable();
5340
- this.hooks.trigger(this.hooks.eventTypes.enable);
5341
- this.trigger(this.eventTypes.enable);
5342
- };
5343
- BScroll.prototype.disable = function () {
5344
- this.scroller.disable();
5345
- this.hooks.trigger(this.hooks.eventTypes.disable);
5346
- this.trigger(this.eventTypes.disable);
5347
- };
5348
- BScroll.prototype.destroy = function () {
5349
- this.scroller.destroy();
5350
- this.hooks.trigger(this.hooks.eventTypes.destroy);
5351
- this.trigger(this.eventTypes.destroy);
5352
- };
5353
- BScroll.prototype.eventRegister = function (names) {
5354
- this.registerType(names);
5355
- };
5356
- BScroll.version = '2.0.0';
5357
- BScroll.plugins = [];
5358
- BScroll.pluginsMap = {};
5359
- return BScroll;
5360
- }(EventEmitter$1));
5361
-
5362
- /*!
5363
- * better-scroll / scroll-bar
5364
- * (c) 2016-2020 ustbhuangyi
5365
- * Released under the MIT License.
5366
- */
5367
- function warn$1(msg) {
5368
- console.error("[BScroll warn]: " + msg);
5369
- }
5370
-
5371
- // ssr support
5372
- var inBrowser$1 = typeof window !== 'undefined';
5373
- var ua$1 = inBrowser$1 && navigator.userAgent.toLowerCase();
5374
- !!(ua$1 && /wechatdevtools/.test(ua$1));
5375
- ua$1 && ua$1.indexOf('android') > 0;
5376
- ((function () {
5377
- if (typeof ua$1 === 'string') {
5378
- var regex = /os (\d\d?_\d(_\d)?)/;
5379
- var matches = regex.exec(ua$1);
5380
- if (!matches)
5381
- return false;
5382
- var parts = matches[1].split('_').map(function (item) {
5383
- return parseInt(item, 10);
5384
- });
5385
- // ios version >= 13.4 issue 982
5386
- return !!(parts[0] >= 13 && parts[1] >= 4);
5387
- }
5388
- return false;
5389
- }))();
5390
-
5391
- var elementStyle$1 = (inBrowser$1 &&
5392
- document.createElement('div').style);
5393
- var vendor$1 = (function () {
5394
- if (!inBrowser$1) {
5395
- return false;
5396
- }
5397
- var transformNames = [
5398
- {
5399
- key: 'standard',
5400
- value: 'transform',
5401
- },
5402
- {
5403
- key: 'webkit',
5404
- value: 'webkitTransform',
5405
- },
5406
- {
5407
- key: 'Moz',
5408
- value: 'MozTransform',
5409
- },
5410
- {
5411
- key: 'O',
5412
- value: 'OTransform',
5413
- },
5414
- {
5415
- key: 'ms',
5416
- value: 'msTransform',
5417
- },
5418
- ];
5419
- for (var _i = 0, transformNames_1 = transformNames; _i < transformNames_1.length; _i++) {
5420
- var obj = transformNames_1[_i];
5421
- if (elementStyle$1[obj.value] !== undefined) {
5422
- return obj.key;
5423
- }
5424
- }
5425
- return false;
5426
- })();
5427
- function prefixStyle$1(style) {
5428
- if (vendor$1 === false) {
5429
- return style;
5430
- }
5431
- if (vendor$1 === 'standard') {
5432
- if (style === 'transitionEnd') {
5433
- return 'transitionend';
5434
- }
5435
- return style;
5436
- }
5437
- return vendor$1 + style.charAt(0).toUpperCase() + style.substr(1);
5438
- }
5439
- function addEvent$1(el, type, fn, capture) {
5440
- el.addEventListener(type, fn, {
5441
- passive: false,
5442
- capture: !!capture,
5443
- });
5444
- }
5445
- function removeEvent$1(el, type, fn, capture) {
5446
- el.removeEventListener(type, fn, {
5447
- capture: !!capture,
5448
- });
5449
- }
5450
- vendor$1 && vendor$1 !== 'standard' ? '-' + vendor$1.toLowerCase() + '-' : '';
5451
- var transform$1 = prefixStyle$1('transform');
5452
- var transition$1 = prefixStyle$1('transition');
5453
- inBrowser$1 && prefixStyle$1('perspective') in elementStyle$1;
5454
- var style = {
5455
- transform: transform$1,
5456
- transition: transition$1,
5457
- transitionTimingFunction: prefixStyle$1('transitionTimingFunction'),
5458
- transitionDuration: prefixStyle$1('transitionDuration'),
5459
- transitionDelay: prefixStyle$1('transitionDelay'),
5460
- transformOrigin: prefixStyle$1('transformOrigin'),
5461
- transitionEnd: prefixStyle$1('transitionEnd'),
5462
- transitionProperty: prefixStyle$1('transitionProperty'),
5463
- };
5464
-
5465
- /*! *****************************************************************************
5466
- Copyright (c) Microsoft Corporation.
5467
-
5468
- Permission to use, copy, modify, and/or distribute this software for any
5469
- purpose with or without fee is hereby granted.
5470
-
5471
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
5472
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
5473
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
5474
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
5475
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
5476
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
5477
- PERFORMANCE OF THIS SOFTWARE.
5478
- ***************************************************************************** */
5479
-
5480
- function __spreadArrays() {
5481
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
5482
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
5483
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
5484
- r[k] = a[j];
5485
- return r;
5486
- }
5487
-
5488
- var EventEmitter = /** @class */ (function () {
5489
- function EventEmitter(names) {
5490
- this.events = {};
5491
- this.eventTypes = {};
5492
- this.registerType(names);
5493
- }
5494
- EventEmitter.prototype.on = function (type, fn, context) {
5495
- if (context === void 0) { context = this; }
5496
- this.hasType(type);
5497
- if (!this.events[type]) {
5498
- this.events[type] = [];
5499
- }
5500
- this.events[type].push([fn, context]);
5501
- return this;
5502
- };
5503
- EventEmitter.prototype.once = function (type, fn, context) {
5504
- var _this = this;
5505
- if (context === void 0) { context = this; }
5506
- this.hasType(type);
5507
- var magic = function () {
5508
- var args = [];
5509
- for (var _i = 0; _i < arguments.length; _i++) {
5510
- args[_i] = arguments[_i];
5511
- }
5512
- _this.off(type, magic);
5513
- fn.apply(context, args);
5514
- };
5515
- magic.fn = fn;
5516
- this.on(type, magic);
5517
- return this;
5518
- };
5519
- EventEmitter.prototype.off = function (type, fn) {
5520
- if (!type && !fn) {
5521
- this.events = {};
5522
- return this;
5523
- }
5524
- if (type) {
5525
- this.hasType(type);
5526
- if (!fn) {
5527
- this.events[type] = [];
5528
- return this;
5529
- }
5530
- var events = this.events[type];
5531
- if (!events) {
5532
- return this;
5533
- }
5534
- var count = events.length;
5535
- while (count--) {
5536
- if (events[count][0] === fn ||
5537
- (events[count][0] && events[count][0].fn === fn)) {
5538
- events.splice(count, 1);
5539
- }
5540
- }
5541
- return this;
5542
- }
5543
- };
5544
- EventEmitter.prototype.trigger = function (type) {
5545
- var args = [];
5546
- for (var _i = 1; _i < arguments.length; _i++) {
5547
- args[_i - 1] = arguments[_i];
5548
- }
5549
- this.hasType(type);
5550
- var events = this.events[type];
5551
- if (!events) {
5552
- return;
5553
- }
5554
- var len = events.length;
5555
- var eventsCopy = __spreadArrays(events);
5556
- var ret;
5557
- for (var i = 0; i < len; i++) {
5558
- var event_1 = eventsCopy[i];
5559
- var fn = event_1[0], context = event_1[1];
5560
- if (fn) {
5561
- ret = fn.apply(context, args);
5562
- if (ret === true) {
5563
- return ret;
5564
- }
5565
- }
5566
- }
5567
- };
5568
- EventEmitter.prototype.registerType = function (names) {
5569
- var _this = this;
5570
- names.forEach(function (type) {
5571
- _this.eventTypes[type] = type;
5572
- });
5573
- };
5574
- EventEmitter.prototype.destroy = function () {
5575
- this.events = {};
5576
- this.eventTypes = {};
5577
- };
5578
- EventEmitter.prototype.hasType = function (type) {
5579
- var types = this.eventTypes;
5580
- var isType = types[type] === type;
5581
- if (!isType) {
5582
- warn$1("EventEmitter has used unknown event type: \"" + type + "\", should be oneof [" +
5583
- ("" + Object.keys(types).map(function (_) { return JSON.stringify(_); })) +
5584
- "]");
5585
- }
5586
- };
5587
- return EventEmitter;
5588
- }());
5589
- var EventRegister$1 = /** @class */ (function () {
5590
- function EventRegister(wrapper, events) {
5591
- this.wrapper = wrapper;
5592
- this.events = events;
5593
- this.addDOMEvents();
5594
- }
5595
- EventRegister.prototype.destroy = function () {
5596
- this.removeDOMEvents();
5597
- this.events = [];
5598
- };
5599
- EventRegister.prototype.addDOMEvents = function () {
5600
- this.handleDOMEvents(addEvent$1);
5601
- };
5602
- EventRegister.prototype.removeDOMEvents = function () {
5603
- this.handleDOMEvents(removeEvent$1);
5604
- };
5605
- EventRegister.prototype.handleDOMEvents = function (eventOperation) {
5606
- var _this = this;
5607
- var wrapper = this.wrapper;
5608
- this.events.forEach(function (event) {
5609
- eventOperation(wrapper, event.name, _this, !!event.capture);
5610
- });
5611
- };
5612
- EventRegister.prototype.handleEvent = function (e) {
5613
- var eventType = e.type;
5614
- this.events.some(function (event) {
5615
- if (event.name === eventType) {
5616
- event.handler(e);
5617
- return true;
5618
- }
5619
- return false;
5620
- });
5621
- };
5622
- return EventRegister;
5623
- }());
5624
-
5625
- var EventHandler = /** @class */ (function () {
5626
- function EventHandler(indicator, options) {
5627
- this.indicator = indicator;
5628
- this.options = options;
5629
- this.bscroll = indicator.bscroll;
5630
- this.startEventRegister = new EventRegister$1(this.indicator.el, [
5631
- {
5632
- name: options.disableMouse ? 'touchstart' : 'mousedown',
5633
- handler: this._start.bind(this)
5634
- }
5635
- ]);
5636
- this.endEventRegister = new EventRegister$1(window, [
5637
- {
5638
- name: options.disableMouse ? 'touchend' : 'mouseup',
5639
- handler: this._end.bind(this)
5640
- }
5641
- ]);
5642
- this.hooks = new EventEmitter(['touchStart', 'touchMove', 'touchEnd']);
5643
- }
5644
- EventHandler.prototype._start = function (e) {
5645
- if (!this.bscroll.scroller.actions.enabled) {
5646
- return;
5647
- }
5648
- var point = (e.touches ? e.touches[0] : e);
5649
- e.preventDefault();
5650
- e.stopPropagation();
5651
- this.initiated = true;
5652
- this.moved = false;
5653
- this.lastPoint = point[this.indicator.keysMap.pointPos];
5654
- var disableMouse = this.bscroll.options.disableMouse;
5655
- this.moveEventRegister = new EventRegister$1(window, [
5656
- {
5657
- name: disableMouse ? 'touchmove' : 'mousemove',
5658
- handler: this._move.bind(this)
5659
- }
5660
- ]);
5661
- this.hooks.trigger('touchStart');
5662
- };
5663
- EventHandler.prototype._move = function (e) {
5664
- var point = (e.touches ? e.touches[0] : e);
5665
- var pointPos = point[this.indicator.keysMap.pointPos];
5666
- e.preventDefault();
5667
- e.stopPropagation();
5668
- var delta = pointPos - this.lastPoint;
5669
- this.lastPoint = pointPos;
5670
- if (!this.moved) {
5671
- this.hooks.trigger('touchMove', this.moved, delta);
5672
- this.moved = true;
5673
- return;
5674
- }
5675
- this.hooks.trigger('touchMove', this.moved, delta);
5676
- };
5677
- EventHandler.prototype._end = function (e) {
5678
- if (!this.initiated) {
5679
- return;
5680
- }
5681
- this.initiated = false;
5682
- e.preventDefault();
5683
- e.stopPropagation();
5684
- this.moveEventRegister.destroy();
5685
- this.hooks.trigger('touchEnd', this.moved);
5686
- };
5687
- EventHandler.prototype.destroy = function () {
5688
- this.startEventRegister.destroy();
5689
- this.moveEventRegister && this.moveEventRegister.destroy();
5690
- this.endEventRegister.destroy();
5691
- };
5692
- return EventHandler;
5693
- }());
5694
-
5695
- var INDICATOR_MIN_LEN = 8;
5696
- var Indicator = /** @class */ (function () {
5697
- function Indicator(bscroll, options) {
5698
- this.bscroll = bscroll;
5699
- this.options = options;
5700
- this.keyVals = {
5701
- sizeRatio: 1,
5702
- maxPos: 0,
5703
- initialSize: 0
5704
- };
5705
- this.curPos = 0;
5706
- this.hooksHandlers = [];
5707
- this.wrapper = options.wrapper;
5708
- this.wrapperStyle = this.wrapper.style;
5709
- this.el = this.wrapper.children[0];
5710
- this.elStyle = this.el.style;
5711
- this.bscroll = bscroll;
5712
- this.direction = options.direction;
5713
- this.keysMap = this._getKeysMap();
5714
- if (options.fade) {
5715
- this.visible = 0;
5716
- this.wrapperStyle.opacity = '0';
5717
- }
5718
- else {
5719
- this.visible = 1;
5720
- }
5721
- this._listenHooks(options.fade, options.interactive);
5722
- this.refresh();
5723
- }
5724
- Indicator.prototype._listenHooks = function (fade, interactive) {
5725
- var _this = this;
5726
- var bscroll = this.bscroll;
5727
- var bscrollHooks = bscroll;
5728
- var translaterHooks = bscroll.scroller.translater.hooks;
5729
- var animaterHooks = bscroll.scroller.animater.hooks;
5730
- this._listen(bscrollHooks, 'refresh', this.refresh);
5731
- this._listen(translaterHooks, 'translate', this.updatePosAndSize);
5732
- this._listen(animaterHooks, 'time', function (time) {
5733
- _this.setTransitionTime(time);
5734
- });
5735
- this._listen(animaterHooks, 'timeFunction', function (ease) {
5736
- _this.setTransitionTimingFunction(ease);
5737
- });
5738
- if (fade) {
5739
- this._listen(bscrollHooks, 'scrollEnd', function () {
5740
- _this.fade();
5741
- });
5742
- this._listen(bscrollHooks, 'scrollStart', function () {
5743
- _this.fade(true);
5744
- });
5745
- // for mousewheel event
5746
- if (bscroll.eventTypes.mousewheelStart &&
5747
- bscroll.eventTypes.mousewheelEnd) {
5748
- this._listen(bscrollHooks, 'mousewheelStart', function () {
5749
- _this.fade(true);
5750
- });
5751
- this._listen(bscrollHooks, 'mousewheelEnd', function () {
5752
- _this.fade();
5753
- });
5754
- }
5755
- }
5756
- if (interactive) {
5757
- var disableMouse = this.bscroll.options.disableMouse;
5758
- this.eventHandler = new EventHandler(this, { disableMouse: disableMouse });
5759
- var eventHandlerHooks = this.eventHandler.hooks;
5760
- this._listen(eventHandlerHooks, 'touchStart', this.startHandler);
5761
- this._listen(eventHandlerHooks, 'touchMove', this.moveHandler);
5762
- this._listen(eventHandlerHooks, 'touchEnd', this.endHandler);
5763
- }
5764
- };
5765
- Indicator.prototype._getKeysMap = function () {
5766
- if (this.direction === "vertical" /* Vertical */) {
5767
- return {
5768
- hasScroll: 'hasVerticalScroll',
5769
- size: 'height',
5770
- wrapperSize: 'clientHeight',
5771
- scrollerSize: 'scrollerHeight',
5772
- maxScroll: 'maxScrollY',
5773
- pos: 'y',
5774
- pointPos: 'pageY',
5775
- translate: 'translateY'
5776
- };
5777
- }
5778
- return {
5779
- hasScroll: 'hasHorizontalScroll',
5780
- size: 'width',
5781
- wrapperSize: 'clientWidth',
5782
- scrollerSize: 'scrollerWidth',
5783
- maxScroll: 'maxScrollX',
5784
- pos: 'x',
5785
- pointPos: 'pageX',
5786
- translate: 'translateX'
5787
- };
5788
- };
5789
- Indicator.prototype.fade = function (visible) {
5790
- var time = visible ? 250 : 500;
5791
- this.wrapperStyle[style.transitionDuration] = time + 'ms';
5792
- this.wrapperStyle.opacity = visible ? '1' : '0';
5793
- this.visible = visible ? 1 : 0;
5794
- };
5795
- Indicator.prototype.refresh = function () {
5796
- var hasScroll = this.keysMap.hasScroll;
5797
- if (this._setShowBy(this.bscroll[hasScroll])) {
5798
- var _a = this.keysMap, wrapperSize = _a.wrapperSize, scrollerSize = _a.scrollerSize, maxScroll = _a.maxScroll;
5799
- this.keyVals = this._refreshKeyValues(this.wrapper[wrapperSize], this.bscroll[scrollerSize], this.bscroll[maxScroll]);
5800
- this.updatePosAndSize({
5801
- x: this.bscroll.x,
5802
- y: this.bscroll.y
5803
- });
5804
- }
5805
- };
5806
- Indicator.prototype._setShowBy = function (hasScroll) {
5807
- if (hasScroll) {
5808
- this.wrapper.style.display = '';
5809
- return true;
5810
- }
5811
- this.wrapper.style.display = 'none';
5812
- return false;
5813
- };
5814
- Indicator.prototype._refreshKeyValues = function (wrapperSize, scrollerSize, maxScroll) {
5815
- var initialSize = Math.max(Math.round((wrapperSize * wrapperSize) / (scrollerSize || wrapperSize || 1)), INDICATOR_MIN_LEN);
5816
- var maxPos = wrapperSize - initialSize;
5817
- // sizeRatio is negative
5818
- var sizeRatio = maxPos / maxScroll;
5819
- return {
5820
- initialSize: initialSize,
5821
- maxPos: maxPos,
5822
- sizeRatio: sizeRatio
5823
- };
5824
- };
5825
- Indicator.prototype.updatePosAndSize = function (endPoint) {
5826
- var _a = this._refreshPosAndSizeValue(endPoint, this.keyVals), pos = _a.pos, size = _a.size;
5827
- this.curPos = pos;
5828
- this._refreshPosAndSizeStyle(size, pos);
5829
- };
5830
- Indicator.prototype._refreshPosAndSizeValue = function (endPoint, keyVals) {
5831
- var posKey = this.keysMap.pos;
5832
- var sizeRatio = keyVals.sizeRatio, initialSize = keyVals.initialSize, maxPos = keyVals.maxPos;
5833
- var pos = Math.round(sizeRatio * endPoint[posKey]);
5834
- var size;
5835
- if (pos < 0) {
5836
- size = Math.max(initialSize + pos * 3, INDICATOR_MIN_LEN);
5837
- pos = 0;
5838
- }
5839
- else if (pos > maxPos) {
5840
- size = Math.max(initialSize - (pos - maxPos) * 3, INDICATOR_MIN_LEN);
5841
- pos = maxPos + initialSize - size;
5842
- }
5843
- else {
5844
- size = initialSize;
5845
- }
5846
- return {
5847
- pos: pos,
5848
- size: size
5849
- };
5850
- };
5851
- Indicator.prototype._refreshPosAndSizeStyle = function (size, pos) {
5852
- var _a = this.keysMap, translate = _a.translate, sizeKey = _a.size;
5853
- this.elStyle[sizeKey] = size + "px";
5854
- this.elStyle[style.transform] = translate + "(" + pos + "px)" + this.bscroll.options.translateZ;
5855
- };
5856
- Indicator.prototype.setTransitionTime = function (time) {
5857
- if (time === void 0) { time = 0; }
5858
- this.elStyle[style.transitionDuration] = time + 'ms';
5859
- };
5860
- Indicator.prototype.setTransitionTimingFunction = function (easing) {
5861
- this.elStyle[style.transitionTimingFunction] = easing;
5862
- };
5863
- Indicator.prototype.startHandler = function () {
5864
- this.setTransitionTime();
5865
- this.bscroll.trigger('beforeScrollStart');
5866
- };
5867
- Indicator.prototype.moveHandler = function (moved, delta) {
5868
- if (!moved) {
5869
- this.bscroll.trigger('scrollStart');
5870
- }
5871
- var newScrollPos = this._calScrollDesPos(this.curPos, delta, this.keyVals);
5872
- // TODO freeScroll ?
5873
- if (this.direction === "vertical" /* Vertical */) {
5874
- this.bscroll.scrollTo(this.bscroll.x, newScrollPos);
5875
- }
5876
- else {
5877
- this.bscroll.scrollTo(newScrollPos, this.bscroll.y);
5878
- }
5879
- this.bscroll.trigger('scroll', {
5880
- x: this.bscroll.x,
5881
- y: this.bscroll.y
5882
- });
5883
- };
5884
- Indicator.prototype._calScrollDesPos = function (curPos, delta, keyVals) {
5885
- var maxPos = keyVals.maxPos, sizeRatio = keyVals.sizeRatio;
5886
- var newPos = curPos + delta;
5887
- if (newPos < 0) {
5888
- newPos = 0;
5889
- }
5890
- else if (newPos > maxPos) {
5891
- newPos = maxPos;
5892
- }
5893
- return Math.round(newPos / sizeRatio);
5894
- };
5895
- Indicator.prototype.endHandler = function (moved) {
5896
- if (moved) {
5897
- this.bscroll.trigger('scrollEnd', {
5898
- x: this.bscroll.x,
5899
- y: this.bscroll.y
5900
- });
5901
- }
5902
- };
5903
- Indicator.prototype.destroy = function () {
5904
- if (this.options.interactive) {
5905
- this.eventHandler.destroy();
5906
- }
5907
- this.wrapper.parentNode.removeChild(this.wrapper);
5908
- this.hooksHandlers.forEach(function (item) {
5909
- var hooks = item[0];
5910
- var hooksName = item[1];
5911
- var handlerFn = item[2];
5912
- hooks.off(hooksName, handlerFn);
5913
- });
5914
- this.hooksHandlers.length = 0;
5915
- };
5916
- Indicator.prototype._listen = function (hooks, name, handler) {
5917
- hooks.on(name, handler, this);
5918
- this.hooksHandlers.push([hooks, name, handler]);
5919
- };
5920
- return Indicator;
5921
- }());
5922
-
5923
- var ScrollBar = /** @class */ (function () {
5924
- function ScrollBar(scroll) {
5925
- this.indicators = [];
5926
- this.indicators = this.createIndicators(scroll);
5927
- scroll.on(scroll.eventTypes.destroy, this.destroy, this);
5928
- }
5929
- ScrollBar.prototype.createIndicators = function (bscroll) {
5930
- var _this = this;
5931
- var _a = bscroll.options
5932
- .scrollbar, _b = _a.fade, fade = _b === void 0 ? true : _b, _c = _a.interactive, interactive = _c === void 0 ? false : _c;
5933
- var indicatorOption;
5934
- var scrolls = {
5935
- scrollX: "horizontal" /* Horizontal */,
5936
- scrollY: "vertical" /* Vertical */
5937
- };
5938
- var indicators = [];
5939
- Object.keys(scrolls).forEach(function (key) {
5940
- var direction = scrolls[key];
5941
- if (bscroll.options[key]) {
5942
- indicatorOption = {
5943
- wrapper: _this.createIndicatorElement(direction),
5944
- direction: direction,
5945
- fade: fade,
5946
- interactive: interactive
5947
- };
5948
- bscroll.wrapper.appendChild(indicatorOption.wrapper);
5949
- indicators.push(new Indicator(bscroll, indicatorOption));
5950
- }
5951
- });
5952
- return indicators;
5953
- };
5954
- ScrollBar.prototype.createIndicatorElement = function (direction) {
5955
- var scrollbarEl = document.createElement('div');
5956
- var indicatorEl = document.createElement('div');
5957
- scrollbarEl.style.cssText =
5958
- 'position:absolute;z-index:9999;pointerEvents:none';
5959
- indicatorEl.style.cssText =
5960
- 'box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px;';
5961
- indicatorEl.className = 'bscroll-indicator';
5962
- if (direction === 'horizontal') {
5963
- scrollbarEl.style.cssText += ';height:7px;left:2px;right:2px;bottom:0';
5964
- indicatorEl.style.height = '100%';
5965
- scrollbarEl.className = 'bscroll-horizontal-scrollbar';
5966
- }
5967
- else {
5968
- scrollbarEl.style.cssText += ';width:7px;bottom:2px;top:2px;right:1px';
5969
- indicatorEl.style.width = '100%';
5970
- scrollbarEl.className = 'bscroll-vertical-scrollbar';
5971
- }
5972
- scrollbarEl.style.cssText += ';overflow:hidden';
5973
- scrollbarEl.appendChild(indicatorEl);
5974
- return scrollbarEl;
5975
- };
5976
- ScrollBar.prototype.destroy = function () {
5977
- for (var _i = 0, _a = this.indicators; _i < _a.length; _i++) {
5978
- var indicator = _a[_i];
5979
- indicator.destroy();
5980
- }
5981
- };
5982
- ScrollBar.pluginName = 'scrollbar';
5983
- return ScrollBar;
5984
- }());
5985
-
5986
- /*!
5987
- * better-scroll / mouse-wheel
5988
- * (c) 2016-2020 ustbhuangyi
5989
- * Released under the MIT License.
5990
- */
5991
- function warn(msg) {
5992
- console.error("[BScroll warn]: " + msg);
5993
- }
5994
-
5995
- // ssr support
5996
- var inBrowser = typeof window !== 'undefined';
5997
- var ua = inBrowser && navigator.userAgent.toLowerCase();
5998
- !!(ua && /wechatdevtools/.test(ua));
5999
- ua && ua.indexOf('android') > 0;
6000
- ((function () {
6001
- if (typeof ua === 'string') {
6002
- var regex = /os (\d\d?_\d(_\d)?)/;
6003
- var matches = regex.exec(ua);
6004
- if (!matches)
6005
- return false;
6006
- var parts = matches[1].split('_').map(function (item) {
6007
- return parseInt(item, 10);
6008
- });
6009
- // ios version >= 13.4 issue 982
6010
- return !!(parts[0] >= 13 && parts[1] >= 4);
6011
- }
6012
- return false;
6013
- }))();
6014
-
6015
- var extend = function (target, source) {
6016
- for (var key in source) {
6017
- target[key] = source[key];
6018
- }
6019
- return target;
6020
- };
6021
-
6022
- var elementStyle = (inBrowser &&
6023
- document.createElement('div').style);
6024
- var vendor = (function () {
6025
- if (!inBrowser) {
6026
- return false;
6027
- }
6028
- var transformNames = [
6029
- {
6030
- key: 'standard',
6031
- value: 'transform',
6032
- },
6033
- {
6034
- key: 'webkit',
6035
- value: 'webkitTransform',
6036
- },
6037
- {
6038
- key: 'Moz',
6039
- value: 'MozTransform',
6040
- },
6041
- {
6042
- key: 'O',
6043
- value: 'OTransform',
6044
- },
6045
- {
6046
- key: 'ms',
6047
- value: 'msTransform',
6048
- },
6049
- ];
6050
- for (var _i = 0, transformNames_1 = transformNames; _i < transformNames_1.length; _i++) {
6051
- var obj = transformNames_1[_i];
6052
- if (elementStyle[obj.value] !== undefined) {
6053
- return obj.key;
6054
- }
6055
- }
6056
- return false;
6057
- })();
6058
- function prefixStyle(style) {
6059
- if (vendor === false) {
6060
- return style;
6061
- }
6062
- if (vendor === 'standard') {
6063
- if (style === 'transitionEnd') {
6064
- return 'transitionend';
6065
- }
6066
- return style;
6067
- }
6068
- return vendor + style.charAt(0).toUpperCase() + style.substr(1);
6069
- }
6070
- function addEvent(el, type, fn, capture) {
6071
- el.addEventListener(type, fn, {
6072
- passive: false,
6073
- capture: !!capture,
6074
- });
6075
- }
6076
- function removeEvent(el, type, fn, capture) {
6077
- el.removeEventListener(type, fn, {
6078
- capture: !!capture,
6079
- });
6080
- }
6081
- vendor && vendor !== 'standard' ? '-' + vendor.toLowerCase() + '-' : '';
6082
- var transform = prefixStyle('transform');
6083
- var transition = prefixStyle('transition');
6084
- inBrowser && prefixStyle('perspective') in elementStyle;
6085
- ({
6086
- transform: transform,
6087
- transition: transition,
6088
- transitionTimingFunction: prefixStyle('transitionTimingFunction'),
6089
- transitionDuration: prefixStyle('transitionDuration'),
6090
- transitionDelay: prefixStyle('transitionDelay'),
6091
- transformOrigin: prefixStyle('transformOrigin'),
6092
- transitionEnd: prefixStyle('transitionEnd'),
6093
- transitionProperty: prefixStyle('transitionProperty'),
6094
- });
6095
- function preventDefaultExceptionFn(el, exceptions) {
6096
- for (var i in exceptions) {
6097
- if (exceptions[i].test(el[i])) {
6098
- return true;
6099
- }
6100
- }
6101
- return false;
6102
- }
6103
-
6104
- var EventRegister = /** @class */ (function () {
6105
- function EventRegister(wrapper, events) {
6106
- this.wrapper = wrapper;
6107
- this.events = events;
6108
- this.addDOMEvents();
6109
- }
6110
- EventRegister.prototype.destroy = function () {
6111
- this.removeDOMEvents();
6112
- this.events = [];
6113
- };
6114
- EventRegister.prototype.addDOMEvents = function () {
6115
- this.handleDOMEvents(addEvent);
6116
- };
6117
- EventRegister.prototype.removeDOMEvents = function () {
6118
- this.handleDOMEvents(removeEvent);
6119
- };
6120
- EventRegister.prototype.handleDOMEvents = function (eventOperation) {
6121
- var _this = this;
6122
- var wrapper = this.wrapper;
6123
- this.events.forEach(function (event) {
6124
- eventOperation(wrapper, event.name, _this, !!event.capture);
6125
- });
6126
- };
6127
- EventRegister.prototype.handleEvent = function (e) {
6128
- var eventType = e.type;
6129
- this.events.some(function (event) {
6130
- if (event.name === eventType) {
6131
- event.handler(e);
6132
- return true;
6133
- }
6134
- return false;
6135
- });
6136
- };
6137
- return EventRegister;
6138
- }());
6139
-
6140
- var MouseWheel = /** @class */ (function () {
6141
- function MouseWheel(scroll) {
6142
- this.scroll = scroll;
6143
- this.wheelEndTimer = 0;
6144
- this.wheelMoveTimer = 0;
6145
- this.wheelStart = false;
6146
- this.init();
6147
- }
6148
- MouseWheel.prototype.init = function () {
6149
- this.handleBScroll();
6150
- this.handleOptions();
6151
- this.handleHooks();
6152
- this.registerEvent();
6153
- };
6154
- MouseWheel.prototype.handleBScroll = function () {
6155
- this.scroll.registerType([
6156
- 'alterOptions',
6157
- 'mousewheelStart',
6158
- 'mousewheelMove',
6159
- 'mousewheelEnd',
6160
- ]);
6161
- };
6162
- MouseWheel.prototype.handleOptions = function () {
6163
- var userOptions = (this.scroll.options.mouseWheel === true
6164
- ? {}
6165
- : this.scroll.options.mouseWheel);
6166
- var defaultOptions = {
6167
- speed: 20,
6168
- invert: false,
6169
- easeTime: 300,
6170
- discreteTime: 400,
6171
- throttleTime: 0,
6172
- dampingFactor: 0.1,
6173
- };
6174
- this.mouseWheelOpt = extend(defaultOptions, userOptions);
6175
- };
6176
- MouseWheel.prototype.handleHooks = function () {
6177
- this.hooksFn = [];
6178
- this.registerHooks(this.scroll.hooks, 'destroy', this.destroy);
6179
- };
6180
- MouseWheel.prototype.registerEvent = function () {
6181
- this.eventRegister = new EventRegister(this.scroll.scroller.wrapper, [
6182
- {
6183
- name: 'wheel',
6184
- handler: this.wheelHandler.bind(this),
6185
- },
6186
- {
6187
- name: 'mousewheel',
6188
- handler: this.wheelHandler.bind(this),
6189
- },
6190
- {
6191
- name: 'DOMMouseScroll',
6192
- handler: this.wheelHandler.bind(this),
6193
- },
6194
- ]);
6195
- };
6196
- MouseWheel.prototype.registerHooks = function (hooks, name, handler) {
6197
- hooks.on(name, handler, this);
6198
- this.hooksFn.push([hooks, name, handler]);
6199
- };
6200
- MouseWheel.prototype.wheelHandler = function (e) {
6201
- if (!this.scroll.enabled) {
6202
- return;
6203
- }
6204
- this.beforeHandler(e);
6205
- // start
6206
- if (!this.wheelStart) {
6207
- this.wheelStartHandler(e);
6208
- this.wheelStart = true;
6209
- }
6210
- // move
6211
- var delta = this.getWheelDelta(e);
6212
- this.wheelMoveHandler(delta);
6213
- // end
6214
- this.wheelEndDetector(delta);
6215
- };
6216
- MouseWheel.prototype.wheelStartHandler = function (e) {
6217
- this.cleanCache();
6218
- var _a = this.scroll.scroller, scrollBehaviorX = _a.scrollBehaviorX, scrollBehaviorY = _a.scrollBehaviorY;
6219
- scrollBehaviorX.setMovingDirection(0 /* Default */);
6220
- scrollBehaviorY.setMovingDirection(0 /* Default */);
6221
- scrollBehaviorX.setDirection(0 /* Default */);
6222
- scrollBehaviorY.setDirection(0 /* Default */);
6223
- this.scroll.trigger(this.scroll.eventTypes.alterOptions, this.mouseWheelOpt);
6224
- this.scroll.trigger(this.scroll.eventTypes.mousewheelStart);
6225
- };
6226
- MouseWheel.prototype.cleanCache = function () {
6227
- this.deltaCache = [];
6228
- };
6229
- MouseWheel.prototype.wheelMoveHandler = function (delta) {
6230
- var _this = this;
6231
- var _a = this.mouseWheelOpt, throttleTime = _a.throttleTime, dampingFactor = _a.dampingFactor;
6232
- if (throttleTime && this.wheelMoveTimer) {
6233
- this.deltaCache.push(delta);
6234
- }
6235
- else {
6236
- var cachedDelta = this.deltaCache.reduce(function (prev, current) {
6237
- return {
6238
- x: prev.x + current.x,
6239
- y: prev.y + current.y,
6240
- };
6241
- }, { x: 0, y: 0 });
6242
- this.cleanCache();
6243
- var _b = this.scroll.scroller, scrollBehaviorX = _b.scrollBehaviorX, scrollBehaviorY = _b.scrollBehaviorY;
6244
- scrollBehaviorX.setMovingDirection(-delta.directionX);
6245
- scrollBehaviorY.setMovingDirection(-delta.directionY);
6246
- scrollBehaviorX.setDirection(delta.x);
6247
- scrollBehaviorY.setDirection(delta.y);
6248
- // when out of boundary, perform a damping scroll
6249
- var newX = scrollBehaviorX.performDampingAlgorithm(Math.round(delta.x) + cachedDelta.x, dampingFactor);
6250
- var newY = scrollBehaviorY.performDampingAlgorithm(Math.round(delta.y) + cachedDelta.x, dampingFactor);
6251
- if (!this.scroll.trigger(this.scroll.eventTypes.mousewheelMove, {
6252
- x: newX,
6253
- y: newY,
6254
- })) {
6255
- var easeTime = this.getEaseTime();
6256
- if (newX !== this.scroll.x || newY !== this.scroll.y) {
6257
- this.scroll.scrollTo(newX, newY, easeTime);
6258
- }
6259
- }
6260
- if (throttleTime) {
6261
- this.wheelMoveTimer = window.setTimeout(function () {
6262
- _this.wheelMoveTimer = 0;
6263
- }, throttleTime);
6264
- }
6265
- }
6266
- };
6267
- MouseWheel.prototype.wheelEndDetector = function (delta) {
6268
- var _this = this;
6269
- window.clearTimeout(this.wheelEndTimer);
6270
- this.wheelEndTimer = window.setTimeout(function () {
6271
- _this.wheelStart = false;
6272
- window.clearTimeout(_this.wheelMoveTimer);
6273
- _this.wheelMoveTimer = 0;
6274
- _this.scroll.trigger(_this.scroll.eventTypes.mousewheelEnd, delta);
6275
- }, this.mouseWheelOpt.discreteTime);
6276
- };
6277
- MouseWheel.prototype.getWheelDelta = function (e) {
6278
- var _a = this.mouseWheelOpt, speed = _a.speed, invert = _a.invert;
6279
- var wheelDeltaX = 0;
6280
- var wheelDeltaY = 0;
6281
- var direction = invert ? -1 /* Negative */ : 1 /* Positive */;
6282
- switch (true) {
6283
- case 'deltaX' in e:
6284
- if (e.deltaMode === 1) {
6285
- wheelDeltaX = -e.deltaX * speed;
6286
- wheelDeltaY = -e.deltaY * speed;
6287
- }
6288
- else {
6289
- wheelDeltaX = -e.deltaX;
6290
- wheelDeltaY = -e.deltaY;
6291
- }
6292
- break;
6293
- case 'wheelDeltaX' in e:
6294
- wheelDeltaX = (e.wheelDeltaX / 120) * speed;
6295
- wheelDeltaY = (e.wheelDeltaY / 120) * speed;
6296
- break;
6297
- case 'wheelDelta' in e:
6298
- wheelDeltaX = wheelDeltaY = (e.wheelDelta / 120) * speed;
6299
- break;
6300
- case 'detail' in e:
6301
- wheelDeltaX = wheelDeltaY = (-e.detail / 3) * speed;
6302
- break;
6303
- }
6304
- wheelDeltaX *= direction;
6305
- wheelDeltaY *= direction;
6306
- if (!this.scroll.hasVerticalScroll) {
6307
- wheelDeltaX = wheelDeltaY;
6308
- wheelDeltaY = 0;
6309
- }
6310
- if (!this.scroll.hasHorizontalScroll) {
6311
- wheelDeltaX = 0;
6312
- }
6313
- var directionX = wheelDeltaX > 0
6314
- ? -1 /* Negative */
6315
- : wheelDeltaX < 0
6316
- ? 1 /* Positive */
6317
- : 0 /* Default */;
6318
- var directionY = wheelDeltaY > 0
6319
- ? -1 /* Negative */
6320
- : wheelDeltaY < 0
6321
- ? 1 /* Positive */
6322
- : 0 /* Default */;
6323
- return {
6324
- x: wheelDeltaX,
6325
- y: wheelDeltaY,
6326
- directionX: directionX,
6327
- directionY: directionY,
6328
- };
6329
- };
6330
- MouseWheel.prototype.beforeHandler = function (e) {
6331
- var _a = this.scroll.options, preventDefault = _a.preventDefault, stopPropagation = _a.stopPropagation, preventDefaultException = _a.preventDefaultException;
6332
- if (preventDefault &&
6333
- !preventDefaultExceptionFn(e.target, preventDefaultException)) {
6334
- e.preventDefault();
6335
- }
6336
- if (stopPropagation) {
6337
- e.stopPropagation();
6338
- }
6339
- };
6340
- MouseWheel.prototype.getEaseTime = function () {
6341
- var SAFE_EASETIME = 100;
6342
- var easeTime = this.mouseWheelOpt.easeTime;
6343
- // scrollEnd event will be triggered in every calling of scrollTo when easeTime is too small
6344
- // easeTime needs to be greater than 100
6345
- if (easeTime < SAFE_EASETIME) {
6346
- warn("easeTime should be greater than 100." +
6347
- "If mouseWheel easeTime is too small," +
6348
- "scrollEnd will be triggered many times.");
6349
- }
6350
- return Math.max(easeTime, SAFE_EASETIME);
6351
- };
6352
- MouseWheel.prototype.destroy = function () {
6353
- this.eventRegister.destroy();
6354
- window.clearTimeout(this.wheelEndTimer);
6355
- window.clearTimeout(this.wheelMoveTimer);
6356
- this.hooksFn.forEach(function (item) {
6357
- var hooks = item[0];
6358
- var hooksName = item[1];
6359
- var handlerFn = item[2];
6360
- hooks.off(hooksName, handlerFn);
6361
- });
6362
- };
6363
- MouseWheel.pluginName = 'mouseWheel';
6364
- MouseWheel.applyOrder = "pre" /* Pre */;
6365
- return MouseWheel;
6366
- }());
6367
-
6368
- //
6369
- BScroll.use(ScrollBar);
6370
- BScroll.use(MouseWheel);
6371
- var script$2 = {
6372
- name: 'ScrollableArea',
6373
- data: () => ({
6374
- scroll: null,
6375
- changed: 0,
6376
- hasSlotContent: false,
6377
- observer: null,
6378
- scrollOptions: {
6379
- scrollbar: {
6380
- fade: false,
6381
- interactive: true
6382
- },
6383
- click: true,
6384
- mouseWheel: {
6385
- speed: 20,
6386
- invert: false
6387
- }
6388
- }
6389
- }),
6390
-
6391
- beforeUpdate() {
6392
- this.hasSlotContent = this.checkForSlotContent();
6393
- },
6394
-
6395
- beforeDestroy: function () {
6396
- // Clean up
6397
- this.observer.disconnect();
6398
- },
6399
-
6400
- created() {
6401
- this.hasSlotContent = this.checkForSlotContent();
6402
- },
6403
-
6404
- updated() {
6405
- this.$nextTick(() => {
6406
- if (this.scroll) {
6407
- this.scroll.refresh();
6408
- }
6409
- });
6410
- },
6411
-
6412
- mounted() {
6413
- this.$nextTick(() => {
6414
- if (!this.scroll) {
6415
- this.scroll = new BScroll(this.$refs.area, this.scrollOptions);
6416
- }
6417
- });
6418
- let classes = ["scrollable", "bscroll-vertical-scrollbar"];
6419
- this.observer = new MutationObserver(function (mutations) {
6420
- let className;
6421
- let reload = false;
6422
- let mut;
6423
-
6424
- for (let m in mutations) {
6425
- mut = mutations[m];
6426
- className = mut.target.className;
6427
-
6428
- if (!(mut.type == "attributes" || classes.indexOf(className) > -1)) {
6429
- reload = true;
6430
- }
6431
- }
6432
-
6433
- if (reload) {
6434
- this.changed++;
6435
- } //
6436
-
6437
- }.bind(this)); // Setup the observer
6438
-
6439
- this.observer.observe(this.$refs.area, {
6440
- attributes: true,
6441
- childList: true,
6442
- characterData: true,
6443
- subtree: true
6444
- });
6445
- },
6446
-
6447
- watch: {
6448
- changed: function (newVal) {
6449
- // watch it
6450
- if (newVal) {
6451
- this.makeScroll();
6452
- }
6453
- },
6454
- hasSlotContent: function (val) {}
6455
- },
6456
- methods: {
6457
- activate() {
6458
- this.makeScroll();
6459
- },
6460
-
6461
- checkForSlotContent() {
6462
- let checkForContent = (hasContent, node) => {
6463
- return hasContent || node.tag || node.text && node.text.trim();
6464
- };
6465
-
6466
- return this.$slots.default && this.$slots.default.reduce(checkForContent, false);
6467
- },
6468
-
6469
- makeScroll() {
6470
- this.$nextTick(() => {
6471
- this.$nextTick(() => {
6472
- if (this.scroll) {
6473
- this.scroll.destroy();
6474
- this.scroll = null;
6475
- }
6476
-
6477
- this.scroll = new BScroll(this.$refs.area, this.scrollOptions);
6478
- });
6479
- });
6480
- },
6481
-
6482
- reset() {
6483
- this.$nextTick(() => {
6484
- if (this.scroll) {
6485
- this.scroll.refresh();
6486
- }
6487
- });
6488
- }
6489
-
6490
- }
6491
- };
6492
-
6493
- /* script */
6494
- const __vue_script__$2 = script$2;
6495
- /* template */
6496
-
6497
- var __vue_render__$2 = function () {
6498
- var _vm = this;
6499
-
6500
- var _h = _vm.$createElement;
6501
-
6502
- var _c = _vm._self._c || _h;
6503
-
6504
- return _c('div', {
6505
- ref: "area",
6506
- staticClass: "wf-component scrollable"
6507
- }, [_vm._t("default")], 2);
6508
- };
6509
-
6510
- var __vue_staticRenderFns__$2 = [];
6511
- /* style */
6512
-
6513
- const __vue_inject_styles__$2 = function (inject) {
6514
- if (!inject) return;
6515
- inject("data-v-a5c2b274_0", {
6516
- source: ".scrollable[data-v-a5c2b274]{overflow:hidden;width:100%;height:100%}",
6517
- map: undefined,
6518
- media: undefined
6519
- });
6520
- };
6521
- /* scoped */
6522
-
6523
-
6524
- const __vue_scope_id__$2 = "data-v-a5c2b274";
3386
+ const __vue_scope_id__$2 = "data-v-21e68d18";
6525
3387
  /* module identifier */
6526
3388
 
6527
3389
  const __vue_module_identifier__$2 = undefined;
6528
3390
  /* functional template */
6529
3391
 
6530
3392
  const __vue_is_functional_template__$2 = false;
3393
+ /* style inject */
3394
+
6531
3395
  /* style inject SSR */
6532
3396
 
6533
3397
  /* style inject shadow dom */
@@ -6535,7 +3399,7 @@ const __vue_is_functional_template__$2 = false;
6535
3399
  const __vue_component__$2 = /*#__PURE__*/normalizeComponent({
6536
3400
  render: __vue_render__$2,
6537
3401
  staticRenderFns: __vue_staticRenderFns__$2
6538
- }, __vue_inject_styles__$2, __vue_script__$2, __vue_scope_id__$2, __vue_is_functional_template__$2, __vue_module_identifier__$2, false, createInjector, undefined, undefined);
3402
+ }, __vue_inject_styles__$2, __vue_script__$2, __vue_scope_id__$2, __vue_is_functional_template__$2, __vue_module_identifier__$2, false, undefined, undefined, undefined);
6539
3403
 
6540
3404
  //
6541
3405
  var script$1 = {