@aurigma/ui-framework
Version:
A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.
495 lines (283 loc) • 10.6 kB
Markdown
# Class: AuWidgetProductInformationAJAX
## Hierarchy
* AuBaseInvisibleWidget
↳ **AuWidgetProductInformationAJAX**
## Implements
* [IWidget](../interfaces/iwidget.md)
* [IRestorableWidget](../interfaces/irestorablewidget.md)
## Index
### Constructors
* [constructor](auwidgetproductinformationajax.md#constructor)
### Properties
* [_isRestoring](auwidgetproductinformationajax.md#_isrestoring)
* [params](auwidgetproductinformationajax.md#params)
### Accessors
* [backOfficeUrl](auwidgetproductinformationajax.md#backofficeurl)
* [costDetails](auwidgetproductinformationajax.md#costdetails)
* [currencyCode](auwidgetproductinformationajax.md#currencycode)
* [currentChoices](auwidgetproductinformationajax.md#currentchoices)
* [designs](auwidgetproductinformationajax.md#designs)
* [designsSettings](auwidgetproductinformationajax.md#designssettings)
* [driverChoices](auwidgetproductinformationajax.md#driverchoices)
* [isPreselectSelectionStrategy](auwidgetproductinformationajax.md#ispreselectselectionstrategy)
* [mockups](auwidgetproductinformationajax.md#mockups)
* [mockupsSettings](auwidgetproductinformationajax.md#mockupssettings)
* [options](auwidgetproductinformationajax.md#options)
* [price](auwidgetproductinformationajax.md#price)
* [priceIsFetching](auwidgetproductinformationajax.md#priceisfetching)
* [productId](auwidgetproductinformationajax.md#productid)
* [productInfo](auwidgetproductinformationajax.md#productinfo)
* [productLinkId](auwidgetproductinformationajax.md#productlinkid)
* [productVersionId](auwidgetproductinformationajax.md#productversionid)
* [quantity](auwidgetproductinformationajax.md#quantity)
* [reference](auwidgetproductinformationajax.md#reference)
* [selectedVariantSku](auwidgetproductinformationajax.md#selectedvariantsku)
* [selectionStrategy](auwidgetproductinformationajax.md#selectionstrategy)
* [storefrontId](auwidgetproductinformationajax.md#storefrontid)
* [storefrontUserId](auwidgetproductinformationajax.md#storefrontuserid)
* [summary](auwidgetproductinformationajax.md#summary)
* [tenantId](auwidgetproductinformationajax.md#tenantid)
* [token](auwidgetproductinformationajax.md#token)
* [variants](auwidgetproductinformationajax.md#variants)
* [variantsHashMap](auwidgetproductinformationajax.md#variantshashmap)
* [variantsSettings](auwidgetproductinformationajax.md#variantssettings)
* [template](auwidgetproductinformationajax.md#static-template)
### Methods
* [checkInitDependenciesWidgets](auwidgetproductinformationajax.md#checkinitdependencieswidgets)
* [exportWidgetData](auwidgetproductinformationajax.md#exportwidgetdata)
* [getDesignVariants](auwidgetproductinformationajax.md#getdesignvariants)
* [getMockupVariants](auwidgetproductinformationajax.md#getmockupvariants)
* [getProductVariants](auwidgetproductinformationajax.md#getproductvariants)
* [resetPreloaderState](auwidgetproductinformationajax.md#resetpreloaderstate)
* [restoreWidgetFromData](auwidgetproductinformationajax.md#restorewidgetfromdata)
* [showPreloader](auwidgetproductinformationajax.md#showpreloader)
* [showToast](auwidgetproductinformationajax.md#showtoast)
## Constructors
### constructor
\+ **new AuWidgetProductInformationAJAX**(): *[AuWidgetProductInformationAJAX](auwidgetproductinformationajax.md)*
*Overrides void*
**Returns:** *[AuWidgetProductInformationAJAX](auwidgetproductinformationajax.md)*
## Properties
### _isRestoring
• **_isRestoring**: *boolean*
___
### 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.
## Accessors
### backOfficeUrl
• **get backOfficeUrl**(): *string*
**Returns:** *string*
___
### costDetails
• **get costDetails**(): *ProductCostDetailsDto*
**Returns:** *ProductCostDetailsDto*
___
### currencyCode
• **get currencyCode**(): *string*
**Returns:** *string*
___
### currentChoices
• **get currentChoices**(): *Record‹string, number[]›*
**Returns:** *Record‹string, number[]›*
___
### designs
• **get designs**(): *[ProductInformationDesign](productinformationdesign.md)[]*
**Returns:** *[ProductInformationDesign](productinformationdesign.md)[]*
___
### designsSettings
• **get designsSettings**(): *[ApiParams](apiparams.md)*
**Returns:** *[ApiParams](apiparams.md)*
___
### driverChoices
• **get driverChoices**(): *Record‹string, number[]›*
**Returns:** *Record‹string, number[]›*
___
### isPreselectSelectionStrategy
• **get isPreselectSelectionStrategy**(): *boolean*
**Returns:** *boolean*
___
### mockups
• **get mockups**(): *[ProductInformationMockup](productinformationmockup.md)[]*
**Returns:** *[ProductInformationMockup](productinformationmockup.md)[]*
___
### mockupsSettings
• **get mockupsSettings**(): *[ApiParams](apiparams.md)*
**Returns:** *[ApiParams](apiparams.md)*
___
### options
• **get options**(): *[ProductInformationOption](productinformationoption.md)[]*
**Returns:** *[ProductInformationOption](productinformationoption.md)[]*
___
### price
• **get price**(): *number*
**Returns:** *number*
___
### priceIsFetching
• **get priceIsFetching**(): *boolean*
**Returns:** *boolean*
___
### productId
• **get productId**(): *string | number*
**Returns:** *string | number*
___
### productInfo
• **get productInfo**(): *[ProductInformation](productinformation.md)‹›*
**Returns:** *[ProductInformation](productinformation.md)‹›*
___
### productLinkId
• **get productLinkId**(): *string | number*
**Returns:** *string | number*
___
### productVersionId
• **get productVersionId**(): *string | number*
**Returns:** *string | number*
___
### quantity
• **get quantity**(): *number*
**Returns:** *number*
___
### reference
• **get reference**(): *string*
**Returns:** *string*
___
### selectedVariantSku
• **get selectedVariantSku**(): *string*
**Returns:** *string*
___
### selectionStrategy
• **get selectionStrategy**(): *SelectionStrategy*
**Returns:** *SelectionStrategy*
___
### storefrontId
• **get storefrontId**(): *string*
**Returns:** *string*
___
### storefrontUserId
• **get storefrontUserId**(): *string*
**Returns:** *string*
___
### summary
• **get summary**(): *any*
**Returns:** *any*
___
### tenantId
• **get tenantId**(): *number*
**Returns:** *number*
___
### token
• **get token**(): *string*
**Returns:** *string*
___
### variants
• **get variants**(): *[ProductInformationVariant](productinformationvariant.md)[]*
**Returns:** *[ProductInformationVariant](productinformationvariant.md)[]*
___
### variantsHashMap
• **get variantsHashMap**(): *Record‹string, number[]›[]*
**Returns:** *Record‹string, number[]›[]*
___
### variantsSettings
• **get variantsSettings**(): *[ApiParams](apiparams.md)*
**Returns:** *[ApiParams](apiparams.md)*
___
### `Static` template
• **get template**(): *HTMLTemplateElement*
*Inherited from void*
**Returns:** *HTMLTemplateElement*
## 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‹any›*
*Implementation of [IRestorableWidget](../interfaces/irestorablewidget.md)*
**Parameters:**
Name | Type |
------ | ------ |
`force` | boolean |
**Returns:** *Promise‹any›*
___
### getDesignVariants
▸ **getDesignVariants**(`productId`: number, `params`: [ApiParams](apiparams.md)): *Promise‹PagedOfProductVariantDesignDto›*
**Parameters:**
Name | Type |
------ | ------ |
`productId` | number |
`params` | [ApiParams](apiparams.md) |
**Returns:** *Promise‹PagedOfProductVariantDesignDto›*
___
### getMockupVariants
▸ **getMockupVariants**(`productId`: number, `params`: [ApiParams](apiparams.md)): *Promise‹PagedOfProductVariantDesignDto›*
**Parameters:**
Name | Type |
------ | ------ |
`productId` | number |
`params` | [ApiParams](apiparams.md) |
**Returns:** *Promise‹PagedOfProductVariantDesignDto›*
___
### getProductVariants
▸ **getProductVariants**(`productId`: number, `params`: [ApiParams](apiparams.md)): *Promise‹PagedOfProductVariantDto›*
**Parameters:**
Name | Type |
------ | ------ |
`productId` | number |
`params` | [ApiParams](apiparams.md) |
**Returns:** *Promise‹PagedOfProductVariantDto›*
___
### resetPreloaderState
▸ **resetPreloaderState**(): *void*
*Inherited from [AuBaseWidget](aubasewidget.md).[resetPreloaderState](aubasewidget.md#resetpreloaderstate)*
**Returns:** *void*
___
### restoreWidgetFromData
▸ **restoreWidgetFromData**(`data`: any, `force`: boolean): *Promise‹void›*
*Implementation of [IRestorableWidget](../interfaces/irestorablewidget.md)*
**Parameters:**
Name | Type |
------ | ------ |
`data` | 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*