|
|
@ -1,16 +1,16 @@ |
|
|
|
package org.jetbrains.compose.web.dom |
|
|
|
package org.jetbrains.compose.web.dom |
|
|
|
|
|
|
|
|
|
|
|
import androidx.compose.runtime.* |
|
|
|
import androidx.compose.runtime.* |
|
|
|
import androidx.compose.web.attributes.SelectAttrsBuilder |
|
|
|
import androidx.compose.web.attributes.SelectAttrsScope |
|
|
|
import kotlinx.browser.document |
|
|
|
import kotlinx.browser.document |
|
|
|
import org.jetbrains.compose.web.attributes.* |
|
|
|
import org.jetbrains.compose.web.attributes.* |
|
|
|
import org.jetbrains.compose.web.attributes.builders.* |
|
|
|
import org.jetbrains.compose.web.attributes.builders.* |
|
|
|
import org.jetbrains.compose.web.css.CSSRuleDeclarationList |
|
|
|
import org.jetbrains.compose.web.css.CSSRuleDeclarationList |
|
|
|
import org.jetbrains.compose.web.css.StyleSheetBuilder |
|
|
|
import org.jetbrains.compose.web.css.StyleSheetBuilder |
|
|
|
import org.jetbrains.compose.web.css.StyleSheetBuilderImpl |
|
|
|
import org.jetbrains.compose.web.css.StyleSheetBuilderImpl |
|
|
|
|
|
|
|
import org.jetbrains.compose.web.internal.runtime.ComposeWebInternalApi |
|
|
|
import org.jetbrains.compose.web.internal.runtime.DomApplier |
|
|
|
import org.jetbrains.compose.web.internal.runtime.DomApplier |
|
|
|
import org.jetbrains.compose.web.internal.runtime.DomNodeWrapper |
|
|
|
import org.jetbrains.compose.web.internal.runtime.DomNodeWrapper |
|
|
|
import org.jetbrains.compose.web.internal.runtime.ComposeWebInternalApi |
|
|
|
|
|
|
|
import org.w3c.dom.Element |
|
|
|
import org.w3c.dom.Element |
|
|
|
import org.w3c.dom.HTMLAnchorElement |
|
|
|
import org.w3c.dom.HTMLAnchorElement |
|
|
|
import org.w3c.dom.HTMLAreaElement |
|
|
|
import org.w3c.dom.HTMLAreaElement |
|
|
@ -23,8 +23,8 @@ import org.w3c.dom.HTMLElement |
|
|
|
import org.w3c.dom.HTMLEmbedElement |
|
|
|
import org.w3c.dom.HTMLEmbedElement |
|
|
|
import org.w3c.dom.HTMLFieldSetElement |
|
|
|
import org.w3c.dom.HTMLFieldSetElement |
|
|
|
import org.w3c.dom.HTMLFormElement |
|
|
|
import org.w3c.dom.HTMLFormElement |
|
|
|
import org.w3c.dom.HTMLHeadingElement |
|
|
|
|
|
|
|
import org.w3c.dom.HTMLHRElement |
|
|
|
import org.w3c.dom.HTMLHRElement |
|
|
|
|
|
|
|
import org.w3c.dom.HTMLHeadingElement |
|
|
|
import org.w3c.dom.HTMLIFrameElement |
|
|
|
import org.w3c.dom.HTMLIFrameElement |
|
|
|
import org.w3c.dom.HTMLImageElement |
|
|
|
import org.w3c.dom.HTMLImageElement |
|
|
|
import org.w3c.dom.HTMLInputElement |
|
|
|
import org.w3c.dom.HTMLInputElement |
|
|
@ -60,7 +60,12 @@ import org.w3c.dom.HTMLVideoElement |
|
|
|
import org.w3c.dom.Text |
|
|
|
import org.w3c.dom.Text |
|
|
|
import org.w3c.dom.css.CSSStyleSheet |
|
|
|
import org.w3c.dom.css.CSSStyleSheet |
|
|
|
|
|
|
|
|
|
|
|
typealias AttrBuilderContext<T> = AttrsBuilder<T>.() -> Unit |
|
|
|
@Deprecated( |
|
|
|
|
|
|
|
message = "Renamed to AttrsBuilder<T>", |
|
|
|
|
|
|
|
replaceWith = ReplaceWith("AttrsBuilder<T>", "org.jetbrains.compose.web.dom.AttrsBuilder") |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
typealias AttrBuilderContext<T> = AttrsBuilder<T> |
|
|
|
|
|
|
|
typealias AttrsBuilder<T> = AttrsScope<T>.() -> Unit |
|
|
|
typealias ContentBuilder<T> = @Composable ElementScope<T>.() -> Unit |
|
|
|
typealias ContentBuilder<T> = @Composable ElementScope<T>.() -> Unit |
|
|
|
|
|
|
|
|
|
|
|
private open class ElementBuilderImplementation<TElement : Element>(private val tagName: String) : ElementBuilder<TElement> { |
|
|
|
private open class ElementBuilderImplementation<TElement : Element>(private val tagName: String) : ElementBuilder<TElement> { |
|
|
@ -163,7 +168,7 @@ fun interface ElementBuilder<TElement : Element> { |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Address( |
|
|
|
fun Address( |
|
|
|
attrs: AttrBuilderContext<HTMLElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLElement>? = null, |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -175,7 +180,7 @@ fun Address( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Article( |
|
|
|
fun Article( |
|
|
|
attrs: AttrBuilderContext<HTMLElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLElement>? = null, |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -187,7 +192,7 @@ fun Article( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Aside( |
|
|
|
fun Aside( |
|
|
|
attrs: AttrBuilderContext<HTMLElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLElement>? = null, |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -199,7 +204,7 @@ fun Aside( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Header( |
|
|
|
fun Header( |
|
|
|
attrs: AttrBuilderContext<HTMLElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLElement>? = null, |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -211,7 +216,7 @@ fun Header( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Area( |
|
|
|
fun Area( |
|
|
|
attrs: AttrBuilderContext<HTMLAreaElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLAreaElement>? = null, |
|
|
|
content: ContentBuilder<HTMLAreaElement>? = null |
|
|
|
content: ContentBuilder<HTMLAreaElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -223,7 +228,7 @@ fun Area( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Audio( |
|
|
|
fun Audio( |
|
|
|
attrs: AttrBuilderContext<HTMLAudioElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLAudioElement>? = null, |
|
|
|
content: ContentBuilder<HTMLAudioElement>? = null |
|
|
|
content: ContentBuilder<HTMLAudioElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -235,7 +240,7 @@ fun Audio( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun HTMLMap( |
|
|
|
fun HTMLMap( |
|
|
|
attrs: AttrBuilderContext<HTMLMapElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLMapElement>? = null, |
|
|
|
content: ContentBuilder<HTMLMapElement>? = null |
|
|
|
content: ContentBuilder<HTMLMapElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -247,7 +252,7 @@ fun HTMLMap( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Track( |
|
|
|
fun Track( |
|
|
|
attrs: AttrBuilderContext<HTMLTrackElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLTrackElement>? = null, |
|
|
|
content: ContentBuilder<HTMLTrackElement>? = null |
|
|
|
content: ContentBuilder<HTMLTrackElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -259,7 +264,7 @@ fun Track( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Video( |
|
|
|
fun Video( |
|
|
|
attrs: AttrBuilderContext<HTMLVideoElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLVideoElement>? = null, |
|
|
|
content: ContentBuilder<HTMLVideoElement>? = null |
|
|
|
content: ContentBuilder<HTMLVideoElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -271,7 +276,7 @@ fun Video( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Datalist( |
|
|
|
fun Datalist( |
|
|
|
attrs: AttrBuilderContext<HTMLDataListElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLDataListElement>? = null, |
|
|
|
content: ContentBuilder<HTMLDataListElement>? = null |
|
|
|
content: ContentBuilder<HTMLDataListElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -283,7 +288,7 @@ fun Datalist( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Fieldset( |
|
|
|
fun Fieldset( |
|
|
|
attrs: AttrBuilderContext<HTMLFieldSetElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLFieldSetElement>? = null, |
|
|
|
content: ContentBuilder<HTMLFieldSetElement>? = null |
|
|
|
content: ContentBuilder<HTMLFieldSetElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -295,7 +300,7 @@ fun Fieldset( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Legend( |
|
|
|
fun Legend( |
|
|
|
attrs: AttrBuilderContext<HTMLLegendElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLLegendElement>? = null, |
|
|
|
content: ContentBuilder<HTMLLegendElement>? = null |
|
|
|
content: ContentBuilder<HTMLLegendElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -307,7 +312,7 @@ fun Legend( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Meter( |
|
|
|
fun Meter( |
|
|
|
attrs: AttrBuilderContext<HTMLMeterElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLMeterElement>? = null, |
|
|
|
content: ContentBuilder<HTMLMeterElement>? = null |
|
|
|
content: ContentBuilder<HTMLMeterElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -319,7 +324,7 @@ fun Meter( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Output( |
|
|
|
fun Output( |
|
|
|
attrs: AttrBuilderContext<HTMLOutputElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLOutputElement>? = null, |
|
|
|
content: ContentBuilder<HTMLOutputElement>? = null |
|
|
|
content: ContentBuilder<HTMLOutputElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -331,7 +336,7 @@ fun Output( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Progress( |
|
|
|
fun Progress( |
|
|
|
attrs: AttrBuilderContext<HTMLProgressElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLProgressElement>? = null, |
|
|
|
content: ContentBuilder<HTMLProgressElement>? = null |
|
|
|
content: ContentBuilder<HTMLProgressElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -343,7 +348,7 @@ fun Progress( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Embed( |
|
|
|
fun Embed( |
|
|
|
attrs: AttrBuilderContext<HTMLEmbedElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLEmbedElement>? = null, |
|
|
|
content: ContentBuilder<HTMLEmbedElement>? = null |
|
|
|
content: ContentBuilder<HTMLEmbedElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -355,7 +360,7 @@ fun Embed( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Iframe( |
|
|
|
fun Iframe( |
|
|
|
attrs: AttrBuilderContext<HTMLIFrameElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLIFrameElement>? = null, |
|
|
|
content: ContentBuilder<HTMLIFrameElement>? = null |
|
|
|
content: ContentBuilder<HTMLIFrameElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -367,7 +372,7 @@ fun Iframe( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Object( |
|
|
|
fun Object( |
|
|
|
attrs: AttrBuilderContext<HTMLObjectElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLObjectElement>? = null, |
|
|
|
content: ContentBuilder<HTMLObjectElement>? = null |
|
|
|
content: ContentBuilder<HTMLObjectElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -379,7 +384,7 @@ fun Object( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Param( |
|
|
|
fun Param( |
|
|
|
attrs: AttrBuilderContext<HTMLParamElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLParamElement>? = null, |
|
|
|
content: ContentBuilder<HTMLParamElement>? = null |
|
|
|
content: ContentBuilder<HTMLParamElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -391,7 +396,7 @@ fun Param( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Picture( |
|
|
|
fun Picture( |
|
|
|
attrs: AttrBuilderContext<HTMLPictureElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLPictureElement>? = null, |
|
|
|
content: ContentBuilder<HTMLPictureElement>? = null |
|
|
|
content: ContentBuilder<HTMLPictureElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -403,7 +408,7 @@ fun Picture( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Source( |
|
|
|
fun Source( |
|
|
|
attrs: AttrBuilderContext<HTMLSourceElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLSourceElement>? = null, |
|
|
|
content: ContentBuilder<HTMLSourceElement>? = null |
|
|
|
content: ContentBuilder<HTMLSourceElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -426,7 +431,7 @@ fun Text(value: String) { |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Div( |
|
|
|
fun Div( |
|
|
|
attrs: AttrBuilderContext<HTMLDivElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLDivElement>? = null, |
|
|
|
content: ContentBuilder<HTMLDivElement>? = null |
|
|
|
content: ContentBuilder<HTMLDivElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -439,7 +444,7 @@ fun Div( |
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun A( |
|
|
|
fun A( |
|
|
|
href: String? = null, |
|
|
|
href: String? = null, |
|
|
|
attrs: AttrBuilderContext<HTMLAnchorElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLAnchorElement>? = null, |
|
|
|
content: ContentBuilder<HTMLAnchorElement>? = null |
|
|
|
content: ContentBuilder<HTMLAnchorElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -458,101 +463,101 @@ fun A( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Button( |
|
|
|
fun Button( |
|
|
|
attrs: AttrBuilderContext<HTMLButtonElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLButtonElement>? = null, |
|
|
|
content: ContentBuilder<HTMLButtonElement>? = null |
|
|
|
content: ContentBuilder<HTMLButtonElement>? = null |
|
|
|
) = TagElement(elementBuilder = Button, applyAttrs = attrs, content = content) |
|
|
|
) = TagElement(elementBuilder = Button, applyAttrs = attrs, content = content) |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun H1( |
|
|
|
fun H1( |
|
|
|
attrs: AttrBuilderContext<HTMLHeadingElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLHeadingElement>? = null, |
|
|
|
content: ContentBuilder<HTMLHeadingElement>? = null |
|
|
|
content: ContentBuilder<HTMLHeadingElement>? = null |
|
|
|
) = TagElement(elementBuilder = H1, applyAttrs = attrs, content = content) |
|
|
|
) = TagElement(elementBuilder = H1, applyAttrs = attrs, content = content) |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun H2( |
|
|
|
fun H2( |
|
|
|
attrs: AttrBuilderContext<HTMLHeadingElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLHeadingElement>? = null, |
|
|
|
content: ContentBuilder<HTMLHeadingElement>? = null |
|
|
|
content: ContentBuilder<HTMLHeadingElement>? = null |
|
|
|
) = TagElement(elementBuilder = H2, applyAttrs = attrs, content = content) |
|
|
|
) = TagElement(elementBuilder = H2, applyAttrs = attrs, content = content) |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun H3( |
|
|
|
fun H3( |
|
|
|
attrs: AttrBuilderContext<HTMLHeadingElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLHeadingElement>? = null, |
|
|
|
content: ContentBuilder<HTMLHeadingElement>? = null |
|
|
|
content: ContentBuilder<HTMLHeadingElement>? = null |
|
|
|
) = TagElement(elementBuilder = H3, applyAttrs = attrs, content = content) |
|
|
|
) = TagElement(elementBuilder = H3, applyAttrs = attrs, content = content) |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun H4( |
|
|
|
fun H4( |
|
|
|
attrs: AttrBuilderContext<HTMLHeadingElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLHeadingElement>? = null, |
|
|
|
content: ContentBuilder<HTMLHeadingElement>? = null |
|
|
|
content: ContentBuilder<HTMLHeadingElement>? = null |
|
|
|
) = TagElement(elementBuilder = H4, applyAttrs = attrs, content = content) |
|
|
|
) = TagElement(elementBuilder = H4, applyAttrs = attrs, content = content) |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun H5( |
|
|
|
fun H5( |
|
|
|
attrs: AttrBuilderContext<HTMLHeadingElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLHeadingElement>? = null, |
|
|
|
content: ContentBuilder<HTMLHeadingElement>? = null |
|
|
|
content: ContentBuilder<HTMLHeadingElement>? = null |
|
|
|
) = TagElement(elementBuilder = H5, applyAttrs = attrs, content = content) |
|
|
|
) = TagElement(elementBuilder = H5, applyAttrs = attrs, content = content) |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun H6( |
|
|
|
fun H6( |
|
|
|
attrs: AttrBuilderContext<HTMLHeadingElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLHeadingElement>? = null, |
|
|
|
content: ContentBuilder<HTMLHeadingElement>? = null |
|
|
|
content: ContentBuilder<HTMLHeadingElement>? = null |
|
|
|
) = TagElement(elementBuilder = H6, applyAttrs = attrs, content = content) |
|
|
|
) = TagElement(elementBuilder = H6, applyAttrs = attrs, content = content) |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun P( |
|
|
|
fun P( |
|
|
|
attrs: AttrBuilderContext<HTMLParagraphElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLParagraphElement>? = null, |
|
|
|
content: ContentBuilder<HTMLParagraphElement>? = null |
|
|
|
content: ContentBuilder<HTMLParagraphElement>? = null |
|
|
|
) = TagElement(elementBuilder = P, applyAttrs = attrs, content = content) |
|
|
|
) = TagElement(elementBuilder = P, applyAttrs = attrs, content = content) |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Em( |
|
|
|
fun Em( |
|
|
|
attrs: AttrBuilderContext<HTMLElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLElement>? = null, |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
) = TagElement(elementBuilder = Em, applyAttrs = attrs, content = content) |
|
|
|
) = TagElement(elementBuilder = Em, applyAttrs = attrs, content = content) |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun I( |
|
|
|
fun I( |
|
|
|
attrs: AttrBuilderContext<HTMLElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLElement>? = null, |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
) = TagElement(elementBuilder = I, applyAttrs = attrs, content = content) |
|
|
|
) = TagElement(elementBuilder = I, applyAttrs = attrs, content = content) |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun B( |
|
|
|
fun B( |
|
|
|
attrs: AttrBuilderContext<HTMLElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLElement>? = null, |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
) = TagElement(elementBuilder = B, applyAttrs = attrs, content = content) |
|
|
|
) = TagElement(elementBuilder = B, applyAttrs = attrs, content = content) |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Small( |
|
|
|
fun Small( |
|
|
|
attrs: AttrBuilderContext<HTMLElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLElement>? = null, |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
) = TagElement(elementBuilder = Small, applyAttrs = attrs, content = content) |
|
|
|
) = TagElement(elementBuilder = Small, applyAttrs = attrs, content = content) |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Span( |
|
|
|
fun Span( |
|
|
|
attrs: AttrBuilderContext<HTMLSpanElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLSpanElement>? = null, |
|
|
|
content: ContentBuilder<HTMLSpanElement>? = null |
|
|
|
content: ContentBuilder<HTMLSpanElement>? = null |
|
|
|
) = TagElement(elementBuilder = Span, applyAttrs = attrs, content = content) |
|
|
|
) = TagElement(elementBuilder = Span, applyAttrs = attrs, content = content) |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Br(attrs: AttrBuilderContext<HTMLBRElement>? = null) = |
|
|
|
fun Br(attrs: AttrsBuilder<HTMLBRElement>? = null) = |
|
|
|
TagElement(elementBuilder = Br, applyAttrs = attrs, content = null) |
|
|
|
TagElement(elementBuilder = Br, applyAttrs = attrs, content = null) |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Ul( |
|
|
|
fun Ul( |
|
|
|
attrs: AttrBuilderContext<HTMLUListElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLUListElement>? = null, |
|
|
|
content: ContentBuilder<HTMLUListElement>? = null |
|
|
|
content: ContentBuilder<HTMLUListElement>? = null |
|
|
|
) = TagElement(elementBuilder = Ul, applyAttrs = attrs, content = content) |
|
|
|
) = TagElement(elementBuilder = Ul, applyAttrs = attrs, content = content) |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Ol( |
|
|
|
fun Ol( |
|
|
|
attrs: AttrBuilderContext<HTMLOListElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLOListElement>? = null, |
|
|
|
content: ContentBuilder<HTMLOListElement>? = null |
|
|
|
content: ContentBuilder<HTMLOListElement>? = null |
|
|
|
) = TagElement(elementBuilder = Ol, applyAttrs = attrs, content = content) |
|
|
|
) = TagElement(elementBuilder = Ol, applyAttrs = attrs, content = content) |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Li( |
|
|
|
fun Li( |
|
|
|
attrs: AttrBuilderContext<HTMLLIElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLLIElement>? = null, |
|
|
|
content: ContentBuilder<HTMLLIElement>? = null |
|
|
|
content: ContentBuilder<HTMLLIElement>? = null |
|
|
|
) = TagElement(elementBuilder = Li, applyAttrs = attrs, content = content) |
|
|
|
) = TagElement(elementBuilder = Li, applyAttrs = attrs, content = content) |
|
|
|
|
|
|
|
|
|
|
@ -560,7 +565,7 @@ fun Li( |
|
|
|
fun Img( |
|
|
|
fun Img( |
|
|
|
src: String, |
|
|
|
src: String, |
|
|
|
alt: String = "", |
|
|
|
alt: String = "", |
|
|
|
attrs: AttrBuilderContext<HTMLImageElement>? = null |
|
|
|
attrs: AttrsBuilder<HTMLImageElement>? = null |
|
|
|
) = TagElement( |
|
|
|
) = TagElement( |
|
|
|
elementBuilder = Img, |
|
|
|
elementBuilder = Img, |
|
|
|
applyAttrs = { |
|
|
|
applyAttrs = { |
|
|
@ -575,7 +580,7 @@ fun Img( |
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Form( |
|
|
|
fun Form( |
|
|
|
action: String? = null, |
|
|
|
action: String? = null, |
|
|
|
attrs: AttrBuilderContext<HTMLFormElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLFormElement>? = null, |
|
|
|
content: ContentBuilder<HTMLFormElement>? = null |
|
|
|
content: ContentBuilder<HTMLFormElement>? = null |
|
|
|
) = TagElement( |
|
|
|
) = TagElement( |
|
|
|
elementBuilder = Form, |
|
|
|
elementBuilder = Form, |
|
|
@ -590,7 +595,7 @@ fun Form( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Select( |
|
|
|
fun Select( |
|
|
|
attrs: (SelectAttrsBuilder.() -> Unit)? = null, |
|
|
|
attrs: (SelectAttrsScope.() -> Unit)? = null, |
|
|
|
multiple: Boolean = false, |
|
|
|
multiple: Boolean = false, |
|
|
|
content: ContentBuilder<HTMLSelectElement>? = null |
|
|
|
content: ContentBuilder<HTMLSelectElement>? = null |
|
|
|
) = TagElement( |
|
|
|
) = TagElement( |
|
|
@ -598,7 +603,7 @@ fun Select( |
|
|
|
applyAttrs = { |
|
|
|
applyAttrs = { |
|
|
|
if (multiple) multiple() |
|
|
|
if (multiple) multiple() |
|
|
|
if (attrs != null) { |
|
|
|
if (attrs != null) { |
|
|
|
val selectAttrsBuilder = with(SelectAttrsBuilder()) { |
|
|
|
val selectAttrsBuilder = with(SelectAttrsScope()) { |
|
|
|
attrs() |
|
|
|
attrs() |
|
|
|
this |
|
|
|
this |
|
|
|
} |
|
|
|
} |
|
|
@ -611,7 +616,7 @@ fun Select( |
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Option( |
|
|
|
fun Option( |
|
|
|
value: String, |
|
|
|
value: String, |
|
|
|
attrs: AttrBuilderContext<HTMLOptionElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLOptionElement>? = null, |
|
|
|
content: ContentBuilder<HTMLOptionElement>? = null |
|
|
|
content: ContentBuilder<HTMLOptionElement>? = null |
|
|
|
) = TagElement( |
|
|
|
) = TagElement( |
|
|
|
elementBuilder = Option, |
|
|
|
elementBuilder = Option, |
|
|
@ -627,7 +632,7 @@ fun Option( |
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun OptGroup( |
|
|
|
fun OptGroup( |
|
|
|
label: String, |
|
|
|
label: String, |
|
|
|
attrs: AttrBuilderContext<HTMLOptGroupElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLOptGroupElement>? = null, |
|
|
|
content: ContentBuilder<HTMLOptGroupElement>? = null |
|
|
|
content: ContentBuilder<HTMLOptGroupElement>? = null |
|
|
|
) = TagElement( |
|
|
|
) = TagElement( |
|
|
|
elementBuilder = OptGroup, |
|
|
|
elementBuilder = OptGroup, |
|
|
@ -642,7 +647,7 @@ fun OptGroup( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Section( |
|
|
|
fun Section( |
|
|
|
attrs: AttrBuilderContext<HTMLElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLElement>? = null, |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
) = TagElement( |
|
|
|
) = TagElement( |
|
|
|
elementBuilder = Section, |
|
|
|
elementBuilder = Section, |
|
|
@ -671,7 +676,7 @@ fun Section( |
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun TextArea( |
|
|
|
fun TextArea( |
|
|
|
value: String? = null, |
|
|
|
value: String? = null, |
|
|
|
attrs: (TextAreaAttrsBuilder.() -> Unit)? = null |
|
|
|
attrs: (TextAreaAttrsScope.() -> Unit)? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
// if firstProvidedValueWasNotNull then TextArea behaves as controlled input |
|
|
|
// if firstProvidedValueWasNotNull then TextArea behaves as controlled input |
|
|
|
val firstProvidedValueWasNotNull = remember { value != null } |
|
|
|
val firstProvidedValueWasNotNull = remember { value != null } |
|
|
@ -682,7 +687,7 @@ fun TextArea( |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
|
elementBuilder = TextArea, |
|
|
|
elementBuilder = TextArea, |
|
|
|
applyAttrs = { |
|
|
|
applyAttrs = { |
|
|
|
val textAreaAttrsBuilder = TextAreaAttrsBuilder() |
|
|
|
val textAreaAttrsBuilder = TextAreaAttrsScope() |
|
|
|
textAreaAttrsBuilder.onInput { |
|
|
|
textAreaAttrsBuilder.onInput { |
|
|
|
// controlled state needs to be restored after every input |
|
|
|
// controlled state needs to be restored after every input |
|
|
|
keyForRestoringControlledState.value = keyForRestoringControlledState.value + 1 |
|
|
|
keyForRestoringControlledState.value = keyForRestoringControlledState.value + 1 |
|
|
@ -708,7 +713,7 @@ private val textAreaRestoreControlledStateEffect: DomEffectScope.(HTMLTextAreaEl |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Nav( |
|
|
|
fun Nav( |
|
|
|
attrs: AttrBuilderContext<HTMLElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLElement>? = null, |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
) = TagElement( |
|
|
|
) = TagElement( |
|
|
|
elementBuilder = Nav, |
|
|
|
elementBuilder = Nav, |
|
|
@ -718,7 +723,7 @@ fun Nav( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Pre( |
|
|
|
fun Pre( |
|
|
|
attrs: AttrBuilderContext<HTMLPreElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLPreElement>? = null, |
|
|
|
content: ContentBuilder<HTMLPreElement>? = null |
|
|
|
content: ContentBuilder<HTMLPreElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -730,7 +735,7 @@ fun Pre( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Code( |
|
|
|
fun Code( |
|
|
|
attrs: AttrBuilderContext<HTMLElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLElement>? = null, |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -742,7 +747,7 @@ fun Code( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Main( |
|
|
|
fun Main( |
|
|
|
attrs: AttrBuilderContext<HTMLElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLElement>? = null, |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -754,7 +759,7 @@ fun Main( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Footer( |
|
|
|
fun Footer( |
|
|
|
attrs: AttrBuilderContext<HTMLElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLElement>? = null, |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
content: ContentBuilder<HTMLElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -766,7 +771,7 @@ fun Footer( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Hr( |
|
|
|
fun Hr( |
|
|
|
attrs: AttrBuilderContext<HTMLHRElement>? = null |
|
|
|
attrs: AttrsBuilder<HTMLHRElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
|
elementBuilder = Hr, |
|
|
|
elementBuilder = Hr, |
|
|
@ -778,7 +783,7 @@ fun Hr( |
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Label( |
|
|
|
fun Label( |
|
|
|
forId: String? = null, |
|
|
|
forId: String? = null, |
|
|
|
attrs: AttrBuilderContext<HTMLLabelElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLLabelElement>? = null, |
|
|
|
content: ContentBuilder<HTMLLabelElement>? = null |
|
|
|
content: ContentBuilder<HTMLLabelElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -797,7 +802,7 @@ fun Label( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Table( |
|
|
|
fun Table( |
|
|
|
attrs: AttrBuilderContext<HTMLTableElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLTableElement>? = null, |
|
|
|
content: ContentBuilder<HTMLTableElement>? = null |
|
|
|
content: ContentBuilder<HTMLTableElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -809,7 +814,7 @@ fun Table( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Caption( |
|
|
|
fun Caption( |
|
|
|
attrs: AttrBuilderContext<HTMLTableCaptionElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLTableCaptionElement>? = null, |
|
|
|
content: ContentBuilder<HTMLTableCaptionElement>? = null |
|
|
|
content: ContentBuilder<HTMLTableCaptionElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -821,7 +826,7 @@ fun Caption( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Col( |
|
|
|
fun Col( |
|
|
|
attrs: AttrBuilderContext<HTMLTableColElement>? = null |
|
|
|
attrs: AttrsBuilder<HTMLTableColElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
|
elementBuilder = Col, |
|
|
|
elementBuilder = Col, |
|
|
@ -832,7 +837,7 @@ fun Col( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Colgroup( |
|
|
|
fun Colgroup( |
|
|
|
attrs: AttrBuilderContext<HTMLTableColElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLTableColElement>? = null, |
|
|
|
content: ContentBuilder<HTMLTableColElement>? = null |
|
|
|
content: ContentBuilder<HTMLTableColElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -844,7 +849,7 @@ fun Colgroup( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Tr( |
|
|
|
fun Tr( |
|
|
|
attrs: AttrBuilderContext<HTMLTableRowElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLTableRowElement>? = null, |
|
|
|
content: ContentBuilder<HTMLTableRowElement>? = null |
|
|
|
content: ContentBuilder<HTMLTableRowElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -856,7 +861,7 @@ fun Tr( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Thead( |
|
|
|
fun Thead( |
|
|
|
attrs: AttrBuilderContext<HTMLTableSectionElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLTableSectionElement>? = null, |
|
|
|
content: ContentBuilder<HTMLTableSectionElement>? = null |
|
|
|
content: ContentBuilder<HTMLTableSectionElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -868,7 +873,7 @@ fun Thead( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Th( |
|
|
|
fun Th( |
|
|
|
attrs: AttrBuilderContext<HTMLTableCellElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLTableCellElement>? = null, |
|
|
|
content: ContentBuilder<HTMLTableCellElement>? = null |
|
|
|
content: ContentBuilder<HTMLTableCellElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -880,7 +885,7 @@ fun Th( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Td( |
|
|
|
fun Td( |
|
|
|
attrs: AttrBuilderContext<HTMLTableCellElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLTableCellElement>? = null, |
|
|
|
content: ContentBuilder<HTMLTableCellElement>? = null |
|
|
|
content: ContentBuilder<HTMLTableCellElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -892,7 +897,7 @@ fun Td( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Tbody( |
|
|
|
fun Tbody( |
|
|
|
attrs: AttrBuilderContext<HTMLTableSectionElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLTableSectionElement>? = null, |
|
|
|
content: ContentBuilder<HTMLTableSectionElement>? = null |
|
|
|
content: ContentBuilder<HTMLTableSectionElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -904,7 +909,7 @@ fun Tbody( |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Tfoot( |
|
|
|
fun Tfoot( |
|
|
|
attrs: AttrBuilderContext<HTMLTableSectionElement>? = null, |
|
|
|
attrs: AttrsBuilder<HTMLTableSectionElement>? = null, |
|
|
|
content: ContentBuilder<HTMLTableSectionElement>? = null |
|
|
|
content: ContentBuilder<HTMLTableSectionElement>? = null |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -922,7 +927,7 @@ fun Tfoot( |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Style( |
|
|
|
fun Style( |
|
|
|
applyAttrs: (AttrsBuilder<HTMLStyleElement>.() -> Unit)? = null, |
|
|
|
applyAttrs: (AttrsScope<HTMLStyleElement>.() -> Unit)? = null, |
|
|
|
cssRules: CSSRuleDeclarationList |
|
|
|
cssRules: CSSRuleDeclarationList |
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
@ -951,7 +956,7 @@ fun Style( |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
inline fun Style( |
|
|
|
inline fun Style( |
|
|
|
noinline applyAttrs: (AttrsBuilder<HTMLStyleElement>.() -> Unit)? = null, |
|
|
|
noinline applyAttrs: (AttrsScope<HTMLStyleElement>.() -> Unit)? = null, |
|
|
|
rulesBuild: StyleSheetBuilder.() -> Unit |
|
|
|
rulesBuild: StyleSheetBuilder.() -> Unit |
|
|
|
) { |
|
|
|
) { |
|
|
|
val builder = StyleSheetBuilderImpl() |
|
|
|
val builder = StyleSheetBuilderImpl() |
|
|
@ -994,7 +999,7 @@ inline fun Style( |
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun <K> Input( |
|
|
|
fun <K> Input( |
|
|
|
type: InputType<K>, |
|
|
|
type: InputType<K>, |
|
|
|
attrs: InputAttrsBuilder<K>.() -> Unit |
|
|
|
attrs: InputAttrsScope<K>.() -> Unit |
|
|
|
) { |
|
|
|
) { |
|
|
|
// changes to this key trigger [inputRestoreControlledStateEffect] |
|
|
|
// changes to this key trigger [inputRestoreControlledStateEffect] |
|
|
|
val keyForRestoringControlledState: MutableState<Int> = remember { mutableStateOf(0) } |
|
|
|
val keyForRestoringControlledState: MutableState<Int> = remember { mutableStateOf(0) } |
|
|
@ -1002,7 +1007,7 @@ fun <K> Input( |
|
|
|
TagElement( |
|
|
|
TagElement( |
|
|
|
elementBuilder = Input, |
|
|
|
elementBuilder = Input, |
|
|
|
applyAttrs = { |
|
|
|
applyAttrs = { |
|
|
|
val inputAttrsBuilder = InputAttrsBuilder(type) |
|
|
|
val inputAttrsBuilder = InputAttrsScope(type) |
|
|
|
inputAttrsBuilder.type(type) |
|
|
|
inputAttrsBuilder.type(type) |
|
|
|
inputAttrsBuilder.onInput { |
|
|
|
inputAttrsBuilder.onInput { |
|
|
|
// controlled state needs to be restored after every input |
|
|
|
// controlled state needs to be restored after every input |
|
|
|