Page MenuHomeSealhub

checkbox.ts
No OneTemporary

checkbox.ts

import { Context } from "koa";
import { FormDataValue } from "../form-types.js";
import { Tickable, TickableOptions } from "./tickable.js";
import { FormField } from "../fields/field.js";
export class Checkbox extends Tickable<boolean> {
type = <const>"checkbox";
isChecked(
_ctx: Context,
_data: Record<string, FormDataValue>,
value: boolean
): boolean {
return value;
}
getValueAttribute(): string {
return "";
}
}
export class CheckboxWithValue extends Checkbox {
constructor(
public field: FormField<boolean, boolean>,
options: TickableOptions,
public value: string
) {
super(field, options);
}
getValueAttribute(): string {
return this.value;
}
}

File Metadata

Mime Type
text/x-java
Expires
Wed, May 7, 19:47 (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
634649
Default Alt Text
checkbox.ts (688 B)

Event Timeline