ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
179 lines (173 loc) • 6.63 kB
JavaScript
import { Directive, ElementRef, ViewContainerRef, ComponentFactoryResolver, Renderer2, Host, Optional, Input, Component, ChangeDetectionStrategy, ViewEncapsulation, ChangeDetectorRef, NgModule } from '@angular/core';
import { zoomBigMotion } from 'ng-zorro-antd/core/animation';
import { NzNoAnimationDirective, NzNoAnimationModule } from 'ng-zorro-antd/core/no-animation';
import { NzTooltipBaseDirective, NzToolTipComponent, isTooltipEmpty, NzToolTipModule } from 'ng-zorro-antd/tooltip';
import { OverlayModule } from '@angular/cdk/overlay';
import { CommonModule } from '@angular/common';
import { NzOutletModule } from 'ng-zorro-antd/core/outlet';
import { NzOverlayModule } from 'ng-zorro-antd/core/overlay';
/**
* @fileoverview added by tsickle
* Generated from: popover.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzPopoverDirective extends NzTooltipBaseDirective {
/**
* @param {?} elementRef
* @param {?} hostView
* @param {?} resolver
* @param {?} renderer
* @param {?=} noAnimation
*/
constructor(elementRef, hostView, resolver, renderer, noAnimation) {
super(elementRef, hostView, resolver, renderer, noAnimation);
this.noAnimation = noAnimation;
this.componentFactory = this.resolver.resolveComponentFactory(NzPopoverComponent);
}
}
NzPopoverDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-popover]',
exportAs: 'nzPopover',
host: {
'[class.ant-popover-open]': 'visible'
}
},] }
];
/** @nocollapse */
NzPopoverDirective.ctorParameters = () => [
{ type: ElementRef },
{ type: ViewContainerRef },
{ type: ComponentFactoryResolver },
{ type: Renderer2 },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
NzPopoverDirective.propDecorators = {
specificTitle: [{ type: Input, args: ['nzPopoverTitle',] }],
specificContent: [{ type: Input, args: ['nzPopoverContent',] }],
directiveNameTitle: [{ type: Input, args: ['nz-popover',] }],
specificTrigger: [{ type: Input, args: ['nzPopoverTrigger',] }],
specificPlacement: [{ type: Input, args: ['nzPopoverPlacement',] }],
specificOrigin: [{ type: Input, args: ['nzPopoverOrigin',] }]
};
if (false) {
/** @type {?} */
NzPopoverDirective.prototype.specificTitle;
/** @type {?} */
NzPopoverDirective.prototype.specificContent;
/** @type {?} */
NzPopoverDirective.prototype.directiveNameTitle;
/** @type {?} */
NzPopoverDirective.prototype.specificTrigger;
/** @type {?} */
NzPopoverDirective.prototype.specificPlacement;
/** @type {?} */
NzPopoverDirective.prototype.specificOrigin;
/** @type {?} */
NzPopoverDirective.prototype.componentFactory;
/** @type {?} */
NzPopoverDirective.prototype.noAnimation;
}
class NzPopoverComponent extends NzToolTipComponent {
/**
* @param {?} cdr
* @param {?=} noAnimation
*/
constructor(cdr, noAnimation) {
super(cdr, noAnimation);
this.noAnimation = noAnimation;
this._prefix = 'ant-popover-placement';
}
/**
* @protected
* @return {?}
*/
isEmpty() {
return isTooltipEmpty(this.nzTitle) && isTooltipEmpty(this.nzContent);
}
}
NzPopoverComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-popover',
exportAs: 'nzPopoverComponent',
animations: [zoomBigMotion],
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
preserveWhitespaces: false,
template: `
<ng-template
#overlay="cdkConnectedOverlay"
cdkConnectedOverlay
nzConnectedOverlay
[cdkConnectedOverlayOrigin]="origin"
[cdkConnectedOverlayHasBackdrop]="_hasBackdrop"
(backdropClick)="hide()"
(detach)="hide()"
(positionChange)="onPositionChange($event)"
[cdkConnectedOverlayPositions]="_positions"
[cdkConnectedOverlayOpen]="_visible"
>
<div
class="ant-popover"
[ngClass]="_classMap"
[ngStyle]="nzOverlayStyle"
[@.disabled]="noAnimation?.nzNoAnimation"
[nzNoAnimation]="noAnimation?.nzNoAnimation"
[]="'active'"
>
<div class="ant-popover-content">
<div class="ant-popover-arrow"></div>
<div class="ant-popover-inner" role="tooltip">
<div>
<div class="ant-popover-title" *ngIf="nzTitle">
<ng-container *nzStringTemplateOutlet="nzTitle">{{ nzTitle }}</ng-container>
</div>
<div class="ant-popover-inner-content">
<ng-container *nzStringTemplateOutlet="nzContent">{{ nzContent }}</ng-container>
</div>
</div>
</div>
</div>
</div>
</ng-template>
`
}] }
];
/** @nocollapse */
NzPopoverComponent.ctorParameters = () => [
{ type: ChangeDetectorRef },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
if (false) {
/** @type {?} */
NzPopoverComponent.prototype._prefix;
/** @type {?} */
NzPopoverComponent.prototype.noAnimation;
}
/**
* @fileoverview added by tsickle
* Generated from: popover.module.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzPopoverModule {
}
NzPopoverModule.decorators = [
{ type: NgModule, args: [{
exports: [NzPopoverDirective, NzPopoverComponent],
entryComponents: [NzPopoverComponent],
declarations: [NzPopoverDirective, NzPopoverComponent],
imports: [CommonModule, OverlayModule, NzOutletModule, NzOverlayModule, NzNoAnimationModule, NzToolTipModule]
},] }
];
/**
* @fileoverview added by tsickle
* Generated from: public-api.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* Generated from: ng-zorro-antd-popover.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
export { NzPopoverComponent, NzPopoverDirective, NzPopoverModule };
//# sourceMappingURL=ng-zorro-antd-popover.js.map