@nivaro/react 0.3.113 → 0.3.114
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/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +13 -1
- package/dist/shared/components/DataTable.js +543 -504
- package/dist/shared/components/cbv/column-totals.js +75 -67
- package/dist/shared/components/queue/QueueWorklist.js +1589 -1491
- package/dist/shared/components/queue/queue-totals.js +92 -0
- package/dist/shared/components/queue/worklist-helpers.js +18 -14
- package/dist/shared/lib/list-link.js +56 -50
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { formatValue as S } from "../../lib/format-value.js";
|
|
2
|
-
const
|
|
2
|
+
const g = [
|
|
3
3
|
{ fn: "sum", label: "Sum", short: "Sum" },
|
|
4
4
|
{ fn: "avg", label: "Average", short: "Avg" },
|
|
5
5
|
{ fn: "min", label: "Minimum", short: "Min" },
|
|
@@ -7,66 +7,72 @@ const p = [
|
|
|
7
7
|
{ fn: "count", label: "Count (filled in)", short: "Count" }
|
|
8
8
|
];
|
|
9
9
|
function b(e) {
|
|
10
|
-
return typeof e == "string" &&
|
|
10
|
+
return typeof e == "string" && g.some((n) => n.fn === e);
|
|
11
11
|
}
|
|
12
12
|
function v(e) {
|
|
13
13
|
return /^[A-Za-z_][A-Za-z0-9_]*$/.test(e);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function w(e, n, t) {
|
|
16
16
|
return {
|
|
17
17
|
[n]: e,
|
|
18
18
|
...t.search ? { search: t.search } : {},
|
|
19
19
|
...t.conditions ? { conditions: t.conditions } : {}
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
var
|
|
24
|
-
const r = (
|
|
22
|
+
function M(e, n, t) {
|
|
23
|
+
var i, l, c;
|
|
24
|
+
const r = (c = (l = (i = e == null ? void 0 : e.data) == null ? void 0 : i[0]) == null ? void 0 : l[t]) == null ? void 0 : c[n];
|
|
25
25
|
if (r == null || r === "") return null;
|
|
26
26
|
const o = Number(r);
|
|
27
27
|
return Number.isFinite(o) ? o : null;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function $(e, n, t) {
|
|
30
30
|
return n === "count" ? Math.round(e).toLocaleString("en-US") : (t == null ? void 0 : t.type) === "number" ? S(String(e), t) : (Math.round(e * 100) / 100).toLocaleString("en-US", { maximumFractionDigits: 2 });
|
|
31
31
|
}
|
|
32
|
-
const
|
|
33
|
-
function
|
|
32
|
+
const p = (e) => `nvr_cbv_totals_${e}`, _ = (e) => e === "off" || b(e);
|
|
33
|
+
function k(e) {
|
|
34
|
+
return y(p(e), v);
|
|
35
|
+
}
|
|
36
|
+
function z(e, n) {
|
|
37
|
+
T(p(e), n);
|
|
38
|
+
}
|
|
39
|
+
function y(e, n) {
|
|
34
40
|
try {
|
|
35
|
-
const
|
|
36
|
-
if (!
|
|
37
|
-
const
|
|
38
|
-
for (const [
|
|
39
|
-
return
|
|
41
|
+
const t = localStorage.getItem(e), r = t ? JSON.parse(t) : null;
|
|
42
|
+
if (!r || typeof r != "object") return {};
|
|
43
|
+
const o = r.v === 2 && r.o && typeof r.o == "object" ? r.o : r, i = {};
|
|
44
|
+
for (const [l, c] of Object.entries(o)) n(l) && _(c) && (i[l] = c);
|
|
45
|
+
return i;
|
|
40
46
|
} catch {
|
|
41
47
|
return {};
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
|
-
function
|
|
50
|
+
function T(e, n) {
|
|
45
51
|
try {
|
|
46
|
-
Object.keys(n).length === 0 ? localStorage.removeItem(
|
|
52
|
+
Object.keys(n).length === 0 ? localStorage.removeItem(e) : localStorage.setItem(e, JSON.stringify({ v: 2, o: n }));
|
|
47
53
|
} catch {
|
|
48
54
|
}
|
|
49
55
|
}
|
|
50
|
-
function
|
|
56
|
+
function j(e, n) {
|
|
51
57
|
const t = { ...e };
|
|
52
58
|
for (const [r, o] of Object.entries(n))
|
|
53
59
|
o === "off" ? delete t[r] : t[r] = o;
|
|
54
60
|
return t;
|
|
55
61
|
}
|
|
56
|
-
function
|
|
62
|
+
function N(e, n, t) {
|
|
57
63
|
return { ...e, [n]: t ?? "off" };
|
|
58
64
|
}
|
|
59
|
-
function
|
|
65
|
+
function Z(e, n) {
|
|
60
66
|
const t = {};
|
|
61
67
|
for (const [r, o] of Object.entries(e))
|
|
62
68
|
(o === "off" ? !n[r] : n[r] === o) || (t[r] = o);
|
|
63
69
|
return t;
|
|
64
70
|
}
|
|
65
|
-
function
|
|
71
|
+
function h(e) {
|
|
66
72
|
return !e.computed_formula || !!e.computed_store;
|
|
67
73
|
}
|
|
68
|
-
const
|
|
69
|
-
function
|
|
74
|
+
const A = /* @__PURE__ */ new Set(["integer", "bigInteger", "biginteger", "decimal", "float"]);
|
|
75
|
+
function O(e) {
|
|
70
76
|
const n = String(e ?? "").trim();
|
|
71
77
|
if (!n) return null;
|
|
72
78
|
let t = 0;
|
|
@@ -74,53 +80,53 @@ function T(e) {
|
|
|
74
80
|
for (; t < n.length && /\s/.test(n[t]); ) t++;
|
|
75
81
|
}, o = () => {
|
|
76
82
|
r();
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
return t +=
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
82
|
-
return t +=
|
|
83
|
-
const f = /^coalesce\s*\(/i.exec(
|
|
83
|
+
const a = n.slice(t), s = /^item\.([A-Za-z_][A-Za-z0-9_]*)/.exec(a);
|
|
84
|
+
if (s)
|
|
85
|
+
return t += s[0].length, s[1];
|
|
86
|
+
const u = /^\{\{\s*([A-Za-z_][A-Za-z0-9_.]*)\s*\}\}/.exec(a);
|
|
87
|
+
if (u)
|
|
88
|
+
return t += u[0].length, u[1];
|
|
89
|
+
const f = /^coalesce\s*\(/i.exec(a);
|
|
84
90
|
if (f) {
|
|
85
91
|
t += f[0].length;
|
|
86
|
-
const
|
|
87
|
-
return !
|
|
92
|
+
const d = o(), m = /^\s*,\s*0(?:\.0+)?\s*\)/.exec(n.slice(t));
|
|
93
|
+
return !d || !m ? null : (t += m[0].length, d);
|
|
88
94
|
}
|
|
89
95
|
return null;
|
|
90
|
-
},
|
|
91
|
-
let
|
|
96
|
+
}, i = /* @__PURE__ */ new Map(), l = (a) => {
|
|
97
|
+
let s = !0;
|
|
92
98
|
for (; ; ) {
|
|
93
99
|
r();
|
|
94
|
-
let
|
|
100
|
+
let u = a;
|
|
95
101
|
if (n[t] === "+" || n[t] === "-")
|
|
96
|
-
n[t] === "-" && (
|
|
97
|
-
else if (!
|
|
98
|
-
if (
|
|
99
|
-
if (t++, !l(
|
|
102
|
+
n[t] === "-" && (u = u === 1 ? -1 : 1), t++, r();
|
|
103
|
+
else if (!s) return !1;
|
|
104
|
+
if (s = !1, n[t] === "(") {
|
|
105
|
+
if (t++, !l(u) || (r(), n[t] !== ")")) return !1;
|
|
100
106
|
t++;
|
|
101
107
|
} else {
|
|
102
108
|
const f = o();
|
|
103
109
|
if (!f) return !1;
|
|
104
|
-
|
|
110
|
+
i.set(f, (i.get(f) ?? 0) + u);
|
|
105
111
|
}
|
|
106
112
|
if (r(), t >= n.length || n[t] === ")") return !0;
|
|
107
113
|
if (n[t] !== "+" && n[t] !== "-") return !1;
|
|
108
114
|
}
|
|
109
115
|
};
|
|
110
116
|
if (!l(1) || (r(), t !== n.length)) return null;
|
|
111
|
-
const
|
|
112
|
-
for (const [
|
|
113
|
-
if (
|
|
114
|
-
else if (
|
|
115
|
-
return
|
|
116
|
-
}
|
|
117
|
-
function
|
|
118
|
-
if (
|
|
117
|
+
const c = [];
|
|
118
|
+
for (const [a, s] of i)
|
|
119
|
+
if (s === 1 || s === -1) c.push({ field: a, sign: s });
|
|
120
|
+
else if (s !== 0) return null;
|
|
121
|
+
return c.length ? c : null;
|
|
122
|
+
}
|
|
123
|
+
function C(e, n) {
|
|
124
|
+
if (h(e)) return { kind: "server" };
|
|
119
125
|
if (e.computed_type !== "rollup") {
|
|
120
|
-
const t =
|
|
126
|
+
const t = O(e.computed_formula ?? "");
|
|
121
127
|
if (t != null && t.every((r) => {
|
|
122
128
|
const o = n(r.field);
|
|
123
|
-
return !!o &&
|
|
129
|
+
return !!o && h(o) && A.has(String(o.type ?? ""));
|
|
124
130
|
}))
|
|
125
131
|
return { kind: "derived", terms: t };
|
|
126
132
|
}
|
|
@@ -129,7 +135,7 @@ function N(e, n) {
|
|
|
129
135
|
why: e.computed_type === "rollup" ? "Worked out from linked records each time the list is read, so it has no total." : "Calculated each time the list is read from a formula that does more than add and subtract stored columns, so it has no total."
|
|
130
136
|
};
|
|
131
137
|
}
|
|
132
|
-
function
|
|
138
|
+
function F(e, n) {
|
|
133
139
|
let t = 0;
|
|
134
140
|
for (const r of e) {
|
|
135
141
|
const o = n(r.field);
|
|
@@ -138,26 +144,28 @@ function Z(e, n) {
|
|
|
138
144
|
}
|
|
139
145
|
return Math.round(t * 1e6) / 1e6;
|
|
140
146
|
}
|
|
141
|
-
function
|
|
142
|
-
var
|
|
143
|
-
const r = ((
|
|
147
|
+
function L(e, n, t) {
|
|
148
|
+
var i;
|
|
149
|
+
const r = ((i = g.find((l) => l.fn === e)) == null ? void 0 : i.label.toLowerCase()) ?? e, o = t == null ? "all matching records" : `all ${t.toLocaleString("en-US")} matching records`;
|
|
144
150
|
return e === "count" ? `Records with ${n} filled in, across ${o}` : `${r.charAt(0).toUpperCase()}${r.slice(1)} of ${n} across ${o}`;
|
|
145
151
|
}
|
|
146
152
|
export {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
153
|
+
g as TOTAL_FNS,
|
|
154
|
+
F as combineTerms,
|
|
155
|
+
$ as formatTotal,
|
|
156
|
+
h as isStoredField,
|
|
151
157
|
b as isTotalFn,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
M as
|
|
157
|
-
z as
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
O as linearSumTerms,
|
|
159
|
+
k as loadTotalOverrides,
|
|
160
|
+
y as loadTotalOverridesAt,
|
|
161
|
+
Z as overridesAfterSave,
|
|
162
|
+
M as readTotal,
|
|
163
|
+
z as rememberTotalOverrides,
|
|
164
|
+
T as rememberTotalOverridesAt,
|
|
165
|
+
N as setOverride,
|
|
166
|
+
j as shownTotals,
|
|
167
|
+
L as totalTip,
|
|
160
168
|
v as totalsEligibleKey,
|
|
161
|
-
|
|
162
|
-
|
|
169
|
+
w as totalsParams,
|
|
170
|
+
C as totalsSupport
|
|
163
171
|
};
|