//>>built
require({cache:{"url:dijit/form/templates/Select.html":"
\n"}});
define("dijit/form/Select",["dojo/_base/array","dojo/_base/declare","dojo/dom-attr","dojo/dom-class","dojo/dom-geometry","dojo/i18n","dojo/keys","dojo/_base/lang","dojo/on","dojo/sniff","./_FormSelectWidget","../_HasDropDown","../DropDownMenu","../MenuItem","../MenuSeparator","../Tooltip","../_KeyNavMixin","../registry","dojo/text!./templates/Select.html","dojo/i18n!./nls/validate"],function(_1,_2,_3,_4,_5,_6,_7,_8,on,_9,_a,_b,_c,_d,_e,_f,_10,_11,_12){
var _13=_2("dijit.form._SelectMenu",_c,{autoFocus:true,buildRendering:function(){
this.inherited(arguments);
this.domNode.setAttribute("role","listbox");
},postCreate:function(){
this.inherited(arguments);
this.own(on(this.domNode,"selectstart",function(evt){
evt.preventDefault();
evt.stopPropagation();
}));
},focus:function(){
var _14=false,val=this.parentWidget.value;
if(_8.isArray(val)){
val=val[val.length-1];
}
if(val){
_1.forEach(this.parentWidget._getChildren(),function(_15){
if(_15.option&&(val===_15.option.value)){
_14=true;
this.focusChild(_15,false);
}
},this);
}
if(!_14){
this.inherited(arguments);
}
}});
var _16=_2("dijit.form.Select"+(_9("dojo-bidi")?"_NoBidi":""),[_a,_b,_10],{baseClass:"dijitSelect dijitValidationTextBox",templateString:_12,_buttonInputDisabled:_9("ie")?"disabled":"",required:false,state:"",message:"",tooltipPosition:[],emptyLabel:" ",_isLoaded:false,_childrenLoaded:false,labelType:"html",_fillContent:function(){
this.inherited(arguments);
if(this.options.length&&!this.value&&this.srcNodeRef){
var si=this.srcNodeRef.selectedIndex||0;
this._set("value",this.options[si>=0?si:0].value);
}
this.dropDown=new _13({id:this.id+"_menu",parentWidget:this});
_4.add(this.dropDown.domNode,this.baseClass.replace(/\s+|$/g,"Menu "));
},_getMenuItemForOption:function(_17){
if(!_17.value&&!_17.label){
return new _e({ownerDocument:this.ownerDocument});
}else{
var _18=_8.hitch(this,"_setValueAttr",_17);
var _19=new _d({option:_17,label:(this.labelType==="text"?(_17.label||"").toString().replace(/&/g,"&").replace(/"+lbl+"";
},validate:function(_2a){
var _2b=this.disabled||this.isValid(_2a);
this._set("state",_2b?"":(this._hasBeenBlurred?"Error":"Incomplete"));
this.focusNode.setAttribute("aria-invalid",_2b?"false":"true");
var _2c=_2b?"":this._missingMsg;
if(_2c&&this.focused&&this._hasBeenBlurred){
_f.show(_2c,this.domNode,this.tooltipPosition,!this.isLeftToRight());
}else{
_f.hide(this.domNode);
}
this._set("message",_2c);
return _2b;
},isValid:function(){
return (!this.required||this.value===0||!(/^\s*$/.test(this.value||"")));
},reset:function(){
this.inherited(arguments);
_f.hide(this.domNode);
this._refreshState();
},postMixInProperties:function(){
this.inherited(arguments);
this._missingMsg=_6.getLocalization("dijit.form","validate",this.lang).missingMessage;
},postCreate:function(){
this.inherited(arguments);
this.own(on(this.domNode,"selectstart",function(evt){
evt.preventDefault();
evt.stopPropagation();
}));
this.domNode.setAttribute("aria-expanded","false");
var _2d=this._keyNavCodes;
delete _2d[_7.LEFT_ARROW];
delete _2d[_7.RIGHT_ARROW];
},_setStyleAttr:function(_2e){
this.inherited(arguments);
_4.toggle(this.domNode,this.baseClass.replace(/\s+|$/g,"FixedWidth "),!!this.domNode.style.width);
},isLoaded:function(){
return this._isLoaded;
},loadDropDown:function(_2f){
this._loadChildren(true);
this._isLoaded=true;
_2f();
},destroy:function(_30){
if(this.dropDown&&!this.dropDown._destroyed){
this.dropDown.destroyRecursive(_30);
delete this.dropDown;
}
_f.hide(this.domNode);
this.inherited(arguments);
},_onFocus:function(){
this.validate(true);
},_onBlur:function(){
_f.hide(this.domNode);
this.inherited(arguments);
this.validate(false);
}});
if(_9("dojo-bidi")){
_16=_2("dijit.form.Select",_16,{_setDisplay:function(_31){
this.inherited(arguments);
this.applyTextDir(this.containerNode);
}});
}
_16._Menu=_13;
function _32(_33){
return function(evt){
if(!this._isLoaded){
this.loadDropDown(_8.hitch(this,_33,evt));
}else{
this.inherited(_33,arguments);
}
};
};
_16.prototype._onContainerKeydown=_32("_onContainerKeydown");
_16.prototype._onContainerKeypress=_32("_onContainerKeypress");
return _16;
});