diff --git a/bower.json b/bower.json index 16e9280..37b6463 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-ui-virtualization", - "version": "0.4.4", + "version": "0.4.5", "description": "A plugin that provides a virtualized repeater and other virtualization services.", "keywords": [ "aurelia", diff --git a/dist/amd/array-virtual-repeat-strategy.js b/dist/amd/array-virtual-repeat-strategy.js index edc62ad..737dee0 100644 --- a/dist/amd/array-virtual-repeat-strategy.js +++ b/dist/amd/array-virtual-repeat-strategy.js @@ -1,4 +1,4 @@ -define(['exports', 'aurelia-templating-resources/array-repeat-strategy', 'aurelia-templating-resources/repeat-utilities', './utilities'], function (exports, _arrayRepeatStrategy, _repeatUtilities, _utilities) { +define(['exports', 'aurelia-templating-resources', './utilities'], function (exports, _aureliaTemplatingResources, _utilities) { 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -46,7 +46,7 @@ define(['exports', 'aurelia-templating-resources/array-repeat-strategy', 'aureli } ArrayVirtualRepeatStrategy.prototype.createFirstItem = function createFirstItem(repeat) { - var overrideContext = (0, _repeatUtilities.createFullOverrideContext)(repeat, repeat.items[0], 0, 1); + var overrideContext = (0, _aureliaTemplatingResources.createFullOverrideContext)(repeat, repeat.items[0], 0, 1); repeat.addView(overrideContext.bindingContext, overrideContext); }; @@ -56,7 +56,7 @@ define(['exports', 'aurelia-templating-resources/array-repeat-strategy', 'aureli ArrayVirtualRepeatStrategy.prototype._standardProcessInstanceChanged = function _standardProcessInstanceChanged(repeat, items) { for (var i = 1, ii = repeat._viewsLength; i < ii; ++i) { - var overrideContext = (0, _repeatUtilities.createFullOverrideContext)(repeat, items[i], i, ii); + var overrideContext = (0, _aureliaTemplatingResources.createFullOverrideContext)(repeat, items[i], i, ii); repeat.addView(overrideContext.bindingContext, overrideContext); } }; @@ -90,7 +90,7 @@ define(['exports', 'aurelia-templating-resources/array-repeat-strategy', 'aureli var minLength = Math.min(repeat._viewsLength, items.length); for (var _i = viewsLength; _i < minLength; _i++) { - var overrideContext = (0, _repeatUtilities.createFullOverrideContext)(repeat, items[_i], _i, itemsLength); + var overrideContext = (0, _aureliaTemplatingResources.createFullOverrideContext)(repeat, items[_i], _i, itemsLength); repeat.addView(overrideContext.bindingContext, overrideContext); } }; @@ -145,8 +145,9 @@ define(['exports', 'aurelia-templating-resources/array-repeat-strategy', 'aureli for (var i = 0, ii = splices.length; i < ii; ++i) { var splice = splices[i]; var removed = splice.removed; - for (var j = 0, jj = removed.length; j < jj; ++j) { - var viewOrPromise = this._removeViewAt(repeat, splice.index + removeDelta + rmPromises.length, true); + var removedLength = removed.length; + for (var j = 0, jj = removedLength; j < jj; ++j) { + var viewOrPromise = this._removeViewAt(repeat, splice.index + removeDelta + rmPromises.length, true, j, removedLength); if (viewOrPromise instanceof Promise) { rmPromises.push(viewOrPromise); } @@ -164,12 +165,18 @@ define(['exports', 'aurelia-templating-resources/array-repeat-strategy', 'aureli (0, _utilities.updateVirtualOverrideContexts)(repeat, 0); }; - ArrayVirtualRepeatStrategy.prototype._removeViewAt = function _removeViewAt(repeat, collectionIndex, returnToCache) { + ArrayVirtualRepeatStrategy.prototype._removeViewAt = function _removeViewAt(repeat, collectionIndex, returnToCache, j, removedLength) { var viewOrPromise = void 0; var view = void 0; var viewSlot = repeat.viewSlot; var viewCount = repeat.viewCount(); var viewAddIndex = void 0; + var removeMoreThanInDom = removedLength > viewCount; + if (repeat._viewsLength <= j) { + repeat._bottomBufferHeight = repeat._bottomBufferHeight - repeat.itemHeight; + repeat._adjustBufferHeights(); + return; + } if (!this._isIndexBeforeViewSlot(repeat, viewSlot, collectionIndex) && !this._isIndexAfterViewSlot(repeat, viewSlot, collectionIndex)) { var viewIndex = this._getViewIndex(repeat, viewSlot, collectionIndex); @@ -178,7 +185,12 @@ define(['exports', 'aurelia-templating-resources/array-repeat-strategy', 'aureli var collectionAddIndex = void 0; if (repeat._bottomBufferHeight > repeat.itemHeight) { viewAddIndex = viewCount; - collectionAddIndex = repeat._getIndexOfLastView() + 1; + if (!removeMoreThanInDom) { + var lastViewItem = repeat._getLastViewItem(); + collectionAddIndex = repeat.items.indexOf(lastViewItem) + 1; + } else { + collectionAddIndex = j; + } repeat._bottomBufferHeight = repeat._bottomBufferHeight - repeat.itemHeight; } else if (repeat._topBufferHeight > 0) { viewAddIndex = 0; @@ -187,12 +199,10 @@ define(['exports', 'aurelia-templating-resources/array-repeat-strategy', 'aureli } var data = repeat.items[collectionAddIndex]; if (data) { - var overrideContext = (0, _repeatUtilities.createFullOverrideContext)(repeat, repeat.items[collectionAddIndex], collectionAddIndex, repeat.items.length); + var overrideContext = (0, _aureliaTemplatingResources.createFullOverrideContext)(repeat, data, collectionAddIndex, repeat.items.length); view = repeat.viewFactory.create(); view.bind(overrideContext.bindingContext, overrideContext); } - } else { - return viewOrPromise; } } else if (this._isIndexBeforeViewSlot(repeat, viewSlot, collectionIndex)) { if (repeat._bottomBufferHeight > 0) { @@ -210,11 +220,9 @@ define(['exports', 'aurelia-templating-resources/array-repeat-strategy', 'aureli repeat.viewSlot.insert(viewAddIndex, view); repeat._adjustBufferHeights(); }); - return undefined; } else if (view) { repeat.viewSlot.insert(viewAddIndex, view); } - repeat._adjustBufferHeights(); }; @@ -247,7 +255,7 @@ define(['exports', 'aurelia-templating-resources/array-repeat-strategy', 'aureli for (; addIndex < end; ++addIndex) { var hasDistanceToBottomViewPort = (0, _utilities.getElementDistanceToBottomViewPort)(repeat.viewStrategy.getLastElement(repeat.bottomBuffer)) > 0; if (repeat.viewCount() === 0 || !this._isIndexBeforeViewSlot(repeat, viewSlot, addIndex) && !this._isIndexAfterViewSlot(repeat, viewSlot, addIndex) || hasDistanceToBottomViewPort) { - var overrideContext = (0, _repeatUtilities.createFullOverrideContext)(repeat, array[addIndex], addIndex, arrayLength); + var overrideContext = (0, _aureliaTemplatingResources.createFullOverrideContext)(repeat, array[addIndex], addIndex, arrayLength); repeat.insertView(addIndex, overrideContext.bindingContext, overrideContext); if (!repeat._hasCalculatedSizes) { repeat._calcInitialHeights(1); @@ -273,5 +281,5 @@ define(['exports', 'aurelia-templating-resources/array-repeat-strategy', 'aureli }; return ArrayVirtualRepeatStrategy; - }(_arrayRepeatStrategy.ArrayRepeatStrategy); + }(_aureliaTemplatingResources.ArrayRepeatStrategy); }); \ No newline at end of file diff --git a/dist/amd/aurelia-ui-virtualization.d.ts b/dist/amd/aurelia-ui-virtualization.d.ts index b089233..782b825 100644 --- a/dist/amd/aurelia-ui-virtualization.d.ts +++ b/dist/amd/aurelia-ui-virtualization.d.ts @@ -1,21 +1,19 @@ declare module 'aurelia-ui-virtualization' { import { updateOverrideContext, + ArrayRepeatStrategy, createFullOverrideContext, + RepeatStrategyLocator, + AbstractRepeater, getItemsSourceExpression, isOneTime, unwrapExpression, - updateOneTimeBinding - } from 'aurelia-templating-resources/repeat-utilities'; - import { - ArrayRepeatStrategy - } from 'aurelia-templating-resources/array-repeat-strategy'; + updateOneTimeBinding, + viewsRequireLifecycle + } from 'aurelia-templating-resources'; import { DOM } from 'aurelia-pal'; - import { - RepeatStrategyLocator - } from 'aurelia-templating-resources/repeat-strategy-locator'; import { inject } from 'aurelia-dependency-injection'; @@ -31,12 +29,6 @@ declare module 'aurelia-ui-virtualization' { bindable, templateController } from 'aurelia-templating'; - import { - AbstractRepeater - } from 'aurelia-templating-resources'; - import { - viewsRequireLifecycle - } from 'aurelia-templating-resources/analyze-view-factory'; export interface ViewStrategy { getScrollContainer(element: Element): Element; moveViewFirst(view: View, topBuffer: Element): void; diff --git a/dist/amd/utilities.js b/dist/amd/utilities.js index 0252f6f..d466e09 100644 --- a/dist/amd/utilities.js +++ b/dist/amd/utilities.js @@ -1,4 +1,4 @@ -define(['exports', 'aurelia-templating-resources/repeat-utilities'], function (exports, _repeatUtilities) { +define(['exports', 'aurelia-templating-resources'], function (exports, _aureliaTemplatingResources) { 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -48,14 +48,14 @@ define(['exports', 'aurelia-templating-resources/repeat-utilities'], function (e var delta = repeat._topBufferHeight / repeat.itemHeight; for (; startIndex < viewLength; ++startIndex) { - (0, _repeatUtilities.updateOverrideContext)(views[startIndex].overrideContext, startIndex + delta, collectionLength); + (0, _aureliaTemplatingResources.updateOverrideContext)(views[startIndex].overrideContext, startIndex + delta, collectionLength); } } function rebindAndMoveView(repeat, view, index, moveToBottom) { var items = repeat.items; var viewSlot = repeat.viewSlot; - (0, _repeatUtilities.updateOverrideContext)(view.overrideContext, index, items.length); + (0, _aureliaTemplatingResources.updateOverrideContext)(view.overrideContext, index, items.length); view.bindingContext[repeat.local] = items[index]; if (moveToBottom) { viewSlot.children.push(viewSlot.children.shift()); diff --git a/dist/amd/virtual-repeat-strategy-locator.js b/dist/amd/virtual-repeat-strategy-locator.js index ca4570d..c1e9ab6 100644 --- a/dist/amd/virtual-repeat-strategy-locator.js +++ b/dist/amd/virtual-repeat-strategy-locator.js @@ -1,4 +1,4 @@ -define(['exports', 'aurelia-templating-resources/repeat-strategy-locator', './array-virtual-repeat-strategy'], function (exports, _repeatStrategyLocator, _arrayVirtualRepeatStrategy) { +define(['exports', 'aurelia-templating-resources', './array-virtual-repeat-strategy'], function (exports, _aureliaTemplatingResources, _arrayVirtualRepeatStrategy) { 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -54,5 +54,5 @@ define(['exports', 'aurelia-templating-resources/repeat-strategy-locator', './ar } return VirtualRepeatStrategyLocator; - }(_repeatStrategyLocator.RepeatStrategyLocator); + }(_aureliaTemplatingResources.RepeatStrategyLocator); }); \ No newline at end of file diff --git a/dist/amd/virtual-repeat.js b/dist/amd/virtual-repeat.js index 4e5cfd2..f716a08 100644 --- a/dist/amd/virtual-repeat.js +++ b/dist/amd/virtual-repeat.js @@ -1,4 +1,4 @@ -define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-templating', 'aurelia-templating-resources', 'aurelia-templating-resources/repeat-utilities', 'aurelia-templating-resources/analyze-view-factory', 'aurelia-pal', './utilities', './dom-helper', './virtual-repeat-strategy-locator', './view-strategy'], function (exports, _aureliaDependencyInjection, _aureliaBinding, _aureliaTemplating, _aureliaTemplatingResources, _repeatUtilities, _analyzeViewFactory, _aureliaPal, _utilities, _domHelper, _virtualRepeatStrategyLocator, _viewStrategy) { +define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-templating', 'aurelia-templating-resources', 'aurelia-pal', './utilities', './dom-helper', './virtual-repeat-strategy-locator', './view-strategy'], function (exports, _aureliaDependencyInjection, _aureliaBinding, _aureliaTemplating, _aureliaTemplatingResources, _aureliaPal, _utilities, _domHelper, _virtualRepeatStrategyLocator, _viewStrategy) { 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -89,7 +89,7 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-t var _this = _possibleConstructorReturn(this, _AbstractRepeater.call(this, { local: 'item', - viewsRequireLifecycle: (0, _analyzeViewFactory.viewsRequireLifecycle)(viewFactory) + viewsRequireLifecycle: (0, _aureliaTemplatingResources.viewsRequireLifecycle)(viewFactory) })); _this._first = 0; @@ -120,8 +120,8 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-t _this.observerLocator = observerLocator; _this.strategyLocator = strategyLocator; _this.viewStrategyLocator = viewStrategyLocator; - _this.sourceExpression = (0, _repeatUtilities.getItemsSourceExpression)(_this.instruction, 'virtual-repeat.for'); - _this.isOneTime = (0, _repeatUtilities.isOneTime)(_this.sourceExpression); + _this.sourceExpression = (0, _aureliaTemplatingResources.getItemsSourceExpression)(_this.instruction, 'virtual-repeat.for'); + _this.isOneTime = (0, _aureliaTemplatingResources.isOneTime)(_this.sourceExpression); _this.domHelper = domHelper; return _this; } @@ -382,7 +382,21 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-t }; VirtualRepeat.prototype._getIndexOfLastView = function _getIndexOfLastView() { - return this.view(this.viewCount() - 1).overrideContext.$index; + var view = this.view(this.viewCount() - 1); + if (view) { + return view.overrideContext.$index; + } + + return -1; + }; + + VirtualRepeat.prototype._getLastViewItem = function _getLastViewItem() { + var children = this.viewSlot.children; + if (!children.length) { + return undefined; + } + var lastViewItem = children[children.length - 1].bindingContext[this.local]; + return lastViewItem; }; VirtualRepeat.prototype._getIndexOfFirstView = function _getIndexOfFirstView() { @@ -439,7 +453,7 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-t }; VirtualRepeat.prototype._getInnerCollection = function _getInnerCollection() { - var expression = (0, _repeatUtilities.unwrapExpression)(this.sourceExpression); + var expression = (0, _aureliaTemplatingResources.unwrapExpression)(this.sourceExpression); if (!expression) { return null; } @@ -490,14 +504,14 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-t VirtualRepeat.prototype.updateBindings = function updateBindings(view) { var j = view.bindings.length; while (j--) { - (0, _repeatUtilities.updateOneTimeBinding)(view.bindings[j]); + (0, _aureliaTemplatingResources.updateOneTimeBinding)(view.bindings[j]); } j = view.controllers.length; while (j--) { var k = view.controllers[j].boundProperties.length; while (k--) { var binding = view.controllers[j].boundProperties[k].binding; - (0, _repeatUtilities.updateOneTimeBinding)(binding); + (0, _aureliaTemplatingResources.updateOneTimeBinding)(binding); } } }; diff --git a/dist/aurelia-ui-virtualization.d.ts b/dist/aurelia-ui-virtualization.d.ts index b089233..782b825 100644 --- a/dist/aurelia-ui-virtualization.d.ts +++ b/dist/aurelia-ui-virtualization.d.ts @@ -1,21 +1,19 @@ declare module 'aurelia-ui-virtualization' { import { updateOverrideContext, + ArrayRepeatStrategy, createFullOverrideContext, + RepeatStrategyLocator, + AbstractRepeater, getItemsSourceExpression, isOneTime, unwrapExpression, - updateOneTimeBinding - } from 'aurelia-templating-resources/repeat-utilities'; - import { - ArrayRepeatStrategy - } from 'aurelia-templating-resources/array-repeat-strategy'; + updateOneTimeBinding, + viewsRequireLifecycle + } from 'aurelia-templating-resources'; import { DOM } from 'aurelia-pal'; - import { - RepeatStrategyLocator - } from 'aurelia-templating-resources/repeat-strategy-locator'; import { inject } from 'aurelia-dependency-injection'; @@ -31,12 +29,6 @@ declare module 'aurelia-ui-virtualization' { bindable, templateController } from 'aurelia-templating'; - import { - AbstractRepeater - } from 'aurelia-templating-resources'; - import { - viewsRequireLifecycle - } from 'aurelia-templating-resources/analyze-view-factory'; export interface ViewStrategy { getScrollContainer(element: Element): Element; moveViewFirst(view: View, topBuffer: Element): void; diff --git a/dist/aurelia-ui-virtualization.js b/dist/aurelia-ui-virtualization.js index eaec254..d5c39bc 100644 --- a/dist/aurelia-ui-virtualization.js +++ b/dist/aurelia-ui-virtualization.js @@ -1,12 +1,8 @@ -import {updateOverrideContext,createFullOverrideContext,getItemsSourceExpression,isOneTime,unwrapExpression,updateOneTimeBinding} from 'aurelia-templating-resources/repeat-utilities'; -import {ArrayRepeatStrategy} from 'aurelia-templating-resources/array-repeat-strategy'; +import {updateOverrideContext,ArrayRepeatStrategy,createFullOverrideContext,RepeatStrategyLocator,AbstractRepeater,getItemsSourceExpression,isOneTime,unwrapExpression,updateOneTimeBinding,viewsRequireLifecycle} from 'aurelia-templating-resources'; import {DOM} from 'aurelia-pal'; -import {RepeatStrategyLocator} from 'aurelia-templating-resources/repeat-strategy-locator'; import {inject} from 'aurelia-dependency-injection'; import {ObserverLocator} from 'aurelia-binding'; import {BoundViewFactory,ViewSlot,ViewResources,TargetInstruction,customAttribute,bindable,templateController} from 'aurelia-templating'; -import {AbstractRepeater} from 'aurelia-templating-resources'; -import {viewsRequireLifecycle} from 'aurelia-templating-resources/analyze-view-factory'; export class DomHelper { getElementDistanceToTopOfDocument(element: Element): number { @@ -205,8 +201,9 @@ export class ArrayVirtualRepeatStrategy extends ArrayRepeatStrategy { for (let i = 0, ii = splices.length; i < ii; ++i) { let splice = splices[i]; let removed = splice.removed; - for (let j = 0, jj = removed.length; j < jj; ++j) { - let viewOrPromise = this._removeViewAt(repeat, splice.index + removeDelta + rmPromises.length, true); + let removedLength = removed.length; + for (let j = 0, jj = removedLength; j < jj; ++j) { + let viewOrPromise = this._removeViewAt(repeat, splice.index + removeDelta + rmPromises.length, true, j, removedLength); if (viewOrPromise instanceof Promise) { rmPromises.push(viewOrPromise); } @@ -224,12 +221,19 @@ export class ArrayVirtualRepeatStrategy extends ArrayRepeatStrategy { updateVirtualOverrideContexts(repeat, 0); } - _removeViewAt(repeat: VirtualRepeat, collectionIndex: number, returnToCache: boolean): any { + _removeViewAt(repeat: VirtualRepeat, collectionIndex: number, returnToCache: boolean, j: number, removedLength: number): any { let viewOrPromise; let view; let viewSlot = repeat.viewSlot; let viewCount = repeat.viewCount(); let viewAddIndex; + let removeMoreThanInDom = removedLength > viewCount; + if (repeat._viewsLength <= j) { + repeat._bottomBufferHeight = repeat._bottomBufferHeight - (repeat.itemHeight); + repeat._adjustBufferHeights(); + return; + } + // index in view slot? if (!this._isIndexBeforeViewSlot(repeat, viewSlot, collectionIndex) && !this._isIndexAfterViewSlot(repeat, viewSlot, collectionIndex)) { let viewIndex = this._getViewIndex(repeat, viewSlot, collectionIndex); @@ -239,7 +243,12 @@ export class ArrayVirtualRepeatStrategy extends ArrayRepeatStrategy { let collectionAddIndex; if (repeat._bottomBufferHeight > repeat.itemHeight) { viewAddIndex = viewCount; - collectionAddIndex = repeat._getIndexOfLastView() + 1; + if (!removeMoreThanInDom) { + let lastViewItem = repeat._getLastViewItem(); + collectionAddIndex = repeat.items.indexOf(lastViewItem) + 1; + } else { + collectionAddIndex = j; + } repeat._bottomBufferHeight = repeat._bottomBufferHeight - (repeat.itemHeight); } else if (repeat._topBufferHeight > 0) { viewAddIndex = 0; @@ -248,12 +257,10 @@ export class ArrayVirtualRepeatStrategy extends ArrayRepeatStrategy { } let data = repeat.items[collectionAddIndex]; if (data) { - let overrideContext = createFullOverrideContext(repeat, repeat.items[collectionAddIndex], collectionAddIndex, repeat.items.length); + let overrideContext = createFullOverrideContext(repeat, data, collectionAddIndex, repeat.items.length); view = repeat.viewFactory.create(); view.bind(overrideContext.bindingContext, overrideContext); } - } else { - return viewOrPromise; } } else if (this._isIndexBeforeViewSlot(repeat, viewSlot, collectionIndex)) { if (repeat._bottomBufferHeight > 0) { @@ -271,11 +278,9 @@ export class ArrayVirtualRepeatStrategy extends ArrayRepeatStrategy { repeat.viewSlot.insert(viewAddIndex, view); repeat._adjustBufferHeights(); }); - return undefined; } else if (view) { repeat.viewSlot.insert(viewAddIndex, view); } - repeat._adjustBufferHeights(); } @@ -760,7 +765,21 @@ export class VirtualRepeat extends AbstractRepeater { } _getIndexOfLastView(): number { - return this.view(this.viewCount() - 1).overrideContext.$index; + const view = this.view(this.viewCount() - 1); + if (view) { + return view.overrideContext.$index; + } + + return -1; + } + + _getLastViewItem() { + let children = this.viewSlot.children; + if (!children.length) { + return undefined; + } + let lastViewItem = children[children.length - 1].bindingContext[this.local]; + return lastViewItem; } _getIndexOfFirstView(): number { diff --git a/dist/commonjs/array-virtual-repeat-strategy.js b/dist/commonjs/array-virtual-repeat-strategy.js index 958846b..8b5f3b4 100644 --- a/dist/commonjs/array-virtual-repeat-strategy.js +++ b/dist/commonjs/array-virtual-repeat-strategy.js @@ -5,9 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.ArrayVirtualRepeatStrategy = undefined; -var _arrayRepeatStrategy = require('aurelia-templating-resources/array-repeat-strategy'); - -var _repeatUtilities = require('aurelia-templating-resources/repeat-utilities'); +var _aureliaTemplatingResources = require('aurelia-templating-resources'); var _utilities = require('./utilities'); @@ -27,7 +25,7 @@ var ArrayVirtualRepeatStrategy = exports.ArrayVirtualRepeatStrategy = function ( } ArrayVirtualRepeatStrategy.prototype.createFirstItem = function createFirstItem(repeat) { - var overrideContext = (0, _repeatUtilities.createFullOverrideContext)(repeat, repeat.items[0], 0, 1); + var overrideContext = (0, _aureliaTemplatingResources.createFullOverrideContext)(repeat, repeat.items[0], 0, 1); repeat.addView(overrideContext.bindingContext, overrideContext); }; @@ -37,7 +35,7 @@ var ArrayVirtualRepeatStrategy = exports.ArrayVirtualRepeatStrategy = function ( ArrayVirtualRepeatStrategy.prototype._standardProcessInstanceChanged = function _standardProcessInstanceChanged(repeat, items) { for (var i = 1, ii = repeat._viewsLength; i < ii; ++i) { - var overrideContext = (0, _repeatUtilities.createFullOverrideContext)(repeat, items[i], i, ii); + var overrideContext = (0, _aureliaTemplatingResources.createFullOverrideContext)(repeat, items[i], i, ii); repeat.addView(overrideContext.bindingContext, overrideContext); } }; @@ -71,7 +69,7 @@ var ArrayVirtualRepeatStrategy = exports.ArrayVirtualRepeatStrategy = function ( var minLength = Math.min(repeat._viewsLength, items.length); for (var _i = viewsLength; _i < minLength; _i++) { - var overrideContext = (0, _repeatUtilities.createFullOverrideContext)(repeat, items[_i], _i, itemsLength); + var overrideContext = (0, _aureliaTemplatingResources.createFullOverrideContext)(repeat, items[_i], _i, itemsLength); repeat.addView(overrideContext.bindingContext, overrideContext); } }; @@ -126,8 +124,9 @@ var ArrayVirtualRepeatStrategy = exports.ArrayVirtualRepeatStrategy = function ( for (var i = 0, ii = splices.length; i < ii; ++i) { var splice = splices[i]; var removed = splice.removed; - for (var j = 0, jj = removed.length; j < jj; ++j) { - var viewOrPromise = this._removeViewAt(repeat, splice.index + removeDelta + rmPromises.length, true); + var removedLength = removed.length; + for (var j = 0, jj = removedLength; j < jj; ++j) { + var viewOrPromise = this._removeViewAt(repeat, splice.index + removeDelta + rmPromises.length, true, j, removedLength); if (viewOrPromise instanceof Promise) { rmPromises.push(viewOrPromise); } @@ -145,12 +144,18 @@ var ArrayVirtualRepeatStrategy = exports.ArrayVirtualRepeatStrategy = function ( (0, _utilities.updateVirtualOverrideContexts)(repeat, 0); }; - ArrayVirtualRepeatStrategy.prototype._removeViewAt = function _removeViewAt(repeat, collectionIndex, returnToCache) { + ArrayVirtualRepeatStrategy.prototype._removeViewAt = function _removeViewAt(repeat, collectionIndex, returnToCache, j, removedLength) { var viewOrPromise = void 0; var view = void 0; var viewSlot = repeat.viewSlot; var viewCount = repeat.viewCount(); var viewAddIndex = void 0; + var removeMoreThanInDom = removedLength > viewCount; + if (repeat._viewsLength <= j) { + repeat._bottomBufferHeight = repeat._bottomBufferHeight - repeat.itemHeight; + repeat._adjustBufferHeights(); + return; + } if (!this._isIndexBeforeViewSlot(repeat, viewSlot, collectionIndex) && !this._isIndexAfterViewSlot(repeat, viewSlot, collectionIndex)) { var viewIndex = this._getViewIndex(repeat, viewSlot, collectionIndex); @@ -159,7 +164,12 @@ var ArrayVirtualRepeatStrategy = exports.ArrayVirtualRepeatStrategy = function ( var collectionAddIndex = void 0; if (repeat._bottomBufferHeight > repeat.itemHeight) { viewAddIndex = viewCount; - collectionAddIndex = repeat._getIndexOfLastView() + 1; + if (!removeMoreThanInDom) { + var lastViewItem = repeat._getLastViewItem(); + collectionAddIndex = repeat.items.indexOf(lastViewItem) + 1; + } else { + collectionAddIndex = j; + } repeat._bottomBufferHeight = repeat._bottomBufferHeight - repeat.itemHeight; } else if (repeat._topBufferHeight > 0) { viewAddIndex = 0; @@ -168,12 +178,10 @@ var ArrayVirtualRepeatStrategy = exports.ArrayVirtualRepeatStrategy = function ( } var data = repeat.items[collectionAddIndex]; if (data) { - var overrideContext = (0, _repeatUtilities.createFullOverrideContext)(repeat, repeat.items[collectionAddIndex], collectionAddIndex, repeat.items.length); + var overrideContext = (0, _aureliaTemplatingResources.createFullOverrideContext)(repeat, data, collectionAddIndex, repeat.items.length); view = repeat.viewFactory.create(); view.bind(overrideContext.bindingContext, overrideContext); } - } else { - return viewOrPromise; } } else if (this._isIndexBeforeViewSlot(repeat, viewSlot, collectionIndex)) { if (repeat._bottomBufferHeight > 0) { @@ -191,11 +199,9 @@ var ArrayVirtualRepeatStrategy = exports.ArrayVirtualRepeatStrategy = function ( repeat.viewSlot.insert(viewAddIndex, view); repeat._adjustBufferHeights(); }); - return undefined; } else if (view) { repeat.viewSlot.insert(viewAddIndex, view); } - repeat._adjustBufferHeights(); }; @@ -228,7 +234,7 @@ var ArrayVirtualRepeatStrategy = exports.ArrayVirtualRepeatStrategy = function ( for (; addIndex < end; ++addIndex) { var hasDistanceToBottomViewPort = (0, _utilities.getElementDistanceToBottomViewPort)(repeat.viewStrategy.getLastElement(repeat.bottomBuffer)) > 0; if (repeat.viewCount() === 0 || !this._isIndexBeforeViewSlot(repeat, viewSlot, addIndex) && !this._isIndexAfterViewSlot(repeat, viewSlot, addIndex) || hasDistanceToBottomViewPort) { - var overrideContext = (0, _repeatUtilities.createFullOverrideContext)(repeat, array[addIndex], addIndex, arrayLength); + var overrideContext = (0, _aureliaTemplatingResources.createFullOverrideContext)(repeat, array[addIndex], addIndex, arrayLength); repeat.insertView(addIndex, overrideContext.bindingContext, overrideContext); if (!repeat._hasCalculatedSizes) { repeat._calcInitialHeights(1); @@ -254,4 +260,4 @@ var ArrayVirtualRepeatStrategy = exports.ArrayVirtualRepeatStrategy = function ( }; return ArrayVirtualRepeatStrategy; -}(_arrayRepeatStrategy.ArrayRepeatStrategy); \ No newline at end of file +}(_aureliaTemplatingResources.ArrayRepeatStrategy); \ No newline at end of file diff --git a/dist/commonjs/aurelia-ui-virtualization.d.ts b/dist/commonjs/aurelia-ui-virtualization.d.ts index b089233..782b825 100644 --- a/dist/commonjs/aurelia-ui-virtualization.d.ts +++ b/dist/commonjs/aurelia-ui-virtualization.d.ts @@ -1,21 +1,19 @@ declare module 'aurelia-ui-virtualization' { import { updateOverrideContext, + ArrayRepeatStrategy, createFullOverrideContext, + RepeatStrategyLocator, + AbstractRepeater, getItemsSourceExpression, isOneTime, unwrapExpression, - updateOneTimeBinding - } from 'aurelia-templating-resources/repeat-utilities'; - import { - ArrayRepeatStrategy - } from 'aurelia-templating-resources/array-repeat-strategy'; + updateOneTimeBinding, + viewsRequireLifecycle + } from 'aurelia-templating-resources'; import { DOM } from 'aurelia-pal'; - import { - RepeatStrategyLocator - } from 'aurelia-templating-resources/repeat-strategy-locator'; import { inject } from 'aurelia-dependency-injection'; @@ -31,12 +29,6 @@ declare module 'aurelia-ui-virtualization' { bindable, templateController } from 'aurelia-templating'; - import { - AbstractRepeater - } from 'aurelia-templating-resources'; - import { - viewsRequireLifecycle - } from 'aurelia-templating-resources/analyze-view-factory'; export interface ViewStrategy { getScrollContainer(element: Element): Element; moveViewFirst(view: View, topBuffer: Element): void; diff --git a/dist/commonjs/utilities.js b/dist/commonjs/utilities.js index 37d2098..6971c4b 100644 --- a/dist/commonjs/utilities.js +++ b/dist/commonjs/utilities.js @@ -11,7 +11,7 @@ exports.getStyleValue = getStyleValue; exports.getElementDistanceToBottomViewPort = getElementDistanceToBottomViewPort; exports.getElementDistanceToTopViewPort = getElementDistanceToTopViewPort; -var _repeatUtilities = require('aurelia-templating-resources/repeat-utilities'); +var _aureliaTemplatingResources = require('aurelia-templating-resources'); function calcOuterHeight(element) { var height = void 0; @@ -50,14 +50,14 @@ function updateVirtualOverrideContexts(repeat, startIndex) { var delta = repeat._topBufferHeight / repeat.itemHeight; for (; startIndex < viewLength; ++startIndex) { - (0, _repeatUtilities.updateOverrideContext)(views[startIndex].overrideContext, startIndex + delta, collectionLength); + (0, _aureliaTemplatingResources.updateOverrideContext)(views[startIndex].overrideContext, startIndex + delta, collectionLength); } } function rebindAndMoveView(repeat, view, index, moveToBottom) { var items = repeat.items; var viewSlot = repeat.viewSlot; - (0, _repeatUtilities.updateOverrideContext)(view.overrideContext, index, items.length); + (0, _aureliaTemplatingResources.updateOverrideContext)(view.overrideContext, index, items.length); view.bindingContext[repeat.local] = items[index]; if (moveToBottom) { viewSlot.children.push(viewSlot.children.shift()); diff --git a/dist/commonjs/virtual-repeat-strategy-locator.js b/dist/commonjs/virtual-repeat-strategy-locator.js index 1d471c6..dd0fcfd 100644 --- a/dist/commonjs/virtual-repeat-strategy-locator.js +++ b/dist/commonjs/virtual-repeat-strategy-locator.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.VirtualRepeatStrategyLocator = undefined; -var _repeatStrategyLocator = require('aurelia-templating-resources/repeat-strategy-locator'); +var _aureliaTemplatingResources = require('aurelia-templating-resources'); var _arrayVirtualRepeatStrategy = require('./array-virtual-repeat-strategy'); @@ -33,4 +33,4 @@ var VirtualRepeatStrategyLocator = exports.VirtualRepeatStrategyLocator = functi } return VirtualRepeatStrategyLocator; -}(_repeatStrategyLocator.RepeatStrategyLocator); \ No newline at end of file +}(_aureliaTemplatingResources.RepeatStrategyLocator); \ No newline at end of file diff --git a/dist/commonjs/virtual-repeat.js b/dist/commonjs/virtual-repeat.js index 951221a..ec96d19 100644 --- a/dist/commonjs/virtual-repeat.js +++ b/dist/commonjs/virtual-repeat.js @@ -15,10 +15,6 @@ var _aureliaTemplating = require('aurelia-templating'); var _aureliaTemplatingResources = require('aurelia-templating-resources'); -var _repeatUtilities = require('aurelia-templating-resources/repeat-utilities'); - -var _analyzeViewFactory = require('aurelia-templating-resources/analyze-view-factory'); - var _aureliaPal = require('aurelia-pal'); var _utilities = require('./utilities'); @@ -86,7 +82,7 @@ var VirtualRepeat = exports.VirtualRepeat = (_dec = (0, _aureliaTemplating.custo var _this = _possibleConstructorReturn(this, _AbstractRepeater.call(this, { local: 'item', - viewsRequireLifecycle: (0, _analyzeViewFactory.viewsRequireLifecycle)(viewFactory) + viewsRequireLifecycle: (0, _aureliaTemplatingResources.viewsRequireLifecycle)(viewFactory) })); _this._first = 0; @@ -117,8 +113,8 @@ var VirtualRepeat = exports.VirtualRepeat = (_dec = (0, _aureliaTemplating.custo _this.observerLocator = observerLocator; _this.strategyLocator = strategyLocator; _this.viewStrategyLocator = viewStrategyLocator; - _this.sourceExpression = (0, _repeatUtilities.getItemsSourceExpression)(_this.instruction, 'virtual-repeat.for'); - _this.isOneTime = (0, _repeatUtilities.isOneTime)(_this.sourceExpression); + _this.sourceExpression = (0, _aureliaTemplatingResources.getItemsSourceExpression)(_this.instruction, 'virtual-repeat.for'); + _this.isOneTime = (0, _aureliaTemplatingResources.isOneTime)(_this.sourceExpression); _this.domHelper = domHelper; return _this; } @@ -379,7 +375,21 @@ var VirtualRepeat = exports.VirtualRepeat = (_dec = (0, _aureliaTemplating.custo }; VirtualRepeat.prototype._getIndexOfLastView = function _getIndexOfLastView() { - return this.view(this.viewCount() - 1).overrideContext.$index; + var view = this.view(this.viewCount() - 1); + if (view) { + return view.overrideContext.$index; + } + + return -1; + }; + + VirtualRepeat.prototype._getLastViewItem = function _getLastViewItem() { + var children = this.viewSlot.children; + if (!children.length) { + return undefined; + } + var lastViewItem = children[children.length - 1].bindingContext[this.local]; + return lastViewItem; }; VirtualRepeat.prototype._getIndexOfFirstView = function _getIndexOfFirstView() { @@ -436,7 +446,7 @@ var VirtualRepeat = exports.VirtualRepeat = (_dec = (0, _aureliaTemplating.custo }; VirtualRepeat.prototype._getInnerCollection = function _getInnerCollection() { - var expression = (0, _repeatUtilities.unwrapExpression)(this.sourceExpression); + var expression = (0, _aureliaTemplatingResources.unwrapExpression)(this.sourceExpression); if (!expression) { return null; } @@ -487,14 +497,14 @@ var VirtualRepeat = exports.VirtualRepeat = (_dec = (0, _aureliaTemplating.custo VirtualRepeat.prototype.updateBindings = function updateBindings(view) { var j = view.bindings.length; while (j--) { - (0, _repeatUtilities.updateOneTimeBinding)(view.bindings[j]); + (0, _aureliaTemplatingResources.updateOneTimeBinding)(view.bindings[j]); } j = view.controllers.length; while (j--) { var k = view.controllers[j].boundProperties.length; while (k--) { var binding = view.controllers[j].boundProperties[k].binding; - (0, _repeatUtilities.updateOneTimeBinding)(binding); + (0, _aureliaTemplatingResources.updateOneTimeBinding)(binding); } } }; diff --git a/dist/es2015/array-virtual-repeat-strategy.js b/dist/es2015/array-virtual-repeat-strategy.js index e5e9f2d..810e89f 100644 --- a/dist/es2015/array-virtual-repeat-strategy.js +++ b/dist/es2015/array-virtual-repeat-strategy.js @@ -1,5 +1,4 @@ -import { ArrayRepeatStrategy } from 'aurelia-templating-resources/array-repeat-strategy'; -import { createFullOverrideContext } from 'aurelia-templating-resources/repeat-utilities'; +import { ArrayRepeatStrategy, createFullOverrideContext } from 'aurelia-templating-resources'; import { updateVirtualOverrideContexts, rebindAndMoveView, getElementDistanceToBottomViewPort } from './utilities'; export let ArrayVirtualRepeatStrategy = class ArrayVirtualRepeatStrategy extends ArrayRepeatStrategy { @@ -93,8 +92,9 @@ export let ArrayVirtualRepeatStrategy = class ArrayVirtualRepeatStrategy extends for (let i = 0, ii = splices.length; i < ii; ++i) { let splice = splices[i]; let removed = splice.removed; - for (let j = 0, jj = removed.length; j < jj; ++j) { - let viewOrPromise = this._removeViewAt(repeat, splice.index + removeDelta + rmPromises.length, true); + let removedLength = removed.length; + for (let j = 0, jj = removedLength; j < jj; ++j) { + let viewOrPromise = this._removeViewAt(repeat, splice.index + removeDelta + rmPromises.length, true, j, removedLength); if (viewOrPromise instanceof Promise) { rmPromises.push(viewOrPromise); } @@ -112,12 +112,18 @@ export let ArrayVirtualRepeatStrategy = class ArrayVirtualRepeatStrategy extends updateVirtualOverrideContexts(repeat, 0); } - _removeViewAt(repeat, collectionIndex, returnToCache) { + _removeViewAt(repeat, collectionIndex, returnToCache, j, removedLength) { let viewOrPromise; let view; let viewSlot = repeat.viewSlot; let viewCount = repeat.viewCount(); let viewAddIndex; + let removeMoreThanInDom = removedLength > viewCount; + if (repeat._viewsLength <= j) { + repeat._bottomBufferHeight = repeat._bottomBufferHeight - repeat.itemHeight; + repeat._adjustBufferHeights(); + return; + } if (!this._isIndexBeforeViewSlot(repeat, viewSlot, collectionIndex) && !this._isIndexAfterViewSlot(repeat, viewSlot, collectionIndex)) { let viewIndex = this._getViewIndex(repeat, viewSlot, collectionIndex); @@ -126,7 +132,12 @@ export let ArrayVirtualRepeatStrategy = class ArrayVirtualRepeatStrategy extends let collectionAddIndex; if (repeat._bottomBufferHeight > repeat.itemHeight) { viewAddIndex = viewCount; - collectionAddIndex = repeat._getIndexOfLastView() + 1; + if (!removeMoreThanInDom) { + let lastViewItem = repeat._getLastViewItem(); + collectionAddIndex = repeat.items.indexOf(lastViewItem) + 1; + } else { + collectionAddIndex = j; + } repeat._bottomBufferHeight = repeat._bottomBufferHeight - repeat.itemHeight; } else if (repeat._topBufferHeight > 0) { viewAddIndex = 0; @@ -135,12 +146,10 @@ export let ArrayVirtualRepeatStrategy = class ArrayVirtualRepeatStrategy extends } let data = repeat.items[collectionAddIndex]; if (data) { - let overrideContext = createFullOverrideContext(repeat, repeat.items[collectionAddIndex], collectionAddIndex, repeat.items.length); + let overrideContext = createFullOverrideContext(repeat, data, collectionAddIndex, repeat.items.length); view = repeat.viewFactory.create(); view.bind(overrideContext.bindingContext, overrideContext); } - } else { - return viewOrPromise; } } else if (this._isIndexBeforeViewSlot(repeat, viewSlot, collectionIndex)) { if (repeat._bottomBufferHeight > 0) { @@ -158,11 +167,9 @@ export let ArrayVirtualRepeatStrategy = class ArrayVirtualRepeatStrategy extends repeat.viewSlot.insert(viewAddIndex, view); repeat._adjustBufferHeights(); }); - return undefined; } else if (view) { repeat.viewSlot.insert(viewAddIndex, view); } - repeat._adjustBufferHeights(); } diff --git a/dist/es2015/aurelia-ui-virtualization.d.ts b/dist/es2015/aurelia-ui-virtualization.d.ts index b089233..782b825 100644 --- a/dist/es2015/aurelia-ui-virtualization.d.ts +++ b/dist/es2015/aurelia-ui-virtualization.d.ts @@ -1,21 +1,19 @@ declare module 'aurelia-ui-virtualization' { import { updateOverrideContext, + ArrayRepeatStrategy, createFullOverrideContext, + RepeatStrategyLocator, + AbstractRepeater, getItemsSourceExpression, isOneTime, unwrapExpression, - updateOneTimeBinding - } from 'aurelia-templating-resources/repeat-utilities'; - import { - ArrayRepeatStrategy - } from 'aurelia-templating-resources/array-repeat-strategy'; + updateOneTimeBinding, + viewsRequireLifecycle + } from 'aurelia-templating-resources'; import { DOM } from 'aurelia-pal'; - import { - RepeatStrategyLocator - } from 'aurelia-templating-resources/repeat-strategy-locator'; import { inject } from 'aurelia-dependency-injection'; @@ -31,12 +29,6 @@ declare module 'aurelia-ui-virtualization' { bindable, templateController } from 'aurelia-templating'; - import { - AbstractRepeater - } from 'aurelia-templating-resources'; - import { - viewsRequireLifecycle - } from 'aurelia-templating-resources/analyze-view-factory'; export interface ViewStrategy { getScrollContainer(element: Element): Element; moveViewFirst(view: View, topBuffer: Element): void; diff --git a/dist/es2015/utilities.js b/dist/es2015/utilities.js index 237870a..17ec82a 100644 --- a/dist/es2015/utilities.js +++ b/dist/es2015/utilities.js @@ -1,4 +1,4 @@ -import { updateOverrideContext } from 'aurelia-templating-resources/repeat-utilities'; +import { updateOverrideContext } from 'aurelia-templating-resources'; export function calcOuterHeight(element) { let height; diff --git a/dist/es2015/virtual-repeat-strategy-locator.js b/dist/es2015/virtual-repeat-strategy-locator.js index 7b08a88..3ba4816 100644 --- a/dist/es2015/virtual-repeat-strategy-locator.js +++ b/dist/es2015/virtual-repeat-strategy-locator.js @@ -1,4 +1,4 @@ -import { RepeatStrategyLocator } from 'aurelia-templating-resources/repeat-strategy-locator'; +import { RepeatStrategyLocator } from 'aurelia-templating-resources'; import { ArrayVirtualRepeatStrategy } from './array-virtual-repeat-strategy'; export let VirtualRepeatStrategyLocator = class VirtualRepeatStrategyLocator extends RepeatStrategyLocator { diff --git a/dist/es2015/virtual-repeat.js b/dist/es2015/virtual-repeat.js index 008add3..d3f4b7d 100644 --- a/dist/es2015/virtual-repeat.js +++ b/dist/es2015/virtual-repeat.js @@ -46,9 +46,7 @@ function _initializerWarningHelper(descriptor, context) { import { inject } from 'aurelia-dependency-injection'; import { ObserverLocator } from 'aurelia-binding'; import { BoundViewFactory, ViewSlot, ViewResources, TargetInstruction, customAttribute, bindable, templateController } from 'aurelia-templating'; -import { AbstractRepeater } from 'aurelia-templating-resources'; -import { getItemsSourceExpression, isOneTime, unwrapExpression, updateOneTimeBinding } from 'aurelia-templating-resources/repeat-utilities'; -import { viewsRequireLifecycle } from 'aurelia-templating-resources/analyze-view-factory'; +import { AbstractRepeater, getItemsSourceExpression, isOneTime, unwrapExpression, updateOneTimeBinding, viewsRequireLifecycle } from 'aurelia-templating-resources'; import { DOM } from 'aurelia-pal'; import { getStyleValue, calcOuterHeight, rebindAndMoveView } from './utilities'; import { DomHelper } from './dom-helper'; @@ -331,7 +329,21 @@ export let VirtualRepeat = (_dec = customAttribute('virtual-repeat'), _dec2 = in } _getIndexOfLastView() { - return this.view(this.viewCount() - 1).overrideContext.$index; + const view = this.view(this.viewCount() - 1); + if (view) { + return view.overrideContext.$index; + } + + return -1; + } + + _getLastViewItem() { + let children = this.viewSlot.children; + if (!children.length) { + return undefined; + } + let lastViewItem = children[children.length - 1].bindingContext[this.local]; + return lastViewItem; } _getIndexOfFirstView() { diff --git a/dist/system/array-virtual-repeat-strategy.js b/dist/system/array-virtual-repeat-strategy.js index 7f17730..61fe5f0 100644 --- a/dist/system/array-virtual-repeat-strategy.js +++ b/dist/system/array-virtual-repeat-strategy.js @@ -1,6 +1,6 @@ 'use strict'; -System.register(['aurelia-templating-resources/array-repeat-strategy', 'aurelia-templating-resources/repeat-utilities', './utilities'], function (_export, _context) { +System.register(['aurelia-templating-resources', './utilities'], function (_export, _context) { var ArrayRepeatStrategy, createFullOverrideContext, updateVirtualOverrideContexts, rebindAndMoveView, getElementDistanceToBottomViewPort, ArrayVirtualRepeatStrategy; function _classCallCheck(instance, Constructor) { @@ -34,10 +34,9 @@ System.register(['aurelia-templating-resources/array-repeat-strategy', 'aurelia- } return { - setters: [function (_aureliaTemplatingResourcesArrayRepeatStrategy) { - ArrayRepeatStrategy = _aureliaTemplatingResourcesArrayRepeatStrategy.ArrayRepeatStrategy; - }, function (_aureliaTemplatingResourcesRepeatUtilities) { - createFullOverrideContext = _aureliaTemplatingResourcesRepeatUtilities.createFullOverrideContext; + setters: [function (_aureliaTemplatingResources) { + ArrayRepeatStrategy = _aureliaTemplatingResources.ArrayRepeatStrategy; + createFullOverrideContext = _aureliaTemplatingResources.createFullOverrideContext; }, function (_utilities) { updateVirtualOverrideContexts = _utilities.updateVirtualOverrideContexts; rebindAndMoveView = _utilities.rebindAndMoveView; @@ -153,8 +152,9 @@ System.register(['aurelia-templating-resources/array-repeat-strategy', 'aurelia- for (var i = 0, ii = splices.length; i < ii; ++i) { var splice = splices[i]; var removed = splice.removed; - for (var j = 0, jj = removed.length; j < jj; ++j) { - var viewOrPromise = this._removeViewAt(repeat, splice.index + removeDelta + rmPromises.length, true); + var removedLength = removed.length; + for (var j = 0, jj = removedLength; j < jj; ++j) { + var viewOrPromise = this._removeViewAt(repeat, splice.index + removeDelta + rmPromises.length, true, j, removedLength); if (viewOrPromise instanceof Promise) { rmPromises.push(viewOrPromise); } @@ -172,12 +172,18 @@ System.register(['aurelia-templating-resources/array-repeat-strategy', 'aurelia- updateVirtualOverrideContexts(repeat, 0); }; - ArrayVirtualRepeatStrategy.prototype._removeViewAt = function _removeViewAt(repeat, collectionIndex, returnToCache) { + ArrayVirtualRepeatStrategy.prototype._removeViewAt = function _removeViewAt(repeat, collectionIndex, returnToCache, j, removedLength) { var viewOrPromise = void 0; var view = void 0; var viewSlot = repeat.viewSlot; var viewCount = repeat.viewCount(); var viewAddIndex = void 0; + var removeMoreThanInDom = removedLength > viewCount; + if (repeat._viewsLength <= j) { + repeat._bottomBufferHeight = repeat._bottomBufferHeight - repeat.itemHeight; + repeat._adjustBufferHeights(); + return; + } if (!this._isIndexBeforeViewSlot(repeat, viewSlot, collectionIndex) && !this._isIndexAfterViewSlot(repeat, viewSlot, collectionIndex)) { var viewIndex = this._getViewIndex(repeat, viewSlot, collectionIndex); @@ -186,7 +192,12 @@ System.register(['aurelia-templating-resources/array-repeat-strategy', 'aurelia- var collectionAddIndex = void 0; if (repeat._bottomBufferHeight > repeat.itemHeight) { viewAddIndex = viewCount; - collectionAddIndex = repeat._getIndexOfLastView() + 1; + if (!removeMoreThanInDom) { + var lastViewItem = repeat._getLastViewItem(); + collectionAddIndex = repeat.items.indexOf(lastViewItem) + 1; + } else { + collectionAddIndex = j; + } repeat._bottomBufferHeight = repeat._bottomBufferHeight - repeat.itemHeight; } else if (repeat._topBufferHeight > 0) { viewAddIndex = 0; @@ -195,12 +206,10 @@ System.register(['aurelia-templating-resources/array-repeat-strategy', 'aurelia- } var data = repeat.items[collectionAddIndex]; if (data) { - var overrideContext = createFullOverrideContext(repeat, repeat.items[collectionAddIndex], collectionAddIndex, repeat.items.length); + var overrideContext = createFullOverrideContext(repeat, data, collectionAddIndex, repeat.items.length); view = repeat.viewFactory.create(); view.bind(overrideContext.bindingContext, overrideContext); } - } else { - return viewOrPromise; } } else if (this._isIndexBeforeViewSlot(repeat, viewSlot, collectionIndex)) { if (repeat._bottomBufferHeight > 0) { @@ -218,11 +227,9 @@ System.register(['aurelia-templating-resources/array-repeat-strategy', 'aurelia- repeat.viewSlot.insert(viewAddIndex, view); repeat._adjustBufferHeights(); }); - return undefined; } else if (view) { repeat.viewSlot.insert(viewAddIndex, view); } - repeat._adjustBufferHeights(); }; diff --git a/dist/system/aurelia-ui-virtualization.d.ts b/dist/system/aurelia-ui-virtualization.d.ts index b089233..782b825 100644 --- a/dist/system/aurelia-ui-virtualization.d.ts +++ b/dist/system/aurelia-ui-virtualization.d.ts @@ -1,21 +1,19 @@ declare module 'aurelia-ui-virtualization' { import { updateOverrideContext, + ArrayRepeatStrategy, createFullOverrideContext, + RepeatStrategyLocator, + AbstractRepeater, getItemsSourceExpression, isOneTime, unwrapExpression, - updateOneTimeBinding - } from 'aurelia-templating-resources/repeat-utilities'; - import { - ArrayRepeatStrategy - } from 'aurelia-templating-resources/array-repeat-strategy'; + updateOneTimeBinding, + viewsRequireLifecycle + } from 'aurelia-templating-resources'; import { DOM } from 'aurelia-pal'; - import { - RepeatStrategyLocator - } from 'aurelia-templating-resources/repeat-strategy-locator'; import { inject } from 'aurelia-dependency-injection'; @@ -31,12 +29,6 @@ declare module 'aurelia-ui-virtualization' { bindable, templateController } from 'aurelia-templating'; - import { - AbstractRepeater - } from 'aurelia-templating-resources'; - import { - viewsRequireLifecycle - } from 'aurelia-templating-resources/analyze-view-factory'; export interface ViewStrategy { getScrollContainer(element: Element): Element; moveViewFirst(view: View, topBuffer: Element): void; diff --git a/dist/system/utilities.js b/dist/system/utilities.js index 2c051bf..04a792a 100644 --- a/dist/system/utilities.js +++ b/dist/system/utilities.js @@ -1,10 +1,10 @@ 'use strict'; -System.register(['aurelia-templating-resources/repeat-utilities'], function (_export, _context) { +System.register(['aurelia-templating-resources'], function (_export, _context) { var updateOverrideContext; return { - setters: [function (_aureliaTemplatingResourcesRepeatUtilities) { - updateOverrideContext = _aureliaTemplatingResourcesRepeatUtilities.updateOverrideContext; + setters: [function (_aureliaTemplatingResources) { + updateOverrideContext = _aureliaTemplatingResources.updateOverrideContext; }], execute: function () { function calcOuterHeight(element) { diff --git a/dist/system/virtual-repeat-strategy-locator.js b/dist/system/virtual-repeat-strategy-locator.js index 4c04ae3..1a4c277 100644 --- a/dist/system/virtual-repeat-strategy-locator.js +++ b/dist/system/virtual-repeat-strategy-locator.js @@ -1,6 +1,6 @@ 'use strict'; -System.register(['aurelia-templating-resources/repeat-strategy-locator', './array-virtual-repeat-strategy'], function (_export, _context) { +System.register(['aurelia-templating-resources', './array-virtual-repeat-strategy'], function (_export, _context) { var RepeatStrategyLocator, ArrayVirtualRepeatStrategy, VirtualRepeatStrategyLocator; function _classCallCheck(instance, Constructor) { @@ -34,8 +34,8 @@ System.register(['aurelia-templating-resources/repeat-strategy-locator', './arra } return { - setters: [function (_aureliaTemplatingResourcesRepeatStrategyLocator) { - RepeatStrategyLocator = _aureliaTemplatingResourcesRepeatStrategyLocator.RepeatStrategyLocator; + setters: [function (_aureliaTemplatingResources) { + RepeatStrategyLocator = _aureliaTemplatingResources.RepeatStrategyLocator; }, function (_arrayVirtualRepeatStrategy) { ArrayVirtualRepeatStrategy = _arrayVirtualRepeatStrategy.ArrayVirtualRepeatStrategy; }], diff --git a/dist/system/virtual-repeat.js b/dist/system/virtual-repeat.js index a4598d9..fbcce66 100644 --- a/dist/system/virtual-repeat.js +++ b/dist/system/virtual-repeat.js @@ -1,6 +1,6 @@ 'use strict'; -System.register(['aurelia-dependency-injection', 'aurelia-binding', 'aurelia-templating', 'aurelia-templating-resources', 'aurelia-templating-resources/repeat-utilities', 'aurelia-templating-resources/analyze-view-factory', 'aurelia-pal', './utilities', './dom-helper', './virtual-repeat-strategy-locator', './view-strategy'], function (_export, _context) { +System.register(['aurelia-dependency-injection', 'aurelia-binding', 'aurelia-templating', 'aurelia-templating-resources', 'aurelia-pal', './utilities', './dom-helper', './virtual-repeat-strategy-locator', './view-strategy'], function (_export, _context) { var inject, ObserverLocator, BoundViewFactory, ViewSlot, ViewResources, TargetInstruction, customAttribute, bindable, templateController, AbstractRepeater, getItemsSourceExpression, isOneTime, unwrapExpression, updateOneTimeBinding, viewsRequireLifecycle, DOM, getStyleValue, calcOuterHeight, rebindAndMoveView, DomHelper, VirtualRepeatStrategyLocator, ViewStrategyLocator, _dec, _dec2, _class, _desc, _value, _class2, _descriptor, _descriptor2, VirtualRepeat; function _initDefineProp(target, property, descriptor, context) { @@ -91,13 +91,11 @@ System.register(['aurelia-dependency-injection', 'aurelia-binding', 'aurelia-tem templateController = _aureliaTemplating.templateController; }, function (_aureliaTemplatingResources) { AbstractRepeater = _aureliaTemplatingResources.AbstractRepeater; - }, function (_aureliaTemplatingResourcesRepeatUtilities) { - getItemsSourceExpression = _aureliaTemplatingResourcesRepeatUtilities.getItemsSourceExpression; - isOneTime = _aureliaTemplatingResourcesRepeatUtilities.isOneTime; - unwrapExpression = _aureliaTemplatingResourcesRepeatUtilities.unwrapExpression; - updateOneTimeBinding = _aureliaTemplatingResourcesRepeatUtilities.updateOneTimeBinding; - }, function (_aureliaTemplatingResourcesAnalyzeViewFactory) { - viewsRequireLifecycle = _aureliaTemplatingResourcesAnalyzeViewFactory.viewsRequireLifecycle; + getItemsSourceExpression = _aureliaTemplatingResources.getItemsSourceExpression; + isOneTime = _aureliaTemplatingResources.isOneTime; + unwrapExpression = _aureliaTemplatingResources.unwrapExpression; + updateOneTimeBinding = _aureliaTemplatingResources.updateOneTimeBinding; + viewsRequireLifecycle = _aureliaTemplatingResources.viewsRequireLifecycle; }, function (_aureliaPal) { DOM = _aureliaPal.DOM; }, function (_utilities) { @@ -413,7 +411,21 @@ System.register(['aurelia-dependency-injection', 'aurelia-binding', 'aurelia-tem }; VirtualRepeat.prototype._getIndexOfLastView = function _getIndexOfLastView() { - return this.view(this.viewCount() - 1).overrideContext.$index; + var view = this.view(this.viewCount() - 1); + if (view) { + return view.overrideContext.$index; + } + + return -1; + }; + + VirtualRepeat.prototype._getLastViewItem = function _getLastViewItem() { + var children = this.viewSlot.children; + if (!children.length) { + return undefined; + } + var lastViewItem = children[children.length - 1].bindingContext[this.local]; + return lastViewItem; }; VirtualRepeat.prototype._getIndexOfFirstView = function _getIndexOfFirstView() { diff --git a/dist/temp/aurelia-ui-virtualization.js b/dist/temp/aurelia-ui-virtualization.js index 441f595..e715004 100644 --- a/dist/temp/aurelia-ui-virtualization.js +++ b/dist/temp/aurelia-ui-virtualization.js @@ -15,24 +15,16 @@ exports.getStyleValue = getStyleValue; exports.getElementDistanceToBottomViewPort = getElementDistanceToBottomViewPort; exports.getElementDistanceToTopViewPort = getElementDistanceToTopViewPort; -var _repeatUtilities = require('aurelia-templating-resources/repeat-utilities'); - -var _arrayRepeatStrategy = require('aurelia-templating-resources/array-repeat-strategy'); +var _aureliaTemplatingResources = require('aurelia-templating-resources'); var _aureliaPal = require('aurelia-pal'); -var _repeatStrategyLocator = require('aurelia-templating-resources/repeat-strategy-locator'); - var _aureliaDependencyInjection = require('aurelia-dependency-injection'); var _aureliaBinding = require('aurelia-binding'); var _aureliaTemplating = require('aurelia-templating'); -var _aureliaTemplatingResources = require('aurelia-templating-resources'); - -var _analyzeViewFactory = require('aurelia-templating-resources/analyze-view-factory'); - function _initDefineProp(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { @@ -141,14 +133,14 @@ function updateVirtualOverrideContexts(repeat, startIndex) { var delta = repeat._topBufferHeight / repeat.itemHeight; for (; startIndex < viewLength; ++startIndex) { - (0, _repeatUtilities.updateOverrideContext)(views[startIndex].overrideContext, startIndex + delta, collectionLength); + (0, _aureliaTemplatingResources.updateOverrideContext)(views[startIndex].overrideContext, startIndex + delta, collectionLength); } } function rebindAndMoveView(repeat, view, index, moveToBottom) { var items = repeat.items; var viewSlot = repeat.viewSlot; - (0, _repeatUtilities.updateOverrideContext)(view.overrideContext, index, items.length); + (0, _aureliaTemplatingResources.updateOverrideContext)(view.overrideContext, index, items.length); view.bindingContext[repeat.local] = items[index]; if (moveToBottom) { viewSlot.children.push(viewSlot.children.shift()); @@ -185,7 +177,7 @@ var ArrayVirtualRepeatStrategy = exports.ArrayVirtualRepeatStrategy = function ( } ArrayVirtualRepeatStrategy.prototype.createFirstItem = function createFirstItem(repeat) { - var overrideContext = (0, _repeatUtilities.createFullOverrideContext)(repeat, repeat.items[0], 0, 1); + var overrideContext = (0, _aureliaTemplatingResources.createFullOverrideContext)(repeat, repeat.items[0], 0, 1); repeat.addView(overrideContext.bindingContext, overrideContext); }; @@ -195,7 +187,7 @@ var ArrayVirtualRepeatStrategy = exports.ArrayVirtualRepeatStrategy = function ( ArrayVirtualRepeatStrategy.prototype._standardProcessInstanceChanged = function _standardProcessInstanceChanged(repeat, items) { for (var i = 1, ii = repeat._viewsLength; i < ii; ++i) { - var overrideContext = (0, _repeatUtilities.createFullOverrideContext)(repeat, items[i], i, ii); + var overrideContext = (0, _aureliaTemplatingResources.createFullOverrideContext)(repeat, items[i], i, ii); repeat.addView(overrideContext.bindingContext, overrideContext); } }; @@ -229,7 +221,7 @@ var ArrayVirtualRepeatStrategy = exports.ArrayVirtualRepeatStrategy = function ( var minLength = Math.min(repeat._viewsLength, items.length); for (var _i = viewsLength; _i < minLength; _i++) { - var overrideContext = (0, _repeatUtilities.createFullOverrideContext)(repeat, items[_i], _i, itemsLength); + var overrideContext = (0, _aureliaTemplatingResources.createFullOverrideContext)(repeat, items[_i], _i, itemsLength); repeat.addView(overrideContext.bindingContext, overrideContext); } }; @@ -284,8 +276,9 @@ var ArrayVirtualRepeatStrategy = exports.ArrayVirtualRepeatStrategy = function ( for (var i = 0, ii = splices.length; i < ii; ++i) { var splice = splices[i]; var removed = splice.removed; - for (var j = 0, jj = removed.length; j < jj; ++j) { - var viewOrPromise = this._removeViewAt(repeat, splice.index + removeDelta + rmPromises.length, true); + var removedLength = removed.length; + for (var j = 0, jj = removedLength; j < jj; ++j) { + var viewOrPromise = this._removeViewAt(repeat, splice.index + removeDelta + rmPromises.length, true, j, removedLength); if (viewOrPromise instanceof Promise) { rmPromises.push(viewOrPromise); } @@ -303,12 +296,18 @@ var ArrayVirtualRepeatStrategy = exports.ArrayVirtualRepeatStrategy = function ( updateVirtualOverrideContexts(repeat, 0); }; - ArrayVirtualRepeatStrategy.prototype._removeViewAt = function _removeViewAt(repeat, collectionIndex, returnToCache) { + ArrayVirtualRepeatStrategy.prototype._removeViewAt = function _removeViewAt(repeat, collectionIndex, returnToCache, j, removedLength) { var viewOrPromise = void 0; var view = void 0; var viewSlot = repeat.viewSlot; var viewCount = repeat.viewCount(); var viewAddIndex = void 0; + var removeMoreThanInDom = removedLength > viewCount; + if (repeat._viewsLength <= j) { + repeat._bottomBufferHeight = repeat._bottomBufferHeight - repeat.itemHeight; + repeat._adjustBufferHeights(); + return; + } if (!this._isIndexBeforeViewSlot(repeat, viewSlot, collectionIndex) && !this._isIndexAfterViewSlot(repeat, viewSlot, collectionIndex)) { var viewIndex = this._getViewIndex(repeat, viewSlot, collectionIndex); @@ -317,7 +316,12 @@ var ArrayVirtualRepeatStrategy = exports.ArrayVirtualRepeatStrategy = function ( var collectionAddIndex = void 0; if (repeat._bottomBufferHeight > repeat.itemHeight) { viewAddIndex = viewCount; - collectionAddIndex = repeat._getIndexOfLastView() + 1; + if (!removeMoreThanInDom) { + var lastViewItem = repeat._getLastViewItem(); + collectionAddIndex = repeat.items.indexOf(lastViewItem) + 1; + } else { + collectionAddIndex = j; + } repeat._bottomBufferHeight = repeat._bottomBufferHeight - repeat.itemHeight; } else if (repeat._topBufferHeight > 0) { viewAddIndex = 0; @@ -326,12 +330,10 @@ var ArrayVirtualRepeatStrategy = exports.ArrayVirtualRepeatStrategy = function ( } var data = repeat.items[collectionAddIndex]; if (data) { - var overrideContext = (0, _repeatUtilities.createFullOverrideContext)(repeat, repeat.items[collectionAddIndex], collectionAddIndex, repeat.items.length); + var overrideContext = (0, _aureliaTemplatingResources.createFullOverrideContext)(repeat, data, collectionAddIndex, repeat.items.length); view = repeat.viewFactory.create(); view.bind(overrideContext.bindingContext, overrideContext); } - } else { - return viewOrPromise; } } else if (this._isIndexBeforeViewSlot(repeat, viewSlot, collectionIndex)) { if (repeat._bottomBufferHeight > 0) { @@ -349,11 +351,9 @@ var ArrayVirtualRepeatStrategy = exports.ArrayVirtualRepeatStrategy = function ( repeat.viewSlot.insert(viewAddIndex, view); repeat._adjustBufferHeights(); }); - return undefined; } else if (view) { repeat.viewSlot.insert(viewAddIndex, view); } - repeat._adjustBufferHeights(); }; @@ -386,7 +386,7 @@ var ArrayVirtualRepeatStrategy = exports.ArrayVirtualRepeatStrategy = function ( for (; addIndex < end; ++addIndex) { var hasDistanceToBottomViewPort = getElementDistanceToBottomViewPort(repeat.viewStrategy.getLastElement(repeat.bottomBuffer)) > 0; if (repeat.viewCount() === 0 || !this._isIndexBeforeViewSlot(repeat, viewSlot, addIndex) && !this._isIndexAfterViewSlot(repeat, viewSlot, addIndex) || hasDistanceToBottomViewPort) { - var overrideContext = (0, _repeatUtilities.createFullOverrideContext)(repeat, array[addIndex], addIndex, arrayLength); + var overrideContext = (0, _aureliaTemplatingResources.createFullOverrideContext)(repeat, array[addIndex], addIndex, arrayLength); repeat.insertView(addIndex, overrideContext.bindingContext, overrideContext); if (!repeat._hasCalculatedSizes) { repeat._calcInitialHeights(1); @@ -412,7 +412,7 @@ var ArrayVirtualRepeatStrategy = exports.ArrayVirtualRepeatStrategy = function ( }; return ArrayVirtualRepeatStrategy; -}(_arrayRepeatStrategy.ArrayRepeatStrategy); +}(_aureliaTemplatingResources.ArrayRepeatStrategy); var ViewStrategyLocator = exports.ViewStrategyLocator = function () { function ViewStrategyLocator() { @@ -563,7 +563,7 @@ var VirtualRepeatStrategyLocator = exports.VirtualRepeatStrategyLocator = functi } return VirtualRepeatStrategyLocator; -}(_repeatStrategyLocator.RepeatStrategyLocator); +}(_aureliaTemplatingResources.RepeatStrategyLocator); var VirtualRepeat = exports.VirtualRepeat = (_dec = (0, _aureliaTemplating.customAttribute)('virtual-repeat'), _dec2 = (0, _aureliaDependencyInjection.inject)(_aureliaPal.DOM.Element, _aureliaTemplating.BoundViewFactory, _aureliaTemplating.TargetInstruction, _aureliaTemplating.ViewSlot, _aureliaTemplating.ViewResources, _aureliaBinding.ObserverLocator, VirtualRepeatStrategyLocator, ViewStrategyLocator, DomHelper), _dec(_class2 = (0, _aureliaTemplating.templateController)(_class2 = _dec2(_class2 = (_class3 = function (_AbstractRepeater) { _inherits(VirtualRepeat, _AbstractRepeater); @@ -573,7 +573,7 @@ var VirtualRepeat = exports.VirtualRepeat = (_dec = (0, _aureliaTemplating.custo var _this5 = _possibleConstructorReturn(this, _AbstractRepeater.call(this, { local: 'item', - viewsRequireLifecycle: (0, _analyzeViewFactory.viewsRequireLifecycle)(viewFactory) + viewsRequireLifecycle: (0, _aureliaTemplatingResources.viewsRequireLifecycle)(viewFactory) })); _this5._first = 0; @@ -604,8 +604,8 @@ var VirtualRepeat = exports.VirtualRepeat = (_dec = (0, _aureliaTemplating.custo _this5.observerLocator = observerLocator; _this5.strategyLocator = strategyLocator; _this5.viewStrategyLocator = viewStrategyLocator; - _this5.sourceExpression = (0, _repeatUtilities.getItemsSourceExpression)(_this5.instruction, 'virtual-repeat.for'); - _this5.isOneTime = (0, _repeatUtilities.isOneTime)(_this5.sourceExpression); + _this5.sourceExpression = (0, _aureliaTemplatingResources.getItemsSourceExpression)(_this5.instruction, 'virtual-repeat.for'); + _this5.isOneTime = (0, _aureliaTemplatingResources.isOneTime)(_this5.sourceExpression); _this5.domHelper = domHelper; return _this5; } @@ -866,7 +866,21 @@ var VirtualRepeat = exports.VirtualRepeat = (_dec = (0, _aureliaTemplating.custo }; VirtualRepeat.prototype._getIndexOfLastView = function _getIndexOfLastView() { - return this.view(this.viewCount() - 1).overrideContext.$index; + var view = this.view(this.viewCount() - 1); + if (view) { + return view.overrideContext.$index; + } + + return -1; + }; + + VirtualRepeat.prototype._getLastViewItem = function _getLastViewItem() { + var children = this.viewSlot.children; + if (!children.length) { + return undefined; + } + var lastViewItem = children[children.length - 1].bindingContext[this.local]; + return lastViewItem; }; VirtualRepeat.prototype._getIndexOfFirstView = function _getIndexOfFirstView() { @@ -923,7 +937,7 @@ var VirtualRepeat = exports.VirtualRepeat = (_dec = (0, _aureliaTemplating.custo }; VirtualRepeat.prototype._getInnerCollection = function _getInnerCollection() { - var expression = (0, _repeatUtilities.unwrapExpression)(this.sourceExpression); + var expression = (0, _aureliaTemplatingResources.unwrapExpression)(this.sourceExpression); if (!expression) { return null; } @@ -974,14 +988,14 @@ var VirtualRepeat = exports.VirtualRepeat = (_dec = (0, _aureliaTemplating.custo VirtualRepeat.prototype.updateBindings = function updateBindings(view) { var j = view.bindings.length; while (j--) { - (0, _repeatUtilities.updateOneTimeBinding)(view.bindings[j]); + (0, _aureliaTemplatingResources.updateOneTimeBinding)(view.bindings[j]); } j = view.controllers.length; while (j--) { var k = view.controllers[j].boundProperties.length; while (k--) { var binding = view.controllers[j].boundProperties[k].binding; - (0, _repeatUtilities.updateOneTimeBinding)(binding); + (0, _aureliaTemplatingResources.updateOneTimeBinding)(binding); } } }; diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index bb8898b..006af18 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,12 @@ +### 0.4.5 (2016-05-10) + + +#### Bug Fixes + +* **all:** import from root of dependencies ([6c41804f](http://github.com/aurelia/ui-virtualization/commit/6c41804f54e7951115f433b13fc2ab79ad20ae15), closes [#48](http://github.com/aurelia/ui-virtualization/issues/48)) +* **array-virtual-repeat-strategy:** error when deleting a lot of items ([b35135db](http://github.com/aurelia/ui-virtualization/commit/b35135dba7bd473a88383cbfc52e44e41000211b), closes [#49](http://github.com/aurelia/ui-virtualization/issues/49)) + + ### 0.4.4 (2016-04-28) diff --git a/package.json b/package.json index 43d9218..0eab2ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-ui-virtualization", - "version": "0.4.4", + "version": "0.4.5", "description": "A plugin that provides a virtualized repeater and other virtualization services.", "keywords": [ "aurelia",