How to use the @aurelia/jit.bindingCommand 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 / umd / binding-commands.js View on Github external
jit_1.bindingCommand('trigger')
    ], TriggerBindingCommand);
    exports.TriggerBindingCommand = TriggerBindingCommand;
    /**
     * Delegate binding command. Compile attr with binding symbol with command `delegate` to `DelegateBindingInstruction`
     */
    let DelegateBindingCommand = class DelegateBindingCommand {
        constructor() {
            this.bindingType = 4184 /* DelegateCommand */;
        }
        compile(binding) {
            return new runtime_html_1.DelegateBindingInstruction(binding.expression, jit_1.getTarget(binding, false));
        }
    };
    DelegateBindingCommand = tslib_1.__decorate([
        jit_1.bindingCommand('delegate')
    ], DelegateBindingCommand);
    exports.DelegateBindingCommand = DelegateBindingCommand;
    /**
     * Capture binding command. Compile attr with binding symbol with command `capture` to `CaptureBindingInstruction`
     */
    let CaptureBindingCommand = class CaptureBindingCommand {
        constructor() {
            this.bindingType = 4183 /* CaptureCommand */;
        }
        compile(binding) {
            return new runtime_html_1.CaptureBindingInstruction(binding.expression, jit_1.getTarget(binding, false));
        }
    };
    CaptureBindingCommand = tslib_1.__decorate([
        jit_1.bindingCommand('capture')
    ], CaptureBindingCommand);
github aurelia / aurelia / packages / i18n / dist / umd / t / translation-parameters-renderer.js View on Github external
this.to = to;
            this.type = exports.TranslationParametersInstructionType;
            this.mode = runtime_1.BindingMode.toView;
        }
    }
    exports.TranslationParametersBindingInstruction = TranslationParametersBindingInstruction;
    let TranslationParametersBindingCommand = class TranslationParametersBindingCommand {
        constructor() {
            this.bindingType = 53 /* BindCommand */;
        }
        compile(binding) {
            return new TranslationParametersBindingInstruction(binding.expression, jit_1.getTarget(binding, false));
        }
    };
    TranslationParametersBindingCommand = tslib_1.__decorate([
        jit_1.bindingCommand(attribute)
    ], TranslationParametersBindingCommand);
    exports.TranslationParametersBindingCommand = TranslationParametersBindingCommand;
    let TranslationParametersBindingRenderer = class TranslationParametersBindingRenderer {
        constructor(parser, observerLocator) {
            this.parser = parser;
            this.observerLocator = observerLocator;
        }
        render(flags, context, controller, target, instruction) {
            translation_binding_1.TranslationBinding.create({ parser: this.parser, observerLocator: this.observerLocator, context, controller: controller, target, instruction, isParameterContext: true });
        }
    };
    TranslationParametersBindingRenderer = tslib_1.__decorate([
        runtime_1.instructionRenderer(exports.TranslationParametersInstructionType),
        tslib_1.__param(0, runtime_1.IExpressionParser),
        tslib_1.__param(1, runtime_1.IObserverLocator),
        tslib_1.__metadata("design:paramtypes", [Object, Object])
github aurelia / aurelia / packages / jit-html / dist / esnext / binding-commands.js View on Github external
bindingCommand('style')
], StyleBindingCommand);
export { StyleBindingCommand };
/**
 * Class binding command. Compile attr with binding symbol with command `class` to `AttributeBindingInstruction`
 */
let ClassBindingCommand = class ClassBindingCommand {
    constructor() {
        this.bindingType = 32 /* IsProperty */;
    }
    compile(binding) {
        return new AttributeBindingInstruction('class', binding.expression, getTarget(binding, false));
    }
};
ClassBindingCommand = __decorate([
    bindingCommand('class')
], ClassBindingCommand);
export { ClassBindingCommand };
/**
 * Binding command to refer different targets (element, custom element/attribute view models, controller) afterAttach to an element
 */
