Monster.Components.Form. ConfirmButton

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

Dependencies: the system uses functions of the monsterjs library as well as pooperjs.

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

<monster-confirm-button></monster-confirm-button>

Or you can create this CustomControl directly in Javascript:

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

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

Constructor

new ConfirmButton()

A confirm button

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
NameTypeDefaultDescription
toggleEventTypeObjectclick,touch

List of event types to be observed for opening the confirm message

templatesObject

Template definitions

Properties
NameTypeDescription
mainstring

Main template

labels.buttonstring'<slot

name="button">' Button label

labels.messagestring'<slot>Should

I Stay or Should I Go?' Message

labels.confirmstring'<slot

name="confirm">Confirm' Confirm button label

labels.cancelstring'<slot

name="cancel">Cancel' Cancel button label

actions.confirmMonster.Components.Form~exampleActionCallback
actions.cancelMonster.Components.Form~exampleActionCallback

List of event types to be observed for opening the dropdown

popperObject

PopperJS Options

Properties
NameTypeDefaultDescription
placementstringtop

PopperJS placement

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() → {Monster.Components.Form.PopperButton}

setConfirmButtonState(state, timeout) → {Monster.Components.Form.ConfirmButton}

Set the confirm button state

.

Set the confirm button state

Parameters:
NameTypeDescription
statestring
timeoutnumber

showConfirmButtonMessage(message, timeout) → {Monster.Components.Form.ConfirmButton}

Set and show the confirm button message

.

Set and show the confirm button message

Parameters:
NameTypeDescription
messagestring
timeoutnumber

showDialog() → {Monster.Components.Form.PopperButton}

(static) getCSSStyleSheet() → {Array}

Returns:
Type: 
Array

(static) getTag() → {string}

Returns:
Type: 
string