@burdenoff/microfe-bigconsole 2026.613.5 → 2026.615.1
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/bigconsole/components/dashboard/DashboardCanvas.js +163 -151
- package/dist/bigconsole/components/dashboard/DashboardCanvas.js.map +1 -1
- package/dist/bigconsole/components/dashboard/DashboardToolbar.js +89 -69
- package/dist/bigconsole/components/dashboard/DashboardToolbar.js.map +1 -1
- package/dist/bigconsole/components/widgets/table/TableHeader.js +89 -29
- package/dist/bigconsole/components/widgets/table/TableHeader.js.map +1 -1
- package/dist/bigconsole/components/widgets/table/TableWidget.js +218 -148
- package/dist/bigconsole/components/widgets/table/TableWidget.js.map +1 -1
- package/dist/bigconsole/hooks/index.js +1 -0
- package/dist/bigconsole/hooks/useDashboardImageExport.js +92 -1
- package/dist/bigconsole/hooks/useDashboardImageExport.js.map +1 -0
- package/dist/bigconsole/hooks/useWidgetConfigPersist.js +32 -0
- package/dist/bigconsole/hooks/useWidgetConfigPersist.js.map +1 -0
- package/dist/bigconsole/store/dashboardStore.js +2 -2
- package/dist/bigconsole/store/dashboardStore.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useIsEditMode as e } from "../../../store/dashboardStore.js";
|
|
2
|
+
import "../../../store/index.js";
|
|
3
|
+
import { useCrossFilterContext as t, useWidgetCrossFilter as n } from "../../../contexts/CrossFilterContext.js";
|
|
2
4
|
import "../../../contexts/index.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import i from "./
|
|
6
|
-
import
|
|
5
|
+
import r from "../../../hooks/useWidgetConfigPersist.js";
|
|
6
|
+
import "../../../hooks/index.js";
|
|
7
|
+
import i from "./TableHeader.js";
|
|
8
|
+
import a from "./TableCell.js";
|
|
9
|
+
import ee from "./TablePagination.js";
|
|
10
|
+
import { memo as o, useCallback as s, useEffect as c, useMemo as l, useRef as te, useState as u } from "react";
|
|
7
11
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
12
|
//#region src/bigconsole/components/widgets/table/TableWidget.tsx
|
|
9
|
-
function
|
|
13
|
+
function ne(e, t) {
|
|
10
14
|
return !t.column || !t.direction ? e : [...e].sort((e, n) => {
|
|
11
15
|
let r = e[t.column], i = n[t.column];
|
|
12
16
|
if (r == null && i == null) return 0;
|
|
@@ -16,7 +20,7 @@ function ee(e, t) {
|
|
|
16
20
|
return a = typeof r == "number" && typeof i == "number" ? r - i : String(r).localeCompare(String(i)), t.direction === "asc" ? a : -a;
|
|
17
21
|
});
|
|
18
22
|
}
|
|
19
|
-
function
|
|
23
|
+
function re(e, t, n) {
|
|
20
24
|
if (!t.trim()) return e;
|
|
21
25
|
let r = t.toLowerCase();
|
|
22
26
|
return e.filter((e) => n.some((t) => {
|
|
@@ -24,7 +28,7 @@ function p(e, t, n) {
|
|
|
24
28
|
return n != null && String(n).toLowerCase().includes(r);
|
|
25
29
|
}));
|
|
26
30
|
}
|
|
27
|
-
function
|
|
31
|
+
function ie(e, t, n) {
|
|
28
32
|
switch (t) {
|
|
29
33
|
case "currency": return new Intl.NumberFormat("en-US", {
|
|
30
34
|
style: "currency",
|
|
@@ -35,10 +39,10 @@ function m(e, t, n) {
|
|
|
35
39
|
default: return Number.isInteger(e) ? String(e) : e.toFixed(2);
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
|
-
var
|
|
39
|
-
let
|
|
40
|
-
if (Array.isArray(
|
|
41
|
-
if (
|
|
42
|
+
var p = o(function({ widget: o, data: p = [], onRowClick: m, onDrilldown: h }) {
|
|
43
|
+
let g = o.config, _ = l(() => {
|
|
44
|
+
if (Array.isArray(p)) return p;
|
|
45
|
+
if (p && typeof p == "object") {
|
|
42
46
|
for (let e of [
|
|
43
47
|
"data",
|
|
44
48
|
"items",
|
|
@@ -49,20 +53,20 @@ var h = a(function({ widget: a, data: h = [], onRowClick: g, onDrilldown: _ }) {
|
|
|
49
53
|
"sales",
|
|
50
54
|
"entries",
|
|
51
55
|
"values"
|
|
52
|
-
]) if (Array.isArray(
|
|
53
|
-
let e = Object.values(
|
|
56
|
+
]) if (Array.isArray(p[e])) return p[e];
|
|
57
|
+
let e = Object.values(p);
|
|
54
58
|
for (let t of e) if (Array.isArray(t)) return t;
|
|
55
|
-
return [
|
|
59
|
+
return [p];
|
|
56
60
|
}
|
|
57
61
|
return [];
|
|
58
|
-
}, [
|
|
59
|
-
column:
|
|
60
|
-
direction:
|
|
61
|
-
}), [
|
|
62
|
+
}, [p]), { handleDataClick: v, enabled: y } = n(o.id, g?.crossFilterMappings), { clearAllCrossFilters: b, hasCrossFilters: ae } = t(), [x, S] = u({
|
|
63
|
+
column: g?.defaultSortColumn || null,
|
|
64
|
+
direction: g?.defaultSortDirection || null
|
|
65
|
+
}), [C, w] = u(""), [T, E] = u({
|
|
62
66
|
page: 0,
|
|
63
|
-
pageSize:
|
|
67
|
+
pageSize: g?.pageSize || 10,
|
|
64
68
|
totalItems: 0
|
|
65
|
-
}), A =
|
|
69
|
+
}), D = e(), { persistConfig: O } = r(o), [k, A] = u({}), [j, oe] = u(null), M = l(() => g?.columns?.length ? g.columns.map((e) => {
|
|
66
70
|
if (typeof e == "string") return {
|
|
67
71
|
key: e,
|
|
68
72
|
header: e.charAt(0).toUpperCase() + e.slice(1).replace(/_/g, " "),
|
|
@@ -76,118 +80,180 @@ var h = a(function({ widget: a, data: h = [], onRowClick: g, onDrilldown: _ }) {
|
|
|
76
80
|
width: e.width == null ? void 0 : String(e.width),
|
|
77
81
|
align: e.align
|
|
78
82
|
};
|
|
79
|
-
}) :
|
|
83
|
+
}) : _.length > 0 ? Object.keys(_[0]).map((e) => ({
|
|
80
84
|
key: e,
|
|
81
85
|
header: e.charAt(0).toUpperCase() + e.slice(1).replace(/_/g, " "),
|
|
82
86
|
sortable: !0
|
|
83
|
-
})) : [], [
|
|
87
|
+
})) : [], [g?.columns, _]), N = l(() => {
|
|
88
|
+
let e = M;
|
|
89
|
+
if (j) {
|
|
90
|
+
let t = new Map(M.map((e) => [e.key, e])), n = j.map((e) => t.get(e)).filter((e) => e !== void 0), r = M.filter((e) => !j.includes(e.key));
|
|
91
|
+
e = [...n, ...r];
|
|
92
|
+
}
|
|
93
|
+
return Object.keys(k).length > 0 && (e = e.map((e) => k[e.key] == null ? e : {
|
|
94
|
+
...e,
|
|
95
|
+
width: `${k[e.key]}px`
|
|
96
|
+
})), e;
|
|
97
|
+
}, [
|
|
98
|
+
M,
|
|
99
|
+
j,
|
|
100
|
+
k
|
|
101
|
+
]), P = s((e, t) => {
|
|
102
|
+
let n = /* @__PURE__ */ new Map();
|
|
103
|
+
g?.columns?.forEach((e) => {
|
|
104
|
+
let t = e.key || e.field;
|
|
105
|
+
t && n.set(t, e);
|
|
106
|
+
});
|
|
107
|
+
let r = M.map((e) => e.key);
|
|
108
|
+
O({ columns: [...e.filter((e) => r.includes(e)), ...r.filter((t) => !e.includes(t))].map((e) => {
|
|
109
|
+
let r = M.find((t) => t.key === e), i = {
|
|
110
|
+
...n.get(e) ?? {},
|
|
111
|
+
key: e
|
|
112
|
+
};
|
|
113
|
+
!i.label && !i.header && r?.header && (i.label = r.header);
|
|
114
|
+
let a = t[e];
|
|
115
|
+
return a != null && (i.width = a), i;
|
|
116
|
+
}) });
|
|
117
|
+
}, [
|
|
118
|
+
M,
|
|
119
|
+
g?.columns,
|
|
120
|
+
O
|
|
121
|
+
]), se = s((e, t) => {
|
|
122
|
+
A((n) => ({
|
|
123
|
+
...n,
|
|
124
|
+
[e]: t
|
|
125
|
+
}));
|
|
126
|
+
}, []), ce = s((e, t) => {
|
|
127
|
+
let n = {
|
|
128
|
+
...k,
|
|
129
|
+
[e]: t
|
|
130
|
+
};
|
|
131
|
+
A(n), P(j ?? M.map((e) => e.key), n);
|
|
132
|
+
}, [
|
|
133
|
+
k,
|
|
134
|
+
j,
|
|
135
|
+
M,
|
|
136
|
+
P
|
|
137
|
+
]), le = s((e, t) => {
|
|
138
|
+
let n = j ?? M.map((e) => e.key), r = n.indexOf(e);
|
|
139
|
+
if (r < 0 || e === t) return;
|
|
140
|
+
let i = [...n];
|
|
141
|
+
i.splice(r, 1);
|
|
142
|
+
let a = i.indexOf(t);
|
|
143
|
+
a < 0 || (i.splice(a, 0, e), oe(i), P(i, k));
|
|
144
|
+
}, [
|
|
145
|
+
j,
|
|
146
|
+
M,
|
|
147
|
+
k,
|
|
148
|
+
P
|
|
149
|
+
]), F = l(() => {
|
|
84
150
|
let e = {};
|
|
85
|
-
return
|
|
151
|
+
return g?.columns?.forEach((t) => {
|
|
86
152
|
t.format && (t.key || t.field) && (e[t.key || t.field || ""] = { type: t.format });
|
|
87
153
|
}), e;
|
|
88
|
-
}, [
|
|
154
|
+
}, [g?.columns]), ue = l(() => {
|
|
89
155
|
let e = {};
|
|
90
|
-
return
|
|
156
|
+
return g?.columns?.forEach((t) => {
|
|
91
157
|
let n = t.key || t.field;
|
|
92
158
|
n && t.cellChart && (e[n] = t.cellChart);
|
|
93
159
|
}), e;
|
|
94
|
-
}, [
|
|
160
|
+
}, [g?.columns]), I = g?.conditionalRules, L = l(() => {
|
|
95
161
|
let e = {};
|
|
96
|
-
return
|
|
162
|
+
return g?.columns?.forEach((t) => {
|
|
97
163
|
let n = t.key || t.field;
|
|
98
164
|
n && t.conditionalRules?.length && (e[n] = t.conditionalRules);
|
|
99
165
|
}), e;
|
|
100
|
-
}, [
|
|
166
|
+
}, [g?.columns]), R = l(() => {
|
|
101
167
|
let e = {};
|
|
102
|
-
return
|
|
168
|
+
return g?.columns?.forEach((t) => {
|
|
103
169
|
let n = t.key || t.field;
|
|
104
170
|
n && t.total && t.total !== "none" && (e[n] = t.total);
|
|
105
171
|
}), e;
|
|
106
|
-
}, [
|
|
107
|
-
let e =
|
|
108
|
-
return
|
|
172
|
+
}, [g?.columns]), z = g?.showTotals === !0 || Object.keys(R).length > 0, B = l(() => {
|
|
173
|
+
let e = _;
|
|
174
|
+
return g?.showSearch !== !1 && (e = re(e, C, N)), e = ne(e, x), e;
|
|
109
175
|
}, [
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
]),
|
|
176
|
+
_,
|
|
177
|
+
C,
|
|
178
|
+
x,
|
|
179
|
+
N,
|
|
180
|
+
g?.showSearch
|
|
181
|
+
]), V = l(() => {
|
|
116
182
|
let e = {};
|
|
117
|
-
for (let t of
|
|
183
|
+
for (let t of N) {
|
|
118
184
|
let n = 0;
|
|
119
|
-
for (let e of
|
|
185
|
+
for (let e of B) {
|
|
120
186
|
let r = e[t.key];
|
|
121
187
|
typeof r == "number" && Number.isFinite(r) && (n = Math.max(n, Math.abs(r)));
|
|
122
188
|
}
|
|
123
189
|
e[t.key] = n;
|
|
124
190
|
}
|
|
125
191
|
return e;
|
|
126
|
-
}, [
|
|
127
|
-
if (!
|
|
192
|
+
}, [N, B]), H = l(() => {
|
|
193
|
+
if (!z) return {};
|
|
128
194
|
let e = {};
|
|
129
|
-
for (let t of
|
|
130
|
-
let n =
|
|
195
|
+
for (let t of N) {
|
|
196
|
+
let n = R[t.key];
|
|
131
197
|
if (!n) {
|
|
132
198
|
e[t.key] = null;
|
|
133
199
|
continue;
|
|
134
200
|
}
|
|
135
|
-
let r =
|
|
136
|
-
n === "count" ? e[t.key] =
|
|
201
|
+
let r = B.map((e) => e[t.key]).filter((e) => typeof e == "number" && Number.isFinite(e));
|
|
202
|
+
n === "count" ? e[t.key] = B.length : r.length === 0 ? e[t.key] = null : n === "sum" ? e[t.key] = r.reduce((e, t) => e + t, 0) : n === "avg" ? e[t.key] = r.reduce((e, t) => e + t, 0) / r.length : n === "min" ? e[t.key] = Math.min(...r) : n === "max" ? e[t.key] = Math.max(...r) : e[t.key] = null;
|
|
137
203
|
}
|
|
138
204
|
return e;
|
|
139
205
|
}, [
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
206
|
+
z,
|
|
207
|
+
N,
|
|
208
|
+
R,
|
|
209
|
+
B
|
|
144
210
|
]);
|
|
145
|
-
|
|
146
|
-
|
|
211
|
+
l(() => {
|
|
212
|
+
E((e) => ({
|
|
147
213
|
...e,
|
|
148
|
-
totalItems:
|
|
214
|
+
totalItems: B.length
|
|
149
215
|
}));
|
|
150
|
-
}, [
|
|
151
|
-
let
|
|
152
|
-
if (
|
|
153
|
-
let e =
|
|
154
|
-
return
|
|
216
|
+
}, [B.length]);
|
|
217
|
+
let U = l(() => {
|
|
218
|
+
if (g?.showPagination === !1) return B;
|
|
219
|
+
let e = T.page * T.pageSize;
|
|
220
|
+
return B.slice(e, e + T.pageSize);
|
|
155
221
|
}, [
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
]),
|
|
160
|
-
|
|
161
|
-
if (!
|
|
162
|
-
let e =
|
|
222
|
+
B,
|
|
223
|
+
T,
|
|
224
|
+
g?.showPagination
|
|
225
|
+
]), W = g?.virtualized === !0, G = g?.rowHeight && g.rowHeight > 0 ? g.rowHeight : 44, K = te(null), [q, de] = u(0), [J, Y] = u(0);
|
|
226
|
+
c(() => {
|
|
227
|
+
if (!W) return;
|
|
228
|
+
let e = K.current;
|
|
163
229
|
if (!e) return;
|
|
164
|
-
|
|
165
|
-
let t = typeof ResizeObserver < "u" ? new ResizeObserver(() =>
|
|
230
|
+
Y(e.clientHeight);
|
|
231
|
+
let t = typeof ResizeObserver < "u" ? new ResizeObserver(() => Y(e.clientHeight)) : void 0;
|
|
166
232
|
return t?.observe(e), () => t?.disconnect();
|
|
167
|
-
}, [
|
|
168
|
-
let
|
|
169
|
-
if (!
|
|
170
|
-
let e =
|
|
233
|
+
}, [W]);
|
|
234
|
+
let X = l(() => {
|
|
235
|
+
if (!W) return null;
|
|
236
|
+
let e = B.length, t = J > 0 ? Math.ceil(J / G) : 20, n = Math.max(0, Math.floor(q / G) - 6), r = Math.min(e, n + t + 12);
|
|
171
237
|
return {
|
|
172
|
-
rows:
|
|
173
|
-
topSpacer: n *
|
|
174
|
-
bottomSpacer: Math.max(0, (e - r) *
|
|
238
|
+
rows: B.slice(n, r),
|
|
239
|
+
topSpacer: n * G,
|
|
240
|
+
bottomSpacer: Math.max(0, (e - r) * G),
|
|
175
241
|
startIndex: n
|
|
176
242
|
};
|
|
177
243
|
}, [
|
|
178
|
-
V,
|
|
179
|
-
L,
|
|
180
|
-
K,
|
|
181
244
|
W,
|
|
182
|
-
|
|
183
|
-
|
|
245
|
+
B,
|
|
246
|
+
J,
|
|
247
|
+
q,
|
|
248
|
+
G
|
|
249
|
+
]), fe = W && X ? X.rows : U, pe = W && X ? X.startIndex : 0, Z = g?.frozenColumns && g.frozenColumns > 0 ? g.frozenColumns : 0, { displayColumns: Q, frozenLefts: $ } = l(() => {
|
|
184
250
|
if (Z <= 0) return {
|
|
185
|
-
displayColumns:
|
|
251
|
+
displayColumns: N,
|
|
186
252
|
frozenLefts: {}
|
|
187
253
|
};
|
|
188
254
|
let e = {}, t = 0;
|
|
189
255
|
return {
|
|
190
|
-
displayColumns:
|
|
256
|
+
displayColumns: N.map((n, r) => {
|
|
191
257
|
if (r < Z) {
|
|
192
258
|
let r = n.width && parseInt(n.width, 10) || 160;
|
|
193
259
|
return e[n.key] = t, t += r, {
|
|
@@ -199,8 +265,8 @@ var h = a(function({ widget: a, data: h = [], onRowClick: g, onDrilldown: _ }) {
|
|
|
199
265
|
}),
|
|
200
266
|
frozenLefts: e
|
|
201
267
|
};
|
|
202
|
-
}, [
|
|
203
|
-
|
|
268
|
+
}, [N, Z]), me = s((e) => {
|
|
269
|
+
S((t) => {
|
|
204
270
|
if (t.column !== e) return {
|
|
205
271
|
column: e,
|
|
206
272
|
direction: "asc"
|
|
@@ -211,55 +277,55 @@ var h = a(function({ widget: a, data: h = [], onRowClick: g, onDrilldown: _ }) {
|
|
|
211
277
|
direction: n
|
|
212
278
|
};
|
|
213
279
|
});
|
|
214
|
-
}, []),
|
|
215
|
-
|
|
280
|
+
}, []), he = s((e) => {
|
|
281
|
+
E((t) => ({
|
|
216
282
|
...t,
|
|
217
283
|
page: e
|
|
218
284
|
}));
|
|
219
|
-
}, []),
|
|
220
|
-
|
|
285
|
+
}, []), ge = s((e) => {
|
|
286
|
+
E((t) => ({
|
|
221
287
|
...t,
|
|
222
288
|
pageSize: e,
|
|
223
289
|
page: 0
|
|
224
290
|
}));
|
|
225
|
-
}, []),
|
|
226
|
-
let n =
|
|
227
|
-
if (
|
|
228
|
-
let t =
|
|
229
|
-
|
|
291
|
+
}, []), _e = s((e, t) => {
|
|
292
|
+
let n = g?.crossFilterMappings?.length || g?.enableCrossFilter;
|
|
293
|
+
if (y && n) {
|
|
294
|
+
let t = N[0]?.key;
|
|
295
|
+
v(e, t ? String(e[t]) : void 0);
|
|
230
296
|
}
|
|
231
|
-
|
|
297
|
+
h ? h(e) : m && o.drilldowns?.length && m(e, t);
|
|
232
298
|
}, [
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
]),
|
|
242
|
-
let e = [
|
|
299
|
+
m,
|
|
300
|
+
h,
|
|
301
|
+
o.drilldowns,
|
|
302
|
+
y,
|
|
303
|
+
v,
|
|
304
|
+
N,
|
|
305
|
+
g?.crossFilterMappings,
|
|
306
|
+
g?.enableCrossFilter
|
|
307
|
+
]), ve = s(() => {
|
|
308
|
+
let e = [N.map((e) => e.header).join(","), ...B.map((e) => N.map((t) => {
|
|
243
309
|
let n = e[t.key];
|
|
244
310
|
if (n == null) return "";
|
|
245
311
|
let r = String(n);
|
|
246
312
|
return r.includes(",") || r.includes("\"") ? `"${r.replace(/"/g, "\"\"")}"` : r;
|
|
247
313
|
}).join(","))].join("\n"), t = new Blob([e], { type: "text/csv" }), n = URL.createObjectURL(t), r = document.createElement("a");
|
|
248
|
-
r.href = n, r.download = `${
|
|
314
|
+
r.href = n, r.download = `${o.title || "table"}-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.csv`, r.click(), URL.revokeObjectURL(n);
|
|
249
315
|
}, [
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
]),
|
|
316
|
+
N,
|
|
317
|
+
B,
|
|
318
|
+
o.title
|
|
319
|
+
]), ye = g?.crossFilterMappings?.length || g?.enableCrossFilter, be = !!(h || m && o.drilldowns?.length || ye);
|
|
254
320
|
return /* @__PURE__ */ f("div", {
|
|
255
321
|
className: "flex flex-col h-full",
|
|
256
322
|
children: [
|
|
257
|
-
|
|
323
|
+
ae && /* @__PURE__ */ d("div", {
|
|
258
324
|
className: "flex items-center gap-2 px-3 py-2 border-b border-border-default",
|
|
259
325
|
children: /* @__PURE__ */ f("button", {
|
|
260
326
|
type: "button",
|
|
261
327
|
onClick: (e) => {
|
|
262
|
-
e.stopPropagation(),
|
|
328
|
+
e.stopPropagation(), b();
|
|
263
329
|
},
|
|
264
330
|
className: "\n inline-flex items-center gap-1.5\n px-2.5 py-1 rounded-md\n text-xs font-medium\n bg-action-primary-bg/10 text-action-primary-text\n hover:bg-action-primary-bg/20\n transition-colors\n ",
|
|
265
331
|
children: [/* @__PURE__ */ d("svg", {
|
|
@@ -276,9 +342,9 @@ var h = a(function({ widget: a, data: h = [], onRowClick: g, onDrilldown: _ }) {
|
|
|
276
342
|
}), "Clear Filter"]
|
|
277
343
|
})
|
|
278
344
|
}),
|
|
279
|
-
(
|
|
345
|
+
(g?.showSearch !== !1 || g?.showExport !== !1) && /* @__PURE__ */ f("div", {
|
|
280
346
|
className: "flex items-center justify-between p-3 border-b border-border-default",
|
|
281
|
-
children: [
|
|
347
|
+
children: [g?.showSearch !== !1 && /* @__PURE__ */ f("div", {
|
|
282
348
|
className: "relative flex items-center",
|
|
283
349
|
children: [/* @__PURE__ */ d("svg", {
|
|
284
350
|
className: "absolute left-3 w-4 h-4 text-text-secondary pointer-events-none",
|
|
@@ -294,13 +360,13 @@ var h = a(function({ widget: a, data: h = [], onRowClick: g, onDrilldown: _ }) {
|
|
|
294
360
|
}), /* @__PURE__ */ d("input", {
|
|
295
361
|
type: "text",
|
|
296
362
|
placeholder: "Search products...",
|
|
297
|
-
value:
|
|
298
|
-
onChange: (e) =>
|
|
363
|
+
value: C,
|
|
364
|
+
onChange: (e) => w(e.target.value),
|
|
299
365
|
className: "\n pl-10 pr-4 py-2\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg focus:border-action-primary-bg\n w-48 sm:w-64\n placeholder:text-text-tertiary\n "
|
|
300
366
|
})]
|
|
301
|
-
}),
|
|
367
|
+
}), g?.showExport !== !1 && /* @__PURE__ */ f("button", {
|
|
302
368
|
type: "button",
|
|
303
|
-
onClick:
|
|
369
|
+
onClick: ve,
|
|
304
370
|
className: "\n inline-flex items-center gap-2\n px-3 py-2\n text-sm font-medium\n text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n hover:bg-bg-muted\n transition-colors\n ",
|
|
305
371
|
children: [/* @__PURE__ */ d("svg", {
|
|
306
372
|
className: "w-4 h-4",
|
|
@@ -317,22 +383,26 @@ var h = a(function({ widget: a, data: h = [], onRowClick: g, onDrilldown: _ }) {
|
|
|
317
383
|
})]
|
|
318
384
|
}),
|
|
319
385
|
/* @__PURE__ */ f("div", {
|
|
320
|
-
ref:
|
|
386
|
+
ref: K,
|
|
321
387
|
className: "flex-1 overflow-auto",
|
|
322
|
-
onScroll:
|
|
388
|
+
onScroll: W ? (e) => de(e.target.scrollTop) : void 0,
|
|
323
389
|
children: [/* @__PURE__ */ f("table", {
|
|
324
390
|
className: "w-full",
|
|
325
391
|
children: [
|
|
326
|
-
/* @__PURE__ */ d(
|
|
392
|
+
/* @__PURE__ */ d(i, {
|
|
327
393
|
columns: Q,
|
|
328
|
-
sortState:
|
|
329
|
-
onSort:
|
|
330
|
-
frozenLefts: Z > 0 ? $ : void 0
|
|
394
|
+
sortState: x,
|
|
395
|
+
onSort: me,
|
|
396
|
+
frozenLefts: Z > 0 ? $ : void 0,
|
|
397
|
+
editable: D,
|
|
398
|
+
onColumnResize: D ? se : void 0,
|
|
399
|
+
onColumnResizeEnd: D ? ce : void 0,
|
|
400
|
+
onColumnReorder: D ? le : void 0
|
|
331
401
|
}),
|
|
332
402
|
/* @__PURE__ */ f("tbody", { children: [
|
|
333
|
-
|
|
403
|
+
W && X && X.topSpacer > 0 && /* @__PURE__ */ d("tr", {
|
|
334
404
|
"aria-hidden": "true",
|
|
335
|
-
style: { height:
|
|
405
|
+
style: { height: X.topSpacer },
|
|
336
406
|
children: /* @__PURE__ */ d("td", {
|
|
337
407
|
colSpan: Q.length,
|
|
338
408
|
style: {
|
|
@@ -341,30 +411,30 @@ var h = a(function({ widget: a, data: h = [], onRowClick: g, onDrilldown: _ }) {
|
|
|
341
411
|
}
|
|
342
412
|
})
|
|
343
413
|
}),
|
|
344
|
-
|
|
345
|
-
let n =
|
|
414
|
+
fe.map((e, t) => {
|
|
415
|
+
let n = pe + t;
|
|
346
416
|
return /* @__PURE__ */ d("tr", {
|
|
347
417
|
className: `
|
|
348
|
-
${
|
|
418
|
+
${be ? "cursor-pointer hover:bg-bg-muted/50" : ""}
|
|
349
419
|
${n % 2 == 0 ? "bg-bg-surface" : "bg-bg-muted/30"}
|
|
350
420
|
`,
|
|
351
|
-
style:
|
|
352
|
-
onClick: () =>
|
|
353
|
-
children: Q.map((t) => /* @__PURE__ */ d(
|
|
421
|
+
style: W ? { height: G } : void 0,
|
|
422
|
+
onClick: () => _e(e, n),
|
|
423
|
+
children: Q.map((t) => /* @__PURE__ */ d(a, {
|
|
354
424
|
value: e[t.key],
|
|
355
425
|
column: t,
|
|
356
|
-
format:
|
|
426
|
+
format: F[t.key],
|
|
357
427
|
rowData: e,
|
|
358
|
-
conditionalRules:
|
|
359
|
-
dataBarMax:
|
|
428
|
+
conditionalRules: L[t.key] ?? I,
|
|
429
|
+
dataBarMax: V[t.key],
|
|
360
430
|
stickyLeft: $[t.key],
|
|
361
|
-
cellChart:
|
|
431
|
+
cellChart: ue[t.key]
|
|
362
432
|
}, t.key))
|
|
363
433
|
}, n);
|
|
364
434
|
}),
|
|
365
|
-
|
|
435
|
+
W && X && X.bottomSpacer > 0 && /* @__PURE__ */ d("tr", {
|
|
366
436
|
"aria-hidden": "true",
|
|
367
|
-
style: { height:
|
|
437
|
+
style: { height: X.bottomSpacer },
|
|
368
438
|
children: /* @__PURE__ */ d("td", {
|
|
369
439
|
colSpan: Q.length,
|
|
370
440
|
style: {
|
|
@@ -374,10 +444,10 @@ var h = a(function({ widget: a, data: h = [], onRowClick: g, onDrilldown: _ }) {
|
|
|
374
444
|
})
|
|
375
445
|
})
|
|
376
446
|
] }),
|
|
377
|
-
|
|
447
|
+
z && B.length > 0 && /* @__PURE__ */ d("tfoot", { children: /* @__PURE__ */ d("tr", {
|
|
378
448
|
className: "bg-bg-muted/50 font-semibold border-t-2 border-border-default",
|
|
379
449
|
children: Q.map((e, t) => {
|
|
380
|
-
let n =
|
|
450
|
+
let n = H[e.key], r = F[e.key], i = $[e.key];
|
|
381
451
|
return /* @__PURE__ */ d("td", {
|
|
382
452
|
className: `
|
|
383
453
|
px-4 py-3 text-sm text-text-primary
|
|
@@ -386,28 +456,28 @@ var h = a(function({ widget: a, data: h = [], onRowClick: g, onDrilldown: _ }) {
|
|
|
386
456
|
${i == null ? "" : "sticky z-10 bg-bg-muted"}
|
|
387
457
|
`,
|
|
388
458
|
style: i == null ? void 0 : { left: i },
|
|
389
|
-
children: n == null ? t === 0 ? "Total" : "" :
|
|
459
|
+
children: n == null ? t === 0 ? "Total" : "" : ie(n, r?.type, r?.currency)
|
|
390
460
|
}, e.key);
|
|
391
461
|
})
|
|
392
462
|
}) })
|
|
393
463
|
]
|
|
394
|
-
}),
|
|
464
|
+
}), B.length === 0 && /* @__PURE__ */ d("div", {
|
|
395
465
|
className: "flex items-center justify-center py-12 text-text-secondary",
|
|
396
|
-
children:
|
|
466
|
+
children: C ? "No matching records found" : "No data available"
|
|
397
467
|
})]
|
|
398
468
|
}),
|
|
399
|
-
!
|
|
469
|
+
!W && g?.showPagination !== !1 && B.length > 0 && /* @__PURE__ */ d(ee, {
|
|
400
470
|
pagination: {
|
|
401
|
-
...
|
|
402
|
-
totalItems:
|
|
471
|
+
...T,
|
|
472
|
+
totalItems: B.length
|
|
403
473
|
},
|
|
404
|
-
onPageChange:
|
|
405
|
-
onPageSizeChange:
|
|
474
|
+
onPageChange: he,
|
|
475
|
+
onPageSizeChange: ge
|
|
406
476
|
})
|
|
407
477
|
]
|
|
408
478
|
});
|
|
409
479
|
});
|
|
410
480
|
//#endregion
|
|
411
|
-
export {
|
|
481
|
+
export { p as default };
|
|
412
482
|
|
|
413
483
|
//# sourceMappingURL=TableWidget.js.map
|