Label content is specialized as HTMLLabelElement

This commit is contained in:
Shagen Ogandzhanian
2021-06-14 12:24:44 +02:00
parent 603901b814
commit d38dcbe8a2
2 changed files with 5 additions and 3 deletions

View File

@@ -28,6 +28,7 @@ import org.w3c.dom.HTMLHeadingElement
import org.w3c.dom.HTMLImageElement
import org.w3c.dom.HTMLInputElement
import org.w3c.dom.HTMLLIElement
import org.w3c.dom.HTMLLabelElement
import org.w3c.dom.HTMLOListElement
import org.w3c.dom.HTMLOptGroupElement
import org.w3c.dom.HTMLOptionElement
@@ -133,7 +134,7 @@ interface ElementBuilder<TElement : Element> {
val Main: ElementBuilder<HTMLElement> = ElementBuilderImplementation("main")
val Footer: ElementBuilder<HTMLElement> = ElementBuilderImplementation("footer")
val Hr: ElementBuilder<HTMLHRElement> = ElementBuilderImplementation("hr")
val Label: ElementBuilder<HTMLElement> = ElementBuilderImplementation("label")
val Label: ElementBuilder<HTMLLabelElement> = ElementBuilderImplementation("label")
val Table: ElementBuilder<HTMLTableElement> = ElementBuilderImplementation("table")
val Caption: ElementBuilder<HTMLTableCaptionElement> = ElementBuilderImplementation("caption")
val Col: ElementBuilder<HTMLTableColElement> = ElementBuilderImplementation("col")

View File

@@ -27,6 +27,7 @@ import org.w3c.dom.HTMLHRElement
import org.w3c.dom.HTMLImageElement
import org.w3c.dom.HTMLInputElement
import org.w3c.dom.HTMLLIElement
import org.w3c.dom.HTMLLabelElement
import org.w3c.dom.HTMLOListElement
import org.w3c.dom.HTMLOptGroupElement
import org.w3c.dom.HTMLOptionElement
@@ -371,9 +372,9 @@ fun Hr(
fun Label(
forId: String? = null,
attrs: AttrBuilderContext<Tag.Label> = {},
content: ContentBuilder<HTMLElement>? = null
content: ContentBuilder<HTMLLabelElement>? = null
) {
TagElement<Tag.Label, HTMLElement>(
TagElement<Tag.Label, HTMLLabelElement>(
elementBuilder = ElementBuilder.Label,
applyAttrs = {
forId(forId)