@datapos/datapos-shared 0.3.100 → 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.
@@ -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 h extends I {
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 h {
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 h {
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 h {
38
+ class D extends p {
39
39
  body;
40
- constructor(t, a, r, n) {
41
- super(t, a, n), this.name = "FetchError", this.body = r;
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 h {
44
+ class v extends p {
45
45
  componentName;
46
46
  info;
47
- constructor(t, a, r, n, o) {
48
- super(t, a, o), this.name = "VueHandledError", this.info = r, this.componentName = n;
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 h {
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 h {
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.`, n = await e.text();
68
- return new D(r, a, n);
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 n;
87
+ let o;
88
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;
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
- n = { componentName: r.componentName, info: r.info, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
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
- n = { locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
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 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);
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 f, w = !1;
115
+ let b, w = !1;
116
116
  function G() {
117
- async function e(o, s, u, b) {
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: o.options.highchartsType, name: c.name, data: c.data });
122
- const m = {
123
- chart: { type: o.options.highchartsType },
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
- }, g = f.chart(u, m, b);
130
- return { chart: g, resize: () => g.reflow(), vendorId: E };
129
+ }, m = b.chart(u, g, h);
130
+ return { chart: m, resize: () => m.reflow(), vendorId: E };
131
131
  }
132
- async function t(o, s, u, b) {
133
- await Promise.all([r(), n()]);
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: o.options.highchartsType, name: c.name, data: c.data });
137
- const m = {
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
- }, g = f.chart(u, m, b);
145
- return { chart: g, resize: () => g.reflow(), vendorId: E };
144
+ }, m = b.chart(u, g, h);
145
+ return { chart: m, resize: () => m.reflow(), vendorId: E };
146
146
  }
147
- async function a(o, s, u, b) {
148
- await Promise.all([r(), n()]);
149
- const l = [], m = [];
150
- console.log(1111, s.data.measures[0].data.length);
151
- for (let p = 0; p < s.data.measures[0].data.length; p++)
152
- console.log(2222, s.data.measures[0].data[p], s.data.measures[1].data[p]), m.push([s.data.measures[0].data[p][0], s.data.measures[1].data[p][0]]);
153
- console.log(3333, s.data.measures, m), l.push({ type: o.options.highchartsType, name: "Unknown", data: m });
154
- const g = {
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 = f.chart(u, g, b);
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 (f) return;
166
- 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`;
167
- f = (await import(
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 n() {
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 n = `${r}decimal${t}.${a}`;
233
- let o = y[n];
234
- return o || (o = new Intl.NumberFormat(r, {
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[n] = o), o.format(e);
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
- h as ApplicationError,
323
+ p as ApplicationError,
325
324
  d as DEFAULT_LOCALE_CODE,
326
325
  R as DefaultTimestamp,
327
326
  _ as EngineError,
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.100",
5
+ "version": "0.3.101",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"