@hpcc-js/html
Advanced tools
Comparing version 0.0.43 to 0.0.44
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/common")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common"],e):e(t["@hpcc-js/html"]={},t["@hpcc-js/common"])}(this,function(t,e){"use strict";function n(){}function r(t,e){var r,o,i,a,l=L;for(a=arguments.length;a-- >2;)A.push(arguments[a]);for(e&&null!=e.children&&(A.length||A.push(e.children),delete e.children);A.length;)if((o=A.pop())&&void 0!==o.pop)for(a=o.length;a--;)A.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&r?l[l.length-1]+=o:l===L?l=[o]:l.push(o),r=i;var p=new n;return p.nodeName=t,p.children=l,p.attributes=null==e?void 0:e,p.key=null==e?void 0:e.key,void 0!==W.vnode&&W.vnode(p),p}function o(t,e){for(var n in e)t[n]=e[n];return t}function i(t){!t._dirty&&(t._dirty=!0)&&1==V.push(t)&&(W.debounceRendering||j)(a)}function a(){var t,e=V;for(V=[];t=e.pop();)t._dirty&&T(t)}function l(t,e,n){return"string"==typeof e||"number"==typeof e?void 0!==t.splitText:"string"==typeof e.nodeName?!t._componentConstructor&&p(t,e.nodeName):n||t._componentConstructor===e.nodeName}function p(t,e){return t.normalizedNodeName===e||t.nodeName.toLowerCase()===e.toLowerCase()}function s(t){var e=o({},t.attributes);e.children=t.children;var n=t.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===e[r]&&(e[r]=n[r]);return e}function c(t,e){var n=e?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t);return n.normalizedNodeName=t,n}function u(t){var e=t.parentNode;e&&e.removeChild(t)}function d(t,e,n,r,o){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)n&&n(null),r&&r(t);else if("class"!==e||o)if("style"===e){if(r&&"string"!=typeof r&&"string"!=typeof n||(t.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(t.style[i]="");for(var i in r)t.style[i]="number"==typeof r[i]&&!1===D.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===e)r&&(t.innerHTML=r.__html||"");else if("o"==e[0]&&"n"==e[1]){var a=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),r?n||t.addEventListener(e,h,a):t.removeEventListener(e,h,a),(t._listeners||(t._listeners={}))[e]=r}else if("list"!==e&&"type"!==e&&!o&&e in t)f(t,e,null==r?"":r),null!=r&&!1!==r||t.removeAttribute(e);else{var l=o&&e!==(e=e.replace(/^xlink\:?/,""));null==r||!1===r?l?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"function"!=typeof r&&(l?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),r):t.setAttribute(e,r))}else t.className=r||""}function f(t,e,n){try{t[e]=n}catch(t){}}function h(t){return this._listeners[t.type](W.event&&W.event(t)||t)}function _(){for(var t;t=z.pop();)W.afterMount&&W.afterMount(t),t.componentDidMount&&t.componentDidMount()}function m(t,e,n,r,o,i){H++||(I=null!=o&&void 0!==o.ownerSVGElement,R=null!=t&&!("__preactattr_"in t));var a=v(t,e,n,r,i);return o&&a.parentNode!==o&&o.appendChild(a),--H||(R=!1,i||_()),a}function v(t,e,n,r,o){var i=t,a=I;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||o)?t.nodeValue!=e&&(t.nodeValue=e):(i=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(i,t),g(t,!0))),i.__preactattr_=!0,i;var l=e.nodeName;if("function"==typeof l)return B(t,e,n,r);if(I="svg"===l||"foreignObject"!==l&&I,l=String(l),(!t||!p(t,l))&&(i=c(l,I),t)){for(;t.firstChild;)i.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(i,t),g(t,!0)}var s=i.firstChild,u=i.__preactattr_,d=e.children;if(null==u){u=i.__preactattr_={};for(var f=i.attributes,h=f.length;h--;)u[f[h].name]=f[h].value}return!R&&d&&1===d.length&&"string"==typeof d[0]&&null!=s&&void 0!==s.splitText&&null==s.nextSibling?s.nodeValue!=d[0]&&(s.nodeValue=d[0]):(d&&d.length||null!=s)&&y(i,d,n,r,R||null!=u.dangerouslySetInnerHTML),x(i,e.attributes,u),I=a,i}function y(t,e,n,r,o){var i,a,p,s,c,d=t.childNodes,f=[],h={},_=0,m=0,y=d.length,b=0,x=e?e.length:0;if(0!==y)for(N=0;N<y;N++){var w=d[N],C=w.__preactattr_;null!=(k=x&&C?w._component?w._component.__key:C.key:null)?(_++,h[k]=w):(C||(void 0!==w.splitText?!o||w.nodeValue.trim():o))&&(f[b++]=w)}if(0!==x)for(N=0;N<x;N++){c=null;var k=(s=e[N]).key;if(null!=k)_&&void 0!==h[k]&&(c=h[k],h[k]=void 0,_--);else if(!c&&m<b)for(i=m;i<b;i++)if(void 0!==f[i]&&l(a=f[i],s,o)){c=a,f[i]=void 0,i===b-1&&b--,i===m&&m++;break}c=v(c,s,n,r),p=d[N],c&&c!==t&&c!==p&&(null==p?t.appendChild(c):c===p.nextSibling?u(p):t.insertBefore(c,p))}if(_)for(var N in h)void 0!==h[N]&&g(h[N],!1);for(;m<=b;)void 0!==(c=f[b--])&&g(c,!1)}function g(t,e){var n=t._component;n?S(n):(null!=t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),!1!==e&&null!=t.__preactattr_||u(t),b(t))}function b(t){for(t=t.lastChild;t;){var e=t.previousSibling;g(t,!0),t=e}}function x(t,e,n){var r;for(r in n)e&&null!=e[r]||null==n[r]||d(t,r,n[r],n[r]=void 0,I);for(r in e)"children"===r||"innerHTML"===r||r in n&&e[r]===("value"===r||"checked"===r?t[r]:n[r])||d(t,r,n[r],n[r]=e[r],I)}function w(t){var e=t.constructor.name;(J[e]||(J[e]=[])).push(t)}function C(t,e,n){var r,o=J[t.name];if(t.prototype&&t.prototype.render?(r=new t(e,n),M.call(r,e,n)):((r=new M(e,n)).constructor=t,r.render=k),o)for(var i=o.length;i--;)if(o[i].constructor===t){r.nextBase=o[i].nextBase,o.splice(i,1);break}return r}function k(t,e,n){return this.constructor(t,n)}function N(t,e,n,r,o){t._disable||(t._disable=!0,(t.__ref=e.ref)&&delete e.ref,(t.__key=e.key)&&delete e.key,!t.base||o?t.componentWillMount&&t.componentWillMount():t.componentWillReceiveProps&&t.componentWillReceiveProps(e,r),r&&r!==t.context&&(t.prevContext||(t.prevContext=t.context),t.context=r),t.prevProps||(t.prevProps=t.props),t.props=e,t._disable=!1,0!==n&&(1!==n&&!1===W.syncComponentUpdates&&t.base?i(t):T(t,1,o)),t.__ref&&t.__ref(t))}function T(t,e,n,r){if(!t._disable){var i,a,l,p=t.props,c=t.state,u=t.context,d=t.prevProps||p,f=t.prevState||c,h=t.prevContext||u,v=t.base,y=t.nextBase,b=v||y,x=t._component,w=!1;if(v&&(t.props=d,t.state=f,t.context=h,2!==e&&t.shouldComponentUpdate&&!1===t.shouldComponentUpdate(p,c,u)?w=!0:t.componentWillUpdate&&t.componentWillUpdate(p,c,u),t.props=p,t.state=c,t.context=u),t.prevProps=t.prevState=t.prevContext=t.nextBase=null,t._dirty=!1,!w){i=t.render(p,c,u),t.getChildContext&&(u=o(o({},u),t.getChildContext()));var k,B,M=i&&i.nodeName;if("function"==typeof M){var U=s(i);(a=x)&&a.constructor===M&&U.key==a.__key?N(a,U,1,u,!1):(k=a,t._component=a=C(M,U,u),a.nextBase=a.nextBase||y,a._parentComponent=t,N(a,U,0,u,!1),T(a,1,n,!0)),B=a.base}else l=b,(k=x)&&(l=t._component=null),(b||1===e)&&(l&&(l._component=null),B=m(l,i,u,n||!v,b&&b.parentNode,!0));if(b&&B!==b&&a!==x){var P=b.parentNode;P&&B!==P&&(P.replaceChild(B,b),k||(b._component=null,g(b,!1)))}if(k&&S(k),t.base=B,B&&!r){for(var E=t,A=t;A=A._parentComponent;)(E=A).base=B;B._component=E,B._componentConstructor=E.constructor}}if(!v||n?z.unshift(t):w||(t.componentDidUpdate&&t.componentDidUpdate(d,f,h),W.afterUpdate&&W.afterUpdate(t)),null!=t._renderCallbacks)for(;t._renderCallbacks.length;)t._renderCallbacks.pop().call(t);H||r||_()}}function B(t,e,n,r){for(var o=t&&t._component,i=o,a=t,l=o&&t._componentConstructor===e.nodeName,p=l,c=s(e);o&&!p&&(o=o._parentComponent);)p=o.constructor===e.nodeName;return o&&p&&(!r||o._component)?(N(o,c,3,n,r),t=o.base):(i&&!l&&(S(i),t=a=null),o=C(e.nodeName,c,n),t&&!o.nextBase&&(o.nextBase=t,a=null),N(o,c,1,n,r),t=o.base,a&&t!==a&&(a._component=null,g(a,!1))),t}function S(t){W.beforeUnmount&&W.beforeUnmount(t);var e=t.base;t._disable=!0,t.componentWillUnmount&&t.componentWillUnmount(),t.base=null;var n=t._component;n?S(n):e&&(e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),t.nextBase=e,u(e),w(t),b(e)),t.__ref&&t.__ref(null)}function M(t,e){this._dirty=!0,this.context=e,this.props=t,this.state=this.state||{}}function U(t,e,n){return m(n,t,{},!1,e,!1)}function P(t){return"function"==typeof t}function E(t){return t.prototype&&t.prototype instanceof X}var W={},A=[],L=[],j="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,D=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,V=[],z=[],H=0,I=!1,R=!1,J={};o(M.prototype,{setState:function(t,e){var n=this.state;this.prevState||(this.prevState=o({},n)),o(n,"function"==typeof t?t(n,this.props):t),e&&(this._renderCallbacks=this._renderCallbacks||[]).push(e),i(this)},forceUpdate:function(t){t&&(this._renderCallbacks=this._renderCallbacks||[]).push(t),T(this,2)},render:function(){}});var O=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(n,t),n.prototype.jsxRender=function(t,e){this.rootNode=U(t,e,this.rootNode)},n.Component=M,n.createElement=r,n}(e.HTMLWidget);O.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 n=t.selectAll(t.node().tagName+" > *").data([this]);return n.exit().each(function(t){return console.log("render: Exit - "+t.type())}).remove(),n.enter().append(this.type()).each(function(t){return console.log("render: Enter - "+t.type())}).attr("reactd3",0).merge(n).each(function(t){var n=e.select(this);t.update(n),t.renderChildren(n)})},t.prototype.renderChildren=function(t){var n=t.selectAll(t.node().tagName+" > *").data(this._children);return n.exit().each(function(t){return console.log("renderChildren: Exit - "+t.type())}).remove(),n.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(n).each(function(t){var n=e.select(this);t.update(n),t.renderChildren(n)})},t}(),$=function(t){function n(e,n,r){var o=t.call(this,n,r)||this;return o._type=e,o}return e.__extends(n,t),n.prototype.type=function(){return this._type},n}(X),q=function(t){function n(e){var n=t.call(this,{},[])||this;return n._text=e,n}return e.__extends(n,t),n.prototype.type=function(){return"span"},n.prototype.update=function(e){t.prototype.update.call(this,e),e.text(this._text)},n}(X),F=function(){function t(){}return t.createElement=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return E(t)?new t(e):P(t)?t(e):new $(t,e,n.map(function(t){return"string"==typeof t?new q(t):t}))},t.render=function(t,e){t.render(e)},t}(),G=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(n,t),n.prototype.refreshProps=function(){for(var t in this.props)this.widget[t]&&"function"==typeof this.widget[t]&&this.widget[t](this.props[t])},n.prototype.componentDidMount=function(){this.widget=(new this.props.type).target(this.base),this.refreshProps(),this.widget.render()},n.prototype.componentWillUnmount=function(){this.widget.target(null).render()},n.prototype.render=function(){return O.createElement("div",{style:this.props.style})},n.prototype.componentDidUpdate=function(){this.refreshProps(),this.widget.render()},n}(O.Component),K=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(n,t),n.prototype.refreshProps=function(){for(var t in this.props)this.widget[t]&&"function"==typeof this.widget[t]&&this.widget[t](this.props[t])},n.prototype.componentDidMount=function(){this.widget=this.props.instance.target(this.base),this.refreshProps(),this.widget.render()},n.prototype.componentWillUnmount=function(){this.widget.target(null).render()},n.prototype.render=function(){return O.createElement("div",{style:this.props.style})},n.prototype.componentDidUpdate=function(){this.refreshProps(),this.widget.render()},n}(O.Component);!function(t,e){if("undefined"==typeof document)return e;t=t||"";var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}("#wrap\r\n{\r\n width: 100%;\r\n}\r\n#left, #right {padding:5px;}\r\n\r\n#left {\r\n background-color:red;\r\n text-align:left;\r\n display: block;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n}\r\n\r\n#right {\r\n background-color:orange;\r\n float:right;\r\n text-align:right;\r\n white-space: nowrap;\r\n}\r\n\r\n.html_TitleBar > .main {\r\n width: 100%;\r\n display: block;\r\n}\r\n\r\n.html_TitleBar .title {\r\n padding:4px;\r\n text-align:left;\r\n display: block;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n font-size:20px;\r\n font-weight: bold;\r\n}\r\n\r\n.html_TitleBar .icon-bar {\r\n padding:4px;\r\n float: right;\r\n text-align:right;\r\n white-space: nowrap;\r\n line-height: 28px;\r\n}\r\n\r\n.html_TitleBar .icon-bar-item {\r\n display: inline; \r\n}\r\n\r\n.html_TitleBar .icon-bar-item > div {\r\n display: inline; \r\n}\r\n\r\n.html_TitleBar .icon-bar a {\r\n text-align: center; /* Center-align text */\r\n padding-top: 4px;\r\n padding-bottom: 4px;\r\n transition: all 0.3s ease; /* Add transition for hover effects */\r\n color: darkgray; /* White text color */\r\n}\r\n\r\n.html_TitleBar .icon-bar a:hover {\r\n background-color: whitesmoke; /* Add a hover color */\r\n}\r\n\r\n.html_TitleBar .icon-bar a.selected {\r\n background-color: #efe5e5; /* Add a hover color */\r\n}\r\n\r\n.html_TitleBar .icon-bar a.spacer {\r\n text-align: center; /* Center-align text */\r\n padding-top: 2px;\r\n padding-left: 8px;\r\n padding-bottom: 0px;\r\n color: none;\r\n}\r\n\r\n.html_TitleBar .icon-bar a.spacer:hover {\r\n background-color: transparent;\r\n}\r\n\r\n.html_TitleBar .icon-bar .active {\r\n background-color: #4CAF50; /* Add an active/current color */\r\n}",void 0);var Q=function(t){function n(e){var n=t.call(this)||this;return n._owner=e,n._tag="a",n}return e.__extends(n,t),n}(e.HTMLWidget),Y=function(t){function n(e,n){var r=t.call(this,e)||this;return r._icon=n,r}return e.__extends(n,t),n.prototype.icon=function(){return this._icon},n.prototype.enter=function(e,n){var r=this;t.prototype.enter.call(this,e,n),n.attr("href","#").on("click",function(t,e,n){return r._owner.titleBarClick(r,t,e,n)}).append("i").attr("class","fa "+this._icon+" fa-lg fa-fw")},n}(Q),Z=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(n,t),n.prototype.enter=function(e,n){var r=this;n.on("click.sel",function(t,e,n){r.selected(!r.selected()),r.render()}),t.prototype.enter.call(this,e,n)},n.prototype.update=function(e,n){t.prototype.update.call(this,e,n),this._element.classed("selected",this.selected())},n}(Y);Z.prototype.publish("selected",!1,"boolean");var tt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(n,t),n.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),n.attr("class","spacer").attr("href","#").append("i")},n}(Q),et=function(t){function n(){return t.call(this)||this}return e.__extends(n,t),n.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),this._divMain=n.append("div").attr("class","main"),this._divIconBar=this._divMain.append("div").attr("class","icon-bar"),this._divTitle=this._divMain.append("div").attr("class","title")},n.prototype.update=function(e,n){t.prototype.update.call(this,e,n),this._divTitle.text(this.title());var r=this._divIconBar.selectAll(".icon-bar-item").data(this.buttons());r.enter().append("div").attr("class","icon-bar-item").each(function(t){t.target(this)}).merge(r).each(function(t){t.render()}),r.exit().each(function(t){t.target(null)}).remove(),r.order()},n}(O);et.prototype._class+=" html_TitleBar",et.prototype.publish("title","","string"),et.prototype.publish("buttons",[],"widgetArray"),t.JSXWidget=O,t.VNode=X,t.ReactD3=F,t.VizComponent=G,t.VizInstance=K,t.Item=Q,t.Button=Y,t.ToggleButton=Z,t.Spacer=tt,t.TitleBar=et,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/common")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common"],e):e(t["@hpcc-js/html"]={},t["@hpcc-js/common"])}(this,function(t,e){"use strict";function n(t,e){for(var n in e)t[n]=e[n];return t}function r(t){!t._dirty&&(t._dirty=!0)&&1==k.push(t)&&(g.debounceRendering||w)(function(){var t,e=k;k=[];for(;t=e.pop();)t._dirty&&m(t)})}function o(t,e){return t.normalizedNodeName===e||t.nodeName.toLowerCase()===e.toLowerCase()}function i(t){var e=n({},t.attributes);e.children=t.children;var r=t.nodeName.defaultProps;if(void 0!==r)for(var o in r)void 0===e[o]&&(e[o]=r[o]);return e}function a(t){var e=t.parentNode;e&&e.removeChild(t)}function l(t,e,n,r,o){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)n&&n(null),r&&r(t);else if("class"!==e||o)if("style"===e){if(r&&"string"!=typeof r&&"string"!=typeof n||(t.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(t.style[i]="");for(var i in r)t.style[i]="number"==typeof r[i]&&!1===C.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===e)r&&(t.innerHTML=r.__html||"");else if("o"==e[0]&&"n"==e[1]){var a=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),r?n||t.addEventListener(e,p,a):t.removeEventListener(e,p,a),(t._listeners||(t._listeners={}))[e]=r}else if("list"!==e&&"type"!==e&&!o&&e in t)!function(t,e,n){try{t[e]=n}catch(t){}}(t,e,null==r?"":r),null!=r&&!1!==r||t.removeAttribute(e);else{var l=o&&e!==(e=e.replace(/^xlink\:?/,""));null==r||!1===r?l?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"function"!=typeof r&&(l?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),r):t.setAttribute(e,r))}else t.className=r||""}function p(t){return this._listeners[t.type](g.event&&g.event(t)||t)}function s(){for(var t;t=N.pop();)g.afterMount&&g.afterMount(t),t.componentDidMount&&t.componentDidMount()}function c(t,e,n,r,o,i){T++||(B=null!=o&&void 0!==o.ownerSVGElement,S=null!=t&&!("__preactattr_"in t));var a=u(t,e,n,r,i);return o&&a.parentNode!==o&&o.appendChild(a),--T||(S=!1,i||s()),a}function u(t,e,n,r,p){var s=t,c=B;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||p)?t.nodeValue!=e&&(t.nodeValue=e):(s=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(s,t),d(t,!0))),s.__preactattr_=!0,s;var f=e.nodeName;if("function"==typeof f)return function(t,e,n,r){var o=t&&t._component,a=o,l=t,p=o&&t._componentConstructor===e.nodeName,s=p,c=i(e);for(;o&&!s&&(o=o._parentComponent);)s=o.constructor===e.nodeName;o&&s&&(!r||o._component)?(_(o,c,3,n,r),t=o.base):(a&&!p&&(v(a),t=l=null),o=h(e.nodeName,c,n),t&&!o.nextBase&&(o.nextBase=t,l=null),_(o,c,1,n,r),t=o.base,l&&t!==l&&(l._component=null,d(l,!1)));return t}(t,e,n,r);if(B="svg"===f||"foreignObject"!==f&&B,f=String(f),(!t||!o(t,f))&&(s=function(t,e){var n=e?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t);return n.normalizedNodeName=t,n}(f,B),t)){for(;t.firstChild;)s.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(s,t),d(t,!0)}var m=s.firstChild,y=s.__preactattr_,g=e.children;if(null==y){y=s.__preactattr_={};for(var b=s.attributes,x=b.length;x--;)y[b[x].name]=b[x].value}return!S&&g&&1===g.length&&"string"==typeof g[0]&&null!=m&&void 0!==m.splitText&&null==m.nextSibling?m.nodeValue!=g[0]&&(m.nodeValue=g[0]):(g&&g.length||null!=m)&&function(t,e,n,r,i){var l,p,s,c,f,h=t.childNodes,_=[],m={},v=0,y=0,g=h.length,b=0,x=e?e.length:0;if(0!==g)for(N=0;N<g;N++){var w=h[N],C=w.__preactattr_;null!=(k=x&&C?w._component?w._component.__key:C.key:null)?(v++,m[k]=w):(C||(void 0!==w.splitText?!i||w.nodeValue.trim():i))&&(_[b++]=w)}if(0!==x)for(N=0;N<x;N++){c=e[N],f=null;var k=c.key;if(null!=k)v&&void 0!==m[k]&&(f=m[k],m[k]=void 0,v--);else if(!f&&y<b)for(l=y;l<b;l++)if(void 0!==_[l]&&function(t,e,n){return"string"==typeof e||"number"==typeof e?void 0!==t.splitText:"string"==typeof e.nodeName?!t._componentConstructor&&o(t,e.nodeName):n||t._componentConstructor===e.nodeName}(p=_[l],c,i)){f=p,_[l]=void 0,l===b-1&&b--,l===y&&y++;break}f=u(f,c,n,r),s=h[N],f&&f!==t&&f!==s&&(null==s?t.appendChild(f):f===s.nextSibling?a(s):t.insertBefore(f,s))}if(v)for(var N in m)void 0!==m[N]&&d(m[N],!1);for(;y<=b;)void 0!==(f=_[b--])&&d(f,!1)}(s,g,n,r,S||null!=y.dangerouslySetInnerHTML),function(t,e,n){var r;for(r in n)e&&null!=e[r]||null==n[r]||l(t,r,n[r],n[r]=void 0,B);for(r in e)"children"===r||"innerHTML"===r||r in n&&e[r]===("value"===r||"checked"===r?t[r]:n[r])||l(t,r,n[r],n[r]=e[r],B)}(s,e.attributes,y),B=c,s}function d(t,e){var n=t._component;n?v(n):(null!=t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),!1!==e&&null!=t.__preactattr_||a(t),f(t))}function f(t){for(t=t.lastChild;t;){var e=t.previousSibling;d(t,!0),t=e}}function h(t,e,n){var r,o=M[t.name];if(t.prototype&&t.prototype.render?(r=new t(e,n),y.call(r,e,n)):((r=new y(e,n)).constructor=t,r.render=function(t,e,n){return this.constructor(t,n)}),o)for(var i=o.length;i--;)if(o[i].constructor===t){r.nextBase=o[i].nextBase,o.splice(i,1);break}return r}function _(t,e,n,o,i){t._disable||(t._disable=!0,(t.__ref=e.ref)&&delete e.ref,(t.__key=e.key)&&delete e.key,!t.base||i?t.componentWillMount&&t.componentWillMount():t.componentWillReceiveProps&&t.componentWillReceiveProps(e,o),o&&o!==t.context&&(t.prevContext||(t.prevContext=t.context),t.context=o),t.prevProps||(t.prevProps=t.props),t.props=e,t._disable=!1,0!==n&&(1!==n&&!1===g.syncComponentUpdates&&t.base?r(t):m(t,1,i)),t.__ref&&t.__ref(t))}function m(t,e,r,o){if(!t._disable){var a,l,p,u=t.props,f=t.state,y=t.context,b=t.prevProps||u,x=t.prevState||f,w=t.prevContext||y,C=t.base,k=t.nextBase,B=C||k,S=t._component,M=!1;if(C&&(t.props=b,t.state=x,t.context=w,2!==e&&t.shouldComponentUpdate&&!1===t.shouldComponentUpdate(u,f,y)?M=!0:t.componentWillUpdate&&t.componentWillUpdate(u,f,y),t.props=u,t.state=f,t.context=y),t.prevProps=t.prevState=t.prevContext=t.nextBase=null,t._dirty=!1,!M){a=t.render(u,f,y),t.getChildContext&&(y=n(n({},y),t.getChildContext()));var U,P,E=a&&a.nodeName;if("function"==typeof E){var W=i(a);(l=S)&&l.constructor===E&&W.key==l.__key?_(l,W,1,y,!1):(U=l,t._component=l=h(E,W,y),l.nextBase=l.nextBase||k,l._parentComponent=t,_(l,W,0,y,!1),m(l,1,r,!0)),P=l.base}else p=B,(U=S)&&(p=t._component=null),(B||1===e)&&(p&&(p._component=null),P=c(p,a,y,r||!C,B&&B.parentNode,!0));if(B&&P!==B&&l!==S){var A=B.parentNode;A&&P!==A&&(A.replaceChild(P,B),U||(B._component=null,d(B,!1)))}if(U&&v(U),t.base=P,P&&!o){for(var L=t,j=t;j=j._parentComponent;)(L=j).base=P;P._component=L,P._componentConstructor=L.constructor}}if(!C||r?N.unshift(t):M||(t.componentDidUpdate&&t.componentDidUpdate(b,x,w),g.afterUpdate&&g.afterUpdate(t)),null!=t._renderCallbacks)for(;t._renderCallbacks.length;)t._renderCallbacks.pop().call(t);T||o||s()}}function v(t){g.beforeUnmount&&g.beforeUnmount(t);var e=t.base;t._disable=!0,t.componentWillUnmount&&t.componentWillUnmount(),t.base=null;var n=t._component;n?v(n):e&&(e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),t.nextBase=e,a(e),function(t){var e=t.constructor.name;(M[e]||(M[e]=[])).push(t)}(t),f(e)),t.__ref&&t.__ref(null)}function y(t,e){this._dirty=!0,this.context=e,this.props=t,this.state=this.state||{}}var g={},b=[],x=[],w="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,C=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,k=[],N=[],T=0,B=!1,S=!1,M={};n(y.prototype,{setState:function(t,e){var o=this.state;this.prevState||(this.prevState=n({},o)),n(o,"function"==typeof t?t(o,this.props):t),e&&(this._renderCallbacks=this._renderCallbacks||[]).push(e),r(this)},forceUpdate:function(t){t&&(this._renderCallbacks=this._renderCallbacks||[]).push(t),m(this,2)},render:function(){}});var U=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(n,t),n.prototype.jsxRender=function(t,e){this.rootNode=function(t,e,n){return c(n,t,{},!1,e,!1)}(t,e,this.rootNode)},n.Component=y,n.createElement=function(t,e){var n,r,o,i,a=x;for(i=arguments.length;i-- >2;)b.push(arguments[i]);for(e&&null!=e.children&&(b.length||b.push(e.children),delete e.children);b.length;)if((r=b.pop())&&void 0!==r.pop)for(i=r.length;i--;)b.push(r[i]);else"boolean"==typeof r&&(r=null),(o="function"!=typeof t)&&(null==r?r="":"number"==typeof r?r=String(r):"string"!=typeof r&&(o=!1)),o&&n?a[a.length-1]+=r:a===x?a=[r]:a.push(r),n=o;var l=new function(){};return l.nodeName=t,l.children=a,l.attributes=null==e?void 0:e,l.key=null==e?void 0:e.key,void 0!==g.vnode&&g.vnode(l),l},n}(e.HTMLWidget);U.prototype._class+=" html_JSXWidget";var P=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 n=t.selectAll(t.node().tagName+" > *").data([this]);return n.exit().each(function(t){return console.log("render: Exit - "+t.type())}).remove(),n.enter().append(this.type()).each(function(t){return console.log("render: Enter - "+t.type())}).attr("reactd3",0).merge(n).each(function(t){var n=e.select(this);t.update(n),t.renderChildren(n)})},t.prototype.renderChildren=function(t){var n=t.selectAll(t.node().tagName+" > *").data(this._children);return n.exit().each(function(t){return console.log("renderChildren: Exit - "+t.type())}).remove(),n.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(n).each(function(t){var n=e.select(this);t.update(n),t.renderChildren(n)})},t}(),E=function(t){function n(e,n,r){var o=t.call(this,n,r)||this;return o._type=e,o}return e.__extends(n,t),n.prototype.type=function(){return this._type},n}(P),W=function(t){function n(e){var n=t.call(this,{},[])||this;return n._text=e,n}return e.__extends(n,t),n.prototype.type=function(){return"span"},n.prototype.update=function(e){t.prototype.update.call(this,e),e.text(this._text)},n}(P),A=function(){function t(){}return t.createElement=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return function(t){return t.prototype&&t.prototype instanceof P}(t)?new t(e):function(t){return"function"==typeof t}(t)?t(e):new E(t,e,n.map(function(t){return"string"==typeof t?new W(t):t}))},t.render=function(t,e){t.render(e)},t}(),L=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(n,t),n.prototype.refreshProps=function(){for(var t in this.props)this.widget[t]&&"function"==typeof this.widget[t]&&this.widget[t](this.props[t])},n.prototype.componentDidMount=function(){this.widget=(new this.props.type).target(this.base),this.refreshProps(),this.widget.render()},n.prototype.componentWillUnmount=function(){this.widget.target(null).render()},n.prototype.render=function(){return U.createElement("div",{style:this.props.style})},n.prototype.componentDidUpdate=function(){this.refreshProps(),this.widget.render()},n}(U.Component),j=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(n,t),n.prototype.refreshProps=function(){for(var t in this.props)this.widget[t]&&"function"==typeof this.widget[t]&&this.widget[t](this.props[t])},n.prototype.componentDidMount=function(){this.widget=this.props.instance.target(this.base),this.refreshProps(),this.widget.render()},n.prototype.componentWillUnmount=function(){this.widget.target(null).render()},n.prototype.render=function(){return U.createElement("div",{style:this.props.style})},n.prototype.componentDidUpdate=function(){this.refreshProps(),this.widget.render()},n}(U.Component);!function(t,e){if("undefined"==typeof document)return e;t=t||"";var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}("#wrap\r\n{\r\n width: 100%;\r\n}\r\n#left, #right {padding:5px;}\r\n\r\n#left {\r\n background-color:red;\r\n text-align:left;\r\n display: block;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n}\r\n\r\n#right {\r\n background-color:orange;\r\n float:right;\r\n text-align:right;\r\n white-space: nowrap;\r\n}\r\n\r\n.html_TitleBar > .main {\r\n width: 100%;\r\n display: block;\r\n}\r\n\r\n.html_TitleBar .title {\r\n padding:4px;\r\n text-align:left;\r\n display: block;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n font-size:20px;\r\n font-weight: bold;\r\n}\r\n\r\n.html_TitleBar .icon-bar {\r\n padding:4px;\r\n float: right;\r\n text-align:right;\r\n white-space: nowrap;\r\n line-height: 28px;\r\n}\r\n\r\n.html_TitleBar .icon-bar-item {\r\n display: inline; \r\n}\r\n\r\n.html_TitleBar .icon-bar-item > div {\r\n display: inline; \r\n}\r\n\r\n.html_TitleBar .icon-bar a {\r\n text-align: center; /* Center-align text */\r\n padding-top: 4px;\r\n padding-bottom: 4px;\r\n transition: all 0.3s ease; /* Add transition for hover effects */\r\n color: darkgray; /* White text color */\r\n}\r\n\r\n.html_TitleBar .icon-bar a:hover {\r\n background-color: whitesmoke; /* Add a hover color */\r\n}\r\n\r\n.html_TitleBar .icon-bar a.selected {\r\n background-color: #efe5e5; /* Add a hover color */\r\n}\r\n\r\n.html_TitleBar .icon-bar a.spacer {\r\n text-align: center; /* Center-align text */\r\n padding-top: 2px;\r\n padding-left: 8px;\r\n padding-bottom: 0px;\r\n color: none;\r\n}\r\n\r\n.html_TitleBar .icon-bar a.spacer:hover {\r\n background-color: transparent;\r\n}\r\n\r\n.html_TitleBar .icon-bar .active {\r\n background-color: #4CAF50; /* Add an active/current color */\r\n}",void 0);var D=function(t){function n(e){var n=t.call(this)||this;return n._owner=e,n._tag="a",n}return e.__extends(n,t),n}(e.HTMLWidget),V=function(t){function n(e,n){var r=t.call(this,e)||this;return r._icon=n,r}return e.__extends(n,t),n.prototype.icon=function(){return this._icon},n.prototype.enter=function(e,n){var r=this;t.prototype.enter.call(this,e,n),n.attr("href","#").on("click",function(t,e,n){return r._owner.titleBarClick(r,t,e,n)}).append("i").attr("class","fa "+this._icon+" fa-lg fa-fw")},n}(D),z=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(n,t),n.prototype.enter=function(e,n){var r=this;n.on("click.sel",function(t,e,n){r.selected(!r.selected()),r.render()}),t.prototype.enter.call(this,e,n)},n.prototype.update=function(e,n){t.prototype.update.call(this,e,n),this._element.classed("selected",this.selected())},n}(V);z.prototype.publish("selected",!1,"boolean");var H=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(n,t),n.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),n.attr("class","spacer").attr("href","#").append("i")},n}(D),I=function(t){function n(){return t.call(this)||this}return e.__extends(n,t),n.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),this._divMain=n.append("div").attr("class","main"),this._divIconBar=this._divMain.append("div").attr("class","icon-bar"),this._divTitle=this._divMain.append("div").attr("class","title")},n.prototype.update=function(e,n){t.prototype.update.call(this,e,n),this._divTitle.text(this.title());var r=this._divIconBar.selectAll(".icon-bar-item").data(this.buttons());r.enter().append("div").attr("class","icon-bar-item").each(function(t){t.target(this)}).merge(r).each(function(t){t.render()}),r.exit().each(function(t){t.target(null)}).remove(),r.order()},n}(U);I.prototype._class+=" html_TitleBar",I.prototype.publish("title","","string"),I.prototype.publish("buttons",[],"widgetArray"),t.JSXWidget=U,t.VNode=P,t.ReactD3=A,t.VizComponent=L,t.VizInstance=j,t.Item=D,t.Button=V,t.ToggleButton=z,t.Spacer=H,t.TitleBar=I,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=html.min.js.map |
@@ -20,3 +20,3 @@ import { d3SelectionType, HTMLWidget } from "@hpcc-js/common"; | ||
enter(domNode: HTMLElement, element: any): void; | ||
update(domNode: HTMLElement, element: any): void; | ||
update(domNode: HTMLElement, element: d3SelectionType): void; | ||
} | ||
@@ -28,3 +28,3 @@ export interface ToggleButton { | ||
export declare class Spacer extends Item { | ||
enter(domNode: HTMLElement, element: any): void; | ||
enter(domNode: HTMLElement, element: d3SelectionType): void; | ||
} | ||
@@ -36,3 +36,3 @@ export declare class TitleBar extends JSXWidget { | ||
constructor(); | ||
enter(domNode: any, element: any): void; | ||
enter(domNode: any, element: d3SelectionType): void; | ||
update(domNode: any, element: any): void; | ||
@@ -39,0 +39,0 @@ } |
@@ -20,3 +20,3 @@ import { d3SelectionType, HTMLWidget } from "@hpcc-js/common"; | ||
enter(domNode: HTMLElement, element: any): void; | ||
update(domNode: HTMLElement, element: any): void; | ||
update(domNode: HTMLElement, element: d3SelectionType): void; | ||
} | ||
@@ -28,3 +28,3 @@ export interface ToggleButton { | ||
export declare class Spacer extends Item { | ||
enter(domNode: HTMLElement, element: any): void; | ||
enter(domNode: HTMLElement, element: d3SelectionType): void; | ||
} | ||
@@ -36,3 +36,3 @@ export declare class TitleBar extends JSXWidget { | ||
constructor(); | ||
enter(domNode: any, element: any): void; | ||
enter(domNode: any, element: d3SelectionType): void; | ||
update(domNode: any, element: any): void; | ||
@@ -39,0 +39,0 @@ } |
{ | ||
"name": "@hpcc-js/html", | ||
"version": "0.0.43", | ||
"version": "0.0.44", | ||
"description": "hpcc-js - Viz HTML", | ||
@@ -8,2 +8,3 @@ "main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"unpkg": "dist/html.min.js", | ||
"files": [ | ||
@@ -23,4 +24,4 @@ "lib/*", | ||
"dependencies": { | ||
"@hpcc-js/common": "^0.0.43", | ||
"@hpcc-js/preact-shim": "^0.0.37", | ||
"@hpcc-js/common": "^0.0.44", | ||
"@hpcc-js/preact-shim": "^0.0.38", | ||
"d3-selection": "1.1.0", | ||
@@ -30,3 +31,3 @@ "tslib": "1.8.0" | ||
"devDependencies": { | ||
"@hpcc-js/bundle": "^0.0.14", | ||
"@hpcc-js/bundle": "^0.0.15", | ||
"rimraf": "2.6.1", | ||
@@ -33,0 +34,0 @@ "typedoc": "0.7.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
251261
+ Added@hpcc-js/common@0.0.44(transitive)
+ Added@hpcc-js/preact-shim@0.0.38(transitive)
- Removed@hpcc-js/common@0.0.43(transitive)
- Removed@hpcc-js/preact-shim@0.0.37(transitive)
Updated@hpcc-js/common@^0.0.44
Updated@hpcc-js/preact-shim@^0.0.38