@opencorestack/opengridx 0.1.0 → 0.1.1
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 +14 -0
- package/README.md +195 -118
- package/dist/opengridx.es.js +194 -194
- package/dist/opengridx.es.js.map +1 -1
- package/dist/opengridx.umd.js +12 -40
- package/dist/opengridx.umd.js.map +1 -1
- package/package.json +1 -12
- package/dist/exceljs.min-CrbHmMCD.js +0 -22597
- package/dist/exceljs.min-CrbHmMCD.js.map +0 -1
package/dist/opengridx.es.js
CHANGED
|
@@ -39,7 +39,7 @@ function jr() {
|
|
|
39
39
|
return "Profiler";
|
|
40
40
|
case E:
|
|
41
41
|
return "StrictMode";
|
|
42
|
-
case
|
|
42
|
+
case y:
|
|
43
43
|
return "Suspense";
|
|
44
44
|
case I:
|
|
45
45
|
return "SuspenseList";
|
|
@@ -59,7 +59,7 @@ function jr() {
|
|
|
59
59
|
case S:
|
|
60
60
|
var H = v.render;
|
|
61
61
|
return v = v.displayName, v || (v = H.displayName || H.name || "", v = v !== "" ? "ForwardRef(" + v + ")" : "ForwardRef"), v;
|
|
62
|
-
case
|
|
62
|
+
case C:
|
|
63
63
|
return H = v.displayName || null, H !== null ? H : n(v.type) || "Memo";
|
|
64
64
|
case p:
|
|
65
65
|
H = v._payload, v = v._init;
|
|
@@ -220,7 +220,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
220
220
|
function d(v) {
|
|
221
221
|
return typeof v == "object" && v !== null && v.$$typeof === w;
|
|
222
222
|
}
|
|
223
|
-
var h = pe, w = /* @__PURE__ */ Symbol.for("react.transitional.element"), x = /* @__PURE__ */ Symbol.for("react.portal"), N = /* @__PURE__ */ Symbol.for("react.fragment"), E = /* @__PURE__ */ Symbol.for("react.strict_mode"), j = /* @__PURE__ */ Symbol.for("react.profiler"), _ = /* @__PURE__ */ Symbol.for("react.consumer"), b = /* @__PURE__ */ Symbol.for("react.context"), S = /* @__PURE__ */ Symbol.for("react.forward_ref"),
|
|
223
|
+
var h = pe, w = /* @__PURE__ */ Symbol.for("react.transitional.element"), x = /* @__PURE__ */ Symbol.for("react.portal"), N = /* @__PURE__ */ Symbol.for("react.fragment"), E = /* @__PURE__ */ Symbol.for("react.strict_mode"), j = /* @__PURE__ */ Symbol.for("react.profiler"), _ = /* @__PURE__ */ Symbol.for("react.consumer"), b = /* @__PURE__ */ Symbol.for("react.context"), S = /* @__PURE__ */ Symbol.for("react.forward_ref"), y = /* @__PURE__ */ Symbol.for("react.suspense"), I = /* @__PURE__ */ Symbol.for("react.suspense_list"), C = /* @__PURE__ */ Symbol.for("react.memo"), p = /* @__PURE__ */ Symbol.for("react.lazy"), k = /* @__PURE__ */ Symbol.for("react.activity"), L = /* @__PURE__ */ Symbol.for("react.client.reference"), B = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Y = Object.prototype.hasOwnProperty, $ = Array.isArray, K = console.createTask ? console.createTask : function() {
|
|
224
224
|
return null;
|
|
225
225
|
};
|
|
226
226
|
h = {
|
|
@@ -489,20 +489,20 @@ function Br({ colDef: n, sortModel: o, onSort: e, onHide: r, onPin: i, pinnedCol
|
|
|
489
489
|
const g = ne(null), [f, m] = Q({ position: "fixed", zIndex: 1300, top: 0, left: 0, visibility: "hidden" });
|
|
490
490
|
pe.useLayoutEffect(() => {
|
|
491
491
|
if (!u || !g.current) return;
|
|
492
|
-
const S = u.getBoundingClientRect(),
|
|
492
|
+
const S = u.getBoundingClientRect(), y = g.current.getBoundingClientRect(), I = window.innerWidth, C = window.innerHeight, p = 8;
|
|
493
493
|
let k = S.left;
|
|
494
|
-
k +
|
|
494
|
+
k + y.width + p > I && (k = I - y.width - p), k < p && (k = p);
|
|
495
495
|
let L = S.bottom + 4;
|
|
496
|
-
L +
|
|
496
|
+
L + y.height + p > C && (L = S.top - y.height - 4), m({ position: "fixed", zIndex: 1300, top: L, left: k, visibility: "visible" });
|
|
497
497
|
}, [u]), ee(() => {
|
|
498
498
|
function S(I) {
|
|
499
499
|
g.current && !g.current.contains(I.target) && u && !u.contains(I.target) && s();
|
|
500
500
|
}
|
|
501
|
-
function
|
|
501
|
+
function y(I) {
|
|
502
502
|
I.key === "Escape" && s();
|
|
503
503
|
}
|
|
504
|
-
return document.addEventListener("mousedown", S), document.addEventListener("keydown",
|
|
505
|
-
document.removeEventListener("mousedown", S), document.removeEventListener("keydown",
|
|
504
|
+
return document.addEventListener("mousedown", S), document.addEventListener("keydown", y), () => {
|
|
505
|
+
document.removeEventListener("mousedown", S), document.removeEventListener("keydown", y);
|
|
506
506
|
};
|
|
507
507
|
}, [u, s]);
|
|
508
508
|
const d = (S) => {
|
|
@@ -699,9 +699,9 @@ function Vr(n) {
|
|
|
699
699
|
dragOverColumn: _,
|
|
700
700
|
onDragStart: b,
|
|
701
701
|
onDragOver: S,
|
|
702
|
-
onDragEnd:
|
|
702
|
+
onDragEnd: y,
|
|
703
703
|
onDrop: I,
|
|
704
|
-
focusedCell:
|
|
704
|
+
focusedCell: C,
|
|
705
705
|
onHeaderClick: p,
|
|
706
706
|
onHideColumn: k,
|
|
707
707
|
onPinColumn: L,
|
|
@@ -712,11 +712,11 @@ function Vr(n) {
|
|
|
712
712
|
K(null);
|
|
713
713
|
};
|
|
714
714
|
pe.useLayoutEffect(() => {
|
|
715
|
-
if (
|
|
716
|
-
const P = Y.current[
|
|
715
|
+
if (C?.id === "HEADER") {
|
|
716
|
+
const P = Y.current[C.field];
|
|
717
717
|
P && P.focus();
|
|
718
718
|
}
|
|
719
|
-
}, [
|
|
719
|
+
}, [C]);
|
|
720
720
|
const te = (P) => () => {
|
|
721
721
|
if (P.sortable === !1 || !u) return;
|
|
722
722
|
const ue = g.find((be) => be.field === P.field);
|
|
@@ -820,7 +820,7 @@ function Vr(n) {
|
|
|
820
820
|
indeterminate: a,
|
|
821
821
|
onChange: (P) => s?.(P.target.checked),
|
|
822
822
|
"aria-label": l ? "Deselect all rows" : "Select all rows",
|
|
823
|
-
tabIndex:
|
|
823
|
+
tabIndex: C?.id === "HEADER" && C.field === "__checkbox_col__" ? 0 : -1,
|
|
824
824
|
onMouseDown: (P) => P.preventDefault(),
|
|
825
825
|
inputRef: (P) => {
|
|
826
826
|
Y.current.__checkbox_col__ = P;
|
|
@@ -848,7 +848,7 @@ function Vr(n) {
|
|
|
848
848
|
Ne && `ogx__header-cell--pinned-${z}`,
|
|
849
849
|
Ie && "ogx__header-cell--dragging",
|
|
850
850
|
ft && "ogx__header-cell--drag-over",
|
|
851
|
-
|
|
851
|
+
C?.id === "HEADER" && C.field === P.field && "ogx__header-cell--focused",
|
|
852
852
|
P.headerClassName
|
|
853
853
|
].filter(Boolean).join(" "), ht = {
|
|
854
854
|
width: m[P.field] ?? P.width ?? 100,
|
|
@@ -883,7 +883,7 @@ function Vr(n) {
|
|
|
883
883
|
draggable: !!b,
|
|
884
884
|
onDragStart: Rt,
|
|
885
885
|
onDragOver: Tt,
|
|
886
|
-
onDragEnd:
|
|
886
|
+
onDragEnd: y,
|
|
887
887
|
onDrop: _t,
|
|
888
888
|
"aria-sort": oe ? be ? g.find((Be) => Be.field === P.field)?.sort === "asc" ? "ascending" : "descending" : "none" : void 0,
|
|
889
889
|
"aria-colindex": ue + 1 + (i ? 1 : 0),
|
|
@@ -1094,7 +1094,7 @@ function Qr(n) {
|
|
|
1094
1094
|
onEditStop: _,
|
|
1095
1095
|
onValueChange: b,
|
|
1096
1096
|
colSpanInfo: S,
|
|
1097
|
-
rowSpan:
|
|
1097
|
+
rowSpan: y,
|
|
1098
1098
|
isHiddenByRowSpan: I
|
|
1099
1099
|
} = n;
|
|
1100
1100
|
if (S?.spannedByColSpan)
|
|
@@ -1110,7 +1110,7 @@ function Qr(n) {
|
|
|
1110
1110
|
"data-colindex": u
|
|
1111
1111
|
}
|
|
1112
1112
|
);
|
|
1113
|
-
const
|
|
1113
|
+
const C = (v) => {
|
|
1114
1114
|
o && (v.stopPropagation(), o({
|
|
1115
1115
|
row: l,
|
|
1116
1116
|
field: a.field,
|
|
@@ -1164,9 +1164,9 @@ function Qr(n) {
|
|
|
1164
1164
|
Y && "ogx__cell--pinned",
|
|
1165
1165
|
Y && `ogx__cell--pinned-${d}`,
|
|
1166
1166
|
E && "ogx__cell--editing",
|
|
1167
|
-
|
|
1167
|
+
y && y > 1 && "ogx__cell--spanned",
|
|
1168
1168
|
$
|
|
1169
|
-
].filter(Boolean).join(" "), q = S?.cellProps?.colSpan || 1, D =
|
|
1169
|
+
].filter(Boolean).join(" "), q = S?.cellProps?.colSpan || 1, D = y || 1, te = S?.cellProps?.width ?? m ?? a.width ?? 100, J = {
|
|
1170
1170
|
width: "var(--width)",
|
|
1171
1171
|
"--width": typeof te == "number" ? `${te}px` : te,
|
|
1172
1172
|
flexGrow: a.flex ?? 0,
|
|
@@ -1189,7 +1189,7 @@ function Qr(n) {
|
|
|
1189
1189
|
ref: we,
|
|
1190
1190
|
className: K,
|
|
1191
1191
|
style: J,
|
|
1192
|
-
onClick:
|
|
1192
|
+
onClick: C,
|
|
1193
1193
|
onDoubleClick: k,
|
|
1194
1194
|
role: "gridcell",
|
|
1195
1195
|
"aria-colindex": u + 1,
|
|
@@ -1320,9 +1320,9 @@ function Cn(n) {
|
|
|
1320
1320
|
rowReordering: _ = !1,
|
|
1321
1321
|
onDragStart: b,
|
|
1322
1322
|
onDragOver: S,
|
|
1323
|
-
onDragEnd:
|
|
1323
|
+
onDragEnd: y,
|
|
1324
1324
|
onDrop: I,
|
|
1325
|
-
isDragging:
|
|
1325
|
+
isDragging: C,
|
|
1326
1326
|
isDragOver: p,
|
|
1327
1327
|
editingCell: k,
|
|
1328
1328
|
onEditStart: L,
|
|
@@ -1378,7 +1378,7 @@ function Cn(n) {
|
|
|
1378
1378
|
r % 2 === 1 && "ogx__row--odd",
|
|
1379
1379
|
Z && "ogx__row--pinned-top",
|
|
1380
1380
|
U && "ogx__row--pinned-bottom",
|
|
1381
|
-
|
|
1381
|
+
C && "ogx__row--dragging",
|
|
1382
1382
|
p && "ogx__row--drag-over",
|
|
1383
1383
|
P && "ogx__row--group"
|
|
1384
1384
|
].filter(Boolean).join(" ");
|
|
@@ -1414,7 +1414,7 @@ function Cn(n) {
|
|
|
1414
1414
|
},
|
|
1415
1415
|
draggable: !0,
|
|
1416
1416
|
onDragStart: b ? b(o.id) : void 0,
|
|
1417
|
-
onDragEnd:
|
|
1417
|
+
onDragEnd: y,
|
|
1418
1418
|
onClick: (z) => z.stopPropagation(),
|
|
1419
1419
|
children: /* @__PURE__ */ t.jsx(ei, {})
|
|
1420
1420
|
}
|
|
@@ -1659,8 +1659,8 @@ function ko(n) {
|
|
|
1659
1659
|
}, E = () => {
|
|
1660
1660
|
i(g - 1);
|
|
1661
1661
|
}, j = (S) => {
|
|
1662
|
-
const
|
|
1663
|
-
l(
|
|
1662
|
+
const y = parseInt(S.target.value, 10);
|
|
1663
|
+
l(y);
|
|
1664
1664
|
}, _ = f === 0, b = f >= g - 1;
|
|
1665
1665
|
return /* @__PURE__ */ t.jsxs("div", { className: "ogx-pagination", role: "navigation", "aria-label": "Pagination", children: [
|
|
1666
1666
|
/* @__PURE__ */ t.jsxs("div", { className: "ogx-pagination__page-size", children: [
|
|
@@ -1924,68 +1924,68 @@ function ii(n) {
|
|
|
1924
1924
|
ee(() => {
|
|
1925
1925
|
o !== m.current && (m.current = o, g({ type: "SET_ROWS", payload: o }));
|
|
1926
1926
|
}, [o]);
|
|
1927
|
-
const d = W((
|
|
1928
|
-
g({ type: "SET_ROWS", payload:
|
|
1929
|
-
}, []), h = W((
|
|
1930
|
-
g({ type: "SET_COLUMNS", payload:
|
|
1931
|
-
}, []), w = W((
|
|
1932
|
-
g({ type: "SET_SORT_MODEL", payload:
|
|
1933
|
-
}, []), x = W((
|
|
1934
|
-
g({ type: "SET_FILTER_MODEL", payload:
|
|
1935
|
-
}, []), N = W((
|
|
1936
|
-
g({ type: "SET_PAGINATION_MODEL", payload:
|
|
1937
|
-
}, []), E = W((
|
|
1938
|
-
g({ type: "SET_SELECTION", payload:
|
|
1939
|
-
}, []), j = W((
|
|
1940
|
-
g({ type: "SET_SCROLL", payload: { scrollTop:
|
|
1941
|
-
}, []), _ = W((
|
|
1942
|
-
g({ type: "SET_DIMENSIONS", payload: { viewportWidth:
|
|
1943
|
-
}, []), b = W((
|
|
1944
|
-
g({ type: "SET_DATASOURCE_LOADING", payload:
|
|
1945
|
-
}, []), S = W((
|
|
1946
|
-
g({ type: "SET_DATASOURCE_ERROR", payload:
|
|
1947
|
-
}, []),
|
|
1948
|
-
g({ type: "SET_ROW_COUNT", payload:
|
|
1927
|
+
const d = W((C, p) => {
|
|
1928
|
+
g({ type: "SET_ROWS", payload: C, preserveRowCount: p });
|
|
1929
|
+
}, []), h = W((C) => {
|
|
1930
|
+
g({ type: "SET_COLUMNS", payload: C });
|
|
1931
|
+
}, []), w = W((C) => {
|
|
1932
|
+
g({ type: "SET_SORT_MODEL", payload: C });
|
|
1933
|
+
}, []), x = W((C) => {
|
|
1934
|
+
g({ type: "SET_FILTER_MODEL", payload: C });
|
|
1935
|
+
}, []), N = W((C) => {
|
|
1936
|
+
g({ type: "SET_PAGINATION_MODEL", payload: C });
|
|
1937
|
+
}, []), E = W((C) => {
|
|
1938
|
+
g({ type: "SET_SELECTION", payload: C });
|
|
1939
|
+
}, []), j = W((C, p) => {
|
|
1940
|
+
g({ type: "SET_SCROLL", payload: { scrollTop: C, scrollLeft: p } });
|
|
1941
|
+
}, []), _ = W((C, p) => {
|
|
1942
|
+
g({ type: "SET_DIMENSIONS", payload: { viewportWidth: C, viewportHeight: p } });
|
|
1943
|
+
}, []), b = W((C) => {
|
|
1944
|
+
g({ type: "SET_DATASOURCE_LOADING", payload: C });
|
|
1945
|
+
}, []), S = W((C) => {
|
|
1946
|
+
g({ type: "SET_DATASOURCE_ERROR", payload: C });
|
|
1947
|
+
}, []), y = W((C) => {
|
|
1948
|
+
g({ type: "SET_ROW_COUNT", payload: C });
|
|
1949
1949
|
}, []), I = ne({
|
|
1950
|
-
getRow: (
|
|
1950
|
+
getRow: (C) => f.current.rows.idRowsLookup.get(C) || null,
|
|
1951
1951
|
getAllRows: () => Array.from(f.current.rows.idRowsLookup.values()),
|
|
1952
1952
|
getVisibleRows: () => Array.from(f.current.rows.idRowsLookup.values()),
|
|
1953
1953
|
getAggregationResult: () => null,
|
|
1954
1954
|
getAggregationModel: () => null,
|
|
1955
|
-
getColumn: (
|
|
1955
|
+
getColumn: (C) => f.current.columns.lookup.get(C) || null,
|
|
1956
1956
|
getAllColumns: () => f.current.columns.all,
|
|
1957
1957
|
getVisibleColumns: () => f.current.columns.all,
|
|
1958
|
-
selectRow: (
|
|
1958
|
+
selectRow: (C, p = !0) => {
|
|
1959
1959
|
const k = new Set(f.current.selection.selectedRows);
|
|
1960
|
-
p ? k.add(
|
|
1960
|
+
p ? k.add(C) : k.delete(C), E(k);
|
|
1961
1961
|
},
|
|
1962
|
-
selectRows: (
|
|
1962
|
+
selectRows: (C, p = !0) => {
|
|
1963
1963
|
const k = new Set(f.current.selection.selectedRows);
|
|
1964
|
-
|
|
1964
|
+
C.forEach((L) => {
|
|
1965
1965
|
p ? k.add(L) : k.delete(L);
|
|
1966
1966
|
}), E(k);
|
|
1967
1967
|
},
|
|
1968
1968
|
getSelectedRows: () => Array.from(f.current.selection.selectedRows),
|
|
1969
|
-
sortColumn: (
|
|
1969
|
+
sortColumn: (C, p) => {
|
|
1970
1970
|
if (p === null)
|
|
1971
|
-
w(f.current.sorting.sortModel.filter((k) => k.field !==
|
|
1971
|
+
w(f.current.sorting.sortModel.filter((k) => k.field !== C));
|
|
1972
1972
|
else {
|
|
1973
|
-
const k = f.current.sorting.sortModel.findIndex((L) => L.field ===
|
|
1973
|
+
const k = f.current.sorting.sortModel.findIndex((L) => L.field === C);
|
|
1974
1974
|
if (k >= 0) {
|
|
1975
1975
|
const L = [...f.current.sorting.sortModel];
|
|
1976
|
-
L[k] = { field:
|
|
1976
|
+
L[k] = { field: C, sort: p }, w(L);
|
|
1977
1977
|
} else
|
|
1978
|
-
w([...f.current.sorting.sortModel, { field:
|
|
1978
|
+
w([...f.current.sorting.sortModel, { field: C, sort: p }]);
|
|
1979
1979
|
}
|
|
1980
1980
|
},
|
|
1981
1981
|
getSortModel: () => f.current.sorting.sortModel,
|
|
1982
1982
|
setFilterModel: x,
|
|
1983
1983
|
getFilterModel: () => f.current.filter.filterModel,
|
|
1984
|
-
setPage: (
|
|
1985
|
-
N({ ...f.current.pagination.paginationModel, page:
|
|
1984
|
+
setPage: (C) => {
|
|
1985
|
+
N({ ...f.current.pagination.paginationModel, page: C });
|
|
1986
1986
|
},
|
|
1987
|
-
setPageSize: (
|
|
1988
|
-
N({ ...f.current.pagination.paginationModel, pageSize:
|
|
1987
|
+
setPageSize: (C) => {
|
|
1988
|
+
N({ ...f.current.pagination.paginationModel, pageSize: C, page: 0 });
|
|
1989
1989
|
},
|
|
1990
1990
|
scrollToIndexes: () => {
|
|
1991
1991
|
},
|
|
@@ -2005,7 +2005,7 @@ function ii(n) {
|
|
|
2005
2005
|
setDimensions: _,
|
|
2006
2006
|
setDataSourceLoading: b,
|
|
2007
2007
|
setDataSourceError: S,
|
|
2008
|
-
setRowCount:
|
|
2008
|
+
setRowCount: y
|
|
2009
2009
|
};
|
|
2010
2010
|
}
|
|
2011
2011
|
function li(n) {
|
|
@@ -2213,9 +2213,9 @@ function hi(n) {
|
|
|
2213
2213
|
rootIds: [],
|
|
2214
2214
|
groupingRows: []
|
|
2215
2215
|
};
|
|
2216
|
-
const b = /* @__PURE__ */ new Map(), S = [],
|
|
2216
|
+
const b = /* @__PURE__ */ new Map(), S = [], y = [], I = /* @__PURE__ */ new Map(), C = (p) => p.join("/");
|
|
2217
2217
|
return o.forEach((p) => {
|
|
2218
|
-
const k = e(p), L = r(p), B =
|
|
2218
|
+
const k = e(p), L = r(p), B = C(L);
|
|
2219
2219
|
I.set(B, k), b.set(k, {
|
|
2220
2220
|
id: k,
|
|
2221
2221
|
parentId: null,
|
|
@@ -2233,7 +2233,7 @@ function hi(n) {
|
|
|
2233
2233
|
}
|
|
2234
2234
|
const B = ($) => {
|
|
2235
2235
|
if ($.length <= 1) return;
|
|
2236
|
-
const K = $.slice(0, -1), q =
|
|
2236
|
+
const K = $.slice(0, -1), q = C(K);
|
|
2237
2237
|
let D = I.get(q);
|
|
2238
2238
|
if (D === void 0 && (D = `auto-group-${q}`, !b.has(D))) {
|
|
2239
2239
|
const te = K[K.length - 1];
|
|
@@ -2251,7 +2251,7 @@ function hi(n) {
|
|
|
2251
2251
|
name: te,
|
|
2252
2252
|
_isGroupRow: !0
|
|
2253
2253
|
};
|
|
2254
|
-
|
|
2254
|
+
y.push(J), K.length === 1 && S.push(D), B(K);
|
|
2255
2255
|
}
|
|
2256
2256
|
return D;
|
|
2257
2257
|
}, Y = B(L);
|
|
@@ -2259,19 +2259,19 @@ function hi(n) {
|
|
|
2259
2259
|
const $ = b.get(Y), K = b.get(k);
|
|
2260
2260
|
$ && K && (K.parentId = Y, $.children = $.children || [], $.children.includes(k) || $.children.push(k));
|
|
2261
2261
|
}
|
|
2262
|
-
}),
|
|
2262
|
+
}), y.forEach((p) => {
|
|
2263
2263
|
const k = p.id, L = b.get(k);
|
|
2264
2264
|
if (!L) return;
|
|
2265
2265
|
const Y = k.replace("auto-group-", "").split("/");
|
|
2266
2266
|
if (Y.length > 1) {
|
|
2267
|
-
const $ = Y.slice(0, -1), K =
|
|
2267
|
+
const $ = Y.slice(0, -1), K = C($), q = I.get(K);
|
|
2268
2268
|
if (q && b.has(q)) {
|
|
2269
2269
|
L.parentId = q;
|
|
2270
2270
|
const D = b.get(q);
|
|
2271
2271
|
D && (D.children = D.children || [], D.children.includes(k) || D.children.push(k));
|
|
2272
2272
|
}
|
|
2273
2273
|
}
|
|
2274
|
-
}), { treeNodes: b, rootIds: S, groupingRows:
|
|
2274
|
+
}), { treeNodes: b, rootIds: S, groupingRows: y };
|
|
2275
2275
|
}, [o, r, i, e]), d = ce(() => {
|
|
2276
2276
|
if (!i) return /* @__PURE__ */ new Set();
|
|
2277
2277
|
const b = /* @__PURE__ */ new Set();
|
|
@@ -2284,26 +2284,26 @@ function hi(n) {
|
|
|
2284
2284
|
}, [d]);
|
|
2285
2285
|
const x = W((b) => {
|
|
2286
2286
|
w((S) => {
|
|
2287
|
-
const
|
|
2288
|
-
if (
|
|
2289
|
-
const
|
|
2290
|
-
|
|
2287
|
+
const y = new Set(S), I = !y.has(b);
|
|
2288
|
+
if (y.has(b) ? y.delete(b) : y.add(b), I && u) {
|
|
2289
|
+
const C = g.get(b);
|
|
2290
|
+
C && u(C);
|
|
2291
2291
|
}
|
|
2292
|
-
return
|
|
2292
|
+
return y;
|
|
2293
2293
|
});
|
|
2294
2294
|
}, [g, u]), N = W(() => {
|
|
2295
2295
|
if (!i) return null;
|
|
2296
2296
|
const b = /* @__PURE__ */ new Map();
|
|
2297
2297
|
o.forEach((B) => b.set(e(B), B)), m.forEach((B) => b.set(B.id, B));
|
|
2298
|
-
const S = (B) => qn(B, a),
|
|
2299
|
-
if (
|
|
2298
|
+
const S = (B) => qn(B, a), y = /* @__PURE__ */ new Map(), I = (B) => {
|
|
2299
|
+
if (y.has(B)) return y.get(B);
|
|
2300
2300
|
const Y = b.get(B);
|
|
2301
2301
|
if (!Y) return !1;
|
|
2302
2302
|
if (S(Y))
|
|
2303
|
-
return
|
|
2303
|
+
return y.set(B, !0), !0;
|
|
2304
2304
|
const K = g.get(B);
|
|
2305
|
-
return K && K.children && K.children.some((D) => I(D)) ? (
|
|
2306
|
-
},
|
|
2305
|
+
return K && K.children && K.children.some((D) => I(D)) ? (y.set(B, !0), !0) : (y.set(B, !1), !1);
|
|
2306
|
+
}, C = (B, Y) => {
|
|
2307
2307
|
if (!s || s.length === 0) return 0;
|
|
2308
2308
|
const $ = b.get(B), K = b.get(Y);
|
|
2309
2309
|
if (!$ || !K) return 0;
|
|
@@ -2314,7 +2314,7 @@ function hi(n) {
|
|
|
2314
2314
|
return 0;
|
|
2315
2315
|
}, p = [], k = /* @__PURE__ */ new Set(), L = (B) => {
|
|
2316
2316
|
const Y = B.filter(($) => I($));
|
|
2317
|
-
Y.sort(
|
|
2317
|
+
Y.sort(C), Y.forEach(($) => {
|
|
2318
2318
|
if (k.has($)) return;
|
|
2319
2319
|
const K = b.get($), q = g.get($);
|
|
2320
2320
|
if (K && q) {
|
|
@@ -2333,11 +2333,11 @@ function hi(n) {
|
|
|
2333
2333
|
return L(f), p;
|
|
2334
2334
|
}, [i, o, m, f, g, h, a, s, e]), E = W((b) => h.has(b), [h]), j = W((b) => g.get(b), [g]), _ = W((b) => {
|
|
2335
2335
|
const S = [];
|
|
2336
|
-
let
|
|
2337
|
-
for (;
|
|
2338
|
-
const I = g.get(
|
|
2336
|
+
let y = b;
|
|
2337
|
+
for (; y !== null; ) {
|
|
2338
|
+
const I = g.get(y);
|
|
2339
2339
|
if (!I) break;
|
|
2340
|
-
S.unshift(I.groupingKey),
|
|
2340
|
+
S.unshift(I.groupingKey), y = I.parentId;
|
|
2341
2341
|
}
|
|
2342
2342
|
return S;
|
|
2343
2343
|
}, [g]);
|
|
@@ -2366,9 +2366,9 @@ function xi(n) {
|
|
|
2366
2366
|
const j = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map(), b = [];
|
|
2367
2367
|
if (r.length === 0)
|
|
2368
2368
|
return { treeNodes: j, rootIds: b, groupingRows: _ };
|
|
2369
|
-
const S = (
|
|
2369
|
+
const S = (C, p, k) => `auto-group-${C}-${p}-${k || "root"}`, y = (C, p, k) => {
|
|
2370
2370
|
if (p >= r.length)
|
|
2371
|
-
return
|
|
2371
|
+
return C.map(($) => {
|
|
2372
2372
|
const K = e($);
|
|
2373
2373
|
return j.set(K, {
|
|
2374
2374
|
id: K,
|
|
@@ -2379,7 +2379,7 @@ function xi(n) {
|
|
|
2379
2379
|
}), K;
|
|
2380
2380
|
});
|
|
2381
2381
|
const L = r[p], B = /* @__PURE__ */ new Map();
|
|
2382
|
-
|
|
2382
|
+
C.forEach(($) => {
|
|
2383
2383
|
const K = $[L], q = String(K);
|
|
2384
2384
|
B.has(q) || B.set(q, []), B.get(q).push($);
|
|
2385
2385
|
});
|
|
@@ -2420,12 +2420,12 @@ function xi(n) {
|
|
|
2420
2420
|
label: `${L}: ${String(D)}`
|
|
2421
2421
|
};
|
|
2422
2422
|
v.aggregationPosition = u(v), j.set(te, v);
|
|
2423
|
-
const H =
|
|
2423
|
+
const H = y($, p + 1, te);
|
|
2424
2424
|
j.get(te).children = H;
|
|
2425
2425
|
const T = $.length;
|
|
2426
2426
|
j.get(te).descendantCount = T;
|
|
2427
2427
|
}), Y;
|
|
2428
|
-
}, I =
|
|
2428
|
+
}, I = y(o, 0, null);
|
|
2429
2429
|
return b.push(...I), { treeNodes: j, rootIds: b, groupingRows: _ };
|
|
2430
2430
|
}, [o, r, i, e, u]);
|
|
2431
2431
|
ee(() => {
|
|
@@ -2450,18 +2450,18 @@ function xi(n) {
|
|
|
2450
2450
|
}, []), x = W((j) => g.has(j), [g]), N = W(() => {
|
|
2451
2451
|
if (r.length === 0) return null;
|
|
2452
2452
|
const j = [], _ = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Map();
|
|
2453
|
-
o.forEach((
|
|
2454
|
-
const S = (
|
|
2455
|
-
const p = m.get(
|
|
2453
|
+
o.forEach((C) => b.set(e(C), C));
|
|
2454
|
+
const S = (C) => {
|
|
2455
|
+
const p = m.get(C);
|
|
2456
2456
|
if (!p) return !1;
|
|
2457
2457
|
if (!p.children || p.children.length === 0) {
|
|
2458
|
-
const k = b.get(
|
|
2458
|
+
const k = b.get(C);
|
|
2459
2459
|
return !(!k || a && !qn(k, a));
|
|
2460
2460
|
}
|
|
2461
2461
|
return p.children.some((k) => S(k));
|
|
2462
|
-
},
|
|
2463
|
-
let p =
|
|
2464
|
-
a && (p =
|
|
2462
|
+
}, y = (C) => {
|
|
2463
|
+
let p = C;
|
|
2464
|
+
a && (p = C.filter(S)), s && s.length > 0 && p.sort((k, L) => {
|
|
2465
2465
|
const B = h.get(k) || b.get(k), Y = h.get(L) || b.get(L);
|
|
2466
2466
|
if (!B || !Y) return 0;
|
|
2467
2467
|
for (const $ of s) {
|
|
@@ -2483,11 +2483,11 @@ function xi(n) {
|
|
|
2483
2483
|
_groupingValue: L.groupingValue,
|
|
2484
2484
|
_descendantCount: L.descendantCount
|
|
2485
2485
|
};
|
|
2486
|
-
j.push($), I.has(k) && B &&
|
|
2486
|
+
j.push($), I.has(k) && B && y(L.children);
|
|
2487
2487
|
}
|
|
2488
2488
|
});
|
|
2489
2489
|
}, I = g;
|
|
2490
|
-
return
|
|
2490
|
+
return y(d), j;
|
|
2491
2491
|
}, [o, e, m, d, h, a, s, g]), E = W((j) => m.get(j), [m]);
|
|
2492
2492
|
return ce(() => ({
|
|
2493
2493
|
treeNodes: m,
|
|
@@ -2565,42 +2565,42 @@ function wi(n, o, e) {
|
|
|
2565
2565
|
}, []), u = W((x, N) => r.get(x)?.[N], [r]), g = W((x, N, E, j, _) => {
|
|
2566
2566
|
const b = new Map(r);
|
|
2567
2567
|
for (let S = j; S < _; S++) {
|
|
2568
|
-
const
|
|
2569
|
-
if (!
|
|
2568
|
+
const y = o[S];
|
|
2569
|
+
if (!y) continue;
|
|
2570
2570
|
let I = 1;
|
|
2571
|
-
if (
|
|
2572
|
-
if (typeof
|
|
2571
|
+
if (y.colSpan)
|
|
2572
|
+
if (typeof y.colSpan == "function") {
|
|
2573
2573
|
const p = {
|
|
2574
2574
|
row: N,
|
|
2575
|
-
value: N[
|
|
2576
|
-
field:
|
|
2577
|
-
colDef:
|
|
2575
|
+
value: N[y.field],
|
|
2576
|
+
field: y.field,
|
|
2577
|
+
colDef: y,
|
|
2578
2578
|
rowIndex: E,
|
|
2579
2579
|
colIndex: S
|
|
2580
2580
|
};
|
|
2581
|
-
I =
|
|
2581
|
+
I = y.colSpan(p);
|
|
2582
2582
|
} else
|
|
2583
|
-
I =
|
|
2583
|
+
I = y.colSpan;
|
|
2584
2584
|
if (I <= 1) {
|
|
2585
|
-
qt(b, x,
|
|
2585
|
+
qt(b, x, y.field, {
|
|
2586
2586
|
spannedByColSpan: !1,
|
|
2587
|
-
cellProps: { colSpan: 1, width: e[
|
|
2587
|
+
cellProps: { colSpan: 1, width: e[y.field] || 100 }
|
|
2588
2588
|
});
|
|
2589
2589
|
continue;
|
|
2590
2590
|
}
|
|
2591
|
-
let
|
|
2591
|
+
let C = e[y.field] || 100;
|
|
2592
2592
|
for (let p = 1; p < I; p++)
|
|
2593
2593
|
if (S + p < _) {
|
|
2594
2594
|
const k = o[S + p];
|
|
2595
|
-
k && (
|
|
2595
|
+
k && (C += e[k.field] || 100, qt(b, x, k.field, {
|
|
2596
2596
|
spannedByColSpan: !0,
|
|
2597
2597
|
leftVisibleCellIndex: S,
|
|
2598
2598
|
rightVisibleCellIndex: Math.min(S + I - 1, o.length - 1)
|
|
2599
2599
|
}));
|
|
2600
2600
|
}
|
|
2601
|
-
qt(b, x,
|
|
2601
|
+
qt(b, x, y.field, {
|
|
2602
2602
|
spannedByColSpan: !1,
|
|
2603
|
-
cellProps: { colSpan: I, width:
|
|
2603
|
+
cellProps: { colSpan: I, width: C }
|
|
2604
2604
|
}), S += I - 1;
|
|
2605
2605
|
}
|
|
2606
2606
|
i(b);
|
|
@@ -2608,18 +2608,18 @@ function wi(n, o, e) {
|
|
|
2608
2608
|
const E = {}, j = {}, _ = {};
|
|
2609
2609
|
o.forEach((b, S) => {
|
|
2610
2610
|
if (b.rowSpan)
|
|
2611
|
-
for (let
|
|
2612
|
-
const I = n[
|
|
2611
|
+
for (let y = x; y < N; y++) {
|
|
2612
|
+
const I = n[y];
|
|
2613
2613
|
if (!I || j[I.id]?.[b.field]) continue;
|
|
2614
|
-
const
|
|
2614
|
+
const C = b.valueGetter ? b.valueGetter({ row: I, field: b.field, value: I[b.field] }) : I[b.field];
|
|
2615
2615
|
let p = 1;
|
|
2616
2616
|
if (typeof b.rowSpan == "function") {
|
|
2617
2617
|
const k = {
|
|
2618
2618
|
row: I,
|
|
2619
|
-
value:
|
|
2619
|
+
value: C,
|
|
2620
2620
|
field: b.field,
|
|
2621
2621
|
colDef: b,
|
|
2622
|
-
rowIndex:
|
|
2622
|
+
rowIndex: y,
|
|
2623
2623
|
colIndex: S
|
|
2624
2624
|
};
|
|
2625
2625
|
p = b.rowSpan(k);
|
|
@@ -2627,10 +2627,10 @@ function wi(n, o, e) {
|
|
|
2627
2627
|
if (p > 1) {
|
|
2628
2628
|
E[I.id] || (E[I.id] = {}), E[I.id][b.field] = p;
|
|
2629
2629
|
for (let k = 1; k < p; k++) {
|
|
2630
|
-
const L =
|
|
2630
|
+
const L = y + k;
|
|
2631
2631
|
if (L < N && n[L]) {
|
|
2632
2632
|
const B = n[L];
|
|
2633
|
-
j[B.id] || (j[B.id] = {}), j[B.id][b.field] = !0, _[L] || (_[L] = {}), _[L][b.field] =
|
|
2633
|
+
j[B.id] || (j[B.id] = {}), j[B.id][b.field] = !0, _[L] || (_[L] = {}), _[L][b.field] = y;
|
|
2634
2634
|
}
|
|
2635
2635
|
}
|
|
2636
2636
|
}
|
|
@@ -2653,46 +2653,46 @@ function wi(n, o, e) {
|
|
|
2653
2653
|
const x = /* @__PURE__ */ new Map();
|
|
2654
2654
|
n.forEach((_, b) => {
|
|
2655
2655
|
for (let S = 0; S < o.length; S++) {
|
|
2656
|
-
const
|
|
2657
|
-
if (!
|
|
2656
|
+
const y = o[S];
|
|
2657
|
+
if (!y) continue;
|
|
2658
2658
|
let I = 1;
|
|
2659
|
-
if (
|
|
2660
|
-
if (typeof
|
|
2659
|
+
if (y.colSpan)
|
|
2660
|
+
if (typeof y.colSpan == "function") {
|
|
2661
2661
|
const p = {
|
|
2662
2662
|
row: _,
|
|
2663
|
-
value: _[
|
|
2664
|
-
field:
|
|
2665
|
-
colDef:
|
|
2663
|
+
value: _[y.field],
|
|
2664
|
+
field: y.field,
|
|
2665
|
+
colDef: y,
|
|
2666
2666
|
rowIndex: b,
|
|
2667
2667
|
colIndex: S
|
|
2668
2668
|
};
|
|
2669
|
-
I =
|
|
2669
|
+
I = y.colSpan(p);
|
|
2670
2670
|
} else
|
|
2671
|
-
I =
|
|
2671
|
+
I = y.colSpan;
|
|
2672
2672
|
if (I <= 1) {
|
|
2673
|
-
const p = e[
|
|
2674
|
-
qt(x, _.id,
|
|
2673
|
+
const p = e[y.field] || (typeof y.width == "number" ? y.width : 100);
|
|
2674
|
+
qt(x, _.id, y.field, {
|
|
2675
2675
|
spannedByColSpan: !1,
|
|
2676
2676
|
cellProps: { colSpan: 1, width: p }
|
|
2677
2677
|
});
|
|
2678
2678
|
continue;
|
|
2679
2679
|
}
|
|
2680
|
-
let
|
|
2680
|
+
let C = e[y.field] || (typeof y.width == "number" ? y.width : 100);
|
|
2681
2681
|
for (let p = 1; p < I; p++)
|
|
2682
2682
|
if (S + p < o.length) {
|
|
2683
2683
|
const k = o[S + p];
|
|
2684
2684
|
if (k) {
|
|
2685
2685
|
const L = e[k.field] || (typeof k.width == "number" ? k.width : 100);
|
|
2686
|
-
|
|
2686
|
+
C += L, qt(x, _.id, k.field, {
|
|
2687
2687
|
spannedByColSpan: !0,
|
|
2688
2688
|
leftVisibleCellIndex: S,
|
|
2689
2689
|
rightVisibleCellIndex: Math.min(S + I - 1, o.length - 1)
|
|
2690
2690
|
});
|
|
2691
2691
|
}
|
|
2692
2692
|
}
|
|
2693
|
-
qt(x, _.id,
|
|
2693
|
+
qt(x, _.id, y.field, {
|
|
2694
2694
|
spannedByColSpan: !1,
|
|
2695
|
-
cellProps: { colSpan: I, width:
|
|
2695
|
+
cellProps: { colSpan: I, width: C }
|
|
2696
2696
|
}), S += I - 1;
|
|
2697
2697
|
}
|
|
2698
2698
|
}), i(x);
|
|
@@ -2700,24 +2700,24 @@ function wi(n, o, e) {
|
|
|
2700
2700
|
o.forEach((_, b) => {
|
|
2701
2701
|
if (_.rowSpan)
|
|
2702
2702
|
for (let S = 0; S < n.length; S++) {
|
|
2703
|
-
const
|
|
2704
|
-
if (!
|
|
2705
|
-
const I = _.valueGetter ? _.valueGetter({ row:
|
|
2706
|
-
let
|
|
2703
|
+
const y = n[S];
|
|
2704
|
+
if (!y || E[y.id]?.[_.field]) continue;
|
|
2705
|
+
const I = _.valueGetter ? _.valueGetter({ row: y, field: _.field, value: y[_.field] }) : y[_.field];
|
|
2706
|
+
let C = 1;
|
|
2707
2707
|
if (typeof _.rowSpan == "function") {
|
|
2708
2708
|
const p = {
|
|
2709
|
-
row:
|
|
2709
|
+
row: y,
|
|
2710
2710
|
value: I,
|
|
2711
2711
|
field: _.field,
|
|
2712
2712
|
colDef: _,
|
|
2713
2713
|
rowIndex: S,
|
|
2714
2714
|
colIndex: b
|
|
2715
2715
|
};
|
|
2716
|
-
|
|
2717
|
-
} else typeof _.rowSpan == "number" && (
|
|
2718
|
-
if (
|
|
2719
|
-
N[
|
|
2720
|
-
for (let p = 1; p <
|
|
2716
|
+
C = _.rowSpan(p);
|
|
2717
|
+
} else typeof _.rowSpan == "number" && (C = _.rowSpan);
|
|
2718
|
+
if (C > 1) {
|
|
2719
|
+
N[y.id] || (N[y.id] = {}), N[y.id][_.field] = C;
|
|
2720
|
+
for (let p = 1; p < C; p++) {
|
|
2721
2721
|
const k = S + p;
|
|
2722
2722
|
if (k < n.length && n[k]) {
|
|
2723
2723
|
const L = n[k];
|
|
@@ -2777,25 +2777,25 @@ function vi(n) {
|
|
|
2777
2777
|
aggregationModel: u
|
|
2778
2778
|
};
|
|
2779
2779
|
try {
|
|
2780
|
-
const
|
|
2780
|
+
const y = await o.getRows(S);
|
|
2781
2781
|
if (j !== x.current)
|
|
2782
2782
|
return;
|
|
2783
2783
|
let I = !1;
|
|
2784
2784
|
if (l === "infinite") {
|
|
2785
|
-
const
|
|
2786
|
-
if (
|
|
2787
|
-
const p = JSON.stringify(
|
|
2788
|
-
!p && !k && !L && i.page >
|
|
2785
|
+
const C = w.current;
|
|
2786
|
+
if (C) {
|
|
2787
|
+
const p = JSON.stringify(C.sortModel) !== JSON.stringify(e), k = JSON.stringify(C.filterModel) !== JSON.stringify(r), L = C.pageSize !== i.pageSize;
|
|
2788
|
+
!p && !k && !L && i.page > C.page && (I = !0);
|
|
2789
2789
|
}
|
|
2790
2790
|
}
|
|
2791
|
-
g(I ? (
|
|
2791
|
+
g(I ? (C) => [...C, ...y.rows] : y.rows, !0), y.aggregationResults && h && h(y.aggregationResults), y.rowCount !== void 0 && f(y.rowCount), w.current = {
|
|
2792
2792
|
sortModel: e,
|
|
2793
2793
|
filterModel: r,
|
|
2794
2794
|
page: i.page,
|
|
2795
2795
|
pageSize: i.pageSize
|
|
2796
2796
|
};
|
|
2797
|
-
} catch (
|
|
2798
|
-
j === x.current && (d(
|
|
2797
|
+
} catch (y) {
|
|
2798
|
+
j === x.current && (d(y), console.error("Data Source Error:", y));
|
|
2799
2799
|
} finally {
|
|
2800
2800
|
j === x.current && m(!1);
|
|
2801
2801
|
}
|
|
@@ -2833,7 +2833,7 @@ function vi(n) {
|
|
|
2833
2833
|
groupKeys: _
|
|
2834
2834
|
});
|
|
2835
2835
|
b.rows.length > 0 && g((S) => {
|
|
2836
|
-
const
|
|
2836
|
+
const y = new Set(S.map((C) => C.id)), I = b.rows.filter((C) => !y.has(C.id));
|
|
2837
2837
|
return [...S, ...I];
|
|
2838
2838
|
});
|
|
2839
2839
|
} catch (b) {
|
|
@@ -2886,8 +2886,8 @@ function _i(n) {
|
|
|
2886
2886
|
console.warn(`[useAggregation] Unknown aggregation function: "${b}"`);
|
|
2887
2887
|
continue;
|
|
2888
2888
|
}
|
|
2889
|
-
const
|
|
2890
|
-
j[_] = S(
|
|
2889
|
+
const y = o.map((I) => I[_]);
|
|
2890
|
+
j[_] = S(y);
|
|
2891
2891
|
}
|
|
2892
2892
|
return j;
|
|
2893
2893
|
}, [o, e, r]), [g, f] = Q({}), [m, d] = Q(!1), [h, w] = Q(null), x = ne(0), N = W(async () => {
|
|
@@ -2994,10 +2994,10 @@ function Ci(n, o, e, r) {
|
|
|
2994
2994
|
align: "right",
|
|
2995
2995
|
headerAlign: "right",
|
|
2996
2996
|
sortable: !0,
|
|
2997
|
-
valueFormatter: ({ value:
|
|
2998
|
-
if (
|
|
2999
|
-
const I = Number(
|
|
3000
|
-
return E.aggFn === "avg" ? I.toFixed(2) : E.aggFn === "count" ? I.toLocaleString() : j?.valueFormatter ? j.valueFormatter({ value:
|
|
2997
|
+
valueFormatter: ({ value: y }) => {
|
|
2998
|
+
if (y == null) return "—";
|
|
2999
|
+
const I = Number(y);
|
|
3000
|
+
return E.aggFn === "avg" ? I.toFixed(2) : E.aggFn === "count" ? I.toLocaleString() : j?.valueFormatter ? j.valueFormatter({ value: y, row: {}, field: E.field }) : I.toLocaleString();
|
|
3001
3001
|
}
|
|
3002
3002
|
});
|
|
3003
3003
|
}
|
|
@@ -3159,9 +3159,9 @@ function el(n) {
|
|
|
3159
3159
|
pageSizeOptions: _ = [10, 25, 50, 100],
|
|
3160
3160
|
pinnedColumns: b,
|
|
3161
3161
|
onPinnedColumnsChange: S,
|
|
3162
|
-
pinnedRows:
|
|
3162
|
+
pinnedRows: y,
|
|
3163
3163
|
getDetailPanelContent: I,
|
|
3164
|
-
getDetailPanelHeight:
|
|
3164
|
+
getDetailPanelHeight: C,
|
|
3165
3165
|
detailPanelExpandedRowIds: p,
|
|
3166
3166
|
onDetailPanelExpandedRowIdsChange: k,
|
|
3167
3167
|
pinCheckboxColumn: L = !0,
|
|
@@ -3453,7 +3453,7 @@ function el(n) {
|
|
|
3453
3453
|
Qe,
|
|
3454
3454
|
it
|
|
3455
3455
|
]);
|
|
3456
|
-
const pn = ce(() => oe ? Array.from(de.rows.idRowsLookup.values()) : en, [oe, de.rows.idRowsLookup, en]), Ve = ce(() => He ? He.getVisibleRows() || [] : nt === "server" && oe ? pn : ui(pn, Ye), [pn, Ye, He, nt, oe]), { top: Xe, center: Ht, bottom: dt } = ce(() => He ? { top: [], center: Ve, bottom: [] } : Pr(Ve,
|
|
3456
|
+
const pn = ce(() => oe ? Array.from(de.rows.idRowsLookup.values()) : en, [oe, de.rows.idRowsLookup, en]), Ve = ce(() => He ? He.getVisibleRows() || [] : nt === "server" && oe ? pn : ui(pn, Ye), [pn, Ye, He, nt, oe]), { top: Xe, center: Ht, bottom: dt } = ce(() => He ? { top: [], center: Ve, bottom: [] } : Pr(Ve, y), [Ve, y, He]), Le = ce(() => He || be === "server" && oe ? Ht : fi(Ht, ot), [Ht, ot, He, be, oe]), pt = ce(() => {
|
|
3457
3457
|
if (!Me || z === "server" && oe)
|
|
3458
3458
|
return Le;
|
|
3459
3459
|
const c = xe.page * xe.pageSize, R = c + xe.pageSize;
|
|
@@ -3510,7 +3510,7 @@ function el(n) {
|
|
|
3510
3510
|
const c = i, R = Me ? pt : Le, M = R.map((F, X) => {
|
|
3511
3511
|
let re = c;
|
|
3512
3512
|
if (yt.has(F.id)) {
|
|
3513
|
-
const De =
|
|
3513
|
+
const De = C?.({ row: F, id: F.id, rowIndex: Xe.length + X }) ?? 200;
|
|
3514
3514
|
re += typeof De == "number" ? De : parseInt(String(De), 10) || 200;
|
|
3515
3515
|
}
|
|
3516
3516
|
return re;
|
|
@@ -3677,11 +3677,11 @@ function el(n) {
|
|
|
3677
3677
|
pt,
|
|
3678
3678
|
Le,
|
|
3679
3679
|
yt,
|
|
3680
|
-
|
|
3680
|
+
C,
|
|
3681
3681
|
Xe.length,
|
|
3682
3682
|
dt.length,
|
|
3683
3683
|
yt,
|
|
3684
|
-
|
|
3684
|
+
C,
|
|
3685
3685
|
Xe.length,
|
|
3686
3686
|
dt.length,
|
|
3687
3687
|
mo,
|
|
@@ -4239,11 +4239,11 @@ function el(n) {
|
|
|
4239
4239
|
onSelectionChange: Vt,
|
|
4240
4240
|
columnWidths: at,
|
|
4241
4241
|
pinnedColumns: it,
|
|
4242
|
-
pinnedRows:
|
|
4242
|
+
pinnedRows: y,
|
|
4243
4243
|
hasDetailPanel: et,
|
|
4244
4244
|
isDetailPanelExpanded: yt.has(c.id),
|
|
4245
4245
|
detailPanelContent: I ? I({ row: c, id: c.id, rowIndex: R }) : null,
|
|
4246
|
-
detailPanelHeight:
|
|
4246
|
+
detailPanelHeight: C?.({ row: c, id: c.id, rowIndex: R }) || 200,
|
|
4247
4247
|
onDetailPanelToggle: on,
|
|
4248
4248
|
pinCheckboxColumn: L,
|
|
4249
4249
|
pinExpandColumn: B,
|
|
@@ -4291,7 +4291,7 @@ function el(n) {
|
|
|
4291
4291
|
},
|
|
4292
4292
|
`skeleton-${M}`
|
|
4293
4293
|
));
|
|
4294
|
-
})() : bo.filter(({ row: c }) => !Xn(c.id,
|
|
4294
|
+
})() : bo.filter(({ row: c }) => !Xn(c.id, y)).filter(
|
|
4295
4295
|
(c, R, M) => R === M.findIndex((V) => V.row.id === c.row.id)
|
|
4296
4296
|
).map(({ row: c, rowIndex: R }) => /* @__PURE__ */ t.jsx(
|
|
4297
4297
|
Cn,
|
|
@@ -4306,11 +4306,11 @@ function el(n) {
|
|
|
4306
4306
|
onSelectionChange: Vt,
|
|
4307
4307
|
columnWidths: at,
|
|
4308
4308
|
pinnedColumns: it,
|
|
4309
|
-
pinnedRows:
|
|
4309
|
+
pinnedRows: y,
|
|
4310
4310
|
hasDetailPanel: et,
|
|
4311
4311
|
isDetailPanelExpanded: yt.has(c.id),
|
|
4312
4312
|
detailPanelContent: I ? I({ row: c, id: c.id, rowIndex: R }) : null,
|
|
4313
|
-
detailPanelHeight:
|
|
4313
|
+
detailPanelHeight: C?.({ row: c, id: c.id, rowIndex: R }) || 200,
|
|
4314
4314
|
onDetailPanelToggle: on,
|
|
4315
4315
|
pinCheckboxColumn: L,
|
|
4316
4316
|
pinExpandColumn: B,
|
|
@@ -4363,11 +4363,11 @@ function el(n) {
|
|
|
4363
4363
|
onSelectionChange: Vt,
|
|
4364
4364
|
columnWidths: at,
|
|
4365
4365
|
pinnedColumns: it,
|
|
4366
|
-
pinnedRows:
|
|
4366
|
+
pinnedRows: y,
|
|
4367
4367
|
hasDetailPanel: et,
|
|
4368
4368
|
isDetailPanelExpanded: yt.has(c.id),
|
|
4369
4369
|
detailPanelContent: I ? I({ row: c, id: c.id, rowIndex: R }) : null,
|
|
4370
|
-
detailPanelHeight:
|
|
4370
|
+
detailPanelHeight: C?.({ row: c, id: c.id, rowIndex: R }) || 200,
|
|
4371
4371
|
onDetailPanelToggle: on,
|
|
4372
4372
|
pinCheckboxColumn: L,
|
|
4373
4373
|
pinExpandColumn: B,
|
|
@@ -4654,7 +4654,7 @@ function Mi({ anchorRef: n, columns: o, model: e, onChange: r, onClose: i }) {
|
|
|
4654
4654
|
function b() {
|
|
4655
4655
|
r({ rowFields: [], columnFields: [], valueFields: [] });
|
|
4656
4656
|
}
|
|
4657
|
-
const S = new Set(o.filter((p) => p.type === "number" || p.aggregable).map((p) => p.field)),
|
|
4657
|
+
const S = new Set(o.filter((p) => p.type === "number" || p.aggregable).map((p) => p.field)), y = e.rowFields.length + e.columnFields.length + e.valueFields.length, I = (p) => o.find((k) => k.field === p)?.headerName ?? p, C = /* @__PURE__ */ t.jsxs(
|
|
4658
4658
|
"div",
|
|
4659
4659
|
{
|
|
4660
4660
|
ref: l,
|
|
@@ -4668,7 +4668,7 @@ function Mi({ anchorRef: n, columns: o, model: e, onChange: r, onClose: i }) {
|
|
|
4668
4668
|
/* @__PURE__ */ t.jsx(Po, {}),
|
|
4669
4669
|
"Pivot Mode"
|
|
4670
4670
|
] }),
|
|
4671
|
-
|
|
4671
|
+
y > 0 && /* @__PURE__ */ t.jsx("button", { className: "ogx-pivot-panel__reset-btn", onClick: b, title: "Reset pivot", children: "Reset" })
|
|
4672
4672
|
] }),
|
|
4673
4673
|
/* @__PURE__ */ t.jsxs("div", { className: "ogx-pivot-panel__body", children: [
|
|
4674
4674
|
/* @__PURE__ */ t.jsxs("div", { className: "ogx-pivot-zone", children: [
|
|
@@ -4754,7 +4754,7 @@ function Mi({ anchorRef: n, columns: o, model: e, onChange: r, onClose: i }) {
|
|
|
4754
4754
|
]
|
|
4755
4755
|
}
|
|
4756
4756
|
);
|
|
4757
|
-
return Mt.createPortal(
|
|
4757
|
+
return Mt.createPortal(C, document.body);
|
|
4758
4758
|
}
|
|
4759
4759
|
function Li() {
|
|
4760
4760
|
return /* @__PURE__ */ t.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
@@ -5138,7 +5138,7 @@ function nl({
|
|
|
5138
5138
|
ee(() => {
|
|
5139
5139
|
g && (_(!0), x(!1), E(!1), S(!1));
|
|
5140
5140
|
}, [g]);
|
|
5141
|
-
const
|
|
5141
|
+
const y = ne(null), I = ne(null), C = ne(null), p = ne(null), k = r ?? $i, L = k.rowFields.length > 0 || k.columnFields.length > 0 || k.valueFields.length > 0, B = n.filter(
|
|
5142
5142
|
(T) => T.aggregable !== !1 && (T.type === "number" || T.aggregable === !0)
|
|
5143
5143
|
), Y = Object.keys(o).filter(
|
|
5144
5144
|
(T) => o[T] && o[T] !== "none"
|
|
@@ -5194,7 +5194,7 @@ function nl({
|
|
|
5194
5194
|
/* @__PURE__ */ t.jsx(Sn, { title: "Columns", children: /* @__PURE__ */ t.jsx(
|
|
5195
5195
|
"button",
|
|
5196
5196
|
{
|
|
5197
|
-
ref:
|
|
5197
|
+
ref: C,
|
|
5198
5198
|
className: `ogx-toolbar__icon-btn${j ? " ogx-toolbar__icon-btn--active" : ""}`,
|
|
5199
5199
|
"aria-label": "Manage columns",
|
|
5200
5200
|
onClick: () => {
|
|
@@ -5206,7 +5206,7 @@ function nl({
|
|
|
5206
5206
|
j && /* @__PURE__ */ t.jsx(
|
|
5207
5207
|
zi,
|
|
5208
5208
|
{
|
|
5209
|
-
anchorRef:
|
|
5209
|
+
anchorRef: C,
|
|
5210
5210
|
columns: n,
|
|
5211
5211
|
visibleColumns: J,
|
|
5212
5212
|
onVisibilityChange: we,
|
|
@@ -5281,7 +5281,7 @@ function nl({
|
|
|
5281
5281
|
/* @__PURE__ */ t.jsx(Sn, { title: "Summaries", children: /* @__PURE__ */ t.jsxs(
|
|
5282
5282
|
"button",
|
|
5283
5283
|
{
|
|
5284
|
-
ref:
|
|
5284
|
+
ref: y,
|
|
5285
5285
|
id: "ogx-aggregation-btn",
|
|
5286
5286
|
className: `ogx-toolbar__icon-btn${w ? " ogx-toolbar__icon-btn--active" : ""}`,
|
|
5287
5287
|
"aria-label": "Configure summaries",
|
|
@@ -5299,7 +5299,7 @@ function nl({
|
|
|
5299
5299
|
w && /* @__PURE__ */ t.jsx(
|
|
5300
5300
|
Ai,
|
|
5301
5301
|
{
|
|
5302
|
-
anchorRef:
|
|
5302
|
+
anchorRef: y,
|
|
5303
5303
|
aggregationModel: o,
|
|
5304
5304
|
aggregableColumns: B,
|
|
5305
5305
|
onFunctionChange: $,
|
|
@@ -5616,15 +5616,15 @@ async function dl(n, o, e = {}) {
|
|
|
5616
5616
|
aggregationResult: f = null,
|
|
5617
5617
|
aggregationModel: m = null,
|
|
5618
5618
|
selectedRows: d
|
|
5619
|
-
} = e, h = (await import("
|
|
5619
|
+
} = e, h = (await import("exceljs")).default, w = new h.Workbook();
|
|
5620
5620
|
w.creator = "OpenGridX", w.created = /* @__PURE__ */ new Date();
|
|
5621
5621
|
const x = o.filter(
|
|
5622
|
-
(
|
|
5623
|
-
), N = n, E = d && d.length > 0 ? n.filter((
|
|
5624
|
-
for (const
|
|
5625
|
-
if ("type" in
|
|
5622
|
+
(C) => C.field !== "__check__" && C.field !== "__actions__" && !C.isSpacer
|
|
5623
|
+
), N = n, E = d && d.length > 0 ? n.filter((C) => d.includes(C.id)) : n, j = i ?? [{ name: "Data", rows: "all", includeHeaders: !0, includeSummary: !1 }], _ = /* @__PURE__ */ new Map();
|
|
5624
|
+
for (const C of j) {
|
|
5625
|
+
if ("type" in C && C.type === "summary") {
|
|
5626
5626
|
if (!f || !m) continue;
|
|
5627
|
-
const v = w.addWorksheet(
|
|
5627
|
+
const v = w.addWorksheet(C.name ?? "Summary");
|
|
5628
5628
|
v.addRow(["Summary / Aggregation Totals"]), v.getRow(1).font = { bold: !0, size: u + 2, color: { argb: St(s) } }, v.addRow([]), v.addRow(["Column", "Function", "Value"]).eachCell((T) => {
|
|
5629
5629
|
T.fill = { type: "pattern", pattern: "solid", fgColor: { argb: St(a) } }, T.font = { bold: !0, size: u, color: { argb: St(s) } }, T.border = jo();
|
|
5630
5630
|
}), x.forEach((T) => {
|
|
@@ -5637,7 +5637,7 @@ async function dl(n, o, e = {}) {
|
|
|
5637
5637
|
}), v.getColumn(1).width = 20, v.getColumn(2).width = 12, v.getColumn(3).width = 18;
|
|
5638
5638
|
continue;
|
|
5639
5639
|
}
|
|
5640
|
-
const p =
|
|
5640
|
+
const p = C, {
|
|
5641
5641
|
name: k = "Data",
|
|
5642
5642
|
rows: L = "all",
|
|
5643
5643
|
includeHeaders: B = !0,
|
|
@@ -5738,8 +5738,8 @@ async function dl(n, o, e = {}) {
|
|
|
5738
5738
|
}
|
|
5739
5739
|
const b = await w.xlsx.writeBuffer(), S = new Blob([b], {
|
|
5740
5740
|
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
5741
|
-
}),
|
|
5742
|
-
I.href =
|
|
5741
|
+
}), y = URL.createObjectURL(S), I = document.createElement("a");
|
|
5742
|
+
I.href = y, I.download = r.endsWith(".xlsx") ? r : `${r}.xlsx`, document.body.appendChild(I), I.click(), document.body.removeChild(I), URL.revokeObjectURL(y);
|
|
5743
5743
|
}
|
|
5744
5744
|
function St(n) {
|
|
5745
5745
|
const o = n.replace("#", "");
|