Change tables to make them work for our scenario (#12193)

* Change tables to make them work for our scenario

* Comments & deprecate API

* Disable selections by default
This commit is contained in:
Amir Omidi
2020-09-11 13:44:19 -07:00
committed by GitHub
parent 58d3b969a2
commit 61ceb72cea
12 changed files with 253 additions and 49 deletions

View File

@@ -1462,15 +1462,26 @@ class DeclarativeTableWrapper extends ComponentWrapper implements azdata.Declara
super(proxy, handle, ModelComponentTypes.DeclarativeTable, id);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidChange, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onDidClick, new Emitter<any>());
}
public get data(): any[][] {
return this.properties['data'];
}
public set data(v: any[][]) {
this.setProperty('data', v);
}
public get dataValues(): azdata.DeclarativeTableCellValue[][] {
return this.properties['dataValues'];
}
public set dataValues(v: azdata.DeclarativeTableCellValue[][]) {
this.setProperty('dataValues', v);
}
public get columns(): azdata.DeclarativeTableColumn[] {
return this.properties['columns'];
}
@@ -1484,10 +1495,23 @@ class DeclarativeTableWrapper extends ComponentWrapper implements azdata.Declara
return emitter && emitter.event;
}
public get onRowSelected(): vscode.Event<any> {
let emitter = this._emitterMap.get(ComponentEventType.onDidClick);
return emitter && emitter.event;
}
protected notifyPropertyChanged(): Thenable<void> {
return this._proxy.$setProperties(this._handle, this._id, this.getPropertiesForMainThread());
}
public get selectEffect(): boolean | undefined {
return this.properties['selectEffect'];
}
public set selectEffect(v: boolean | undefined) {
this.setProperty('selectEffect', v);
}
public toComponentShape(): IComponentShape {
// Overridden to ensure we send the correct properties mapping.
return <IComponentShape>{