/*!@license * Infragistics.Web.ClientUI infragistics.legend.js 19.1.20191.172 * * Copyright (c) 2011-2019 Infragistics Inc. * * http://www.infragistics.com/ * * Depends: * jquery-1.4.4.js * jquery.ui.core.js * jquery.ui.widget.js * infragistics.util.js * infragistics.ext_core.js * infragistics.ext_collections.js * infragistics.dv_core.js * infragistics.dv_visualdata.js * infragistics.ext_ui.js */ (function(factory){if(typeof define==="function"&&define.amd){define(["./infragistics.util","./infragistics.ext_core","./infragistics.ext_collections","./infragistics.dv_core","./infragistics.dv_visualdata","./infragistics.ext_ui"],factory)}else{factory(igRoot)}})(function($){$.ig=$.ig||{};var $$t={};$.ig.globalDefs=$.ig.globalDefs||{};$.ig.globalDefs.$$p=$$t;$$0=$.ig.globalDefs.$$0;$$4=$.ig.globalDefs.$$4;$$1=$.ig.globalDefs.$$1;$$w=$.ig.globalDefs.$$w;$$ap=$.ig.globalDefs.$$ap;$$6=$.ig.globalDefs.$$6;$$a=$.ig.globalDefs.$$a;$.ig.$currDefinitions=$$t;$.ig.util.bulkDefine(["LegendBaseViewManager:b","LegendMouseEventHandler:d","LegendMouseButtonEventHandler:f","ItemLegend:g","Legend:h","LegendBase:k","FinancialLegend:l","ScaleLegend:m","ItemLegendView:n","LegendBaseView:o","LegendView:p","FinancialLegendView:q","ScaleLegendView:r"]);var $a=$.ig.intDivide,$b=$.ig.util.cast,$c=$.ig.util.defType,$d=$.ig.util.defEnum,$e=$.ig.util.getBoxIfEnum,$f=$.ig.util.getDefaultValue,$g=$.ig.util.getEnumValue,$h=$.ig.util.getValue,$i=$.ig.util.intSToU,$j=$.ig.util.nullableEquals,$k=$.ig.util.nullableIsNull,$l=$.ig.util.nullableNotEquals,$m=$.ig.util.toNullable,$n=$.ig.util.toString$1,$o=$.ig.util.u32BitwiseAnd,$p=$.ig.util.u32BitwiseOr,$q=$.ig.util.u32BitwiseXor,$r=$.ig.util.u32LS,$s=$.ig.util.unwrapNullable,$t=$.ig.util.wrapNullable,$u=String.fromCharCode,$v=$.ig.util.castObjTo$t,$w=$.ig.util.compare,$x=$.ig.util.replace,$y=$.ig.util.stringFormat,$z=$.ig.util.stringFormat1,$0=$.ig.util.stringFormat2,$1=$.ig.util.stringCompare1,$2=$.ig.util.stringCompare2,$3=$.ig.util.stringCompare3,$4=$.ig.util.compareSimple,$5=$.ig.util.tryParseNumber,$6=$.ig.util.tryParseNumber1,$7=$.ig.util.numberToString,$8=$.ig.util.numberToString1,$9=$.ig.util.parseNumber;$d("LegendOrientation:i",false,false,{Horizontal:0,Vertical:1});$c("LegendBaseViewManager:b","Object",{a:null,init:function(a){this.g=null;this.d=false;$.ig.$op.init.call(this);this.a=a;this._f=new $$4.h($.ig.$op.$type,$$1.$h.$type,0);this.q()},g:null,q:function(){var $self=this;if(this.g==null){this.g=function(a){var b=$.ig.LegendItemHelper.prototype.b();if(window.devicePixelRatio!=window.undefined&&($.ig.util.isNaN(b)||window.devicePixelRatio!=b)){$.ig.LegendItemHelper.prototype.b(window.devicePixelRatio);$self.a.aj()}};window.addEventListener("resize",this.g,false)}this.g(null)},t:function(a){if(a==null){if(this.g!=null){window.removeEventListener("resize",this.g,false);this.g=null}this._m=null;this._h=null;return}this._h=a;this._m=this.j();this._m.addClass(this.a._s);this._h.append(this._m)},j:function(){return this._h.createElement("table")},_m:null,_h:null,d:false,i:function(){var a=this._h.createElement("tr");a.addClass(this.a._t);var b=this.a.k();if(b){a.setStyleProperty("display","block");a.setStyleProperty("float","left");a.setStyleProperty("margin","0px");a.setStyleProperty("margin-right","8px")}return a},k:function(a){return this.l(a,this._m)},l:function(a,b){var c=$b($$a.$g.$type,a);var d=this.i();if(c!=null){var e=$b($.ig.ILegendContext.prototype.$type,c.content());if(e!=null&&c._ah!=null){var f=new $$a.l;f.context=d;f.passID="LegendItem";var g=new $$a.m;g.passInfo=f;g.width=NaN;g.height=NaN;g.data=e;g.context=d;var h=new $$a.n;h.passInfo=f;if(c._ah.measure()!=null){c._ah.measure()(g)}h.context=this._h.getSubRenderer(d);h.availableWidth=g.width;h.availableHeight=g.height;h.data=e;h.xPosition=0;h.yPosition=0;c._ah.render()(h);var i=d.findByClass(".ui-legend-item-badge");for(var j=0;j=this._m.getChildCount()){this._m.append(c)}else{var d=this._m.getChildAt(b);d.before(c)}},v:function(a){},w:function(a){var $self=this;var b;if(function(){var c=$self._f.tryGetValue(a,b);b=c.p1;return c.ret}()){b.unlistenAll();b.remove();this._f.remove(a)}},o:function(visual_){var a=this._f.getEnumerator();while(a.moveNext()){var pair_=a.current();if(pair_.value().getNativeElement()===visual_){return pair_.key()}}return null},e:function(a){var c=this._f.keys().getEnumerator();while(c.moveNext()){var b=c.current();var d=$b($$a.$g.$type,b);if(d!=null&&d.content()!=null){var e=$b($.ig.ILegendContext.prototype.$type,d.content());if(e!=null&&e.itemLabel()==a.itemLabel()&&e.legendLabel()==a.legendLabel()&&e.series()==a.series()&&e.itemBrush()==a.itemBrush()){return true}}}return false},_n:null,_c:null,b:function(a){var b=this._h.rootWrapper().width();var c=this._h.rootWrapper().height();this._m.remove();var d=this._h.createElement("div");d.setStyleProperty("position","relative");this._n=this._h.createElement('');this._n.setStyleProperty("position","absolute");this._n.setStyleProperty("top","0px");this._n.setStyleProperty("left","0px");this._h.append(d);d.append(this._n);this._c=new $.ig.RenderingContext(new $.ig.CanvasViewRenderer,this._h.get2DCanvasContext(this._n));this._n.setAttribute("width",b.toString());this._n.setAttribute("height",c.toString());return this._c},aa:function(){return new $$a.af(1,this._h.rootWrapper().width(),Math.max(10,this._h.rootWrapper().height()-15))},x:function(a,b,c,d){var e=a.g();e.beginPath();e.moveTo(b._aj.__inner[0].__x,b._aj.__inner[0].__y);for(var f=1;f0?b[0]:null;return c!=null?new $.ig.RectData(c.getOffset().left,c.getOffset().top,c.width(),c.height()):null},a:function(a){if(this._b==null||this._b.children()==null||this._b.children().count()<=a){return null}var b=this._b.children().__inner[a];if(b==null){return null}var c=b.content();if(c==null){return null}var d=c.actualItemBrush()!=null?c.actualItemBrush():c.itemBrush();return $.ig.AppearanceHelper.prototype.b(d)},f:function(){var a=new $$t.w;var b=this._c._m;var c=b.getChildCount();for(var d=0;d=this._a9.width()){d=0}var e=this._a9.width()-d;var f=2;var g=2;e=e-4;var h=this._a9.height()-4;var i=f+e+4;var j=g;var k=h;var l={__x:f+3/5*e,__y:g,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName};var m={__x:f+5/5*e,__y:g,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName};var n={__x:f+5/5*e,__y:h,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName};var o={__x:f,__y:h,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName};var p=this._a8;p._aj.clear();p._aj.add(l);p._aj.add(m);p._aj.add(n);p._aj.add(o);this._a4._n=i;this._a4._o=j;this._a4._am=this._a6;this._a3._n=i;this._a3._o=j+k-this.ar(this._a4);this._a3._am=this._a6;this._ao.k(0,0,this._a9.width(),this._a9.height());if(this._am==null&&this._a5!=null){p.__fill=this._a5;this._ao.t(p)}else{this._c.x(this._ao,p,this._am,new $$a.ae(0,g,f,e,h))}if(d>0){this._ao.w(this._a4);this._ao.w(this._a3)}}},_a5:null,aj:function(){$$t.$o.aj.call(this)},$type:new $.ig.Type("ScaleLegendView",$$t.$o.$type)},true);$c("GradientData:s","Object",{init:function(){$.ig.$op.init.call(this);this._a=new $$4.x($$t.$t.$type,0)},_a:null,b:function(){this._a.sort2(function(a,b){return $4(a._a,b._a)})},$type:new $.ig.Type("GradientData",$.ig.$ot)},true);$c("GradientStopData:t","Object",{init:function(){$.ig.$op.init.call(this)},_a:0,_b:null,$type:new $.ig.Type("GradientStopData",$.ig.$ot)},true);$c("LegendItemVisualData:u","Object",{init:function(){$.ig.$op.init.call(this);this.labelBounds($.ig.RectData.prototype.empty());this.appearance(new $.ig.PrimitiveAppearanceData)},_label:null,label:function(a){if(arguments.length===1){this._label=a;return a}else{return this._label}},_labelBounds:null,labelBounds:function(a){if(arguments.length===1){this._labelBounds=a;return a}else{return this._labelBounds}},_appearance:null,appearance:function(a){if(arguments.length===1){this._appearance=a;return a}else{return this._appearance}},_labelAppearance:null,labelAppearance:function(a){if(arguments.length===1){this._labelAppearance=a;return a}else{return this._labelAppearance}},_bounds:null,bounds:function(a){if(arguments.length===1){this._bounds=a;return a}else{return this._bounds}},_badgeBounds:null,badgeBounds:function(a){if(arguments.length===1){this._badgeBounds=a;return a}else{return this._badgeBounds}},serialize:function(){var a=new $$6.aj(0);a.u("{");if(this.label()!=null){a.u('label: "'+this.label()+'", ')}if(this.appearance()!=null){a.u("appearance: "+this.appearance().serialize()+", ")}if(this.labelAppearance()!=null){a.u("labelAppearance: "+this.labelAppearance().serialize()+", ")}var b=function(c){return"{ left: "+c.left()+", top: "+c.top()+", width: "+c.width()+", height: "+c.height()+"}"};a.q("bounds: {0},\r\n",b(this.bounds()));a.q("badgeBounds: {0},\r\n",b(this.badgeBounds()));a.q("labelBounds: {0}\r\n",b(this.labelBounds()));a.u("}");return a.toString()},$type:new $.ig.Type("LegendItemVisualData",$.ig.$ot)},true);$c("LegendVisualDataList:v","List$1",{init:function(){$$4.$x.init.call(this,$$t.$u.$type,0)},$type:new $.ig.Type("LegendVisualDataList",$$4.$x.$type.specialize($$t.$u.$type))},true);$c("LegendVisualData:w","Object",{init:function(){$.ig.$op.init.call(this);this.items(new $$t.v)},_items:null,items:function(a){if(arguments.length===1){this._items=a;return a}else{return this._items}},_viewport:null,viewport:function(a){if(arguments.length===1){this._viewport=a;return a}else{return this._viewport}},_width:0,width:function(a){if(arguments.length===1){this._width=a;return a}else{return this._width}},_height:0,height:function(a){if(arguments.length===1){this._height=a;return a}else{return this._height}},serialize:function(){var a=new $$6.aj(0);a.u("{");a.u("width: "+this.width()+",");a.u("height: "+this.height()+",");a.u("items: [");for(var b=0;b