ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
16 lines (14 loc) • 8.37 kB
JavaScript
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("ng-zorro-antd/core/util"),require("ng-zorro-antd/core/config"),require("rxjs"),require("rxjs/operators"),require("@angular/common"),require("ng-zorro-antd/core/outlet")):"function"==typeof define&&define.amd?define("ng-zorro-antd/card",["exports","@angular/core","ng-zorro-antd/core/util","ng-zorro-antd/core/config","rxjs","rxjs/operators","@angular/common","ng-zorro-antd/core/outlet"],t):t(((n=n||self)["ng-zorro-antd"]=n["ng-zorro-antd"]||{},n["ng-zorro-antd"].card={}),n.ng.core,n["ng-zorro-antd"].core.util,n["ng-zorro-antd"].core.config,n.rxjs,n.rxjs.operators,n.ng.common,n["ng-zorro-antd"].core.outlet)}(this,(function(n,t,e,a,o,r,i,c){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */function l(n,t,e,a){var o,r=arguments.length,i=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,e):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(n,t,e,a);else for(var c=n.length-1;c>=0;c--)(o=n[c])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i}function s(n,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,t)}var d=function(){function n(){this.nzHoverable=!0}return n.decorators=[{type:t.Directive,args:[{selector:"[nz-card-grid]",exportAs:"nzCardGrid",host:{"[class.ant-card-grid]":"true","[class.ant-card-hoverable]":"nzHoverable"}}]}],n.propDecorators={nzHoverable:[{type:t.Input}]},l([e.InputBoolean(),s("design:type",Object)],n.prototype,"nzHoverable",void 0),n}();var p=function(){function n(){}return n.decorators=[{type:t.Component,args:[{selector:"nz-card-tab",exportAs:"nzCardTab",encapsulation:t.ViewEncapsulation.None,changeDetection:t.ChangeDetectionStrategy.OnPush,template:"\n <ng-template>\n <ng-content></ng-content>\n </ng-template>\n "}]}],n.propDecorators={template:[{type:t.ViewChild,args:[t.TemplateRef,{static:!0}]}]},n}();var g=function(){function n(n,t){var e=this;this.nzConfigService=n,this.cdr=t,this.nzLoading=!1,this.nzActions=[],this.nzType=null,this.destroy$=new o.Subject,this.nzConfigService.getConfigChangeEventForComponent("card").pipe(r.takeUntil(this.destroy$)).subscribe((function(){e.cdr.markForCheck()}))}return n.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},n.decorators=[{type:t.Component,args:[{selector:"nz-card",exportAs:"nzCard",preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None,template:'\n <div class="ant-card-head" *ngIf="nzTitle || nzExtra || listOfNzCardTabComponent">\n <div class="ant-card-head-wrapper">\n <div class="ant-card-head-title" *ngIf="nzTitle">\n <ng-container *nzStringTemplateOutlet="nzTitle">{{ nzTitle }}</ng-container>\n </div>\n <div class="ant-card-extra" *ngIf="nzExtra">\n <ng-container *nzStringTemplateOutlet="nzExtra">{{ nzExtra }}</ng-container>\n </div>\n </div>\n <ng-container *ngIf="listOfNzCardTabComponent">\n <ng-template [ngTemplateOutlet]="listOfNzCardTabComponent.template"></ng-template>\n </ng-container>\n </div>\n <div class="ant-card-cover" *ngIf="nzCover">\n <ng-template [ngTemplateOutlet]="nzCover"></ng-template>\n </div>\n <div class="ant-card-body" [ngStyle]="nzBodyStyle">\n <ng-container *ngIf="!nzLoading; else loadingTemplate">\n <ng-content></ng-content>\n </ng-container>\n <ng-template #loadingTemplate>\n <nz-card-loading></nz-card-loading>\n </ng-template>\n </div>\n <ul class="ant-card-actions" *ngIf="nzActions.length">\n <li *ngFor="let action of nzActions" [style.width.%]="100 / nzActions.length">\n <span><ng-template [ngTemplateOutlet]="action"></ng-template></span>\n </li>\n </ul>\n ',host:{"[class.ant-card]":"true","[class.ant-card-loading]":"nzLoading","[class.ant-card-bordered]":"nzBordered","[class.ant-card-hoverable]":"nzHoverable","[class.ant-card-small]":'nzSize === "small"',"[class.ant-card-contain-grid]":"listOfNzCardGridDirective && listOfNzCardGridDirective.length","[class.ant-card-type-inner]":'nzType === "inner"',"[class.ant-card-contain-tabs]":"!!listOfNzCardTabComponent"}}]}],n.ctorParameters=function(){return[{type:a.NzConfigService},{type:t.ChangeDetectorRef}]},n.propDecorators={nzBordered:[{type:t.Input}],nzLoading:[{type:t.Input}],nzHoverable:[{type:t.Input}],nzBodyStyle:[{type:t.Input}],nzCover:[{type:t.Input}],nzActions:[{type:t.Input}],nzType:[{type:t.Input}],nzSize:[{type:t.Input}],nzTitle:[{type:t.Input}],nzExtra:[{type:t.Input}],listOfNzCardTabComponent:[{type:t.ContentChild,args:[p,{static:!1}]}],listOfNzCardGridDirective:[{type:t.ContentChildren,args:[d]}]},l([a.WithConfig("card",!0),e.InputBoolean(),s("design:type",Boolean)],n.prototype,"nzBordered",void 0),l([e.InputBoolean(),s("design:type",Object)],n.prototype,"nzLoading",void 0),l([a.WithConfig("card",!1),e.InputBoolean(),s("design:type",Boolean)],n.prototype,"nzHoverable",void 0),l([a.WithConfig("card","default"),s("design:type",String)],n.prototype,"nzSize",void 0),n}();var u=function(){function n(){this.listOfLoading=[["ant-col-22"],["ant-col-8","ant-col-15"],["ant-col-6","ant-col-18"],["ant-col-13","ant-col-9"],["ant-col-4","ant-col-3","ant-col-16"],["ant-col-8","ant-col-6","ant-col-8"]]}return n.decorators=[{type:t.Component,args:[{selector:"nz-card-loading",exportAs:"nzCardLoading",template:'\n <div class="ant-card-loading-content">\n <div class="ant-row" style="margin-left: -4px; margin-right: -4px;" *ngFor="let listOfClassName of listOfLoading">\n <div *ngFor="let className of listOfClassName" [ngClass]="className" style="padding-left: 4px; padding-right: 4px;">\n <div class="ant-card-loading-block"></div>\n </div>\n </div>\n </div>\n ',preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None,host:{"[class.ant-card-loading-content]":"true"}}]}],n.ctorParameters=function(){return[]},n}();var z=function(){function n(){this.nzTitle=null,this.nzDescription=null,this.nzAvatar=null}return n.decorators=[{type:t.Component,args:[{selector:"nz-card-meta",exportAs:"nzCardMeta",preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None,template:'\n <div class="ant-card-meta-avatar" *ngIf="nzAvatar">\n <ng-template [ngTemplateOutlet]="nzAvatar"></ng-template>\n </div>\n <div class="ant-card-meta-detail" *ngIf="nzTitle || nzDescription">\n <div class="ant-card-meta-title" *ngIf="nzTitle">\n <ng-container *nzStringTemplateOutlet="nzTitle">{{ nzTitle }}</ng-container>\n </div>\n <div class="ant-card-meta-description" *ngIf="nzDescription">\n <ng-container *nzStringTemplateOutlet="nzDescription">{{ nzDescription }}</ng-container>\n </div>\n </div>\n ',host:{"[class.ant-card-meta]":"true"}}]}],n.propDecorators={nzTitle:[{type:t.Input}],nzDescription:[{type:t.Input}],nzAvatar:[{type:t.Input}]},n}();var f=function(){function n(){}return n.decorators=[{type:t.NgModule,args:[{imports:[i.CommonModule,c.NzOutletModule],declarations:[g,d,z,u,p],exports:[g,d,z,u,p]}]}],n}();n.NzCardComponent=g,n.NzCardGridDirective=d,n.NzCardLoadingComponent=u,n.NzCardMetaComponent=z,n.NzCardModule=f,n.NzCardTabComponent=p,Object.defineProperty(n,"__esModule",{value:!0})}));
//# sourceMappingURL=ng-zorro-antd-card.umd.min.js.map