Skip to content

Commit

Permalink
Release v2.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
tangbc committed Sep 6, 2021
1 parent 97f7f6e commit 83ee782
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 14 deletions.
86 changes: 73 additions & 13 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-virtual-scroll-list v2.3.2
* vue-virtual-scroll-list v2.3.3
* open source under the MIT license
* https://github.com/tangbc/vue-virtual-scroll-list#readme
*/
Expand Down Expand Up @@ -34,6 +34,55 @@
return Constructor;
}

function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}

return obj;
}

function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);

if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}

return keys;
}

function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};

if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}

return target;
}

function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
Expand Down Expand Up @@ -81,7 +130,7 @@
FIXED: 'FIXED',
DYNAMIC: 'DYNAMIC'
};
var LEADING_BUFFER = 2;
var LEADING_BUFFER = 0;

var Virtual = /*#__PURE__*/function () {
function Virtual(param, callUpdate) {
Expand Down Expand Up @@ -536,6 +585,9 @@
component: {
type: [Object, Function]
},
slotComponent: {
type: Function
},
uniqueKey: {
type: [String, Number]
},
Expand All @@ -561,10 +613,6 @@
}
};

/**
* item and slot component both use similar wrapper
* we need to know their size change at any time
*/
var Wrapper = {
created: function created() {
this.shapeKey = this.horizontal ? 'offsetWidth' : 'offsetHeight';
Expand Down Expand Up @@ -609,18 +657,28 @@
_this$extraProps = this.extraProps,
extraProps = _this$extraProps === void 0 ? {} : _this$extraProps,
index = this.index,
source = this.source,
_this$scopedSlots = this.scopedSlots,
scopedSlots = _this$scopedSlots === void 0 ? {} : _this$scopedSlots,
uniqueKey = this.uniqueKey;
extraProps.source = this.source;
extraProps.index = index;
uniqueKey = this.uniqueKey,
slotComponent = this.slotComponent;

var props = _objectSpread2({}, extraProps, {
source: source,
index: index
});

return h(tag, {
key: uniqueKey,
attrs: {
role: 'listitem'
}
}, [h(component, {
props: extraProps,
}, [slotComponent ? h('div', slotComponent({
item: source,
index: index,
scope: props
})) : h(component, {
props: props,
scopedSlots: scopedSlots
})]);
}
Expand Down Expand Up @@ -649,9 +707,9 @@
SLOT: 'slot_resize'
};
var SLOT_TYPE = {
HEADER: 'header',
HEADER: 'thead',
// string value also use for aria role attribute
FOOTER: 'footer'
FOOTER: 'tfoot'
};
var VirtualList = Vue.component('virtual-list', {
props: VirtualProps,
Expand Down Expand Up @@ -894,6 +952,7 @@
extraProps = this.extraProps,
dataComponent = this.dataComponent,
itemScopedSlots = this.itemScopedSlots;
var slotComponent = this.$scopedSlots && this.$scopedSlots.item;

for (var index = start; index <= end; index++) {
var dataSource = dataSources[index];
Expand All @@ -912,6 +971,7 @@
source: dataSource,
extraProps: extraProps,
component: dataComponent,
slotComponent: slotComponent,
scopedSlots: itemScopedSlots
},
style: itemStyle,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-virtual-scroll-list",
"version": "2.3.2",
"version": "2.3.3",
"description": "A vue component support big amount data list with high scroll performance.",
"main": "dist/index.js",
"files": [
Expand Down

0 comments on commit 83ee782

Please sign in to comment.