mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[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:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user