Skip to content

Commit

Permalink
chore(all): prepare release 0.17.4
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Nov 15, 2015
1 parent 2a5f02a commit 14f9999
Show file tree
Hide file tree
Showing 19 changed files with 187 additions and 142 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-templating-resources",
"version": "0.17.3",
"version": "0.17.4",
"description": "A standard set of behaviors, converters and other resources for use with the Aurelia templating library.",
"keywords": [
"aurelia",
Expand Down
15 changes: 9 additions & 6 deletions dist/amd/array-collection-strategy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(['exports', './collection-strategy'], function (exports, _collectionStrategy) {
define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', './collection-strategy'], function (exports, _aureliaDependencyInjection, _aureliaBinding, _collectionStrategy) {
'use strict';

exports.__esModule = true;
Expand All @@ -10,10 +10,11 @@ define(['exports', './collection-strategy'], function (exports, _collectionStrat
var ArrayCollectionStrategy = (function (_CollectionStrategy) {
_inherits(ArrayCollectionStrategy, _CollectionStrategy);

function ArrayCollectionStrategy() {
_classCallCheck(this, ArrayCollectionStrategy);
function ArrayCollectionStrategy(observerLocator) {
_classCallCheck(this, _ArrayCollectionStrategy);

_CollectionStrategy.apply(this, arguments);
_CollectionStrategy.call(this);
this.observerLocator = observerLocator;
}

ArrayCollectionStrategy.prototype.processItems = function processItems(items) {
Expand All @@ -25,7 +26,7 @@ define(['exports', './collection-strategy'], function (exports, _collectionStrat
for (i = 0, ii = items.length; i < ii; ++i) {
overrideContext = _CollectionStrategy.prototype.createFullOverrideContext.call(this, items[i], i, ii);
view = this.viewFactory.create();
view.bind(undefined, overrideContext);
view.bind(overrideContext.bindingContext, overrideContext);
this.viewSlot.add(view);
}
};
Expand Down Expand Up @@ -81,14 +82,16 @@ define(['exports', './collection-strategy'], function (exports, _collectionStrat
for (; addIndex < end; ++addIndex) {
var overrideContext = this.createFullOverrideContext(array[addIndex], addIndex, arrayLength);
var view = this.viewFactory.create();
view.bind(undefined, overrideContext);
view.bind(overrideContext.bindingContext, overrideContext);
this.viewSlot.insert(addIndex, view);
}
}

return spliceIndexLow;
};

var _ArrayCollectionStrategy = ArrayCollectionStrategy;
ArrayCollectionStrategy = _aureliaDependencyInjection.inject(_aureliaBinding.ObserverLocator)(ArrayCollectionStrategy) || ArrayCollectionStrategy;
return ArrayCollectionStrategy;
})(_collectionStrategy.CollectionStrategy);

Expand Down
37 changes: 17 additions & 20 deletions dist/amd/collection-strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-binding'], function
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

var CollectionStrategy = (function () {
function CollectionStrategy(observerLocator) {
function CollectionStrategy() {
_classCallCheck(this, _CollectionStrategy);

this.observerLocator = observerLocator;
}

CollectionStrategy.prototype.initialize = function initialize(repeat, bindingContext, overrideContext) {
Expand Down Expand Up @@ -48,41 +46,40 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-binding'], function
};

CollectionStrategy.prototype.createFullOverrideContext = function createFullOverrideContext(data, index, length, key) {
var context = this.createBaseOverrideContext(data, key);
return this.updateOverrideContext(context, index, length);
var overrideContext = this.createBaseOverrideContext(data, key);
this.updateOverrideContext(overrideContext, index, length);
return overrideContext;
};

CollectionStrategy.prototype.createBaseOverrideContext = function createBaseOverrideContext(data, key) {
var context = _aureliaBinding.createOverrideContext(undefined, this.overrideContext);
var bindingContext = {};
var overrideContext = _aureliaBinding.createOverrideContext(bindingContext, this.overrideContext);

if (typeof key !== 'undefined') {
context[this.key] = key;
context[this.value] = data;
bindingContext[this.key] = key;
bindingContext[this.value] = data;
} else {
context[this.local] = data;
bindingContext[this.local] = data;
}

return context;
return overrideContext;
};

CollectionStrategy.prototype.updateOverrideContext = function updateOverrideContext(context, index, length) {
CollectionStrategy.prototype.updateOverrideContext = function updateOverrideContext(overrideContext, index, length) {
var first = index === 0;
var last = index === length - 1;
var even = index % 2 === 0;

context.$index = index;
context.$first = first;
context.$last = last;
context.$middle = !(first || last);
context.$odd = !even;
context.$even = even;

return context;
overrideContext.$index = index;
overrideContext.$first = first;
overrideContext.$last = last;
overrideContext.$middle = !(first || last);
overrideContext.$odd = !even;
overrideContext.$even = even;
};

var _CollectionStrategy = CollectionStrategy;
CollectionStrategy = _aureliaDependencyInjection.transient()(CollectionStrategy) || CollectionStrategy;
CollectionStrategy = _aureliaDependencyInjection.inject(_aureliaBinding.ObserverLocator)(CollectionStrategy) || CollectionStrategy;
return CollectionStrategy;
})();

Expand Down
17 changes: 10 additions & 7 deletions dist/amd/map-collection-strategy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(['exports', './collection-strategy'], function (exports, _collectionStrategy) {
define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', './collection-strategy'], function (exports, _aureliaDependencyInjection, _aureliaBinding, _collectionStrategy) {
'use strict';

exports.__esModule = true;
Expand All @@ -10,10 +10,11 @@ define(['exports', './collection-strategy'], function (exports, _collectionStrat
var MapCollectionStrategy = (function (_CollectionStrategy) {
_inherits(MapCollectionStrategy, _CollectionStrategy);

function MapCollectionStrategy() {
_classCallCheck(this, MapCollectionStrategy);
function MapCollectionStrategy(observerLocator) {
_classCallCheck(this, _MapCollectionStrategy);

_CollectionStrategy.apply(this, arguments);
_CollectionStrategy.call(this);
this.observerLocator = observerLocator;
}

MapCollectionStrategy.prototype.getCollectionObserver = function getCollectionObserver(items) {
Expand All @@ -32,7 +33,7 @@ define(['exports', './collection-strategy'], function (exports, _collectionStrat
items.forEach(function (value, key) {
overrideContext = _this.createFullOverrideContext(value, index, items.size, key);
view = viewFactory.create();
view.bind(undefined, overrideContext);
view.bind(overrideContext.bindingContext, overrideContext);
viewSlot.add(view);
++index;
});
Expand Down Expand Up @@ -64,13 +65,13 @@ define(['exports', './collection-strategy'], function (exports, _collectionStrat
}
overrideContext = this.createFullOverrideContext(map.get(key), removeIndex, map.size, key);
view = this.viewFactory.create();
view.bind(undefined, overrideContext);
view.bind(overrideContext.bindingContext, overrideContext);
viewSlot.insert(removeIndex, view);
break;
case 'add':
overrideContext = this.createFullOverrideContext(map.get(key), map.size - 1, map.size, key);
view = this.viewFactory.create();
view.bind(undefined, overrideContext);
view.bind(overrideContext.bindingContext, overrideContext);
viewSlot.insert(map.size - 1, view);
break;
case 'delete':
Expand Down Expand Up @@ -114,6 +115,8 @@ define(['exports', './collection-strategy'], function (exports, _collectionStrat
}
};

var _MapCollectionStrategy = MapCollectionStrategy;
MapCollectionStrategy = _aureliaDependencyInjection.inject(_aureliaBinding.ObserverLocator)(MapCollectionStrategy) || MapCollectionStrategy;
return MapCollectionStrategy;
})(_collectionStrategy.CollectionStrategy);

Expand Down
2 changes: 1 addition & 1 deletion dist/amd/number-strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ define(['exports', './collection-strategy'], function (exports, _collectionStrat
for (i = childrenLength, ii = value; i < ii; ++i) {
overrideContext = this.createFullOverrideContext(i, i, ii);
view = viewFactory.create();
view.bind(undefined, overrideContext);
view.bind(overrideContext.bindingContext, overrideContext);
viewSlot.add(view);
}

Expand Down
17 changes: 12 additions & 5 deletions dist/commonjs/array-collection-strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,20 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons

function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var _aureliaDependencyInjection = require('aurelia-dependency-injection');

var _aureliaBinding = require('aurelia-binding');

var _collectionStrategy = require('./collection-strategy');

var ArrayCollectionStrategy = (function (_CollectionStrategy) {
_inherits(ArrayCollectionStrategy, _CollectionStrategy);

function ArrayCollectionStrategy() {
_classCallCheck(this, ArrayCollectionStrategy);
function ArrayCollectionStrategy(observerLocator) {
_classCallCheck(this, _ArrayCollectionStrategy);

_CollectionStrategy.apply(this, arguments);
_CollectionStrategy.call(this);
this.observerLocator = observerLocator;
}

ArrayCollectionStrategy.prototype.processItems = function processItems(items) {
Expand All @@ -26,7 +31,7 @@ var ArrayCollectionStrategy = (function (_CollectionStrategy) {
for (i = 0, ii = items.length; i < ii; ++i) {
overrideContext = _CollectionStrategy.prototype.createFullOverrideContext.call(this, items[i], i, ii);
view = this.viewFactory.create();
view.bind(undefined, overrideContext);
view.bind(overrideContext.bindingContext, overrideContext);
this.viewSlot.add(view);
}
};
Expand Down Expand Up @@ -82,14 +87,16 @@ var ArrayCollectionStrategy = (function (_CollectionStrategy) {
for (; addIndex < end; ++addIndex) {
var overrideContext = this.createFullOverrideContext(array[addIndex], addIndex, arrayLength);
var view = this.viewFactory.create();
view.bind(undefined, overrideContext);
view.bind(overrideContext.bindingContext, overrideContext);
this.viewSlot.insert(addIndex, view);
}
}

return spliceIndexLow;
};

var _ArrayCollectionStrategy = ArrayCollectionStrategy;
ArrayCollectionStrategy = _aureliaDependencyInjection.inject(_aureliaBinding.ObserverLocator)(ArrayCollectionStrategy) || ArrayCollectionStrategy;
return ArrayCollectionStrategy;
})(_collectionStrategy.CollectionStrategy);

Expand Down
37 changes: 17 additions & 20 deletions dist/commonjs/collection-strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ var _aureliaDependencyInjection = require('aurelia-dependency-injection');
var _aureliaBinding = require('aurelia-binding');

var CollectionStrategy = (function () {
function CollectionStrategy(observerLocator) {
function CollectionStrategy() {
_classCallCheck(this, _CollectionStrategy);

this.observerLocator = observerLocator;
}

CollectionStrategy.prototype.initialize = function initialize(repeat, bindingContext, overrideContext) {
Expand Down Expand Up @@ -51,41 +49,40 @@ var CollectionStrategy = (function () {
};

CollectionStrategy.prototype.createFullOverrideContext = function createFullOverrideContext(data, index, length, key) {
var context = this.createBaseOverrideContext(data, key);
return this.updateOverrideContext(context, index, length);
var overrideContext = this.createBaseOverrideContext(data, key);
this.updateOverrideContext(overrideContext, index, length);
return overrideContext;
};

CollectionStrategy.prototype.createBaseOverrideContext = function createBaseOverrideContext(data, key) {
var context = _aureliaBinding.createOverrideContext(undefined, this.overrideContext);
var bindingContext = {};
var overrideContext = _aureliaBinding.createOverrideContext(bindingContext, this.overrideContext);

if (typeof key !== 'undefined') {
context[this.key] = key;
context[this.value] = data;
bindingContext[this.key] = key;
bindingContext[this.value] = data;
} else {
context[this.local] = data;
bindingContext[this.local] = data;
}

return context;
return overrideContext;
};

CollectionStrategy.prototype.updateOverrideContext = function updateOverrideContext(context, index, length) {
CollectionStrategy.prototype.updateOverrideContext = function updateOverrideContext(overrideContext, index, length) {
var first = index === 0;
var last = index === length - 1;
var even = index % 2 === 0;

context.$index = index;
context.$first = first;
context.$last = last;
context.$middle = !(first || last);
context.$odd = !even;
context.$even = even;

return context;
overrideContext.$index = index;
overrideContext.$first = first;
overrideContext.$last = last;
overrideContext.$middle = !(first || last);
overrideContext.$odd = !even;
overrideContext.$even = even;
};

var _CollectionStrategy = CollectionStrategy;
CollectionStrategy = _aureliaDependencyInjection.transient()(CollectionStrategy) || CollectionStrategy;
CollectionStrategy = _aureliaDependencyInjection.inject(_aureliaBinding.ObserverLocator)(CollectionStrategy) || CollectionStrategy;
return CollectionStrategy;
})();

Expand Down
19 changes: 13 additions & 6 deletions dist/commonjs/map-collection-strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,20 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons

function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var _aureliaDependencyInjection = require('aurelia-dependency-injection');

var _aureliaBinding = require('aurelia-binding');

var _collectionStrategy = require('./collection-strategy');

var MapCollectionStrategy = (function (_CollectionStrategy) {
_inherits(MapCollectionStrategy, _CollectionStrategy);

function MapCollectionStrategy() {
_classCallCheck(this, MapCollectionStrategy);
function MapCollectionStrategy(observerLocator) {
_classCallCheck(this, _MapCollectionStrategy);

_CollectionStrategy.apply(this, arguments);
_CollectionStrategy.call(this);
this.observerLocator = observerLocator;
}

MapCollectionStrategy.prototype.getCollectionObserver = function getCollectionObserver(items) {
Expand All @@ -33,7 +38,7 @@ var MapCollectionStrategy = (function (_CollectionStrategy) {
items.forEach(function (value, key) {
overrideContext = _this.createFullOverrideContext(value, index, items.size, key);
view = viewFactory.create();
view.bind(undefined, overrideContext);
view.bind(overrideContext.bindingContext, overrideContext);
viewSlot.add(view);
++index;
});
Expand Down Expand Up @@ -65,13 +70,13 @@ var MapCollectionStrategy = (function (_CollectionStrategy) {
}
overrideContext = this.createFullOverrideContext(map.get(key), removeIndex, map.size, key);
view = this.viewFactory.create();
view.bind(undefined, overrideContext);
view.bind(overrideContext.bindingContext, overrideContext);
viewSlot.insert(removeIndex, view);
break;
case 'add':
overrideContext = this.createFullOverrideContext(map.get(key), map.size - 1, map.size, key);
view = this.viewFactory.create();
view.bind(undefined, overrideContext);
view.bind(overrideContext.bindingContext, overrideContext);
viewSlot.insert(map.size - 1, view);
break;
case 'delete':
Expand Down Expand Up @@ -115,6 +120,8 @@ var MapCollectionStrategy = (function (_CollectionStrategy) {
}
};

var _MapCollectionStrategy = MapCollectionStrategy;
MapCollectionStrategy = _aureliaDependencyInjection.inject(_aureliaBinding.ObserverLocator)(MapCollectionStrategy) || MapCollectionStrategy;
return MapCollectionStrategy;
})(_collectionStrategy.CollectionStrategy);

Expand Down
2 changes: 1 addition & 1 deletion dist/commonjs/number-strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var NumberStrategy = (function (_CollectionStrategy) {
for (i = childrenLength, ii = value; i < ii; ++i) {
overrideContext = this.createFullOverrideContext(i, i, ii);
view = viewFactory.create();
view.bind(undefined, overrideContext);
view.bind(overrideContext.bindingContext, overrideContext);
viewSlot.add(view);
}

Expand Down
Loading

0 comments on commit 14f9999

Please sign in to comment.