au-widget-option/au-widget-option
Classes
AuWidgetOption
A widget that is used to select product options provided by an e-commerce system such as paper types, colors, sizes, etc.
For details, you can refer to the Option widget topic.
{
"widgets": [
{
"title": "Book Size (Inches)",
"name": "books",
"type": "option",
"params": {
"type": "list",
"title": "Book Size (Inches)",
"initWithEmptyValue": true,
"placeholderText": "Select a book size",
"values": []
}
},
{
"title": "Type of Pages",
"name": "pages",
"type": "option",
"params": {
"type": "radio",
"subType": "compact",
"title": "Type of Pages",
"initWithEmptyValue": true,
"placeholderText": "Select a type",
"values": []
}
}
]
}
Extends
Implements
Constructors
Constructor
new AuWidgetOption(): AuWidgetOption;
Returns
Inherited from
Properties
_definitionPromise
_definitionPromise: Promise<any>;
Inherited from
AuAbstractOption._definitionPromise
_firstTimeInit
_firstTimeInit: boolean = true;
Inherited from
AuAbstractOption._firstTimeInit
_onChange
_onChange: Function;
Inherited from
definition
definition: IOption;
An option definition obtained from the e-commerce driver.
element
element: AuOptionBase;
An option obtained from the e-commerce driver.
Inherited from
order
order: IOrder;
An order obtained from the e-commerce driver.
Inherited from
params
params: any;
Compiled widget configuration.
Inherited from
placeholderText
placeholderText: string;
Inherited from
AuAbstractOption.placeholderText
Accessors
_
Get Signature
get _(): any;
Returns the selected value.
Returns
any
Inherited from
selected
Get Signature
get selected(): any;
Returns the selected value.
Returns
any
Inherited from
Methods
_manageEmptyValuesText()
_manageEmptyValuesText(applyEmptyValues): void;
Parameters
| Parameter | Type |
|---|---|
applyEmptyValues | boolean |
Returns
void
Inherited from
AuAbstractOption._manageEmptyValuesText
checkInitDependenciesWidgets()
checkInitDependenciesWidgets(): string[];
Returns an array of widget names, due to which the current widget cannot receive parameters.
Returns
string[]
Inherited from
AuAbstractOption.checkInitDependenciesWidgets
clearSelection()
clearSelection(): void;
Sets the value of the option to null.
Returns
void
Inherited from
AuAbstractOption.clearSelection
exportWidgetData()
exportWidgetData(force): Promise<OptionsData>;
Parameters
| Parameter | Type |
|---|---|
force | boolean |
Returns
Promise<OptionsData>
Implementation of
IRestorableWidget.exportWidgetData
resetPreloaderState()
resetPreloaderState(): void;
Returns
void
Inherited from
AuAbstractOption.resetPreloaderState
restoreWidgetFromData()
restoreWidgetFromData(widgetData, force): Promise<void>;
Parameters
| Parameter | Type |
|---|---|
widgetData | OptionsData |
force | boolean |
Returns
Promise<void>
Implementation of
IRestorableWidget.restoreWidgetFromData
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
AuAbstractOption.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
Interfaces
IWidgetOptionParam
Provides advanced settings for options.
Extends
unknown
Properties
applyEmptyValues
applyEmptyValues: boolean;
hidden
hidden: boolean;
If true, hides this option.
onChange?
optional onChange?: Function | Function[];
A single function or an array of functions that will be executed when the option value is changed.
orderIndex
orderIndex: number;
The order index.
values
values: PointedArray<IWidgetOptionValue>;
the option values as defined in the ecommerce-driver.
References
IWidgetOptionValue
Re-exports IWidgetOptionValue
widget
Renames and re-exports AuWidgetOption