apply css style at the right element (#14144)

* apply css style at the right element

* make mergeCss protected
This commit is contained in:
Alan Ren
2021-02-03 10:27:12 -08:00
committed by GitHub
parent b390052c86
commit 52a642f351
26 changed files with 155 additions and 58 deletions

View File

@@ -55,7 +55,7 @@ type TableCellDataType = string | CssIconCellValue | ButtonCellValue | Hyperlink
@Component({
selector: 'modelview-table',
template: `
<div #table style="height:100%;" [style.font-size]="fontSize" [style.width]="width"></div>
<div #table [ngStyle]="CSSStyles"></div>
`
})
export default class TableComponent extends ComponentBase<azdata.TableComponentProperties> implements IComponent, OnDestroy, AfterViewInit {
@@ -621,4 +621,12 @@ export default class TableComponent extends ComponentBase<azdata.TableComponentP
this._table.grid.getActiveCellNode().focus();
}
}
public get CSSStyles(): azdata.CssStyles {
return this.mergeCss(super.CSSStyles, {
'width': this.getWidth(),
'height': '100%',
'font-size': this.fontSize
});
}
}