@ck-ui/component-library 1.0.7 → 1.0.9
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/{DropdownFooter-B1d0HFxd.js → DropdownFooter-BmXLYRcE.js} +4 -3
- package/dist/{OptionList-BM4AleXV.js → OptionList-DU0iA8Y4.js} +206 -198
- package/dist/assets/index-CRlPQn7l.css +1 -0
- package/dist/assets/index-xlbz19JS.css +1 -0
- package/dist/assets/{index-CtR-jzNi.css → index-zWDnehqu.css} +1 -1
- package/dist/assets/styles-0GdZsGyi.css +1 -0
- package/dist/assets/styles-C9rG0Alp.css +1 -0
- package/dist/assets/styles-CwZG1jzB.css +1 -0
- package/dist/assets/{styles-DAqMiQ0N.css → styles-D2n8YjU_.css} +1 -1
- package/dist/components/Breadcrumb/index.js +39 -39
- package/dist/components/FusionChart/_config/builders.d.ts.map +1 -1
- package/dist/components/FusionChart/_config/builders.js +147 -110
- package/dist/components/FusionChart/_config/events.d.ts.map +1 -1
- package/dist/components/FusionChart/_config/events.js +52 -37
- package/dist/components/FusionChart/_types/fusionChart.types.d.ts +3 -0
- package/dist/components/FusionChart/_types/fusionChart.types.d.ts.map +1 -1
- package/dist/components/FusionChart/index.d.ts.map +1 -1
- package/dist/components/FusionChart/index.js +524 -506
- package/dist/components/MultiSelect/SimpleMultiSelect.js +1 -1
- package/dist/components/MultiSelect/_helpers/DropdownFooter.js +1 -1
- package/dist/components/MultiSelect/_helpers/OptionRow.js +1 -1
- package/dist/components/MultiSelect/_helpers/OverflowMenu.js +1 -1
- package/dist/components/MultiSelect/_helpers/OverflowMenuItem.js +1 -1
- package/dist/components/MultiSelect/_helpers/SearchResult.js +1 -1
- package/dist/components/MultiSelect/_helpers/TagContent.js +1 -1
- package/dist/components/MultiSelect/_helpers/TriggerButton.js +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/Search/index.js +60 -60
- package/dist/components/SingleSelectDropdown/_helpers/DropdownFooter.js +4 -3
- package/dist/components/SingleSelectDropdown/index.js +12 -11
- package/dist/components/Table/_helpers/ColumnManager/index.d.ts +1 -1
- package/dist/components/Table/_helpers/ColumnManager/index.d.ts.map +1 -1
- package/dist/components/Table/_helpers/ColumnManager/index.js +803 -696
- package/dist/components/Table/_helpers/GroupedHeader/index.d.ts +3 -2
- package/dist/components/Table/_helpers/GroupedHeader/index.d.ts.map +1 -1
- package/dist/components/Table/_helpers/GroupedHeader/index.js +148 -147
- package/dist/components/Table/_helpers/TableFilterModal/OptionList.d.ts.map +1 -1
- package/dist/components/Table/_helpers/TableFilterModal/OptionList.js +3 -3
- package/dist/components/Table/_helpers/TableFilterModal/index.d.ts.map +1 -1
- package/dist/components/Table/_helpers/TableFilterModal/index.js +52 -50
- package/dist/components/Table/_helpers/TableRows.d.ts +1 -1
- package/dist/components/Table/_helpers/TableRows.d.ts.map +1 -1
- package/dist/components/Table/_helpers/TableRows.js +242 -243
- package/dist/components/Table/_hooks/useOverlayScrollbar.d.ts.map +1 -1
- package/dist/components/Table/_hooks/useOverlayScrollbar.js +63 -58
- package/dist/components/Table/_types/table.types.d.ts +1 -1
- package/dist/components/Table/_types/table.types.d.ts.map +1 -1
- package/dist/components/Table/_utils/table.utils.d.ts +1 -1
- package/dist/components/Table/_utils/table.utils.d.ts.map +1 -1
- package/dist/components/Table/_utils/table.utils.js +84 -46
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +395 -324
- package/dist/components/TextField/index.js +165 -165
- package/dist/styles.module-DSbSTQeV.js +56 -0
- package/package.json +1 -1
- package/dist/assets/index-C8gvpfKZ.css +0 -1
- package/dist/assets/index-DewFIgpp.css +0 -1
- package/dist/assets/styles-BATmGmYA.css +0 -1
- package/dist/assets/styles-DLJzdWsF.css +0 -1
- package/dist/assets/styles-O-5pBCak.css +0 -1
- package/dist/search-B_cup-NN.js +0 -5
- package/dist/styles.module-BJEFZA32.js +0 -56
|
@@ -1,130 +1,131 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { useState as
|
|
4
|
-
import {
|
|
5
|
-
import { u as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
|
|
1
|
+
import { jsx as l, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { useState as N, useEffect as M, useCallback as I, useRef as U, useMemo as A } from "react";
|
|
4
|
+
import { flushSync as it } from "react-dom";
|
|
5
|
+
import { u as lt } from "../../OptionList-DU0iA8Y4.js";
|
|
6
|
+
import { u as at, f as ct, g as dt, a as ut, b as mt } from "../../index-Bcvmezbu.js";
|
|
7
|
+
import { CKButton as Be } from "../CKButton/index.js";
|
|
8
|
+
import { Search as ft } from "../Search/index.js";
|
|
9
|
+
import { EmptyState as gt } from "../EmptyState/index.js";
|
|
10
|
+
import { Loader as ht } from "../Loader/index.js";
|
|
11
|
+
import { S as pt, a as yt } from "../../table-filter-C0zetUfo.js";
|
|
12
|
+
import { INITIAL_COLUMN_MANAGER_CONFIG as We, ROW_MIN_HEIGHT as kt, TABLE_PREFIX as z } from "./constants.js";
|
|
13
|
+
import Ct from "./_helpers/TableFilterModal/index.js";
|
|
14
|
+
import bt from "./_helpers/ColumnManager/index.js";
|
|
15
|
+
import vt from "./_helpers/GroupedHeader/index.js";
|
|
16
|
+
import { SelectionHeaderCell as ze } from "./_helpers/SelectionCell/index.js";
|
|
17
|
+
import xt from "./_helpers/TableRows.js";
|
|
18
|
+
import { useSelection as St } from "./_hooks/useSelection.js";
|
|
19
|
+
import { useExpansion as wt } from "./_hooks/useExpansion.js";
|
|
20
|
+
import { useOverlayScrollbar as Et } from "./_hooks/useOverlayScrollbar.js";
|
|
21
|
+
import { isTableConfigDefault as ce, saveToLocalStorage as de, getTableMinWidth as Nt, isTableConfigChanged as Mt, pinnedStyle as ue, columnLayoutStyle as Re } from "./_utils/table.utils.js";
|
|
22
|
+
import { formatCellValue as De } from "./_utils/formatCellValue.js";
|
|
23
|
+
import '../../assets/styles-D2n8YjU_.css';/* empty css */
|
|
24
|
+
const It = (c) => /* @__PURE__ */ i.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 14, height: 14, viewBox: "0 0 14 14", fill: "none", ...c }, /* @__PURE__ */ i.createElement("path", { d: "M1.75 8.75006L8.16667 8.75", stroke: "#2B2B2B", strokeWidth: 0.875, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ i.createElement("path", { d: "M1.75 5.25H5.83333", stroke: "#2B2B2B", strokeWidth: 0.875, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ i.createElement("path", { d: "M1.75 12.25H11.0833", stroke: "#2B2B2B", strokeWidth: 0.875, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ i.createElement("path", { d: "M10.7913 1.75V8.75M10.7913 1.75C10.3829 1.75 9.61972 2.91334 9.33301 3.20833M10.7913 1.75C11.1998 1.75 11.963 2.91334 12.2497 3.20833", stroke: "#2B2B2B", strokeWidth: 0.875, strokeLinecap: "round", strokeLinejoin: "round" })), Lt = (c) => /* @__PURE__ */ i.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 14, height: 14, viewBox: "0 0 14 14", fill: "none", ...c }, /* @__PURE__ */ i.createElement("path", { d: "M1.75 5.24994L8.16667 5.25", stroke: "#2B2B2B", strokeWidth: 0.875, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ i.createElement("path", { d: "M1.75 8.75H5.83333", stroke: "#2B2B2B", strokeWidth: 0.875, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ i.createElement("path", { d: "M1.75 1.75H11.0833", stroke: "#2B2B2B", strokeWidth: 0.875, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ i.createElement("path", { d: "M10.7913 12.25V5.25M10.7913 12.25C10.3829 12.25 9.61972 11.0867 9.33301 10.7917M10.7913 12.25C11.1998 12.25 11.963 11.0867 12.2497 10.7917", stroke: "#2B2B2B", strokeWidth: 0.875, strokeLinecap: "round", strokeLinejoin: "round" })), Ft = (c) => /* @__PURE__ */ i.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 14, height: 14, viewBox: "0 0 14 14", fill: "none", ...c }, /* @__PURE__ */ i.createElement("mask", { id: "mask0_1852_13537", style: {
|
|
24
25
|
maskType: "luminance"
|
|
25
|
-
}, maskUnits: "userSpaceOnUse", x: 0, y: 0, width: 14, height: 14 }, /* @__PURE__ */
|
|
26
|
-
if (typeof
|
|
27
|
-
if (
|
|
28
|
-
const
|
|
29
|
-
return
|
|
30
|
-
},
|
|
31
|
-
const
|
|
32
|
-
return Number.isNaN(
|
|
26
|
+
}, maskUnits: "userSpaceOnUse", x: 0, y: 0, width: 14, height: 14 }, /* @__PURE__ */ i.createElement("path", { d: "M13.708 0.291992V13.708H0.291992V0.291992H13.708Z", fill: "white", stroke: "white", strokeWidth: 0.583333 })), /* @__PURE__ */ i.createElement("g", { mask: "url(#mask0_1852_13537)" }, /* @__PURE__ */ i.createElement("path", { d: "M1.75 4.08325H12.25", stroke: "#2B2B2B", strokeWidth: 0.875, strokeLinecap: "round" }), /* @__PURE__ */ i.createElement("path", { d: "M3.5 7H10.5", stroke: "#2B2B2B", strokeWidth: 0.875, strokeLinecap: "round" }), /* @__PURE__ */ i.createElement("path", { d: "M5.83398 9.9165H8.16732", stroke: "#2B2B2B", strokeWidth: 0.875, strokeLinecap: "round" }))), Bt = (c) => /* @__PURE__ */ i.createElement("svg", { width: 200, height: 180, viewBox: "0 0 200 180", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...c }, /* @__PURE__ */ i.createElement("ellipse", { cx: 100, cy: 168, rx: 38, ry: 6, fill: "#E0E0E0" }), /* @__PURE__ */ i.createElement("path", { d: "M30 110 C10 110 5 90 20 80 C15 60 35 50 55 60 C60 45 80 38 95 50 C110 38 135 42 140 58 C158 55 170 70 162 85 C175 90 175 110 158 112 Z", fill: "#F0F0F0" }), /* @__PURE__ */ i.createElement("g", { stroke: "#C0C0C0", strokeWidth: 2.5, strokeLinecap: "round" }, /* @__PURE__ */ i.createElement("line", { x1: 28, y1: 22, x2: 28, y2: 32 }), /* @__PURE__ */ i.createElement("line", { x1: 23, y1: 27, x2: 33, y2: 27 }), /* @__PURE__ */ i.createElement("line", { x1: 38, y1: 118, x2: 38, y2: 128 }), /* @__PURE__ */ i.createElement("line", { x1: 33, y1: 123, x2: 43, y2: 123 }), /* @__PURE__ */ i.createElement("line", { x1: 162, y1: 52, x2: 162, y2: 62 }), /* @__PURE__ */ i.createElement("line", { x1: 157, y1: 57, x2: 167, y2: 57 })), /* @__PURE__ */ i.createElement("circle", { cx: 100, cy: 155, r: 2, fill: "#D0D0D0" }), /* @__PURE__ */ i.createElement("g", { transform: "rotate(-8, 100, 90)" }, /* @__PURE__ */ i.createElement("rect", { x: 42, y: 28, width: 112, height: 130, rx: 10, fill: "#DCDCDC" }), /* @__PURE__ */ i.createElement("rect", { x: 44, y: 30, width: 108, height: 126, rx: 9, fill: "white", stroke: "#C2C2C2", strokeWidth: 1.5 }), /* @__PURE__ */ i.createElement("rect", { x: 50, y: 36, width: 96, height: 114, rx: 6, fill: "white", stroke: "#C2C2C2", strokeWidth: 1 }), /* @__PURE__ */ i.createElement("rect", { x: 82, y: 20, width: 32, height: 20, rx: 4, fill: "white", stroke: "#C2C2C2", strokeWidth: 1.5 }), /* @__PURE__ */ i.createElement("path", { d: "M91 20 Q98 14 105 20", stroke: "#C2C2C2", strokeWidth: 1.5, fill: "#F4F4F4" }), /* @__PURE__ */ i.createElement("circle", { cx: 95, cy: 88, r: 26, stroke: "#C2C2C2", strokeWidth: 3, fill: "white" }), /* @__PURE__ */ i.createElement("line", { x1: 113, y1: 106, x2: 128, y2: 121, stroke: "#C2C2C2", strokeWidth: 5, strokeLinecap: "round" }), /* @__PURE__ */ i.createElement("line", { x1: 116, y1: 109, x2: 125, y2: 118, stroke: "#E8E8E8", strokeWidth: 2, strokeLinecap: "round" }))), Ke = (c) => {
|
|
27
|
+
if (typeof c == "number") return c;
|
|
28
|
+
if (c == null) return NaN;
|
|
29
|
+
const f = String(c).replace(/[^0-9.-]/g, "");
|
|
30
|
+
return f === "" ? NaN : Number(f);
|
|
31
|
+
}, Wt = (c, f, H) => {
|
|
32
|
+
const x = Ke(c.getValue(H)), d = Ke(f.getValue(H));
|
|
33
|
+
return Number.isNaN(x) && Number.isNaN(d) ? 0 : Number.isNaN(x) ? 1 : Number.isNaN(d) ? -1 : x - d;
|
|
33
34
|
};
|
|
34
|
-
let
|
|
35
|
-
const
|
|
36
|
-
if (typeof
|
|
37
|
-
if (typeof
|
|
38
|
-
const
|
|
39
|
-
return Number.isNaN(
|
|
35
|
+
let Ve = !1;
|
|
36
|
+
const Ae = (c) => {
|
|
37
|
+
if (typeof c == "number") return c;
|
|
38
|
+
if (typeof c == "string" && c.trim().endsWith("px")) {
|
|
39
|
+
const f = Number.parseFloat(c);
|
|
40
|
+
return Number.isNaN(f) ? void 0 : f;
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
|
-
function
|
|
43
|
-
config:
|
|
44
|
-
data:
|
|
45
|
-
maxHeight:
|
|
46
|
-
virtualization:
|
|
47
|
-
persistTableConfig:
|
|
48
|
-
message:
|
|
49
|
-
icon:
|
|
50
|
-
totalRow:
|
|
51
|
-
selection:
|
|
52
|
-
expandable:
|
|
53
|
-
externalColumnFilters:
|
|
54
|
-
externalTableConfig:
|
|
55
|
-
onConfigChange:
|
|
56
|
-
isLoading:
|
|
43
|
+
function tn({
|
|
44
|
+
config: c = {},
|
|
45
|
+
data: f = [],
|
|
46
|
+
maxHeight: H = "600px",
|
|
47
|
+
virtualization: x = !1,
|
|
48
|
+
persistTableConfig: d = "",
|
|
49
|
+
message: me,
|
|
50
|
+
icon: He,
|
|
51
|
+
totalRow: fe,
|
|
52
|
+
selection: Z,
|
|
53
|
+
expandable: Q,
|
|
54
|
+
externalColumnFilters: X,
|
|
55
|
+
externalTableConfig: S,
|
|
56
|
+
onConfigChange: Oe,
|
|
57
|
+
isLoading: ge = !1
|
|
57
58
|
}) {
|
|
58
59
|
const {
|
|
59
|
-
headers:
|
|
60
|
-
headerGroups:
|
|
61
|
-
showFilters:
|
|
62
|
-
showColumnManager:
|
|
63
|
-
columnManagerConfig:
|
|
64
|
-
toolbarLabels:
|
|
65
|
-
search:
|
|
66
|
-
} =
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}, [
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
}, [
|
|
73
|
-
|
|
60
|
+
headers: L = [],
|
|
61
|
+
headerGroups: p,
|
|
62
|
+
showFilters: je = !0,
|
|
63
|
+
showColumnManager: Te = !0,
|
|
64
|
+
columnManagerConfig: he = We,
|
|
65
|
+
toolbarLabels: pe,
|
|
66
|
+
search: g
|
|
67
|
+
} = c ?? {}, ye = pe?.columnManager ?? !0, ke = pe?.filter ?? !0, [O, Ce] = N(g?.value ?? "");
|
|
68
|
+
M(() => {
|
|
69
|
+
g?.value !== void 0 && Ce(g.value);
|
|
70
|
+
}, [g?.value]);
|
|
71
|
+
const be = I((e) => {
|
|
72
|
+
Ce(e), g?.onSearch?.(e);
|
|
73
|
+
}, [g]), w = U(null), Y = U(null);
|
|
74
|
+
Et(w);
|
|
74
75
|
const {
|
|
75
|
-
selectionState:
|
|
76
|
-
getRowId:
|
|
77
|
-
toggleRowSelection:
|
|
78
|
-
toggleSelectAll:
|
|
79
|
-
} =
|
|
80
|
-
expandedIds:
|
|
81
|
-
toggleExpand:
|
|
82
|
-
} =
|
|
83
|
-
() =>
|
|
76
|
+
selectionState: R,
|
|
77
|
+
getRowId: $e,
|
|
78
|
+
toggleRowSelection: Ge,
|
|
79
|
+
toggleSelectAll: ve
|
|
80
|
+
} = St(f, Z), {
|
|
81
|
+
expandedIds: Pe,
|
|
82
|
+
toggleExpand: _e
|
|
83
|
+
} = wt(Q), j = A(
|
|
84
|
+
() => L.map((e) => {
|
|
84
85
|
let t = "includesString";
|
|
85
|
-
return e.filterable && (e.type === "string" ? t = (n,
|
|
86
|
-
if (!
|
|
87
|
-
const a = Array.isArray(
|
|
86
|
+
return e.filterable && (e.type === "string" ? t = (n, r, o) => {
|
|
87
|
+
if (!o) return !0;
|
|
88
|
+
const a = Array.isArray(o) ? o : o.values, s = Array.isArray(o) ? !1 : o.exclude;
|
|
88
89
|
if (!a || a.length === 0) return !0;
|
|
89
|
-
const
|
|
90
|
-
return
|
|
91
|
-
} : e.type === "number" && (t = (n,
|
|
92
|
-
if (!
|
|
93
|
-
const a = Number(n.getValue(
|
|
94
|
-
return a >=
|
|
90
|
+
const u = String(n.getValue(r));
|
|
91
|
+
return s ? !a.includes(u) : a.includes(u);
|
|
92
|
+
} : e.type === "number" && (t = (n, r, o) => {
|
|
93
|
+
if (!o) return !0;
|
|
94
|
+
const a = Number(n.getValue(r));
|
|
95
|
+
return a >= o.min && a <= o.max;
|
|
95
96
|
})), {
|
|
96
97
|
...e,
|
|
97
98
|
enableSorting: e.sortable !== !1,
|
|
98
99
|
...e.minWidth !== void 0 ? { enableResizing: !1 } : {},
|
|
99
|
-
...e.minSize === void 0 &&
|
|
100
|
+
...e.minSize === void 0 && Ae(e.minWidth) !== void 0 ? { minSize: Ae(e.minWidth) } : {},
|
|
100
101
|
...e.type === "number" ? { sortingFn: "numericSort" } : { sortingFn: "text" },
|
|
101
102
|
filterFn: t,
|
|
102
103
|
...e.renderCell ? {
|
|
103
104
|
cell: (n) => e.renderCell(n.getValue(), n.row.original)
|
|
104
105
|
} : e.prefix || e.suffix || e.decimalPlaces !== void 0 ? {
|
|
105
|
-
cell: (n) =>
|
|
106
|
+
cell: (n) => De(n.getValue(), e)
|
|
106
107
|
} : {}
|
|
107
108
|
};
|
|
108
109
|
}),
|
|
109
|
-
[
|
|
110
|
-
),
|
|
110
|
+
[L]
|
|
111
|
+
), D = I(
|
|
111
112
|
() => ({
|
|
112
|
-
...
|
|
113
|
-
...
|
|
114
|
-
columns:
|
|
113
|
+
...We,
|
|
114
|
+
...he,
|
|
115
|
+
columns: j
|
|
115
116
|
}),
|
|
116
|
-
[
|
|
117
|
-
),
|
|
118
|
-
const e =
|
|
119
|
-
if (
|
|
117
|
+
[he, j]
|
|
118
|
+
), xe = () => {
|
|
119
|
+
const e = D();
|
|
120
|
+
if (d)
|
|
120
121
|
try {
|
|
121
|
-
const t = localStorage.getItem(`${
|
|
122
|
+
const t = localStorage.getItem(`${z}-${d}`);
|
|
122
123
|
if (t) {
|
|
123
124
|
const n = JSON.parse(t);
|
|
124
125
|
if (n?.tableConfig) {
|
|
125
|
-
const
|
|
126
|
-
return e.columns.forEach((
|
|
127
|
-
a.find((
|
|
126
|
+
const r = n.tableConfig.columns || [], o = /* @__PURE__ */ new Set(), a = r.map((s) => e.columns.find((u) => u.accessorKey === s.accessorKey)).filter((s) => !s || o.has(s.accessorKey) ? !1 : (o.add(s.accessorKey), !0));
|
|
127
|
+
return e.columns.forEach((s) => {
|
|
128
|
+
a.find((u) => u.accessorKey === s.accessorKey) || a.push(s);
|
|
128
129
|
}), { ...e, ...n.tableConfig, columns: a };
|
|
129
130
|
}
|
|
130
131
|
}
|
|
@@ -132,10 +133,10 @@ function jt({
|
|
|
132
133
|
console.error("Failed to load table config from local storage", t);
|
|
133
134
|
}
|
|
134
135
|
return e;
|
|
135
|
-
},
|
|
136
|
-
if (
|
|
136
|
+
}, Se = () => {
|
|
137
|
+
if (d)
|
|
137
138
|
try {
|
|
138
|
-
const e = localStorage.getItem(`${
|
|
139
|
+
const e = localStorage.getItem(`${z}-${d}`);
|
|
139
140
|
if (e) {
|
|
140
141
|
const t = JSON.parse(e);
|
|
141
142
|
if (t?.columnFilters) return t.columnFilters;
|
|
@@ -144,10 +145,10 @@ function jt({
|
|
|
144
145
|
console.error("Failed to load table config from local storage", e);
|
|
145
146
|
}
|
|
146
147
|
return [];
|
|
147
|
-
},
|
|
148
|
-
if (
|
|
148
|
+
}, qe = () => {
|
|
149
|
+
if (d)
|
|
149
150
|
try {
|
|
150
|
-
const e = localStorage.getItem(`${
|
|
151
|
+
const e = localStorage.getItem(`${z}-${d}`);
|
|
151
152
|
if (e) {
|
|
152
153
|
const t = JSON.parse(e);
|
|
153
154
|
if (t?.columnSizing) return t.columnSizing;
|
|
@@ -156,282 +157,353 @@ function jt({
|
|
|
156
157
|
console.error("Failed to load table config from local storage", e);
|
|
157
158
|
}
|
|
158
159
|
return {};
|
|
159
|
-
}, [
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
160
|
+
}, [y, ee] = N(xe), [F, T] = N(xe), [K, te] = N(Se), [$, we] = N(Se), [h, Ee] = N(qe), ne = U(h);
|
|
161
|
+
ne.current = h;
|
|
162
|
+
const Ne = I(
|
|
163
|
+
(e) => (t) => {
|
|
164
|
+
const n = w.current;
|
|
165
|
+
if (n && Y.current) {
|
|
166
|
+
const s = Y.current.getVisibleLeafColumns(), u = { ...ne.current }, v = n.querySelector(".ckds-dragable-tbody .ckds-dragable-tr");
|
|
167
|
+
if (v) {
|
|
168
|
+
const b = v.querySelectorAll(".ckds-dragable-td"), ae = b.length > s.length ? 1 : 0;
|
|
169
|
+
let J = !1;
|
|
170
|
+
s.forEach((Ie, st) => {
|
|
171
|
+
if (u[Ie.id] === void 0) {
|
|
172
|
+
const Le = b[st + ae];
|
|
173
|
+
if (Le) {
|
|
174
|
+
const Fe = Le.offsetWidth;
|
|
175
|
+
Fe > 0 && (u[Ie.id] = Fe, J = !0);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}), J && (ne.current = u, it(() => {
|
|
179
|
+
Ee(u);
|
|
180
|
+
}));
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (e?.(t), !n) return;
|
|
184
|
+
let r = n.scrollWidth;
|
|
185
|
+
const o = () => {
|
|
186
|
+
if (!n) return;
|
|
187
|
+
const s = n.scrollWidth;
|
|
188
|
+
if (s < r && n.scrollLeft > 0) {
|
|
189
|
+
const u = r - s;
|
|
190
|
+
n.scrollLeft = Math.max(0, n.scrollLeft - u);
|
|
191
|
+
}
|
|
192
|
+
r = s;
|
|
193
|
+
}, a = () => {
|
|
194
|
+
document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", a);
|
|
195
|
+
};
|
|
196
|
+
document.addEventListener("mousemove", o), document.addEventListener("mouseup", a);
|
|
197
|
+
},
|
|
198
|
+
[w]
|
|
199
|
+
), [G, E] = N({ open: !1, type: "", activeOption: "" });
|
|
200
|
+
M(() => {
|
|
201
|
+
S && ee(S);
|
|
202
|
+
}, [S]);
|
|
203
|
+
const m = A(() => {
|
|
204
|
+
const e = S ?? y;
|
|
205
|
+
if (!S) return e;
|
|
206
|
+
const t = new Map(j.map((n) => [n.accessorKey, n]));
|
|
167
207
|
return {
|
|
168
208
|
...e,
|
|
169
209
|
columns: e.columns.map((n) => {
|
|
170
|
-
const
|
|
171
|
-
return
|
|
210
|
+
const r = t.get(n.accessorKey);
|
|
211
|
+
return r ? {
|
|
172
212
|
...n,
|
|
173
|
-
...
|
|
174
|
-
...
|
|
175
|
-
...
|
|
213
|
+
...r.filterFn ? { filterFn: r.filterFn } : {},
|
|
214
|
+
...r.renderCell ? { renderCell: r.renderCell } : {},
|
|
215
|
+
...r.cell ? { cell: r.cell } : {}
|
|
176
216
|
} : n;
|
|
177
217
|
})
|
|
178
218
|
};
|
|
179
|
-
}, [
|
|
219
|
+
}, [S, y, j]), Je = X ?? K, Ue = A(() => {
|
|
180
220
|
const e = {};
|
|
181
|
-
return
|
|
182
|
-
if (
|
|
221
|
+
return L.forEach((t) => {
|
|
222
|
+
if (m.columnVisibility[t.accessorKey] !== !1) {
|
|
183
223
|
if (t.filterable && (t.type === "string" || !t.type)) {
|
|
184
224
|
const n = [
|
|
185
|
-
...new Set(
|
|
225
|
+
...new Set(f.map((r) => String(r[t.accessorKey] ?? "")).filter(Boolean))
|
|
186
226
|
];
|
|
187
227
|
e[t.header] = { type: "checkbox", options: n, accessorKey: t.accessorKey };
|
|
188
228
|
} else if (t.filterable && t.type === "number") {
|
|
189
|
-
const n =
|
|
190
|
-
e[t.header] = { type: "range", values: { min:
|
|
229
|
+
const n = f.map((a) => Number(a[t.accessorKey])).filter((a) => !Number.isNaN(a)), r = n.length ? Math.floor(Math.min(...n)) : 0, o = n.length ? Math.ceil(Math.max(...n)) : 0;
|
|
230
|
+
e[t.header] = { type: "range", values: { min: r, max: o }, accessorKey: t.accessorKey };
|
|
191
231
|
}
|
|
192
232
|
}
|
|
193
233
|
}), e;
|
|
194
|
-
}, [
|
|
195
|
-
|
|
196
|
-
if (
|
|
234
|
+
}, [L, f, m.columnVisibility]);
|
|
235
|
+
M(() => {
|
|
236
|
+
if (d && !Ve)
|
|
197
237
|
try {
|
|
198
|
-
const e =
|
|
199
|
-
(e || t) && (
|
|
238
|
+
const e = K.length > 0, t = !ce(y, D());
|
|
239
|
+
(e || t) && (Ve = !0);
|
|
200
240
|
} catch (e) {
|
|
201
241
|
console.error("Failed to check toast condition", e);
|
|
202
242
|
}
|
|
203
|
-
}, [
|
|
204
|
-
|
|
205
|
-
}, [
|
|
206
|
-
|
|
243
|
+
}, [d]), M(() => {
|
|
244
|
+
d && Object.keys(h).length > 0 && de(`${z}-${d}`, { columnSizing: h });
|
|
245
|
+
}, [h, d]), M(() => {
|
|
246
|
+
te((e) => {
|
|
207
247
|
const t = e.filter(
|
|
208
|
-
(n) =>
|
|
248
|
+
(n) => y.columnVisibility[n.id] !== !1
|
|
209
249
|
);
|
|
210
250
|
return t.length !== e.length ? t : e;
|
|
211
251
|
});
|
|
212
|
-
}, [
|
|
213
|
-
const
|
|
214
|
-
const e = /* @__PURE__ */ new Set(), t =
|
|
215
|
-
|
|
216
|
-
},
|
|
217
|
-
|
|
218
|
-
},
|
|
219
|
-
|
|
220
|
-
const
|
|
221
|
-
return
|
|
252
|
+
}, [y.columnVisibility]);
|
|
253
|
+
const Ze = () => {
|
|
254
|
+
const e = /* @__PURE__ */ new Set(), t = F.columns.filter((r) => e.has(r.accessorKey) ? !1 : (e.add(r.accessorKey), !0)), n = { ...F, columns: t };
|
|
255
|
+
ee(n), E({ type: "", activeOption: "", open: !1 }), d && de(`${z}-${d}`, { tableConfig: n }), Oe?.(F);
|
|
256
|
+
}, Qe = () => {
|
|
257
|
+
T(D);
|
|
258
|
+
}, Xe = I((e, t) => {
|
|
259
|
+
T((n) => {
|
|
260
|
+
const r = [...n.columns], [o] = r.splice(e, 1);
|
|
261
|
+
return r.splice(t, 0, o), { ...n, columns: r };
|
|
222
262
|
});
|
|
223
|
-
}, []),
|
|
224
|
-
|
|
263
|
+
}, []), Ye = I((e) => {
|
|
264
|
+
ee((t) => {
|
|
225
265
|
const n = typeof e == "function" ? e(t.columnVisibility) : e;
|
|
226
266
|
return { ...t, columnVisibility: n };
|
|
227
267
|
});
|
|
228
|
-
}, []),
|
|
229
|
-
const e = [], t = [], n =
|
|
230
|
-
(
|
|
268
|
+
}, []), et = A(() => {
|
|
269
|
+
const e = [], t = [], n = m.columns.filter(
|
|
270
|
+
(s) => m.columnVisibility[s.accessorKey] !== !1
|
|
231
271
|
);
|
|
232
|
-
if (
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
272
|
+
if (n.length === 0) return { left: e, right: t };
|
|
273
|
+
const r = /* @__PURE__ */ new Set(), o = [];
|
|
274
|
+
if (p && p.length > 0) {
|
|
275
|
+
const s = /* @__PURE__ */ new Map();
|
|
276
|
+
p.forEach((v) => {
|
|
277
|
+
v.columns.forEach((b) => {
|
|
278
|
+
s.set(b, v.columns), r.add(b);
|
|
279
|
+
});
|
|
280
|
+
});
|
|
281
|
+
const u = /* @__PURE__ */ new Set();
|
|
282
|
+
for (const v of n) {
|
|
283
|
+
const b = s.get(v.accessorKey);
|
|
284
|
+
if (b) {
|
|
285
|
+
const le = b.join(",");
|
|
286
|
+
if (!u.has(le)) {
|
|
287
|
+
u.add(le);
|
|
288
|
+
const ae = b.filter(
|
|
289
|
+
(J) => m.columnVisibility[J] !== !1
|
|
290
|
+
);
|
|
291
|
+
o.push({ type: "group", ids: ae });
|
|
292
|
+
}
|
|
293
|
+
} else
|
|
294
|
+
o.push({ type: "single", id: v.accessorKey });
|
|
295
|
+
}
|
|
296
|
+
} else
|
|
297
|
+
n.forEach((s) => {
|
|
298
|
+
o.push({ type: "single", id: s.accessorKey });
|
|
299
|
+
});
|
|
300
|
+
const a = (s) => s.type === "group" ? s.ids ?? [] : [s.id];
|
|
301
|
+
return m.stickyStart === "first" && o.length > 0 && a(o[0]).forEach((s) => e.push(s)), m.stickyStart === "firstTwo" && o.length > 1 && (a(o[0]).forEach((s) => e.push(s)), a(o[1]).forEach((s) => e.push(s))), m.stickyEnd === "last" && o.length > 0 && a(o[o.length - 1]).forEach((u) => {
|
|
302
|
+
e.includes(u) || t.push(u);
|
|
303
|
+
}), { left: e, right: t };
|
|
304
|
+
}, [m.stickyStart, m.stickyEnd, m.columns, m.columnVisibility, p]), tt = A(() => {
|
|
305
|
+
if (!g || g.mode !== "frontend" || !O.trim()) return f;
|
|
306
|
+
const e = O.toLowerCase(), t = L.filter((n) => m.columnVisibility[n.accessorKey] !== !1).map((n) => n.accessorKey);
|
|
307
|
+
return f.filter(
|
|
308
|
+
(n) => t.some((r) => {
|
|
309
|
+
const o = n[r];
|
|
310
|
+
return o != null && String(o).toLowerCase().includes(e);
|
|
244
311
|
})
|
|
245
312
|
);
|
|
246
|
-
}, [
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}, [
|
|
250
|
-
const
|
|
251
|
-
data:
|
|
252
|
-
columns:
|
|
313
|
+
}, [g, O, f, L, m.columnVisibility]);
|
|
314
|
+
M(() => {
|
|
315
|
+
w.current && (w.current.scrollTop = 0);
|
|
316
|
+
}, [f]);
|
|
317
|
+
const k = at({
|
|
318
|
+
data: tt,
|
|
319
|
+
columns: m.columns,
|
|
253
320
|
defaultColumn: {
|
|
254
321
|
minSize: 100
|
|
255
322
|
},
|
|
256
323
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
257
|
-
sortingFns: { numericSort:
|
|
258
|
-
getRowId: (e, t) =>
|
|
324
|
+
sortingFns: { numericSort: Wt },
|
|
325
|
+
getRowId: (e, t) => $e(e, t),
|
|
259
326
|
state: {
|
|
260
|
-
columnVisibility:
|
|
261
|
-
columnPinning:
|
|
262
|
-
columnFilters:
|
|
263
|
-
columnSizing:
|
|
327
|
+
columnVisibility: m.columnVisibility,
|
|
328
|
+
columnPinning: et,
|
|
329
|
+
columnFilters: Je,
|
|
330
|
+
columnSizing: h
|
|
264
331
|
},
|
|
265
|
-
onColumnFiltersChange:
|
|
266
|
-
onColumnSizingChange:
|
|
332
|
+
onColumnFiltersChange: te,
|
|
333
|
+
onColumnSizingChange: Ee,
|
|
267
334
|
enableRowSelection: !1,
|
|
268
335
|
enableColumnResizing: !0,
|
|
269
336
|
columnResizeMode: "onChange",
|
|
270
|
-
onColumnVisibilityChange:
|
|
271
|
-
getCoreRowModel:
|
|
272
|
-
getSortedRowModel:
|
|
273
|
-
getFilteredRowModel:
|
|
274
|
-
})
|
|
275
|
-
|
|
337
|
+
onColumnVisibilityChange: Ye,
|
|
338
|
+
getCoreRowModel: mt(),
|
|
339
|
+
getSortedRowModel: ut(),
|
|
340
|
+
getFilteredRowModel: dt()
|
|
341
|
+
});
|
|
342
|
+
Y.current = k;
|
|
343
|
+
const { rows: P } = k.getRowModel(), B = k.getVisibleLeafColumns(), Me = B.length > 0 ? B[B.length - 1].id : null, V = (Z?.enabled ?? !1) && !Q?.enabled, _ = V ? 40 : 0, oe = Nt(B, _, h), q = U(/* @__PURE__ */ new Map()), nt = I(
|
|
344
|
+
(e) => q.current.get(e) || kt,
|
|
276
345
|
[]
|
|
277
|
-
),
|
|
278
|
-
count:
|
|
279
|
-
getScrollElement: () =>
|
|
280
|
-
estimateSize:
|
|
346
|
+
), W = lt({
|
|
347
|
+
count: P.length,
|
|
348
|
+
getScrollElement: () => w.current,
|
|
349
|
+
estimateSize: nt,
|
|
281
350
|
overscan: 5
|
|
282
351
|
});
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
352
|
+
M(() => {
|
|
353
|
+
q.current.clear(), requestAnimationFrame(() => {
|
|
354
|
+
W.measure();
|
|
286
355
|
});
|
|
287
|
-
}, [
|
|
288
|
-
const
|
|
356
|
+
}, [m.wrapText, W]);
|
|
357
|
+
const ot = I(
|
|
289
358
|
(e, t) => {
|
|
290
359
|
if (!t) return;
|
|
291
|
-
const n = t.offsetHeight,
|
|
292
|
-
n &&
|
|
293
|
-
|
|
360
|
+
const n = t.offsetHeight, r = q.current.get(e);
|
|
361
|
+
n && r !== n && (q.current.set(e, n), requestAnimationFrame(() => {
|
|
362
|
+
W.measure();
|
|
294
363
|
}));
|
|
295
364
|
},
|
|
296
|
-
[
|
|
297
|
-
),
|
|
298
|
-
|
|
365
|
+
[W]
|
|
366
|
+
), re = (e) => e === "asc" ? /* @__PURE__ */ l(It, {}) : e === "desc" ? /* @__PURE__ */ l(Lt, {}) : /* @__PURE__ */ l(Ft, {}), rt = G.type === "filter" ? /* @__PURE__ */ l(
|
|
367
|
+
Ct,
|
|
299
368
|
{
|
|
300
|
-
filters:
|
|
301
|
-
draftColumnFilters:
|
|
302
|
-
setDraftColumnFilters:
|
|
369
|
+
filters: Ue,
|
|
370
|
+
draftColumnFilters: $,
|
|
371
|
+
setDraftColumnFilters: we,
|
|
303
372
|
handleApplyFilters: () => {
|
|
304
|
-
|
|
373
|
+
te($), E({ ...G, open: !1 }), d && de(`${z}-${d}`, { columnFilters: $ });
|
|
305
374
|
},
|
|
306
|
-
setModalOpen:
|
|
307
|
-
virtualization:
|
|
308
|
-
isFilterChanged: JSON.stringify(
|
|
375
|
+
setModalOpen: E,
|
|
376
|
+
virtualization: x,
|
|
377
|
+
isFilterChanged: JSON.stringify($) !== JSON.stringify(K)
|
|
309
378
|
}
|
|
310
|
-
) : /* @__PURE__ */
|
|
311
|
-
|
|
379
|
+
) : /* @__PURE__ */ l(
|
|
380
|
+
bt,
|
|
312
381
|
{
|
|
313
|
-
draftConfig:
|
|
314
|
-
setDraftConfig:
|
|
315
|
-
moveDraftColumn:
|
|
316
|
-
handleApplyPref:
|
|
317
|
-
setModalOpen:
|
|
318
|
-
handleResetToDefault:
|
|
319
|
-
isDefault:
|
|
320
|
-
isConfigChanged:
|
|
382
|
+
draftConfig: F,
|
|
383
|
+
setDraftConfig: T,
|
|
384
|
+
moveDraftColumn: Xe,
|
|
385
|
+
handleApplyPref: Ze,
|
|
386
|
+
setModalOpen: E,
|
|
387
|
+
handleResetToDefault: Qe,
|
|
388
|
+
isDefault: ce(F, D()),
|
|
389
|
+
isConfigChanged: Mt(F, y),
|
|
390
|
+
headerGroupDefs: p
|
|
321
391
|
}
|
|
322
|
-
),
|
|
323
|
-
return /* @__PURE__ */
|
|
324
|
-
(
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
-
|
|
392
|
+
), se = Te, ie = je && !X;
|
|
393
|
+
return /* @__PURE__ */ C("div", { children: [
|
|
394
|
+
(g || se || ie) && /* @__PURE__ */ C("div", { className: "ckds-filter-wrapper", style: { display: "flex", gap: "8px", margin: "16px 0px 12px 0px", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
395
|
+
/* @__PURE__ */ l("div", { className: "ckds-toolbar-search", children: g && /* @__PURE__ */ l(
|
|
396
|
+
ft,
|
|
327
397
|
{
|
|
328
|
-
value:
|
|
329
|
-
placeholder:
|
|
330
|
-
debounceMs:
|
|
331
|
-
onChange:
|
|
332
|
-
onClear: () =>
|
|
333
|
-
disabled:
|
|
398
|
+
value: O,
|
|
399
|
+
placeholder: g.placeholder ?? "Search",
|
|
400
|
+
debounceMs: g.debounceMs ?? 0,
|
|
401
|
+
onChange: be,
|
|
402
|
+
onClear: () => be(""),
|
|
403
|
+
disabled: ge
|
|
334
404
|
}
|
|
335
405
|
) }),
|
|
336
|
-
(
|
|
337
|
-
|
|
338
|
-
|
|
406
|
+
(se || ie) && /* @__PURE__ */ C("div", { style: { display: "flex", gap: "8px", alignItems: "center" }, children: [
|
|
407
|
+
se && /* @__PURE__ */ l(
|
|
408
|
+
Be,
|
|
339
409
|
{
|
|
410
|
+
className: `relative ${ce(y, D()) ? "" : "after:content-[''] after:absolute after:-top-[1px] after:-right-[1px] after:size-[5px] after:rounded-full after:bg-primary"}`,
|
|
340
411
|
onClick: () => {
|
|
341
|
-
|
|
412
|
+
T({ ...y, columnVisibility: { ...y.columnVisibility }, columns: [...y.columns] }), E({ open: !0, type: "columnManager", activeOption: "" });
|
|
342
413
|
},
|
|
343
414
|
variant: "secondary",
|
|
344
415
|
size: "medium",
|
|
345
|
-
icons: { left: /* @__PURE__ */
|
|
346
|
-
label:
|
|
347
|
-
iconOnly: !
|
|
416
|
+
icons: { left: /* @__PURE__ */ l(pt, {}) },
|
|
417
|
+
label: ye ? "Column Manager" : void 0,
|
|
418
|
+
iconOnly: !ye
|
|
348
419
|
}
|
|
349
420
|
),
|
|
350
|
-
/* @__PURE__ */
|
|
351
|
-
|
|
352
|
-
|
|
421
|
+
/* @__PURE__ */ l("div", { style: { borderRight: "1px solid var(--ckcl-black-200, #C2C2C2)", margin: "5px 0" } }),
|
|
422
|
+
ie && /* @__PURE__ */ l(
|
|
423
|
+
Be,
|
|
353
424
|
{
|
|
354
|
-
className: `relative ${
|
|
425
|
+
className: `relative ${K.length > 0 ? "after:content-[''] after:absolute after:-top-[1px] after:-right-[1px] after:size-[5px] after:rounded-full after:bg-primary" : ""}`,
|
|
355
426
|
onClick: () => {
|
|
356
|
-
|
|
427
|
+
we(K), E({ open: !0, type: "filter", activeOption: "" });
|
|
357
428
|
},
|
|
358
429
|
variant: "secondary",
|
|
359
430
|
size: "medium",
|
|
360
|
-
icons: { right: /* @__PURE__ */
|
|
361
|
-
label:
|
|
362
|
-
iconOnly: !
|
|
431
|
+
icons: { right: /* @__PURE__ */ l(yt, {}) },
|
|
432
|
+
label: ke ? "Filters" : void 0,
|
|
433
|
+
iconOnly: !ke
|
|
363
434
|
}
|
|
364
435
|
)
|
|
365
436
|
] })
|
|
366
437
|
] }),
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
-
|
|
369
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ C("div", { style: { position: "relative", overflow: "hidden", borderRadius: "var(--ckcl-border-radius-lg, 12px)" }, children: [
|
|
439
|
+
ge && /* @__PURE__ */ l(ht, { overlay: !0 }),
|
|
440
|
+
/* @__PURE__ */ l(
|
|
370
441
|
"div",
|
|
371
442
|
{
|
|
372
443
|
className: "ckds-custom-table ckds-custom-scrollbar",
|
|
373
|
-
ref:
|
|
374
|
-
style: { maxHeight:
|
|
375
|
-
children:
|
|
444
|
+
ref: w,
|
|
445
|
+
style: { maxHeight: H, width: k?.getHeaderGroups()?.[0]?.headers?.length === 1 ? "fit-content" : "100%" },
|
|
446
|
+
children: P.length ? /* @__PURE__ */ C(
|
|
376
447
|
"table",
|
|
377
448
|
{
|
|
378
449
|
className: "ckds-dragable-table",
|
|
379
|
-
style: { width: "100%", minWidth:
|
|
450
|
+
style: { width: "100%", minWidth: oe, display: "block" },
|
|
380
451
|
children: [
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
-
|
|
383
|
-
|
|
452
|
+
/* @__PURE__ */ C("thead", { className: "ckds-dragable-thead", style: { display: "block", position: "sticky", top: 0, zIndex: 10, minWidth: oe, backgroundColor: "var(--ckds-cell-bg-default, #ffffff)" }, children: [
|
|
453
|
+
p && p.length > 0 && /* @__PURE__ */ l(
|
|
454
|
+
vt,
|
|
384
455
|
{
|
|
385
|
-
headerGroups:
|
|
386
|
-
table:
|
|
387
|
-
hasSelection:
|
|
388
|
-
getSortIcon:
|
|
389
|
-
selectionCell:
|
|
390
|
-
|
|
456
|
+
headerGroups: p,
|
|
457
|
+
table: k,
|
|
458
|
+
hasSelection: V,
|
|
459
|
+
getSortIcon: re,
|
|
460
|
+
selectionCell: V ? /* @__PURE__ */ l(
|
|
461
|
+
ze,
|
|
391
462
|
{
|
|
392
|
-
isAllSelected:
|
|
393
|
-
isIndeterminate:
|
|
394
|
-
onToggleAll:
|
|
463
|
+
isAllSelected: R.isAllSelected,
|
|
464
|
+
isIndeterminate: R.isIndeterminate,
|
|
465
|
+
onToggleAll: ve
|
|
395
466
|
}
|
|
396
467
|
) : void 0,
|
|
397
|
-
lastColId:
|
|
398
|
-
columnSizing:
|
|
399
|
-
pinnedStyle:
|
|
400
|
-
selectionOffset:
|
|
468
|
+
lastColId: Me,
|
|
469
|
+
columnSizing: h,
|
|
470
|
+
pinnedStyle: ue,
|
|
471
|
+
selectionOffset: _,
|
|
472
|
+
handleResizeWithScrollFollow: Ne
|
|
401
473
|
}
|
|
402
474
|
),
|
|
403
|
-
!(
|
|
404
|
-
|
|
475
|
+
!(p && p.length > 0) && k.getHeaderGroups().map((e) => /* @__PURE__ */ C("tr", { className: "ckds-dragable-tr", style: { display: "flex", width: "100%" }, children: [
|
|
476
|
+
V && /* @__PURE__ */ l(
|
|
405
477
|
"th",
|
|
406
478
|
{
|
|
407
479
|
className: "ckds-dragable-th",
|
|
408
480
|
style: { width: 40, minWidth: 40, maxWidth: 40, flex: "0 0 40px", display: "flex", alignItems: "center", justifyContent: "center", position: "sticky", left: 0, zIndex: 2 },
|
|
409
|
-
children: /* @__PURE__ */
|
|
410
|
-
|
|
481
|
+
children: /* @__PURE__ */ l(
|
|
482
|
+
ze,
|
|
411
483
|
{
|
|
412
|
-
isAllSelected:
|
|
413
|
-
isIndeterminate:
|
|
414
|
-
onToggleAll:
|
|
484
|
+
isAllSelected: R.isAllSelected,
|
|
485
|
+
isIndeterminate: R.isIndeterminate,
|
|
486
|
+
onToggleAll: ve
|
|
415
487
|
}
|
|
416
488
|
)
|
|
417
489
|
}
|
|
418
490
|
),
|
|
419
491
|
e.headers.map((t) => {
|
|
420
|
-
const n = t.column.getIsPinned(),
|
|
421
|
-
return /* @__PURE__ */
|
|
492
|
+
const n = t.column.getIsPinned(), r = t.column.id === Me;
|
|
493
|
+
return /* @__PURE__ */ C(
|
|
422
494
|
"th",
|
|
423
495
|
{
|
|
424
496
|
className: "ckds-dragable-th",
|
|
425
497
|
style: {
|
|
426
|
-
...
|
|
427
|
-
...
|
|
498
|
+
...ue(t.column, k, _, h),
|
|
499
|
+
...Re(t.column, B, h),
|
|
428
500
|
position: n ? "sticky" : "relative",
|
|
429
501
|
zIndex: n ? 2 : void 0,
|
|
430
502
|
display: "flex",
|
|
431
503
|
flexDirection: "column"
|
|
432
504
|
},
|
|
433
505
|
children: [
|
|
434
|
-
/* @__PURE__ */
|
|
506
|
+
/* @__PURE__ */ C(
|
|
435
507
|
"div",
|
|
436
508
|
{
|
|
437
509
|
style: {
|
|
@@ -445,25 +517,25 @@ function jt({
|
|
|
445
517
|
onClick: t.column.getCanSort() ? t.column.getToggleSortingHandler() : void 0,
|
|
446
518
|
role: "button",
|
|
447
519
|
tabIndex: t.column.getCanSort() ? 0 : -1,
|
|
448
|
-
onKeyDown: (
|
|
449
|
-
t.column.getCanSort() && (
|
|
520
|
+
onKeyDown: (o) => {
|
|
521
|
+
t.column.getCanSort() && (o.key === "Enter" || o.key === " ") && t.column.getToggleSortingHandler()?.(o);
|
|
450
522
|
},
|
|
451
523
|
children: [
|
|
452
|
-
t.column.columnDef.align === "right" && t.column.getCanSort() && /* @__PURE__ */
|
|
453
|
-
|
|
454
|
-
t.column.columnDef.align !== "right" && t.column.getCanSort() && /* @__PURE__ */
|
|
524
|
+
t.column.columnDef.align === "right" && t.column.getCanSort() && /* @__PURE__ */ l("span", { className: "ckds-sort-icon ckds-sort-icon-left", children: re(t.column.getIsSorted()) }),
|
|
525
|
+
ct(t.column.columnDef.header, t.getContext()),
|
|
526
|
+
t.column.columnDef.align !== "right" && t.column.getCanSort() && /* @__PURE__ */ l("span", { className: "ckds-sort-icon", children: re(t.column.getIsSorted()) })
|
|
455
527
|
]
|
|
456
528
|
}
|
|
457
529
|
),
|
|
458
|
-
!
|
|
530
|
+
!r && t.column.getCanResize() && /* @__PURE__ */ l(
|
|
459
531
|
"div",
|
|
460
532
|
{
|
|
461
|
-
onMouseDown: t.getResizeHandler(),
|
|
533
|
+
onMouseDown: Ne(t.getResizeHandler()),
|
|
462
534
|
onTouchStart: t.getResizeHandler(),
|
|
463
535
|
className: "ckds-col-resize-handle",
|
|
464
536
|
role: "separator",
|
|
465
537
|
"aria-orientation": "vertical",
|
|
466
|
-
children: /* @__PURE__ */
|
|
538
|
+
children: /* @__PURE__ */ l("div", { className: "ckds-col-resize-line" })
|
|
467
539
|
}
|
|
468
540
|
)
|
|
469
541
|
]
|
|
@@ -473,57 +545,56 @@ function jt({
|
|
|
473
545
|
})
|
|
474
546
|
] }, e.id))
|
|
475
547
|
] }),
|
|
476
|
-
/* @__PURE__ */
|
|
548
|
+
/* @__PURE__ */ l(
|
|
477
549
|
"tbody",
|
|
478
550
|
{
|
|
479
551
|
className: "ckds-dragable-tbody",
|
|
480
552
|
style: {
|
|
481
|
-
height:
|
|
553
|
+
height: x && P.length ? `${W.getTotalSize()}px` : "auto",
|
|
482
554
|
position: "relative",
|
|
483
555
|
display: "block",
|
|
484
556
|
width: "100%",
|
|
485
|
-
minWidth:
|
|
557
|
+
minWidth: oe
|
|
486
558
|
},
|
|
487
|
-
children: /* @__PURE__ */
|
|
488
|
-
|
|
559
|
+
children: /* @__PURE__ */ l(
|
|
560
|
+
xt,
|
|
489
561
|
{
|
|
490
|
-
rows:
|
|
491
|
-
virtualization:
|
|
492
|
-
rowVirtualizer:
|
|
493
|
-
handleMeasure:
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
onToggleExpand: Re
|
|
562
|
+
rows: P,
|
|
563
|
+
virtualization: x,
|
|
564
|
+
rowVirtualizer: W,
|
|
565
|
+
handleMeasure: ot,
|
|
566
|
+
columnSizing: h,
|
|
567
|
+
tableConfig: m,
|
|
568
|
+
table: k,
|
|
569
|
+
selectionState: R,
|
|
570
|
+
selectionConfig: Z,
|
|
571
|
+
onToggleRowSelection: Ge,
|
|
572
|
+
expandableConfig: Q,
|
|
573
|
+
expandedIds: Pe,
|
|
574
|
+
onToggleExpand: _e
|
|
504
575
|
}
|
|
505
576
|
)
|
|
506
577
|
}
|
|
507
578
|
),
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
const n = e.getIsPinned(),
|
|
579
|
+
fe && /* @__PURE__ */ l("tfoot", { className: "ckds-dragable-tfoot", style: { display: "block", position: "sticky", bottom: 0, zIndex: 10, backgroundColor: "var(--ckds-cell-bg-default, #ffffff)" }, children: /* @__PURE__ */ C("tr", { className: "ckds-dragable-tr", style: { display: "flex", width: "100%" }, children: [
|
|
580
|
+
V && /* @__PURE__ */ l("td", { className: "ckds-dragable-td ckds-dragable-total-td", style: { display: "flex", alignItems: "center", width: 40, minWidth: 40, maxWidth: 40, flex: "0 0 40px", position: "sticky", left: 0, zIndex: 2 } }),
|
|
581
|
+
k.getVisibleLeafColumns().map((e, t) => {
|
|
582
|
+
const n = e.getIsPinned(), r = fe[e.id], o = e.columnDef;
|
|
512
583
|
let a = null;
|
|
513
|
-
t === 0 &&
|
|
514
|
-
const
|
|
515
|
-
return /* @__PURE__ */
|
|
584
|
+
t === 0 && r === void 0 ? a = /* @__PURE__ */ l("span", { children: "Total" }) : r !== void 0 && (typeof r == "object" && r !== null ? a = /* @__PURE__ */ l("span", { children: r }) : o.prefix || o.suffix || o.decimalPlaces !== void 0 ? a = /* @__PURE__ */ l("span", { children: De(r, o) }) : a = /* @__PURE__ */ l("span", { children: r }));
|
|
585
|
+
const s = o.align === "right" ? "right" : o.align === "center" ? "center" : "left";
|
|
586
|
+
return /* @__PURE__ */ l(
|
|
516
587
|
"td",
|
|
517
588
|
{
|
|
518
589
|
className: "ckds-dragable-td ckds-dragable-total-td",
|
|
519
590
|
style: {
|
|
520
|
-
...
|
|
591
|
+
...ue(e, k, _, h),
|
|
521
592
|
display: "flex",
|
|
522
593
|
alignItems: "center",
|
|
523
|
-
...
|
|
594
|
+
...Re(e, B, h),
|
|
524
595
|
zIndex: n ? 2 : void 0
|
|
525
596
|
},
|
|
526
|
-
children: /* @__PURE__ */
|
|
597
|
+
children: /* @__PURE__ */ l("div", { style: { width: "100%", textAlign: s, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: a })
|
|
527
598
|
},
|
|
528
599
|
e.id
|
|
529
600
|
);
|
|
@@ -531,13 +602,13 @@ function jt({
|
|
|
531
602
|
] }) })
|
|
532
603
|
]
|
|
533
604
|
}
|
|
534
|
-
) : /* @__PURE__ */
|
|
535
|
-
|
|
605
|
+
) : /* @__PURE__ */ l(
|
|
606
|
+
gt,
|
|
536
607
|
{
|
|
537
|
-
icon:
|
|
608
|
+
icon: He ?? /* @__PURE__ */ l(Bt, {}),
|
|
538
609
|
message: {
|
|
539
|
-
heading:
|
|
540
|
-
content:
|
|
610
|
+
heading: me?.heading ?? "No data to display",
|
|
611
|
+
content: me?.content ?? "There's no activity recorded for this period or filter selection."
|
|
541
612
|
},
|
|
542
613
|
classNames: { wrapperClass: "ckds-table-empty-state-wrapper" }
|
|
543
614
|
}
|
|
@@ -545,11 +616,11 @@ function jt({
|
|
|
545
616
|
}
|
|
546
617
|
)
|
|
547
618
|
] }),
|
|
548
|
-
|
|
619
|
+
G.open && !X && !S && /* @__PURE__ */ l(
|
|
549
620
|
"div",
|
|
550
621
|
{
|
|
551
622
|
className: "ckds-table-filter-modal-wr",
|
|
552
|
-
onClick: () =>
|
|
623
|
+
onClick: () => E({ ...G, open: !1 }),
|
|
553
624
|
role: "dialog",
|
|
554
625
|
"aria-modal": "true",
|
|
555
626
|
style: {
|
|
@@ -561,12 +632,12 @@ function jt({
|
|
|
561
632
|
justifyContent: "center",
|
|
562
633
|
backgroundColor: "rgba(0,0,0,0.3)"
|
|
563
634
|
},
|
|
564
|
-
children: /* @__PURE__ */
|
|
635
|
+
children: /* @__PURE__ */ l(
|
|
565
636
|
"div",
|
|
566
637
|
{
|
|
567
638
|
className: "ckds-table-modal-box",
|
|
568
639
|
onClick: (e) => e.stopPropagation(),
|
|
569
|
-
children:
|
|
640
|
+
children: rt
|
|
570
641
|
}
|
|
571
642
|
)
|
|
572
643
|
}
|
|
@@ -574,6 +645,6 @@ function jt({
|
|
|
574
645
|
] });
|
|
575
646
|
}
|
|
576
647
|
export {
|
|
577
|
-
|
|
578
|
-
|
|
648
|
+
tn as CustomTable,
|
|
649
|
+
tn as default
|
|
579
650
|
};
|