vue-custom-scrollview
Version:
基于 Vue better-scroll的移动端滚动组件,支持自定义上下拉样式
1,578 lines (1,344 loc) • 144 kB
JavaScript
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "9c03");
/******/ })
/************************************************************************/
/******/ ({
/***/ "0a82":
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__("170f");
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var add = __webpack_require__("85cb").default
var update = add("244ca892", content, true, {"sourceMap":false,"shadowMode":false});
/***/ }),
/***/ "109e":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _node_modules_vue_style_loader_4_1_2_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_1_0_1_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_15_7_1_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_7_2_0_sass_loader_lib_loader_js_ref_8_oneOf_1_4_node_modules_cache_loader_2_0_1_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_15_7_1_vue_loader_lib_index_js_vue_loader_options_Scroll_vue_vue_type_style_index_0_id_7ca1b9e2_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("0a82");
/* harmony import */ var _node_modules_vue_style_loader_4_1_2_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_1_0_1_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_15_7_1_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_7_2_0_sass_loader_lib_loader_js_ref_8_oneOf_1_4_node_modules_cache_loader_2_0_1_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_15_7_1_vue_loader_lib_index_js_vue_loader_options_Scroll_vue_vue_type_style_index_0_id_7ca1b9e2_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_4_1_2_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_1_0_1_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_15_7_1_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_7_2_0_sass_loader_lib_loader_js_ref_8_oneOf_1_4_node_modules_cache_loader_2_0_1_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_15_7_1_vue_loader_lib_index_js_vue_loader_options_Scroll_vue_vue_type_style_index_0_id_7ca1b9e2_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
/* unused harmony reexport * */
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_vue_style_loader_4_1_2_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_1_0_1_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_15_7_1_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_7_2_0_sass_loader_lib_loader_js_ref_8_oneOf_1_4_node_modules_cache_loader_2_0_1_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_15_7_1_vue_loader_lib_index_js_vue_loader_options_Scroll_vue_vue_type_style_index_0_id_7ca1b9e2_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default.a);
/***/ }),
/***/ "170f":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("690e")(false);
// imports
// module
exports.push([module.i, ".pulldown[data-v-7ca1b9e2]{position:absolute;left:0;top:-60px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;height:60px}", ""]);
// exports
/***/ }),
/***/ "2f7c":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("690e")(false);
// imports
// module
exports.push([module.i, ".pswp__preloader__icn[data-v-ea894aa6]{opacity:.75;width:24px;height:24px;-webkit-animation:clockwise-data-v-ea894aa6 .5s linear infinite;animation:clockwise-data-v-ea894aa6 .5s linear infinite}.pswp__preloader__cut[data-v-ea894aa6]{position:relative;width:12px;height:24px;overflow:hidden;position:absolute;top:0;left:0}.pswp__preloader__donut[data-v-ea894aa6]{-webkit-box-sizing:border-box;box-sizing:border-box;width:24px;height:24px;border:2px solid #000;border-radius:50%;border-left-color:transparent;border-bottom-color:transparent;position:absolute;top:0;left:0;background:none;margin:0;-webkit-animation:donut-rotate-data-v-ea894aa6 1s cubic-bezier(.4,0,.22,1) infinite;animation:donut-rotate-data-v-ea894aa6 1s cubic-bezier(.4,0,.22,1) infinite}@-webkit-keyframes clockwise-data-v-ea894aa6{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes clockwise-data-v-ea894aa6{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes donut-rotate-data-v-ea894aa6{0%{-webkit-transform:rotate(0)}50%{-webkit-transform:rotate(-140deg)}to{-webkit-transform:rotate(0)}}@keyframes donut-rotate-data-v-ea894aa6{0%{-webkit-transform:rotate(0);transform:rotate(0)}50%{-webkit-transform:rotate(-140deg);transform:rotate(-140deg)}to{-webkit-transform:rotate(0);transform:rotate(0)}}", ""]);
// exports
/***/ }),
/***/ "3933":
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__("2f7c");
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var add = __webpack_require__("85cb").default
var update = add("c2820d5e", content, true, {"sourceMap":false,"shadowMode":false});
/***/ }),
/***/ "690e":
/***/ (function(module, exports) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
// css base code, injected by the css-loader
module.exports = function(useSourceMap) {
var list = [];
// return the list of modules as css string
list.toString = function toString() {
return this.map(function (item) {
var content = cssWithMappingToString(item, useSourceMap);
if(item[2]) {
return "@media " + item[2] + "{" + content + "}";
} else {
return content;
}
}).join("");
};
// import a list of modules into the list
list.i = function(modules, mediaQuery) {
if(typeof modules === "string")
modules = [[null, modules, ""]];
var alreadyImportedModules = {};
for(var i = 0; i < this.length; i++) {
var id = this[i][0];
if(typeof id === "number")
alreadyImportedModules[id] = true;
}
for(i = 0; i < modules.length; i++) {
var item = modules[i];
// skip already imported module
// this implementation is not 100% perfect for weird media query combinations
// when a module is imported multiple times with different media queries.
// I hope this will never occur (Hey this way we have smaller bundles)
if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
if(mediaQuery && !item[2]) {
item[2] = mediaQuery;
} else if(mediaQuery) {
item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
}
list.push(item);
}
}
};
return list;
};
function cssWithMappingToString(item, useSourceMap) {
var content = item[1] || '';
var cssMapping = item[3];
if (!cssMapping) {
return content;
}
if (useSourceMap && typeof btoa === 'function') {
var sourceMapping = toComment(cssMapping);
var sourceURLs = cssMapping.sources.map(function (source) {
return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
});
return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
}
return [content].join('\n');
}
// Adapted from convert-source-map (MIT)
function toComment(sourceMap) {
// eslint-disable-next-line no-undef
var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
return '/*# ' + data + ' */';
}
/***/ }),
/***/ "698b":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _node_modules_vue_style_loader_4_1_2_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_1_0_1_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_15_7_1_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_7_2_0_sass_loader_lib_loader_js_ref_8_oneOf_1_4_node_modules_cache_loader_2_0_1_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_15_7_1_vue_loader_lib_index_js_vue_loader_options_Loading_vue_vue_type_style_index_0_id_1c4209c0_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ae40");
/* harmony import */ var _node_modules_vue_style_loader_4_1_2_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_1_0_1_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_15_7_1_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_7_2_0_sass_loader_lib_loader_js_ref_8_oneOf_1_4_node_modules_cache_loader_2_0_1_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_15_7_1_vue_loader_lib_index_js_vue_loader_options_Loading_vue_vue_type_style_index_0_id_1c4209c0_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_4_1_2_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_1_0_1_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_15_7_1_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_7_2_0_sass_loader_lib_loader_js_ref_8_oneOf_1_4_node_modules_cache_loader_2_0_1_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_15_7_1_vue_loader_lib_index_js_vue_loader_options_Loading_vue_vue_type_style_index_0_id_1c4209c0_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
/* unused harmony reexport * */
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_vue_style_loader_4_1_2_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_1_0_1_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_15_7_1_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_7_2_0_sass_loader_lib_loader_js_ref_8_oneOf_1_4_node_modules_cache_loader_2_0_1_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_15_7_1_vue_loader_lib_index_js_vue_loader_options_Loading_vue_vue_type_style_index_0_id_1c4209c0_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default.a);
/***/ }),
/***/ "85cb":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/_vue-style-loader@4.1.2@vue-style-loader/lib/listToStyles.js
/**
* Translates the list format produced by css-loader into something
* easier to manipulate.
*/
function listToStyles (parentId, list) {
var styles = []
var newStyles = {}
for (var i = 0; i < list.length; i++) {
var item = list[i]
var id = item[0]
var css = item[1]
var media = item[2]
var sourceMap = item[3]
var part = {
id: parentId + ':' + i,
css: css,
media: media,
sourceMap: sourceMap
}
if (!newStyles[id]) {
styles.push(newStyles[id] = { id: id, parts: [part] })
} else {
newStyles[id].parts.push(part)
}
}
return styles
}
// CONCATENATED MODULE: ./node_modules/_vue-style-loader@4.1.2@vue-style-loader/lib/addStylesClient.js
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return addStylesClient; });
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
Modified by Evan You @yyx990803
*/
var hasDocument = typeof document !== 'undefined'
if (typeof DEBUG !== 'undefined' && DEBUG) {
if (!hasDocument) {
throw new Error(
'vue-style-loader cannot be used in a non-browser environment. ' +
"Use { target: 'node' } in your Webpack config to indicate a server-rendering environment."
) }
}
/*
type StyleObject = {
id: number;
parts: Array<StyleObjectPart>
}
type StyleObjectPart = {
css: string;
media: string;
sourceMap: ?string
}
*/
var stylesInDom = {/*
[id: number]: {
id: number,
refs: number,
parts: Array<(obj?: StyleObjectPart) => void>
}
*/}
var head = hasDocument && (document.head || document.getElementsByTagName('head')[0])
var singletonElement = null
var singletonCounter = 0
var isProduction = false
var noop = function () {}
var options = null
var ssrIdKey = 'data-vue-ssr-id'
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
// tags it will allow on a page
var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase())
function addStylesClient (parentId, list, _isProduction, _options) {
isProduction = _isProduction
options = _options || {}
var styles = listToStyles(parentId, list)
addStylesToDom(styles)
return function update (newList) {
var mayRemove = []
for (var i = 0; i < styles.length; i++) {
var item = styles[i]
var domStyle = stylesInDom[item.id]
domStyle.refs--
mayRemove.push(domStyle)
}
if (newList) {
styles = listToStyles(parentId, newList)
addStylesToDom(styles)
} else {
styles = []
}
for (var i = 0; i < mayRemove.length; i++) {
var domStyle = mayRemove[i]
if (domStyle.refs === 0) {
for (var j = 0; j < domStyle.parts.length; j++) {
domStyle.parts[j]()
}
delete stylesInDom[domStyle.id]
}
}
}
}
function addStylesToDom (styles /* Array<StyleObject> */) {
for (var i = 0; i < styles.length; i++) {
var item = styles[i]
var domStyle = stylesInDom[item.id]
if (domStyle) {
domStyle.refs++
for (var j = 0; j < domStyle.parts.length; j++) {
domStyle.parts[j](item.parts[j])
}
for (; j < item.parts.length; j++) {
domStyle.parts.push(addStyle(item.parts[j]))
}
if (domStyle.parts.length > item.parts.length) {
domStyle.parts.length = item.parts.length
}
} else {
var parts = []
for (var j = 0; j < item.parts.length; j++) {
parts.push(addStyle(item.parts[j]))
}
stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts }
}
}
}
function createStyleElement () {
var styleElement = document.createElement('style')
styleElement.type = 'text/css'
head.appendChild(styleElement)
return styleElement
}
function addStyle (obj /* StyleObjectPart */) {
var update, remove
var styleElement = document.querySelector('style[' + ssrIdKey + '~="' + obj.id + '"]')
if (styleElement) {
if (isProduction) {
// has SSR styles and in production mode.
// simply do nothing.
return noop
} else {
// has SSR styles but in dev mode.
// for some reason Chrome can't handle source map in server-rendered
// style tags - source maps in <style> only works if the style tag is
// created and inserted dynamically. So we remove the server rendered
// styles and inject new ones.
styleElement.parentNode.removeChild(styleElement)
}
}
if (isOldIE) {
// use singleton mode for IE9.
var styleIndex = singletonCounter++
styleElement = singletonElement || (singletonElement = createStyleElement())
update = applyToSingletonTag.bind(null, styleElement, styleIndex, false)
remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true)
} else {
// use multi-style-tag mode in all other cases
styleElement = createStyleElement()
update = applyToTag.bind(null, styleElement)
remove = function () {
styleElement.parentNode.removeChild(styleElement)
}
}
update(obj)
return function updateStyle (newObj /* StyleObjectPart */) {
if (newObj) {
if (newObj.css === obj.css &&
newObj.media === obj.media &&
newObj.sourceMap === obj.sourceMap) {
return
}
update(obj = newObj)
} else {
remove()
}
}
}
var replaceText = (function () {
var textStore = []
return function (index, replacement) {
textStore[index] = replacement
return textStore.filter(Boolean).join('\n')
}
})()
function applyToSingletonTag (styleElement, index, remove, obj) {
var css = remove ? '' : obj.css
if (styleElement.styleSheet) {
styleElement.styleSheet.cssText = replaceText(index, css)
} else {
var cssNode = document.createTextNode(css)
var childNodes = styleElement.childNodes
if (childNodes[index]) styleElement.removeChild(childNodes[index])
if (childNodes.length) {
styleElement.insertBefore(cssNode, childNodes[index])
} else {
styleElement.appendChild(cssNode)
}
}
}
function applyToTag (styleElement, obj) {
var css = obj.css
var media = obj.media
var sourceMap = obj.sourceMap
if (media) {
styleElement.setAttribute('media', media)
}
if (options.ssrId) {
styleElement.setAttribute(ssrIdKey, obj.id)
}
if (sourceMap) {
// https://developer.chrome.com/devtools/docs/javascript-debugging
// this makes source maps inside style tags work properly in Chrome
css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */'
// http://stackoverflow.com/a/26603875
css += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'
}
if (styleElement.styleSheet) {
styleElement.styleSheet.cssText = css
} else {
while (styleElement.firstChild) {
styleElement.removeChild(styleElement.firstChild)
}
styleElement.appendChild(document.createTextNode(css))
}
}
/***/ }),
/***/ "9c03":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/_@vue_cli-service@3.10.0@@vue/cli-service/lib/commands/build/setPublicPath.js
// This file is imported into lib/wc client bundles.
if (typeof window !== 'undefined') {
if (true) {
__webpack_require__("e67d")
}
var i
if ((i = window.document.currentScript) && (i = i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))) {
__webpack_require__.p = i[1] // eslint-disable-line
}
}
// Indicate to webpack that this file can be concatenated
/* harmony default export */ var setPublicPath = (null);
// CONCATENATED MODULE: ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"2c71098e-vue-loader-template"}!./node_modules/_vue-loader@15.7.1@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.1@vue-loader/lib??vue-loader-options!./packages/scroll/src/Scroll.vue?vue&type=template&id=7ca1b9e2&scoped=true&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:"wrapper"},[_c('div',{staticClass:"contantView"},[_c('div',{ref:"listWrapper"},[_vm._t("default"),_vm._t("pullup",null,{"finishPullUp":_vm.pullUpDirty})],2),_c('div',{staticClass:"pulldown"},[(_vm.pullDownRefresh)?_vm._t("pulldown",[_c('Loading',{attrs:{"isPullingDownStatus":_vm.isPullingDownStatus,"isPullingDown":_vm.isPullingDown,"isTouchEndStatus":_vm.isTouchEndStatus}})],{"isPullingDownStatus":_vm.isPullingDownStatus,"isPullingDown":_vm.isPullingDown}):_vm._e()],2)])])}
var staticRenderFns = []
// CONCATENATED MODULE: ./packages/scroll/src/Scroll.vue?vue&type=template&id=7ca1b9e2&scoped=true&
// CONCATENATED MODULE: ./node_modules/_better-scroll@1.15.2@better-scroll/dist/bscroll.esm.js
/*!
* better-normal-scroll v1.15.2
* (c) 2016-2019 ustbhuangyi
* Released under the MIT License.
*/
// As of V8 6.6, depending on the size of the array, this is anywhere
// between 1.5-10x faster than the two-arg version of Array#splice()
function spliceOne(list, index) {
for (; index + 1 < list.length; index++) {
list[index] = list[index + 1];
}
list.pop();
}
var slicedToArray = function () {
function sliceIterator(arr, i) {
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"]) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
return function (arr, i) {
if (Array.isArray(arr)) {
return arr;
} else if (Symbol.iterator in Object(arr)) {
return sliceIterator(arr, i);
} else {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
};
}();
var toConsumableArray = function (arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
return arr2;
} else {
return Array.from(arr);
}
};
function eventMixin(BScroll) {
BScroll.prototype.on = function (type, fn) {
var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this;
if (!this._events[type]) {
this._events[type] = [];
}
this._events[type].push([fn, context]);
};
BScroll.prototype.once = function (type, fn) {
var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this;
function magic() {
this.off(type, magic);
fn.apply(context, arguments);
}
// To expose the corresponding function method in order to execute the off method
magic.fn = fn;
this.on(type, magic);
};
BScroll.prototype.off = function (type, fn) {
var _events = this._events[type];
if (!_events) {
return;
}
var count = _events.length;
while (count--) {
if (_events[count][0] === fn || _events[count][0] && _events[count][0].fn === fn) {
spliceOne(_events, count);
}
}
};
BScroll.prototype.trigger = function (type) {
var events = this._events[type];
if (!events) {
return;
}
var len = events.length;
var eventsCopy = [].concat(toConsumableArray(events));
for (var i = 0; i < len; i++) {
var event = eventsCopy[i];
var _event = slicedToArray(event, 2),
fn = _event[0],
context = _event[1];
if (fn) {
fn.apply(context, [].slice.call(arguments, 1));
}
}
};
}
// ssr support
var inBrowser = typeof window !== 'undefined';
var ua = inBrowser && navigator.userAgent.toLowerCase();
var isWeChatDevTools = ua && /wechatdevtools/.test(ua);
var isAndroid = ua && ua.indexOf('android') > 0;
function getNow() {
return window.performance && window.performance.now ? window.performance.now() + window.performance.timing.navigationStart : +new Date();
}
function extend(target) {
for (var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
rest[_key - 1] = arguments[_key];
}
for (var i = 0; i < rest.length; i++) {
var source = rest[i];
for (var key in source) {
target[key] = source[key];
}
}
return target;
}
function isUndef(v) {
return v === undefined || v === null;
}
function getDistance(x, y) {
return Math.sqrt(x * x + y * y);
}
var elementStyle = inBrowser && document.createElement('div').style;
var vendor = function () {
if (!inBrowser) {
return false;
}
// first pick up standard to fix #743
var transformNames = {
standard: 'transform',
webkit: 'webkitTransform',
Moz: 'MozTransform',
O: 'OTransform',
ms: 'msTransform'
};
for (var key in transformNames) {
if (elementStyle[transformNames[key]] !== undefined) {
return key;
}
}
return false;
}();
function prefixStyle(style) {
if (vendor === false) {
return false;
}
if (vendor === 'standard') {
if (style === 'transitionEnd') {
return 'transitionend';
}
return style;
}
return vendor + style.charAt(0).toUpperCase() + style.substr(1);
}
function addEvent(el, type, fn, capture) {
el.addEventListener(type, fn, { passive: false, capture: !!capture });
}
function removeEvent(el, type, fn, capture) {
el.removeEventListener(type, fn, { passive: false, capture: !!capture });
}
function offset(el) {
var left = 0;
var top = 0;
while (el) {
left -= el.offsetLeft;
top -= el.offsetTop;
el = el.offsetParent;
}
return {
left: left,
top: top
};
}
function offsetToBody(el) {
var rect = el.getBoundingClientRect();
return {
left: -(rect.left + window.pageXOffset),
top: -(rect.top + window.pageYOffset)
};
}
var cssVendor = vendor && vendor !== 'standard' ? '-' + vendor.toLowerCase() + '-' : '';
var transform = prefixStyle('transform');
var transition = prefixStyle('transition');
var hasPerspective = inBrowser && prefixStyle('perspective') in elementStyle;
// fix issue #361
var hasTouch = inBrowser && ('ontouchstart' in window || isWeChatDevTools);
var hasTransform = transform !== false;
var hasTransition = inBrowser && transition in elementStyle;
var style = {
transform: transform,
transition: transition,
transitionTimingFunction: prefixStyle('transitionTimingFunction'),
transitionDuration: prefixStyle('transitionDuration'),
transitionDelay: prefixStyle('transitionDelay'),
transformOrigin: prefixStyle('transformOrigin'),
transitionEnd: prefixStyle('transitionEnd')
};
var TOUCH_EVENT = 1;
var MOUSE_EVENT = 2;
var eventType = {
touchstart: TOUCH_EVENT,
touchmove: TOUCH_EVENT,
touchend: TOUCH_EVENT,
mousedown: MOUSE_EVENT,
mousemove: MOUSE_EVENT,
mouseup: MOUSE_EVENT
};
function getRect(el) {
if (el instanceof window.SVGElement) {
var rect = el.getBoundingClientRect();
return {
top: rect.top,
left: rect.left,
width: rect.width,
height: rect.height
};
} else {
return {
top: el.offsetTop,
left: el.offsetLeft,
width: el.offsetWidth,
height: el.offsetHeight
};
}
}
function preventDefaultException(el, exceptions) {
for (var i in exceptions) {
if (exceptions[i].test(el[i])) {
return true;
}
}
return false;
}
function tap(e, eventName) {
var ev = document.createEvent('Event');
ev.initEvent(eventName, true, true);
ev.pageX = e.pageX;
ev.pageY = e.pageY;
e.target.dispatchEvent(ev);
}
function click(e) {
var event = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'click';
var eventSource = void 0;
if (e.type === 'mouseup' || e.type === 'mousecancel') {
eventSource = e;
} else if (e.type === 'touchend' || e.type === 'touchcancel') {
eventSource = e.changedTouches[0];
}
var posSrc = {};
if (eventSource) {
posSrc.screenX = eventSource.screenX || 0;
posSrc.screenY = eventSource.screenY || 0;
posSrc.clientX = eventSource.clientX || 0;
posSrc.clientY = eventSource.clientY || 0;
}
var ev = void 0;
var bubbles = true;
var cancelable = true;
if (typeof MouseEvent !== 'undefined') {
try {
ev = new MouseEvent(event, extend({
bubbles: bubbles,
cancelable: cancelable
}, posSrc));
} catch (e) {
createEvent();
}
} else {
createEvent();
}
function createEvent() {
ev = document.createEvent('Event');
ev.initEvent(event, bubbles, cancelable);
extend(ev, posSrc);
}
// forwardedTouchEvent set to true in case of the conflict with fastclick
ev.forwardedTouchEvent = true;
ev._constructed = true;
e.target.dispatchEvent(ev);
}
function dblclick(e) {
click(e, 'dblclick');
}
function prepend(el, target) {
if (target.firstChild) {
before(el, target.firstChild);
} else {
target.appendChild(el);
}
}
function before(el, target) {
target.parentNode.insertBefore(el, target);
}
function removeChild(el, child) {
el.removeChild(child);
}
var DEFAULT_OPTIONS = {
startX: 0,
startY: 0,
scrollX: false,
scrollY: true,
freeScroll: false,
directionLockThreshold: 5,
eventPassthrough: '',
click: false,
tap: false,
/**
* support any side
* bounce: {
* top: true,
* bottom: true,
* left: true,
* right: true
* }
*/
bounce: true,
bounceTime: 800,
momentum: true,
momentumLimitTime: 300,
momentumLimitDistance: 15,
swipeTime: 2500,
swipeBounceTime: 500,
deceleration: 0.0015,
flickLimitTime: 200,
flickLimitDistance: 100,
resizePolling: 60,
probeType: 0,
preventDefault: true,
preventDefaultException: {
tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT|AUDIO)$/
},
HWCompositing: true,
useTransition: true,
useTransform: true,
bindToWrapper: false,
disableMouse: hasTouch,
disableTouch: !hasTouch,
observeDOM: true,
autoBlur: true,
/**
* for picker
* wheel: {
* selectedIndex: 0,
* rotate: 25,
* adjustTime: 400
* wheelWrapperClass: 'wheel-scroll',
* wheelItemClass: 'wheel-item'
* }
*/
wheel: false,
/**
* for slide
* snap: {
* loop: false,
* el: domEl,
* threshold: 0.1,
* stepX: 100,
* stepY: 100,
* speed: 400,
* easing: {
* style: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',
* fn: function (t) {
* return t * (2 - t)
* }
* }
* listenFlick: true
* }
*/
snap: false,
/**
* for scrollbar
* scrollbar: {
* fade: true,
* interactive: false
* }
*/
scrollbar: false,
/**
* for pull down and refresh
* pullDownRefresh: {
* threshold: 50,
* stop: 20
* }
*/
pullDownRefresh: false,
/**
* for pull up and load
* pullUpLoad: {
* threshold: 50
* }
*/
pullUpLoad: false,
/**
* for mouse wheel
* mouseWheel: {
* speed: 20,
* invert: false,
* easeTime: 300
* }
*/
mouseWheel: false,
stopPropagation: false,
/**
* for zoom
* zoom: {
* start: 1,
* min: 1,
* max: 4
* }
*/
zoom: false,
/**
* for infinity
* infinity: {
* render(item, div) {
* },
* createTombstone() {
* },
* fetch(count) {
* }
* }
*/
infinity: false,
/**
* for double click
* dblclick: {
* delay: 300
* }
*/
dblclick: false
};
function initMixin(BScroll) {
BScroll.prototype._init = function (options) {
this._handleOptions(options);
// init private custom events
this._events = {};
this.x = 0;
this.y = 0;
this.directionX = 0;
this.directionY = 0;
this.setScale(1);
this._addDOMEvents();
this._initExtFeatures();
this._watchTransition();
if (this.options.observeDOM) {
this._initDOMObserver();
}
if (this.options.autoBlur) {
this._handleAutoBlur();
}
this.refresh();
if (!this.options.snap) {
this.scrollTo(this.options.startX, this.options.startY);
}
this.enable();
};
BScroll.prototype.setScale = function (scale) {
this.lastScale = isUndef(this.scale) ? scale : this.scale;
this.scale = scale;
};
BScroll.prototype._handleOptions = function (options) {
this.options = extend({}, DEFAULT_OPTIONS, options);
this.translateZ = this.options.HWCompositing && hasPerspective ? ' translateZ(0)' : '';
this.options.useTransition = this.options.useTransition && hasTransition;
this.options.useTransform = this.options.useTransform && hasTransform;
this.options.preventDefault = !this.options.eventPassthrough && this.options.preventDefault;
// If you want eventPassthrough I have to lock one of the axes
this.options.scrollX = this.options.eventPassthrough === 'horizontal' ? false : this.options.scrollX;
this.options.scrollY = this.options.eventPassthrough === 'vertical' ? false : this.options.scrollY;
// With eventPassthrough we also need lockDirection mechanism
this.options.freeScroll = this.options.freeScroll && !this.options.eventPassthrough;
this.options.directionLockThreshold = this.options.eventPassthrough ? 0 : this.options.directionLockThreshold;
if (this.options.tap === true) {
this.options.tap = 'tap';
}
};
BScroll.prototype._addDOMEvents = function () {
var eventOperation = addEvent;
this._handleDOMEvents(eventOperation);
};
BScroll.prototype._removeDOMEvents = function () {
var eventOperation = removeEvent;
this._handleDOMEvents(eventOperation);
};
BScroll.prototype._handleDOMEvents = function (eventOperation) {
var target = this.options.bindToWrapper ? this.wrapper : window;
eventOperation(window, 'orientationchange', this);
eventOperation(window, 'resize', this);
if (this.options.click) {
eventOperation(this.wrapper, 'click', this, true);
}
if (!this.options.disableMouse) {
eventOperation(this.wrapper, 'mousedown', this);
eventOperation(target, 'mousemove', this);
eventOperation(target, 'mousecancel', this);
eventOperation(target, 'mouseup', this);
}
if (hasTouch && !this.options.disableTouch) {
eventOperation(this.wrapper, 'touchstart', this);
eventOperation(target, 'touchmove', this);
eventOperation(target, 'touchcancel', this);
eventOperation(target, 'touchend', this);
}
eventOperation(this.scroller, style.transitionEnd, this);
};
BScroll.prototype._initExtFeatures = function () {
if (this.options.snap) {
this._initSnap();
}
if (this.options.scrollbar) {
this._initScrollbar();
}
if (this.options.pullUpLoad) {
this._initPullUp();
}
if (this.options.pullDownRefresh) {
this._initPullDown();
}
if (this.options.wheel) {
this._initWheel();
}
if (this.options.mouseWheel) {
this._initMouseWheel();
}
if (this.options.zoom) {
this._initZoom();
}
if (this.options.infinity) {
this._initInfinite();
}
};
BScroll.prototype._watchTransition = function () {
if (typeof Object.defineProperty !== 'function') {
return;
}
var me = this;
var isInTransition = false;
var key = this.options.useTransition ? 'isInTransition' : 'isAnimating';
Object.defineProperty(this, key, {
get: function get() {
return isInTransition;
},
set: function set(newVal) {
isInTransition = newVal;
// fix issue #359
var el = me.scroller.children.length ? me.scroller.children : [me.scroller];
var pointerEvents = isInTransition && !me.pulling ? 'none' : 'auto';
for (var i = 0; i < el.length; i++) {
el[i].style.pointerEvents = pointerEvents;
}
}
});
};
BScroll.prototype._handleAutoBlur = function () {
this.on('scrollStart', function () {
var activeElement = document.activeElement;
if (activeElement && (activeElement.tagName === 'INPUT' || activeElement.tagName === 'TEXTAREA')) {
activeElement.blur();
}
});
};
BScroll.prototype._initDOMObserver = function () {
var _this = this;
if (typeof MutationObserver !== 'undefined') {
var timer = void 0;
var observer = new MutationObserver(function (mutations) {
// don't do any refresh during the transition, or outside of the boundaries
if (_this._shouldNotRefresh()) {
return;
}
var immediateRefresh = false;
var deferredRefresh = false;
for (var i = 0; i < mutations.length; i++) {
var mutation = mutations[i];
if (mutation.type !== 'attributes') {
immediateRefresh = true;
break;
} else {
if (mutation.target !== _this.scroller) {
deferredRefresh = true;
break;
}
}
}
if (immediateRefresh) {
_this.refresh();
} else if (deferredRefresh) {
// attributes changes too often
clearTimeout(timer);
timer = setTimeout(function () {
if (!_this._shouldNotRefresh()) {
_this.refresh();
}
}, 60);
}
});
var config = {
attributes: true,
childList: true,
subtree: true
};
observer.observe(this.scroller, config);
this.on('destroy', function () {
observer.disconnect();
});
} else {
this._checkDOMUpdate();
}
};
BScroll.prototype._shouldNotRefresh = function () {
var outsideBoundaries = this.x > this.minScrollX || this.x < this.maxScrollX || this.y > this.minScrollY || this.y < this.maxScrollY;
return this.isInTransition || this.stopFromTransition || outsideBoundaries;
};
BScroll.prototype._checkDOMUpdate = function () {
var scrollerRect = getRect(this.scroller);
var oldWidth = scrollerRect.width;
var oldHeight = scrollerRect.height;
function check() {
if (this.destroyed) {
return;
}
scrollerRect = getRect(this.scroller);
var newWidth = scrollerRect.width;
var newHeight = scrollerRect.height;
if (oldWidth !== newWidth || oldHeight !== newHeight) {
this.refresh();
}
oldWidth = newWidth;
oldHeight = newHeight;
next.call(this);
}
function next() {
var _this2 = this;
setTimeout(function () {
check.call(_this2);
}, 1000);
}
next.call(this);
};
BScroll.prototype.handleEvent = function (e) {
switch (e.type) {
case 'touchstart':
case 'mousedown':
this._start(e);
if (this.options.zoom && e.touches && e.touches.length > 1) {
this._zoomStart(e);
}
break;
case 'touchmove':
case 'mousemove':
if (this.options.zoom && e.touches && e.touches.length > 1) {
this._zoom(e);
} else {
this._move(e);
}
break;
case 'touchend':
case 'mouseup':
case 'touchcancel':
case 'mousecancel':
if (this.scaled) {
this._zoomEnd(e);
} else {
this._end(e);
}
break;
case 'orientationchange':
case 'resize':
this._resize();
break;
case 'transitionend':
case 'webkitTransitionEnd':
case 'oTransitionEnd':
case 'MSTransitionEnd':
this._transitionEnd(e);
break;
case 'click':
if (this.enabled && !e._constructed) {
if (!preventDefaultException(e.target, this.options.preventDefaultException)) {
e.preventDefault();
e.stopPropagation();
}
}
break;
case 'wheel':
case 'DOMMouseScroll':
case 'mousewheel':
this._onMouseWheel(e);
break;
}
};
BScroll.prototype.refresh = function () {
var isWrapperStatic = window.getComputedStyle(this.wrapper, null).position === 'static';
var wrapperRect = getRect(this.wrapper);
this.wrapperWidth = wrapperRect.width;
this.wrapperHeight = wrapperRect.height;
var scrollerRect = getRect(this.scroller);
this.scrollerWidth = Math.round(scrollerRect.width * this.scale);
this.scrollerHeight = Math.round(scrollerRect.height * this.scale);
this.relativeX = scrollerRect.left;
this.relativeY = scrollerRect.top;
if (isWrapperStatic) {
this.relativeX -= wrapperRect.left;
this.relativeY -= wrapperRect.top;
}
this.minScrollX = 0;
this.minScrollY = 0;
var wheel = this.options.wheel;
if (wheel) {
this.items = this.scroller.children;
// check whether there are all disable items or not when refresh
this._checkWheelAllDisabled();
this.options.itemHeight = this.itemHeight = this.items.length ? this.scrollerHeight / this.items.length : 0;
if (this.selectedIndex === undefined) {
this.selectedIndex = wheel.selectedIndex || 0;
}
this.options.startY = -this.selectedIndex * this.itemHeight;
this.maxScrollX = 0;
this.maxScrollY = -this.itemHeight * (this.items.length - 1);
} else {
this.maxScrollX = this.wrapperWidth - this.scrollerWidth;
if (!this.options.infinity) {
this.maxScrollY = this.wrapperHeight - this.scrollerHeight;
}
if (this.maxScrollX < 0) {
this.maxScrollX -= this.relativeX;
this.minScrollX = -this.relativeX;
} else if (this.scale > 1) {
this.maxScrollX = this.maxScrollX / 2 - this.relativeX;
this.minScrollX = this.maxScrollX;
}
if (this.maxScrollY < 0) {
this.maxScrollY -= this.relativeY;
this.minScrollY = -this.relativeY;
} else if (this.scale > 1) {
this.maxScrollY = this.maxScrollY / 2 - this.relativeY;
this.minScrollY = this.maxScrollY;
}
}
this.hasHorizontalScroll = this.options.scrollX && this.maxScrollX < this.minScrollX;
this.hasVerticalScroll = this.options.scrollY && this.maxScrollY < this.minScrollY;
if (!this.hasHorizontalScroll) {
this.maxScrollX = this.minScrollX;
this.scrollerWidth = this.wrapperWidth;
}
if (!this.hasVerticalScroll) {
this.maxScrollY = this.minScrollY;
this.scrollerHeight = this.wrapperHeight;
}
this.endTime = 0;
this.directionX = 0;
this.directionY = 0;
this.wrapperOffset = offset(this.wrapper);
this.trigger('refresh');
!this.scaled && this.resetPosition();
};
BScroll.prototype.enable = function () {
this.enabled = true;
};
BScroll.prototype.disable = function () {
this.enabled = false;
};
}
var ease = {
// easeOutQuint
swipe: {
style: 'cubic-bezier(0.23, 1, 0.32, 1)',
fn: function fn(t) {
return 1 + --t * t * t * t * t;
}
},
// easeOutQuard
swipeBounce: {
style: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',
fn: function fn(t) {
return t * (2 - t);
}
},
// easeOutQuart
bounce: {
style: 'cubic-bezier(0.165, 0.84, 0.44, 1)',
fn: function fn(t) {
return 1 - --t * t * t * t;
}
}
};
function momentum(current, start, time, lowerMargin, upperMargin, wrapperSize, options, scroll) {
var distance = current - start;
var speed = Math.abs(distance) / time;
var deceleration = options.deceleration,
itemHeight = options.itemHeight,
swipeBounceTime = options.swipeBounceTime,
wheel = options.wheel,
swipeTime = options.swipeTime;
var duration = swipeTime;
var rate = wheel ? 4 : 15;
var destination = current + speed / deceleration * (distance < 0 ? -1 : 1);
if (wheel && itemHeight) {
destination = scroll._findNearestValidWheel(destination).y;
}
if (destination < lowerMargin) {
destination = wrapperSize ? Math.max(lowerMargin - wrapperSize / 4, lowerMargin - wrapperSize / rate * speed) : lowerMargin;
duration = swipeBounceTime;
} else if (destination > upperMargin) {
destination = wrapperSize ? Math.min(upperMargin + wrapperSize / 4, upperMargin + wrapperSize / rate * speed) : upperMargin;
duration = swipeBounceTime;
}
return {
destination: Math.round(destination),
duration: duration
};
}
var DEFAULT_INTERVAL = 100 / 60;
function noop() {}
var requestAnimationFrame = function () {
if (!inBrowser) {
/* istanbul ignore if */
return noop;
}
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame ||
// if all else fails, use setTimeout
function (callback) {
return window.setTimeout(callback, (callback.interval || DEFAULT_INTERVAL) / 2); // make interval as precise as possible.
};
}();
var cancelAnimationFrame = function () {
if (!inBrowser) {
/* istanbul ignore if */
return noop;
}
return window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || function (id) {
window.clearTimeout(id);
};
}();
var DIRECTION_UP = 1;
var DIRECTION_DOWN = -1;
var DIRECTION_LEFT = 1;
var DIRECTION_RIGHT = -1;
var PROBE_DEBOUNCE = 1;
var PROBE_REALTIME = 3;
function warn(msg) {
console.error('[BScroll warn]: ' + msg);
}
function assert(condition, msg) {
if (!condition) {
throw new Error('[BScroll] ' + msg);
}
}
function coreMixin(BScroll) {
BScroll.prototype._start = function (e) {
var _eventType = eventType[e.type];
if (_eventType !== TOUCH_EVENT) {
if (e.button !== 0) {
return;
}
}
if (!this.enabled || this.destroyed || this.initiated && this.initiated !== _eventType) {
return;
}
this.initiated = _eventType;
if (this.options.preventDefault && !preventDefaultException(e.target, this.options.preventDefaultException)) {
e.preventDefault();
}
if (this.options.stopPropagation) {
e.stopPropagation();
}
this.moved = false;
this.distX = 0;
this.distY = 0;
this.directionX = 0;
this.directionY = 0;
this.movingDirectionX = 0;
this.movingDirectionY = 0;
this.dir