White paper: Templates in web-to-print.  Free download

Class: AuWidgetHelp

A widget that is used to display webpages and modal windows.

In the following example, we define a modal window to be displayed in the help widget.

{
  "modals": [
    {
      "name": "faq",
      "header": "F.A.Q.",
      "showOnStartup": true,
      "externalContent": {
        "url": "https://example.com/pages/faq",
      }
    }
  ],
  "widgets": [
    {
      "name": "help",
      "type": "help",
      "title": "help",
      "params": {
        "steps": {
          "0": {
            "type": "modal",
            "content": "faq"
          },
          "1": {
            "type": "page",
            "content": "http://customerscanvas.com"
          }
        }
      }
    }
  ]
}

Hierarchy

  • AuBaseInvisibleWidget

    AuWidgetHelp

Implements

Index

Properties

Accessors

Methods

Properties

params

params: IAuWidgetHelpParams

Overrides AuBaseWidget.params

Properties of the widget.


paramsRaw

paramsRaw: any

Inherited from AuBaseWidget.paramsRaw

Uncompiled widget configuration.

Accessors

Static template

get template(): HTMLTemplateElement

Inherited from void

Returns:HTMLTemplateElement

Methods

addCustomStyles

addCustomStyles(params: any): void

Inherited from AuBaseWidget.addCustomStyles

Applies new styles to a widget.

Parameters:

Name Type
params any

Returns:void


compile

compile(additionalParam: any): Promise‹any›

Inherited from AuBaseWidget.compile

Compiles the widget config.

"steps": [{
  "name": "card-size",
  "title": "Step 1. Card Options",
  "description": "Choose a card size.",
  "toolPanel": {
    "name": "options"
  },
  "onActivate": [
    "{{#function $['logo'].compile() }}"
  ]
},
...

Parameters:

Name Type Default Description
additionalParam any Parameters for widget config compilation.

Returns:Promise‹any›

The compiled widget configuration.


emitChange

emitChange(data: any, forceRecompile: boolean): void

Inherited from AuBaseWidget.emitChange

Sends a message about the widget state changes.

"steps": [{
  "name": "card-size",
  "title": "Step 1. Card Options",
  "description": "Choose a card size.",
  "toolPanel": {
    "name": "options"
  },
  "onActivate": [
    "{{#function $['options'].emitChange()}}"
  ]
},
...

Parameters:

Name Type Default Description
data any Data for updating the widget.
forceRecompile boolean false If true, runs widget recompilation to apply the updated parameters.

Returns:void


showPreloader

showPreloader(isPreload: boolean, message: string): void

Inherited from AuBaseWidget.showPreloader

Shows a preloader.

"onClick": [
  "{{#function main.showPreloader(true, 'Creating print files...')}}",
  "{{#function $['editor'].getHiResImages(800,800)}}",
  "{{#function main.showPreloader(false)}}"
]

Parameters:

Name Type Default Description
isPreload boolean - If true, enables the preloader.
message string undefined A text message that appears next to the preloader.

Returns:void


showToast

showToast(data?: string, duration?: number): void

Inherited from AuBaseWidget.showToast

Shows a toast.

return editor.loadUserInfo(data)
    .catch(err => {
        this.widget.showToast("Error: Invalid data");
        console.log(err);
    });

Parameters:

Name Type Description
data? string A string message to display in the toast.
duration? number Defines how long to show the toast for.

Returns:void