projects/rebirth-ng/src/lib/popover/popover-popup.component.ts
host | { |
selector | re-popover-popup |
templateUrl | ./popover-popup.component.html |
Properties |
|
Methods |
Inputs |
HostListeners |
constructor(elementRef: ElementRef, renderer: Renderer2, changeDetectorRef: ChangeDetectorRef)
|
||||||||||||
Parameters :
|
title
|
Type: |
content
|
Type: |
Inherited from
TooltipPopup
|
|
Defined in TooltipPopup:8
|
context
|
Type: |
Inherited from
TooltipPopup
|
|
Defined in TooltipPopup:9
|
cssClass
|
Type: |
Inherited from
TooltipPopup
|
|
Defined in TooltipPopup:10
|
placement
|
Type:
Default value: |
Inherited from
TooltipPopup
|
|
Defined in TooltipPopup:7
|
click |
Arguments : '$event'
|
click($event: Event)
|
Inherited from
TooltipPopup
|
Defined in TooltipPopup:18
|
afterVisibilityAnimation | ||||||
afterVisibilityAnimation(e: AnimationEvent)
|
||||||
Inherited from
TooltipPopup
|
||||||
Defined in TooltipPopup:45
|
||||||
Parameters :
Returns :
void
|
hide |
hide()
|
Inherited from
TooltipPopup
|
Defined in TooltipPopup:35
|
Returns :
void
|
isTemplateRef | ||||
isTemplateRef(obj: )
|
||||
Inherited from
TooltipPopup
|
||||
Defined in TooltipPopup:52
|
||||
Parameters :
Returns :
boolean
|
show |
show()
|
Inherited from
TooltipPopup
|
Defined in TooltipPopup:22
|
Returns :
void
|
Static ACTIVE_CLASS |
ACTIVE_CLASS:
|
Type : string
|
Default value : 'in'
|
Inherited from
TooltipPopup
|
Defined in TooltipPopup:6
|
animateState |
animateState:
|
Type : string
|
Default value : 'initial'
|
Inherited from
TooltipPopup
|
Defined in TooltipPopup:12
|
isOpen |
isOpen:
|
Type : boolean
|
Inherited from
TooltipPopup
|
Defined in TooltipPopup:11
|
import { Component, Renderer2, ElementRef, Input, TemplateRef, ChangeDetectorRef } from '@angular/core';
import { TooltipPopup } from '../tooltip/tooltip-popup';
import { trigger, state, style, animate, transition } from '@angular/animations';
@Component({
selector: 're-popover-popup',
templateUrl: './popover-popup.component.html',
host: {
'[class]': '"popover fade " + placement',
'style': 'display:none;',
'role': 'tooltip',
'[@state]': 'animateState',
'(@state.done)': 'afterVisibilityAnimation($event)'
},
animations: [
trigger('state', [
state('void', style({ transform: 'scale(0)' })),
state('initial', style({ transform: 'scale(0)' })),
state('visible', style({ transform: 'scale(1)' })),
state('hidden', style({ transform: 'scale(0)' })),
transition('* => visible', animate('150ms cubic-bezier(0.0, 0.0, 0.2, 1)')),
transition('* => hidden', animate('150ms cubic-bezier(0.4, 0.0, 1, 1)')),
])
]
})
export class PopoverPopupComponent extends TooltipPopup {
@Input() title: string | TemplateRef<any>;
constructor(elementRef: ElementRef, renderer: Renderer2, changeDetectorRef: ChangeDetectorRef) {
super(elementRef, renderer, changeDetectorRef);
}
}
<div class="arrow"></div>
<h3 class="popover-title" *ngIf="title">
<span *ngIf="!isTemplateRef(title)" [innerHTML]="title"></span>
<ng-template *ngIf="isTemplateRef(title)" [ngTemplateOutlet]="title"
[ngTemplateOutletContext]="{ $implicit: context }"></ng-template>
</h3>
<div class="popover-content">
<span *ngIf="!isTemplateRef(content)" [innerHTML]="content"></span>
<ng-template *ngIf="isTemplateRef(content)" [ngTemplateOutlet]="content"
[ngTemplateOutletContext]="{ $implicit: context }"></ng-template>
</div>