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

@@ -239,7 +239,7 @@ declare module 'sqlops' {
horizontal?: boolean;
componentWidth?: number | string;
componentHeight?: number | string;
titleFontSize?: number;
titleFontSize?: number | string;
required?: boolean;
info?: string;
}
@@ -300,15 +300,22 @@ declare module 'sqlops' {
Error = 3
}
export enum CardType {
VerticalButton = 'VerticalButton',
Details = 'Details'
}
/**
* Properties representing the card component, can be used
* when using ModelBuilder to create the component
*/
export interface CardProperties {
export interface CardProperties extends ComponentWithIcon {
label: string;
value?: string;
actions?: ActionDescriptor[];
status?: StatusIndicator;
selected?: boolean;
cardType: CardType;
}
export type InputBoxInputType = 'color' | 'date' | 'datetime-local' | 'email' | 'month' | 'number' | 'password' | 'range' | 'search' | 'text' | 'time' | 'url' | 'week';
@@ -318,6 +325,12 @@ declare module 'sqlops' {
width?: number | string;
}
export interface ComponentWithIcon {
iconPath?: string | vscode.Uri | { light: string | vscode.Uri; dark: string | vscode.Uri };
iconHeight?: number | string;
iconWidth?: number | string;
}
export interface InputBoxProperties extends ComponentProperties {
value?: string;
ariaLabel?: string;
@@ -393,20 +406,17 @@ declare module 'sqlops' {
html?: string;
}
export interface ButtonProperties extends ComponentProperties {
export interface ButtonProperties extends ComponentProperties, ComponentWithIcon {
label?: string;
iconPath?: string | vscode.Uri | { light: string | vscode.Uri; dark: string | vscode.Uri };
}
export interface LoadingComponentProperties {
loading?: boolean;
}
export interface CardComponent extends Component {
label: string;
value: string;
actions?: ActionDescriptor[];
export interface CardComponent extends Component, CardProperties {
onDidActionClick: vscode.Event<ActionDescriptor>;
onCardSelectedChanged: vscode.Event<any>;
}
export interface TextComponent extends Component {