type aria sort

This commit is contained in:
Sara Vieira 2022-12-22 17:38:57 +00:00
parent 19af976dcb
commit 85481c23c1
2 changed files with 13 additions and 1 deletions

View File

@ -53,7 +53,7 @@ pub fn global_attrs(span: Span) -> StringyMap<Ident, TokenStream> {
insert("aria_required", "crate::types::Bool");
insert("aria_selected", "crate::types::Bool");
insert("aria_placeholder", "String");
insert("aria_sort", "String"); // TODO only supports some values
insert("aria_sort", "crate::types::AriaSort"); // TODO only supports some values
insert("aria_valuemax", "isize");
insert("aria_valuemin", "isize");
insert("aria_valuenow", "isize");

View File

@ -537,3 +537,15 @@ pub enum Wrap {
#[strum(to_string = "off")]
Off,
}
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum AriaSort {
#[strum(to_string = "ascending")]
Ascending,
#[strum(to_string = "descending")]
Descending,
#[strum(to_string = "none")]
None,
#[strum(to_string = "other")]
Other,
}