aurelia-materialize-bridge
Version:
Aurelia interface to http://materializecss.com/
44 lines (34 loc) • 1.09 kB
text/typescript
import * as au from "../aurelia";
.customElement("md-progress")
.autoinject
export class MdProgress {
constructor(private element: Element) { }
wrapper: HTMLDivElement;
.ato.bindable.stringMd
color: string = null;
.ato.bindable.numberMd({ defaultBindingMode: au.bindingMode.twoWay })
pixelSize?: number = null;
pixelSizeChanged(newValue: number) {
if (this.wrapper) {
this.wrapper.style.height = `${newValue}px`;
this.wrapper.style.width = `${newValue}px`;
}
}
.bindable
size: "big" | "default" | "small" = "big";
sizeChanged(newValue) {
this.pixelSize = null;
}
.bindable({ defaultBindingMode: au.bindingMode.oneTime })
type: "linear" | "circular" = "linear";
.ato.bindable.numberMd({ defaultBindingMode: au.bindingMode.twoWay })
value: number = null;
bind() {
// DO NOT REMOVE!!!
// This disables property changed callbacks for any bindable properties during initialization
// Prevents mdPixelSize getting cleared by the mdSizeChanged event during binding
}
attached() {
this.pixelSizeChanged(this.pixelSize);
}
}