diff --git a/src/sql/workbench/api/common/extHostModelView.ts b/src/sql/workbench/api/common/extHostModelView.ts index efc45c19a6..00bf818a26 100644 --- a/src/sql/workbench/api/common/extHostModelView.ts +++ b/src/sql/workbench/api/common/extHostModelView.ts @@ -329,6 +329,9 @@ class FormContainerBuilder extends GenericContainerBuilder { @@ -552,6 +555,14 @@ class ComponentWrapper implements azdata.Component { this.setProperty('display', v); } + public get ariaLabel(): string { + return this.properties['ariaLabel']; + } + + public set ariaLabel(v: string) { + this.setProperty('ariaLabel', v); + } + public get CSSStyles(): { [key: string]: string } { return this.properties['CSSStyles']; } @@ -820,18 +831,11 @@ class InputBoxWrapper extends ComponentWrapper implements azdata.InputBoxCompone this.setProperty('value', v); } - public get ariaLabel(): string { - return this.properties['ariaLabel']; - } - public set ariaLabel(v: string) { - this.setProperty('ariaLabel', v); - } - public get ariaLive(): string { return this.properties['ariaLive']; } public set ariaLive(v: string) { - this.setProperty('ariaLabel', v); + this.setProperty('ariaLive', v); } public get placeHolder(): string { @@ -1327,13 +1331,6 @@ class DropDownWrapper extends ComponentWrapper implements azdata.DropDownCompone this.setProperty('fireOnTextChange', v); } - public get ariaLabel(): string { - return this.properties['ariaLabel']; - } - public set ariaLabel(v: string) { - this.setProperty('ariaLabel', v); - } - public get onValueChanged(): vscode.Event { let emitter = this._emitterMap.get(ComponentEventType.onDidChange); return emitter && emitter.event; @@ -1419,13 +1416,6 @@ class ButtonWrapper extends ComponentWithIconWrapper implements azdata.ButtonCom this.setProperty('title', v); } - public get ariaLabel(): string { - return this.properties['ariaLabel']; - } - public set ariaLabel(v: string) { - this.setProperty('ariaLabel', v); - } - public get onDidClick(): vscode.Event { let emitter = this._emitterMap.get(ComponentEventType.onDidClick); return emitter && emitter.event; diff --git a/src/sql/workbench/browser/modelComponents/button.component.ts b/src/sql/workbench/browser/modelComponents/button.component.ts index 4ae23fe26b..c2511fe9ee 100644 --- a/src/sql/workbench/browser/modelComponents/button.component.ts +++ b/src/sql/workbench/browser/modelComponents/button.component.ts @@ -192,12 +192,4 @@ export default class ButtonComponent extends ComponentWithIconBase implements IC private setFileType(value: string) { this.properties.fileType = value; } - - private get ariaLabel(): string { - return this.getPropertyOrDefault((properties) => properties.ariaLabel, ''); - } - - private set ariaLabel(newValue: string) { - this.setPropertyFromUI((properties, ariaLabel) => { properties.ariaLabel = ariaLabel; }, newValue); - } } diff --git a/src/sql/workbench/browser/modelComponents/componentBase.ts b/src/sql/workbench/browser/modelComponents/componentBase.ts index aaf2aa2562..603b1be7c5 100644 --- a/src/sql/workbench/browser/modelComponents/componentBase.ts +++ b/src/sql/workbench/browser/modelComponents/componentBase.ts @@ -174,6 +174,14 @@ export abstract class ComponentBase extends Disposable implements IComponent, On this.setPropertyFromUI((properties, display) => { properties.display = display; }, newValue); } + public get ariaLabel(): string { + return this.getPropertyOrDefault((props) => props.ariaLabel, ''); + } + + public set ariaLabel(newValue: string) { + this.setPropertyFromUI((props, value) => props.ariaLabel = value, newValue); + } + public get CSSStyles(): { [key: string]: string } { return this.getPropertyOrDefault((props) => props.CSSStyles, {}); } diff --git a/src/sql/workbench/browser/modelComponents/dropdown.component.ts b/src/sql/workbench/browser/modelComponents/dropdown.component.ts index 303a4f384b..44bd86d54f 100644 --- a/src/sql/workbench/browser/modelComponents/dropdown.component.ts +++ b/src/sql/workbench/browser/modelComponents/dropdown.component.ts @@ -188,10 +188,6 @@ export default class DropDownComponent extends ComponentBase implements ICompone return this.getPropertyOrDefault((props) => props.fireOnTextChange, false); } - private get ariaLabel(): string { - return this.getPropertyOrDefault((props) => props.ariaLabel, ''); - } - public getEditableDisplay(): string { return this.editable && !this._isInAccessibilityMode ? '' : 'none'; } diff --git a/src/sql/workbench/browser/modelComponents/inputbox.component.ts b/src/sql/workbench/browser/modelComponents/inputbox.component.ts index 6756541e79..0db63c4dcb 100644 --- a/src/sql/workbench/browser/modelComponents/inputbox.component.ts +++ b/src/sql/workbench/browser/modelComponents/inputbox.component.ts @@ -248,14 +248,6 @@ export default class InputBoxComponent extends ComponentBase implements ICompone this.setPropertyFromUI((props, value) => props.value = value, newValue); } - public get ariaLabel(): string { - return this.getPropertyOrDefault((props) => props.ariaLabel, ''); - } - - public set ariaLabel(newValue: string) { - this.setPropertyFromUI((props, value) => props.ariaLabel = value, newValue); - } - public get ariaLive() { return this.getPropertyOrDefault((props) => props.ariaLive, ''); }