//>>built
require({cache:{"url:dojox/layout/resources/GridContainer.html":"
\n\t
\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\n\t\t
\n\t
\n
"}});
define("dojox/layout/GridContainerLite",["dojo/_base/kernel","dojo/text!./resources/GridContainer.html","dojo/_base/declare","dojo/query","dojo/_base/sniff","dojo/dom-class","dojo/dom-style","dojo/dom-geometry","dojo/dom-construct","dojo/dom-attr","dojo/_base/array","dojo/_base/lang","dojo/_base/event","dojo/keys","dojo/topic","dijit/registry","dijit/focus","dijit/_base/focus","dijit/_WidgetBase","dijit/_TemplatedMixin","dijit/layout/_LayoutWidget","dojo/_base/NodeList","dojox/mdnd/AreaManager","dojox/mdnd/DropIndicator","dojox/mdnd/dropMode/OverDropMode","dojox/mdnd/AutoScroll"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c,_d,_e,_f,_10,_11,_12,_13,_14,_15,_16){
var gcl=_3("dojox.layout.GridContainerLite",[_15,_14],{autoRefresh:true,templateString:_2,dragHandleClass:"dojoxDragHandle",nbZones:1,doLayout:true,isAutoOrganized:true,acceptTypes:[],colWidths:"",constructor:function(_17,_18){
this.acceptTypes=(_17||{}).acceptTypes||["text"];
this._disabled=true;
},postCreate:function(){
this.inherited(arguments);
this._grid=[];
this._createCells();
this.subscribe("/dojox/mdnd/drop","resizeChildAfterDrop");
this.subscribe("/dojox/mdnd/drag/start","resizeChildAfterDragStart");
this._dragManager=dojox.mdnd.areaManager();
this._dragManager.autoRefresh=this.autoRefresh;
this._dragManager.dragHandleClass=this.dragHandleClass;
if(this.doLayout){
this._border={h:_5("ie")?_8.getBorderExtents(this.gridContainerTable).h:0,w:(_5("ie")==6)?1:0};
}else{
_7.set(this.domNode,"overflowY","hidden");
_7.set(this.gridContainerTable,"height","auto");
}
},startup:function(){
if(this._started){
return;
}
if(this.isAutoOrganized){
this._organizeChildren();
}else{
this._organizeChildrenManually();
}
_b.forEach(this.getChildren(),function(_19){
_19.startup();
});
if(this._isShown()){
this.enableDnd();
}
this.inherited(arguments);
},resizeChildAfterDrop:function(_1a,_1b,_1c){
if(this._disabled){
return false;
}
if(_10.getEnclosingWidget(_1b.node)==this){
var _1d=_10.byNode(_1a);
if(_1d.resize&&_c.isFunction(_1d.resize)){
_1d.resize();
}
_1d.set("column",_1a.parentNode.cellIndex);
if(this.doLayout){
var _1e=this._contentBox.h,_1f=_8.getContentBox(this.gridContainerDiv).h;
if(_1f>=_1e){
_7.set(this.gridContainerTable,"height",(_1e-this._border.h)+"px");
}
}
return true;
}
return false;
},resizeChildAfterDragStart:function(_20,_21,_22){
if(this._disabled){
return false;
}
if(_10.getEnclosingWidget(_21.node)==this){
this._draggedNode=_20;
if(this.doLayout){
_8.getMarginBox(this.gridContainerTable,{h:_8.getContentBox(this.gridContainerDiv).h-this._border.h});
}
return true;
}
return false;
},getChildren:function(){
var _23=new _16();
_b.forEach(this._grid,function(_24){
_4("> [widgetId]",_24.node).map(_10.byNode).forEach(function(_25){
_23.push(_25);
});
});
return _23;
},_isShown:function(){
if("open" in this){
return this.open;
}else{
var _26=this.domNode;
return (_26.style.display!="none")&&(_26.style.visibility!="hidden")&&!_6.contains(_26,"dijitHidden");
}
},layout:function(){
if(this.doLayout){
var _27=this._contentBox;
_8.getMarginBox(this.gridContainerTable,{h:_27.h-this._border.h});
_8.getContentBox(this.domNode,{w:_27.w-this._border.w});
}
_b.forEach(this.getChildren(),function(_28){
if(_28.resize&&_c.isFunction(_28.resize)){
_28.resize();
}
});
},onShow:function(){
if(this._disabled){
this.enableDnd();
}
},onHide:function(){
if(!this._disabled){
this.disableDnd();
}
},_createCells:function(){
if(this.nbZones===0){
this.nbZones=1;
}
var _29=this.acceptTypes.join(","),i=0;
var _2a=this.colWidths||[];
var _2b=[];
var _2c;
var _2d=0;
for(i=0;i0){
try{
this._insertChild(_30[i],z);
i++;
}
catch(e){
console.error("Unable to insert child in GridContainer",e);
}
mod--;
}else{
if(_32===0){
break;
}
}
}
},_organizeChildrenManually:function(){
var _33=dojox.layout.GridContainerLite.superclass.getChildren.call(this),_34=_33.length,_35;
for(var i=0;i<_34;i++){
_35=_33[i];
try{
this._insertChild(_35,_35.column-1);
}
catch(e){
console.error("Unable to insert child in GridContainer",e);
}
}
},_insertChild:function(_36,_37,p){
var _38=this._grid[_37].node,_39=_38.childNodes.length;
if(typeof (p)==undefined||p>_39){
p=_39;
}
if(this._disabled){
_9.place(_36.domNode,_38,p);
_a.set(_36.domNode,"tabIndex","0");
}else{
if(!_36.dragRestriction){
this._dragManager.addDragItem(_38,_36.domNode,p,true);
}else{
_9.place(_36.domNode,_38,p);
_a.set(_36.domNode,"tabIndex","0");
}
}
_36.set("column",_37);
return _36;
},removeChild:function(_3a){
if(this._disabled){
this.inherited(arguments);
}else{
this._dragManager.removeDragItem(_3a.domNode.parentNode,_3a.domNode);
}
},addService:function(_3b,_3c,p){
kernel.deprecated("addService is deprecated.","Please use instead.","Future");
this.addChild(_3b,_3c,p);
},addChild:function(_3d,_3e,p){
_3d.domNode.id=_3d.id;
dojox.layout.GridContainerLite.superclass.addChild.call(this,_3d,0);
if(_3e<0||_3e==undefined){
_3e=0;
}
if(p<=0){
p=0;
}
try{
return this._insertChild(_3d,_3e,p);
}
catch(e){
console.error("Unable to insert child in GridContainer",e);
}
return null;
},_setColWidthsAttr:function(_3f){
this.colWidths=_c.isString(_3f)?_3f.split(","):(_c.isArray(_3f)?_3f:[_3f]);
if(this._started){
this._updateColumnsWidth();
}
},_updateColumnsWidth:function(_40){
var _41=this._grid.length;
var _42=this.colWidths||[];
var _43=[];
var _44;
var _45=0;
var i;
for(i=0;i<_41;i++){
if(_43.length<_42.length){
_45+=_42[i]*1;
_43.push(_42[i]);
}else{
if(!_44){
_44=(100-_45)/(this.nbZones-i);
if(_44<0){
_44=100/this.nbZones;
}
}
_43.push(_44);
_45+=_44*1;
}
}
if(_45>100){
var _46=100/_45;
for(i=0;i<_43.length;i++){
_43[i]*=_46;
}
}
for(i=0;i<_41;i++){
this._grid[i].node.style.width=_43[i]+"%";
}
},_selectFocus:function(_47){
if(this._disabled){
return;
}
var key=_47.keyCode,k=_e,_48=null,_49=_12.getFocus(),_4a=_49.node,m=this._dragManager,_4b,i,j,r,_4c,_4d,_4e;
if(_4a==this.containerNode){
_4d=this.gridNode.childNodes;
switch(key){
case k.DOWN_ARROW:
case k.RIGHT_ARROW:
_4b=false;
for(i=0;i<_4d.length;i++){
_4c=_4d[i].childNodes;
for(j=0;j<_4c.length;j++){
_48=_4c[j];
if(_48!=null&&_48.style.display!="none"){
_11.focus(_48);
_d.stop(_47);
_4b=true;
break;
}
}
if(_4b){
break;
}
}
break;
case k.UP_ARROW:
case k.LEFT_ARROW:
_4d=this.gridNode.childNodes;
_4b=false;
for(i=_4d.length-1;i>=0;i--){
_4c=_4d[i].childNodes;
for(j=_4c.length;j>=0;j--){
_48=_4c[j];
if(_48!=null&&_48.style.display!="none"){
_11.focus(_48);
_d.stop(_47);
_4b=true;
break;
}
}
if(_4b){
break;
}
}
break;
}
}else{
if(_4a.parentNode.parentNode==this.gridNode){
var _4f=(key==k.UP_ARROW||key==k.LEFT_ARROW)?"lastChild":"firstChild";
var pos=(key==k.UP_ARROW||key==k.LEFT_ARROW)?"previousSibling":"nextSibling";
switch(key){
case k.UP_ARROW:
case k.DOWN_ARROW:
_d.stop(_47);
_4b=false;
var _50=_4a;
while(!_4b){
_4c=_50.parentNode.childNodes;
var num=0;
for(i=0;i<_4c.length;i++){
if(_4c[i].style.display!="none"){
num++;
}
if(num>1){
break;
}
}
if(num==1){
return;
}
if(_50[pos]==null){
_48=_50.parentNode[_4f];
}else{
_48=_50[pos];
}
if(_48.style.display==="none"){
_50=_48;
}else{
_4b=true;
}
}
if(_47.shiftKey){
var _51=_4a.parentNode;
for(i=0;i=0;i--){
if(_4c[i].style.display!="none"){
_57=_4c[i];
break;
}
}
}else{
for(i=0;i<_4c.length;i++){
if(_4c[i].style.display!="none"){
_57=_4c[i];
break;
}
}
}
if(!_57){
_4a=_48;
_56=_4a.parentNode;
_48=null;
}else{
_48=_57;
}
}
}
_11.focus(_48);
}
break;
}
}
}
},destroy:function(){
var m=this._dragManager;
_b.forEach(this._grid,function(_58){
m.unregister(_58.node);
});
this.inherited(arguments);
}});
gcl.ChildWidgetProperties={column:"1",dragRestriction:false};
_c.extend(_13,gcl.ChildWidgetProperties);
return gcl;
});