mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 09:35:37 -05:00
Adding link support to infobox. (#18876)
This commit is contained in:
@@ -2085,7 +2085,8 @@ 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>());
|
||||
this._emitterMap.set(ComponentEventType.onDidClick, new Emitter<any>());
|
||||
this._emitterMap.set(ComponentEventType.onChildClick, new Emitter<any>());
|
||||
}
|
||||
|
||||
public get style(): azdata.InfoBoxStyle {
|
||||
@@ -2104,6 +2105,14 @@ class InfoBoxComponentWrapper extends ComponentWrapper implements azdata.InfoBox
|
||||
this.setProperty('text', v);
|
||||
}
|
||||
|
||||
public get links(): azdata.LinkArea[] {
|
||||
return this.properties['links'];
|
||||
}
|
||||
|
||||
public set links(v: azdata.LinkArea[]) {
|
||||
this.setProperty('links', v);
|
||||
}
|
||||
|
||||
public get announceText(): boolean {
|
||||
return this.properties['announceText'];
|
||||
}
|
||||
@@ -2128,10 +2137,15 @@ class InfoBoxComponentWrapper extends ComponentWrapper implements azdata.InfoBox
|
||||
this.setProperty('clickableButtonAriaLabel', v);
|
||||
}
|
||||
|
||||
public get onDidClick(): vscode.Event<any> {
|
||||
public get onDidClick(): vscode.Event<void> {
|
||||
let emitter = this._emitterMap.get(ComponentEventType.onDidClick);
|
||||
return emitter && emitter.event;
|
||||
}
|
||||
|
||||
public get onLinkClick(): vscode.Event<azdata.InfoBoxLinkClickEventArgs> {
|
||||
let emitter = this._emitterMap.get(ComponentEventType.onChildClick);
|
||||
return emitter && emitter.event;
|
||||
}
|
||||
}
|
||||
|
||||
class SliderComponentWrapper extends ComponentWrapper implements azdata.SliderComponent {
|
||||
|
||||
@@ -246,7 +246,8 @@ export enum ComponentEventType {
|
||||
onCellAction,
|
||||
onEnterKeyPressed,
|
||||
onInput,
|
||||
onComponentLoaded
|
||||
onComponentLoaded,
|
||||
onChildClick
|
||||
}
|
||||
|
||||
export interface IComponentEventArgs {
|
||||
|
||||
Reference in New Issue
Block a user