@hpcc-js/other 3.1.0 → 3.1.1
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/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/__package__.ts +2 -2
- package/types/__package__.d.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var po=Object.create;var Ht=Object.defineProperty;var fo=Object.getOwnPropertyDescriptor;var go=Object.getOwnPropertyNames;var mo=Object.getPrototypeOf,yo=Object.prototype.hasOwnProperty;var c=(r,t)=>Ht(r,"name",{value:t,configurable:!0});var Se=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),Te=(r,t)=>{for(var o in t)Ht(r,o,{get:t[o],enumerable:!0})},_o=(r,t,o,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of go(t))!yo.call(r,i)&&i!==o&&Ht(r,i,{get:()=>t[i],enumerable:!(e=fo(t,i))||e.enumerable});return r};var Ee=(r,t,o)=>(o=r!=null?po(mo(r)):{},_o(t||!r||!r.__esModule?Ht(o,"default",{value:r,enumerable:!0}):o,r));var De=Se((Mr,zt)=>{var ee=function(){function r(t){if(!document.querySelector)return;function o(h,p){return h.classList?h.classList.contains(p):new RegExp("\\b"+p+"\\b").test(h.className)}c(o,"hasClass");function e(h,p,_){h.attachEvent?h.attachEvent("on"+p,_):h.addEventListener(p,_)}c(e,"addEvent");function i(h,p,_){h.detachEvent?h.detachEvent("on"+p,_):h.removeEventListener(p,_)}c(i,"removeEvent");function n(h,p,_,w){e(w||document,p,function(b){for(var f,v=b.target||b.srcElement;v&&!(f=o(v,h));)v=v.parentElement;f&&_.call(v,b)})}c(n,"live");var s={selector:0,source:0,minChars:3,delay:150,offsetLeft:0,offsetTop:1,cache:1,menuClass:"",renderItem:c(function(h,p){p=p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");var _=new RegExp("("+p.split(" ").join("|")+")","gi");return'<div class="autocomplete-suggestion" data-val="'+h+'">'+h.replace(_,"<b>$1</b>")+"</div>"},"renderItem"),onSelect:c(function(h,p,_){},"onSelect")};for(var a in t)t.hasOwnProperty(a)&&(s[a]=t[a]);for(var l=typeof s.selector=="object"?[s.selector]:document.querySelectorAll(s.selector),d=0;d<l.length;d++){var u=l[d];u.sc=document.createElement("div"),u.sc.className="autocomplete-suggestions "+s.menuClass,u.autocompleteAttr=u.getAttribute("autocomplete"),u.setAttribute("autocomplete","off"),u.cache={},u.last_val="",u.updateSC=function(h,p){var _=u.getBoundingClientRect();if(u.sc.style.left=Math.round(_.left+(window.pageXOffset||document.documentElement.scrollLeft)+s.offsetLeft)+"px",u.sc.style.top=Math.round(_.bottom+(window.pageYOffset||document.documentElement.scrollTop)+s.offsetTop)+"px",u.sc.style.width=Math.round(_.right-_.left)+"px",!h&&(u.sc.style.display="block",u.sc.classList.remove("hide"),u.sc.maxHeight||(u.sc.maxHeight=parseInt((window.getComputedStyle?getComputedStyle(u.sc,null):u.sc.currentStyle).maxHeight)),u.sc.suggestionHeight||(u.sc.suggestionHeight=u.sc.querySelector(".autocomplete-suggestion").offsetHeight),u.sc.suggestionHeight))if(!p)u.sc.scrollTop=0;else{var w=u.sc.scrollTop,b=p.getBoundingClientRect().top-u.sc.getBoundingClientRect().top;b+u.sc.suggestionHeight-u.sc.maxHeight>0?u.sc.scrollTop=b+u.sc.suggestionHeight+w-u.sc.maxHeight:b<0&&(u.sc.scrollTop=b+w)}},e(window,"resize",u.updateSC),document.body.appendChild(u.sc),n("autocomplete-suggestion","mouseleave",function(h){var p=u.sc.querySelector(".autocomplete-suggestion.selected");p&&setTimeout(function(){p.className=p.className.replace("selected","")},20)},u.sc),n("autocomplete-suggestion","mouseover",function(h){var p=u.sc.querySelector(".autocomplete-suggestion.selected");p&&(p.className=p.className.replace("selected","")),this.className+=" selected"},u.sc),n("autocomplete-suggestion","mousedown",function(h){if(o(this,"autocomplete-suggestion")){var p=this.getAttribute("data-val");u.value=p,s.onSelect(h,p,this),u.sc.style.display="none",u.sc.classList.add("hide")}},u.sc),u.blurHandler=function(){try{var h=document.querySelector(".autocomplete-suggestions:hover")}catch{var h=0}h?u!==document.activeElement&&setTimeout(function(){u.focus()},20):(u.last_val=u.value,u.sc.style.display="none",u.sc.classList.add("hide"),setTimeout(function(){u.sc.style.display="none",u.sc.classList.add("hide")},350))},e(u,"blur",u.blurHandler);var y=c(function(h,p){if(!p)var p=u.value;if(u.cache[p]=h,h.length&&p.length>=s.minChars){for(var _="",w=0;w<h.length;w++)_+=s.renderItem(h[w],p);u.sc.innerHTML=_,u.updateSC(0)}else u.sc.style.display="none",u.sc.classList.add("hide")},"suggest");u.keydownHandler=function(h){var p=window.event?h.keyCode:h.which;if((p==40||p==38)&&u.sc.innerHTML){var _,w=u.sc.querySelector(".autocomplete-suggestion.selected");return w?(_=p==40?w.nextSibling:w.previousSibling,_?(w.className=w.className.replace("selected",""),_.className+=" selected",u.value=_.getAttribute("data-val")):(w.className=w.className.replace("selected",""),u.value=u.last_val,_=0)):(_=p==40?u.sc.querySelector(".autocomplete-suggestion"):u.sc.childNodes[u.sc.childNodes.length-1],_.className+=" selected",u.value=_.getAttribute("data-val")),u.updateSC(0,_),!1}else if(p==27)u.value=u.last_val,u.sc.style.display="none",u.sc.classList.add("hide");else if(p==13||p==9){u.sc.style.display!=="none"&&h.preventDefault();var w=u.sc.querySelector(".autocomplete-suggestion.selected");w&&u.sc.style.display!="none"&&(s.onSelect(h,w.getAttribute("data-val"),w),setTimeout(function(){u.sc.style.display="none",u.sc.classList.add("hide")},20))}},e(u,"keydown",u.keydownHandler),u.keyupHandler=function(h){var p=window.event?h.keyCode:h.which;if(!p||(p<35||p>40)&&p!=13&&p!=27){var _=u.value;if(_.length>=s.minChars){if(_!=u.last_val){if(u.last_val=_,clearTimeout(u.timer),s.cache){if(_ in u.cache){y(u.cache[_]);return}for(var w=1;w<_.length-s.minChars;w++){var b=_.slice(0,_.length-w);if(b in u.cache&&!u.cache[b].length){y([]);return}}}u.timer=setTimeout(function(){s.source(_,y)},s.delay)}}else u.last_val=_,u.sc.style.display="none",u.sc.classList.add("hide")}},e(u,"keyup",u.keyupHandler),u.focusHandler=function(h){u.last_val=`
|
|
2
|
-
`,u.keyupHandler(h)},s.minChars||e(u,"focus",u.focusHandler)}this.destroy=function(){for(var h=0;h<l.length;h++){var p=l[h];i(window,"resize",p.updateSC),i(p,"blur",p.blurHandler),i(p,"focus",p.focusHandler),i(p,"keydown",p.keydownHandler),i(p,"keyup",p.keyupHandler),p.autocompleteAttr?p.setAttribute("autocomplete",p.autocompleteAttr):p.removeAttribute("autocomplete"),document.body.removeChild(p.sc),p=null}}}return c(r,"autoComplete"),r}();(function(){typeof define=="function"&&define.amd?define("autoComplete",function(){return ee}):typeof zt<"u"&&zt.exports?zt.exports=ee:window.autoComplete=ee})()});var Ke=Se((Ii,pe)=>{"use strict";typeof pe<"u"&&(pe.exports=Yt);function Yt(r){if(!(this instanceof Yt))return new Yt(r);this._canvas=r=typeof r=="string"?document.getElementById(r):r,this._ctx=r.getContext("2d"),this._width=r.width,this._height=r.height,this._max=1,this._data=[]}c(Yt,"simpleheat");Yt.prototype={defaultRadius:25,defaultGradient:{.4:"blue",.6:"cyan",.7:"lime",.8:"yellow",1:"red"},data:c(function(r){return this._data=r,this},"data"),max:c(function(r){return this._max=r,this},"max"),add:c(function(r){return this._data.push(r),this},"add"),clear:c(function(){return this._data=[],this},"clear"),radius:c(function(r,t){t=t===void 0?15:t;var o=this._circle=this._createCanvas(),e=o.getContext("2d"),i=this._r=r+t;return o.width=o.height=i*2,e.shadowOffsetX=e.shadowOffsetY=i*2,e.shadowBlur=t,e.shadowColor="black",e.beginPath(),e.arc(-i,-i,r,0,Math.PI*2,!0),e.closePath(),e.fill(),this},"radius"),resize:c(function(){this._width=this._canvas.width,this._height=this._canvas.height},"resize"),gradient:c(function(r){var t=this._createCanvas(),o=t.getContext("2d"),e=o.createLinearGradient(0,0,0,256);t.width=1,t.height=256;for(var i in r)e.addColorStop(+i,r[i]);return o.fillStyle=e,o.fillRect(0,0,1,256),this._grad=o.getImageData(0,0,1,256).data,this},"gradient"),draw:c(function(r){this._circle||this.radius(this.defaultRadius),this._grad||this.gradient(this.defaultGradient);var t=this._ctx;t.clearRect(0,0,this._width,this._height);for(var o=0,e=this._data.length,i;o<e;o++)i=this._data[o],t.globalAlpha=Math.max(i[2]/this._max,r===void 0?.05:r),t.drawImage(this._circle,i[0]-this._r,i[1]-this._r);var n=t.getImageData(0,0,this._width,this._height);return this._colorize(n.data,this._grad),t.putImageData(n,0,0),this},"draw"),_colorize:c(function(r,t){for(var o=0,e=r.length,i;o<e;o+=4)i=r[o+3]*4,i&&(r[o]=t[i],r[o+1]=t[i+1],r[o+2]=t[i+2])},"_colorize"),_createCanvas:c(function(){return typeof document<"u"?document.createElement("canvas"):new this._canvas.constructor},"_createCanvas")}});var Tr="@hpcc-js/other",Er="3.1.
|
|
2
|
+
`,u.keyupHandler(h)},s.minChars||e(u,"focus",u.focusHandler)}this.destroy=function(){for(var h=0;h<l.length;h++){var p=l[h];i(window,"resize",p.updateSC),i(p,"blur",p.blurHandler),i(p,"focus",p.focusHandler),i(p,"keydown",p.keydownHandler),i(p,"keyup",p.keyupHandler),p.autocompleteAttr?p.setAttribute("autocomplete",p.autocompleteAttr):p.removeAttribute("autocomplete"),document.body.removeChild(p.sc),p=null}}}return c(r,"autoComplete"),r}();(function(){typeof define=="function"&&define.amd?define("autoComplete",function(){return ee}):typeof zt<"u"&&zt.exports?zt.exports=ee:window.autoComplete=ee})()});var Ke=Se((Ii,pe)=>{"use strict";typeof pe<"u"&&(pe.exports=Yt);function Yt(r){if(!(this instanceof Yt))return new Yt(r);this._canvas=r=typeof r=="string"?document.getElementById(r):r,this._ctx=r.getContext("2d"),this._width=r.width,this._height=r.height,this._max=1,this._data=[]}c(Yt,"simpleheat");Yt.prototype={defaultRadius:25,defaultGradient:{.4:"blue",.6:"cyan",.7:"lime",.8:"yellow",1:"red"},data:c(function(r){return this._data=r,this},"data"),max:c(function(r){return this._max=r,this},"max"),add:c(function(r){return this._data.push(r),this},"add"),clear:c(function(){return this._data=[],this},"clear"),radius:c(function(r,t){t=t===void 0?15:t;var o=this._circle=this._createCanvas(),e=o.getContext("2d"),i=this._r=r+t;return o.width=o.height=i*2,e.shadowOffsetX=e.shadowOffsetY=i*2,e.shadowBlur=t,e.shadowColor="black",e.beginPath(),e.arc(-i,-i,r,0,Math.PI*2,!0),e.closePath(),e.fill(),this},"radius"),resize:c(function(){this._width=this._canvas.width,this._height=this._canvas.height},"resize"),gradient:c(function(r){var t=this._createCanvas(),o=t.getContext("2d"),e=o.createLinearGradient(0,0,0,256);t.width=1,t.height=256;for(var i in r)e.addColorStop(+i,r[i]);return o.fillStyle=e,o.fillRect(0,0,1,256),this._grad=o.getImageData(0,0,1,256).data,this},"gradient"),draw:c(function(r){this._circle||this.radius(this.defaultRadius),this._grad||this.gradient(this.defaultGradient);var t=this._ctx;t.clearRect(0,0,this._width,this._height);for(var o=0,e=this._data.length,i;o<e;o++)i=this._data[o],t.globalAlpha=Math.max(i[2]/this._max,r===void 0?.05:r),t.drawImage(this._circle,i[0]-this._r,i[1]-this._r);var n=t.getImageData(0,0,this._width,this._height);return this._colorize(n.data,this._grad),t.putImageData(n,0,0),this},"draw"),_colorize:c(function(r,t){for(var o=0,e=r.length,i;o<e;o+=4)i=r[o+3]*4,i&&(r[o]=t[i],r[o+1]=t[i+1],r[o+2]=t[i+2])},"_colorize"),_createCanvas:c(function(){return typeof document<"u"?document.createElement("canvas"):new this._canvas.constructor},"_createCanvas")}});var Tr="@hpcc-js/other",Er="3.1.1",Pr="3.2.1";import{HTMLWidget as vo}from"@hpcc-js/common";var ft=0,kt=0,Ct=0,Re=1e3,Nt,St,Ft=0,rt=0,Mt=0,Tt=typeof performance=="object"&&performance.now?performance:Date,Ie=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(r){setTimeout(r,17)};function te(){return rt||(Ie(bo),rt=Tt.now()+Mt)}c(te,"now");function bo(){rt=0}c(bo,"clearNow");function Kt(){this._call=this._time=this._next=null}c(Kt,"Timer");Kt.prototype=Lt.prototype={constructor:Kt,restart:c(function(r,t,o){if(typeof r!="function")throw new TypeError("callback is not a function");o=(o==null?te():+o)+(t==null?0:+t),!this._next&&St!==this&&(St?St._next=this:Nt=this,St=this),this._call=r,this._time=o,Zt()},"restart"),stop:c(function(){this._call&&(this._call=null,this._time=1/0,Zt())},"stop")};function Lt(r,t,o){var e=new Kt;return e.restart(r,t,o),e}c(Lt,"timer");function We(){te(),++ft;for(var r=Nt,t;r;)(t=rt-r._time)>=0&&r._call.call(null,t),r=r._next;--ft}c(We,"timerFlush");function Pe(){rt=(Ft=Tt.now())+Mt,ft=kt=0;try{We()}finally{ft=0,wo(),rt=0}}c(Pe,"wake");function xo(){var r=Tt.now(),t=r-Ft;t>Re&&(Mt-=t,Ft=r)}c(xo,"poke");function wo(){for(var r,t=Nt,o,e=1/0;t;)t._call?(e>t._time&&(e=t._time),r=t,t=t._next):(o=t._next,t._next=null,t=r?r._next=o:Nt=o);St=r,Zt(e)}c(wo,"nap");function Zt(r){if(!ft){kt&&(kt=clearTimeout(kt));var t=r-rt;t>24?(r<1/0&&(kt=setTimeout(Pe,r-Tt.now()-Mt)),Ct&&(Ct=clearInterval(Ct))):(Ct||(Ft=Tt.now(),Ct=setInterval(xo,Re)),ft=1,Ie(Pe))}}c(Zt,"sleep");var Ot=class extends vo{static{c(this,"Audio")}_sections;constructor(){super(),this._tag="audio",this._sections={}}section(t,o,e,i){return arguments.length?arguments.length===1?this._sections[t]:(this._sections[t]={label:t,offset:o,beatLength:e,beatCount:i,endOffset:o+i*e},this):this._sections}getType(t){switch(t){case"mp3":return"audio/mpeg; codecs='mp3'";case"ogg":return"audio/ogg; codecs='vorbis'"}return""}enter(t,o){let e=this;o.on("play",function(i){e.onPlay(i)})}update(t,o){o.selectAll("source").data(this.source(),function(i){return i}).enter().append("source").attr("src",function(i){return i})}createTimer(t,o,e){let i=this;Lt(function(){return i.onTick(t.label,e,t),!0},e*t.beatLength,o+t.offset)}onTick(t,o,e){}onPlay(t){let o=Date.now();for(let e in this._sections){let i=this._sections[e];for(let n=0;n<i.beatCount;++n)this.createTimer(i,o,n)}}play(t){let o=this;this._element.on("canplaythrough",function(e){o.node().play()}),this.node().load()}};Ot.prototype._class+=" other_Audio";Ot.prototype.publish("source","","string","Audio Source");var Be=Ee(De(),1);import{HTMLWidget as Co}from"@hpcc-js/common";(function(){if(!document.getElementById("eea6831e")){var r=document.createElement("style");r.id="eea6831e",r.textContent=`.other_autoCompleteText label {
|
|
3
3
|
display: inline-block;
|
|
4
4
|
vertical-align: top;
|
|
5
5
|
}
|