mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Accessibility enhancements (#1678)
* adds aria-label to inputs for connection * formatting * add ariaLabels to all checkboxes/inputboxes/dropdowns * fix labels on database dropdown action * fix compile errors * remove unnecessary code
This commit is contained in:
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -38,5 +38,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"typescript.tsdk": "node_modules/typescript/lib"
|
"typescript.tsdk": "node_modules/typescript/lib",
|
||||||
|
"git.ignoreLimitWarning": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export class ToggleDropdownAction extends Action {
|
|||||||
private static readonly ID = 'dropdownAction.toggle';
|
private static readonly ID = 'dropdownAction.toggle';
|
||||||
private static readonly ICON = 'dropdown-arrow';
|
private static readonly ICON = 'dropdown-arrow';
|
||||||
|
|
||||||
constructor(label, private _fn: () => any) {
|
constructor(private _fn: () => any, label: string) {
|
||||||
super(ToggleDropdownAction.ID, label, ToggleDropdownAction.ICON);
|
super(ToggleDropdownAction.ID, label, ToggleDropdownAction.ICON);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ export interface IDropdownOptions extends IDropdownStyles {
|
|||||||
* Value to use as aria-label for the input box
|
* Value to use as aria-label for the input box
|
||||||
*/
|
*/
|
||||||
ariaLabel?: string;
|
ariaLabel?: string;
|
||||||
|
/**
|
||||||
|
* Label for the dropdown action
|
||||||
|
*/
|
||||||
|
actionLabel: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IDropdownStyles {
|
export interface IDropdownStyles {
|
||||||
@@ -66,7 +70,8 @@ const defaults: IDropdownOptions = {
|
|||||||
strictSelection: true,
|
strictSelection: true,
|
||||||
maxHeight: 300,
|
maxHeight: 300,
|
||||||
errorMessage: errorMessage,
|
errorMessage: errorMessage,
|
||||||
contextBorder: Color.fromHex('#696969')
|
contextBorder: Color.fromHex('#696969'),
|
||||||
|
actionLabel: nls.localize('dropdownAction.toggle', "Toggle dropdown")
|
||||||
};
|
};
|
||||||
|
|
||||||
interface ListResource {
|
interface ListResource {
|
||||||
@@ -115,11 +120,11 @@ export class Dropdown extends Disposable {
|
|||||||
this.$input = $('.dropdown-input').style('width', '100%').appendTo(this.$el);
|
this.$input = $('.dropdown-input').style('width', '100%').appendTo(this.$el);
|
||||||
this.$treeContainer = $('.dropdown-tree');
|
this.$treeContainer = $('.dropdown-tree');
|
||||||
|
|
||||||
this._toggleAction = new ToggleDropdownAction(nls.localize('dropdown.toggle', '{0} Toggle Dropdown', this._options.ariaLabel), () => {
|
this._toggleAction = new ToggleDropdownAction(() => {
|
||||||
this._showList();
|
this._showList();
|
||||||
this._tree.domFocus();
|
this._tree.domFocus();
|
||||||
this._tree.focusFirst();
|
this._tree.focusFirst();
|
||||||
});
|
}, opt.actionLabel);
|
||||||
|
|
||||||
this._input = new InputBox(this.$input.getHTMLElement(), contextViewService, {
|
this._input = new InputBox(this.$input.getHTMLElement(), contextViewService, {
|
||||||
validationOptions: {
|
validationOptions: {
|
||||||
|
|||||||
@@ -172,7 +172,8 @@ export class ConnectionWidget {
|
|||||||
strictSelection: false,
|
strictSelection: false,
|
||||||
placeholder: this._defaultDatabaseName,
|
placeholder: this._defaultDatabaseName,
|
||||||
maxHeight: 125,
|
maxHeight: 125,
|
||||||
ariaLabel: databaseOption.displayName
|
ariaLabel: databaseOption.displayName,
|
||||||
|
actionLabel: localize('toggleDatabaseNameDropdown', 'Select Database Toggle Dropdown')
|
||||||
});
|
});
|
||||||
|
|
||||||
let serverGroupLabel = localize('serverGroup', 'Server group');
|
let serverGroupLabel = localize('serverGroup', 'Server group');
|
||||||
|
|||||||
@@ -235,7 +235,8 @@ export class RestoreDialog extends Modal {
|
|||||||
this._databaseDropdown = new Dropdown(inputCellContainer.getHTMLElement(), this._contextViewService, this._themeService,
|
this._databaseDropdown = new Dropdown(inputCellContainer.getHTMLElement(), this._contextViewService, this._themeService,
|
||||||
{
|
{
|
||||||
strictSelection: false,
|
strictSelection: false,
|
||||||
ariaLabel: LocalizedStrings.TARGETDATABASE
|
ariaLabel: LocalizedStrings.TARGETDATABASE,
|
||||||
|
actionLabel: localize('toggleDatabaseNameDropdown', 'Select Database Toggle Dropdown')
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
this._databaseDropdown.onValueChange(s => {
|
this._databaseDropdown.onValueChange(s => {
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Component, Input, Inject, ChangeDetectorRef, forwardRef, ComponentFactoryResolver,
|
Component, Input, Inject, ChangeDetectorRef, forwardRef,
|
||||||
ViewChild, ViewChildren, ElementRef, Injector, OnDestroy, QueryList, AfterViewInit
|
ViewChild, ElementRef, OnDestroy, AfterViewInit
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import * as sqlops from 'sqlops';
|
import * as sqlops from 'sqlops';
|
||||||
@@ -14,14 +14,11 @@ import { ComponentBase } from 'sql/parts/modelComponents/componentBase';
|
|||||||
import { IComponent, IComponentDescriptor, IModelStore, ComponentEventType } from 'sql/parts/modelComponents/interfaces';
|
import { IComponent, IComponentDescriptor, IModelStore, ComponentEventType } from 'sql/parts/modelComponents/interfaces';
|
||||||
import { Dropdown, IDropdownOptions } from 'sql/base/browser/ui/editableDropdown/dropdown';
|
import { Dropdown, IDropdownOptions } from 'sql/base/browser/ui/editableDropdown/dropdown';
|
||||||
import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox';
|
import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox';
|
||||||
import { CommonServiceInterface } from 'sql/services/common/commonServiceInterface.service';
|
|
||||||
import { attachEditableDropdownStyler } from 'sql/common/theme/styler';
|
import { attachEditableDropdownStyler } from 'sql/common/theme/styler';
|
||||||
import { attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
|
import { attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
|
||||||
|
|
||||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||||
import { Event, Emitter } from 'vs/base/common/event';
|
|
||||||
import { attachListStyler } from 'vs/platform/theme/common/styler';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'modelview-dropdown',
|
selector: 'modelview-dropdown',
|
||||||
@@ -60,7 +57,8 @@ export default class DropDownComponent extends ComponentBase implements ICompone
|
|||||||
strictSelection: false,
|
strictSelection: false,
|
||||||
placeholder: '',
|
placeholder: '',
|
||||||
maxHeight: 125,
|
maxHeight: 125,
|
||||||
ariaLabel: ''
|
ariaLabel: '',
|
||||||
|
actionLabel: ''
|
||||||
};
|
};
|
||||||
this._editableDropdown = new Dropdown(this._editableDropDownContainer.nativeElement, this.contextViewService, this.themeService,
|
this._editableDropdown = new Dropdown(this._editableDropDownContainer.nativeElement, this.contextViewService, this.themeService,
|
||||||
dropdownOptions);
|
dropdownOptions);
|
||||||
|
|||||||
@@ -448,7 +448,8 @@ export class ListDatabasesActionItem extends EventEmitter implements IActionItem
|
|||||||
this._dropdown = new Dropdown(this.$databaseListDropdown.getHTMLElement(), contextViewProvider, themeService, {
|
this._dropdown = new Dropdown(this.$databaseListDropdown.getHTMLElement(), contextViewProvider, themeService, {
|
||||||
strictSelection: true,
|
strictSelection: true,
|
||||||
placeholder: selectString,
|
placeholder: selectString,
|
||||||
ariaLabel: selectString
|
ariaLabel: selectString,
|
||||||
|
actionLabel: nls.localize('toggleDatabaseNameDropdown', 'Select Database Toggle Dropdown')
|
||||||
});
|
});
|
||||||
this._dropdown.onValueChange(s => this.databaseSelected(s));
|
this._dropdown.onValueChange(s => this.databaseSelected(s));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user