UNPKG

@lidorsystems/integralui-web

Version:

IntegralUI Web - Advanced UI Components for Angular

15 lines (12 loc) 53.6 kB
/* filename: integralui.treeview.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 n(){this.constructor=t}t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();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_dragdrop_service_1=require("../services/integralui.dragdrop.service"),integralui_filter_service_1=require("../services/integralui.filter.service"),integralui_base_list_1=require("./integralui.base.list"),integralui_scrollbar_1=require("./integralui.scrollbar"),integralui_treeitem_1=require("./integralui.treeitem"),i0=require("@angular/core"),i1=require("../services/integralui.data.service"),i2=require("../services/integralui.dragdrop.service"),i3=require("../services/integralui.common.service"),i4=require("../services/integralui.filter.service"),i5=require("./integralui.core"),i6=require("@angular/common"),i7=require("./integralui.scrollbar"),i8=require("./integralui.treeitem"),_c0=["content"],_c1=["verScroll"],_c2=["horScroll"],_c3=["itemElem"],_c4=["itemContentElem"];function IntegralUITreeView_span_3_li_2_div_2_span_4_Template(e,t){if(1&e){var i=i0.ɵɵgetCurrentView();i0.ɵɵelementStart(0,"span");i0.ɵɵelementStart(1,"span",23);i0.ɵɵlistener("mousedown",function(e){i0.ɵɵrestoreView(i);var t=i0.ɵɵnextContext(2).$implicit;return i0.ɵɵnextContext(2).expandBoxMouseDown(e,t.data)})("mouseup",function(e){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext(4).expandBoxMouseUp(e)})("touchstart",function(e){i0.ɵɵrestoreView(i);var t=i0.ɵɵnextContext(2).$implicit;return i0.ɵɵnextContext(2).expandBoxTouchStart(e,t.data)})("touchend",function(e){i0.ɵɵrestoreView(i);var t=i0.ɵɵnextContext(2).$implicit;return i0.ɵɵnextContext(2).expandBoxTouchEnd(e,t.data)});i0.ɵɵelementEnd();i0.ɵɵelementEnd()}if(2&e){var n=i0.ɵɵnextContext(2).$implicit;i0.ɵɵadvance(1);i0.ɵɵproperty("ngClass",n.style.expandBox)}}var _c5=function(e,t){return{height:e,width:t}},_c6=function(e){return{"iui-listitem-animate-select iui-listitem-animate-select-left":e}},_c7=function(e){return{height:e}};function IntegralUITreeView_span_3_li_2_div_2_span_7_Template(e,t){if(1&e){i0.ɵɵelementStart(0,"span",24);i0.ɵɵelement(1,"span",12);i0.ɵɵelementEnd()}if(2&e){var i=i0.ɵɵnextContext(2).$implicit,n=i0.ɵɵnextContext(2);i0.ɵɵproperty("ngStyle",i0.ɵɵpureFunction2(3,_c5,n.animateItemSize.height+"px",i.clickPos.x+"px"));i0.ɵɵadvance(1);i0.ɵɵproperty("ngClass",i0.ɵɵpureFunction1(6,_c6,i.isClicked))("ngStyle",i0.ɵɵpureFunction1(8,_c7,n.animateItemSize.height+"px"))}}var _c8=function(e,t,i){return{left:e,height:t,width:i}},_c9=function(e){return{"iui-listitem-animate-select iui-listitem-animate-select-right":e}};function IntegralUITreeView_span_3_li_2_div_2_span_8_Template(e,t){if(1&e){i0.ɵɵelementStart(0,"span",24);i0.ɵɵelement(1,"span",12);i0.ɵɵelementEnd()}if(2&e){var i=i0.ɵɵnextContext(2).$implicit,n=i0.ɵɵnextContext(2);i0.ɵɵproperty("ngStyle",i0.ɵɵpureFunction3(3,_c8,i.clickPos.x+"px",n.animateItemSize.height+"px",n.contentSize.width-i.clickPos.x+"px"));i0.ɵɵadvance(1);i0.ɵɵproperty("ngClass",i0.ɵɵpureFunction1(7,_c9,i.isClicked))("ngStyle",i0.ɵɵpureFunction1(9,_c7,n.animateItemSize.height+"px"))}}var _c10=function(e,t){return{display:e,width:t}},_c11=function(e){return{"padding-left":e}},_c12=function(e){return{display:e}},_c13=function(e){return{$implicit:e}};function IntegralUITreeView_span_3_li_2_div_2_Template(e,t){if(1&e){var i=i0.ɵɵgetCurrentView();i0.ɵɵelementStart(0,"div",16);i0.ɵɵlistener("mouseenter",function(e){i0.ɵɵrestoreView(i);var t=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext(2).itemMouseEnter(e,t)})("mousemove",function(e){i0.ɵɵrestoreView(i);var t=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext(2).itemMouseMove(e,t)})("mouseleave",function(e){i0.ɵɵrestoreView(i);var t=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext(2).itemMouseLeave(e,t)});i0.ɵɵelementStart(1,"div",17);i0.ɵɵlistener("mousedown",function(e){i0.ɵɵrestoreView(i);var t=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext(2).itemMouseDown(e,t)})("mouseup",function(e){i0.ɵɵrestoreView(i);var t=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext(2).itemMouseUp(e,t)})("dragstart",function(e){i0.ɵɵrestoreView(i);var t=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext(2).itemDragStart(e,t)})("dragover",function(e){i0.ɵɵrestoreView(i);var t=i0.ɵɵnextContext(),n=t.$implicit,o=t.index;return i0.ɵɵnextContext(2).itemDragOver(e,n,o)})("drop",function(e){i0.ɵɵrestoreView(i);var t=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext(2).itemDragDrop(e,t)})("touchstart",function(e){i0.ɵɵrestoreView(i);var t=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext(2).itemTouchStart(e,t)})("touchmove",function(e){i0.ɵɵrestoreView(i);var t=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext(2).itemTouchMove(e,t)})("touchend",function(e){i0.ɵɵrestoreView(i);var t=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext(2).itemTouchEnd(e,t)});i0.ɵɵelementStart(2,"div",18,19);i0.ɵɵlistener("focus",function(){i0.ɵɵrestoreView(i);var e=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext(2).itemGotFocus(e)})("blur",function(){i0.ɵɵrestoreView(i);var e=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext(2).itemLostFocus(e)})("keydown",function(e){i0.ɵɵrestoreView(i);var t=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext(2).itemKeyDown(e,t)})("keypress",function(e){i0.ɵɵrestoreView(i);var t=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext(2).itemKeyPress(e,t)})("keyup",function(e){i0.ɵɵrestoreView(i);var t=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext(2).itemKeyUp(e,t)});i0.ɵɵtemplate(4,IntegralUITreeView_span_3_li_2_div_2_span_4_Template,2,1,"span",8);i0.ɵɵelementStart(5,"div",20);i0.ɵɵlistener("click",function(e){i0.ɵɵrestoreView(i);var t=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext(2).itemClickEvent(e,t)})("dblclick",function(e){i0.ɵɵrestoreView(i);var t=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext(2).itemDblClickEvent(e,t)})("contextmenu",function(e){i0.ɵɵrestoreView(i);var t=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext(2).itemRightClickEvent(e,t)});i0.ɵɵelement(6,"span",21);i0.ɵɵelementEnd();i0.ɵɵelementEnd();i0.ɵɵelementEnd();i0.ɵɵtemplate(7,IntegralUITreeView_span_3_li_2_div_2_span_7_Template,2,10,"span",22);i0.ɵɵtemplate(8,IntegralUITreeView_span_3_li_2_div_2_span_8_Template,2,11,"span",22);i0.ɵɵelementEnd()}if(2&e){var n=i0.ɵɵnextContext().$implicit,o=i0.ɵɵnextContext(2);i0.ɵɵproperty("ngClass",n.style.general)("ngStyle",i0.ɵɵpureFunction2(12,_c10,0==o.currentItemDisplay?"inline-block":"block",o.longestItemWidthValue));i0.ɵɵadvance(1);i0.ɵɵproperty("ngStyle",i0.ɵɵpureFunction1(15,_c11,n.indent+"px"));i0.ɵɵadvance(1);i0.ɵɵpropertyInterpolate("tabindex",n.tabIndex);i0.ɵɵproperty("ngClass",n.style.content)("iuiFocus",n.data==o.currentFocusItem)("ngStyle",i0.ɵɵpureFunction1(17,_c12,0==o.currentItemDisplay?"inline-block":"block"));i0.ɵɵadvance(2);i0.ɵɵproperty("ngIf",o.showExpandBox);i0.ɵɵadvance(2);i0.ɵɵproperty("iuiTemplateOutlet",o.itemData[0])("iuiTemplateOutletContext",i0.ɵɵpureFunction1(19,_c13,n.data));i0.ɵɵadvance(1);i0.ɵɵproperty("ngIf",o.allowAnimation&&n.isClicked);i0.ɵɵadvance(1);i0.ɵɵproperty("ngIf",o.allowAnimation&&n.isClicked)}}var _c14=function(e,t){return{"open-empty-bottom":e,"close-empty-bottom":t}};function IntegralUITreeView_span_3_li_2_span_3_Template(e,t){if(1&e){i0.ɵɵelementStart(0,"span",25);i0.ɵɵelement(1,"div",26);i0.ɵɵelementEnd()}if(2&e){var i=i0.ɵɵnextContext().$implicit;i0.ɵɵadvance(1);i0.ɵɵproperty("ngClass",i0.ɵɵpureFunction2(1,_c14,1==i.status,2==i.status))}}var _c15=function(e,t,i){return{"open-empty-bottom":e,"close-empty-bottom":t,"empty-bottom":i}};function IntegralUITreeView_span_3_li_2_span_4_Template(e,t){if(1&e){i0.ɵɵelementStart(0,"span",25);i0.ɵɵelement(1,"div",26);i0.ɵɵelementEnd()}if(2&e){var i=i0.ɵɵnextContext().$implicit;i0.ɵɵadvance(1);i0.ɵɵproperty("ngClass",i0.ɵɵpureFunction3(1,_c15,1==i.status,2==i.status,3==i.status))}}var _c16=function(e){return{"iui-treeitem-animate":e}};function IntegralUITreeView_span_3_li_2_Template(e,t){if(1&e){i0.ɵɵelementStart(0,"li",12,13);i0.ɵɵtemplate(2,IntegralUITreeView_span_3_li_2_div_2_Template,9,21,"div",14);i0.ɵɵtemplate(3,IntegralUITreeView_span_3_li_2_span_3_Template,2,4,"span",15);i0.ɵɵtemplate(4,IntegralUITreeView_span_3_li_2_span_4_Template,2,5,"span",15);i0.ɵɵelementEnd()}if(2&e){var i=t.$implicit,n=i0.ɵɵnextContext(2);i0.ɵɵproperty("ngClass",i0.ɵɵpureFunction1(5,_c16,n.allowAnimation))("ngStyle",i.inlineStyle);i0.ɵɵadvance(2);i0.ɵɵproperty("ngIf",!i.isEmpty&&!i.isEmptyPrev);i0.ɵɵadvance(1);i0.ɵɵproperty("ngIf",i.isEmptyPrev);i0.ɵɵadvance(1);i0.ɵɵproperty("ngIf",i.isEmpty)}}var _c17=function(e,t,i,n){return{left:e,top:t,height:i,width:n}};function IntegralUITreeView_span_3_div_3_Template(e,t){if(1&e){var i=i0.ɵɵgetCurrentView();i0.ɵɵelementStart(0,"div",27);i0.ɵɵelementStart(1,"div",28);i0.ɵɵlistener("mousemove",function(e){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext(2).hoverBlockMouseMove(e)})("mouseleave",function(e){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext(2).hoverBlockMouseLeave(e)});i0.ɵɵelement(2,"span",21);i0.ɵɵelementEnd();i0.ɵɵelementEnd()}if(2&e){var n=i0.ɵɵnextContext(2);i0.ɵɵproperty("ngStyle",i0.ɵɵpureFunction4(4,_c17,n.blockHoverRect.left+"px",n.blockHoverRect.top+"px",n.blockHoverRect.height+"px",n.blockHoverRect.width+"px"));i0.ɵɵadvance(1);i0.ɵɵproperty("ngStyle",i0.ɵɵpureFunction1(9,_c7,n.blockHoverRect.height+"px"));i0.ɵɵadvance(1);i0.ɵɵproperty("iuiTemplateOutlet",n.itemHoverData[0])("iuiTemplateOutletContext",i0.ɵɵpureFunction1(11,_c13,n.hoverItemObj.data))}}function IntegralUITreeView_span_3_span_4_span_1_div_1_Template(e,t){if(1&e){i0.ɵɵelementStart(0,"div",31);i0.ɵɵelementStart(1,"div",32);i0.ɵɵelement(2,"span",21);i0.ɵɵelementEnd();i0.ɵɵelementEnd()}if(2&e){var i=i0.ɵɵnextContext(),n=i.index,o=i.$implicit,s=i0.ɵɵnextContext(3);i0.ɵɵproperty("ngStyle",s.getSelectBlockRect(n));i0.ɵɵadvance(1);i0.ɵɵproperty("ngStyle",i0.ɵɵpureFunction1(4,_c7,s.blockSelectHeight+"px"));i0.ɵɵadvance(1);i0.ɵɵproperty("iuiTemplateOutlet",s.itemSelectData[0])("iuiTemplateOutletContext",i0.ɵɵpureFunction1(6,_c13,o))}}function IntegralUITreeView_span_3_span_4_span_1_Template(e,t){if(1&e){i0.ɵɵelementStart(0,"span");i0.ɵɵtemplate(1,IntegralUITreeView_span_3_span_4_span_1_div_1_Template,3,8,"div",30);i0.ɵɵelementEnd()}if(2&e){var i=t.$implicit,n=i0.ɵɵnextContext(3);i0.ɵɵadvance(1);i0.ɵɵproperty("ngIf",n.isContentAllowed(i,"select"))}}function IntegralUITreeView_span_3_span_4_Template(e,t){if(1&e){i0.ɵɵelementStart(0,"span");i0.ɵɵtemplate(1,IntegralUITreeView_span_3_span_4_span_1_Template,2,1,"span",29);i0.ɵɵelementEnd()}if(2&e){var i=i0.ɵɵnextContext(2);i0.ɵɵadvance(1);i0.ɵɵproperty("ngForOf",i.currentSelectedItems)}}function IntegralUITreeView_span_3_iui_scrollbar_5_Template(e,t){if(1&e){var i=i0.ɵɵgetCurrentView();i0.ɵɵelementStart(0,"iui-scrollbar",33,34);i0.ɵɵlistener("mouseenter",function(e){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext(2).scrollMouseEnter(e)})("valueChanged",function(e){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext(2).onVerticalScrollChanged(e)})("scrollStart",function(e){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext(2).onVerticalScrollStart(e)})("scrollEnd",function(e){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext(2).onVerticalScrollEnd(e)});i0.ɵɵelementEnd()}if(2&e){var n=i0.ɵɵnextContext(2);i0.ɵɵproperty("enabled",n.enabled)("value",n.currentScrollPos.y)("max",n.maxScrollPos.y)("largeChange",n.scrollLargeChange.y)("height",n.scrollBarSize.height)}}function IntegralUITreeView_span_3_iui_scrollbar_6_Template(e,t){if(1&e){var i=i0.ɵɵgetCurrentView();i0.ɵɵelementStart(0,"iui-scrollbar",35,36);i0.ɵɵlistener("mouseenter",function(e){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext(2).scrollMouseEnter(e)})("valueChanged",function(e){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext(2).onHorizontalScrollChanged(e)})("scrollStart",function(e){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext(2).onHorizontalScrollStart(e)})("scrollEnd",function(e){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext(2).onHorizontalScrollEnd(e)});i0.ɵɵelementEnd()}if(2&e){var n=i0.ɵɵnextContext(2);i0.ɵɵproperty("enabled",n.enabled)("orientation",n.horScrollOrientation)("value",n.currentScrollPos.x)("max",n.maxScrollPos.x)("width",n.scrollBarSize.width)}}function IntegralUITreeView_span_3_div_7_Template(e,t){if(1&e)i0.ɵɵelement(0,"div",37)}var _c18=function(e,t,i){return{width:e,height:t,"margin-left":i}};function IntegralUITreeView_span_3_Template(e,t){if(1&e){var i=i0.ɵɵgetCurrentView();i0.ɵɵelementStart(0,"span");i0.ɵɵelementStart(1,"ul",5);i0.ɵɵlistener("touchstart",function(e){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext().ctrlTouchStart(e)})("touchend",function(e){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext().ctrlTouchEnd(e)});i0.ɵɵtemplate(2,IntegralUITreeView_span_3_li_2_Template,5,7,"li",6);i0.ɵɵelementEnd();i0.ɵɵtemplate(3,IntegralUITreeView_span_3_div_3_Template,3,13,"div",7);i0.ɵɵtemplate(4,IntegralUITreeView_span_3_span_4_Template,2,1,"span",8);i0.ɵɵtemplate(5,IntegralUITreeView_span_3_iui_scrollbar_5_Template,2,5,"iui-scrollbar",9);i0.ɵɵtemplate(6,IntegralUITreeView_span_3_iui_scrollbar_6_Template,2,5,"iui-scrollbar",10);i0.ɵɵtemplate(7,IntegralUITreeView_span_3_div_7_Template,1,0,"div",11);i0.ɵɵelementEnd()}if(2&e){var n=i0.ɵɵnextContext();i0.ɵɵadvance(1);i0.ɵɵproperty("ngStyle",i0.ɵɵpureFunction3(7,_c18,0==n.currentItemDisplay?"9999px":n.blockSize.width+"px",n.contentSize.height+"px",0-n.currentScrollPos.x+"px"));i0.ɵɵadvance(1);i0.ɵɵproperty("ngForOf",n.scrollItemList);i0.ɵɵadvance(1);i0.ɵɵproperty("ngIf",n.isHoverTemplatePresent&&!n.isUpdateActive&&n.hoverItemObj&&n.isContentAllowed(n.hoverItemObj.data,"hover"));i0.ɵɵadvance(1);i0.ɵɵproperty("ngIf",n.isSelectedTemplatePresent&&!n.isUpdateActive);i0.ɵɵadvance(1);i0.ɵɵproperty("ngIf",n.isVerScrollVisible());i0.ɵɵadvance(1);i0.ɵɵproperty("ngIf",n.isHorScrollVisible());i0.ɵɵadvance(1);i0.ɵɵproperty("ngIf",n.isVerScrollVisible()&&n.isHorScrollVisible())}}function IntegralUITreeView_span_4_iui_treeitem_2_Template(e,t){if(1&e)i0.ɵɵelement(0,"iui-treeitem",40);if(2&e){var i=t.$implicit,n=i0.ɵɵnextContext(2);i0.ɵɵproperty("allowAnimation",n.getItemObject(i,"allowAnimation"))("enabled",n.getItemObject(i,"enabled"))("expanded",n.getItemObject(i,"expanded"))("text",n.getItemObject(i,"text"))("templateRef",n.itemData[0])("data",i)("items",n.getItemObject(i,"items"))("visible",n.getItemObject(i,"visible"))}}function IntegralUITreeView_span_4_Template(e,t){if(1&e){i0.ɵɵelementStart(0,"span");i0.ɵɵelementStart(1,"ul",38);i0.ɵɵtemplate(2,IntegralUITreeView_span_4_iui_treeitem_2_Template,1,8,"iui-treeitem",39);i0.ɵɵelementEnd();i0.ɵɵelementEnd()}if(2&e){var i=i0.ɵɵnextContext();i0.ɵɵadvance(1);i0.ɵɵproperty("ngStyle",i.getBlockStyle());i0.ɵɵadvance(1);i0.ɵɵproperty("ngForOf",i.items)}}var IntegralUITreeView=function(e){__extends(t,e);function t(t,i,n,o,s,r,a,l){var c=e.call(this,t,i,n,o,s,r)||this;c.dataService=t;c.dragDropService=i;c.elemRef=n;c.elemRenderer=o;c.commonService=s;c.filterService=r;c.cmpResolver=a;c.baseService=l;c.isThereChildItems=!1;c.expandTimeout=null;c.expandItem=null;c.currentItemDisplay=integralui_core_1.IntegralUIItemDisplayMode.Full;c.isExpandBoxVisible=!0;c.isLongestInProcess=!1;c.longestObj={data:null,width:0};c.isExpandBoxTouched=!1;c.tRef=null;c.autoExpand=!1;c.afterCollapse=new core_1.EventEmitter;c.afterExpand=new core_1.EventEmitter;c.beforeCollapse=new core_1.EventEmitter;c.beforeExpand=new core_1.EventEmitter;c.itemList=[];return c}Object.defineProperty(t.prototype,"compactMode",{get:function(){return this.options.compactMode},set:function(e){if(this.options.compactMode!=e){this.options.compactMode=e;this.updateLayout()}},enumerable:!0,configurable:!0});Object.defineProperty(t.prototype,"indent",{get:function(){return this.options.indent},set:function(e){if(this.options.indent!=e){this.options.indent=e;this.updateLayout()}},enumerable:!0,configurable:!0});Object.defineProperty(t.prototype,"itemDisplay",{get:function(){return this.currentItemDisplay},set:function(e){if(this.currentItemDisplay!=e){this.currentItemDisplay=e;this.updateLayout()}},enumerable:!0,configurable:!0});Object.defineProperty(t.prototype,"showExpandBox",{get:function(){return this.isExpandBoxVisible},set:function(e){if(this.isExpandBoxVisible!=e){this.isExpandBoxVisible=e;this.updateLayout()}},enumerable:!0,configurable:!0});t.prototype.ngOnInit=function(){this.baseService.setComponent(this);this.updateData();this.updateCurrentList();this.generalClassName="iui-treeview";this.itemClassName="iui-treeitem";this.itemContentClassName=this.itemClassName+"-content";this.expandBoxClassName=this.itemClassName+"-expand-box";this.initStyle()};t.prototype.updateData=function(){this.dataService.init([{data:this.items,fields:this.options.dataFields}])};t.prototype.initStyle=function(){this.defaultStyle={general:{disabled:this.generalClassName+"-disabled",focused:this.generalClassName+"-focused",normal:this.generalClassName,hovered:this.generalClassName+"-hovered",selected:this.generalClassName+"-selected"},item:{general:{disabled:this.itemClassName+"-disabled",focused:this.itemClassName+"-focused",normal:this.itemClassName,hovered:this.itemClassName+"-hovered",selected:this.itemClassName+"-selected"},expandBox:{general:this.expandBoxClassName,load:this.expandBoxClassName+"-load",expanded:this.expandBoxClassName+"-open",collapsed:this.expandBoxClassName+"-close"},content:{disabled:this.itemContentClassName+"-disabled",focused:this.itemContentClassName+"-focused",normal:this.itemContentClassName,hovered:this.itemContentClassName+"-hovered",selected:this.itemContentClassName+"-selected"}}};this.updateStyle(this.controlStyle);this.updateControlClass();this.refresh()};t.prototype.ngAfterViewInit=function(){var e=this,t=setTimeout(function(){var i=e.cmpResolver.resolveComponentFactory(integralui_core_1.IntegralUITComponent);if(i&&e.contentRef)e.tRef=e.contentRef.createComponent(i);clearTimeout(t)},100);e.updateLayout()};t.prototype.ngAfterContentInit=function(){this.templateList=this.templates.toArray();this.isHoverTemplatePresent=!1;this.isSelectedTemplatePresent=!1;if(this.templateList.length>0){for(var e=0;e<this.templateList.length;e++)if(this.templateList[e].settings)switch(this.templateList[e].settings.type){case"item":this.itemData.push(this.templateList[e].getTemplate());break;case"item-hover":this.itemHoverData.push(this.templateList[e].getTemplate());this.isHoverTemplatePresent=!0;break;case"item-select":this.itemSelectData.push(this.templateList[e].getTemplate());this.isSelectedTemplatePresent=!0}}else this.itemData.push(this.itemTemplate);this.updateBlockSize()};t.prototype.ngOnDestroy=function(){this.removeDropMark();if(this.expandTimeout)clearTimeout(this.expandTimeout);this.resetLayoutTimer();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.ngAfterViewChecked=function(){};t.prototype.checkForChildren=function(e){var t=!1,i=e[this.options.dataFields.items];if(i)for(var n=0;n<i.length;n++)if(this.isItemAllowed(i[n])){t=!0;break}return t};t.prototype.updateIsThereChildItems=function(){var e=!1,t=this.dataService.getList();if(t)for(var i=0;i<t.length&&!(e=this.checkForChildren(t[i]));i++);this.isThereChildItems=e};t.prototype.processItemAdd=function(e,t){if(this.allowUpdate)this.updateIsThereChildItems()};t.prototype.processItemRemoval=function(e,t){if(this.allowUpdate)this.updateIsThereChildItems()};t.prototype.itemDblClickEvent=function(e,t){if(this.isEnabled){var i={cancel:!1,event:e,item:t.data};this.itemDblClick.emit(i);if(1!=i.cancel)this.toggle(t.data)}};t.prototype.updateOptions=function(e){if(e){this.options={allowDrag:this.commonService.isFieldAvailable(e.allowDrag,!1),allowDrop:this.commonService.isFieldAvailable(e.allowDrop,!0),compactMode:this.commonService.isFieldAvailable(e.compactMode,!1),dataFields:null,indent:this.commonService.isFieldAvailable(e.indent,15),loadItems:[],selectedItem:this.commonService.isFieldAvailable(e.selectedItem,this.options.selectedItem?this.options.selectedItem:null)};this.updateShowScroll(e.showScroll)}else{this.options={allowDrag:!1,allowDrop:!0,compactMode:!1,dataFields:null,indent:15,loadItems:[],selectedItem:null};this.updateDataFields();this.updateShowScroll()}};t.prototype.updateDataFields=function(e){if(e)this.options.dataFields={allowDrag:e.allowDrag?e.allowDrag:"allowDrag",allowDrop:e.allowDrop?e.allowDrop:"allowDrop",allowEdit:e.allowEdit?e.allowEdit:"allowEdit",allowFocus:e.allowFocus?e.allowFocus:"allowFocus",autoCheck:e.autoCheck?e.autoCheck:"autoCheck",checkBoxSettings:e.checkBoxSettings?e.checkBoxSettings:"checkBoxSettings",checked:e.checked?e.checked:"checked",checkState:e.checkState?e.checkState:"checkState",content:e.content?e.content:"content",contentVisibility:e.contentVisibility?e.contentVisibility:"contentVisibility",contextMenu:e.contextMenu?e.contextMenu:"contextMenu",enabled:e.enabled?e.enabled:"enabled",expanded:e.expanded?e.expanded:"expanded",hasChildren:e.hasChildren?e.hasChildren:"hasChildren",icon:e.icon?e.icon:"icon",id:e.id?e.id:"id",items:e.items?e.items:"items",pid:e.pid?e.pid:"pid",selected:e.selected?e.selected:"selected",statusIcon:e.statusIcon?e.statusIcon:"statusIcon",style:e.style?e.style:"style",templateObj:e.templateObj?e.templateObj:"templateObj",text:e.text?e.text:"text",tooltip:e.tooltip?e.tooltip:"tooltip",value:e.value?e.value:"value",visible:e.value?e.visible:"visible"};else this.options.dataFields={allowDrag:"allowDrag",allowDrop:"allowDrop",allowEdit:"allowEdit",allowFocus:"allowFocus",autoCheck:"autoCheck",checkBoxSettings:"checkBoxSettings",checked:"checked",checkState:"checkState",content:"content",contentVisibility:"contentVisibility",contextMenu:"contextMenu",enabled:"enabled",expanded:"expanded",hasChildren:"hasChildren",icon:"icon",id:"id",items:"items",pid:"pid",selected:"selected",statusIcon:"statusIcon",style:"style",templateObj:"templateObj",text:"text",tooltip:"tooltip",value:"value",visible:"visible"};if(this.dataService)this.dataService.updateDataFields(this.options.dataFields)};t.prototype.updateCurrentList=function(){var e=this;e.currentList.length=0;e.isThereChildItems=!1;var t=e.dataService.getList();if(1==e.options.compactMode)t=e.createCompactList(t);if(t){e.applySorting(t);t.forEach(function(t){e.addChildItems(t,0,null,!1)})}};t.prototype.addChildItems=function(e,t,i,n,o){var s=this,r=!0;if(!e[s.options.dataFields.items])return r=s.addItemToCurrentList(e,t,i,n,o);if(r=s.addItemToCurrentList(e,t,i,n,o)){var a=0;if(n||s.isItemExpanded(e)){var l=e[s.options.dataFields.items];if(l){s.applySorting(l);l.forEach(function(i){if(s.addChildItems(i,t+s.options.indent,e[s.options.dataFields.id],n,e))a++})}}if(!n&&!s.isThereChildItems&&(a>0||!s.isItemExpanded(e)&&e[s.options.dataFields.items]&&e[s.options.dataFields.items].length>0&&s.isThereVisibleChildren(e)))s.isThereChildItems=!0}return r};t.prototype.addItemToCurrentList=function(e,t,i,n,o){e.type="item";if(!e[this.options.dataFields.id])e[this.options.dataFields.id]=this.commonService.getUniqueId();if(i)e[this.options.dataFields.pid]=i;var s=this.isItemAllowed(e);if(s)if(n)this.fullList.push(e);else this.currentList.push({data:e,indent:t});return s};t.prototype.resetVisiblity=function(e){if(e)for(var t=0;t<e.length;t++){e[t][this.options.dataFields.visible]=!0;this.resetVisiblity(e[t][this.options.dataFields.items])}};t.prototype.collapseChildren=function(e){if(e)for(var t=0;t<e.length;t++){e[t][this.options.dataFields.expanded]=!1;this.collapseChildren(e[t][this.options.dataFields.items])}};t.prototype.createCompactList=function(e){this.resetVisiblity(e);if(this.selectedItem){var t=this.selectedItem,i=this.getItemParent(this.selectedItem),n=i,o=this.selectedItem;this.collapseChildren(o[this.options.dataFields.items]);if(i)for(;i;){for(var s=i[this.options.dataFields.items],r=0;r<s.length;r++)if(!this.commonService.isEqual(s[r][this.options.dataFields.id],o[this.options.dataFields.id])){s[r][this.options.dataFields.expanded]=!1;s[r][this.options.dataFields.visible]=this.isItemExpanded(o)&&this.isThereVisibleChildren(o)?!1:!0}var a=this.getItemParent(i);if(!a)t=i;o=i;i=a}for(r=0;r<e.length;r++)if(!this.commonService.isEqual(e[r][this.options.dataFields.id],t[this.options.dataFields.id]))e[r][this.options.dataFields.visible]=n&&this.isItemExpanded(t)?!1:this.isItemExpanded(o)&&this.isThereVisibleChildren(this.selectedItem)?!1:!0}return e};t.prototype.loadData=function(e,t,i,n){this.processLoadData(e,t,i,n)};t.prototype.updateItem=function(e){var t=this;if(e&&this.isItemExpanded(e))var i=setTimeout(function(){var n=t.getComponentFromItem(e);if(n&&!n.isBlockExpanded())n.toggleContent();clearTimeout(i)},100)};t.prototype.updateScrollItemList=function(){this.scrollItemList.length=0;for(var e=0,t=this.currentIndex;t<this.currentList.length&&t<this.currentIndex+this.visibleRange;t++,e++){var i=this.currentList[t],n={data:i.data,indent:i.indent,index:t-this.currentIndex,inlineStyle:this.getItemInlineStyle(i),style:{},tabIndex:e};this.updateItemStyle(n);this.scrollItemList.push(n)}};t.prototype.expandOnDelay=function(e){var t=this;if(0!=t.autoExpand){if(t.expandItem!=e){if(t.expandTimeout)clearTimeout(t.expandTimeout);t.expandTimeout=setTimeout(function(){if(t.expandTimeout)t.expand(e);clearTimeout(t.expandTimeout)},500)}t.expandItem=e}};t.prototype.itemDragOver=function(e,t,i,n){if(this.isEnabled){var o=this.getItemElemList();if(o&&i>=0&&i<o.length){var s=this.commonService.getPageRect(o[i].nativeElement),r={x:s.left,y:s.top,width:s.right-s.left,height:s.bottom-s.top};this.expandOnDelay(t.data);this.processScroll(e);if(!this.isScrollTimerActive)this.processDragOver(e,t.data,r,n)}}e.stopPropagation()};t.prototype.itemDragDrop=function(e,t){if(this.isEnabled){this.expandItem=null;if(this.expandTimeout)clearTimeout(this.expandTimeout);this.processDragDrop(e,t.data)}e.stopPropagation()};t.prototype.collapse=function(e){this.toggle(e,!1)};t.prototype.expand=function(e){this.toggle(e,!0)};t.prototype.expandBoxMouseDown=function(e,t){if(this.isEnabled){if(1==e.buttons&&!this.isExpandBoxTouched)this.toggle(t);this.isExpandBoxTouched=!1}e.stopPropagation()};t.prototype.expandBoxMouseUp=function(e){this.isExpandBoxTouched=!1;e.stopPropagation()};t.prototype.expandBoxTouchStart=function(e,t){if(this.isEnabled){this.isExpandBoxTouched=!0;this.toggle(t)}e.stopPropagation()};t.prototype.expandBoxTouchEnd=function(e,t){};t.prototype.toggle=function(e,t){if(e){if(!e[this.options.dataFields.hasChildren]&&(!e[this.options.dataFields.items]||0==e[this.options.dataFields.items].length))return;else if(t&&0!=e[this.options.dataFields.expanded])return;else if(!1===t&&0==e[this.options.dataFields.expanded])return;var i=void 0!==t?t:!1!==e[this.options.dataFields.expanded]?!0:!1,n=void 0!=t?t:!i;if(0!=this.virtualMode){var o={cancel:!1,item:e};if(void 0!==t)if(t)this.beforeExpand.emit(o);else this.beforeCollapse.emit(o);else if(i)this.beforeCollapse.emit(o);else this.beforeExpand.emit(o);if(1!=o.cancel){if(n!=e[this.options.dataFields.expanded]){e[this.options.dataFields.expanded]=n;if(1==this.options.compactMode)this.processSelection(null,e);this.updateCurrentLayout(!1)}if(this.isItemExpanded(e))this.afterExpand.emit({item:e});else this.afterCollapse.emit({item:e})}}else{var s=this.getComponentFromItem(e);if(s)s.expanded=n}}else if(0!=this.virtualMode){for(var r=this.getFullList(),a=0;a<r.length;a++)r[a][this.options.dataFields.expanded]=t;this.updateCurrentLayout(!1)}else{this.itemList=this.contentList.toArray();if(this.itemList&&this.itemList.length>0)this.itemList.forEach(function(e){e.toggle(t,!0)})}};t.prototype.exportToJSON=function(e,t,i){t=t?t:null;var n=0==i?this.items:this.getFullList(),o=e?e:[this.options.dataFields.allowDrag,this.options.dataFields.allowDrop,this.options.dataFields.allowEdit,this.options.dataFields.allowFocus,this.options.dataFields.autoCheck,this.options.dataFields.canSelect,this.options.dataFields.checkBoxSettings,this.options.dataFields.checked,this.options.dataFields.checkState,this.options.dataFields.content,this.options.dataFields.contextMenu,this.options.dataFields.contentVisibility,this.options.dataFields.enabled,this.options.dataFields.expanded,this.options.dataFields.fixed,this.options.dataFields.fixChildren,this.options.dataFields.hasChildren,this.options.dataFields.icon,this.options.dataFields.id,this.options.dataFields.pid,this.options.dataFields.selected,this.options.dataFields.showCheckBox,this.options.dataFields.statusIcon,this.options.dataFields.style,this.options.dataFields.templateObj,this.options.dataFields.text,this.options.dataFields.tooltip,this.options.dataFields.value,this.options.dataFields.visible];if(!1===i)o.push(this.options.dataFields.items);return JSON.stringify(n,o,t)};t.prototype.getDisplayMode=function(){return this.currentItemDisplay==integralui_core_1.IntegralUIItemDisplayMode.Partial&&!this.isHoverTemplatePresent&&!this.isSelectedTemplatePresent?integralui_core_1.IntegralUIItemDisplayMode.Partial:integralui_core_1.IntegralUIItemDisplayMode.Full};t.prototype.updateFullList=function(){this.fullList.length=0;var e=this.dataService.getList();if(e)for(var t=0;t<e.length;t++)this.addChildItems(e[t],0,null,!0);return this.fullList};t.prototype.getItemElemList=function(){return this.itemElems?this.itemElems.toArray():null};t.prototype.getItemContentElemList=function(){return this.itemContentElems?this.itemContentElems.toArray():null};t.prototype.getItemFromComponent=function(e){if(e&&e.data)return e.data;if(this.items){this.itemList=this.contentList.toArray();var t=this.itemList.indexOf(e);if(t>=0&&t<this.items.length)return this.items[t]}return null};t.prototype.getItemIndex=function(e){return this.itemList&&this.itemList.length>0?this.itemList.indexOf(e):-1};t.prototype.getItemLevel=function(e){for(var t=0,i=this.getItemParent(e);i;){t++;i=this.getItemParent(i)}return t};t.prototype.getItemObject=function(e,t){switch(t){case"allowAnimation":return this.allowAnimation;case"enabled":return e[this.options.dataFields.enabled];case"expanded":return e[this.options.dataFields.expanded];case"items":return e[this.options.dataFields.items];case"text":return e[this.options.dataFields.text];case"visible":return e[this.options.dataFields.visible]||!0}return null};t.prototype.getItemParent=function(e){return this.dataService.getParent(e)};t.prototype.getList=function(e,t){switch(e){case"current":return this.currentList;case"selected":return this.currentSelectedItems}return this.dataService.getList(t)};t.prototype.isChildOf=function(e,t){var i=!1;if(e&&t){var n=t[this.options.dataFields.items];if(n&&n.length>0)for(var o=0;o<n.length;o++){if(this.commonService.isEqual(e[this.options.dataFields.id],n[o][this.options.dataFields.id])){i=!0;break}else i=this.isChildOf(e,n[o]);if(i)break}}return i};t.prototype.isParentOf=function(e,t){var i=this.dataService.getParent(t);if(e&&t&&i&&this.commonService.isEqual(e[this.options.dataFields.id],i[this.options.dataFields.id]))return!0;else return!1};t.prototype.isThereChildren=function(){return this.isThereChildItems};t.prototype.isItemExpanded=function(e){return e?e[this.options.dataFields.expanded]||void 0===e[this.options.dataFields.expanded]?!0:!1:!0};t.prototype.isThereVisibleChildren=function(e){var t=!1;if(e){var i=e[this.options.dataFields.items];if(i)for(var n=0;n<i.length;n++)if(this.isItemAllowed(i[n])){t=!0;break}}return t};t.prototype.invokeEvent=function(e,t){var i=!0;if(this.isEnabled)if(t){var n={cancel:!1,item:t};switch(e){case"AFTER_COLLAPSE":this.afterCollapse.emit({item:t});break;case"AFTER_EXPAND":this.afterExpand.emit({item:t});break;case"BEFORE_COLLAPSE":this.beforeCollapse.emit(n);i=!n.cancel;break;case"BEFORE_EXPAND":this.beforeExpand.emit(n);i=!n.cancel;break;case"ITEM_HOVER":this.itemHover.emit({item:t})}}return i};t.prototype.invokeMethod=function(e,t){var i=!0;if(this.isEnabled)if(t)switch(e){case"CHANGE_EXPANDED":this.changeExpanded(t.component);break;case"SELECT_ITEM":i=this.processSelection(t.event,t.item);break;case"UPDATE_SELECTION":this.updateSelection(t.event,t.item)}return i};t.prototype.changeExpanded=function(e){if(e&&e.data)e.data[this.options.dataFields.expanded]=e.expanded};t.prototype.getItemRealIndex=function(e){var t=this.dataService.getList();return t?t.indexOf(e):-1};t.prototype.getPrevItem=function(e){var t=null;if(e){var i=this.dataService.getList(),n=this.getItemParent(e);if(n)i=n[this.options.dataFields.items];var o=i.indexOf(e);if((o=o>0?o-1:-1)>=0)t=i[o]}return t};t.prototype.getNextItem=function(e){var t=null;if(e){var i=this.dataService.getList(),n=this.getItemParent(e);if(n)i=n[this.options.dataFields.items];var o=i.indexOf(e);if((o=o<i.length-1?o+1:-1)>=0)t=i[o]}return t};t.prototype.moveItem=function(e,t,i,n){if(e){this.allowUpdate=!1;var o=-1;switch(t){case integralui_core_1.IntegralUIMoveDirection.At:o=n;break;case integralui_core_1.IntegralUIMoveDirection.Down:i=this.getNextItem(e);break;case integralui_core_1.IntegralUIMoveDirection.First:o=0;break;case integralui_core_1.IntegralUIMoveDirection.Last:o=this.getLastItemIndex();break;case integralui_core_1.IntegralUIMoveDirection.Left:i=this.getItemParent(e);break;case integralui_core_1.IntegralUIMoveDirection.Right:case integralui_core_1.IntegralUIMoveDirection.Up:i=this.getPrevItem(e)}if(Array.isArray(e)){for(var s=[],r=0;r<e.length;r++){for(var a=!1,l=this.getItemParent(e[r]);l;){if(e.indexOf(l)>=0){a=!0;break}l=this.getItemParent(l)}if(!a)s.push(e[r])}if(s.length>0){if(this.getItemCurrentIndex(s[0])<=this.getItemCurrentIndex(s[s.length-1]))for(r=0;r<s.length;r++)this.moveItemAt(s[r],i,t,o);else for(r=s.length-1;r>=0;r--)this.moveItemAt(s[r],i,t,o)}}else this.moveItemAt(e,i,t,o);this.allowUpdate=!0;this.updateCurrentLayout(!0);this.change.emit({type:"move-item"})}};t.prototype.processLeftArrowKey=function(e,t){this.collapse(e.data);return null};t.prototype.processRightArrowKey=function(e,t){this.expand(e.data);return null};t.prototype.getContentSize=function(){return this.contentElem?{width:this.contentElem.nativeElement.offsetWidth,height:this.contentElem.nativeElement.offsetHeight}:{width:0,height:0}};t.prototype.getComponentFromItem=function(e){var t=null;this.itemList=this.contentList.toArray();if(this.itemList&&this.itemList.length>0)for(var i=0;!t&&i<this.itemList.length;){var n=this.itemList[i];if(this.getItemFromComponent(n)==e){t=n;break}else t=n.getComponentFromItem(e);i++}return t};t.prototype.updateBlockSize=function(){if(this.currentItemDisplay==integralui_core_1.IntegralUIItemDisplayMode.Partial){if(0!=this.virtualMode)this.updateLongestItem();else if(this.contentList){var e={width:0,height:0};this.itemList=this.contentList.toArray();if(this.itemList)for(var t={width:0,height:0},i=0;i<this.itemList.length;i++){t=this.itemList[i].getSize();if(e.width<t.width)e.width=t.width}this.blockSize={width:e.width>this.clientRect.width-2?e.width+16:this.clientRect.width-2,height:this.clientRect.height}}}else{this.blockSize={width:this.scrollBarSize.width+2,height:this.scrollBarSize.height+2};this.longestItemWidthValue=this.getFullItemWidth()}};t.prototype.isItemInCurrentList=function(e){var t=!1;if(e)for(var i=0;i<this.currentList.length;i++)if(this.currentList[i].data.id==e.id){t=!0;break}return t};t.prototype.getFullItemWidth=function(){if(!this.isLongestInProcess&&0==this.currentItemDisplay&&(this.isHoverTemplatePresent||this.isSelectedTemplatePresent))return this.longestItemWidth+"px";else return"auto"};t.prototype.updateLongestItem=function(){var e=this;e.isLongestInProcess=!0;e.prevLongestItemWidth=e.longestObj&&e.isItemInCurrentList(e.longestObj.data)?e.longestObj.width:0;setTimeout(function(){if(e.longestObj&&!e.isItemInCurrentList(e.longestObj.data))e.longestObj={data:null,width:0};var t=e.getItemContentElemList();if(t){e.calcLongestItem(t);if(e.prevLongestItemWidth<e.clientRect.width)e.prevLongestItemWidth=e.clientRect.width}var i=e.commonService.getPadding(e.elemRef.nativeElement.firstElementChild);e.blockSize.width=e.longestObj.width+(i.left+i.right);e.isLongestInProcess=!1;e.longestItemWidth=e.prevLongestItemWidth;e.longestItemWidthValue=e.getFullItemWidth();e.updateScrollSize()},1)};t.prototype.calcLongestItem=function(e,t){for(var i=0,n=0;n<e.length;n++)if(n<this.scrollItemList.length){var o=this.scrollItemList[n].data,s=this.getObjFromItem(o);if(s){var r=e[n].nativeElement.offsetWidth+s.indent;if(!t&&this.longestObj.data==s.data){this.calcLongestItem(e,!0);break}if(i<r&&r>=this.longestObj.width){i=r;this.longestObj={data:s.data,width:i};this.longestItemWidth=i}}}};t.prototype.updateCurrentLayout=function(e){var t=this;if(t.allowUpdate){t.resetLayoutTimer();t.updateCurrentList();if(e)t.updateFullList();t.updateScrollItemList();if(this.currentItemDisplay==integralui_core_1.IntegralUIItemDisplayMode.Partial&&0!=this.virtualMode)t.updateLongestItem();else t.updateScrollSize();t.updateTimer=setTimeout(function(){t.updateBlockSize();t.updateHoverContentPos();t.updateSelectContentPos();clearTimeout(t.updateTimer)},1)}};t.prototype.updateScrollSize=function(){this.contentSize={width:this.clientRect.width-2,height:this.clientRect.height-2};this.scrollSize={width:this.currentItemDisplay==integralui_core_1.IntegralUIItemDisplayMode.Partial?this.blockSize.width-this.clientRect.width-2:0,height:this.avgItemHeight*this.currentList.length-this.clientRect.height+this.avgItemHeight};if(this.isVerScrollVisible())this.contentSize.width-=18;if(this.currentItemDisplay==integralui_core_1.IntegralUIItemDisplayMode.Partial&&this.scrollSize.width>=-6){if(this.isVerScrollVisible())this.scrollSize.width+=16;if(this.isHoverTemplatePresent||this.isSelectedTemplatePresent)this.scrollSize.width+=4}if(this.isHorScrollVisible())this.scrollSize.height+=16;this.scrollSize.width=this.scrollSize.width>0?this.scrollSize.width:0;this.scrollSize.height=this.scrollSize.height>0?this.scrollSize.height:0;this.maxScrollPos={x:this.scrollSize.width,y:this.scrollSize.height};if(this.currentScrollPos.x>this.maxScrollPos.x)this.changeHorizontalScrollPos(this.maxScrollPos.x);if(this.currentScrollPos.y>this.maxScrollPos.y)this.changeVerticalScrollPos(this.maxScrollPos.y);this.scrollBarSize={width:this.isVerScrollVisible()?this.clientRect.width-20:this.clientRect.width-4,height:this.isHorScrollVisible()?this.clientRect.height-20:this.clientRect.height-4};this.scrollLargeChange={x:this.scrollBarSize.width,y:this.scrollBarSize.height};this.blockHoverRect={height:this.avgItemHeight-2,left:0,top:-9999999,width:this.clientRect.width-2};var e={height:this.avgItemHeight-2,left:0,top:-9999999,width:this.clientRect.width-2};if(this.isVerScrollVisible()){this.blockHoverRect.width-=16;e.width-=16}this.blockSelectRect.map(function(t){t.width=e.width;t.height=e.height})};t.prototype.beginLoad=function(e){if(e)if(this.options.loadItems.indexOf(e)<0)this.options.loadItems.push(e)};t.prototype.endLoad=function(e){var t=this.options.loadItems.indexOf(e);if(t>=0)this.options.loadItems.splice(t,1);this.updateCurrentLayout(!0)};t.prototype.isItemLoading=function(e){return this.options.loadItems.indexOf(e)>=0?!0:!1};t.prototype.isVerScrollVisible2=function(){return this.isEnabled&&this.options.showScroll.vertical&&this.scrollSize.height>this.avgItemHeight/2?!0:!1};t.prototype.scrollTo=function(e){if(0!=this.virtualMode&&e){this.suspendLayout();for(var t=this.getItemParent(e);null!=t;){this.expand(t);t=this.getItemParent(t)}this.resumeLayout();var i=this,n=setTimeout(function(){var t=i.getItemCurrentIndex(e);if(t>=0){i.scrollPos({x:i.currentScrollPos.x,y:i.avgItemHeight*(t-Math.floor(i.visibleRange/2))});i.updateLayout()}clearTimeout(n)},150)}};t.prototype.callAfterSelectEvent=function(e){var t={item:e};this.afterSelect.emit(t);this.selectionChanged.emit(t);if(1==this.options.compactMode){if(this.getItemParent(e))e[this.options.dataFields.expanded]=!0;this.updateLayout()}};t.prototype.clearComponentSelection=function(){if(this.contentList){this.itemList=this.contentList.toArray();if(this.itemList&&this.itemList.length>0)this.itemList.forEach(function(e){e.state&=~integralui_core_1.IntegralUIObjectState.selected;e.clearComponentSelection()})}};t.prototype.getControlStyle=function(){var e={cursor:this.ctrlCursor,overflow:this.virtualMode?"hidden":"auto"};if(this.ctrlSize.width>0)e.width=this.ctrlSize.width+"px";if(this.ctrlSize.height>0)e.height=this.ctrlSize.height+"px";return e};t.prototype.getBlockStyle=function(){var e={};if(this.currentItemDisplay==integralui_core_1.IntegralUIItemDisplayMode.Partial)e={width:this.blockSize.width+"px"};return e};t.prototype.getItemInlineStyle=function(e){return e.data[this.options.dataFields.style]||{}};t.prototype.getItemInlineContentStyle=function(e){var t={};t["padding-left"]=e.indent+"px";return t};t.prototype.updateItemStyle=function(e){if(e){e.style={general:[],expandBox:[],content:[]};e.inlineStyle=this.getItemInlineStyle(e);e.inlineContentStyle=this.getItemInlineContentStyle(e);e.style.general.push(this.itemClassName);e.style.general.push(this.options.currentStyle.item.general.normal);e.style.content.push(this.itemContentClassName);e.style.content.push(this.options.currentStyle.item.content.normal);if(this.getDisplayMode()==integralui_core_1.IntegralUIItemDisplayMode.Partial){e.style.content.push("iui-treeitem-content-block");if(!this.isItemEnabled(e.data))e.style.content.push(this.options.currentStyle.item.content.disabled);else if(this.isItemSelected(e.data))e.style.content.push(this.options.currentStyle.item.content.selected);else if(this.isItemHovered(e.data))e.style.content.push(this.options.currentStyle.item.content.hovered)}else{e.style.general.push("iui-treeitem-block");if(!this.isItemEnabled(e.data))e.style.general.push(this.options.currentStyle.item.general.disabled);else if(this.isItemSelected(e.data))e.style.general.push(this.options.currentStyle.item.general.selected);else if(this.isItemHovered(e.data))e.style.general.push(this.options.currentStyle.item.general.hovered)}if(e.data==this.currentFocusItem)e.style.content.push(this.options.currentStyle.item.content.focused);if(this.isThereChildItems||e.data[this.options.dataFields.hasChildren])e.style.expandBox.push(this.options.currentStyle.item.expandBox.general);if(e.data[this.options.dataFields.hasChildren]&&(this.isThereVisibleChildren(e.data)||!e.data[this.options.dataFields.items]||e.data[this.options.dataFields.items]&&0==e.data[this.options.dataFields.items].length)||this.isThereVisibleChildren(e.data))if(this.isItemLoading(e.data))e.style.expandBox.push(this.options.currentStyle.item.expandBox.load);else if(0!=e.data[this.options.dataFields.expanded])e.style.expandBox.push(this.options.currentStyle.item.expandBox.expanded);else e.style.expandBox.push(this.options.currentStyle.item.expandBox.collapsed)}};t.prototype.getItemStyle=function(e){if(e)return{general:this.getItemGeneralStyle(e.general),expandBox:this.getItemExpandBoxStyle(e.expandBox),content:this.getItemContentStyle(e.content)};else return this.getDefaultItemStyle()};t.prototype.getItemExpandBoxStyle=function(e){if(this.commonService.isString(e))return e;else if(e)return{general:this.commonService.isFieldAvailable(e.disabled,this.expandBoxClassName),load:this.commonService.isFieldAvailable(e.focused,this.expandBoxClassName+"-load"),expanded:this.commonService.isFieldAvailable(e.normal,this.expandBoxClassName+"-open"),collapsed:this.commonService.isFieldAvailable(e.hovered,this.expandBoxClassName+"-close")};else return this.getDefaultItemExpandBoxStyle()};t.prototype.getDefaultItemStyle=function(){return{general:this.getDefaultItemGeneralStyle(),expandBox:this.getDefaultItemExpandBoxStyle(),content:this.getDefaultItemContentStyle()}};t.prototype.getDefaultItemExpandBoxStyle=function(){return{general:this.defaultStyle.item.expandBox.general,load:this.defaultStyle.item.expandBox.load,expanded:this.defaultStyle.item.expandBox.expanded,collapsed:this.defaultStyle.item.expandBox.collapsed}};t.prototype.resetRefresh=function(){if(this.refreshTimer)clearTimeout(this.refreshTimer);this.refreshTimer=null};t.prototype.refresh=function(e){if(this.allowUpdate){this.resetRefresh();if(0!=this.virtualMode){this.updateControlClass();for(var t=0;t<this.scrollItemList.length;t++){var i=this.scrollItemList[t];this.updateItemStyle(i)}}else{this.clearComponentSelection();for(t=0;t<this.currentSelectedItems.length;t++){var n=this.getComponentFromItem(this.currentSelectedItems[t]);if(n)n.state|=integralui_core_1.IntegralUIObjectState.selected}if(this.contentList){this.itemList=this.contentList.toArray();for(t=0;t<this.itemList.length;t++)this.itemList[t].refresh()}}}};t.ɵfac=function(e){return new(e||t)(i0.ɵɵdirectiveInject(i1.IntegralUIDataService),i0.ɵɵdirectiveInject(i2.IntegralUIDragDropService),i0.ɵɵdirectiveInject(i0.ElementRef),i0.ɵɵdirectiveInject(i0.Renderer2),i0.ɵɵdirectiveInject(i3.IntegralUICommonService),i0.ɵɵdirectiveInject(i4.IntegralUIFilterService),i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver),i0.ɵɵdirectiveInject(i5.IntegralUIBaseService))};t.ɵcmp=i0.ɵɵdefineComponent({type:t,selectors:[["iui-treeview"]],contentQueries:function(e,t,i){if(1&e){i0.ɵɵcontentQuery(i,core_1.TemplateRef,!0);i0.ɵɵcontentQuery(i,integralui_core_1.IntegralUITemplate,!0)}if(2&e){var n;i0.ɵɵqueryRefresh(n=i0.ɵɵloadQuery())&&(t.itemTemplate=n.first);i0.ɵɵqueryRefresh(n=i0.ɵɵloadQuery())&&(t.templates=n)}},viewQuery:function(e,t){if(1&e){i0.ɵɵviewQuery(_c0,!0,core_1.ViewContainerRef);i0.ɵɵviewQuery(_c0,!0,core_1.ElementRef);i0.ɵɵviewQuery(_c1,!0);i0.ɵɵviewQuery(_c2,!0);i0.ɵɵviewQuery(integralui_treeitem_1.IntegralUITreeItem,!0);i0.ɵɵviewQuery(_c3,!0,core_1.ElementRef);i0.ɵɵviewQuery(_c4,!0,core_1.ElementRef)}if(2&e){var i;i0.ɵɵqueryRefresh(i=i0.ɵɵloadQuery())&&(t.contentRef=i.first);i0.ɵɵqueryRefresh(i=i0.ɵɵloadQuery())&&(t.contentElem=i.first);i0.ɵɵqueryRefresh(i=i0.ɵɵloadQuery())&&(t.verScrollCmp=i.first);i0.ɵɵqueryRefresh(i=i0.ɵɵloadQuery())&&(t.horScrollCmp=i.first);i0.ɵɵqueryRefresh(i=i0.ɵɵloadQuery())&&(t.contentList=i);i0.ɵɵqueryRefresh(i=i0.ɵɵloadQuery())&&(t.itemElems=i);i0.ɵɵqueryRefresh(i=i0.ɵɵloadQuery())&&(t.itemContentElems=i)}},inputs:{allowDrag:"allowDrag",allowDrop:"allowDrop",allowFilter:"allowFilter",allowFocus:"allowFocus",appRef:"appRef",controlStyle:"controlStyle",data:"data",enabled:"enabled",items:"items",name:"name",selectedItem:"selectedItem",selectionMode:"selectionMode",size:"size",sorting:"sorting",state:"state",virtualMode:"virtualMode",autoExpand:"autoExpand",compactMode:"compactMode",indent:"indent",itemDisplay:"itemDisplay",showExpandBox:"showExpandBox"},outputs:{afterSelect:"afterSelect",beforeEdit:"beforeEdit",beforeSelect:"beforeSelect",change:"change",clear:"clear",dragEnter:"dragEnter",dragDrop:"dragDrop",dragDropComplete:"dragDropComplete",dragLeave:"dragLeave",dragOver:"dragOver",itemAdding:"itemAdding",itemAdded:"itemAdded",itemHover:"itemHover",itemRemoving:"itemRemoving",itemRemoved:"itemRemoved",keyDown:"keyDown",keyPress:"keyPress",keyUp:"keyUp",loadComplete:"loadComplete",scrollPosChanged:"scrollPosChanged",selectionChanged:"selectionChanged",updateComplete:"updateComplete",afterCollapse:"afterCollapse",afterExpand:"afterExpand",beforeCollapse:"beforeCollapse",beforeExpand:"beforeExpand"},features:[i0.ɵɵProvidersFeature([integralui_core_1.IntegralUIBaseService,integralui_data_service_1.IntegralUIDataService]),i0.ɵɵInheritDefinitionFeature],decls:5,vars:4,consts:[[3,"ngClass","ngStyle","DOMMouseScroll","mousewheel","mouseenter","mouseleave","mousemove","dragenter","dragleave","dragover","drop","dragend","scroll"],[3,"ngSwitch"],["content",""],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],[2,"margin","0","padding","0",3,"ngStyle","touchstart","touchend"],[3,"ngClass","ngStyle",4,"ngFor","ngForOf"],["class","iui-treeview-block iui-treeview-block-hover",3,"ngStyle",4,"ngIf"],[4,"ngIf"],[3,"enabled","value","max","largeChange","height","mouseenter","valueChanged","scrollStart","scrollEnd",4,"ngIf"],[3,"enabled","orientation","value","max","width","mouseenter","valueChanged","scrollStart","scrollEnd",4,"ngIf"],["class","iui-scrollbar-corner","style","position:absolute;right:0;bottom:0;width:16px;height:16px;",4,"ngIf"],[3,"ngClass","ngStyle"],["itemElem",""],[3,"ngClass","ngStyle","mouseenter","mousemove","mouseleave",4,"ngIf"],["style","pointer-ev