@datapos/datapos-shared 0.3.95 → 0.3.97
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 +118 -116
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const R = 0, F = (e) => e, L = () => Date.now(), k = {
|
|
2
2
|
cartesian_area: { categoryId: "cartesian", typeId: "area", label: { "en-gb": "Area" }, options: { highchartsType: "area" } },
|
|
3
3
|
cartesian_bar: { categoryId: "cartesian", typeId: "bar", label: { "en-gb": "Bar" }, options: { highchartsType: "bar" } },
|
|
4
4
|
cartesian_column: { categoryId: "cartesian", typeId: "column", label: { "en-gb": "Column" }, options: { highchartsType: "column" } },
|
|
@@ -14,63 +14,63 @@ const C = 0, R = (e) => e, F = () => Date.now(), L = {
|
|
|
14
14
|
streamgraph: { categoryId: "streamgraph", label: { "en-gb": "Streamgraph" }, options: {} },
|
|
15
15
|
values: { categoryId: "values", label: { "en-gb": "Values" }, options: {} }
|
|
16
16
|
};
|
|
17
|
-
class
|
|
17
|
+
class I extends Error {
|
|
18
18
|
locator;
|
|
19
19
|
constructor(t, a, r) {
|
|
20
20
|
super(t, r), this.name = "DataPosError", this.locator = a, Error.captureStackTrace?.(this, new.target);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
class
|
|
23
|
+
class p extends I {
|
|
24
24
|
constructor(t, a, r) {
|
|
25
25
|
super(t, a, r), this.name = "ApplicationError";
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
class
|
|
28
|
+
class O extends p {
|
|
29
29
|
constructor(t, a, r) {
|
|
30
30
|
super(t, a, r), this.name = "APIError";
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
class
|
|
33
|
+
class _ extends p {
|
|
34
34
|
constructor(t, a, r) {
|
|
35
35
|
super(t, a, r), this.name = "EngineError";
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
class
|
|
38
|
+
class D extends p {
|
|
39
39
|
body;
|
|
40
|
-
constructor(t, a, r,
|
|
41
|
-
super(t, a,
|
|
40
|
+
constructor(t, a, r, n) {
|
|
41
|
+
super(t, a, n), this.name = "FetchError", this.body = r;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
class
|
|
44
|
+
class v extends p {
|
|
45
45
|
componentName;
|
|
46
46
|
info;
|
|
47
|
-
constructor(t, a, r,
|
|
48
|
-
super(t, a,
|
|
47
|
+
constructor(t, a, r, n, o) {
|
|
48
|
+
super(t, a, o), this.name = "VueHandledError", this.info = r, this.componentName = n;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
class
|
|
51
|
+
class M extends p {
|
|
52
52
|
constructor(t, a, r) {
|
|
53
53
|
super(t, a, r), this.name = "WindowHandledRuntimeError";
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
class
|
|
56
|
+
class U extends p {
|
|
57
57
|
constructor(t, a, r) {
|
|
58
58
|
super(t, a, r), this.name = "WindowHandledPromiseRejectionError";
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
class
|
|
61
|
+
class B extends I {
|
|
62
62
|
constructor(t, a, r) {
|
|
63
63
|
super(t, a, r), this.name = "OperationalError";
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
async function
|
|
67
|
-
const r = `${t} Response status '${e.status}${e.statusText ? ` - ${e.statusText}` : ""}' received.`,
|
|
68
|
-
return new
|
|
66
|
+
async function j(e, t, a) {
|
|
67
|
+
const r = `${t} Response status '${e.status}${e.statusText ? ` - ${e.statusText}` : ""}' received.`, n = await e.text();
|
|
68
|
+
return new D(r, a, n);
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function H(e) {
|
|
71
71
|
return e.map((t) => t.message).join(" ");
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function W(e, t = "Unknown error.") {
|
|
74
74
|
if (e instanceof Error) return e;
|
|
75
75
|
if (typeof e == "string") return new Error(e);
|
|
76
76
|
try {
|
|
@@ -79,88 +79,90 @@ function H(e, t = "Unknown error.") {
|
|
|
79
79
|
return new Error(t);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function z(e) {
|
|
83
83
|
const t = /* @__PURE__ */ new Set(), a = [];
|
|
84
84
|
let r = e;
|
|
85
85
|
for (; r && !t.has(r); ) {
|
|
86
86
|
t.add(r);
|
|
87
|
-
let
|
|
88
|
-
if (r instanceof
|
|
89
|
-
|
|
90
|
-
else if (r instanceof
|
|
91
|
-
|
|
92
|
-
else if (r instanceof
|
|
93
|
-
|
|
87
|
+
let n;
|
|
88
|
+
if (r instanceof D)
|
|
89
|
+
n = { 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
|
+
n = { 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
|
+
n = { locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
|
|
94
94
|
else if (r instanceof Error) {
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
} else r ? (
|
|
98
|
-
/(?:\.{3}|[.!?])$/.test(
|
|
95
|
+
const o = r;
|
|
96
|
+
n = { locator: "", message: o.message, name: o.name, stack: o.stack }, r = o.cause;
|
|
97
|
+
} else r ? (n = { locator: "", message: String(r), name: "Error" }, r = void 0) : (n = { locator: "", message: "Unknown error.", name: "Error" }, r = void 0);
|
|
98
|
+
/(?:\.{3}|[.!?])$/.test(n.message) || (n.message += "."), a.push(n);
|
|
99
99
|
}
|
|
100
100
|
return a;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function V() {
|
|
103
103
|
function e(t, a, r) {
|
|
104
104
|
r.textContent = "Cytoscape.js diagram goes here...";
|
|
105
105
|
}
|
|
106
106
|
return { render: e };
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function X() {
|
|
109
109
|
function e(t, a, r) {
|
|
110
110
|
r.textContent = "values table goes here...";
|
|
111
111
|
}
|
|
112
112
|
return { render: e };
|
|
113
113
|
}
|
|
114
|
-
const
|
|
115
|
-
let b,
|
|
116
|
-
function
|
|
117
|
-
async function e(
|
|
114
|
+
const S = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", E = "highcharts";
|
|
115
|
+
let b, w = !1;
|
|
116
|
+
function G() {
|
|
117
|
+
async function e(o, s, u, h) {
|
|
118
118
|
await r();
|
|
119
119
|
const l = [];
|
|
120
|
-
for (const
|
|
121
|
-
l.push({ type:
|
|
122
|
-
const
|
|
123
|
-
chart: { type:
|
|
120
|
+
for (const c of s.data.measures)
|
|
121
|
+
l.push({ type: o.options.highchartsType, name: c.name, data: c.data });
|
|
122
|
+
const m = {
|
|
123
|
+
chart: { type: o.options.highchartsType },
|
|
124
124
|
plotOptions: { series: { borderColor: "#333" } },
|
|
125
125
|
series: l,
|
|
126
126
|
title: { text: s.title.text },
|
|
127
127
|
xAxis: { categories: s.data.categoryLabels },
|
|
128
128
|
yAxis: { title: { text: s.data.name } }
|
|
129
|
-
},
|
|
130
|
-
return { chart:
|
|
129
|
+
}, g = b.chart(u, m, h);
|
|
130
|
+
return { chart: g, resize: () => g.reflow(), vendorId: E };
|
|
131
131
|
}
|
|
132
|
-
async function t(
|
|
133
|
-
await Promise.all([r(),
|
|
132
|
+
async function t(o, s, u, h) {
|
|
133
|
+
await Promise.all([r(), n()]);
|
|
134
134
|
const l = [];
|
|
135
|
-
for (const
|
|
136
|
-
l.push({ type:
|
|
137
|
-
const
|
|
135
|
+
for (const c of s.data.measures)
|
|
136
|
+
l.push({ type: o.options.highchartsType, name: c.name, data: c.data });
|
|
137
|
+
const m = {
|
|
138
138
|
chart: { polar: !0 },
|
|
139
139
|
plotOptions: { series: { borderColor: "#333" } },
|
|
140
140
|
series: l,
|
|
141
141
|
title: { text: s.title.text },
|
|
142
142
|
xAxis: { categories: s.data.categoryLabels },
|
|
143
143
|
yAxis: { title: { text: s.data.name } }
|
|
144
|
-
},
|
|
145
|
-
return { chart:
|
|
144
|
+
}, g = b.chart(u, m, h);
|
|
145
|
+
return { chart: g, resize: () => g.reflow(), vendorId: E };
|
|
146
146
|
}
|
|
147
|
-
async function a(
|
|
148
|
-
await Promise.all([r(),
|
|
149
|
-
const l = [];
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
147
|
+
async function a(o, s, u, h) {
|
|
148
|
+
await Promise.all([r(), n()]);
|
|
149
|
+
const l = [], m = [];
|
|
150
|
+
for (let f = 0; f++; f < s.data.measures[0].data.length)
|
|
151
|
+
m.push([s.data.measures[0].data[f], s.data.measures[1].data[f]]);
|
|
152
|
+
console.log(1111, s.data.measures, m), l.push({ type: o.options.highchartsType, name: "Unknown", data: m });
|
|
153
|
+
const g = {
|
|
154
|
+
chart: { type: o.options.highchartsType, inverted: o.options.inverted },
|
|
153
155
|
plotOptions: { series: { borderColor: "#333" } },
|
|
154
156
|
series: l,
|
|
155
157
|
title: { text: s.title.text },
|
|
156
158
|
xAxis: { categories: s.data.categoryLabels },
|
|
157
159
|
yAxis: { title: { text: s.data.name } }
|
|
158
|
-
}, c = b.chart(u,
|
|
160
|
+
}, c = b.chart(u, g, h);
|
|
159
161
|
return { chart: c, resize: () => c.reflow(), vendorId: E };
|
|
160
162
|
}
|
|
161
163
|
async function r() {
|
|
162
164
|
if (b) return;
|
|
163
|
-
const
|
|
165
|
+
const o = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", s = `${o}highcharts.src.js`, u = `${o}modules/accessibility.src.js`;
|
|
164
166
|
b = (await import(
|
|
165
167
|
/* @vite-ignore */
|
|
166
168
|
s
|
|
@@ -169,13 +171,13 @@ function X() {
|
|
|
169
171
|
u
|
|
170
172
|
);
|
|
171
173
|
}
|
|
172
|
-
async function
|
|
173
|
-
if (
|
|
174
|
-
await import(`${
|
|
174
|
+
async function n() {
|
|
175
|
+
if (w) return;
|
|
176
|
+
await import(`${S}highcharts-more.src.js`), w = !0;
|
|
175
177
|
}
|
|
176
178
|
return { renderCartesianChart: e, renderPolarChart: t, renderRangeChart: a };
|
|
177
179
|
}
|
|
178
|
-
const
|
|
180
|
+
const T = "en-US", y = {}, P = (e) => {
|
|
179
181
|
switch (e) {
|
|
180
182
|
case "Edm.Binary":
|
|
181
183
|
return "unknown";
|
|
@@ -214,32 +216,32 @@ const D = "en-US", f = {}, G = (e) => {
|
|
|
214
216
|
default:
|
|
215
217
|
return "unknown";
|
|
216
218
|
}
|
|
217
|
-
},
|
|
219
|
+
}, J = (e) => {
|
|
218
220
|
if (e) {
|
|
219
221
|
const t = e.lastIndexOf("/"), a = e.lastIndexOf(".", t > -1 ? t : e.length);
|
|
220
222
|
return a > -1 ? e.substring(0, a) : e;
|
|
221
223
|
}
|
|
222
|
-
},
|
|
224
|
+
}, K = (e) => {
|
|
223
225
|
if (e) {
|
|
224
226
|
const t = e.lastIndexOf(".");
|
|
225
227
|
if (t > -1) return e.substring(t + 1);
|
|
226
228
|
}
|
|
227
|
-
}, i = (e, t = 2, a = t, r =
|
|
229
|
+
}, i = (e, t = 2, a = t, r = T) => {
|
|
228
230
|
if (e == null) return "";
|
|
229
|
-
const
|
|
230
|
-
let
|
|
231
|
-
return
|
|
231
|
+
const n = `${r}decimal${t}.${a}`;
|
|
232
|
+
let o = y[n];
|
|
233
|
+
return o || (o = new Intl.NumberFormat(r, {
|
|
232
234
|
localeMatcher: "best fit",
|
|
233
235
|
maximumFractionDigits: t,
|
|
234
236
|
minimumFractionDigits: a,
|
|
235
237
|
minimumIntegerDigits: 1,
|
|
236
238
|
style: "decimal",
|
|
237
239
|
useGrouping: !0
|
|
238
|
-
}),
|
|
239
|
-
},
|
|
240
|
+
}), y[n] = o), o.format(e);
|
|
241
|
+
}, q = (e) => e == null ? "" : e < 1e3 ? x(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 ? `${x(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 ? `${x(e)} ms` : e === 1e3 ? `${x(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`, x = (e, t = T) => {
|
|
240
242
|
if (e == null) return "";
|
|
241
243
|
const a = `${t}decimal0.0`;
|
|
242
|
-
let r =
|
|
244
|
+
let r = y[a];
|
|
243
245
|
return r || (r = new Intl.NumberFormat(t, {
|
|
244
246
|
localeMatcher: "best fit",
|
|
245
247
|
maximumFractionDigits: 0,
|
|
@@ -247,8 +249,8 @@ const D = "en-US", f = {}, G = (e) => {
|
|
|
247
249
|
minimumIntegerDigits: 1,
|
|
248
250
|
style: "decimal",
|
|
249
251
|
useGrouping: !0
|
|
250
|
-
}),
|
|
251
|
-
},
|
|
252
|
+
}), y[a] = r), r.format(e);
|
|
253
|
+
}, Z = (e) => {
|
|
252
254
|
switch (e) {
|
|
253
255
|
case "csv":
|
|
254
256
|
return "text/csv";
|
|
@@ -262,7 +264,7 @@ const D = "en-US", f = {}, G = (e) => {
|
|
|
262
264
|
default:
|
|
263
265
|
return "application/octet-stream";
|
|
264
266
|
}
|
|
265
|
-
},
|
|
267
|
+
}, A = [
|
|
266
268
|
{ id: "dtv", label: { "en-gb": "Delimited Text" } },
|
|
267
269
|
{ id: "e/e", label: { "en-gb": "Entity/Event" } },
|
|
268
270
|
{ id: "jsonArray", label: { "en-gb": "JSON Array" } },
|
|
@@ -270,22 +272,22 @@ const D = "en-US", f = {}, G = (e) => {
|
|
|
270
272
|
{ id: "xls", label: { "en-gb": "XLS" } },
|
|
271
273
|
{ id: "xlsx", label: { "en-gb": "XLSX" } },
|
|
272
274
|
{ id: "xml", label: { "en-gb": "XML" } }
|
|
273
|
-
],
|
|
275
|
+
], ee = (e = d) => {
|
|
274
276
|
const t = [];
|
|
275
|
-
for (const a of
|
|
277
|
+
for (const a of A) t.push({ ...a, label: a.label[e] || a.label[d] || a.id });
|
|
276
278
|
return t;
|
|
277
|
-
},
|
|
279
|
+
}, N = [
|
|
278
280
|
{ id: `
|
|
279
281
|
`, label: { "en-gb": "Newline" } },
|
|
280
282
|
{ id: "\r", label: { "en-gb": "Carriage Return" } },
|
|
281
283
|
{ id: `\r
|
|
282
284
|
`, label: { "en-gb": "Carriage Return/Newline" } }
|
|
283
|
-
],
|
|
285
|
+
], re = (e = d) => {
|
|
284
286
|
const t = [];
|
|
285
|
-
for (const a of
|
|
287
|
+
for (const a of N)
|
|
286
288
|
t.push({ ...a, label: a.label[e] || a.label[d] || a.id });
|
|
287
289
|
return t;
|
|
288
|
-
},
|
|
290
|
+
}, $ = [
|
|
289
291
|
{ id: ":", label: { "en-gb": "Colon" } },
|
|
290
292
|
{ id: ",", label: { "en-gb": "Comma" } },
|
|
291
293
|
{ id: "!", label: { "en-gb": "Exclamation Mark" } },
|
|
@@ -297,12 +299,12 @@ const D = "en-US", f = {}, G = (e) => {
|
|
|
297
299
|
{ id: "_", label: { "en-gb": "Underscore" } },
|
|
298
300
|
{ id: "0x1F", label: { "en-gb": "Unit Separator" } },
|
|
299
301
|
{ id: "|", label: { "en-gb": "Vertical Bar" } }
|
|
300
|
-
],
|
|
302
|
+
], te = (e = d) => {
|
|
301
303
|
const t = [];
|
|
302
|
-
for (const a of
|
|
304
|
+
for (const a of $)
|
|
303
305
|
t.push({ ...a, label: a.label[e] || a.label[d] || a.id });
|
|
304
306
|
return t;
|
|
305
|
-
},
|
|
307
|
+
}, C = [
|
|
306
308
|
{ id: "alpha", color: "red", label: { "en-gb": "alpha" } },
|
|
307
309
|
{ id: "beta", color: "amber", label: { "en-gb": "beta" } },
|
|
308
310
|
{ id: "generalAvailability", color: "green", label: { "en-gb": "" } },
|
|
@@ -312,42 +314,42 @@ const D = "en-US", f = {}, G = (e) => {
|
|
|
312
314
|
{ id: "releaseCandidate", color: "green", label: { "en-gb": "release-candidate" } },
|
|
313
315
|
{ id: "unavailable", color: "other", label: { "en-gb": "unavailable" } },
|
|
314
316
|
{ id: "underReview", color: "other", label: { "en-gb": "under-review" } }
|
|
315
|
-
],
|
|
316
|
-
const a =
|
|
317
|
+
], ae = (e, t = d) => {
|
|
318
|
+
const a = C.find((r) => r.id === e);
|
|
317
319
|
return a ? { ...a, label: a.label[t] || a.label[d] || e } : { id: e, color: "other", label: e };
|
|
318
320
|
}, d = "en-gb";
|
|
319
321
|
export {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
+
O as APIError,
|
|
323
|
+
p as ApplicationError,
|
|
322
324
|
d as DEFAULT_LOCALE_CODE,
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
325
|
+
R as DefaultTimestamp,
|
|
326
|
+
_ as EngineError,
|
|
327
|
+
D as FetchError,
|
|
328
|
+
B as OperationalError,
|
|
329
|
+
v as VueError,
|
|
330
|
+
U as WindowPromiseRejectionError,
|
|
331
|
+
M as WindowRuntimeError,
|
|
332
|
+
j as buildFetchError,
|
|
333
|
+
H as concatenateSerialisedErrorMessages,
|
|
334
|
+
F as convertMillisecondsToTimestamp,
|
|
335
|
+
P as convertODataTypeIdToUsageTypeId,
|
|
336
|
+
K as extractExtensionFromPath,
|
|
337
|
+
J as extractNameFromPath,
|
|
336
338
|
i as formatNumberAsDecimalNumber,
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
339
|
+
Y as formatNumberAsDuration,
|
|
340
|
+
q as formatNumberAsSize,
|
|
341
|
+
Q as formatNumberAsStorageSize,
|
|
342
|
+
x as formatNumberAsWholeNumber,
|
|
343
|
+
ae as getComponentStatus,
|
|
344
|
+
L as getCurrentTimestamp,
|
|
345
|
+
ee as getDataFormats,
|
|
346
|
+
re as getRecordDelimiters,
|
|
347
|
+
te as getValueDelimiters,
|
|
348
|
+
Z as lookupMimeTypeForExtension,
|
|
349
|
+
W as normalizeToError,
|
|
350
|
+
k as presentationViewTypeMap,
|
|
351
|
+
z as serialiseError,
|
|
352
|
+
V as useCytoscapeJS,
|
|
353
|
+
X as useDataTable,
|
|
354
|
+
G as useHighcharts
|
|
353
355
|
};
|