UNPKG

@lxlib/seed

Version:

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.1.

16 lines (14 loc) 23.7 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@lxlib/theme"),require("rxjs"),require("@angular/cdk/overlay"),require("@angular/cdk/portal"),require("@angular/common"),require("@angular/router"),require("@lxlib/util"),require("rxjs/operators"),require("ng-zorro-antd/icon"),require("ng-zorro-antd/menu"),require("ng-zorro-antd/tabs")):"function"==typeof define&&define.amd?define("@lxlib/seed/reuse-tab",["exports","@angular/core","@lxlib/theme","rxjs","@angular/cdk/overlay","@angular/cdk/portal","@angular/common","@angular/router","@lxlib/util","rxjs/operators","ng-zorro-antd/icon","ng-zorro-antd/menu","ng-zorro-antd/tabs"],t):t(((e=e||self).lxlib=e.lxlib||{},e.lxlib.seed=e.lxlib.seed||{},e.lxlib.seed["reuse-tab"]={}),e.ng.core,e.lxlib.theme,e.rxjs,e.ng.cdk.overlay,e.ng.cdk.portal,e.ng.common,e.ng.router,e.lxlib.util,e.rxjs.operators,e["ng-zorro-antd/icon"],e["ng-zorro-antd/menu"],e["ng-zorro-antd/tabs"])}(this,(function(e,t,n,i,r,o,s,c,l,a,u,h,p){"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. ***************************************************************************** */var d=function(){return(d=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function f(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var c=e.length-1;c>=0;c--)(r=e[c])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function g(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function b(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(b(arguments[t]));return e}var v=function(){function e(e){this.i18nSrv=e,this.close=new t.EventEmitter}return Object.defineProperty(e.prototype,"i18n",{get:function(){return this._i18n},set:function(e){this._i18n=d(d({},this.i18nSrv.getData("reuseTab")),e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"includeNonCloseable",{get:function(){return this.event.ctrlKey},enumerable:!0,configurable:!0}),e.prototype.notify=function(e){this.close.next({type:e,item:this.item,includeNonCloseable:this.includeNonCloseable})},e.prototype.ngOnInit=function(){this.includeNonCloseable&&(this.item.closable=!0)},e.prototype.click=function(e,t,n){if(e.preventDefault(),e.stopPropagation(),("close"!==t||this.item.closable)&&("closeRight"!==t||!this.item.last)){if(n){if(this.isDisabled(n))return;n.fn(this.item,n)}this.notify(t)}},e.prototype.isDisabled=function(e){return!!e.disabled&&e.disabled(this.item)},e.prototype.closeMenu=function(e){"click"===e.type&&2===e.button||this.notify(null)},e.decorators=[{type:t.Component,args:[{selector:"reuse-tab-context-menu",template:'<ul nz-menu>\n <li nz-menu-item\n (click)="click($event, \'close\')"\n data-type="close"\n [nzDisabled]="!item.closable"\n [innerHTML]="i18n.close"></li>\n <li nz-menu-item\n (click)="click($event, \'closeOther\')"\n data-type="closeOther"\n [innerHTML]="i18n.closeOther"></li>\n <li nz-menu-item\n (click)="click($event, \'closeRight\')"\n data-type="closeRight"\n [nzDisabled]="item.last"\n [innerHTML]="i18n.closeRight"></li>\n <li nz-menu-item\n (click)="click($event, \'clear\')"\n data-type="clear"\n [innerHTML]="i18n.clear"></li>\n <ng-container *ngIf="customContextMenu!.length > 0">\n <li nz-menu-divider></li>\n <li *ngFor="let i of customContextMenu"\n nz-menu-item\n [attr.data-type]="i.id"\n [nzDisabled]="isDisabled(i)"\n (click)="click($event, \'custom\', i)"\n [innerHTML]="i.title"></li>\n </ng-container>\n</ul>\n',host:{"(document:click)":"closeMenu($event)","(document:contextmenu)":"closeMenu($event)"},preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None}]}],e.ctorParameters=function(){return[{type:n.LxlibLocaleService}]},e.propDecorators={i18n:[{type:t.Input}],item:[{type:t.Input}],event:[{type:t.Input}],customContextMenu:[{type:t.Input}],close:[{type:t.Output}]},e}();var m=function(){function e(e){this.overlay=e,this.show=new i.Subject,this.close=new i.Subject}return e.prototype.remove=function(){this.ref&&(this.ref.detach(),this.ref.dispose(),this.ref=null)},e.prototype.open=function(e){var n=this;this.remove();var s=e.event,c=e.item,l=e.customContextMenu,a=new t.ElementRef({getBoundingClientRect:function(){return{bottom:s.clientY,height:0,left:s.clientX,right:s.clientX,top:s.clientY,width:0}}}),u=[new r.ConnectionPositionPair({originX:"start",originY:"bottom"},{overlayX:"start",overlayY:"top"}),new r.ConnectionPositionPair({originX:"start",originY:"top"},{overlayX:"start",overlayY:"bottom"})],h=this.overlay.position().flexibleConnectedTo(a).withPositions(u);this.ref=this.overlay.create({positionStrategy:h,panelClass:"reuse-tab__cm",scrollStrategy:this.overlay.scrollStrategies.close()});var p=this.ref.attach(new o.ComponentPortal(v)),f=p.instance;f.i18n=this.i18n,f.item=d({},c),f.customContextMenu=l,f.event=s;var g=new i.Subscription;g.add(f.close.subscribe((function(e){n.close.next(e),n.remove()}))),p.onDestroy((function(){return g.unsubscribe()}))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:r.Overlay}]},e}();var x=function(){function e(e){var n=this;this.srv=e,this.sub$=new i.Subscription,this.change=new t.EventEmitter,this.sub$.add(e.show.subscribe((function(e){return n.srv.open(e)}))),this.sub$.add(e.close.subscribe((function(e){return n.change.emit(e)})))}return Object.defineProperty(e.prototype,"i18n",{set:function(e){this.srv.i18n=e},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this.sub$.unsubscribe()},e.decorators=[{type:t.Component,args:[{selector:"reuse-tab-context",template:""}]}],e.ctorParameters=function(){return[{type:m}]},e.propDecorators={i18n:[{type:t.Input}],change:[{type:t.Output}]},e}();var C=function(){function e(e){this.srv=e}return e.prototype._onContextMenu=function(e){this.srv.show.next({event:e,item:this.item,customContextMenu:this.customContextMenu}),e.preventDefault(),e.stopPropagation()},e.decorators=[{type:t.Directive,args:[{selector:"[reuse-tab-context-menu]",exportAs:"reuseTabContextMenu",host:{"(contextmenu)":"_onContextMenu($event)"}}]}],e.ctorParameters=function(){return[{type:m}]},e.propDecorators={item:[{type:t.Input,args:["reuse-tab-context-menu"]}],customContextMenu:[{type:t.Input}]},e}();var _={Menu:0,MenuForce:1,URL:2};_[_.Menu]="Menu",_[_.MenuForce]="MenuForce",_[_.URL]="URL";var R=function(){function e(e,t){this.injector=e,this.menuService=t,this._inited=!1,this._max=10,this._keepingScroll=!1,this._cachedChange=new i.BehaviorSubject(null),this._cached=[],this._titleCached={},this._closableCached={},this.positionBuffer={},this.debug=!1,this.mode=_.Menu,this.excludes=[]}return Object.defineProperty(e.prototype,"snapshot",{get:function(){return this.injector.get(c.ActivatedRoute).snapshot},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inited",{get:function(){return this._inited},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"curUrl",{get:function(){return this.getUrl(this.snapshot)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"max",{set:function(e){this._max=Math.min(Math.max(e,2),100);for(var t=this._cached.length;t>this._max;t--)this._cached.pop()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"keepingScroll",{get:function(){return this._keepingScroll},set:function(e){this._keepingScroll=e,this.initScroll()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._cached},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this._cached.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"change",{get:function(){return this._cachedChange.asObservable()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{set:function(e){var t=this.curUrl;"string"==typeof e&&(e={text:e}),this._titleCached[t]=e,this.di("update current tag title: ",e),this._cachedChange.next({active:"title",title:e,list:this._cached})},enumerable:!0,configurable:!0}),e.prototype.index=function(e){return this._cached.findIndex((function(t){return t.url===e}))},e.prototype.exists=function(e){return-1!==this.index(e)},e.prototype.get=function(e){return e&&this._cached.find((function(t){return t.url===e}))||null},e.prototype.remove=function(e,t){var n="string"==typeof e?this.index(e):e,i=-1!==n?this._cached[n]:null;return!(!i||!t&&!i.closable)&&(this.destroy(i._handle),this._cached.splice(n,1),delete this._titleCached[e],!0)},e.prototype.close=function(e,t){return void 0===t&&(t=!1),this.removeUrlBuffer=e,this.remove(e,t),this._cachedChange.next({active:"close",url:e,list:this._cached}),this.di("close tag",e),!0},e.prototype.closeRight=function(e,t){void 0===t&&(t=!1);for(var n=this.index(e),i=this.count-1;i>n;i--)this.remove(i,t);return this.removeUrlBuffer=null,this._cachedChange.next({active:"closeRight",url:e,list:this._cached}),this.di("close right tages",e),!0},e.prototype.clear=function(e){var t=this;void 0===e&&(e=!1),this._cached.forEach((function(n){!e&&n.closable&&t.destroy(n._handle)})),this._cached=this._cached.filter((function(t){return!e&&!t.closable})),this.removeUrlBuffer=null,this._cachedChange.next({active:"clear",list:this._cached}),this.di("clear all catch")},e.prototype.move=function(e,t){var n=this._cached.findIndex((function(t){return t.url===e}));if(-1!==n){var i=this._cached.slice();i.splice(t<0?i.length+t:t,0,i.splice(n,1)[0]),this._cached=i,this._cachedChange.next({active:"move",url:e,position:t,list:this._cached})}},e.prototype.replace=function(e){var t=this.curUrl;this.exists(t)?this.close(t,!0):this.removeUrlBuffer=t,this.injector.get(c.Router).navigateByUrl(e)},e.prototype.getTitle=function(e,t){if(this._titleCached[e])return this._titleCached[e];if(t&&t.data&&(t.data.titleI18n||t.data.title))return{text:t.data.title,i18n:t.data.titleI18n};var n=this.getMenu(e);return n?{text:n.text,i18n:n.i18n}:{text:e}},e.prototype.clearTitleCached=function(){this._titleCached={}},Object.defineProperty(e.prototype,"closable",{set:function(e){var t=this.curUrl;this._closableCached[t]=e,this.di("update current tag closable: ",e),this._cachedChange.next({active:"closable",closable:e,list:this._cached})},enumerable:!0,configurable:!0}),e.prototype.getClosable=function(e,t){if(void 0!==this._closableCached[e])return this._closableCached[e];if(t&&t.data&&"boolean"==typeof t.data.reuseClosable)return t.data.reuseClosable;var n=this.mode!==_.URL?this.getMenu(e):null;return!n||"boolean"!=typeof n.reuseClosable||n.reuseClosable},e.prototype.clearClosableCached=function(){this._closableCached={}},e.prototype.getTruthRoute=function(e){for(var t=e;t.firstChild;)t=t.firstChild;return t},e.prototype.getUrl=function(e){for(var t=this.getTruthRoute(e),n=[];t;)n.push(t.url.join("/")),t=t.parent;return"/"+n.filter((function(e){return e})).reverse().join("/")},e.prototype.can=function(e){var t=this.getUrl(e);if(t===this.removeUrlBuffer)return!1;if(e.data&&"boolean"==typeof e.data.reuse)return e.data.reuse;if(this.mode!==_.URL){var n=this.getMenu(t);if(!n)return!1;if(this.mode===_.Menu){if(!1===n.reuse)return!1}else if(!n.reuse||!0!==n.reuse)return!1;return!0}return-1===this.excludes.findIndex((function(e){return e.test(t)}))},e.prototype.refresh=function(e){this._cachedChange.next({active:"refresh",data:e})},e.prototype.destroy=function(e){e&&e.componentRef&&e.componentRef.destroy&&e.componentRef.destroy()},e.prototype.di=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.debug&&console.warn.apply(console,y(e))},e.prototype.init=function(){this.initScroll(),this._inited=!0},e.prototype.getMenu=function(e){var t=this.menuService.getPathByUrl(e);return t&&0!==t.length?t.pop():null},e.prototype.runHook=function(e,t,n){n.instance&&"function"==typeof n.instance[e]&&n.instance[e]()},e.prototype.hasInValidRoute=function(e){return!e.routeConfig||e.routeConfig.loadChildren||e.routeConfig.children},e.prototype.shouldDetach=function(e){return!this.hasInValidRoute(e)&&(this.di("#shouldDetach",this.can(e),this.getUrl(e)),this.can(e))},e.prototype.store=function(e,t){var n=this.getUrl(e),i=this.index(n),r={title:this.getTitle(n,e),closable:this.getClosable(n,e),position:this.getKeepingScroll(n,e)?this.positionBuffer[n]:null,url:n,_snapshot:e,_handle:t};if(-1===i){if(this.count>=this._max){var o=this._cached.findIndex((function(e){return e.closable}));-1!==o&&this.remove(o,!1)}this._cached.push(r)}else this._cached[i]=r;this.removeUrlBuffer=null,this.di("#store",-1===i?"[new]":"[override]",n),t&&t.componentRef&&this.runHook("_onReuseDestroy",n,t.componentRef),this._cachedChange.next({active:"add",item:r,list:this._cached})},e.prototype.shouldAttach=function(e){if(this.hasInValidRoute(e))return!1;var t=this.getUrl(e),n=this.get(t),i=!(!n||!n._handle);return this.di("#shouldAttach",i,t),i&&n._handle.componentRef&&this.runHook("_onReuseInit",t,n._handle.componentRef),i},e.prototype.retrieve=function(e){if(this.hasInValidRoute(e))return null;var t=this.getUrl(e),n=this.get(t),i=n&&n._handle||null;return this.di("#retrieve",t,i),i},e.prototype.shouldReuseRoute=function(e,t){var n=e.routeConfig===t.routeConfig;if(!n)return!1;var i=e.routeConfig&&e.routeConfig.path||"";i.length>0&&~i.indexOf(":")&&(n=this.getUrl(e)===this.getUrl(t));return this.di("====================="),this.di("#shouldReuseRoute",n,this.getUrl(t)+"=>"+this.getUrl(e),e,t),n},e.prototype.getKeepingScroll=function(e,t){if(t&&t.data&&"boolean"==typeof t.data.keepingScroll)return t.data.keepingScroll;var n=this.mode!==_.URL?this.getMenu(e):null;return n&&"boolean"==typeof n.keepingScroll?n.keepingScroll:this.keepingScroll},Object.defineProperty(e.prototype,"isDisabledInRouter",{get:function(){return"disabled"===this.injector.get(c.ROUTER_CONFIGURATION,{}).scrollPositionRestoration},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ss",{get:function(){return this.injector.get(n.ScrollService)},enumerable:!0,configurable:!0}),e.prototype.initScroll=function(){var e=this;this._router$&&this._router$.unsubscribe(),this._router$=this.injector.get(c.Router).events.subscribe((function(t){if(t instanceof c.NavigationStart){var n=e.curUrl;e.getKeepingScroll(n,e.getTruthRoute(e.snapshot))?e.positionBuffer[n]=e.ss.getScrollPosition(e.keepingScrollContainer):delete e.positionBuffer[n]}else if(t instanceof c.NavigationEnd){n=e.curUrl;var i=e.get(n);i&&i.position&&e.getKeepingScroll(n,e.getTruthRoute(e.snapshot))&&(e.isDisabledInRouter?e.ss.scrollToPosition(e.keepingScrollContainer,i.position):setTimeout((function(){return e.ss.scrollToPosition(e.keepingScrollContainer,i.position)}),1))}}))},e.prototype.ngOnDestroy=function(){var e=this._cachedChange,t=this._router$;this.clear(),this._cached=[],e.complete(),t&&t.unsubscribe()},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:t.Injector},{type:n.MenuService}]},e.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.MenuService))},token:e,providedIn:"root"}),e}();var S=function(){function e(e,n,r,o,s,c,l,a){this.srv=n,this.cdr=r,this.router=o,this.route=s,this.render=c,this.i18nSrv=l,this.doc=a,this.unsubscribe$=new i.Subject,this.list=[],this.pos=0,this.mode=_.Menu,this.debug=!1,this.allowClose=!0,this.showCurrent=!0,this.keepingScroll=!1,this.customContextMenu=[],this.tabType="line",this.change=new t.EventEmitter,this.close=new t.EventEmitter,this.el=e.nativeElement}return Object.defineProperty(e.prototype,"keepingScrollContainer",{set:function(e){this._keepingScrollContainer="string"==typeof e?this.doc.querySelector(e):e},enumerable:!0,configurable:!0}),e.prototype.genTit=function(e){return e.i18n&&this.i18nSrv?this.i18nSrv.fanyi(e.i18n):e.text},e.prototype.genList=function(e){var t=this,n=e&&"close"===e.active,i=n?this.list.findIndex((function(t){return t.url===e.url})):-1,r=this.srv.items.map((function(e,n){return{url:e.url,title:t.genTit(e.title),closable:t.allowClose&&e.closable&&t.srv.count>0,index:n,active:!1,last:!1}}));if(this.showCurrent){var o=this.route.snapshot,s=this.srv.getUrl(o),c=r.findIndex((function(e){return e.url===s}));if(-1!==c||n&&e.url===s)this.pos=n?c>=i?this.pos-1:this.pos:c;else{var l=this.srv.getTruthRoute(o);r.push({url:s,title:this.genTit(this.srv.getTitle(s,l)),closable:this.allowClose&&this.srv.count>0&&this.srv.getClosable(s,l),index:r.length,active:!1,last:!1}),this.pos=r.length-1}r.length<=1&&(r[0].closable=!1)}this.list=r,r.length&&n&&this.to(this.pos),this.refStatus(!1),this.visibility(),this.cdr.detectChanges()},e.prototype.visibility=function(){this.showCurrent||this.render.setStyle(this.el,"display",0===this.list.length?"none":"block")},Object.defineProperty(e.prototype,"acitveIndex",{get:function(){return this.list.find((function(e){return e.active})).index},enumerable:!0,configurable:!0}),e.prototype.cmChange=function(e){var t=this,n=null;switch(e.type){case"close":this._close(null,e.item.index,e.includeNonCloseable);break;case"closeRight":n=function(){t.srv.closeRight(e.item.url,e.includeNonCloseable),t.close.emit(null)};break;case"clear":case"closeOther":n=function(){t.srv.clear(e.includeNonCloseable),t.close.emit(null)}}n&&(!e.item.active&&e.item.index<=this.acitveIndex?this.to(e.item.index,n):n())},e.prototype.refStatus=function(e){var t=this;void 0===e&&(e=!0),this.list.length&&(this.list[this.list.length-1].last=!0,this.list.forEach((function(e,n){return e.active=t.pos===n}))),e&&this.cdr.detectChanges()},e.prototype.to=function(e,t){var n=this;e=Math.max(0,Math.min(e,this.list.length-1));var i=this.list[e];this.router.navigateByUrl(i.url).then((function(r){r&&(n.pos=e,n.item=i,n.refStatus(),n.change.emit(i),t&&t())}))},e.prototype._close=function(e,t,n){null!=e&&(e.preventDefault(),e.stopPropagation());var i=this.list[t];return this.srv.close(i.url,n),this.close.emit(i),this.cdr.detectChanges(),!1},e.prototype.ngOnInit=function(){var e=this;this.router.events.pipe(a.takeUntil(this.unsubscribe$),a.filter((function(e){return e instanceof c.NavigationEnd}))).subscribe((function(){return e.genList()})),this.srv.change.pipe(a.takeUntil(this.unsubscribe$)).subscribe((function(t){return e.genList(t)})),this.i18nSrv.change.pipe(a.filter((function(){return e.srv.inited})),a.takeUntil(this.unsubscribe$),a.debounceTime(100)).subscribe((function(){return e.genList()})),this.genList(),this.srv.init()},e.prototype.ngOnChanges=function(e){e.max&&(this.srv.max=this.max),e.excludes&&(this.srv.excludes=this.excludes),e.mode&&(this.srv.mode=this.mode),e.keepingScroll&&(this.srv.keepingScroll=this.keepingScroll,this.srv.keepingScrollContainer=this._keepingScrollContainer),this.srv.debug=this.debug,this.cdr.detectChanges()},e.prototype.ngOnDestroy=function(){var e=this.unsubscribe$;e.next(),e.complete()},e.decorators=[{type:t.Component,args:[{selector:"reuse-tab",exportAs:"reuseTab",template:'<nz-tabset [nzSelectedIndex]="pos"\n [nzAnimated]="false" [nzType]="tabType"\n [nzTabBarExtraContent]="tabBarExtraContent"\n [nzTabBarGutter]="tabBarGutter"\n [nzTabBarStyle]="tabBarStyle">\n <nz-tab *ngFor="let i of list; let index = index" [nzTitle]="titleTemplate" (nzClick)="to(index)">\n <ng-template #titleTemplate>\n <div [reuse-tab-context-menu]="i" [customContextMenu]="customContextMenu" class="reuse-tab__name" [attr.title]="i.title">\n <span [class.reuse-tab__name-width]="tabMaxWidth" [style.max-width.px]="tabMaxWidth">\n {{i.title}}\n </span>\n </div>\n <i *ngIf="i.closable" nz-icon nzType="close" class="reuse-tab__op" (click)="_close($event, index, false)"></i>\n </ng-template>\n </nz-tab>\n</nz-tabset>\n<reuse-tab-context [i18n]="i18n" (change)="cmChange($event)"></reuse-tab-context>\n',host:{"[class.reuse-tab]":"true","[class.reuse-tab__line]":"tabType === 'line'","[class.reuse-tab__card]":"tabType === 'card'"},providers:[m],preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:R},{type:t.ChangeDetectorRef},{type:c.Router},{type:c.ActivatedRoute},{type:t.Renderer2},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[n.LXLIB_I18N_TOKEN]}]},{type:void 0,decorators:[{type:t.Inject,args:[s.DOCUMENT]}]}]},e.propDecorators={mode:[{type:t.Input}],i18n:[{type:t.Input}],debug:[{type:t.Input}],max:[{type:t.Input}],tabMaxWidth:[{type:t.Input}],excludes:[{type:t.Input}],allowClose:[{type:t.Input}],showCurrent:[{type:t.Input}],keepingScroll:[{type:t.Input}],keepingScrollContainer:[{type:t.Input}],customContextMenu:[{type:t.Input}],tabBarExtraContent:[{type:t.Input}],tabBarGutter:[{type:t.Input}],tabBarStyle:[{type:t.Input}],tabType:[{type:t.Input}],change:[{type:t.Output}],close:[{type:t.Output}]},f([l.InputBoolean(),g("design:type",Object)],e.prototype,"debug",void 0),f([l.InputNumber(),g("design:type",Number)],e.prototype,"max",void 0),f([l.InputNumber(),g("design:type",Number)],e.prototype,"tabMaxWidth",void 0),f([l.InputBoolean(),g("design:type",Object)],e.prototype,"allowClose",void 0),f([l.InputBoolean(),g("design:type",Object)],e.prototype,"showCurrent",void 0),f([l.InputBoolean(),g("design:type",Object)],e.prototype,"keepingScroll",void 0),e}();var I=function(){function e(e){this.srv=e}return e.prototype.shouldDetach=function(e){return this.srv.shouldDetach(e)},e.prototype.store=function(e,t){this.srv.store(e,t)},e.prototype.shouldAttach=function(e){return this.srv.shouldAttach(e)},e.prototype.retrieve=function(e){return this.srv.retrieve(e)},e.prototype.shouldReuseRoute=function(e,t){return this.srv.shouldReuseRoute(e,t)},e}();var M=[S],j=[v,x,C],O=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[s.CommonModule,c.RouterModule,n.LxlibLocaleModule,h.NzMenuModule,p.NzTabsModule,u.NzIconModule,r.OverlayModule],declarations:y(M,j),entryComponents:[v],exports:y(M)}]}],e}();e.ReuseTabComponent=S,e.ReuseTabContextComponent=x,e.ReuseTabContextDirective=C,e.ReuseTabContextMenuComponent=v,e.ReuseTabContextService=m,e.ReuseTabMatchMode=_,e.ReuseTabModule=O,e.ReuseTabService=R,e.ReuseTabStrategy=I,Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=reuseTab.umd.min.js.map