/**
* The Color Picker Component
*
* @module aui-color-picker
* @submodule aui-color-picker-popover
*/
var Lang = A.Lang;
/**
* A base class for `ColorPickerPopover`.
*
* @class A.ColorPickerPopover
* @extends A.Popover
* @uses A.ColorPickerBase, A.WidgetAutohide, A.WidgetCssClass, A.WidgetToggle
* @param {Object} config Object literal specifying widget configuration
* properties.
* @constructor
* @example
```
<input id="myColorPickerPopover" class="form-control" type="text" value="Click to select a color">
```
* @example
```
YUI().use(
'aui-color-picker-popover',
function(Y) {
var colorPicker = new Y.ColorPickerPopover(
{
trigger: '#myColorPickerPopover',
zIndex: 2
}
).render();
colorPicker.on('select',
function(event) {
event.trigger.setStyle('backgroundColor', event.color);
}
);
}
);
```
*/
var ColorPickerPopover = A.Base.create('color-picker-popover', A.Popover, [
A.ColorPickerBase,
A.WidgetAutohide,
A.WidgetCssClass,
A.WidgetToggle
], {}, {
/**
* Static property used to define the default attribute
* configuration for the `ColorPickerPopover`.
*
* @property ATTRS
* @type {Object}
* @static
*/
ATTRS: {
/**
* The alignment configuration for `ColorPickerPopover`.
*
* @attribute align
* @type {Object}
*/
align: {
validator: Lang.isObject,
value: {
points: [A.WidgetPositionAlign.TC, A.WidgetPositionAlign.BC]
}
},
/**
* Determines if `ColorPickerPopover` is visible or not.
*
* @attribute visible
* @default false
* @type {Boolean}
*/
visible: {
validator: Lang.isBoolean,
value: false
}
},
/**
* Static property provides a string to identify the class.
*
* @property NAME
* @type {String}
* @static
*/
NAME: 'color-picker-popover',
/**
* Static property provides a string to identify the namespace.
*
* @property NS
* @type {String}
* @static
*/
NS: 'color-picker-popover'
});
A.ColorPickerPopover = ColorPickerPopover;