mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Adding aria-live label support for input boxes (#6862)
* Adding aria-live support for InputBoxes * Adding aria-live setting for DacFx wizard InputBox control * Dud commit to unstick Github CI
This commit is contained in:
@@ -136,7 +136,7 @@ export abstract class DacFxConfigPage extends BasePage {
|
|||||||
if (!(this.instance.selectedOperation === Operation.deploy && !this.model.upgradeExisting)) {
|
if (!(this.instance.selectedOperation === Operation.deploy && !this.model.upgradeExisting)) {
|
||||||
this.model.database = values[0].name;
|
this.model.database = values[0].name;
|
||||||
}
|
}
|
||||||
// filename shouldn't change for deploy because the file exists and isn't being generated like for extract and export
|
// filename shouldn't change for deploy because the file exists and isn't being generated as for extract and export
|
||||||
if (this.instance.selectedOperation !== Operation.deploy) {
|
if (this.instance.selectedOperation !== Operation.deploy) {
|
||||||
this.model.filePath = this.generateFilePathFromDatabaseAndTimestamp();
|
this.model.filePath = this.generateFilePathFromDatabaseAndTimestamp();
|
||||||
this.fileTextBox.value = this.model.filePath;
|
this.fileTextBox.value = this.model.filePath;
|
||||||
@@ -156,7 +156,8 @@ export abstract class DacFxConfigPage extends BasePage {
|
|||||||
component => isValidBasename(component.value)
|
component => isValidBasename(component.value)
|
||||||
)
|
)
|
||||||
.withProperties({
|
.withProperties({
|
||||||
required: true
|
required: true,
|
||||||
|
ariaLive: 'polite'
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
this.fileTextBox.ariaLabel = localize('dacfx.fileLocationAriaLabel', "File Location");
|
this.fileTextBox.ariaLabel = localize('dacfx.fileLocationAriaLabel', "File Location");
|
||||||
|
|||||||
1
src/sql/azdata.d.ts
vendored
1
src/sql/azdata.d.ts
vendored
@@ -2890,6 +2890,7 @@ declare module 'azdata' {
|
|||||||
export interface InputBoxProperties extends ComponentProperties {
|
export interface InputBoxProperties extends ComponentProperties {
|
||||||
value?: string;
|
value?: string;
|
||||||
ariaLabel?: string;
|
ariaLabel?: string;
|
||||||
|
ariaLive?: string;
|
||||||
placeHolder?: string;
|
placeHolder?: string;
|
||||||
inputType?: InputBoxInputType;
|
inputType?: InputBoxInputType;
|
||||||
required?: boolean;
|
required?: boolean;
|
||||||
|
|||||||
@@ -96,6 +96,10 @@ export class InputBox extends vsInputBox {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public set ariaLive(value: string) {
|
||||||
|
this.element.setAttribute('aria-live', value);
|
||||||
|
}
|
||||||
|
|
||||||
public isEnabled(): boolean {
|
public isEnabled(): boolean {
|
||||||
return !this.inputElement.hasAttribute('disabled');
|
return !this.inputElement.hasAttribute('disabled');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -767,6 +767,13 @@ class InputBoxWrapper extends ComponentWrapper implements azdata.InputBoxCompone
|
|||||||
this.setProperty('ariaLabel', v);
|
this.setProperty('ariaLabel', v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get ariaLive(): string {
|
||||||
|
return this.properties['ariaLive'];
|
||||||
|
}
|
||||||
|
public set ariaLive(v: string) {
|
||||||
|
this.setProperty('ariaLabel', v);
|
||||||
|
}
|
||||||
|
|
||||||
public get placeHolder(): string {
|
public get placeHolder(): string {
|
||||||
return this.properties['placeHolder'];
|
return this.properties['placeHolder'];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,6 +204,9 @@ export default class InputBoxComponent extends ComponentBase implements ICompone
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.ariaLive) {
|
||||||
|
input.ariaLive = this.ariaLive;
|
||||||
|
}
|
||||||
|
|
||||||
input.inputElement.required = this.required;
|
input.inputElement.required = this.required;
|
||||||
}
|
}
|
||||||
@@ -226,6 +229,10 @@ export default class InputBoxComponent extends ComponentBase implements ICompone
|
|||||||
this.setPropertyFromUI<azdata.InputBoxProperties, string>((props, value) => props.ariaLabel = value, newValue);
|
this.setPropertyFromUI<azdata.InputBoxProperties, string>((props, value) => props.ariaLabel = value, newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get ariaLive() {
|
||||||
|
return this.getPropertyOrDefault<azdata.InputBoxProperties, string>((props) => props.ariaLive, '');
|
||||||
|
}
|
||||||
|
|
||||||
public get placeHolder(): string {
|
public get placeHolder(): string {
|
||||||
return this.getPropertyOrDefault<azdata.InputBoxProperties, string>((props) => props.placeHolder, '');
|
return this.getPropertyOrDefault<azdata.InputBoxProperties, string>((props) => props.placeHolder, '');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user