kvision / pl.treksoft.kvision.panel / TabPanel

TabPanel

open class TabPanel : SimplePanel

The container rendering it's children as tabs.

It supports activating children by a JavaScript route.

Constructors

<init>

TabPanel(tabPosition: TabPosition = TabPosition.TOP, sideTabSize: SideTabSize = SideTabSize.SIZE_3, scrollableTabs: Boolean = false, classes: Set<String> = setOf(), init: (TabPanel.() -> Unit)? = null)

Properties

activeIndex

var activeIndex: Int

The index of active (visible) tab.

Functions

add

open fun add(child: Component): TabPanel

Adds given component to the current container.

addAll

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

Adds a list of components to the current container.

addTab

open fun addTab(title: String, panel: Component, icon: String? = null, image: ResString? = null, closable: Boolean = false, route: String? = null): TabPanel

Adds new tab and optionally bounds it's activation to a given route.

getChildComponent

open fun getChildComponent(index: Int): Component?

Returns child component by tab index.

getNavComponent

open fun getNavComponent(index: Int): Tag?

Returns tab header component by tab index.

remove

open fun remove(child: Component): TabPanel

Removes given component from the current container.

removeAll

open fun removeAll(): TabPanel

Removes all children from the current container.

removeTab

open fun removeTab(index: Int): TabPanel

Removes tab at given index.

Inherited Functions

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.

render

open fun render(): VNode

Renders current component as a Snabbdom vnode.

Companion Object Functions

tabPanel

fun Container.tabPanel(tabPosition: TabPosition = TabPosition.TOP, sideTabSize: SideTabSize = SideTabSize.SIZE_3, scrollableTabs: Boolean = false, classes: Set<String> = setOf(), init: (TabPanel.() -> Unit)? = null): TabPanel

DSL builder extension function.

Extension Functions

createInstance

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

Helper function for creating JavaScript objects from dynamic constructors.