Socket
Socket
Sign inDemoInstall

@syncfusion/ej2-svg-base

Package Overview
Dependencies
Maintainers
2
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@syncfusion/ej2-svg-base - npm Package Compare versions

Comparing version 16.2.46 to 16.2.47

8

CHANGELOG.md
# Changelog
## [Unreleased]
## [Unreleased]
### Tooltip
#### Bug Fixes
- Removed measure text element from the DOM.

4

dist/ej2-svg-base.umd.min.js
/*!
* filename: ej2-svg-base.umd.min.js
* version : 16.2.46
* version : 16.2.47
* Copyright Syncfusion Inc. 2001 - 2018. All rights reserved.

@@ -10,3 +10,3 @@ * Use of this code is subject to the terms of our license.

*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@syncfusion/ej2-base")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base"],e):e(t.ej={},t.ej2Base)}(this,function(t,e){"use strict";function i(t){var e;switch(t){case"Highcontrast":e={tooltipFill:"#ffffff",tooltipBoldLabel:"#000000",tooltipLightLabel:"#000000",tooltipHeaderLine:"#969696"};break;default:e={tooltipFill:"rgba(0, 8, 22, 0.75)",tooltipBoldLabel:"#ffffff",tooltipLightLabel:"#dbdbdb",tooltipHeaderLine:"#ffffff"}}return e}function o(t,i){var o=document.getElementById("chartmeasuretext");return null===o&&(o=e.createElement("text",{id:"chartmeasuretext"}),document.body.appendChild(o)),o.innerHTML=t,o.style.position="absolute",o.style.fontSize=i.size,o.style.fontWeight=i.fontWeight,o.style.fontStyle=i.fontStyle,o.style.fontFamily=i.fontFamily,o.style.visibility="hidden",o.style.top="-100",o.style.left="0",o.style.whiteSpace="nowrap",o.style.lineHeight="normal",new h(o.clientWidth,o.clientHeight)}function r(t){return document.getElementById(t)}function n(t){var i=r(t);i&&e.remove(i)}function a(t,i,o,r,n,a){var s=new e.SvgRenderer(""),h=function(t,i,o,r,n){var a,s="Path",h=i.width,p=i.height,d=t.x,l=t.y,c=t.x+-h/2,y=t.y+-p/2;switch(o){case"Circle":case"Bubble":s="Ellipse",e.merge(r,{rx:h/2,ry:p/2,cx:d,cy:l});break;case"Cross":a="M "+c+" "+l+" L "+(d+h/2)+" "+l+" M "+d+" "+(l+p/2)+" L "+d+" "+(l+-p/2),e.merge(r,{d:a});break;case"HorizontalLine":a="M "+c+" "+l+" L "+(d+h/2)+" "+l,e.merge(r,{d:a});break;case"VerticalLine":a="M "+d+" "+(l+p/2)+" L "+d+" "+(l+-p/2),e.merge(r,{d:a});break;case"Diamond":a="M "+c+" "+l+" L "+d+" "+(l+-p/2)+" L "+(d+h/2)+" "+l+" L "+d+" "+(l+p/2)+" L "+c+" "+l+" z",e.merge(r,{d:a});break;case"Rectangle":a="M "+c+" "+(l+-p/2)+" L "+(d+h/2)+" "+(l+-p/2)+" L "+(d+h/2)+" "+(l+p/2)+" L "+c+" "+(l+p/2)+" L "+c+" "+(l+-p/2)+" z",e.merge(r,{d:a});break;case"Triangle":a="M "+c+" "+(l+p/2)+" L "+d+" "+(l+-p/2)+" L "+(d+h/2)+" "+(l+p/2)+" L "+c+" "+(l+p/2)+" z",e.merge(r,{d:a});break;case"InvertedTriangle":a="M "+(d+h/2)+" "+(l-p/2)+" L "+d+" "+(l+p/2)+" L "+(d-h/2)+" "+(l-p/2)+" L "+(d+h/2)+" "+(l-p/2)+" z",e.merge(r,{d:a});break;case"Pentagon":for(var u=void 0,f=void 0,m=0;m<=5;m++)u=h/2*Math.cos(Math.PI/180*(72*m)),f=p/2*Math.sin(Math.PI/180*(72*m)),a=0===m?"M "+(d+u)+" "+(l+f)+" ":a.concat("L "+(d+u)+" "+(l+f)+" ");a=a.concat("Z"),e.merge(r,{d:a});break;case"Image":s="Image",e.merge(r,{href:n,height:p,width:h,x:c,y:y})}return{renderOption:r,functionName:s}}(t,o,i,n,r),p=s["draw"+h.functionName](h.renderOption);return p.setAttribute("aria-label",a),p}var s=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),h=function(){return function(t,e){this.width=t,this.height=e}}(),p=function(){return function(t,e,i,o){this.x=t,this.y=e,this.width=i,this.height=o}}(),d=function(){return function(t,e){this.isRight=e,this.isBottom=t}}(),l=function(){return function(t){this.id=t}}(),c=function(t){function e(e,i,o,r,n,a,s){void 0===a&&(a="");var h=t.call(this,e)||this;return h.transform="",h.baseLine="auto",h.x=i,h.y=o,h.anchor=r,h.text=n,h.transform=a,h.baseLine=s,h}return s(e,t),e}(l),y=function(t){function e(e,i,o,r,n,a,s){var h=t.call(this,e)||this;return h.opacity=n,h.fill=i,h.stroke=r,h["stroke-width"]=o,h["stroke-dasharray"]=a,h.d=s,h}return s(e,t),e}(l),u=function(){return function(t,e){this.x=t,this.y=e}}(),f=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),m=function(t,e,i,o){var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a},g=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return f(i,t),m([e.Property(null)],i.prototype,"size",void 0),m([e.Property("")],i.prototype,"color",void 0),m([e.Property("Segoe UI")],i.prototype,"fontFamily",void 0),m([e.Property("Normal")],i.prototype,"fontWeight",void 0),m([e.Property("Normal")],i.prototype,"fontStyle",void 0),m([e.Property(1)],i.prototype,"opacity",void 0),i}(e.ChildProperty),v=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return f(i,t),m([e.Property("")],i.prototype,"color",void 0),m([e.Property(1)],i.prototype,"width",void 0),i}(e.ChildProperty),x=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return f(i,t),m([e.Property(0)],i.prototype,"x",void 0),m([e.Property(0)],i.prototype,"y",void 0),m([e.Property(0)],i.prototype,"width",void 0),m([e.Property(0)],i.prototype,"height",void 0),i}(e.ChildProperty),w=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return f(i,t),m([e.Property(0)],i.prototype,"x",void 0),m([e.Property(0)],i.prototype,"y",void 0),i}(e.ChildProperty),b=function(t){function s(e,i){return t.call(this,e,i)||this}return f(s,t),s.prototype.preRender=function(){this.initPrivateVariable(),this.removeSVG(),this.createTooltipElement()},s.prototype.initPrivateVariable=function(){this.renderer=new e.SvgRenderer(this.element.id),this.themeStyle=i(this.theme),this.formattedText=[],this.padding=5,this.isFirst=!0,this.markerPoint=[]},s.prototype.removeSVG=function(){var t=document.getElementById(this.element.id+"_svg"),i=document.getElementById(this.element.id+"parent_template");t&&t.parentNode&&e.remove(t),i&&i.parentNode&&e.remove(i)},s.prototype.render=function(){if(this.fadeOuted=!1,this.template)this.updateTemplateFn(),this.createTemplate(this.areaBounds,this.location);else{this.renderText(this.isFirst);var t={cancel:!1,name:"tooltipRender",tooltip:this};this.trigger("tooltipRender",t);var e=this.renderTooltipElement(this.areaBounds,this.location);this.drawMarker(e.isBottom,e.isRight,this.markerSize)}this.trigger("loaded",{tooltip:this})},s.prototype.createTooltipElement=function(){if(this.textElements=[],!this.template||this.shared){var t=this.renderer.createSvg({id:this.element.id+"_svg"});this.element.appendChild(t);var e=this.renderer.createGroup({id:this.element.id+"_group"});t.appendChild(e);var i=this.renderer.drawPath({id:this.element.id+"_path","stroke-width":this.border.width,fill:this.fill||this.themeStyle.tooltipFill,opacity:this.opacity,stroke:this.border.color});e.appendChild(i)}},s.prototype.drawMarker=function(t,e,i){if(this.shapes.length<=0)return null;for(var o,n=0,s=this.renderer.createGroup({id:this.element.id+"_trackball_group"}),p=r(this.element.id+"_group"),d=2*this.marginX+i/2+(e?this.arrowPadding:0),l=0,c=this.shapes;l<c.length;l++){var f=c[l];o=new y(this.element.id+"_Trackball_"+n,this.palette[n],1,"#cccccc",1,null),s.appendChild(a(new u(d,this.markerPoint[n]-this.padding+(t?this.arrowPadding:0)),f,new h(i,i),"",o,null)),n++}p.appendChild(s)},s.prototype.renderTooltipElement=function(t,i){var n,a=r(this.element.id),s=new u(0,0),h=new u(0,0),l=r(this.element.id+"_svg"),c=r(this.element.id+"_group"),y=r(this.element.id+"_path"),f=!1,m=!1,g=!1,v=0,x=0;if(this.tipRadius=1,""!==this.header&&(this.elementSize.height+=this.marginY),this.content.length>1?(n=this.sharedTooltipLocation(t,this.location.x,this.location.y),f=!0):(n=this.tooltipLocation(t,i,s,h),this.inverted?v=(m=n.x<i.x+this.clipBounds.x)?0:this.arrowPadding:(g=!(f=n.y<i.y+this.clipBounds.y),x=f?0:this.arrowPadding)),""!==this.header){var w=o(this.header,this.textStyle).height+2*this.marginY+(g?this.arrowPadding:0),b="M "+(3*this.marginX+(m||f||g?0:this.arrowPadding))+" "+w+"L "+(n.width+(m||f||g?0:this.arrowPadding)-2*this.marginX)+" "+w,P=this.renderer.drawPath({id:this.element.id+"_header_path","stroke-width":1,fill:null,opacity:.8,stroke:this.themeStyle.tooltipHeaderLine,d:b});c.appendChild(P)}var L=this.border.width/2,S=new p(L+v,L+x,n.width-L,n.height-L);if(c.setAttribute("opacity","1"),!this.enableAnimation||this.shared||this.isFirst?this.updateDiv(a,n.x,n.y):this.animateTooltipDiv(a,n),l.setAttribute("height",(n.height+this.border.width+(this.inverted?0:this.arrowPadding)).toString()),l.setAttribute("width",(n.width+this.border.width+(this.inverted?this.arrowPadding:0)).toString()),l.setAttribute("opacity","1"),y.setAttribute("d",function(t,e,i,o,r,n,a,s,h,p,d){var l="",c=i.x,y=i.y,u=i.x+i.width,f=i.y+i.height;return d=d||0,n?(l=(l=l.concat("M "+c+" "+(y+e)+" Q "+c+" "+y+" "+(c+t)+" "+y+" L "+(u-t)+" "+y+" Q "+u+" "+y+" "+u+" "+(y+e))).concat(" L "+u+" "+(f-e)+" Q "+u+" "+f+" "+(u-t)+" "+f),0!==r&&(l=(l=l.concat(" L "+(o.x+r/2)+" "+f)).concat(" L "+(h+d)+" "+(f+r-d)),l+=" Q "+h+" "+(f+r)+" "+(h-d)+" "+(f+r-d)),l=o.x-r/2>c?l.concat(" L "+(o.x-r/2)+" "+f+" L "+(c+t)+" "+f+" Q "+c+" "+f+" "+c+" "+(f-e)+" z"):0===r?l.concat(" L "+(c+t)+" "+f+" Q "+c+" "+f+" "+c+" "+(f-e)+" z"):l.concat(" L "+c+" "+(f+e)+" z")):a?(l=(l=l.concat("M "+c+" "+(y+e)+" Q "+c+" "+y+" "+(c+t)+" "+y+" L "+(o.x-r/2)+" "+y)).concat(" L "+(h-d)+" "+(o.y+d)),l=(l=(l+=" Q "+h+" "+o.y+" "+(h+d)+" "+(o.y+d)).concat(" L "+(o.x+r/2)+" "+y+" L "+(u-t)+" "+y+" Q "+u+" "+y+" "+u+" "+(y+e))).concat(" L "+u+" "+(f-e)+" Q "+u+" "+f+" "+(u-t)+" "+f+" L "+(c+t)+" "+f+" Q "+c+" "+f+" "+c+" "+(f-e)+" z")):s?(l=(l=(l=l.concat("M "+c+" "+(y+e)+" Q "+c+" "+y+" "+(c+t)+" "+y)).concat(" L "+(u-t)+" "+y+" Q "+u+" "+y+" "+u+" "+(y+e)+" L "+u+" "+(o.y-r/2))).concat(" L "+(u+r-d)+" "+(p-d)),l=(l=(l+=" Q "+(u+r)+" "+p+" "+(u+r-d)+" "+(p+d)).concat(" L "+u+" "+(o.y+r/2)+" L "+u+" "+(f-e)+" Q "+u+" "+f+" "+(u-t)+" "+f)).concat(" L "+(c+t)+" "+f+" Q "+c+" "+f+" "+c+" "+(f-e)+" z")):(l=(l=l.concat("M "+(c+t)+" "+y+" Q "+c+" "+y+" "+c+" "+(y+e)+" L "+c+" "+(o.y-r/2))).concat(" L "+(c-r+d)+" "+(p-d)),l=(l=(l+=" Q "+(c-r)+" "+p+" "+(c-r+d)+" "+(p+d)).concat(" L "+c+" "+(o.y+r/2)+" L "+c+" "+(f-e)+" Q "+c+" "+f+" "+(c+t)+" "+f)).concat(" L "+(u-t)+" "+f+" Q "+u+" "+f+" "+u+" "+(f-e)+" L "+u+" "+(y+e)+" Q "+u+" "+y+" "+(u-t)+" "+y+" z")),l}(this.rx,this.ry,S,s,this.arrowPadding,f,g,m,h.x,h.y,this.tipRadius)),this.enableShadow){y.setAttribute("filter",e.Browser.isIE?"":"url(#chart_shadow_tooltip)");var _='<filter id="chart_shadow_tooltip" height="130%"><feGaussianBlur in="SourceAlpha" stdDeviation="3"/>';_+='<feOffset dx="3" dy="3" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="0.5"/>',_+='</feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter>';var T=this.renderer.createDefs();T.setAttribute("id","SVG_tooltip_definition"),c.appendChild(T),T.innerHTML=_}return y.setAttribute("stroke",this.border.color),this.changeText(new u(v,x),g,!m&&!f&&!g,n),new d(g,!m&&!f&&!g)},s.prototype.changeText=function(t,e,i,o){var r=document.getElementById(this.element.id+"_text");e&&r.setAttribute("transform","translate(0,"+this.arrowPadding+")"),i&&r.setAttribute("transform","translate("+this.arrowPadding+" 0)")},s.prototype.findFormattedText=function(){this.formattedText=[],""!==this.header.replace(/<b>/g,"").replace(/<\/b>/g,"").trim()&&(this.formattedText=this.formattedText.concat(this.header)),this.formattedText=this.formattedText.concat(this.content)},s.prototype.renderText=function(t){var i,a,s,p,d=0,l=0,y=0,u=e.extend({},this.textStyle,null,!0).properties,f=r(this.element.id+"_group"),m="";this.findFormattedText();var g=this.header.replace(/<b>/g,"").replace(/<\/b>/g,"").trim(),v=""!==g?this.marginY:0,x=!0,w=!0;this.markerPoint=[];var b=this.shapes.length>0?10:0,P=this.shapes.length>0?5:0,L=22/parseFloat("13px")*parseFloat(u.size);t||(n(this.element.id+"_text"),n(this.element.id+"_header_path"),n(this.element.id+"_trackball_group"),n("SVG_tooltip_definition"));for(var S=new c(this.element.id+"_text",2*this.marginX,2*this.marginY+2*this.padding+(2===this.marginY?3:0),"start",""),_=function(t,i,o,r){var n,a,s={},h=new e.SvgRenderer("");return s={id:t.id,x:t.x,y:t.y,fill:o,"font-size":i.size,"font-style":i.fontStyle,"font-family":i.fontFamily,"font-weight":i.fontWeight,"text-anchor":t.anchor,transform:t.transform,opacity:i.opacity,"dominant-baseline":t.baseLine},a="string"==typeof t.text?t.text:t.text[0],n=h.createText(s,a),r.appendChild(n),n}(S,u,null,f),T=0,C=this.formattedText.length;T<C;T++){var z=this.formattedText[T].replace(/<(b|strong)>/g,"<b>").replace(/<\/(b|strong)>/g,"</b>").split(/<br.*?>/g);o(this.formattedText[T],u),0===T&&""!==g||this.markerPoint.push((""!==g?this.marginY:0)+S.y+d);for(var A=0,M=z.length;A<M;A++){y=0,w=!0,d+=L;for(var k=0,B=(i=z[A].replace(/<b>/g,"<br><b>").replace(/<\/b>/g,"</b><br>").split("<br>")).length;k<B;k++)""!==(s=i[k]).replace(/<b>/g,"").replace(/<\/b>/g,"").trim()&&(y+=4,w&&!x?(p={x:2*this.marginX+(b+P),dy:L+(w?v:0),fill:""},v=null):p=x&&w?{x:""===g?2*this.marginX+(b+P):2*this.marginX}:{},w=!1,a=this.renderer.createTSpan(p,""),_.appendChild(a),s.indexOf("<b>")>-1?(m="font-weight:bold",u.fontWeight="bold",a.setAttribute("fill",this.textStyle.color||this.themeStyle.tooltipBoldLabel)):(m="",u.fontWeight="Normal",a.setAttribute("fill",this.textStyle.color||this.themeStyle.tooltipLightLabel)),a.textContent=s=s.replace(/<[a-zA-Z\/](.|\n)*?>/g,""),y+=o(s,u).width,""!==m&&a.setAttribute("style",m),x=!1);y-=4,l=Math.max(l,y)}}this.elementSize=new h(l+(l>0?2*this.marginX:0),d),this.elementSize.width+=b+P;var F=_.childNodes[0];if(""!==g&&F){u.fontWeight="bold";var R=(this.elementSize.width+2*this.padding)/2-o(g,u).width/2;F.setAttribute("x",R.toString())}},s.prototype.createTemplate=function(t,e){var i={cancel:!1,name:"tooltipRender",tooltip:this};this.trigger("tooltipRender",i);var o=document.getElementById(this.element.id),n=o.firstElementChild;if(n&&n.remove(),i.cancel)r(this.element.id+"_tooltip").remove();else{for(var a=this.templateFn(this.data),s=this.createElement("div",{id:this.element.id+"parent_template"});a&&a.length>0;)s.appendChild(a[0]);o.appendChild(s);var p=this.element.getBoundingClientRect();this.padding=0,this.elementSize=new h(p.width,p.height);var d=this.tooltipLocation(t,e,new u(0,0),new u(0,0));!this.enableAnimation||this.shared||this.isFirst?this.updateDiv(this.element,d.x,d.y):this.animateTooltipDiv(this.element,d)}},s.prototype.sharedTooltipLocation=function(t,e,i){var o=this.elementSize.width+2*this.marginX,r=this.elementSize.height+2*this.marginY,n=new p(e+2*this.padding,i-r-this.padding,o,r);return n.y<t.y&&(n.y+=n.height+2*this.padding),n.x+n.width>t.x+t.width&&(n.x-=n.width+4*this.padding),n},s.prototype.tooltipLocation=function(t,e,i,o){var r=new u(e.x,e.y),n=this.elementSize.width+2*this.marginX,a=this.elementSize.height+2*this.marginY,s=this.offset,h=this.clipBounds.x,d=this.clipBounds.y,l=t.x,c=t.y;return this.inverted?(r=new u(r.x+h+s,r.y+d-this.elementSize.height/2-this.padding),i.y=o.y=a/2,(r.x+n+this.arrowPadding>l+t.width||this.isNegative)&&(r.x=(e.x>t.width?t.width:e.x)+h-s-(n+this.arrowPadding)),r.x<l&&(r.x=(e.x<0?0:e.x)+h+s),r.y<=c&&(i.y-=c-r.y,o.y-=c-r.y,r.y=c),r.y+a>=c+t.height&&(i.y+=r.y+a-(c+t.height),o.y+=r.y+a-(c+t.height),r.y-=r.y+a-(c+t.height)),i.y+this.arrowPadding/2>a-this.ry&&(i.y=a-this.ry-this.arrowPadding/2,o.y=a,this.tipRadius=0),i.y-this.arrowPadding/2<this.ry&&(i.y=this.ry+this.arrowPadding/2,o.y=0,this.tipRadius=0)):(r=new u(r.x+h-this.elementSize.width/2-this.padding,r.y+d-this.elementSize.height-2*this.padding-this.arrowPadding-s),i.x=o.x=n/2,(r.y<c||this.isNegative)&&(r.y=(e.y<0?0:e.y)+d+s),r.y+a+this.arrowPadding>c+t.height&&(r.y=(e.y>t.height?t.height:e.y)+d-this.elementSize.height-2*this.padding-this.arrowPadding-s),o.x=n/2,r.x<l&&(i.x-=l-r.x,o.x-=l-r.x,r.x=l),r.x+n>l+t.width&&(i.x+=r.x+n-(l+t.width),o.x+=r.x+n-(l+t.width),r.x-=r.x+n-(l+t.width)),i.x+this.arrowPadding/2>n-this.rx&&(i.x=n-this.rx-this.arrowPadding/2,o.x=n,this.tipRadius=0),i.x-this.arrowPadding/2<this.rx&&(i.x=this.rx+this.arrowPadding/2,o.x=0,this.tipRadius=0)),new p(r.x,r.y,n,a)},s.prototype.animateTooltipDiv=function(t,i){var o,r=this,n=parseFloat(t.style.left),a=parseFloat(t.style.top);new e.Animation({}).animate(t,{duration:300,progress:function(e){o=e.timeStamp/e.duration,t.style.animation=null,t.style.left=n+o*(i.x-n)+"px",t.style.top=a+o*(i.y-a)+"px"},end:function(e){r.updateDiv(t,i.x,i.y),r.trigger("animationComplete",{tooltip:r})}})},s.prototype.updateDiv=function(t,e,i){t.style.left=e+"px",t.style.top=i+"px"},s.prototype.updateTemplateFn=function(){if(this.template)try{document.querySelectorAll(this.template).length&&(this.templateFn=e.compile(document.querySelector(this.template).innerHTML.trim()))}catch(t){this.templateFn=e.compile(this.template)}},s.prototype.fadeOut=function(){var t=this,i=r(this.element.id);if(i){var o=i.firstChild,n=parseFloat(o.getAttribute("opacity"))||1;new e.Animation({}).animate(o,{duration:200,progress:function(e){t.progressAnimation(o,n,e.timeStamp/e.duration)},end:function(e){t.fadeOuted=!0,t.endAnimation(o)}})}},s.prototype.progressAnimation=function(t,e,i){t.style.animation="",t.setAttribute("opacity",(e-i).toString())},s.prototype.endAnimation=function(t){t.setAttribute("opacity","0"),this.template&&!this.shared&&(t.style.display="none"),this.trigger("animationComplete",{tooltip:this})},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.prototype.getModuleName=function(){return"tooltip"},s.prototype.destroy=function(){t.prototype.destroy.call(this),this.element.classList.remove("e-tooltip")},s.prototype.onPropertyChanged=function(t,e){this.isFirst=!1,this.render()},m([e.Property(!1)],s.prototype,"enable",void 0),m([e.Property(!1)],s.prototype,"shared",void 0),m([e.Property(!0)],s.prototype,"enableShadow",void 0),m([e.Property(null)],s.prototype,"fill",void 0),m([e.Property("")],s.prototype,"header",void 0),m([e.Property(.75)],s.prototype,"opacity",void 0),m([e.Complex({size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},g)],s.prototype,"textStyle",void 0),m([e.Property(null)],s.prototype,"template",void 0),m([e.Property(!0)],s.prototype,"enableAnimation",void 0),m([e.Property(!1)],s.prototype,"inverted",void 0),m([e.Property(!1)],s.prototype,"isNegative",void 0),m([e.Complex({color:"#cccccc",width:.5},v)],s.prototype,"border",void 0),m([e.Property([])],s.prototype,"content",void 0),m([e.Property(10)],s.prototype,"markerSize",void 0),m([e.Complex({x:0,y:0},w)],s.prototype,"clipBounds",void 0),m([e.Property([])],s.prototype,"palette",void 0),m([e.Property([])],s.prototype,"shapes",void 0),m([e.Complex({x:0,y:0},w)],s.prototype,"location",void 0),m([e.Property(0)],s.prototype,"offset",void 0),m([e.Property(2)],s.prototype,"rx",void 0),m([e.Property(2)],s.prototype,"ry",void 0),m([e.Property(5)],s.prototype,"marginX",void 0),m([e.Property(5)],s.prototype,"marginY",void 0),m([e.Property(12)],s.prototype,"arrowPadding",void 0),m([e.Property(null)],s.prototype,"data",void 0),m([e.Property("Material")],s.prototype,"theme",void 0),m([e.Complex({x:0,y:0,width:0,height:0},x)],s.prototype,"areaBounds",void 0),m([e.Event()],s.prototype,"tooltipRender",void 0),m([e.Event()],s.prototype,"loaded",void 0),m([e.Event()],s.prototype,"animationComplete",void 0),s=m([e.NotifyPropertyChanges],s)}(e.Component);t.TextStyle=g,t.TooltipBorder=v,t.AreaBounds=x,t.ToolLocation=w,t.Tooltip=b,t.getTooltipThemeColor=i,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@syncfusion/ej2-base")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base"],e):e(t.ej={},t.ej2Base)}(this,function(t,e){"use strict";function i(t){var e;switch(t){case"Highcontrast":e={tooltipFill:"#ffffff",tooltipBoldLabel:"#000000",tooltipLightLabel:"#000000",tooltipHeaderLine:"#969696"};break;default:e={tooltipFill:"rgba(0, 8, 22, 0.75)",tooltipBoldLabel:"#ffffff",tooltipLightLabel:"#dbdbdb",tooltipHeaderLine:"#ffffff"}}return e}function o(t,i){var o=document.getElementById("chartmeasuretext");return null===o&&(o=e.createElement("text",{id:"chartmeasuretext"}),document.body.appendChild(o)),o.innerHTML=t,o.style.position="absolute",o.style.fontSize=i.size,o.style.fontWeight=i.fontWeight,o.style.fontStyle=i.fontStyle,o.style.fontFamily=i.fontFamily,o.style.visibility="hidden",o.style.top="-100",o.style.left="0",o.style.whiteSpace="nowrap",o.style.lineHeight="normal",new h(o.clientWidth,o.clientHeight)}function r(t){return document.getElementById(t)}function n(t){var i=r(t);i&&e.remove(i)}function a(t,i,o,r,n,a){var s=new e.SvgRenderer(""),h=function(t,i,o,r,n){var a,s="Path",h=i.width,p=i.height,d=t.x,l=t.y,c=t.x+-h/2,y=t.y+-p/2;switch(o){case"Circle":case"Bubble":s="Ellipse",e.merge(r,{rx:h/2,ry:p/2,cx:d,cy:l});break;case"Cross":a="M "+c+" "+l+" L "+(d+h/2)+" "+l+" M "+d+" "+(l+p/2)+" L "+d+" "+(l+-p/2),e.merge(r,{d:a});break;case"HorizontalLine":a="M "+c+" "+l+" L "+(d+h/2)+" "+l,e.merge(r,{d:a});break;case"VerticalLine":a="M "+d+" "+(l+p/2)+" L "+d+" "+(l+-p/2),e.merge(r,{d:a});break;case"Diamond":a="M "+c+" "+l+" L "+d+" "+(l+-p/2)+" L "+(d+h/2)+" "+l+" L "+d+" "+(l+p/2)+" L "+c+" "+l+" z",e.merge(r,{d:a});break;case"Rectangle":a="M "+c+" "+(l+-p/2)+" L "+(d+h/2)+" "+(l+-p/2)+" L "+(d+h/2)+" "+(l+p/2)+" L "+c+" "+(l+p/2)+" L "+c+" "+(l+-p/2)+" z",e.merge(r,{d:a});break;case"Triangle":a="M "+c+" "+(l+p/2)+" L "+d+" "+(l+-p/2)+" L "+(d+h/2)+" "+(l+p/2)+" L "+c+" "+(l+p/2)+" z",e.merge(r,{d:a});break;case"InvertedTriangle":a="M "+(d+h/2)+" "+(l-p/2)+" L "+d+" "+(l+p/2)+" L "+(d-h/2)+" "+(l-p/2)+" L "+(d+h/2)+" "+(l-p/2)+" z",e.merge(r,{d:a});break;case"Pentagon":for(var u=void 0,f=void 0,m=0;m<=5;m++)u=h/2*Math.cos(Math.PI/180*(72*m)),f=p/2*Math.sin(Math.PI/180*(72*m)),a=0===m?"M "+(d+u)+" "+(l+f)+" ":a.concat("L "+(d+u)+" "+(l+f)+" ");a=a.concat("Z"),e.merge(r,{d:a});break;case"Image":s="Image",e.merge(r,{href:n,height:p,width:h,x:c,y:y})}return{renderOption:r,functionName:s}}(t,o,i,n,r),p=s["draw"+h.functionName](h.renderOption);return p.setAttribute("aria-label",a),p}var s=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),h=function(){return function(t,e){this.width=t,this.height=e}}(),p=function(){return function(t,e,i,o){this.x=t,this.y=e,this.width=i,this.height=o}}(),d=function(){return function(t,e){this.isRight=e,this.isBottom=t}}(),l=function(){return function(t){this.id=t}}(),c=function(t){function e(e,i,o,r,n,a,s){void 0===a&&(a="");var h=t.call(this,e)||this;return h.transform="",h.baseLine="auto",h.x=i,h.y=o,h.anchor=r,h.text=n,h.transform=a,h.baseLine=s,h}return s(e,t),e}(l),y=function(t){function e(e,i,o,r,n,a,s){var h=t.call(this,e)||this;return h.opacity=n,h.fill=i,h.stroke=r,h["stroke-width"]=o,h["stroke-dasharray"]=a,h.d=s,h}return s(e,t),e}(l),u=function(){return function(t,e){this.x=t,this.y=e}}(),f=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),m=function(t,e,i,o){var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a},g=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return f(i,t),m([e.Property(null)],i.prototype,"size",void 0),m([e.Property("")],i.prototype,"color",void 0),m([e.Property("Segoe UI")],i.prototype,"fontFamily",void 0),m([e.Property("Normal")],i.prototype,"fontWeight",void 0),m([e.Property("Normal")],i.prototype,"fontStyle",void 0),m([e.Property(1)],i.prototype,"opacity",void 0),i}(e.ChildProperty),v=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return f(i,t),m([e.Property("")],i.prototype,"color",void 0),m([e.Property(1)],i.prototype,"width",void 0),i}(e.ChildProperty),x=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return f(i,t),m([e.Property(0)],i.prototype,"x",void 0),m([e.Property(0)],i.prototype,"y",void 0),m([e.Property(0)],i.prototype,"width",void 0),m([e.Property(0)],i.prototype,"height",void 0),i}(e.ChildProperty),w=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return f(i,t),m([e.Property(0)],i.prototype,"x",void 0),m([e.Property(0)],i.prototype,"y",void 0),i}(e.ChildProperty),b=function(t){function s(e,i){return t.call(this,e,i)||this}return f(s,t),s.prototype.preRender=function(){this.initPrivateVariable(),this.removeSVG(),this.createTooltipElement()},s.prototype.initPrivateVariable=function(){this.renderer=new e.SvgRenderer(this.element.id),this.themeStyle=i(this.theme),this.formattedText=[],this.padding=5,this.isFirst=!0,this.markerPoint=[]},s.prototype.removeSVG=function(){var t=document.getElementById(this.element.id+"_svg"),i=document.getElementById(this.element.id+"parent_template");t&&t.parentNode&&e.remove(t),i&&i.parentNode&&e.remove(i)},s.prototype.render=function(){if(this.fadeOuted=!1,this.template)this.updateTemplateFn(),this.createTemplate(this.areaBounds,this.location);else{this.renderText(this.isFirst);var t={cancel:!1,name:"tooltipRender",tooltip:this};this.trigger("tooltipRender",t);var e=this.renderTooltipElement(this.areaBounds,this.location);this.drawMarker(e.isBottom,e.isRight,this.markerSize)}this.trigger("loaded",{tooltip:this});var i=document.getElementById("chartmeasuretext");i&&i.remove()},s.prototype.createTooltipElement=function(){if(this.textElements=[],!this.template||this.shared){var t=this.renderer.createSvg({id:this.element.id+"_svg"});this.element.appendChild(t);var e=this.renderer.createGroup({id:this.element.id+"_group"});t.appendChild(e);var i=this.renderer.drawPath({id:this.element.id+"_path","stroke-width":this.border.width,fill:this.fill||this.themeStyle.tooltipFill,opacity:this.opacity,stroke:this.border.color});e.appendChild(i)}},s.prototype.drawMarker=function(t,e,i){if(this.shapes.length<=0)return null;for(var o,n=0,s=this.renderer.createGroup({id:this.element.id+"_trackball_group"}),p=r(this.element.id+"_group"),d=2*this.marginX+i/2+(e?this.arrowPadding:0),l=0,c=this.shapes;l<c.length;l++){var f=c[l];o=new y(this.element.id+"_Trackball_"+n,this.palette[n],1,"#cccccc",1,null),s.appendChild(a(new u(d,this.markerPoint[n]-this.padding+(t?this.arrowPadding:0)),f,new h(i,i),"",o,null)),n++}p.appendChild(s)},s.prototype.renderTooltipElement=function(t,i){var n,a=r(this.element.id),s=new u(0,0),h=new u(0,0),l=r(this.element.id+"_svg"),c=r(this.element.id+"_group"),y=r(this.element.id+"_path"),f=!1,m=!1,g=!1,v=0,x=0;if(this.tipRadius=1,""!==this.header&&(this.elementSize.height+=this.marginY),this.content.length>1?(n=this.sharedTooltipLocation(t,this.location.x,this.location.y),f=!0):(n=this.tooltipLocation(t,i,s,h),this.inverted?v=(m=n.x<i.x+this.clipBounds.x)?0:this.arrowPadding:(g=!(f=n.y<i.y+this.clipBounds.y),x=f?0:this.arrowPadding)),""!==this.header){var w=o(this.header,this.textStyle).height+2*this.marginY+(g?this.arrowPadding:0),b="M "+(3*this.marginX+(m||f||g?0:this.arrowPadding))+" "+w+"L "+(n.width+(m||f||g?0:this.arrowPadding)-2*this.marginX)+" "+w,P=this.renderer.drawPath({id:this.element.id+"_header_path","stroke-width":1,fill:null,opacity:.8,stroke:this.themeStyle.tooltipHeaderLine,d:b});c.appendChild(P)}var L=this.border.width/2,S=new p(L+v,L+x,n.width-L,n.height-L);if(c.setAttribute("opacity","1"),!this.enableAnimation||this.shared||this.isFirst?this.updateDiv(a,n.x,n.y):this.animateTooltipDiv(a,n),l.setAttribute("height",(n.height+this.border.width+(this.inverted?0:this.arrowPadding)).toString()),l.setAttribute("width",(n.width+this.border.width+(this.inverted?this.arrowPadding:0)).toString()),l.setAttribute("opacity","1"),y.setAttribute("d",function(t,e,i,o,r,n,a,s,h,p,d){var l="",c=i.x,y=i.y,u=i.x+i.width,f=i.y+i.height;return d=d||0,n?(l=(l=l.concat("M "+c+" "+(y+e)+" Q "+c+" "+y+" "+(c+t)+" "+y+" L "+(u-t)+" "+y+" Q "+u+" "+y+" "+u+" "+(y+e))).concat(" L "+u+" "+(f-e)+" Q "+u+" "+f+" "+(u-t)+" "+f),0!==r&&(l=(l=l.concat(" L "+(o.x+r/2)+" "+f)).concat(" L "+(h+d)+" "+(f+r-d)),l+=" Q "+h+" "+(f+r)+" "+(h-d)+" "+(f+r-d)),l=o.x-r/2>c?l.concat(" L "+(o.x-r/2)+" "+f+" L "+(c+t)+" "+f+" Q "+c+" "+f+" "+c+" "+(f-e)+" z"):0===r?l.concat(" L "+(c+t)+" "+f+" Q "+c+" "+f+" "+c+" "+(f-e)+" z"):l.concat(" L "+c+" "+(f+e)+" z")):a?(l=(l=l.concat("M "+c+" "+(y+e)+" Q "+c+" "+y+" "+(c+t)+" "+y+" L "+(o.x-r/2)+" "+y)).concat(" L "+(h-d)+" "+(o.y+d)),l=(l=(l+=" Q "+h+" "+o.y+" "+(h+d)+" "+(o.y+d)).concat(" L "+(o.x+r/2)+" "+y+" L "+(u-t)+" "+y+" Q "+u+" "+y+" "+u+" "+(y+e))).concat(" L "+u+" "+(f-e)+" Q "+u+" "+f+" "+(u-t)+" "+f+" L "+(c+t)+" "+f+" Q "+c+" "+f+" "+c+" "+(f-e)+" z")):s?(l=(l=(l=l.concat("M "+c+" "+(y+e)+" Q "+c+" "+y+" "+(c+t)+" "+y)).concat(" L "+(u-t)+" "+y+" Q "+u+" "+y+" "+u+" "+(y+e)+" L "+u+" "+(o.y-r/2))).concat(" L "+(u+r-d)+" "+(p-d)),l=(l=(l+=" Q "+(u+r)+" "+p+" "+(u+r-d)+" "+(p+d)).concat(" L "+u+" "+(o.y+r/2)+" L "+u+" "+(f-e)+" Q "+u+" "+f+" "+(u-t)+" "+f)).concat(" L "+(c+t)+" "+f+" Q "+c+" "+f+" "+c+" "+(f-e)+" z")):(l=(l=l.concat("M "+(c+t)+" "+y+" Q "+c+" "+y+" "+c+" "+(y+e)+" L "+c+" "+(o.y-r/2))).concat(" L "+(c-r+d)+" "+(p-d)),l=(l=(l+=" Q "+(c-r)+" "+p+" "+(c-r+d)+" "+(p+d)).concat(" L "+c+" "+(o.y+r/2)+" L "+c+" "+(f-e)+" Q "+c+" "+f+" "+(c+t)+" "+f)).concat(" L "+(u-t)+" "+f+" Q "+u+" "+f+" "+u+" "+(f-e)+" L "+u+" "+(y+e)+" Q "+u+" "+y+" "+(u-t)+" "+y+" z")),l}(this.rx,this.ry,S,s,this.arrowPadding,f,g,m,h.x,h.y,this.tipRadius)),this.enableShadow){y.setAttribute("filter",e.Browser.isIE?"":"url(#chart_shadow_tooltip)");var _='<filter id="chart_shadow_tooltip" height="130%"><feGaussianBlur in="SourceAlpha" stdDeviation="3"/>';_+='<feOffset dx="3" dy="3" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="0.5"/>',_+='</feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter>';var T=this.renderer.createDefs();T.setAttribute("id","SVG_tooltip_definition"),c.appendChild(T),T.innerHTML=_}return y.setAttribute("stroke",this.border.color),this.changeText(new u(v,x),g,!m&&!f&&!g,n),new d(g,!m&&!f&&!g)},s.prototype.changeText=function(t,e,i,o){var r=document.getElementById(this.element.id+"_text");e&&r.setAttribute("transform","translate(0,"+this.arrowPadding+")"),i&&r.setAttribute("transform","translate("+this.arrowPadding+" 0)")},s.prototype.findFormattedText=function(){this.formattedText=[],""!==this.header.replace(/<b>/g,"").replace(/<\/b>/g,"").trim()&&(this.formattedText=this.formattedText.concat(this.header)),this.formattedText=this.formattedText.concat(this.content)},s.prototype.renderText=function(t){var i,a,s,p,d=0,l=0,y=0,u=e.extend({},this.textStyle,null,!0).properties,f=r(this.element.id+"_group"),m="";this.findFormattedText();var g=this.header.replace(/<b>/g,"").replace(/<\/b>/g,"").trim(),v=""!==g?this.marginY:0,x=!0,w=!0;this.markerPoint=[];var b=this.shapes.length>0?10:0,P=this.shapes.length>0?5:0,L=22/parseFloat("13px")*parseFloat(u.size);t||(n(this.element.id+"_text"),n(this.element.id+"_header_path"),n(this.element.id+"_trackball_group"),n("SVG_tooltip_definition"));for(var S=new c(this.element.id+"_text",2*this.marginX,2*this.marginY+2*this.padding+(2===this.marginY?3:0),"start",""),_=function(t,i,o,r){var n,a,s={},h=new e.SvgRenderer("");return s={id:t.id,x:t.x,y:t.y,fill:o,"font-size":i.size,"font-style":i.fontStyle,"font-family":i.fontFamily,"font-weight":i.fontWeight,"text-anchor":t.anchor,transform:t.transform,opacity:i.opacity,"dominant-baseline":t.baseLine},a="string"==typeof t.text?t.text:t.text[0],n=h.createText(s,a),r.appendChild(n),n}(S,u,null,f),T=0,C=this.formattedText.length;T<C;T++){var z=this.formattedText[T].replace(/<(b|strong)>/g,"<b>").replace(/<\/(b|strong)>/g,"</b>").split(/<br.*?>/g);o(this.formattedText[T],u),0===T&&""!==g||this.markerPoint.push((""!==g?this.marginY:0)+S.y+d);for(var A=0,M=z.length;A<M;A++){y=0,w=!0,d+=L;for(var k=0,B=(i=z[A].replace(/<b>/g,"<br><b>").replace(/<\/b>/g,"</b><br>").split("<br>")).length;k<B;k++)""!==(s=i[k]).replace(/<b>/g,"").replace(/<\/b>/g,"").trim()&&(y+=4,w&&!x?(p={x:2*this.marginX+(b+P),dy:L+(w?v:0),fill:""},v=null):p=x&&w?{x:""===g?2*this.marginX+(b+P):2*this.marginX}:{},w=!1,a=this.renderer.createTSpan(p,""),_.appendChild(a),s.indexOf("<b>")>-1?(m="font-weight:bold",u.fontWeight="bold",a.setAttribute("fill",this.textStyle.color||this.themeStyle.tooltipBoldLabel)):(m="",u.fontWeight="Normal",a.setAttribute("fill",this.textStyle.color||this.themeStyle.tooltipLightLabel)),a.textContent=s=s.replace(/<[a-zA-Z\/](.|\n)*?>/g,""),y+=o(s,u).width,""!==m&&a.setAttribute("style",m),x=!1);y-=4,l=Math.max(l,y)}}this.elementSize=new h(l+(l>0?2*this.marginX:0),d),this.elementSize.width+=b+P;var F=_.childNodes[0];if(""!==g&&F){u.fontWeight="bold";var R=(this.elementSize.width+2*this.padding)/2-o(g,u).width/2;F.setAttribute("x",R.toString())}},s.prototype.createTemplate=function(t,e){var i={cancel:!1,name:"tooltipRender",tooltip:this};this.trigger("tooltipRender",i);var o=document.getElementById(this.element.id),n=o.firstElementChild;if(n&&n.remove(),i.cancel)r(this.element.id+"_tooltip").remove();else{for(var a=this.templateFn(this.data),s=this.createElement("div",{id:this.element.id+"parent_template"});a&&a.length>0;)s.appendChild(a[0]);o.appendChild(s);var p=this.element.getBoundingClientRect();this.padding=0,this.elementSize=new h(p.width,p.height);var d=this.tooltipLocation(t,e,new u(0,0),new u(0,0));!this.enableAnimation||this.shared||this.isFirst?this.updateDiv(this.element,d.x,d.y):this.animateTooltipDiv(this.element,d)}},s.prototype.sharedTooltipLocation=function(t,e,i){var o=this.elementSize.width+2*this.marginX,r=this.elementSize.height+2*this.marginY,n=new p(e+2*this.padding,i-r-this.padding,o,r);return n.y<t.y&&(n.y+=n.height+2*this.padding),n.x+n.width>t.x+t.width&&(n.x-=n.width+4*this.padding),n},s.prototype.tooltipLocation=function(t,e,i,o){var r=new u(e.x,e.y),n=this.elementSize.width+2*this.marginX,a=this.elementSize.height+2*this.marginY,s=this.offset,h=this.clipBounds.x,d=this.clipBounds.y,l=t.x,c=t.y;return this.inverted?(r=new u(r.x+h+s,r.y+d-this.elementSize.height/2-this.padding),i.y=o.y=a/2,(r.x+n+this.arrowPadding>l+t.width||this.isNegative)&&(r.x=(e.x>t.width?t.width:e.x)+h-s-(n+this.arrowPadding)),r.x<l&&(r.x=(e.x<0?0:e.x)+h+s),r.y<=c&&(i.y-=c-r.y,o.y-=c-r.y,r.y=c),r.y+a>=c+t.height&&(i.y+=r.y+a-(c+t.height),o.y+=r.y+a-(c+t.height),r.y-=r.y+a-(c+t.height)),i.y+this.arrowPadding/2>a-this.ry&&(i.y=a-this.ry-this.arrowPadding/2,o.y=a,this.tipRadius=0),i.y-this.arrowPadding/2<this.ry&&(i.y=this.ry+this.arrowPadding/2,o.y=0,this.tipRadius=0)):(r=new u(r.x+h-this.elementSize.width/2-this.padding,r.y+d-this.elementSize.height-2*this.padding-this.arrowPadding-s),i.x=o.x=n/2,(r.y<c||this.isNegative)&&(r.y=(e.y<0?0:e.y)+d+s),r.y+a+this.arrowPadding>c+t.height&&(r.y=(e.y>t.height?t.height:e.y)+d-this.elementSize.height-2*this.padding-this.arrowPadding-s),o.x=n/2,r.x<l&&(i.x-=l-r.x,o.x-=l-r.x,r.x=l),r.x+n>l+t.width&&(i.x+=r.x+n-(l+t.width),o.x+=r.x+n-(l+t.width),r.x-=r.x+n-(l+t.width)),i.x+this.arrowPadding/2>n-this.rx&&(i.x=n-this.rx-this.arrowPadding/2,o.x=n,this.tipRadius=0),i.x-this.arrowPadding/2<this.rx&&(i.x=this.rx+this.arrowPadding/2,o.x=0,this.tipRadius=0)),new p(r.x,r.y,n,a)},s.prototype.animateTooltipDiv=function(t,i){var o,r=this,n=parseFloat(t.style.left),a=parseFloat(t.style.top);new e.Animation({}).animate(t,{duration:300,progress:function(e){o=e.timeStamp/e.duration,t.style.animation=null,t.style.left=n+o*(i.x-n)+"px",t.style.top=a+o*(i.y-a)+"px"},end:function(e){r.updateDiv(t,i.x,i.y),r.trigger("animationComplete",{tooltip:r})}})},s.prototype.updateDiv=function(t,e,i){t.style.left=e+"px",t.style.top=i+"px"},s.prototype.updateTemplateFn=function(){if(this.template)try{document.querySelectorAll(this.template).length&&(this.templateFn=e.compile(document.querySelector(this.template).innerHTML.trim()))}catch(t){this.templateFn=e.compile(this.template)}},s.prototype.fadeOut=function(){var t=this,i=r(this.element.id);if(i){var o=i.firstChild,n=parseFloat(o.getAttribute("opacity"))||1;new e.Animation({}).animate(o,{duration:200,progress:function(e){t.progressAnimation(o,n,e.timeStamp/e.duration)},end:function(e){t.fadeOuted=!0,t.endAnimation(o)}})}},s.prototype.progressAnimation=function(t,e,i){t.style.animation="",t.setAttribute("opacity",(e-i).toString())},s.prototype.endAnimation=function(t){t.setAttribute("opacity","0"),this.template&&!this.shared&&(t.style.display="none"),this.trigger("animationComplete",{tooltip:this})},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.prototype.getModuleName=function(){return"tooltip"},s.prototype.destroy=function(){t.prototype.destroy.call(this),this.element.classList.remove("e-tooltip")},s.prototype.onPropertyChanged=function(t,e){this.isFirst=!1,this.render()},m([e.Property(!1)],s.prototype,"enable",void 0),m([e.Property(!1)],s.prototype,"shared",void 0),m([e.Property(!0)],s.prototype,"enableShadow",void 0),m([e.Property(null)],s.prototype,"fill",void 0),m([e.Property("")],s.prototype,"header",void 0),m([e.Property(.75)],s.prototype,"opacity",void 0),m([e.Complex({size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},g)],s.prototype,"textStyle",void 0),m([e.Property(null)],s.prototype,"template",void 0),m([e.Property(!0)],s.prototype,"enableAnimation",void 0),m([e.Property(!1)],s.prototype,"inverted",void 0),m([e.Property(!1)],s.prototype,"isNegative",void 0),m([e.Complex({color:"#cccccc",width:.5},v)],s.prototype,"border",void 0),m([e.Property([])],s.prototype,"content",void 0),m([e.Property(10)],s.prototype,"markerSize",void 0),m([e.Complex({x:0,y:0},w)],s.prototype,"clipBounds",void 0),m([e.Property([])],s.prototype,"palette",void 0),m([e.Property([])],s.prototype,"shapes",void 0),m([e.Complex({x:0,y:0},w)],s.prototype,"location",void 0),m([e.Property(0)],s.prototype,"offset",void 0),m([e.Property(2)],s.prototype,"rx",void 0),m([e.Property(2)],s.prototype,"ry",void 0),m([e.Property(5)],s.prototype,"marginX",void 0),m([e.Property(5)],s.prototype,"marginY",void 0),m([e.Property(12)],s.prototype,"arrowPadding",void 0),m([e.Property(null)],s.prototype,"data",void 0),m([e.Property("Material")],s.prototype,"theme",void 0),m([e.Complex({x:0,y:0,width:0,height:0},x)],s.prototype,"areaBounds",void 0),m([e.Event()],s.prototype,"tooltipRender",void 0),m([e.Event()],s.prototype,"loaded",void 0),m([e.Event()],s.prototype,"animationComplete",void 0),s=m([e.NotifyPropertyChanges],s)}(e.Component);t.TextStyle=g,t.TooltipBorder=v,t.AreaBounds=x,t.ToolLocation=w,t.Tooltip=b,t.getTooltipThemeColor=i,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=ej2-svg-base.umd.min.js.map

@@ -456,2 +456,6 @@ import { Animation, Browser, ChildProperty, Complex, Component, Event, NotifyPropertyChanges, Property, SvgRenderer, compile, createElement, extend, merge, remove } from '@syncfusion/ej2-base';

this.trigger('loaded', { tooltip: this });
let element = document.getElementById('chartmeasuretext');
if (element) {
element.remove();
}
}

@@ -458,0 +462,0 @@ createTooltipElement() {

@@ -509,2 +509,6 @@ import { Animation, Browser, ChildProperty, Complex, Component, Event, NotifyPropertyChanges, Property, SvgRenderer, compile, createElement, extend, merge, remove } from '@syncfusion/ej2-base';

this.trigger('loaded', { tooltip: this });
var element = document.getElementById('chartmeasuretext');
if (element) {
element.remove();
}
};

@@ -511,0 +515,0 @@ Tooltip.prototype.createTooltipElement = function () {

/*!
* filename: index.d.ts
* version : 16.2.46
* version : 16.2.47
* Copyright Syncfusion Inc. 2001 - 2018. All rights reserved.

@@ -5,0 +5,0 @@ * Use of this code is subject to the terms of our license.

{
"name": "@syncfusion/ej2-svg-base",
"version": "16.2.46",
"version": "16.2.47",
"description": "Essential JS 2 SVG Base Components",

@@ -5,0 +5,0 @@ "author": "Syncfusion Inc.",

@@ -179,2 +179,6 @@ var __extends = (this && this.__extends) || (function () {

this.trigger('loaded', { tooltip: this });
var element = document.getElementById('chartmeasuretext');
if (element) {
element.remove();
}
};

@@ -181,0 +185,0 @@ Tooltip.prototype.createTooltipElement = function () {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc