Contact us

Applies to: Customer's Canvas On-Premises; Customer's Canvas Hub cloud; UI Framework 4.0 - 4.47

Skip to main content

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​

AuWidgetMockupPreviewAJAX

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​
ParameterTypeDefault valueDescription
isPreloadbooleanundefinedIf true, enables the preloader.
messagestring | string[]...A text message that appears next to the preloader.
timeoutnumber5-
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​
ParameterTypeDescription
data?stringA string message to display in the toast.
duration?numberDefines 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

Was this page helpful?