accessible radio card (#8514)

* accessible radio card group

* set radio card group width

* address comments

* address comments 2

* fix the profile card not being focused issue
This commit is contained in:
Alan Ren
2019-12-03 13:26:00 -08:00
committed by GitHub
parent 82c60a23c0
commit b38b53b658
11 changed files with 517 additions and 205 deletions

View File

@@ -226,6 +226,13 @@ class ModelBuilderImpl implements azdata.ModelBuilder {
return builder;
}
radioCardGroup(): azdata.ComponentBuilder<azdata.RadioCardGroupComponent> {
let id = this.getNextComponentId();
let builder: ComponentBuilderImpl<azdata.RadioCardGroupComponent> = this.getComponentBuilder(new RadioCardGroupComponentWrapper(this._proxy, this._handle, id), id);
this._componentBuilders.set(id, builder);
return builder;
}
getComponentBuilder<T extends azdata.Component>(component: ComponentWrapper, id: string): ComponentBuilderImpl<T> {
let componentBuilder: ComponentBuilderImpl<T> = new ComponentBuilderImpl<T>(component);
this._componentBuilders.set(id, componentBuilder);
@@ -1591,6 +1598,66 @@ class HyperlinkComponentWrapper extends ComponentWrapper implements azdata.Hyper
}
}
class RadioCardGroupComponentWrapper extends ComponentWrapper implements azdata.RadioCardGroupComponent {
constructor(proxy: MainThreadModelViewShape, handle: number, id: string) {
super(proxy, handle, ModelComponentTypes.RadioCardGroup, id);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidChange, new Emitter<any>());
}
public get iconWidth(): string | undefined {
return this.properties['iconWidth'];
}
public set iconWidth(v: string | undefined) {
this.setProperty('iconWidth', v);
}
public get iconHeight(): string | undefined {
return this.properties['iconHeight'];
}
public set iconHeight(v: string | undefined) {
this.setProperty('iconHeight', v);
}
public get cardWidth(): string | undefined {
return this.properties['cardWidth'];
}
public set cardWidth(v: string | undefined) {
this.setProperty('cardWidth', v);
}
public get cardHeight(): string | undefined {
return this.properties['cardHeight'];
}
public set cardHeight(v: string | undefined) {
this.setProperty('cardHeight', v);
}
public get cards(): azdata.RadioCard[] {
return this.properties['cards'];
}
public set cards(v: azdata.RadioCard[]) {
this.setProperty('cards', v);
}
public get selectedCardId(): string | undefined {
return this.properties['selectedCardId'];
}
public set selectedCardId(v: string | undefined) {
this.setProperty('selectedCardId', v);
}
public get onSelectionChanged(): vscode.Event<any> {
let emitter = this._emitterMap.get(ComponentEventType.onDidChange);
return emitter && emitter.event;
}
}
class GroupContainerComponentWrapper extends ComponentWrapper implements azdata.GroupContainer {
constructor(proxy: MainThreadModelViewShape, handle: number, type: ModelComponentTypes, id: string) {
super(proxy, handle, type, id);