@paperbits/forms
Version:
Paperbits components for form builder.
30 lines (26 loc) • 1.06 kB
text/typescript
import * as ko from "knockout";
import template from "./checkbox.html";
import { Component } from "@paperbits/common/ko/decorators";
import { StyleModel } from "@paperbits/common/styles";
({
selector: "checkbox",
template: template
})
export class Checkbox {
public readonly label: ko.Observable<string>;
public readonly name: ko.Observable<string>;
public readonly value: ko.Observable<boolean>;
public readonly styles: ko.Observable<StyleModel>;
public readonly readonly: ko.Observable<boolean>;
public readonly required: ko.Observable<boolean>;
public readonly invalidFeedback: ko.Observable<string>;
constructor() {
this.label = ko.observable<string>("Checkbox");
this.name = ko.observable<string>();
this.value = ko.observable<boolean>();
this.readonly = ko.observable<boolean>();
this.required = ko.observable<boolean>();
this.invalidFeedback = ko.observable<string>();
this.styles = ko.observable<StyleModel>();
}
}