diff --git a/build/configs.js b/build/configs.js index 7bc6929..833beee 100644 --- a/build/configs.js +++ b/build/configs.js @@ -83,6 +83,7 @@ function genConfig (opts) { 'lodash/isFinite', 'lodash/debounce', 'lodash/throttle', + 'es6-map/implement' ] } diff --git a/build/rollup.dev.config.js b/build/rollup.dev.config.js index 8fb68fb..9f539e9 100644 --- a/build/rollup.dev.config.js +++ b/build/rollup.dev.config.js @@ -14,5 +14,6 @@ export default { 'lodash/isFinite', 'lodash/debounce', 'lodash/throttle', + 'es6-map/implement' ] } diff --git a/dist/vue-scroll.common.js b/dist/vue-scroll.common.js index bc5d52c..75c2d76 100644 --- a/dist/vue-scroll.common.js +++ b/dist/vue-scroll.common.js @@ -13,6 +13,7 @@ var _isInteger = _interopDefault(require('lodash/isInteger')); var _isFinite = _interopDefault(require('lodash/isFinite')); var _debounce = _interopDefault(require('lodash/debounce')); var _throttle = _interopDefault(require('lodash/throttle')); +require('es6-map/implement'); var dom = (function () { var listeners = new Map(); diff --git a/dist/vue-scroll.esm.js b/dist/vue-scroll.esm.js index d206e92..50d7d14 100644 --- a/dist/vue-scroll.esm.js +++ b/dist/vue-scroll.esm.js @@ -9,6 +9,7 @@ import _isInteger from 'lodash/isInteger'; import _isFinite from 'lodash/isFinite'; import _debounce from 'lodash/debounce'; import _throttle from 'lodash/throttle'; +import 'es6-map/implement'; var dom = (function () { var listeners = new Map(); diff --git a/dist/vue-scroll.js b/dist/vue-scroll.js index 176cf66..bd72d2e 100644 --- a/dist/vue-scroll.js +++ b/dist/vue-scroll.js @@ -43,6 +43,14 @@ var isObject_1 = isObject; var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + + + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; @@ -57,9 +65,9 @@ var root = _freeGlobal || freeSelf || Function('return this')(); var _root = root; /** Built-in value references. */ -var Symbol = _root.Symbol; +var Symbol$1 = _root.Symbol; -var _Symbol = Symbol; +var _Symbol = Symbol$1; /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -447,11 +455,11 @@ var nativeIsFinite = _root.isFinite; * _.isFinite('3'); * // => false */ -function isFinite(value) { +function isFinite$1(value) { return typeof value == 'number' && nativeIsFinite(value); } -var _isFinite = isFinite; +var _isFinite = isFinite$1; /** * Gets the timestamp of the number of milliseconds that have elapsed since @@ -581,9 +589,11 @@ function debounce(func, wait, options) { function remainingWait(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, - result = wait - timeSinceLastCall; + timeWaiting = wait - timeSinceLastCall; - return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; + return maxing + ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) + : timeWaiting; } function shouldInvoke(time) { @@ -842,6 +852,1328 @@ var dom = (function () { })(); +var isImplemented = function () { + var map, iterator, result; + if (typeof Map !== 'function') { return false; } + try { + // WebKit doesn't support arguments and crashes + map = new Map([['raz', 'one'], ['dwa', 'two'], ['trzy', 'three']]); + } catch (e) { + return false; + } + if (String(map) !== '[object Map]') { return false; } + if (map.size !== 3) { return false; } + if (typeof map.clear !== 'function') { return false; } + if (typeof map.delete !== 'function') { return false; } + if (typeof map.entries !== 'function') { return false; } + if (typeof map.forEach !== 'function') { return false; } + if (typeof map.get !== 'function') { return false; } + if (typeof map.has !== 'function') { return false; } + if (typeof map.keys !== 'function') { return false; } + if (typeof map.set !== 'function') { return false; } + if (typeof map.values !== 'function') { return false; } + + iterator = map.entries(); + result = iterator.next(); + if (result.done !== false) { return false; } + if (!result.value) { return false; } + if (result.value[0] !== 'raz') { return false; } + if (result.value[1] !== 'one') { return false; } + + return true; +}; + +/* eslint strict: "off" */ + +var global$1 = (function () { + return this; +}()); + +// eslint-disable-next-line no-empty-function +var noop = function () {}; + +var _undefined = noop(); // Support ES3 engines + +var isValue = function (val) { + return (val !== _undefined) && (val !== null); +}; + +var validValue = function (value) { + if (!isValue(value)) { throw new TypeError("Cannot use null or undefined"); } + return value; +}; + +var clear = function () { + validValue(this).length = 0; + return this; +}; + +var isImplemented$2 = function () { + var numberIsNaN = Number.isNaN; + if (typeof numberIsNaN !== "function") { return false; } + return !numberIsNaN({}) && numberIsNaN(NaN) && !numberIsNaN(34); +}; + +var shim = function (value) { + // eslint-disable-next-line no-self-compare + return value !== value; +}; + +var isNan = isImplemented$2() + ? Number.isNaN + : shim; + +var isImplemented$4 = function () { + var sign = Math.sign; + if (typeof sign !== "function") { return false; } + return (sign(10) === 1) && (sign(-20) === -1); +}; + +var shim$2 = function (value) { + value = Number(value); + if (isNaN(value) || (value === 0)) { return value; } + return value > 0 ? 1 : -1; +}; + +var sign = isImplemented$4() + ? Math.sign + : shim$2; + +var abs$1 = Math.abs; +var floor$1 = Math.floor; + +var toInteger$2 = function (value) { + if (isNaN(value)) { return 0; } + value = Number(value); + if ((value === 0) || !isFinite(value)) { return value; } + return sign(value) * floor$1(abs$1(value)); +}; + +var max = Math.max; + +var toPosInteger = function (value) { + return max(0, toInteger$2(value)); +}; + +var indexOf = Array.prototype.indexOf; +var objHasOwnProperty = Object.prototype.hasOwnProperty; +var abs = Math.abs; +var floor = Math.floor; + +var eIndexOf = function (searchElement /* fromIndex*/) { + var this$1 = this; + + var i, length, fromIndex, val; + if (!isNan(searchElement)) { return indexOf.apply(this, arguments); } + + length = toPosInteger(validValue(this).length); + fromIndex = arguments[1]; + if (isNaN(fromIndex)) { fromIndex = 0; } + else if (fromIndex >= 0) { fromIndex = floor(fromIndex); } + else { fromIndex = toPosInteger(this.length) - floor(abs(fromIndex)); } + + for (i = fromIndex; i < length; ++i) { + if (objHasOwnProperty.call(this$1, i)) { + val = this$1[i]; + if (isNan(val)) { return i; } // Jslint: ignore + } + } + return -1; +}; + +var create = Object.create; +var getPrototypeOf$1 = Object.getPrototypeOf; +var plainObject = {}; + +var isImplemented$6 = function (/* CustomCreate*/) { + var setPrototypeOf = Object.setPrototypeOf, customCreate = arguments[0] || create; + if (typeof setPrototypeOf !== "function") { return false; } + return getPrototypeOf$1(setPrototypeOf(customCreate(null), plainObject)) === plainObject; +}; + +var map = { function: true, object: true }; + +var isObject$2 = function (value) { + return (isValue(value) && map[typeof value]) || false; +}; + +var create$1 = Object.create; +var shim$6; + +if (!isImplemented$6()) { + shim$6 = shim$4; +} + +var create_1 = (function () { + var nullObject, polyProps, desc; + if (!shim$6) { return create$1; } + if (shim$6.level !== 1) { return create$1; } + + nullObject = {}; + polyProps = {}; + desc = { + configurable: false, + enumerable: false, + writable: true, + value: undefined + }; + Object.getOwnPropertyNames(Object.prototype).forEach(function (name) { + if (name === "__proto__") { + polyProps[name] = { + configurable: true, + enumerable: false, + writable: true, + value: undefined + }; + return; + } + polyProps[name] = desc; + }); + Object.defineProperties(nullObject, polyProps); + + Object.defineProperty(shim$6, "nullPolyfill", { + configurable: false, + enumerable: false, + writable: false, + value: nullObject + }); + + return function (prototype, props) { + return create$1(prototype === null ? nullObject : prototype, props); + }; +}()); + +var objIsPrototypeOf = Object.prototype.isPrototypeOf; +var defineProperty = Object.defineProperty; +var nullDesc = { + configurable: true, + enumerable: false, + writable: true, + value: undefined +}; +var validate; + +validate = function (obj, prototype) { + validValue(obj); + if (prototype === null || isObject$2(prototype)) { return obj; } + throw new TypeError("Prototype must be null or an object"); +}; + +var shim$4 = (function (status) { + var fn, set; + if (!status) { return null; } + if (status.level === 2) { + if (status.set) { + set = status.set; + fn = function (obj, prototype) { + set.call(validate(obj, prototype), prototype); + return obj; + }; + } else { + fn = function (obj, prototype) { + validate(obj, prototype).__proto__ = prototype; + return obj; + }; + } + } else { + fn = function self(obj, prototype) { + var isNullBase; + validate(obj, prototype); + isNullBase = objIsPrototypeOf.call(self.nullPolyfill, obj); + if (isNullBase) { delete self.nullPolyfill.__proto__; } + if (prototype === null) { prototype = self.nullPolyfill; } + obj.__proto__ = prototype; + if (isNullBase) { defineProperty(self.nullPolyfill, "__proto__", nullDesc); } + return obj; + }; + } + return Object.defineProperty(fn, "level", { + configurable: false, + enumerable: false, + writable: false, + value: status.level + }); +}( + (function () { + var tmpObj1 = Object.create(null) + , tmpObj2 = {} + , set + , desc = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__"); + + if (desc) { + try { + set = desc.set; // Opera crashes at this point + set.call(tmpObj1, tmpObj2); + } catch (ignore) {} + if (Object.getPrototypeOf(tmpObj1) === tmpObj2) { return { set: set, level: 2 }; } + } + + tmpObj1.__proto__ = tmpObj2; + if (Object.getPrototypeOf(tmpObj1) === tmpObj2) { return { level: 2 }; } + + tmpObj1 = {}; + tmpObj1.__proto__ = tmpObj2; + if (Object.getPrototypeOf(tmpObj1) === tmpObj2) { return { level: 1 }; } + + return false; + })() +)); + +var setPrototypeOf = isImplemented$6() + ? Object.setPrototypeOf + : shim$4; + +var validCallable = function (fn) { + if (typeof fn !== "function") { throw new TypeError(fn + " is not a function"); } + return fn; +}; + +var isImplemented$8 = function () { + var assign = Object.assign, obj; + if (typeof assign !== "function") { return false; } + obj = { foo: "raz" }; + assign(obj, { bar: "dwa" }, { trzy: "trzy" }); + return (obj.foo + obj.bar + obj.trzy) === "razdwatrzy"; +}; + +var isImplemented$10 = function () { + try { + return true; + } catch (e) { + return false; + } +}; + +var keys$2 = Object.keys; + +var shim$9 = function (object) { return keys$2(isValue(object) ? Object(object) : object); }; + +var keys = isImplemented$10() ? Object.keys : shim$9; + +var max$1 = Math.max; + +var shim$7 = function (dest, src /* …srcn*/) { + var arguments$1 = arguments; + + var error, i, length = max$1(arguments.length, 2), assign; + dest = Object(validValue(dest)); + assign = function (key) { + try { + dest[key] = src[key]; + } catch (e) { + if (!error) { error = e; } + } + }; + for (i = 1; i < length; ++i) { + src = arguments$1[i]; + keys(src).forEach(assign); + } + if (error !== undefined) { throw error; } + return dest; +}; + +var assign = isImplemented$8() + ? Object.assign + : shim$7; + +var forEach = Array.prototype.forEach; +var create$2 = Object.create; + +var process = function (src, obj) { + var key; + for (key in src) { obj[key] = src[key]; } +}; + +// eslint-disable-next-line no-unused-vars +var normalizeOptions = function (opts1 /* …options*/) { + var result = create$2(null); + forEach.call(arguments, function (options) { + if (!isValue(options)) { return; } + process(Object(options), result); + }); + return result; +}; + +// Deprecated + +var isCallable = function (obj) { + return typeof obj === "function"; +}; + +var str = "razdwatrzy"; + +var isImplemented$12 = function () { + if (typeof str.contains !== "function") { return false; } + return (str.contains("dwa") === true) && (str.contains("foo") === false); +}; + +var indexOf$1 = String.prototype.indexOf; + +var shim$11 = function (searchString/* position*/) { + return indexOf$1.call(this, searchString, arguments[1]) > -1; +}; + +var contains = isImplemented$12() + ? String.prototype.contains + : shim$11; + +var d_1 = createCommonjsModule(function (module) { +var d; + +d = module.exports = function (dscr, value/* options*/) { + var c, e, w, options, desc; + if ((arguments.length < 2) || (typeof dscr !== 'string')) { + options = value; + value = dscr; + dscr = null; + } else { + options = arguments[2]; + } + if (dscr == null) { + c = w = true; + e = false; + } else { + c = contains.call(dscr, 'c'); + e = contains.call(dscr, 'e'); + w = contains.call(dscr, 'w'); + } + + desc = { value: value, configurable: c, enumerable: e, writable: w }; + return !options ? desc : assign(normalizeOptions(options), desc); +}; + +d.gs = function (dscr, get, set/* options*/) { + var c, e, options, desc; + if (typeof dscr !== 'string') { + options = set; + set = get; + get = dscr; + dscr = null; + } else { + options = arguments[3]; + } + if (get == null) { + get = undefined; + } else if (!isCallable(get)) { + options = get; + get = set = undefined; + } else if (set == null) { + set = undefined; + } else if (!isCallable(set)) { + options = set; + set = undefined; + } + if (dscr == null) { + c = true; + e = false; + } else { + c = contains.call(dscr, 'c'); + e = contains.call(dscr, 'e'); + } + + desc = { get: get, set: set, configurable: c, enumerable: e }; + return !options ? desc : assign(normalizeOptions(options), desc); +}; +}); + +var eventEmitter = createCommonjsModule(function (module, exports) { +var apply = Function.prototype.apply, call = Function.prototype.call + , create = Object.create, defineProperty = Object.defineProperty + , defineProperties = Object.defineProperties + , hasOwnProperty = Object.prototype.hasOwnProperty + , descriptor = { configurable: true, enumerable: false, writable: true } + + , on, once, off, emit, methods, descriptors, base; + +on = function (type, listener) { + var data; + + validCallable(listener); + + if (!hasOwnProperty.call(this, '__ee__')) { + data = descriptor.value = create(null); + defineProperty(this, '__ee__', descriptor); + descriptor.value = null; + } else { + data = this.__ee__; + } + if (!data[type]) { data[type] = listener; } + else if (typeof data[type] === 'object') { data[type].push(listener); } + else { data[type] = [data[type], listener]; } + + return this; +}; + +once = function (type, listener) { + var once, self; + + validCallable(listener); + self = this; + on.call(this, type, once = function () { + off.call(self, type, once); + apply.call(listener, this, arguments); + }); + + once.__eeOnceListener__ = listener; + return this; +}; + +off = function (type, listener) { + var data, listeners, candidate, i; + + validCallable(listener); + + if (!hasOwnProperty.call(this, '__ee__')) { return this; } + data = this.__ee__; + if (!data[type]) { return this; } + listeners = data[type]; + + if (typeof listeners === 'object') { + for (i = 0; (candidate = listeners[i]); ++i) { + if ((candidate === listener) || + (candidate.__eeOnceListener__ === listener)) { + if (listeners.length === 2) { data[type] = listeners[i ? 0 : 1]; } + else { listeners.splice(i, 1); } + } + } + } else { + if ((listeners === listener) || + (listeners.__eeOnceListener__ === listener)) { + delete data[type]; + } + } + + return this; +}; + +emit = function (type) { + var arguments$1 = arguments; + var this$1 = this; + + var i, l, listener, listeners, args; + + if (!hasOwnProperty.call(this, '__ee__')) { return; } + listeners = this.__ee__[type]; + if (!listeners) { return; } + + if (typeof listeners === 'object') { + l = arguments.length; + args = new Array(l - 1); + for (i = 1; i < l; ++i) { args[i - 1] = arguments$1[i]; } + + listeners = listeners.slice(); + for (i = 0; (listener = listeners[i]); ++i) { + apply.call(listener, this$1, args); + } + } else { + switch (arguments.length) { + case 1: + call.call(listeners, this); + break; + case 2: + call.call(listeners, this, arguments[1]); + break; + case 3: + call.call(listeners, this, arguments[1], arguments[2]); + break; + default: + l = arguments.length; + args = new Array(l - 1); + for (i = 1; i < l; ++i) { + args[i - 1] = arguments$1[i]; + } + apply.call(listeners, this, args); + } + } +}; + +methods = { + on: on, + once: once, + off: off, + emit: emit +}; + +descriptors = { + on: d_1(on), + once: d_1(once), + off: d_1(off), + emit: d_1(emit) +}; + +base = defineProperties({}, descriptors); + +module.exports = exports = function (o) { + return (o == null) ? create(base) : defineProperties(Object(o), descriptors); +}; +exports.methods = methods; +}); + +var eventEmitter_1 = eventEmitter.methods; + +var validTypes = { object: true, symbol: true }; + +var isImplemented$14 = function () { + if (typeof Symbol !== 'function') { return false; } + try { } catch (e) { return false; } + + // Return 'true' also for polyfills + if (!validTypes[typeof Symbol.iterator]) { return false; } + if (!validTypes[typeof Symbol.toPrimitive]) { return false; } + if (!validTypes[typeof Symbol.toStringTag]) { return false; } + + return true; +}; + +var isSymbol$2 = function (x) { + if (!x) { return false; } + if (typeof x === 'symbol') { return true; } + if (!x.constructor) { return false; } + if (x.constructor.name !== 'Symbol') { return false; } + return (x[x.constructor.toStringTag] === 'Symbol'); +}; + +var validateSymbol = function (value) { + if (!isSymbol$2(value)) { throw new TypeError(value + " is not a symbol"); } + return value; +}; + +var create$3 = Object.create; +var defineProperties$1 = Object.defineProperties; +var defineProperty$1 = Object.defineProperty; +var objPrototype = Object.prototype; +var NativeSymbol; +var SymbolPolyfill; +var HiddenSymbol; +var globalSymbols = create$3(null); +var isNativeSafe; + +if (typeof Symbol === 'function') { + NativeSymbol = Symbol; + try { + String(NativeSymbol()); + isNativeSafe = true; + } catch (ignore) {} +} + +var generateName = (function () { + var created = create$3(null); + return function (desc) { + var postfix = 0, name, ie11BugWorkaround; + while (created[desc + (postfix || '')]) { ++postfix; } + desc += (postfix || ''); + created[desc] = true; + name = '@@' + desc; + defineProperty$1(objPrototype, name, d_1.gs(null, function (value) { + // For IE11 issue see: + // https://connect.microsoft.com/IE/feedbackdetail/view/1928508/ + // ie11-broken-getters-on-dom-objects + // https://github.com/medikoo/es6-symbol/issues/12 + if (ie11BugWorkaround) { return; } + ie11BugWorkaround = true; + defineProperty$1(this, name, d_1(value)); + ie11BugWorkaround = false; + })); + return name; + }; +}()); + +// Internal constructor (not one exposed) for creating Symbol instances. +// This one is used to ensure that `someSymbol instanceof Symbol` always return false +HiddenSymbol = function Symbol(description) { + if (this instanceof HiddenSymbol) { throw new TypeError('Symbol is not a constructor'); } + return SymbolPolyfill(description); +}; + +// Exposed `Symbol` constructor +// (returns instances of HiddenSymbol) +var polyfill$2 = SymbolPolyfill = function Symbol(description) { + var symbol; + if (this instanceof Symbol) { throw new TypeError('Symbol is not a constructor'); } + if (isNativeSafe) { return NativeSymbol(description); } + symbol = create$3(HiddenSymbol.prototype); + description = (description === undefined ? '' : String(description)); + return defineProperties$1(symbol, { + __description__: d_1('', description), + __name__: d_1('', generateName(description)) + }); +}; +defineProperties$1(SymbolPolyfill, { + for: d_1(function (key) { + if (globalSymbols[key]) { return globalSymbols[key]; } + return (globalSymbols[key] = SymbolPolyfill(String(key))); + }), + keyFor: d_1(function (s) { + var key; + validateSymbol(s); + for (key in globalSymbols) { if (globalSymbols[key] === s) { return key; } } + }), + + // To ensure proper interoperability with other native functions (e.g. Array.from) + // fallback to eventual native implementation of given symbol + hasInstance: d_1('', (NativeSymbol && NativeSymbol.hasInstance) || SymbolPolyfill('hasInstance')), + isConcatSpreadable: d_1('', (NativeSymbol && NativeSymbol.isConcatSpreadable) || + SymbolPolyfill('isConcatSpreadable')), + iterator: d_1('', (NativeSymbol && NativeSymbol.iterator) || SymbolPolyfill('iterator')), + match: d_1('', (NativeSymbol && NativeSymbol.match) || SymbolPolyfill('match')), + replace: d_1('', (NativeSymbol && NativeSymbol.replace) || SymbolPolyfill('replace')), + search: d_1('', (NativeSymbol && NativeSymbol.search) || SymbolPolyfill('search')), + species: d_1('', (NativeSymbol && NativeSymbol.species) || SymbolPolyfill('species')), + split: d_1('', (NativeSymbol && NativeSymbol.split) || SymbolPolyfill('split')), + toPrimitive: d_1('', (NativeSymbol && NativeSymbol.toPrimitive) || SymbolPolyfill('toPrimitive')), + toStringTag: d_1('', (NativeSymbol && NativeSymbol.toStringTag) || SymbolPolyfill('toStringTag')), + unscopables: d_1('', (NativeSymbol && NativeSymbol.unscopables) || SymbolPolyfill('unscopables')) +}); + +// Internal tweaks for real symbol producer +defineProperties$1(HiddenSymbol.prototype, { + constructor: d_1(SymbolPolyfill), + toString: d_1('', function () { return this.__name__; }) +}); + +// Proper implementation of methods exposed on Symbol.prototype +// They won't be accessible on produced symbol instances as they derive from HiddenSymbol.prototype +defineProperties$1(SymbolPolyfill.prototype, { + toString: d_1(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }), + valueOf: d_1(function () { return validateSymbol(this); }) +}); +defineProperty$1(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d_1('', function () { + var symbol = validateSymbol(this); + if (typeof symbol === 'symbol') { return symbol; } + return symbol.toString(); +})); +defineProperty$1(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d_1('c', 'Symbol')); + +// Proper implementaton of toPrimitive and toStringTag for returned symbol instances +defineProperty$1(HiddenSymbol.prototype, SymbolPolyfill.toStringTag, + d_1('c', SymbolPolyfill.prototype[SymbolPolyfill.toStringTag])); + +// Note: It's important to define `toPrimitive` as last one, as some implementations +// implement `toPrimitive` natively without implementing `toStringTag` (or other specified symbols) +// And that may invoke error in definition flow: +// See: https://github.com/medikoo/es6-symbol/issues/13#issuecomment-164146149 +defineProperty$1(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive, + d_1('c', SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive])); + +var es6Symbol = isImplemented$14() ? Symbol : polyfill$2; + +var objToString = Object.prototype.toString; +var id = objToString.call( + (function () { + return arguments; + })() +); + +var isArguments = function (value) { + return objToString.call(value) === id; +}; + +var objToString$1 = Object.prototype.toString; +var id$1 = objToString$1.call(""); + +var isString = function (value) { + return ( + typeof value === "string" || + (value && + typeof value === "object" && + (value instanceof String || objToString$1.call(value) === id$1)) || + false + ); +}; + +var iteratorSymbol = es6Symbol.iterator; +var isArray = Array.isArray; + +var isIterable = function (value) { + if (!isValue(value)) { return false; } + if (isArray(value)) { return true; } + if (isString(value)) { return true; } + if (isArguments(value)) { return true; } + return typeof value[iteratorSymbol] === "function"; +}; + +var validIterable = function (value) { + if (!isIterable(value)) { throw new TypeError(value + " is not iterable"); } + return value; +}; + +var isImplemented$16 = function () { + var from = Array.from, arr, result; + if (typeof from !== "function") { return false; } + arr = ["raz", "dwa"]; + result = from(arr); + return Boolean(result && (result !== arr) && (result[1] === "dwa")); +}; + +var objToString$2 = Object.prototype.toString; +var id$2 = objToString$2.call(noop); + +var isFunction$1 = function (value) { + return typeof value === "function" && objToString$2.call(value) === id$2; +}; + +var iteratorSymbol$2 = es6Symbol.iterator; +var isArray$2 = Array.isArray; +var call$2 = Function.prototype.call; +var desc = { configurable: true, enumerable: true, writable: true, value: null }; +var defineProperty$4 = Object.defineProperty; + +// eslint-disable-next-line complexity +var shim$13 = function (arrayLike /* mapFn, thisArg*/) { + var mapFn = arguments[1] + , thisArg = arguments[2] + , Context + , i + , j + , arr + , length + , code + , iterator + , result + , getIterator + , value; + + arrayLike = Object(validValue(arrayLike)); + + if (isValue(mapFn)) { validCallable(mapFn); } + if (!this || this === Array || !isFunction$1(this)) { + // Result: Plain array + if (!mapFn) { + if (isArguments(arrayLike)) { + // Source: Arguments + length = arrayLike.length; + if (length !== 1) { return Array.apply(null, arrayLike); } + arr = new Array(1); + arr[0] = arrayLike[0]; + return arr; + } + if (isArray$2(arrayLike)) { + // Source: Array + arr = new Array(length = arrayLike.length); + for (i = 0; i < length; ++i) { arr[i] = arrayLike[i]; } + return arr; + } + } + arr = []; + } else { + // Result: Non plain array + Context = this; + } + + if (!isArray$2(arrayLike)) { + if ((getIterator = arrayLike[iteratorSymbol$2]) !== undefined) { + // Source: Iterator + iterator = validCallable(getIterator).call(arrayLike); + if (Context) { arr = new Context(); } + result = iterator.next(); + i = 0; + while (!result.done) { + value = mapFn ? call$2.call(mapFn, thisArg, result.value, i) : result.value; + if (Context) { + desc.value = value; + defineProperty$4(arr, i, desc); + } else { + arr[i] = value; + } + result = iterator.next(); + ++i; + } + length = i; + } else if (isString(arrayLike)) { + // Source: String + length = arrayLike.length; + if (Context) { arr = new Context(); } + for (i = 0, j = 0; i < length; ++i) { + value = arrayLike[i]; + if (i + 1 < length) { + code = value.charCodeAt(0); + // eslint-disable-next-line max-depth + if (code >= 0xd800 && code <= 0xdbff) { value += arrayLike[++i]; } + } + value = mapFn ? call$2.call(mapFn, thisArg, value, j) : value; + if (Context) { + desc.value = value; + defineProperty$4(arr, j, desc); + } else { + arr[j] = value; + } + ++j; + } + length = j; + } + } + if (length === undefined) { + // Source: array or array-like + length = toPosInteger(arrayLike.length); + if (Context) { arr = new Context(length); } + for (i = 0; i < length; ++i) { + value = mapFn ? call$2.call(mapFn, thisArg, arrayLike[i], i) : arrayLike[i]; + if (Context) { + desc.value = value; + defineProperty$4(arr, i, desc); + } else { + arr[i] = value; + } + } + } + if (Context) { + desc.value = null; + arr.length = length; + } + return arr; +}; + +var from = isImplemented$16() + ? Array.from + : shim$13; + +var copy = function (obj/* propertyNames, options*/) { + var copy = Object(validValue(obj)), propertyNames = arguments[1], options = Object(arguments[2]); + if (copy !== obj && !propertyNames) { return copy; } + var result = {}; + if (propertyNames) { + from(propertyNames, function (propertyName) { + if (options.ensure || propertyName in obj) { result[propertyName] = obj[propertyName]; } + }); + } else { + assign(result, obj); + } + return result; +}; + +var bind$1 = Function.prototype.bind; +var call$4 = Function.prototype.call; +var keys$4 = Object.keys; +var objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable; + +var _iterate = function (method, defVal) { + return function (obj, cb /* thisArg, compareFn*/) { + var list, thisArg = arguments[2], compareFn = arguments[3]; + obj = Object(validValue(obj)); + validCallable(cb); + + list = keys$4(obj); + if (compareFn) { + list.sort(typeof compareFn === "function" ? bind$1.call(compareFn, obj) : undefined); + } + if (typeof method !== "function") { method = list[method]; } + return call$4.call(method, list, function (key, index) { + if (!objPropertyIsEnumerable.call(obj, key)) { return defVal; } + return call$4.call(cb, thisArg, obj[key], key, obj, index); + }); + }; +}; + +var forEach$1 = _iterate("forEach"); + +var call$3 = Function.prototype.call; + +var map$1 = function (obj, cb /* thisArg*/) { + var result = {}, thisArg = arguments[2]; + validCallable(cb); + forEach$1(obj, function (value, key, targetObj, index) { + result[key] = call$3.call(cb, thisArg, value, key, targetObj, index); + }); + return result; +}; + +var callable$1 = validCallable; +var bind = Function.prototype.bind; +var defineProperty$3 = Object.defineProperty; +var hasOwnProperty$1 = Object.prototype.hasOwnProperty; +var define; + +define = function (name, desc, options) { + var value = validValue(desc) && callable$1(desc.value), dgs; + dgs = copy(desc); + delete dgs.writable; + delete dgs.value; + dgs.get = function () { + if (!options.overwriteDefinition && hasOwnProperty$1.call(this, name)) { return value; } + desc.value = bind.call(value, options.resolveContext ? options.resolveContext(this) : this); + defineProperty$3(this, name, desc); + return this[name]; + }; + return dgs; +}; + +var autoBind = function (props/* options*/) { + var options = normalizeOptions(arguments[1]); + if (options.resolveContext != null) { validCallable(options.resolveContext); } + return map$1(props, function (desc, name) { return define(name, desc, options); }); +}; + +var defineProperty$2 = Object.defineProperty; +var defineProperties$2 = Object.defineProperties; +var Iterator; + +var es6Iterator = Iterator = function (list, context) { + if (!(this instanceof Iterator)) { throw new TypeError("Constructor requires 'new'"); } + defineProperties$2(this, { + __list__: d_1("w", validValue(list)), + __context__: d_1("w", context), + __nextIndex__: d_1("w", 0) + }); + if (!context) { return; } + validCallable(context.on); + context.on("_add", this._onAdd); + context.on("_delete", this._onDelete); + context.on("_clear", this._onClear); +}; + +// Internal %IteratorPrototype% doesn't expose its constructor +delete Iterator.prototype.constructor; + +defineProperties$2( + Iterator.prototype, + assign( + { + _next: d_1(function () { + var i; + if (!this.__list__) { return undefined; } + if (this.__redo__) { + i = this.__redo__.shift(); + if (i !== undefined) { return i; } + } + if (this.__nextIndex__ < this.__list__.length) { return this.__nextIndex__++; } + this._unBind(); + return undefined; + }), + next: d_1(function () { + return this._createResult(this._next()); + }), + _createResult: d_1(function (i) { + if (i === undefined) { return { done: true, value: undefined }; } + return { done: false, value: this._resolve(i) }; + }), + _resolve: d_1(function (i) { + return this.__list__[i]; + }), + _unBind: d_1(function () { + this.__list__ = null; + delete this.__redo__; + if (!this.__context__) { return; } + this.__context__.off("_add", this._onAdd); + this.__context__.off("_delete", this._onDelete); + this.__context__.off("_clear", this._onClear); + this.__context__ = null; + }), + toString: d_1(function () { + return "[object " + (this[es6Symbol.toStringTag] || "Object") + "]"; + }) + }, + autoBind({ + _onAdd: d_1(function (index) { + if (index >= this.__nextIndex__) { return; } + ++this.__nextIndex__; + if (!this.__redo__) { + defineProperty$2(this, "__redo__", d_1("c", [index])); + return; + } + this.__redo__.forEach(function (redo, i) { + if (redo >= index) { this.__redo__[i] = ++redo; } + }, this); + this.__redo__.push(index); + }), + _onDelete: d_1(function (index) { + var i; + if (index >= this.__nextIndex__) { return; } + --this.__nextIndex__; + if (!this.__redo__) { return; } + i = this.__redo__.indexOf(index); + if (i !== -1) { this.__redo__.splice(i, 1); } + this.__redo__.forEach(function (redo, j) { + if (redo > index) { this.__redo__[j] = --redo; } + }, this); + }), + _onClear: d_1(function () { + if (this.__redo__) { clear.call(this.__redo__); } + this.__nextIndex__ = 0; + }) + }) + ) +); + +defineProperty$2( + Iterator.prototype, + es6Symbol.iterator, + d_1(function () { + return this; + }) +); + +var array = createCommonjsModule(function (module) { +var defineProperty = Object.defineProperty, ArrayIterator; + +ArrayIterator = module.exports = function (arr, kind) { + if (!(this instanceof ArrayIterator)) { throw new TypeError("Constructor requires 'new'"); } + es6Iterator.call(this, arr); + if (!kind) { kind = "value"; } + else if (contains.call(kind, "key+value")) { kind = "key+value"; } + else if (contains.call(kind, "key")) { kind = "key"; } + else { kind = "value"; } + defineProperty(this, "__kind__", d_1("", kind)); +}; +if (setPrototypeOf) { setPrototypeOf(ArrayIterator, es6Iterator); } + +// Internal %ArrayIteratorPrototype% doesn't expose its constructor +delete ArrayIterator.prototype.constructor; + +ArrayIterator.prototype = Object.create(es6Iterator.prototype, { + _resolve: d_1(function (i) { + if (this.__kind__ === "value") { return this.__list__[i]; } + if (this.__kind__ === "key+value") { return [i, this.__list__[i]]; } + return i; + }) +}); +defineProperty(ArrayIterator.prototype, es6Symbol.toStringTag, d_1("c", "Array Iterator")); +}); + +var string = createCommonjsModule(function (module) { +// Thanks @mathiasbynens +// http://mathiasbynens.be/notes/javascript-unicode#iterating-over-symbols + +var defineProperty = Object.defineProperty, StringIterator; + +StringIterator = module.exports = function (str) { + if (!(this instanceof StringIterator)) { throw new TypeError("Constructor requires 'new'"); } + str = String(str); + es6Iterator.call(this, str); + defineProperty(this, "__length__", d_1("", str.length)); +}; +if (setPrototypeOf) { setPrototypeOf(StringIterator, es6Iterator); } + +// Internal %ArrayIteratorPrototype% doesn't expose its constructor +delete StringIterator.prototype.constructor; + +StringIterator.prototype = Object.create(es6Iterator.prototype, { + _next: d_1(function () { + if (!this.__list__) { return undefined; } + if (this.__nextIndex__ < this.__length__) { return this.__nextIndex__++; } + this._unBind(); + return undefined; + }), + _resolve: d_1(function (i) { + var char = this.__list__[i], code; + if (this.__nextIndex__ === this.__length__) { return char; } + code = char.charCodeAt(0); + if (code >= 0xd800 && code <= 0xdbff) { return char + this.__list__[this.__nextIndex__++]; } + return char; + }) +}); +defineProperty(StringIterator.prototype, es6Symbol.toStringTag, d_1("c", "String Iterator")); +}); + +var iteratorSymbol$1 = es6Symbol.iterator; + +var get = function (obj) { + if (typeof validIterable(obj)[iteratorSymbol$1] === "function") { return obj[iteratorSymbol$1](); } + if (isArguments(obj)) { return new array(obj); } + if (isString(obj)) { return new string(obj); } + return new array(obj); +}; + +var isArray$1 = Array.isArray; +var call$1 = Function.prototype.call; +var some = Array.prototype.some; + +var forOf = function (iterable, cb /* thisArg*/) { + var mode, thisArg = arguments[2], result, doBreak, broken, i, length, char, code; + if (isArray$1(iterable) || isArguments(iterable)) { mode = "array"; } + else if (isString(iterable)) { mode = "string"; } + else { iterable = get(iterable); } + + validCallable(cb); + doBreak = function () { + broken = true; + }; + if (mode === "array") { + some.call(iterable, function (value) { + call$1.call(cb, thisArg, value, doBreak); + return broken; + }); + return; + } + if (mode === "string") { + length = iterable.length; + for (i = 0; i < length; ++i) { + char = iterable[i]; + if (i + 1 < length) { + code = char.charCodeAt(0); + if (code >= 0xd800 && code <= 0xdbff) { char += iterable[++i]; } + } + call$1.call(cb, thisArg, char, doBreak); + if (broken) { break; } + } + return; + } + result = iterable.next(); + + while (!result.done) { + call$1.call(cb, thisArg, result.value, doBreak); + if (broken) { return; } + result = iterable.next(); + } +}; + +var forEach$4 = Array.prototype.forEach; +var create$4 = Object.create; + +// eslint-disable-next-line no-unused-vars +var primitiveSet = function (arg /* …args*/) { + var set = create$4(null); + forEach$4.call(arguments, function (name) { + set[name] = true; + }); + return set; +}; + +var iteratorKinds = primitiveSet('key', + 'value', 'key+value'); + +var iterator$1 = createCommonjsModule(function (module) { +var toStringTagSymbol = es6Symbol.toStringTag + + , defineProperties = Object.defineProperties + , unBind = es6Iterator.prototype._unBind + , MapIterator; + +MapIterator = module.exports = function (map, kind) { + if (!(this instanceof MapIterator)) { return new MapIterator(map, kind); } + es6Iterator.call(this, map.__mapKeysData__, map); + if (!kind || !iteratorKinds[kind]) { kind = 'key+value'; } + defineProperties(this, { + __kind__: d_1('', kind), + __values__: d_1('w', map.__mapValuesData__) + }); +}; +if (setPrototypeOf) { setPrototypeOf(MapIterator, es6Iterator); } + +MapIterator.prototype = Object.create(es6Iterator.prototype, { + constructor: d_1(MapIterator), + _resolve: d_1(function (i) { + if (this.__kind__ === 'value') { return this.__values__[i]; } + if (this.__kind__ === 'key') { return this.__list__[i]; } + return [this.__list__[i], this.__values__[i]]; + }), + _unBind: d_1(function () { + this.__values__ = null; + unBind.call(this); + }), + toString: d_1(function () { return '[object Map Iterator]'; }) +}); +Object.defineProperty(MapIterator.prototype, toStringTagSymbol, + d_1('c', 'Map Iterator')); +}); + +// Exports true if environment provides native `Map` implementation, +// whatever that is. + +var isNativeImplemented = (function () { + if (typeof Map === 'undefined') { return false; } + return (Object.prototype.toString.call(new Map()) === '[object Map]'); +}()); + +var iterator = validIterable; +var call = Function.prototype.call; +var defineProperties = Object.defineProperties; +var getPrototypeOf = Object.getPrototypeOf; +var MapPoly; + +var polyfill = MapPoly = function (/*iterable*/) { + var iterable$$1 = arguments[0], keys, values, self; + if (!(this instanceof MapPoly)) { throw new TypeError('Constructor requires \'new\''); } + if (isNativeImplemented && setPrototypeOf && (Map !== MapPoly)) { + self = setPrototypeOf(new Map(), getPrototypeOf(this)); + } else { + self = this; + } + if (iterable$$1 != null) { iterator(iterable$$1); } + defineProperties(self, { + __mapKeysData__: d_1('c', keys = []), + __mapValuesData__: d_1('c', values = []) + }); + if (!iterable$$1) { return self; } + forOf(iterable$$1, function (value$$1) { + var key = validValue(value$$1)[0]; + value$$1 = value$$1[1]; + if (eIndexOf.call(keys, key) !== -1) { return; } + keys.push(key); + values.push(value$$1); + }, self); + return self; +}; + +if (isNativeImplemented) { + if (setPrototypeOf) { setPrototypeOf(MapPoly, Map); } + MapPoly.prototype = Object.create(Map.prototype, { + constructor: d_1(MapPoly) + }); +} + +eventEmitter(defineProperties(MapPoly.prototype, { + clear: d_1(function () { + if (!this.__mapKeysData__.length) { return; } + clear.call(this.__mapKeysData__); + clear.call(this.__mapValuesData__); + this.emit('_clear'); + }), + delete: d_1(function (key) { + var index = eIndexOf.call(this.__mapKeysData__, key); + if (index === -1) { return false; } + this.__mapKeysData__.splice(index, 1); + this.__mapValuesData__.splice(index, 1); + this.emit('_delete', index, key); + return true; + }), + entries: d_1(function () { return new iterator$1(this, 'key+value'); }), + forEach: d_1(function (cb/* thisArg*/) { + var this$1 = this; + + var thisArg = arguments[1], iterator, result; + validCallable(cb); + iterator = this.entries(); + result = iterator._next(); + while (result !== undefined) { + call.call(cb, thisArg, this$1.__mapValuesData__[result], + this$1.__mapKeysData__[result], this$1); + result = iterator._next(); + } + }), + get: d_1(function (key) { + var index = eIndexOf.call(this.__mapKeysData__, key); + if (index === -1) { return; } + return this.__mapValuesData__[index]; + }), + has: d_1(function (key) { + return (eIndexOf.call(this.__mapKeysData__, key) !== -1); + }), + keys: d_1(function () { return new iterator$1(this, 'key'); }), + set: d_1(function (key, value$$1) { + var index = eIndexOf.call(this.__mapKeysData__, key), emit; + if (index === -1) { + index = this.__mapKeysData__.push(key) - 1; + emit = true; + } + this.__mapValuesData__[index] = value$$1; + if (emit) { this.emit('_add', index, key); } + return this; + }), + size: d_1.gs(function () { return this.__mapKeysData__.length; }), + values: d_1(function () { return new iterator$1(this, 'value'); }), + toString: d_1(function () { return '[object Map]'; }) +})); +Object.defineProperty(MapPoly.prototype, es6Symbol.iterator, d_1(function () { + return this.entries(); +})); +Object.defineProperty(MapPoly.prototype, es6Symbol.toStringTag, d_1('c', 'Map')); + +if (!isImplemented()) { + Object.defineProperty(global$1, 'Map', + { value: polyfill, configurable: true, enumerable: false, + writable: true }); +} + var vuescroll = new Object; vuescroll.install = function (Vue, options) { diff --git a/dist/vue-scroll.min.js b/dist/vue-scroll.min.js index bc81f7e..bdefbb0 100644 --- a/dist/vue-scroll.min.js +++ b/dist/vue-scroll.min.js @@ -3,4 +3,4 @@ * (c) 2018 Wang Pin * @license MIT */ -!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.VueScroll=t()}(this,function(){"use strict";var n=function(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)},t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e="object"==typeof t&&t&&t.Object===Object&&t,o="object"==typeof self&&self&&self.Object===Object&&self,r=e||o||Function("return this")(),i=r.Symbol,u=Object.prototype,c=u.hasOwnProperty,f=u.toString,l=i?i.toStringTag:void 0,a=function(n){var t=c.call(n,l),e=n[l];try{n[l]=void 0;var o=!0}catch(n){}var r=f.call(n);return o&&(t?n[l]=e:delete n[l]),r},d=Object.prototype.toString,s=function(n){return d.call(n)},p="[object Null]",b="[object Undefined]",v=i?i.toStringTag:void 0,y=function(n){return null==n?void 0===n?b:p:v&&v in Object(n)?a(n):s(n)},g="[object AsyncFunction]",h="[object Function]",m="[object GeneratorFunction]",w="[object Proxy]",j=function(t){if(!n(t))return!1;var e=y(t);return e==h||e==m||e==g||e==w},x=function(n){return null!=n&&"object"==typeof n},O="[object Symbol]",T=function(n){return"symbol"==typeof n||x(n)&&y(n)==O},E=NaN,S=/^\s+|\s+$/g,L=/^[-+]0x[0-9a-f]+$/i,F=/^0b[01]+$/i,M=/^0o[0-7]+$/i,$=parseInt,N=function(t){if("number"==typeof t)return t;if(T(t))return E;if(n(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=n(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(S,"");var o=F.test(t);return o||M.test(t)?$(t.slice(2),o?2:8):L.test(t)?E:+t},U=1/0,V=1.7976931348623157e308,W=function(n){if(!n)return 0===n?n:0;if((n=N(n))===U||n===-U)return(n<0?-1:1)*V;return n==n?n:0},P=function(n){var t=W(n),e=t%1;return t==t?e?t-e:t:0},A=function(n){return"number"==typeof n&&n==P(n)},D=r.isFinite,G=function(n){return"number"==typeof n&&D(n)},I=function(){return r.Date.now()},k="Expected a function",q=Math.max,z=Math.min,B=function(t,e,o){function r(n){var e=l,o=a;return l=a=void 0,v=n,s=t.apply(o,e)}function i(n){var t=n-b;return void 0===b||t>=e||t<0||g&&n-v>=d}function u(){var n=I();if(i(n))return c(n);p=setTimeout(u,function(n){var t=e-(n-b);return g?z(t,d-(n-v)):t}(n))}function c(n){return p=void 0,h&&l?r(n):(l=a=void 0,s)}function f(){var n=I(),t=i(n);if(l=arguments,a=this,b=n,t){if(void 0===p)return function(n){return v=n,p=setTimeout(u,e),y?r(n):s}(b);if(g)return p=setTimeout(u,e),r(b)}return void 0===p&&(p=setTimeout(u,e)),s}var l,a,d,s,p,b,v=0,y=!1,g=!1,h=!0;if("function"!=typeof t)throw new TypeError(k);return e=N(e)||0,n(o)&&(y=!!o.leading,d=(g="maxWait"in o)?q(N(o.maxWait)||0,e):d,h="trailing"in o?!!o.trailing:h),f.cancel=function(){void 0!==p&&clearTimeout(p),v=0,l=b=a=p=void 0},f.flush=function(){return void 0===p?s:c(I())},f},C="Expected a function",H=function(t,e,o){var r=!0,i=!0;if("function"!=typeof t)throw new TypeError(C);return n(o)&&(r="leading"in o?!!o.leading:r,i="trailing"in o?!!o.trailing:i),B(t,e,{leading:r,maxWait:e,trailing:i})},J=function(){var t=new Map,e="scroll";return{bind:function(o,r,i,u){var c,f;if(!j(i))throw new Error("Scroll handler is not a function");t.has(o)||t.set(o,new Map),(c=t.get(o)).has(r)||c.set(r,[]),(f=c.get(r)).length||function(t,o,r,i){function u(n){var t,o=n.target||n.srcElement;(n=n||window.e).type===e&&(t=o===document?{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}:{scrollTop:o.scrollTop,scrollLeft:o.scrollLeft}),r.forEach(function(e){e(n,t)})}n(i)&&(A(i.throttle)&&G(i.throttle)&&i.throttle>-1&&(u=H(u,i.throttle)),A(i.debounce)&&G(i.debounce)&&i.debounce>-1&&(u=B(u,i.debounce))),o===e&&(t===document.body||t===document||t===window?document.onscroll=u:t.addEventListener?t.addEventListener(o,u):t.attachEvent("on"+o,u))}(o,r,f,u),f.push(i)},unbind:function(n,e,o){var r,i;if(j(o))return t.has(n)||t.set(n,new Map),(r=t.get(n)).has(e)||r.set(e,[]),(i=r.get(e)).indexOf(o)>-1&&(i.splice(i.indexOf(o),1),!0)}}}(),K=new Object;return K.install=function(t,e){function o(t,o,r){var l,a=Object.assign({},e);if(n(o)||j(o)){l=o,f.indexOf(r)>-1&&(l=o.fn,r===u?a={throttle:o.throttle}:r===c&&(a={debounce:o.debounce}));try{J.bind(t,i,l,a)}catch(n){console.warn("Unexpected error happened when binding listener")}}else console.warn("Unexpected scroll properties")}function r(t,e,o){var r;(n(e)||j(e))&&(r=e,f.indexOf(o)>-1&&(r=e.fn),J.unbind(t,i,r))}e=e||{};var i="scroll",u="throttle",c="debounce",f=[u,c];t.directive(i,{bind:function(n,t,e,r){o(n,t.value,t.arg)},inserted:function(n,t){},update:function(n,t){t.value!==t.oldValue&&(o(n,t.value,t.arg),r(n,t.oldValue,t.arg))},unbind:function(n,t){r(n,t.value,t.arg)}})},K}); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueScroll=e()}(this,function(){"use strict";function t(t,e){return e={exports:{}},t(e,e.exports),e.exports}var e,n=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},o="object"==typeof r&&r&&r.Object===Object&&r,i="object"==typeof self&&self&&self.Object===Object&&self,c=o||i||Function("return this")(),a=c.Symbol,u=Object.prototype,l=u.hasOwnProperty,f=u.toString,s=a?a.toStringTag:void 0,_=function(t){var e=l.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var o=f.call(t);return r&&(e?t[s]=n:delete t[s]),o},p=Object.prototype.toString,h=function(t){return p.call(t)},y="[object Null]",d="[object Undefined]",b=a?a.toStringTag:void 0,v=function(t){return null==t?void 0===t?d:y:b&&b in Object(t)?_(t):h(t)},g="[object AsyncFunction]",m="[object Function]",O="[object GeneratorFunction]",j="[object Proxy]",w=function(t){if(!n(t))return!1;var e=v(t);return e==m||e==O||e==g||e==j},x=function(t){return null!=t&&"object"==typeof t},S="[object Symbol]",P=function(t){return"symbol"==typeof t||x(t)&&v(t)==S},T=NaN,E=/^\s+|\s+$/g,M=/^[-+]0x[0-9a-f]+$/i,k=/^0b[01]+$/i,A=/^0o[0-7]+$/i,D=parseInt,I=function(t){if("number"==typeof t)return t;if(P(t))return T;if(n(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=n(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(E,"");var r=k.test(t);return r||A.test(t)?D(t.slice(2),r?2:8):M.test(t)?T:+t},N=1/0,C=1.7976931348623157e308,F=function(t){if(!t)return 0===t?t:0;if((t=I(t))===N||t===-N)return(t<0?-1:1)*C;return t==t?t:0},z=function(t){var e=F(t),n=e%1;return e==e?n?e-n:e:0},K=function(t){return"number"==typeof t&&t==z(t)},V=c.isFinite,L=function(t){return"number"==typeof t&&V(t)},B=function(){return c.Date.now()},q="Expected a function",$=Math.max,U=Math.min,W=function(t,e,r){function o(e){var n=l,r=f;return l=f=void 0,y=e,_=t.apply(r,n)}function i(t){var n=t-h;return void 0===h||n>=e||n<0||b&&t-y>=s}function c(){var t=B();if(i(t))return a(t);p=setTimeout(c,function(t){var n=e-(t-h);return b?U(n,s-(t-y)):n}(t))}function a(t){return p=void 0,v&&l?o(t):(l=f=void 0,_)}function u(){var t=B(),n=i(t);if(l=arguments,f=this,h=t,n){if(void 0===p)return function(t){return y=t,p=setTimeout(c,e),d?o(t):_}(h);if(b)return p=setTimeout(c,e),o(h)}return void 0===p&&(p=setTimeout(c,e)),_}var l,f,s,_,p,h,y=0,d=!1,b=!1,v=!0;if("function"!=typeof t)throw new TypeError(q);return e=I(e)||0,n(r)&&(d=!!r.leading,s=(b="maxWait"in r)?$(I(r.maxWait)||0,e):s,v="trailing"in r?!!r.trailing:v),u.cancel=function(){void 0!==p&&clearTimeout(p),y=0,l=h=f=p=void 0},u.flush=function(){return void 0===p?_:a(B())},u},R="Expected a function",G=function(t,e,r){var o=!0,i=!0;if("function"!=typeof t)throw new TypeError(R);return n(r)&&(o="leading"in r?!!r.leading:o,i="trailing"in r?!!r.trailing:i),W(t,e,{leading:o,maxWait:e,trailing:i})},H=function(){var t=new Map,e="scroll";return{bind:function(r,o,i,c){var a,u;if(!w(i))throw new Error("Scroll handler is not a function");t.has(r)||t.set(r,new Map),(a=t.get(r)).has(o)||a.set(o,[]),(u=a.get(o)).length||function(t,r,o,i){function c(t){var n,r=t.target||t.srcElement;(t=t||window.e).type===e&&(n=r===document?{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}:{scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),o.forEach(function(e){e(t,n)})}n(i)&&(K(i.throttle)&&L(i.throttle)&&i.throttle>-1&&(c=G(c,i.throttle)),K(i.debounce)&&L(i.debounce)&&i.debounce>-1&&(c=W(c,i.debounce))),r===e&&(t===document.body||t===document||t===window?document.onscroll=c:t.addEventListener?t.addEventListener(r,c):t.attachEvent("on"+r,c))}(r,o,u,c),u.push(i)},unbind:function(e,n,r){var o,i;if(w(r))return t.has(e)||t.set(e,new Map),(o=t.get(e)).has(n)||o.set(n,[]),(i=o.get(n)).indexOf(r)>-1&&(i.splice(i.indexOf(r),1),!0)}}}(),J=function(){return this}(),Q=function(){},X=Q(),Y=function(t){return t!==X&&null!==t},Z=function(t){if(!Y(t))throw new TypeError("Cannot use null or undefined");return t},tt=function(){return Z(this).length=0,this},et=function(){var t=Number.isNaN;return"function"==typeof t&&!t({})&&t(NaN)&&!t(34)}()?Number.isNaN:function(t){return t!=t},nt=function(){var t=Math.sign;return"function"==typeof t&&1===t(10)&&-1===t(-20)}()?Math.sign:function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1},rt=Math.abs,ot=Math.floor,it=Math.max,ct=function(t){return it(0,function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?nt(t)*ot(rt(t)):t}(t))},at=Array.prototype.indexOf,ut=Object.prototype.hasOwnProperty,lt=Math.abs,ft=Math.floor,st=function(t){var e,n,r,o;if(!et(t))return at.apply(this,arguments);for(n=ct(Z(this).length),r=arguments[1],e=r=isNaN(r)?0:r>=0?ft(r):ct(this.length)-ft(lt(r));e-1},Lt=t(function(t){(t.exports=function(t,e){var n,r,o,i,c;return arguments.length<2||"string"!=typeof t?(i=e,e=t,t=null):i=arguments[2],null==t?(n=o=!0,r=!1):(n=Vt.call(t,"c"),r=Vt.call(t,"e"),o=Vt.call(t,"w")),c={value:e,configurable:n,enumerable:r,writable:o},i?Dt(Ct(i),c):c}).gs=function(t,e,n){var r,o,i,c;return"string"!=typeof t?(i=n,n=e,e=t,t=null):i=arguments[3],null==e?e=void 0:Ft(e)?null==n?n=void 0:Ft(n)||(i=n,n=void 0):(i=e,e=n=void 0),null==t?(r=!0,o=!1):(r=Vt.call(t,"c"),o=Vt.call(t,"e")),c={get:e,set:n,configurable:r,enumerable:o},i?Dt(Ct(i),c):c}}),Bt=t(function(t,e){var n,r,o,i,c,a,u,l=Function.prototype.apply,f=Function.prototype.call,s=Object.create,_=Object.defineProperty,p=Object.defineProperties,h=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};c={on:n=function(t,e){var n;return Et(e),h.call(this,"__ee__")?n=this.__ee__:(n=y.value=s(null),_(this,"__ee__",y),y.value=null),n[t]?"object"==typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},once:r=function(t,e){var r,i;return Et(e),i=this,n.call(this,t,r=function(){o.call(i,t,r),l.call(e,this,arguments)}),r.__eeOnceListener__=e,this},off:o=function(t,e){var n,r,o,i;if(Et(e),!h.call(this,"__ee__"))return this;if(!(n=this.__ee__)[t])return this;if("object"==typeof(r=n[t]))for(i=0;o=r[i];++i)o!==e&&o.__eeOnceListener__!==e||(2===r.length?n[t]=r[i?0:1]:r.splice(i,1));else r!==e&&r.__eeOnceListener__!==e||delete n[t];return this},emit:i=function(t){var e,n,r,o,i,c=arguments;if(h.call(this,"__ee__")&&(o=this.__ee__[t]))if("object"==typeof o){for(n=arguments.length,i=new Array(n-1),e=1;e=55296&&c<=56319&&(f+=t[++n]),f=s?_e.call(s,_,f,r):f,e?(pe.value=f,he(o,r,pe)):o[r]=f,++r;i=r}if(void 0===i)for(i=ct(t.length),e&&(o=new e(i)),n=0;n=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach(function(e,n){e>=t&&(this.__redo__[n]=++e)},this),this.__redo__.push(t)):Te(this,"__redo__",Lt("c",[t])))}),_onDelete:Lt(function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach(function(e,n){e>t&&(this.__redo__[n]=--e)},this)))}),_onClear:Lt(function(){this.__redo__&&tt.call(this.__redo__),this.__nextIndex__=0})}))),Te(Pe.prototype,Yt.iterator,Lt(function(){return this}));var ke,Ae=t(function(t){var e,n=Object.defineProperty;e=t.exports=function(t,r){if(!(this instanceof e))throw new TypeError("Constructor requires 'new'");Me.call(this,t),r=r?Vt.call(r,"key+value")?"key+value":Vt.call(r,"key")?"key":"value":"value",n(this,"__kind__",Lt("",r))},Tt&&Tt(e,Me),delete e.prototype.constructor,e.prototype=Object.create(Me.prototype,{_resolve:Lt(function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t})}),n(e.prototype,Yt.toStringTag,Lt("c","Array Iterator"))}),De=t(function(t){var e,n=Object.defineProperty;e=t.exports=function(t){if(!(this instanceof e))throw new TypeError("Constructor requires 'new'");t=String(t),Me.call(this,t),n(this,"__length__",Lt("",t.length))},Tt&&Tt(e,Me),delete e.prototype.constructor,e.prototype=Object.create(Me.prototype,{_next:Lt(function(){if(this.__list__)return this.__nextIndex__=55296&&e<=56319?n+this.__list__[this.__nextIndex__++]:n})}),n(e.prototype,Yt.toStringTag,Lt("c","String Iterator"))}),Ie=Yt.iterator,Ne=Array.isArray,Ce=Function.prototype.call,Fe=Array.prototype.some,ze=function(t,e){var n,r,o,i,c,a,u,l,f=arguments[2];if(Ne(t)||ee(t)?n="array":oe(t)?n="string":t=function(t){return"function"==typeof ae(t)[Ie]?t[Ie]():ee(t)?new Ae(t):oe(t)?new De(t):new Ae(t)}(t),Et(e),o=function(){i=!0},"array"!==n)if("string"!==n)for(r=t.next();!r.done;){if(Ce.call(e,f,r.value,o),i)return;r=t.next()}else for(a=t.length,c=0;c=55296&&l<=56319&&(u+=t[++c]),Ce.call(e,f,u,o),!i);++c);else Fe.call(t,function(t){return Ce.call(e,f,t,o),i})},Ke=Array.prototype.forEach,Ve=Object.create,Le=function(t){var e=Ve(null);return Ke.call(arguments,function(t){e[t]=!0}),e}("key","value","key+value"),Be=t(function(t){var e,n=Yt.toStringTag,r=Object.defineProperties,o=Me.prototype._unBind;e=t.exports=function(t,n){if(!(this instanceof e))return new e(t,n);Me.call(this,t.__mapKeysData__,t),n&&Le[n]||(n="key+value"),r(this,{__kind__:Lt("",n),__values__:Lt("w",t.__mapValuesData__)})},Tt&&Tt(e,Me),e.prototype=Object.create(Me.prototype,{constructor:Lt(e),_resolve:Lt(function(t){return"value"===this.__kind__?this.__values__[t]:"key"===this.__kind__?this.__list__[t]:[this.__list__[t],this.__values__[t]]}),_unBind:Lt(function(){this.__values__=null,o.call(this)}),toString:Lt(function(){return"[object Map Iterator]"})}),Object.defineProperty(e.prototype,n,Lt("c","Map Iterator"))}),qe="undefined"!=typeof Map&&"[object Map]"===Object.prototype.toString.call(new Map),$e=ae,Ue=Function.prototype.call,We=Object.defineProperties,Re=Object.getPrototypeOf,Ge=ke=function(){var t,e,n,r=arguments[0];if(!(this instanceof ke))throw new TypeError("Constructor requires 'new'");return n=qe&&Tt&&Map!==ke?Tt(new Map,Re(this)):this,null!=r&&$e(r),We(n,{__mapKeysData__:Lt("c",t=[]),__mapValuesData__:Lt("c",e=[])}),r?(ze(r,function(n){var r=Z(n)[0];n=n[1],-1===st.call(t,r)&&(t.push(r),e.push(n))},n),n):n};qe&&(Tt&&Tt(ke,Map),ke.prototype=Object.create(Map.prototype,{constructor:Lt(ke)})),Bt(We(ke.prototype,{clear:Lt(function(){this.__mapKeysData__.length&&(tt.call(this.__mapKeysData__),tt.call(this.__mapValuesData__),this.emit("_clear"))}),delete:Lt(function(t){var e=st.call(this.__mapKeysData__,t);return-1!==e&&(this.__mapKeysData__.splice(e,1),this.__mapValuesData__.splice(e,1),this.emit("_delete",e,t),!0)}),entries:Lt(function(){return new Be(this,"key+value")}),forEach:Lt(function(t){var e,n,r=arguments[1];for(Et(t),n=(e=this.entries())._next();void 0!==n;)Ue.call(t,r,this.__mapValuesData__[n],this.__mapKeysData__[n],this),n=e._next()}),get:Lt(function(t){var e=st.call(this.__mapKeysData__,t);if(-1!==e)return this.__mapValuesData__[e]}),has:Lt(function(t){return-1!==st.call(this.__mapKeysData__,t)}),keys:Lt(function(){return new Be(this,"key")}),set:Lt(function(t,e){var n,r=st.call(this.__mapKeysData__,t);return-1===r&&(r=this.__mapKeysData__.push(t)-1,n=!0),this.__mapValuesData__[r]=e,n&&this.emit("_add",r,t),this}),size:Lt.gs(function(){return this.__mapKeysData__.length}),values:Lt(function(){return new Be(this,"value")}),toString:Lt(function(){return"[object Map]"})})),Object.defineProperty(ke.prototype,Yt.iterator,Lt(function(){return this.entries()})),Object.defineProperty(ke.prototype,Yt.toStringTag,Lt("c","Map")),function(){var t,e,n;if("function"!=typeof Map)return!1;try{t=new Map([["raz","one"],["dwa","two"],["trzy","three"]])}catch(t){return!1}return"[object Map]"===String(t)&&3===t.size&&"function"==typeof t.clear&&"function"==typeof t.delete&&"function"==typeof t.entries&&"function"==typeof t.forEach&&"function"==typeof t.get&&"function"==typeof t.has&&"function"==typeof t.keys&&"function"==typeof t.set&&"function"==typeof t.values&&(e=t.entries(),!1===(n=e.next()).done&&!!n.value&&"raz"===n.value[0]&&"one"===n.value[1])}()||Object.defineProperty(J,"Map",{value:Ge,configurable:!0,enumerable:!1,writable:!0});var He=new Object;return He.install=function(t,e){function r(t,r,o){var l,f=Object.assign({},e);if(n(r)||w(r)){l=r,u.indexOf(o)>-1&&(l=r.fn,o===c?f={throttle:r.throttle}:o===a&&(f={debounce:r.debounce}));try{H.bind(t,i,l,f)}catch(t){console.warn("Unexpected error happened when binding listener")}}else console.warn("Unexpected scroll properties")}function o(t,e,r){var o;(n(e)||w(e))&&(o=e,u.indexOf(r)>-1&&(o=e.fn),H.unbind(t,i,o))}e=e||{};var i="scroll",c="throttle",a="debounce",u=[c,a];t.directive(i,{bind:function(t,e,n,o){r(t,e.value,e.arg)},inserted:function(t,e){},update:function(t,e){e.value!==e.oldValue&&(r(t,e.value,e.arg),o(t,e.oldValue,e.arg))},unbind:function(t,e){o(t,e.value,e.arg)}})},He}); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 1d3ab35..ef3f060 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vue-scroll", - "version": "2.1.4", + "version": "2.1.7", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -16,7 +16,7 @@ "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", "dev": true, "requires": { - "acorn": "3.3.0" + "acorn": "^3.0.4" }, "dependencies": { "acorn": { @@ -33,7 +33,7 @@ "integrity": "sha1-1XWAge7ZcSGrC+R+Mcqu8qo5lpc=", "dev": true, "requires": { - "acorn": "5.2.1" + "acorn": "^5.1.2" } }, "ansi-styles": { @@ -42,7 +42,7 @@ "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", "dev": true, "requires": { - "color-convert": "1.9.1" + "color-convert": "^1.9.0" } }, "arr-diff": { @@ -51,7 +51,7 @@ "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", "dev": true, "requires": { - "arr-flatten": "1.1.0" + "arr-flatten": "^1.0.1" } }, "arr-flatten": { @@ -84,7 +84,7 @@ "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -94,9 +94,9 @@ "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", "dev": true, "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.2" + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" } }, "browser-resolve": { @@ -122,14 +122,14 @@ "integrity": "sha512-U3NJxUiSz0H1EB54PEHAuBTxdXgQH4DaQkvkINFXf9kEKCDWSn67EgQfFKbkTzsok4xRrIPsoxWDl2czCHR65g==", "dev": true, "requires": { - "acorn": "5.2.1", - "acorn-jsx": "3.0.1", - "acorn5-object-spread": "4.0.0", - "chalk": "2.3.0", - "magic-string": "0.22.4", - "minimist": "1.2.0", - "os-homedir": "1.0.2", - "vlq": "0.2.3" + "acorn": "^5.1.2", + "acorn-jsx": "^3.0.1", + "acorn5-object-spread": "^4.0.0", + "chalk": "^2.1.0", + "magic-string": "^0.22.4", + "minimist": "^1.2.0", + "os-homedir": "^1.0.1", + "vlq": "^0.2.2" } }, "builtin-modules": { @@ -144,9 +144,9 @@ "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", "dev": true, "requires": { - "ansi-styles": "3.2.0", - "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "ansi-styles": "^3.1.0", + "escape-string-regexp": "^1.0.5", + "supports-color": "^4.0.0" } }, "color-convert": { @@ -155,7 +155,7 @@ "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", "dev": true, "requires": { - "color-name": "1.1.3" + "color-name": "^1.1.1" } }, "color-name": { @@ -176,6 +176,68 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "d": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "requires": { + "es5-ext": "^0.10.9" + } + }, + "es5-ext": { + "version": "0.10.46", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.46.tgz", + "integrity": "sha512-24XxRvJXNFwEMpJb3nOkiRJKRoupmjYmOPVlI65Qy2SrtxwOTB+g6ODjBKOtwEHbYrhWRty9xxOWLNdClT2djw==", + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.1", + "next-tick": "1" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-map": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", + "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", + "requires": { + "d": "1", + "es5-ext": "~0.10.14", + "es6-iterator": "~2.0.1", + "es6-set": "~0.1.5", + "es6-symbol": "~3.1.1", + "event-emitter": "~0.3.5" + } + }, + "es6-set": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", + "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", + "requires": { + "d": "1", + "es5-ext": "~0.10.14", + "es6-iterator": "~2.0.1", + "es6-symbol": "3.1.1", + "event-emitter": "~0.3.5" + } + }, + "es6-symbol": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -188,13 +250,22 @@ "integrity": "sha1-5rGlHPcpJSTnI3wxLl/mZgwc4ao=", "dev": true }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, "expand-brackets": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", "dev": true, "requires": { - "is-posix-bracket": "0.1.1" + "is-posix-bracket": "^0.1.0" } }, "expand-range": { @@ -203,7 +274,7 @@ "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", "dev": true, "requires": { - "fill-range": "2.2.3" + "fill-range": "^2.1.0" } }, "extglob": { @@ -212,7 +283,7 @@ "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", "dev": true, "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } }, "filename-regex": { @@ -222,16 +293,43 @@ "dev": true }, "fill-range": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", - "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", "dev": true, "requires": { - "is-number": "2.1.0", - "isobject": "2.1.0", - "randomatic": "1.1.7", - "repeat-element": "1.1.2", - "repeat-string": "1.6.1" + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "randomatic": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", + "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", + "dev": true, + "requires": { + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } + } + } } }, "flow-remove-types-no-whitespace": { @@ -240,8 +338,8 @@ "integrity": "sha1-PSl5haC+1Rl7j7DL6J7BY/jeqes=", "dev": true, "requires": { - "babylon": "6.18.0", - "magic-string": "0.16.0" + "babylon": "^6.8.4", + "magic-string": "^0.16.0" }, "dependencies": { "magic-string": { @@ -250,7 +348,7 @@ "integrity": "sha1-lw67DacZMwEoX7GqZQ85vdgetFo=", "dev": true, "requires": { - "vlq": "0.2.3" + "vlq": "^0.2.1" } } } @@ -267,7 +365,7 @@ "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", "dev": true, "requires": { - "for-in": "1.0.2" + "for-in": "^1.0.1" } }, "glob-base": { @@ -276,8 +374,8 @@ "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", "dev": true, "requires": { - "glob-parent": "2.0.0", - "is-glob": "2.0.1" + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" } }, "glob-parent": { @@ -286,7 +384,7 @@ "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", "dev": true, "requires": { - "is-glob": "2.0.1" + "is-glob": "^2.0.0" } }, "has-flag": { @@ -313,7 +411,7 @@ "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", "dev": true, "requires": { - "is-primitive": "2.0.0" + "is-primitive": "^2.0.0" } }, "is-extendable": { @@ -334,7 +432,7 @@ "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "dev": true, "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } }, "is-module": { @@ -349,7 +447,7 @@ "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" } }, "is-posix-bracket": { @@ -385,13 +483,13 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } }, "lodash": { - "version": "4.17.4", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" }, "magic-string": { "version": "0.22.4", @@ -399,28 +497,34 @@ "integrity": "sha512-kxBL06p6iO2qPBHsqGK2b3cRwiRGpnmSuVWNhwHcMX7qJOUr1HvricYP1LZOCdkQBUp0jiWg2d6WJwR3vYgByw==", "dev": true, "requires": { - "vlq": "0.2.3" + "vlq": "^0.2.1" } }, + "math-random": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", + "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", + "dev": true + }, "micromatch": { "version": "2.3.11", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", "dev": true, "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.4" + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" } }, "minimatch": { @@ -429,7 +533,7 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.8" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -438,13 +542,18 @@ "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" + }, "normalize-path": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", "dev": true, "requires": { - "remove-trailing-separator": "1.1.0" + "remove-trailing-separator": "^1.0.1" } }, "object.omit": { @@ -453,8 +562,8 @@ "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", "dev": true, "requires": { - "for-own": "0.1.5", - "is-extendable": "0.1.1" + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" } }, "os-homedir": { @@ -469,10 +578,10 @@ "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", "dev": true, "requires": { - "glob-base": "0.3.0", - "is-dotfile": "1.0.3", - "is-extglob": "1.0.0", - "is-glob": "2.0.1" + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" } }, "path-parse": { @@ -487,54 +596,13 @@ "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", "dev": true }, - "randomatic": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", - "dev": true, - "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, "regex-cache": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", "dev": true, "requires": { - "is-equal-shallow": "0.1.3" + "is-equal-shallow": "^0.1.3" } }, "remove-trailing-separator": { @@ -561,7 +629,7 @@ "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", "dev": true, "requires": { - "path-parse": "1.0.5" + "path-parse": "^1.0.5" } }, "rollup": { @@ -576,8 +644,8 @@ "integrity": "sha512-rd3JG2MxvQXfg5coCw0IyZV8QrsceVI4zfJgGVgkUnntwp+gnjv7TsKWGKGoLNMGAMRKQlhcsSyvUuvOL+vNHw==", "dev": true, "requires": { - "buble": "0.18.0", - "rollup-pluginutils": "2.0.1" + "buble": "^0.18.0", + "rollup-pluginutils": "^2.0.1" } }, "rollup-plugin-commonjs": { @@ -586,11 +654,11 @@ "integrity": "sha512-qK0+uhktmnAgZkHkqFuajNmPw93fjrO7+CysDaxWE5jrUR9XSlSvuao5ZJP+XizxA8weakhgYYBtbVz9SGBpjA==", "dev": true, "requires": { - "acorn": "5.2.1", - "estree-walker": "0.5.1", - "magic-string": "0.22.4", - "resolve": "1.5.0", - "rollup-pluginutils": "2.0.1" + "acorn": "^5.2.1", + "estree-walker": "^0.5.0", + "magic-string": "^0.22.4", + "resolve": "^1.4.0", + "rollup-pluginutils": "^2.0.1" }, "dependencies": { "estree-walker": { @@ -607,8 +675,8 @@ "integrity": "sha1-vUuhvNma1biCNNcubi2s6pqgLRY=", "dev": true, "requires": { - "flow-remove-types-no-whitespace": "1.0.5", - "rollup-pluginutils": "1.5.2" + "flow-remove-types-no-whitespace": "^1.0.3", + "rollup-pluginutils": "^1.5.2" }, "dependencies": { "estree-walker": { @@ -623,8 +691,8 @@ "integrity": "sha1-HhVud4+UtyVb+hs9AXi+j1xVJAg=", "dev": true, "requires": { - "estree-walker": "0.2.1", - "minimatch": "3.0.4" + "estree-walker": "^0.2.1", + "minimatch": "^3.0.2" } } } @@ -635,10 +703,10 @@ "integrity": "sha1-i4l8TDAw1QASd7BRSyXSygloPuA=", "dev": true, "requires": { - "browser-resolve": "1.11.2", - "builtin-modules": "1.1.1", - "is-module": "1.0.0", - "resolve": "1.5.0" + "browser-resolve": "^1.11.0", + "builtin-modules": "^1.1.0", + "is-module": "^1.0.0", + "resolve": "^1.1.6" } }, "rollup-plugin-replace": { @@ -647,9 +715,9 @@ "integrity": "sha512-pK9mTd/FNrhtBxcTBXoh0YOwRIShV0gGhv9qvUtNcXHxIMRZMXqfiZKVBmCRGp8/2DJRy62z2JUE7/5tP6WxOQ==", "dev": true, "requires": { - "magic-string": "0.22.4", - "minimatch": "3.0.4", - "rollup-pluginutils": "2.0.1" + "magic-string": "^0.22.4", + "minimatch": "^3.0.2", + "rollup-pluginutils": "^2.0.1" } }, "rollup-plugin-strip": { @@ -658,10 +726,10 @@ "integrity": "sha1-uWXZyqWXHWJu0bcD7nPTQh4/79E=", "dev": true, "requires": { - "acorn": "3.3.0", - "estree-walker": "0.2.1", - "magic-string": "0.15.2", - "rollup-pluginutils": "1.5.2" + "acorn": "^3.1.0", + "estree-walker": "^0.2.1", + "magic-string": "^0.15.0", + "rollup-pluginutils": "^1.3.1" }, "dependencies": { "acorn": { @@ -682,7 +750,7 @@ "integrity": "sha1-BoHXOIdBu8Ot2qZQYJkmJMbAnpw=", "dev": true, "requires": { - "vlq": "0.2.3" + "vlq": "^0.2.1" } }, "rollup-pluginutils": { @@ -691,8 +759,8 @@ "integrity": "sha1-HhVud4+UtyVb+hs9AXi+j1xVJAg=", "dev": true, "requires": { - "estree-walker": "0.2.1", - "minimatch": "3.0.4" + "estree-walker": "^0.2.1", + "minimatch": "^3.0.2" } } } @@ -703,8 +771,8 @@ "integrity": "sha1-fslbNXP2VDpGpkYb2afFRFJdD8A=", "dev": true, "requires": { - "estree-walker": "0.3.1", - "micromatch": "2.3.11" + "estree-walker": "^0.3.0", + "micromatch": "^2.3.11" } }, "source-map": { @@ -719,7 +787,7 @@ "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "^2.0.0" } }, "uglify-js": { @@ -728,8 +796,8 @@ "integrity": "sha512-BhZTJPmOKPSUcjnx2nlfaOQKHLyjjT4HFyzFWF1BUErx9knJNpdW94ql5o8qVxeNL+8IAWjEjnPvASH2yZnkMg==", "dev": true, "requires": { - "commander": "2.12.2", - "source-map": "0.6.1" + "commander": "~2.12.1", + "source-map": "~0.6.1" } }, "vlq": { diff --git a/package.json b/package.json index 9d2db5f..e959819 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,8 @@ "author": "wangpin", "license": "MIT", "dependencies": { - "lodash": "^4.17.4" + "es6-map": "^0.1.5", + "lodash": "^4.17.11" }, "peerDependencies": { "vue": "^2.1.4" diff --git a/src/index.js b/src/index.js index 7b8227c..45b7d38 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,8 @@ import _isObject from 'lodash/isObject' import _isFunction from 'lodash/isFunction' import dom from './domEvent' +import * as _ from 'es6-map/implement' + const vuescroll = new Object;