@hpcc-js/html
Advanced tools
Comparing version 2.12.0 to 2.13.0
140
CHANGELOG.md
@@ -6,2 +6,142 @@ # Change Log | ||
# [2.13.0](https://github.com/hpcc-systems/Visualization/compare/@hpcc-js/html@2.8.7...@hpcc-js/html@2.13.0) (2020-08-22) | ||
# 2.33.0 (2020-08-08) | ||
### Features | ||
* Adds react gantt widgets ([cf869fe](https://github.com/hpcc-systems/Visualization/commit/cf869fea1997f54ad4057bd4e939bd39eea071eb)) | ||
# 2.32.0 (2020-08-05) | ||
# 2.31.0 (2020-07-29) | ||
# 2.30.0 (2020-07-29) | ||
# 2.29.0 (2020-07-28) | ||
# 2.28.0 (2020-07-22) | ||
### Features | ||
* **Graph2:** Add vertex tooltip support ([461f096](https://github.com/hpcc-systems/Visualization/commit/461f096dff5b33c1b8d430f27b67dd7240f2a544)), closes [#3646](https://github.com/hpcc-systems/Visualization/issues/3646) | ||
# 2.26.0 (2020-06-26) | ||
# 2.25.0 (2020-06-24) | ||
# 2.24.0 (2020-06-23) | ||
# 2.23.0 (2020-06-23) | ||
# 2.22.0 (2020-06-17) | ||
# 2.21.0 (2020-06-17) | ||
# 2.20.0 (2020-06-17) | ||
# 2.19.0 (2020-06-15) | ||
# 2.18.0 (2020-06-02) | ||
# 2.17.0 (2020-05-31) | ||
# 2.16.0 (2020-05-21) | ||
## 2.15.21 (2020-05-20) | ||
## 2.15.20 (2020-05-20) | ||
## 2.15.19 (2020-05-19) | ||
## 2.15.18 (2020-05-15) | ||
## 2.15.17 (2020-05-15) | ||
## 2.15.16 (2020-05-14) | ||
## 2.15.15 (2020-05-12) | ||
## 2.15.14 (2020-05-07) | ||
## 2.15.13 (2020-04-24) | ||
## 2.15.12 (2020-04-22) | ||
## 2.15.11 (2020-04-21) | ||
## 2.15.10 (2020-04-21) | ||
## 2.15.9 (2020-04-17) | ||
## 2.15.7 (2020-04-11) | ||
# [2.12.0](https://github.com/hpcc-systems/Visualization/compare/@hpcc-js/html@2.8.7...@hpcc-js/html@2.12.0) (2020-08-08) | ||
@@ -8,0 +148,0 @@ |
@@ -5,18 +5,18 @@ import { select, HTMLWidget, format } from '@hpcc-js/common'; | ||
var PKG_NAME = "@hpcc-js/html"; | ||
var PKG_VERSION = "2.12.0"; | ||
var BUILD_VERSION = "2.33.0"; | ||
var PKG_VERSION = "2.13.0"; | ||
var BUILD_VERSION = "2.34.0"; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
Copyright (c) Microsoft Corporation. | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
@@ -28,3 +28,3 @@ /* global Reflect, Promise */ | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
@@ -31,0 +31,0 @@ }; |
@@ -8,18 +8,18 @@ (function (global, factory) { | ||
var PKG_NAME = "@hpcc-js/html"; | ||
var PKG_VERSION = "2.12.0"; | ||
var BUILD_VERSION = "2.33.0"; | ||
var PKG_VERSION = "2.13.0"; | ||
var BUILD_VERSION = "2.34.0"; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
Copyright (c) Microsoft Corporation. | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
@@ -31,3 +31,3 @@ /* global Reflect, Promise */ | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
@@ -34,0 +34,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=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)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};function i(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}var r=function(){return(r=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};var l=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(){for(var t=0,e=0,o=arguments.length;e<o;e++)t+=arguments[e].length;var n=Array(t),i=0;for(e=0;e<o;e++)for(var r=arguments[e],l=0,s=r.length;l<s;l++,i++)n[i]=r[l];return n})(i.querySelectorAll("*")).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}this._contentNode?this.onShowContent(this._contentNode):this._tooltipElement.html(function(){return n._tooltipHTMLCallback(n.data())}),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 '"+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",this.arrowHeight()+"px solid "+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",this.arrowHeight()+"px").style("border-bottom-width","0px").style("border-left-width",this.arrowWidth()/2+"px").style("border-right-width",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",this.arrowHeight()+"px").style("border-left-width",this.arrowWidth()/2+"px").style("border-right-width",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",this.arrowWidth()/2+"px").style("border-bottom-width",this.arrowWidth()/2+"px").style("border-left-width","0px").style("border-right-width",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",this.arrowWidth()/2+"px").style("border-bottom-width",this.arrowWidth()/2+"px").style("border-left-width",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(),e=r({},t.getBoundingClientRect()),o=this.tooltipWidth(),n=this.tooltipHeight(),i=o/2,l=n/2,s=this.arrowHeight(),p=this.padding(),h=2*p;return this.followCursor()&&this._cursorLoc&&(e.left=this._cursorLoc[0],e.top=this._cursorLoc[1],e.width=1,e.height=1),{n:{x:e.left+e.width/2-i-p,y:e.top-n-s-h},e:{x:e.left+e.width+s,y:e.top+e.height/2-l-p},s:{x:e.left+e.width/2-i-p,y:e.top+e.height+s},w:{x:e.left-o-s-h,y:e.top+e.height/2-l-p},nw:{x:e.left-o-h,y:e.top-n-h},ne:{x:e.left+e.width,y:e.top-n-h},se:{x:e.left+e.width,y:e.top+e.height},sw:{x:e.left-o-h,y:e.top+e.height}}},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);l.prototype._class+=" html_HTMLTooltip",l.prototype.publish("followCursor",!1,"boolean","If true, tooltip will display relative to cursor location"),l.prototype.publish("closeDelay",400,"number","Number of milliseconds to wait before closing tooltip (cancelled on tooltip mouseover event)"),l.prototype.publish("direction","n","set","Direction in which to display the tooltip",["n","s","e","w","ne","nw","se","sw"]),l.prototype.publish("padding",8,"number","Padding (pixels)"),l.prototype.publish("arrowWidth",16,"number","Width (or height depending on direction) of the tooltip arrow (pixels)"),l.prototype.publish("arrowHeight",8,"number","Height (or width depending on direction) of the tooltip arrow (pixels)"),l.prototype.publish("fontColor","#FFF","html-color","The default font color for text in the tooltip"),l.prototype.publish("tooltipColor","#000000EE","html-color","Background color of the tooltip"),l.prototype.publish("tooltipWidth",200,"number","Width of the tooltip (not including arrow) (pixels)"),l.prototype.publish("tooltipHeight",200,"number","Height of the tooltip (not including arrow) (pixels)"),l.prototype.publish("enablePointerEvents",!1,"boolean","If true, the 'pointer-events: all' style will be used");var s=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-"+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-"+e}).merge(o).text(function(t){return t.toString()}),o.exit().remove()}),r.exit().remove()},o}(e.HTMLWidget);s.prototype._class+=" html_SimpleTable",s.prototype.publish("autoWidth",!1,"boolean","If true, table width will be set to 'auto'. If false, the width is set to '100%'");var p=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-"+e),t)}),this.tbodyColumnStyles().forEach(function(t,e){n.applyStyleObject(o.selectAll(".col-"+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}(s);p.prototype._class+=" html_StyledTable",p.prototype.publish("fontFamily","Verdana","string","Base font-family used within the table"),p.prototype.publish("fontColor","#333","string","Base font color used within the table"),p.prototype.publish("theadColumnStyles",[],"array",'Array of objects containing styles for the thead columns (ex: [{"color":"red"},{"color":"blue"}])'),p.prototype.publish("tbodyColumnStyles",[],"array",'Array of objects containing styles for the tbody columns (ex: [{"color":"red"},{"color":"blue"}])'),p.prototype.publish("lastRowStyles",{},"object",'Object containing styles for the last row (ex: {"color":"red"})'),p.prototype.publish("evenRowStyles",{},"object",'Object containing styles for even rows (ex: {"background-color":"#AAA"})');var h=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=this.otherLabel()+" ("+(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 l).target(e),this._tooltip.tooltipHTML(function(t){var e=n.useCalculatedRowCount()?n.calculateRowCount():n.rowCount(),o=n.fontSize(),i=Math.max.apply(Math,t.map(function(t){return n.textSize(t[0],"Verdana",n.fontSize()).width})),r=2*(i+30)+2*n._tooltip.padding(),l=o*Math.ceil((t.length-e)/2)+2*n._tooltip.padding();n._tooltip.tooltipWidth(r),n._tooltip.tooltipHeight(l);var s=n.breakdownData(n.data().length).slice(e-1);return'<div style="\n width: 100%;\n height: 100%;\n font-size: '+n.fontSize()+'px\n ">'+s.map(function(t){return'<div style="\n float:left;\n width:'+Math.floor(49.5)+'%;\n ">'+t[0]+": "+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}(p);h.prototype._class+=" html_BreakdownTable",h.prototype.publish("useCalculatedRowCount",!0,"boolean","If true, rowCount will be calculated and its default will be overwritten"),h.prototype.publish("rowCount",5,"number","Number of total rows to display (including the 'other' row)",void 0,{disable:function(t){return t.useCalculatedRowCount()}}),h.prototype.publish("fontSize",14,"number","Font size (pixels)"),h.prototype.publish("labelAlignment","left","set","Alignment of the label column text",["left","center","right"]),h.prototype.publish("percentageAlignment","center","set","Alignment of the percentage column text",["left","center","right"]),h.prototype.publish("topLabelColor","#333","html-color","Color of displayed 'top' labels"),h.prototype.publish("topPercentageColor","#1A99D5","html-color","Color of displayed 'top' percentages"),h.prototype.publish("topPercentageBold",!0,"html-color","If true, the 'top' percentages will be bold"),h.prototype.publish("otherLabel","Other","string","Label text for the 'other' row"),h.prototype.publish("otherLabelColor","#AAA","html-color","Color of the 'other' label"),h.prototype.publish("otherLabelBold",!1,"html-color","If true, the 'other' label will be bold"),h.prototype.publish("otherPercentageColor","#AAA","html-color","Color of the 'other' percentage"),h.prototype.publish("otherPercentageBold",!1,"html-color","If true, the 'other' percentage will be bold"),h.prototype.publish("thFontWeight","bold","string","Font weight for th elements"),h.prototype.publish("thFontSize",26,"number","Font size for th elements"),h.prototype.publish("thFirstColor","#333","html-color","Text color of the first th element"),h.prototype.publish("thLastColor","#333","html-color","Text color of the last th element");var a,u,c,d,f,_={},y=[],g=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function m(t,e){for(var o in e)t[o]=e[o];return t}function b(t){var e=t.parentNode;e&&e.removeChild(t)}function w(t,e,o){var n,i=arguments,r={};for(n in e)"key"!==n&&"ref"!==n&&(r[n]=e[n]);if(arguments.length>3)for(o=[o],n=3;n<arguments.length;n++)o.push(i[n]);if(null!=o&&(r.children=o),"function"==typeof t&&null!=t.defaultProps)for(n in t.defaultProps)void 0===r[n]&&(r[n]=t.defaultProps[n]);return v(t,r,e&&e.key,e&&e.ref)}function v(t,e,o,n){var i={type:t,props:e,key:o,ref:n,__k:null,__:null,__b:0,__e:null,__d:null,__c:null,constructor:void 0};return a.vnode&&a.vnode(i),i}function x(t){return t.children}function C(t,e){this.props=t,this.context=e}function k(t,e){if(null==e)return t.__?k(t.__,t.__.__k.indexOf(t)+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?k(t):null}function S(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 S(t)}}function E(t){(!t.__d&&(t.__d=!0)&&1===u.push(t)||d!==a.debounceRendering)&&((d=a.debounceRendering)||c)(T)}function T(){var t,e,o,n,i,r,l;for(u.sort(function(t,e){return e.__v.__b-t.__v.__b});t=u.pop();)t.__d&&(o=void 0,n=void 0,r=(i=(e=t).__v).__e,(l=e.__P)&&(o=[],n=R(l,i,m({},i),e.__n,void 0!==l.ownerSVGElement,null,o,null==r?k(i):r),F(o,i),n!=r&&S(i)))}function W(t,e,o,n,i,r,l,s,p){var h,a,u,c,d,f,g,m=o&&o.__k||y,w=m.length;if(s==_&&(s=null!=r?r[0]:w?k(o,0):null),h=0,e.__k=A(e.__k,function(o){if(null!=o){if(o.__=e,o.__b=e.__b+1,null===(u=m[h])||u&&o.key==u.key&&o.type===u.type)m[h]=void 0;else for(a=0;a<w;a++){if((u=m[a])&&o.key==u.key&&o.type===u.type){m[a]=void 0;break}u=null}if(c=R(t,o,u=u||_,n,i,r,l,s,p),(a=o.ref)&&u.ref!=a&&(g||(g=[]),u.ref&&g.push(u.ref,null,o),g.push(a,o.__c||c,o)),null!=c){if(null==f&&(f=c),null!=o.__d)c=o.__d,o.__d=null;else if(r==u||c!=s||null==c.parentNode){t:if(null==s||s.parentNode!==t)t.appendChild(c);else{for(d=s,a=0;(d=d.nextSibling)&&a<w;a+=2)if(d==c)break t;t.insertBefore(c,s)}"option"==e.type&&(t.value="")}s=c.nextSibling,"function"==typeof e.type&&(e.__d=c)}}return h++,o}),e.__e=f,null!=r&&"function"!=typeof e.type)for(h=r.length;h--;)null!=r[h]&&b(r[h]);for(h=w;h--;)null!=m[h]&&M(m[h],m[h]);if(g)for(h=0;h<g.length;h++)N(g[h],g[++h],g[++h])}function A(t,e,o){if(null==o&&(o=[]),null==t||"boolean"==typeof t)e&&o.push(e(null));else if(Array.isArray(t))for(var n=0;n<t.length;n++)A(t[n],e,o);else o.push(e?e("string"==typeof t||"number"==typeof t?v(null,t,null,null):null!=t.__e||null!=t.__c?v(t.type,t.props,t.key,null):t):t);return o}function H(t,e,o){"-"===e[0]?t.setProperty(e,o):t[e]="number"==typeof o&&!1===g.test(e)?o+"px":null==o?"":o}function B(t,e,o,n,i){var r,l,s,p,h;if(i?"className"===e&&(e="class"):"class"===e&&(e="className"),"key"===e||"children"===e);else if("style"===e)if(r=t.style,"string"==typeof o)r.cssText=o;else{if("string"==typeof n&&(r.cssText="",n=null),n)for(l in n)o&&l in o||H(r,l,"");if(o)for(s in o)n&&o[s]===n[s]||H(r,s,o[s])}else"o"===e[0]&&"n"===e[1]?(p=e!==(e=e.replace(/Capture$/,"")),h=e.toLowerCase(),e=(h in t?h:e).slice(2),o?(n||t.addEventListener(e,P,p),(t.l||(t.l={}))[e]=o):t.removeEventListener(e,P,p)):"list"!==e&&"tagName"!==e&&"form"!==e&&"type"!==e&&!i&&e in t?t[e]=null==o?"":o:"function"!=typeof o&&"dangerouslySetInnerHTML"!==e&&(e!==(e=e.replace(/^xlink:?/,""))?null==o||!1===o?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),o):null==o||!1===o?t.removeAttribute(e):t.setAttribute(e,o))}function P(t){this.l[t.type](a.event?a.event(t):t)}function R(t,e,o,n,i,r,l,s,p){var h,u,c,d,f,_,y,g,b,w,v=e.type;if(void 0!==e.constructor)return null;(h=a.__b)&&h(e);try{t:if("function"==typeof v){if(g=e.props,b=(h=v.contextType)&&n[h.__c],w=h?b?b.props.value:h.__:n,o.__c?y=(u=e.__c=o.__c).__=u.__E:("prototype"in v&&v.prototype.render?e.__c=u=new v(g,w):(e.__c=u=new C(g,w),u.constructor=v,u.render=j),b&&b.sub(u),u.props=g,u.state||(u.state={}),u.context=w,u.__n=n,c=u.__d=!0,u.__h=[]),null==u.__s&&(u.__s=u.state),null!=v.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=m({},u.__s)),m(u.__s,v.getDerivedStateFromProps(g,u.__s))),d=u.props,f=u.state,c)null==v.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==v.getDerivedStateFromProps&&g!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,w),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,w)){for(u.props=g,u.state=u.__s,u.__d=!1,u.__v=e,e.__e=o.__e,e.__k=o.__k,u.__h.length&&l.push(u),h=0;h<e.__k.length;h++)e.__k[h]&&(e.__k[h].__=e);break t}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,w),null!=u.componentDidUpdate&&u.__h.push(function(){u.componentDidUpdate(d,f,_)})}u.context=w,u.props=g,u.state=u.__s,(h=a.__r)&&h(e),u.__d=!1,u.__v=e,u.__P=t,h=u.render(u.props,u.state,u.context),e.__k=A(null!=h&&h.type==x&&null==h.key?h.props.children:h),null!=u.getChildContext&&(n=m(m({},n),u.getChildContext())),c||null==u.getSnapshotBeforeUpdate||(_=u.getSnapshotBeforeUpdate(d,f)),W(t,e,o,n,i,r,l,s,p),u.base=e.__e,u.__h.length&&l.push(u),y&&(u.__E=u.__=null),u.__e=null}else e.__e=L(o.__e,e,o,n,i,r,l,p);(h=a.diffed)&&h(e)}catch(t){a.__e(t,e,o)}return e.__e}function F(t,e){a.__c&&a.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){a.__e(t,e.__v)}})}function L(t,e,o,n,i,r,l,s){var p,h,a,u,c,d=o.props,f=e.props;if(i="svg"===e.type||i,null==t&&null!=r)for(p=0;p<r.length;p++)if(null!=(h=r[p])&&(null===e.type?3===h.nodeType:h.localName===e.type)){t=h,r[p]=null;break}if(null==t){if(null===e.type)return document.createTextNode(f);t=i?document.createElementNS("http://www.w3.org/2000/svg",e.type):document.createElement(e.type),r=null}if(null===e.type)null!=r&&(r[r.indexOf(t)]=null),d!==f&&(t.data=f);else if(e!==o){if(null!=r&&(r=y.slice.call(t.childNodes)),a=(d=o.props||_).dangerouslySetInnerHTML,u=f.dangerouslySetInnerHTML,!s){if(d===_)for(d={},c=0;c<t.attributes.length;c++)d[t.attributes[c].name]=t.attributes[c].value;(u||a)&&(u&&a&&u.__html==a.__html||(t.innerHTML=u&&u.__html||""))}(function(t,e,o,n,i){var r;for(r in o)r in e||B(t,r,null,o[r],n);for(r in e)i&&"function"!=typeof e[r]||"value"===r||"checked"===r||o[r]===e[r]||B(t,r,e[r],o[r],n)})(t,f,d,i,s),e.__k=e.props.children,u||W(t,e,o,n,"foreignObject"!==e.type&&i,r,l,_,s),s||("value"in f&&void 0!==f.value&&f.value!==t.value&&(t.value=null==f.value?"":f.value),"checked"in f&&void 0!==f.checked&&f.checked!==t.checked&&(t.checked=f.checked))}return t}function N(t,e,o){try{"function"==typeof t?t(e):t.current=e}catch(t){a.__e(t,o)}}function M(t,e,o){var n,i,r;if(a.unmount&&a.unmount(t),(n=t.ref)&&N(n,null,e),o||"function"==typeof t.type||(o=null!=(i=t.__e)),t.__e=t.__d=null,null!=(n=t.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(t){a.__e(t,e)}n.base=n.__P=null}if(n=t.__k)for(r=0;r<n.length;r++)n[r]&&M(n[r],e,o);null!=i&&b(i)}function j(t,e,o){return this.constructor(t,o)}a={__e:function(t,e){for(var o;e=e.__;)if((o=e.__c)&&!o.__)try{if(o.constructor&&null!=o.constructor.getDerivedStateFromError)o.setState(o.constructor.getDerivedStateFromError(t));else{if(null==o.componentDidCatch)continue;o.componentDidCatch(t)}return E(o.__E=o)}catch(e){t=e}throw t}},C.prototype.setState=function(t,e){var o;o=this.__s!==this.state?this.__s:this.__s=m({},this.state),"function"==typeof t&&(t=t(o,this.props)),t&&m(o,t),null!=t&&this.__v&&(this.__e=!1,e&&this.__h.push(e),E(this))},C.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),E(this))},C.prototype.render=x,u=[],c="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=_;var D,z,O=[],I=a.__r,U=a.diffed,V=a.__c,q=a.unmount;function G(){O.some(function(t){t.__P&&(t.__H.u.forEach($),t.__H.u.forEach(J),t.__H.u=[])}),O=[]}function $(t){t.m&&t.m()}function J(t){var e=t.i();"function"==typeof e&&(t.m=e)}a.__r=function(t){I&&I(t),(D=t.__c).__H&&(D.__H.u.forEach($),D.__H.u.forEach(J),D.__H.u=[])},a.diffed=function(t){U&&U(t);var e=t.__c;if(e){var o=e.__H;o&&o.u.length&&(1!==O.push(e)&&z===a.requestAnimationFrame||((z=a.requestAnimationFrame)||function(t){var e,o=function(){clearTimeout(n),cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(o,100);"undefined"!=typeof window&&(e=requestAnimationFrame(o))})(G))}},a.__c=function(t,e){e.some(function(t){t.__h.forEach($),t.__h=t.__h.filter(function(t){return!t.i||J(t)})}),V&&V(t,e)},a.unmount=function(t){q&&q(t);var e=t.__c;if(e){var o=e.__H;o&&o.t.forEach(function(t){return t.m&&t.m()})}};var K=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;a.__&&a.__(t,e),i=(n=o===f)?null:o&&o.__k||e.__k,t=w(x,null,[t]),r=[],R(e,(n?e:o||e).__k=t,i||_,_,void 0!==e.ownerSVGElement,o&&!n?[o]:i?null:y.slice.call(e.childNodes),r,o||_,n),F(r,t)}(t,e,this.rootNode)},e.Component=C,e.createElement=w,e}(e.HTMLWidget);K.prototype._class+=" html_JSXWidget";var X=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(t.node().tagName+" > *").data([this]);return o.exit().each(function(t){return console.log("render: Exit - "+t.type())}).remove(),o.enter().append(this.type()).each(function(t){return console.log("render: Enter - "+t.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(t.node().tagName+" > *").data(this._children);return o.exit().each(function(t){return console.log("renderChildren: Exit - "+t.type())}).remove(),o.enter().append(function(t){return document.createElement(t.type())}).each(function(t){return console.log("renderChildren: Enter - "+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}(),Q=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}(X),Y=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}(X);var Z=function(){function t(){}return t.createElement=function(t,e){for(var o=[],n=2;n<arguments.length;n++)o[n-2]=arguments[n];return function(t){return t.prototype&&t.prototype instanceof X}(t)?new t(e):function(t){return"function"==typeof t}(t)?t(e):new Q(t,e,o.map(function(t){return"string"==typeof t?new Y(t):t}))},t.render=function(t,e){t.render(e)},t}(),tt=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 w("div",{style:this.props.style})},e.prototype.componentDidUpdate=function(){this.refreshProps(),this.widget.render()},e}(K.Component),et=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 w("div",{style:this.props.style})},e.prototype.componentDidUpdate=function(){this.refreshProps(),this.widget.render()},e}(K.Component),ot=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}(p);ot.prototype._class+=" html_StatsTable",ot.prototype.publish("labelColor","#333","html-color","Color of the text in the first column"),ot.prototype.publish("primaryValueColor","#333","html-color","Color of the text in the second column"),ot.prototype.publish("secondaryValueColor","#333","html-color","Color of the text in the third column"),ot.prototype.publish("evenRowBackgroundColor","#333","html-color","Background color of the even rows"),ot.prototype.publish("evenRowFontColor","#333","html-color","Font color of the even rows"),ot.prototype.publish("firstColumnWidth","auto","string","CSS style applied as the 'width' for the first column (ex: 40px)"),ot.prototype.publish("secondColumnWidth","1%","string","CSS style applied as the 'width' for the second column (ex: 40px)"),ot.prototype.publish("thirdColumnWidth","1%","string","CSS style applied as the 'width' for the third column (ex: 40px)"),ot.prototype.publish("secondColumnFormat","$,.0f","string","d3-format specifier applied to the second column's values",void 0,{optional:!0}),ot.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;text-align:left;display:block;text-overflow:ellipsis;overflow:hidden}#left,#right{white-space:nowrap}#right{background-color:orange;float:right;text-align:right}.html_TitleBar>.main{width:100%;display:block}.html_TitleBar .title{padding:4px;text-align:left;display:block;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;font-size:20px;font-weight:700}.html_TitleBar .icon-bar{padding:4px;float:right;text-align:right;white-space:nowrap;line-height:28px}.html_TitleBar .icon-bar-item,.html_TitleBar .icon-bar-item>div{display:inline}.html_TitleBar .icon-bar a{text-align:center;padding-top:4px;padding-bottom:4px;transition:all .3s ease;color:#a9a9a9}.html_TitleBar .icon-bar a:hover{background-color:#f5f5f5}.html_TitleBar .icon-bar a.selected{background-color:#efe5e5}.html_TitleBar .icon-bar a.spacer{text-align:center;padding-top:2px;padding-left:8px;padding-bottom:0;color:none}.html_TitleBar .icon-bar a.spacer:hover{background-color:transparent}.html_TitleBar .icon-bar .active{background-color:#4caf50}");var nt=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),it=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 "+this._icon+" fa-lg fa-fw")},e}(nt),rt=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}(it);rt.prototype.publish("selected",!1,"boolean");var lt=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}(nt),st=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}(K);st.prototype._class+=" html_TitleBar",st.prototype.publish("title","","string"),st.prototype.publish("buttons",[],"widgetArray"),t.BUILD_VERSION="2.33.0",t.BreakdownTable=h,t.Button=it,t.HTMLTooltip=l,t.Item=nt,t.JSXWidget=K,t.PKG_NAME="@hpcc-js/html",t.PKG_VERSION="2.12.0",t.ReactD3=Z,t.SimpleTable=s,t.Spacer=lt,t.StatsTable=ot,t.StyledTable=p,t.TitleBar=st,t.ToggleButton=rt,t.VNode=X,t.VizComponent=tt,t.VizInstance=et,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=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])})(t,e)};function i(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}var r=function(){return(r=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};var l=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(){for(var t=0,e=0,o=arguments.length;e<o;e++)t+=arguments[e].length;var n=Array(t),i=0;for(e=0;e<o;e++)for(var r=arguments[e],l=0,s=r.length;l<s;l++,i++)n[i]=r[l];return n})(i.querySelectorAll("*")).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}this._contentNode?this.onShowContent(this._contentNode):this._tooltipElement.html(function(){return n._tooltipHTMLCallback(n.data())}),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 '"+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",this.arrowHeight()+"px solid "+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",this.arrowHeight()+"px").style("border-bottom-width","0px").style("border-left-width",this.arrowWidth()/2+"px").style("border-right-width",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",this.arrowHeight()+"px").style("border-left-width",this.arrowWidth()/2+"px").style("border-right-width",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",this.arrowWidth()/2+"px").style("border-bottom-width",this.arrowWidth()/2+"px").style("border-left-width","0px").style("border-right-width",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",this.arrowWidth()/2+"px").style("border-bottom-width",this.arrowWidth()/2+"px").style("border-left-width",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(),e=r({},t.getBoundingClientRect()),o=this.tooltipWidth(),n=this.tooltipHeight(),i=o/2,l=n/2,s=this.arrowHeight(),p=this.padding(),h=2*p;return this.followCursor()&&this._cursorLoc&&(e.left=this._cursorLoc[0],e.top=this._cursorLoc[1],e.width=1,e.height=1),{n:{x:e.left+e.width/2-i-p,y:e.top-n-s-h},e:{x:e.left+e.width+s,y:e.top+e.height/2-l-p},s:{x:e.left+e.width/2-i-p,y:e.top+e.height+s},w:{x:e.left-o-s-h,y:e.top+e.height/2-l-p},nw:{x:e.left-o-h,y:e.top-n-h},ne:{x:e.left+e.width,y:e.top-n-h},se:{x:e.left+e.width,y:e.top+e.height},sw:{x:e.left-o-h,y:e.top+e.height}}},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);l.prototype._class+=" html_HTMLTooltip",l.prototype.publish("followCursor",!1,"boolean","If true, tooltip will display relative to cursor location"),l.prototype.publish("closeDelay",400,"number","Number of milliseconds to wait before closing tooltip (cancelled on tooltip mouseover event)"),l.prototype.publish("direction","n","set","Direction in which to display the tooltip",["n","s","e","w","ne","nw","se","sw"]),l.prototype.publish("padding",8,"number","Padding (pixels)"),l.prototype.publish("arrowWidth",16,"number","Width (or height depending on direction) of the tooltip arrow (pixels)"),l.prototype.publish("arrowHeight",8,"number","Height (or width depending on direction) of the tooltip arrow (pixels)"),l.prototype.publish("fontColor","#FFF","html-color","The default font color for text in the tooltip"),l.prototype.publish("tooltipColor","#000000EE","html-color","Background color of the tooltip"),l.prototype.publish("tooltipWidth",200,"number","Width of the tooltip (not including arrow) (pixels)"),l.prototype.publish("tooltipHeight",200,"number","Height of the tooltip (not including arrow) (pixels)"),l.prototype.publish("enablePointerEvents",!1,"boolean","If true, the 'pointer-events: all' style will be used");var s=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-"+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-"+e}).merge(o).text(function(t){return t.toString()}),o.exit().remove()}),r.exit().remove()},o}(e.HTMLWidget);s.prototype._class+=" html_SimpleTable",s.prototype.publish("autoWidth",!1,"boolean","If true, table width will be set to 'auto'. If false, the width is set to '100%'");var p=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-"+e),t)}),this.tbodyColumnStyles().forEach(function(t,e){n.applyStyleObject(o.selectAll(".col-"+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}(s);p.prototype._class+=" html_StyledTable",p.prototype.publish("fontFamily","Verdana","string","Base font-family used within the table"),p.prototype.publish("fontColor","#333","string","Base font color used within the table"),p.prototype.publish("theadColumnStyles",[],"array",'Array of objects containing styles for the thead columns (ex: [{"color":"red"},{"color":"blue"}])'),p.prototype.publish("tbodyColumnStyles",[],"array",'Array of objects containing styles for the tbody columns (ex: [{"color":"red"},{"color":"blue"}])'),p.prototype.publish("lastRowStyles",{},"object",'Object containing styles for the last row (ex: {"color":"red"})'),p.prototype.publish("evenRowStyles",{},"object",'Object containing styles for even rows (ex: {"background-color":"#AAA"})');var h=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=this.otherLabel()+" ("+(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 l).target(e),this._tooltip.tooltipHTML(function(t){var e=n.useCalculatedRowCount()?n.calculateRowCount():n.rowCount(),o=n.fontSize(),i=Math.max.apply(Math,t.map(function(t){return n.textSize(t[0],"Verdana",n.fontSize()).width})),r=2*(i+30)+2*n._tooltip.padding(),l=o*Math.ceil((t.length-e)/2)+2*n._tooltip.padding();n._tooltip.tooltipWidth(r),n._tooltip.tooltipHeight(l);var s=n.breakdownData(n.data().length).slice(e-1);return'<div style="\n width: 100%;\n height: 100%;\n font-size: '+n.fontSize()+'px\n ">'+s.map(function(t){return'<div style="\n float:left;\n width:'+Math.floor(49.5)+'%;\n ">'+t[0]+": "+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}(p);h.prototype._class+=" html_BreakdownTable",h.prototype.publish("useCalculatedRowCount",!0,"boolean","If true, rowCount will be calculated and its default will be overwritten"),h.prototype.publish("rowCount",5,"number","Number of total rows to display (including the 'other' row)",void 0,{disable:function(t){return t.useCalculatedRowCount()}}),h.prototype.publish("fontSize",14,"number","Font size (pixels)"),h.prototype.publish("labelAlignment","left","set","Alignment of the label column text",["left","center","right"]),h.prototype.publish("percentageAlignment","center","set","Alignment of the percentage column text",["left","center","right"]),h.prototype.publish("topLabelColor","#333","html-color","Color of displayed 'top' labels"),h.prototype.publish("topPercentageColor","#1A99D5","html-color","Color of displayed 'top' percentages"),h.prototype.publish("topPercentageBold",!0,"html-color","If true, the 'top' percentages will be bold"),h.prototype.publish("otherLabel","Other","string","Label text for the 'other' row"),h.prototype.publish("otherLabelColor","#AAA","html-color","Color of the 'other' label"),h.prototype.publish("otherLabelBold",!1,"html-color","If true, the 'other' label will be bold"),h.prototype.publish("otherPercentageColor","#AAA","html-color","Color of the 'other' percentage"),h.prototype.publish("otherPercentageBold",!1,"html-color","If true, the 'other' percentage will be bold"),h.prototype.publish("thFontWeight","bold","string","Font weight for th elements"),h.prototype.publish("thFontSize",26,"number","Font size for th elements"),h.prototype.publish("thFirstColor","#333","html-color","Text color of the first th element"),h.prototype.publish("thLastColor","#333","html-color","Text color of the last th element");var a,u,c,d,f,_={},y=[],g=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function m(t,e){for(var o in e)t[o]=e[o];return t}function b(t){var e=t.parentNode;e&&e.removeChild(t)}function w(t,e,o){var n,i=arguments,r={};for(n in e)"key"!==n&&"ref"!==n&&(r[n]=e[n]);if(arguments.length>3)for(o=[o],n=3;n<arguments.length;n++)o.push(i[n]);if(null!=o&&(r.children=o),"function"==typeof t&&null!=t.defaultProps)for(n in t.defaultProps)void 0===r[n]&&(r[n]=t.defaultProps[n]);return v(t,r,e&&e.key,e&&e.ref)}function v(t,e,o,n){var i={type:t,props:e,key:o,ref:n,__k:null,__:null,__b:0,__e:null,__d:null,__c:null,constructor:void 0};return a.vnode&&a.vnode(i),i}function x(t){return t.children}function C(t,e){this.props=t,this.context=e}function k(t,e){if(null==e)return t.__?k(t.__,t.__.__k.indexOf(t)+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?k(t):null}function S(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 S(t)}}function E(t){(!t.__d&&(t.__d=!0)&&1===u.push(t)||d!==a.debounceRendering)&&((d=a.debounceRendering)||c)(T)}function T(){var t,e,o,n,i,r,l;for(u.sort(function(t,e){return e.__v.__b-t.__v.__b});t=u.pop();)t.__d&&(o=void 0,n=void 0,r=(i=(e=t).__v).__e,(l=e.__P)&&(o=[],n=R(l,i,m({},i),e.__n,void 0!==l.ownerSVGElement,null,o,null==r?k(i):r),F(o,i),n!=r&&S(i)))}function W(t,e,o,n,i,r,l,s,p){var h,a,u,c,d,f,g,m=o&&o.__k||y,w=m.length;if(s==_&&(s=null!=r?r[0]:w?k(o,0):null),h=0,e.__k=A(e.__k,function(o){if(null!=o){if(o.__=e,o.__b=e.__b+1,null===(u=m[h])||u&&o.key==u.key&&o.type===u.type)m[h]=void 0;else for(a=0;a<w;a++){if((u=m[a])&&o.key==u.key&&o.type===u.type){m[a]=void 0;break}u=null}if(c=R(t,o,u=u||_,n,i,r,l,s,p),(a=o.ref)&&u.ref!=a&&(g||(g=[]),u.ref&&g.push(u.ref,null,o),g.push(a,o.__c||c,o)),null!=c){if(null==f&&(f=c),null!=o.__d)c=o.__d,o.__d=null;else if(r==u||c!=s||null==c.parentNode){t:if(null==s||s.parentNode!==t)t.appendChild(c);else{for(d=s,a=0;(d=d.nextSibling)&&a<w;a+=2)if(d==c)break t;t.insertBefore(c,s)}"option"==e.type&&(t.value="")}s=c.nextSibling,"function"==typeof e.type&&(e.__d=c)}}return h++,o}),e.__e=f,null!=r&&"function"!=typeof e.type)for(h=r.length;h--;)null!=r[h]&&b(r[h]);for(h=w;h--;)null!=m[h]&&M(m[h],m[h]);if(g)for(h=0;h<g.length;h++)N(g[h],g[++h],g[++h])}function A(t,e,o){if(null==o&&(o=[]),null==t||"boolean"==typeof t)e&&o.push(e(null));else if(Array.isArray(t))for(var n=0;n<t.length;n++)A(t[n],e,o);else o.push(e?e("string"==typeof t||"number"==typeof t?v(null,t,null,null):null!=t.__e||null!=t.__c?v(t.type,t.props,t.key,null):t):t);return o}function H(t,e,o){"-"===e[0]?t.setProperty(e,o):t[e]="number"==typeof o&&!1===g.test(e)?o+"px":null==o?"":o}function B(t,e,o,n,i){var r,l,s,p,h;if(i?"className"===e&&(e="class"):"class"===e&&(e="className"),"key"===e||"children"===e);else if("style"===e)if(r=t.style,"string"==typeof o)r.cssText=o;else{if("string"==typeof n&&(r.cssText="",n=null),n)for(l in n)o&&l in o||H(r,l,"");if(o)for(s in o)n&&o[s]===n[s]||H(r,s,o[s])}else"o"===e[0]&&"n"===e[1]?(p=e!==(e=e.replace(/Capture$/,"")),h=e.toLowerCase(),e=(h in t?h:e).slice(2),o?(n||t.addEventListener(e,P,p),(t.l||(t.l={}))[e]=o):t.removeEventListener(e,P,p)):"list"!==e&&"tagName"!==e&&"form"!==e&&"type"!==e&&!i&&e in t?t[e]=null==o?"":o:"function"!=typeof o&&"dangerouslySetInnerHTML"!==e&&(e!==(e=e.replace(/^xlink:?/,""))?null==o||!1===o?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),o):null==o||!1===o?t.removeAttribute(e):t.setAttribute(e,o))}function P(t){this.l[t.type](a.event?a.event(t):t)}function R(t,e,o,n,i,r,l,s,p){var h,u,c,d,f,_,y,g,b,w,v=e.type;if(void 0!==e.constructor)return null;(h=a.__b)&&h(e);try{t:if("function"==typeof v){if(g=e.props,b=(h=v.contextType)&&n[h.__c],w=h?b?b.props.value:h.__:n,o.__c?y=(u=e.__c=o.__c).__=u.__E:("prototype"in v&&v.prototype.render?e.__c=u=new v(g,w):(e.__c=u=new C(g,w),u.constructor=v,u.render=j),b&&b.sub(u),u.props=g,u.state||(u.state={}),u.context=w,u.__n=n,c=u.__d=!0,u.__h=[]),null==u.__s&&(u.__s=u.state),null!=v.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=m({},u.__s)),m(u.__s,v.getDerivedStateFromProps(g,u.__s))),d=u.props,f=u.state,c)null==v.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==v.getDerivedStateFromProps&&g!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,w),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,w)){for(u.props=g,u.state=u.__s,u.__d=!1,u.__v=e,e.__e=o.__e,e.__k=o.__k,u.__h.length&&l.push(u),h=0;h<e.__k.length;h++)e.__k[h]&&(e.__k[h].__=e);break t}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,w),null!=u.componentDidUpdate&&u.__h.push(function(){u.componentDidUpdate(d,f,_)})}u.context=w,u.props=g,u.state=u.__s,(h=a.__r)&&h(e),u.__d=!1,u.__v=e,u.__P=t,h=u.render(u.props,u.state,u.context),e.__k=A(null!=h&&h.type==x&&null==h.key?h.props.children:h),null!=u.getChildContext&&(n=m(m({},n),u.getChildContext())),c||null==u.getSnapshotBeforeUpdate||(_=u.getSnapshotBeforeUpdate(d,f)),W(t,e,o,n,i,r,l,s,p),u.base=e.__e,u.__h.length&&l.push(u),y&&(u.__E=u.__=null),u.__e=null}else e.__e=L(o.__e,e,o,n,i,r,l,p);(h=a.diffed)&&h(e)}catch(t){a.__e(t,e,o)}return e.__e}function F(t,e){a.__c&&a.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){a.__e(t,e.__v)}})}function L(t,e,o,n,i,r,l,s){var p,h,a,u,c,d=o.props,f=e.props;if(i="svg"===e.type||i,null==t&&null!=r)for(p=0;p<r.length;p++)if(null!=(h=r[p])&&(null===e.type?3===h.nodeType:h.localName===e.type)){t=h,r[p]=null;break}if(null==t){if(null===e.type)return document.createTextNode(f);t=i?document.createElementNS("http://www.w3.org/2000/svg",e.type):document.createElement(e.type),r=null}if(null===e.type)null!=r&&(r[r.indexOf(t)]=null),d!==f&&(t.data=f);else if(e!==o){if(null!=r&&(r=y.slice.call(t.childNodes)),a=(d=o.props||_).dangerouslySetInnerHTML,u=f.dangerouslySetInnerHTML,!s){if(d===_)for(d={},c=0;c<t.attributes.length;c++)d[t.attributes[c].name]=t.attributes[c].value;(u||a)&&(u&&a&&u.__html==a.__html||(t.innerHTML=u&&u.__html||""))}(function(t,e,o,n,i){var r;for(r in o)r in e||B(t,r,null,o[r],n);for(r in e)i&&"function"!=typeof e[r]||"value"===r||"checked"===r||o[r]===e[r]||B(t,r,e[r],o[r],n)})(t,f,d,i,s),e.__k=e.props.children,u||W(t,e,o,n,"foreignObject"!==e.type&&i,r,l,_,s),s||("value"in f&&void 0!==f.value&&f.value!==t.value&&(t.value=null==f.value?"":f.value),"checked"in f&&void 0!==f.checked&&f.checked!==t.checked&&(t.checked=f.checked))}return t}function N(t,e,o){try{"function"==typeof t?t(e):t.current=e}catch(t){a.__e(t,o)}}function M(t,e,o){var n,i,r;if(a.unmount&&a.unmount(t),(n=t.ref)&&N(n,null,e),o||"function"==typeof t.type||(o=null!=(i=t.__e)),t.__e=t.__d=null,null!=(n=t.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(t){a.__e(t,e)}n.base=n.__P=null}if(n=t.__k)for(r=0;r<n.length;r++)n[r]&&M(n[r],e,o);null!=i&&b(i)}function j(t,e,o){return this.constructor(t,o)}a={__e:function(t,e){for(var o;e=e.__;)if((o=e.__c)&&!o.__)try{if(o.constructor&&null!=o.constructor.getDerivedStateFromError)o.setState(o.constructor.getDerivedStateFromError(t));else{if(null==o.componentDidCatch)continue;o.componentDidCatch(t)}return E(o.__E=o)}catch(e){t=e}throw t}},C.prototype.setState=function(t,e){var o;o=this.__s!==this.state?this.__s:this.__s=m({},this.state),"function"==typeof t&&(t=t(o,this.props)),t&&m(o,t),null!=t&&this.__v&&(this.__e=!1,e&&this.__h.push(e),E(this))},C.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),E(this))},C.prototype.render=x,u=[],c="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=_;var D,z,O=[],I=a.__r,U=a.diffed,V=a.__c,q=a.unmount;function G(){O.some(function(t){t.__P&&(t.__H.u.forEach($),t.__H.u.forEach(J),t.__H.u=[])}),O=[]}function $(t){t.m&&t.m()}function J(t){var e=t.i();"function"==typeof e&&(t.m=e)}a.__r=function(t){I&&I(t),(D=t.__c).__H&&(D.__H.u.forEach($),D.__H.u.forEach(J),D.__H.u=[])},a.diffed=function(t){U&&U(t);var e=t.__c;if(e){var o=e.__H;o&&o.u.length&&(1!==O.push(e)&&z===a.requestAnimationFrame||((z=a.requestAnimationFrame)||function(t){var e,o=function(){clearTimeout(n),cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(o,100);"undefined"!=typeof window&&(e=requestAnimationFrame(o))})(G))}},a.__c=function(t,e){e.some(function(t){t.__h.forEach($),t.__h=t.__h.filter(function(t){return!t.i||J(t)})}),V&&V(t,e)},a.unmount=function(t){q&&q(t);var e=t.__c;if(e){var o=e.__H;o&&o.t.forEach(function(t){return t.m&&t.m()})}};var K=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;a.__&&a.__(t,e),i=(n=o===f)?null:o&&o.__k||e.__k,t=w(x,null,[t]),r=[],R(e,(n?e:o||e).__k=t,i||_,_,void 0!==e.ownerSVGElement,o&&!n?[o]:i?null:y.slice.call(e.childNodes),r,o||_,n),F(r,t)}(t,e,this.rootNode)},e.Component=C,e.createElement=w,e}(e.HTMLWidget);K.prototype._class+=" html_JSXWidget";var X=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(t.node().tagName+" > *").data([this]);return o.exit().each(function(t){return console.log("render: Exit - "+t.type())}).remove(),o.enter().append(this.type()).each(function(t){return console.log("render: Enter - "+t.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(t.node().tagName+" > *").data(this._children);return o.exit().each(function(t){return console.log("renderChildren: Exit - "+t.type())}).remove(),o.enter().append(function(t){return document.createElement(t.type())}).each(function(t){return console.log("renderChildren: Enter - "+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}(),Q=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}(X),Y=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}(X);var Z=function(){function t(){}return t.createElement=function(t,e){for(var o=[],n=2;n<arguments.length;n++)o[n-2]=arguments[n];return function(t){return t.prototype&&t.prototype instanceof X}(t)?new t(e):function(t){return"function"==typeof t}(t)?t(e):new Q(t,e,o.map(function(t){return"string"==typeof t?new Y(t):t}))},t.render=function(t,e){t.render(e)},t}(),tt=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 w("div",{style:this.props.style})},e.prototype.componentDidUpdate=function(){this.refreshProps(),this.widget.render()},e}(K.Component),et=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 w("div",{style:this.props.style})},e.prototype.componentDidUpdate=function(){this.refreshProps(),this.widget.render()},e}(K.Component),ot=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}(p);ot.prototype._class+=" html_StatsTable",ot.prototype.publish("labelColor","#333","html-color","Color of the text in the first column"),ot.prototype.publish("primaryValueColor","#333","html-color","Color of the text in the second column"),ot.prototype.publish("secondaryValueColor","#333","html-color","Color of the text in the third column"),ot.prototype.publish("evenRowBackgroundColor","#333","html-color","Background color of the even rows"),ot.prototype.publish("evenRowFontColor","#333","html-color","Font color of the even rows"),ot.prototype.publish("firstColumnWidth","auto","string","CSS style applied as the 'width' for the first column (ex: 40px)"),ot.prototype.publish("secondColumnWidth","1%","string","CSS style applied as the 'width' for the second column (ex: 40px)"),ot.prototype.publish("thirdColumnWidth","1%","string","CSS style applied as the 'width' for the third column (ex: 40px)"),ot.prototype.publish("secondColumnFormat","$,.0f","string","d3-format specifier applied to the second column's values",void 0,{optional:!0}),ot.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;text-align:left;display:block;text-overflow:ellipsis;overflow:hidden}#left,#right{white-space:nowrap}#right{background-color:orange;float:right;text-align:right}.html_TitleBar>.main{width:100%;display:block}.html_TitleBar .title{padding:4px;text-align:left;display:block;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;font-size:20px;font-weight:700}.html_TitleBar .icon-bar{padding:4px;float:right;text-align:right;white-space:nowrap;line-height:28px}.html_TitleBar .icon-bar-item,.html_TitleBar .icon-bar-item>div{display:inline}.html_TitleBar .icon-bar a{text-align:center;padding-top:4px;padding-bottom:4px;transition:all .3s ease;color:#a9a9a9}.html_TitleBar .icon-bar a:hover{background-color:#f5f5f5}.html_TitleBar .icon-bar a.selected{background-color:#efe5e5}.html_TitleBar .icon-bar a.spacer{text-align:center;padding-top:2px;padding-left:8px;padding-bottom:0;color:none}.html_TitleBar .icon-bar a.spacer:hover{background-color:transparent}.html_TitleBar .icon-bar .active{background-color:#4caf50}");var nt=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),it=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 "+this._icon+" fa-lg fa-fw")},e}(nt),rt=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}(it);rt.prototype.publish("selected",!1,"boolean");var lt=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}(nt),st=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}(K);st.prototype._class+=" html_TitleBar",st.prototype.publish("title","","string"),st.prototype.publish("buttons",[],"widgetArray"),t.BUILD_VERSION="2.34.0",t.BreakdownTable=h,t.Button=it,t.HTMLTooltip=l,t.Item=nt,t.JSXWidget=K,t.PKG_NAME="@hpcc-js/html",t.PKG_VERSION="2.13.0",t.ReactD3=Z,t.SimpleTable=s,t.Spacer=lt,t.StatsTable=ot,t.StyledTable=p,t.TitleBar=st,t.ToggleButton=rt,t.VNode=X,t.VizComponent=tt,t.VizInstance=et,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=index.min.js.map |
{ | ||
"name": "@hpcc-js/html", | ||
"version": "2.12.0", | ||
"version": "2.13.0", | ||
"description": "hpcc-js - Viz HTML", | ||
@@ -40,8 +40,8 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@hpcc-js/common": "^2.39.0", | ||
"@hpcc-js/preact-shim": "^2.13.12", | ||
"@hpcc-js/util": "^2.25.0" | ||
"@hpcc-js/common": "^2.40.0", | ||
"@hpcc-js/preact-shim": "^2.13.13", | ||
"@hpcc-js/util": "^2.26.0" | ||
}, | ||
"devDependencies": { | ||
"@hpcc-js/bundle": "^2.10.16", | ||
"@hpcc-js/bundle": "^2.10.17", | ||
"@rollup/plugin-alias": "3.1.0", | ||
@@ -54,3 +54,3 @@ "@rollup/plugin-commonjs": "12.0.0", | ||
"d3-selection": "1.4.0", | ||
"downlevel-dts": "^0.4.0", | ||
"downlevel-dts": "0.6.0", | ||
"eslint": "7.2.0", | ||
@@ -63,5 +63,5 @@ "npm-run-all": "4.1.5", | ||
"terser": "4.0.0", | ||
"tslib": "1.10.0", | ||
"tslib": "2.0.1", | ||
"typedoc": "0.14.2", | ||
"typescript": "3.9.2" | ||
"typescript": "4.0.2" | ||
}, | ||
@@ -79,3 +79,3 @@ "repository": { | ||
"homepage": "https://github.com/hpcc-systems/Visualization", | ||
"gitHead": "a24bc51161418226aa293d887cf6b8fbf4f1ed2c" | ||
"gitHead": "a686988684d0a1c7ce869916a6e6a154944400ac" | ||
} |
export const PKG_NAME = "@hpcc-js/html"; | ||
export const PKG_VERSION = "2.12.0"; | ||
export const BUILD_VERSION = "2.33.0"; | ||
export const PKG_VERSION = "2.13.0"; | ||
export const BUILD_VERSION = "2.34.0"; |
export declare const PKG_NAME = "@hpcc-js/html"; | ||
export declare const PKG_VERSION = "2.12.0"; | ||
export declare const BUILD_VERSION = "2.33.0"; | ||
export declare const PKG_VERSION = "2.13.0"; | ||
export declare const BUILD_VERSION = "2.34.0"; | ||
//# sourceMappingURL=__package__.d.ts.map |
export declare const PKG_NAME = "@hpcc-js/html"; | ||
export declare const PKG_VERSION = "2.12.0"; | ||
export declare const BUILD_VERSION = "2.33.0"; | ||
export declare const PKG_VERSION = "2.13.0"; | ||
export declare const BUILD_VERSION = "2.34.0"; | ||
//# 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
726484
Updated@hpcc-js/common@^2.40.0
Updated@hpcc-js/util@^2.26.0