au-widget-mockup-previews
Classes
AuWidgetMockupPreviewAJAX
A widget for get previews on mockups.
Example of use:
{
"widgets": [
{
"name": "mockup-previews",
"type": "mockup-previews-ajax",
"params": {
"size": { "width": 450, "height": 450 },
"visualizePrintAreas": false,
"format": "png"
"state": {
"id": "{{ $['editor].stateId }}",
"surfacesCount": "{{ $['editor'].surfaceCount }}"
},
"mockups": "{{ $['pim-ajax'].mockups }}"
}
}
}
Constructors
Constructor
new AuWidgetMockupPreviewAJAX(): AuWidgetMockupPreviewAJAX;
Returns
Overrides
AuBaseInvisibleWidget.constructor
Properties
params
params: any;
Compiled widget configuration.
Inherited from
AuBaseInvisibleWidget.params
urls
urls: string[] = [];
Accessors
surfacesCount
Get Signature
get surfacesCount(): any;
Returns
any
template
Get Signature
get static template(): any;
Returns
any
Inherited from
AuBaseInvisibleWidget.template
Methods
checkInitDependenciesWidgets()
checkInitDependenciesWidgets(): string[];
Returns an array of widget names, due to which the current widget cannot receive parameters.
Returns
string[]
Inherited from
AuBaseInvisibleWidget.checkInitDependenciesWidgets
render()
render(): Promise<void>;
Returns
Promise<void>
resetPreloaderState()
resetPreloaderState(): void;
Returns
void
Inherited from
AuBaseInvisibleWidget.resetPreloaderState
showPreloader()
showPreloader(
isPreload,
message?,
timeout?): void;
Shows a preloader.
"onClick": [
"{{#function main.showPreloader(true, 'Creating print files...')}}",
"{{#function $['editor'].getHiResImages(800,800)}}",
"{{#function main.showPreloader(false)}}"
]
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
isPreload | boolean | undefined | If true, enables the preloader. |
message | string | string[] | ... | A text message that appears next to the preloader. |
timeout | number | 5 | - |
Returns
void
Inherited from
AuBaseInvisibleWidget.showPreloader
showToast()
showToast(data?, duration?): void;
Shows a toast.
return editor.loadUserInfo(data)
.catch(err => {
this.widget.showToast("Error: Invalid data");
console.log(err);
});
Parameters
| Parameter | Type | Description |
|---|---|---|
data? | string | A string message to display in the toast. |
duration? | number | Defines how long to show the toast for. |
Returns
void
Inherited from
AuBaseInvisibleWidget.showToast
Interfaces
IMockupPreviewAJAX
Properties
format
format: "png" | "jpeg";
mockups
mockups: ProductInformationMockup[];
size
size: object;
height
height: number;
width
width: number;
state
state: object;
id
id: string;
surfacesCount?
optional surfacesCount?: number;
visualizePrintAreas
visualizePrintAreas: boolean;
References
widget
Renames and re-exports AuWidgetMockupPreviewAJAX