@openremote/or-chart 1.11.0-snapshot.20251103144513 → 1.11.0

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.
@@ -0,0 +1,269 @@
1
+
2
+ import type { OrChartEvent, OrChart } from "./lib/index.d.ts";
3
+
4
+ /**
5
+ * This type can be used to create scoped tags for your components.
6
+ *
7
+ * Usage:
8
+ *
9
+ * ```ts
10
+ * import type { ScopedElements } from "path/to/library/jsx-integration";
11
+ *
12
+ * declare module "my-library" {
13
+ * namespace JSX {
14
+ * interface IntrinsicElements
15
+ * extends ScopedElements<'test-', ''> {}
16
+ * }
17
+ * }
18
+ * ```
19
+ *
20
+ * @deprecated Runtime scoped elements result in duplicate types and can confusing for developers. It is recommended to use the `prefix` and `suffix` options to generate new types instead.
21
+ */
22
+ export type ScopedElements<
23
+ Prefix extends string = "",
24
+ Suffix extends string = ""
25
+ > = {
26
+ [Key in keyof CustomElements as `${Prefix}${Key}${Suffix}`]: CustomElements[Key];
27
+ };
28
+
29
+ type BaseProps<T extends HTMLElement> = {
30
+
31
+ /** Content added between the opening and closing tags of the element */
32
+ children?: any;
33
+ /** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
34
+ class?: string;
35
+ /** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
36
+ className?: string;
37
+ /** Takes an object where the key is the class name(s) and the value is a boolean expression. When true, the class is applied, and when false, it is removed. */
38
+ classList?: Record<string, boolean | undefined>;
39
+ /** Specifies the text direction of the element. */
40
+ dir?: "ltr" | "rtl";
41
+ /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
42
+ exportparts?: string;
43
+ /** For <label> and <output>, lets you associate the label with some control. */
44
+ htmlFor?: string;
45
+ /** Specifies whether the element should be hidden. */
46
+ hidden?: boolean | string;
47
+ /** A unique identifier for the element. */
48
+ id?: string;
49
+ /** Keys tell React which array item each component corresponds to */
50
+ key?: string | number;
51
+ /** Specifies the language of the element. */
52
+ lang?: string;
53
+ /** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
54
+ part?: string;
55
+ /** Use the ref attribute with a variable to assign a DOM element to the variable once the element is rendered. */
56
+ ref?: T | ((e: T) => void);
57
+ /** Adds a reference for a custom element slot */
58
+ slot?: string;
59
+ /** Prop for setting inline styles */
60
+ style?: Record<string, string | number>;
61
+ /** Overrides the default Tab button behavior. Avoid using values other than -1 and 0. */
62
+ tabIndex?: number;
63
+ /** Specifies the tooltip text for the element. */
64
+ title?: string;
65
+ /** Passing 'no' excludes the element content from being translated. */
66
+ translate?: "yes" | "no";
67
+ /** The popover global attribute is used to designate an element as a popover element. */
68
+ popover?: "auto" | "hint" | "manual";
69
+ /** Turns an element element into a popover control button; takes the ID of the popover element to control as its value. */
70
+ popovertarget?: "top" | "bottom" | "left" | "right" | "auto";
71
+ /** Specifies the action to be performed on a popover element being controlled by a control element. */
72
+ popovertargetaction?: "show" | "hide" | "toggle";
73
+
74
+ } ;
75
+
76
+ type BaseEvents = {
77
+
78
+
79
+ };
80
+
81
+
82
+
83
+ export type OrChartProps = {
84
+ /** */
85
+ "assets"?: OrChart['assets'];
86
+ /** */
87
+ "activeAsset"?: OrChart['activeAsset'];
88
+ /** */
89
+ "assetAttributes"?: OrChart['assetAttributes'];
90
+ /** The list of HEX colors representing the line color for each AttributeRef.
91
+ Acts as an override, and will fall back to the colors attribute if not specified.
92
+ The AttributeRef object with Asset ID and Attribute name need to be present in the Chart to work.
93
+ The HEX color should be put in without '#' prefix. For example, you'd use '4d9d2a' instead of '#4d9d2a'. */
94
+ "attributeColors"?: OrChart['attributeColors'];
95
+ /** Chart attribute configuration object, specifying characteristics for each Chart line.
96
+ For example, what AttributeRef is aligned to the right side, or what AttributeRef is using a fill.
97
+ Check for ChartAttributeConfig for specification. This HTML attribute expects JSON string input. */
98
+ "attributeConfig"?: OrChart['attributeConfig'];
99
+ /** */
100
+ "dataProvider"?: OrChart['dataProvider'];
101
+ /** */
102
+ "colors"?: OrChart['colors'];
103
+ /** */
104
+ "datapointQuery"?: OrChart['datapointQuery'];
105
+ /** */
106
+ "config"?: OrChart['config'];
107
+ /** */
108
+ "chartOptions"?: OrChart['chartOptions'];
109
+ /** */
110
+ "realm"?: OrChart['realm'];
111
+ /** */
112
+ "panelName"?: OrChart['panelName'];
113
+ /** */
114
+ "attributeControls"?: OrChart['attributeControls'];
115
+ /** */
116
+ "timeframe"?: OrChart['timeframe'];
117
+ /** */
118
+ "timestampControls"?: OrChart['timestampControls'];
119
+ /** List of 'time prefix' options like 'this' or 'last', for the user to select from.
120
+ In combination with the timeWindowOptions attribute, it becomes a string like 'last 6 hours'. */
121
+ "timePrefixOptions"?: OrChart['timePrefixOptions'];
122
+ /** Selected 'time prefix' of the available timePrefixOptions.
123
+ This string attribute will only accept keys of the timeWindowOptions Array. */
124
+ "timePrefixKey"?: OrChart['timePrefixKey'];
125
+ /** List of timeframe options like '6 hours' for the user to select from.
126
+ In combination with the timePrefixKey attribute, it becomes a string like 'last 6 hours'.
127
+ Expects a JSON string input, that is formatted as an JavaScript Map object.
128
+ The map is identified with a unique key, and a combination of `[duration, length]`.
129
+ For example `['6hours', ['hours', 6]]`. */
130
+ "timeWindowOptions"?: OrChart['timeWindowOptions'];
131
+ /** Selected 'time window' of the available timeWindowOptions.
132
+ This string attribute will only accept keys of the timeWindowOptions Map. */
133
+ "timeWindowKey"?: OrChart['timeWindowKey'];
134
+ /** Boolean attribute to enable/disable stacking the data vertically. (compound line chart)
135
+ On the same axis, it will display a cumulative effect of all data series on top of each other. */
136
+ "stacked"?: OrChart['stacked'];
137
+ /** */
138
+ "showLegend"?: OrChart['showLegend'];
139
+ /** */
140
+ "denseLegend"?: OrChart['denseLegend'];
141
+ /** */
142
+ "showZoomBar"?: OrChart['showZoomBar'];
143
+ /** */
144
+ "_tableTemplate"?: OrChart['_tableTemplate'];
145
+
146
+ /** */
147
+ "onrendered"?: (e: CustomEvent<OrChartEvent>) => void;
148
+ }
149
+
150
+ export type CustomElements = {
151
+
152
+
153
+ /**
154
+ *
155
+ *
156
+ * ## Attributes & Properties
157
+ *
158
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
159
+ *
160
+ * - `assets`: undefined
161
+ * - `activeAsset`: undefined
162
+ * - `assetAttributes`: undefined
163
+ * - `attributeColors`: The list of HEX colors representing the line color for each AttributeRef.
164
+ * Acts as an override, and will fall back to the colors attribute if not specified.
165
+ * The AttributeRef object with Asset ID and Attribute name need to be present in the Chart to work.
166
+ * The HEX color should be put in without '#' prefix. For example, you'd use '4d9d2a' instead of '#4d9d2a'.
167
+ * - `attributeConfig`: Chart attribute configuration object, specifying characteristics for each Chart line.
168
+ * For example, what AttributeRef is aligned to the right side, or what AttributeRef is using a fill.
169
+ * Check for ChartAttributeConfig for specification. This HTML attribute expects JSON string input.
170
+ * - `dataProvider`: undefined
171
+ * - `colors`: undefined
172
+ * - `datapointQuery`: undefined
173
+ * - `config`: undefined
174
+ * - `chartOptions`: undefined
175
+ * - `realm`: undefined
176
+ * - `panelName`: undefined
177
+ * - `attributeControls`: undefined
178
+ * - `timeframe`: undefined
179
+ * - `timestampControls`: undefined
180
+ * - `timePrefixOptions`: List of 'time prefix' options like 'this' or 'last', for the user to select from.
181
+ * In combination with the timeWindowOptions attribute, it becomes a string like 'last 6 hours'.
182
+ * - `timePrefixKey`: Selected 'time prefix' of the available timePrefixOptions.
183
+ * This string attribute will only accept keys of the timeWindowOptions Array.
184
+ * - `timeWindowOptions`: List of timeframe options like '6 hours' for the user to select from.
185
+ * In combination with the timePrefixKey attribute, it becomes a string like 'last 6 hours'.
186
+ * Expects a JSON string input, that is formatted as an JavaScript Map object.
187
+ * The map is identified with a unique key, and a combination of `[duration, length]`.
188
+ * For example `['6hours', ['hours', 6]]`.
189
+ * - `timeWindowKey`: Selected 'time window' of the available timeWindowOptions.
190
+ * This string attribute will only accept keys of the timeWindowOptions Map.
191
+ * - `stacked`: Boolean attribute to enable/disable stacking the data vertically. (compound line chart)
192
+ * On the same axis, it will display a cumulative effect of all data series on top of each other.
193
+ * - `showLegend`: undefined
194
+ * - `denseLegend`: undefined
195
+ * - `showZoomBar`: undefined
196
+ * - `_tableTemplate`: undefined
197
+ *
198
+ * ## Events
199
+ *
200
+ * Events that will be emitted by the component.
201
+ *
202
+ * - `rendered`: undefined
203
+ *
204
+ * ## Methods
205
+ *
206
+ * Methods that can be called to access component functionality.
207
+ *
208
+ * - `applyChartResponsiveness() => void`: undefined
209
+ * - `_addDatasetHighlight(attrRef: AttributeRef, chart = this._chart) => void`: Adds a Chart line color highlight, by reducing/increasing opacity.
210
+ * So the given line (represented by assetId and attrName will be emphasized, while others are less visible.
211
+ * - `loadSettings(reset: boolean) => void`: undefined
212
+ * - `saveSettings() => void`: undefined
213
+ */
214
+ "or-chart": Partial<OrChartProps & BaseProps<OrChart> & BaseEvents>;
215
+ }
216
+
217
+ export type CustomCssProperties = {
218
+
219
+ }
220
+
221
+
222
+ declare module 'react' {
223
+ namespace JSX {
224
+ interface IntrinsicElements extends CustomElements {}
225
+ }
226
+ export interface CSSProperties extends CustomCssProperties {}
227
+ }
228
+
229
+ declare module 'preact' {
230
+ namespace JSX {
231
+ interface IntrinsicElements extends CustomElements {}
232
+ }
233
+ export interface CSSProperties extends CustomCssProperties {}
234
+ }
235
+
236
+ declare module '@builder.io/qwik' {
237
+ namespace JSX {
238
+ interface IntrinsicElements extends CustomElements {}
239
+ }
240
+ export interface CSSProperties extends CustomCssProperties {}
241
+ }
242
+
243
+ declare module '@stencil/core' {
244
+ namespace JSX {
245
+ interface IntrinsicElements extends CustomElements {}
246
+ }
247
+ export interface CSSProperties extends CustomCssProperties {}
248
+ }
249
+
250
+ declare module 'hono/jsx' {
251
+ namespace JSX {
252
+ interface IntrinsicElements extends CustomElements {}
253
+ }
254
+ export interface CSSProperties extends CustomCssProperties {}
255
+ }
256
+
257
+ declare module 'react-native' {
258
+ namespace JSX {
259
+ interface IntrinsicElements extends CustomElements {}
260
+ }
261
+ export interface CSSProperties extends CustomCssProperties {}
262
+ }
263
+
264
+ declare global {
265
+ namespace JSX {
266
+ interface IntrinsicElements extends CustomElements {}
267
+ }
268
+ export interface CSSProperties extends CustomCssProperties {}
269
+ }
@@ -416,6 +416,9 @@
416
416
  "type": {
417
417
  "text": "void"
418
418
  }
