@openremote/or-attribute-history 1.2.0-snapshot.20240512154942

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/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # @openremote/or-attribute-history \<or-attribute-history\>
2
+ [![NPM Version][npm-image]][npm-url]
3
+ [![Linux Build][travis-image]][travis-url]
4
+ [![Test Coverage][coveralls-image]][coveralls-url]
5
+
6
+ Web Component for displaying historical values of an attribute.
7
+
8
+ ## Install
9
+ ```bash
10
+ npm i @openremote/or-attribute-history
11
+ yarn add @openremote/or-attribute-history
12
+ ```
13
+
14
+ ## Usage
15
+ For a full list of properties, methods and options refer to the TypeDoc generated [documentation]().
16
+
17
+
18
+ ## Supported Browsers
19
+ The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
20
+ Internet Explorer 11 is also supported.
21
+
22
+
23
+ ## License
24
+ [GNU AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html)
25
+
26
+ [npm-image]: https://img.shields.io/npm/v/live-xxx.svg
27
+ [npm-url]: https://npmjs.org/package/@openremote/or-attribute-history
28
+ [travis-image]: https://img.shields.io/travis/live-js/live-xxx/master.svg
29
+ [travis-url]: https://travis-ci.org/live-js/live-xxx
30
+ [coveralls-image]: https://img.shields.io/coveralls/live-js/live-xxx/master.svg
31
+ [coveralls-url]: https://coveralls.io/r/live-js/live-xxx?branch=master
package/lib/index.d.ts ADDED
@@ -0,0 +1,122 @@
1
+ import { LitElement, PropertyValues, TemplateResult } from "lit";
2
+ import { Attribute, AttributeRef, ValueDatapoint, ValueDescriptor } from "@openremote/model";
3
+ import "@openremote/or-mwc-components/or-mwc-input";
4
+ import "@openremote/or-components/or-panel";
5
+ import "@openremote/or-translate";
6
+ import "@openremote/or-chart";
7
+ import { Chart, ScatterDataPoint, TimeUnit } from "chart.js";
8
+ import "chartjs-adapter-moment";
9
+ import { MDCDataTable } from "@material/data-table";
10
+ import moment from "moment";
11
+ export declare class OrAttributeHistoryEvent extends CustomEvent<OrAttributeHistoryEventDetail> {
12
+ static readonly NAME = "or-attribute-history-event";
13
+ constructor(value?: any, previousValue?: any);
14
+ }
15
+ export interface OrAttributeHistoryEventDetail {
16
+ value?: any;
17
+ previousValue?: any;
18
+ }
19
+ declare global {
20
+ export interface HTMLElementEventMap {
21
+ [OrAttributeHistoryEvent.NAME]: OrAttributeHistoryEvent;
22
+ }
23
+ }
24
+ export type TableColumnType = "timestamp" | "prop";
25
+ export interface TableColumnConfig {
26
+ type?: TableColumnType;
27
+ header?: string;
28
+ numeric?: boolean;
29
+ path?: string;
30
+ stringify?: boolean;
31
+ styles?: {
32
+ [style: string]: string;
33
+ };
34
+ headerStyles?: {
35
+ [style: string]: string;
36
+ };
37
+ contentProvider?: (datapoint: ValueDatapoint<any>, value: any, config: TableColumnConfig) => TemplateResult | any | undefined;
38
+ }
39
+ export interface AssetTableConfig {
40
+ timestampFormat?: string;
41
+ autoColumns?: boolean;
42
+ columns?: TableColumnConfig[];
43
+ styles?: {
44
+ [style: string]: string;
45
+ };
46
+ }
47
+ export interface TableConfig {
48
+ default?: AssetTableConfig;
49
+ assetTypes?: {
50
+ [assetType: string]: {
51
+ attributeNames?: {
52
+ [attributeName: string]: AssetTableConfig;
53
+ };
54
+ attributeValueTypes?: {
55
+ [attributeValueType: string]: AssetTableConfig;
56
+ };
57
+ };
58
+ };
59
+ attributeNames?: {
60
+ [attributeName: string]: AssetTableConfig;
61
+ };
62
+ attributeValueTypes?: {
63
+ [attributeValueType: string]: AssetTableConfig;
64
+ };
65
+ }
66
+ export interface ChartConfig {
67
+ xLabel?: string;
68
+ yLabel?: string;
69
+ }
70
+ export interface HistoryConfig {
71
+ table?: TableConfig;
72
+ chart?: ChartConfig;
73
+ }
74
+ declare const OrAttributeHistory_base: (new (...args: any[]) => {
75
+ _i18nextJustInitialized: boolean;
76
+ connectedCallback(): void;
77
+ disconnectedCallback(): void;
78
+ shouldUpdate(changedProps: import("lit").PropertyValueMap<any> | Map<PropertyKey, unknown>): any;
79
+ initCallback: (options: import("i18next").InitOptions) => void;
80
+ langChangedCallback: () => void;
81
+ readonly isConnected: boolean;
82
+ }) & typeof LitElement;
83
+ export declare class OrAttributeHistory extends OrAttributeHistory_base {
84
+ static DEFAULT_TIMESTAMP_FORMAT: string;
85
+ static get styles(): import("lit").CSSResult[];
86
+ assetType?: string;
87
+ assetId?: string;
88
+ attribute?: Attribute<any>;
89
+ attributeRef?: AttributeRef;
90
+ period: moment.unitOfTime.Base;
91
+ toTimestamp?: Date;
92
+ config?: HistoryConfig;
93
+ protected _loading: boolean;
94
+ protected _data?: ValueDatapoint<any>[];
95
+ protected _tableTemplate?: TemplateResult;
96
+ protected _chartElem: HTMLCanvasElement;
97
+ protected _tableElem: HTMLDivElement;
98
+ protected _table?: MDCDataTable;
99
+ protected _chart?: Chart<"line", ScatterDataPoint[]>;
100
+ protected _type?: ValueDescriptor;
101
+ protected _style: CSSStyleDeclaration;
102
+ protected _startOfPeriod?: number;
103
+ protected _endOfPeriod?: number;
104
+ protected _timeUnits?: TimeUnit;
105
+ protected _stepSize?: number;
106
+ protected _updateTimestampTimer?: number;
107
+ protected _dataFirstLoaded: boolean;
108
+ connectedCallback(): void;
109
+ disconnectedCallback(): void;
110
+ shouldUpdate(_changedProperties: PropertyValues): boolean;
111
+ render(): TemplateResult<1>;
112
+ willUpdate(changedProperties: PropertyValues): void;
113
+ onCompleted(): Promise<void>;
114
+ protected _cleanup(): void;
115
+ protected _getTableTemplate(): TemplateResult;
116
+ protected _getCellValue(datapoint: ValueDatapoint<any>, config: TableColumnConfig, timestampFormat: string | undefined): TemplateResult | string | undefined;
117
+ protected _getIntervalOptions(): [string, string][];
118
+ protected _getPeriodOptions(): string[];
119
+ protected _loadData(): Promise<void>;
120
+ protected _updateTimestamp(timestamp: Date, forward?: boolean, timeout?: number): void;
121
+ }
122
+ export {};
package/lib/index.js ADDED
@@ -0,0 +1,149 @@
1
+ var OrAttributeHistory_1,__decorate=this&&this.__decorate||function(t,e,r,i){var o,a=arguments.length,s=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var n=t.length-1;n>=0;n--)(o=t[n])&&(s=(a<3?o(s):a>3?o(e,r,s):o(e,r))||s);return a>3&&s&&Object.defineProperty(e,r,s),s},__awaiter=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(o,a){function s(t){try{l(i.next(t))}catch(t){a(t)}}function n(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,n)}l((i=i.apply(t,e||[])).next())}))};import{css,html,LitElement,unsafeCSS}from"lit";import{customElement,property,query}from"lit/decorators.js";import i18next from"i18next";import{translate}from"@openremote/or-translate";import{AssetModelUtil}from"@openremote/model";import manager,{DefaultColor2,DefaultColor3,DefaultColor4}from"@openremote/core";import"@openremote/or-mwc-components/or-mwc-input";import"@openremote/or-components/or-panel";import"@openremote/or-translate";import"@openremote/or-chart";import{Chart}from"chart.js";import"chartjs-adapter-moment";import{InputType}from"@openremote/or-mwc-components/or-mwc-input";import{JSONPath}from"jsonpath-plus";import moment from"moment";import{styleMap}from"lit/directives/style-map.js";export class OrAttributeHistoryEvent extends CustomEvent{constructor(t,e){super(OrAttributeHistoryEvent.NAME,{detail:{value:t,previousValue:e},bubbles:!0,composed:!0})}}OrAttributeHistoryEvent.NAME="or-attribute-history-event";const tableStyle=require("@material/data-table/dist/mdc.data-table.css"),style=css`
2
+ :host {
3
+ --internal-or-attribute-history-background-color: var(--or-attribute-history-background-color, var(--or-app-color2, ${unsafeCSS(DefaultColor2)}));
4
+ --internal-or-attribute-history-text-color: var(--or-attribute-history-text-color, var(--or-app-color3, ${unsafeCSS(DefaultColor3)}));
5
+ --internal-or-attribute-history-controls-margin: var(--or-attribute-history-controls-margin, 10px 0);
6
+ --internal-or-attribute-history-controls-justify-content: var(--or-attribute-history-controls-justify-content, flex-end);
7
+ --internal-or-attribute-history-graph-fill-color: var(--or-attribute-history-graph-fill-color, var(--or-app-color4, ${unsafeCSS(DefaultColor4)}));
8
+ --internal-or-attribute-history-graph-fill-opacity: var(--or-attribute-history-graph-fill-opacity, 1);
9
+ --internal-or-attribute-history-graph-line-color: var(--or-attribute-history-graph-line-color, var(--or-app-color4, ${unsafeCSS(DefaultColor4)}));
10
+ --internal-or-attribute-history-graph-point-color: var(--or-attribute-history-graph-point-color, var(--or-app-color4, ${unsafeCSS(DefaultColor4)}));
11
+ --internal-or-attribute-history-graph-point-border-color: var(--or-attribute-history-graph-point-border-color, var(--or-app-color4, ${unsafeCSS(DefaultColor4)}));
12
+ --internal-or-attribute-history-graph-point-radius: var(--or-attribute-history-graph-point-radius, 2);
13
+ --internal-or-attribute-history-graph-point-hit-radius: var(--or-attribute-history-graph-point-hit-radius, 20);
14
+ --internal-or-attribute-history-graph-point-border-width: var(--or-attribute-history-graph-point-border-width, 2);
15
+ --internal-or-attribute-history-graph-point-hover-color: var(--or-attribute-history-graph-point-hover-color, var(--or-app-color4, ${unsafeCSS(DefaultColor4)}));
16
+ --internal-or-attribute-history-graph-point-hover-border-color: var(--or-attribute-history-graph-point-hover-border-color, var(--or-app-color4, ${unsafeCSS(DefaultColor4)}));
17
+ --internal-or-attribute-history-graph-point-hover-radius: var(--or-attribute-history-graph-point-hover-radius, 4);
18
+ --internal-or-attribute-history-graph-point-hover-border-width: var(--or-attribute-history-graph-point-hover-border-width, 2);
19
+ display: block;
20
+ }
21
+
22
+ :host([hidden]) {
23
+ display: none;
24
+ }
25
+
26
+ #container {
27
+ display: flex;
28
+ min-width: 0;
29
+ width: 100%;
30
+ height: 100%;
31
+ flex-direction: column;
32
+ }
33
+
34
+ .button-icon {
35
+ align-self: center;
36
+ padding: 10px;
37
+ cursor: pointer;
38
+ }
39
+
40
+
41
+ #msg {
42
+ height: 100%;
43
+ width: 100%;
44
+ justify-content: center;
45
+ align-items: center;
46
+ text-align: center;
47
+ }
48
+
49
+ #msg:not([hidden]) {
50
+ display: flex;
51
+ }
52
+
53
+ #controls {
54
+ display: flex;
55
+ flex-wrap: wrap;
56
+ justify-content: var(--internal-or-attribute-history-controls-justify-content);
57
+ margin: var(--internal-or-attribute-history-controls-margin);
58
+ flex-direction: row;
59
+ }
60
+
61
+ #time-picker {
62
+ width: 150px;
63
+ padding: 0 5px;
64
+ }
65
+
66
+ #ending-controls {
67
+ max-width: 100%;
68
+ display: flex;
69
+ flex-wrap: wrap;
70
+ align-items: center;
71
+ }
72
+
73
+ #ending-controls > * {
74
+ padding: 0 3px;
75
+ }
76
+
77
+ #ending-date {
78
+ width: 200px;
79
+ padding-left: 5px;
80
+ }
81
+
82
+ #chart-container {
83
+ position: relative;
84
+ min-height: 250px;
85
+ }
86
+
87
+ #table-container {
88
+ height: 100%;
89
+ }
90
+
91
+ #table {
92
+ width: 100%;
93
+ margin-bottom: 10px;
94
+ }
95
+
96
+ #table > table {
97
+ width: 100%;
98
+ table-layout: fixed;
99
+ }
100
+
101
+ #table th, #table td {
102
+ overflow: hidden;
103
+ white-space: nowrap;
104
+ text-overflow: ellipsis;
105
+ }
106
+ `;let OrAttributeHistory=OrAttributeHistory_1=class extends(translate(i18next)(LitElement)){constructor(){super(...arguments),this.period="day",this._loading=!1,this._dataFirstLoaded=!1}static get styles(){return[css`${unsafeCSS(tableStyle)}`,style]}connectedCallback(){super.connectedCallback(),this._style=window.getComputedStyle(this)}disconnectedCallback(){super.disconnectedCallback(),this._cleanup()}shouldUpdate(t){let e=t.has("period")||t.has("toTimestamp")||t.has("attribute");return!(this._dataFirstLoaded&&!t.get("_loading")&&!e)&&(this.toTimestamp?(!this._type&&this.attribute&&(this._type=AssetModelUtil.getValueDescriptor(this.attribute.type)||{}),e&&(this._type=void 0,this._data=void 0,this._loadData()),super.shouldUpdate(t)):(this.toTimestamp=new Date,!1))}render(){const t=this._type&&("number"===this._type.jsonType||"boolean"===this._type.jsonType),e=this._loading||!this._type;return html`
107
+ <div id="container">
108
+ <div id="controls">
109
+ <or-mwc-input id="time-picker" .type="${InputType.SELECT}" ?disabled="${e}" .label="${i18next.t("timeframe")}" @or-mwc-input-changed="${t=>this.period=t.detail.value}" .value="${this.period}" .options="${this._getPeriodOptions()}"></or-mwc-input>
110
+ <div id="ending-controls">
111
+ <or-mwc-input id="ending-date" .type="${InputType.DATETIME}" ?disabled="${e}" label="${i18next.t("ending")}" .value="${this.toTimestamp}" @or-mwc-input-changed="${t=>this._updateTimestamp(moment(t.detail.value).toDate())}"></or-mwc-input>
112
+ <or-icon class="button button-icon" ?disabled="${e}" icon="chevron-left" @click="${()=>this._updateTimestamp(this.toTimestamp,!1,0)}"></or-icon>
113
+ <or-icon class="button button-icon" ?disabled="${e}" icon="chevron-right" @click="${()=>this._updateTimestamp(this.toTimestamp,!0,0)}"></or-icon>
114
+ <or-icon class="button button-icon" ?disabled="${e}" icon="chevron-double-right" @click="${()=>this._updateTimestamp(new Date)}"></or-icon>
115
+ </div>
116
+ </div>
117
+
118
+ ${this._type?t?html`
119
+ <div id="chart-container">
120
+ <canvas id="chart"></canvas>
121
+ </div>
122
+ `:html`
123
+ <div id="table-container">
124
+ ${this._tableTemplate||""}
125
+ </div>
126
+ `:html`
127
+ <div id="msg">
128
+ <or-translate value="invalidAttribute"></or-translate>
129
+ </div>
130
+ `}
131
+ </div>
132
+ `}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;if(this._chart)t.has("_data")&&(this._chart.options.scales.x.min=this._startOfPeriod,this._chart.options.scales.x.max=this._endOfPeriod,this._chart.options.scales.x.time.unit=this._timeUnits,this._chart.options.scales.x.time.stepSize=this._stepSize,this._chart.data.datasets[0].data=e,this._chart.update());else{let t=this._style.getPropertyValue("--internal-or-attribute-history-graph-fill-color").trim();const r=Number(this._style.getPropertyValue("--internal-or-attribute-history-graph-fill-opacity").trim());isNaN(r)||(!t.startsWith("#")||4!==t.length&&7!==t.length?t.startsWith("rgb(")&&(t=t.substring(0,t.length-1)+r):t+=4===t.length?Math.round(255*r).toString(16).substr(0,1):Math.round(255*r).toString(16));const i={type:"line",data:{datasets:[{data:e,backgroundColor:t,borderColor:this._style.getPropertyValue("--internal-or-attribute-history-graph-line-color"),pointBorderColor:this._style.getPropertyValue("--internal-or-attribute-history-graph-point-border-color"),pointBackgroundColor:this._style.getPropertyValue("--internal-or-attribute-history-graph-point-color"),pointRadius:Number(this._style.getPropertyValue("--internal-or-attribute-history-graph-point-radius")),pointBorderWidth:Number(this._style.getPropertyValue("--internal-or-attribute-history-graph-point-border-width")),pointHoverBackgroundColor:this._style.getPropertyValue("--internal-or-attribute-history-graph-point-hover-color"),pointHoverBorderColor:this._style.getPropertyValue("--internal-or-attribute-history-graph-point-hover-border-color"),pointHoverRadius:Number(this._style.getPropertyValue("--internal-or-attribute-history-graph-point-hover-radius")),pointHoverBorderWidth:Number(this._style.getPropertyValue("--internal-or-attribute-history-graph-point-hover-border-width")),pointHitRadius:Number(this._style.getPropertyValue("--internal-or-attribute-history-graph-point-hit-radius")),fill:!1}]},options:{responsive:!0,maintainAspectRatio:!1,onResize:()=>this.dispatchEvent(new OrAttributeHistoryEvent("resize")),plugins:{legend:{display:!1},tooltip:{displayColors:!1,xPadding:10,yPadding:10,titleMarginBottom:10}},scales:{y:{beginAtZero:!0,grid:{color:"#cccccc"}},x:{type:"time",min:this._startOfPeriod,max:this._endOfPeriod,time:{tooltipFormat:"MMM D, YYYY, HH:mm:ss",displayFormats:{millisecond:"HH:mm:ss.SSS",second:"HH:mm:ss",minute:"HH:mm",hour:"HH:mm",week:"w"},unit:this._timeUnits,stepSize:this._stepSize},ticks:{color:"#000",font:{family:"'Open Sans', Helvetica, Arial, Lucida, sans-serif",size:9,style:"normal"}},gridLines:{color:"#cccccc"}}}}};this._chart=new Chart(this._chartElem.getContext("2d"),i)}}this.onCompleted().then((()=>{this.dispatchEvent(new OrAttributeHistoryEvent("rendered"))}))}}onCompleted(){return __awaiter(this,void 0,void 0,(function*(){yield this.updateComplete}))}_cleanup(){this._tableTemplate=void 0,this._chart&&(this._chart.destroy(),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,r=this.attribute?this.attribute.type:void 0;if(!(this._data&&t&&e&&r))return html``;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]||r&&this.config.table.assetTypes[t].attributeValueTypes&&this.config.table.assetTypes[t].attributeValueTypes[r])?i=this.config.table.assetTypes[t].attributeNames&&this.config.table.assetTypes[t].attributeNames[e]||this.config.table.assetTypes[t].attributeValueTypes[r]:this.config.table.attributeNames&&this.config.table.attributeNames[e]?i=this.config.table.attributeNames[e]:r&&this.config.table.attributeValueTypes&&this.config.table.attributeValueTypes[r]?i=this.config.table.attributeValueTypes[r]: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?html`
133
+ <div id="table" class="mdc-data-table">
134
+ <table style="${i.styles?styleMap(i.styles):""}" class="mdc-data-table__table" aria-label="${e+" history"}">
135
+ <thead>
136
+ <tr class="mdc-data-table__header-row">
137
+ ${i.columns.map((t=>html`<th style="${t.headerStyles?styleMap(t.headerStyles):""}" class="mdc-data-table__header-cell ${t.numeric?"mdc-data-table__header-cell--numeric":""}" role="columnheader" scope="col"><or-translate value="${t.header}"></or-translate></th>`))}
138
+ </tr>
139
+ </thead>
140
+ <tbody class="mdc-data-table__content">
141
+ ${this._data.map((t=>html`
142
+ <tr class="mdc-data-table__row">
143
+ ${i.columns.map((e=>{const r=this._getCellValue(t,e,i.timestampFormat);return html`<td style="${e.styles?styleMap(e.styles):""}" class="mdc-data-table__cell ${e.numeric?"mdc-data-table__cell--numeric":""}" title="${r}">${r}</td>`}))}
144
+ </tr>
145
+ `))}
146
+ </tbody>
147
+ </table>
148
+ </div>
149
+ `:(console.warn("OrAttributeHistory: No columns configured so nothing to show"),html``)}_getCellValue(t,e,r){switch(e.type){case"timestamp":const i=moment(t.x).format(r||OrAttributeHistory_1.DEFAULT_TIMESTAMP_FORMAT);if(e&&e.contentProvider){const r=e.contentProvider(t,i,e);if(r)return r}return i;case"prop":let o=t.y;if(e.path&&(o=JSONPath({path:e.path,json:t.y,wrap:!1}),Array.isArray(o)&&1===o.length&&(o=o[0])),e&&e.contentProvider){const r=e.contentProvider(t,o,e);if(r)return r}return e.stringify?JSON.stringify(o):o}}_getIntervalOptions(){return["HOUR","DAY","WEEK","MONTH","YEAR"].map((t=>[t,i18next.t(t.toLowerCase())]))}_getPeriodOptions(){return["HOUR".toLowerCase(),"DAY".toLowerCase(),"WEEK".toLowerCase(),"MONTH".toLowerCase(),"YEAR".toLowerCase()]}_loadData(){return __awaiter(this,void 0,void 0,(function*(){if(this._loading||this._data||!this.assetType||!this.assetId||!this.attribute&&!this.attributeRef||!this.period||!this.toTimestamp)return;this._loading=!0;const t=this.assetId,e=this.attribute?this.attribute.name:this.attributeRef.name;if(!this._type){let r=this.attribute;if(!r){const i=yield manager.rest.api.AssetResource.queryAssets({ids:[t],select:{attributes:[e]}});200===i.status&&i.data.length>0&&(r=i.data[0].attributes?i.data[0].attributes[e]:void 0)}r&&(this._type=AssetModelUtil.getValueDescriptor(r.type)||{})}if(!this._type||!this._type.name)return void(this._loading=!1);let r="HOUR",i=1;switch(this.period){case"hour":r="MINUTE",i=5;break;case"day":r="HOUR",i=1;break;case"week":r="HOUR",i=6;break;case"month":r="DAY",i=1;break;case"year":r="MONTH",i=1}const o=r.toLowerCase();let a;this._startOfPeriod=moment(this.toTimestamp).subtract(1,this.period).startOf(o).add(1,o).toDate().getTime(),this._endOfPeriod=moment(this.toTimestamp).startOf(o).add(1,o).toDate().getTime(),this._timeUnits=o,this._stepSize=i,a=!this._type||"number"!==this._type.jsonType&&"boolean"!==this._type.jsonType?yield manager.rest.api.AssetDatapointResource.getDatapoints(t,e,{type:"all",fromTimestamp:this._startOfPeriod,toTimestamp:this._endOfPeriod}):yield manager.rest.api.AssetDatapointResource.getDatapoints(t,e,{type:"lttb",fromTimestamp:this._startOfPeriod,toTimestamp:this._endOfPeriod,amountOfPoints:100}),this._loading=!1,200===a.status&&(this._data=a.data.filter((t=>null!==t.y&&void 0!==t.y)),this._dataFirstLoaded=!0)}))}_updateTimestamp(t,e,r=300){this._updateTimestampTimer&&(window.clearTimeout(this._updateTimestampTimer),this._updateTimestampTimer=void 0),this._updateTimestampTimer=window.setTimeout((()=>{const r=moment(t);void 0!==e&&r.add(e?1:-1,this.period),this.toTimestamp=r.toDate()}),r)}};OrAttributeHistory.DEFAULT_TIMESTAMP_FORMAT="L HH:mm:ss",__decorate([property({type:String})],OrAttributeHistory.prototype,"assetType",void 0),__decorate([property({type:String})],OrAttributeHistory.prototype,"assetId",void 0),__decorate([property({type:Object})],OrAttributeHistory.prototype,"attribute",void 0),__decorate([property({type:Object})],OrAttributeHistory.prototype,"attributeRef",void 0),__decorate([property({type:String})],OrAttributeHistory.prototype,"period",void 0),__decorate([property({type:Number})],OrAttributeHistory.prototype,"toTimestamp",void 0),__decorate([property({type:Object})],OrAttributeHistory.prototype,"config",void 0),__decorate([property()],OrAttributeHistory.prototype,"_loading",void 0),__decorate([property()],OrAttributeHistory.prototype,"_data",void 0),__decorate([property()],OrAttributeHistory.prototype,"_tableTemplate",void 0),__decorate([query("#chart")],OrAttributeHistory.prototype,"_chartElem",void 0),__decorate([query("#table")],OrAttributeHistory.prototype,"_tableElem",void 0),OrAttributeHistory=OrAttributeHistory_1=__decorate([customElement("or-attribute-history")],OrAttributeHistory);export{OrAttributeHistory};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAGA,OAAO,EACH,GAAG,EACH,IAAI,EACJ,UAAU,EAGV,SAAS,EACZ,MAAM,KAAK,CAAC;AACb,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACjE,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAC,cAAc,EAA8E,MAAM,mBAAmB,CAAC;AAC9H,OAAO,OAAO,EAAE,EAAC,aAAa,EAAE,aAAa,EAAE,aAAa,EAAgB,MAAM,kBAAkB,CAAC;AACrG,OAAO,4CAA4C,CAAC;AACpD,OAAO,oCAAoC,CAAC;AAC5C,OAAO,0BAA0B,CAAC;AAClC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,EAAC,KAAK,EAAmE,MAAM,UAAU,CAAC;AACjG,OAAO,wBAAwB,CAAC;AAChC,OAAO,EAAC,SAAS,EAAsB,MAAM,4CAA4C,CAAC;AAE1F,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AACvC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,MAAM,OAAO,uBAAwB,SAAQ,WAA0C;IAInF,YAAY,KAAW,EAAE,aAAmB;QACxC,KAAK,CAAC,uBAAuB,CAAC,IAAI,EAAE;YACh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AgB;AAU/C;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;qDACC;AAGnB;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;mDACD;AAGjB;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;qDACS;AAG3B;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;wDACU;AAG5B;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;kDACqB;AAGvC;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;uDACC;AAGnB;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;kDACK;AAGpB;IADT,QAAQ,EAAE;oDACyB;AAG1B;IADT,QAAQ,EAAE;iDAC6B;AAG9B;IADT,QAAQ,EAAE;0DAC+B;AAGhC;IADT,KAAK,CAAC,QAAQ,CAAC;sDACyB;AAE/B;IADT,KAAK,CAAC,QAAQ,CAAC;sDACsB;AA5C7B,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CAoiB9B"}
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@openremote/or-attribute-history",
3
+ "version": "1.2.0-snapshot.20240512154942",
4
+ "description": "OpenRemote attribute history",
5
+ "main": "dist/umd/index.bundle.js",
6
+ "module": "lib/index.js",
7
+ "exports": {
8
+ ".": "./lib/index.js",
9
+ "./*": "./lib/*.js"
10
+ },
11
+ "types": "lib/index.d.ts",
12
+ "scripts": {
13
+ "test": "echo \"No tests\" && exit 0",
14
+ "prepublishOnly": "npx webpack"
15
+ },
16
+ "author": "OpenRemote",
17
+ "license": "AGPL-3.0-or-later",
18
+ "dependencies": {
19
+ "@material/data-table": "^9.0.0",
20
+ "@openremote/core": "1.2.0-snapshot.20240512154942",
21
+ "@openremote/or-chart": "1.2.0-snapshot.20240512154942",
22
+ "@openremote/or-components": "1.2.0-snapshot.20240512154942",
23
+ "@openremote/or-mwc-components": "1.2.0-snapshot.20240512154942",
24
+ "@openremote/or-translate": "1.2.0-snapshot.20240512154942",
25
+ "jsonpath-plus": "^6.0.1",
26
+ "lit": "^2.0.2"
27
+ },
28
+ "devDependencies": {
29
+ "@openremote/util": "1.2.0-snapshot.20240512154942",
30
+ "@types/chart.js": "^2.9.34"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ }
35
+ }