//>>built
define("dojox/layout/TableContainer","dojo/_base/kernel dojo/_base/lang dojo/_base/declare dojo/dom-class dojo/dom-construct dojo/_base/array dojo/dom-prop dojo/dom-style dijit/_WidgetBase dijit/layout/_LayoutWidget".split(" "),function(h,l,z,p,f,g,v,A,B,C){h.experimental("dojox.layout.TableContainer");h=z("dojox.layout.TableContainer",C,{cols:1,labelWidth:"100",showLabels:!0,orientation:"horiz",spacing:1,customClass:"",postCreate:function(){this.inherited(arguments);this._children=[];this.connect(this,
"set",function(b,d){!d||"orientation"!=b&&"customClass"!=b&&"cols"!=b||this.layout()})},startup:function(){if(!this._started&&(this.inherited(arguments),!this._initialized)){var b=this.getChildren();1>b.length||(this._initialized=!0,p.add(this.domNode,"dijitTableLayout"),g.forEach(b,function(d){d.started||d._started||d.startup()}),this.layout(),this.resize())}},resize:function(){g.forEach(this.getChildren(),function(b){"function"==typeof b.resize&&b.resize()})},layout:function(){function b(a,m,e){if(""!=
w.customClass){var c=w.customClass+"-"+(m||a.tagName.toLowerCase());p.add(a,c);2<arguments.length&&p.add(a,c+"-"+e)}}if(this._initialized){var d=this.getChildren(),x={},w=this;g.forEach(this._children,l.hitch(this,function(a){x[a.id]=a}));g.forEach(d,l.hitch(this,function(a,m){x[a.id]||this._children.push(a)}));var q=f.create("table",{width:"100%","class":"tableContainer-table tableContainer-table-"+this.orientation,cellspacing:this.spacing},this.domNode),k=f.create("tbody");q.appendChild(k);b(q,
"table",this.orientation);var n=f.create("tr",{},k),y=this.showLabels&&"horiz"!=this.orientation?f.create("tr",{},k):n,r=this.cols*(this.showLabels?2:1),t=0;g.forEach(this._children,l.hitch(this,function(a,m){var e=a.colspan||1;1<e&&(e=this.showLabels?Math.min(r-1,2*e-1):Math.min(r,e));t+e-1+(this.showLabels?1:0)>=r&&(t=0,n=f.create("tr",{},k),y="horiz"==this.orientation?n:f.create("tr",{},k));if(this.showLabels){var c=f.create("td",{"class":"tableContainer-labelCell"},n);if(a.spanLabel)v.set(c,"vert"==
this.orientation?"rowspan":"colspan",2);else{b(c,"labelCell");var u={"for":a.get("id")};u=f.create("label",u,c);(-1<Number(this.labelWidth)||-1<String(this.labelWidth).indexOf("%"))&&A.set(c,"width",0>String(this.labelWidth).indexOf("%")?this.labelWidth+"px":this.labelWidth);u.innerHTML=a.get("label")||a.get("title")}}c=a.spanLabel&&c?c:f.create("td",{"class":"tableContainer-valueCell"},y);1<e&&v.set(c,"colspan",e);b(c,"valueCell",m);c.appendChild(a.domNode);t+=e+(this.showLabels?1:0)}));this.table&&
this.table.parentNode.removeChild(this.table);g.forEach(d,function(a){"function"==typeof a.layout&&a.layout()});this.table=q;this.resize()}},destroyDescendants:function(b){g.forEach(this._children,function(d){d.destroyRecursive(b)})},_setSpacingAttr:function(b){this.spacing=b;this.table&&(this.table.cellspacing=Number(b))}});h.ChildWidgetProperties={label:"",title:"",spanLabel:!1,colspan:1};l.extend(B,h.ChildWidgetProperties);return h});