From d8ec9abd14e692d22e2ec5c09ef4d2fc1e9fca82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Fri, 22 Jul 2022 16:30:42 +0300 Subject: [PATCH] Accessibility for Rating --- src/components/config/PrimeVue.js | 5 +- src/components/rating/Rating.d.ts | 4 ++ src/components/rating/Rating.vue | 73 ++++++++++++++++++++++++++--- src/views/rating/RatingDemo.vue | 8 ++-- src/views/rating/RatingDoc.vue | 77 ++++++++++++++++++++++++++----- 5 files changed, 143 insertions(+), 24 deletions(-) diff --git a/src/components/config/PrimeVue.js b/src/components/config/PrimeVue.js index d4b131923..3929b38fc 100644 --- a/src/components/config/PrimeVue.js +++ b/src/components/config/PrimeVue.js @@ -66,7 +66,10 @@ const defaultOptions = { aria: { trueLabel: 'True', falseLabel: 'False', - nullLabel: 'Not Selected' + nullLabel: 'Not Selected', + star: 'star', + stars: 'stars', + noneStars: 'No Rating' } }, filterMatchModeOptions: { diff --git a/src/components/rating/Rating.d.ts b/src/components/rating/Rating.d.ts index 0e494844f..46fccd4eb 100755 --- a/src/components/rating/Rating.d.ts +++ b/src/components/rating/Rating.d.ts @@ -16,6 +16,10 @@ export interface RatingProps { * Value of the rating. */ modelValue?: number | undefined; + /** + * Name of the element. + */ + name?: string | undefined; /** * When present, it specifies that the element should be disabled. */ diff --git a/src/components/rating/Rating.vue b/src/components/rating/Rating.vue index 37c754164..a97263bcb 100755 --- a/src/components/rating/Rating.vue +++ b/src/components/rating/Rating.vue @@ -1,19 +1,33 @@