mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-13 11:38:36 -05:00
Expose inputbox title so hover text can be set (#13084)
* expose inputbox title so hover text can be set * only update title if there's a value
This commit is contained in:
4
src/sql/azdata.proposed.d.ts
vendored
4
src/sql/azdata.proposed.d.ts
vendored
@@ -531,6 +531,10 @@ declare module 'azdata' {
|
||||
export interface InputBoxProperties extends ComponentProperties {
|
||||
validationErrorMessage?: string;
|
||||
readOnly?: boolean;
|
||||
/**
|
||||
* This title will show when hovered over
|
||||
*/
|
||||
title?: string;
|
||||
}
|
||||
|
||||
export interface CheckBoxProperties {
|
||||
|
||||
@@ -245,6 +245,11 @@ export default class InputBoxComponent extends ComponentBase<azdata.InputBoxProp
|
||||
|
||||
input.inputElement.required = this.required;
|
||||
input.inputElement.readOnly = this.readOnly;
|
||||
|
||||
// only update title if there's a value, otherwise title gets set to placeholder above
|
||||
if (this.title) {
|
||||
input.inputElement.title = this.title;
|
||||
}
|
||||
}
|
||||
|
||||
// CSS-bound properties
|
||||
@@ -269,6 +274,14 @@ export default class InputBoxComponent extends ComponentBase<azdata.InputBoxProp
|
||||
this.setPropertyFromUI<string>((props, value) => props.placeHolder = value, newValue);
|
||||
}
|
||||
|
||||
public get title(): string {
|
||||
return this.getPropertyOrDefault<string>((props) => props.title, '');
|
||||
}
|
||||
|
||||
public set title(newValue: string) {
|
||||
this.setPropertyFromUI<string>((props, value) => props.title = value, newValue);
|
||||
}
|
||||
|
||||
public set columns(newValue: number) {
|
||||
this.setPropertyFromUI<number>((props, value) => props.columns = value, newValue);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user