@aurigma/ui-framework
Version:
A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.
165 lines (106 loc) • 3.53 kB
Markdown
A widget that is used to display multiple images together.
The following example illustrates how you can initialize a slider with proof images obtained from the Design Editor.
```
{
"widgets": [{
"name": "preview",
"type": "slider",
"params": {
"style": {
"--au-widget-background": "#ffffff",
"--au-widget-height": "480px"
},
"direction": "tile",
"rows": 1,
"columns": 2,
"showImageIndex": false,
"lightbox": false,
"images": {
"{{ #each $['editor'].proofImageUrls as url }}": {
"url": "{{ url[0] }}"
}
}
}
}]
}
```
↳ [AuBaseWidget](aubasewidget.md)
↳ **AuWidgetSlider**
* [IWidget](../interfaces/iwidget.md)
* [params](auwidgetslider.md
* [backImage](auwidgetslider.md
* [checkInitDependenciesWidgets](auwidgetslider.md
* [nextImage](auwidgetslider.md
* [resetPreloaderState](auwidgetslider.md
* [showPreloader](auwidgetslider.md
* [showToast](auwidgetslider.md
• **params**: *any*
*Implementation of [IWidget](../interfaces/iwidget.md).[params](../interfaces/iwidget.md
*Inherited from [AuBaseWidget](aubasewidget.md).[params](aubasewidget.md
Compiled widget configuration.
▸ **backImage**(): *void*
Navigates to the previous image.
**Returns:** *void*
___
▸ **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[]*
___
▸ **nextImage**(): *void*
Navigates to the next image.
**Returns:** *void*
___
▸ **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*