ViewElementAttributeValue
Common interface for a ViewTokenList and StylesMap.
Properties
Methods
_canMergeFrom( other ) → booleanmodule:engine/view/element~ViewElementAttributeValue#_canMergeFromUsed by
_canMergeAttributesFromto verify if the given attribute can be merged without conflicts into the attribute.This method is indirectly used by the
ViewDowncastWriterwhile down-casting anViewAttributeElementto merge it with other ViewAttributeElement.Parameters
other : this
Returns
boolean
_clone() → thismodule:engine/view/element~ViewElementAttributeValue#_clone_getConsumables( [ name ] ) → Array<string>module:engine/view/element~ViewElementAttributeValue#_getConsumablesReturns a list of consumables for the attribute. This includes related tokens (for example other forms of notation of the same style property).
Could be filtered by the given token name (class name, style property, etc.).
Parameters
[ name ] : string
Returns
Array<string>
_getTokensMatch( tokenPattern, [ valuePattern ] ) → undefined | Array<string>module:engine/view/element~ViewElementAttributeValue#_getTokensMatchUsed by the Matcher to collect matching attribute tokens.
Parameters
tokenPattern : string | true | RegExpThe matched token name pattern.
[ valuePattern ] : string | true | RegExpThe matched token value pattern.
Returns
undefined | Array<string>An array of matching tokens.
_isMatching( other ) → booleanmodule:engine/view/element~ViewElementAttributeValue#_isMatchingUsed by
_canSubtractAttributesOfto verify if the given attribute can be fully subtracted from the attribute.This method is indirectly used by the
ViewDowncastWriterwhile down-casting anViewAttributeElementto unwrap the ViewAttributeElement.Parameters
other : this
Returns
boolean
_mergeFrom( other ) → voidmodule:engine/view/element~ViewElementAttributeValue#_mergeFromUsed by
_mergeAttributesFromto merge a given attribute into the attribute.This method is indirectly used by the
ViewDowncastWriterwhile down-casting anViewAttributeElementto merge it with other ViewAttributeElement.Parameters
other : this
Returns
void
clear() → voidmodule:engine/view/element~ViewElementAttributeValue#clearhas( name ) → booleanmodule:engine/view/element~ViewElementAttributeValue#hasChecks if a given token (style, class, token) is set.
Parameters
name : string
Returns
boolean
isSimilar( other ) → booleanmodule:engine/view/element~ViewElementAttributeValue#isSimilarReturns
trueif both attributes have the same content.Parameters
other : this
Returns
boolean
keys() → Array<string>module:engine/view/element~ViewElementAttributeValue#keysReturns all tokens (styles, classes, other tokens).
Returns
Array<string>
remove( tokens ) → voidmodule:engine/view/element~ViewElementAttributeValue#removeset( stylesOrTokens ) → voidmodule:engine/view/element~ViewElementAttributeValue#setSets a given token (for style also a record of properties).
Parameters
stylesOrTokens : Styles | ArrayOrItem<string>
Returns
void
set( name, value ) → voidmodule:engine/view/element~ViewElementAttributeValue#setsetTo( value ) → thismodule:engine/view/element~ViewElementAttributeValue#setTotoString() → stringmodule:engine/view/element~ViewElementAttributeValue#toStringReturns a normalized tokens string (styles, classes, etc.).
Returns
string