A.ColorPickerBase Class
A base class for ColorPickerBase.
Constructor
A.ColorPickerBase
-
config
Parameters:
-
configObjectObject 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:
-
itemsArray
Returns:
Index of the empty spot
_getDefaultAttributeValue
-
attributeName
Returns the default value of passed attribute.
Parameters:
-
attributeNameString
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:
-
eventEventFacade
_onColorPaletteSelectChange
-
event
Sets the newly selected color from color palette.
Parameters:
-
eventEventFacade
_onHSVPaletteOK
-
event
Selects the custom color from the HSVAPaletteModal.
Parameters:
-
eventEventFacade
_onHSVTriggerClick
()
protected
Opens HSVAPaletteModal.
_onNoColorClick
-
event
Removes color from the current trigger.
Parameters:
-
eventEventFacade
_onRecentColorClick
-
event
Sets the selected color from the recentColors palette.
Parameters:
-
eventEventFacade
_onRecentColorPaletteSelectChange
-
event
Sets the newly selected color from recentColors.
Parameters:
-
eventEventFacade
_onTriggerInteraction
-
event
Displays or hides the color picker after trigger interaction.
Parameters:
-
eventEventFacade
_onVisibleChange
-
event
Syncs clickoutside event and refocuses trigger on modal hide.
Parameters:
-
eventEventFacade
_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:
-
valueNode | String
Returns:
_validateTrigger
-
value
Validates the value of the trigger attribute.
Parameters:
-
valueNode | 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.