Skip to content

Commit

Permalink
chore(all): update build
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Jun 22, 2016
1 parent bd70391 commit b216781
Show file tree
Hide file tree
Showing 24 changed files with 194 additions and 232 deletions.
2 changes: 1 addition & 1 deletion dist/amd/array-virtual-repeat-strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ define(['exports', 'aurelia-templating-resources', './utilities'], function (exp
var addIndex = splice.index;
var end = splice.index + splice.addedCount;
for (; addIndex < end; ++addIndex) {
var hasDistanceToBottomViewPort = (0, _utilities.getElementDistanceToBottomViewPort)(repeat.viewStrategy.getLastElement(repeat.bottomBuffer)) > 0;
var hasDistanceToBottomViewPort = (0, _utilities.getElementDistanceToBottomViewPort)(repeat.templateStrategy.getLastElement(repeat.bottomBuffer)) > 0;
if (repeat.viewCount() === 0 || !this._isIndexBeforeViewSlot(repeat, viewSlot, addIndex) && !this._isIndexAfterViewSlot(repeat, viewSlot, addIndex) || hasDistanceToBottomViewPort) {
var overrideContext = (0, _aureliaTemplatingResources.createFullOverrideContext)(repeat, array[addIndex], addIndex, arrayLength);
repeat.insertView(addIndex, overrideContext.bindingContext, overrideContext);
Expand Down
34 changes: 17 additions & 17 deletions dist/amd/view-strategy.js → dist/amd/template-strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ define(['exports', 'aurelia-pal', 'aurelia-templating', './utilities'], function
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DefaultViewStrategy = exports.TableStrategy = exports.ViewStrategyLocator = undefined;
exports.DefaultTemplateStrategy = exports.TableStrategy = exports.TemplateStrategyLocator = undefined;



var ViewStrategyLocator = exports.ViewStrategyLocator = function () {
function ViewStrategyLocator() {
var TemplateStrategyLocator = exports.TemplateStrategyLocator = function () {
function TemplateStrategyLocator() {

}

ViewStrategyLocator.prototype.getStrategy = function getStrategy(element) {
TemplateStrategyLocator.prototype.getStrategy = function getStrategy(element) {
if (element.parentNode && element.parentNode.localName === 'tbody') {
return new TableStrategy();
}
return new DefaultViewStrategy();
return new DefaultTemplateStrategy();
};

return ViewStrategyLocator;
return TemplateStrategyLocator;
}();

var TableStrategy = exports.TableStrategy = function () {
Expand Down Expand Up @@ -90,52 +90,52 @@ define(['exports', 'aurelia-pal', 'aurelia-templating', './utilities'], function
return TableStrategy;
}();

var DefaultViewStrategy = exports.DefaultViewStrategy = function () {
function DefaultViewStrategy() {
var DefaultTemplateStrategy = exports.DefaultTemplateStrategy = function () {
function DefaultTemplateStrategy() {

}

DefaultViewStrategy.prototype.getScrollContainer = function getScrollContainer(element) {
DefaultTemplateStrategy.prototype.getScrollContainer = function getScrollContainer(element) {
return element.parentNode;
};

DefaultViewStrategy.prototype.moveViewFirst = function moveViewFirst(view, topBuffer) {
DefaultTemplateStrategy.prototype.moveViewFirst = function moveViewFirst(view, topBuffer) {
(0, _utilities.insertBeforeNode)(view, _aureliaPal.DOM.nextElementSibling(topBuffer));
};

DefaultViewStrategy.prototype.moveViewLast = function moveViewLast(view, bottomBuffer) {
DefaultTemplateStrategy.prototype.moveViewLast = function moveViewLast(view, bottomBuffer) {
var previousSibling = bottomBuffer.previousSibling;
var referenceNode = previousSibling.nodeType === 8 && previousSibling.data === 'anchor' ? previousSibling : bottomBuffer;
(0, _utilities.insertBeforeNode)(view, referenceNode);
};

DefaultViewStrategy.prototype.createTopBufferElement = function createTopBufferElement(element) {
DefaultTemplateStrategy.prototype.createTopBufferElement = function createTopBufferElement(element) {
var elementName = element.parentNode.localName === 'ul' ? 'li' : 'div';
var buffer = _aureliaPal.DOM.createElement(elementName);
element.parentNode.insertBefore(buffer, element);
return buffer;
};

DefaultViewStrategy.prototype.createBottomBufferElement = function createBottomBufferElement(element) {
DefaultTemplateStrategy.prototype.createBottomBufferElement = function createBottomBufferElement(element) {
var elementName = element.parentNode.localName === 'ul' ? 'li' : 'div';
var buffer = _aureliaPal.DOM.createElement(elementName);
element.parentNode.insertBefore(buffer, element.nextSibling);
return buffer;
};

DefaultViewStrategy.prototype.removeBufferElements = function removeBufferElements(element, topBuffer, bottomBuffer) {
DefaultTemplateStrategy.prototype.removeBufferElements = function removeBufferElements(element, topBuffer, bottomBuffer) {
element.parentNode.removeChild(topBuffer);
element.parentNode.removeChild(bottomBuffer);
};

DefaultViewStrategy.prototype.getFirstElement = function getFirstElement(topBuffer) {
DefaultTemplateStrategy.prototype.getFirstElement = function getFirstElement(topBuffer) {
return _aureliaPal.DOM.nextElementSibling(topBuffer);
};

DefaultViewStrategy.prototype.getLastElement = function getLastElement(bottomBuffer) {
DefaultTemplateStrategy.prototype.getLastElement = function getLastElement(bottomBuffer) {
return bottomBuffer.previousElementSibling;
};

return DefaultViewStrategy;
return DefaultTemplateStrategy;
}();
});
4 changes: 2 additions & 2 deletions dist/amd/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ define(['exports', 'aurelia-templating-resources', 'aurelia-templating'], functi
view.bindingContext[repeat.local] = items[index];
if (moveToBottom) {
viewSlot.children.push(viewSlot.children.shift());
repeat.viewStrategy.moveViewLast(view, repeat.bottomBuffer);
repeat.templateStrategy.moveViewLast(view, repeat.bottomBuffer);
} else {
viewSlot.children.unshift(viewSlot.children.splice(-1, 1)[0]);
repeat.viewStrategy.moveViewFirst(view, repeat.topBuffer);
repeat.templateStrategy.moveViewFirst(view, repeat.topBuffer);
}
}

Expand Down
20 changes: 10 additions & 10 deletions dist/amd/virtual-repeat.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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) {
define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-templating', 'aurelia-templating-resources', 'aurelia-pal', './utilities', './dom-helper', './virtual-repeat-strategy-locator', './template-strategy'], function (exports, _aureliaDependencyInjection, _aureliaBinding, _aureliaTemplating, _aureliaTemplatingResources, _aureliaPal, _utilities, _domHelper, _virtualRepeatStrategyLocator, _templateStrategy) {
'use strict';

Object.defineProperty(exports, "__esModule", {
Expand Down Expand Up @@ -77,10 +77,10 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-t

var _dec, _dec2, _class, _desc, _value, _class2, _descriptor, _descriptor2;

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.VirtualRepeatStrategyLocator, _viewStrategy.ViewStrategyLocator, _domHelper.DomHelper), _dec(_class = (0, _aureliaTemplating.templateController)(_class = _dec2(_class = (_class2 = function (_AbstractRepeater) {
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.VirtualRepeatStrategyLocator, _templateStrategy.TemplateStrategyLocator, _domHelper.DomHelper), _dec(_class = (0, _aureliaTemplating.templateController)(_class = _dec2(_class = (_class2 = function (_AbstractRepeater) {
_inherits(VirtualRepeat, _AbstractRepeater);

function VirtualRepeat(element, viewFactory, instruction, viewSlot, viewResources, observerLocator, strategyLocator, viewStrategyLocator, domHelper) {
function VirtualRepeat(element, viewFactory, instruction, viewSlot, viewResources, observerLocator, strategyLocator, templateStrategyLocator, domHelper) {


var _this = _possibleConstructorReturn(this, _AbstractRepeater.call(this, {
Expand Down Expand Up @@ -115,7 +115,7 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-t
_this.lookupFunctions = viewResources.lookupFunctions;
_this.observerLocator = observerLocator;
_this.strategyLocator = strategyLocator;
_this.viewStrategyLocator = viewStrategyLocator;
_this.templateStrategyLocator = templateStrategyLocator;
_this.sourceExpression = (0, _aureliaTemplatingResources.getItemsSourceExpression)(_this.instruction, 'virtual-repeat.for');
_this.isOneTime = (0, _aureliaTemplatingResources.isOneTime)(_this.sourceExpression);
_this.domHelper = domHelper;
Expand All @@ -128,10 +128,10 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-t
this._isAttached = true;
var element = this.element;
this._itemsLength = this.items.length;
this.viewStrategy = this.viewStrategyLocator.getStrategy(element);
this.scrollContainer = this.viewStrategy.getScrollContainer(element);
this.topBuffer = this.viewStrategy.createTopBufferElement(element);
this.bottomBuffer = this.viewStrategy.createBottomBufferElement(element);
this.templateStrategy = this.templateStrategyLocator.getStrategy(element);
this.scrollContainer = this.templateStrategy.getScrollContainer(element);
this.topBuffer = this.templateStrategy.createTopBufferElement(element);
this.bottomBuffer = this.templateStrategy.createBottomBufferElement(element);
this.itemsChanged();
this.scrollListener = function () {
return _this2._onScroll();
Expand All @@ -145,7 +145,7 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-t
}
}, 500);

this.distanceToTop = this.domHelper.getElementDistanceToTopOfDocument(this.viewStrategy.getFirstElement(this.topBuffer));
this.distanceToTop = this.domHelper.getElementDistanceToTopOfDocument(this.templateStrategy.getFirstElement(this.topBuffer));
if (this.domHelper.hasOverflowScroll(this.scrollContainer)) {
this._fixedHeightContainer = true;
this.scrollContainer.addEventListener('scroll', this.scrollListener);
Expand Down Expand Up @@ -176,7 +176,7 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-t
this._isAttached = false;
this._ticking = false;
this._hasCalculatedSizes = false;
this.viewStrategy.removeBufferElements(this.element, this.topBuffer, this.bottomBuffer);
this.templateStrategy.removeBufferElements(this.element, this.topBuffer, this.bottomBuffer);
this.isLastIndex = false;
this.scrollContainer = null;
this.scrollContainerHeight = null;
Expand Down
48 changes: 5 additions & 43 deletions dist/aurelia-ui-virtualization.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
import {
ObserverLocator
} from 'aurelia-binding';
export declare interface ViewStrategy {
export declare interface TemplateStrategy {
getScrollContainer(element: Element): Element;
moveViewFirst(view: View, topBuffer: Element): void;
moveViewLast(view: View, bottomBuffer: Element): void;
Expand Down Expand Up @@ -70,8 +70,6 @@ export declare class ArrayVirtualRepeatStrategy extends ArrayRepeatStrategy {
* @param items The new array instance.
*/
instanceChanged(repeat: VirtualRepeat, items: Array<any>): void;
_standardProcessInstanceChanged(repeat: VirtualRepeat, items: Array<any>): void;
_inPlaceProcessItems(repeat: VirtualRepeat, items: Array<any>): void;

/**
* Handle the repeat's collection instance mutating.
Expand All @@ -80,16 +78,9 @@ export declare class ArrayVirtualRepeatStrategy extends ArrayRepeatStrategy {
* @param splices Records of array changes.
*/
instanceMutated(repeat: VirtualRepeat, array: Array<any>, splices: any): void;
_standardProcessInstanceMutated(repeat: VirtualRepeat, array: Array<any>, splices: any): void;
_runSplices(repeat: VirtualRepeat, array: Array<any>, splices: any): any;
_removeViewAt(repeat: VirtualRepeat, collectionIndex: number, returnToCache: boolean, j: number, removedLength: number): any;
_isIndexBeforeViewSlot(repeat: VirtualRepeat, viewSlot: ViewSlot, index: number): number;
_isIndexAfterViewSlot(repeat: VirtualRepeat, viewSlot: ViewSlot, index: number): number;
_getViewIndex(repeat: VirtualRepeat, viewSlot: ViewSlot, index: number): number;
_handleAddedSplices(repeat: VirtualRepeat, array: Array<any>, splices: any): void;
}
export declare class ViewStrategyLocator {
getStrategy(element: Element): ViewStrategy;
export declare class TemplateStrategyLocator {
getStrategy(element: Element): TemplateStrategy;
}
export declare class TableStrategy {
tableCssReset: any;
Expand All @@ -102,7 +93,7 @@ export declare class TableStrategy {
getFirstElement(topBuffer: Element): Element;
getLastElement(bottomBuffer: Element): Element;
}
export declare class DefaultViewStrategy {
export declare class DefaultTemplateStrategy {
getScrollContainer(element: Element): Element;
moveViewFirst(view: View, topBuffer: Element): void;
moveViewLast(view: View, bottomBuffer: Element): void;
Expand All @@ -116,24 +107,9 @@ export declare class VirtualRepeatStrategyLocator extends RepeatStrategyLocator
constructor();
}
export declare class VirtualRepeat extends AbstractRepeater {
_first: any;
_previousFirst: any;
_viewsLength: any;
_lastRebind: any;
_topBufferHeight: any;
_bottomBufferHeight: any;
_bufferSize: any;
_scrollingDown: any;
_scrollingUp: any;
_switchedDirection: any;
_isAttached: any;
_ticking: any;
_fixedHeightContainer: any;
_hasCalculatedSizes: any;
_isAtTop: any;
items: any;
local: any;
constructor(element: Element, viewFactory: BoundViewFactory, instruction: TargetInstruction, viewSlot: ViewSlot, viewResources: ViewResources, observerLocator: ObserverLocator, strategyLocator: VirtualRepeatStrategyLocator, viewStrategyLocator: ViewStrategyLocator, domHelper: DomHelper);
constructor(element: Element, viewFactory: BoundViewFactory, instruction: TargetInstruction, viewSlot: ViewSlot, viewResources: ViewResources, observerLocator: ObserverLocator, strategyLocator: VirtualRepeatStrategyLocator, templateStrategyLocator: TemplateStrategyLocator, domHelper: DomHelper);
attached(): void;
bind(bindingContext?: any, overrideContext?: any): void;
call(context?: any, changes?: any): void;
Expand All @@ -142,20 +118,6 @@ export declare class VirtualRepeat extends AbstractRepeater {
unbind(): void;
handleCollectionMutated(collection?: any, changes?: any): void;
handleInnerCollectionMutated(collection?: any, changes?: any): void;
_onScroll(): void;
_handleScroll(): void;
_checkScrolling(): void;
_adjustBufferHeights(): void;
_unsubscribeCollection(): void;
_moveViews(length: number): number;
_getIndexOfLastView(): number;
_getLastViewItem(): any;
_getIndexOfFirstView(): number;
_calcInitialHeights(itemsLength: number): any;
_calcScrollHeight(element: Element): number;
_observeInnerCollection(): boolean;
_getInnerCollection(): any;
_observeCollection(): void;

// @override AbstractRepeater
viewCount(): any;
Expand Down
Loading

0 comments on commit b216781

Please sign in to comment.