defaultkavy
7f8f599b8a
new: $HTMLElementAPIs optimize: collect utilty method of HTMLElement and merge into different $Element
19 lines
804 B
TypeScript
19 lines
804 B
TypeScript
import { $HTMLElementAPIFilter, $HTMLElementAPIs } from "../$ElementTemplate";
|
|
import { $StateArgument } from "../$State";
|
|
import { $Util } from "../$Util";
|
|
import { $Container, $ContainerOptions } from "./$Container";
|
|
export interface $LabelOptions extends $ContainerOptions {}
|
|
export class $Label extends $Container<HTMLLabelElement> {
|
|
constructor(options?: $LabelOptions) {
|
|
super('label', options);
|
|
}
|
|
|
|
for(): string;
|
|
for(name: $StateArgument<string>): this;
|
|
for(name?: $StateArgument<string>) { return $.fluent(this, arguments, () => this.dom.htmlFor, () => { $.set(this.dom, 'htmlFor', name)}) }
|
|
|
|
get control() { return this.dom.control }
|
|
}
|
|
|
|
export interface $Label extends $HTMLElementAPIFilter<$Label, 'form'> {}
|
|
$Util.mixin($Label, $HTMLElementAPIs.create('form',)) |