UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

1 lines 7.47 kB
export const __rspack_esm_id=9970;export const __rspack_esm_ids=[9970];export const __webpack_modules__={78771(e,t,i){i.d(t,{A:()=>y});var o=i(62826),s=i(41144),l=i(22785),a=i(52557),r=i(90057),n=i(9078),c=i(28917),u=i(52577),m=i(79825),h=i(6715);function p(e,t){this.parent.drift(e,t)}const y=function(e){function t(t,i,o,s){var l=e.call(this)||this;return l.updateData(t,i,o,s),l}return(0,o.C6)(t,e),t.prototype._createSymbol=function(e,t,i,o,l,a){this.removeAll();var r=(0,s.v5)(e,-1,-1,2,2,null,a);r.attr({z2:(0,u.retrieve2)(l,100),culling:!0,scaleX:o[0]/2,scaleY:o[1]/2}),r.drift=p,this._symbolType=e,this.add(r)},t.prototype.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(null,e)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){(0,n.HY)(this.childAt(0))},t.prototype.downplay=function(){(0,n.SD)(this.childAt(0))},t.prototype.setZ=function(e,t){var i=this.childAt(0);i.zlevel=e,i.z=t},t.prototype.setDraggable=function(e,t){var i=this.childAt(0);i.draggable=e,i.cursor=!t&&e?"move":i.cursor},t.prototype.updateData=function(e,i,o,s){this.silent=!1;var l=e.getItemVisual(i,"symbol")||"circle",r=e.hostModel,n=t.getSymbolSize(e,i),c=t.getSymbolZ2(e,i),u=l!==this._symbolType,m=s&&s.disableAnimation;if(u){var h=e.getItemVisual(i,"symbolKeepAspect");this._createSymbol(l,e,i,n,c,h)}else{(y=this.childAt(0)).silent=!1;var p={scaleX:n[0]/2,scaleY:n[1]/2};m?y.attr(p):a.oi(y,p,r,i),(0,a.ap)(y)}if(this._updateCommon(e,i,n,o,s),u){var y=this.childAt(0);if(!m){p={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:y.style.opacity}};y.scaleX=y.scaleY=0,y.style.opacity=0,a.LW(y,p,r,i)}}m&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(e,t,i,o,l){var a,r,p,y,d,g,f,v,S,b=this.childAt(0),_=e.hostModel;if(o&&(a=o.emphasisItemStyle,r=o.blurItemStyle,p=o.selectItemStyle,y=o.focus,d=o.blurScope,f=o.labelStatesModels,v=o.hoverScale,S=o.cursorStyle,g=o.emphasisDisabled),!o||e.hasItemOption){var I=o&&o.itemModel?o.itemModel:e.getItemModel(t),A=I.getModel("emphasis");a=A.getModel("itemStyle").getItemStyle(),p=I.getModel(["select","itemStyle"]).getItemStyle(),r=I.getModel(["blur","itemStyle"]).getItemStyle(),y=A.get("focus"),d=A.get("blurScope"),g=A.get("disabled"),f=(0,m.lx)(I),v=A.getShallow("scale"),S=I.getShallow("cursor")}var x=e.getItemVisual(t,"symbolRotate");b.attr("rotation",(x||0)*Math.PI/180||0);var z=(0,s.hV)(e.getItemVisual(t,"symbolOffset"),i);z&&(b.x=z[0],b.y=z[1]),S&&b.attr("cursor",S);var M=e.getItemVisual(t,"style"),E=M.fill;if(b instanceof h.Ay){var C=b.style;b.useStyle((0,u.extend)({image:C.image,x:C.x,y:C.y,width:C.width,height:C.height},M))}else b.__isEmptyBrush?b.useStyle((0,u.extend)({},M)):b.useStyle(M),b.style.decal=null,b.setColor(E,l&&l.symbolInnerColor),b.style.strokeNoScale=!0;var Y=e.getItemVisual(t,"liftZ"),D=this._z2;null!=Y?null==D&&(this._z2=b.z2,b.z2+=Y):null!=D&&(b.z2=D,this._z2=null);var L=l&&l.useNameLabel;(0,m.qM)(b,f,{labelFetcher:_,labelDataIndex:t,defaultText:function(t){return L?e.getName(t):(0,c.i)(e,t)},inheritColor:E,defaultOpacity:M.opacity}),this._sizeX=i[0]/2,this._sizeY=i[1]/2;var T=b.ensureState("emphasis");T.style=a,b.ensureState("select").style=p,b.ensureState("blur").style=r;var V=null==v||!0===v?Math.max(1.1,3/this._sizeY):isFinite(v)&&v>0?+v:1;T.scaleX=this._sizeX*V,T.scaleY=this._sizeY*V,this.setSymbolScale(1),(0,n.Lm)(this,y,d,g)},t.prototype.setSymbolScale=function(e){this.scaleX=this.scaleY=e},t.prototype.fadeOut=function(e,t,i){var o=this.childAt(0),s=(0,r.z)(this).dataIndex,l=i&&i.animation;if(this.silent=o.silent=!0,i&&i.fadeLabel){var n=o.getTextContent();n&&a.Nz(n,{style:{opacity:0}},t,{dataIndex:s,removeOpt:l,cb:function(){o.removeTextContent()}})}else o.removeTextContent();a.Nz(o,{style:{opacity:0},scaleX:0,scaleY:0},t,{dataIndex:s,cb:e,removeOpt:l})},t.getSymbolSize=function(e,t){return(0,s.xU)(e.getItemVisual(t,"symbolSize"))},t.getSymbolZ2=function(e,t){return e.getItemVisual(t,"z2")},t}(l.A)},59689(e,t,i){i.d(t,{A:()=>p});i(44114),i(46058);var o=i(22785),s=i(52557),l=i(26322),a=i(78771),r=i(52577),n=i(79825);function c(e,t,i,o){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(o&&o.isIgnore&&o.isIgnore(i))&&!(o&&o.clipShape&&!o.clipShape.contain(t[0],t[1]))&&"none"!==e.getItemVisual(i,"symbol")}function u(e){return null==e||(0,r.isObject)(e)||(e={isIgnore:e}),e||{}}function m(e){var t=e.hostModel,i=t.getModel("emphasis");return{emphasisItemStyle:i.getModel("itemStyle").getItemStyle(),blurItemStyle:t.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:t.getModel(["select","itemStyle"]).getItemStyle(),focus:i.get("focus"),blurScope:i.get("blurScope"),emphasisDisabled:i.get("disabled"),hoverScale:i.get("scale"),labelStatesModels:(0,n.lx)(t),cursorStyle:t.get("cursor")}}function h(e,t,i,o,s,l,a){var r=new e(t,i,o,s);return r.setPosition(l),t.setItemGraphicEl(i,r),a.add(r),r}const p=function(){function e(e){this.group=new o.A,this._SymbolCtor=e||a.A}return e.prototype.updateData=function(e,t){this._progressiveEls=null,t=u(t);var i=this.group,o=e.hostModel,l=this._data,a=this._SymbolCtor,r=t.disableAnimation,n=this._seriesScope=m(e),p={disableAnimation:r},y=t.getSymbolPoint||function(t){return e.getItemLayout(t)};l||i.removeAll(),e.diff(l).add(function(o){var s=y(o);c(e,s,o,t)&&h(a,e,o,n,p,s,i)}).update(function(u,m){var h=l.getItemGraphicEl(m),d=y(u);if(c(e,d,u,t)){var g=e.getItemVisual(u,"symbol")||"circle",f=h&&h.getSymbolType&&h.getSymbolType();if(!h||f&&f!==g)i.remove(h),(h=new a(e,u,n,p)).setPosition(d);else{h.updateData(e,u,n,p);var v={x:d[0],y:d[1]};r?h.attr(v):s.oi(h,v,o)}i.add(h),e.setItemGraphicEl(u,h)}else i.remove(h)}).remove(function(e){var t=l.getItemGraphicEl(e);t&&t.fadeOut(function(){i.remove(t)},o)}).execute(),this._getSymbolPoint=y,this._data=e},e.prototype.updateLayout=function(e){var t=this._data;if(t)for(var i=this,o=0,s=t.getStore().count();o<s;o++){var l=t.getItemGraphicEl(o),a=i._getSymbolPoint(o);c(t,a,o,e)?((l=l||h(i._SymbolCtor,t,o,i._seriesScope,{disableAnimation:!0},a,i.group)).stopAnimation(),l.setPosition(a),l.markRedraw()):l&&(i.group.remove(l),t.setItemGraphicEl(o,null))}},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=m(e),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t,i,o){function s(e){e.isGroup||(e.incremental=i,e.ensureState("emphasis").hoverLayer=l.HOVER_LAYER_FOR_INCREMENTAL)}this._progressiveEls=[],o=u(o);for(var a=e.start;a<e.end;a++){var r=t.getItemLayout(a);if(c(t,r,a,o)){var n=new this._SymbolCtor(t,a,this._seriesScope);n.traverse(s),n.setPosition(r),this.group.add(n),t.setItemGraphicEl(a,n),this._progressiveEls.push(n)}}},e.prototype.eachRendered=function(e){l.traverseElements(this._progressiveEls||this.group,e)},e.prototype.remove=function(e){var t=this.group,i=this._data;i&&e?i.eachItemGraphicEl(function(e){e.fadeOut(function(){t.remove(e)},i.hostModel)}):t.removeAll()},e}()},28917(e,t,i){i.d(t,{T:()=>a,i:()=>l});i(44114);var o=i(46802),s=i(52577);function l(e,t){var i=e.mapDimensionsAll("defaultedLabel"),s=i.length;if(1===s){var l=(0,o.QE)(e,t,i[0]);return null!=l?l+"":null}if(s){for(var a=[],r=0;r<i.length;r++)a.push((0,o.QE)(e,t,i[r]));return a.join(" ")}}function a(e,t){var i=e.mapDimensionsAll("defaultedLabel");if(!(0,s.isArray)(t))return t+"";for(var o=[],l=0;l<i.length;l++){var a=e.getDimensionIndex(i[l]);a>=0&&o.push(t[a])}return o.join(" ")}}};