ax5ui-docker
Advanced tools
Comparing version 1.4.108 to 1.4.109
{ | ||
"name": "ax5ui-docker", | ||
"version": "1.4.108", | ||
"version": "1.4.109", | ||
"description": "A dashboard plugin that works with Bootstrap & jQuery", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -1,2 +0,2 @@ | ||
"use strict";!function(){var e=ax5.ui,a=ax5.util,t=void 0;e.addClass({className:"docker"},function(){return function(){var n=this,r=this,l=void 0;this.instanceId=ax5.getGuid(),this.config={theme:"default",animateTime:250,columnKeys:{},control:{},icons:{close:"X",more:"..."},labelDirection:"top",disableClosePanel:!1,disableDragPanel:!1,resizeDebounceTime:100,panelDebounceTime:300},this.xvar={},this.menu=null,this.onResize=null,this.panels=[],this.panelId=0,this.modules={},l=this.config;var i={resizeDebounceFn:ax5.util.debounce(function(e){e()},l.resizeDebounceTime),panelDebounceFn:ax5.util.debounce(function(e){e()},l.panelDebounceTime)},o=function(e){var a={resize:function(e){this.onResize&&i.resizeDebounceFn(function(){var a={self:this,resizer:e.target,resizedDom:[e.target.prev(),e.target.next()]};this.onResize.call(a,a)}.bind(this))}};return e.eventName in a&&a[e.eventName].call(n,e),n},s=function(){return n.panelId++},d={init:function(e,a){e.$element.html(a.name)},active:function(e,a){},deactive:function(e,a){},destroy:function(e,a){}},c=function(e,a){var t=[];return e&&"undefined"!=typeof e.panelPath&&t.push(e.panelPath),t.push("panels["+(a||0)+"]"),t.join(".")},p=function(e){var t=[],r=a.isArray(e)?[].concat(e):[].concat(e.split(/[\.\[\]]/g));r.forEach(function(e){""!==e&&t.push('["'+e.replace(/['\"]/g,"")+'"]')});try{return Function("","return this"+t.join("")+";").call(n)}catch(e){return}},u=function(e){try{var a=e.panelPath.substr(0,e.panelPath.lastIndexOf("."));return Function("","return this."+a+";").call(n)}catch(e){return}},h=function(e,t){var r=[],l=a.isArray(e)?[].concat(e):[].concat(e.split(/[\.\[\]]/g));return l.forEach(function(e){""!==e&&r.push('["'+e.replace(/['\"]/g,"")+'"]')}),Function("val","return this"+r.join("")+" = val;").call(n,t)},f=function(e){var a=void 0,t=e.originalEvent?e.originalEvent:e;return a="changedTouches"in t&&t.changedTouches?t.changedTouches[0]:t,{clientX:a.pageX,clientY:a.pageY}},v=function(e,t,r){var i=jQuery.extend(e.moduleState,{name:e.name}),o={$element:e.$item},s=void 0,c={init:function(){e.builded=!0,s=e.moduleName in n.modules&&"init"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,s.init(o,i)},active:function(){e.active=!0,e.$label.addClass("active"),e.$item.addClass("active");var a=e.$label.parent();a.get(0)&&a.get(0).clientWidth!==a.get(0).scrollWidth&&a.animate({scrollLeft:e.$label.position().left},300),s=e.moduleName in n.modules&&"active"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,s.active(o,i),a=null},deactive:function(){e.active=!1,e.$label.removeClass("active"),e.$item.removeClass("active"),s=e.moduleName in n.modules&&"deactive"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,s.deactive(o,i)},destroy:function(){s=e.moduleName in n.modules&&"destroy"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,s.destroy(o,i),h(e.panelPath,null),w()},remove:function(){s=e.moduleName in n.modules&&"destroy"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,s.destroy(o,i),h(e.panelPath,null),w()}},p={panel:e,controlType:t},u=function(){c[t](),s=null,a.isFunction(l.control.after)&&l.control.after.call(p,p)};c[t]&&(a.isFunction(l.control.before)?l.control.before.call(p,p,function(e){"undefined"==typeof e&&(e=!0),e&&u(),a.isFunction(r)&&r(e)}):u())},x=function(){var e={stack:function(n,i,o,s){var d=void 0,p=-1;o.panelPath=c(i,s),d=jQuery(t.tmpl.get.call(this,"stack-panel",{id:r.instanceId,name:o.name,hasLabelColor:!a.isNothing(o.color),color:o.color,borderColor:o.borderColor,panelPath:o.panelPath,icons:l.icons,labelDirection:o.labelDirection||l.labelDirection,disableClosePanel:l.disableClosePanel,disableDragPanel:l.disableDragPanel},{})),n.append(d),a.isArray(o.panels)&&(o.panels.forEach(function(e,a){e.active&&(p=a)}),p===-1&&(p=0),o.panels[p].active=!0,o.panels.forEach(function(a,t){a.panelIndex=t,e[a.type](d,o,a,t)})),d=null,p=null},panel:function(e,n,i,o){var d=void 0;i.panelPath=c(n,o),i.$label=jQuery(t.tmpl.get.call(this,"panel-label",{id:r.instanceId,pIndex:o,name:i.name,hasLabelColor:!a.isNothing(i.color),color:i.color,borderColor:i.borderColor,panelPath:i.panelPath,icons:l.icons,disableClosePanel:l.disableClosePanel,disableDragPanel:l.disableDragPanel},{})),i.$item?(i.$item.attr("data-ax5docker-path",i.panelPath),i.$item.attr("data-ax5docker-pane-item",o)):i.$item=jQuery('<div data-ax5docker-pane-item="'+o+'" data-ax5docker-id="'+r.instanceId+'" data-ax5docker-pane-id="'+s()+'" data-ax5docker-path="'+i.panelPath+'"></div>'),n&&"stack"==n.type?(i.active&&(i.builded||v(i,"init"),v(i,"active")),e.find('[data-ax5docker-pane-tabs="'+r.instanceId+'"]').append(i.$label),e.find('[data-ax5docker-pane-item-views="'+r.instanceId+'"]').append(i.$item)):(d=jQuery(t.tmpl.get.call(this,"stack-panel",{id:r.instanceId,name:i.name,hasLabelColor:!a.isNothing(i.color),color:i.color,borderColor:i.borderColor,panelPath:i.panelPath,flexGrow:i.flexGrow,icons:l.icons,labelDirection:i.labelDirection||l.labelDirection,disableClosePanel:l.disableClosePanel,disableDragPanel:l.disableDragPanel},{})),i.builded||v(i,"init"),v(i,"active"),d.find('[data-ax5docker-pane-tabs="'+r.instanceId+'"]').append(i.$label),d.find('[data-ax5docker-pane-item-views="'+r.instanceId+'"]').append(i.$item),e.append(d)),d=null},resizeHandle:function(e,a,t,n){var l=jQuery('<div data-ax5docker-id="'+r.instanceId+'" data-ax5docker-resize-handle="'+a.type+"/"+a.panelPath+"/"+n+'"></div>');e.append(l),l=null},row:function(t,n,l,i){var o=void 0;if(l.panelPath=c(n,i),n&&"stack"==n.type)throw"The 'stack' type child nodes are allowed only for the 'panel' type.";o=jQuery('<div data-ax5docker-pane-axis="row" data-ax5docker-id="'+r.instanceId+'" data-ax5docker-path="'+l.panelPath+'" style="flex-grow: '+(l.flexGrow||1)+';"></div>'),t.append(o),a.isArray(l.panels)&&l.panels.forEach(function(a,t){t>0&&e.resizeHandle(o,l,a,t),a.panelIndex=t,e[a.type](o,l,a,t)}),o=null},column:function(t,n,l,i){var o=void 0;if(l.panelPath=c(n,i),n&&"stack"==n.type)throw"The 'stack' type child nodes are allowed only for the 'panel' type.";o=jQuery('<div data-ax5docker-pane-axis="column" data-ax5docker-id="'+r.instanceId+'" data-ax5docker-path="'+l.panelPath+'" style="flex-grow: '+(l.flexGrow||1)+';"></div>'),t.append(o),a.isArray(l.panels)&&l.panels.forEach(function(a,t){t>0&&e.resizeHandle(o,l,a,t),a.panelIndex=t,e[a.type](o,l,a,t)}),o=null}},i=jQuery('<div data-ax5docker-panes="'+n.instanceId+'"></div>');n.panels[0]&&e[n.panels[0].type](i,null,n.panels[0],0),n.$target.html(i),n.$target.off("click.ax5docker-pane").on("click.ax5docker-pane",'[data-ax5docker-id="'+r.instanceId+'"][data-ax5docker-pane-tab] .close-icon',function(e){r.removePanel($(this).parents("[data-ax5docker-pane-tab]").attr("data-ax5docker-path")),a.stopEvent(e)}).on("click.ax5docker-pane",'[data-ax5docker-id="'+r.instanceId+'"][data-ax5docker-pane-tab]',function(e){var t=jQuery(this),n=p(t.parents("[data-ax5docker-pane]").attr("data-ax5docker-path")),r=t.attr("data-ax5docker-pane-tab");t.hasClass("active")||b(n,r),t=null,n=null,r=null,a.stopEvent(e)}).on("click.ax5docker-pane",'[data-ax5docker-pane-tabs-more="'+n.instanceId+'"]',function(e){k($(this).parents("[data-ax5docker-pane]"),e),a.stopEvent(e)}),n.$target.off("mousedown.ax5docker-pane-resize").off("dragstart.ax5docker-pane-resize").on("dragstart.ax5docker-pane-resize",'[data-ax5docker-id="'+r.instanceId+'"][data-ax5docker-pane-tab]',function(e){l.disableDragPanel||g.on(this)}).on("mousedown.ax5docker-pane-resize",'[data-ax5docker-id="'+r.instanceId+'"][data-ax5docker-resize-handle]',function(e){var t=this.getAttribute("data-ax5docker-resize-handle").split(/\//g);r.xvar.mousePosition=f(e),r.xvar.resizerType=t[0],r.xvar.resizerPath=t[1],r.xvar.resizerIndex=t[2],r.xvar.resizer$dom=$(this),r.xvar.resizerParent$dom=r.xvar.resizer$dom.parent(),r.xvar.resizerPrevGrow=a.number(r.xvar.resizer$dom.prev().css("flex-grow")),r.xvar.resizerNextGrow=a.number(r.xvar.resizer$dom.next().css("flex-grow")),"row"==r.xvar.resizerType?r.xvar.resizerCanvasWidth=r.xvar.resizer$dom.prev().innerWidth()+r.xvar.resizer$dom.next().innerWidth()+r.xvar.resizer$dom.width():r.xvar.resizerCanvasHeight=r.xvar.resizer$dom.prev().innerHeight()+r.xvar.resizer$dom.next().innerHeight()+r.xvar.resizer$dom.height(),m.on(this),a.stopEvent(e)}).on("dragstart.ax5docker-pane-resize",'[data-ax5docker-id="'+r.instanceId+'"][data-ax5docker-resize-handle]',function(e){return a.stopEvent(e),!1}),y(),i=null},g={on:function(e){n.panels[0]&&n.panels[0].panels&&n.panels[0].panels.length&&(n.xvar.dragger={dragPanel:e,target:null,dragOverVertical:null,dragOverHorizontal:null},n.$target.on("dragover.ax5docker-"+n.instanceId,'[data-ax5docker-id="'+n.instanceId+'"][data-ax5docker-path]',function(e){g.dragover(this,e),a.stopEvent(e)}).on("drop.ax5docker-"+n.instanceId,function(e){g.off("drop"),a.stopEvent(e)}).on("dragend.ax5docker-"+n.instanceId,function(e){g.off(),a.stopEvent(e)}))},dragover:function(e,a){var t=jQuery(e),r={},l=f(a),i=void 0,o=void 0;if(null!=n.xvar.dragger.target&&n.xvar.dragger.target.get(0)==t.get(0)||(n.xvar.dragger.target&&n.xvar.dragger.target.removeAttr("data-dropper"),n.xvar.dragger.target=t,n.xvar.dragger.dragOverVertical=null,n.xvar.dragger.dragOverHorizontal=null),r=t.offset(),r.width=t.width(),r.height=t.height(),t.attr("data-ax5docker-pane-tab")){var s=r.width/2;if(r.left<=l.clientX&&r.left+s>=l.clientX?o="left":r.left+s<=l.clientX&&r.left+2*s>=l.clientX&&(o="right"),n.xvar.dragger.dragOverHorizontal!=o&&"undefined"!=typeof o){n.xvar.dragger.dragOverHorizontal=o;var d={left:function(e){e.attr("data-dropper","left")},right:function(e){e.attr("data-dropper","right")}};n.xvar.dragger.dragOverHorizontal in d&&d[n.xvar.dragger.dragOverHorizontal](n.xvar.dragger.target)}s=null}else if(t.attr("data-ax5docker-pane-tabs"))n.xvar.dragger.dragOverHorizontal="last-child",n.xvar.dragger.target.attr("data-dropper","true");else if(t.attr("data-ax5docker-pane-item")){var c=r.height/3,p=r.width/3;if(r.top<=l.clientY&&r.top+c>=l.clientY?i="top":r.top+c<=l.clientY&&r.top+2*c>=l.clientY?i="middle":r.top+2*c<=l.clientY&&r.top+3*c>=l.clientY&&(i="bottom"),r.left<=l.clientX&&r.left+p>=l.clientX?o="left":r.left+p<=l.clientX&&r.left+2*p>=l.clientX?o="center":r.left+2*p<=l.clientX&&r.left+3*p>=l.clientX&&(o="right"),n.xvar.dragger.dragOverVertical!=i||n.xvar.dragger.dragOverHorizontal!=o){n.xvar.dragger.dragOverVertical=i,n.xvar.dragger.dragOverHorizontal=o;var u={"left-top":function(e){e.attr("data-dropper","left")},"right-top":function(e){e.attr("data-dropper","right")},"center-top":function(e){e.attr("data-dropper","top")},"left-middle":function(e){e.attr("data-dropper","left")},"right-middle":function(e){e.attr("data-dropper","right")},"center-middle":function(e){e.attr("data-dropper","center")},"left-bottom":function(e){e.attr("data-dropper","left")},"right-bottom":function(e){e.attr("data-dropper","right")},"center-bottom":function(e){e.attr("data-dropper","bottom")}};n.xvar.dragger.dragOverHorizontal+"-"+n.xvar.dragger.dragOverVertical in u&&u[n.xvar.dragger.dragOverHorizontal+"-"+n.xvar.dragger.dragOverVertical](n.xvar.dragger.target)}c=null,p=null}},off:function(e){if(e){var a=p(n.xvar.dragger.dragPanel.getAttribute("data-ax5docker-path")),t=[];n.xvar.dragger.dragOverHorizontal&&t.push(n.xvar.dragger.dragOverHorizontal),n.xvar.dragger.dragOverVertical&&t.push(n.xvar.dragger.dragOverVertical),n.appendPanel(a,n.xvar.dragger.target.attr("data-ax5docker-path"),t),a=null,t=null}y(),n.$target.off("dragover.ax5docker-"+n.instanceId).off("drop.ax5docker-"+n.instanceId).off("dragend.ax5docker-"+n.instanceId),n.xvar.dragger.target.removeAttr("data-dropper")}},m={on:function(e){jQuery(document.body).on("mousemove.ax5docker-"+n.instanceId,function(e){var t=f(e),n=void 0;r.xvar.resizerLived?("row"==r.xvar.resizerType?(r.xvar.__da=t.clientX-r.xvar.mousePosition.clientX,n=a.number(2*r.xvar.__da/r.xvar.resizerCanvasWidth,{round:6}),r.xvar.resizer$dom.prev().css({"flex-grow":r.xvar.resizerPrevGrow+n}),r.xvar.resizer$dom.next().css({"flex-grow":r.xvar.resizerNextGrow-n})):(r.xvar.__da=t.clientY-r.xvar.mousePosition.clientY,n=a.number(2*r.xvar.__da/r.xvar.resizerCanvasHeight,{round:6}),r.xvar.resizer$dom.prev().css({"flex-grow":r.xvar.resizerPrevGrow+n}),r.xvar.resizer$dom.next().css({"flex-grow":r.xvar.resizerNextGrow-n})),o({eventName:"resize",target:r.xvar.resizer$dom})):r.xvar.resizerLived=!0,t=null,n=null}).on("mouseup.ax5docker-"+n.instanceId,function(e){m.off(),a.stopEvent(e)}).on("mouseleave.ax5docker-"+n.instanceId,function(e){m.off(),a.stopEvent(e)}),jQuery(document.body).attr("unselectable","on").css("user-select","none").on("selectstart",!1)},off:function(){if(r.xvar.resizerLived=!1,"undefined"==typeof n.xvar.__da);else{var e=r.xvar.resizer$dom.prev(),t=r.xvar.resizer$dom.next(),l=p(e.attr("data-ax5docker-path")),i=p(t.attr("data-ax5docker-path"));l.flexGrow=a.number(e.css("flex-grow")),i.flexGrow=a.number(t.css("flex-grow")),e=null,t=null,l=null,i=null}y(),jQuery(document.body).off("mousemove.ax5docker-"+n.instanceId).off("mouseup.ax5docker-"+n.instanceId).off("mouseleave.ax5docker-"+n.instanceId),jQuery(document.body).removeAttr("unselectable").css("user-select","auto").off("selectstart")}},b=function(e,a){for(var t=e.panels[a],r=0,l=e.panels.length;r<l;r++)e.panels[r].active&&v(e.panels[r],"deactive");return t.builded||v(t,"init"),v(t,"active"),e=null,a=null,t=null,n},k=function(e,t){var r=jQuery(e),l=r.attr("data-ax5docker-path"),i=p(l);if(!n.menu)throw console.log(i.panels),"'ax5ui-menu' is required to implement the function.";var o=a.map(i.panels,function(e){return{label:this.name,index:e,panePath:l}});return n.menu.setConfig({items:o,onClick:function(){b(p(this.panePath),this.index)}}),n.menu.popup(t),r=null,l=null,i=null,n},y=function(){i.panelDebounceFn(function(){this.$target.find('[data-ax5docker-pane-tabs="'+this.instanceId+'"]').each(function(){var e=jQuery(this).parent();this.scrollWidth>this.clientWidth?e.addClass("tabs-scrolled"):e.removeClass("tabs-scrolled"),e=null})}.bind(n))},P=function(e){a.isArray(e)?e.forEach(function(e){v(e,"deactive")}):v(e,"deactive")},w=function(){var e={stack:function(t){if(!a.isArray(t.panels))return!1;var n={type:"stack",panels:[]};return t.panels.forEach(function(a,t){if(a){var r=e[a.type](a);r&&n.panels.push(r),r=null}}),0==n.panels.length?null:(n.panels.length<2&&(n=n.panels[0]),n)},panel:function(e){return e},row:function(t){if(!a.isArray(t.panels))return!1;var n={type:"row",panels:[]};return t.panels.forEach(function(a,t){if(a){var r=e[a.type](a);r&&n.panels.push(r),r=null}}),0==n.panels.length?null:(n.panels.length<2&&(n=n.panels[0]),n)},column:function(t){if(!a.isArray(t.panels))return!1;var n={type:"column",panels:[]};return t.panels.forEach(function(a,t){if(a){var r=e[a.type](a);r&&n.panels.push(r),r=null}}),0==n.panels.length?null:(n.panels.length<2&&(n=n.panels[0]),n)}};n.panels[0]?(n.panels[0]=e[n.panels[0].type](n.panels[0]),n.panels[0]&&"panel"===n.panels[0].type&&(n.panels[0]={type:"stack",panels:[n.panels[0]]})):n.panels=[],x()};this.init=function(e){return l=jQuery.extend(!0,{},l,e),l.target?(this.onResize=l.onResize,this.$target=jQuery(l.target),this.panels=l.panels||[],this.onStateChanged=l.onStateChanged,this.onClick=l.onClick,this.onLoad=l.onLoad,this.onDataChanged=l.onDataChanged,ax5.ui.menu&&(this.menu=new ax5.ui.menu({theme:"default",position:"absolute",icons:{arrow:"▸"}})),void jQuery(window).bind("resize.ax5docker-"+this.id,function(){y()})):(console.log(ax5.info.getError("ax5docker","401","init")),this)},this.setPanels=function(e){return this.panels=e||[],x(),this},this.addModule=function(e){return a.isObject(e)&&jQuery.extend(!0,this.modules,e),this},this.repaint=function(){return x(),this},this.addPanel=function(e,a,t,n){var r="",l=void 0,i=void 0;if(0===this.panels.length||!this.panels[0])return this.setPanels([{type:"stack",panels:[t]}]);r="undefined"==e?"0":e.replace(/[a-zA-Z\[\]]+/g,"").replace(/(\d+)/g,function(e,a){return"panels["+e+"]"}),l=p(r),i=u(l),i&&"stack"==i.type&&(l=i,r=l.panelPath);var o={stack:function(e,a,t,n){var l=jQuery.extend({},e),i={stack:function(e,a){a.active&&P(e.panels),e.panels.push(a),w()},"stack-left":function(e,a){a.active&&P(e.panels),e.panels.splice(n,0,a),w()},"stack-right":function(e,a){a.active&&P(e.panels),e.panels.splice(Number(n)+1,0,a),w()},"row-left":function(e,t){var n=r.substr(0,r.lastIndexOf(".")),i=p(n);i&&"row"==i.type?this.addPanel(i.panelPath,a,t,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(t),e.panels.push(l),w())},"row-right":function(e,t){var n=r.substr(0,r.lastIndexOf(".")),i=p(n);i&&"row"==i.type?this.addPanel(i.panelPath,a,t,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(l),e.panels.push(t),w())},"column-top":function(e,t){var n=r.substr(0,r.lastIndexOf(".")),i=p(n);i&&"column"==i.type?this.addPanel(i.panelPath,a,t,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(t),e.panels.push(l),w())},"column-bottom":function(e,t){var n=r.substr(0,r.lastIndexOf(".")),i=p(n);i&&"column"==i.type?this.addPanel(i.panelPath,a,t,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(l),e.panels.push(t),w())}};a in i&&i[a].call(this,e,t),l=null,i=null},row:function(e,a,t,n){var l=jQuery.extend({},e),i={stack:function(e,t){e.panels[0]&&e.panels[0].panelPath&&this.addPanel(e.panels[0].panelPath,a,t)},"row-left":function(e,a,t){e.panels.splice(t,0,a),w()},"row-right":function(e,a,t){e.panels.splice(t+1,0,a),w()},"column-top":function(e,t,n){var i=r.substr(0,r.lastIndexOf(".")),o=p(i);o&&"column"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(t),e.panels.push(l),w())},"column-bottom":function(e,t,n){var i=r.substr(0,r.lastIndexOf(".")),o=p(i);o&&"column"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(l),e.panels.push(t),w())}};a in i&&i[a].call(this,e,t,n),i=null,l=null},column:function(e,a,t,n){var l=jQuery.extend({},e),i={stack:function(e,t){e.panels[0]&&e.panels[0].panelPath&&this.addPanel(e.panels[0].panelPath,a,t)},"row-left":function(e,t){var n=r.substr(0,r.lastIndexOf(".")),i=p(n);i&&"row"==i.type?this.addPanel(i.panelPath,a,t,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(t),e.panels.push(l),w())},"row-right":function(e,t){var n=r.substr(0,r.lastIndexOf(".")),i=p(n);i&&"row"==i.type?this.addPanel(i.panelPath,a,t,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(l),e.panels.push(t),w())},"column-top":function(e,a){e.panels.splice(n,0,a),w()},"column-bottom":function(e,a){e.panels.splice(n+1,0,a),w()}};a in i&&i[a].call(this,e,t),i=null,l=null},panel:function(e,a,t){var n=jQuery.extend({},e),l={stack:function(e,a){e=h(r,{type:"stack",panels:[]}),a.active&&P(n),e.panels.push(n),e.panels.push(a),w()},"stack-left":function(e,a){e=h(r,{type:"stack",panels:[]}),a.active&&P(n),e.panels.push(a),e.panels.push(n),w()},"stack-right":function(e,a){e=h(r,{type:"stack",panels:[]}),a.active&&P(n),e.panels.push(n),e.panels.push(a),w()},"row-left":function(e,t){var l=r.substr(0,r.lastIndexOf(".")),i=p(l);i&&"row"==i.type||"column"==i.type?this.addPanel(i.panelPath,a,t,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(t),e.panels.push(n),w())},"row-right":function(e,t){var l=r.substr(0,r.lastIndexOf(".")),i=p(l);i&&"row"==i.type||"column"==i.type?this.addPanel(i.panelPath,a,t,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(n),e.panels.push(t),w())},"column-top":function(e,t){var l=r.substr(0,r.lastIndexOf(".")),i=p(l);i&&"column"==i.type||"row"==i.type?this.addPanel(i.panelPath,a,t,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(t),e.panels.push(n),w())},"column-bottom":function(e,t){var l=r.substr(0,r.lastIndexOf(".")),i=p(l);i&&"column"==i.type||"row"==i.type?this.addPanel(i.panelPath,a,t,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(n),e.panels.push(t),w())}};a in l&&l[a].call(this,e,t),n=null,l=null}};return(l?l.type:"stack"in o)&&o[l?l.type:"stack"].call(this,l,a,t,n),this},this.removePanel=function(e,a){var t=p(e);return v(t,"destroy",a),t=null,this},this.appendPanel=function(e,t,n){var r=$.extend({},e,{panelPath:""}),l=void 0,i=e.panelPath,o=a.right(t,".").replace(/\D/g,"");if(0==n.length)return this;if(e.panelPath===t){var s=t.substr(0,t.lastIndexOf(".")),d=p(s);if("stack"!=d.type)return this}if(1==n.length)l="last-child"==n[0]?"stack":"stack-"+n[0],r.active=!1,r.$item.removeClass("active"),v(r,"deactive");else switch(n[0]+"-"+n[1]){case"left-top":l="row-left";break;case"left-middle":l="row-left";break;case"left-bottom":l="row-left";break;case"center-top":l="column-top";break;case"center-middle":l="stack",r.active=!1,r.$item.removeClass("active"),o=void 0,v(r,"deactive");break;case"center-bottom":l="column-bottom";break;case"right-top":l="row-right";break;case"right-middle":l="row-right";break;case"right-bottom":l="row-right"}return e.panelPath===t&&(t=a.left(t,".")),h(i,null),this.addPanel(t,l,r,o),r=null,this},this.align=function(){return y(),this},this.searchPanel=function(e){if(a.isFunction(e)){var t=function a(t){for(var n=0,l=t.length,i=void 0;n<l;n++)if(t[n])if("panel"===t[n].type){if(e.call({config:r.config,panel:t[n]},t[n]))return t[n]}else if(i=a(t[n].panels))return i};return t(this.panels)}if(a.isString(e))return p(e)},this.activePanel=function(e,a){var t="",n=void 0,r=void 0;return 0!==this.panels.length&&this.panels[0]?(t="undefined"==typeof e?"0":e.replace(/[a-zA-Z\[\]]+/g,"").replace(/(\d+)/g,function(e,a){return"panels["+e+"]"}),n=p(t),r=u(n),b(r,n.panelIndex),this):this},this.main=function(){e.docker_instance=e.docker_instance||[],e.docker_instance.push(this),arguments&&a.isObject(arguments[0])&&this.setConfig(arguments[0])}.apply(this,arguments)}}()),t=ax5.ui.docker}(),function(){var e=ax5.ui.docker,a=function(e,a){return"bottom"===a.labelDirection?'<div data-ax5docker-pane="{{id}}" data-ax5docker-label-direction="{{labelDirection}}" data-ax5docker-path="{{panelPath}}" style="flex-grow: {{#flexGrow}}{{.}}{{/flexGrow}}{{^flexGrow}}1{{/flexGrow}};">\n <div data-ax5docker-pane-item-views="{{id}}"></div>\n <ul data-ax5docker-pane-tabs="{{id}}" data-ax5docker-id="{{id}}" data-ax5docker-path="{{panelPath}}"></ul>\n <div data-ax5docker-pane-tabs-more="{{id}}">{{{icons.more}}}</div>\n</div>':'<div data-ax5docker-pane="{{id}}" data-ax5docker-label-direction="{{labelDirection}}" data-ax5docker-path="{{panelPath}}" style="flex-grow: {{#flexGrow}}{{.}}{{/flexGrow}}{{^flexGrow}}1{{/flexGrow}};">\n <ul data-ax5docker-pane-tabs="{{id}}" data-ax5docker-id="{{id}}" data-ax5docker-path="{{panelPath}}"></ul>\n <div data-ax5docker-pane-tabs-more="{{id}}">{{{icons.more}}}</div>\n <div data-ax5docker-pane-item-views="{{id}}"></div>\n</div>'},t=function(){return'<li data-ax5docker-pane-tab="{{pIndex}}" data-ax5docker-id="{{id}}" data-ax5docker-path="{{panelPath}}" class="{{#hasLabelColor}}hasLabelColor{{/hasLabelColor}}">\n <div class="label-icon" style="{{#color}}background: {{color}};{{/color}}{{#borderColor}}border-color: {{borderColor}};{{/borderColor}}"></div>\n <div class="title">{{{name}}}</div>\n {{^disableClosePanel}}<div class="close-icon">{{{icons.close}}}</div>{{/disableClosePanel}}\n</li><li class="pane-tab-margin"></li>'};e.tmpl={"stack-panel":a,"panel-label":t,get:function(a,t,n){return ax5.mustache.render(e.tmpl[a].call(this,n,t),t)}}}(); | ||
"use strict";!function(){var e=ax5.ui,a=ax5.util,n=void 0;e.addClass({className:"docker"},function(){return function(){var t=this,r=this,l=void 0;this.instanceId=ax5.getGuid(),this.config={theme:"default",animateTime:250,columnKeys:{},control:{},icons:{close:"X",more:"..."},labelDirection:"top",disableClosePanel:!1,disableDragPanel:!1,resizeDebounceTime:100,panelDebounceTime:300},this.xvar={},this.menu=null,this.onResize=null,this.panels=[],this.panelId=0,this.modules={},l=this.config;var o={resizeDebounceFn:ax5.util.debounce(function(e){e()},l.resizeDebounceTime),panelDebounceFn:ax5.util.debounce(function(e){e()},l.panelDebounceTime)},i=function(e){var a={resize:function(e){this.onResize&&o.resizeDebounceFn(function(){var a={self:this,resizer:e.target,resizedDom:[e.target.prev(),e.target.next()]};this.onResize.call(a,a)}.bind(this))}};return e.eventName in a&&a[e.eventName].call(t,e),t},s=function(){return t.panelId++},d={init:function(e,a){e.$element.html(a.name)},active:function(e,a){},deactive:function(e,a){},destroy:function(e,a){}},c=function(e,a){var n=[];return e&&"undefined"!=typeof e.panelPath&&n.push(e.panelPath),n.push("panels["+(a||0)+"]"),n.join(".")},p=function(e){var n=[],r=a.isArray(e)?[].concat(e):[].concat(e.split(/[\.\[\]]/g));r.forEach(function(e){""!==e&&n.push('["'+e.replace(/['\"]/g,"")+'"]')});try{return Function("","return this"+n.join("")+";").call(t)}catch(e){return}},u=function(e){try{var a=e.panelPath.substr(0,e.panelPath.lastIndexOf("."));return Function("","return this."+a+";").call(t)}catch(e){return}},h=function(e,n){var r=[],l=a.isArray(e)?[].concat(e):[].concat(e.split(/[\.\[\]]/g));return l.forEach(function(e){""!==e&&r.push('["'+e.replace(/['\"]/g,"")+'"]')}),Function("val","return this"+r.join("")+" = val;").call(t,n)},f=function(e){var a=void 0,n=e.originalEvent?e.originalEvent:e;return a="changedTouches"in n&&n.changedTouches?n.changedTouches[0]:n,{clientX:a.pageX,clientY:a.pageY}},v=function(e,n,r){var o=jQuery.extend(e.moduleState,{name:e.name}),i={$element:e.$item},s=void 0,c={init:function(){e.builded=!0,s=e.moduleName in t.modules&&"init"in t.modules[e.moduleName]?t.modules[e.moduleName]:d,s.init(i,o)},active:function(){e.active=!0,e.$label.addClass("active"),e.$item.addClass("active");var a=e.$label.parent();a.get(0)&&a.get(0).clientWidth!==a.get(0).scrollWidth&&a.animate({scrollLeft:e.$label.position().left},300),s=e.moduleName in t.modules&&"active"in t.modules[e.moduleName]?t.modules[e.moduleName]:d,s.active(i,o),a=null},deactive:function(){e.active=!1,e.$label.removeClass("active"),e.$item.removeClass("active"),s=e.moduleName in t.modules&&"deactive"in t.modules[e.moduleName]?t.modules[e.moduleName]:d,s.deactive(i,o)},destroy:function(){s=e.moduleName in t.modules&&"destroy"in t.modules[e.moduleName]?t.modules[e.moduleName]:d,s.destroy(i,o),h(e.panelPath,null),w()},remove:function(){s=e.moduleName in t.modules&&"destroy"in t.modules[e.moduleName]?t.modules[e.moduleName]:d,s.destroy(i,o),h(e.panelPath,null),w()}},p={panel:e,controlType:n},u=function(){c[n](),s=null,a.isFunction(l.control.after)&&l.control.after.call(p,p)};c[n]&&(a.isFunction(l.control.before)?l.control.before.call(p,p,function(e){"undefined"==typeof e&&(e=!0),e&&u(),a.isFunction(r)&&r(e)}):u())},x=function(){var e={stack:function(t,o,i,s){var d=void 0,p=-1;i.panelPath=c(o,s),d=jQuery(n.tmpl.get.call(this,"stack-panel",{id:r.instanceId,name:i.name,hasLabelColor:!a.isNothing(i.color),color:i.color,borderColor:i.borderColor,panelPath:i.panelPath,icons:l.icons,labelDirection:i.labelDirection||l.labelDirection,disableClosePanel:l.disableClosePanel,disableDragPanel:l.disableDragPanel},{})),t.append(d),a.isArray(i.panels)&&(i.panels.forEach(function(e,a){e.active&&(p=a)}),p===-1&&(p=0),i.panels[p].active=!0,i.panels.forEach(function(a,n){a.panelIndex=n,e[a.type](d,i,a,n)})),d=null,p=null},panel:function(e,t,o,i){var d=void 0;o.panelPath=c(t,i),o.$label=jQuery(n.tmpl.get.call(this,"panel-label",{id:r.instanceId,pIndex:i,name:o.name,hasLabelColor:!a.isNothing(o.color),color:o.color,borderColor:o.borderColor,panelPath:o.panelPath,icons:l.icons,disableClosePanel:l.disableClosePanel,disableDragPanel:l.disableDragPanel},{})),o.$item?(o.$item.attr("data-ax5docker-path",o.panelPath),o.$item.attr("data-ax5docker-pane-item",i)):o.$item=jQuery('<div data-ax5docker-pane-item="'+i+'" data-ax5docker-id="'+r.instanceId+'" data-ax5docker-pane-id="'+s()+'" data-ax5docker-path="'+o.panelPath+'"></div>'),t&&"stack"==t.type?(o.active&&(o.builded||v(o,"init"),v(o,"active")),e.find('[data-ax5docker-pane-tabs="'+r.instanceId+'"]').append(o.$label),e.find('[data-ax5docker-pane-item-views="'+r.instanceId+'"]').append(o.$item)):(d=jQuery(n.tmpl.get.call(this,"stack-panel",{id:r.instanceId,name:o.name,hasLabelColor:!a.isNothing(o.color),color:o.color,borderColor:o.borderColor,panelPath:o.panelPath,flexGrow:o.flexGrow,icons:l.icons,labelDirection:o.labelDirection||l.labelDirection,disableClosePanel:l.disableClosePanel,disableDragPanel:l.disableDragPanel},{})),o.builded||v(o,"init"),v(o,"active"),d.find('[data-ax5docker-pane-tabs="'+r.instanceId+'"]').append(o.$label),d.find('[data-ax5docker-pane-item-views="'+r.instanceId+'"]').append(o.$item),e.append(d)),d=null},resizeHandle:function(e,a,n,t){var l=jQuery('<div data-ax5docker-id="'+r.instanceId+'" data-ax5docker-resize-handle="'+a.type+"/"+a.panelPath+"/"+t+'"></div>');e.append(l),l=null},row:function(n,t,l,o){var i=void 0;if(l.panelPath=c(t,o),t&&"stack"==t.type)throw"The 'stack' type child nodes are allowed only for the 'panel' type.";i=jQuery('<div data-ax5docker-pane-axis="row" data-ax5docker-id="'+r.instanceId+'" data-ax5docker-path="'+l.panelPath+'" style="flex-grow: '+(l.flexGrow||1)+';"></div>'),n.append(i),a.isArray(l.panels)&&l.panels.forEach(function(a,n){n>0&&e.resizeHandle(i,l,a,n),a.panelIndex=n,e[a.type](i,l,a,n)}),i=null},column:function(n,t,l,o){var i=void 0;if(l.panelPath=c(t,o),t&&"stack"==t.type)throw"The 'stack' type child nodes are allowed only for the 'panel' type.";i=jQuery('<div data-ax5docker-pane-axis="column" data-ax5docker-id="'+r.instanceId+'" data-ax5docker-path="'+l.panelPath+'" style="flex-grow: '+(l.flexGrow||1)+';"></div>'),n.append(i),a.isArray(l.panels)&&l.panels.forEach(function(a,n){n>0&&e.resizeHandle(i,l,a,n),a.panelIndex=n,e[a.type](i,l,a,n)}),i=null}},o=jQuery('<div data-ax5docker-panes="'+t.instanceId+'"></div>');t.panels[0]&&e[t.panels[0].type](o,null,t.panels[0],0),t.$target.html(o),t.$target.off("click.ax5docker-pane").on("click.ax5docker-pane",'[data-ax5docker-id="'+r.instanceId+'"][data-ax5docker-pane-tab] .close-icon',function(e){r.removePanel($(this).parents("[data-ax5docker-pane-tab]").attr("data-ax5docker-path")),a.stopEvent(e)}).on("click.ax5docker-pane",'[data-ax5docker-id="'+r.instanceId+'"][data-ax5docker-pane-tab]',function(e){var n=jQuery(this),t=p(n.parents("[data-ax5docker-pane]").attr("data-ax5docker-path")),r=n.attr("data-ax5docker-pane-tab");n.hasClass("active")||b(t,r),n=null,t=null,r=null,a.stopEvent(e)}).on("click.ax5docker-pane",'[data-ax5docker-pane-tabs-more="'+t.instanceId+'"]',function(e){k($(this).parents("[data-ax5docker-pane]"),e),a.stopEvent(e)}),t.$target.off("mousedown.ax5docker-pane-resize").off("dragstart.ax5docker-pane-resize").on("dragstart.ax5docker-pane-resize",'[data-ax5docker-id="'+r.instanceId+'"][data-ax5docker-pane-tab]',function(e){l.disableDragPanel||g.on(this)}).on("mousedown.ax5docker-pane-resize",'[data-ax5docker-id="'+r.instanceId+'"][data-ax5docker-resize-handle]',function(e){var n=this.getAttribute("data-ax5docker-resize-handle").split(/\//g);r.xvar.mousePosition=f(e),r.xvar.resizerType=n[0],r.xvar.resizerPath=n[1],r.xvar.resizerIndex=n[2],r.xvar.resizer$dom=$(this),r.xvar.resizerParent$dom=r.xvar.resizer$dom.parent(),r.xvar.resizerPrevGrow=a.number(r.xvar.resizer$dom.prev().css("flex-grow")),r.xvar.resizerNextGrow=a.number(r.xvar.resizer$dom.next().css("flex-grow")),"row"==r.xvar.resizerType?r.xvar.resizerCanvasWidth=r.xvar.resizer$dom.prev().innerWidth()+r.xvar.resizer$dom.next().innerWidth()+r.xvar.resizer$dom.width():r.xvar.resizerCanvasHeight=r.xvar.resizer$dom.prev().innerHeight()+r.xvar.resizer$dom.next().innerHeight()+r.xvar.resizer$dom.height(),m.on(this),a.stopEvent(e)}).on("dragstart.ax5docker-pane-resize",'[data-ax5docker-id="'+r.instanceId+'"][data-ax5docker-resize-handle]',function(e){return a.stopEvent(e),!1}),y(),o=null},g={on:function(e){t.panels[0]&&t.panels[0].panels&&t.panels[0].panels.length&&(t.xvar.dragger={dragPanel:e,target:null,dragOverVertical:null,dragOverHorizontal:null},t.$target.on("dragover.ax5docker-"+t.instanceId,'[data-ax5docker-id="'+t.instanceId+'"][data-ax5docker-path]',function(e){g.dragover(this,e),a.stopEvent(e)}).on("drop.ax5docker-"+t.instanceId,function(e){g.off("drop"),a.stopEvent(e)}).on("dragend.ax5docker-"+t.instanceId,function(e){g.off(),a.stopEvent(e)}))},dragover:function(e,a){var n=jQuery(e),r={},l=f(a),o=void 0,i=void 0;if(null!=t.xvar.dragger.target&&t.xvar.dragger.target.get(0)==n.get(0)||(t.xvar.dragger.target&&t.xvar.dragger.target.removeAttr("data-dropper"),t.xvar.dragger.target=n,t.xvar.dragger.dragOverVertical=null,t.xvar.dragger.dragOverHorizontal=null),r=n.offset(),r.width=n.width(),r.height=n.height(),n.attr("data-ax5docker-pane-tab")){var s=r.width/2;if(r.left<=l.clientX&&r.left+s>=l.clientX?i="left":r.left+s<=l.clientX&&r.left+2*s>=l.clientX&&(i="right"),t.xvar.dragger.dragOverHorizontal!=i&&"undefined"!=typeof i){t.xvar.dragger.dragOverHorizontal=i;var d={left:function(e){e.attr("data-dropper","left")},right:function(e){e.attr("data-dropper","right")}};t.xvar.dragger.dragOverHorizontal in d&&d[t.xvar.dragger.dragOverHorizontal](t.xvar.dragger.target)}s=null}else if(n.attr("data-ax5docker-pane-tabs"))t.xvar.dragger.dragOverHorizontal="last-child",t.xvar.dragger.target.attr("data-dropper","true");else if(n.attr("data-ax5docker-pane-item")){var c=r.height/3,p=r.width/3;if(r.top<=l.clientY&&r.top+c>=l.clientY?o="top":r.top+c<=l.clientY&&r.top+2*c>=l.clientY?o="middle":r.top+2*c<=l.clientY&&r.top+3*c>=l.clientY&&(o="bottom"),r.left<=l.clientX&&r.left+p>=l.clientX?i="left":r.left+p<=l.clientX&&r.left+2*p>=l.clientX?i="center":r.left+2*p<=l.clientX&&r.left+3*p>=l.clientX&&(i="right"),t.xvar.dragger.dragOverVertical!=o||t.xvar.dragger.dragOverHorizontal!=i){t.xvar.dragger.dragOverVertical=o,t.xvar.dragger.dragOverHorizontal=i;var u={"left-top":function(e){e.attr("data-dropper","left")},"right-top":function(e){e.attr("data-dropper","right")},"center-top":function(e){e.attr("data-dropper","top")},"left-middle":function(e){e.attr("data-dropper","left")},"right-middle":function(e){e.attr("data-dropper","right")},"center-middle":function(e){e.attr("data-dropper","center")},"left-bottom":function(e){e.attr("data-dropper","left")},"right-bottom":function(e){e.attr("data-dropper","right")},"center-bottom":function(e){e.attr("data-dropper","bottom")}};t.xvar.dragger.dragOverHorizontal+"-"+t.xvar.dragger.dragOverVertical in u&&u[t.xvar.dragger.dragOverHorizontal+"-"+t.xvar.dragger.dragOverVertical](t.xvar.dragger.target)}c=null,p=null}},off:function(e){if(e){var a=p(t.xvar.dragger.dragPanel.getAttribute("data-ax5docker-path")),n=[];t.xvar.dragger.dragOverHorizontal&&n.push(t.xvar.dragger.dragOverHorizontal),t.xvar.dragger.dragOverVertical&&n.push(t.xvar.dragger.dragOverVertical),t.appendPanel(a,t.xvar.dragger.target.attr("data-ax5docker-path"),n),a=null,n=null}y(),t.$target.off("dragover.ax5docker-"+t.instanceId).off("drop.ax5docker-"+t.instanceId).off("dragend.ax5docker-"+t.instanceId),t.xvar.dragger.target.removeAttr("data-dropper")}},m={on:function(e){jQuery(document.body).on("mousemove.ax5docker-"+t.instanceId,function(e){var n=f(e),t=void 0;r.xvar.resizerLived?("row"==r.xvar.resizerType?(r.xvar.__da=n.clientX-r.xvar.mousePosition.clientX,t=a.number(2*r.xvar.__da/r.xvar.resizerCanvasWidth,{round:6}),r.xvar.resizer$dom.prev().css({"flex-grow":r.xvar.resizerPrevGrow+t}),r.xvar.resizer$dom.next().css({"flex-grow":r.xvar.resizerNextGrow-t})):(r.xvar.__da=n.clientY-r.xvar.mousePosition.clientY,t=a.number(2*r.xvar.__da/r.xvar.resizerCanvasHeight,{round:6}),r.xvar.resizer$dom.prev().css({"flex-grow":r.xvar.resizerPrevGrow+t}),r.xvar.resizer$dom.next().css({"flex-grow":r.xvar.resizerNextGrow-t})),i({eventName:"resize",target:r.xvar.resizer$dom})):r.xvar.resizerLived=!0,n=null,t=null}).on("mouseup.ax5docker-"+t.instanceId,function(e){m.off(),a.stopEvent(e)}).on("mouseleave.ax5docker-"+t.instanceId,function(e){m.off(),a.stopEvent(e)}),jQuery(document.body).attr("unselectable","on").css("user-select","none").on("selectstart",!1)},off:function(){if(r.xvar.resizerLived=!1,"undefined"==typeof t.xvar.__da);else{var e=r.xvar.resizer$dom.prev(),n=r.xvar.resizer$dom.next(),l=p(e.attr("data-ax5docker-path")),o=p(n.attr("data-ax5docker-path"));l.flexGrow=a.number(e.css("flex-grow")),o.flexGrow=a.number(n.css("flex-grow")),e=null,n=null,l=null,o=null}y(),jQuery(document.body).off("mousemove.ax5docker-"+t.instanceId).off("mouseup.ax5docker-"+t.instanceId).off("mouseleave.ax5docker-"+t.instanceId),jQuery(document.body).removeAttr("unselectable").css("user-select","auto").off("selectstart")}},b=function(e,a){for(var n=e.panels[a],r=0,l=e.panels.length;r<l;r++)e.panels[r].active&&v(e.panels[r],"deactive");return n.builded||v(n,"init"),v(n,"active"),e=null,a=null,n=null,t},k=function(e,n){var r=jQuery(e),l=r.attr("data-ax5docker-path"),o=p(l);if(!t.menu)throw console.log(o.panels),"'ax5ui-menu' is required to implement the function.";var i=a.map(o.panels,function(e){return{label:this.name,index:e,panePath:l}});return t.menu.setConfig({items:i,onClick:function(){b(p(this.panePath),this.index)}}),t.menu.popup(n),r=null,l=null,o=null,t},y=function(){o.panelDebounceFn(function(){this.$target.find('[data-ax5docker-pane-tabs="'+this.instanceId+'"]').each(function(){var e=jQuery(this).parent();this.scrollWidth>this.clientWidth?e.addClass("tabs-scrolled"):e.removeClass("tabs-scrolled"),e=null})}.bind(t))},P=function(e){a.isArray(e)?e.forEach(function(e){v(e,"deactive")}):v(e,"deactive")},w=function(){var e={stack:function(n){if(!a.isArray(n.panels))return!1;var t={type:"stack",panels:[]};return n.panels.forEach(function(a,n){if(a){var r=e[a.type](a);r&&t.panels.push(r),r=null}}),0==t.panels.length?null:(t.panels.length<2&&(t=t.panels[0]),t)},panel:function(e){return e},row:function(n){if(!a.isArray(n.panels))return!1;var t={type:"row",panels:[]};return n.panels.forEach(function(a,n){if(a){var r=e[a.type](a);r&&t.panels.push(r),r=null}}),0==t.panels.length?null:(t.panels.length<2&&(t=t.panels[0]),t)},column:function(n){if(!a.isArray(n.panels))return!1;var t={type:"column",panels:[]};return n.panels.forEach(function(a,n){if(a){var r=e[a.type](a);r&&t.panels.push(r),r=null}}),0==t.panels.length?null:(t.panels.length<2&&(t=t.panels[0]),t)}};t.panels[0]?(t.panels[0]=e[t.panels[0].type](t.panels[0]),t.panels[0]&&"panel"===t.panels[0].type&&(t.panels[0]={type:"stack",panels:[t.panels[0]]})):t.panels=[],x()};this.init=function(e){return l=jQuery.extend(!0,{},l,e),l.target?(this.onResize=l.onResize,this.$target=jQuery(l.target),this.panels=l.panels||[],this.onStateChanged=l.onStateChanged,this.onClick=l.onClick,this.onLoad=l.onLoad,this.onDataChanged=l.onDataChanged,ax5.ui.menu&&(this.menu=new ax5.ui.menu({theme:"default",position:"absolute",icons:{arrow:"▸"}})),void jQuery(window).bind("resize.ax5docker-"+this.id,function(){y()})):(console.log(ax5.info.getError("ax5docker","401","init")),this)},this.setPanels=function(e){return this.panels=e||[],x(),this},this.addModule=function(e){return a.isObject(e)&&jQuery.extend(!0,this.modules,e),this},this.repaint=function(){return x(),this},this.addPanel=function(e,a,n,t){console.log(e,a);var r="",l=void 0,o=void 0;if(0===this.panels.length||!this.panels[0])return this.setPanels([{type:"stack",panels:[n]}]);r="undefined"==e?"0":e.replace(/[a-zA-Z\[\]]+/g,"").replace(/(\d+)/g,function(e,a){return"panels["+e+"]"}),l=p(r),o=u(l),o&&"stack"==o.type&&(l=o,r=l.panelPath),console.log(l),console.log(o),console.log(r);var i={stack:function(e,a,n,t){var l=jQuery.extend({},e),o={stack:function(e,a){a.active&&P(e.panels),e.panels.push(a),w()},"stack-left":function(e,a){a.active&&P(e.panels),e.panels.splice(t,0,a),w()},"stack-right":function(e,a){a.active&&P(e.panels),e.panels.splice(Number(t)+1,0,a),w()},"row-left":function(e,n){var t=r.substr(0,r.lastIndexOf(".")),o=p(t);o&&"row"==o.type?this.addPanel(o.panelPath,a,n,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(n),e.panels.push(l),w())},"row-right":function(e,n){var t=r.substr(0,r.lastIndexOf(".")),o=p(t);o&&"row"==o.type?this.addPanel(o.panelPath,a,n,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(l),e.panels.push(n),w())},"column-top":function(e,n){var t=r.substr(0,r.lastIndexOf(".")),o=p(t);o&&"column"==o.type?this.addPanel(o.panelPath,a,n,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(n),e.panels.push(l),w())},"column-bottom":function(e,n){var t=r.substr(0,r.lastIndexOf(".")),o=p(t);o&&"column"==o.type?this.addPanel(o.panelPath,a,n,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(l),e.panels.push(n),w())}};a in o&&o[a].call(this,e,n),l=null,o=null},row:function(e,a,n,t){var l=jQuery.extend({},e),o={stack:function(e,n){e.panels[0]&&e.panels[0].panelPath&&this.addPanel(e.panels[0].panelPath,a,n)},"row-left":function(e,a,n){e.panels.splice(n,0,a),w()},"row-right":function(e,a,n){e.panels.splice(n+1,0,a),w()},"column-top":function(e,n,t){var o=r.substr(0,r.lastIndexOf(".")),i=p(o);i&&"column"==i.type?this.addPanel(i.panelPath,a,n,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(n),e.panels.push(l),w())},"column-bottom":function(e,n,t){var o=r.substr(0,r.lastIndexOf(".")),i=p(o);i&&"column"==i.type?this.addPanel(i.panelPath,a,n,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(l),e.panels.push(n),w())}};a in o&&o[a].call(this,e,n,t),o=null,l=null},column:function(e,a,n,t){var l=jQuery.extend({},e),o={stack:function(e,n){e.panels[0]&&e.panels[0].panelPath&&this.addPanel(e.panels[0].panelPath,a,n)},"row-left":function(e,n){var t=r.substr(0,r.lastIndexOf(".")),o=p(t);o&&"row"==o.type?this.addPanel(o.panelPath,a,n,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(n),e.panels.push(l),w())},"row-right":function(e,n){var t=r.substr(0,r.lastIndexOf(".")),o=p(t);o&&"row"==o.type?this.addPanel(o.panelPath,a,n,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(l),e.panels.push(n),w())},"column-top":function(e,a){e.panels.splice(t,0,a),w()},"column-bottom":function(e,a){e.panels.splice(t+1,0,a),w()}};a in o&&o[a].call(this,e,n),o=null,l=null},panel:function(e,a,n){var t=jQuery.extend({},e),l={stack:function(e,a){e=h(r,{type:"stack",panels:[]}),a.active&&P(t),e.panels.push(t),e.panels.push(a),w()},"stack-left":function(e,a){e=h(r,{type:"stack",panels:[]}),a.active&&P(t),e.panels.push(a),e.panels.push(t),w()},"stack-right":function(e,a){e=h(r,{type:"stack",panels:[]}),a.active&&P(t),e.panels.push(t),e.panels.push(a),w()},"row-left":function(e,n){var l=r.substr(0,r.lastIndexOf(".")),o=p(l);o&&"row"==o.type||"column"==o.type?this.addPanel(o.panelPath,a,n,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(n),e.panels.push(t),w())},"row-right":function(e,n){var l=r.substr(0,r.lastIndexOf(".")),o=p(l);o&&"row"==o.type||"column"==o.type?this.addPanel(o.panelPath,a,n,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(t),e.panels.push(n),w())},"column-top":function(e,n){var l=r.substr(0,r.lastIndexOf(".")),o=p(l);o&&"column"==o.type||"row"==o.type?this.addPanel(o.panelPath,a,n,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(n),e.panels.push(t),w())},"column-bottom":function(e,n){var l=r.substr(0,r.lastIndexOf(".")),o=p(l);o&&"column"==o.type||"row"==o.type?this.addPanel(o.panelPath,a,n,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(t),e.panels.push(n),w())}};a in l&&l[a].call(this,e,n),t=null,l=null}};return(l?l.type:"stack"in i)&&i[l?l.type:"stack"].call(this,l,a,n,t),this},this.removePanel=function(e,a){var n=p(e);return v(n,"destroy",a),n=null,this},this.appendPanel=function(e,n,t){console.log(e);var r=$.extend({},e,{panelPath:""}),l=void 0,o=e.panelPath,i=a.right(n,".").replace(/\D/g,"");if(0==t.length)return this;if(e.panelPath===n){var s=n.substr(0,n.lastIndexOf(".")),d=p(s);if("stack"!=d.type)return this}if(1==t.length)l="last-child"==t[0]?"stack":"stack-"+t[0],r.active=!1,r.$item.removeClass("active"),v(r,"deactive");else switch(t[0]+"-"+t[1]){case"left-top":l="row-left";break;case"left-middle":l="row-left";break;case"left-bottom":l="row-left";break;case"center-top":l="column-top";break;case"center-middle":l="stack",r.active=!1,r.$item.removeClass("active"),i=void 0,v(r,"deactive");break;case"center-bottom":l="column-bottom";break;case"right-top":l="row-right";break;case"right-middle":l="row-right";break;case"right-bottom":l="row-right"}return e.panelPath===n&&(n=a.left(n,".")),h(o,null),console.log(n,l,r,i),this.addPanel(n,l,r,i),r=null,this},this.align=function(){return y(),this},this.searchPanel=function(e){if(a.isFunction(e)){var n=function a(n){for(var t=0,l=n.length,o=void 0;t<l;t++)if(n[t])if("panel"===n[t].type){if(e.call({config:r.config,panel:n[t]},n[t]))return n[t]}else if(o=a(n[t].panels))return o};return n(this.panels)}if(a.isString(e))return p(e)},this.activePanel=function(e,a){var n="",t=void 0,r=void 0;return 0!==this.panels.length&&this.panels[0]?(n="undefined"==typeof e?"0":e.replace(/[a-zA-Z\[\]]+/g,"").replace(/(\d+)/g,function(e,a){return"panels["+e+"]"}),t=p(n),r=u(t),b(r,t.panelIndex),this):this},this.main=function(){e.docker_instance=e.docker_instance||[],e.docker_instance.push(this),arguments&&a.isObject(arguments[0])&&this.setConfig(arguments[0])}.apply(this,arguments)}}()),n=ax5.ui.docker}(),function(){var e=ax5.ui.docker,a=function(e,a){return"bottom"===a.labelDirection?'<div data-ax5docker-pane="{{id}}" data-ax5docker-label-direction="{{labelDirection}}" data-ax5docker-path="{{panelPath}}" style="flex-grow: {{#flexGrow}}{{.}}{{/flexGrow}}{{^flexGrow}}1{{/flexGrow}};">\n <div data-ax5docker-pane-item-views="{{id}}"></div>\n <ul data-ax5docker-pane-tabs="{{id}}" data-ax5docker-id="{{id}}" data-ax5docker-path="{{panelPath}}"></ul>\n <div data-ax5docker-pane-tabs-more="{{id}}">{{{icons.more}}}</div>\n</div>':'<div data-ax5docker-pane="{{id}}" data-ax5docker-label-direction="{{labelDirection}}" data-ax5docker-path="{{panelPath}}" style="flex-grow: {{#flexGrow}}{{.}}{{/flexGrow}}{{^flexGrow}}1{{/flexGrow}};">\n <ul data-ax5docker-pane-tabs="{{id}}" data-ax5docker-id="{{id}}" data-ax5docker-path="{{panelPath}}"></ul>\n <div data-ax5docker-pane-tabs-more="{{id}}">{{{icons.more}}}</div>\n <div data-ax5docker-pane-item-views="{{id}}"></div>\n</div>'},n=function(){return'<li data-ax5docker-pane-tab="{{pIndex}}" data-ax5docker-id="{{id}}" data-ax5docker-path="{{panelPath}}" class="{{#hasLabelColor}}hasLabelColor{{/hasLabelColor}}">\n <div class="label-icon" style="{{#color}}background: {{color}};{{/color}}{{#borderColor}}border-color: {{borderColor}};{{/borderColor}}"></div>\n <div class="title">{{{name}}}</div>\n {{^disableClosePanel}}<div class="close-icon">{{{icons.close}}}</div>{{/disableClosePanel}}\n</li><li class="pane-tab-margin"></li>'};e.tmpl={"stack-panel":a,"panel-label":n,get:function(a,n,t){return ax5.mustache.render(e.tmpl[a].call(this,t,n),n)}}}(); | ||
//# sourceMappingURL=ax5docker.min.js.map |
{ | ||
"name": "ax5ui-docker", | ||
"version": "1.4.108", | ||
"version": "1.4.109", | ||
"description": "A dashboard plugin that works with Bootstrap & jQuery", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1361108
3543