UNPKG

@aurigma/ui-framework

Version:

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

272 lines (157 loc) 5.7 kB
# Class: AuPIMDesignSelector ## Hierarchy ↳ [AuBaseSelectorWidget](aubaseselectorwidget.md) ↳ **AuPIMDesignSelector** ## Implements * [IWidget](../interfaces/iwidget.md) * [IRestorableWidget](../interfaces/irestorablewidget.md) ## Index ### Properties * [container](aupimdesignselector.md#container) * [currentPage](aupimdesignselector.md#currentpage) * [displayedVariants](aupimdesignselector.md#displayedvariants) * [imageIsLoading](aupimdesignselector.md#imageisloading) * [ironSelectorElement](aupimdesignselector.md#ironselectorelement) * [pages](aupimdesignselector.md#pages) * [params](aupimdesignselector.md#params) * [showPagination](aupimdesignselector.md#showpagination) * [value](aupimdesignselector.md#value) * [variants](aupimdesignselector.md#variants) ### Accessors * [_](aupimdesignselector.md#_) * [sku](aupimdesignselector.md#sku) ### Methods * [checkInitDependenciesWidgets](aupimdesignselector.md#checkinitdependencieswidgets) * [clearSelection](aupimdesignselector.md#clearselection) * [exportWidgetData](aupimdesignselector.md#exportwidgetdata) * [onWidgetDisplayAsync](aupimdesignselector.md#onwidgetdisplayasync) * [ready](aupimdesignselector.md#ready) * [resetPreloaderState](aupimdesignselector.md#resetpreloaderstate) * [restoreWidgetFromData](aupimdesignselector.md#restorewidgetfromdata) * [showPreloader](aupimdesignselector.md#showpreloader) * [showToast](aupimdesignselector.md#showtoast) ## Properties ### container**container**: *any* ___ ### currentPage • **currentPage**: *number* = 1 ___ ### displayedVariants**displayedVariants**: *[ProductInformationDesign](productinformationdesign.md)[]* = [] ___ ### imageIsLoading • **imageIsLoading**: *boolean* = true ___ ### ironSelectorElement**ironSelectorElement**: *IronSelectorElement* ___ ### pages • **pages**: *number* = 1 ___ ### params**params**: *[IDesignSelectorConfig](../interfaces/idesignselectorconfig.md)* *Implementation of [IWidget](../interfaces/iwidget.md).[params](../interfaces/iwidget.md#optional-params)* *Overrides [AuBaseWidget](aubasewidget.md).[params](aubasewidget.md#params)* Properties of this widget. ___ ### showPagination • **showPagination**: *boolean* = false ___ ### value**value**: *[ProductInformationDesign](productinformationdesign.md)* A gallery item. ___ ### variants • **variants**: *[ProductInformationDesign](productinformationdesign.md)[]* = [] ## Accessors ### _ • **get _**(): *[ProductInformationDesign](productinformationdesign.md)* *Overrides [AuBaseSelectorWidget](aubaseselectorwidget.md).[_](aubaseselectorwidget.md#_)* Returns the selected gallery item. **Returns:** *[ProductInformationDesign](productinformationdesign.md)* ___ ### sku**get sku**(): *string* **Returns:** *string* ## Methods ### checkInitDependenciesWidgets**checkInitDependenciesWidgets**(): *string[]* *Inherited from [AuBaseWidget](aubasewidget.md).[checkInitDependenciesWidgets](aubasewidget.md#checkinitdependencieswidgets)* Returns an array of widget names, due to which the current widget cannot receive parameters. **Returns:** *string[]* ___ ### clearSelection ▸ **clearSelection**(): *void* *Overrides [AuBaseSelectorWidget](aubaseselectorwidget.md).[clearSelection](aubaseselectorwidget.md#abstract-clearselection)* **Returns:** *void* ___ ### exportWidgetData**exportWidgetData**(`force`: boolean): *Promise‹any›* *Implementation of [IRestorableWidget](../interfaces/irestorablewidget.md)* **Parameters:** Name | Type | ------ | ------ | `force` | boolean | **Returns:** *Promise‹any›* ___ ### onWidgetDisplayAsync ▸ **onWidgetDisplayAsync**(): *Promise‹void›* *Overrides void* **Returns:** *Promise‹void›* ___ ### ready**ready**(): *void* **Returns:** *void* ___ ### resetPreloaderState ▸ **resetPreloaderState**(): *void* *Inherited from [AuBaseWidget](aubasewidget.md).[resetPreloaderState](aubasewidget.md#resetpreloaderstate)* **Returns:** *void* ___ ### restoreWidgetFromData**restoreWidgetFromData**(`widgetData`: any, `force`: boolean): *Promise‹void›* *Implementation of [IRestorableWidget](../interfaces/irestorablewidget.md)* **Parameters:** Name | Type | ------ | ------ | `widgetData` | any | `force` | boolean | **Returns:** *Promise‹void›* ___ ### showPreloader ▸ **showPreloader**(`isPreload`: boolean, `message`: string | string[], `timeout`: number): *void* *Inherited from [AuBaseWidget](aubasewidget.md).[showPreloader](aubasewidget.md#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 | string[] | [""] | A text message that appears next to the preloader. | `timeout` | number | 5 | - | **Returns:** *void* ___ ### showToast**showToast**(`data?`: string, `duration?`: number): *void* *Inherited from [AuBaseWidget](aubasewidget.md).[showToast](aubasewidget.md#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*