@ck-ui/component-library 1.0.8 → 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.
Files changed (49) hide show
  1. package/dist/{DropdownFooter-B1d0HFxd.js → DropdownFooter-BmXLYRcE.js} +4 -3
  2. package/dist/{OptionList-BM4AleXV.js → OptionList-DU0iA8Y4.js} +206 -198
  3. package/dist/assets/index-CRlPQn7l.css +1 -0
  4. package/dist/assets/index-xlbz19JS.css +1 -0
  5. package/dist/assets/{index-CtR-jzNi.css → index-zWDnehqu.css} +1 -1
  6. package/dist/assets/styles-0GdZsGyi.css +1 -0
  7. package/dist/assets/styles-CwZG1jzB.css +1 -0
  8. package/dist/assets/{styles-DAqMiQ0N.css → styles-D2n8YjU_.css} +1 -1
  9. package/dist/components/Breadcrumb/index.js +39 -39
  10. package/dist/components/FusionChart/_config/builders.d.ts.map +1 -1
  11. package/dist/components/FusionChart/_config/builders.js +147 -110
  12. package/dist/components/FusionChart/_config/events.d.ts.map +1 -1
  13. package/dist/components/FusionChart/_config/events.js +52 -37
  14. package/dist/components/FusionChart/_types/fusionChart.types.d.ts +3 -0
  15. package/dist/components/FusionChart/_types/fusionChart.types.d.ts.map +1 -1
  16. package/dist/components/FusionChart/index.d.ts.map +1 -1
  17. package/dist/components/FusionChart/index.js +524 -506
  18. package/dist/components/Search/index.js +60 -60
  19. package/dist/components/SingleSelectDropdown/_helpers/DropdownFooter.js +4 -3
  20. package/dist/components/SingleSelectDropdown/index.js +12 -11
  21. package/dist/components/Table/_helpers/ColumnManager/index.d.ts +1 -1
  22. package/dist/components/Table/_helpers/ColumnManager/index.d.ts.map +1 -1
  23. package/dist/components/Table/_helpers/ColumnManager/index.js +803 -696
  24. package/dist/components/Table/_helpers/GroupedHeader/index.d.ts +3 -2
  25. package/dist/components/Table/_helpers/GroupedHeader/index.d.ts.map +1 -1
  26. package/dist/components/Table/_helpers/GroupedHeader/index.js +148 -147
  27. package/dist/components/Table/_helpers/TableFilterModal/OptionList.d.ts.map +1 -1
  28. package/dist/components/Table/_helpers/TableFilterModal/OptionList.js +3 -3
  29. package/dist/components/Table/_helpers/TableFilterModal/index.d.ts.map +1 -1
  30. package/dist/components/Table/_helpers/TableFilterModal/index.js +52 -50
  31. package/dist/components/Table/_helpers/TableRows.d.ts +1 -1
  32. package/dist/components/Table/_helpers/TableRows.d.ts.map +1 -1
  33. package/dist/components/Table/_helpers/TableRows.js +242 -243
  34. package/dist/components/Table/_hooks/useOverlayScrollbar.d.ts.map +1 -1
  35. package/dist/components/Table/_hooks/useOverlayScrollbar.js +63 -58
  36. package/dist/components/Table/_types/table.types.d.ts +1 -1
  37. package/dist/components/Table/_types/table.types.d.ts.map +1 -1
  38. package/dist/components/Table/_utils/table.utils.d.ts +1 -1
  39. package/dist/components/Table/_utils/table.utils.d.ts.map +1 -1
  40. package/dist/components/Table/_utils/table.utils.js +84 -46
  41. package/dist/components/Table/index.d.ts.map +1 -1
  42. package/dist/components/Table/index.js +395 -324
  43. package/dist/components/TextField/index.js +165 -165
  44. package/package.json +1 -1
  45. package/dist/assets/index-C8gvpfKZ.css +0 -1
  46. package/dist/assets/index-DewFIgpp.css +0 -1
  47. package/dist/assets/styles-DLJzdWsF.css +0 -1
  48. package/dist/assets/styles-O-5pBCak.css +0 -1
  49. package/dist/search-B_cup-NN.js +0 -5
