Add default model view input types and validation (#1397)

This commit is contained in:
Matt Irvine
2018-05-14 16:20:19 -07:00
committed by GitHub
parent 89c48bbe75
commit 9bd45cf66a
14 changed files with 363 additions and 118 deletions

View File

@@ -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();