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, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // 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 = 272); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports) { // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self // eslint-disable-next-line no-new-func : Function('return this')(); if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef /***/ }), /* 1 */ /***/ (function(module, exports) { /* globals __VUE_SSR_CONTEXT__ */ // this module is a runtime utility for cleaner component module output and will // be included in the final webpack user bundle module.exports = function normalizeComponent ( rawScriptExports, compiledTemplate, injectStyles, scopeId, moduleIdentifier /* server only */ ) { var esModule var scriptExports = rawScriptExports = rawScriptExports || {} // ES6 modules interop var type = typeof rawScriptExports.default if (type === 'object' || type === 'function') { esModule = rawScriptExports scriptExports = rawScriptExports.default } // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (compiledTemplate) { options.render = compiledTemplate.render options.staticRenderFns = compiledTemplate.staticRenderFns } // scopedId if (scopeId) { options._scopeId = scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = injectStyles } if (hook) { var functional = options.functional var existing = functional ? options.render : options.beforeCreate if (!functional) { // inject component registration as beforeCreate hook options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } else { // register for functioal component in vue file options.render = function renderWithStyleInjection (h, context) { hook.call(context) return existing(h, context) } } } return { esModule: esModule, exports: scriptExports, options: options } } /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { var store = __webpack_require__(25)('wks'); var uid = __webpack_require__(20); var Symbol = __webpack_require__(0).Symbol; var USE_SYMBOL = typeof Symbol == 'function'; var $exports = module.exports = function (name) { return store[name] || (store[name] = USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); }; $exports.store = store; /***/ }), /* 3 */ /***/ (function(module, exports) { var core = module.exports = { version: '2.5.3' }; if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { // Thank's IE8 for his funny defineProperty module.exports = !__webpack_require__(9)(function () { return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; }); /***/ }), /* 5 */ /***/ (function(module, exports) { module.exports = function (it) { return typeof it === 'object' ? it !== null : typeof it === 'function'; }; /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { var dP = __webpack_require__(7); var createDesc = __webpack_require__(15); module.exports = __webpack_require__(4) ? function (object, key, value) { return dP.f(object, key, createDesc(1, value)); } : function (object, key, value) { object[key] = value; return object; }; /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { var anObject = __webpack_require__(8); var IE8_DOM_DEFINE = __webpack_require__(33); var toPrimitive = __webpack_require__(30); var dP = Object.defineProperty; exports.f = __webpack_require__(4) ? Object.defineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPrimitive(P, true); anObject(Attributes); if (IE8_DOM_DEFINE) try { return dP(O, P, Attributes); } catch (e) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(5); module.exports = function (it) { if (!isObject(it)) throw TypeError(it + ' is not an object!'); return it; }; /***/ }), /* 9 */ /***/ (function(module, exports) { module.exports = function (exec) { try { return !!exec(); } catch (e) { return true; } }; /***/ }), /* 10 */ /***/ (function(module, exports) { var hasOwnProperty = {}.hasOwnProperty; module.exports = function (it, key) { return hasOwnProperty.call(it, key); }; /***/ }), /* 11 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(0); var core = __webpack_require__(3); var ctx = __webpack_require__(21); var hide = __webpack_require__(6); var PROTOTYPE = 'prototype'; var $export = function (type, name, source) { var IS_FORCED = type & $export.F; var IS_GLOBAL = type & $export.G; var IS_STATIC = type & $export.S; var IS_PROTO = type & $export.P; var IS_BIND = type & $export.B; var IS_WRAP = type & $export.W; var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); var expProto = exports[PROTOTYPE]; var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]; var key, own, out; if (IS_GLOBAL) source = name; for (key in source) { // contains in native own = !IS_FORCED && target && target[key] !== undefined; if (own && key in exports) continue; // export native or passed out = own ? target[key] : source[key]; // prevent global pollution for namespaces exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] // bind timers to global for call from export context : IS_BIND && own ? ctx(out, global) // wrap global constructors for prevent change them in library : IS_WRAP && target[key] == out ? (function (C) { var F = function (a, b, c) { if (this instanceof C) { switch (arguments.length) { case 0: return new C(); case 1: return new C(a); case 2: return new C(a, b); } return new C(a, b, c); } return C.apply(this, arguments); }; F[PROTOTYPE] = C[PROTOTYPE]; return F; // make static versions for prototype methods })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% if (IS_PROTO) { (exports.virtual || (exports.virtual = {}))[key] = out; // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out); } } }; // type bitmap $export.F = 1; // forced $export.G = 2; // global $export.S = 4; // static $export.P = 8; // proto $export.B = 16; // bind $export.W = 32; // wrap $export.U = 64; // safe $export.R = 128; // real proto method for `library` module.exports = $export; /***/ }), /* 12 */ /***/ (function(module, exports, __webpack_require__) { // to indexed object, toObject with fallback for non-array-like ES3 strings var IObject = __webpack_require__(23); var defined = __webpack_require__(13); module.exports = function (it) { return IObject(defined(it)); }; /***/ }), /* 13 */ /***/ (function(module, exports) { // 7.2.1 RequireObjectCoercible(argument) module.exports = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; /***/ }), /* 14 */ /***/ (function(module, exports) { // 7.1.4 ToInteger var ceil = Math.ceil; var floor = Math.floor; module.exports = function (it) { return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); }; /***/ }), /* 15 */ /***/ (function(module, exports) { module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; /***/ }), /* 16 */ /***/ (function(module, exports, __webpack_require__) { var shared = __webpack_require__(25)('keys'); var uid = __webpack_require__(20); module.exports = function (key) { return shared[key] || (shared[key] = uid(key)); }; /***/ }), /* 17 */ /***/ (function(module, exports, __webpack_require__) { // 7.1.13 ToObject(argument) var defined = __webpack_require__(13); module.exports = function (it) { return Object(defined(it)); }; /***/ }), /* 18 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.14 / 15.2.3.14 Object.keys(O) var $keys = __webpack_require__(34); var enumBugKeys = __webpack_require__(26); module.exports = Object.keys || function keys(O) { return $keys(O, enumBugKeys); }; /***/ }), /* 19 */ /***/ (function(module, exports) { var toString = {}.toString; module.exports = function (it) { return toString.call(it).slice(8, -1); }; /***/ }), /* 20 */ /***/ (function(module, exports) { var id = 0; var px = Math.random(); module.exports = function (key) { return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); }; /***/ }), /* 21 */ /***/ (function(module, exports, __webpack_require__) { // optional / simple context binding var aFunction = __webpack_require__(28); module.exports = function (fn, that, length) { aFunction(fn); if (that === undefined) return fn; switch (length) { case 1: return function (a) { return fn.call(that, a); }; case 2: return function (a, b) { return fn.call(that, a, b); }; case 3: return function (a, b, c) { return fn.call(that, a, b, c); }; } return function (/* ...args */) { return fn.apply(that, arguments); }; }; /***/ }), /* 22 */ /***/ (function(module, exports) { module.exports = {}; /***/ }), /* 23 */ /***/ (function(module, exports, __webpack_require__) { // fallback for non-array-like ES3 and non-enumerable old V8 strings var cof = __webpack_require__(19); // eslint-disable-next-line no-prototype-builtins module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { return cof(it) == 'String' ? it.split('') : Object(it); }; /***/ }), /* 24 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(5); var document = __webpack_require__(0).document; // typeof document.createElement is 'object' in old IE var is = isObject(document) && isObject(document.createElement); module.exports = function (it) { return is ? document.createElement(it) : {}; }; /***/ }), /* 25 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(0); var SHARED = '__core-js_shared__'; var store = global[SHARED] || (global[SHARED] = {}); module.exports = function (key) { return store[key] || (store[key] = {}); }; /***/ }), /* 26 */ /***/ (function(module, exports) { // IE 8- don't enum bug keys module.exports = ( 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' ).split(','); /***/ }), /* 27 */ /***/ (function(module, exports, __webpack_require__) { // 7.1.15 ToLength var toInteger = __webpack_require__(14); var min = Math.min; module.exports = function (it) { return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 }; /***/ }), /* 28 */ /***/ (function(module, exports) { module.exports = function (it) { if (typeof it != 'function') throw TypeError(it + ' is not a function!'); return it; }; /***/ }), /* 29 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(42), __esModule: true }; /***/ }), /* 30 */ /***/ (function(module, exports, __webpack_require__) { // 7.1.1 ToPrimitive(input [, PreferredType]) var isObject = __webpack_require__(5); // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string module.exports = function (it, S) { if (!isObject(it)) return it; var fn, val; if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; throw TypeError("Can't convert object to primitive value"); }; /***/ }), /* 31 */ /***/ (function(module, exports) { exports.f = {}.propertyIsEnumerable; /***/ }), /* 32 */, /* 33 */ /***/ (function(module, exports, __webpack_require__) { module.exports = !__webpack_require__(4) && !__webpack_require__(9)(function () { return Object.defineProperty(__webpack_require__(24)('div'), 'a', { get: function () { return 7; } }).a != 7; }); /***/ }), /* 34 */ /***/ (function(module, exports, __webpack_require__) { var has = __webpack_require__(10); var toIObject = __webpack_require__(12); var arrayIndexOf = __webpack_require__(37)(false); var IE_PROTO = __webpack_require__(16)('IE_PROTO'); module.exports = function (object, names) { var O = toIObject(object); var i = 0; var result = []; var key; for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); // Don't enum bug & hidden keys while (names.length > i) if (has(O, key = names[i++])) { ~arrayIndexOf(result, key) || result.push(key); } return result; }; /***/ }), /* 35 */ /***/ (function(module, exports, __webpack_require__) { var def = __webpack_require__(7).f; var has = __webpack_require__(10); var TAG = __webpack_require__(2)('toStringTag'); module.exports = function (it, tag, stat) { if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); }; /***/ }), /* 36 */ /***/ (function(module, exports) { exports.f = Object.getOwnPropertySymbols; /***/ }), /* 37 */ /***/ (function(module, exports, __webpack_require__) { // false -> Array#indexOf // true -> Array#includes var toIObject = __webpack_require__(12); var toLength = __webpack_require__(27); var toAbsoluteIndex = __webpack_require__(38); module.exports = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIObject($this); var length = toLength(O.length); var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare if (IS_INCLUDES && el != el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (;length > index; index++) if (IS_INCLUDES || index in O) { if (O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; /***/ }), /* 38 */ /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(14); var max = Math.max; var min = Math.min; module.exports = function (index, length) { index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); }; /***/ }), /* 39 */, /* 40 */, /* 41 */ /***/ (function(module, exports) { module.exports = true; /***/ }), /* 42 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(43); module.exports = __webpack_require__(3).Object.assign; /***/ }), /* 43 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.3.1 Object.assign(target, source) var $export = __webpack_require__(11); $export($export.S + $export.F, 'Object', { assign: __webpack_require__(44) }); /***/ }), /* 44 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // 19.1.2.1 Object.assign(target, source, ...) var getKeys = __webpack_require__(18); var gOPS = __webpack_require__(36); var pIE = __webpack_require__(31); var toObject = __webpack_require__(17); var IObject = __webpack_require__(23); var $assign = Object.assign; // should work with symbols and should have deterministic property order (V8 bug) module.exports = !$assign || __webpack_require__(9)(function () { var A = {}; var B = {}; // eslint-disable-next-line no-undef var S = Symbol(); var K = 'abcdefghijklmnopqrst'; A[S] = 7; K.split('').forEach(function (k) { B[k] = k; }); return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; }) ? function assign(target, source) { // eslint-disable-line no-unused-vars var T = toObject(target); var aLen = arguments.length; var index = 1; var getSymbols = gOPS.f; var isEnum = pIE.f; while (aLen > index) { var S = IObject(arguments[index++]); var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); var length = keys.length; var j = 0; var key; while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; } return T; } : $assign; /***/ }), /* 45 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var LIBRARY = __webpack_require__(41); var $export = __webpack_require__(11); var redefine = __webpack_require__(47); var hide = __webpack_require__(6); var has = __webpack_require__(10); var Iterators = __webpack_require__(22); var $iterCreate = __webpack_require__(56); var setToStringTag = __webpack_require__(35); var getPrototypeOf = __webpack_require__(58); var ITERATOR = __webpack_require__(2)('iterator'); var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` var FF_ITERATOR = '@@iterator'; var KEYS = 'keys'; var VALUES = 'values'; var returnThis = function () { return this; }; module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { $iterCreate(Constructor, NAME, next); var getMethod = function (kind) { if (!BUGGY && kind in proto) return proto[kind]; switch (kind) { case KEYS: return function keys() { return new Constructor(this, kind); }; case VALUES: return function values() { return new Constructor(this, kind); }; } return function entries() { return new Constructor(this, kind); }; }; var TAG = NAME + ' Iterator'; var DEF_VALUES = DEFAULT == VALUES; var VALUES_BUG = false; var proto = Base.prototype; var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; var $default = (!BUGGY && $native) || getMethod(DEFAULT); var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; var methods, key, IteratorPrototype; // Fix native if ($anyNative) { IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { // Set @@toStringTag to native iterators setToStringTag(IteratorPrototype, TAG, true); // fix for some old engines if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis); } } // fix Array#{values, @@iterator}.name in V8 / FF if (DEF_VALUES && $native && $native.name !== VALUES) { VALUES_BUG = true; $default = function values() { return $native.call(this); }; } // Define iterator if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { hide(proto, ITERATOR, $default); } // Plug for library Iterators[NAME] = $default; Iterators[TAG] = returnThis; if (DEFAULT) { methods = { values: DEF_VALUES ? $default : getMethod(VALUES), keys: IS_SET ? $default : getMethod(KEYS), entries: $entries }; if (FORCED) for (key in methods) { if (!(key in proto)) redefine(proto, key, methods[key]); } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); } return methods; }; /***/ }), /* 46 */, /* 47 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(6); /***/ }), /* 48 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) var anObject = __webpack_require__(8); var dPs = __webpack_require__(57); var enumBugKeys = __webpack_require__(26); var IE_PROTO = __webpack_require__(16)('IE_PROTO'); var Empty = function () { /* empty */ }; var PROTOTYPE = 'prototype'; // Create object with fake `null` prototype: use iframe Object with cleared prototype var createDict = function () { // Thrash, waste and sodomy: IE GC bug var iframe = __webpack_require__(24)('iframe'); var i = enumBugKeys.length; var lt = '<'; var gt = '>'; var iframeDocument; iframe.style.display = 'none'; __webpack_require__(49).appendChild(iframe); iframe.src = 'javascript:'; // eslint-disable-line no-script-url // createDict = iframe.contentWindow.Object; // html.removeChild(iframe); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); iframeDocument.close(); createDict = iframeDocument.F; while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; return createDict(); }; module.exports = Object.create || function create(O, Properties) { var result; if (O !== null) { Empty[PROTOTYPE] = anObject(O); result = new Empty(); Empty[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; } else result = createDict(); return Properties === undefined ? result : dPs(result, Properties); }; /***/ }), /* 49 */ /***/ (function(module, exports, __webpack_require__) { var document = __webpack_require__(0).document; module.exports = document && document.documentElement; /***/ }), /* 50 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $at = __webpack_require__(55)(true); // 21.1.3.27 String.prototype[@@iterator]() __webpack_require__(45)(String, 'String', function (iterated) { this._t = String(iterated); // target this._i = 0; // next index // 21.1.5.2.1 %StringIteratorPrototype%.next() }, function () { var O = this._t; var index = this._i; var point; if (index >= O.length) return { value: undefined, done: true }; point = $at(O, index); this._i += point.length; return { value: point, done: false }; }); /***/ }), /* 51 */, /* 52 */, /* 53 */, /* 54 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /*! * better-normal-scroll v1.9.1 * (c) 2016-2018 ustbhuangyi * Released under the MIT License. */ 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) { _events[count][0] = undefined; } } }; 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; } var elementStyle = inBrowser && document.createElement('div').style; var vendor = function () { if (!inBrowser) { return false; } var transformNames = { webkit: 'webkitTransform', Moz: 'MozTransform', O: 'OTransform', ms: 'msTransform', standard: 'transform' }; 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 }; } var transform = prefixStyle('transform'); var hasPerspective = inBrowser && prefixStyle('perspective') in elementStyle; // fix issue #361 var hasTouch = inBrowser && ('ontouchstart' in window || isWeChatDevTools); var hasTransform = transform !== false; var hasTransition = inBrowser && prefixStyle('transition') in elementStyle; var style = { transform: transform, transitionTimingFunction: prefixStyle('transitionTimingFunction'), transitionDuration: prefixStyle('transitionDuration'), transitionProperty: prefixStyle('transitionProperty'), 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 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 event = 'click'; 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 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, bounce: true, bounceTime: 800, momentum: true, momentumLimitTime: 300, momentumLimitDistance: 15, swipeTime: 2500, swipeBounceTime: 500, deceleration: 0.001, flickLimitTime: 200, flickLimitDistance: 100, resizePolling: 60, probeType: 0, preventDefault: true, preventDefaultException: { tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/ }, 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 * } */ mouseWheel: false, stopPropagation: false }; function initMixin(BScroll) { BScroll.prototype._init = function (el, options) { this._handleOptions(options); // init private custom events this._events = {}; this.x = 0; this.y = 0; this.directionX = 0; this.directionY = 0; 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._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(); } }; BScroll.prototype._watchTransition = function () { if (typeof Object.defineProperty !== 'function') { return; } var me = this; var isInTransition = false; Object.defineProperty(this, 'isInTransition', { 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('beforeScrollStart', 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 > 0 || this.x < this.maxScrollX || this.y > 0 || 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); break; case 'touchmove': case 'mousemove': this._move(e); break; case 'touchend': case 'mouseup': case 'touchcancel': case 'mousecancel': 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 wrapperRect = getRect(this.wrapper); this.wrapperWidth = wrapperRect.width; this.wrapperHeight = wrapperRect.height; var scrollerRect = getRect(this.scroller); this.scrollerWidth = scrollerRect.width; this.scrollerHeight = scrollerRect.height; var wheel = this.options.wheel; if (wheel) { this.items = this.scroller.children; 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; this.maxScrollY = this.wrapperHeight - this.scrollerHeight; } this.hasHorizontalScroll = this.options.scrollX && this.maxScrollX < 0; this.hasVerticalScroll = this.options.scrollY && this.maxScrollY < 0; if (!this.hasHorizontalScroll) { this.maxScrollX = 0; this.scrollerWidth = this.wrapperWidth; } if (!this.hasVerticalScroll) { this.maxScrollY = 0; this.scrollerHeight = this.wrapperHeight; } this.endTime = 0; this.directionX = 0; this.directionY = 0; this.wrapperOffset = offset(this.wrapper); this.trigger('refresh'); 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, wrapperSize, options) { 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 = Math.round(destination / itemHeight) * itemHeight; } if (destination < lowerMargin) { destination = wrapperSize ? Math.max(lowerMargin - wrapperSize / 4, lowerMargin - wrapperSize / rate * speed) : lowerMargin; duration = swipeBounceTime; } else if (destination > 0) { destination = wrapperSize ? Math.min(wrapperSize / 4, wrapperSize / rate * speed) : 0; 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.directionLocked = 0; this._transitionTime(); this.startTime = getNow(); if (this.options.wheel) { this.target = e.target; } this.stop(); var point = e.touches ? e.touches[0] : e; this.startX = this.x; this.startY = this.y; this.absStartX = this.x; this.absStartY = this.y; this.pointX = point.pageX; this.pointY = point.pageY; this.trigger('beforeScrollStart'); }; BScroll.prototype._move = function (e) { if (!this.enabled || this.destroyed || eventType[e.type] !== this.initiated) { return; } if (this.options.preventDefault) { e.preventDefault(); } if (this.options.stopPropagation) { e.stopPropagation(); } var point = e.touches ? e.touches[0] : e; var deltaX = point.pageX - this.pointX; var deltaY = point.pageY - this.pointY; this.pointX = point.pageX; this.pointY = point.pageY; this.distX += deltaX; this.distY += deltaY; var absDistX = Math.abs(this.distX); var absDistY = Math.abs(this.distY); var timestamp = getNow(); // We need to move at least momentumLimitDistance pixels for the scrolling to initiate if (timestamp - this.endTime > this.options.momentumLimitTime && absDistY < this.options.momentumLimitDistance && absDistX < this.options.momentumLimitDistance) { return; } // If you are scrolling in one direction lock the other if (!this.directionLocked && !this.options.freeScroll) { if (absDistX > absDistY + this.options.directionLockThreshold) { this.directionLocked = 'h'; // lock horizontally } else if (absDistY >= absDistX + this.options.directionLockThreshold) { this.directionLocked = 'v'; // lock vertically } else { this.directionLocked = 'n'; // no lock } } if (this.directionLocked === 'h') { if (this.options.eventPassthrough === 'vertical') { e.preventDefault(); } else if (this.options.eventPassthrough === 'horizontal') { this.initiated = false; return; } deltaY = 0; } else if (this.directionLocked === 'v') { if (this.options.eventPassthrough === 'horizontal') { e.preventDefault(); } else if (this.options.eventPassthrough === 'vertical') { this.initiated = false; return; } deltaX = 0; } deltaX = this.hasHorizontalScroll ? deltaX : 0; deltaY = this.hasVerticalScroll ? deltaY : 0; this.movingDirectionX = deltaX > 0 ? DIRECTION_RIGHT : deltaX < 0 ? DIRECTION_LEFT : 0; this.movingDirectionY = deltaY > 0 ? DIRECTION_DOWN : deltaY < 0 ? DIRECTION_UP : 0; var newX = this.x + deltaX; var newY = this.y + deltaY; // Slow down or stop if outside of the boundaries if (newX > 0 || newX < this.maxScrollX) { if (this.options.bounce) { newX = this.x + deltaX / 3; } else { newX = newX > 0 ? 0 : this.maxScrollX; } } if (newY > 0 || newY < this.maxScrollY) { if (this.options.bounce) { newY = this.y + deltaY / 3; } else { newY = newY > 0 ? 0 : this.maxScrollY; } } if (!this.moved) { this.moved = true; this.trigger('scrollStart'); } this._translate(newX, newY); if (timestamp - this.startTime > this.options.momentumLimitTime) { this.startTime = timestamp; this.startX = this.x; this.startY = this.y; if (this.options.probeType === PROBE_DEBOUNCE) { this.trigger('scroll', { x: this.x, y: this.y }); } } if (this.options.probeType > PROBE_DEBOUNCE) { this.trigger('scroll', { x: this.x, y: this.y }); } var scrollLeft = document.documentElement.scrollLeft || window.pageXOffset || document.body.scrollLeft; var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; var pX = this.pointX - scrollLeft; var pY = this.pointY - scrollTop; if (pX > document.documentElement.clientWidth - this.options.momentumLimitDistance || pX < this.options.momentumLimitDistance || pY < this.options.momentumLimitDistance || pY > document.documentElement.clientHeight - this.options.momentumLimitDistance) { this._end(e); } }; BScroll.prototype._end = function (e) { if (!this.enabled || this.destroyed || eventType[e.type] !== this.initiated) { return; } this.initiated = false; if (this.options.preventDefault && !preventDefaultException(e.target, this.options.preventDefaultException)) { e.preventDefault(); } if (this.options.stopPropagation) { e.stopPropagation(); } this.trigger('touchEnd', { x: this.x, y: this.y }); this.isInTransition = false; // ensures that the last position is rounded var newX = Math.round(this.x); var newY = Math.round(this.y); var deltaX = newX - this.absStartX; var deltaY = newY - this.absStartY; this.directionX = deltaX > 0 ? DIRECTION_RIGHT : deltaX < 0 ? DIRECTION_LEFT : 0; this.directionY = deltaY > 0 ? DIRECTION_DOWN : deltaY < 0 ? DIRECTION_UP : 0; // if configure pull down refresh, check it first if (this.options.pullDownRefresh && this._checkPullDown()) { return; } // check if it is a click operation if (this._checkClick(e)) { this.trigger('scrollCancel'); return; } // reset if we are outside of the boundaries if (this.resetPosition(this.options.bounceTime, ease.bounce)) { return; } this.scrollTo(newX, newY); this.endTime = getNow(); var duration = this.endTime - this.startTime; var absDistX = Math.abs(newX - this.startX); var absDistY = Math.abs(newY - this.startY); // flick if (this._events.flick && duration < this.options.flickLimitTime && absDistX < this.options.flickLimitDistance && absDistY < this.options.flickLimitDistance) { this.trigger('flick'); return; } var time = 0; // start momentum animation if needed if (this.options.momentum && duration < this.options.momentumLimitTime && (absDistY > this.options.momentumLimitDistance || absDistX > this.options.momentumLimitDistance)) { var momentumX = this.hasHorizontalScroll ? momentum(this.x, this.startX, duration, this.maxScrollX, this.options.bounce ? this.wrapperWidth : 0, this.options) : { destination: newX, duration: 0 }; var momentumY = this.hasVerticalScroll ? momentum(this.y, this.startY, duration, this.maxScrollY, this.options.bounce ? this.wrapperHeight : 0, this.options) : { destination: newY, duration: 0 }; newX = momentumX.destination; newY = momentumY.destination; time = Math.max(momentumX.duration, momentumY.duration); this.isInTransition = true; } else { if (this.options.wheel) { newY = Math.round(newY / this.itemHeight) * this.itemHeight; time = this.options.wheel.adjustTime || 400; } } var easing = ease.swipe; if (this.options.snap) { var snap = this._nearestSnap(newX, newY); this.currentPage = snap; time = this.options.snapSpeed || Math.max(Math.max(Math.min(Math.abs(newX - snap.x), 1000), Math.min(Math.abs(newY - snap.y), 1000)), 300); newX = snap.x; newY = snap.y; this.directionX = 0; this.directionY = 0; easing = this.options.snap.easing || ease.bounce; } if (newX !== this.x || newY !== this.y) { // change easing function when scroller goes out of the boundaries if (newX > 0 || newX < this.maxScrollX || newY > 0 || newY < this.maxScrollY) { easing = ease.swipeBounce; } this.scrollTo(newX, newY, time, easing); return; } if (this.options.wheel) { this.selectedIndex = Math.round(Math.abs(this.y / this.itemHeight)); } this.trigger('scrollEnd', { x: this.x, y: this.y }); }; BScroll.prototype._checkClick = function (e) { // when in the process of pulling down, it should not prevent click var preventClick = this.stopFromTransition && !this.pulling; this.stopFromTransition = false; // we scrolled less than 15 pixels if (!this.moved) { if (this.options.wheel) { if (this.target && this.target.className === this.options.wheel.wheelWrapperClass) { var index = Math.abs(Math.round(this.y / this.itemHeight)); var _offset = Math.round((this.pointY + offset(this.target).top - this.itemHeight / 2) / this.itemHeight); this.target = this.items[index + _offset]; } this.scrollToElement(this.target, this.options.wheel.adjustTime || 400, true, true, ease.swipe); return true; } else { if (!preventClick) { if (this.options.tap) { tap(e, this.options.tap); } if (this.options.click && !preventDefaultException(e.target, this.options.preventDefaultException)) { click(e); } return true; } return false; } } return false; }; BScroll.prototype._resize = function () { var _this = this; if (!this.enabled) { return; } // fix a scroll problem under Android condition if (isAndroid) { this.wrapper.scrollTop = 0; } clearTimeout(this.resizeTimeout); this.resizeTimeout = setTimeout(function () { _this.refresh(); }, this.options.resizePolling); }; BScroll.prototype._startProbe = function () { cancelAnimationFrame(this.probeTimer); this.probeTimer = requestAnimationFrame(probe); var me = this; function probe() { var pos = me.getComputedPosition(); me.trigger('scroll', pos); if (!me.isInTransition) { me.trigger('scrollEnd', pos); return; } me.probeTimer = requestAnimationFrame(probe); } }; BScroll.prototype._transitionProperty = function () { var property = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transform'; this.scrollerStyle[style.transitionProperty] = property; }; BScroll.prototype._transitionTime = function () { var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; this.scrollerStyle[style.transitionDuration] = time + 'ms'; if (this.options.wheel) { for (var i = 0; i < this.items.length; i++) { this.items[i].style[style.transitionDuration] = time + 'ms'; } } if (this.indicators) { for (var _i = 0; _i < this.indicators.length; _i++) { this.indicators[_i].transitionTime(time); } } }; BScroll.prototype._transitionTimingFunction = function (easing) { this.scrollerStyle[style.transitionTimingFunction] = easing; if (this.options.wheel) { for (var i = 0; i < this.items.length; i++) { this.items[i].style[style.transitionTimingFunction] = easing; } } if (this.indicators) { for (var _i2 = 0; _i2 < this.indicators.length; _i2++) { this.indicators[_i2].transitionTimingFunction(easing); } } }; BScroll.prototype._transitionEnd = function (e) { if (e.target !== this.scroller || !this.isInTransition) { return; } this._transitionTime(); if (!this.pulling && !this.resetPosition(this.options.bounceTime, ease.bounce)) { this.isInTransition = false; if (this.options.probeType !== PROBE_REALTIME) { this.trigger('scrollEnd', { x: this.x, y: this.y }); } } }; BScroll.prototype._translate = function (x, y) { assert(!isUndef(x) && !isUndef(y), 'Oops! translate x or y is null or undefined. please check your code.'); if (this.options.useTransform) { this.scrollerStyle[style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.translateZ; } else { x = Math.round(x); y = Math.round(y); this.scrollerStyle.left = x + 'px'; this.scrollerStyle.top = y + 'px'; } if (this.options.wheel) { var _options$wheel$rotate = this.options.wheel.rotate, rotate = _options$wheel$rotate === undefined ? 25 : _options$wheel$rotate; for (var i = 0; i < this.items.length; i++) { var deg = rotate * (y / this.itemHeight + i); this.items[i].style[style.transform] = 'rotateX(' + deg + 'deg)'; } } this.x = x; this.y = y; if (this.indicators) { for (var _i3 = 0; _i3 < this.indicators.length; _i3++) { this.indicators[_i3].updatePosition(); } } }; BScroll.prototype._animate = function (destX, destY, duration, easingFn) { var me = this; var startX = this.x; var startY = this.y; var startTime = getNow(); var destTime = startTime + duration; function step() { var now = getNow(); if (now >= destTime) { me.isAnimating = false; me._translate(destX, destY); if (!me.pulling && !me.resetPosition(me.options.bounceTime)) { me.trigger('scrollEnd', { x: me.x, y: me.y }); } return; } now = (now - startTime) / duration; var easing = easingFn(now); var newX = (destX - startX) * easing + startX; var newY = (destY - startY) * easing + startY; me._translate(newX, newY); if (me.isAnimating) { me.animateTimer = requestAnimationFrame(step); } if (me.options.probeType === PROBE_REALTIME) { me.trigger('scroll', { x: me.x, y: me.y }); } } this.isAnimating = true; cancelAnimationFrame(this.animateTimer); step(); }; BScroll.prototype.scrollBy = function (x, y) { var time = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; var easing = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ease.bounce; x = this.x + x; y = this.y + y; this.scrollTo(x, y, time, easing); }; BScroll.prototype.scrollTo = function (x, y) { var time = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; var easing = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ease.bounce; this.isInTransition = this.options.useTransition && time > 0 && (x !== this.x || y !== this.y); if (!time || this.options.useTransition) { this._transitionProperty(); this._transitionTimingFunction(easing.style); this._transitionTime(time); this._translate(x, y); if (time && this.options.probeType === PROBE_REALTIME) { this._startProbe(); } if (this.options.wheel) { if (y > 0) { this.selectedIndex = 0; } else if (y < this.maxScrollY) { this.selectedIndex = this.items.length - 1; } else { this.selectedIndex = Math.round(Math.abs(y / this.itemHeight)); } } } else { this._animate(x, y, time, easing.fn); } }; BScroll.prototype.scrollToElement = function (el, time, offsetX, offsetY, easing) { if (!el) { return; } el = el.nodeType ? el : this.scroller.querySelector(el); if (this.options.wheel && el.className !== this.options.wheel.wheelItemClass) { return; } var pos = offset(el); pos.left -= this.wrapperOffset.left; pos.top -= this.wrapperOffset.top; // if offsetX/Y are true we center the element to the screen if (offsetX === true) { offsetX = Math.round(el.offsetWidth / 2 - this.wrapper.offsetWidth / 2); } if (offsetY === true) { offsetY = Math.round(el.offsetHeight / 2 - this.wrapper.offsetHeight / 2); } pos.left -= offsetX || 0; pos.top -= offsetY || 0; pos.left = pos.left > 0 ? 0 : pos.left < this.maxScrollX ? this.maxScrollX : pos.left; pos.top = pos.top > 0 ? 0 : pos.top < this.maxScrollY ? this.maxScrollY : pos.top; if (this.options.wheel) { pos.top = Math.round(pos.top / this.itemHeight) * this.itemHeight; } this.scrollTo(pos.left, pos.top, time, easing); }; BScroll.prototype.resetPosition = function () { var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var easeing = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ease.bounce; var x = this.x; var roundX = Math.round(x); if (!this.hasHorizontalScroll || roundX > 0) { x = 0; } else if (roundX < this.maxScrollX) { x = this.maxScrollX; } var y = this.y; var roundY = Math.round(y); if (!this.hasVerticalScroll || roundY > 0) { y = 0; } else if (roundY < this.maxScrollY) { y = this.maxScrollY; } if (x === this.x && y === this.y) { return false; } this.scrollTo(x, y, time, easeing); return true; }; BScroll.prototype.getComputedPosition = function () { var matrix = window.getComputedStyle(this.scroller, null); var x = void 0; var y = void 0; if (this.options.useTransform) { matrix = matrix[style.transform].split(')')[0].split(', '); x = +(matrix[12] || matrix[4]); y = +(matrix[13] || matrix[5]); } else { x = +matrix.left.replace(/[^-\d.]/g, ''); y = +matrix.top.replace(/[^-\d.]/g, ''); } return { x: x, y: y }; }; BScroll.prototype.stop = function () { if (this.options.useTransition && this.isInTransition) { this.isInTransition = false; var pos = this.getComputedPosition(); this._translate(pos.x, pos.y); if (this.options.wheel) { this.target = this.items[Math.round(-pos.y / this.itemHeight)]; } else { this.trigger('scrollEnd', { x: this.x, y: this.y }); } this.stopFromTransition = true; } else if (!this.options.useTransition && this.isAnimating) { this.isAnimating = false; this.trigger('scrollEnd', { x: this.x, y: this.y }); this.stopFromTransition = true; } }; BScroll.prototype.destroy = function () { this.destroyed = true; this.trigger('destroy'); this._removeDOMEvents(); // remove custom events this._events = {}; }; } function snapMixin(BScroll) { BScroll.prototype._initSnap = function () { var _this = this; this.currentPage = {}; var snap = this.options.snap; if (snap.loop) { var children = this.scroller.children; if (children.length > 1) { prepend(children[children.length - 1].cloneNode(true), this.scroller); this.scroller.appendChild(children[1].cloneNode(true)); } else { // Loop does not make any sense if there is only one child. snap.loop = false; } } var el = snap.el; if (typeof el === 'string') { el = this.scroller.querySelectorAll(el); } this.on('refresh', function () { _this.pages = []; if (!_this.wrapperWidth || !_this.wrapperHeight || !_this.scrollerWidth || !_this.scrollerHeight) { return; } var stepX = snap.stepX || _this.wrapperWidth; var stepY = snap.stepY || _this.wrapperHeight; var x = 0; var y = void 0; var cx = void 0; var cy = void 0; var i = 0; var l = void 0; var m = 0; var n = void 0; var rect = void 0; if (!el) { cx = Math.round(stepX / 2); cy = Math.round(stepY / 2); while (x > -_this.scrollerWidth) { _this.pages[i] = []; l = 0; y = 0; while (y > -_this.scrollerHeight) { _this.pages[i][l] = { x: Math.max(x, _this.maxScrollX), y: Math.max(y, _this.maxScrollY), width: stepX, height: stepY, cx: x - cx, cy: y - cy }; y -= stepY; l++; } x -= stepX; i++; } } else { l = el.length; n = -1; for (; i < l; i++) { rect = getRect(el[i]); if (i === 0 || rect.left <= getRect(el[i - 1]).left) { m = 0; n++; } if (!_this.pages[m]) { _this.pages[m] = []; } x = Math.max(-rect.left, _this.maxScrollX); y = Math.max(-rect.top, _this.maxScrollY); cx = x - Math.round(rect.width / 2); cy = y - Math.round(rect.height / 2); _this.pages[m][n] = { x: x, y: y, width: rect.width, height: rect.height, cx: cx, cy: cy }; if (x > _this.maxScrollX) { m++; } } } _this._checkSnapLoop(); var initPageX = snap._loopX ? 1 : 0; var initPageY = snap._loopY ? 1 : 0; _this._goToPage(_this.currentPage.pageX || initPageX, _this.currentPage.pageY || initPageY, 0); // Update snap threshold if needed. var snapThreshold = snap.threshold; if (snapThreshold % 1 === 0) { _this.snapThresholdX = snapThreshold; _this.snapThresholdY = snapThreshold; } else { _this.snapThresholdX = Math.round(_this.pages[_this.currentPage.pageX][_this.currentPage.pageY].width * snapThreshold); _this.snapThresholdY = Math.round(_this.pages[_this.currentPage.pageX][_this.currentPage.pageY].height * snapThreshold); } }); this.on('scrollEnd', function () { if (snap.loop) { if (snap._loopX) { if (_this.currentPage.pageX === 0) { _this._goToPage(_this.pages.length - 2, _this.currentPage.pageY, 0); } if (_this.currentPage.pageX === _this.pages.length - 1) { _this._goToPage(1, _this.currentPage.pageY, 0); } } else { if (_this.currentPage.pageY === 0) { _this._goToPage(_this.currentPage.pageX, _this.pages[0].length - 2, 0); } if (_this.currentPage.pageY === _this.pages[0].length - 1) { _this._goToPage(_this.currentPage.pageX, 1, 0); } } } }); if (snap.listenFlick !== false) { this.on('flick', function () { var time = snap.speed || Math.max(Math.max(Math.min(Math.abs(_this.x - _this.startX), 1000), Math.min(Math.abs(_this.y - _this.startY), 1000)), 300); _this._goToPage(_this.currentPage.pageX + _this.directionX, _this.currentPage.pageY + _this.directionY, time); }); } this.on('destroy', function () { if (snap.loop) { var _children = _this.scroller.children; if (_children.length > 2) { removeChild(_this.scroller, _children[_children.length - 1]); removeChild(_this.scroller, _children[0]); } } }); }; BScroll.prototype._checkSnapLoop = function () { var snap = this.options.snap; if (!snap.loop || !this.pages) { return; } if (this.pages.length > 1) { snap._loopX = true; } if (this.pages[0] && this.pages[0].length > 1) { snap._loopY = true; } if (snap._loopX && snap._loopY) { warn('Loop does not support two direction at the same time.'); } }; BScroll.prototype._nearestSnap = function (x, y) { if (!this.pages.length) { return { x: 0, y: 0, pageX: 0, pageY: 0 }; } var i = 0; // Check if we exceeded the snap threshold if (Math.abs(x - this.absStartX) <= this.snapThresholdX && Math.abs(y - this.absStartY) <= this.snapThresholdY) { return this.currentPage; } if (x > 0) { x = 0; } else if (x < this.maxScrollX) { x = this.maxScrollX; } if (y > 0) { y = 0; } else if (y < this.maxScrollY) { y = this.maxScrollY; } var l = this.pages.length; for (; i < l; i++) { if (x >= this.pages[i][0].cx) { x = this.pages[i][0].x; break; } } l = this.pages[i].length; var m = 0; for (; m < l; m++) { if (y >= this.pages[0][m].cy) { y = this.pages[0][m].y; break; } } if (i === this.currentPage.pageX) { i += this.directionX; if (i < 0) { i = 0; } else if (i >= this.pages.length) { i = this.pages.length - 1; } x = this.pages[i][0].x; } if (m === this.currentPage.pageY) { m += this.directionY; if (m < 0) { m = 0; } else if (m >= this.pages[0].length) { m = this.pages[0].length - 1; } y = this.pages[0][m].y; } return { x: x, y: y, pageX: i, pageY: m }; }; BScroll.prototype._goToPage = function (x) { var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var time = arguments[2]; var easing = arguments[3]; var snap = this.options.snap; if (!snap || !this.pages) { return; } easing = easing || snap.easing || ease.bounce; if (x >= this.pages.length) { x = this.pages.length - 1; } else if (x < 0) { x = 0; } if (!this.pages[x]) { return; } if (y >= this.pages[x].length) { y = this.pages[x].length - 1; } else if (y < 0) { y = 0; } var posX = this.pages[x][y].x; var posY = this.pages[x][y].y; time = time === undefined ? snap.speed || Math.max(Math.max(Math.min(Math.abs(posX - this.x), 1000), Math.min(Math.abs(posY - this.y), 1000)), 300) : time; this.currentPage = { x: posX, y: posY, pageX: x, pageY: y }; this.scrollTo(posX, posY, time, easing); }; BScroll.prototype.goToPage = function (x, y, time, easing) { var snap = this.options.snap; if (!snap) { return; } if (snap.loop) { var len = void 0; if (snap._loopX) { len = this.pages.length - 2; if (x >= len) { x = len - 1; } else if (x < 0) { x = 0; } x += 1; } else { len = this.pages[0].length - 2; if (y >= len) { y = len - 1; } else if (y < 0) { y = 0; } y += 1; } } this._goToPage(x, y, time, easing); }; BScroll.prototype.next = function (time, easing) { var snap = this.options.snap; if (!snap) { return; } var x = this.currentPage.pageX; var y = this.currentPage.pageY; x++; if (x >= this.pages.length && this.hasVerticalScroll) { x = 0; y++; } this._goToPage(x, y, time, easing); }; BScroll.prototype.prev = function (time, easing) { var snap = this.options.snap; if (!snap) { return; } var x = this.currentPage.pageX; var y = this.currentPage.pageY; x--; if (x < 0 && this.hasVerticalScroll) { x = 0; y--; } this._goToPage(x, y, time, easing); }; BScroll.prototype.getCurrentPage = function () { var snap = this.options.snap; if (!snap) { return null; } if (snap.loop) { var currentPage = void 0; if (snap._loopX) { currentPage = extend({}, this.currentPage, { pageX: this.currentPage.pageX - 1 }); } else { currentPage = extend({}, this.currentPage, { pageY: this.currentPage.pageY - 1 }); } return currentPage; } return this.currentPage; }; } function wheelMixin(BScroll) { BScroll.prototype.wheelTo = function () { var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; if (this.options.wheel) { this.y = -index * this.itemHeight; this.scrollTo(0, this.y); } }; BScroll.prototype.getSelectedIndex = function () { return this.options.wheel && this.selectedIndex; }; BScroll.prototype._initWheel = function () { var wheel = this.options.wheel; if (!wheel.wheelWrapperClass) { wheel.wheelWrapperClass = 'wheel-scroll'; } if (!wheel.wheelItemClass) { wheel.wheelItemClass = 'wheel-item'; } if (wheel.selectedIndex === undefined) { wheel.selectedIndex = 0; warn('wheel option selectedIndex is required!'); } }; } var INDICATOR_MIN_LEN = 8; function scrollbarMixin(BScroll) { BScroll.prototype._initScrollbar = function () { var _this = this; var _options$scrollbar = this.options.scrollbar, _options$scrollbar$fa = _options$scrollbar.fade, fade = _options$scrollbar$fa === undefined ? true : _options$scrollbar$fa, _options$scrollbar$in = _options$scrollbar.interactive, interactive = _options$scrollbar$in === undefined ? false : _options$scrollbar$in; this.indicators = []; var indicator = void 0; if (this.options.scrollX) { indicator = { el: createScrollbar('horizontal'), direction: 'horizontal', fade: fade, interactive: interactive }; this._insertScrollBar(indicator.el); this.indicators.push(new Indicator(this, indicator)); } if (this.options.scrollY) { indicator = { el: createScrollbar('vertical'), direction: 'vertical', fade: fade, interactive: interactive }; this._insertScrollBar(indicator.el); this.indicators.push(new Indicator(this, indicator)); } this.on('refresh', function () { for (var i = 0; i < _this.indicators.length; i++) { _this.indicators[i].refresh(); } }); if (fade) { this.on('scrollEnd', function () { for (var i = 0; i < _this.indicators.length; i++) { _this.indicators[i].fade(); } }); this.on('scrollCancel', function () { for (var i = 0; i < _this.indicators.length; i++) { _this.indicators[i].fade(); } }); this.on('scrollStart', function () { for (var i = 0; i < _this.indicators.length; i++) { _this.indicators[i].fade(true); } }); this.on('beforeScrollStart', function () { for (var i = 0; i < _this.indicators.length; i++) { _this.indicators[i].fade(true, true); } }); } this.on('destroy', function () { _this._removeScrollBars(); }); }; BScroll.prototype._insertScrollBar = function (scrollbar) { this.wrapper.appendChild(scrollbar); }; BScroll.prototype._removeScrollBars = function () { for (var i = 0; i < this.indicators.length; i++) { this.indicators[i].destroy(); } }; } function createScrollbar(direction) { var scrollbar = document.createElement('div'); var indicator = document.createElement('div'); scrollbar.style.cssText = 'position:absolute;z-index:9999;pointerEvents:none'; indicator.style.cssText = '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;'; indicator.className = 'bscroll-indicator'; if (direction === 'horizontal') { scrollbar.style.cssText += ';height:7px;left:2px;right:2px;bottom:0'; indicator.style.height = '100%'; scrollbar.className = 'bscroll-horizontal-scrollbar'; } else { scrollbar.style.cssText += ';width:7px;bottom:2px;top:2px;right:1px'; indicator.style.width = '100%'; scrollbar.className = 'bscroll-vertical-scrollbar'; } scrollbar.style.cssText += ';overflow:hidden'; scrollbar.appendChild(indicator); return scrollbar; } function Indicator(scroller, options) { this.wrapper = options.el; this.wrapperStyle = this.wrapper.style; this.indicator = this.wrapper.children[0]; this.indicatorStyle = this.indicator.style; this.scroller = scroller; this.direction = options.direction; if (options.fade) { this.visible = 0; this.wrapperStyle.opacity = '0'; } else { this.visible = 1; } this.sizeRatioX = 1; this.sizeRatioY = 1; this.maxPosX = 0; this.maxPosY = 0; this.x = 0; this.y = 0; if (options.interactive) { this._addDOMEvents(); } } Indicator.prototype.handleEvent = function (e) { switch (e.type) { case 'touchstart': case 'mousedown': this._start(e); break; case 'touchmove': case 'mousemove': this._move(e); break; case 'touchend': case 'mouseup': case 'touchcancel': case 'mousecancel': this._end(e); break; } }; Indicator.prototype.refresh = function () { this.transitionTime(); this._calculate(); this.updatePosition(); }; Indicator.prototype.fade = function (visible, hold) { var _this2 = this; if (hold && !this.visible) { return; } var time = visible ? 250 : 500; visible = visible ? '1' : '0'; this.wrapperStyle[style.transitionDuration] = time + 'ms'; clearTimeout(this.fadeTimeout); this.fadeTimeout = setTimeout(function () { _this2.wrapperStyle.opacity = visible; _this2.visible = +visible; }, 0); }; Indicator.prototype.updatePosition = function () { if (this.direction === 'vertical') { var y = Math.round(this.sizeRatioY * this.scroller.y); if (y < 0) { this.transitionTime(500); var height = Math.max(this.indicatorHeight + y * 3, INDICATOR_MIN_LEN); this.indicatorStyle.height = height + 'px'; y = 0; } else if (y > this.maxPosY) { this.transitionTime(500); var _height = Math.max(this.indicatorHeight - (y - this.maxPosY) * 3, INDICATOR_MIN_LEN); this.indicatorStyle.height = _height + 'px'; y = this.maxPosY + this.indicatorHeight - _height; } else { this.indicatorStyle.height = this.indicatorHeight + 'px'; } this.y = y; if (this.scroller.options.useTransform) { this.indicatorStyle[style.transform] = 'translateY(' + y + 'px)' + this.scroller.translateZ; } else { this.indicatorStyle.top = y + 'px'; } } else { var x = Math.round(this.sizeRatioX * this.scroller.x); if (x < 0) { this.transitionTime(500); var width = Math.max(this.indicatorWidth + x * 3, INDICATOR_MIN_LEN); this.indicatorStyle.width = width + 'px'; x = 0; } else if (x > this.maxPosX) { this.transitionTime(500); var _width = Math.max(this.indicatorWidth - (x - this.maxPosX) * 3, INDICATOR_MIN_LEN); this.indicatorStyle.width = _width + 'px'; x = this.maxPosX + this.indicatorWidth - _width; } else { this.indicatorStyle.width = this.indicatorWidth + 'px'; } this.x = x; if (this.scroller.options.useTransform) { this.indicatorStyle[style.transform] = 'translateX(' + x + 'px)' + this.scroller.translateZ; } else { this.indicatorStyle.left = x + 'px'; } } }; Indicator.prototype.transitionTime = function () { var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; this.indicatorStyle[style.transitionDuration] = time + 'ms'; }; Indicator.prototype.transitionTimingFunction = function (easing) { this.indicatorStyle[style.transitionTimingFunction] = easing; }; Indicator.prototype.destroy = function () { this._removeDOMEvents(); this.wrapper.parentNode.removeChild(this.wrapper); }; Indicator.prototype._start = function (e) { var point = e.touches ? e.touches[0] : e; e.preventDefault(); e.stopPropagation(); this.transitionTime(); this.initiated = true; this.moved = false; this.lastPointX = point.pageX; this.lastPointY = point.pageY; this.startTime = getNow(); this._handleMoveEvents(addEvent); this.scroller.trigger('beforeScrollStart'); }; Indicator.prototype._move = function (e) { var point = e.touches ? e.touches[0] : e; e.preventDefault(); e.stopPropagation(); if (!this.moved) { this.scroller.trigger('scrollStart'); } this.moved = true; var deltaX = point.pageX - this.lastPointX; this.lastPointX = point.pageX; var deltaY = point.pageY - this.lastPointY; this.lastPointY = point.pageY; var newX = this.x + deltaX; var newY = this.y + deltaY; this._pos(newX, newY); }; Indicator.prototype._end = function (e) { if (!this.initiated) { return; } this.initiated = false; e.preventDefault(); e.stopPropagation(); this._handleMoveEvents(removeEvent); var snapOption = this.scroller.options.snap; if (snapOption) { var speed = snapOption.speed, _snapOption$easing = snapOption.easing, easing = _snapOption$easing === undefined ? ease.bounce : _snapOption$easing; var snap = this.scroller._nearestSnap(this.scroller.x, this.scroller.y); var time = speed || Math.max(Math.max(Math.min(Math.abs(this.scroller.x - snap.x), 1000), Math.min(Math.abs(this.scroller.y - snap.y), 1000)), 300); if (this.scroller.x !== snap.x || this.scroller.y !== snap.y) { this.scroller.directionX = 0; this.scroller.directionY = 0; this.scroller.currentPage = snap; this.scroller.scrollTo(snap.x, snap.y, time, easing); } } if (this.moved) { this.scroller.trigger('scrollEnd', { x: this.scroller.x, y: this.scroller.y }); } }; Indicator.prototype._pos = function (x, y) { if (x < 0) { x = 0; } else if (x > this.maxPosX) { x = this.maxPosX; } if (y < 0) { y = 0; } else if (y > this.maxPosY) { y = this.maxPosY; } x = Math.round(x / this.sizeRatioX); y = Math.round(y / this.sizeRatioY); this.scroller.scrollTo(x, y); this.scroller.trigger('scroll', { x: this.scroller.x, y: this.scroller.y }); }; Indicator.prototype._calculate = function () { if (this.direction === 'vertical') { var wrapperHeight = this.wrapper.clientHeight; this.indicatorHeight = Math.max(Math.round(wrapperHeight * wrapperHeight / (this.scroller.scrollerHeight || wrapperHeight || 1)), INDICATOR_MIN_LEN); this.indicatorStyle.height = this.indicatorHeight + 'px'; this.maxPosY = wrapperHeight - this.indicatorHeight; this.sizeRatioY = this.maxPosY / this.scroller.maxScrollY; } else { var wrapperWidth = this.wrapper.clientWidth; this.indicatorWidth = Math.max(Math.round(wrapperWidth * wrapperWidth / (this.scroller.scrollerWidth || wrapperWidth || 1)), INDICATOR_MIN_LEN); this.indicatorStyle.width = this.indicatorWidth + 'px'; this.maxPosX = wrapperWidth - this.indicatorWidth; this.sizeRatioX = this.maxPosX / this.scroller.maxScrollX; } }; Indicator.prototype._addDOMEvents = function () { var eventOperation = addEvent; this._handleDOMEvents(eventOperation); }; Indicator.prototype._removeDOMEvents = function () { var eventOperation = removeEvent; this._handleDOMEvents(eventOperation); this._handleMoveEvents(eventOperation); }; Indicator.prototype._handleMoveEvents = function (eventOperation) { if (!this.scroller.options.disableTouch) { eventOperation(window, 'touchmove', this); } if (!this.scroller.options.disableMouse) { eventOperation(window, 'mousemove', this); } }; Indicator.prototype._handleDOMEvents = function (eventOperation) { if (!this.scroller.options.disableTouch) { eventOperation(this.indicator, 'touchstart', this); eventOperation(window, 'touchend', this); } if (!this.scroller.options.disableMouse) { eventOperation(this.indicator, 'mousedown', this); eventOperation(window, 'mouseup', this); } }; function pullDownMixin(BScroll) { BScroll.prototype._initPullDown = function () { // must watch scroll in real time this.options.probeType = PROBE_REALTIME; }; BScroll.prototype._checkPullDown = function () { var _options$pullDownRefr = this.options.pullDownRefresh, _options$pullDownRefr2 = _options$pullDownRefr.threshold, threshold = _options$pullDownRefr2 === undefined ? 90 : _options$pullDownRefr2, _options$pullDownRefr3 = _options$pullDownRefr.stop, stop = _options$pullDownRefr3 === undefined ? 40 : _options$pullDownRefr3; // check if a real pull down action if (this.directionY !== DIRECTION_DOWN || this.y < threshold) { return false; } if (!this.pulling) { this.pulling = true; this.trigger('pullingDown'); } this.scrollTo(this.x, stop, this.options.bounceTime, ease.bounce); return this.pulling; }; BScroll.prototype.finishPullDown = function () { this.pulling = false; this.resetPosition(this.options.bounceTime, ease.bounce); }; BScroll.prototype.openPullDown = function () { var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; this.options.pullDownRefresh = config; this._initPullDown(); }; BScroll.prototype.closePullDown = function () { this.options.pullDownRefresh = false; }; } function pullUpMixin(BScroll) { BScroll.prototype._initPullUp = function () { // must watch scroll in real time this.options.probeType = PROBE_REALTIME; this.pullupWatching = false; this._watchPullUp(); }; BScroll.prototype._watchPullUp = function () { if (this.pullupWatching) { return; } this.pullupWatching = true; this.on('scroll', this._checkToEnd); }; BScroll.prototype._checkToEnd = function (pos) { var _this = this; var _options$pullUpLoad$t = this.options.pullUpLoad.threshold, threshold = _options$pullUpLoad$t === undefined ? 0 : _options$pullUpLoad$t; if (this.movingDirectionY === DIRECTION_UP && pos.y <= this.maxScrollY + threshold) { // reset pullupWatching status after scroll end. this.once('scrollEnd', function () { _this.pullupWatching = false; }); this.trigger('pullingUp'); this.off('scroll', this._checkToEnd); } }; BScroll.prototype.finishPullUp = function () { var _this2 = this; if (this.pullupWatching) { this.once('scrollEnd', function () { _this2._watchPullUp(); }); } else { this._watchPullUp(); } }; BScroll.prototype.openPullUp = function () { var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; this.options.pullUpLoad = config; this._initPullUp(); }; BScroll.prototype.closePullUp = function () { this.options.pullUpLoad = false; if (!this.pullupWatching) { return; } this.pullupWatching = false; this.off('scroll', this._checkToEnd); }; } function mouseWheelMixin(BScroll) { BScroll.prototype._initMouseWheel = function () { var _this = this; this._handleMouseWheelEvent(addEvent); this.on('destroy', function () { clearTimeout(_this.mouseWheelTimer); _this._handleMouseWheelEvent(removeEvent); }); this.firstWheelOpreation = true; }; BScroll.prototype._handleMouseWheelEvent = function (eventOperation) { eventOperation(this.wrapper, 'wheel', this); eventOperation(this.wrapper, 'mousewheel', this); eventOperation(this.wrapper, 'DOMMouseScroll', this); }; BScroll.prototype._onMouseWheel = function (e) { var _this2 = this; if (!this.enabled) { return; } e.preventDefault(); if (this.firstWheelOpreation) { this.trigger('scrollStart'); } this.firstWheelOpreation = false; clearTimeout(this.mouseWheelTimer); this.mouseWheelTimer = setTimeout(function () { if (!_this2.options.snap) { _this2.trigger('scrollEnd', { x: _this2.x, y: _this2.y }); } _this2.firstWheelOpreation = true; }, 400); var _options$mouseWheel = this.options.mouseWheel, _options$mouseWheel$s = _options$mouseWheel.speed, speed = _options$mouseWheel$s === undefined ? 20 : _options$mouseWheel$s, _options$mouseWheel$i = _options$mouseWheel.invert, invert = _options$mouseWheel$i === undefined ? false : _options$mouseWheel$i; var wheelDeltaX = void 0; var wheelDeltaY = void 0; switch (true) { case 'deltaX' in e: if (e.deltaMode === 1) { wheelDeltaX = -e.deltaX * speed; wheelDeltaY = -e.deltaY * speed; } else { wheelDeltaX = -e.deltaX; wheelDeltaY = -e.deltaY; } break; case 'wheelDeltaX' in e: wheelDeltaX = e.wheelDeltaX / 120 * speed; wheelDeltaY = e.wheelDeltaY / 120 * speed; break; case 'wheelDelta' in e: wheelDeltaX = wheelDeltaY = e.wheelDelta / 120 * speed; break; case 'detail' in e: wheelDeltaX = wheelDeltaY = -e.detail / 3 * speed; break; default: return; } var direction = invert ? -1 : 1; wheelDeltaX *= direction; wheelDeltaY *= direction; if (!this.hasVerticalScroll) { wheelDeltaX = wheelDeltaY; wheelDeltaY = 0; } var newX = void 0; var newY = void 0; if (this.options.snap) { newX = this.currentPage.pageX; newY = this.currentPage.pageY; if (wheelDeltaX > 0) { newX--; } else if (wheelDeltaX < 0) { newX++; } if (wheelDeltaY > 0) { newY--; } else if (wheelDeltaY < 0) { newY++; } this._goToPage(newX, newY); return; } newX = this.x + Math.round(this.hasHorizontalScroll ? wheelDeltaX : 0); newY = this.y + Math.round(this.hasVerticalScroll ? wheelDeltaY : 0); this.directionX = wheelDeltaX > 0 ? -1 : wheelDeltaX < 0 ? 1 : 0; this.directionY = wheelDeltaY > 0 ? -1 : wheelDeltaY < 0 ? 1 : 0; if (newX > 0) { newX = 0; } else if (newX < this.maxScrollX) { newX = this.maxScrollX; } if (newY > 0) { newY = 0; } else if (newY < this.maxScrollY) { newY = this.maxScrollY; } this.scrollTo(newX, newY); this.trigger('scroll', { x: this.x, y: this.y }); }; } function BScroll(el, options) { this.wrapper = typeof el === 'string' ? document.querySelector(el) : el; if (!this.wrapper) { warn('Can not resolve the wrapper DOM.'); } this.scroller = this.wrapper.children[0]; if (!this.scroller) { warn('The wrapper need at least one child element to be scroller.'); } // cache style for better performance this.scrollerStyle = this.scroller.style; this._init(el, options); } initMixin(BScroll); coreMixin(BScroll); eventMixin(BScroll); snapMixin(BScroll); wheelMixin(BScroll); scrollbarMixin(BScroll); pullDownMixin(BScroll); pullUpMixin(BScroll); mouseWheelMixin(BScroll); BScroll.Version = '1.9.1'; /* harmony default export */ __webpack_exports__["default"] = (BScroll); /***/ }), /* 55 */ /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(14); var defined = __webpack_require__(13); // true -> String#at // false -> String#codePointAt module.exports = function (TO_STRING) { return function (that, pos) { var s = String(defined(that)); var i = toInteger(pos); var l = s.length; var a, b; if (i < 0 || i >= l) return TO_STRING ? '' : undefined; a = s.charCodeAt(i); return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; }; }; /***/ }), /* 56 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var create = __webpack_require__(48); var descriptor = __webpack_require__(15); var setToStringTag = __webpack_require__(35); var IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() __webpack_require__(6)(IteratorPrototype, __webpack_require__(2)('iterator'), function () { return this; }); module.exports = function (Constructor, NAME, next) { Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); setToStringTag(Constructor, NAME + ' Iterator'); }; /***/ }), /* 57 */ /***/ (function(module, exports, __webpack_require__) { var dP = __webpack_require__(7); var anObject = __webpack_require__(8); var getKeys = __webpack_require__(18); module.exports = __webpack_require__(4) ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var keys = getKeys(Properties); var length = keys.length; var i = 0; var P; while (length > i) dP.f(O, P = keys[i++], Properties[P]); return O; }; /***/ }), /* 58 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) var has = __webpack_require__(10); var toObject = __webpack_require__(17); var IE_PROTO = __webpack_require__(16)('IE_PROTO'); var ObjectProto = Object.prototype; module.exports = Object.getPrototypeOf || function (O) { O = toObject(O); if (has(O, IE_PROTO)) return O[IE_PROTO]; if (typeof O.constructor == 'function' && O instanceof O.constructor) { return O.constructor.prototype; } return O instanceof Object ? ObjectProto : null; }; /***/ }), /* 59 */ /***/ (function(module, exports, __webpack_require__) { // getting tag from 19.1.3.6 Object.prototype.toString() var cof = __webpack_require__(19); var TAG = __webpack_require__(2)('toStringTag'); // ES3 wrong here var ARG = cof(function () { return arguments; }()) == 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet = function (it, key) { try { return it[key]; } catch (e) { /* empty */ } }; module.exports = function (it) { var O, T, B; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T // builtinTag case : ARG ? cof(O) // ES3 arguments fallback : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; }; /***/ }), /* 60 */, /* 61 */, /* 62 */, /* 63 */, /* 64 */ /***/ (function(module, exports, __webpack_require__) { // call something on iterator step with safe closing on error var anObject = __webpack_require__(8); module.exports = function (iterator, fn, value, entries) { try { return entries ? fn(anObject(value)[0], value[1]) : fn(value); // 7.4.6 IteratorClose(iterator, completion) } catch (e) { var ret = iterator['return']; if (ret !== undefined) anObject(ret.call(iterator)); throw e; } }; /***/ }), /* 65 */ /***/ (function(module, exports, __webpack_require__) { // check on default Array iterator var Iterators = __webpack_require__(22); var ITERATOR = __webpack_require__(2)('iterator'); var ArrayProto = Array.prototype; module.exports = function (it) { return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); }; /***/ }), /* 66 */ /***/ (function(module, exports, __webpack_require__) { var classof = __webpack_require__(59); var ITERATOR = __webpack_require__(2)('iterator'); var Iterators = __webpack_require__(22); module.exports = __webpack_require__(3).getIteratorMethod = function (it) { if (it != undefined) return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)]; }; /***/ }), /* 67 */ /***/ (function(module, exports, __webpack_require__) { var ITERATOR = __webpack_require__(2)('iterator'); var SAFE_CLOSING = false; try { var riter = [7][ITERATOR](); riter['return'] = function () { SAFE_CLOSING = true; }; // eslint-disable-next-line no-throw-literal Array.from(riter, function () { throw 2; }); } catch (e) { /* empty */ } module.exports = function (exec, skipClosing) { if (!skipClosing && !SAFE_CLOSING) return false; var safe = false; try { var arr = [7]; var iter = arr[ITERATOR](); iter.next = function () { return { done: safe = true }; }; arr[ITERATOR] = function () { return iter; }; exec(arr); } catch (e) { /* empty */ } return safe; }; /***/ }), /* 68 */, /* 69 */, /* 70 */, /* 71 */, /* 72 */, /* 73 */, /* 74 */, /* 75 */, /* 76 */, /* 77 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else if (typeof exports !== "undefined") { factory(exports); } else { var mod = { exports: {} }; factory(mod.exports); global.env = mod.exports; } })(this, function (exports) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var inBrowser = exports.inBrowser = typeof window !== 'undefined'; }); /***/ }), /* 78 */, /* 79 */, /* 80 */, /* 81 */, /* 82 */ /***/ (function(module, exports) { /***/ }), /* 83 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(84); var global = __webpack_require__(0); var hide = __webpack_require__(6); var Iterators = __webpack_require__(22); var TO_STRING_TAG = __webpack_require__(2)('toStringTag'); var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' + 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' + 'TextTrackList,TouchList').split(','); for (var i = 0; i < DOMIterables.length; i++) { var NAME = DOMIterables[i]; var Collection = global[NAME]; var proto = Collection && Collection.prototype; if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); Iterators[NAME] = Iterators.Array; } /***/ }), /* 84 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var addToUnscopables = __webpack_require__(85); var step = __webpack_require__(86); var Iterators = __webpack_require__(22); var toIObject = __webpack_require__(12); // 22.1.3.4 Array.prototype.entries() // 22.1.3.13 Array.prototype.keys() // 22.1.3.29 Array.prototype.values() // 22.1.3.30 Array.prototype[@@iterator]() module.exports = __webpack_require__(45)(Array, 'Array', function (iterated, kind) { this._t = toIObject(iterated); // target this._i = 0; // next index this._k = kind; // kind // 22.1.5.2.1 %ArrayIteratorPrototype%.next() }, function () { var O = this._t; var kind = this._k; var index = this._i++; if (!O || index >= O.length) { this._t = undefined; return step(1); } if (kind == 'keys') return step(0, index); if (kind == 'values') return step(0, O[index]); return step(0, [index, O[index]]); }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) Iterators.Arguments = Iterators.Array; addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); /***/ }), /* 85 */ /***/ (function(module, exports) { module.exports = function () { /* empty */ }; /***/ }), /* 86 */ /***/ (function(module, exports) { module.exports = function (done, value) { return { value: value, done: !!done }; }; /***/ }), /* 87 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // 25.4.1.5 NewPromiseCapability(C) var aFunction = __webpack_require__(28); function PromiseCapability(C) { var resolve, reject; this.promise = new C(function ($$resolve, $$reject) { if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); resolve = $$resolve; reject = $$reject; }); this.resolve = aFunction(resolve); this.reject = aFunction(reject); } module.exports.f = function (C) { return new PromiseCapability(C); }; /***/ }), /* 88 */, /* 89 */, /* 90 */, /* 91 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(77)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else if (typeof exports !== "undefined") { factory(exports, require('./env')); } else { var mod = { exports: {} }; factory(mod.exports, global.env); global.dom = mod.exports; } })(this, function (exports, _env) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.hasClass = hasClass; exports.addClass = addClass; exports.removeClass = removeClass; exports.getData = getData; exports.getRect = getRect; exports.prefixStyle = prefixStyle; function hasClass(el, className) { var reg = new RegExp('(^|\\s)' + className + '(\\s|$)'); return reg.test(el.className); } function addClass(el, className) { if (hasClass(el, className)) { return; } var newClass = el.className.split(' '); newClass.push(className); el.className = newClass.join(' '); } function removeClass(el, className) { if (!hasClass(el, className)) { return; } var reg = new RegExp('(^|\\s)' + className + '(\\s|$)', 'g'); el.className = el.className.replace(reg, ' '); } function getData(el, name) { var prefix = 'data-'; return el.getAttribute(prefix + name); } function getRect(el) { return { top: el.offsetTop, left: el.offsetLeft, width: el.offsetWidth, height: el.offsetHeight }; } var vendor = function () { if (!_env.inBrowser) { return false; } var elementStyle = document.createElement('div').style; 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); } }); /***/ }), /* 92 */ /***/ (function(module, exports, __webpack_require__) { function injectStyle (ssrContext) { __webpack_require__(95) } var Component = __webpack_require__(1)( /* script */ __webpack_require__(96), /* template */ __webpack_require__(97), /* styles */ injectStyle, /* scopeId */ null, /* moduleIdentifier (server only) */ null ) module.exports = Component.exports /***/ }), /* 93 */, /* 94 */, /* 95 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 96 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else if (typeof exports !== "undefined") { factory(module, exports); } else { var mod = { exports: {} }; factory(mod, mod.exports); global.loading = mod.exports; } })(this, function (module, exports) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var COMPONENT_NAME = 'cube-loading'; exports.default = { name: COMPONENT_NAME, data: function data() { return { balde: 12 }; }, props: { size: { type: Number } }, computed: { style: function style() { if (!this.size) { return; } var value = this.size + 'px'; return { width: value, height: value }; } } }; module.exports = exports['default']; }); /***/ }), /* 97 */ /***/ (function(module, exports) { module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; return _c('div', { staticClass: "cube-loading" }, [_c('span', { staticClass: "cube-loading-spinners", style: (_vm.style) }, _vm._l((_vm.balde), function(item) { return _c('i', { staticClass: "cube-loading-spinner" }) }))]) },staticRenderFns: []} /***/ }), /* 98 */ /***/ (function(module, exports, __webpack_require__) { // 7.3.20 SpeciesConstructor(O, defaultConstructor) var anObject = __webpack_require__(8); var aFunction = __webpack_require__(28); var SPECIES = __webpack_require__(2)('species'); module.exports = function (O, D) { var C = anObject(O).constructor; var S; return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); }; /***/ }), /* 99 */ /***/ (function(module, exports, __webpack_require__) { var ctx = __webpack_require__(21); var invoke = __webpack_require__(127); var html = __webpack_require__(49); var cel = __webpack_require__(24); var global = __webpack_require__(0); var process = global.process; var setTask = global.setImmediate; var clearTask = global.clearImmediate; var MessageChannel = global.MessageChannel; var Dispatch = global.Dispatch; var counter = 0; var queue = {}; var ONREADYSTATECHANGE = 'onreadystatechange'; var defer, channel, port; var run = function () { var id = +this; // eslint-disable-next-line no-prototype-builtins if (queue.hasOwnProperty(id)) { var fn = queue[id]; delete queue[id]; fn(); } }; var listener = function (event) { run.call(event.data); }; // Node.js 0.9+ & IE10+ has setImmediate, otherwise: if (!setTask || !clearTask) { setTask = function setImmediate(fn) { var args = []; var i = 1; while (arguments.length > i) args.push(arguments[i++]); queue[++counter] = function () { // eslint-disable-next-line no-new-func invoke(typeof fn == 'function' ? fn : Function(fn), args); }; defer(counter); return counter; }; clearTask = function clearImmediate(id) { delete queue[id]; }; // Node.js 0.8- if (__webpack_require__(19)(process) == 'process') { defer = function (id) { process.nextTick(ctx(run, id, 1)); }; // Sphere (JS game engine) Dispatch API } else if (Dispatch && Dispatch.now) { defer = function (id) { Dispatch.now(ctx(run, id, 1)); }; // Browsers with MessageChannel, includes WebWorkers } else if (MessageChannel) { channel = new MessageChannel(); port = channel.port2; channel.port1.onmessage = listener; defer = ctx(port.postMessage, port, 1); // Browsers with postMessage, skip WebWorkers // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { defer = function (id) { global.postMessage(id + '', '*'); }; global.addEventListener('message', listener, false); // IE8- } else if (ONREADYSTATECHANGE in cel('script')) { defer = function (id) { html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { html.removeChild(this); run.call(id); }; }; // Rest old browsers } else { defer = function (id) { setTimeout(ctx(run, id, 1), 0); }; } } module.exports = { set: setTask, clear: clearTask }; /***/ }), /* 100 */ /***/ (function(module, exports) { module.exports = function (exec) { try { return { e: false, v: exec() }; } catch (e) { return { e: true, v: e }; } }; /***/ }), /* 101 */ /***/ (function(module, exports, __webpack_require__) { var anObject = __webpack_require__(8); var isObject = __webpack_require__(5); var newPromiseCapability = __webpack_require__(87); module.exports = function (C, x) { anObject(C); if (isObject(x) && x.constructor === C) return x; var promiseCapability = newPromiseCapability.f(C); var resolve = promiseCapability.resolve; resolve(x); return promiseCapability.promise; }; /***/ }), /* 102 */, /* 103 */, /* 104 */, /* 105 */, /* 106 */, /* 107 */, /* 108 */, /* 109 */, /* 110 */, /* 111 */, /* 112 */, /* 113 */, /* 114 */, /* 115 */, /* 116 */, /* 117 */, /* 118 */, /* 119 */ /***/ (function(module, exports, __webpack_require__) { function injectStyle (ssrContext) { __webpack_require__(120) } var Component = __webpack_require__(1)( /* script */ __webpack_require__(121), /* template */ __webpack_require__(136), /* styles */ injectStyle, /* scopeId */ null, /* moduleIdentifier (server only) */ null ) module.exports = Component.exports /***/ }), /* 120 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 121 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports, __webpack_require__(122), __webpack_require__(29), __webpack_require__(54), __webpack_require__(92), __webpack_require__(133), __webpack_require__(91)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else if (typeof exports !== "undefined") { factory(module, exports, require('babel-runtime/core-js/promise'), require('babel-runtime/core-js/object/assign'), require('better-scroll'), require('../loading/loading.vue'), require('../bubble/bubble.vue'), require('../../common/helpers/dom')); } else { var mod = { exports: {} }; factory(mod, mod.exports, global.promise, global.assign, global.betterScroll, global.loading, global.bubble, global.dom); global.scroll = mod.exports; } })(this, function (module, exports, _promise, _assign, _betterScroll, _loading, _bubble, _dom) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _promise2 = _interopRequireDefault(_promise); var _assign2 = _interopRequireDefault(_assign); var _betterScroll2 = _interopRequireDefault(_betterScroll); var _loading2 = _interopRequireDefault(_loading); var _bubble2 = _interopRequireDefault(_bubble); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var COMPONENT_NAME = 'cube-scroll'; var DIRECTION_H = 'horizontal'; var DIRECTION_V = 'vertical'; var DEFAULT_REFRESH_TXT = 'Refresh success'; var PULL_DOWN_ELEMENT_INITIAL_HEIGHT = -50; var EVENT_SCROLL = 'scroll'; var EVENT_BEFORE_SCROLL_START = 'before-scroll-start'; var EVENT_CLICK = 'click'; var EVENT_PULLING_DOWN = 'pulling-down'; var EVENT_PULLING_UP = 'pulling-up'; var DEFAULT_OPTIONS = { observeDOM: true, click: true, probeType: 1, scrollbar: false, pullDownRefresh: false, pullUpLoad: false }; exports.default = { name: COMPONENT_NAME, props: { data: { type: Array, default: function _default() { return []; } }, options: { type: Object, default: function _default() { return {}; } }, listenScroll: { type: Boolean, default: false }, listenBeforeScroll: { type: Boolean, default: false }, direction: { type: String, default: DIRECTION_V }, refreshDelay: { type: Number, default: 20 } }, data: function data() { return { beforePullDown: true, isPullingDown: false, isPullUpLoad: false, pullUpDirty: true, bubbleY: 0, pullDownStyle: '' }; }, computed: { pullDownRefresh: function pullDownRefresh() { return this.options.pullDownRefresh; }, pullUpLoad: function pullUpLoad() { return this.options.pullUpLoad; }, pullUpTxt: function pullUpTxt() { var pullUpLoad = this.pullUpLoad; var txt = pullUpLoad && pullUpLoad.txt; var moreTxt = txt && txt.more || ''; var noMoreTxt = txt && txt.noMore || ''; return this.pullUpDirty ? moreTxt : noMoreTxt; }, refreshTxt: function refreshTxt() { var pullDownRefresh = this.pullDownRefresh; return pullDownRefresh && pullDownRefresh.txt || DEFAULT_REFRESH_TXT; } }, watch: { data: function data() { var _this = this; setTimeout(function () { _this.forceUpdate(true); }, this.refreshDelay); }, pullDownRefresh: { handler: function handler(newVal, oldVal) { if (newVal) { this.scroll.openPullDown(newVal); if (!oldVal) { this._onPullDownRefresh(); this._calculateMinHeight(); } } if (!newVal && oldVal) { this.scroll.closePullDown(); this._offPullDownRefresh(); this._calculateMinHeight(); } }, deep: true }, pullUpLoad: { handler: function handler(newVal, oldVal) { if (newVal) { this.scroll.openPullUp(newVal); if (!oldVal) { this._onPullUpLoad(); this._calculateMinHeight(); } } if (!newVal && oldVal) { this.scroll.closePullUp(); this._offPullUpLoad(); this._calculateMinHeight(); } }, deep: true } }, activated: function activated() { this.enable(); }, deactivated: function deactivated() { this.disable(); }, mounted: function mounted() { var _this2 = this; this.$nextTick(function () { _this2.initScroll(); }); }, beforeDestroy: function beforeDestroy() { this.destroy(); }, methods: { initScroll: function initScroll() { var _this3 = this; if (!this.$refs.wrapper) { return; } this._calculateMinHeight(); var options = (0, _assign2.default)({}, DEFAULT_OPTIONS, { scrollY: this.direction === DIRECTION_V, scrollX: this.direction === DIRECTION_H }, this.options); this.scroll = new _betterScroll2.default(this.$refs.wrapper, options); if (this.listenScroll) { this.scroll.on('scroll', function (pos) { _this3.$emit(EVENT_SCROLL, pos); }); } if (this.listenBeforeScroll) { this.scroll.on('beforeScrollStart', function () { _this3.$emit(EVENT_BEFORE_SCROLL_START); }); } if (this.pullDownRefresh) { this._onPullDownRefresh(); } if (this.pullUpLoad) { this._onPullUpLoad(); } }, disable: function disable() { this.scroll && this.scroll.disable(); }, enable: function enable() { this.scroll && this.scroll.enable(); }, refresh: function refresh() { this._calculateMinHeight(); this.scroll && this.scroll.refresh(); }, destroy: function destroy() { this.scroll && this.scroll.destroy(); this.scroll = null; }, scrollTo: function scrollTo() { this.scroll && this.scroll.scrollTo.apply(this.scroll, arguments); }, scrollToElement: function scrollToElement() { this.scroll && this.scroll.scrollToElement.apply(this.scroll, arguments); }, clickItem: function clickItem(item) { this.$emit(EVENT_CLICK, item); }, forceUpdate: function forceUpdate() { var _this4 = this; var dirty = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (this.pullDownRefresh && this.isPullingDown) { this.isPullingDown = false; this._reboundPullDown().then(function () { _this4._afterPullDown(dirty); }); } else if (this.pullUpLoad && this.isPullUpLoad) { this.isPullUpLoad = false; this.scroll.finishPullUp(); this.pullUpDirty = dirty; dirty && this.refresh(); } else { dirty && this.refresh(); } }, _calculateMinHeight: function _calculateMinHeight() { if (this.$refs.listWrapper) { this.$refs.listWrapper.style.minHeight = this.pullDownRefresh || this.pullUpLoad ? (0, _dom.getRect)(this.$refs.wrapper).height + 1 + 'px' : 0; } }, _onPullDownRefresh: function _onPullDownRefresh() { this.scroll.on('pullingDown', this._pullDownHandle); this.scroll.on('scroll', this._pullDownScrollHandle); }, _offPullDownRefresh: function _offPullDownRefresh() { this.scroll.off('pullingDown', this._pullDownHandle); this.scroll.off('scroll', this._pullDownScrollHandle); }, _pullDownHandle: function _pullDownHandle() { this.beforePullDown = false; this.isPullingDown = true; this.$emit(EVENT_PULLING_DOWN); }, _pullDownScrollHandle: function _pullDownScrollHandle(pos) { if (this.beforePullDown) { this.bubbleY = Math.max(0, pos.y + PULL_DOWN_ELEMENT_INITIAL_HEIGHT); this.pullDownStyle = 'top:' + Math.min(pos.y + PULL_DOWN_ELEMENT_INITIAL_HEIGHT, 10) + 'px'; } else { this.bubbleY = 0; this.pullDownStyle = 'top:' + Math.min(pos.y - 30, 10) + 'px'; } }, _onPullUpLoad: function _onPullUpLoad() { this.scroll.on('pullingUp', this._pullUpHandle); }, _offPullUpLoad: function _offPullUpLoad() { this.scroll.off('pullingUp', this._pullUpHandle); }, _pullUpHandle: function _pullUpHandle() { this.isPullUpLoad = true; this.$emit(EVENT_PULLING_UP); }, _reboundPullDown: function _reboundPullDown() { var _this5 = this; var _pullDownRefresh$stop = this.pullDownRefresh.stopTime, stopTime = _pullDownRefresh$stop === undefined ? 600 : _pullDownRefresh$stop; return new _promise2.default(function (resolve) { setTimeout(function () { _this5.scroll.finishPullDown(); _this5.isPullingDown = false; resolve(); }, stopTime); }); }, _afterPullDown: function _afterPullDown(dirty) { var _this6 = this; setTimeout(function () { _this6.pullDownStyle = 'top:' + PULL_DOWN_ELEMENT_INITIAL_HEIGHT + 'px'; _this6.beforePullDown = true; dirty && _this6.refresh(); }, this.scroll.options.bounceTime); } }, components: { Loading: _loading2.default, Bubble: _bubble2.default } }; module.exports = exports['default']; }); /***/ }), /* 122 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(123), __esModule: true }; /***/ }), /* 123 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(82); __webpack_require__(50); __webpack_require__(83); __webpack_require__(124); __webpack_require__(131); __webpack_require__(132); module.exports = __webpack_require__(3).Promise; /***/ }), /* 124 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var LIBRARY = __webpack_require__(41); var global = __webpack_require__(0); var ctx = __webpack_require__(21); var classof = __webpack_require__(59); var $export = __webpack_require__(11); var isObject = __webpack_require__(5); var aFunction = __webpack_require__(28); var anInstance = __webpack_require__(125); var forOf = __webpack_require__(126); var speciesConstructor = __webpack_require__(98); var task = __webpack_require__(99).set; var microtask = __webpack_require__(128)(); var newPromiseCapabilityModule = __webpack_require__(87); var perform = __webpack_require__(100); var promiseResolve = __webpack_require__(101); var PROMISE = 'Promise'; var TypeError = global.TypeError; var process = global.process; var $Promise = global[PROMISE]; var isNode = classof(process) == 'process'; var empty = function () { /* empty */ }; var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; var USE_NATIVE = !!function () { try { // correct subclassing with @@species support var promise = $Promise.resolve(1); var FakePromise = (promise.constructor = {})[__webpack_require__(2)('species')] = function (exec) { exec(empty, empty); }; // unhandled rejections tracking support, NodeJS Promise without it fails @@species test return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise; } catch (e) { /* empty */ } }(); // helpers var isThenable = function (it) { var then; return isObject(it) && typeof (then = it.then) == 'function' ? then : false; }; var notify = function (promise, isReject) { if (promise._n) return; promise._n = true; var chain = promise._c; microtask(function () { var value = promise._v; var ok = promise._s == 1; var i = 0; var run = function (reaction) { var handler = ok ? reaction.ok : reaction.fail; var resolve = reaction.resolve; var reject = reaction.reject; var domain = reaction.domain; var result, then; try { if (handler) { if (!ok) { if (promise._h == 2) onHandleUnhandled(promise); promise._h = 1; } if (handler === true) result = value; else { if (domain) domain.enter(); result = handler(value); if (domain) domain.exit(); } if (result === reaction.promise) { reject(TypeError('Promise-chain cycle')); } else if (then = isThenable(result)) { then.call(result, resolve, reject); } else resolve(result); } else reject(value); } catch (e) { reject(e); } }; while (chain.length > i) run(chain[i++]); // variable length - can't use forEach promise._c = []; promise._n = false; if (isReject && !promise._h) onUnhandled(promise); }); }; var onUnhandled = function (promise) { task.call(global, function () { var value = promise._v; var unhandled = isUnhandled(promise); var result, handler, console; if (unhandled) { result = perform(function () { if (isNode) { process.emit('unhandledRejection', value, promise); } else if (handler = global.onunhandledrejection) { handler({ promise: promise, reason: value }); } else if ((console = global.console) && console.error) { console.error('Unhandled promise rejection', value); } }); // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should promise._h = isNode || isUnhandled(promise) ? 2 : 1; } promise._a = undefined; if (unhandled && result.e) throw result.v; }); }; var isUnhandled = function (promise) { return promise._h !== 1 && (promise._a || promise._c).length === 0; }; var onHandleUnhandled = function (promise) { task.call(global, function () { var handler; if (isNode) { process.emit('rejectionHandled', promise); } else if (handler = global.onrejectionhandled) { handler({ promise: promise, reason: promise._v }); } }); }; var $reject = function (value) { var promise = this; if (promise._d) return; promise._d = true; promise = promise._w || promise; // unwrap promise._v = value; promise._s = 2; if (!promise._a) promise._a = promise._c.slice(); notify(promise, true); }; var $resolve = function (value) { var promise = this; var then; if (promise._d) return; promise._d = true; promise = promise._w || promise; // unwrap try { if (promise === value) throw TypeError("Promise can't be resolved itself"); if (then = isThenable(value)) { microtask(function () { var wrapper = { _w: promise, _d: false }; // wrap try { then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); } catch (e) { $reject.call(wrapper, e); } }); } else { promise._v = value; promise._s = 1; notify(promise, false); } } catch (e) { $reject.call({ _w: promise, _d: false }, e); // wrap } }; // constructor polyfill if (!USE_NATIVE) { // 25.4.3.1 Promise(executor) $Promise = function Promise(executor) { anInstance(this, $Promise, PROMISE, '_h'); aFunction(executor); Internal.call(this); try { executor(ctx($resolve, this, 1), ctx($reject, this, 1)); } catch (err) { $reject.call(this, err); } }; // eslint-disable-next-line no-unused-vars Internal = function Promise(executor) { this._c = []; // <- awaiting reactions this._a = undefined; // <- checked in isUnhandled reactions this._s = 0; // <- state this._d = false; // <- done this._v = undefined; // <- value this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled this._n = false; // <- notify }; Internal.prototype = __webpack_require__(129)($Promise.prototype, { // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) then: function then(onFulfilled, onRejected) { var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; reaction.fail = typeof onRejected == 'function' && onRejected; reaction.domain = isNode ? process.domain : undefined; this._c.push(reaction); if (this._a) this._a.push(reaction); if (this._s) notify(this, false); return reaction.promise; }, // 25.4.5.1 Promise.prototype.catch(onRejected) 'catch': function (onRejected) { return this.then(undefined, onRejected); } }); OwnPromiseCapability = function () { var promise = new Internal(); this.promise = promise; this.resolve = ctx($resolve, promise, 1); this.reject = ctx($reject, promise, 1); }; newPromiseCapabilityModule.f = newPromiseCapability = function (C) { return C === $Promise || C === Wrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C); }; } $export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); __webpack_require__(35)($Promise, PROMISE); __webpack_require__(130)(PROMISE); Wrapper = __webpack_require__(3)[PROMISE]; // statics $export($export.S + $export.F * !USE_NATIVE, PROMISE, { // 25.4.4.5 Promise.reject(r) reject: function reject(r) { var capability = newPromiseCapability(this); var $$reject = capability.reject; $$reject(r); return capability.promise; } }); $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { // 25.4.4.6 Promise.resolve(x) resolve: function resolve(x) { return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); } }); $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(67)(function (iter) { $Promise.all(iter)['catch'](empty); })), PROMISE, { // 25.4.4.1 Promise.all(iterable) all: function all(iterable) { var C = this; var capability = newPromiseCapability(C); var resolve = capability.resolve; var reject = capability.reject; var result = perform(function () { var values = []; var index = 0; var remaining = 1; forOf(iterable, false, function (promise) { var $index = index++; var alreadyCalled = false; values.push(undefined); remaining++; C.resolve(promise).then(function (value) { if (alreadyCalled) return; alreadyCalled = true; values[$index] = value; --remaining || resolve(values); }, reject); }); --remaining || resolve(values); }); if (result.e) reject(result.v); return capability.promise; }, // 25.4.4.4 Promise.race(iterable) race: function race(iterable) { var C = this; var capability = newPromiseCapability(C); var reject = capability.reject; var result = perform(function () { forOf(iterable, false, function (promise) { C.resolve(promise).then(capability.resolve, reject); }); }); if (result.e) reject(result.v); return capability.promise; } }); /***/ }), /* 125 */ /***/ (function(module, exports) { module.exports = function (it, Constructor, name, forbiddenField) { if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { throw TypeError(name + ': incorrect invocation!'); } return it; }; /***/ }), /* 126 */ /***/ (function(module, exports, __webpack_require__) { var ctx = __webpack_require__(21); var call = __webpack_require__(64); var isArrayIter = __webpack_require__(65); var anObject = __webpack_require__(8); var toLength = __webpack_require__(27); var getIterFn = __webpack_require__(66); var BREAK = {}; var RETURN = {}; var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable); var f = ctx(fn, that, entries ? 2 : 1); var index = 0; var length, step, iterator, result; if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); // fast case for arrays with default iterator if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); if (result === BREAK || result === RETURN) return result; } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { result = call(iterator, f, step.value, entries); if (result === BREAK || result === RETURN) return result; } }; exports.BREAK = BREAK; exports.RETURN = RETURN; /***/ }), /* 127 */ /***/ (function(module, exports) { // fast apply, http://jsperf.lnkit.com/fast-apply/5 module.exports = function (fn, args, that) { var un = that === undefined; switch (args.length) { case 0: return un ? fn() : fn.call(that); case 1: return un ? fn(args[0]) : fn.call(that, args[0]); case 2: return un ? fn(args[0], args[1]) : fn.call(that, args[0], args[1]); case 3: return un ? fn(args[0], args[1], args[2]) : fn.call(that, args[0], args[1], args[2]); case 4: return un ? fn(args[0], args[1], args[2], args[3]) : fn.call(that, args[0], args[1], args[2], args[3]); } return fn.apply(that, args); }; /***/ }), /* 128 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(0); var macrotask = __webpack_require__(99).set; var Observer = global.MutationObserver || global.WebKitMutationObserver; var process = global.process; var Promise = global.Promise; var isNode = __webpack_require__(19)(process) == 'process'; module.exports = function () { var head, last, notify; var flush = function () { var parent, fn; if (isNode && (parent = process.domain)) parent.exit(); while (head) { fn = head.fn; head = head.next; try { fn(); } catch (e) { if (head) notify(); else last = undefined; throw e; } } last = undefined; if (parent) parent.enter(); }; // Node.js if (isNode) { notify = function () { process.nextTick(flush); }; // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 } else if (Observer && !(global.navigator && global.navigator.standalone)) { var toggle = true; var node = document.createTextNode(''); new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new notify = function () { node.data = toggle = !toggle; }; // environments with maybe non-completely correct, but existent Promise } else if (Promise && Promise.resolve) { var promise = Promise.resolve(); notify = function () { promise.then(flush); }; // for other environments - macrotask based on: // - setImmediate // - MessageChannel // - window.postMessag // - onreadystatechange // - setTimeout } else { notify = function () { // strange IE + webpack dev server bug - use .call(global) macrotask.call(global, flush); }; } return function (fn) { var task = { fn: fn, next: undefined }; if (last) last.next = task; if (!head) { head = task; notify(); } last = task; }; }; /***/ }), /* 129 */ /***/ (function(module, exports, __webpack_require__) { var hide = __webpack_require__(6); module.exports = function (target, src, safe) { for (var key in src) { if (safe && target[key]) target[key] = src[key]; else hide(target, key, src[key]); } return target; }; /***/ }), /* 130 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var global = __webpack_require__(0); var core = __webpack_require__(3); var dP = __webpack_require__(7); var DESCRIPTORS = __webpack_require__(4); var SPECIES = __webpack_require__(2)('species'); module.exports = function (KEY) { var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY]; if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { configurable: true, get: function () { return this; } }); }; /***/ }), /* 131 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://github.com/tc39/proposal-promise-finally var $export = __webpack_require__(11); var core = __webpack_require__(3); var global = __webpack_require__(0); var speciesConstructor = __webpack_require__(98); var promiseResolve = __webpack_require__(101); $export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { var C = speciesConstructor(this, core.Promise || global.Promise); var isFunction = typeof onFinally == 'function'; return this.then( isFunction ? function (x) { return promiseResolve(C, onFinally()).then(function () { return x; }); } : onFinally, isFunction ? function (e) { return promiseResolve(C, onFinally()).then(function () { throw e; }); } : onFinally ); } }); /***/ }), /* 132 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://github.com/tc39/proposal-promise-try var $export = __webpack_require__(11); var newPromiseCapability = __webpack_require__(87); var perform = __webpack_require__(100); $export($export.S, 'Promise', { 'try': function (callbackfn) { var promiseCapability = newPromiseCapability.f(this); var result = perform(callbackfn); (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); return promiseCapability.promise; } }); /***/ }), /* 133 */ /***/ (function(module, exports, __webpack_require__) { var Component = __webpack_require__(1)( /* script */ __webpack_require__(134), /* template */ __webpack_require__(135), /* styles */ null, /* scopeId */ null, /* moduleIdentifier (server only) */ null ) module.exports = Component.exports /***/ }), /* 134 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else if (typeof exports !== "undefined") { factory(module, exports); } else { var mod = { exports: {} }; factory(mod, mod.exports); global.bubble = mod.exports; } })(this, function (module, exports) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = { props: { y: { type: Number, default: 0 } }, data: function data() { return { width: 50, height: 80 }; }, computed: { distance: function distance() { return Math.max(0, Math.min(this.y * this.ratio, this.maxDistance)); }, style: function style() { return 'width:' + this.width / this.ratio + 'px;height:' + this.height / this.ratio + 'px'; } }, created: function created() { this.ratio = window.devicePixelRatio; this.width *= this.ratio; this.height *= this.ratio; this.initRadius = 18 * this.ratio; this.minHeadRadius = 12 * this.ratio; this.minTailRadius = 5 * this.ratio; this.initArrowRadius = 10 * this.ratio; this.minArrowRadius = 6 * this.ratio; this.arrowWidth = 3 * this.ratio; this.maxDistance = 40 * this.ratio; this.initCenterX = 25 * this.ratio; this.initCenterY = 25 * this.ratio; this.headCenter = { x: this.initCenterX, y: this.initCenterY }; }, mounted: function mounted() { this._draw(); }, methods: { _draw: function _draw() { var bubble = this.$refs.bubble; var ctx = bubble.getContext('2d'); ctx.clearRect(0, 0, bubble.width, bubble.height); this._drawBubble(ctx); this._drawArrow(ctx); }, _drawBubble: function _drawBubble(ctx) { ctx.save(); ctx.beginPath(); var rate = this.distance / this.maxDistance; var headRadius = this.initRadius - (this.initRadius - this.minHeadRadius) * rate; this.headCenter.y = this.initCenterY - (this.initRadius - this.minHeadRadius) * rate; ctx.arc(this.headCenter.x, this.headCenter.y, headRadius, 0, Math.PI, true); var tailRadius = this.initRadius - (this.initRadius - this.minTailRadius) * rate; var tailCenter = { x: this.headCenter.x, y: this.headCenter.y + this.distance }; var tailPointL = { x: tailCenter.x - tailRadius, y: tailCenter.y }; var controlPointL = { x: tailPointL.x, y: tailPointL.y - this.distance / 2 }; ctx.quadraticCurveTo(controlPointL.x, controlPointL.y, tailPointL.x, tailPointL.y); ctx.arc(tailCenter.x, tailCenter.y, tailRadius, Math.PI, 0, true); var headPointR = { x: this.headCenter.x + headRadius, y: this.headCenter.y }; var controlPointR = { x: tailCenter.x + tailRadius, y: headPointR.y + this.distance / 2 }; ctx.quadraticCurveTo(controlPointR.x, controlPointR.y, headPointR.x, headPointR.y); ctx.fillStyle = 'rgb(170,170,170)'; ctx.fill(); ctx.strokeStyle = 'rgb(153,153,153)'; ctx.stroke(); ctx.restore(); }, _drawArrow: function _drawArrow(ctx) { ctx.save(); ctx.beginPath(); var rate = this.distance / this.maxDistance; var arrowRadius = this.initArrowRadius - (this.initArrowRadius - this.minArrowRadius) * rate; ctx.arc(this.headCenter.x, this.headCenter.y, arrowRadius - (this.arrowWidth - rate), -Math.PI / 2, 0, true); ctx.arc(this.headCenter.x, this.headCenter.y, arrowRadius, 0, Math.PI * 3 / 2, false); ctx.lineTo(this.headCenter.x, this.headCenter.y - arrowRadius - this.arrowWidth / 2 + rate); ctx.lineTo(this.headCenter.x + this.arrowWidth * 2 - rate * 2, this.headCenter.y - arrowRadius + this.arrowWidth / 2); ctx.lineTo(this.headCenter.x, this.headCenter.y - arrowRadius + this.arrowWidth * 3 / 2 - rate); ctx.fillStyle = 'rgb(255,255,255)'; ctx.fill(); ctx.strokeStyle = 'rgb(170,170,170)'; ctx.stroke(); ctx.restore(); } }, watch: { y: function y() { this._draw(); } } }; module.exports = exports['default']; }); /***/ }), /* 135 */ /***/ (function(module, exports) { module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; return _c('canvas', { ref: "bubble", style: (_vm.style), attrs: { "width": _vm.width, "height": _vm.height } }) },staticRenderFns: []} /***/ }), /* 136 */ /***/ (function(module, exports) { module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; return _c('div', { ref: "wrapper", staticClass: "cube-scroll-wrapper" }, [_c('div', { staticClass: "cube-scroll-content" }, [_c('div', { ref: "listWrapper", staticClass: "cube-scroll-list-wrapper" }, [_vm._t("default", [_c('ul', { staticClass: "cube-scroll-list" }, _vm._l((_vm.data), function(item) { return _c('li', { staticClass: "cube-scroll-item border-bottom-1px", on: { "click": function($event) { _vm.clickItem(item) } } }, [_vm._v(_vm._s(item))]) }))])], 2), _vm._v(" "), _vm._t("pullup", [(_vm.pullUpLoad) ? _c('div', { staticClass: "cube-pullup-wrapper" }, [(!_vm.isPullUpLoad) ? _c('div', { staticClass: "before-trigger" }, [_c('span', [_vm._v(_vm._s(_vm.pullUpTxt))])]) : _c('div', { staticClass: "after-trigger" }, [_c('loading')], 1)]) : _vm._e()], { pullUpLoad: _vm.pullUpLoad, isPullUpLoad: _vm.isPullUpLoad })], 2), _vm._v(" "), _vm._t("pulldown", [(_vm.pullDownRefresh) ? _c('div', { staticClass: "cube-pulldown-wrapper", style: (_vm.pullDownStyle) }, [(_vm.beforePullDown) ? _c('div', { staticClass: "before-trigger" }, [_c('bubble', { attrs: { "y": _vm.bubbleY } })], 1) : _c('div', { staticClass: "after-trigger" }, [(_vm.isPullingDown) ? _c('div', { staticClass: "loading" }, [_c('loading')], 1) : _c('div', [_c('span', [_vm._v(_vm._s(_vm.refreshTxt))])])])]) : _vm._e()], { pullDownRefresh: _vm.pullDownRefresh, pullDownStyle: _vm.pullDownStyle, beforePullDown: _vm.beforePullDown, isPullingDown: _vm.isPullingDown, bubbleY: _vm.bubbleY })], 2) },staticRenderFns: []} /***/ }), /* 137 */, /* 138 */, /* 139 */, /* 140 */, /* 141 */, /* 142 */, /* 143 */, /* 144 */, /* 145 */, /* 146 */, /* 147 */, /* 148 */, /* 149 */, /* 150 */, /* 151 */, /* 152 */, /* 153 */, /* 154 */, /* 155 */, /* 156 */, /* 157 */, /* 158 */, /* 159 */, /* 160 */, /* 161 */, /* 162 */, /* 163 */, /* 164 */, /* 165 */, /* 166 */, /* 167 */, /* 168 */, /* 169 */, /* 170 */, /* 171 */, /* 172 */, /* 173 */, /* 174 */, /* 175 */, /* 176 */, /* 177 */, /* 178 */, /* 179 */, /* 180 */, /* 181 */, /* 182 */, /* 183 */, /* 184 */, /* 185 */, /* 186 */, /* 187 */, /* 188 */, /* 189 */, /* 190 */, /* 191 */, /* 192 */, /* 193 */, /* 194 */, /* 195 */, /* 196 */, /* 197 */, /* 198 */, /* 199 */, /* 200 */, /* 201 */, /* 202 */, /* 203 */, /* 204 */, /* 205 */, /* 206 */, /* 207 */, /* 208 */, /* 209 */, /* 210 */, /* 211 */, /* 212 */, /* 213 */, /* 214 */, /* 215 */, /* 216 */, /* 217 */ /***/ (function(module, exports, __webpack_require__) { var Component = __webpack_require__(1)( /* script */ __webpack_require__(276), /* template */ __webpack_require__(280), /* styles */ null, /* scopeId */ null, /* moduleIdentifier (server only) */ null ) module.exports = Component.exports /***/ }), /* 218 */ /***/ (function(module, exports, __webpack_require__) { function injectStyle (ssrContext) { __webpack_require__(277) } var Component = __webpack_require__(1)( /* script */ __webpack_require__(278), /* template */ __webpack_require__(279), /* styles */ injectStyle, /* scopeId */ null, /* moduleIdentifier (server only) */ null ) module.exports = Component.exports /***/ }), /* 219 */, /* 220 */, /* 221 */, /* 222 */, /* 223 */, /* 224 */, /* 225 */, /* 226 */, /* 227 */, /* 228 */, /* 229 */, /* 230 */, /* 231 */, /* 232 */, /* 233 */, /* 234 */, /* 235 */, /* 236 */, /* 237 */, /* 238 */, /* 239 */, /* 240 */, /* 241 */, /* 242 */, /* 243 */, /* 244 */, /* 245 */, /* 246 */, /* 247 */, /* 248 */, /* 249 */, /* 250 */, /* 251 */, /* 252 */, /* 253 */, /* 254 */, /* 255 */, /* 256 */, /* 257 */, /* 258 */, /* 259 */, /* 260 */, /* 261 */, /* 262 */, /* 263 */, /* 264 */, /* 265 */, /* 266 */, /* 267 */, /* 268 */, /* 269 */, /* 270 */, /* 271 */, /* 272 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports, __webpack_require__(273), __webpack_require__(217), __webpack_require__(218)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else if (typeof exports !== "undefined") { factory(module, exports, require('../../components/index-list/index-list.vue'), require('../../components/index-list/index-list-group.vue'), require('../../components/index-list/index-list-item.vue')); } else { var mod = { exports: {} }; factory(mod, mod.exports, global.indexList, global.indexListGroup, global.indexListItem); global.index = mod.exports; } })(this, function (module, exports, _indexList, _indexListGroup, _indexListItem) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _indexList2 = _interopRequireDefault(_indexList); var _indexListGroup2 = _interopRequireDefault(_indexListGroup); var _indexListItem2 = _interopRequireDefault(_indexListItem); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } _indexList2.default.install = function (Vue) { Vue.component(_indexList2.default.name, _indexList2.default); Vue.component(_indexListGroup2.default.name, _indexListGroup2.default); Vue.component(_indexListItem2.default.name, _indexListItem2.default); }; _indexList2.default.Group = _indexListGroup2.default; _indexList2.default.Item = _indexListItem2.default; exports.default = _indexList2.default; module.exports = exports['default']; }); /***/ }), /* 273 */ /***/ (function(module, exports, __webpack_require__) { function injectStyle (ssrContext) { __webpack_require__(274) } var Component = __webpack_require__(1)( /* script */ __webpack_require__(275), /* template */ __webpack_require__(281), /* styles */ injectStyle, /* scopeId */ null, /* moduleIdentifier (server only) */ null ) module.exports = Component.exports /***/ }), /* 274 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 275 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports, __webpack_require__(91), __webpack_require__(77), __webpack_require__(119), __webpack_require__(217)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else if (typeof exports !== "undefined") { factory(module, exports, require('../../common/helpers/dom'), require('../../common/helpers/env'), require('../scroll/scroll.vue'), require('./index-list-group.vue')); } else { var mod = { exports: {} }; factory(mod, mod.exports, global.dom, global.env, global.scroll, global.indexListGroup); global.indexList = mod.exports; } })(this, function (module, exports, _dom, _env, _scroll, _indexListGroup) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _scroll2 = _interopRequireDefault(_scroll); var _indexListGroup2 = _interopRequireDefault(_indexListGroup); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var COMPONENT_NAME = 'cube-index-list'; var EVENT_SELECT = 'select'; var EVENT_TITLE_CLICK = 'title-click'; var ANCHOR_HEIGHT = _env.inBrowser ? window.innerHeight <= 480 ? 17 : 18 : 18; var transformStyleKey = (0, _dom.prefixStyle)('transform'); exports.default = { name: COMPONENT_NAME, props: { title: { type: String, default: '' }, data: { type: Array, default: function _default() { return []; } }, speed: { type: Number, default: 0 }, navbar: { type: Boolean, default: true } }, data: function data() { return { currentIndex: 0, scrollY: -1, diff: -1, options: { probeType: 3 }, titleHeight: null }; }, created: function created() { this.listenScroll = true; this.groupList = []; this.listHeight = []; this.touch = {}; this.subTitleHeight = 0; }, mounted: function mounted() { var _this = this; this.$nextTick(function () { _this.titleHeight = _this.title && _this.$refs.title ? (0, _dom.getRect)(_this.$refs.title).height : 0; _this._calculateHeight(); }); }, computed: { fixedTitle: function fixedTitle() { if (this.titleHeight === null || this.scrollY > -this.titleHeight) { return ''; } return this.data[this.currentIndex] ? this.data[this.currentIndex].name : ''; }, shortcutList: function shortcutList() { return this.data.map(function (group) { return group ? group.shortcut || group.name.substr(0, 1) : ''; }); } }, methods: { refresh: function refresh() { this.$refs.indexList.refresh(); }, selectItem: function selectItem(item) { this.$emit(EVENT_SELECT, item); }, scroll: function scroll(pos) { this.scrollY = pos.y; }, titleClick: function titleClick() { this.$emit(EVENT_TITLE_CLICK, this.title); }, onShortcutTouchStart: function onShortcutTouchStart(e) { var anchorIndex = (0, _dom.getData)(e.target, 'index'); var firstTouch = e.touches[0]; this.touch.y1 = firstTouch.pageY; this.touch.anchorIndex = anchorIndex; this._scrollTo(anchorIndex); }, onShortcutTouchMove: function onShortcutTouchMove(e) { var firstTouch = e.touches[0]; this.touch.y2 = firstTouch.pageY; var delta = (this.touch.y2 - this.touch.y1) / ANCHOR_HEIGHT | 0; var anchorIndex = parseInt(this.touch.anchorIndex) + delta; this._scrollTo(anchorIndex); }, _calculateHeight: function _calculateHeight() { this.groupList = this.$el.getElementsByClassName('cube-index-list-group'); var subTitleEl = this.$el.getElementsByClassName('cube-index-list-anchor')[0]; this.subTitleHeight = subTitleEl ? (0, _dom.getRect)(subTitleEl).height : 0; this.listHeight = []; if (!this.groupList) { return; } var height = this.titleHeight; this.listHeight.push(height); for (var i = 0; i < this.groupList.length; i++) { var item = this.groupList[i]; height += item.clientHeight; this.listHeight.push(height); } }, _scrollTo: function _scrollTo(index) { if (index < 0) { index = 0; } else if (index > this.listHeight.length - 2) { index = this.listHeight.length - 2; } this.$refs.indexList.scrollToElement(this.groupList[index], this.speed); this.scrollY = this.$refs.indexList.scroll.y; } }, watch: { data: function data() { var _this2 = this; this.$nextTick(function () { _this2._calculateHeight(); }); }, title: function title(newVal) { var _this3 = this; this.$nextTick(function () { _this3.titleHeight = newVal && _this3.$refs.title ? (0, _dom.getRect)(_this3.$refs.title).height : 0; _this3._calculateHeight(); }); }, diff: function diff(newVal) { var fixedTop = newVal > 0 && newVal < this.subTitleHeight ? newVal - this.subTitleHeight : 0; if (this.fixedTop === fixedTop) { return; } this.fixedTop = fixedTop; this.$refs.fixed.style[transformStyleKey] = 'translate3d(0,' + fixedTop + 'px,0)'; }, scrollY: function scrollY(newY) { var listHeight = this.listHeight; if (newY > -this.titleHeight) { this.currentIndex = 0; return; } for (var i = 0; i < listHeight.length - 1; i++) { var height1 = listHeight[i]; var height2 = listHeight[i + 1]; if (-newY >= height1 && -newY < height2) { this.currentIndex = i; this.diff = height2 + newY; return; } } this.currentIndex = listHeight.length - 2; } }, components: { CubeScroll: _scroll2.default, CubeIndexListGroup: _indexListGroup2.default } }; module.exports = exports['default']; }); /***/ }), /* 276 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports, __webpack_require__(218)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else if (typeof exports !== "undefined") { factory(module, exports, require('./index-list-item.vue')); } else { var mod = { exports: {} }; factory(mod, mod.exports, global.indexListItem); global.indexListGroup = mod.exports; } })(this, function (module, exports, _indexListItem) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _indexListItem2 = _interopRequireDefault(_indexListItem); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var COMPONENT_NAME = 'cube-index-list-group'; var EVENT_SELECT = 'select'; exports.default = { name: COMPONENT_NAME, props: { group: { type: Object, default: function _default() { return {}; } } }, methods: { selectItem: function selectItem(item) { this.$emit(EVENT_SELECT, item); } }, components: { CubeIndexListItem: _indexListItem2.default } }; module.exports = exports['default']; }); /***/ }), /* 277 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 278 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports, __webpack_require__(91)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else if (typeof exports !== "undefined") { factory(module, exports, require('../../common/helpers/dom')); } else { var mod = { exports: {} }; factory(mod, mod.exports, global.dom); global.indexListItem = mod.exports; } })(this, function (module, exports, _dom) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var COMPONENT_NAME = 'cube-index-list-item'; var ACTIVE_CLS = 'cube-index-list-item_active'; var EVENT_SELECT = 'select'; exports.default = { name: COMPONENT_NAME, props: { item: { type: Object, default: function _default() { return {}; } } }, computed: { itemClass: function itemClass() { return this.item.active ? ACTIVE_CLS : ''; } }, methods: { addActiveCls: function addActiveCls(e) { (0, _dom.addClass)(e.currentTarget, ACTIVE_CLS); }, removeActiveCls: function removeActiveCls(e) { (0, _dom.removeClass)(e.currentTarget, ACTIVE_CLS); }, selectItem: function selectItem() { this.$emit(EVENT_SELECT, this.item); } } }; module.exports = exports['default']; }); /***/ }), /* 279 */ /***/ (function(module, exports) { module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; return _c('li', { staticClass: "cube-index-list-item", class: _vm.itemClass, on: { "touchstart": _vm.addActiveCls, "touchend": _vm.removeActiveCls, "click": function($event) { _vm.selectItem() } } }, [_vm._t("default", [_c('div', { staticClass: "cube-index-list-item-def border-bottom-1px" }, [_vm._v("\n " + _vm._s(_vm.item.name) + "\n ")])])], 2) },staticRenderFns: []} /***/ }), /* 280 */ /***/ (function(module, exports) { module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; return _c('li', { staticClass: "cube-index-list-group" }, [_c('h2', { staticClass: "cube-index-list-anchor" }, [_vm._v(_vm._s(_vm.group.name))]), _vm._v(" "), _c('ul', [_vm._t("default", _vm._l((_vm.group.items), function(item, index) { return _c('cube-index-list-item', { key: index, attrs: { "item": item }, on: { "select": _vm.selectItem } }) }))], 2)]) },staticRenderFns: []} /***/ }), /* 281 */ /***/ (function(module, exports) { module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; return _c('div', { staticClass: "cube-index-list" }, [_c('cube-scroll', { ref: "indexList", attrs: { "listen-scroll": _vm.listenScroll, "options": _vm.options, "data": _vm.data }, on: { "scroll": _vm.scroll } }, [_c('div', { ref: "content", staticClass: "cube-index-list-content" }, [(_vm.title) ? _c('h1', { ref: "title", staticClass: "cube-index-list-title", on: { "click": _vm.titleClick } }, [_vm._v("\n " + _vm._s(_vm.title) + "\n ")]) : _vm._e(), _vm._v(" "), _c('ul', [_vm._t("default", _vm._l((_vm.data), function(group, index) { return _c('cube-index-list-group', { key: index, attrs: { "group": group }, on: { "select": _vm.selectItem } }) }))], 2)])]), _vm._v(" "), (_vm.navbar) ? _c('div', { staticClass: "cube-index-list-nav", on: { "touchstart": _vm.onShortcutTouchStart, "touchmove": function($event) { $event.stopPropagation(); $event.preventDefault(); _vm.onShortcutTouchMove($event) } } }, [_c('ul', { staticClass: "cube-index-list-nav-list" }, _vm._l((_vm.shortcutList), function(item, index) { return _c('li', { key: index, staticClass: "cube-index-list-nav-item", class: { active: _vm.currentIndex === index }, attrs: { "data-index": index } }, [_vm._t("nav-item", [_vm._v(_vm._s(item))], { item: item })], 2) }))]) : _vm._e(), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: (_vm.fixedTitle), expression: "fixedTitle" }], ref: "fixed", staticClass: "cube-index-list-fixed cube-index-list-anchor" }, [_vm._v("\n " + _vm._s(_vm.fixedTitle) + "\n ")])], 1) },staticRenderFns: []} /***/ }) /******/ ]);