UNPKG

@lidorsystems/integralui-web

Version:

IntegralUI Web - Advanced UI Components for Angular

15 lines (12 loc) 64.2 kB
/* filename: integralui.tabstrip.js version : 20.2.0 Copyright © 2016-2020 Lidor Systems. All rights reserved. This file is part of the "IntegralUI Web" Library. The contents of this file are subject to the IntegralUI Web License, and may not be used except in compliance with the License. A copy of the License should have been installed in the product's root installation directory or it can be found at http://www.lidorsystems.com/products/web/studio/license-agreement.aspx. This SOFTWARE is provided "AS IS", WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. Any infringement will be prosecuted under applicable laws. */ "use strict";var __extends=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]})(t,i)};return function(t,i){e(t,i);function r(){this.constructor=t}t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();Object.defineProperty(exports,"__esModule",{value:!0});var core_1=require("@angular/core"),integralui_core_1=require("./integralui.core"),integralui_common_service_1=require("../services/integralui.common.service"),integralui_data_service_1=require("../services/integralui.data.service"),integralui_tab_1=require("./integralui.tab"),i0=require("@angular/core"),i1=require("../services/integralui.data.service"),i2=require("../services/integralui.common.service"),i3=require("./integralui.core"),i4=require("@angular/common"),_c0=["content"],_c1=["scrollInBound"],_c2=["scrollButton"],_c3=["tabBlock"],_c4=["tabIcon"],_c5=["toolbarLeft"],_c6=["toolbarRight"],_c7=["tabHeader"],_c8=function(e,t){return{top:e,bottom:t}};function IntegralUITabStrip_div_1_Template(e,t){if(1&e){i0.ɵɵelementStart(0,"div",14,15);i0.ɵɵprojection(2,1);i0.ɵɵelementEnd()}if(2&e){var i=i0.ɵɵnextContext();i0.ɵɵproperty("ngStyle",i0.ɵɵpureFunction2(1,_c8,i.toolbarPos.top,i.toolbarPos.bottom))}}var _c9=function(e,t){return{"iui-tabstrip-scroll-button-up":e,"iui-tabstrip-scroll-button-left":t}};function IntegralUITabStrip_div_4_Template(e,t){if(1&e){var i=i0.ɵɵgetCurrentView();i0.ɵɵelementStart(0,"div",16,17);i0.ɵɵelementStart(2,"div",18,19);i0.ɵɵlistener("mousedown",function(e){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext().scrollButtonMouseDown(e)})("mouseup",function(e){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext().scrollButtonMouseUp(e)});i0.ɵɵelement(4,"span");i0.ɵɵelementEnd();i0.ɵɵelementEnd()}if(2&e){var r=i0.ɵɵnextContext();i0.ɵɵproperty("ngClass",r.getScrollBlockClass())("ngStyle",r.getScrollOutBoundStyle(1));i0.ɵɵadvance(2);i0.ɵɵproperty("ngClass",i0.ɵɵpureFunction2(4,_c9,1==r.tabStripPlacement||4==r.tabStripPlacement,0==r.tabStripPlacement||3==r.tabStripPlacement))("ngStyle",r.getScrollInBoundButtonStyle())}}function IntegralUITabStrip_li_7_span_2_Template(e,t){if(1&e)i0.ɵɵelement(0,"span",24,25);if(2&e){var i=i0.ɵɵnextContext().$implicit;i0.ɵɵproperty("ngClass",i.icon)}}function IntegralUITabStrip_li_7_span_3_Template(e,t){if(1&e){i0.ɵɵelementStart(0,"span",26);i0.ɵɵtext(1);i0.ɵɵelementEnd()}if(2&e){var i=i0.ɵɵnextContext().$implicit;i0.ɵɵadvance(1);i0.ɵɵtextInterpolate(i.text)}}var _c10=function(e,t){return{opacity:e,"z-index":t}};function IntegralUITabStrip_li_7_Template(e,t){if(1&e){var i=i0.ɵɵgetCurrentView();i0.ɵɵelementStart(0,"li",20,21);i0.ɵɵlistener("mouseenter",function(e){i0.ɵɵrestoreView(i);var r=t.$implicit;return i0.ɵɵnextContext().tabEnter(e,r)})("mouseleave",function(e){i0.ɵɵrestoreView(i);var r=t.$implicit;return i0.ɵɵnextContext().tabLeave(e,r)})("mousedown",function(e){i0.ɵɵrestoreView(i);var r=t.$implicit;return i0.ɵɵnextContext().tabMouseDown(e,r)})("mousemove",function(e){i0.ɵɵrestoreView(i);var r=t.$implicit;return i0.ɵɵnextContext().tabMouseMove(e,r)})("touchstart",function(e){i0.ɵɵrestoreView(i);var r=t.$implicit;return i0.ɵɵnextContext().tabTouchStart(e,r)});i0.ɵɵtemplate(2,IntegralUITabStrip_li_7_span_2_Template,2,1,"span",22);i0.ɵɵtemplate(3,IntegralUITabStrip_li_7_span_3_Template,2,1,"span",23);i0.ɵɵelementEnd()}if(2&e){var r=t.$implicit,n=i0.ɵɵnextContext();i0.ɵɵproperty("ngClass",n.getTabHeaderClass(r))("ngStyle",i0.ɵɵpureFunction2(4,_c10,n.getTabOpacity(r),r.elemOrder));i0.ɵɵadvance(2);i0.ɵɵproperty("ngIf",r.icon);i0.ɵɵadvance(1);i0.ɵɵproperty("ngIf",r.text&&(r.selected||1!==n.displayMode||1===n.tabStripPlacement||4===n.tabStripPlacement))}}function IntegralUITabStrip_li_8_span_2_Template(e,t){if(1&e)i0.ɵɵelement(0,"span",24);if(2&e){var i=i0.ɵɵnextContext(2);i0.ɵɵproperty("ngClass",i.reorderTab.icon)}}function IntegralUITabStrip_li_8_span_3_Template(e,t){if(1&e){i0.ɵɵelementStart(0,"span",26);i0.ɵɵtext(1);i0.ɵɵelementEnd()}if(2&e){var i=i0.ɵɵnextContext(2);i0.ɵɵadvance(1);i0.ɵɵtextInterpolate(i.reorderTab.text)}}var _c11=function(){return{opacity:"0.5"}};function IntegralUITabStrip_li_8_Template(e,t){if(1&e){i0.ɵɵelementStart(0,"li",0);i0.ɵɵelementStart(1,"div",27);i0.ɵɵtemplate(2,IntegralUITabStrip_li_8_span_2_Template,1,1,"span",22);i0.ɵɵtemplate(3,IntegralUITabStrip_li_8_span_3_Template,2,1,"span",23);i0.ɵɵelementEnd();i0.ɵɵelementEnd()}if(2&e){var i=i0.ɵɵnextContext();i0.ɵɵproperty("ngClass",i.getTabHeaderClass(i.reorderTab,!0))("ngStyle",i.getReorderTabStyle());i0.ɵɵadvance(1);i0.ɵɵproperty("ngStyle",i0.ɵɵpureFunction0(5,_c11));i0.ɵɵadvance(1);i0.ɵɵproperty("ngIf",i.reorderTab.icon);i0.ɵɵadvance(1);i0.ɵɵproperty("ngIf",i.reorderTab.text)}}var _c12=function(e,t){return{"iui-tabstrip-scroll-button-down":e,"iui-tabstrip-scroll-button-right":t}};function IntegralUITabStrip_div_9_Template(e,t){if(1&e){var i=i0.ɵɵgetCurrentView();i0.ɵɵelementStart(0,"div",28,29);i0.ɵɵelementStart(2,"div",18,19);i0.ɵɵlistener("mousedown",function(e){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext().scrollButtonMouseDown(e)})("mouseup",function(e){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext().scrollButtonMouseUp(e)});i0.ɵɵelement(4,"span");i0.ɵɵelementEnd();i0.ɵɵelementStart(5,"div",18);i0.ɵɵlistener("mousedown",function(e){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext().scrollButtonMouseDown(e,!0)})("mouseup",function(e){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext().scrollButtonMouseUp(e)});i0.ɵɵelement(6,"span");i0.ɵɵelementEnd();i0.ɵɵelementEnd()}if(2&e){var r=i0.ɵɵnextContext();i0.ɵɵproperty("ngClass",r.getScrollBlockClass())("ngStyle",r.getScrollInBoundStyle());i0.ɵɵadvance(2);i0.ɵɵproperty("ngClass",i0.ɵɵpureFunction2(6,_c9,1==r.tabStripPlacement||4==r.tabStripPlacement,0==r.tabStripPlacement||3==r.tabStripPlacement))("ngStyle",r.getScrollInBoundButtonStyle());i0.ɵɵadvance(3);i0.ɵɵproperty("ngClass",i0.ɵɵpureFunction2(9,_c12,1==r.tabStripPlacement||4==r.tabStripPlacement,0==r.tabStripPlacement||3==r.tabStripPlacement))("ngStyle",r.getScrollInBoundButtonStyle())}}function IntegralUITabStrip_div_10_Template(e,t){if(1&e){var i=i0.ɵɵgetCurrentView();i0.ɵɵelementStart(0,"div",16,29);i0.ɵɵelementStart(2,"div",18);i0.ɵɵlistener("mousedown",function(e){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext().scrollButtonMouseDown(e,!0)})("mouseup",function(e){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext().scrollButtonMouseUp(e)});i0.ɵɵelement(3,"span");i0.ɵɵelementEnd();i0.ɵɵelementEnd()}if(2&e){var r=i0.ɵɵnextContext();i0.ɵɵproperty("ngClass",r.getScrollBlockClass())("ngStyle",r.getScrollOutBoundStyle());i0.ɵɵadvance(2);i0.ɵɵproperty("ngClass",i0.ɵɵpureFunction2(4,_c12,1==r.tabStripPlacement||4==r.tabStripPlacement,0==r.tabStripPlacement||3==r.tabStripPlacement))("ngStyle",r.getScrollInBoundButtonStyle())}}var _c13=function(e,t,i,r){return{top:e,left:t,height:i,width:r}};function IntegralUITabStrip_div_11_Template(e,t){if(1&e)i0.ɵɵelement(0,"div",30);if(2&e){var i=i0.ɵɵnextContext();i0.ɵɵproperty("ngStyle",i0.ɵɵpureFunction4(1,_c13,i.selTabLinePos.top+"px",i.selTabLinePos.left+"px",i.selTabLineSize.height+"px",i.selTabLineSize.width+"px"))}}function IntegralUITabStrip_div_15_Template(e,t){if(1&e){i0.ɵɵelementStart(0,"div",31,32);i0.ɵɵprojection(2,2);i0.ɵɵelementEnd()}if(2&e){var i=i0.ɵɵnextContext();i0.ɵɵproperty("ngStyle",i0.ɵɵpureFunction2(1,_c8,i.toolbarPos.top,i.toolbarPos.bottom))}}var _c14=["*",[["iui-tabstrip-toolbar-left"]],[["iui-tabstrip-toolbar-right"]]],_c15=function(e,t,i,r,n,o){return{top:e,right:t,bottom:i,left:r,width:n,height:o}},_c16=function(e,t,i,r){return{top:e,right:t,bottom:i,left:r}},_c17=function(e,t,i,r){return{top:e,left:t,width:i,height:r}},_c18=["*","iui-tabstrip-toolbar-left","iui-tabstrip-toolbar-right"],IntegralUITabStripToolbarLeft=function(){function e(){}e.ɵfac=function(t){return new(t||e)};e.ɵdir=i0.ɵɵdefineDirective({type:e,selectors:[["iui-tabstrip-toolbar-left"]]});return e}();exports.IntegralUITabStripToolbarLeft=IntegralUITabStripToolbarLeft;var IntegralUITabStripToolbarRight=function(){function e(){}e.ɵfac=function(t){return new(t||e)};e.ɵdir=i0.ɵɵdefineDirective({type:e,selectors:[["iui-tabstrip-toolbar-right"]]});return e}();exports.IntegralUITabStripToolbarRight=IntegralUITabStripToolbarRight;var IntegralUITabStrip=function(e){__extends(t,e);function t(t,i,r,n,o,a,l){var c=e.call(this,o)||this;c.dataService=t;c.elemRef=i;c.elemRenderer=r;c.changeRef=n;c.commonService=o;c.cmpResolver=a;c.baseService=l;c.animationTimer=null;c.currentAnimation=integralui_core_1.IntegralUIAnimationType.Fade;c.dataTabs=[];c.eventList=[];c.numTabs=0;c.reorderTab=null;c.tabReorderActive=!1;c.reorderTabPos={top:0,left:0};c.reorderTabStartPos={top:0,left:0};c.reorderTabCurrentPos={top:0,left:0};c.startTabReorder=!1;c.reorderTabIndex=-1;c.reorderNewTabIndex=-1;c.orgHeaderList=[];c.orgReorderTabIndex=-1;c.ctrlCursor="default";c.autoSizeValue=!1;c.blockPos={top:"0",right:"auto",bottom:"auto",left:"0"};c.contentBlockPos={top:0,left:0};c.contentBlockSize={width:0,height:0};c.clientRect={width:0,height:0};c.currentTabPlacement=integralui_core_1.IntegralUITabStripPlacement.Top;c.currentDisplayMode=integralui_core_1.IntegralUITabDisplayMode.AutoSized;c.emptyTabSpace=0;c.orgTabHeaderSpace=[];c.scrollBlockSize={width:0,height:0};c.scrollButtonSize={width:0,height:0};c.selTabLinePos={top:0,left:0};c.selTabLineSize={width:0,height:0};c.tabHeaderRect=[];c.tabPos={top:0,left:0};c.tabSize={width:0,height:0};c.tabstripPos={top:"0",right:"auto",bottom:"auto",left:"0"};c.tabStripSize={width:0,height:0};c.toolbarPos={top:"0",bottom:"auto"};c.updateTimer=null;c.currentScrollMode=integralui_core_1.IntegralUITabScrollMode.None;c.isScrollActive=!1;c.isScrollAllowed=!1;c.scrollCount=0;c.currentScrollPos=0;c.scrollTimer=null;c.stopScrolling=!0;c.maxScrollPos=0;c.currentSelection=null;c.currentSelectedIndex=-1;c.selectedComponent=null;c.prevComponent=null;c.removeIndex=-1;c.tRef=null;c.allowDrag=!1;c.allowDrop=!0;c.animationSpeed=integralui_core_1.IntegralUISpeedMode.Normal;c.tabSpacing=0;c.afterSelect=new core_1.EventEmitter;c.beforeSelect=new core_1.EventEmitter;c.change=new core_1.EventEmitter;c.tabAdding=new core_1.EventEmitter;c.tabAdded=new core_1.EventEmitter;c.tabOrderChanged=new core_1.EventEmitter;c.clear=new core_1.EventEmitter;c.tabRemoving=new core_1.EventEmitter;c.tabRemoved=new core_1.EventEmitter;c.scrollPosChanged=new core_1.EventEmitter;c.selectionChanged=new core_1.EventEmitter;c.tabList=[];return c}Object.defineProperty(t.prototype,"animation",{get:function(){return this.currentAnimation},set:function(e){if(this.currentAnimation!=e){this.currentAnimation=e;this.updateLayout()}},enumerable:!0,configurable:!0});Object.defineProperty(t.prototype,"autoSize",{get:function(){return this.autoSizeValue},set:function(e){if(this.autoSizeValue!=e){this.autoSizeValue=e;this.updateLayout()}},enumerable:!0,configurable:!0});Object.defineProperty(t.prototype,"displayMode",{get:function(){return this.currentDisplayMode},set:function(e){if(this.currentDisplayMode!=e){this.currentDisplayMode=e;this.updateLayout()}},enumerable:!0,configurable:!0});Object.defineProperty(t.prototype,"scrollMode",{get:function(){return this.currentScrollMode},set:function(e){if(this.currentScrollMode!=e){this.currentScrollMode=e;this.scrollPos(0);this.updateLayout()}},enumerable:!0,configurable:!0});Object.defineProperty(t.prototype,"selectedIndex",{get:function(){return this.currentSelectedIndex},set:function(e){if(this.currentSelectedIndex!=e){this.currentSelectedIndex=e;this.selectComponentByIndex(e)}},enumerable:!0,configurable:!0});Object.defineProperty(t.prototype,"selectedTab",{get:function(){return this.currentSelection},set:function(e){if(this.currentSelection!=e){this.currentSelection=e;this.selectTab(e)}},enumerable:!0,configurable:!0});Object.defineProperty(t.prototype,"tabs",{get:function(){return this.dataTabs},set:function(e){this.dataTabs=e;this.updateData();var t=this;setTimeout(function(){t.tabList=t.contentList.toArray();t.numTabs=t.tabList.length;if(t.numTabs>0)if(t.selectedIndex>=0)t.selectComponentByIndex(t.selectedIndex);else if(t.selectedTab&&t.tabs)t.selectComponentByIndex(t.tabs.indexOf(t.selectedTab));else t.selectComponentByIndex(0);t.updateLayout()},100)},enumerable:!0,configurable:!0});Object.defineProperty(t.prototype,"tabStripPlacement",{get:function(){return this.currentTabPlacement},set:function(e){if(this.currentTabPlacement!=e){this.currentTabPlacement=e;this.scrollPos(0);this.updateLayout()}},enumerable:!0,configurable:!0});t.prototype.ngOnInit=function(){this.baseService.setComponent(this);this.updateData();this.generalClassName="iui-tabstrip";this.tabHeaderClassName="iui-tab-header";this.initStyle()};t.prototype.updateData=function(){this.dataService.init([{data:this.tabs}])};t.prototype.ngAfterViewInit=function(){var e=this,t=setTimeout(function(){var i=e.cmpResolver.resolveComponentFactory(integralui_core_1.IntegralUITComponent);if(i&&e.tabBlockRef)e.tRef=e.tabBlockRef.createComponent(i);clearTimeout(t)},100)};t.prototype.ngAfterContentInit=function(){};t.prototype.ngOnDestroy=function(){if(this.scrollTimer)clearInterval(this.scrollTimer);this.removeAnimationTimer();if(this.tRef)this.tRef.destroy()};t.prototype.ngAfterContentChecked=function(){this.clientRect={width:this.elemRef.nativeElement.firstElementChild.clientWidth,height:this.elemRef.nativeElement.firstElementChild.clientHeight};if(this.clientRect.width!=this.prevClientRect.width){this.updateLayout();this.prevClientRect.width=this.clientRect.width}else if(this.clientRect.height!=this.prevClientRect.height){this.updateLayout();this.prevClientRect.height=this.clientRect.height}};t.prototype.addTab=function(e){this.callEventAdd("add",e)};t.prototype.clearTabs=function(){this.dataService.clear();this.clear.emit(null)};t.prototype.insertTabAt=function(e,t){this.callEventAdd("at",e,t)};t.prototype.insertTabBefore=function(e,t){this.callEventAdd("ref",e,-1,t)};t.prototype.insertTabAfter=function(e,t){this.callEventAdd("ref",e,-1,t,!0)};t.prototype.removeTab=function(e){return this.callEventRemove(e)};t.prototype.removeTabAt=function(e){if(this.tabs&&e>=0&&e<this.tabs.length)return this.callEventRemove(this.tabs[e]);else return!1};t.prototype.callEventAdd=function(e,t,i,r,n){var o={cancel:!1,tab:t};this.tabAdding.emit(o);if(1!=o.cancel){switch(e){case"at":this.dataService.insert(t,i);break;case"ref":this.dataService.insertByRef(t,r,n);break;default:this.dataService.insert(t)}this.tabAdded.emit({tab:t});if(!this.selectedComponent)this.selectComponentByIndex(0)}};t.prototype.callEventRemove=function(e){var t={cancel:!1,tab:e};this.tabRemoving.emit(t);if(1!=t.cancel){this.removeIndex=this.tabs?this.tabs.indexOf(e):-1;this.dataService.removeAt(e);this.tabRemoved.emit({tab:e});return!0}return!1};t.prototype.animate=function(){switch(this.animation){case integralui_core_1.IntegralUIAnimationType.Fade:if(this.allowAnimation)this.fadeTabContent();break;case integralui_core_1.IntegralUIAnimationType.Slide:if(this.allowAnimation&&this.prevComponent&&this.selectedComponent)if(this.currentTabPlacement===integralui_core_1.IntegralUITabStripPlacement.Left||this.currentTabPlacement===integralui_core_1.IntegralUITabStripPlacement.Right)this.slideTabContentVertical();else this.slideTabContentHorizontal();else{var e=this.currentTabPlacement===integralui_core_1.IntegralUITabStripPlacement.Left||this.currentTabPlacement===integralui_core_1.IntegralUITabStripPlacement.Right?!0:!1,t=e?this.clientRect.height:this.clientRect.width;if(this.prevComponent){this.prevComponent.updatePos(e?{top:-t}:{left:-t});this.prevComponent.updateOpacity(0);this.prevComponent.updateContentOverflow()}if(this.selectedComponent){this.selectedComponent.updatePos(e?{top:0}:{left:0});this.selectedComponent.updateOpacity(1);this.selectedComponent.updateContentOverflow()}var i=this.getTabCurrentIndex(this.selectedComponent);this.updateTabLine(i)}}};t.prototype.fadeTabContent=function(){var e=this;e.removeAnimationTimer();var t=0,i=1/e.getAnimationFactor();if(e.prevComponent){e.prevComponent.updateOpacity(1);e.prevComponent.updateVisibility(!1);e.prevComponent.updateContentOverflow("hidden")}if(e.selectedComponent){e.selectedComponent.updateOpacity(0);e.selectedComponent.updateVisibility(!1);e.selectedComponent.updateContentOverflow("hidden")}e.animationTimer=setInterval(function(){if(t<1){t+=i;if(e.prevComponent)e.prevComponent.updateOpacity(1-t);if(e.selectedComponent)e.selectedComponent.updateOpacity(t)}else{t=1;if(e.prevComponent){e.prevComponent.updateOpacity(0);e.prevComponent.updateVisibility(!0);e.prevComponent.updateContentOverflow()}if(e.selectedComponent){e.selectedComponent.updateOpacity(1);e.selectedComponent.updateContentOverflow()}e.removeAnimationTimer()}},15)};t.prototype.getAnimationFactor=function(){var e=15;switch(this.animationSpeed){case integralui_core_1.IntegralUISpeedMode.VerySlow:e=25;break;case integralui_core_1.IntegralUISpeedMode.Slow:e=20;break;case integralui_core_1.IntegralUISpeedMode.Fast:e=10;break;case integralui_core_1.IntegralUISpeedMode.VeryFast:e=5}return e};t.prototype.removeAnimationTimer=function(){if(this.animationTimer)clearInterval(this.animationTimer)};t.prototype.slideTabContentHorizontal=function(){var e=this;e.removeAnimationTimer();var t=e.clientRect.width;if(t<=0){if(e.prevComponent){e.prevComponent.updatePos({left:-9999999});e.prevComponent.updateOpacity(0);e.prevComponent.updateContentOverflow()}if(e.selectedComponent){e.selectedComponent.updatePos({left:0});e.selectedComponent.updateOpacity(1);e.selectedComponent.updateContentOverflow()}}else{var i=0,r=e.getAnimationFactor(),n=t/r,o=e.getTabCurrentIndex(e.selectedComponent)<e.getTabCurrentIndex(e.prevComponent)?"backward":"forward";if("forward"===o){if(e.prevComponent){e.prevComponent.updatePos({left:0});e.prevComponent.updateOpacity(1);e.prevComponent.updateContentOverflow("hidden")}if(e.selectedComponent){e.selectedComponent.updatePos({left:t});e.selectedComponent.updateOpacity(0);e.selectedComponent.updateContentOverflow("hidden")}}else{if(e.prevComponent){e.prevComponent.updatePos({left:0});e.prevComponent.updateOpacity(1);e.prevComponent.updateContentOverflow("hidden")}if(e.selectedComponent){e.selectedComponent.updatePos({left:-t});e.selectedComponent.updateOpacity(0);e.selectedComponent.updateContentOverflow("hidden")}}var a=e.getTabCurrentIndex(e.prevComponent),l=e.getTabCurrentIndex(e.selectedComponent),c=e.commonService.isIndexInRange(a,e.tabHeaderRect),s=e.commonService.isIndexInRange(l,e.tabHeaderRect),p=c&&s?e.tabHeaderRect[l].left-e.tabHeaderRect[a].left:0,h=c&&s?e.tabHeaderRect[l].width-e.tabHeaderRect[a].width:0,d=p/r,u=h/r;e.animationTimer=setInterval(function(){if("forward"===o)if(i>-t){i-=n;if(e.prevComponent){e.prevComponent.updatePos({left:i});e.prevComponent.updateOpacity(1-Math.abs(i/t))}if(e.selectedComponent){e.selectedComponent.updatePos({left:t+i});e.selectedComponent.updateOpacity(1-Math.abs((t+i)/t))}e.selTabLinePos.left+=d;e.selTabLineSize.width+=u}else{i=-t;if(e.prevComponent){e.prevComponent.updatePos({left:-t});e.prevComponent.updateOpacity(0);e.prevComponent.updateContentOverflow()}if(e.selectedComponent){e.selectedComponent.updatePos({left:0});e.selectedComponent.updateOpacity(1);e.selectedComponent.updateContentOverflow()}e.updateTabLine(l);e.removeAnimationTimer()}else if(i<t){i+=n;if(e.prevComponent){e.prevComponent.updatePos({left:i});e.prevComponent.updateOpacity(1-Math.abs(i/t))}if(e.selectedComponent){e.selectedComponent.updatePos({left:-t+i});e.selectedComponent.updateOpacity(1-Math.abs((-t+i)/t))}e.selTabLinePos.left+=d;e.selTabLineSize.width+=u}else{i=-t;if(e.prevComponent){e.prevComponent.updatePos({left:t});e.prevComponent.updateOpacity(0);e.prevComponent.updateContentOverflow()}if(e.selectedComponent){e.selectedComponent.updatePos({left:0});e.selectedComponent.updateOpacity(1);e.selectedComponent.updateContentOverflow()}e.updateTabLine(l);e.removeAnimationTimer()}},15)}};t.prototype.slideTabContentVertical=function(){var e=this;e.removeAnimationTimer();var t=e.clientRect.height;if(t<=0){if(e.prevComponent){e.prevComponent.updatePos({top:-t});e.prevComponent.updateOpacity(0);e.prevComponent.updateContentOverflow()}if(e.selectedComponent){e.selectedComponent.updatePos({top:0});e.selectedComponent.updateOpacity(1);e.selectedComponent.updateContentOverflow()}}else{var i=0,r=e.getAnimationFactor(),n=t/r,o=e.getTabCurrentIndex(e.selectedComponent)<e.getTabCurrentIndex(e.prevComponent)?"backward":"forward";if("forward"===o){if(e.prevComponent){e.prevComponent.updatePos({top:0});e.prevComponent.updateOpacity(1);e.prevComponent.updateContentOverflow("hidden")}if(e.selectedComponent){e.selectedComponent.updatePos({top:t});e.selectedComponent.updateOpacity(0);e.selectedComponent.updateContentOverflow("hidden")}}else{if(e.prevComponent){e.prevComponent.updatePos({top:0});e.prevComponent.updateOpacity(1);e.prevComponent.updateContentOverflow("hidden")}if(e.selectedComponent){e.selectedComponent.updatePos({top:-t});e.selectedComponent.updateOpacity(0);e.selectedComponent.updateContentOverflow("hidden")}}var a=e.getTabCurrentIndex(e.prevComponent),l=e.getTabCurrentIndex(e.selectedComponent),c=e.commonService.isIndexInRange(a,e.tabHeaderRect),s=e.commonService.isIndexInRange(l,e.tabHeaderRect),p=c&&s?e.tabHeaderRect[l].top-e.tabHeaderRect[a].top:s?e.tabHeaderRect[l].height:0,h=c&&s?e.tabHeaderRect[l].height-e.tabHeaderRect[a].height:0,d=p/r,u=h/r;e.animationTimer=setInterval(function(){if("forward"===o)if(i>-t){i-=n;if(e.prevComponent){e.prevComponent.updatePos({top:i});e.prevComponent.updateOpacity(1-Math.abs(i/t))}if(e.selectedComponent){e.selectedComponent.updatePos({top:t+i});e.selectedComponent.updateOpacity(1-Math.abs((t+i)/t))}e.selTabLinePos.top+=d;e.selTabLineSize.height+=u}else{i=-t;if(e.prevComponent){e.prevComponent.updatePos({top:-t});e.prevComponent.updateOpacity(0);e.prevComponent.updateContentOverflow()}if(e.selectedComponent){e.selectedComponent.updatePos({top:0});e.selectedComponent.updateOpacity(1);e.selectedComponent.updateContentOverflow()}e.updateTabLine(l);e.removeAnimationTimer()}else if(i<t){i+=n;if(e.prevComponent){e.prevComponent.updatePos({top:i});e.prevComponent.updateOpacity(1-Math.abs(i/t))}if(e.selectedComponent){e.selectedComponent.updatePos({top:-t+i});e.selectedComponent.updateOpacity(1-Math.abs((-t+i)/t))}e.selTabLinePos.top+=d;e.selTabLineSize.height+=u}else{i=-t;if(e.prevComponent){e.prevComponent.updatePos({top:t});e.prevComponent.updateOpacity(0);e.prevComponent.updateContentOverflow()}if(e.selectedComponent){e.selectedComponent.updatePos({top:0});e.selectedComponent.updateOpacity(1);e.selectedComponent.updateContentOverflow()}e.updateTabLine(l);e.removeAnimationTimer()}},15)}};t.prototype.attachTabEvents=function(){};t.prototype.getTabCurrentIndex=function(e){this.tabList=this.contentList.toArray();return e&&this.tabList?this.tabList.indexOf(e):-1};t.prototype.getTabDataIndex=function(e){if(e){var t=this.getTabCurrentIndex(e);if(this.tabs&&t>=0&&t<this.tabs.length)return t}return-1};t.prototype.getTabData=function(e){return this.tabs&&e>=0&&e<this.tabs.length?this.tabs[e]:null};t.prototype.getTabIndex=function(e){return e&&this.tabs?this.tabs.indexOf(e):-1};t.prototype.getComponentData=function(e){if(e)if(e.data)return e.data;else{var t=this.getTabDataIndex(e);if(this.tabs&&t>=0&&t<this.tabs.length)return this.tabs[t]}return null};t.prototype.isIndexInRange=function(e){if(this.contentList)this.tabList=this.contentList.toArray();return this.tabList?e>=0&&e<this.tabList.length:!1};t.prototype.calcEmptyTabSpace=function(){var e=this,t=e.tabHeaders.toArray();if(t&&t.length>0){var i=0;t.forEach(function(t,r){e.elemRenderer.setStyle(t.nativeElement,"width","auto");e.elemRenderer.setStyle(t.nativeElement,"height","auto");if(e.currentTabPlacement===integralui_core_1.IntegralUITabStripPlacement.Left||e.currentTabPlacement===integralui_core_1.IntegralUITabStripPlacement.Right)i+=t.nativeElement.offsetHeight+e.tabSpacing-1;else i+=t.nativeElement.offsetWidth+e.tabSpacing-1});if(e.currentTabPlacement===integralui_core_1.IntegralUITabStripPlacement.Left||e.currentTabPlacement===integralui_core_1.IntegralUITabStripPlacement.Right)e.emptyTabSpace=e.clientRect.height+1-i;else e.emptyTabSpace=e.clientRect.width+1-i;e.emptyTabSpace=Math.max(0,e.emptyTabSpace/t.length)}};t.prototype.resetLayout=function(){if(this.updateTimer)clearTimeout(this.updateTimer);this.updateTimer=null};t.prototype.updateLayout=function(){this.updateTabLayout()};t.prototype.updateTabLine=function(e){if(e>=0&&e<this.tabHeaderRect.length)switch(this.currentTabPlacement){case integralui_core_1.IntegralUITabStripPlacement.Right:this.selTabLinePos={top:this.tabHeaderRect[e].top-this.currentScrollPos,left:this.contentBlockPos.left};this.selTabLineSize={width:2,height:this.tabHeaderRect[e].height};if(this.currentScrollMode===integralui_core_1.IntegralUITabScrollMode.OutBound&&this.isScrollAllowed)this.selTabLinePos.top+=this.scrollButtonSize.height+4;break;case integralui_core_1.IntegralUITabStripPlacement.Bottom:this.selTabLinePos={top:this.contentBlockPos.top,left:this.tabHeaderRect[e].left-this.currentScrollPos};this.selTabLineSize={width:this.tabHeaderRect[e].width,height:2};if(this.currentScrollMode===integralui_core_1.IntegralUITabScrollMode.OutBound&&this.isScrollAllowed)this.selTabLinePos.left+=this.scrollButtonSize.width+2;break;case integralui_core_1.IntegralUITabStripPlacement.Left:this.selTabLinePos={top:this.tabHeaderRect[e].top-this.currentScrollPos,left:this.contentBlockPos.left-2};this.selTabLineSize={width:2,height:this.tabHeaderRect[e].height};if(this.currentScrollMode===integralui_core_1.IntegralUITabScrollMode.OutBound&&this.isScrollAllowed)this.selTabLinePos.top+=this.scrollButtonSize.height+4;break;default:this.selTabLinePos={top:this.contentBlockPos.top-1,left:this.tabHeaderRect[e].left-this.currentScrollPos};this.selTabLineSize={width:this.tabHeaderRect[e].width,height:2};if(this.currentScrollMode===integralui_core_1.IntegralUITabScrollMode.OutBound&&this.isScrollAllowed)this.selTabLinePos.left+=this.scrollButtonSize.width+2}};t.prototype.updateTabLayout=function(){var e=this;e.resetLayout();e.updateTimer=setTimeout(function(){e.commonService.getMargin(e.elemRef.nativeElement.firstElmentChild);e.clientRect={width:e.elemRef.nativeElement.firstElementChild.clientWidth,height:e.elemRef.nativeElement.firstElementChild.clientHeight};var t=e.toolbarLeftElem?e.commonService.getMargin(e.toolbarLeftElem.nativeElement):{top:0,right:0,bottom:0,left:0},i=e.toolbarRightElem?e.commonService.getMargin(e.toolbarRightElem.nativeElement):{top:0,right:0,bottom:0,left:0};e.tabStripSize={width:e.toolbarLeftElem&&e.toolbarRightElem?e.clientRect.width-2-(e.toolbarLeftElem.nativeElement.offsetWidth+t.left+t.right)-(e.toolbarRightElem.nativeElement.offsetWidth+i.left+i.right):e.clientRect.width,height:e.clientRect.height};e.scrollBlockSize=e.scrollInBoundElem?{width:e.scrollInBoundElem.nativeElement.offsetWidth,height:e.scrollInBoundElem.nativeElement.offsetHeight}:{width:0,height:0};e.scrollButtonSize=e.scrollButtonElem?{width:e.scrollButtonElem.nativeElement.offsetWidth,height:e.scrollButtonElem.nativeElement.offsetHeight}:{width:0,height:0};e.tabList=e.contentList.toArray();if(e.tabHeaders){var r={x:0,y:0},n={width:0,height:0},o={top:0,left:0},a={width:0,height:0};e.tabSize={width:0,height:0};e.tabHeaderRect.length=0;e.orgTabHeaderSpace.length=0;var l=e.tabHeaders.toArray();if(l&&l.length>0){e.calcEmptyTabSpace();l.forEach(function(t,i){e.elemRenderer.setStyle(t.nativeElement,"width","auto");e.elemRenderer.setStyle(t.nativeElement,"height","auto");var o=e.commonService.getPadding(t.nativeElement),a=e.commonService.getBorderWidth(t.nativeElement);n={width:t.nativeElement.offsetWidth,height:t.nativeElement.offsetHeight};e.orgTabHeaderSpace.push({border:a,padding:o,size:n});if(e.currentDisplayMode===integralui_core_1.IntegralUITabDisplayMode.Justified)if(e.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Left||e.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Right)n.height+=e.emptyTabSpace;else n.width+=e.emptyTabSpace;var l={top:0,left:r.x,width:n.width,height:n.height};switch(e.currentTabPlacement){case integralui_core_1.IntegralUITabStripPlacement.Right:e.tabstripPos={top:-e.currentScrollPos+"px",right:"0",bottom:"auto",left:"auto"};if(e.currentScrollMode==integralui_core_1.IntegralUITabScrollMode.OutBound)e.tabstripPos.top=e.scrollButtonSize.height+4-e.currentScrollPos+"px";e.elemRenderer.setStyle(t.nativeElement,"top",r.y+"px");e.elemRenderer.setStyle(t.nativeElement,"right","0");e.elemRenderer.setStyle(t.nativeElement,"bottom","auto");e.elemRenderer.setStyle(t.nativeElement,"left","auto");if(e.tabSize.width<n.width)e.tabSize.width=n.width;break;case integralui_core_1.IntegralUITabStripPlacement.Bottom:e.tabstripPos={top:"auto",right:"auto",bottom:"0",left:-e.currentScrollPos+"px"};if(e.currentScrollMode==integralui_core_1.IntegralUITabScrollMode.OutBound)e.tabstripPos.left=e.scrollButtonSize.width+2-e.currentScrollPos+"px";e.elemRenderer.setStyle(t.nativeElement,"top","auto");e.elemRenderer.setStyle(t.nativeElement,"right","auto");e.elemRenderer.setStyle(t.nativeElement,"bottom","0");e.elemRenderer.setStyle(t.nativeElement,"left",r.x+"px");if(e.currentDisplayMode===integralui_core_1.IntegralUITabDisplayMode.Justified&&e.emptyTabSpace>0)e.elemRenderer.setStyle(t.nativeElement,"width",t.nativeElement.offsetWidth-(o.left+o.right)-(a.left+a.right)+e.emptyTabSpace+"px");if(e.tabSize.height<n.height)e.tabSize.height=n.height;break;case integralui_core_1.IntegralUITabStripPlacement.Left:e.tabstripPos={top:-e.currentScrollPos+"px",right:"auto",bottom:"auto",left:"0"};if(e.currentScrollMode==integralui_core_1.IntegralUITabScrollMode.OutBound)e.tabstripPos.top=e.scrollButtonSize.height+4-e.currentScrollPos+"px";e.elemRenderer.setStyle(t.nativeElement,"top",r.y+"px");e.elemRenderer.setStyle(t.nativeElement,"right","auto");e.elemRenderer.setStyle(t.nativeElement,"bottom","auto");e.elemRenderer.setStyle(t.nativeElement,"left","0");if(e.tabSize.width<n.width)e.tabSize.width=n.width;break;default:e.tabstripPos={top:"0",right:"auto",bottom:"auto",left:-e.currentScrollPos+"px"};if(e.currentScrollMode==integralui_core_1.IntegralUITabScrollMode.OutBound)e.tabstripPos.left=e.scrollButtonSize.width+2-e.currentScrollPos+"px";e.elemRenderer.setStyle(t.nativeElement,"top","0");e.elemRenderer.setStyle(t.nativeElement,"right","auto");e.elemRenderer.setStyle(t.nativeElement,"bottom","auto");e.elemRenderer.setStyle(t.nativeElement,"left",r.x+"px");if(e.currentDisplayMode===integralui_core_1.IntegralUITabDisplayMode.Justified&&e.emptyTabSpace>0)e.elemRenderer.setStyle(t.nativeElement,"width",t.nativeElement.offsetWidth-(o.left+o.right)-(a.left+a.right)+e.emptyTabSpace+"px");if(e.tabSize.height<n.height)e.tabSize.height=n.height}if(e.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Left||e.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Right)l.top=r.y;e.tabHeaderRect.push(l);var c=e.tabSpacing;r.x+=n.width+c-1;r.y+=n.height+c-1});var c=e.commonService.getBorderWidth(e.elemRef.nativeElement.children[0]),s=e.toolbarLeftElem&&e.toolbarRightElem?Math.max(e.toolbarLeftElem.nativeElement.offsetHeight,e.toolbarRightElem.nativeElement.offsetHeight)+1:0;e.tabPos={top:s>e.tabSize.height?s-e.tabSize.height:0,left:0};switch(e.currentTabPlacement){case integralui_core_1.IntegralUITabStripPlacement.Right:e.blockPos={top:"0",right:"0",bottom:"auto",left:"auto"};e.tabStripSize.width=e.tabSize.width;e.contentBlockPos={top:0,left:0};e.contentBlockSize={width:e.elemRef.nativeElement.children[0].clientWidth-e.tabStripSize.width-(c.left+c.right),height:e.elemRef.nativeElement.children[0].clientHeight-(c.top+c.bottom)};break;case integralui_core_1.IntegralUITabStripPlacement.Bottom:e.blockPos={top:"auto",right:"auto",bottom:"0",left:e.toolbarLeftElem?e.toolbarLeftElem.nativeElement.offsetWidth+"px":"0"};e.tabStripSize.height=s>e.tabSize.height?s:e.tabSize.height;e.contentBlockPos={top:0,left:0};e.contentBlockSize={width:e.elemRef.nativeElement.children[0].clientWidth-(c.left+c.right),height:e.elemRef.nativeElement.children[0].clientHeight-e.tabStripSize.height-(c.top+c.bottom)};e.toolbarPos={top:"auto",bottom:"0"};break;case integralui_core_1.IntegralUITabStripPlacement.Left:e.blockPos={top:"0",right:"auto",bottom:"auto",left:"0"};e.tabStripSize.width=e.tabSize.width;e.contentBlockPos={top:0,left:e.tabStripSize.width};e.contentBlockSize={width:e.elemRef.nativeElement.children[0].clientWidth-e.tabStripSize.width-(c.left+c.right),height:e.elemRef.nativeElement.children[0].clientHeight-(c.top+c.bottom)};break;default:e.blockPos={top:"0",right:"auto",bottom:"auto",left:e.toolbarLeftElem?e.toolbarLeftElem.nativeElement.offsetWidth+"px":"0"};e.tabStripSize.height=s>e.tabSize.height?s:e.tabSize.height;e.contentBlockPos={top:e.tabStripSize.height-1,left:0};e.contentBlockSize={width:e.elemRef.nativeElement.children[0].clientWidth-(c.left+c.right),height:e.elemRef.nativeElement.children[0].clientHeight-e.tabStripSize.height-(c.top+c.bottom-1)};e.toolbarPos={top:"0",bottom:"auto"}}l.forEach(function(t,i){var r=e.commonService.getPadding(t.nativeElement);switch(e.currentTabPlacement){case integralui_core_1.IntegralUITabStripPlacement.Right:e.elemRenderer.setStyle(t.nativeElement,"width",e.tabSize.width-(r.left+r.right)-1+"px");o={top:e.animation===integralui_core_1.IntegralUIAnimationType.Slide?-e.clientRect.height:0,left:0};a={width:e.elemRef.nativeElement.children[0].clientWidth-(c.left+c.right-1)-e.tabStripSize.width-2,height:e.elemRef.nativeElement.children[0].clientHeight-(c.top+c.bottom)};break;case integralui_core_1.IntegralUITabStripPlacement.Bottom:e.elemRenderer.setStyle(t.nativeElement,"bottom",e.tabPos.top+"px");e.elemRenderer.setStyle(t.nativeElement,"height",e.tabSize.height-(r.top+r.bottom)+"px");o={top:0,left:e.animation===integralui_core_1.IntegralUIAnimationType.Slide?-e.clientRect.width:0};a={width:e.elemRef.nativeElement.children[0].clientWidth-(c.left+c.right),height:e.elemRef.nativeElement.children[0].clientHeight-e.tabStripSize.height-(c.top+c.bottom-1)};break;case integralui_core_1.IntegralUITabStripPlacement.Left:e.elemRenderer.setStyle(t.nativeElement,"width",e.tabSize.width-(r.left+r.right)-1+"px");o={top:e.animation===integralui_core_1.IntegralUIAnimationType.Slide?-e.clientRect.height:0,left:0};a={width:e.elemRef.nativeElement.children[0].clientWidth-(c.left+c.right-1)-e.tabStripSize.width-2,height:e.elemRef.nativeElement.children[0].clientHeight-(c.top+c.bottom)};break;default:e.elemRenderer.setStyle(t.nativeElement,"top",e.tabPos.top+"px");o={top:0,left:e.animation===integralui_core_1.IntegralUIAnimationType.Slide?-e.clientRect.width:0};a={width:e.elemRef.nativeElement.children[0].clientWidth-(c.left+c.right),height:e.elemRef.nativeElement.children[0].clientHeight-e.tabStripSize.height-(c.top+c.bottom-1)};if(e.autoSizeValue)a.height="auto"}})}if(e.tabList&&e.tabList.length>0)e.tabList.forEach(function(t){t.animation=e.animation;t.updateLayout(o,a,e.animation===integralui_core_1.IntegralUIAnimationType.Slide?!1:!0)});e.maxScrollPos=0;if(e.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Left||e.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Right){e.maxScrollPos+=r.y-e.tabSpacing+1-e.clientRect.height;if(e.maxScrollPos>0)if(e.currentScrollMode==integralui_core_1.IntegralUITabScrollMode.OutBound)e.maxScrollPos+=2*(e.scrollButtonSize.height+4);else e.maxScrollPos+=e.scrollBlockSize.height}else{e.maxScrollPos+=r.x-e.tabSpacing+1-e.clientRect.width;e.maxScrollPos+=e.toolbarLeftElem?e.toolbarLeftElem.nativeElement.offsetWidth+t.left+t.right:0;e.maxScrollPos+=e.toolbarRightElem?e.toolbarRightElem.nativeElement.offsetWidth+i.left+i.right:0;if(e.maxScrollPos>0)if(e.currentScrollMode==integralui_core_1.IntegralUITabScrollMode.OutBound)e.maxScrollPos+=2*(e.scrollButtonSize.width+2);else{var p=e.scrollInBoundElem?e.commonService.getPadding(e.scrollInBoundElem.nativeElement):{top:0,right:0,bottom:0,left:0};e.maxScrollPos+=e.scrollBlockSize.width+p.left+p.right}}e.maxScrollPos=Math.max(e.maxScrollPos,0);e.isScrollAllowed=e.maxScrollPos>0&&e.currentScrollMode!==integralui_core_1.IntegralUITabScrollMode.None;if(!e.isScrollAllowed)if(e.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Left||e.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Right)e.tabstripPos.top=-e.currentScrollPos+"px";else e.tabstripPos.left=-e.currentScrollPos+"px";if(e.selectedComponent){e.selectedComponent.updatePos({left:0,top:0});e.selectedComponent.updateOpacity(1);e.selectedComponent.updateVisibility(!1)}var h=e.getTabCurrentIndex(e.selectedComponent);e.updateTabLine(h)}clearTimeout(e.updateTimer)},1)};t.prototype.updateTabHeaders=function(){var e=this,t={x:0,y:0},i={width:0,height:0};e.tabHeaderRect.length=0;var r=e.tabHeaders.toArray();if(r&&r.length>0)r.forEach(function(r,n){e.elemRenderer.setStyle(r.nativeElement,"width","auto");e.elemRenderer.setStyle(r.nativeElement,"height","auto");i={width:r.nativeElement.offsetWidth,height:r.nativeElement.offsetHeight};if(e.currentDisplayMode===integralui_core_1.IntegralUITabDisplayMode.Justified)if(e.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Left||e.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Right)i.height+=e.emptyTabSpace;else i.width+=e.emptyTabSpace;var o=e.commonService.getPadding(r.nativeElement),a=e.commonService.getBorderWidth(r.nativeElement),l={top:0,left:t.x,width:i.width,height:i.height};switch(e.currentTabPlacement){case integralui_core_1.IntegralUITabStripPlacement.Right:e.elemRenderer.setStyle(r.nativeElement,"top",t.y+"px");e.elemRenderer.setStyle(r.nativeElement,"right","0");e.elemRenderer.setStyle(r.nativeElement,"bottom","auto");e.elemRenderer.setStyle(r.nativeElement,"left","auto");break;case integralui_core_1.IntegralUITabStripPlacement.Bottom:e.elemRenderer.setStyle(r.nativeElement,"top","auto");e.elemRenderer.setStyle(r.nativeElement,"right","auto");e.elemRenderer.setStyle(r.nativeElement,"bottom",e.tabPos.top+"px");e.elemRenderer.setStyle(r.nativeElement,"left",t.x+"px");if(e.currentDisplayMode===integralui_core_1.IntegralUITabDisplayMode.Justified&&e.emptyTabSpace>0)e.elemRenderer.setStyle(r.nativeElement,"width",r.nativeElement.offsetWidth-(o.left+o.right)-(a.left+a.right)+e.emptyTabSpace+"px");break;case integralui_core_1.IntegralUITabStripPlacement.Left:e.elemRenderer.setStyle(r.nativeElement,"top",t.y+"px");e.elemRenderer.setStyle(r.nativeElement,"right","auto");e.elemRenderer.setStyle(r.nativeElement,"bottom","auto");e.elemRenderer.setStyle(r.nativeElement,"left","0");break;default:e.elemRenderer.setStyle(r.nativeElement,"top",e.tabPos.top+"px");e.elemRenderer.setStyle(r.nativeElement,"right","auto");e.elemRenderer.setStyle(r.nativeElement,"bottom","auto");e.elemRenderer.setStyle(r.nativeElement,"left",t.x+"px");if(e.currentDisplayMode===integralui_core_1.IntegralUITabDisplayMode.Justified&&e.emptyTabSpace>0)e.elemRenderer.setStyle(r.nativeElement,"width",r.nativeElement.offsetWidth-(o.left+o.right)-(a.left+a.right)+e.emptyTabSpace+"px")}if(e.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Left||e.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Right)l.top=t.y;e.tabHeaderRect.push(l);var c=e.tabSpacing;t.x+=i.width+c-1;t.y+=i.height+c-1})};t.prototype.tabMouseDown=function(e,t){if(this.isEnabled)this.selectComponent(t);if(this.isEnabled)switch(e.which){case 1:this.selectComponent(t);if(this.allowDrag&&t.allowDrag){this.startTabReorder=!0;this.reorderTabStartPos={top:e.pageY+this.currentScrollPos,left:e.pageX+this.currentScrollPos}}break;case 2:this.selectComponent(t)}};t.prototype.tabMouseMove=function(e,t){if(this.isEnabled&&1===e.which)if(this.startTabReorder){this.reorderTabCurrentPos={top:e.pageY,left:e.pageX};var i={dx:Math.abs(this.reorderTabCurrentPos.left+this.currentScrollPos-this.reorderTabStartPos.left),dy:Math.abs(this.reorderTabCurrentPos.top+this.currentScrollPos-this.reorderTabStartPos.top)};if(!this.tabReorderActive&&(i.dx>3||i.dy>3)){this.tabReorderActive=!0;this.reorderTab=t;this.ctrlCursor="move";this.orgHeaderList=this.tabHeaders.toArray();this.orgReorderTabIndex=this.tabList.indexOf(this.reorderTab);this.updateReorderTabPos()}}};t.prototype.tabEnter=function(e,t){if(this.isEnabled&&!t.selected)t.state|=integralui_core_1.IntegralUIObjectState.hovered};t.prototype.tabLeave=function(e,t){t.state&=~integralui_core_1.IntegralUIObjectState.hovered};t.prototype.ctrlMouseMove=function(e){if(this.isEnabled&&1==e.which)if(this.tabReorderActive&&this.reorderTab){this.reorderTabCurrentPos.left=e.pageX;this.updateReorderTabPos();this.processDragScroll(e);e.stopPropagation()}};t.prototype.ctrlMouseUp=function(e){var t=this;if(1==e.which)if(t.reorderTab&&t.reorderNewTabIndex>=0&&t.reorderNewTabIndex<t.tabList.length)if(t.orgReorderTabIndex!=t.reorderNewTabIndex){var i={tab:t.getComponentData(t.reorderTab)};t.commonService.moveObject(t.orgReorderTabIndex,t.reorderNewTabIndex,t.tabs);setTimeout(function(){t.tabList=t.contentList.toArray();t.updateLayout();t.tabOrderChanged.emit(i)},1)}this.resetReorderTabSettings()};t.prototype.updateReorderTabPos=function(){if(this.reorderTab){var e={width:0,height:0},t={width:0,height:0};this.reorderTabIndex=this.tabList.indexOf(this.reorderTab);this.reorderNewTabIndex=this.reorderTabIndex;var i=this.orgHeaderList,r=0;for(r=0;r<i.length&&r<this.orgReorderTabIndex;r++){t={width:i[r].nativeElement.offsetWidth,height:i[r].nativeElement.offsetHeight};if(this.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Left||this.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Right)e.height+=t.height+this.tabSpacing-1;else e.width+=t.width+this.tabSpacing-1}var n={width:0,height:0};if(r<i.length&&r==this.orgReorderTabIndex){n={width:i[r].nativeElement.offsetWidth,height:i[r].nativeElement.offsetHeight};var o=0;if(this.currentScrollMode==integralui_core_1.IntegralUITabScrollMode.OutBound&&this.isScrollAllowed)if(this.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Left||this.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Right)o=this.scrollButtonSize.height+4;else o=this.scrollButtonSize.width+2;if(this.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Left||this.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Right){this.reorderTabPos.top=e.height+this.reorderTabCurrentPos.top-this.reorderTabStartPos.top+o;this.reorderTabPos.top=Math.max(0,Math.min(this.reorderTabPos.top,this.clientRect.height-n.height))}else{this.reorderTabPos.left=e.width+this.reorderTabCurrentPos.left-this.reorderTabStartPos.left+o;this.reorderTabPos.left=Math.max(0,Math.min(this.reorderTabPos.left,this.clientRect.width-n.width))}}e={width:0,height:0};for(var a=this.commonService.getPageRect(this.elemRef.nativeElement),l=0;l<this.tabs.length;l++)if(l<i.length){t={width:i[l].nativeElement.offsetWidth,height:i[l].nativeElement.offsetHeight};if(this.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Left||this.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Right){e.height+=t.height;if(this.reorderTabCurrentPos.top-a.top<e.height-this.currentScrollPos){this.reorderNewTabIndex=l;break}}else{e.width+=t.width;if(this.reorderTabCurrentPos.left-a.left<e.width-this.currentScrollPos){this.reorderNewTabIndex=l;break}}}if(this.reorderTabIndex!=this.reorderNewTabIndex){this.commonService.moveObject(this.reorderTabIndex,this.reorderNewTabIndex,this.tabList);this.changeRef.detectChanges();this.updateTabHeaders()}}};t.prototype.resetReorderTabSettings=function(){this.reorderTab=null;this.tabReorderActive=!1;this.startTabReorder=!1;this.ctrlCursor="default";this.reorderTabStartPos={top:0,left:0};this.reorderTabCurrentPos={top:0,left:0};this.reorderTabPos={top:0,left:0}};t.prototype.getTabOpacity=function(e){if(this.tabReorderActive&&e==this.reorderTab)return 0;else return 1};t.prototype.onWindowMouseUp=function(e){this.resetReorderTabSettings()};t.prototype.getLastTabIndex=function(){var e=this.dataService.getList();return e?e.length-1:-1};t.prototype.getPrevTab=function(e){var t=null;if(e){var i=this.dataService.getList(),r=i.indexOf(e);if((r=r>0?r-1:-1)>=0)t=i[r]}return t};t.prototype.getNextTab=function(e){var t=null;if(e){var i=this.dataService.getList(),r=i.indexOf(e);if((r=r<i.length-1?r+1:-1)>=0)t=i[r]}return t};t.prototype.moveTab=function(e,t,i,r){if(e){var n=-1;switch(t){case integralui_core_1.IntegralUIMoveDirection.At:n=r;break;case integralui_core_1.IntegralUIMoveDirection.Down:i=this.getNextTab(e);break;case integralui_core_1.IntegralUIMoveDirection.First:n=0;break;case integralui_core_1.IntegralUIMoveDirection.Last:n=this.getLastTabIndex();break;case integralui_core_1.IntegralUIMoveDirection.Left:i=this.getPrevTab(e);break;case integralui_core_1.IntegralUIMoveDirection.Right:i=this.getNextTab(e);break;case integralui_core_1.IntegralUIMoveDirection.Up:i=this.getPrevTab(e)}this.moveTabAt(e,i,t,n);this.tabs=this.dataService.getList();this.selectTab(e);this.updateLayout();this.change.emit({type:"move-tab"});this.scrollTo(e)}};t.prototype.moveTabAt=function(e,t,i,r){if(this.removeTab(e))if(i==integralui_core_1.IntegralUIMoveDirection.First||i==integralui_core_1.IntegralUIMoveDirection.Right||i==integralui_core_1.IntegralUIMoveDirection.Last||i==integralui_core_1.IntegralUIMoveDirection.At)this.insertTabAt(e,r);else if(i==integralui_core_1.IntegralUIMoveDirection.Before||i==integralui_core_1.IntegralUIMoveDirection.Up)this.insertTabBefore(e,t);else if(i==integralui_core_1.IntegralUIMoveDirection.After||i==integralui_core_1.IntegralUIMoveDirection.Left||i==integralui_core_1.IntegralUIMoveDirection.Down)this.insertTabAfter(e,t)};t.prototype.scrollPos=function(e){if(void 0!=e){this.currentScrollPos=Math.max(0,Math.min(e,this.maxScrollPos));this.updateLayout();this.scrollPosChanged.emit({value:this.currentScrollPos})}return Math.floor(this.currentScrollPos)};t.prototype.startScroll=function(e){var t=this;if(t.scrollTimer)clearInterval(t.scrollTimer);t.scrollCount=0;t.isScrollActive=!0;t.scrollTimer=setInterval(function(){t.scrollTimerElapsed(e)},100)};t.prototype.stopScroll=function(){if(this.scrollTimer)clearInterval(this.scrollTimer);this.isScrollActive=!1};t.prototype.processScroll=function(e){if(e)if(this.currentScrollPos+this.scrollCount<this.maxScrollPos)this.currentScrollPos+=this.scrollCount;else{this.stopScrolling=!0;this.currentScrollPos=this.maxScrollPos}else if(this.currentScrollPos-this.scrollCount>0)this.currentScrollPos-=this.scrollCount;else{this.stopScrolling=!0;this.currentScrollPos=0}this.scrollTabs();var t=this.getTabCurrentIndex(this.selectedComponent);this.updateTabLine(t);this.scrollPosChanged.emit({value:this.currentScrollPos})};t.prototype.processDragScroll=function(e){if(this.isEnabled){var t=this.commonService.getShiftPos(),i=this.commonService.getMousePos(e);i.x-=t.x;i.y-=t.y;var r=this.commonService.getPageRect(this.elemRef.nativeElement.firstElementChild),n={top:r.top+25,right:r.right-25,bottom:r.bottom-25,left:r.left+25};if(this.currentScrollMode==integralui_core_1.IntegralUITabScrollMode.OutBound&&this.isScrollAllowed){n.top+=this.scrollButtonSize.height+4;n.right-=this.scrollButtonSize.width+2;n.bottom-=this.scrollButtonSize.height+4;n.left+=this.scrollButtonSize.width+2}else{n.right-=this.scrollBlockSize.width;n.bottom-=this.scrollBlockSize.height}if(this.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Left||this.currentTabPlacement==integralui_core_1.IntegralUITabStripPlacement.Right)if(i.y<n.top)this.startScroll();else if(i.y>n.bottom)this.startScroll(!0);else this.stopScroll();else if(i.x<n.left)this.startScroll();else if(i.x>n.right)this.startScroll(!0);else this.stopScroll()}};t.prototype.scrollTimerElapsed=function(e){if(0==this.scrollCount)this.scrollCount=1;this.scrollCount+=5;this.stopScrolling=!1;this.processScroll(e);if(this.stopScrolling){clearInterval(this.scrollTimer);this.isScrollActive=!1}};t.prototype.scrollTabs=function(){var e={top:0,right:0,bottom:0,left:0};switch(this.currentTabPlacement){case integralui_core_1.IntegralUITabStripPlacement.Right:e.top=-this.currentScrollPos;e.right=0;if(this.currentScrollMode==integralui_core_1.IntegralUITabScrollMode.OutBound&&this.isScrollAllowed)e.top+=this.scrollButtonSize.height+4;this.tabstripPos={top:e.top+"px",right:"0",bottom:"auto",left:"auto"};break;case integralui_core_1.IntegralUITabStripPlacement.Bottom:e.bottom=0;e.left=-this.currentScrollPos;if(this.currentScrollMode==integralui_core_1.IntegralUITabScrollMode.OutBound&&this.isScrollAllowed)e.left+=this.scrollButtonSize.width+2;this.tabstripPos={top:"auto",right:"auto",bottom:"0",left:e.left+"px"};break;case integralui_cor