@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.
- package/dist/datapos-shared.es.js +203 -108
- package/dist/types/src/composables/useCytoscapeJS.d.ts +7 -0
- package/dist/types/src/composables/useDataTable.d.ts +4 -0
- package/dist/types/src/composables/useHighcharts.d.ts +10 -0
- package/dist/types/src/index.d.ts +6 -0
- package/dist/types/src/presenter.d.ts +94 -0
- package/package.json +2 -1
|
@@ -1,61 +1,76 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
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,
|
|
5
|
-
super(t, r), this.name = "DataPosError", this.locator =
|
|
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
|
|
9
|
-
constructor(t,
|
|
10
|
-
super(t,
|
|
23
|
+
class m extends I {
|
|
24
|
+
constructor(t, a, r) {
|
|
25
|
+
super(t, a, r), this.name = "ApplicationError";
|
|
11
26
|
}
|
|
12
27
|
}
|
|
13
|
-
class
|
|
14
|
-
constructor(t,
|
|
15
|
-
super(t,
|
|
28
|
+
class O extends m {
|
|
29
|
+
constructor(t, a, r) {
|
|
30
|
+
super(t, a, r), this.name = "APIError";
|
|
16
31
|
}
|
|
17
32
|
}
|
|
18
|
-
class
|
|
19
|
-
constructor(t,
|
|
20
|
-
super(t,
|
|
33
|
+
class _ extends m {
|
|
34
|
+
constructor(t, a, r) {
|
|
35
|
+
super(t, a, r), this.name = "EngineError";
|
|
21
36
|
}
|
|
22
37
|
}
|
|
23
|
-
class
|
|
38
|
+
class D extends m {
|
|
24
39
|
body;
|
|
25
|
-
constructor(t,
|
|
26
|
-
super(t,
|
|
40
|
+
constructor(t, a, r, o) {
|
|
41
|
+
super(t, a, o), this.name = "FetchError", this.body = r;
|
|
27
42
|
}
|
|
28
43
|
}
|
|
29
|
-
class
|
|
44
|
+
class v extends m {
|
|
30
45
|
componentName;
|
|
31
46
|
info;
|
|
32
|
-
constructor(t,
|
|
33
|
-
super(t,
|
|
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
|
|
37
|
-
constructor(t,
|
|
38
|
-
super(t,
|
|
51
|
+
class M extends m {
|
|
52
|
+
constructor(t, a, r) {
|
|
53
|
+
super(t, a, r), this.name = "WindowHandledRuntimeError";
|
|
39
54
|
}
|
|
40
55
|
}
|
|
41
|
-
class
|
|
42
|
-
constructor(t,
|
|
43
|
-
super(t,
|
|
56
|
+
class U extends m {
|
|
57
|
+
constructor(t, a, r) {
|
|
58
|
+
super(t, a, r), this.name = "WindowHandledPromiseRejectionError";
|
|
44
59
|
}
|
|
45
60
|
}
|
|
46
|
-
class
|
|
47
|
-
constructor(t,
|
|
48
|
-
super(t,
|
|
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
|
|
52
|
-
const r = `${t} Response status '${e.status}${e.statusText ? ` - ${e.statusText}` : ""}' received.`,
|
|
53
|
-
return new
|
|
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
|
|
70
|
+
function H(e) {
|
|
56
71
|
return e.map((t) => t.message).join(" ");
|
|
57
72
|
}
|
|
58
|
-
function
|
|
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
|
|
68
|
-
const t = /* @__PURE__ */ new Set(),
|
|
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
|
|
73
|
-
if (r instanceof
|
|
74
|
-
|
|
75
|
-
else if (r instanceof
|
|
76
|
-
|
|
77
|
-
else if (r instanceof
|
|
78
|
-
|
|
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
|
|
81
|
-
|
|
82
|
-
} else r ? (
|
|
83
|
-
/(?:\.{3}|[.!?])$/.test(
|
|
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
|
|
176
|
+
return { renderCartesianChart: e, renderPolarChart: t, renderRangeChart: a };
|
|
86
177
|
}
|
|
87
|
-
const
|
|
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
|
-
},
|
|
217
|
+
}, J = (e) => {
|
|
127
218
|
if (e) {
|
|
128
|
-
const t = e.lastIndexOf("/"),
|
|
129
|
-
return
|
|
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
|
-
},
|
|
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
|
-
},
|
|
227
|
+
}, i = (e, t = 2, a = t, r = T) => {
|
|
137
228
|
if (e == null) return "";
|
|
138
|
-
const
|
|
139
|
-
let
|
|
140
|
-
return
|
|
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:
|
|
234
|
+
minimumFractionDigits: a,
|
|
144
235
|
minimumIntegerDigits: 1,
|
|
145
236
|
style: "decimal",
|
|
146
237
|
useGrouping: !0
|
|
147
|
-
}),
|
|
148
|
-
},
|
|
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
|
|
151
|
-
let r =
|
|
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
|
-
}),
|
|
160
|
-
},
|
|
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
|
-
},
|
|
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
|
-
],
|
|
273
|
+
], ee = (e = d) => {
|
|
183
274
|
const t = [];
|
|
184
|
-
for (const
|
|
275
|
+
for (const a of A) t.push({ ...a, label: a.label[e] || a.label[d] || a.id });
|
|
185
276
|
return t;
|
|
186
|
-
},
|
|
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
|
-
],
|
|
283
|
+
], re = (e = d) => {
|
|
193
284
|
const t = [];
|
|
194
|
-
for (const
|
|
195
|
-
t.push({ ...
|
|
285
|
+
for (const a of N)
|
|
286
|
+
t.push({ ...a, label: a.label[e] || a.label[d] || a.id });
|
|
196
287
|
return t;
|
|
197
|
-
},
|
|
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
|
-
],
|
|
300
|
+
], te = (e = d) => {
|
|
210
301
|
const t = [];
|
|
211
|
-
for (const
|
|
212
|
-
t.push({ ...
|
|
302
|
+
for (const a of $)
|
|
303
|
+
t.push({ ...a, label: a.label[e] || a.label[d] || a.id });
|
|
213
304
|
return t;
|
|
214
|
-
},
|
|
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
|
-
],
|
|
225
|
-
const
|
|
226
|
-
return
|
|
227
|
-
},
|
|
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
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
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.
|
|
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",
|