Monster.Components.Form. MessageStateButton

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-message-state-button');` method.

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

Or you can create this CustomControl directly in Javascript:

import from '@schukai/monster/source/components/form/message-state-button.mjs';
document.createElement('monster-state-button');

Constructor

new MessageStateButton()

A state button with icons and a message

Since
  • 2.11.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

labelsObject

Label definitions

Properties
NameTypeDescription
buttonstring

Button label

modeObject

Mode definitions (manual, submit)

See

(static) instanceSymbol

This method is called by the instanceof operator.

This method is called by the instanceof operator.

Since
  • 2.1.0

Methods

assembleMethodSymbol()

blur()

The Button.blur() method removes focus from the internal button element.

The Button.blur() method removes focus from the internal button element.

click()

The Button.click() method simulates a click on the internal button element.

The Button.click() method simulates a click on the internal button element.

Since
  • 3.27.0

focus(options)

The Button.focus() method sets focus on the internal button element.

The Button.focus() method sets focus on the internal button element.

Parameters:
NameTypeDescription
optionsObject
Since
  • 3.27.0

getMessage() → {Object}

Returns:
Type: 
Object

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

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

hideMessage() → {Monster.Components.Form.MessageStateButton}

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

setMessage(message, title, icon) → {Monster.Components.Form.MessageStateButton}

Sets the message

.

Sets the message

Parameters:
NameTypeDescription
messagestring | HTMLElement
titlestring
iconstring

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

Parameters:
NameTypeDescription
statestring
timeoutnumber
Throws:
  • value is not a string

    Type
    TypeError
  • value is not an instance

    Type
    TypeError

showMessage(timeout) → {Monster.Components.Form.MessageStateButton}

Parameters:
NameTypeDescription
timeoutnumber

toggleMessage() → {Monster.Components.Form.MessageStateButton}

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

Returns:
Type: 
Array.<CSSStyleSheet>

(static) getTag() → {string}

Returns:
Type: 
string