define(["dojo/_base/declare","dijit/form/FilteringSelect","dojo/dom-class","dojo/dom-geometry","dojo/dom-style","dojo/on","dojo/ready","dojo/parser","dojo/_base/array"],function(declare,selectBox,domClass,domGeom,style,on,ready,parser,array) {return declare("core/ui/LabelSelect",selectBox,{labelText:"",_showLabel:true,_label:null,postCreate:function() {this.inherited(arguments);var self=this;var label=document.createElement('label');label.innerHTML=this.labelText;label.className="combo";domClass.add(this.domNode,"medBox combo opHasLabel");if(this.readOnly) {domClass.add(this.domNode,"readonly");} if(this._showLabel) {this.addLabel();} this.domNode.style.position="relative";domClass.add(this.domNode,"a-medBox");this.label_div=document.createElement("div");domClass.add(this.label_div,"a-label-box-label");this.label_div.innerHTML=this.labelText;if(this.value.length) {domClass.add(self.label_div,"a-label-box-label-with-value")} this.domNode.appendChild(this.label_div);setTimeout(function() {if(self._beingDestroyed) {return;} if(self.get("value").length) {domClass.add(self.label_div,"a-label-box-label-with-value");}},200);on(this.focusNode,"focus",function() {domClass.add(self.label_div,"a-label-box-label-with-focus");});on(this,"change",function() {domClass.remove(self.label_div,"a-label-box-label-with-focus");if((self.get("value")||"").length) {domClass.add(self.label_div,"a-label-box-label-with-value");} else {domClass.remove(self.label_div,"a-label-box-label-with-value");}});on(this.focusNode,"blur",function() {domClass.remove(self.label_div,"a-label-box-label-with-focus");if((self.get("value")||"").length) {domClass.add(self.label_div,"a-label-box-label-with-value");} else {domClass.remove(self.label_div,"a-label-box-label-with-value");}});this.startup();if(this.create_link) {var table,tr,td;table=document.createElement("table");table.setAttribute("border","0");table.setAttribute("cellpadding","0");table.setAttribute("cellspacing","0");table.style.width="100%";tr=table.insertRow();td=tr.insertCell(0);array.forEach(this.domNode.childNodes,function(node) {if(node) {td.appendChild(node);}});this.create_link_node=document.createElement("div");this.create_link_node.style.cssText="padding: 5px 3px 1px !important;";this.create_link_node.className="right-create-link";this.create_link_node.innerHTML="";td=tr.insertCell(1);td.appendChild(this.create_link_node);this.create_link_node.onclick=function() {self.create_link_callback();};this.domNode.appendChild(table);}},create_link_callback:function() {},addLabel:function() {return this;},resizeLabel:function() {return this;}});});