// 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/RelatedTableCharts/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,e,m,g,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,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(e(this.domNode,"click",d.hitch(this,function(a){a.stopPropagation();a.preventDefault();this._isTooltipDialogOpened?this._hideTooltipDialog():this._showTooltipDialog()})));this.own(e(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(f){var h=!0;this.showOnlyNumericFields&&0>this._numberFieldTypes.indexOf(f.type)&&(h=!1);if(h){h=f.alias+" {"+f.name+"}";var b=n.create("div",{innerHTML:h,style:{cursor:"pointer",padding:"4px 2px"}},c);g.set(b,"name",f.name);g.set(b,"alias",f.alias);e(b,"mouseover",d.hitch(this,function(){m.set(b,
"background-color","#e4e4e4")}));e(b,"mouseout",d.hitch(this,function(){m.set(b,"background-color","#FFFFFF")}));e(b,"click",d.hitch(this,function(){var l={};l.name=g.get(b,"name");l.alias=g.get(b,"alias");this.onSelect(l);this.hideOnSelect&&this._hideTooltipDialog()}))}}))}return c}})});