new component - infobox (#14027)

* new component: infobox

* comments

* new option

* add comments
This commit is contained in:
Alan Ren
2021-01-22 18:38:10 -08:00
committed by GitHub
parent dd0fa50d32
commit d059032dee
18 changed files with 358 additions and 7 deletions

View File

@@ -271,6 +271,14 @@ class ModelBuilderImpl implements azdata.ModelBuilder {
return builder;
}
infoBox(): azdata.ComponentBuilder<azdata.InfoBoxComponent, azdata.InfoBoxComponentProperties> {
let id = this.getNextComponentId();
let builder: ComponentBuilderImpl<azdata.InfoBoxComponent, azdata.InfoBoxComponentProperties> = this.getComponentBuilder(new InfoBoxComponentWrapper(this._proxy, this._handle, id), id);
this._componentBuilders.set(id, builder);
return builder;
}
getComponentBuilder<T extends azdata.Component, TPropertyBag extends azdata.ComponentProperties>(component: ComponentWrapper, id: string): ComponentBuilderImpl<T, TPropertyBag> {
let componentBuilder: ComponentBuilderImpl<T, TPropertyBag> = new ComponentBuilderImpl<T, TPropertyBag>(component);
this._componentBuilders.set(id, componentBuilder);
@@ -1984,6 +1992,37 @@ class PropertiesContainerComponentWrapper extends ComponentWrapper implements az
}
}
class InfoBoxComponentWrapper extends ComponentWrapper implements azdata.InfoBoxComponent {
constructor(proxy: MainThreadModelViewShape, handle: number, id: string) {
super(proxy, handle, ModelComponentTypes.InfoBox, id);
this.properties = {};
}
public get style(): azdata.InfoBoxStyle {
return this.properties['style'];
}
public set style(v: azdata.InfoBoxStyle) {
this.setProperty('style', v);
}
public get text(): string {
return this.properties['text'];
}
public set text(v: string) {
this.setProperty('text', v);
}
public get announceText(): boolean {
return this.properties['announceText'];
}
public set announceText(v: boolean) {
this.setProperty('announceText', v);
}
}
class GroupContainerComponentWrapper extends ComponentWrapper implements azdata.GroupContainer {
constructor(proxy: MainThreadModelViewShape, handle: number, type: ModelComponentTypes, id: string) {
super(proxy, handle, type, id);

View File

@@ -177,7 +177,8 @@ export enum ModelComponentTypes {
ListView,
TabbedPanel,
Separator,
PropertiesContainer
PropertiesContainer,
InfoBox
}
export enum ModelViewAction {