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