UNPKG

vscroll

Version:
70 lines 1.42 kB
export class Item { get uid() { return this.container.uid; } set uid(value) { this.container.uid = value; } get $index() { return this.container.$index; } set $index(value) { this.container.$index = value; } get data() { return this.container.data; } set data(value) { this.container.data = value; } get element() { return this.container.element; } set element(value) { this.container.element = value; } constructor($index, data, routines) { this.container = { uid: Item.nextUid++, $index, data }; this.nodeId = String($index); this.routines = routines; this.invisible = true; this.toRemove = false; this.toInsert = false; } dispose() { delete this.container.element; } setSize(preSize = 0) { this.preSize = preSize; if (this.element) { this.size = this.routines.getSize(this.element); } } makeVisible() { this.routines.makeElementVisible(this.element); this.invisible = false; } hide() { if (this.element) { this.routines.hideElement(this.element); } } scrollTo(argument) { if (this.element) { this.routines.scrollTo(this.element, argument); } } updateIndex(index) { this.$index = index; this.nodeId = String(index); } get() { return this.container; } } Item.nextUid = 1; //# sourceMappingURL=item.js.map