@hpcc-js/html 2.44.3 → 2.44.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +43 -43
- package/dist/index.es6.js +5 -5
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +4 -4
- package/src/BreakdownTable.ts +218 -218
- package/src/HTMLTooltip.ts +385 -385
- package/src/JSXWidget.ts +13 -13
- package/src/SimpleTable.ts +64 -64
- package/src/StatsTable.ts +103 -103
- package/src/StyledTable.ts +68 -68
- package/src/TitleBar.css +84 -84
- package/src/TitleBar.ts +133 -133
- package/src/VizComponent.tsx +40 -40
- package/src/VizInstance.tsx +40 -40
- package/src/__package__.ts +3 -3
- package/src/index.ts +11 -11
- package/src/reactD3.ts +127 -127
- package/types/__package__.d.ts +2 -2
- package/types/__package__.d.ts.map +1 -1
- package/types-3.4/__package__.d.ts +2 -2
package/dist/index.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!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,b,w={},v=[],x=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,C=Array.isArray;function k(t,e){for(var o in e)t[o]=e[o];return t}function S(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function T(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 E(t,l,n,i,null)}function E(t,e,o,n,i){var r={type:t,props:e,key:o,ref:n,__k:null,__:null,__b:0,__e:null,__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 W(t){return t.children}function H(t,e){this.props=t,this.context=e}function A(t,e){if(null==e)return t.__?A(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?A(t):null}function B(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 B(t)}}function F(t){(!t.__d&&(t.__d=!0)&&u.push(t)&&!R.__r++||_!=h.debounceRendering)&&((_=h.debounceRendering)||d)(R)}function R(){for(var t,e,o,n,i,r,l,s=1;u.length;)u.length>s&&u.sort(f),t=u.shift(),s=u.length,t.__d&&(o=void 0,n=void 0,i=(n=(e=t).__v).__e,r=[],l=[],e.__P&&((o=k({},n)).__v=n.__v+1,h.vnode&&h.vnode(o),j(e.__P,o,n,e.__n,e.__P.namespaceURI,32&n.__u?[i]:null,r,null==i?A(n):i,!!(32&n.__u),l),o.__v=n.__v,o.__.__k[o.__i]=o,O(r,o,l),n.__e=n.__=null,o.__e!=i&&B(o)));R.__r=0}function P(t,e,o,n,i,r,l,s,p,a,h){var c,u,_,d,f,y,g,m=n&&n.__k||v,b=e.length;for(p=function(t,e,o,n,i){var r,l,s,p,a,h=o.length,c=h,u=0;for(t.__k=new Array(i),r=0;r<i;r++)null!=(l=e[r])&&"boolean"!=typeof l&&"function"!=typeof l?("string"==typeof l||"number"==typeof l||"bigint"==typeof l||l.constructor==String?l=t.__k[r]=E(null,l,null,null,null):C(l)?l=t.__k[r]=E(W,{children:l},null,null,null):void 0===l.constructor&&l.__b>0?l=t.__k[r]=E(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):t.__k[r]=l,p=r+u,l.__=t,l.__b=t.__b+1,s=null,-1!=(a=l.__i=L(l,o,p,c))&&(c--,(s=o[a])&&(s.__u|=2)),null==s||null==s.__v?(-1==a&&(i>h?u--:i<h&&u++),"function"!=typeof l.type&&(l.__u|=4)):a!=p&&(a==p-1?u--:a==p+1?u++:(a>p?u--:u++,l.__u|=4))):t.__k[r]=null;if(c)for(r=0;r<h;r++)null!=(s=o[r])&&!(2&s.__u)&&(s.__e==n&&(n=A(s)),$(s,s));return n}(o,e,m,p,b),c=0;c<b;c++)null!=(_=o.__k[c])&&(u=-1==_.__i?w:m[_.__i]||w,_.__i=c,y=j(t,_,u,i,r,l,s,p,a,h),d=_.__e,_.ref&&u.ref!=_.ref&&(u.ref&&q(u.ref,null,_),h.push(_.ref,_.__c||d,_)),null==f&&null!=d&&(f=d),(g=!!(4&_.__u))||u.__k===_.__k?p=M(_,p,t,g):"function"==typeof _.type&&void 0!==y?p=y:d&&(p=d.nextSibling),_.__u&=-7);return o.__e=f,p}function M(t,e,o,n){var i,r;if("function"==typeof t.type){for(i=t.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=t,e=M(i[r],e,o,n));return e}t.__e!=e&&(n&&(e&&t.type&&!e.parentNode&&(e=A(t)),o.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function L(t,e,o,n){var i,r,l,s=t.key,p=t.type,a=e[o],h=null!=a&&!(2&a.__u);if(null===a&&null==s||h&&s==a.key&&p==a.type)return o;if(n>(h?1:0))for(i=o-1,r=o+1;i>=0||r<e.length;)if(null!=(a=e[l=i>=0?i--:r++])&&!(2&a.__u)&&s==a.key&&p==a.type)return l;return-1}function N(t,e,o){"-"==e[0]?t.setProperty(e,null==o?"":o):t[e]=null==o?"":"number"!=typeof o||x.test(e)?o:o+"px"}function z(t,e,o,n,i){var r,l;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||N(t.style,e,"");if(o)for(e in o)n&&o[e]==n[e]||N(t.style,e,o[e])}else if("o"==e[0]&&"n"==e[1])r=e!=(e=e.replace(y,"$1")),l=e.toLowerCase(),e=l in t||"onFocusOut"==e||"onFocusIn"==e?l.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=o,o?n?o.u=n.u:(o.u=g,t.addEventListener(e,r?b:m,r)):t.removeEventListener(e,r?b:m,r);else{if("http://www.w3.org/2000/svg"==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&&"popover"!=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,"popover"==e&&1==o?"":o))}}function D(t){return function(e){if(this.l){var o=this.l[e.type+t];if(null==e.t)e.t=g++;else if(e.t<o.u)return;return o(h.event?h.event(e):e)}}}function j(t,e,o,n,i,r,l,s,p,a){var c,u,_,d,f,y,g,m,b,w,v,x,T,E,A,B,F,R=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 R)try{if(m=e.props,b="prototype"in R&&R.prototype.render,w=(c=R.contextType)&&n[c.__c],v=c?w?w.props.value:c.__:n,o.__c?g=(u=e.__c=o.__c).__=u.__E:(b?e.__c=u=new R(m,v):(e.__c=u=new H(m,v),u.constructor=R,u.render=G),w&&w.sub(u),u.state||(u.state={}),u.__n=n,_=u.__d=!0,u.__h=[],u._sb=[]),b&&null==u.__s&&(u.__s=u.state),b&&null!=R.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=k({},u.__s)),k(u.__s,R.getDerivedStateFromProps(m,u.__s))),d=u.props,f=u.state,u.__v=e,_)b&&null==R.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),b&&null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(b&&null==R.getDerivedStateFromProps&&m!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(m,v),e.__v==o.__v||!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(m,u.__s,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.some(function(t){t&&(t.__=e)}),x=0;x<u._sb.length;x++)u.__h.push(u._sb[x]);u._sb=[],u.__h.length&&l.push(u);break t}null!=u.componentWillUpdate&&u.componentWillUpdate(m,u.__s,v),b&&null!=u.componentDidUpdate&&u.__h.push(function(){u.componentDidUpdate(d,f,y)})}if(u.context=v,u.props=m,u.__P=t,u.__e=!1,T=h.__r,E=0,b){for(u.state=u.__s,u.__d=!1,T&&T(e),c=u.render(u.props,u.state,u.context),A=0;A<u._sb.length;A++)u.__h.push(u._sb[A]);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=k(k({},n),u.getChildContext())),b&&!_&&null!=u.getSnapshotBeforeUpdate&&(y=u.getSnapshotBeforeUpdate(d,f)),B=c,null!=c&&c.type===W&&null==c.key&&(B=U(c.props.children)),s=P(t,C(B)?B:[B],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){if(e.__v=null,p||null!=r)if(t.then){for(e.__u|=p?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;r[r.indexOf(s)]=null,e.__e=s}else{for(F=r.length;F--;)S(r[F]);I(e)}else e.__e=o.__e,e.__k=o.__k,t.then||I(e);h.__e(t,e,o)}else null==r&&e.__v==o.__v?(e.__k=o.__k,e.__e=o.__e):s=e.__e=V(o.__e,e,o,n,i,r,l,p,a);return(c=h.diffed)&&c(e),128&e.__u?void 0:s}function I(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(I)}function O(t,e,o){for(var n=0;n<o.length;n++)q(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 U(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:C(t)?t.map(U):k({},t)}function V(t,e,o,n,i,r,l,s,p){var c,u,_,d,f,y,g,m=o.props||w,b=e.props,v=e.type;if("svg"==v?i="http://www.w3.org/2000/svg":"math"==v?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=r)for(c=0;c<r.length;c++)if((f=r[c])&&"setAttribute"in f==!!v&&(v?f.localName==v:3==f.nodeType)){t=f,r[c]=null;break}if(null==t){if(null==v)return document.createTextNode(b);t=document.createElementNS(i,v,b.is&&b),s&&(h.__m&&h.__m(e,r),s=!1),r=null}if(null==v)m===b||s&&t.data==b||(t.data=b);else{if(r=r&&a.call(t.childNodes),!s&&null!=r)for(m={},c=0;c<t.attributes.length;c++)m[(f=t.attributes[c]).name]=f.value;for(c in m)if(f=m[c],"children"==c);else if("dangerouslySetInnerHTML"==c)_=f;else if(!(c in b)){if("value"==c&&"defaultValue"in b||"checked"==c&&"defaultChecked"in b)continue;z(t,c,null,f,i)}for(c in b)f=b[c],"children"==c?d=f:"dangerouslySetInnerHTML"==c?u=f:"value"==c?y=f:"checked"==c?g=f:s&&"function"!=typeof f||m[c]===f||z(t,c,f,m[c],i);if(u)s||_&&(u.__html==_.__html||u.__html==t.innerHTML)||(t.innerHTML=u.__html),e.__k=[];else if(_&&(t.innerHTML=""),P("template"==e.type?t.content:t,C(d)?d:[d],e,o,n,"foreignObject"==v?"http://www.w3.org/1999/xhtml":i,r,l,r?r[0]:o.__k&&A(o,0),s,p),null!=r)for(c=r.length;c--;)S(r[c]);s||(c="value","progress"==v&&null==y?t.removeAttribute("value"):null!=y&&(y!==t[c]||"progress"==v&&!y||"option"==v&&y!=m[c])&&z(t,c,y,m[c],i),c="checked",null!=g&&g!=t[c]&&z(t,c,g,m[c],i))}return t}function q(t,e,o){try{if("function"==typeof t){var n="function"==typeof t.__u;n&&t.__u(),n&&null==e||(t.__u=t(e))}else t.current=e}catch(t){h.__e(t,o)}}function $(t,e,o){var n,i;if(h.unmount&&h.unmount(t),(n=t.ref)&&(n.current&&n.current!=t.__e||q(n,null,e)),null!=(n=t.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(t){h.__e(t,e)}n.base=n.__P=null}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&$(n[i],e,o||"function"!=typeof t.type);o||S(t.__e),t.__c=t.__=t.__e=void 0}function G(t,e,o){return this.constructor(t,o)}a=v.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,H.prototype.setState=function(t,e){var o;o=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=k({},this.state),"function"==typeof t&&(t=t(k({},o),this.props)),t&&k(o,t),null!=t&&this.__v&&(e&&this._sb.push(e),F(this))},H.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),F(this))},H.prototype.render=W,u=[],d="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(t,e){return t.__v.__b-e.__v.__b},R.__r=0,y=/(PointerCapture)$|Capture$/i,g=0,m=D(!1),b=D(!0);var J,K,X,Q=[],Y=h,Z=Y.__b,tt=Y.__r,et=Y.diffed,ot=Y.__c,nt=Y.unmount,it=Y.__;function rt(){for(var t;t=Q.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(pt),t.__H.__h.forEach(at),t.__H.__h=[]}catch(e){t.__H.__h=[],Y.__e(e,t.__v)}}Y.__b=function(t){J=null,Z&&Z(t)},Y.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),it&&it(t,e)},Y.__r=function(t){tt&&tt(t);var e=(J=t.__c).__H;e&&(K===J?(e.__h=[],J.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.forEach(pt),e.__h.forEach(at),e.__h=[])),K=J},Y.diffed=function(t){et&&et(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Q.push(e)&&X===Y.requestAnimationFrame||((X=Y.requestAnimationFrame)||st)(rt)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),K=J=null},Y.__c=function(t,e){e.some(function(t){try{t.__h.forEach(pt),t.__h=t.__h.filter(function(t){return!t.__||at(t)})}catch(o){e.some(function(t){t.__h&&(t.__h=[])}),e=[],Y.__e(o,t.__v)}}),ot&&ot(t,e)},Y.unmount=function(t){nt&&nt(t);var e,o=t.__c;o&&o.__H&&(o.__H.__.forEach(function(t){try{pt(t)}catch(t){e=t}}),o.__H=void 0,e&&Y.__e(e,o.__v))};var lt="function"==typeof requestAnimationFrame;function st(t){var e,o=function(){clearTimeout(n),lt&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(o,35);lt&&(e=requestAnimationFrame(o))}function pt(t){var e=J,o=t.__c;"function"==typeof o&&(t.__c=void 0,o()),J=e}function at(t){var e=J;t.__c=t.__(),J=e}var ht=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;e==document&&(e=document.documentElement),h.__&&h.__(t,e),i=(n="function"==typeof o)?null:o&&o.__k||e.__k,r=[],l=[],j(e,t=(!n&&o||e).__k=T(W,null,[t]),i||w,w,e.namespaceURI,!n&&o?[o]:i?null:e.firstChild?a.call(e.childNodes):null,r,!n&&o?o:i?i.__e:e.firstChild,n,l),O(r,t,l)}(t,e,this.rootNode)},e.Component=H,e.createElement=T,e}(e.HTMLWidget);ht.prototype._class+=" html_JSXWidget";var ct=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}(),ut=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}(ct),_t=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}(ct);var dt=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 ct}(t)?new t(e):function(t){return"function"==typeof t}(t)?t(e):new ut(t,e,o.map(function(t){return"string"==typeof t?new _t(t):t}))},t.render=function(t,e){t.render(e)},t}(),ft=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 T("div",{style:this.props.style})},e.prototype.componentDidUpdate=function(){this.refreshProps(),this.widget.render()},e}(ht.Component),yt=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 T("div",{style:this.props.style})},e.prototype.componentDidUpdate=function(){this.refreshProps(),this.widget.render()},e}(ht.Component),gt=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);gt.prototype._class+=" html_StatsTable",gt.prototype.publish("labelColor","#333","html-color","Color of the text in the first column"),gt.prototype.publish("primaryValueColor","#333","html-color","Color of the text in the second column"),gt.prototype.publish("secondaryValueColor","#333","html-color","Color of the text in the third column"),gt.prototype.publish("evenRowBackgroundColor","#333","html-color","Background color of the even rows"),gt.prototype.publish("evenRowFontColor","#333","html-color","Font color of the even rows"),gt.prototype.publish("firstColumnWidth","auto","string","CSS style applied as the 'width' for the first column (ex: 40px)"),gt.prototype.publish("secondColumnWidth","1%","string","CSS style applied as the 'width' for the second column (ex: 40px)"),gt.prototype.publish("thirdColumnWidth","1%","string","CSS style applied as the 'width' for the third column (ex: 40px)"),gt.prototype.publish("secondColumnFormat","$,.0f","string","d3-format specifier applied to the second column's values",void 0,{optional:!0}),gt.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("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 mt=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),bt=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}(mt),wt=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}(bt);wt.prototype.publish("selected",!1,"boolean");var vt=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}(mt),xt=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}(ht);xt.prototype._class+=" html_TitleBar",xt.prototype.publish("title","","string"),xt.prototype.publish("buttons",[],"widgetArray"),t.BUILD_VERSION="2.108.6",t.BreakdownTable=p,t.Button=bt,t.HTMLTooltip=r,t.Item=mt,t.JSXWidget=ht,t.PKG_NAME="@hpcc-js/html",t.PKG_VERSION="2.44.2",t.ReactD3=dt,t.SimpleTable=l,t.Spacer=vt,t.StatsTable=gt,t.StyledTable=s,t.TitleBar=xt,t.ToggleButton=wt,t.VNode=ct,t.VizComponent=ft,t.VizInstance=yt});
|
|
1
|
+
!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,b,w={},v=[],x=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,C=Array.isArray;function k(t,e){for(var o in e)t[o]=e[o];return t}function S(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function T(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 E(t,l,n,i,null)}function E(t,e,o,n,i){var r={type:t,props:e,key:o,ref:n,__k:null,__:null,__b:0,__e:null,__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 W(t){return t.children}function A(t,e){this.props=t,this.context=e}function H(t,e){if(null==e)return t.__?H(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?H(t):null}function B(t){if(t.__P&&t.__d){var e=t.__v,o=e.__e,n=[],i=[],r=k({},e);r.__v=e.__v+1,h.vnode&&h.vnode(r),I(t.__P,r,e,t.__n,t.__P.namespaceURI,32&e.__u?[o]:null,n,null==o?H(e):o,!!(32&e.__u),i),r.__v=e.__v,r.__.__k[r.__i]=r,U(n,r,i),e.__e=e.__=null,r.__e!=o&&F(r)}}function F(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some(function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e}),F(t)}function R(t){(!t.__d&&(t.__d=!0)&&u.push(t)&&!P.__r++||_!=h.debounceRendering)&&((_=h.debounceRendering)||d)(P)}function P(){try{for(var t,e=1;u.length;)u.length>e&&u.sort(f),t=u.shift(),e=u.length,B(t)}finally{u.length=P.__r=0}}function M(t,e,o,n,i,r,l,s,p,a,h){var c,u,_,d,f,y,g,m=n&&n.__k||v,b=e.length;for(p=function(t,e,o,n,i){var r,l,s,p,a,h=o.length,c=h,u=0;for(t.__k=new Array(i),r=0;r<i;r++)null!=(l=e[r])&&"boolean"!=typeof l&&"function"!=typeof l?("string"==typeof l||"number"==typeof l||"bigint"==typeof l||l.constructor==String?l=t.__k[r]=E(null,l,null,null,null):C(l)?l=t.__k[r]=E(W,{children:l},null,null,null):void 0===l.constructor&&l.__b>0?l=t.__k[r]=E(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):t.__k[r]=l,p=r+u,l.__=t,l.__b=t.__b+1,s=null,-1!=(a=l.__i=N(l,o,p,c))&&(c--,(s=o[a])&&(s.__u|=2)),null==s||null==s.__v?(-1==a&&(i>h?u--:i<h&&u++),"function"!=typeof l.type&&(l.__u|=4)):a!=p&&(a==p-1?u--:a==p+1?u++:(a>p?u--:u++,l.__u|=4))):t.__k[r]=null;if(c)for(r=0;r<h;r++)null!=(s=o[r])&&!(2&s.__u)&&(s.__e==n&&(n=H(s)),G(s,s));return n}(o,e,m,p,b),c=0;c<b;c++)null!=(_=o.__k[c])&&(u=-1!=_.__i&&m[_.__i]||w,_.__i=c,y=I(t,_,u,i,r,l,s,p,a,h),d=_.__e,_.ref&&u.ref!=_.ref&&(u.ref&&$(u.ref,null,_),h.push(_.ref,_.__c||d,_)),null==f&&null!=d&&(f=d),(g=!!(4&_.__u))||u.__k===_.__k?p=L(_,p,t,g):"function"==typeof _.type&&void 0!==y?p=y:d&&(p=d.nextSibling),_.__u&=-7);return o.__e=f,p}function L(t,e,o,n){var i,r;if("function"==typeof t.type){for(i=t.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=t,e=L(i[r],e,o,n));return e}t.__e!=e&&(n&&(e&&t.type&&!e.parentNode&&(e=H(t)),o.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function N(t,e,o,n){var i,r,l,s=t.key,p=t.type,a=e[o],h=null!=a&&!(2&a.__u);if(null===a&&null==s||h&&s==a.key&&p==a.type)return o;if(n>(h?1:0))for(i=o-1,r=o+1;i>=0||r<e.length;)if(null!=(a=e[l=i>=0?i--:r++])&&!(2&a.__u)&&s==a.key&&p==a.type)return l;return-1}function z(t,e,o){"-"==e[0]?t.setProperty(e,null==o?"":o):t[e]=null==o?"":"number"!=typeof o||x.test(e)?o:o+"px"}function D(t,e,o,n,i){var r,l;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||z(t.style,e,"");if(o)for(e in o)n&&o[e]==n[e]||z(t.style,e,o[e])}else if("o"==e[0]&&"n"==e[1])r=e!=(e=e.replace(y,"$1")),l=e.toLowerCase(),e=l in t||"onFocusOut"==e||"onFocusIn"==e?l.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=o,o?n?o.u=n.u:(o.u=g,t.addEventListener(e,r?b:m,r)):t.removeEventListener(e,r?b:m,r);else{if("http://www.w3.org/2000/svg"==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&&"popover"!=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,"popover"==e&&1==o?"":o))}}function j(t){return function(e){if(this.l){var o=this.l[e.type+t];if(null==e.t)e.t=g++;else if(e.t<o.u)return;return o(h.event?h.event(e):e)}}}function I(t,e,o,n,i,r,l,s,p,a){var c,u,_,d,f,y,g,m,b,w,x,T,E,H,B,F=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 F)try{if(m=e.props,b=F.prototype&&F.prototype.render,w=(c=F.contextType)&&n[c.__c],x=c?w?w.props.value:c.__:n,o.__c?g=(u=e.__c=o.__c).__=u.__E:(b?e.__c=u=new F(m,x):(e.__c=u=new A(m,x),u.constructor=F,u.render=J),w&&w.sub(u),u.state||(u.state={}),u.__n=n,_=u.__d=!0,u.__h=[],u._sb=[]),b&&null==u.__s&&(u.__s=u.state),b&&null!=F.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=k({},u.__s)),k(u.__s,F.getDerivedStateFromProps(m,u.__s))),d=u.props,f=u.state,u.__v=e,_)b&&null==F.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),b&&null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(b&&null==F.getDerivedStateFromProps&&m!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(m,x),e.__v==o.__v||!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(m,u.__s,x)){e.__v!=o.__v&&(u.props=m,u.state=u.__s,u.__d=!1),e.__e=o.__e,e.__k=o.__k,e.__k.some(function(t){t&&(t.__=e)}),v.push.apply(u.__h,u._sb),u._sb=[],u.__h.length&&l.push(u);break t}null!=u.componentWillUpdate&&u.componentWillUpdate(m,u.__s,x),b&&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,b)u.state=u.__s,u.__d=!1,T&&T(e),c=u.render(u.props,u.state,u.context),v.push.apply(u.__h,u._sb),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=k(k({},n),u.getChildContext())),b&&!_&&null!=u.getSnapshotBeforeUpdate&&(y=u.getSnapshotBeforeUpdate(d,f)),H=null!=c&&c.type===W&&null==c.key?V(c.props.children):c,s=M(t,C(H)?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){if(e.__v=null,p||null!=r)if(t.then){for(e.__u|=p?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;r[r.indexOf(s)]=null,e.__e=s}else{for(B=r.length;B--;)S(r[B]);O(e)}else e.__e=o.__e,e.__k=o.__k,t.then||O(e);h.__e(t,e,o)}else null==r&&e.__v==o.__v?(e.__k=o.__k,e.__e=o.__e):s=e.__e=q(o.__e,e,o,n,i,r,l,p,a);return(c=h.diffed)&&c(e),128&e.__u?void 0:s}function O(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(O))}function U(t,e,o){for(var n=0;n<o.length;n++)$(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 V(t){return"object"!=typeof t||null==t||t.__b>0?t:C(t)?t.map(V):k({},t)}function q(t,e,o,n,i,r,l,s,p){var c,u,_,d,f,y,g,m=o.props||w,b=e.props,v=e.type;if("svg"==v?i="http://www.w3.org/2000/svg":"math"==v?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=r)for(c=0;c<r.length;c++)if((f=r[c])&&"setAttribute"in f==!!v&&(v?f.localName==v:3==f.nodeType)){t=f,r[c]=null;break}if(null==t){if(null==v)return document.createTextNode(b);t=document.createElementNS(i,v,b.is&&b),s&&(h.__m&&h.__m(e,r),s=!1),r=null}if(null==v)m===b||s&&t.data==b||(t.data=b);else{if(r=r&&a.call(t.childNodes),!s&&null!=r)for(m={},c=0;c<t.attributes.length;c++)m[(f=t.attributes[c]).name]=f.value;for(c in m)f=m[c],"dangerouslySetInnerHTML"==c?_=f:"children"==c||c in b||"value"==c&&"defaultValue"in b||"checked"==c&&"defaultChecked"in b||D(t,c,null,f,i);for(c in b)f=b[c],"children"==c?d=f:"dangerouslySetInnerHTML"==c?u=f:"value"==c?y=f:"checked"==c?g=f:s&&"function"!=typeof f||m[c]===f||D(t,c,f,m[c],i);if(u)s||_&&(u.__html==_.__html||u.__html==t.innerHTML)||(t.innerHTML=u.__html),e.__k=[];else if(_&&(t.innerHTML=""),M("template"==e.type?t.content:t,C(d)?d:[d],e,o,n,"foreignObject"==v?"http://www.w3.org/1999/xhtml":i,r,l,r?r[0]:o.__k&&H(o,0),s,p),null!=r)for(c=r.length;c--;)S(r[c]);s||(c="value","progress"==v&&null==y?t.removeAttribute("value"):null!=y&&(y!==t[c]||"progress"==v&&!y||"option"==v&&y!=m[c])&&D(t,c,y,m[c],i),c="checked",null!=g&&g!=t[c]&&D(t,c,g,m[c],i))}return t}function $(t,e,o){try{if("function"==typeof t){var n="function"==typeof t.__u;n&&t.__u(),n&&null==e||(t.__u=t(e))}else t.current=e}catch(t){h.__e(t,o)}}function G(t,e,o){var n,i;if(h.unmount&&h.unmount(t),(n=t.ref)&&(n.current&&n.current!=t.__e||$(n,null,e)),null!=(n=t.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(t){h.__e(t,e)}n.base=n.__P=null}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&G(n[i],e,o||"function"!=typeof t.type);o||S(t.__e),t.__c=t.__=t.__e=void 0}function J(t,e,o){return this.constructor(t,o)}a=v.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,A.prototype.setState=function(t,e){var o;o=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=k({},this.state),"function"==typeof t&&(t=t(k({},o),this.props)),t&&k(o,t),null!=t&&this.__v&&(e&&this._sb.push(e),R(this))},A.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),R(this))},A.prototype.render=W,u=[],d="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(t,e){return t.__v.__b-e.__v.__b},P.__r=0,y=/(PointerCapture)$|Capture$/i,g=0,m=j(!1),b=j(!0);var K,X,Q,Y=[],Z=h,tt=Z.__b,et=Z.__r,ot=Z.diffed,nt=Z.__c,it=Z.unmount,rt=Z.__;function lt(){for(var t;t=Y.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(at),e.__h.some(ht),e.__h=[]}catch(o){e.__h=[],Z.__e(o,t.__v)}}}Z.__b=function(t){K=null,tt&&tt(t)},Z.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),rt&&rt(t,e)},Z.__r=function(t){et&&et(t);var e=(K=t.__c).__H;e&&(X===K?(e.__h=[],K.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.some(at),e.__h.some(ht),e.__h=[])),X=K},Z.diffed=function(t){ot&&ot(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Y.push(e)&&Q===Z.requestAnimationFrame||((Q=Z.requestAnimationFrame)||pt)(lt)),e.__H.__.some(function(t){t.u&&(t.__H=t.u),t.u=void 0})),X=K=null},Z.__c=function(t,e){e.some(function(t){try{t.__h.some(at),t.__h=t.__h.filter(function(t){return!t.__||ht(t)})}catch(o){e.some(function(t){t.__h&&(t.__h=[])}),e=[],Z.__e(o,t.__v)}}),nt&&nt(t,e)},Z.unmount=function(t){it&&it(t);var e,o=t.__c;o&&o.__H&&(o.__H.__.some(function(t){try{at(t)}catch(t){e=t}}),o.__H=void 0,e&&Z.__e(e,o.__v))};var st="function"==typeof requestAnimationFrame;function pt(t){var e,o=function(){clearTimeout(n),st&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(o,35);st&&(e=requestAnimationFrame(o))}function at(t){var e=K,o=t.__c;"function"==typeof o&&(t.__c=void 0,o()),K=e}function ht(t){var e=K;t.__c=t.__(),K=e}var ct=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;e==document&&(e=document.documentElement),h.__&&h.__(t,e),i=(n="function"==typeof o)?null:o&&o.__k||e.__k,r=[],l=[],I(e,t=(!n&&o||e).__k=T(W,null,[t]),i||w,w,e.namespaceURI,!n&&o?[o]:i?null:e.firstChild?a.call(e.childNodes):null,r,!n&&o?o:i?i.__e:e.firstChild,n,l),U(r,t,l)}(t,e,this.rootNode)},e.Component=A,e.createElement=T,e}(e.HTMLWidget);ct.prototype._class+=" html_JSXWidget";var ut=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}(),_t=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}(ut),dt=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}(ut);var ft=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 ut}(t)?new t(e):function(t){return"function"==typeof t}(t)?t(e):new _t(t,e,o.map(function(t){return"string"==typeof t?new dt(t):t}))},t.render=function(t,e){t.render(e)},t}(),yt=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 T("div",{style:this.props.style})},e.prototype.componentDidUpdate=function(){this.refreshProps(),this.widget.render()},e}(ct.Component),gt=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 T("div",{style:this.props.style})},e.prototype.componentDidUpdate=function(){this.refreshProps(),this.widget.render()},e}(ct.Component),mt=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);mt.prototype._class+=" html_StatsTable",mt.prototype.publish("labelColor","#333","html-color","Color of the text in the first column"),mt.prototype.publish("primaryValueColor","#333","html-color","Color of the text in the second column"),mt.prototype.publish("secondaryValueColor","#333","html-color","Color of the text in the third column"),mt.prototype.publish("evenRowBackgroundColor","#333","html-color","Background color of the even rows"),mt.prototype.publish("evenRowFontColor","#333","html-color","Font color of the even rows"),mt.prototype.publish("firstColumnWidth","auto","string","CSS style applied as the 'width' for the first column (ex: 40px)"),mt.prototype.publish("secondColumnWidth","1%","string","CSS style applied as the 'width' for the second column (ex: 40px)"),mt.prototype.publish("thirdColumnWidth","1%","string","CSS style applied as the 'width' for the third column (ex: 40px)"),mt.prototype.publish("secondColumnFormat","$,.0f","string","d3-format specifier applied to the second column's values",void 0,{optional:!0}),mt.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("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 bt=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),wt=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}(bt),vt=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}(wt);vt.prototype.publish("selected",!1,"boolean");var xt=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}(bt),Ct=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}(ct);Ct.prototype._class+=" html_TitleBar",Ct.prototype.publish("title","","string"),Ct.prototype.publish("buttons",[],"widgetArray"),t.BUILD_VERSION="2.108.10",t.BreakdownTable=p,t.Button=wt,t.HTMLTooltip=r,t.Item=bt,t.JSXWidget=ct,t.PKG_NAME="@hpcc-js/html",t.PKG_VERSION="2.44.5",t.ReactD3=ft,t.SimpleTable=l,t.Spacer=xt,t.StatsTable=mt,t.StyledTable=s,t.TitleBar=Ct,t.ToggleButton=vt,t.VNode=ut,t.VizComponent=yt,t.VizInstance=gt});
|
|
2
2
|
//# sourceMappingURL=index.min.js.map
|