mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
fix theming issue in table widget (#1391)
This commit is contained in:
@@ -6,24 +6,31 @@ import { Component, Input, Inject, ChangeDetectorRef, forwardRef, ElementRef, On
|
|||||||
|
|
||||||
import { getContentHeight, getContentWidth } from 'vs/base/browser/dom';
|
import { getContentHeight, getContentWidth } from 'vs/base/browser/dom';
|
||||||
import { Dimension } from 'vs/base/browser/builder';
|
import { Dimension } from 'vs/base/browser/builder';
|
||||||
|
import { Disposable } from 'vs/base/common/lifecycle';
|
||||||
|
|
||||||
import { IInsightsView, IInsightData } from 'sql/parts/dashboard/widgets/insights/interfaces';
|
import { IInsightsView, IInsightData } from 'sql/parts/dashboard/widgets/insights/interfaces';
|
||||||
import { Table } from 'sql/base/browser/ui/table/table';
|
import { Table } from 'sql/base/browser/ui/table/table';
|
||||||
import { TableDataView } from 'sql/base/browser/ui/table/tableDataView';
|
import { TableDataView } from 'sql/base/browser/ui/table/tableDataView';
|
||||||
import { DragCellSelectionModel } from 'sql/base/browser/ui/table/plugins/dragCellSelectionModel.plugin';
|
import { DragCellSelectionModel } from 'sql/base/browser/ui/table/plugins/dragCellSelectionModel.plugin';
|
||||||
|
import { attachTableStyler} from 'sql/common/theme/styler';
|
||||||
|
import { CommonServiceInterface } from 'sql/services/common/commonServiceInterface.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
template: '<span></span>'
|
template: '<span></span>'
|
||||||
})
|
})
|
||||||
export default class TableInsight implements IInsightsView, OnInit {
|
export default class TableInsight extends Disposable implements IInsightsView, OnInit {
|
||||||
private table: Table<any>;
|
private table: Table<any>;
|
||||||
private dataView: TableDataView<any>;
|
private dataView: TableDataView<any>;
|
||||||
private columns: Slick.Column<any>[];
|
private columns: Slick.Column<any>[];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef,
|
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef,
|
||||||
@Inject(forwardRef(() => ElementRef)) private _elementRef: ElementRef
|
@Inject(forwardRef(() => ElementRef)) private _elementRef: ElementRef,
|
||||||
) { }
|
@Inject(forwardRef(() => CommonServiceInterface)) private _bootstrap: CommonServiceInterface,
|
||||||
|
) {
|
||||||
|
super();
|
||||||
|
this._elementRef.nativeElement.className = 'slickgridContainer';
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.createTable();
|
this.createTable();
|
||||||
@@ -58,6 +65,7 @@ export default class TableInsight implements IInsightsView, OnInit {
|
|||||||
if (!this.table) {
|
if (!this.table) {
|
||||||
this.table = new Table(this._elementRef.nativeElement, this.dataView, this.columns, { showRowNumber: true });
|
this.table = new Table(this._elementRef.nativeElement, this.dataView, this.columns, { showRowNumber: true });
|
||||||
this.table.setSelectionModel(new DragCellSelectionModel());
|
this.table.setSelectionModel(new DragCellSelectionModel());
|
||||||
|
this._register(attachTableStyler(this.table, this._bootstrap.themeService));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user