@@ -1,130 +1,131 @@
1
- import { jsx as i, jsxs as g } from "react/jsx-runtime";
2
- import * as r from "react";
3
- import { useState as x, useEffect as w, useCallback as I, useRef as ke, useMemo as R } from "react";
4
- import { u as qe } from "../../OptionList-BM4AleXV.js";
5
- import { u as Ue, f as Ze, g as Qe, a as Xe, b as Ye } from "../../index-Bcvmezbu.js";
6
- import { CKButton as Ce } from "../CKButton/index.js";
7
- import { Search as et } from "../Search/index.js";
8
- import { EmptyState as tt } from "../EmptyState/index.js";
9
- import { Loader as nt } from "../Loader/index.js";
10
- import { S as ot, a as rt } from "../../table-filter-C0zetUfo.js";
11
- import { INITIAL_COLUMN_MANAGER_CONFIG as be, ROW_MIN_HEIGHT as it, TABLE_PREFIX as F } from "./constants.js";
12
- import st from "./_helpers/TableFilterModal/index.js";
13
- import lt from "./_helpers/ColumnManager/index.js";
14
- import at from "./_helpers/GroupedHeader/index.js";
15
- import { SelectionHeaderCell as xe } from "./_helpers/SelectionCell/index.js";
16
- import ct from "./_helpers/TableRows.js";
17
- import { useSelection as dt } from "./_hooks/useSelection.js";
18
- import { useExpansion as mt } from "./_hooks/useExpansion.js";
19
- import { useOverlayScrollbar as ut } from "./_hooks/useOverlayScrollbar.js";
20
- import { isTableConfigDefault as we, saveToLocalStorage as te, getTableMinWidth as ft, isTableConfigChanged as gt, pinnedStyle as ne, columnLayoutStyle as ve } from "./_utils/table.utils.js";
21
- import { formatCellValue as Se } from "./_utils/formatCellValue.js";
22
- import '../../assets/styles-DAqMiQ0N.css';/* empty css */
23
- const ht = (l) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 14, height: 14, viewBox: "0 0 14 14", fill: "none", ...l }, /* @__PURE__ */ r.createElement("path", { d: "M1.75 8.75006L8.16667 8.75", stroke: "#2B2B2B", strokeWidth: 0.875, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M1.75 5.25H5.83333", stroke: "#2B2B2B", strokeWidth: 0.875, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M1.75 12.25H11.0833", stroke: "#2B2B2B", strokeWidth: 0.875, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.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" })), pt = (l) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 14, height: 14, viewBox: "0 0 14 14", fill: "none", ...l }, /* @__PURE__ */ r.createElement("path", { d: "M1.75 5.24994L8.16667 5.25", stroke: "#2B2B2B", strokeWidth: 0.875, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M1.75 8.75H5.83333", stroke: "#2B2B2B", strokeWidth: 0.875, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M1.75 1.75H11.0833", stroke: "#2B2B2B", strokeWidth: 0.875, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.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" })), yt = (l) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 14, height: 14, viewBox: "0 0 14 14", fill: "none", ...l }, /* @__PURE__ */ r.createElement("mask", { id: "mask0_1852_13537", style: {
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__ */ r.createElement("path", { d: "M13.708 0.291992V13.708H0.291992V0.291992H13.708Z", fill: "white", stroke: "white", strokeWidth: 0.583333 })), /* @__PURE__ */ r.createElement("g", { mask: "url(#mask0_1852_13537)" }, /* @__PURE__ */ r.createElement("path", { d: "M1.75 4.08325H12.25", stroke: "#2B2B2B", strokeWidth: 0.875, strokeLinecap: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M3.5 7H10.5", stroke: "#2B2B2B", strokeWidth: 0.875, strokeLinecap: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M5.83398 9.9165H8.16732", stroke: "#2B2B2B", strokeWidth: 0.875, strokeLinecap: "round" }))), kt = (l) => /* @__PURE__ */ r.createElement("svg", { width: 200, height: 180, viewBox: "0 0 200 180", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...l }, /* @__PURE__ */ r.createElement("ellipse", { cx: 100, cy: 168, rx: 38, ry: 6, fill: "#E0E0E0" }), /* @__PURE__ */ r.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__ */ r.createElement("g", { stroke: "#C0C0C0", strokeWidth: 2.5, strokeLinecap: "round" }, /* @__PURE__ */ r.createElement("line", { x1: 28, y1: 22, x2: 28, y2: 32 }), /* @__PURE__ */ r.createElement("line", { x1: 23, y1: 27, x2: 33, y2: 27 }), /* @__PURE__ */ r.createElement("line", { x1: 38, y1: 118, x2: 38, y2: 128 }), /* @__PURE__ */ r.createElement("line", { x1: 33, y1: 123, x2: 43, y2: 123 }), /* @__PURE__ */ r.createElement("line", { x1: 162, y1: 52, x2: 162, y2: 62 }), /* @__PURE__ */ r.createElement("line", { x1: 157, y1: 57, x2: 167, y2: 57 })), /* @__PURE__ */ r.createElement("circle", { cx: 100, cy: 155, r: 2, fill: "#D0D0D0" }), /* @__PURE__ */ r.createElement("g", { transform: "rotate(-8, 100, 90)" }, /* @__PURE__ */ r.createElement("rect", { x: 42, y: 28, width: 112, height: 130, rx: 10, fill: "#DCDCDC" }), /* @__PURE__ */ r.createElement("rect", { x: 44, y: 30, width: 108, height: 126, rx: 9, fill: "white", stroke: "#C2C2C2", strokeWidth: 1.5 }), /* @__PURE__ */ r.createElement("rect", { x: 50, y: 36, width: 96, height: 114, rx: 6, fill: "white", stroke: "#C2C2C2", strokeWidth: 1 }), /* @__PURE__ */ r.createElement("rect", { x: 82, y: 20, width: 32, height: 20, rx: 4, fill: "white", stroke: "#C2C2C2", strokeWidth: 1.5 }), /* @__PURE__ */ r.createElement("path", { d: "M91 20 Q98 14 105 20", stroke: "#C2C2C2", strokeWidth: 1.5, fill: "#F4F4F4" }), /* @__PURE__ */ r.createElement("circle", { cx: 95, cy: 88, r: 26, stroke: "#C2C2C2", strokeWidth: 3, fill: "white" }), /* @__PURE__ */ r.createElement("line", { x1: 113, y1: 106, x2: 128, y2: 121, stroke: "#C2C2C2", strokeWidth: 5, strokeLinecap: "round" }), /* @__PURE__ */ r.createElement("line", { x1: 116, y1: 109, x2: 125, y2: 118, stroke: "#E8E8E8", strokeWidth: 2, strokeLinecap: "round" }))), Ee = (l) => {
26
- if (typeof l == "number") return l;
27
- if (l == null) return NaN;
28
- const m = String(l).replace(/[^0-9.-]/g, "");
29
- return m === "" ? NaN : Number(m);
30
- }, Ct = (l, m, K) => {
31
- const k = Ee(l.getValue(K)), c = Ee(m.getValue(K));
32
- return Number.isNaN(k) && Number.isNaN(c) ? 0 : Number.isNaN(k) ? 1 : Number.isNaN(c) ? -1 : k - c;
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 Ne = !1;
35
- const Me = (l) => {
36
- if (typeof l == "number") return l;
37
- if (typeof l == "string" && l.trim().endsWith("px")) {
38
- const m = Number.parseFloat(l);
39
- return Number.isNaN(m) ? void 0 : m;
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 jt({
43
- config: l = {},
44
- data: m = [],
45
- maxHeight: K = "600px",
46
- virtualization: k = !1,
47
- persistTableConfig: c = "",
48
- message: oe,
49
- icon: Ie,
50
- totalRow: re,
51
- selection: G,
52
- expandable: J,
53
- externalColumnFilters: q,
54
- externalTableConfig: C,
55
- onConfigChange: Fe,
56
- isLoading: ie = !1
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: v = [],
60
- headerGroups: B,
61
- showFilters: Be = !0,
62
- showColumnManager: Le = !0,
63
- columnManagerConfig: se = be,
64
- toolbarLabels: le,
65
- search: u
66
- } = l ?? {}, ae = le?.columnManager ?? !0, ce = le?.filter ?? !0, [V, de] = x(u?.value ?? "");
67
- w(() => {
68
- u?.value !== void 0 && de(u.value);
69
- }, [u?.value]);
70
- const me = I((e) => {
71
- de(e), u?.onSearch?.(e);
72
- }, [u]), L = ke(null);
73
- ut(L);
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: W,
76
- getRowId: We,
77
- toggleRowSelection: ze,
78
- toggleSelectAll: ue
79
- } = dt(m, G), {
80
- expandedIds: De,
81
- toggleExpand: Re
82
- } = mt(J), A = R(
83
- () => v.map((e) => {
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, o, s) => {
86
- if (!s) return !0;
87
- const a = Array.isArray(s) ? s : s.values, f = Array.isArray(s) ? !1 : s.exclude;
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 M = String(n.getValue(o));
90
- return f ? !a.includes(M) : a.includes(M);
91
- } : e.type === "number" && (t = (n, o, s) => {
92
- if (!s) return !0;
93
- const a = Number(n.getValue(o));
94
- return a >= s.min && a <= s.max;
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 && Me(e.minWidth) !== void 0 ? { minSize: Me(e.minWidth) } : {},
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) => Se(n.getValue(), e)
106
+ cell: (n) => De(n.getValue(), e)
106
107
  } : {}
107
108
  };
108
109
  }),
109
- [v]
110
- ), H = I(
110
+ [L]
111
+ ), D = I(
111
112
  () => ({
112
- ...be,
113
- ...se,
114
- columns: A
113
+ ...We,
114
+ ...he,
115
+ columns: j
115
116
  }),
116
- [se, A]
117
- ), fe = () => {
118
- const e = H();
119
- if (c)
117
+ [he, j]
118
+ ), xe = () => {
119
+ const e = D();
120
+ if (d)
120
121
  try {
121
- const t = localStorage.getItem(`${F}-${c}`);
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 o = n.tableConfig.columns || [], s = /* @__PURE__ */ new Set(), a = o.map((f) => e.columns.find((M) => M.accessorKey === f.accessorKey)).filter((f) => !f || s.has(f.accessorKey) ? !1 : (s.add(f.accessorKey), !0));
126
- return e.columns.forEach((f) => {
127
- a.find((M) => M.accessorKey === f.accessorKey) || a.push(f);
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
- }, ge = () => {
136
- if (c)
136
+ }, Se = () => {
137
+ if (d)
137
138
  try {
138
- const e = localStorage.getItem(`${F}-${c}`);
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
- }, Ke = () => {
148
- if (c)
148
+ }, qe = () => {
149
+ if (d)
149
150
  try {
150
- const e = localStorage.getItem(`${F}-${c}`);
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
- }, [h, U] = x(fe), [S, O] = x(fe), [z, Z] = x(ge), [j, he] = x(ge), [p, Ve] = x(Ke), [T, b] = x({ open: !1, type: "", activeOption: "" });
160
- w(() => {
161
- C && U(C);
162
- }, [C]);
163
- const d = R(() => {
164
- const e = C ?? h;
165
- if (!C) return e;
166
- const t = new Map(A.map((n) => [n.accessorKey, n]));
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 o = t.get(n.accessorKey);
171
- return o ? {
210
+ const r = t.get(n.accessorKey);
211
+ return r ? {
172
212
  ...n,
173
- ...o.filterFn ? { filterFn: o.filterFn } : {},
174
- ...o.renderCell ? { renderCell: o.renderCell } : {},
175
- ...o.cell ? { cell: o.cell } : {}
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
- }, [C, h, A]), Ae = q ?? z, He = R(() => {
219
+ }, [S, y, j]), Je = X ?? K, Ue = A(() => {
180
220
  const e = {};
181
- return v.forEach((t) => {
182
- if (d.columnVisibility[t.accessorKey] !== !1) {
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(m.map((o) => String(o[t.accessorKey] ?? "")).filter(Boolean))
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 = m.map((a) => Number(a[t.accessorKey])).filter((a) => !Number.isNaN(a)), o = n.length ? Math.floor(Math.min(...n)) : 0, s = n.length ? Math.ceil(Math.max(...n)) : 0;
190
- e[t.header] = { type: "range", values: { min: o, max: s }, accessorKey: t.accessorKey };
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
- }, [v, m, d.columnVisibility]);
195
- w(() => {
196
- if (c && !Ne)
234
+ }, [L, f, m.columnVisibility]);
235
+ M(() => {
236
+ if (d && !Ve)
197
237
  try {
198
- const e = z.length > 0, t = !we(h, H());
199
- (e || t) && (Ne = !0);
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
- }, [c]), w(() => {
204
- c && Object.keys(p).length > 0 && te(`${F}-${c}`, { columnSizing: p });
205
- }, [p, c]), w(() => {
206
- Z((e) => {
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) => h.columnVisibility[n.id] !== !1
248
+ (n) => y.columnVisibility[n.id] !== !1
209
249
  );
210
250
  return t.length !== e.length ? t : e;
211
251
  });
212
- }, [h.columnVisibility]);
213
- const Oe = () => {
214
- const e = /* @__PURE__ */ new Set(), t = S.columns.filter((o) => e.has(o.accessorKey) ? !1 : (e.add(o.accessorKey), !0)), n = { ...S, columns: t };
215
- U(n), b({ type: "", activeOption: "", open: !1 }), c && te(`${F}-${c}`, { tableConfig: n }), Fe?.(S);
216
- }, je = () => {
217
- O(H);
218
- }, Te = I((e, t) => {
219
- O((n) => {
220
- const o = [...n.columns], [s] = o.splice(e, 1);
221
- return o.splice(t, 0, s), { ...n, columns: o };
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
- }, []), $e = I((e) => {
224
- U((t) => {
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
- }, []), Pe = R(() => {
229
- const e = [], t = [], n = d.columns.filter(
230
- (o) => d.columnVisibility[o.accessorKey] !== !1
268
+ }, []), et = A(() => {
269
+ const e = [], t = [], n = m.columns.filter(
270
+ (s) => m.columnVisibility[s.accessorKey] !== !1
231
271
  );
232
- if (d.stickyStart === "first" && n.length > 0 && e.push(n[0].accessorKey), d.stickyStart === "firstTwo" && n.length > 1 && (e.push(n[0].accessorKey), e.push(n[1].accessorKey)), d.stickyEnd === "last" && n.length > 0) {
233
- const o = n[n.length - 1].accessorKey;
234
- e.includes(o) || t.push(o);
235
- }
236
- return { left: e, right: t };
237
- }, [d.stickyStart, d.stickyEnd, d.columns, d.columnVisibility]), _e = R(() => {
238
- if (!u || u.mode !== "frontend" || !V.trim()) return m;
239
- const e = V.toLowerCase(), t = v.filter((n) => d.columnVisibility[n.accessorKey] !== !1).map((n) => n.accessorKey);
240
- return m.filter(
241
- (n) => t.some((o) => {
242
- const s = n[o];
243
- return s != null && String(s).toLowerCase().includes(e);
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
- }, [u, V, m, v, d.columnVisibility]);
247
- w(() => {
248
- L.current && (L.current.scrollTop = 0);
249
- }, [m]);
250
- const y = Ue({
251
- data: _e,
252
- columns: d.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: Ct },
258
- getRowId: (e, t) => We(e, t),
324
+ sortingFns: { numericSort: Wt },
325
+ getRowId: (e, t) => $e(e, t),
259
326
  state: {
260
- columnVisibility: d.columnVisibility,
261
- columnPinning: Pe,
262
- columnFilters: Ae,
263
- columnSizing: p
327
+ columnVisibility: m.columnVisibility,
328
+ columnPinning: et,
329
+ columnFilters: Je,
330
+ columnSizing: h
264
331
  },
265
- onColumnFiltersChange: Z,
266
- onColumnSizingChange: Ve,
332
+ onColumnFiltersChange: te,
333
+ onColumnSizingChange: Ee,
267
334
  enableRowSelection: !1,
268
335
  enableColumnResizing: !0,
269
336
  columnResizeMode: "onChange",
270
- onColumnVisibilityChange: $e,
271
- getCoreRowModel: Ye(),
272
- getSortedRowModel: Xe(),
273
- getFilteredRowModel: Qe()
274
- }), { rows: $ } = y.getRowModel(), E = y.getVisibleLeafColumns(), pe = E.length > 0 ? E[E.length - 1].id : null, D = (G?.enabled ?? !1) && !J?.enabled, P = D ? 40 : 0, Q = ft(E, P, p), _ = ke(/* @__PURE__ */ new Map()), ye = I(
275
- (e) => _.current.get(e) || it,
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
- ), N = qe({
278
- count: $.length,
279
- getScrollElement: () => L.current,
280
- estimateSize: ye,
346
+ ), W = lt({
347
+ count: P.length,
348
+ getScrollElement: () => w.current,
349
+ estimateSize: nt,
281
350
  overscan: 5
282
351
  });
283
- w(() => {
284
- _.current.clear(), requestAnimationFrame(() => {
285
- N.measure();
352
+ M(() => {
353
+ q.current.clear(), requestAnimationFrame(() => {
354
+ W.measure();
286
355
  });
287
- }, [d.wrapText, N]);
288
- const Ge = I(
356
+ }, [m.wrapText, W]);
357
+ const ot = I(
289
358
  (e, t) => {
290
359
  if (!t) return;
291
- const n = t.offsetHeight, o = _.current.get(e);
292
- n && o !== n && (_.current.set(e, n), requestAnimationFrame(() => {
293
- N.measure();
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
- [N]
297
- ), X = (e) => e === "asc" ? /* @__PURE__ */ i(ht, {}) : e === "desc" ? /* @__PURE__ */ i(pt, {}) : /* @__PURE__ */ i(yt, {}), Je = T.type === "filter" ? /* @__PURE__ */ i(
298
- st,
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: He,
301
- draftColumnFilters: j,
302
- setDraftColumnFilters: he,
369
+ filters: Ue,
370
+ draftColumnFilters: $,
371
+ setDraftColumnFilters: we,
303
372
  handleApplyFilters: () => {
304
- Z(j), b({ ...T, open: !1 }), c && te(`${F}-${c}`, { columnFilters: j });
373
+ te($), E({ ...G, open: !1 }), d && de(`${z}-${d}`, { columnFilters: $ });
305
374
  },
306
- setModalOpen: b,
307
- virtualization: k,
308
- isFilterChanged: JSON.stringify(j) !== JSON.stringify(z)
375
+ setModalOpen: E,
376
+ virtualization: x,
377
+ isFilterChanged: JSON.stringify($) !== JSON.stringify(K)
309
378
  }
310
- ) : /* @__PURE__ */ i(
311
- lt,
379
+ ) : /* @__PURE__ */ l(
380
+ bt,
312
381
  {
313
- draftConfig: S,
314
- setDraftConfig: O,
315
- moveDraftColumn: Te,
316
- handleApplyPref: Oe,
317
- setModalOpen: b,
318
- handleResetToDefault: je,
319
- isDefault: we(S, H()),
320
- isConfigChanged: gt(S, h)
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
- ), Y = Le, ee = Be && !q;
323
- return /* @__PURE__ */ g("div", { children: [
324
- (u || Y || ee) && /* @__PURE__ */ g("div", { className: "ckds-filter-wrapper", style: { display: "flex", gap: "8px", margin: "16px 0px 12px 0px", justifyContent: "space-between", alignItems: "center" }, children: [
325
- /* @__PURE__ */ i("div", { className: "ckds-toolbar-search", children: u && /* @__PURE__ */ i(
326
- et,
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: V,
329
- placeholder: u.placeholder ?? "Search",
330
- debounceMs: u.debounceMs ?? 0,
331
- onChange: me,
332
- onClear: () => me(""),
333
- disabled: ie
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
- (Y || ee) && /* @__PURE__ */ g("div", { style: { display: "flex", gap: "8px", alignItems: "center" }, children: [
337
- Y && /* @__PURE__ */ i(
338
- Ce,
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
- O({ ...h, columnVisibility: { ...h.columnVisibility }, columns: [...h.columns] }), b({ open: !0, type: "columnManager", activeOption: "" });
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__ */ i(ot, {}) },
346
- label: ae ? "Column Manager" : void 0,
347
- iconOnly: !ae
416
+ icons: { left: /* @__PURE__ */ l(pt, {}) },
417
+ label: ye ? "Column Manager" : void 0,
418
+ iconOnly: !ye
348
419
  }
349
420
  ),
350
- /* @__PURE__ */ i("div", { style: { borderRight: "1px solid var(--ckcl-black-200, #C2C2C2)", margin: "5px 0" } }),
351
- ee && /* @__PURE__ */ i(
352
- Ce,
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 ${z.length > 0 ? "after:content-[''] after:absolute after:-top-[1px] after:-right-[1px] after:size-[5px] after:rounded-full after:bg-primary" : ""}`,
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
- he(z), b({ open: !0, type: "filter", activeOption: "" });
427
+ we(K), E({ open: !0, type: "filter", activeOption: "" });
357
428
  },
358
429
  variant: "secondary",
359
430
  size: "medium",
360
- icons: { right: /* @__PURE__ */ i(rt, {}) },
361
- label: ce ? "Filters" : void 0,
362
- iconOnly: !ce
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__ */ g("div", { style: { position: "relative", overflow: "hidden", borderRadius: "var(--ckcl-border-radius-lg, 12px)" }, children: [
368
- ie && /* @__PURE__ */ i(nt, { overlay: !0 }),
369
- /* @__PURE__ */ i(
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: L,
374
- style: { maxHeight: K, width: y?.getHeaderGroups()?.[0]?.headers?.length === 1 ? "fit-content" : "100%" },
375
- children: $.length ? /* @__PURE__ */ g(
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: Q, display: "block" },
450
+ style: { width: "100%", minWidth: oe, display: "block" },
380
451
  children: [
381
- /* @__PURE__ */ g("thead", { className: "ckds-dragable-thead", style: { display: "block", position: "sticky", top: 0, zIndex: 10, minWidth: Q, backgroundColor: "var(--ckds-cell-bg-default, #ffffff)" }, children: [
382
- B && B.length > 0 && /* @__PURE__ */ i(
383
- at,
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: B,
386
- table: y,
387
- hasSelection: D,
388
- getSortIcon: X,
389
- selectionCell: D ? /* @__PURE__ */ i(
390
- xe,
456
+ headerGroups: p,
457
+ table: k,
458
+ hasSelection: V,
459
+ getSortIcon: re,
460
+ selectionCell: V ? /* @__PURE__ */ l(
461
+ ze,
391
462
  {
392
- isAllSelected: W.isAllSelected,
393
- isIndeterminate: W.isIndeterminate,
394
- onToggleAll: ue
463
+ isAllSelected: R.isAllSelected,
464
+ isIndeterminate: R.isIndeterminate,
465
+ onToggleAll: ve
395
466
  }
396
467
  ) : void 0,
397
- lastColId: pe,
398
- columnSizing: p,
399
- pinnedStyle: ne,
400
- selectionOffset: P
468
+ lastColId: Me,
469
+ columnSizing: h,
470
+ pinnedStyle: ue,
471
+ selectionOffset: _,
472
+ handleResizeWithScrollFollow: Ne
401
473
  }
402
474
  ),
403
- !(B && B.length > 0) && y.getHeaderGroups().map((e) => /* @__PURE__ */ g("tr", { className: "ckds-dragable-tr", style: { display: "flex", width: "100%" }, children: [
404
- D && /* @__PURE__ */ i(
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__ */ i(
410
- xe,
481
+ children: /* @__PURE__ */ l(
482
+ ze,
411
483
  {
412
- isAllSelected: W.isAllSelected,
413
- isIndeterminate: W.isIndeterminate,
414
- onToggleAll: ue
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(), o = t.column.id === pe;
421
- return /* @__PURE__ */ g(
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
- ...ne(t.column, y, P),
427
- ...ve(t.column, E, p),
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__ */ g(
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: (s) => {
449
- t.column.getCanSort() && (s.key === "Enter" || s.key === " ") && t.column.getToggleSortingHandler()?.(s);
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__ */ i("span", { className: "ckds-sort-icon ckds-sort-icon-left", children: X(t.column.getIsSorted()) }),
453
- Ze(t.column.columnDef.header, t.getContext()),
454
- t.column.columnDef.align !== "right" && t.column.getCanSort() && /* @__PURE__ */ i("span", { className: "ckds-sort-icon", children: X(t.column.getIsSorted()) })
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
- !o && t.column.getCanResize() && /* @__PURE__ */ i(
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__ */ i("div", { className: "ckds-col-resize-line" })
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__ */ i(
548
+ /* @__PURE__ */ l(
477
549
  "tbody",
478
550
  {
479
551
  className: "ckds-dragable-tbody",
480
552
  style: {
481
- height: k && $.length ? `${N.getTotalSize()}px` : "auto",
553
+ height: x && P.length ? `${W.getTotalSize()}px` : "auto",
482
554
  position: "relative",
483
555
  display: "block",
484
556
  width: "100%",
485
- minWidth: Q
557
+ minWidth: oe
486
558
  },
487
- children: /* @__PURE__ */ i(
488
- ct,
559
+ children: /* @__PURE__ */ l(
560
+ xt,
489
561
  {
490
- rows: $,
491
- virtualization: k,
492
- rowVirtualizer: N,
493
- handleMeasure: Ge,
494
- getEstimatedSize: ye,
495
- columnSizing: p,
496
- tableConfig: d,
497
- table: y,
498
- selectionState: W,
499
- selectionConfig: G,
500
- onToggleRowSelection: ze,
501
- expandableConfig: J,
502
- expandedIds: De,
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
- re && /* @__PURE__ */ i("tfoot", { className: "ckds-dragable-tfoot", style: { display: "block", position: "sticky", bottom: 0, zIndex: 10, backgroundColor: "var(--ckds-cell-bg-default, #ffffff)" }, children: /* @__PURE__ */ g("tr", { className: "ckds-dragable-tr", style: { display: "flex", width: "100%" }, children: [
509
- D && /* @__PURE__ */ i("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 } }),
510
- y.getVisibleLeafColumns().map((e, t) => {
511
- const n = e.getIsPinned(), o = re[e.id], s = e.columnDef;
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 && o === void 0 ? a = /* @__PURE__ */ i("span", { children: "Total" }) : o !== void 0 && (typeof o == "object" && o !== null ? a = /* @__PURE__ */ i("span", { children: o }) : s.prefix || s.suffix || s.decimalPlaces !== void 0 ? a = /* @__PURE__ */ i("span", { children: Se(o, s) }) : a = /* @__PURE__ */ i("span", { children: o }));
514
- const f = s.align === "right" ? "right" : s.align === "center" ? "center" : "left";
515
- return /* @__PURE__ */ i(
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
- ...ne(e, y, P),
591
+ ...ue(e, k, _, h),
521
592
  display: "flex",
522
593
  alignItems: "center",
523
- ...ve(e, E, p),
594
+ ...Re(e, B, h),
524
595
  zIndex: n ? 2 : void 0
525
596
  },
526
- children: /* @__PURE__ */ i("div", { style: { width: "100%", textAlign: f, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: a })
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__ */ i(
535
- tt,
605
+ ) : /* @__PURE__ */ l(
606
+ gt,
536
607
  {
537
- icon: Ie ?? /* @__PURE__ */ i(kt, {}),
608
+ icon: He ?? /* @__PURE__ */ l(Bt, {}),
538
609
  message: {
539
- heading: oe?.heading ?? "No data to display",
540
- content: oe?.content ?? "There's no activity recorded for this period or filter selection."
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
- T.open && !q && !C && /* @__PURE__ */ i(
619
+ G.open && !X && !S && /* @__PURE__ */ l(
549
620
  "div",
550
621
  {
551
622
  className: "ckds-table-filter-modal-wr",
552
- onClick: () => b({ ...T, open: !1 }),
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__ */ i(
635
+ children: /* @__PURE__ */ l(
565
636
  "div",
566
637
  {
567
638
  className: "ckds-table-modal-box",
568
639
  onClick: (e) => e.stopPropagation(),
569
- children: Je
640
+ children: rt
570
641
  }
571
642
  )
572
643
  }
@@ -574,6 +645,6 @@ function jt({
574
645
  ] });
575
646
  }
576
647
  export {
577
- jt as CustomTable,
578
- jt as default
648
+ tn as CustomTable,
649
+ tn as default
579
650
  };