@opencorestack/opengridx 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/opengridx.es.js +616 -610
- package/dist/opengridx.es.js.map +1 -1
- package/dist/opengridx.umd.js +5 -5
- package/dist/opengridx.umd.js.map +1 -1
- package/docs/API_REFERENCE.md +743 -0
- package/lib/components/DataGrid/DataGrid.tsx +15 -3
- package/package.json +1 -1
package/dist/opengridx.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ae, { useMemo as le, useState as Q, useCallback as z, useRef as J, useEffect as re, useLayoutEffect as Ee, useReducer as So } from "react";
|
|
2
2
|
import Ge from "react-dom";
|
|
3
|
-
var Tt = { exports: {} },
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
if (
|
|
7
|
-
|
|
3
|
+
var Tt = { exports: {} }, ht = {};
|
|
4
|
+
var Pn;
|
|
5
|
+
function jo() {
|
|
6
|
+
if (Pn) return ht;
|
|
7
|
+
Pn = 1;
|
|
8
8
|
var n = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
9
9
|
function e(o, i, l) {
|
|
10
10
|
var a = null;
|
|
@@ -21,12 +21,12 @@ function So() {
|
|
|
21
21
|
props: l
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return ht.Fragment = t, ht.jsx = e, ht.jsxs = e, ht;
|
|
25
25
|
}
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
function
|
|
29
|
-
return
|
|
26
|
+
var pt = {};
|
|
27
|
+
var Ln;
|
|
28
|
+
function Ro() {
|
|
29
|
+
return Ln || (Ln = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
30
30
|
function n(C) {
|
|
31
31
|
if (C == null) return null;
|
|
32
32
|
if (typeof C == "function")
|
|
@@ -181,8 +181,8 @@ function jo() {
|
|
|
181
181
|
else x(D);
|
|
182
182
|
if (T.call(B, "key")) {
|
|
183
183
|
D = n(C);
|
|
184
|
-
var P = Object.keys(B).filter(function(
|
|
185
|
-
return
|
|
184
|
+
var P = Object.keys(B).filter(function(te) {
|
|
185
|
+
return te !== "key";
|
|
186
186
|
});
|
|
187
187
|
W = 0 < P.length ? "{key: someKey, " + P.join(": ..., ") + ": ...}" : "{key: someKey}", K[D + W] || (P = 0 < P.length ? "{" + P.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
188
188
|
`A props object containing a "key" prop is being spread into JSX:
|
|
@@ -199,8 +199,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
199
199
|
}
|
|
200
200
|
if (D = null, O !== void 0 && (e(O), D = "" + O), a(B) && (e(B.key), D = "" + B.key), "key" in B) {
|
|
201
201
|
O = {};
|
|
202
|
-
for (var
|
|
203
|
-
|
|
202
|
+
for (var ne in B)
|
|
203
|
+
ne !== "key" && (O[ne] = B[ne]);
|
|
204
204
|
} else O = B;
|
|
205
205
|
return D && s(
|
|
206
206
|
O,
|
|
@@ -220,7 +220,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
220
220
|
function h(C) {
|
|
221
221
|
return typeof C == "object" && C !== null && C.$$typeof === v;
|
|
222
222
|
}
|
|
223
|
-
var m =
|
|
223
|
+
var m = ae, v = /* @__PURE__ */ Symbol.for("react.transitional.element"), b = /* @__PURE__ */ Symbol.for("react.portal"), S = /* @__PURE__ */ Symbol.for("react.fragment"), N = /* @__PURE__ */ Symbol.for("react.strict_mode"), f = /* @__PURE__ */ Symbol.for("react.profiler"), k = /* @__PURE__ */ Symbol.for("react.consumer"), y = /* @__PURE__ */ Symbol.for("react.context"), w = /* @__PURE__ */ Symbol.for("react.forward_ref"), u = /* @__PURE__ */ Symbol.for("react.suspense"), p = /* @__PURE__ */ Symbol.for("react.suspense_list"), j = /* @__PURE__ */ Symbol.for("react.memo"), E = /* @__PURE__ */ Symbol.for("react.lazy"), R = /* @__PURE__ */ Symbol.for("react.activity"), _ = /* @__PURE__ */ Symbol.for("react.client.reference"), M = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, T = Object.prototype.hasOwnProperty, I = Array.isArray, F = console.createTask ? console.createTask : function() {
|
|
224
224
|
return null;
|
|
225
225
|
};
|
|
226
226
|
m = {
|
|
@@ -232,7 +232,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
232
232
|
m,
|
|
233
233
|
l
|
|
234
234
|
)(), q = F(o(l)), K = {};
|
|
235
|
-
|
|
235
|
+
pt.Fragment = S, pt.jsx = function(C, B, O) {
|
|
236
236
|
var W = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
237
237
|
return g(
|
|
238
238
|
C,
|
|
@@ -242,7 +242,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
242
242
|
W ? Error("react-stack-top-frame") : U,
|
|
243
243
|
W ? F(o(C)) : q
|
|
244
244
|
);
|
|
245
|
-
},
|
|
245
|
+
}, pt.jsxs = function(C, B, O) {
|
|
246
246
|
var W = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
247
247
|
return g(
|
|
248
248
|
C,
|
|
@@ -253,17 +253,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
253
253
|
W ? F(o(C)) : q
|
|
254
254
|
);
|
|
255
255
|
};
|
|
256
|
-
})()),
|
|
256
|
+
})()), pt;
|
|
257
257
|
}
|
|
258
|
-
var
|
|
259
|
-
function
|
|
260
|
-
return
|
|
258
|
+
var Tn;
|
|
259
|
+
function Eo() {
|
|
260
|
+
return Tn || (Tn = 1, process.env.NODE_ENV === "production" ? Tt.exports = jo() : Tt.exports = Ro()), Tt.exports;
|
|
261
261
|
}
|
|
262
|
-
var r =
|
|
262
|
+
var r = Eo();
|
|
263
263
|
function zt(n, t) {
|
|
264
264
|
return t ? t.left?.includes(n) ? "left" : t.right?.includes(n) ? "right" : null : null;
|
|
265
265
|
}
|
|
266
|
-
function
|
|
266
|
+
function No(n, t) {
|
|
267
267
|
const e = [], o = [], i = [];
|
|
268
268
|
return t ? (n.forEach((l) => {
|
|
269
269
|
const a = zt(l.field, t);
|
|
@@ -276,10 +276,10 @@ function Eo(n, t) {
|
|
|
276
276
|
return s - c;
|
|
277
277
|
}), { left: e, center: o, right: i }) : { left: e, center: n, right: i };
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function An(n, t, e, o, i, l, a, s) {
|
|
280
280
|
const c = {};
|
|
281
281
|
if (!e) return c;
|
|
282
|
-
const d =
|
|
282
|
+
const d = No(n, e);
|
|
283
283
|
let g = 0;
|
|
284
284
|
s && (g += 48), l && a && (g += 48), o && i && (g += 48), d.left.forEach((h) => {
|
|
285
285
|
c[h.field] = g;
|
|
@@ -295,7 +295,7 @@ function Fn(n, t, e, o, i, l, a, s) {
|
|
|
295
295
|
function cn(n, t) {
|
|
296
296
|
return t ? t.top?.includes(n) ? "top" : t.bottom?.includes(n) ? "bottom" : null : null;
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function Mo(n, t) {
|
|
299
299
|
const e = [], o = [], i = [];
|
|
300
300
|
return t ? (n.forEach((l) => {
|
|
301
301
|
const a = cn(l.id, t);
|
|
@@ -308,7 +308,7 @@ function No(n, t) {
|
|
|
308
308
|
return s - c;
|
|
309
309
|
}), { top: e, center: o, bottom: i }) : { top: e, center: n, bottom: i };
|
|
310
310
|
}
|
|
311
|
-
function
|
|
311
|
+
function it(n) {
|
|
312
312
|
if (n === void 0) return { type: "auto", value: 0 };
|
|
313
313
|
if (typeof n == "number") return { type: "fixed", value: n };
|
|
314
314
|
if (typeof n == "string") {
|
|
@@ -320,7 +320,7 @@ function rt(n) {
|
|
|
320
320
|
}
|
|
321
321
|
return { type: "fixed", value: 100 };
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function Io(n) {
|
|
324
324
|
const {
|
|
325
325
|
rowHeight: t,
|
|
326
326
|
pagination: e,
|
|
@@ -341,50 +341,50 @@ function Mo(n) {
|
|
|
341
341
|
isLoading: N,
|
|
342
342
|
pageSize: f
|
|
343
343
|
} = n;
|
|
344
|
-
return
|
|
344
|
+
return le(() => {
|
|
345
345
|
const k = e ? o : i, y = k.map((A, X) => {
|
|
346
|
-
let
|
|
346
|
+
let oe = t;
|
|
347
347
|
if (l.has(A.id)) {
|
|
348
348
|
const ue = a?.({ row: A, id: A.id, rowIndex: s + X }) ?? 200;
|
|
349
|
-
|
|
349
|
+
oe += typeof ue == "number" ? ue : parseInt(String(ue), 10) || 200;
|
|
350
350
|
}
|
|
351
|
-
return
|
|
352
|
-
}), w = y.reduce((A, X,
|
|
351
|
+
return oe;
|
|
352
|
+
}), w = y.reduce((A, X, oe) => (A.push((A[oe - 1] || 0) + X), A), []), u = S === "infinite" && N && k.length > 0 ? Math.min(f, 20) : 0, p = (w[w.length - 1] || 0) + u * t, j = s * t, E = c * t, R = [], _ = [], M = [], T = [];
|
|
353
353
|
d.forEach((A) => {
|
|
354
354
|
const X = zt(A.field, g);
|
|
355
355
|
X === "left" ? R.push(A) : X === "right" ? _.push(A) : M.push(A);
|
|
356
356
|
});
|
|
357
357
|
const I = (m ? 48 : 0) + (v ? 48 : 0) + (b ? 48 : 0), F = (A) => x[A.field] ?? A.width, H = R.reduce((A, X) => {
|
|
358
|
-
const
|
|
359
|
-
return A + (
|
|
358
|
+
const oe = it(F(X));
|
|
359
|
+
return A + (oe.type === "fixed" ? oe.value : 100);
|
|
360
360
|
}, 0), L = _.reduce((A, X) => {
|
|
361
|
-
const
|
|
362
|
-
return A + (
|
|
361
|
+
const oe = it(F(X));
|
|
362
|
+
return A + (oe.type === "fixed" ? oe.value : 100);
|
|
363
363
|
}, 0), U = M.reduce((A, X) => {
|
|
364
364
|
if (!Object.prototype.hasOwnProperty.call(x, X.field) && X.flex && X.flex > 0) {
|
|
365
365
|
const fe = X.minWidth ?? 150, Ie = typeof X.width == "number" ? X.width : 150;
|
|
366
366
|
return A + (fe || Ie);
|
|
367
367
|
}
|
|
368
|
-
const ue =
|
|
368
|
+
const ue = it(F(X));
|
|
369
369
|
return ue.type === "fixed" ? A + ue.value : ue.type === "percentage" ? A + 100 : A + (X.minWidth ?? 150);
|
|
370
370
|
}, 0), q = Math.max(
|
|
371
371
|
h - I - H - L,
|
|
372
372
|
U
|
|
373
373
|
), K = [], C = [], B = [];
|
|
374
374
|
M.forEach((A) => {
|
|
375
|
-
const X = Object.prototype.hasOwnProperty.call(x, A.field),
|
|
375
|
+
const X = Object.prototype.hasOwnProperty.call(x, A.field), oe = it(F(A));
|
|
376
376
|
if (!X && A.flex && A.flex > 0) {
|
|
377
377
|
B.push({ col: A, flex: A.flex });
|
|
378
378
|
return;
|
|
379
379
|
}
|
|
380
|
-
|
|
380
|
+
oe.type === "fixed" ? K.push({ col: A, width: oe.value }) : oe.type === "percentage" ? C.push({ col: A, percentage: oe.value }) : B.push({ col: A, flex: 1 });
|
|
381
381
|
});
|
|
382
382
|
const O = K.reduce((A, { width: X }) => A + X, 0);
|
|
383
383
|
let W = Math.max(0, q - O);
|
|
384
384
|
const V = /* @__PURE__ */ new Map();
|
|
385
385
|
C.forEach(({ col: A, percentage: X }) => {
|
|
386
|
-
const
|
|
387
|
-
V.set(A.field,
|
|
386
|
+
const oe = X / 100 * W;
|
|
387
|
+
V.set(A.field, oe), W -= oe;
|
|
388
388
|
}), W = Math.max(0, W);
|
|
389
389
|
const G = /* @__PURE__ */ new Map(), D = B.map((A) => ({
|
|
390
390
|
...A,
|
|
@@ -398,11 +398,11 @@ function Mo(n) {
|
|
|
398
398
|
const X = D.length * 2;
|
|
399
399
|
for (; A < X; ) {
|
|
400
400
|
A++;
|
|
401
|
-
const
|
|
402
|
-
if (
|
|
403
|
-
const ue =
|
|
401
|
+
const oe = D.filter((ie) => !ie.frozen);
|
|
402
|
+
if (oe.length === 0) break;
|
|
403
|
+
const ue = oe.reduce((ie, ye) => ie + ye.flex, 0), fe = D.reduce((ie, ye) => ye.frozen ? ie + ye.computedWidth : ie, 0), Ie = Math.max(0, W - fe);
|
|
404
404
|
if (ue <= 0) {
|
|
405
|
-
|
|
405
|
+
oe.forEach((ie) => {
|
|
406
406
|
ie.computedWidth = ie.minWidth, ie.frozen = !0;
|
|
407
407
|
});
|
|
408
408
|
break;
|
|
@@ -410,11 +410,11 @@ function Mo(n) {
|
|
|
410
410
|
const Ve = Ie / ue;
|
|
411
411
|
let xe = 0;
|
|
412
412
|
const Ue = [], Ke = [];
|
|
413
|
-
if (
|
|
413
|
+
if (oe.forEach((ie) => {
|
|
414
414
|
const ye = Ve * ie.flex;
|
|
415
415
|
ye < ie.minWidth ? (xe += ie.minWidth - ye, Ue.push(ie)) : ye > ie.maxWidth ? (xe += ie.maxWidth - ye, Ke.push(ie)) : ie.computedWidth = ye;
|
|
416
416
|
}), Ue.length === 0 && Ke.length === 0) {
|
|
417
|
-
|
|
417
|
+
oe.forEach((ie) => ie.frozen = !0);
|
|
418
418
|
break;
|
|
419
419
|
}
|
|
420
420
|
xe > 0 ? Ue.forEach((ie) => {
|
|
@@ -428,41 +428,41 @@ function Mo(n) {
|
|
|
428
428
|
}));
|
|
429
429
|
}
|
|
430
430
|
})(), D.forEach((A) => G.set(A.col.field, A.computedWidth));
|
|
431
|
-
const
|
|
431
|
+
const ne = /* @__PURE__ */ new Map();
|
|
432
432
|
M.forEach((A) => {
|
|
433
433
|
let X;
|
|
434
434
|
if (G.has(A.field))
|
|
435
435
|
X = G.get(A.field);
|
|
436
436
|
else {
|
|
437
|
-
const
|
|
438
|
-
if (
|
|
439
|
-
X =
|
|
437
|
+
const oe = K.find((fe) => fe.col.field === A.field), ue = C.find((fe) => fe.col.field === A.field);
|
|
438
|
+
if (oe)
|
|
439
|
+
X = oe.width;
|
|
440
440
|
else if (ue) {
|
|
441
441
|
const fe = V.get(A.field) || 0;
|
|
442
442
|
X = Math.max(A.minWidth ?? 50, fe || 100);
|
|
443
443
|
} else
|
|
444
444
|
X = 100;
|
|
445
445
|
}
|
|
446
|
-
T.push(X),
|
|
446
|
+
T.push(X), ne.set(A.field, X);
|
|
447
447
|
});
|
|
448
|
-
const
|
|
449
|
-
const X = D.find((
|
|
448
|
+
const te = M.map((A) => {
|
|
449
|
+
const X = D.find((oe) => oe.col.field === A.field);
|
|
450
450
|
return {
|
|
451
451
|
...A,
|
|
452
|
-
width:
|
|
452
|
+
width: ne.get(A.field) ?? (typeof A.width == "number" ? A.width : 100),
|
|
453
453
|
flex: X ? X.flex : A.flex
|
|
454
454
|
};
|
|
455
455
|
}), Z = 11, pe = R.map((A, X) => {
|
|
456
|
-
const
|
|
457
|
-
return { ...A, width:
|
|
456
|
+
const oe = it(F(A));
|
|
457
|
+
return { ...A, width: oe.type === "fixed" ? oe.value : 100, zIndex: Z + X };
|
|
458
458
|
}), $ = 11, ge = _.map((A, X) => {
|
|
459
|
-
const
|
|
459
|
+
const oe = it(F(A));
|
|
460
460
|
return {
|
|
461
461
|
...A,
|
|
462
|
-
width:
|
|
462
|
+
width: oe.type === "fixed" ? oe.value : 100,
|
|
463
463
|
zIndex: $ + (_.length - 1 - X)
|
|
464
464
|
};
|
|
465
|
-
}), de = T.reduce((A, X) => A + X, 0), ve = H + de + L + I, ce = T.reduce((A, X,
|
|
465
|
+
}), de = T.reduce((A, X) => A + X, 0), ve = H + de + L + I, ce = T.reduce((A, X, oe) => (A.push((A[oe - 1] || 0) + X), A), []);
|
|
466
466
|
return {
|
|
467
467
|
rowHeights: y,
|
|
468
468
|
cumulativeHeights: w,
|
|
@@ -471,7 +471,7 @@ function Mo(n) {
|
|
|
471
471
|
pinnedBottomHeight: E,
|
|
472
472
|
leftPinnedCols: pe,
|
|
473
473
|
rightPinnedCols: ge,
|
|
474
|
-
unpinnedColsWithWidth:
|
|
474
|
+
unpinnedColsWithWidth: te,
|
|
475
475
|
unpinnedColWidths: T,
|
|
476
476
|
unpinnedAccWidths: ce,
|
|
477
477
|
totalWidth: ve,
|
|
@@ -504,7 +504,7 @@ function Mo(n) {
|
|
|
504
504
|
f
|
|
505
505
|
]);
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function Po(n) {
|
|
508
508
|
const {
|
|
509
509
|
allRenderableRows: t,
|
|
510
510
|
navigationColumns: e,
|
|
@@ -587,11 +587,11 @@ function Io(n) {
|
|
|
587
587
|
if (["__checkbox_col__"].includes(Z.field) || pe) return { r: O, c: W };
|
|
588
588
|
continue;
|
|
589
589
|
}
|
|
590
|
-
const D = t[O], P = e[W],
|
|
591
|
-
let
|
|
592
|
-
if (x && !
|
|
590
|
+
const D = t[O], P = e[W], ne = ["__checkbox_col__", "__expand_col__", "__reorder_col__"].includes(P.field);
|
|
591
|
+
let te = P.editable || ne;
|
|
592
|
+
if (x && !ne)
|
|
593
593
|
try {
|
|
594
|
-
|
|
594
|
+
te = x({
|
|
595
595
|
row: D,
|
|
596
596
|
field: P.field,
|
|
597
597
|
value: D[P.field],
|
|
@@ -601,7 +601,7 @@ function Io(n) {
|
|
|
601
601
|
});
|
|
602
602
|
} catch {
|
|
603
603
|
}
|
|
604
|
-
if (
|
|
604
|
+
if (te) return { r: O, c: W };
|
|
605
605
|
}
|
|
606
606
|
return null;
|
|
607
607
|
};
|
|
@@ -636,14 +636,14 @@ function Io(n) {
|
|
|
636
636
|
N(I === -1 ? { id: "HEADER", field: L.field } : { id: t[I].id, field: L.field });
|
|
637
637
|
const U = b.current;
|
|
638
638
|
if (U) {
|
|
639
|
-
const { cumulativeHeights: q, pinnedTopHeight: K, columnMetrics: C } = v, { clientHeight: B, clientWidth: O, scrollTop: W, scrollLeft: V } = U, G = I <= 0 ? 0 : q[I - 1], D = q[I], P = W + K,
|
|
640
|
-
let
|
|
641
|
-
if (G < P ?
|
|
639
|
+
const { cumulativeHeights: q, pinnedTopHeight: K, columnMetrics: C } = v, { clientHeight: B, clientWidth: O, scrollTop: W, scrollLeft: V } = U, G = I <= 0 ? 0 : q[I - 1], D = q[I], P = W + K, ne = W + B;
|
|
640
|
+
let te = W;
|
|
641
|
+
if (G < P ? te = Math.max(0, G - K) : D > ne && (te = D - B), te !== W && (U.scrollTop = te), C) {
|
|
642
642
|
const { leftPinnedWidth: Z, rightPinnedWidth: pe, unpinnedAccWidths: $, unpinnedCols: ge, totalSpecialsWidth: de, pinnedSpecialsWidth: ve } = C, ce = ge.findIndex((A) => A.field === L.field);
|
|
643
643
|
if (ce !== -1) {
|
|
644
|
-
const A = de + Z + (ce > 0 ? $[ce - 1] : 0), X = de + Z + $[ce],
|
|
644
|
+
const A = de + Z + (ce > 0 ? $[ce - 1] : 0), X = de + Z + $[ce], oe = V + ve + Z, ue = V + O - pe;
|
|
645
645
|
let fe = V;
|
|
646
|
-
A <
|
|
646
|
+
A < oe ? fe = Math.max(0, A - ve - Z) : X > ue && (fe = X - O + pe), fe !== V && (U.scrollLeft = fe);
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
649
|
}
|
|
@@ -667,8 +667,8 @@ function Io(n) {
|
|
|
667
667
|
]);
|
|
668
668
|
return { focusedCell: S, setFocusedCell: N, handleFocus: f, handleBlur: k, handleKeyDown: y };
|
|
669
669
|
}
|
|
670
|
-
const
|
|
671
|
-
function
|
|
670
|
+
const Lo = { rowFields: [], columnFields: [], valueFields: [] };
|
|
671
|
+
function To(n) {
|
|
672
672
|
const {
|
|
673
673
|
initialState: t,
|
|
674
674
|
sortModel: e,
|
|
@@ -698,14 +698,14 @@ function Lo(n) {
|
|
|
698
698
|
), F = M ? s : T, H = z((Z) => {
|
|
699
699
|
M || I(Z), c?.(Z);
|
|
700
700
|
}, [M, c]), [L, U] = Q(
|
|
701
|
-
() => d ??
|
|
701
|
+
() => d ?? Lo
|
|
702
702
|
), q = d ?? L, K = z((Z) => {
|
|
703
703
|
U(Z), g?.(Z);
|
|
704
704
|
}, [g]), C = x !== void 0 && n.paginationModel !== void 0, [B, O] = Q(
|
|
705
705
|
() => t?.pagination?.paginationModel ?? x
|
|
706
706
|
), W = C ? x : B, V = z((Z) => {
|
|
707
707
|
C || O(Z), h?.(Z);
|
|
708
|
-
}, [C, h]), G = m !== void 0, [D, P] = Q([]),
|
|
708
|
+
}, [C, h]), G = m !== void 0, [D, P] = Q([]), ne = G ? m : D, te = le(() => new Set(ne), [ne]);
|
|
709
709
|
return {
|
|
710
710
|
sortModel: N,
|
|
711
711
|
isSortControlled: S,
|
|
@@ -720,13 +720,13 @@ function Lo(n) {
|
|
|
720
720
|
handlePivotModelChange: K,
|
|
721
721
|
effectivePaginationModel: W,
|
|
722
722
|
handlePaginationModelChange: V,
|
|
723
|
-
rowSelectionModel:
|
|
724
|
-
selectedRowIds:
|
|
723
|
+
rowSelectionModel: ne,
|
|
724
|
+
selectedRowIds: te,
|
|
725
725
|
isSelectionControlled: G,
|
|
726
726
|
setInternalRowSelectionModel: P
|
|
727
727
|
};
|
|
728
728
|
}
|
|
729
|
-
const
|
|
729
|
+
const Oo = {
|
|
730
730
|
contains: (n, t) => n == null || t == null ? !1 : String(n).toLowerCase().includes(String(t).toLowerCase()),
|
|
731
731
|
equals: (n, t) => n == null && t == null ? !0 : n == null || t == null ? !1 : String(n).toLowerCase() === String(t).toLowerCase(),
|
|
732
732
|
startsWith: (n, t) => n == null || t == null ? !1 : String(n).toLowerCase().startsWith(String(t).toLowerCase()),
|
|
@@ -770,11 +770,11 @@ const To = {
|
|
|
770
770
|
},
|
|
771
771
|
"=": (n, t) => n == null || t == null || t === "" ? !1 : Number(n) === Number(t)
|
|
772
772
|
};
|
|
773
|
-
function
|
|
774
|
-
const { field: e, operator: o, value: i } = t, l = n[e], a =
|
|
773
|
+
function Wo(n, t) {
|
|
774
|
+
const { field: e, operator: o, value: i } = t, l = n[e], a = Oo[o];
|
|
775
775
|
return a ? a(l, i) : (console.warn(`Unknown filter operator: ${o}`), !0);
|
|
776
776
|
}
|
|
777
|
-
function
|
|
777
|
+
function Fo(n, t) {
|
|
778
778
|
return !t || t.length === 0 ? !0 : t.every((e) => {
|
|
779
779
|
const o = e.toLowerCase();
|
|
780
780
|
return Object.values(n).some((i) => i == null ? !1 : String(i).toLowerCase().includes(o));
|
|
@@ -782,7 +782,7 @@ function Wo(n, t) {
|
|
|
782
782
|
}
|
|
783
783
|
function un(n, t) {
|
|
784
784
|
const e = t.items ?? [], o = t.logicOperator ?? "and", i = ("quickFilterValues" in t ? t.quickFilterValues : void 0) ?? [];
|
|
785
|
-
if (i.length > 0 && !
|
|
785
|
+
if (i.length > 0 && !Fo(n, i))
|
|
786
786
|
return !1;
|
|
787
787
|
if (e.length === 0)
|
|
788
788
|
return !0;
|
|
@@ -791,16 +791,16 @@ function un(n, t) {
|
|
|
791
791
|
const s = a, c = s.items;
|
|
792
792
|
return c.length === 0 ? !0 : s.logicOperator === "and" ? c.every(l) : c.some(l);
|
|
793
793
|
} else
|
|
794
|
-
return
|
|
794
|
+
return Wo(n, a);
|
|
795
795
|
};
|
|
796
796
|
return o === "and" ? e.every(l) : e.some(l);
|
|
797
797
|
}
|
|
798
|
-
function
|
|
798
|
+
function Ao(n, t) {
|
|
799
799
|
if (!t) return n;
|
|
800
800
|
const { items: e = [], quickFilterValues: o = [] } = t;
|
|
801
801
|
return e.length === 0 && (!o || o.length === 0) ? n : n.filter((i) => un(i, t));
|
|
802
802
|
}
|
|
803
|
-
function
|
|
803
|
+
function zo(n) {
|
|
804
804
|
switch (n) {
|
|
805
805
|
case "number":
|
|
806
806
|
return ["=", "!=", ">", ">=", "<", "<=", "isEmpty", "isNotEmpty"];
|
|
@@ -825,7 +825,7 @@ function gn(n, t, e) {
|
|
|
825
825
|
const o = String(n).toLowerCase(), i = String(t).toLowerCase();
|
|
826
826
|
return e === "asc" ? o < i ? -1 : o > i ? 1 : 0 : o > i ? -1 : o < i ? 1 : 0;
|
|
827
827
|
}
|
|
828
|
-
function
|
|
828
|
+
function Bo(n, t) {
|
|
829
829
|
if (t.length === 0)
|
|
830
830
|
return n;
|
|
831
831
|
const e = [...n];
|
|
@@ -838,7 +838,7 @@ function zo(n, t) {
|
|
|
838
838
|
return 0;
|
|
839
839
|
}), e;
|
|
840
840
|
}
|
|
841
|
-
function
|
|
841
|
+
function $o(n) {
|
|
842
842
|
const {
|
|
843
843
|
effectiveRows: t,
|
|
844
844
|
activeHierarchyHandlers: e,
|
|
@@ -853,11 +853,11 @@ function Bo(n) {
|
|
|
853
853
|
pinnedRows: x,
|
|
854
854
|
isLoading: h,
|
|
855
855
|
pageSize: m
|
|
856
|
-
} = n, v =
|
|
856
|
+
} = n, v = le(() => e ? e.getVisibleRows() || [] : o === "server" && l ? t : Ao(t, i), [t, i, e, o, l]), { top: b, center: S, bottom: N } = le(() => e ? { top: [], center: v, bottom: [] } : Mo(v, x), [v, x, e]), f = le(() => e || s === "server" && l ? S : Bo(S, a), [S, a, e, s, l]), k = le(() => {
|
|
857
857
|
if (!c || d === "server" && l) return f;
|
|
858
858
|
const w = g.page * g.pageSize;
|
|
859
859
|
return f.slice(w, w + g.pageSize);
|
|
860
|
-
}, [f, c, g.page, g.pageSize, d, l]), y =
|
|
860
|
+
}, [f, c, g.page, g.pageSize, d, l]), y = le(() => {
|
|
861
861
|
if (e) return S;
|
|
862
862
|
const w = c ? k : f, u = [...b, ...w, ...N];
|
|
863
863
|
if (d === "infinite" && h && u.length > 0) {
|
|
@@ -890,7 +890,7 @@ function Bo(n) {
|
|
|
890
890
|
allRenderableRows: y
|
|
891
891
|
};
|
|
892
892
|
}
|
|
893
|
-
function
|
|
893
|
+
function Do(n) {
|
|
894
894
|
const {
|
|
895
895
|
layout: t,
|
|
896
896
|
scrollTop: e,
|
|
@@ -904,7 +904,7 @@ function $o(n) {
|
|
|
904
904
|
pinCheckboxColumn: g,
|
|
905
905
|
pinExpandColumn: x
|
|
906
906
|
} = n;
|
|
907
|
-
return
|
|
907
|
+
return le(() => {
|
|
908
908
|
const {
|
|
909
909
|
unpinnedAccWidths: h,
|
|
910
910
|
unpinnedColsWithWidth: m,
|
|
@@ -942,12 +942,12 @@ function $o(n) {
|
|
|
942
942
|
...C > 0 ? [{ field: "__spacer_right__", width: C, isSpacer: !0 }] : [],
|
|
943
943
|
...b
|
|
944
944
|
], W = _ > 0 && S > _ ? 16 : 0, V = u + j + p + W + 2, G = 5;
|
|
945
|
-
let D = 0, P = R - 1,
|
|
946
|
-
for (;
|
|
947
|
-
const $ =
|
|
948
|
-
w[$] < e ?
|
|
945
|
+
let D = 0, P = R - 1, ne = 0, te = 0, Z = w.length - 1;
|
|
946
|
+
for (; te <= Z; ) {
|
|
947
|
+
const $ = te + Z >>> 1;
|
|
948
|
+
w[$] < e ? te = $ + 1 : Z = $ - 1;
|
|
949
949
|
}
|
|
950
|
-
D = Math.max(0,
|
|
950
|
+
D = Math.max(0, te - G), ne = D > 0 ? w[D - 1] : 0;
|
|
951
951
|
for (let $ = D; $ < w.length; $++)
|
|
952
952
|
if (w[$] >= e + M) {
|
|
953
953
|
P = Math.min(R - 1, $ + G);
|
|
@@ -961,7 +961,7 @@ function $o(n) {
|
|
|
961
961
|
firstColumnIndex: H,
|
|
962
962
|
lastColumnIndex: L
|
|
963
963
|
},
|
|
964
|
-
offsetTop:
|
|
964
|
+
offsetTop: ne,
|
|
965
965
|
offsetLeft: 0,
|
|
966
966
|
totalHeight: V,
|
|
967
967
|
pinnedTopHeight: u,
|
|
@@ -993,7 +993,7 @@ function $o(n) {
|
|
|
993
993
|
x
|
|
994
994
|
]);
|
|
995
995
|
}
|
|
996
|
-
function
|
|
996
|
+
function Ho(n) {
|
|
997
997
|
const { columns: t, onColumnOrderChange: e, disableColumnReorder: o = !1 } = n, [i, l] = Q(null), [a, s] = Q(null), c = J(-1), d = z(
|
|
998
998
|
(m) => (v) => {
|
|
999
999
|
if (o) return;
|
|
@@ -1041,7 +1041,7 @@ function Do(n) {
|
|
|
1041
1041
|
onDrop: o ? void 0 : x
|
|
1042
1042
|
};
|
|
1043
1043
|
}
|
|
1044
|
-
function
|
|
1044
|
+
function zn({ isExpanded: n, onClick: t, variant: e = "chevron" }) {
|
|
1045
1045
|
return /* @__PURE__ */ r.jsx(
|
|
1046
1046
|
"button",
|
|
1047
1047
|
{
|
|
@@ -1114,7 +1114,7 @@ function An({ isExpanded: n, onClick: t, variant: e = "chevron" }) {
|
|
|
1114
1114
|
}
|
|
1115
1115
|
);
|
|
1116
1116
|
}
|
|
1117
|
-
function
|
|
1117
|
+
function Go(n) {
|
|
1118
1118
|
const {
|
|
1119
1119
|
activeColumns: t,
|
|
1120
1120
|
isHierarchyEnabled: e,
|
|
@@ -1131,7 +1131,7 @@ function Ho(n) {
|
|
|
1131
1131
|
rowReordering: m,
|
|
1132
1132
|
initialState: v,
|
|
1133
1133
|
setColumns: b
|
|
1134
|
-
} = n, S =
|
|
1134
|
+
} = n, S = le(() => e ? t.map((_, M) => M === 0 ? {
|
|
1135
1135
|
..._,
|
|
1136
1136
|
renderCell: (T) => {
|
|
1137
1137
|
const I = T.row, F = typeof I._treeDepth == "number" ? I._treeDepth : 0, H = !!I._hasChildren, L = !!I._isExpanded, U = typeof I._groupingField == "string" ? I._groupingField : void 0, q = I._groupingValue, K = typeof I._descendantCount == "number" ? I._descendantCount : void 0, C = !!I._isGroupRow;
|
|
@@ -1155,7 +1155,7 @@ function Ho(n) {
|
|
|
1155
1155
|
},
|
|
1156
1156
|
style: { cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", pointerEvents: "auto", zIndex: 10, position: "relative" },
|
|
1157
1157
|
children: /* @__PURE__ */ r.jsx(
|
|
1158
|
-
|
|
1158
|
+
zn,
|
|
1159
1159
|
{
|
|
1160
1160
|
isExpanded: L,
|
|
1161
1161
|
onClick: (O) => {
|
|
@@ -1186,24 +1186,24 @@ function Ho(n) {
|
|
|
1186
1186
|
}, [t, b]), re(() => {
|
|
1187
1187
|
g && w(t.map((_) => _.field));
|
|
1188
1188
|
}, [g, t]);
|
|
1189
|
-
const p =
|
|
1189
|
+
const p = le(() => {
|
|
1190
1190
|
if (d) return S;
|
|
1191
1191
|
const _ = new Map(u.map((M, T) => [M, T]));
|
|
1192
1192
|
return [...S].sort((M, T) => {
|
|
1193
1193
|
const I = _.get(M.field) ?? S.indexOf(M), F = _.get(T.field) ?? S.indexOf(T);
|
|
1194
1194
|
return I - F;
|
|
1195
1195
|
});
|
|
1196
|
-
}, [S, u, d]), j =
|
|
1196
|
+
}, [S, u, d]), j = le(
|
|
1197
1197
|
() => p.filter((_) => a[_.field] !== !1),
|
|
1198
1198
|
[p, a]
|
|
1199
|
-
), E =
|
|
1199
|
+
), E = Ho({
|
|
1200
1200
|
columns: p,
|
|
1201
1201
|
onColumnOrderChange: z((_) => {
|
|
1202
1202
|
const { oldIndex: M, targetIndex: T } = _, I = [...u], [F] = I.splice(M, 1);
|
|
1203
1203
|
I.splice(T, 0, F), s || w(I), c?.(_);
|
|
1204
1204
|
}, [u, s, c]),
|
|
1205
1205
|
disableColumnReorder: d
|
|
1206
|
-
}), R =
|
|
1206
|
+
}), R = le(() => {
|
|
1207
1207
|
const _ = [];
|
|
1208
1208
|
return m && _.push({ field: "__reorder_col__" }), h && _.push({ field: "__expand_col__" }), x && _.push({ field: "__checkbox_col__" }), [..._, ...p];
|
|
1209
1209
|
}, [p, x, h, m]);
|
|
@@ -1219,7 +1219,7 @@ function Ho(n) {
|
|
|
1219
1219
|
handleColumnResize: k
|
|
1220
1220
|
};
|
|
1221
1221
|
}
|
|
1222
|
-
function
|
|
1222
|
+
function Vo(n) {
|
|
1223
1223
|
const {
|
|
1224
1224
|
renderContext: t,
|
|
1225
1225
|
pinnedTopRows: e,
|
|
@@ -1228,7 +1228,7 @@ function Go(n) {
|
|
|
1228
1228
|
sortedUnpinnedRows: l,
|
|
1229
1229
|
pagination: a
|
|
1230
1230
|
} = n;
|
|
1231
|
-
return
|
|
1231
|
+
return le(() => {
|
|
1232
1232
|
const { firstRowIndex: s, lastRowIndex: c } = t, d = a ? i : l, g = e.length, x = e.map((f, k) => ({ row: f, rowIndex: k })), h = o.map((f, k) => ({
|
|
1233
1233
|
row: f,
|
|
1234
1234
|
rowIndex: g + d.length + k
|
|
@@ -1239,7 +1239,7 @@ function Go(n) {
|
|
|
1239
1239
|
return S.filter((f) => N.has(f.row.id) ? !1 : (N.add(f.row.id), !0));
|
|
1240
1240
|
}, [t, e, o, i, l, a]);
|
|
1241
1241
|
}
|
|
1242
|
-
function
|
|
1242
|
+
function Uo(n) {
|
|
1243
1243
|
const { onRowsScrollEnd: t } = n, e = J({ scrollTop: 0, scrollLeft: 0 }), o = J(null), [i, l] = Q({ scrollTop: 0, scrollLeft: 0 });
|
|
1244
1244
|
re(() => () => {
|
|
1245
1245
|
o.current !== null && cancelAnimationFrame(o.current);
|
|
@@ -1259,7 +1259,7 @@ function Vo(n) {
|
|
|
1259
1259
|
}, [t]);
|
|
1260
1260
|
return { scrollTop: i.scrollTop, scrollLeft: i.scrollLeft, handleScroll: a };
|
|
1261
1261
|
}
|
|
1262
|
-
function
|
|
1262
|
+
function Ko(n) {
|
|
1263
1263
|
const {
|
|
1264
1264
|
onStateChange: t,
|
|
1265
1265
|
sortModel: e,
|
|
@@ -1296,7 +1296,7 @@ function Uo(n) {
|
|
|
1296
1296
|
c
|
|
1297
1297
|
]);
|
|
1298
1298
|
}
|
|
1299
|
-
const
|
|
1299
|
+
const Yo = {
|
|
1300
1300
|
sum: (n) => n.filter((e) => e != null && !isNaN(Number(e))).reduce((e, o) => e + Number(o), 0),
|
|
1301
1301
|
avg: (n) => {
|
|
1302
1302
|
const t = n.filter((e) => e != null && !isNaN(Number(e)));
|
|
@@ -1316,7 +1316,7 @@ const Ko = {
|
|
|
1316
1316
|
function He(n, t) {
|
|
1317
1317
|
return n == null ? "—" : typeof n == "number" ? t === "avg" ? n.toLocaleString(void 0, { maximumFractionDigits: 2 }) : n.toLocaleString() : String(n);
|
|
1318
1318
|
}
|
|
1319
|
-
function
|
|
1319
|
+
function qo(n) {
|
|
1320
1320
|
const {
|
|
1321
1321
|
rows: t,
|
|
1322
1322
|
aggregationModel: e,
|
|
@@ -1325,11 +1325,11 @@ function Yo(n) {
|
|
|
1325
1325
|
filterModel: l,
|
|
1326
1326
|
sortModel: a,
|
|
1327
1327
|
serverAggregationResults: s
|
|
1328
|
-
} = n, c =
|
|
1328
|
+
} = n, c = le(() => {
|
|
1329
1329
|
if (o || Object.keys(e).length === 0) return {};
|
|
1330
1330
|
const f = {};
|
|
1331
1331
|
for (const [k, y] of Object.entries(e)) {
|
|
1332
|
-
const w =
|
|
1332
|
+
const w = Yo[y];
|
|
1333
1333
|
if (!w) {
|
|
1334
1334
|
console.warn(`[useAggregation] Unknown aggregation function: "${y}"`);
|
|
1335
1335
|
continue;
|
|
@@ -1358,9 +1358,9 @@ function Yo(n) {
|
|
|
1358
1358
|
}, [i, e, l, a]);
|
|
1359
1359
|
return re(() => {
|
|
1360
1360
|
o && i?.getAggregations && !s && S();
|
|
1361
|
-
}, [S, o, i, s]), { aggregationResult:
|
|
1361
|
+
}, [S, o, i, s]), { aggregationResult: le(() => o ? s && Object.keys(s).length > 0 ? s : d : c, [o, c, s, d]), isLoading: x, error: m };
|
|
1362
1362
|
}
|
|
1363
|
-
function
|
|
1363
|
+
function Xo({
|
|
1364
1364
|
columns: n,
|
|
1365
1365
|
aggregationModel: t,
|
|
1366
1366
|
aggregationResult: e,
|
|
@@ -1407,7 +1407,7 @@ function qo({
|
|
|
1407
1407
|
}
|
|
1408
1408
|
);
|
|
1409
1409
|
}
|
|
1410
|
-
function
|
|
1410
|
+
function Jo({ noRowsLabel: n, width: t }) {
|
|
1411
1411
|
return /* @__PURE__ */ r.jsxs("div", { className: "ogx__empty", style: { width: t }, children: [
|
|
1412
1412
|
/* @__PURE__ */ r.jsxs("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
1413
1413
|
/* @__PURE__ */ r.jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
|
|
@@ -1416,7 +1416,7 @@ function Xo({ noRowsLabel: n, width: t }) {
|
|
|
1416
1416
|
/* @__PURE__ */ r.jsx("span", { children: n })
|
|
1417
1417
|
] });
|
|
1418
1418
|
}
|
|
1419
|
-
function
|
|
1419
|
+
function Qo({ error: n }) {
|
|
1420
1420
|
if (!n) return null;
|
|
1421
1421
|
const t = n instanceof Error ? n.message : typeof n == "string" ? n : "An unexpected error occurred while loading the data.";
|
|
1422
1422
|
return /* @__PURE__ */ r.jsxs("div", { className: "ogx-error-overlay", "aria-live": "assertive", role: "alert", children: [
|
|
@@ -1444,10 +1444,10 @@ const At = ({
|
|
|
1444
1444
|
inputRef: o,
|
|
1445
1445
|
...i
|
|
1446
1446
|
}) => {
|
|
1447
|
-
const l =
|
|
1447
|
+
const l = ae.useRef(null), a = ae.useCallback((c) => {
|
|
1448
1448
|
l.current = c, typeof o == "function" ? o(c) : o && (o.current = c);
|
|
1449
1449
|
}, [o]);
|
|
1450
|
-
|
|
1450
|
+
ae.useEffect(() => {
|
|
1451
1451
|
l.current && (l.current.indeterminate = n);
|
|
1452
1452
|
}, [n]);
|
|
1453
1453
|
const s = [
|
|
@@ -1473,7 +1473,7 @@ const At = ({
|
|
|
1473
1473
|
t && /* @__PURE__ */ r.jsx("span", { className: "ogx-checkbox__label", children: t })
|
|
1474
1474
|
] });
|
|
1475
1475
|
};
|
|
1476
|
-
function
|
|
1476
|
+
function Zo(n) {
|
|
1477
1477
|
const { field: t, currentWidth: e, onResize: o, minWidth: i = 50, maxWidth: l = 1e3 } = n, [a, s] = Q(!1), c = J(0), d = J(0), g = z((m) => {
|
|
1478
1478
|
m.preventDefault(), m.stopPropagation(), s(!0), c.current = m.clientX, d.current = e;
|
|
1479
1479
|
let v = 0;
|
|
@@ -1509,13 +1509,13 @@ function Qo(n) {
|
|
|
1509
1509
|
}
|
|
1510
1510
|
);
|
|
1511
1511
|
}
|
|
1512
|
-
function
|
|
1512
|
+
function lt() {
|
|
1513
1513
|
return /* @__PURE__ */ r.jsx("svg", { width: "8", height: "8", viewBox: "0 0 8 8", fill: "currentColor", children: /* @__PURE__ */ r.jsx("circle", { cx: "4", cy: "4", r: "4" }) });
|
|
1514
1514
|
}
|
|
1515
|
-
function
|
|
1515
|
+
function st() {
|
|
1516
1516
|
return /* @__PURE__ */ r.jsx("svg", { width: "8", height: "8", viewBox: "0 0 8 8", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ r.jsx("circle", { cx: "4", cy: "4", r: "3" }) });
|
|
1517
1517
|
}
|
|
1518
|
-
function
|
|
1518
|
+
function er() {
|
|
1519
1519
|
return /* @__PURE__ */ r.jsxs("svg", { focusable: "false", "aria-hidden": "true", viewBox: "0 0 24 24", width: "13", height: "13", fill: "none", children: [
|
|
1520
1520
|
/* @__PURE__ */ r.jsx("rect", { x: "2", y: "4", width: "20", height: "16", rx: "2", stroke: "currentColor", strokeWidth: "1.8" }),
|
|
1521
1521
|
/* @__PURE__ */ r.jsx("rect", { x: "8.5", y: "4", width: "7", height: "16", fill: "currentColor", opacity: "0.3" }),
|
|
@@ -1525,52 +1525,52 @@ function Zo() {
|
|
|
1525
1525
|
/* @__PURE__ */ r.jsx("line", { x1: "2", y1: "14", x2: "22", y2: "14", stroke: "currentColor", strokeWidth: "1.2" })
|
|
1526
1526
|
] });
|
|
1527
1527
|
}
|
|
1528
|
-
function
|
|
1528
|
+
function tr() {
|
|
1529
1529
|
return /* @__PURE__ */ r.jsxs("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1530
1530
|
/* @__PURE__ */ r.jsx("line", { x1: "12", y1: "19", x2: "12", y2: "5" }),
|
|
1531
1531
|
/* @__PURE__ */ r.jsx("polyline", { points: "5 12 12 5 19 12" })
|
|
1532
1532
|
] });
|
|
1533
1533
|
}
|
|
1534
|
-
function
|
|
1534
|
+
function nr() {
|
|
1535
1535
|
return /* @__PURE__ */ r.jsxs("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1536
1536
|
/* @__PURE__ */ r.jsx("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
|
|
1537
1537
|
/* @__PURE__ */ r.jsx("polyline", { points: "19 12 12 19 5 12" })
|
|
1538
1538
|
] });
|
|
1539
1539
|
}
|
|
1540
|
-
function
|
|
1540
|
+
function or() {
|
|
1541
1541
|
return /* @__PURE__ */ r.jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", children: /* @__PURE__ */ r.jsx("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
|
|
1542
1542
|
}
|
|
1543
|
-
function
|
|
1543
|
+
function rr() {
|
|
1544
1544
|
return /* @__PURE__ */ r.jsxs("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1545
1545
|
/* @__PURE__ */ r.jsx("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94" }),
|
|
1546
1546
|
/* @__PURE__ */ r.jsx("path", { d: "M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19" }),
|
|
1547
1547
|
/* @__PURE__ */ r.jsx("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
1548
1548
|
] });
|
|
1549
1549
|
}
|
|
1550
|
-
function
|
|
1550
|
+
function ir() {
|
|
1551
1551
|
return /* @__PURE__ */ r.jsxs("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1552
1552
|
/* @__PURE__ */ r.jsx("line", { x1: "4", y1: "2", x2: "4", y2: "22" }),
|
|
1553
1553
|
/* @__PURE__ */ r.jsx("polyline", { points: "11 8 4 12 11 16" }),
|
|
1554
1554
|
/* @__PURE__ */ r.jsx("line", { x1: "4", y1: "12", x2: "20", y2: "12" })
|
|
1555
1555
|
] });
|
|
1556
1556
|
}
|
|
1557
|
-
function
|
|
1557
|
+
function lr() {
|
|
1558
1558
|
return /* @__PURE__ */ r.jsxs("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1559
1559
|
/* @__PURE__ */ r.jsx("line", { x1: "20", y1: "2", x2: "20", y2: "22" }),
|
|
1560
1560
|
/* @__PURE__ */ r.jsx("polyline", { points: "13 8 20 12 13 16" }),
|
|
1561
1561
|
/* @__PURE__ */ r.jsx("line", { x1: "20", y1: "12", x2: "4", y2: "12" })
|
|
1562
1562
|
] });
|
|
1563
1563
|
}
|
|
1564
|
-
function
|
|
1564
|
+
function sr() {
|
|
1565
1565
|
return /* @__PURE__ */ r.jsxs("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1566
1566
|
/* @__PURE__ */ r.jsx("line", { x1: "2", y1: "2", x2: "22", y2: "22" }),
|
|
1567
1567
|
/* @__PURE__ */ r.jsx("line", { x1: "4", y1: "4", x2: "4", y2: "20" }),
|
|
1568
1568
|
/* @__PURE__ */ r.jsx("line", { x1: "4", y1: "12", x2: "20", y2: "12" })
|
|
1569
1569
|
] });
|
|
1570
1570
|
}
|
|
1571
|
-
function
|
|
1571
|
+
function ar({ colDef: n, sortModel: t, onSort: e, onHide: o, onPin: i, pinnedColumns: l, onManageColumns: a, onClose: s, anchorEl: c }) {
|
|
1572
1572
|
const d = J(null), [g, x] = Q({ position: "fixed", zIndex: 1300, top: 0, left: 0, visibility: "hidden" });
|
|
1573
|
-
|
|
1573
|
+
ae.useLayoutEffect(() => {
|
|
1574
1574
|
if (!c || !d.current) return;
|
|
1575
1575
|
const w = c.getBoundingClientRect(), u = d.current.getBoundingClientRect(), p = window.innerWidth, j = window.innerHeight, E = 8;
|
|
1576
1576
|
let R = w.left;
|
|
@@ -1606,8 +1606,8 @@ function sr({ colDef: n, sortModel: t, onSort: e, onHide: o, onPin: i, pinnedCol
|
|
|
1606
1606
|
role: "menuitemradio",
|
|
1607
1607
|
"aria-checked": b === "asc",
|
|
1608
1608
|
children: [
|
|
1609
|
-
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__indicator", "aria-hidden": "true", children: b === "asc" ? /* @__PURE__ */ r.jsx(
|
|
1610
|
-
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__icon", "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(
|
|
1609
|
+
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__indicator", "aria-hidden": "true", children: b === "asc" ? /* @__PURE__ */ r.jsx(lt, {}) : /* @__PURE__ */ r.jsx(st, {}) }),
|
|
1610
|
+
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__icon", "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(tr, {}) }),
|
|
1611
1611
|
"Sort Ascending"
|
|
1612
1612
|
]
|
|
1613
1613
|
}
|
|
@@ -1620,8 +1620,8 @@ function sr({ colDef: n, sortModel: t, onSort: e, onHide: o, onPin: i, pinnedCol
|
|
|
1620
1620
|
role: "menuitemradio",
|
|
1621
1621
|
"aria-checked": b === "desc",
|
|
1622
1622
|
children: [
|
|
1623
|
-
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__indicator", "aria-hidden": "true", children: b === "desc" ? /* @__PURE__ */ r.jsx(
|
|
1624
|
-
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__icon", "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(
|
|
1623
|
+
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__indicator", "aria-hidden": "true", children: b === "desc" ? /* @__PURE__ */ r.jsx(lt, {}) : /* @__PURE__ */ r.jsx(st, {}) }),
|
|
1624
|
+
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__icon", "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(nr, {}) }),
|
|
1625
1625
|
"Sort Descending"
|
|
1626
1626
|
]
|
|
1627
1627
|
}
|
|
@@ -1634,8 +1634,8 @@ function sr({ colDef: n, sortModel: t, onSort: e, onHide: o, onPin: i, pinnedCol
|
|
|
1634
1634
|
role: "menuitemradio",
|
|
1635
1635
|
"aria-checked": S,
|
|
1636
1636
|
children: [
|
|
1637
|
-
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__indicator", "aria-hidden": "true", children: S ? /* @__PURE__ */ r.jsx(
|
|
1638
|
-
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__icon", "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(
|
|
1637
|
+
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__indicator", "aria-hidden": "true", children: S ? /* @__PURE__ */ r.jsx(lt, {}) : /* @__PURE__ */ r.jsx(st, {}) }),
|
|
1638
|
+
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__icon", "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(or, {}) }),
|
|
1639
1639
|
"Unsort"
|
|
1640
1640
|
]
|
|
1641
1641
|
}
|
|
@@ -1652,8 +1652,8 @@ function sr({ colDef: n, sortModel: t, onSort: e, onHide: o, onPin: i, pinnedCol
|
|
|
1652
1652
|
"aria-checked": N,
|
|
1653
1653
|
"aria-label": "Pin to left",
|
|
1654
1654
|
children: [
|
|
1655
|
-
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__indicator", "aria-hidden": "true", children: N ? /* @__PURE__ */ r.jsx(
|
|
1656
|
-
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__icon", "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(
|
|
1655
|
+
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__indicator", "aria-hidden": "true", children: N ? /* @__PURE__ */ r.jsx(lt, {}) : /* @__PURE__ */ r.jsx(st, {}) }),
|
|
1656
|
+
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__icon", "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(ir, {}) }),
|
|
1657
1657
|
"Pin to Left"
|
|
1658
1658
|
]
|
|
1659
1659
|
}
|
|
@@ -1667,8 +1667,8 @@ function sr({ colDef: n, sortModel: t, onSort: e, onHide: o, onPin: i, pinnedCol
|
|
|
1667
1667
|
"aria-checked": f,
|
|
1668
1668
|
"aria-label": "Pin to right",
|
|
1669
1669
|
children: [
|
|
1670
|
-
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__indicator", "aria-hidden": "true", children: f ? /* @__PURE__ */ r.jsx(
|
|
1671
|
-
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__icon", "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(
|
|
1670
|
+
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__indicator", "aria-hidden": "true", children: f ? /* @__PURE__ */ r.jsx(lt, {}) : /* @__PURE__ */ r.jsx(st, {}) }),
|
|
1671
|
+
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__icon", "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(lr, {}) }),
|
|
1672
1672
|
"Pin to Right"
|
|
1673
1673
|
]
|
|
1674
1674
|
}
|
|
@@ -1682,8 +1682,8 @@ function sr({ colDef: n, sortModel: t, onSort: e, onHide: o, onPin: i, pinnedCol
|
|
|
1682
1682
|
"aria-checked": k,
|
|
1683
1683
|
"aria-label": "Unpin column",
|
|
1684
1684
|
children: [
|
|
1685
|
-
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__indicator", "aria-hidden": "true", children: k ? /* @__PURE__ */ r.jsx(
|
|
1686
|
-
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__icon", "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(
|
|
1685
|
+
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__indicator", "aria-hidden": "true", children: k ? /* @__PURE__ */ r.jsx(lt, {}) : /* @__PURE__ */ r.jsx(st, {}) }),
|
|
1686
|
+
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__icon", "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(sr, {}) }),
|
|
1687
1687
|
"Unpin"
|
|
1688
1688
|
]
|
|
1689
1689
|
}
|
|
@@ -1691,7 +1691,7 @@ function sr({ colDef: n, sortModel: t, onSort: e, onHide: o, onPin: i, pinnedCol
|
|
|
1691
1691
|
/* @__PURE__ */ r.jsx("div", { className: "ogx-menu-divider" }),
|
|
1692
1692
|
/* @__PURE__ */ r.jsxs("button", { className: "ogx-menu-item", onClick: m, role: "menuitem", "aria-label": `Hide ${y} column`, children: [
|
|
1693
1693
|
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__indicator", "aria-hidden": "true" }),
|
|
1694
|
-
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__icon", "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(
|
|
1694
|
+
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__icon", "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(rr, {}) }),
|
|
1695
1695
|
"Hide Column"
|
|
1696
1696
|
] }),
|
|
1697
1697
|
/* @__PURE__ */ r.jsx("div", { className: "ogx-menu-divider" }),
|
|
@@ -1699,26 +1699,26 @@ function sr({ colDef: n, sortModel: t, onSort: e, onHide: o, onPin: i, pinnedCol
|
|
|
1699
1699
|
a?.(), s();
|
|
1700
1700
|
}, role: "menuitem", "aria-label": "Manage all columns", children: [
|
|
1701
1701
|
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__indicator", "aria-hidden": "true" }),
|
|
1702
|
-
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__icon", "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(
|
|
1702
|
+
/* @__PURE__ */ r.jsx("span", { className: "ogx-menu-item__icon", "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(er, {}) }),
|
|
1703
1703
|
"Manage columns"
|
|
1704
1704
|
] })
|
|
1705
1705
|
] }),
|
|
1706
1706
|
c?.closest(".ogx-theme-provider") || document.body
|
|
1707
1707
|
);
|
|
1708
1708
|
}
|
|
1709
|
-
function
|
|
1709
|
+
function dr() {
|
|
1710
1710
|
return /* @__PURE__ */ r.jsx("svg", { focusable: "false", "aria-hidden": "true", viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: /* @__PURE__ */ r.jsx("path", { d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" }) });
|
|
1711
1711
|
}
|
|
1712
|
-
function
|
|
1712
|
+
function cr() {
|
|
1713
1713
|
return /* @__PURE__ */ r.jsx("svg", { focusable: "false", "aria-hidden": "true", viewBox: "0 0 24 24", width: "18", height: "18", fill: "currentColor", children: /* @__PURE__ */ r.jsx("path", { d: "M6.99 11L3 15l3.99 4v-3H14v-2H6.99v-3zM21 9l-3.99-4v3H10v2h7.01v3L21 9z" }) });
|
|
1714
1714
|
}
|
|
1715
|
-
function
|
|
1715
|
+
function Bn(n) {
|
|
1716
1716
|
const t = [];
|
|
1717
1717
|
for (const e of n.children)
|
|
1718
|
-
typeof e == "string" ? t.push(e) : t.push(...
|
|
1718
|
+
typeof e == "string" ? t.push(e) : t.push(...Bn(e));
|
|
1719
1719
|
return t;
|
|
1720
1720
|
}
|
|
1721
|
-
function
|
|
1721
|
+
function ur(n) {
|
|
1722
1722
|
let t = 0;
|
|
1723
1723
|
function e(o, i) {
|
|
1724
1724
|
t = Math.max(t, i);
|
|
@@ -1726,9 +1726,9 @@ function cr(n) {
|
|
|
1726
1726
|
}
|
|
1727
1727
|
return n.forEach((o) => e(o, 1)), t;
|
|
1728
1728
|
}
|
|
1729
|
-
function
|
|
1729
|
+
function gr(n, t, e) {
|
|
1730
1730
|
function o(s, c, d) {
|
|
1731
|
-
if (!
|
|
1731
|
+
if (!Bn(s).includes(c)) return null;
|
|
1732
1732
|
if (d === e) return s;
|
|
1733
1733
|
for (const g of s.children)
|
|
1734
1734
|
if (typeof g != "string") {
|
|
@@ -1759,7 +1759,7 @@ function ur(n, t, e) {
|
|
|
1759
1759
|
}
|
|
1760
1760
|
return l;
|
|
1761
1761
|
}
|
|
1762
|
-
function
|
|
1762
|
+
function fr(n) {
|
|
1763
1763
|
const {
|
|
1764
1764
|
columns: t,
|
|
1765
1765
|
allColumns: e,
|
|
@@ -1789,12 +1789,12 @@ function gr(n) {
|
|
|
1789
1789
|
onHideColumn: R,
|
|
1790
1790
|
onPinColumn: _,
|
|
1791
1791
|
onManageColumns: M
|
|
1792
|
-
} = n, T =
|
|
1793
|
-
|
|
1792
|
+
} = n, T = ae.useRef({}), [I, F] = ae.useState(null), H = (P) => (ne) => {
|
|
1793
|
+
ne.stopPropagation(), F({ colDef: P, anchorEl: ne.currentTarget });
|
|
1794
1794
|
}, L = () => {
|
|
1795
1795
|
F(null);
|
|
1796
1796
|
};
|
|
1797
|
-
|
|
1797
|
+
ae.useLayoutEffect(() => {
|
|
1798
1798
|
if (j?.id === "HEADER") {
|
|
1799
1799
|
const P = T.current[j.field];
|
|
1800
1800
|
P && P.focus();
|
|
@@ -1802,13 +1802,13 @@ function gr(n) {
|
|
|
1802
1802
|
}, [j]);
|
|
1803
1803
|
const U = (P) => () => {
|
|
1804
1804
|
if (P.sortable === !1 || !c) return;
|
|
1805
|
-
const
|
|
1806
|
-
let
|
|
1807
|
-
|
|
1805
|
+
const ne = d.find((Z) => Z.field === P.field);
|
|
1806
|
+
let te = "asc";
|
|
1807
|
+
ne && (ne.sort === "asc" ? te = "desc" : te = null), c(P.field, te);
|
|
1808
1808
|
}, q = (P) => {
|
|
1809
|
-
const
|
|
1810
|
-
return
|
|
1811
|
-
}, K =
|
|
1809
|
+
const ne = d.find((te) => te.field === P);
|
|
1810
|
+
return ne ? /* @__PURE__ */ r.jsx("span", { className: `ogx__sort-icon ogx__sort-icon--${ne.sort}`, "aria-hidden": "true" }) : null;
|
|
1811
|
+
}, K = ae.useMemo(() => An(
|
|
1812
1812
|
t,
|
|
1813
1813
|
x,
|
|
1814
1814
|
h,
|
|
@@ -1817,7 +1817,7 @@ function gr(n) {
|
|
|
1817
1817
|
m,
|
|
1818
1818
|
b,
|
|
1819
1819
|
S
|
|
1820
|
-
), [t, x, h, i, v, m, b, S]), C = o ?
|
|
1820
|
+
), [t, x, h, i, v, m, b, S]), C = o ? ur(o) : 0, O = (e ?? t).filter((P) => !P.isSpacer).map((P) => ({
|
|
1821
1821
|
field: P.field,
|
|
1822
1822
|
width: x[P.field] ?? P.width ?? 100
|
|
1823
1823
|
})), D = (S ? 48 : 0) + (m ? 48 : 0) + (i ? 48 : 0);
|
|
@@ -1825,11 +1825,11 @@ function gr(n) {
|
|
|
1825
1825
|
// Outer sticky wrapper — both group rows AND column header row live here
|
|
1826
1826
|
// so they ALL stay sticky together and scroll horizontally as one unit.
|
|
1827
1827
|
/* @__PURE__ */ r.jsxs("div", { className: "ogx__header-wrap", children: [
|
|
1828
|
-
C > 0 && Array.from({ length: C }, (P,
|
|
1829
|
-
const
|
|
1828
|
+
C > 0 && Array.from({ length: C }, (P, ne) => {
|
|
1829
|
+
const te = gr(
|
|
1830
1830
|
o,
|
|
1831
1831
|
O,
|
|
1832
|
-
|
|
1832
|
+
ne
|
|
1833
1833
|
);
|
|
1834
1834
|
return /* @__PURE__ */ r.jsxs("div", { className: "ogx-col-group-row", role: "row", children: [
|
|
1835
1835
|
D > 0 && /* @__PURE__ */ r.jsx(
|
|
@@ -1840,7 +1840,7 @@ function gr(n) {
|
|
|
1840
1840
|
role: "columnheader"
|
|
1841
1841
|
}
|
|
1842
1842
|
),
|
|
1843
|
-
|
|
1843
|
+
te.map((Z) => /* @__PURE__ */ r.jsx(
|
|
1844
1844
|
"div",
|
|
1845
1845
|
{
|
|
1846
1846
|
role: "columnheader",
|
|
@@ -1851,7 +1851,7 @@ function gr(n) {
|
|
|
1851
1851
|
},
|
|
1852
1852
|
Z.key
|
|
1853
1853
|
))
|
|
1854
|
-
] }, `ogx-grp-${
|
|
1854
|
+
] }, `ogx-grp-${ne}`);
|
|
1855
1855
|
}),
|
|
1856
1856
|
/* @__PURE__ */ r.jsxs("div", { className: "ogx__header", role: "row", children: [
|
|
1857
1857
|
S && /* @__PURE__ */ r.jsx(
|
|
@@ -1912,7 +1912,7 @@ function gr(n) {
|
|
|
1912
1912
|
)
|
|
1913
1913
|
}
|
|
1914
1914
|
),
|
|
1915
|
-
t.map((P,
|
|
1915
|
+
t.map((P, ne) => {
|
|
1916
1916
|
if (P.isSpacer)
|
|
1917
1917
|
return /* @__PURE__ */ r.jsx(
|
|
1918
1918
|
"div",
|
|
@@ -1922,10 +1922,10 @@ function gr(n) {
|
|
|
1922
1922
|
},
|
|
1923
1923
|
P.field
|
|
1924
1924
|
);
|
|
1925
|
-
const
|
|
1925
|
+
const te = P.sortable !== !1, Z = d.some((xe) => xe.field === P.field), pe = P.resizable !== !1, $ = zt(P.field, h), ge = $ !== null, de = f === P.field, ve = k === P.field, ce = [
|
|
1926
1926
|
"ogx__header-cell",
|
|
1927
1927
|
`ogx__header-cell--align-${P.headerAlign || P.align || "left"}`,
|
|
1928
|
-
|
|
1928
|
+
te && "ogx__header-cell--sortable",
|
|
1929
1929
|
Z && "ogx__header-cell--sorted",
|
|
1930
1930
|
ge && "ogx__header-cell--pinned",
|
|
1931
1931
|
ge && `ogx__header-cell--pinned-${$}`,
|
|
@@ -1949,12 +1949,12 @@ function gr(n) {
|
|
|
1949
1949
|
const xe = K[P.field];
|
|
1950
1950
|
$ === "left" ? X.left = xe : X.right = xe;
|
|
1951
1951
|
}
|
|
1952
|
-
const
|
|
1952
|
+
const oe = P.renderHeader ? P.renderHeader({ field: P.field, colDef: P, colIndex: ne }) : P.headerName || P.field, ue = (xe) => {
|
|
1953
1953
|
if (xe.target.closest(".ogx-column-resize-handle")) {
|
|
1954
1954
|
xe.stopPropagation();
|
|
1955
1955
|
return;
|
|
1956
1956
|
}
|
|
1957
|
-
E?.(P.field),
|
|
1957
|
+
E?.(P.field), te && U(P)();
|
|
1958
1958
|
}, fe = y ? y(P.field) : void 0, Ie = w ? w(P.field) : void 0, Ve = p ? p(P.field) : void 0;
|
|
1959
1959
|
return /* @__PURE__ */ r.jsxs(
|
|
1960
1960
|
"div",
|
|
@@ -1968,8 +1968,8 @@ function gr(n) {
|
|
|
1968
1968
|
onDragOver: Ie,
|
|
1969
1969
|
onDragEnd: u,
|
|
1970
1970
|
onDrop: Ve,
|
|
1971
|
-
"aria-sort":
|
|
1972
|
-
"aria-colindex":
|
|
1971
|
+
"aria-sort": te ? Z ? d.find((xe) => xe.field === P.field)?.sort === "asc" ? "ascending" : "descending" : "none" : void 0,
|
|
1972
|
+
"aria-colindex": ne + 1 + (i ? 1 : 0),
|
|
1973
1973
|
"data-field": P.field,
|
|
1974
1974
|
tabIndex: -1,
|
|
1975
1975
|
ref: (xe) => {
|
|
@@ -1977,12 +1977,12 @@ function gr(n) {
|
|
|
1977
1977
|
},
|
|
1978
1978
|
children: [
|
|
1979
1979
|
/* @__PURE__ */ r.jsxs("div", { className: "ogx__header-cell-content", children: [
|
|
1980
|
-
de && /* @__PURE__ */ r.jsx("div", { className: "ogx__header-drag-icon", children: /* @__PURE__ */ r.jsx(
|
|
1980
|
+
de && /* @__PURE__ */ r.jsx("div", { className: "ogx__header-drag-icon", children: /* @__PURE__ */ r.jsx(cr, {}) }),
|
|
1981
1981
|
/* @__PURE__ */ r.jsxs("div", { className: "ogx__header-cell-title-wrapper", children: [
|
|
1982
|
-
/* @__PURE__ */ r.jsx("span", { className: "ogx__header-cell-title", children:
|
|
1982
|
+
/* @__PURE__ */ r.jsx("span", { className: "ogx__header-cell-title", children: oe }),
|
|
1983
1983
|
N && N[P.field] && /* @__PURE__ */ r.jsx("span", { className: "ogx__header-cell-aggregation", children: N[P.field] })
|
|
1984
1984
|
] }),
|
|
1985
|
-
|
|
1985
|
+
te && q(P.field),
|
|
1986
1986
|
!P.disableColumnMenu && /* @__PURE__ */ r.jsx(
|
|
1987
1987
|
"button",
|
|
1988
1988
|
{
|
|
@@ -1991,12 +1991,12 @@ function gr(n) {
|
|
|
1991
1991
|
"aria-label": `Open column menu for ${P.headerName || P.field}`,
|
|
1992
1992
|
"aria-haspopup": "menu",
|
|
1993
1993
|
tabIndex: -1,
|
|
1994
|
-
children: /* @__PURE__ */ r.jsx(
|
|
1994
|
+
children: /* @__PURE__ */ r.jsx(dr, {})
|
|
1995
1995
|
}
|
|
1996
1996
|
)
|
|
1997
1997
|
] }),
|
|
1998
1998
|
pe && g && /* @__PURE__ */ r.jsx(
|
|
1999
|
-
|
|
1999
|
+
Zo,
|
|
2000
2000
|
{
|
|
2001
2001
|
field: P.field,
|
|
2002
2002
|
currentWidth: A,
|
|
@@ -2011,7 +2011,7 @@ function gr(n) {
|
|
|
2011
2011
|
);
|
|
2012
2012
|
}),
|
|
2013
2013
|
I && /* @__PURE__ */ r.jsx(
|
|
2014
|
-
|
|
2014
|
+
ar,
|
|
2015
2015
|
{
|
|
2016
2016
|
colDef: I.colDef,
|
|
2017
2017
|
sortModel: d,
|
|
@@ -2055,7 +2055,7 @@ const Ot = ({
|
|
|
2055
2055
|
}
|
|
2056
2056
|
);
|
|
2057
2057
|
};
|
|
2058
|
-
function
|
|
2058
|
+
function $n(n) {
|
|
2059
2059
|
const {
|
|
2060
2060
|
page: t,
|
|
2061
2061
|
pageSize: e,
|
|
@@ -2155,7 +2155,7 @@ function Bn(n) {
|
|
|
2155
2155
|
] })
|
|
2156
2156
|
] });
|
|
2157
2157
|
}
|
|
2158
|
-
function
|
|
2158
|
+
function hr(n, t, e = {}) {
|
|
2159
2159
|
const o = /* @__PURE__ */ new Map(), i = [];
|
|
2160
2160
|
n.forEach((s) => {
|
|
2161
2161
|
o.set(s.id, s), i.push(s.id);
|
|
@@ -2211,7 +2211,7 @@ function fr(n, t, e = {}) {
|
|
|
2211
2211
|
}
|
|
2212
2212
|
};
|
|
2213
2213
|
}
|
|
2214
|
-
function
|
|
2214
|
+
function pr(n, t) {
|
|
2215
2215
|
switch (t.type) {
|
|
2216
2216
|
case "SET_ROWS": {
|
|
2217
2217
|
const e = Array.from(n.rows.idRowsLookup.values()), o = typeof t.payload == "function" ? t.payload(e) : t.payload, i = /* @__PURE__ */ new Map(), l = [];
|
|
@@ -2302,10 +2302,10 @@ function hr(n, t) {
|
|
|
2302
2302
|
return n;
|
|
2303
2303
|
}
|
|
2304
2304
|
}
|
|
2305
|
-
function
|
|
2305
|
+
function xr(n) {
|
|
2306
2306
|
const { rows: t, columns: e, rowHeight: o = 52, headerHeight: i = 56, columnVisibilityModel: l, initialState: a } = n, [s] = Q(
|
|
2307
|
-
() =>
|
|
2308
|
-
), [c, d] =
|
|
2307
|
+
() => hr(t, e, l)
|
|
2308
|
+
), [c, d] = So(pr, {
|
|
2309
2309
|
...s,
|
|
2310
2310
|
sorting: a?.sorting || s.sorting,
|
|
2311
2311
|
filter: a?.filter || s.filter,
|
|
@@ -2409,7 +2409,7 @@ function pr(n) {
|
|
|
2409
2409
|
setRowCount: w
|
|
2410
2410
|
};
|
|
2411
2411
|
}
|
|
2412
|
-
function
|
|
2412
|
+
function mr(n) {
|
|
2413
2413
|
const { onRowOrderChange: t, rows: e, getRowId: o, rowReordering: i = !1 } = n, [l, a] = Q(null), [s, c] = Q(null), d = z((v) => o ? o(v) : v.id, [o]), g = z((v) => (b) => {
|
|
2414
2414
|
i && (a(v), b.dataTransfer.effectAllowed = "move");
|
|
2415
2415
|
}, [i]), x = z((v) => (b) => {
|
|
@@ -2437,7 +2437,7 @@ function xr(n) {
|
|
|
2437
2437
|
onDrop: i ? m : void 0
|
|
2438
2438
|
};
|
|
2439
2439
|
}
|
|
2440
|
-
function
|
|
2440
|
+
function wr(n) {
|
|
2441
2441
|
const {
|
|
2442
2442
|
rows: t,
|
|
2443
2443
|
getRowId: e,
|
|
@@ -2447,7 +2447,7 @@ function mr(n) {
|
|
|
2447
2447
|
filterModel: a,
|
|
2448
2448
|
sortModel: s,
|
|
2449
2449
|
onRowExpansionChange: c
|
|
2450
|
-
} = n, { treeNodes: d, rootIds: g, groupingRows: x } =
|
|
2450
|
+
} = n, { treeNodes: d, rootIds: g, groupingRows: x } = le(() => {
|
|
2451
2451
|
if (!i || !o)
|
|
2452
2452
|
return {
|
|
2453
2453
|
treeNodes: /* @__PURE__ */ new Map(),
|
|
@@ -2513,7 +2513,7 @@ function mr(n) {
|
|
|
2513
2513
|
}
|
|
2514
2514
|
}
|
|
2515
2515
|
}), { treeNodes: y, rootIds: w, groupingRows: u };
|
|
2516
|
-
}, [t, o, i, e]), h =
|
|
2516
|
+
}, [t, o, i, e]), h = le(() => {
|
|
2517
2517
|
if (!i) return /* @__PURE__ */ new Set();
|
|
2518
2518
|
const y = /* @__PURE__ */ new Set();
|
|
2519
2519
|
return d.forEach((w) => {
|
|
@@ -2582,7 +2582,7 @@ function mr(n) {
|
|
|
2582
2582
|
}
|
|
2583
2583
|
return w;
|
|
2584
2584
|
}, [d]);
|
|
2585
|
-
return
|
|
2585
|
+
return le(() => ({
|
|
2586
2586
|
treeNodes: d,
|
|
2587
2587
|
groupingRows: x,
|
|
2588
2588
|
toggleExpansion: b,
|
|
@@ -2592,8 +2592,8 @@ function mr(n) {
|
|
|
2592
2592
|
getNodePath: k
|
|
2593
2593
|
}), [d, x, b, N, S, f, k]);
|
|
2594
2594
|
}
|
|
2595
|
-
const
|
|
2596
|
-
function
|
|
2595
|
+
const vr = (n) => n?.depth === -1 ? "footer" : "inline";
|
|
2596
|
+
function br(n) {
|
|
2597
2597
|
const {
|
|
2598
2598
|
rows: t,
|
|
2599
2599
|
getRowId: e,
|
|
@@ -2602,8 +2602,8 @@ function vr(n) {
|
|
|
2602
2602
|
defaultGroupingExpansionDepth: l = 0,
|
|
2603
2603
|
filterModel: a,
|
|
2604
2604
|
sortModel: s,
|
|
2605
|
-
getAggregationPosition: c =
|
|
2606
|
-
} = n, [d, g] = Q(/* @__PURE__ */ new Set()), { treeNodes: x, rootIds: h, groupingRows: m } =
|
|
2605
|
+
getAggregationPosition: c = vr
|
|
2606
|
+
} = n, [d, g] = Q(/* @__PURE__ */ new Set()), { treeNodes: x, rootIds: h, groupingRows: m } = le(() => {
|
|
2607
2607
|
const f = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new Map(), y = [];
|
|
2608
2608
|
if (o.length === 0)
|
|
2609
2609
|
return { treeNodes: f, rootIds: y, groupingRows: k };
|
|
@@ -2638,7 +2638,7 @@ function vr(n) {
|
|
|
2638
2638
|
else if (V === "max")
|
|
2639
2639
|
q[W] = Math.max(...G.map((D) => Number(D) || 0));
|
|
2640
2640
|
else if (V === "avg") {
|
|
2641
|
-
const D = G.reduce((P,
|
|
2641
|
+
const D = G.reduce((P, ne) => P + (Number(ne) || 0), 0);
|
|
2642
2642
|
q[W] = G.length ? D / G.length : 0;
|
|
2643
2643
|
} else V === "count" && (q[W] = G.length);
|
|
2644
2644
|
});
|
|
@@ -2730,7 +2730,7 @@ function vr(n) {
|
|
|
2730
2730
|
}, p = d;
|
|
2731
2731
|
return u(h), f;
|
|
2732
2732
|
}, [t, e, x, h, m, a, s, d, o]), N = z((f) => x.get(f), [x]);
|
|
2733
|
-
return
|
|
2733
|
+
return le(() => ({
|
|
2734
2734
|
treeNodes: x,
|
|
2735
2735
|
groupingRows: m,
|
|
2736
2736
|
toggleExpansion: v,
|
|
@@ -2739,7 +2739,7 @@ function vr(n) {
|
|
|
2739
2739
|
getNode: N
|
|
2740
2740
|
}), [x, m, v, b, S, N]);
|
|
2741
2741
|
}
|
|
2742
|
-
function
|
|
2742
|
+
function _r(n) {
|
|
2743
2743
|
const {
|
|
2744
2744
|
rows: t,
|
|
2745
2745
|
getRowId: e,
|
|
@@ -2793,7 +2793,7 @@ function br(n) {
|
|
|
2793
2793
|
setEditCellValue: h
|
|
2794
2794
|
};
|
|
2795
2795
|
}
|
|
2796
|
-
function
|
|
2796
|
+
function yr(n, t, e) {
|
|
2797
2797
|
const [o, i] = Q(/* @__PURE__ */ new Map()), [l, a] = Q({
|
|
2798
2798
|
caches: {
|
|
2799
2799
|
spannedCells: {},
|
|
@@ -2823,7 +2823,7 @@ function _r(n, t, e) {
|
|
|
2823
2823
|
} else
|
|
2824
2824
|
p = u.colSpan;
|
|
2825
2825
|
if (p <= 1) {
|
|
2826
|
-
|
|
2826
|
+
at(y, b, u.field, {
|
|
2827
2827
|
spannedByColSpan: !1,
|
|
2828
2828
|
cellProps: { colSpan: 1, width: e[u.field] || 100 }
|
|
2829
2829
|
});
|
|
@@ -2833,13 +2833,13 @@ function _r(n, t, e) {
|
|
|
2833
2833
|
for (let E = 1; E < p; E++)
|
|
2834
2834
|
if (w + E < k) {
|
|
2835
2835
|
const R = t[w + E];
|
|
2836
|
-
R && (j += e[R.field] || 100,
|
|
2836
|
+
R && (j += e[R.field] || 100, at(y, b, R.field, {
|
|
2837
2837
|
spannedByColSpan: !0,
|
|
2838
2838
|
leftVisibleCellIndex: w,
|
|
2839
2839
|
rightVisibleCellIndex: Math.min(w + p - 1, t.length - 1)
|
|
2840
2840
|
}));
|
|
2841
2841
|
}
|
|
2842
|
-
|
|
2842
|
+
at(y, b, u.field, {
|
|
2843
2843
|
spannedByColSpan: !1,
|
|
2844
2844
|
cellProps: { colSpan: p, width: j }
|
|
2845
2845
|
}), w += p - 1;
|
|
@@ -2912,7 +2912,7 @@ function _r(n, t, e) {
|
|
|
2912
2912
|
p = u.colSpan;
|
|
2913
2913
|
if (p <= 1) {
|
|
2914
2914
|
const E = e[u.field] || (typeof u.width == "number" ? u.width : 100);
|
|
2915
|
-
|
|
2915
|
+
at(b, k.id, u.field, {
|
|
2916
2916
|
spannedByColSpan: !1,
|
|
2917
2917
|
cellProps: { colSpan: 1, width: E }
|
|
2918
2918
|
});
|
|
@@ -2924,14 +2924,14 @@ function _r(n, t, e) {
|
|
|
2924
2924
|
const R = t[w + E];
|
|
2925
2925
|
if (R) {
|
|
2926
2926
|
const _ = e[R.field] || (typeof R.width == "number" ? R.width : 100);
|
|
2927
|
-
j += _,
|
|
2927
|
+
j += _, at(b, k.id, R.field, {
|
|
2928
2928
|
spannedByColSpan: !0,
|
|
2929
2929
|
leftVisibleCellIndex: w,
|
|
2930
2930
|
rightVisibleCellIndex: Math.min(w + p - 1, t.length - 1)
|
|
2931
2931
|
});
|
|
2932
2932
|
}
|
|
2933
2933
|
}
|
|
2934
|
-
|
|
2934
|
+
at(b, k.id, u.field, {
|
|
2935
2935
|
spannedByColSpan: !1,
|
|
2936
2936
|
cellProps: { colSpan: p, width: j }
|
|
2937
2937
|
}), w += p - 1;
|
|
@@ -2986,11 +2986,11 @@ function _r(n, t, e) {
|
|
|
2986
2986
|
getHiddenCellOriginMap: v
|
|
2987
2987
|
};
|
|
2988
2988
|
}
|
|
2989
|
-
function
|
|
2989
|
+
function at(n, t, e, o) {
|
|
2990
2990
|
let i = n.get(t);
|
|
2991
2991
|
i || (i = {}, n.set(t, i)), i[e] = o;
|
|
2992
2992
|
}
|
|
2993
|
-
function
|
|
2993
|
+
function Cr(n) {
|
|
2994
2994
|
const {
|
|
2995
2995
|
dataSource: t,
|
|
2996
2996
|
sortModel: e,
|
|
@@ -3089,8 +3089,8 @@ function yr(n) {
|
|
|
3089
3089
|
fetchChildren: N
|
|
3090
3090
|
};
|
|
3091
3091
|
}
|
|
3092
|
-
const
|
|
3093
|
-
function
|
|
3092
|
+
const Dn = "\0", xt = "";
|
|
3093
|
+
function kr(n, t) {
|
|
3094
3094
|
const e = n.filter((o) => o != null && !isNaN(o));
|
|
3095
3095
|
if (e.length === 0) return null;
|
|
3096
3096
|
switch (t) {
|
|
@@ -3107,13 +3107,13 @@ function Cr(n, t) {
|
|
|
3107
3107
|
}
|
|
3108
3108
|
}
|
|
3109
3109
|
function Wt(n, t) {
|
|
3110
|
-
return t.map((e) => String(n[e] ?? "")).join(
|
|
3110
|
+
return t.map((e) => String(n[e] ?? "")).join(Dn);
|
|
3111
3111
|
}
|
|
3112
3112
|
function an(n, t, e, o) {
|
|
3113
|
-
return o ? `${n}${
|
|
3113
|
+
return o ? `${n}${xt}${t}${xt}${e}` : `${t}${xt}${e}`;
|
|
3114
3114
|
}
|
|
3115
|
-
function
|
|
3116
|
-
return
|
|
3115
|
+
function Sr(n, t, e, o) {
|
|
3116
|
+
return le(() => {
|
|
3117
3117
|
const i = { pivotRows: [], pivotColumns: [], colKeys: [], isValid: !1 };
|
|
3118
3118
|
if (!o) return i;
|
|
3119
3119
|
const { rowFields: l, columnFields: a, valueFields: s } = e;
|
|
@@ -3145,7 +3145,7 @@ function kr(n, t, e, o) {
|
|
|
3145
3145
|
const w = f.bucket.get(y);
|
|
3146
3146
|
for (const u of s) {
|
|
3147
3147
|
const p = an(y, u.field, u.aggFn, c), j = w?.get(u.field) ?? [];
|
|
3148
|
-
k[p] = j.length > 0 ?
|
|
3148
|
+
k[p] = j.length > 0 ? kr(j, u.aggFn) : null;
|
|
3149
3149
|
}
|
|
3150
3150
|
}
|
|
3151
3151
|
v.push(k);
|
|
@@ -3155,7 +3155,7 @@ function kr(n, t, e, o) {
|
|
|
3155
3155
|
const k = Wt(f, a);
|
|
3156
3156
|
for (const y of s) {
|
|
3157
3157
|
if (y.aggFn !== "avg" && y.aggFn !== "min" && y.aggFn !== "max") continue;
|
|
3158
|
-
const w = `${k}${
|
|
3158
|
+
const w = `${k}${xt}${y.field}`;
|
|
3159
3159
|
b.has(w) || b.set(w, []);
|
|
3160
3160
|
const u = f[y.field];
|
|
3161
3161
|
u != null && !isNaN(Number(u)) && b.get(w).push(Number(u));
|
|
@@ -3171,7 +3171,7 @@ function kr(n, t, e, o) {
|
|
|
3171
3171
|
S[y] = null;
|
|
3172
3172
|
continue;
|
|
3173
3173
|
}
|
|
3174
|
-
const u = `${f}${
|
|
3174
|
+
const u = `${f}${xt}${k.field}`;
|
|
3175
3175
|
switch (k.aggFn) {
|
|
3176
3176
|
case "sum":
|
|
3177
3177
|
case "count":
|
|
@@ -3202,7 +3202,7 @@ function kr(n, t, e, o) {
|
|
|
3202
3202
|
});
|
|
3203
3203
|
}
|
|
3204
3204
|
for (const f of x) {
|
|
3205
|
-
const k = c ? f.split(
|
|
3205
|
+
const k = c ? f.split(Dn).map((y, w) => {
|
|
3206
3206
|
const u = d.get(a[w]);
|
|
3207
3207
|
return u?.headerName ? `${u.headerName}: ${y}` : y;
|
|
3208
3208
|
}).join(" / ") : "";
|
|
@@ -3227,7 +3227,7 @@ function kr(n, t, e, o) {
|
|
|
3227
3227
|
return { pivotRows: v, pivotColumns: N, colKeys: x, isValid: !0 };
|
|
3228
3228
|
}, [n, t, e, o]);
|
|
3229
3229
|
}
|
|
3230
|
-
function
|
|
3230
|
+
function jr(n) {
|
|
3231
3231
|
const t = document.createElement("textarea");
|
|
3232
3232
|
t.value = n, t.style.cssText = "position:fixed;top:-9999px;left:-9999px;opacity:0;", document.body.appendChild(t), t.focus(), t.select();
|
|
3233
3233
|
let e = !1;
|
|
@@ -3238,10 +3238,10 @@ function Sr(n) {
|
|
|
3238
3238
|
}
|
|
3239
3239
|
return e;
|
|
3240
3240
|
}
|
|
3241
|
-
async function
|
|
3241
|
+
async function Rr(n) {
|
|
3242
3242
|
let t = !1;
|
|
3243
3243
|
try {
|
|
3244
|
-
t =
|
|
3244
|
+
t = jr(n);
|
|
3245
3245
|
} catch {
|
|
3246
3246
|
}
|
|
3247
3247
|
if (navigator.clipboard && typeof navigator.clipboard.writeText == "function")
|
|
@@ -3255,7 +3255,7 @@ async function jr(n) {
|
|
|
3255
3255
|
else if (!t)
|
|
3256
3256
|
throw new Error("Clipboard API not available and fallback failed.");
|
|
3257
3257
|
}
|
|
3258
|
-
function
|
|
3258
|
+
function Er(n) {
|
|
3259
3259
|
const { selectedRowIds: t, columns: e, getVisibleRows: o, getRowId: i } = n, l = z(async () => {
|
|
3260
3260
|
if (t.size === 0) return;
|
|
3261
3261
|
const s = o().filter((h) => t.has(i(h)));
|
|
@@ -3269,7 +3269,7 @@ function Rr(n) {
|
|
|
3269
3269
|
`), x = `${d}
|
|
3270
3270
|
${g}`;
|
|
3271
3271
|
try {
|
|
3272
|
-
await
|
|
3272
|
+
await Rr(x);
|
|
3273
3273
|
} catch (h) {
|
|
3274
3274
|
console.error("[OpenGridX] Failed to copy to clipboard:", h);
|
|
3275
3275
|
}
|
|
@@ -3283,7 +3283,7 @@ ${g}`;
|
|
|
3283
3283
|
return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
|
|
3284
3284
|
}, [l]), { copySelectedRows: l };
|
|
3285
3285
|
}
|
|
3286
|
-
function
|
|
3286
|
+
function Nr({
|
|
3287
3287
|
row: n,
|
|
3288
3288
|
rowIndex: t,
|
|
3289
3289
|
listViewColumn: e,
|
|
@@ -3327,7 +3327,7 @@ function Er({
|
|
|
3327
3327
|
}
|
|
3328
3328
|
);
|
|
3329
3329
|
}
|
|
3330
|
-
function
|
|
3330
|
+
function Mr({
|
|
3331
3331
|
ariaLabel: n,
|
|
3332
3332
|
allRenderableRows: t,
|
|
3333
3333
|
filteredRows: e,
|
|
@@ -3348,7 +3348,7 @@ function Nr({
|
|
|
3348
3348
|
onSelectionChange: N,
|
|
3349
3349
|
onPaginationModelChange: f
|
|
3350
3350
|
}) {
|
|
3351
|
-
const k = v ||
|
|
3351
|
+
const k = v || $n, y = x === "server" && h ? m || 0 : e.length;
|
|
3352
3352
|
return /* @__PURE__ */ r.jsxs(
|
|
3353
3353
|
"div",
|
|
3354
3354
|
{
|
|
@@ -3371,7 +3371,7 @@ function Nr({
|
|
|
3371
3371
|
] }),
|
|
3372
3372
|
c
|
|
3373
3373
|
] }) : t.map((w, u) => /* @__PURE__ */ r.jsx(
|
|
3374
|
-
|
|
3374
|
+
Nr,
|
|
3375
3375
|
{
|
|
3376
3376
|
row: w,
|
|
3377
3377
|
rowIndex: u,
|
|
@@ -3400,7 +3400,7 @@ function Nr({
|
|
|
3400
3400
|
}
|
|
3401
3401
|
);
|
|
3402
3402
|
}
|
|
3403
|
-
function
|
|
3403
|
+
function Ir({ value: n, onValueChange: t, onCommit: e, onCancel: o }) {
|
|
3404
3404
|
const [i, l] = Q(String(n ?? "")), a = J(null);
|
|
3405
3405
|
return re(() => {
|
|
3406
3406
|
a.current?.focus(), a.current?.select();
|
|
@@ -3421,7 +3421,7 @@ function Mr({ value: n, onValueChange: t, onCommit: e, onCancel: o }) {
|
|
|
3421
3421
|
}
|
|
3422
3422
|
);
|
|
3423
3423
|
}
|
|
3424
|
-
function
|
|
3424
|
+
function Pr({ value: n, onValueChange: t, onCommit: e, onCancel: o }) {
|
|
3425
3425
|
const [i, l] = Q(typeof n == "number" ? n : ""), a = J(null);
|
|
3426
3426
|
return re(() => {
|
|
3427
3427
|
a.current?.focus(), a.current?.select();
|
|
@@ -3443,7 +3443,7 @@ function Ir({ value: n, onValueChange: t, onCommit: e, onCancel: o }) {
|
|
|
3443
3443
|
}
|
|
3444
3444
|
);
|
|
3445
3445
|
}
|
|
3446
|
-
function
|
|
3446
|
+
function Lr({ value: n, onValueChange: t, onCommit: e, onCancel: o }) {
|
|
3447
3447
|
const i = J(null);
|
|
3448
3448
|
re(() => {
|
|
3449
3449
|
i.current?.focus();
|
|
@@ -3465,7 +3465,7 @@ function Pr({ value: n, onValueChange: t, onCommit: e, onCancel: o }) {
|
|
|
3465
3465
|
}
|
|
3466
3466
|
) });
|
|
3467
3467
|
}
|
|
3468
|
-
function
|
|
3468
|
+
function Tr({ value: n, colDef: t, onValueChange: e, onCommit: o, onCancel: i }) {
|
|
3469
3469
|
const l = J(null);
|
|
3470
3470
|
re(() => {
|
|
3471
3471
|
l.current?.focus();
|
|
@@ -3491,7 +3491,7 @@ function Lr({ value: n, colDef: t, onValueChange: e, onCommit: o, onCancel: i })
|
|
|
3491
3491
|
}
|
|
3492
3492
|
);
|
|
3493
3493
|
}
|
|
3494
|
-
function
|
|
3494
|
+
function Or({ value: n, onValueChange: t, onCommit: e, onCancel: o }) {
|
|
3495
3495
|
const [i, l] = Q(typeof n == "string" ? n : String(n ?? "")), a = J(null);
|
|
3496
3496
|
return re(() => {
|
|
3497
3497
|
a.current?.focus();
|
|
@@ -3512,22 +3512,22 @@ function Tr({ value: n, onValueChange: t, onCommit: e, onCancel: o }) {
|
|
|
3512
3512
|
}
|
|
3513
3513
|
);
|
|
3514
3514
|
}
|
|
3515
|
-
function
|
|
3515
|
+
function Wr(n) {
|
|
3516
3516
|
const { colDef: t } = n;
|
|
3517
3517
|
switch (t.type) {
|
|
3518
3518
|
case "number":
|
|
3519
|
-
return /* @__PURE__ */ r.jsx("div", { className: "ogx__edit-cell", children: /* @__PURE__ */ r.jsx(Ir, { ...n }) });
|
|
3520
|
-
case "boolean":
|
|
3521
3519
|
return /* @__PURE__ */ r.jsx("div", { className: "ogx__edit-cell", children: /* @__PURE__ */ r.jsx(Pr, { ...n }) });
|
|
3522
|
-
case "
|
|
3520
|
+
case "boolean":
|
|
3523
3521
|
return /* @__PURE__ */ r.jsx("div", { className: "ogx__edit-cell", children: /* @__PURE__ */ r.jsx(Lr, { ...n }) });
|
|
3524
|
-
case "
|
|
3522
|
+
case "singleSelect":
|
|
3525
3523
|
return /* @__PURE__ */ r.jsx("div", { className: "ogx__edit-cell", children: /* @__PURE__ */ r.jsx(Tr, { ...n }) });
|
|
3524
|
+
case "date":
|
|
3525
|
+
return /* @__PURE__ */ r.jsx("div", { className: "ogx__edit-cell", children: /* @__PURE__ */ r.jsx(Or, { ...n }) });
|
|
3526
3526
|
default:
|
|
3527
|
-
return /* @__PURE__ */ r.jsx("div", { className: "ogx__edit-cell", children: /* @__PURE__ */ r.jsx(
|
|
3527
|
+
return /* @__PURE__ */ r.jsx("div", { className: "ogx__edit-cell", children: /* @__PURE__ */ r.jsx(Ir, { ...n }) });
|
|
3528
3528
|
}
|
|
3529
3529
|
}
|
|
3530
|
-
function
|
|
3530
|
+
function Fr(n) {
|
|
3531
3531
|
const {
|
|
3532
3532
|
onCellClick: t,
|
|
3533
3533
|
onCellEditStart: e,
|
|
@@ -3552,13 +3552,13 @@ function Wr(n) {
|
|
|
3552
3552
|
colSpanInfo: w,
|
|
3553
3553
|
rowSpan: u,
|
|
3554
3554
|
isHiddenByRowSpan: p
|
|
3555
|
-
} = n, j =
|
|
3555
|
+
} = n, j = ae.useCallback((C) => {
|
|
3556
3556
|
o ? o(a.field, C) : y?.(C);
|
|
3557
|
-
}, [o, y, a.field]), E =
|
|
3557
|
+
}, [o, y, a.field]), E = ae.useMemo(() => a.valueFormatter ? a.valueFormatter({
|
|
3558
3558
|
value: i,
|
|
3559
3559
|
row: l,
|
|
3560
3560
|
field: a.field
|
|
3561
|
-
}) : i == null ? "" : String(i), [i, l, a]), R =
|
|
3561
|
+
}) : i == null ? "" : String(i), [i, l, a]), R = ae.useMemo(() => N && (o || y) && k ? a.renderEditCell ? a.renderEditCell({
|
|
3562
3562
|
value: i,
|
|
3563
3563
|
row: l,
|
|
3564
3564
|
field: a.field,
|
|
@@ -3566,7 +3566,7 @@ function Wr(n) {
|
|
|
3566
3566
|
rowIndex: s,
|
|
3567
3567
|
colIndex: c
|
|
3568
3568
|
}) : /* @__PURE__ */ r.jsx(
|
|
3569
|
-
|
|
3569
|
+
Wr,
|
|
3570
3570
|
{
|
|
3571
3571
|
value: i,
|
|
3572
3572
|
row: l,
|
|
@@ -3585,8 +3585,8 @@ function Wr(n) {
|
|
|
3585
3585
|
colDef: a,
|
|
3586
3586
|
rowIndex: s,
|
|
3587
3587
|
colIndex: c
|
|
3588
|
-
}) : E, [i, l, a, s, c, E, N, j, k, o, y]), _ =
|
|
3589
|
-
if (
|
|
3588
|
+
}) : E, [i, l, a, s, c, E, N, j, k, o, y]), _ = ae.useMemo(() => a.cellClassName ? typeof a.cellClassName == "function" ? a.cellClassName({ value: i, row: l, field: a.field, colDef: a, rowIndex: s, colIndex: c }) || "" : a.cellClassName : "", [a, i, l, s, c]), M = ae.useRef(null);
|
|
3589
|
+
if (ae.useLayoutEffect(() => {
|
|
3590
3590
|
v && M.current && M.current.focus({ preventScroll: !0 });
|
|
3591
3591
|
}, [v]), w?.spannedByColSpan)
|
|
3592
3592
|
return null;
|
|
@@ -3657,7 +3657,7 @@ function Wr(n) {
|
|
|
3657
3657
|
}
|
|
3658
3658
|
);
|
|
3659
3659
|
}
|
|
3660
|
-
const
|
|
3660
|
+
const Ar = ae.memo(Fr), zr = ({ className: n = "", ...t }) => /* @__PURE__ */ r.jsx(
|
|
3661
3661
|
"button",
|
|
3662
3662
|
{
|
|
3663
3663
|
type: "button",
|
|
@@ -3667,7 +3667,7 @@ const Fr = se.memo(Wr), Ar = ({ className: n = "", ...t }) => /* @__PURE__ */ r.
|
|
|
3667
3667
|
children: /* @__PURE__ */ r.jsx("svg", { viewBox: "0 0 24 24", width: "20", height: "20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ r.jsx("path", { d: "M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" }) })
|
|
3668
3668
|
}
|
|
3669
3669
|
);
|
|
3670
|
-
function
|
|
3670
|
+
function Br(n) {
|
|
3671
3671
|
const { content: t, height: e, isExpanded: o } = n;
|
|
3672
3672
|
if (!o)
|
|
3673
3673
|
return null;
|
|
@@ -3713,11 +3713,11 @@ function dn(n) {
|
|
|
3713
3713
|
colspanMap: H,
|
|
3714
3714
|
rowSpanningCaches: L,
|
|
3715
3715
|
rowHeight: U = 52
|
|
3716
|
-
} = n, q =
|
|
3717
|
-
|
|
3716
|
+
} = n, q = ae.useRef(null), K = ae.useRef(null);
|
|
3717
|
+
ae.useLayoutEffect(() => {
|
|
3718
3718
|
I === "__expand_col__" && q.current && q.current.focus({ preventScroll: !0 }), I === "__checkbox_col__" && K.current && K.current.focus({ preventScroll: !0 });
|
|
3719
3719
|
}, [I]);
|
|
3720
|
-
const C =
|
|
3720
|
+
const C = ae.useMemo(() => An(
|
|
3721
3721
|
e,
|
|
3722
3722
|
d,
|
|
3723
3723
|
g,
|
|
@@ -3726,11 +3726,11 @@ function dn(n) {
|
|
|
3726
3726
|
h,
|
|
3727
3727
|
f,
|
|
3728
3728
|
k
|
|
3729
|
-
), [e, d, g, l, N, h, f, k]), B = t._hasChildren === !0, O =
|
|
3729
|
+
), [e, d, g, l, N, h, f, k]), B = t._hasChildren === !0, O = ae.useCallback(($, ge) => {
|
|
3730
3730
|
B || _?.({ id: t.id, field: $, value: ge });
|
|
3731
|
-
}, [B, t.id, _]), W =
|
|
3731
|
+
}, [B, t.id, _]), W = ae.useCallback(($, ge) => {
|
|
3732
3732
|
T?.({ id: t.id, field: $, value: ge });
|
|
3733
|
-
}, [T, t.id]), V =
|
|
3733
|
+
}, [T, t.id]), V = ae.useCallback(($) => {
|
|
3734
3734
|
M?.({ cancel: $ });
|
|
3735
3735
|
}, [M]);
|
|
3736
3736
|
if (t._isSkeleton) {
|
|
@@ -3752,12 +3752,12 @@ function dn(n) {
|
|
|
3752
3752
|
$.stopPropagation(), c?.(t.id, $.target.checked);
|
|
3753
3753
|
}, P = ($) => {
|
|
3754
3754
|
$.stopPropagation(), v?.(t.id);
|
|
3755
|
-
},
|
|
3755
|
+
}, ne = cn(t.id, x), te = ne === "top", Z = ne === "bottom", pe = [
|
|
3756
3756
|
"ogx__row",
|
|
3757
3757
|
i && "ogx__row--selected",
|
|
3758
3758
|
o % 2 === 0 && "ogx__row--even",
|
|
3759
3759
|
o % 2 === 1 && "ogx__row--odd",
|
|
3760
|
-
|
|
3760
|
+
te && "ogx__row--pinned-top",
|
|
3761
3761
|
Z && "ogx__row--pinned-bottom",
|
|
3762
3762
|
j && "ogx__row--dragging",
|
|
3763
3763
|
E && "ogx__row--drag-over",
|
|
@@ -3797,7 +3797,7 @@ function dn(n) {
|
|
|
3797
3797
|
onDragStart: y ? y(t.id) : void 0,
|
|
3798
3798
|
onDragEnd: u,
|
|
3799
3799
|
onClick: ($) => $.stopPropagation(),
|
|
3800
|
-
children: /* @__PURE__ */ r.jsx(
|
|
3800
|
+
children: /* @__PURE__ */ r.jsx(zr, {})
|
|
3801
3801
|
}
|
|
3802
3802
|
),
|
|
3803
3803
|
h && /* @__PURE__ */ r.jsx(
|
|
@@ -3825,7 +3825,7 @@ function dn(n) {
|
|
|
3825
3825
|
});
|
|
3826
3826
|
},
|
|
3827
3827
|
children: /* @__PURE__ */ r.jsx(
|
|
3828
|
-
|
|
3828
|
+
zn,
|
|
3829
3829
|
{
|
|
3830
3830
|
isExpanded: m,
|
|
3831
3831
|
onClick: P,
|
|
@@ -3881,11 +3881,11 @@ function dn(n) {
|
|
|
3881
3881
|
},
|
|
3882
3882
|
$.field
|
|
3883
3883
|
);
|
|
3884
|
-
const de = $.valueGetter ? $.valueGetter({ row: t, field: $.field, value: t[$.field] }) : t[$.field], ve = d[$.field] ?? $.width, ce = zt($.field, g), A = ce ? C[$.field] : void 0, X = R?.id === t.id && R?.field === $.field,
|
|
3884
|
+
const de = $.valueGetter ? $.valueGetter({ row: t, field: $.field, value: t[$.field] }) : t[$.field], ve = d[$.field] ?? $.width, ce = zt($.field, g), A = ce ? C[$.field] : void 0, X = R?.id === t.id && R?.field === $.field, oe = X ? R?.value : de, ue = H?.get(t.id)?.[$.field], fe = L?.spannedCells[t.id]?.[$.field], Ie = L?.hiddenCells[t.id]?.[$.field] || !1;
|
|
3885
3885
|
return /* @__PURE__ */ r.jsx(
|
|
3886
|
-
|
|
3886
|
+
Ar,
|
|
3887
3887
|
{
|
|
3888
|
-
value:
|
|
3888
|
+
value: oe,
|
|
3889
3889
|
row: t,
|
|
3890
3890
|
colDef: $,
|
|
3891
3891
|
rowIndex: o,
|
|
@@ -3913,7 +3913,7 @@ function dn(n) {
|
|
|
3913
3913
|
}
|
|
3914
3914
|
),
|
|
3915
3915
|
h && /* @__PURE__ */ r.jsx(
|
|
3916
|
-
|
|
3916
|
+
Br,
|
|
3917
3917
|
{
|
|
3918
3918
|
row: t,
|
|
3919
3919
|
rowId: t.id,
|
|
@@ -3925,7 +3925,7 @@ function dn(n) {
|
|
|
3925
3925
|
)
|
|
3926
3926
|
] });
|
|
3927
3927
|
}
|
|
3928
|
-
function
|
|
3928
|
+
function On({
|
|
3929
3929
|
rows: n,
|
|
3930
3930
|
position: t,
|
|
3931
3931
|
columns: e,
|
|
@@ -3978,7 +3978,7 @@ function Tn({
|
|
|
3978
3978
|
u.id
|
|
3979
3979
|
)) });
|
|
3980
3980
|
}
|
|
3981
|
-
const
|
|
3981
|
+
const $r = ({
|
|
3982
3982
|
columns: n,
|
|
3983
3983
|
rowHeight: t,
|
|
3984
3984
|
checkboxSelection: e = !1,
|
|
@@ -4048,7 +4048,7 @@ const Br = ({
|
|
|
4048
4048
|
]
|
|
4049
4049
|
}
|
|
4050
4050
|
);
|
|
4051
|
-
function
|
|
4051
|
+
function Dr({
|
|
4052
4052
|
virtualContainerHeight: n,
|
|
4053
4053
|
offsetTop: t,
|
|
4054
4054
|
effectiveLoading: e,
|
|
@@ -4108,7 +4108,7 @@ function $r({
|
|
|
4108
4108
|
role: "rowgroup",
|
|
4109
4109
|
children: [
|
|
4110
4110
|
e && o.length === 0 ? Array.from({ length: 10 }).map((K, C) => /* @__PURE__ */ r.jsx(
|
|
4111
|
-
|
|
4111
|
+
$r,
|
|
4112
4112
|
{
|
|
4113
4113
|
columns: U,
|
|
4114
4114
|
rowHeight: g,
|
|
@@ -4172,13 +4172,13 @@ function $r({
|
|
|
4172
4172
|
}
|
|
4173
4173
|
);
|
|
4174
4174
|
}
|
|
4175
|
-
function
|
|
4175
|
+
function Hr() {
|
|
4176
4176
|
return /* @__PURE__ */ r.jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
4177
4177
|
/* @__PURE__ */ r.jsx("circle", { cx: "11", cy: "11", r: "8" }),
|
|
4178
4178
|
/* @__PURE__ */ r.jsx("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
|
|
4179
4179
|
] });
|
|
4180
4180
|
}
|
|
4181
|
-
function
|
|
4181
|
+
function Gr() {
|
|
4182
4182
|
return /* @__PURE__ */ r.jsxs(
|
|
4183
4183
|
"svg",
|
|
4184
4184
|
{
|
|
@@ -4198,8 +4198,8 @@ function Hr() {
|
|
|
4198
4198
|
}
|
|
4199
4199
|
);
|
|
4200
4200
|
}
|
|
4201
|
-
function
|
|
4202
|
-
const { columns: t, visibleColumns: e, onVisibilityChange: o, onShowAll: i, onHideAll: l, onColumnReorder: a, onColumnOrderReset: s } = n, [c, d] = Q(""), [g, x] = Q(null), h = J(null), v =
|
|
4201
|
+
function Hn(n) {
|
|
4202
|
+
const { columns: t, visibleColumns: e, onVisibilityChange: o, onShowAll: i, onHideAll: l, onColumnReorder: a, onColumnOrderReset: s } = n, [c, d] = Q(""), [g, x] = Q(null), h = J(null), v = le(() => t.filter((u) => u.hideable !== !1), [t]).every((u) => e.has(u.field)), b = le(() => {
|
|
4203
4203
|
if (!c) return t;
|
|
4204
4204
|
const u = c.toLowerCase();
|
|
4205
4205
|
return t.filter(
|
|
@@ -4222,7 +4222,7 @@ function Dn(n) {
|
|
|
4222
4222
|
};
|
|
4223
4223
|
return /* @__PURE__ */ r.jsxs("div", { className: "ogx-column-visibility-panel", children: [
|
|
4224
4224
|
/* @__PURE__ */ r.jsx("div", { className: "ogx-column-visibility-panel__search-section", children: /* @__PURE__ */ r.jsxs("div", { className: "ogx-column-visibility-panel__search-container", children: [
|
|
4225
|
-
/* @__PURE__ */ r.jsx(
|
|
4225
|
+
/* @__PURE__ */ r.jsx(Hr, {}),
|
|
4226
4226
|
/* @__PURE__ */ r.jsx(
|
|
4227
4227
|
"input",
|
|
4228
4228
|
{
|
|
@@ -4259,7 +4259,7 @@ function Dn(n) {
|
|
|
4259
4259
|
draggable: !0,
|
|
4260
4260
|
onDragStart: N(u.field),
|
|
4261
4261
|
title: "Drag to reorder",
|
|
4262
|
-
children: /* @__PURE__ */ r.jsx(
|
|
4262
|
+
children: /* @__PURE__ */ r.jsx(Gr, {})
|
|
4263
4263
|
}
|
|
4264
4264
|
),
|
|
4265
4265
|
/* @__PURE__ */ r.jsxs(
|
|
@@ -4309,7 +4309,7 @@ function Dn(n) {
|
|
|
4309
4309
|
] })
|
|
4310
4310
|
] });
|
|
4311
4311
|
}
|
|
4312
|
-
function
|
|
4312
|
+
function Vr({
|
|
4313
4313
|
isOpen: n,
|
|
4314
4314
|
containerRef: t,
|
|
4315
4315
|
effectiveColumns: e,
|
|
@@ -4379,7 +4379,7 @@ function Gr({
|
|
|
4379
4379
|
}
|
|
4380
4380
|
),
|
|
4381
4381
|
/* @__PURE__ */ r.jsx(
|
|
4382
|
-
|
|
4382
|
+
Hn,
|
|
4383
4383
|
{
|
|
4384
4384
|
columns: e,
|
|
4385
4385
|
visibleColumns: new Set(
|
|
@@ -4409,7 +4409,7 @@ function Gr({
|
|
|
4409
4409
|
b
|
|
4410
4410
|
);
|
|
4411
4411
|
}
|
|
4412
|
-
function
|
|
4412
|
+
function wi(n) {
|
|
4413
4413
|
const {
|
|
4414
4414
|
rows: t,
|
|
4415
4415
|
columns: e,
|
|
@@ -4455,8 +4455,8 @@ function mi(n) {
|
|
|
4455
4455
|
getAggregationPosition: G,
|
|
4456
4456
|
isCellEditable: D,
|
|
4457
4457
|
processRowUpdate: P,
|
|
4458
|
-
onProcessRowUpdateError:
|
|
4459
|
-
dataSource:
|
|
4458
|
+
onProcessRowUpdateError: ne,
|
|
4459
|
+
dataSource: te,
|
|
4460
4460
|
sortingMode: Z = "client",
|
|
4461
4461
|
filterMode: pe = "client",
|
|
4462
4462
|
paginationMode: $ = "client",
|
|
@@ -4466,7 +4466,7 @@ function mi(n) {
|
|
|
4466
4466
|
pivotMode: ce = !1,
|
|
4467
4467
|
pivotModel: A,
|
|
4468
4468
|
onPivotModelChange: X,
|
|
4469
|
-
className:
|
|
4469
|
+
className: oe = "",
|
|
4470
4470
|
style: ue,
|
|
4471
4471
|
onRowsScrollEnd: fe,
|
|
4472
4472
|
ariaLabel: Ie,
|
|
@@ -4480,12 +4480,12 @@ function mi(n) {
|
|
|
4480
4480
|
columnGroupingModel: Be,
|
|
4481
4481
|
noRowsLabel: Bt = "No Data",
|
|
4482
4482
|
apiRef: $t
|
|
4483
|
-
} = n,
|
|
4483
|
+
} = n, Kn = le(() => ({ items: [] }), []), Ne = h || Kn, Yn = le(() => [], []), Dt = O || Yn, hn = J(de?.toolbar);
|
|
4484
4484
|
hn.current = de?.toolbar;
|
|
4485
|
-
const
|
|
4486
|
-
const
|
|
4487
|
-
return
|
|
4488
|
-
}).current,
|
|
4485
|
+
const qn = J((Y) => {
|
|
4486
|
+
const ee = hn.current;
|
|
4487
|
+
return ee ? ee(Y) : null;
|
|
4488
|
+
}).current, Xn = To({
|
|
4489
4489
|
initialState: Ve,
|
|
4490
4490
|
sortModel: v,
|
|
4491
4491
|
aggregationModel: W,
|
|
@@ -4506,7 +4506,7 @@ function mi(n) {
|
|
|
4506
4506
|
aggregationModel: Me,
|
|
4507
4507
|
handleAggregationModelChange: mn,
|
|
4508
4508
|
columnVisibilityModel: $e,
|
|
4509
|
-
handleColumnVisibilityModelChange:
|
|
4509
|
+
handleColumnVisibilityModelChange: mt,
|
|
4510
4510
|
pinnedColumns: We,
|
|
4511
4511
|
handlePinnedColumnsChange: Ht,
|
|
4512
4512
|
currentPivotModel: Gt,
|
|
@@ -4514,24 +4514,30 @@ function mi(n) {
|
|
|
4514
4514
|
effectivePaginationModel: Se,
|
|
4515
4515
|
handlePaginationModelChange: Vt,
|
|
4516
4516
|
selectedRowIds: Ce,
|
|
4517
|
-
isSelectionControlled:
|
|
4518
|
-
setInternalRowSelectionModel:
|
|
4519
|
-
} =
|
|
4517
|
+
isSelectionControlled: wt,
|
|
4518
|
+
setInternalRowSelectionModel: vt
|
|
4519
|
+
} = Xn, bt = d, _t = Sr(t, e, Gt, ce), vn = ce && _t.isValid ? _t.pivotRows : t, Ut = ce && _t.isValid ? _t.pivotColumns : e, [Jn, bn] = Q(null);
|
|
4520
4520
|
re(() => {
|
|
4521
|
-
|
|
4521
|
+
bn(null);
|
|
4522
4522
|
}, [Me]);
|
|
4523
|
-
const Ye = J(null),
|
|
4523
|
+
const Ye = J(null), Qn = J(null), yt = J(null), Zn = z((Y) => Y.id, []), qe = o || Zn, Kt = le(
|
|
4524
|
+
() => vn.map((Y) => {
|
|
4525
|
+
const ee = qe(Y);
|
|
4526
|
+
return ee === Y.id ? Y : { ...Y, id: ee };
|
|
4527
|
+
}),
|
|
4528
|
+
[vn, qe]
|
|
4529
|
+
), Xe = z((Y) => {
|
|
4524
4530
|
sn.current?.classList.toggle("ogx--kb", Y);
|
|
4525
|
-
}, []),
|
|
4526
|
-
|
|
4527
|
-
const
|
|
4528
|
-
if (
|
|
4529
|
-
const
|
|
4530
|
-
|
|
4531
|
+
}, []), _n = J(te);
|
|
4532
|
+
_n.current = te;
|
|
4533
|
+
const yn = J(null), Cn = J(null), eo = z((Y) => {
|
|
4534
|
+
if (_n.current && K && (Y.serverChildrenCount ?? 0) > 0 && (Y.children ?? []).length === 0) {
|
|
4535
|
+
const ee = Cn.current?.getNodePath(Y.id) || [Y.groupingKey];
|
|
4536
|
+
yn.current?.(Y.id, ee);
|
|
4531
4537
|
}
|
|
4532
|
-
}, [K]), ke =
|
|
4533
|
-
rows:
|
|
4534
|
-
columns:
|
|
4538
|
+
}, [K]), ke = xr({
|
|
4539
|
+
rows: Kt,
|
|
4540
|
+
columns: Ut,
|
|
4535
4541
|
rowHeight: i,
|
|
4536
4542
|
headerHeight: l,
|
|
4537
4543
|
rowCount: ge,
|
|
@@ -4539,68 +4545,68 @@ function mi(n) {
|
|
|
4539
4545
|
initialState: n.initialState
|
|
4540
4546
|
}), {
|
|
4541
4547
|
state: he,
|
|
4542
|
-
apiRef:
|
|
4548
|
+
apiRef: Je,
|
|
4543
4549
|
setRows: Yt,
|
|
4544
|
-
setColumns:
|
|
4545
|
-
setDimensions:
|
|
4546
|
-
setDataSourceLoading:
|
|
4547
|
-
setDataSourceError:
|
|
4548
|
-
setRowCount:
|
|
4549
|
-
} = ke, { scrollTop:
|
|
4550
|
+
setColumns: to,
|
|
4551
|
+
setDimensions: kn,
|
|
4552
|
+
setDataSourceLoading: no,
|
|
4553
|
+
setDataSourceError: oo,
|
|
4554
|
+
setRowCount: ro
|
|
4555
|
+
} = ke, { scrollTop: io, scrollLeft: lo, handleScroll: so } = Uo({ onRowsScrollEnd: fe });
|
|
4550
4556
|
re(() => {
|
|
4551
|
-
$t && ($t.current =
|
|
4552
|
-
}, [$t,
|
|
4553
|
-
const { copySelectedRows:
|
|
4557
|
+
$t && ($t.current = Je.current);
|
|
4558
|
+
}, [$t, Je]);
|
|
4559
|
+
const { copySelectedRows: Sn } = Er({
|
|
4554
4560
|
selectedRowIds: Ce,
|
|
4555
|
-
columns:
|
|
4556
|
-
getVisibleRows: () =>
|
|
4557
|
-
getRowId:
|
|
4561
|
+
columns: Ut,
|
|
4562
|
+
getVisibleRows: () => Je.current.getVisibleRows(),
|
|
4563
|
+
getRowId: qe
|
|
4558
4564
|
});
|
|
4559
4565
|
re(() => {
|
|
4560
|
-
|
|
4561
|
-
}, [
|
|
4562
|
-
const
|
|
4563
|
-
rows:
|
|
4564
|
-
getRowId:
|
|
4566
|
+
Je.current.copySelectedRows = Sn, Je.current.getSelectedRows = () => Array.from(Ce);
|
|
4567
|
+
}, [Sn, Ce, Je]);
|
|
4568
|
+
const ao = he.dataSource.loading, ct = q || ao, Qe = le(() => he.rows.allRows.map((Y) => he.rows.idRowsLookup.get(Y)), [he.rows]), qt = wr({
|
|
4569
|
+
rows: Qe,
|
|
4570
|
+
getRowId: qe,
|
|
4565
4571
|
getTreeDataPath: C,
|
|
4566
4572
|
treeData: K,
|
|
4567
4573
|
defaultGroupingExpansionDepth: B,
|
|
4568
4574
|
filterModel: Ne,
|
|
4569
4575
|
sortModel: Oe,
|
|
4570
|
-
onRowExpansionChange:
|
|
4576
|
+
onRowExpansionChange: eo
|
|
4571
4577
|
});
|
|
4572
4578
|
re(() => {
|
|
4573
|
-
|
|
4579
|
+
Cn.current = qt;
|
|
4574
4580
|
}, [qt]);
|
|
4575
|
-
const
|
|
4576
|
-
rows:
|
|
4577
|
-
getRowId:
|
|
4581
|
+
const co = br({
|
|
4582
|
+
rows: Qe,
|
|
4583
|
+
getRowId: qe,
|
|
4578
4584
|
rowGroupingModel: Dt,
|
|
4579
4585
|
aggregationModel: Me,
|
|
4580
4586
|
defaultGroupingExpansionDepth: B,
|
|
4581
4587
|
filterModel: Ne,
|
|
4582
4588
|
sortModel: Oe,
|
|
4583
4589
|
getAggregationPosition: G
|
|
4584
|
-
}),
|
|
4585
|
-
rows:
|
|
4586
|
-
getRowId:
|
|
4590
|
+
}), Ze = _r({
|
|
4591
|
+
rows: Qe,
|
|
4592
|
+
getRowId: qe,
|
|
4587
4593
|
processRowUpdate: P,
|
|
4588
|
-
onProcessRowUpdateError:
|
|
4594
|
+
onProcessRowUpdateError: ne,
|
|
4589
4595
|
onRowChange: (Y) => {
|
|
4590
|
-
const { dispatch:
|
|
4596
|
+
const { dispatch: ee } = ke, we = Array.from(ke.state.rows.idRowsLookup.values()).map(
|
|
4591
4597
|
(me) => me.id === Y.id ? Y : me
|
|
4592
4598
|
);
|
|
4593
|
-
|
|
4599
|
+
ee({ type: "SET_ROWS", payload: we });
|
|
4594
4600
|
}
|
|
4595
|
-
}), Xt = K, Ct = !!(Dt && Dt.length > 0), Jt = Xt || Ct, kt = Xt ? qt : Ct ?
|
|
4596
|
-
const { row:
|
|
4597
|
-
if (Jt &&
|
|
4598
|
-
kt?.toggleExpansion(
|
|
4601
|
+
}), Xt = K, Ct = !!(Dt && Dt.length > 0), Jt = Xt || Ct, kt = Xt ? qt : Ct ? co : null, Pe = S && !Ct, St = z((Y) => {
|
|
4602
|
+
const { row: ee, id: se } = Y;
|
|
4603
|
+
if (Jt && ee._hasChildren) {
|
|
4604
|
+
kt?.toggleExpansion(se);
|
|
4599
4605
|
return;
|
|
4600
4606
|
}
|
|
4601
4607
|
g?.(Y);
|
|
4602
|
-
}, [Jt, kt, g]), Qt =
|
|
4603
|
-
dataSource:
|
|
4608
|
+
}, [Jt, kt, g]), Qt = Cr({
|
|
4609
|
+
dataSource: te,
|
|
4604
4610
|
sortModel: Oe,
|
|
4605
4611
|
filterModel: Ne,
|
|
4606
4612
|
paginationModel: Se,
|
|
@@ -4609,31 +4615,31 @@ function mi(n) {
|
|
|
4609
4615
|
filterMode: pe,
|
|
4610
4616
|
aggregationModel: Me,
|
|
4611
4617
|
setRows: Yt,
|
|
4612
|
-
setRowCount:
|
|
4613
|
-
setDataSourceLoading:
|
|
4614
|
-
setDataSourceError:
|
|
4615
|
-
onAggregationResults:
|
|
4618
|
+
setRowCount: ro,
|
|
4619
|
+
setDataSourceLoading: no,
|
|
4620
|
+
setDataSourceError: oo,
|
|
4621
|
+
onAggregationResults: bn
|
|
4616
4622
|
});
|
|
4617
4623
|
re(() => {
|
|
4618
|
-
Qt.fetchChildren && (
|
|
4624
|
+
Qt.fetchChildren && (yn.current = Qt.fetchChildren);
|
|
4619
4625
|
}, [Qt.fetchChildren]), re(() => {
|
|
4620
|
-
|
|
4621
|
-
}, [
|
|
4622
|
-
const Le = !!p, [
|
|
4623
|
-
const
|
|
4624
|
-
|
|
4625
|
-
}, [
|
|
4626
|
+
te || Yt(Kt);
|
|
4627
|
+
}, [Kt, Yt, te]);
|
|
4628
|
+
const Le = !!p, [uo, go] = Q(/* @__PURE__ */ new Set()), et = E ?? uo, jt = z((Y) => {
|
|
4629
|
+
const ee = new Set(et);
|
|
4630
|
+
ee.has(Y) ? ee.delete(Y) : ee.add(Y), E === void 0 && go(ee), R?.(ee);
|
|
4631
|
+
}, [et, E, R]), {
|
|
4626
4632
|
effectiveColumns: Fe,
|
|
4627
4633
|
orderedColumns: Zt,
|
|
4628
|
-
visibleOrderedColumns:
|
|
4629
|
-
navigationColumns:
|
|
4634
|
+
visibleOrderedColumns: fo,
|
|
4635
|
+
navigationColumns: jn,
|
|
4630
4636
|
columnWidths: Ae,
|
|
4631
4637
|
effectiveColumnOrder: Rt,
|
|
4632
4638
|
setInternalColumnOrder: Et,
|
|
4633
|
-
columnReorderHandlers:
|
|
4634
|
-
handleColumnResize:
|
|
4635
|
-
} =
|
|
4636
|
-
activeColumns:
|
|
4639
|
+
columnReorderHandlers: tt,
|
|
4640
|
+
handleColumnResize: ho
|
|
4641
|
+
} = Go({
|
|
4642
|
+
activeColumns: Ut,
|
|
4637
4643
|
isHierarchyEnabled: Jt,
|
|
4638
4644
|
isRowGrouping: Ct,
|
|
4639
4645
|
isTreeData: Xt,
|
|
@@ -4647,9 +4653,9 @@ function mi(n) {
|
|
|
4647
4653
|
hasDetailPanel: Le,
|
|
4648
4654
|
rowReordering: L,
|
|
4649
4655
|
initialState: Ve,
|
|
4650
|
-
setColumns:
|
|
4656
|
+
setColumns: to
|
|
4651
4657
|
});
|
|
4652
|
-
|
|
4658
|
+
Ko({
|
|
4653
4659
|
onStateChange: xe,
|
|
4654
4660
|
sortModel: Oe,
|
|
4655
4661
|
filterModel: Ne,
|
|
@@ -4659,12 +4665,12 @@ function mi(n) {
|
|
|
4659
4665
|
columnVisibilityModel: $e,
|
|
4660
4666
|
pinnedColumns: We
|
|
4661
4667
|
});
|
|
4662
|
-
const
|
|
4663
|
-
effectiveRows:
|
|
4668
|
+
const nt = $o({
|
|
4669
|
+
effectiveRows: Qe,
|
|
4664
4670
|
activeHierarchyHandlers: kt,
|
|
4665
4671
|
filterMode: pe,
|
|
4666
4672
|
filterModel: Ne,
|
|
4667
|
-
dataSource:
|
|
4673
|
+
dataSource: te,
|
|
4668
4674
|
sortModel: Oe,
|
|
4669
4675
|
sortingMode: Z,
|
|
4670
4676
|
pagination: Pe,
|
|
@@ -4673,41 +4679,41 @@ function mi(n) {
|
|
|
4673
4679
|
pinnedRows: u,
|
|
4674
4680
|
isLoading: he.dataSource.loading,
|
|
4675
4681
|
pageSize: Se.pageSize
|
|
4676
|
-
}), De =
|
|
4682
|
+
}), De = nt.filteredRows, en = nt.pinnedTopRows, tn = nt.pinnedBottomRows, ot = nt.sortedUnpinnedRows, ut = nt.paginatedUnpinnedRows, nn = nt.allRenderableRows;
|
|
4677
4683
|
re(() => {
|
|
4678
|
-
ke.apiRef.current.getVisibleRows = () => Pe ?
|
|
4679
|
-
}, [
|
|
4680
|
-
const
|
|
4681
|
-
rows: Pe ?
|
|
4684
|
+
ke.apiRef.current.getVisibleRows = () => Pe ? ut : ot, ke.apiRef.current.getVisibleColumns = () => Fe;
|
|
4685
|
+
}, [ot, ut, Pe, Fe, ke.apiRef]);
|
|
4686
|
+
const po = mr({
|
|
4687
|
+
rows: Pe ? ut : ot,
|
|
4682
4688
|
getRowId: (Y) => Y.id,
|
|
4683
4689
|
onRowOrderChange: U,
|
|
4684
4690
|
rowReordering: L
|
|
4685
|
-
}),
|
|
4691
|
+
}), rt = yr(
|
|
4686
4692
|
nn,
|
|
4687
|
-
|
|
4693
|
+
jn,
|
|
4688
4694
|
Ae
|
|
4689
|
-
), { aggregationResult: on } =
|
|
4695
|
+
), { aggregationResult: on } = qo({
|
|
4690
4696
|
rows: De,
|
|
4691
4697
|
aggregationModel: Me,
|
|
4692
|
-
isServerSide: !!(
|
|
4693
|
-
dataSource:
|
|
4698
|
+
isServerSide: !!(te && ($ === "server" || Z === "server")),
|
|
4699
|
+
dataSource: te,
|
|
4694
4700
|
filterModel: Ne,
|
|
4695
4701
|
sortModel: Oe,
|
|
4696
|
-
serverAggregationResults:
|
|
4702
|
+
serverAggregationResults: Jn
|
|
4697
4703
|
}), Nt = Object.keys(Me).length > 0;
|
|
4698
4704
|
re(() => {
|
|
4699
4705
|
ke.apiRef.current.getAggregationResult = () => Nt ? on : null, ke.apiRef.current.getAggregationModel = () => Nt ? Me : null;
|
|
4700
4706
|
}, [on, Me, Nt, ke.apiRef]);
|
|
4701
|
-
const je =
|
|
4707
|
+
const je = Io({
|
|
4702
4708
|
rowHeight: i,
|
|
4703
4709
|
pagination: Pe,
|
|
4704
|
-
paginatedUnpinnedRows:
|
|
4705
|
-
sortedUnpinnedRows:
|
|
4706
|
-
expandedRowIds:
|
|
4710
|
+
paginatedUnpinnedRows: ut,
|
|
4711
|
+
sortedUnpinnedRows: ot,
|
|
4712
|
+
expandedRowIds: et,
|
|
4707
4713
|
getDetailPanelHeight: j,
|
|
4708
4714
|
pinnedTopRowsLength: en.length,
|
|
4709
4715
|
pinnedBottomRowsLength: tn.length,
|
|
4710
|
-
visibleOrderedColumns:
|
|
4716
|
+
visibleOrderedColumns: fo,
|
|
4711
4717
|
pinnedColumns: We,
|
|
4712
4718
|
columnWidths: Ae,
|
|
4713
4719
|
viewportWidth: he.dimensions.viewportWidth || 1e3,
|
|
@@ -4719,28 +4725,28 @@ function mi(n) {
|
|
|
4719
4725
|
pageSize: Se.pageSize
|
|
4720
4726
|
});
|
|
4721
4727
|
re(() => {
|
|
4722
|
-
ke.apiRef.current.scrollToIndexes = ({ rowIndex: Y, colIndex:
|
|
4723
|
-
const
|
|
4724
|
-
if (
|
|
4728
|
+
ke.apiRef.current.scrollToIndexes = ({ rowIndex: Y, colIndex: ee }) => {
|
|
4729
|
+
const se = Ye.current;
|
|
4730
|
+
if (se) {
|
|
4725
4731
|
if (Y !== void 0 && Y >= 0) {
|
|
4726
|
-
const we = Y > 0 ? je.cumulativeHeights[Y - 1] : 0, me = je.cumulativeHeights[Y] ?? we, { scrollTop: be, clientHeight: _e } =
|
|
4727
|
-
we < be ?
|
|
4732
|
+
const we = Y > 0 ? je.cumulativeHeights[Y - 1] : 0, me = je.cumulativeHeights[Y] ?? we, { scrollTop: be, clientHeight: _e } = se;
|
|
4733
|
+
we < be ? se.scrollTop = we : me > be + _e && (se.scrollTop = me - _e);
|
|
4728
4734
|
}
|
|
4729
|
-
if (
|
|
4730
|
-
const me = [...je.leftPinnedCols, ...je.unpinnedColsWithWidth, ...je.rightPinnedCols][
|
|
4735
|
+
if (ee !== void 0 && ee >= 0) {
|
|
4736
|
+
const me = [...je.leftPinnedCols, ...je.unpinnedColsWithWidth, ...je.rightPinnedCols][ee];
|
|
4731
4737
|
if (!me) return;
|
|
4732
|
-
const be = je.unpinnedColsWithWidth.findIndex((
|
|
4738
|
+
const be = je.unpinnedColsWithWidth.findIndex((ko) => ko.field === me.field);
|
|
4733
4739
|
if (be === -1) return;
|
|
4734
|
-
const _e = be > 0 ? je.unpinnedAccWidths[be - 1] : 0, Pt = je.unpinnedAccWidths[be] ?? _e, Lt = je.leftWidth + Pt, { scrollLeft:
|
|
4735
|
-
_e <
|
|
4740
|
+
const _e = be > 0 ? je.unpinnedAccWidths[be - 1] : 0, Pt = je.unpinnedAccWidths[be] ?? _e, Lt = je.leftWidth + Pt, { scrollLeft: Mn, clientWidth: In } = se;
|
|
4741
|
+
_e < Mn ? se.scrollLeft = _e : Lt > Mn + In && (se.scrollLeft = Lt - In);
|
|
4736
4742
|
}
|
|
4737
4743
|
}
|
|
4738
4744
|
};
|
|
4739
4745
|
}, [je, Ye, ke.apiRef]);
|
|
4740
|
-
const Re =
|
|
4746
|
+
const Re = Do({
|
|
4741
4747
|
layout: je,
|
|
4742
|
-
scrollTop:
|
|
4743
|
-
scrollLeft:
|
|
4748
|
+
scrollTop: io,
|
|
4749
|
+
scrollLeft: lo,
|
|
4744
4750
|
viewportWidth: he.dimensions.viewportWidth,
|
|
4745
4751
|
viewportHeight: he.dimensions.viewportHeight,
|
|
4746
4752
|
autoHeight: a,
|
|
@@ -4752,65 +4758,65 @@ function mi(n) {
|
|
|
4752
4758
|
});
|
|
4753
4759
|
re(() => {
|
|
4754
4760
|
if (!Ye.current) return;
|
|
4755
|
-
const Y = new ResizeObserver((
|
|
4756
|
-
for (const
|
|
4757
|
-
const { width: we, height: me } =
|
|
4758
|
-
|
|
4761
|
+
const Y = new ResizeObserver((ee) => {
|
|
4762
|
+
for (const se of ee) {
|
|
4763
|
+
const { width: we, height: me } = se.contentRect;
|
|
4764
|
+
kn(we, me);
|
|
4759
4765
|
}
|
|
4760
4766
|
});
|
|
4761
4767
|
return Y.observe(Ye.current), () => {
|
|
4762
4768
|
Y.disconnect();
|
|
4763
4769
|
};
|
|
4764
|
-
}, [
|
|
4765
|
-
const
|
|
4766
|
-
const
|
|
4767
|
-
|
|
4768
|
-
const we = Array.from(
|
|
4769
|
-
|
|
4770
|
-
}, [Ce,
|
|
4771
|
-
let
|
|
4772
|
-
Y && (
|
|
4773
|
-
}, [
|
|
4774
|
-
const
|
|
4775
|
-
pn || xn(
|
|
4776
|
-
}, [pn, b, xn]), { focusedCell: Mt, setFocusedCell: rn, handleFocus:
|
|
4770
|
+
}, [kn]);
|
|
4771
|
+
const gt = z((Y, ee) => {
|
|
4772
|
+
const se = new Set(Ce);
|
|
4773
|
+
ee ? se.add(Y) : se.delete(Y);
|
|
4774
|
+
const we = Array.from(se);
|
|
4775
|
+
wt || vt(we), bt?.(we);
|
|
4776
|
+
}, [Ce, wt, bt, vt]), xo = z((Y) => {
|
|
4777
|
+
let ee = [];
|
|
4778
|
+
Y && (ee = Qe.map((se) => se.id)), wt || vt(ee), bt?.(ee);
|
|
4779
|
+
}, [Qe, wt, bt, vt]), Rn = z((Y, ee) => {
|
|
4780
|
+
const se = ee ? [{ field: Y, sort: ee }] : [];
|
|
4781
|
+
pn || xn(se), b?.(se);
|
|
4782
|
+
}, [pn, b, xn]), { focusedCell: Mt, setFocusedCell: rn, handleFocus: mo, handleBlur: wo, handleKeyDown: vo } = Po({
|
|
4777
4783
|
allRenderableRows: nn,
|
|
4778
|
-
navigationColumns:
|
|
4784
|
+
navigationColumns: jn,
|
|
4779
4785
|
checkboxSelection: s,
|
|
4780
4786
|
selectedRowIds: Ce,
|
|
4781
|
-
handleSelectionChange:
|
|
4787
|
+
handleSelectionChange: gt,
|
|
4782
4788
|
handleDetailPanelToggle: jt,
|
|
4783
|
-
editingHandlers:
|
|
4784
|
-
setKeyboardMode:
|
|
4789
|
+
editingHandlers: Ze,
|
|
4790
|
+
setKeyboardMode: Xe,
|
|
4785
4791
|
sortModel: Oe,
|
|
4786
|
-
handleSort:
|
|
4792
|
+
handleSort: Rn,
|
|
4787
4793
|
isCellEditable: D,
|
|
4788
4794
|
pagination: Pe,
|
|
4789
4795
|
pageSize: Se.pageSize,
|
|
4790
4796
|
virtualization: Re,
|
|
4791
4797
|
viewportRef: Ye
|
|
4792
4798
|
}), ln = z((Y) => {
|
|
4793
|
-
|
|
4794
|
-
}, [x,
|
|
4799
|
+
Xe(!1), rn({ id: Y.row.id, field: Y.field }), yt.current?.focus({ preventScroll: !0 }), x?.(Y);
|
|
4800
|
+
}, [x, Xe, rn]), En = J(Ze.editingCell);
|
|
4795
4801
|
re(() => {
|
|
4796
|
-
const Y = !!
|
|
4797
|
-
Y && !
|
|
4798
|
-
}, [
|
|
4799
|
-
const
|
|
4802
|
+
const Y = !!En.current, ee = !!Ze.editingCell;
|
|
4803
|
+
Y && !ee && yt.current?.focus({ preventScroll: !0 }), En.current = Ze.editingCell;
|
|
4804
|
+
}, [Ze.editingCell]);
|
|
4805
|
+
const bo = Vo({
|
|
4800
4806
|
renderContext: Re.renderContext,
|
|
4801
4807
|
pinnedTopRows: en,
|
|
4802
4808
|
pinnedBottomRows: tn,
|
|
4803
|
-
paginatedUnpinnedRows:
|
|
4804
|
-
sortedUnpinnedRows:
|
|
4809
|
+
paginatedUnpinnedRows: ut,
|
|
4810
|
+
sortedUnpinnedRows: ot,
|
|
4805
4811
|
pagination: Pe
|
|
4806
|
-
}),
|
|
4812
|
+
}), _o = t.length > 0 && Ce.size === t.length, yo = Ce.size > 0 && Ce.size < t.length, Co = ae.useMemo(() => Fe.some((Y) => !!Y.rowSpan), [Fe]), [ft, It] = ae.useState(!1), sn = ae.useRef(null), Nn = ae.useMemo(() => {
|
|
4807
4813
|
if (!de?.toolbar) return null;
|
|
4808
|
-
const Y = T ? void 0 : (
|
|
4809
|
-
const we = [...Rt], me = we.indexOf(
|
|
4814
|
+
const Y = T ? void 0 : (ee, se) => {
|
|
4815
|
+
const we = [...Rt], me = we.indexOf(ee), be = we.indexOf(se);
|
|
4810
4816
|
if (me === -1 || be === -1) return;
|
|
4811
4817
|
const _e = [...we];
|
|
4812
|
-
_e.splice(me, 1), _e.splice(be, 0,
|
|
4813
|
-
const Pt = Fe.find((Lt) => Lt.field ===
|
|
4818
|
+
_e.splice(me, 1), _e.splice(be, 0, ee), I || Et(_e);
|
|
4819
|
+
const Pt = Fe.find((Lt) => Lt.field === ee);
|
|
4814
4820
|
Pt && F?.({ oldIndex: me, targetIndex: be, column: Pt });
|
|
4815
4821
|
};
|
|
4816
4822
|
return {
|
|
@@ -4826,10 +4832,10 @@ function mi(n) {
|
|
|
4826
4832
|
filterModel: Ne,
|
|
4827
4833
|
onFilterModelChange: m,
|
|
4828
4834
|
columnVisibilityModel: $e,
|
|
4829
|
-
onColumnVisibilityModelChange:
|
|
4835
|
+
onColumnVisibilityModelChange: mt,
|
|
4830
4836
|
onColumnReorder: Y,
|
|
4831
|
-
onColumnOrderReset: T ? void 0 : () => Et(e.map((
|
|
4832
|
-
forceColumnsOpen:
|
|
4837
|
+
onColumnOrderReset: T ? void 0 : () => Et(e.map((ee) => ee.field)),
|
|
4838
|
+
forceColumnsOpen: ft,
|
|
4833
4839
|
onColumnsPanelClose: () => It(!1),
|
|
4834
4840
|
...ve?.toolbar
|
|
4835
4841
|
};
|
|
@@ -4854,35 +4860,35 @@ function mi(n) {
|
|
|
4854
4860
|
Ne,
|
|
4855
4861
|
m,
|
|
4856
4862
|
$e,
|
|
4857
|
-
|
|
4858
|
-
|
|
4863
|
+
mt,
|
|
4864
|
+
ft,
|
|
4859
4865
|
ve?.toolbar
|
|
4860
4866
|
]);
|
|
4861
4867
|
return re(() => {
|
|
4862
|
-
if (!
|
|
4863
|
-
function Y(
|
|
4864
|
-
const
|
|
4865
|
-
|
|
4868
|
+
if (!ft || de?.toolbar) return;
|
|
4869
|
+
function Y(ee) {
|
|
4870
|
+
const se = document.getElementById("ogx-standalone-col-panel");
|
|
4871
|
+
se && !se.contains(ee.target) && It(!1);
|
|
4866
4872
|
}
|
|
4867
4873
|
return document.addEventListener("mousedown", Y), () => document.removeEventListener("mousedown", Y);
|
|
4868
|
-
}, [
|
|
4874
|
+
}, [ft, de?.toolbar]), /* @__PURE__ */ r.jsxs(
|
|
4869
4875
|
"div",
|
|
4870
4876
|
{
|
|
4871
4877
|
ref: sn,
|
|
4872
|
-
className: ["ogx",
|
|
4878
|
+
className: ["ogx", oe, a && "ogx--auto-height", Co && "ogx--row-spanning", ie && "ogx--list-view"].filter(Boolean).join(" "),
|
|
4873
4879
|
style: {
|
|
4874
4880
|
...ue,
|
|
4875
4881
|
height: H ?? ue?.height,
|
|
4876
4882
|
"--ogx-row-height": `${i}px`,
|
|
4877
4883
|
"--ogx-header-height": `${l}px`
|
|
4878
4884
|
},
|
|
4879
|
-
"aria-busy":
|
|
4885
|
+
"aria-busy": ct,
|
|
4880
4886
|
children: [
|
|
4881
|
-
|
|
4887
|
+
Nn && /* @__PURE__ */ r.jsx(qn, { ...Nn }),
|
|
4882
4888
|
!de?.toolbar && /* @__PURE__ */ r.jsx(
|
|
4883
|
-
|
|
4889
|
+
Vr,
|
|
4884
4890
|
{
|
|
4885
|
-
isOpen:
|
|
4891
|
+
isOpen: ft,
|
|
4886
4892
|
containerRef: sn,
|
|
4887
4893
|
effectiveColumns: Fe,
|
|
4888
4894
|
columnVisibilityModel: $e,
|
|
@@ -4890,13 +4896,13 @@ function mi(n) {
|
|
|
4890
4896
|
columnOrder: I,
|
|
4891
4897
|
disableColumnReorder: T,
|
|
4892
4898
|
onClose: () => It(!1),
|
|
4893
|
-
onColumnVisibilityChange:
|
|
4899
|
+
onColumnVisibilityChange: mt,
|
|
4894
4900
|
onColumnOrderChange: F,
|
|
4895
4901
|
setInternalColumnOrder: Et
|
|
4896
4902
|
}
|
|
4897
4903
|
),
|
|
4898
4904
|
ie && ye && /* @__PURE__ */ r.jsx(
|
|
4899
|
-
|
|
4905
|
+
Mr,
|
|
4900
4906
|
{
|
|
4901
4907
|
ariaLabel: Ie,
|
|
4902
4908
|
allRenderableRows: nn,
|
|
@@ -4910,12 +4916,12 @@ function mi(n) {
|
|
|
4910
4916
|
rowHeight: i,
|
|
4911
4917
|
checkboxSelection: s,
|
|
4912
4918
|
paginationMode: $,
|
|
4913
|
-
dataSource:
|
|
4919
|
+
dataSource: te,
|
|
4914
4920
|
serverRowCount: he.pagination.rowCount || 0,
|
|
4915
4921
|
paginationSlot: de?.pagination,
|
|
4916
4922
|
paginationSlotProps: ve?.pagination,
|
|
4917
4923
|
onRowClick: St,
|
|
4918
|
-
onSelectionChange:
|
|
4924
|
+
onSelectionChange: gt,
|
|
4919
4925
|
onPaginationModelChange: Vt
|
|
4920
4926
|
}
|
|
4921
4927
|
),
|
|
@@ -4923,29 +4929,29 @@ function mi(n) {
|
|
|
4923
4929
|
"div",
|
|
4924
4930
|
{
|
|
4925
4931
|
ref: (Y) => {
|
|
4926
|
-
Ye.current = Y,
|
|
4932
|
+
Ye.current = Y, yt.current = Y;
|
|
4927
4933
|
},
|
|
4928
4934
|
className: "ogx__viewport",
|
|
4929
|
-
onScroll:
|
|
4935
|
+
onScroll: so,
|
|
4930
4936
|
role: "grid",
|
|
4931
4937
|
"aria-label": Ie || "Data grid",
|
|
4932
4938
|
"aria-rowcount": De.length + 1,
|
|
4933
4939
|
"aria-colcount": e.length + (s ? 1 : 0) + (Le ? 1 : 0) + (L ? 1 : 0),
|
|
4934
|
-
"aria-busy":
|
|
4940
|
+
"aria-busy": ct,
|
|
4935
4941
|
tabIndex: 0,
|
|
4936
4942
|
onKeyDownCapture: () => {
|
|
4937
|
-
|
|
4943
|
+
Xe(!0);
|
|
4938
4944
|
},
|
|
4939
4945
|
onMouseDownCapture: () => {
|
|
4940
|
-
|
|
4946
|
+
Xe(!1);
|
|
4941
4947
|
},
|
|
4942
|
-
onKeyDown:
|
|
4943
|
-
onFocus:
|
|
4944
|
-
onBlur:
|
|
4948
|
+
onKeyDown: vo,
|
|
4949
|
+
onFocus: mo,
|
|
4950
|
+
onBlur: wo,
|
|
4945
4951
|
children: /* @__PURE__ */ r.jsxs(
|
|
4946
4952
|
"div",
|
|
4947
4953
|
{
|
|
4948
|
-
ref:
|
|
4954
|
+
ref: Qn,
|
|
4949
4955
|
className: "ogx__content",
|
|
4950
4956
|
style: {
|
|
4951
4957
|
width: Re.totalWidth
|
|
@@ -4953,51 +4959,51 @@ function mi(n) {
|
|
|
4953
4959
|
role: "presentation",
|
|
4954
4960
|
children: [
|
|
4955
4961
|
/* @__PURE__ */ r.jsx(
|
|
4956
|
-
|
|
4962
|
+
fr,
|
|
4957
4963
|
{
|
|
4958
4964
|
columns: Re.virtualColumns,
|
|
4959
4965
|
allColumns: Fe,
|
|
4960
4966
|
columnGroupingModel: Be,
|
|
4961
4967
|
checkboxSelection: s,
|
|
4962
|
-
allSelected:
|
|
4963
|
-
someSelected:
|
|
4964
|
-
onSelectAll:
|
|
4968
|
+
allSelected: _o,
|
|
4969
|
+
someSelected: yo,
|
|
4970
|
+
onSelectAll: xo,
|
|
4965
4971
|
sortModel: Oe,
|
|
4966
|
-
onSort:
|
|
4967
|
-
onColumnResize:
|
|
4972
|
+
onSort: Rn,
|
|
4973
|
+
onColumnResize: ho,
|
|
4968
4974
|
columnWidths: Ae,
|
|
4969
4975
|
pinnedColumns: We,
|
|
4970
4976
|
focusedCell: Mt,
|
|
4971
4977
|
onHeaderClick: (Y) => {
|
|
4972
|
-
rn({ id: "HEADER", field: Y }),
|
|
4978
|
+
rn({ id: "HEADER", field: Y }), Xe(!1), yt.current?.focus({ preventScroll: !0 });
|
|
4973
4979
|
},
|
|
4974
|
-
onDragStart: Be ? void 0 :
|
|
4975
|
-
onDragOver: Be ? void 0 :
|
|
4976
|
-
onDragEnd: Be ? void 0 :
|
|
4977
|
-
onDrop: Be ? void 0 :
|
|
4978
|
-
draggedColumn: Be ? void 0 :
|
|
4979
|
-
dragOverColumn: Be ? void 0 :
|
|
4980
|
+
onDragStart: Be ? void 0 : tt.onDragStart,
|
|
4981
|
+
onDragOver: Be ? void 0 : tt.onDragOver,
|
|
4982
|
+
onDragEnd: Be ? void 0 : tt.onDragEnd,
|
|
4983
|
+
onDrop: Be ? void 0 : tt.onDrop,
|
|
4984
|
+
draggedColumn: Be ? void 0 : tt.draggedColumn,
|
|
4985
|
+
dragOverColumn: Be ? void 0 : tt.dragOverColumn,
|
|
4980
4986
|
rowReordering: L,
|
|
4981
4987
|
hasDetailPanel: Le,
|
|
4982
4988
|
pinCheckboxColumn: _,
|
|
4983
4989
|
pinExpandColumn: M,
|
|
4984
4990
|
aggregationModel: Me,
|
|
4985
4991
|
onHideColumn: (Y) => {
|
|
4986
|
-
|
|
4992
|
+
mt({
|
|
4987
4993
|
...$e,
|
|
4988
4994
|
[Y]: !1
|
|
4989
4995
|
});
|
|
4990
4996
|
},
|
|
4991
4997
|
onManageColumns: () => It(!0),
|
|
4992
|
-
onPinColumn: (Y,
|
|
4993
|
-
const
|
|
4994
|
-
Ht(
|
|
4998
|
+
onPinColumn: (Y, ee) => {
|
|
4999
|
+
const se = [...We?.left ?? []], we = [...We?.right ?? []], me = se.filter((_e) => _e !== Y), be = we.filter((_e) => _e !== Y);
|
|
5000
|
+
Ht(ee === "left" ? { left: [...me, Y], right: be } : ee === "right" ? { left: me, right: [...be, Y] } : { left: me, right: be });
|
|
4995
5001
|
}
|
|
4996
5002
|
}
|
|
4997
5003
|
),
|
|
4998
|
-
!
|
|
5004
|
+
!ct && !he.dataSource.error && De.length === 0 && /* @__PURE__ */ r.jsx(Jo, { noRowsLabel: Bt, width: Re.totalWidth }),
|
|
4999
5005
|
/* @__PURE__ */ r.jsx(
|
|
5000
|
-
|
|
5006
|
+
On,
|
|
5001
5007
|
{
|
|
5002
5008
|
rows: en,
|
|
5003
5009
|
position: "top",
|
|
@@ -5006,30 +5012,30 @@ function mi(n) {
|
|
|
5006
5012
|
checkboxSelection: s,
|
|
5007
5013
|
onRowClick: St,
|
|
5008
5014
|
onCellClick: ln,
|
|
5009
|
-
onSelectionChange:
|
|
5015
|
+
onSelectionChange: gt,
|
|
5010
5016
|
columnWidths: Ae,
|
|
5011
5017
|
pinnedColumns: We,
|
|
5012
5018
|
pinnedRows: u,
|
|
5013
5019
|
hasDetailPanel: Le,
|
|
5014
|
-
expandedRowIds:
|
|
5020
|
+
expandedRowIds: et,
|
|
5015
5021
|
getDetailPanelContent: p,
|
|
5016
5022
|
getDetailPanelHeight: j,
|
|
5017
5023
|
onDetailPanelToggle: jt,
|
|
5018
5024
|
pinCheckboxColumn: _,
|
|
5019
5025
|
pinExpandColumn: M,
|
|
5020
5026
|
focusedCell: Mt,
|
|
5021
|
-
colspanMap:
|
|
5022
|
-
rowSpanningCaches:
|
|
5027
|
+
colspanMap: rt.colspanMap,
|
|
5028
|
+
rowSpanningCaches: rt.rowSpanningState.caches,
|
|
5023
5029
|
rowHeight: i
|
|
5024
5030
|
}
|
|
5025
5031
|
),
|
|
5026
5032
|
/* @__PURE__ */ r.jsx(
|
|
5027
|
-
|
|
5033
|
+
Dr,
|
|
5028
5034
|
{
|
|
5029
5035
|
virtualContainerHeight: Re.totalHeight - Re.pinnedTopHeight - Re.pinnedBottomHeight,
|
|
5030
5036
|
offsetTop: Re.offsetTop,
|
|
5031
|
-
effectiveLoading:
|
|
5032
|
-
visibleRows:
|
|
5037
|
+
effectiveLoading: ct,
|
|
5038
|
+
visibleRows: bo,
|
|
5033
5039
|
baseColumns: e,
|
|
5034
5040
|
virtualColumns: Re.virtualColumns,
|
|
5035
5041
|
viewportWidth: he.dimensions.viewportWidth,
|
|
@@ -5041,29 +5047,29 @@ function mi(n) {
|
|
|
5041
5047
|
selectedRowIds: Ce,
|
|
5042
5048
|
onRowClick: St,
|
|
5043
5049
|
onCellClick: ln,
|
|
5044
|
-
onSelectionChange:
|
|
5050
|
+
onSelectionChange: gt,
|
|
5045
5051
|
columnWidths: Ae,
|
|
5046
5052
|
pinnedColumns: We,
|
|
5047
|
-
expandedRowIds:
|
|
5053
|
+
expandedRowIds: et,
|
|
5048
5054
|
getDetailPanelContent: p,
|
|
5049
5055
|
getDetailPanelHeight: j,
|
|
5050
5056
|
onDetailPanelToggle: jt,
|
|
5051
5057
|
pinCheckboxColumn: _,
|
|
5052
5058
|
pinExpandColumn: M,
|
|
5053
|
-
rowReorderHandlers:
|
|
5054
|
-
editingHandlers:
|
|
5059
|
+
rowReorderHandlers: po,
|
|
5060
|
+
editingHandlers: Ze,
|
|
5055
5061
|
focusedCell: Mt,
|
|
5056
|
-
colspanMap:
|
|
5057
|
-
rowSpanningCaches:
|
|
5062
|
+
colspanMap: rt.colspanMap,
|
|
5063
|
+
rowSpanningCaches: rt.rowSpanningState.caches,
|
|
5058
5064
|
paginationMode: $,
|
|
5059
5065
|
dataSourceLoading: he.dataSource.loading,
|
|
5060
|
-
sortedUnpinnedRowCount:
|
|
5066
|
+
sortedUnpinnedRowCount: ot.length,
|
|
5061
5067
|
infiniteScrollSkeletonCount: Math.min(Se.pageSize, 20),
|
|
5062
5068
|
unpinnedRowsLength: je.unpinnedRowsLength
|
|
5063
5069
|
}
|
|
5064
5070
|
),
|
|
5065
5071
|
/* @__PURE__ */ r.jsx(
|
|
5066
|
-
|
|
5072
|
+
On,
|
|
5067
5073
|
{
|
|
5068
5074
|
rows: tn,
|
|
5069
5075
|
position: "bottom",
|
|
@@ -5072,25 +5078,25 @@ function mi(n) {
|
|
|
5072
5078
|
checkboxSelection: s,
|
|
5073
5079
|
onRowClick: St,
|
|
5074
5080
|
onCellClick: ln,
|
|
5075
|
-
onSelectionChange:
|
|
5081
|
+
onSelectionChange: gt,
|
|
5076
5082
|
columnWidths: Ae,
|
|
5077
5083
|
pinnedColumns: We,
|
|
5078
5084
|
pinnedRows: u,
|
|
5079
5085
|
hasDetailPanel: Le,
|
|
5080
|
-
expandedRowIds:
|
|
5086
|
+
expandedRowIds: et,
|
|
5081
5087
|
getDetailPanelContent: p,
|
|
5082
5088
|
getDetailPanelHeight: j,
|
|
5083
5089
|
onDetailPanelToggle: jt,
|
|
5084
5090
|
pinCheckboxColumn: _,
|
|
5085
5091
|
pinExpandColumn: M,
|
|
5086
5092
|
focusedCell: Mt,
|
|
5087
|
-
colspanMap:
|
|
5088
|
-
rowSpanningCaches:
|
|
5093
|
+
colspanMap: rt.colspanMap,
|
|
5094
|
+
rowSpanningCaches: rt.rowSpanningState.caches,
|
|
5089
5095
|
rowHeight: i
|
|
5090
5096
|
}
|
|
5091
5097
|
),
|
|
5092
5098
|
Nt && !ce && /* @__PURE__ */ r.jsx(
|
|
5093
|
-
|
|
5099
|
+
Xo,
|
|
5094
5100
|
{
|
|
5095
5101
|
columns: Zt,
|
|
5096
5102
|
aggregationModel: Me,
|
|
@@ -5108,7 +5114,7 @@ function mi(n) {
|
|
|
5108
5114
|
}
|
|
5109
5115
|
),
|
|
5110
5116
|
!ie && Pe && (() => {
|
|
5111
|
-
const Y = de?.pagination ||
|
|
5117
|
+
const Y = de?.pagination || $n;
|
|
5112
5118
|
return /* @__PURE__ */ r.jsx(
|
|
5113
5119
|
Y,
|
|
5114
5120
|
{
|
|
@@ -5116,31 +5122,31 @@ function mi(n) {
|
|
|
5116
5122
|
pageSize: Se.pageSize,
|
|
5117
5123
|
rowCount: he.pagination.rowCount,
|
|
5118
5124
|
pageSizeOptions: k,
|
|
5119
|
-
onPageChange: (
|
|
5120
|
-
onPageSizeChange: (
|
|
5125
|
+
onPageChange: (ee) => Vt({ ...Se, page: ee }),
|
|
5126
|
+
onPageSizeChange: (ee) => Vt({ ...Se, pageSize: ee, page: 0 }),
|
|
5121
5127
|
...ve?.pagination
|
|
5122
5128
|
}
|
|
5123
5129
|
);
|
|
5124
5130
|
})(),
|
|
5125
5131
|
/* @__PURE__ */ r.jsxs("div", { className: "ogx-aria-live-status", role: "status", "aria-live": "polite", children: [
|
|
5126
|
-
|
|
5132
|
+
ct ? "Loading data..." : "",
|
|
5127
5133
|
he.dataSource.error ? `Error: ${he.dataSource.error instanceof Error ? he.dataSource.error.message : "Unknown error"}` : "",
|
|
5128
5134
|
!q && !he.dataSource.error && (De.length === 0 ? Bt : Ne && ((Ne.quickFilterValues?.length || 0) > 0 || (Ne.items?.length || 0) > 0) ? `${De.length} ${De.length === 1 ? "row" : "rows"} found` : "")
|
|
5129
5135
|
] }),
|
|
5130
|
-
/* @__PURE__ */ r.jsx(
|
|
5136
|
+
/* @__PURE__ */ r.jsx(Qo, { error: he.dataSource.error })
|
|
5131
5137
|
]
|
|
5132
5138
|
}
|
|
5133
5139
|
);
|
|
5134
5140
|
}
|
|
5135
|
-
function
|
|
5141
|
+
function vi({ rows: n = 5, columns: t = 5 }) {
|
|
5136
5142
|
return /* @__PURE__ */ r.jsx("div", { className: "ogx__skeleton", children: Array.from({ length: n }).map((e, o) => /* @__PURE__ */ r.jsx("div", { className: "ogx__skeleton-row", children: Array.from({ length: t }).map((i, l) => /* @__PURE__ */ r.jsx("div", { className: "ogx__skeleton-cell", children: /* @__PURE__ */ r.jsx("div", { className: "ogx__skeleton-content" }) }, l)) }, o)) });
|
|
5137
5143
|
}
|
|
5138
|
-
const
|
|
5139
|
-
function
|
|
5144
|
+
const Wn = /* @__PURE__ */ new Set(["isEmpty", "isNotEmpty"]);
|
|
5145
|
+
function Ur(n, t) {
|
|
5140
5146
|
return n.find((e) => "field" in e && e.field === t);
|
|
5141
5147
|
}
|
|
5142
|
-
const
|
|
5143
|
-
const o =
|
|
5148
|
+
const Kr = ({ col: n, item: t, onChange: e }) => {
|
|
5149
|
+
const o = zo(n.type), i = !!t, l = t?.operator ?? o[0], [a, s] = Q(t?.value != null ? String(t.value) : ""), c = J(e), d = J(t), g = J(n.field), x = J(l);
|
|
5144
5150
|
Ee(() => {
|
|
5145
5151
|
c.current = e, d.current = t, g.current = n.field, x.current = l;
|
|
5146
5152
|
});
|
|
@@ -5160,7 +5166,7 @@ const Ur = ({ col: n, item: t, onChange: e }) => {
|
|
|
5160
5166
|
return () => clearTimeout(f);
|
|
5161
5167
|
}, [a]);
|
|
5162
5168
|
const m = (f) => {
|
|
5163
|
-
const k =
|
|
5169
|
+
const k = Wn.has(f), y = {
|
|
5164
5170
|
id: t?.id ?? `${n.field}-${Date.now()}`,
|
|
5165
5171
|
field: n.field,
|
|
5166
5172
|
operator: f,
|
|
@@ -5169,7 +5175,7 @@ const Ur = ({ col: n, item: t, onChange: e }) => {
|
|
|
5169
5175
|
e(y);
|
|
5170
5176
|
}, v = () => {
|
|
5171
5177
|
s(""), e(null);
|
|
5172
|
-
}, b =
|
|
5178
|
+
}, b = Wn.has(String(l)), S = n.type === "boolean", N = !b;
|
|
5173
5179
|
return /* @__PURE__ */ r.jsxs("div", { className: `ogx-filter__row${i ? " ogx-filter__row--active" : ""}`, children: [
|
|
5174
5180
|
/* @__PURE__ */ r.jsx("span", { className: "ogx-filter__col-label", title: n.field, children: n.headerName || n.field }),
|
|
5175
5181
|
/* @__PURE__ */ r.jsxs("div", { className: "ogx-filter__controls", children: [
|
|
@@ -5232,8 +5238,8 @@ const Ur = ({ col: n, item: t, onChange: e }) => {
|
|
|
5232
5238
|
)
|
|
5233
5239
|
] })
|
|
5234
5240
|
] });
|
|
5235
|
-
},
|
|
5236
|
-
const o =
|
|
5241
|
+
}, Yr = ({ filterModel: n, columns: t, onFilterModelChange: e }) => {
|
|
5242
|
+
const o = le(() => n.items ?? [], [n.items]), i = n.logicOperator ?? "and", l = z((c, d) => {
|
|
5237
5243
|
const g = o.filter((h) => "field" in h && h.field !== c), x = d ? [...g, d] : g;
|
|
5238
5244
|
e({ ...n, items: x });
|
|
5239
5245
|
}, [o, n, e]), a = z((c) => {
|
|
@@ -5262,17 +5268,17 @@ const Ur = ({ col: n, item: t, onChange: e }) => {
|
|
|
5262
5268
|
)
|
|
5263
5269
|
] }),
|
|
5264
5270
|
s.length === 0 ? /* @__PURE__ */ r.jsx("div", { className: "ogx-filter__empty", children: "No filterable columns." }) : s.map((c) => /* @__PURE__ */ r.jsx(
|
|
5265
|
-
|
|
5271
|
+
Kr,
|
|
5266
5272
|
{
|
|
5267
5273
|
col: c,
|
|
5268
|
-
item:
|
|
5274
|
+
item: Ur(o, c.field),
|
|
5269
5275
|
onChange: (d) => l(c.field, d)
|
|
5270
5276
|
},
|
|
5271
5277
|
c.field
|
|
5272
5278
|
))
|
|
5273
5279
|
] });
|
|
5274
|
-
},
|
|
5275
|
-
function
|
|
5280
|
+
}, qr = ["sum", "avg", "count", "min", "max"];
|
|
5281
|
+
function Gn() {
|
|
5276
5282
|
return /* @__PURE__ */ r.jsxs(
|
|
5277
5283
|
"svg",
|
|
5278
5284
|
{
|
|
@@ -5295,7 +5301,7 @@ function Hn() {
|
|
|
5295
5301
|
}
|
|
5296
5302
|
);
|
|
5297
5303
|
}
|
|
5298
|
-
function
|
|
5304
|
+
function Xr({ anchorRef: n, columns: t, model: e, onChange: o, onClose: i }) {
|
|
5299
5305
|
const l = J(null), [a, s] = Q({ top: 0, right: 0 }), [c, d] = Q(document.body);
|
|
5300
5306
|
Ee(() => {
|
|
5301
5307
|
d(n.current?.closest(".ogx-theme-provider") ?? document.body);
|
|
@@ -5361,7 +5367,7 @@ function qr({ anchorRef: n, columns: t, model: e, onChange: o, onClose: i }) {
|
|
|
5361
5367
|
children: [
|
|
5362
5368
|
/* @__PURE__ */ r.jsxs("div", { className: "ogx-pivot-panel__header", children: [
|
|
5363
5369
|
/* @__PURE__ */ r.jsxs("span", { className: "ogx-pivot-panel__title", children: [
|
|
5364
|
-
/* @__PURE__ */ r.jsx(
|
|
5370
|
+
/* @__PURE__ */ r.jsx(Gn, {}),
|
|
5365
5371
|
"Pivot Mode"
|
|
5366
5372
|
] }),
|
|
5367
5373
|
j > 0 && /* @__PURE__ */ r.jsx("button", { className: "ogx-pivot-panel__reset-btn", onClick: u, title: "Reset pivot", children: "Reset" })
|
|
@@ -5420,7 +5426,7 @@ function qr({ anchorRef: n, columns: t, model: e, onChange: o, onClose: i }) {
|
|
|
5420
5426
|
value: _.aggFn,
|
|
5421
5427
|
onChange: (M) => w(_.field, M.target.value),
|
|
5422
5428
|
title: "Aggregation function",
|
|
5423
|
-
children:
|
|
5429
|
+
children: qr.map((M) => /* @__PURE__ */ r.jsx("option", { value: M, children: M.toUpperCase() }, M))
|
|
5424
5430
|
}
|
|
5425
5431
|
),
|
|
5426
5432
|
/* @__PURE__ */ r.jsx("button", { className: "ogx-pivot-chip__remove", onClick: () => y(_.field), title: `Remove ${E(_.field)}`, children: "×" })
|
|
@@ -5452,19 +5458,19 @@ function qr({ anchorRef: n, columns: t, model: e, onChange: o, onClose: i }) {
|
|
|
5452
5458
|
);
|
|
5453
5459
|
return Ge.createPortal(R, c);
|
|
5454
5460
|
}
|
|
5455
|
-
function
|
|
5461
|
+
function Jr() {
|
|
5456
5462
|
return /* @__PURE__ */ r.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
5457
5463
|
/* @__PURE__ */ r.jsx("circle", { cx: "11", cy: "11", r: "8" }),
|
|
5458
5464
|
/* @__PURE__ */ r.jsx("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
|
|
5459
5465
|
] });
|
|
5460
5466
|
}
|
|
5461
|
-
function
|
|
5467
|
+
function Qr() {
|
|
5462
5468
|
return /* @__PURE__ */ r.jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
5463
5469
|
/* @__PURE__ */ r.jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
5464
5470
|
/* @__PURE__ */ r.jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
5465
5471
|
] });
|
|
5466
5472
|
}
|
|
5467
|
-
function
|
|
5473
|
+
function Zr({ value: n = "", onChange: t, placeholder: e = "Search...", debounceMs: o = 250 }) {
|
|
5468
5474
|
const [i, l] = Q(() => n.length > 0), [a, s] = Q(n), c = J(null), d = J(null), g = J(t);
|
|
5469
5475
|
Ee(() => {
|
|
5470
5476
|
g.current = t;
|
|
@@ -5507,7 +5513,7 @@ function Qr({ value: n = "", onChange: t, placeholder: e = "Search...", debounce
|
|
|
5507
5513
|
className: `ogx-global-search${i ? " ogx-global-search--expanded" : ""}`,
|
|
5508
5514
|
onClick: i ? void 0 : v,
|
|
5509
5515
|
children: [
|
|
5510
|
-
/* @__PURE__ */ r.jsx("div", { className: "ogx-global-search__icon-wrapper", children: /* @__PURE__ */ r.jsx(
|
|
5516
|
+
/* @__PURE__ */ r.jsx("div", { className: "ogx-global-search__icon-wrapper", children: /* @__PURE__ */ r.jsx(Jr, {}) }),
|
|
5511
5517
|
/* @__PURE__ */ r.jsx(
|
|
5512
5518
|
"input",
|
|
5513
5519
|
{
|
|
@@ -5524,7 +5530,7 @@ function Qr({ value: n = "", onChange: t, placeholder: e = "Search...", debounce
|
|
|
5524
5530
|
autoComplete: "off"
|
|
5525
5531
|
}
|
|
5526
5532
|
),
|
|
5527
|
-
a && /* @__PURE__ */ r.jsx("button", { className: "ogx-global-search__clear", onClick: b, "aria-label": "Clear search", children: /* @__PURE__ */ r.jsx(
|
|
5533
|
+
a && /* @__PURE__ */ r.jsx("button", { className: "ogx-global-search__clear", onClick: b, "aria-label": "Clear search", children: /* @__PURE__ */ r.jsx(Qr, {}) })
|
|
5528
5534
|
]
|
|
5529
5535
|
}
|
|
5530
5536
|
);
|
|
@@ -5586,8 +5592,8 @@ function Ft({
|
|
|
5586
5592
|
)
|
|
5587
5593
|
] });
|
|
5588
5594
|
}
|
|
5589
|
-
const
|
|
5590
|
-
function
|
|
5595
|
+
const ei = ["none", "sum", "avg", "count", "min", "max"];
|
|
5596
|
+
function Vn() {
|
|
5591
5597
|
return /* @__PURE__ */ r.jsx(
|
|
5592
5598
|
"svg",
|
|
5593
5599
|
{
|
|
@@ -5604,7 +5610,7 @@ function Gn() {
|
|
|
5604
5610
|
}
|
|
5605
5611
|
);
|
|
5606
5612
|
}
|
|
5607
|
-
function
|
|
5613
|
+
function ti() {
|
|
5608
5614
|
return /* @__PURE__ */ r.jsxs("svg", { focusable: "false", "aria-hidden": "true", viewBox: "0 0 24 24", width: "18", height: "18", fill: "none", children: [
|
|
5609
5615
|
/* @__PURE__ */ r.jsx("rect", { x: "2", y: "4", width: "20", height: "16", rx: "2", stroke: "currentColor", strokeWidth: "1.8" }),
|
|
5610
5616
|
/* @__PURE__ */ r.jsx("rect", { x: "8.5", y: "4", width: "7", height: "16", fill: "currentColor", opacity: "0.25" }),
|
|
@@ -5614,10 +5620,10 @@ function ei() {
|
|
|
5614
5620
|
/* @__PURE__ */ r.jsx("line", { x1: "2", y1: "14", x2: "22", y2: "14", stroke: "currentColor", strokeWidth: "1.2" })
|
|
5615
5621
|
] });
|
|
5616
5622
|
}
|
|
5617
|
-
function
|
|
5623
|
+
function Un() {
|
|
5618
5624
|
return /* @__PURE__ */ r.jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ r.jsx("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" }) });
|
|
5619
5625
|
}
|
|
5620
|
-
function
|
|
5626
|
+
function ni({
|
|
5621
5627
|
anchorRef: n,
|
|
5622
5628
|
aggregationModel: t,
|
|
5623
5629
|
aggregableColumns: e,
|
|
@@ -5666,7 +5672,7 @@ function ti({
|
|
|
5666
5672
|
children: [
|
|
5667
5673
|
/* @__PURE__ */ r.jsxs("div", { className: "ogx-toolbar__panel-header", children: [
|
|
5668
5674
|
/* @__PURE__ */ r.jsxs("span", { className: "ogx-toolbar__panel-title", children: [
|
|
5669
|
-
/* @__PURE__ */ r.jsx(
|
|
5675
|
+
/* @__PURE__ */ r.jsx(Vn, {}),
|
|
5670
5676
|
"Summaries"
|
|
5671
5677
|
] }),
|
|
5672
5678
|
a > 0 && /* @__PURE__ */ r.jsx(
|
|
@@ -5689,7 +5695,7 @@ function ti({
|
|
|
5689
5695
|
const b = t[v.field] || "none";
|
|
5690
5696
|
return /* @__PURE__ */ r.jsxs("div", { className: "ogx-toolbar__agg-row", children: [
|
|
5691
5697
|
/* @__PURE__ */ r.jsx("span", { className: "ogx-toolbar__agg-label", title: v.field, children: v.headerName || v.field }),
|
|
5692
|
-
/* @__PURE__ */ r.jsx("div", { className: "ogx-toolbar__agg-pills", children:
|
|
5698
|
+
/* @__PURE__ */ r.jsx("div", { className: "ogx-toolbar__agg-pills", children: ei.map((S) => /* @__PURE__ */ r.jsx(
|
|
5693
5699
|
"button",
|
|
5694
5700
|
{
|
|
5695
5701
|
className: `ogx-toolbar__pill${b === S ? " ogx-toolbar__pill--active" : ""}`,
|
|
@@ -5706,7 +5712,7 @@ function ti({
|
|
|
5706
5712
|
);
|
|
5707
5713
|
return Ge.createPortal(m, g);
|
|
5708
5714
|
}
|
|
5709
|
-
function
|
|
5715
|
+
function oi({
|
|
5710
5716
|
anchorRef: n,
|
|
5711
5717
|
columns: t,
|
|
5712
5718
|
visibleColumns: e,
|
|
@@ -5750,7 +5756,7 @@ function ni({
|
|
|
5750
5756
|
"aria-label": "Column visibility",
|
|
5751
5757
|
style: { top: g.top, right: g.right, width: 280, padding: 0 },
|
|
5752
5758
|
children: /* @__PURE__ */ r.jsx(
|
|
5753
|
-
|
|
5759
|
+
Hn,
|
|
5754
5760
|
{
|
|
5755
5761
|
columns: t,
|
|
5756
5762
|
visibleColumns: e,
|
|
@@ -5765,7 +5771,7 @@ function ni({
|
|
|
5765
5771
|
);
|
|
5766
5772
|
return Ge.createPortal(b, h);
|
|
5767
5773
|
}
|
|
5768
|
-
function
|
|
5774
|
+
function ri({
|
|
5769
5775
|
anchorRef: n,
|
|
5770
5776
|
columns: t,
|
|
5771
5777
|
filterModel: e,
|
|
@@ -5813,7 +5819,7 @@ function oi({
|
|
|
5813
5819
|
children: [
|
|
5814
5820
|
/* @__PURE__ */ r.jsxs("div", { className: "ogx-toolbar__panel-header", children: [
|
|
5815
5821
|
/* @__PURE__ */ r.jsxs("span", { className: "ogx-toolbar__panel-title", children: [
|
|
5816
|
-
/* @__PURE__ */ r.jsx(
|
|
5822
|
+
/* @__PURE__ */ r.jsx(Un, {}),
|
|
5817
5823
|
"Filters",
|
|
5818
5824
|
h > 0 && /* @__PURE__ */ r.jsx("span", { className: "ogx-toolbar__panel-count", children: h })
|
|
5819
5825
|
] }),
|
|
@@ -5840,7 +5846,7 @@ function oi({
|
|
|
5840
5846
|
] })
|
|
5841
5847
|
] }),
|
|
5842
5848
|
/* @__PURE__ */ r.jsx("div", { className: "ogx-toolbar__panel-body ogx-toolbar__panel-body--filter", children: /* @__PURE__ */ r.jsx(
|
|
5843
|
-
|
|
5849
|
+
Yr,
|
|
5844
5850
|
{
|
|
5845
5851
|
columns: t,
|
|
5846
5852
|
filterModel: e,
|
|
@@ -5852,8 +5858,8 @@ function oi({
|
|
|
5852
5858
|
);
|
|
5853
5859
|
return Ge.createPortal(v, d);
|
|
5854
5860
|
}
|
|
5855
|
-
const
|
|
5856
|
-
function
|
|
5861
|
+
const ii = { rowFields: [], columnFields: [], valueFields: [] };
|
|
5862
|
+
function bi({
|
|
5857
5863
|
columns: n = [],
|
|
5858
5864
|
baseColumns: t,
|
|
5859
5865
|
aggregationModel: e = {},
|
|
@@ -5876,7 +5882,7 @@ function vi({
|
|
|
5876
5882
|
re(() => {
|
|
5877
5883
|
h && (u(!0), f(!1), y(!1), j(!1));
|
|
5878
5884
|
}, [h]);
|
|
5879
|
-
const E = J(null), R = J(null), _ = J(null), M = J(null), T = i ??
|
|
5885
|
+
const E = J(null), R = J(null), _ = J(null), M = J(null), T = i ?? ii, I = T.rowFields.length > 0 || T.columnFields.length > 0 || T.valueFields.length > 0, F = n.filter(
|
|
5880
5886
|
(G) => G.aggregable !== !1 && (G.type === "number" || G.aggregable === !0)
|
|
5881
5887
|
), H = Object.keys(e).filter(
|
|
5882
5888
|
(G) => e[G] && e[G] !== "none"
|
|
@@ -5921,7 +5927,7 @@ function vi({
|
|
|
5921
5927
|
/* @__PURE__ */ r.jsx("div", { className: "ogx-toolbar__spacer" }),
|
|
5922
5928
|
/* @__PURE__ */ r.jsxs("div", { className: "ogx-toolbar__actions", children: [
|
|
5923
5929
|
s && /* @__PURE__ */ r.jsx("div", { className: "ogx-toolbar__dropdown-wrapper", style: { marginRight: 4 }, children: /* @__PURE__ */ r.jsx(
|
|
5924
|
-
|
|
5930
|
+
Zr,
|
|
5925
5931
|
{
|
|
5926
5932
|
value: K,
|
|
5927
5933
|
onChange: q,
|
|
@@ -5938,11 +5944,11 @@ function vi({
|
|
|
5938
5944
|
onClick: () => {
|
|
5939
5945
|
u(!w), f(!1), y(!1), j(!1);
|
|
5940
5946
|
},
|
|
5941
|
-
children: /* @__PURE__ */ r.jsx(
|
|
5947
|
+
children: /* @__PURE__ */ r.jsx(ti, {})
|
|
5942
5948
|
}
|
|
5943
5949
|
) }),
|
|
5944
5950
|
w && /* @__PURE__ */ r.jsx(
|
|
5945
|
-
|
|
5951
|
+
oi,
|
|
5946
5952
|
{
|
|
5947
5953
|
anchorRef: _,
|
|
5948
5954
|
columns: n,
|
|
@@ -5969,13 +5975,13 @@ function vi({
|
|
|
5969
5975
|
j(!p), f(!1), y(!1), u(!1);
|
|
5970
5976
|
},
|
|
5971
5977
|
children: [
|
|
5972
|
-
/* @__PURE__ */ r.jsx(
|
|
5978
|
+
/* @__PURE__ */ r.jsx(Un, {}),
|
|
5973
5979
|
C > 0 && /* @__PURE__ */ r.jsx("span", { className: "ogx-toolbar__dot", "aria-label": "Filters active" })
|
|
5974
5980
|
]
|
|
5975
5981
|
}
|
|
5976
5982
|
) }),
|
|
5977
5983
|
p && /* @__PURE__ */ r.jsx(
|
|
5978
|
-
|
|
5984
|
+
ri,
|
|
5979
5985
|
{
|
|
5980
5986
|
anchorRef: M,
|
|
5981
5987
|
columns: n,
|
|
@@ -5999,13 +6005,13 @@ function vi({
|
|
|
5999
6005
|
y(!k), f(!1), u(!1), j(!1);
|
|
6000
6006
|
},
|
|
6001
6007
|
children: [
|
|
6002
|
-
/* @__PURE__ */ r.jsx(
|
|
6008
|
+
/* @__PURE__ */ r.jsx(Gn, {}),
|
|
6003
6009
|
I && /* @__PURE__ */ r.jsx("span", { className: "ogx-toolbar__dot", "aria-label": "Pivot active" })
|
|
6004
6010
|
]
|
|
6005
6011
|
}
|
|
6006
6012
|
) }),
|
|
6007
6013
|
k && /* @__PURE__ */ r.jsx(
|
|
6008
|
-
|
|
6014
|
+
Xr,
|
|
6009
6015
|
{
|
|
6010
6016
|
anchorRef: R,
|
|
6011
6017
|
columns: t ?? n,
|
|
@@ -6031,13 +6037,13 @@ function vi({
|
|
|
6031
6037
|
f(!N), y(!1), u(!1), j(!1);
|
|
6032
6038
|
},
|
|
6033
6039
|
children: [
|
|
6034
|
-
/* @__PURE__ */ r.jsx(
|
|
6040
|
+
/* @__PURE__ */ r.jsx(Vn, {}),
|
|
6035
6041
|
H > 0 && /* @__PURE__ */ r.jsx("span", { className: "ogx-toolbar__dot", "aria-label": `${H} active summaries` })
|
|
6036
6042
|
]
|
|
6037
6043
|
}
|
|
6038
6044
|
) }),
|
|
6039
6045
|
N && /* @__PURE__ */ r.jsx(
|
|
6040
|
-
|
|
6046
|
+
ni,
|
|
6041
6047
|
{
|
|
6042
6048
|
anchorRef: E,
|
|
6043
6049
|
aggregationModel: e,
|
|
@@ -6053,10 +6059,10 @@ function vi({
|
|
|
6053
6059
|
] })
|
|
6054
6060
|
] });
|
|
6055
6061
|
}
|
|
6056
|
-
function
|
|
6062
|
+
function _i() {
|
|
6057
6063
|
return J(null);
|
|
6058
6064
|
}
|
|
6059
|
-
const
|
|
6065
|
+
const yi = ({
|
|
6060
6066
|
fullWidth: n = !1,
|
|
6061
6067
|
error: t = !1,
|
|
6062
6068
|
startAdornment: e,
|
|
@@ -6083,7 +6089,7 @@ const _i = ({
|
|
|
6083
6089
|
o && /* @__PURE__ */ r.jsx("div", { className: "ogx-input__adornment ogx-input__adornment--end", children: o })
|
|
6084
6090
|
] });
|
|
6085
6091
|
};
|
|
6086
|
-
function
|
|
6092
|
+
function Ci(n, t, e = {}) {
|
|
6087
6093
|
const {
|
|
6088
6094
|
fileName: o = "export.csv",
|
|
6089
6095
|
includeHeaders: i = !0,
|
|
@@ -6097,39 +6103,39 @@ function yi(n, t, e = {}) {
|
|
|
6097
6103
|
const c = t.filter((g) => !(g.exportable === !1 || g.field === "__check__" || g.field === "__actions__"));
|
|
6098
6104
|
let d = "";
|
|
6099
6105
|
if (i) {
|
|
6100
|
-
const g = c.map((x) =>
|
|
6106
|
+
const g = c.map((x) => dt(x.headerName || x.field));
|
|
6101
6107
|
d += g.join(l) + `
|
|
6102
6108
|
`;
|
|
6103
6109
|
}
|
|
6104
6110
|
if (s.forEach((g) => {
|
|
6105
6111
|
const x = c.map((h) => {
|
|
6106
6112
|
let m = g[h.field];
|
|
6107
|
-
return h.valueGetter && (m = h.valueGetter({ row: g, field: h.field, value: m })), h.valueFormatter && m !== void 0 && m !== null && (m = h.valueFormatter({ value: m, row: g, field: h.field })),
|
|
6113
|
+
return h.valueGetter && (m = h.valueGetter({ row: g, field: h.field, value: m })), h.valueFormatter && m !== void 0 && m !== null && (m = h.valueFormatter({ value: m, row: g, field: h.field })), dt(String(m ?? ""));
|
|
6108
6114
|
});
|
|
6109
6115
|
d += x.join(l) + `
|
|
6110
6116
|
`;
|
|
6111
6117
|
}), e.aggregationResult) {
|
|
6112
|
-
const g = e.aggregationResult, x = e.aggregationModel || {}, h = c.map((v) => x[v.field] ?
|
|
6118
|
+
const g = e.aggregationResult, x = e.aggregationModel || {}, h = c.map((v) => x[v.field] ? dt(x[v.field].toUpperCase()) : dt(""));
|
|
6113
6119
|
d += h.join(l) + `
|
|
6114
6120
|
`;
|
|
6115
6121
|
const m = c.map((v) => {
|
|
6116
6122
|
const b = g[v.field];
|
|
6117
6123
|
if (b != null) {
|
|
6118
6124
|
let S = b;
|
|
6119
|
-
return v.valueFormatter ? S = v.valueFormatter({ value: b, row: {}, field: v.field }) : x[v.field] && (S = He(b, x[v.field])),
|
|
6125
|
+
return v.valueFormatter ? S = v.valueFormatter({ value: b, row: {}, field: v.field }) : x[v.field] && (S = He(b, x[v.field])), dt(String(S));
|
|
6120
6126
|
}
|
|
6121
|
-
return
|
|
6127
|
+
return dt("");
|
|
6122
6128
|
});
|
|
6123
6129
|
d += m.join(l) + `
|
|
6124
6130
|
`;
|
|
6125
6131
|
}
|
|
6126
6132
|
fn(d, o, "text/csv;charset=utf-8;");
|
|
6127
6133
|
}
|
|
6128
|
-
function
|
|
6134
|
+
function dt(n) {
|
|
6129
6135
|
return n.includes(",") || n.includes('"') || n.includes(`
|
|
6130
6136
|
`) ? `"${n.replace(/"/g, '""')}"` : n;
|
|
6131
6137
|
}
|
|
6132
|
-
function
|
|
6138
|
+
function ki(n, t, e = {}) {
|
|
6133
6139
|
const {
|
|
6134
6140
|
fileName: o = "export.xls",
|
|
6135
6141
|
sheetName: i = "Sheet1",
|
|
@@ -6167,7 +6173,7 @@ function Ci(n, t, e = {}) {
|
|
|
6167
6173
|
function Te(n) {
|
|
6168
6174
|
return n.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
6169
6175
|
}
|
|
6170
|
-
function
|
|
6176
|
+
function Si(n, t, e = {}) {
|
|
6171
6177
|
const {
|
|
6172
6178
|
fileName: o = "export.json",
|
|
6173
6179
|
pretty: i = !0,
|
|
@@ -6207,7 +6213,7 @@ function ki(n, t, e = {}) {
|
|
|
6207
6213
|
const g = i ? JSON.stringify(d, null, 2) : JSON.stringify(d);
|
|
6208
6214
|
fn(g, o, "application/json;charset=utf-8;");
|
|
6209
6215
|
}
|
|
6210
|
-
async function
|
|
6216
|
+
async function ji(n, t, e) {
|
|
6211
6217
|
const o = window.open("", "_blank");
|
|
6212
6218
|
if (!o) {
|
|
6213
6219
|
console.error("Failed to open print window. Please check your popup blocker settings.");
|
|
@@ -6305,26 +6311,26 @@ function fn(n, t, e) {
|
|
|
6305
6311
|
const o = new Blob([n], { type: e }), i = URL.createObjectURL(o), l = document.createElement("a");
|
|
6306
6312
|
l.href = i, l.download = t, document.body.appendChild(l), l.click(), document.body.removeChild(l), URL.revokeObjectURL(i);
|
|
6307
6313
|
}
|
|
6308
|
-
function
|
|
6314
|
+
function li(n, t) {
|
|
6309
6315
|
return n.type === "number" ? "number" : n.type === "boolean" ? "boolean" : n.type === "date" ? "date" : typeof t == "number" ? "number" : typeof t == "boolean" ? "boolean" : t instanceof Date ? "date" : "string";
|
|
6310
6316
|
}
|
|
6311
|
-
function
|
|
6317
|
+
function si(n) {
|
|
6312
6318
|
if (n.type === "number") return "#,##0.##";
|
|
6313
6319
|
if (n.type === "date") return "yyyy-mm-dd";
|
|
6314
6320
|
}
|
|
6315
|
-
function
|
|
6321
|
+
function ai(n, t) {
|
|
6316
6322
|
if (t != null) return t;
|
|
6317
6323
|
const e = n.width ?? 120;
|
|
6318
6324
|
return Math.min(60, Math.max(8, (e - 5) / 7));
|
|
6319
6325
|
}
|
|
6320
|
-
function
|
|
6326
|
+
function di(n, t) {
|
|
6321
6327
|
const e = t ?? "";
|
|
6322
6328
|
if (e.includes("jpeg") || e.includes("jpg")) return "jpeg";
|
|
6323
6329
|
if (e.includes("gif")) return "gif";
|
|
6324
6330
|
const o = n.split("?")[0].toLowerCase();
|
|
6325
6331
|
return o.endsWith(".jpg") || o.endsWith(".jpeg") ? "jpeg" : o.endsWith(".gif") ? "gif" : "png";
|
|
6326
6332
|
}
|
|
6327
|
-
async function
|
|
6333
|
+
async function ci(n) {
|
|
6328
6334
|
const t = await Promise.allSettled(
|
|
6329
6335
|
n.map(async (o) => {
|
|
6330
6336
|
if (o.startsWith("data:")) {
|
|
@@ -6336,7 +6342,7 @@ async function di(n) {
|
|
|
6336
6342
|
}
|
|
6337
6343
|
const i = await fetch(o, { mode: "cors" });
|
|
6338
6344
|
if (!i.ok) throw new Error(`HTTP ${i.status}`);
|
|
6339
|
-
const l = await i.arrayBuffer(), a =
|
|
6345
|
+
const l = await i.arrayBuffer(), a = di(o, i.headers.get("content-type"));
|
|
6340
6346
|
return { url: o, buffer: l, ext: a };
|
|
6341
6347
|
})
|
|
6342
6348
|
), e = /* @__PURE__ */ new Map();
|
|
@@ -6347,7 +6353,7 @@ async function di(n) {
|
|
|
6347
6353
|
);
|
|
6348
6354
|
}), e;
|
|
6349
6355
|
}
|
|
6350
|
-
async function
|
|
6356
|
+
async function Ri(n, t, e = {}) {
|
|
6351
6357
|
const {
|
|
6352
6358
|
fileName: o = "export.xlsx",
|
|
6353
6359
|
sheets: i,
|
|
@@ -6369,7 +6375,7 @@ async function ji(n, t, e = {}) {
|
|
|
6369
6375
|
if (!g || !x) continue;
|
|
6370
6376
|
const C = v.addWorksheet(j.name ?? "Summary");
|
|
6371
6377
|
C.addRow(["Summary / Aggregation Totals"]), C.getRow(1).font = { bold: !0, size: c + 2, color: { argb: ze(s) } }, C.addRow([]), C.addRow(["Column", "Function", "Value"]).eachCell((O) => {
|
|
6372
|
-
O.fill = { type: "pattern", pattern: "solid", fgColor: { argb: ze(a) } }, O.font = { bold: !0, size: c, color: { argb: ze(s) } }, O.border =
|
|
6378
|
+
O.fill = { type: "pattern", pattern: "solid", fgColor: { argb: ze(a) } }, O.font = { bold: !0, size: c, color: { argb: ze(s) } }, O.border = Fn();
|
|
6373
6379
|
}), b.forEach((O) => {
|
|
6374
6380
|
const W = x[O.field], V = g[O.field];
|
|
6375
6381
|
if (W == null || V == null) return;
|
|
@@ -6397,7 +6403,7 @@ async function ji(n, t, e = {}) {
|
|
|
6397
6403
|
typeof V == "string" && V && !k.has(V) && !B.has(V) && (C.push(V), B.add(V));
|
|
6398
6404
|
});
|
|
6399
6405
|
}), C.length > 0) {
|
|
6400
|
-
const O = await
|
|
6406
|
+
const O = await ci(C);
|
|
6401
6407
|
for (const [W, { buffer: V, extension: G }] of O) {
|
|
6402
6408
|
const D = v.addImage({ buffer: V, extension: G });
|
|
6403
6409
|
k.set(W, D);
|
|
@@ -6407,9 +6413,9 @@ async function ji(n, t, e = {}) {
|
|
|
6407
6413
|
const q = v.addWorksheet(R);
|
|
6408
6414
|
if (q.columns = b.map((C) => ({
|
|
6409
6415
|
key: C.field,
|
|
6410
|
-
width:
|
|
6416
|
+
width: ai(C, l[C.field]?.width),
|
|
6411
6417
|
style: {
|
|
6412
|
-
numFmt: l[C.field]?.numFmt ??
|
|
6418
|
+
numFmt: l[C.field]?.numFmt ?? si(C)
|
|
6413
6419
|
}
|
|
6414
6420
|
})), M) {
|
|
6415
6421
|
const C = b.map((O) => O.headerName ?? O.field), B = q.addRow(C);
|
|
@@ -6418,7 +6424,7 @@ async function ji(n, t, e = {}) {
|
|
|
6418
6424
|
O.fill = { type: "pattern", pattern: "solid", fgColor: { argb: ze(a) } }, O.font = { bold: !0, size: c, color: { argb: ze(s) } }, O.alignment = {
|
|
6419
6425
|
horizontal: l[V?.field]?.alignment ?? (V?.type === "number" ? "right" : "left"),
|
|
6420
6426
|
vertical: "middle"
|
|
6421
|
-
}, O.border =
|
|
6427
|
+
}, O.border = Fn();
|
|
6422
6428
|
}), I && (q.autoFilter = {
|
|
6423
6429
|
from: { row: 1, column: 1 },
|
|
6424
6430
|
to: { row: 1, column: b.length }
|
|
@@ -6429,7 +6435,7 @@ async function ji(n, t, e = {}) {
|
|
|
6429
6435
|
const O = b.map((V) => {
|
|
6430
6436
|
if (l[V.field]?.embedImage) return "";
|
|
6431
6437
|
let G = C[V.field];
|
|
6432
|
-
return V.valueGetter && (G = V.valueGetter({ row: C, field: V.field, value: G })),
|
|
6438
|
+
return V.valueGetter && (G = V.valueGetter({ row: C, field: V.field, value: G })), li(V, G) === "string" && V.valueFormatter && G != null && (G = V.valueFormatter({ value: G, row: C, field: V.field })), G;
|
|
6433
6439
|
}), W = q.addRow(O);
|
|
6434
6440
|
if (W.font = { size: d }, H && B % 2 === 1 && W.eachCell((V) => {
|
|
6435
6441
|
V.fill = { type: "pattern", pattern: "solid", fgColor: { argb: ze(H) } };
|
|
@@ -6440,17 +6446,17 @@ async function ji(n, t, e = {}) {
|
|
|
6440
6446
|
vertical: "middle"
|
|
6441
6447
|
}, V.border = { bottom: { style: "thin", color: { argb: "FFf1f5f9" } } });
|
|
6442
6448
|
}), U.length > 0) {
|
|
6443
|
-
const V = U.reduce((P,
|
|
6449
|
+
const V = U.reduce((P, ne) => Math.max(P, l[ne.field]?.imageHeight ?? 40), 0), G = Math.ceil(V / 1.333), D = G * 1.333;
|
|
6444
6450
|
W.height = G, U.forEach((P) => {
|
|
6445
|
-
const
|
|
6451
|
+
const ne = b.indexOf(P), te = C[P.field], Z = typeof te == "string" ? k.get(te) : void 0;
|
|
6446
6452
|
if (Z === void 0) {
|
|
6447
|
-
W.getCell(
|
|
6453
|
+
W.getCell(ne + 1).value = typeof te == "string" ? te : "";
|
|
6448
6454
|
return;
|
|
6449
6455
|
}
|
|
6450
|
-
const pe = l[P.field], $ = pe?.imageWidth ?? 40, ge = pe?.imageHeight ?? 40, ve = (q.getColumn(
|
|
6456
|
+
const pe = l[P.field], $ = pe?.imageWidth ?? 40, ge = pe?.imageHeight ?? 40, ve = (q.getColumn(ne + 1).width ?? 8) * 7 + 5, ce = Math.max(0, ve - $) / 2, A = Math.max(0, D - ge) / 2;
|
|
6451
6457
|
q.addImage(Z, {
|
|
6452
6458
|
tl: {
|
|
6453
|
-
col:
|
|
6459
|
+
col: ne,
|
|
6454
6460
|
row: K,
|
|
6455
6461
|
nativeColOff: Math.floor(ce * 9525),
|
|
6456
6462
|
nativeRowOff: Math.floor(A * 9525)
|
|
@@ -6475,7 +6481,7 @@ async function ji(n, t, e = {}) {
|
|
|
6475
6481
|
return G == null || D == null ? "" : V.valueFormatter ? V.valueFormatter({ value: D, row: {}, field: V.field }) : He(D, G);
|
|
6476
6482
|
}), W = q.addRow(O);
|
|
6477
6483
|
W.height = 18, W.font = { bold: !0, size: d, color: { argb: ze(s) } }, W.eachCell((V) => {
|
|
6478
|
-
V.fill = { type: "pattern", pattern: "solid", fgColor: { argb: ze(a) } }, V.alignment = { horizontal: "right", vertical: "middle" }, V.border =
|
|
6484
|
+
V.fill = { type: "pattern", pattern: "solid", fgColor: { argb: ze(a) } }, V.alignment = { horizontal: "right", vertical: "middle" }, V.border = ui();
|
|
6479
6485
|
});
|
|
6480
6486
|
}
|
|
6481
6487
|
}
|
|
@@ -6488,13 +6494,13 @@ function ze(n) {
|
|
|
6488
6494
|
const t = n.replace("#", "");
|
|
6489
6495
|
return t.length === 3 ? "FF" + t.split("").map((e) => e + e).join("") : t.length === 6 ? "FF" + t : "FF" + t.padEnd(6, "0");
|
|
6490
6496
|
}
|
|
6491
|
-
function
|
|
6497
|
+
function Fn() {
|
|
6492
6498
|
return { bottom: { style: "medium", color: { argb: "FFcbd5e1" } } };
|
|
6493
6499
|
}
|
|
6494
|
-
function
|
|
6500
|
+
function ui() {
|
|
6495
6501
|
return { top: { style: "medium", color: { argb: "FFcbd5e1" } } };
|
|
6496
6502
|
}
|
|
6497
|
-
const
|
|
6503
|
+
const gi = {
|
|
6498
6504
|
"--ogx-color-primary": "#3b82f6",
|
|
6499
6505
|
"--ogx-color-primary-dark": "#2563eb",
|
|
6500
6506
|
"--ogx-color-primary-light": "#eff6ff",
|
|
@@ -6568,7 +6574,7 @@ const ui = {
|
|
|
6568
6574
|
"--ogx-skeleton-dark-base": "#e2e8f0",
|
|
6569
6575
|
"--ogx-skeleton-dark-highlight": "#f8fafc"
|
|
6570
6576
|
};
|
|
6571
|
-
function
|
|
6577
|
+
function fi(n) {
|
|
6572
6578
|
const t = {};
|
|
6573
6579
|
function e(o, i) {
|
|
6574
6580
|
i !== void 0 && (t[o] = i);
|
|
@@ -6619,13 +6625,13 @@ function gi(n) {
|
|
|
6619
6625
|
}
|
|
6620
6626
|
return t;
|
|
6621
6627
|
}
|
|
6622
|
-
function
|
|
6628
|
+
function Ei({
|
|
6623
6629
|
theme: n,
|
|
6624
6630
|
children: t,
|
|
6625
6631
|
className: e,
|
|
6626
6632
|
style: o
|
|
6627
6633
|
}) {
|
|
6628
|
-
const i =
|
|
6634
|
+
const i = ae.useMemo(() => ({ ...gi, ...fi(n) }), [n]);
|
|
6629
6635
|
return /* @__PURE__ */ r.jsx(
|
|
6630
6636
|
"div",
|
|
6631
6637
|
{
|
|
@@ -6635,7 +6641,7 @@ function Ri({
|
|
|
6635
6641
|
}
|
|
6636
6642
|
);
|
|
6637
6643
|
}
|
|
6638
|
-
const
|
|
6644
|
+
const Ni = {
|
|
6639
6645
|
colors: {
|
|
6640
6646
|
primary: "#60a5fa",
|
|
6641
6647
|
primaryDark: "#3b82f6",
|
|
@@ -6711,7 +6717,7 @@ const Ei = {
|
|
|
6711
6717
|
darkBaseColor: "#0f172a",
|
|
6712
6718
|
darkHighlightColor: "#1e293b"
|
|
6713
6719
|
}
|
|
6714
|
-
},
|
|
6720
|
+
}, Mi = {
|
|
6715
6721
|
colors: {
|
|
6716
6722
|
primary: "#e11d48",
|
|
6717
6723
|
primaryDark: "#be123c",
|
|
@@ -6727,7 +6733,7 @@ const Ei = {
|
|
|
6727
6733
|
rowSelectedHoverBackground: "#fecdd3",
|
|
6728
6734
|
cellFocusBorder: "#e11d48"
|
|
6729
6735
|
}
|
|
6730
|
-
},
|
|
6736
|
+
}, Ii = {
|
|
6731
6737
|
colors: {
|
|
6732
6738
|
primary: "#059669",
|
|
6733
6739
|
primaryDark: "#047857",
|
|
@@ -6743,7 +6749,7 @@ const Ei = {
|
|
|
6743
6749
|
rowSelectedHoverBackground: "#a7f3d0",
|
|
6744
6750
|
cellFocusBorder: "#059669"
|
|
6745
6751
|
}
|
|
6746
|
-
},
|
|
6752
|
+
}, Pi = {
|
|
6747
6753
|
colors: {
|
|
6748
6754
|
primary: "#d97706",
|
|
6749
6755
|
primaryDark: "#b45309",
|
|
@@ -6759,7 +6765,7 @@ const Ei = {
|
|
|
6759
6765
|
rowSelectedHoverBackground: "#fde68a",
|
|
6760
6766
|
cellFocusBorder: "#d97706"
|
|
6761
6767
|
}
|
|
6762
|
-
},
|
|
6768
|
+
}, Li = {
|
|
6763
6769
|
grid: {
|
|
6764
6770
|
rowHeightCompact: "28px",
|
|
6765
6771
|
rowHeightStandard: "36px",
|
|
@@ -6773,7 +6779,7 @@ const Ei = {
|
|
|
6773
6779
|
fontSizeMd: "0.875rem"
|
|
6774
6780
|
}
|
|
6775
6781
|
};
|
|
6776
|
-
function
|
|
6782
|
+
function hi(n, t) {
|
|
6777
6783
|
try {
|
|
6778
6784
|
const e = t.getItem(n);
|
|
6779
6785
|
return e ? JSON.parse(e) : void 0;
|
|
@@ -6781,7 +6787,7 @@ function fi(n, t) {
|
|
|
6781
6787
|
return;
|
|
6782
6788
|
}
|
|
6783
6789
|
}
|
|
6784
|
-
function
|
|
6790
|
+
function pi(n, t, e, o) {
|
|
6785
6791
|
try {
|
|
6786
6792
|
const i = e ? Object.fromEntries(
|
|
6787
6793
|
Object.entries(t).filter(([l]) => e.includes(l))
|
|
@@ -6790,17 +6796,17 @@ function hi(n, t, e, o) {
|
|
|
6790
6796
|
} catch {
|
|
6791
6797
|
}
|
|
6792
6798
|
}
|
|
6793
|
-
function
|
|
6799
|
+
function Ti(n) {
|
|
6794
6800
|
const t = typeof n == "string" ? { key: n } : n, {
|
|
6795
6801
|
key: e,
|
|
6796
6802
|
debounceMs: o = 300,
|
|
6797
6803
|
include: i,
|
|
6798
6804
|
storage: l = typeof window < "u" ? window.localStorage : void 0
|
|
6799
|
-
} = t, a =
|
|
6805
|
+
} = t, a = le(() => {
|
|
6800
6806
|
if (l)
|
|
6801
|
-
return
|
|
6807
|
+
return hi(e, l);
|
|
6802
6808
|
}, [e, l]), s = J(null), c = J(null), d = z(() => {
|
|
6803
|
-
c.current && l &&
|
|
6809
|
+
c.current && l && pi(e, c.current, i, l);
|
|
6804
6810
|
}, [e, i, l]), g = z(
|
|
6805
6811
|
(h) => {
|
|
6806
6812
|
c.current = h, s.current && clearTimeout(s.current), s.current = setTimeout(d, o);
|
|
@@ -6817,31 +6823,31 @@ function Li(n) {
|
|
|
6817
6823
|
}
|
|
6818
6824
|
export {
|
|
6819
6825
|
Ot as Button,
|
|
6820
|
-
|
|
6826
|
+
Ar as Cell,
|
|
6821
6827
|
At as Checkbox,
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6828
|
+
wi as DataGrid,
|
|
6829
|
+
Ei as DataGridThemeProvider,
|
|
6830
|
+
Yr as FilterPanel,
|
|
6831
|
+
bi as GridToolbar,
|
|
6826
6832
|
Ft as GridTooltip,
|
|
6827
|
-
|
|
6828
|
-
|
|
6833
|
+
fr as Header,
|
|
6834
|
+
yi as Input,
|
|
6829
6835
|
dn as Row,
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6836
|
+
vi as Skeleton,
|
|
6837
|
+
Pi as amberTheme,
|
|
6838
|
+
Li as compactTheme,
|
|
6839
|
+
Ni as darkTheme,
|
|
6840
|
+
Ii as emeraldTheme,
|
|
6841
|
+
Ci as exportToCsv,
|
|
6842
|
+
ki as exportToExcel,
|
|
6843
|
+
Ri as exportToExcelAdvanced,
|
|
6844
|
+
Si as exportToJson,
|
|
6839
6845
|
He as formatAggregationValue,
|
|
6840
|
-
|
|
6841
|
-
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6846
|
+
ji as printGrid,
|
|
6847
|
+
Mi as roseTheme,
|
|
6848
|
+
qo as useAggregation,
|
|
6849
|
+
_i as useGridApiRef,
|
|
6850
|
+
Ti as useGridStateStorage,
|
|
6851
|
+
Sr as usePivot
|
|
6846
6852
|
};
|
|
6847
6853
|
//# sourceMappingURL=opengridx.es.js.map
|