let RefBindingCommand = class RefBindingCommand {
    constructor() {
        this.bindingType = 32 /* IsProperty */ | 4096 /* IgnoreCustomAttr */;
    }
    compile(binding) {
        return new RefBindingInstruction(binding.expression, getTarget(binding, false));
    }
};
RefBindingCommand = __decorate([
    bindingCommand('ref')
], RefBindingCommand);
github aurelia / aurelia / packages / jit-html / dist / umd / binding-commands.js View on Github external
jit_1.bindingCommand('style')
    ], StyleBindingCommand);
    exports.StyleBindingCommand = StyleBindingCommand;
    /**
     * Class binding command. Compile attr with binding symbol with command `class` to `AttributeBindingInstruction`
     */
    let ClassBindingCommand = class ClassBindingCommand {
        constructor() {
            this.bindingType = 32 /* IsProperty */;
        }
        compile(binding) {
            return new runtime_html_1.AttributeBindingInstruction('class', binding.expression, jit_1.getTarget(binding, false));
        }
    };
    ClassBindingCommand = tslib_1.__decorate([
        jit_1.bindingCommand('class')
    ], ClassBindingCommand);
    exports.ClassBindingCommand = ClassBindingCommand;
    /**
     * Binding command to refer different targets (element, custom element/attribute view models, controller) afterAttach to an element
     */
    let RefBindingCommand = class RefBindingCommand {
        constructor() {
            this.bindingType = 32 /* IsProperty */ | 4096 /* IgnoreCustomAttr */;
        }
        compile(binding) {
            return new runtime_1.RefBindingInstruction(binding.expression, jit_1.getTarget(binding, false));
        }
    };
    RefBindingCommand = tslib_1.__decorate([
        jit_1.bindingCommand('ref')
    ], RefBindingCommand);
github aurelia / aurelia / packages / jit-html / dist / esnext / binding-commands.js View on Github external
bindingCommand('class')
], ClassBindingCommand);
export { ClassBindingCommand };
/**
 * Binding command to refer different targets (element, custom element/attribute view models, controller) afterAttach to an element
 */
let RefBindingCommand = class RefBindingCommand {
    constructor() {
        this.bindingType = 32 /* IsProperty */ | 4096 /* IgnoreCustomAttr */;
    }
    compile(binding) {
        return new RefBindingInstruction(binding.expression, getTarget(binding, false));
    }
};
RefBindingCommand = __decorate([
    bindingCommand('ref')
], RefBindingCommand);
export { RefBindingCommand };
//# sourceMappingURL=binding-commands.js.map
github aurelia / aurelia / packages / jit-html / dist / esnext / binding-commands.js View on Github external
bindingCommand('attr')
], AttrBindingCommand);
export { AttrBindingCommand };
/**
 * Style binding command. Compile attr with binding symbol with command `style` to `AttributeBindingInstruction`
 */
let StyleBindingCommand = class StyleBindingCommand {
    constructor() {
        this.bindingType = 32 /* IsProperty */;
    }
    compile(binding) {
        return new AttributeBindingInstruction('style', binding.expression, getTarget(binding, false));
    }
};
StyleBindingCommand = __decorate([
    bindingCommand('style')
], StyleBindingCommand);
export { StyleBindingCommand };
/**
 * Class binding command. Compile attr with binding symbol with command `class` to `AttributeBindingInstruction`
 */
let ClassBindingCommand = class ClassBindingCommand {
    constructor() {
        this.bindingType = 32 /* IsProperty */;
    }
    compile(binding) {
        return new AttributeBindingInstruction('class', binding.expression, getTarget(binding, false));
    }
};
ClassBindingCommand = __decorate([
    bindingCommand('class')
], ClassBindingCommand);
github aurelia / aurelia / packages / jit-html / src / binding-commands.ts View on Github external
/**
 * Trigger binding command. Compile attr with binding symbol with command `trigger` to `TriggerBindingInstruction`
 */
@bindingCommand('trigger')
export class TriggerBindingCommand implements BindingCommandInstance {
  public readonly bindingType: BindingType.TriggerCommand = BindingType.TriggerCommand;

  public compile(binding: PlainAttributeSymbol | BindingSymbol): HTMLAttributeInstruction {
    return new TriggerBindingInstruction(binding.expression as IsBindingBehavior, getTarget(binding, false));
  }
}

/**
 * Delegate binding command. Compile attr with binding symbol with command `delegate` to `DelegateBindingInstruction`
 */
@bindingCommand('delegate')
export class DelegateBindingCommand implements BindingCommandInstance {
  public readonly bindingType: BindingType.DelegateCommand = BindingType.DelegateCommand;

  public compile(binding: PlainAttributeSymbol | BindingSymbol): HTMLAttributeInstruction {
    return new DelegateBindingInstruction(binding.expression as IsBindingBehavior, getTarget(binding, false));
  }
}

/**
 * Capture binding command. Compile attr with binding symbol with command `capture` to `CaptureBindingInstruction`
 */
@bindingCommand('capture')
export class CaptureBindingCommand implements BindingCommandInstance {
  public readonly bindingType: BindingType.CaptureCommand = BindingType.CaptureCommand;

