Element Creator
open class ElementCreator<out PARENT_TYPE : Element>(val element: PARENT_TYPE, val parentCreator: ElementCreator<*>? = element.creator, val insertBefore: String? = null)(source)
Responsible for creating new DOM elements, and cleaning up Cleaners, KVars, and other related objects when DOM elements are deleted.
ElementCreator is typically used as a receiver for element creation functions like p or element.
Constructors
Link copied to clipboard
constructor(element: PARENT_TYPE, parentCreator: ElementCreator<*>? = element.creator, insertBefore: String? = null)
Properties
Functions
Link copied to clipboard
Link copied to clipboard
fun ElementCreator<Element>.button(attributes: Map<String, JsonPrimitive> = emptyMap(), type: ButtonType? = ButtonType.button, autofocus: Boolean? = null, new: ElementCreator<ButtonElement>.(ButtonElement) -> Unit? = null): ButtonElement
Link copied to clipboard
fun ElementCreator<Element>.canvas(attributes: Map<String, JsonPrimitive> = emptyMap(), width: Int, height: Int, new: ElementCreator<CanvasElement>.(CanvasElement) -> Unit? = null): CanvasElement
Link copied to clipboard
Close this AutoCloseable when this ElementCreator is cleaned up.
Link copied to clipboard
Link copied to clipboard
fun ElementCreator<Element>.div(attributes: Map<String, JsonPrimitive> = emptyMap(), new: ElementCreator<DivElement>.(DivElement) -> Unit? = null): DivElement
Link copied to clipboard
Creates a CoroutineScope that will be cancelled when this ElementCreator is cleaned up.
Link copied to clipboard
fun ElementCreator<*>.fileInput(name: String? = null, initialValue: String? = null, size: Int? = null, placeholder: String? = null, attributes: Map<String, JsonPrimitive> = attr): FileFormInput
Create a FileReader
Link copied to clipboard
fun ElementCreator<Element>.footer(attributes: Map<String, JsonPrimitive> = emptyMap(), new: ElementCreator<FooterElement>.(FooterElement) -> Unit? = null): FooterElement
Link copied to clipboard
fun ElementCreator<Element>.form(attributes: Map<String, JsonPrimitive> = emptyMap(), new: ElementCreator<FormElement>.(FormElement) -> Unit? = null): FormElement
Link copied to clipboard
fun ElementCreator<Element>.img(attributes: Map<String, JsonPrimitive> = emptyMap(), new: ElementCreator<ImageElement>.(ImageElement) -> Unit? = null): ImageElement
Link copied to clipboard
fun ElementCreator<Element>.input(attributes: Map<String, JsonPrimitive> = emptyMap(), type: InputType? = null, name: String? = null, initialValue: String? = null, size: Int? = null, placeholder: String? = null, required: Boolean? = null, new: ElementCreator<InputElement>.(InputElement) -> Unit? = null): InputElement
Link copied to clipboard
fun ElementCreator<Element>.label(attributes: Map<String, JsonPrimitive> = emptyMap(), new: ElementCreator<LabelElement>.(LabelElement) -> Unit? = null): LabelElement
Link copied to clipboard
fun ElementCreator<Element>.link(rel: LinkRelationship, href: URL, hreflang: String? = null, attributes: Map<String, JsonPrimitive> = emptyMap()): Element
Link copied to clipboard
fun ElementCreator<Element>.main(attributes: Map<String, JsonPrimitive> = emptyMap(), new: ElementCreator<MainElement>.(MainElement) -> Unit? = null): MainElement
Link copied to clipboard
fun ElementCreator<Element>.meta(attributes: Map<String, JsonPrimitive> = emptyMap(), name: String? = null, content: String? = null, httpEquiv: String? = null, charset: String? = null, new: ElementCreator<MetaElement>.(MetaElement) -> Unit? = null): MetaElement
Link copied to clipboard
fun ElementCreator<Element>.nav(attributes: Map<String, JsonPrimitive> = emptyMap(), new: ElementCreator<NavElement>.(NavElement) -> Unit? = null): NavElement
Link copied to clipboard
fun ElementCreator<Element>.option(attributes: Map<String, JsonPrimitive> = emptyMap(), new: ElementCreator<OptionElement>.(OptionElement) -> Unit? = null): OptionElement
Link copied to clipboard
fun <T> ElementCreator<*>.render(value: KVal<T>, block: ElementCreator<Element>.(T) -> Unit): RenderFragment
Link copied to clipboard
fun <T : Any> ElementCreator<*>.renderEach(list: KVar<List<T>>, block: ElementCreator<Element>.(value: KVar<T>) -> Unit)
Render each element of a List
fun <ITEM : Any, EL : Element> ElementCreator<EL>.renderEach(observableList: ObservableList<ITEM>, itemRenderer: ElementCreator<Element>.(ITEM) -> Unit)
Similar to render, but renders a list of items, and updates the DOM when the list changes.
Link copied to clipboard
Specify that a specific plugin be provided in Kweb.plugins, throws an exception if not.
Link copied to clipboard
Route extension
Link copied to clipboard
fun ElementCreator<Element>.section(attributes: Map<String, JsonPrimitive> = emptyMap(), new: ElementCreator<SectionElement>.(SectionElement) -> Unit? = null): SectionElement
Link copied to clipboard
fun ElementCreator<Element>.select(attributes: Map<String, JsonPrimitive> = emptyMap(), name: String? = null, required: Boolean? = null, initialValue: String? = null, new: ElementCreator<SelectElement>.(SelectElement) -> Unit? = null): SelectElement
Link copied to clipboard
fun ElementCreator<Element>.span(attributes: Map<String, JsonPrimitive> = emptyMap(), new: ElementCreator<SpanElement>.(SpanElement) -> Unit? = null): SpanElement
Link copied to clipboard
fun ElementCreator<Element>.table(attributes: Map<String, JsonPrimitive> = emptyMap(), new: ElementCreator<TableElement>.(TableElement) -> Unit? = null): TableElement
Link copied to clipboard
fun ElementCreator<Element>.tbody(attributes: Map<String, JsonPrimitive> = emptyMap(), new: ElementCreator<TbodyElement>.(TbodyElement) -> Unit? = null): TbodyElement
Link copied to clipboard
fun ElementCreator<Element>.textArea(attributes: Map<String, JsonPrimitive> = emptyMap(), new: ElementCreator<TextAreaElement>.(TextAreaElement) -> Unit? = null): TextAreaElement
https://www.w3schools.com/tags/tag_textarea.asp
fun ElementCreator<Element>.textArea(attributes: Map<String, JsonPrimitive> = emptyMap(), rows: Int? = null, cols: Int? = null, required: Boolean? = null, initialValue: String? = null, new: ElementCreator<TextAreaElement>.(TextAreaElement) -> Unit? = null): TextAreaElement
Link copied to clipboard
fun ElementCreator<Element>.tfoot(attributes: Map<String, JsonPrimitive> = emptyMap(), new: ElementCreator<TfootElement>.(TfootElement) -> Unit? = null): TfootElement
Link copied to clipboard
fun ElementCreator<Element>.thead(attributes: Map<String, JsonPrimitive> = emptyMap(), new: ElementCreator<TheadElement>.(TheadElement) -> Unit? = null): TheadElement
Link copied to clipboard
fun ElementCreator<HeadElement>.title(attributes: Map<String, JsonPrimitive> = emptyMap(), new: ElementCreator<TitleElement>.(TitleElement) -> Unit? = null): TitleElement
Link copied to clipboard
fun ElementCreator<HeadElement>.viewport(attributes: Map<String, JsonPrimitive> = emptyMap(), width: ViewportWidth = ViewportWidth.DeviceWidth, height: ViewportHeight = ViewportHeight.DeviceHeight, initialScale: Double = 1.0, minimumScale: Double = 0.1, maximumScale: Double = 10.0, userScalable: UserScalable = UserScalable.Yes, new: ElementCreator<MetaElement>.(MetaElement) -> Unit? = null): MetaElement
Viewport and related classes *