Bug/accessibility 5 (#7008)

* fixing 6946 and 6796(second part)

* fix for https://github.com/microsoft/azuredatastudio/issues/6726

* comments cleanup

* taking PR comments

* adding strong border for HC focus

* convert to string template
This commit is contained in:
Udeesha Gautam
2019-09-09 15:37:12 -07:00
committed by GitHub
parent 66cdbbb335
commit 5ae8017233
6 changed files with 53 additions and 17 deletions

View File

@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { escape } from 'sql/base/common/strings';
import { localize } from 'vs/nls';
export class DBCellValue {
displayValue: string;
@@ -77,6 +78,19 @@ export function slickGridDataItemColumnValueExtractor(value: any, columnDef: any
};
}
/**
* Alternate function to provide slick grid cell with ariaLabel and plain text
* In this case, for no display value ariaLabel will be set to specific string "no data available" for accessibily support for screen readers
* Set 'no data' lable only if cell is present and has no value (so that checkbox and other custom plugins do not get 'no data' label)
*/
export function slickGridDataItemColumnValueWithNoData(value: any, columnDef: any): { text: string; ariaLabel: string; } {
let displayValue = value[columnDef.field];
return {
text: displayValue,
ariaLabel: displayValue ? escape(displayValue) : ((displayValue !== undefined) ? localize("tableCell.NoDataAvailable", "no data available") : displayValue)
};
}
/** The following code is a rewrite over the both formatter function using dom builder
* rather than string manipulation, which is a safer and easier method of achieving the same goal.
* However, when electron is in "Run as node" mode, dom creation acts differently than normal and therefore