/ui/elements/drawer

The drawer element module exports the drawer method for the mapp.ui.elements{} library object.

Methods

(inner) drawer(params) → {HTMLElement}

The drawer method will create and return drawer element with a header and content.

Parameters:
NameTypeDescription
paramsObject

The configuration params for the drawer element.

Properties
NameTypeAttributesDescription
params.data_idstring

The data-id for drawer element.

params.headerHTML

The header element[s].

params.contentHTML

The content element[s] for the drawer.

params.drawerboolean<optional>

Optional flag to skip creation of the expandable container and/or header. Set to false creates header and content. Set to null creates content only. disableOnHide sets the drawer to disabled when a layer is turned off. By default, all style drawers are given disableOnHide behaviour. This can be revoked by passing an empty string or any other value e.g. showOnHide to the drawer property.

params.viewHTMLElement<optional>

The layer view the drawer is in.

Returns:

The drawer element.

Type: 
HTMLElement

(inner) drawerDialog(params) → {HTMLElement}

Creates the button for creating the dialog, which contains the content of the drawer.

A dialog configuration object with defaults will be created if the dialog property value is true.

Several options can be specified in the dialog:

dialog: {
  btn_title: "My panel Dialog",
  btn_label: "Open my panel dialog",
  title: "My dialog title",
  icon: "thumbs_up"
}

A dialog associated with a layer will be closed in the layer hideCallbacks methods.

A dialog will be displayed in the layer showCallbacks methods with the showOnLayerDisplay flag.

Parameters:
NameTypeDescription
paramsobject
Properties
NameTypeDescription
params.layerlayer

A mapp layer associated with the dialog.

params.dialogobject

The configuration for the dialog.

dialog.showOnLayerDisplayboolean

Show dialog when the layer display is toggled on.

dialog.iconstring

material-symbols-outlined icon to show in the button.

dialog.btn_labelstring

Text shown in the button.

dialog.btn_titlestring

Title text assigned to the button element.

Returns:

The button element to toggle the dialog display.

Type: 
HTMLElement

(inner) onClick(e)

The [drawer] onClick event method will shortcircuit if the parentElement has the empty class.

Parameters:
NameTypeDescription
eObject

The click event.

(inner) openDialog(params)

Instatiates the dialog for the drawer, or if the dialog already exists calls the dialog show function.

Parameters:
NameTypeDescription
paramsobject
Properties
NameTypeAttributesDefaultDescription
params.layerlayer

The layer holding the configuration for the drawer.

params.dialogobject

Configuration for the dialog element.

dialog.titlestring<optional>
"Dialog"

Text shown in the dialog header.

dialog.headerHTMLElement<optional>

Header element foor the dialog.

(inner) popout(params)

The method assigns the popout behaviour to the drawer element if the popout property is not falsy.

Parameters:
NameTypeDescription
paramsObject

The configuration params for the drawer element.

Properties
NameTypeAttributesDescription
params.drawerHTML

The drawer element.

params.popoutboolean<optional>

Whether the drawer can be popped out into a dialog.

params.drawerboolean<optional>

Optional flag to skip creation of the expandable container and/or header. Set to false creates header and content. Set to null creates content only.

params.viewHTMLElement<optional>

The layer view the drawer is in.

(inner) popoutDialog(params)

the popoutDialog creates the popout element for a drawer and appends the popout button to the header of the drawer.

Parameters:
NameTypeDescription
paramsObject

The configuration params for the popout element.

Properties
NameTypeDescription
params.data_idstring

The data-id for popout element.

params.headerHTML

The header element[s].

params.contentHTML

The content element[s] for the popout.

params.drawerHTML

The drawer element being popped out.

params.originalTargetHTML

The element that holds the content within the drawer being popped out.