@datapos/datapos-shared 0.3.99 → 0.3.101
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 +52 -53
- package/package.json +1 -1
|
@@ -20,40 +20,40 @@ class I extends Error {
|
|
|
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 O extends
|
|
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 _ extends
|
|
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 D extends
|
|
38
|
+
class D extends p {
|
|
39
39
|
body;
|
|
40
|
-
constructor(t, a, r,
|
|
41
|
-
super(t, a,
|
|
40
|
+
constructor(t, a, r, o) {
|
|
41
|
+
super(t, a, o), this.name = "FetchError", this.body = r;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
class v extends
|
|
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, o, n) {
|
|
48
|
+
super(t, a, n), this.name = "VueHandledError", this.info = r, this.componentName = o;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
class M extends
|
|
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 U extends
|
|
56
|
+
class U extends p {
|
|
57
57
|
constructor(t, a, r) {
|
|
58
58
|
super(t, a, r), this.name = "WindowHandledPromiseRejectionError";
|
|
59
59
|
}
|
|
@@ -64,8 +64,8 @@ class B extends I {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
async function j(e, t, a) {
|
|
67
|
-
const r = `${t} Response status '${e.status}${e.statusText ? ` - ${e.statusText}` : ""}' received.`,
|
|
68
|
-
return new D(r, 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);
|
|
69
69
|
}
|
|
70
70
|
function H(e) {
|
|
71
71
|
return e.map((t) => t.message).join(" ");
|
|
@@ -84,18 +84,18 @@ function z(e) {
|
|
|
84
84
|
let r = e;
|
|
85
85
|
for (; r && !t.has(r); ) {
|
|
86
86
|
t.add(r);
|
|
87
|
-
let
|
|
87
|
+
let o;
|
|
88
88
|
if (r instanceof D)
|
|
89
|
-
|
|
89
|
+
o = { body: r.body, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
|
|
90
90
|
else if (r instanceof v)
|
|
91
|
-
|
|
91
|
+
o = { componentName: r.componentName, info: r.info, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
|
|
92
92
|
else if (r instanceof I)
|
|
93
|
-
|
|
93
|
+
o = { 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 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
99
|
}
|
|
100
100
|
return a;
|
|
101
101
|
}
|
|
@@ -112,59 +112,58 @@ function X() {
|
|
|
112
112
|
return { render: e };
|
|
113
113
|
}
|
|
114
114
|
const S = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", E = "highcharts";
|
|
115
|
-
let
|
|
115
|
+
let b, w = !1;
|
|
116
116
|
function G() {
|
|
117
|
-
async function e(
|
|
117
|
+
async function e(n, s, u, h) {
|
|
118
118
|
await r();
|
|
119
119
|
const l = [];
|
|
120
120
|
for (const c of s.data.measures)
|
|
121
|
-
l.push({ type:
|
|
122
|
-
const
|
|
123
|
-
chart: { type:
|
|
121
|
+
l.push({ type: n.options.highchartsType, name: c.name, data: c.data });
|
|
122
|
+
const g = {
|
|
123
|
+
chart: { type: n.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
|
+
}, m = b.chart(u, g, h);
|
|
130
|
+
return { chart: m, resize: () => m.reflow(), vendorId: E };
|
|
131
131
|
}
|
|
132
|
-
async function t(
|
|
133
|
-
await Promise.all([r(),
|
|
132
|
+
async function t(n, s, u, h) {
|
|
133
|
+
await Promise.all([r(), o()]);
|
|
134
134
|
const l = [];
|
|
135
135
|
for (const c of s.data.measures)
|
|
136
|
-
l.push({ type:
|
|
137
|
-
const
|
|
136
|
+
l.push({ type: n.options.highchartsType, name: c.name, data: c.data });
|
|
137
|
+
const g = {
|
|
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
|
+
}, m = b.chart(u, g, h);
|
|
145
|
+
return { chart: m, resize: () => m.reflow(), vendorId: E };
|
|
146
146
|
}
|
|
147
|
-
async function a(
|
|
148
|
-
await Promise.all([r(),
|
|
149
|
-
const l = [],
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
chart: { type: o.options.highchartsType, inverted: o.options.inverted },
|
|
147
|
+
async function a(n, s, u, h) {
|
|
148
|
+
await Promise.all([r(), o()]);
|
|
149
|
+
const l = [], g = [];
|
|
150
|
+
for (let f = 0; f < s.data.measures[0].data.length; f++)
|
|
151
|
+
g.push([s.data.measures[0].data[f][0], s.data.measures[1].data[f][0]]);
|
|
152
|
+
l.push({ type: n.options.highchartsType, name: "Unknown", data: g });
|
|
153
|
+
const m = {
|
|
154
|
+
chart: { type: n.options.highchartsType, inverted: n.options.inverted },
|
|
156
155
|
plotOptions: { series: { borderColor: "#333" } },
|
|
157
156
|
series: l,
|
|
158
157
|
title: { text: s.title.text },
|
|
159
158
|
xAxis: { categories: s.data.categoryLabels },
|
|
160
159
|
yAxis: { title: { text: s.data.name } }
|
|
161
|
-
}, c =
|
|
160
|
+
}, c = b.chart(u, m, h);
|
|
162
161
|
return { chart: c, resize: () => c.reflow(), vendorId: E };
|
|
163
162
|
}
|
|
164
163
|
async function r() {
|
|
165
|
-
if (
|
|
166
|
-
const
|
|
167
|
-
|
|
164
|
+
if (b) return;
|
|
165
|
+
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`;
|
|
166
|
+
b = (await import(
|
|
168
167
|
/* @vite-ignore */
|
|
169
168
|
s
|
|
170
169
|
)).default, await import(
|
|
@@ -172,7 +171,7 @@ function G() {
|
|
|
172
171
|
u
|
|
173
172
|
);
|
|
174
173
|
}
|
|
175
|
-
async function
|
|
174
|
+
async function o() {
|
|
176
175
|
if (w) return;
|
|
177
176
|
await import(`${S}highcharts-more.src.js`), w = !0;
|
|
178
177
|
}
|
|
@@ -229,16 +228,16 @@ const T = "en-US", y = {}, P = (e) => {
|
|
|
229
228
|
}
|
|
230
229
|
}, i = (e, t = 2, a = t, r = T) => {
|
|
231
230
|
if (e == null) return "";
|
|
232
|
-
const
|
|
233
|
-
let
|
|
234
|
-
return
|
|
231
|
+
const o = `${r}decimal${t}.${a}`;
|
|
232
|
+
let n = y[o];
|
|
233
|
+
return n || (n = new Intl.NumberFormat(r, {
|
|
235
234
|
localeMatcher: "best fit",
|
|
236
235
|
maximumFractionDigits: t,
|
|
237
236
|
minimumFractionDigits: a,
|
|
238
237
|
minimumIntegerDigits: 1,
|
|
239
238
|
style: "decimal",
|
|
240
239
|
useGrouping: !0
|
|
241
|
-
}), y[
|
|
240
|
+
}), y[o] = n), n.format(e);
|
|
242
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) => {
|
|
243
242
|
if (e == null) return "";
|
|
244
243
|
const a = `${t}decimal0.0`;
|
|
@@ -321,7 +320,7 @@ const T = "en-US", y = {}, P = (e) => {
|
|
|
321
320
|
}, d = "en-gb";
|
|
322
321
|
export {
|
|
323
322
|
O as APIError,
|
|
324
|
-
|
|
323
|
+
p as ApplicationError,
|
|
325
324
|
d as DEFAULT_LOCALE_CODE,
|
|
326
325
|
R as DefaultTimestamp,
|
|
327
326
|
_ as EngineError,
|