mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
fall back to the old text component behavior... (#7405)
* fall back to the old text component behavior... if no required indicator and description is needed, fall back to the old text component behavior. * Update text.component.ts indention
This commit is contained in:
@@ -18,13 +18,16 @@ import { TitledComponent } from 'sql/workbench/browser/modelComponents/titledCom
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'modelview-text',
|
selector: 'modelview-text',
|
||||||
template: `
|
template: `
|
||||||
<div style="display:flex;flex-flow:row;align-items:center;" [style.width]="getWidth()">
|
<div *ngIf="showDiv;else noDiv" style="display:flex;flex-flow:row;align-items:center;" [style.width]="getWidth()">
|
||||||
<p [innerHTML]="getValue()" [title]="title" [ngStyle]="this.CSSStyles" (click)="onClick()"></p>
|
<p [innerHTML]="getValue()" [title]="title" [ngStyle]="this.CSSStyles" (click)="onClick()"></p>
|
||||||
<p *ngIf="requiredIndicator" style="color:red;margin-left:5px;">*</p>
|
<p *ngIf="requiredIndicator" style="color:red;margin-left:5px;">*</p>
|
||||||
<div *ngIf="description" tabindex="0" class="modelview-text-tooltip" [attr.aria-label]="description">
|
<div *ngIf="description" tabindex="0" class="modelview-text-tooltip" [attr.aria-label]="description">
|
||||||
<div class="modelview-text-tooltip-content" [innerHTML]="description"></div>
|
<div class="modelview-text-tooltip-content" [innerHTML]="description"></div>
|
||||||
</div>
|
</div>
|
||||||
<div>`
|
</div>
|
||||||
|
<ng-template #noDiv>
|
||||||
|
<p [style.width]="getWidth()" [innerHTML]="getValue()" [ngStyle]="this.CSSStyles" (click)="onClick()"></p>
|
||||||
|
</ng-template>`
|
||||||
})
|
})
|
||||||
export default class TextComponent extends TitledComponent implements IComponent, OnDestroy, AfterViewInit {
|
export default class TextComponent extends TitledComponent implements IComponent, OnDestroy, AfterViewInit {
|
||||||
@Input() descriptor: IComponentDescriptor;
|
@Input() descriptor: IComponentDescriptor;
|
||||||
@@ -92,6 +95,10 @@ export default class TextComponent extends TitledComponent implements IComponent
|
|||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get showDiv(): boolean {
|
||||||
|
return this.requiredIndicator || !!this.description;
|
||||||
|
}
|
||||||
|
|
||||||
private onClick() {
|
private onClick() {
|
||||||
this.fireEvent({
|
this.fireEvent({
|
||||||
eventType: ComponentEventType.onDidClick,
|
eventType: ComponentEventType.onDidClick,
|
||||||
|
|||||||
Reference in New Issue
Block a user