mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-01 17:23:35 -05:00
Improve narration for backup and dacpac UIs (#6783)
* Added ability to specify aria-rowcount and -colcount to tables. * Cleanup * Adds aria role to table container so that screen-readers ignore it
This commit is contained in:
2
src/sql/azdata.d.ts
vendored
2
src/sql/azdata.d.ts
vendored
@@ -2941,6 +2941,8 @@ declare module 'azdata' {
|
||||
selectedRows?: number[];
|
||||
forceFitColumns?: ColumnSizingMode;
|
||||
title?: string;
|
||||
ariaRowCount?: number;
|
||||
ariaColumnCount?: number;
|
||||
}
|
||||
|
||||
export interface FileBrowserTreeProperties extends ComponentProperties {
|
||||
|
||||
@@ -343,4 +343,20 @@ export class Table<T extends Slick.SlickData> extends Widget implements IDisposa
|
||||
public setTableTitle(title: string): void {
|
||||
this._tableContainer.title = title;
|
||||
}
|
||||
|
||||
public removeAriaRowCount(): void {
|
||||
this._tableContainer.removeAttribute('aria-rowcount');
|
||||
}
|
||||
|
||||
public set ariaRowCount(value: number) {
|
||||
this._tableContainer.setAttribute('aria-rowcount', value.toString());
|
||||
}
|
||||
|
||||
public removeAriaColumnCount(): void {
|
||||
this._tableContainer.removeAttribute('aria-colcount');
|
||||
}
|
||||
|
||||
public set ariaColumnCount(value: number) {
|
||||
this._tableContainer.setAttribute('aria-colcount', value.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,6 +217,20 @@ export default class TableComponent extends ComponentBase implements IComponent,
|
||||
this.registerCheckboxPlugin(this._checkboxColumns[col]);
|
||||
}
|
||||
|
||||
if (this.ariaRowCount === -1) {
|
||||
this._table.removeAriaRowCount();
|
||||
}
|
||||
else {
|
||||
this._table.ariaRowCount = this.ariaRowCount;
|
||||
}
|
||||
|
||||
if (this.ariaColumnCount === -1) {
|
||||
this._table.removeAriaColumnCount();
|
||||
}
|
||||
else {
|
||||
this._table.ariaColumnCount = this.ariaColumnCount;
|
||||
}
|
||||
|
||||
this.layoutTable();
|
||||
this.validate();
|
||||
}
|
||||
@@ -291,4 +305,12 @@ export default class TableComponent extends ComponentBase implements IComponent,
|
||||
public get title() {
|
||||
return this.getPropertyOrDefault<azdata.TableComponentProperties, string>((props) => props.title, '');
|
||||
}
|
||||
|
||||
public get ariaRowCount(): number {
|
||||
return this.getPropertyOrDefault<azdata.TableComponentProperties, number>((props) => props.ariaRowCount, -1);
|
||||
}
|
||||
|
||||
public get ariaColumnCount(): number {
|
||||
return this.getPropertyOrDefault<azdata.TableComponentProperties, number>((props) => props.ariaColumnCount, -1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +88,8 @@ export class FileBrowserDialog extends Modal {
|
||||
this._treeContainer = DOM.append(this._body, DOM.$('.tree-view'));
|
||||
|
||||
let tableContainer: HTMLElement = DOM.append(DOM.append(this._body, DOM.$('.option-section')), DOM.$('table.file-table-content'));
|
||||
tableContainer.setAttribute('role', 'presentation');
|
||||
|
||||
let pathLabel = localize('filebrowser.filepath', "Selected path");
|
||||
let pathBuilder = DialogHelper.appendRow(tableContainer, pathLabel, 'file-input-label', 'file-input-box');
|
||||
this._filePathInputBox = new InputBox(pathBuilder, this._contextViewService, {
|
||||
|
||||
Reference in New Issue
Block a user