UNPKG

@aurigma/ui-framework

Version:

A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.

139 lines (80 loc) 2.89 kB
# Class: AuBaseWidget The base class for widgets. ## Hierarchy * any ↳ **AuBaseWidget** ↳ [AuBaseSelectorWidget](aubaseselectorwidget.md) ↳ [AuDesignEditor](audesigneditor.md) ↳ [AuWidgetButton](auwidgetbutton.md) ↳ [AuCanvas](aucanvas.md) ↳ [AuWidgetHtml](auwidgethtml.md) ↳ [AuWidgetImageCarousel](auwidgetimagecarousel.md) ↳ [AuWidgetStaticText](auwidgetstatictext.md) ↳ [AuWidgetUploader](auwidgetuploader.md) ↳ [AuWidgetDndController](auwidgetdndcontroller.md) ↳ [Au3dViewerBase](au3dviewerbase.md) ↳ [AuWidgetSlider](auwidgetslider.md) ↳ [AuWidgetPreflight](auwidgetpreflight.md) ↳ [AuWidgetVariantSelector](auwidgetvariantselector.md) ↳ [AuWidgetPreviewMockupSlider](auwidgetpreviewmockupslider.md) ↳ [AuWidgetPantoneColorPicker](auwidgetpantonecolorpicker.md) ↳ [AuWidgetDesignAtoms](auwidgetdesignatoms.md) ## Implements * [IWidget](../interfaces/iwidget.md) ## Index ### Properties * [params](aubasewidget.md#params) ### Methods * [checkInitDependenciesWidgets](aubasewidget.md#checkinitdependencieswidgets) * [resetPreloaderState](aubasewidget.md#resetpreloaderstate) * [showPreloader](aubasewidget.md#showpreloader) * [showToast](aubasewidget.md#showtoast) ## Properties ### params**params**: *any* *Implementation of [IWidget](../interfaces/iwidget.md).[params](../interfaces/iwidget.md#optional-params)* Compiled widget configuration. ## Methods ### checkInitDependenciesWidgets**checkInitDependenciesWidgets**(): *string[]* Returns an array of widget names, due to which the current widget cannot receive parameters. **Returns:** *string[]* ___ ### resetPreloaderState ▸ **resetPreloaderState**(): *void* **Returns:** *void* ___ ### showPreloader**showPreloader**(`isPreload`: boolean, `message`: string | string[], `timeout`: number): *void* 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 | string[] | [""] | A text message that appears next to the preloader. | `timeout` | number | 5 | - | **Returns:** *void* ___ ### showToast ▸ **showToast**(`data?`: string, `duration?`: number): *void* 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*