Skip to main content

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

AuWidgetOption

Inherited from

AuAbstractOption.constructor

Properties

_definitionPromise
_definitionPromise: Promise<any>;
Inherited from

AuAbstractOption._definitionPromise

_firstTimeInit
_firstTimeInit: boolean = true;
Inherited from

AuAbstractOption._firstTimeInit

_onChange
_onChange: Function;
Inherited from

AuAbstractOption._onChange

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

AuAbstractOption.element

order
order: IOrder;

An order obtained from the e-commerce driver.

Inherited from

AuAbstractOption.order

params
params: any;

Compiled widget configuration.

Inherited from

AuAbstractOption.params

placeholderText
placeholderText: string;
Inherited from

AuAbstractOption.placeholderText

Accessors

_
Get Signature
get _(): any;

Returns the selected value.

Returns

any

Inherited from

AuAbstractOption._

selected
Get Signature
get selected(): any;

Returns the selected value.

Returns

any

Inherited from

AuAbstractOption.selected

Methods

_manageEmptyValuesText()
_manageEmptyValuesText(applyEmptyValues): void;
Parameters
ParameterType
applyEmptyValuesboolean
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
ParameterType
forceboolean
Returns

Promise<OptionsData>

Implementation of

IRestorableWidget.exportWidgetData

resetPreloaderState()
resetPreloaderState(): void;
Returns

void

Inherited from

AuAbstractOption.resetPreloaderState

restoreWidgetFromData()
restoreWidgetFromData(widgetData, force): Promise<void>;
Parameters
ParameterType
widgetDataOptionsData
forceboolean
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
ParameterTypeDefault valueDescription
isPreloadbooleanundefinedIf true, enables the preloader.
messagestring | string[]...A text message that appears next to the preloader.
timeoutnumber5-
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
ParameterTypeDescription
data?stringA string message to display in the toast.
duration?numberDefines how long to show the toast for.
Returns

void

Inherited from

AuAbstractOption.showToast

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

Was this page helpful?