[ACS-10205]: Extends DataTableAdapter interface to handle focus for accessibility (#11506)

* [ACS-10205]: updates base DataTableAdapter class with optional props

* [ACS-10205]: updates ShareDataTableAdapter with new props for focus handling

* [ACS-10205]: bind new focus props to template

* [ACS-10205]: uts update

* [ACS-10205]: uts refactor

* [ACS-10205]: fixes circullar deps
This commit is contained in:
Anton Ramanovich
2026-01-14 12:43:29 +01:00
committed by GitHub
parent e44e00304a
commit e01cd40b1f
5 changed files with 83 additions and 24 deletions
@@ -493,4 +493,16 @@ describe('ShareDataTableAdapter', () => {
expect(adapter.getRowByNodeId('fake-node-id-2')).toEqual(fakeShareDataRows[1]);
});
});
it('should initialize with allowFocusOnRows as true by default', () => {
const adapter = new ShareDataTableAdapter(thumbnailService, contentService, null);
expect(adapter.allowFocusOnRows).toBe(true);
});
it('should set allowFocusOnRows value', () => {
const adapter = new ShareDataTableAdapter(thumbnailService, contentService, null);
expect(adapter.allowFocusOnRows).toBe(true);
adapter.setAllowFocusOnTableRows(false);
expect(adapter.allowFocusOnRows).toBe(false);
});
});
@@ -34,10 +34,11 @@ export class ShareDataTableAdapter implements DataTableAdapter {
private filter: RowFilter;
private imageResolver: any;
thumbnails: boolean = false;
thumbnails = false;
permissionsStyle: PermissionStyleModel[];
selectedRow: DataRow;
allowDropFiles: boolean;
allowFocusOnRows = true;
set sortingMode(value: string) {
let newValue = (value || 'client').toLowerCase();
@@ -196,6 +197,10 @@ export class ShareDataTableAdapter implements DataTableAdapter {
this.imageResolver = resolver;
}
setAllowFocusOnTableRows(allow: boolean) {
this.allowFocusOnRows = allow;
}
private getFolderIcon(node: any) {
if (this.isSmartFolder(node)) {
return this.thumbnailService.getMimeTypeIcon('smartFolder');