elexis/lib/$Button.ts
defaultkavy 8e37f65f4f fix: declare global not working.
fix: Array.detype() return empty array.
new: RouteRecord, Route with path resolve function.
change: $ElementManager rename to $NodeManager.
add: $Node.hide() and $Node.show().
fix: $Node parent undefined.
add: create element with 'label', 'input'.
new: $.state() to binding data in element.
new: $Form, $Button.
fix: Router resolve path id bug
2024-02-03 09:33:34 +08:00

22 lines
953 B
TypeScript

import { $Container, $ContainerOptions } from "./$Container";
import { FormElementMethod, $FormElementMethod } from "./$Form";
export interface $ButtonOptions extends $ContainerOptions {}
//@ts-expect-error
export interface $Button extends $FormElementMethod {}
@FormElementMethod
export class $Button extends $Container<HTMLButtonElement> {
constructor(options?: $ButtonOptions) {
super('button', options);
}
disabled(): boolean;
disabled(disabled: boolean): this;
disabled(disabled?: boolean) { return $.fluent(this, arguments, () => this.dom.disabled, () => $.set(this.dom, 'disabled', disabled))}
type(): ButtonType;
type(type: ButtonType): this;
type(type?: ButtonType) { return $.fluent(this, arguments, () => this.dom.type as ButtonType, () => $.set(this.dom, 'type', type))}
checkValidity() { return this.dom.checkValidity() }
reportValidity() { return this.dom.reportValidity() }
}