@openremote/or-attribute-history 1.7.0-snapshot.20250704092907 → 1.7.0-snapshot.20250704115747
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/umd/index.bundle.js +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.orbundle.js +2 -2
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +7 -7
package/dist/umd/index.bundle.js
CHANGED
|
@@ -701,7 +701,7 @@
|
|
|
701
701
|
</div>
|
|
702
702
|
`))))))}
|
|
703
703
|
</div>
|
|
704
|
-
`}willUpdate(t){
|
|
704
|
+
`}willUpdate(t){if(super.willUpdate(t),this._type&&this._data){if(!this._type||"number"!==this._type.jsonType&&"boolean"!==this._type.jsonType)this._tableTemplate&&!t.has("_data")||(this._tableTemplate=this._getTableTemplate());else{const e=this._data.map((t=>[t.x,t.y]));if(this._chart)t.has("_data")&&this._updateChartData();else{let t=this._style.getPropertyValue("--internal-or-attribute-history-graph-fill-color").trim();const n=Number(this._style.getPropertyValue("--internal-or-attribute-history-graph-fill-opacity").trim());isNaN(n)||(!t.startsWith("#")||4!==t.length&&7!==t.length?t.startsWith("rgb(")&&(t=t.substring(0,t.length-1)+n):t+=4===t.length?Math.round(255*n).toString(16).substr(0,1):Math.round(255*n).toString(16)),this._chartOptions={animation:!1,grid:{show:!0,backgroundColor:this._style.getPropertyValue("--internal-or-asset-viewer-panel-color"),borderColor:this._style.getPropertyValue("--internal-or-attribute-history-text-color"),left:4,right:4,top:10,containLabel:!0},backgroundColor:this._style.getPropertyValue("--internal-or-asset-viewer-panel-color"),tooltip:{trigger:"axis",confine:!0,axisPointer:{type:"cross"},formatter:t=>{if(Array.isArray(t)&&t.length>0){const e=t[0].value[1];return void 0!==e?e.toString():""}return""}},xAxis:{type:"time",axisLine:{onZero:!1,lineStyle:{color:this._style.getPropertyValue("--internal-or-attribute-history-text-color")}},splitLine:{show:!0},min:this._startOfPeriod,max:this._endOfPeriod,axisLabel:{hideOverlap:!0,fontSize:10,formatter:{year:"{yyyy}-{MMM}",month:"{yy}-{MMM}",day:"{d}-{MMM}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{d}-{MMM} {HH}:{mm}",none:"{MMM}-{dd} {HH}:{mm}"}}},yAxis:{type:"value",axisLine:{lineStyle:{color:this._style.getPropertyValue("--internal-or-attribute-history-text-color")}},boundaryGap:["10%","10%"],scale:!0},dataZoom:[{type:"inside",start:0,end:100},{start:0,end:100,backgroundColor:t,fillerColor:t,dataBackground:{areaStyle:{color:this._style.getPropertyValue("--internal-or-attribute-history-graph-fill-color")}},selectedDataBackground:{areaStyle:{color:this._style.getPropertyValue("--internal-or-attribute-history-graph-fill-color")}},moveHandleStyle:{color:this._style.getPropertyValue("--internal-or-attribute-history-graph-fill-color")},emphasis:{moveHandleStyle:{color:this._style.getPropertyValue("--internal-or-attribute-history-graph-fill-color")},handleLabel:{show:!0}},handleLabel:{show:!1},showDetail:!1}],series:[{name:"timestamp value",type:"line",showSymbol:e.length<=30,data:e,sampling:"lttb",itemStyle:{color:this._style.getPropertyValue("--internal-or-attribute-history-graph-line-color")}}]},this._chart=function(t,e,n){var i=function(t){return Wy[function(t,e){return t.getAttribute?t.getAttribute(e):t[e]}(t,$y)]}(t);if(i)return i;var r=new Oy(t,void 0,n);return r.id="ec_"+Uy++,Wy[r.id]=r,Ra(t,$y,r.id),Dy(r),ty.trigger("afterinit",r),r}(this._chartElem),this._chart.setOption(this._chartOptions),window.addEventListener("resize",(()=>{var t;return null===(t=this._chart)||void 0===t?void 0:t.resize()}));const i=new ResizeObserver((()=>{var t;return null===(t=this._chart)||void 0===t?void 0:t.resize()}));i.observe(this._chartElem),this._chart.on("datazoom",(0,cG.debounce)((t=>{this._onZoomChange(t)}),750))}}this.onCompleted().then((()=>{this.dispatchEvent(new h4("rendered"))}))}}onCompleted(){return u4(this,void 0,void 0,(function*(){yield this.updateComplete}))}_cleanup(){this._tableTemplate=void 0,this._chart&&(this._chart.dispose(),this._chart=void 0),this._table&&(this._table.destroy(),this._table=void 0)}_getTableTemplate(){const t=this.assetType,e=this.attribute?this.attribute.name:this.attributeRef?this.attributeRef.name:void 0,n=this.attribute?this.attribute.type:void 0;if(!(this._data&&t&&e&&n))return XG``;let i={autoColumns:!0};if(this.config&&this.config.table&&(this.config.table.assetTypes&&this.config.table.assetTypes[t]&&(this.config.table.assetTypes[t].attributeNames&&this.config.table.assetTypes[t].attributeNames[e]||n&&this.config.table.assetTypes[t].attributeValueTypes&&this.config.table.assetTypes[t].attributeValueTypes[n])?i=this.config.table.assetTypes[t].attributeNames&&this.config.table.assetTypes[t].attributeNames[e]||this.config.table.assetTypes[t].attributeValueTypes[n]:this.config.table.attributeNames&&this.config.table.attributeNames[e]?i=this.config.table.attributeNames[e]:n&&this.config.table.attributeValueTypes&&this.config.table.attributeValueTypes[n]?i=this.config.table.attributeValueTypes[n]:this.config.table.default&&(i=this.config.table.default),i||(i={autoColumns:!0})),i.autoColumns){i=Object.assign({},i),i.columns=[];const t=this._data.find((t=>void 0!==t.y));t&&("object"!=typeof t.y||Array.isArray(t.y)?i.columns.push({type:"prop",header:"value",stringify:"object"==typeof t.y,numeric:"number"==typeof t.y}):i.columns=Object.entries(t.y).map((([t,e])=>({type:"prop",header:t,path:"$.['"+t+"']",stringify:"object"==typeof e,numeric:!isNaN(Number(e))})))),i.columns.length>0&&i.columns.push({header:"timestamp",type:"timestamp"})}return i.columns&&i.columns.length>0?XG`
|
|
705
705
|
<div id="table" class="mdc-data-table">
|
|
706
706
|
<table style="${i.styles?ZZ(i.styles):""}" class="mdc-data-table__table" aria-label="${e+" history"}">
|
|
707
707
|
<thead>
|
package/dist/umd/index.js
CHANGED
|
@@ -701,7 +701,7 @@
|
|
|
701
701
|
</div>
|
|
702
702
|
`))))))}
|
|
703
703
|
</div>
|
|
704
|
-
`}willUpdate(t){
|
|
704
|
+
`}willUpdate(t){if(super.willUpdate(t),this._type&&this._data){if(!this._type||"number"!==this._type.jsonType&&"boolean"!==this._type.jsonType)this._tableTemplate&&!t.has("_data")||(this._tableTemplate=this._getTableTemplate());else{const e=this._data.map((t=>[t.x,t.y]));if(this._chart)t.has("_data")&&this._updateChartData();else{let t=this._style.getPropertyValue("--internal-or-attribute-history-graph-fill-color").trim();const n=Number(this._style.getPropertyValue("--internal-or-attribute-history-graph-fill-opacity").trim());isNaN(n)||(!t.startsWith("#")||4!==t.length&&7!==t.length?t.startsWith("rgb(")&&(t=t.substring(0,t.length-1)+n):t+=4===t.length?Math.round(255*n).toString(16).substr(0,1):Math.round(255*n).toString(16)),this._chartOptions={animation:!1,grid:{show:!0,backgroundColor:this._style.getPropertyValue("--internal-or-asset-viewer-panel-color"),borderColor:this._style.getPropertyValue("--internal-or-attribute-history-text-color"),left:4,right:4,top:10,containLabel:!0},backgroundColor:this._style.getPropertyValue("--internal-or-asset-viewer-panel-color"),tooltip:{trigger:"axis",confine:!0,axisPointer:{type:"cross"},formatter:t=>{if(Array.isArray(t)&&t.length>0){const e=t[0].value[1];return void 0!==e?e.toString():""}return""}},xAxis:{type:"time",axisLine:{onZero:!1,lineStyle:{color:this._style.getPropertyValue("--internal-or-attribute-history-text-color")}},splitLine:{show:!0},min:this._startOfPeriod,max:this._endOfPeriod,axisLabel:{hideOverlap:!0,fontSize:10,formatter:{year:"{yyyy}-{MMM}",month:"{yy}-{MMM}",day:"{d}-{MMM}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{d}-{MMM} {HH}:{mm}",none:"{MMM}-{dd} {HH}:{mm}"}}},yAxis:{type:"value",axisLine:{lineStyle:{color:this._style.getPropertyValue("--internal-or-attribute-history-text-color")}},boundaryGap:["10%","10%"],scale:!0},dataZoom:[{type:"inside",start:0,end:100},{start:0,end:100,backgroundColor:t,fillerColor:t,dataBackground:{areaStyle:{color:this._style.getPropertyValue("--internal-or-attribute-history-graph-fill-color")}},selectedDataBackground:{areaStyle:{color:this._style.getPropertyValue("--internal-or-attribute-history-graph-fill-color")}},moveHandleStyle:{color:this._style.getPropertyValue("--internal-or-attribute-history-graph-fill-color")},emphasis:{moveHandleStyle:{color:this._style.getPropertyValue("--internal-or-attribute-history-graph-fill-color")},handleLabel:{show:!0}},handleLabel:{show:!1},showDetail:!1}],series:[{name:"timestamp value",type:"line",showSymbol:e.length<=30,data:e,sampling:"lttb",itemStyle:{color:this._style.getPropertyValue("--internal-or-attribute-history-graph-line-color")}}]},this._chart=function(t,e,n){var i=function(t){return Uy[function(t,e){return t.getAttribute?t.getAttribute(e):t[e]}(t,jy)]}(t);if(i)return i;var r=new Ly(t,void 0,n);return r.id="ec_"+Xy++,Uy[r.id]=r,zo(t,jy,r.id),Cy(r),Qv.trigger("afterinit",r),r}(this._chartElem),this._chart.setOption(this._chartOptions),window.addEventListener("resize",(()=>{var t;return null===(t=this._chart)||void 0===t?void 0:t.resize()}));const i=new ResizeObserver((()=>{var t;return null===(t=this._chart)||void 0===t?void 0:t.resize()}));i.observe(this._chartElem),this._chart.on("datazoom",(0,aX.debounce)((t=>{this._onZoomChange(t)}),750))}}this.onCompleted().then((()=>{this.dispatchEvent(new HK("rendered"))}))}}onCompleted(){return FK(this,void 0,void 0,(function*(){yield this.updateComplete}))}_cleanup(){this._tableTemplate=void 0,this._chart&&(this._chart.dispose(),this._chart=void 0),this._table&&(this._table.destroy(),this._table=void 0)}_getTableTemplate(){const t=this.assetType,e=this.attribute?this.attribute.name:this.attributeRef?this.attributeRef.name:void 0,n=this.attribute?this.attribute.type:void 0;if(!(this._data&&t&&e&&n))return XX``;let i={autoColumns:!0};if(this.config&&this.config.table&&(this.config.table.assetTypes&&this.config.table.assetTypes[t]&&(this.config.table.assetTypes[t].attributeNames&&this.config.table.assetTypes[t].attributeNames[e]||n&&this.config.table.assetTypes[t].attributeValueTypes&&this.config.table.assetTypes[t].attributeValueTypes[n])?i=this.config.table.assetTypes[t].attributeNames&&this.config.table.assetTypes[t].attributeNames[e]||this.config.table.assetTypes[t].attributeValueTypes[n]:this.config.table.attributeNames&&this.config.table.attributeNames[e]?i=this.config.table.attributeNames[e]:n&&this.config.table.attributeValueTypes&&this.config.table.attributeValueTypes[n]?i=this.config.table.attributeValueTypes[n]:this.config.table.default&&(i=this.config.table.default),i||(i={autoColumns:!0})),i.autoColumns){i=Object.assign({},i),i.columns=[];const t=this._data.find((t=>void 0!==t.y));t&&("object"!=typeof t.y||Array.isArray(t.y)?i.columns.push({type:"prop",header:"value",stringify:"object"==typeof t.y,numeric:"number"==typeof t.y}):i.columns=Object.entries(t.y).map((([t,e])=>({type:"prop",header:t,path:"$.['"+t+"']",stringify:"object"==typeof e,numeric:!isNaN(Number(e))})))),i.columns.length>0&&i.columns.push({header:"timestamp",type:"timestamp"})}return i.columns&&i.columns.length>0?XX`
|
|
705
705
|
<div id="table" class="mdc-data-table">
|
|
706
706
|
<table style="${i.styles?YZ(i.styles):""}" class="mdc-data-table__table" aria-label="${e+" history"}">
|
|
707
707
|
<thead>
|