@aurigma/ui-framework
Version:
A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.
160 lines (102 loc) • 3.94 kB
Markdown
A widget that is used to initialize several products in your editor and receive several orders, either of which is bound to a separate product.
This widget can be used instead of the [Order widget](https://customerscanvas.com/dev/editors/ui-framework/widgets/order.html).
For details, you can refer to the [Cart widget](https://customerscanvas.com/dev/editors/ui-framework/widgets/cart.html) topic.
```
{
"widgets": [
{
"name": "cart",
"type": "cart",
"params": {
"lineItems": [
{
"productIndex": 0,
"images": "{{ getOrDefault(\" $['editor'].proofImageUrls.map(item=>item[0])\",[]) }}",
"downloadUrls": "{{ getOrDefault(\" $['editor'].hiResUrls \",[]) }}",
"data": {
"stateId": "{{ getOrDefault(\" $['editor'].stateId \",'') }}",
"orderUrl": "{{ getOrDefault(\" settings.customersCanvasBaseUrl.toLowerCase().split('users')[0] + '/orders/DepositPhotos?userId=' + $['editor'].userId + '&stateId=' + $['editor'].stateId\",'') }}"
},
"props": { }
}
]
}
}
]
}
```
* AuBaseInvisibleWidget
↳ **AuWidgetCart**
* [IWidget](../interfaces/iwidget.md)
* [params](auwidgetcart.md
* [template](auwidgetcart.md
* [checkInitDependenciesWidgets](auwidgetcart.md
* [resetPreloaderState](auwidgetcart.md
* [showPreloader](auwidgetcart.md
* [showToast](auwidgetcart.md
• **params**: *[ICartConfig](../interfaces/icartconfig.md)*
*Implementation of [IWidget](../interfaces/iwidget.md).[params](../interfaces/iwidget.md
*Overrides [AuBaseWidget](aubasewidget.md).[params](aubasewidget.md
Properties of the widget.
• **get template**(): *HTMLTemplateElement*
*Inherited from void*
**Returns:** *HTMLTemplateElement*
▸ **checkInitDependenciesWidgets**(): *string[]*
*Inherited from [AuBaseWidget](aubasewidget.md).[checkInitDependenciesWidgets](aubasewidget.md
Returns an array of widget names, due to which the current widget cannot receive parameters.
**Returns:** *string[]*
___
▸ **resetPreloaderState**(): *void*
*Inherited from [AuBaseWidget](aubasewidget.md).[resetPreloaderState](aubasewidget.md
**Returns:** *void*
___
▸ **showPreloader**(`isPreload`: boolean, `message`: string | string[], `timeout`: number): *void*
*Inherited from [AuBaseWidget](aubasewidget.md).[showPreloader](aubasewidget.md
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 &
`timeout` | number | 5 | - |
**Returns:** *void*
___
▸ **showToast**(`data?`: string, `duration?`: number): *void*
*Inherited from [AuBaseWidget](aubasewidget.md).[showToast](aubasewidget.md
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*