419
+ },
420
+ "type": {
421
+ "text": "applyChartResponsiveness() => void"
419
422
  }
420
423
  },
421
424
  {
@@ -460,7 +463,10 @@
460
463
  "description": "ECharts instance to add the highlight to."
461
464
  }
462
465
  ],
463
- "description": "Adds a Chart line color highlight, by reducing/increasing opacity.\nSo the given line (represented by assetId and attrName will be emphasized, while others are less visible."
466
+ "description": "Adds a Chart line color highlight, by reducing/increasing opacity.\nSo the given line (represented by assetId and attrName will be emphasized, while others are less visible.",
467
+ "type": {
468
+ "text": "_addDatasetHighlight(attrRef: AttributeRef, chart = this._chart) => void"
469
+ }
464
470
  },
465
471
  {
466
472
  "kind": "method",
@@ -472,11 +478,17 @@
472
478
  "text": "boolean"
473
479
  }
474
480
  }
475
- ]
481
+ ],
482
+ "type": {
483
+ "text": "loadSettings(reset: boolean) => void"
484
+ }
476
485
  },
477
486
  {
478
487
  "kind": "method",
479
- "name": "saveSettings"
488
+ "name": "saveSettings",
489
+ "type": {
490
+ "text": "saveSettings() => void"
491
+ }
480
492
  },
481
493
  {
482
494
  "kind": "method",
@@ -1013,7 +1025,9 @@
1013
1025
  "package": "lit"
1014
1026
  },
1015
1027
  "tagName": "or-chart",
1016
- "customElement": true
1028
+ "customElement": true,
1029
+ "modulePath": "src/index.ts",
1030
+ "definitionPath": "src/index.ts"
1017
1031
  }
1018
1032
  ],
1019
1033
  "exports": [