cpr.controls.UIControlStyler

UIControlStyler The style class of the control.

Index

Properties
Name Type Description
disposed Boolean Returns whether to remove style
name String Returns the style name.
transform CSSTransformContext Get the transform editing context.
Methods
Name Return Type Description
addClass Add a class.
addMediaClass Add a media class.
animateAndReverse UIControlStyler Starts the animation with the given intermediate state.
animateFrom UIControlStyler Starts animation from the given state to the current state.
animateTo UIControlStyler Starts the animation with the given end state.
bind IBindFactory Bind that css property.
bindClass IBindFactory Get the class binding factory.
css {[key:string]: String} Get all specified CSS properties in JSON format.
dispose Removes the objects contained in the style.
getBaseClassName #css-class Returns the default class name.
getBindContext BindContext Returns the bind context.
getBindInfo BindInfo Get binding information for a specific CSS property.
getCSS String Returns the value of the corresponding css property.
getClassBindInfo BindInfo Get the CSS class binding information for the styler.
getClasses #css-class[] Returns the class name of the control.
getMediaCSS String Sets the css property of the media.
getMediaClasses String[] Returns the class name of the corresponding media of the control.
hasClass Boolean Check class ownership.
mediaCss {[key:string]: String}
removeClass Delete the class.
removeMediaClass Removes the class name of the corresponding media.
removeMediaStyle Removes the corresponding property of the configured media style.
removeStyle Removes the corresponding property of the set style.
setClasses Set more than two classes.
setMediaClasses Set two or more classes in media.
unbind Unbind to that CSS property.
unbindClass Remove class binding.

Properties

disposed
type Boolean
readonly
Returns whether to remove style
name
type String
readonly
Returns the style name.
transform
type CSSTransformContext
readonly
Get the transform editing context.

Methods

addClass(className)
Add a class.
Parameters
name type description
className #css-class class name
addMediaClass(media, className)
Add a media class.
Parameters
name type description
media String media name.
className String class name.
animateAndReverse(state, duration, timingFunction)
Starts the animation with the given intermediate state. It is animated until it returns to its original state after entering the intermediate state.
Parameters
name type description
state {[key:string]: String} Intermediate CSS state. You can not change the style value of a layout element, such as its position or size.
durationoptional Number default0.3 The animation length, in seconds, before the intermediate state is reached.
timingFunctionoptional String defaultanimation.TimingFunction.EASE_IN_OUT Animation timing functions, available values ​​are declared in cpr.animation.TimingFunction.
return UIControlStyler
animateFrom(state, duration, timingFunction)
Starts animation from the given state to the current state.
Parameters
name type description
state {[key:string]: String} Start CSS state. You can not change the style value of a layout element, such as its position or size.
durationoptional Number default0.3 The animation length, in seconds.
timingFunctionoptional String defaultanimation.TimingFunction.EASE_IN_OUT Animation timing functions, available values ​​are declared in cpr.animation.TimingFunction.
return UIControlStyler
animateTo(state, duration, timingFunction)
Starts the animation with the given end state.
Parameters
name type description
state {[key:string]: String} Exit CSS state. You can not change the style value of a layout element, such as its position or size.
durationoptional Number default0.3 The animation length, in seconds.
timingFunctionoptional String defaultanimation.TimingFunction.EASE_IN_OUT Animation timing functions, available values ​​are declared in cpr.animation.TimingFunction.
return UIControlStyler
bind(property)
Bind that css property.
Parameters
name type description
property String The css attribute name to bind.
return IBindFactory
bindClass()
Get the class binding factory.
return IBindFactory
css()
Get all specified CSS properties in JSON format.
return {[key:string]: String}
css(key)
Get the attribute CSS property value.
Parameters
name type description
key String property name to get value
return String
css(key, value)
Specifies the value of a specific CSS property.
Parameters
name type description
key String CSS property name to assign value to
value String The value to specify.
css(json)
Specify multiple CSS properties at once.
Parameters
name type description
json {[key:string]: String} A JSON object with keys and values ​​to specify.
dispose()
Removes the objects contained in the style.
getBaseClassName()
Returns the default class name.
return #css-class Default class name
getBindContext()
Returns the bind context.
return BindContext bind context
getBindInfo(property)
Get binding information for a specific CSS property.
Parameters
name type description
property String Style attribute name from which to get binding information.
return BindInfo Binding information object.
getCSS(key, defaultValue)
Returns the value of the corresponding css property.
If no value is returned, it returns to the specified default value.
Parameters
name type description
key String css property name
defaultValue String The default value for the property.
return String
getClassBindInfo()
Get the CSS class binding information for the styler.
return BindInfo Class binding information object.
getClasses()
Returns the class name of the control.
return #css-class[] class name.
getMediaCSS(media, key, defaultValue)
Sets the css property of the media.
Parameters
name type description
media String media name.
key String property name.
defaultValue String The default value for the property.
return String
getMediaClasses(media)
Returns the class name of the corresponding media of the control.
Parameters
name type description
media String media name.
return String[]
hasClass(className)
Check class ownership.
Parameters
name type description
className #css-class Class to check.
return Boolean
mediaCss(media)
Parameters
name type description
media String
return {[key:string]: String}
mediaCss(media, property)
Parameters
name type description
media String
property String
return String
mediaCss(media, property, value)
Parameters
name type description
media String
property String
value String
mediaCss(media, set)
Parameters
name type description
media String
set {[key:string]: String}
removeClass(className)
Delete the class.
Parameters
name type description
className #css-class class name
removeMediaClass(media, className)
Removes the class name of the corresponding media.
Parameters
name type description
media String media name.
classNameoptional String class name.
removeMediaStyle(media, property)
Removes the corresponding property of the configured media style.
Parameters
name type description
media String media name.
property String property name.
removeStyle(propertyName)
Removes the corresponding property of the set style.
Parameters
name type description
propertyName String property name
setClasses(classNames)
Set more than two classes.
example:
control.style.setClasses("buttonStyle", "imageStyle");
Parameters
name type description
classNames #css-class[] The class names to add.
setMediaClasses(media, classNames)
Set two or more classes in media.
Parameters
name type description
media String media name.
classNames String[] class name
unbind(property)
Unbind to that CSS property.
Parameters
name type description
property String CSS property name to unbind.
unbindClass()
Remove class binding.