kvision / pl.treksoft.kvision.panel / GridPanel

GridPanel

open class GridPanel : SimplePanel

The container with CSS grid layout support.

Constructors

<init>

GridPanel(autoColumns: String? = null, autoRows: String? = null, autoFlow: GridFlow? = null, templateColumns: String? = null, templateRows: String? = null, templateAreas: List<String>? = null, columnGap: Int? = null, rowGap: Int? = null, justifyItems: GridJustify? = null, alignItems: GridAlign? = null, justifyContent: GridJustifyContent? = null, alignContent: GridAlignContent? = null, classes: Set<String> = setOf(), init: GridPanel.() -> Unit = null)

Properties

alignContent

var alignContent: GridAlignContent?

CSS grid content alignment.

alignItems

var alignItems: GridAlign?

CSS grid items alignment.

autoColumns

var autoColumns: String?

CSS grid auto columns.

autoFlow

var autoFlow: GridFlow?

CSS grid auto flow.

autoRows

var autoRows: String?

CSS grid auto rows.

columnGap

var columnGap: Int?

CSS grid column gap.

justifyContent

var justifyContent: GridJustifyContent?

CSS grid content justification.

justifyItems

var justifyItems: GridJustify?

CSS grid items justification.

rowGap

var rowGap: Int?

CSS grid row gap.

templateAreas

var templateAreas: List<String>?

CSS grid areas template.

templateColumns

var templateColumns: String?

CSS grid columns template.

templateRows

var templateRows: String?

CSS grid rows template.

Functions

add

fun add(child: Component, columnStart: Int? = null, rowStart: Int? = null, columnEnd: String? = null, rowEnd: String? = null, area: String? = null, justifySelf: GridJustify? = null, alignSelf: GridAlign? = null, classes: Set<String> = setOf()): GridPanel

Adds a component to the grid container.

open fun add(child: Component): GridPanel

Adds given component to the current container.

addAll

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

Adds a list of components to the current container.

getSnStyle

open fun getSnStyle(): List<StringPair>

Returns the list of String pairs defining CSS style attributes and their values.

remove

open fun remove(child: Component): GridPanel

Removes given component from the current container.

removeAll

open fun removeAll(): GridPanel

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.

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

gridPanel

fun Container.gridPanel(autoColumns: String? = null, autoRows: String? = null, autoFlow: GridFlow? = null, templateColumns: String? = null, templateRows: String? = null, templateAreas: List<String>? = null, columnGap: Int? = null, rowGap: Int? = null, justifyItems: GridJustify? = null, alignItems: GridAlign? = null, justifyContent: GridJustifyContent? = null, alignContent: GridAlignContent? = null, classes: Set<String> = setOf(), init: GridPanel.() -> Unit = null): GridPanel

DSL builder extension function.