Merge pull request #12 from axodotdev/aria-sort

This commit is contained in:
Sara Vieira 2022-12-23 16:05:15 +00:00 committed by GitHub
commit 12c89a4fc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

@ -538,6 +538,18 @@ pub enum Wrap {
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,
}
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum AriaOrientation {
#[strum(to_string = "horizontal")]