A.ColorPickerBase Class
A base class for ColorPickerBase
.
Constructor
A.ColorPickerBase
-
config
Parameters:
-
config
ObjectObject literal specifying widget configuration properties.
Index
Methods
- _bindHSVPalette
- _bindNoColor
- _bindUICPBase
- _defaultValueRecentColors
- _findRecentColorEmptySpot
- _getCurrentTrigger
- _getDefaultAttributeValue
- _getHSVPalette
- _onColorChange
- _onColorPaletteSelectChange
- _onHSVPaletteOK
- _onHSVTriggerClick
- _onNoColorClick
- _onRecentColorClick
- _onRecentColorPaletteSelectChange
- _onTriggerInteraction
- _onVisibleChange
- _renderActionsContainer
- _renderColorPalette
- _rendererUICPBase
- _renderHSVTrigger
- _renderNoColor
- _renderRecentColors
- _setTrigger
- _uiSetTrigger
- _validateTrigger
- destructor
- initializer
- reset
Properties
- ATTRS static
- CSS_PREFIX static
- NAME static
Methods
_bindHSVPalette
()
protected
Binds events to the HSVPalette
.
_bindNoColor
()
protected
Binds the click event to the NoColor node.
_bindUICPBase
()
protected
Binds base events to the ColorPickerBase
instance.
_defaultValueRecentColors
()
Object
protected
Provides the default value for the recentColors
attribute.
Returns:
_findRecentColorEmptySpot
-
items
Returns an empty spot from the recentColors
palette.
Parameters:
-
items
Array
Returns:
Index of the empty spot
_getDefaultAttributeValue
-
attributeName
Returns the default value of passed attribute.
Parameters:
-
attributeName
String
Returns:
The default value of an attribute
_getHSVPalette
()
Object
protected
Returns the HSVAPaletteModal
instance.
Returns:
HSV palette modal
_onColorChange
-
event
Fires the select event and hides popover.
Parameters:
-
event
EventFacade
_onColorPaletteSelectChange
-
event
Sets the newly selected color from color palette.
Parameters:
-
event
EventFacade
_onHSVPaletteOK
-
event
Selects the custom color from the HSVAPaletteModal
.
Parameters:
-
event
EventFacade
_onHSVTriggerClick
()
protected
Opens HSVAPaletteModal
.
_onNoColorClick
-
event
Removes color from the current trigger
.
Parameters:
-
event
EventFacade
_onRecentColorClick
-
event
Sets the selected color from the recentColors
palette.
Parameters:
-
event
EventFacade
_onRecentColorPaletteSelectChange
-
event
Sets the newly selected color from recentColors
.
Parameters:
-
event
EventFacade
_onTriggerInteraction
-
event
Displays or hides the color picker after trigger
interaction.
Parameters:
-
event
EventFacade
_onVisibleChange
-
event
Syncs clickoutside event and refocuses trigger
on modal hide.
Parameters:
-
event
EventFacade
_renderActionsContainer
()
protected
Renders and appends actions container to the body.
_renderColorPalette
()
protected
Creates new instance of the ColorPalette
component with defaultColor
options.
_rendererUICPBase
()
protected
Renders the elements for the color palette popover.
_renderHSVTrigger
()
protected
Renders trigger
for the HSVPalette
and appends it to the actions
container.
_renderNoColor
()
protected
Renders the no color node and appends it to the actions container.
_renderRecentColors
()
protected
Renders the recentColors
palette.
_setTrigger
-
value
Overwrites the default setter for trigger
in WidgetTrigger
class
which invokes A.one
, but we need to support multiple triggers.
Parameters:
-
value
Node | String
Returns:
_validateTrigger
-
value
Validates the value of the trigger
attribute.
Parameters:
-
value
Node | String
Returns:
The result of the validation
destructor
()
protected
Destructor lifecycle implementation for the ColorPickerBase
class.
initializer
()
protected
Construction logic executed during ColorPickerBase
instantiation.
Lifecycle.
reset
()
Resets the ColorPickerBase
to it's default state.
Properties
ATTRS
Object
static
Static property used to define the default attribute
configuration for the ColorPickerBase
.
CSS_PREFIX
String
static
Static property provides a string to identify the CSS prefix.
NAME
String
static
Static property provides a string to identify the class.