comins-table 0.1.3 → 0.1.5

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/index.js CHANGED
@@ -1,92 +1,47 @@
1
- import { addCominsRows as e, applyCominsColumnLayout as t, clearCominsCellRange as n, clearCominsSelection as r, clearCominsSortState as i, copyCominsCell as a, copyCominsCellRange as o, copyCominsRow as s, createCominsTableState as c, deleteCominsRows as l, exportCominsRowsToCsv as u, exportCominsRowsToJson as d, fillCominsCellRange as f, formatCominsCellValue as p, getCominsCellClassName as m, getCominsCellStyle as h, getCominsCellValue as g, getCominsHeaderRows as _, getCominsPageRows as v, getCominsSelectedCellRange as y, getCominsSortedRowIndexes as b, getCominsVirtualRows as x, getCominsVisibleColumns as ee, isCominsCellDisabled as S, isCominsCellInSelectedRange as te, isCominsCellSelected as C, isCominsRowSelected as ne, moveCominsColumn as re, moveCominsColumnGroup as w, moveCominsRow as T, pasteCominsCell as ie, pasteCominsCellRange as E, pasteCominsRow as ae, queryCominsRows as oe, replaceCominsRows as se, selectCell as ce, selectCellRange as le, selectRow as D, selectRows as ue, serializeCominsColumnLayout as de, setCominsColumnGroupHidden as fe, setCominsColumnGroupWidth as pe, setCominsColumnHidden as me, setCominsColumnWidth as he, setCominsHeaderVisible as ge, setCominsPagination as _e, setCominsSortState as ve, setCominsTableTheme as ye, sortCominsRows as be, updateCominsRows as xe } from "./core.js";
2
- import { Fragment as Se, createContext as Ce, createElement as we, forwardRef as Te, useContext as Ee, useEffect as O, useId as De, useImperativeHandle as Oe, useLayoutEffect as ke, useMemo as k, useRef as A, useState as j } from "react";
1
+ import { addCominsRows as e, applyCominsColumnLayout as t, clearCominsCellRange as n, clearCominsSelection as r, clearCominsSortState as i, copyCominsCell as a, copyCominsCellRange as o, copyCominsRow as s, createCominsTableState as c, deleteCominsRows as l, exportCominsRowsToCsv as u, exportCominsRowsToJson as d, fillCominsCellRange as f, formatCominsCellValue as p, getCominsCellClassName as m, getCominsCellStyle as h, getCominsCellValue as g, getCominsHeaderRows as _, getCominsPageRows as v, getCominsSelectedCellRange as y, getCominsSortedRowIndexes as b, getCominsVirtualRows as x, getCominsVisibleColumns as ee, isCominsCellDisabled as S, isCominsCellInSelectedRange as C, isCominsCellSelected as w, isCominsRowSelected as te, moveCominsColumn as ne, moveCominsColumnGroup as re, moveCominsRow as ie, pasteCominsCell as ae, pasteCominsCellRange as T, pasteCominsRow as oe, queryCominsRows as se, replaceCominsRows as ce, selectCell as le, selectCellRange as ue, selectRow as E, selectRows as de, serializeCominsColumnLayout as fe, setCominsColumnGroupHidden as pe, setCominsColumnGroupWidth as me, setCominsColumnHidden as he, setCominsColumnWidth as D, setCominsHeaderVisible as ge, setCominsPagination as _e, setCominsSortModel as ve, setCominsSortState as ye, setCominsTableTheme as be, sortCominsRows as xe, updateCominsRows as Se } from "./core.js";
2
+ import { Fragment as Ce, createElement as we, forwardRef as Te, useEffect as O, useId as Ee, useImperativeHandle as De, useLayoutEffect as Oe, useMemo as k, useRef as A, useState as j } from "react";
3
3
  import { jsx as M, jsxs as N } from "react/jsx-runtime";
