@memobit/libs 3.18.0 → 3.19.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/README.md +1 -1
- package/dist/components/AnalogClock/AnalogClock.css +1 -1
- package/dist/components/Calendar/Calendar.css +1 -1
- package/dist/components/DataView/DataView.CardView.js +58 -55
- package/dist/components/DataView/DataView.TableView.js +171 -0
- package/dist/components/DataView/DataView.css +1 -1
- package/dist/components/DataView/DataView.helpers.js +17 -15
- package/dist/components/DataView/DataView2.js +251 -358
- package/dist/components/DatePicker/DatePicker.css +1 -1
- package/dist/components/MiniStatsCard/MiniStatsCard2.js +28 -21
- package/dist/components/RollingNumber/RollingNumber.css +1 -1
- package/dist/components/RollingNumber/RollingNumber.helpers.js +7 -0
- package/dist/components/RollingNumber/RollingNumber2.js +34 -35
- package/dist/components/Stats/Stats2.js +23 -16
- package/dist/components/TimePicker/TimePicker.css +1 -1
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/hooks/useListMotion/ListMotion.css +1 -0
- package/dist/hooks/useListMotion/useHighlight.js +16 -0
- package/dist/hooks/useListMotion/useListMotion.js +229 -0
- package/dist/index.d.ts +57 -1
- package/dist/index.js +303 -298
- package/dist/styles/effects.scss +4 -4
- package/dist/styles/variables.scss +20 -0
- package/dist/version.js +2 -2
- package/dist/version.json +4 -4
- package/package.json +1 -1
|
@@ -1,441 +1,334 @@
|
|
|
1
1
|
import './DataView.css';
|
|
2
|
-
import { Icon as
|
|
2
|
+
import { Icon as ut } from "../Icon/Icon2.js";
|
|
3
3
|
import { Button as ft } from "../Button/Button2.js";
|
|
4
|
-
import { Tooltip as
|
|
5
|
-
import { Checkbox as
|
|
6
|
-
import { Dropdown as
|
|
4
|
+
import { Tooltip as mt } from "../Tooltip/Tooltip2.js";
|
|
5
|
+
import { Checkbox as pt } from "../Checkbox/Checkbox2.js";
|
|
6
|
+
import { Dropdown as ht } from "../Dropdown/Dropdown2.js";
|
|
7
7
|
import { useBreakpoint as vt } from "../../hooks/useBreakpoint.js";
|
|
8
|
-
import { getResultsCount as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { DEFAULT_PAGE_SIZES as
|
|
14
|
-
import { CardView as
|
|
15
|
-
import { DataViewColumnSelector as
|
|
16
|
-
import { DataViewMiniSort as
|
|
8
|
+
import { getResultsCount as gt } from "../../helpers/Pagination.js";
|
|
9
|
+
import { useListMotion as wt } from "../../hooks/useListMotion/useListMotion.js";
|
|
10
|
+
import { EmptyState as bt } from "../EmptyState/EmptyState2.js";
|
|
11
|
+
import { Pagination as St } from "../Pagination/Pagination2.js";
|
|
12
|
+
import { calculateTimelineMarkers as yt } from "../TimelineMarkers/calculateTimelineMarkers.js";
|
|
13
|
+
import { DEFAULT_PAGE_SIZES as Ee, getColumnLabel as Ct } from "./DataView.helpers.js";
|
|
14
|
+
import { CardView as _t } from "./DataView.CardView.js";
|
|
15
|
+
import { DataViewColumnSelector as kt } from "./DataView.ColumnSelector.js";
|
|
16
|
+
import { DataViewMiniSort as Mt } from "./DataView.MiniSort.js";
|
|
17
|
+
import { TableView as Nt } from "./DataView.TableView.js";
|
|
17
18
|
/* empty css */
|
|
18
|
-
import
|
|
19
|
-
import { Fragment as
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const { isMobile: we } = vt(), [qe, Je] = P(Re), [Qe, Ye] = P(ze), [He, et] = P([]), f = ce ?? He, [tt, at] = P(1), nt = ve ?? tt, [T, ge] = P(Be), [M, it] = P(() => h.reduce((e, a) => (a.width && (e[a.key] = a.width), e), {})), [be, st] = P(/* @__PURE__ */ new Set()), ke = (e) => {
|
|
28
|
-
st((a) => {
|
|
29
|
-
const s = new Set(a);
|
|
19
|
+
import { useCallback as Ge, useEffect as Tt, useMemo as E, useRef as De, useState as C } from "react";
|
|
20
|
+
import { Fragment as Et, jsx as r, jsxs as _ } from "react/jsx-runtime";
|
|
21
|
+
function Ht({ columns: l, data: L, rowKey: F, pinnedIds: p, selectable: G = !1, onSelectionChange: Pe, selectedIds: I, pageSizeOptions: Ve = Ee, initialPageSize: Le = Ee[1], showPageSize: U = !0, card: Re, actions: ee, actionsWidth: xe, timeline: h, onRowClick: te, rowHref: oe, rowClassName: ne, rowDetail: Ae, empty: se, initialSortKey: $e = null, initialSortDirection: Be = "asc", sortKey: W, sortDirection: re, onSortChange: ze, miniSort: R, showCardSortControls: Fe = !0, desktopView: ie = "table", cardMaxWidth: Ue, className: k, onPageChange: ae, onPageSizeChange: We, currentPage: K, totalItems: le, group: i, showResultsCount: Ke = !0, totalCount: Xe, itemNoun: je, columnSelector: X, animateChanges: Oe = !0, highlightIds: v }) {
|
|
22
|
+
const { isMobile: ce } = vt(), x = De(null), A = wt(x, {
|
|
23
|
+
enabled: Oe && F !== void 0,
|
|
24
|
+
highlightKeys: v
|
|
25
|
+
}), [Ze, qe] = C($e), [He, Je] = C(Be), [Qe, Ye] = C([]), f = I ?? Qe, [Ie, et] = C(1), j = K ?? Ie, [g, tt] = C(Le), [de, ot] = C(() => l.reduce((e, t) => (t.width && (e[t.key] = t.width), e), {})), [ue, nt] = C(/* @__PURE__ */ new Set()), fe = (e) => {
|
|
26
|
+
A.forceNext(), nt((t) => {
|
|
27
|
+
const s = new Set(t);
|
|
30
28
|
return s.has(e) ? s.delete(e) : s.add(e), s;
|
|
31
29
|
});
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
|
|
30
|
+
}, c = Ge((e, t) => F?.(e, t) ?? t, [F]), D = Ge((e) => {
|
|
31
|
+
e !== j && A.skipNext(), K === void 0 && et(e), ae?.(e);
|
|
32
|
+
}, [
|
|
33
|
+
K,
|
|
34
|
+
j,
|
|
35
|
+
A,
|
|
36
|
+
ae
|
|
37
|
+
]), d = W !== void 0 ? W : Ze, u = re ?? He, M = (e, t) => {
|
|
38
|
+
W === void 0 && qe(e), re === void 0 && Je(t), ze?.({
|
|
36
39
|
key: e,
|
|
37
|
-
direction:
|
|
38
|
-
}),
|
|
39
|
-
},
|
|
40
|
-
let e =
|
|
41
|
-
if (
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
return typeof
|
|
47
|
-
}),
|
|
48
|
-
const
|
|
49
|
-
return typeof
|
|
40
|
+
direction: t
|
|
41
|
+
}), D(1);
|
|
42
|
+
}, $ = E(() => new Set(p ?? []), [p]), O = E(() => {
|
|
43
|
+
let e = L;
|
|
44
|
+
if (d) {
|
|
45
|
+
const o = l.find((n) => n.key === d);
|
|
46
|
+
if (o) {
|
|
47
|
+
const n = o.sortAccessor || o.accessor || ((P) => {
|
|
48
|
+
const S = P[o.key];
|
|
49
|
+
return typeof S == "string" || typeof S == "number" ? S : "";
|
|
50
|
+
}), a = [...L].sort((P, S) => {
|
|
51
|
+
const V = n(P), y = n(S);
|
|
52
|
+
return typeof V == "number" && typeof y == "number" ? V - y : String(V).localeCompare(String(y));
|
|
50
53
|
});
|
|
51
|
-
e =
|
|
54
|
+
e = u === "asc" ? a : a.reverse();
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
|
-
if (
|
|
55
|
-
const
|
|
56
|
-
if (e.forEach((
|
|
57
|
-
|
|
58
|
-
}),
|
|
59
|
-
const
|
|
60
|
-
|
|
57
|
+
if ($.size === 0) return e;
|
|
58
|
+
const t = [], s = [];
|
|
59
|
+
if (e.forEach((o, n) => {
|
|
60
|
+
$.has(c(o, n)) ? t.push(o) : s.push(o);
|
|
61
|
+
}), p && p.length > 1 && t.length > 1) {
|
|
62
|
+
const o = new Map(p.map((n, a) => [n, a]));
|
|
63
|
+
t.sort((n, a) => (o.get(c(n, 0)) ?? 0) - (o.get(c(a, 0)) ?? 0));
|
|
61
64
|
}
|
|
62
|
-
return [...
|
|
65
|
+
return [...t, ...s];
|
|
63
66
|
}, [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
l,
|
|
68
|
+
L,
|
|
69
|
+
u,
|
|
70
|
+
d,
|
|
71
|
+
$,
|
|
67
72
|
p,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const i = o.groupBy(n), r = e.get(i);
|
|
76
|
-
r ? r.push(n) : (e.set(i, [n]), a.push(i));
|
|
73
|
+
c
|
|
74
|
+
]), N = le !== void 0, w = E(() => {
|
|
75
|
+
if (!i || N) return O;
|
|
76
|
+
const e = /* @__PURE__ */ new Map(), t = [];
|
|
77
|
+
O.forEach((o) => {
|
|
78
|
+
const n = i.groupBy(o), a = e.get(n);
|
|
79
|
+
a ? a.push(o) : (e.set(n, [o]), t.push(n));
|
|
77
80
|
});
|
|
78
|
-
const s =
|
|
79
|
-
const
|
|
81
|
+
const s = t.map((o) => {
|
|
82
|
+
const n = e.get(o);
|
|
80
83
|
return {
|
|
81
|
-
key:
|
|
82
|
-
label:
|
|
83
|
-
items:
|
|
84
|
-
totalCount:
|
|
84
|
+
key: o,
|
|
85
|
+
label: i.groupLabel(o),
|
|
86
|
+
items: n,
|
|
87
|
+
totalCount: n.length
|
|
85
88
|
};
|
|
86
89
|
});
|
|
87
|
-
return
|
|
90
|
+
return i.sortGroups ? s.sort(i.sortGroups) : s.sort((o, n) => o.key === null ? 1 : n.key === null ? -1 : 0), s.flatMap((o) => o.items);
|
|
88
91
|
}, [
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
]), B =
|
|
93
|
-
|
|
92
|
+
i,
|
|
93
|
+
N,
|
|
94
|
+
O
|
|
95
|
+
]), B = N ? le : w.length, me = Math.max(1, Math.ceil(B / g)), T = Math.min(j, me), b = N ? w : w.slice((T - 1) * g, T * g), pe = De(void 0);
|
|
96
|
+
Tt(() => {
|
|
97
|
+
if (!v || v.length === 0 || N || pe.current === v) return;
|
|
98
|
+
const e = w.findIndex((s, o) => v.includes(c(s, o)));
|
|
99
|
+
if (e === -1) return;
|
|
100
|
+
pe.current = v;
|
|
101
|
+
const t = Math.floor(e / g) + 1;
|
|
102
|
+
t !== T && D(t);
|
|
103
|
+
}, [
|
|
104
|
+
D,
|
|
105
|
+
v,
|
|
106
|
+
N,
|
|
107
|
+
w,
|
|
108
|
+
g,
|
|
109
|
+
c,
|
|
110
|
+
T
|
|
111
|
+
]);
|
|
112
|
+
const Z = Ke ? gt(g, B, Xe ?? B, T, je) : null, q = E(() => {
|
|
113
|
+
if (!i) return null;
|
|
94
114
|
const e = /* @__PURE__ */ new Map();
|
|
95
|
-
return
|
|
96
|
-
const s =
|
|
115
|
+
return w.forEach((t) => {
|
|
116
|
+
const s = i.groupBy(t);
|
|
97
117
|
e.set(s, (e.get(s) ?? 0) + 1);
|
|
98
118
|
}), e;
|
|
99
|
-
}, [
|
|
100
|
-
if (!
|
|
101
|
-
const e = /* @__PURE__ */ new Map(),
|
|
102
|
-
b.forEach((
|
|
103
|
-
const
|
|
104
|
-
|
|
119
|
+
}, [i, w]), he = E(() => {
|
|
120
|
+
if (!i || !q) return null;
|
|
121
|
+
const e = /* @__PURE__ */ new Map(), t = [];
|
|
122
|
+
b.forEach((o) => {
|
|
123
|
+
const n = i.groupBy(o), a = e.get(n);
|
|
124
|
+
a ? a.push(o) : (e.set(n, [o]), t.push(n));
|
|
105
125
|
});
|
|
106
|
-
const s =
|
|
107
|
-
key:
|
|
108
|
-
label:
|
|
109
|
-
items: e.get(
|
|
110
|
-
totalCount:
|
|
126
|
+
const s = t.map((o) => ({
|
|
127
|
+
key: o,
|
|
128
|
+
label: i.groupLabel(o),
|
|
129
|
+
items: e.get(o),
|
|
130
|
+
totalCount: q.get(o) ?? 0
|
|
111
131
|
}));
|
|
112
|
-
return
|
|
132
|
+
return i.sortGroups ? s.sort(i.sortGroups) : s.sort((o, n) => o.key === null ? 1 : n.key === null ? -1 : 0), s;
|
|
113
133
|
}, [
|
|
114
|
-
|
|
115
|
-
|
|
134
|
+
i,
|
|
135
|
+
q,
|
|
116
136
|
b
|
|
117
|
-
]),
|
|
118
|
-
if (!
|
|
119
|
-
const e = b.map((
|
|
120
|
-
id:
|
|
121
|
-
date:
|
|
137
|
+
]), ve = E(() => {
|
|
138
|
+
if (!h) return /* @__PURE__ */ new Map();
|
|
139
|
+
const e = b.map((t) => ({
|
|
140
|
+
id: h.idAccessor(t),
|
|
141
|
+
date: h.dateAccessor(t)
|
|
122
142
|
}));
|
|
123
|
-
return
|
|
124
|
-
}, [b,
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
},
|
|
143
|
+
return yt(e, h.granularity);
|
|
144
|
+
}, [b, h]), z = (e) => {
|
|
145
|
+
I === void 0 && Ye(e), Pe?.(L.filter((t, s) => e.includes(c(t, s))));
|
|
146
|
+
}, ge = (e, t) => {
|
|
147
|
+
z(t ? [...f, e] : f.filter((s) => s !== e));
|
|
148
|
+
}, st = (e) => {
|
|
149
|
+
e.sortable && (d === e.key ? M(e.key, u === "asc" ? "desc" : "asc") : M(e.key, "asc"));
|
|
150
|
+
}, rt = (e, t) => {
|
|
129
151
|
e.preventDefault();
|
|
130
|
-
const s = e.clientX,
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
...
|
|
134
|
-
[
|
|
152
|
+
const s = e.clientX, o = de[t] ?? 150, n = (P) => {
|
|
153
|
+
const S = P.clientX - s, V = l.find((y) => y.key === t)?.minWidth ?? 120;
|
|
154
|
+
ot((y) => ({
|
|
155
|
+
...y,
|
|
156
|
+
[t]: Math.max(V, o + S)
|
|
135
157
|
}));
|
|
136
|
-
},
|
|
137
|
-
window.removeEventListener("mousemove",
|
|
158
|
+
}, a = () => {
|
|
159
|
+
window.removeEventListener("mousemove", n), window.removeEventListener("mouseup", a);
|
|
138
160
|
};
|
|
139
|
-
window.addEventListener("mousemove",
|
|
140
|
-
},
|
|
141
|
-
label:
|
|
161
|
+
window.addEventListener("mousemove", n), window.addEventListener("mouseup", a);
|
|
162
|
+
}, we = l.some((e) => e.filter), H = l.filter((e) => e.sortable), it = H.map((e) => ({
|
|
163
|
+
label: Ct(e),
|
|
142
164
|
value: e.key
|
|
143
|
-
})),
|
|
144
|
-
columns:
|
|
145
|
-
config:
|
|
146
|
-
sortKey:
|
|
147
|
-
sortDirection:
|
|
148
|
-
onSort:
|
|
149
|
-
}) : null, Se =
|
|
150
|
-
|
|
151
|
-
},
|
|
165
|
+
})), at = H.length > 0, J = d ? H.find((e) => e.key === d) : void 0, lt = R?.align ?? "left", be = (R?.columns ?? R?.column ?? []).length > 0 ? /* @__PURE__ */ r(Mt, {
|
|
166
|
+
columns: l,
|
|
167
|
+
config: R,
|
|
168
|
+
sortKey: d,
|
|
169
|
+
sortDirection: u,
|
|
170
|
+
onSort: M
|
|
171
|
+
}) : null, Se = X && X.options.length > 0 ? /* @__PURE__ */ r(kt, { config: X }) : null, m = b.map(c), Q = m.filter((e) => f.includes(e)).length, Y = !!G && m.length > 0 && Q === m.length, ye = !!G && Q > 0 && Q < m.length, Ce = (e) => {
|
|
172
|
+
z(e ? [...f, ...m.filter((t) => !f.includes(t))] : f.filter((t) => !m.includes(t)));
|
|
173
|
+
}, ct = G && m.length > 0 ? /* @__PURE__ */ _("label", {
|
|
152
174
|
className: "data-view__select-all",
|
|
153
|
-
children: [/* @__PURE__ */
|
|
154
|
-
checked:
|
|
155
|
-
indeterminate:
|
|
156
|
-
onChange:
|
|
157
|
-
}), /* @__PURE__ */
|
|
158
|
-
}) : null,
|
|
159
|
-
className: `data-view__top-row data-view__top-row--mini-${
|
|
175
|
+
children: [/* @__PURE__ */ r(pt, {
|
|
176
|
+
checked: Y,
|
|
177
|
+
indeterminate: ye,
|
|
178
|
+
onChange: Ce
|
|
179
|
+
}), /* @__PURE__ */ r("span", { children: Y ? "Clear selection" : `Select these ${m.length}` })]
|
|
180
|
+
}) : null, _e = (e) => Z || be || Se || e ? /* @__PURE__ */ _("div", {
|
|
181
|
+
className: `data-view__top-row data-view__top-row--mini-${lt}`,
|
|
160
182
|
children: [
|
|
161
|
-
|
|
183
|
+
Z && /* @__PURE__ */ r("div", {
|
|
162
184
|
className: "data-view__results-count",
|
|
163
|
-
children:
|
|
185
|
+
children: Z
|
|
164
186
|
}),
|
|
165
187
|
e,
|
|
166
|
-
|
|
188
|
+
be,
|
|
167
189
|
Se
|
|
168
190
|
]
|
|
169
|
-
}) : null,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
191
|
+
}) : null, ke = _e(), Me = /* @__PURE__ */ r(St, {
|
|
192
|
+
currentPage: T,
|
|
193
|
+
totalPages: me,
|
|
194
|
+
totalItems: B,
|
|
195
|
+
onPageChange: D,
|
|
196
|
+
pageSizeOptions: U ? Ve : void 0,
|
|
197
|
+
pageSize: U ? g : void 0,
|
|
198
|
+
onPageSizeChange: U ? (e) => {
|
|
199
|
+
A.skipNext(), tt(e), D(1), We?.(e);
|
|
200
|
+
} : void 0
|
|
201
|
+
});
|
|
202
|
+
if (ie !== "cards" && l.length === 0) return /* @__PURE__ */ _("div", {
|
|
203
|
+
className: `data-view${k ? ` ${k}` : ""}`,
|
|
204
|
+
ref: x,
|
|
205
|
+
children: [ke, /* @__PURE__ */ r("div", {
|
|
173
206
|
className: "data-view__wrapper data-view__wrapper--empty",
|
|
174
|
-
children: /* @__PURE__ */
|
|
207
|
+
children: /* @__PURE__ */ r(bt, {
|
|
175
208
|
title: "No columns selected",
|
|
176
209
|
description: "Use the Columns button above to pick which columns to display."
|
|
177
210
|
})
|
|
178
211
|
})]
|
|
179
212
|
});
|
|
180
|
-
if (
|
|
181
|
-
className: `data-view data-view--cards${
|
|
213
|
+
if (ie === "cards") return /* @__PURE__ */ _("div", {
|
|
214
|
+
className: `data-view data-view--cards${k ? ` ${k}` : ""}`,
|
|
215
|
+
ref: x,
|
|
182
216
|
children: [
|
|
183
|
-
|
|
184
|
-
|
|
217
|
+
_e(ct),
|
|
218
|
+
Fe && at && /* @__PURE__ */ _("div", {
|
|
185
219
|
className: "data-view__card-sort-bar",
|
|
186
|
-
children: [/* @__PURE__ */
|
|
220
|
+
children: [/* @__PURE__ */ r("div", {
|
|
187
221
|
className: "data-view__card-sort-field",
|
|
188
|
-
children: /* @__PURE__ */
|
|
222
|
+
children: /* @__PURE__ */ r(ht, {
|
|
189
223
|
name: "data-view-card-sort",
|
|
190
224
|
label: "Sort by",
|
|
191
|
-
options:
|
|
192
|
-
value:
|
|
225
|
+
options: it,
|
|
226
|
+
value: d,
|
|
193
227
|
placeholder: "Sort by...",
|
|
194
228
|
searchable: !1,
|
|
195
229
|
usePortal: !1,
|
|
196
230
|
onChange: (e) => {
|
|
197
231
|
if (!e || Array.isArray(e)) {
|
|
198
|
-
|
|
232
|
+
M(null, u);
|
|
199
233
|
return;
|
|
200
234
|
}
|
|
201
|
-
const
|
|
202
|
-
|
|
235
|
+
const t = String(e.value);
|
|
236
|
+
M(t, d === t ? u : "asc");
|
|
203
237
|
}
|
|
204
238
|
})
|
|
205
|
-
}), /* @__PURE__ */
|
|
206
|
-
title:
|
|
207
|
-
children: /* @__PURE__ */
|
|
239
|
+
}), /* @__PURE__ */ r(mt, {
|
|
240
|
+
title: u === "asc" ? "Sort descending" : "Sort ascending",
|
|
241
|
+
children: /* @__PURE__ */ r(ft, {
|
|
208
242
|
className: "data-view__card-sort-direction",
|
|
209
|
-
disabled: !
|
|
243
|
+
disabled: !J,
|
|
210
244
|
onClick: () => {
|
|
211
|
-
|
|
245
|
+
J && M(J.key, u === "asc" ? "desc" : "asc");
|
|
212
246
|
},
|
|
213
247
|
variant: "ghost",
|
|
214
|
-
children: /* @__PURE__ */
|
|
248
|
+
children: /* @__PURE__ */ r(ut, { name: u === "asc" ? "arrow-up" : "arrow-down" })
|
|
215
249
|
})
|
|
216
250
|
})]
|
|
217
251
|
}),
|
|
218
|
-
|
|
252
|
+
we && /* @__PURE__ */ r("div", {
|
|
219
253
|
className: "data-view__filter-bar",
|
|
220
|
-
children:
|
|
254
|
+
children: l.filter((e) => e.filter).map((e) => /* @__PURE__ */ r("div", {
|
|
221
255
|
className: "data-view__filter-bar-item",
|
|
222
256
|
children: e.filter
|
|
223
257
|
}, e.key))
|
|
224
258
|
}),
|
|
225
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ r(_t, {
|
|
226
260
|
data: b,
|
|
227
|
-
columns:
|
|
228
|
-
rowKey:
|
|
229
|
-
card:
|
|
230
|
-
actions:
|
|
231
|
-
timeline:
|
|
232
|
-
onRowClick:
|
|
233
|
-
rowHref:
|
|
234
|
-
rowClassName:
|
|
235
|
-
empty:
|
|
236
|
-
selectable:
|
|
261
|
+
columns: l,
|
|
262
|
+
rowKey: c,
|
|
263
|
+
card: Re,
|
|
264
|
+
actions: ee,
|
|
265
|
+
timeline: h,
|
|
266
|
+
onRowClick: te,
|
|
267
|
+
rowHref: oe,
|
|
268
|
+
rowClassName: ne,
|
|
269
|
+
empty: se,
|
|
270
|
+
selectable: G,
|
|
237
271
|
selectedIds: f,
|
|
238
|
-
pinnedIds:
|
|
239
|
-
cardMaxWidth:
|
|
240
|
-
isMobile:
|
|
241
|
-
groups:
|
|
242
|
-
showGroupCount:
|
|
243
|
-
collapsible:
|
|
244
|
-
collapsedGroups:
|
|
245
|
-
onToggleGroup:
|
|
246
|
-
onToggleSelect:
|
|
247
|
-
E(a ? [...f, e] : f.filter((s) => s !== e));
|
|
248
|
-
}
|
|
272
|
+
pinnedIds: p,
|
|
273
|
+
cardMaxWidth: Ue,
|
|
274
|
+
isMobile: ce,
|
|
275
|
+
groups: he ?? void 0,
|
|
276
|
+
showGroupCount: i?.showCount !== !1,
|
|
277
|
+
collapsible: i?.collapsible,
|
|
278
|
+
collapsedGroups: ue,
|
|
279
|
+
onToggleGroup: fe,
|
|
280
|
+
onToggleSelect: ge
|
|
249
281
|
}),
|
|
250
|
-
|
|
251
|
-
currentPage: F,
|
|
252
|
-
totalPages: J,
|
|
253
|
-
totalItems: B,
|
|
254
|
-
onPageChange: V,
|
|
255
|
-
pageSizeOptions: $ ? de : void 0,
|
|
256
|
-
pageSize: $ ? T : void 0,
|
|
257
|
-
onPageSizeChange: $ ? (e) => {
|
|
258
|
-
ge(e), V(1), pe?.(e);
|
|
259
|
-
} : void 0
|
|
260
|
-
})
|
|
282
|
+
Me
|
|
261
283
|
]
|
|
262
284
|
});
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
/* @__PURE__ */
|
|
285
|
+
const dt = l.filter((e) => !e.hideInTable && !(ce && e.hideInMobile)), Ne = h && ve.size > 0, Te = /* @__PURE__ */ _(Et, { children: [
|
|
286
|
+
ke,
|
|
287
|
+
/* @__PURE__ */ r("div", {
|
|
266
288
|
className: "data-view__wrapper",
|
|
267
|
-
children: /* @__PURE__ */
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
] }), Ce && /* @__PURE__ */ c("tr", {
|
|
299
|
-
className: "data-view__filter-row",
|
|
300
|
-
children: [
|
|
301
|
-
G && /* @__PURE__ */ t("td", { className: "data-view__filter-cell data-view__filter-cell--spacer" }),
|
|
302
|
-
w && /* @__PURE__ */ t("td", { className: "data-view__filter-cell data-view__filter-cell--spacer" }),
|
|
303
|
-
I.map((e) => /* @__PURE__ */ t("td", {
|
|
304
|
-
className: "data-view__filter-cell",
|
|
305
|
-
style: M[e.key] ? { width: M[e.key] } : void 0,
|
|
306
|
-
children: e.filter ?? null
|
|
307
|
-
}, e.key)),
|
|
308
|
-
C && /* @__PURE__ */ t("td", { className: "data-view__filter-cell data-view__filter-cell--spacer" })
|
|
309
|
-
]
|
|
310
|
-
})] }), /* @__PURE__ */ t("tbody", { children: (() => {
|
|
311
|
-
if (b.length === 0) return /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
312
|
-
colSpan: I.length + (G ? 1 : 0) + (w ? 1 : 0) + (C ? 1 : 0),
|
|
313
|
-
className: "data-view__empty",
|
|
314
|
-
children: S ? /* @__PURE__ */ t(oe, {
|
|
315
|
-
title: S.title,
|
|
316
|
-
description: S.description,
|
|
317
|
-
icon: S.icon,
|
|
318
|
-
primary: S.primary,
|
|
319
|
-
secondary: S.secondary
|
|
320
|
-
}) : /* @__PURE__ */ t(oe, { title: "No data available" })
|
|
321
|
-
}) });
|
|
322
|
-
const e = I.length + (G ? 1 : 0) + (w ? 1 : 0) + (C ? 1 : 0), a = o?.showCount !== !1, s = (n, i) => {
|
|
323
|
-
const r = g(n, i), m = f.includes(r), u = W.has(r), _ = ye.get(i), d = he?.(n), Ae = !!K || !!d, ut = (l) => {
|
|
324
|
-
if (d && (l.metaKey || l.ctrlKey || l.shiftKey)) {
|
|
325
|
-
window.open(d, "_blank", "noopener,noreferrer");
|
|
326
|
-
return;
|
|
327
|
-
}
|
|
328
|
-
if (K) {
|
|
329
|
-
K(n, l);
|
|
330
|
-
return;
|
|
331
|
-
}
|
|
332
|
-
d && window.location.assign(d);
|
|
333
|
-
}, mt = (l) => {
|
|
334
|
-
l.button !== 1 || !d || (l.preventDefault(), window.open(d, "_blank", "noopener,noreferrer"));
|
|
335
|
-
}, ie = Ie?.(n);
|
|
336
|
-
return /* @__PURE__ */ c(Ve.Fragment, { children: [/* @__PURE__ */ c("tr", {
|
|
337
|
-
className: `${m ? "is-selected" : ""} ${Ae ? "data-view__row--clickable" : ""} ${u ? "data-view__row--pinned" : ""} ${ue?.(n) || ""}`,
|
|
338
|
-
onClick: Ae ? ut : void 0,
|
|
339
|
-
onAuxClick: d ? mt : void 0,
|
|
340
|
-
children: [
|
|
341
|
-
G && /* @__PURE__ */ t("td", {
|
|
342
|
-
className: "data-view__timeline-cell",
|
|
343
|
-
children: _ && /* @__PURE__ */ t(gt, { marker: _ })
|
|
344
|
-
}),
|
|
345
|
-
w && /* @__PURE__ */ t("td", {
|
|
346
|
-
className: "data-view__checkbox",
|
|
347
|
-
onClick: (l) => l.stopPropagation(),
|
|
348
|
-
children: /* @__PURE__ */ t(re, {
|
|
349
|
-
checked: m,
|
|
350
|
-
onChange: (l) => {
|
|
351
|
-
E(l ? [...f, r] : f.filter((se) => se !== r));
|
|
352
|
-
}
|
|
353
|
-
})
|
|
354
|
-
}),
|
|
355
|
-
I.map((l, se) => /* @__PURE__ */ c("td", {
|
|
356
|
-
style: M[l.key] ? { width: M[l.key] } : void 0,
|
|
357
|
-
children: [se === 0 && u && /* @__PURE__ */ t(Ee, {
|
|
358
|
-
title: "Pinned",
|
|
359
|
-
children: /* @__PURE__ */ t(O, {
|
|
360
|
-
className: "data-view__pin-indicator",
|
|
361
|
-
name: "pin",
|
|
362
|
-
size: "sm"
|
|
363
|
-
})
|
|
364
|
-
}), kt(l, n)]
|
|
365
|
-
}, l.key)),
|
|
366
|
-
C && /* @__PURE__ */ t("td", {
|
|
367
|
-
className: "data-view__actions-cell",
|
|
368
|
-
style: z ? { width: z } : void 0,
|
|
369
|
-
children: /* @__PURE__ */ t("div", {
|
|
370
|
-
className: "data-view__table-actions",
|
|
371
|
-
onClick: (l) => l.stopPropagation(),
|
|
372
|
-
children: C(n)
|
|
373
|
-
})
|
|
374
|
-
})
|
|
375
|
-
]
|
|
376
|
-
}), ie != null && ie !== !1 && /* @__PURE__ */ t("tr", {
|
|
377
|
-
className: "data-view__row-detail",
|
|
378
|
-
children: /* @__PURE__ */ t("td", {
|
|
379
|
-
colSpan: e,
|
|
380
|
-
onClick: (l) => l.stopPropagation(),
|
|
381
|
-
children: ie
|
|
382
|
-
})
|
|
383
|
-
})] }, r);
|
|
384
|
-
};
|
|
385
|
-
if (H) {
|
|
386
|
-
let n = 0;
|
|
387
|
-
return H.map((i) => {
|
|
388
|
-
const r = n;
|
|
389
|
-
n += i.items.length;
|
|
390
|
-
const m = o?.collapsible && be.has(i.key);
|
|
391
|
-
return /* @__PURE__ */ c(Ve.Fragment, { children: [/* @__PURE__ */ t("tr", {
|
|
392
|
-
className: `data-view__group-row${o?.collapsible ? " data-view__group-row--collapsible" : ""}`,
|
|
393
|
-
onClick: o?.collapsible ? () => ke(i.key) : void 0,
|
|
394
|
-
children: /* @__PURE__ */ c("td", {
|
|
395
|
-
colSpan: e,
|
|
396
|
-
className: "data-view__group-cell",
|
|
397
|
-
children: [
|
|
398
|
-
/* @__PURE__ */ t("span", {
|
|
399
|
-
className: "data-view__group-label",
|
|
400
|
-
children: i.label
|
|
401
|
-
}),
|
|
402
|
-
a && /* @__PURE__ */ t("span", {
|
|
403
|
-
className: "data-view__group-count",
|
|
404
|
-
children: i.items.length === i.totalCount ? i.totalCount : `${i.items.length} of ${i.totalCount}`
|
|
405
|
-
}),
|
|
406
|
-
o?.collapsible && /* @__PURE__ */ t(O, {
|
|
407
|
-
className: "data-view__group-chevron",
|
|
408
|
-
name: m ? "caret-down" : "caret-up",
|
|
409
|
-
size: "sm"
|
|
410
|
-
})
|
|
411
|
-
]
|
|
412
|
-
})
|
|
413
|
-
}), !m && i.items.map((u, _) => s(u, r + _))] }, i.key ?? "__null__");
|
|
414
|
-
});
|
|
415
|
-
}
|
|
416
|
-
return b.map((n, i) => s(n, i));
|
|
417
|
-
})() })] })
|
|
289
|
+
children: /* @__PURE__ */ r(Nt, {
|
|
290
|
+
data: b,
|
|
291
|
+
columns: dt,
|
|
292
|
+
rowKey: c,
|
|
293
|
+
columnWidths: de,
|
|
294
|
+
onResizeStart: rt,
|
|
295
|
+
sortKey: d,
|
|
296
|
+
sortDirection: u,
|
|
297
|
+
onToggleSort: st,
|
|
298
|
+
hasFilters: we,
|
|
299
|
+
showTimeline: !!Ne,
|
|
300
|
+
timelineMarkers: ve,
|
|
301
|
+
selectable: G,
|
|
302
|
+
selectedIds: f,
|
|
303
|
+
allVisibleSelected: Y,
|
|
304
|
+
someVisibleSelected: ye,
|
|
305
|
+
onToggleVisibleSelection: Ce,
|
|
306
|
+
onToggleSelect: ge,
|
|
307
|
+
pinnedSet: $,
|
|
308
|
+
actions: ee,
|
|
309
|
+
actionsWidth: xe,
|
|
310
|
+
onRowClick: te,
|
|
311
|
+
rowHref: oe,
|
|
312
|
+
rowClassName: ne,
|
|
313
|
+
rowDetail: Ae,
|
|
314
|
+
empty: se,
|
|
315
|
+
groups: he,
|
|
316
|
+
group: i,
|
|
317
|
+
collapsedGroups: ue,
|
|
318
|
+
onToggleGroup: fe
|
|
319
|
+
})
|
|
418
320
|
}),
|
|
419
|
-
|
|
420
|
-
currentPage: F,
|
|
421
|
-
totalPages: J,
|
|
422
|
-
totalItems: B,
|
|
423
|
-
onPageChange: V,
|
|
424
|
-
pageSizeOptions: $ ? de : void 0,
|
|
425
|
-
pageSize: $ ? T : void 0,
|
|
426
|
-
onPageSizeChange: $ ? (e) => {
|
|
427
|
-
ge(e), V(1), pe?.(e);
|
|
428
|
-
} : void 0
|
|
429
|
-
})
|
|
321
|
+
Me
|
|
430
322
|
] });
|
|
431
|
-
return /* @__PURE__ */
|
|
432
|
-
className: `data-view${
|
|
433
|
-
|
|
323
|
+
return /* @__PURE__ */ r("div", {
|
|
324
|
+
className: `data-view${k ? ` ${k}` : ""}`,
|
|
325
|
+
ref: x,
|
|
326
|
+
children: Ne ? /* @__PURE__ */ _("div", {
|
|
434
327
|
className: "timeline-markers",
|
|
435
|
-
children: [/* @__PURE__ */
|
|
328
|
+
children: [/* @__PURE__ */ r("div", { className: "timeline-markers__track" }), Te]
|
|
436
329
|
}) : Te
|
|
437
330
|
});
|
|
438
331
|
}
|
|
439
332
|
export {
|
|
440
|
-
|
|
333
|
+
Ht as DataView
|
|
441
334
|
};
|