UNPKG

ng-zorro-antd

Version:

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

16 lines (14 loc) • 10.3 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/cdk/platform"),require("ng-zorro-antd/core/services"),require("ng-zorro-antd/core/util"),require("ng-zorro-antd/menu"),require("rxjs"),require("rxjs/operators"),require("@angular/cdk/layout"),require("@angular/common"),require("ng-zorro-antd/icon")):"function"==typeof define&&define.amd?define("ng-zorro-antd/layout",["exports","@angular/core","@angular/cdk/platform","ng-zorro-antd/core/services","ng-zorro-antd/core/util","ng-zorro-antd/menu","rxjs","rxjs/operators","@angular/cdk/layout","@angular/common","ng-zorro-antd/icon"],t):t(((e=e||self)["ng-zorro-antd"]=e["ng-zorro-antd"]||{},e["ng-zorro-antd"].layout={}),e.ng.core,e.ng.cdk.platform,e["ng-zorro-antd"].core.services,e["ng-zorro-antd"].core.util,e["ng-zorro-antd"].menu,e.rxjs,e.rxjs.operators,e.ng.cdk.layout,e.ng.common,e["ng-zorro-antd"].icon)}(this,(function(e,t,n,r,o,i,a,s,l,p,d){"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 c(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function g(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}var u=function(){function e(e,t){this.elementRef=e,this.renderer=t,this.renderer.addClass(this.elementRef.nativeElement,"ant-layout-content")}return e.decorators=[{type:t.Component,args:[{selector:"nz-content",exportAs:"nzContent",preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None,template:"\n <ng-content></ng-content>\n "}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},e}();var h=function(){function e(e,t){this.elementRef=e,this.renderer=t,this.renderer.addClass(this.elementRef.nativeElement,"ant-layout-footer")}return e.decorators=[{type:t.Component,args:[{selector:"nz-footer",exportAs:"nzFooter",preserveWhitespaces:!1,encapsulation:t.ViewEncapsulation.None,changeDetection:t.ChangeDetectionStrategy.OnPush,template:"\n <ng-content></ng-content>\n "}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},e}();var z=function(){function e(e,t){this.elementRef=e,this.renderer=t,this.renderer.addClass(this.elementRef.nativeElement,"ant-layout-header")}return e.decorators=[{type:t.Component,args:[{selector:"nz-header",exportAs:"nzHeader",changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None,preserveWhitespaces:!1,template:"\n <ng-content></ng-content>\n "}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},e}();var y=function(){function e(e,n,r){this.platform=e,this.cdr=n,this.breakpointService=r,this.destroy$=new a.Subject,this.nzMenuDirective=null,this.nzCollapsedChange=new t.EventEmitter,this.nzWidth=200,this.nzTheme="dark",this.nzCollapsedWidth=80,this.nzBreakpoint=null,this.nzZeroTrigger=null,this.nzTrigger=void 0,this.nzReverseArrow=!1,this.nzCollapsible=!1,this.nzCollapsed=!1,this.matchBreakPoint=!1,this.flexSetting=null,this.widthSetting=null}return e.prototype.updateStyleMap=function(){this.widthSetting=this.nzCollapsed?this.nzCollapsedWidth+"px":o.toCssPixel(this.nzWidth),this.flexSetting="0 0 "+this.widthSetting,this.cdr.markForCheck()},e.prototype.updateMenuInlineCollapsed=function(){this.nzMenuDirective&&"inline"===this.nzMenuDirective.nzMode&&0!==this.nzCollapsedWidth&&this.nzMenuDirective.setInlineCollapsed(this.nzCollapsed)},e.prototype.setCollapsed=function(e){e!==this.nzCollapsed&&(this.nzCollapsed=e,this.nzCollapsedChange.emit(e),this.updateMenuInlineCollapsed(),this.updateStyleMap(),this.cdr.markForCheck())},e.prototype.ngOnInit=function(){var e=this;this.updateStyleMap(),this.platform.isBrowser&&this.breakpointService.subscribe(r.siderResponsiveMap,!0).pipe(s.takeUntil(this.destroy$)).subscribe((function(t){var n=e.nzBreakpoint;n&&o.inNextTick().subscribe((function(){e.matchBreakPoint=!t[n],e.setCollapsed(e.matchBreakPoint),e.cdr.markForCheck()}))}))},e.prototype.ngOnChanges=function(e){var t=e.nzCollapsed,n=e.nzCollapsedWidth,r=e.nzWidth;(t||n||r)&&this.updateStyleMap(),t&&this.updateMenuInlineCollapsed()},e.prototype.ngAfterContentInit=function(){this.updateMenuInlineCollapsed()},e.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},e.decorators=[{type:t.Component,args:[{selector:"nz-sider",exportAs:"nzSider",preserveWhitespaces:!1,encapsulation:t.ViewEncapsulation.None,changeDetection:t.ChangeDetectionStrategy.OnPush,template:'\n <div class="ant-layout-sider-children">\n <ng-content></ng-content>\n </div>\n <div\n *ngIf="nzCollapsible && nzTrigger !== null"\n nz-sider-trigger\n [matchBreakPoint]="matchBreakPoint"\n [nzCollapsedWidth]="nzCollapsedWidth"\n [nzCollapsed]="nzCollapsed"\n [nzBreakpoint]="nzBreakpoint"\n [nzReverseArrow]="nzReverseArrow"\n [nzTrigger]="nzTrigger"\n [nzZeroTrigger]="nzZeroTrigger"\n [siderWidth]="widthSetting"\n (click)="setCollapsed(!nzCollapsed)"\n ></div>\n ',host:{"[class.ant-layout-sider]":"true","[class.ant-layout-sider-zero-width]":"nzCollapsed && nzCollapsedWidth === 0","[class.ant-layout-sider-light]":"nzTheme === 'light'","[class.ant-layout-sider-dark]":"nzTheme === 'dark'","[class.ant-layout-sider-collapsed]":"nzCollapsed","[style.flex]":"flexSetting","[style.maxWidth]":"widthSetting","[style.minWidth]":"widthSetting","[style.width]":"widthSetting"}}]}],e.ctorParameters=function(){return[{type:n.Platform},{type:t.ChangeDetectorRef},{type:r.NzBreakpointService}]},e.propDecorators={nzMenuDirective:[{type:t.ContentChild,args:[i.NzMenuDirective]}],nzCollapsedChange:[{type:t.Output}],nzWidth:[{type:t.Input}],nzTheme:[{type:t.Input}],nzCollapsedWidth:[{type:t.Input}],nzBreakpoint:[{type:t.Input}],nzZeroTrigger:[{type:t.Input}],nzTrigger:[{type:t.Input}],nzReverseArrow:[{type:t.Input}],nzCollapsible:[{type:t.Input}],nzCollapsed:[{type:t.Input}]},c([o.InputBoolean(),g("design:type",Object)],e.prototype,"nzReverseArrow",void 0),c([o.InputBoolean(),g("design:type",Object)],e.prototype,"nzCollapsible",void 0),c([o.InputBoolean(),g("design:type",Object)],e.prototype,"nzCollapsed",void 0),e}();var f=function(){function e(){}return e.decorators=[{type:t.Component,args:[{selector:"nz-layout",exportAs:"nzLayout",encapsulation:t.ViewEncapsulation.None,changeDetection:t.ChangeDetectionStrategy.OnPush,preserveWhitespaces:!1,template:"\n <ng-content></ng-content>\n ",host:{"[class.ant-layout-has-sider]":"listOfNzSiderComponent.length > 0","[class.ant-layout]":"true"}}]}],e.propDecorators={listOfNzSiderComponent:[{type:t.ContentChildren,args:[y]}]},e}();var m=function(){function e(){this.nzCollapsed=!1,this.nzReverseArrow=!1,this.nzZeroTrigger=null,this.nzTrigger=void 0,this.matchBreakPoint=!1,this.nzCollapsedWidth=null,this.siderWidth=null,this.nzBreakpoint=null,this.isZeroTrigger=!1,this.isNormalTrigger=!1}return e.prototype.updateTriggerType=function(){this.isZeroTrigger=0===this.nzCollapsedWidth&&(this.nzBreakpoint&&this.matchBreakPoint||!this.nzBreakpoint),this.isNormalTrigger=0!==this.nzCollapsedWidth},e.prototype.ngOnInit=function(){this.updateTriggerType()},e.prototype.ngOnChanges=function(){this.updateTriggerType()},e.decorators=[{type:t.Component,args:[{selector:"[nz-sider-trigger]",exportAs:"nzSiderTrigger",preserveWhitespaces:!1,encapsulation:t.ViewEncapsulation.None,changeDetection:t.ChangeDetectionStrategy.OnPush,template:'\n <ng-container *ngIf="isZeroTrigger">\n <ng-template [ngTemplateOutlet]="nzZeroTrigger || defaultZeroTrigger"></ng-template>\n </ng-container>\n <ng-container *ngIf="isNormalTrigger">\n <ng-template [ngTemplateOutlet]="nzTrigger || defaultTrigger"></ng-template>\n </ng-container>\n <ng-template #defaultTrigger>\n <i nz-icon [nzType]="nzCollapsed ? \'right\' : \'left\'" *ngIf="!nzReverseArrow"></i>\n <i nz-icon [nzType]="nzCollapsed ? \'left\' : \'right\'" *ngIf="nzReverseArrow"></i>\n </ng-template>\n <ng-template #defaultZeroTrigger>\n <i nz-icon nzType="bars"></i>\n </ng-template>\n ',host:{"[class.ant-layout-sider-trigger]":"isNormalTrigger","[style.width]":"isNormalTrigger ? siderWidth : null","[class.ant-layout-sider-zero-width-trigger]":"isZeroTrigger","[class.ant-layout-sider-zero-width-trigger-right]":"isZeroTrigger && nzReverseArrow","[class.ant-layout-sider-zero-width-trigger-left]":"isZeroTrigger && !nzReverseArrow"}}]}],e.propDecorators={nzCollapsed:[{type:t.Input}],nzReverseArrow:[{type:t.Input}],nzZeroTrigger:[{type:t.Input}],nzTrigger:[{type:t.Input}],matchBreakPoint:[{type:t.Input}],nzCollapsedWidth:[{type:t.Input}],siderWidth:[{type:t.Input}],nzBreakpoint:[{type:t.Input}]},e}();var C=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{declarations:[f,z,u,h,y,m],exports:[f,z,u,h,y],imports:[p.CommonModule,d.NzIconModule,l.LayoutModule,n.PlatformModule]}]}],e}();e.NzContentComponent=u,e.NzFooterComponent=h,e.NzHeaderComponent=z,e.NzLayoutComponent=f,e.NzLayoutModule=C,e.NzSiderComponent=y,e.ɵNzSiderTriggerComponent=m,Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=ng-zorro-antd-layout.umd.min.js.map