Making infobox clickable (#18676)

* Making infobox clickable

* Making it accessible

* Moving API to proposed

* Matching styling from portal

* Fixing some styling

* Moving to proposed

* Removing extra spacing

* Registering and Unregistering listeners

* Fixing listeners

* Registering emitter only once.

* Changing emitter type from undefined to void

* Adding arialabel to clickable link

* Changing property name to suit its purpose
This commit is contained in:
Aasim Khan
2022-03-09 18:43:39 -08:00
committed by GitHub
parent 0c54c12772
commit b299f7ed3f
5 changed files with 147 additions and 5 deletions

View File

@@ -2085,6 +2085,7 @@ class InfoBoxComponentWrapper extends ComponentWrapper implements azdata.InfoBox
constructor(proxy: MainThreadModelViewShape, handle: number, id: string, logService: ILogService) {
super(proxy, handle, ModelComponentTypes.InfoBox, id, logService);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidClick, new Emitter<void>());
}
public get style(): azdata.InfoBoxStyle {
@@ -2110,6 +2111,27 @@ class InfoBoxComponentWrapper extends ComponentWrapper implements azdata.InfoBox
public set announceText(v: boolean) {
this.setProperty('announceText', v);
}
public get isClickable(): boolean {
return this.properties['isClickable'];
}
public set isClickable(v: boolean) {
this.setProperty('isClickable', v);
}
public get clickableButtonAriaLabel(): string {
return this.properties['clickableButtonAriaLabel'];
}
public set clickableButtonAriaLabel(v: string) {
this.setProperty('clickableButtonAriaLabel', v);
}
public get onDidClick(): vscode.Event<any> {
let emitter = this._emitterMap.get(ComponentEventType.onDidClick);
return emitter && emitter.event;
}
}
class SliderComponentWrapper extends ComponentWrapper implements azdata.SliderComponent {