mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 17:22:20 -05:00
Feature/selectable card component (#1703)
* added selectable card * creating new card type
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user