@hpcc-js/html
Advanced tools
Comparing version 2.42.19 to 2.42.20
@@ -5,4 +5,4 @@ import { select, HTMLWidget, format } from '@hpcc-js/common'; | ||
var PKG_NAME = "@hpcc-js/html"; | ||
var PKG_VERSION = "2.42.19"; | ||
var BUILD_VERSION = "2.105.6"; | ||
var PKG_VERSION = "2.42.20"; | ||
var BUILD_VERSION = "2.105.9"; | ||
@@ -9,0 +9,0 @@ /****************************************************************************** |
@@ -8,4 +8,4 @@ (function (global, factory) { | ||
var PKG_NAME = "@hpcc-js/html"; | ||
var PKG_VERSION = "2.42.19"; | ||
var BUILD_VERSION = "2.105.6"; | ||
var PKG_VERSION = "2.42.20"; | ||
var BUILD_VERSION = "2.105.9"; | ||
@@ -12,0 +12,0 @@ /****************************************************************************** |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/common"),require("@hpcc-js/util")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common","@hpcc-js/util"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/html"]={},t["@hpcc-js/common"],t["@hpcc-js/util"])}(this,(function(t,e,o){"use strict";var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])},n(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}"function"==typeof SuppressedError&&SuppressedError;var r=function(t){function n(){var e=t.call(this)||this;return e._tooltipHTMLCallback=function(t){return"<b>_tooltipHTMLCallback is undefined</b>"},e._logger=o.scopedLogger("html/HTMLTooltip"),e._closing=!1,e.visible(!1),e}return i(n,t),n.prototype.tooltipHTML=function(t){return this._tooltipHTMLCallback=t,this},n.prototype.tooltipContent=function(t){return arguments.length?(this._contentNode=t,this):this._contentNode},n.prototype.triggerElement=function(t){return this._triggerElement=t,this},n.prototype.enter=function(o,n){t.prototype.enter.call(this,o,n);var i=e.select("body");this._tooltipElement=i.append("div").attr("class","tooltip-div").style("z-index","2147483638").style("position","fixed"),this._arrowElement=i.append("div").attr("class","arrow-div").style("z-index","2147483638").style("position","fixed")},n.prototype.update=function(e,o){var n=this;if(t.prototype.update.call(this,e,o),this._contentNode!==this._prevContentNode){var i=this._tooltipElement.node();(function(t,e,o){if(o||2===arguments.length)for(var n,i=0,r=e.length;i<r;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))})([],i.querySelectorAll("*"),!0).map((function(t){return t.__data__})).filter((function(t){return t})).forEach((function(t){"function"==typeof t.target&&t.target(null),"function"==typeof t.exit&&t.exit()})),i.innerHTML="",i.appendChild(this._contentNode),this._prevContentNode=this._contentNode}if(this._contentNode?this.onShowContent(this._contentNode):this._tooltipElement.html((function(){return n._tooltipHTMLCallback(n.data())})),this.fitContent()){this._tooltipElement.style("width","auto").style("height","auto").style("padding","0px").style("box-sizing","content-box");var r=this._tooltipElement.node().getBoundingClientRect();this.tooltipWidth_default(r.width),this.tooltipHeight_default(r.height)}this._closing=!1,this._tooltipElement.style("background-color",this.tooltipColor()).style("color",this.fontColor()).style("width",this.tooltipWidth()+"px").style("height",this.tooltipHeight()+"px").style("opacity",1).style("padding",this.padding()+"px").style("pointer-events",this.enablePointerEvents()?"all":"none").style("box-sizing","content-box"),this._arrowElement.style("opacity",1).style("pointer-events","none"),this.updateTooltipPosition()},n.prototype.onShowContent=function(t){},n.prototype.updateTooltipPosition=function(){var t=this.calcReferenceBBox(),e=this.calcTooltipDirection(t),o=t[e];return this._tooltipElement.style("top",o.y+"px").style("left",o.x+"px"),this.setArrowPosition(o,e),o},n.prototype.calcTooltipDirection=function(t){var e=Object.keys(t),o=this.direction();e.sort((function(t,e){return t===o?-1:1}));for(var n={top:0,left:0,width:window.innerWidth,height:window.innerHeight},i=0;i<e.length;i++){var r={top:t[e[i]].y,left:t[e[i]].x,width:this.tooltipWidth(),height:this.tooltipHeight()};if(this.rectFits(r,n))return e[i]}return this._logger.warning("Tooltip doesn't fit in the window for any of the directions. Defaulting to '".concat(o,"'")),this._logger.debug(n),this._logger.debug({top:t[o].y,left:t[o].x,width:this.tooltipWidth(),height:this.tooltipHeight()}),o},n.prototype.rectFits=function(t,e){return t.top>=e.top&&t.left>=e.left&&t.width+t.left<=e.width+e.left&&t.height+t.top<=e.height+e.top},n.prototype.setArrowPosition=function(t,e){var o,n,i="border-top-color";switch(this._arrowElement.style("border","".concat(this.arrowHeight(),"px solid ").concat(this.tooltipColor())).style("border-top-color","transparent").style("border-right-color","transparent").style("border-bottom-color","transparent").style("border-left-color","transparent"),e){case"n":o=t.y+this.tooltipHeight()+2*this.padding(),n=t.x+this.tooltipWidth()/2-this.arrowWidth()/2+this.padding(),i="border-top-color",this._arrowElement.style("border-top-width","".concat(this.arrowHeight(),"px")).style("border-bottom-width","0px").style("border-left-width","".concat(this.arrowWidth()/2,"px")).style("border-right-width","".concat(this.arrowWidth()/2,"px"));break;case"s":o=t.y-this.arrowHeight(),n=t.x+this.padding()+this.tooltipWidth()/2-this.arrowWidth()/2,i="border-bottom-color",this._arrowElement.style("border-top-width","0px").style("border-bottom-width","".concat(this.arrowHeight(),"px")).style("border-left-width","".concat(this.arrowWidth()/2,"px")).style("border-right-width","".concat(this.arrowWidth()/2,"px"));break;case"e":o=t.y+this.tooltipHeight()/2+this.padding()-this.arrowWidth()/2,n=t.x-this.arrowHeight(),i="border-right-color",this._arrowElement.style("border-top-width","".concat(this.arrowWidth()/2,"px")).style("border-bottom-width","".concat(this.arrowWidth()/2,"px")).style("border-left-width","0px").style("border-right-width","".concat(this.arrowHeight(),"px"));break;case"w":o=t.y+this.tooltipHeight()/2-this.arrowWidth()/2+this.padding(),n=t.x+this.tooltipWidth()+2*this.padding(),i="border-left-color",this._arrowElement.style("border-top-width","".concat(this.arrowWidth()/2,"px")).style("border-bottom-width","".concat(this.arrowWidth()/2,"px")).style("border-left-width","".concat(this.arrowHeight(),"px")).style("border-right-width","0px")}return void 0!==o&&void 0!==n?this._arrowElement.style("top",o+"px").style("left",n+"px").style(i,this.tooltipColor()).style("opacity",1):this._arrowElement.style("opacity",0),t},n.prototype.getReferenceNode=function(){return this._triggerElement?this._triggerElement.node():this.element().node().parentNode.parentNode},n.prototype.calcReferenceBBox=function(){var t=this.getReferenceNode().getBoundingClientRect(),e=t.top,o=t.left,n=t.width,i=t.height,r=this.tooltipWidth(),l=this.tooltipHeight(),s=r/2,p=l/2,a=this.arrowHeight(),h=this.padding(),c=2*h;return this.followCursor()&&this._cursorLoc&&(o=this._cursorLoc[0],e=this._cursorLoc[1],n=1,i=1),{n:{x:o+n/2-s-h,y:e-l-a-c},e:{x:o+n+a,y:e+i/2-p-h},s:{x:o+n/2-s-h,y:e+i+a},w:{x:o-r-a-c,y:e+i/2-p-h},nw:{x:o-r-c,y:e-l-c},ne:{x:o+n,y:e-l-c},se:{x:o+n,y:e+i},sw:{x:o-r-c,y:e+i}}},n.prototype.mouseout=function(){var t=this;this._closing=!0,this._tooltipElement.on("mouseover",(function(){t._closing=!1})),this._tooltipElement.on("mouseout",(function(){t.mouseout()})),setTimeout((function(){t._closing&&t.visible(!1)}),this.closeDelay())},n.prototype.visible=function(e){return arguments.length?(this._arrowElement&&(this._arrowElement.style("visibility",e?"visible":"hidden"),this._tooltipElement.style("visibility",e?"visible":"hidden")),t.prototype.visible.call(this,e),this):t.prototype.visible.call(this)},n.prototype.exit=function(e,o){this._arrowElement&&(this._arrowElement.remove(),this._tooltipElement.remove()),t.prototype.exit.call(this,e,o)},n}(e.HTMLWidget);r.prototype._class+=" html_HTMLTooltip",r.prototype.publish("fitContent",!1,"boolean","If true, tooltip will grow to fit its html content"),r.prototype.publish("followCursor",!1,"boolean","If true, tooltip will display relative to cursor location"),r.prototype.publish("closeDelay",400,"number","Number of milliseconds to wait before closing tooltip (cancelled on tooltip mouseover event)"),r.prototype.publish("direction","n","set","Direction in which to display the tooltip",["n","s","e","w","ne","nw","se","sw"]),r.prototype.publish("padding",8,"number","Padding (pixels)"),r.prototype.publish("arrowWidth",16,"number","Width (or height depending on direction) of the tooltip arrow (pixels)"),r.prototype.publish("arrowHeight",8,"number","Height (or width depending on direction) of the tooltip arrow (pixels)"),r.prototype.publish("fontColor","#FFF","html-color","The default font color for text in the tooltip"),r.prototype.publish("tooltipColor","#000000EE","html-color","Background color of the tooltip"),r.prototype.publish("tooltipWidth",200,"number","Width of the tooltip (not including arrow) (pixels)"),r.prototype.publish("tooltipHeight",200,"number","Height of the tooltip (not including arrow) (pixels)"),r.prototype.publish("enablePointerEvents",!1,"boolean","If true, the 'pointer-events: all' style will be used");var l=function(t){function o(){return t.call(this)||this}return i(o,t),o.prototype.transformData=function(){return this.data()},o.prototype.enter=function(e,o){t.prototype.enter.call(this,e,o),this._table=o.append("table"),this._thead=this._table.append("thead"),this._theadRow=this._thead.append("tr"),this._tbody=this._table.append("tbody")},o.prototype.update=function(o,n){t.prototype.update.call(this,o,n),this._table.style("width",this.autoWidth()?"auto":"100%");var i=this._theadRow.selectAll("th").data(this.columns());i.enter().append("th").attr("class",(function(t,e){return"th-".concat(e)})).merge(i).text((function(t){return t.toString()})),i.exit().remove();var r=this._tbody.selectAll("tr").data(this.transformData());r.enter().append("tr").merge(r).each((function(t){var o=e.select(this).selectAll("td").data(t);o.enter().append("td").attr("class",(function(t,e){return"col-".concat(e)})).merge(o).text((function(t){return t.toString()})),o.exit().remove()})),r.exit().remove()},o}(e.HTMLWidget);l.prototype._class+=" html_SimpleTable",l.prototype.publish("autoWidth",!1,"boolean","If true, table width will be set to 'auto'. If false, the width is set to '100%'");var s=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.applyStyleObject=function(t,e){Object.keys(e).forEach((function(o){t.style(o,e[o])}))},e.prototype.update=function(e,o){var n=this;t.prototype.update.call(this,e,o),o.selectAll("tr,th,td").attr("style","").style("font-family",this.fontFamily()).style("color",this.fontColor()),this.theadColumnStyles().forEach((function(t,e){n.applyStyleObject(o.select(".th-".concat(e)),t)})),this.tbodyColumnStyles().forEach((function(t,e){n.applyStyleObject(o.selectAll(".col-".concat(e)),t)}));var i=Object.keys(this.evenRowStyles()).length>0,r=Object.keys(this.lastRowStyles()).length>0,l=o.selectAll("tbody > tr");if(i){var s=l.select((function(t,e){return e%2?this:null}));this.applyStyleObject(s,this.evenRowStyles())}if(r){var p=l.select((function(t,e,o){return e===o.length-1?this:null}));this.applyStyleObject(p,this.lastRowStyles())}},e}(l);s.prototype._class+=" html_StyledTable",s.prototype.publish("fontFamily","Verdana","string","Base font-family used within the table"),s.prototype.publish("fontColor","#333","string","Base font color used within the table"),s.prototype.publish("theadColumnStyles",[],"array",'Array of objects containing styles for the thead columns (ex: [{"color":"red"},{"color":"blue"}])'),s.prototype.publish("tbodyColumnStyles",[],"array",'Array of objects containing styles for the tbody columns (ex: [{"color":"red"},{"color":"blue"}])'),s.prototype.publish("lastRowStyles",{},"object",'Object containing styles for the last row (ex: {"color":"red"})'),s.prototype.publish("evenRowStyles",{},"object",'Object containing styles for even rows (ex: {"background-color":"#AAA"})');var p=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.transformData=function(){var t=this.useCalculatedRowCount()?this.calculateRowCount():this.rowCount();return this.breakdownData(t)},e.prototype.breakdownData=function(t){var e=this.data().length,o=this.data().reduce((function(t,e){return t+e[1]}),0),n=[],i=0;this.data().sort((function(t,e){return t[1]>e[1]?-1:1}));var r=e-t>0;if(this.data().filter((function(e,o){return!r||o<t-1})).forEach((function(t){var e=Math.round(t[1]/o*100);i+=e,n.push([t[0],e+"%"])})),r){var l="".concat(this.otherLabel()," (").concat(e-t+1,")"),s="~"+(100-i)+"%";n.push([l,s])}return n},e.prototype.calculateRowCount=function(){var t=this.columns().length>0?this.thFontSize()+5:0,e=this.fontSize()+5,o=this.height()-t;return Math.floor(o/e)},e.prototype.enter=function(e,o){var n=this;t.prototype.enter.call(this,e,o),this._tooltip=(new r).target(e),this._tooltip.tooltipHTML((function(t){var e,o=n.useCalculatedRowCount()?n.calculateRowCount():n.rowCount(),i=null!==(e=Math.max.apply(Math,t.map((function(t){return n.textSize(t[0],n.fontFamily(),n.fontSize()).height}))))&&void 0!==e?e:n.fontSize(),r=Math.max.apply(Math,t.map((function(t){return n.textSize(t[0],n.fontFamily(),n.fontSize()).width}))),l=2*(r+30)+2*n._tooltip.padding(),s=i*Math.ceil((t.length-o)/2)+2*n._tooltip.padding();n._tooltip.tooltipWidth(l),n._tooltip.tooltipHeight(s);var p=n.breakdownData(n.data().length).slice(o-1);return'<div style="\n width: 100%;\n height: 100%;\n font-size: '.concat(n.fontSize(),'px;\n ">').concat(p.map((function(t){return'<div style="\n float:left;\n width:'.concat(Math.floor(49.5),'%;\n ">').concat(t[0],": ").concat(t[1],"</div>")})).join(""),"</div>")}))},e.prototype.update=function(e,o){if(this.theadColumnStyles_default([{color:this.thFirstColor(),"font-size":this.thFontSize()+"px","font-weight":this.thFontWeight(),"text-align":this.labelAlignment(),width:"auto",padding:"0px"},{width:"1%","font-size":this.thFontSize()+"px","font-weight":this.thFontWeight(),"text-align":this.percentageAlignment(),padding:"0px"}]),this.tbodyColumnStyles_default([{color:this.topLabelColor(),"font-size":this.fontSize()+"px","font-weight":"normal","text-align":this.labelAlignment(),width:"auto",padding:"0px"},{color:this.topPercentageColor(),"font-size":this.fontSize()+"px","font-weight":"normal","text-align":this.percentageAlignment(),width:"1%",padding:"0px"}]),this.lastRowStyles_default([{color:this.otherLabelColor(),"font-size":this.fontSize()+"px","font-weight":this.otherLabelBold()?"bold":"normal","text-align":this.labelAlignment(),width:"auto",padding:"0px"},{color:this.otherLabelColor(),"font-size":this.fontSize()+"px","font-weight":this.otherPercentageBold()?"bold":"normal","text-align":this.percentageAlignment(),width:"1%",padding:"0px"}]),t.prototype.update.call(this,e,o),(this.useCalculatedRowCount()?this.calculateRowCount():this.rowCount())<this.data().length){var n=o.select("tbody > tr:last-child"),i=this;n.on("mouseout.tooltip",(function(t){i._tooltip._triggerElement=n,i._tooltip.visible(!1).render()})).on("mouseenter.tooltip",(function(t){i._tooltip._triggerElement=n,i._tooltip.direction("n").data(i.data()).visible(!0).render()}))}},e}(s);p.prototype._class+=" html_BreakdownTable",p.prototype.publish("useCalculatedRowCount",!0,"boolean","If true, rowCount will be calculated and its default will be overwritten"),p.prototype.publish("rowCount",5,"number","Number of total rows to display (including the 'other' row)",void 0,{disable:function(t){return t.useCalculatedRowCount()}}),p.prototype.publish("fontSize",14,"number","Font size (pixels)"),p.prototype.publish("labelAlignment","left","set","Alignment of the label column text",["left","center","right"]),p.prototype.publish("percentageAlignment","center","set","Alignment of the percentage column text",["left","center","right"]),p.prototype.publish("topLabelColor","#333","html-color","Color of displayed 'top' labels"),p.prototype.publish("topPercentageColor","#1A99D5","html-color","Color of displayed 'top' percentages"),p.prototype.publish("topPercentageBold",!0,"html-color","If true, the 'top' percentages will be bold"),p.prototype.publish("otherLabel","Other","string","Label text for the 'other' row"),p.prototype.publish("otherLabelColor","#AAA","html-color","Color of the 'other' label"),p.prototype.publish("otherLabelBold",!1,"html-color","If true, the 'other' label will be bold"),p.prototype.publish("otherPercentageColor","#AAA","html-color","Color of the 'other' percentage"),p.prototype.publish("otherPercentageBold",!1,"html-color","If true, the 'other' percentage will be bold"),p.prototype.publish("thFontWeight","bold","string","Font weight for th elements"),p.prototype.publish("thFontSize",26,"number","Font size for th elements"),p.prototype.publish("thFirstColor","#333","html-color","Text color of the first th element"),p.prototype.publish("thLastColor","#333","html-color","Text color of the last th element");var a,h,c,u,_,d,f,y={},g=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,b=Array.isArray;function v(t,e){for(var o in e)t[o]=e[o];return t}function w(t){var e=t.parentNode;e&&e.removeChild(t)}function x(t,e,o){var n,i,r,l={};for(r in e)"key"==r?n=e[r]:"ref"==r?i=e[r]:l[r]=e[r];if(arguments.length>2&&(l.children=arguments.length>3?a.call(arguments,2):o),"function"==typeof t&&null!=t.defaultProps)for(r in t.defaultProps)void 0===l[r]&&(l[r]=t.defaultProps[r]);return C(t,l,n,i,null)}function C(t,e,o,n,i){var r={type:t,props:e,key:o,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==i?++c:i,__i:-1,__u:0};return null==i&&null!=h.vnode&&h.vnode(r),r}function k(t){return t.children}function S(t,e){this.props=t,this.context=e}function T(t,e){if(null==e)return t.__?T(t.__,t.__i+1):null;for(var o;e<t.__k.length;e++)if(null!=(o=t.__k[e])&&null!=o.__e)return o.__e;return"function"==typeof t.type?T(t):null}function E(t){var e,o;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(o=t.__k[e])&&null!=o.__e){t.__e=t.__c.base=o.__e;break}return E(t)}}function W(t){(!t.__d&&(t.__d=!0)&&u.push(t)&&!H.__r++||_!==h.debounceRendering)&&((_=h.debounceRendering)||d)(H)}function H(){var t,e,o,n,i,r,l,s,p;for(u.sort(f);t=u.shift();)t.__d&&(e=u.length,n=void 0,r=(i=(o=t).__v).__e,s=[],p=[],(l=o.__P)&&((n=v({},i)).__v=i.__v+1,h.vnode&&h.vnode(n),D(l,n,i,o.__n,void 0!==l.ownerSVGElement,32&i.__u?[r]:null,s,null==r?T(i):r,!!(32&i.__u),p),n.__v=i.__v,n.__.__k[n.__i]=n,z(s,n,p),n.__e!=r&&E(n)),u.length>e&&u.sort(f));H.__r=0}function A(t,e,o,n,i,r,l,s,p,a,h){var c,u,_,d,f,m=n&&n.__k||g,b=e.length;for(o.__d=p,B(o,e,m),p=o.__d,c=0;c<b;c++)null!=(_=o.__k[c])&&"boolean"!=typeof _&&"function"!=typeof _&&(u=-1===_.__i?y:m[_.__i]||y,_.__i=c,D(t,_,u,i,r,l,s,p,a,h),d=_.__e,_.ref&&u.ref!=_.ref&&(u.ref&&O(u.ref,null,_),h.push(_.ref,_.__c||d,_)),null==f&&null!=d&&(f=d),65536&_.__u||u.__k===_.__k?(d||u.__e!=p||(p=T(u)),p=F(_,p,t)):"function"==typeof _.type&&void 0!==_.__d?p=_.__d:d&&(p=d.nextSibling),_.__d=void 0,_.__u&=-196609);o.__d=p,o.__e=f}function B(t,e,o){var n,i,r,l,s,p=e.length,a=o.length,h=a,c=0;for(t.__k=[],n=0;n<p;n++)l=n+c,null!=(i=t.__k[n]=null==(i=e[n])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?C(null,i,null,null,null):b(i)?C(k,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?C(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=t,i.__b=t.__b+1,s=P(i,o,l,h),i.__i=s,r=null,-1!==s&&(h--,(r=o[s])&&(r.__u|=131072)),null==r||null===r.__v?(-1==s&&c--,"function"!=typeof i.type&&(i.__u|=65536)):s!==l&&(s===l+1?c++:s>l?h>p-l?c+=s-l:c--:s<l?s==l-1&&(c=s-l):c=0,s!==n+c&&(i.__u|=65536))):(r=o[l])&&null==r.key&&r.__e&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=T(r)),I(r,r,!1),o[l]=null,h--);if(h)for(n=0;n<a;n++)null!=(r=o[n])&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=T(r)),I(r,r))}function F(t,e,o){var n,i;if("function"==typeof t.type){for(n=t.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=t,e=F(n[i],e,o));return e}t.__e!=e&&(o.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function P(t,e,o,n){var i=t.key,r=t.type,l=o-1,s=o+1,p=e[o];if(null===p||p&&i==p.key&&r===p.type&&!(131072&p.__u))return o;if(n>(null==p||131072&p.__u?0:1))for(;l>=0||s<e.length;){if(l>=0){if((p=e[l])&&!(131072&p.__u)&&i==p.key&&r===p.type)return l;l--}if(s<e.length){if((p=e[s])&&!(131072&p.__u)&&i==p.key&&r===p.type)return s;s++}}return-1}function R(t,e,o){"-"===e[0]?t.setProperty(e,null==o?"":o):t[e]=null==o?"":"number"!=typeof o||m.test(e)?o:o+"px"}function L(t,e,o,n,i){var r;t:if("style"===e)if("string"==typeof o)t.style.cssText=o;else{if("string"==typeof n&&(t.style.cssText=n=""),n)for(e in n)o&&e in o||R(t.style,e,"");if(o)for(e in o)n&&o[e]===n[e]||R(t.style,e,o[e])}else if("o"===e[0]&&"n"===e[1])r=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||"onFocusOut"===e||"onFocusIn"===e?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=o,o?n?o.u=n.u:(o.u=Date.now(),t.addEventListener(e,r?N:M,r)):t.removeEventListener(e,r?N:M,r);else{if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&"role"!==e&&e in t)try{t[e]=null==o?"":o;break t}catch(t){}"function"==typeof o||(null==o||!1===o&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,o))}}function M(t){if(this.l){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(h.event?h.event(t):t)}}function N(t){if(this.l)return this.l[t.type+!0](h.event?h.event(t):t)}function D(t,e,o,n,i,r,l,s,p,a){var c,u,_,d,f,y,g,m,w,x,C,T,E,W,H,B=e.type;if(void 0!==e.constructor)return null;128&o.__u&&(p=!!(32&o.__u),r=[s=e.__e=o.__e]),(c=h.__b)&&c(e);t:if("function"==typeof B)try{if(m=e.props,w=(c=B.contextType)&&n[c.__c],x=c?w?w.props.value:c.__:n,o.__c?g=(u=e.__c=o.__c).__=u.__E:("prototype"in B&&B.prototype.render?e.__c=u=new B(m,x):(e.__c=u=new S(m,x),u.constructor=B,u.render=U),w&&w.sub(u),u.props=m,u.state||(u.state={}),u.context=x,u.__n=n,_=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=B.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=v({},u.__s)),v(u.__s,B.getDerivedStateFromProps(m,u.__s))),d=u.props,f=u.state,u.__v=e,_)null==B.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==B.getDerivedStateFromProps&&m!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(m,x),!u.__e&&(null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(m,u.__s,x)||e.__v===o.__v)){for(e.__v!==o.__v&&(u.props=m,u.state=u.__s,u.__d=!1),e.__e=o.__e,e.__k=o.__k,e.__k.forEach((function(t){t&&(t.__=e)})),C=0;C<u._sb.length;C++)u.__h.push(u._sb[C]);u._sb=[],u.__h.length&&l.push(u);break t}null!=u.componentWillUpdate&&u.componentWillUpdate(m,u.__s,x),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(d,f,y)}))}if(u.context=x,u.props=m,u.__P=t,u.__e=!1,T=h.__r,E=0,"prototype"in B&&B.prototype.render){for(u.state=u.__s,u.__d=!1,T&&T(e),c=u.render(u.props,u.state,u.context),W=0;W<u._sb.length;W++)u.__h.push(u._sb[W]);u._sb=[]}else do{u.__d=!1,T&&T(e),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++E<25);u.state=u.__s,null!=u.getChildContext&&(n=v(v({},n),u.getChildContext())),_||null==u.getSnapshotBeforeUpdate||(y=u.getSnapshotBeforeUpdate(d,f)),A(t,b(H=null!=c&&c.type===k&&null==c.key?c.props.children:c)?H:[H],e,o,n,i,r,l,s,p,a),u.base=e.__e,e.__u&=-161,u.__h.length&&l.push(u),g&&(u.__E=u.__=null)}catch(t){e.__v=null,p||null!=r?(e.__e=s,e.__u|=p?160:32,r[r.indexOf(s)]=null):(e.__e=o.__e,e.__k=o.__k),h.__e(t,e,o)}else null==r&&e.__v===o.__v?(e.__k=o.__k,e.__e=o.__e):e.__e=j(o.__e,e,o,n,i,r,l,p,a);(c=h.diffed)&&c(e)}function z(t,e,o){e.__d=void 0;for(var n=0;n<o.length;n++)O(o[n],o[++n],o[++n]);h.__c&&h.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){h.__e(t,e.__v)}}))}function j(t,e,o,n,i,r,l,s,p){var h,c,u,_,d,f,g,m=o.props,v=e.props,x=e.type;if("svg"===x&&(i=!0),null!=r)for(h=0;h<r.length;h++)if((d=r[h])&&"setAttribute"in d==!!x&&(x?d.localName===x:3===d.nodeType)){t=d,r[h]=null;break}if(null==t){if(null===x)return document.createTextNode(v);t=i?document.createElementNS("http://www.w3.org/2000/svg",x):document.createElement(x,v.is&&v),r=null,s=!1}if(null===x)m===v||s&&t.data===v||(t.data=v);else{if(r=r&&a.call(t.childNodes),m=o.props||y,!s&&null!=r)for(m={},h=0;h<t.attributes.length;h++)m[(d=t.attributes[h]).name]=d.value;for(h in m)d=m[h],"children"==h||("dangerouslySetInnerHTML"==h?u=d:"key"===h||h in v||L(t,h,null,d,i));for(h in v)d=v[h],"children"==h?_=d:"dangerouslySetInnerHTML"==h?c=d:"value"==h?f=d:"checked"==h?g=d:"key"===h||s&&"function"!=typeof d||m[h]===d||L(t,h,d,m[h],i);if(c)s||u&&(c.__html===u.__html||c.__html===t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(u&&(t.innerHTML=""),A(t,b(_)?_:[_],e,o,n,i&&"foreignObject"!==x,r,l,r?r[0]:o.__k&&T(o,0),s,p),null!=r)for(h=r.length;h--;)null!=r[h]&&w(r[h]);s||(h="value",void 0!==f&&(f!==t[h]||"progress"===x&&!f||"option"===x&&f!==m[h])&&L(t,h,f,m[h],!1),h="checked",void 0!==g&&g!==t[h]&&L(t,h,g,m[h],!1))}return t}function O(t,e,o){try{"function"==typeof t?t(e):t.current=e}catch(t){h.__e(t,o)}}function I(t,e,o){var n,i;if(h.unmount&&h.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||O(n,null,e)),null!=(n=t.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(t){h.__e(t,e)}n.base=n.__P=null,t.__c=void 0}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&I(n[i],e,o||"function"!=typeof t.type);o||null==t.__e||w(t.__e),t.__=t.__e=t.__d=void 0}function U(t,e,o){return this.constructor(t,o)}a=g.slice,h={__e:function(t,e,o,n){for(var i,r,l;e=e.__;)if((i=e.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(t)),l=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t,n||{}),l=i.__d),l)return i.__E=i}catch(e){t=e}throw t}},c=0,S.prototype.setState=function(t,e){var o;o=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=v({},this.state),"function"==typeof t&&(t=t(v({},o),this.props)),t&&v(o,t),null!=t&&this.__v&&(e&&this._sb.push(e),W(this))},S.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),W(this))},S.prototype.render=k,u=[],d="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(t,e){return t.__v.__b-e.__v.__b},H.__r=0;var V,q,$,G=[],J=[],K=h,X=K.__b,Q=K.__r,Y=K.diffed,Z=K.__c,tt=K.unmount,et=K.__;function ot(){for(var t;t=G.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(rt),t.__H.__h.forEach(lt),t.__H.__h=[]}catch(e){t.__H.__h=[],K.__e(e,t.__v)}}K.__b=function(t){V=null,X&&X(t)},K.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),et&&et(t,e)},K.__r=function(t){Q&&Q(t);var e=(V=t.__c).__H;e&&(q===V?(e.__h=[],V.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=J,t.__N=t.i=void 0}))):(e.__h.forEach(rt),e.__h.forEach(lt),e.__h=[])),q=V},K.diffed=function(t){Y&&Y(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==G.push(e)&&$===K.requestAnimationFrame||(($=K.requestAnimationFrame)||it)(ot)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==J&&(t.__=t.__V),t.i=void 0,t.__V=J}))),q=V=null},K.__c=function(t,e){e.some((function(t){try{t.__h.forEach(rt),t.__h=t.__h.filter((function(t){return!t.__||lt(t)}))}catch(o){e.some((function(t){t.__h&&(t.__h=[])})),e=[],K.__e(o,t.__v)}})),Z&&Z(t,e)},K.unmount=function(t){tt&&tt(t);var e,o=t.__c;o&&o.__H&&(o.__H.__.forEach((function(t){try{rt(t)}catch(t){e=t}})),o.__H=void 0,e&&K.__e(e,o.__v))};var nt="function"==typeof requestAnimationFrame;function it(t){var e,o=function(){clearTimeout(n),nt&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(o,100);nt&&(e=requestAnimationFrame(o))}function rt(t){var e=V,o=t.__c;"function"==typeof o&&(t.__c=void 0,o()),V=e}function lt(t){var e=V;t.__c=t.__(),V=e}var st=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.jsxRender=function(t,e){this.rootNode=function(t,e,o){var n,i,r,l;h.__&&h.__(t,e),i=(n="function"==typeof o)?null:o&&o.__k||e.__k,r=[],l=[],D(e,t=(!n&&o||e).__k=x(k,null,[t]),i||y,y,void 0!==e.ownerSVGElement,!n&&o?[o]:i?null:e.firstChild?a.call(e.childNodes):null,r,!n&&o?o:i?i.__e:e.firstChild,n,l),z(r,t,l)}(t,e,this.rootNode)},e.Component=S,e.createElement=x,e}(e.HTMLWidget);st.prototype._class+=" html_JSXWidget";var pt=function(){function t(t,e){this._attrs=t,this._children=e}return t.prototype.type=function(){return"div"},t.prototype.attrs=function(){return this._attrs},t.prototype.attr=function(t){return this._attrs[t]},t.prototype.children=function(){return this._children},t.prototype.update=function(t){for(var e in this._attrs)t.attr(e,this._attrs[e])},t.prototype.render=function(t){var o=t.selectAll("".concat(t.node().tagName," > *")).data([this]);return o.exit().remove(),o.enter().append(this.type()).attr("reactd3",0).merge(o).each((function(t){var o=e.select(this);t.update(o),t.renderChildren(o)}))},t.prototype.renderChildren=function(t){var o=t.selectAll("".concat(t.node().tagName," > *")).data(this._children);return o.exit().remove(),o.enter().append((function(t){return document.createElement(t.type())})).attr("reactd3",(function(t,e){return e})).merge(o).each((function(t){var o=e.select(this);t.update(o),t.renderChildren(o)}))},t}(),at=function(t){function e(e,o,n){var i=t.call(this,o,n)||this;return i._type=e,i}return i(e,t),e.prototype.type=function(){return this._type},e}(pt),ht=function(t){function e(e){var o=t.call(this,{},[])||this;return o._text=e,o}return i(e,t),e.prototype.type=function(){return"span"},e.prototype.update=function(e){t.prototype.update.call(this,e),e.text(this._text)},e}(pt);var ct=function(){function t(){}return t.createElement=function(t,e){for(var o,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return(o=t).prototype&&o.prototype instanceof pt?new t(e):function(t){return"function"==typeof t}(t)?t(e):new at(t,e,n.map((function(t){return"string"==typeof t?new ht(t):t})))},t.render=function(t,e){t.render(e)},t}(),ut=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.refreshProps=function(){for(var t in this.props)this.widget[t]&&"function"==typeof this.widget[t]&&this.widget[t](this.props[t])},e.prototype.componentDidMount=function(){this.widget=(new this.props.type).target(this.base),this.refreshProps(),this.widget.render()},e.prototype.componentWillUnmount=function(){this.widget.target(null).render()},e.prototype.render=function(){return x("div",{style:this.props.style})},e.prototype.componentDidUpdate=function(){this.refreshProps(),this.widget.render()},e}(st.Component),_t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.refreshProps=function(){for(var t in this.props)this.widget[t]&&"function"==typeof this.widget[t]&&this.widget[t](this.props[t])},e.prototype.componentDidMount=function(){this.widget=this.props.instance.target(this.base),this.refreshProps(),this.widget.render()},e.prototype.componentWillUnmount=function(){this.widget.target(null).render()},e.prototype.render=function(){return x("div",{style:this.props.style})},e.prototype.componentDidUpdate=function(){this.refreshProps(),this.widget.render()},e}(st.Component),dt=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return i(o,t),o.prototype.transformData=function(){var t=this,o=[["Total",0,0]],n=this.data();return n.forEach((function(t){o[0][1]+=t[1],o[0][2]+=t[2]})),n.concat(o).map((function(o){return[o[0],t.secondColumnFormat_exists()?e.format(t.secondColumnFormat())(o[1]):o[1],t.thirdColumnFormat_exists()?e.format(t.thirdColumnFormat())(o[2]):o[2]]}))},o.prototype.update=function(e,o){this.tbodyColumnStyles_default([{"font-weight":"bold",width:this.firstColumnWidth(),"text-align":"left"},{width:this.secondColumnWidth(),"text-align":"right"},{width:this.thirdColumnWidth(),"text-align":"right"}]),this.evenRowStyles_default([{"font-weight":"bold",width:this.firstColumnWidth(),"text-align":"left","font-color":this.evenRowFontColor(),"background-color":this.evenRowBackgroundColor()},{width:this.secondColumnWidth(),"text-align":"right","font-color":this.evenRowFontColor(),"background-color":this.evenRowBackgroundColor()},{width:this.thirdColumnWidth(),"text-align":"right","font-color":this.evenRowFontColor(),"background-color":this.evenRowBackgroundColor()}]),this.lastRowStyles_default({"font-weight":"bold"}),t.prototype.update.call(this,e,o)},o}(s);dt.prototype._class+=" html_StatsTable",dt.prototype.publish("labelColor","#333","html-color","Color of the text in the first column"),dt.prototype.publish("primaryValueColor","#333","html-color","Color of the text in the second column"),dt.prototype.publish("secondaryValueColor","#333","html-color","Color of the text in the third column"),dt.prototype.publish("evenRowBackgroundColor","#333","html-color","Background color of the even rows"),dt.prototype.publish("evenRowFontColor","#333","html-color","Font color of the even rows"),dt.prototype.publish("firstColumnWidth","auto","string","CSS style applied as the 'width' for the first column (ex: 40px)"),dt.prototype.publish("secondColumnWidth","1%","string","CSS style applied as the 'width' for the second column (ex: 40px)"),dt.prototype.publish("thirdColumnWidth","1%","string","CSS style applied as the 'width' for the third column (ex: 40px)"),dt.prototype.publish("secondColumnFormat","$,.0f","string","d3-format specifier applied to the second column's values",void 0,{optional:!0}),dt.prototype.publish("thirdColumnFormat",null,"string","d3-format specifier applied to the third column's values",void 0,{optional:!0});!function(t,e){void 0===e&&(e={});var o=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===o&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}("#wrap{width:100%}#left,#right{padding:5px}#left{background-color:red;display:block;overflow:hidden;text-align:left;text-overflow:ellipsis}#left,#right{white-space:nowrap}#right{background-color:orange;float:right;text-align:right}.html_TitleBar>.main{display:block;width:100%}.html_TitleBar .title{display:block;font-size:20px;font-weight:700;overflow:hidden;padding:4px;text-align:left;text-overflow:ellipsis;white-space:nowrap}.html_TitleBar .icon-bar{float:right;line-height:28px;padding:4px;text-align:right;white-space:nowrap}.html_TitleBar .icon-bar-item,.html_TitleBar .icon-bar-item>div{display:inline}.html_TitleBar .icon-bar a{color:#a9a9a9;padding-bottom:4px;padding-top:4px;text-align:center;transition:all .3s ease}.html_TitleBar .icon-bar a:hover{background-color:#f5f5f5}.html_TitleBar .icon-bar a.selected{background-color:#efe5e5}.html_TitleBar .icon-bar a.spacer{color:none;padding-bottom:0;padding-left:8px;padding-top:2px;text-align:center}.html_TitleBar .icon-bar a.spacer:hover{background-color:transparent}.html_TitleBar .icon-bar .active{background-color:#4caf50}");var ft=function(t){function e(e){var o=t.call(this)||this;return o._owner=e,o._tag="a",o}return i(e,t),e}(e.HTMLWidget),yt=function(t){function e(e,o){var n=t.call(this,e)||this;return n._icon=o,n}return i(e,t),e.prototype.icon=function(){return this._icon},e.prototype.enter=function(e,o){var n=this;t.prototype.enter.call(this,e,o),o.attr("href","#").on("click",(function(t,e,o){return n._owner.titleBarClick(n,t,e,o)})).append("i").attr("class","fa ".concat(this._icon," fa-lg fa-fw"))},e}(ft),gt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.enter=function(e,o){var n=this;o.on("click.sel",(function(t,e,o){n.selected(!n.selected()),n.render()})),t.prototype.enter.call(this,e,o)},e.prototype.update=function(e,o){t.prototype.update.call(this,e,o),this._element.classed("selected",this.selected())},e}(yt);gt.prototype.publish("selected",!1,"boolean");var mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.enter=function(e,o){t.prototype.enter.call(this,e,o),o.attr("class","spacer").attr("href","#").append("i")},e}(ft),bt=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.enter=function(e,o){t.prototype.enter.call(this,e,o),this._divMain=o.append("div").attr("class","main"),this._divIconBar=this._divMain.append("div").attr("class","icon-bar"),this._divTitle=this._divMain.append("div").attr("class","title")},e.prototype.update=function(e,o){t.prototype.update.call(this,e,o),this._divTitle.text(this.title());var n=this._divIconBar.selectAll(".icon-bar-item").data(this.buttons());n.enter().append("div").attr("class","icon-bar-item").each((function(t){t.target(this)})).merge(n).each((function(t){t.render()})),n.exit().each((function(t){t.target(null)})).remove(),n.order()},e}(st);bt.prototype._class+=" html_TitleBar",bt.prototype.publish("title","","string"),bt.prototype.publish("buttons",[],"widgetArray"),t.BUILD_VERSION="2.105.6",t.BreakdownTable=p,t.Button=yt,t.HTMLTooltip=r,t.Item=ft,t.JSXWidget=st,t.PKG_NAME="@hpcc-js/html",t.PKG_VERSION="2.42.19",t.ReactD3=ct,t.SimpleTable=l,t.Spacer=mt,t.StatsTable=dt,t.StyledTable=s,t.TitleBar=bt,t.ToggleButton=gt,t.VNode=pt,t.VizComponent=ut,t.VizInstance=_t,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/common"),require("@hpcc-js/util")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common","@hpcc-js/util"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/html"]={},t["@hpcc-js/common"],t["@hpcc-js/util"])}(this,(function(t,e,o){"use strict";var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])},n(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}"function"==typeof SuppressedError&&SuppressedError;var r=function(t){function n(){var e=t.call(this)||this;return e._tooltipHTMLCallback=function(t){return"<b>_tooltipHTMLCallback is undefined</b>"},e._logger=o.scopedLogger("html/HTMLTooltip"),e._closing=!1,e.visible(!1),e}return i(n,t),n.prototype.tooltipHTML=function(t){return this._tooltipHTMLCallback=t,this},n.prototype.tooltipContent=function(t){return arguments.length?(this._contentNode=t,this):this._contentNode},n.prototype.triggerElement=function(t){return this._triggerElement=t,this},n.prototype.enter=function(o,n){t.prototype.enter.call(this,o,n);var i=e.select("body");this._tooltipElement=i.append("div").attr("class","tooltip-div").style("z-index","2147483638").style("position","fixed"),this._arrowElement=i.append("div").attr("class","arrow-div").style("z-index","2147483638").style("position","fixed")},n.prototype.update=function(e,o){var n=this;if(t.prototype.update.call(this,e,o),this._contentNode!==this._prevContentNode){var i=this._tooltipElement.node();(function(t,e,o){if(o||2===arguments.length)for(var n,i=0,r=e.length;i<r;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))})([],i.querySelectorAll("*"),!0).map((function(t){return t.__data__})).filter((function(t){return t})).forEach((function(t){"function"==typeof t.target&&t.target(null),"function"==typeof t.exit&&t.exit()})),i.innerHTML="",i.appendChild(this._contentNode),this._prevContentNode=this._contentNode}if(this._contentNode?this.onShowContent(this._contentNode):this._tooltipElement.html((function(){return n._tooltipHTMLCallback(n.data())})),this.fitContent()){this._tooltipElement.style("width","auto").style("height","auto").style("padding","0px").style("box-sizing","content-box");var r=this._tooltipElement.node().getBoundingClientRect();this.tooltipWidth_default(r.width),this.tooltipHeight_default(r.height)}this._closing=!1,this._tooltipElement.style("background-color",this.tooltipColor()).style("color",this.fontColor()).style("width",this.tooltipWidth()+"px").style("height",this.tooltipHeight()+"px").style("opacity",1).style("padding",this.padding()+"px").style("pointer-events",this.enablePointerEvents()?"all":"none").style("box-sizing","content-box"),this._arrowElement.style("opacity",1).style("pointer-events","none"),this.updateTooltipPosition()},n.prototype.onShowContent=function(t){},n.prototype.updateTooltipPosition=function(){var t=this.calcReferenceBBox(),e=this.calcTooltipDirection(t),o=t[e];return this._tooltipElement.style("top",o.y+"px").style("left",o.x+"px"),this.setArrowPosition(o,e),o},n.prototype.calcTooltipDirection=function(t){var e=Object.keys(t),o=this.direction();e.sort((function(t,e){return t===o?-1:1}));for(var n={top:0,left:0,width:window.innerWidth,height:window.innerHeight},i=0;i<e.length;i++){var r={top:t[e[i]].y,left:t[e[i]].x,width:this.tooltipWidth(),height:this.tooltipHeight()};if(this.rectFits(r,n))return e[i]}return this._logger.warning("Tooltip doesn't fit in the window for any of the directions. Defaulting to '".concat(o,"'")),this._logger.debug(n),this._logger.debug({top:t[o].y,left:t[o].x,width:this.tooltipWidth(),height:this.tooltipHeight()}),o},n.prototype.rectFits=function(t,e){return t.top>=e.top&&t.left>=e.left&&t.width+t.left<=e.width+e.left&&t.height+t.top<=e.height+e.top},n.prototype.setArrowPosition=function(t,e){var o,n,i="border-top-color";switch(this._arrowElement.style("border","".concat(this.arrowHeight(),"px solid ").concat(this.tooltipColor())).style("border-top-color","transparent").style("border-right-color","transparent").style("border-bottom-color","transparent").style("border-left-color","transparent"),e){case"n":o=t.y+this.tooltipHeight()+2*this.padding(),n=t.x+this.tooltipWidth()/2-this.arrowWidth()/2+this.padding(),i="border-top-color",this._arrowElement.style("border-top-width","".concat(this.arrowHeight(),"px")).style("border-bottom-width","0px").style("border-left-width","".concat(this.arrowWidth()/2,"px")).style("border-right-width","".concat(this.arrowWidth()/2,"px"));break;case"s":o=t.y-this.arrowHeight(),n=t.x+this.padding()+this.tooltipWidth()/2-this.arrowWidth()/2,i="border-bottom-color",this._arrowElement.style("border-top-width","0px").style("border-bottom-width","".concat(this.arrowHeight(),"px")).style("border-left-width","".concat(this.arrowWidth()/2,"px")).style("border-right-width","".concat(this.arrowWidth()/2,"px"));break;case"e":o=t.y+this.tooltipHeight()/2+this.padding()-this.arrowWidth()/2,n=t.x-this.arrowHeight(),i="border-right-color",this._arrowElement.style("border-top-width","".concat(this.arrowWidth()/2,"px")).style("border-bottom-width","".concat(this.arrowWidth()/2,"px")).style("border-left-width","0px").style("border-right-width","".concat(this.arrowHeight(),"px"));break;case"w":o=t.y+this.tooltipHeight()/2-this.arrowWidth()/2+this.padding(),n=t.x+this.tooltipWidth()+2*this.padding(),i="border-left-color",this._arrowElement.style("border-top-width","".concat(this.arrowWidth()/2,"px")).style("border-bottom-width","".concat(this.arrowWidth()/2,"px")).style("border-left-width","".concat(this.arrowHeight(),"px")).style("border-right-width","0px")}return void 0!==o&&void 0!==n?this._arrowElement.style("top",o+"px").style("left",n+"px").style(i,this.tooltipColor()).style("opacity",1):this._arrowElement.style("opacity",0),t},n.prototype.getReferenceNode=function(){return this._triggerElement?this._triggerElement.node():this.element().node().parentNode.parentNode},n.prototype.calcReferenceBBox=function(){var t=this.getReferenceNode().getBoundingClientRect(),e=t.top,o=t.left,n=t.width,i=t.height,r=this.tooltipWidth(),l=this.tooltipHeight(),s=r/2,p=l/2,a=this.arrowHeight(),h=this.padding(),c=2*h;return this.followCursor()&&this._cursorLoc&&(o=this._cursorLoc[0],e=this._cursorLoc[1],n=1,i=1),{n:{x:o+n/2-s-h,y:e-l-a-c},e:{x:o+n+a,y:e+i/2-p-h},s:{x:o+n/2-s-h,y:e+i+a},w:{x:o-r-a-c,y:e+i/2-p-h},nw:{x:o-r-c,y:e-l-c},ne:{x:o+n,y:e-l-c},se:{x:o+n,y:e+i},sw:{x:o-r-c,y:e+i}}},n.prototype.mouseout=function(){var t=this;this._closing=!0,this._tooltipElement.on("mouseover",(function(){t._closing=!1})),this._tooltipElement.on("mouseout",(function(){t.mouseout()})),setTimeout((function(){t._closing&&t.visible(!1)}),this.closeDelay())},n.prototype.visible=function(e){return arguments.length?(this._arrowElement&&(this._arrowElement.style("visibility",e?"visible":"hidden"),this._tooltipElement.style("visibility",e?"visible":"hidden")),t.prototype.visible.call(this,e),this):t.prototype.visible.call(this)},n.prototype.exit=function(e,o){this._arrowElement&&(this._arrowElement.remove(),this._tooltipElement.remove()),t.prototype.exit.call(this,e,o)},n}(e.HTMLWidget);r.prototype._class+=" html_HTMLTooltip",r.prototype.publish("fitContent",!1,"boolean","If true, tooltip will grow to fit its html content"),r.prototype.publish("followCursor",!1,"boolean","If true, tooltip will display relative to cursor location"),r.prototype.publish("closeDelay",400,"number","Number of milliseconds to wait before closing tooltip (cancelled on tooltip mouseover event)"),r.prototype.publish("direction","n","set","Direction in which to display the tooltip",["n","s","e","w","ne","nw","se","sw"]),r.prototype.publish("padding",8,"number","Padding (pixels)"),r.prototype.publish("arrowWidth",16,"number","Width (or height depending on direction) of the tooltip arrow (pixels)"),r.prototype.publish("arrowHeight",8,"number","Height (or width depending on direction) of the tooltip arrow (pixels)"),r.prototype.publish("fontColor","#FFF","html-color","The default font color for text in the tooltip"),r.prototype.publish("tooltipColor","#000000EE","html-color","Background color of the tooltip"),r.prototype.publish("tooltipWidth",200,"number","Width of the tooltip (not including arrow) (pixels)"),r.prototype.publish("tooltipHeight",200,"number","Height of the tooltip (not including arrow) (pixels)"),r.prototype.publish("enablePointerEvents",!1,"boolean","If true, the 'pointer-events: all' style will be used");var l=function(t){function o(){return t.call(this)||this}return i(o,t),o.prototype.transformData=function(){return this.data()},o.prototype.enter=function(e,o){t.prototype.enter.call(this,e,o),this._table=o.append("table"),this._thead=this._table.append("thead"),this._theadRow=this._thead.append("tr"),this._tbody=this._table.append("tbody")},o.prototype.update=function(o,n){t.prototype.update.call(this,o,n),this._table.style("width",this.autoWidth()?"auto":"100%");var i=this._theadRow.selectAll("th").data(this.columns());i.enter().append("th").attr("class",(function(t,e){return"th-".concat(e)})).merge(i).text((function(t){return t.toString()})),i.exit().remove();var r=this._tbody.selectAll("tr").data(this.transformData());r.enter().append("tr").merge(r).each((function(t){var o=e.select(this).selectAll("td").data(t);o.enter().append("td").attr("class",(function(t,e){return"col-".concat(e)})).merge(o).text((function(t){return t.toString()})),o.exit().remove()})),r.exit().remove()},o}(e.HTMLWidget);l.prototype._class+=" html_SimpleTable",l.prototype.publish("autoWidth",!1,"boolean","If true, table width will be set to 'auto'. If false, the width is set to '100%'");var s=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.applyStyleObject=function(t,e){Object.keys(e).forEach((function(o){t.style(o,e[o])}))},e.prototype.update=function(e,o){var n=this;t.prototype.update.call(this,e,o),o.selectAll("tr,th,td").attr("style","").style("font-family",this.fontFamily()).style("color",this.fontColor()),this.theadColumnStyles().forEach((function(t,e){n.applyStyleObject(o.select(".th-".concat(e)),t)})),this.tbodyColumnStyles().forEach((function(t,e){n.applyStyleObject(o.selectAll(".col-".concat(e)),t)}));var i=Object.keys(this.evenRowStyles()).length>0,r=Object.keys(this.lastRowStyles()).length>0,l=o.selectAll("tbody > tr");if(i){var s=l.select((function(t,e){return e%2?this:null}));this.applyStyleObject(s,this.evenRowStyles())}if(r){var p=l.select((function(t,e,o){return e===o.length-1?this:null}));this.applyStyleObject(p,this.lastRowStyles())}},e}(l);s.prototype._class+=" html_StyledTable",s.prototype.publish("fontFamily","Verdana","string","Base font-family used within the table"),s.prototype.publish("fontColor","#333","string","Base font color used within the table"),s.prototype.publish("theadColumnStyles",[],"array",'Array of objects containing styles for the thead columns (ex: [{"color":"red"},{"color":"blue"}])'),s.prototype.publish("tbodyColumnStyles",[],"array",'Array of objects containing styles for the tbody columns (ex: [{"color":"red"},{"color":"blue"}])'),s.prototype.publish("lastRowStyles",{},"object",'Object containing styles for the last row (ex: {"color":"red"})'),s.prototype.publish("evenRowStyles",{},"object",'Object containing styles for even rows (ex: {"background-color":"#AAA"})');var p=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.transformData=function(){var t=this.useCalculatedRowCount()?this.calculateRowCount():this.rowCount();return this.breakdownData(t)},e.prototype.breakdownData=function(t){var e=this.data().length,o=this.data().reduce((function(t,e){return t+e[1]}),0),n=[],i=0;this.data().sort((function(t,e){return t[1]>e[1]?-1:1}));var r=e-t>0;if(this.data().filter((function(e,o){return!r||o<t-1})).forEach((function(t){var e=Math.round(t[1]/o*100);i+=e,n.push([t[0],e+"%"])})),r){var l="".concat(this.otherLabel()," (").concat(e-t+1,")"),s="~"+(100-i)+"%";n.push([l,s])}return n},e.prototype.calculateRowCount=function(){var t=this.columns().length>0?this.thFontSize()+5:0,e=this.fontSize()+5,o=this.height()-t;return Math.floor(o/e)},e.prototype.enter=function(e,o){var n=this;t.prototype.enter.call(this,e,o),this._tooltip=(new r).target(e),this._tooltip.tooltipHTML((function(t){var e,o=n.useCalculatedRowCount()?n.calculateRowCount():n.rowCount(),i=null!==(e=Math.max.apply(Math,t.map((function(t){return n.textSize(t[0],n.fontFamily(),n.fontSize()).height}))))&&void 0!==e?e:n.fontSize(),r=Math.max.apply(Math,t.map((function(t){return n.textSize(t[0],n.fontFamily(),n.fontSize()).width}))),l=2*(r+30)+2*n._tooltip.padding(),s=i*Math.ceil((t.length-o)/2)+2*n._tooltip.padding();n._tooltip.tooltipWidth(l),n._tooltip.tooltipHeight(s);var p=n.breakdownData(n.data().length).slice(o-1);return'<div style="\n width: 100%;\n height: 100%;\n font-size: '.concat(n.fontSize(),'px;\n ">').concat(p.map((function(t){return'<div style="\n float:left;\n width:'.concat(Math.floor(49.5),'%;\n ">').concat(t[0],": ").concat(t[1],"</div>")})).join(""),"</div>")}))},e.prototype.update=function(e,o){if(this.theadColumnStyles_default([{color:this.thFirstColor(),"font-size":this.thFontSize()+"px","font-weight":this.thFontWeight(),"text-align":this.labelAlignment(),width:"auto",padding:"0px"},{width:"1%","font-size":this.thFontSize()+"px","font-weight":this.thFontWeight(),"text-align":this.percentageAlignment(),padding:"0px"}]),this.tbodyColumnStyles_default([{color:this.topLabelColor(),"font-size":this.fontSize()+"px","font-weight":"normal","text-align":this.labelAlignment(),width:"auto",padding:"0px"},{color:this.topPercentageColor(),"font-size":this.fontSize()+"px","font-weight":"normal","text-align":this.percentageAlignment(),width:"1%",padding:"0px"}]),this.lastRowStyles_default([{color:this.otherLabelColor(),"font-size":this.fontSize()+"px","font-weight":this.otherLabelBold()?"bold":"normal","text-align":this.labelAlignment(),width:"auto",padding:"0px"},{color:this.otherLabelColor(),"font-size":this.fontSize()+"px","font-weight":this.otherPercentageBold()?"bold":"normal","text-align":this.percentageAlignment(),width:"1%",padding:"0px"}]),t.prototype.update.call(this,e,o),(this.useCalculatedRowCount()?this.calculateRowCount():this.rowCount())<this.data().length){var n=o.select("tbody > tr:last-child"),i=this;n.on("mouseout.tooltip",(function(t){i._tooltip._triggerElement=n,i._tooltip.visible(!1).render()})).on("mouseenter.tooltip",(function(t){i._tooltip._triggerElement=n,i._tooltip.direction("n").data(i.data()).visible(!0).render()}))}},e}(s);p.prototype._class+=" html_BreakdownTable",p.prototype.publish("useCalculatedRowCount",!0,"boolean","If true, rowCount will be calculated and its default will be overwritten"),p.prototype.publish("rowCount",5,"number","Number of total rows to display (including the 'other' row)",void 0,{disable:function(t){return t.useCalculatedRowCount()}}),p.prototype.publish("fontSize",14,"number","Font size (pixels)"),p.prototype.publish("labelAlignment","left","set","Alignment of the label column text",["left","center","right"]),p.prototype.publish("percentageAlignment","center","set","Alignment of the percentage column text",["left","center","right"]),p.prototype.publish("topLabelColor","#333","html-color","Color of displayed 'top' labels"),p.prototype.publish("topPercentageColor","#1A99D5","html-color","Color of displayed 'top' percentages"),p.prototype.publish("topPercentageBold",!0,"html-color","If true, the 'top' percentages will be bold"),p.prototype.publish("otherLabel","Other","string","Label text for the 'other' row"),p.prototype.publish("otherLabelColor","#AAA","html-color","Color of the 'other' label"),p.prototype.publish("otherLabelBold",!1,"html-color","If true, the 'other' label will be bold"),p.prototype.publish("otherPercentageColor","#AAA","html-color","Color of the 'other' percentage"),p.prototype.publish("otherPercentageBold",!1,"html-color","If true, the 'other' percentage will be bold"),p.prototype.publish("thFontWeight","bold","string","Font weight for th elements"),p.prototype.publish("thFontSize",26,"number","Font size for th elements"),p.prototype.publish("thFirstColor","#333","html-color","Text color of the first th element"),p.prototype.publish("thLastColor","#333","html-color","Text color of the last th element");var a,h,c,u,_,d,f,y={},g=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,b=Array.isArray;function v(t,e){for(var o in e)t[o]=e[o];return t}function w(t){var e=t.parentNode;e&&e.removeChild(t)}function x(t,e,o){var n,i,r,l={};for(r in e)"key"==r?n=e[r]:"ref"==r?i=e[r]:l[r]=e[r];if(arguments.length>2&&(l.children=arguments.length>3?a.call(arguments,2):o),"function"==typeof t&&null!=t.defaultProps)for(r in t.defaultProps)void 0===l[r]&&(l[r]=t.defaultProps[r]);return C(t,l,n,i,null)}function C(t,e,o,n,i){var r={type:t,props:e,key:o,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==i?++c:i,__i:-1,__u:0};return null==i&&null!=h.vnode&&h.vnode(r),r}function k(t){return t.children}function S(t,e){this.props=t,this.context=e}function T(t,e){if(null==e)return t.__?T(t.__,t.__i+1):null;for(var o;e<t.__k.length;e++)if(null!=(o=t.__k[e])&&null!=o.__e)return o.__e;return"function"==typeof t.type?T(t):null}function E(t){var e,o;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(o=t.__k[e])&&null!=o.__e){t.__e=t.__c.base=o.__e;break}return E(t)}}function W(t){(!t.__d&&(t.__d=!0)&&u.push(t)&&!H.__r++||_!==h.debounceRendering)&&((_=h.debounceRendering)||d)(H)}function H(){var t,e,o,n,i,r,l,s,p;for(u.sort(f);t=u.shift();)t.__d&&(e=u.length,n=void 0,r=(i=(o=t).__v).__e,s=[],p=[],(l=o.__P)&&((n=v({},i)).__v=i.__v+1,h.vnode&&h.vnode(n),D(l,n,i,o.__n,void 0!==l.ownerSVGElement,32&i.__u?[r]:null,s,null==r?T(i):r,!!(32&i.__u),p),n.__v=i.__v,n.__.__k[n.__i]=n,z(s,n,p),n.__e!=r&&E(n)),u.length>e&&u.sort(f));H.__r=0}function A(t,e,o,n,i,r,l,s,p,a,h){var c,u,_,d,f,m=n&&n.__k||g,b=e.length;for(o.__d=p,B(o,e,m),p=o.__d,c=0;c<b;c++)null!=(_=o.__k[c])&&"boolean"!=typeof _&&"function"!=typeof _&&(u=-1===_.__i?y:m[_.__i]||y,_.__i=c,D(t,_,u,i,r,l,s,p,a,h),d=_.__e,_.ref&&u.ref!=_.ref&&(u.ref&&O(u.ref,null,_),h.push(_.ref,_.__c||d,_)),null==f&&null!=d&&(f=d),65536&_.__u||u.__k===_.__k?(d||u.__e!=p||(p=T(u)),p=F(_,p,t)):"function"==typeof _.type&&void 0!==_.__d?p=_.__d:d&&(p=d.nextSibling),_.__d=void 0,_.__u&=-196609);o.__d=p,o.__e=f}function B(t,e,o){var n,i,r,l,s,p=e.length,a=o.length,h=a,c=0;for(t.__k=[],n=0;n<p;n++)l=n+c,null!=(i=t.__k[n]=null==(i=e[n])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?C(null,i,null,null,null):b(i)?C(k,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?C(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=t,i.__b=t.__b+1,s=P(i,o,l,h),i.__i=s,r=null,-1!==s&&(h--,(r=o[s])&&(r.__u|=131072)),null==r||null===r.__v?(-1==s&&c--,"function"!=typeof i.type&&(i.__u|=65536)):s!==l&&(s===l+1?c++:s>l?h>p-l?c+=s-l:c--:s<l?s==l-1&&(c=s-l):c=0,s!==n+c&&(i.__u|=65536))):(r=o[l])&&null==r.key&&r.__e&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=T(r)),I(r,r,!1),o[l]=null,h--);if(h)for(n=0;n<a;n++)null!=(r=o[n])&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=T(r)),I(r,r))}function F(t,e,o){var n,i;if("function"==typeof t.type){for(n=t.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=t,e=F(n[i],e,o));return e}t.__e!=e&&(o.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function P(t,e,o,n){var i=t.key,r=t.type,l=o-1,s=o+1,p=e[o];if(null===p||p&&i==p.key&&r===p.type&&!(131072&p.__u))return o;if(n>(null==p||131072&p.__u?0:1))for(;l>=0||s<e.length;){if(l>=0){if((p=e[l])&&!(131072&p.__u)&&i==p.key&&r===p.type)return l;l--}if(s<e.length){if((p=e[s])&&!(131072&p.__u)&&i==p.key&&r===p.type)return s;s++}}return-1}function R(t,e,o){"-"===e[0]?t.setProperty(e,null==o?"":o):t[e]=null==o?"":"number"!=typeof o||m.test(e)?o:o+"px"}function L(t,e,o,n,i){var r;t:if("style"===e)if("string"==typeof o)t.style.cssText=o;else{if("string"==typeof n&&(t.style.cssText=n=""),n)for(e in n)o&&e in o||R(t.style,e,"");if(o)for(e in o)n&&o[e]===n[e]||R(t.style,e,o[e])}else if("o"===e[0]&&"n"===e[1])r=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||"onFocusOut"===e||"onFocusIn"===e?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=o,o?n?o.u=n.u:(o.u=Date.now(),t.addEventListener(e,r?N:M,r)):t.removeEventListener(e,r?N:M,r);else{if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&"role"!==e&&e in t)try{t[e]=null==o?"":o;break t}catch(t){}"function"==typeof o||(null==o||!1===o&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,o))}}function M(t){if(this.l){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(h.event?h.event(t):t)}}function N(t){if(this.l)return this.l[t.type+!0](h.event?h.event(t):t)}function D(t,e,o,n,i,r,l,s,p,a){var c,u,_,d,f,y,g,m,w,x,C,T,E,W,H,B=e.type;if(void 0!==e.constructor)return null;128&o.__u&&(p=!!(32&o.__u),r=[s=e.__e=o.__e]),(c=h.__b)&&c(e);t:if("function"==typeof B)try{if(m=e.props,w=(c=B.contextType)&&n[c.__c],x=c?w?w.props.value:c.__:n,o.__c?g=(u=e.__c=o.__c).__=u.__E:("prototype"in B&&B.prototype.render?e.__c=u=new B(m,x):(e.__c=u=new S(m,x),u.constructor=B,u.render=U),w&&w.sub(u),u.props=m,u.state||(u.state={}),u.context=x,u.__n=n,_=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=B.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=v({},u.__s)),v(u.__s,B.getDerivedStateFromProps(m,u.__s))),d=u.props,f=u.state,u.__v=e,_)null==B.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==B.getDerivedStateFromProps&&m!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(m,x),!u.__e&&(null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(m,u.__s,x)||e.__v===o.__v)){for(e.__v!==o.__v&&(u.props=m,u.state=u.__s,u.__d=!1),e.__e=o.__e,e.__k=o.__k,e.__k.forEach((function(t){t&&(t.__=e)})),C=0;C<u._sb.length;C++)u.__h.push(u._sb[C]);u._sb=[],u.__h.length&&l.push(u);break t}null!=u.componentWillUpdate&&u.componentWillUpdate(m,u.__s,x),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(d,f,y)}))}if(u.context=x,u.props=m,u.__P=t,u.__e=!1,T=h.__r,E=0,"prototype"in B&&B.prototype.render){for(u.state=u.__s,u.__d=!1,T&&T(e),c=u.render(u.props,u.state,u.context),W=0;W<u._sb.length;W++)u.__h.push(u._sb[W]);u._sb=[]}else do{u.__d=!1,T&&T(e),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++E<25);u.state=u.__s,null!=u.getChildContext&&(n=v(v({},n),u.getChildContext())),_||null==u.getSnapshotBeforeUpdate||(y=u.getSnapshotBeforeUpdate(d,f)),A(t,b(H=null!=c&&c.type===k&&null==c.key?c.props.children:c)?H:[H],e,o,n,i,r,l,s,p,a),u.base=e.__e,e.__u&=-161,u.__h.length&&l.push(u),g&&(u.__E=u.__=null)}catch(t){e.__v=null,p||null!=r?(e.__e=s,e.__u|=p?160:32,r[r.indexOf(s)]=null):(e.__e=o.__e,e.__k=o.__k),h.__e(t,e,o)}else null==r&&e.__v===o.__v?(e.__k=o.__k,e.__e=o.__e):e.__e=j(o.__e,e,o,n,i,r,l,p,a);(c=h.diffed)&&c(e)}function z(t,e,o){e.__d=void 0;for(var n=0;n<o.length;n++)O(o[n],o[++n],o[++n]);h.__c&&h.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){h.__e(t,e.__v)}}))}function j(t,e,o,n,i,r,l,s,p){var h,c,u,_,d,f,g,m=o.props,v=e.props,x=e.type;if("svg"===x&&(i=!0),null!=r)for(h=0;h<r.length;h++)if((d=r[h])&&"setAttribute"in d==!!x&&(x?d.localName===x:3===d.nodeType)){t=d,r[h]=null;break}if(null==t){if(null===x)return document.createTextNode(v);t=i?document.createElementNS("http://www.w3.org/2000/svg",x):document.createElement(x,v.is&&v),r=null,s=!1}if(null===x)m===v||s&&t.data===v||(t.data=v);else{if(r=r&&a.call(t.childNodes),m=o.props||y,!s&&null!=r)for(m={},h=0;h<t.attributes.length;h++)m[(d=t.attributes[h]).name]=d.value;for(h in m)d=m[h],"children"==h||("dangerouslySetInnerHTML"==h?u=d:"key"===h||h in v||L(t,h,null,d,i));for(h in v)d=v[h],"children"==h?_=d:"dangerouslySetInnerHTML"==h?c=d:"value"==h?f=d:"checked"==h?g=d:"key"===h||s&&"function"!=typeof d||m[h]===d||L(t,h,d,m[h],i);if(c)s||u&&(c.__html===u.__html||c.__html===t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(u&&(t.innerHTML=""),A(t,b(_)?_:[_],e,o,n,i&&"foreignObject"!==x,r,l,r?r[0]:o.__k&&T(o,0),s,p),null!=r)for(h=r.length;h--;)null!=r[h]&&w(r[h]);s||(h="value",void 0!==f&&(f!==t[h]||"progress"===x&&!f||"option"===x&&f!==m[h])&&L(t,h,f,m[h],!1),h="checked",void 0!==g&&g!==t[h]&&L(t,h,g,m[h],!1))}return t}function O(t,e,o){try{"function"==typeof t?t(e):t.current=e}catch(t){h.__e(t,o)}}function I(t,e,o){var n,i;if(h.unmount&&h.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||O(n,null,e)),null!=(n=t.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(t){h.__e(t,e)}n.base=n.__P=null,t.__c=void 0}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&I(n[i],e,o||"function"!=typeof t.type);o||null==t.__e||w(t.__e),t.__=t.__e=t.__d=void 0}function U(t,e,o){return this.constructor(t,o)}a=g.slice,h={__e:function(t,e,o,n){for(var i,r,l;e=e.__;)if((i=e.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(t)),l=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t,n||{}),l=i.__d),l)return i.__E=i}catch(e){t=e}throw t}},c=0,S.prototype.setState=function(t,e){var o;o=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=v({},this.state),"function"==typeof t&&(t=t(v({},o),this.props)),t&&v(o,t),null!=t&&this.__v&&(e&&this._sb.push(e),W(this))},S.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),W(this))},S.prototype.render=k,u=[],d="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(t,e){return t.__v.__b-e.__v.__b},H.__r=0;var V,q,$,G=[],J=[],K=h,X=K.__b,Q=K.__r,Y=K.diffed,Z=K.__c,tt=K.unmount,et=K.__;function ot(){for(var t;t=G.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(rt),t.__H.__h.forEach(lt),t.__H.__h=[]}catch(e){t.__H.__h=[],K.__e(e,t.__v)}}K.__b=function(t){V=null,X&&X(t)},K.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),et&&et(t,e)},K.__r=function(t){Q&&Q(t);var e=(V=t.__c).__H;e&&(q===V?(e.__h=[],V.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=J,t.__N=t.i=void 0}))):(e.__h.forEach(rt),e.__h.forEach(lt),e.__h=[])),q=V},K.diffed=function(t){Y&&Y(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==G.push(e)&&$===K.requestAnimationFrame||(($=K.requestAnimationFrame)||it)(ot)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==J&&(t.__=t.__V),t.i=void 0,t.__V=J}))),q=V=null},K.__c=function(t,e){e.some((function(t){try{t.__h.forEach(rt),t.__h=t.__h.filter((function(t){return!t.__||lt(t)}))}catch(o){e.some((function(t){t.__h&&(t.__h=[])})),e=[],K.__e(o,t.__v)}})),Z&&Z(t,e)},K.unmount=function(t){tt&&tt(t);var e,o=t.__c;o&&o.__H&&(o.__H.__.forEach((function(t){try{rt(t)}catch(t){e=t}})),o.__H=void 0,e&&K.__e(e,o.__v))};var nt="function"==typeof requestAnimationFrame;function it(t){var e,o=function(){clearTimeout(n),nt&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(o,100);nt&&(e=requestAnimationFrame(o))}function rt(t){var e=V,o=t.__c;"function"==typeof o&&(t.__c=void 0,o()),V=e}function lt(t){var e=V;t.__c=t.__(),V=e}var st=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.jsxRender=function(t,e){this.rootNode=function(t,e,o){var n,i,r,l;h.__&&h.__(t,e),i=(n="function"==typeof o)?null:o&&o.__k||e.__k,r=[],l=[],D(e,t=(!n&&o||e).__k=x(k,null,[t]),i||y,y,void 0!==e.ownerSVGElement,!n&&o?[o]:i?null:e.firstChild?a.call(e.childNodes):null,r,!n&&o?o:i?i.__e:e.firstChild,n,l),z(r,t,l)}(t,e,this.rootNode)},e.Component=S,e.createElement=x,e}(e.HTMLWidget);st.prototype._class+=" html_JSXWidget";var pt=function(){function t(t,e){this._attrs=t,this._children=e}return t.prototype.type=function(){return"div"},t.prototype.attrs=function(){return this._attrs},t.prototype.attr=function(t){return this._attrs[t]},t.prototype.children=function(){return this._children},t.prototype.update=function(t){for(var e in this._attrs)t.attr(e,this._attrs[e])},t.prototype.render=function(t){var o=t.selectAll("".concat(t.node().tagName," > *")).data([this]);return o.exit().remove(),o.enter().append(this.type()).attr("reactd3",0).merge(o).each((function(t){var o=e.select(this);t.update(o),t.renderChildren(o)}))},t.prototype.renderChildren=function(t){var o=t.selectAll("".concat(t.node().tagName," > *")).data(this._children);return o.exit().remove(),o.enter().append((function(t){return document.createElement(t.type())})).attr("reactd3",(function(t,e){return e})).merge(o).each((function(t){var o=e.select(this);t.update(o),t.renderChildren(o)}))},t}(),at=function(t){function e(e,o,n){var i=t.call(this,o,n)||this;return i._type=e,i}return i(e,t),e.prototype.type=function(){return this._type},e}(pt),ht=function(t){function e(e){var o=t.call(this,{},[])||this;return o._text=e,o}return i(e,t),e.prototype.type=function(){return"span"},e.prototype.update=function(e){t.prototype.update.call(this,e),e.text(this._text)},e}(pt);var ct=function(){function t(){}return t.createElement=function(t,e){for(var o,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return(o=t).prototype&&o.prototype instanceof pt?new t(e):function(t){return"function"==typeof t}(t)?t(e):new at(t,e,n.map((function(t){return"string"==typeof t?new ht(t):t})))},t.render=function(t,e){t.render(e)},t}(),ut=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.refreshProps=function(){for(var t in this.props)this.widget[t]&&"function"==typeof this.widget[t]&&this.widget[t](this.props[t])},e.prototype.componentDidMount=function(){this.widget=(new this.props.type).target(this.base),this.refreshProps(),this.widget.render()},e.prototype.componentWillUnmount=function(){this.widget.target(null).render()},e.prototype.render=function(){return x("div",{style:this.props.style})},e.prototype.componentDidUpdate=function(){this.refreshProps(),this.widget.render()},e}(st.Component),_t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.refreshProps=function(){for(var t in this.props)this.widget[t]&&"function"==typeof this.widget[t]&&this.widget[t](this.props[t])},e.prototype.componentDidMount=function(){this.widget=this.props.instance.target(this.base),this.refreshProps(),this.widget.render()},e.prototype.componentWillUnmount=function(){this.widget.target(null).render()},e.prototype.render=function(){return x("div",{style:this.props.style})},e.prototype.componentDidUpdate=function(){this.refreshProps(),this.widget.render()},e}(st.Component),dt=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return i(o,t),o.prototype.transformData=function(){var t=this,o=[["Total",0,0]],n=this.data();return n.forEach((function(t){o[0][1]+=t[1],o[0][2]+=t[2]})),n.concat(o).map((function(o){return[o[0],t.secondColumnFormat_exists()?e.format(t.secondColumnFormat())(o[1]):o[1],t.thirdColumnFormat_exists()?e.format(t.thirdColumnFormat())(o[2]):o[2]]}))},o.prototype.update=function(e,o){this.tbodyColumnStyles_default([{"font-weight":"bold",width:this.firstColumnWidth(),"text-align":"left"},{width:this.secondColumnWidth(),"text-align":"right"},{width:this.thirdColumnWidth(),"text-align":"right"}]),this.evenRowStyles_default([{"font-weight":"bold",width:this.firstColumnWidth(),"text-align":"left","font-color":this.evenRowFontColor(),"background-color":this.evenRowBackgroundColor()},{width:this.secondColumnWidth(),"text-align":"right","font-color":this.evenRowFontColor(),"background-color":this.evenRowBackgroundColor()},{width:this.thirdColumnWidth(),"text-align":"right","font-color":this.evenRowFontColor(),"background-color":this.evenRowBackgroundColor()}]),this.lastRowStyles_default({"font-weight":"bold"}),t.prototype.update.call(this,e,o)},o}(s);dt.prototype._class+=" html_StatsTable",dt.prototype.publish("labelColor","#333","html-color","Color of the text in the first column"),dt.prototype.publish("primaryValueColor","#333","html-color","Color of the text in the second column"),dt.prototype.publish("secondaryValueColor","#333","html-color","Color of the text in the third column"),dt.prototype.publish("evenRowBackgroundColor","#333","html-color","Background color of the even rows"),dt.prototype.publish("evenRowFontColor","#333","html-color","Font color of the even rows"),dt.prototype.publish("firstColumnWidth","auto","string","CSS style applied as the 'width' for the first column (ex: 40px)"),dt.prototype.publish("secondColumnWidth","1%","string","CSS style applied as the 'width' for the second column (ex: 40px)"),dt.prototype.publish("thirdColumnWidth","1%","string","CSS style applied as the 'width' for the third column (ex: 40px)"),dt.prototype.publish("secondColumnFormat","$,.0f","string","d3-format specifier applied to the second column's values",void 0,{optional:!0}),dt.prototype.publish("thirdColumnFormat",null,"string","d3-format specifier applied to the third column's values",void 0,{optional:!0});!function(t,e){void 0===e&&(e={});var o=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===o&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}("#wrap{width:100%}#left,#right{padding:5px}#left{background-color:red;display:block;overflow:hidden;text-align:left;text-overflow:ellipsis}#left,#right{white-space:nowrap}#right{background-color:orange;float:right;text-align:right}.html_TitleBar>.main{display:block;width:100%}.html_TitleBar .title{display:block;font-size:20px;font-weight:700;overflow:hidden;padding:4px;text-align:left;text-overflow:ellipsis;white-space:nowrap}.html_TitleBar .icon-bar{float:right;line-height:28px;padding:4px;text-align:right;white-space:nowrap}.html_TitleBar .icon-bar-item,.html_TitleBar .icon-bar-item>div{display:inline}.html_TitleBar .icon-bar a{color:#a9a9a9;padding-bottom:4px;padding-top:4px;text-align:center;transition:all .3s ease}.html_TitleBar .icon-bar a:hover{background-color:#f5f5f5}.html_TitleBar .icon-bar a.selected{background-color:#efe5e5}.html_TitleBar .icon-bar a.spacer{color:none;padding-bottom:0;padding-left:8px;padding-top:2px;text-align:center}.html_TitleBar .icon-bar a.spacer:hover{background-color:transparent}.html_TitleBar .icon-bar .active{background-color:#4caf50}");var ft=function(t){function e(e){var o=t.call(this)||this;return o._owner=e,o._tag="a",o}return i(e,t),e}(e.HTMLWidget),yt=function(t){function e(e,o){var n=t.call(this,e)||this;return n._icon=o,n}return i(e,t),e.prototype.icon=function(){return this._icon},e.prototype.enter=function(e,o){var n=this;t.prototype.enter.call(this,e,o),o.attr("href","#").on("click",(function(t,e,o){return n._owner.titleBarClick(n,t,e,o)})).append("i").attr("class","fa ".concat(this._icon," fa-lg fa-fw"))},e}(ft),gt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.enter=function(e,o){var n=this;o.on("click.sel",(function(t,e,o){n.selected(!n.selected()),n.render()})),t.prototype.enter.call(this,e,o)},e.prototype.update=function(e,o){t.prototype.update.call(this,e,o),this._element.classed("selected",this.selected())},e}(yt);gt.prototype.publish("selected",!1,"boolean");var mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.enter=function(e,o){t.prototype.enter.call(this,e,o),o.attr("class","spacer").attr("href","#").append("i")},e}(ft),bt=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.enter=function(e,o){t.prototype.enter.call(this,e,o),this._divMain=o.append("div").attr("class","main"),this._divIconBar=this._divMain.append("div").attr("class","icon-bar"),this._divTitle=this._divMain.append("div").attr("class","title")},e.prototype.update=function(e,o){t.prototype.update.call(this,e,o),this._divTitle.text(this.title());var n=this._divIconBar.selectAll(".icon-bar-item").data(this.buttons());n.enter().append("div").attr("class","icon-bar-item").each((function(t){t.target(this)})).merge(n).each((function(t){t.render()})),n.exit().each((function(t){t.target(null)})).remove(),n.order()},e}(st);bt.prototype._class+=" html_TitleBar",bt.prototype.publish("title","","string"),bt.prototype.publish("buttons",[],"widgetArray"),t.BUILD_VERSION="2.105.9",t.BreakdownTable=p,t.Button=yt,t.HTMLTooltip=r,t.Item=ft,t.JSXWidget=st,t.PKG_NAME="@hpcc-js/html",t.PKG_VERSION="2.42.20",t.ReactD3=ct,t.SimpleTable=l,t.Spacer=mt,t.StatsTable=dt,t.StyledTable=s,t.TitleBar=bt,t.ToggleButton=gt,t.VNode=pt,t.VizComponent=ut,t.VizInstance=_t,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.min.js.map |
{ | ||
"name": "@hpcc-js/html", | ||
"version": "2.42.19", | ||
"version": "2.42.20", | ||
"description": "hpcc-js - Viz HTML", | ||
@@ -41,3 +41,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@hpcc-js/common": "^2.71.16", | ||
"@hpcc-js/common": "^2.71.17", | ||
"@hpcc-js/preact-shim": "^2.16.10", | ||
@@ -63,3 +63,3 @@ "@hpcc-js/util": "^2.51.0" | ||
"homepage": "https://github.com/hpcc-systems/Visualization", | ||
"gitHead": "deee15f00809eeff445088fd7b928a7f4089b713" | ||
"gitHead": "492a0c771c204bed123cbe0c16a5c7e1cdaaa7f3" | ||
} |
export const PKG_NAME = "@hpcc-js/html"; | ||
export const PKG_VERSION = "2.42.19"; | ||
export const BUILD_VERSION = "2.105.6"; | ||
export const PKG_VERSION = "2.42.20"; | ||
export const BUILD_VERSION = "2.105.9"; |
export declare const PKG_NAME = "@hpcc-js/html"; | ||
export declare const PKG_VERSION = "2.42.19"; | ||
export declare const BUILD_VERSION = "2.105.6"; | ||
export declare const PKG_VERSION = "2.42.20"; | ||
export declare const BUILD_VERSION = "2.105.9"; | ||
//# sourceMappingURL=__package__.d.ts.map |
export declare const PKG_NAME = "@hpcc-js/html"; | ||
export declare const PKG_VERSION = "2.42.19"; | ||
export declare const BUILD_VERSION = "2.105.6"; | ||
export declare const PKG_VERSION = "2.42.20"; | ||
export declare const BUILD_VERSION = "2.105.9"; | ||
//# sourceMappingURL=__package__.d.ts.map |
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
Updated@hpcc-js/common@^2.71.17