Feature/selectable card component (#1703)

* added selectable card

* creating new card type
This commit is contained in:
Leila Lali
2018-06-22 14:25:21 -07:00
committed by GitHub
parent 322847469d
commit a627285a4c
12 changed files with 327 additions and 86 deletions

View File

@@ -15,7 +15,7 @@ import * as vscode from 'vscode';
import * as sqlops from 'sqlops';
import { SqlMainContext, ExtHostModelViewShape, MainThreadModelViewShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { IItemConfig, ModelComponentTypes, IComponentShape, IComponentEventArgs, ComponentEventType } from 'sql/workbench/api/common/sqlExtHostTypes';
import { IItemConfig, ModelComponentTypes, IComponentShape, IComponentEventArgs, ComponentEventType, CardType } from 'sql/workbench/api/common/sqlExtHostTypes';
class ModelBuilderImpl implements sqlops.ModelBuilder {
private nextComponentId: number;
@@ -523,6 +523,7 @@ class CardWrapper extends ComponentWrapper implements sqlops.CardComponent {
super(proxy, handle, ModelComponentTypes.Card, id);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidClick, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onDidClick, new Emitter<any>());
}
public get label(): string {
@@ -537,17 +538,53 @@ class CardWrapper extends ComponentWrapper implements sqlops.CardComponent {
public set value(v: string) {
this.setProperty('value', v);
}
public get selected(): boolean {
return this.properties['selected'];
}
public set selected(v: boolean) {
this.setProperty('selected', v);
}
public get cardType(): sqlops.CardType {
return this.properties['cardType'];
}
public set cardType(v: sqlops.CardType) {
this.setProperty('cardType', v);
}
public get actions(): sqlops.ActionDescriptor[] {
return this.properties['actions'];
}
public set actions(a: sqlops.ActionDescriptor[]) {
this.setProperty('actions', a);
}
public get iconPath(): string | URI | { light: string | URI; dark: string | URI } {
return this.properties['iconPath'];
}
public set iconPath(v: string | URI | { light: string | URI; dark: string | URI }) {
this.setProperty('iconPath', v);
}
public get iconHeight(): number | string {
return this.properties['iconHeight'];
}
public set iconHeight(v: number | string) {
this.setProperty('iconHeight', v);
}
public get iconWidth(): number | string {
return this.properties['iconWidth'];
}
public set iconWidth(v: number | string) {
this.setProperty('iconWidth', v);
}
public get onDidActionClick(): vscode.Event<sqlops.ActionDescriptor> {
let emitter = this._emitterMap.get(ComponentEventType.onDidClick);
return emitter && emitter.event;
}
public get onCardSelectedChanged(): vscode.Event<any> {
let emitter = this._emitterMap.get(ComponentEventType.onDidClick);
return emitter && emitter.event;
}
}
class InputBoxWrapper extends ComponentWrapper implements sqlops.InputBoxComponent {