add css styling for text component (#5491)

This commit is contained in:
kisantia
2019-05-17 14:17:14 -07:00
committed by GitHub
parent 8ea831c845
commit 1fce604a11
3 changed files with 6 additions and 3 deletions

View File

@@ -95,11 +95,13 @@ export class SchemaCompareResult {
}]);
let sourceLabel = view.modelBuilder.text().withProperties({
value: localize('schemaCompare.sourceLabel', 'Source')
value: localize('schemaCompare.sourceLabel', 'Source'),
CSSStyles: { 'margin-bottom': '0px' }
}).component();
let targetLabel = view.modelBuilder.text().withProperties({
value: localize('schemaCompare.targetLabel', 'Target')
value: localize('schemaCompare.targetLabel', 'Target'),
CSSStyles: { 'margin-bottom': '0px' }
}).component();
let arrowLabel = view.modelBuilder.text().withProperties({

View File

@@ -3165,6 +3165,7 @@ declare module 'azdata' {
export interface TextComponentProperties {
value?: string;
links?: LinkArea[];
CSSStyles?: { [key: string]: string };
}
export interface LinkArea {

View File

@@ -18,7 +18,7 @@ import { SafeHtml, DomSanitizer } from '@angular/platform-browser';
@Component({
selector: 'modelview-text',
template: `
<p [style.width]="getWidth()" [innerHTML]="getValue()"></p>`
<p [style.width]="getWidth()" [innerHTML]="getValue()" [ngStyle]="this.CSSStyles"></p>`
})
export default class TextComponent extends ComponentBase implements IComponent, OnDestroy, AfterViewInit {
@Input() descriptor: IComponentDescriptor;