Add Slider component (#14774)

* initial

* more cleanup

* update types
This commit is contained in:
Charles Gagnon
2021-03-18 09:47:36 -07:00
committed by GitHub
parent 03d2ac7206
commit 88b7960d01
11 changed files with 506 additions and 8 deletions

View File

@@ -345,6 +345,7 @@ declare module 'azdata' {
separator(): ComponentBuilder<SeparatorComponent, SeparatorComponentProperties>;
propertiesContainer(): ComponentBuilder<PropertiesContainerComponent, PropertiesContainerComponentProperties>;
infoBox(): ComponentBuilder<InfoBoxComponent, InfoBoxComponentProperties>;
slider(): ComponentBuilder<SliderComponent, SliderComponentProperties>;
}
export interface ComponentBuilder<TComponent extends Component, TPropertyBag extends ComponentProperties> {
@@ -588,6 +589,38 @@ declare module 'azdata' {
required?: boolean;
}
export interface SliderComponentProperties extends ComponentProperties {
/**
* The value selected on the slider. Default initial value is the minimum value.
*/
value?: number,
/**
* The minimum value of the slider. Default value is 1.
*/
min?: number,
/**
* The maximum value of the slider. Default value is 100.
*/
max?: number,
/**
* The value between each "tick" of the slider. Default is 1.
*/
step?: number,
/**
* Whether to show the tick marks on the slider. Default is false.
*/
showTicks?: boolean
/**
* The width of the slider, not including the value box.
*/
width?: number | string;
}
export interface SliderComponent extends Component, SliderComponentProperties {
onChanged: vscode.Event<number>;
onInput: vscode.Event<number>;
}
/**
* A property to be displayed in the PropertiesContainerComponent
*/