@lidorsystems/integralui-web
Version:
IntegralUI Web - Advanced UI Components for Angular
15 lines (12 loc) • 28.6 kB
JavaScript
/*
filename: integralui.breadcrumb.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 t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)if(e.hasOwnProperty(i))t[i]=e[i]})(e,i)};return function(e,i){t(e,i);function s(){this.constructor=e}e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}();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"),i0=require("@angular/core"),i1=require("../services/integralui.data.service"),i2=require("../services/integralui.common.service"),i3=require("@angular/common"),i4=require("./integralui.core"),_c0=["block"],_c1=["topButton"],_c2=["itemElem"],_c3=["buttonElem"],_c4=function(t){return{height:t}};function IntegralUIBreadCrumb_div_1_Template(t,e){if(1&t){var i=i0.ɵɵgetCurrentView();i0.ɵɵelementStart(0,"div",7,8);i0.ɵɵlistener("mousedown",function(t){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext().rootMouseDown(t)})("mouseenter",function(t){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext().rootMouseEnter(t)})("mouseleave",function(t){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext().rootMouseLeave(t)})("touchstart",function(t){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext().rootTouchStart(t)});i0.ɵɵelement(2,"span",9);i0.ɵɵelementEnd()}if(2&t){var s=i0.ɵɵnextContext();i0.ɵɵproperty("ngClass",s.rootButtonStyle)("ngStyle",i0.ɵɵpureFunction1(2,_c4,s.getRootButtonHeight()))}}var _c5=function(t){return{"iui-breadcrumb-item-button-first":t}};function IntegralUIBreadCrumb_li_4_div_1_Template(t,e){if(1&t){var i=i0.ɵɵgetCurrentView();i0.ɵɵelementStart(0,"div",13,14);i0.ɵɵlistener("mousedown",function(t){i0.ɵɵrestoreView(i);var e=i0.ɵɵnextContext(),s=e.$implicit,o=e.index;return i0.ɵɵnextContext().expandBoxMouseDown(t,s,o)})("mouseup",function(t){i0.ɵɵrestoreView(i);return i0.ɵɵnextContext(2).expandBoxMouseUp(t)})("touchstart",function(t){i0.ɵɵrestoreView(i);var e=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext().expandBoxTouchStart(t,e)});i0.ɵɵelement(2,"span",15);i0.ɵɵelementEnd()}if(2&t){var s=i0.ɵɵnextContext().$implicit;i0.ɵɵproperty("ngClass",i0.ɵɵpureFunction1(2,_c5,s.isRoot));i0.ɵɵadvance(2);i0.ɵɵproperty("ngClass",s.style.expandBox)}}var _c6=function(t){return{$implicit:t}};function IntegralUIBreadCrumb_li_4_div_2_Template(t,e){if(1&t){var i=i0.ɵɵgetCurrentView();i0.ɵɵelementStart(0,"div",16);i0.ɵɵlistener("mousedown",function(t){i0.ɵɵrestoreView(i);var e=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext().itemMouseDown(t,e)})("mouseup",function(t){i0.ɵɵrestoreView(i);var e=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext().itemMouseUp(t,e)})("touchend",function(t){i0.ɵɵrestoreView(i);var e=i0.ɵɵnextContext().$implicit;return i0.ɵɵnextContext().itemTouchEnd(t,e)});i0.ɵɵelement(1,"span",17);i0.ɵɵelementEnd()}if(2&t){var s=i0.ɵɵnextContext().$implicit,o=i0.ɵɵnextContext();i0.ɵɵproperty("ngClass",s.style.content);i0.ɵɵadvance(1);i0.ɵɵproperty("iuiTemplateOutlet",o.itemTemplate)("iuiTemplateOutletContext",i0.ɵɵpureFunction1(3,_c6,s.data))}}function IntegralUIBreadCrumb_li_4_Template(t,e){if(1&t){var i=i0.ɵɵgetCurrentView();i0.ɵɵelementStart(0,"li",10);i0.ɵɵlistener("mouseenter",function(t){i0.ɵɵrestoreView(i);var s=e.$implicit,o=e.index;return i0.ɵɵnextContext().itemMouseEnter(t,s,o)})("mouseleave",function(t){i0.ɵɵrestoreView(i);var s=e.$implicit;return i0.ɵɵnextContext().itemMouseLeave(t,s)});i0.ɵɵtemplate(1,IntegralUIBreadCrumb_li_4_div_1_Template,3,4,"div",11);i0.ɵɵtemplate(2,IntegralUIBreadCrumb_li_4_div_2_Template,2,5,"div",12);i0.ɵɵelementEnd()}if(2&t){var s=e.$implicit,o=i0.ɵɵnextContext();i0.ɵɵproperty("ngClass",s.style.general)("ngStyle",i0.ɵɵpureFunction1(4,_c4,o.getItemHeight()));i0.ɵɵadvance(1);i0.ɵɵproperty("ngIf",s.hasChildren);i0.ɵɵadvance(1);i0.ɵɵproperty("ngIf",!s.isRoot)}}function IntegralUIBreadCrumb_li_6_div_2_Template(t,e){if(1&t){i0.ɵɵelementStart(0,"div",21);i0.ɵɵelement(1,"span",15);i0.ɵɵelementEnd()}if(2&t){var i=i0.ɵɵnextContext().$implicit;i0.ɵɵproperty("ngClass",i0.ɵɵpureFunction1(2,_c5,i.isRoot));i0.ɵɵadvance(1);i0.ɵɵproperty("ngClass",i.style.expandBox)}}function IntegralUIBreadCrumb_li_6_div_3_Template(t,e){if(1&t){i0.ɵɵelementStart(0,"div",15);i0.ɵɵelement(1,"span",17);i0.ɵɵelementEnd()}if(2&t){var i=i0.ɵɵnextContext().$implicit,s=i0.ɵɵnextContext();i0.ɵɵproperty("ngClass",i.style.content);i0.ɵɵadvance(1);i0.ɵɵproperty("iuiTemplateOutlet",s.itemTemplate)("iuiTemplateOutletContext",i0.ɵɵpureFunction1(3,_c6,i.data))}}function IntegralUIBreadCrumb_li_6_Template(t,e){if(1&t){i0.ɵɵelementStart(0,"li",0,18);i0.ɵɵtemplate(2,IntegralUIBreadCrumb_li_6_div_2_Template,2,4,"div",19);i0.ɵɵtemplate(3,IntegralUIBreadCrumb_li_6_div_3_Template,2,5,"div",20);i0.ɵɵelementEnd()}if(2&t){var i=e.$implicit,s=i0.ɵɵnextContext();i0.ɵɵproperty("ngClass",i.style.general)("ngStyle",i0.ɵɵpureFunction1(4,_c4,s.getItemHeight()));i0.ɵɵadvance(2);i0.ɵɵproperty("ngIf",i.hasChildren);i0.ɵɵadvance(1);i0.ɵɵproperty("ngIf",!i.isRoot)}}var _c7=function(){return{opacity:0,position:"absolute",top:"-9999999px"}},IntegralUIBreadCrumb=function(t){__extends(e,t);function e(e,i,s,o){var n=t.call(this,s)||this;n.dataService=e;n.elemRef=i;n.commonService=s;n.cmpResolver=o;n.visibleStartIndex=0;n.dataItems=[];n.currentList=[];n.isThereChildItems=!1;n.options={};n.visibleList=[];n.activeObj=null;n.hoverItem=null;n.isListOpened=!1;n.prevActiveObj=null;n.isRootActive=null;n.isRootHovered=null;n.isPopupDelayed=!1;n.itemSize={width:0,height:0};n.listSize={width:100,height:200};n.showRootButton=!1;n.startIndex=0;n.updateTimeout=null;n.dropListRef=null;n.dropList=null;n.rootButtonStyle=[];n.isExpandBoxTouched=!1;n.selectionChanged=new core_1.EventEmitter;n.updateOptions();return n}Object.defineProperty(e.prototype,"dataFields",{set:function(t){this.updateDataFields(t)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"dropDownWidth",{get:function(){return this.listSize.width},set:function(t){if(this.listSize.width!=t)this.listSize.width=t},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"items",{get:function(){return this.dataItems},set:function(t){this.dataItems=t;this.updateData()},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"selectedItem",{get:function(){return this.currentSelection},set:function(t){if(this.currentSelection!=t){this.currentSelection=t;this.updateLayout()}},enumerable:!0,configurable:!0});e.prototype.ngOnInit=function(){this.updateData();this.updateCurrentList();this.generalClassName="iui-breadcrumb";this.itemClassName="iui-breadcrumb-item";this.itemContentClassName=this.itemClassName+"-content";this.expandBoxClassName=this.itemClassName+"-expand-box";this.rootButtonClassName=this.generalClassName+"-root-button";this.initStyle()};e.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+"-close",collapsed:this.expandBoxClassName+"-open"},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()};e.prototype.ngAfterViewInit=function(){var t=this,e=setTimeout(function(){t.addDropList();clearTimeout(e)},100);t.updateLayout()};e.prototype.ngOnDestroy=function(){this.resetLayoutTimer();this.removeDropList()};e.prototype.ngAfterContentChecked=function(){if(!0===this.autoUpdate){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}}};e.prototype.getItemObject=function(t,e){switch(e){case"text":return t[this.options.dataFields.text]}return null};e.prototype.updateCurrentList=function(){var t,e=this;this.currentList.length=0;if(this.currentSelection){this.currentList.push({data:this.currentSelection,hasChildren:this.isThereVisibleChildren(this.currentSelection),style:{}});for(var i=this.getItemParent(this.currentSelection);i;){this.currentList.splice(0,0,{data:i,hasChildren:!0,style:{}});i=this.getItemParent(i)}this.currentList.splice(0,0,{data:(t={},t[this.options.dataFields.items]=this.items,t),hasChildren:!0,isRoot:!0,style:{}})}else if(this.items)this.items.map(function(t){return e.currentList.push({data:t,hasChildren:e.isThereVisibleChildren(t),style:{}})})};e.prototype.updateData=function(){this.dataService.init([{data:this.items,fields:this.options.dataFields}])};e.prototype.updateDataFields=function(t){if(t)this.options.dataFields={allowFocus:t.allowFocus?t.allowFocus:"allowFocus",content:t.content?t.content:"content",enabled:t.enabled?t.enabled:"enabled",hasChildren:t.hasChildren?t.hasChildren:"hasChildren",icon:t.icon?t.icon:"icon",id:t.id?t.id:"id",items:t.items?t.items:"items",pid:t.pid?t.pid:"pid",selected:t.selected?t.selected:"selected",style:t.style?t.style:"style",text:t.text?t.text:"text",tooltip:t.tooltip?t.tooltip:"tooltip",value:t.value?t.value:"value",visible:t.visible?t.visible:"visible"};else this.options.dataFields={allowFocus:"allowFocus",content:"content",enabled:"enabled",hasChildren:"hasChildren",icon:"icon",id:"id",items:"items",pid:"pid",selected:"selected",style:"style",text:"text",tooltip:"tooltip",value:"value",visible:"visible"};if(this.dataService)this.dataService.updateDataFields(this.options.dataFields)};e.prototype.updateOptions=function(t){if(t)this.options={currentStyle:{},dataFields:null};else{this.options={currentStyle:{},dataFields:null};this.updateDataFields()}};e.prototype.addDropList=function(){var t=this;if(t.appRef){t.removeDropList();var e=t.cmpResolver.resolveComponentFactory(integralui_core_1.IntegralUIListPopup);if(e){t.dropListRef=t.appRef.createComponent(e);if(t.dropListRef.instance)t.dropList=t.dropListRef.instance;t.hideDropList();if(t.dropList){t.dropList.closed.subscribe(function(e){t.hideDropList()});t.dropList.selectionChanged.subscribe(function(e){t.hideDropList();t.selectedItem=e.item;t.selectionChanged.emit({item:e.item});t.isPopupDelayed=!0;setTimeout(function(){t.isPopupDelayed=!1},250)})}}}};e.prototype.removeDropList=function(){if(this.dropList){if(this.dropList.closed)this.dropList.closed.unsubscribe();if(this.dropList.selectionChanged)this.dropList.selectionChanged.unsubscribe()}if(this.dropListRef)this.dropListRef.destroy();this.dropList=null};e.prototype.hideDropList=function(){if(this.dropList)this.dropList.display="none";this.updateActiveObj(null);this.activeObj=null;this.isListOpened=!1;this.isRootActive=!1;this.refresh()};e.prototype.showPopup=function(t,e,i){var s=this.commonService.getShiftPos(),o=this.getButtonElemRect(i),n=this.commonService.getPageRect(this.elemRef.nativeElement.firstElementChild);if(this.dropList){this.dropList.allowAnimation=!1;this.dropList.dataFields=this.options.dataFields;this.dropList.display="block";this.dropList.items=e.data[this.options.dataFields.items]?e.data[this.options.dataFields.items]:[];this.dropList.minWidth=this.listSize.width;this.dropList.position={x:o.left+s.x-1,y:n.bottom+s.y};this.dropList.size={width:Math.max(o.width,this.dropList.minWidth),height:0};this.dropList.refresh();this.dropList.open();this.dropList.focus();this.isListOpened=!0}this.refresh()};e.prototype.getButtonElemRect=function(t){var e=this.commonService.getPageRect(),i=this.getButtonElemList();if(i)if(t>=0&&t<i.length)e=this.commonService.getPageRect(i[t].nativeElement);return e};e.prototype.expandBoxMouseDown=function(t,e,i){if(this.isEnabled){if(1==t.buttons&&!this.isExpandBoxTouched)this.toggle(e);if(1==t.which&&!this.isPopupDelayed)this.showPopup(t,e,i);this.isExpandBoxTouched=!1}t.stopPropagation()};e.prototype.expandBoxMouseUp=function(t){this.isExpandBoxTouched=!1;t.stopPropagation()};e.prototype.expandBoxTouchStart=function(t,e){if(this.isEnabled){this.isExpandBoxTouched=!0;this.toggle(e)}t.stopPropagation()};e.prototype.toggle=function(t,e){if(t){if(!t.data[this.options.dataFields.hasChildren]&&(!t.data[this.options.dataFields.items]||0==t.data[this.options.dataFields.items].length))return;else if(e&&0!=t.data[this.options.dataFields.expanded])return;else if(!1===e&&0==t.data[this.options.dataFields.expanded])return;var i=void 0!==e?e:!1!==t.data[this.options.dataFields.expanded]?!0:!1,s=void 0!=e?e:!i;if(1!={cancel:!1,item:t.data}.cancel){if(s!=t.data[this.options.dataFields.expanded]){t.data[this.options.dataFields.expanded]=s;this.updateActiveObj(t)}}}};e.prototype.itemMouseEnter=function(t,e,i){if(this.isEnabled){this.hoverItem=e.data;if(this.isListOpened)this.updateActiveObj(e);if(this.dropList){var s=this.commonService.getShiftPos(),o=this.getButtonElemRect(i);this.dropList.items=e.data[this.options.dataFields.items]?e.data[this.options.dataFields.items]:[];this.dropList.position.x=o.left+s.x-1;this.dropList.opacity=this.dropList.items&&this.dropList.items.length>0?1:0;this.dropList.updateLayout()}this.refresh()}t.stopPropagation()};e.prototype.itemMouseLeave=function(t,e){if(this.isEnabled){this.hoverItem=null;this.refresh()}t.stopPropagation()};e.prototype.itemMouseDown=function(t,e){if(this.isEnabled)this.selectedItem=e.data;t.stopPropagation()};e.prototype.itemMouseUp=function(t,e){if(this.isEnabled);};e.prototype.itemTouchStart=function(t,e){if(this.isEnabled);};e.prototype.itemTouchEnd=function(t,e){if(this.isEnabled);};e.prototype.getRootButtonHeight=function(){return this.itemSize.height>0?this.itemSize.height-2+"px":"auto"};e.prototype.getItemHeight=function(){return this.itemSize.height>0?this.itemSize.height+"px":"auto"};e.prototype.getItemParent=function(t){return this.dataService.getParent(t)};e.prototype.isItemAllowed=function(t){return 0==t[this.options.dataFields.visible]?!1:!0};e.prototype.isItemEnabled=function(t){return this.isEnabled&&t&&0!=t[this.options.dataFields.enabled]};e.prototype.isItemHovered=function(t){return t&&t==this.hoverItem?!0:!1};e.prototype.isItemLoading=function(t){return!1};e.prototype.isItemSelected=function(t){return t==this.activeObj};e.prototype.isThereVisibleChildren=function(t){var e=!1;if(t){var i=t[this.options.dataFields.items];if(i)for(var s=0;s<i.length;s++)if(this.isItemAllowed(i[s])){e=!0;break}}return e};e.prototype.updateActiveObj=function(t){this.prevActiveObj=this.activeObj;this.activeObj=t;this.isRootActive=!1};e.prototype.getButtonElemList=function(){return this.buttonElems?this.buttonElems.toArray():null};e.prototype.getItemElemList=function(){return this.itemElems?this.itemElems.toArray():null};e.prototype.resetLayoutTimer=function(){if(this.updateTimeout)clearTimeout(this.updateTimeout);this.updateTimeout=null};e.prototype.updateLayout=function(){var t=this;t.resetLayoutTimer();t.updateTimeout=setTimeout(function(){t.updateCurrentList();t.clientRect={width:t.elemRef.nativeElement.firstElementChild.clientWidth,height:t.elemRef.nativeElement.firstElementChild.clientHeight};for(var e=0;e<t.currentList.length;e++)t.updateItemStyle(t.currentList[e]);setTimeout(function(){var e=[];t.startIndex=0;var i=t.getItemElemList();if(i){for(var s={width:0,height:0},o=0,n=-1,r=i.length-1;r>=0;r--){s={width:i[r].nativeElement.offsetWidth,height:Math.max(s.height,i[r].nativeElement.offsetHeight)};if(n<0&&o+s.width>t.clientRect.width-28)n=r+1;o+=s.width}t.itemSize=s;n=n>1?n:0;t.startIndex=Math.max(0,n)}if(t.currentSelection){t.currentList.map(function(i,s){if(s>=t.startIndex)e.push(i)});t.showRootButton=t.startIndex>0?!0:!1}else t.showRootButton=!0;t.visibleList=e},5);clearTimeout(t.updateTimeout)},1)};e.prototype.getRootList=function(){var t=[];if(this.currentSelection)for(var e=this.startIndex-1;e>=1;e--)t.push(this.currentList[e].data);else this.currentList.map(function(e){return t.push(e.data)});return t};e.prototype.rootMouseEnter=function(t){if(this.isEnabled){this.hoverItem=null;this.updateActiveObj(null);this.isRootHovered=!0;if(this.isListOpened)this.isRootActive=!0;if(this.dropList){var e=this.commonService.getShiftPos(),i=this.commonService.getPageRect(this.topButtonElem.nativeElement);this.dropList.items=this.getRootList();this.dropList.position.x=i.left+e.x-1;this.dropList.opacity=1;this.dropList.updateLayout()}this.refresh()}t.stopPropagation()};e.prototype.rootMouseLeave=function(t){if(this.isEnabled){this.hoverItem=null;this.isRootHovered=!1;this.refresh()}t.stopPropagation()};e.prototype.rootMouseDown=function(t){if(this.isEnabled){if(1===t.which&&!this.isPopupDelayed){var e=this.getRootList();this.showRootList(t,e);this.isRootActive=!0}this.isExpandBoxTouched=!1}t.stopPropagation()};e.prototype.rootTouchStart=function(t){if(this.isEnabled)if(!this.isPopupDelayed){var e=this.getRootList();this.showRootList(t,e);this.isRootActive=!0}t.stopPropagation()};e.prototype.showRootList=function(t,e){var i=this.commonService.getShiftPos(),s=this.commonService.getPageRect(this.topButtonElem.nativeElement),o=this.commonService.getPageRect(this.elemRef.nativeElement.firstElementChild);if(this.dropList){this.dropList.allowAnimation=!1;this.dropList.dataFields=this.options.dataFields;this.dropList.display="block";this.dropList.items=e;this.dropList.minWidth=this.listSize.width;this.dropList.position={x:s.left+i.x-1,y:o.bottom+i.y};this.dropList.size={width:Math.max(s.width,this.dropList.minWidth),height:0};this.dropList.refresh();this.dropList.open();this.dropList.focus();this.isListOpened=!0}this.refresh()};e.prototype.getControlStyle=function(){var t={};if(this.ctrlSize.width>0)t.width=this.ctrlSize.width+"px";if(this.ctrlSize.height>0)t.height=this.ctrlSize.height+"px";return t};e.prototype.getItemInlineStyle=function(t){return t.data[this.options.dataFields.style]||{}};e.prototype.refresh=function(t){if(t)this.updateItemStyle(t);else{this.updateRootButtonStyle();for(var e=0;e<this.currentList.length;e++){var i=this.currentList[e];this.updateItemStyle(i)}}};e.prototype.updateItemStyle=function(t){if(t){t.style={general:[],expandBox:[],content:[]};t.inlineStyle=this.getItemInlineStyle(t);t.style.general.push(this.itemClassName);t.style.general.push(this.options.currentStyle.item.general.normal);t.style.content.push(this.itemContentClassName);t.style.content.push(this.options.currentStyle.item.content.normal);if(!this.isItemEnabled(t.data)){t.style.general.push(this.options.currentStyle.item.general.disabled);t.style.content.push(this.options.currentStyle.item.content.disabled)}else if(this.isItemSelected(t)){t.style.general.push(this.options.currentStyle.item.general.selected);t.style.content.push(this.options.currentStyle.item.content.selected)}else if(this.isItemHovered(t.data)){t.style.general.push(this.options.currentStyle.item.general.hovered);t.style.content.push(this.options.currentStyle.item.content.hovered)}if(this.isThereChildItems||t.hasChildren)t.style.expandBox.push(this.options.currentStyle.item.expandBox.general);if((t.hasChildren||t.data[this.options.dataFields.hasChildren])&&(this.isThereVisibleChildren(t.data)||!t.data[this.options.dataFields.items]||t.data[this.options.dataFields.items]&&0==t.data[this.options.dataFields.items].length)||this.isThereVisibleChildren(t.data))if(this.isItemLoading(t.data))t.style.expandBox.push(this.options.currentStyle.item.expandBox.load);else if(t==this.activeObj&&this.isListOpened){t.style.expandBox.push(this.options.currentStyle.item.expandBox.collapsed);t.style.expandBox.push(this.options.currentStyle.item.expandBox.collapsed+"-animate")}else{t.style.expandBox.push(this.options.currentStyle.item.expandBox.expanded);if(t==this.prevActiveObj)t.style.expandBox.push(this.options.currentStyle.item.expandBox.expanded+"-animate")}}};e.prototype.updateRootButtonStyle=function(){this.rootButtonStyle=[];this.rootButtonStyle.push(this.rootButtonClassName);if(!this.isEnabled)this.rootButtonStyle.push(this.rootButtonClassName+"-disabled");else if(this.isRootActive)this.rootButtonStyle.push(this.rootButtonClassName+"-selected");else if(this.isRootHovered)this.rootButtonStyle.push(this.rootButtonClassName+"-hovered")};e.prototype.getItemStyle=function(t){if(t)return{general:this.getItemGeneralStyle(t.general),expandBox:this.getItemExpandBoxStyle(t.expandBox),content:this.getItemContentStyle(t.content)};else return this.getDefaultItemStyle()};e.prototype.getItemExpandBoxStyle=function(t){if(this.commonService.isString(t))return t;else if(t)return{general:this.commonService.isFieldAvailable(t.disabled,this.expandBoxClassName),load:this.commonService.isFieldAvailable(t.focused,this.expandBoxClassName+"-load"),expanded:this.commonService.isFieldAvailable(t.normal,this.expandBoxClassName+"-open"),collapsed:this.commonService.isFieldAvailable(t.hovered,this.expandBoxClassName+"-close")};else return this.getDefaultItemExpandBoxStyle()};e.prototype.getItemGeneralStyle=function(t){if(this.commonService.isString(t))return t;else if(t)return{disabled:this.commonService.isFieldAvailable(t.disabled,this.itemClassName+"-disabled"),focused:this.commonService.isFieldAvailable(t.focused,this.itemClassName+"-focused"),normal:this.commonService.isFieldAvailable(t.normal,this.itemClassName),hovered:this.commonService.isFieldAvailable(t.hovered,this.itemClassName+"-hovered"),selected:this.commonService.isFieldAvailable(t.selected,this.itemClassName+"-selected")};else return this.getDefaultItemGeneralStyle()};e.prototype.getItemContentStyle=function(t){if(this.commonService.isString(t))return t;else if(t)return{disabled:this.commonService.isFieldAvailable(t.disabled,this.itemContentClassName+"-disabled"),focused:this.commonService.isFieldAvailable(t.focused,this.itemContentClassName+"-focused"),normal:this.commonService.isFieldAvailable(t.normal,this.itemContentClassName),hovered:this.commonService.isFieldAvailable(t.hovered,this.itemContentClassName+"-hovered"),selected:this.commonService.isFieldAvailable(t.selected,this.itemContentClassName+"-selected")};else return this.getDefaultItemContentStyle()};e.prototype.getDefaultListStyle=function(){return{general:this.getDefaultGeneralStyle(),item:this.getDefaultItemStyle()}};e.prototype.getDefaultItemStyle=function(){return{general:this.getDefaultItemGeneralStyle(),expandBox:this.getDefaultItemExpandBoxStyle(),content:this.getDefaultItemContentStyle()}};e.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}};e.prototype.getDefaultItemGeneralStyle=function(){return{disabled:this.defaultStyle.item.general.disabled,focused:this.defaultStyle.item.general.focused,normal:this.defaultStyle.item.general.normal,hovered:this.defaultStyle.item.general.hovered,selected:this.defaultStyle.item.general.selected}};e.prototype.getDefaultItemContentStyle=function(){return{disabled:this.defaultStyle.item.content.disabled,focused:this.defaultStyle.item.content.focused,normal:this.defaultStyle.item.content.normal,hovered:this.defaultStyle.item.content.hovered,selected:this.defaultStyle.item.content.selected}};e.prototype.updateStyle=function(t){if(t)this.options.currentStyle={general:this.getGeneralStyle(t.general),item:this.getItemStyle(t.item)};else this.options.currentStyle=this.getDefaultListStyle()};e.ɵfac=function(t){return new(t||e)(i0.ɵɵdirectiveInject(i1.IntegralUIDataService),i0.ɵɵdirectiveInject(i0.ElementRef),i0.ɵɵdirectiveInject(i2.IntegralUICommonService),i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver))};e.ɵcmp=i0.ɵɵdefineComponent({type:e,selectors:[["iui-breadcrumb"]],contentQueries:function(t,e,i){if(1&t)i0.ɵɵcontentQuery(i,core_1.TemplateRef,!0);if(2&t){var s;i0.ɵɵqueryRefresh(s=i0.ɵɵloadQuery())&&(e.itemTemplate=s.first)}},viewQuery:function(t,e){if(1&t){i0.ɵɵviewQuery(_c0,!0,core_1.ElementRef);i0.ɵɵviewQuery(_c1,!0,core_1.ElementRef);i0.ɵɵviewQuery(_c2,!0,core_1.ElementRef);i0.ɵɵviewQuery(_c3,!0,core_1.ElementRef)}if(2&t){var i;i0.ɵɵqueryRefresh(i=i0.ɵɵloadQuery())&&(e.blockElem=i.first);i0.ɵɵqueryRefresh(i=i0.ɵɵloadQuery())&&(e.topButtonElem=i.first);i0.ɵɵqueryRefresh(i=i0.ɵɵloadQuery())&&(e.itemElems=i);i0.ɵɵqueryRefresh(i=i0.ɵɵloadQuery())&&(e.buttonElems=i)}},inputs:{controlStyle:"controlStyle",data:"data",enabled:"enabled",name:"name",size:"size",state:"state",appRef:"appRef",autoUpdate:"autoUpdate",dataFields:"dataFields",dropDownWidth:"dropDownWidth",items:"items",selectedItem:"selectedItem"},outputs:{selectionChanged:"selectionChanged"},features:[i0.ɵɵProvidersFeature([integralui_data_service_1.IntegralUIDataService]),i0.ɵɵInheritDefinitionFeature],decls:7,vars:7,consts:[[3,"ngClass","ngStyle"],[3,"ngClass","ngStyle","mousedown","mouseenter","mouseleave","touchstart",4,"ngIf"],[1,"iui-breadcrumb-block"],["block",""],[3,"ngClass","ngStyle","mouseenter","mouseleave",4,"ngFor","ngForOf"],[1,"iui-breadcrumb-block",3,"ngStyle"],[3,"ngClass","ngStyle",4,"ngFor","ngForOf"],[3,"ngClass","ngStyle","mousedown","mouseenter","mouseleave","touchstart"],["topButton",""],[1,"iui-breadcrumb-root-button-box"],[3,"ngClass","ngStyle","mouseenter","mouseleave"],["class","iui-breadcrumb-item-button","style","display:inline-block",3,"ngClass","mousedown","mouseup","touchstart",4,"ngIf"],[3,"ngClass","mousedown","mouseup","touchend",4,"ngIf"],[1,"iui-breadcrumb-item-button",2,"display","inline-block",3,"ngClass","mousedown","mouseup","touchstart"],["buttonElem",""],[3,"ngClass"],[3,"ngClass","mousedown","mouseup","touchend"],[3,"iuiTemplateOutlet","iuiTemplateOutletContext"],["itemElem",""],["class","iui-breadcrumb-item-button","style","display:inline-block",3,"ngClass",4,"ngIf"],[3,"ngClass",4,"ngIf"],[1,"iui-breadcrumb-item-button",2,"display","inline-block",3,"ngClass"]],template:function(t,e){if(1&t){i0.ɵɵelementStart(0,"div",0);i0.ɵɵtemplate(1,IntegralUIBreadCrumb_div_1_Template,3,4,"div",1);i0.ɵɵelementStart(2,"ul",2,3);i0.ɵɵtemplate(4,IntegralUIBreadCrumb_li_4_Template,3,6,"li",4);i0.ɵɵelementEnd();i0.ɵɵelementStart(5,"ul",5);i0.ɵɵtemplate(6,IntegralUIBreadCrumb_li_6_Template,4,6,"li",6);i0.ɵɵelementEnd();i0.ɵɵelementEnd()}if(2&t){i0.ɵɵproperty("ngClass",e.getControlClass())("ngStyle",e.getControlStyle());i0.ɵɵadvance(1);i0.ɵɵproperty("ngIf",e.showRootButton);i0.ɵɵadvance(3);i0.ɵɵproperty("ngForOf",e.visibleList);i0.ɵɵadvance(1);i0.ɵɵproperty("ngStyle",i0.ɵɵpureFunction0(6,_c7));i0.ɵɵadvance(1);i0.ɵɵproperty("ngForOf",e.currentList)}},directives:[i3.NgClass,i3.NgStyle,i3.NgIf,i3.NgForOf,i4.IntegralUITemplateOutlet],encapsulation:2});return e}(integralui_core_1.IntegralUIBaseComponent);exports.IntegralUIBreadCrumb=IntegralUIBreadCrumb;