AriaValueAttribute<T extends AriaAttributeType> class
ARIA specific type attribute.
class AriaValueAttribute<T extends AriaAttributeType> extends Attribute<T> { AriaValueAttribute(String name, [String defaultValue = null]) : super(name, defaultValue); String getSingleValue(T value) { return value.getAriaValue(); } }
Extends
Attribute<T> > AriaValueAttribute<T>
Constructors
new AriaValueAttribute(String name, [String defaultValue = null]) #
Properties
Methods
String get(Element element) #
Gets the HTML attribute value for the attribute with name {@code name} for element {@code element}
@param element HTM element @return The attribute value for {@code element}
String get(dart_html.Element element) { assert (element != null); // : "Element cannot be null."; return element.attributes["name"]; }
String getName() #
Gets the property/state name
@return The attribute name
String getName() { return name; }
void remove(Element element) #
Removes the state/property attribute for element {@code element}.
@param element HTM element
void remove(dart_html.Element element) { assert (element != null); // : "Element cannot be null."; element.attributes.remove(name); }
void set(Element element, T values) #
Sets the state/property {@code value} for the HTML element {@code element}.
@param element HTML element @param values Attribute value
void set(dart_html.Element element, T values) { assert (element != null); // : "Element cannot be null."; //assert (values.length > 0); element.attributes[name] = _getAriaValue(values); }
void setDefault(Element element) #
Sets the state/property value to the defaultValue if not null. If a list of default values is set, every default value is converted to string and the string values are concatenated in a string token list. There is an assertion checking whether the default is null. Note that the asserts are enabled during development and testing but they will be stripped in production mode.
@param element HTML element
void setDefault(dart_html.Element element) { assert (element != null); // : "Element cannot be null."; assert (defaultValue != null && !defaultValue.isEmpty); // : "Default value cannot be null."; element.attributes[name] = defaultValue; }