//>>built
define("mill/queryBuilder/parametersView","dojo/DeferredList dijit/TitlePane dijit/form/ValidationTextBox dijit/form/CheckBox dijit/form/SimpleTextarea dijit/form/Textarea mill/mill".split(" "),function(){window.mill||(mill={});mill.queryBuilder||(mill.queryBuilder={});dojo.declare("mill.queryBuilder.parametersView",[],{items:null,dialog:null,useTabs:!1,title:"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438",buttonsPaneContent:dojo.cache("mill","dataBrowser/buttonsPane.html",'\x3cdiv align\x3d"right"\x3e\x3cspan dojoType\x3d"dijit.form.Button" onClick\x3d"dijit.byNode(this.domNode.parentNode.parentNode.parentNode.parentNode.parentNode)._perform()"\x3e\x3cb\x3eOK\x3c/b\x3e\x3c/span\x3e\x3cspan dojoType\x3d"dijit.form.Button" onClick\x3d"dijit.byNode(this.domNode.parentNode.parentNode.parentNode.parentNode.parentNode).hide()"\x3e \u041e\u0442\u043c\u0435\u043d\u0430 \x3c/span\x3e\x3c/div\x3e'),
constructor:function(g){g&&dojo.mixin(this,g)},show:function(){var g=this.useTabs?new dijit.layout.TabContainer({region:"center"}):new dijit.layout.BorderContainer({design:"sidebar",region:"center"}),n=[],v=function(a,c){var b=null;dojo.forEach(n,function(e){e.caption==a&&(b=e)});b||(b={caption:a,groups:[]},n.push(b));var f=null;dojo.forEach(b.groups,function(e){e.caption==c&&(f=e)});f||(f={caption:c,items:[]},b.groups.push(f));return f};dojo.forEach(this.items,function(a){v(a.Tab,a.Group).items.push(a)});
var r=!1;dojo.forEach(n,function(a,c){var b=!1,f=new dijit.layout.ContentPane({splitter:!0,style:"overflow: auto",title:a.caption});dojo.forEach(a.groups,function(e){var t=!1,h=new dijit.TitlePane({toggleable:!1,title:e.caption,style:"margin-bottom:8px;"},f.containerNode.appendChild(document.createElement("div")));e.caption||(dojo.style(h.titleBarNode,{display:"none"}),dojo.style(h.hideNode,{borderTop:"1px solid #B5BCC7"}));dojo.style(h.containerNode,{padding:"2px"});var p=document.createElement("table");
p.width="100%";dojo.forEach(e.items,function(q){var k=p.insertRow(-1);k.insertCell(-1).appendChild(document.createTextNode(q.Caption+":"));k=k.insertCell(-1);q.control=new dijit.form.ValidationTextBox({style:"width:100%",value:q.Value},k.appendChild(document.createElement("span")));r=b=t=!0});t?h.attr("content",p):h.domNode.parentNode.removeChild(h.domNode)});b&&g.addChild(f)});if(!this.useTabs){var u=g.getChildren();dojo.forEach(u,function(a,c){c?a.attr("region","right"):a.attr("region","center");
a.domNode.style.width=100/u.length+"%"})}if(r){var d=new dijit.Dialog({title:this.title}),l=new dijit.layout.BorderContainer({design:"headline",style:"width:100%;height:100%"}),m=new dijit.layout.ContentPane({region:"bottom",splitter:!1,style:"padding:0;border:0 none",content:this.buttonsPaneContent});l.addChild(g);l.addChild(m);m=dojo.coords(dojo.body());dojo.style(d.containerNode,{width:.7*m.w+"px",height:.7*m.h+"px",padding:0});d.containerNode.appendChild(l.domNode);dojo.mixin(d,{_perform:dojo.hitch(this,
function(){d.hide();this.perform(this)})});this.dialog=d;d.startup();d.show().always(function(){var a=1E6;dojo.forEach(g.getChildren(),function(c){var b=c.containerNode.childNodes;b=dojo.coords(dijit.byNode(b[b.length-1]).hideNode);c=dojo.coords(c.containerNode).h-(b.t+b.h);a>c-18&&(a=c-18)});0<a&&(d.containerNode.style.height=dojo.coords(d.containerNode).h-a+"px",d._size(),d._position(),l.layout())})}else this.perform(this)},perform:function(){}})});