elexis/lib/node/$Button.ts
defaultkavy 7f8f599b8a v0.2.2
new: $HTMLElementAPIs
optimize: collect utilty method of HTMLElement and merge into different $Element
2024-05-15 18:38:45 +08:00

16 lines
953 B
TypeScript

import { $Container, $ContainerOptions } from "./$Container";
import { $Util } from "../$Util";
import { $HTMLElementAPIFilter, $HTMLElementAPIs } from "../$ElementTemplate";
export interface $ButtonOptions extends $ContainerOptions {}
export class $Button extends $Container<HTMLButtonElement> {
constructor(options?: $ButtonOptions) {
super('button', options);
}
type(): ButtonType;
type(type: ButtonType): this;
type(type?: ButtonType) { return $.fluent(this, arguments, () => this.dom.type as ButtonType, () => $.set(this.dom, 'type', type as any))}
}
export interface $Button extends $HTMLElementAPIFilter<$Button, 'disabled' | 'checkValidity' | 'formAction' | 'formEnctype' | 'formMethod' | 'formNoValidate' | 'formTarget' | 'reportValidity'> {}
$Util.mixin($Button, $HTMLElementAPIs.create('disabled', 'checkValidity', 'formAction', 'formEnctype', 'formMethod', 'formNoValidate', 'formTarget', 'reportValidity'))