Skip to main content

au-widget-color-picker/au-widget-color-picker

Classes

AuWidgetColorPicker

A widget that is used to select colors in the editor.

{
"widgets": [
{
"title": "Background Color",
"name": "colors",
"type": "color-picker",
"params": {
"text": "Choose a background",
"type": "color",
"colors": [
{
"value": "Beige",
"displayColor": "#dac0a3"
},
{
"value": "Kelly Green",
"displayColor": "#017c60"
},
{
"value": "Yellow",
"displayColor": "#fed505"
},
{
"value": "Teal",
"displayColor": "#009ead"
}
]
}
}
]
}

Extends

Implements

Constructors

Constructor
new AuWidgetColorPicker(): AuWidgetColorPicker;
Returns

AuWidgetColorPicker

Inherited from

AuBaseSelectorWidget.constructor

Properties

color
color: any;

The color selected by the user.

params
params: IColorPickerConfig;

Properties of the widget.

Overrides

AuBaseSelectorWidget.params

Accessors

_
Get Signature
get _(): boolean;

Returns the selected value.

Returns

boolean

Overrides

AuBaseSelectorWidget._

Methods

checkInitDependenciesWidgets()
checkInitDependenciesWidgets(): string[];

Returns an array of widget names, due to which the current widget cannot receive parameters.

Returns

string[]

Inherited from

AuBaseSelectorWidget.checkInitDependenciesWidgets

clearSelection()
clearSelection(): void;

Sets the color value to false to reset the color selection.

Returns

void

Overrides

AuBaseSelectorWidget.clearSelection

closePicker()
closePicker(): void;

Closes the color picker.

Returns

void

exportWidgetData()
exportWidgetData(force): Promise<ColorPickerData>;
Parameters
ParameterType
forceboolean
Returns

Promise<ColorPickerData>

Implementation of

IRestorableWidget.exportWidgetData

resetPreloaderState()
resetPreloaderState(): void;
Returns

void

Inherited from

AuBaseSelectorWidget.resetPreloaderState

restoreWidgetFromData()
restoreWidgetFromData(widgetData, force): Promise<void>;
Parameters
ParameterType
widgetDataColorPickerData
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

AuBaseSelectorWidget.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

AuBaseSelectorWidget.showToast

togglePicker()
togglePicker(): void;

Shows and hides the color picker.

Returns

void

References

widget

Renames and re-exports AuWidgetColorPicker

Was this page helpful?