/*! * filename: ej2-layouts.min.js * version : 19.1.63 * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ this.ej=this.ej||{},this.ej.layouts=function(e,t){"use strict";var i=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)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),s=function(e,t,i,s){var n,a=arguments.length,l=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(l=(a<3?n(l):a>3?n(t,i,l):n(t,i))||l);return a>3&&l&&Object.defineProperty(t,i,l),l},n="e-splitter",a="e-pane",l="e-pane-horizontal",r="e-pane-vertical",o="e-split-bar",h="e-split-bar-horizontal",d="e-static-pane",p="e-resize-handler",c="e-arrow-left",u="e-arrow-up",g="e-arrow-down",m="e-icon-hidden",v=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return i(n,e),s([t.Property()],n.prototype,"size",void 0),s([t.Property(!1)],n.prototype,"collapsible",void 0),s([t.Property(!1)],n.prototype,"collapsed",void 0),s([t.Property(!0)],n.prototype,"resizable",void 0),s([t.Property(null)],n.prototype,"min",void 0),s([t.Property(null)],n.prototype,"max",void 0),s([t.Property()],n.prototype,"content",void 0),s([t.Property("")],n.prototype,"cssClass",void 0),n}(t.ChildProperty),f=function(e){function f(t,i){var s=e.call(this,t,i)||this;return s.allPanes=[],s.paneOrder=[],s.separatorOrder=[],s.allBars=[],s.previousCoordinates={},s.currentCoordinates={},s.updatePrePaneInPercentage=!1,s.updateNextPaneInPercentage=!1,s.panesDimensions=[],s.border=0,s.validDataAttributes=["data-size","data-min","data-max","data-collapsible","data-resizable","data-content","data-collapsed"],s.validElementAttributes=["data-orientation","data-width","data-height"],s.iconsDelay=300,s.templateElement=[],s.collapseFlag=!1,s.expandFlag=!0,s}return i(f,e),f.prototype.onPropertyChanged=function(e,i){if(this.element.classList.contains(n))for(var s=0,a=Object.keys(e);s0||this.nextPane.style.flexBasis.indexOf("%")>0){var a=this.updatePaneFlexBasis(this.previousPane),l=this.updatePaneFlexBasis(this.nextPane);this.totalPercent=a+l,this.totalWidth=this.convertPercentageToPixel(this.totalPercent+"%"),"keydown"!==e.type||t.isNullOrUndefined(e.keyCode)||((39===e.keyCode||40===e.keyCode)&&s>0?(this.previousPane.style.flexBasis=a+1+"%",this.nextPane.style.flexBasis=l-1+"%"):(37===e.keyCode||38===e.keyCode)&&i>0&&(this.previousPane.style.flexBasis=a-1+"%",this.nextPane.style.flexBasis=l+1+"%"))}else this.totalWidth="Horizontal"===this.orientation?this.previousPane.offsetWidth+this.nextPane.offsetWidth:this.previousPane.offsetHeight+this.nextPane.offsetHeight,"keydown"!==e.type||t.isNullOrUndefined(e.keyCode)||((39===e.keyCode||40===e.keyCode)&&s>0?(this.addStaticPaneClass(),this.previousPane.style.flexBasis=i+n+"px",this.nextPane.style.flexBasis=s0&&(this.addStaticPaneClass(),this.previousPane.style.flexBasis=i1){var i=this.getSeparatorIndex(this.currentSeparator),s=this.previousPane.classList.contains("e-collapsed"),n=this.previousPane.classList.contains("e-expanded"),a=this.nextPane.classList.contains("e-collapsed");("Horizontal"!==this.orientation&&38===e.keyCode||"Horizontal"===this.orientation&&39===e.keyCode||"Horizontal"===this.orientation&&37===e.keyCode||"Horizontal"!==this.orientation&&40===e.keyCode)&&(!n&&!a&&!s||n&&!a)&&document.activeElement.classList.contains(o)&&this.paneSettings[i].resizable&&this.paneSettings[i+1].resizable?(this.checkPaneSize(e),this.triggerResizing(e)):13===e.keyCode&&this.paneSettings[i].collapsible&&document.activeElement.classList.contains(o)&&(this.previousPane.classList.contains("e-collapsed")?(this.expand(i),t.addClass([this.currentSeparator],"e-split-bar-active")):(this.collapse(i),t.addClass([this.currentSeparator],"e-split-bar-active")))}},f.prototype.sanitizeHelper=function(e){if(this.enableHtmlSanitizer){var i=t.SanitizeHtmlHelper.beforeSanitize(),s={cancel:!1,helper:null};t.extend(i,i,s),this.trigger("beforeSanitizeHtml",i),i.cancel&&!t.isNullOrUndefined(i.helper)?e=i.helper(e):i.cancel||(e=t.SanitizeHtmlHelper.serializeValue(i,e))}return e},f.prototype.checkDataAttributes=function(){for(var e,i,s=0;s-1?",":" "))},f.prototype.hideResizer=function(e){t.addClass([t.select("."+p,e)],"e-hide-handler")},f.prototype.showResizer=function(e){!t.isNullOrUndefined(this.previousPane)&&this.previousPane.classList.contains("e-resizable")&&!t.isNullOrUndefined(this.nextPane)&&this.nextPane.classList.contains("e-resizable")&&t.removeClass([t.select("."+p,e)],"e-hide-handler")},f.prototype.resizableModel=function(e,i){var s=e===this.allBars.length?e-1:e,n=e;t.EventHandler.remove(this.allBars[s],"mousedown",this.onMouseDown),i?(t.EventHandler.add(this.allBars[s],"mousedown",this.onMouseDown,this),this.isResizable()&&(this.showResizer(this.allBars[s]),t.removeClass([t.select("."+p,this.allBars[s])],"e-hide-handler"),this.allBars[s].classList.add("e-resizable-split-bar"),e===this.allBars.length?this.allPanes[e].classList.add("e-resizable"):this.allPanes[s].classList.add("e-resizable"),this.updateResizablePanes(n))):(this.updateResizablePanes(n),this.hideResizer(this.allBars[s]),this.allBars[s].classList.remove("e-resizable-split-bar"),e===this.allBars.length?this.allPanes[e].classList.remove("e-resizable"):this.allPanes[s].classList.remove("e-resizable"))},f.prototype.collapsibleModelUpdate=function(e){var t=e===this.allBars.length?e-1:e,i="Horizontal"===this.orientation?this.checkArrow(t,c):this.checkArrow(t,u),s="Horizontal"===this.orientation?this.checkArrow(t,"e-arrow-right"):this.checkArrow(t,g);this.paneCollapsible(this.allPanes[e],e),this.updateCollapseIcons(t,s,i)},f.prototype.collapseArrow=function(e,i){return t.selectAll("."+i,this.allBars[e])[0]},f.prototype.updateIsCollapsed=function(e,i,s){if(!t.isNullOrUndefined(e)){var n=e===this.allBars.length,a=n?e-1:e;(!n&&this.allPanes[e+1].classList.contains("e-collapsed")&&0!==e?this.collapseArrow(a-1,s):n?this.collapseArrow(a,s):this.collapseArrow(a,i)).click()}},f.prototype.isCollapsed=function(e){var i=this;if(t.isNullOrUndefined(e)||!this.paneSettings[e].collapsed||!t.isNullOrUndefined(this.allPanes[e].classList.contains("e-collapsed"))){if(this.expandFlag=!1,t.isNullOrUndefined(e)){for(s=0;s=0;s--)if(!t.isNullOrUndefined(this.paneSettings[s])&&this.paneSettings[s].collapsed&&!this.allPanes[s].classList.contains("e-collapsed")){var n="Horizontal"===this.orientation?"e-arrow-right":g;0!==s&&(a=this.collapseArrow(s-1,n)).click(),this.nextPane.classList.contains("e-collapsed")||(a=this.collapseArrow(s-1,n)).click()}}else{this.collapseFlag=!0;var a=void 0,l=e===this.allBars.length,r=l?e-1:e,o={target:a=!l&&this.allPanes[e+1].classList.contains("e-collapsed")&&0!==e?this.collapseArrow(r-1,this.targetArrows().lastBarArrow):l?this.collapseArrow(r,this.targetArrows().lastBarArrow):this.collapseArrow(r,this.targetArrows().collapseArrow)},h=this.beforeAction(o);this.trigger("beforeCollapse",h,function(t){if(!t.cancel){var s=[];s[0]=e;for(var n=1,a=0;a0;a--)if(!i.allPanes[s[a-1]].classList.contains("e-collapsed")){var l=i.targetArrows();i.updateIsCollapsed(s[a-1],l.collapseArrow,l.lastBarArrow)}var r=i.afterAction(o);i.trigger("collapsed",r),i.collapseFlag=!1}})}this.expandFlag=!0}},f.prototype.targetArrows=function(){return this.splitterProperty(),{collapseArrow:"Horizontal"===this.orientation?c:u,lastBarArrow:"Vertical"===this.orientation?g:"e-arrow-right"}},f.prototype.collapsedOnchange=function(e){t.isNullOrUndefined(this.paneSettings[e])||t.isNullOrUndefined(this.paneSettings[e].collapsed)||!this.allPanes[e].classList.contains("e-collapsed")||this.updateIsCollapsed(e,this.targetArrows().lastBarArrow,this.targetArrows().collapseArrow)},f.prototype.isEnabled=function(e){e?t.removeClass([this.element],"e-disabled"):t.addClass([this.element],"e-disabled")},f.prototype.setSeparatorSize=function(e){for(var i=t.isNullOrUndefined(e)?"auto":e+"px",s="Horizontal"===this.orientation?h:"e-split-bar-vertical",n=0;n1&&this.updateResizablePanes(c);if("msie"===t.Browser.info.name)for(var d=this.element.querySelectorAll(".e-splitter .e-resize-handler"),c=0;c-1?"mouse":"touch"},f.prototype.updateCurrentSeparator=function(e){this.currentSeparator=this.isSeparator(e)?e.parentElement:e},f.prototype.isSeparator=function(e){return!e.classList.contains(o)},f.prototype.isMouseEvent=function(e){var i=!1;return("mouse"===this.getEventType(e.type)||!t.isNullOrUndefined(e.pointerType)&&"mouse"===this.getEventType(e.pointerType))&&(i=!0),i},f.prototype.updateCursorPosition=function(e,i){if(this.isMouseEvent(e))this.changeCoordinates({x:e.pageX,y:e.pageY},i);else{var s="msie"!==t.Browser.info.name?e.touches[0]:e;this.changeCoordinates({x:s.pageX,y:s.pageY},i)}},f.prototype.changeCoordinates=function(e,t){"previous"===t?this.previousCoordinates=e:this.currentCoordinates=e},f.prototype.reportWindowSize=function(){var e=this,i=this.allPanes.length;if(!document.body.contains(this.element))return void document.defaultView.removeEventListener("resize",this.onReportWindowSize);for(var s=0;s0&&setTimeout(function(){e.updateSplitterSize(!0)},200)},f.prototype.updateSplitterSize=function(e){for(var t=0,i=[],s=0,n=this.element.children,a=0;a0&&(p=this.convertPercentageToPixel(this.paneSettings[a].min)),d=this.convertPixelToNumber(p.toString()),this.allPanes[a].offsetWidth-1;c.style.flexBasis=m?this.convertPixelToPercentage(c.offsetWidth+g)+"%":c.offsetWidth+g+"px",u.style.flexBasis=u.style.flexBasis.indexOf("%")>-1?this.convertPixelToPercentage(u.offsetWidth-g)+"%":u.offsetWidth-g+"px"}},f.prototype.wireResizeEvents=function(){t.EventHandler.add(document,"mousemove",this.onMouseMove,this),t.EventHandler.add(document,"mouseup",this.onMouseUp,this);var e="msie"===t.Browser.info.name?"pointermove":"touchmove",i="msie"===t.Browser.info.name?"pointerup":"touchend";t.EventHandler.add(document,e,this.onMouseMove,this),t.EventHandler.add(document,i,this.onMouseUp,this)},f.prototype.unwireResizeEvents=function(){this.element.ownerDocument.defaultView.removeEventListener("resize",this.onReportWindowSize);var e="msie"===t.Browser.info.name?"pointermove":"touchmove",i="msie"===t.Browser.info.name?"pointerup":"touchend";t.EventHandler.remove(document,"mousemove",this.onMouseMove),t.EventHandler.remove(document,"mouseup",this.onMouseUp),t.EventHandler.remove(document,e,this.onMouseMove),t.EventHandler.remove(document,i,this.onMouseUp)},f.prototype.wireClickEvents=function(){t.EventHandler.add(this.currentSeparator,"touchstart click",this.clickHandler,this)},f.prototype.clickHandler=function(e){if(!e.target.classList.contains("e-navigate-arrow")){var i=t.selectAll(".e-splitter > .e-split-bar.e-split-bar-hover");i.length>0&&t.removeClass(i,"e-split-bar-hover"),e.target.classList.add("e-split-bar-hover")}var s=e.target;(s.classList.contains(c)||s.classList.contains(u))&&this.collapseAction(e),(s.classList.contains("e-arrow-right")||s.classList.contains(g))&&this.expandAction(e);for(var n=0,a=this.element.children,l=0;lthis.element.offsetWidth&&this.updateSplitterSize()},f.prototype.expandAction=function(e){var t=this;this.splitterDetails(e);var i=this.beforeAction(e);this.expandFlag?this.trigger("beforeExpand",i,function(i){i.cancel||t.expandPane(e);var s=t.afterAction(e);t.trigger("expanded",s)}):this.expandPane(e)},f.prototype.expandPane=function(e){this.removeStaticPanes();var i=this.element.querySelectorAll(".e-collapsed").length,s=!this.previousPane.classList.contains("e-collapsed")&&this.previousPane.classList.contains(d)&&!this.nextPane.classList.contains("e-collapsed")&&!this.nextPane.classList.contains("e-expanded")&&this.nextPane.nextElementSibling.classList.contains(a)&&!this.nextPane.nextElementSibling.classList.contains(d)&&!(i===this.allPanes.length-2),n=["e-collapsed","e-pane-hidden"];this.previousPane.classList.contains("e-collapsed")?(t.removeClass([this.previousPane],n),t.removeClass([this.nextPane],"e-expanded"),this.expandFlag&&this.updatePaneSettings(this.prevPaneIndex,!1)):(t.removeClass([this.nextPane],"e-expanded"),t.removeClass([this.previousPane],n),t.addClass([this.previousPane],"e-expanded"),t.addClass([this.nextPane],n),this.expandFlag&&this.updatePaneSettings(this.nextPaneIndex,!0)),this.updateIconsOnExpand(e),this.previousPane.setAttribute("aria-expanded","true"),this.nextPane.setAttribute("aria-expanded","false"),this.updateFlexGrow(this.checkStaticPanes()),s&&(this.previousPane.classList.remove("e-expanded"),this.previousPane.style.flexGrow="")},f.prototype.checkStaticPanes=function(){for(var e=!0,t=0;t0)t=this.removePercentageUnit(e.style.flexBasis);else if(""!==e.style.flexBasis)t=this.convertPixelToPercentage(this.convertPixelToNumber(e.style.flexBasis));else{var i="Horizontal"===this.orientation?e.offsetWidth:e.offsetHeight;t=this.convertPixelToPercentage(i)}return t},f.prototype.removePercentageUnit=function(e){return parseFloat(e.slice(0,e.indexOf("%")))},f.prototype.convertPercentageToPixel=function(e,i){var s,n=e.toString();if(n.indexOf("%")>-1){s=parseFloat(n.slice(0,n.indexOf("%")));var a=void 0;a=t.isNullOrUndefined(i)?"Horizontal"===this.orientation?this.element.offsetWidth:this.element.offsetHeight:this.panesDimensions[this.allPanes.indexOf(i)],s=Math.ceil(a*(s/100))}else s=parseInt(n,10);return s},f.prototype.convertPixelToPercentage=function(e){return e/("Horizontal"===this.orientation?this.element.offsetWidth:this.element.offsetHeight)*100},f.prototype.convertPixelToNumber=function(e){return e.indexOf("p")>-1?parseFloat(e.slice(0,e.indexOf("p"))):parseFloat(e)},f.prototype.calcDragPosition=function(e,t){var i;return i=("Horizontal"===this.orientation?this.currentCoordinates.x-e:this.currentCoordinates.y-e)/t,(i=i>1?1:i<0?0:i)*t},f.prototype.getSeparatorPosition=function(e){this.updateCursorPosition(e,"current");var t="Horizontal"===this.orientation?this.element.getBoundingClientRect().left:this.element.getBoundingClientRect().top+window.scrollY,i="Horizontal"===this.orientation?this.element.offsetWidth:this.element.offsetHeight;return this.calcDragPosition(t,i)},f.prototype.getMinMax=function(e,i,s){var n="min"===s?0:null,a=null;return"min"===s?t.isNullOrUndefined(this.paneSettings[e])||t.isNullOrUndefined(this.paneSettings[e].min)||(a=this.paneSettings[e].min):t.isNullOrUndefined(this.paneSettings[e])||t.isNullOrUndefined(this.paneSettings[e].max)||(a=this.paneSettings[e].max),this.paneSettings.length>0&&!t.isNullOrUndefined(this.paneSettings[e])&&!t.isNullOrUndefined(a)?(a.indexOf("%")>0&&(a=this.convertPercentageToPixel(a).toString()),this.convertPixelToNumber(a)):n},f.prototype.getPreviousPaneIndex=function(){var e=this.enableReversePanes?parseInt(this.currentSeparator.style.order,10)+1:parseInt(this.currentSeparator.style.order,10)-1;return this.getOrderIndex(e,"pane")},f.prototype.getNextPaneIndex=function(){var e=this.enableReversePanes?parseInt(this.currentSeparator.style.order,10)-1:parseInt(this.currentSeparator.style.order,10)+1;return this.getOrderIndex(e,"pane")},f.prototype.getPaneDetails=function(){var e=null,t=null;this.order=parseInt(this.currentSeparator.style.order,10),this.allPanes.length>1&&(e=this.getPrevPane(this.order),t=this.getNextPane(this.order)),e&&t&&(this.previousPane=e,this.nextPane=t,this.prevPaneIndex=this.getPreviousPaneIndex(),this.nextPaneIndex=this.getNextPaneIndex())},f.prototype.getPaneHeight=function(e){return"Horizontal"===this.orientation?e.offsetWidth.toString():e.offsetHeight.toString()},f.prototype.isValidSize=function(e){var i=!1;return!t.isNullOrUndefined(this.paneSettings[e])&&!t.isNullOrUndefined(this.paneSettings[e].size)&&this.paneSettings[e].size.indexOf("%")>-1&&(i=!0),i},f.prototype.getPaneDimensions=function(){this.previousPaneHeightWidth=""===this.previousPane.style.flexBasis?this.getPaneHeight(this.previousPane):this.previousPane.style.flexBasis,this.nextPaneHeightWidth=""===this.nextPane.style.flexBasis?this.getPaneHeight(this.nextPane):this.nextPane.style.flexBasis,this.isValidSize(this.prevPaneIndex)&&(this.previousPaneHeightWidth=this.convertPercentageToPixel(this.previousPaneHeightWidth).toString(),this.updatePrePaneInPercentage=!0),this.isValidSize(this.nextPaneIndex)&&(this.nextPaneHeightWidth=this.convertPercentageToPixel(this.nextPaneHeightWidth).toString(),this.updateNextPaneInPercentage=!0),this.prePaneDimenson=this.convertPixelToNumber(this.previousPaneHeightWidth.toString()),this.nextPaneDimension=this.convertPixelToNumber(this.nextPaneHeightWidth.toString())},f.prototype.checkCoordinates=function(e,t){var i=!0;return e!==this.previousCoordinates.x&&t!==this.previousCoordinates.y||(i=!1),i},f.prototype.isCursorMoved=function(e){return"mouse"===this.getEventType(e.type)||!t.isNullOrUndefined(e.pointerType)&&"mouse"===this.getEventType(e.pointerType)?this.checkCoordinates(e.pageX,e.pageY):"msie"!==t.Browser.info.name?this.checkCoordinates(e.touches[0].pageX,e.touches[0].pageY):this.checkCoordinates(e.pageX,e.pageY)},f.prototype.getBorder=function(){this.border=0;var e="Horizontal"===this.orientation?(this.element.offsetWidth-this.element.clientWidth)/2:(this.element.offsetHeight-this.element.clientHeight)/2;this.border="chrome"!==t.Browser.info.name?this.border:e},f.prototype.onMouseMove=function(e){if(this.isCursorMoved(e)){this.getPaneDetails(),this.getPaneDimensions(),this.triggerResizing(e);var t,i=this.validateDraggedPosition(this.getSeparatorPosition(e),this.prePaneDimenson,this.nextPaneDimension);if(this.getBorder(),t="Horizontal"===this.orientation?this.element.getBoundingClientRect().left+i-this.currentSeparator.getBoundingClientRect().left+this.border:this.element.getBoundingClientRect().top+i-this.currentSeparator.getBoundingClientRect().top+this.border,this.nextPaneHeightWidth="string"==typeof this.nextPaneHeightWidth&&this.nextPaneHeightWidth.indexOf("p")>-1?this.convertPixelToNumber(this.nextPaneHeightWidth):parseInt(this.nextPaneHeightWidth,10),this.prevPaneCurrentWidth=t+this.convertPixelToNumber(this.previousPaneHeightWidth),this.nextPaneCurrentWidth=this.nextPaneHeightWidth-t,this.validateMinMaxValues(),this.nextPaneCurrentWidth<0&&(this.nextPaneCurrentWidth=0),this.prevPaneCurrentWidth<0&&(this.prevPaneCurrentWidth=0),this.nextPaneCurrentWidth+this.prevPaneCurrentWidth>this.totalWidth&&(this.nextPaneCurrentWidth2||this.updateSplitterSize()}},f.prototype.validateMinRange=function(e,i,s){var n,a,l=null,r=0;return t.isNullOrUndefined(this.paneSettings[e])||t.isNullOrUndefined(this.paneSettings[e].min)||(l=this.paneSettings[e].min.toString()),t.isNullOrUndefined(l)||(l.indexOf("%")>0&&(l=this.convertPercentageToPixel(l).toString()),i<(n=this.convertPixelToNumber(l))&&(r=i-n<=0?0:i-n,this.totalWidth=this.totalWidth-r,this.totalPercent=this.convertPixelToPercentage(this.totalWidth),a=n)),t.isNullOrUndefined(a)?i:a},f.prototype.validateMaxRange=function(e,i,s){var n,a,l=null;return t.isNullOrUndefined(this.paneSettings[e])||t.isNullOrUndefined(this.paneSettings[e].max)||(l=this.paneSettings[e].max.toString()),t.isNullOrUndefined(l)||(l.indexOf("%")>0&&(l=this.convertPercentageToPixel(l).toString()),i>(n=this.convertPixelToNumber(l))&&(this.totalWidth=this.totalWidth-(i-n),this.totalPercent=this.convertPixelToPercentage(this.totalWidth),a=n)),t.isNullOrUndefined(a)?i:a},f.prototype.validateMinMaxValues=function(){this.prevPaneCurrentWidth=this.validateMinRange(this.prevPaneIndex,this.prevPaneCurrentWidth,this.previousPane),this.nextPaneCurrentWidth=this.validateMinRange(this.nextPaneIndex,this.nextPaneCurrentWidth,this.nextPane),this.prevPaneCurrentWidth=this.validateMaxRange(this.prevPaneIndex,this.prevPaneCurrentWidth,this.previousPane),this.nextPaneCurrentWidth=this.validateMaxRange(this.nextPaneIndex,this.nextPaneCurrentWidth,this.nextPane)},f.prototype.equatePaneWidths=function(){var e;this.prevPaneCurrentWidth+this.nextPaneCurrentWidth>this.totalPercent&&(e=this.prevPaneCurrentWidth+this.nextPaneCurrentWidth-this.totalPercent,this.prevPaneCurrentWidth=this.prevPaneCurrentWidth-e/2+"%",this.nextPaneCurrentWidth=this.nextPaneCurrentWidth-e/2+"%"),this.prevPaneCurrentWidth+this.nextPaneCurrentWidthl-o?p=l-o:ea+h&&(p=a+h),p},f.prototype.onMouseUp=function(e){t.removeClass([this.currentSeparator],"e-split-bar-active"),this.unwireResizeEvents();for(var i=t.isBlazor()?{event:e,element:this.element,index:[this.prevPaneIndex,this.nextPaneIndex],separator:this.currentSeparator,paneSize:[this.prePaneDimenson,this.nextPaneDimension]}:{event:e,element:this.element,pane:[this.previousPane,this.nextPane],index:[this.prevPaneIndex,this.nextPaneIndex],separator:this.currentSeparator,paneSize:[this.prePaneDimenson,this.nextPaneDimension]},s=0;s0&&[].slice.call(l).forEach(function(t){e.appendChild(t)})},f.prototype.paneCollapsible=function(e,i){this.paneSettings[i].collapsible?t.addClass([e],"e-collapsible"):t.removeClass([e],"e-collapsible")},f.prototype.createSplitPane=function(e){var i=e.children.length;if(!this.checkBlazor())for(o=0;o0)for(var o=0;o0;)this.element.removeAttribute(this.element.attributes[0].name);if(this.checkBlazor())for(var i=this.element.children,s=i.length-1;s>=0;s--)t.detach(i[s]);else{this.element.innerHTML=this.wrapper.innerHTML;for(s=0;s0)for(var e=0;ethis.allPanes.length+1?this.allPanes.length:i;var n={size:t.isNullOrUndefined(e.size)?"":e.size,min:t.isNullOrUndefined(e.min)?null:e.min,max:t.isNullOrUndefined(e.max)?null:e.max,content:t.isNullOrUndefined(e.content)?"":e.content,resizable:!!t.isNullOrUndefined(e.resizable)||e.resizable,collapsible:!t.isNullOrUndefined(e.collapsible)&&e.collapsible,collapsed:!t.isNullOrUndefined(e.collapsed)&&e.collapsed,cssClass:t.isNullOrUndefined(e.cssClass)?"":e.cssClass};this.paneSettings.splice(i,0,n),this.setProperties({paneSettings:this.paneSettings},!0),"Horizontal"===this.orientation?(this.element.insertBefore(s,this.element.querySelectorAll("."+l)[i]),this.removePaneOrders(l)):(this.element.insertBefore(s,this.element.querySelectorAll("."+r)[i]),this.removePaneOrders(r)),this.allPanes.splice(i,0,s),this.updatePanes(),this.setTemplate(this.paneSettings[i].content,s),this.setCssClass(this.allPanes[i],e.cssClass),this.allPanes[this.allPanes.length-1].classList.remove(d)},f.prototype.removePane=function(e){e=e>this.allPanes.length+1?this.allPanes.length:e;var i="Horizontal"===this.orientation?l:r;t.isNullOrUndefined(this.element.querySelectorAll("."+i)[e])||(t.detach(this.element.querySelectorAll("."+i)[e]),this.allPanes.splice(e,1),this.removePaneOrders(i),this.updatePanes(),this.paneSettings.splice(e,1),this.setProperties({paneSettings:this.paneSettings},!0),this.allPanes.length>0&&this.allPanes[this.allPanes.length-1].classList.remove(d))},s([t.Property("100%")],f.prototype,"height",void 0),s([t.Property(!1)],f.prototype,"enableReversePanes",void 0),s([t.Property("100%")],f.prototype,"width",void 0),s([t.Property(!1)],f.prototype,"enablePersistence",void 0),s([t.Collection([],v)],f.prototype,"paneSettings",void 0),s([t.Property("Horizontal")],f.prototype,"orientation",void 0),s([t.Property("")],f.prototype,"cssClass",void 0),s([t.Property(!0)],f.prototype,"enabled",void 0),s([t.Property(!0)],f.prototype,"enableHtmlSanitizer",void 0),s([t.Property(null)],f.prototype,"separatorSize",void 0),s([t.Event()],f.prototype,"beforeSanitizeHtml",void 0),s([t.Event()],f.prototype,"created",void 0),s([t.Event()],f.prototype,"resizeStart",void 0),s([t.Event()],f.prototype,"resizing",void 0),s([t.Event()],f.prototype,"resizeStop",void 0),s([t.Event()],f.prototype,"beforeCollapse",void 0),s([t.Event()],f.prototype,"beforeExpand",void 0),s([t.Event()],f.prototype,"collapsed",void 0),s([t.Event()],f.prototype,"expanded",void 0),f=s([t.NotifyPropertyChanges],f)}(t.Component),P=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)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),y=function(e,t,i,s){var n,a=arguments.length,l=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(l=(a<3?n(l):a>3?n(t,i,l):n(t,i))||l);return a>3&&l&&Object.defineProperty(t,i,l),l},C="e-drag",x=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return P(i,e),y([t.Property("")],i.prototype,"id",void 0),y([t.Property("")],i.prototype,"cssClass",void 0),y([t.Property("")],i.prototype,"header",void 0),y([t.Property("")],i.prototype,"content",void 0),y([t.Property(!0)],i.prototype,"enabled",void 0),y([t.Property(0)],i.prototype,"row",void 0),y([t.Property(0)],i.prototype,"col",void 0),y([t.Property(1)],i.prototype,"sizeX",void 0),y([t.Property(1)],i.prototype,"sizeY",void 0),y([t.Property(1)],i.prototype,"minSizeY",void 0),y([t.Property(1)],i.prototype,"minSizeX",void 0),y([t.Property(null)],i.prototype,"maxSizeY",void 0),y([t.Property(null)],i.prototype,"maxSizeX",void 0),y([t.Property(1e3)],i.prototype,"zIndex",void 0),i}(t.ChildProperty),S=function(e){function i(i,s){var n=e.call(this,i,s)||this;return n.rows=1,n.panelID=0,n.movePanelCalled=!1,n.resizeCalled=!1,n.mOffX=0,n.mOffY=0,n.maxTop=9999,n.maxRows=100,n.mouseX=0,n.mouseY=0,n.minTop=0,n.minLeft=0,n.isBlazor=!1,n.isInlineRendering=!1,n.removeAllCalled=!1,n.isPanelRemoved=!1,n.panelsSizeY=0,n.resizeHeight=!1,t.setValue("mergePersistData",n.mergePersistPanelData,n),n}return P(i,e),i.prototype.preRender=function(){this.isBlazor=t.isBlazor()&&this.isServerRendered,this.panelCollection=[],this.sortedArray=[],this.gridPanelCollection=[],this.overlapElement=[],this.overlapElementClone=[],this.overlapSubElementClone=[],this.collisionChecker={},this.dragCollection=[],this.elementRef={top:"",left:"",height:"",width:""},this.dimensions=[],this.allItems=[],this.oldRowCol={},this.availableClasses=[],this.setOldRowCol(),this.calculateCellSize(),this.contentTemplateChild=[].slice.call(this.element.children)},i.prototype.setOldRowCol=function(){for(var e=0;e0&&t.addClass([s],e),i&&s.setAttribute("id",i),s},i.prototype.render=function(){this.initialize(),this.isRenderComplete=!0,this.showGridLines&&!this.checkMediaQuery()&&this.initGridLines(),this.updateDragArea(),this.renderComplete(),this.updateServerPanelData(),this.renderReactTemplates()},i.prototype.updateServerPanelData=function(){t.isBlazor()&&this.isServerRendered&&(this.setProperties({panels:this.panels},!0),this.allowServerDataBinding=!0,this.serverDataBind())},i.prototype.initGridLines=function(){this.table=document.createElement("table");var e=document.createElement("tbody");this.table.classList.add("e-dashboard-gridline-table");for(var t=0;t0&&this.element.querySelectorAll(".e-panel").length>0&&!(this.isBlazor&&this.panels.length>0)){var e=[];this.setProperties({panels:[]},!0),this.isInlineRendering=!0;for(i=0;i1&&t.isNullOrUndefined(e))return i=this.rows;for(var s=0;si&&(i=this.panels[s].sizeY+this.panels[s].row);return 0===this.panels.length&&(i=this.columns),i},i.prototype.maxCol=function(){var e=1;return e=this.columns,this.maxColumnValue=e,e},i.prototype.updateOldRowColumn=function(){for(var e=0;e0&&t.addClass([n],e),i&&n.setAttribute("id",i),n},i.prototype.templateParser=function(e){if(e)try{if(document.querySelectorAll(e).length)return t.compile(document.querySelector(e).innerHTML.trim())}catch(s){var i=t.SanitizeHtmlHelper.sanitize(e);return t.compile(this.enableHtmlSanitizer&&"string"==typeof e?i:e)}},i.prototype.renderTemplate=function(e,i,s,n,a){var l=this.templateParser(e),r=[];if("."!==e[0]&&"#"!==e[0]||"SCRIPT"===document.querySelector(e).tagName){var o=l({},this,a,s,n,null,i);if(o){for(var h=0,d=o;h=0&&(this.elementHeight-lthis.getMaxHeight(t)?(s=this.elementHeight-this.getMaxHeight(t),this.mOffY=l-s):this.elementY+l=0&&(this.elementHeight+lthis.getMaxHeight(t)&&(s=this.getMaxHeight(t)-this.elementHeight,this.mOffY=l-s),this.elementHeight+=s),this.handleClass.indexOf("west")>=0&&(this.elementWidth-rthis.getMaxWidth(t)?(i=this.elementWidth-this.getMaxWidth(t),this.mOffX=r-i):this.elementX+r=0&&(this.elementWidth+rthis.getMaxWidth(t)?(i=this.getMaxWidth(t)-this.elementWidth,this.mOffX=r-i):this.elementX+this.elementWidth+r>this.maxLeft&&(i=this.maxLeft-this.elementX-this.elementWidth,this.mOffX=r-i),this.elementWidth+=i),e.style.top=this.elementY+"px",e.style.left=this.elementX+"px",e.style.width=this.elementWidth+"px",e.style.height=this.elementHeight+"px";var o=this.getResizeRowColumn(t);if(o.col+o.sizeX>this.columns&&this.panelPropertyChange(o,{sizeX:o.sizeX-1}),this.shadowEle.style.top=o.row*this.getCellSize()[1]+o.row*this.cellSpacing[1]+"px",this.shadowEle.style.left=o.col*this.getCellSize()[0]+o.col*this.cellSpacing[0]+"px",this.shadowEle.style.height=o.sizeY*(this.getCellSize()[1]+this.cellSpacing[1])+"px",this.shadowEle.style.width=o.sizeX*(this.getCellSize()[0]+this.cellSpacing[0])+"px",n!==o.sizeX||a!==o.sizeY){n=o.sizeX,a=o.sizeY;var h=this.getCellInstance(e.id),d={attributes:{row:h.row.toString(),col:h.col.toString(),sizeX:h.sizeX.toString(),sizeY:h.sizeY.toString()}};this.setAttributes(d,e),this.mainElement=e,this.updatePanelLayout(e,this.getCellInstance(e.id)),this.updateOldRowColumn(),this.sortedPanel()}},i.prototype.upResizeHandler=function(e){if(!t.isNullOrUndefined(this.downTarget)){this.updateServerPanelData(),this.upTarget=this.downTarget;var i=t.closest(this.upTarget,".e-panel"),s={event:e,element:i,isInteracted:!0};if(i){t.addClass([i],"e-panel-transition");var n="msie"===t.Browser.info.name?"mousemove pointermove":"mousemove",a="msie"===t.Browser.info.name?"mouseup pointerup":"mouseup";t.EventHandler.remove(document,n,this.moveResizeHandler),t.EventHandler.remove(document,a,this.upResizeHandler),"msie"!==t.Browser.info.name&&(t.EventHandler.remove(document,"touchmove",this.touchMoveResizeHandler),t.EventHandler.remove(document,"touchend",this.upResizeHandler)),this.isMouseUpBound=!1,this.isMouseMoveBound=!1,this.shadowEle&&t.detach(this.shadowEle),this.shadowEle=null;var l=this.getCellInstance(i.getAttribute("id"));this.setPanelPosition(i,l.row,l.col),this.setHeightAndWidth(i,l)}t.removeClass([i],["e-dragging"]),this.trigger("resizeStop",s),this.resizeCalled=!1,this.lastMouseX=this.lastMouseY=void 0,this.mOffX=this.mOffY=0,this.mainElement=null,this.allowFloating&&this.moveItemsUpwards(),this.updatePanels(),this.updateCloneArrayObject(),this.checkForChanges(!0)}},i.prototype.getResizeRowColumn=function(e){var t=!1,i=e.col;-1!==["e-west","e-south-west"].indexOf(this.handleClass)&&(i=this.pixelsToColumns(this.elementX,!1));var s=e.row;-1!==["e-north"].indexOf(this.handleClass)&&(s=this.pixelsToRows(this.elementY,!1),this.previousRow!==s&&(this.previousRow=s,t=!0));var n=e.sizeX;-1===["e-north","e-south"].indexOf(this.handleClass)&&(n=this.pixelsToColumns(this.elementWidth-n*this.cellSpacing[1],!0));var a=e.sizeY;return-1===["e-east","e-west"].indexOf(this.handleClass)&&("e-north"!==this.handleClass||t)&&(a=this.pixelsToRows(this.elementHeight-a*this.cellSpacing[0],!0)),e.col+e.sizeX>this.columns&&(e.sizeX=e.sizeX-1),(s>-1&&i>-1&&n+i<=this.maxCol()&&a+s<=this.maxRow()&&0===this.collisions(s,i,n,a,this.getPanelBase(e.id)).length||!1!==this.allowPushing)&&this.panelPropertyChange(e,{row:s,col:i,sizeX:n,sizeY:a}),e},i.prototype.pixelsToColumns=function(e,t){var i=this.cellSize[0];return t?Math.ceil(e/i):Math.floor(e/i)},i.prototype.pixelsToRows=function(e,t){return t?Math.round(e/this.cellSize[1]):Math.round(e/(this.cellSize[1]+this.cellSpacing[0]))},i.prototype.getMinWidth=function(e){return e.minSizeX*this.getCellSize()[0]},i.prototype.getMaxWidth=function(e){return e.maxSizeX*this.getCellSize()[0]},i.prototype.getMinHeight=function(e){return e.minSizeY*this.getCellSize()[1]},i.prototype.getMaxHeight=function(e){return e.maxSizeY*this.getCellSize()[1]},i.prototype.sortedPanel=function(){this.sortedArray=[];for(var e=0,t=this.panelCollection.length;e-1&&0===this.collisions(l,t,s,i,e).length;)n=l,a=t,--l;null!==n&&this.sortItem(e,n,a)}},i.prototype.sortItem=function(e,t,i){this.overlapElement=[];var s=parseInt(e.getAttribute("data-col"),10),n=parseInt(e.getAttribute("data-row"),10);if(this.sortedArray[n]||(this.sortedArray[n]=[]),this.sortedArray[n][s]=e,void 0!==e&&void 0!==t&&void 0!==i){if(void 0!==this.oldRowCol[e.id]&&null!==this.oldRowCol[e.id].row&&void 0!==this.oldRowCol[e.id].col){var a=this.sortedArray[this.oldRowCol[e.id].row];this.oldRowCol[e.id]&&a[this.oldRowCol[e.id].col]===e&&(delete a[this.oldRowCol[e.id].col],this.updateOldRowColumn(),this.sortedPanel())}this.oldRowCol[e.id].row=t,this.oldRowCol[e.id].row=i,this.sortedArray[n]||(this.sortedArray[n]=[]),this.sortedArray[n][s]=e,-1===this.allItems.indexOf(e)&&this.allItems.push(e),this.panelPropertyChange(this.getCellInstance(e.id),{row:t,col:i});var l=this.getCellInstance(e.id);this.setAttributes({value:{col:l.col.toString(),row:l.row.toString()}},e),this.updateLayout(e,this.getCellInstance(e.id))}},i.prototype.updateLayout=function(e,t){this.setPanelPosition(e,t.row,t.col),this.setHeightAndWidth(e,t),this.updateRowHeight(),this.sortedPanel()},i.prototype.refresh=function(){if(this.panelsSizeY=0,this.updateDragArea(),this.checkMediaQuery())this.checkMediaQuerySizing();else{if(this.element.classList.contains("e-responsive")){t.removeClass([this.element],["e-responsive"]);for(var e=0;e1&&(n=(this.element.parentElement&&this.element.parentElement.offsetWidth/this.cellAspectRatio)*e[i].sizeY+parseInt((Math.round(e[i].sizeY/2)*this.cellSpacing[1]).toString(),0),s.style.height=n+"px"),this.resizeHeight=!0,this.addPanelCalled&&this.isBlazor){var a=this.getActualProperties(e[i]);a.row=i,a.col=0,this.panelPropertyChange(e[i],a),this.setPanelPosition(s,i,0)}else this.panelPropertyChange(e[i],{row:i,col:0}),this.setPanelPosition(s,e[i].row,e[i].col),this.panelsSizeY=this.panelsSizeY+e[i].sizeY;this.setClasses(this.panelCollection),this.checkDragging(this.dragCollection),this.removeResizeClasses(this.panelCollection)}}this.updateRowHeight()},i.prototype.panelResponsiveUpdate=function(){this.element.classList.add("e-responsive"),this.calculateCellSize();for(i=0;i0&&!t.isNullOrUndefined(s)?(n=this.contentTemplateChild[s],e.cssClass&&t.addClass([n],[e.cssClass]),e.id&&n.setAttribute("id",e.id)):n=this.createPanelElement(e.cssClass?e.cssClass.split(" "):null,e.id),n.style.zIndex=""+e.zIndex,this.element.appendChild(n),this.renderReactTemplates());var a=this.renderPanels(n,e,e.id,i);if(this.panelCollection.push(a),this.isBlazor){var l=n.querySelector(".e-panel-content");if(l){var r="calc( 100% - "+(n.querySelector(".e-panel-header")?window.getComputedStyle(n.querySelector(".e-panel-header")).height:"0px")+")";t.setStyleAttribute(l,{height:r})}}else this.setXYAttributes(n,e);return this.setHeightAndWidth(n,e),n},i.prototype.setPanelPosition=function(e,i,s){if(e){this.checkMediaQuery()&&this.calculateCellSize();var n=this.getCellSize()[1],a=this.getCellSize()[0],l=0===s?0:s*(a+this.cellSpacing[0]),r=0===i?0:i*(n+this.cellSpacing[1]);this.checkMediaQuery()&&(r=0===i?0:this.panelsSizeY*(n+this.cellSpacing[1])),t.setStyleAttribute(e,{left:l+"px",top:r+"px"})}},i.prototype.getRowColumn=function(){if(this.rows=null,this.element.querySelectorAll(".e-panel").length>0&&!this.updatedRows)for(var e=this.element.querySelectorAll(".e-panel"),t=0;te.maxSizeX?this.panelPropertyChange(e,{sizeX:e.maxSizeX}):e.sizeX>this.columns?this.panelPropertyChange(e,{sizeX:this.columns}):this.panelPropertyChange(e,{sizeX:e.sizeX}),!e.sizeY||e.sizeYe.maxSizeY?this.panelPropertyChange(e,{sizeY:e.maxSizeY}):this.panelPropertyChange(e,{sizeY:e.sizeY})},i.prototype.checkMinMaxValues=function(e){e.col+e.sizeX>this.columns&&this.panelPropertyChange(e,{sizeX:e.sizeX+(this.columns-(e.col+e.sizeX))})},i.prototype.panelPropertyChange=function(e,t){this.allowServerDataBinding=!1,e.setProperties(t,!0)},i.prototype.renderDashBoardCells=function(e){if(this.element.querySelectorAll(".e-panel").length>0||this.panels.length>0)for(var i=0;i0||this.setMinMaxValues(e[i]),(this.maxColumnValue=t)if(a>1)for(var l=i;l0)for(var l=t+1;l<=this.columns-1;l++)-1===n.indexOf(l)&&l!==t&&-1===a.indexOf(l)&&a.push(l);var r=this.getOccupiedColumns(i);return r.forEach(function(e){e>t&&-1!==a.indexOf(e)&&a.splice(a.indexOf(e),1)}),this.getOccupiedColumns(this.checkingElement).forEach(function(e){e>parseInt(i.getAttribute("data-col"),10)&&-1===r.indexOf(e)&&-1===a.indexOf(e)&&a.push(e)}),a=a.sort(function(e,t){return e-t})},i.prototype.getOccupiedColumns=function(e){for(var t=[],i=parseInt(e.getAttribute("data-sizeX"),10),s=parseInt(e.getAttribute("data-col"),10),n=s;n1)for(var l=i;l0)for(var l=0;l<=t;l++)-1===a.indexOf(l)&&l!==t&&-1===n.indexOf(l)&&n.push(l);var r=this.getOccupiedColumns(i);return r.forEach(function(e){e0?(this.leftAdjustable=this.isLeftAdjustable(p,a,e,i,n,s),this.spacedColumnValue!==d-this.getCellInstance(this.checkingElement.id).sizeX&&(this.leftAdjustable=!1),this.leftAdjustable?this.rightAdjustable=!1:(this.leftAdjustable=!1,l=this.rightWardsSpaceChecking(o,i,a),this.rightAdjustable=l.length>0&&this.isRightAdjustable(l,a,e,i,n,s),this.spacedColumnValue!==h+d&&(this.rightAdjustable=!1),this.rightAdjustable||(this.rightAdjustable=!1))):(l=this.rightWardsSpaceChecking(o,i,a),this.rightAdjustable=l.length>0&&this.isRightAdjustable(l,a,e,i,n,s),this.spacedColumnValue!==h+d&&(this.rightAdjustable=!1),this.rightAdjustable&&(this.leftAdjustable=!1)),!this.rightAdjustable&&!this.leftAdjustable&&e>0){var c=this.getCellInstance(a.id).row,u=!1;this.startRow!==c&&(u=!0);for(var g=e;g>=0;g--){var m=this.getCellInstance(a.id).sizeY>1&&u?this.checkingElement:a;g!==c&&g===c-s&&0===this.collisions(g,i,n,s,m).length&&(u=!1,this.topAdjustable=!0,this.spacedRowValue=t.isNullOrUndefined(this.spacedRowValue)?g:this.spacedRowValue,this.spacedColumnValue=i)}}return(this.rightAdjustable||this.leftAdjustable||this.topAdjustable)&&(r=!0,t.isNullOrUndefined(this.spacedRowValue)&&(this.spacedRowValue=e)),r},i.prototype.isXSpacingAvailable=function(e,t){for(var i=!1,s=[],n=0;nt&&s.splice(-1)),s.length===t)return i=!0,this.spacedColumnValue=s.sort(function(e,t){return e-t})[0],this.spacedColumnValue<0&&(this.spacedColumnValue=1),i}else s=[];return i},i.prototype.getRowElements=function(e){for(var t=[],i=0;i0)this.spacedColumnValue=e[0],l=!0;else if(n>1&&1===a)l=this.isXSpacingAvailable(e,n);else if(a>1)if(1===n){var r=void 0;if(e.length>=1&&(r=!0),r)for(var o=0;o0)this.spacedColumnValue=e[0],l=!0;else if(n>1&&1===a)l=this.isXSpacingAvailable(e,n);else if(a>1)if(1===n){var r=void 0;if(e.length>=1&&(r=!0),r)for(var o=0;o=0;n--)!function(n){t=[],e.forEach(function(e){e&&e.getAttribute("data-row")===n.toString()&&t.push(e)});for(var a=s.columns-1;a>=0;a--)!function(e){t.forEach(function(t){t&&t.getAttribute("data-col")===e.toString()&&i.push(t)})}(a)}(n);return i},i.prototype.updatedModels=function(e,t,i){var s=this,n=[];return this.mainElement||this.sortedPanel(),e.forEach(function(a){s.checkingElement=a;var l=s.getCellInstance(a.id),r=!s.adjustmentAvailable(l.row,l.col,l.sizeY,l.sizeX,i);if(l.sizeX>1&&r)for(var o=l.row;o=0&&-1===n.indexOf(t)&&n.push(t)})}),n.forEach(function(t){n.indexOf(t)>=0&&e.splice(e.indexOf(t),1)}),e},i.prototype.resetLayout=function(e){var t=this.collisions(e.row,e.col,e.sizeX,e.sizeY,this.mainElement);if(!this.mainElement||this.addPanelCalled||this.resizeCalled||this.movePanelCalled)return t;if(this.mainElement&&this.oldRowCol!==this.cloneObject)for(var i=0;i0&&-1===t.indexOf(this.checkCollision[0])&&this.cloneObject[this.checkCollision[0].id].row===e.row&&t.push(this.checkCollision[0]),t},i.prototype.swapAvailability=function(e,t){for(var i=!0,s=this.getCellInstance(t.id),n=0;n0)return i=!1,!1}return i},i.prototype.checkForSwapping=function(e,t){if(!this.mainElement||0===e.length)return!1;var i,s=parseInt(e[0].getAttribute("data-row"),10);if(this.startRows&&(i=0),!this.swapAvailability(e,t))return!1;for(var n=!1,a=0;a=1&&this.cloneObject[this.mainElement.id].row===this.oldRowCol[this.mainElement.id].row)return!1;for(var l=0===i?this.getCellInstance(this.mainElement.id).row+this.getCellInstance(this.mainElement.id).sizeY:this.startRow,r=0;r1&&-1===d.indexOf(e[r]))if(1===i&&h.row===this.cloneObject[o.id].row+o.sizeY-1)d.push(e[r]);else{if(0!==i||h.row!==this.cloneObject[o.id].row)return!1;d.push(e[r])}if(o.sizeY<=h.sizeY&&-1===d.indexOf(e[r])&&d.push(e[r]),d.push(this.mainElement),this.collisions(l,o.col,o.sizeX,o.sizeY,d).length>0)return n=!1;r===e.length-1&&(n=!0)}return n},i.prototype.swapItems=function(e,t,i){var s,n=this,a=[];a.push(t);var l=parseInt(e[0].getAttribute("data-row"),10);this.startRowl&&(s=0);var r=0===s?l+i.sizeY:this.startRow;if(!this.movePanelCalled){var o=this.getCellInstance(e[0].id);this.panelPropertyChange(i,{row:0===s?l:r+o.sizeY})}for(var h=0;h0)if(s=this.sortCollisionItems(s),s=this.updatedModels(s,i,e),!t.isNullOrUndefined(this.startRow)&&this.checkForSwapping(s,e))this.swapItems(s,e,i);else for(var a=0;a0){var o=this;n.forEach(function(e){-1===o.overlapElement.indexOf(e)&&o.overlapElement.push(e)}),this.overlapElement&&-1!==this.overlapElement.indexOf(e)&&this.overlapElement.splice(this.overlapElement.indexOf(e),1),n.length>0&&(this.updateRowColumn(i.row,this.overlapElement,e),this.checkForCompletePushing())}this.isSubValue||this.sortedPanel(),this.updateRowHeight(),this.updateGridLines()},i.prototype.checkForCompletePushing=function(){for(var e=0;e1||d>1){var u=this.getCellInstance(this.overlapElementClone[a].id);p=u.col;for(var g=document.getElementById(u.id),m=u.row;m0){var a=this;this.overlapElement=[],this.shouldRestrict=!0,e.forEach(function(e){a.overlapElement.push(e)});for(var l=parseInt(s.getAttribute("data-row"),10),r=0;r0)for(var o=this,h=0;h0&&o.updateRowColumn(t,o.overlapElement,o.overlapSubElementClone[e])}(h);this.overlapSubElementClone=[]}},i.prototype.removeResizeClasses=function(e){for(var i=0;i1?e.sizeX*a+(e.sizeX-1)*this.cellSpacing[0]:a,s=e&&"number"==typeof n&&e.sizeY>1&&"number"==typeof e.sizeY?e.sizeY*n+(e.sizeY-1)*this.cellSpacing[1]:t.formatUnit(n),[s,i]},i.prototype.getRowColumnDragValues=function(e){var t=parseFloat(e.element.style.top),i=parseFloat(e.element.style.left);return[Math.round(t/(this.getCellSize()[1]+this.cellSpacing[1])),Math.round(i/(this.getCellSize()[0]+ +this.cellSpacing[0]))]},i.prototype.checkForChanges=function(e,i,s){var n=[];if(this.removeAllCalled)n=[];else for(var a=0;a0||this.removeAllCalled){var l={changedPanels:n,isInteracted:e,addedPanels:t.isNullOrUndefined(i)?[]:i,removedPanels:t.isNullOrUndefined(s)?[]:s};this.trigger("change",l)}},i.prototype.enableDraggingContent=function(e){for(var i=this,s=0;s0?(i.setHolderPosition(e),i.setPanelPosition(i.mainElement,s.row,s.col),i.updatePanelLayout(i.mainElement,s)):i.setPanelPosition(i.mainElement,s.row,s.col),i.mainElement=null;var n=i.getPanelBase(e);i.shadowEle&&t.detach(i.shadowEle),t.removeClass([i.element],["e-prevent"]),t.removeClass([e.element],["e-dragging"]),i.shadowEle=null,e.element.classList.remove("e-dragging");var a=i.getRowColumnDragValues(e)[0],l=i.getRowColumnDragValues(e)[1],r=i.getCellInstance(e.element.id);i.allowPushing&&0===i.collisions(a,l,r.sizeX,r.sizeY,document.getElementById(n.id)).length?(i.panelPropertyChange(i.getCellInstance(e.element.id),{row:a,col:l}),i.oldRowCol[e.element.id].row=a,i.oldRowCol[e.element.id].col=l,i.setAttributes({value:{col:l.toString(),row:a.toString()}},e.element),i.sortedPanel()):(i.panelPropertyChange(i.getCellInstance(e.element.id),{row:i.oldRowCol[e.element.id].row,col:i.oldRowCol[e.element.id].col}),e.element.setAttribute("data-col",i.getCellInstance(e.element.id).col.toString()),e.element.setAttribute("data-row",i.getCellInstance(e.element.id).row.toString()),i.sortedPanel());var o=i.getCellInstance(e.element.id);i.setPanelPosition(e.element,o.row,o.col),i.updatePanels(),i.updateServerPanelData(),i.updateCloneArrayObject(),i.checkForChanges(!0),i.dragStopEventArgs={event:e.event,element:e.element},i.trigger("dragStop",e),i.resizeEvents(),i.rows=i.maxRow(!0),i.setHeightWidth(),i.updateDragArea()},drag:function(e){i.draggedEventArgs={event:e.event,element:e.element,target:t.closest(e.target,".e-panel")},i.trigger("drag",i.draggedEventArgs),i.onDragStart(e)}}),-1===this.dragCollection.indexOf(this.dragobj)&&this.dragCollection.push(this.dragobj)}},i.prototype.updatePanels=function(){this.moveItemsUpwards(),this.updateOldRowColumn(),this.sortedPanel()},i.prototype.updateDragArea=function(){this.dragCollection.forEach(function(e){e.setDragArea()})},i.prototype.updateRowsHeight=function(e,t,i){e+t>=this.rows&&(this.rows=this.rows+i,this.setHeightWidth())},i.prototype.onDraggingStart=function(e){var i=e;this.trigger("dragStart",i,function(i){t.isBlazor()&&i.bindEvents(e.element)}),this.panelsInitialModel=this.cloneModels(this.panels),this.mainElement=e.element,this.cloneObject=JSON.parse(JSON.stringify(this.cloneObject));var s=this.startRow=parseInt(e.element.getAttribute("data-row"),10);this.startCol=parseInt(e.element.getAttribute("data-col"),10);var n=parseInt(e.element.getAttribute("data-sizeY"),10);this.updateRowsHeight(s,n,n),this.updateDragArea(),this.shadowEle=document.createElement("div"),this.shadowEle.classList.add("e-holder"),this.shadowEle.classList.add("e-holder-transition"),t.setStyleAttribute(this.shadowEle,{position:"absolute"}),t.addClass([this.element],["e-prevent"]),t.addClass([e.element],["e-dragging"]),this.element.appendChild(this.shadowEle),this.renderReactTemplates(),this.shadowEle=document.querySelector(".e-holder"),this.shadowEle.style.height=this.getCellInstance(e.element.id).sizeY*this.cellSize[1]+"px",this.shadowEle.style.width=this.getCellInstance(e.element.id).sizeX*this.cellSize[0]+"px";var a=this.getCellInstance(e.element.id);this.setPanelPosition(this.shadowEle,a.row,a.col)},i.prototype.cloneModels=function(e,t){void 0===t&&(t=[]);for(var i=0;i=this.checkColumnValue&&(this.checkCollision=[]),this.updatePanelLayout(e.element,l),this.moveItemsUpwards()}!1!==this.allowPushing&&this.panelPropertyChange(this.getCellInstance(e.element.id),{row:a,col:n}),this.oldRowCol[e.element.id].row===a&&this.oldRowCol[e.element.id].col===n||(this.panelPropertyChange(this.getCellInstance(e.element.id),{row:a,col:n}),this.setAttributes({value:{col:n.toString(),row:a.toString()}},e.element)),this.startCol!==s&&(this.startCol=t,this.moveItemsUpwards()),this.allowPushing||this.setHolderPosition(e),this.removeResizeClasses(this.panelCollection),this.setClasses(this.panelCollection),this.allowPushing}},i.prototype.getPanelBase=function(e){for(var t,i=0;i-1;){for(var n=1,a=t;a>-1;){var l=this.sortedArray[e];if(l){var r=l[a];if(r&&(!i||-1===i.indexOf(r))&&parseInt(r.getAttribute("data-sizeX"),10)>=n&&parseInt(r.getAttribute("data-sizeY"),10)>=s)return r}++n,--a}--e,++s}return null},i.prototype.setHolderPosition=function(e){var t=parseInt(e.element.getAttribute("data-sizeY"),10),i=parseInt(e.element.getAttribute("data-col"),10),s=parseInt(e.element.getAttribute("data-row"),10),n=parseInt(e.element.getAttribute("data-sizeX"),10),a=this.getCellSize()[0],l=this.getCellSize()[1],r=0===s?0:s*(l+this.cellSpacing[1]),o=0===i?0:i*(a+this.cellSpacing[0]),h=this.getCellSize()[1],d=this.getCellSize()[0];this.elementRef.top=this.shadowEle.style.top=r+"px",this.elementRef.left=this.shadowEle.style.left=o+"px",this.elementRef.height=this.shadowEle.style.height=t*h+(t-1)*this.cellSpacing[1]+"px",this.elementRef.width=this.shadowEle.style.width=n*d+(n-1)*this.cellSpacing[0]+"px"},i.prototype.getCellInstance=function(e){for(var t,i=0;ithis.columns?this.columns-1:e.col,t.isNullOrUndefined(e.col)&&(e.col=i.col),this.panelPropertyChange(i,e),this.setMinMaxValues(i);var s=document.getElementById(e.id);this.mainElement=s;var n=i.cssClass?i.cssClass.split(" "):null;if(this.panelContent=s.querySelector(".e-panel-container")?s.querySelector(".e-panel-container"):this.createSubElement(n,s.id+"_content","e-panel-container"),s.appendChild(this.panelContent),i.header){var a=s.querySelector(".e-panel-header")?s.querySelector(".e-panel-header"):this.createSubElement([],s.id+"template","");t.addClass([a],["e-panel-header"]),a.innerHTML="";o=this.element.id+"HeaderTemplate"+i.id;this.renderTemplate(i.header,a,o,!0,"header"),this.panelContent.appendChild(a),this.renderReactTemplates()}else s.querySelector(".e-panel-header")&&t.detach(s.querySelector(".e-panel-header"));if(i.content){var l=i.cssClass?i.cssClass.split(" "):null;this.panelBody=s.querySelector(".e-panel-content")?s.querySelector(".e-panel-content"):this.createSubElement(l,s.id+"_body","e-panel-content"),this.panelBody.innerHTML="";var r="calc( 100% - "+(this.panelContent.querySelector(".e-panel-header")?window.getComputedStyle(this.panelContent.querySelector(".e-panel-header")).height:"0px")+")";t.setStyleAttribute(this.panelBody,{height:r});var o=this.element.id+"ContentTemplate"+i.id;this.renderTemplate(i.content,this.panelBody,o,!0,"content"),this.panelContent.appendChild(this.panelBody),this.renderReactTemplates()}else s.querySelector(".e-panel-content")&&t.detach(s.querySelector(".e-panel-content"));this.setXYAttributes(s,i),this.setHeightAndWidth(s,i),this.setPanelPosition(s,i.row,i.col),this.updatePanelLayout(s,i),this.checkMediaQuery()&&this.checkMediaQuerySizing(),this.mainElement=null,this.updatePanels(),this.updateCloneArrayObject()}}},i.prototype.updateCloneArrayObject=function(){this.cloneArray=this.sortedArray,this.cloneObject=JSON.parse(JSON.stringify(this.oldRowCol))},i.prototype.serialize=function(){for(var e=this.cloneModels(this.panels),t=[],i=0;ithis.columns&&(i=this.columns-s.sizeX),this.panelPropertyChange(s,{row:t,col:i});var n=document.getElementById(e);this.mainElement=n,this.startRow=parseInt(n.getAttribute("data-row"),10),this.startCol=parseInt(n.getAttribute("data-col"),10),this.setAttributes({value:{col:i.toString(),row:t.toString()}},n),this.updateOldRowColumn(),this.setPanelPosition(n,t,i),this.updatePanelLayout(n,s),this.updateRowHeight(),this.updatePanels(),this.updateServerPanelData(),this.updateCloneArrayObject(),this.mainElement=null,this.allowFloating&&this.moveItemsUpwards(),this.movePanelCalled=!1,this.checkForChanges(!1)}},i.prototype.setAttributes=function(e,t){for(var i=0;i0?(this.panelID=0,e.forEach(function(e){e.id||(i.panelPropertyChange(e,{id:"layout_"+i.panelID.toString()}),i.panelID=i.panelID+1)})):this.restrictDynamicUpdate=!0},i.prototype.onPropertyChanged=function(e,i){var s=this;e.panels&&e.panels.length>0&&e.panels[0]instanceof x&&this.checkForIDValues(e.panels);for(var n=0,a=Object.keys(e);n0?(this.isRenderComplete=!1,this.updatePanelsDynamically(e.panels),this.isRenderComplete=!0):e.panels[0]&&e.panels.length?this.restrictDynamicUpdate=!1:(this.isRenderComplete=!1,this.updatePanelsDynamically(this.panels),this.isRenderComplete=!0);break;case"columns":this.isRenderComplete=!1,e.panels&&this.updatePanelsDynamically(e.panels),this.setProperties({columns:e.columns},!0),this.panelCollection=[],this.maxColumnValue=this.columns,this.calculateCellSize(),this.panels.forEach(function(e){if(s.setMinMaxValues(e),s.maxColumnValue