FlexberryColorpickerComponent Class
Flexberry colorpicker component based on jquery-minicolors plugin (see http://labs.abeautifulsite.net/jquery-minicolors).
Usage: templates/my-form.hbs
{{flexberry-colorpicker
value=model.color
change=(action "onModelColorChange")
}}
controllers/my-form.js
actions: {
onModelColorChange(e) {
// Set new value to model's 'color' property.
this.set('model.color', e.newValue);
// Log original jQuery 'change' event object.
console.log(e.originalEvent);
}
}
Usage with {{#crossLink "FlexberryDdauCheckboxActionsHandlerMixin"}}flexberry-ddau-checkbox-actions-handler mixin{{/crossLink}}:
{{flexberry-colorpicker
value=model.color
change=(action "onColorpickerChange" "model.color")
}}
controllers/my-form.js
import Controller from '@ember/controller';
import FlexberryColorpickerActionsHandlerMixin from 'ember-flexberry/mixins/flexberry-colorpicker-actions-handler';
export default Controller.extend(FlexberryColorpickerActionsHandlerMixin, {
});
Item Index
Methods
Methods
_actionHandlerIsDefined
-
options
Parameters:
Returns:
_addDynamicProperty
-
propertyName
Parameters:
-
propertyName
StringName of dynamic property that must be added.
_dynamicPropertiesDidChange
()
private
_removeDynamicProperties
()
private
_removeDynamicProperty
-
propertyName
Parameters:
-
propertyName
StringName of dynamic property that must be removed.
actions.change
-
e
Handles inner input's bubbled 'change' action. Invokes component's FlexberryColorpicker/sendingActions.change:method action.
Parameters:
-
e
ObjectjQuery event object which describes inner input's 'change' event.
attachEventHandler
-
options
Parameters:
-
options
ObjectMethod options.-
eventTarget
ObjectDOM-element (jQuery-object) for which event-handler must be attached.
-
eventName
StringEvent name.
-
eventHandler
FunctionEvent handler.
-
closeModalDialog
()
createdModalDialog
-
modalDialog
Parameters:
-
modalDialog
JQueryCreated modal window.
detachAllEventHandlers
()
detachEventHandler
-
options
Parameters:
-
options
ObjectMethod options.-
eventTarget
ObjectDOM-element (jQuery-object) from which event-handler must be detached.
-
eventName
StringEvent name.
-
eventHandler
FunctionEvent handler.
-
send
-
actionName
-
args
`
Parameters:
-
actionName
StringName of the action that must be triggered. -
args
Arguments that must be passed to action.
Returns:
sendingActions.change
-
e
Component's action invoking when color changed.
Parameters:
-
e
ObjectAction's event object.
-
newValue
BooleanComponent's new value.
-
originalEvent
ObjectjQuery event object which describes inner input's 'change' event.
-
Properties
_availableDomEvents
Object
private
_componentWrapperIsAvailable
Boolean
private
_dynamicActions
Object
private
_dynamicPropertiesMetadata
Object[]
private
Default: null
_eventsMetadata
Object[]
private
Default: null
_openedModalDialog
JQuery
Default: undefined
_requiredActions
String[]
Component's required actions names. For actions enumerated in this array an assertion exceptions will be thrown, if actions handlers are not defined for them.
Default: ['change']
classNames
String[]
Component's wrapping
Any other CSS-classes can be added through component's 'class' property.
Default: ['flexberry-colorpicker']
dynamicActions
DynamicActionObject[]
Default: null
dynamicProperties
Object
Default: null
flexberryClassNames
Object
static
Component's CSS-classes names. JSON-object containing string constants with CSS-classes names related to component's .hbs markup elements.
Sub-properties:
-
prefix
StringComponent's CSS-class names prefix ('flexberry-colorpicker').
-
wrapper
StringComponent's wrapping
CSS-class name ('flexberry-colorpicker').
BooleanisTagless
Flag: indicates whether component is tagless or not (has empty [tagName](https://emberjs.com/api/ember/release/classes/Component#property_tagName) or not).