// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://@sbaseurl@/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.

//>>built
require({cache:{"url:widgets/SmartEditor/setting/RelativeDomains.html":'\x3cdiv\x3e\r\n  \x3cfieldset class\x3d"esriCTFieldset"\x3e\r\n    \x3cdiv class\x3d"esriCTDomainFieldsHint"data-dojo-attach-point\x3d"domainFieldsHint"\x3e\x3c/div\x3e\r\n    \x3clegend class\x3d"esriCTLegendTitle"\x3e${nls.relativeDomains.fieldSetTitle}\x3c/legend\x3e\r\n    \x3cdiv class\x3d"esriCTTableParentContainer" data-dojo-attach-point\x3d"tableParentContainer"\x3e\r\n    \x3c/div\x3e\r\n  \x3c/fieldset\x3e\r\n\x3c/div\x3e'}});
define("dojo/_base/declare dojo/Evented dojo/_base/lang dojo/on dojo/text!./RelativeDomains.html dijit/_WidgetsInTemplateMixin dojo/_base/array jimu/BaseWidgetSetting jimu/dijit/Popup jimu/dijit/SimpleTable jimu/dijit/Message jimu/utils dojo/query dijit/focus dojo/string dojo/dom-attr dijit/form/DateTextBox dijit/form/TimeTextBox dijit/form/NumberTextBox".split(" "),function(k,l,f,m,n,p,g,q,r,t,u,h,v,w,x,y){return k([q,l,p],{baseClass:"jimu-widget-smartEditor-setting-relativeDomains",templateString:n,
domainObj:[],selectDomainValuePopup:null,validNumericData:["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble"],postCreate:function(){this.domainObj=[];this.selectDomainValuePopup=null;this._createDomainTable();this._createSelectValuePopUp();if(this.selectedDomainFields&&0<this.selectedDomainFields.length){var a=x.substitute(this.nls.relativeDomains.selectedDomainFieldsHint,{domainFields:this.selectedDomainFields.join(", ")});y.set(this.domainFieldsHint,
"innerHTML",a)}},postMixInProperties:function(){this.nls=f.mixin(this.nls,window.jimuNls.common)},_createDomainTable:function(){this._domainTable=new t({fields:[{name:"selectDomain",title:"",type:"checkbox",width:"10%"},{name:"domainValue",title:this.nls.relativeDomains.valueText,type:"text",width:"15%"},{name:"label",title:this.nls.label,type:"text",width:"55%"},{name:"defaultDomain",title:this.nls.relativeDomains.defaultText,type:"radio",width:"10%"},{name:"actions",title:this.nls.action,type:"actions",
width:"10%%",actions:["up","down"],"class":"actions"}],selectable:!1});this._domainTable.startup();this._domainTable.placeAt(this.tableParentContainer);this._setValues()},_createSelectValuePopUp:function(){this.selectDomainValuePopup=new r({titleLabel:this.nls.chooseFromLayer.selectValueLabel,width:800,height:500,autoHeight:!0,"class":this.baseClass,content:this,buttons:[{label:this.nls.ok,onClick:f.hitch(this,function(){var a=this._getValue();a&&(this.emit("updatePresetValue",a),this.selectDomainValuePopup.close())})},
{label:this.nls.cancel,classNames:["jimu-btn-vacation"],onClick:f.hitch(this,function(){this.selectDomainValuePopup.close()})}]})},_getValue:function(){var a="",b=[],e=this._domainTable.getData();if(this._isValidConfiguration(e))return g.forEach(e,f.hitch(this,function(c){var d={};d.showInList=c.selectDomain;d.value="esriFieldTypeString"!==this.dataType?Number(c.domainValue):c.domainValue;d.label=c.label;d.isDefault=c.defaultDomain;d.isDefault&&(a=c.label);b.push(d)})),{domainData:b,defaultValue:a};
new u({message:this.nls.relativeDomains.selectDefaultDomainMsg})},_setValues:function(){g.forEach(this.domainTableData,f.hitch(this,function(a){var b=this._domainTable.addRow({selectDomain:a.showInList,domainValue:""+a.value,label:a.label,defaultDomain:a.isDefault}).tr.cells[3].childNodes[0];var e=b.checked;this.own(m(b,"click",f.hitch(this,function(){e=e?b.checked=!1:b.checked=!0})))}))},_isValidConfiguration:function(a){var b=!1,e=!1,c=!1;g.some(a,f.hitch(this,function(d){d.defaultDomain&&(c=!0,
d.selectDomain&&(e=!0));d.selectDomain&&(b=!0)}));return c?c&&e:b?b:!1},_support508ForSelectValuePopUp:function(){var a=v(".jimu-btn-vacation",this.selectDomainValuePopup.domNode)[0];h.initFirstFocusNode(this.selectDomainValuePopup.domNode,this.selectDomainValuePopup.closeBtnNode);w.focus(this.selectDomainValuePopup.closeBtnNode);h.initLastFocusNode(this.selectDomainValuePopup.domNode,a)}})});