From df5f04e30f9f02b4f9fcbf8943d382600067fda0 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: Mon, 18 Jul 2022 13:36:43 +0300 Subject: [PATCH] Accessibility for TriStateCheckbox --- src/components/config/PrimeVue.d.ts | 7 ++ src/components/config/PrimeVue.js | 7 +- .../tristatecheckbox/TriStateCheckbox.vue | 69 ++++++++++++++----- .../tristatecheckbox/TriStateCheckboxDoc.vue | 42 +++++++++++ 4 files changed, 108 insertions(+), 17 deletions(-) diff --git a/src/components/config/PrimeVue.d.ts b/src/components/config/PrimeVue.d.ts index a74135db2..574ffe002 100644 --- a/src/components/config/PrimeVue.d.ts +++ b/src/components/config/PrimeVue.d.ts @@ -6,6 +6,12 @@ interface PrimeVueConfiguration { locale?: PrimeVueLocaleOptions; } +interface PrimeVueLocaleAriaOptions { + trueLabel?: string; + falseLabel?: string; + nullLabel?: string; +} + interface PrimeVueLocaleOptions { startsWith?: string; contains?: string; @@ -48,6 +54,7 @@ interface PrimeVueLocaleOptions { passwordPrompt?: string; emptyFilterMessage?: string; emptyMessage?: string; + aria?: PrimeVueLocaleAriaOptions; } export declare function usePrimeVue(): { config: PrimeVueConfiguration }; diff --git a/src/components/config/PrimeVue.js b/src/components/config/PrimeVue.js index d5f750a81..06b98e916 100644 --- a/src/components/config/PrimeVue.js +++ b/src/components/config/PrimeVue.js @@ -45,7 +45,12 @@ const defaultOptions = { strong: 'Strong', passwordPrompt: 'Enter a password', emptyFilterMessage: 'No results found', - emptyMessage: 'No available options' + emptyMessage: 'No available options', + aria: { + trueLabel: 'True', + falseLabel: 'False', + nullLabel: 'Not Selected' + } }, filterMatchModeOptions: { text: [ diff --git a/src/components/tristatecheckbox/TriStateCheckbox.vue b/src/components/tristatecheckbox/TriStateCheckbox.vue index df4b4d5cf..b9c4e4070 100755 --- a/src/components/tristatecheckbox/TriStateCheckbox.vue +++ b/src/components/tristatecheckbox/TriStateCheckbox.vue @@ -1,9 +1,11 @@