Monster.Components.Host. Host

The Host component is used to encapsulate the content of a web app.

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

<monster-host></monster-host>

Or you can create this CustomControl directly in Javascript:

import '@schukai/component-state/source/host.mjs';
document.createElement('monster-host');

The Body should have a class "hidden" to ensure that the styles are applied correctly.

body.hidden {
   visibility: hidden;
}

Constructor

new Host()

A simple host component

Fires:
  • Monster.Components.Host.Host#event:monster-host-connected
  • Monster.Components.Host.Host#event:monster-host-disconnected

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

featuresObject

Feature definitions

See

focusManager

locale

resourceManager

translations

(static) instanceSymbol

This method is called by the instanceof operator.

This method is called by the instanceof operator.

Methods

assembleMethodSymbol() → {Monster.Components.Host.Host}

closeOverlay() → {Host}

Throws:

There is no overlay element defined.

Type
Error
Returns:
Type: 
Host

getConfig(key) → {Promise}

Parameters:
NameTypeDescription
key
Returns:
Type: 
Promise

onReady() → {Promise}

The Promise is resolved when the element is connected to the DOM and all resources are available.

The Promise is resolved when the element is connected to the DOM and all resources are available. If the element is not connected to the DOM, the Promise is rejected.

Returns:
Type: 
Promise

openOverlay() → {Host}

Throws:

There is no overlay element defined.

Type
Error
Returns:
Type: 
Host

pushNotification(message)

Parameters:
NameTypeDescription
messagestring | Message

setConfig(key, value) → {Promise}

Parameters:
NameTypeDescription
keystring
value*
Returns:
Type: 
Promise

toggleOverlay() → {Monster.Components.Host.Host}

Throws:

There is no overlay element defined.

Type
Error

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

Returns:
Type: 
Array.<CSSStyleSheet>

(static) getTag() → {string}

Returns:
Type: 
string

Events

event:monster-host-connected

This event is fired during the host connection process.

This event is fired during the host connection process. The event is fired on the host element.

Type:
  • object

event:monster-host-disconnected

This event is fired during the host disconnection process.

This event is fired during the host disconnection process. The event is fired on the host element.

Type:
  • object