From c68535196cfec92c296b830b0fed6c8a200b263a 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, 29 Jul 2022 14:47:57 +0300 Subject: [PATCH] Accessibility: ToggleButton with hidden checkbox --- api-generator/components/togglebutton.js | 30 ++++ src/components/togglebutton/ToggleButton.d.ts | 32 ++++ src/components/togglebutton/ToggleButton.vue | 145 ++++++++++++++++-- src/views/togglebutton/ToggleButtonDemo.vue | 2 +- src/views/togglebutton/ToggleButtonDoc.vue | 37 ++++- 5 files changed, 232 insertions(+), 14 deletions(-) diff --git a/api-generator/components/togglebutton.js b/api-generator/components/togglebutton.js index 7ea83c3d8..a4e4c44e3 100644 --- a/api-generator/components/togglebutton.js +++ b/api-generator/components/togglebutton.js @@ -34,6 +34,36 @@ const ToggleButtonProps = [ type: "string", default: "left", description: 'Position of the icon, valid values are "left" and "right".' + }, + { + name: "tabindex", + type: "number", + default: "null", + description: "Index of the element in tabbing order." + }, + { + name: "disabled", + type: "boolean", + default: "false", + description: "When present, it specifies that the element should be disabled." + }, + { + name: "inputId", + type: "string", + default: "null", + description: "Identifier of the focus input to match a label defined for the chips." + }, + { + name: "inputClass", + type: "string", + default: "null", + description: "Style class of the input field." + }, + { + name: "inputStyle", + type: "any", + default: "null", + description: "Inline style of the input field." } ]; diff --git a/src/components/togglebutton/ToggleButton.d.ts b/src/components/togglebutton/ToggleButton.d.ts index f158ee944..4f58aa371 100755 --- a/src/components/togglebutton/ToggleButton.d.ts +++ b/src/components/togglebutton/ToggleButton.d.ts @@ -31,6 +31,38 @@ export interface ToggleButtonProps { * Default value is 'left'. */ iconPos?: ToggleButtonType; + /** + * When present, it specifies that the element should be disabled. + */ + disabled?: boolean | undefined; + /** + * Index of the element in tabbing order. + */ + tabindex?: string | undefined; + /** + * Identifier of the focus input to match a label defined for the chips. + */ + inputId?: string | undefined; + /** + * Style class of the input field. + */ + inputClass?: any | undefined; + /** + * Inline style of the input field. + */ + inputStyle?: any | undefined; + /** + * + */ + inputProps?: object | undefined; + /** + * Establishes relationships between the component and label(s) where its value should be one or more element IDs. + */ + 'aria-labelledby'?: string | undefined; + /** + * Establishes a string value that labels the component. + */ + 'aria-label'?: string | undefined; } export interface ToggleButtonSlots { diff --git a/src/components/togglebutton/ToggleButton.vue b/src/components/togglebutton/ToggleButton.vue index 609451773..51c2c1dc8 100755 --- a/src/components/togglebutton/ToggleButton.vue +++ b/src/components/togglebutton/ToggleButton.vue @@ -1,6 +1,9 @@ @@ -230,7 +261,7 @@ export default {
Customized
- + @@ -256,7 +287,7 @@ export default {
Customized
- +