//>>built
require({cache:{"url:mill/jssupport/form/filteringSelectField.html":'\x3cdiv\x3e\x3cdiv data-dojo-type\x3d"office.layout.GridLayoutColumn" data-dojo-props\x3d"piece: \'${textPiece}\'" data-dojo-attach-point\x3d"textColumnNode" class\x3d"cell"\x3e\x3cdiv data-dojo-type\x3d"office.TranslatableNode" data-dojo-props\x3d"display: \'inline\'" data-dojo-attach-point\x3d"translatableNode"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv data-dojo-type\x3d"office.layout.GridLayoutColumn" data-dojo-props\x3d"piece: \'${controlPiece}\'" class\x3d"cell"\x3e\x3cdiv data-dojo-type\x3d"office.form.FilteringSelectWidget" data-dojo-props\x3d"type: \'${type}\'" data-dojo-attach-point\x3d"controlNode" data-dojo-observer\x3d"${observer}" class\x3d"controlNode"\x3e\x3c/div\x3e\x3cdiv data-dojo-attach-point\x3d"unhideContainerNode" class\x3d"dim small"\x3e\x3c/div\x3e\x3cdiv data-dojo-attach-point\x3d"containerNode" class\x3d"dim small"\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e'}});
define("mill/jssupport/form/FilteringSelectField","dojo/_base/declare dojo/_base/lang dojo/_base/Deferred dojo/dom-style dojo/dom-construct dojo/dom-class dijit/form/FilteringSelect dojo/text!mill/jssupport/form/filteringSelectField.html mill/jssupport/form/TextField mill/jssupport/form/_TextFieldWidgetMixin mill/jssupport/base".split(" "),function(e,c,f,g,h,k,l,m,n,p,q){e("office.form.FilteringSelectWidget",[l,p],{required:!1,searchAttrObject:null,preventFetchPropertiesModify:null,onHideForValue:new Function,
postMixInProperties:function(){this.inherited(arguments);this.searchAttrObject=this.searchAttrObject||{RU:"Description",EN:"EngDescription"}},_setSearchAttrObjectAttr:function(a){this.searchAttrObject=a;this._updateSearchAttr()},_getSearchAttr:function(){return c.isObject(this.searchAttrObject)?this.searchAttrObject[q.locale.toUpperCase()]||"Description":c.isString(this.searchAttrObject)?this.searchAttrObject:"Description"},_updateSearchAttr:function(){this.set("searchAttr",this._getSearchAttr());
this.preventFetchPropertiesModify||this.set("fetchProperties",{sort:[{attribute:this._getSearchAttr(),descending:!1}]})},updateItem:function(a){var b=new f;if(a=a||this.value){var d=this.store.query({ID:a});c.isArray(d)&&!d.length&&(d=this.store.query({ID:parseInt(a)}));c.isArray(d)?(this.set("item",d[0]||null),b.resolve()):d.then(c.hitch(this,function(r){this.set("item",r[0]||null);this.get("displayedValue")||this.set("item",null);b.resolve()}),b.reject)}else b.resolve();return b.promise},translate:function(){this.inherited(arguments);
this._updateSearchAttr();this.updateItem()},_createSavedValueNode:function(){h.destroy(this._savedValueNode);this._savedValueNode=h.create("span",{innerHTML:this._savedValue?this.get("displayedValue"):"",className:"dim bold"},this.domNode.parentNode,"first");this._changed&&k.add(this._savedValueNode,["blue","italic"]);var a=this.getFieldWidget();a&&g.set(a.containerNode,{display:"none"});this.onHideForValue(this._savedValueNode)},hideForValue:function(a){var b=new f;if(a||"string"===typeof a)this._savedValue&&
(this._changed=a!==this._savedValue),this._savedValue=a;this&&c.isObject(this)&&this.domNode&&(g.set(this.domNode,{display:"none"}),this._updateSearchAttr(),this.updateItem(this._savedValue).then(c.hitch(this,function(){this._createSavedValueNode();b.resolve()})));return b.promise}});return mill.registerAlias("office.form.FilteringSelectField",e("mill.jssupport.form.FilteringSelectField",[n],{templateString:m,store:null,searchAttrObject:null,_setStoreAttr:function(a){this.controlNode.set("store",
this.store=a)},_setSearchAttrObjectAttr:function(a){this.controlNode.set("searchAttrObject",this.searchAttrObject=a)}}))});