Show:

A base class for ColorPickerBase.

Constructor

A.ColorPickerBase

(
  • config
)

Parameters:

  • config Object

    Object literal specifying widget configuration properties.

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:

Object:

_findRecentColorEmptySpot

(
  • items
)
Number protected

Returns an empty spot from the recentColors palette.

Parameters:

  • items Array

Returns:

Number:

Index of the empty spot

_getCurrentTrigger

() Node protected

Returns the current trigger.

Returns:

Node:

_getDefaultAttributeValue

(
  • attributeName
)
protected

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:

Object:

HSV palette modal

_onColorChange

(
  • event
)
protected

Fires the select event and hides popover.

Parameters:

_onColorPaletteSelectChange

(
  • event
)
protected

Sets the newly selected color from color palette.

Parameters:

_onHSVPaletteOK

(
  • event
)
protected

Selects the custom color from the HSVAPaletteModal.

Parameters:

_onHSVTriggerClick

() protected

Opens HSVAPaletteModal.

_onNoColorClick

(
  • event
)
protected

Removes color from the current trigger.

Parameters:

_onRecentColorClick

(
  • event
)
protected

Sets the selected color from the recentColors palette.

Parameters:

_onRecentColorPaletteSelectChange

(
  • event
)
protected

Sets the newly selected color from recentColors.

Parameters:

_onTriggerInteraction

(
  • event
)
protected

Displays or hides the color picker after trigger interaction.

Parameters:

_onVisibleChange

(
  • event
)
protected

Syncs clickoutside event and refocuses trigger on modal hide.

Parameters:

_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
)
Node | String protected

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:

Node | String:

_uiSetTrigger

(
  • value
)
protected

Set the trigger UI.

Parameters:

  • value Node | String

_validateTrigger

(
  • value
)
Boolean protected

Validates the value of the trigger attribute.

Parameters:

  • value Node | String

Returns:

Boolean:

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.

Attributes

bodyContent

String

The content of body.

Default: ''

color

String

Currently selected color.

colorPalette

Object

Default colors available to the color palette.

currentTrigger

Node readonly

Current trigger node.

defaultColor

String

Provides the default color used for the recentColors palette.

Default: '#FFF'

hsvPalette

Object

HSVPalette used for selecting custom colors not present in defualtColors.

recentColors

Object

Colors that have been selected recently from the HSVPalette.

renderColorPalette

Boolean

Determines if the color palette is rendered on load.

Default: true

renderHSVPalette

Boolean

Determines if the HSVPalette is rendered on load.

Default: true

strings

Object

Collection of strings used to label elements of the UI.

trigger

Node | String

Trigger node that opens the color palette.

triggerEvent

String

Trigger event that fires on trigger click.

Default: 'click'