@datapos/datapos-shared 0.3.92 → 0.3.94

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.
@@ -1,61 +1,76 @@
1
- const x = 0, w = (e) => e, D = () => Date.now();
2
- class u extends Error {
1
+ const R = 0, F = (e) => e, L = () => Date.now(), k = {
2
+ cartesian_area: { categoryId: "cartesian", typeId: "area", label: { "en-gb": "Area" }, options: { highchartsType: "area" } },
3
+ cartesian_bar: { categoryId: "cartesian", typeId: "bar", label: { "en-gb": "Bar" }, options: { highchartsType: "bar" } },
4
+ cartesian_column: { categoryId: "cartesian", typeId: "column", label: { "en-gb": "Column" }, options: { highchartsType: "column" } },
5
+ cartesian_line: { categoryId: "cartesian", typeId: "line", label: { "en-gb": "Line" }, options: { highchartsType: "line" } },
6
+ chordDiagram: { categoryId: "chordDiagram", label: { "en-gb": "Chord Diagram" }, options: {} },
7
+ polar_area: { categoryId: "polar", typeId: "area", label: { "en-gb": "Radar (Area)" }, options: { highchartsType: "area" } },
8
+ polar_column: { categoryId: "polar", typeId: "column", label: { "en-gb": "Radar (Column)" }, options: { highchartsType: "column" } },
9
+ polar_line: { categoryId: "polar", typeId: "line", label: { "en-gb": "Radar (Line)" }, options: { highchartsType: "line" } },
10
+ range_area: { categoryId: "range", typeId: "area", label: { "en-gb": "Range (Area)" }, options: { highchartsType: "arearange" } },
11
+ range_bar: { categoryId: "range", typeId: "bar", label: { "en-gb": "Range (Bar)" }, options: { highchartsType: "columnrange", inverted: !0 } },
12
+ range_column: { categoryId: "range", typeId: "column", label: { "en-gb": "Range (Column)" }, options: { highchartsType: "columnrange" } },
13
+ sankeyDiagram: { categoryId: "sankeyDiagram", label: { "en-gb": "Sankey Diagram" }, options: {} },
14
+ streamgraph: { categoryId: "streamgraph", label: { "en-gb": "Streamgraph" }, options: {} },
15
+ values: { categoryId: "values", label: { "en-gb": "Values" }, options: {} }
16
+ };
17
+ class I extends Error {
3
18
  locator;
4
- constructor(t, n, r) {
5
- super(t, r), this.name = "DataPosError", this.locator = n, Error.captureStackTrace?.(this, new.target);
19
+ constructor(t, a, r) {
20
+ super(t, r), this.name = "DataPosError", this.locator = a, Error.captureStackTrace?.(this, new.target);
6
21
  }
7
22
  }
8
- class l extends u {
9
- constructor(t, n, r) {
10
- super(t, n, r), this.name = "ApplicationError";
23
+ class m extends I {
24
+ constructor(t, a, r) {
25
+ super(t, a, r), this.name = "ApplicationError";
11
26
  }
12
27
  }
13
- class N extends l {
14
- constructor(t, n, r) {
15
- super(t, n, r), this.name = "APIError";
28
+ class O extends m {
29
+ constructor(t, a, r) {
30
+ super(t, a, r), this.name = "APIError";
16
31
  }
17
32
  }
18
- class S extends l {
19
- constructor(t, n, r) {
20
- super(t, n, r), this.name = "EngineError";
33
+ class _ extends m {
34
+ constructor(t, a, r) {
35
+ super(t, a, r), this.name = "EngineError";
21
36
  }
22
37
  }
23
- class m extends l {
38
+ class D extends m {
24
39
  body;
25
- constructor(t, n, r, a) {
26
- super(t, n, a), this.name = "FetchError", this.body = r;
40
+ constructor(t, a, r, o) {
41
+ super(t, a, o), this.name = "FetchError", this.body = r;
27
42
  }
28
43
  }
29
- class g extends l {
44
+ class v extends m {
30
45
  componentName;
31
46
  info;
32
- constructor(t, n, r, a, s) {
33
- super(t, n, s), this.name = "VueHandledError", this.info = r, this.componentName = a;
47
+ constructor(t, a, r, o, n) {
48
+ super(t, a, n), this.name = "VueHandledError", this.info = r, this.componentName = o;
34
49
  }
35
50
  }
36
- class y extends l {
37
- constructor(t, n, r) {
38
- super(t, n, r), this.name = "WindowHandledRuntimeError";
51
+ class M extends m {
52
+ constructor(t, a, r) {
53
+ super(t, a, r), this.name = "WindowHandledRuntimeError";
39
54
  }
40
55
  }
41
- class $ extends l {
42
- constructor(t, n, r) {
43
- super(t, n, r), this.name = "WindowHandledPromiseRejectionError";
56
+ class U extends m {
57
+ constructor(t, a, r) {
58
+ super(t, a, r), this.name = "WindowHandledPromiseRejectionError";
44
59
  }
45
60
  }
46
- class v extends u {
47
- constructor(t, n, r) {
48
- super(t, n, r), this.name = "OperationalError";
61
+ class B extends I {
62
+ constructor(t, a, r) {
63
+ super(t, a, r), this.name = "OperationalError";
49
64
  }
50
65
  }
51
- async function T(e, t, n) {
52
- const r = `${t} Response status '${e.status}${e.statusText ? ` - ${e.statusText}` : ""}' received.`, a = await e.text();
53
- return new m(r, n, a);
66
+ async function j(e, t, a) {
67
+ const r = `${t} Response status '${e.status}${e.statusText ? ` - ${e.statusText}` : ""}' received.`, o = await e.text();
68
+ return new D(r, a, o);
54
69
  }
55
- function F(e) {
70
+ function H(e) {
56
71
  return e.map((t) => t.message).join(" ");
57
72
  }
58
- function I(e, t = "Unknown error.") {
73
+ function W(e, t = "Unknown error.") {
59
74
  if (e instanceof Error) return e;
60
75
  if (typeof e == "string") return new Error(e);
61
76
  try {
@@ -64,27 +79,103 @@ function I(e, t = "Unknown error.") {
64
79
  return new Error(t);
65
80
  }
66
81
  }
67
- function A(e) {
68
- const t = /* @__PURE__ */ new Set(), n = [];
82
+ function z(e) {
83
+ const t = /* @__PURE__ */ new Set(), a = [];
69
84
  let r = e;
70
85
  for (; r && !t.has(r); ) {
71
86
  t.add(r);
72
- let a;
73
- if (r instanceof m)
74
- a = { body: r.body, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
75
- else if (r instanceof g)
76
- a = { componentName: r.componentName, info: r.info, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
77
- else if (r instanceof u)
78
- a = { locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
87
+ let o;
88
+ if (r instanceof D)
89
+ o = { body: r.body, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
90
+ else if (r instanceof v)
91
+ o = { componentName: r.componentName, info: r.info, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
92
+ else if (r instanceof I)
93
+ o = { locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
79
94
  else if (r instanceof Error) {
80
- const s = r;
81
- a = { locator: "", message: s.message, name: s.name, stack: s.stack }, r = s.cause;
82
- } else r ? (a = { locator: "", message: String(r), name: "Error" }, r = void 0) : (a = { locator: "", message: "Unknown error.", name: "Error" }, r = void 0);
83
- /(?:\.{3}|[.!?])$/.test(a.message) || (a.message += "."), n.push(a);
95
+ const n = r;
96
+ o = { locator: "", message: n.message, name: n.name, stack: n.stack }, r = n.cause;
97
+ } else r ? (o = { locator: "", message: String(r), name: "Error" }, r = void 0) : (o = { locator: "", message: "Unknown error.", name: "Error" }, r = void 0);
98
+ /(?:\.{3}|[.!?])$/.test(o.message) || (o.message += "."), a.push(o);
99
+ }
100
+ return a;
101
+ }
102
+ function V() {
103
+ function e(t, a, r) {
104
+ r.textContent = "Cytoscape.js diagram goes here...";
105
+ }
106
+ return { render: e };
107
+ }
108
+ function X() {
109
+ function e(t, a, r) {
110
+ r.textContent = "values table goes here...";
111
+ }
112
+ return { render: e };
113
+ }
114
+ const S = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", x = "highcharts";
115
+ let b, w = !1;
116
+ function G() {
117
+ async function e(n, s, u, g, p) {
118
+ await r();
119
+ const l = [];
120
+ for (const E of s.data.measures)
121
+ l.push({ type: n.options.highchartsType, name: E.name, data: u });
122
+ const h = {
123
+ chart: { type: n.options.highchartsType },
124
+ plotOptions: { series: { borderColor: "#333" } },
125
+ series: l,
126
+ title: { text: s.title.text },
127
+ xAxis: { categories: s.data.categoryLabels },
128
+ yAxis: { title: { text: s.data.name } }
129
+ }, c = b.chart(g, h, p);
130
+ return { chart: c, resize: () => c.reflow(), vendorId: x };
131
+ }
132
+ async function t(n, s, u, g, p) {
133
+ await Promise.all([r(), o()]);
134
+ const l = [];
135
+ for (const E of s.data.measures)
136
+ l.push({ type: n.options.highchartsType, name: E.name, data: u });
137
+ const h = {
138
+ chart: { polar: !0 },
139
+ plotOptions: { series: { borderColor: "#333" } },
140
+ series: l,
141
+ title: { text: s.title.text },
142
+ xAxis: { categories: s.data.categoryLabels },
143
+ yAxis: { title: { text: s.data.name } }
144
+ }, c = b.chart(g, h, p);
145
+ return { chart: c, resize: () => c.reflow(), vendorId: x };
146
+ }
147
+ async function a(n, s, u, g, p) {
148
+ await Promise.all([r(), o()]);
149
+ const l = [];
150
+ l.push({ type: n.options.highchartsType, name: "Unknown", data: u });
151
+ const h = {
152
+ chart: { type: n.options.highchartsType, inverted: n.options.inverted },
153
+ plotOptions: { series: { borderColor: "#333" } },
154
+ series: l,
155
+ title: { text: s.title.text },
156
+ xAxis: { categories: s.data.categoryLabels },
157
+ yAxis: { title: { text: s.data.name } }
158
+ }, c = b.chart(g, h, p);
159
+ return { chart: c, resize: () => c.reflow(), vendorId: x };
160
+ }
161
+ async function r() {
162
+ if (b) return;
163
+ const n = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", s = `${n}highcharts.src.js`, u = `${n}modules/accessibility.src.js`;
164
+ b = (await import(
165
+ /* @vite-ignore */
166
+ s
167
+ )).default, await import(
168
+ /* @vite-ignore */
169
+ u
170
+ );
171
+ }
172
+ async function o() {
173
+ if (w) return;
174
+ await import(`${S}highcharts-more.src.js`), w = !0;
84
175
  }
85
- return n;
176
+ return { renderCartesianChart: e, renderPolarChart: t, renderRangeChart: a };
86
177
  }
87
- const f = "en-US", c = {}, k = (e) => {
178
+ const T = "en-US", f = {}, P = (e) => {
88
179
  switch (e) {
89
180
  case "Edm.Binary":
90
181
  return "unknown";
@@ -123,32 +214,32 @@ const f = "en-US", c = {}, k = (e) => {
123
214
  default:
124
215
  return "unknown";
125
216
  }
126
- }, O = (e) => {
217
+ }, J = (e) => {
127
218
  if (e) {
128
- const t = e.lastIndexOf("/"), n = e.lastIndexOf(".", t > -1 ? t : e.length);
129
- return n > -1 ? e.substring(0, n) : e;
219
+ const t = e.lastIndexOf("/"), a = e.lastIndexOf(".", t > -1 ? t : e.length);
220
+ return a > -1 ? e.substring(0, a) : e;
130
221
  }
131
- }, B = (e) => {
222
+ }, K = (e) => {
132
223
  if (e) {
133
224
  const t = e.lastIndexOf(".");
134
225
  if (t > -1) return e.substring(t + 1);
135
226
  }
136
- }, o = (e, t = 2, n = t, r = f) => {
227
+ }, i = (e, t = 2, a = t, r = T) => {
137
228
  if (e == null) return "";
138
- const a = `${r}decimal${t}.${n}`;
139
- let s = c[a];
140
- return s || (s = new Intl.NumberFormat(r, {
229
+ const o = `${r}decimal${t}.${a}`;
230
+ let n = f[o];
231
+ return n || (n = new Intl.NumberFormat(r, {
141
232
  localeMatcher: "best fit",
142
233
  maximumFractionDigits: t,
143
- minimumFractionDigits: n,
234
+ minimumFractionDigits: a,
144
235
  minimumIntegerDigits: 1,
145
236
  style: "decimal",
146
237
  useGrouping: !0
147
- }), c[a] = s), s.format(e);
148
- }, C = (e) => e == null ? "" : e < 1e3 ? d(e) : e < 1e6 ? `${o(e / 1e3, 2, 0)}K` : e < 1e9 ? `${o(e / 1e6, 2, 0)}M` : e < 1e12 ? `${o(e / 1e9, 2, 0)}B` : `${o(e / 1e12, 2, 0)}T`, M = (e) => e == null ? "" : e === 1 ? "1 byte" : e < 1024 ? `${d(e)} bytes` : e < 1048576 ? `${o(e / 1024, 2, 0)} KB` : e < 1073741824 ? `${o(e / 1048576, 2, 0)} MB` : e < 1099511627776 ? `${o(e / 1073741824, 2, 0)} GB` : `${o(e / 1099511627776, 2, 0)} TB`, R = (e) => e == null ? "" : e < 1e3 ? `${d(e)} ms` : e === 1e3 ? `${d(e)} sec` : e < 6e4 ? `${o(e / 1e3, 2, 0)} secs` : e === 6e4 ? "1 min" : e < 36e5 ? `${o(e / 6e4, 2, 0)} mins` : e === 36e5 ? "1 hr" : e < 864e5 ? `${o(e / 36e5, 2, 0)} hrs` : e === 864e5 ? "1 day" : `${o(e / 864e5, 2, 0)} days`, d = (e, t = f) => {
238
+ }), f[o] = n), n.format(e);
239
+ }, q = (e) => e == null ? "" : e < 1e3 ? y(e) : e < 1e6 ? `${i(e / 1e3, 2, 0)}K` : e < 1e9 ? `${i(e / 1e6, 2, 0)}M` : e < 1e12 ? `${i(e / 1e9, 2, 0)}B` : `${i(e / 1e12, 2, 0)}T`, Q = (e) => e == null ? "" : e === 1 ? "1 byte" : e < 1024 ? `${y(e)} bytes` : e < 1048576 ? `${i(e / 1024, 2, 0)} KB` : e < 1073741824 ? `${i(e / 1048576, 2, 0)} MB` : e < 1099511627776 ? `${i(e / 1073741824, 2, 0)} GB` : `${i(e / 1099511627776, 2, 0)} TB`, Y = (e) => e == null ? "" : e < 1e3 ? `${y(e)} ms` : e === 1e3 ? `${y(e)} sec` : e < 6e4 ? `${i(e / 1e3, 2, 0)} secs` : e === 6e4 ? "1 min" : e < 36e5 ? `${i(e / 6e4, 2, 0)} mins` : e === 36e5 ? "1 hr" : e < 864e5 ? `${i(e / 36e5, 2, 0)} hrs` : e === 864e5 ? "1 day" : `${i(e / 864e5, 2, 0)} days`, y = (e, t = T) => {
149
240
  if (e == null) return "";
150
- const n = `${t}decimal0.0`;
151
- let r = c[n];
241
+ const a = `${t}decimal0.0`;
242
+ let r = f[a];
152
243
  return r || (r = new Intl.NumberFormat(t, {
153
244
  localeMatcher: "best fit",
154
245
  maximumFractionDigits: 0,
@@ -156,8 +247,8 @@ const f = "en-US", c = {}, k = (e) => {
156
247
  minimumIntegerDigits: 1,
157
248
  style: "decimal",
158
249
  useGrouping: !0
159
- }), c[n] = r), r.format(e);
160
- }, L = (e) => {
250
+ }), f[a] = r), r.format(e);
251
+ }, Z = (e) => {
161
252
  switch (e) {
162
253
  case "csv":
163
254
  return "text/csv";
@@ -171,7 +262,7 @@ const f = "en-US", c = {}, k = (e) => {
171
262
  default:
172
263
  return "application/octet-stream";
173
264
  }
174
- }, b = [
265
+ }, A = [
175
266
  { id: "dtv", label: { "en-gb": "Delimited Text" } },
176
267
  { id: "e/e", label: { "en-gb": "Entity/Event" } },
177
268
  { id: "jsonArray", label: { "en-gb": "JSON Array" } },
@@ -179,22 +270,22 @@ const f = "en-US", c = {}, k = (e) => {
179
270
  { id: "xls", label: { "en-gb": "XLS" } },
180
271
  { id: "xlsx", label: { "en-gb": "XLSX" } },
181
272
  { id: "xml", label: { "en-gb": "XML" } }
182
- ], U = (e = i) => {
273
+ ], ee = (e = d) => {
183
274
  const t = [];
184
- for (const n of b) t.push({ ...n, label: n.label[e] || n.label[i] || n.id });
275
+ for (const a of A) t.push({ ...a, label: a.label[e] || a.label[d] || a.id });
185
276
  return t;
186
- }, p = [
277
+ }, N = [
187
278
  { id: `
188
279
  `, label: { "en-gb": "Newline" } },
189
280
  { id: "\r", label: { "en-gb": "Carriage Return" } },
190
281
  { id: `\r
191
282
  `, label: { "en-gb": "Carriage Return/Newline" } }
192
- ], W = (e = i) => {
283
+ ], re = (e = d) => {
193
284
  const t = [];
194
- for (const n of p)
195
- t.push({ ...n, label: n.label[e] || n.label[i] || n.id });
285
+ for (const a of N)
286
+ t.push({ ...a, label: a.label[e] || a.label[d] || a.id });
196
287
  return t;
197
- }, E = [
288
+ }, $ = [
198
289
  { id: ":", label: { "en-gb": "Colon" } },
199
290
  { id: ",", label: { "en-gb": "Comma" } },
200
291
  { id: "!", label: { "en-gb": "Exclamation Mark" } },
@@ -206,12 +297,12 @@ const f = "en-US", c = {}, k = (e) => {
206
297
  { id: "_", label: { "en-gb": "Underscore" } },
207
298
  { id: "0x1F", label: { "en-gb": "Unit Separator" } },
208
299
  { id: "|", label: { "en-gb": "Vertical Bar" } }
209
- ], j = (e = i) => {
300
+ ], te = (e = d) => {
210
301
  const t = [];
211
- for (const n of E)
212
- t.push({ ...n, label: n.label[e] || n.label[i] || n.id });
302
+ for (const a of $)
303
+ t.push({ ...a, label: a.label[e] || a.label[d] || a.id });
213
304
  return t;
214
- }, h = [
305
+ }, C = [
215
306
  { id: "alpha", color: "red", label: { "en-gb": "alpha" } },
216
307
  { id: "beta", color: "amber", label: { "en-gb": "beta" } },
217
308
  { id: "generalAvailability", color: "green", label: { "en-gb": "" } },
@@ -221,38 +312,42 @@ const f = "en-US", c = {}, k = (e) => {
221
312
  { id: "releaseCandidate", color: "green", label: { "en-gb": "release-candidate" } },
222
313
  { id: "unavailable", color: "other", label: { "en-gb": "unavailable" } },
223
314
  { id: "underReview", color: "other", label: { "en-gb": "under-review" } }
224
- ], G = (e, t = i) => {
225
- const n = h.find((r) => r.id === e);
226
- return n ? { ...n, label: n.label[t] || n.label[i] || e } : { id: e, color: "other", label: e };
227
- }, i = "en-gb";
315
+ ], ae = (e, t = d) => {
316
+ const a = C.find((r) => r.id === e);
317
+ return a ? { ...a, label: a.label[t] || a.label[d] || e } : { id: e, color: "other", label: e };
318
+ }, d = "en-gb";
228
319
  export {
229
- N as APIError,
230
- l as ApplicationError,
231
- i as DEFAULT_LOCALE_CODE,
232
- x as DefaultTimestamp,
233
- S as EngineError,
234
- m as FetchError,
235
- v as OperationalError,
236
- g as VueError,
237
- $ as WindowPromiseRejectionError,
238
- y as WindowRuntimeError,
239
- T as buildFetchError,
240
- F as concatenateSerialisedErrorMessages,
241
- w as convertMillisecondsToTimestamp,
242
- k as convertODataTypeIdToUsageTypeId,
243
- B as extractExtensionFromPath,
244
- O as extractNameFromPath,
245
- o as formatNumberAsDecimalNumber,
246
- R as formatNumberAsDuration,
247
- C as formatNumberAsSize,
248
- M as formatNumberAsStorageSize,
249
- d as formatNumberAsWholeNumber,
250
- G as getComponentStatus,
251
- D as getCurrentTimestamp,
252
- U as getDataFormats,
253
- W as getRecordDelimiters,
254
- j as getValueDelimiters,
255
- L as lookupMimeTypeForExtension,
256
- I as normalizeToError,
257
- A as serialiseError
320
+ O as APIError,
321
+ m as ApplicationError,
322
+ d as DEFAULT_LOCALE_CODE,
323
+ R as DefaultTimestamp,
324
+ _ as EngineError,
325
+ D as FetchError,
326
+ B as OperationalError,
327
+ v as VueError,
328
+ U as WindowPromiseRejectionError,
329
+ M as WindowRuntimeError,
330
+ j as buildFetchError,
331
+ H as concatenateSerialisedErrorMessages,
332
+ F as convertMillisecondsToTimestamp,
333
+ P as convertODataTypeIdToUsageTypeId,
334
+ K as extractExtensionFromPath,
335
+ J as extractNameFromPath,
336
+ i as formatNumberAsDecimalNumber,
337
+ Y as formatNumberAsDuration,
338
+ q as formatNumberAsSize,
339
+ Q as formatNumberAsStorageSize,
340
+ y as formatNumberAsWholeNumber,
341
+ ae as getComponentStatus,
342
+ L as getCurrentTimestamp,
343
+ ee as getDataFormats,
344
+ re as getRecordDelimiters,
345
+ te as getValueDelimiters,
346
+ Z as lookupMimeTypeForExtension,
347
+ W as normalizeToError,
348
+ k as presentationViewTypeMap,
349
+ z as serialiseError,
350
+ V as useCytoscapeJS,
351
+ X as useDataTable,
352
+ G as useHighcharts
258
353
  };
@@ -0,0 +1,7 @@
1
+ import { PresentationView, PresentationVisualContentConfig } from '../index';
2
+ export interface CytoscapeJSView extends PresentationView {
3
+ diagram: unknown;
4
+ }
5
+ export declare function useCytoscapeJS(): {
6
+ render: (viewType: unknown, contentConfig: PresentationVisualContentConfig, element: HTMLElement) => void;
7
+ };
@@ -0,0 +1,4 @@
1
+ import { PresentationVisualContentConfig, PresentationVisualValuesViewType } from '../index';
2
+ export declare function useDataTable(): {
3
+ render: (viewType: PresentationVisualValuesViewType, contentConfig: PresentationVisualContentConfig, element: HTMLElement) => void;
4
+ };
@@ -0,0 +1,10 @@
1
+ import { Chart } from 'highcharts';
2
+ import { PresentationView, PresentationVisualCartesianViewType, PresentationVisualContentConfig, PresentationVisualPolarViewType, PresentationVisualRangeViewType } from '../index';
3
+ export interface HighchartsView extends PresentationView {
4
+ chart: Chart;
5
+ }
6
+ export declare function useHighcharts(): {
7
+ renderCartesianChart: (type: PresentationVisualCartesianViewType, contentConfig: PresentationVisualContentConfig, data: number[][], element: HTMLElement, callback?: () => void) => Promise<HighchartsView>;
8
+ renderPolarChart: (type: PresentationVisualPolarViewType, content: PresentationVisualContentConfig, data: number[][], element: HTMLElement, callback?: () => void) => Promise<HighchartsView>;
9
+ renderRangeChart: (type: PresentationVisualRangeViewType, content: PresentationVisualContentConfig, data: number[][], element: HTMLElement, callback?: () => void) => Promise<HighchartsView>;
10
+ };
@@ -3,6 +3,7 @@ export type LocalisedString = Record<LocaleCode, string>;
3
3
  export type StatusColorId = 'amber' | 'green' | 'red' | 'other';
4
4
  export declare const DEFAULT_LOCALE_CODE: LocaleCode;
5
5
  export { DefaultTimestamp } from './timestamp';
6
+ export { presentationViewTypeMap } from './presenter';
6
7
  export type { ComponentConfig, ComponentRef, ComponentStatus, ComponentStatusId, ComponentTypeId } from './component';
7
8
  export type { AuditContentResult, AuditContentSettings } from './connector';
8
9
  export type { Connector, ConnectorCallbackData, ConnectorConfig, ConnectorImplementation, ConnectorOperationSettings, ConnectorLocalisedConfig, ConnectorTools } from './connector';
@@ -28,12 +29,17 @@ export type { SerialisedError } from './errors';
28
29
  export type { EventQueryConfig, EventQueryLocalisedConfig } from './eventQuery';
29
30
  export type { Presenter, PresenterConfig, PresenterLocalisedConfig, PresenterTools } from './presenter';
30
31
  export type { PresentationConfig, PresentationView } from './presenter';
32
+ export type { PresentationVisualConfig, PresentationVisualContentConfig, PresentationVisualViewConfig, PresentationVisualCartesianViewConfig, PresentationVisualChordDiagramViewConfig, PresentationVisualPolarViewConfig, PresentationVisualRangeViewConfig, PresentationVisualSankeyDiagramViewConfig, PresentationVisualStreamgraphViewConfig, PresentationVisualValuesViewConfig } from './presenter';
33
+ export type { PresentationVisualViewType, PresentationVisualCartesianViewType, PresentationVisualChordViewType, PresentationVisualPolarViewType, PresentationVisualRangeViewType, PresentationVisualSankeyDiagramViewType, PresentationVisualStreamgraphViewType, PresentationVisualValuesViewType } from './presenter';
31
34
  export type { Recipe, RecipeConfig, RecipeLocalisedConfig } from './recipe';
32
35
  export type { ServiceData } from './service';
33
36
  export type { StateConfig } from './state';
34
37
  export type { Timestamp } from './timestamp';
35
38
  export type { TutorialConfig } from './tutorial';
36
39
  export { APIError, ApplicationError, EngineError, FetchError, OperationalError, VueError, WindowRuntimeError, WindowPromiseRejectionError } from './errors';
40
+ export { type CytoscapeJSView, useCytoscapeJS } from './composables/useCytoscapeJS';
41
+ export { useDataTable } from './composables/useDataTable';
42
+ export { type HighchartsView, useHighcharts } from './composables/useHighcharts';
37
43
  export { buildFetchError, concatenateSerialisedErrorMessages, normalizeToError, serialiseError } from './errors';
38
44
  export { convertMillisecondsToTimestamp, getCurrentTimestamp } from './timestamp';
39
45
  export { convertODataTypeIdToUsageTypeId } from './utilities';
@@ -25,3 +25,97 @@ export interface PresentationView {
25
25
  resize: () => void;
26
26
  vendorId: string;
27
27
  }
28
+ export type PresentationVisualConfig = {
29
+ content: PresentationVisualContentConfig;
30
+ views: PresentationVisualViewConfig[];
31
+ };
32
+ export type PresentationVisualContentConfig = {
33
+ title: {
34
+ text: string;
35
+ };
36
+ data: {
37
+ name: string;
38
+ categoryLabels: string[];
39
+ measures: {
40
+ id: string;
41
+ name: string;
42
+ }[];
43
+ };
44
+ };
45
+ export interface PresentationVisualViewConfig {
46
+ categoryId: 'cartesian' | 'chordDiagram' | 'polar' | 'range' | 'sankeyDiagram' | 'streamgraph' | 'values';
47
+ default?: boolean;
48
+ }
49
+ export interface PresentationVisualCartesianViewConfig extends PresentationVisualViewConfig {
50
+ categoryId: 'cartesian';
51
+ typeId: 'area' | 'bar' | 'column' | 'line';
52
+ }
53
+ export interface PresentationVisualChordDiagramViewConfig extends PresentationVisualViewConfig {
54
+ categoryId: 'chordDiagram';
55
+ }
56
+ export interface PresentationVisualPolarViewConfig extends PresentationVisualViewConfig {
57
+ categoryId: 'polar';
58
+ typeId: 'area' | 'column' | 'line';
59
+ }
60
+ export interface PresentationVisualRangeViewConfig extends PresentationVisualViewConfig {
61
+ categoryId: 'range';
62
+ typeId: 'area' | 'bar' | 'column';
63
+ }
64
+ export interface PresentationVisualSankeyDiagramViewConfig extends PresentationVisualViewConfig {
65
+ categoryId: 'sankeyDiagram';
66
+ }
67
+ export interface PresentationVisualStreamgraphViewConfig extends PresentationVisualViewConfig {
68
+ categoryId: 'streamgraph';
69
+ }
70
+ export interface PresentationVisualValuesViewConfig extends PresentationVisualViewConfig {
71
+ categoryId: 'values';
72
+ }
73
+ export type PresentationVisualViewType = PresentationVisualCartesianViewType | PresentationVisualChordViewType | PresentationVisualPolarViewType | PresentationVisualRangeViewType | PresentationVisualSankeyDiagramViewType | PresentationVisualStreamgraphViewType | PresentationVisualValuesViewType;
74
+ export type PresentationVisualCartesianViewType = {
75
+ categoryId: 'cartesian';
76
+ typeId: 'area' | 'bar' | 'column' | 'line';
77
+ label: Record<string, string>;
78
+ options: {
79
+ highchartsType: 'area' | 'bar' | 'column' | 'line';
80
+ inverted?: boolean;
81
+ };
82
+ };
83
+ export type PresentationVisualChordViewType = {
84
+ categoryId: 'chordDiagram';
85
+ label: Record<string, string>;
86
+ options: {};
87
+ };
88
+ export type PresentationVisualPolarViewType = {
89
+ categoryId: 'polar';
90
+ typeId: 'area' | 'column' | 'line';
91
+ label: Record<string, string>;
92
+ options: {
93
+ highchartsType: 'area' | 'column' | 'line';
94
+ inverted?: boolean;
95
+ };
96
+ };
97
+ export type PresentationVisualRangeViewType = {
98
+ categoryId: 'range';
99
+ typeId: 'area' | 'bar' | 'column';
100
+ label: Record<string, string>;
101
+ options: {
102
+ highchartsType: 'arearange' | 'columnrange';
103
+ inverted?: boolean;
104
+ };
105
+ };
106
+ export type PresentationVisualSankeyDiagramViewType = {
107
+ categoryId: 'sankeyDiagram';
108
+ label: Record<string, string>;
109
+ options: {};
110
+ };
111
+ export type PresentationVisualStreamgraphViewType = {
112
+ categoryId: 'streamgraph';
113
+ label: Record<string, string>;
114
+ options: {};
115
+ };
116
+ export type PresentationVisualValuesViewType = {
117
+ categoryId: 'values';
118
+ label: Record<string, string>;
119
+ options: {};
120
+ };
121
+ export declare const presentationViewTypeMap: Record<string, PresentationVisualViewType>;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@datapos/datapos-shared",
3
3
  "license": "MIT",
4
4
  "private": false,
5
- "version": "0.3.92",
5
+ "version": "0.3.94",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"
@@ -25,6 +25,7 @@
25
25
  "date-fns": "^4.1.0",
26
26
  "eslint": "^9.38.0",
27
27
  "eslint-plugin-import": "^2.32.0",
28
+ "highcharts": "^12.4.0",
28
29
  "jiti": "^2.6.1",
29
30
  "license-report": "^6.8.1",
30
31
  "license-report-check": "^0.1.2",