4
- //#region node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs
5
- var Ae = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), je = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Me = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), Ne = (e) => {
6
- let t = Me(e);
7
- return t.charAt(0).toUpperCase() + t.slice(1);
8
- }, P = {
9
- xmlns: "http://www.w3.org/2000/svg",
10
- width: 24,
11
- height: 24,
12
- viewBox: "0 0 24 24",
13
- fill: "none",
14
- stroke: "currentColor",
15
- strokeWidth: 2,
16
- strokeLinecap: "round",
17
- strokeLinejoin: "round"
18
- }, Pe = (e) => {
19
- for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
20
- return !1;
21
- }, F = Ce({}), Fe = () => Ee(F), Ie = Te(({ color: e, size: t, strokeWidth: n, absoluteStrokeWidth: r, className: i = "", children: a, iconNode: o, ...s }, c) => {
22
- let { size: l = 24, strokeWidth: u = 2, absoluteStrokeWidth: d = !1, color: f = "currentColor", className: p = "" } = Fe() ?? {}, m = r ?? d ? Number(n ?? u) * 24 / Number(t ?? l) : n ?? u;
23
- return we("svg", {
24
- ref: c,
25
- ...P,
26
- width: t ?? l ?? P.width,
27
- height: t ?? l ?? P.height,
28
- stroke: e ?? f,
29
- strokeWidth: m,
30
- className: Ae("lucide", p, i),
31
- ...!a && !Pe(s) && { "aria-hidden": "true" },
32
- ...s
33
- }, [...o.map(([e, t]) => we(e, t)), ...Array.isArray(a) ? a : [a]]);
34
- }), Le = ((e, t) => {
35
- let n = Te(({ className: n, ...r }, i) => we(Ie, {
36
- ref: i,
37
- iconNode: t,
38
- className: Ae(`lucide-${je(Ne(e))}`, `lucide-${e}`, n),
39
- ...r
40
- }));
41
- return n.displayName = Ne(e), n;
42
- })("arrow-up", [["path", {
43
- d: "m5 12 7-7 7 7",
44
- key: "hav0vg"
45
- }], ["path", {
46
- d: "M12 19V5",
47
- key: "x0mq9r"
48
- }]]);
49
- function Re({ clientX: e, clientY: t, startX: n, startY: r }) {
4
+ function ke({ clientX: e, clientY: t, startX: n, startY: r }) {
50
5
  let i = Math.abs(e - n), a = Math.abs(t - r);
51
6
  return i >= 6 && i > a ? "activate" : a >= 6 && a >= i ? "cancel" : "pending";
52
7
  }
53
8
  //#endregion
54
9
  //#region src/component-renderer.tsx
55
- function I(...e) {
10
+ function P(...e) {
56
11
  return e.filter(Boolean).join(" ");
57
12
  }
58
- function L(e, t) {
13
+ function F(e, t) {
59
14
  return typeof e == "function" ? e(t) : e ?? {};
60
15
  }
61
- function R(e, t) {
16
+ function Ae(e, t) {
62
17
  return typeof e == "function" ? e(t) : e;
63
18
  }
64
- function ze(e, t) {
19
+ function je(e, t) {
65
20
  return typeof e == "function" ? e(t) : e;
66
21
  }
67
- function z(e, t) {
22
+ function Me(e, t) {
68
23
  return typeof e == "function" ? e(t) : e;
69
24
  }
70
- function B(e) {
71
- return typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : Array.isArray(e) ? e.map(B).join(" ") : "";
25
+ function Ne(e) {
26
+ return typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : Array.isArray(e) ? e.map(Ne).join(" ") : "";
72
27
  }
73
- function Be(e) {
28
+ function Pe(e) {
74
29
  return e.type !== "divider" && e.type !== "label";
75
30
  }
76
- function Ve(e, t) {
31
+ function Fe(e, t) {
77
32
  return !!(e && t instanceof Node && e.contains(t));
78
33
  }
79
- function V(e) {
34
+ function I(e) {
80
35
  e.stopPropagation();
81
36
  }
82
- function H(e) {
37
+ function Ie(e) {
83
38
  e.preventDefault(), e.stopPropagation();
84
39
  }
85
- function He(e) {
40
+ function L(e) {
86
41
  return e == null ? "" : String(e);
87
42
  }
88
- function Ue({ component: e, payload: t }) {
89
- let n = L(e.props, t), { defaultValue: r, onBlur: i, onChange: a, onClick: o, onKeyDown: s, onMouseDown: c, onPointerDown: l, value: u, ...d } = n, f = He(u ?? r), [p, m] = j(f), h = A(f);
43
+ function Le({ component: e, payload: t }) {
44
+ let n = F(e.props, t), { defaultValue: r, onBlur: i, onChange: a, onClick: o, onKeyDown: s, onMouseDown: c, onPointerDown: l, value: u, ...d } = n, f = L(u ?? r), [p, m] = j(f), h = A(f);
90
45
  O(() => {
91
46
  m(f), h.current = f;
92
47
  }, [f]);
@@ -102,53 +57,53 @@ function Ue({ component: e, payload: t }) {
102
57
  };
103
58
  return /* @__PURE__ */ M("input", {
104
59
  ...d,
105
- className: I("comins-table__component", "comins-table__component-input", n.className),
60
+ className: P("comins-table__component", "comins-table__component-input", n.className),
106
61
  onBlur: (e) => {
107
- i?.(e), V(e), g(e);
62
+ i?.(e), I(e), g(e);
108
63
  },
109
64
  onChange: (e) => {
110
- V(e), m(e.currentTarget.value);
65
+ I(e), m(e.currentTarget.value);
111
66
  },
112
67
  onClick: (e) => {
113
- o?.(e), V(e);
68
+ o?.(e), I(e);
114
69
  },
115
70
  onKeyDown: (e) => {
116
- s?.(e), V(e), e.key === "Enter" && (e.preventDefault(), g(e), e.currentTarget.blur());
71
+ s?.(e), I(e), e.key === "Enter" && (e.preventDefault(), g(e), e.currentTarget.blur());
117
72
  },
118
73
  onMouseDown: (e) => {
119
- c?.(e), V(e);
74
+ c?.(e), I(e);
120
75
  },
121
76
  onPointerDown: (e) => {
122
- l?.(e), V(e);
77
+ l?.(e), I(e);
123
78
  },
124
79
  value: p
125
80
  });
126
81
  }
127
- function We({ component: e, payload: t }) {
128
- let n = L(e.props, t), { checked: r, defaultChecked: i, onChange: a, onClick: o, onKeyDown: s, onMouseDown: c, onPointerDown: l, style: u, ...d } = n, [f, p] = j(!!(r ?? i));
82
+ function Re({ component: e, payload: t }) {
83
+ let n = F(e.props, t), { checked: r, defaultChecked: i, onChange: a, onClick: o, onKeyDown: s, onMouseDown: c, onPointerDown: l, style: u, ...d } = n, [f, p] = j(!!(r ?? i));
129
84
  return O(() => {
130
85
  r !== void 0 && p(!!r);
131
86
  }, [r]), /* @__PURE__ */ M("input", {
132
87
  ...d,
133
88
  checked: f,
134
- className: I("comins-table__component", "comins-table__component-checkbox", n.className),
89
+ className: P("comins-table__component", "comins-table__component-checkbox", n.className),
135
90
  onClick: (e) => {
136
- o?.(e), V(e);
91
+ o?.(e), I(e);
137
92
  },
138
93
  onChange: (n) => {
139
- a?.(n), V(n), p(n.currentTarget.checked), e.onCheckedChange?.({
94
+ a?.(n), I(n), p(n.currentTarget.checked), e.onCheckedChange?.({
140
95
  ...t,
141
96
  checked: n.currentTarget.checked
142
97
  });
143
98
  },
144
99
  onKeyDown: (e) => {
145
- s?.(e), V(e);
100
+ s?.(e), I(e);
146
101
  },
147
102
  onMouseDown: (e) => {
148
- c?.(e), V(e);
103
+ c?.(e), I(e);
149
104
  },
150
105
  onPointerDown: (e) => {
151
- l?.(e), V(e);
106
+ l?.(e), I(e);
152
107
  },
153
108
  style: {
154
109
  height: 20,
@@ -158,8 +113,8 @@ function We({ component: e, payload: t }) {
158
113
  type: "checkbox"
159
114
  });
160
115
  }
161
- function U({ component: e, payload: t }) {
162
- let { checked: n, ...r } = L(e.props, t), { onClick: i, onKeyDown: a, onMouseDown: o, onPointerDown: s, ...c } = r, [l, u] = j(!!n);
116
+ function ze({ component: e, payload: t }) {
117
+ let { checked: n, ...r } = F(e.props, t), { onClick: i, onKeyDown: a, onMouseDown: o, onPointerDown: s, ...c } = r, [l, u] = j(!!n);
163
118
  O(() => {
164
119
  n !== void 0 && u(!!n);
165
120
  }, [n]);
@@ -167,9 +122,9 @@ function U({ component: e, payload: t }) {
167
122
  return /* @__PURE__ */ M("button", {
168
123
  ...c,
169
124
  "aria-pressed": l,
170
- className: I("comins-table__component", "comins-table__component-toggle", r.className),
125
+ className: P("comins-table__component", "comins-table__component-toggle", r.className),
171
126
  onClick: (n) => {
172
- i?.(n), V(n);
127
+ i?.(n), I(n);
173
128
  let r = !l;
174
129
  u(r), e.onCheckedChange?.({
175
130
  ...t,
@@ -177,24 +132,24 @@ function U({ component: e, payload: t }) {
177
132
  });
178
133
  },
179
134
  onKeyDown: (e) => {
180
- a?.(e), V(e);
135
+ a?.(e), I(e);
181
136
  },
182
137
  onMouseDown: (e) => {
183
- o?.(e), V(e);
138
+ o?.(e), I(e);
184
139
  },
185
140
  onPointerDown: (e) => {
186
- s?.(e), V(e);
141
+ s?.(e), I(e);
187
142
  },
188
143
  type: r.type ?? "button",
189
144
  children: d
190
145
  });
191
146
  }
192
- function Ge({ component: e, payload: t }) {
193
- let [n, r] = j(!1), i = De(), a = A(null), o = A(null), [s, c] = j({
147
+ function Be({ component: e, payload: t }) {
148
+ let [n, r] = j(!1), i = Ee(), a = A(null), o = A(null), [s, c] = j({
194
149
  left: 0,
195
150
  position: "fixed",
196
151
  top: 0
197
- }), l = L(e.props, t), u = k(() => ze(e.items, t), [e.items, t]), d = () => {
152
+ }), l = F(e.props, t), u = k(() => je(e.items, t), [e.items, t]), d = () => {
198
153
  let e = a.current;
199
154
  if (!e || typeof window > "u") return;
200
155
  let t = e.getBoundingClientRect(), n = Math.max(o.current?.offsetWidth ?? 136, 136);
@@ -218,14 +173,14 @@ function Ge({ component: e, payload: t }) {
218
173
  O(() => {
219
174
  if (!n) return;
220
175
  let e = (e) => {
221
- Ve(a.current, e.target) || Ve(o.current, e.target) || f(!1, e);
176
+ Fe(a.current, e.target) || Fe(o.current, e.target) || f(!1, e);
222
177
  }, t = (e) => {
223
178
  e.key === "Escape" && (f(!1, e), a.current?.focus());
224
179
  };
225
180
  return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
226
181
  document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
227
182
  };
228
- }, [n]), ke(() => {
183
+ }, [n]), Oe(() => {
229
184
  if (n && (d(), !(typeof window > "u"))) return window.addEventListener("resize", d), window.addEventListener("scroll", d, !0), () => {
230
185
  window.removeEventListener("resize", d), window.removeEventListener("scroll", d, !0);
231
186
  };
@@ -249,16 +204,16 @@ function Ge({ component: e, payload: t }) {
249
204
  className: "comins-table__component-menu-item",
250
205
  disabled: n.disabled,
251
206
  onClick: (r) => {
252
- H(r), !(n.disabled || !Be(n)) && (f(!1, r), e.onSelect?.({
207
+ Ie(r), !(n.disabled || !Pe(n)) && (f(!1, r), e.onSelect?.({
253
208
  ...t,
254
209
  event: r,
255
210
  item: n,
256
211
  value: n.value
257
212
  }));
258
213
  },
259
- onKeyDown: V,
260
- onMouseDown: V,
261
- onPointerDown: V,
214
+ onKeyDown: I,
215
+ onMouseDown: I,
216
+ onPointerDown: I,
262
217
  role: "menuitem",
263
218
  type: "button",
264
219
  children: n.label
@@ -272,20 +227,20 @@ function Ge({ component: e, payload: t }) {
272
227
  "aria-expanded": n,
273
228
  "aria-haspopup": "menu",
274
229
  "aria-label": l["aria-label"] ?? "Header menu",
275
- className: I("comins-table__component-menu-trigger", l.className),
230
+ className: P("comins-table__component-menu-trigger", l.className),
276
231
  onClick: (e) => {
277
- H(e), f(!n, e);
232
+ Ie(e), f(!n, e);
278
233
  },
279
234
  onKeyDown: (e) => {
280
235
  if (l.onKeyDown?.(e), e.key === "Escape" && n) {
281
- H(e), f(!1, e);
236
+ Ie(e), f(!1, e);
282
237
  return;
283
238
  }
284
- V(e);
239
+ I(e);
285
240
  },
286
- onMouseDown: V,
241
+ onMouseDown: I,
287
242
  onPointerDown: (e) => {
288
- l.onPointerDown?.(e), V(e);
243
+ l.onPointerDown?.(e), I(e);
289
244
  },
290
245
  ref: a,
291
246
  type: l.type ?? "button",
@@ -293,47 +248,47 @@ function Ge({ component: e, payload: t }) {
293
248
  }), p]
294
249
  });
295
250
  }
296
- function Ke({ component: e, interaction: t, payload: n }) {
297
- let { height: r, itemHeight: i, limit: a, more: o = !1, searchable: s = !1, style: c, ...l } = L(e.props, n), u = k(() => z(e.items, n), [e.items, n]), d = Math.max(1, Number(a ?? 5)), f = Math.max(1, Number(i ?? 28)), p = f * 5, m = r !== void 0 || c?.height !== void 0, [h, g] = j(""), [_, v] = j(!1), [y, b] = j(0), [x, ee] = j(null), [S, te] = j(p), C = A(null), ne = n.row.selected && n.selection.selectedRowCount === 1, re = !!(s && ne), w = re ? h : "";
251
+ function R({ component: e, interaction: t, payload: n }) {
252
+ let { height: r, itemHeight: i, limit: a, more: o = !1, searchable: s = !1, style: c, ...l } = F(e.props, n), u = k(() => Me(e.items, n), [e.items, n]), d = Math.max(1, Number(a ?? 5)), f = Math.max(1, Number(i ?? 28)), p = f * 5, m = r !== void 0 || c?.height !== void 0, [h, g] = j(""), [_, v] = j(!1), [y, b] = j(0), [x, ee] = j(null), [S, C] = j(p), w = A(null), te = n.row.selected && n.selection.selectedRowCount === 1, ne = !!(s && te), re = ne ? h : "";
298
253
  O(() => {
299
254
  v(!1), b(0);
300
- }, [u.length, d]), ke(() => {
301
- let e = C.current;
255
+ }, [u.length, d]), Oe(() => {
256
+ let e = w.current;
302
257
  if (!e) return;
303
258
  let t = e.clientHeight > 0 ? e.clientHeight : p;
304
- te(m ? t : Math.min(t, p));
259
+ C(m ? t : Math.min(t, p));
305
260
  }, [
306
261
  p,
307
262
  _,
308
- w,
263
+ re,
309
264
  m
310
265
  ]), O(() => {
311
- let e = C.current;
266
+ let e = w.current;
312
267
  e && (e.scrollTop = 0, b(0));
313
- }, [w]), O(() => {
314
- if (ne) return;
315
- let e = C.current;
268
+ }, [re]), O(() => {
269
+ if (te) return;
270
+ let e = w.current;
316
271
  e && (e.scrollTop = 0), v(!1), g(""), b(0);
317
- }, [ne]);
318
- let T = k(() => {
319
- let t = w.trim().toLowerCase();
272
+ }, [te]);
273
+ let ie = k(() => {
274
+ let t = re.trim().toLowerCase();
320
275
  return u.map((e, t) => ({
321
276
  item: e,
322
277
  itemIndex: t
323
278
  })).filter(({ item: n, itemIndex: r }) => t ? e.searchFilter ? e.searchFilter({
324
279
  item: n,
325
280
  itemIndex: r,
326
- value: w
327
- }) : B(n.label).toLowerCase().includes(t) : !0);
281
+ value: re
282
+ }) : Ne(n.label).toLowerCase().includes(t) : !0);
328
283
  }, [
329
- w,
284
+ re,
330
285
  e,
331
286
  u
332
- ]), ie = T.length > d, E = !!(ne && (_ || w.trim().length > 0 || !o && ie)), ae = ie && !E, oe = re && !_ ? 0 : 2, se = Math.max(f, m ? S || p : Math.min(S || p, p)), ce = Math.max(0, Math.floor(Math.max(0, y) / f) - oe), le = Math.min(T.length, Math.ceil((Math.max(0, y) + se) / f) + oe), D = E ? T.slice(ce, le) : T.slice(0, ie ? d : T.length), ue = E ? ce * f : 0, de = E ? Math.max(0, T.length - le) * f : 0, fe = `${String(n.row.id)}-${n.column.id}`, pe = {
287
+ ]), ae = ie.length > d, T = !!(te && (_ || re.trim().length > 0 || !o && ae)), oe = ae && !T, se = ne && !_ ? 0 : 2, ce = Math.max(f, m ? S || p : Math.min(S || p, p)), le = Math.max(0, Math.floor(Math.max(0, y) / f) - se), ue = Math.min(ie.length, Math.ceil((Math.max(0, y) + ce) / f) + se), E = T ? ie.slice(le, ue) : ie.slice(0, ae ? d : ie.length), de = T ? le * f : 0, fe = T ? Math.max(0, ie.length - ue) * f : 0, pe = `${String(n.row.id)}-${n.column.id}`, me = {
333
288
  ...c,
334
289
  "--comins-table-virtual-list-item-height": `${f}px`,
335
290
  height: r ?? c?.height ?? p
336
- }, me = (r, i, a) => {
291
+ }, he = (r, i, a) => {
337
292
  r.disabled || t?.requestRowSelection?.({
338
293
  event: a,
339
294
  mode: "row-click"
@@ -348,67 +303,67 @@ function Ke({ component: e, interaction: t, payload: n }) {
348
303
  return /* @__PURE__ */ N("div", {
349
304
  ...l,
350
305
  "aria-label": l["aria-label"] ?? "Virtual list",
351
- className: I("comins-table__component", "comins-table__component-virtual-list", l.className),
352
- "data-comins-virtual-list-expanded": E ? "true" : void 0,
353
- "data-comins-virtual-list-visible-count": D.length,
354
- "data-testid": `virtual-list-${fe}`,
306
+ className: P("comins-table__component", "comins-table__component-virtual-list", l.className),
307
+ "data-comins-virtual-list-expanded": T ? "true" : void 0,
308
+ "data-comins-virtual-list-visible-count": E.length,
309
+ "data-testid": `virtual-list-${pe}`,
355
310
  onClick: (e) => {
356
- l.onClick?.(e), V(e);
311
+ l.onClick?.(e), I(e);
357
312
  },
358
- onKeyDown: V,
359
- onMouseDown: V,
360
- onContextMenu: V,
361
- onDoubleClick: V,
362
- onMouseUp: V,
363
- onPointerUp: V,
364
- onPointerMove: V,
365
- onPointerEnter: V,
366
- onMouseOver: V,
367
- onMouseOut: V,
368
- onPointerLeave: V,
369
- onBlur: V,
370
- onFocus: V,
371
- onInput: V,
372
- onChange: V,
373
- onMouseMove: V,
374
- onMouseEnter: V,
375
- onMouseLeave: V,
376
- onTouchStart: V,
377
- onTouchMove: V,
378
- onTouchEnd: V,
313
+ onKeyDown: I,
314
+ onMouseDown: I,
315
+ onContextMenu: I,
316
+ onDoubleClick: I,
317
+ onMouseUp: I,
318
+ onPointerUp: I,
319
+ onPointerMove: I,
320
+ onPointerEnter: I,
321
+ onMouseOver: I,
322
+ onMouseOut: I,
323
+ onPointerLeave: I,
324
+ onBlur: I,
325
+ onFocus: I,
326
+ onInput: I,
327
+ onChange: I,
328
+ onMouseMove: I,
329
+ onMouseEnter: I,
330
+ onMouseLeave: I,
331
+ onTouchStart: I,
332
+ onTouchMove: I,
333
+ onTouchEnd: I,
379
334
  onWheel: (e) => {
380
- l.onWheel?.(e), V(e);
335
+ l.onWheel?.(e), I(e);
381
336
  },
382
337
  onPointerDown: (e) => {
383
- l.onPointerDown?.(e), V(e);
338
+ l.onPointerDown?.(e), I(e);
384
339
  },
385
340
  role: "listbox",
386
- style: pe,
341
+ style: me,
387
342
  children: [/* @__PURE__ */ N("div", {
388
343
  className: "comins-table__component-virtual-list-items",
389
344
  onScroll: (e) => {
390
- V(e), b(e.currentTarget.scrollTop);
345
+ I(e), b(e.currentTarget.scrollTop);
391
346
  let t = e.currentTarget.clientHeight > 0 ? e.currentTarget.clientHeight : p;
392
- te(m ? t : Math.min(t, p));
347
+ C(m ? t : Math.min(t, p));
393
348
  },
394
- ref: C,
349
+ ref: w,
395
350
  role: "presentation",
396
351
  children: [
397
- ue > 0 ? /* @__PURE__ */ M("span", {
352
+ de > 0 ? /* @__PURE__ */ M("span", {
398
353
  "aria-hidden": "true",
399
354
  className: "comins-table__component-virtual-list-spacer",
400
- style: { height: ue }
355
+ style: { height: de }
401
356
  }) : null,
402
- D.map(({ item: t, itemIndex: r }) => /* @__PURE__ */ M("button", {
357
+ E.map(({ item: t, itemIndex: r }) => /* @__PURE__ */ M("button", {
403
358
  "aria-selected": x === t.value,
404
359
  className: "comins-table__component-virtual-list-item",
405
360
  "data-comins-virtual-list-item": "true",
406
361
  disabled: t.disabled,
407
362
  onClick: (e) => {
408
- H(e), me(t, r, e);
363
+ Ie(e), he(t, r, e);
409
364
  },
410
365
  onContextMenu: (i) => {
411
- V(i), !t.disabled && e.onContextMenuItem?.({
366
+ I(i), !t.disabled && e.onContextMenuItem?.({
412
367
  ...n,
413
368
  event: i,
414
369
  item: t,
@@ -417,10 +372,10 @@ function Ke({ component: e, interaction: t, payload: n }) {
417
372
  });
418
373
  },
419
374
  onKeyDown: (e) => {
420
- V(e), (e.key === "Enter" || e.key === " " || e.key === "Spacebar") && (e.preventDefault(), me(t, r, e));
375
+ I(e), (e.key === "Enter" || e.key === " " || e.key === "Spacebar") && (e.preventDefault(), he(t, r, e));
421
376
  },
422
- onMouseDown: V,
423
- onPointerDown: V,
377
+ onMouseDown: I,
378
+ onPointerDown: I,
424
379
  role: "option",
425
380
  type: "button",
426
381
  children: /* @__PURE__ */ M("span", {
@@ -428,115 +383,115 @@ function Ke({ component: e, interaction: t, payload: n }) {
428
383
  children: t.label
429
384
  })
430
385
  }, `${String(t.value)}-${r}`)),
431
- de > 0 ? /* @__PURE__ */ M("span", {
386
+ fe > 0 ? /* @__PURE__ */ M("span", {
432
387
  "aria-hidden": "true",
433
388
  className: "comins-table__component-virtual-list-spacer",
434
- style: { height: de }
389
+ style: { height: fe }
435
390
  }) : null
436
391
  ]
437
392
  }), /* @__PURE__ */ N("div", {
438
393
  className: "comins-table__component-virtual-list-controls",
439
- children: [o && ie ? /* @__PURE__ */ M("button", {
440
- "aria-expanded": E,
394
+ children: [o && ae ? /* @__PURE__ */ M("button", {
395
+ "aria-expanded": T,
441
396
  "aria-label": "전체 목록 보기",
442
397
  className: "comins-table__component-virtual-list-overflow comins-table__component-virtual-list-more",
443
- "data-testid": `virtual-list-overflow-${fe}`,
398
+ "data-testid": `virtual-list-overflow-${pe}`,
444
399
  onClick: (e) => {
445
- H(e), t?.requestRowSelection?.({
400
+ Ie(e), t?.requestRowSelection?.({
446
401
  event: e,
447
402
  mode: "exclusive"
448
403
  }) !== !1 && v(!0);
449
404
  },
450
- onKeyDown: V,
451
- onMouseDown: V,
452
- onPointerDown: V,
405
+ onKeyDown: I,
406
+ onMouseDown: I,
407
+ onPointerDown: I,
453
408
  type: "button",
454
409
  children: "..."
455
- }) : ae ? /* @__PURE__ */ M("span", {
410
+ }) : oe ? /* @__PURE__ */ M("span", {
456
411
  "aria-hidden": "true",
457
412
  className: "comins-table__component-virtual-list-overflow comins-table__component-virtual-list-more",
458
- "data-testid": `virtual-list-overflow-${fe}`,
413
+ "data-testid": `virtual-list-overflow-${pe}`,
459
414
  children: "..."
460
- }) : null, re ? /* @__PURE__ */ M("input", {
415
+ }) : null, ne ? /* @__PURE__ */ M("input", {
461
416
  "aria-label": `${l["aria-label"] ?? "Virtual list"} 검색`,
462
417
  className: "comins-table__component-virtual-list-search",
463
- "data-testid": `virtual-list-search-${fe}`,
418
+ "data-testid": `virtual-list-search-${pe}`,
464
419
  onChange: (e) => {
465
- V(e), g(e.currentTarget.value);
420
+ I(e), g(e.currentTarget.value);
466
421
  },
467
- onClick: V,
468
- onKeyDown: V,
469
- onMouseDown: V,
470
- onPointerDown: V,
422
+ onClick: I,
423
+ onKeyDown: I,
424
+ onMouseDown: I,
425
+ onPointerDown: I,
471
426
  placeholder: "검색",
472
427
  value: h
473
428
  }) : null]
474
429
  })]
475
430
  });
476
431
  }
477
- function qe(e, t, n) {
478
- if (e.type === "menu") return /* @__PURE__ */ M(Ge, {
432
+ function Ve(e, t, n) {
433
+ if (e.type === "menu") return /* @__PURE__ */ M(Be, {
479
434
  component: e,
480
435
  payload: t
481
436
  });
482
- if (e.type === "virtual-list") return /* @__PURE__ */ M(Ke, {
437
+ if (e.type === "virtual-list") return /* @__PURE__ */ M(R, {
483
438
  component: e,
484
439
  interaction: n,
485
440
  payload: t
486
441
  });
487
442
  if (e.type === "button") {
488
- let n = L(e.props, t), { onClick: r, onKeyDown: i, onMouseDown: a, onPointerDown: o, ...s } = n;
443
+ let n = F(e.props, t), { onClick: r, onKeyDown: i, onMouseDown: a, onPointerDown: o, ...s } = n;
489
444
  return /* @__PURE__ */ M("button", {
490
445
  ...s,
491
- className: I("comins-table__component", "comins-table__component-button", n.className),
446
+ className: P("comins-table__component", "comins-table__component-button", n.className),
492
447
  onClick: (n) => {
493
- r?.(n), V(n), e.onClick?.({
448
+ r?.(n), I(n), e.onClick?.({
494
449
  ...t,
495
450
  event: n
496
451
  });
497
452
  },
498
453
  onKeyDown: (e) => {
499
- i?.(e), V(e);
454
+ i?.(e), I(e);
500
455
  },
501
456
  onMouseDown: (e) => {
502
- a?.(e), V(e);
457
+ a?.(e), I(e);
503
458
  },
504
459
  onPointerDown: (e) => {
505
- o?.(e), V(e);
460
+ o?.(e), I(e);
506
461
  },
507
462
  type: n.type ?? "button"
508
463
  });
509
464
  }
510
- if (e.type === "input") return /* @__PURE__ */ M(Ue, {
465
+ if (e.type === "input") return /* @__PURE__ */ M(Le, {
511
466
  component: e,
512
467
  payload: t
513
468
  });
514
- if (e.type === "checkbox") return /* @__PURE__ */ M(We, {
469
+ if (e.type === "checkbox") return /* @__PURE__ */ M(Re, {
515
470
  component: e,
516
471
  payload: t
517
472
  });
518
473
  if (e.type === "select") {
519
- let n = L(e.props, t), r = R(e.options, t), { onChange: i, onClick: a, onKeyDown: o, onMouseDown: s, onPointerDown: c, ...l } = n;
474
+ let n = F(e.props, t), r = Ae(e.options, t), { onChange: i, onClick: a, onKeyDown: o, onMouseDown: s, onPointerDown: c, ...l } = n;
520
475
  return /* @__PURE__ */ M("select", {
521
476
  ...l,
522
- className: I("comins-table__component", "comins-table__component-select", n.className),
477
+ className: P("comins-table__component", "comins-table__component-select", n.className),
523
478
  onClick: (e) => {
524
- a?.(e), V(e);
479
+ a?.(e), I(e);
525
480
  },
526
481
  onChange: (n) => {
527
- i?.(n), V(n), e.onValueChange?.({
482
+ i?.(n), I(n), e.onValueChange?.({
528
483
  ...t,
529
484
  value: n.currentTarget.value
530
485
  });
531
486
  },
532
487
  onKeyDown: (e) => {
533
- o?.(e), V(e);
488
+ o?.(e), I(e);
534
489
  },
535
490
  onMouseDown: (e) => {
536
- s?.(e), V(e);
491
+ s?.(e), I(e);
537
492
  },
538
493
  onPointerDown: (e) => {
539
- c?.(e), V(e);
494
+ c?.(e), I(e);
540
495
  },
541
496
  children: r.map((e) => /* @__PURE__ */ M("option", {
542
497
  disabled: e.disabled,
@@ -546,40 +501,40 @@ function qe(e, t, n) {
546
501
  });
547
502
  }
548
503
  if (e.type === "radio") {
549
- let n = L(e.props, t), r = R(e.options, t), i = n.value ?? ("value" in t ? t.value : void 0), a = "row" in t ? `${t.column.id}-${String(t.row.id)}-radio` : `${t.column.id}-header-radio`, { value: o, ...s } = n;
504
+ let n = F(e.props, t), r = Ae(e.options, t), i = n.value ?? ("value" in t ? t.value : void 0), a = "row" in t ? `${t.column.id}-${String(t.row.id)}-radio` : `${t.column.id}-header-radio`, { value: o, ...s } = n;
550
505
  return /* @__PURE__ */ M("div", {
551
506
  ...s,
552
- className: I("comins-table__component", "comins-table__component-radio", s.className),
507
+ className: P("comins-table__component", "comins-table__component-radio", s.className),
553
508
  onClick: (e) => {
554
- s.onClick?.(e), V(e);
509
+ s.onClick?.(e), I(e);
555
510
  },
556
511
  onKeyDown: (e) => {
557
- s.onKeyDown?.(e), V(e);
512
+ s.onKeyDown?.(e), I(e);
558
513
  },
559
514
  onMouseDown: (e) => {
560
- s.onMouseDown?.(e), V(e);
515
+ s.onMouseDown?.(e), I(e);
561
516
  },
562
517
  onPointerDown: (e) => {
563
- s.onPointerDown?.(e), V(e);
518
+ s.onPointerDown?.(e), I(e);
564
519
  },
565
520
  role: "radiogroup",
566
521
  children: r.map((n) => /* @__PURE__ */ N("label", {
567
- onClick: V,
568
- onMouseDown: V,
522
+ onClick: I,
523
+ onMouseDown: I,
569
524
  children: [/* @__PURE__ */ M("input", {
570
525
  checked: i === void 0 ? void 0 : String(i) === String(n.value),
571
526
  disabled: n.disabled,
572
527
  name: a,
573
- onClick: V,
528
+ onClick: I,
574
529
  onChange: (r) => {
575
- V(r), r.currentTarget.checked && e.onValueChange?.({
530
+ I(r), r.currentTarget.checked && e.onValueChange?.({
576
531
  ...t,
577
532
  value: String(n.value)
578
533
  });
579
534
  },
580
- onKeyDown: V,
581
- onMouseDown: V,
582
- onPointerDown: V,
535
+ onKeyDown: I,
536
+ onMouseDown: I,
537
+ onPointerDown: I,
583
538
  style: {
584
539
  height: 20,
585
540
  width: 20
@@ -590,49 +545,49 @@ function qe(e, t, n) {
590
545
  }, String(n.value)))
591
546
  });
592
547
  }
593
- if (e.type === "toggle") return /* @__PURE__ */ M(U, {
548
+ if (e.type === "toggle") return /* @__PURE__ */ M(ze, {
594
549
  component: e,
595
550
  payload: t
596
551
  });
597
- let r = L(e.props, t), i = Number(r.value ?? 0), a = Math.max(1, Number(r.max ?? 100)), o = Math.max(0, Math.min(100, i / a * 100));
552
+ let r = F(e.props, t), i = Number(r.value ?? 0), a = Math.max(1, Number(r.max ?? 100)), o = Math.max(0, Math.min(100, i / a * 100));
598
553
  return /* @__PURE__ */ M("div", {
599
554
  ...r,
600
555
  "aria-valuemax": a,
601
556
  "aria-valuemin": 0,
602
557
  "aria-valuenow": i,
603
- className: I("comins-table__component", "comins-table__component-progress", r.className),
604
- onClick: V,
605
- onKeyDown: V,
606
- onMouseDown: V,
607
- onPointerDown: V,
558
+ className: P("comins-table__component", "comins-table__component-progress", r.className),
559
+ onClick: I,
560
+ onKeyDown: I,
561
+ onMouseDown: I,
562
+ onPointerDown: I,
608
563
  role: "progressbar",
609
564
  children: /* @__PURE__ */ M("span", { style: { width: `${o}%` } })
610
565
  });
611
566
  }
612
567
  //#endregion
613
568
  //#region src/summary.ts
614
- function Je(e, t) {
569
+ function z(e, t) {
615
570
  return t.split(".").reduce((e, t) => {
616
571
  if (!(typeof e != "object" || !e)) return e[t];
617
572
  }, e);
618
573
  }
619
- function Ye(e) {
574
+ function B(e) {
620
575
  return e.filter((e) => typeof e == "number" && Number.isFinite(e));
621
576
  }
622
- function Xe(e, t) {
577
+ function He(e, t) {
623
578
  if (e === "count") return t.length;
624
- let n = Ye(t);
579
+ let n = B(t);
625
580
  return n.length === 0 ? null : e === "sum" ? n.reduce((e, t) => e + t, 0) : e === "avg" ? n.reduce((e, t) => e + t, 0) / n.length : e === "min" ? Math.min(...n) : Math.max(...n);
626
581
  }
627
- function Ze(e, t, n) {
582
+ function Ue(e, t, n) {
628
583
  return Object.entries(n.columns).reduce((n, [r, i]) => {
629
584
  let a = t.find((e) => e.id === r);
630
585
  if (!a || !i) return n;
631
- let o = typeof i == "object" && i ? i : void 0, s = typeof i == "object" && i ? i.aggregate : i, c = e.map((e) => Je(e, a.field)), l = typeof s == "function" ? s({
586
+ let o = typeof i == "object" && i ? i : void 0, s = typeof i == "object" && i ? i.aggregate : i, c = e.map((e) => z(e, a.field)), l = typeof s == "function" ? s({
632
587
  column: a,
633
588
  rows: e,
634
589
  values: c
635
- }) : Xe(s, c);
590
+ }) : He(s, c);
636
591
  return n[r] = o?.format ? o.format({
637
592
  column: a,
638
593
  rows: e,
@@ -643,15 +598,15 @@ function Ze(e, t, n) {
643
598
  }
644
599
  //#endregion
645
600
  //#region src/tree.ts
646
- function Qe(e) {
601
+ function We(e) {
647
602
  return e.join(".");
648
603
  }
649
- function W(e, t) {
604
+ function Ge(e, t) {
650
605
  let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = 0, a = (e, o) => {
651
606
  e.forEach((e, s) => {
652
607
  let c = [...o, s], l = t(e.item, i);
653
608
  if (i += 1, n.has(l)) throw Error(`Duplicate tree row id: ${String(l)}`);
654
- n.set(l, c), r.set(Qe(c), l), e.children?.length && a(e.children, c);
609
+ n.set(l, c), r.set(We(c), l), e.children?.length && a(e.children, c);
655
610
  });
656
611
  };
657
612
  return a(e, []), {
@@ -659,17 +614,17 @@ function W(e, t) {
659
614
  idByPath: r
660
615
  };
661
616
  }
662
- function $e(e, t, n) {
617
+ function V(e, t, n) {
663
618
  let [r, ...i] = t;
664
619
  return r === void 0 ? [...e] : e.map((e, t) => t === r ? i.length === 0 ? n(e) : e.children ? {
665
620
  ...e,
666
- children: $e(e.children, i, n)
621
+ children: V(e.children, i, n)
667
622
  } : e : e);
668
623
  }
669
- function et(e, t, n = {}) {
670
- let r = W(e, t), i = [], a = (e, t, o) => {
624
+ function Ke(e, t, n = {}) {
625
+ let r = Ge(e, t), i = [], a = (e, t, o) => {
671
626
  e.forEach((e, s) => {
672
- let c = [...o, s], l = e.children ?? [], u = l.length > 0, d = e.expand ?? n.defaultExpandAll ?? !1, f = r.idByPath.get(Qe(c));
627
+ let c = [...o, s], l = e.children ?? [], u = l.length > 0, d = e.expand ?? n.defaultExpandAll ?? !1, f = r.idByPath.get(We(c));
673
628
  f !== void 0 && (i.push({
674
629
  depth: t,
675
630
  expanded: d,
@@ -682,33 +637,33 @@ function et(e, t, n = {}) {
682
637
  };
683
638
  return a(e, 0, []), i;
684
639
  }
685
- function tt(e) {
686
- return e.flatMap((e) => e.children?.length ? tt(e.children) : [e.item]);
640
+ function H(e) {
641
+ return e.flatMap((e) => e.children?.length ? H(e.children) : [e.item]);
687
642
  }
688
- function nt(e, t, n, r = {}) {
689
- let i = W(e, n).byId.get(t);
690
- return i ? $e(e, i, (e) => ({
643
+ function qe(e, t, n, r = {}) {
644
+ let i = Ge(e, n).byId.get(t);
645
+ return i ? V(e, i, (e) => ({
691
646
  ...e,
692
647
  expand: !(e.expand ?? r.defaultExpandAll ?? !1)
693
648
  })) : [...e];
694
649
  }
695
- function rt(e, t, n, r) {
696
- let i = W(e, n).byId.get(t);
697
- return i ? $e(e, i, (e) => ({
650
+ function U(e, t, n, r) {
651
+ let i = Ge(e, n).byId.get(t);
652
+ return i ? V(e, i, (e) => ({
698
653
  ...e,
699
654
  item: r(e.item)
700
655
  })) : [...e];
701
656
  }
702
- function G(e, t) {
657
+ function W(e, t) {
703
658
  return [...e].sort((e, n) => t(e.item, n.item)).map((e) => ({
704
659
  ...e,
705
- children: e.children ? G(e.children, t) : void 0
660
+ children: e.children ? W(e.children, t) : void 0
706
661
  }));
707
662
  }
708
663
  //#endregion
709
664
  //#region src/index.tsx
710
- var it = 50;
711
- function at(e, t, n, r, i) {
665
+ var Je = 50;
666
+ function Ye(e, t, n, r, i) {
712
667
  let a = Math.max(0, r), o = e?.length ?? t.length, s = Math.min(o, Math.max(a, i)), c = [];
713
668
  for (let r = a; r < s; r += 1) {
714
669
  let i = e?.[r] ?? r, a = t[i], o = n[i];
@@ -721,26 +676,26 @@ function at(e, t, n, r, i) {
721
676
  }
722
677
  return c;
723
678
  }
724
- function ot(e) {
679
+ function Xe(e) {
725
680
  return !e || typeof e == "string" ? e : Object.entries(e).filter(([, e]) => e).map(([e]) => e).join(" ");
726
681
  }
727
- function K(e, t, n) {
682
+ function G(e, t, n) {
728
683
  return typeof e == "function" ? e(t, n) : e;
729
684
  }
730
- function st(e, t, n) {
731
- let r = K(e?.disabled, t, n) === !0;
685
+ function Ze(e, t, n) {
686
+ let r = G(e?.disabled, t, n) === !0;
732
687
  return {
733
- className: ot(K(e?.className, t, n)),
688
+ className: Xe(G(e?.className, t, n)),
734
689
  disabled: r,
735
- draggable: !r && K(e?.draggable, t, n) !== !1,
736
- style: K(e?.style, t, n)
690
+ draggable: !r && G(e?.draggable, t, n) !== !1,
691
+ style: G(e?.style, t, n)
737
692
  };
738
693
  }
739
- function ct(e) {
694
+ function Qe(e) {
740
695
  let t = e?.background ?? e?.backgroundColor;
741
696
  return typeof t == "string" || typeof t == "number" ? t : void 0;
742
697
  }
743
- function lt(e, t, n) {
698
+ function $e(e, t, n) {
744
699
  let r = {
745
700
  height: e,
746
701
  ...t
@@ -750,7 +705,7 @@ function lt(e, t, n) {
750
705
  "--comins-table-row-custom-background": n
751
706
  };
752
707
  }
753
- function ut(e) {
708
+ function et(e) {
754
709
  return {
755
710
  data: e.row,
756
711
  dataIndex: e.dataIndex,
@@ -758,7 +713,7 @@ function ut(e) {
758
713
  index: e.visibleIndex
759
714
  };
760
715
  }
761
- function dt(e, t) {
716
+ function tt(e, t) {
762
717
  return {
763
718
  definition: e,
764
719
  field: e.field,
@@ -767,23 +722,23 @@ function dt(e, t) {
767
722
  label: e.label
768
723
  };
769
724
  }
770
- function ft(e, t) {
725
+ function nt(e, t) {
771
726
  return {
772
727
  event: e,
773
728
  index: t.visibleIndex,
774
- row: ut(t)
729
+ row: et(t)
775
730
  };
776
731
  }
777
- function pt(e, t, n, r, i) {
732
+ function rt(e, t, n, r, i) {
778
733
  return {
779
- column: dt(n, r),
734
+ column: tt(n, r),
780
735
  event: e,
781
736
  index: t.visibleIndex,
782
- row: ut(t),
737
+ row: et(t),
783
738
  value: i
784
739
  };
785
740
  }
786
- function q(e, t) {
741
+ function it(e, t) {
787
742
  return {
788
743
  definition: e,
789
744
  field: e.field,
@@ -792,9 +747,9 @@ function q(e, t) {
792
747
  label: e.label
793
748
  };
794
749
  }
795
- function mt(e, t, n, r, i, a, o) {
750
+ function at(e, t, n, r, i, a, o) {
796
751
  return {
797
- column: q(i, a),
752
+ column: it(i, a),
798
753
  row: {
799
754
  data: e.row,
800
755
  dataIndex: e.dataIndex,
@@ -807,52 +762,54 @@ function mt(e, t, n, r, i, a, o) {
807
762
  value: o
808
763
  };
809
764
  }
810
- function ht(e, t) {
765
+ function ot(e, t) {
811
766
  let n = e.cell?.props;
812
767
  return typeof n == "function" ? n(t) : n;
813
768
  }
814
- function gt(e, t) {
769
+ function st(e, t) {
815
770
  return e === void 0 ? !0 : typeof e == "boolean" ? e : e(t);
816
771
  }
817
- function _t(e, t) {
818
- return e?.disabled !== void 0 && gt(e.disabled, t) === !0;
772
+ function ct(e, t) {
773
+ return e?.disabled !== void 0 && st(e.disabled, t) === !0;
819
774
  }
820
- function vt(e, t) {
775
+ function lt(e, t) {
821
776
  let n = e?.className;
822
777
  return typeof n == "function" ? n(t) : n;
823
778
  }
824
- function yt(e, t) {
779
+ function ut(e, t) {
825
780
  let n = e?.style;
826
781
  return typeof n == "function" ? n(t) : n;
827
782
  }
828
- function bt(e, t, n) {
783
+ function dt(e, t, n) {
829
784
  return e.cell?.format ? e.cell.format(n) : t == null ? "" : String(t);
830
785
  }
831
- function xt(e, t, n) {
832
- let r = e.columnState[t.id];
786
+ function ft(e, t, n) {
787
+ let r = e.columnState[t.id], i = Tt(e.sortModel, t.id);
833
788
  return {
834
- column: q(t, n),
789
+ column: it(t, n),
835
790
  layout: {
836
791
  hidden: r?.hidden === !0 || t.hidden === !0,
837
792
  width: r?.width ?? t.width
838
793
  },
839
794
  sort: {
840
- direction: e.sort?.columnId === t.id ? e.sort.direction : null,
841
- enabled: !!t.sort
795
+ count: e.sortModel.length,
796
+ direction: i?.rule.direction ?? null,
797
+ enabled: !!t.sort,
798
+ priority: i?.priority ?? null
842
799
  }
843
800
  };
844
801
  }
845
- function St(e) {
802
+ function pt(e) {
846
803
  return "row" in e && "selection" in e;
847
804
  }
848
- function Ct(e, t) {
849
- return !St(t) || e.type !== "input" && e.type !== "select" || t.selection.selectedRowCount === 1 && t.row.selected;
805
+ function K(e, t) {
806
+ return !pt(t) || e.type !== "input" && e.type !== "select" || t.selection.selectedRowCount === 1 && t.row.selected;
850
807
  }
851
- function wt(e, t) {
852
- return (e ?? []).filter((e) => Ct(e, t));
808
+ function mt(e, t) {
809
+ return (e ?? []).filter((e) => K(e, t));
853
810
  }
854
- function Tt(e, t, n, r) {
855
- return wt(e, t).map((e, t) => ({
811
+ function ht(e, t, n, r) {
812
+ return mt(e, t).map((e, t) => ({
856
813
  component: e,
857
814
  index: t
858
815
  })).filter(({ component: e }) => (e.direction ?? "left") === n).map(({ component: e, index: i }) => /* @__PURE__ */ M("span", {
@@ -860,14 +817,14 @@ function Tt(e, t, n, r) {
860
817
  "data-comins-component-align": e.align ?? "center",
861
818
  "data-comins-component-direction": n,
862
819
  "data-comins-component-id": e.id ?? `${e.type}-${i}`,
863
- children: qe(e, t, r)
820
+ children: Ve(e, t, r)
864
821
  }, e.id ?? `${e.type}-${i}`));
865
822
  }
866
- function Et(e, t, n, r = {}) {
823
+ function gt(e, t, n, r = {}) {
867
824
  if (!t?.length) return e;
868
- let i = r.showContent ?? !0, a = wt(t, n);
825
+ let i = r.showContent ?? !0, a = mt(t, n);
869
826
  if (!a.length) return e;
870
- let o = Tt(a, n, "left", r.interaction), s = Tt(a, n, "right", r.interaction);
827
+ let o = ht(a, n, "left", r.interaction), s = ht(a, n, "right", r.interaction);
871
828
  return i ? /* @__PURE__ */ N("span", {
872
829
  className: "comins-table__component-layout",
873
830
  children: [
@@ -896,48 +853,48 @@ function Et(e, t, n, r = {}) {
896
853
  })
897
854
  });
898
855
  }
899
- function Dt(e) {
900
- return Math.max(it, e.minWidth ?? it);
856
+ function _t(e) {
857
+ return Math.max(Je, e.minWidth ?? Je);
901
858
  }
902
- function J(e) {
859
+ function vt(e) {
903
860
  return e.maxWidth ?? Infinity;
904
861
  }
905
- function Ot(e, t) {
862
+ function yt(e, t) {
906
863
  return e.columnState[t.id]?.width ?? t.width ?? 100;
907
864
  }
908
- function kt(e, t, n) {
865
+ function q(e, t, n) {
909
866
  return Math.min(n, Math.max(t, e));
910
867
  }
911
- function At(e, t, n) {
912
- let r = t.map((t) => kt(Ot(e, t), Dt(t), J(t))), i = new Set(t.map((e, t) => t)), a = t.map(Dt), o = t.map(J), s = kt(n, a.reduce((e, t) => e + t, 0), o.reduce((e, t) => e + t, 0));
868
+ function bt(e, t, n) {
869
+ let r = t.map((t) => q(yt(e, t), _t(t), vt(t))), i = new Set(t.map((e, t) => t)), a = t.map(_t), o = t.map(vt), s = q(n, a.reduce((e, t) => e + t, 0), o.reduce((e, t) => e + t, 0));
913
870
  for (; i.size > 0;) {
914
871
  let e = s - r.reduce((e, t) => e + t, 0);
915
872
  if (Math.abs(e) < .001) break;
916
873
  let t = [...i], n = t.reduce((e, t) => e + Math.max(r[t] ?? 0, 0), 0), c = !1;
917
874
  for (let s of t) {
918
- let l = r[s] ?? 0, u = l + e * (n > 0 ? l / n : 1 / t.length), d = kt(u, a[s] ?? 0, o[s] ?? Infinity);
875
+ let l = r[s] ?? 0, u = l + e * (n > 0 ? l / n : 1 / t.length), d = q(u, a[s] ?? 0, o[s] ?? Infinity);
919
876
  r[s] = d, Math.abs(d - u) > .001 && (i.delete(s), c = !0);
920
877
  }
921
878
  if (!c) break;
922
879
  }
923
880
  return r;
924
881
  }
925
- function jt(e, t, n) {
882
+ function xt(e, t, n) {
926
883
  let r = e.columnGroups.find((e) => e.children.includes(t));
927
- if (!r || e.columnGroupState[r.id]?.hidden === !0) return he(e, t, n);
884
+ if (!r || e.columnGroupState[r.id]?.hidden === !0) return D(e, t, n);
928
885
  let i = r.children.map((t) => e.columns.find((e) => e.id === t)).filter((e) => !!e).filter((t) => e.columnState[t.id]?.hidden !== !0), a = i.find((e) => e.id === t);
929
- if (!a) return he(e, t, n);
886
+ if (!a) return D(e, t, n);
930
887
  let o = i.filter((e) => e.id !== t);
931
888
  if (o.length === 0) {
932
- let r = Ot(e, a);
933
- return he(e, t, kt(n, Dt(a), Math.min(J(a), r)));
889
+ let r = yt(e, a);
890
+ return D(e, t, q(n, _t(a), Math.min(vt(a), r)));
934
891
  }
935
- let s = i.reduce((t, n) => t + Ot(e, n), 0), c = o.reduce((e, t) => e + Dt(t), 0), l = o.reduce((e, t) => e + J(t), 0), u = Math.max(Dt(a), s - l), d = kt(n, u, Math.max(u, Math.min(J(a), s - c))), f = At(e, o, s - d), p = he(e, t, d);
892
+ let s = i.reduce((t, n) => t + yt(e, n), 0), c = o.reduce((e, t) => e + _t(t), 0), l = o.reduce((e, t) => e + vt(t), 0), u = Math.max(_t(a), s - l), d = q(n, u, Math.max(u, Math.min(vt(a), s - c))), f = bt(e, o, s - d), p = D(e, t, d);
936
893
  return o.forEach((e, t) => {
937
- p = he(p, e.id, f[t] ?? Ot(p, e));
894
+ p = D(p, e.id, f[t] ?? yt(p, e));
938
895
  }), p;
939
896
  }
940
- function Mt(e, t, n) {
897
+ function St(e, t, n) {
941
898
  if (!e || typeof e != "object") return e;
942
899
  let r = t.split("."), [i] = r;
943
900
  if (!i) return e;
@@ -951,7 +908,7 @@ function Mt(e, t, n) {
951
908
  o[e] = a, n && (o = a);
952
909
  }), o[r.at(-1)] = n, a;
953
910
  }
954
- function Nt(e, t) {
911
+ function Ct(e, t) {
955
912
  return e?.columnId === t ? e.direction === "asc" ? {
956
913
  columnId: t,
957
914
  direction: "desc"
@@ -960,37 +917,60 @@ function Nt(e, t) {
960
917
  direction: "asc"
961
918
  };
962
919
  }
963
- function Pt(e, t) {
964
- return e?.columnId === t ? e.direction : "none";
920
+ function wt(e, t, n) {
921
+ let r = e.findIndex((e) => e.columnId === t), i = Ct(r < 0 ? null : e[r] ?? null, t);
922
+ return n ? i ? r < 0 ? [...e, i] : e.map((e, t) => t === r ? i : e) : e.filter((e) => e.columnId !== t) : i ? [i] : [];
923
+ }
924
+ function Tt(e, t) {
925
+ let n = e.findIndex((e) => e.columnId === t);
926
+ return n < 0 ? null : {
927
+ priority: n + 1,
928
+ rule: e[n]
929
+ };
930
+ }
931
+ function Et(e, t) {
932
+ let n = Tt(e, t)?.rule;
933
+ return n ? n.direction : "none";
965
934
  }
966
- function Ft(e, t) {
967
- return e?.columnId === t ? e.direction === "asc" ? "ascending" : "descending" : "none";
935
+ function Dt(e, t) {
936
+ let n = Tt(e, t);
937
+ if (!n) return e.length > 1 ? void 0 : "none";
938
+ if (!(n.priority > 1)) return n.rule.direction === "asc" ? "ascending" : "descending";
968
939
  }
969
- function It(e, t) {
940
+ function Ot(e, t) {
941
+ return !e || !t ? e === t : e.columnId === t.columnId && e.direction === t.direction;
942
+ }
943
+ function kt(e, t) {
944
+ return e.length === t.length && e.every((e, n) => e.columnId === t[n]?.columnId && e.direction === t[n]?.direction);
945
+ }
946
+ function At(e, t) {
970
947
  return e.length === t.length && e.every((e, n) => e === t[n]);
971
948
  }
972
- function Lt(e, t) {
973
- if (!It(e.rowIds, t.rowIds)) return !1;
949
+ function jt(e, t) {
950
+ if (!At(e.rowIds, t.rowIds)) return !1;
974
951
  let n = new Set(t.columns.map((e) => e.id)), r = e.selection.cell, i = e.selection.range;
975
952
  return !(r && !n.has(r.columnId) || i && (!n.has(i.anchor.columnId) || !n.has(i.focus.columnId)));
976
953
  }
977
- function Rt(e, t) {
954
+ function Mt(e, t) {
978
955
  return t.split(".").reduce((e, t) => {
979
956
  if (!(typeof e != "object" || !e)) return e[t];
980
957
  }, e);
981
958
  }
982
- function zt(e, t) {
959
+ function J(e, t) {
983
960
  return typeof e == "number" && typeof t == "number" ? e - t : String(e ?? "").localeCompare(String(t ?? ""));
984
961
  }
985
- function Bt(e, t, n) {
986
- if (!n) return e;
987
- let r = t.find((e) => (e.id ?? e.field) === n.columnId);
988
- return r?.sort ? G(e, (e, t) => {
989
- let i = Rt(e, r.field), a = Rt(t, r.field), o = typeof r.sort == "function" ? r.sort(i, a, e, t) : zt(i, a);
990
- return n.direction === "desc" ? o * -1 : o;
991
- }) : e;
962
+ function Nt(e, t, n) {
963
+ return n.length === 0 ? e : W(e, (e, r) => {
964
+ for (let i of n) {
965
+ let n = t.find((e) => (e.id ?? e.field) === i.columnId);
966
+ if (!n?.sort) continue;
967
+ let a = Mt(e, n.field), o = Mt(r, n.field), s = typeof n.sort == "function" ? n.sort(a, o, e, r) : J(a, o);
968
+ if (s !== 0) return i.direction === "desc" ? s * -1 : s;
969
+ }
970
+ return 0;
971
+ });
992
972
  }
993
- function Vt(e, t, n, r, i) {
973
+ function Pt(e, t, n, r, i) {
994
974
  if (t?.length === 0) return e;
995
975
  let a = [], o = /* @__PURE__ */ new Map(), s = 0, c = (e, t) => {
996
976
  e.forEach((e) => {
@@ -1022,112 +1002,117 @@ function Vt(e, t, n, r, i) {
1022
1002
  };
1023
1003
  return m(e);
1024
1004
  }
1025
- function Ht({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroups: l, columns: u, data: d, "data-testid": f, emptyComponent: p, getRowId: m, hasMoreRows: h = !1, infiniteScroll: v = !1, infiniteScrollThreshold: y = 160, lazyLoad: x = !1, lazyLoadBatchSize: S = 30, lazyLoadMode: C = "append", lazyLoadThreshold: ne, loading: oe = !1, loadingComponent: se, loadingMore: fe = !1, onChangeColumnLayout: me, onChangeData: ge, onChangeSelection: _e, onChangeSort: ye, onClickCell: be, onClickRow: Ce, onContextMenuCell: Te, onContextMenuRow: Ee, onDoubleClickCell: De, onDoubleClickRow: ke, onKeyDownCell: Ae, onKeyDownRow: je, onLazyLoad: Me, onLoadMore: Ne, pagination: P, persistHeaderWhenEmpty: Pe = !0, rowHeight: F = 36, rowProps: Fe, showHeader: Ie = !0, skeletonRowCount: I, style: L, summary: R, theme: ze, treeContext: z, virtualized: B = !1 }, Be) {
1026
- let Ve = A(null), V = A(null), H = A(null), He = A(null), Ue = A(null), We = A(null), U = A(null), Ge = A(null), Ke = A(null), qe = A(null), Je = A(0), Ye = A(d), Xe = A(void 0), Qe = A(null), W = A(null), $e = A(null), et = A(null), tt = A(!1), nt = A(null), rt = A(0), G = A(null), it = A(null), K = A(null), [ut, dt] = j(0), [q, gt] = j(0), [St, Ct] = j(null), [J, Ot] = j(null), [kt, At] = j(null), [It, Rt] = j(null), [zt, Bt] = j(null), [Vt, Ht] = j(d), [Ut, Wt] = j(void 0), [Gt, Kt] = j(null), [qt, Jt] = j(null), [Yt, Xt] = j(0), Zt = x ? Vt : d, [Y, Qt] = j(() => c({
1005
+ function Ft({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroups: l, columns: u, data: d, "data-testid": f, emptyComponent: p, getRowId: m, hasMoreRows: h = !1, infiniteScroll: v = !1, infiniteScrollThreshold: y = 160, lazyLoad: x = !1, lazyLoadBatchSize: S = 30, lazyLoadMode: w = "append", lazyLoadThreshold: te, loading: se = !1, loadingComponent: ce, loadingMore: pe = !1, multiSort: he = !1, onChangeColumnLayout: ge, onChangeData: _e, onChangeSelection: be, onChangeSort: xe, onChangeSortModel: Te, onClickCell: Ee, onClickRow: Oe, onContextMenuCell: P, onContextMenuRow: F, onDoubleClickCell: Ae, onDoubleClickRow: je, onKeyDownCell: Me, onKeyDownRow: Ne, onLazyLoad: Pe, onLoadMore: Fe, pagination: I, persistHeaderWhenEmpty: Ie = !0, rowHeight: L = 36, rowProps: Le, showHeader: Re = !0, skeletonRowCount: ze, style: Be, summary: R, theme: Ve, treeContext: z, virtualized: B = !1 }, He) {
1006
+ let We = A(null), Ge = A(null), V = A(null), Ke = A(null), H = A(null), qe = A(null), U = A(null), W = A(null), Je = A(null), G = A(null), et = A(null), tt = A(0), it = A(d), st = A(void 0), pt = A(null), K = A(null), vt = A(null), yt = A(null), q = A(!1), bt = A(null), Ct = A(0), At = A(null), Mt = A(null), J = A(null), [Nt, Pt] = j(0), [Ft, It] = j(0), [Lt, Rt] = j(null), [zt, Bt] = j(null), [Vt, Ht] = j(null), [Ut, Wt] = j(null), [Gt, Kt] = j(null), [qt, Jt] = j(d), [Yt, Xt] = j(void 0), [Zt, Qt] = j(null), [$t, en] = j(null), [tn, nn] = j(0), rn = x ? qt : d, [Y, an] = j(() => c({
1027
1007
  columnGroups: l,
1028
1008
  columns: u,
1029
1009
  getRowId: m,
1030
- pagination: P,
1031
- rows: Zt,
1032
- showHeader: Ie,
1033
- theme: ze
1034
- })), X = A(Y), $t = A({
1010
+ pagination: I,
1011
+ rows: rn,
1012
+ showHeader: Re,
1013
+ theme: Ve
1014
+ })), X = A(Y), on = A({
1035
1015
  columnGroups: l,
1036
1016
  columns: u,
1037
- data: Zt,
1017
+ data: rn,
1038
1018
  getRowId: m,
1039
- pagination: P,
1040
- showHeader: Ie
1041
- }), en = Math.max(0, Math.floor(Number.isFinite(e) ? Number(e) : 10)), tn = Math.max(1, Math.floor(S)), nn = Math.max(0, Math.floor(ne ?? y)), rn = (e) => {
1042
- if (!x || C !== "append" || !Me || qe.current) return;
1019
+ pagination: I,
1020
+ showHeader: Re
1021
+ }), sn = Math.max(0, Math.floor(Number.isFinite(e) ? Number(e) : 10)), cn = Math.max(1, Math.floor(S)), ln = Math.max(0, Math.floor(te ?? y)), un = () => {
1022
+ let e = U.current;
1023
+ U.current = null, e?.();
1024
+ }, dn = (e) => {
1025
+ un(), U.current = e;
1026
+ }, fn = (e) => {
1027
+ if (!x || w !== "append" || !Pe || et.current) return;
1043
1028
  let t = X.current.rows.length;
1044
- if (e === "scroll" && Xe.current !== void 0 && t >= Xe.current) return;
1045
- let n = new AbortController(), r = Je.current + 1, i = e === "scroll" ? t : 0;
1046
- Je.current = r, Ke.current?.abort(), Ke.current = n, qe.current = e, e !== "scroll" && (rt.current = 0, Xt(0), Ve.current && (Ve.current.scrollTop = 0)), Bt(e), Me({
1047
- limit: tn,
1029
+ if (e === "scroll" && st.current !== void 0 && t >= st.current) return;
1030
+ let n = new AbortController(), r = tt.current + 1, i = e === "scroll" ? t : 0;
1031
+ tt.current = r, G.current?.abort(), G.current = n, et.current = e, e !== "scroll" && (Ct.current = 0, nn(0), We.current && (We.current.scrollTop = 0)), Kt(e), Pe({
1032
+ limit: cn,
1048
1033
  offset: i,
1049
1034
  reason: e,
1050
1035
  signal: n.signal
1051
1036
  }).then((t) => {
1052
- if (n.signal.aborted || Je.current !== r) return;
1053
- let i = e === "scroll" ? [...Ye.current, ...t.rows] : [...t.rows];
1054
- Ye.current = i, Xe.current = t.total, Ht(i), Wt(t.total);
1037
+ if (n.signal.aborted || tt.current !== r) return;
1038
+ let i = e === "scroll" ? [...it.current, ...t.rows] : [...t.rows];
1039
+ it.current = i, st.current = t.total, Jt(i), Xt(t.total);
1055
1040
  }).catch(() => {}).finally(() => {
1056
- Je.current === r && (qe.current = null, Ke.current = null, Bt(null));
1041
+ tt.current === r && (et.current = null, G.current = null, Kt(null));
1057
1042
  });
1058
1043
  };
1059
1044
  O(() => {
1060
- Ye.current = Vt;
1061
- }, [Vt]), O(() => {
1062
- Xe.current = Ut;
1063
- }, [Ut]), O(() => {
1064
- x || (Ye.current = d, Ht(d), Xe.current = void 0, Wt(void 0));
1045
+ it.current = qt;
1046
+ }, [qt]), O(() => {
1047
+ st.current = Yt;
1048
+ }, [Yt]), O(() => {
1049
+ x || (it.current = d, Jt(d), st.current = void 0, Xt(void 0));
1065
1050
  }, [d, x]), O(() => {
1066
- if (!(!x || !Me)) return rn("initial"), () => {
1067
- Je.current += 1, qe.current = null, Ke.current?.abort(), Ke.current = null;
1051
+ if (!(!x || !Pe)) return fn("initial"), () => {
1052
+ tt.current += 1, et.current = null, G.current?.abort(), G.current = null;
1068
1053
  };
1069
1054
  }, [
1070
1055
  x,
1071
- Me,
1072
- tn
1056
+ Pe,
1057
+ cn
1073
1058
  ]), O(() => {
1074
- let e = $t.current;
1075
- e.columns === u && e.columnGroups === l && e.data === Zt && e.getRowId === m && e.pagination === P && e.showHeader === Ie || ($t.current = {
1059
+ let e = on.current;
1060
+ if (e.columns === u && e.columnGroups === l && e.data === rn && e.getRowId === m && e.pagination === I && e.showHeader === Re) return;
1061
+ on.current = {
1076
1062
  columnGroups: l,
1077
1063
  columns: u,
1078
- data: Zt,
1064
+ data: rn,
1079
1065
  getRowId: m,
1080
- pagination: P,
1081
- showHeader: Ie
1082
- }, Qt((e) => {
1083
- let t = c({
1084
- columnLayout: de(e),
1085
- columnGroups: l,
1086
- columns: u,
1087
- getRowId: m,
1088
- pagination: P ?? e.pagination,
1089
- rows: Zt,
1090
- showHeader: Ie,
1091
- sort: e.sort,
1092
- theme: e.theme
1093
- });
1094
- return Lt(e, t) ? {
1095
- ...t,
1096
- selection: e.selection
1097
- } : t;
1098
- }));
1066
+ pagination: I,
1067
+ showHeader: Re
1068
+ };
1069
+ let t = X.current, n = c({
1070
+ columnLayout: fe(t),
1071
+ columnGroups: l,
1072
+ columns: u,
1073
+ getRowId: m,
1074
+ pagination: I ?? t.pagination,
1075
+ rows: rn,
1076
+ showHeader: Re,
1077
+ sortModel: t.sortModel,
1078
+ theme: t.theme
1079
+ }), r = jt(t, n) ? {
1080
+ ...n,
1081
+ selection: t.selection
1082
+ } : n;
1083
+ X.current = r, an(r), Ot(r.sort, t.sort) || xe?.(r.sort), kt(r.sortModel, t.sortModel) || Te?.(r.sortModel);
1099
1084
  }, [
1100
1085
  l,
1101
1086
  u,
1102
- Zt,
1087
+ rn,
1103
1088
  m,
1104
- P,
1105
- Ie
1089
+ I,
1090
+ Re
1106
1091
  ]), O(() => {
1107
1092
  X.current = Y;
1108
1093
  }, [Y]), O(() => {
1109
- Qe.current !== null && Qe.current !== Y.rows.length && (Qe.current = null);
1094
+ pt.current !== null && pt.current !== Y.rows.length && (pt.current = null);
1110
1095
  }, [Y.rows.length]), O(() => () => {
1111
- it.current !== null && window.cancelAnimationFrame(it.current), G.current !== null && window.clearTimeout(G.current);
1096
+ un(), Mt.current !== null && window.cancelAnimationFrame(Mt.current), At.current !== null && window.clearTimeout(At.current);
1112
1097
  }, []), O(() => {
1113
- let e = Ve.current;
1098
+ let e = We.current;
1114
1099
  if (!e || typeof ResizeObserver > "u") return;
1115
1100
  let t = new ResizeObserver(([e]) => {
1116
- e && (dt(e.contentRect.height), gt(e.contentRect.width));
1101
+ e && (Pt(e.contentRect.height), It(e.contentRect.width));
1117
1102
  });
1118
1103
  return t.observe(e), () => t.disconnect();
1119
1104
  }, []);
1120
- let an = (e, t, n = {}) => {
1121
- t.rows !== e.rows && ge?.(t.rows), t.selection !== e.selection && _e?.(t.selection), n.columnLayoutChanged && me?.(de(t)), (n.sortChanged || t.sort !== e.sort) && ye?.(t.sort);
1105
+ let pn = (e, t, n = {}) => {
1106
+ t.rows !== e.rows && _e?.(t.rows), t.selection !== e.selection && be?.(t.selection), n.columnLayoutChanged && ge?.(fe(t)), Ot(t.sort, e.sort) || xe?.(t.sort), kt(t.sortModel, e.sortModel) || Te?.(t.sortModel);
1122
1107
  }, Z = (e, t = {}) => {
1123
1108
  let n = X.current, r = typeof e == "function" ? e(n) : e;
1124
- X.current = r, Qt(r), an(n, r, t);
1125
- }, Q = k(() => ee(Y), [Y]), on = k(() => _(Y), [Y]), sn = k(() => R ? Ze(z?.summaryRows ?? Y.rows, Q, R) : null, [
1109
+ X.current = r, an(r), pn(n, r, t);
1110
+ }, Q = k(() => ee(Y), [Y]), mn = k(() => _(Y), [Y]), hn = k(() => R ? Ue(z?.summaryRows ?? Y.rows, Q, R) : null, [
1126
1111
  Y.rows,
1127
1112
  R,
1128
1113
  z?.summaryRows,
1129
1114
  Q
1130
- ]), cn = k(() => {
1115
+ ]), gn = k(() => {
1131
1116
  if (!R) return [];
1132
1117
  let e = [], t = 0;
1133
1118
  for (; t < Q.length;) {
@@ -1137,69 +1122,69 @@ function Ht({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
1137
1122
  colSpan: o,
1138
1123
  column: n,
1139
1124
  style: i?.style,
1140
- value: sn?.[n.id] ?? (e.length === 0 ? R.label : null)
1125
+ value: hn?.[n.id] ?? (e.length === 0 ? R.label : null)
1141
1126
  }), t += o;
1142
1127
  }
1143
1128
  return e;
1144
1129
  }, [
1145
1130
  R,
1146
- sn,
1131
+ hn,
1147
1132
  Q
1148
- ]), ln = k(() => z || !Y.sort ? null : b(Y), [Y, z]), un = ln?.length ?? Y.rows.length, dn = Math.max(0, Y.pagination.pageIndex) * Math.max(1, Y.pagination.pageSize), fn = k(() => {
1133
+ ]), _n = k(() => z || Y.sortModel.length === 0 ? null : b(Y), [Y, z]), vn = _n?.length ?? Y.rows.length, yn = Math.max(0, Y.pagination.pageIndex) * Math.max(1, Y.pagination.pageSize), bn = k(() => {
1149
1134
  if (B) {
1150
- let e = Math.max(1, F), t = ut || F * 12, n = un * e, r = Math.min(n, 15e5), i = Math.max(0, n - t), a = Math.max(0, r - t), o = i > 0 && a > 0 ? i / a : 1, s = Math.min(i, Math.max(0, Yt) * o), c = Math.max(0, Math.floor(s / e) - en), l = Math.min(un, Math.ceil((s + Math.max(0, t)) / e) + en), u = c * e, d = o > 0 ? u / o : u;
1135
+ let e = Math.max(1, L), t = Nt || L * 12, n = vn * e, r = Math.min(n, 15e5), i = Math.max(0, n - t), a = Math.max(0, r - t), o = i > 0 && a > 0 ? i / a : 1, s = Math.min(i, Math.max(0, tn) * o), c = Math.max(0, Math.floor(s / e) - sn), l = Math.min(vn, Math.ceil((s + Math.max(0, t)) / e) + sn), u = c * e, d = o > 0 ? u / o : u;
1151
1136
  return {
1152
- entries: at(ln, Y.rows, Y.rowIds, c, l),
1137
+ entries: Ye(_n, Y.rows, Y.rowIds, c, l),
1153
1138
  renderOffset: d,
1154
1139
  scrollHeight: r
1155
1140
  };
1156
1141
  }
1157
1142
  return {
1158
- entries: at(ln, Y.rows, Y.rowIds, dn, dn + Math.max(1, Y.pagination.pageSize)),
1143
+ entries: Ye(_n, Y.rows, Y.rowIds, yn, yn + Math.max(1, Y.pagination.pageSize)),
1159
1144
  renderOffset: 0,
1160
1145
  scrollHeight: 0
1161
1146
  };
1162
1147
  }, [
1163
- ut,
1164
- dn,
1165
- F,
1166
- Yt,
1167
- ln,
1148
+ Nt,
1149
+ yn,
1150
+ L,
1151
+ tn,
1152
+ _n,
1168
1153
  Y.pagination.pageSize,
1169
1154
  Y.rowIds,
1170
1155
  Y.rows,
1171
- en,
1156
+ sn,
1172
1157
  B,
1173
- un
1174
- ]), pn = ze ?? Y.theme, mn = pn.density === "compact" ? "text-[11px]" : pn.density === "spacious" ? "text-[13px]" : "text-[length:var(--comins-font-size-base,12px)]", hn = k(() => new Set(Y.selection.rowIds), [Y.selection.rowIds]), gn = k(() => {
1158
+ vn
1159
+ ]), xn = Ve ?? Y.theme, Sn = xn.density === "compact" ? "text-[11px]" : xn.density === "spacious" ? "text-[13px]" : "text-[length:var(--comins-font-size-base,12px)]", Cn = k(() => new Set(Y.selection.rowIds), [Y.selection.rowIds]), wn = k(() => {
1175
1160
  let e = Q.length;
1176
1161
  if (e === 0) return [];
1177
1162
  let t = Q.map((e) => Y.columnState[e.id]?.width ?? e.width);
1178
- if (q <= 0) {
1163
+ if (Ft <= 0) {
1179
1164
  let n = `${100 / e}%`;
1180
1165
  return t.map((e) => e ?? n);
1181
1166
  }
1182
1167
  let n = 0;
1183
1168
  for (let e of t) n += e ?? 0;
1184
- let r = Q.filter((e, n) => t[n] === void 0), i = r.length > 0 ? Math.max(0, (q - n) / r.length) : 0;
1169
+ let r = Q.filter((e, n) => t[n] === void 0), i = r.length > 0 ? Math.max(0, (Ft - n) / r.length) : 0;
1185
1170
  return Q.map((e, n) => {
1186
- let r = t[n] ?? i, a = Dt(e), o = e.maxWidth ?? Infinity;
1171
+ let r = t[n] ?? i, a = _t(e), o = e.maxWidth ?? Infinity;
1187
1172
  return Math.min(o, Math.max(a, r));
1188
1173
  });
1189
1174
  }, [
1190
- q,
1175
+ Ft,
1191
1176
  Y.columnState,
1192
1177
  Q
1193
- ]), _n = k(() => {
1178
+ ]), Tn = k(() => {
1194
1179
  let e = 0;
1195
- for (let t of gn) {
1180
+ for (let t of wn) {
1196
1181
  if (typeof t != "number") return;
1197
1182
  e += t;
1198
1183
  }
1199
1184
  return e;
1200
- }, [gn]), vn = k(() => {
1201
- if (typeof _n == "number") return Math.max(q, _n);
1202
- }, [_n, q]), yn = typeof _n == "number" && q > 0 && _n > q + 1, bn = x ? x && (Ut === void 0 || un < Ut) : h, xn = oe || zt === "initial" || zt === "refresh", Sn = fe || zt === "scroll", Cn = un === 0, wn = xn && Cn, Tn = !xn && Cn, En = (v || x) && Sn && bn && !Cn, Dn = Math.max(1, Math.floor(I ?? Math.min(Math.max(1, Y.pagination.pageSize), 5))), On = (wn ? Dn : +!!Tn) + +!!En, kn = (fn.entries.length + On) * F, An = B ? 0 : Math.max(0, ut - kn), jn = Y.showHeader && (Pe || !Cn || xn), Mn = (e, t) => (e.ctrlKey || e.metaKey) && e.key.toLowerCase() === t, Nn = (e) => fn.entries[e], Pn = (e, t, n) => {
1185
+ }, [wn]), En = k(() => {
1186
+ if (typeof Tn == "number") return Math.max(Ft, Tn);
1187
+ }, [Tn, Ft]), Dn = typeof Tn == "number" && Ft > 0 && Tn > Ft + 1, On = x ? x && (Yt === void 0 || vn < Yt) : h, kn = se || Gt === "initial" || Gt === "refresh", An = pe || Gt === "scroll", jn = vn === 0, Mn = kn && jn, Nn = !kn && jn, Pn = (v || x) && An && On && !jn, Fn = Math.max(1, Math.floor(ze ?? Math.min(Math.max(1, Y.pagination.pageSize), 5))), In = (Mn ? Fn : +!!Nn) + +!!Pn, Ln = (bn.entries.length + In) * L, Rn = B ? 0 : Math.max(0, Nt - Ln), zn = Y.showHeader && (Ie || !jn || kn), Bn = (e, t) => (e.ctrlKey || e.metaKey) && e.key.toLowerCase() === t, Vn = (e) => bn.entries[e], Hn = (e, t, n) => {
1203
1188
  let r = (z ? e.rows.map((e, t) => t) : b(e)).flatMap((t, n) => {
1204
1189
  let r = e.rows[t], i = e.rowIds[t];
1205
1190
  return r === void 0 || i === void 0 ? [] : [{
@@ -1212,48 +1197,49 @@ function Ht({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
1212
1197
  if (i < 0 || a < 0) return [n];
1213
1198
  let o = Math.min(i, a), s = Math.max(i, a);
1214
1199
  return r.slice(o, s + 1).map((e) => e.rowId);
1215
- }, Fn = (e, t) => {
1216
- Z((n) => ue(n, Pn(n, e, t)));
1217
- }, In = (e) => {
1218
- Z((t) => ue(t, e.flatMap((e) => {
1219
- let t = Nn(e);
1200
+ }, Un = (e, t) => {
1201
+ Z((n) => de(n, Hn(n, e, t)));
1202
+ }, Wn = (e) => {
1203
+ Z((t) => de(t, e.flatMap((e) => {
1204
+ let t = Vn(e);
1220
1205
  return t ? [t.rowId] : [];
1221
1206
  })));
1222
1207
  }, $ = () => {
1223
- let e = K.current;
1224
- e && (e.cleanup(), e.timer !== null && window.clearTimeout(e.timer), K.current = null);
1225
- }, Ln = (e) => {
1226
- K.current?.columnId !== e && ($(), K.current = {
1208
+ let e = J.current;
1209
+ e && (e.cleanup(), e.timer !== null && window.clearTimeout(e.timer), J.current = null);
1210
+ }, Gn = (e) => {
1211
+ J.current?.columnId !== e && ($(), J.current = {
1227
1212
  cleanup: () => void 0,
1228
1213
  columnId: e,
1229
1214
  timer: null
1230
1215
  });
1231
- }, Rn = () => {
1232
- let e = K.current;
1216
+ }, Kn = () => {
1217
+ let e = J.current;
1233
1218
  e && (e.cleanup(), e.cleanup = () => void 0, e.timer = window.setTimeout(() => {
1234
- K.current === e && (K.current = null);
1219
+ J.current === e && (J.current = null);
1235
1220
  }, 0));
1236
- }, zn = () => {
1237
- let e = K.current;
1221
+ }, qn = () => {
1222
+ let e = J.current;
1238
1223
  if (!e) return;
1239
- let t = () => Rn(), n = () => $(), r = () => $();
1224
+ let t = () => Kn(), n = () => $(), r = () => $();
1240
1225
  e.cleanup(), e.cleanup = () => {
1241
1226
  window.removeEventListener("pointerup", t), window.removeEventListener("pointercancel", n), window.removeEventListener("blur", r);
1242
1227
  }, window.addEventListener("pointerup", t, { once: !0 }), window.addEventListener("pointercancel", n, { once: !0 }), window.addEventListener("blur", r, { once: !0 });
1243
- }, Bn = (e) => K.current?.columnId === e ? ($(), !0) : !1, Vn = (e) => {
1244
- e.sort && Z((t) => ve(t, Nt(t.sort, e.id)), { sortChanged: !0 });
1245
- }, Hn = (e, t) => {
1228
+ }, Jn = (e) => J.current?.columnId === e ? ($(), !0) : !1, Yn = (e, t) => {
1229
+ e.sort && Z((n) => ve(n, wt(n.sortModel, e.id, he && t)));
1230
+ }, Xn = (e, t) => {
1246
1231
  let n = document.elementFromPoint(e, t)?.closest("[data-comins-column-id], [data-comins-column-group-id]");
1247
1232
  if (!n) return null;
1248
1233
  if (n.dataset.cominsColumnId) return n.dataset.cominsColumnId;
1249
1234
  let r = n.dataset.cominsColumnGroupId;
1250
1235
  return (r ? X.current.columnGroups.find((e) => e.id === r) : void 0)?.children.find((e) => Q.some((t) => t.id === e)) ?? null;
1251
1236
  };
1252
- Oe(Be, () => ({
1253
- clearSort: () => Z((e) => i(e), { sortChanged: !0 }),
1237
+ De(He, () => ({
1238
+ clearSort: () => Z((e) => i(e)),
1254
1239
  expand: (e) => z?.onExpand(e),
1255
1240
  fold: (e) => z?.onFold(e),
1256
- getColumnLayout: () => de(Y),
1241
+ getColumnLayout: () => fe(Y),
1242
+ getSortModel: () => Y.sortModel,
1257
1243
  getSortState: () => Y.sort,
1258
1244
  setColumnLayout: (e) => Z((n) => t(n, e), { columnLayoutChanged: !0 }),
1259
1245
  setMoveTargetRow: (e, t) => Z((n) => {
@@ -1273,36 +1259,38 @@ function Ht({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
1273
1259
  ...n,
1274
1260
  rowIds: a,
1275
1261
  rows: c,
1276
- sort: null
1262
+ sort: null,
1263
+ sortModel: []
1277
1264
  } : n;
1278
- }, { sortChanged: !0 }),
1279
- setSelectedRow: (e) => In([e]),
1280
- setSelectedRows: (e) => In(e),
1281
- setSortState: (e) => Z((t) => ve(t, e), { sortChanged: !0 })
1265
+ }),
1266
+ setSelectedRow: (e) => Wn([e]),
1267
+ setSelectedRows: (e) => Wn(e),
1268
+ setSortModel: (e) => Z((t) => ve(t, e)),
1269
+ setSortState: (e) => Z((t) => ye(t, e))
1282
1270
  }), [
1283
- fn.entries,
1271
+ bn.entries,
1284
1272
  Y,
1285
1273
  z
1286
1274
  ]);
1287
- let Un = () => {
1288
- let e = U.current;
1289
- e && (e.cleanup(), e.timer !== null && window.clearTimeout(e.timer)), U.current = null, Ct(null), Ot(null), At(null), Rt(null);
1275
+ let Zn = () => {
1276
+ let e = W.current;
1277
+ e && (e.cleanup(), e.timer !== null && window.clearTimeout(e.timer)), W.current = null, Rt(null), Bt(null), Ht(null), Wt(null);
1290
1278
  };
1291
1279
  O(() => () => {
1292
- Un(), $();
1280
+ Zn(), $();
1293
1281
  }, []);
1294
- let Wn = (e) => {
1282
+ let Qn = (e) => {
1295
1283
  if (e.event.button !== 0) return;
1296
1284
  let t = e.event.pointerType, n = t === "mouse" || t === "", r = () => {
1297
- e.sortColumnId && Ln(e.sortColumnId);
1285
+ e.sortColumnId && Gn(e.sortColumnId);
1298
1286
  }, i = (t, n) => {
1299
- let i = U.current;
1287
+ let i = W.current;
1300
1288
  !i || i !== u || i.active || i.blocked || (i.active = !0, i.cancelSort = !0, r(), e.activate(t, n));
1301
1289
  }, a = (e) => {
1302
- let t = U.current;
1290
+ let t = W.current;
1303
1291
  if (!(!t || t !== u)) {
1304
1292
  if (!t.active && !t.blocked && n) {
1305
- let n = Re({
1293
+ let n = ke({
1306
1294
  clientX: e.clientX,
1307
1295
  clientY: e.clientY,
1308
1296
  startX: t.startX,
@@ -1310,24 +1298,24 @@ function Ht({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
1310
1298
  });
1311
1299
  n === "activate" ? i(e.clientX, e.clientY) : n === "cancel" && (t.blocked = !0, t.cancelSort = !0, r());
1312
1300
  }
1313
- !t.active && !t.blocked && !n && Math.hypot(e.clientX - t.startX, e.clientY - t.startY) > 4 && (t.blocked = !0, t.cancelSort = !0, window.clearTimeout(t.timer ?? void 0), r()), t.active && (e.preventDefault(), At({
1301
+ !t.active && !t.blocked && !n && Math.hypot(e.clientX - t.startX, e.clientY - t.startY) > 4 && (t.blocked = !0, t.cancelSort = !0, window.clearTimeout(t.timer ?? void 0), r()), t.active && (e.preventDefault(), Ht({
1314
1302
  x: e.clientX,
1315
1303
  y: e.clientY
1316
- }), Rt(Hn(e.clientX, e.clientY)));
1304
+ }), Wt(Xn(e.clientX, e.clientY)));
1317
1305
  }
1318
1306
  }, o = (t) => {
1319
- let n = U.current;
1307
+ let n = W.current;
1320
1308
  if (n === u && n.active) {
1321
- let n = Hn(t.clientX, t.clientY);
1309
+ let n = Xn(t.clientX, t.clientY);
1322
1310
  n && e.commitTarget(n);
1323
1311
  }
1324
- n === u && n.cancelSort && Rn(), Un();
1312
+ n === u && n.cancelSort && Kn(), Zn();
1325
1313
  }, s = () => {
1326
- $(), Un();
1314
+ $(), Zn();
1327
1315
  }, c = (e) => {
1328
- e.key === "Escape" && (e.preventDefault(), U.current === u && u.cancelSort && zn(), Un());
1316
+ e.key === "Escape" && (e.preventDefault(), W.current === u && u.cancelSort && qn(), Zn());
1329
1317
  }, l = () => {
1330
- $(), Un();
1318
+ $(), Zn();
1331
1319
  }, u = {
1332
1320
  active: !1,
1333
1321
  blocked: !1,
@@ -1342,23 +1330,23 @@ function Ht({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
1342
1330
  startY: e.event.clientY,
1343
1331
  timer: null
1344
1332
  };
1345
- Un(), $(), n || (u.timer = window.setTimeout(() => {
1346
- let e = U.current;
1333
+ Zn(), $(), n || (u.timer = window.setTimeout(() => {
1334
+ let e = W.current;
1347
1335
  e === u && !e.active && !e.blocked && i(e.startX, e.startY);
1348
- }, 1e3)), U.current = u, window.addEventListener("pointermove", a), window.addEventListener("pointerup", o), window.addEventListener("pointercancel", s), window.addEventListener("keydown", c), window.addEventListener("blur", l);
1349
- }, Gn = (e, t) => {
1350
- Wn({
1336
+ }, 1e3)), W.current = u, window.addEventListener("pointermove", a), window.addEventListener("pointerup", o), window.addEventListener("pointercancel", s), window.addEventListener("keydown", c), window.addEventListener("blur", l);
1337
+ }, $n = (e, t) => {
1338
+ Qn({
1351
1339
  activate: (e, n) => {
1352
- At({
1340
+ Ht({
1353
1341
  x: e,
1354
1342
  y: n
1355
- }), Rt(t.id), Ot(null), Ct(t.id);
1343
+ }), Wt(t.id), Bt(null), Rt(t.id);
1356
1344
  },
1357
1345
  commitTarget: (e) => {
1358
1346
  if (e === t.id) return;
1359
1347
  let n = Q.findIndex((t) => t.id === e);
1360
1348
  if (n >= 0) {
1361
- let e = X.current, r = re(e, t.id, n);
1349
+ let e = X.current, r = ne(e, t.id, n);
1362
1350
  r !== e && r.columnOrder.some((t, n) => t !== e.columnOrder[n]) && Z(r, { columnLayoutChanged: !0 });
1363
1351
  }
1364
1352
  },
@@ -1367,19 +1355,19 @@ function Ht({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
1367
1355
  kind: "column",
1368
1356
  sortColumnId: t.id
1369
1357
  });
1370
- }, Kn = (e, t) => {
1371
- Wn({
1358
+ }, er = (e, t) => {
1359
+ Qn({
1372
1360
  activate: (e, n) => {
1373
- At({
1361
+ Ht({
1374
1362
  x: e,
1375
1363
  y: n
1376
- }), Rt(t.children[0] ?? null), Ct(null), Ot(t.id);
1364
+ }), Wt(t.children[0] ?? null), Rt(null), Bt(t.id);
1377
1365
  },
1378
1366
  commitTarget: (e) => {
1379
1367
  if (t.children.includes(e)) return;
1380
1368
  let n = Q.findIndex((t) => t.id === e);
1381
1369
  if (n >= 0) {
1382
- let e = X.current, r = w(e, t.id, n);
1370
+ let e = X.current, r = re(e, t.id, n);
1383
1371
  r !== e && r.columnOrder.some((t, n) => t !== e.columnOrder[n]) && Z(r, { columnLayoutChanged: !0 });
1384
1372
  }
1385
1373
  },
@@ -1387,78 +1375,82 @@ function Ht({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
1387
1375
  id: t.id,
1388
1376
  kind: "group"
1389
1377
  });
1390
- }, qn = (e, t) => {
1391
- if (e.shiftKey && W.current !== null) {
1392
- Fn(W.current, t.rowId), W.current = t.rowId;
1378
+ }, tr = (e, t) => {
1379
+ if (e.shiftKey && K.current !== null) {
1380
+ Un(K.current, t.rowId), K.current = t.rowId;
1393
1381
  return;
1394
1382
  }
1395
- Z((n) => D(n, t.rowId, {
1383
+ Z((n) => E(n, t.rowId, {
1396
1384
  multi: e.ctrlKey || e.metaKey,
1397
1385
  toggle: e.ctrlKey || e.metaKey
1398
- })), W.current = t.rowId;
1399
- }, Jn = (e, t, n) => {
1386
+ })), K.current = t.rowId;
1387
+ }, nr = (e, t, n) => {
1400
1388
  if (n) {
1401
1389
  e.preventDefault();
1402
1390
  return;
1403
1391
  }
1404
- if (je?.(ft(e, t)), !(e.defaultPrevented || e.target !== e.currentTarget)) {
1405
- if (z && (Mn(e, "c") || Mn(e, "v"))) {
1392
+ if (Ne?.(nt(e, t)), !(e.defaultPrevented || e.target !== e.currentTarget)) {
1393
+ if (z && (Bn(e, "c") || Bn(e, "v"))) {
1406
1394
  e.preventDefault();
1407
1395
  return;
1408
1396
  }
1409
- if (Mn(e, "c")) {
1410
- e.preventDefault(), We.current = s(Y, t.rowId);
1397
+ if (Bn(e, "c")) {
1398
+ e.preventDefault(), qe.current = s(Y, t.rowId);
1411
1399
  return;
1412
1400
  }
1413
- Mn(e, "v") && We.current && (e.preventDefault(), Z((e) => ae(e, We.current, {
1401
+ Bn(e, "v") && qe.current && (e.preventDefault(), Z((e) => oe(e, qe.current, {
1414
1402
  mode: "insert-after",
1415
1403
  targetRowId: t.rowId
1416
1404
  })));
1417
1405
  }
1418
- }, Yn = (e, t, n, r, i, s) => {
1406
+ }, rr = (e, t, n, r, i, s) => {
1419
1407
  if (s) {
1420
1408
  e.preventDefault(), e.stopPropagation();
1421
1409
  return;
1422
1410
  }
1423
- if (Ae?.(pt(e, t, n, r, g(Y, t.row, n.id))), !e.defaultPrevented) {
1424
- if (Mn(e, "c")) {
1425
- e.preventDefault(), e.stopPropagation(), Ue.current = Y.selection.range ? o(Y) : null, He.current = Ue.current ? null : a(Y, i);
1411
+ if (Me?.(rt(e, t, n, r, g(Y, t.row, n.id))), !e.defaultPrevented) {
1412
+ if (Bn(e, "c")) {
1413
+ e.preventDefault(), e.stopPropagation(), H.current = Y.selection.range ? o(Y) : null, Ke.current = H.current ? null : a(Y, i);
1426
1414
  return;
1427
1415
  }
1428
- Mn(e, "v") && (Ue.current || He.current) && (e.preventDefault(), e.stopPropagation(), Z((e) => Ue.current ? E(e, i, Ue.current) : ie(e, i, He.current)));
1416
+ Bn(e, "v") && (H.current || Ke.current) && (e.preventDefault(), e.stopPropagation(), Z((e) => H.current ? T(e, i, H.current) : ae(e, i, Ke.current)));
1429
1417
  }
1430
- }, Xn = (e, t, r) => {
1431
- n && (r || e.button !== 0 || e.shiftKey || ($e.current = t, et.current = t, tt.current = !1));
1432
- }, Zn = (e, t) => {
1418
+ }, ir = (e, t, r) => {
1419
+ n && (r || e.button !== 0 || e.shiftKey || (vt.current = t, yt.current = t, q.current = !1));
1420
+ }, ar = (e, t) => {
1433
1421
  let n = document.elementFromPoint(e, t)?.closest("[data-comins-cell-column-id][data-comins-data-index]"), r = n?.dataset.cominsCellColumnId, i = n?.dataset.cominsDataIndex === void 0 ? NaN : Number(n.dataset.cominsDataIndex), a = Number.isInteger(i) ? Y.rowIds[i] : void 0;
1434
1422
  return r && a !== void 0 ? {
1435
1423
  columnId: r,
1436
1424
  rowId: a
1437
1425
  } : null;
1438
- }, Qn = (e) => {
1426
+ }, or = (e) => {
1439
1427
  if (!n) return;
1440
- let t = $e.current;
1441
- !t || t.rowId === e.rowId && t.columnId === e.columnId || (tt.current = !0, et.current = e, Ge.current = t, Z((n) => le(n, {
1428
+ let t = vt.current;
1429
+ !t || t.rowId === e.rowId && t.columnId === e.columnId || (q.current = !0, yt.current = e, Je.current = t, Z((n) => ue(n, {
1442
1430
  anchor: t,
1443
1431
  focus: e
1444
1432
  })));
1445
- }, $n = () => {
1446
- n && ($e.current = null, et.current = null);
1447
- }, er = (e, t, n) => {
1448
- if (Xn(e, t, n), n || e.button !== 0 || e.shiftKey) return;
1433
+ }, sr = () => {
1434
+ n && (vt.current = null, yt.current = null);
1435
+ }, cr = (e, t, n) => {
1436
+ if (ir(e, t, n), n || e.button !== 0 || e.shiftKey) return;
1449
1437
  let r = (e) => {
1450
1438
  if (e.buttons !== 1) return;
1451
- let t = Zn(e.clientX, e.clientY);
1452
- t && Qn(t);
1439
+ let t = ar(e.clientX, e.clientY);
1440
+ t && or(t);
1453
1441
  }, i = () => {
1454
- $n(), window.removeEventListener("pointermove", r), window.removeEventListener("pointerup", i);
1442
+ window.removeEventListener("pointermove", r), window.removeEventListener("pointerup", a), window.removeEventListener("pointercancel", o), window.removeEventListener("blur", o), U.current === i && (U.current = null);
1443
+ }, a = () => {
1444
+ i(), sr();
1445
+ }, o = () => {
1446
+ i(), sr();
1455
1447
  };
1456
- e.preventDefault(), window.addEventListener("pointermove", r), window.addEventListener("pointerup", i);
1457
- }, tr = (e, t, n, r) => {
1448
+ e.preventDefault(), dn(i), window.addEventListener("pointermove", r), window.addEventListener("pointerup", a), window.addEventListener("pointercancel", o), window.addEventListener("blur", o);
1449
+ }, lr = (e, t, n, r) => {
1458
1450
  if (n || !r || e.button !== 0) return;
1459
1451
  e.preventDefault(), e.stopPropagation();
1460
1452
  let i = t.rowId, a = (e) => {
1461
- nt.current = e, Jt(e);
1453
+ bt.current = e, en(e);
1462
1454
  }, o = (e, t) => {
1463
1455
  let n = document.elementFromPoint(e, t)?.closest("[data-comins-row-data-index]");
1464
1456
  if (!n || n.dataset.cominsRowDataIndex === void 0) return;
@@ -1469,21 +1461,25 @@ function Ht({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
1469
1461
  });
1470
1462
  }, s = (e) => {
1471
1463
  e.buttons === 1 && o(e.clientX, e.clientY);
1472
- }, c = (e) => {
1473
- window.removeEventListener("pointermove", s), window.removeEventListener("pointerup", c), o(e.clientX, e.clientY);
1474
- let t = nt.current?.targetDataIndex;
1475
- a(null), t !== void 0 && Z((e) => T(e, i, t));
1464
+ }, c = () => {
1465
+ window.removeEventListener("pointermove", s), window.removeEventListener("pointerup", l), window.removeEventListener("pointercancel", u), window.removeEventListener("blur", u), U.current === c && (U.current = null);
1466
+ }, l = (e) => {
1467
+ c(), o(e.clientX, e.clientY);
1468
+ let t = bt.current?.targetDataIndex;
1469
+ a(null), t !== void 0 && Z((e) => ie(e, i, t));
1470
+ }, u = () => {
1471
+ c(), a(null);
1476
1472
  };
1477
- o(e.clientX, e.clientY), window.addEventListener("pointermove", s), window.addEventListener("pointerup", c);
1478
- }, nr = St ? Q.find((e) => e.id === St) : void 0, rr = J ? Y.columnGroups.find((e) => e.id === J) : void 0, ir = nr?.label ?? rr?.label, ar = (e, t) => {
1473
+ o(e.clientX, e.clientY), dn(c), window.addEventListener("pointermove", s), window.addEventListener("pointerup", l), window.addEventListener("pointercancel", u), window.addEventListener("blur", u);
1474
+ }, ur = Lt ? Q.find((e) => e.id === Lt) : void 0, dr = zt ? Y.columnGroups.find((e) => e.id === zt) : void 0, fr = ur?.label ?? dr?.label, pr = (e, t) => {
1479
1475
  if (e.kind === "group") return /* @__PURE__ */ N("th", {
1480
- className: ["comins-table__th comins-table__group-th px-3 py-2 text-left font-semibold", J === e.groupId ? "comins-column-moving" : void 0].filter(Boolean).join(" "),
1476
+ className: ["comins-table__th comins-table__group-th px-3 py-2 text-left font-semibold", zt === e.groupId ? "comins-column-moving" : void 0].filter(Boolean).join(" "),
1481
1477
  colSpan: e.colSpan,
1482
- "data-column-moving": J === e.groupId ? "true" : void 0,
1483
- "data-column-placeholder": J === e.groupId ? "true" : void 0,
1478
+ "data-column-moving": zt === e.groupId ? "true" : void 0,
1479
+ "data-column-placeholder": zt === e.groupId ? "true" : void 0,
1484
1480
  "data-comins-column-group-id": e.groupId,
1485
1481
  "data-testid": `header-group-${e.groupId}`,
1486
- onPointerDown: (t) => Kn(t, e.group),
1482
+ onPointerDown: (t) => er(t, e.group),
1487
1483
  rowSpan: e.rowSpan,
1488
1484
  scope: "colgroup",
1489
1485
  children: [
@@ -1502,7 +1498,7 @@ function Ht({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
1502
1498
  /* @__PURE__ */ M("span", {
1503
1499
  "aria-hidden": "true",
1504
1500
  className: "comins-table__resize",
1505
- "data-resizing": Gt === e.groupId ? "true" : void 0,
1501
+ "data-resizing": Zt === e.groupId ? "true" : void 0,
1506
1502
  "data-testid": `resize-group-${e.groupId}`,
1507
1503
  onClick: (e) => e.stopPropagation(),
1508
1504
  onPointerDown: (t) => {
@@ -1511,52 +1507,58 @@ function Ht({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
1511
1507
  for (let t of e.group.children) {
1512
1508
  let e = Q.find((e) => e.id === t);
1513
1509
  if (!e) continue;
1514
- let n = Array.from(H.current?.querySelectorAll("[data-comins-column-id]") ?? []).find((t) => t.dataset.cominsColumnId === e.id)?.getBoundingClientRect().width, r = X.current.columnState[e.id]?.width ?? e.width ?? 160;
1510
+ let n = Array.from(V.current?.querySelectorAll("[data-comins-column-id]") ?? []).find((t) => t.dataset.cominsColumnId === e.id)?.getBoundingClientRect().width, r = X.current.columnState[e.id]?.width ?? e.width ?? 160;
1515
1511
  i.set(e.id, n && Number.isFinite(n) ? n : r);
1516
1512
  }
1517
1513
  let a = [...i.values()].reduce((e, t) => e + t, 0), o = r && Number.isFinite(r) ? r : Math.max(1, a);
1518
- Kt(e.groupId);
1514
+ Qt(e.groupId);
1519
1515
  let s = (t) => {
1520
1516
  Z((r) => {
1521
1517
  let a = r;
1522
- for (let [e, t] of i) a = he(a, e, t);
1523
- return pe(a, e.groupId, o + t.clientX - n);
1518
+ for (let [e, t] of i) a = D(a, e, t);
1519
+ return me(a, e.groupId, o + t.clientX - n);
1524
1520
  }, { columnLayoutChanged: !0 });
1525
1521
  }, c = () => {
1526
- Kt(null), window.removeEventListener("pointermove", s), window.removeEventListener("pointerup", c);
1522
+ window.removeEventListener("pointermove", s), window.removeEventListener("pointerup", l), window.removeEventListener("pointercancel", u), window.removeEventListener("blur", u), U.current === c && (U.current = null);
1523
+ }, l = () => {
1524
+ c(), Qt(null);
1525
+ }, u = () => {
1526
+ c(), Qt(null);
1527
1527
  };
1528
- window.addEventListener("pointermove", s), window.addEventListener("pointerup", c);
1528
+ dn(c), window.addEventListener("pointermove", s), window.addEventListener("pointerup", l), window.addEventListener("pointercancel", u), window.addEventListener("blur", u);
1529
1529
  },
1530
1530
  children: /* @__PURE__ */ M("span", { className: "comins-table__resize-line" })
1531
1531
  })
1532
1532
  ]
1533
1533
  }, `group-${e.groupId}`);
1534
- let n = e.column, r = Q.findIndex((e) => e.id === n.id), i = r >= 0 ? r : t, a = Y.columnState[n.id], o = n.header?.props ?? {}, s = Pt(Y.sort, n.id), c = s === "asc" || s === "desc", l = !!rr?.children.includes(n.id), u = St === n.id || l, d = [
1534
+ let n = e.column, r = Q.findIndex((e) => e.id === n.id), i = r >= 0 ? r : t, a = Y.columnState[n.id], o = n.header?.props ?? {}, s = Tt(Y.sortModel, n.id), c = Et(Y.sortModel, n.id), l = c === "asc" || c === "desc", u = s !== null && Y.sortModel.length > 1, d = !!dr?.children.includes(n.id), f = Lt === n.id || d, p = [
1535
1535
  "comins-table__th px-3 py-2 text-left font-semibold",
1536
- St === n.id ? "comins-column-moving" : void 0,
1536
+ Lt === n.id ? "comins-column-moving" : void 0,
1537
1537
  o.className
1538
- ].filter(Boolean).join(" "), f = xt(Y, n, i), p = n.header?.renderer ? n.header.renderer(f) : null, m = n.header?.renderer ? [] : Tt(n.header?.components, f, "left"), h = n.header?.renderer ? [] : Tt(n.header?.components, f, "right"), g = m.length > 0 || h.length > 0;
1538
+ ].filter(Boolean).join(" "), m = ft(Y, n, i), h = n.header?.renderer ? n.header.renderer(m) : null, g = n.header?.renderer ? [] : ht(n.header?.components, m, "left"), _ = n.header?.renderer ? [] : ht(n.header?.components, m, "right"), v = g.length > 0 || _.length > 0;
1539
1539
  return /* @__PURE__ */ we("th", {
1540
1540
  ...o,
1541
- className: d,
1541
+ className: p,
1542
1542
  colSpan: e.colSpan,
1543
- "data-column-drop-target": It === n.id ? "true" : void 0,
1544
- "data-column-moving": St === n.id ? "true" : void 0,
1545
- "data-column-placeholder": u ? "true" : void 0,
1543
+ "data-column-drop-target": Ut === n.id ? "true" : void 0,
1544
+ "data-column-moving": Lt === n.id ? "true" : void 0,
1545
+ "data-column-placeholder": f ? "true" : void 0,
1546
1546
  "data-comins-column-id": n.id,
1547
1547
  "data-comins-column-index": i,
1548
- "data-sort-direction": Y.sort?.columnId === n.id ? Y.sort.direction : void 0,
1548
+ "data-sort-count": s ? Y.sortModel.length : void 0,
1549
+ "data-sort-direction": s?.rule.direction,
1550
+ "data-sort-priority": s?.priority,
1549
1551
  "data-sortable": n.sort ? "true" : "false",
1550
1552
  "data-testid": `header-${n.id}`,
1551
- "aria-sort": n.sort ? Ft(Y.sort, n.id) : void 0,
1553
+ "aria-sort": n.sort ? Dt(Y.sortModel, n.id) : void 0,
1552
1554
  key: `column-${n.id}`,
1553
1555
  onClick: (e) => {
1554
- o.onClick?.(e), !(e.defaultPrevented || !n.sort) && (Bn(n.id) || Vn(n));
1556
+ o.onClick?.(e), !(e.defaultPrevented || !n.sort) && (Jn(n.id) || Yn(n, e.shiftKey));
1555
1557
  },
1556
1558
  onKeyDown: (e) => {
1557
- o.onKeyDown?.(e), !(e.defaultPrevented || !n.sort) && (e.key === "Enter" || e.key === " " || e.key === "Spacebar") && (e.preventDefault(), Vn(n));
1559
+ o.onKeyDown?.(e), !(e.defaultPrevented || !n.sort) && (e.key === "Enter" || e.key === " " || e.key === "Spacebar") && (e.preventDefault(), Yn(n, e.shiftKey));
1558
1560
  },
1559
- onPointerDown: (e) => Gn(e, n),
1561
+ onPointerDown: (e) => $n(e, n),
1560
1562
  rowSpan: e.rowSpan,
1561
1563
  scope: "col",
1562
1564
  style: {
@@ -1570,154 +1572,166 @@ function Ht({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
1570
1572
  }), /* @__PURE__ */ N("span", {
1571
1573
  className: "comins-table__header-content",
1572
1574
  "data-comins-header-body": "true",
1573
- "data-comins-header-components": g ? "true" : void 0,
1574
- "data-comins-sort-indicator-visible": c ? "true" : void 0,
1575
+ "data-comins-header-components": v ? "true" : void 0,
1576
+ "data-comins-sort-indicator-visible": l ? "true" : void 0,
1575
1577
  children: [
1576
1578
  /* @__PURE__ */ M("span", {
1577
1579
  className: "comins-table__header-slot",
1578
1580
  "data-comins-header-slot": "left",
1579
- children: m
1581
+ children: g
1580
1582
  }),
1581
1583
  /* @__PURE__ */ M("span", {
1582
1584
  className: "comins-table__header-label",
1583
- children: n.header?.renderer ? p : n.label
1585
+ children: n.header?.renderer ? h : n.label
1584
1586
  }),
1585
- /* @__PURE__ */ M("span", {
1586
- "aria-hidden": "true",
1587
- className: "comins-sort-indicator",
1588
- "data-sort-state": s,
1589
- "data-sort-visible": c ? "true" : void 0,
1590
- "data-testid": `sort-indicator-${n.id}`,
1591
- children: /* @__PURE__ */ M(Le, {
1592
- className: "comins-sort-icon",
1593
- focusable: "false",
1594
- size: 14,
1595
- strokeWidth: 2.25
1596
- })
1587
+ /* @__PURE__ */ N("span", {
1588
+ className: "comins-sort-meta",
1589
+ "data-sort-visible": l ? "true" : void 0,
1590
+ children: [/* @__PURE__ */ M("span", {
1591
+ "aria-hidden": "true",
1592
+ className: "comins-sort-indicator",
1593
+ "data-sort-state": c,
1594
+ "data-sort-visible": l ? "true" : void 0,
1595
+ "data-testid": `sort-indicator-${n.id}`,
1596
+ children: /* @__PURE__ */ M("span", { className: "comins-sort-icon" })
1597
+ }), u ? /* @__PURE__ */ M("span", {
1598
+ "aria-hidden": "true",
1599
+ className: "comins-sort-priority",
1600
+ "data-testid": `sort-priority-${n.id}`,
1601
+ children: s.priority
1602
+ }) : null]
1597
1603
  }),
1604
+ u ? /* @__PURE__ */ M("span", {
1605
+ className: "comins-table__sort-status",
1606
+ children: `Sorted ${s.rule.direction === "asc" ? "ascending" : "descending"}, priority ${s.priority} of ${Y.sortModel.length}`
1607
+ }) : null,
1598
1608
  /* @__PURE__ */ M("span", {
1599
1609
  className: "comins-table__header-slot",
1600
1610
  "data-comins-header-slot": "right",
1601
- children: h
1611
+ children: _
1602
1612
  })
1603
1613
  ]
1604
1614
  }), /* @__PURE__ */ M("span", {
1605
1615
  "aria-hidden": "true",
1606
1616
  className: "comins-table__resize",
1607
- "data-resizing": Gt === n.id ? "true" : void 0,
1617
+ "data-resizing": Zt === n.id ? "true" : void 0,
1608
1618
  "data-testid": `resize-${n.id}`,
1609
1619
  onClick: (e) => e.stopPropagation(),
1610
1620
  onPointerDown: (e) => {
1611
1621
  e.preventDefault(), e.stopPropagation();
1612
1622
  let t = e.clientX, r = e.currentTarget.closest("th")?.getBoundingClientRect().width, i = /* @__PURE__ */ new Map();
1613
1623
  for (let e of Q) {
1614
- let t = Array.from(H.current?.querySelectorAll("[data-comins-column-id]") ?? []).find((t) => t.dataset.cominsColumnId === e.id)?.getBoundingClientRect().width, n = X.current.columnState[e.id]?.width ?? e.width ?? 160;
1624
+ let t = Array.from(V.current?.querySelectorAll("[data-comins-column-id]") ?? []).find((t) => t.dataset.cominsColumnId === e.id)?.getBoundingClientRect().width, n = X.current.columnState[e.id]?.width ?? e.width ?? 160;
1615
1625
  i.set(e.id, t && Number.isFinite(t) ? t : n);
1616
1626
  }
1617
1627
  let o = i.get(n.id) ?? (r && Number.isFinite(r) ? r : a?.width ?? n.width ?? 160);
1618
- Kt(n.id);
1628
+ Qt(n.id);
1619
1629
  let s = (e) => {
1620
1630
  Z((r) => {
1621
1631
  let a = r;
1622
- for (let [e, t] of i) a = he(a, e, t);
1623
- return jt(a, n.id, Math.max(Dt(n), o + e.clientX - t));
1632
+ for (let [e, t] of i) a = D(a, e, t);
1633
+ return xt(a, n.id, Math.max(_t(n), o + e.clientX - t));
1624
1634
  }, { columnLayoutChanged: !0 });
1625
1635
  }, c = () => {
1626
- Kt(null), window.removeEventListener("pointermove", s), window.removeEventListener("pointerup", c);
1636
+ window.removeEventListener("pointermove", s), window.removeEventListener("pointerup", l), window.removeEventListener("pointercancel", u), window.removeEventListener("blur", u), U.current === c && (U.current = null);
1637
+ }, l = () => {
1638
+ c(), Qt(null);
1639
+ }, u = () => {
1640
+ c(), Qt(null);
1627
1641
  };
1628
- window.addEventListener("pointermove", s), window.addEventListener("pointerup", c);
1642
+ dn(c), window.addEventListener("pointermove", s), window.addEventListener("pointerup", l), window.addEventListener("pointercancel", u), window.addEventListener("blur", u);
1629
1643
  },
1630
1644
  children: /* @__PURE__ */ M("span", { className: "comins-table__resize-line" })
1631
1645
  }));
1632
- }, or = () => /* @__PURE__ */ M("colgroup", { children: Q.map((e, t) => /* @__PURE__ */ M("col", { style: { width: gn[t] } }, e.id)) }), sr = () => {
1633
- Xt((e) => {
1634
- let t = rt.current;
1646
+ }, mr = () => /* @__PURE__ */ M("colgroup", { children: Q.map((e, t) => /* @__PURE__ */ M("col", { style: { width: wn[t] } }, e.id)) }), hr = () => {
1647
+ nn((e) => {
1648
+ let t = Ct.current;
1635
1649
  return Math.abs(e - t) > .5 ? t : e;
1636
1650
  });
1637
- }, cr = (e) => {
1651
+ }, gr = (e) => {
1638
1652
  if (x) {
1639
- if (!Me || qe.current) return;
1640
- e.scrollHeight - e.scrollTop - e.clientHeight <= nn && rn("scroll");
1653
+ if (!Pe || et.current) return;
1654
+ e.scrollHeight - e.scrollTop - e.clientHeight <= ln && fn("scroll");
1641
1655
  return;
1642
1656
  }
1643
- if (!v || !h || fe || !Ne) return;
1657
+ if (!v || !h || pe || !Fe) return;
1644
1658
  let t = Math.max(0, y);
1645
1659
  if (e.scrollHeight - e.scrollTop - e.clientHeight > t) return;
1646
1660
  let n = X.current.rows.length;
1647
- Qe.current !== n && (Qe.current = n, Ne());
1648
- }, lr = (e) => {
1661
+ pt.current !== n && (pt.current = n, Fe());
1662
+ }, _r = (e) => {
1649
1663
  let t = e.currentTarget;
1650
- rt.current = t.scrollTop, cr(t), G.current !== null && (window.clearTimeout(G.current), G.current = null), it.current === null && (it.current = window.requestAnimationFrame(() => {
1651
- it.current = null, sr();
1664
+ Ct.current = t.scrollTop, gr(t), At.current !== null && (window.clearTimeout(At.current), At.current = null), Mt.current === null && (Mt.current = window.requestAnimationFrame(() => {
1665
+ Mt.current = null, hr();
1652
1666
  }));
1653
1667
  let n = Math.max(0, t.scrollLeft);
1654
- if (H.current) {
1655
- let e = Math.max(0, H.current.scrollWidth - H.current.clientWidth), r = Math.max(0, t.scrollWidth - t.clientWidth);
1656
- n = Math.min(Math.min(e, r), n), Math.abs(t.scrollLeft - n) > .5 && (t.scrollLeft = n), H.current.scrollLeft = n;
1668
+ if (V.current) {
1669
+ let e = Math.max(0, V.current.scrollWidth - V.current.clientWidth), r = Math.max(0, t.scrollWidth - t.clientWidth);
1670
+ n = Math.min(Math.min(e, r), n), Math.abs(t.scrollLeft - n) > .5 && (t.scrollLeft = n), V.current.scrollLeft = n;
1657
1671
  }
1658
- V.current && (V.current.scrollLeft = n);
1672
+ Ge.current && (Ge.current.scrollLeft = n);
1659
1673
  };
1660
1674
  return /* @__PURE__ */ N("div", {
1661
1675
  className: [
1662
1676
  "comins-table comins-typography-base h-full w-full overflow-hidden",
1663
- mn,
1664
- pn.className,
1677
+ Sn,
1678
+ xn.className,
1665
1679
  r
1666
1680
  ].filter(Boolean).join(" "),
1667
- "aria-busy": xn || Sn ? "true" : void 0,
1668
- "data-loading": xn || Sn ? "true" : void 0,
1669
- "data-show-header": jn ? "true" : void 0,
1681
+ "aria-busy": kn || An ? "true" : void 0,
1682
+ "data-loading": kn || An ? "true" : void 0,
1683
+ "data-show-header": zn ? "true" : void 0,
1670
1684
  style: {
1671
- ...pn.style,
1672
- ...L
1685
+ ...xn.style,
1686
+ ...Be
1673
1687
  },
1674
1688
  children: [
1675
- jn ? /* @__PURE__ */ M("div", {
1689
+ zn ? /* @__PURE__ */ M("div", {
1676
1690
  className: "comins-table__header",
1677
- ref: H,
1691
+ ref: V,
1678
1692
  children: /* @__PURE__ */ N("table", {
1679
1693
  className: "comins-table__table comins-table__header-table min-w-full table-fixed",
1680
- style: { width: vn },
1681
- children: [or(), /* @__PURE__ */ M("thead", {
1694
+ style: { width: En },
1695
+ children: [mr(), /* @__PURE__ */ M("thead", {
1682
1696
  className: "comins-table__thead",
1683
- children: on.map((e, t) => /* @__PURE__ */ M("tr", { children: e.map((e, t) => ar(e, t)) }, `header-row-${t}`))
1697
+ children: mn.map((e, t) => /* @__PURE__ */ M("tr", { children: e.map((e, t) => pr(e, t)) }, `header-row-${t}`))
1684
1698
  })]
1685
1699
  })
1686
1700
  }) : null,
1687
1701
  /* @__PURE__ */ N("div", {
1688
1702
  className: "comins-table__body-viewport",
1689
- "data-horizontal-overflow": yn ? "true" : void 0,
1703
+ "data-horizontal-overflow": Dn ? "true" : void 0,
1690
1704
  "data-virtualized": B ? "true" : void 0,
1691
1705
  "data-testid": f,
1692
- onScroll: lr,
1693
- ref: Ve,
1706
+ onScroll: _r,
1707
+ ref: We,
1694
1708
  children: [
1695
1709
  /* @__PURE__ */ N("table", {
1696
1710
  className: ["comins-table__table comins-table__body-table min-w-full table-fixed", B ? "comins-table__body-table--virtualized" : void 0].filter(Boolean).join(" "),
1697
1711
  style: B ? {
1698
- transform: `translate3d(0, ${fn.renderOffset}px, 0)`,
1699
- width: vn
1700
- } : { width: vn },
1701
- children: [or(), /* @__PURE__ */ N("tbody", { children: [
1702
- wn ? Array.from({ length: Dn }).map((e, t) => /* @__PURE__ */ M("tr", {
1712
+ transform: `translate3d(0, ${bn.renderOffset}px, 0)`,
1713
+ width: En
1714
+ } : { width: En },
1715
+ children: [mr(), /* @__PURE__ */ N("tbody", { children: [
1716
+ Mn ? Array.from({ length: Fn }).map((e, t) => /* @__PURE__ */ M("tr", {
1703
1717
  "aria-hidden": "true",
1704
1718
  className: "comins-table__tr comins-table__skeleton-row",
1705
1719
  "data-comins-row-parity": t % 2 == 0 ? "even" : "odd",
1706
1720
  "data-testid": "loading-skeleton-row",
1707
- style: { height: F },
1721
+ style: { height: L },
1708
1722
  children: Q.length > 0 ? Q.map((e) => /* @__PURE__ */ M("td", {
1709
1723
  className: "comins-table__td comins-table__skeleton-cell px-3 py-2",
1710
1724
  "data-testid": `loading-skeleton-cell-${t}-${e.id}`,
1711
- style: { height: F },
1725
+ style: { height: L },
1712
1726
  children: /* @__PURE__ */ M("span", { className: "comins-table__skeleton-block" })
1713
1727
  }, e.id)) : /* @__PURE__ */ M("td", {
1714
1728
  className: "comins-table__td comins-table__skeleton-cell px-3 py-2",
1715
1729
  children: /* @__PURE__ */ M("span", { className: "comins-table__skeleton-block" })
1716
1730
  })
1717
1731
  }, `loading-skeleton-${t}`)) : null,
1718
- Tn ? /* @__PURE__ */ M("tr", {
1732
+ Nn ? /* @__PURE__ */ M("tr", {
1719
1733
  className: "comins-table__tr comins-table__empty-state-row",
1720
- style: { height: F },
1734
+ style: { height: L },
1721
1735
  children: /* @__PURE__ */ M("td", {
1722
1736
  className: "comins-table__td comins-table__empty-state-cell",
1723
1737
  colSpan: Math.max(1, Q.length),
@@ -1728,9 +1742,9 @@ function Ht({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
1728
1742
  })
1729
1743
  })
1730
1744
  }) : null,
1731
- fn.entries.map((e, t) => {
1732
- let r = st(Fe, e.row, e.visibleIndex), i = hn.has(e.rowId), a = An === 0 && t === fn.entries.length - 1, o = ct(r.style), s = B ? `virtual-row-slot-${t}` : String(e.rowId);
1733
- return /* @__PURE__ */ N(Se, { children: [qt?.targetDataIndex === e.dataIndex && qt.sourceRowId !== e.rowId ? /* @__PURE__ */ M("tr", {
1745
+ bn.entries.map((e, t) => {
1746
+ let r = Ze(Le, e.row, e.visibleIndex), i = Cn.has(e.rowId), a = Rn === 0 && t === bn.entries.length - 1, o = Qe(r.style), s = B ? `virtual-row-slot-${t}` : String(e.rowId);
1747
+ return /* @__PURE__ */ N(Ce, { children: [$t?.targetDataIndex === e.dataIndex && $t.sourceRowId !== e.rowId ? /* @__PURE__ */ M("tr", {
1734
1748
  "aria-hidden": "true",
1735
1749
  className: "comins-row-move-placeholder",
1736
1750
  children: /* @__PURE__ */ M("td", {
@@ -1760,48 +1774,48 @@ function Ht({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
1760
1774
  t.preventDefault();
1761
1775
  return;
1762
1776
  }
1763
- t.__cominsCellSelectionHandled || qn(t, e), Ce?.(ft(t, e));
1777
+ t.__cominsCellSelectionHandled || tr(t, e), Oe?.(nt(t, e));
1764
1778
  },
1765
1779
  onContextMenu: (t) => {
1766
1780
  if (r.disabled) {
1767
1781
  t.preventDefault();
1768
1782
  return;
1769
1783
  }
1770
- Z((t) => D(t, e.rowId)), W.current = e.rowId, Ee?.(ft(t, e));
1784
+ Z((t) => E(t, e.rowId)), K.current = e.rowId, F?.(nt(t, e));
1771
1785
  },
1772
1786
  onDoubleClick: (t) => {
1773
1787
  if (r.disabled) {
1774
1788
  t.preventDefault();
1775
1789
  return;
1776
1790
  }
1777
- ke?.(ft(t, e));
1791
+ je?.(nt(t, e));
1778
1792
  },
1779
- onKeyDown: (t) => Jn(t, e, r.disabled),
1780
- style: lt(F, r.style, o),
1793
+ onKeyDown: (t) => nr(t, e, r.disabled),
1794
+ style: $e(L, r.style, o),
1781
1795
  tabIndex: r.disabled ? -1 : 0,
1782
1796
  children: Q.map((t, a) => {
1783
1797
  let o = g(Y, e.row, t.id), s = {
1784
1798
  columnId: t.id,
1785
1799
  rowId: e.rowId
1786
- }, c = n && te(Y, s), l = n && Y.selection.cell?.rowId === e.rowId && Y.selection.cell.columnId === t.id, u = mt(e, r.disabled, i, Y.selection.rowIds.length, t, a, o), d = ht(t, u), f = r.disabled || _t(d, u), p = { requestRowSelection: ({ event: t, mode: n }) => f ? !1 : n === "exclusive" ? (Z((t) => D(t, e.rowId)), W.current = e.rowId, !0) : (qn(t, e), !0) }, m = ot(vt(d, u)), h = yt(d, u), _ = !!t.cell?.components?.length, v = bt(t, o, u), y = t.cell?.components?.map((e) => {
1800
+ }, c = n && C(Y, s), l = n && Y.selection.cell?.rowId === e.rowId && Y.selection.cell.columnId === t.id, u = at(e, r.disabled, i, Y.selection.rowIds.length, t, a, o), d = ot(t, u), f = r.disabled || ct(d, u), p = { requestRowSelection: ({ event: t, mode: n }) => f ? !1 : n === "exclusive" ? (Z((t) => E(t, e.rowId)), K.current = e.rowId, !0) : (tr(t, e), !0) }, m = Xe(lt(d, u)), h = ut(d, u), _ = !!t.cell?.components?.length, v = dt(t, o, u), y = t.cell?.components?.map((e) => {
1787
1801
  if (e.type !== "input") return e;
1788
1802
  let t = e.onValueChange;
1789
1803
  return {
1790
1804
  ...e,
1791
1805
  onValueChange: (e) => {
1792
- Z((t) => xe(t, [{
1806
+ Z((t) => Se(t, [{
1793
1807
  id: e.row.id,
1794
- patch: (t) => Mt(t, e.column.field, e.value)
1808
+ patch: (t) => St(t, e.column.field, e.value)
1795
1809
  }])), t?.(e);
1796
1810
  }
1797
1811
  };
1798
- }), b = wt(y, u), x = t.cell?.renderer ? t.cell.renderer(u) : _ ? Et(v, y, u, {
1812
+ }), b = mt(y, u), x = t.cell?.renderer ? t.cell.renderer(u) : _ ? gt(v, y, u, {
1799
1813
  interaction: p,
1800
1814
  showContent: !1
1801
1815
  }) : /* @__PURE__ */ M("span", {
1802
1816
  className: "comins-table__cell-value",
1803
1817
  children: v
1804
- }), ee = typeof t.cell?.tooltip == "function" ? t.cell.tooltip(u) : t.cell?.tooltip, S = a === 0 ? z?.entriesByRowId.get(e.rowId) : void 0, C = S ? /* @__PURE__ */ N("span", {
1818
+ }), ee = typeof t.cell?.tooltip == "function" ? t.cell.tooltip(u) : t.cell?.tooltip, S = a === 0 ? z?.entriesByRowId.get(e.rowId) : void 0, w = S ? /* @__PURE__ */ N("span", {
1805
1819
  className: "comins-tree-cell-content",
1806
1820
  style: { "--comins-tree-depth": S.depth },
1807
1821
  children: [S.hasChildren ? /* @__PURE__ */ M("button", {
@@ -1841,29 +1855,29 @@ function Ht({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
1841
1855
  "data-testid": `cell-${String(e.rowId)}-${t.id}`,
1842
1856
  draggable: !1,
1843
1857
  onClick: (r) => {
1844
- if (be && r.stopPropagation(), f) {
1858
+ if (Ee && r.stopPropagation(), f) {
1845
1859
  r.preventDefault(), r.stopPropagation();
1846
1860
  return;
1847
1861
  }
1848
- if (tt.current) {
1849
- tt.current = !1, r.__cominsCellSelectionHandled = !0;
1862
+ if (q.current) {
1863
+ q.current = !1, r.__cominsCellSelectionHandled = !0;
1850
1864
  return;
1851
1865
  }
1852
- let i = n ? Y.selection.cell ?? Ge.current : null;
1866
+ let i = n ? Y.selection.cell ?? Je.current : null;
1853
1867
  if (r.shiftKey && i) {
1854
- r.__cominsCellSelectionHandled = !0, Ge.current = i, Z((t) => le(W.current === null ? D(t, e.rowId) : ue(t, Pn(t, W.current, e.rowId)), {
1868
+ r.__cominsCellSelectionHandled = !0, Je.current = i, Z((t) => ue(K.current === null ? E(t, e.rowId) : de(t, Hn(t, K.current, e.rowId)), {
1855
1869
  anchor: i,
1856
1870
  focus: s
1857
- })), W.current = e.rowId;
1871
+ })), K.current = e.rowId;
1858
1872
  return;
1859
1873
  }
1860
- n && (Ge.current = s), Z((t) => {
1861
- let i = D(t, e.rowId, {
1874
+ n && (Je.current = s), Z((t) => {
1875
+ let i = E(t, e.rowId, {
1862
1876
  multi: r.ctrlKey || r.metaKey,
1863
1877
  toggle: r.ctrlKey || r.metaKey
1864
1878
  });
1865
- return n ? ce(i, s) : i;
1866
- }), r.__cominsCellSelectionHandled = !0, W.current = e.rowId, be?.(pt(r, e, t, a, o));
1879
+ return n ? le(i, s) : i;
1880
+ }), r.__cominsCellSelectionHandled = !0, K.current = e.rowId, Ee?.(rt(r, e, t, a, o));
1867
1881
  },
1868
1882
  onContextMenu: (r) => {
1869
1883
  if (f) {
@@ -1871,29 +1885,33 @@ function Ht({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
1871
1885
  return;
1872
1886
  }
1873
1887
  Z((t) => {
1874
- let r = D(t, e.rowId);
1875
- return n ? ce(r, s) : r;
1876
- }), W.current = e.rowId, n && (Ge.current = s), Te && (r.stopPropagation(), Te(pt(r, e, t, a, o)));
1888
+ let r = E(t, e.rowId);
1889
+ return n ? le(r, s) : r;
1890
+ }), K.current = e.rowId, n && (Je.current = s), P && (r.stopPropagation(), P(rt(r, e, t, a, o)));
1877
1891
  },
1878
1892
  onDoubleClick: (n) => {
1879
- if (De && n.stopPropagation(), f) {
1893
+ if (Ae && n.stopPropagation(), f) {
1880
1894
  n.preventDefault(), n.stopPropagation();
1881
1895
  return;
1882
1896
  }
1883
- De?.(pt(n, e, t, a, o));
1897
+ Ae?.(rt(n, e, t, a, o));
1898
+ },
1899
+ onKeyDown: (n) => rr(n, e, t, a, s, f),
1900
+ onMouseDown: (e) => ir(e, s, f),
1901
+ onMouseOver: (e) => {
1902
+ e.buttons === 1 && !U.current && or(s);
1903
+ },
1904
+ onMouseUp: sr,
1905
+ onPointerDown: (e) => cr(e, s, f),
1906
+ onPointerEnter: (e) => {
1907
+ e.buttons === 1 && or(s);
1884
1908
  },
1885
- onKeyDown: (n) => Yn(n, e, t, a, s, f),
1886
- onMouseDown: (e) => Xn(e, s, f),
1887
- onMouseOver: () => Qn(s),
1888
- onMouseUp: $n,
1889
- onPointerDown: (e) => er(e, s, f),
1890
- onPointerEnter: () => Qn(s),
1891
1909
  onPointerMove: (e) => {
1892
- e.buttons === 1 && Qn(s);
1910
+ e.buttons === 1 && or(s);
1893
1911
  },
1894
- onPointerUp: $n,
1912
+ onPointerUp: sr,
1895
1913
  style: {
1896
- height: F,
1914
+ height: L,
1897
1915
  ...h
1898
1916
  },
1899
1917
  title: typeof ee == "string" ? ee : void 0,
@@ -1905,15 +1923,15 @@ function Ht({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
1905
1923
  draggable: !1,
1906
1924
  onClick: (e) => e.stopPropagation(),
1907
1925
  onMouseDown: (e) => e.stopPropagation(),
1908
- onPointerDown: (t) => tr(t, e, r.disabled, r.draggable)
1909
- }) : null, C]
1926
+ onPointerDown: (t) => lr(t, e, r.disabled, r.draggable)
1927
+ }) : null, w]
1910
1928
  }, t.id);
1911
1929
  })
1912
1930
  }, s)] }, s);
1913
1931
  }),
1914
- En ? /* @__PURE__ */ M("tr", {
1932
+ Pn ? /* @__PURE__ */ M("tr", {
1915
1933
  className: "comins-table__tr comins-table__infinite-loading-row",
1916
- style: { height: F },
1934
+ style: { height: L },
1917
1935
  children: /* @__PURE__ */ N("td", {
1918
1936
  className: "comins-table__td comins-table__infinite-loading-cell",
1919
1937
  colSpan: Math.max(1, Q.length),
@@ -1924,13 +1942,13 @@ function Ht({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
1924
1942
  }), /* @__PURE__ */ M("span", { children: "데이터를 불러오는 중입니다." })]
1925
1943
  })
1926
1944
  }) : null,
1927
- An > 0 ? /* @__PURE__ */ M("tr", {
1945
+ Rn > 0 ? /* @__PURE__ */ M("tr", {
1928
1946
  "aria-hidden": "true",
1929
1947
  className: "comins-table-empty-filler",
1930
1948
  children: /* @__PURE__ */ M("td", {
1931
1949
  colSpan: Math.max(1, Q.length),
1932
1950
  "data-testid": "table-empty-filler",
1933
- style: { height: An }
1951
+ style: { height: Rn }
1934
1952
  })
1935
1953
  }) : null
1936
1954
  ] })]
@@ -1939,33 +1957,33 @@ function Ht({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
1939
1957
  "aria-hidden": "true",
1940
1958
  className: "comins-table__body-virtual-sizer",
1941
1959
  style: {
1942
- height: fn.scrollHeight,
1943
- width: vn
1960
+ height: bn.scrollHeight,
1961
+ width: En
1944
1962
  }
1945
1963
  }) : null,
1946
- xn && !Cn ? /* @__PURE__ */ N("div", {
1964
+ kn && !jn ? /* @__PURE__ */ N("div", {
1947
1965
  className: "comins-table__loading-overlay",
1948
1966
  "data-testid": "data-table-loading-overlay",
1949
1967
  role: "status",
1950
- style: Yt > 0 ? { transform: `translateY(${Yt}px)` } : void 0,
1968
+ style: tn > 0 ? { transform: `translateY(${tn}px)` } : void 0,
1951
1969
  children: [/* @__PURE__ */ M("span", {
1952
1970
  className: "comins-table__loading-spinner",
1953
1971
  "data-testid": "data-table-loading-spinner"
1954
- }), /* @__PURE__ */ M("span", { children: se ?? "불러오는 중입니다." })]
1972
+ }), /* @__PURE__ */ M("span", { children: ce ?? "불러오는 중입니다." })]
1955
1973
  }) : null
1956
1974
  ]
1957
1975
  }),
1958
1976
  R ? /* @__PURE__ */ M("div", {
1959
1977
  "aria-label": "Table summary",
1960
1978
  className: "comins-table__summary",
1961
- ref: V,
1979
+ ref: Ge,
1962
1980
  children: /* @__PURE__ */ N("table", {
1963
1981
  className: "comins-table__table comins-table__summary-table min-w-full table-fixed",
1964
- style: { width: vn },
1965
- children: [or(), /* @__PURE__ */ M("tfoot", { children: /* @__PURE__ */ M("tr", {
1982
+ style: { width: En },
1983
+ children: [mr(), /* @__PURE__ */ M("tfoot", { children: /* @__PURE__ */ M("tr", {
1966
1984
  className: ["comins-table__summary-row", R.className].filter(Boolean).join(" "),
1967
1985
  style: R.style,
1968
- children: cn.map((e) => /* @__PURE__ */ M("td", {
1986
+ children: gn.map((e) => /* @__PURE__ */ M("td", {
1969
1987
  className: ["comins-table__summary-cell px-3 py-2", e.className].filter(Boolean).join(" "),
1970
1988
  colSpan: e.colSpan,
1971
1989
  "data-testid": `summary-cell-${e.column.id}`,
@@ -1975,56 +1993,56 @@ function Ht({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
1975
1993
  }) })]
1976
1994
  })
1977
1995
  }) : null,
1978
- ir && kt ? /* @__PURE__ */ M("div", {
1996
+ fr && Vt ? /* @__PURE__ */ M("div", {
1979
1997
  "aria-hidden": "true",
1980
1998
  className: "comins-column-move-ghost",
1981
1999
  "data-testid": "column-move-ghost",
1982
2000
  style: {
1983
- left: kt.x + 12,
1984
- top: kt.y + 12
2001
+ left: Vt.x + 12,
2002
+ top: Vt.y + 12
1985
2003
  },
1986
- children: ir
2004
+ children: fr
1987
2005
  }) : null
1988
2006
  ]
1989
2007
  });
1990
2008
  }
1991
- function Ut({ data: e, defaultExpandAll: t = !0, getRowId: n, hasMoreRows: r, infiniteScroll: i, infiniteScrollThreshold: a, lazyLoad: o, lazyLoadBatchSize: s, lazyLoadMode: c, lazyLoadThreshold: l, loadingMore: u, onChangeData: d, onChangeSort: f, onLazyLoad: p, onLoadMore: m, rowProps: h, tree: g, ..._ }, v) {
1992
- let y = A(t).current, [b, x] = j(null), ee = k(() => Bt(e, _.columns, b), [
2009
+ function It({ data: e, defaultExpandAll: t = !0, getRowId: n, hasMoreRows: r, infiniteScroll: i, infiniteScrollThreshold: a, lazyLoad: o, lazyLoadBatchSize: s, lazyLoadMode: c, lazyLoadThreshold: l, loadingMore: u, onChangeData: d, onChangeSort: f, onChangeSortModel: p, onLazyLoad: m, onLoadMore: h, rowProps: g, tree: _, ...v }, y) {
2010
+ let b = A(t).current, [x, ee] = j([]), S = k(() => Nt(e, v.columns, x), [
1993
2011
  e,
1994
- _.columns,
1995
- b
1996
- ]), S = k(() => et(ee, n, { defaultExpandAll: y }), [
2012
+ v.columns,
2013
+ x
2014
+ ]), C = k(() => Ke(S, n, { defaultExpandAll: b }), [
1997
2015
  n,
1998
- y,
1999
- ee
2000
- ]), te = k(() => new Map(S.map((e) => [e.rowId, e])), [S]), C = k(() => ({
2001
- entriesByRowId: te,
2016
+ b,
2017
+ S
2018
+ ]), w = k(() => new Map(C.map((e) => [e.rowId, e])), [C]), te = k(() => ({
2019
+ entriesByRowId: w,
2002
2020
  onExpand: (t) => {
2003
- let r = Vt(e, t, !0, n, y);
2021
+ let r = Pt(e, t, !0, n, b);
2004
2022
  r !== e && d?.([...r]);
2005
2023
  },
2006
2024
  onFold: (t) => {
2007
- let r = Vt(e, t, !1, n, y);
2025
+ let r = Pt(e, t, !1, n, b);
2008
2026
  r !== e && d?.([...r]);
2009
2027
  },
2010
- onToggle: (t) => d?.(nt(e, t, n, { defaultExpandAll: y })),
2011
- summaryRows: tt(e)
2028
+ onToggle: (t) => d?.(qe(e, t, n, { defaultExpandAll: b })),
2029
+ summaryRows: H(e)
2012
2030
  }), [
2013
2031
  e,
2014
- te,
2032
+ w,
2015
2033
  n,
2016
- y,
2034
+ b,
2017
2035
  d
2018
2036
  ]), ne = (t) => {
2019
2037
  let r = e;
2020
2038
  t.forEach((e, t) => {
2021
- let i = S[t];
2022
- i && i.item !== e && (r = rt(r, i.rowId, n, () => e));
2039
+ let i = C[t];
2040
+ i && i.item !== e && (r = U(r, i.rowId, n, () => e));
2023
2041
  }), r !== e && d?.([...r]);
2024
2042
  };
2025
- return /* @__PURE__ */ M(Wt, {
2026
- ..._,
2027
- data: S.map((e) => e.item),
2043
+ return /* @__PURE__ */ M(Lt, {
2044
+ ...v,
2045
+ data: C.map((e) => e.item),
2028
2046
  getRowId: n,
2029
2047
  hasMoreRows: !1,
2030
2048
  infiniteScroll: !1,
@@ -2035,36 +2053,37 @@ function Ut({ data: e, defaultExpandAll: t = !0, getRowId: n, hasMoreRows: r, in
2035
2053
  lazyLoadThreshold: void 0,
2036
2054
  loadingMore: !1,
2037
2055
  onChangeData: ne,
2038
- onChangeSort: (e) => {
2039
- x(e), f?.(e);
2056
+ onChangeSort: f,
2057
+ onChangeSortModel: (e) => {
2058
+ ee(e), p?.(e);
2040
2059
  },
2041
2060
  onLazyLoad: void 0,
2042
2061
  onLoadMore: void 0,
2043
2062
  pagination: {
2044
2063
  pageIndex: 0,
2045
- pageSize: Math.max(1, S.length)
2064
+ pageSize: Math.max(1, C.length)
2046
2065
  },
2047
2066
  rowProps: {
2048
- ...h,
2067
+ ...g,
2049
2068
  draggable: !1
2050
2069
  },
2051
2070
  tree: !1,
2052
- ref: v,
2053
- treeContext: C
2071
+ ref: y,
2072
+ treeContext: te
2054
2073
  });
2055
2074
  }
2056
- var Wt = Te(Ht), Gt = Te(Ut);
2057
- function Kt(e, t) {
2058
- return e.tree ? /* @__PURE__ */ M(Gt, {
2075
+ var Lt = Te(Ft), Rt = Te(It);
2076
+ function zt(e, t) {
2077
+ return e.tree ? /* @__PURE__ */ M(Rt, {
2059
2078
  ...e,
2060
2079
  ref: t
2061
- }) : /* @__PURE__ */ M(Wt, {
2080
+ }) : /* @__PURE__ */ M(Lt, {
2062
2081
  ...e,
2063
2082
  ref: t
2064
2083
  });
2065
2084
  }
2066
- var qt = Te(Kt), Jt = "comins-table";
2085
+ var Bt = Te(zt), Vt = "comins-table";
2067
2086
  //#endregion
2068
- export { qt as CominsTable, e as addCominsRows, t as applyCominsColumnLayout, n as clearCominsCellRange, r as clearCominsSelection, i as clearCominsSortState, Jt as cominsTablePackage, a as copyCominsCell, o as copyCominsCellRange, s as copyCominsRow, c as createCominsTableState, l as deleteCominsRows, u as exportCominsRowsToCsv, d as exportCominsRowsToJson, f as fillCominsCellRange, et as flattenCominsTree, p as formatCominsCellValue, m as getCominsCellClassName, h as getCominsCellStyle, g as getCominsCellValue, _ as getCominsHeaderRows, v as getCominsPageRows, y as getCominsSelectedCellRange, b as getCominsSortedRowIndexes, Ze as getCominsSummaryValues, tt as getCominsTreeLeafItems, x as getCominsVirtualRows, ee as getCominsVisibleColumns, S as isCominsCellDisabled, te as isCominsCellInSelectedRange, C as isCominsCellSelected, ne as isCominsRowSelected, re as moveCominsColumn, w as moveCominsColumnGroup, T as moveCominsRow, ie as pasteCominsCell, E as pasteCominsCellRange, ae as pasteCominsRow, oe as queryCominsRows, se as replaceCominsRows, ce as selectCell, le as selectCellRange, D as selectRow, ue as selectRows, de as serializeCominsColumnLayout, fe as setCominsColumnGroupHidden, pe as setCominsColumnGroupWidth, me as setCominsColumnHidden, he as setCominsColumnWidth, ge as setCominsHeaderVisible, _e as setCominsPagination, ve as setCominsSortState, ye as setCominsTableTheme, be as sortCominsRows, G as sortCominsTreeSiblings, nt as toggleCominsTreeNode, xe as updateCominsRows, rt as updateCominsTreeItem };
2087
+ export { Bt as CominsTable, e as addCominsRows, t as applyCominsColumnLayout, n as clearCominsCellRange, r as clearCominsSelection, i as clearCominsSortState, Vt as cominsTablePackage, a as copyCominsCell, o as copyCominsCellRange, s as copyCominsRow, c as createCominsTableState, l as deleteCominsRows, u as exportCominsRowsToCsv, d as exportCominsRowsToJson, f as fillCominsCellRange, Ke as flattenCominsTree, p as formatCominsCellValue, m as getCominsCellClassName, h as getCominsCellStyle, g as getCominsCellValue, _ as getCominsHeaderRows, v as getCominsPageRows, y as getCominsSelectedCellRange, b as getCominsSortedRowIndexes, Ue as getCominsSummaryValues, H as getCominsTreeLeafItems, x as getCominsVirtualRows, ee as getCominsVisibleColumns, S as isCominsCellDisabled, C as isCominsCellInSelectedRange, w as isCominsCellSelected, te as isCominsRowSelected, ne as moveCominsColumn, re as moveCominsColumnGroup, ie as moveCominsRow, ae as pasteCominsCell, T as pasteCominsCellRange, oe as pasteCominsRow, se as queryCominsRows, ce as replaceCominsRows, le as selectCell, ue as selectCellRange, E as selectRow, de as selectRows, fe as serializeCominsColumnLayout, pe as setCominsColumnGroupHidden, me as setCominsColumnGroupWidth, he as setCominsColumnHidden, D as setCominsColumnWidth, ge as setCominsHeaderVisible, _e as setCominsPagination, ve as setCominsSortModel, ye as setCominsSortState, be as setCominsTableTheme, xe as sortCominsRows, W as sortCominsTreeSiblings, qe as toggleCominsTreeNode, Se as updateCominsRows, U as updateCominsTreeItem };
2069
2088
 
2070
2089
  //# sourceMappingURL=index.js.map