@opencorestack/opengridx 0.1.0 → 0.1.2
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 +195 -118
- package/dist/opengridx.es.js +720 -720
- 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 +2 -18
- package/dist/exceljs.min-CrbHmMCD.js +0 -22597
- package/dist/exceljs.min-CrbHmMCD.js.map +0 -1
package/dist/opengridx.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import pe, { useState as Q, useRef as ne, useCallback as W, useEffect as ee, useMemo as
|
|
1
|
+
import pe, { useState as Q, useRef as ne, useCallback as W, useEffect as ee, useMemo as de, useReducer as Cr, useLayoutEffect as kr } from "react";
|
|
2
2
|
import Mt from "react-dom";
|
|
3
|
-
var
|
|
3
|
+
var Cn = { exports: {} }, ln = {};
|
|
4
4
|
var _o;
|
|
5
5
|
function Sr() {
|
|
6
6
|
if (_o) return ln;
|
|
@@ -27,146 +27,146 @@ var sn = {};
|
|
|
27
27
|
var yo;
|
|
28
28
|
function jr() {
|
|
29
29
|
return yo || (yo = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
30
|
-
function n(
|
|
31
|
-
if (
|
|
32
|
-
if (typeof
|
|
33
|
-
return
|
|
34
|
-
if (typeof
|
|
35
|
-
switch (
|
|
30
|
+
function n(b) {
|
|
31
|
+
if (b == null) return null;
|
|
32
|
+
if (typeof b == "function")
|
|
33
|
+
return b.$$typeof === L ? null : b.displayName || b.name || null;
|
|
34
|
+
if (typeof b == "string") return b;
|
|
35
|
+
switch (b) {
|
|
36
36
|
case N:
|
|
37
37
|
return "Fragment";
|
|
38
38
|
case j:
|
|
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";
|
|
46
46
|
case k:
|
|
47
47
|
return "Activity";
|
|
48
48
|
}
|
|
49
|
-
if (typeof
|
|
50
|
-
switch (typeof
|
|
49
|
+
if (typeof b == "object")
|
|
50
|
+
switch (typeof b.tag == "number" && console.error(
|
|
51
51
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
52
|
-
),
|
|
52
|
+
), b.$$typeof) {
|
|
53
53
|
case x:
|
|
54
54
|
return "Portal";
|
|
55
|
-
case
|
|
56
|
-
return
|
|
55
|
+
case v:
|
|
56
|
+
return b.displayName || "Context";
|
|
57
57
|
case _:
|
|
58
|
-
return (
|
|
58
|
+
return (b._context.displayName || "Context") + ".Consumer";
|
|
59
59
|
case S:
|
|
60
|
-
var H =
|
|
61
|
-
return
|
|
62
|
-
case
|
|
63
|
-
return H =
|
|
60
|
+
var H = b.render;
|
|
61
|
+
return b = b.displayName, b || (b = H.displayName || H.name || "", b = b !== "" ? "ForwardRef(" + b + ")" : "ForwardRef"), b;
|
|
62
|
+
case C:
|
|
63
|
+
return H = b.displayName || null, H !== null ? H : n(b.type) || "Memo";
|
|
64
64
|
case p:
|
|
65
|
-
H =
|
|
65
|
+
H = b._payload, b = b._init;
|
|
66
66
|
try {
|
|
67
|
-
return n(
|
|
67
|
+
return n(b(H));
|
|
68
68
|
} catch {
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
return null;
|
|
72
72
|
}
|
|
73
|
-
function o(
|
|
74
|
-
return "" +
|
|
73
|
+
function o(b) {
|
|
74
|
+
return "" + b;
|
|
75
75
|
}
|
|
76
|
-
function e(
|
|
76
|
+
function e(b) {
|
|
77
77
|
try {
|
|
78
|
-
o(
|
|
78
|
+
o(b);
|
|
79
79
|
var H = !1;
|
|
80
80
|
} catch {
|
|
81
81
|
H = !0;
|
|
82
82
|
}
|
|
83
83
|
if (H) {
|
|
84
84
|
H = console;
|
|
85
|
-
var T = H.error, A = typeof Symbol == "function" && Symbol.toStringTag &&
|
|
85
|
+
var T = H.error, A = typeof Symbol == "function" && Symbol.toStringTag && b[Symbol.toStringTag] || b.constructor.name || "Object";
|
|
86
86
|
return T.call(
|
|
87
87
|
H,
|
|
88
88
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
89
89
|
A
|
|
90
|
-
), o(
|
|
90
|
+
), o(b);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
function r(
|
|
94
|
-
if (
|
|
95
|
-
if (typeof
|
|
93
|
+
function r(b) {
|
|
94
|
+
if (b === N) return "<>";
|
|
95
|
+
if (typeof b == "object" && b !== null && b.$$typeof === p)
|
|
96
96
|
return "<...>";
|
|
97
97
|
try {
|
|
98
|
-
var H = n(
|
|
98
|
+
var H = n(b);
|
|
99
99
|
return H ? "<" + H + ">" : "<...>";
|
|
100
100
|
} catch {
|
|
101
101
|
return "<...>";
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
function i() {
|
|
105
|
-
var
|
|
106
|
-
return
|
|
105
|
+
var b = B.A;
|
|
106
|
+
return b === null ? null : b.getOwner();
|
|
107
107
|
}
|
|
108
108
|
function l() {
|
|
109
109
|
return Error("react-stack-top-frame");
|
|
110
110
|
}
|
|
111
|
-
function a(
|
|
112
|
-
if (Y.call(
|
|
113
|
-
var H = Object.getOwnPropertyDescriptor(
|
|
111
|
+
function a(b) {
|
|
112
|
+
if (Y.call(b, "key")) {
|
|
113
|
+
var H = Object.getOwnPropertyDescriptor(b, "key").get;
|
|
114
114
|
if (H && H.isReactWarning) return !1;
|
|
115
115
|
}
|
|
116
|
-
return
|
|
116
|
+
return b.key !== void 0;
|
|
117
117
|
}
|
|
118
|
-
function s(
|
|
118
|
+
function s(b, H) {
|
|
119
119
|
function T() {
|
|
120
120
|
q || (q = !0, console.error(
|
|
121
121
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
122
122
|
H
|
|
123
123
|
));
|
|
124
124
|
}
|
|
125
|
-
T.isReactWarning = !0, Object.defineProperty(
|
|
125
|
+
T.isReactWarning = !0, Object.defineProperty(b, "key", {
|
|
126
126
|
get: T,
|
|
127
127
|
configurable: !0
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
130
|
function u() {
|
|
131
|
-
var
|
|
132
|
-
return D[
|
|
131
|
+
var b = n(this.type);
|
|
132
|
+
return D[b] || (D[b] = !0, console.error(
|
|
133
133
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
134
|
-
)),
|
|
134
|
+
)), b = this.props.ref, b !== void 0 ? b : null;
|
|
135
135
|
}
|
|
136
|
-
function g(
|
|
136
|
+
function g(b, H, T, A, O, Z) {
|
|
137
137
|
var U = T.ref;
|
|
138
|
-
return
|
|
138
|
+
return b = {
|
|
139
139
|
$$typeof: w,
|
|
140
|
-
type:
|
|
140
|
+
type: b,
|
|
141
141
|
key: H,
|
|
142
142
|
props: T,
|
|
143
143
|
_owner: A
|
|
144
|
-
}, (U !== void 0 ? U : null) !== null ? Object.defineProperty(
|
|
144
|
+
}, (U !== void 0 ? U : null) !== null ? Object.defineProperty(b, "ref", {
|
|
145
145
|
enumerable: !1,
|
|
146
146
|
get: u
|
|
147
|
-
}) : Object.defineProperty(
|
|
147
|
+
}) : Object.defineProperty(b, "ref", { enumerable: !1, value: null }), b._store = {}, Object.defineProperty(b._store, "validated", {
|
|
148
148
|
configurable: !1,
|
|
149
149
|
enumerable: !1,
|
|
150
150
|
writable: !0,
|
|
151
151
|
value: 0
|
|
152
|
-
}), Object.defineProperty(
|
|
152
|
+
}), Object.defineProperty(b, "_debugInfo", {
|
|
153
153
|
configurable: !1,
|
|
154
154
|
enumerable: !1,
|
|
155
155
|
writable: !0,
|
|
156
156
|
value: null
|
|
157
|
-
}), Object.defineProperty(
|
|
157
|
+
}), Object.defineProperty(b, "_debugStack", {
|
|
158
158
|
configurable: !1,
|
|
159
159
|
enumerable: !1,
|
|
160
160
|
writable: !0,
|
|
161
161
|
value: O
|
|
162
|
-
}), Object.defineProperty(
|
|
162
|
+
}), Object.defineProperty(b, "_debugTask", {
|
|
163
163
|
configurable: !1,
|
|
164
164
|
enumerable: !1,
|
|
165
165
|
writable: !0,
|
|
166
166
|
value: Z
|
|
167
|
-
}), Object.freeze && (Object.freeze(
|
|
167
|
+
}), Object.freeze && (Object.freeze(b.props), Object.freeze(b)), b;
|
|
168
168
|
}
|
|
169
|
-
function f(
|
|
169
|
+
function f(b, H, T, A, O, Z) {
|
|
170
170
|
var U = H.children;
|
|
171
171
|
if (U !== void 0)
|
|
172
172
|
if (A)
|
|
@@ -180,9 +180,9 @@ function jr() {
|
|
|
180
180
|
);
|
|
181
181
|
else m(U);
|
|
182
182
|
if (Y.call(H, "key")) {
|
|
183
|
-
U = n(
|
|
184
|
-
var P = Object.keys(H).filter(function(
|
|
185
|
-
return
|
|
183
|
+
U = n(b);
|
|
184
|
+
var P = Object.keys(H).filter(function(ie) {
|
|
185
|
+
return ie !== "key";
|
|
186
186
|
});
|
|
187
187
|
A = 0 < P.length ? "{key: someKey, " + P.join(": ..., ") + ": ...}" : "{key: someKey}", we[U + A] || (P = 0 < P.length ? "{" + P.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
188
188
|
`A props object containing a "key" prop is being spread into JSX:
|
|
@@ -199,14 +199,14 @@ React keys must be passed directly to JSX without using spread:
|
|
|
199
199
|
}
|
|
200
200
|
if (U = null, T !== void 0 && (e(T), U = "" + T), a(H) && (e(H.key), U = "" + H.key), "key" in H) {
|
|
201
201
|
T = {};
|
|
202
|
-
for (var
|
|
203
|
-
|
|
202
|
+
for (var ce in H)
|
|
203
|
+
ce !== "key" && (T[ce] = H[ce]);
|
|
204
204
|
} else T = H;
|
|
205
205
|
return U && s(
|
|
206
206
|
T,
|
|
207
|
-
typeof
|
|
207
|
+
typeof b == "function" ? b.displayName || b.name || "Unknown" : b
|
|
208
208
|
), g(
|
|
209
|
-
|
|
209
|
+
b,
|
|
210
210
|
U,
|
|
211
211
|
T,
|
|
212
212
|
i(),
|
|
@@ -214,50 +214,50 @@ React keys must be passed directly to JSX without using spread:
|
|
|
214
214
|
Z
|
|
215
215
|
);
|
|
216
216
|
}
|
|
217
|
-
function m(
|
|
218
|
-
d(
|
|
217
|
+
function m(b) {
|
|
218
|
+
d(b) ? b._store && (b._store.validated = 1) : typeof b == "object" && b !== null && b.$$typeof === p && (b._payload.status === "fulfilled" ? d(b._payload.value) && b._payload.value._store && (b._payload.value._store.validated = 1) : b._store && (b._store.validated = 1));
|
|
219
219
|
}
|
|
220
|
-
function d(
|
|
221
|
-
return typeof
|
|
220
|
+
function d(b) {
|
|
221
|
+
return typeof b == "object" && b !== null && b.$$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"),
|
|
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"), v = /* @__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 = {
|
|
227
|
-
react_stack_bottom_frame: function(
|
|
228
|
-
return
|
|
227
|
+
react_stack_bottom_frame: function(b) {
|
|
228
|
+
return b();
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
231
|
var q, D = {}, te = h.react_stack_bottom_frame.bind(
|
|
232
232
|
h,
|
|
233
233
|
l
|
|
234
234
|
)(), J = K(r(l)), we = {};
|
|
235
|
-
sn.Fragment = N, sn.jsx = function(
|
|
235
|
+
sn.Fragment = N, sn.jsx = function(b, H, T) {
|
|
236
236
|
var A = 1e4 > B.recentlyCreatedOwnerStacks++;
|
|
237
237
|
return f(
|
|
238
|
-
|
|
238
|
+
b,
|
|
239
239
|
H,
|
|
240
240
|
T,
|
|
241
241
|
!1,
|
|
242
242
|
A ? Error("react-stack-top-frame") : te,
|
|
243
|
-
A ? K(r(
|
|
243
|
+
A ? K(r(b)) : J
|
|
244
244
|
);
|
|
245
|
-
}, sn.jsxs = function(
|
|
245
|
+
}, sn.jsxs = function(b, H, T) {
|
|
246
246
|
var A = 1e4 > B.recentlyCreatedOwnerStacks++;
|
|
247
247
|
return f(
|
|
248
|
-
|
|
248
|
+
b,
|
|
249
249
|
H,
|
|
250
250
|
T,
|
|
251
251
|
!0,
|
|
252
252
|
A ? Error("react-stack-top-frame") : te,
|
|
253
|
-
A ? K(r(
|
|
253
|
+
A ? K(r(b)) : J
|
|
254
254
|
);
|
|
255
255
|
};
|
|
256
256
|
})()), sn;
|
|
257
257
|
}
|
|
258
258
|
var Co;
|
|
259
259
|
function Rr() {
|
|
260
|
-
return Co || (Co = 1, process.env.NODE_ENV === "production" ?
|
|
260
|
+
return Co || (Co = 1, process.env.NODE_ENV === "production" ? Cn.exports = Sr() : Cn.exports = jr()), Cn.exports;
|
|
261
261
|
}
|
|
262
262
|
var t = Rr();
|
|
263
263
|
function Er({
|
|
@@ -304,7 +304,7 @@ function Er({
|
|
|
304
304
|
}
|
|
305
305
|
);
|
|
306
306
|
}
|
|
307
|
-
const
|
|
307
|
+
const Rn = ({
|
|
308
308
|
indeterminate: n = !1,
|
|
309
309
|
label: o,
|
|
310
310
|
className: e = "",
|
|
@@ -347,12 +347,12 @@ function Nr(n) {
|
|
|
347
347
|
h && (u.current = h.getBoundingClientRect().width);
|
|
348
348
|
let w = 0;
|
|
349
349
|
const x = 16, N = (j) => {
|
|
350
|
-
const _ = j.clientX - s.current,
|
|
351
|
-
S - w >= x && (e(o,
|
|
350
|
+
const _ = j.clientX - s.current, v = Math.max(r, Math.min(i, u.current + _)), S = Date.now();
|
|
351
|
+
S - w >= x && (e(o, v), w = S);
|
|
352
352
|
}, E = (j) => {
|
|
353
353
|
a(!1);
|
|
354
|
-
const _ = j.clientX - s.current,
|
|
355
|
-
e(o,
|
|
354
|
+
const _ = j.clientX - s.current, v = Math.max(r, Math.min(i, u.current + _));
|
|
355
|
+
e(o, v), document.removeEventListener("mousemove", N), document.removeEventListener("mouseup", E);
|
|
356
356
|
};
|
|
357
357
|
document.addEventListener("mousemove", N), document.addEventListener("mouseup", E);
|
|
358
358
|
}, [o, e, r, i]), f = W((d) => {
|
|
@@ -378,13 +378,13 @@ function Nr(n) {
|
|
|
378
378
|
}
|
|
379
379
|
);
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function En(n, o) {
|
|
382
382
|
return o ? o.left?.includes(n) ? "left" : o.right?.includes(n) ? "right" : null : null;
|
|
383
383
|
}
|
|
384
384
|
function Ir(n, o) {
|
|
385
385
|
const e = [], r = [], i = [];
|
|
386
386
|
return o ? (n.forEach((l) => {
|
|
387
|
-
const a =
|
|
387
|
+
const a = En(l.field, o);
|
|
388
388
|
a === "left" ? e.push(l) : a === "right" ? i.push(l) : r.push(l);
|
|
389
389
|
}), o.left && e.sort((l, a) => {
|
|
390
390
|
const s = o.left.indexOf(l.field), u = o.left.indexOf(a.field);
|
|
@@ -410,13 +410,13 @@ function Ro(n, o, e, r, i, l, a, s) {
|
|
|
410
410
|
u[d.field] = m, m += h;
|
|
411
411
|
}), u;
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function qn(n, o) {
|
|
414
414
|
return o ? o.top?.includes(n) ? "top" : o.bottom?.includes(n) ? "bottom" : null : null;
|
|
415
415
|
}
|
|
416
416
|
function Pr(n, o) {
|
|
417
417
|
const e = [], r = [], i = [];
|
|
418
418
|
return o ? (n.forEach((l) => {
|
|
419
|
-
const a =
|
|
419
|
+
const a = qn(l.id, o);
|
|
420
420
|
a === "top" ? e.push(l) : a === "bottom" ? i.push(l) : r.push(l);
|
|
421
421
|
}), o.top && e.sort((l, a) => {
|
|
422
422
|
const s = o.top.indexOf(l.id), u = o.top.indexOf(a.id);
|
|
@@ -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) => {
|
|
@@ -511,9 +511,9 @@ function Br({ colDef: n, sortModel: o, onSort: e, onHide: r, onPin: i, pinnedCol
|
|
|
511
511
|
r?.(n.field), s();
|
|
512
512
|
}, w = (S) => {
|
|
513
513
|
i?.(n.field, S), s();
|
|
514
|
-
}, x = o?.find((S) => S.field === n.field)?.sort, N = x == null, E = l?.left?.includes(n.field) ?? !1, j = l?.right?.includes(n.field) ?? !1, _ = !E && !j,
|
|
514
|
+
}, x = o?.find((S) => S.field === n.field)?.sort, N = x == null, E = l?.left?.includes(n.field) ?? !1, j = l?.right?.includes(n.field) ?? !1, _ = !E && !j, v = n.headerName || n.field;
|
|
515
515
|
return Mt.createPortal(
|
|
516
|
-
/* @__PURE__ */ t.jsxs("div", { ref: g, className: "ogx-column-menu", style: f, role: "menu", "aria-label": `Column options for ${
|
|
516
|
+
/* @__PURE__ */ t.jsxs("div", { ref: g, className: "ogx-column-menu", style: f, role: "menu", "aria-label": `Column options for ${v}`, children: [
|
|
517
517
|
e && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
518
518
|
/* @__PURE__ */ t.jsxs(
|
|
519
519
|
"button",
|
|
@@ -606,7 +606,7 @@ function Br({ colDef: n, sortModel: o, onSort: e, onHide: r, onPin: i, pinnedCol
|
|
|
606
606
|
}
|
|
607
607
|
),
|
|
608
608
|
/* @__PURE__ */ t.jsx("div", { className: "ogx-menu-divider" }),
|
|
609
|
-
/* @__PURE__ */ t.jsxs("button", { className: "ogx-menu-item", onClick: h, role: "menuitem", "aria-label": `Hide ${
|
|
609
|
+
/* @__PURE__ */ t.jsxs("button", { className: "ogx-menu-item", onClick: h, role: "menuitem", "aria-label": `Hide ${v} column`, children: [
|
|
610
610
|
/* @__PURE__ */ t.jsx("span", { className: "ogx-menu-item__indicator", "aria-hidden": "true" }),
|
|
611
611
|
/* @__PURE__ */ t.jsx("span", { className: "ogx-menu-item__icon", "aria-hidden": "true", children: /* @__PURE__ */ t.jsx(Wr, {}) }),
|
|
612
612
|
"Hide Column"
|
|
@@ -697,34 +697,34 @@ function Vr(n) {
|
|
|
697
697
|
aggregationModel: E,
|
|
698
698
|
draggedColumn: j,
|
|
699
699
|
dragOverColumn: _,
|
|
700
|
-
onDragStart:
|
|
700
|
+
onDragStart: v,
|
|
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,
|
|
708
708
|
onManageColumns: B
|
|
709
|
-
} = n, Y = pe.useRef({}), [$, K] = pe.useState(null), q = (P) => (
|
|
710
|
-
|
|
709
|
+
} = n, Y = pe.useRef({}), [$, K] = pe.useState(null), q = (P) => (ce) => {
|
|
710
|
+
ce.stopPropagation(), K({ colDef: P, anchorEl: ce.currentTarget });
|
|
711
711
|
}, D = () => {
|
|
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
|
-
const
|
|
723
|
-
let
|
|
724
|
-
|
|
722
|
+
const ce = g.find((ve) => ve.field === P.field);
|
|
723
|
+
let ie = "asc";
|
|
724
|
+
ce && (ce.sort === "asc" ? ie = "desc" : ie = null), u(P.field, ie);
|
|
725
725
|
}, J = (P) => {
|
|
726
|
-
const
|
|
727
|
-
return
|
|
726
|
+
const ce = g.find((ie) => ie.field === P);
|
|
727
|
+
return ce ? /* @__PURE__ */ t.jsx("span", { className: `ogx__sort-icon ogx__sort-icon--${ce.sort}`, "aria-hidden": "true" }) : null;
|
|
728
728
|
}, we = pe.useMemo(() => Ro(
|
|
729
729
|
o,
|
|
730
730
|
m,
|
|
@@ -734,7 +734,7 @@ function Vr(n) {
|
|
|
734
734
|
h,
|
|
735
735
|
x,
|
|
736
736
|
N
|
|
737
|
-
), [o, m, d, i, w, h, x, N]),
|
|
737
|
+
), [o, m, d, i, w, h, x, N]), b = r ? Dr(r) : 0, T = (e ?? o).filter((P) => !P.isSpacer).map((P) => ({
|
|
738
738
|
field: P.field,
|
|
739
739
|
width: m[P.field] ?? P.width ?? 100
|
|
740
740
|
})), U = (N ? 48 : 0) + (h ? 48 : 0) + (i ? 48 : 0);
|
|
@@ -742,11 +742,11 @@ function Vr(n) {
|
|
|
742
742
|
// Outer sticky wrapper — both group rows AND column header row live here
|
|
743
743
|
// so they ALL stay sticky together and scroll horizontally as one unit.
|
|
744
744
|
/* @__PURE__ */ t.jsxs("div", { className: "ogx__header-wrap", children: [
|
|
745
|
-
|
|
746
|
-
const
|
|
745
|
+
b > 0 && Array.from({ length: b }, (P, ce) => {
|
|
746
|
+
const ie = Gr(
|
|
747
747
|
r,
|
|
748
748
|
T,
|
|
749
|
-
|
|
749
|
+
ce
|
|
750
750
|
);
|
|
751
751
|
return /* @__PURE__ */ t.jsxs("div", { className: "ogx-col-group-row", role: "row", children: [
|
|
752
752
|
U > 0 && /* @__PURE__ */ t.jsx(
|
|
@@ -757,18 +757,18 @@ function Vr(n) {
|
|
|
757
757
|
role: "columnheader"
|
|
758
758
|
}
|
|
759
759
|
),
|
|
760
|
-
|
|
760
|
+
ie.map((ve) => /* @__PURE__ */ t.jsx(
|
|
761
761
|
"div",
|
|
762
762
|
{
|
|
763
763
|
role: "columnheader",
|
|
764
|
-
className: `ogx-col-group-cell ${
|
|
765
|
-
style: { width:
|
|
766
|
-
title:
|
|
767
|
-
children:
|
|
764
|
+
className: `ogx-col-group-cell ${ve.isGroup ? "ogx-col-group-cell--group" : "ogx-col-group-cell--filler"}`,
|
|
765
|
+
style: { width: ve.width, minWidth: ve.width, flexShrink: 0 },
|
|
766
|
+
title: ve.isGroup ? ve.label : void 0,
|
|
767
|
+
children: ve.isGroup && /* @__PURE__ */ t.jsx("span", { className: "ogx-col-group-cell__label", children: ve.label })
|
|
768
768
|
},
|
|
769
|
-
|
|
769
|
+
ve.key
|
|
770
770
|
))
|
|
771
|
-
] }, `ogx-grp-${
|
|
771
|
+
] }, `ogx-grp-${ce}`);
|
|
772
772
|
}),
|
|
773
773
|
/* @__PURE__ */ t.jsxs("div", { className: "ogx__header", role: "row", children: [
|
|
774
774
|
N && /* @__PURE__ */ t.jsx(
|
|
@@ -812,7 +812,7 @@ function Vr(n) {
|
|
|
812
812
|
left: w ? (N ? 48 : 0) + (h && x ? 48 : 0) : void 0
|
|
813
813
|
},
|
|
814
814
|
children: /* @__PURE__ */ t.jsx(
|
|
815
|
-
|
|
815
|
+
Rn,
|
|
816
816
|
{
|
|
817
817
|
id: "ogx-select-all",
|
|
818
818
|
name: "ogx-select-all",
|
|
@@ -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;
|
|
@@ -829,7 +829,7 @@ function Vr(n) {
|
|
|
829
829
|
)
|
|
830
830
|
}
|
|
831
831
|
),
|
|
832
|
-
o.map((P,
|
|
832
|
+
o.map((P, ce) => {
|
|
833
833
|
if (P.isSpacer)
|
|
834
834
|
return /* @__PURE__ */ t.jsx(
|
|
835
835
|
"div",
|
|
@@ -839,16 +839,16 @@ function Vr(n) {
|
|
|
839
839
|
},
|
|
840
840
|
P.field
|
|
841
841
|
);
|
|
842
|
-
const
|
|
842
|
+
const ie = P.sortable !== !1, ve = g.some((Be) => Be.field === P.field), nt = P.resizable !== !1, z = En(P.field, d), Ne = z !== null, Ie = j === P.field, ft = _ === P.field, Ge = [
|
|
843
843
|
"ogx__header-cell",
|
|
844
844
|
`ogx__header-cell--align-${P.headerAlign || P.align || "left"}`,
|
|
845
|
-
|
|
846
|
-
|
|
845
|
+
ie && "ogx__header-cell--sortable",
|
|
846
|
+
ve && "ogx__header-cell--sorted",
|
|
847
847
|
Ne && "ogx__header-cell--pinned",
|
|
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,
|
|
@@ -866,13 +866,13 @@ function Vr(n) {
|
|
|
866
866
|
const Be = we[P.field];
|
|
867
867
|
z === "left" ? ht.left = Be : ht.right = Be;
|
|
868
868
|
}
|
|
869
|
-
const Qt = P.renderHeader ? P.renderHeader({ field: P.field, colDef: P, colIndex:
|
|
869
|
+
const Qt = P.renderHeader ? P.renderHeader({ field: P.field, colDef: P, colIndex: ce }) : P.headerName || P.field, Lt = (Be) => {
|
|
870
870
|
if (Be.target.closest(".ogx-column-resize-handle")) {
|
|
871
871
|
Be.stopPropagation();
|
|
872
872
|
return;
|
|
873
873
|
}
|
|
874
|
-
p?.(P.field),
|
|
875
|
-
}, Rt =
|
|
874
|
+
p?.(P.field), ie && te(P)();
|
|
875
|
+
}, Rt = v ? v(P.field) : void 0, Tt = S ? S(P.field) : void 0, _t = I ? I(P.field) : void 0;
|
|
876
876
|
return /* @__PURE__ */ t.jsxs(
|
|
877
877
|
"div",
|
|
878
878
|
{
|
|
@@ -880,13 +880,13 @@ function Vr(n) {
|
|
|
880
880
|
style: ht,
|
|
881
881
|
onClick: Lt,
|
|
882
882
|
role: "columnheader",
|
|
883
|
-
draggable: !!
|
|
883
|
+
draggable: !!v,
|
|
884
884
|
onDragStart: Rt,
|
|
885
885
|
onDragOver: Tt,
|
|
886
|
-
onDragEnd:
|
|
886
|
+
onDragEnd: y,
|
|
887
887
|
onDrop: _t,
|
|
888
|
-
"aria-sort":
|
|
889
|
-
"aria-colindex":
|
|
888
|
+
"aria-sort": ie ? ve ? g.find((Be) => Be.field === P.field)?.sort === "asc" ? "ascending" : "descending" : "none" : void 0,
|
|
889
|
+
"aria-colindex": ce + 1 + (i ? 1 : 0),
|
|
890
890
|
"data-field": P.field,
|
|
891
891
|
tabIndex: -1,
|
|
892
892
|
ref: (Be) => {
|
|
@@ -899,7 +899,7 @@ function Vr(n) {
|
|
|
899
899
|
/* @__PURE__ */ t.jsx("span", { className: "ogx__header-cell-title", children: Qt }),
|
|
900
900
|
E && E[P.field] && /* @__PURE__ */ t.jsx("span", { className: "ogx__header-cell-aggregation", children: E[P.field] })
|
|
901
901
|
] }),
|
|
902
|
-
|
|
902
|
+
ie && J(P.field),
|
|
903
903
|
!P.disableColumnMenu && /* @__PURE__ */ t.jsx(
|
|
904
904
|
"button",
|
|
905
905
|
{
|
|
@@ -1092,9 +1092,9 @@ function Qr(n) {
|
|
|
1092
1092
|
isEditing: E,
|
|
1093
1093
|
onEditStart: j,
|
|
1094
1094
|
onEditStop: _,
|
|
1095
|
-
onValueChange:
|
|
1095
|
+
onValueChange: v,
|
|
1096
1096
|
colSpanInfo: S,
|
|
1097
|
-
rowSpan:
|
|
1097
|
+
rowSpan: y,
|
|
1098
1098
|
isHiddenByRowSpan: I
|
|
1099
1099
|
} = n;
|
|
1100
1100
|
if (S?.spannedByColSpan)
|
|
@@ -1110,24 +1110,24 @@ function Qr(n) {
|
|
|
1110
1110
|
"data-colindex": u
|
|
1111
1111
|
}
|
|
1112
1112
|
);
|
|
1113
|
-
const
|
|
1114
|
-
o && (
|
|
1113
|
+
const C = (b) => {
|
|
1114
|
+
o && (b.stopPropagation(), o({
|
|
1115
1115
|
row: l,
|
|
1116
1116
|
field: a.field,
|
|
1117
1117
|
value: i,
|
|
1118
1118
|
colDef: a,
|
|
1119
1119
|
rowIndex: s,
|
|
1120
1120
|
colIndex: u
|
|
1121
|
-
})), f?.(
|
|
1122
|
-
}, p = pe.useCallback((
|
|
1123
|
-
r ? r(a.field,
|
|
1124
|
-
}, [r,
|
|
1125
|
-
N && (j || e) && (
|
|
1121
|
+
})), f?.(b);
|
|
1122
|
+
}, p = pe.useCallback((b) => {
|
|
1123
|
+
r ? r(a.field, b) : v?.(b);
|
|
1124
|
+
}, [r, v, a.field]), k = (b) => {
|
|
1125
|
+
N && (j || e) && (b.stopPropagation(), e ? e(a.field, i) : j?.());
|
|
1126
1126
|
}, L = pe.useMemo(() => a.valueFormatter ? a.valueFormatter({
|
|
1127
1127
|
value: i,
|
|
1128
1128
|
row: l,
|
|
1129
1129
|
field: a.field
|
|
1130
|
-
}) : i == null ? "" : String(i), [i, l, a]), B = pe.useMemo(() => E && (r ||
|
|
1130
|
+
}) : i == null ? "" : String(i), [i, l, a]), B = pe.useMemo(() => E && (r || v) && _ ? a.renderEditCell ? a.renderEditCell({
|
|
1131
1131
|
value: i,
|
|
1132
1132
|
row: l,
|
|
1133
1133
|
field: a.field,
|
|
@@ -1154,7 +1154,7 @@ function Qr(n) {
|
|
|
1154
1154
|
colDef: a,
|
|
1155
1155
|
rowIndex: s,
|
|
1156
1156
|
colIndex: u
|
|
1157
|
-
}) : L, [i, l, a, s, u, L, E, p, _, r,
|
|
1157
|
+
}) : L, [i, l, a, s, u, L, E, p, _, r, v]), Y = d != null, $ = pe.useMemo(() => a.cellClassName ? typeof a.cellClassName == "function" ? a.cellClassName({ value: i, row: l, field: a.field, colDef: a, rowIndex: s, colIndex: u }) || "" : a.cellClassName : "", [a, i, l, s, u]), K = [
|
|
1158
1158
|
"ogx__cell",
|
|
1159
1159
|
`ogx__cell--align-${a.align || "left"}`,
|
|
1160
1160
|
g && "ogx__cell--selected",
|
|
@@ -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,
|
|
@@ -1297,7 +1297,7 @@ function ti(n) {
|
|
|
1297
1297
|
};
|
|
1298
1298
|
return /* @__PURE__ */ t.jsx("div", { className: "ogx__detail-panel", style: i, children: /* @__PURE__ */ t.jsx("div", { className: "ogx__detail-panel-content", children: o }) });
|
|
1299
1299
|
}
|
|
1300
|
-
function
|
|
1300
|
+
function kn(n) {
|
|
1301
1301
|
const {
|
|
1302
1302
|
row: o,
|
|
1303
1303
|
columns: e,
|
|
@@ -1318,11 +1318,11 @@ function Cn(n) {
|
|
|
1318
1318
|
pinCheckboxColumn: E = !0,
|
|
1319
1319
|
pinExpandColumn: j = !0,
|
|
1320
1320
|
rowReordering: _ = !1,
|
|
1321
|
-
onDragStart:
|
|
1321
|
+
onDragStart: v,
|
|
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,
|
|
@@ -1350,7 +1350,7 @@ function Cn(n) {
|
|
|
1350
1350
|
pe.useLayoutEffect(() => {
|
|
1351
1351
|
$ === "__expand_col__" && J.current && J.current.focus({ preventScroll: !0 }), $ === "__checkbox_col__" && we.current && we.current.focus({ preventScroll: !0 });
|
|
1352
1352
|
}, [$]);
|
|
1353
|
-
const
|
|
1353
|
+
const b = (z) => {
|
|
1354
1354
|
z.target.closest(".ogx-checkbox-wrapper, .ogx-expand-icon, .ogx-drag-handle, .ogx__edit-cell") || a?.({ row: o, id: o.id, rowIndex: r });
|
|
1355
1355
|
}, H = (z) => {
|
|
1356
1356
|
z.stopPropagation(), u?.(o.id, z.target.checked);
|
|
@@ -1365,11 +1365,11 @@ function Cn(n) {
|
|
|
1365
1365
|
d,
|
|
1366
1366
|
j,
|
|
1367
1367
|
_
|
|
1368
|
-
), [e, g, f, l, E, d, j, _]), O =
|
|
1368
|
+
), [e, g, f, l, E, d, j, _]), O = qn(o.id, m), Z = O === "top", U = O === "bottom", P = o._hasChildren === !0, ce = pe.useCallback((z, Ne) => {
|
|
1369
1369
|
P || L?.({ id: o.id, field: z, value: Ne });
|
|
1370
|
-
}, [P, o.id, L]),
|
|
1370
|
+
}, [P, o.id, L]), ie = pe.useCallback((z, Ne) => {
|
|
1371
1371
|
Y?.({ id: o.id, field: z, value: Ne });
|
|
1372
|
-
}, [Y, o.id]),
|
|
1372
|
+
}, [Y, o.id]), ve = pe.useCallback((z) => {
|
|
1373
1373
|
B?.({ cancel: z });
|
|
1374
1374
|
}, [B]), nt = [
|
|
1375
1375
|
"ogx__row",
|
|
@@ -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(" ");
|
|
@@ -1387,7 +1387,7 @@ function Cn(n) {
|
|
|
1387
1387
|
"div",
|
|
1388
1388
|
{
|
|
1389
1389
|
className: nt,
|
|
1390
|
-
onClick:
|
|
1390
|
+
onClick: b,
|
|
1391
1391
|
role: "row",
|
|
1392
1392
|
"aria-rowindex": r + 1,
|
|
1393
1393
|
"aria-selected": i,
|
|
@@ -1413,8 +1413,8 @@ function Cn(n) {
|
|
|
1413
1413
|
zIndex: 4
|
|
1414
1414
|
},
|
|
1415
1415
|
draggable: !0,
|
|
1416
|
-
onDragStart:
|
|
1417
|
-
onDragEnd:
|
|
1416
|
+
onDragStart: v ? v(o.id) : void 0,
|
|
1417
|
+
onDragEnd: y,
|
|
1418
1418
|
onClick: (z) => z.stopPropagation(),
|
|
1419
1419
|
children: /* @__PURE__ */ t.jsx(ei, {})
|
|
1420
1420
|
}
|
|
@@ -1476,7 +1476,7 @@ function Cn(n) {
|
|
|
1476
1476
|
});
|
|
1477
1477
|
},
|
|
1478
1478
|
children: /* @__PURE__ */ t.jsx(
|
|
1479
|
-
|
|
1479
|
+
Rn,
|
|
1480
1480
|
{
|
|
1481
1481
|
id: `ogx-select-row-${o.id}`,
|
|
1482
1482
|
name: `ogx-select-row-${o.id}`,
|
|
@@ -1500,7 +1500,7 @@ function Cn(n) {
|
|
|
1500
1500
|
},
|
|
1501
1501
|
z.field
|
|
1502
1502
|
);
|
|
1503
|
-
const Ie = z.valueGetter ? z.valueGetter({ row: o, field: z.field, value: o[z.field] }) : o[z.field], ft = g[z.field] ?? z.width, Ge =
|
|
1503
|
+
const Ie = z.valueGetter ? z.valueGetter({ row: o, field: z.field, value: o[z.field] }) : o[z.field], ft = g[z.field] ?? z.width, Ge = En(z.field, f), jt = Ge ? A[z.field] : void 0, ht = k?.id === o.id && k?.field === z.field, Qt = ht ? k?.value : Ie, Lt = q?.get(o.id)?.[z.field], Rt = D?.spannedCells[o.id]?.[z.field], Tt = D?.hiddenCells[o.id]?.[z.field] || !1;
|
|
1504
1504
|
return /* @__PURE__ */ t.jsx(
|
|
1505
1505
|
Zr,
|
|
1506
1506
|
{
|
|
@@ -1518,9 +1518,9 @@ function Cn(n) {
|
|
|
1518
1518
|
isFocusVisible: K,
|
|
1519
1519
|
isEditable: z.editable,
|
|
1520
1520
|
isEditing: ht,
|
|
1521
|
-
onCellEditStart:
|
|
1522
|
-
onEditStop:
|
|
1523
|
-
onCellValueChange:
|
|
1521
|
+
onCellEditStart: ce,
|
|
1522
|
+
onEditStop: ve,
|
|
1523
|
+
onCellValueChange: ie,
|
|
1524
1524
|
colSpanInfo: Lt,
|
|
1525
1525
|
rowSpan: Rt,
|
|
1526
1526
|
isHiddenByRowSpan: Tt
|
|
@@ -1613,7 +1613,7 @@ const ni = ({
|
|
|
1613
1613
|
})
|
|
1614
1614
|
]
|
|
1615
1615
|
}
|
|
1616
|
-
),
|
|
1616
|
+
), Sn = ({
|
|
1617
1617
|
variant: n = "text",
|
|
1618
1618
|
size: o = "medium",
|
|
1619
1619
|
color: e = "default",
|
|
@@ -1659,9 +1659,9 @@ function ko(n) {
|
|
|
1659
1659
|
}, E = () => {
|
|
1660
1660
|
i(g - 1);
|
|
1661
1661
|
}, j = (S) => {
|
|
1662
|
-
const
|
|
1663
|
-
l(
|
|
1664
|
-
}, _ = f === 0,
|
|
1662
|
+
const y = parseInt(S.target.value, 10);
|
|
1663
|
+
l(y);
|
|
1664
|
+
}, _ = f === 0, v = 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: [
|
|
1667
1667
|
/* @__PURE__ */ t.jsx("label", { htmlFor: "page-size-select", className: "ogx-pagination__label", children: "Rows per page:" }),
|
|
@@ -1684,7 +1684,7 @@ function ko(n) {
|
|
|
1684
1684
|
] }),
|
|
1685
1685
|
/* @__PURE__ */ t.jsxs("div", { className: "ogx-pagination__actions", children: [
|
|
1686
1686
|
s && /* @__PURE__ */ t.jsx(
|
|
1687
|
-
|
|
1687
|
+
Sn,
|
|
1688
1688
|
{
|
|
1689
1689
|
variant: "text",
|
|
1690
1690
|
size: "small",
|
|
@@ -1696,7 +1696,7 @@ function ko(n) {
|
|
|
1696
1696
|
}
|
|
1697
1697
|
),
|
|
1698
1698
|
/* @__PURE__ */ t.jsx(
|
|
1699
|
-
|
|
1699
|
+
Sn,
|
|
1700
1700
|
{
|
|
1701
1701
|
variant: "text",
|
|
1702
1702
|
size: "small",
|
|
@@ -1714,24 +1714,24 @@ function ko(n) {
|
|
|
1714
1714
|
g
|
|
1715
1715
|
] }),
|
|
1716
1716
|
/* @__PURE__ */ t.jsx(
|
|
1717
|
-
|
|
1717
|
+
Sn,
|
|
1718
1718
|
{
|
|
1719
1719
|
variant: "text",
|
|
1720
1720
|
size: "small",
|
|
1721
1721
|
onClick: N,
|
|
1722
|
-
disabled:
|
|
1722
|
+
disabled: v,
|
|
1723
1723
|
"aria-label": "Go to next page",
|
|
1724
1724
|
title: "Next page",
|
|
1725
1725
|
children: /* @__PURE__ */ t.jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ t.jsx("path", { d: "M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" }) })
|
|
1726
1726
|
}
|
|
1727
1727
|
),
|
|
1728
1728
|
u && /* @__PURE__ */ t.jsx(
|
|
1729
|
-
|
|
1729
|
+
Sn,
|
|
1730
1730
|
{
|
|
1731
1731
|
variant: "text",
|
|
1732
1732
|
size: "small",
|
|
1733
1733
|
onClick: E,
|
|
1734
|
-
disabled:
|
|
1734
|
+
disabled: v,
|
|
1735
1735
|
"aria-label": "Go to last page",
|
|
1736
1736
|
title: "Last page",
|
|
1737
1737
|
children: /* @__PURE__ */ t.jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ t.jsx("path", { d: "M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z" }) })
|
|
@@ -1900,7 +1900,7 @@ function ri(n, o) {
|
|
|
1900
1900
|
}
|
|
1901
1901
|
}
|
|
1902
1902
|
function ii(n) {
|
|
1903
|
-
const { rows: o, columns: e, rowHeight: r = 52, headerHeight: i = 56, columnVisibilityModel: l, initialState: a } = n, s =
|
|
1903
|
+
const { rows: o, columns: e, rowHeight: r = 52, headerHeight: i = 56, columnVisibilityModel: l, initialState: a } = n, s = de(
|
|
1904
1904
|
() => oi(o, e, l),
|
|
1905
1905
|
[]
|
|
1906
1906
|
), [u, g] = Cr(ri, {
|
|
@@ -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
|
-
}, []),
|
|
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
|
+
}, []), v = 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
|
},
|
|
@@ -2003,9 +2003,9 @@ function ii(n) {
|
|
|
2003
2003
|
setSelection: E,
|
|
2004
2004
|
setScroll: j,
|
|
2005
2005
|
setDimensions: _,
|
|
2006
|
-
setDataSourceLoading:
|
|
2006
|
+
setDataSourceLoading: v,
|
|
2007
2007
|
setDataSourceError: S,
|
|
2008
|
-
setRowCount:
|
|
2008
|
+
setRowCount: y
|
|
2009
2009
|
};
|
|
2010
2010
|
}
|
|
2011
2011
|
function li(n) {
|
|
@@ -2138,7 +2138,7 @@ function ci(n, o) {
|
|
|
2138
2138
|
return Object.values(n).some((i) => i == null ? !1 : String(i).toLowerCase().includes(r));
|
|
2139
2139
|
});
|
|
2140
2140
|
}
|
|
2141
|
-
function
|
|
2141
|
+
function Jn(n, o) {
|
|
2142
2142
|
const e = o.items || [], r = o.logicOperator || "and", i = o.quickFilterValues || [];
|
|
2143
2143
|
if (i.length > 0 && !ci(n, i))
|
|
2144
2144
|
return !1;
|
|
@@ -2156,7 +2156,7 @@ function qn(n, o) {
|
|
|
2156
2156
|
function ui(n, o) {
|
|
2157
2157
|
if (!o) return n;
|
|
2158
2158
|
const { items: e = [], quickFilterValues: r = [] } = o;
|
|
2159
|
-
return e.length === 0 && (!r || r.length === 0) ? n : n.filter((i) =>
|
|
2159
|
+
return e.length === 0 && (!r || r.length === 0) ? n : n.filter((i) => Jn(i, o));
|
|
2160
2160
|
}
|
|
2161
2161
|
function gi(n) {
|
|
2162
2162
|
switch (n) {
|
|
@@ -2172,7 +2172,7 @@ function gi(n) {
|
|
|
2172
2172
|
return ["contains", "equals", "startsWith", "endsWith", "isEmpty", "isNotEmpty"];
|
|
2173
2173
|
}
|
|
2174
2174
|
}
|
|
2175
|
-
function
|
|
2175
|
+
function Qn(n, o, e) {
|
|
2176
2176
|
if (n == null && o == null) return 0;
|
|
2177
2177
|
if (n == null) return e === "asc" ? 1 : -1;
|
|
2178
2178
|
if (o == null) return e === "asc" ? -1 : 1;
|
|
@@ -2189,7 +2189,7 @@ function fi(n, o) {
|
|
|
2189
2189
|
const e = [...n];
|
|
2190
2190
|
return e.sort((r, i) => {
|
|
2191
2191
|
for (const l of o) {
|
|
2192
|
-
const a = r[l.field], s = i[l.field], u =
|
|
2192
|
+
const a = r[l.field], s = i[l.field], u = Qn(a, s, l.sort);
|
|
2193
2193
|
if (u !== 0)
|
|
2194
2194
|
return u;
|
|
2195
2195
|
}
|
|
@@ -2206,17 +2206,17 @@ function hi(n) {
|
|
|
2206
2206
|
filterModel: a,
|
|
2207
2207
|
sortModel: s,
|
|
2208
2208
|
onRowExpansionChange: u
|
|
2209
|
-
} = n, { treeNodes: g, rootIds: f, groupingRows: m } =
|
|
2209
|
+
} = n, { treeNodes: g, rootIds: f, groupingRows: m } = de(() => {
|
|
2210
2210
|
if (!i || !r)
|
|
2211
2211
|
return {
|
|
2212
2212
|
treeNodes: /* @__PURE__ */ new Map(),
|
|
2213
2213
|
rootIds: [],
|
|
2214
2214
|
groupingRows: []
|
|
2215
2215
|
};
|
|
2216
|
-
const
|
|
2216
|
+
const v = /* @__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 =
|
|
2219
|
-
I.set(B, k),
|
|
2218
|
+
const k = e(p), L = r(p), B = C(L);
|
|
2219
|
+
I.set(B, k), v.set(k, {
|
|
2220
2220
|
id: k,
|
|
2221
2221
|
parentId: null,
|
|
2222
2222
|
depth: L.length - 1,
|
|
@@ -2233,11 +2233,11 @@ 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
|
-
if (D === void 0 && (D = `auto-group-${q}`, !
|
|
2238
|
+
if (D === void 0 && (D = `auto-group-${q}`, !v.has(D))) {
|
|
2239
2239
|
const te = K[K.length - 1];
|
|
2240
|
-
|
|
2240
|
+
v.set(D, {
|
|
2241
2241
|
id: D,
|
|
2242
2242
|
parentId: null,
|
|
2243
2243
|
depth: K.length - 1,
|
|
@@ -2251,72 +2251,72 @@ 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);
|
|
2258
2258
|
if (Y !== void 0) {
|
|
2259
|
-
const $ =
|
|
2259
|
+
const $ = v.get(Y), K = v.get(k);
|
|
2260
2260
|
$ && K && (K.parentId = Y, $.children = $.children || [], $.children.includes(k) || $.children.push(k));
|
|
2261
2261
|
}
|
|
2262
|
-
}),
|
|
2263
|
-
const k = p.id, L =
|
|
2262
|
+
}), y.forEach((p) => {
|
|
2263
|
+
const k = p.id, L = v.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 =
|
|
2268
|
-
if (q &&
|
|
2267
|
+
const $ = Y.slice(0, -1), K = C($), q = I.get(K);
|
|
2268
|
+
if (q && v.has(q)) {
|
|
2269
2269
|
L.parentId = q;
|
|
2270
|
-
const D =
|
|
2270
|
+
const D = v.get(q);
|
|
2271
2271
|
D && (D.children = D.children || [], D.children.includes(k) || D.children.push(k));
|
|
2272
2272
|
}
|
|
2273
2273
|
}
|
|
2274
|
-
}), { treeNodes:
|
|
2275
|
-
}, [o, r, i, e]), d =
|
|
2274
|
+
}), { treeNodes: v, rootIds: S, groupingRows: y };
|
|
2275
|
+
}, [o, r, i, e]), d = de(() => {
|
|
2276
2276
|
if (!i) return /* @__PURE__ */ new Set();
|
|
2277
|
-
const
|
|
2277
|
+
const v = /* @__PURE__ */ new Set();
|
|
2278
2278
|
return g.forEach((S) => {
|
|
2279
|
-
S.children && S.children.length > 0 && (l === -1 || S.depth < l) &&
|
|
2280
|
-
}),
|
|
2279
|
+
S.children && S.children.length > 0 && (l === -1 || S.depth < l) && v.add(S.id);
|
|
2280
|
+
}), v;
|
|
2281
2281
|
}, [g, i, l]), [h, w] = Q(/* @__PURE__ */ new Set());
|
|
2282
2282
|
ee(() => {
|
|
2283
2283
|
d.size > 0 && w(d);
|
|
2284
2284
|
}, [d]);
|
|
2285
|
-
const x = W((
|
|
2285
|
+
const x = W((v) => {
|
|
2286
2286
|
w((S) => {
|
|
2287
|
-
const
|
|
2288
|
-
if (
|
|
2289
|
-
const
|
|
2290
|
-
|
|
2287
|
+
const y = new Set(S), I = !y.has(v);
|
|
2288
|
+
if (y.has(v) ? y.delete(v) : y.add(v), I && u) {
|
|
2289
|
+
const C = g.get(v);
|
|
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
|
-
const
|
|
2297
|
-
o.forEach((B) =>
|
|
2298
|
-
const S = (B) =>
|
|
2299
|
-
if (
|
|
2300
|
-
const Y =
|
|
2296
|
+
const v = /* @__PURE__ */ new Map();
|
|
2297
|
+
o.forEach((B) => v.set(e(B), B)), m.forEach((B) => v.set(B.id, B));
|
|
2298
|
+
const S = (B) => Jn(B, a), y = /* @__PURE__ */ new Map(), I = (B) => {
|
|
2299
|
+
if (y.has(B)) return y.get(B);
|
|
2300
|
+
const Y = v.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
|
-
const $ =
|
|
2308
|
+
const $ = v.get(B), K = v.get(Y);
|
|
2309
2309
|
if (!$ || !K) return 0;
|
|
2310
2310
|
for (const q of s) {
|
|
2311
|
-
const D = $[q.field], te = K[q.field], J =
|
|
2311
|
+
const D = $[q.field], te = K[q.field], J = Qn(D, te, q.sort);
|
|
2312
2312
|
if (J !== 0) return J;
|
|
2313
2313
|
}
|
|
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
|
-
const K =
|
|
2319
|
+
const K = v.get($), q = g.get($);
|
|
2320
2320
|
if (K && q) {
|
|
2321
2321
|
k.add($);
|
|
2322
2322
|
const D = {
|
|
@@ -2331,17 +2331,17 @@ function hi(n) {
|
|
|
2331
2331
|
});
|
|
2332
2332
|
};
|
|
2333
2333
|
return L(f), p;
|
|
2334
|
-
}, [i, o, m, f, g, h, a, s, e]), E = W((
|
|
2334
|
+
}, [i, o, m, f, g, h, a, s, e]), E = W((v) => h.has(v), [h]), j = W((v) => g.get(v), [g]), _ = W((v) => {
|
|
2335
2335
|
const S = [];
|
|
2336
|
-
let
|
|
2337
|
-
for (;
|
|
2338
|
-
const I = g.get(
|
|
2336
|
+
let y = v;
|
|
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]);
|
|
2344
|
-
return
|
|
2344
|
+
return de(() => ({
|
|
2345
2345
|
treeNodes: g,
|
|
2346
2346
|
groupingRows: m,
|
|
2347
2347
|
toggleExpansion: x,
|
|
@@ -2362,13 +2362,13 @@ function xi(n) {
|
|
|
2362
2362
|
filterModel: a,
|
|
2363
2363
|
sortModel: s,
|
|
2364
2364
|
getAggregationPosition: u = pi
|
|
2365
|
-
} = n, [g, f] = Q(/* @__PURE__ */ new Set()), { treeNodes: m, rootIds: d, groupingRows: h } =
|
|
2366
|
-
const j = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map(),
|
|
2365
|
+
} = n, [g, f] = Q(/* @__PURE__ */ new Set()), { treeNodes: m, rootIds: d, groupingRows: h } = de(() => {
|
|
2366
|
+
const j = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map(), v = [];
|
|
2367
2367
|
if (r.length === 0)
|
|
2368
|
-
return { treeNodes: j, rootIds:
|
|
2369
|
-
const S = (
|
|
2368
|
+
return { treeNodes: j, rootIds: v, groupingRows: _ };
|
|
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
|
});
|
|
@@ -2397,7 +2397,7 @@ function xi(n) {
|
|
|
2397
2397
|
else if (O === "max")
|
|
2398
2398
|
J[A] = Math.max(...Z.map((U) => Number(U) || 0));
|
|
2399
2399
|
else if (O === "avg") {
|
|
2400
|
-
const U = Z.reduce((P,
|
|
2400
|
+
const U = Z.reduce((P, ce) => (Number(P) || 0) + (Number(ce) || 0), 0);
|
|
2401
2401
|
J[A] = Z.length ? U / Z.length : 0;
|
|
2402
2402
|
} else O === "count" && (J[A] = Z.length);
|
|
2403
2403
|
});
|
|
@@ -2407,7 +2407,7 @@ function xi(n) {
|
|
|
2407
2407
|
id: te
|
|
2408
2408
|
};
|
|
2409
2409
|
_.set(te, we);
|
|
2410
|
-
const
|
|
2410
|
+
const b = {
|
|
2411
2411
|
id: te,
|
|
2412
2412
|
parentId: k,
|
|
2413
2413
|
depth: p,
|
|
@@ -2419,59 +2419,59 @@ function xi(n) {
|
|
|
2419
2419
|
children: [],
|
|
2420
2420
|
label: `${L}: ${String(D)}`
|
|
2421
2421
|
};
|
|
2422
|
-
|
|
2423
|
-
const H =
|
|
2422
|
+
b.aggregationPosition = u(b), j.set(te, b);
|
|
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 =
|
|
2429
|
-
return
|
|
2428
|
+
}, I = y(o, 0, null);
|
|
2429
|
+
return v.push(...I), { treeNodes: j, rootIds: v, groupingRows: _ };
|
|
2430
2430
|
}, [o, r, i, e, u]);
|
|
2431
2431
|
ee(() => {
|
|
2432
2432
|
if (l === -1) {
|
|
2433
2433
|
const j = /* @__PURE__ */ new Set();
|
|
2434
|
-
m.forEach((_,
|
|
2435
|
-
_.children && _.children.length > 0 && j.add(
|
|
2434
|
+
m.forEach((_, v) => {
|
|
2435
|
+
_.children && _.children.length > 0 && j.add(v);
|
|
2436
2436
|
}), f(j);
|
|
2437
2437
|
} else if (l > 0) {
|
|
2438
2438
|
const j = /* @__PURE__ */ new Set();
|
|
2439
|
-
m.forEach((_,
|
|
2440
|
-
_.depth < l && _.children && _.children.length > 0 && j.add(
|
|
2439
|
+
m.forEach((_, v) => {
|
|
2440
|
+
_.depth < l && _.children && _.children.length > 0 && j.add(v);
|
|
2441
2441
|
}), f(j);
|
|
2442
2442
|
} else
|
|
2443
2443
|
f(/* @__PURE__ */ new Set());
|
|
2444
2444
|
}, [r, l]);
|
|
2445
2445
|
const w = W((j) => {
|
|
2446
2446
|
f((_) => {
|
|
2447
|
-
const
|
|
2448
|
-
return
|
|
2447
|
+
const v = new Set(_);
|
|
2448
|
+
return v.has(j) ? v.delete(j) : v.add(j), v;
|
|
2449
2449
|
});
|
|
2450
2450
|
}, []), x = W((j) => g.has(j), [g]), N = W(() => {
|
|
2451
2451
|
if (r.length === 0) return null;
|
|
2452
|
-
const j = [], _ = /* @__PURE__ */ new Set(),
|
|
2453
|
-
o.forEach((
|
|
2454
|
-
const S = (
|
|
2455
|
-
const p = m.get(
|
|
2452
|
+
const j = [], _ = /* @__PURE__ */ new Set(), v = /* @__PURE__ */ new Map();
|
|
2453
|
+
o.forEach((C) => v.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 =
|
|
2459
|
-
return !(!k || a && !
|
|
2458
|
+
const k = v.get(C);
|
|
2459
|
+
return !(!k || a && !Jn(k, a));
|
|
2460
2460
|
}
|
|
2461
2461
|
return p.children.some((k) => S(k));
|
|
2462
|
-
},
|
|
2463
|
-
let p =
|
|
2464
|
-
a && (p =
|
|
2465
|
-
const B = h.get(k) ||
|
|
2462
|
+
}, y = (C) => {
|
|
2463
|
+
let p = C;
|
|
2464
|
+
a && (p = C.filter(S)), s && s.length > 0 && p.sort((k, L) => {
|
|
2465
|
+
const B = h.get(k) || v.get(k), Y = h.get(L) || v.get(L);
|
|
2466
2466
|
if (!B || !Y) return 0;
|
|
2467
2467
|
for (const $ of s) {
|
|
2468
|
-
const K = B[$.field], q = Y[$.field], D =
|
|
2468
|
+
const K = B[$.field], q = Y[$.field], D = Qn(K, q, $.sort);
|
|
2469
2469
|
if (D !== 0) return D;
|
|
2470
2470
|
}
|
|
2471
2471
|
return 0;
|
|
2472
2472
|
}), p.forEach((k) => {
|
|
2473
2473
|
if (_.has(k)) return;
|
|
2474
|
-
const L = m.get(k), B = L?.children && L.children.length > 0, Y = B ? h.get(k) :
|
|
2474
|
+
const L = m.get(k), B = L?.children && L.children.length > 0, Y = B ? h.get(k) : v.get(k);
|
|
2475
2475
|
if (Y && L) {
|
|
2476
2476
|
_.add(k);
|
|
2477
2477
|
const $ = {
|
|
@@ -2483,13 +2483,13 @@ 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
|
-
return
|
|
2492
|
+
return de(() => ({
|
|
2493
2493
|
treeNodes: m,
|
|
2494
2494
|
groupingRows: h,
|
|
2495
2495
|
toggleExpansion: w,
|
|
@@ -2531,13 +2531,13 @@ function mi(n) {
|
|
|
2531
2531
|
g(null);
|
|
2532
2532
|
return;
|
|
2533
2533
|
}
|
|
2534
|
-
const
|
|
2534
|
+
const v = { ..._, [N]: E };
|
|
2535
2535
|
try {
|
|
2536
2536
|
if (r) {
|
|
2537
|
-
const S = await r(
|
|
2537
|
+
const S = await r(v, _);
|
|
2538
2538
|
l?.(S);
|
|
2539
2539
|
} else
|
|
2540
|
-
l?.(
|
|
2540
|
+
l?.(v);
|
|
2541
2541
|
g(null);
|
|
2542
2542
|
} catch (S) {
|
|
2543
2543
|
i && i(S);
|
|
@@ -2563,74 +2563,74 @@ function wi(n, o, e) {
|
|
|
2563
2563
|
}), s = W(() => {
|
|
2564
2564
|
i(/* @__PURE__ */ new Map());
|
|
2565
2565
|
}, []), u = W((x, N) => r.get(x)?.[N], [r]), g = W((x, N, E, j, _) => {
|
|
2566
|
-
const
|
|
2566
|
+
const v = 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(
|
|
2585
|
+
qt(v, 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(v, 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(
|
|
2601
|
+
qt(v, 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
|
-
i(
|
|
2606
|
+
i(v);
|
|
2607
2607
|
}, [r, o, e]), f = W((x, N) => {
|
|
2608
2608
|
const E = {}, j = {}, _ = {};
|
|
2609
|
-
o.forEach((
|
|
2610
|
-
if (
|
|
2611
|
-
for (let
|
|
2612
|
-
const I = n[
|
|
2613
|
-
if (!I || j[I.id]?.[
|
|
2614
|
-
const
|
|
2609
|
+
o.forEach((v, S) => {
|
|
2610
|
+
if (v.rowSpan)
|
|
2611
|
+
for (let y = x; y < N; y++) {
|
|
2612
|
+
const I = n[y];
|
|
2613
|
+
if (!I || j[I.id]?.[v.field]) continue;
|
|
2614
|
+
const C = v.valueGetter ? v.valueGetter({ row: I, field: v.field, value: I[v.field] }) : I[v.field];
|
|
2615
2615
|
let p = 1;
|
|
2616
|
-
if (typeof
|
|
2616
|
+
if (typeof v.rowSpan == "function") {
|
|
2617
2617
|
const k = {
|
|
2618
2618
|
row: I,
|
|
2619
|
-
value:
|
|
2620
|
-
field:
|
|
2621
|
-
colDef:
|
|
2622
|
-
rowIndex:
|
|
2619
|
+
value: C,
|
|
2620
|
+
field: v.field,
|
|
2621
|
+
colDef: v,
|
|
2622
|
+
rowIndex: y,
|
|
2623
2623
|
colIndex: S
|
|
2624
2624
|
};
|
|
2625
|
-
p =
|
|
2626
|
-
} else typeof
|
|
2625
|
+
p = v.rowSpan(k);
|
|
2626
|
+
} else typeof v.rowSpan == "number" && (p = v.rowSpan);
|
|
2627
2627
|
if (p > 1) {
|
|
2628
|
-
E[I.id] || (E[I.id] = {}), E[I.id][
|
|
2628
|
+
E[I.id] || (E[I.id] = {}), E[I.id][v.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][
|
|
2633
|
+
j[B.id] || (j[B.id] = {}), j[B.id][v.field] = !0, _[L] || (_[L] = {}), _[L][v.field] = y;
|
|
2634
2634
|
}
|
|
2635
2635
|
}
|
|
2636
2636
|
}
|
|
@@ -2651,73 +2651,73 @@ function wi(n, o, e) {
|
|
|
2651
2651
|
}, []);
|
|
2652
2652
|
ee(() => {
|
|
2653
2653
|
const x = /* @__PURE__ */ new Map();
|
|
2654
|
-
n.forEach((_,
|
|
2654
|
+
n.forEach((_, v) => {
|
|
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:
|
|
2666
|
-
rowIndex:
|
|
2663
|
+
value: _[y.field],
|
|
2664
|
+
field: y.field,
|
|
2665
|
+
colDef: y,
|
|
2666
|
+
rowIndex: v,
|
|
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);
|
|
2699
2699
|
const N = {}, E = {}, j = {};
|
|
2700
|
-
o.forEach((_,
|
|
2700
|
+
o.forEach((_, v) => {
|
|
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
|
-
colIndex:
|
|
2714
|
+
colIndex: v
|
|
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];
|
|
@@ -2749,7 +2749,7 @@ function qt(n, o, e, r) {
|
|
|
2749
2749
|
let i = n.get(o);
|
|
2750
2750
|
i || (i = {}, n.set(o, i)), i[e] = r;
|
|
2751
2751
|
}
|
|
2752
|
-
function
|
|
2752
|
+
function bi(n) {
|
|
2753
2753
|
const {
|
|
2754
2754
|
dataSource: o,
|
|
2755
2755
|
sortModel: e,
|
|
@@ -2768,34 +2768,34 @@ function vi(n) {
|
|
|
2768
2768
|
if (!o) return;
|
|
2769
2769
|
const j = ++x.current;
|
|
2770
2770
|
m(!0), d(null);
|
|
2771
|
-
const _ = i.page * i.pageSize,
|
|
2771
|
+
const _ = i.page * i.pageSize, v = _ + i.pageSize, S = {
|
|
2772
2772
|
startRow: _,
|
|
2773
|
-
endRow:
|
|
2773
|
+
endRow: v,
|
|
2774
2774
|
sortModel: e,
|
|
2775
2775
|
filterModel: r,
|
|
2776
2776
|
groupKeys: [],
|
|
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
|
}
|
|
@@ -2825,19 +2825,19 @@ function vi(n) {
|
|
|
2825
2825
|
if (o) {
|
|
2826
2826
|
m(!0);
|
|
2827
2827
|
try {
|
|
2828
|
-
const
|
|
2828
|
+
const v = await o.getRows({
|
|
2829
2829
|
startRow: 0,
|
|
2830
2830
|
endRow: -1,
|
|
2831
2831
|
sortModel: e,
|
|
2832
2832
|
filterModel: r,
|
|
2833
2833
|
groupKeys: _
|
|
2834
2834
|
});
|
|
2835
|
-
|
|
2836
|
-
const
|
|
2835
|
+
v.rows.length > 0 && g((S) => {
|
|
2836
|
+
const y = new Set(S.map((C) => C.id)), I = v.rows.filter((C) => !y.has(C.id));
|
|
2837
2837
|
return [...S, ...I];
|
|
2838
2838
|
});
|
|
2839
|
-
} catch (
|
|
2840
|
-
d(
|
|
2839
|
+
} catch (v) {
|
|
2840
|
+
d(v), console.error("Failed to fetch children:", v);
|
|
2841
2841
|
} finally {
|
|
2842
2842
|
m(!1);
|
|
2843
2843
|
}
|
|
@@ -2848,7 +2848,7 @@ function vi(n) {
|
|
|
2848
2848
|
fetchChildren: E
|
|
2849
2849
|
};
|
|
2850
2850
|
}
|
|
2851
|
-
const
|
|
2851
|
+
const vi = {
|
|
2852
2852
|
sum: (n) => n.filter((e) => e != null && !isNaN(Number(e))).reduce((e, r) => e + Number(r), 0),
|
|
2853
2853
|
avg: (n) => {
|
|
2854
2854
|
const o = n.filter((e) => e != null && !isNaN(Number(e)));
|
|
@@ -2877,17 +2877,17 @@ function _i(n) {
|
|
|
2877
2877
|
filterModel: l,
|
|
2878
2878
|
sortModel: a,
|
|
2879
2879
|
serverAggregationResults: s
|
|
2880
|
-
} = n, u =
|
|
2880
|
+
} = n, u = de(() => {
|
|
2881
2881
|
if (r || Object.keys(e).length === 0) return {};
|
|
2882
2882
|
const j = {};
|
|
2883
|
-
for (const [_,
|
|
2884
|
-
const S =
|
|
2883
|
+
for (const [_, v] of Object.entries(e)) {
|
|
2884
|
+
const S = vi[v];
|
|
2885
2885
|
if (!S) {
|
|
2886
|
-
console.warn(`[useAggregation] Unknown aggregation function: "${
|
|
2886
|
+
console.warn(`[useAggregation] Unknown aggregation function: "${v}"`);
|
|
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 () => {
|
|
@@ -2910,7 +2910,7 @@ function _i(n) {
|
|
|
2910
2910
|
}, [i, e, l, a]);
|
|
2911
2911
|
return ee(() => {
|
|
2912
2912
|
r && i?.getAggregations && !s && N();
|
|
2913
|
-
}, [N, r, i, s]), { aggregationResult:
|
|
2913
|
+
}, [N, r, i, s]), { aggregationResult: de(() => r ? s && Object.keys(s).length > 0 ? s : g : u, [r, u, s, g]), isLoading: m, error: h };
|
|
2914
2914
|
}
|
|
2915
2915
|
function yi(n, o) {
|
|
2916
2916
|
const e = n.filter((r) => r != null && !isNaN(r));
|
|
@@ -2928,32 +2928,32 @@ function yi(n, o) {
|
|
|
2928
2928
|
return Math.max(...e);
|
|
2929
2929
|
}
|
|
2930
2930
|
}
|
|
2931
|
-
function
|
|
2931
|
+
function Xn(n, o) {
|
|
2932
2932
|
return o.map((e) => String(n[e] ?? "")).join("\0");
|
|
2933
2933
|
}
|
|
2934
2934
|
function Ci(n, o, e, r) {
|
|
2935
|
-
return
|
|
2935
|
+
return de(() => {
|
|
2936
2936
|
const i = { pivotRows: [], pivotColumns: [], colKeys: [], isValid: !1 };
|
|
2937
2937
|
if (!r) return i;
|
|
2938
2938
|
const { rowFields: l, columnFields: a, valueFields: s } = e;
|
|
2939
2939
|
if (l.length === 0 || s.length === 0) return i;
|
|
2940
2940
|
const u = new Map(o.map((x) => [x.field, x])), g = /* @__PURE__ */ new Set();
|
|
2941
2941
|
for (const x of n)
|
|
2942
|
-
g.add(
|
|
2942
|
+
g.add(Xn(x, a));
|
|
2943
2943
|
const f = Array.from(g).sort(), m = /* @__PURE__ */ new Map();
|
|
2944
2944
|
for (const x of n) {
|
|
2945
|
-
const N =
|
|
2945
|
+
const N = Xn(x, l);
|
|
2946
2946
|
if (!m.has(N)) {
|
|
2947
|
-
const
|
|
2948
|
-
for (const S of l)
|
|
2949
|
-
m.set(N, { labelValues:
|
|
2947
|
+
const v = {};
|
|
2948
|
+
for (const S of l) v[S] = x[S];
|
|
2949
|
+
m.set(N, { labelValues: v, bucket: /* @__PURE__ */ new Map() });
|
|
2950
2950
|
}
|
|
2951
|
-
const E = m.get(N), j =
|
|
2951
|
+
const E = m.get(N), j = Xn(x, a);
|
|
2952
2952
|
E.bucket.has(j) || E.bucket.set(j, /* @__PURE__ */ new Map());
|
|
2953
2953
|
const _ = E.bucket.get(j);
|
|
2954
|
-
for (const
|
|
2955
|
-
const S = Number(x[
|
|
2956
|
-
_.has(
|
|
2954
|
+
for (const v of s) {
|
|
2955
|
+
const S = Number(x[v.field]);
|
|
2956
|
+
_.has(v.field) || _.set(v.field, []), isNaN(S) || _.get(v.field).push(S);
|
|
2957
2957
|
}
|
|
2958
2958
|
}
|
|
2959
2959
|
let d = 0;
|
|
@@ -2963,8 +2963,8 @@ function Ci(n, o, e, r) {
|
|
|
2963
2963
|
for (const E of f) {
|
|
2964
2964
|
const j = x.bucket.get(E);
|
|
2965
2965
|
for (const _ of s) {
|
|
2966
|
-
const
|
|
2967
|
-
N[
|
|
2966
|
+
const v = a.length > 0 ? `${E}${_.field}${_.aggFn}` : `${_.field}${_.aggFn}`, S = j?.get(_.field) ?? [];
|
|
2967
|
+
N[v] = S.length > 0 ? yi(S, _.aggFn) : null;
|
|
2968
2968
|
}
|
|
2969
2969
|
}
|
|
2970
2970
|
h.push(N);
|
|
@@ -2985,7 +2985,7 @@ function Ci(n, o, e, r) {
|
|
|
2985
2985
|
return _?.headerName ? `${_.headerName}: ${E}` : E;
|
|
2986
2986
|
}).join(" / ") : "";
|
|
2987
2987
|
for (const E of s) {
|
|
2988
|
-
const j = u.get(E.field), _ = a.length > 0 ? `${x}${E.field}${E.aggFn}` : `${E.field}${E.aggFn}`,
|
|
2988
|
+
const j = u.get(E.field), _ = a.length > 0 ? `${x}${E.field}${E.aggFn}` : `${E.field}${E.aggFn}`, v = E.headerName ?? j?.headerName ?? E.field, S = N ? `${N} — ${v} (${E.aggFn})` : `${v} (${E.aggFn})`;
|
|
2989
2989
|
w.push({
|
|
2990
2990
|
field: _,
|
|
2991
2991
|
headerName: S,
|
|
@@ -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
|
}
|
|
@@ -3068,7 +3068,7 @@ function Ri() {
|
|
|
3068
3068
|
] });
|
|
3069
3069
|
}
|
|
3070
3070
|
function Io(n) {
|
|
3071
|
-
const { columns: o, visibleColumns: e, onVisibilityChange: r, onShowAll: i, onHideAll: l } = n, [a, s] = Q(""), g =
|
|
3071
|
+
const { columns: o, visibleColumns: e, onVisibilityChange: r, onShowAll: i, onHideAll: l } = n, [a, s] = Q(""), g = de(() => o.filter((d) => d.hideable !== !1), [o]).every((d) => e.has(d.field)), f = de(() => {
|
|
3072
3072
|
if (!a) return o;
|
|
3073
3073
|
const d = a.toLowerCase();
|
|
3074
3074
|
return o.filter(
|
|
@@ -3101,7 +3101,7 @@ function Io(n) {
|
|
|
3101
3101
|
className: `ogx-column-visibility-panel__item ${w ? "" : "ogx-column-visibility-panel__item--disabled"}`,
|
|
3102
3102
|
children: [
|
|
3103
3103
|
/* @__PURE__ */ t.jsx(
|
|
3104
|
-
|
|
3104
|
+
Rn,
|
|
3105
3105
|
{
|
|
3106
3106
|
checked: h,
|
|
3107
3107
|
onChange: (x) => r(d.field, x.target.checked),
|
|
@@ -3117,7 +3117,7 @@ function Io(n) {
|
|
|
3117
3117
|
/* @__PURE__ */ t.jsxs("div", { className: "ogx-column-visibility-panel__footer", children: [
|
|
3118
3118
|
/* @__PURE__ */ t.jsxs("label", { className: "ogx-column-visibility-panel__item", children: [
|
|
3119
3119
|
/* @__PURE__ */ t.jsx(
|
|
3120
|
-
|
|
3120
|
+
Rn,
|
|
3121
3121
|
{
|
|
3122
3122
|
checked: g,
|
|
3123
3123
|
onChange: m
|
|
@@ -3157,11 +3157,11 @@ function el(n) {
|
|
|
3157
3157
|
paginationModel: E = { page: 0, pageSize: 100 },
|
|
3158
3158
|
onPaginationModelChange: j,
|
|
3159
3159
|
pageSizeOptions: _ = [10, 25, 50, 100],
|
|
3160
|
-
pinnedColumns:
|
|
3160
|
+
pinnedColumns: v,
|
|
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,
|
|
@@ -3174,7 +3174,7 @@ function el(n) {
|
|
|
3174
3174
|
onRowOrderChange: te,
|
|
3175
3175
|
loading: J = !1,
|
|
3176
3176
|
treeData: we = !1,
|
|
3177
|
-
getTreeDataPath:
|
|
3177
|
+
getTreeDataPath: b,
|
|
3178
3178
|
defaultGroupingExpansionDepth: H,
|
|
3179
3179
|
rowGroupingModel: T,
|
|
3180
3180
|
aggregationModel: A,
|
|
@@ -3182,9 +3182,9 @@ function el(n) {
|
|
|
3182
3182
|
getAggregationPosition: Z,
|
|
3183
3183
|
isCellEditable: U,
|
|
3184
3184
|
processRowUpdate: P,
|
|
3185
|
-
onProcessRowUpdateError:
|
|
3186
|
-
dataSource:
|
|
3187
|
-
sortingMode:
|
|
3185
|
+
onProcessRowUpdateError: ce,
|
|
3186
|
+
dataSource: ie,
|
|
3187
|
+
sortingMode: ve = "client",
|
|
3188
3188
|
filterMode: nt = "client",
|
|
3189
3189
|
paginationMode: z = "client",
|
|
3190
3190
|
rowCount: Ne,
|
|
@@ -3200,48 +3200,48 @@ function el(n) {
|
|
|
3200
3200
|
initialState: _t,
|
|
3201
3201
|
onStateChange: Be,
|
|
3202
3202
|
// Column Visibility
|
|
3203
|
-
columnVisibilityModel:
|
|
3204
|
-
onColumnVisibilityModelChange:
|
|
3203
|
+
columnVisibilityModel: eo,
|
|
3204
|
+
onColumnVisibilityModelChange: to,
|
|
3205
3205
|
listView: an = !1,
|
|
3206
|
-
listViewColumn:
|
|
3206
|
+
listViewColumn: no,
|
|
3207
3207
|
columnGroupingModel: Et,
|
|
3208
|
-
noRowsLabel:
|
|
3209
|
-
apiRef:
|
|
3210
|
-
} = n, To =
|
|
3208
|
+
noRowsLabel: Nn = "No Data",
|
|
3209
|
+
apiRef: In
|
|
3210
|
+
} = n, To = de(() => ({ items: [] }), []), Ye = d || To, [Fo, Wo] = Q(
|
|
3211
3211
|
() => _t?.sorting?.sortModel ?? []
|
|
3212
|
-
),
|
|
3212
|
+
), Pn = w !== void 0, ot = Pn ? w : Fo, Oo = de(() => [], []), Mn = T || Oo, Ln = A !== void 0, oo = de(() => Ie?.toolbar, [Ie?.toolbar]), [Ao, zo] = Q(
|
|
3213
3213
|
() => A ?? {}
|
|
3214
|
-
), rt =
|
|
3215
|
-
|
|
3216
|
-
}, [
|
|
3214
|
+
), rt = Ln ? A : Ao, Bo = W((c) => {
|
|
3215
|
+
Ln || zo(c), O?.(c);
|
|
3216
|
+
}, [Ln, O]), [$o, Ho] = Q(
|
|
3217
3217
|
() => _t?.columns?.columnVisibilityModel ?? {}
|
|
3218
|
-
),
|
|
3219
|
-
|
|
3220
|
-
}, [
|
|
3218
|
+
), Tn = eo !== void 0, Qe = Tn ? eo : $o, Zt = W((c) => {
|
|
3219
|
+
Tn || Ho(c), to?.(c);
|
|
3220
|
+
}, [Tn, to]), [Do, Go] = Q(
|
|
3221
3221
|
() => _t?.columns?.pinnedColumns ?? {}
|
|
3222
|
-
),
|
|
3223
|
-
|
|
3224
|
-
}, [
|
|
3222
|
+
), Fn = v !== void 0, it = Fn ? v : Do, Wn = W((c) => {
|
|
3223
|
+
Fn || Go(c), S?.(c);
|
|
3224
|
+
}, [Fn, S]), Vo = de(() => ({ rowFields: [], columnFields: [], valueFields: [] }), []), [Uo, Ko] = Q(jt ?? Vo), ro = jt ?? Uo, Yo = W((c) => {
|
|
3225
3225
|
Ko(c), ht?.(c);
|
|
3226
|
-
}, [ht]), dn = Ci(o, e,
|
|
3226
|
+
}, [ht]), dn = Ci(o, e, ro, Ge), On = Ge && dn.isValid ? dn.pivotRows : o, lt = Ge && dn.isValid ? dn.pivotColumns : e, [Xo, io] = Q(null);
|
|
3227
3227
|
ee(() => {
|
|
3228
|
-
|
|
3228
|
+
io(null);
|
|
3229
3229
|
}, [rt]);
|
|
3230
3230
|
const [qo, Jo] = Q(
|
|
3231
3231
|
() => _t?.pagination?.paginationModel ?? E
|
|
3232
|
-
),
|
|
3233
|
-
|
|
3234
|
-
}, [
|
|
3235
|
-
|
|
3236
|
-
}, []),
|
|
3237
|
-
|
|
3238
|
-
const
|
|
3239
|
-
if (
|
|
3240
|
-
const R =
|
|
3241
|
-
|
|
3232
|
+
), An = n.paginationModel !== void 0, xe = An ? E : qo, cn = W((c) => {
|
|
3233
|
+
An || Jo(c), j?.(c);
|
|
3234
|
+
}, [An, j]), [Qo, lo] = Q([]), en = u !== void 0, so = en ? u : Qo, Pe = de(() => new Set(so), [so]), un = g, Nt = ne(null), Zo = ne(null), gn = ne(null), er = W((c) => c.id, []), fn = r || er, [Ze, Ft] = Q(null), Wt = W((c) => {
|
|
3235
|
+
Kn.current?.classList.toggle("ogx--kb", c);
|
|
3236
|
+
}, []), ao = ne(ie);
|
|
3237
|
+
ao.current = ie;
|
|
3238
|
+
const co = ne(null), uo = ne(null), tr = W((c) => {
|
|
3239
|
+
if (ao.current && we && c.serverChildrenCount > 0 && c.children.length === 0) {
|
|
3240
|
+
const R = uo.current?.getNodePath(c.id) || [c.groupingKey];
|
|
3241
|
+
co.current?.(c.id, R);
|
|
3242
3242
|
}
|
|
3243
3243
|
}, [we]), st = ii({
|
|
3244
|
-
rows:
|
|
3244
|
+
rows: On,
|
|
3245
3245
|
columns: lt,
|
|
3246
3246
|
rowHeight: i,
|
|
3247
3247
|
headerHeight: l,
|
|
@@ -3249,32 +3249,32 @@ function el(n) {
|
|
|
3249
3249
|
columnVisibilityModel: Qe,
|
|
3250
3250
|
initialState: n.initialState
|
|
3251
3251
|
}), {
|
|
3252
|
-
state:
|
|
3252
|
+
state: ue,
|
|
3253
3253
|
apiRef: Ot,
|
|
3254
|
-
setRows:
|
|
3255
|
-
setColumns:
|
|
3256
|
-
setScroll:
|
|
3257
|
-
setDimensions:
|
|
3254
|
+
setRows: zn,
|
|
3255
|
+
setColumns: go,
|
|
3256
|
+
setScroll: fo,
|
|
3257
|
+
setDimensions: ho,
|
|
3258
3258
|
setDataSourceLoading: nr,
|
|
3259
3259
|
setDataSourceError: or,
|
|
3260
3260
|
setRowCount: rr
|
|
3261
3261
|
} = st;
|
|
3262
3262
|
ee(() => {
|
|
3263
|
-
|
|
3264
|
-
}, [
|
|
3265
|
-
const { copySelectedRows:
|
|
3263
|
+
In && (In.current = Ot.current);
|
|
3264
|
+
}, [In, Ot]);
|
|
3265
|
+
const { copySelectedRows: po } = ji({
|
|
3266
3266
|
selectedRowIds: Pe,
|
|
3267
3267
|
columns: lt,
|
|
3268
3268
|
getVisibleRows: () => Ot.current.getVisibleRows(),
|
|
3269
|
-
getRowId:
|
|
3269
|
+
getRowId: fn
|
|
3270
3270
|
});
|
|
3271
3271
|
ee(() => {
|
|
3272
|
-
Ot.current.copySelectedRows =
|
|
3273
|
-
}, [
|
|
3274
|
-
const ir =
|
|
3275
|
-
rows:
|
|
3276
|
-
getRowId:
|
|
3277
|
-
getTreeDataPath:
|
|
3272
|
+
Ot.current.copySelectedRows = po, Ot.current.getSelectedRows = () => Array.from(Pe);
|
|
3273
|
+
}, [po, Pe, Ot]);
|
|
3274
|
+
const ir = ue.dataSource.loading, tn = J || ir, nn = de(() => ue.rows.allRows.map((c) => ue.rows.idRowsLookup.get(c)), [ue.rows]), Bn = hi({
|
|
3275
|
+
rows: nn,
|
|
3276
|
+
getRowId: fn,
|
|
3277
|
+
getTreeDataPath: b,
|
|
3278
3278
|
treeData: we,
|
|
3279
3279
|
defaultGroupingExpansionDepth: H,
|
|
3280
3280
|
filterModel: Ye,
|
|
@@ -3282,48 +3282,48 @@ function el(n) {
|
|
|
3282
3282
|
onRowExpansionChange: tr
|
|
3283
3283
|
});
|
|
3284
3284
|
ee(() => {
|
|
3285
|
-
|
|
3286
|
-
}, [
|
|
3285
|
+
uo.current = Bn;
|
|
3286
|
+
}, [Bn]);
|
|
3287
3287
|
const lr = xi({
|
|
3288
|
-
rows:
|
|
3289
|
-
getRowId:
|
|
3290
|
-
rowGroupingModel:
|
|
3288
|
+
rows: nn,
|
|
3289
|
+
getRowId: fn,
|
|
3290
|
+
rowGroupingModel: Mn,
|
|
3291
3291
|
aggregationModel: rt,
|
|
3292
3292
|
defaultGroupingExpansionDepth: H,
|
|
3293
3293
|
filterModel: Ye,
|
|
3294
3294
|
sortModel: ot,
|
|
3295
3295
|
getAggregationPosition: Z
|
|
3296
3296
|
}), $e = mi({
|
|
3297
|
-
rows:
|
|
3298
|
-
getRowId:
|
|
3297
|
+
rows: nn,
|
|
3298
|
+
getRowId: fn,
|
|
3299
3299
|
processRowUpdate: P,
|
|
3300
|
-
onProcessRowUpdateError:
|
|
3300
|
+
onProcessRowUpdateError: ce,
|
|
3301
3301
|
onRowChange: (c) => {
|
|
3302
3302
|
const { dispatch: R } = st, V = Array.from(st.state.rows.idRowsLookup.values()).map(
|
|
3303
3303
|
(le) => le.id === c.id ? c : le
|
|
3304
3304
|
);
|
|
3305
3305
|
R({ type: "SET_ROWS", payload: V });
|
|
3306
3306
|
}
|
|
3307
|
-
}),
|
|
3307
|
+
}), $n = we, At = !!(Mn && Mn.length > 0), hn = $n || At, He = $n ? Bn : At ? lr : null, Me = N && !At, pn = W((c) => {
|
|
3308
3308
|
const { row: R, id: M } = c;
|
|
3309
|
-
if (
|
|
3309
|
+
if (hn && R._hasChildren) {
|
|
3310
3310
|
He?.toggleExpansion(M);
|
|
3311
3311
|
return;
|
|
3312
3312
|
}
|
|
3313
3313
|
f?.(c);
|
|
3314
|
-
}, [
|
|
3314
|
+
}, [hn, He, f]), Oe = de(() => hn ? lt.map((c, R) => R === 0 ? {
|
|
3315
3315
|
...c,
|
|
3316
3316
|
renderCell: (M) => {
|
|
3317
|
-
const { _treeDepth: V, _hasChildren: le, _isExpanded: fe, _groupingField: Ce, _groupingValue: qe, _descendantCount: Ue } = M.row,
|
|
3317
|
+
const { _treeDepth: V, _hasChildren: le, _isExpanded: fe, _groupingField: Ce, _groupingValue: qe, _descendantCount: Ue } = M.row, be = (V || 0) * 24;
|
|
3318
3318
|
let ae = c.renderCell ? c.renderCell(M) : M.value;
|
|
3319
|
-
return
|
|
3319
|
+
return $n && le && M.row._isGroupRow && (ae = /* @__PURE__ */ t.jsxs("div", { className: "ogx__group-cell-content", children: [
|
|
3320
3320
|
M.value,
|
|
3321
3321
|
Ue !== void 0 && Ue > 0 ? ` (${Ue})` : ""
|
|
3322
3322
|
] })), At && le && Ce && (ae = /* @__PURE__ */ t.jsxs("div", { className: "ogx__group-cell-content", children: [
|
|
3323
3323
|
c.field === Ce ? "" : `${Ce}: `,
|
|
3324
3324
|
String(qe),
|
|
3325
3325
|
Ue !== void 0 ? ` (${Ue})` : ""
|
|
3326
|
-
] })), /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", paddingLeft:
|
|
3326
|
+
] })), /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", paddingLeft: be, width: "100%", height: "100%" }, children: [
|
|
3327
3327
|
/* @__PURE__ */ t.jsx(
|
|
3328
3328
|
"div",
|
|
3329
3329
|
{
|
|
@@ -3377,44 +3377,44 @@ function el(n) {
|
|
|
3377
3377
|
const { _hasChildren: V, _groupingField: le } = M.row;
|
|
3378
3378
|
return At && V ? c.field === le ? null : M.value !== void 0 && M.value !== null ? c.renderCell ? c.renderCell(M) : M.value : null : c.renderCell ? c.renderCell(M) : M.value;
|
|
3379
3379
|
}
|
|
3380
|
-
}) : lt, [lt,
|
|
3381
|
-
dataSource:
|
|
3380
|
+
}) : lt, [lt, hn, At, He]), Hn = bi({
|
|
3381
|
+
dataSource: ie,
|
|
3382
3382
|
sortModel: ot,
|
|
3383
3383
|
filterModel: Ye,
|
|
3384
3384
|
paginationModel: xe,
|
|
3385
3385
|
paginationMode: z,
|
|
3386
|
-
sortingMode:
|
|
3386
|
+
sortingMode: ve,
|
|
3387
3387
|
filterMode: nt,
|
|
3388
3388
|
aggregationModel: rt,
|
|
3389
|
-
setRows:
|
|
3389
|
+
setRows: zn,
|
|
3390
3390
|
setRowCount: rr,
|
|
3391
3391
|
setDataSourceLoading: nr,
|
|
3392
3392
|
setDataSourceError: or,
|
|
3393
|
-
onAggregationResults:
|
|
3393
|
+
onAggregationResults: io
|
|
3394
3394
|
});
|
|
3395
3395
|
ee(() => {
|
|
3396
|
-
|
|
3397
|
-
}, [
|
|
3396
|
+
Hn.fetchChildren && (co.current = Hn.fetchChildren);
|
|
3397
|
+
}, [Hn.fetchChildren]);
|
|
3398
3398
|
const [at, sr] = Q(
|
|
3399
3399
|
() => _t?.columns?.columnWidths ?? {}
|
|
3400
3400
|
), [ar, xo] = Q(
|
|
3401
3401
|
() => _t?.columns?.columnOrder ?? lt.map((c) => c.field)
|
|
3402
3402
|
), zt = $ || ar;
|
|
3403
3403
|
ee(() => {
|
|
3404
|
-
|
|
3405
|
-
}, [
|
|
3406
|
-
|
|
3407
|
-
}, [lt,
|
|
3404
|
+
ie || zn(On);
|
|
3405
|
+
}, [On, zn, ie]), ee(() => {
|
|
3406
|
+
go(lt);
|
|
3407
|
+
}, [lt, go]), ee(() => {
|
|
3408
3408
|
Ge && xo(lt.map((c) => c.field));
|
|
3409
3409
|
}, [Ge, lt]);
|
|
3410
|
-
const Bt =
|
|
3410
|
+
const Bt = de(() => {
|
|
3411
3411
|
if (Y) return Oe;
|
|
3412
3412
|
const c = new Map(zt.map((R, M) => [R, M]));
|
|
3413
3413
|
return [...Oe].sort((R, M) => {
|
|
3414
3414
|
const V = c.get(R.field) ?? Oe.indexOf(R), le = c.get(M.field) ?? Oe.indexOf(M);
|
|
3415
3415
|
return V - le;
|
|
3416
3416
|
});
|
|
3417
|
-
}, [Oe, zt, Y]), mo =
|
|
3417
|
+
}, [Oe, zt, Y]), mo = de(() => Bt.filter((c) => Qe[c.field] !== !1), [Bt, Qe]), $t = li({
|
|
3418
3418
|
columns: Bt,
|
|
3419
3419
|
onColumnOrderChange: W((c) => {
|
|
3420
3420
|
const { oldIndex: R, targetIndex: M } = c, V = [...zt], [le] = V.splice(R, 1);
|
|
@@ -3424,14 +3424,14 @@ function el(n) {
|
|
|
3424
3424
|
}), [dr, cr] = Q(/* @__PURE__ */ new Set()), yt = p ?? dr, et = !!I, on = W((c) => {
|
|
3425
3425
|
const R = new Set(yt);
|
|
3426
3426
|
R.has(c) ? R.delete(c) : R.add(c), p === void 0 && cr(R), k?.(R);
|
|
3427
|
-
}, [yt, p, k]), ye =
|
|
3427
|
+
}, [yt, p, k]), ye = de(() => {
|
|
3428
3428
|
const c = [];
|
|
3429
3429
|
return D && c.push({ field: "__reorder_col__" }), et && c.push({ field: "__expand_col__" }), s && c.push({ field: "__checkbox_col__" }), [...c, ...Bt];
|
|
3430
3430
|
}, [Bt, s, et, D]), ur = W((c, R) => {
|
|
3431
3431
|
sr((M) => ({ ...M, [c]: R }));
|
|
3432
|
-
}, []),
|
|
3433
|
-
|
|
3434
|
-
if (!
|
|
3432
|
+
}, []), Dn = ne(Be);
|
|
3433
|
+
Dn.current = Be, ee(() => {
|
|
3434
|
+
if (!Dn.current) return;
|
|
3435
3435
|
const c = {
|
|
3436
3436
|
sorting: { sortModel: ot },
|
|
3437
3437
|
filter: { filterModel: Ye },
|
|
@@ -3443,7 +3443,7 @@ function el(n) {
|
|
|
3443
3443
|
pinnedColumns: it
|
|
3444
3444
|
}
|
|
3445
3445
|
};
|
|
3446
|
-
|
|
3446
|
+
Dn.current(c);
|
|
3447
3447
|
}, [
|
|
3448
3448
|
ot,
|
|
3449
3449
|
Ye,
|
|
@@ -3453,12 +3453,12 @@ function el(n) {
|
|
|
3453
3453
|
Qe,
|
|
3454
3454
|
it
|
|
3455
3455
|
]);
|
|
3456
|
-
const
|
|
3457
|
-
if (!Me || z === "server" &&
|
|
3456
|
+
const xn = de(() => nn, [nn]), Ve = de(() => He ? He.getVisibleRows() || [] : nt === "server" && ie ? xn : ui(xn, Ye), [xn, Ye, He, nt, ie]), { top: Xe, center: Ht, bottom: dt } = de(() => He ? { top: [], center: Ve, bottom: [] } : Pr(Ve, y), [Ve, y, He]), Le = de(() => He || ve === "server" && ie ? Ht : fi(Ht, ot), [Ht, ot, He, ve, ie]), pt = de(() => {
|
|
3457
|
+
if (!Me || z === "server" && ie)
|
|
3458
3458
|
return Le;
|
|
3459
3459
|
const c = xe.page * xe.pageSize, R = c + xe.pageSize;
|
|
3460
3460
|
return Le.slice(c, R);
|
|
3461
|
-
}, [Le, Me, xe.page, xe.pageSize, z,
|
|
3461
|
+
}, [Le, Me, xe.page, xe.pageSize, z, ie]);
|
|
3462
3462
|
ee(() => {
|
|
3463
3463
|
st.apiRef.current.getVisibleRows = () => Le, st.apiRef.current.getVisibleColumns = () => Oe;
|
|
3464
3464
|
}, [Le, Oe, st.apiRef]);
|
|
@@ -3467,11 +3467,11 @@ function el(n) {
|
|
|
3467
3467
|
getRowId: (c) => c.id,
|
|
3468
3468
|
onRowOrderChange: te,
|
|
3469
3469
|
rowReordering: D
|
|
3470
|
-
}), Re =
|
|
3470
|
+
}), Re = de(() => {
|
|
3471
3471
|
if (He)
|
|
3472
3472
|
return Ht;
|
|
3473
3473
|
const c = Me ? pt : Le, R = [...Xe, ...c, ...dt];
|
|
3474
|
-
if (z === "infinite" &&
|
|
3474
|
+
if (z === "infinite" && ue.dataSource.loading && R.length > 0) {
|
|
3475
3475
|
const M = Math.min(xe.pageSize, 20), V = Array.from({ length: M }, (le, fe) => ({
|
|
3476
3476
|
id: `__skeleton_${fe}__`,
|
|
3477
3477
|
_isSkeleton: !0
|
|
@@ -3488,38 +3488,38 @@ function el(n) {
|
|
|
3488
3488
|
He,
|
|
3489
3489
|
Ht,
|
|
3490
3490
|
z,
|
|
3491
|
-
|
|
3491
|
+
ue.dataSource.loading,
|
|
3492
3492
|
xe.pageSize
|
|
3493
3493
|
]), Gt = wi(
|
|
3494
3494
|
Re,
|
|
3495
3495
|
ye,
|
|
3496
3496
|
at
|
|
3497
|
-
), { aggregationResult:
|
|
3497
|
+
), { aggregationResult: Gn } = _i({
|
|
3498
3498
|
rows: Ve,
|
|
3499
3499
|
aggregationModel: rt,
|
|
3500
|
-
isServerSide: !!(
|
|
3501
|
-
dataSource:
|
|
3500
|
+
isServerSide: !!(ie && (z === "server" || ve === "server")),
|
|
3501
|
+
dataSource: ie,
|
|
3502
3502
|
filterModel: Ye,
|
|
3503
3503
|
sortModel: ot,
|
|
3504
3504
|
serverAggregationResults: Xo
|
|
3505
|
-
}),
|
|
3505
|
+
}), mn = Object.keys(rt).length > 0;
|
|
3506
3506
|
ee(() => {
|
|
3507
|
-
st.apiRef.current.getAggregationResult = () =>
|
|
3508
|
-
}, [
|
|
3509
|
-
const
|
|
3507
|
+
st.apiRef.current.getAggregationResult = () => mn ? Gn : null, st.apiRef.current.getAggregationModel = () => mn ? rt : null;
|
|
3508
|
+
}, [Gn, rt, mn, st.apiRef]);
|
|
3509
|
+
const Vn = de(() => {
|
|
3510
3510
|
const c = i, R = Me ? pt : Le, M = R.map((F, X) => {
|
|
3511
|
-
let
|
|
3511
|
+
let oe = c;
|
|
3512
3512
|
if (yt.has(F.id)) {
|
|
3513
|
-
const De =
|
|
3514
|
-
|
|
3513
|
+
const De = C?.({ row: F, id: F.id, rowIndex: Xe.length + X }) ?? 200;
|
|
3514
|
+
oe += typeof De == "number" ? De : parseInt(String(De), 10) || 200;
|
|
3515
3515
|
}
|
|
3516
|
-
return
|
|
3517
|
-
}), V = M.reduce((F, X,
|
|
3516
|
+
return oe;
|
|
3517
|
+
}), V = M.reduce((F, X, oe) => (F.push((F[oe - 1] || 0) + X), F), []), fe = (z === "infinite" && ue.dataSource.loading && R.length > 0 ? Math.min(xe.pageSize, 20) : 0) * c, Ce = (V[V.length - 1] || 0) + fe, qe = Xe.length * c, Ue = dt.length * c, se = [], be = [], ae = [], G = [];
|
|
3518
3518
|
mo.forEach((F) => {
|
|
3519
|
-
const X =
|
|
3520
|
-
X === "left" ? se.push(F) : X === "right" ?
|
|
3519
|
+
const X = En(F.field, it);
|
|
3520
|
+
X === "left" ? se.push(F) : X === "right" ? be.push(F) : ae.push(F);
|
|
3521
3521
|
});
|
|
3522
|
-
const me =
|
|
3522
|
+
const me = ue.dimensions.viewportWidth || 1e3, je = (s ? 48 : 0) + (et ? 48 : 0) + (D ? 48 : 0), _e = (F) => at[F.field] ?? F.width, Te = (F) => {
|
|
3523
3523
|
if (F === void 0) return { type: "auto", value: 0 };
|
|
3524
3524
|
if (typeof F == "number") return { type: "fixed", value: F };
|
|
3525
3525
|
if (typeof F == "string") {
|
|
@@ -3531,18 +3531,18 @@ function el(n) {
|
|
|
3531
3531
|
}
|
|
3532
3532
|
return { type: "fixed", value: 100 };
|
|
3533
3533
|
}, Fe = se.reduce((F, X) => {
|
|
3534
|
-
const
|
|
3535
|
-
return F + (
|
|
3536
|
-
}, 0), he =
|
|
3537
|
-
const
|
|
3538
|
-
return F + (
|
|
3534
|
+
const oe = Te(_e(X));
|
|
3535
|
+
return F + (oe.type === "fixed" ? oe.value : 100);
|
|
3536
|
+
}, 0), he = be.reduce((F, X) => {
|
|
3537
|
+
const oe = Te(_e(X));
|
|
3538
|
+
return F + (oe.type === "fixed" ? oe.value : 100);
|
|
3539
3539
|
}, 0), ge = ae.reduce((F, X) => {
|
|
3540
3540
|
if (X.flex && X.flex > 0) {
|
|
3541
|
-
const De = X.minWidth ?? 150,
|
|
3542
|
-
return F + (De ||
|
|
3541
|
+
const De = X.minWidth ?? 150, bt = typeof X.width == "number" ? X.width : 150;
|
|
3542
|
+
return F + (De || bt);
|
|
3543
3543
|
}
|
|
3544
|
-
const
|
|
3545
|
-
return
|
|
3544
|
+
const oe = Te(_e(X));
|
|
3545
|
+
return oe.type === "fixed" ? F + oe.value : oe.type === "percentage" ? F + 100 : F + (X.minWidth ?? 150);
|
|
3546
3546
|
}, 0), xt = Math.max(
|
|
3547
3547
|
me - je - Fe - he,
|
|
3548
3548
|
ge
|
|
@@ -3560,8 +3560,8 @@ function el(n) {
|
|
|
3560
3560
|
let We = Math.max(0, xt - Ke);
|
|
3561
3561
|
const ut = /* @__PURE__ */ new Map();
|
|
3562
3562
|
Ae.forEach(({ col: F, percentage: X }) => {
|
|
3563
|
-
const
|
|
3564
|
-
ut.set(F.field,
|
|
3563
|
+
const oe = X / 100 * We;
|
|
3564
|
+
ut.set(F.field, oe), We -= oe;
|
|
3565
3565
|
}), We = Math.max(0, We);
|
|
3566
3566
|
const Ct = /* @__PURE__ */ new Map(), mt = Ee.map((F) => ({
|
|
3567
3567
|
...F,
|
|
@@ -3575,40 +3575,40 @@ function el(n) {
|
|
|
3575
3575
|
const X = mt.length * 2;
|
|
3576
3576
|
for (; F < X; ) {
|
|
3577
3577
|
F++;
|
|
3578
|
-
const
|
|
3579
|
-
if (
|
|
3580
|
-
const De =
|
|
3578
|
+
const oe = mt.filter((re) => !re.frozen);
|
|
3579
|
+
if (oe.length === 0) break;
|
|
3580
|
+
const De = oe.reduce((re, gt) => re + gt.flex, 0), bt = mt.reduce((re, gt) => gt.frozen ? re + gt.computedWidth : re, 0), _r = Math.max(0, We - bt);
|
|
3581
3581
|
if (De <= 0) {
|
|
3582
|
-
|
|
3583
|
-
|
|
3582
|
+
oe.forEach((re) => {
|
|
3583
|
+
re.computedWidth = re.minWidth, re.frozen = !0;
|
|
3584
3584
|
});
|
|
3585
3585
|
break;
|
|
3586
3586
|
}
|
|
3587
3587
|
const yr = _r / De;
|
|
3588
3588
|
let vn = 0;
|
|
3589
|
-
const
|
|
3590
|
-
if (
|
|
3591
|
-
const gt = yr *
|
|
3592
|
-
if (gt <
|
|
3593
|
-
const
|
|
3594
|
-
vn +=
|
|
3595
|
-
} else if (gt >
|
|
3596
|
-
const
|
|
3597
|
-
vn +=
|
|
3589
|
+
const _n = [], yn = [];
|
|
3590
|
+
if (oe.forEach((re) => {
|
|
3591
|
+
const gt = yr * re.flex;
|
|
3592
|
+
if (gt < re.minWidth) {
|
|
3593
|
+
const Yn = re.minWidth - gt;
|
|
3594
|
+
vn += Yn, _n.push(re);
|
|
3595
|
+
} else if (gt > re.maxWidth) {
|
|
3596
|
+
const Yn = re.maxWidth - gt;
|
|
3597
|
+
vn += Yn, yn.push(re);
|
|
3598
3598
|
} else
|
|
3599
|
-
|
|
3600
|
-
}),
|
|
3601
|
-
|
|
3599
|
+
re.computedWidth = gt;
|
|
3600
|
+
}), _n.length === 0 && yn.length === 0) {
|
|
3601
|
+
oe.forEach((re) => re.frozen = !0);
|
|
3602
3602
|
break;
|
|
3603
3603
|
}
|
|
3604
|
-
vn > 0 ?
|
|
3605
|
-
|
|
3606
|
-
}) : vn < 0 ?
|
|
3607
|
-
|
|
3608
|
-
}) : (
|
|
3609
|
-
|
|
3610
|
-
}),
|
|
3611
|
-
|
|
3604
|
+
vn > 0 ? _n.forEach((re) => {
|
|
3605
|
+
re.computedWidth = re.minWidth, re.frozen = !0;
|
|
3606
|
+
}) : vn < 0 ? yn.forEach((re) => {
|
|
3607
|
+
re.computedWidth = re.maxWidth, re.frozen = !0;
|
|
3608
|
+
}) : (_n.forEach((re) => {
|
|
3609
|
+
re.computedWidth = re.minWidth, re.frozen = !0;
|
|
3610
|
+
}), yn.forEach((re) => {
|
|
3611
|
+
re.computedWidth = re.maxWidth, re.frozen = !0;
|
|
3612
3612
|
}));
|
|
3613
3613
|
}
|
|
3614
3614
|
})(), mt.forEach((F) => Ct.set(F.col.field, F.computedWidth));
|
|
@@ -3618,39 +3618,39 @@ function el(n) {
|
|
|
3618
3618
|
if (Ct.has(F.field))
|
|
3619
3619
|
X = Ct.get(F.field);
|
|
3620
3620
|
else {
|
|
3621
|
-
const
|
|
3622
|
-
if (
|
|
3623
|
-
X =
|
|
3621
|
+
const oe = ct.find((bt) => bt.col.field === F.field), De = Ae.find((bt) => bt.col.field === F.field);
|
|
3622
|
+
if (oe)
|
|
3623
|
+
X = oe.width;
|
|
3624
3624
|
else if (De) {
|
|
3625
|
-
const
|
|
3626
|
-
X = Math.max(F.minWidth ?? 50,
|
|
3625
|
+
const bt = ut.get(F.field) || 0;
|
|
3626
|
+
X = Math.max(F.minWidth ?? 50, bt || 100);
|
|
3627
3627
|
} else
|
|
3628
3628
|
X = 100;
|
|
3629
3629
|
}
|
|
3630
3630
|
G.push(X), Ut.set(F.field, X);
|
|
3631
3631
|
});
|
|
3632
3632
|
const wt = ae.map((F) => {
|
|
3633
|
-
const X = mt.find((
|
|
3633
|
+
const X = mt.find((oe) => oe.col.field === F.field);
|
|
3634
3634
|
return {
|
|
3635
3635
|
...F,
|
|
3636
3636
|
width: Ut.get(F.field) ?? (typeof F.width == "number" ? F.width : 100),
|
|
3637
3637
|
flex: X ? X.flex : F.flex
|
|
3638
3638
|
};
|
|
3639
3639
|
}), Je = 11, It = se.map((F, X) => {
|
|
3640
|
-
const
|
|
3640
|
+
const oe = Te(_e(F)), De = oe.type === "fixed" ? oe.value : 100;
|
|
3641
3641
|
return {
|
|
3642
3642
|
...F,
|
|
3643
3643
|
width: De,
|
|
3644
3644
|
zIndex: Je + X
|
|
3645
3645
|
};
|
|
3646
|
-
}), Kt = 11, kt =
|
|
3647
|
-
const
|
|
3646
|
+
}), Kt = 11, kt = be.map((F, X) => {
|
|
3647
|
+
const oe = Te(_e(F)), De = oe.type === "fixed" ? oe.value : 100;
|
|
3648
3648
|
return {
|
|
3649
3649
|
...F,
|
|
3650
3650
|
width: De,
|
|
3651
|
-
zIndex: Kt + (
|
|
3651
|
+
zIndex: Kt + (be.length - 1 - X)
|
|
3652
3652
|
};
|
|
3653
|
-
}), tt = G.reduce((F, X) => F + X, 0), ke = Fe + tt + he + je,
|
|
3653
|
+
}), tt = G.reduce((F, X) => F + X, 0), ke = Fe + tt + he + je, vr = G.reduce((F, X, oe) => (F.push((F[oe - 1] || 0) + X), F), []);
|
|
3654
3654
|
return {
|
|
3655
3655
|
rowHeights: M,
|
|
3656
3656
|
cumulativeHeights: V,
|
|
@@ -3661,7 +3661,7 @@ function el(n) {
|
|
|
3661
3661
|
rightPinnedCols: kt,
|
|
3662
3662
|
unpinnedColsWithWidth: wt,
|
|
3663
3663
|
unpinnedColWidths: G,
|
|
3664
|
-
unpinnedAccWidths:
|
|
3664
|
+
unpinnedAccWidths: vr,
|
|
3665
3665
|
totalWidth: ke,
|
|
3666
3666
|
leftWidth: Fe,
|
|
3667
3667
|
rightWidth: he,
|
|
@@ -3677,17 +3677,17 @@ 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,
|
|
3688
3688
|
it,
|
|
3689
3689
|
at,
|
|
3690
|
-
|
|
3690
|
+
ue.dimensions.viewportWidth,
|
|
3691
3691
|
s,
|
|
3692
3692
|
et,
|
|
3693
3693
|
D,
|
|
@@ -3695,9 +3695,9 @@ function el(n) {
|
|
|
3695
3695
|
B,
|
|
3696
3696
|
a,
|
|
3697
3697
|
z,
|
|
3698
|
-
|
|
3698
|
+
ue.dataSource.loading,
|
|
3699
3699
|
xe.pageSize
|
|
3700
|
-
]), Se =
|
|
3700
|
+
]), Se = de(() => {
|
|
3701
3701
|
const {
|
|
3702
3702
|
unpinnedAccWidths: c,
|
|
3703
3703
|
unpinnedColsWithWidth: R,
|
|
@@ -3709,12 +3709,12 @@ function el(n) {
|
|
|
3709
3709
|
unpinnedTotalWidth: qe,
|
|
3710
3710
|
systemColumnsWidth: Ue,
|
|
3711
3711
|
cumulativeHeights: se,
|
|
3712
|
-
pinnedTopHeight:
|
|
3712
|
+
pinnedTopHeight: be,
|
|
3713
3713
|
pinnedBottomHeight: ae,
|
|
3714
3714
|
unpinnedRowsHeight: G,
|
|
3715
3715
|
rowHeights: me,
|
|
3716
3716
|
unpinnedRowsLength: je
|
|
3717
|
-
} =
|
|
3717
|
+
} = Vn, _e = ue.virtualization.scrollLeft, Te = ue.virtualization.scrollTop, Fe = ue.dimensions.viewportWidth || 1e3, he = a ? be + G + ae + 50 : ue.dimensions.viewportHeight || 600, ge = 6, xt = Math.max(0, _e - fe), ct = _e + Fe - fe;
|
|
3718
3718
|
let Ae = 0, Ee = R.length - 1, ze = 0, Ke = c.length - 1;
|
|
3719
3719
|
for (; ze <= Ke; ) {
|
|
3720
3720
|
const ke = ze + Ke >>> 1;
|
|
@@ -3734,7 +3734,7 @@ function el(n) {
|
|
|
3734
3734
|
...R.slice(Ae, Ee + 1),
|
|
3735
3735
|
...ut > 0 ? [{ field: "__spacer_right__", width: ut, isSpacer: !0 }] : [],
|
|
3736
3736
|
...V
|
|
3737
|
-
], rn = Fe > 0 && le > Fe ? 16 : 0, Ut =
|
|
3737
|
+
], rn = Fe > 0 && le > Fe ? 16 : 0, Ut = be + G + ae + rn + 2, wt = 5;
|
|
3738
3738
|
let Je = 0, It = je - 1, Kt = 0, kt = 0, tt = se.length - 1;
|
|
3739
3739
|
for (; kt <= tt; ) {
|
|
3740
3740
|
const ke = kt + tt >>> 1;
|
|
@@ -3756,7 +3756,7 @@ function el(n) {
|
|
|
3756
3756
|
offsetTop: Kt,
|
|
3757
3757
|
offsetLeft: 0,
|
|
3758
3758
|
totalHeight: Ut,
|
|
3759
|
-
pinnedTopHeight:
|
|
3759
|
+
pinnedTopHeight: be,
|
|
3760
3760
|
pinnedBottomHeight: ae,
|
|
3761
3761
|
totalWidth: le,
|
|
3762
3762
|
rowHeights: me,
|
|
@@ -3772,15 +3772,15 @@ function el(n) {
|
|
|
3772
3772
|
}
|
|
3773
3773
|
};
|
|
3774
3774
|
}, [
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3775
|
+
Vn,
|
|
3776
|
+
ue.virtualization.scrollTop,
|
|
3777
|
+
ue.virtualization.scrollLeft,
|
|
3778
|
+
ue.dimensions.viewportHeight,
|
|
3779
|
+
ue.dimensions.viewportWidth,
|
|
3780
3780
|
a
|
|
3781
3781
|
]), gr = W((c) => {
|
|
3782
3782
|
const R = c.currentTarget;
|
|
3783
|
-
if (
|
|
3783
|
+
if (fo(R.scrollTop, R.scrollLeft), Rt) {
|
|
3784
3784
|
const { scrollTop: M, scrollHeight: V, clientHeight: le } = R;
|
|
3785
3785
|
V - M - le < 100 && Rt({
|
|
3786
3786
|
visibleTop: M,
|
|
@@ -3788,38 +3788,38 @@ function el(n) {
|
|
|
3788
3788
|
viewportHeight: le
|
|
3789
3789
|
});
|
|
3790
3790
|
}
|
|
3791
|
-
}, [
|
|
3791
|
+
}, [fo, Rt]);
|
|
3792
3792
|
ee(() => {
|
|
3793
3793
|
if (!Nt.current) return;
|
|
3794
3794
|
const c = new ResizeObserver((R) => {
|
|
3795
3795
|
for (const M of R) {
|
|
3796
3796
|
const { width: V, height: le } = M.contentRect;
|
|
3797
|
-
|
|
3797
|
+
ho(V, le);
|
|
3798
3798
|
}
|
|
3799
3799
|
});
|
|
3800
3800
|
return c.observe(Nt.current), () => {
|
|
3801
3801
|
c.disconnect();
|
|
3802
3802
|
};
|
|
3803
|
-
}, [
|
|
3803
|
+
}, [ho]);
|
|
3804
3804
|
const Vt = W((c, R) => {
|
|
3805
3805
|
const M = new Set(Pe);
|
|
3806
3806
|
R ? M.add(c) : M.delete(c);
|
|
3807
3807
|
const V = Array.from(M);
|
|
3808
|
-
|
|
3809
|
-
}, [Pe,
|
|
3808
|
+
en || lo(V), un?.(V);
|
|
3809
|
+
}, [Pe, en, un]), fr = W((c) => {
|
|
3810
3810
|
let R = [];
|
|
3811
|
-
c && (R =
|
|
3812
|
-
}, [o,
|
|
3811
|
+
c && (R = xn.map((M) => M.id)), en || lo(R), un?.(R);
|
|
3812
|
+
}, [o, en, un]), wo = W((c, R) => {
|
|
3813
3813
|
const M = R ? [{ field: c, sort: R }] : [];
|
|
3814
|
-
|
|
3815
|
-
}, [
|
|
3814
|
+
Pn || Wo(M), x?.(M);
|
|
3815
|
+
}, [Pn, x]), Un = W((c) => {
|
|
3816
3816
|
Wt(!1), Ft({ id: c.row.id, field: c.field }), gn.current?.focus({ preventScroll: !0 }), m?.(c);
|
|
3817
|
-
}, [m, Wt]),
|
|
3817
|
+
}, [m, Wt]), bo = ne($e.editingCell);
|
|
3818
3818
|
ee(() => {
|
|
3819
|
-
const c = !!
|
|
3820
|
-
c && !R && gn.current?.focus({ preventScroll: !0 }),
|
|
3819
|
+
const c = !!bo.current, R = !!$e.editingCell;
|
|
3820
|
+
c && !R && gn.current?.focus({ preventScroll: !0 }), bo.current = $e.editingCell;
|
|
3821
3821
|
}, [$e.editingCell]);
|
|
3822
|
-
const
|
|
3822
|
+
const vo = de(() => {
|
|
3823
3823
|
const { firstRowIndex: c, lastRowIndex: R } = Se.renderContext, M = Xe.length, V = Xe.map((ae, G) => ({ row: ae, rowIndex: G })), le = dt.map((ae, G) => ({
|
|
3824
3824
|
row: ae,
|
|
3825
3825
|
rowIndex: M + (Me ? pt.length : Le.length) + G
|
|
@@ -3839,7 +3839,7 @@ function el(n) {
|
|
|
3839
3839
|
Le,
|
|
3840
3840
|
Me,
|
|
3841
3841
|
z,
|
|
3842
|
-
|
|
3842
|
+
ue.dataSource.loading,
|
|
3843
3843
|
xe.pageSize,
|
|
3844
3844
|
i
|
|
3845
3845
|
]), hr = o.length > 0 && Pe.size === o.length, pr = Pe.size > 0 && Pe.size < o.length, xr = W((c) => {
|
|
@@ -3932,26 +3932,26 @@ function el(n) {
|
|
|
3932
3932
|
}
|
|
3933
3933
|
return null;
|
|
3934
3934
|
};
|
|
3935
|
-
let se = fe,
|
|
3935
|
+
let se = fe, be = Ce, ae = !1;
|
|
3936
3936
|
if (c.key === "Tab") {
|
|
3937
3937
|
const G = c.shiftKey ? -1 : 1, me = Ue(fe, Ce, 0, G, !0, !1);
|
|
3938
|
-
me && (se = me.r,
|
|
3938
|
+
me && (se = me.r, be = me.c, ae = !0);
|
|
3939
3939
|
} else if (c.key === "ArrowRight") {
|
|
3940
3940
|
const G = qe(fe, Ce, 0, 1, !0, !0);
|
|
3941
|
-
G && (se = G.r,
|
|
3941
|
+
G && (se = G.r, be = G.c, ae = !0);
|
|
3942
3942
|
} else if (c.key === "ArrowLeft") {
|
|
3943
3943
|
const G = qe(fe, Ce, 0, -1, !0, !0);
|
|
3944
|
-
G && (se = G.r,
|
|
3944
|
+
G && (se = G.r, be = G.c, ae = !0);
|
|
3945
3945
|
} else if (c.key === "ArrowDown") {
|
|
3946
3946
|
const G = qe(fe, Ce, 1, 0, !1, !0);
|
|
3947
|
-
G && (se = G.r,
|
|
3947
|
+
G && (se = G.r, be = G.c, ae = !0);
|
|
3948
3948
|
} else if (c.key === "ArrowUp") {
|
|
3949
3949
|
const G = qe(fe, Ce, -1, 0, !1, !0);
|
|
3950
|
-
G && (se = G.r,
|
|
3950
|
+
G && (se = G.r, be = G.c, ae = !0);
|
|
3951
3951
|
} else if (c.key === "Home")
|
|
3952
|
-
(c.ctrlKey || c.metaKey) && (se = -1),
|
|
3952
|
+
(c.ctrlKey || c.metaKey) && (se = -1), be = 0, ae = !0;
|
|
3953
3953
|
else if (c.key === "End")
|
|
3954
|
-
(c.ctrlKey || c.metaKey) && (se = Re.length - 1),
|
|
3954
|
+
(c.ctrlKey || c.metaKey) && (se = Re.length - 1), be = ye.length - 1, ae = !0;
|
|
3955
3955
|
else if (c.key === "PageUp") {
|
|
3956
3956
|
const G = Me ? xe.pageSize : 10;
|
|
3957
3957
|
se = Math.max(-1, se - G), ae = !0;
|
|
@@ -3959,8 +3959,8 @@ function el(n) {
|
|
|
3959
3959
|
const G = Me ? xe.pageSize : 10;
|
|
3960
3960
|
se = Math.min(Re.length - 1, se + G), ae = !0;
|
|
3961
3961
|
}
|
|
3962
|
-
if (ae && (c.preventDefault(), V && c.key === "Tab" && $e.stopCellEdit(), se >= -1 && se < Re.length &&
|
|
3963
|
-
const G = ye[
|
|
3962
|
+
if (ae && (c.preventDefault(), V && c.key === "Tab" && $e.stopCellEdit(), se >= -1 && se < Re.length && be >= 0 && be < ye.length)) {
|
|
3963
|
+
const G = ye[be];
|
|
3964
3964
|
if (se === -1)
|
|
3965
3965
|
Ft({ id: "HEADER", field: G.field });
|
|
3966
3966
|
else {
|
|
@@ -3980,54 +3980,54 @@ function el(n) {
|
|
|
3980
3980
|
}
|
|
3981
3981
|
}
|
|
3982
3982
|
}
|
|
3983
|
-
}, [Ze, Re, ye, $e, Se, Pe, Vt, on]),
|
|
3983
|
+
}, [Ze, Re, ye, $e, Se, Pe, Vt, on]), br = pe.useMemo(() => Oe.some((c) => !!c.rowSpan), [Oe]), [wn, bn] = pe.useState(!1), Kn = pe.useRef(null);
|
|
3984
3984
|
return ee(() => {
|
|
3985
|
-
if (!
|
|
3985
|
+
if (!wn || Ie?.toolbar) return;
|
|
3986
3986
|
function c(R) {
|
|
3987
3987
|
const M = document.getElementById("ogx-standalone-col-panel");
|
|
3988
|
-
M && !M.contains(R.target) &&
|
|
3988
|
+
M && !M.contains(R.target) && bn(!1);
|
|
3989
3989
|
}
|
|
3990
3990
|
return document.addEventListener("mousedown", c), () => document.removeEventListener("mousedown", c);
|
|
3991
|
-
}, [
|
|
3991
|
+
}, [wn, Ie?.toolbar]), /* @__PURE__ */ t.jsxs(
|
|
3992
3992
|
"div",
|
|
3993
3993
|
{
|
|
3994
|
-
ref:
|
|
3995
|
-
className: `ogx ${Qt} ${a ? "ogx--auto-height" : ""} ${
|
|
3994
|
+
ref: Kn,
|
|
3995
|
+
className: `ogx ${Qt} ${a ? "ogx--auto-height" : ""} ${br ? "ogx--row-spanning" : ""} ${an ? "ogx--list-view" : ""}`,
|
|
3996
3996
|
style: {
|
|
3997
3997
|
...Lt,
|
|
3998
3998
|
height: q ?? Lt?.height,
|
|
3999
3999
|
"--ogx-row-height": `${i}px`,
|
|
4000
4000
|
"--ogx-header-height": `${l}px`
|
|
4001
4001
|
},
|
|
4002
|
-
"aria-busy":
|
|
4002
|
+
"aria-busy": tn,
|
|
4003
4003
|
children: [
|
|
4004
|
-
|
|
4004
|
+
oo && (() => {
|
|
4005
4005
|
const c = {
|
|
4006
4006
|
apiRef: st.apiRef,
|
|
4007
4007
|
columns: Oe,
|
|
4008
4008
|
aggregationModel: rt,
|
|
4009
4009
|
onAggregationModelChange: Bo,
|
|
4010
4010
|
...Ge ? {
|
|
4011
|
-
pivotModel:
|
|
4011
|
+
pivotModel: ro,
|
|
4012
4012
|
onPivotModelChange: Yo
|
|
4013
4013
|
} : {},
|
|
4014
4014
|
filterModel: Ye,
|
|
4015
4015
|
onFilterModelChange: h,
|
|
4016
4016
|
columnVisibilityModel: Qe,
|
|
4017
4017
|
onColumnVisibilityModelChange: Zt,
|
|
4018
|
-
forceColumnsOpen:
|
|
4019
|
-
onColumnsPanelClose: () =>
|
|
4018
|
+
forceColumnsOpen: wn,
|
|
4019
|
+
onColumnsPanelClose: () => bn(!1),
|
|
4020
4020
|
...ft?.toolbar
|
|
4021
4021
|
};
|
|
4022
|
-
return /* @__PURE__ */ t.jsx(
|
|
4022
|
+
return /* @__PURE__ */ t.jsx(oo, { ...c });
|
|
4023
4023
|
})(),
|
|
4024
|
-
!Ie?.toolbar &&
|
|
4024
|
+
!Ie?.toolbar && wn && Mt.createPortal(
|
|
4025
4025
|
/* @__PURE__ */ t.jsxs(
|
|
4026
4026
|
"div",
|
|
4027
4027
|
{
|
|
4028
4028
|
id: "ogx-standalone-col-panel",
|
|
4029
4029
|
style: (() => {
|
|
4030
|
-
const c =
|
|
4030
|
+
const c = Kn.current?.getBoundingClientRect();
|
|
4031
4031
|
return {
|
|
4032
4032
|
position: "fixed",
|
|
4033
4033
|
top: c ? c.top + 8 : 16,
|
|
@@ -4040,7 +4040,7 @@ function el(n) {
|
|
|
4040
4040
|
/* @__PURE__ */ t.jsx(
|
|
4041
4041
|
"button",
|
|
4042
4042
|
{
|
|
4043
|
-
onClick: () =>
|
|
4043
|
+
onClick: () => bn(!1),
|
|
4044
4044
|
style: {
|
|
4045
4045
|
position: "absolute",
|
|
4046
4046
|
top: -12,
|
|
@@ -4093,7 +4093,7 @@ function el(n) {
|
|
|
4093
4093
|
),
|
|
4094
4094
|
document.body
|
|
4095
4095
|
),
|
|
4096
|
-
an &&
|
|
4096
|
+
an && no && /* @__PURE__ */ t.jsxs(
|
|
4097
4097
|
"div",
|
|
4098
4098
|
{
|
|
4099
4099
|
className: "ogx-list-view",
|
|
@@ -4113,23 +4113,23 @@ function el(n) {
|
|
|
4113
4113
|
/* @__PURE__ */ t.jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
|
|
4114
4114
|
/* @__PURE__ */ t.jsx("path", { d: "M3 9h18M9 21V9" })
|
|
4115
4115
|
] }),
|
|
4116
|
-
|
|
4116
|
+
Nn
|
|
4117
4117
|
] }) : Re.map((c, R) => /* @__PURE__ */ t.jsx(
|
|
4118
4118
|
Er,
|
|
4119
4119
|
{
|
|
4120
4120
|
row: c,
|
|
4121
4121
|
rowIndex: R,
|
|
4122
|
-
listViewColumn:
|
|
4122
|
+
listViewColumn: no,
|
|
4123
4123
|
isSelected: Pe.has(c.id),
|
|
4124
4124
|
checkboxSelection: s,
|
|
4125
4125
|
rowHeight: i,
|
|
4126
|
-
onRowClick: (M) =>
|
|
4126
|
+
onRowClick: (M) => pn({ row: M, id: M.id, rowIndex: R }),
|
|
4127
4127
|
onSelectionChange: Vt
|
|
4128
4128
|
},
|
|
4129
4129
|
c.id
|
|
4130
4130
|
)) }),
|
|
4131
4131
|
Me && (() => {
|
|
4132
|
-
const c = Ie?.pagination || ko, R = z === "server" &&
|
|
4132
|
+
const c = Ie?.pagination || ko, R = z === "server" && ie ? ue.pagination.rowCount || 0 : Ve.length, M = {
|
|
4133
4133
|
page: xe.page,
|
|
4134
4134
|
pageSize: xe.pageSize,
|
|
4135
4135
|
rowCount: R,
|
|
@@ -4155,7 +4155,7 @@ function el(n) {
|
|
|
4155
4155
|
"aria-label": Tt || "Data grid",
|
|
4156
4156
|
"aria-rowcount": Ve.length + 1,
|
|
4157
4157
|
"aria-colcount": e.length + (s ? 1 : 0) + (et ? 1 : 0) + (D ? 1 : 0),
|
|
4158
|
-
"aria-busy":
|
|
4158
|
+
"aria-busy": tn,
|
|
4159
4159
|
tabIndex: 0,
|
|
4160
4160
|
onKeyDownCapture: () => {
|
|
4161
4161
|
Wt(!0);
|
|
@@ -4212,38 +4212,38 @@ function el(n) {
|
|
|
4212
4212
|
[c]: !1
|
|
4213
4213
|
});
|
|
4214
4214
|
},
|
|
4215
|
-
onManageColumns: () =>
|
|
4215
|
+
onManageColumns: () => bn(!0),
|
|
4216
4216
|
onPinColumn: (c, R) => {
|
|
4217
4217
|
const M = [...it?.left ?? []], V = [...it?.right ?? []], le = M.filter((Ce) => Ce !== c), fe = V.filter((Ce) => Ce !== c);
|
|
4218
|
-
|
|
4218
|
+
Wn(R === "left" ? { left: [...le, c], right: fe } : R === "right" ? { left: le, right: [...fe, c] } : { left: le, right: fe });
|
|
4219
4219
|
}
|
|
4220
4220
|
}
|
|
4221
4221
|
),
|
|
4222
|
-
!
|
|
4222
|
+
!tn && !ue.dataSource.error && Ve.length === 0 && /* @__PURE__ */ t.jsxs("div", { className: "ogx__empty", style: { width: Se.totalWidth }, children: [
|
|
4223
4223
|
/* @__PURE__ */ t.jsxs("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
4224
4224
|
/* @__PURE__ */ t.jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
|
|
4225
4225
|
/* @__PURE__ */ t.jsx("path", { d: "M3 9h18M9 21V9" })
|
|
4226
4226
|
] }),
|
|
4227
|
-
/* @__PURE__ */ t.jsx("span", { children:
|
|
4227
|
+
/* @__PURE__ */ t.jsx("span", { children: Nn })
|
|
4228
4228
|
] }),
|
|
4229
4229
|
Xe.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "ogx__pinned-rows ogx__pinned-rows--top", role: "rowgroup", children: Xe.map((c, R) => /* @__PURE__ */ t.jsx(
|
|
4230
|
-
|
|
4230
|
+
kn,
|
|
4231
4231
|
{
|
|
4232
4232
|
row: c,
|
|
4233
4233
|
columns: Se.virtualColumns,
|
|
4234
4234
|
rowIndex: R,
|
|
4235
4235
|
isSelected: Pe.has(c.id),
|
|
4236
4236
|
checkboxSelection: s,
|
|
4237
|
-
onRowClick:
|
|
4238
|
-
onCellClick:
|
|
4237
|
+
onRowClick: pn,
|
|
4238
|
+
onCellClick: Un,
|
|
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,
|
|
@@ -4271,9 +4271,9 @@ function el(n) {
|
|
|
4271
4271
|
},
|
|
4272
4272
|
role: "rowgroup",
|
|
4273
4273
|
children: [
|
|
4274
|
-
|
|
4274
|
+
tn && vo.length === 0 ? (() => {
|
|
4275
4275
|
const c = e.length > 0 ? e : (() => {
|
|
4276
|
-
const R = (
|
|
4276
|
+
const R = (ue.dimensions.viewportWidth || 1e3) - (s ? 48 : 0) - (I ? 48 : 0) - (D ? 48 : 0), M = 150, V = Math.max(1, Math.ceil(R / M));
|
|
4277
4277
|
return Array.from({ length: V }, (le, fe) => ({
|
|
4278
4278
|
field: `placeholder_${fe}`,
|
|
4279
4279
|
headerName: "",
|
|
@@ -4291,26 +4291,26 @@ function el(n) {
|
|
|
4291
4291
|
},
|
|
4292
4292
|
`skeleton-${M}`
|
|
4293
4293
|
));
|
|
4294
|
-
})() :
|
|
4294
|
+
})() : vo.filter(({ row: c }) => !qn(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
|
+
kn,
|
|
4298
4298
|
{
|
|
4299
4299
|
row: c,
|
|
4300
4300
|
columns: Se.virtualColumns,
|
|
4301
4301
|
rowIndex: R,
|
|
4302
4302
|
isSelected: Pe.has(c.id),
|
|
4303
4303
|
checkboxSelection: s,
|
|
4304
|
-
onRowClick:
|
|
4305
|
-
onCellClick:
|
|
4304
|
+
onRowClick: pn,
|
|
4305
|
+
onCellClick: Un,
|
|
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,
|
|
@@ -4332,10 +4332,10 @@ function el(n) {
|
|
|
4332
4332
|
},
|
|
4333
4333
|
`${c.id}-${Se.totalWidth}`
|
|
4334
4334
|
)),
|
|
4335
|
-
z === "infinite" &&
|
|
4336
|
-
const c = Math.min(xe.pageSize, 20), R =
|
|
4335
|
+
z === "infinite" && ue.dataSource.loading && Le.length > 0 && (() => {
|
|
4336
|
+
const c = Math.min(xe.pageSize, 20), R = Vn.unpinnedRowsLength;
|
|
4337
4337
|
return /* @__PURE__ */ t.jsx("div", { className: "ogx__skeleton-group", children: Array.from({ length: c }).map((M, V) => /* @__PURE__ */ t.jsx(
|
|
4338
|
-
|
|
4338
|
+
kn,
|
|
4339
4339
|
{
|
|
4340
4340
|
row: { id: `__skeleton_${V}__`, _isSkeleton: !0 },
|
|
4341
4341
|
columns: Se.virtualColumns,
|
|
@@ -4351,23 +4351,23 @@ function el(n) {
|
|
|
4351
4351
|
}
|
|
4352
4352
|
),
|
|
4353
4353
|
dt.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "ogx__pinned-rows ogx__pinned-rows--bottom", role: "rowgroup", children: dt.map((c, R) => /* @__PURE__ */ t.jsx(
|
|
4354
|
-
|
|
4354
|
+
kn,
|
|
4355
4355
|
{
|
|
4356
4356
|
row: c,
|
|
4357
4357
|
columns: Se.virtualColumns,
|
|
4358
4358
|
rowIndex: R,
|
|
4359
4359
|
isSelected: Pe.has(c.id),
|
|
4360
4360
|
checkboxSelection: s,
|
|
4361
|
-
onRowClick:
|
|
4362
|
-
onCellClick:
|
|
4361
|
+
onRowClick: pn,
|
|
4362
|
+
onCellClick: Un,
|
|
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,
|
|
@@ -4378,7 +4378,7 @@ function el(n) {
|
|
|
4378
4378
|
},
|
|
4379
4379
|
c.id
|
|
4380
4380
|
)) }),
|
|
4381
|
-
|
|
4381
|
+
mn && /* @__PURE__ */ t.jsxs(
|
|
4382
4382
|
"div",
|
|
4383
4383
|
{
|
|
4384
4384
|
className: "ogx__aggregation-footer",
|
|
@@ -4393,7 +4393,7 @@ function el(n) {
|
|
|
4393
4393
|
et && /* @__PURE__ */ t.jsx("div", { style: { width: 48, flexShrink: 0 } }),
|
|
4394
4394
|
D && /* @__PURE__ */ t.jsx("div", { style: { width: 48, flexShrink: 0 } }),
|
|
4395
4395
|
Bt.map((c) => {
|
|
4396
|
-
const R = rt[c.field], M =
|
|
4396
|
+
const R = rt[c.field], M = Gn[c.field], V = at[c.field] ?? (typeof c.width == "number" ? c.width : 120);
|
|
4397
4397
|
return /* @__PURE__ */ t.jsx(
|
|
4398
4398
|
"div",
|
|
4399
4399
|
{
|
|
@@ -4425,7 +4425,7 @@ function el(n) {
|
|
|
4425
4425
|
const c = Ie?.pagination || ko, R = {
|
|
4426
4426
|
page: xe.page,
|
|
4427
4427
|
pageSize: xe.pageSize,
|
|
4428
|
-
rowCount:
|
|
4428
|
+
rowCount: ue.pagination.rowCount,
|
|
4429
4429
|
pageSizeOptions: _,
|
|
4430
4430
|
onPageChange: (M) => cn({ ...xe, page: M }),
|
|
4431
4431
|
onPageSizeChange: (M) => cn({ ...xe, pageSize: M, page: 0 }),
|
|
@@ -4434,18 +4434,18 @@ function el(n) {
|
|
|
4434
4434
|
return /* @__PURE__ */ t.jsx(c, { ...R });
|
|
4435
4435
|
})(),
|
|
4436
4436
|
/* @__PURE__ */ t.jsxs("div", { className: "ogx-aria-live-status", role: "status", "aria-live": "polite", children: [
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
!J && !
|
|
4437
|
+
tn ? "Loading data..." : "",
|
|
4438
|
+
ue.dataSource.error ? `Error: ${ue.dataSource.error.message || "Unknown error"}` : "",
|
|
4439
|
+
!J && !ue.dataSource.error && (Ve.length === 0 ? Nn : Ye && ((Ye.quickFilterValues?.length || 0) > 0 || (Ye.items?.length || 0) > 0) ? `${Ve.length} ${Ve.length === 1 ? "row" : "rows"} found` : "")
|
|
4440
4440
|
] }),
|
|
4441
|
-
|
|
4441
|
+
ue.dataSource.error && /* @__PURE__ */ t.jsxs("div", { className: "ogx-error-overlay", "aria-live": "assertive", role: "alert", children: [
|
|
4442
4442
|
/* @__PURE__ */ t.jsxs("svg", { width: "56", height: "56", viewBox: "0 0 24 24", fill: "none", stroke: "var(--ogx-color-error)", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
4443
4443
|
/* @__PURE__ */ t.jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
4444
4444
|
/* @__PURE__ */ t.jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
|
|
4445
4445
|
/* @__PURE__ */ t.jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
|
|
4446
4446
|
] }),
|
|
4447
4447
|
/* @__PURE__ */ t.jsx("div", { className: "ogx-error-overlay__title", children: "Oops! Something went wrong" }),
|
|
4448
|
-
/* @__PURE__ */ t.jsx("div", { className: "ogx-error-overlay__message", children:
|
|
4448
|
+
/* @__PURE__ */ t.jsx("div", { className: "ogx-error-overlay__message", children: ue.dataSource.error.message || "An unexpected error occurred while loading the data." }),
|
|
4449
4449
|
/* @__PURE__ */ t.jsx(
|
|
4450
4450
|
"button",
|
|
4451
4451
|
{
|
|
@@ -4651,10 +4651,10 @@ function Mi({ anchorRef: n, columns: o, model: e, onChange: r, onClose: i }) {
|
|
|
4651
4651
|
valueFields: e.valueFields.map((L) => L.field === p ? { ...L, aggFn: k } : L)
|
|
4652
4652
|
});
|
|
4653
4653
|
}
|
|
4654
|
-
function
|
|
4654
|
+
function v() {
|
|
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: v, 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: [
|
|
@@ -4821,7 +4821,7 @@ function Fi({ value: n = "", onChange: o, placeholder: e = "Search...", debounce
|
|
|
4821
4821
|
}
|
|
4822
4822
|
);
|
|
4823
4823
|
}
|
|
4824
|
-
function
|
|
4824
|
+
function jn({
|
|
4825
4825
|
title: n,
|
|
4826
4826
|
children: o,
|
|
4827
4827
|
placement: e = "top",
|
|
@@ -5134,11 +5134,11 @@ function nl({
|
|
|
5134
5134
|
rightContent: d,
|
|
5135
5135
|
style: h
|
|
5136
5136
|
}) {
|
|
5137
|
-
const [w, x] = Q(!1), [N, E] = Q(!1), [j, _] = Q(!1), [
|
|
5137
|
+
const [w, x] = Q(!1), [N, E] = Q(!1), [j, _] = Q(!1), [v, S] = Q(!1);
|
|
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"
|
|
@@ -5165,7 +5165,7 @@ function nl({
|
|
|
5165
5165
|
if (!u) return;
|
|
5166
5166
|
const O = { ...s, [T]: A };
|
|
5167
5167
|
u(O);
|
|
5168
|
-
}, [s, u]),
|
|
5168
|
+
}, [s, u]), b = W(() => {
|
|
5169
5169
|
if (!u) return;
|
|
5170
5170
|
const T = { ...s };
|
|
5171
5171
|
n.forEach((A) => {
|
|
@@ -5191,10 +5191,10 @@ function nl({
|
|
|
5191
5191
|
}
|
|
5192
5192
|
) }),
|
|
5193
5193
|
u && /* @__PURE__ */ t.jsxs("div", { className: "ogx-toolbar__dropdown-wrapper", style: { marginRight: 4 }, children: [
|
|
5194
|
-
/* @__PURE__ */ t.jsx(
|
|
5194
|
+
/* @__PURE__ */ t.jsx(jn, { 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,11 +5206,11 @@ 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,
|
|
5213
|
-
onShowAll:
|
|
5213
|
+
onShowAll: b,
|
|
5214
5214
|
onHideAll: H,
|
|
5215
5215
|
onClose: () => {
|
|
5216
5216
|
_(!1), f?.();
|
|
@@ -5219,14 +5219,14 @@ function nl({
|
|
|
5219
5219
|
)
|
|
5220
5220
|
] }),
|
|
5221
5221
|
a && /* @__PURE__ */ t.jsxs("div", { className: "ogx-toolbar__dropdown-wrapper", style: { marginRight: 4 }, children: [
|
|
5222
|
-
/* @__PURE__ */ t.jsx(
|
|
5222
|
+
/* @__PURE__ */ t.jsx(jn, { title: "Filters", children: /* @__PURE__ */ t.jsxs(
|
|
5223
5223
|
"button",
|
|
5224
5224
|
{
|
|
5225
5225
|
ref: p,
|
|
5226
|
-
className: `ogx-toolbar__icon-btn${
|
|
5226
|
+
className: `ogx-toolbar__icon-btn${v ? " ogx-toolbar__icon-btn--active" : ""}`,
|
|
5227
5227
|
"aria-label": "Advanced filters",
|
|
5228
5228
|
onClick: () => {
|
|
5229
|
-
S(!
|
|
5229
|
+
S(!v), x(!1), E(!1), _(!1);
|
|
5230
5230
|
},
|
|
5231
5231
|
children: [
|
|
5232
5232
|
/* @__PURE__ */ t.jsx(Lo, {}),
|
|
@@ -5234,7 +5234,7 @@ function nl({
|
|
|
5234
5234
|
]
|
|
5235
5235
|
}
|
|
5236
5236
|
) }),
|
|
5237
|
-
|
|
5237
|
+
v && /* @__PURE__ */ t.jsx(
|
|
5238
5238
|
Bi,
|
|
5239
5239
|
{
|
|
5240
5240
|
anchorRef: p,
|
|
@@ -5246,7 +5246,7 @@ function nl({
|
|
|
5246
5246
|
)
|
|
5247
5247
|
] }),
|
|
5248
5248
|
i && /* @__PURE__ */ t.jsxs("div", { className: "ogx-toolbar__dropdown-wrapper", style: { marginRight: 4 }, children: [
|
|
5249
|
-
/* @__PURE__ */ t.jsx(
|
|
5249
|
+
/* @__PURE__ */ t.jsx(jn, { title: "Pivot", children: /* @__PURE__ */ t.jsxs(
|
|
5250
5250
|
"button",
|
|
5251
5251
|
{
|
|
5252
5252
|
ref: I,
|
|
@@ -5278,10 +5278,10 @@ function nl({
|
|
|
5278
5278
|
)
|
|
5279
5279
|
] }),
|
|
5280
5280
|
/* @__PURE__ */ t.jsxs("div", { className: "ogx-toolbar__dropdown-wrapper", style: { marginRight: 4 }, children: [
|
|
5281
|
-
/* @__PURE__ */ t.jsx(
|
|
5281
|
+
/* @__PURE__ */ t.jsx(jn, { 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: $,
|
|
@@ -5383,7 +5383,7 @@ function il(n, o, e = {}) {
|
|
|
5383
5383
|
g += h.join(l) + `
|
|
5384
5384
|
`;
|
|
5385
5385
|
}
|
|
5386
|
-
|
|
5386
|
+
Zn(g, r, "text/csv;charset=utf-8;");
|
|
5387
5387
|
}
|
|
5388
5388
|
function Jt(n) {
|
|
5389
5389
|
return n.includes(",") || n.includes('"') || n.includes(`
|
|
@@ -5403,28 +5403,28 @@ function ll(n, o, e = {}) {
|
|
|
5403
5403
|
const u = o.filter((f) => !(f.field === "__check__" || f.field === "__actions__"));
|
|
5404
5404
|
let g = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">';
|
|
5405
5405
|
if (g += "<head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet>", g += `<x:Name>${i}</x:Name>`, g += "<x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]-->", g += '<meta charset="UTF-8"></head><body>', g += '<table border="1">', l && (g += "<thead><tr>", u.forEach((f) => {
|
|
5406
|
-
g += `<th>${
|
|
5406
|
+
g += `<th>${vt(f.headerName || f.field)}</th>`;
|
|
5407
5407
|
}), g += "</tr></thead>"), g += "<tbody>", s.forEach((f) => {
|
|
5408
5408
|
g += "<tr>", u.forEach((m) => {
|
|
5409
5409
|
let d = f[m.field];
|
|
5410
|
-
m.valueGetter && (d = m.valueGetter({ row: f, field: m.field, value: d })), m.valueFormatter && d !== void 0 && d !== null && (d = m.valueFormatter({ value: d, row: f, field: m.field })), g += `<td>${
|
|
5410
|
+
m.valueGetter && (d = m.valueGetter({ row: f, field: m.field, value: d })), m.valueFormatter && d !== void 0 && d !== null && (d = m.valueFormatter({ value: d, row: f, field: m.field })), g += `<td>${vt(String(d ?? ""))}</td>`;
|
|
5411
5411
|
});
|
|
5412
5412
|
}), e.aggregationResult) {
|
|
5413
5413
|
const f = e.aggregationResult, m = e.aggregationModel || {};
|
|
5414
5414
|
g += '<tr style="font-size: 11px; color: #666; background-color: #f5f5f5;">', u.forEach((d) => {
|
|
5415
|
-
m[d.field] ? g += `<td style="text-align: right; font-weight: bold;">${
|
|
5415
|
+
m[d.field] ? g += `<td style="text-align: right; font-weight: bold;">${vt(m[d.field].toUpperCase())}</td>` : g += "<td></td>";
|
|
5416
5416
|
}), g += "</tr>", g += '<tr style="font-weight: bold; background-color: #f5f5f5;">', u.forEach((d) => {
|
|
5417
5417
|
const h = f[d.field];
|
|
5418
5418
|
if (h != null) {
|
|
5419
5419
|
let w = h;
|
|
5420
|
-
d.valueFormatter ? w = d.valueFormatter({ value: h, row: {}, field: d.field }) : m[d.field] && (w = Pt(h, m[d.field])), g += `<td style="text-align: right;">${
|
|
5420
|
+
d.valueFormatter ? w = d.valueFormatter({ value: h, row: {}, field: d.field }) : m[d.field] && (w = Pt(h, m[d.field])), g += `<td style="text-align: right;">${vt(String(w))}</td>`;
|
|
5421
5421
|
} else
|
|
5422
5422
|
g += "<td></td>";
|
|
5423
5423
|
}), g += "</tr>";
|
|
5424
5424
|
}
|
|
5425
|
-
g += "</tbody></table></body></html>",
|
|
5425
|
+
g += "</tbody></table></body></html>", Zn(g, r, "application/vnd.ms-excel");
|
|
5426
5426
|
}
|
|
5427
|
-
function
|
|
5427
|
+
function vt(n) {
|
|
5428
5428
|
return n.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
5429
5429
|
}
|
|
5430
5430
|
function sl(n, o, e = {}) {
|
|
@@ -5465,7 +5465,7 @@ function sl(n, o, e = {}) {
|
|
|
5465
5465
|
};
|
|
5466
5466
|
}
|
|
5467
5467
|
const f = i ? JSON.stringify(g, null, 2) : JSON.stringify(g);
|
|
5468
|
-
|
|
5468
|
+
Zn(f, r, "application/json;charset=utf-8;");
|
|
5469
5469
|
}
|
|
5470
5470
|
async function al(n, o, e) {
|
|
5471
5471
|
const r = window.open("", "_blank");
|
|
@@ -5523,22 +5523,22 @@ async function al(n, o, e) {
|
|
|
5523
5523
|
</head>
|
|
5524
5524
|
<body>
|
|
5525
5525
|
`;
|
|
5526
|
-
if (i && (f += `<h1>${
|
|
5527
|
-
f += `<th>${
|
|
5526
|
+
if (i && (f += `<h1>${vt(i)}</h1>`), f += "<table>", f += "<thead><tr>", g.forEach((d) => {
|
|
5527
|
+
f += `<th>${vt(d.headerName || d.field)}</th>`;
|
|
5528
5528
|
}), f += "</tr></thead>", f += "<tbody>", u.forEach((d) => {
|
|
5529
5529
|
f += "<tr>", g.forEach((h) => {
|
|
5530
5530
|
let w = d[h.field];
|
|
5531
|
-
h.valueGetter && (w = h.valueGetter({ row: d, field: h.field, value: w })), h.valueFormatter && w !== void 0 && w !== null && (w = h.valueFormatter({ value: w, row: d, field: h.field })), h.type === "image" && w ? f += `<td><div style="display:flex;justify-content:center;"><img src="${w}" alt="${h.headerName}" style="max-height: 40px; border-radius: 4px;"></div></td>` : f += `<td>${
|
|
5531
|
+
h.valueGetter && (w = h.valueGetter({ row: d, field: h.field, value: w })), h.valueFormatter && w !== void 0 && w !== null && (w = h.valueFormatter({ value: w, row: d, field: h.field })), h.type === "image" && w ? f += `<td><div style="display:flex;justify-content:center;"><img src="${w}" alt="${h.headerName}" style="max-height: 40px; border-radius: 4px;"></div></td>` : f += `<td>${vt(String(w ?? ""))}</td>`;
|
|
5532
5532
|
}), f += "</tr>";
|
|
5533
5533
|
}), a) {
|
|
5534
5534
|
const d = s || {};
|
|
5535
5535
|
f += '<tfoot><tr style="font-size: 11px; color: #666; background-color: #f5f5f5;">', g.forEach((h) => {
|
|
5536
|
-
d[h.field] ? f += `<td style="text-align: right; font-weight: bold;">${
|
|
5536
|
+
d[h.field] ? f += `<td style="text-align: right; font-weight: bold;">${vt(d[h.field].toUpperCase())}</td>` : f += "<td></td>";
|
|
5537
5537
|
}), f += '</tr><tr style="font-weight: bold; background-color: #f5f5f5;">', g.forEach((h) => {
|
|
5538
5538
|
const w = a[h.field];
|
|
5539
5539
|
if (w != null) {
|
|
5540
5540
|
let x = w;
|
|
5541
|
-
h.valueFormatter ? x = h.valueFormatter({ value: w, row: {}, field: h.field }) : d[h.field] && (x = Pt(w, d[h.field])), f += `<td style="text-align: right;">${
|
|
5541
|
+
h.valueFormatter ? x = h.valueFormatter({ value: w, row: {}, field: h.field }) : d[h.field] && (x = Pt(w, d[h.field])), f += `<td style="text-align: right;">${vt(String(x))}</td>`;
|
|
5542
5542
|
} else
|
|
5543
5543
|
f += "<td></td>";
|
|
5544
5544
|
}), f += "</tr></tfoot>";
|
|
@@ -5558,7 +5558,7 @@ async function al(n, o, e) {
|
|
|
5558
5558
|
console.error("Print generation failed:", i), r && !r.closed && (r.document.body.innerHTML = `<div style="color: red; padding: 20px;"><h3>Error Generating Print Preview</h3><p>${i.message}</p></div>`);
|
|
5559
5559
|
}
|
|
5560
5560
|
}
|
|
5561
|
-
function
|
|
5561
|
+
function Zn(n, o, e) {
|
|
5562
5562
|
const r = new Blob([n], { type: e }), i = URL.createObjectURL(r), l = document.createElement("a");
|
|
5563
5563
|
l.href = i, l.download = o, document.body.appendChild(l), l.click(), document.body.removeChild(l), URL.revokeObjectURL(i);
|
|
5564
5564
|
}
|
|
@@ -5616,28 +5616,28 @@ 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
|
|
5628
|
-
|
|
5627
|
+
const b = w.addWorksheet(C.name ?? "Summary");
|
|
5628
|
+
b.addRow(["Summary / Aggregation Totals"]), b.getRow(1).font = { bold: !0, size: u + 2, color: { argb: St(s) } }, b.addRow([]), b.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) => {
|
|
5631
5631
|
const A = m[T.field], O = f[T.field];
|
|
5632
5632
|
if (A == null || O == null) return;
|
|
5633
5633
|
let Z = O;
|
|
5634
5634
|
T.valueFormatter ? Z = T.valueFormatter({ value: O, row: {}, field: T.field }) : Z = Pt(O, A);
|
|
5635
|
-
const U =
|
|
5635
|
+
const U = b.addRow([T.headerName ?? T.field, A.toUpperCase(), Z]);
|
|
5636
5636
|
U.getCell(3).alignment = { horizontal: "right" }, U.getCell(3).font = { bold: !0, size: g };
|
|
5637
|
-
}),
|
|
5637
|
+
}), b.getColumn(1).width = 20, b.getColumn(2).width = 12, b.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,
|
|
@@ -5645,16 +5645,16 @@ async function dl(n, o, e = {}) {
|
|
|
5645
5645
|
autoFilter: $ = !0,
|
|
5646
5646
|
frozenHeader: K = !0,
|
|
5647
5647
|
alternateRowColor: q = "#f8fafc"
|
|
5648
|
-
} = p, D = L === "selected" ? E : N, te = x.filter((
|
|
5648
|
+
} = p, D = L === "selected" ? E : N, te = x.filter((b) => l[b.field]?.embedImage);
|
|
5649
5649
|
if (te.length > 0) {
|
|
5650
|
-
const
|
|
5650
|
+
const b = [], H = /* @__PURE__ */ new Set();
|
|
5651
5651
|
if (D.forEach((T) => {
|
|
5652
5652
|
te.forEach((A) => {
|
|
5653
5653
|
const O = T[A.field];
|
|
5654
|
-
typeof O == "string" && O && !_.has(O) && !H.has(O) && (
|
|
5654
|
+
typeof O == "string" && O && !_.has(O) && !H.has(O) && (b.push(O), H.add(O));
|
|
5655
5655
|
});
|
|
5656
|
-
}),
|
|
5657
|
-
const T = await Ui(
|
|
5656
|
+
}), b.length > 0) {
|
|
5657
|
+
const T = await Ui(b);
|
|
5658
5658
|
for (const [A, { buffer: O, extension: Z }] of T) {
|
|
5659
5659
|
const U = w.addImage({ buffer: O, extension: Z });
|
|
5660
5660
|
_.set(A, U);
|
|
@@ -5662,14 +5662,14 @@ async function dl(n, o, e = {}) {
|
|
|
5662
5662
|
}
|
|
5663
5663
|
}
|
|
5664
5664
|
const J = w.addWorksheet(k);
|
|
5665
|
-
if (J.columns = x.map((
|
|
5666
|
-
key:
|
|
5667
|
-
width: Gi(
|
|
5665
|
+
if (J.columns = x.map((b) => ({
|
|
5666
|
+
key: b.field,
|
|
5667
|
+
width: Gi(b, l[b.field]?.width),
|
|
5668
5668
|
style: {
|
|
5669
|
-
numFmt: l[
|
|
5669
|
+
numFmt: l[b.field]?.numFmt ?? Di(b)
|
|
5670
5670
|
}
|
|
5671
5671
|
})), B) {
|
|
5672
|
-
const
|
|
5672
|
+
const b = x.map((T) => T.headerName ?? T.field), H = J.addRow(b);
|
|
5673
5673
|
H.height = 20, H.eachCell((T, A) => {
|
|
5674
5674
|
const O = x[A - 1];
|
|
5675
5675
|
T.fill = { type: "pattern", pattern: "solid", fgColor: { argb: St(a) } }, T.font = { bold: !0, size: u, color: { argb: St(s) } }, T.alignment = {
|
|
@@ -5682,11 +5682,11 @@ async function dl(n, o, e = {}) {
|
|
|
5682
5682
|
}), K ? J.views = [{ state: "frozen", ySplit: 1, showGridLines: !1 }] : J.views = [{ showGridLines: !1 }];
|
|
5683
5683
|
}
|
|
5684
5684
|
let we = B ? 1 : 0;
|
|
5685
|
-
if (D.forEach((
|
|
5685
|
+
if (D.forEach((b, H) => {
|
|
5686
5686
|
const T = x.map((O) => {
|
|
5687
5687
|
if (l[O.field]?.embedImage) return "";
|
|
5688
|
-
let Z =
|
|
5689
|
-
return O.valueGetter && (Z = O.valueGetter({ row:
|
|
5688
|
+
let Z = b[O.field];
|
|
5689
|
+
return O.valueGetter && (Z = O.valueGetter({ row: b, field: O.field, value: Z })), Hi(O, Z) === "string" && O.valueFormatter && Z != null && (Z = O.valueFormatter({ value: Z, row: b, field: O.field })), Z;
|
|
5690
5690
|
}), A = J.addRow(T);
|
|
5691
5691
|
if (A.font = { size: g }, q && H % 2 === 1 && A.eachCell((O) => {
|
|
5692
5692
|
O.fill = { type: "pattern", pattern: "solid", fgColor: { argb: St(q) } };
|
|
@@ -5697,17 +5697,17 @@ async function dl(n, o, e = {}) {
|
|
|
5697
5697
|
vertical: "middle"
|
|
5698
5698
|
}, O.border = { bottom: { style: "thin", color: { argb: "FFf1f5f9" } } });
|
|
5699
5699
|
}), te.length > 0) {
|
|
5700
|
-
const O = te.reduce((P,
|
|
5700
|
+
const O = te.reduce((P, ce) => Math.max(P, l[ce.field]?.imageHeight ?? 40), 0), Z = Math.ceil(O / 1.333), U = Z * 1.333;
|
|
5701
5701
|
A.height = Z, te.forEach((P) => {
|
|
5702
|
-
const
|
|
5703
|
-
if (
|
|
5704
|
-
A.getCell(
|
|
5702
|
+
const ce = x.indexOf(P), ie = b[P.field], ve = typeof ie == "string" ? _.get(ie) : void 0;
|
|
5703
|
+
if (ve === void 0) {
|
|
5704
|
+
A.getCell(ce + 1).value = typeof ie == "string" ? ie : "";
|
|
5705
5705
|
return;
|
|
5706
5706
|
}
|
|
5707
|
-
const nt = l[P.field], z = nt?.imageWidth ?? 40, Ne = nt?.imageHeight ?? 40, ft = (J.getColumn(
|
|
5708
|
-
J.addImage(
|
|
5707
|
+
const nt = l[P.field], z = nt?.imageWidth ?? 40, Ne = nt?.imageHeight ?? 40, ft = (J.getColumn(ce + 1).width ?? 8) * 7 + 5, Ge = Math.max(0, ft - z) / 2, jt = Math.max(0, U - Ne) / 2;
|
|
5708
|
+
J.addImage(ve, {
|
|
5709
5709
|
tl: {
|
|
5710
|
-
col:
|
|
5710
|
+
col: ce,
|
|
5711
5711
|
row: we,
|
|
5712
5712
|
nativeColOff: Math.floor(Ge * 9525),
|
|
5713
5713
|
nativeRowOff: Math.floor(jt * 9525)
|
|
@@ -5720,10 +5720,10 @@ async function dl(n, o, e = {}) {
|
|
|
5720
5720
|
A.height = 16;
|
|
5721
5721
|
we++;
|
|
5722
5722
|
}), Y && f && m) {
|
|
5723
|
-
const
|
|
5723
|
+
const b = x.map((O) => {
|
|
5724
5724
|
const Z = m[O.field];
|
|
5725
5725
|
return Z ? Z.toUpperCase() : "";
|
|
5726
|
-
}), H = J.addRow(
|
|
5726
|
+
}), H = J.addRow(b);
|
|
5727
5727
|
H.height = 16, H.font = { size: g - 1, italic: !0, color: { argb: "FF94a3b8" } }, H.eachCell((O) => {
|
|
5728
5728
|
O.alignment = { horizontal: "right", vertical: "middle" }, O.border = { top: { style: "thin", color: { argb: "FFcbd5e1" } } };
|
|
5729
5729
|
});
|
|
@@ -5736,10 +5736,10 @@ async function dl(n, o, e = {}) {
|
|
|
5736
5736
|
});
|
|
5737
5737
|
}
|
|
5738
5738
|
}
|
|
5739
|
-
const
|
|
5739
|
+
const v = await w.xlsx.writeBuffer(), S = new Blob([v], {
|
|
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("#", "");
|
|
@@ -6053,7 +6053,7 @@ function xl(n) {
|
|
|
6053
6053
|
debounceMs: r = 300,
|
|
6054
6054
|
include: i,
|
|
6055
6055
|
storage: l = typeof window < "u" ? window.localStorage : void 0
|
|
6056
|
-
} = o, a =
|
|
6056
|
+
} = o, a = de(() => {
|
|
6057
6057
|
if (l)
|
|
6058
6058
|
return qi(e, l);
|
|
6059
6059
|
}, [e]), s = ne(null), u = ne(null), g = W(() => {
|
|
@@ -6073,17 +6073,17 @@ function xl(n) {
|
|
|
6073
6073
|
return { initialState: a, onStateChange: f, clearState: m };
|
|
6074
6074
|
}
|
|
6075
6075
|
export {
|
|
6076
|
-
|
|
6076
|
+
Sn as Button,
|
|
6077
6077
|
Zr as Cell,
|
|
6078
|
-
|
|
6078
|
+
Rn as Checkbox,
|
|
6079
6079
|
el as DataGrid,
|
|
6080
6080
|
cl as DataGridThemeProvider,
|
|
6081
6081
|
Ii as FilterPanel,
|
|
6082
6082
|
nl as GridToolbar,
|
|
6083
|
-
|
|
6083
|
+
jn as GridTooltip,
|
|
6084
6084
|
Vr as Header,
|
|
6085
6085
|
rl as Input,
|
|
6086
|
-
|
|
6086
|
+
kn as Row,
|
|
6087
6087
|
tl as Skeleton,
|
|
6088
6088
|
hl as amberTheme,
|
|
6089
6089
|
pl as compactTheme,
|