mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-02 09:35:40 -05:00
Add default model view input types and validation (#1397)
This commit is contained in:
@@ -32,6 +32,7 @@ export interface IInputOptions extends IInputBoxStyles {
|
||||
// {{SQL CARBON EDIT}} Candidate for addition to vscode
|
||||
min?: string;
|
||||
max?: string;
|
||||
useDefaultValidation?: boolean;
|
||||
}
|
||||
|
||||
export interface IInputBoxStyles {
|
||||
@@ -355,6 +356,14 @@ export class InputBox extends Widget {
|
||||
if (this.validation) {
|
||||
result = this.validation(this.value);
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
if (!result && this.options.useDefaultValidation && this.inputElement.validationMessage) {
|
||||
result = {
|
||||
content: this.inputElement.validationMessage,
|
||||
type: MessageType.ERROR
|
||||
};
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
this.inputElement.removeAttribute('aria-invalid');
|
||||
this.hideMessage();
|
||||
|
||||
Reference in New Issue
Block a user