The arguments for the Label constructor.

interface LabelArgs {
    allowTextSelection?: boolean;
    binding?: BindingBase;
    class?: string | string[];
    dom?: string | HTMLElement;
    enabled?: boolean;
    error?: boolean;
    flex?: boolean;
    flexBasis?: string;
    flexDirection?: string;
    flexGrow?: string;
    flexShrink?: string;
    flexWrap?: string;
    height?: number;
    hidden?: boolean;
    id?: string;
    ignoreParent?: boolean;
    isRoot?: boolean;
    link?: {
        observer: Observer | Observer[];
        path: string | string[];
    };
    nativeTooltip?: boolean;
    onChange?: ((value) => void);
    onClick?: (() => void);
    onRemove?: (() => void);
    parent?: Element;
    placeholder?: string;
    readOnly?: boolean;
    renderChanges?: boolean;
    style?: string;
    tabIndex?: number;
    text?: string;
    unsafe?: boolean;
    value?: string;
    values?: any[];
    width?: number;
}

Hierarchy (view full)

  • ElementArgs
  • IBindableArgs
  • IPlaceholderArgs
  • IFlexArgs
    • LabelArgs

Properties

allowTextSelection?: boolean

If true then the label can be clicked to select text. Defaults to false.

binding?: BindingBase

A binding to use with this Element.

class?: string | string[]

The class attribute of this Element's HTMLElement.

dom?: string | HTMLElement

The DOM element or its type to use for this component. Defaults to 'span'.

enabled?: boolean

Sets whether it is possible to interact with this Element and its children.

error?: boolean

Sets whether the Element is in an error state.

flex?: boolean

Sets whether the element uses flex layout.

flexBasis?: string

Sets the element's flexBasis CSS property.

flexDirection?: string

Sets the element's flexDirection CSS property.

flexGrow?: string

Sets the element's flexGrow CSS property.

flexShrink?: string

Sets the element's flexShrink CSS property.

flexWrap?: string

Sets the element's flexWrap CSS property.

height?: number

Sets the initial height of the Element.

hidden?: boolean

Sets whether this Element is hidden. Defaults to false.

id?: string

The id attribute of this Element's HTMLElement.

ignoreParent?: boolean

If true, this Element will ignore its parent's enabled value when determining whether this element is enabled. Defaults to false.

isRoot?: boolean

Sets whether this Element is at the root of the hierarchy.

link?: {
    observer: Observer | Observer[];
    path: string | string[];
}

Links the observer attribute at the path location in the given observer to this Element.

Type declaration

  • observer: Observer | Observer[]
  • path: string | string[]
nativeTooltip?: boolean

If true then use the text of the label as the native HTML tooltip. Defaults to false.

onChange?: ((value) => void)

If provided and the Element is changeable, this function will be called each time the element value is changed.

Type declaration

    • (value): void
    • Parameters

      • value: any

      Returns void

onClick?: (() => void)

If provided and the Element is clickable, this function will be called each time the element is clicked.

Type declaration

    • (): void
    • Returns void

onRemove?: (() => void)

If provided and the Element is removable, this function will be called each time the element is removed.

Type declaration

    • (): void
    • Returns void

parent?: Element

Sets the parent Element.

placeholder?: string

Sets the placeholder label that appears on the right of the input.

readOnly?: boolean

Whether this Element is read only or not. Defaults to false.

renderChanges?: boolean

If true each input will flash on changes.

style?: string

Sets an initial value for Element.dom.style.

tabIndex?: number

Sets the tabIndex of the Element.

text?: string

Sets the text of the Label. Defaults to ''.

unsafe?: boolean

If true, the innerHTML property will be used to set the text. Otherwise, textContent will be used instead. Defaults to false.

value?: string

Sets the value of the Label. Defaults to ''.

values?: any[]

Sets multiple values to the Element. It is up to the Element to determine how to display them.

width?: number

Sets the initial width of the Element.