Monster.Components.Form. ApiButton

The ApiButton is a button that opens a popper element with possible actions.

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

<monster-action-button></monster-action-button>

Or you can create this CustomControl directly in Javascript:

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

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

Constructor

new ApiButton()

A button that opens a popper element with possible actions.

Since
  • 3.32.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
mappingobject

The mapping object.

Properties
NameTypeDescription
selectorstring

The selector to find the buttons in the response.

labelSelectorstring

The selector to find the label for the button.

labelTemplatestring

The template to create the label for the button.

apiTemplatestring

The template to create the api for the button.

urlTemplatestring

The template to create the url for the button.

filterfunction

The filter function to filter the buttons.

urlstring

The url to fetch the data.

apiobject

The api options.

Properties
NameTypeDescription
fetchobject

The fetch options.

bodystring

The body template.

callbacksobject

The callbacks object.

Properties
NameTypeDescription
beforeApifunction

The beforeApi callback.

fetchobject

The fetch options.

Properties
NameTypeDescription
redirectstring

The redirect option.

methodstring

The method option.

modestring

The mode option.

credentialsstring

The credentials option.

headersobject

The headers option.

Properties
NameTypeDescription
acceptstring

The accept option.

See

(static) instanceSymbol

This method is called by the instanceof operator.

This method is called by the instanceof operator.

Methods

assembleMethodSymbol() → {Monster.Components.Form.Popper}

fetch() → {Promise}

Returns:
Type: 
Promise

importButtons(data) → {Monster.Components.Form.ApiButton}

Import buttons from a map.

Import buttons from a map.

Parameters:
NameTypeDescription
dataarray | object | Map | Set
Since
  • 0.16.0
Throws:
  • map is not iterable

    Type
    Error
  • missing label configuration

    Type
    Error

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

Returns:
Type: 
Array.<CSSStyleSheet>

(static) getTag() → {string}

Returns:
Type: 
string