au-widget-data-driven-editor/au-widget-data-driven-editor
Classes
AuWidgetDataDrivenEditor
Represents a Data-Driven Editor widget, enabling users to fill out pre-configured forms and modify designs accordingly.
For details, you can refer to the Data-Driven Editor widget topic.
{
"widgets": [
{
"name": "dde",
"type": "data-driven-editor",
"params": {
"config": {
"design": {
"designId": "68e74591f70c72b7ce14f889",
"dataSetId": "68a24768aa00e6f0203564dc"
},
"settings": {
"lang": "en",
"allowManipulations": false,
"itemsSnapLines": true
},
"renderer": {
"watermarkEnabled": true,
"watermarkOpacity": 0.5,
"format": "jpeg"
}
}
}
}
]
}
Extends
Implements
Properties
idStr
idStr: string;
Product ID string
Implementation of
isValid
isValid: boolean;
true if form of data driven editor is valid
Implementation of
IWidgetDataDrivenEditor.isValid
pdfUrl
pdfUrl: string;
URL for download PDF file
Implementation of
IWidgetDataDrivenEditor.pdfUrl
previewUrlLink
previewUrlLink: string;
URL preview image (First page)
Implementation of
IWidgetDataDrivenEditor.previewUrlLink
previewUrls
previewUrls: string[] = [];
URL's preview images
Implementation of
IWidgetDataDrivenEditor.previewUrls
stateId
stateId: string;
Saved product ID
Implementation of
IWidgetDataDrivenEditor.stateId
userId
userId: string;
Current user ID
Implementation of
IWidgetDataDrivenEditor.userId
Methods
checkInitDependenciesWidgets()
checkInitDependenciesWidgets(): string[];
Returns an array of widget names, due to which the current widget cannot receive parameters.
Returns
string[]
Inherited from
AuBaseWidget.checkInitDependenciesWidgets
createIdStr()
createIdStr(): Promise<string>;
Create id string from values from data driven form
Returns
Promise<string>
Implementation of
IWidgetDataDrivenEditor.createIdStr
createPdfPreview()
createPdfPreview(config?): Promise<string>;
Create link for download preview PDF file
Parameters
| Parameter | Type | Description |
|---|---|---|
config? | IRendererConfig | Render configuration |
Returns
Promise<string>
Implementation of
IWidgetDataDrivenEditor.createPdfPreview
createPreview()
createPreview(config?): Promise<string[]>;
Create preview images
Parameters
| Parameter | Type | Description |
|---|---|---|
config? | IRendererConfig | Render configuration |
Returns
Promise<string[]>
Implementation of
IWidgetDataDrivenEditor.createPreview
exportWidgetData()
exportWidgetData(force): Promise<Partial<IEditorConfig>>;
Parameters
| Parameter | Type |
|---|---|
force | boolean |
Returns
Promise<Partial<IEditorConfig>>
Implementation of
IRestorableWidget.exportWidgetData
getFormData()
getFormData(config): Record<string, string>;
Allow to get current data of form
Parameters
| Parameter | Type |
|---|---|
config | IFormDataConfig |
Returns
Record<string, string>
Implementation of
IWidgetDataDrivenEditor.getFormData
getInvalidFieldsNames()
getInvalidFieldsNames(): string[];
Allows you to get the names of fields that have not been validated.
Returns
string[]
resetPreloaderState()
resetPreloaderState(): void;
Returns
void
Inherited from
AuBaseWidget.resetPreloaderState
restoreWidgetFromData()
restoreWidgetFromData(data, force): Promise<void>;
Parameters
| Parameter | Type |
|---|---|
data | IEditorConfig |
force | boolean |
Returns
Promise<void>
Implementation of
IRestorableWidget.restoreWidgetFromData
saveProduct()
saveProduct(asNew): Promise<void>;
Saved or updated current product to private storage
Parameters
| Parameter | Type |
|---|---|
asNew | boolean |
Returns
Promise<void>
Implementation of
IWidgetDataDrivenEditor.saveProduct
setEditorConfig()
setEditorConfig(config): Promise<void>;
Sets the configuration of data driven editor
Parameters
| Parameter | Type |
|---|---|
config | IEditorConfig |
Returns
Promise<void>
Implementation of
IWidgetDataDrivenEditor.setEditorConfig
setLang()
setLang(lang): void;
Sets the language of data driven editor
Parameters
| Parameter | Type |
|---|---|
lang | string |
Returns
void
setUserInfo()
setUserInfo(userInfo): void;
Allow to set user info
Parameters
| Parameter | Type |
|---|---|
userInfo | Record<string, string> |
Returns
void
Implementation of
IWidgetDataDrivenEditor.setUserInfo
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
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
updateToken()
updateToken(token): void;
Update the token for data driven editor.
Parameters
| Parameter | Type |
|---|---|
token | string |
Returns
void
Deprecated
validate()
validate(): boolean;
Validate form in editor
Returns
boolean
Implementation of
IWidgetDataDrivenEditor.validate
References
widget
Renames and re-exports AuWidgetDataDrivenEditor