Monster.Components.Form. StateButton

This CustomControl creates a button element with a variety of options.

Dependencies: the system uses functions of the monsterjs library

You can create this control either by specifying the HTML tagdirectly in the HTML or using Javascript via thedocument.createElement('monster-state-button');` method.

<monster-state-button></monster-state-button>

Or you can create this CustomControl directly in Javascript:

import {StateButton} from '@schukai/component-form/source/state-button.js';
document.createElement('monster-state-button');

The data-monster-button-class attribute can be used to change the CSS class of the button.

Constructor

new StateButton()

A state button with icons

Since
  • 1.5.0

Members

defaults

To set the options via the html tag the attribute data-monster-options must be used.

To set the options via the html tag the attribute data-monster-options must be used.

Properties
NameTypeDescription
templatesObject

Template definitions

Properties
NameTypeDescription
mainstring

Main template

statesObject

Available status

Properties
NameTypeDescription
successful=Monster.Components.Form.Types.State

successful

activity=Monster.Components.Form.Types.State

activity

failed=Monster.Components.Form.Types.State

failed

currentMonster.Components.Form.Types.State

current status

actions.clickMonster.Components.Form~exampleActionCallback
See

(static) instanceSymbol

This method is called by the instanceof operator.

This method is called by the instanceof operator.

Since
  • 2.1.0

Methods

getState() → {Monster.Components.Form.Types.State|undefined}

Returns:
Type: 
Monster.Components.Form.Types.State | undefined

removeState() → {Monster.Components.Form.StateButton}

setState(state, timeout) → {Monster.Components.Form.StateButton}

This method sets the current state of the button.

This method sets the current state of the button. If a timeout is set, the state is automatically removed after the specified time.

Parameters:
NameTypeDescription
statestring
timeoutnumber
Since
  • 3.18.0 a previously set timeout is cleared
Throws:
  • value is not a string

    Type
    TypeError
  • value is not an instance

    Type
    TypeError

(static) getCSSStyleSheet() → {Array.<CSSStyleSheet>}

Returns:
Type: 
Array.<CSSStyleSheet>

(static) getTag() → {string}

Returns:
Type: 
string