Constructor
new Button()
A simple button
- Since
- 1.5.0
- Copyright
- schukai GmbH
import {Button} from '@schukai/component-form/source/button.js';
const button = document.createElement('monster-button');
// set label
button.setOption('labels.button', 'Click')
// add action for click
button.setOption('actions.click', function (e) {
console.log(e);
})
document.body.appendChild(button)
Members
defaults
data-monster-options
must be used.To set the options via the html tag the attribute data-monster-options
must be used.
Name | Type | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
templates | Object | Template definitions Properties
| |||||||||
labels | Object | Labels Properties
| |||||||||
actions | Object | Callbacks Properties
| |||||||||
classes | Object | CSS classes Properties
| |||||||||
disabled | boolean | false | Disabled state | ||||||||
effects | Object | Effects Properties
|
- See
- https://monsterjs.org/en/doc/#configurate-a-monster-control The individual configuration values can be found in the table.
(static) instanceSymbol
instanceof
operator.This method is called by the instanceof
operator.
- Since
- 2.1.0
(static) observedAttributes
attributeChangedCallback()
.This method determines which attributes are to be monitored by attributeChangedCallback()
.
Methods
assembleMethodSymbol() → {Monster.Components.Form.Button}
blur()
The Button.blur() method removes focus from the internal button element.
click()
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.
Name | Type | Description |
---|---|---|
options | Object |
- Since
- 3.27.0
(static) getCSSStyleSheet() → {Array.<CSSStyleSheet>}
- Type:
- Array.<CSSStyleSheet>
(static) getTag() → {string}
- Type:
- string