From 91215ed0e3652ec195e9af8d891e0cd8d1cd4364 Mon Sep 17 00:00:00 2001 From: Bernardo Cardoso Date: Wed, 30 Aug 2023 13:47:12 +0100 Subject: [PATCH] build the code --- dist/OutSystemsUI.d.ts | 2 ++ dist/OutSystemsUI.js | 7 ++++++- src/scripts/OSFramework/OSUI/Constants.ts | 1 + .../OSFramework/OSUI/Helper/ManageAccessibility.ts | 11 +++++++++++ .../OSUI/Pattern/TabsHeaderItem/TabsHeaderItem.ts | 3 ++- 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/dist/OutSystemsUI.d.ts b/dist/OutSystemsUI.d.ts index 64c30548c9..e4a5e98416 100644 --- a/dist/OutSystemsUI.d.ts +++ b/dist/OutSystemsUI.d.ts @@ -37,6 +37,7 @@ declare namespace OSFramework.OSUI.Constants { Listbox: string; MenuItem: string; Option: string; + Presentation: string; Progressbar: string; Region: string; Search: string; @@ -1083,6 +1084,7 @@ declare namespace OSFramework.OSUI.Helper { static RoleListbox(element: HTMLElement): void; static RoleMenuItem(element: HTMLElement): void; static RoleOption(element: HTMLElement): void; + static RolePresentation(element: HTMLElement): void; static RoleProgressBar(element: HTMLElement): void; static RoleRegion(element: HTMLElement): void; static RoleSearch(element: HTMLElement): void; diff --git a/dist/OutSystemsUI.js b/dist/OutSystemsUI.js index 1f41244b11..a009163dd4 100644 --- a/dist/OutSystemsUI.js +++ b/dist/OutSystemsUI.js @@ -79,6 +79,7 @@ var OSFramework; Listbox: 'listbox', MenuItem: 'menuitem', Option: 'option', + Presentation: 'presentation', Progressbar: 'progressbar', Region: 'region', Search: 'search', @@ -2987,6 +2988,9 @@ var OSFramework; static RoleOption(element) { Helper.Dom.Attribute.Set(element, OSUI.Constants.A11YAttributes.Role.AttrName, OSUI.Constants.A11YAttributes.Role.Option); } + static RolePresentation(element) { + Helper.Dom.Attribute.Set(element, OSUI.Constants.A11YAttributes.Role.AttrName, OSUI.Constants.A11YAttributes.Role.Presentation); + } static RoleProgressBar(element) { Helper.Dom.Attribute.Set(element, OSUI.Constants.A11YAttributes.Role.AttrName, OSUI.Constants.A11YAttributes.Role.Progressbar); } @@ -10632,7 +10636,8 @@ var OSFramework; } setA11YProperties(isUpdate = true) { if (isUpdate === false) { - OSUI.Helper.A11Y.RoleTab(this.selfElement.parentElement); + OSUI.Helper.A11Y.RoleTab(this.selfElement); + OSUI.Helper.A11Y.RolePresentation(this.selfElement.parentElement); } if (this._isActive) { OSUI.Helper.A11Y.TabIndexTrue(this.selfElement); diff --git a/src/scripts/OSFramework/OSUI/Constants.ts b/src/scripts/OSFramework/OSUI/Constants.ts index 98801cd67a..19ebf7b094 100644 --- a/src/scripts/OSFramework/OSUI/Constants.ts +++ b/src/scripts/OSFramework/OSUI/Constants.ts @@ -33,6 +33,7 @@ namespace OSFramework.OSUI.Constants { Listbox: 'listbox', MenuItem: 'menuitem', Option: 'option', + Presentation: 'presentation', Progressbar: 'progressbar', Region: 'region', Search: 'search', diff --git a/src/scripts/OSFramework/OSUI/Helper/ManageAccessibility.ts b/src/scripts/OSFramework/OSUI/Helper/ManageAccessibility.ts index e5ef729e43..cb04243796 100644 --- a/src/scripts/OSFramework/OSUI/Helper/ManageAccessibility.ts +++ b/src/scripts/OSFramework/OSUI/Helper/ManageAccessibility.ts @@ -395,6 +395,17 @@ namespace OSFramework.OSUI.Helper { Dom.Attribute.Set(element, Constants.A11YAttributes.Role.AttrName, Constants.A11YAttributes.Role.Option); } + /** + * Method that will set the presentation role + * + * @static + * @param {HTMLElement} element + * @memberof A11Y + */ + public static RolePresentation(element: HTMLElement): void { + Dom.Attribute.Set(element, Constants.A11YAttributes.Role.AttrName, Constants.A11YAttributes.Role.Presentation); + } + /** * Method that will set the progressbar role * diff --git a/src/scripts/OSFramework/OSUI/Pattern/TabsHeaderItem/TabsHeaderItem.ts b/src/scripts/OSFramework/OSUI/Pattern/TabsHeaderItem/TabsHeaderItem.ts index 47df58e90f..17f1af5303 100644 --- a/src/scripts/OSFramework/OSUI/Pattern/TabsHeaderItem/TabsHeaderItem.ts +++ b/src/scripts/OSFramework/OSUI/Pattern/TabsHeaderItem/TabsHeaderItem.ts @@ -61,7 +61,8 @@ namespace OSFramework.OSUI.Patterns.TabsHeaderItem { protected setA11YProperties(isUpdate = true): void { // Static attribute to be added when the item is created if (isUpdate === false) { - Helper.A11Y.RoleTab(this.selfElement.parentElement); + Helper.A11Y.RoleTab(this.selfElement); + Helper.A11Y.RolePresentation(this.selfElement.parentElement); } // Dynamic values that need to be changed when toggling the active state