@opencorestack/opengridx 0.1.2 → 0.1.3
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 +15 -0
- package/README.md +4 -2
- package/dist/opengridx.es.js +948 -949
- package/dist/opengridx.es.js.map +1 -1
- package/dist/opengridx.umd.js +11 -11
- package/dist/opengridx.umd.js.map +1 -1
- package/llms.txt +494 -0
- package/package.json +3 -2
package/dist/opengridx.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import pe, { useState as Q, useRef as ne, useCallback as
|
|
1
|
+
import pe, { useState as Q, useRef as ne, useCallback as F, useEffect as ee, useMemo as de, useReducer as Cr, useLayoutEffect as kr } from "react";
|
|
2
2
|
import Mt from "react-dom";
|
|
3
3
|
var Cn = { exports: {} }, ln = {};
|
|
4
4
|
var _o;
|
|
@@ -127,13 +127,13 @@ function jr() {
|
|
|
127
127
|
configurable: !0
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function g() {
|
|
131
131
|
var b = n(this.type);
|
|
132
132
|
return D[b] || (D[b] = !0, console.error(
|
|
133
133
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
134
134
|
)), b = this.props.ref, b !== void 0 ? b : null;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function u(b, H, T, A, O, Z) {
|
|
137
137
|
var U = T.ref;
|
|
138
138
|
return b = {
|
|
139
139
|
$$typeof: w,
|
|
@@ -143,7 +143,7 @@ function jr() {
|
|
|
143
143
|
_owner: A
|
|
144
144
|
}, (U !== void 0 ? U : null) !== null ? Object.defineProperty(b, "ref", {
|
|
145
145
|
enumerable: !1,
|
|
146
|
-
get:
|
|
146
|
+
get: g
|
|
147
147
|
}) : Object.defineProperty(b, "ref", { enumerable: !1, value: null }), b._store = {}, Object.defineProperty(b._store, "validated", {
|
|
148
148
|
configurable: !1,
|
|
149
149
|
enumerable: !1,
|
|
@@ -166,7 +166,7 @@ function jr() {
|
|
|
166
166
|
value: Z
|
|
167
167
|
}), Object.freeze && (Object.freeze(b.props), Object.freeze(b)), b;
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function h(b, H, T, A, O, Z) {
|
|
170
170
|
var U = H.children;
|
|
171
171
|
if (U !== void 0)
|
|
172
172
|
if (A)
|
|
@@ -205,7 +205,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
205
205
|
return U && s(
|
|
206
206
|
T,
|
|
207
207
|
typeof b == "function" ? b.displayName || b.name || "Unknown" : b
|
|
208
|
-
),
|
|
208
|
+
), u(
|
|
209
209
|
b,
|
|
210
210
|
U,
|
|
211
211
|
T,
|
|
@@ -215,26 +215,26 @@ React keys must be passed directly to JSX without using spread:
|
|
|
215
215
|
);
|
|
216
216
|
}
|
|
217
217
|
function m(b) {
|
|
218
|
-
|
|
218
|
+
c(b) ? b._store && (b._store.validated = 1) : typeof b == "object" && b !== null && b.$$typeof === p && (b._payload.status === "fulfilled" ? c(b._payload.value) && b._payload.value._store && (b._payload.value._store.validated = 1) : b._store && (b._store.validated = 1));
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function c(b) {
|
|
221
221
|
return typeof b == "object" && b !== null && b.$$typeof === w;
|
|
222
222
|
}
|
|
223
|
-
var
|
|
223
|
+
var f = pe, w = /* @__PURE__ */ Symbol.for("react.transitional.element"), x = /* @__PURE__ */ Symbol.for("react.portal"), N = /* @__PURE__ */ Symbol.for("react.fragment"), E = /* @__PURE__ */ Symbol.for("react.strict_mode"), j = /* @__PURE__ */ Symbol.for("react.profiler"), _ = /* @__PURE__ */ Symbol.for("react.consumer"), v = /* @__PURE__ */ Symbol.for("react.context"), S = /* @__PURE__ */ Symbol.for("react.forward_ref"), y = /* @__PURE__ */ Symbol.for("react.suspense"), I = /* @__PURE__ */ Symbol.for("react.suspense_list"), C = /* @__PURE__ */ Symbol.for("react.memo"), p = /* @__PURE__ */ Symbol.for("react.lazy"), k = /* @__PURE__ */ Symbol.for("react.activity"), L = /* @__PURE__ */ Symbol.for("react.client.reference"), B = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Y = Object.prototype.hasOwnProperty, $ = Array.isArray, K = console.createTask ? console.createTask : function() {
|
|
224
224
|
return null;
|
|
225
225
|
};
|
|
226
|
-
|
|
226
|
+
f = {
|
|
227
227
|
react_stack_bottom_frame: function(b) {
|
|
228
228
|
return b();
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
|
-
var q, D = {}, te =
|
|
232
|
-
|
|
231
|
+
var q, D = {}, te = f.react_stack_bottom_frame.bind(
|
|
232
|
+
f,
|
|
233
233
|
l
|
|
234
234
|
)(), J = K(r(l)), we = {};
|
|
235
235
|
sn.Fragment = N, sn.jsx = function(b, H, T) {
|
|
236
236
|
var A = 1e4 > B.recentlyCreatedOwnerStacks++;
|
|
237
|
-
return
|
|
237
|
+
return h(
|
|
238
238
|
b,
|
|
239
239
|
H,
|
|
240
240
|
T,
|
|
@@ -244,7 +244,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
244
244
|
);
|
|
245
245
|
}, sn.jsxs = function(b, H, T) {
|
|
246
246
|
var A = 1e4 > B.recentlyCreatedOwnerStacks++;
|
|
247
|
-
return
|
|
247
|
+
return h(
|
|
248
248
|
b,
|
|
249
249
|
H,
|
|
250
250
|
T,
|
|
@@ -270,15 +270,15 @@ function Er({
|
|
|
270
270
|
onRowClick: a,
|
|
271
271
|
onSelectionChange: s
|
|
272
272
|
}) {
|
|
273
|
-
const
|
|
273
|
+
const g = {
|
|
274
274
|
row: n,
|
|
275
275
|
value: void 0,
|
|
276
276
|
field: e.field,
|
|
277
277
|
colDef: { field: e.field },
|
|
278
278
|
rowIndex: o,
|
|
279
279
|
colIndex: 0
|
|
280
|
-
},
|
|
281
|
-
|
|
280
|
+
}, u = (h) => {
|
|
281
|
+
h.stopPropagation(), s?.(n.id, h.target.checked);
|
|
282
282
|
};
|
|
283
283
|
return /* @__PURE__ */ t.jsxs(
|
|
284
284
|
"div",
|
|
@@ -290,16 +290,16 @@ function Er({
|
|
|
290
290
|
"aria-rowindex": o + 2,
|
|
291
291
|
"aria-selected": r,
|
|
292
292
|
children: [
|
|
293
|
-
i && /* @__PURE__ */ t.jsx("div", { className: "ogx-list-view__checkbox", onClick: (
|
|
293
|
+
i && /* @__PURE__ */ t.jsx("div", { className: "ogx-list-view__checkbox", onClick: (h) => h.stopPropagation(), children: /* @__PURE__ */ t.jsx(
|
|
294
294
|
"input",
|
|
295
295
|
{
|
|
296
296
|
type: "checkbox",
|
|
297
297
|
checked: r,
|
|
298
|
-
onChange:
|
|
298
|
+
onChange: u,
|
|
299
299
|
"aria-label": `Select row ${n.id}`
|
|
300
300
|
}
|
|
301
301
|
) }),
|
|
302
|
-
/* @__PURE__ */ t.jsx("div", { className: "ogx-list-view__cell", role: "gridcell", children: e.renderCell(
|
|
302
|
+
/* @__PURE__ */ t.jsx("div", { className: "ogx-list-view__cell", role: "gridcell", children: e.renderCell(g) })
|
|
303
303
|
]
|
|
304
304
|
}
|
|
305
305
|
);
|
|
@@ -311,8 +311,8 @@ const Rn = ({
|
|
|
311
311
|
inputRef: r,
|
|
312
312
|
...i
|
|
313
313
|
}) => {
|
|
314
|
-
const l = pe.useRef(null), a = pe.useCallback((
|
|
315
|
-
l.current =
|
|
314
|
+
const l = pe.useRef(null), a = pe.useCallback((g) => {
|
|
315
|
+
l.current = g, typeof r == "function" ? r(g) : r && (r.current = g);
|
|
316
316
|
}, [r]);
|
|
317
317
|
pe.useEffect(() => {
|
|
318
318
|
l.current && (l.current.indeterminate = n);
|
|
@@ -341,36 +341,34 @@ const Rn = ({
|
|
|
341
341
|
] });
|
|
342
342
|
};
|
|
343
343
|
function Nr(n) {
|
|
344
|
-
const { field: o,
|
|
345
|
-
|
|
346
|
-
const h = d.target.closest(".ogx__header-cell");
|
|
347
|
-
h && (u.current = h.getBoundingClientRect().width);
|
|
344
|
+
const { field: o, currentWidth: e, onResize: r, minWidth: i = 50, maxWidth: l = 1e3 } = n, [a, s] = Q(!1), g = ne(0), u = ne(0), h = F((f) => {
|
|
345
|
+
f.preventDefault(), f.stopPropagation(), s(!0), g.current = f.clientX, u.current = e;
|
|
348
346
|
let w = 0;
|
|
349
347
|
const x = 16, N = (j) => {
|
|
350
|
-
const _ = j.clientX -
|
|
351
|
-
S - w >= x && (
|
|
348
|
+
const _ = j.clientX - g.current, v = Math.max(i, Math.min(l, u.current + _)), S = Date.now();
|
|
349
|
+
S - w >= x && (r(o, v), w = S);
|
|
352
350
|
}, E = (j) => {
|
|
353
|
-
|
|
354
|
-
const _ = j.clientX -
|
|
355
|
-
|
|
351
|
+
s(!1);
|
|
352
|
+
const _ = j.clientX - g.current, v = Math.max(i, Math.min(l, u.current + _));
|
|
353
|
+
r(o, v), document.removeEventListener("mousemove", N), document.removeEventListener("mouseup", E);
|
|
356
354
|
};
|
|
357
355
|
document.addEventListener("mousemove", N), document.addEventListener("mouseup", E);
|
|
358
|
-
}, [o, e, r, i]),
|
|
359
|
-
|
|
360
|
-
}, [
|
|
356
|
+
}, [o, e, r, i, l]), m = F((f) => {
|
|
357
|
+
f.preventDefault(), f.stopPropagation();
|
|
358
|
+
}, []), c = [
|
|
361
359
|
"ogx-column-resize-handle",
|
|
362
|
-
|
|
360
|
+
a && "ogx-column-resize-handle--dragging"
|
|
363
361
|
].filter(Boolean).join(" ");
|
|
364
362
|
return /* @__PURE__ */ t.jsx(
|
|
365
363
|
"div",
|
|
366
364
|
{
|
|
367
|
-
className:
|
|
368
|
-
onMouseDown:
|
|
369
|
-
onClick: (
|
|
370
|
-
onDragStart: (
|
|
371
|
-
|
|
365
|
+
className: c,
|
|
366
|
+
onMouseDown: h,
|
|
367
|
+
onClick: (f) => f.stopPropagation(),
|
|
368
|
+
onDragStart: (f) => {
|
|
369
|
+
f.preventDefault(), f.stopPropagation();
|
|
372
370
|
},
|
|
373
|
-
onDoubleClick:
|
|
371
|
+
onDoubleClick: m,
|
|
374
372
|
role: "separator",
|
|
375
373
|
"aria-orientation": "vertical",
|
|
376
374
|
"aria-label": `Resize ${o} column`,
|
|
@@ -387,28 +385,28 @@ function Ir(n, o) {
|
|
|
387
385
|
const a = En(l.field, o);
|
|
388
386
|
a === "left" ? e.push(l) : a === "right" ? i.push(l) : r.push(l);
|
|
389
387
|
}), o.left && e.sort((l, a) => {
|
|
390
|
-
const s = o.left.indexOf(l.field),
|
|
391
|
-
return s -
|
|
388
|
+
const s = o.left.indexOf(l.field), g = o.left.indexOf(a.field);
|
|
389
|
+
return s - g;
|
|
392
390
|
}), o.right && i.sort((l, a) => {
|
|
393
|
-
const s = o.right.indexOf(l.field),
|
|
394
|
-
return s -
|
|
391
|
+
const s = o.right.indexOf(l.field), g = o.right.indexOf(a.field);
|
|
392
|
+
return s - g;
|
|
395
393
|
}), { left: e, center: r, right: i }) : { left: e, center: n, right: i };
|
|
396
394
|
}
|
|
397
395
|
function Ro(n, o, e, r, i, l, a, s) {
|
|
398
|
-
const
|
|
399
|
-
if (!e) return
|
|
400
|
-
const
|
|
401
|
-
let
|
|
402
|
-
s && (
|
|
403
|
-
|
|
404
|
-
const
|
|
405
|
-
|
|
396
|
+
const g = {};
|
|
397
|
+
if (!e) return g;
|
|
398
|
+
const u = Ir(n, e);
|
|
399
|
+
let h = 0;
|
|
400
|
+
s && (h += 48), l && a && (h += 48), r && i && (h += 48), u.left.forEach((c) => {
|
|
401
|
+
g[c.field] = h;
|
|
402
|
+
const f = o[c.field] ?? c.width ?? 100;
|
|
403
|
+
h += f;
|
|
406
404
|
});
|
|
407
405
|
let m = 0;
|
|
408
|
-
return [...
|
|
409
|
-
const
|
|
410
|
-
|
|
411
|
-
}),
|
|
406
|
+
return [...u.right].reverse().forEach((c) => {
|
|
407
|
+
const f = o[c.field] ?? c.width ?? 100;
|
|
408
|
+
g[c.field] = m, m += f;
|
|
409
|
+
}), g;
|
|
412
410
|
}
|
|
413
411
|
function qn(n, o) {
|
|
414
412
|
return o ? o.top?.includes(n) ? "top" : o.bottom?.includes(n) ? "bottom" : null : null;
|
|
@@ -419,11 +417,11 @@ function Pr(n, o) {
|
|
|
419
417
|
const a = qn(l.id, o);
|
|
420
418
|
a === "top" ? e.push(l) : a === "bottom" ? i.push(l) : r.push(l);
|
|
421
419
|
}), o.top && e.sort((l, a) => {
|
|
422
|
-
const s = o.top.indexOf(l.id),
|
|
423
|
-
return s -
|
|
420
|
+
const s = o.top.indexOf(l.id), g = o.top.indexOf(a.id);
|
|
421
|
+
return s - g;
|
|
424
422
|
}), o.bottom && i.sort((l, a) => {
|
|
425
|
-
const s = o.bottom.indexOf(l.id),
|
|
426
|
-
return s -
|
|
423
|
+
const s = o.bottom.indexOf(l.id), g = o.bottom.indexOf(a.id);
|
|
424
|
+
return s - g;
|
|
427
425
|
}), { top: e, center: r, bottom: i }) : { top: e, center: n, bottom: i };
|
|
428
426
|
}
|
|
429
427
|
function Yt() {
|
|
@@ -454,10 +452,10 @@ function Tr() {
|
|
|
454
452
|
/* @__PURE__ */ t.jsx("polyline", { points: "19 12 12 19 5 12" })
|
|
455
453
|
] });
|
|
456
454
|
}
|
|
457
|
-
function
|
|
455
|
+
function Wr() {
|
|
458
456
|
return /* @__PURE__ */ t.jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", children: /* @__PURE__ */ t.jsx("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
|
|
459
457
|
}
|
|
460
|
-
function
|
|
458
|
+
function Fr() {
|
|
461
459
|
return /* @__PURE__ */ t.jsxs("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
462
460
|
/* @__PURE__ */ t.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" }),
|
|
463
461
|
/* @__PURE__ */ t.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" }),
|
|
@@ -485,18 +483,18 @@ function zr() {
|
|
|
485
483
|
/* @__PURE__ */ t.jsx("line", { x1: "4", y1: "12", x2: "20", y2: "12" })
|
|
486
484
|
] });
|
|
487
485
|
}
|
|
488
|
-
function Br({ colDef: n, sortModel: o, onSort: e, onHide: r, onPin: i, pinnedColumns: l, onManageColumns: a, onClose: s, anchorEl:
|
|
489
|
-
const
|
|
486
|
+
function Br({ colDef: n, sortModel: o, onSort: e, onHide: r, onPin: i, pinnedColumns: l, onManageColumns: a, onClose: s, anchorEl: g }) {
|
|
487
|
+
const u = ne(null), [h, m] = Q({ position: "fixed", zIndex: 1300, top: 0, left: 0, visibility: "hidden" });
|
|
490
488
|
pe.useLayoutEffect(() => {
|
|
491
|
-
if (!
|
|
492
|
-
const S =
|
|
489
|
+
if (!g || !u.current) return;
|
|
490
|
+
const S = g.getBoundingClientRect(), y = u.current.getBoundingClientRect(), I = window.innerWidth, C = window.innerHeight, p = 8;
|
|
493
491
|
let k = S.left;
|
|
494
492
|
k + y.width + p > I && (k = I - y.width - p), k < p && (k = p);
|
|
495
493
|
let L = S.bottom + 4;
|
|
496
494
|
L + y.height + p > C && (L = S.top - y.height - 4), m({ position: "fixed", zIndex: 1300, top: L, left: k, visibility: "visible" });
|
|
497
|
-
}, [
|
|
495
|
+
}, [g]), ee(() => {
|
|
498
496
|
function S(I) {
|
|
499
|
-
|
|
497
|
+
u.current && !u.current.contains(I.target) && g && !g.contains(I.target) && s();
|
|
500
498
|
}
|
|
501
499
|
function y(I) {
|
|
502
500
|
I.key === "Escape" && s();
|
|
@@ -504,22 +502,22 @@ function Br({ colDef: n, sortModel: o, onSort: e, onHide: r, onPin: i, pinnedCol
|
|
|
504
502
|
return document.addEventListener("mousedown", S), document.addEventListener("keydown", y), () => {
|
|
505
503
|
document.removeEventListener("mousedown", S), document.removeEventListener("keydown", y);
|
|
506
504
|
};
|
|
507
|
-
}, [
|
|
508
|
-
const
|
|
505
|
+
}, [g, s]);
|
|
506
|
+
const c = (S) => {
|
|
509
507
|
e?.(n.field, S), s();
|
|
510
|
-
},
|
|
508
|
+
}, f = () => {
|
|
511
509
|
r?.(n.field), s();
|
|
512
510
|
}, w = (S) => {
|
|
513
511
|
i?.(n.field, S), s();
|
|
514
512
|
}, x = o?.find((S) => S.field === n.field)?.sort, N = x == null, E = l?.left?.includes(n.field) ?? !1, j = l?.right?.includes(n.field) ?? !1, _ = !E && !j, v = n.headerName || n.field;
|
|
515
513
|
return Mt.createPortal(
|
|
516
|
-
/* @__PURE__ */ t.jsxs("div", { ref:
|
|
514
|
+
/* @__PURE__ */ t.jsxs("div", { ref: u, className: "ogx-column-menu", style: h, role: "menu", "aria-label": `Column options for ${v}`, children: [
|
|
517
515
|
e && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
518
516
|
/* @__PURE__ */ t.jsxs(
|
|
519
517
|
"button",
|
|
520
518
|
{
|
|
521
519
|
className: `ogx-menu-item${x === "asc" ? " ogx-menu-item--active" : ""}`,
|
|
522
|
-
onClick: () =>
|
|
520
|
+
onClick: () => c("asc"),
|
|
523
521
|
role: "menuitemradio",
|
|
524
522
|
"aria-checked": x === "asc",
|
|
525
523
|
children: [
|
|
@@ -533,7 +531,7 @@ function Br({ colDef: n, sortModel: o, onSort: e, onHide: r, onPin: i, pinnedCol
|
|
|
533
531
|
"button",
|
|
534
532
|
{
|
|
535
533
|
className: `ogx-menu-item${x === "desc" ? " ogx-menu-item--active" : ""}`,
|
|
536
|
-
onClick: () =>
|
|
534
|
+
onClick: () => c("desc"),
|
|
537
535
|
role: "menuitemradio",
|
|
538
536
|
"aria-checked": x === "desc",
|
|
539
537
|
children: [
|
|
@@ -547,12 +545,12 @@ function Br({ colDef: n, sortModel: o, onSort: e, onHide: r, onPin: i, pinnedCol
|
|
|
547
545
|
"button",
|
|
548
546
|
{
|
|
549
547
|
className: `ogx-menu-item${N ? " ogx-menu-item--active" : ""}`,
|
|
550
|
-
onClick: () =>
|
|
548
|
+
onClick: () => c(null),
|
|
551
549
|
role: "menuitemradio",
|
|
552
550
|
"aria-checked": N,
|
|
553
551
|
children: [
|
|
554
552
|
/* @__PURE__ */ t.jsx("span", { className: "ogx-menu-item__indicator", "aria-hidden": "true", children: N ? /* @__PURE__ */ t.jsx(Yt, {}) : /* @__PURE__ */ t.jsx(Xt, {}) }),
|
|
555
|
-
/* @__PURE__ */ t.jsx("span", { className: "ogx-menu-item__icon", "aria-hidden": "true", children: /* @__PURE__ */ t.jsx(
|
|
553
|
+
/* @__PURE__ */ t.jsx("span", { className: "ogx-menu-item__icon", "aria-hidden": "true", children: /* @__PURE__ */ t.jsx(Wr, {}) }),
|
|
556
554
|
"Unsort"
|
|
557
555
|
]
|
|
558
556
|
}
|
|
@@ -606,9 +604,9 @@ function Br({ colDef: n, sortModel: o, onSort: e, onHide: r, onPin: i, pinnedCol
|
|
|
606
604
|
}
|
|
607
605
|
),
|
|
608
606
|
/* @__PURE__ */ t.jsx("div", { className: "ogx-menu-divider" }),
|
|
609
|
-
/* @__PURE__ */ t.jsxs("button", { className: "ogx-menu-item", onClick:
|
|
607
|
+
/* @__PURE__ */ t.jsxs("button", { className: "ogx-menu-item", onClick: f, role: "menuitem", "aria-label": `Hide ${v} column`, children: [
|
|
610
608
|
/* @__PURE__ */ t.jsx("span", { className: "ogx-menu-item__indicator", "aria-hidden": "true" }),
|
|
611
|
-
/* @__PURE__ */ t.jsx("span", { className: "ogx-menu-item__icon", "aria-hidden": "true", children: /* @__PURE__ */ t.jsx(
|
|
609
|
+
/* @__PURE__ */ t.jsx("span", { className: "ogx-menu-item__icon", "aria-hidden": "true", children: /* @__PURE__ */ t.jsx(Fr, {}) }),
|
|
612
610
|
"Hide Column"
|
|
613
611
|
] }),
|
|
614
612
|
/* @__PURE__ */ t.jsx("div", { className: "ogx-menu-divider" }),
|
|
@@ -644,34 +642,34 @@ function Dr(n) {
|
|
|
644
642
|
return n.forEach((r) => e(r, 1)), o;
|
|
645
643
|
}
|
|
646
644
|
function Gr(n, o, e) {
|
|
647
|
-
function r(s,
|
|
648
|
-
if (!Eo(s).includes(
|
|
649
|
-
if (
|
|
650
|
-
for (const
|
|
651
|
-
if (typeof
|
|
652
|
-
const m = r(
|
|
645
|
+
function r(s, g, u) {
|
|
646
|
+
if (!Eo(s).includes(g)) return null;
|
|
647
|
+
if (u === e) return s;
|
|
648
|
+
for (const h of s.children)
|
|
649
|
+
if (typeof h != "string") {
|
|
650
|
+
const m = r(h, g, u + 1);
|
|
653
651
|
if (m) return m;
|
|
654
652
|
}
|
|
655
653
|
return null;
|
|
656
654
|
}
|
|
657
655
|
const i = /* @__PURE__ */ new Map();
|
|
658
656
|
for (const s of o) {
|
|
659
|
-
let
|
|
660
|
-
for (const
|
|
661
|
-
if (
|
|
662
|
-
i.set(s.field,
|
|
657
|
+
let g = null;
|
|
658
|
+
for (const u of n)
|
|
659
|
+
if (g = r(u, s.field, 0), g) break;
|
|
660
|
+
i.set(s.field, g);
|
|
663
661
|
}
|
|
664
662
|
const l = [];
|
|
665
663
|
let a = 0;
|
|
666
664
|
for (; a < o.length; ) {
|
|
667
|
-
const s = o[a],
|
|
668
|
-
if (!
|
|
669
|
-
l.push({ key: `fg-${s.field}-${e}`, label: "", width:
|
|
665
|
+
const s = o[a], g = i.get(s.field) ?? null, u = s.width;
|
|
666
|
+
if (!g)
|
|
667
|
+
l.push({ key: `fg-${s.field}-${e}`, label: "", width: u, isGroup: !1 }), a++;
|
|
670
668
|
else {
|
|
671
|
-
let
|
|
672
|
-
for (; m < o.length && i.get(o[m].field) ===
|
|
673
|
-
|
|
674
|
-
l.push({ key: `${
|
|
669
|
+
let h = 0, m = a;
|
|
670
|
+
for (; m < o.length && i.get(o[m].field) === g; )
|
|
671
|
+
h += o[m].width, m++;
|
|
672
|
+
l.push({ key: `${g.groupId}-${e}`, label: g.headerName, width: h, isGroup: !0 }), a = m;
|
|
675
673
|
}
|
|
676
674
|
}
|
|
677
675
|
return l;
|
|
@@ -685,12 +683,12 @@ function Vr(n) {
|
|
|
685
683
|
allSelected: l = !1,
|
|
686
684
|
someSelected: a = !1,
|
|
687
685
|
onSelectAll: s,
|
|
688
|
-
onSort:
|
|
689
|
-
sortModel:
|
|
690
|
-
onColumnResize:
|
|
686
|
+
onSort: g,
|
|
687
|
+
sortModel: u = [],
|
|
688
|
+
onColumnResize: h,
|
|
691
689
|
columnWidths: m = {},
|
|
692
|
-
pinnedColumns:
|
|
693
|
-
hasDetailPanel:
|
|
690
|
+
pinnedColumns: c,
|
|
691
|
+
hasDetailPanel: f = !1,
|
|
694
692
|
pinCheckboxColumn: w = !0,
|
|
695
693
|
pinExpandColumn: x = !0,
|
|
696
694
|
rowReordering: N = !1,
|
|
@@ -718,26 +716,26 @@ function Vr(n) {
|
|
|
718
716
|
}
|
|
719
717
|
}, [C]);
|
|
720
718
|
const te = (P) => () => {
|
|
721
|
-
if (P.sortable === !1 || !
|
|
722
|
-
const ce =
|
|
719
|
+
if (P.sortable === !1 || !g) return;
|
|
720
|
+
const ce = u.find((ve) => ve.field === P.field);
|
|
723
721
|
let ie = "asc";
|
|
724
|
-
ce && (ce.sort === "asc" ? ie = "desc" : ie = null),
|
|
722
|
+
ce && (ce.sort === "asc" ? ie = "desc" : ie = null), g(P.field, ie);
|
|
725
723
|
}, J = (P) => {
|
|
726
|
-
const ce =
|
|
724
|
+
const ce = u.find((ie) => ie.field === P);
|
|
727
725
|
return ce ? /* @__PURE__ */ t.jsx("span", { className: `ogx__sort-icon ogx__sort-icon--${ce.sort}`, "aria-hidden": "true" }) : null;
|
|
728
726
|
}, we = pe.useMemo(() => Ro(
|
|
729
727
|
o,
|
|
730
728
|
m,
|
|
731
|
-
|
|
729
|
+
c,
|
|
732
730
|
i,
|
|
733
731
|
w,
|
|
734
|
-
|
|
732
|
+
f,
|
|
735
733
|
x,
|
|
736
734
|
N
|
|
737
|
-
), [o, m,
|
|
735
|
+
), [o, m, c, i, w, f, x, N]), b = r ? Dr(r) : 0, T = (e ?? o).filter((P) => !P.isSpacer).map((P) => ({
|
|
738
736
|
field: P.field,
|
|
739
737
|
width: m[P.field] ?? P.width ?? 100
|
|
740
|
-
})), U = (N ? 48 : 0) + (
|
|
738
|
+
})), U = (N ? 48 : 0) + (f ? 48 : 0) + (i ? 48 : 0);
|
|
741
739
|
return (
|
|
742
740
|
// Outer sticky wrapper — both group rows AND column header row live here
|
|
743
741
|
// so they ALL stay sticky together and scroll horizontally as one unit.
|
|
@@ -787,7 +785,7 @@ function Vr(n) {
|
|
|
787
785
|
}
|
|
788
786
|
}
|
|
789
787
|
),
|
|
790
|
-
|
|
788
|
+
f && /* @__PURE__ */ t.jsx(
|
|
791
789
|
"div",
|
|
792
790
|
{
|
|
793
791
|
className: `ogx__header-cell ogx__header-cell--expand ${x ? "ogx__header-cell--pinned ogx__header-cell--pinned-left" : ""}`,
|
|
@@ -809,7 +807,7 @@ function Vr(n) {
|
|
|
809
807
|
role: "columnheader",
|
|
810
808
|
style: {
|
|
811
809
|
position: w ? "sticky" : void 0,
|
|
812
|
-
left: w ? (N ? 48 : 0) + (
|
|
810
|
+
left: w ? (N ? 48 : 0) + (f && x ? 48 : 0) : void 0
|
|
813
811
|
},
|
|
814
812
|
children: /* @__PURE__ */ t.jsx(
|
|
815
813
|
Rn,
|
|
@@ -839,7 +837,7 @@ function Vr(n) {
|
|
|
839
837
|
},
|
|
840
838
|
P.field
|
|
841
839
|
);
|
|
842
|
-
const ie = P.sortable !== !1, ve =
|
|
840
|
+
const ie = P.sortable !== !1, ve = u.some((Be) => Be.field === P.field), nt = P.resizable !== !1, z = En(P.field, c), Ne = z !== null, Ie = j === P.field, ft = _ === P.field, Ge = [
|
|
843
841
|
"ogx__header-cell",
|
|
844
842
|
`ogx__header-cell--align-${P.headerAlign || P.align || "left"}`,
|
|
845
843
|
ie && "ogx__header-cell--sortable",
|
|
@@ -850,8 +848,8 @@ function Vr(n) {
|
|
|
850
848
|
ft && "ogx__header-cell--drag-over",
|
|
851
849
|
C?.id === "HEADER" && C.field === P.field && "ogx__header-cell--focused",
|
|
852
850
|
P.headerClassName
|
|
853
|
-
].filter(Boolean).join(" "), ht = {
|
|
854
|
-
width:
|
|
851
|
+
].filter(Boolean).join(" "), ht = m[P.field] ?? P.width ?? 100, pt = {
|
|
852
|
+
width: ht,
|
|
855
853
|
minWidth: P.minWidth,
|
|
856
854
|
maxWidth: P.maxWidth,
|
|
857
855
|
flexGrow: P.flex ?? 0,
|
|
@@ -864,7 +862,7 @@ function Vr(n) {
|
|
|
864
862
|
};
|
|
865
863
|
if (Ne && z) {
|
|
866
864
|
const Be = we[P.field];
|
|
867
|
-
z === "left" ?
|
|
865
|
+
z === "left" ? pt.left = Be : pt.right = Be;
|
|
868
866
|
}
|
|
869
867
|
const Qt = P.renderHeader ? P.renderHeader({ field: P.field, colDef: P, colIndex: ce }) : P.headerName || P.field, Lt = (Be) => {
|
|
870
868
|
if (Be.target.closest(".ogx-column-resize-handle")) {
|
|
@@ -872,20 +870,20 @@ function Vr(n) {
|
|
|
872
870
|
return;
|
|
873
871
|
}
|
|
874
872
|
p?.(P.field), ie && te(P)();
|
|
875
|
-
}, Rt = v ? v(P.field) : void 0, Tt = S ? S(P.field) : void 0,
|
|
873
|
+
}, Rt = v ? v(P.field) : void 0, Tt = S ? S(P.field) : void 0, yt = I ? I(P.field) : void 0;
|
|
876
874
|
return /* @__PURE__ */ t.jsxs(
|
|
877
875
|
"div",
|
|
878
876
|
{
|
|
879
877
|
className: Ge,
|
|
880
|
-
style:
|
|
878
|
+
style: pt,
|
|
881
879
|
onClick: Lt,
|
|
882
880
|
role: "columnheader",
|
|
883
881
|
draggable: !!v,
|
|
884
882
|
onDragStart: Rt,
|
|
885
883
|
onDragOver: Tt,
|
|
886
884
|
onDragEnd: y,
|
|
887
|
-
onDrop:
|
|
888
|
-
"aria-sort": ie ? ve ?
|
|
885
|
+
onDrop: yt,
|
|
886
|
+
"aria-sort": ie ? ve ? u.find((Be) => Be.field === P.field)?.sort === "asc" ? "ascending" : "descending" : "none" : void 0,
|
|
889
887
|
"aria-colindex": ce + 1 + (i ? 1 : 0),
|
|
890
888
|
"data-field": P.field,
|
|
891
889
|
tabIndex: -1,
|
|
@@ -912,11 +910,12 @@ function Vr(n) {
|
|
|
912
910
|
}
|
|
913
911
|
)
|
|
914
912
|
] }),
|
|
915
|
-
nt &&
|
|
913
|
+
nt && h && /* @__PURE__ */ t.jsx(
|
|
916
914
|
Nr,
|
|
917
915
|
{
|
|
918
916
|
field: P.field,
|
|
919
|
-
|
|
917
|
+
currentWidth: ht,
|
|
918
|
+
onResize: h,
|
|
920
919
|
minWidth: P.minWidth,
|
|
921
920
|
maxWidth: P.maxWidth
|
|
922
921
|
}
|
|
@@ -930,11 +929,11 @@ function Vr(n) {
|
|
|
930
929
|
Br,
|
|
931
930
|
{
|
|
932
931
|
colDef: $.colDef,
|
|
933
|
-
sortModel:
|
|
934
|
-
onSort:
|
|
932
|
+
sortModel: u,
|
|
933
|
+
onSort: g,
|
|
935
934
|
onHide: k,
|
|
936
935
|
onPin: L,
|
|
937
|
-
pinnedColumns:
|
|
936
|
+
pinnedColumns: c,
|
|
938
937
|
onManageColumns: B,
|
|
939
938
|
onClose: D,
|
|
940
939
|
anchorEl: $.anchorEl
|
|
@@ -977,8 +976,8 @@ function Kr({ value: n, onValueChange: o, onCommit: e, onCancel: r }) {
|
|
|
977
976
|
className: "ogx__edit-input ogx__edit-input--number",
|
|
978
977
|
value: i,
|
|
979
978
|
onChange: (s) => {
|
|
980
|
-
const
|
|
981
|
-
l(
|
|
979
|
+
const g = s.target.value === "" ? "" : Number(s.target.value);
|
|
980
|
+
l(g), o(g === "" ? null : g);
|
|
982
981
|
},
|
|
983
982
|
onBlur: e,
|
|
984
983
|
onKeyDown: (s) => {
|
|
@@ -1029,8 +1028,8 @@ function Xr({ value: n, colDef: o, onValueChange: e, onCommit: r, onCancel: i })
|
|
|
1029
1028
|
s.key === "Enter" && (s.stopPropagation(), r()), s.key === "Escape" && (s.stopPropagation(), i());
|
|
1030
1029
|
},
|
|
1031
1030
|
children: a.map((s) => {
|
|
1032
|
-
const
|
|
1033
|
-
return /* @__PURE__ */ t.jsx("option", { value: String(
|
|
1031
|
+
const g = typeof s == "object" ? s.value : s, u = typeof s == "object" ? s.label : String(s);
|
|
1032
|
+
return /* @__PURE__ */ t.jsx("option", { value: String(g), children: u }, String(g));
|
|
1034
1033
|
})
|
|
1035
1034
|
}
|
|
1036
1035
|
);
|
|
@@ -1080,12 +1079,12 @@ function Qr(n) {
|
|
|
1080
1079
|
row: l,
|
|
1081
1080
|
colDef: a,
|
|
1082
1081
|
rowIndex: s,
|
|
1083
|
-
colIndex:
|
|
1084
|
-
isSelected:
|
|
1085
|
-
onClick:
|
|
1082
|
+
colIndex: g,
|
|
1083
|
+
isSelected: u,
|
|
1084
|
+
onClick: h,
|
|
1086
1085
|
width: m,
|
|
1087
|
-
pinnedPosition:
|
|
1088
|
-
pinnedOffset:
|
|
1086
|
+
pinnedPosition: c,
|
|
1087
|
+
pinnedOffset: f,
|
|
1089
1088
|
isFocused: w,
|
|
1090
1089
|
isFocusVisible: x,
|
|
1091
1090
|
isEditable: N,
|
|
@@ -1107,7 +1106,7 @@ function Qr(n) {
|
|
|
1107
1106
|
style: { width: m ?? a.width ?? 100 },
|
|
1108
1107
|
role: "presentation",
|
|
1109
1108
|
"data-field": a.field,
|
|
1110
|
-
"data-colindex":
|
|
1109
|
+
"data-colindex": g
|
|
1111
1110
|
}
|
|
1112
1111
|
);
|
|
1113
1112
|
const C = (b) => {
|
|
@@ -1117,8 +1116,8 @@ function Qr(n) {
|
|
|
1117
1116
|
value: i,
|
|
1118
1117
|
colDef: a,
|
|
1119
1118
|
rowIndex: s,
|
|
1120
|
-
colIndex:
|
|
1121
|
-
})),
|
|
1119
|
+
colIndex: g
|
|
1120
|
+
})), h?.(b);
|
|
1122
1121
|
}, p = pe.useCallback((b) => {
|
|
1123
1122
|
r ? r(a.field, b) : v?.(b);
|
|
1124
1123
|
}, [r, v, a.field]), k = (b) => {
|
|
@@ -1133,7 +1132,7 @@ function Qr(n) {
|
|
|
1133
1132
|
field: a.field,
|
|
1134
1133
|
colDef: a,
|
|
1135
1134
|
rowIndex: s,
|
|
1136
|
-
colIndex:
|
|
1135
|
+
colIndex: g
|
|
1137
1136
|
}) : /* @__PURE__ */ t.jsx(
|
|
1138
1137
|
Jr,
|
|
1139
1138
|
{
|
|
@@ -1142,7 +1141,7 @@ function Qr(n) {
|
|
|
1142
1141
|
field: a.field,
|
|
1143
1142
|
colDef: a,
|
|
1144
1143
|
rowIndex: s,
|
|
1145
|
-
colIndex:
|
|
1144
|
+
colIndex: g,
|
|
1146
1145
|
onValueChange: p,
|
|
1147
1146
|
onCommit: () => _(),
|
|
1148
1147
|
onCancel: () => _(!0)
|
|
@@ -1153,16 +1152,16 @@ function Qr(n) {
|
|
|
1153
1152
|
field: a.field,
|
|
1154
1153
|
colDef: a,
|
|
1155
1154
|
rowIndex: s,
|
|
1156
|
-
colIndex:
|
|
1157
|
-
}) : L, [i, l, a, s,
|
|
1155
|
+
colIndex: g
|
|
1156
|
+
}) : L, [i, l, a, s, g, L, E, p, _, r, v]), Y = c != null, $ = pe.useMemo(() => a.cellClassName ? typeof a.cellClassName == "function" ? a.cellClassName({ value: i, row: l, field: a.field, colDef: a, rowIndex: s, colIndex: g }) || "" : a.cellClassName : "", [a, i, l, s, g]), K = [
|
|
1158
1157
|
"ogx__cell",
|
|
1159
1158
|
`ogx__cell--align-${a.align || "left"}`,
|
|
1160
|
-
|
|
1159
|
+
u && "ogx__cell--selected",
|
|
1161
1160
|
w && "ogx__cell--focused",
|
|
1162
1161
|
w && x && "ogx__cell--focus-visible",
|
|
1163
1162
|
a.type && `ogx__cell--type-${a.type}`,
|
|
1164
1163
|
Y && "ogx__cell--pinned",
|
|
1165
|
-
Y && `ogx__cell--pinned-${
|
|
1164
|
+
Y && `ogx__cell--pinned-${c}`,
|
|
1166
1165
|
E && "ogx__cell--editing",
|
|
1167
1166
|
y && y > 1 && "ogx__cell--spanned",
|
|
1168
1167
|
$
|
|
@@ -1179,7 +1178,7 @@ function Qr(n) {
|
|
|
1179
1178
|
zIndex: a.zIndex ?? (Y ? 3 : void 0),
|
|
1180
1179
|
padding: E ? 0 : void 0
|
|
1181
1180
|
};
|
|
1182
|
-
D > 1 && (J.height = `calc(var(--height) * ${D} - var(--border-width, 1px))`, J.zIndex = 10, Y && (J.zIndex = 40)), Y &&
|
|
1181
|
+
D > 1 && (J.height = `calc(var(--height) * ${D} - var(--border-width, 1px))`, J.zIndex = 10, Y && (J.zIndex = 40)), Y && f !== void 0 && (c === "left" ? J.left = f : J.right = f);
|
|
1183
1182
|
const we = pe.useRef(null);
|
|
1184
1183
|
return pe.useLayoutEffect(() => {
|
|
1185
1184
|
w && we.current && we.current.focus({ preventScroll: !0 });
|
|
@@ -1192,11 +1191,11 @@ function Qr(n) {
|
|
|
1192
1191
|
onClick: C,
|
|
1193
1192
|
onDoubleClick: k,
|
|
1194
1193
|
role: "gridcell",
|
|
1195
|
-
"aria-colindex":
|
|
1194
|
+
"aria-colindex": g + 1,
|
|
1196
1195
|
"aria-readonly": !N || void 0,
|
|
1197
1196
|
tabIndex: -1,
|
|
1198
1197
|
"data-field": a.field,
|
|
1199
|
-
"data-colindex":
|
|
1198
|
+
"data-colindex": g,
|
|
1200
1199
|
...q > 1 ? { "aria-colspan": q } : {},
|
|
1201
1200
|
...D > 1 ? { "aria-rowspan": D } : {},
|
|
1202
1201
|
children: /* @__PURE__ */ t.jsx("div", { className: "ogx__cell-content", children: B })
|
|
@@ -1306,12 +1305,12 @@ function kn(n) {
|
|
|
1306
1305
|
checkboxSelection: l = !1,
|
|
1307
1306
|
onRowClick: a,
|
|
1308
1307
|
onCellClick: s,
|
|
1309
|
-
onSelectionChange:
|
|
1310
|
-
columnWidths:
|
|
1311
|
-
pinnedColumns:
|
|
1308
|
+
onSelectionChange: g,
|
|
1309
|
+
columnWidths: u = {},
|
|
1310
|
+
pinnedColumns: h,
|
|
1312
1311
|
pinnedRows: m,
|
|
1313
|
-
hasDetailPanel:
|
|
1314
|
-
isDetailPanelExpanded:
|
|
1312
|
+
hasDetailPanel: c = !1,
|
|
1313
|
+
isDetailPanelExpanded: f = !1,
|
|
1315
1314
|
onDetailPanelToggle: w,
|
|
1316
1315
|
detailPanelContent: x,
|
|
1317
1316
|
detailPanelHeight: N = 200,
|
|
@@ -1353,19 +1352,19 @@ function kn(n) {
|
|
|
1353
1352
|
const b = (z) => {
|
|
1354
1353
|
z.target.closest(".ogx-checkbox-wrapper, .ogx-expand-icon, .ogx-drag-handle, .ogx__edit-cell") || a?.({ row: o, id: o.id, rowIndex: r });
|
|
1355
1354
|
}, H = (z) => {
|
|
1356
|
-
z.stopPropagation(),
|
|
1355
|
+
z.stopPropagation(), g?.(o.id, z.target.checked);
|
|
1357
1356
|
}, T = (z) => {
|
|
1358
1357
|
z.stopPropagation(), w?.(o.id);
|
|
1359
1358
|
}, A = pe.useMemo(() => Ro(
|
|
1360
1359
|
e,
|
|
1361
|
-
|
|
1362
|
-
|
|
1360
|
+
u,
|
|
1361
|
+
h,
|
|
1363
1362
|
l,
|
|
1364
1363
|
E,
|
|
1365
|
-
|
|
1364
|
+
c,
|
|
1366
1365
|
j,
|
|
1367
1366
|
_
|
|
1368
|
-
), [e,
|
|
1367
|
+
), [e, u, h, l, E, c, j, _]), O = qn(o.id, m), Z = O === "top", U = O === "bottom", P = o._hasChildren === !0, ce = pe.useCallback((z, Ne) => {
|
|
1369
1368
|
P || L?.({ id: o.id, field: z, value: Ne });
|
|
1370
1369
|
}, [P, o.id, L]), ie = pe.useCallback((z, Ne) => {
|
|
1371
1370
|
Y?.({ id: o.id, field: z, value: Ne });
|
|
@@ -1419,13 +1418,13 @@ function kn(n) {
|
|
|
1419
1418
|
children: /* @__PURE__ */ t.jsx(ei, {})
|
|
1420
1419
|
}
|
|
1421
1420
|
),
|
|
1422
|
-
|
|
1421
|
+
c && /* @__PURE__ */ t.jsx(
|
|
1423
1422
|
"div",
|
|
1424
1423
|
{
|
|
1425
1424
|
className: `ogx__cell ogx__cell--expand ${j ? "ogx__cell--pinned-left" : ""} ${$ === "__expand_col__" ? "ogx__cell--focused" : ""} ${$ === "__expand_col__" && K ? "ogx__cell--focus-visible" : ""}`,
|
|
1426
1425
|
role: "gridcell",
|
|
1427
|
-
"aria-label":
|
|
1428
|
-
"aria-expanded":
|
|
1426
|
+
"aria-label": f ? "Collapse row details" : "Expand row details",
|
|
1427
|
+
"aria-expanded": f,
|
|
1429
1428
|
style: {
|
|
1430
1429
|
position: j ? "sticky" : void 0,
|
|
1431
1430
|
left: j ? _ ? 48 : 0 : void 0,
|
|
@@ -1437,7 +1436,7 @@ function kn(n) {
|
|
|
1437
1436
|
z.stopPropagation(), s?.({
|
|
1438
1437
|
row: o,
|
|
1439
1438
|
field: "__expand_col__",
|
|
1440
|
-
value:
|
|
1439
|
+
value: f,
|
|
1441
1440
|
colDef: { field: "__expand_col__", width: 48 },
|
|
1442
1441
|
rowIndex: r,
|
|
1443
1442
|
colIndex: -1
|
|
@@ -1446,7 +1445,7 @@ function kn(n) {
|
|
|
1446
1445
|
children: /* @__PURE__ */ t.jsx(
|
|
1447
1446
|
No,
|
|
1448
1447
|
{
|
|
1449
|
-
isExpanded:
|
|
1448
|
+
isExpanded: f,
|
|
1450
1449
|
onClick: T,
|
|
1451
1450
|
variant: "plus-minus"
|
|
1452
1451
|
}
|
|
@@ -1460,7 +1459,7 @@ function kn(n) {
|
|
|
1460
1459
|
role: "gridcell",
|
|
1461
1460
|
style: {
|
|
1462
1461
|
position: E ? "sticky" : void 0,
|
|
1463
|
-
left: E ? (_ ? 48 : 0) + (
|
|
1462
|
+
left: E ? (_ ? 48 : 0) + (c && j ? 48 : 0) : void 0,
|
|
1464
1463
|
zIndex: E ? 11 : void 0
|
|
1465
1464
|
},
|
|
1466
1465
|
ref: we,
|
|
@@ -1500,7 +1499,7 @@ function kn(n) {
|
|
|
1500
1499
|
},
|
|
1501
1500
|
z.field
|
|
1502
1501
|
);
|
|
1503
|
-
const Ie = z.valueGetter ? z.valueGetter({ row: o, field: z.field, value: o[z.field] }) : o[z.field], ft =
|
|
1502
|
+
const Ie = z.valueGetter ? z.valueGetter({ row: o, field: z.field, value: o[z.field] }) : o[z.field], ft = u[z.field] ?? z.width, Ge = En(z.field, h), ht = Ge ? A[z.field] : void 0, pt = k?.id === o.id && k?.field === z.field, Qt = pt ? k?.value : Ie, Lt = q?.get(o.id)?.[z.field], Rt = D?.spannedCells[o.id]?.[z.field], Tt = D?.hiddenCells[o.id]?.[z.field] || !1;
|
|
1504
1503
|
return /* @__PURE__ */ t.jsx(
|
|
1505
1504
|
Zr,
|
|
1506
1505
|
{
|
|
@@ -1513,11 +1512,11 @@ function kn(n) {
|
|
|
1513
1512
|
onCellClick: s,
|
|
1514
1513
|
width: ft,
|
|
1515
1514
|
pinnedPosition: Ge,
|
|
1516
|
-
pinnedOffset:
|
|
1515
|
+
pinnedOffset: ht,
|
|
1517
1516
|
isFocused: $ === z.field,
|
|
1518
1517
|
isFocusVisible: K,
|
|
1519
1518
|
isEditable: z.editable,
|
|
1520
|
-
isEditing:
|
|
1519
|
+
isEditing: pt,
|
|
1521
1520
|
onCellEditStart: ce,
|
|
1522
1521
|
onEditStop: ve,
|
|
1523
1522
|
onCellValueChange: ie,
|
|
@@ -1531,7 +1530,7 @@ function kn(n) {
|
|
|
1531
1530
|
]
|
|
1532
1531
|
}
|
|
1533
1532
|
),
|
|
1534
|
-
|
|
1533
|
+
c && /* @__PURE__ */ t.jsx(
|
|
1535
1534
|
ti,
|
|
1536
1535
|
{
|
|
1537
1536
|
row: o,
|
|
@@ -1539,7 +1538,7 @@ function kn(n) {
|
|
|
1539
1538
|
rowIndex: r,
|
|
1540
1539
|
content: x,
|
|
1541
1540
|
height: N,
|
|
1542
|
-
isExpanded:
|
|
1541
|
+
isExpanded: f
|
|
1543
1542
|
}
|
|
1544
1543
|
)
|
|
1545
1544
|
] });
|
|
@@ -1582,7 +1581,7 @@ const ni = ({
|
|
|
1582
1581
|
}
|
|
1583
1582
|
),
|
|
1584
1583
|
n.map((l, a) => {
|
|
1585
|
-
const s = l.width || 150,
|
|
1584
|
+
const s = l.width || 150, g = Math.min(s * 0.7, s - 20);
|
|
1586
1585
|
return /* @__PURE__ */ t.jsx(
|
|
1587
1586
|
"div",
|
|
1588
1587
|
{
|
|
@@ -1601,7 +1600,7 @@ const ni = ({
|
|
|
1601
1600
|
{
|
|
1602
1601
|
className: "ogx-skeleton-box",
|
|
1603
1602
|
style: {
|
|
1604
|
-
width:
|
|
1603
|
+
width: g,
|
|
1605
1604
|
height: 16,
|
|
1606
1605
|
borderRadius: 4
|
|
1607
1606
|
}
|
|
@@ -1649,19 +1648,19 @@ function ko(n) {
|
|
|
1649
1648
|
onPageSizeChange: l,
|
|
1650
1649
|
pageSizeOptions: a = [10, 25, 50, 100],
|
|
1651
1650
|
showFirstButton: s = !0,
|
|
1652
|
-
showLastButton:
|
|
1653
|
-
} = n,
|
|
1651
|
+
showLastButton: g = !0
|
|
1652
|
+
} = n, u = Math.max(1, Math.ceil(r / e)), h = Math.min(o, u - 1), m = h * e, c = Math.min(m + e, r), f = r === 0 ? 0 : `${m + 1}–${c}`, w = () => {
|
|
1654
1653
|
i(0);
|
|
1655
1654
|
}, x = () => {
|
|
1656
|
-
i(Math.max(0,
|
|
1655
|
+
i(Math.max(0, h - 1));
|
|
1657
1656
|
}, N = () => {
|
|
1658
|
-
i(Math.min(
|
|
1657
|
+
i(Math.min(u - 1, h + 1));
|
|
1659
1658
|
}, E = () => {
|
|
1660
|
-
i(
|
|
1659
|
+
i(u - 1);
|
|
1661
1660
|
}, j = (S) => {
|
|
1662
1661
|
const y = parseInt(S.target.value, 10);
|
|
1663
1662
|
l(y);
|
|
1664
|
-
}, _ =
|
|
1663
|
+
}, _ = h === 0, v = h >= u - 1;
|
|
1665
1664
|
return /* @__PURE__ */ t.jsxs("div", { className: "ogx-pagination", role: "navigation", "aria-label": "Pagination", children: [
|
|
1666
1665
|
/* @__PURE__ */ t.jsxs("div", { className: "ogx-pagination__page-size", children: [
|
|
1667
1666
|
/* @__PURE__ */ t.jsx("label", { htmlFor: "page-size-select", className: "ogx-pagination__label", children: "Rows per page:" }),
|
|
@@ -1678,7 +1677,7 @@ function ko(n) {
|
|
|
1678
1677
|
)
|
|
1679
1678
|
] }),
|
|
1680
1679
|
/* @__PURE__ */ t.jsxs("div", { className: "ogx-pagination__info", "aria-live": "polite", "aria-atomic": "true", children: [
|
|
1681
|
-
|
|
1680
|
+
f,
|
|
1682
1681
|
" of ",
|
|
1683
1682
|
r
|
|
1684
1683
|
] }),
|
|
@@ -1709,9 +1708,9 @@ function ko(n) {
|
|
|
1709
1708
|
),
|
|
1710
1709
|
/* @__PURE__ */ t.jsxs("div", { className: "ogx-pagination__page-info", "aria-current": "page", children: [
|
|
1711
1710
|
"Page ",
|
|
1712
|
-
|
|
1711
|
+
h + 1,
|
|
1713
1712
|
" of ",
|
|
1714
|
-
|
|
1713
|
+
u
|
|
1715
1714
|
] }),
|
|
1716
1715
|
/* @__PURE__ */ t.jsx(
|
|
1717
1716
|
Sn,
|
|
@@ -1725,7 +1724,7 @@ function ko(n) {
|
|
|
1725
1724
|
children: /* @__PURE__ */ t.jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ t.jsx("path", { d: "M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" }) })
|
|
1726
1725
|
}
|
|
1727
1726
|
),
|
|
1728
|
-
|
|
1727
|
+
g && /* @__PURE__ */ t.jsx(
|
|
1729
1728
|
Sn,
|
|
1730
1729
|
{
|
|
1731
1730
|
variant: "text",
|
|
@@ -1743,8 +1742,8 @@ function ko(n) {
|
|
|
1743
1742
|
function oi(n, o, e = {}) {
|
|
1744
1743
|
const r = /* @__PURE__ */ new Map(), i = [];
|
|
1745
1744
|
n.forEach((s) => {
|
|
1746
|
-
const
|
|
1747
|
-
r.set(
|
|
1745
|
+
const g = s.id;
|
|
1746
|
+
r.set(g, s), i.push(g);
|
|
1748
1747
|
});
|
|
1749
1748
|
const l = /* @__PURE__ */ new Map(), a = [];
|
|
1750
1749
|
return o.forEach((s) => {
|
|
@@ -1903,7 +1902,7 @@ function ii(n) {
|
|
|
1903
1902
|
const { rows: o, columns: e, rowHeight: r = 52, headerHeight: i = 56, columnVisibilityModel: l, initialState: a } = n, s = de(
|
|
1904
1903
|
() => oi(o, e, l),
|
|
1905
1904
|
[]
|
|
1906
|
-
), [
|
|
1905
|
+
), [g, u] = Cr(ri, {
|
|
1907
1906
|
...s,
|
|
1908
1907
|
sorting: a?.sorting || s.sorting,
|
|
1909
1908
|
filter: a?.filter || s.filter,
|
|
@@ -1918,85 +1917,85 @@ function ii(n) {
|
|
|
1918
1917
|
rowHeight: r,
|
|
1919
1918
|
headerHeight: i
|
|
1920
1919
|
}
|
|
1921
|
-
}),
|
|
1922
|
-
|
|
1920
|
+
}), h = ne(g);
|
|
1921
|
+
h.current = g;
|
|
1923
1922
|
const m = ne(o);
|
|
1924
1923
|
ee(() => {
|
|
1925
|
-
o !== m.current && (m.current = o,
|
|
1924
|
+
o !== m.current && (m.current = o, u({ type: "SET_ROWS", payload: o }));
|
|
1926
1925
|
}, [o]);
|
|
1927
|
-
const
|
|
1928
|
-
|
|
1929
|
-
}, []),
|
|
1930
|
-
|
|
1931
|
-
}, []), w =
|
|
1932
|
-
|
|
1933
|
-
}, []), x =
|
|
1934
|
-
|
|
1935
|
-
}, []), N =
|
|
1936
|
-
|
|
1937
|
-
}, []), E =
|
|
1938
|
-
|
|
1939
|
-
}, []), j =
|
|
1940
|
-
|
|
1941
|
-
}, []), _ =
|
|
1942
|
-
|
|
1943
|
-
}, []), v =
|
|
1944
|
-
|
|
1945
|
-
}, []), S =
|
|
1946
|
-
|
|
1947
|
-
}, []), y =
|
|
1948
|
-
|
|
1926
|
+
const c = F((C, p) => {
|
|
1927
|
+
u({ type: "SET_ROWS", payload: C, preserveRowCount: p });
|
|
1928
|
+
}, []), f = F((C) => {
|
|
1929
|
+
u({ type: "SET_COLUMNS", payload: C });
|
|
1930
|
+
}, []), w = F((C) => {
|
|
1931
|
+
u({ type: "SET_SORT_MODEL", payload: C });
|
|
1932
|
+
}, []), x = F((C) => {
|
|
1933
|
+
u({ type: "SET_FILTER_MODEL", payload: C });
|
|
1934
|
+
}, []), N = F((C) => {
|
|
1935
|
+
u({ type: "SET_PAGINATION_MODEL", payload: C });
|
|
1936
|
+
}, []), E = F((C) => {
|
|
1937
|
+
u({ type: "SET_SELECTION", payload: C });
|
|
1938
|
+
}, []), j = F((C, p) => {
|
|
1939
|
+
u({ type: "SET_SCROLL", payload: { scrollTop: C, scrollLeft: p } });
|
|
1940
|
+
}, []), _ = F((C, p) => {
|
|
1941
|
+
u({ type: "SET_DIMENSIONS", payload: { viewportWidth: C, viewportHeight: p } });
|
|
1942
|
+
}, []), v = F((C) => {
|
|
1943
|
+
u({ type: "SET_DATASOURCE_LOADING", payload: C });
|
|
1944
|
+
}, []), S = F((C) => {
|
|
1945
|
+
u({ type: "SET_DATASOURCE_ERROR", payload: C });
|
|
1946
|
+
}, []), y = F((C) => {
|
|
1947
|
+
u({ type: "SET_ROW_COUNT", payload: C });
|
|
1949
1948
|
}, []), I = ne({
|
|
1950
|
-
getRow: (C) =>
|
|
1951
|
-
getAllRows: () => Array.from(
|
|
1952
|
-
getVisibleRows: () => Array.from(
|
|
1949
|
+
getRow: (C) => h.current.rows.idRowsLookup.get(C) || null,
|
|
1950
|
+
getAllRows: () => Array.from(h.current.rows.idRowsLookup.values()),
|
|
1951
|
+
getVisibleRows: () => Array.from(h.current.rows.idRowsLookup.values()),
|
|
1953
1952
|
getAggregationResult: () => null,
|
|
1954
1953
|
getAggregationModel: () => null,
|
|
1955
|
-
getColumn: (C) =>
|
|
1956
|
-
getAllColumns: () =>
|
|
1957
|
-
getVisibleColumns: () =>
|
|
1954
|
+
getColumn: (C) => h.current.columns.lookup.get(C) || null,
|
|
1955
|
+
getAllColumns: () => h.current.columns.all,
|
|
1956
|
+
getVisibleColumns: () => h.current.columns.all,
|
|
1958
1957
|
selectRow: (C, p = !0) => {
|
|
1959
|
-
const k = new Set(
|
|
1958
|
+
const k = new Set(h.current.selection.selectedRows);
|
|
1960
1959
|
p ? k.add(C) : k.delete(C), E(k);
|
|
1961
1960
|
},
|
|
1962
1961
|
selectRows: (C, p = !0) => {
|
|
1963
|
-
const k = new Set(
|
|
1962
|
+
const k = new Set(h.current.selection.selectedRows);
|
|
1964
1963
|
C.forEach((L) => {
|
|
1965
1964
|
p ? k.add(L) : k.delete(L);
|
|
1966
1965
|
}), E(k);
|
|
1967
1966
|
},
|
|
1968
|
-
getSelectedRows: () => Array.from(
|
|
1967
|
+
getSelectedRows: () => Array.from(h.current.selection.selectedRows),
|
|
1969
1968
|
sortColumn: (C, p) => {
|
|
1970
1969
|
if (p === null)
|
|
1971
|
-
w(
|
|
1970
|
+
w(h.current.sorting.sortModel.filter((k) => k.field !== C));
|
|
1972
1971
|
else {
|
|
1973
|
-
const k =
|
|
1972
|
+
const k = h.current.sorting.sortModel.findIndex((L) => L.field === C);
|
|
1974
1973
|
if (k >= 0) {
|
|
1975
|
-
const L = [...
|
|
1974
|
+
const L = [...h.current.sorting.sortModel];
|
|
1976
1975
|
L[k] = { field: C, sort: p }, w(L);
|
|
1977
1976
|
} else
|
|
1978
|
-
w([...
|
|
1977
|
+
w([...h.current.sorting.sortModel, { field: C, sort: p }]);
|
|
1979
1978
|
}
|
|
1980
1979
|
},
|
|
1981
|
-
getSortModel: () =>
|
|
1980
|
+
getSortModel: () => h.current.sorting.sortModel,
|
|
1982
1981
|
setFilterModel: x,
|
|
1983
|
-
getFilterModel: () =>
|
|
1982
|
+
getFilterModel: () => h.current.filter.filterModel,
|
|
1984
1983
|
setPage: (C) => {
|
|
1985
|
-
N({ ...
|
|
1984
|
+
N({ ...h.current.pagination.paginationModel, page: C });
|
|
1986
1985
|
},
|
|
1987
1986
|
setPageSize: (C) => {
|
|
1988
|
-
N({ ...
|
|
1987
|
+
N({ ...h.current.pagination.paginationModel, pageSize: C, page: 0 });
|
|
1989
1988
|
},
|
|
1990
1989
|
scrollToIndexes: () => {
|
|
1991
1990
|
},
|
|
1992
1991
|
copySelectedRows: () => Promise.resolve()
|
|
1993
1992
|
});
|
|
1994
1993
|
return {
|
|
1995
|
-
state:
|
|
1996
|
-
dispatch:
|
|
1994
|
+
state: g,
|
|
1995
|
+
dispatch: u,
|
|
1997
1996
|
apiRef: I,
|
|
1998
|
-
setRows:
|
|
1999
|
-
setColumns:
|
|
1997
|
+
setRows: c,
|
|
1998
|
+
setColumns: f,
|
|
2000
1999
|
setSortModel: w,
|
|
2001
2000
|
setFilterModel: x,
|
|
2002
2001
|
setPaginationModel: N,
|
|
@@ -2009,29 +2008,29 @@ function ii(n) {
|
|
|
2009
2008
|
};
|
|
2010
2009
|
}
|
|
2011
2010
|
function li(n) {
|
|
2012
|
-
const { columns: o, onColumnOrderChange: e, disableColumnReorder: r = !1 } = n, [i, l] = Q(null), [a, s] = Q(null),
|
|
2013
|
-
(
|
|
2011
|
+
const { columns: o, onColumnOrderChange: e, disableColumnReorder: r = !1 } = n, [i, l] = Q(null), [a, s] = Q(null), g = ne(-1), u = F(
|
|
2012
|
+
(f) => (w) => {
|
|
2014
2013
|
if (r) return;
|
|
2015
|
-
const x = o.findIndex((E) => E.field ===
|
|
2014
|
+
const x = o.findIndex((E) => E.field === f);
|
|
2016
2015
|
if (o[x]?.pinnable === !1) {
|
|
2017
2016
|
w.preventDefault();
|
|
2018
2017
|
return;
|
|
2019
2018
|
}
|
|
2020
|
-
l(
|
|
2019
|
+
l(f), g.current = x, w.dataTransfer && (w.dataTransfer.effectAllowed = "move", w.dataTransfer.setData("text/plain", f));
|
|
2021
2020
|
},
|
|
2022
2021
|
[o, r]
|
|
2023
|
-
),
|
|
2024
|
-
(
|
|
2025
|
-
r || !i || (w.preventDefault(), w.dataTransfer.dropEffect = "move", s(
|
|
2022
|
+
), h = F(
|
|
2023
|
+
(f) => (w) => {
|
|
2024
|
+
r || !i || (w.preventDefault(), w.dataTransfer.dropEffect = "move", s(f));
|
|
2026
2025
|
},
|
|
2027
2026
|
[i, r]
|
|
2028
|
-
), m =
|
|
2029
|
-
(
|
|
2030
|
-
if (w.preventDefault(), r || !i || i ===
|
|
2027
|
+
), m = F(
|
|
2028
|
+
(f) => (w) => {
|
|
2029
|
+
if (w.preventDefault(), r || !i || i === f) {
|
|
2031
2030
|
l(null), s(null);
|
|
2032
2031
|
return;
|
|
2033
2032
|
}
|
|
2034
|
-
const x = o.findIndex((j) => j.field === i), N = o.findIndex((j) => j.field ===
|
|
2033
|
+
const x = o.findIndex((j) => j.field === i), N = o.findIndex((j) => j.field === f);
|
|
2035
2034
|
if (x === -1 || N === -1) {
|
|
2036
2035
|
l(null), s(null);
|
|
2037
2036
|
return;
|
|
@@ -2041,47 +2040,47 @@ function li(n) {
|
|
|
2041
2040
|
column: E,
|
|
2042
2041
|
oldIndex: x,
|
|
2043
2042
|
targetIndex: N
|
|
2044
|
-
}), l(null), s(null),
|
|
2043
|
+
}), l(null), s(null), g.current = -1;
|
|
2045
2044
|
},
|
|
2046
2045
|
[o, i, r, e]
|
|
2047
|
-
),
|
|
2048
|
-
l(null), s(null),
|
|
2046
|
+
), c = F(() => {
|
|
2047
|
+
l(null), s(null), g.current = -1;
|
|
2049
2048
|
}, []);
|
|
2050
2049
|
return {
|
|
2051
2050
|
draggedColumn: i,
|
|
2052
2051
|
dragOverColumn: a,
|
|
2053
|
-
onDragStart: r ? void 0 :
|
|
2054
|
-
onDragOver: r ? void 0 :
|
|
2055
|
-
onDragEnd: r ? void 0 :
|
|
2052
|
+
onDragStart: r ? void 0 : u,
|
|
2053
|
+
onDragOver: r ? void 0 : h,
|
|
2054
|
+
onDragEnd: r ? void 0 : c,
|
|
2056
2055
|
onDrop: r ? void 0 : m
|
|
2057
2056
|
};
|
|
2058
2057
|
}
|
|
2059
2058
|
function si(n) {
|
|
2060
|
-
const { onRowOrderChange: o, rows: e, getRowId: r, rowReordering: i = !1 } = n, [l, a] = Q(null), [s,
|
|
2059
|
+
const { onRowOrderChange: o, rows: e, getRowId: r, rowReordering: i = !1 } = n, [l, a] = Q(null), [s, g] = Q(null), u = F((w) => r ? r(w) : w.id, [r]), h = F((w) => (x) => {
|
|
2061
2060
|
i && (a(w), x.dataTransfer.effectAllowed = "move");
|
|
2062
|
-
}, [i]), m =
|
|
2063
|
-
!i || !l || (x.preventDefault(), x.dataTransfer.dropEffect = "move", s !== w &&
|
|
2064
|
-
}, [i, l, s]),
|
|
2065
|
-
a(null),
|
|
2066
|
-
}, []),
|
|
2061
|
+
}, [i]), m = F((w) => (x) => {
|
|
2062
|
+
!i || !l || (x.preventDefault(), x.dataTransfer.dropEffect = "move", s !== w && g(w));
|
|
2063
|
+
}, [i, l, s]), c = F(() => {
|
|
2064
|
+
a(null), g(null);
|
|
2065
|
+
}, []), f = F((w) => (x) => {
|
|
2067
2066
|
if (x.preventDefault(), !l || !o) {
|
|
2068
|
-
|
|
2067
|
+
c();
|
|
2069
2068
|
return;
|
|
2070
2069
|
}
|
|
2071
|
-
const N = e.findIndex((j) =>
|
|
2070
|
+
const N = e.findIndex((j) => u(j) === l), E = e.findIndex((j) => u(j) === w);
|
|
2072
2071
|
N !== -1 && E !== -1 && N !== E && o({
|
|
2073
2072
|
row: e[N],
|
|
2074
2073
|
oldIndex: N,
|
|
2075
2074
|
targetIndex: E
|
|
2076
|
-
}),
|
|
2077
|
-
}, [l, o, e,
|
|
2075
|
+
}), c();
|
|
2076
|
+
}, [l, o, e, u, c]);
|
|
2078
2077
|
return {
|
|
2079
2078
|
draggedRowId: l,
|
|
2080
2079
|
dragOverRowId: s,
|
|
2081
|
-
onDragStart: i ?
|
|
2080
|
+
onDragStart: i ? h : void 0,
|
|
2082
2081
|
onDragOver: i ? m : void 0,
|
|
2083
|
-
onDragEnd: i ?
|
|
2084
|
-
onDrop: i ?
|
|
2082
|
+
onDragEnd: i ? c : void 0,
|
|
2083
|
+
onDrop: i ? f : void 0
|
|
2085
2084
|
};
|
|
2086
2085
|
}
|
|
2087
2086
|
const ai = {
|
|
@@ -2146,8 +2145,8 @@ function Jn(n, o) {
|
|
|
2146
2145
|
return !0;
|
|
2147
2146
|
const l = (a) => {
|
|
2148
2147
|
if ("logicOperator" in a && "items" in a) {
|
|
2149
|
-
const s = a,
|
|
2150
|
-
return
|
|
2148
|
+
const s = a, g = s.items;
|
|
2149
|
+
return g.length === 0 ? !0 : s.logicOperator === "and" ? g.every(l) : g.some(l);
|
|
2151
2150
|
} else
|
|
2152
2151
|
return di(n, a);
|
|
2153
2152
|
};
|
|
@@ -2189,9 +2188,9 @@ function fi(n, o) {
|
|
|
2189
2188
|
const e = [...n];
|
|
2190
2189
|
return e.sort((r, i) => {
|
|
2191
2190
|
for (const l of o) {
|
|
2192
|
-
const a = r[l.field], s = i[l.field],
|
|
2193
|
-
if (
|
|
2194
|
-
return
|
|
2191
|
+
const a = r[l.field], s = i[l.field], g = Qn(a, s, l.sort);
|
|
2192
|
+
if (g !== 0)
|
|
2193
|
+
return g;
|
|
2195
2194
|
}
|
|
2196
2195
|
return 0;
|
|
2197
2196
|
}), e;
|
|
@@ -2205,8 +2204,8 @@ function hi(n) {
|
|
|
2205
2204
|
defaultGroupingExpansionDepth: l = 0,
|
|
2206
2205
|
filterModel: a,
|
|
2207
2206
|
sortModel: s,
|
|
2208
|
-
onRowExpansionChange:
|
|
2209
|
-
} = n, { treeNodes:
|
|
2207
|
+
onRowExpansionChange: g
|
|
2208
|
+
} = n, { treeNodes: u, rootIds: h, groupingRows: m } = de(() => {
|
|
2210
2209
|
if (!i || !r)
|
|
2211
2210
|
return {
|
|
2212
2211
|
treeNodes: /* @__PURE__ */ new Map(),
|
|
@@ -2272,26 +2271,26 @@ function hi(n) {
|
|
|
2272
2271
|
}
|
|
2273
2272
|
}
|
|
2274
2273
|
}), { treeNodes: v, rootIds: S, groupingRows: y };
|
|
2275
|
-
}, [o, r, i, e]),
|
|
2274
|
+
}, [o, r, i, e]), c = de(() => {
|
|
2276
2275
|
if (!i) return /* @__PURE__ */ new Set();
|
|
2277
2276
|
const v = /* @__PURE__ */ new Set();
|
|
2278
|
-
return
|
|
2277
|
+
return u.forEach((S) => {
|
|
2279
2278
|
S.children && S.children.length > 0 && (l === -1 || S.depth < l) && v.add(S.id);
|
|
2280
2279
|
}), v;
|
|
2281
|
-
}, [
|
|
2280
|
+
}, [u, i, l]), [f, w] = Q(/* @__PURE__ */ new Set());
|
|
2282
2281
|
ee(() => {
|
|
2283
|
-
|
|
2284
|
-
}, [
|
|
2285
|
-
const x =
|
|
2282
|
+
c.size > 0 && w(c);
|
|
2283
|
+
}, [c]);
|
|
2284
|
+
const x = F((v) => {
|
|
2286
2285
|
w((S) => {
|
|
2287
2286
|
const y = new Set(S), I = !y.has(v);
|
|
2288
|
-
if (y.has(v) ? y.delete(v) : y.add(v), I &&
|
|
2289
|
-
const C =
|
|
2290
|
-
C &&
|
|
2287
|
+
if (y.has(v) ? y.delete(v) : y.add(v), I && g) {
|
|
2288
|
+
const C = u.get(v);
|
|
2289
|
+
C && g(C);
|
|
2291
2290
|
}
|
|
2292
2291
|
return y;
|
|
2293
2292
|
});
|
|
2294
|
-
}, [
|
|
2293
|
+
}, [u, g]), N = F(() => {
|
|
2295
2294
|
if (!i) return null;
|
|
2296
2295
|
const v = /* @__PURE__ */ new Map();
|
|
2297
2296
|
o.forEach((B) => v.set(e(B), B)), m.forEach((B) => v.set(B.id, B));
|
|
@@ -2301,7 +2300,7 @@ function hi(n) {
|
|
|
2301
2300
|
if (!Y) return !1;
|
|
2302
2301
|
if (S(Y))
|
|
2303
2302
|
return y.set(B, !0), !0;
|
|
2304
|
-
const K =
|
|
2303
|
+
const K = u.get(B);
|
|
2305
2304
|
return K && K.children && K.children.some((D) => I(D)) ? (y.set(B, !0), !0) : (y.set(B, !1), !1);
|
|
2306
2305
|
}, C = (B, Y) => {
|
|
2307
2306
|
if (!s || s.length === 0) return 0;
|
|
@@ -2316,40 +2315,40 @@ function hi(n) {
|
|
|
2316
2315
|
const Y = B.filter(($) => I($));
|
|
2317
2316
|
Y.sort(C), Y.forEach(($) => {
|
|
2318
2317
|
if (k.has($)) return;
|
|
2319
|
-
const K = v.get($), q =
|
|
2318
|
+
const K = v.get($), q = u.get($);
|
|
2320
2319
|
if (K && q) {
|
|
2321
2320
|
k.add($);
|
|
2322
2321
|
const D = {
|
|
2323
2322
|
...K,
|
|
2324
2323
|
_treeDepth: q.depth,
|
|
2325
|
-
_isExpanded:
|
|
2324
|
+
_isExpanded: f.has($),
|
|
2326
2325
|
_hasChildren: q.children && q.children.length > 0 || q.serverChildrenCount && q.serverChildrenCount > 0,
|
|
2327
2326
|
_descendantCount: q.children ? q.children.length : 0
|
|
2328
2327
|
};
|
|
2329
|
-
p.push(D),
|
|
2328
|
+
p.push(D), f.has($) && q.children && q.children.length > 0 && L(q.children);
|
|
2330
2329
|
}
|
|
2331
2330
|
});
|
|
2332
2331
|
};
|
|
2333
|
-
return L(
|
|
2334
|
-
}, [i, o, m,
|
|
2332
|
+
return L(h), p;
|
|
2333
|
+
}, [i, o, m, h, u, f, a, s, e]), E = F((v) => f.has(v), [f]), j = F((v) => u.get(v), [u]), _ = F((v) => {
|
|
2335
2334
|
const S = [];
|
|
2336
2335
|
let y = v;
|
|
2337
2336
|
for (; y !== null; ) {
|
|
2338
|
-
const I =
|
|
2337
|
+
const I = u.get(y);
|
|
2339
2338
|
if (!I) break;
|
|
2340
2339
|
S.unshift(I.groupingKey), y = I.parentId;
|
|
2341
2340
|
}
|
|
2342
2341
|
return S;
|
|
2343
|
-
}, [
|
|
2342
|
+
}, [u]);
|
|
2344
2343
|
return de(() => ({
|
|
2345
|
-
treeNodes:
|
|
2344
|
+
treeNodes: u,
|
|
2346
2345
|
groupingRows: m,
|
|
2347
2346
|
toggleExpansion: x,
|
|
2348
2347
|
isGroupExpanded: E,
|
|
2349
2348
|
getVisibleRows: N,
|
|
2350
2349
|
getNode: j,
|
|
2351
2350
|
getNodePath: _
|
|
2352
|
-
}), [
|
|
2351
|
+
}), [u, m, x, E, N, j, _]);
|
|
2353
2352
|
}
|
|
2354
2353
|
const pi = (n) => n?.depth === -1 ? "footer" : "inline";
|
|
2355
2354
|
function xi(n) {
|
|
@@ -2361,8 +2360,8 @@ function xi(n) {
|
|
|
2361
2360
|
defaultGroupingExpansionDepth: l = 0,
|
|
2362
2361
|
filterModel: a,
|
|
2363
2362
|
sortModel: s,
|
|
2364
|
-
getAggregationPosition:
|
|
2365
|
-
} = n, [
|
|
2363
|
+
getAggregationPosition: g = pi
|
|
2364
|
+
} = n, [u, h] = Q(/* @__PURE__ */ new Set()), { treeNodes: m, rootIds: c, groupingRows: f } = de(() => {
|
|
2366
2365
|
const j = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map(), v = [];
|
|
2367
2366
|
if (r.length === 0)
|
|
2368
2367
|
return { treeNodes: j, rootIds: v, groupingRows: _ };
|
|
@@ -2419,7 +2418,7 @@ function xi(n) {
|
|
|
2419
2418
|
children: [],
|
|
2420
2419
|
label: `${L}: ${String(D)}`
|
|
2421
2420
|
};
|
|
2422
|
-
b.aggregationPosition =
|
|
2421
|
+
b.aggregationPosition = g(b), j.set(te, b);
|
|
2423
2422
|
const H = y($, p + 1, te);
|
|
2424
2423
|
j.get(te).children = H;
|
|
2425
2424
|
const T = $.length;
|
|
@@ -2427,27 +2426,27 @@ function xi(n) {
|
|
|
2427
2426
|
}), Y;
|
|
2428
2427
|
}, I = y(o, 0, null);
|
|
2429
2428
|
return v.push(...I), { treeNodes: j, rootIds: v, groupingRows: _ };
|
|
2430
|
-
}, [o, r, i, e,
|
|
2429
|
+
}, [o, r, i, e, g]);
|
|
2431
2430
|
ee(() => {
|
|
2432
2431
|
if (l === -1) {
|
|
2433
2432
|
const j = /* @__PURE__ */ new Set();
|
|
2434
2433
|
m.forEach((_, v) => {
|
|
2435
2434
|
_.children && _.children.length > 0 && j.add(v);
|
|
2436
|
-
}),
|
|
2435
|
+
}), h(j);
|
|
2437
2436
|
} else if (l > 0) {
|
|
2438
2437
|
const j = /* @__PURE__ */ new Set();
|
|
2439
2438
|
m.forEach((_, v) => {
|
|
2440
2439
|
_.depth < l && _.children && _.children.length > 0 && j.add(v);
|
|
2441
|
-
}),
|
|
2440
|
+
}), h(j);
|
|
2442
2441
|
} else
|
|
2443
|
-
|
|
2442
|
+
h(/* @__PURE__ */ new Set());
|
|
2444
2443
|
}, [r, l]);
|
|
2445
|
-
const w =
|
|
2446
|
-
|
|
2444
|
+
const w = F((j) => {
|
|
2445
|
+
h((_) => {
|
|
2447
2446
|
const v = new Set(_);
|
|
2448
2447
|
return v.has(j) ? v.delete(j) : v.add(j), v;
|
|
2449
2448
|
});
|
|
2450
|
-
}, []), x =
|
|
2449
|
+
}, []), x = F((j) => u.has(j), [u]), N = F(() => {
|
|
2451
2450
|
if (r.length === 0) return null;
|
|
2452
2451
|
const j = [], _ = /* @__PURE__ */ new Set(), v = /* @__PURE__ */ new Map();
|
|
2453
2452
|
o.forEach((C) => v.set(e(C), C));
|
|
@@ -2462,7 +2461,7 @@ function xi(n) {
|
|
|
2462
2461
|
}, y = (C) => {
|
|
2463
2462
|
let p = C;
|
|
2464
2463
|
a && (p = C.filter(S)), s && s.length > 0 && p.sort((k, L) => {
|
|
2465
|
-
const B =
|
|
2464
|
+
const B = f.get(k) || v.get(k), Y = f.get(L) || v.get(L);
|
|
2466
2465
|
if (!B || !Y) return 0;
|
|
2467
2466
|
for (const $ of s) {
|
|
2468
2467
|
const K = B[$.field], q = Y[$.field], D = Qn(K, q, $.sort);
|
|
@@ -2471,13 +2470,13 @@ function xi(n) {
|
|
|
2471
2470
|
return 0;
|
|
2472
2471
|
}), p.forEach((k) => {
|
|
2473
2472
|
if (_.has(k)) return;
|
|
2474
|
-
const L = m.get(k), B = L?.children && L.children.length > 0, Y = B ?
|
|
2473
|
+
const L = m.get(k), B = L?.children && L.children.length > 0, Y = B ? f.get(k) : v.get(k);
|
|
2475
2474
|
if (Y && L) {
|
|
2476
2475
|
_.add(k);
|
|
2477
2476
|
const $ = {
|
|
2478
2477
|
...Y,
|
|
2479
2478
|
_treeDepth: L.depth,
|
|
2480
|
-
_isExpanded:
|
|
2479
|
+
_isExpanded: u.has(k),
|
|
2481
2480
|
_hasChildren: B,
|
|
2482
2481
|
_groupingField: L.groupingField,
|
|
2483
2482
|
_groupingValue: L.groupingValue,
|
|
@@ -2486,17 +2485,17 @@ function xi(n) {
|
|
|
2486
2485
|
j.push($), I.has(k) && B && y(L.children);
|
|
2487
2486
|
}
|
|
2488
2487
|
});
|
|
2489
|
-
}, I =
|
|
2490
|
-
return y(
|
|
2491
|
-
}, [o, e, m,
|
|
2488
|
+
}, I = u;
|
|
2489
|
+
return y(c), j;
|
|
2490
|
+
}, [o, e, m, c, f, a, s, u]), E = F((j) => m.get(j), [m]);
|
|
2492
2491
|
return de(() => ({
|
|
2493
2492
|
treeNodes: m,
|
|
2494
|
-
groupingRows:
|
|
2493
|
+
groupingRows: f,
|
|
2495
2494
|
toggleExpansion: w,
|
|
2496
2495
|
isGroupExpanded: x,
|
|
2497
2496
|
getVisibleRows: N,
|
|
2498
2497
|
getNode: E
|
|
2499
|
-
}), [m,
|
|
2498
|
+
}), [m, f, w, x, N, E]);
|
|
2500
2499
|
}
|
|
2501
2500
|
function mi(n) {
|
|
2502
2501
|
const {
|
|
@@ -2505,30 +2504,30 @@ function mi(n) {
|
|
|
2505
2504
|
processRowUpdate: r,
|
|
2506
2505
|
onProcessRowUpdateError: i,
|
|
2507
2506
|
onRowChange: l
|
|
2508
|
-
} = n, [a, s] = Q(null),
|
|
2509
|
-
s(
|
|
2510
|
-
}, []),
|
|
2511
|
-
|
|
2512
|
-
id:
|
|
2513
|
-
field:
|
|
2514
|
-
value:
|
|
2515
|
-
originalValue:
|
|
2507
|
+
} = n, [a, s] = Q(null), g = ne(null), u = F((f) => {
|
|
2508
|
+
s(f), g.current = typeof f == "function" ? f(g.current) : f;
|
|
2509
|
+
}, []), h = F((f) => {
|
|
2510
|
+
u({
|
|
2511
|
+
id: f.id,
|
|
2512
|
+
field: f.field,
|
|
2513
|
+
value: f.value,
|
|
2514
|
+
originalValue: f.value
|
|
2516
2515
|
});
|
|
2517
|
-
}, []), m =
|
|
2518
|
-
const w =
|
|
2516
|
+
}, []), m = F(async (f) => {
|
|
2517
|
+
const w = g.current;
|
|
2519
2518
|
if (!w) return;
|
|
2520
|
-
if (
|
|
2521
|
-
|
|
2519
|
+
if (f?.cancel) {
|
|
2520
|
+
u(null);
|
|
2522
2521
|
return;
|
|
2523
2522
|
}
|
|
2524
2523
|
const { id: x, field: N, value: E, originalValue: j } = w;
|
|
2525
2524
|
if (E === j) {
|
|
2526
|
-
|
|
2525
|
+
u(null);
|
|
2527
2526
|
return;
|
|
2528
2527
|
}
|
|
2529
2528
|
const _ = o.find((S) => e(S) === x);
|
|
2530
2529
|
if (!_) {
|
|
2531
|
-
|
|
2530
|
+
u(null);
|
|
2532
2531
|
return;
|
|
2533
2532
|
}
|
|
2534
2533
|
const v = { ..._, [N]: E };
|
|
@@ -2538,18 +2537,18 @@ function mi(n) {
|
|
|
2538
2537
|
l?.(S);
|
|
2539
2538
|
} else
|
|
2540
2539
|
l?.(v);
|
|
2541
|
-
|
|
2540
|
+
u(null);
|
|
2542
2541
|
} catch (S) {
|
|
2543
2542
|
i && i(S);
|
|
2544
2543
|
}
|
|
2545
|
-
}, [a, o, e, r, l, i]),
|
|
2546
|
-
a && a.id ===
|
|
2544
|
+
}, [a, o, e, r, l, i]), c = F((f) => {
|
|
2545
|
+
a && a.id === f.id && a.field === f.field && u((w) => w ? { ...w, value: f.value } : null);
|
|
2547
2546
|
}, [a]);
|
|
2548
2547
|
return {
|
|
2549
2548
|
editingCell: a,
|
|
2550
|
-
startCellEdit:
|
|
2549
|
+
startCellEdit: h,
|
|
2551
2550
|
stopCellEdit: m,
|
|
2552
|
-
setEditCellValue:
|
|
2551
|
+
setEditCellValue: c
|
|
2553
2552
|
};
|
|
2554
2553
|
}
|
|
2555
2554
|
function wi(n, o, e) {
|
|
@@ -2560,9 +2559,9 @@ function wi(n, o, e) {
|
|
|
2560
2559
|
hiddenCellOriginMap: {}
|
|
2561
2560
|
},
|
|
2562
2561
|
processedRange: { firstRowIndex: 0, lastRowIndex: 0 }
|
|
2563
|
-
}), s =
|
|
2562
|
+
}), s = F(() => {
|
|
2564
2563
|
i(/* @__PURE__ */ new Map());
|
|
2565
|
-
}, []),
|
|
2564
|
+
}, []), g = F((x, N) => r.get(x)?.[N], [r]), u = F((x, N, E, j, _) => {
|
|
2566
2565
|
const v = new Map(r);
|
|
2567
2566
|
for (let S = j; S < _; S++) {
|
|
2568
2567
|
const y = o[S];
|
|
@@ -2604,7 +2603,7 @@ function wi(n, o, e) {
|
|
|
2604
2603
|
}), S += I - 1;
|
|
2605
2604
|
}
|
|
2606
2605
|
i(v);
|
|
2607
|
-
}, [r, o, e]),
|
|
2606
|
+
}, [r, o, e]), h = F((x, N) => {
|
|
2608
2607
|
const E = {}, j = {}, _ = {};
|
|
2609
2608
|
o.forEach((v, S) => {
|
|
2610
2609
|
if (v.rowSpan)
|
|
@@ -2639,7 +2638,7 @@ function wi(n, o, e) {
|
|
|
2639
2638
|
caches: { spannedCells: E, hiddenCells: j, hiddenCellOriginMap: _ },
|
|
2640
2639
|
processedRange: { firstRowIndex: x, lastRowIndex: N }
|
|
2641
2640
|
});
|
|
2642
|
-
}, [n, o]), m =
|
|
2641
|
+
}, [n, o]), m = F(() => {
|
|
2643
2642
|
a({
|
|
2644
2643
|
caches: {
|
|
2645
2644
|
spannedCells: {},
|
|
@@ -2731,17 +2730,17 @@ function wi(n, o, e) {
|
|
|
2731
2730
|
processedRange: { firstRowIndex: 0, lastRowIndex: n.length }
|
|
2732
2731
|
});
|
|
2733
2732
|
}, [n, o, e]);
|
|
2734
|
-
const
|
|
2733
|
+
const c = F(() => l.caches.spannedCells, [l]), f = F(() => l.caches.hiddenCells, [l]), w = F(() => l.caches.hiddenCellOriginMap, [l]);
|
|
2735
2734
|
return {
|
|
2736
2735
|
colspanMap: r,
|
|
2737
2736
|
resetColSpan: s,
|
|
2738
|
-
getCellColSpanInfo:
|
|
2739
|
-
calculateColSpan:
|
|
2737
|
+
getCellColSpanInfo: g,
|
|
2738
|
+
calculateColSpan: u,
|
|
2740
2739
|
rowSpanningState: l,
|
|
2741
|
-
calculateRowSpan:
|
|
2740
|
+
calculateRowSpan: h,
|
|
2742
2741
|
resetRowSpan: m,
|
|
2743
|
-
getSpannedCells:
|
|
2744
|
-
getHiddenCells:
|
|
2742
|
+
getSpannedCells: c,
|
|
2743
|
+
getHiddenCells: f,
|
|
2745
2744
|
getHiddenCellOriginMap: w
|
|
2746
2745
|
};
|
|
2747
2746
|
}
|
|
@@ -2758,23 +2757,23 @@ function bi(n) {
|
|
|
2758
2757
|
paginationMode: l,
|
|
2759
2758
|
sortingMode: a,
|
|
2760
2759
|
filterMode: s,
|
|
2761
|
-
aggregationModel:
|
|
2762
|
-
setRows:
|
|
2763
|
-
setRowCount:
|
|
2760
|
+
aggregationModel: g,
|
|
2761
|
+
setRows: u,
|
|
2762
|
+
setRowCount: h,
|
|
2764
2763
|
setDataSourceLoading: m,
|
|
2765
|
-
setDataSourceError:
|
|
2766
|
-
onAggregationResults:
|
|
2767
|
-
} = n, w = ne(null), x = ne(0), N =
|
|
2764
|
+
setDataSourceError: c,
|
|
2765
|
+
onAggregationResults: f
|
|
2766
|
+
} = n, w = ne(null), x = ne(0), N = F(async () => {
|
|
2768
2767
|
if (!o) return;
|
|
2769
2768
|
const j = ++x.current;
|
|
2770
|
-
m(!0),
|
|
2769
|
+
m(!0), c(null);
|
|
2771
2770
|
const _ = i.page * i.pageSize, v = _ + i.pageSize, S = {
|
|
2772
2771
|
startRow: _,
|
|
2773
2772
|
endRow: v,
|
|
2774
2773
|
sortModel: e,
|
|
2775
2774
|
filterModel: r,
|
|
2776
2775
|
groupKeys: [],
|
|
2777
|
-
aggregationModel:
|
|
2776
|
+
aggregationModel: g
|
|
2778
2777
|
};
|
|
2779
2778
|
try {
|
|
2780
2779
|
const y = await o.getRows(S);
|
|
@@ -2788,14 +2787,14 @@ function bi(n) {
|
|
|
2788
2787
|
!p && !k && !L && i.page > C.page && (I = !0);
|
|
2789
2788
|
}
|
|
2790
2789
|
}
|
|
2791
|
-
|
|
2790
|
+
u(I ? (C) => [...C, ...y.rows] : y.rows, !0), y.aggregationResults && f && f(y.aggregationResults), y.rowCount !== void 0 && h(y.rowCount), w.current = {
|
|
2792
2791
|
sortModel: e,
|
|
2793
2792
|
filterModel: r,
|
|
2794
2793
|
page: i.page,
|
|
2795
2794
|
pageSize: i.pageSize
|
|
2796
2795
|
};
|
|
2797
2796
|
} catch (y) {
|
|
2798
|
-
j === x.current && (
|
|
2797
|
+
j === x.current && (c(y), console.error("Data Source Error:", y));
|
|
2799
2798
|
} finally {
|
|
2800
2799
|
j === x.current && m(!1);
|
|
2801
2800
|
}
|
|
@@ -2806,12 +2805,12 @@ function bi(n) {
|
|
|
2806
2805
|
e,
|
|
2807
2806
|
r,
|
|
2808
2807
|
l,
|
|
2809
|
-
u,
|
|
2810
|
-
h,
|
|
2811
2808
|
g,
|
|
2812
2809
|
f,
|
|
2810
|
+
u,
|
|
2811
|
+
h,
|
|
2813
2812
|
m,
|
|
2814
|
-
|
|
2813
|
+
c
|
|
2815
2814
|
]);
|
|
2816
2815
|
ee(() => {
|
|
2817
2816
|
if (o && (l === "server" || l === "infinite" || a === "server" || s === "server")) {
|
|
@@ -2821,7 +2820,7 @@ function bi(n) {
|
|
|
2821
2820
|
return () => clearTimeout(_);
|
|
2822
2821
|
}
|
|
2823
2822
|
}, [N, o, l, a, s]);
|
|
2824
|
-
const E =
|
|
2823
|
+
const E = F(async (j, _) => {
|
|
2825
2824
|
if (o) {
|
|
2826
2825
|
m(!0);
|
|
2827
2826
|
try {
|
|
@@ -2832,17 +2831,17 @@ function bi(n) {
|
|
|
2832
2831
|
filterModel: r,
|
|
2833
2832
|
groupKeys: _
|
|
2834
2833
|
});
|
|
2835
|
-
v.rows.length > 0 &&
|
|
2834
|
+
v.rows.length > 0 && u((S) => {
|
|
2836
2835
|
const y = new Set(S.map((C) => C.id)), I = v.rows.filter((C) => !y.has(C.id));
|
|
2837
2836
|
return [...S, ...I];
|
|
2838
2837
|
});
|
|
2839
2838
|
} catch (v) {
|
|
2840
|
-
|
|
2839
|
+
c(v), console.error("Failed to fetch children:", v);
|
|
2841
2840
|
} finally {
|
|
2842
2841
|
m(!1);
|
|
2843
2842
|
}
|
|
2844
2843
|
}
|
|
2845
|
-
}, [o, e, r,
|
|
2844
|
+
}, [o, e, r, u, m, c]);
|
|
2846
2845
|
return {
|
|
2847
2846
|
fetchRows: N,
|
|
2848
2847
|
fetchChildren: E
|
|
@@ -2877,7 +2876,7 @@ function _i(n) {
|
|
|
2877
2876
|
filterModel: l,
|
|
2878
2877
|
sortModel: a,
|
|
2879
2878
|
serverAggregationResults: s
|
|
2880
|
-
} = n,
|
|
2879
|
+
} = n, g = de(() => {
|
|
2881
2880
|
if (r || Object.keys(e).length === 0) return {};
|
|
2882
2881
|
const j = {};
|
|
2883
2882
|
for (const [_, v] of Object.entries(e)) {
|
|
@@ -2890,10 +2889,10 @@ function _i(n) {
|
|
|
2890
2889
|
j[_] = S(y);
|
|
2891
2890
|
}
|
|
2892
2891
|
return j;
|
|
2893
|
-
}, [o, e, r]), [
|
|
2892
|
+
}, [o, e, r]), [u, h] = Q({}), [m, c] = Q(!1), [f, w] = Q(null), x = ne(0), N = F(async () => {
|
|
2894
2893
|
if (!i?.getAggregations || Object.keys(e).length === 0) return;
|
|
2895
2894
|
const j = ++x.current;
|
|
2896
|
-
|
|
2895
|
+
c(!0), w(null);
|
|
2897
2896
|
try {
|
|
2898
2897
|
const _ = await i.getAggregations({
|
|
2899
2898
|
sortModel: a ?? [],
|
|
@@ -2901,16 +2900,16 @@ function _i(n) {
|
|
|
2901
2900
|
groupKeys: [],
|
|
2902
2901
|
aggregationModel: e
|
|
2903
2902
|
});
|
|
2904
|
-
j === x.current &&
|
|
2903
|
+
j === x.current && h(_);
|
|
2905
2904
|
} catch (_) {
|
|
2906
2905
|
j === x.current && (w(_), console.error("[useAggregation] Server aggregation error:", _));
|
|
2907
2906
|
} finally {
|
|
2908
|
-
j === x.current &&
|
|
2907
|
+
j === x.current && c(!1);
|
|
2909
2908
|
}
|
|
2910
2909
|
}, [i, e, l, a]);
|
|
2911
2910
|
return ee(() => {
|
|
2912
2911
|
r && i?.getAggregations && !s && N();
|
|
2913
|
-
}, [N, r, i, s]), { aggregationResult: de(() => r ? s && Object.keys(s).length > 0 ? s :
|
|
2912
|
+
}, [N, r, i, s]), { aggregationResult: de(() => r ? s && Object.keys(s).length > 0 ? s : u : g, [r, g, s, u]), isLoading: m, error: f };
|
|
2914
2913
|
}
|
|
2915
2914
|
function yi(n, o) {
|
|
2916
2915
|
const e = n.filter((r) => r != null && !isNaN(r));
|
|
@@ -2937,10 +2936,10 @@ function Ci(n, o, e, r) {
|
|
|
2937
2936
|
if (!r) return i;
|
|
2938
2937
|
const { rowFields: l, columnFields: a, valueFields: s } = e;
|
|
2939
2938
|
if (l.length === 0 || s.length === 0) return i;
|
|
2940
|
-
const
|
|
2939
|
+
const g = new Map(o.map((x) => [x.field, x])), u = /* @__PURE__ */ new Set();
|
|
2941
2940
|
for (const x of n)
|
|
2942
|
-
|
|
2943
|
-
const
|
|
2941
|
+
u.add(Xn(x, a));
|
|
2942
|
+
const h = Array.from(u).sort(), m = /* @__PURE__ */ new Map();
|
|
2944
2943
|
for (const x of n) {
|
|
2945
2944
|
const N = Xn(x, l);
|
|
2946
2945
|
if (!m.has(N)) {
|
|
@@ -2956,22 +2955,22 @@ function Ci(n, o, e, r) {
|
|
|
2956
2955
|
_.has(v.field) || _.set(v.field, []), isNaN(S) || _.get(v.field).push(S);
|
|
2957
2956
|
}
|
|
2958
2957
|
}
|
|
2959
|
-
let
|
|
2960
|
-
const
|
|
2958
|
+
let c = 0;
|
|
2959
|
+
const f = [];
|
|
2961
2960
|
for (const [, x] of m) {
|
|
2962
|
-
const N = { id:
|
|
2963
|
-
for (const E of
|
|
2961
|
+
const N = { id: c++, ...x.labelValues };
|
|
2962
|
+
for (const E of h) {
|
|
2964
2963
|
const j = x.bucket.get(E);
|
|
2965
2964
|
for (const _ of s) {
|
|
2966
2965
|
const v = a.length > 0 ? `${E}${_.field}${_.aggFn}` : `${_.field}${_.aggFn}`, S = j?.get(_.field) ?? [];
|
|
2967
2966
|
N[v] = S.length > 0 ? yi(S, _.aggFn) : null;
|
|
2968
2967
|
}
|
|
2969
2968
|
}
|
|
2970
|
-
|
|
2969
|
+
f.push(N);
|
|
2971
2970
|
}
|
|
2972
2971
|
const w = [];
|
|
2973
2972
|
for (const x of l) {
|
|
2974
|
-
const N =
|
|
2973
|
+
const N = g.get(x);
|
|
2975
2974
|
w.push({
|
|
2976
2975
|
field: x,
|
|
2977
2976
|
headerName: N?.headerName ?? x,
|
|
@@ -2979,13 +2978,13 @@ function Ci(n, o, e, r) {
|
|
|
2979
2978
|
sortable: !0
|
|
2980
2979
|
});
|
|
2981
2980
|
}
|
|
2982
|
-
for (const x of
|
|
2981
|
+
for (const x of h) {
|
|
2983
2982
|
const N = a.length > 0 ? x.split("\0").map((E, j) => {
|
|
2984
|
-
const _ =
|
|
2983
|
+
const _ = g.get(a[j]);
|
|
2985
2984
|
return _?.headerName ? `${_.headerName}: ${E}` : E;
|
|
2986
2985
|
}).join(" / ") : "";
|
|
2987
2986
|
for (const E of s) {
|
|
2988
|
-
const j =
|
|
2987
|
+
const j = g.get(E.field), _ = a.length > 0 ? `${x}${E.field}${E.aggFn}` : `${E.field}${E.aggFn}`, v = E.headerName ?? j?.headerName ?? E.field, S = N ? `${N} — ${v} (${E.aggFn})` : `${v} (${E.aggFn})`;
|
|
2989
2988
|
w.push({
|
|
2990
2989
|
field: _,
|
|
2991
2990
|
headerName: S,
|
|
@@ -3002,7 +3001,7 @@ function Ci(n, o, e, r) {
|
|
|
3002
3001
|
});
|
|
3003
3002
|
}
|
|
3004
3003
|
}
|
|
3005
|
-
return { pivotRows:
|
|
3004
|
+
return { pivotRows: f, pivotColumns: w, colKeys: h, isValid: !0 };
|
|
3006
3005
|
}, [n, o, e, r]);
|
|
3007
3006
|
}
|
|
3008
3007
|
function ki(n) {
|
|
@@ -3034,29 +3033,29 @@ async function Si(n) {
|
|
|
3034
3033
|
throw new Error("Clipboard API not available and fallback failed.");
|
|
3035
3034
|
}
|
|
3036
3035
|
function ji(n) {
|
|
3037
|
-
const { selectedRowIds: o, columns: e, getVisibleRows: r, getRowId: i } = n, l =
|
|
3036
|
+
const { selectedRowIds: o, columns: e, getVisibleRows: r, getRowId: i } = n, l = F(async () => {
|
|
3038
3037
|
if (o.size === 0) return;
|
|
3039
|
-
const s = r().filter((
|
|
3038
|
+
const s = r().filter((c) => o.has(i(c)));
|
|
3040
3039
|
if (s.length === 0) return;
|
|
3041
|
-
const
|
|
3042
|
-
(
|
|
3043
|
-
const w =
|
|
3044
|
-
return
|
|
3040
|
+
const g = e.filter((c) => !c.field.startsWith("__")), u = g.map((c) => c.headerName || c.field).join(" "), h = s.map(
|
|
3041
|
+
(c) => g.map((f) => {
|
|
3042
|
+
const w = c[f.field];
|
|
3043
|
+
return f.valueFormatter ? f.valueFormatter({ value: w, row: c, field: f.field }) : w ?? "";
|
|
3045
3044
|
}).join(" ")
|
|
3046
3045
|
).join(`
|
|
3047
|
-
`), m = `${
|
|
3048
|
-
${
|
|
3046
|
+
`), m = `${u}
|
|
3047
|
+
${h}`;
|
|
3049
3048
|
try {
|
|
3050
3049
|
await Si(m);
|
|
3051
|
-
} catch (
|
|
3052
|
-
console.error("[OpenGridX] Failed to copy to clipboard:",
|
|
3050
|
+
} catch (c) {
|
|
3051
|
+
console.error("[OpenGridX] Failed to copy to clipboard:", c);
|
|
3053
3052
|
}
|
|
3054
3053
|
}, [o, e, r, i]);
|
|
3055
3054
|
return ee(() => {
|
|
3056
3055
|
const a = (s) => {
|
|
3057
3056
|
if (!(s.ctrlKey || s.metaKey) || s.key !== "c") return;
|
|
3058
|
-
const
|
|
3059
|
-
|
|
3057
|
+
const g = document.activeElement, u = g?.tagName.toLowerCase(), h = g?.type;
|
|
3058
|
+
u === "input" && h !== "checkbox" && h !== "radio" || u === "textarea" || u === "select" || g?.isContentEditable || l();
|
|
3060
3059
|
};
|
|
3061
3060
|
return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
|
|
3062
3061
|
}, [l]), { copySelectedRows: l };
|
|
@@ -3068,14 +3067,14 @@ function Ri() {
|
|
|
3068
3067
|
] });
|
|
3069
3068
|
}
|
|
3070
3069
|
function Io(n) {
|
|
3071
|
-
const { columns: o, visibleColumns: e, onVisibilityChange: r, onShowAll: i, onHideAll: l } = n, [a, s] = Q(""),
|
|
3070
|
+
const { columns: o, visibleColumns: e, onVisibilityChange: r, onShowAll: i, onHideAll: l } = n, [a, s] = Q(""), u = de(() => o.filter((c) => c.hideable !== !1), [o]).every((c) => e.has(c.field)), h = de(() => {
|
|
3072
3071
|
if (!a) return o;
|
|
3073
|
-
const
|
|
3072
|
+
const c = a.toLowerCase();
|
|
3074
3073
|
return o.filter(
|
|
3075
|
-
(
|
|
3074
|
+
(f) => (f.headerName || f.field).toLowerCase().includes(c)
|
|
3076
3075
|
);
|
|
3077
|
-
}, [o, a]), m = (
|
|
3078
|
-
|
|
3076
|
+
}, [o, a]), m = (c) => {
|
|
3077
|
+
c.target.checked ? i() : l();
|
|
3079
3078
|
};
|
|
3080
3079
|
return /* @__PURE__ */ t.jsxs("div", { className: "ogx-column-visibility-panel", children: [
|
|
3081
3080
|
/* @__PURE__ */ t.jsx("div", { className: "ogx-column-visibility-panel__search-section", children: /* @__PURE__ */ t.jsxs("div", { className: "ogx-column-visibility-panel__search-container", children: [
|
|
@@ -3089,12 +3088,12 @@ function Io(n) {
|
|
|
3089
3088
|
className: "ogx-column-visibility-panel__search-input",
|
|
3090
3089
|
placeholder: "Search",
|
|
3091
3090
|
value: a,
|
|
3092
|
-
onChange: (
|
|
3091
|
+
onChange: (c) => s(c.target.value)
|
|
3093
3092
|
}
|
|
3094
3093
|
)
|
|
3095
3094
|
] }) }),
|
|
3096
|
-
/* @__PURE__ */ t.jsx("div", { className: "ogx-column-visibility-panel__list", children:
|
|
3097
|
-
const
|
|
3095
|
+
/* @__PURE__ */ t.jsx("div", { className: "ogx-column-visibility-panel__list", children: h.map((c) => {
|
|
3096
|
+
const f = e.has(c.field), w = c.hideable !== !1;
|
|
3098
3097
|
return /* @__PURE__ */ t.jsxs(
|
|
3099
3098
|
"label",
|
|
3100
3099
|
{
|
|
@@ -3103,15 +3102,15 @@ function Io(n) {
|
|
|
3103
3102
|
/* @__PURE__ */ t.jsx(
|
|
3104
3103
|
Rn,
|
|
3105
3104
|
{
|
|
3106
|
-
checked:
|
|
3107
|
-
onChange: (x) => r(
|
|
3105
|
+
checked: f,
|
|
3106
|
+
onChange: (x) => r(c.field, x.target.checked),
|
|
3108
3107
|
disabled: !w
|
|
3109
3108
|
}
|
|
3110
3109
|
),
|
|
3111
|
-
/* @__PURE__ */ t.jsx("span", { className: "ogx-column-visibility-panel__label", children:
|
|
3110
|
+
/* @__PURE__ */ t.jsx("span", { className: "ogx-column-visibility-panel__label", children: c.headerName || c.field })
|
|
3112
3111
|
]
|
|
3113
3112
|
},
|
|
3114
|
-
|
|
3113
|
+
c.field
|
|
3115
3114
|
);
|
|
3116
3115
|
}) }),
|
|
3117
3116
|
/* @__PURE__ */ t.jsxs("div", { className: "ogx-column-visibility-panel__footer", children: [
|
|
@@ -3119,7 +3118,7 @@ function Io(n) {
|
|
|
3119
3118
|
/* @__PURE__ */ t.jsx(
|
|
3120
3119
|
Rn,
|
|
3121
3120
|
{
|
|
3122
|
-
checked:
|
|
3121
|
+
checked: u,
|
|
3123
3122
|
onChange: m
|
|
3124
3123
|
}
|
|
3125
3124
|
),
|
|
@@ -3145,12 +3144,12 @@ function el(n) {
|
|
|
3145
3144
|
headerHeight: l = 56,
|
|
3146
3145
|
autoHeight: a = !1,
|
|
3147
3146
|
checkboxSelection: s = !1,
|
|
3148
|
-
rowSelectionModel:
|
|
3149
|
-
onRowSelectionModelChange:
|
|
3150
|
-
onRowClick:
|
|
3147
|
+
rowSelectionModel: g,
|
|
3148
|
+
onRowSelectionModelChange: u,
|
|
3149
|
+
onRowClick: h,
|
|
3151
3150
|
onCellClick: m,
|
|
3152
|
-
filterModel:
|
|
3153
|
-
onFilterModelChange:
|
|
3151
|
+
filterModel: c,
|
|
3152
|
+
onFilterModelChange: f,
|
|
3154
3153
|
sortModel: w,
|
|
3155
3154
|
onSortModelChange: x,
|
|
3156
3155
|
pagination: N = !1,
|
|
@@ -3191,13 +3190,13 @@ function el(n) {
|
|
|
3191
3190
|
slots: Ie,
|
|
3192
3191
|
slotProps: ft,
|
|
3193
3192
|
pivotMode: Ge = !1,
|
|
3194
|
-
pivotModel:
|
|
3195
|
-
onPivotModelChange:
|
|
3193
|
+
pivotModel: ht,
|
|
3194
|
+
onPivotModelChange: pt,
|
|
3196
3195
|
className: Qt = "",
|
|
3197
3196
|
style: Lt,
|
|
3198
3197
|
onRowsScrollEnd: Rt,
|
|
3199
3198
|
ariaLabel: Tt,
|
|
3200
|
-
initialState:
|
|
3199
|
+
initialState: yt,
|
|
3201
3200
|
onStateChange: Be,
|
|
3202
3201
|
// Column Visibility
|
|
3203
3202
|
columnVisibilityModel: eo,
|
|
@@ -3207,38 +3206,38 @@ function el(n) {
|
|
|
3207
3206
|
columnGroupingModel: Et,
|
|
3208
3207
|
noRowsLabel: Nn = "No Data",
|
|
3209
3208
|
apiRef: In
|
|
3210
|
-
} = n, To = de(() => ({ items: [] }), []), Ye =
|
|
3211
|
-
() =>
|
|
3212
|
-
), Pn = w !== void 0, ot = Pn ? w :
|
|
3209
|
+
} = n, To = de(() => ({ items: [] }), []), Ye = c || To, [Wo, Fo] = Q(
|
|
3210
|
+
() => yt?.sorting?.sortModel ?? []
|
|
3211
|
+
), Pn = w !== void 0, ot = Pn ? w : Wo, Oo = de(() => [], []), Mn = T || Oo, Ln = A !== void 0, oo = de(() => Ie?.toolbar, [Ie?.toolbar]), [Ao, zo] = Q(
|
|
3213
3212
|
() => A ?? {}
|
|
3214
|
-
), rt = Ln ? A : Ao, Bo =
|
|
3215
|
-
Ln || zo(
|
|
3213
|
+
), rt = Ln ? A : Ao, Bo = F((d) => {
|
|
3214
|
+
Ln || zo(d), O?.(d);
|
|
3216
3215
|
}, [Ln, O]), [$o, Ho] = Q(
|
|
3217
|
-
() =>
|
|
3218
|
-
), Tn = eo !== void 0, Qe = Tn ? eo : $o, Zt =
|
|
3219
|
-
Tn || Ho(
|
|
3216
|
+
() => yt?.columns?.columnVisibilityModel ?? {}
|
|
3217
|
+
), Tn = eo !== void 0, Qe = Tn ? eo : $o, Zt = F((d) => {
|
|
3218
|
+
Tn || Ho(d), to?.(d);
|
|
3220
3219
|
}, [Tn, to]), [Do, Go] = Q(
|
|
3221
|
-
() =>
|
|
3222
|
-
),
|
|
3223
|
-
|
|
3224
|
-
}, [
|
|
3225
|
-
Ko(
|
|
3226
|
-
}, [
|
|
3220
|
+
() => yt?.columns?.pinnedColumns ?? {}
|
|
3221
|
+
), Wn = v !== void 0, it = Wn ? v : Do, Fn = F((d) => {
|
|
3222
|
+
Wn || Go(d), S?.(d);
|
|
3223
|
+
}, [Wn, S]), Vo = de(() => ({ rowFields: [], columnFields: [], valueFields: [] }), []), [Uo, Ko] = Q(ht ?? Vo), ro = ht ?? Uo, Yo = F((d) => {
|
|
3224
|
+
Ko(d), pt?.(d);
|
|
3225
|
+
}, [pt]), dn = Ci(o, e, ro, Ge), On = Ge && dn.isValid ? dn.pivotRows : o, lt = Ge && dn.isValid ? dn.pivotColumns : e, [Xo, io] = Q(null);
|
|
3227
3226
|
ee(() => {
|
|
3228
3227
|
io(null);
|
|
3229
3228
|
}, [rt]);
|
|
3230
3229
|
const [qo, Jo] = Q(
|
|
3231
|
-
() =>
|
|
3232
|
-
), An = n.paginationModel !== void 0, xe = An ? E : qo, cn =
|
|
3233
|
-
An || Jo(
|
|
3234
|
-
}, [An, j]), [Qo, lo] = Q([]), en =
|
|
3235
|
-
Kn.current?.classList.toggle("ogx--kb",
|
|
3230
|
+
() => yt?.pagination?.paginationModel ?? E
|
|
3231
|
+
), An = n.paginationModel !== void 0, xe = An ? E : qo, cn = F((d) => {
|
|
3232
|
+
An || Jo(d), j?.(d);
|
|
3233
|
+
}, [An, j]), [Qo, lo] = Q([]), en = g !== void 0, so = en ? g : Qo, Pe = de(() => new Set(so), [so]), un = u, Nt = ne(null), Zo = ne(null), gn = ne(null), er = F((d) => d.id, []), fn = r || er, [Ze, Wt] = Q(null), Ft = F((d) => {
|
|
3234
|
+
Kn.current?.classList.toggle("ogx--kb", d);
|
|
3236
3235
|
}, []), ao = ne(ie);
|
|
3237
3236
|
ao.current = ie;
|
|
3238
|
-
const co = ne(null), uo = ne(null), tr =
|
|
3239
|
-
if (ao.current && we &&
|
|
3240
|
-
const R = uo.current?.getNodePath(
|
|
3241
|
-
co.current?.(
|
|
3237
|
+
const co = ne(null), uo = ne(null), tr = F((d) => {
|
|
3238
|
+
if (ao.current && we && d.serverChildrenCount > 0 && d.children.length === 0) {
|
|
3239
|
+
const R = uo.current?.getNodePath(d.id) || [d.groupingKey];
|
|
3240
|
+
co.current?.(d.id, R);
|
|
3242
3241
|
}
|
|
3243
3242
|
}, [we]), st = ii({
|
|
3244
3243
|
rows: On,
|
|
@@ -3271,7 +3270,7 @@ function el(n) {
|
|
|
3271
3270
|
ee(() => {
|
|
3272
3271
|
Ot.current.copySelectedRows = po, Ot.current.getSelectedRows = () => Array.from(Pe);
|
|
3273
3272
|
}, [po, Pe, Ot]);
|
|
3274
|
-
const ir = ue.dataSource.loading, tn = J || ir, nn = de(() => ue.rows.allRows.map((
|
|
3273
|
+
const ir = ue.dataSource.loading, tn = J || ir, nn = de(() => ue.rows.allRows.map((d) => ue.rows.idRowsLookup.get(d)), [ue.rows]), Bn = hi({
|
|
3275
3274
|
rows: nn,
|
|
3276
3275
|
getRowId: fn,
|
|
3277
3276
|
getTreeDataPath: b,
|
|
@@ -3298,29 +3297,29 @@ function el(n) {
|
|
|
3298
3297
|
getRowId: fn,
|
|
3299
3298
|
processRowUpdate: P,
|
|
3300
3299
|
onProcessRowUpdateError: ce,
|
|
3301
|
-
onRowChange: (
|
|
3300
|
+
onRowChange: (d) => {
|
|
3302
3301
|
const { dispatch: R } = st, V = Array.from(st.state.rows.idRowsLookup.values()).map(
|
|
3303
|
-
(le) => le.id ===
|
|
3302
|
+
(le) => le.id === d.id ? d : le
|
|
3304
3303
|
);
|
|
3305
3304
|
R({ type: "SET_ROWS", payload: V });
|
|
3306
3305
|
}
|
|
3307
|
-
}), $n = we, At = !!(Mn && Mn.length > 0), hn = $n || At, He = $n ? Bn : At ? lr : null, Me = N && !At, pn =
|
|
3308
|
-
const { row: R, id: M } =
|
|
3306
|
+
}), $n = we, At = !!(Mn && Mn.length > 0), hn = $n || At, He = $n ? Bn : At ? lr : null, Me = N && !At, pn = F((d) => {
|
|
3307
|
+
const { row: R, id: M } = d;
|
|
3309
3308
|
if (hn && R._hasChildren) {
|
|
3310
3309
|
He?.toggleExpansion(M);
|
|
3311
3310
|
return;
|
|
3312
3311
|
}
|
|
3313
|
-
|
|
3314
|
-
}, [hn, He,
|
|
3315
|
-
...
|
|
3312
|
+
h?.(d);
|
|
3313
|
+
}, [hn, He, h]), Oe = de(() => hn ? lt.map((d, R) => R === 0 ? {
|
|
3314
|
+
...d,
|
|
3316
3315
|
renderCell: (M) => {
|
|
3317
3316
|
const { _treeDepth: V, _hasChildren: le, _isExpanded: fe, _groupingField: Ce, _groupingValue: qe, _descendantCount: Ue } = M.row, be = (V || 0) * 24;
|
|
3318
|
-
let ae =
|
|
3317
|
+
let ae = d.renderCell ? d.renderCell(M) : M.value;
|
|
3319
3318
|
return $n && le && M.row._isGroupRow && (ae = /* @__PURE__ */ t.jsxs("div", { className: "ogx__group-cell-content", children: [
|
|
3320
3319
|
M.value,
|
|
3321
3320
|
Ue !== void 0 && Ue > 0 ? ` (${Ue})` : ""
|
|
3322
3321
|
] })), At && le && Ce && (ae = /* @__PURE__ */ t.jsxs("div", { className: "ogx__group-cell-content", children: [
|
|
3323
|
-
|
|
3322
|
+
d.field === Ce ? "" : `${Ce}: `,
|
|
3324
3323
|
String(qe),
|
|
3325
3324
|
Ue !== void 0 ? ` (${Ue})` : ""
|
|
3326
3325
|
] })), /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", paddingLeft: be, width: "100%", height: "100%" }, children: [
|
|
@@ -3372,10 +3371,10 @@ function el(n) {
|
|
|
3372
3371
|
] });
|
|
3373
3372
|
}
|
|
3374
3373
|
} : {
|
|
3375
|
-
...
|
|
3374
|
+
...d,
|
|
3376
3375
|
renderCell: (M) => {
|
|
3377
3376
|
const { _hasChildren: V, _groupingField: le } = M.row;
|
|
3378
|
-
return At && V ?
|
|
3377
|
+
return At && V ? d.field === le ? null : M.value !== void 0 && M.value !== null ? d.renderCell ? d.renderCell(M) : M.value : null : d.renderCell ? d.renderCell(M) : M.value;
|
|
3379
3378
|
}
|
|
3380
3379
|
}) : lt, [lt, hn, At, He]), Hn = bi({
|
|
3381
3380
|
dataSource: ie,
|
|
@@ -3396,43 +3395,43 @@ function el(n) {
|
|
|
3396
3395
|
Hn.fetchChildren && (co.current = Hn.fetchChildren);
|
|
3397
3396
|
}, [Hn.fetchChildren]);
|
|
3398
3397
|
const [at, sr] = Q(
|
|
3399
|
-
() =>
|
|
3398
|
+
() => yt?.columns?.columnWidths ?? {}
|
|
3400
3399
|
), [ar, xo] = Q(
|
|
3401
|
-
() =>
|
|
3400
|
+
() => yt?.columns?.columnOrder ?? lt.map((d) => d.field)
|
|
3402
3401
|
), zt = $ || ar;
|
|
3403
3402
|
ee(() => {
|
|
3404
3403
|
ie || zn(On);
|
|
3405
3404
|
}, [On, zn, ie]), ee(() => {
|
|
3406
3405
|
go(lt);
|
|
3407
3406
|
}, [lt, go]), ee(() => {
|
|
3408
|
-
Ge && xo(lt.map((
|
|
3407
|
+
Ge && xo(lt.map((d) => d.field));
|
|
3409
3408
|
}, [Ge, lt]);
|
|
3410
3409
|
const Bt = de(() => {
|
|
3411
3410
|
if (Y) return Oe;
|
|
3412
|
-
const
|
|
3411
|
+
const d = new Map(zt.map((R, M) => [R, M]));
|
|
3413
3412
|
return [...Oe].sort((R, M) => {
|
|
3414
|
-
const V =
|
|
3413
|
+
const V = d.get(R.field) ?? Oe.indexOf(R), le = d.get(M.field) ?? Oe.indexOf(M);
|
|
3415
3414
|
return V - le;
|
|
3416
3415
|
});
|
|
3417
|
-
}, [Oe, zt, Y]), mo = de(() => Bt.filter((
|
|
3416
|
+
}, [Oe, zt, Y]), mo = de(() => Bt.filter((d) => Qe[d.field] !== !1), [Bt, Qe]), $t = li({
|
|
3418
3417
|
columns: Bt,
|
|
3419
|
-
onColumnOrderChange:
|
|
3420
|
-
const { oldIndex: R, targetIndex: M } =
|
|
3421
|
-
V.splice(M, 0, le), $ || xo(V), K?.(
|
|
3418
|
+
onColumnOrderChange: F((d) => {
|
|
3419
|
+
const { oldIndex: R, targetIndex: M } = d, V = [...zt], [le] = V.splice(R, 1);
|
|
3420
|
+
V.splice(M, 0, le), $ || xo(V), K?.(d);
|
|
3422
3421
|
}, [zt, $, K]),
|
|
3423
3422
|
disableColumnReorder: Y
|
|
3424
|
-
}), [dr, cr] = Q(/* @__PURE__ */ new Set()),
|
|
3425
|
-
const R = new Set(
|
|
3426
|
-
R.has(
|
|
3427
|
-
}, [
|
|
3428
|
-
const
|
|
3429
|
-
return D &&
|
|
3430
|
-
}, [Bt, s, et, D]), ur =
|
|
3431
|
-
sr((M) => ({ ...M, [
|
|
3423
|
+
}), [dr, cr] = Q(/* @__PURE__ */ new Set()), Ct = p ?? dr, et = !!I, on = F((d) => {
|
|
3424
|
+
const R = new Set(Ct);
|
|
3425
|
+
R.has(d) ? R.delete(d) : R.add(d), p === void 0 && cr(R), k?.(R);
|
|
3426
|
+
}, [Ct, p, k]), ye = de(() => {
|
|
3427
|
+
const d = [];
|
|
3428
|
+
return D && d.push({ field: "__reorder_col__" }), et && d.push({ field: "__expand_col__" }), s && d.push({ field: "__checkbox_col__" }), [...d, ...Bt];
|
|
3429
|
+
}, [Bt, s, et, D]), ur = F((d, R) => {
|
|
3430
|
+
sr((M) => ({ ...M, [d]: R }));
|
|
3432
3431
|
}, []), Dn = ne(Be);
|
|
3433
3432
|
Dn.current = Be, ee(() => {
|
|
3434
3433
|
if (!Dn.current) return;
|
|
3435
|
-
const
|
|
3434
|
+
const d = {
|
|
3436
3435
|
sorting: { sortModel: ot },
|
|
3437
3436
|
filter: { filterModel: Ye },
|
|
3438
3437
|
pagination: { paginationModel: xe },
|
|
@@ -3443,7 +3442,7 @@ function el(n) {
|
|
|
3443
3442
|
pinnedColumns: it
|
|
3444
3443
|
}
|
|
3445
3444
|
};
|
|
3446
|
-
Dn.current(
|
|
3445
|
+
Dn.current(d);
|
|
3447
3446
|
}, [
|
|
3448
3447
|
ot,
|
|
3449
3448
|
Ye,
|
|
@@ -3453,24 +3452,24 @@ function el(n) {
|
|
|
3453
3452
|
Qe,
|
|
3454
3453
|
it
|
|
3455
3454
|
]);
|
|
3456
|
-
const xn = de(() => nn, [nn]), Ve = de(() => He ? He.getVisibleRows() || [] : nt === "server" && ie ? xn : ui(xn, Ye), [xn, Ye, He, nt, ie]), { top: Xe, center: Ht, bottom: dt } = de(() => He ? { top: [], center: Ve, bottom: [] } : Pr(Ve, y), [Ve, y, He]), Le = de(() => He || ve === "server" && ie ? Ht : fi(Ht, ot), [Ht, ot, He, ve, ie]),
|
|
3455
|
+
const xn = de(() => nn, [nn]), Ve = de(() => He ? He.getVisibleRows() || [] : nt === "server" && ie ? xn : ui(xn, Ye), [xn, Ye, He, nt, ie]), { top: Xe, center: Ht, bottom: dt } = de(() => He ? { top: [], center: Ve, bottom: [] } : Pr(Ve, y), [Ve, y, He]), Le = de(() => He || ve === "server" && ie ? Ht : fi(Ht, ot), [Ht, ot, He, ve, ie]), xt = de(() => {
|
|
3457
3456
|
if (!Me || z === "server" && ie)
|
|
3458
3457
|
return Le;
|
|
3459
|
-
const
|
|
3460
|
-
return Le.slice(
|
|
3458
|
+
const d = xe.page * xe.pageSize, R = d + xe.pageSize;
|
|
3459
|
+
return Le.slice(d, R);
|
|
3461
3460
|
}, [Le, Me, xe.page, xe.pageSize, z, ie]);
|
|
3462
3461
|
ee(() => {
|
|
3463
3462
|
st.apiRef.current.getVisibleRows = () => Le, st.apiRef.current.getVisibleColumns = () => Oe;
|
|
3464
3463
|
}, [Le, Oe, st.apiRef]);
|
|
3465
3464
|
const Dt = si({
|
|
3466
|
-
rows: Me ?
|
|
3467
|
-
getRowId: (
|
|
3465
|
+
rows: Me ? xt : Le,
|
|
3466
|
+
getRowId: (d) => d.id,
|
|
3468
3467
|
onRowOrderChange: te,
|
|
3469
3468
|
rowReordering: D
|
|
3470
3469
|
}), Re = de(() => {
|
|
3471
3470
|
if (He)
|
|
3472
3471
|
return Ht;
|
|
3473
|
-
const
|
|
3472
|
+
const d = Me ? xt : Le, R = [...Xe, ...d, ...dt];
|
|
3474
3473
|
if (z === "infinite" && ue.dataSource.loading && R.length > 0) {
|
|
3475
3474
|
const M = Math.min(xe.pageSize, 20), V = Array.from({ length: M }, (le, fe) => ({
|
|
3476
3475
|
id: `__skeleton_${fe}__`,
|
|
@@ -3481,7 +3480,7 @@ function el(n) {
|
|
|
3481
3480
|
return R;
|
|
3482
3481
|
}, [
|
|
3483
3482
|
Xe,
|
|
3484
|
-
|
|
3483
|
+
xt,
|
|
3485
3484
|
Le,
|
|
3486
3485
|
dt,
|
|
3487
3486
|
Me,
|
|
@@ -3507,77 +3506,77 @@ function el(n) {
|
|
|
3507
3506
|
st.apiRef.current.getAggregationResult = () => mn ? Gn : null, st.apiRef.current.getAggregationModel = () => mn ? rt : null;
|
|
3508
3507
|
}, [Gn, rt, mn, st.apiRef]);
|
|
3509
3508
|
const Vn = de(() => {
|
|
3510
|
-
const
|
|
3511
|
-
let oe =
|
|
3512
|
-
if (
|
|
3513
|
-
const De = C?.({ row:
|
|
3509
|
+
const d = i, R = Me ? xt : Le, M = R.map((W, X) => {
|
|
3510
|
+
let oe = d;
|
|
3511
|
+
if (Ct.has(W.id)) {
|
|
3512
|
+
const De = C?.({ row: W, id: W.id, rowIndex: Xe.length + X }) ?? 200;
|
|
3514
3513
|
oe += typeof De == "number" ? De : parseInt(String(De), 10) || 200;
|
|
3515
3514
|
}
|
|
3516
3515
|
return oe;
|
|
3517
|
-
}), V = M.reduce((
|
|
3518
|
-
mo.forEach((
|
|
3519
|
-
const X = En(
|
|
3520
|
-
X === "left" ? se.push(
|
|
3516
|
+
}), V = M.reduce((W, X, oe) => (W.push((W[oe - 1] || 0) + X), W), []), fe = (z === "infinite" && ue.dataSource.loading && R.length > 0 ? Math.min(xe.pageSize, 20) : 0) * d, Ce = (V[V.length - 1] || 0) + fe, qe = Xe.length * d, Ue = dt.length * d, se = [], be = [], ae = [], G = [];
|
|
3517
|
+
mo.forEach((W) => {
|
|
3518
|
+
const X = En(W.field, it);
|
|
3519
|
+
X === "left" ? se.push(W) : X === "right" ? be.push(W) : ae.push(W);
|
|
3521
3520
|
});
|
|
3522
|
-
const me = ue.dimensions.viewportWidth || 1e3, je = (s ? 48 : 0) + (et ? 48 : 0) + (D ? 48 : 0), _e = (
|
|
3523
|
-
if (
|
|
3524
|
-
if (typeof
|
|
3525
|
-
if (typeof
|
|
3526
|
-
if (
|
|
3527
|
-
if (
|
|
3528
|
-
return { type: "percentage", value: parseFloat(
|
|
3529
|
-
const X = parseFloat(
|
|
3521
|
+
const me = ue.dimensions.viewportWidth || 1e3, je = (s ? 48 : 0) + (et ? 48 : 0) + (D ? 48 : 0), _e = (W) => at[W.field] ?? W.width, Te = (W) => {
|
|
3522
|
+
if (W === void 0) return { type: "auto", value: 0 };
|
|
3523
|
+
if (typeof W == "number") return { type: "fixed", value: W };
|
|
3524
|
+
if (typeof W == "string") {
|
|
3525
|
+
if (W.toLowerCase() === "auto") return { type: "auto", value: 0 };
|
|
3526
|
+
if (W.endsWith("%"))
|
|
3527
|
+
return { type: "percentage", value: parseFloat(W) };
|
|
3528
|
+
const X = parseFloat(W);
|
|
3530
3529
|
if (!isNaN(X)) return { type: "fixed", value: X };
|
|
3531
3530
|
}
|
|
3532
3531
|
return { type: "fixed", value: 100 };
|
|
3533
|
-
},
|
|
3532
|
+
}, We = se.reduce((W, X) => {
|
|
3534
3533
|
const oe = Te(_e(X));
|
|
3535
|
-
return
|
|
3536
|
-
}, 0), he = be.reduce((
|
|
3534
|
+
return W + (oe.type === "fixed" ? oe.value : 100);
|
|
3535
|
+
}, 0), he = be.reduce((W, X) => {
|
|
3537
3536
|
const oe = Te(_e(X));
|
|
3538
|
-
return
|
|
3539
|
-
}, 0), ge = ae.reduce((
|
|
3537
|
+
return W + (oe.type === "fixed" ? oe.value : 100);
|
|
3538
|
+
}, 0), ge = ae.reduce((W, X) => {
|
|
3540
3539
|
if (X.flex && X.flex > 0) {
|
|
3541
|
-
const De = X.minWidth ?? 150,
|
|
3542
|
-
return
|
|
3540
|
+
const De = X.minWidth ?? 150, vt = typeof X.width == "number" ? X.width : 150;
|
|
3541
|
+
return W + (De || vt);
|
|
3543
3542
|
}
|
|
3544
3543
|
const oe = Te(_e(X));
|
|
3545
|
-
return oe.type === "fixed" ?
|
|
3546
|
-
}, 0),
|
|
3547
|
-
me - je -
|
|
3544
|
+
return oe.type === "fixed" ? W + oe.value : oe.type === "percentage" ? W + 100 : W + (X.minWidth ?? 150);
|
|
3545
|
+
}, 0), mt = Math.max(
|
|
3546
|
+
me - je - We - he,
|
|
3548
3547
|
ge
|
|
3549
3548
|
), ct = [], Ae = [], Ee = [];
|
|
3550
3549
|
let ze = 0;
|
|
3551
|
-
ae.forEach((
|
|
3552
|
-
const X = Te(_e(
|
|
3553
|
-
if (
|
|
3554
|
-
Ee.push({ col:
|
|
3550
|
+
ae.forEach((W) => {
|
|
3551
|
+
const X = Te(_e(W));
|
|
3552
|
+
if (W.flex && W.flex > 0) {
|
|
3553
|
+
Ee.push({ col: W, flex: W.flex }), ze += W.flex;
|
|
3555
3554
|
return;
|
|
3556
3555
|
}
|
|
3557
|
-
X.type === "fixed" ? ct.push({ col:
|
|
3556
|
+
X.type === "fixed" ? ct.push({ col: W, width: X.value }) : X.type === "percentage" ? Ae.push({ col: W, percentage: X.value }) : (Ee.push({ col: W, flex: 1 }), ze += 1);
|
|
3558
3557
|
});
|
|
3559
|
-
const Ke = ct.reduce((
|
|
3560
|
-
let
|
|
3558
|
+
const Ke = ct.reduce((W, { width: X }) => W + X, 0);
|
|
3559
|
+
let Fe = Math.max(0, mt - Ke);
|
|
3561
3560
|
const ut = /* @__PURE__ */ new Map();
|
|
3562
|
-
Ae.forEach(({ col:
|
|
3563
|
-
const oe = X / 100 *
|
|
3564
|
-
ut.set(
|
|
3565
|
-
}),
|
|
3566
|
-
const
|
|
3567
|
-
...
|
|
3568
|
-
minWidth:
|
|
3569
|
-
maxWidth:
|
|
3561
|
+
Ae.forEach(({ col: W, percentage: X }) => {
|
|
3562
|
+
const oe = X / 100 * Fe;
|
|
3563
|
+
ut.set(W.field, oe), Fe -= oe;
|
|
3564
|
+
}), Fe = Math.max(0, Fe);
|
|
3565
|
+
const kt = /* @__PURE__ */ new Map(), wt = Ee.map((W) => ({
|
|
3566
|
+
...W,
|
|
3567
|
+
minWidth: W.col.minWidth ?? 50,
|
|
3568
|
+
maxWidth: W.col.maxWidth ?? 1 / 0,
|
|
3570
3569
|
frozen: !1,
|
|
3571
3570
|
computedWidth: 0
|
|
3572
3571
|
}));
|
|
3573
3572
|
(() => {
|
|
3574
|
-
let
|
|
3575
|
-
const X =
|
|
3576
|
-
for (;
|
|
3577
|
-
|
|
3578
|
-
const oe =
|
|
3573
|
+
let W = 0;
|
|
3574
|
+
const X = wt.length * 2;
|
|
3575
|
+
for (; W < X; ) {
|
|
3576
|
+
W++;
|
|
3577
|
+
const oe = wt.filter((re) => !re.frozen);
|
|
3579
3578
|
if (oe.length === 0) break;
|
|
3580
|
-
const De = oe.reduce((re, gt) => re + gt.flex, 0),
|
|
3579
|
+
const De = oe.reduce((re, gt) => re + gt.flex, 0), vt = wt.reduce((re, gt) => gt.frozen ? re + gt.computedWidth : re, 0), _r = Math.max(0, Fe - vt);
|
|
3581
3580
|
if (De <= 0) {
|
|
3582
3581
|
oe.forEach((re) => {
|
|
3583
3582
|
re.computedWidth = re.minWidth, re.frozen = !0;
|
|
@@ -3611,46 +3610,46 @@ function el(n) {
|
|
|
3611
3610
|
re.computedWidth = re.maxWidth, re.frozen = !0;
|
|
3612
3611
|
}));
|
|
3613
3612
|
}
|
|
3614
|
-
})(),
|
|
3613
|
+
})(), wt.forEach((W) => kt.set(W.col.field, W.computedWidth));
|
|
3615
3614
|
const Ut = /* @__PURE__ */ new Map();
|
|
3616
|
-
ae.forEach((
|
|
3615
|
+
ae.forEach((W) => {
|
|
3617
3616
|
let X;
|
|
3618
|
-
if (
|
|
3619
|
-
X =
|
|
3617
|
+
if (kt.has(W.field))
|
|
3618
|
+
X = kt.get(W.field);
|
|
3620
3619
|
else {
|
|
3621
|
-
const oe = ct.find((
|
|
3620
|
+
const oe = ct.find((vt) => vt.col.field === W.field), De = Ae.find((vt) => vt.col.field === W.field);
|
|
3622
3621
|
if (oe)
|
|
3623
3622
|
X = oe.width;
|
|
3624
3623
|
else if (De) {
|
|
3625
|
-
const
|
|
3626
|
-
X = Math.max(
|
|
3624
|
+
const vt = ut.get(W.field) || 0;
|
|
3625
|
+
X = Math.max(W.minWidth ?? 50, vt || 100);
|
|
3627
3626
|
} else
|
|
3628
3627
|
X = 100;
|
|
3629
3628
|
}
|
|
3630
|
-
G.push(X), Ut.set(
|
|
3629
|
+
G.push(X), Ut.set(W.field, X);
|
|
3631
3630
|
});
|
|
3632
|
-
const
|
|
3633
|
-
const X =
|
|
3631
|
+
const bt = ae.map((W) => {
|
|
3632
|
+
const X = wt.find((oe) => oe.col.field === W.field);
|
|
3634
3633
|
return {
|
|
3635
|
-
...
|
|
3636
|
-
width: Ut.get(
|
|
3637
|
-
flex: X ? X.flex :
|
|
3634
|
+
...W,
|
|
3635
|
+
width: Ut.get(W.field) ?? (typeof W.width == "number" ? W.width : 100),
|
|
3636
|
+
flex: X ? X.flex : W.flex
|
|
3638
3637
|
};
|
|
3639
|
-
}), Je = 11, It = se.map((
|
|
3640
|
-
const oe = Te(_e(
|
|
3638
|
+
}), Je = 11, It = se.map((W, X) => {
|
|
3639
|
+
const oe = Te(_e(W)), De = oe.type === "fixed" ? oe.value : 100;
|
|
3641
3640
|
return {
|
|
3642
|
-
...
|
|
3641
|
+
...W,
|
|
3643
3642
|
width: De,
|
|
3644
3643
|
zIndex: Je + X
|
|
3645
3644
|
};
|
|
3646
|
-
}), Kt = 11,
|
|
3647
|
-
const oe = Te(_e(
|
|
3645
|
+
}), Kt = 11, St = be.map((W, X) => {
|
|
3646
|
+
const oe = Te(_e(W)), De = oe.type === "fixed" ? oe.value : 100;
|
|
3648
3647
|
return {
|
|
3649
|
-
...
|
|
3648
|
+
...W,
|
|
3650
3649
|
width: De,
|
|
3651
3650
|
zIndex: Kt + (be.length - 1 - X)
|
|
3652
3651
|
};
|
|
3653
|
-
}), tt = G.reduce((
|
|
3652
|
+
}), tt = G.reduce((W, X) => W + X, 0), ke = We + tt + he + je, vr = G.reduce((W, X, oe) => (W.push((W[oe - 1] || 0) + X), W), []);
|
|
3654
3653
|
return {
|
|
3655
3654
|
rowHeights: M,
|
|
3656
3655
|
cumulativeHeights: V,
|
|
@@ -3658,12 +3657,12 @@ function el(n) {
|
|
|
3658
3657
|
pinnedTopHeight: qe,
|
|
3659
3658
|
pinnedBottomHeight: Ue,
|
|
3660
3659
|
leftPinnedCols: It,
|
|
3661
|
-
rightPinnedCols:
|
|
3662
|
-
unpinnedColsWithWidth:
|
|
3660
|
+
rightPinnedCols: St,
|
|
3661
|
+
unpinnedColsWithWidth: bt,
|
|
3663
3662
|
unpinnedColWidths: G,
|
|
3664
3663
|
unpinnedAccWidths: vr,
|
|
3665
3664
|
totalWidth: ke,
|
|
3666
|
-
leftWidth:
|
|
3665
|
+
leftWidth: We,
|
|
3667
3666
|
rightWidth: he,
|
|
3668
3667
|
unpinnedTotalWidth: tt,
|
|
3669
3668
|
systemColumnsWidth: je,
|
|
@@ -3674,13 +3673,13 @@ function el(n) {
|
|
|
3674
3673
|
}, [
|
|
3675
3674
|
i,
|
|
3676
3675
|
Me,
|
|
3677
|
-
|
|
3676
|
+
xt,
|
|
3678
3677
|
Le,
|
|
3679
|
-
|
|
3678
|
+
Ct,
|
|
3680
3679
|
C,
|
|
3681
3680
|
Xe.length,
|
|
3682
3681
|
dt.length,
|
|
3683
|
-
|
|
3682
|
+
Ct,
|
|
3684
3683
|
C,
|
|
3685
3684
|
Xe.length,
|
|
3686
3685
|
dt.length,
|
|
@@ -3699,7 +3698,7 @@ function el(n) {
|
|
|
3699
3698
|
xe.pageSize
|
|
3700
3699
|
]), Se = de(() => {
|
|
3701
3700
|
const {
|
|
3702
|
-
unpinnedAccWidths:
|
|
3701
|
+
unpinnedAccWidths: d,
|
|
3703
3702
|
unpinnedColsWithWidth: R,
|
|
3704
3703
|
leftPinnedCols: M,
|
|
3705
3704
|
rightPinnedCols: V,
|
|
@@ -3714,36 +3713,36 @@ function el(n) {
|
|
|
3714
3713
|
unpinnedRowsHeight: G,
|
|
3715
3714
|
rowHeights: me,
|
|
3716
3715
|
unpinnedRowsLength: je
|
|
3717
|
-
} = Vn, _e = ue.virtualization.scrollLeft, Te = ue.virtualization.scrollTop,
|
|
3718
|
-
let Ae = 0, Ee = R.length - 1, ze = 0, Ke =
|
|
3716
|
+
} = Vn, _e = ue.virtualization.scrollLeft, Te = ue.virtualization.scrollTop, We = ue.dimensions.viewportWidth || 1e3, he = a ? be + G + ae + 50 : ue.dimensions.viewportHeight || 600, ge = 6, mt = Math.max(0, _e - fe), ct = _e + We - fe;
|
|
3717
|
+
let Ae = 0, Ee = R.length - 1, ze = 0, Ke = d.length - 1;
|
|
3719
3718
|
for (; ze <= Ke; ) {
|
|
3720
3719
|
const ke = ze + Ke >>> 1;
|
|
3721
|
-
|
|
3720
|
+
d[ke] < mt ? ze = ke + 1 : Ke = ke - 1;
|
|
3722
3721
|
}
|
|
3723
3722
|
Ae = Math.max(0, ze - ge);
|
|
3724
|
-
for (let ke = Ae; ke <
|
|
3725
|
-
if ((ke === 0 ? 0 :
|
|
3723
|
+
for (let ke = Ae; ke < d.length; ke++) {
|
|
3724
|
+
if ((ke === 0 ? 0 : d[ke - 1]) > ct) {
|
|
3726
3725
|
Ee = Math.min(R.length - 1, ke + ge);
|
|
3727
3726
|
break;
|
|
3728
3727
|
}
|
|
3729
3728
|
Ee = Math.min(R.length - 1, ke + ge);
|
|
3730
3729
|
}
|
|
3731
|
-
const
|
|
3730
|
+
const Fe = Ae > 0 ? d[Ae - 1] : 0, ut = qe - d[Ee], kt = [
|
|
3732
3731
|
...M,
|
|
3733
|
-
...
|
|
3732
|
+
...Fe > 0 ? [{ field: "__spacer_left__", width: Fe, isSpacer: !0 }] : [],
|
|
3734
3733
|
...R.slice(Ae, Ee + 1),
|
|
3735
3734
|
...ut > 0 ? [{ field: "__spacer_right__", width: ut, isSpacer: !0 }] : [],
|
|
3736
3735
|
...V
|
|
3737
|
-
], rn =
|
|
3738
|
-
let Je = 0, It = je - 1, Kt = 0,
|
|
3739
|
-
for (;
|
|
3740
|
-
const ke =
|
|
3741
|
-
se[ke] < Te ?
|
|
3736
|
+
], rn = We > 0 && le > We ? 16 : 0, Ut = be + G + ae + rn + 2, bt = 5;
|
|
3737
|
+
let Je = 0, It = je - 1, Kt = 0, St = 0, tt = se.length - 1;
|
|
3738
|
+
for (; St <= tt; ) {
|
|
3739
|
+
const ke = St + tt >>> 1;
|
|
3740
|
+
se[ke] < Te ? St = ke + 1 : tt = ke - 1;
|
|
3742
3741
|
}
|
|
3743
|
-
Je = Math.max(0,
|
|
3742
|
+
Je = Math.max(0, St - bt), Kt = Je > 0 ? se[Je - 1] : 0;
|
|
3744
3743
|
for (let ke = Je; ke < se.length; ke++)
|
|
3745
3744
|
if (se[ke] >= Te + he) {
|
|
3746
|
-
It = Math.min(je - 1, ke +
|
|
3745
|
+
It = Math.min(je - 1, ke + bt);
|
|
3747
3746
|
break;
|
|
3748
3747
|
}
|
|
3749
3748
|
return {
|
|
@@ -3761,11 +3760,11 @@ function el(n) {
|
|
|
3761
3760
|
totalWidth: le,
|
|
3762
3761
|
rowHeights: me,
|
|
3763
3762
|
cumulativeHeights: se,
|
|
3764
|
-
virtualColumns:
|
|
3763
|
+
virtualColumns: kt,
|
|
3765
3764
|
columnMetrics: {
|
|
3766
3765
|
leftPinnedWidth: fe,
|
|
3767
3766
|
rightPinnedWidth: Ce,
|
|
3768
|
-
unpinnedAccWidths:
|
|
3767
|
+
unpinnedAccWidths: d,
|
|
3769
3768
|
unpinnedCols: R,
|
|
3770
3769
|
totalSpecialsWidth: Ue,
|
|
3771
3770
|
pinnedSpecialsWidth: (D ? 48 : 0) + (et && B ? 48 : 0) + (s && L ? 48 : 0)
|
|
@@ -3778,8 +3777,8 @@ function el(n) {
|
|
|
3778
3777
|
ue.dimensions.viewportHeight,
|
|
3779
3778
|
ue.dimensions.viewportWidth,
|
|
3780
3779
|
a
|
|
3781
|
-
]), gr =
|
|
3782
|
-
const R =
|
|
3780
|
+
]), gr = F((d) => {
|
|
3781
|
+
const R = d.currentTarget;
|
|
3783
3782
|
if (fo(R.scrollTop, R.scrollLeft), Rt) {
|
|
3784
3783
|
const { scrollTop: M, scrollHeight: V, clientHeight: le } = R;
|
|
3785
3784
|
V - M - le < 100 && Rt({
|
|
@@ -3791,42 +3790,42 @@ function el(n) {
|
|
|
3791
3790
|
}, [fo, Rt]);
|
|
3792
3791
|
ee(() => {
|
|
3793
3792
|
if (!Nt.current) return;
|
|
3794
|
-
const
|
|
3793
|
+
const d = new ResizeObserver((R) => {
|
|
3795
3794
|
for (const M of R) {
|
|
3796
3795
|
const { width: V, height: le } = M.contentRect;
|
|
3797
3796
|
ho(V, le);
|
|
3798
3797
|
}
|
|
3799
3798
|
});
|
|
3800
|
-
return
|
|
3801
|
-
|
|
3799
|
+
return d.observe(Nt.current), () => {
|
|
3800
|
+
d.disconnect();
|
|
3802
3801
|
};
|
|
3803
3802
|
}, [ho]);
|
|
3804
|
-
const Vt =
|
|
3803
|
+
const Vt = F((d, R) => {
|
|
3805
3804
|
const M = new Set(Pe);
|
|
3806
|
-
R ? M.add(
|
|
3805
|
+
R ? M.add(d) : M.delete(d);
|
|
3807
3806
|
const V = Array.from(M);
|
|
3808
3807
|
en || lo(V), un?.(V);
|
|
3809
|
-
}, [Pe, en, un]), fr =
|
|
3808
|
+
}, [Pe, en, un]), fr = F((d) => {
|
|
3810
3809
|
let R = [];
|
|
3811
|
-
|
|
3812
|
-
}, [o, en, un]), wo =
|
|
3813
|
-
const M = R ? [{ field:
|
|
3814
|
-
Pn ||
|
|
3815
|
-
}, [Pn, x]), Un =
|
|
3816
|
-
|
|
3817
|
-
}, [m,
|
|
3810
|
+
d && (R = xn.map((M) => M.id)), en || lo(R), un?.(R);
|
|
3811
|
+
}, [o, en, un]), wo = F((d, R) => {
|
|
3812
|
+
const M = R ? [{ field: d, sort: R }] : [];
|
|
3813
|
+
Pn || Fo(M), x?.(M);
|
|
3814
|
+
}, [Pn, x]), Un = F((d) => {
|
|
3815
|
+
Ft(!1), Wt({ id: d.row.id, field: d.field }), gn.current?.focus({ preventScroll: !0 }), m?.(d);
|
|
3816
|
+
}, [m, Ft]), bo = ne($e.editingCell);
|
|
3818
3817
|
ee(() => {
|
|
3819
|
-
const
|
|
3820
|
-
|
|
3818
|
+
const d = !!bo.current, R = !!$e.editingCell;
|
|
3819
|
+
d && !R && gn.current?.focus({ preventScroll: !0 }), bo.current = $e.editingCell;
|
|
3821
3820
|
}, [$e.editingCell]);
|
|
3822
3821
|
const vo = de(() => {
|
|
3823
|
-
const { firstRowIndex:
|
|
3822
|
+
const { firstRowIndex: d, lastRowIndex: R } = Se.renderContext, M = Xe.length, V = Xe.map((ae, G) => ({ row: ae, rowIndex: G })), le = dt.map((ae, G) => ({
|
|
3824
3823
|
row: ae,
|
|
3825
|
-
rowIndex: M + (Me ?
|
|
3826
|
-
})), fe = Math.max(0,
|
|
3827
|
-
Me ?
|
|
3824
|
+
rowIndex: M + (Me ? xt.length : Le.length) + G
|
|
3825
|
+
})), fe = Math.max(0, d - M), Ce = Math.min(
|
|
3826
|
+
Me ? xt.length : Le.length,
|
|
3828
3827
|
R - M + 1
|
|
3829
|
-
), qe = (Me ?
|
|
3828
|
+
), qe = (Me ? xt : Le).slice(fe, Ce).map((ae, G) => ({
|
|
3830
3829
|
row: ae,
|
|
3831
3830
|
rowIndex: M + fe + G
|
|
3832
3831
|
})), Ue = [...V, ...qe, ...le], se = /* @__PURE__ */ new Set();
|
|
@@ -3835,28 +3834,28 @@ function el(n) {
|
|
|
3835
3834
|
Se.renderContext,
|
|
3836
3835
|
Xe,
|
|
3837
3836
|
dt,
|
|
3838
|
-
|
|
3837
|
+
xt,
|
|
3839
3838
|
Le,
|
|
3840
3839
|
Me,
|
|
3841
3840
|
z,
|
|
3842
3841
|
ue.dataSource.loading,
|
|
3843
3842
|
xe.pageSize,
|
|
3844
3843
|
i
|
|
3845
|
-
]), hr = o.length > 0 && Pe.size === o.length, pr = Pe.size > 0 && Pe.size < o.length, xr =
|
|
3846
|
-
|
|
3844
|
+
]), hr = o.length > 0 && Pe.size === o.length, pr = Pe.size > 0 && Pe.size < o.length, xr = F((d) => {
|
|
3845
|
+
d.target === d.currentTarget && Wt((R) => {
|
|
3847
3846
|
if (R) return R;
|
|
3848
3847
|
if (s)
|
|
3849
3848
|
return { id: "HEADER", field: "__checkbox_col__" };
|
|
3850
3849
|
const M = Re[0], V = ye[0];
|
|
3851
3850
|
return M && V ? { id: M.id, field: V.field } : null;
|
|
3852
3851
|
});
|
|
3853
|
-
}, [Re, ye]), mr =
|
|
3854
|
-
|
|
3855
|
-
}, []), wr =
|
|
3856
|
-
if (
|
|
3852
|
+
}, [Re, ye]), mr = F((d) => {
|
|
3853
|
+
d.currentTarget.contains(d.relatedTarget) || Wt(null);
|
|
3854
|
+
}, []), wr = F((d) => {
|
|
3855
|
+
if (Ft(!0), !Ze) return;
|
|
3857
3856
|
const { id: R, field: M } = Ze, V = !!$e.editingCell;
|
|
3858
|
-
if (
|
|
3859
|
-
if (
|
|
3857
|
+
if (d.key === "Enter") {
|
|
3858
|
+
if (d.preventDefault(), V)
|
|
3860
3859
|
$e.stopCellEdit();
|
|
3861
3860
|
else if (ye.find((me) => me.field === M)?.editable) {
|
|
3862
3861
|
const me = Re.find((je) => je.id === R);
|
|
@@ -3868,18 +3867,18 @@ function el(n) {
|
|
|
3868
3867
|
}
|
|
3869
3868
|
return;
|
|
3870
3869
|
}
|
|
3871
|
-
if ((
|
|
3870
|
+
if ((d.key === " " || d.key === "Spacebar") && !V) {
|
|
3872
3871
|
if (M === "__checkbox_col__") {
|
|
3873
|
-
|
|
3872
|
+
d.preventDefault(), Vt(R, !Pe.has(R));
|
|
3874
3873
|
return;
|
|
3875
3874
|
}
|
|
3876
3875
|
if (M === "__expand_col__") {
|
|
3877
|
-
|
|
3876
|
+
d.preventDefault(), on(R);
|
|
3878
3877
|
return;
|
|
3879
3878
|
}
|
|
3880
3879
|
}
|
|
3881
|
-
if (R === "HEADER" && (
|
|
3882
|
-
|
|
3880
|
+
if (R === "HEADER" && (d.key === "Enter" || d.key === " ")) {
|
|
3881
|
+
d.preventDefault();
|
|
3883
3882
|
const G = ye.find((me) => me.field === M);
|
|
3884
3883
|
if (G && G.sortable !== !1) {
|
|
3885
3884
|
const me = ot.find((_e) => _e.field === M);
|
|
@@ -3888,29 +3887,29 @@ function el(n) {
|
|
|
3888
3887
|
}
|
|
3889
3888
|
return;
|
|
3890
3889
|
}
|
|
3891
|
-
if (
|
|
3892
|
-
V && (
|
|
3890
|
+
if (d.key === "Escape") {
|
|
3891
|
+
V && (d.preventDefault(), $e.stopCellEdit({ cancel: !0 }));
|
|
3893
3892
|
return;
|
|
3894
3893
|
}
|
|
3895
|
-
if (V &&
|
|
3894
|
+
if (V && d.key !== "Tab")
|
|
3896
3895
|
return;
|
|
3897
3896
|
const le = R === "HEADER", fe = le ? -1 : Re.findIndex((G) => G.id === R), Ce = ye.findIndex((G) => G.field === M);
|
|
3898
3897
|
if (!le && fe === -1 || Ce === -1) return;
|
|
3899
|
-
const qe = (G, me, je, _e, Te,
|
|
3898
|
+
const qe = (G, me, je, _e, Te, We = !1) => {
|
|
3900
3899
|
let he = G + je, ge = me + _e;
|
|
3901
|
-
return Te && _e !== 0 && (_e > 0 && ge >= ye.length ? (ge = 0, he++) : _e < 0 && ge < 0 && (ge = ye.length - 1, he--)), !Te && (ge < 0 || ge >= ye.length) || he < (
|
|
3902
|
-
}, Ue = (G, me, je, _e, Te,
|
|
3903
|
-
let he = G, ge = me,
|
|
3900
|
+
return Te && _e !== 0 && (_e > 0 && ge >= ye.length ? (ge = 0, he++) : _e < 0 && ge < 0 && (ge = ye.length - 1, he--)), !Te && (ge < 0 || ge >= ye.length) || he < (We ? -1 : 0) || he >= Re.length ? null : { r: he, c: ge };
|
|
3901
|
+
}, Ue = (G, me, je, _e, Te, We = !1) => {
|
|
3902
|
+
let he = G, ge = me, mt = 0;
|
|
3904
3903
|
const ct = Re.length * ye.length + ye.length;
|
|
3905
|
-
for (;
|
|
3906
|
-
if (
|
|
3904
|
+
for (; mt < ct; ) {
|
|
3905
|
+
if (mt++, he += je, ge += _e, _e !== 0)
|
|
3907
3906
|
_e > 0 ? ge >= ye.length && (ge = 0, he++) : ge < 0 && (ge = ye.length - 1, he--);
|
|
3908
3907
|
else if (ge < 0 || ge >= ye.length) return null;
|
|
3909
3908
|
if (he < -1 || he >= Re.length) return null;
|
|
3910
3909
|
if (he === -1) {
|
|
3911
|
-
if (!
|
|
3912
|
-
const
|
|
3913
|
-
if (["__checkbox_col__"].includes(
|
|
3910
|
+
if (!We) continue;
|
|
3911
|
+
const Fe = ye[ge], ut = Fe.sortable !== !1;
|
|
3912
|
+
if (["__checkbox_col__"].includes(Fe.field) || ut) return { r: he, c: ge };
|
|
3914
3913
|
continue;
|
|
3915
3914
|
}
|
|
3916
3915
|
const Ae = Re[he], Ee = ye[ge], ze = ["__checkbox_col__", "__expand_col__", "__reorder_col__"].includes(Ee.field);
|
|
@@ -3925,69 +3924,69 @@ function el(n) {
|
|
|
3925
3924
|
rowIndex: he,
|
|
3926
3925
|
colIndex: ge
|
|
3927
3926
|
});
|
|
3928
|
-
} catch (
|
|
3929
|
-
console.error("Error in isCellEditable:",
|
|
3927
|
+
} catch (Fe) {
|
|
3928
|
+
console.error("Error in isCellEditable:", Fe);
|
|
3930
3929
|
}
|
|
3931
3930
|
if (Ke) return { r: he, c: ge };
|
|
3932
3931
|
}
|
|
3933
3932
|
return null;
|
|
3934
3933
|
};
|
|
3935
3934
|
let se = fe, be = Ce, ae = !1;
|
|
3936
|
-
if (
|
|
3937
|
-
const G =
|
|
3935
|
+
if (d.key === "Tab") {
|
|
3936
|
+
const G = d.shiftKey ? -1 : 1, me = Ue(fe, Ce, 0, G, !0, !1);
|
|
3938
3937
|
me && (se = me.r, be = me.c, ae = !0);
|
|
3939
|
-
} else if (
|
|
3938
|
+
} else if (d.key === "ArrowRight") {
|
|
3940
3939
|
const G = qe(fe, Ce, 0, 1, !0, !0);
|
|
3941
3940
|
G && (se = G.r, be = G.c, ae = !0);
|
|
3942
|
-
} else if (
|
|
3941
|
+
} else if (d.key === "ArrowLeft") {
|
|
3943
3942
|
const G = qe(fe, Ce, 0, -1, !0, !0);
|
|
3944
3943
|
G && (se = G.r, be = G.c, ae = !0);
|
|
3945
|
-
} else if (
|
|
3944
|
+
} else if (d.key === "ArrowDown") {
|
|
3946
3945
|
const G = qe(fe, Ce, 1, 0, !1, !0);
|
|
3947
3946
|
G && (se = G.r, be = G.c, ae = !0);
|
|
3948
|
-
} else if (
|
|
3947
|
+
} else if (d.key === "ArrowUp") {
|
|
3949
3948
|
const G = qe(fe, Ce, -1, 0, !1, !0);
|
|
3950
3949
|
G && (se = G.r, be = G.c, ae = !0);
|
|
3951
|
-
} else if (
|
|
3952
|
-
(
|
|
3953
|
-
else if (
|
|
3954
|
-
(
|
|
3955
|
-
else if (
|
|
3950
|
+
} else if (d.key === "Home")
|
|
3951
|
+
(d.ctrlKey || d.metaKey) && (se = -1), be = 0, ae = !0;
|
|
3952
|
+
else if (d.key === "End")
|
|
3953
|
+
(d.ctrlKey || d.metaKey) && (se = Re.length - 1), be = ye.length - 1, ae = !0;
|
|
3954
|
+
else if (d.key === "PageUp") {
|
|
3956
3955
|
const G = Me ? xe.pageSize : 10;
|
|
3957
3956
|
se = Math.max(-1, se - G), ae = !0;
|
|
3958
|
-
} else if (
|
|
3957
|
+
} else if (d.key === "PageDown") {
|
|
3959
3958
|
const G = Me ? xe.pageSize : 10;
|
|
3960
3959
|
se = Math.min(Re.length - 1, se + G), ae = !0;
|
|
3961
3960
|
}
|
|
3962
|
-
if (ae && (
|
|
3961
|
+
if (ae && (d.preventDefault(), V && d.key === "Tab" && $e.stopCellEdit(), se >= -1 && se < Re.length && be >= 0 && be < ye.length)) {
|
|
3963
3962
|
const G = ye[be];
|
|
3964
3963
|
if (se === -1)
|
|
3965
|
-
|
|
3964
|
+
Wt({ id: "HEADER", field: G.field });
|
|
3966
3965
|
else {
|
|
3967
3966
|
const me = Re[se];
|
|
3968
|
-
|
|
3967
|
+
Wt({ id: me.id, field: G.field });
|
|
3969
3968
|
}
|
|
3970
3969
|
if (Nt.current) {
|
|
3971
|
-
const { cumulativeHeights: me, pinnedTopHeight: je } = Se, { clientHeight: _e, clientWidth: Te, scrollTop:
|
|
3972
|
-
let ze =
|
|
3973
|
-
if (ge < Ae ? ze = Math.max(0, ge - ct) :
|
|
3974
|
-
const { leftPinnedWidth: Ke, rightPinnedWidth:
|
|
3975
|
-
if (
|
|
3976
|
-
const Je =
|
|
3970
|
+
const { cumulativeHeights: me, pinnedTopHeight: je } = Se, { clientHeight: _e, clientWidth: Te, scrollTop: We, scrollLeft: he } = Nt.current, ge = se === 0 ? 0 : me[se - 1], mt = me[se], ct = je, Ae = We + ct, Ee = We + _e;
|
|
3971
|
+
let ze = We;
|
|
3972
|
+
if (ge < Ae ? ze = Math.max(0, ge - ct) : mt > Ee && (ze = mt - _e), ze !== We && (Nt.current.scrollTop = ze), Se.columnMetrics) {
|
|
3973
|
+
const { leftPinnedWidth: Ke, rightPinnedWidth: Fe, unpinnedAccWidths: ut, unpinnedCols: kt, totalSpecialsWidth: wt, pinnedSpecialsWidth: rn } = Se.columnMetrics, Ut = G.field, bt = kt.findIndex((Je) => Je.field === Ut);
|
|
3974
|
+
if (bt !== -1) {
|
|
3975
|
+
const Je = wt + Ke + (bt > 0 ? ut[bt - 1] : 0), It = wt + Ke + ut[bt], Kt = he + rn + Ke, St = he + Te - Fe;
|
|
3977
3976
|
let tt = he;
|
|
3978
|
-
Je < Kt ? tt = Math.max(0, Je - rn - Ke) : It >
|
|
3977
|
+
Je < Kt ? tt = Math.max(0, Je - rn - Ke) : It > St && (tt = It - Te + Fe), tt !== he && (Nt.current.scrollLeft = tt);
|
|
3979
3978
|
}
|
|
3980
3979
|
}
|
|
3981
3980
|
}
|
|
3982
3981
|
}
|
|
3983
|
-
}, [Ze, Re, ye, $e, Se, Pe, Vt, on]), br = pe.useMemo(() => Oe.some((
|
|
3982
|
+
}, [Ze, Re, ye, $e, Se, Pe, Vt, on]), br = pe.useMemo(() => Oe.some((d) => !!d.rowSpan), [Oe]), [wn, bn] = pe.useState(!1), Kn = pe.useRef(null);
|
|
3984
3983
|
return ee(() => {
|
|
3985
3984
|
if (!wn || Ie?.toolbar) return;
|
|
3986
|
-
function
|
|
3985
|
+
function d(R) {
|
|
3987
3986
|
const M = document.getElementById("ogx-standalone-col-panel");
|
|
3988
3987
|
M && !M.contains(R.target) && bn(!1);
|
|
3989
3988
|
}
|
|
3990
|
-
return document.addEventListener("mousedown",
|
|
3989
|
+
return document.addEventListener("mousedown", d), () => document.removeEventListener("mousedown", d);
|
|
3991
3990
|
}, [wn, Ie?.toolbar]), /* @__PURE__ */ t.jsxs(
|
|
3992
3991
|
"div",
|
|
3993
3992
|
{
|
|
@@ -4002,7 +4001,7 @@ function el(n) {
|
|
|
4002
4001
|
"aria-busy": tn,
|
|
4003
4002
|
children: [
|
|
4004
4003
|
oo && (() => {
|
|
4005
|
-
const
|
|
4004
|
+
const d = {
|
|
4006
4005
|
apiRef: st.apiRef,
|
|
4007
4006
|
columns: Oe,
|
|
4008
4007
|
aggregationModel: rt,
|
|
@@ -4012,14 +4011,14 @@ function el(n) {
|
|
|
4012
4011
|
onPivotModelChange: Yo
|
|
4013
4012
|
} : {},
|
|
4014
4013
|
filterModel: Ye,
|
|
4015
|
-
onFilterModelChange:
|
|
4014
|
+
onFilterModelChange: f,
|
|
4016
4015
|
columnVisibilityModel: Qe,
|
|
4017
4016
|
onColumnVisibilityModelChange: Zt,
|
|
4018
4017
|
forceColumnsOpen: wn,
|
|
4019
4018
|
onColumnsPanelClose: () => bn(!1),
|
|
4020
4019
|
...ft?.toolbar
|
|
4021
4020
|
};
|
|
4022
|
-
return /* @__PURE__ */ t.jsx(oo, { ...
|
|
4021
|
+
return /* @__PURE__ */ t.jsx(oo, { ...d });
|
|
4023
4022
|
})(),
|
|
4024
4023
|
!Ie?.toolbar && wn && Mt.createPortal(
|
|
4025
4024
|
/* @__PURE__ */ t.jsxs(
|
|
@@ -4027,11 +4026,11 @@ function el(n) {
|
|
|
4027
4026
|
{
|
|
4028
4027
|
id: "ogx-standalone-col-panel",
|
|
4029
4028
|
style: (() => {
|
|
4030
|
-
const
|
|
4029
|
+
const d = Kn.current?.getBoundingClientRect();
|
|
4031
4030
|
return {
|
|
4032
4031
|
position: "fixed",
|
|
4033
|
-
top:
|
|
4034
|
-
right:
|
|
4032
|
+
top: d ? d.top + 8 : 16,
|
|
4033
|
+
right: d ? window.innerWidth - d.right + 8 : 16,
|
|
4035
4034
|
zIndex: 9999,
|
|
4036
4035
|
display: "inline-block"
|
|
4037
4036
|
};
|
|
@@ -4069,22 +4068,22 @@ function el(n) {
|
|
|
4069
4068
|
{
|
|
4070
4069
|
columns: Oe,
|
|
4071
4070
|
visibleColumns: new Set(
|
|
4072
|
-
Oe.filter((
|
|
4071
|
+
Oe.filter((d) => Qe[d.field] !== !1).map((d) => d.field)
|
|
4073
4072
|
),
|
|
4074
|
-
onVisibilityChange: (
|
|
4075
|
-
Zt({ ...Qe, [
|
|
4073
|
+
onVisibilityChange: (d, R) => {
|
|
4074
|
+
Zt({ ...Qe, [d]: R });
|
|
4076
4075
|
},
|
|
4077
4076
|
onShowAll: () => {
|
|
4078
|
-
const
|
|
4077
|
+
const d = { ...Qe };
|
|
4079
4078
|
Oe.forEach((R) => {
|
|
4080
|
-
R.hideable !== !1 && (
|
|
4081
|
-
}), Zt(
|
|
4079
|
+
R.hideable !== !1 && (d[R.field] = !0);
|
|
4080
|
+
}), Zt(d);
|
|
4082
4081
|
},
|
|
4083
4082
|
onHideAll: () => {
|
|
4084
|
-
const
|
|
4083
|
+
const d = { ...Qe };
|
|
4085
4084
|
Oe.forEach((R) => {
|
|
4086
|
-
R.hideable !== !1 && (
|
|
4087
|
-
}), Zt(
|
|
4085
|
+
R.hideable !== !1 && (d[R.field] = !1);
|
|
4086
|
+
}), Zt(d);
|
|
4088
4087
|
}
|
|
4089
4088
|
}
|
|
4090
4089
|
)
|
|
@@ -4114,22 +4113,22 @@ function el(n) {
|
|
|
4114
4113
|
/* @__PURE__ */ t.jsx("path", { d: "M3 9h18M9 21V9" })
|
|
4115
4114
|
] }),
|
|
4116
4115
|
Nn
|
|
4117
|
-
] }) : Re.map((
|
|
4116
|
+
] }) : Re.map((d, R) => /* @__PURE__ */ t.jsx(
|
|
4118
4117
|
Er,
|
|
4119
4118
|
{
|
|
4120
|
-
row:
|
|
4119
|
+
row: d,
|
|
4121
4120
|
rowIndex: R,
|
|
4122
4121
|
listViewColumn: no,
|
|
4123
|
-
isSelected: Pe.has(
|
|
4122
|
+
isSelected: Pe.has(d.id),
|
|
4124
4123
|
checkboxSelection: s,
|
|
4125
4124
|
rowHeight: i,
|
|
4126
4125
|
onRowClick: (M) => pn({ row: M, id: M.id, rowIndex: R }),
|
|
4127
4126
|
onSelectionChange: Vt
|
|
4128
4127
|
},
|
|
4129
|
-
|
|
4128
|
+
d.id
|
|
4130
4129
|
)) }),
|
|
4131
4130
|
Me && (() => {
|
|
4132
|
-
const
|
|
4131
|
+
const d = Ie?.pagination || ko, R = z === "server" && ie ? ue.pagination.rowCount || 0 : Ve.length, M = {
|
|
4133
4132
|
page: xe.page,
|
|
4134
4133
|
pageSize: xe.pageSize,
|
|
4135
4134
|
rowCount: R,
|
|
@@ -4138,7 +4137,7 @@ function el(n) {
|
|
|
4138
4137
|
onPageSizeChange: (V) => cn({ ...xe, pageSize: V, page: 0 }),
|
|
4139
4138
|
...ft?.pagination
|
|
4140
4139
|
};
|
|
4141
|
-
return /* @__PURE__ */ t.jsx(
|
|
4140
|
+
return /* @__PURE__ */ t.jsx(d, { ...M });
|
|
4142
4141
|
})()
|
|
4143
4142
|
]
|
|
4144
4143
|
}
|
|
@@ -4146,8 +4145,8 @@ function el(n) {
|
|
|
4146
4145
|
!an && /* @__PURE__ */ t.jsx(
|
|
4147
4146
|
"div",
|
|
4148
4147
|
{
|
|
4149
|
-
ref: (
|
|
4150
|
-
Nt.current =
|
|
4148
|
+
ref: (d) => {
|
|
4149
|
+
Nt.current = d, gn.current = d;
|
|
4151
4150
|
},
|
|
4152
4151
|
className: "ogx__viewport",
|
|
4153
4152
|
onScroll: gr,
|
|
@@ -4158,10 +4157,10 @@ function el(n) {
|
|
|
4158
4157
|
"aria-busy": tn,
|
|
4159
4158
|
tabIndex: 0,
|
|
4160
4159
|
onKeyDownCapture: () => {
|
|
4161
|
-
|
|
4160
|
+
Ft(!0);
|
|
4162
4161
|
},
|
|
4163
4162
|
onMouseDownCapture: () => {
|
|
4164
|
-
|
|
4163
|
+
Ft(!1);
|
|
4165
4164
|
},
|
|
4166
4165
|
onKeyDown: wr,
|
|
4167
4166
|
onFocus: xr,
|
|
@@ -4192,8 +4191,8 @@ function el(n) {
|
|
|
4192
4191
|
columnWidths: at,
|
|
4193
4192
|
pinnedColumns: it,
|
|
4194
4193
|
focusedCell: Ze,
|
|
4195
|
-
onHeaderClick: (
|
|
4196
|
-
|
|
4194
|
+
onHeaderClick: (d) => {
|
|
4195
|
+
Wt({ id: "HEADER", field: d }), Ft(!1), gn.current?.focus({ preventScroll: !0 });
|
|
4197
4196
|
},
|
|
4198
4197
|
onDragStart: Et ? void 0 : $t.onDragStart,
|
|
4199
4198
|
onDragOver: Et ? void 0 : $t.onDragOver,
|
|
@@ -4206,16 +4205,16 @@ function el(n) {
|
|
|
4206
4205
|
pinCheckboxColumn: L,
|
|
4207
4206
|
pinExpandColumn: B,
|
|
4208
4207
|
aggregationModel: rt,
|
|
4209
|
-
onHideColumn: (
|
|
4208
|
+
onHideColumn: (d) => {
|
|
4210
4209
|
Zt({
|
|
4211
4210
|
...Qe,
|
|
4212
|
-
[
|
|
4211
|
+
[d]: !1
|
|
4213
4212
|
});
|
|
4214
4213
|
},
|
|
4215
4214
|
onManageColumns: () => bn(!0),
|
|
4216
|
-
onPinColumn: (
|
|
4217
|
-
const M = [...it?.left ?? []], V = [...it?.right ?? []], le = M.filter((Ce) => Ce !==
|
|
4218
|
-
|
|
4215
|
+
onPinColumn: (d, R) => {
|
|
4216
|
+
const M = [...it?.left ?? []], V = [...it?.right ?? []], le = M.filter((Ce) => Ce !== d), fe = V.filter((Ce) => Ce !== d);
|
|
4217
|
+
Fn(R === "left" ? { left: [...le, d], right: fe } : R === "right" ? { left: le, right: [...fe, d] } : { left: le, right: fe });
|
|
4219
4218
|
}
|
|
4220
4219
|
}
|
|
4221
4220
|
),
|
|
@@ -4226,13 +4225,13 @@ function el(n) {
|
|
|
4226
4225
|
] }),
|
|
4227
4226
|
/* @__PURE__ */ t.jsx("span", { children: Nn })
|
|
4228
4227
|
] }),
|
|
4229
|
-
Xe.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "ogx__pinned-rows ogx__pinned-rows--top", role: "rowgroup", children: Xe.map((
|
|
4228
|
+
Xe.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "ogx__pinned-rows ogx__pinned-rows--top", role: "rowgroup", children: Xe.map((d, R) => /* @__PURE__ */ t.jsx(
|
|
4230
4229
|
kn,
|
|
4231
4230
|
{
|
|
4232
|
-
row:
|
|
4231
|
+
row: d,
|
|
4233
4232
|
columns: Se.virtualColumns,
|
|
4234
4233
|
rowIndex: R,
|
|
4235
|
-
isSelected: Pe.has(
|
|
4234
|
+
isSelected: Pe.has(d.id),
|
|
4236
4235
|
checkboxSelection: s,
|
|
4237
4236
|
onRowClick: pn,
|
|
4238
4237
|
onCellClick: Un,
|
|
@@ -4241,18 +4240,18 @@ function el(n) {
|
|
|
4241
4240
|
pinnedColumns: it,
|
|
4242
4241
|
pinnedRows: y,
|
|
4243
4242
|
hasDetailPanel: et,
|
|
4244
|
-
isDetailPanelExpanded:
|
|
4245
|
-
detailPanelContent: I ? I({ row:
|
|
4246
|
-
detailPanelHeight: C?.({ row:
|
|
4243
|
+
isDetailPanelExpanded: Ct.has(d.id),
|
|
4244
|
+
detailPanelContent: I ? I({ row: d, id: d.id, rowIndex: R }) : null,
|
|
4245
|
+
detailPanelHeight: C?.({ row: d, id: d.id, rowIndex: R }) || 200,
|
|
4247
4246
|
onDetailPanelToggle: on,
|
|
4248
4247
|
pinCheckboxColumn: L,
|
|
4249
4248
|
pinExpandColumn: B,
|
|
4250
|
-
focusedCellField: Ze?.id ===
|
|
4249
|
+
focusedCellField: Ze?.id === d.id ? Ze.field : null,
|
|
4251
4250
|
colspanMap: Gt.colspanMap,
|
|
4252
4251
|
rowSpanningCaches: Gt.rowSpanningState.caches,
|
|
4253
4252
|
rowHeight: i
|
|
4254
4253
|
},
|
|
4255
|
-
|
|
4254
|
+
d.id
|
|
4256
4255
|
)) }),
|
|
4257
4256
|
/* @__PURE__ */ t.jsx(
|
|
4258
4257
|
"div",
|
|
@@ -4272,7 +4271,7 @@ function el(n) {
|
|
|
4272
4271
|
role: "rowgroup",
|
|
4273
4272
|
children: [
|
|
4274
4273
|
tn && vo.length === 0 ? (() => {
|
|
4275
|
-
const
|
|
4274
|
+
const d = e.length > 0 ? e : (() => {
|
|
4276
4275
|
const R = (ue.dimensions.viewportWidth || 1e3) - (s ? 48 : 0) - (I ? 48 : 0) - (D ? 48 : 0), M = 150, V = Math.max(1, Math.ceil(R / M));
|
|
4277
4276
|
return Array.from({ length: V }, (le, fe) => ({
|
|
4278
4277
|
field: `placeholder_${fe}`,
|
|
@@ -4283,7 +4282,7 @@ function el(n) {
|
|
|
4283
4282
|
return Array.from({ length: 10 }).map((R, M) => /* @__PURE__ */ t.jsx(
|
|
4284
4283
|
ni,
|
|
4285
4284
|
{
|
|
4286
|
-
columns:
|
|
4285
|
+
columns: d,
|
|
4287
4286
|
rowHeight: i,
|
|
4288
4287
|
checkboxSelection: s,
|
|
4289
4288
|
hasDetailPanel: !!I,
|
|
@@ -4291,15 +4290,15 @@ function el(n) {
|
|
|
4291
4290
|
},
|
|
4292
4291
|
`skeleton-${M}`
|
|
4293
4292
|
));
|
|
4294
|
-
})() : vo.filter(({ row:
|
|
4295
|
-
(
|
|
4296
|
-
).map(({ row:
|
|
4293
|
+
})() : vo.filter(({ row: d }) => !qn(d.id, y)).filter(
|
|
4294
|
+
(d, R, M) => R === M.findIndex((V) => V.row.id === d.row.id)
|
|
4295
|
+
).map(({ row: d, rowIndex: R }) => /* @__PURE__ */ t.jsx(
|
|
4297
4296
|
kn,
|
|
4298
4297
|
{
|
|
4299
|
-
row:
|
|
4298
|
+
row: d,
|
|
4300
4299
|
columns: Se.virtualColumns,
|
|
4301
4300
|
rowIndex: R,
|
|
4302
|
-
isSelected: Pe.has(
|
|
4301
|
+
isSelected: Pe.has(d.id),
|
|
4303
4302
|
checkboxSelection: s,
|
|
4304
4303
|
onRowClick: pn,
|
|
4305
4304
|
onCellClick: Un,
|
|
@@ -4308,9 +4307,9 @@ function el(n) {
|
|
|
4308
4307
|
pinnedColumns: it,
|
|
4309
4308
|
pinnedRows: y,
|
|
4310
4309
|
hasDetailPanel: et,
|
|
4311
|
-
isDetailPanelExpanded:
|
|
4312
|
-
detailPanelContent: I ? I({ row:
|
|
4313
|
-
detailPanelHeight: C?.({ row:
|
|
4310
|
+
isDetailPanelExpanded: Ct.has(d.id),
|
|
4311
|
+
detailPanelContent: I ? I({ row: d, id: d.id, rowIndex: R }) : null,
|
|
4312
|
+
detailPanelHeight: C?.({ row: d, id: d.id, rowIndex: R }) || 200,
|
|
4314
4313
|
onDetailPanelToggle: on,
|
|
4315
4314
|
pinCheckboxColumn: L,
|
|
4316
4315
|
pinExpandColumn: B,
|
|
@@ -4319,22 +4318,22 @@ function el(n) {
|
|
|
4319
4318
|
onDragOver: Dt.onDragOver,
|
|
4320
4319
|
onDragEnd: Dt.onDragEnd,
|
|
4321
4320
|
onDrop: Dt.onDrop,
|
|
4322
|
-
isDragging: Dt.draggedRowId ===
|
|
4323
|
-
isDragOver: Dt.dragOverRowId ===
|
|
4321
|
+
isDragging: Dt.draggedRowId === d.id,
|
|
4322
|
+
isDragOver: Dt.dragOverRowId === d.id,
|
|
4324
4323
|
editingCell: $e.editingCell,
|
|
4325
4324
|
onEditStart: $e.startCellEdit,
|
|
4326
4325
|
onEditStop: $e.stopCellEdit,
|
|
4327
4326
|
onEditCellValueChange: $e.setEditCellValue,
|
|
4328
|
-
focusedCellField: Ze != null && Ze.id ===
|
|
4327
|
+
focusedCellField: Ze != null && Ze.id === d.id ? Ze.field : null,
|
|
4329
4328
|
colspanMap: Gt.colspanMap,
|
|
4330
4329
|
rowSpanningCaches: Gt.rowSpanningState.caches,
|
|
4331
4330
|
rowHeight: i
|
|
4332
4331
|
},
|
|
4333
|
-
`${
|
|
4332
|
+
`${d.id}-${Se.totalWidth}`
|
|
4334
4333
|
)),
|
|
4335
4334
|
z === "infinite" && ue.dataSource.loading && Le.length > 0 && (() => {
|
|
4336
|
-
const
|
|
4337
|
-
return /* @__PURE__ */ t.jsx("div", { className: "ogx__skeleton-group", children: Array.from({ length:
|
|
4335
|
+
const d = Math.min(xe.pageSize, 20), R = Vn.unpinnedRowsLength;
|
|
4336
|
+
return /* @__PURE__ */ t.jsx("div", { className: "ogx__skeleton-group", children: Array.from({ length: d }).map((M, V) => /* @__PURE__ */ t.jsx(
|
|
4338
4337
|
kn,
|
|
4339
4338
|
{
|
|
4340
4339
|
row: { id: `__skeleton_${V}__`, _isSkeleton: !0 },
|
|
@@ -4350,13 +4349,13 @@ function el(n) {
|
|
|
4350
4349
|
)
|
|
4351
4350
|
}
|
|
4352
4351
|
),
|
|
4353
|
-
dt.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "ogx__pinned-rows ogx__pinned-rows--bottom", role: "rowgroup", children: dt.map((
|
|
4352
|
+
dt.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "ogx__pinned-rows ogx__pinned-rows--bottom", role: "rowgroup", children: dt.map((d, R) => /* @__PURE__ */ t.jsx(
|
|
4354
4353
|
kn,
|
|
4355
4354
|
{
|
|
4356
|
-
row:
|
|
4355
|
+
row: d,
|
|
4357
4356
|
columns: Se.virtualColumns,
|
|
4358
4357
|
rowIndex: R,
|
|
4359
|
-
isSelected: Pe.has(
|
|
4358
|
+
isSelected: Pe.has(d.id),
|
|
4360
4359
|
checkboxSelection: s,
|
|
4361
4360
|
onRowClick: pn,
|
|
4362
4361
|
onCellClick: Un,
|
|
@@ -4365,18 +4364,18 @@ function el(n) {
|
|
|
4365
4364
|
pinnedColumns: it,
|
|
4366
4365
|
pinnedRows: y,
|
|
4367
4366
|
hasDetailPanel: et,
|
|
4368
|
-
isDetailPanelExpanded:
|
|
4369
|
-
detailPanelContent: I ? I({ row:
|
|
4370
|
-
detailPanelHeight: C?.({ row:
|
|
4367
|
+
isDetailPanelExpanded: Ct.has(d.id),
|
|
4368
|
+
detailPanelContent: I ? I({ row: d, id: d.id, rowIndex: R }) : null,
|
|
4369
|
+
detailPanelHeight: C?.({ row: d, id: d.id, rowIndex: R }) || 200,
|
|
4371
4370
|
onDetailPanelToggle: on,
|
|
4372
4371
|
pinCheckboxColumn: L,
|
|
4373
4372
|
pinExpandColumn: B,
|
|
4374
|
-
focusedCellField: Ze?.id ===
|
|
4373
|
+
focusedCellField: Ze?.id === d.id ? Ze.field : null,
|
|
4375
4374
|
colspanMap: Gt.colspanMap,
|
|
4376
4375
|
rowSpanningCaches: Gt.rowSpanningState.caches,
|
|
4377
4376
|
rowHeight: i
|
|
4378
4377
|
},
|
|
4379
|
-
|
|
4378
|
+
d.id
|
|
4380
4379
|
)) }),
|
|
4381
4380
|
mn && /* @__PURE__ */ t.jsxs(
|
|
4382
4381
|
"div",
|
|
@@ -4392,8 +4391,8 @@ function el(n) {
|
|
|
4392
4391
|
s && /* @__PURE__ */ t.jsx("div", { style: { width: 48, flexShrink: 0 } }),
|
|
4393
4392
|
et && /* @__PURE__ */ t.jsx("div", { style: { width: 48, flexShrink: 0 } }),
|
|
4394
4393
|
D && /* @__PURE__ */ t.jsx("div", { style: { width: 48, flexShrink: 0 } }),
|
|
4395
|
-
Bt.map((
|
|
4396
|
-
const R = rt[
|
|
4394
|
+
Bt.map((d) => {
|
|
4395
|
+
const R = rt[d.field], M = Gn[d.field], V = at[d.field] ?? (typeof d.width == "number" ? d.width : 120);
|
|
4397
4396
|
return /* @__PURE__ */ t.jsx(
|
|
4398
4397
|
"div",
|
|
4399
4398
|
{
|
|
@@ -4403,14 +4402,14 @@ function el(n) {
|
|
|
4403
4402
|
width: V,
|
|
4404
4403
|
minWidth: V,
|
|
4405
4404
|
maxWidth: V,
|
|
4406
|
-
textAlign:
|
|
4405
|
+
textAlign: d.align || "left"
|
|
4407
4406
|
},
|
|
4408
4407
|
children: R ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
4409
4408
|
/* @__PURE__ */ t.jsx("span", { className: "ogx__aggregation-label", children: R }),
|
|
4410
4409
|
/* @__PURE__ */ t.jsx("span", { className: "ogx__aggregation-value", children: Pt(M, R) })
|
|
4411
4410
|
] }) : null
|
|
4412
4411
|
},
|
|
4413
|
-
|
|
4412
|
+
d.field
|
|
4414
4413
|
);
|
|
4415
4414
|
})
|
|
4416
4415
|
]
|
|
@@ -4422,7 +4421,7 @@ function el(n) {
|
|
|
4422
4421
|
}
|
|
4423
4422
|
),
|
|
4424
4423
|
!an && Me && (() => {
|
|
4425
|
-
const
|
|
4424
|
+
const d = Ie?.pagination || ko, R = {
|
|
4426
4425
|
page: xe.page,
|
|
4427
4426
|
pageSize: xe.pageSize,
|
|
4428
4427
|
rowCount: ue.pagination.rowCount,
|
|
@@ -4431,7 +4430,7 @@ function el(n) {
|
|
|
4431
4430
|
onPageSizeChange: (M) => cn({ ...xe, pageSize: M, page: 0 }),
|
|
4432
4431
|
...ft?.pagination
|
|
4433
4432
|
};
|
|
4434
|
-
return /* @__PURE__ */ t.jsx(
|
|
4433
|
+
return /* @__PURE__ */ t.jsx(d, { ...R });
|
|
4435
4434
|
})(),
|
|
4436
4435
|
/* @__PURE__ */ t.jsxs("div", { className: "ogx-aria-live-status", role: "status", "aria-live": "polite", children: [
|
|
4437
4436
|
tn ? "Loading data..." : "",
|
|
@@ -4467,24 +4466,24 @@ function Ei(n, o) {
|
|
|
4467
4466
|
return n.find((e) => "field" in e && e.field === o);
|
|
4468
4467
|
}
|
|
4469
4468
|
const Ni = ({ col: n, item: o, onChange: e }) => {
|
|
4470
|
-
const r = gi(n.type), i = !!o, l = o?.operator ?? r[0], a = (
|
|
4471
|
-
const
|
|
4469
|
+
const r = gi(n.type), i = !!o, l = o?.operator ?? r[0], a = (c) => {
|
|
4470
|
+
const f = So.has(c), w = {
|
|
4472
4471
|
id: o?.id ?? `${n.field}-${Date.now()}`,
|
|
4473
4472
|
field: n.field,
|
|
4474
|
-
operator:
|
|
4475
|
-
value:
|
|
4473
|
+
operator: c,
|
|
4474
|
+
value: f ? void 0 : o?.value ?? (n.type === "boolean" ? "true" : "")
|
|
4476
4475
|
};
|
|
4477
4476
|
e(w);
|
|
4478
|
-
}, s = (
|
|
4477
|
+
}, s = (c) => {
|
|
4479
4478
|
e({
|
|
4480
4479
|
id: o?.id ?? `${n.field}-${Date.now()}`,
|
|
4481
4480
|
field: n.field,
|
|
4482
4481
|
operator: l,
|
|
4483
|
-
value:
|
|
4482
|
+
value: c
|
|
4484
4483
|
});
|
|
4485
|
-
},
|
|
4484
|
+
}, g = () => {
|
|
4486
4485
|
e(null);
|
|
4487
|
-
},
|
|
4486
|
+
}, u = So.has(String(l)), h = n.type === "boolean", m = !u;
|
|
4488
4487
|
return /* @__PURE__ */ t.jsxs("div", { className: `ogx-filter__row${i ? " ogx-filter__row--active" : ""}`, children: [
|
|
4489
4488
|
/* @__PURE__ */ t.jsx("span", { className: "ogx-filter__col-label", title: n.field, children: n.headerName || n.field }),
|
|
4490
4489
|
/* @__PURE__ */ t.jsxs("div", { className: "ogx-filter__controls", children: [
|
|
@@ -4495,19 +4494,19 @@ const Ni = ({ col: n, item: o, onChange: e }) => {
|
|
|
4495
4494
|
name: `filter-op-${n.field}`,
|
|
4496
4495
|
className: `ogx-filter__op-select${i ? " ogx-filter__op-select--active" : ""}`,
|
|
4497
4496
|
value: String(l),
|
|
4498
|
-
onChange: (
|
|
4497
|
+
onChange: (c) => a(c.target.value),
|
|
4499
4498
|
"aria-label": `Filter operator for ${n.headerName || n.field}`,
|
|
4500
|
-
children: r.map((
|
|
4499
|
+
children: r.map((c) => /* @__PURE__ */ t.jsx("option", { value: c, children: c }, c))
|
|
4501
4500
|
}
|
|
4502
4501
|
),
|
|
4503
|
-
m &&
|
|
4502
|
+
m && h && /* @__PURE__ */ t.jsxs(
|
|
4504
4503
|
"select",
|
|
4505
4504
|
{
|
|
4506
4505
|
id: `ogx-filter-val-${n.field}`,
|
|
4507
4506
|
name: `filter-val-${n.field}`,
|
|
4508
4507
|
className: `ogx-filter__value-input ogx-filter__value-select${i ? " ogx-filter__value-input--active" : ""}`,
|
|
4509
4508
|
value: String(o?.value ?? "true"),
|
|
4510
|
-
onChange: (
|
|
4509
|
+
onChange: (c) => s(c.target.value),
|
|
4511
4510
|
"aria-label": `Filter value for ${n.headerName || n.field}`,
|
|
4512
4511
|
children: [
|
|
4513
4512
|
/* @__PURE__ */ t.jsx("option", { value: "true", children: "true" }),
|
|
@@ -4515,7 +4514,7 @@ const Ni = ({ col: n, item: o, onChange: e }) => {
|
|
|
4515
4514
|
]
|
|
4516
4515
|
}
|
|
4517
4516
|
),
|
|
4518
|
-
m && !
|
|
4517
|
+
m && !h && /* @__PURE__ */ t.jsx(
|
|
4519
4518
|
"input",
|
|
4520
4519
|
{
|
|
4521
4520
|
id: `ogx-filter-val-${n.field}`,
|
|
@@ -4523,7 +4522,7 @@ const Ni = ({ col: n, item: o, onChange: e }) => {
|
|
|
4523
4522
|
className: `ogx-filter__value-input${i ? " ogx-filter__value-input--active" : ""}`,
|
|
4524
4523
|
type: n.type === "number" ? "number" : "text",
|
|
4525
4524
|
value: o?.value ?? "",
|
|
4526
|
-
onChange: (
|
|
4525
|
+
onChange: (c) => s(c.target.value),
|
|
4527
4526
|
placeholder: "Value…",
|
|
4528
4527
|
"aria-label": `Filter value for ${n.headerName || n.field}`
|
|
4529
4528
|
}
|
|
@@ -4532,7 +4531,7 @@ const Ni = ({ col: n, item: o, onChange: e }) => {
|
|
|
4532
4531
|
"button",
|
|
4533
4532
|
{
|
|
4534
4533
|
className: "ogx-filter__row-clear",
|
|
4535
|
-
onClick:
|
|
4534
|
+
onClick: g,
|
|
4536
4535
|
"aria-label": `Clear filter for ${n.headerName || n.field}`,
|
|
4537
4536
|
title: "Clear",
|
|
4538
4537
|
children: "×"
|
|
@@ -4541,12 +4540,12 @@ const Ni = ({ col: n, item: o, onChange: e }) => {
|
|
|
4541
4540
|
] })
|
|
4542
4541
|
] });
|
|
4543
4542
|
}, Ii = ({ filterModel: n, columns: o, onFilterModelChange: e }) => {
|
|
4544
|
-
const r = n.items ?? [], i = n.logicOperator ?? "and", l =
|
|
4545
|
-
const
|
|
4543
|
+
const r = n.items ?? [], i = n.logicOperator ?? "and", l = F((g, u) => {
|
|
4544
|
+
const h = r.filter((c) => "field" in c && c.field !== g), m = u ? [...h, u] : h;
|
|
4546
4545
|
e({ ...n, items: m });
|
|
4547
|
-
}, [r, n, e]), a =
|
|
4548
|
-
e({ ...n, logicOperator:
|
|
4549
|
-
}, [n, e]), s = o.filter((
|
|
4546
|
+
}, [r, n, e]), a = F((g) => {
|
|
4547
|
+
e({ ...n, logicOperator: g });
|
|
4548
|
+
}, [n, e]), s = o.filter((g) => g.filterable !== !1);
|
|
4550
4549
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
4551
4550
|
r.length > 1 && /* @__PURE__ */ t.jsxs("div", { className: "ogx-filter__logic-bar", children: [
|
|
4552
4551
|
/* @__PURE__ */ t.jsx("span", { className: "ogx-filter__logic-label", children: "Match:" }),
|
|
@@ -4569,14 +4568,14 @@ const Ni = ({ col: n, item: o, onChange: e }) => {
|
|
|
4569
4568
|
}
|
|
4570
4569
|
)
|
|
4571
4570
|
] }),
|
|
4572
|
-
s.length === 0 ? /* @__PURE__ */ t.jsx("div", { className: "ogx-filter__empty", children: "No filterable columns." }) : s.map((
|
|
4571
|
+
s.length === 0 ? /* @__PURE__ */ t.jsx("div", { className: "ogx-filter__empty", children: "No filterable columns." }) : s.map((g) => /* @__PURE__ */ t.jsx(
|
|
4573
4572
|
Ni,
|
|
4574
4573
|
{
|
|
4575
|
-
col:
|
|
4576
|
-
item: Ei(r,
|
|
4577
|
-
onChange: (
|
|
4574
|
+
col: g,
|
|
4575
|
+
item: Ei(r, g.field),
|
|
4576
|
+
onChange: (u) => l(g.field, u)
|
|
4578
4577
|
},
|
|
4579
|
-
|
|
4578
|
+
g.field
|
|
4580
4579
|
))
|
|
4581
4580
|
] });
|
|
4582
4581
|
}, Pi = ["sum", "avg", "count", "min", "max"];
|
|
@@ -4604,18 +4603,18 @@ function Po() {
|
|
|
4604
4603
|
);
|
|
4605
4604
|
}
|
|
4606
4605
|
function Mi({ anchorRef: n, columns: o, model: e, onChange: r, onClose: i }) {
|
|
4607
|
-
const l = ne(null), [a, s] = Q({ top: 0, right: 0 }),
|
|
4606
|
+
const l = ne(null), [a, s] = Q({ top: 0, right: 0 }), g = F(() => {
|
|
4608
4607
|
if (!n.current) return { top: 0, right: 0 };
|
|
4609
4608
|
const p = n.current.getBoundingClientRect();
|
|
4610
4609
|
return { top: p.bottom + 6, right: window.innerWidth - p.right };
|
|
4611
4610
|
}, [n]);
|
|
4612
4611
|
ee(() => {
|
|
4613
|
-
s(
|
|
4614
|
-
const p = () => s(
|
|
4612
|
+
s(g());
|
|
4613
|
+
const p = () => s(g());
|
|
4615
4614
|
return window.addEventListener("scroll", p, !0), window.addEventListener("resize", p), () => {
|
|
4616
4615
|
window.removeEventListener("scroll", p, !0), window.removeEventListener("resize", p);
|
|
4617
4616
|
};
|
|
4618
|
-
}, [
|
|
4617
|
+
}, [g]), ee(() => {
|
|
4619
4618
|
function p(L) {
|
|
4620
4619
|
l.current && !l.current.contains(L.target) && n.current && !n.current.contains(L.target) && i();
|
|
4621
4620
|
}
|
|
@@ -4626,12 +4625,12 @@ function Mi({ anchorRef: n, columns: o, model: e, onChange: r, onClose: i }) {
|
|
|
4626
4625
|
document.removeEventListener("mousedown", p), document.removeEventListener("keydown", k);
|
|
4627
4626
|
};
|
|
4628
4627
|
}, [n, i]);
|
|
4629
|
-
const
|
|
4630
|
-
function
|
|
4631
|
-
|
|
4628
|
+
const u = new Set(e.rowFields), h = new Set(e.columnFields), m = new Set(e.valueFields.map((p) => p.field)), c = (p) => u.has(p) || h.has(p) || m.has(p);
|
|
4629
|
+
function f(p) {
|
|
4630
|
+
u.has(p) || r({ ...e, rowFields: [...e.rowFields, p] });
|
|
4632
4631
|
}
|
|
4633
4632
|
function w(p) {
|
|
4634
|
-
|
|
4633
|
+
h.has(p) || r({ ...e, columnFields: [...e.columnFields, p] });
|
|
4635
4634
|
}
|
|
4636
4635
|
function x(p, k = "sum") {
|
|
4637
4636
|
m.has(p) || r({ ...e, valueFields: [...e.valueFields, { field: p, aggFn: k }] });
|
|
@@ -4738,16 +4737,16 @@ function Mi({ anchorRef: n, columns: o, model: e, onChange: r, onClose: i }) {
|
|
|
4738
4737
|
/* @__PURE__ */ t.jsxs("div", { className: "ogx-pivot-fields", children: [
|
|
4739
4738
|
o.map((p) => {
|
|
4740
4739
|
const k = S.has(p.field);
|
|
4741
|
-
return
|
|
4740
|
+
return c(p.field) ? null : /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 3 }, children: [
|
|
4742
4741
|
/* @__PURE__ */ t.jsx("span", { className: `ogx-pivot-field-btn${k ? " ogx-pivot-field-btn--numeric" : ""}`, children: p.headerName ?? p.field }),
|
|
4743
4742
|
/* @__PURE__ */ t.jsxs("div", { className: "ogx-pivot-field-actions", children: [
|
|
4744
|
-
/* @__PURE__ */ t.jsx("button", { className: "ogx-pivot-add-btn ogx-pivot-add-btn--row", onClick: () =>
|
|
4743
|
+
/* @__PURE__ */ t.jsx("button", { className: "ogx-pivot-add-btn ogx-pivot-add-btn--row", onClick: () => f(p.field), title: "Add to Row Fields", children: "Row" }),
|
|
4745
4744
|
/* @__PURE__ */ t.jsx("button", { className: "ogx-pivot-add-btn ogx-pivot-add-btn--col", onClick: () => w(p.field), title: "Add to Column Fields", children: "Col" }),
|
|
4746
4745
|
k && /* @__PURE__ */ t.jsx("button", { className: "ogx-pivot-add-btn ogx-pivot-add-btn--value", onClick: () => x(p.field), title: "Add to Value Fields", children: "Val" })
|
|
4747
4746
|
] })
|
|
4748
4747
|
] }, p.field);
|
|
4749
4748
|
}),
|
|
4750
|
-
o.every((p) =>
|
|
4749
|
+
o.every((p) => c(p.field)) && /* @__PURE__ */ t.jsx("span", { style: { fontSize: 12, color: "var(--ogx-color-gray-400, #94a3b8)" }, children: "All fields are in use." })
|
|
4751
4750
|
] })
|
|
4752
4751
|
] })
|
|
4753
4752
|
] })
|
|
@@ -4768,49 +4767,49 @@ function Ti() {
|
|
|
4768
4767
|
/* @__PURE__ */ t.jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
4769
4768
|
] });
|
|
4770
4769
|
}
|
|
4771
|
-
function
|
|
4772
|
-
const [i, l] = Q(!1), [a, s] = Q(n),
|
|
4770
|
+
function Wi({ value: n = "", onChange: o, placeholder: e = "Search...", debounceMs: r = 250 }) {
|
|
4771
|
+
const [i, l] = Q(!1), [a, s] = Q(n), g = ne(null), u = ne(null);
|
|
4773
4772
|
ee(() => {
|
|
4774
4773
|
s(n), n && !i && l(!0);
|
|
4775
4774
|
}, [n, i]), ee(() => {
|
|
4776
|
-
const
|
|
4775
|
+
const f = setTimeout(() => {
|
|
4777
4776
|
a !== n && o(a);
|
|
4778
4777
|
}, r);
|
|
4779
|
-
return () => clearTimeout(
|
|
4778
|
+
return () => clearTimeout(f);
|
|
4780
4779
|
}, [a, o, r, n]);
|
|
4781
|
-
const
|
|
4780
|
+
const h = () => {
|
|
4782
4781
|
l(!0);
|
|
4783
|
-
}, m = (
|
|
4784
|
-
|
|
4785
|
-
},
|
|
4782
|
+
}, m = (f) => {
|
|
4783
|
+
f.stopPropagation(), s(""), g.current?.focus(), o("");
|
|
4784
|
+
}, c = () => {
|
|
4786
4785
|
a || l(!1);
|
|
4787
4786
|
};
|
|
4788
4787
|
return ee(() => {
|
|
4789
|
-
const
|
|
4790
|
-
|
|
4788
|
+
const f = (w) => {
|
|
4789
|
+
u.current && !u.current.contains(w.target) && (a || l(!1));
|
|
4791
4790
|
};
|
|
4792
|
-
return document.addEventListener("mousedown",
|
|
4791
|
+
return document.addEventListener("mousedown", f), () => document.removeEventListener("mousedown", f);
|
|
4793
4792
|
}, [a]), /* @__PURE__ */ t.jsxs(
|
|
4794
4793
|
"div",
|
|
4795
4794
|
{
|
|
4796
|
-
ref:
|
|
4795
|
+
ref: u,
|
|
4797
4796
|
className: `ogx-global-search${i ? " ogx-global-search--expanded" : ""}`,
|
|
4798
4797
|
onClick: () => {
|
|
4799
|
-
i || (l(!0), setTimeout(() =>
|
|
4798
|
+
i || (l(!0), setTimeout(() => g.current?.focus(), 50));
|
|
4800
4799
|
},
|
|
4801
4800
|
children: [
|
|
4802
4801
|
/* @__PURE__ */ t.jsx("div", { className: "ogx-global-search__icon-wrapper", children: /* @__PURE__ */ t.jsx(Li, {}) }),
|
|
4803
4802
|
/* @__PURE__ */ t.jsx(
|
|
4804
4803
|
"input",
|
|
4805
4804
|
{
|
|
4806
|
-
ref:
|
|
4805
|
+
ref: g,
|
|
4807
4806
|
id: "ogx-global-search-input",
|
|
4808
4807
|
name: "ogx-global-search",
|
|
4809
4808
|
className: "ogx-global-search__input",
|
|
4810
4809
|
value: a,
|
|
4811
|
-
onChange: (
|
|
4812
|
-
onFocus:
|
|
4813
|
-
onBlur:
|
|
4810
|
+
onChange: (f) => s(f.target.value),
|
|
4811
|
+
onFocus: h,
|
|
4812
|
+
onBlur: c,
|
|
4814
4813
|
placeholder: e,
|
|
4815
4814
|
"aria-label": "Global Search",
|
|
4816
4815
|
autoComplete: "off"
|
|
@@ -4828,26 +4827,26 @@ function jn({
|
|
|
4828
4827
|
enterDelay: r = 200,
|
|
4829
4828
|
leaveDelay: i = 0
|
|
4830
4829
|
}) {
|
|
4831
|
-
const [l, a] = Q(!1), [s,
|
|
4832
|
-
if (!
|
|
4833
|
-
const x =
|
|
4830
|
+
const [l, a] = Q(!1), [s, g] = Q({ top: 0, left: 0 }), u = ne(null), h = ne(null), m = F(() => {
|
|
4831
|
+
if (!h.current) return;
|
|
4832
|
+
const x = h.current.getBoundingClientRect();
|
|
4834
4833
|
let N = 0, E = 0;
|
|
4835
4834
|
const j = window.pageXOffset || document.documentElement.scrollLeft, _ = window.pageYOffset || document.documentElement.scrollTop;
|
|
4836
|
-
e === "top" ? (N = x.top + _ - 8, E = x.left + j + x.width / 2) : e === "bottom" && (N = x.bottom + _ + 8, E = x.left + j + x.width / 2),
|
|
4835
|
+
e === "top" ? (N = x.top + _ - 8, E = x.left + j + x.width / 2) : e === "bottom" && (N = x.bottom + _ + 8, E = x.left + j + x.width / 2), g({ top: N, left: E });
|
|
4837
4836
|
}, [e]);
|
|
4838
4837
|
kr(() => (l && (m(), window.addEventListener("scroll", m, !0), window.addEventListener("resize", m)), () => {
|
|
4839
4838
|
window.removeEventListener("scroll", m, !0), window.removeEventListener("resize", m);
|
|
4840
4839
|
}), [l, m]);
|
|
4841
|
-
const
|
|
4842
|
-
|
|
4840
|
+
const c = () => {
|
|
4841
|
+
u.current && clearTimeout(u.current), u.current = setTimeout(() => {
|
|
4843
4842
|
a(!0);
|
|
4844
4843
|
}, r);
|
|
4845
|
-
},
|
|
4846
|
-
|
|
4844
|
+
}, f = () => {
|
|
4845
|
+
u.current && clearTimeout(u.current), u.current = setTimeout(() => {
|
|
4847
4846
|
a(!1);
|
|
4848
4847
|
}, i);
|
|
4849
|
-
}, w =
|
|
4850
|
-
|
|
4848
|
+
}, w = F((x) => {
|
|
4849
|
+
h.current = x ? x.firstElementChild ?? x : null;
|
|
4851
4850
|
}, []);
|
|
4852
4851
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
4853
4852
|
/* @__PURE__ */ t.jsx(
|
|
@@ -4855,8 +4854,8 @@ function jn({
|
|
|
4855
4854
|
{
|
|
4856
4855
|
ref: w,
|
|
4857
4856
|
style: { display: "inline-block", lineHeight: 0 },
|
|
4858
|
-
onMouseEnter:
|
|
4859
|
-
onMouseLeave:
|
|
4857
|
+
onMouseEnter: c,
|
|
4858
|
+
onMouseLeave: f,
|
|
4860
4859
|
children: o
|
|
4861
4860
|
}
|
|
4862
4861
|
),
|
|
@@ -4878,7 +4877,7 @@ function jn({
|
|
|
4878
4877
|
)
|
|
4879
4878
|
] });
|
|
4880
4879
|
}
|
|
4881
|
-
const
|
|
4880
|
+
const Fi = ["none", "sum", "avg", "count", "min", "max"];
|
|
4882
4881
|
function Mo() {
|
|
4883
4882
|
return /* @__PURE__ */ t.jsx(
|
|
4884
4883
|
"svg",
|
|
@@ -4918,30 +4917,30 @@ function Ai({
|
|
|
4918
4917
|
onClose: l,
|
|
4919
4918
|
activeCount: a
|
|
4920
4919
|
}) {
|
|
4921
|
-
const s = ne(null), [
|
|
4920
|
+
const s = ne(null), [g, u] = Q({ top: 0, right: 0 }), h = F(() => {
|
|
4922
4921
|
if (!n.current) return { top: 0, right: 0 };
|
|
4923
|
-
const
|
|
4922
|
+
const c = n.current.getBoundingClientRect();
|
|
4924
4923
|
return {
|
|
4925
|
-
top:
|
|
4926
|
-
right: window.innerWidth -
|
|
4924
|
+
top: c.bottom + 6,
|
|
4925
|
+
right: window.innerWidth - c.right
|
|
4927
4926
|
};
|
|
4928
4927
|
}, [n]);
|
|
4929
4928
|
ee(() => {
|
|
4930
|
-
|
|
4931
|
-
const
|
|
4932
|
-
return window.addEventListener("scroll",
|
|
4933
|
-
window.removeEventListener("scroll",
|
|
4929
|
+
u(h());
|
|
4930
|
+
const c = () => u(h());
|
|
4931
|
+
return window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
|
|
4932
|
+
window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c);
|
|
4934
4933
|
};
|
|
4935
|
-
}, [
|
|
4936
|
-
function
|
|
4937
|
-
s.current && !s.current.contains(
|
|
4934
|
+
}, [h]), ee(() => {
|
|
4935
|
+
function c(f) {
|
|
4936
|
+
s.current && !s.current.contains(f.target) && n.current && !n.current.contains(f.target) && l();
|
|
4938
4937
|
}
|
|
4939
|
-
return document.addEventListener("mousedown",
|
|
4938
|
+
return document.addEventListener("mousedown", c), () => document.removeEventListener("mousedown", c);
|
|
4940
4939
|
}, [n, l]), ee(() => {
|
|
4941
|
-
function
|
|
4942
|
-
|
|
4940
|
+
function c(f) {
|
|
4941
|
+
f.key === "Escape" && l();
|
|
4943
4942
|
}
|
|
4944
|
-
return document.addEventListener("keydown",
|
|
4943
|
+
return document.addEventListener("keydown", c), () => document.removeEventListener("keydown", c);
|
|
4945
4944
|
}, [l]);
|
|
4946
4945
|
const m = /* @__PURE__ */ t.jsxs(
|
|
4947
4946
|
"div",
|
|
@@ -4950,7 +4949,7 @@ function Ai({
|
|
|
4950
4949
|
className: "ogx-toolbar__panel",
|
|
4951
4950
|
role: "dialog",
|
|
4952
4951
|
"aria-label": "Summaries configuration",
|
|
4953
|
-
style: { top:
|
|
4952
|
+
style: { top: g.top, right: g.right, width: 400, maxWidth: "calc(100vw - 24px)" },
|
|
4954
4953
|
children: [
|
|
4955
4954
|
/* @__PURE__ */ t.jsxs("div", { className: "ogx-toolbar__panel-header", children: [
|
|
4956
4955
|
/* @__PURE__ */ t.jsxs("span", { className: "ogx-toolbar__panel-title", children: [
|
|
@@ -4973,21 +4972,21 @@ function Ai({
|
|
|
4973
4972
|
"Set ",
|
|
4974
4973
|
/* @__PURE__ */ t.jsx("code", { children: "aggregable: true" }),
|
|
4975
4974
|
" on a column to enable."
|
|
4976
|
-
] }) : e.map((
|
|
4977
|
-
const
|
|
4975
|
+
] }) : e.map((c) => {
|
|
4976
|
+
const f = o[c.field] || "none";
|
|
4978
4977
|
return /* @__PURE__ */ t.jsxs("div", { className: "ogx-toolbar__agg-row", children: [
|
|
4979
|
-
/* @__PURE__ */ t.jsx("span", { className: "ogx-toolbar__agg-label", title:
|
|
4980
|
-
/* @__PURE__ */ t.jsx("div", { className: "ogx-toolbar__agg-pills", children:
|
|
4978
|
+
/* @__PURE__ */ t.jsx("span", { className: "ogx-toolbar__agg-label", title: c.field, children: c.headerName || c.field }),
|
|
4979
|
+
/* @__PURE__ */ t.jsx("div", { className: "ogx-toolbar__agg-pills", children: Fi.map((w) => /* @__PURE__ */ t.jsx(
|
|
4981
4980
|
"button",
|
|
4982
4981
|
{
|
|
4983
|
-
className: `ogx-toolbar__pill${
|
|
4984
|
-
onClick: () => r(
|
|
4985
|
-
"aria-pressed":
|
|
4982
|
+
className: `ogx-toolbar__pill${f === w ? " ogx-toolbar__pill--active" : ""}`,
|
|
4983
|
+
onClick: () => r(c.field, w),
|
|
4984
|
+
"aria-pressed": f === w,
|
|
4986
4985
|
children: w
|
|
4987
4986
|
},
|
|
4988
4987
|
w
|
|
4989
4988
|
)) })
|
|
4990
|
-
] },
|
|
4989
|
+
] }, c.field);
|
|
4991
4990
|
}) })
|
|
4992
4991
|
]
|
|
4993
4992
|
}
|
|
@@ -5003,25 +5002,25 @@ function zi({
|
|
|
5003
5002
|
onHideAll: l,
|
|
5004
5003
|
onClose: a
|
|
5005
5004
|
}) {
|
|
5006
|
-
const s = ne(null), [
|
|
5005
|
+
const s = ne(null), [g, u] = Q({ top: 0, right: 0 }), h = F(() => {
|
|
5007
5006
|
if (!n.current) return { top: 0, right: 0 };
|
|
5008
|
-
const
|
|
5007
|
+
const c = n.current.getBoundingClientRect();
|
|
5009
5008
|
return {
|
|
5010
|
-
top:
|
|
5011
|
-
right: window.innerWidth -
|
|
5009
|
+
top: c.bottom + 6,
|
|
5010
|
+
right: window.innerWidth - c.right
|
|
5012
5011
|
};
|
|
5013
5012
|
}, [n]);
|
|
5014
5013
|
ee(() => {
|
|
5015
|
-
|
|
5016
|
-
const
|
|
5017
|
-
return window.addEventListener("scroll",
|
|
5018
|
-
window.removeEventListener("scroll",
|
|
5014
|
+
u(h());
|
|
5015
|
+
const c = () => u(h());
|
|
5016
|
+
return window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
|
|
5017
|
+
window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c);
|
|
5019
5018
|
};
|
|
5020
|
-
}, [
|
|
5021
|
-
function
|
|
5022
|
-
s.current && !s.current.contains(
|
|
5019
|
+
}, [h]), ee(() => {
|
|
5020
|
+
function c(f) {
|
|
5021
|
+
s.current && !s.current.contains(f.target) && n.current && !n.current.contains(f.target) && a();
|
|
5023
5022
|
}
|
|
5024
|
-
return document.addEventListener("mousedown",
|
|
5023
|
+
return document.addEventListener("mousedown", c), () => document.removeEventListener("mousedown", c);
|
|
5025
5024
|
}, [n, a]);
|
|
5026
5025
|
const m = /* @__PURE__ */ t.jsx(
|
|
5027
5026
|
"div",
|
|
@@ -5030,7 +5029,7 @@ function zi({
|
|
|
5030
5029
|
className: "ogx-toolbar__panel",
|
|
5031
5030
|
role: "dialog",
|
|
5032
5031
|
"aria-label": "Column visibility",
|
|
5033
|
-
style: { top:
|
|
5032
|
+
style: { top: g.top, right: g.right, width: 280, padding: 0 },
|
|
5034
5033
|
children: /* @__PURE__ */ t.jsx(
|
|
5035
5034
|
Io,
|
|
5036
5035
|
{
|
|
@@ -5052,32 +5051,32 @@ function Bi({
|
|
|
5052
5051
|
onFilterModelChange: r,
|
|
5053
5052
|
onClose: i
|
|
5054
5053
|
}) {
|
|
5055
|
-
const l = ne(null), [a, s] = Q({ top: 0, right: 0 }),
|
|
5054
|
+
const l = ne(null), [a, s] = Q({ top: 0, right: 0 }), g = F(() => {
|
|
5056
5055
|
if (!n.current) return { top: 0, right: 0 };
|
|
5057
|
-
const
|
|
5056
|
+
const c = n.current.getBoundingClientRect();
|
|
5058
5057
|
return {
|
|
5059
|
-
top:
|
|
5060
|
-
right: window.innerWidth -
|
|
5058
|
+
top: c.bottom + 6,
|
|
5059
|
+
right: window.innerWidth - c.right
|
|
5061
5060
|
};
|
|
5062
5061
|
}, [n]);
|
|
5063
5062
|
ee(() => {
|
|
5064
|
-
s(
|
|
5065
|
-
const
|
|
5066
|
-
return window.addEventListener("scroll",
|
|
5067
|
-
window.removeEventListener("scroll",
|
|
5063
|
+
s(g());
|
|
5064
|
+
const c = () => s(g());
|
|
5065
|
+
return window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
|
|
5066
|
+
window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c);
|
|
5068
5067
|
};
|
|
5069
|
-
}, [
|
|
5070
|
-
function
|
|
5068
|
+
}, [g]), ee(() => {
|
|
5069
|
+
function c(w) {
|
|
5071
5070
|
l.current && !l.current.contains(w.target) && n.current && !n.current.contains(w.target) && i();
|
|
5072
5071
|
}
|
|
5073
|
-
function
|
|
5072
|
+
function f(w) {
|
|
5074
5073
|
w.key === "Escape" && i();
|
|
5075
5074
|
}
|
|
5076
|
-
return document.addEventListener("mousedown",
|
|
5077
|
-
document.removeEventListener("mousedown",
|
|
5075
|
+
return document.addEventListener("mousedown", c), document.addEventListener("keydown", f), () => {
|
|
5076
|
+
document.removeEventListener("mousedown", c), document.removeEventListener("keydown", f);
|
|
5078
5077
|
};
|
|
5079
5078
|
}, [n, i]);
|
|
5080
|
-
const
|
|
5079
|
+
const u = e.items?.length ?? 0, h = () => {
|
|
5081
5080
|
r({ ...e, items: [], logicOperator: "and" });
|
|
5082
5081
|
}, m = /* @__PURE__ */ t.jsxs(
|
|
5083
5082
|
"div",
|
|
@@ -5092,13 +5091,13 @@ function Bi({
|
|
|
5092
5091
|
/* @__PURE__ */ t.jsxs("span", { className: "ogx-toolbar__panel-title", children: [
|
|
5093
5092
|
/* @__PURE__ */ t.jsx(Lo, {}),
|
|
5094
5093
|
"Filters",
|
|
5095
|
-
|
|
5094
|
+
u > 0 && /* @__PURE__ */ t.jsx("span", { className: "ogx-toolbar__panel-count", children: u })
|
|
5096
5095
|
] }),
|
|
5097
|
-
|
|
5096
|
+
u > 0 && /* @__PURE__ */ t.jsx(
|
|
5098
5097
|
"button",
|
|
5099
5098
|
{
|
|
5100
5099
|
className: "ogx-toolbar__clear-btn",
|
|
5101
|
-
onClick:
|
|
5100
|
+
onClick: h,
|
|
5102
5101
|
title: "Clear all filters",
|
|
5103
5102
|
children: "Clear all"
|
|
5104
5103
|
}
|
|
@@ -5127,31 +5126,31 @@ function nl({
|
|
|
5127
5126
|
filterModel: l,
|
|
5128
5127
|
onFilterModelChange: a,
|
|
5129
5128
|
columnVisibilityModel: s = {},
|
|
5130
|
-
onColumnVisibilityModelChange:
|
|
5131
|
-
forceColumnsOpen:
|
|
5132
|
-
onColumnsPanelClose:
|
|
5129
|
+
onColumnVisibilityModelChange: g,
|
|
5130
|
+
forceColumnsOpen: u,
|
|
5131
|
+
onColumnsPanelClose: h,
|
|
5133
5132
|
children: m,
|
|
5134
|
-
rightContent:
|
|
5135
|
-
style:
|
|
5133
|
+
rightContent: c,
|
|
5134
|
+
style: f
|
|
5136
5135
|
}) {
|
|
5137
5136
|
const [w, x] = Q(!1), [N, E] = Q(!1), [j, _] = Q(!1), [v, S] = Q(!1);
|
|
5138
5137
|
ee(() => {
|
|
5139
|
-
|
|
5140
|
-
}, [
|
|
5138
|
+
u && (_(!0), x(!1), E(!1), S(!1));
|
|
5139
|
+
}, [u]);
|
|
5141
5140
|
const y = ne(null), I = ne(null), C = ne(null), p = ne(null), k = r ?? $i, L = k.rowFields.length > 0 || k.columnFields.length > 0 || k.valueFields.length > 0, B = n.filter(
|
|
5142
5141
|
(T) => T.aggregable !== !1 && (T.type === "number" || T.aggregable === !0)
|
|
5143
5142
|
), Y = Object.keys(o).filter(
|
|
5144
5143
|
(T) => o[T] && o[T] !== "none"
|
|
5145
|
-
).length, $ =
|
|
5144
|
+
).length, $ = F(
|
|
5146
5145
|
(T, A) => {
|
|
5147
5146
|
if (!e) return;
|
|
5148
5147
|
const O = { ...o };
|
|
5149
5148
|
A === "none" ? delete O[T] : O[T] = A, e(O);
|
|
5150
5149
|
},
|
|
5151
5150
|
[o, e]
|
|
5152
|
-
), K =
|
|
5151
|
+
), K = F(() => {
|
|
5153
5152
|
e?.({});
|
|
5154
|
-
}, [e]), q =
|
|
5153
|
+
}, [e]), q = F((T) => {
|
|
5155
5154
|
if (!a) return;
|
|
5156
5155
|
const O = {
|
|
5157
5156
|
...l || {},
|
|
@@ -5161,36 +5160,36 @@ function nl({
|
|
|
5161
5160
|
a(O);
|
|
5162
5161
|
}, [l, a]), D = l?.quickFilterValues?.[0] || "", te = l?.items?.length || 0, J = new Set(
|
|
5163
5162
|
n.filter((T) => s[T.field] !== !1).map((T) => T.field)
|
|
5164
|
-
), we =
|
|
5165
|
-
if (!
|
|
5163
|
+
), we = F((T, A) => {
|
|
5164
|
+
if (!g) return;
|
|
5166
5165
|
const O = { ...s, [T]: A };
|
|
5167
|
-
|
|
5168
|
-
}, [s,
|
|
5169
|
-
if (!
|
|
5166
|
+
g(O);
|
|
5167
|
+
}, [s, g]), b = F(() => {
|
|
5168
|
+
if (!g) return;
|
|
5170
5169
|
const T = { ...s };
|
|
5171
5170
|
n.forEach((A) => {
|
|
5172
5171
|
A.hideable !== !1 && (T[A.field] = !0);
|
|
5173
|
-
}),
|
|
5174
|
-
}, [n, s,
|
|
5175
|
-
if (!
|
|
5172
|
+
}), g(T);
|
|
5173
|
+
}, [n, s, g]), H = F(() => {
|
|
5174
|
+
if (!g) return;
|
|
5176
5175
|
const T = { ...s };
|
|
5177
5176
|
n.forEach((A) => {
|
|
5178
5177
|
A.hideable !== !1 && (T[A.field] = !1);
|
|
5179
|
-
}),
|
|
5180
|
-
}, [n, s,
|
|
5181
|
-
return /* @__PURE__ */ t.jsxs("div", { className: "ogx-toolbar", role: "toolbar", "aria-label": "Grid toolbar", style:
|
|
5178
|
+
}), g(T);
|
|
5179
|
+
}, [n, s, g]);
|
|
5180
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "ogx-toolbar", role: "toolbar", "aria-label": "Grid toolbar", style: f, children: [
|
|
5182
5181
|
m && /* @__PURE__ */ t.jsx("div", { className: "ogx-toolbar__left", children: m }),
|
|
5183
5182
|
/* @__PURE__ */ t.jsx("div", { className: "ogx-toolbar__spacer" }),
|
|
5184
5183
|
/* @__PURE__ */ t.jsxs("div", { className: "ogx-toolbar__actions", children: [
|
|
5185
5184
|
a && /* @__PURE__ */ t.jsx("div", { className: "ogx-toolbar__dropdown-wrapper", style: { marginRight: 4 }, children: /* @__PURE__ */ t.jsx(
|
|
5186
|
-
|
|
5185
|
+
Wi,
|
|
5187
5186
|
{
|
|
5188
5187
|
value: D,
|
|
5189
5188
|
onChange: q,
|
|
5190
5189
|
placeholder: "Search..."
|
|
5191
5190
|
}
|
|
5192
5191
|
) }),
|
|
5193
|
-
|
|
5192
|
+
g && /* @__PURE__ */ t.jsxs("div", { className: "ogx-toolbar__dropdown-wrapper", style: { marginRight: 4 }, children: [
|
|
5194
5193
|
/* @__PURE__ */ t.jsx(jn, { title: "Columns", children: /* @__PURE__ */ t.jsx(
|
|
5195
5194
|
"button",
|
|
5196
5195
|
{
|
|
@@ -5213,7 +5212,7 @@ function nl({
|
|
|
5213
5212
|
onShowAll: b,
|
|
5214
5213
|
onHideAll: H,
|
|
5215
5214
|
onClose: () => {
|
|
5216
|
-
_(!1),
|
|
5215
|
+
_(!1), h?.();
|
|
5217
5216
|
}
|
|
5218
5217
|
}
|
|
5219
5218
|
)
|
|
@@ -5309,7 +5308,7 @@ function nl({
|
|
|
5309
5308
|
}
|
|
5310
5309
|
)
|
|
5311
5310
|
] }),
|
|
5312
|
-
|
|
5311
|
+
c
|
|
5313
5312
|
] })
|
|
5314
5313
|
] });
|
|
5315
5314
|
}
|
|
@@ -5349,41 +5348,41 @@ function il(n, o, e = {}) {
|
|
|
5349
5348
|
includeHeaders: i = !0,
|
|
5350
5349
|
delimiter: l = ",",
|
|
5351
5350
|
selectedRows: a
|
|
5352
|
-
} = e, s = a && a.length > 0 ? n.filter((
|
|
5351
|
+
} = e, s = a && a.length > 0 ? n.filter((h) => a.includes(h.id)) : n;
|
|
5353
5352
|
if (s.length === 0) {
|
|
5354
5353
|
console.warn("No rows to export");
|
|
5355
5354
|
return;
|
|
5356
5355
|
}
|
|
5357
|
-
const
|
|
5358
|
-
let
|
|
5356
|
+
const g = o.filter((h) => !(h.field === "__check__" || h.field === "__actions__"));
|
|
5357
|
+
let u = "";
|
|
5359
5358
|
if (i) {
|
|
5360
|
-
const
|
|
5361
|
-
|
|
5359
|
+
const h = g.map((m) => Jt(m.headerName || m.field));
|
|
5360
|
+
u += h.join(l) + `
|
|
5362
5361
|
`;
|
|
5363
5362
|
}
|
|
5364
|
-
if (s.forEach((
|
|
5365
|
-
const m =
|
|
5366
|
-
let
|
|
5367
|
-
return
|
|
5363
|
+
if (s.forEach((h) => {
|
|
5364
|
+
const m = g.map((c) => {
|
|
5365
|
+
let f = h[c.field];
|
|
5366
|
+
return c.valueGetter && (f = c.valueGetter({ row: h, field: c.field, value: f })), c.valueFormatter && f !== void 0 && f !== null && (f = c.valueFormatter({ value: f, row: h, field: c.field })), Jt(String(f ?? ""));
|
|
5368
5367
|
});
|
|
5369
|
-
|
|
5368
|
+
u += m.join(l) + `
|
|
5370
5369
|
`;
|
|
5371
5370
|
}), e.aggregationResult) {
|
|
5372
|
-
const
|
|
5373
|
-
|
|
5371
|
+
const h = e.aggregationResult, m = e.aggregationModel || {}, c = g.map((w) => m[w.field] ? Jt(m[w.field].toUpperCase()) : Jt(""));
|
|
5372
|
+
u += c.join(l) + `
|
|
5374
5373
|
`;
|
|
5375
|
-
const
|
|
5376
|
-
const x =
|
|
5374
|
+
const f = g.map((w) => {
|
|
5375
|
+
const x = h[w.field];
|
|
5377
5376
|
if (x != null) {
|
|
5378
5377
|
let N = x;
|
|
5379
5378
|
return w.valueFormatter ? N = w.valueFormatter({ value: x, row: {}, field: w.field }) : m[w.field] && (N = Pt(x, m[w.field])), Jt(String(N));
|
|
5380
5379
|
}
|
|
5381
5380
|
return Jt("");
|
|
5382
5381
|
});
|
|
5383
|
-
|
|
5382
|
+
u += f.join(l) + `
|
|
5384
5383
|
`;
|
|
5385
5384
|
}
|
|
5386
|
-
Zn(
|
|
5385
|
+
Zn(u, r, "text/csv;charset=utf-8;");
|
|
5387
5386
|
}
|
|
5388
5387
|
function Jt(n) {
|
|
5389
5388
|
return n.includes(",") || n.includes('"') || n.includes(`
|
|
@@ -5395,36 +5394,36 @@ function ll(n, o, e = {}) {
|
|
|
5395
5394
|
sheetName: i = "Sheet1",
|
|
5396
5395
|
includeHeaders: l = !0,
|
|
5397
5396
|
selectedRows: a
|
|
5398
|
-
} = e, s = a && a.length > 0 ? n.filter((
|
|
5397
|
+
} = e, s = a && a.length > 0 ? n.filter((h) => a.includes(h.id)) : n;
|
|
5399
5398
|
if (s.length === 0) {
|
|
5400
5399
|
console.warn("No rows to export");
|
|
5401
5400
|
return;
|
|
5402
5401
|
}
|
|
5403
|
-
const
|
|
5404
|
-
let
|
|
5405
|
-
if (
|
|
5406
|
-
|
|
5407
|
-
}),
|
|
5408
|
-
|
|
5409
|
-
let
|
|
5410
|
-
m.valueGetter && (
|
|
5402
|
+
const g = o.filter((h) => !(h.field === "__check__" || h.field === "__actions__"));
|
|
5403
|
+
let u = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">';
|
|
5404
|
+
if (u += "<head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet>", u += `<x:Name>${i}</x:Name>`, u += "<x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]-->", u += '<meta charset="UTF-8"></head><body>', u += '<table border="1">', l && (u += "<thead><tr>", g.forEach((h) => {
|
|
5405
|
+
u += `<th>${_t(h.headerName || h.field)}</th>`;
|
|
5406
|
+
}), u += "</tr></thead>"), u += "<tbody>", s.forEach((h) => {
|
|
5407
|
+
u += "<tr>", g.forEach((m) => {
|
|
5408
|
+
let c = h[m.field];
|
|
5409
|
+
m.valueGetter && (c = m.valueGetter({ row: h, field: m.field, value: c })), m.valueFormatter && c !== void 0 && c !== null && (c = m.valueFormatter({ value: c, row: h, field: m.field })), u += `<td>${_t(String(c ?? ""))}</td>`;
|
|
5411
5410
|
});
|
|
5412
5411
|
}), e.aggregationResult) {
|
|
5413
|
-
const
|
|
5414
|
-
|
|
5415
|
-
m[
|
|
5416
|
-
}),
|
|
5417
|
-
const
|
|
5418
|
-
if (
|
|
5419
|
-
let w =
|
|
5420
|
-
|
|
5412
|
+
const h = e.aggregationResult, m = e.aggregationModel || {};
|
|
5413
|
+
u += '<tr style="font-size: 11px; color: #666; background-color: #f5f5f5;">', g.forEach((c) => {
|
|
5414
|
+
m[c.field] ? u += `<td style="text-align: right; font-weight: bold;">${_t(m[c.field].toUpperCase())}</td>` : u += "<td></td>";
|
|
5415
|
+
}), u += "</tr>", u += '<tr style="font-weight: bold; background-color: #f5f5f5;">', g.forEach((c) => {
|
|
5416
|
+
const f = h[c.field];
|
|
5417
|
+
if (f != null) {
|
|
5418
|
+
let w = f;
|
|
5419
|
+
c.valueFormatter ? w = c.valueFormatter({ value: f, row: {}, field: c.field }) : m[c.field] && (w = Pt(f, m[c.field])), u += `<td style="text-align: right;">${_t(String(w))}</td>`;
|
|
5421
5420
|
} else
|
|
5422
|
-
|
|
5423
|
-
}),
|
|
5421
|
+
u += "<td></td>";
|
|
5422
|
+
}), u += "</tr>";
|
|
5424
5423
|
}
|
|
5425
|
-
|
|
5424
|
+
u += "</tbody></table></body></html>", Zn(u, r, "application/vnd.ms-excel");
|
|
5426
5425
|
}
|
|
5427
|
-
function
|
|
5426
|
+
function _t(n) {
|
|
5428
5427
|
return n.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
5429
5428
|
}
|
|
5430
5429
|
function sl(n, o, e = {}) {
|
|
@@ -5437,35 +5436,35 @@ function sl(n, o, e = {}) {
|
|
|
5437
5436
|
console.warn("No rows to export");
|
|
5438
5437
|
return;
|
|
5439
5438
|
}
|
|
5440
|
-
const s = o.filter((m) => !(m.field === "__check__" || m.field === "__actions__")),
|
|
5441
|
-
const
|
|
5442
|
-
return s.forEach((
|
|
5443
|
-
let w = m[
|
|
5444
|
-
|
|
5445
|
-
}),
|
|
5439
|
+
const s = o.filter((m) => !(m.field === "__check__" || m.field === "__actions__")), g = a.map((m) => {
|
|
5440
|
+
const c = {};
|
|
5441
|
+
return s.forEach((f) => {
|
|
5442
|
+
let w = m[f.field];
|
|
5443
|
+
f.valueGetter && (w = f.valueGetter({ row: m, field: f.field, value: w })), c[f.field] = w;
|
|
5444
|
+
}), c;
|
|
5446
5445
|
});
|
|
5447
|
-
let
|
|
5446
|
+
let u = g;
|
|
5448
5447
|
if (e.aggregationResult) {
|
|
5449
|
-
const m = e.aggregationResult,
|
|
5448
|
+
const m = e.aggregationResult, c = e.aggregationModel || {}, f = {};
|
|
5450
5449
|
s.forEach((x) => {
|
|
5451
|
-
|
|
5450
|
+
c[x.field] && (f[x.field] = c[x.field].toUpperCase());
|
|
5452
5451
|
});
|
|
5453
5452
|
const w = {};
|
|
5454
5453
|
s.forEach((x) => {
|
|
5455
5454
|
if (m[x.field] !== void 0 && m[x.field] !== null) {
|
|
5456
5455
|
let N = m[x.field];
|
|
5457
|
-
x.valueFormatter ? N = x.valueFormatter({ value: N, row: {}, field: x.field }) :
|
|
5456
|
+
x.valueFormatter ? N = x.valueFormatter({ value: N, row: {}, field: x.field }) : c[x.field] && (N = Pt(N, c[x.field])), w[x.field] = N;
|
|
5458
5457
|
}
|
|
5459
|
-
}),
|
|
5460
|
-
data:
|
|
5458
|
+
}), u = {
|
|
5459
|
+
data: g,
|
|
5461
5460
|
aggregation: {
|
|
5462
|
-
labels:
|
|
5461
|
+
labels: f,
|
|
5463
5462
|
values: w
|
|
5464
5463
|
}
|
|
5465
5464
|
};
|
|
5466
5465
|
}
|
|
5467
|
-
const
|
|
5468
|
-
Zn(
|
|
5466
|
+
const h = i ? JSON.stringify(u, null, 2) : JSON.stringify(u);
|
|
5467
|
+
Zn(h, r, "application/json;charset=utf-8;");
|
|
5469
5468
|
}
|
|
5470
5469
|
async function al(n, o, e) {
|
|
5471
5470
|
const r = window.open("", "_blank");
|
|
@@ -5497,13 +5496,13 @@ async function al(n, o, e) {
|
|
|
5497
5496
|
try {
|
|
5498
5497
|
let i = "Print", l, a = null, s = null;
|
|
5499
5498
|
typeof e == "string" ? i = e : typeof e == "object" && (i = e.title || "Print", l = e.selectedRows, a = e.aggregationResult || null, s = e.aggregationModel || null);
|
|
5500
|
-
const
|
|
5501
|
-
if (
|
|
5499
|
+
const g = l && l.length > 0 ? n.filter((c) => l.includes(c.id)) : n;
|
|
5500
|
+
if (g.length === 0) {
|
|
5502
5501
|
r.document.body.innerHTML = "<h3>No rows to export</h3>";
|
|
5503
5502
|
return;
|
|
5504
5503
|
}
|
|
5505
|
-
const
|
|
5506
|
-
let
|
|
5504
|
+
const u = o.filter((c) => !(c.field === "__check__" || c.field === "__actions__"));
|
|
5505
|
+
let h = `
|
|
5507
5506
|
<!DOCTYPE html>
|
|
5508
5507
|
<html>
|
|
5509
5508
|
<head>
|
|
@@ -5523,27 +5522,27 @@ async function al(n, o, e) {
|
|
|
5523
5522
|
</head>
|
|
5524
5523
|
<body>
|
|
5525
5524
|
`;
|
|
5526
|
-
if (i && (
|
|
5527
|
-
|
|
5528
|
-
}),
|
|
5529
|
-
|
|
5530
|
-
let w =
|
|
5531
|
-
|
|
5532
|
-
}),
|
|
5525
|
+
if (i && (h += `<h1>${_t(i)}</h1>`), h += "<table>", h += "<thead><tr>", u.forEach((c) => {
|
|
5526
|
+
h += `<th>${_t(c.headerName || c.field)}</th>`;
|
|
5527
|
+
}), h += "</tr></thead>", h += "<tbody>", g.forEach((c) => {
|
|
5528
|
+
h += "<tr>", u.forEach((f) => {
|
|
5529
|
+
let w = c[f.field];
|
|
5530
|
+
f.valueGetter && (w = f.valueGetter({ row: c, field: f.field, value: w })), f.valueFormatter && w !== void 0 && w !== null && (w = f.valueFormatter({ value: w, row: c, field: f.field })), f.type === "image" && w ? h += `<td><div style="display:flex;justify-content:center;"><img src="${w}" alt="${f.headerName}" style="max-height: 40px; border-radius: 4px;"></div></td>` : h += `<td>${_t(String(w ?? ""))}</td>`;
|
|
5531
|
+
}), h += "</tr>";
|
|
5533
5532
|
}), a) {
|
|
5534
|
-
const
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
}),
|
|
5538
|
-
const w = a[
|
|
5533
|
+
const c = s || {};
|
|
5534
|
+
h += '<tfoot><tr style="font-size: 11px; color: #666; background-color: #f5f5f5;">', u.forEach((f) => {
|
|
5535
|
+
c[f.field] ? h += `<td style="text-align: right; font-weight: bold;">${_t(c[f.field].toUpperCase())}</td>` : h += "<td></td>";
|
|
5536
|
+
}), h += '</tr><tr style="font-weight: bold; background-color: #f5f5f5;">', u.forEach((f) => {
|
|
5537
|
+
const w = a[f.field];
|
|
5539
5538
|
if (w != null) {
|
|
5540
5539
|
let x = w;
|
|
5541
|
-
|
|
5540
|
+
f.valueFormatter ? x = f.valueFormatter({ value: w, row: {}, field: f.field }) : c[f.field] && (x = Pt(w, c[f.field])), h += `<td style="text-align: right;">${_t(String(x))}</td>`;
|
|
5542
5541
|
} else
|
|
5543
|
-
|
|
5544
|
-
}),
|
|
5542
|
+
h += "<td></td>";
|
|
5543
|
+
}), h += "</tr></tfoot>";
|
|
5545
5544
|
}
|
|
5546
|
-
|
|
5545
|
+
h += "</tbody></table></body></html>", r.document.open(), r.document.write(h), r.document.close(), r.document.title = i || "Print Preview", r.focus();
|
|
5547
5546
|
let m = !1;
|
|
5548
5547
|
r.onload = () => {
|
|
5549
5548
|
m || (m = !0, r.print(), setTimeout(() => {
|
|
@@ -5585,11 +5584,11 @@ async function Ui(n) {
|
|
|
5585
5584
|
const o = await Promise.allSettled(
|
|
5586
5585
|
n.map(async (r) => {
|
|
5587
5586
|
if (r.startsWith("data:")) {
|
|
5588
|
-
const s = r.indexOf(","),
|
|
5589
|
-
for (let x = 0; x <
|
|
5590
|
-
const
|
|
5587
|
+
const s = r.indexOf(","), g = r.slice(0, s), u = r.slice(s + 1), h = atob(u), m = new Uint8Array(h.length);
|
|
5588
|
+
for (let x = 0; x < h.length; x++) m[x] = h.charCodeAt(x);
|
|
5589
|
+
const f = g.match(/data:([^;,]+)/)?.[1] ?? "image/png";
|
|
5591
5590
|
let w = "png";
|
|
5592
|
-
return
|
|
5591
|
+
return f.includes("jpeg") || f.includes("jpg") ? w = "jpeg" : f.includes("gif") && (w = "gif"), { url: r, buffer: m.buffer, ext: w };
|
|
5593
5592
|
}
|
|
5594
5593
|
const i = await fetch(r, { mode: "cors" });
|
|
5595
5594
|
if (!i.ok) throw new Error(`HTTP ${i.status}`);
|
|
@@ -5611,29 +5610,29 @@ async function dl(n, o, e = {}) {
|
|
|
5611
5610
|
columnStyles: l = {},
|
|
5612
5611
|
headerFillColor: a = "#f1f5f9",
|
|
5613
5612
|
headerTextColor: s = "#334155",
|
|
5614
|
-
headerFontSize:
|
|
5615
|
-
bodyFontSize:
|
|
5616
|
-
aggregationResult:
|
|
5613
|
+
headerFontSize: g = 10,
|
|
5614
|
+
bodyFontSize: u = 10,
|
|
5615
|
+
aggregationResult: h = null,
|
|
5617
5616
|
aggregationModel: m = null,
|
|
5618
|
-
selectedRows:
|
|
5619
|
-
} = e,
|
|
5617
|
+
selectedRows: c
|
|
5618
|
+
} = e, f = (await import("exceljs")).default, w = new f.Workbook();
|
|
5620
5619
|
w.creator = "OpenGridX", w.created = /* @__PURE__ */ new Date();
|
|
5621
5620
|
const x = o.filter(
|
|
5622
5621
|
(C) => C.field !== "__check__" && C.field !== "__actions__" && !C.isSpacer
|
|
5623
|
-
), N = n, E =
|
|
5622
|
+
), N = n, E = c && c.length > 0 ? n.filter((C) => c.includes(C.id)) : n, j = i ?? [{ name: "Data", rows: "all", includeHeaders: !0, includeSummary: !1 }], _ = /* @__PURE__ */ new Map();
|
|
5624
5623
|
for (const C of j) {
|
|
5625
5624
|
if ("type" in C && C.type === "summary") {
|
|
5626
|
-
if (!
|
|
5625
|
+
if (!h || !m) continue;
|
|
5627
5626
|
const b = w.addWorksheet(C.name ?? "Summary");
|
|
5628
|
-
b.addRow(["Summary / Aggregation Totals"]), b.getRow(1).font = { bold: !0, size:
|
|
5629
|
-
T.fill = { type: "pattern", pattern: "solid", fgColor: { argb:
|
|
5627
|
+
b.addRow(["Summary / Aggregation Totals"]), b.getRow(1).font = { bold: !0, size: g + 2, color: { argb: jt(s) } }, b.addRow([]), b.addRow(["Column", "Function", "Value"]).eachCell((T) => {
|
|
5628
|
+
T.fill = { type: "pattern", pattern: "solid", fgColor: { argb: jt(a) } }, T.font = { bold: !0, size: g, color: { argb: jt(s) } }, T.border = jo();
|
|
5630
5629
|
}), x.forEach((T) => {
|
|
5631
|
-
const A = m[T.field], O =
|
|
5630
|
+
const A = m[T.field], O = h[T.field];
|
|
5632
5631
|
if (A == null || O == null) return;
|
|
5633
5632
|
let Z = O;
|
|
5634
5633
|
T.valueFormatter ? Z = T.valueFormatter({ value: O, row: {}, field: T.field }) : Z = Pt(O, A);
|
|
5635
5634
|
const U = b.addRow([T.headerName ?? T.field, A.toUpperCase(), Z]);
|
|
5636
|
-
U.getCell(3).alignment = { horizontal: "right" }, U.getCell(3).font = { bold: !0, size:
|
|
5635
|
+
U.getCell(3).alignment = { horizontal: "right" }, U.getCell(3).font = { bold: !0, size: u };
|
|
5637
5636
|
}), b.getColumn(1).width = 20, b.getColumn(2).width = 12, b.getColumn(3).width = 18;
|
|
5638
5637
|
continue;
|
|
5639
5638
|
}
|
|
@@ -5672,7 +5671,7 @@ async function dl(n, o, e = {}) {
|
|
|
5672
5671
|
const b = x.map((T) => T.headerName ?? T.field), H = J.addRow(b);
|
|
5673
5672
|
H.height = 20, H.eachCell((T, A) => {
|
|
5674
5673
|
const O = x[A - 1];
|
|
5675
|
-
T.fill = { type: "pattern", pattern: "solid", fgColor: { argb:
|
|
5674
|
+
T.fill = { type: "pattern", pattern: "solid", fgColor: { argb: jt(a) } }, T.font = { bold: !0, size: g, color: { argb: jt(s) } }, T.alignment = {
|
|
5676
5675
|
horizontal: l[O?.field]?.alignment ?? (O?.type === "number" ? "right" : "left"),
|
|
5677
5676
|
vertical: "middle"
|
|
5678
5677
|
}, T.border = jo();
|
|
@@ -5688,8 +5687,8 @@ async function dl(n, o, e = {}) {
|
|
|
5688
5687
|
let Z = b[O.field];
|
|
5689
5688
|
return O.valueGetter && (Z = O.valueGetter({ row: b, field: O.field, value: Z })), Hi(O, Z) === "string" && O.valueFormatter && Z != null && (Z = O.valueFormatter({ value: Z, row: b, field: O.field })), Z;
|
|
5690
5689
|
}), A = J.addRow(T);
|
|
5691
|
-
if (A.font = { size:
|
|
5692
|
-
O.fill = { type: "pattern", pattern: "solid", fgColor: { argb:
|
|
5690
|
+
if (A.font = { size: u }, q && H % 2 === 1 && A.eachCell((O) => {
|
|
5691
|
+
O.fill = { type: "pattern", pattern: "solid", fgColor: { argb: jt(q) } };
|
|
5693
5692
|
}), A.eachCell((O, Z) => {
|
|
5694
5693
|
const U = x[Z - 1];
|
|
5695
5694
|
U && (O.alignment = {
|
|
@@ -5704,13 +5703,13 @@ async function dl(n, o, e = {}) {
|
|
|
5704
5703
|
A.getCell(ce + 1).value = typeof ie == "string" ? ie : "";
|
|
5705
5704
|
return;
|
|
5706
5705
|
}
|
|
5707
|
-
const nt = l[P.field], z = nt?.imageWidth ?? 40, Ne = nt?.imageHeight ?? 40, ft = (J.getColumn(ce + 1).width ?? 8) * 7 + 5, Ge = Math.max(0, ft - z) / 2,
|
|
5706
|
+
const nt = l[P.field], z = nt?.imageWidth ?? 40, Ne = nt?.imageHeight ?? 40, ft = (J.getColumn(ce + 1).width ?? 8) * 7 + 5, Ge = Math.max(0, ft - z) / 2, ht = Math.max(0, U - Ne) / 2;
|
|
5708
5707
|
J.addImage(ve, {
|
|
5709
5708
|
tl: {
|
|
5710
5709
|
col: ce,
|
|
5711
5710
|
row: we,
|
|
5712
5711
|
nativeColOff: Math.floor(Ge * 9525),
|
|
5713
|
-
nativeRowOff: Math.floor(
|
|
5712
|
+
nativeRowOff: Math.floor(ht * 9525)
|
|
5714
5713
|
},
|
|
5715
5714
|
ext: { width: z, height: Ne },
|
|
5716
5715
|
editAs: "oneCell"
|
|
@@ -5719,20 +5718,20 @@ async function dl(n, o, e = {}) {
|
|
|
5719
5718
|
} else
|
|
5720
5719
|
A.height = 16;
|
|
5721
5720
|
we++;
|
|
5722
|
-
}), Y &&
|
|
5721
|
+
}), Y && h && m) {
|
|
5723
5722
|
const b = x.map((O) => {
|
|
5724
5723
|
const Z = m[O.field];
|
|
5725
5724
|
return Z ? Z.toUpperCase() : "";
|
|
5726
5725
|
}), H = J.addRow(b);
|
|
5727
|
-
H.height = 16, H.font = { size:
|
|
5726
|
+
H.height = 16, H.font = { size: u - 1, italic: !0, color: { argb: "FF94a3b8" } }, H.eachCell((O) => {
|
|
5728
5727
|
O.alignment = { horizontal: "right", vertical: "middle" }, O.border = { top: { style: "thin", color: { argb: "FFcbd5e1" } } };
|
|
5729
5728
|
});
|
|
5730
5729
|
const T = x.map((O) => {
|
|
5731
|
-
const Z = m[O.field], U =
|
|
5730
|
+
const Z = m[O.field], U = h[O.field];
|
|
5732
5731
|
return Z == null || U == null ? "" : O.valueFormatter ? O.valueFormatter({ value: U, row: {}, field: O.field }) : Pt(U, Z);
|
|
5733
5732
|
}), A = J.addRow(T);
|
|
5734
|
-
A.height = 18, A.font = { bold: !0, size:
|
|
5735
|
-
O.fill = { type: "pattern", pattern: "solid", fgColor: { argb:
|
|
5733
|
+
A.height = 18, A.font = { bold: !0, size: u, color: { argb: jt(s) } }, A.eachCell((O) => {
|
|
5734
|
+
O.fill = { type: "pattern", pattern: "solid", fgColor: { argb: jt(a) } }, O.alignment = { horizontal: "right", vertical: "middle" }, O.border = Ki();
|
|
5736
5735
|
});
|
|
5737
5736
|
}
|
|
5738
5737
|
}
|
|
@@ -5741,7 +5740,7 @@ async function dl(n, o, e = {}) {
|
|
|
5741
5740
|
}), y = URL.createObjectURL(S), I = document.createElement("a");
|
|
5742
5741
|
I.href = y, I.download = r.endsWith(".xlsx") ? r : `${r}.xlsx`, document.body.appendChild(I), I.click(), document.body.removeChild(I), URL.revokeObjectURL(y);
|
|
5743
5742
|
}
|
|
5744
|
-
function
|
|
5743
|
+
function jt(n) {
|
|
5745
5744
|
const o = n.replace("#", "");
|
|
5746
5745
|
return o.length === 3 ? "FF" + o.split("").map((e) => e + e).join("") : o.length === 6 ? "FF" + o : "FF" + o.padEnd(6, "0");
|
|
5747
5746
|
}
|
|
@@ -6056,21 +6055,21 @@ function xl(n) {
|
|
|
6056
6055
|
} = o, a = de(() => {
|
|
6057
6056
|
if (l)
|
|
6058
6057
|
return qi(e, l);
|
|
6059
|
-
}, [e]), s = ne(null),
|
|
6060
|
-
|
|
6061
|
-
}, [e, i, l]),
|
|
6062
|
-
(
|
|
6063
|
-
|
|
6058
|
+
}, [e]), s = ne(null), g = ne(null), u = F(() => {
|
|
6059
|
+
g.current && l && Ji(e, g.current, i, l);
|
|
6060
|
+
}, [e, i, l]), h = F(
|
|
6061
|
+
(c) => {
|
|
6062
|
+
g.current = c, s.current && clearTimeout(s.current), s.current = setTimeout(u, r);
|
|
6064
6063
|
},
|
|
6065
|
-
[
|
|
6064
|
+
[u, r]
|
|
6066
6065
|
);
|
|
6067
6066
|
ee(() => () => {
|
|
6068
|
-
s.current && (clearTimeout(s.current),
|
|
6069
|
-
}, [
|
|
6070
|
-
const m =
|
|
6067
|
+
s.current && (clearTimeout(s.current), u());
|
|
6068
|
+
}, [u]);
|
|
6069
|
+
const m = F(() => {
|
|
6071
6070
|
l && l.removeItem(e);
|
|
6072
6071
|
}, [e, l]);
|
|
6073
|
-
return { initialState: a, onStateChange:
|
|
6072
|
+
return { initialState: a, onStateChange: h, clearState: m };
|
|
6074
6073
|
}
|
|
6075
6074
|
export {
|
|
6076
6075
|
Sn as Button,
|