Class NumericSpinner

A numeric spinner widget with standard styling.

Index

Methods

build

  • build(): HTMLElement

getElement

  • getElement(): HTMLElement

getFloatValue

  • getFloatValue(): number

getIntValue

  • getIntValue(): number

getValue

  • getValue(): string

reset

  • reset(): void

setValue

  • setValue(value: number): void
  • Sets the numeric spinner value.

    Parameters

    • value: number

      The value to set the numeric spinner to. If value is greater than [max]{@link NumericSpinner.max}, this method sets the numeric spinner to its maximum value instead. Likewise, if value is lesser than [min]{@link NumericSpinner.min}, the method sets the numeric spinner to its minimum value.

    Returns void

Constructors

constructor

  • new NumericSpinner(onChange?: function, min?: number, max?: number, label?: string): NumericSpinner
  • Creates a new NumericSpinner.

    Parameters

    • Default value onChange: function = (numericSpinner: NumericSpinner) => {}

      The function to call when the numeric spinner value changes. This function takes the current NumericSpinner instance as an argument.

    • Default value min: number = 0

      The minimum possible value of the numeric spinner.

    • Optional max: number

      The maximum possible value of the numeric spinner.

    • Optional label: string

      The label to use for the input for accessibility purposes.

    Returns NumericSpinner

Hierarchy

  • NumericSpinner

Implements