bixi
Version:
企业级中后台前端解决方案
66 lines (62 loc) • 1.69 kB
text/typescript
import {
ChangeDetectionStrategy,
Component,
Input,
TemplateRef,
ViewEncapsulation
} from '@angular/core';
import { IHoverInLabelsEvent, ISafeAny } from './label.type';
export class BixiLabelTooltipComponent {
content: TemplateRef<ISafeAny> | undefined;
tooltip: IHoverInLabelsEvent;
get labels() {
return this.tooltip ? (this.tooltip.data) || [] : [];
}
get sytle() {
if (!this.tooltip) {
return {
width: '0px',
height: '0px'
};
}
return {
top: `${this.tooltip.position.top || 0}px`,
left: `${this.tooltip.position.left || 0}px`,
height: `${this.tooltip.position.height || 0}px`,
width: `${this.tooltip.position.width || 0}px`
};
}
}