@@ -70,9 +70,11 @@
pButton
(click)="setSelectedItem(item); updateGridMenuItems(true); menu.toggle($event)"
icon="pi pi-ellipsis-v"
- [attr.ariaLabel]="'OCX_DATA_LIST_GRID.MORE_ACTIONS' | translate"
+ [attr.aria-label]="'OCX_DATA_LIST_GRID.MORE_ACTIONS_ARIA_LABEL' | translate"
class="more-actions-menu-button menu-btn"
[attr.name]="'data-grid-item-menu-button'"
+ [pTooltip]="'OCX_DATA_LIST_GRID.MORE_ACTIONS_TOOLTIP' | translate"
+ tooltipPosition="top"
>
@@ -102,7 +104,8 @@
icon="pi pi-eye"
pButton
class="p-button-rounded p-button-text mb-1 mr-2 viewListItemButton"
- title="{{ (viewMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.VIEW') | translate }}"
+ [pTooltip]="(viewMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.VIEW') | translate"
+ tooltipPosition="top"
[attr.aria-label]="(viewMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.VIEW') | translate"
(click)="onViewRow(item)"
*ocxIfPermission="viewPermission"
@@ -118,7 +121,8 @@
class="p-button-rounded p-button-text mb-1 mr-2 editListItemButton"
icon="pi pi-pencil"
pButton
- title="{{ (editMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.EDIT') | translate }}"
+ [pTooltip]="(editMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.EDIT') | translate"
+ tooltipPosition="top"
[attr.aria-label]="(editMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.EDIT') | translate"
(click)="onEditRow(item)"
*ocxIfPermission="editPermission"
@@ -134,7 +138,8 @@
icon="pi pi-trash"
class="p-button-rounded p-button-text p-button-danger mb-1 mr-2 deleteListItemButton"
pButton
- title="{{ (deleteMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.DELETE') | translate }}"
+ [pTooltip]="(deleteMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.DELETE') | translate"
+ tooltipPosition="top"
[attr.aria-label]="(deleteMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.DELETE') | translate"
(click)="onDeleteRow(item)"
*ocxIfPermission="deletePermission"
@@ -151,7 +156,8 @@
[ngClass]="action.classes"
[icon]="action.icon || ''"
(click)="action.callback(item)"
- [title]="action.labelKey ? (action.labelKey | translate) : ''"
+ [pTooltip]="action.labelKey ? (action.labelKey | translate) : ''"
+ tooltipPosition="top"
[attr.aria-label]="action.labelKey ? (action.labelKey | translate) : ''"
[disabled]="action.disabled || (!!action.actionEnabledField && !fieldIsTruthy(item, action.actionEnabledField))"
>
@@ -164,8 +170,9 @@
class="p-button-rounded p-button-text"
[icon]="'pi pi-ellipsis-v'"
(click)="toggleOverflowMenu($event, menu, item)"
- [ariaLabel]="'OCX_DATA_TABLE.MORE_ACTIONS' | translate"
- [title]="'OCX_DATA_TABLE.MORE_ACTIONS' | translate"
+ [attr.aria-label]="'OCX_DATA_LIST_GRID.MORE_ACTIONS_ARIA_LABEL' | translate"
+ [pTooltip]="'OCX_DATA_LIST_GRID.MORE_ACTIONS_TOOLTIP' | translate"
+ tooltipPosition="top"
>
diff --git a/libs/portal-integration-angular/assets/i18n/de.json b/libs/portal-integration-angular/assets/i18n/de.json
index 7d5ce992..537d9a44 100644
--- a/libs/portal-integration-angular/assets/i18n/de.json
+++ b/libs/portal-integration-angular/assets/i18n/de.json
@@ -99,7 +99,8 @@
"EDIT": "Bearbeiten",
"DELETE": "Löschen"
},
- "MORE_ACTIONS": "Weitere Aktionen"
+ "MORE_ACTIONS_ARIA_LABEL": "Weitere Aktionen",
+ "MORE_ACTIONS_TOOLTIP": "Weitere Aktionen anzeigen"
},
"OCX_DATA_LAYOUT_SELECTION": {
"LAYOUT": {
diff --git a/libs/portal-integration-angular/assets/i18n/en.json b/libs/portal-integration-angular/assets/i18n/en.json
index 2f4c8cce..c81c3a00 100644
--- a/libs/portal-integration-angular/assets/i18n/en.json
+++ b/libs/portal-integration-angular/assets/i18n/en.json
@@ -99,7 +99,8 @@
"EDIT": "Edit",
"DELETE": "Delete"
},
- "MORE_ACTIONS": "More actions"
+ "MORE_ACTIONS_ARIA_LABEL": "More actions",
+ "MORE_ACTIONS_TOOLTIP": "Display more actions"
},
"OCX_DATA_LAYOUT_SELECTION": {
"LAYOUT": {
From f54c93f8c81401981e857348360e0e6a360d3a73 Mon Sep 17 00:00:00 2001
From: markuczy <129275100+markuczy@users.noreply.github.com>
Date: Fri, 27 Sep 2024 15:57:02 +0200
Subject: [PATCH 2/2] feat: interactive data view and its children
accessibility (#502)
* feat: data-layout accessibility improvements
* feat: interactive data component and children accessibility improvements
* feat: support translation keys in custom group column selector
* fix: tests
* fix: lint
* feat: removed tooltip hover
---
libs/angular-accelerator/assets/i18n/de.json | 14 ++++---
libs/angular-accelerator/assets/i18n/en.json | 14 ++++---
.../lib/angular-accelerator-primeng.module.ts | 3 ++
.../column-group-selection.component.html | 7 ++--
...ustom-group-column-selector.component.html | 39 +++++++++++++------
.../custom-group-column-selector.component.ts | 14 ++++++-
.../data-layout-selection.component.html | 5 ++-
.../data-layout-selection.component.ts | 35 +++++++++++++----
.../data-list-grid-sorting.component.html | 8 ++--
.../data-list-grid-sorting.component.ts | 10 ++---
.../interactive-data-view.component.spec.ts | 16 ++++----
...interactive-data-view.component.stories.ts | 8 ++--
.../custom-group-column-selector.harness.ts | 2 +-
.../testing/data-layout-selection.harness.ts | 13 +++----
.../harnesses/primeng/p-dropdown.harness.ts | 13 +++++--
.../assets/i18n/de.json | 14 ++++---
.../assets/i18n/en.json | 14 ++++---
17 files changed, 155 insertions(+), 74 deletions(-)
diff --git a/libs/angular-accelerator/assets/i18n/de.json b/libs/angular-accelerator/assets/i18n/de.json
index ac98c363..0b43e64f 100644
--- a/libs/angular-accelerator/assets/i18n/de.json
+++ b/libs/angular-accelerator/assets/i18n/de.json
@@ -1,11 +1,15 @@
{
"OCX_CUSTOM_GROUP_COLUMN_SELECTOR": {
- "DROPDOWN_LABEL": "Spalten",
+ "ARIA_LABEL": "Spaltengruppe-Selektor",
+ "DROPDOWN_LABEL": "Spaltengruppe",
"OPEN_BUTTON_DETAIL": "Dialog zur Auswahl einer benutzerdefinierten Gruppe öffnen",
+ "OPEN_BUTTON_ARIA_LABEL": "Dialog zur Auswahl einer benutzerdefinierten Gruppe öffnen",
"ACTIVE_COLUMNS_LABEL": "Aktive Spalten",
"INACTIVE_COLUMNS_LABEL": "Inaktive Spalten",
"SAVE_BUTTON_LABEL": "Speichern",
+ "SAVE_BUTTON_ARIA_LABEL": "Speichern",
"CANCEL_BUTTON_LABEL": "Abbrechen",
+ "CANCEL_BUTTON_ARIA_LABEL": "Abbrechen",
"DIALOG_TITLE": "Spalten für benutzerdefinierte Gruppe auswählen",
"CONFIGURE_ACTION_COLUMN": {
"TITLE": "Aktionsspalte konfigurieren",
@@ -36,12 +40,12 @@
"OCX_LIST_GRID_SORT": {
"DROPDOWN": {
"PLACEHOLDER": "Sortierung auswählen",
- "TITLE": "Sortieren nach"
+ "ARIA_LABEL": "Sortieren nach"
},
"TOGGLE_BUTTON": {
- "ASCENDING_TITLE": "Aufsteigend",
- "DESCENDING_TITLE": "Absteigend",
- "DEFAULT_TITLE": "Standard"
+ "ASCENDING_TOOLTIP": "Aufsteigend",
+ "DESCENDING_TOOLTIP": "Absteigend",
+ "DEFAULT_TOOLTIP": "Standard"
},
"SORTING_BUTTON_ARIA_LABEL": "{{direction}} sortieren"
},
diff --git a/libs/angular-accelerator/assets/i18n/en.json b/libs/angular-accelerator/assets/i18n/en.json
index edb81a0d..a0b5c98c 100644
--- a/libs/angular-accelerator/assets/i18n/en.json
+++ b/libs/angular-accelerator/assets/i18n/en.json
@@ -1,11 +1,15 @@
{
"OCX_CUSTOM_GROUP_COLUMN_SELECTOR": {
- "DROPDOWN_LABEL": "Columns",
+ "ARIA_LABEL": "Column group selector",
+ "DROPDOWN_LABEL": "Column group",
"OPEN_BUTTON_DETAIL": "Open custom group selection dialog",
+ "OPEN_BUTTON_ARIA_LABEL": "Open custom group selection dialog",
"ACTIVE_COLUMNS_LABEL": "Active columns",
"INACTIVE_COLUMNS_LABEL": "Inactive columns",
"SAVE_BUTTON_LABEL": "Save",
+ "SAVE_BUTTON_ARIA_LABEL": "Save",
"CANCEL_BUTTON_LABEL": "Cancel",
+ "CANCEL_BUTTON_ARIA_LABEL": "Cancel",
"DIALOG_TITLE": "Custom group column selection",
"CONFIGURE_ACTION_COLUMN": {
"TITLE": "Configure action column",
@@ -36,12 +40,12 @@
"OCX_LIST_GRID_SORT": {
"DROPDOWN": {
"PLACEHOLDER": "Select sorting",
- "TITLE": "Sort by"
+ "ARIA_LABEL": "Sort by"
},
"TOGGLE_BUTTON": {
- "ASCENDING_TITLE": "Ascending",
- "DESCENDING_TITLE": "Descending",
- "DEFAULT_TITLE": "Default"
+ "ASCENDING_TOOLTIP": "Ascending",
+ "DESCENDING_TOOLTIP": "Descending",
+ "DEFAULT_TOOLTIP": "Default"
},
"SORTING_BUTTON_ARIA_LABEL": "Toggle sorting direction to {{direction}}"
},
diff --git a/libs/angular-accelerator/src/lib/angular-accelerator-primeng.module.ts b/libs/angular-accelerator/src/lib/angular-accelerator-primeng.module.ts
index e2f5cedf..26a6e018 100644
--- a/libs/angular-accelerator/src/lib/angular-accelerator-primeng.module.ts
+++ b/libs/angular-accelerator/src/lib/angular-accelerator-primeng.module.ts
@@ -14,6 +14,7 @@ import { SkeletonModule } from 'primeng/skeleton'
import { MessageModule } from 'primeng/message'
import { SharedModule } from 'primeng/api'
import { CheckboxModule } from 'primeng/checkbox'
+import { FloatLabelModule } from 'primeng/floatlabel'
@NgModule({
imports: [
@@ -31,6 +32,7 @@ import { CheckboxModule } from 'primeng/checkbox'
MultiSelectModule,
SkeletonModule,
MessageModule,
+ FloatLabelModule,
SharedModule,
],
exports: [
@@ -48,6 +50,7 @@ import { CheckboxModule } from 'primeng/checkbox'
MultiSelectModule,
SkeletonModule,
MessageModule,
+ FloatLabelModule,
SharedModule,
],
})
diff --git a/libs/angular-accelerator/src/lib/components/column-group-selection/column-group-selection.component.html b/libs/angular-accelerator/src/lib/components/column-group-selection/column-group-selection.component.html
index a9c445b0..d24689c4 100644
--- a/libs/angular-accelerator/src/lib/components/column-group-selection/column-group-selection.component.html
+++ b/libs/angular-accelerator/src/lib/components/column-group-selection/column-group-selection.component.html
@@ -1,6 +1,6 @@
-
+
{{ item ? (item | translate) : ''}}
{{ item ? (item | translate) : ''}}
@@ -15,4 +16,4 @@
-
+
diff --git a/libs/angular-accelerator/src/lib/components/custom-group-column-selector/custom-group-column-selector.component.html b/libs/angular-accelerator/src/lib/components/custom-group-column-selector/custom-group-column-selector.component.html
index c97c788d..91616151 100644
--- a/libs/angular-accelerator/src/lib/components/custom-group-column-selector/custom-group-column-selector.component.html
+++ b/libs/angular-accelerator/src/lib/components/custom-group-column-selector/custom-group-column-selector.component.html
@@ -2,24 +2,35 @@
id="customGroupColumnSelectorButton"
type="button"
(onClick)="onOpenCustomGroupColumnSelectionDialogClick()"
- [title]="openButtonTitle || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.OPEN_BUTTON_DETAIL' | translate)"
+ [pTooltip]="openButtonTitle || (openButtonTitleKey | translate) || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.OPEN_BUTTON_DETAIL' | translate)"
+ tooltipPosition="top"
icon="pi pi-cog"
styleClass="p-button"
- [attr.aria-label]="openButtonTitle || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.OPEN_BUTTON_DETAIL' | translate)"
+ [ariaLabel]="(openButtonAriaLabelKey ? (openButtonAriaLabelKey | translate) : openButtonAriaLabel) || openButtonTitle || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.OPEN_BUTTON_DETAIL' | translate)"
+ [attr.aria-controls]="visible ? 'customGroupColumnSelectorDialog' : null"
+ [attr.aria-expanded]="visible ? true : false"
>
-
+
- {{ dialogTitle || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.DIALOG_TITLE' | translate) }}{{ dialogTitle || (dialogTitleKey | translate) || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.DIALOG_TITLE' | translate)
+ }}
- {{option.label | translate}}
+
+
+
@@ -65,7 +78,9 @@
class="mt-2"
name="action-column-position-select-button"
>
- {{option.label | translate}}
+
+
+
@@ -75,13 +90,15 @@
diff --git a/libs/angular-accelerator/src/lib/components/custom-group-column-selector/custom-group-column-selector.component.ts b/libs/angular-accelerator/src/lib/components/custom-group-column-selector/custom-group-column-selector.component.ts
index 75a6e59e..ccaccff9 100644
--- a/libs/angular-accelerator/src/lib/components/custom-group-column-selector/custom-group-column-selector.component.ts
+++ b/libs/angular-accelerator/src/lib/components/custom-group-column-selector/custom-group-column-selector.component.ts
@@ -26,11 +26,23 @@ export class CustomGroupColumnSelectorComponent implements OnInit {
@Input() columns: DataTableColumn[] = []
@Input() displayedColumns: DataTableColumn[] = []
@Input() dialogTitle = ''
+ @Input() dialogTitleKey = ''
@Input() openButtonTitle = ''
+ @Input() openButtonTitleKey = ''
+ @Input() openButtonAriaLabel = ''
+ @Input() openButtonAriaLabelKey = ''
@Input() saveButtonLabel = ''
+ @Input() saveButtonLabelKey = ''
+ @Input() saveButtonAriaLabel = ''
+ @Input() saveButtonAriaLabelKey = ''
@Input() cancelButtonLabel = ''
+ @Input() cancelButtonLabelKey = ''
+ @Input() cancelButtonAriaLabel = ''
+ @Input() cancelButtonAriaLabelKey = ''
@Input() activeColumnsLabel = ''
+ @Input() activeColumnsLabelKey = ''
@Input() inactiveColumnsLabel = ''
+ @Input() inactiveColumnsLabelKey = ''
@Input() frozenActionColumn = false
@Input() actionColumnPosition: 'left' | 'right' = 'right'
@@ -100,7 +112,7 @@ export class CustomGroupColumnSelectorComponent implements OnInit {
frozen: this.frozenActionColumnModel,
position: this.actionColumnPositionModel,
},
- activeColumnGroupKey: undefined
+ activeColumnGroupKey: undefined,
})
}
diff --git a/libs/angular-accelerator/src/lib/components/data-layout-selection/data-layout-selection.component.html b/libs/angular-accelerator/src/lib/components/data-layout-selection/data-layout-selection.component.html
index 68b23333..c4a33c38 100644
--- a/libs/angular-accelerator/src/lib/components/data-layout-selection/data-layout-selection.component.html
+++ b/libs/angular-accelerator/src/lib/components/data-layout-selection/data-layout-selection.component.html
@@ -3,11 +3,12 @@
*ngIf="viewingLayouts.length > 1"
[options]="viewingLayouts"
[(ngModel)]="selectedViewLayout"
- optionLabel="icon"
+ optionLabel="id"
(onChange)="onDataViewLayoutChange($event.value)"
>