  public compile(binding: PlainAttributeSymbol | BindingSymbol): HTMLAttributeInstruction {
github aurelia / aurelia / packages / jit-html / src / binding-commands.ts View on Github external
/**
 * Delegate binding command. Compile attr with binding symbol with command `delegate` to `DelegateBindingInstruction`
 */
@bindingCommand('delegate')
export class DelegateBindingCommand implements BindingCommandInstance {
  public readonly bindingType: BindingType.DelegateCommand = BindingType.DelegateCommand;

  public compile(binding: PlainAttributeSymbol | BindingSymbol): HTMLAttributeInstruction {
    return new DelegateBindingInstruction(binding.expression as IsBindingBehavior, getTarget(binding, false));
  }
}

/**
 * Capture binding command. Compile attr with binding symbol with command `capture` to `CaptureBindingInstruction`
 */
@bindingCommand('capture')
export class CaptureBindingCommand implements BindingCommandInstance {
  public readonly bindingType: BindingType.CaptureCommand = BindingType.CaptureCommand;

  public compile(binding: PlainAttributeSymbol | BindingSymbol): HTMLAttributeInstruction {
    return new CaptureBindingInstruction(binding.expression as IsBindingBehavior, getTarget(binding, false));
  }
}

/**
 * Attr binding command. Compile attr with binding symbol with command `attr` to `AttributeBindingInstruction`
 */
@bindingCommand('attr')
export class AttrBindingCommand implements BindingCommandInstance {
  public readonly bindingType: BindingType.IsProperty = BindingType.IsProperty;

  public compile(binding: PlainAttributeSymbol | BindingSymbol): HTMLAttributeInstruction {
github aurelia / aurelia / packages / jit-html / src / binding-commands.ts View on Github external
/**
 * Style binding command. Compile attr with binding symbol with command `style` to `AttributeBindingInstruction`
 */
@bindingCommand('style')
export class StyleBindingCommand implements BindingCommandInstance {
  public readonly bindingType: BindingType.IsProperty = BindingType.IsProperty;

  public compile(binding: PlainAttributeSymbol | BindingSymbol): HTMLAttributeInstruction {
    return new AttributeBindingInstruction('style', binding.expression as IsBindingBehavior, getTarget(binding, false));
  }
}

/**
 * Class binding command. Compile attr with binding symbol with command `class` to `AttributeBindingInstruction`
 */
@bindingCommand('class')
export class ClassBindingCommand implements BindingCommandInstance {
  public readonly bindingType: BindingType.IsProperty = BindingType.IsProperty;

  public compile(binding: PlainAttributeSymbol | BindingSymbol): HTMLAttributeInstruction {
    return new AttributeBindingInstruction('class', binding.expression as IsBindingBehavior, getTarget(binding, false));
  }
}

/**
 * Binding command to refer different targets (element, custom element/attribute view models, controller) afterAttach to an element
 */
@bindingCommand('ref')
export class RefBindingCommand implements BindingCommandInstance {
  public readonly bindingType: BindingType.IsProperty | BindingType.IgnoreCustomAttr = BindingType.IsProperty | BindingType.IgnoreCustomAttr;

  public compile(binding: PlainAttributeSymbol | BindingSymbol): RefBindingInstruction {
github aurelia / aurelia / packages / i18n / src / t / translation-parameters-renderer.ts View on Github external
public [attribute](rawName: string, rawValue: string, parts: string[]): AttrSyntax {
    return new AttrSyntax(rawName, rawValue, '', attribute);
  }
}

export class TranslationParametersBindingInstruction {
  public readonly type: string = TranslationParametersInstructionType;
  public mode: BindingMode.toView = BindingMode.toView;

  public constructor(
    public from: IsBindingBehavior,
    public to: string,
  ) {}
}

@bindingCommand(attribute)
export class TranslationParametersBindingCommand implements BindingCommandInstance {
  public readonly bindingType: BindingType.BindCommand = BindingType.BindCommand;

  public compile(binding: PlainAttributeSymbol | BindingSymbol): TranslationParametersBindingInstruction {
    return new TranslationParametersBindingInstruction(binding.expression as IsBindingBehavior, getTarget(binding, false));
  }
}

@instructionRenderer(TranslationParametersInstructionType)
export class TranslationParametersBindingRenderer implements IInstructionRenderer {
  public constructor(
    @IExpressionParser private readonly parser: IExpressionParser,
    @IObserverLocator private readonly observerLocator: IObserverLocator,
  ) { }

  public render(flags: LifecycleFlags, dom: IDOM, context: IRenderContext, renderable: IController, target: HTMLElement, instruction: ICallBindingInstruction): void {