// 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/NetworkTrace/setting/FieldSelector.html":'\x3cdiv\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"showFieldsButton" class\x3d"jimu-icon jimu-icon-add esriCTHover"\x3e\r\n    \x3c/div\x3e\r\n\x3c/div\x3e\r\n'}});
define("dojo/_base/declare jimu/BaseWidgetSetting dijit/_WidgetsInTemplateMixin dojo/text!./FieldSelector.html dijit/TooltipDialog dijit/popup dojo/_base/lang dojo/_base/html dojo/on dojo/dom-style dojo/dom-attr dojo/dom-construct dojo/_base/array".split(" "),function(p,q,r,t,u,k,d,v,f,m,h,n,w){return p([q,r],{baseClass:"jimu-widget-RelatedTableCharts-setting",templateString:t,_stringFieldType:"esriFieldTypeString",_oidFieldType:"esriFieldTypeOID",_numberFieldTypes:["esriFieldTypeSmallInteger","esriFieldTypeInteger",
"esriFieldTypeSingle","esriFieldTypeDouble"],_isTooltipDialogOpened:!1,fields:[],hideOnSelect:!1,showOnlyNumericFields:!1,skipObjectIdField:!1,startup:function(){this.inherited(arguments)},postCreate:function(){this._createTooltipDialog(this.domNode);this._hideTooltipDialog()},destroy:function(){k.close(this.tooltipDialog);this.tooltipDialog.destroy();this.inherited(arguments)},isPartOfPopup:function(c){var a=this.tooltipDialog.domNode;return c===a||v.isDescendant(c,a)},onSelect:function(c){},_showTooltipDialog:function(){k.open({parent:this.getParent(),
popup:this.tooltipDialog,around:this.domNode});this._isTooltipDialogOpened=!0},_hideTooltipDialog:function(){k.close(this.tooltipDialog);this._isTooltipDialogOpened=!1},_createTooltipDialog:function(){var c=this._createFieldList();this.tooltipDialog=new u({content:c});this.own(f(this.domNode,"click",d.hitch(this,function(a){a.stopPropagation();a.preventDefault();this._isTooltipDialogOpened?this._hideTooltipDialog():this._showTooltipDialog()})));this.own(f(document.body,"click",d.hitch(this,function(a){this.isPartOfPopup(a.target||
a.srcElement)||this._hideTooltipDialog()})))},_createFieldList:function(){var c=n.create("div",{style:{"max-height":"150px",overflow:"auto"}});if(this.fields){var a=d.clone(this.fields);w.forEach(a,d.hitch(this,function(e){var g=!0;this.showOnlyNumericFields&&0>this._numberFieldTypes.indexOf(e.type)&&(g=!1);this.skipObjectIdField&&e.type===this._oidFieldType&&(g=!1);if(g){g=e.alias+" {"+e.name+"}";var b=n.create("div",{innerHTML:g,style:{cursor:"pointer",padding:"4px 2px"}},c);h.set(b,"name",e.name);
h.set(b,"alias",e.alias);f(b,"mouseover",d.hitch(this,function(){m.set(b,"background-color","#e4e4e4")}));f(b,"mouseout",d.hitch(this,function(){m.set(b,"background-color","#FFFFFF")}));f(b,"click",d.hitch(this,function(){var l={};l.name=h.get(b,"name");l.alias=h.get(b,"alias");this.onSelect(l);this.hideOnSelect&&this._hideTooltipDialog()}))}}))}return c}})});