3.0 KiB
Property
Properties
idString Property id, eg.my-property-id.propertyString Related CSS property name, eg.text-align.labelString Label to use in UI, eg.Text Align.defaultString Defaul value of the property.
getId
Get property id.
Returns String
getType
Get the property type.
The type of the property is defined on property creation and based on its value the proper Property class is assigned.
The default type is base.
Returns String
getName
Get name (the CSS property name).
Returns String
getLabel
Get property label.
Parameters
-
optsObject Options (optional, default{})opts.localeBoolean Use the locale string from i18n module (optional, defaulttrue)
Returns String
getValue
Get property value.
Parameters
-
optsObject Options (optional, default{})opts.noDefaultBoolean Avoid returning the default value (optional, defaultfalse)
Returns String
hasValue
Check if the property has value.
Parameters
-
optsObject Options (optional, default{})opts.noParentBoolean Ignore the value if it comes from the parent target. (optional, defaultfalse)
Returns Boolean
getStyle
Get the CSS style object of the property.
Parameters
-
optsObject Options (optional, default{})opts.camelCaseBoolean? Return property name in camelCase.
Examples
// In case the property is `color` with a value of `red`.
console.log(property.getStyle());
// { color: 'red' };
Returns Object
getDefaultValue
Get the default value.
Returns string
upValue
Update the value. The change is also propagated to the selected targets (eg. CSS rule).
Parameters
clear
Clear the value. The change is also propagated to the selected targets (eg. the css property is cleared).