vscroll
Version:
Virtual scroll engine
77 lines • 1.96 kB
JavaScript
var Item = /** @class */ (function () {
function Item($index, data, routines) {
this.container = {
$index: $index,
data: data
};
this.nodeId = String($index);
this.routines = routines;
this.invisible = true;
this.toRemove = false;
this.toInsert = false;
}
Object.defineProperty(Item.prototype, "$index", {
get: function () {
return this.container.$index;
},
set: function (value) {
this.container.$index = value;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Item.prototype, "data", {
get: function () {
return this.container.data;
},
set: function (value) {
this.container.data = value;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Item.prototype, "element", {
get: function () {
return this.container.element;
},
set: function (value) {
this.container.element = value;
},
enumerable: false,
configurable: true
});
Item.prototype.dispose = function () {
delete this.container.element;
};
Item.prototype.setSize = function (preSize) {
if (preSize === void 0) { preSize = 0; }
this.preSize = preSize;
if (this.element) {
this.size = this.routines.getSize(this.element);
}
};
Item.prototype.makeVisible = function () {
this.routines.makeElementVisible(this.element);
this.invisible = false;
};
Item.prototype.hide = function () {
if (this.element) {
this.routines.hideElement(this.element);
}
};
Item.prototype.scrollTo = function (argument) {
if (this.element) {
this.routines.scrollTo(this.element, argument);
}
};
Item.prototype.updateIndex = function (index) {
this.$index = index;
this.nodeId = String(index);
};
Item.prototype.get = function () {
return this.container;
};
return Item;
}());
export { Item };
//# sourceMappingURL=item.js.map