@ck-ui/component-library 1.0.9 → 1.0.11

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.
@@ -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 at, f as ct, g as dt, a as ut, b as mt } from "../../index-Bcvmezbu.js";
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 z } from "./constants.js";
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 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";
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 ce, saveToLocalStorage as de, getTableMinWidth as Nt, isTableConfigChanged as Mt, pinnedStyle as ue, columnLayoutStyle as Re } from "./_utils/table.utils.js";
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-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: {
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 = (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, "");
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 = (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;
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 = (c) => {
37
- if (typeof c == "number") return c;
38
- if (typeof c == "string" && c.trim().endsWith("px")) {
39
- const f = Number.parseFloat(c);
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: c = {},
44
+ config: a = {},
45
45
  data: f = [],
46
46
  maxHeight: H = "600px",
47
- virtualization: x = !1,
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: S,
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
- } = c ?? {}, ye = pe?.columnManager ?? !0, ke = pe?.filter ?? !0, [O, Ce] = N(g?.value ?? "");
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]), w = U(null), Y = U(null);
74
- Et(w);
73
+ }, [g]), x = U(null), Y = U(null);
74
+ Et(x);
75
75
  const {
76
- selectionState: R,
76
+ selectionState: z,
77
77
  getRowId: $e,
78
78
  toggleRowSelection: Ge,
79
79
  toggleSelectAll: ve
80
- } = St(f, Z), {
80
+ } = wt(f, Z), {
81
81
  expandedIds: Pe,
82
82
  toggleExpand: _e
83
- } = wt(Q), j = A(
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 a = Array.isArray(o) ? o : o.values, s = Array.isArray(o) ? !1 : o.exclude;
89
- if (!a || a.length === 0) return !0;
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 ? !a.includes(u) : a.includes(u);
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 a = Number(n.getValue(r));
95
- return a >= o.min && a <= o.max;
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
- ), xe = () => {
118
+ ), Se = () => {
119
119
  const e = D();
120
120
  if (d)
121
121
  try {
122
- const t = localStorage.getItem(`${z}-${d}`);
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(), 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));
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
- a.find((u) => u.accessorKey === s.accessorKey) || a.push(s);
129
- }), { ...e, ...n.tableConfig, columns: a };
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
- }, Se = () => {
136
+ }, we = () => {
137
137
  if (d)
138
138
  try {
139
- const e = localStorage.getItem(`${z}-${d}`);
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(`${z}-${d}`);
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(xe), [F, T] = N(xe), [K, te] = N(Se), [$, we] = N(Se), [h, Ee] = N(qe), ne = U(h);
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 = w.current;
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"), ae = b.length > s.length ? 1 : 0;
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 + ae];
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
- }, a = () => {
194
- document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", a);
193
+ }, c = () => {
194
+ document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", c);
195
195
  };
196
- document.addEventListener("mousemove", o), document.addEventListener("mouseup", a);
196
+ document.addEventListener("mousemove", o), document.addEventListener("mouseup", c);
197
197
  },
198
- [w]
198
+ [x]
199
199
  ), [G, E] = N({ open: !1, type: "", activeOption: "" });
200
200
  M(() => {
201
- S && ee(S);
202
- }, [S]);
201
+ w && ee(w);
202
+ }, [w]);
203
203
  const m = A(() => {
204
- const e = S ?? y;
205
- if (!S) return e;
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
- }, [S, y, j]), Je = X ?? K, Ue = A(() => {
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((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;
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 = !ce(y, D());
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(`${z}-${d}`, { columnSizing: h });
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(`${z}-${d}`, { tableConfig: n }), Oe?.(F);
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 ae = b.filter(
288
+ const ce = b.filter(
289
289
  (J) => m.columnVisibility[J] !== !1
290
290
  );
291
- o.push({ type: "group", ids: ae });
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 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) => {
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
- w.current && (w.current.scrollTop = 0);
315
+ x.current && (x.current.scrollTop = 0);
316
316
  }, [f]);
317
- const k = at({
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: () => w.current,
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: we,
371
+ setDraftColumnFilters: xe,
372
372
  handleApplyFilters: () => {
373
- te($), E({ ...G, open: !1 }), d && de(`${z}-${d}`, { columnFilters: $ });
373
+ te($), E({ ...G, open: !1 }), d && de(`${R}-${d}`, { columnFilters: $ });
374
374
  },
375
375
  setModalOpen: E,
376
- virtualization: x,
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: ce(F, D()),
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: `relative ${ce(y, D()) ? "" : "after:content-[''] after:absolute after:-top-[1px] after:-right-[1px] after:size-[5px] after:rounded-full after:bg-primary"}`,
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: `relative ${K.length > 0 ? "after:content-[''] after:absolute after:-top-[1px] after:-right-[1px] after:size-[5px] after:rounded-full after:bg-primary" : ""}`,
425
+ className: `${K.length > 0 ? "ckds-toolbar-btn-indicator" : ""}`,
426
426
  onClick: () => {
427
- we(K), E({ open: !0, type: "filter", activeOption: "" });
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: w,
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
- ze,
461
+ Re,
462
462
  {
463
- isAllSelected: R.isAllSelected,
464
- isIndeterminate: R.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
- ze,
482
+ Re,
483
483
  {
484
- isAllSelected: R.isAllSelected,
485
- isIndeterminate: R.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
- ...Re(t.column, B, h),
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
- ct(t.column.columnDef.header, t.getContext()),
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: x && P.length ? `${W.getTotalSize()}px` : "auto",
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
- xt,
560
+ St,
561
561
  {
562
562
  rows: P,
563
- virtualization: x,
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: R,
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 a = null;
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 }));
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
- ...Re(e, B, h),
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: a })
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 && !S && /* @__PURE__ */ l(
619
+ G.open && !X && !w && /* @__PURE__ */ l(
620
620
  "div",
621
621
  {
622
622
  className: "ckds-table-filter-modal-wr",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ck-ui/component-library",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "type": "module",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",