@ck-ui/component-library 1.0.9 → 1.0.10
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-BmXLYRcE.js → DropdownFooter-CJnM_ECj.js} +1 -1
- package/dist/assets/{index-CRlPQn7l.css → index-EOsQwhza.css} +1 -1
- package/dist/assets/{styles-D2n8YjU_.css → styles-DrYTmjez.css} +1 -1
- package/dist/components/FusionChart/_config/builders.d.ts.map +1 -1
- package/dist/components/FusionChart/_config/builders.js +120 -119
- package/dist/components/FusionChart/_config/helpers.js +6 -6
- package/dist/components/FusionChart/_constant/constants.d.ts +3 -3
- package/dist/components/FusionChart/_constant/constants.js +1 -1
- package/dist/components/FusionChart/_helpers/doughnutHelper.js +13 -13
- package/dist/components/FusionChart/_types/fusionChart.types.d.ts +0 -1
- 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 +163 -152
- package/dist/components/SingleSelectDropdown/_helpers/DropdownFooter.js +2 -2
- package/dist/components/SingleSelectDropdown/index.js +2 -2
- package/dist/components/Table/_helpers/FilterColumnToolbar.js +36 -36
- package/dist/components/Table/index.js +91 -91
- package/package.json +1 -1
|
@@ -3,48 +3,48 @@ import * as i from "react";
|
|
|
3
3
|
import { useState as N, useEffect as M, useCallback as I, useRef as U, useMemo as A } from "react";
|
|
4
4
|
import { flushSync as it } from "react-dom";
|
|
5
5
|
import { u as lt } from "../../OptionList-DU0iA8Y4.js";
|
|
6
|
-
import { u as
|
|
6
|
+
import { u as ct, f as at, g as dt, a as ut, b as mt } from "../../index-Bcvmezbu.js";
|
|
7
7
|
import { CKButton as Be } from "../CKButton/index.js";
|
|
8
8
|
import { Search as ft } from "../Search/index.js";
|
|
9
9
|
import { EmptyState as gt } from "../EmptyState/index.js";
|
|
10
10
|
import { Loader as ht } from "../Loader/index.js";
|
|
11
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
|
|
12
|
+
import { INITIAL_COLUMN_MANAGER_CONFIG as We, ROW_MIN_HEIGHT as kt, TABLE_PREFIX as R } from "./constants.js";
|
|
13
13
|
import Ct from "./_helpers/TableFilterModal/index.js";
|
|
14
14
|
import bt from "./_helpers/ColumnManager/index.js";
|
|
15
15
|
import vt from "./_helpers/GroupedHeader/index.js";
|
|
16
|
-
import { SelectionHeaderCell as
|
|
17
|
-
import
|
|
18
|
-
import { useSelection as
|
|
19
|
-
import { useExpansion as
|
|
16
|
+
import { SelectionHeaderCell as Re } from "./_helpers/SelectionCell/index.js";
|
|
17
|
+
import St from "./_helpers/TableRows.js";
|
|
18
|
+
import { useSelection as wt } from "./_hooks/useSelection.js";
|
|
19
|
+
import { useExpansion as xt } from "./_hooks/useExpansion.js";
|
|
20
20
|
import { useOverlayScrollbar as Et } from "./_hooks/useOverlayScrollbar.js";
|
|
21
|
-
import { isTableConfigDefault as
|
|
21
|
+
import { isTableConfigDefault as ae, saveToLocalStorage as de, getTableMinWidth as Nt, isTableConfigChanged as Mt, pinnedStyle as ue, columnLayoutStyle as ze } from "./_utils/table.utils.js";
|
|
22
22
|
import { formatCellValue as De } from "./_utils/formatCellValue.js";
|
|
23
|
-
import '../../assets/styles-
|
|
24
|
-
const It = (
|
|
23
|
+
import '../../assets/styles-DrYTmjez.css';/* empty css */
|
|
24
|
+
const It = (a) => /* @__PURE__ */ i.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 14, height: 14, viewBox: "0 0 14 14", fill: "none", ...a }, /* @__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 = (a) => /* @__PURE__ */ i.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 14, height: 14, viewBox: "0 0 14 14", fill: "none", ...a }, /* @__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 = (a) => /* @__PURE__ */ i.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 14, height: 14, viewBox: "0 0 14 14", fill: "none", ...a }, /* @__PURE__ */ i.createElement("mask", { id: "mask0_1852_13537", style: {
|
|
25
25
|
maskType: "luminance"
|
|
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 = (
|
|
27
|
-
if (typeof
|
|
28
|
-
if (
|
|
29
|
-
const f = String(
|
|
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 = (a) => /* @__PURE__ */ i.createElement("svg", { width: 200, height: 180, viewBox: "0 0 200 180", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...a }, /* @__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 = (a) => {
|
|
27
|
+
if (typeof a == "number") return a;
|
|
28
|
+
if (a == null) return NaN;
|
|
29
|
+
const f = String(a).replace(/[^0-9.-]/g, "");
|
|
30
30
|
return f === "" ? NaN : Number(f);
|
|
31
|
-
}, Wt = (
|
|
32
|
-
const
|
|
33
|
-
return Number.isNaN(
|
|
31
|
+
}, Wt = (a, f, H) => {
|
|
32
|
+
const S = Ke(a.getValue(H)), d = Ke(f.getValue(H));
|
|
33
|
+
return Number.isNaN(S) && Number.isNaN(d) ? 0 : Number.isNaN(S) ? 1 : Number.isNaN(d) ? -1 : S - d;
|
|
34
34
|
};
|
|
35
35
|
let Ve = !1;
|
|
36
|
-
const Ae = (
|
|
37
|
-
if (typeof
|
|
38
|
-
if (typeof
|
|
39
|
-
const f = Number.parseFloat(
|
|
36
|
+
const Ae = (a) => {
|
|
37
|
+
if (typeof a == "number") return a;
|
|
38
|
+
if (typeof a == "string" && a.trim().endsWith("px")) {
|
|
39
|
+
const f = Number.parseFloat(a);
|
|
40
40
|
return Number.isNaN(f) ? void 0 : f;
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
function tn({
|
|
44
|
-
config:
|
|
44
|
+
config: a = {},
|
|
45
45
|
data: f = [],
|
|
46
46
|
maxHeight: H = "600px",
|
|
47
|
-
virtualization:
|
|
47
|
+
virtualization: S = !1,
|
|
48
48
|
persistTableConfig: d = "",
|
|
49
49
|
message: me,
|
|
50
50
|
icon: He,
|
|
@@ -52,7 +52,7 @@ function tn({
|
|
|
52
52
|
selection: Z,
|
|
53
53
|
expandable: Q,
|
|
54
54
|
externalColumnFilters: X,
|
|
55
|
-
externalTableConfig:
|
|
55
|
+
externalTableConfig: w,
|
|
56
56
|
onConfigChange: Oe,
|
|
57
57
|
isLoading: ge = !1
|
|
58
58
|
}) {
|
|
@@ -64,35 +64,35 @@ function tn({
|
|
|
64
64
|
columnManagerConfig: he = We,
|
|
65
65
|
toolbarLabels: pe,
|
|
66
66
|
search: g
|
|
67
|
-
} =
|
|
67
|
+
} = a ?? {}, ye = pe?.columnManager ?? !0, ke = pe?.filter ?? !0, [O, Ce] = N(g?.value ?? "");
|
|
68
68
|
M(() => {
|
|
69
69
|
g?.value !== void 0 && Ce(g.value);
|
|
70
70
|
}, [g?.value]);
|
|
71
71
|
const be = I((e) => {
|
|
72
72
|
Ce(e), g?.onSearch?.(e);
|
|
73
|
-
}, [g]),
|
|
74
|
-
Et(
|
|
73
|
+
}, [g]), x = U(null), Y = U(null);
|
|
74
|
+
Et(x);
|
|
75
75
|
const {
|
|
76
|
-
selectionState:
|
|
76
|
+
selectionState: z,
|
|
77
77
|
getRowId: $e,
|
|
78
78
|
toggleRowSelection: Ge,
|
|
79
79
|
toggleSelectAll: ve
|
|
80
|
-
} =
|
|
80
|
+
} = wt(f, Z), {
|
|
81
81
|
expandedIds: Pe,
|
|
82
82
|
toggleExpand: _e
|
|
83
|
-
} =
|
|
83
|
+
} = xt(Q), j = A(
|
|
84
84
|
() => L.map((e) => {
|
|
85
85
|
let t = "includesString";
|
|
86
86
|
return e.filterable && (e.type === "string" ? t = (n, r, o) => {
|
|
87
87
|
if (!o) return !0;
|
|
88
|
-
const
|
|
89
|
-
if (!
|
|
88
|
+
const c = Array.isArray(o) ? o : o.values, s = Array.isArray(o) ? !1 : o.exclude;
|
|
89
|
+
if (!c || c.length === 0) return !0;
|
|
90
90
|
const u = String(n.getValue(r));
|
|
91
|
-
return s ? !
|
|
91
|
+
return s ? !c.includes(u) : c.includes(u);
|
|
92
92
|
} : e.type === "number" && (t = (n, r, o) => {
|
|
93
93
|
if (!o) return !0;
|
|
94
|
-
const
|
|
95
|
-
return
|
|
94
|
+
const c = Number(n.getValue(r));
|
|
95
|
+
return c >= o.min && c <= o.max;
|
|
96
96
|
})), {
|
|
97
97
|
...e,
|
|
98
98
|
enableSorting: e.sortable !== !1,
|
|
@@ -115,28 +115,28 @@ function tn({
|
|
|
115
115
|
columns: j
|
|
116
116
|
}),
|
|
117
117
|
[he, j]
|
|
118
|
-
),
|
|
118
|
+
), Se = () => {
|
|
119
119
|
const e = D();
|
|
120
120
|
if (d)
|
|
121
121
|
try {
|
|
122
|
-
const t = localStorage.getItem(`${
|
|
122
|
+
const t = localStorage.getItem(`${R}-${d}`);
|
|
123
123
|
if (t) {
|
|
124
124
|
const n = JSON.parse(t);
|
|
125
125
|
if (n?.tableConfig) {
|
|
126
|
-
const r = n.tableConfig.columns || [], o = /* @__PURE__ */ new Set(),
|
|
126
|
+
const r = n.tableConfig.columns || [], o = /* @__PURE__ */ new Set(), c = 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
127
|
return e.columns.forEach((s) => {
|
|
128
|
-
|
|
129
|
-
}), { ...e, ...n.tableConfig, columns:
|
|
128
|
+
c.find((u) => u.accessorKey === s.accessorKey) || c.push(s);
|
|
129
|
+
}), { ...e, ...n.tableConfig, columns: c };
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
} catch (t) {
|
|
133
133
|
console.error("Failed to load table config from local storage", t);
|
|
134
134
|
}
|
|
135
135
|
return e;
|
|
136
|
-
},
|
|
136
|
+
}, we = () => {
|
|
137
137
|
if (d)
|
|
138
138
|
try {
|
|
139
|
-
const e = localStorage.getItem(`${
|
|
139
|
+
const e = localStorage.getItem(`${R}-${d}`);
|
|
140
140
|
if (e) {
|
|
141
141
|
const t = JSON.parse(e);
|
|
142
142
|
if (t?.columnFilters) return t.columnFilters;
|
|
@@ -148,7 +148,7 @@ function tn({
|
|
|
148
148
|
}, qe = () => {
|
|
149
149
|
if (d)
|
|
150
150
|
try {
|
|
151
|
-
const e = localStorage.getItem(`${
|
|
151
|
+
const e = localStorage.getItem(`${R}-${d}`);
|
|
152
152
|
if (e) {
|
|
153
153
|
const t = JSON.parse(e);
|
|
154
154
|
if (t?.columnSizing) return t.columnSizing;
|
|
@@ -157,19 +157,19 @@ function tn({
|
|
|
157
157
|
console.error("Failed to load table config from local storage", e);
|
|
158
158
|
}
|
|
159
159
|
return {};
|
|
160
|
-
}, [y, ee] = N(
|
|
160
|
+
}, [y, ee] = N(Se), [F, T] = N(Se), [K, te] = N(we), [$, xe] = N(we), [h, Ee] = N(qe), ne = U(h);
|
|
161
161
|
ne.current = h;
|
|
162
162
|
const Ne = I(
|
|
163
163
|
(e) => (t) => {
|
|
164
|
-
const n =
|
|
164
|
+
const n = x.current;
|
|
165
165
|
if (n && Y.current) {
|
|
166
166
|
const s = Y.current.getVisibleLeafColumns(), u = { ...ne.current }, v = n.querySelector(".ckds-dragable-tbody .ckds-dragable-tr");
|
|
167
167
|
if (v) {
|
|
168
|
-
const b = v.querySelectorAll(".ckds-dragable-td"),
|
|
168
|
+
const b = v.querySelectorAll(".ckds-dragable-td"), ce = b.length > s.length ? 1 : 0;
|
|
169
169
|
let J = !1;
|
|
170
170
|
s.forEach((Ie, st) => {
|
|
171
171
|
if (u[Ie.id] === void 0) {
|
|
172
|
-
const Le = b[st +
|
|
172
|
+
const Le = b[st + ce];
|
|
173
173
|
if (Le) {
|
|
174
174
|
const Fe = Le.offsetWidth;
|
|
175
175
|
Fe > 0 && (u[Ie.id] = Fe, J = !0);
|
|
@@ -190,19 +190,19 @@ function tn({
|
|
|
190
190
|
n.scrollLeft = Math.max(0, n.scrollLeft - u);
|
|
191
191
|
}
|
|
192
192
|
r = s;
|
|
193
|
-
},
|
|
194
|
-
document.removeEventListener("mousemove", o), document.removeEventListener("mouseup",
|
|
193
|
+
}, c = () => {
|
|
194
|
+
document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", c);
|
|
195
195
|
};
|
|
196
|
-
document.addEventListener("mousemove", o), document.addEventListener("mouseup",
|
|
196
|
+
document.addEventListener("mousemove", o), document.addEventListener("mouseup", c);
|
|
197
197
|
},
|
|
198
|
-
[
|
|
198
|
+
[x]
|
|
199
199
|
), [G, E] = N({ open: !1, type: "", activeOption: "" });
|
|
200
200
|
M(() => {
|
|
201
|
-
|
|
202
|
-
}, [
|
|
201
|
+
w && ee(w);
|
|
202
|
+
}, [w]);
|
|
203
203
|
const m = A(() => {
|
|
204
|
-
const e =
|
|
205
|
-
if (!
|
|
204
|
+
const e = w ?? y;
|
|
205
|
+
if (!w) return e;
|
|
206
206
|
const t = new Map(j.map((n) => [n.accessorKey, n]));
|
|
207
207
|
return {
|
|
208
208
|
...e,
|
|
@@ -216,7 +216,7 @@ function tn({
|
|
|
216
216
|
} : n;
|
|
217
217
|
})
|
|
218
218
|
};
|
|
219
|
-
}, [
|
|
219
|
+
}, [w, y, j]), Je = X ?? K, Ue = A(() => {
|
|
220
220
|
const e = {};
|
|
221
221
|
return L.forEach((t) => {
|
|
222
222
|
if (m.columnVisibility[t.accessorKey] !== !1) {
|
|
@@ -226,7 +226,7 @@ function tn({
|
|
|
226
226
|
];
|
|
227
227
|
e[t.header] = { type: "checkbox", options: n, accessorKey: t.accessorKey };
|
|
228
228
|
} else if (t.filterable && t.type === "number") {
|
|
229
|
-
const n = f.map((
|
|
229
|
+
const n = f.map((c) => Number(c[t.accessorKey])).filter((c) => !Number.isNaN(c)), r = n.length ? Math.floor(Math.min(...n)) : 0, o = n.length ? Math.ceil(Math.max(...n)) : 0;
|
|
230
230
|
e[t.header] = { type: "range", values: { min: r, max: o }, accessorKey: t.accessorKey };
|
|
231
231
|
}
|
|
232
232
|
}
|
|
@@ -235,13 +235,13 @@ function tn({
|
|
|
235
235
|
M(() => {
|
|
236
236
|
if (d && !Ve)
|
|
237
237
|
try {
|
|
238
|
-
const e = K.length > 0, t = !
|
|
238
|
+
const e = K.length > 0, t = !ae(y, D());
|
|
239
239
|
(e || t) && (Ve = !0);
|
|
240
240
|
} catch (e) {
|
|
241
241
|
console.error("Failed to check toast condition", e);
|
|
242
242
|
}
|
|
243
243
|
}, [d]), M(() => {
|
|
244
|
-
d && Object.keys(h).length > 0 && de(`${
|
|
244
|
+
d && Object.keys(h).length > 0 && de(`${R}-${d}`, { columnSizing: h });
|
|
245
245
|
}, [h, d]), M(() => {
|
|
246
246
|
te((e) => {
|
|
247
247
|
const t = e.filter(
|
|
@@ -252,7 +252,7 @@ function tn({
|
|
|
252
252
|
}, [y.columnVisibility]);
|
|
253
253
|
const Ze = () => {
|
|
254
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(`${
|
|
255
|
+
ee(n), E({ type: "", activeOption: "", open: !1 }), d && de(`${R}-${d}`, { tableConfig: n }), Oe?.(F);
|
|
256
256
|
}, Qe = () => {
|
|
257
257
|
T(D);
|
|
258
258
|
}, Xe = I((e, t) => {
|
|
@@ -285,10 +285,10 @@ function tn({
|
|
|
285
285
|
const le = b.join(",");
|
|
286
286
|
if (!u.has(le)) {
|
|
287
287
|
u.add(le);
|
|
288
|
-
const
|
|
288
|
+
const ce = b.filter(
|
|
289
289
|
(J) => m.columnVisibility[J] !== !1
|
|
290
290
|
);
|
|
291
|
-
o.push({ type: "group", ids:
|
|
291
|
+
o.push({ type: "group", ids: ce });
|
|
292
292
|
}
|
|
293
293
|
} else
|
|
294
294
|
o.push({ type: "single", id: v.accessorKey });
|
|
@@ -297,8 +297,8 @@ function tn({
|
|
|
297
297
|
n.forEach((s) => {
|
|
298
298
|
o.push({ type: "single", id: s.accessorKey });
|
|
299
299
|
});
|
|
300
|
-
const
|
|
301
|
-
return m.stickyStart === "first" && o.length > 0 &&
|
|
300
|
+
const c = (s) => s.type === "group" ? s.ids ?? [] : [s.id];
|
|
301
|
+
return m.stickyStart === "first" && o.length > 0 && c(o[0]).forEach((s) => e.push(s)), m.stickyStart === "firstTwo" && o.length > 1 && (c(o[0]).forEach((s) => e.push(s)), c(o[1]).forEach((s) => e.push(s))), m.stickyEnd === "last" && o.length > 0 && c(o[o.length - 1]).forEach((u) => {
|
|
302
302
|
e.includes(u) || t.push(u);
|
|
303
303
|
}), { left: e, right: t };
|
|
304
304
|
}, [m.stickyStart, m.stickyEnd, m.columns, m.columnVisibility, p]), tt = A(() => {
|
|
@@ -312,9 +312,9 @@ function tn({
|
|
|
312
312
|
);
|
|
313
313
|
}, [g, O, f, L, m.columnVisibility]);
|
|
314
314
|
M(() => {
|
|
315
|
-
|
|
315
|
+
x.current && (x.current.scrollTop = 0);
|
|
316
316
|
}, [f]);
|
|
317
|
-
const k =
|
|
317
|
+
const k = ct({
|
|
318
318
|
data: tt,
|
|
319
319
|
columns: m.columns,
|
|
320
320
|
defaultColumn: {
|
|
@@ -345,7 +345,7 @@ function tn({
|
|
|
345
345
|
[]
|
|
346
346
|
), W = lt({
|
|
347
347
|
count: P.length,
|
|
348
|
-
getScrollElement: () =>
|
|
348
|
+
getScrollElement: () => x.current,
|
|
349
349
|
estimateSize: nt,
|
|
350
350
|
overscan: 5
|
|
351
351
|
});
|
|
@@ -368,12 +368,12 @@ function tn({
|
|
|
368
368
|
{
|
|
369
369
|
filters: Ue,
|
|
370
370
|
draftColumnFilters: $,
|
|
371
|
-
setDraftColumnFilters:
|
|
371
|
+
setDraftColumnFilters: xe,
|
|
372
372
|
handleApplyFilters: () => {
|
|
373
|
-
te($), E({ ...G, open: !1 }), d && de(`${
|
|
373
|
+
te($), E({ ...G, open: !1 }), d && de(`${R}-${d}`, { columnFilters: $ });
|
|
374
374
|
},
|
|
375
375
|
setModalOpen: E,
|
|
376
|
-
virtualization:
|
|
376
|
+
virtualization: S,
|
|
377
377
|
isFilterChanged: JSON.stringify($) !== JSON.stringify(K)
|
|
378
378
|
}
|
|
379
379
|
) : /* @__PURE__ */ l(
|
|
@@ -385,7 +385,7 @@ function tn({
|
|
|
385
385
|
handleApplyPref: Ze,
|
|
386
386
|
setModalOpen: E,
|
|
387
387
|
handleResetToDefault: Qe,
|
|
388
|
-
isDefault:
|
|
388
|
+
isDefault: ae(F, D()),
|
|
389
389
|
isConfigChanged: Mt(F, y),
|
|
390
390
|
headerGroupDefs: p
|
|
391
391
|
}
|
|
@@ -407,7 +407,7 @@ function tn({
|
|
|
407
407
|
se && /* @__PURE__ */ l(
|
|
408
408
|
Be,
|
|
409
409
|
{
|
|
410
|
-
className:
|
|
410
|
+
className: `${ae(y, D()) ? "" : "ckds-toolbar-btn-indicator"}`,
|
|
411
411
|
onClick: () => {
|
|
412
412
|
T({ ...y, columnVisibility: { ...y.columnVisibility }, columns: [...y.columns] }), E({ open: !0, type: "columnManager", activeOption: "" });
|
|
413
413
|
},
|
|
@@ -422,9 +422,9 @@ function tn({
|
|
|
422
422
|
ie && /* @__PURE__ */ l(
|
|
423
423
|
Be,
|
|
424
424
|
{
|
|
425
|
-
className:
|
|
425
|
+
className: `${K.length > 0 ? "ckds-toolbar-btn-indicator" : ""}`,
|
|
426
426
|
onClick: () => {
|
|
427
|
-
|
|
427
|
+
xe(K), E({ open: !0, type: "filter", activeOption: "" });
|
|
428
428
|
},
|
|
429
429
|
variant: "secondary",
|
|
430
430
|
size: "medium",
|
|
@@ -441,7 +441,7 @@ function tn({
|
|
|
441
441
|
"div",
|
|
442
442
|
{
|
|
443
443
|
className: "ckds-custom-table ckds-custom-scrollbar",
|
|
444
|
-
ref:
|
|
444
|
+
ref: x,
|
|
445
445
|
style: { maxHeight: H, width: k?.getHeaderGroups()?.[0]?.headers?.length === 1 ? "fit-content" : "100%" },
|
|
446
446
|
children: P.length ? /* @__PURE__ */ C(
|
|
447
447
|
"table",
|
|
@@ -458,10 +458,10 @@ function tn({
|
|
|
458
458
|
hasSelection: V,
|
|
459
459
|
getSortIcon: re,
|
|
460
460
|
selectionCell: V ? /* @__PURE__ */ l(
|
|
461
|
-
|
|
461
|
+
Re,
|
|
462
462
|
{
|
|
463
|
-
isAllSelected:
|
|
464
|
-
isIndeterminate:
|
|
463
|
+
isAllSelected: z.isAllSelected,
|
|
464
|
+
isIndeterminate: z.isIndeterminate,
|
|
465
465
|
onToggleAll: ve
|
|
466
466
|
}
|
|
467
467
|
) : void 0,
|
|
@@ -479,10 +479,10 @@ function tn({
|
|
|
479
479
|
className: "ckds-dragable-th",
|
|
480
480
|
style: { width: 40, minWidth: 40, maxWidth: 40, flex: "0 0 40px", display: "flex", alignItems: "center", justifyContent: "center", position: "sticky", left: 0, zIndex: 2 },
|
|
481
481
|
children: /* @__PURE__ */ l(
|
|
482
|
-
|
|
482
|
+
Re,
|
|
483
483
|
{
|
|
484
|
-
isAllSelected:
|
|
485
|
-
isIndeterminate:
|
|
484
|
+
isAllSelected: z.isAllSelected,
|
|
485
|
+
isIndeterminate: z.isIndeterminate,
|
|
486
486
|
onToggleAll: ve
|
|
487
487
|
}
|
|
488
488
|
)
|
|
@@ -496,7 +496,7 @@ function tn({
|
|
|
496
496
|
className: "ckds-dragable-th",
|
|
497
497
|
style: {
|
|
498
498
|
...ue(t.column, k, _, h),
|
|
499
|
-
...
|
|
499
|
+
...ze(t.column, B, h),
|
|
500
500
|
position: n ? "sticky" : "relative",
|
|
501
501
|
zIndex: n ? 2 : void 0,
|
|
502
502
|
display: "flex",
|
|
@@ -522,7 +522,7 @@ function tn({
|
|
|
522
522
|
},
|
|
523
523
|
children: [
|
|
524
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
|
-
|
|
525
|
+
at(t.column.columnDef.header, t.getContext()),
|
|
526
526
|
t.column.columnDef.align !== "right" && t.column.getCanSort() && /* @__PURE__ */ l("span", { className: "ckds-sort-icon", children: re(t.column.getIsSorted()) })
|
|
527
527
|
]
|
|
528
528
|
}
|
|
@@ -550,23 +550,23 @@ function tn({
|
|
|
550
550
|
{
|
|
551
551
|
className: "ckds-dragable-tbody",
|
|
552
552
|
style: {
|
|
553
|
-
height:
|
|
553
|
+
height: S && P.length ? `${W.getTotalSize()}px` : "auto",
|
|
554
554
|
position: "relative",
|
|
555
555
|
display: "block",
|
|
556
556
|
width: "100%",
|
|
557
557
|
minWidth: oe
|
|
558
558
|
},
|
|
559
559
|
children: /* @__PURE__ */ l(
|
|
560
|
-
|
|
560
|
+
St,
|
|
561
561
|
{
|
|
562
562
|
rows: P,
|
|
563
|
-
virtualization:
|
|
563
|
+
virtualization: S,
|
|
564
564
|
rowVirtualizer: W,
|
|
565
565
|
handleMeasure: ot,
|
|
566
566
|
columnSizing: h,
|
|
567
567
|
tableConfig: m,
|
|
568
568
|
table: k,
|
|
569
|
-
selectionState:
|
|
569
|
+
selectionState: z,
|
|
570
570
|
selectionConfig: Z,
|
|
571
571
|
onToggleRowSelection: Ge,
|
|
572
572
|
expandableConfig: Q,
|
|
@@ -580,8 +580,8 @@ function tn({
|
|
|
580
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
581
|
k.getVisibleLeafColumns().map((e, t) => {
|
|
582
582
|
const n = e.getIsPinned(), r = fe[e.id], o = e.columnDef;
|
|
583
|
-
let
|
|
584
|
-
t === 0 && r === void 0 ?
|
|
583
|
+
let c = null;
|
|
584
|
+
t === 0 && r === void 0 ? c = /* @__PURE__ */ l("span", { children: "Total" }) : r !== void 0 && (typeof r == "object" && r !== null ? c = /* @__PURE__ */ l("span", { children: r }) : o.prefix || o.suffix || o.decimalPlaces !== void 0 ? c = /* @__PURE__ */ l("span", { children: De(r, o) }) : c = /* @__PURE__ */ l("span", { children: r }));
|
|
585
585
|
const s = o.align === "right" ? "right" : o.align === "center" ? "center" : "left";
|
|
586
586
|
return /* @__PURE__ */ l(
|
|
587
587
|
"td",
|
|
@@ -591,10 +591,10 @@ function tn({
|
|
|
591
591
|
...ue(e, k, _, h),
|
|
592
592
|
display: "flex",
|
|
593
593
|
alignItems: "center",
|
|
594
|
-
...
|
|
594
|
+
...ze(e, B, h),
|
|
595
595
|
zIndex: n ? 2 : void 0
|
|
596
596
|
},
|
|
597
|
-
children: /* @__PURE__ */ l("div", { style: { width: "100%", textAlign: s, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children:
|
|
597
|
+
children: /* @__PURE__ */ l("div", { style: { width: "100%", textAlign: s, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: c })
|
|
598
598
|
},
|
|
599
599
|
e.id
|
|
600
600
|
);
|
|
@@ -616,7 +616,7 @@ function tn({
|
|
|
616
616
|
}
|
|
617
617
|
)
|
|
618
618
|
] }),
|
|
619
|
-
G.open && !X && !
|
|
619
|
+
G.open && !X && !w && /* @__PURE__ */ l(
|
|
620
620
|
"div",
|
|
621
621
|
{
|
|
622
622
|
className: "ckds-table-filter-modal-wr",
|