kvision / pl.treksoft.kvision.panel / StackPanel

StackPanel

open class StackPanel : SimplePanel

The container with only one active (visible) child at any moment.

It supports activating children by a JavaScript route.

Constructors

<init>

StackPanel(activateLast: Boolean = true, classes: Set<String> = setOf(), init: (StackPanel.() -> Unit)? = null)

Properties

activeChild

var activeChild: Component

The active (visible) child.

activeIndex

var activeIndex: Int

The index of active (visible) child.

Functions

add

open fun add(panel: Component, route: String): StackPanel

Adds given component and bounds it's activation to a given route.

open fun add(child: Component): StackPanel

Adds given component to the current container.

addAll

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

Adds a list of components to the current container.

childrenVNodes

open fun childrenVNodes(): Array<VNode>

Returns the array of the children Snabbdom vnodes.

remove

open fun remove(child: Component): StackPanel

Removes given component from the current container.

removeAll

open fun removeAll(): StackPanel

Removes all children from the current container.

Inherited Functions

addInternal

fun addInternal(child: Component): SimplePanel

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

getChildren

open fun getChildren(): List<Component>

Returns a list of children of the current container.

render

open fun render(): VNode

Renders current component as a Snabbdom vnode.

Companion Object Functions

stackPanel

fun Container.stackPanel(activateLast: Boolean = true, classes: Set<String> = setOf(), init: (StackPanel.() -> Unit)? = null): StackPanel

DSL builder extension function.

Extension Functions

createInstance

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

Helper function for creating JavaScript objects from dynamic constructors.