Add required property to checkbox and set it for deployment dialog (#9392)

This commit is contained in:
Charles Gagnon
2020-03-02 07:54:13 -08:00
committed by GitHub
parent 6383bc7ebd
commit 01db78f743
4 changed files with 25 additions and 1 deletions

View File

@@ -90,6 +90,9 @@ export default class CheckBoxComponent extends ComponentBase implements ICompone
if (this.ariaLabel) {
this._input.ariaLabel = this.ariaLabel;
}
if (this.required) {
this._input.required = this.required;
}
}
// CSS-bound properties
@@ -110,6 +113,14 @@ export default class CheckBoxComponent extends ComponentBase implements ICompone
this.setPropertyFromUI<azdata.CheckBoxProperties, string>((properties, label) => { properties.label = label; }, newValue);
}
public get required(): boolean {
return this.getPropertyOrDefault<azdata.CheckBoxProperties, boolean>((props) => props.required, false);
}
public set required(newValue: boolean) {
this.setPropertyFromUI<azdata.CheckBoxProperties, boolean>((props, value) => props.required = value, newValue);
}
public focus(): void {
this._input.focus();
}