comins-table 0.1.4 → 0.1.6
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/CHANGELOG.md +21 -0
- package/README.md +28 -6
- package/THIRD_PARTY_NOTICES.md +123 -0
- package/dist/core.d.ts +2 -0
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +135 -90
- package/dist/core.js.map +1 -1
- package/dist/index.d.ts +23 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1732 -925
- package/dist/index.js.map +1 -1
- package/dist/row-detail.d.ts +23 -0
- package/dist/row-detail.d.ts.map +1 -0
- package/dist/table-icons.d.ts +15 -0
- package/dist/table-icons.d.ts.map +1 -0
- package/dist/virtual-layout.d.ts +109 -0
- package/dist/virtual-layout.d.ts.map +1 -0
- package/package.json +12 -9
- package/styles.css +240 -50
package/dist/index.js
CHANGED
|
@@ -1,92 +1,49 @@
|
|
|
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
|
|
2
|
-
import
|
|
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 ee, getCominsVisibleColumns as te, isCominsCellDisabled as ne, isCominsCellInSelectedRange as re, isCominsCellSelected as ie, isCominsRowSelected as x, moveCominsColumn as S, moveCominsColumnGroup as C, moveCominsRow as w, pasteCominsCell as ae, pasteCominsCellRange as T, pasteCominsRow as oe, queryCominsRows as se, replaceCominsRows as ce, selectCell as le, selectCellRange as ue, selectRow as de, selectRows as fe, serializeCominsColumnLayout as pe, setCominsColumnGroupHidden as me, setCominsColumnGroupWidth as he, setCominsColumnHidden as ge, setCominsColumnWidth as _e, setCominsHeaderVisible as ve, setCominsPagination as ye, setCominsSortModel as be, setCominsSortState as xe, setCominsTableTheme as Se, sortCominsRows as Ce, updateCominsRows as we } from "./core.js";
|
|
2
|
+
import * as Te from "react";
|
|
3
|
+
import { Fragment as Ee, createElement as De, forwardRef as Oe, isValidElement as ke, useEffect as E, useId as Ae, useImperativeHandle as je, useLayoutEffect as Me, useMemo as D, useRef as O, useState as k } from "react";
|
|
3
4
|
import { jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
let t = Fe(e);
|
|
7
|
-
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
8
|
-
}, M = {
|
|
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
|
-
}, Le = (e) => {
|
|
19
|
-
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
20
|
-
return !1;
|
|
21
|
-
}, Re = Ee({}), ze = () => ke(Re), N = Oe(({ 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 = "" } = ze() ?? {}, m = r ?? d ? Number(n ?? u) * 24 / Number(t ?? l) : n ?? u;
|
|
23
|
-
return De("svg", {
|
|
24
|
-
ref: c,
|
|
25
|
-
...M,
|
|
26
|
-
width: t ?? l ?? M.width,
|
|
27
|
-
height: t ?? l ?? M.height,
|
|
28
|
-
stroke: e ?? f,
|
|
29
|
-
strokeWidth: m,
|
|
30
|
-
className: Ne("lucide", p, i),
|
|
31
|
-
...!a && !Le(s) && { "aria-hidden": "true" },
|
|
32
|
-
...s
|
|
33
|
-
}, [...o.map(([e, t]) => De(e, t)), ...Array.isArray(a) ? a : [a]]);
|
|
34
|
-
}), Be = ((e, t) => {
|
|
35
|
-
let n = Oe(({ className: n, ...r }, i) => De(N, {
|
|
36
|
-
ref: i,
|
|
37
|
-
iconNode: t,
|
|
38
|
-
className: Ne(`lucide-${Pe(Ie(e))}`, `lucide-${e}`, n),
|
|
39
|
-
...r
|
|
40
|
-
}));
|
|
41
|
-
return n.displayName = Ie(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 Ve({ clientX: e, clientY: t, startX: n, startY: r }) {
|
|
5
|
+
import { CaretSortIcon as Ne, ChevronRightIcon as Pe, DragHandleDots2Icon as Fe, ThickArrowDownIcon as Ie, ThickArrowUpIcon as Le } from "@radix-ui/react-icons";
|
|
6
|
+
function Re({ clientX: e, clientY: t, startX: n, startY: r }) {
|
|
50
7
|
let i = Math.abs(e - n), a = Math.abs(t - r);
|
|
51
8
|
return i >= 6 && i > a ? "activate" : a >= 6 && a >= i ? "cancel" : "pending";
|
|
52
9
|
}
|
|
53
10
|
//#endregion
|
|
54
11
|
//#region src/component-renderer.tsx
|
|
55
|
-
function
|
|
12
|
+
function M(...e) {
|
|
56
13
|
return e.filter(Boolean).join(" ");
|
|
57
14
|
}
|
|
58
|
-
function
|
|
15
|
+
function N(e, t) {
|
|
59
16
|
return typeof e == "function" ? e(t) : e ?? {};
|
|
60
17
|
}
|
|
61
|
-
function
|
|
18
|
+
function ze(e, t) {
|
|
62
19
|
return typeof e == "function" ? e(t) : e;
|
|
63
20
|
}
|
|
64
|
-
function
|
|
21
|
+
function Be(e, t) {
|
|
65
22
|
return typeof e == "function" ? e(t) : e;
|
|
66
23
|
}
|
|
67
|
-
function
|
|
24
|
+
function Ve(e, t) {
|
|
68
25
|
return typeof e == "function" ? e(t) : e;
|
|
69
26
|
}
|
|
70
|
-
function
|
|
71
|
-
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : Array.isArray(e) ? e.map(
|
|
27
|
+
function He(e) {
|
|
28
|
+
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : Array.isArray(e) ? e.map(He).join(" ") : "";
|
|
72
29
|
}
|
|
73
|
-
function
|
|
30
|
+
function Ue(e) {
|
|
74
31
|
return e.type !== "divider" && e.type !== "label";
|
|
75
32
|
}
|
|
76
|
-
function
|
|
33
|
+
function We(e, t) {
|
|
77
34
|
return !!(e && t instanceof Node && e.contains(t));
|
|
78
35
|
}
|
|
79
|
-
function
|
|
36
|
+
function P(e) {
|
|
80
37
|
e.stopPropagation();
|
|
81
38
|
}
|
|
82
|
-
function
|
|
39
|
+
function F(e) {
|
|
83
40
|
e.preventDefault(), e.stopPropagation();
|
|
84
41
|
}
|
|
85
42
|
function Ge(e) {
|
|
86
43
|
return e == null ? "" : String(e);
|
|
87
44
|
}
|
|
88
|
-
function
|
|
89
|
-
let n =
|
|
45
|
+
function Ke({ component: e, payload: t }) {
|
|
46
|
+
let n = N(e.props, t), { defaultValue: r, onBlur: i, onChange: a, onClick: o, onKeyDown: s, onMouseDown: c, onPointerDown: l, value: u, ...d } = n, f = Ge(u ?? r), [p, m] = k(f), h = O(f);
|
|
90
47
|
E(() => {
|
|
91
48
|
m(f), h.current = f;
|
|
92
49
|
}, [f]);
|
|
@@ -102,53 +59,53 @@ function V({ component: e, payload: t }) {
|
|
|
102
59
|
};
|
|
103
60
|
return /* @__PURE__ */ A("input", {
|
|
104
61
|
...d,
|
|
105
|
-
className:
|
|
62
|
+
className: M("comins-table__component", "comins-table__component-input", n.className),
|
|
106
63
|
onBlur: (e) => {
|
|
107
|
-
i?.(e),
|
|
64
|
+
i?.(e), P(e), g(e);
|
|
108
65
|
},
|
|
109
66
|
onChange: (e) => {
|
|
110
|
-
|
|
67
|
+
P(e), m(e.currentTarget.value);
|
|
111
68
|
},
|
|
112
69
|
onClick: (e) => {
|
|
113
|
-
o?.(e),
|
|
70
|
+
o?.(e), P(e);
|
|
114
71
|
},
|
|
115
72
|
onKeyDown: (e) => {
|
|
116
|
-
s?.(e),
|
|
73
|
+
s?.(e), P(e), e.key === "Enter" && (e.preventDefault(), g(e), e.currentTarget.blur());
|
|
117
74
|
},
|
|
118
75
|
onMouseDown: (e) => {
|
|
119
|
-
c?.(e),
|
|
76
|
+
c?.(e), P(e);
|
|
120
77
|
},
|
|
121
78
|
onPointerDown: (e) => {
|
|
122
|
-
l?.(e),
|
|
79
|
+
l?.(e), P(e);
|
|
123
80
|
},
|
|
124
81
|
value: p
|
|
125
82
|
});
|
|
126
83
|
}
|
|
127
|
-
function
|
|
128
|
-
let n =
|
|
84
|
+
function qe({ component: e, payload: t }) {
|
|
85
|
+
let n = N(e.props, t), { checked: r, defaultChecked: i, onChange: a, onClick: o, onKeyDown: s, onMouseDown: c, onPointerDown: l, style: u, ...d } = n, [f, p] = k(!!(r ?? i));
|
|
129
86
|
return E(() => {
|
|
130
87
|
r !== void 0 && p(!!r);
|
|
131
88
|
}, [r]), /* @__PURE__ */ A("input", {
|
|
132
89
|
...d,
|
|
133
90
|
checked: f,
|
|
134
|
-
className:
|
|
91
|
+
className: M("comins-table__component", "comins-table__component-checkbox", n.className),
|
|
135
92
|
onClick: (e) => {
|
|
136
|
-
o?.(e),
|
|
93
|
+
o?.(e), P(e);
|
|
137
94
|
},
|
|
138
95
|
onChange: (n) => {
|
|
139
|
-
a?.(n),
|
|
96
|
+
a?.(n), P(n), p(n.currentTarget.checked), e.onCheckedChange?.({
|
|
140
97
|
...t,
|
|
141
98
|
checked: n.currentTarget.checked
|
|
142
99
|
});
|
|
143
100
|
},
|
|
144
101
|
onKeyDown: (e) => {
|
|
145
|
-
s?.(e),
|
|
102
|
+
s?.(e), P(e);
|
|
146
103
|
},
|
|
147
104
|
onMouseDown: (e) => {
|
|
148
|
-
c?.(e),
|
|
105
|
+
c?.(e), P(e);
|
|
149
106
|
},
|
|
150
107
|
onPointerDown: (e) => {
|
|
151
|
-
l?.(e),
|
|
108
|
+
l?.(e), P(e);
|
|
152
109
|
},
|
|
153
110
|
style: {
|
|
154
111
|
height: 20,
|
|
@@ -158,8 +115,8 @@ function Ke({ component: e, payload: t }) {
|
|
|
158
115
|
type: "checkbox"
|
|
159
116
|
});
|
|
160
117
|
}
|
|
161
|
-
function
|
|
162
|
-
let { checked: n, ...r } =
|
|
118
|
+
function Je({ component: e, payload: t }) {
|
|
119
|
+
let { checked: n, ...r } = N(e.props, t), { onClick: i, onKeyDown: a, onMouseDown: o, onPointerDown: s, ...c } = r, [l, u] = k(!!n);
|
|
163
120
|
E(() => {
|
|
164
121
|
n !== void 0 && u(!!n);
|
|
165
122
|
}, [n]);
|
|
@@ -167,9 +124,9 @@ function qe({ component: e, payload: t }) {
|
|
|
167
124
|
return /* @__PURE__ */ A("button", {
|
|
168
125
|
...c,
|
|
169
126
|
"aria-pressed": l,
|
|
170
|
-
className:
|
|
127
|
+
className: M("comins-table__component", "comins-table__component-toggle", r.className),
|
|
171
128
|
onClick: (n) => {
|
|
172
|
-
i?.(n),
|
|
129
|
+
i?.(n), P(n);
|
|
173
130
|
let r = !l;
|
|
174
131
|
u(r), e.onCheckedChange?.({
|
|
175
132
|
...t,
|
|
@@ -177,24 +134,24 @@ function qe({ component: e, payload: t }) {
|
|
|
177
134
|
});
|
|
178
135
|
},
|
|
179
136
|
onKeyDown: (e) => {
|
|
180
|
-
a?.(e),
|
|
137
|
+
a?.(e), P(e);
|
|
181
138
|
},
|
|
182
139
|
onMouseDown: (e) => {
|
|
183
|
-
o?.(e),
|
|
140
|
+
o?.(e), P(e);
|
|
184
141
|
},
|
|
185
142
|
onPointerDown: (e) => {
|
|
186
|
-
s?.(e),
|
|
143
|
+
s?.(e), P(e);
|
|
187
144
|
},
|
|
188
145
|
type: r.type ?? "button",
|
|
189
146
|
children: d
|
|
190
147
|
});
|
|
191
148
|
}
|
|
192
|
-
function
|
|
149
|
+
function Ye({ component: e, payload: t }) {
|
|
193
150
|
let [n, r] = k(!1), i = Ae(), a = O(null), o = O(null), [s, c] = k({
|
|
194
151
|
left: 0,
|
|
195
152
|
position: "fixed",
|
|
196
153
|
top: 0
|
|
197
|
-
}), l =
|
|
154
|
+
}), l = N(e.props, t), u = D(() => Be(e.items, t), [e.items, t]), d = () => {
|
|
198
155
|
let e = a.current;
|
|
199
156
|
if (!e || typeof window > "u") return;
|
|
200
157
|
let t = e.getBoundingClientRect(), n = Math.max(o.current?.offsetWidth ?? 136, 136);
|
|
@@ -218,7 +175,7 @@ function Je({ component: e, payload: t }) {
|
|
|
218
175
|
E(() => {
|
|
219
176
|
if (!n) return;
|
|
220
177
|
let e = (e) => {
|
|
221
|
-
|
|
178
|
+
We(a.current, e.target) || We(o.current, e.target) || f(!1, e);
|
|
222
179
|
}, t = (e) => {
|
|
223
180
|
e.key === "Escape" && (f(!1, e), a.current?.focus());
|
|
224
181
|
};
|
|
@@ -249,16 +206,16 @@ function Je({ component: e, payload: t }) {
|
|
|
249
206
|
className: "comins-table__component-menu-item",
|
|
250
207
|
disabled: n.disabled,
|
|
251
208
|
onClick: (r) => {
|
|
252
|
-
|
|
209
|
+
F(r), !(n.disabled || !Ue(n)) && (f(!1, r), e.onSelect?.({
|
|
253
210
|
...t,
|
|
254
211
|
event: r,
|
|
255
212
|
item: n,
|
|
256
213
|
value: n.value
|
|
257
214
|
}));
|
|
258
215
|
},
|
|
259
|
-
onKeyDown:
|
|
260
|
-
onMouseDown:
|
|
261
|
-
onPointerDown:
|
|
216
|
+
onKeyDown: P,
|
|
217
|
+
onMouseDown: P,
|
|
218
|
+
onPointerDown: P,
|
|
262
219
|
role: "menuitem",
|
|
263
220
|
type: "button",
|
|
264
221
|
children: n.label
|
|
@@ -272,20 +229,20 @@ function Je({ component: e, payload: t }) {
|
|
|
272
229
|
"aria-expanded": n,
|
|
273
230
|
"aria-haspopup": "menu",
|
|
274
231
|
"aria-label": l["aria-label"] ?? "Header menu",
|
|
275
|
-
className:
|
|
232
|
+
className: M("comins-table__component-menu-trigger", l.className),
|
|
276
233
|
onClick: (e) => {
|
|
277
|
-
|
|
234
|
+
F(e), f(!n, e);
|
|
278
235
|
},
|
|
279
236
|
onKeyDown: (e) => {
|
|
280
237
|
if (l.onKeyDown?.(e), e.key === "Escape" && n) {
|
|
281
|
-
|
|
238
|
+
F(e), f(!1, e);
|
|
282
239
|
return;
|
|
283
240
|
}
|
|
284
|
-
|
|
241
|
+
P(e);
|
|
285
242
|
},
|
|
286
|
-
onMouseDown:
|
|
243
|
+
onMouseDown: P,
|
|
287
244
|
onPointerDown: (e) => {
|
|
288
|
-
l.onPointerDown?.(e),
|
|
245
|
+
l.onPointerDown?.(e), P(e);
|
|
289
246
|
},
|
|
290
247
|
ref: a,
|
|
291
248
|
type: l.type ?? "button",
|
|
@@ -293,28 +250,28 @@ function Je({ component: e, payload: t }) {
|
|
|
293
250
|
}), p]
|
|
294
251
|
});
|
|
295
252
|
}
|
|
296
|
-
function
|
|
297
|
-
let { height: r, itemHeight: i, limit: a, more: o = !1, searchable: s = !1, style: c, ...l } =
|
|
253
|
+
function Xe({ component: e, interaction: t, payload: n }) {
|
|
254
|
+
let { height: r, itemHeight: i, limit: a, more: o = !1, searchable: s = !1, style: c, ...l } = N(e.props, n), u = D(() => Ve(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] = k(""), [_, v] = k(!1), [y, b] = k(0), [ee, te] = k(null), [ne, re] = k(p), ie = O(null), x = n.row.selected && n.selection.selectedRowCount === 1, S = !!(s && x), C = S ? h : "";
|
|
298
255
|
E(() => {
|
|
299
|
-
|
|
256
|
+
v(!1), b(0);
|
|
300
257
|
}, [u.length, d]), Me(() => {
|
|
301
|
-
let e =
|
|
258
|
+
let e = ie.current;
|
|
302
259
|
if (!e) return;
|
|
303
260
|
let t = e.clientHeight > 0 ? e.clientHeight : p;
|
|
304
|
-
|
|
261
|
+
re(m ? t : Math.min(t, p));
|
|
305
262
|
}, [
|
|
306
263
|
p,
|
|
307
|
-
|
|
264
|
+
_,
|
|
308
265
|
C,
|
|
309
266
|
m
|
|
310
267
|
]), E(() => {
|
|
311
|
-
let e =
|
|
312
|
-
e && (e.scrollTop = 0,
|
|
268
|
+
let e = ie.current;
|
|
269
|
+
e && (e.scrollTop = 0, b(0));
|
|
313
270
|
}, [C]), E(() => {
|
|
314
|
-
if (
|
|
315
|
-
let e =
|
|
316
|
-
e && (e.scrollTop = 0),
|
|
317
|
-
}, [
|
|
271
|
+
if (x) return;
|
|
272
|
+
let e = ie.current;
|
|
273
|
+
e && (e.scrollTop = 0), v(!1), g(""), b(0);
|
|
274
|
+
}, [x]);
|
|
318
275
|
let w = D(() => {
|
|
319
276
|
let t = C.trim().toLowerCase();
|
|
320
277
|
return u.map((e, t) => ({
|
|
@@ -324,12 +281,12 @@ function H({ component: e, interaction: t, payload: n }) {
|
|
|
324
281
|
item: n,
|
|
325
282
|
itemIndex: r,
|
|
326
283
|
value: C
|
|
327
|
-
}) :
|
|
284
|
+
}) : He(n.label).toLowerCase().includes(t) : !0);
|
|
328
285
|
}, [
|
|
329
286
|
C,
|
|
330
287
|
e,
|
|
331
288
|
u
|
|
332
|
-
]), ae = w.length > d,
|
|
289
|
+
]), ae = w.length > d, T = !!(x && (_ || C.trim().length > 0 || !o && ae)), oe = ae && !T, se = S && !_ ? 0 : 2, ce = Math.max(f, m ? ne || p : Math.min(ne || p, p)), le = Math.max(0, Math.floor(Math.max(0, y) / f) - se), ue = Math.min(w.length, Math.ceil((Math.max(0, y) + ce) / f) + se), de = T ? w.slice(le, ue) : w.slice(0, ae ? d : w.length), fe = T ? le * f : 0, pe = T ? Math.max(0, w.length - ue) * f : 0, me = `${String(n.row.id)}-${n.column.id}`, he = {
|
|
333
290
|
...c,
|
|
334
291
|
"--comins-table-virtual-list-item-height": `${f}px`,
|
|
335
292
|
height: r ?? c?.height ?? p
|
|
@@ -337,7 +294,7 @@ function H({ component: e, interaction: t, payload: n }) {
|
|
|
337
294
|
r.disabled || t?.requestRowSelection?.({
|
|
338
295
|
event: a,
|
|
339
296
|
mode: "row-click"
|
|
340
|
-
}) !== !1 && (
|
|
297
|
+
}) !== !1 && (te(r.value), e.onClickItem?.({
|
|
341
298
|
...n,
|
|
342
299
|
event: a,
|
|
343
300
|
item: r,
|
|
@@ -348,50 +305,50 @@ function H({ component: e, interaction: t, payload: n }) {
|
|
|
348
305
|
return /* @__PURE__ */ j("div", {
|
|
349
306
|
...l,
|
|
350
307
|
"aria-label": l["aria-label"] ?? "Virtual list",
|
|
351
|
-
className:
|
|
352
|
-
"data-comins-virtual-list-expanded":
|
|
353
|
-
"data-comins-virtual-list-visible-count":
|
|
308
|
+
className: M("comins-table__component", "comins-table__component-virtual-list", l.className),
|
|
309
|
+
"data-comins-virtual-list-expanded": T ? "true" : void 0,
|
|
310
|
+
"data-comins-virtual-list-visible-count": de.length,
|
|
354
311
|
"data-testid": `virtual-list-${me}`,
|
|
355
312
|
onClick: (e) => {
|
|
356
|
-
l.onClick?.(e),
|
|
313
|
+
l.onClick?.(e), P(e);
|
|
357
314
|
},
|
|
358
|
-
onKeyDown:
|
|
359
|
-
onMouseDown:
|
|
360
|
-
onContextMenu:
|
|
361
|
-
onDoubleClick:
|
|
362
|
-
onMouseUp:
|
|
363
|
-
onPointerUp:
|
|
364
|
-
onPointerMove:
|
|
365
|
-
onPointerEnter:
|
|
366
|
-
onMouseOver:
|
|
367
|
-
onMouseOut:
|
|
368
|
-
onPointerLeave:
|
|
369
|
-
onBlur:
|
|
370
|
-
onFocus:
|
|
371
|
-
onInput:
|
|
372
|
-
onChange:
|
|
373
|
-
onMouseMove:
|
|
374
|
-
onMouseEnter:
|
|
375
|
-
onMouseLeave:
|
|
376
|
-
onTouchStart:
|
|
377
|
-
onTouchMove:
|
|
378
|
-
onTouchEnd:
|
|
315
|
+
onKeyDown: P,
|
|
316
|
+
onMouseDown: P,
|
|
317
|
+
onContextMenu: P,
|
|
318
|
+
onDoubleClick: P,
|
|
319
|
+
onMouseUp: P,
|
|
320
|
+
onPointerUp: P,
|
|
321
|
+
onPointerMove: P,
|
|
322
|
+
onPointerEnter: P,
|
|
323
|
+
onMouseOver: P,
|
|
324
|
+
onMouseOut: P,
|
|
325
|
+
onPointerLeave: P,
|
|
326
|
+
onBlur: P,
|
|
327
|
+
onFocus: P,
|
|
328
|
+
onInput: P,
|
|
329
|
+
onChange: P,
|
|
330
|
+
onMouseMove: P,
|
|
331
|
+
onMouseEnter: P,
|
|
332
|
+
onMouseLeave: P,
|
|
333
|
+
onTouchStart: P,
|
|
334
|
+
onTouchMove: P,
|
|
335
|
+
onTouchEnd: P,
|
|
379
336
|
onWheel: (e) => {
|
|
380
|
-
l.onWheel?.(e),
|
|
337
|
+
l.onWheel?.(e), P(e);
|
|
381
338
|
},
|
|
382
339
|
onPointerDown: (e) => {
|
|
383
|
-
l.onPointerDown?.(e),
|
|
340
|
+
l.onPointerDown?.(e), P(e);
|
|
384
341
|
},
|
|
385
342
|
role: "listbox",
|
|
386
343
|
style: he,
|
|
387
344
|
children: [/* @__PURE__ */ j("div", {
|
|
388
345
|
className: "comins-table__component-virtual-list-items",
|
|
389
346
|
onScroll: (e) => {
|
|
390
|
-
|
|
347
|
+
P(e), b(e.currentTarget.scrollTop);
|
|
391
348
|
let t = e.currentTarget.clientHeight > 0 ? e.currentTarget.clientHeight : p;
|
|
392
|
-
|
|
349
|
+
re(m ? t : Math.min(t, p));
|
|
393
350
|
},
|
|
394
|
-
ref:
|
|
351
|
+
ref: ie,
|
|
395
352
|
role: "presentation",
|
|
396
353
|
children: [
|
|
397
354
|
fe > 0 ? /* @__PURE__ */ A("span", {
|
|
@@ -399,16 +356,16 @@ function H({ component: e, interaction: t, payload: n }) {
|
|
|
399
356
|
className: "comins-table__component-virtual-list-spacer",
|
|
400
357
|
style: { height: fe }
|
|
401
358
|
}) : null,
|
|
402
|
-
|
|
403
|
-
"aria-selected":
|
|
359
|
+
de.map(({ item: t, itemIndex: r }) => /* @__PURE__ */ A("button", {
|
|
360
|
+
"aria-selected": ee === t.value,
|
|
404
361
|
className: "comins-table__component-virtual-list-item",
|
|
405
362
|
"data-comins-virtual-list-item": "true",
|
|
406
363
|
disabled: t.disabled,
|
|
407
364
|
onClick: (e) => {
|
|
408
|
-
|
|
365
|
+
F(e), ge(t, r, e);
|
|
409
366
|
},
|
|
410
367
|
onContextMenu: (i) => {
|
|
411
|
-
|
|
368
|
+
P(i), !t.disabled && e.onContextMenuItem?.({
|
|
412
369
|
...n,
|
|
413
370
|
event: i,
|
|
414
371
|
item: t,
|
|
@@ -417,10 +374,10 @@ function H({ component: e, interaction: t, payload: n }) {
|
|
|
417
374
|
});
|
|
418
375
|
},
|
|
419
376
|
onKeyDown: (e) => {
|
|
420
|
-
|
|
377
|
+
P(e), (e.key === "Enter" || e.key === " " || e.key === "Spacebar") && (e.preventDefault(), ge(t, r, e));
|
|
421
378
|
},
|
|
422
|
-
onMouseDown:
|
|
423
|
-
onPointerDown:
|
|
379
|
+
onMouseDown: P,
|
|
380
|
+
onPointerDown: P,
|
|
424
381
|
role: "option",
|
|
425
382
|
type: "button",
|
|
426
383
|
children: /* @__PURE__ */ A("span", {
|
|
@@ -437,106 +394,106 @@ function H({ component: e, interaction: t, payload: n }) {
|
|
|
437
394
|
}), /* @__PURE__ */ j("div", {
|
|
438
395
|
className: "comins-table__component-virtual-list-controls",
|
|
439
396
|
children: [o && ae ? /* @__PURE__ */ A("button", {
|
|
440
|
-
"aria-expanded":
|
|
397
|
+
"aria-expanded": T,
|
|
441
398
|
"aria-label": "전체 목록 보기",
|
|
442
399
|
className: "comins-table__component-virtual-list-overflow comins-table__component-virtual-list-more",
|
|
443
400
|
"data-testid": `virtual-list-overflow-${me}`,
|
|
444
401
|
onClick: (e) => {
|
|
445
|
-
|
|
402
|
+
F(e), t?.requestRowSelection?.({
|
|
446
403
|
event: e,
|
|
447
404
|
mode: "exclusive"
|
|
448
|
-
}) !== !1 &&
|
|
405
|
+
}) !== !1 && v(!0);
|
|
449
406
|
},
|
|
450
|
-
onKeyDown:
|
|
451
|
-
onMouseDown:
|
|
452
|
-
onPointerDown:
|
|
407
|
+
onKeyDown: P,
|
|
408
|
+
onMouseDown: P,
|
|
409
|
+
onPointerDown: P,
|
|
453
410
|
type: "button",
|
|
454
411
|
children: "..."
|
|
455
|
-
}) :
|
|
412
|
+
}) : oe ? /* @__PURE__ */ A("span", {
|
|
456
413
|
"aria-hidden": "true",
|
|
457
414
|
className: "comins-table__component-virtual-list-overflow comins-table__component-virtual-list-more",
|
|
458
415
|
"data-testid": `virtual-list-overflow-${me}`,
|
|
459
416
|
children: "..."
|
|
460
|
-
}) : null,
|
|
417
|
+
}) : null, S ? /* @__PURE__ */ A("input", {
|
|
461
418
|
"aria-label": `${l["aria-label"] ?? "Virtual list"} 검색`,
|
|
462
419
|
className: "comins-table__component-virtual-list-search",
|
|
463
420
|
"data-testid": `virtual-list-search-${me}`,
|
|
464
421
|
onChange: (e) => {
|
|
465
|
-
|
|
422
|
+
P(e), g(e.currentTarget.value);
|
|
466
423
|
},
|
|
467
|
-
onClick:
|
|
468
|
-
onKeyDown:
|
|
469
|
-
onMouseDown:
|
|
470
|
-
onPointerDown:
|
|
424
|
+
onClick: P,
|
|
425
|
+
onKeyDown: P,
|
|
426
|
+
onMouseDown: P,
|
|
427
|
+
onPointerDown: P,
|
|
471
428
|
placeholder: "검색",
|
|
472
429
|
value: h
|
|
473
430
|
}) : null]
|
|
474
431
|
})]
|
|
475
432
|
});
|
|
476
433
|
}
|
|
477
|
-
function
|
|
478
|
-
if (e.type === "menu") return /* @__PURE__ */ A(
|
|
434
|
+
function Ze(e, t, n) {
|
|
435
|
+
if (e.type === "menu") return /* @__PURE__ */ A(Ye, {
|
|
479
436
|
component: e,
|
|
480
437
|
payload: t
|
|
481
438
|
});
|
|
482
|
-
if (e.type === "virtual-list") return /* @__PURE__ */ A(
|
|
439
|
+
if (e.type === "virtual-list") return /* @__PURE__ */ A(Xe, {
|
|
483
440
|
component: e,
|
|
484
441
|
interaction: n,
|
|
485
442
|
payload: t
|
|
486
443
|
});
|
|
487
444
|
if (e.type === "button") {
|
|
488
|
-
let n =
|
|
445
|
+
let n = N(e.props, t), { onClick: r, onKeyDown: i, onMouseDown: a, onPointerDown: o, ...s } = n;
|
|
489
446
|
return /* @__PURE__ */ A("button", {
|
|
490
447
|
...s,
|
|
491
|
-
className:
|
|
448
|
+
className: M("comins-table__component", "comins-table__component-button", n.className),
|
|
492
449
|
onClick: (n) => {
|
|
493
|
-
r?.(n),
|
|
450
|
+
r?.(n), P(n), e.onClick?.({
|
|
494
451
|
...t,
|
|
495
452
|
event: n
|
|
496
453
|
});
|
|
497
454
|
},
|
|
498
455
|
onKeyDown: (e) => {
|
|
499
|
-
i?.(e),
|
|
456
|
+
i?.(e), P(e);
|
|
500
457
|
},
|
|
501
458
|
onMouseDown: (e) => {
|
|
502
|
-
a?.(e),
|
|
459
|
+
a?.(e), P(e);
|
|
503
460
|
},
|
|
504
461
|
onPointerDown: (e) => {
|
|
505
|
-
o?.(e),
|
|
462
|
+
o?.(e), P(e);
|
|
506
463
|
},
|
|
507
464
|
type: n.type ?? "button"
|
|
508
465
|
});
|
|
509
466
|
}
|
|
510
|
-
if (e.type === "input") return /* @__PURE__ */ A(
|
|
467
|
+
if (e.type === "input") return /* @__PURE__ */ A(Ke, {
|
|
511
468
|
component: e,
|
|
512
469
|
payload: t
|
|
513
470
|
});
|
|
514
|
-
if (e.type === "checkbox") return /* @__PURE__ */ A(
|
|
471
|
+
if (e.type === "checkbox") return /* @__PURE__ */ A(qe, {
|
|
515
472
|
component: e,
|
|
516
473
|
payload: t
|
|
517
474
|
});
|
|
518
475
|
if (e.type === "select") {
|
|
519
|
-
let n =
|
|
476
|
+
let n = N(e.props, t), r = ze(e.options, t), { onChange: i, onClick: a, onKeyDown: o, onMouseDown: s, onPointerDown: c, ...l } = n;
|
|
520
477
|
return /* @__PURE__ */ A("select", {
|
|
521
478
|
...l,
|
|
522
|
-
className:
|
|
479
|
+
className: M("comins-table__component", "comins-table__component-select", n.className),
|
|
523
480
|
onClick: (e) => {
|
|
524
|
-
a?.(e),
|
|
481
|
+
a?.(e), P(e);
|
|
525
482
|
},
|
|
526
483
|
onChange: (n) => {
|
|
527
|
-
i?.(n),
|
|
484
|
+
i?.(n), P(n), e.onValueChange?.({
|
|
528
485
|
...t,
|
|
529
486
|
value: n.currentTarget.value
|
|
530
487
|
});
|
|
531
488
|
},
|
|
532
489
|
onKeyDown: (e) => {
|
|
533
|
-
o?.(e),
|
|
490
|
+
o?.(e), P(e);
|
|
534
491
|
},
|
|
535
492
|
onMouseDown: (e) => {
|
|
536
|
-
s?.(e),
|
|
493
|
+
s?.(e), P(e);
|
|
537
494
|
},
|
|
538
495
|
onPointerDown: (e) => {
|
|
539
|
-
c?.(e),
|
|
496
|
+
c?.(e), P(e);
|
|
540
497
|
},
|
|
541
498
|
children: r.map((e) => /* @__PURE__ */ A("option", {
|
|
542
499
|
disabled: e.disabled,
|
|
@@ -546,40 +503,40 @@ function Ye(e, t, n) {
|
|
|
546
503
|
});
|
|
547
504
|
}
|
|
548
505
|
if (e.type === "radio") {
|
|
549
|
-
let n =
|
|
506
|
+
let n = N(e.props, t), r = ze(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
507
|
return /* @__PURE__ */ A("div", {
|
|
551
508
|
...s,
|
|
552
|
-
className:
|
|
509
|
+
className: M("comins-table__component", "comins-table__component-radio", s.className),
|
|
553
510
|
onClick: (e) => {
|
|
554
|
-
s.onClick?.(e),
|
|
511
|
+
s.onClick?.(e), P(e);
|
|
555
512
|
},
|
|
556
513
|
onKeyDown: (e) => {
|
|
557
|
-
s.onKeyDown?.(e),
|
|
514
|
+
s.onKeyDown?.(e), P(e);
|
|
558
515
|
},
|
|
559
516
|
onMouseDown: (e) => {
|
|
560
|
-
s.onMouseDown?.(e),
|
|
517
|
+
s.onMouseDown?.(e), P(e);
|
|
561
518
|
},
|
|
562
519
|
onPointerDown: (e) => {
|
|
563
|
-
s.onPointerDown?.(e),
|
|
520
|
+
s.onPointerDown?.(e), P(e);
|
|
564
521
|
},
|
|
565
522
|
role: "radiogroup",
|
|
566
523
|
children: r.map((n) => /* @__PURE__ */ j("label", {
|
|
567
|
-
onClick:
|
|
568
|
-
onMouseDown:
|
|
524
|
+
onClick: P,
|
|
525
|
+
onMouseDown: P,
|
|
569
526
|
children: [/* @__PURE__ */ A("input", {
|
|
570
527
|
checked: i === void 0 ? void 0 : String(i) === String(n.value),
|
|
571
528
|
disabled: n.disabled,
|
|
572
529
|
name: a,
|
|
573
|
-
onClick:
|
|
530
|
+
onClick: P,
|
|
574
531
|
onChange: (r) => {
|
|
575
|
-
|
|
532
|
+
P(r), r.currentTarget.checked && e.onValueChange?.({
|
|
576
533
|
...t,
|
|
577
534
|
value: String(n.value)
|
|
578
535
|
});
|
|
579
536
|
},
|
|
580
|
-
onKeyDown:
|
|
581
|
-
onMouseDown:
|
|
582
|
-
onPointerDown:
|
|
537
|
+
onKeyDown: P,
|
|
538
|
+
onMouseDown: P,
|
|
539
|
+
onPointerDown: P,
|
|
583
540
|
style: {
|
|
584
541
|
height: 20,
|
|
585
542
|
width: 20
|
|
@@ -590,49 +547,134 @@ function Ye(e, t, n) {
|
|
|
590
547
|
}, String(n.value)))
|
|
591
548
|
});
|
|
592
549
|
}
|
|
593
|
-
if (e.type === "toggle") return /* @__PURE__ */ A(
|
|
550
|
+
if (e.type === "toggle") return /* @__PURE__ */ A(Je, {
|
|
594
551
|
component: e,
|
|
595
552
|
payload: t
|
|
596
553
|
});
|
|
597
|
-
let r =
|
|
554
|
+
let r = N(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
555
|
return /* @__PURE__ */ A("div", {
|
|
599
556
|
...r,
|
|
600
557
|
"aria-valuemax": a,
|
|
601
558
|
"aria-valuemin": 0,
|
|
602
559
|
"aria-valuenow": i,
|
|
603
|
-
className:
|
|
604
|
-
onClick:
|
|
605
|
-
onKeyDown:
|
|
606
|
-
onMouseDown:
|
|
607
|
-
onPointerDown:
|
|
560
|
+
className: M("comins-table__component", "comins-table__component-progress", r.className),
|
|
561
|
+
onClick: P,
|
|
562
|
+
onKeyDown: P,
|
|
563
|
+
onMouseDown: P,
|
|
564
|
+
onPointerDown: P,
|
|
608
565
|
role: "progressbar",
|
|
609
566
|
children: /* @__PURE__ */ A("span", { style: { width: `${o}%` } })
|
|
610
567
|
});
|
|
611
568
|
}
|
|
612
569
|
//#endregion
|
|
570
|
+
//#region src/table-icons.tsx
|
|
571
|
+
var I = {
|
|
572
|
+
columnMove: Fe,
|
|
573
|
+
disclosureCollapsed: Pe,
|
|
574
|
+
disclosureExpanded: Pe,
|
|
575
|
+
sortAscending: Le,
|
|
576
|
+
sortDescending: Ie,
|
|
577
|
+
sortUnsorted: Ne
|
|
578
|
+
};
|
|
579
|
+
function Qe({ className: e, name: t }) {
|
|
580
|
+
let n = I[t];
|
|
581
|
+
return /* @__PURE__ */ A(n, {
|
|
582
|
+
"aria-hidden": "true",
|
|
583
|
+
className: ["comins-table-icon", e].filter(Boolean).join(" "),
|
|
584
|
+
"data-comins-icon": t,
|
|
585
|
+
focusable: "false"
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
var $e = Te.forwardRef(function({ className: e, icon: t, type: n = "button", ...r }, i) {
|
|
589
|
+
return /* @__PURE__ */ A("button", {
|
|
590
|
+
className: ["comins-table-icon-button", e].filter(Boolean).join(" "),
|
|
591
|
+
ref: i,
|
|
592
|
+
type: n,
|
|
593
|
+
...r,
|
|
594
|
+
children: /* @__PURE__ */ A(Qe, { name: t })
|
|
595
|
+
});
|
|
596
|
+
});
|
|
597
|
+
//#endregion
|
|
598
|
+
//#region src/row-detail.tsx
|
|
599
|
+
function et(e) {
|
|
600
|
+
return /* @__PURE__ */ A($e, {
|
|
601
|
+
"aria-controls": e.expanded ? e.controlsId : void 0,
|
|
602
|
+
"aria-expanded": e.expanded,
|
|
603
|
+
"aria-label": e.label,
|
|
604
|
+
className: "comins-row-detail-expander",
|
|
605
|
+
"data-comins-row-leading-control": "disclosure",
|
|
606
|
+
"data-testid": e.testId,
|
|
607
|
+
disabled: e.disabled,
|
|
608
|
+
icon: e.expanded ? "disclosureExpanded" : "disclosureCollapsed",
|
|
609
|
+
id: e.id,
|
|
610
|
+
onClick: (t) => {
|
|
611
|
+
t.preventDefault(), t.stopPropagation(), e.onToggle();
|
|
612
|
+
},
|
|
613
|
+
onKeyDown: (e) => e.stopPropagation(),
|
|
614
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
615
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
616
|
+
ref: e.onElement
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
function tt(e) {
|
|
620
|
+
let t = O(null), n = O(e.getToggleElement), r = O(e.onContentElement), i = e.fixedHeight === void 0;
|
|
621
|
+
return n.current = e.getToggleElement, r.current = e.onContentElement, Me(() => {
|
|
622
|
+
let e = t.current;
|
|
623
|
+
return r.current(e), () => r.current(null);
|
|
624
|
+
}, [i]), Me(() => {
|
|
625
|
+
let e = t.current;
|
|
626
|
+
return () => {
|
|
627
|
+
if (e?.contains(document.activeElement)) {
|
|
628
|
+
let e = () => {
|
|
629
|
+
let e = n.current();
|
|
630
|
+
e?.isConnected && e.focus();
|
|
631
|
+
};
|
|
632
|
+
e(), window.requestAnimationFrame(e);
|
|
633
|
+
}
|
|
634
|
+
};
|
|
635
|
+
}, []), /* @__PURE__ */ A("tr", {
|
|
636
|
+
className: "comins-table__detail-row",
|
|
637
|
+
"data-detail-for": e.ownerId,
|
|
638
|
+
children: /* @__PURE__ */ A("td", {
|
|
639
|
+
className: "comins-table__detail-cell",
|
|
640
|
+
colSpan: Math.max(1, e.colSpan),
|
|
641
|
+
children: /* @__PURE__ */ A("div", {
|
|
642
|
+
"aria-labelledby": e.labelId,
|
|
643
|
+
className: "comins-table__detail-content",
|
|
644
|
+
"data-testid": e.testId,
|
|
645
|
+
id: e.contentId,
|
|
646
|
+
ref: t,
|
|
647
|
+
role: "region",
|
|
648
|
+
style: e.fixedHeight === void 0 ? void 0 : { height: e.fixedHeight },
|
|
649
|
+
children: e.children
|
|
650
|
+
})
|
|
651
|
+
})
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
//#endregion
|
|
613
655
|
//#region src/summary.ts
|
|
614
|
-
function
|
|
656
|
+
function nt(e, t) {
|
|
615
657
|
return t.split(".").reduce((e, t) => {
|
|
616
658
|
if (!(typeof e != "object" || !e)) return e[t];
|
|
617
659
|
}, e);
|
|
618
660
|
}
|
|
619
|
-
function
|
|
661
|
+
function L(e) {
|
|
620
662
|
return e.filter((e) => typeof e == "number" && Number.isFinite(e));
|
|
621
663
|
}
|
|
622
|
-
function
|
|
664
|
+
function R(e, t) {
|
|
623
665
|
if (e === "count") return t.length;
|
|
624
|
-
let n =
|
|
666
|
+
let n = L(t);
|
|
625
667
|
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
668
|
}
|
|
627
|
-
function
|
|
669
|
+
function rt(e, t, n) {
|
|
628
670
|
return Object.entries(n.columns).reduce((n, [r, i]) => {
|
|
629
671
|
let a = t.find((e) => e.id === r);
|
|
630
672
|
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) =>
|
|
673
|
+
let o = typeof i == "object" && i ? i : void 0, s = typeof i == "object" && i ? i.aggregate : i, c = e.map((e) => nt(e, a.field)), l = typeof s == "function" ? s({
|
|
632
674
|
column: a,
|
|
633
675
|
rows: e,
|
|
634
676
|
values: c
|
|
635
|
-
}) :
|
|
677
|
+
}) : R(s, c);
|
|
636
678
|
return n[r] = o?.format ? o.format({
|
|
637
679
|
column: a,
|
|
638
680
|
rows: e,
|
|
@@ -643,15 +685,15 @@ function $e(e, t, n) {
|
|
|
643
685
|
}
|
|
644
686
|
//#endregion
|
|
645
687
|
//#region src/tree.ts
|
|
646
|
-
function
|
|
688
|
+
function it(e) {
|
|
647
689
|
return e.join(".");
|
|
648
690
|
}
|
|
649
|
-
function
|
|
691
|
+
function z(e, t) {
|
|
650
692
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = 0, a = (e, o) => {
|
|
651
693
|
e.forEach((e, s) => {
|
|
652
694
|
let c = [...o, s], l = t(e.item, i);
|
|
653
695
|
if (i += 1, n.has(l)) throw Error(`Duplicate tree row id: ${String(l)}`);
|
|
654
|
-
n.set(l, c), r.set(
|
|
696
|
+
n.set(l, c), r.set(it(c), l), e.children?.length && a(e.children, c);
|
|
655
697
|
});
|
|
656
698
|
};
|
|
657
699
|
return a(e, []), {
|
|
@@ -659,17 +701,17 @@ function U(e, t) {
|
|
|
659
701
|
idByPath: r
|
|
660
702
|
};
|
|
661
703
|
}
|
|
662
|
-
function
|
|
704
|
+
function at(e, t, n) {
|
|
663
705
|
let [r, ...i] = t;
|
|
664
706
|
return r === void 0 ? [...e] : e.map((e, t) => t === r ? i.length === 0 ? n(e) : e.children ? {
|
|
665
707
|
...e,
|
|
666
|
-
children:
|
|
708
|
+
children: at(e.children, i, n)
|
|
667
709
|
} : e : e);
|
|
668
710
|
}
|
|
669
|
-
function
|
|
670
|
-
let r =
|
|
711
|
+
function B(e, t, n = {}) {
|
|
712
|
+
let r = z(e, t), i = [], a = (e, t, o) => {
|
|
671
713
|
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(
|
|
714
|
+
let c = [...o, s], l = e.children ?? [], u = l.length > 0, d = e.expand ?? n.defaultExpandAll ?? !1, f = r.idByPath.get(it(c));
|
|
673
715
|
f !== void 0 && (i.push({
|
|
674
716
|
depth: t,
|
|
675
717
|
expanded: d,
|
|
@@ -682,33 +724,171 @@ function G(e, t, n = {}) {
|
|
|
682
724
|
};
|
|
683
725
|
return a(e, 0, []), i;
|
|
684
726
|
}
|
|
685
|
-
function
|
|
686
|
-
return e.flatMap((e) => e.children?.length ?
|
|
727
|
+
function ot(e) {
|
|
728
|
+
return e.flatMap((e) => e.children?.length ? ot(e.children) : [e.item]);
|
|
687
729
|
}
|
|
688
|
-
function
|
|
689
|
-
let i =
|
|
690
|
-
return i ?
|
|
730
|
+
function st(e, t, n, r = {}) {
|
|
731
|
+
let i = z(e, n).byId.get(t);
|
|
732
|
+
return i ? at(e, i, (e) => ({
|
|
691
733
|
...e,
|
|
692
734
|
expand: !(e.expand ?? r.defaultExpandAll ?? !1)
|
|
693
735
|
})) : [...e];
|
|
694
736
|
}
|
|
695
|
-
function
|
|
696
|
-
let i =
|
|
697
|
-
return i ?
|
|
737
|
+
function ct(e, t, n, r) {
|
|
738
|
+
let i = z(e, n).byId.get(t);
|
|
739
|
+
return i ? at(e, i, (e) => ({
|
|
698
740
|
...e,
|
|
699
741
|
item: r(e.item)
|
|
700
742
|
})) : [...e];
|
|
701
743
|
}
|
|
702
|
-
function
|
|
744
|
+
function lt(e, t) {
|
|
703
745
|
return [...e].sort((e, n) => t(e.item, n.item)).map((e) => ({
|
|
704
746
|
...e,
|
|
705
|
-
children: e.children ?
|
|
747
|
+
children: e.children ? lt(e.children, t) : void 0
|
|
706
748
|
}));
|
|
707
749
|
}
|
|
708
750
|
//#endregion
|
|
751
|
+
//#region src/virtual-layout.ts
|
|
752
|
+
var V = 15e5;
|
|
753
|
+
function ut(e) {
|
|
754
|
+
return `data:${typeof e}:${encodeURIComponent(String(e))}`;
|
|
755
|
+
}
|
|
756
|
+
function dt(e) {
|
|
757
|
+
return {
|
|
758
|
+
dataIndex: e.dataIndex,
|
|
759
|
+
...e.detail ? { detail: e.detail } : {},
|
|
760
|
+
key: ut(e.rowId),
|
|
761
|
+
kind: "data",
|
|
762
|
+
row: e.row,
|
|
763
|
+
rowId: e.rowId,
|
|
764
|
+
visibleIndex: e.visibleIndex
|
|
765
|
+
};
|
|
766
|
+
}
|
|
767
|
+
function ft(e, t) {
|
|
768
|
+
return typeof e == "number" && Number.isFinite(e) && e > 0 ? e : Math.max(1, t);
|
|
769
|
+
}
|
|
770
|
+
function pt(e) {
|
|
771
|
+
return typeof e == "number" && Number.isFinite(e) && e > 0 ? {
|
|
772
|
+
height: e,
|
|
773
|
+
mode: "fixed"
|
|
774
|
+
} : { mode: "auto" };
|
|
775
|
+
}
|
|
776
|
+
var mt = class e {
|
|
777
|
+
heights;
|
|
778
|
+
tree;
|
|
779
|
+
totalHeight;
|
|
780
|
+
constructor(e) {
|
|
781
|
+
this.heights = Float64Array.from(e, (e) => Math.max(0, e)), this.tree = new Float64Array(this.heights.length + 1), this.totalHeight = 0;
|
|
782
|
+
for (let e = 0; e < this.heights.length; e += 1) {
|
|
783
|
+
let t = e + 1, n = this.heights[e] ?? 0, r = t + (t & -t);
|
|
784
|
+
this.tree[t] = (this.tree[t] ?? 0) + n, this.totalHeight += n, r < this.tree.length && (this.tree[r] = (this.tree[r] ?? 0) + (this.tree[t] ?? 0));
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
static from(t) {
|
|
788
|
+
return new e(t);
|
|
789
|
+
}
|
|
790
|
+
add(e, t) {
|
|
791
|
+
for (let n = e + 1; n < this.tree.length; n += n & -n) this.tree[n] = (this.tree[n] ?? 0) + t;
|
|
792
|
+
}
|
|
793
|
+
getHeight(e) {
|
|
794
|
+
return this.heights[e] ?? 0;
|
|
795
|
+
}
|
|
796
|
+
getPrefixHeight(e) {
|
|
797
|
+
let t = 0;
|
|
798
|
+
for (let n = Math.min(this.heights.length, Math.max(0, e)); n > 0; n -= n & -n) t += this.tree[n] ?? 0;
|
|
799
|
+
return t;
|
|
800
|
+
}
|
|
801
|
+
getTotalHeight() {
|
|
802
|
+
return this.totalHeight;
|
|
803
|
+
}
|
|
804
|
+
findIndexAtOffset(e) {
|
|
805
|
+
if (this.heights.length === 0 || this.totalHeight <= 0) return 0;
|
|
806
|
+
let t = Math.min(Math.max(0, e), Math.max(0, this.getTotalHeight() - 2 ** -52)), n = 0, r = 0, i = 1;
|
|
807
|
+
for (; i * 2 < this.tree.length;) i *= 2;
|
|
808
|
+
for (; i > 0; i = Math.floor(i / 2)) {
|
|
809
|
+
let e = n + i, a = r + (this.tree[e] ?? 0);
|
|
810
|
+
e < this.tree.length && a <= t && (n = e, r = a);
|
|
811
|
+
}
|
|
812
|
+
return Math.min(this.heights.length - 1, n);
|
|
813
|
+
}
|
|
814
|
+
updateHeight(e, t) {
|
|
815
|
+
let n = Math.max(0, t), r = this.heights[e];
|
|
816
|
+
if (r === void 0) return 0;
|
|
817
|
+
let i = n - r;
|
|
818
|
+
return this.heights[e] = n, this.totalHeight += i, this.add(e, i), i;
|
|
819
|
+
}
|
|
820
|
+
};
|
|
821
|
+
function ht(e, t) {
|
|
822
|
+
return e.kind === "group" ? e.height : t + (e.detail?.height ?? 0);
|
|
823
|
+
}
|
|
824
|
+
function H(e, t) {
|
|
825
|
+
let n = Math.min(e, V), r = Math.max(0, e - t), i = Math.max(0, n - t);
|
|
826
|
+
return {
|
|
827
|
+
logicalScrollableHeight: r,
|
|
828
|
+
physicalScrollableHeight: i,
|
|
829
|
+
physicalScrollHeight: n,
|
|
830
|
+
scrollScale: r > 0 && i > 0 ? r / i : 1
|
|
831
|
+
};
|
|
832
|
+
}
|
|
833
|
+
function gt(e) {
|
|
834
|
+
let t = H(e.heightIndex.getTotalHeight(), e.viewportHeight), n = Math.min(t.physicalScrollableHeight, Math.max(0, e.physicalScrollTop)), r = Math.min(t.logicalScrollableHeight, n * t.scrollScale), i = e.heightIndex.findIndexAtOffset(r), a = e.heightIndex.findIndexAtOffset(r + Math.max(0, e.viewportHeight)), o = Math.max(0, i - Math.max(0, e.overscan)), s = Math.min(a + Math.max(0, e.overscan) + 1, e.heightIndex.findIndexAtOffset(Infinity) + 1), c = e.heightIndex.getPrefixHeight(o);
|
|
835
|
+
return {
|
|
836
|
+
endIndex: s,
|
|
837
|
+
logicalScrollTop: r,
|
|
838
|
+
logicalStartOffset: c,
|
|
839
|
+
physicalScrollHeight: t.physicalScrollHeight,
|
|
840
|
+
renderOffset: n - (r - c),
|
|
841
|
+
scrollScale: t.scrollScale,
|
|
842
|
+
startIndex: o
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
function _t(e, t, n, r) {
|
|
846
|
+
let i = e.get(t);
|
|
847
|
+
return i && i.width === Math.round(n) ? {
|
|
848
|
+
estimated: !1,
|
|
849
|
+
height: i.height
|
|
850
|
+
} : {
|
|
851
|
+
estimated: !0,
|
|
852
|
+
height: r
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
function vt(e, t) {
|
|
856
|
+
for (let n of e.keys()) t.has(n) || e.delete(n);
|
|
857
|
+
}
|
|
858
|
+
function yt(e) {
|
|
859
|
+
if (e.keys.length === 0) return;
|
|
860
|
+
let t = e.heightIndex.findIndexAtOffset(e.logicalScrollTop), n = e.keys[t];
|
|
861
|
+
if (n === void 0) return;
|
|
862
|
+
let r = e.heightIndex.getPrefixHeight(t);
|
|
863
|
+
return {
|
|
864
|
+
key: n,
|
|
865
|
+
offsetWithinSlot: Math.max(0, e.logicalScrollTop - r),
|
|
866
|
+
previousIndex: t
|
|
867
|
+
};
|
|
868
|
+
}
|
|
869
|
+
function bt(e) {
|
|
870
|
+
let t = e.nextKeys.indexOf(e.anchor.key);
|
|
871
|
+
if (t === -1) for (let n = Math.min(e.anchor.previousIndex - 1, e.previousKeys.length - 1); n >= 0 && (t = e.nextKeys.indexOf(e.previousKeys[n] ?? ""), t === -1); --n);
|
|
872
|
+
if (t === -1) for (let n = Math.max(0, e.anchor.previousIndex + 1); n < e.previousKeys.length && (t = e.nextKeys.indexOf(e.previousKeys[n] ?? ""), t === -1); n += 1);
|
|
873
|
+
if (t !== -1) return {
|
|
874
|
+
index: t,
|
|
875
|
+
offsetWithinSlot: Math.min(Math.max(0, e.anchor.offsetWithinSlot), Math.max(0, e.getNextHeight(t)))
|
|
876
|
+
};
|
|
877
|
+
}
|
|
878
|
+
function xt(e, t, n) {
|
|
879
|
+
let r = H(t, n);
|
|
880
|
+
return Math.min(r.physicalScrollableHeight, Math.max(0, e) / r.scrollScale);
|
|
881
|
+
}
|
|
882
|
+
//#endregion
|
|
709
883
|
//#region src/index.tsx
|
|
710
|
-
var
|
|
711
|
-
function
|
|
884
|
+
var St = 88;
|
|
885
|
+
function Ct(e, t, n) {
|
|
886
|
+
return e.id === t.id && e.kind === t.kind ? "neutral" : e.depth !== t.depth || e.parentGroupId !== t.parentGroupId ? "invalid" : n ? "valid" : "invalid";
|
|
887
|
+
}
|
|
888
|
+
function wt(e, t) {
|
|
889
|
+
return e.selection.rowIds.includes(t) ? e : de(e, t);
|
|
890
|
+
}
|
|
891
|
+
function Tt(e, t, n, r, i) {
|
|
712
892
|
let a = Math.max(0, r), o = e?.length ?? t.length, s = Math.min(o, Math.max(a, i)), c = [];
|
|
713
893
|
for (let r = a; r < s; r += 1) {
|
|
714
894
|
let i = e?.[r] ?? r, a = t[i], o = n[i];
|
|
@@ -721,26 +901,62 @@ function ot(e, t, n, r, i) {
|
|
|
721
901
|
}
|
|
722
902
|
return c;
|
|
723
903
|
}
|
|
724
|
-
function
|
|
904
|
+
function Et(e) {
|
|
905
|
+
return e.mixed ? e.keys : e.projectedDataIndexes.flatMap((t) => {
|
|
906
|
+
let n = e.rowIds[t];
|
|
907
|
+
return n === void 0 ? [] : [ut(n)];
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
function Dt(e) {
|
|
911
|
+
let t = Et(e.projection), n = e.logicalScrollTop ?? (e.projection.mixed ? gt({
|
|
912
|
+
heightIndex: e.projection.heightIndex,
|
|
913
|
+
overscan: 0,
|
|
914
|
+
physicalScrollTop: e.physicalScrollTop,
|
|
915
|
+
viewportHeight: e.viewportHeight
|
|
916
|
+
}).logicalScrollTop : (() => {
|
|
917
|
+
let t = H(e.projection.visibleRowCount * e.projection.rowHeight, e.viewportHeight);
|
|
918
|
+
return Math.min(t.logicalScrollableHeight, Math.max(0, e.physicalScrollTop) * t.scrollScale);
|
|
919
|
+
})()), r = e.projection.mixed ? yt({
|
|
920
|
+
heightIndex: e.projection.heightIndex,
|
|
921
|
+
keys: t,
|
|
922
|
+
logicalScrollTop: n
|
|
923
|
+
}) : (() => {
|
|
924
|
+
if (e.projection.visibleRowCount === 0) return;
|
|
925
|
+
let r = Math.min(e.projection.visibleRowCount - 1, Math.floor(n / e.projection.rowHeight)), i = t[r];
|
|
926
|
+
return i === void 0 ? void 0 : {
|
|
927
|
+
key: i,
|
|
928
|
+
offsetWithinSlot: n - r * e.projection.rowHeight,
|
|
929
|
+
previousIndex: r
|
|
930
|
+
};
|
|
931
|
+
})();
|
|
932
|
+
return r ? {
|
|
933
|
+
anchor: r,
|
|
934
|
+
previousKeys: t,
|
|
935
|
+
previousLogicalScrollTop: n,
|
|
936
|
+
previousPhysicalScrollTop: e.physicalScrollTop,
|
|
937
|
+
previousViewportHeight: e.viewportHeight
|
|
938
|
+
} : void 0;
|
|
939
|
+
}
|
|
940
|
+
function Ot(e) {
|
|
725
941
|
return !e || typeof e == "string" ? e : Object.entries(e).filter(([, e]) => e).map(([e]) => e).join(" ");
|
|
726
942
|
}
|
|
727
|
-
function
|
|
943
|
+
function kt(e, t, n) {
|
|
728
944
|
return typeof e == "function" ? e(t, n) : e;
|
|
729
945
|
}
|
|
730
|
-
function
|
|
731
|
-
let r =
|
|
946
|
+
function At(e, t, n) {
|
|
947
|
+
let r = kt(e?.disabled, t, n) === !0;
|
|
732
948
|
return {
|
|
733
|
-
className:
|
|
949
|
+
className: Ot(kt(e?.className, t, n)),
|
|
734
950
|
disabled: r,
|
|
735
|
-
draggable: !r &&
|
|
736
|
-
style:
|
|
951
|
+
draggable: !r && kt(e?.draggable, t, n) !== !1,
|
|
952
|
+
style: kt(e?.style, t, n)
|
|
737
953
|
};
|
|
738
954
|
}
|
|
739
|
-
function
|
|
955
|
+
function jt(e) {
|
|
740
956
|
let t = e?.background ?? e?.backgroundColor;
|
|
741
957
|
return typeof t == "string" || typeof t == "number" ? t : void 0;
|
|
742
958
|
}
|
|
743
|
-
function
|
|
959
|
+
function Mt(e, t, n) {
|
|
744
960
|
let r = {
|
|
745
961
|
height: e,
|
|
746
962
|
...t
|
|
@@ -750,7 +966,7 @@ function ut(e, t, n) {
|
|
|
750
966
|
"--comins-table-row-custom-background": n
|
|
751
967
|
};
|
|
752
968
|
}
|
|
753
|
-
function
|
|
969
|
+
function Nt(e) {
|
|
754
970
|
return {
|
|
755
971
|
data: e.row,
|
|
756
972
|
dataIndex: e.dataIndex,
|
|
@@ -758,7 +974,7 @@ function dt(e) {
|
|
|
758
974
|
index: e.visibleIndex
|
|
759
975
|
};
|
|
760
976
|
}
|
|
761
|
-
function
|
|
977
|
+
function U(e, t) {
|
|
762
978
|
return {
|
|
763
979
|
definition: e,
|
|
764
980
|
field: e.field,
|
|
@@ -767,23 +983,23 @@ function q(e, t) {
|
|
|
767
983
|
label: e.label
|
|
768
984
|
};
|
|
769
985
|
}
|
|
770
|
-
function
|
|
986
|
+
function Pt(e, t) {
|
|
771
987
|
return {
|
|
772
988
|
event: e,
|
|
773
989
|
index: t.visibleIndex,
|
|
774
|
-
row:
|
|
990
|
+
row: Nt(t)
|
|
775
991
|
};
|
|
776
992
|
}
|
|
777
|
-
function
|
|
993
|
+
function Ft(e, t, n, r, i) {
|
|
778
994
|
return {
|
|
779
|
-
column:
|
|
995
|
+
column: U(n, r),
|
|
780
996
|
event: e,
|
|
781
997
|
index: t.visibleIndex,
|
|
782
|
-
row:
|
|
998
|
+
row: Nt(t),
|
|
783
999
|
value: i
|
|
784
1000
|
};
|
|
785
1001
|
}
|
|
786
|
-
function
|
|
1002
|
+
function W(e, t) {
|
|
787
1003
|
return {
|
|
788
1004
|
definition: e,
|
|
789
1005
|
field: e.field,
|
|
@@ -792,9 +1008,9 @@ function mt(e, t) {
|
|
|
792
1008
|
label: e.label
|
|
793
1009
|
};
|
|
794
1010
|
}
|
|
795
|
-
function
|
|
1011
|
+
function It(e, t, n, r, i, a, o) {
|
|
796
1012
|
return {
|
|
797
|
-
column:
|
|
1013
|
+
column: W(i, a),
|
|
798
1014
|
row: {
|
|
799
1015
|
data: e.row,
|
|
800
1016
|
dataIndex: e.dataIndex,
|
|
@@ -807,31 +1023,31 @@ function ht(e, t, n, r, i, a, o) {
|
|
|
807
1023
|
value: o
|
|
808
1024
|
};
|
|
809
1025
|
}
|
|
810
|
-
function
|
|
1026
|
+
function Lt(e, t) {
|
|
811
1027
|
let n = e.cell?.props;
|
|
812
1028
|
return typeof n == "function" ? n(t) : n;
|
|
813
1029
|
}
|
|
814
|
-
function
|
|
1030
|
+
function Rt(e, t) {
|
|
815
1031
|
return e === void 0 ? !0 : typeof e == "boolean" ? e : e(t);
|
|
816
1032
|
}
|
|
817
|
-
function
|
|
818
|
-
return e?.disabled !== void 0 &&
|
|
1033
|
+
function zt(e, t) {
|
|
1034
|
+
return e?.disabled !== void 0 && Rt(e.disabled, t) === !0;
|
|
819
1035
|
}
|
|
820
|
-
function
|
|
1036
|
+
function Bt(e, t) {
|
|
821
1037
|
let n = e?.className;
|
|
822
1038
|
return typeof n == "function" ? n(t) : n;
|
|
823
1039
|
}
|
|
824
|
-
function
|
|
1040
|
+
function Vt(e, t) {
|
|
825
1041
|
let n = e?.style;
|
|
826
1042
|
return typeof n == "function" ? n(t) : n;
|
|
827
1043
|
}
|
|
828
|
-
function
|
|
1044
|
+
function Ht(e, t, n) {
|
|
829
1045
|
return e.cell?.format ? e.cell.format(n) : t == null ? "" : String(t);
|
|
830
1046
|
}
|
|
831
|
-
function
|
|
832
|
-
let r = e.columnState[t.id], i =
|
|
1047
|
+
function Ut(e, t, n) {
|
|
1048
|
+
let r = e.columnState[t.id], i = un(e.sortModel, t.id);
|
|
833
1049
|
return {
|
|
834
|
-
column:
|
|
1050
|
+
column: W(t, n),
|
|
835
1051
|
layout: {
|
|
836
1052
|
hidden: r?.hidden === !0 || t.hidden === !0,
|
|
837
1053
|
width: r?.width ?? t.width
|
|
@@ -844,17 +1060,17 @@ function St(e, t, n) {
|
|
|
844
1060
|
}
|
|
845
1061
|
};
|
|
846
1062
|
}
|
|
847
|
-
function
|
|
1063
|
+
function Wt(e) {
|
|
848
1064
|
return "row" in e && "selection" in e;
|
|
849
1065
|
}
|
|
850
|
-
function
|
|
851
|
-
return !
|
|
1066
|
+
function Gt(e, t) {
|
|
1067
|
+
return !Wt(t) || e.type !== "input" && e.type !== "select" || t.selection.selectedRowCount === 1 && t.row.selected;
|
|
852
1068
|
}
|
|
853
|
-
function
|
|
854
|
-
return (e ?? []).filter((e) =>
|
|
1069
|
+
function Kt(e, t) {
|
|
1070
|
+
return (e ?? []).filter((e) => Gt(e, t));
|
|
855
1071
|
}
|
|
856
|
-
function
|
|
857
|
-
return
|
|
1072
|
+
function qt(e, t, n, r) {
|
|
1073
|
+
return Kt(e, t).map((e, t) => ({
|
|
858
1074
|
component: e,
|
|
859
1075
|
index: t
|
|
860
1076
|
})).filter(({ component: e }) => (e.direction ?? "left") === n).map(({ component: e, index: i }) => /* @__PURE__ */ A("span", {
|
|
@@ -862,14 +1078,64 @@ function Et(e, t, n, r) {
|
|
|
862
1078
|
"data-comins-component-align": e.align ?? "center",
|
|
863
1079
|
"data-comins-component-direction": n,
|
|
864
1080
|
"data-comins-component-id": e.id ?? `${e.type}-${i}`,
|
|
865
|
-
children:
|
|
1081
|
+
children: Ze(e, t, r)
|
|
866
1082
|
}, e.id ?? `${e.type}-${i}`));
|
|
867
1083
|
}
|
|
868
|
-
function
|
|
1084
|
+
function G(e) {
|
|
1085
|
+
e.preventDefault(), e.stopPropagation();
|
|
1086
|
+
}
|
|
1087
|
+
function Jt(e) {
|
|
1088
|
+
e.stopPropagation(), e.target instanceof HTMLElement && e.target.blur();
|
|
1089
|
+
}
|
|
1090
|
+
var Yt = /* @__PURE__ */ new WeakSet();
|
|
1091
|
+
function Xt(e) {
|
|
1092
|
+
if (!e || Yt.has(e)) return;
|
|
1093
|
+
let t = (t) => {
|
|
1094
|
+
e.hasAttribute("inert") && e.getAttribute("aria-hidden") === "true" && (t.preventDefault(), t.stopPropagation());
|
|
1095
|
+
};
|
|
1096
|
+
e.addEventListener("change", t, !0), e.addEventListener("input", t, !0), Yt.add(e);
|
|
1097
|
+
}
|
|
1098
|
+
var Zt = {
|
|
1099
|
+
onBeforeInputCapture: G,
|
|
1100
|
+
onBlurCapture: G,
|
|
1101
|
+
onChangeCapture: G,
|
|
1102
|
+
onClickCapture: G,
|
|
1103
|
+
onContextMenuCapture: G,
|
|
1104
|
+
onDoubleClickCapture: G,
|
|
1105
|
+
onFocusCapture: Jt,
|
|
1106
|
+
onInputCapture: G,
|
|
1107
|
+
onKeyDownCapture: G,
|
|
1108
|
+
onKeyPressCapture: G,
|
|
1109
|
+
onKeyUpCapture: G,
|
|
1110
|
+
onMouseDownCapture: G,
|
|
1111
|
+
onMouseMoveCapture: G,
|
|
1112
|
+
onMouseOutCapture: G,
|
|
1113
|
+
onMouseOverCapture: G,
|
|
1114
|
+
onMouseUpCapture: G,
|
|
1115
|
+
onPointerCancelCapture: G,
|
|
1116
|
+
onPointerDownCapture: G,
|
|
1117
|
+
onPointerMoveCapture: G,
|
|
1118
|
+
onPointerOutCapture: G,
|
|
1119
|
+
onPointerOverCapture: G,
|
|
1120
|
+
onPointerUpCapture: G,
|
|
1121
|
+
onResetCapture: G,
|
|
1122
|
+
onScrollCapture: G,
|
|
1123
|
+
onSubmitCapture: G,
|
|
1124
|
+
onTouchCancelCapture: G,
|
|
1125
|
+
onTouchEndCapture: G,
|
|
1126
|
+
onTouchMoveCapture: G,
|
|
1127
|
+
onTouchStartCapture: G,
|
|
1128
|
+
onWheelCapture: G
|
|
1129
|
+
};
|
|
1130
|
+
function Qt(e, t) {
|
|
1131
|
+
let n = (e) => typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(n).join("") : ke(e) && typeof e.type == "string" ? n(e.props.children) : "";
|
|
1132
|
+
return n(e).trim() || t;
|
|
1133
|
+
}
|
|
1134
|
+
function $t(e, t, n, r = {}) {
|
|
869
1135
|
if (!t?.length) return e;
|
|
870
|
-
let i = r.showContent ?? !0, a =
|
|
1136
|
+
let i = r.showContent ?? !0, a = Kt(t, n);
|
|
871
1137
|
if (!a.length) return e;
|
|
872
|
-
let o =
|
|
1138
|
+
let o = qt(a, n, "left", r.interaction), s = qt(a, n, "right", r.interaction);
|
|
873
1139
|
return i ? /* @__PURE__ */ j("span", {
|
|
874
1140
|
className: "comins-table__component-layout",
|
|
875
1141
|
children: [
|
|
@@ -898,48 +1164,48 @@ function Dt(e, t, n, r = {}) {
|
|
|
898
1164
|
})
|
|
899
1165
|
});
|
|
900
1166
|
}
|
|
901
|
-
function
|
|
902
|
-
return Math.max(
|
|
1167
|
+
function en(e) {
|
|
1168
|
+
return Math.max(St, e.minWidth ?? St);
|
|
903
1169
|
}
|
|
904
|
-
function
|
|
1170
|
+
function tn(e) {
|
|
905
1171
|
return e.maxWidth ?? Infinity;
|
|
906
1172
|
}
|
|
907
|
-
function
|
|
1173
|
+
function nn(e, t) {
|
|
908
1174
|
return e.columnState[t.id]?.width ?? t.width ?? 100;
|
|
909
1175
|
}
|
|
910
|
-
function
|
|
1176
|
+
function rn(e, t, n) {
|
|
911
1177
|
return Math.min(n, Math.max(t, e));
|
|
912
1178
|
}
|
|
913
|
-
function
|
|
914
|
-
let r = t.map((t) =>
|
|
1179
|
+
function an(e, t, n) {
|
|
1180
|
+
let r = t.map((t) => rn(nn(e, t), en(t), tn(t))), i = new Set(t.map((e, t) => t)), a = t.map(en), o = t.map(tn), s = rn(n, a.reduce((e, t) => e + t, 0), o.reduce((e, t) => e + t, 0));
|
|
915
1181
|
for (; i.size > 0;) {
|
|
916
1182
|
let e = s - r.reduce((e, t) => e + t, 0);
|
|
917
1183
|
if (Math.abs(e) < .001) break;
|
|
918
1184
|
let t = [...i], n = t.reduce((e, t) => e + Math.max(r[t] ?? 0, 0), 0), c = !1;
|
|
919
1185
|
for (let s of t) {
|
|
920
|
-
let l = r[s] ?? 0, u = l + e * (n > 0 ? l / n : 1 / t.length), d =
|
|
1186
|
+
let l = r[s] ?? 0, u = l + e * (n > 0 ? l / n : 1 / t.length), d = rn(u, a[s] ?? 0, o[s] ?? Infinity);
|
|
921
1187
|
r[s] = d, Math.abs(d - u) > .001 && (i.delete(s), c = !0);
|
|
922
1188
|
}
|
|
923
1189
|
if (!c) break;
|
|
924
1190
|
}
|
|
925
1191
|
return r;
|
|
926
1192
|
}
|
|
927
|
-
function
|
|
1193
|
+
function on(e, t, n) {
|
|
928
1194
|
let r = e.columnGroups.find((e) => e.children.includes(t));
|
|
929
1195
|
if (!r || e.columnGroupState[r.id]?.hidden === !0) return _e(e, t, n);
|
|
930
1196
|
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);
|
|
931
1197
|
if (!a) return _e(e, t, n);
|
|
932
1198
|
let o = i.filter((e) => e.id !== t);
|
|
933
1199
|
if (o.length === 0) {
|
|
934
|
-
let r =
|
|
935
|
-
return _e(e, t,
|
|
1200
|
+
let r = nn(e, a);
|
|
1201
|
+
return _e(e, t, rn(n, en(a), Math.min(tn(a), r)));
|
|
936
1202
|
}
|
|
937
|
-
let s = i.reduce((t, n) => t +
|
|
1203
|
+
let s = i.reduce((t, n) => t + nn(e, n), 0), c = o.reduce((e, t) => e + en(t), 0), l = o.reduce((e, t) => e + tn(t), 0), u = Math.max(en(a), s - l), d = rn(n, u, Math.max(u, Math.min(tn(a), s - c))), f = an(e, o, s - d), p = _e(e, t, d);
|
|
938
1204
|
return o.forEach((e, t) => {
|
|
939
|
-
p = _e(p, e.id, f[t] ??
|
|
1205
|
+
p = _e(p, e.id, f[t] ?? nn(p, e));
|
|
940
1206
|
}), p;
|
|
941
1207
|
}
|
|
942
|
-
function
|
|
1208
|
+
function sn(e, t, n) {
|
|
943
1209
|
if (!e || typeof e != "object") return e;
|
|
944
1210
|
let r = t.split("."), [i] = r;
|
|
945
1211
|
if (!i) return e;
|
|
@@ -953,7 +1219,7 @@ function Mt(e, t, n) {
|
|
|
953
1219
|
o[e] = a, n && (o = a);
|
|
954
1220
|
}), o[r.at(-1)] = n, a;
|
|
955
1221
|
}
|
|
956
|
-
function
|
|
1222
|
+
function cn(e, t) {
|
|
957
1223
|
return e?.columnId === t ? e.direction === "asc" ? {
|
|
958
1224
|
columnId: t,
|
|
959
1225
|
direction: "desc"
|
|
@@ -962,60 +1228,60 @@ function Nt(e, t) {
|
|
|
962
1228
|
direction: "asc"
|
|
963
1229
|
};
|
|
964
1230
|
}
|
|
965
|
-
function
|
|
966
|
-
let r = e.findIndex((e) => e.columnId === t), i =
|
|
1231
|
+
function ln(e, t, n) {
|
|
1232
|
+
let r = e.findIndex((e) => e.columnId === t), i = cn(r < 0 ? null : e[r] ?? null, t);
|
|
967
1233
|
return n ? i ? r < 0 ? [...e, i] : e.map((e, t) => t === r ? i : e) : e.filter((e) => e.columnId !== t) : i ? [i] : [];
|
|
968
1234
|
}
|
|
969
|
-
function
|
|
1235
|
+
function un(e, t) {
|
|
970
1236
|
let n = e.findIndex((e) => e.columnId === t);
|
|
971
1237
|
return n < 0 ? null : {
|
|
972
1238
|
priority: n + 1,
|
|
973
1239
|
rule: e[n]
|
|
974
1240
|
};
|
|
975
1241
|
}
|
|
976
|
-
function
|
|
977
|
-
let n =
|
|
1242
|
+
function dn(e, t) {
|
|
1243
|
+
let n = un(e, t)?.rule;
|
|
978
1244
|
return n ? n.direction : "none";
|
|
979
1245
|
}
|
|
980
|
-
function
|
|
981
|
-
let n =
|
|
1246
|
+
function fn(e, t) {
|
|
1247
|
+
let n = un(e, t);
|
|
982
1248
|
if (!n) return e.length > 1 ? void 0 : "none";
|
|
983
1249
|
if (!(n.priority > 1)) return n.rule.direction === "asc" ? "ascending" : "descending";
|
|
984
1250
|
}
|
|
985
|
-
function
|
|
1251
|
+
function pn(e, t) {
|
|
986
1252
|
return !e || !t ? e === t : e.columnId === t.columnId && e.direction === t.direction;
|
|
987
1253
|
}
|
|
988
|
-
function
|
|
1254
|
+
function mn(e, t) {
|
|
989
1255
|
return e.length === t.length && e.every((e, n) => e.columnId === t[n]?.columnId && e.direction === t[n]?.direction);
|
|
990
1256
|
}
|
|
991
|
-
function
|
|
1257
|
+
function K(e, t) {
|
|
992
1258
|
return e.length === t.length && e.every((e, n) => e === t[n]);
|
|
993
1259
|
}
|
|
994
|
-
function
|
|
995
|
-
if (!
|
|
1260
|
+
function hn(e, t) {
|
|
1261
|
+
if (!K(e.rowIds, t.rowIds)) return !1;
|
|
996
1262
|
let n = new Set(t.columns.map((e) => e.id)), r = e.selection.cell, i = e.selection.range;
|
|
997
1263
|
return !(r && !n.has(r.columnId) || i && (!n.has(i.anchor.columnId) || !n.has(i.focus.columnId)));
|
|
998
1264
|
}
|
|
999
|
-
function
|
|
1265
|
+
function gn(e, t) {
|
|
1000
1266
|
return t.split(".").reduce((e, t) => {
|
|
1001
1267
|
if (!(typeof e != "object" || !e)) return e[t];
|
|
1002
1268
|
}, e);
|
|
1003
1269
|
}
|
|
1004
|
-
function
|
|
1270
|
+
function _n(e, t) {
|
|
1005
1271
|
return typeof e == "number" && typeof t == "number" ? e - t : String(e ?? "").localeCompare(String(t ?? ""));
|
|
1006
1272
|
}
|
|
1007
|
-
function
|
|
1008
|
-
return n.length === 0 ? e :
|
|
1273
|
+
function vn(e, t, n) {
|
|
1274
|
+
return n.length === 0 ? e : lt(e, (e, r) => {
|
|
1009
1275
|
for (let i of n) {
|
|
1010
1276
|
let n = t.find((e) => (e.id ?? e.field) === i.columnId);
|
|
1011
1277
|
if (!n?.sort) continue;
|
|
1012
|
-
let a =
|
|
1278
|
+
let a = gn(e, n.field), o = gn(r, n.field), s = typeof n.sort == "function" ? n.sort(a, o, e, r) : _n(a, o);
|
|
1013
1279
|
if (s !== 0) return i.direction === "desc" ? s * -1 : s;
|
|
1014
1280
|
}
|
|
1015
1281
|
return 0;
|
|
1016
1282
|
});
|
|
1017
1283
|
}
|
|
1018
|
-
function
|
|
1284
|
+
function yn(e, t, n, r, i) {
|
|
1019
1285
|
if (t?.length === 0) return e;
|
|
1020
1286
|
let a = [], o = /* @__PURE__ */ new Map(), s = 0, c = (e, t) => {
|
|
1021
1287
|
e.forEach((e) => {
|
|
@@ -1047,185 +1313,504 @@ function Gt(e, t, n, r, i) {
|
|
|
1047
1313
|
};
|
|
1048
1314
|
return m(e);
|
|
1049
1315
|
}
|
|
1050
|
-
function
|
|
1051
|
-
let B = O(null),
|
|
1316
|
+
function bn({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroups: l, columns: u, data: d, "data-testid": f, emptyComponent: p, estimatedRowDetailHeight: m, expandedRowIds: h, getRowDetailHeight: v, getRowId: y, hasMoreRows: ee = !1, infiniteScroll: ne = !1, infiniteScrollThreshold: ie = 160, lazyLoad: x = !1, lazyLoadBatchSize: se = 30, lazyLoadMode: ce = "append", lazyLoadThreshold: me, loading: ge = !1, loadingComponent: ve, loadingMore: ye = !1, multiSort: Se = !1, onChangeColumnLayout: Ce, onChangeData: Te, onChangeSelection: Oe, onChangeSort: ke, onChangeSortModel: Ne, onClickCell: Pe, onClickRow: Fe, onContextMenuCell: Ie, onContextMenuRow: Le, onChangeExpandedRowIds: M, onDoubleClickCell: N, onDoubleClickRow: ze, onKeyDownCell: Be, onKeyDownRow: Ve, onLazyLoad: He, onLoadMore: Ue, pagination: We, persistHeaderWhenEmpty: P = !0, rowHeight: F = 36, rowProps: Ge, isRowExpandable: Ke, renderRowDetail: qe, showColumnMoveHandle: Je = !0, showHeader: Ye = !0, skeletonRowCount: Xe, style: Ze, summary: I, theme: nt, treeContext: L, virtualized: R = !1 }, it) {
|
|
1317
|
+
let z = O(null), at = O(null), B = O(null), ot = O(null), st = O(null), ct = O(null), lt = O(/* @__PURE__ */ new Map()), V = O(/* @__PURE__ */ new Map()), ut = O(/* @__PURE__ */ new Set()), H = O(null), yt = O(/* @__PURE__ */ new Set()), St = O(null), kt = O(/* @__PURE__ */ new Map()), U = O(null), W = O(null), Rt = O(null), Wt = O(null), Gt = O(/* @__PURE__ */ new Map()), G = O(null), Jt = O(null), Yt = O(null), nn = O(He), an = O(0), cn = O(null), K = O(null), gn = O(null), _n = O(null), vn = O(!1), yn = O(null), bn = O(0), xn = O(null), q = O(null), Sn = O(0), Cn = O(null), wn = O(null), Tn = O(null), En = O(null), [Dn, On] = k(0), [kn, An] = k(0), [jn, Mn] = k(0), [Nn, Pn] = k(null), [Fn, In] = k(null), [Ln, Rn] = k(null), [zn, Bn] = k(null), [Vn, Hn] = k(null), [Un, Wn] = k(null), [Gn, Kn] = k(null), [qn, Jn] = k(0), Yn = Ae(), Xn = d, [J, Zn] = k(() => c({
|
|
1052
1318
|
columnGroups: l,
|
|
1053
1319
|
columns: u,
|
|
1054
|
-
getRowId:
|
|
1055
|
-
pagination:
|
|
1056
|
-
rows:
|
|
1057
|
-
showHeader:
|
|
1058
|
-
theme:
|
|
1059
|
-
})),
|
|
1320
|
+
getRowId: y,
|
|
1321
|
+
pagination: We,
|
|
1322
|
+
rows: Xn,
|
|
1323
|
+
showHeader: Ye,
|
|
1324
|
+
theme: nt
|
|
1325
|
+
})), Y = O(J), Qn = O({
|
|
1060
1326
|
columnGroups: l,
|
|
1061
1327
|
columns: u,
|
|
1062
|
-
data:
|
|
1063
|
-
getRowId:
|
|
1064
|
-
pagination:
|
|
1065
|
-
showHeader:
|
|
1066
|
-
}),
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1328
|
+
data: Xn,
|
|
1329
|
+
getRowId: y,
|
|
1330
|
+
pagination: We,
|
|
1331
|
+
showHeader: Ye
|
|
1332
|
+
}), $n = Math.max(0, Math.floor(Number.isFinite(e) ? Number(e) : 10)), er = Math.max(1, Math.floor(se)), tr = Math.max(0, Math.floor(me ?? ie)), nr = typeof He == "function", rr = typeof qe == "function" && !L, ir = D(() => {
|
|
1333
|
+
let e = /* @__PURE__ */ new Set();
|
|
1334
|
+
return (h ?? []).filter((t) => e.has(t) ? !1 : (e.add(t), !0));
|
|
1335
|
+
}, [h]), ar = D(() => new Set(ir), [ir]), or = (e, t) => {
|
|
1336
|
+
!rr || !t || !M || M(ar.has(e) ? ir.filter((t) => t !== e) : [...ir, e]);
|
|
1337
|
+
}, sr = () => {
|
|
1338
|
+
let e = U.current;
|
|
1339
|
+
U.current = null, e?.();
|
|
1340
|
+
}, cr = (e) => {
|
|
1341
|
+
sr(), U.current = e;
|
|
1342
|
+
};
|
|
1343
|
+
Me(() => {
|
|
1344
|
+
nn.current = He;
|
|
1345
|
+
}, [He]);
|
|
1346
|
+
let lr = (e) => {
|
|
1347
|
+
let t = nn.current;
|
|
1348
|
+
if (!x || ce !== "append" || !t || Yt.current) return;
|
|
1349
|
+
let n = Y.current.rows.length;
|
|
1350
|
+
if (e === "scroll" && (!ee || ge || ye)) return;
|
|
1351
|
+
let r = new AbortController(), i = an.current + 1, a = e === "scroll" ? n : 0;
|
|
1352
|
+
an.current = i, Jt.current?.abort(), Jt.current = r, Yt.current = e, e !== "scroll" && (Sn.current = 0, Jn(0), z.current && (z.current.scrollTop = 0));
|
|
1353
|
+
let o;
|
|
1354
|
+
try {
|
|
1355
|
+
o = t({
|
|
1356
|
+
limit: er,
|
|
1357
|
+
offset: a,
|
|
1358
|
+
reason: e,
|
|
1359
|
+
signal: r.signal
|
|
1360
|
+
});
|
|
1361
|
+
} catch {
|
|
1362
|
+
Yt.current = null, Jt.current = null;
|
|
1363
|
+
return;
|
|
1364
|
+
}
|
|
1365
|
+
Promise.resolve(o).catch(() => {}).finally(() => {
|
|
1366
|
+
an.current === i && (Yt.current = null, Jt.current = null);
|
|
1082
1367
|
});
|
|
1083
1368
|
};
|
|
1084
1369
|
E(() => {
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
U.current = Jt;
|
|
1088
|
-
}, [Jt]), E(() => {
|
|
1089
|
-
y || (et.current = d, qt(d), U.current = void 0, Yt(void 0));
|
|
1090
|
-
}, [d, y]), E(() => {
|
|
1091
|
-
if (!(!y || !M)) return ln("initial"), () => {
|
|
1092
|
-
Qe.current += 1, Ze.current = null, Xe.current?.abort(), Xe.current = null;
|
|
1370
|
+
if (!(!x || !nr)) return lr("initial"), () => {
|
|
1371
|
+
an.current += 1, Yt.current = null, Jt.current?.abort(), Jt.current = null;
|
|
1093
1372
|
};
|
|
1094
1373
|
}, [
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1374
|
+
nr,
|
|
1375
|
+
x,
|
|
1376
|
+
er
|
|
1098
1377
|
]), E(() => {
|
|
1099
|
-
let e =
|
|
1100
|
-
if (e.columns === u && e.columnGroups === l && e.data ===
|
|
1101
|
-
|
|
1378
|
+
let e = Qn.current;
|
|
1379
|
+
if (e.columns === u && e.columnGroups === l && e.data === Xn && e.getRowId === y && e.pagination === We && e.showHeader === Ye) return;
|
|
1380
|
+
Qn.current = {
|
|
1102
1381
|
columnGroups: l,
|
|
1103
1382
|
columns: u,
|
|
1104
|
-
data:
|
|
1105
|
-
getRowId:
|
|
1106
|
-
pagination:
|
|
1107
|
-
showHeader:
|
|
1383
|
+
data: Xn,
|
|
1384
|
+
getRowId: y,
|
|
1385
|
+
pagination: We,
|
|
1386
|
+
showHeader: Ye
|
|
1108
1387
|
};
|
|
1109
|
-
let t =
|
|
1388
|
+
let t = Y.current, n = c({
|
|
1110
1389
|
columnLayout: pe(t),
|
|
1111
1390
|
columnGroups: l,
|
|
1112
1391
|
columns: u,
|
|
1113
|
-
getRowId:
|
|
1114
|
-
pagination:
|
|
1115
|
-
rows:
|
|
1116
|
-
showHeader:
|
|
1392
|
+
getRowId: y,
|
|
1393
|
+
pagination: We ?? t.pagination,
|
|
1394
|
+
rows: Xn,
|
|
1395
|
+
showHeader: Ye,
|
|
1117
1396
|
sortModel: t.sortModel,
|
|
1118
1397
|
theme: t.theme
|
|
1119
|
-
}), r =
|
|
1398
|
+
}), r = hn(t, n) ? {
|
|
1120
1399
|
...n,
|
|
1121
1400
|
selection: t.selection
|
|
1122
1401
|
} : n;
|
|
1123
|
-
|
|
1402
|
+
if (e.getRowId !== y) {
|
|
1403
|
+
let e = new Map(t.rowIds.map((e, n) => [e, t.rows[n]]));
|
|
1404
|
+
r.rowIds.forEach((t, n) => {
|
|
1405
|
+
e.has(t) && e.get(t) !== r.rows[n] && lt.current.delete(t);
|
|
1406
|
+
});
|
|
1407
|
+
}
|
|
1408
|
+
Y.current = r, Zn(r), pn(r.sort, t.sort) || ke?.(r.sort), mn(r.sortModel, t.sortModel) || Ne?.(r.sortModel);
|
|
1124
1409
|
}, [
|
|
1125
1410
|
l,
|
|
1126
1411
|
u,
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1412
|
+
Xn,
|
|
1413
|
+
y,
|
|
1414
|
+
We,
|
|
1415
|
+
Ye
|
|
1131
1416
|
]), E(() => {
|
|
1132
|
-
|
|
1133
|
-
}, [
|
|
1134
|
-
|
|
1135
|
-
}, [
|
|
1136
|
-
|
|
1417
|
+
Y.current = J;
|
|
1418
|
+
}, [J]), E(() => {
|
|
1419
|
+
cn.current !== null && cn.current !== J.rows.length && (cn.current = null);
|
|
1420
|
+
}, [J.rows.length]), E(() => () => {
|
|
1421
|
+
sr(), Tn.current !== null && window.cancelAnimationFrame(Tn.current), wn.current !== null && window.clearTimeout(wn.current);
|
|
1137
1422
|
}, []), E(() => {
|
|
1138
|
-
let e =
|
|
1423
|
+
let e = z.current;
|
|
1139
1424
|
if (!e || typeof ResizeObserver > "u") return;
|
|
1140
1425
|
let t = new ResizeObserver(([e]) => {
|
|
1141
|
-
e && (
|
|
1426
|
+
e && (On(e.contentRect.height), An(e.contentRect.width));
|
|
1142
1427
|
});
|
|
1143
1428
|
return t.observe(e), () => t.disconnect();
|
|
1429
|
+
}, []), E(() => {
|
|
1430
|
+
vt(lt.current, new Set(J.rowIds));
|
|
1431
|
+
}, [J.rowIds]);
|
|
1432
|
+
let ur = (e, t, n, r) => {
|
|
1433
|
+
let i = e.projection;
|
|
1434
|
+
if (!i || r !== e.contentWidth) return !1;
|
|
1435
|
+
let a = i.slotIndexByRowId.get(t), o = a === void 0 ? void 0 : i.slots[a];
|
|
1436
|
+
if (a === void 0 || o?.detail?.mode !== "auto") return !1;
|
|
1437
|
+
let s = i.heightIndex.getHeight(a) - o.detail.height + n, c = i.heightIndex.updateHeight(a, s);
|
|
1438
|
+
return o.detail.estimated = !1, o.detail.height = n, c !== 0;
|
|
1439
|
+
}, dr = (e) => {
|
|
1440
|
+
let t = St.current;
|
|
1441
|
+
if (!t) return;
|
|
1442
|
+
let n = e.filter(({ height: e, rowId: t, width: n }) => {
|
|
1443
|
+
let r = lt.current.get(t);
|
|
1444
|
+
return !r || r.width !== n || Math.abs(r.height - e) >= .5;
|
|
1445
|
+
});
|
|
1446
|
+
if (n.length === 0) return;
|
|
1447
|
+
let r = t.projection, i = z.current, a = i?.clientHeight || t.viewportHeight, o = q.current, s = o?.status === "pending" ? o : !o && r && i ? Dt({
|
|
1448
|
+
logicalScrollTop: xn.current && Math.abs(i.scrollTop - xn.current.actualPhysical) <= .5 ? xn.current.targetLogical : void 0,
|
|
1449
|
+
physicalScrollTop: i.scrollTop,
|
|
1450
|
+
projection: {
|
|
1451
|
+
heightIndex: r.heightIndex,
|
|
1452
|
+
keys: r.keys,
|
|
1453
|
+
mixed: !0
|
|
1454
|
+
},
|
|
1455
|
+
viewportHeight: a
|
|
1456
|
+
}) : void 0, c = !1;
|
|
1457
|
+
for (let e of n) lt.current.set(e.rowId, {
|
|
1458
|
+
height: e.height,
|
|
1459
|
+
width: e.width
|
|
1460
|
+
}), c = ur(t, e.rowId, e.height, e.width) || c;
|
|
1461
|
+
if (s && c && o?.status !== "pending") {
|
|
1462
|
+
let e = bn.current + 1;
|
|
1463
|
+
bn.current = e, q.current = {
|
|
1464
|
+
...s,
|
|
1465
|
+
revision: e,
|
|
1466
|
+
status: "pending"
|
|
1467
|
+
};
|
|
1468
|
+
}
|
|
1469
|
+
(c || !r) && Mn((e) => e + 1);
|
|
1470
|
+
}, fr = () => {
|
|
1471
|
+
if (typeof ResizeObserver > "u") return null;
|
|
1472
|
+
let e = new ResizeObserver((e) => {
|
|
1473
|
+
let t = [];
|
|
1474
|
+
for (let n of e) {
|
|
1475
|
+
let e = V.current.get(n.target);
|
|
1476
|
+
if (!e) continue;
|
|
1477
|
+
let r = (Array.isArray(n.borderBoxSize) ? n.borderBoxSize[0] : n.borderBoxSize)?.blockSize ?? n.target.getBoundingClientRect().height, i = Math.round(n.target.getBoundingClientRect().width);
|
|
1478
|
+
Number.isFinite(r) && r > 0 && t.push({
|
|
1479
|
+
height: r,
|
|
1480
|
+
rowId: e.rowId,
|
|
1481
|
+
width: i
|
|
1482
|
+
});
|
|
1483
|
+
}
|
|
1484
|
+
dr(t);
|
|
1485
|
+
});
|
|
1486
|
+
H.current = e;
|
|
1487
|
+
for (let t of V.current.values()) yt.current.add(t.element), e.observe(t.element);
|
|
1488
|
+
return e;
|
|
1489
|
+
};
|
|
1490
|
+
Me(() => () => {
|
|
1491
|
+
H.current?.disconnect(), H.current = null, yt.current.clear(), V.current.clear(), ut.current.clear(), St.current = null;
|
|
1144
1492
|
}, []);
|
|
1145
|
-
let
|
|
1146
|
-
|
|
1147
|
-
},
|
|
1148
|
-
let
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1493
|
+
let pr = () => {
|
|
1494
|
+
V.current.size === 0 && (H.current?.disconnect(), H.current = null, yt.current.clear());
|
|
1495
|
+
}, mr = (e, t, n) => {
|
|
1496
|
+
for (let [t, r] of V.current) r.rowId === e && t !== n && (H.current?.unobserve(t), yt.current.delete(t), V.current.delete(t), ut.current.delete(t));
|
|
1497
|
+
if (!n || t === "fixed") {
|
|
1498
|
+
pr();
|
|
1499
|
+
return;
|
|
1500
|
+
}
|
|
1501
|
+
V.current.set(n, {
|
|
1502
|
+
element: n,
|
|
1503
|
+
rowId: e
|
|
1504
|
+
});
|
|
1505
|
+
}, hr = (e, t, n = {}) => {
|
|
1506
|
+
t.rows !== e.rows && Te?.(t.rows), t.selection !== e.selection && Oe?.(t.selection), n.columnLayoutChanged && Ce?.(pe(t)), pn(t.sort, e.sort) || ke?.(t.sort), mn(t.sortModel, e.sortModel) || Ne?.(t.sortModel);
|
|
1507
|
+
}, X = (e, t = {}) => {
|
|
1508
|
+
let n = Y.current, r = typeof e == "function" ? e(n) : e;
|
|
1509
|
+
Y.current = r, Zn(r), hr(n, r, t);
|
|
1510
|
+
}, Z = D(() => te(J), [J]), gr = /* @__PURE__ */ new Map();
|
|
1511
|
+
E(() => {
|
|
1512
|
+
Gt.current = gr;
|
|
1513
|
+
});
|
|
1514
|
+
let _r = D(() => {
|
|
1515
|
+
let e = Z.length;
|
|
1516
|
+
if (e === 0) return [];
|
|
1517
|
+
let t = Z.map((e) => J.columnState[e.id]?.width ?? e.width);
|
|
1518
|
+
if (kn <= 0) {
|
|
1519
|
+
let n = `${100 / e}%`;
|
|
1520
|
+
return t.map((e, t) => {
|
|
1521
|
+
if (e === void 0) return n;
|
|
1522
|
+
let r = Z[t];
|
|
1523
|
+
return rn(e, en(r), tn(r));
|
|
1524
|
+
});
|
|
1525
|
+
}
|
|
1526
|
+
let n = 0;
|
|
1527
|
+
for (let e of t) n += e ?? 0;
|
|
1528
|
+
let r = Z.filter((e, n) => t[n] === void 0), i = r.length > 0 ? Math.max(0, (kn - n) / r.length) : 0;
|
|
1529
|
+
return Z.map((e, n) => {
|
|
1530
|
+
let r = t[n] ?? i, a = en(e), o = e.maxWidth ?? Infinity;
|
|
1531
|
+
return Math.min(o, Math.max(a, r));
|
|
1532
|
+
});
|
|
1533
|
+
}, [
|
|
1534
|
+
kn,
|
|
1535
|
+
J.columnState,
|
|
1536
|
+
Z
|
|
1537
|
+
]), vr = D(() => {
|
|
1538
|
+
let e = 0;
|
|
1539
|
+
for (let t of _r) {
|
|
1540
|
+
if (typeof t != "number") return;
|
|
1541
|
+
e += t;
|
|
1542
|
+
}
|
|
1543
|
+
return e;
|
|
1544
|
+
}, [_r]), yr = D(() => {
|
|
1545
|
+
if (typeof vr == "number") return Math.max(kn, vr);
|
|
1546
|
+
}, [vr, kn]), br = typeof yr == "number" && Number.isFinite(yr) ? Math.round(yr) : 0, xr = D(() => _(J), [J]), Sr = D(() => I ? rt(L?.summaryRows ?? J.rows, Z, I) : null, [
|
|
1547
|
+
J.rows,
|
|
1152
1548
|
I,
|
|
1153
1549
|
L?.summaryRows,
|
|
1154
|
-
|
|
1155
|
-
]),
|
|
1550
|
+
Z
|
|
1551
|
+
]), Cr = D(() => {
|
|
1156
1552
|
if (!I) return [];
|
|
1157
1553
|
let e = [], t = 0;
|
|
1158
|
-
for (; t <
|
|
1159
|
-
let n =
|
|
1554
|
+
for (; t < Z.length;) {
|
|
1555
|
+
let n = Z[t], r = I.columns[n.id], i = typeof r == "object" && r ? r : void 0, a = i?.colSpan, o = Math.min(typeof a == "number" && Number.isFinite(a) ? Math.max(1, Math.floor(a)) : 1, Z.length - t);
|
|
1160
1556
|
e.push({
|
|
1161
1557
|
className: i?.className,
|
|
1162
1558
|
colSpan: o,
|
|
1163
1559
|
column: n,
|
|
1164
1560
|
style: i?.style,
|
|
1165
|
-
value:
|
|
1561
|
+
value: Sr?.[n.id] ?? (e.length === 0 ? I.label : null)
|
|
1166
1562
|
}), t += o;
|
|
1167
1563
|
}
|
|
1168
1564
|
return e;
|
|
1169
1565
|
}, [
|
|
1170
1566
|
I,
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
]),
|
|
1567
|
+
Sr,
|
|
1568
|
+
Z
|
|
1569
|
+
]), wr = D(() => L || J.sortModel.length === 0 ? null : b(J), [J, L]), Tr = D(() => wr ?? J.rows.map((e, t) => t), [wr, J.rows]), Er = Tr.length, Dr = Math.max(1, J.pagination.pageSize), Or = Math.max(0, J.pagination.pageIndex) * Dr, kr = D(() => {
|
|
1570
|
+
if (!rr) return /* @__PURE__ */ new Set();
|
|
1571
|
+
let e = /* @__PURE__ */ new Set(), t = R ? 0 : Or, n = R ? Tr.length : Math.min(Tr.length, Or + Dr);
|
|
1572
|
+
for (let r = t; r < n; r += 1) {
|
|
1573
|
+
let t = Tr[r];
|
|
1574
|
+
if (t === void 0) continue;
|
|
1575
|
+
let n = J.rows[t], i = J.rowIds[t];
|
|
1576
|
+
if (n === void 0 || i === void 0 || !ar.has(i)) continue;
|
|
1577
|
+
let a = { row: Nt({
|
|
1578
|
+
dataIndex: t,
|
|
1579
|
+
row: n,
|
|
1580
|
+
rowId: i,
|
|
1581
|
+
visibleIndex: r
|
|
1582
|
+
}) };
|
|
1583
|
+
Ke?.(a) !== !1 && e.add(i);
|
|
1584
|
+
}
|
|
1585
|
+
return e;
|
|
1586
|
+
}, [
|
|
1587
|
+
ar,
|
|
1588
|
+
Ke,
|
|
1589
|
+
Dr,
|
|
1590
|
+
Or,
|
|
1591
|
+
Tr,
|
|
1592
|
+
rr,
|
|
1593
|
+
J.rowIds,
|
|
1594
|
+
J.rows,
|
|
1595
|
+
R
|
|
1596
|
+
]), Ar = D(() => {
|
|
1597
|
+
if (!R || kr.size === 0) return null;
|
|
1598
|
+
let e = Math.max(1, F), t = Tr.flatMap((t, n) => {
|
|
1599
|
+
let r = J.rows[t], i = J.rowIds[t];
|
|
1600
|
+
if (r === void 0 || i === void 0) return [];
|
|
1601
|
+
let a = null;
|
|
1602
|
+
if (kr.has(i)) {
|
|
1603
|
+
let e = { row: Nt({
|
|
1604
|
+
dataIndex: t,
|
|
1605
|
+
row: r,
|
|
1606
|
+
rowId: i,
|
|
1607
|
+
visibleIndex: n
|
|
1608
|
+
}) }, o = pt(v?.(e));
|
|
1609
|
+
a = o.mode === "auto" ? {
|
|
1610
|
+
..._t(lt.current, i, br, ft(m, F)),
|
|
1611
|
+
mode: "auto"
|
|
1612
|
+
} : {
|
|
1613
|
+
estimated: !1,
|
|
1614
|
+
height: o.height,
|
|
1615
|
+
mode: "fixed"
|
|
1616
|
+
};
|
|
1617
|
+
}
|
|
1618
|
+
return [dt({
|
|
1619
|
+
dataIndex: t,
|
|
1620
|
+
detail: a,
|
|
1621
|
+
row: r,
|
|
1622
|
+
rowHeight: e,
|
|
1623
|
+
rowId: i,
|
|
1624
|
+
visibleIndex: n
|
|
1625
|
+
})];
|
|
1626
|
+
}), n = mt.from(t.map((t) => ht(t, e))), r = /* @__PURE__ */ new Map();
|
|
1627
|
+
for (let e = 0; e < t.length; e += 1) {
|
|
1628
|
+
let n = t[e]?.rowId;
|
|
1629
|
+
n !== void 0 && !r.has(n) && r.set(n, e);
|
|
1630
|
+
}
|
|
1631
|
+
return {
|
|
1632
|
+
heightIndex: n,
|
|
1633
|
+
keys: t.map((e) => e.key),
|
|
1634
|
+
slotIndexByRowId: r,
|
|
1635
|
+
slots: t
|
|
1636
|
+
};
|
|
1637
|
+
}, [
|
|
1638
|
+
kr,
|
|
1639
|
+
br,
|
|
1640
|
+
m,
|
|
1641
|
+
v,
|
|
1642
|
+
Tr,
|
|
1643
|
+
F,
|
|
1644
|
+
J.rowIds,
|
|
1645
|
+
J.rows,
|
|
1646
|
+
R
|
|
1647
|
+
]), jr = D(() => ({
|
|
1648
|
+
contentWidth: br,
|
|
1649
|
+
projection: Ar,
|
|
1650
|
+
viewportHeight: Dn || Math.max(1, F) * 12
|
|
1651
|
+
}), [
|
|
1652
|
+
Dn,
|
|
1653
|
+
br,
|
|
1654
|
+
Ar,
|
|
1655
|
+
F
|
|
1656
|
+
]);
|
|
1657
|
+
Me(() => {
|
|
1658
|
+
if (St.current = jr, V.current.size === 0) {
|
|
1659
|
+
pr();
|
|
1660
|
+
return;
|
|
1661
|
+
}
|
|
1662
|
+
if (typeof ResizeObserver < "u") {
|
|
1663
|
+
let e = H.current, t = e ?? fr();
|
|
1664
|
+
if (e) for (let e of V.current.values()) yt.current.has(e.element) || (yt.current.add(e.element), t?.observe(e.element));
|
|
1665
|
+
return;
|
|
1666
|
+
}
|
|
1667
|
+
let e = [];
|
|
1668
|
+
for (let t of V.current.values()) {
|
|
1669
|
+
if (ut.current.has(t.element)) continue;
|
|
1670
|
+
ut.current.add(t.element);
|
|
1671
|
+
let n = t.element.getBoundingClientRect();
|
|
1672
|
+
Number.isFinite(n.height) && n.height > 0 && e.push({
|
|
1673
|
+
height: n.height,
|
|
1674
|
+
rowId: t.rowId,
|
|
1675
|
+
width: Math.round(n.width)
|
|
1676
|
+
});
|
|
1677
|
+
}
|
|
1678
|
+
dr(e);
|
|
1679
|
+
});
|
|
1680
|
+
let Mr = D(() => {
|
|
1174
1681
|
if (R) {
|
|
1175
|
-
let e = Math.max(1,
|
|
1682
|
+
let e = Math.max(1, F), t = Dn || F * 12;
|
|
1683
|
+
if (Ar) {
|
|
1684
|
+
let e = Vn && Math.abs(qn - Vn.actualPhysical) <= .5 ? Vn : null, n = gt({
|
|
1685
|
+
heightIndex: Ar.heightIndex,
|
|
1686
|
+
overscan: $n,
|
|
1687
|
+
physicalScrollTop: e?.requestedPhysical ?? qn,
|
|
1688
|
+
viewportHeight: t
|
|
1689
|
+
});
|
|
1690
|
+
return {
|
|
1691
|
+
mixed: !0,
|
|
1692
|
+
renderOffset: e ? e.actualPhysical - (e.targetLogical - n.logicalStartOffset) : n.renderOffset,
|
|
1693
|
+
scrollHeight: n.physicalScrollHeight,
|
|
1694
|
+
slots: Ar.slots.slice(n.startIndex, n.endIndex)
|
|
1695
|
+
};
|
|
1696
|
+
}
|
|
1697
|
+
let n = Er * 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, qn) * o), c = Math.max(0, Math.floor(s / e) - $n), l = Math.min(Er, Math.ceil((s + Math.max(0, t)) / e) + $n), u = c * e;
|
|
1176
1698
|
return {
|
|
1177
|
-
|
|
1178
|
-
renderOffset:
|
|
1179
|
-
scrollHeight: r
|
|
1699
|
+
mixed: !1,
|
|
1700
|
+
renderOffset: o > 0 ? u / o : u,
|
|
1701
|
+
scrollHeight: r,
|
|
1702
|
+
slots: Tt(wr, J.rows, J.rowIds, c, l).map((t) => dt({
|
|
1703
|
+
...t,
|
|
1704
|
+
detail: null,
|
|
1705
|
+
rowHeight: e
|
|
1706
|
+
}))
|
|
1180
1707
|
};
|
|
1181
1708
|
}
|
|
1182
1709
|
return {
|
|
1183
|
-
|
|
1710
|
+
mixed: !1,
|
|
1184
1711
|
renderOffset: 0,
|
|
1185
|
-
scrollHeight: 0
|
|
1712
|
+
scrollHeight: 0,
|
|
1713
|
+
slots: Tt(wr, J.rows, J.rowIds, Or, Or + Dr).map((e) => {
|
|
1714
|
+
let t = null;
|
|
1715
|
+
if (kr.has(e.rowId)) {
|
|
1716
|
+
let n = { row: Nt(e) }, r = pt(v?.(n));
|
|
1717
|
+
t = r.mode === "auto" ? {
|
|
1718
|
+
..._t(lt.current, e.rowId, br, ft(m, F)),
|
|
1719
|
+
mode: "auto"
|
|
1720
|
+
} : {
|
|
1721
|
+
estimated: !1,
|
|
1722
|
+
height: r.height,
|
|
1723
|
+
mode: "fixed"
|
|
1724
|
+
};
|
|
1725
|
+
}
|
|
1726
|
+
return dt({
|
|
1727
|
+
...e,
|
|
1728
|
+
detail: t,
|
|
1729
|
+
rowHeight: F
|
|
1730
|
+
});
|
|
1731
|
+
})
|
|
1186
1732
|
};
|
|
1187
1733
|
}, [
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1734
|
+
Dn,
|
|
1735
|
+
br,
|
|
1736
|
+
jn,
|
|
1737
|
+
kr,
|
|
1738
|
+
m,
|
|
1739
|
+
v,
|
|
1740
|
+
Vn,
|
|
1741
|
+
Ar,
|
|
1742
|
+
Or,
|
|
1743
|
+
F,
|
|
1744
|
+
qn,
|
|
1745
|
+
Dr,
|
|
1746
|
+
wr,
|
|
1747
|
+
J.rowIds,
|
|
1748
|
+
J.rows,
|
|
1749
|
+
$n,
|
|
1197
1750
|
R,
|
|
1198
|
-
|
|
1199
|
-
]),
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1751
|
+
Er
|
|
1752
|
+
]), Q = D(() => R ? Ar ? {
|
|
1753
|
+
heightIndex: Ar.heightIndex,
|
|
1754
|
+
keys: Ar.keys,
|
|
1755
|
+
mixed: !0
|
|
1756
|
+
} : {
|
|
1757
|
+
mixed: !1,
|
|
1758
|
+
projectedDataIndexes: Tr,
|
|
1759
|
+
rowHeight: Math.max(1, F),
|
|
1760
|
+
rowIds: J.rowIds,
|
|
1761
|
+
visibleRowCount: Er
|
|
1762
|
+
} : null, [
|
|
1763
|
+
Ar,
|
|
1764
|
+
Tr,
|
|
1765
|
+
F,
|
|
1766
|
+
J.rowIds,
|
|
1767
|
+
R,
|
|
1768
|
+
Er
|
|
1769
|
+
]), Nr = Cn.current, $ = q.current, Pr = !$ && Q && Nr && Q !== Nr && z.current ? Dt({
|
|
1770
|
+
logicalScrollTop: Vn && Math.abs(z.current.scrollTop - Vn.actualPhysical) <= .5 ? Vn.targetLogical : void 0,
|
|
1771
|
+
physicalScrollTop: z.current.scrollTop,
|
|
1772
|
+
projection: Nr,
|
|
1773
|
+
viewportHeight: z.current.clientHeight || Dn || F * 12
|
|
1774
|
+
}) : void 0, Fr = $?.status === "pending" ? $ : Pr;
|
|
1775
|
+
Me(() => {
|
|
1776
|
+
if (!Q) {
|
|
1777
|
+
Cn.current = null, q.current = null, xn.current = null, Hn(null);
|
|
1778
|
+
return;
|
|
1206
1779
|
}
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
let r = t[n] ?? i, a = Ot(e), o = e.maxWidth ?? Infinity;
|
|
1212
|
-
return Math.min(o, Math.max(a, r));
|
|
1213
|
-
});
|
|
1214
|
-
}, [
|
|
1215
|
-
Ct,
|
|
1216
|
-
X.columnState,
|
|
1217
|
-
$
|
|
1218
|
-
]), Sn = D(() => {
|
|
1219
|
-
let e = 0;
|
|
1220
|
-
for (let t of xn) {
|
|
1221
|
-
if (typeof t != "number") return;
|
|
1222
|
-
e += t;
|
|
1780
|
+
if (Cn.current = Q, $?.status === "cancelled") {
|
|
1781
|
+
let e = q.current;
|
|
1782
|
+
e?.revision === $.revision && e.status === "cancelled" && (q.current = null);
|
|
1783
|
+
return;
|
|
1223
1784
|
}
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1785
|
+
let e = z.current;
|
|
1786
|
+
if (!e || !Fr) return;
|
|
1787
|
+
let t = Et(Q), n = bt({
|
|
1788
|
+
anchor: Fr.anchor,
|
|
1789
|
+
getNextHeight: (e) => Q.mixed ? Q.heightIndex.getHeight(e) : Q.rowHeight,
|
|
1790
|
+
nextKeys: t,
|
|
1791
|
+
previousKeys: Fr.previousKeys
|
|
1792
|
+
}), r = n ? (Q.mixed ? Q.heightIndex.getPrefixHeight(n.index) : n.index * Q.rowHeight) + n.offsetWithinSlot : 0, i = xt(r, Q.mixed ? Q.heightIndex.getTotalHeight() : Q.visibleRowCount * Q.rowHeight, e.clientHeight || Fr.previousViewportHeight);
|
|
1793
|
+
if ($) {
|
|
1794
|
+
let e = q.current;
|
|
1795
|
+
if (e?.revision !== $.revision || e.status !== "pending") return;
|
|
1796
|
+
}
|
|
1797
|
+
if (Tn.current !== null && (window.cancelAnimationFrame(Tn.current), Tn.current = null), e.scrollTop = i, $) {
|
|
1798
|
+
let e = q.current;
|
|
1799
|
+
if (e?.revision !== $.revision || e.status !== "pending") return;
|
|
1800
|
+
}
|
|
1801
|
+
let a = e.scrollTop, o = $?.revision ?? bn.current + 1, s = Q.mixed ? {
|
|
1802
|
+
actualPhysical: a,
|
|
1803
|
+
requestedPhysical: i,
|
|
1804
|
+
revision: o,
|
|
1805
|
+
targetLogical: r
|
|
1806
|
+
} : null;
|
|
1807
|
+
bn.current = Math.max(bn.current, o), $ && (q.current = null), xn.current = s, Sn.current = a, Hn(s), Jn(a);
|
|
1808
|
+
}, [Q, Fr]);
|
|
1809
|
+
let Ir = nt ?? J.theme, Lr = Ir.density === "compact" ? "text-[11px]" : Ir.density === "spacious" ? "text-[13px]" : "text-[length:var(--comins-font-size-base,12px)]", Rr = D(() => new Set(J.selection.rowIds), [J.selection.rowIds]), zr = typeof vr == "number" && kn > 0 && vr > kn + 1, Br = ee, Vr = ge, Hr = ye, Ur = Er === 0, Wr = Vr && Ur, Gr = !Vr && Ur, Kr = (ne || x) && Hr && Br && !Ur, qr = Math.max(1, Math.floor(Xe ?? Math.min(Math.max(1, J.pagination.pageSize), 5))), Jr = (Wr ? qr : +!!Gr) + +!!Kr, Yr = Mr.slots.reduce((e, t) => e + ht(t, F), 0) + Jr * F, Xr = R ? 0 : Math.max(0, Dn - Yr), Zr = J.showHeader && (P || !Ur || Vr), Qr = (e, t) => (e.ctrlKey || e.metaKey) && e.key.toLowerCase() === t, $r = (e) => {
|
|
1810
|
+
let t = Mr.slots[e];
|
|
1811
|
+
return t?.kind === "data" ? t : void 0;
|
|
1812
|
+
}, ei = (e, t, n) => {
|
|
1813
|
+
let r = (L ? e.rows.map((e, t) => t) : b(e)).flatMap((t, n) => {
|
|
1229
1814
|
let r = e.rows[t], i = e.rowIds[t];
|
|
1230
1815
|
return r === void 0 || i === void 0 ? [] : [{
|
|
1231
1816
|
dataIndex: t,
|
|
@@ -1237,54 +1822,68 @@ function Kt({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
|
|
|
1237
1822
|
if (i < 0 || a < 0) return [n];
|
|
1238
1823
|
let o = Math.min(i, a), s = Math.max(i, a);
|
|
1239
1824
|
return r.slice(o, s + 1).map((e) => e.rowId);
|
|
1240
|
-
},
|
|
1241
|
-
|
|
1242
|
-
},
|
|
1243
|
-
|
|
1244
|
-
let t =
|
|
1825
|
+
}, ti = (e, t) => {
|
|
1826
|
+
X((n) => fe(n, ei(n, e, t)));
|
|
1827
|
+
}, ni = (e) => {
|
|
1828
|
+
X((t) => fe(t, e.flatMap((e) => {
|
|
1829
|
+
let t = $r(e);
|
|
1245
1830
|
return t ? [t.rowId] : [];
|
|
1246
1831
|
})));
|
|
1247
|
-
},
|
|
1248
|
-
let e =
|
|
1249
|
-
e && (e.cleanup(), e.timer !== null && window.clearTimeout(e.timer),
|
|
1250
|
-
},
|
|
1251
|
-
|
|
1832
|
+
}, ri = () => {
|
|
1833
|
+
let e = En.current;
|
|
1834
|
+
e && (e.cleanup(), e.timer !== null && window.clearTimeout(e.timer), En.current = null);
|
|
1835
|
+
}, ii = (e) => {
|
|
1836
|
+
En.current?.columnId !== e && (ri(), En.current = {
|
|
1252
1837
|
cleanup: () => void 0,
|
|
1253
1838
|
columnId: e,
|
|
1254
1839
|
timer: null
|
|
1255
1840
|
});
|
|
1256
|
-
},
|
|
1257
|
-
let e =
|
|
1841
|
+
}, ai = () => {
|
|
1842
|
+
let e = En.current;
|
|
1258
1843
|
e && (e.cleanup(), e.cleanup = () => void 0, e.timer = window.setTimeout(() => {
|
|
1259
|
-
|
|
1844
|
+
En.current === e && (En.current = null);
|
|
1260
1845
|
}, 0));
|
|
1261
|
-
},
|
|
1262
|
-
let e =
|
|
1846
|
+
}, oi = () => {
|
|
1847
|
+
let e = En.current;
|
|
1263
1848
|
if (!e) return;
|
|
1264
|
-
let t = () =>
|
|
1849
|
+
let t = () => ai(), n = () => ri(), r = () => ri();
|
|
1265
1850
|
e.cleanup(), e.cleanup = () => {
|
|
1266
1851
|
window.removeEventListener("pointerup", t), window.removeEventListener("pointercancel", n), window.removeEventListener("blur", r);
|
|
1267
1852
|
}, window.addEventListener("pointerup", t, { once: !0 }), window.addEventListener("pointercancel", n, { once: !0 }), window.addEventListener("blur", r, { once: !0 });
|
|
1268
|
-
},
|
|
1269
|
-
e.sort &&
|
|
1270
|
-
},
|
|
1853
|
+
}, si = (e) => En.current?.columnId === e ? (ri(), !0) : !1, ci = (e, t) => {
|
|
1854
|
+
e.sort && X((n) => be(n, ln(n.sortModel, e.id, Se && t)));
|
|
1855
|
+
}, li = (e, t) => {
|
|
1271
1856
|
let n = document.elementFromPoint(e, t)?.closest("[data-comins-column-id], [data-comins-column-group-id]");
|
|
1272
1857
|
if (!n) return null;
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1858
|
+
let r = Number(n.dataset.cominsColumnDepth);
|
|
1859
|
+
if (r !== 0 && r !== 1) return null;
|
|
1860
|
+
if (n.dataset.cominsColumnId) return {
|
|
1861
|
+
depth: r,
|
|
1862
|
+
id: n.dataset.cominsColumnId,
|
|
1863
|
+
kind: "column",
|
|
1864
|
+
parentGroupId: n.dataset.cominsColumnParentGroupId
|
|
1865
|
+
};
|
|
1866
|
+
let i = n.dataset.cominsColumnGroupId;
|
|
1867
|
+
return i ? {
|
|
1868
|
+
depth: r,
|
|
1869
|
+
id: i,
|
|
1870
|
+
kind: "group"
|
|
1871
|
+
} : null;
|
|
1872
|
+
}, ui = (e) => {
|
|
1873
|
+
let t = e.kind === "column" ? e.id : Y.current.columnGroups.find((t) => t.id === e.id)?.children.find((e) => Z.some((t) => t.id === e));
|
|
1874
|
+
return t ? Z.findIndex((e) => e.id === t) : -1;
|
|
1276
1875
|
};
|
|
1277
|
-
je(
|
|
1278
|
-
clearSort: () =>
|
|
1876
|
+
je(it, () => ({
|
|
1877
|
+
clearSort: () => X((e) => i(e)),
|
|
1279
1878
|
expand: (e) => L?.onExpand(e),
|
|
1280
1879
|
fold: (e) => L?.onFold(e),
|
|
1281
|
-
getColumnLayout: () => pe(
|
|
1282
|
-
getSortModel: () =>
|
|
1283
|
-
getSortState: () =>
|
|
1284
|
-
setColumnLayout: (e) =>
|
|
1285
|
-
setMoveTargetRow: (e, t) =>
|
|
1880
|
+
getColumnLayout: () => pe(J),
|
|
1881
|
+
getSortModel: () => J.sortModel,
|
|
1882
|
+
getSortState: () => J.sort,
|
|
1883
|
+
setColumnLayout: (e) => X((n) => t(n, e), { columnLayoutChanged: !0 }),
|
|
1884
|
+
setMoveTargetRow: (e, t) => X((n) => {
|
|
1286
1885
|
if (L) return n;
|
|
1287
|
-
let r =
|
|
1886
|
+
let r = b(n).flatMap((e) => {
|
|
1288
1887
|
let t = n.rowIds[e];
|
|
1289
1888
|
return t === void 0 ? [] : [t];
|
|
1290
1889
|
}), i = r[t];
|
|
@@ -1303,65 +1902,105 @@ function Kt({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
|
|
|
1303
1902
|
sortModel: []
|
|
1304
1903
|
} : n;
|
|
1305
1904
|
}),
|
|
1306
|
-
setSelectedRow: (e) =>
|
|
1307
|
-
setSelectedRows: (e) =>
|
|
1308
|
-
setSortModel: (e) =>
|
|
1309
|
-
setSortState: (e) =>
|
|
1905
|
+
setSelectedRow: (e) => ni([e]),
|
|
1906
|
+
setSelectedRows: (e) => ni(e),
|
|
1907
|
+
setSortModel: (e) => X((t) => be(t, e)),
|
|
1908
|
+
setSortState: (e) => X((t) => xe(t, e))
|
|
1310
1909
|
}), [
|
|
1311
|
-
|
|
1312
|
-
|
|
1910
|
+
Mr.slots,
|
|
1911
|
+
J,
|
|
1313
1912
|
L
|
|
1314
1913
|
]);
|
|
1315
|
-
let
|
|
1316
|
-
let e =
|
|
1317
|
-
e && (e.cleanup(), e.timer !== null && window.clearTimeout(e.timer)),
|
|
1914
|
+
let di = () => {
|
|
1915
|
+
let e = W.current;
|
|
1916
|
+
e && (e.cleanup(), e.timer !== null && window.clearTimeout(e.timer)), W.current = null, Pn(null), In(null), Rn(null), Bn(null);
|
|
1318
1917
|
};
|
|
1319
1918
|
E(() => () => {
|
|
1320
|
-
|
|
1919
|
+
di(), ri(), Rt.current?.();
|
|
1321
1920
|
}, []);
|
|
1322
|
-
let
|
|
1921
|
+
let fi = () => {
|
|
1922
|
+
if (Rt.current?.(), Rt.current = null, Wt.current = null, typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
1923
|
+
let e = [
|
|
1924
|
+
B.current,
|
|
1925
|
+
z.current,
|
|
1926
|
+
at.current
|
|
1927
|
+
].flatMap((e) => e ? Array.from(e.querySelectorAll("[data-comins-column-id], [data-comins-cell-column-id], [data-comins-summary-column-id]")) : []), t = /* @__PURE__ */ new Map();
|
|
1928
|
+
for (let n of e) t.set(n, n.getBoundingClientRect().left);
|
|
1929
|
+
Wt.current = t;
|
|
1930
|
+
};
|
|
1931
|
+
Me(() => {
|
|
1932
|
+
let e = Wt.current;
|
|
1933
|
+
if (Wt.current = null, !e) return;
|
|
1934
|
+
let t = [];
|
|
1935
|
+
for (let [n, r] of e) {
|
|
1936
|
+
if (!n.isConnected) continue;
|
|
1937
|
+
let e = r - n.getBoundingClientRect().left;
|
|
1938
|
+
Math.abs(e) < .5 || (n.dataset.columnMoveAnimating = "prepare", n.style.setProperty("--comins-column-move-offset", `${e}px`), t.push(n));
|
|
1939
|
+
}
|
|
1940
|
+
if (t.length === 0) return;
|
|
1941
|
+
t[0]?.getBoundingClientRect();
|
|
1942
|
+
let n = 0, r = 0, i = () => {
|
|
1943
|
+
window.cancelAnimationFrame(n), window.clearTimeout(r);
|
|
1944
|
+
for (let e of t) delete e.dataset.columnMoveAnimating, e.style.removeProperty("--comins-column-move-offset");
|
|
1945
|
+
Rt.current === i && (Rt.current = null);
|
|
1946
|
+
};
|
|
1947
|
+
return Rt.current = i, n = window.requestAnimationFrame(() => {
|
|
1948
|
+
for (let e of t) e.dataset.columnMoveAnimating = "true", e.style.setProperty("--comins-column-move-offset", "0px");
|
|
1949
|
+
}), r = window.setTimeout(i, 220), i;
|
|
1950
|
+
}, [J.columnOrder]);
|
|
1951
|
+
let pi = (e) => {
|
|
1323
1952
|
if (e.event.button !== 0) return;
|
|
1324
1953
|
let t = e.event.pointerType, n = t === "mouse" || t === "", r = () => {
|
|
1325
|
-
e.sortColumnId &&
|
|
1954
|
+
e.sortColumnId && ii(e.sortColumnId);
|
|
1326
1955
|
}, i = (t, n) => {
|
|
1327
|
-
let i =
|
|
1328
|
-
!i || i !== u || i.active || i.blocked || (i.active = !0, i.cancelSort = !0, r(), e.activate(t, n)
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1956
|
+
let i = W.current;
|
|
1957
|
+
!i || i !== u || i.active || i.blocked || (i.active = !0, i.cancelSort = !0, r(), e.activate(t, n), Bn({
|
|
1958
|
+
...e.source,
|
|
1959
|
+
status: "neutral"
|
|
1960
|
+
}));
|
|
1961
|
+
}, a = (t) => {
|
|
1962
|
+
let a = W.current;
|
|
1963
|
+
if (!(!a || a !== u)) {
|
|
1964
|
+
if (!a.active && !a.blocked && n) {
|
|
1965
|
+
let e = Re({
|
|
1966
|
+
clientX: t.clientX,
|
|
1967
|
+
clientY: t.clientY,
|
|
1968
|
+
startX: a.startX,
|
|
1969
|
+
startY: a.startY
|
|
1338
1970
|
});
|
|
1339
|
-
|
|
1971
|
+
e === "activate" ? i(t.clientX, t.clientY) : e === "cancel" && (a.blocked = !0, a.cancelSort = !0, r());
|
|
1972
|
+
}
|
|
1973
|
+
if (!a.active && !a.blocked && !n && Math.hypot(t.clientX - a.startX, t.clientY - a.startY) > 4 && (a.blocked = !0, a.cancelSort = !0, window.clearTimeout(a.timer ?? void 0), r()), a.active) {
|
|
1974
|
+
t.preventDefault(), Rn({
|
|
1975
|
+
x: t.clientX,
|
|
1976
|
+
y: t.clientY
|
|
1977
|
+
});
|
|
1978
|
+
let n = li(t.clientX, t.clientY);
|
|
1979
|
+
Bn(n ? {
|
|
1980
|
+
...n,
|
|
1981
|
+
status: e.resolveTarget(n)
|
|
1982
|
+
} : null);
|
|
1340
1983
|
}
|
|
1341
|
-
!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(), Bt({
|
|
1342
|
-
x: e.clientX,
|
|
1343
|
-
y: e.clientY
|
|
1344
|
-
}), Ut(Jn(e.clientX, e.clientY)));
|
|
1345
1984
|
}
|
|
1346
1985
|
}, o = (t) => {
|
|
1347
|
-
let n =
|
|
1986
|
+
let n = W.current;
|
|
1348
1987
|
if (n === u && n.active) {
|
|
1349
|
-
let n =
|
|
1350
|
-
n && e.commitTarget(n);
|
|
1988
|
+
let n = li(t.clientX, t.clientY);
|
|
1989
|
+
n && e.resolveTarget(n) === "valid" && e.commitTarget(n);
|
|
1351
1990
|
}
|
|
1352
|
-
n === u && n.cancelSort &&
|
|
1991
|
+
n === u && n.cancelSort && ai(), di();
|
|
1353
1992
|
}, s = () => {
|
|
1354
|
-
|
|
1993
|
+
ri(), di();
|
|
1355
1994
|
}, c = (e) => {
|
|
1356
|
-
e.key === "Escape" && (e.preventDefault(),
|
|
1995
|
+
e.key === "Escape" && (e.preventDefault(), W.current === u && u.cancelSort && oi(), di());
|
|
1357
1996
|
}, l = () => {
|
|
1358
|
-
|
|
1997
|
+
ri(), di();
|
|
1359
1998
|
}, u = {
|
|
1360
1999
|
active: !1,
|
|
1361
2000
|
blocked: !1,
|
|
1362
2001
|
cancelSort: !1,
|
|
1363
2002
|
cleanup: () => {
|
|
1364
|
-
window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o), window.removeEventListener("pointercancel", s), window.removeEventListener("keydown", c), window.removeEventListener("blur", l);
|
|
2003
|
+
window.removeEventListener("pointermove", a, !0), window.removeEventListener("pointerup", o, !0), window.removeEventListener("pointercancel", s, !0), window.removeEventListener("keydown", c), window.removeEventListener("blur", l);
|
|
1365
2004
|
},
|
|
1366
2005
|
id: e.id,
|
|
1367
2006
|
kind: e.kind,
|
|
@@ -1370,123 +2009,155 @@ function Kt({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
|
|
|
1370
2009
|
startY: e.event.clientY,
|
|
1371
2010
|
timer: null
|
|
1372
2011
|
};
|
|
1373
|
-
|
|
1374
|
-
let e =
|
|
2012
|
+
di(), ri(), n || (u.timer = window.setTimeout(() => {
|
|
2013
|
+
let e = W.current;
|
|
1375
2014
|
e === u && !e.active && !e.blocked && i(e.startX, e.startY);
|
|
1376
|
-
}, 1e3)),
|
|
1377
|
-
},
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
2015
|
+
}, 1e3)), W.current = u, window.addEventListener("pointermove", a, !0), window.addEventListener("pointerup", o, !0), window.addEventListener("pointercancel", s, !0), window.addEventListener("keydown", c), window.addEventListener("blur", l), e.activateImmediately && i(u.startX, u.startY);
|
|
2016
|
+
}, mi = (e, t, n = !1) => {
|
|
2017
|
+
let r = t.column;
|
|
2018
|
+
if (r.lockPosition) return;
|
|
2019
|
+
let i = {
|
|
2020
|
+
depth: +!!t.groupId,
|
|
2021
|
+
id: r.id,
|
|
2022
|
+
kind: "column",
|
|
2023
|
+
parentGroupId: t.groupId
|
|
2024
|
+
};
|
|
2025
|
+
pi({
|
|
2026
|
+
activateImmediately: n,
|
|
2027
|
+
activate: (e, t) => {
|
|
2028
|
+
Rn({
|
|
1381
2029
|
x: e,
|
|
1382
|
-
y:
|
|
1383
|
-
}),
|
|
2030
|
+
y: t
|
|
2031
|
+
}), In(null), Pn(r.id);
|
|
1384
2032
|
},
|
|
1385
2033
|
commitTarget: (e) => {
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
r !== e && r.columnOrder.some((t, n) => t !== e.columnOrder[n]) && Q(r, { columnLayoutChanged: !0 });
|
|
2034
|
+
let t = ui(e);
|
|
2035
|
+
if (t >= 0) {
|
|
2036
|
+
let e = Y.current, n = S(e, r.id, t);
|
|
2037
|
+
n !== e && n.columnOrder.some((t, n) => t !== e.columnOrder[n]) && (fi(), X(n, { columnLayoutChanged: !0 }));
|
|
1391
2038
|
}
|
|
1392
2039
|
},
|
|
1393
2040
|
event: e,
|
|
1394
|
-
id:
|
|
2041
|
+
id: r.id,
|
|
1395
2042
|
kind: "column",
|
|
1396
|
-
|
|
2043
|
+
resolveTarget: (e) => {
|
|
2044
|
+
let t = ui(e);
|
|
2045
|
+
if (t < 0) return "invalid";
|
|
2046
|
+
let n = Y.current, a = S(n, r.id, t);
|
|
2047
|
+
return Ct(i, e, a.columnOrder.some((e, t) => e !== n.columnOrder[t]));
|
|
2048
|
+
},
|
|
2049
|
+
sortColumnId: r.id,
|
|
2050
|
+
source: i
|
|
1397
2051
|
});
|
|
1398
|
-
},
|
|
1399
|
-
|
|
2052
|
+
}, hi = (e, t, n = !1) => {
|
|
2053
|
+
if (t.lockPosition) return;
|
|
2054
|
+
let r = {
|
|
2055
|
+
depth: 0,
|
|
2056
|
+
id: t.id,
|
|
2057
|
+
kind: "group"
|
|
2058
|
+
};
|
|
2059
|
+
pi({
|
|
2060
|
+
activateImmediately: n,
|
|
1400
2061
|
activate: (e, n) => {
|
|
1401
|
-
|
|
2062
|
+
Rn({
|
|
1402
2063
|
x: e,
|
|
1403
2064
|
y: n
|
|
1404
|
-
}),
|
|
2065
|
+
}), Pn(null), In(t.id);
|
|
1405
2066
|
},
|
|
1406
2067
|
commitTarget: (e) => {
|
|
1407
|
-
|
|
1408
|
-
let n = $.findIndex((t) => t.id === e);
|
|
2068
|
+
let n = ui(e);
|
|
1409
2069
|
if (n >= 0) {
|
|
1410
|
-
let e =
|
|
1411
|
-
r !== e && r.columnOrder.some((t, n) => t !== e.columnOrder[n]) &&
|
|
2070
|
+
let e = Y.current, r = C(e, t.id, n);
|
|
2071
|
+
r !== e && r.columnOrder.some((t, n) => t !== e.columnOrder[n]) && (fi(), X(r, { columnLayoutChanged: !0 }));
|
|
1412
2072
|
}
|
|
1413
2073
|
},
|
|
1414
2074
|
event: e,
|
|
1415
2075
|
id: t.id,
|
|
1416
|
-
kind: "group"
|
|
2076
|
+
kind: "group",
|
|
2077
|
+
resolveTarget: (e) => {
|
|
2078
|
+
let n = ui(e);
|
|
2079
|
+
if (n < 0) return "invalid";
|
|
2080
|
+
let i = Y.current, a = C(i, t.id, n);
|
|
2081
|
+
return Ct(r, e, a.columnOrder.some((e, t) => e !== i.columnOrder[t]));
|
|
2082
|
+
},
|
|
2083
|
+
source: r
|
|
1417
2084
|
});
|
|
1418
|
-
},
|
|
1419
|
-
if (e.shiftKey &&
|
|
1420
|
-
|
|
2085
|
+
}, gi = (e, t) => {
|
|
2086
|
+
if (e.shiftKey && K.current !== null) {
|
|
2087
|
+
ti(K.current, t.rowId), K.current = t.rowId;
|
|
1421
2088
|
return;
|
|
1422
2089
|
}
|
|
1423
|
-
|
|
2090
|
+
X((n) => de(n, t.rowId, {
|
|
1424
2091
|
multi: e.ctrlKey || e.metaKey,
|
|
1425
2092
|
toggle: e.ctrlKey || e.metaKey
|
|
1426
|
-
})),
|
|
1427
|
-
},
|
|
2093
|
+
})), K.current = t.rowId;
|
|
2094
|
+
}, _i = (e, t, n) => {
|
|
1428
2095
|
if (n) {
|
|
1429
2096
|
e.preventDefault();
|
|
1430
2097
|
return;
|
|
1431
2098
|
}
|
|
1432
|
-
if (
|
|
1433
|
-
if (L && (
|
|
2099
|
+
if (Ve?.(Pt(e, t)), !(e.defaultPrevented || e.target !== e.currentTarget)) {
|
|
2100
|
+
if (L && (Qr(e, "c") || Qr(e, "v"))) {
|
|
1434
2101
|
e.preventDefault();
|
|
1435
2102
|
return;
|
|
1436
2103
|
}
|
|
1437
|
-
if (
|
|
1438
|
-
e.preventDefault(),
|
|
2104
|
+
if (Qr(e, "c")) {
|
|
2105
|
+
e.preventDefault(), ct.current = s(J, t.rowId);
|
|
1439
2106
|
return;
|
|
1440
2107
|
}
|
|
1441
|
-
|
|
2108
|
+
Qr(e, "v") && ct.current && (e.preventDefault(), X((e) => oe(e, ct.current, {
|
|
1442
2109
|
mode: "insert-after",
|
|
1443
2110
|
targetRowId: t.rowId
|
|
1444
2111
|
})));
|
|
1445
2112
|
}
|
|
1446
|
-
},
|
|
2113
|
+
}, vi = (e, t, n, r, i, s) => {
|
|
1447
2114
|
if (s) {
|
|
1448
2115
|
e.preventDefault(), e.stopPropagation();
|
|
1449
2116
|
return;
|
|
1450
2117
|
}
|
|
1451
|
-
if (
|
|
1452
|
-
if (
|
|
1453
|
-
e.preventDefault(), e.stopPropagation(),
|
|
2118
|
+
if (Be?.(Ft(e, t, n, r, g(J, t.row, n.id))), !e.defaultPrevented) {
|
|
2119
|
+
if (Qr(e, "c")) {
|
|
2120
|
+
e.preventDefault(), e.stopPropagation(), st.current = J.selection.range ? o(J) : null, ot.current = st.current ? null : a(J, i);
|
|
1454
2121
|
return;
|
|
1455
2122
|
}
|
|
1456
|
-
|
|
2123
|
+
Qr(e, "v") && (st.current || ot.current) && (e.preventDefault(), e.stopPropagation(), X((e) => st.current ? T(e, i, st.current) : ae(e, i, ot.current)));
|
|
1457
2124
|
}
|
|
1458
|
-
},
|
|
1459
|
-
n && (r || e.button !== 0 || e.shiftKey || (
|
|
1460
|
-
},
|
|
1461
|
-
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) ?
|
|
2125
|
+
}, yi = (e, t, r) => {
|
|
2126
|
+
n && (r || e.button !== 0 || e.shiftKey || (gn.current = t, _n.current = t, vn.current = !1));
|
|
2127
|
+
}, bi = (e, t) => {
|
|
2128
|
+
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) ? J.rowIds[i] : void 0;
|
|
1462
2129
|
return r && a !== void 0 ? {
|
|
1463
2130
|
columnId: r,
|
|
1464
2131
|
rowId: a
|
|
1465
2132
|
} : null;
|
|
1466
|
-
},
|
|
2133
|
+
}, xi = (e) => {
|
|
1467
2134
|
if (!n) return;
|
|
1468
|
-
let t =
|
|
1469
|
-
!t || t.rowId === e.rowId && t.columnId === e.columnId || (
|
|
2135
|
+
let t = gn.current;
|
|
2136
|
+
!t || t.rowId === e.rowId && t.columnId === e.columnId || (vn.current = !0, _n.current = e, G.current = t, X((n) => ue(n, {
|
|
1470
2137
|
anchor: t,
|
|
1471
2138
|
focus: e
|
|
1472
2139
|
})));
|
|
1473
|
-
},
|
|
1474
|
-
n && (
|
|
1475
|
-
},
|
|
1476
|
-
if (
|
|
2140
|
+
}, Si = () => {
|
|
2141
|
+
n && (gn.current = null, _n.current = null);
|
|
2142
|
+
}, Ci = (e, t, n) => {
|
|
2143
|
+
if (yi(e, t, n), n || e.button !== 0 || e.shiftKey) return;
|
|
1477
2144
|
let r = (e) => {
|
|
1478
2145
|
if (e.buttons !== 1) return;
|
|
1479
|
-
let t =
|
|
1480
|
-
t &&
|
|
2146
|
+
let t = bi(e.clientX, e.clientY);
|
|
2147
|
+
t && xi(t);
|
|
1481
2148
|
}, i = () => {
|
|
1482
|
-
|
|
2149
|
+
window.removeEventListener("pointermove", r), window.removeEventListener("pointerup", a), window.removeEventListener("pointercancel", o), window.removeEventListener("blur", o), U.current === i && (U.current = null);
|
|
2150
|
+
}, a = () => {
|
|
2151
|
+
i(), Si();
|
|
2152
|
+
}, o = () => {
|
|
2153
|
+
i(), Si();
|
|
1483
2154
|
};
|
|
1484
|
-
e.preventDefault(), window.addEventListener("pointermove", r), window.addEventListener("pointerup",
|
|
1485
|
-
},
|
|
2155
|
+
e.preventDefault(), cr(i), window.addEventListener("pointermove", r), window.addEventListener("pointerup", a), window.addEventListener("pointercancel", o), window.addEventListener("blur", o);
|
|
2156
|
+
}, wi = (e, t, n, r) => {
|
|
1486
2157
|
if (n || !r || e.button !== 0) return;
|
|
1487
2158
|
e.preventDefault(), e.stopPropagation();
|
|
1488
2159
|
let i = t.rowId, a = (e) => {
|
|
1489
|
-
|
|
2160
|
+
yn.current = e, Kn(e);
|
|
1490
2161
|
}, o = (e, t) => {
|
|
1491
2162
|
let n = document.elementFromPoint(e, t)?.closest("[data-comins-row-data-index]");
|
|
1492
2163
|
if (!n || n.dataset.cominsRowDataIndex === void 0) return;
|
|
@@ -1497,120 +2168,190 @@ function Kt({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
|
|
|
1497
2168
|
});
|
|
1498
2169
|
}, s = (e) => {
|
|
1499
2170
|
e.buttons === 1 && o(e.clientX, e.clientY);
|
|
1500
|
-
}, c = (
|
|
1501
|
-
window.removeEventListener("pointermove", s), window.removeEventListener("pointerup",
|
|
1502
|
-
|
|
1503
|
-
|
|
2171
|
+
}, c = () => {
|
|
2172
|
+
window.removeEventListener("pointermove", s), window.removeEventListener("pointerup", l), window.removeEventListener("pointercancel", u), window.removeEventListener("blur", u), U.current === c && (U.current = null);
|
|
2173
|
+
}, l = (e) => {
|
|
2174
|
+
c(), o(e.clientX, e.clientY);
|
|
2175
|
+
let t = yn.current?.targetDataIndex;
|
|
2176
|
+
a(null), t !== void 0 && X((e) => w(e, i, t));
|
|
2177
|
+
}, u = () => {
|
|
2178
|
+
c(), a(null);
|
|
1504
2179
|
};
|
|
1505
|
-
o(e.clientX, e.clientY), window.addEventListener("pointermove", s), window.addEventListener("pointerup",
|
|
1506
|
-
},
|
|
1507
|
-
if (e.kind === "group")
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
2180
|
+
o(e.clientX, e.clientY), cr(c), window.addEventListener("pointermove", s), window.addEventListener("pointerup", l), window.addEventListener("pointercancel", u), window.addEventListener("blur", u);
|
|
2181
|
+
}, Ti = Nn ? Z.find((e) => e.id === Nn) : void 0, Ei = Fn ? J.columnGroups.find((e) => e.id === Fn) : void 0, Di = Ti ? Qt(Ti.label, Ti.id) : Ei ? Qt(Ei.label, Ei.id) : void 0, Oi = (e, t) => {
|
|
2182
|
+
if (e.kind === "group") {
|
|
2183
|
+
let t = zn?.kind === "group" && zn.id === e.groupId, n = Fn === e.groupId, r = e.group.lockPosition === !0, i = Qt(e.group.label, e.groupId);
|
|
2184
|
+
return /* @__PURE__ */ j("th", {
|
|
2185
|
+
"aria-label": n ? i : void 0,
|
|
2186
|
+
className: ["comins-table__th comins-table__group-th px-3 py-2 text-left font-semibold", n ? "comins-column-moving" : void 0].filter(Boolean).join(" "),
|
|
2187
|
+
colSpan: e.colSpan,
|
|
2188
|
+
"data-column-drop-target": t ? "true" : void 0,
|
|
2189
|
+
"data-column-drop-valid": t && zn.status !== "neutral" ? zn.status === "valid" ? "true" : "false" : void 0,
|
|
2190
|
+
"data-column-moving": n ? "true" : void 0,
|
|
2191
|
+
"data-column-placeholder": n ? "true" : void 0,
|
|
2192
|
+
"data-column-position-locked": r ? "true" : void 0,
|
|
2193
|
+
"data-comins-column-depth": "0",
|
|
2194
|
+
"data-comins-column-group-id": e.groupId,
|
|
2195
|
+
"data-testid": `header-group-${e.groupId}`,
|
|
2196
|
+
onPointerDown: (t) => hi(t, e.group),
|
|
2197
|
+
rowSpan: e.rowSpan,
|
|
2198
|
+
scope: "colgroup",
|
|
2199
|
+
children: [
|
|
2200
|
+
/* @__PURE__ */ A("span", {
|
|
2201
|
+
"aria-hidden": "true",
|
|
2202
|
+
className: "comins-column-drop-marker"
|
|
2203
|
+
}),
|
|
2204
|
+
/* @__PURE__ */ j("span", {
|
|
2205
|
+
...n ? Zt : {},
|
|
2206
|
+
"aria-hidden": n ? "true" : void 0,
|
|
2207
|
+
className: "comins-table__header-content",
|
|
2208
|
+
"data-comins-header-body": "true",
|
|
2209
|
+
inert: n ? !0 : void 0,
|
|
2210
|
+
ref: Xt,
|
|
2211
|
+
children: [Je && !r ? /* @__PURE__ */ A("span", {
|
|
2212
|
+
"aria-hidden": "true",
|
|
2213
|
+
className: "comins-column-move-handle",
|
|
2214
|
+
"data-comins-column-move-handle": "true",
|
|
2215
|
+
"data-testid": `column-group-move-handle-${e.groupId}`,
|
|
2216
|
+
draggable: !1,
|
|
2217
|
+
onClick: (e) => e.stopPropagation(),
|
|
2218
|
+
onPointerDown: (t) => {
|
|
2219
|
+
t.preventDefault(), t.stopPropagation(), hi(t, e.group, !0);
|
|
2220
|
+
},
|
|
2221
|
+
children: /* @__PURE__ */ A(Qe, { name: "columnMove" })
|
|
2222
|
+
}) : null, /* @__PURE__ */ A("span", {
|
|
2223
|
+
className: "comins-table__header-label",
|
|
2224
|
+
children: n ? null : e.group.label
|
|
2225
|
+
})]
|
|
2226
|
+
}),
|
|
2227
|
+
n ? /* @__PURE__ */ A("span", {
|
|
2228
|
+
"aria-hidden": "true",
|
|
2229
|
+
className: "comins-column-placeholder-label",
|
|
2230
|
+
children: i
|
|
2231
|
+
}) : null,
|
|
2232
|
+
/* @__PURE__ */ A("span", {
|
|
2233
|
+
"aria-hidden": "true",
|
|
2234
|
+
className: "comins-table__resize",
|
|
2235
|
+
"data-resizing": Un === e.groupId ? "true" : void 0,
|
|
2236
|
+
"data-testid": `resize-group-${e.groupId}`,
|
|
2237
|
+
onClick: (e) => e.stopPropagation(),
|
|
2238
|
+
onPointerDown: (t) => {
|
|
2239
|
+
t.preventDefault(), t.stopPropagation();
|
|
2240
|
+
let n = t.clientX, r = t.currentTarget.closest("th")?.getBoundingClientRect().width, i = /* @__PURE__ */ new Map();
|
|
2241
|
+
for (let t of e.group.children) {
|
|
2242
|
+
let e = Z.find((e) => e.id === t);
|
|
2243
|
+
if (!e) continue;
|
|
2244
|
+
let n = Array.from(B.current?.querySelectorAll("[data-comins-column-id]") ?? []).find((t) => t.dataset.cominsColumnId === e.id)?.getBoundingClientRect().width, r = Y.current.columnState[e.id]?.width ?? e.width ?? 160;
|
|
2245
|
+
i.set(e.id, n && Number.isFinite(n) ? n : r);
|
|
2246
|
+
}
|
|
2247
|
+
let a = [...i.values()].reduce((e, t) => e + t, 0), o = r && Number.isFinite(r) ? r : Math.max(1, a);
|
|
2248
|
+
Wn(e.groupId);
|
|
2249
|
+
let s = (t) => {
|
|
2250
|
+
X((r) => {
|
|
2251
|
+
let a = r;
|
|
2252
|
+
for (let [e, t] of i) a = _e(a, e, t);
|
|
2253
|
+
return he(a, e.groupId, o + t.clientX - n);
|
|
2254
|
+
}, { columnLayoutChanged: !0 });
|
|
2255
|
+
}, c = () => {
|
|
2256
|
+
window.removeEventListener("pointermove", s), window.removeEventListener("pointerup", l), window.removeEventListener("pointercancel", u), window.removeEventListener("blur", u), U.current === c && (U.current = null);
|
|
2257
|
+
}, l = () => {
|
|
2258
|
+
c(), Wn(null);
|
|
2259
|
+
}, u = () => {
|
|
2260
|
+
c(), Wn(null);
|
|
2261
|
+
};
|
|
2262
|
+
cr(c), window.addEventListener("pointermove", s), window.addEventListener("pointerup", l), window.addEventListener("pointercancel", u), window.addEventListener("blur", u);
|
|
2263
|
+
},
|
|
2264
|
+
children: /* @__PURE__ */ A("span", { className: "comins-table__resize-line" })
|
|
1528
2265
|
})
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
"data-resizing": Xt === e.groupId ? "true" : void 0,
|
|
1534
|
-
"data-testid": `resize-group-${e.groupId}`,
|
|
1535
|
-
onClick: (e) => e.stopPropagation(),
|
|
1536
|
-
onPointerDown: (t) => {
|
|
1537
|
-
t.preventDefault(), t.stopPropagation();
|
|
1538
|
-
let n = t.clientX, r = t.currentTarget.closest("th")?.getBoundingClientRect().width, i = /* @__PURE__ */ new Map();
|
|
1539
|
-
for (let t of e.group.children) {
|
|
1540
|
-
let e = $.find((e) => e.id === t);
|
|
1541
|
-
if (!e) continue;
|
|
1542
|
-
let n = Array.from(V.current?.querySelectorAll("[data-comins-column-id]") ?? []).find((t) => t.dataset.cominsColumnId === e.id)?.getBoundingClientRect().width, r = Z.current.columnState[e.id]?.width ?? e.width ?? 160;
|
|
1543
|
-
i.set(e.id, n && Number.isFinite(n) ? n : r);
|
|
1544
|
-
}
|
|
1545
|
-
let a = [...i.values()].reduce((e, t) => e + t, 0), o = r && Number.isFinite(r) ? r : Math.max(1, a);
|
|
1546
|
-
Zt(e.groupId);
|
|
1547
|
-
let s = (t) => {
|
|
1548
|
-
Q((r) => {
|
|
1549
|
-
let a = r;
|
|
1550
|
-
for (let [e, t] of i) a = _e(a, e, t);
|
|
1551
|
-
return he(a, e.groupId, o + t.clientX - n);
|
|
1552
|
-
}, { columnLayoutChanged: !0 });
|
|
1553
|
-
}, c = () => {
|
|
1554
|
-
Zt(null), window.removeEventListener("pointermove", s), window.removeEventListener("pointerup", c);
|
|
1555
|
-
};
|
|
1556
|
-
window.addEventListener("pointermove", s), window.addEventListener("pointerup", c);
|
|
1557
|
-
},
|
|
1558
|
-
children: /* @__PURE__ */ A("span", { className: "comins-table__resize-line" })
|
|
1559
|
-
})
|
|
1560
|
-
]
|
|
1561
|
-
}, `group-${e.groupId}`);
|
|
1562
|
-
let n = e.column, r = $.findIndex((e) => e.id === n.id), i = r >= 0 ? r : t, a = X.columnState[n.id], o = n.header?.props ?? {}, s = Ft(X.sortModel, n.id), c = It(X.sortModel, n.id), l = c === "asc" || c === "desc", u = s !== null && X.sortModel.length > 1, d = !!lr?.children.includes(n.id), f = J === n.id || d, p = [
|
|
2266
|
+
]
|
|
2267
|
+
}, `group-${e.groupId}`);
|
|
2268
|
+
}
|
|
2269
|
+
let n = e.column, r = Z.findIndex((e) => e.id === n.id), i = r >= 0 ? r : t, a = J.columnState[n.id], o = n.header?.props ?? {}, s = un(J.sortModel, n.id), c = dn(J.sortModel, n.id), l = c === "asc" || c === "desc", u = s !== null && J.sortModel.length > 1, d = !!Ei?.children.includes(n.id), f = Nn === n.id || d, p = Qt(n.label, n.id), m = [
|
|
1563
2270
|
"comins-table__th px-3 py-2 text-left font-semibold",
|
|
1564
|
-
|
|
2271
|
+
Nn === n.id ? "comins-column-moving" : void 0,
|
|
1565
2272
|
o.className
|
|
1566
|
-
].filter(Boolean).join(" "),
|
|
2273
|
+
].filter(Boolean).join(" "), h = Ut(J, n, i), g = n.header?.renderer, _ = g ? Gt.current.get(n.id) : void 0, v = !!g && (!f || _?.renderer !== g), y = g ? v ? g(h) : _?.body : null;
|
|
2274
|
+
g && v ? gr.set(n.id, {
|
|
2275
|
+
body: y,
|
|
2276
|
+
renderer: g
|
|
2277
|
+
}) : g && _ && gr.set(n.id, _);
|
|
2278
|
+
let b = n.header?.renderer ? [] : qt(n.header?.components, h, "left"), ee = n.header?.renderer ? [] : qt(n.header?.components, h, "right"), te = b.length > 0 || ee.length > 0, ne = zn?.kind === "column" && zn.id === n.id, re = n.lockPosition === !0;
|
|
1567
2279
|
return /* @__PURE__ */ De("th", {
|
|
1568
2280
|
...o,
|
|
1569
|
-
|
|
2281
|
+
"aria-label": f ? p : o["aria-label"],
|
|
2282
|
+
"aria-labelledby": f ? void 0 : o["aria-labelledby"],
|
|
2283
|
+
className: m,
|
|
1570
2284
|
colSpan: e.colSpan,
|
|
1571
|
-
"data-column-drop-target":
|
|
1572
|
-
"data-column-
|
|
2285
|
+
"data-column-drop-target": ne ? "true" : void 0,
|
|
2286
|
+
"data-column-drop-valid": ne && zn.status !== "neutral" ? zn.status === "valid" ? "true" : "false" : void 0,
|
|
2287
|
+
"data-column-moving": Nn === n.id ? "true" : void 0,
|
|
1573
2288
|
"data-column-placeholder": f ? "true" : void 0,
|
|
2289
|
+
"data-column-position-locked": re ? "true" : void 0,
|
|
2290
|
+
"data-comins-column-depth": e.groupId ? "1" : "0",
|
|
1574
2291
|
"data-comins-column-id": n.id,
|
|
1575
2292
|
"data-comins-column-index": i,
|
|
1576
|
-
"data-
|
|
2293
|
+
"data-comins-column-parent-group-id": e.groupId,
|
|
2294
|
+
"data-sort-count": s ? J.sortModel.length : void 0,
|
|
1577
2295
|
"data-sort-direction": s?.rule.direction,
|
|
1578
2296
|
"data-sort-priority": s?.priority,
|
|
1579
2297
|
"data-sortable": n.sort ? "true" : "false",
|
|
1580
2298
|
"data-testid": `header-${n.id}`,
|
|
1581
|
-
"aria-sort": n.sort ?
|
|
2299
|
+
"aria-sort": n.sort ? fn(J.sortModel, n.id) : void 0,
|
|
1582
2300
|
key: `column-${n.id}`,
|
|
1583
2301
|
onClick: (e) => {
|
|
1584
|
-
|
|
2302
|
+
if (f) {
|
|
2303
|
+
e.preventDefault();
|
|
2304
|
+
return;
|
|
2305
|
+
}
|
|
2306
|
+
o.onClick?.(e), !(e.defaultPrevented || !n.sort) && (si(n.id) || ci(n, e.shiftKey));
|
|
1585
2307
|
},
|
|
1586
2308
|
onKeyDown: (e) => {
|
|
1587
|
-
|
|
2309
|
+
if (f) {
|
|
2310
|
+
e.preventDefault();
|
|
2311
|
+
return;
|
|
2312
|
+
}
|
|
2313
|
+
o.onKeyDown?.(e), !(e.defaultPrevented || !n.sort) && (e.key === "Enter" || e.key === " " || e.key === "Spacebar") && (e.preventDefault(), ci(n, e.shiftKey));
|
|
1588
2314
|
},
|
|
1589
|
-
onPointerDown: (
|
|
2315
|
+
onPointerDown: (t) => mi(t, e),
|
|
1590
2316
|
rowSpan: e.rowSpan,
|
|
1591
2317
|
scope: "col",
|
|
1592
2318
|
style: {
|
|
1593
2319
|
width: a?.width ?? n.width,
|
|
1594
2320
|
...o.style
|
|
1595
2321
|
},
|
|
1596
|
-
tabIndex: n.sort ? 0 : void 0
|
|
2322
|
+
tabIndex: n.sort && !f ? 0 : void 0
|
|
1597
2323
|
}, /* @__PURE__ */ A("span", {
|
|
1598
2324
|
"aria-hidden": "true",
|
|
1599
2325
|
className: "comins-column-drop-marker"
|
|
1600
2326
|
}), /* @__PURE__ */ j("span", {
|
|
2327
|
+
...f ? Zt : {},
|
|
2328
|
+
"aria-hidden": f ? "true" : void 0,
|
|
1601
2329
|
className: "comins-table__header-content",
|
|
1602
2330
|
"data-comins-header-body": "true",
|
|
1603
|
-
"data-comins-header-components":
|
|
2331
|
+
"data-comins-header-components": te ? "true" : void 0,
|
|
1604
2332
|
"data-comins-sort-indicator-visible": l ? "true" : void 0,
|
|
2333
|
+
inert: f ? !0 : void 0,
|
|
2334
|
+
ref: Xt,
|
|
1605
2335
|
children: [
|
|
1606
|
-
/* @__PURE__ */
|
|
2336
|
+
/* @__PURE__ */ j("span", {
|
|
1607
2337
|
className: "comins-table__header-slot",
|
|
1608
2338
|
"data-comins-header-slot": "left",
|
|
1609
|
-
children:
|
|
2339
|
+
children: [Je && !re ? /* @__PURE__ */ A("span", {
|
|
2340
|
+
"aria-hidden": "true",
|
|
2341
|
+
className: "comins-column-move-handle",
|
|
2342
|
+
"data-comins-column-move-handle": "true",
|
|
2343
|
+
"data-testid": `column-move-handle-${n.id}`,
|
|
2344
|
+
draggable: !1,
|
|
2345
|
+
onClick: (e) => e.stopPropagation(),
|
|
2346
|
+
onPointerDown: (t) => {
|
|
2347
|
+
t.preventDefault(), t.stopPropagation(), mi(t, e, !0);
|
|
2348
|
+
},
|
|
2349
|
+
children: /* @__PURE__ */ A(Qe, { name: "columnMove" })
|
|
2350
|
+
}) : null, b]
|
|
1610
2351
|
}),
|
|
1611
2352
|
/* @__PURE__ */ A("span", {
|
|
1612
2353
|
className: "comins-table__header-label",
|
|
1613
|
-
children: n.header?.renderer ?
|
|
2354
|
+
children: n.header?.renderer ? y : f ? null : n.label
|
|
1614
2355
|
}),
|
|
1615
2356
|
/* @__PURE__ */ j("span", {
|
|
1616
2357
|
className: "comins-sort-meta",
|
|
@@ -1621,12 +2362,7 @@ function Kt({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
|
|
|
1621
2362
|
"data-sort-state": c,
|
|
1622
2363
|
"data-sort-visible": l ? "true" : void 0,
|
|
1623
2364
|
"data-testid": `sort-indicator-${n.id}`,
|
|
1624
|
-
children: /* @__PURE__ */ A(
|
|
1625
|
-
className: "comins-sort-icon",
|
|
1626
|
-
focusable: "false",
|
|
1627
|
-
size: 14,
|
|
1628
|
-
strokeWidth: 2.25
|
|
1629
|
-
})
|
|
2365
|
+
children: /* @__PURE__ */ A(Qe, { name: c === "asc" ? "sortAscending" : c === "desc" ? "sortDescending" : "sortUnsorted" })
|
|
1630
2366
|
}), u ? /* @__PURE__ */ A("span", {
|
|
1631
2367
|
"aria-hidden": "true",
|
|
1632
2368
|
className: "comins-sort-priority",
|
|
@@ -1636,7 +2372,7 @@ function Kt({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
|
|
|
1636
2372
|
}),
|
|
1637
2373
|
u ? /* @__PURE__ */ A("span", {
|
|
1638
2374
|
className: "comins-table__sort-status",
|
|
1639
|
-
children: `Sorted ${s.rule.direction === "asc" ? "ascending" : "descending"}, priority ${s.priority} of ${
|
|
2375
|
+
children: `Sorted ${s.rule.direction === "asc" ? "ascending" : "descending"}, priority ${s.priority} of ${J.sortModel.length}`
|
|
1640
2376
|
}) : null,
|
|
1641
2377
|
/* @__PURE__ */ A("span", {
|
|
1642
2378
|
className: "comins-table__header-slot",
|
|
@@ -1644,126 +2380,137 @@ function Kt({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
|
|
|
1644
2380
|
children: ee
|
|
1645
2381
|
})
|
|
1646
2382
|
]
|
|
1647
|
-
}), /* @__PURE__ */ A("span", {
|
|
2383
|
+
}), f ? /* @__PURE__ */ A("span", {
|
|
2384
|
+
"aria-hidden": "true",
|
|
2385
|
+
className: "comins-column-placeholder-label",
|
|
2386
|
+
children: p
|
|
2387
|
+
}) : null, /* @__PURE__ */ A("span", {
|
|
1648
2388
|
"aria-hidden": "true",
|
|
1649
2389
|
className: "comins-table__resize",
|
|
1650
|
-
"data-resizing":
|
|
2390
|
+
"data-resizing": Un === n.id ? "true" : void 0,
|
|
1651
2391
|
"data-testid": `resize-${n.id}`,
|
|
1652
2392
|
onClick: (e) => e.stopPropagation(),
|
|
1653
2393
|
onPointerDown: (e) => {
|
|
1654
2394
|
e.preventDefault(), e.stopPropagation();
|
|
1655
2395
|
let t = e.clientX, r = e.currentTarget.closest("th")?.getBoundingClientRect().width, i = /* @__PURE__ */ new Map();
|
|
1656
|
-
for (let e of
|
|
1657
|
-
let t = Array.from(
|
|
2396
|
+
for (let e of Z) {
|
|
2397
|
+
let t = Array.from(B.current?.querySelectorAll("[data-comins-column-id]") ?? []).find((t) => t.dataset.cominsColumnId === e.id)?.getBoundingClientRect().width, n = Y.current.columnState[e.id]?.width ?? e.width ?? 160;
|
|
1658
2398
|
i.set(e.id, t && Number.isFinite(t) ? t : n);
|
|
1659
2399
|
}
|
|
1660
2400
|
let o = i.get(n.id) ?? (r && Number.isFinite(r) ? r : a?.width ?? n.width ?? 160);
|
|
1661
|
-
|
|
2401
|
+
Wn(n.id);
|
|
1662
2402
|
let s = (e) => {
|
|
1663
|
-
|
|
2403
|
+
X((r) => {
|
|
1664
2404
|
let a = r;
|
|
1665
2405
|
for (let [e, t] of i) a = _e(a, e, t);
|
|
1666
|
-
return
|
|
2406
|
+
return on(a, n.id, Math.max(en(n), o + e.clientX - t));
|
|
1667
2407
|
}, { columnLayoutChanged: !0 });
|
|
1668
2408
|
}, c = () => {
|
|
1669
|
-
|
|
2409
|
+
window.removeEventListener("pointermove", s), window.removeEventListener("pointerup", l), window.removeEventListener("pointercancel", u), window.removeEventListener("blur", u), U.current === c && (U.current = null);
|
|
2410
|
+
}, l = () => {
|
|
2411
|
+
c(), Wn(null);
|
|
2412
|
+
}, u = () => {
|
|
2413
|
+
c(), Wn(null);
|
|
1670
2414
|
};
|
|
1671
|
-
window.addEventListener("pointermove", s), window.addEventListener("pointerup",
|
|
2415
|
+
cr(c), window.addEventListener("pointermove", s), window.addEventListener("pointerup", l), window.addEventListener("pointercancel", u), window.addEventListener("blur", u);
|
|
1672
2416
|
},
|
|
1673
2417
|
children: /* @__PURE__ */ A("span", { className: "comins-table__resize-line" })
|
|
1674
2418
|
}));
|
|
1675
|
-
},
|
|
1676
|
-
|
|
1677
|
-
let t =
|
|
2419
|
+
}, ki = () => /* @__PURE__ */ A("colgroup", { children: Z.map((e, t) => /* @__PURE__ */ A("col", { style: { width: _r[t] } }, e.id)) }), Ai = () => {
|
|
2420
|
+
Jn((e) => {
|
|
2421
|
+
let t = Sn.current;
|
|
1678
2422
|
return Math.abs(e - t) > .5 ? t : e;
|
|
1679
2423
|
});
|
|
1680
|
-
},
|
|
1681
|
-
if (
|
|
1682
|
-
if (!
|
|
1683
|
-
e.scrollHeight - e.scrollTop - e.clientHeight <=
|
|
2424
|
+
}, ji = (e) => {
|
|
2425
|
+
if (x) {
|
|
2426
|
+
if (!He || Yt.current) return;
|
|
2427
|
+
e.scrollHeight - e.scrollTop - e.clientHeight <= tr && lr("scroll");
|
|
1684
2428
|
return;
|
|
1685
2429
|
}
|
|
1686
|
-
if (!
|
|
1687
|
-
let t = Math.max(0,
|
|
2430
|
+
if (!ne || !ee || ye || !Ue) return;
|
|
2431
|
+
let t = Math.max(0, ie);
|
|
1688
2432
|
if (e.scrollHeight - e.scrollTop - e.clientHeight > t) return;
|
|
1689
|
-
let n =
|
|
1690
|
-
|
|
1691
|
-
},
|
|
1692
|
-
let t = e.currentTarget;
|
|
1693
|
-
|
|
1694
|
-
|
|
2433
|
+
let n = Y.current.rows.length;
|
|
2434
|
+
cn.current !== n && (cn.current = n, Ue());
|
|
2435
|
+
}, Mi = (e) => {
|
|
2436
|
+
let t = e.currentTarget, n = xn.current, r = q.current;
|
|
2437
|
+
Sn.current = t.scrollTop, r?.status === "pending" && Math.abs(t.scrollTop - r.previousPhysicalScrollTop) > .5 && (q.current = {
|
|
2438
|
+
...r,
|
|
2439
|
+
status: "cancelled"
|
|
2440
|
+
}), n && Math.abs(t.scrollTop - n.actualPhysical) > .5 && (xn.current = null, Hn(null)), ji(t), wn.current !== null && (window.clearTimeout(wn.current), wn.current = null), Tn.current === null && (Tn.current = window.requestAnimationFrame(() => {
|
|
2441
|
+
Tn.current = null, Ai();
|
|
1695
2442
|
}));
|
|
1696
|
-
let
|
|
1697
|
-
if (
|
|
1698
|
-
let e = Math.max(0,
|
|
1699
|
-
|
|
2443
|
+
let i = Math.max(0, t.scrollLeft);
|
|
2444
|
+
if (B.current) {
|
|
2445
|
+
let e = Math.max(0, B.current.scrollWidth - B.current.clientWidth), n = Math.max(0, t.scrollWidth - t.clientWidth);
|
|
2446
|
+
i = Math.min(Math.min(e, n), i), Math.abs(t.scrollLeft - i) > .5 && (t.scrollLeft = i), B.current.scrollLeft = i;
|
|
1700
2447
|
}
|
|
1701
|
-
|
|
2448
|
+
at.current && (at.current.scrollLeft = i);
|
|
1702
2449
|
};
|
|
1703
2450
|
return /* @__PURE__ */ j("div", {
|
|
1704
2451
|
className: [
|
|
1705
2452
|
"comins-table comins-typography-base h-full w-full overflow-hidden",
|
|
1706
|
-
|
|
1707
|
-
|
|
2453
|
+
Lr,
|
|
2454
|
+
Ir.className,
|
|
1708
2455
|
r
|
|
1709
2456
|
].filter(Boolean).join(" "),
|
|
1710
|
-
"aria-busy":
|
|
1711
|
-
"data-loading":
|
|
1712
|
-
"data-show-header":
|
|
2457
|
+
"aria-busy": Vr || Hr ? "true" : void 0,
|
|
2458
|
+
"data-loading": Vr || Hr ? "true" : void 0,
|
|
2459
|
+
"data-show-header": Zr ? "true" : void 0,
|
|
1713
2460
|
style: {
|
|
1714
|
-
...
|
|
1715
|
-
...
|
|
2461
|
+
...Ir.style,
|
|
2462
|
+
...Ze
|
|
1716
2463
|
},
|
|
1717
2464
|
children: [
|
|
1718
|
-
|
|
2465
|
+
Zr ? /* @__PURE__ */ A("div", {
|
|
1719
2466
|
className: "comins-table__header",
|
|
1720
|
-
ref:
|
|
2467
|
+
ref: B,
|
|
1721
2468
|
children: /* @__PURE__ */ j("table", {
|
|
1722
2469
|
className: "comins-table__table comins-table__header-table min-w-full table-fixed",
|
|
1723
|
-
style: { width:
|
|
1724
|
-
children: [
|
|
2470
|
+
style: { width: yr },
|
|
2471
|
+
children: [ki(), /* @__PURE__ */ A("thead", {
|
|
1725
2472
|
className: "comins-table__thead",
|
|
1726
|
-
children:
|
|
2473
|
+
children: xr.map((e, t) => /* @__PURE__ */ A("tr", { children: e.map((e, t) => Oi(e, t)) }, `header-row-${t}`))
|
|
1727
2474
|
})]
|
|
1728
2475
|
})
|
|
1729
2476
|
}) : null,
|
|
1730
2477
|
/* @__PURE__ */ j("div", {
|
|
1731
2478
|
className: "comins-table__body-viewport",
|
|
1732
|
-
"data-horizontal-overflow":
|
|
2479
|
+
"data-horizontal-overflow": zr ? "true" : void 0,
|
|
1733
2480
|
"data-virtualized": R ? "true" : void 0,
|
|
1734
2481
|
"data-testid": f,
|
|
1735
|
-
onScroll:
|
|
1736
|
-
ref:
|
|
2482
|
+
onScroll: Mi,
|
|
2483
|
+
ref: z,
|
|
1737
2484
|
children: [
|
|
1738
2485
|
/* @__PURE__ */ j("table", {
|
|
1739
2486
|
className: ["comins-table__table comins-table__body-table min-w-full table-fixed", R ? "comins-table__body-table--virtualized" : void 0].filter(Boolean).join(" "),
|
|
1740
2487
|
style: R ? {
|
|
1741
|
-
transform: `translate3d(0, ${
|
|
1742
|
-
width:
|
|
1743
|
-
} : { width:
|
|
1744
|
-
children: [
|
|
1745
|
-
|
|
2488
|
+
transform: `translate3d(0, ${Mr.renderOffset}px, 0)`,
|
|
2489
|
+
width: yr
|
|
2490
|
+
} : { width: yr },
|
|
2491
|
+
children: [ki(), /* @__PURE__ */ j("tbody", { children: [
|
|
2492
|
+
Wr ? Array.from({ length: qr }).map((e, t) => /* @__PURE__ */ A("tr", {
|
|
1746
2493
|
"aria-hidden": "true",
|
|
1747
2494
|
className: "comins-table__tr comins-table__skeleton-row",
|
|
1748
2495
|
"data-comins-row-parity": t % 2 == 0 ? "even" : "odd",
|
|
1749
2496
|
"data-testid": "loading-skeleton-row",
|
|
1750
|
-
style: { height:
|
|
1751
|
-
children:
|
|
2497
|
+
style: { height: F },
|
|
2498
|
+
children: Z.length > 0 ? Z.map((e) => /* @__PURE__ */ A("td", {
|
|
1752
2499
|
className: "comins-table__td comins-table__skeleton-cell px-3 py-2",
|
|
1753
2500
|
"data-testid": `loading-skeleton-cell-${t}-${e.id}`,
|
|
1754
|
-
style: { height:
|
|
2501
|
+
style: { height: F },
|
|
1755
2502
|
children: /* @__PURE__ */ A("span", { className: "comins-table__skeleton-block" })
|
|
1756
2503
|
}, e.id)) : /* @__PURE__ */ A("td", {
|
|
1757
2504
|
className: "comins-table__td comins-table__skeleton-cell px-3 py-2",
|
|
1758
2505
|
children: /* @__PURE__ */ A("span", { className: "comins-table__skeleton-block" })
|
|
1759
2506
|
})
|
|
1760
2507
|
}, `loading-skeleton-${t}`)) : null,
|
|
1761
|
-
|
|
2508
|
+
Gr ? /* @__PURE__ */ A("tr", {
|
|
1762
2509
|
className: "comins-table__tr comins-table__empty-state-row",
|
|
1763
|
-
style: { height:
|
|
2510
|
+
style: { height: F },
|
|
1764
2511
|
children: /* @__PURE__ */ A("td", {
|
|
1765
2512
|
className: "comins-table__td comins-table__empty-state-cell",
|
|
1766
|
-
colSpan: Math.max(1,
|
|
2513
|
+
colSpan: Math.max(1, Z.length),
|
|
1767
2514
|
children: /* @__PURE__ */ A("div", {
|
|
1768
2515
|
"data-testid": "data-table-empty-state",
|
|
1769
2516
|
className: "comins-table__empty-state",
|
|
@@ -1771,195 +2518,245 @@ function Kt({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
|
|
|
1771
2518
|
})
|
|
1772
2519
|
})
|
|
1773
2520
|
}) : null,
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
"
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
}), ne = typeof t.cell?.tooltip == "function" ? t.cell.tooltip(u) : t.cell?.tooltip, b = a === 0 ? L?.entriesByRowId.get(e.rowId) : void 0, S = b ? /* @__PURE__ */ j("span", {
|
|
1848
|
-
className: "comins-tree-cell-content",
|
|
1849
|
-
style: { "--comins-tree-depth": b.depth },
|
|
1850
|
-
children: [b.hasChildren ? /* @__PURE__ */ A("button", {
|
|
1851
|
-
"aria-expanded": b.expanded,
|
|
1852
|
-
"aria-label": `${b.expanded ? "Collapse" : "Expand"} ${String(e.rowId)}`,
|
|
1853
|
-
className: "comins-tree-expander",
|
|
1854
|
-
"data-testid": `tree-expander-${String(e.rowId)}`,
|
|
1855
|
-
onClick: (t) => {
|
|
1856
|
-
t.preventDefault(), t.stopPropagation(), L?.onToggle(e.rowId);
|
|
1857
|
-
},
|
|
1858
|
-
onMouseDown: (e) => e.stopPropagation(),
|
|
1859
|
-
onPointerDown: (e) => e.stopPropagation(),
|
|
1860
|
-
type: "button",
|
|
1861
|
-
children: b.expanded ? "▾" : "▸"
|
|
2521
|
+
Mr.slots.map((e, t) => {
|
|
2522
|
+
if (e.kind !== "data") return null;
|
|
2523
|
+
let r = e, i = At(Ge, r.row, r.visibleIndex), a = Rr.has(r.rowId), o = t === Mr.slots.length - 1, s = r.visibleIndex === Er - 1, c = Mr.scrollHeight >= Dn - 1, l = o && (R ? s && c : Xr === 0), u = jt(i.style), d = R && Mr.mixed ? r.key : R ? `virtual-row-slot-${t}` : String(r.rowId), f = { row: Nt(r) }, p = rr && (Ke?.(f) ?? !0), m = p && kr.has(r.rowId), h = m && r.detail?.mode === "fixed" ? r.detail.height : void 0, _ = r.detail?.mode ?? "fixed", v = `${typeof r.rowId}-${encodeURIComponent(String(r.rowId))}`, y = `comins-row-detail-${encodeURIComponent(Yn)}-${v}`, b = `${y}-content`, ee = `${y}-toggle`;
|
|
2524
|
+
return /* @__PURE__ */ j(Ee, { children: [
|
|
2525
|
+
Gn?.targetDataIndex === r.dataIndex && Gn.sourceRowId !== r.rowId ? /* @__PURE__ */ A("tr", {
|
|
2526
|
+
"aria-hidden": "true",
|
|
2527
|
+
className: "comins-row-move-placeholder",
|
|
2528
|
+
children: /* @__PURE__ */ A("td", {
|
|
2529
|
+
colSpan: Math.max(1, Z.length),
|
|
2530
|
+
"data-testid": "row-move-placeholder",
|
|
2531
|
+
children: "이 위치로 이동"
|
|
2532
|
+
})
|
|
2533
|
+
}) : null,
|
|
2534
|
+
/* @__PURE__ */ A("tr", {
|
|
2535
|
+
"aria-disabled": i.disabled ? "true" : void 0,
|
|
2536
|
+
"aria-selected": a,
|
|
2537
|
+
className: [
|
|
2538
|
+
"comins-table__tr",
|
|
2539
|
+
l && !m ? "comins-table__tr--viewport-end" : void 0,
|
|
2540
|
+
a ? "comins-row-selected" : void 0,
|
|
2541
|
+
i.className
|
|
2542
|
+
].filter(Boolean).join(" "),
|
|
2543
|
+
"data-disabled": i.disabled ? "true" : void 0,
|
|
2544
|
+
"data-comins-row-custom-background": u === void 0 ? void 0 : "true",
|
|
2545
|
+
"data-comins-row-data-index": r.dataIndex,
|
|
2546
|
+
"data-comins-row-parity": r.visibleIndex % 2 == 0 ? "even" : "odd",
|
|
2547
|
+
"data-row-draggable": i.draggable ? "true" : "false",
|
|
2548
|
+
"data-selected-row": a ? "true" : void 0,
|
|
2549
|
+
"data-testid": `row-${String(r.rowId)}`,
|
|
2550
|
+
draggable: !1,
|
|
2551
|
+
onClick: (e) => {
|
|
2552
|
+
if (i.disabled) {
|
|
2553
|
+
e.preventDefault();
|
|
2554
|
+
return;
|
|
2555
|
+
}
|
|
2556
|
+
e.__cominsCellSelectionHandled || gi(e, r), Fe?.(Pt(e, r));
|
|
2557
|
+
},
|
|
2558
|
+
onContextMenu: (e) => {
|
|
2559
|
+
if (i.disabled) {
|
|
2560
|
+
e.preventDefault();
|
|
2561
|
+
return;
|
|
2562
|
+
}
|
|
2563
|
+
X((e) => wt(e, r.rowId)), K.current = r.rowId, Le?.(Pt(e, r));
|
|
2564
|
+
},
|
|
2565
|
+
onDoubleClick: (e) => {
|
|
2566
|
+
if (i.disabled) {
|
|
2567
|
+
e.preventDefault();
|
|
2568
|
+
return;
|
|
2569
|
+
}
|
|
2570
|
+
ze?.(Pt(e, r));
|
|
2571
|
+
},
|
|
2572
|
+
onKeyDown: (e) => _i(e, r, i.disabled),
|
|
2573
|
+
style: Mt(F, i.style, u),
|
|
2574
|
+
tabIndex: i.disabled ? -1 : 0,
|
|
2575
|
+
children: Z.map((e, t) => {
|
|
2576
|
+
let o = g(J, r.row, e.id), s = {
|
|
2577
|
+
columnId: e.id,
|
|
2578
|
+
rowId: r.rowId
|
|
2579
|
+
}, c = n && re(J, s), l = n && J.selection.cell?.rowId === r.rowId && J.selection.cell.columnId === e.id, u = It(r, i.disabled, a, J.selection.rowIds.length, e, t, o), d = Lt(e, u), f = i.disabled || zt(d, u), h = { requestRowSelection: ({ event: e, mode: t }) => f ? !1 : t === "exclusive" ? (X((e) => de(e, r.rowId)), K.current = r.rowId, !0) : (gi(e, r), !0) }, _ = Ot(Bt(d, u)), v = Vt(d, u), y = !!e.cell?.components?.length, te = Ht(e, o, u), ne = e.cell?.components?.map((e) => {
|
|
2580
|
+
if (e.type !== "input") return e;
|
|
2581
|
+
let t = e.onValueChange;
|
|
2582
|
+
return {
|
|
2583
|
+
...e,
|
|
2584
|
+
onValueChange: (e) => {
|
|
2585
|
+
X((t) => we(t, [{
|
|
2586
|
+
id: e.row.id,
|
|
2587
|
+
patch: (t) => sn(t, e.column.field, e.value)
|
|
2588
|
+
}])), t?.(e);
|
|
2589
|
+
}
|
|
2590
|
+
};
|
|
2591
|
+
}), ie = Kt(ne, u), x = e.cell?.renderer ? e.cell.renderer(u) : y ? $t(te, ne, u, {
|
|
2592
|
+
interaction: h,
|
|
2593
|
+
showContent: !1
|
|
1862
2594
|
}) : /* @__PURE__ */ A("span", {
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
}), /* @__PURE__ */
|
|
1866
|
-
className: "comins-tree-cell-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
return;
|
|
1902
|
-
}
|
|
1903
|
-
n && (Ye.current = s), Q((t) => {
|
|
1904
|
-
let i = T(t, e.rowId, {
|
|
1905
|
-
multi: r.ctrlKey || r.metaKey,
|
|
1906
|
-
toggle: r.ctrlKey || r.metaKey
|
|
1907
|
-
});
|
|
1908
|
-
return n ? ue(i, s) : i;
|
|
1909
|
-
}), r.__cominsCellSelectionHandled = !0, G.current = e.rowId, Oe?.(pt(r, e, t, a, o));
|
|
1910
|
-
},
|
|
1911
|
-
onContextMenu: (r) => {
|
|
1912
|
-
if (f) {
|
|
1913
|
-
r.preventDefault(), r.stopPropagation();
|
|
1914
|
-
return;
|
|
1915
|
-
}
|
|
1916
|
-
Q((t) => {
|
|
1917
|
-
let r = T(t, e.rowId);
|
|
1918
|
-
return n ? ue(r, s) : r;
|
|
1919
|
-
}), G.current = e.rowId, n && (Ye.current = s), Ae && (r.stopPropagation(), Ae(pt(r, e, t, a, o)));
|
|
1920
|
-
},
|
|
1921
|
-
onDoubleClick: (n) => {
|
|
1922
|
-
if (Ne && n.stopPropagation(), f) {
|
|
1923
|
-
n.preventDefault(), n.stopPropagation();
|
|
1924
|
-
return;
|
|
1925
|
-
}
|
|
1926
|
-
Ne?.(pt(n, e, t, a, o));
|
|
1927
|
-
},
|
|
1928
|
-
onKeyDown: (n) => tr(n, e, t, a, s, f),
|
|
1929
|
-
onMouseDown: (e) => nr(e, s, f),
|
|
1930
|
-
onMouseOver: () => ir(s),
|
|
1931
|
-
onMouseUp: ar,
|
|
1932
|
-
onPointerDown: (e) => or(e, s, f),
|
|
1933
|
-
onPointerEnter: () => ir(s),
|
|
1934
|
-
onPointerMove: (e) => {
|
|
1935
|
-
e.buttons === 1 && ir(s);
|
|
1936
|
-
},
|
|
1937
|
-
onPointerUp: ar,
|
|
1938
|
-
style: {
|
|
1939
|
-
height: N,
|
|
1940
|
-
...h
|
|
1941
|
-
},
|
|
1942
|
-
title: typeof ne == "string" ? ne : void 0,
|
|
1943
|
-
tabIndex: f ? -1 : 0,
|
|
1944
|
-
children: [a === 0 && r.draggable ? /* @__PURE__ */ A("span", {
|
|
1945
|
-
"aria-hidden": "true",
|
|
1946
|
-
className: "comins-row-drag-handle",
|
|
1947
|
-
"data-testid": `row-drag-handle-${String(e.rowId)}`,
|
|
2595
|
+
className: "comins-table__cell-value",
|
|
2596
|
+
children: te
|
|
2597
|
+
}), S = typeof e.cell?.tooltip == "function" ? e.cell.tooltip(u) : e.cell?.tooltip, C = e.id === L?.treeColumnId ? L.entriesByRowId.get(r.rowId) : void 0, w = C ? /* @__PURE__ */ j("span", {
|
|
2598
|
+
className: "comins-tree-cell-content",
|
|
2599
|
+
style: { "--comins-tree-depth": C.depth },
|
|
2600
|
+
children: [C.hasChildren ? /* @__PURE__ */ A($e, {
|
|
2601
|
+
"aria-expanded": C.expanded,
|
|
2602
|
+
"aria-label": `${C.expanded ? "Collapse" : "Expand"} ${String(r.rowId)}`,
|
|
2603
|
+
className: "comins-tree-expander",
|
|
2604
|
+
"data-testid": `tree-expander-${String(r.rowId)}`,
|
|
2605
|
+
icon: C.expanded ? "disclosureExpanded" : "disclosureCollapsed",
|
|
2606
|
+
onClick: (e) => {
|
|
2607
|
+
e.preventDefault(), e.stopPropagation(), L?.onToggle(r.rowId);
|
|
2608
|
+
},
|
|
2609
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
2610
|
+
onPointerDown: (e) => e.stopPropagation()
|
|
2611
|
+
}) : /* @__PURE__ */ A("span", {
|
|
2612
|
+
"aria-hidden": "true",
|
|
2613
|
+
className: "comins-tree-expander-spacer"
|
|
2614
|
+
}), /* @__PURE__ */ A("span", {
|
|
2615
|
+
className: "comins-tree-cell-value",
|
|
2616
|
+
children: x
|
|
2617
|
+
})]
|
|
2618
|
+
}) : x;
|
|
2619
|
+
return /* @__PURE__ */ A("td", {
|
|
2620
|
+
"aria-disabled": f ? "true" : void 0,
|
|
2621
|
+
className: [
|
|
2622
|
+
"comins-table__td px-3 py-2",
|
|
2623
|
+
c ? "comins-cell-range-selected" : void 0,
|
|
2624
|
+
_
|
|
2625
|
+
].filter(Boolean).join(" "),
|
|
2626
|
+
"data-disabled": f ? "true" : void 0,
|
|
2627
|
+
"data-comins-cell-column-id": e.id,
|
|
2628
|
+
"data-comins-component-cell": ie.length > 0 ? "true" : void 0,
|
|
2629
|
+
"data-comins-data-index": r.dataIndex,
|
|
2630
|
+
"data-range-selected": c ? "true" : void 0,
|
|
2631
|
+
"data-selected": l ? "true" : void 0,
|
|
2632
|
+
"data-testid": `cell-${String(r.rowId)}-${e.id}`,
|
|
1948
2633
|
draggable: !1,
|
|
1949
|
-
onClick: (
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
2634
|
+
onClick: (i) => {
|
|
2635
|
+
if (Pe && i.stopPropagation(), f) {
|
|
2636
|
+
i.preventDefault(), i.stopPropagation();
|
|
2637
|
+
return;
|
|
2638
|
+
}
|
|
2639
|
+
if (vn.current) {
|
|
2640
|
+
vn.current = !1, i.__cominsCellSelectionHandled = !0;
|
|
2641
|
+
return;
|
|
2642
|
+
}
|
|
2643
|
+
let a = n ? J.selection.cell ?? G.current : null;
|
|
2644
|
+
if (i.shiftKey && a) {
|
|
2645
|
+
i.__cominsCellSelectionHandled = !0, G.current = a, X((e) => ue(K.current === null ? de(e, r.rowId) : fe(e, ei(e, K.current, r.rowId)), {
|
|
2646
|
+
anchor: a,
|
|
2647
|
+
focus: s
|
|
2648
|
+
})), K.current = r.rowId;
|
|
2649
|
+
return;
|
|
2650
|
+
}
|
|
2651
|
+
n && (G.current = s), X((e) => {
|
|
2652
|
+
let t = de(e, r.rowId, {
|
|
2653
|
+
multi: i.ctrlKey || i.metaKey,
|
|
2654
|
+
toggle: i.ctrlKey || i.metaKey
|
|
2655
|
+
});
|
|
2656
|
+
return n ? le(t, s) : t;
|
|
2657
|
+
}), i.__cominsCellSelectionHandled = !0, K.current = r.rowId, Pe?.(Ft(i, r, e, t, o));
|
|
2658
|
+
},
|
|
2659
|
+
onContextMenu: (i) => {
|
|
2660
|
+
if (i.target.closest(".comins-row-detail-expander")) {
|
|
2661
|
+
i.stopPropagation();
|
|
2662
|
+
return;
|
|
2663
|
+
}
|
|
2664
|
+
if (f) {
|
|
2665
|
+
i.preventDefault(), i.stopPropagation();
|
|
2666
|
+
return;
|
|
2667
|
+
}
|
|
2668
|
+
X((e) => {
|
|
2669
|
+
let t = wt(e, r.rowId);
|
|
2670
|
+
return n ? le(t, s) : t;
|
|
2671
|
+
}), K.current = r.rowId, n && (G.current = s), Ie && (i.stopPropagation(), Ie(Ft(i, r, e, t, o)));
|
|
2672
|
+
},
|
|
2673
|
+
onDoubleClick: (n) => {
|
|
2674
|
+
if (n.target.closest(".comins-row-detail-expander")) {
|
|
2675
|
+
n.stopPropagation();
|
|
2676
|
+
return;
|
|
2677
|
+
}
|
|
2678
|
+
if (N && n.stopPropagation(), f) {
|
|
2679
|
+
n.preventDefault(), n.stopPropagation();
|
|
2680
|
+
return;
|
|
2681
|
+
}
|
|
2682
|
+
N?.(Ft(n, r, e, t, o));
|
|
2683
|
+
},
|
|
2684
|
+
onKeyDown: (n) => vi(n, r, e, t, s, f),
|
|
2685
|
+
onMouseDown: (e) => yi(e, s, f),
|
|
2686
|
+
onMouseOver: (e) => {
|
|
2687
|
+
e.buttons === 1 && !U.current && xi(s);
|
|
2688
|
+
},
|
|
2689
|
+
onMouseUp: Si,
|
|
2690
|
+
onPointerDown: (e) => Ci(e, s, f),
|
|
2691
|
+
onPointerEnter: (e) => {
|
|
2692
|
+
e.buttons === 1 && xi(s);
|
|
2693
|
+
},
|
|
2694
|
+
onPointerMove: (e) => {
|
|
2695
|
+
e.buttons === 1 && xi(s);
|
|
2696
|
+
},
|
|
2697
|
+
onPointerUp: Si,
|
|
2698
|
+
style: {
|
|
2699
|
+
height: F,
|
|
2700
|
+
...v
|
|
2701
|
+
},
|
|
2702
|
+
title: typeof S == "string" ? S : void 0,
|
|
2703
|
+
tabIndex: f ? -1 : 0,
|
|
2704
|
+
children: t === 0 && (rr || i.draggable) ? /* @__PURE__ */ j("div", {
|
|
2705
|
+
className: "comins-row-cell-content",
|
|
2706
|
+
children: [/* @__PURE__ */ j("span", {
|
|
2707
|
+
className: "comins-row-leading-controls",
|
|
2708
|
+
children: [rr ? p ? /* @__PURE__ */ A(et, {
|
|
2709
|
+
controlsId: b,
|
|
2710
|
+
disabled: !M,
|
|
2711
|
+
expanded: m,
|
|
2712
|
+
id: ee,
|
|
2713
|
+
label: `${m ? "Collapse" : "Expand"} ${String(r.rowId)} details`,
|
|
2714
|
+
onElement: (e) => {
|
|
2715
|
+
e ? kt.current.set(r.rowId, e) : kt.current.delete(r.rowId);
|
|
2716
|
+
},
|
|
2717
|
+
onToggle: () => or(r.rowId, p),
|
|
2718
|
+
testId: `row-detail-toggle-${String(r.rowId)}`
|
|
2719
|
+
}) : /* @__PURE__ */ A("span", {
|
|
2720
|
+
"aria-hidden": "true",
|
|
2721
|
+
className: "comins-row-detail-expander-spacer",
|
|
2722
|
+
"data-comins-row-leading-control": "disclosure"
|
|
2723
|
+
}) : null, i.draggable ? /* @__PURE__ */ A("span", {
|
|
2724
|
+
"aria-hidden": "true",
|
|
2725
|
+
className: "comins-row-drag-handle",
|
|
2726
|
+
"data-comins-row-leading-control": "drag",
|
|
2727
|
+
"data-testid": `row-drag-handle-${String(r.rowId)}`,
|
|
2728
|
+
draggable: !1,
|
|
2729
|
+
onClick: (e) => e.stopPropagation(),
|
|
2730
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
2731
|
+
onPointerDown: (e) => wi(e, r, i.disabled, i.draggable)
|
|
2732
|
+
}) : null]
|
|
2733
|
+
}), /* @__PURE__ */ A("div", {
|
|
2734
|
+
className: "comins-row-cell-content__value",
|
|
2735
|
+
children: w
|
|
2736
|
+
})]
|
|
2737
|
+
}) : w
|
|
2738
|
+
}, e.id);
|
|
2739
|
+
})
|
|
2740
|
+
}, d),
|
|
2741
|
+
m ? /* @__PURE__ */ A(tt, {
|
|
2742
|
+
colSpan: Z.length,
|
|
2743
|
+
contentId: b,
|
|
2744
|
+
fixedHeight: h,
|
|
2745
|
+
labelId: ee,
|
|
2746
|
+
onContentElement: (e) => mr(r.rowId, _, e),
|
|
2747
|
+
ownerId: String(r.rowId),
|
|
2748
|
+
testId: `row-detail-content-${String(r.rowId)}`,
|
|
2749
|
+
getToggleElement: () => kt.current.get(r.rowId) ?? null,
|
|
2750
|
+
children: qe?.(f)
|
|
2751
|
+
}) : null
|
|
2752
|
+
] }, d);
|
|
1956
2753
|
}),
|
|
1957
|
-
|
|
2754
|
+
Kr ? /* @__PURE__ */ A("tr", {
|
|
1958
2755
|
className: "comins-table__tr comins-table__infinite-loading-row",
|
|
1959
|
-
style: { height:
|
|
2756
|
+
style: { height: F },
|
|
1960
2757
|
children: /* @__PURE__ */ j("td", {
|
|
1961
2758
|
className: "comins-table__td comins-table__infinite-loading-cell",
|
|
1962
|
-
colSpan: Math.max(1,
|
|
2759
|
+
colSpan: Math.max(1, Z.length),
|
|
1963
2760
|
"data-testid": "data-table-infinite-loading-row",
|
|
1964
2761
|
children: [/* @__PURE__ */ A("span", {
|
|
1965
2762
|
className: "comins-table__loading-spinner",
|
|
@@ -1967,13 +2764,13 @@ function Kt({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
|
|
|
1967
2764
|
}), /* @__PURE__ */ A("span", { children: "데이터를 불러오는 중입니다." })]
|
|
1968
2765
|
})
|
|
1969
2766
|
}) : null,
|
|
1970
|
-
|
|
2767
|
+
Xr > 0 ? /* @__PURE__ */ A("tr", {
|
|
1971
2768
|
"aria-hidden": "true",
|
|
1972
2769
|
className: "comins-table-empty-filler",
|
|
1973
2770
|
children: /* @__PURE__ */ A("td", {
|
|
1974
|
-
colSpan: Math.max(1,
|
|
2771
|
+
colSpan: Math.max(1, Z.length),
|
|
1975
2772
|
"data-testid": "table-empty-filler",
|
|
1976
|
-
style: { height:
|
|
2773
|
+
style: { height: Xr }
|
|
1977
2774
|
})
|
|
1978
2775
|
}) : null
|
|
1979
2776
|
] })]
|
|
@@ -1982,35 +2779,36 @@ function Kt({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
|
|
|
1982
2779
|
"aria-hidden": "true",
|
|
1983
2780
|
className: "comins-table__body-virtual-sizer",
|
|
1984
2781
|
style: {
|
|
1985
|
-
height:
|
|
1986
|
-
width:
|
|
2782
|
+
height: Mr.scrollHeight,
|
|
2783
|
+
width: yr
|
|
1987
2784
|
}
|
|
1988
2785
|
}) : null,
|
|
1989
|
-
|
|
2786
|
+
Vr && !Ur ? /* @__PURE__ */ j("div", {
|
|
1990
2787
|
className: "comins-table__loading-overlay",
|
|
1991
2788
|
"data-testid": "data-table-loading-overlay",
|
|
1992
2789
|
role: "status",
|
|
1993
|
-
style:
|
|
2790
|
+
style: qn > 0 ? { transform: `translateY(${qn}px)` } : void 0,
|
|
1994
2791
|
children: [/* @__PURE__ */ A("span", {
|
|
1995
2792
|
className: "comins-table__loading-spinner",
|
|
1996
2793
|
"data-testid": "data-table-loading-spinner"
|
|
1997
|
-
}), /* @__PURE__ */ A("span", { children:
|
|
2794
|
+
}), /* @__PURE__ */ A("span", { children: ve ?? "불러오는 중입니다." })]
|
|
1998
2795
|
}) : null
|
|
1999
2796
|
]
|
|
2000
2797
|
}),
|
|
2001
2798
|
I ? /* @__PURE__ */ A("div", {
|
|
2002
2799
|
"aria-label": "Table summary",
|
|
2003
2800
|
className: "comins-table__summary",
|
|
2004
|
-
ref:
|
|
2801
|
+
ref: at,
|
|
2005
2802
|
children: /* @__PURE__ */ j("table", {
|
|
2006
2803
|
className: "comins-table__table comins-table__summary-table min-w-full table-fixed",
|
|
2007
|
-
style: { width:
|
|
2008
|
-
children: [
|
|
2804
|
+
style: { width: yr },
|
|
2805
|
+
children: [ki(), /* @__PURE__ */ A("tfoot", { children: /* @__PURE__ */ A("tr", {
|
|
2009
2806
|
className: ["comins-table__summary-row", I.className].filter(Boolean).join(" "),
|
|
2010
2807
|
style: I.style,
|
|
2011
|
-
children:
|
|
2808
|
+
children: Cr.map((e) => /* @__PURE__ */ A("td", {
|
|
2012
2809
|
className: ["comins-table__summary-cell px-3 py-2", e.className].filter(Boolean).join(" "),
|
|
2013
2810
|
colSpan: e.colSpan,
|
|
2811
|
+
"data-comins-summary-column-id": e.column.id,
|
|
2014
2812
|
"data-testid": `summary-cell-${e.column.id}`,
|
|
2015
2813
|
style: e.style,
|
|
2016
2814
|
children: e.value
|
|
@@ -2018,57 +2816,66 @@ function Kt({ "buffer-size": e, cellSelection: n = !0, className: r, columnGroup
|
|
|
2018
2816
|
}) })]
|
|
2019
2817
|
})
|
|
2020
2818
|
}) : null,
|
|
2021
|
-
|
|
2819
|
+
Di && Ln ? /* @__PURE__ */ j("div", {
|
|
2022
2820
|
"aria-hidden": "true",
|
|
2023
2821
|
className: "comins-column-move-ghost",
|
|
2024
2822
|
"data-testid": "column-move-ghost",
|
|
2025
2823
|
style: {
|
|
2026
|
-
left:
|
|
2027
|
-
top:
|
|
2824
|
+
left: Ln.x + 12,
|
|
2825
|
+
top: Ln.y + 12
|
|
2028
2826
|
},
|
|
2029
|
-
children:
|
|
2827
|
+
children: [/* @__PURE__ */ A(Qe, { name: "columnMove" }), /* @__PURE__ */ A("span", {
|
|
2828
|
+
className: "comins-column-move-ghost__label",
|
|
2829
|
+
children: Di
|
|
2830
|
+
})]
|
|
2030
2831
|
}) : null
|
|
2031
2832
|
]
|
|
2032
2833
|
});
|
|
2033
2834
|
}
|
|
2034
|
-
function
|
|
2035
|
-
let
|
|
2835
|
+
function xn({ data: e, defaultExpandAll: t = !0, estimatedRowDetailHeight: n, expandedRowIds: r, getRowDetailHeight: i, getRowId: a, hasMoreRows: o, infiniteScroll: s, infiniteScrollThreshold: c, lazyLoad: l, lazyLoadBatchSize: u, lazyLoadMode: d, lazyLoadThreshold: f, loadingMore: p, onChangeData: m, onChangeExpandedRowIds: h, onChangeSort: g, onChangeSortModel: _, onLazyLoad: v, onLoadMore: y, rowProps: b, isRowExpandable: ee, renderRowDetail: te, tree: ne, ...re }, ie) {
|
|
2836
|
+
let x = O(t).current, [S, C] = k([]), w = D(() => re.columns.map((e, t) => t === 0 ? {
|
|
2837
|
+
...e,
|
|
2838
|
+
lockPosition: !0
|
|
2839
|
+
} : e), [re.columns]), ae = w[0]?.id ?? w[0]?.field ?? null, T = D(() => vn(e, w, S), [
|
|
2036
2840
|
e,
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
]),
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
]),
|
|
2044
|
-
entriesByRowId:
|
|
2841
|
+
w,
|
|
2842
|
+
S
|
|
2843
|
+
]), oe = D(() => B(T, a, { defaultExpandAll: x }), [
|
|
2844
|
+
a,
|
|
2845
|
+
x,
|
|
2846
|
+
T
|
|
2847
|
+
]), se = D(() => new Map(oe.map((e) => [e.rowId, e])), [oe]), ce = D(() => ({
|
|
2848
|
+
entriesByRowId: se,
|
|
2045
2849
|
onExpand: (t) => {
|
|
2046
|
-
let
|
|
2047
|
-
|
|
2850
|
+
let n = yn(e, t, !0, a, x);
|
|
2851
|
+
n !== e && m?.([...n]);
|
|
2048
2852
|
},
|
|
2049
2853
|
onFold: (t) => {
|
|
2050
|
-
let
|
|
2051
|
-
|
|
2854
|
+
let n = yn(e, t, !1, a, x);
|
|
2855
|
+
n !== e && m?.([...n]);
|
|
2052
2856
|
},
|
|
2053
|
-
onToggle: (t) =>
|
|
2054
|
-
summaryRows:
|
|
2857
|
+
onToggle: (t) => m?.(st(e, t, a, { defaultExpandAll: x })),
|
|
2858
|
+
summaryRows: ot(e),
|
|
2859
|
+
treeColumnId: ae
|
|
2055
2860
|
}), [
|
|
2056
2861
|
e,
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2862
|
+
se,
|
|
2863
|
+
a,
|
|
2864
|
+
x,
|
|
2865
|
+
m,
|
|
2866
|
+
ae
|
|
2867
|
+
]), le = (t) => {
|
|
2868
|
+
let n = e;
|
|
2063
2869
|
t.forEach((e, t) => {
|
|
2064
|
-
let
|
|
2065
|
-
|
|
2066
|
-
}),
|
|
2870
|
+
let r = oe[t];
|
|
2871
|
+
r && r.item !== e && (n = ct(n, r.rowId, a, () => e));
|
|
2872
|
+
}), n !== e && m?.([...n]);
|
|
2067
2873
|
};
|
|
2068
|
-
return /* @__PURE__ */ A(
|
|
2069
|
-
...
|
|
2070
|
-
|
|
2071
|
-
|
|
2874
|
+
return /* @__PURE__ */ A(q, {
|
|
2875
|
+
...re,
|
|
2876
|
+
columns: w,
|
|
2877
|
+
data: oe.map((e) => e.item),
|
|
2878
|
+
getRowId: a,
|
|
2072
2879
|
hasMoreRows: !1,
|
|
2073
2880
|
infiniteScroll: !1,
|
|
2074
2881
|
infiniteScrollThreshold: void 0,
|
|
@@ -2077,38 +2884,38 @@ function qt({ data: e, defaultExpandAll: t = !0, getRowId: n, hasMoreRows: r, in
|
|
|
2077
2884
|
lazyLoadMode: void 0,
|
|
2078
2885
|
lazyLoadThreshold: void 0,
|
|
2079
2886
|
loadingMore: !1,
|
|
2080
|
-
onChangeData:
|
|
2081
|
-
onChangeSort:
|
|
2887
|
+
onChangeData: le,
|
|
2888
|
+
onChangeSort: g,
|
|
2082
2889
|
onChangeSortModel: (e) => {
|
|
2083
|
-
|
|
2890
|
+
C(e), _?.(e);
|
|
2084
2891
|
},
|
|
2085
2892
|
onLazyLoad: void 0,
|
|
2086
2893
|
onLoadMore: void 0,
|
|
2087
2894
|
pagination: {
|
|
2088
2895
|
pageIndex: 0,
|
|
2089
|
-
pageSize: Math.max(1,
|
|
2896
|
+
pageSize: Math.max(1, oe.length)
|
|
2090
2897
|
},
|
|
2091
2898
|
rowProps: {
|
|
2092
|
-
...
|
|
2899
|
+
...b,
|
|
2093
2900
|
draggable: !1
|
|
2094
2901
|
},
|
|
2095
2902
|
tree: !1,
|
|
2096
|
-
ref:
|
|
2097
|
-
treeContext:
|
|
2903
|
+
ref: ie,
|
|
2904
|
+
treeContext: ce
|
|
2098
2905
|
});
|
|
2099
2906
|
}
|
|
2100
|
-
var
|
|
2101
|
-
function
|
|
2102
|
-
return e.tree ? /* @__PURE__ */ A(
|
|
2907
|
+
var q = Oe(bn), Sn = Oe(xn);
|
|
2908
|
+
function Cn(e, t) {
|
|
2909
|
+
return e.tree ? /* @__PURE__ */ A(Sn, {
|
|
2103
2910
|
...e,
|
|
2104
2911
|
ref: t
|
|
2105
|
-
}) : /* @__PURE__ */ A(
|
|
2912
|
+
}) : /* @__PURE__ */ A(q, {
|
|
2106
2913
|
...e,
|
|
2107
2914
|
ref: t
|
|
2108
2915
|
});
|
|
2109
2916
|
}
|
|
2110
|
-
var
|
|
2917
|
+
var wn = Oe(Cn), Tn = "comins-table";
|
|
2111
2918
|
//#endregion
|
|
2112
|
-
export {
|
|
2919
|
+
export { wn as CominsTable, e as addCominsRows, t as applyCominsColumnLayout, n as clearCominsCellRange, r as clearCominsSelection, i as clearCominsSortState, Tn 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, B 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, rt as getCominsSummaryValues, ot as getCominsTreeLeafItems, ee as getCominsVirtualRows, te as getCominsVisibleColumns, ne as isCominsCellDisabled, re as isCominsCellInSelectedRange, ie as isCominsCellSelected, x as isCominsRowSelected, S as moveCominsColumn, C as moveCominsColumnGroup, w as moveCominsRow, ae as pasteCominsCell, T as pasteCominsCellRange, oe as pasteCominsRow, se as queryCominsRows, ce as replaceCominsRows, le as selectCell, ue as selectCellRange, de as selectRow, fe as selectRows, pe as serializeCominsColumnLayout, me as setCominsColumnGroupHidden, he as setCominsColumnGroupWidth, ge as setCominsColumnHidden, _e as setCominsColumnWidth, ve as setCominsHeaderVisible, ye as setCominsPagination, be as setCominsSortModel, xe as setCominsSortState, Se as setCominsTableTheme, Ce as sortCominsRows, lt as sortCominsTreeSiblings, st as toggleCominsTreeNode, we as updateCominsRows, ct as updateCominsTreeItem };
|
|
2113
2920
|
|
|
2114
2921
|
//# sourceMappingURL=index.js.map
|