open class Widget : StyledComponent
Base widget class. The parent of all component classes.
A simple widget is rendered as HTML DIV element.
Widget(classes: Set<String> = setOf())
Creates basic Widget with given CSS class names. |
var draggable: Boolean?
Determines if the current widget is draggable. |
|
var id: String?
An ID attribute of generated HTML element. |
|
open var parent: Component?
Parent of the current component. |
|
var role: String?
A role attribute of generated HTML element. |
|
var title: String?
A title attribute of generated HTML element. |
|
open var visible: Boolean
Visibility state of the current component. |
var background: Background?
Background of the current component. |
|
var border: Border?
Border of the current component. |
|
var borderBottom: Border?
Bottom border of the current component. |
|
var borderLeft: Border?
Left border of the current component. |
|
var borderRight: Border?
Right border of the current component. |
|
var borderTop: Border?
Top border of the current component. |
|
var bottom: CssSize?
Bottom edge of the current component. |
|
var color: Color?
Text color for the current component. |
|
var colorHex: Int?
Text color for the current component given in hex format (write only). |
|
var colorName: Col?
Text color for the current component given with named constant (write only). |
|
var height: CssSize?
Height of the current component. |
|
var left: CssSize?
Left edge of the current component. |
|
var margin: CssSize?
Margin of the current component. |
|
var marginBottom: CssSize?
Bottom margin of the current component. |
|
var marginLeft: CssSize?
Left margin of the current component. |
|
var marginRight: CssSize?
Right margin of the current component. |
|
var marginTop: CssSize?
Top margin of the current component. |
|
var maxHeight: CssSize?
Maximal height of the current component. |
|
var maxWidth: CssSize?
Maximal width of the current component. |
|
var minHeight: CssSize?
Minimal height of the current component. |
|
var minWidth: CssSize?
Minimal width of the current component. |
|
var opacity: Double?
Opacity of the current component. |
|
var overflow: Overflow?
CSS overflow of the current component. |
|
var padding: CssSize?
Padding of the current component. |
|
var paddingBottom: CssSize?
Bottom padding of the current component. |
|
var paddingLeft: CssSize?
Left padding of the current component. |
|
var paddingRight: CssSize?
Right padding of the current component. |
|
var paddingTop: CssSize?
Top padding of the current component. |
|
var position: Position?
CSS position of the current component. |
|
var resize: Resize?
CSS resize of the current component. |
|
var right: CssSize?
Right edge of the current component. |
|
var top: CssSize?
Top edge of the current component. |
|
open var width: CssSize?
Width of the current component. |
|
var zIndex: Int?
Z-index of the current component. |
open fun addCssClass(css: String): Widget
Adds given value to the set of CSS classes generated in html code of current component. |
|
open fun addSurroundingCssClass(css: String): Widget
Adds given value to the set of CSS classes generated in html code of parent component. |
|
open fun afterCreate(node: VNode): Unit
Method called after creating Snabbdom vnode. |
|
open fun afterDestroy(): Unit
Method called after destroying Snabbdom vnode. |
|
open fun afterInsert(node: VNode): Unit
Method called after inserting Snabbdom vnode into the DOM. |
|
open fun afterPostpatch(node: VNode): Unit
Method called after updating Snabbdom vnode. |
|
open fun clearDragDropData(): Unit
Clears D&D data for the current widget. It also makes it not draggable. |
|
open fun getElement(): Node?
Returns DOM element bound to the current component. |
|
open fun getElementJQuery(): JQuery?
Returns JQuery element bound to the current component. |
|
open fun getElementJQueryD(): dynamic
Returns JQuery element bound to the current component as a dynamic type. |
|
open fun getSnAttrs(): List<StringPair>
Returns list of element attributes in the form of a List. |
|
open fun getSnClass(): List<StringBoolPair>
Returns list of CSS class names for current widget in the form of a List. |
|
open fun getSnHooks(): Hooks?
Returns list of hooks in the form of a Snabbdom Hooks object. |
|
open fun getSnOn(): On?
Returns list of event handlers in the form of a Snabbdom On object. |
|
open fun hide(): Widget
Makes current widget invisible. |
|
open fun removeCssClass(css: String): Widget
Removes given value from the set of CSS classes generated in html code of current component. |
|
open fun removeEventListeners(): Widget
Removes all event listeners from current widget. |
|
open fun removeSurroundingCssClass(css: String): Widget
Removes given value from the set of CSS classes generated in html code of parent component. |
|
open fun render(): VNode open fun render(elementName: String): VNode open fun render(elementName: String, children: Array<dynamic>): VNode
Renders current component as a Snabbdom vnode. |
|
open fun setDragDropData(format: String, data: String): Unit
Sets D&D data for the current widget. It also makes it draggable. |
|
open fun setDropTarget(format: String, callback: (DragEvent) -> Unit): Unit open fun setDropTarget(formats: Set<String>? = null, callback: (DragEvent) -> Unit): Unit
Sets the current widget as a D&D drop target. |
|
open fun setDropTargetData(format: String, callback: (String?) -> Unit): Unit
Sets the current widget as a D&D drop target with helper callback accepting String data. |
|
open fun <T : Widget> setEventListener(block: SnOn<T>.() -> Unit): Widget
Sets an event listener for current widget, keeping the actual type of component. open fun setEventListener(block: SnOn<Widget>.() -> Unit): Widget
Sets an event listener for current widget. |
|
open fun show(): Widget
Makes current widget visible. |
|
open fun toggleVisible(): Widget
Toggles visibility of current widget. |
open fun getSnStyle(): List<StringPair>
Returns the list of String pairs defining CSS style attributes and their values. |
fun Container.widget(classes: Set<String> = setOf(), init: Widget.() -> Unit = null): Widget
DSL builder extension function. |
abstract class AbstractTextInput : Widget
Base class for basic text components. |
|
open class Button : Widget
Button component. |
|
open class CheckInput : Widget
The basic input component rendered as HTML input type="checkbox" or input type="radio". |
|
open class CloseIcon : Widget
Helper class for close icon component. |
|
class DataContainer<M : DataComponent, C : Component> : Widget, Container, DataUpdatable
A container class with support for observable data model. |
|
open class DateTimeInput : Widget
Basic date/time chooser component. |
|
open class Image : Widget
Image component. |
|
open class SelectOption : Widget
The helper component for adding options to Select or SelectOptGroup. |
|
open class SimplePanel : Widget, Container
Basic container class, rendered as a DIV element with all children directly within. |
|
open class SpinnerInput : Widget
The basic component for spinner control. |
|
open class WidgetWrapper : Widget
This class allows to wrap a component into separately styled DIV element. |