UNPKG

ng-zorro-antd

Version:

An enterprise-class UI components based on Ant Design and Angular

217 lines (210 loc) 7.09 kB
import { CommonModule } from '@angular/common'; import { Directive, ComponentFactoryResolver, ViewContainerRef, Input, Component, ViewEncapsulation, ChangeDetectionStrategy, ViewChild, TemplateRef, ContentChildren, NgModule } from '@angular/core'; import { NzOutletModule } from 'ng-zorro-antd/core/outlet'; import { CdkPortalOutlet, TemplatePortal } from '@angular/cdk/portal'; /** * @fileoverview added by tsickle * Generated from: comment-cells.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class NzCommentAvatarDirective { } NzCommentAvatarDirective.decorators = [ { type: Directive, args: [{ selector: 'nz-avatar[nz-comment-avatar]', exportAs: 'nzCommentAvatar' },] } ]; class NzCommentContentDirective { } NzCommentContentDirective.decorators = [ { type: Directive, args: [{ selector: 'nz-comment-content, [nz-comment-content]', exportAs: 'nzCommentContent', host: { class: 'ant-comment-content-detail' } },] } ]; class NzCommentActionHostDirective extends CdkPortalOutlet { /** * @param {?} componentFactoryResolver * @param {?} viewContainerRef */ constructor(componentFactoryResolver, viewContainerRef) { super(componentFactoryResolver, viewContainerRef); } /** * @return {?} */ ngOnInit() { super.ngOnInit(); } /** * @return {?} */ ngOnDestroy() { super.ngOnDestroy(); } /** * @return {?} */ ngAfterViewInit() { this.attach(this.nzCommentActionHost); } } NzCommentActionHostDirective.decorators = [ { type: Directive, args: [{ selector: '[nzCommentActionHost]', exportAs: 'nzCommentActionHost' },] } ]; /** @nocollapse */ NzCommentActionHostDirective.ctorParameters = () => [ { type: ComponentFactoryResolver }, { type: ViewContainerRef } ]; NzCommentActionHostDirective.propDecorators = { nzCommentActionHost: [{ type: Input }] }; if (false) { /** @type {?} */ NzCommentActionHostDirective.prototype.nzCommentActionHost; } class NzCommentActionComponent { /** * @param {?} viewContainerRef */ constructor(viewContainerRef) { this.viewContainerRef = viewContainerRef; this.contentPortal = null; } /** * @return {?} */ get content() { return this.contentPortal; } /** * @return {?} */ ngOnInit() { this.contentPortal = new TemplatePortal(this.implicitContent, this.viewContainerRef); } } NzCommentActionComponent.decorators = [ { type: Component, args: [{ selector: 'nz-comment-action', exportAs: 'nzCommentAction', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: '<ng-template><ng-content></ng-content></ng-template>' }] } ]; /** @nocollapse */ NzCommentActionComponent.ctorParameters = () => [ { type: ViewContainerRef } ]; NzCommentActionComponent.propDecorators = { implicitContent: [{ type: ViewChild, args: [TemplateRef, { static: true },] }] }; if (false) { /** @type {?} */ NzCommentActionComponent.prototype.implicitContent; /** * @type {?} * @private */ NzCommentActionComponent.prototype.contentPortal; /** * @type {?} * @private */ NzCommentActionComponent.prototype.viewContainerRef; } /** * @fileoverview added by tsickle * Generated from: comment.component.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class NzCommentComponent { constructor() { } } NzCommentComponent.decorators = [ { type: Component, args: [{ selector: 'nz-comment', exportAs: 'nzComment', template: ` <div class="ant-comment-inner"> <div class="ant-comment-avatar"> <ng-content select="nz-avatar[nz-comment-avatar]"></ng-content> </div> <div class="ant-comment-content"> <div class="ant-comment-content-author"> <span *ngIf="nzAuthor" class="ant-comment-content-author-name"> <ng-container *nzStringTemplateOutlet="nzAuthor">{{ nzAuthor }}</ng-container> </span> <span *ngIf="nzDatetime" class="ant-comment-content-author-time"> <ng-container *nzStringTemplateOutlet="nzDatetime">{{ nzDatetime }}</ng-container> </span> </div> <ng-content select="nz-comment-content"></ng-content> <ul class="ant-comment-actions" *ngIf="actions?.length"> <li *ngFor="let action of actions"> <span><ng-template [nzCommentActionHost]="action.content"></ng-template></span> </li> </ul> </div> </div> <div class="ant-comment-nested"> <ng-content></ng-content> </div> `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'ant-comment' } }] } ]; /** @nocollapse */ NzCommentComponent.ctorParameters = () => []; NzCommentComponent.propDecorators = { nzAuthor: [{ type: Input }], nzDatetime: [{ type: Input }], actions: [{ type: ContentChildren, args: [NzCommentActionComponent,] }] }; if (false) { /** @type {?} */ NzCommentComponent.prototype.nzAuthor; /** @type {?} */ NzCommentComponent.prototype.nzDatetime; /** @type {?} */ NzCommentComponent.prototype.actions; } /** * @fileoverview added by tsickle * Generated from: comment.module.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** @type {?} */ const NZ_COMMENT_CELLS = [NzCommentAvatarDirective, NzCommentContentDirective, NzCommentActionComponent, NzCommentActionHostDirective]; class NzCommentModule { } NzCommentModule.decorators = [ { type: NgModule, args: [{ imports: [CommonModule, NzOutletModule], exports: [NzCommentComponent, ...NZ_COMMENT_CELLS], declarations: [NzCommentComponent, ...NZ_COMMENT_CELLS] },] } ]; /** * @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-comment.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ export { NzCommentActionComponent, NzCommentActionHostDirective, NzCommentAvatarDirective, NzCommentComponent, NzCommentContentDirective, NzCommentModule }; //# sourceMappingURL=ng-zorro-antd-comment.js.map