@aurigma/ui-framework
Version:
A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.
187 lines (111 loc) • 4.21 kB
Markdown
# Class: AuWidgetVariantSelector
## Hierarchy
↳ [AuBaseWidget](aubasewidget.md)
↳ **AuWidgetVariantSelector**
## Implements
* [IWidget](../interfaces/iwidget.md)
* [IRestorableWidget](../interfaces/irestorablewidget.md)
## Index
### Properties
* [_isRestoring](auwidgetvariantselector.md#_isrestoring)
* [onDoubleClick](auwidgetvariantselector.md#ondoubleclick)
* [params](auwidgetvariantselector.md#params)
* [selectedVariant](auwidgetvariantselector.md#selectedvariant)
### Methods
* [checkInitDependenciesWidgets](auwidgetvariantselector.md#checkinitdependencieswidgets)
* [exportWidgetData](auwidgetvariantselector.md#exportwidgetdata)
* [resetPreloaderState](auwidgetvariantselector.md#resetpreloaderstate)
* [restoreWidgetFromData](auwidgetvariantselector.md#restorewidgetfromdata)
* [showPreloader](auwidgetvariantselector.md#showpreloader)
* [showToast](auwidgetvariantselector.md#showtoast)
* [updateParams](auwidgetvariantselector.md#updateparams)
## Properties
### _isRestoring
• **_isRestoring**: *boolean*
___
### onDoubleClick
• **onDoubleClick**: *Function* = null
___
### params
• **params**: *any*
*Implementation of [IWidget](../interfaces/iwidget.md).[params](../interfaces/iwidget.md#optional-params)*
*Inherited from [AuBaseWidget](aubasewidget.md).[params](aubasewidget.md#params)*
Compiled widget configuration.
___
### selectedVariant
• **selectedVariant**: *[ProductVariantDesign](../interfaces/productvariantdesign.md)*
## 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[]*
___
### exportWidgetData
▸ **exportWidgetData**(`force`: boolean): *Promise‹VariantSelectorData›*
*Implementation of [IRestorableWidget](../interfaces/irestorablewidget.md)*
**Parameters:**
Name | Type |
------ | ------ |
`force` | boolean |
**Returns:** *Promise‹VariantSelectorData›*
___
### resetPreloaderState
▸ **resetPreloaderState**(): *void*
*Inherited from [AuBaseWidget](aubasewidget.md).[resetPreloaderState](aubasewidget.md#resetpreloaderstate)*
**Returns:** *void*
___
### restoreWidgetFromData
▸ **restoreWidgetFromData**(`data`: VariantSelectorData, `force`: boolean): *Promise‹void›*
**Parameters:**
Name | Type |
------ | ------ |
`data` | VariantSelectorData |
`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*
___
### updateParams
▸ **updateParams**(`params`: [VariantSelectorConfig](../interfaces/variantselectorconfig.md)): *void*
*Overrides void*
**Parameters:**
Name | Type |
------ | ------ |
`params` | [VariantSelectorConfig](../interfaces/variantselectorconfig.md) |
**Returns:** *void*