UNPKG

vue-long-list

Version:
1,127 lines (948 loc) 35.2 kB
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["VueLongList"] = factory(); else root["VueLongList"] = factory(); })(this, function() { return /******/ (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] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ // Flag the module as loaded /******/ module.loaded = 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; /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.LongListItem = exports.LongList = undefined; var _longList = __webpack_require__(1); var _longList2 = _interopRequireDefault(_longList); var _longListItem = __webpack_require__(41); var _longListItem2 = _interopRequireDefault(_longListItem); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.LongList = _longList2.default; exports.LongListItem = _longListItem2.default; /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { var __vue_script__, __vue_template__ var __vue_styles__ = {} __vue_script__ = __webpack_require__(2) if (Object.keys(__vue_script__).some(function (key) { return key !== "default" && key !== "__esModule" })) { console.warn("[vue-loader] src/components/long-list.vue: named exports in *.vue files are ignored.")} __vue_template__ = __webpack_require__(40) module.exports = __vue_script__ || {} if (module.exports.__esModule) module.exports = module.exports.default var __vue_options__ = typeof module.exports === "function" ? (module.exports.options || (module.exports.options = {})) : module.exports if (__vue_template__) { __vue_options__.template = __vue_template__ } if (!__vue_options__.computed) __vue_options__.computed = {} Object.keys(__vue_styles__).forEach(function (key) { var module = __vue_styles__[key] __vue_options__.computed[key] = function () { return module } }) if (false) {(function () { module.hot.accept() var hotAPI = require("vue-hot-reload-api") hotAPI.install(require("vue"), false) if (!hotAPI.compatible) return var id = "_v-20b15aa4/long-list.vue" if (!module.hot.data) { hotAPI.createRecord(id, module.exports) } else { hotAPI.update(id, module.exports, __vue_template__) } })()} /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _assign = __webpack_require__(3); var _assign2 = _interopRequireDefault(_assign); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // <template lang="html"> // <div :style="upholderStyle" v-el:upholder> // <div :class="itemsCtnClass" :style="slidingBlockStyle" v-el:sliding-block> // <slot></slot> // </div> // </div> // </template> // // <script> var SCROLL_START_MAP = { x: 'scrollLeft', y: 'scrollTop' }; var SCROLL_SIZE_MAP = { x: 'scrollWidth', y: 'scrollHeight' }; // offset start is relative to offset parent node // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetTop var OFFSET_START_MAP = { x: 'offsetLeft', y: 'offsetTop' }; // offset size includes border, padding, and scrollbar // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight var OFFSET_SIZE_MAP = { x: 'offsetWidth', y: 'offsetHeight' }; // client size is including CSS padding, CSS width/height, but not scrollbar // https://developer.mozilla.org/en-US/docs/Web/API/Element/clientHeight var CLIENT_SIZE_MAP = { x: 'clientWidth', y: 'clientHeight' }; // inner size only exist on `window` object, // `window.innerHeight` = height of window viewport + horizontal scrollbar // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerHeight var INNER_SIZE_MAP = { x: 'innerWidth', y: 'innerHeight' }; var OVERFLOW_MAP = { x: 'overflowX', y: 'overflowY' }; var DEFAULT_ITEMS_PER_ROW = 1; var DEFAULT_UNIFORM_SIZE_PER_ROW = 0; var noop = function noop() {}; var requestAnimationFrame = window.requestAnimationFrame || noop; exports.default = { props: { mode: { type: String, default: 'uniform', // currently only support mode uniform validator: function validator(mode) { return mode === 'uniform'; } }, length: { required: true, type: Number, validator: function validator(length) { return length >= 0; } }, renderStart: { required: true, type: Number, twoWay: true, validator: function validator(renderStart) { return renderStart >= 0; } }, renderLength: { required: true, type: Number, twoWay: true, validator: function validator(renderLength) { return renderLength >= 0; } }, // the number of pixels to buffer at both beginning and end of rendered // items bufferZone: { type: Number, default: 200 }, axis: { type: String, default: 'y', // currently only support y axis validator: function validator(axis) { return axis === 'y'; } }, scrollParentProvider: { type: Function }, itemsCtnStyle: { type: Object }, itemsCtnClass: { type: Object }, proxyScrollHandler: { type: Function } }, data: function data() { return { itemsPerRow: DEFAULT_ITEMS_PER_ROW, uniformSizePerRow: DEFAULT_UNIFORM_SIZE_PER_ROW }; }, watch: { length: function length() { // for the case that `length` changes from 0 to a positive number. this.updateRowInfo(); // otherwise, at the case that `length` is less than real items per row // at begin, `renderLength` have no chance to update // because the list is too short to be scrollable. this.updateFrame(); }, // support change `proxyScrollHandler` after render <long-list>, // for example, you can apply different debounce policies according to // the length of list. proxyScrollHandler: function proxyScrollHandler(_proxyScrollHandler) { var scrollParent = this.scrollParent; var scrollHandler = this.scrollHandler; if (!scrollParent) return; scrollParent.removeEventListener('scroll', scrollHandler, false); this.scrollHandler = scrollHandler = _proxyScrollHandler(this.updateFrame); scrollParent.addEventListener('scroll', scrollHandler, false); } }, computed: { upholderStyle: function upholderStyle() { var mode = this.mode, length = this.length; var height = 'auto'; if (mode === 'uniform') { var itemsPerRow = this.itemsPerRow, uniformSizePerRow = this.uniformSizePerRow; if (itemsPerRow >= 1 && uniformSizePerRow > 0) { height = Math.ceil(length / itemsPerRow) * uniformSizePerRow; height = height + 'px'; } } return { height: height, // make upholder as offset parent of item elements. // https://developer.mozilla.org/en-US/docs/Web/API/HTMLelement/offsetParent position: 'relative' }; }, slidingBlockStyle: function slidingBlockStyle() { var axis = this.axis, offset = this.slidingBlockOffset, itemsCtnStyle = this.itemsCtnStyle; var x = axis === 'x' ? offset : 0; var y = axis === 'y' ? offset : 0; var transform = 'translate(' + x + 'px, ' + y + 'px)'; var slidingBlockStyle = { msTransform: transform, WebkitTransform: transform, transform: transform }; return itemsCtnStyle ? (0, _assign2.default)(slidingBlockStyle, itemsCtnStyle) : slidingBlockStyle; }, slidingBlockOffset: function slidingBlockOffset() { var mode = this.mode; var offset = 0; if (mode === 'uniform') { var renderStart = this.renderStart, itemsPerRow = this.itemsPerRow, uniformSizePerRow = this.uniformSizePerRow; if (itemsPerRow >= 1 && uniformSizePerRow > 0) { offset = Math.floor(renderStart / itemsPerRow) * uniformSizePerRow; } } return offset; } }, created: function created() { var axis = this.axis; this.OFFSET_START = OFFSET_START_MAP[axis]; this.OFFSET_SIZE = OFFSET_SIZE_MAP[axis]; this.SCROLL_START = SCROLL_START_MAP[axis]; this.SCROLL_SIZE = SCROLL_SIZE_MAP[axis]; this.CLIENT_SIZE = CLIENT_SIZE_MAP[axis]; this.INNER_SIZE = INNER_SIZE_MAP[axis]; this.OVERFLOW = OVERFLOW_MAP[axis]; }, ready: function ready() { this.scrollParent = this.calcScrollParent(); this.updateRowInfo(); this.updateFrame(); var proxyScrollHandler = this.proxyScrollHandler; this.scrollHandler = proxyScrollHandler ? proxyScrollHandler(this.updateFrame) : this.updateFrame; this.scrollParent.addEventListener('scroll', this.scrollHandler, false); }, methods: { updateRowInfo: function updateRowInfo() { var mode = this.mode; var oldItemsPerRow = this.itemsPerRow; var newItemsPerRow = this.updateItemsPerRow(); if (oldItemsPerRow === newItemsPerRow) { // re-calc `itemsPerRow` before repaint, i.e. after render tree updated, // because the re-calc needs access DOM. // otherwise cause the bug that upholder get wrong height in the case // that `length` change from 1 to 2 and first row's items count is // greater than 2. requestAnimationFrame(this.updateItemsPerRow); } if (mode === 'uniform') { this.uniformSizePerRow = this.calcUniformSizePerRow(); } }, // only use this method to update `itemsPerRow` updateItemsPerRow: function updateItemsPerRow() { return this.itemsPerRow = this.calcItemsPerRow(); }, // @return {Number} // we assume that every row has the same count of items, // call this method after component DOM ready. calcItemsPerRow: function calcItemsPerRow() { var firstItemEl = this.getItemEl(0); if (!firstItemEl) return DEFAULT_ITEMS_PER_ROW; var OFFSET_START = this.OFFSET_START; var firstItemOffsetStart = firstItemEl[OFFSET_START]; if (!isNumber(firstItemOffsetStart)) return DEFAULT_ITEMS_PER_ROW; var i = 1; var itemEl = void 0; while ((itemEl = this.getItemEl(i)) && itemEl[OFFSET_START] === firstItemOffsetStart) { i++; } return i; }, // @return {Number} // call this method after component DOM ready. calcUniformSizePerRow: function calcUniformSizePerRow() { var firstItemEl = this.getItemEl(0); if (!firstItemEl) return DEFAULT_UNIFORM_SIZE_PER_ROW; var OFFSET_SIZE = this.OFFSET_SIZE; var firstItemOffsetSize = firstItemEl[OFFSET_SIZE]; return isNumber(firstItemOffsetSize) ? firstItemOffsetSize : DEFAULT_UNIFORM_SIZE_PER_ROW; }, getItemEl: function getItemEl(i) { var item = this.$children[i]; if (!item) return null; return item.getChildEl(); }, updateFrame: function updateFrame() { switch (this.mode) { case 'uniform': return this.updateUniformFrame.apply(this, arguments); } }, updateUniformFrame: function updateUniformFrame() { var OFFSET_START = this.OFFSET_START, OFFSET_SIZE = this.OFFSET_SIZE, SCROLL_START = this.SCROLL_START, SCROLL_SIZE = this.SCROLL_SIZE, length = this.length, bufferZone = this.bufferZone, itemsPerRow = this.itemsPerRow, uniformSizePerRow = this.uniformSizePerRow, slidingBlockOffset = this.slidingBlockOffset; if (uniformSizePerRow <= 0) return; var renderStart = this.renderStart, renderLength = this.renderLength; var renderEnd = renderStart + renderLength - 1; var slidingBlock = this.$els.slidingBlock; var scrollParentScrollStart = this.getScrollParentScrollStart(); var scrollParentScrollEnd = // always re-calc size for the case of resize scroll parent scrollParentScrollStart + this.getScrollParentSize(); var secondRowOffsetStart = slidingBlockOffset + uniformSizePerRow; var lastSecondRowOffsetEnd = slidingBlockOffset + slidingBlock[OFFSET_SIZE] - uniformSizePerRow; // change `renderStart` to make second row offset start always locating // at start buffer zone if (scrollParentScrollStart - bufferZone > secondRowOffsetStart) { // it's likely moving content upwarding, so remove items as many as // possible from head buffer zone. renderStart += Math.floor((scrollParentScrollStart - secondRowOffsetStart) / uniformSizePerRow) * itemsPerRow; } else if (scrollParentScrollStart < secondRowOffsetStart) { // it's linkly moving content downwarding, so fill items as many as // possible into head buffer zone. renderStart -= Math.floor((secondRowOffsetStart - scrollParentScrollStart + bufferZone) / uniformSizePerRow) * itemsPerRow; } // change `renderEnd` to make last second row offset end always locating // at start buffer zone if (scrollParentScrollEnd > lastSecondRowOffsetEnd) { // it's likely moving content upwarding, so fill items as many as // possible into head buffer zone. renderEnd += Math.floor((scrollParentScrollEnd + bufferZone - lastSecondRowOffsetEnd) / uniformSizePerRow) * itemsPerRow; } else if (scrollParentScrollEnd + bufferZone < lastSecondRowOffsetEnd) { // it's likely moving content downwarding, so remove items as many as // possible from tail buffer zone. renderEnd -= Math.floor((lastSecondRowOffsetEnd - scrollParentScrollEnd) / uniformSizePerRow) * itemsPerRow; } this.safeUpdateRenderRange(renderStart, renderEnd); }, safeUpdateRenderRange: function safeUpdateRenderRange(renderStart, renderEnd) { var length = this.length, itemsPerRow = this.itemsPerRow; var FIX_LENGTH = itemsPerRow * 10; if (renderStart >= length) renderStart = length - FIX_LENGTH; var mode = renderStart % itemsPerRow; // fix `renderStart` to the first item of one row if (mode !== 0) renderStart -= mode; if (renderStart < 0) renderStart = 0; if (renderEnd < renderStart) renderEnd = renderStart + FIX_LENGTH - 1; // fix `renderEnd` to the last item of one row mode = renderEnd % itemsPerRow; if (mode !== itemsPerRow - 1) renderEnd += itemsPerRow - mode - 1; if (renderEnd >= length) renderEnd = length - 1; this.renderStart = renderStart; this.renderLength = renderEnd - renderStart + 1; }, // scroll parent is who trigger scroll event. calcScrollParent: function calcScrollParent() { var axis = this.axis, scrollParentProvider = this.scrollParentProvider; if (scrollParentProvider) return scrollParentProvider(); var OVERFLOW = this.OVERFLOW; var el = this.$el; while (el = el.parentElement) { switch (getComputedStyle(el)[OVERFLOW]) { case 'auto': case 'scroll': case 'overlay': return el; } } return window; }, // `window` can trigger scroll event, but it has no property `SCROLL_START`, // but you can pick the same info from `document.body` or // `document.documentElement`. getScrollParentScrollStart: function getScrollParentScrollStart() { var SCROLL_START = this.SCROLL_START, scrollParent = this.scrollParent; return scrollParent === window ? // On Firefox, `document.body[SCROLL_START]` always is 0, // on Chrome/Safari, `document.documentElement[SCROLL_START]` // always is 0. document.body[SCROLL_START] || document.documentElement[SCROLL_START] : scrollParent[SCROLL_START]; }, getScrollParentSize: function getScrollParentSize() { var INNER_SIZE = this.INNER_SIZE, CLIENT_SIZE = this.CLIENT_SIZE, scrollParent = this.scrollParent; return scrollParent[scrollParent === window ? INNER_SIZE : CLIENT_SIZE]; } } }; function isNumber(val) { return typeof val === 'number'; } function isPositiveNumber(val) { return isNumber(val) && val > 0; } // </script> /***/ }, /* 3 */ /***/ function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(4), __esModule: true }; /***/ }, /* 4 */ /***/ function(module, exports, __webpack_require__) { __webpack_require__(5); module.exports = __webpack_require__(8).Object.assign; /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { // 19.1.3.1 Object.assign(target, source) var $export = __webpack_require__(6); $export($export.S + $export.F, 'Object', {assign: __webpack_require__(21)}); /***/ }, /* 6 */ /***/ function(module, exports, __webpack_require__) { var global = __webpack_require__(7) , core = __webpack_require__(8) , ctx = __webpack_require__(9) , hide = __webpack_require__(11) , PROTOTYPE = 'prototype'; var $export = function(type, name, source){ var IS_FORCED = type & $export.F , IS_GLOBAL = type & $export.G , IS_STATIC = type & $export.S , IS_PROTO = type & $export.P , IS_BIND = type & $export.B , IS_WRAP = type & $export.W , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) , expProto = exports[PROTOTYPE] , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE] , 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; /***/ }, /* 7 */ /***/ 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 : Function('return this')(); if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef /***/ }, /* 8 */ /***/ function(module, exports) { var core = module.exports = {version: '2.4.0'}; if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef /***/ }, /* 9 */ /***/ function(module, exports, __webpack_require__) { // optional / simple context binding var aFunction = __webpack_require__(10); 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); }; }; /***/ }, /* 10 */ /***/ function(module, exports) { module.exports = function(it){ if(typeof it != 'function')throw TypeError(it + ' is not a function!'); return it; }; /***/ }, /* 11 */ /***/ function(module, exports, __webpack_require__) { var dP = __webpack_require__(12) , createDesc = __webpack_require__(20); module.exports = __webpack_require__(16) ? function(object, key, value){ return dP.f(object, key, createDesc(1, value)); } : function(object, key, value){ object[key] = value; return object; }; /***/ }, /* 12 */ /***/ function(module, exports, __webpack_require__) { var anObject = __webpack_require__(13) , IE8_DOM_DEFINE = __webpack_require__(15) , toPrimitive = __webpack_require__(19) , dP = Object.defineProperty; exports.f = __webpack_require__(16) ? 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; }; /***/ }, /* 13 */ /***/ function(module, exports, __webpack_require__) { var isObject = __webpack_require__(14); module.exports = function(it){ if(!isObject(it))throw TypeError(it + ' is not an object!'); return it; }; /***/ }, /* 14 */ /***/ function(module, exports) { module.exports = function(it){ return typeof it === 'object' ? it !== null : typeof it === 'function'; }; /***/ }, /* 15 */ /***/ function(module, exports, __webpack_require__) { module.exports = !__webpack_require__(16) && !__webpack_require__(17)(function(){ return Object.defineProperty(__webpack_require__(18)('div'), 'a', {get: function(){ return 7; }}).a != 7; }); /***/ }, /* 16 */ /***/ function(module, exports, __webpack_require__) { // Thank's IE8 for his funny defineProperty module.exports = !__webpack_require__(17)(function(){ return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; }); /***/ }, /* 17 */ /***/ function(module, exports) { module.exports = function(exec){ try { return !!exec(); } catch(e){ return true; } }; /***/ }, /* 18 */ /***/ function(module, exports, __webpack_require__) { var isObject = __webpack_require__(14) , document = __webpack_require__(7).document // in old IE typeof document.createElement is 'object' , is = isObject(document) && isObject(document.createElement); module.exports = function(it){ return is ? document.createElement(it) : {}; }; /***/ }, /* 19 */ /***/ function(module, exports, __webpack_require__) { // 7.1.1 ToPrimitive(input [, PreferredType]) var isObject = __webpack_require__(14); // 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"); }; /***/ }, /* 20 */ /***/ function(module, exports) { module.exports = function(bitmap, value){ return { enumerable : !(bitmap & 1), configurable: !(bitmap & 2), writable : !(bitmap & 4), value : value }; }; /***/ }, /* 21 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; // 19.1.2.1 Object.assign(target, source, ...) var getKeys = __webpack_require__(22) , gOPS = __webpack_require__(37) , pIE = __webpack_require__(38) , toObject = __webpack_require__(39) , IObject = __webpack_require__(26) , $assign = Object.assign; // should work with symbols and should have deterministic property order (V8 bug) module.exports = !$assign || __webpack_require__(17)(function(){ var A = {} , B = {} , S = Symbol() , 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) , aLen = arguments.length , index = 1 , getSymbols = gOPS.f , isEnum = pIE.f; while(aLen > index){ var S = IObject(arguments[index++]) , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S) , length = keys.length , j = 0 , key; while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key]; } return T; } : $assign; /***/ }, /* 22 */ /***/ function(module, exports, __webpack_require__) { // 19.1.2.14 / 15.2.3.14 Object.keys(O) var $keys = __webpack_require__(23) , enumBugKeys = __webpack_require__(36); module.exports = Object.keys || function keys(O){ return $keys(O, enumBugKeys); }; /***/ }, /* 23 */ /***/ function(module, exports, __webpack_require__) { var has = __webpack_require__(24) , toIObject = __webpack_require__(25) , arrayIndexOf = __webpack_require__(29)(false) , IE_PROTO = __webpack_require__(33)('IE_PROTO'); module.exports = function(object, names){ var O = toIObject(object) , i = 0 , result = [] , 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; }; /***/ }, /* 24 */ /***/ function(module, exports) { var hasOwnProperty = {}.hasOwnProperty; module.exports = function(it, key){ return hasOwnProperty.call(it, key); }; /***/ }, /* 25 */ /***/ function(module, exports, __webpack_require__) { // to indexed object, toObject with fallback for non-array-like ES3 strings var IObject = __webpack_require__(26) , defined = __webpack_require__(28); module.exports = function(it){ return IObject(defined(it)); }; /***/ }, /* 26 */ /***/ function(module, exports, __webpack_require__) { // fallback for non-array-like ES3 and non-enumerable old V8 strings var cof = __webpack_require__(27); module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ return cof(it) == 'String' ? it.split('') : Object(it); }; /***/ }, /* 27 */ /***/ function(module, exports) { var toString = {}.toString; module.exports = function(it){ return toString.call(it).slice(8, -1); }; /***/ }, /* 28 */ /***/ 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; }; /***/ }, /* 29 */ /***/ function(module, exports, __webpack_require__) { // false -> Array#indexOf // true -> Array#includes var toIObject = __webpack_require__(25) , toLength = __webpack_require__(30) , toIndex = __webpack_require__(32); module.exports = function(IS_INCLUDES){ return function($this, el, fromIndex){ var O = toIObject($this) , length = toLength(O.length) , index = toIndex(fromIndex, length) , value; // Array#includes uses SameValueZero equality algorithm if(IS_INCLUDES && el != el)while(length > index){ value = O[index++]; if(value != value)return true; // Array#toIndex 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; }; }; /***/ }, /* 30 */ /***/ function(module, exports, __webpack_require__) { // 7.1.15 ToLength var toInteger = __webpack_require__(31) , min = Math.min; module.exports = function(it){ return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 }; /***/ }, /* 31 */ /***/ function(module, exports) { // 7.1.4 ToInteger var ceil = Math.ceil , floor = Math.floor; module.exports = function(it){ return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); }; /***/ }, /* 32 */ /***/ function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(31) , max = Math.max , min = Math.min; module.exports = function(index, length){ index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); }; /***/ }, /* 33 */ /***/ function(module, exports, __webpack_require__) { var shared = __webpack_require__(34)('keys') , uid = __webpack_require__(35); module.exports = function(key){ return shared[key] || (shared[key] = uid(key)); }; /***/ }, /* 34 */ /***/ function(module, exports, __webpack_require__) { var global = __webpack_require__(7) , SHARED = '__core-js_shared__' , store = global[SHARED] || (global[SHARED] = {}); module.exports = function(key){ return store[key] || (store[key] = {}); }; /***/ }, /* 35 */ /***/ function(module, exports) { var id = 0 , px = Math.random(); module.exports = function(key){ return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); }; /***/ }, /* 36 */ /***/ function(module, exports) { // IE 8- don't enum bug keys module.exports = ( 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' ).split(','); /***/ }, /* 37 */ /***/ function(module, exports) { exports.f = Object.getOwnPropertySymbols; /***/ }, /* 38 */ /***/ function(module, exports) { exports.f = {}.propertyIsEnumerable; /***/ }, /* 39 */ /***/ function(module, exports, __webpack_require__) { // 7.1.13 ToObject(argument) var defined = __webpack_require__(28); module.exports = function(it){ return Object(defined(it)); }; /***/ }, /* 40 */ /***/ function(module, exports) { module.exports = "\n<div :style=\"upholderStyle\" v-el:upholder>\n <div :class=\"itemsCtnClass\" :style=\"slidingBlockStyle\" v-el:sliding-block>\n <slot></slot>\n </div>\n</div>\n"; /***/ }, /* 41 */ /***/ function(module, exports, __webpack_require__) { var __vue_script__, __vue_template__ var __vue_styles__ = {} __vue_script__ = __webpack_require__(42) if (Object.keys(__vue_script__).some(function (key) { return key !== "default" && key !== "__esModule" })) { console.warn("[vue-loader] src/components/long-list-item.vue: named exports in *.vue files are ignored.")} __vue_template__ = __webpack_require__(43) module.exports = __vue_script__ || {} if (module.exports.__esModule) module.exports = module.exports.default var __vue_options__ = typeof module.exports === "function" ? (module.exports.options || (module.exports.options = {})) : module.exports if (__vue_template__) { __vue_options__.template = __vue_template__ } if (!__vue_options__.computed) __vue_options__.computed = {} Object.keys(__vue_styles__).forEach(function (key) { var module = __vue_styles__[key] __vue_options__.computed[key] = function () { return module } }) if (false) {(function () { module.hot.accept() var hotAPI = require("vue-hot-reload-api") hotAPI.install(require("vue"), false) if (!hotAPI.compatible) return var id = "_v-64f825fc/long-list-item.vue" if (!module.hot.data) { hotAPI.createRecord(id, module.exports) } else { hotAPI.update(id, module.exports, __vue_template__) } })()} /***/ }, /* 42 */ /***/ function(module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // <template lang="html"> // <slot></slot> // </template> // // <script> exports.default = { created: function created() { this.cache = {}; }, methods: { getChildEl: function getChildEl() { var childEl = this.cache.childEl; if (childEl) return childEl; childEl = this.$el; // `this` maybe fragment instance // http://v1.vuejs.org/guide/components.html#Fragment-Instance while (childEl.nodeType !== Node.ELEMENT_NODE) { childEl = childEl.nextElementSibling; } return this.cache.childEl = childEl; } } }; // @param {String} partialHeight May be empty string if element has not mounted // on DOM. var reduceSizeParts = function reduceSizeParts(outerHeight, partialHeight) { partialHeight = parseFloat(partialHeight); partialHeight = partialHeight ? partialHeight : 0; return outerHeight + partialHeight; }; // </script> /***/ }, /* 43 */ /***/ function(module, exports) { module.exports = "\n<slot></slot>\n"; /***/ } /******/ ]) }); ; //# sourceMappingURL=vue-long-list.js.map