How to use the @aurelia/jit.BindingCommandResource.define function in @aurelia/jit

To help you get started, we’ve selected a few @aurelia/jit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aurelia / aurelia / packages / jit-html / dist / index.es6.js View on Github external
return new DelegateBindingInstruction(binding.expression, getTarget(binding, false));
    }
}
BindingCommandResource.define('delegate', DelegateBindingCommand);
/**
 * Capture binding command. Compile attr with binding symbol with command `capture` to `CaptureBindingInstruction`
 */
class CaptureBindingCommand {
    constructor() {
        this.bindingType = 87 /* CaptureCommand */;
    }
    compile(binding) {
        return new CaptureBindingInstruction(binding.expression, getTarget(binding, false));
    }
}
BindingCommandResource.define('capture', CaptureBindingCommand);
/**
 * Attr binding command. Compile attr with binding symbol with command `attr` to `AttributeBindingInstruction`
 */
class AttrBindingCommand {
    constructor() {
        this.bindingType = 32 /* IsProperty */;
    }
    compile(binding) {
        const target = getTarget(binding, false);
        return new AttributeBindingInstruction(target, binding.expression, target);
    }
}
BindingCommandResource.define('attr', AttrBindingCommand);
/**
 * Style binding command. Compile attr with binding symbol with command `style` to `AttributeBindingInstruction`
 */
github aurelia / aurelia / packages / jit-html / dist / index.es6.js View on Github external
return new AttributeBindingInstruction(target, binding.expression, target);
    }
}
BindingCommandResource.define('attr', AttrBindingCommand);
/**
 * Style binding command. Compile attr with binding symbol with command `style` to `AttributeBindingInstruction`
 */
class StyleBindingCommand {
    constructor() {
        this.bindingType = 32 /* IsProperty */;
    }
    compile(binding) {
        return new AttributeBindingInstruction('style', binding.expression, getTarget(binding, false));
    }
}
BindingCommandResource.define('style', StyleBindingCommand);
/**
 * Class binding command. Compile attr with binding symbol with command `class` to `AttributeBindingInstruction`
 */
class ClassBindingCommand {
    constructor() {
        this.bindingType = 32 /* IsProperty */;
    }
    compile(binding) {
        return new AttributeBindingInstruction('class', binding.expression, getTarget(binding, false));
    }
}
BindingCommandResource.define('class', ClassBindingCommand);

/**
 * Attribute syntax pattern recognizer, helping Aurelia understand template:
 * ```html
github aurelia / aurelia / packages / jit-html / dist / index.es6.js View on Github external
return new TriggerBindingInstruction(binding.expression, getTarget(binding, false));
    }
}
BindingCommandResource.define('trigger', TriggerBindingCommand);
/**
 * Delegate binding command. Compile attr with binding symbol with command `delegate` to `DelegateBindingInstruction`
 */
class DelegateBindingCommand {
    constructor() {
        this.bindingType = 88 /* DelegateCommand */;
    }
    compile(binding) {
        return new DelegateBindingInstruction(binding.expression, getTarget(binding, false));
    }
}
BindingCommandResource.define('delegate', DelegateBindingCommand);
/**
 * Capture binding command. Compile attr with binding symbol with command `capture` to `CaptureBindingInstruction`
 */
class CaptureBindingCommand {
    constructor() {
        this.bindingType = 87 /* CaptureCommand */;
    }
    compile(binding) {
        return new CaptureBindingInstruction(binding.expression, getTarget(binding, false));
    }
}
BindingCommandResource.define('capture', CaptureBindingCommand);
/**
 * Attr binding command. Compile attr with binding symbol with command `attr` to `AttributeBindingInstruction`
 */
class AttrBindingCommand {
github aurelia / aurelia / packages / jit-html / dist / index.es6.js View on Github external
}
}
BindingCommandResource.define('capture', CaptureBindingCommand);
/**
 * Attr binding command. Compile attr with binding symbol with command `attr` to `AttributeBindingInstruction`
 */
