Skip to content

Commit

Permalink
chore(all): prepare release 1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Oct 2, 2018
1 parent fe1b519 commit 27cebc0
Show file tree
Hide file tree
Showing 11 changed files with 626 additions and 33 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-binding",
"version": "1.5.0",
"version": "1.5.1",
"description": "An implementation of the templating engine's Binding Language abstraction which uses a pluggable command syntax.",
"keywords": [
"aurelia",
Expand Down
102 changes: 96 additions & 6 deletions dist/amd/aurelia-templating-binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ define(['exports', 'aurelia-logging', 'aurelia-binding', 'aurelia-templating'],
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TemplatingBindingLanguage = exports.SyntaxInterpreter = exports.ChildInterpolationBinding = exports.InterpolationBinding = exports.InterpolationBindingExpression = exports.AttributeMap = undefined;
exports.TemplatingBindingLanguage = exports.SyntaxInterpreter = exports.LetBinding = exports.LetExpression = exports.ChildInterpolationBinding = exports.InterpolationBinding = exports.InterpolationBindingExpression = exports.AttributeMap = undefined;
exports.configure = configure;

var LogManager = _interopRequireWildcard(_aureliaLogging);
Expand Down Expand Up @@ -52,7 +52,7 @@ define(['exports', 'aurelia-logging', 'aurelia-binding', 'aurelia-templating'],



var _class, _temp, _dec, _class2, _class3, _temp2, _class4, _temp3;
var _class, _temp, _dec, _class2, _dec2, _class3, _class4, _temp2, _class5, _temp3;

var AttributeMap = exports.AttributeMap = (_temp = _class = function () {
function AttributeMap(svg) {
Expand Down Expand Up @@ -332,7 +332,97 @@ define(['exports', 'aurelia-logging', 'aurelia-binding', 'aurelia-templating'],

return ChildInterpolationBinding;
}()) || _class2);
var SyntaxInterpreter = exports.SyntaxInterpreter = (_temp2 = _class3 = function () {

var LetExpression = exports.LetExpression = function () {
function LetExpression(observerLocator, targetProperty, sourceExpression, lookupFunctions, toBindingContext) {


this.observerLocator = observerLocator;
this.sourceExpression = sourceExpression;
this.targetProperty = targetProperty;
this.lookupFunctions = lookupFunctions;
this.toBindingContext = toBindingContext;
}

LetExpression.prototype.createBinding = function createBinding() {
return new LetBinding(this.observerLocator, this.sourceExpression, this.targetProperty, this.lookupFunctions, this.toBindingContext);
};

return LetExpression;
}();

var LetBinding = exports.LetBinding = (_dec2 = (0, _aureliaBinding.connectable)(), _dec2(_class3 = function () {
function LetBinding(observerLocator, sourceExpression, targetProperty, lookupFunctions, toBindingContext) {


this.observerLocator = observerLocator;
this.sourceExpression = sourceExpression;
this.targetProperty = targetProperty;
this.lookupFunctions = lookupFunctions;
this.source = null;
this.target = null;
this.toBindingContext = toBindingContext;
}

LetBinding.prototype.updateTarget = function updateTarget() {
var value = this.sourceExpression.evaluate(this.source, this.lookupFunctions);
this.target[this.targetProperty] = value;
};

LetBinding.prototype.call = function call(context) {
if (!this.isBound) {
return;
}
if (context === _aureliaBinding.sourceContext) {
this.updateTarget();
return;
}
throw new Error('Unexpected call context ' + context);
};

LetBinding.prototype.bind = function bind(source) {
if (this.isBound) {
if (this.source === source) {
return;
}
this.unbind();
}

this.isBound = true;
this.source = source;
this.target = this.toBindingContext ? source.bindingContext : source.overrideContext;

if (this.sourceExpression.bind) {
this.sourceExpression.bind(this, source, this.lookupFunctions);
}

(0, _aureliaBinding.enqueueBindingConnect)(this);
};

LetBinding.prototype.unbind = function unbind() {
if (!this.isBound) {
return;
}
this.isBound = false;
if (this.sourceExpression.unbind) {
this.sourceExpression.unbind(this, this.source);
}
this.source = null;
this.target = null;
this.unobserve(true);
};

LetBinding.prototype.connect = function connect() {
if (!this.isBound) {
return;
}
this.updateTarget();
this.sourceExpression.connect(this, this.source);
};

return LetBinding;
}()) || _class3);
var SyntaxInterpreter = exports.SyntaxInterpreter = (_temp2 = _class4 = function () {
function SyntaxInterpreter(parser, observerLocator, eventManager, attributeMap) {


Expand Down Expand Up @@ -532,14 +622,14 @@ define(['exports', 'aurelia-logging', 'aurelia-binding', 'aurelia-templating'],
};

return SyntaxInterpreter;
}(), _class3.inject = [_aureliaBinding.Parser, _aureliaBinding.ObserverLocator, _aureliaBinding.EventManager, AttributeMap], _temp2);
}(), _class4.inject = [_aureliaBinding.Parser, _aureliaBinding.ObserverLocator, _aureliaBinding.EventManager, AttributeMap], _temp2);


SyntaxInterpreter.prototype['one-way'] = SyntaxInterpreter.prototype['to-view'];

var info = {};

var TemplatingBindingLanguage = exports.TemplatingBindingLanguage = (_temp3 = _class4 = function (_BindingLanguage) {
var TemplatingBindingLanguage = exports.TemplatingBindingLanguage = (_temp3 = _class5 = function (_BindingLanguage) {
_inherits(TemplatingBindingLanguage, _BindingLanguage);

function TemplatingBindingLanguage(parser, observerLocator, syntaxInterpreter, attributeMap) {
Expand Down Expand Up @@ -738,7 +828,7 @@ define(['exports', 'aurelia-logging', 'aurelia-binding', 'aurelia-templating'],
};

return TemplatingBindingLanguage;
}(_aureliaTemplating.BindingLanguage), _class4.inject = [_aureliaBinding.Parser, _aureliaBinding.ObserverLocator, SyntaxInterpreter, AttributeMap], _temp3);
}(_aureliaTemplating.BindingLanguage), _class5.inject = [_aureliaBinding.Parser, _aureliaBinding.ObserverLocator, SyntaxInterpreter, AttributeMap], _temp3);
function configure(config) {
config.container.registerSingleton(_aureliaTemplating.BindingLanguage, TemplatingBindingLanguage);
config.container.registerAlias(_aureliaTemplating.BindingLanguage, TemplatingBindingLanguage);
Expand Down
34 changes: 34 additions & 0 deletions dist/aurelia-templating-binding.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
bindingMode,
connectable,
enqueueBindingConnect,
sourceContext,
Parser,
ObserverLocator,
EventManager,
Expand Down Expand Up @@ -59,6 +60,39 @@ export declare class ChildInterpolationBinding {
unbind(): any;
connect(evaluate?: any): any;
}
export declare class LetExpression {

/**
* @param {ObserverLocator} observerLocator
* @param {string} targetProperty
* @param {Expression} sourceExpression
* @param {any} lookupFunctions
* @param {boolean} toBindingContext indicates let binding result should be assigned to binding context
*/
constructor(observerLocator?: any, targetProperty?: any, sourceExpression?: any, lookupFunctions?: any, toBindingContext?: any);
createBinding(): any;
}
export declare class LetBinding {

/**
* @param {ObserverLocator} observerLocator
* @param {Expression} sourceExpression
* @param {Function | Element} target
* @param {string} targetProperty
* @param {*} lookupFunctions
* @param {boolean} toBindingContext indicates let binding result should be assigned to binding context
*/
constructor(observerLocator?: any, sourceExpression?: any, targetProperty?: any, lookupFunctions?: any, toBindingContext?: any);
updateTarget(): any;
call(context?: any): any;

/**
* @param {Scope} source Binding context
*/
bind(source?: any): any;
unbind(): any;
connect(): any;
}

/*eslint dot-notation:0*/
export declare class SyntaxInterpreter {
Expand Down
109 changes: 108 additions & 1 deletion dist/aurelia-templating-binding.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as LogManager from 'aurelia-logging';
import {camelCase,SVGAnalyzer,bindingMode,connectable,enqueueBindingConnect,Parser,ObserverLocator,EventManager,ListenerExpression,BindingExpression,CallExpression,delegationStrategy,NameExpression,LiteralString} from 'aurelia-binding';
import {camelCase,SVGAnalyzer,bindingMode,connectable,enqueueBindingConnect,sourceContext,Parser,ObserverLocator,EventManager,ListenerExpression,BindingExpression,CallExpression,delegationStrategy,NameExpression,LiteralString} from 'aurelia-binding';
import {BehaviorInstruction,BindingLanguage} from 'aurelia-templating';

export class AttributeMap {
Expand Down Expand Up @@ -295,6 +295,113 @@ export class ChildInterpolationBinding {
}
}

export class LetExpression {
/**
* @param {ObserverLocator} observerLocator
* @param {string} targetProperty
* @param {Expression} sourceExpression
* @param {any} lookupFunctions
* @param {boolean} toBindingContext indicates let binding result should be assigned to binding context
*/
constructor(observerLocator, targetProperty, sourceExpression, lookupFunctions, toBindingContext) {
this.observerLocator = observerLocator;
this.sourceExpression = sourceExpression;
this.targetProperty = targetProperty;
this.lookupFunctions = lookupFunctions;
this.toBindingContext = toBindingContext;
}

createBinding() {
return new LetBinding(
this.observerLocator,
this.sourceExpression,
this.targetProperty,
this.lookupFunctions,
this.toBindingContext
);
}
}

@connectable()
export class LetBinding {
/**
* @param {ObserverLocator} observerLocator
* @param {Expression} sourceExpression
* @param {Function | Element} target
* @param {string} targetProperty
* @param {*} lookupFunctions
* @param {boolean} toBindingContext indicates let binding result should be assigned to binding context
*/
constructor(observerLocator, sourceExpression, targetProperty, lookupFunctions, toBindingContext) {
this.observerLocator = observerLocator;
this.sourceExpression = sourceExpression;
this.targetProperty = targetProperty;
this.lookupFunctions = lookupFunctions;
this.source = null;
this.target = null;
this.toBindingContext = toBindingContext;
}

updateTarget() {
const value = this.sourceExpression.evaluate(this.source, this.lookupFunctions);
this.target[this.targetProperty] = value;
}

call(context) {
if (!this.isBound) {
return;
}
if (context === sourceContext) {
this.updateTarget();
return;
}
throw new Error(`Unexpected call context ${context}`);
}

/**
* @param {Scope} source Binding context
*/
bind(source) {
if (this.isBound) {
if (this.source === source) {
return;
}
this.unbind();
}

this.isBound = true;
this.source = source;
this.target = this.toBindingContext ? source.bindingContext : source.overrideContext;

if (this.sourceExpression.bind) {
this.sourceExpression.bind(this, source, this.lookupFunctions);
}

enqueueBindingConnect(this);
}

unbind() {
if (!this.isBound) {
return;
}
this.isBound = false;
if (this.sourceExpression.unbind) {
this.sourceExpression.unbind(this, this.source);
}
this.source = null;
this.target = null;
this.unobserve(true);
}

connect() {
if (!this.isBound) {
return;
}
this.updateTarget();
this.sourceExpression.connect(this, this.source);
}
}

/*eslint dot-notation:0*/
export class SyntaxInterpreter {
static inject = [Parser, ObserverLocator, EventManager, AttributeMap];
Expand Down
Loading

0 comments on commit 27cebc0

Please sign in to comment.