mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-22 17:22:59 -05:00
Designer: property descriptions (#17668)
* format * added strings * format doc * use codicon instead * show descriptions in property pane only * fix ssdt string bug * fix overflow option * review comments * review comments * changes
This commit is contained in:
@@ -30,6 +30,9 @@ export class Checkbox extends Widget {
|
||||
private _onChange = new Emitter<boolean>();
|
||||
public readonly onChange: Event<boolean> = this._onChange.event;
|
||||
|
||||
private _onFocus = new Emitter<void>();
|
||||
public readonly onFocus: Event<void> = this._onFocus.event;
|
||||
|
||||
constructor(container: HTMLElement, opts: ICheckboxOptions) {
|
||||
super();
|
||||
const id = generateUuid();
|
||||
@@ -46,6 +49,9 @@ export class Checkbox extends Widget {
|
||||
this._onChange.fire(this.checked);
|
||||
});
|
||||
|
||||
this.onfocus(this._el, () => {
|
||||
this._onFocus.fire();
|
||||
});
|
||||
|
||||
this._label = document.createElement('label');
|
||||
this._label.style.verticalAlign = 'middle';
|
||||
|
||||
@@ -41,6 +41,9 @@ export class InputBox extends vsInputBox {
|
||||
private _onLoseFocus = this._register(new Emitter<OnLoseFocusParams>());
|
||||
public onLoseFocus: Event<OnLoseFocusParams> = this._onLoseFocus.event;
|
||||
|
||||
private _onInputFocus = this._register(new Emitter<void>());
|
||||
public onInputFocus: Event<void> = this._onInputFocus.event;
|
||||
|
||||
private _isTextAreaInput = false;
|
||||
private _hideErrors = false;
|
||||
|
||||
@@ -58,6 +61,10 @@ export class InputBox extends vsInputBox {
|
||||
self._lastLoseFocusValue = self.value;
|
||||
});
|
||||
|
||||
this.onfocus(this.inputElement, () => {
|
||||
self._onInputFocus.fire();
|
||||
});
|
||||
|
||||
if (_sqlOptions && _sqlOptions.type === 'textarea') {
|
||||
this._isTextAreaInput = true;
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ export class SelectBox extends vsSelectBox {
|
||||
private contextViewProvider: IContextViewProvider;
|
||||
private message?: IMessage;
|
||||
private _onDidSelect: Emitter<ISelectData>;
|
||||
private _onDidFocus: Emitter<void>;
|
||||
|
||||
private inputValidationInfoBorder?: Color;
|
||||
private inputValidationInfoBackground?: Color;
|
||||
@@ -71,6 +72,7 @@ export class SelectBox extends vsSelectBox {
|
||||
super(optionItems, 0, contextViewProvider, undefined, selectBoxOptions);
|
||||
|
||||
this._onDidSelect = new Emitter<ISelectData>();
|
||||
this._onDidFocus = new Emitter<void>();
|
||||
this._optionsDictionary = new Map<string, number>();
|
||||
this.populateOptionsDictionary(optionItems);
|
||||
this._dialogOptions = optionItems;
|
||||
@@ -100,7 +102,10 @@ export class SelectBox extends vsSelectBox {
|
||||
let focusTracker = dom.trackFocus(this.selectElement);
|
||||
this._register(focusTracker);
|
||||
this._register(focusTracker.onDidBlur(() => this._hideMessage()));
|
||||
this._register(focusTracker.onDidFocus(() => this._showMessage()));
|
||||
this._register(focusTracker.onDidFocus(() => {
|
||||
this._showMessage();
|
||||
this._onDidFocus.fire();
|
||||
}));
|
||||
// Stop propagation - we've handled the event already and letting it bubble up causes issues with parent
|
||||
// controls handling it (such as dialog pages)
|
||||
this.onkeydown(this.selectElement, (e: IKeyboardEvent) => {
|
||||
@@ -133,6 +138,10 @@ export class SelectBox extends vsSelectBox {
|
||||
return this._onDidSelect.event;
|
||||
}
|
||||
|
||||
public get onDidFocus(): Event<void> {
|
||||
return this._onDidFocus.event;
|
||||
}
|
||||
|
||||
public onSelect(newInput: ISelectData) {
|
||||
const selected = this._dialogOptions[newInput.index];
|
||||
this._selectedOption = selected.value;
|
||||
|
||||
Reference in New Issue
Block a user