ElementProperties

interface ElementProperties<T>

An interface for exposing an HTML element. Use this vor components that more or less wrap a single basic HTML tag like `inputField` or `pushButton`.

The offered element property enables the client to access the deeper features of an element even though the component itself does not offer an appropriate functionality. A client should use this with caution, as it might massively change the default behaviour of the component!

Example usage:

// apply interface to a component class
open class SomeComponent : ElementProperties<Div> by ElementMixin() {
^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^
implement the | mix in the default implementation
interface |
Expose the underlying element,
in this case a ``Div``!
}

// use the property offered by the interface
someComponent {
element {
// all properties of the ``Div`` element are accessible here
}
}

Advice: Try to offer all useful properties for a component in a redundant way if the component usage will benefit from a feature the underlying HTML element offers! This will make it much easier for the client user to use a component and much easier to read and maintain at client side code.

RFC: If the component itself offers some redundant property, the values from within the element property context should win and used for the rendering! This is the mandatory behaviour!

Functions

equals
Link copied to clipboard
js
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
js
open fun hashCode(): Int
toString
Link copied to clipboard
js
open fun toString(): String

Properties

element
Link copied to clipboard
js
abstract val element: ComponentProperty<T.() -> Unit>
This property enables the client to access the deeper features of an element even though the component itself does not offer an appropriate functionality.

Inheritors

PushButtonComponent
Link copied to clipboard
CheckboxComponent
Link copied to clipboard
ElementMixin
Link copied to clipboard
InputFieldComponent
Link copied to clipboard
RadioComponent
Link copied to clipboard
SwitchComponent
Link copied to clipboard
TextAreaComponent
Link copied to clipboard