mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-15 17:22:25 -05:00
Add styling and component column type to declarative table (#8476)
* Initial wip * wip * Working implementation * Make widths a bit nicer and remove sqlops addition * Add sqlops back in * Fix timing issue with tables * Undo change to sql.bat and remove loading component when done
This commit is contained in:
@@ -1368,6 +1368,46 @@ class DeclarativeTableWrapper extends ComponentWrapper implements azdata.Declara
|
||||
let emitter = this._emitterMap.get(ComponentEventType.onDidChange);
|
||||
return emitter && emitter.event;
|
||||
}
|
||||
|
||||
protected notifyPropertyChanged(): Thenable<void> {
|
||||
return this._proxy.$setProperties(this._handle, this._id, this.getPropertiesForMainThread());
|
||||
}
|
||||
|
||||
public toComponentShape(): IComponentShape {
|
||||
// Overridden to ensure we send the correct properties mapping.
|
||||
return <IComponentShape>{
|
||||
id: this.id,
|
||||
type: this.type,
|
||||
layout: this.layout,
|
||||
properties: this.getPropertiesForMainThread(),
|
||||
itemConfigs: this.itemConfigs ? this.itemConfigs.map<IItemConfig>(item => item.toIItemConfig()) : undefined
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the properties map to send to the main thread.
|
||||
*/
|
||||
private getPropertiesForMainThread(): { [key: string]: string } {
|
||||
// This is necessary because we can't send the actual ComponentWrapper objects
|
||||
// and so map them into their IDs instead. We don't want to update the actual
|
||||
// data property though since the caller would still expect that to contain
|
||||
// the Component objects they created
|
||||
const properties = assign({}, this.properties);
|
||||
if (properties.data) {
|
||||
properties.data = properties.data.map((row: any[]) => row.map(cell => {
|
||||
if (cell instanceof ComponentWrapper) {
|
||||
// First ensure that we register the component using addItem
|
||||
// such that it gets added to the ModelStore. We don't want to
|
||||
// make the table component an actual container since that exposes
|
||||
// a lot of functionality we don't need.
|
||||
this.addItem(cell);
|
||||
return cell.id;
|
||||
}
|
||||
return cell;
|
||||
}));
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
}
|
||||
|
||||
class ListBoxWrapper extends ComponentWrapper implements azdata.ListBoxComponent {
|
||||
|
||||
Reference in New Issue
Block a user