kvision / pl.treksoft.kvision.modal / Modal

Modal

open class Modal : SimplePanel

Configurable modal window based on Bootstrap modal.

Constructors

<init>

Modal(caption: String? = null, closeButton: Boolean = true, size: ModalSize? = null, animation: Boolean = true, escape: Boolean = true, classes: Set<String> = setOf(), init: (Modal.() -> Unit)? = null)

Properties

animation

var animation: Boolean

Determines if animations are used.

caption

var caption: String?

Window caption text.

closeButton

var closeButton: Boolean

Determines if Close button is visible.

parent

open var parent: Container?

size

var size: ModalSize?

Window size.

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.

addButton

open fun addButton(button: Button): Modal

Adds given button to the bottom section of dialog window.

afterInsert

open fun afterInsert(node: VNode): Unit

Method called after inserting Snabbdom vnode into the DOM.

clearParent

open fun clearParent(): Widget

getChildren

open fun getChildren(): List<Component>

Returns a list of children of the current container.

getRoot

open fun getRoot(): Root?

getSnAttrs

open fun getSnAttrs(): List<StringPair>

Returns list of element attributes in the form of a List.

getSnClass

open fun getSnClass(): List<StringBoolPair>

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

hide

open fun hide(): Widget

Makes current widget invisible.

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.

removeAllButtons

open fun removeAllButtons(): Modal

Removes all buttons from the bottom section of dialog window.

removeButton

open fun removeButton(button: Button): Modal

Removes given button from the bottom section of dialog window.

toggle

open fun toggle(): Unit

Toggle modal window visibility.

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.

render

open fun render(): VNode

Renders current component as a Snabbdom vnode.

Extension Functions

createInstance

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

Helper function for creating JavaScript objects from dynamic constructors.

Inheritors

Alert

open class Alert : Modal

Alert window based on Bootstrap modal.

Confirm

open class Confirm : Modal

Confirm window based on Bootstrap modal.

Dialog

open class Dialog<R> : Modal

Modal window with a result.