class AttrBindingCommand {
    constructor() {
        this.bindingType = 32 /* IsProperty */;
    }
    compile(binding) {
        const target = getTarget(binding, false);
        return new AttributeBindingInstruction(target, binding.expression, target);
    }
}
BindingCommandResource.define('attr', AttrBindingCommand);
/**
 * Style binding command. Compile attr with binding symbol with command `style` to `AttributeBindingInstruction`
 */
class StyleBindingCommand {
    constructor() {
        this.bindingType = 32 /* IsProperty */;
    }
    compile(binding) {
        return new AttributeBindingInstruction('style', binding.expression, getTarget(binding, false));
    }
}
BindingCommandResource.define('style', StyleBindingCommand);
/**
 * Class binding command. Compile attr with binding symbol with command `class` to `AttributeBindingInstruction`
 */
class ClassBindingCommand {
github aurelia / aurelia / packages / jit-html / dist / index.es6.js View on Github external
import { TriggerBindingInstruction, DelegateBindingInstruction, CaptureBindingInstruction, AttributeBindingInstruction, TextBindingInstruction, SetAttributeInstruction, BasicConfiguration as BasicConfiguration$1 } from '@aurelia/runtime-html';
import { Profiler, Tracer, camelCase, DI, Registration, PLATFORM } from '@aurelia/kernel';
import { BindingMode, IDOM, ITemplateCompiler, LetBindingInstruction, LetElementInstruction, HydrateElementInstruction, HydrateTemplateController, SetPropertyInstruction, InterpolationInstruction, HydrateAttributeInstruction, RefBindingInstruction, IExpressionParser } from '@aurelia/runtime';

/**
 * Trigger binding command. Compile attr with binding symbol with command `trigger` to `TriggerBindingInstruction`
 */
class TriggerBindingCommand {
    constructor() {
        this.bindingType = 86 /* TriggerCommand */;
    }
    compile(binding) {
        return new TriggerBindingInstruction(binding.expression, getTarget(binding, false));
    }
}
BindingCommandResource.define('trigger', TriggerBindingCommand);
/**
 * Delegate binding command. Compile attr with binding symbol with command `delegate` to `DelegateBindingInstruction`
 */
class DelegateBindingCommand {
    constructor() {
        this.bindingType = 88 /* DelegateCommand */;
    }
    compile(binding) {
        return new DelegateBindingInstruction(binding.expression, getTarget(binding, false));
    }
}
BindingCommandResource.define('delegate', DelegateBindingCommand);
/**
 * Capture binding command. Compile attr with binding symbol with command `capture` to `CaptureBindingInstruction`
 */
class CaptureBindingCommand {
github aurelia / aurelia / packages / jit-html / dist / index.es6.js View on Github external
return new AttributeBindingInstruction('style', binding.expression, getTarget(binding, false));
    }
}
BindingCommandResource.define('style', StyleBindingCommand);
/**
 * Class binding command. Compile attr with binding symbol with command `class` to `AttributeBindingInstruction`
 */
class ClassBindingCommand {
    constructor() {
        this.bindingType = 32 /* IsProperty */;
    }
    compile(binding) {
        return new AttributeBindingInstruction('class', binding.expression, getTarget(binding, false));
    }
}
BindingCommandResource.define('class', ClassBindingCommand);

/**
 * Attribute syntax pattern recognizer, helping Aurelia understand template:
 * ```html
 * <div></div>
 * <div></div>
 * ````
 */
class AttrAttributePattern {
    ['attr.PART'](rawName, rawValue, parts) {
        return new AttrSyntax(rawName, rawValue, parts[1], 'attr');
    }
    ['PART.attr'](rawName, rawValue, parts) {
        return new AttrSyntax(rawName, rawValue, parts[0], 'attr');
    }
}