kvision / pl.treksoft.kvision.html / Tag

Tag

open class Tag : SimplePanel, Template

HTML tag component.

Constructors

<init>

Tag(type: TAG, content: String? = null, rich: Boolean = false, align: Align? = null, classes: Set<String> = setOf(), attributes: Map<String, String> = mapOf(), init: (Tag.() -> Unit)? = null)

Properties

align

var align: Align?

Text align.

content

open var content: String?

Text content of the tag.

rich

open var rich: Boolean

Determines if content can contain HTML code.

template

open var template: ((Any?) -> String)?

Handlebars template.

templates

open var templates: Map<String, (Any?) -> String>

Handlebars templates for i18n.

type

var type: TAG

Tag type.

Inherited Properties

templateData

open var templateData: Any?

Handlebars template data object.

Functions

getSnClass

open fun getSnClass(): List<StringBoolPair>

Returns list of CSS class names for current widget in the form of a List.

render

open fun render(): VNode

Renders current component as a Snabbdom vnode.

unaryPlus

operator fun String.unaryPlus(): Unit

Inherited Functions

add

open fun add(child: Component): SimplePanel

Adds given component to the current container.

addAll

open fun addAll(children: List<Component>): SimplePanel

Adds a list of components to the current container.

addInternal

fun addInternal(child: Component): SimplePanel

Protected and final method to add given component to the current container.

childrenVNodes

open fun childrenVNodes(): Array<VNode>

Returns the array of the children Snabbdom vnodes.

getChildren

open fun getChildren(): List<Component>

Returns a list of children of the current container.

remove

open fun remove(child: Component): SimplePanel

Removes given component from the current container.

removeAll

open fun removeAll(): SimplePanel

Removes all children from the current container.

Companion Object Functions

tag

fun Container.tag(type: TAG, content: String? = null, rich: Boolean = false, align: Align? = null, classes: Set<String> = setOf(), attributes: Map<String, String> = mapOf(), init: (Tag.() -> Unit)? = null): Tag

DSL builder extension function.

Extension Functions

createInstance

fun <T> Any?.createInstance(vararg args: dynamic): T

Helper function for creating JavaScript objects from dynamic constructors.

setData

fun <K> Template.setData(obj: K, serializer: SerializationStrategy<K>): Unit
fun <K : Any> Template.setData(obj: K): Unit

Extension function to set serializable object as a template data.

Inheritors

Cell

open class Cell : Tag

HTML table cell component.

Div

open class Div : Tag

Simple component rendered as div.

FieldLabel

open class FieldLabel : Tag

Helper class for HTML label element.

Footer

open class Footer : Tag

Simple component rendered as footer.

H1

open class H1 : Tag

Simple component rendered as h1.

H2

open class H2 : Tag

Simple component rendered as h2.

H3

open class H3 : Tag

Simple component rendered as h3.

H4

open class H4 : Tag

Simple component rendered as h4.

H5

open class H5 : Tag

Simple component rendered as h5.

H6

open class H6 : Tag

Simple component rendered as h6.

Header

open class Header : Tag

Menu header component.

Header

open class Header : Tag

Simple component rendered as header.

HeaderCell

open class HeaderCell : Tag

HTML table header cell component.

HelpBlock

open class HelpBlock : Tag

Helper class for Bootstrap help block element.

Icon

open class Icon : Tag

Icon component with support for FontAwesome and Bootstrap glyphicons.

Nav

open class Nav : Tag

The Bootstrap Nav container.

NavForm

open class NavForm : Tag

The Bootstrap Nav form container.

P

open class P : Tag

Simple component rendered as p.

Row

open class Row : Tag

HTML table row component.

Section

open class Section : Tag

Simple component rendered as section.

Separator

open class Separator : Tag

Menu separator component.

Span

open class Span : Tag

Simple component rendered as span.