react-open-source-grid 1.7.16 → 1.7.17
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/dist/assets/index-BzDbdtZY.css +1 -0
- package/dist/assets/{index-yNQpV202.js → index-DbTnZTkL.js} +279 -131
- package/dist/assets/index.js +1 -1
- package/dist/assets/{layoutPersistence-DKb0Rxme.js → layoutPersistence-BomhL2-B.js} +1 -1
- package/dist/index.html +2 -2
- package/dist/lib/components/DataGrid/ColumnFilters.d.ts +3 -1
- package/dist/lib/components/DataGrid/DetailRow.d.ts +19 -0
- package/dist/lib/components/DataGrid/GridBody.d.ts +3 -1
- package/dist/lib/components/DataGrid/GridHeader.d.ts +3 -1
- package/dist/lib/components/DataGrid/MasterDetailCell.d.ts +14 -0
- package/dist/lib/components/DataGrid/index.d.ts +1 -1
- package/dist/lib/components/DataGrid/types.d.ts +36 -0
- package/dist/lib/components/MasterDetailDemo.d.ts +2 -0
- package/dist/lib/index.cjs +932 -693
- package/dist/lib/index.css +103 -0
- package/dist/lib/index.js +679 -440
- package/package.json +1 -1
- package/dist/assets/index-B400HUc-.css +0 -1
package/dist/lib/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-FG3FLQAE.js";
|
|
11
11
|
|
|
12
12
|
// src/components/DataGrid/DataGrid.tsx
|
|
13
|
-
import
|
|
13
|
+
import React22, { useReducer, useMemo as useMemo4, useEffect as useEffect9, useCallback as useCallback7, useRef as useRef10, useState as useState14, forwardRef, useImperativeHandle } from "react";
|
|
14
14
|
|
|
15
15
|
// src/components/DataGrid/gridReducer.ts
|
|
16
16
|
var createInitialState = (columns, pageSize = 10) => {
|
|
@@ -52,7 +52,10 @@ var createInitialState = (columns, pageSize = 10) => {
|
|
|
52
52
|
dropPosition: null
|
|
53
53
|
},
|
|
54
54
|
pinnedRowsTop: [],
|
|
55
|
-
pinnedRowsBottom: []
|
|
55
|
+
pinnedRowsBottom: [],
|
|
56
|
+
detailRowState: {
|
|
57
|
+
expandedMasterRows: {}
|
|
58
|
+
}
|
|
56
59
|
};
|
|
57
60
|
};
|
|
58
61
|
var gridReducer = (state, action) => {
|
|
@@ -463,6 +466,55 @@ var gridReducer = (state, action) => {
|
|
|
463
466
|
pinnedRowsBottom: state.pinnedRowsBottom.filter((id) => id !== rowId)
|
|
464
467
|
};
|
|
465
468
|
}
|
|
469
|
+
case "TOGGLE_MASTER_ROW": {
|
|
470
|
+
const rowId = action.payload;
|
|
471
|
+
const currentExpanded = state.detailRowState.expandedMasterRows[String(rowId)] || false;
|
|
472
|
+
return {
|
|
473
|
+
...state,
|
|
474
|
+
detailRowState: {
|
|
475
|
+
...state.detailRowState,
|
|
476
|
+
expandedMasterRows: {
|
|
477
|
+
...state.detailRowState.expandedMasterRows,
|
|
478
|
+
[String(rowId)]: !currentExpanded
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
case "EXPAND_MASTER_ROW": {
|
|
484
|
+
const rowId = action.payload;
|
|
485
|
+
return {
|
|
486
|
+
...state,
|
|
487
|
+
detailRowState: {
|
|
488
|
+
...state.detailRowState,
|
|
489
|
+
expandedMasterRows: {
|
|
490
|
+
...state.detailRowState.expandedMasterRows,
|
|
491
|
+
[String(rowId)]: true
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
case "COLLAPSE_MASTER_ROW": {
|
|
497
|
+
const rowId = action.payload;
|
|
498
|
+
return {
|
|
499
|
+
...state,
|
|
500
|
+
detailRowState: {
|
|
501
|
+
...state.detailRowState,
|
|
502
|
+
expandedMasterRows: {
|
|
503
|
+
...state.detailRowState.expandedMasterRows,
|
|
504
|
+
[String(rowId)]: false
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
case "SET_EXPANDED_MASTER_ROWS": {
|
|
510
|
+
return {
|
|
511
|
+
...state,
|
|
512
|
+
detailRowState: {
|
|
513
|
+
...state.detailRowState,
|
|
514
|
+
expandedMasterRows: action.payload
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
}
|
|
466
518
|
case "SET_ROW_DATA": {
|
|
467
519
|
return { ...state };
|
|
468
520
|
}
|
|
@@ -483,6 +535,8 @@ var GridHeader = ({
|
|
|
483
535
|
pinnedLeft,
|
|
484
536
|
pinnedRight,
|
|
485
537
|
showColumnPinning,
|
|
538
|
+
masterDetailConfig,
|
|
539
|
+
dragRowConfig,
|
|
486
540
|
onContextMenu
|
|
487
541
|
}) => {
|
|
488
542
|
const [draggedColumn, setDraggedColumn] = useState(null);
|
|
@@ -593,7 +647,38 @@ var GridHeader = ({
|
|
|
593
647
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
594
648
|
};
|
|
595
649
|
}, [resizingColumn, resizeStartX, resizeStartWidth, dispatch]);
|
|
596
|
-
return /* @__PURE__ */ React.createElement("div", { ref: headerRef, style: { borderBottom: "var(--grid-border-width, 1px) solid var(--grid-border)", width: "100%", backgroundColor: "var(--grid-header-bg)" } }, /* @__PURE__ */ React.createElement("div", { role: "row", style: { display: "flex", minWidth: "100%", backgroundColor: "var(--grid-header-bg)" } },
|
|
650
|
+
return /* @__PURE__ */ React.createElement("div", { ref: headerRef, style: { borderBottom: "var(--grid-border-width, 1px) solid var(--grid-border)", width: "100%", backgroundColor: "var(--grid-header-bg)" } }, /* @__PURE__ */ React.createElement("div", { role: "row", style: { display: "flex", minWidth: "100%", backgroundColor: "var(--grid-header-bg)" } }, (masterDetailConfig == null ? void 0 : masterDetailConfig.enabled) && /* @__PURE__ */ React.createElement(
|
|
651
|
+
"div",
|
|
652
|
+
{
|
|
653
|
+
role: "columnheader",
|
|
654
|
+
style: {
|
|
655
|
+
width: "48px",
|
|
656
|
+
flexShrink: 0,
|
|
657
|
+
borderRight: "var(--grid-border-width, 1px) solid var(--grid-border)",
|
|
658
|
+
backgroundColor: "var(--grid-header-bg)",
|
|
659
|
+
display: "flex",
|
|
660
|
+
alignItems: "center",
|
|
661
|
+
justifyContent: "center"
|
|
662
|
+
}
|
|
663
|
+
},
|
|
664
|
+
/* @__PURE__ */ React.createElement("div", { style: {
|
|
665
|
+
padding: "var(--grid-header-padding, 10px 12px)",
|
|
666
|
+
fontWeight: "var(--grid-header-font-weight, 600)",
|
|
667
|
+
fontSize: "var(--grid-font-size, 13px)",
|
|
668
|
+
color: "var(--grid-header-text)"
|
|
669
|
+
} })
|
|
670
|
+
), (dragRowConfig == null ? void 0 : dragRowConfig.enabled) && dragRowConfig.showDragHandle !== false && dragRowConfig.dragHandlePosition === "left" && /* @__PURE__ */ React.createElement(
|
|
671
|
+
"div",
|
|
672
|
+
{
|
|
673
|
+
role: "columnheader",
|
|
674
|
+
style: {
|
|
675
|
+
width: "32px",
|
|
676
|
+
flexShrink: 0,
|
|
677
|
+
borderRight: "var(--grid-border-width, 1px) solid var(--grid-border)",
|
|
678
|
+
backgroundColor: "var(--grid-header-bg)"
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
), displayColumnOrder.map((field, colIndex) => {
|
|
597
682
|
const column = columnMap.get(field);
|
|
598
683
|
if (!column) return null;
|
|
599
684
|
const isSorted = sortConfig.field === field;
|
|
@@ -757,7 +842,7 @@ var GridHeader = ({
|
|
|
757
842
|
};
|
|
758
843
|
|
|
759
844
|
// src/components/DataGrid/GridBody.tsx
|
|
760
|
-
import
|
|
845
|
+
import React8, { useRef as useRef4, useEffect as useEffect2 } from "react";
|
|
761
846
|
|
|
762
847
|
// src/components/DataGrid/GroupRow.tsx
|
|
763
848
|
import React2 from "react";
|
|
@@ -1950,6 +2035,55 @@ var DraggableRow = ({
|
|
|
1950
2035
|
);
|
|
1951
2036
|
};
|
|
1952
2037
|
|
|
2038
|
+
// src/components/DataGrid/MasterDetailCell.tsx
|
|
2039
|
+
import React6 from "react";
|
|
2040
|
+
var MasterDetailCell = ({
|
|
2041
|
+
row: _row,
|
|
2042
|
+
isExpanded,
|
|
2043
|
+
isMasterRow,
|
|
2044
|
+
onToggle
|
|
2045
|
+
}) => {
|
|
2046
|
+
if (!isMasterRow) {
|
|
2047
|
+
return /* @__PURE__ */ React6.createElement("div", { className: "master-detail-cell-empty" });
|
|
2048
|
+
}
|
|
2049
|
+
return /* @__PURE__ */ React6.createElement("div", { className: "master-detail-cell" }, /* @__PURE__ */ React6.createElement(
|
|
2050
|
+
"button",
|
|
2051
|
+
{
|
|
2052
|
+
type: "button",
|
|
2053
|
+
className: "master-detail-toggle",
|
|
2054
|
+
onClick: (e) => {
|
|
2055
|
+
e.stopPropagation();
|
|
2056
|
+
onToggle();
|
|
2057
|
+
},
|
|
2058
|
+
"aria-label": isExpanded ? "Collapse detail row" : "Expand detail row",
|
|
2059
|
+
"aria-expanded": isExpanded
|
|
2060
|
+
},
|
|
2061
|
+
/* @__PURE__ */ React6.createElement("span", { className: `master-detail-icon ${isExpanded ? "expanded" : "collapsed"}` }, isExpanded ? "\u25BC" : "\u25B6")
|
|
2062
|
+
));
|
|
2063
|
+
};
|
|
2064
|
+
|
|
2065
|
+
// src/components/DataGrid/DetailRow.tsx
|
|
2066
|
+
import React7 from "react";
|
|
2067
|
+
var DetailRow = ({
|
|
2068
|
+
masterRow,
|
|
2069
|
+
rowIndex,
|
|
2070
|
+
renderDetailRow,
|
|
2071
|
+
columnCount,
|
|
2072
|
+
detailRowHeight = 200,
|
|
2073
|
+
detailRowAutoHeight = false
|
|
2074
|
+
}) => {
|
|
2075
|
+
const style = detailRowAutoHeight ? { minHeight: detailRowHeight } : { height: detailRowHeight };
|
|
2076
|
+
return /* @__PURE__ */ React7.createElement("tr", { className: "detail-row-wrapper" }, /* @__PURE__ */ React7.createElement(
|
|
2077
|
+
"td",
|
|
2078
|
+
{
|
|
2079
|
+
className: "detail-row-cell",
|
|
2080
|
+
colSpan: columnCount,
|
|
2081
|
+
style: { padding: 0 }
|
|
2082
|
+
},
|
|
2083
|
+
/* @__PURE__ */ React7.createElement("div", { className: "detail-row", style }, /* @__PURE__ */ React7.createElement("div", { className: "detail-row-content" }, renderDetailRow({ masterRow, rowIndex })))
|
|
2084
|
+
));
|
|
2085
|
+
};
|
|
2086
|
+
|
|
1953
2087
|
// src/components/DataGrid/GridBody.tsx
|
|
1954
2088
|
var GridBody = ({
|
|
1955
2089
|
columns,
|
|
@@ -1973,6 +2107,8 @@ var GridBody = ({
|
|
|
1973
2107
|
virtualScrollConfig,
|
|
1974
2108
|
treeConfig,
|
|
1975
2109
|
dragRowConfig,
|
|
2110
|
+
masterDetailConfig,
|
|
2111
|
+
expandedMasterRows = {},
|
|
1976
2112
|
tableId,
|
|
1977
2113
|
onRowReorder,
|
|
1978
2114
|
onScroll,
|
|
@@ -2222,7 +2358,7 @@ var GridBody = ({
|
|
|
2222
2358
|
const renderRowContent = (row, rowIndex, style) => {
|
|
2223
2359
|
if (isGroupedRow(row)) {
|
|
2224
2360
|
const groupAgg = groupAggregates.get(row.groupKey) || {};
|
|
2225
|
-
return /* @__PURE__ */
|
|
2361
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, { key: row.groupKey }, /* @__PURE__ */ React8.createElement(
|
|
2226
2362
|
GroupRow,
|
|
2227
2363
|
{
|
|
2228
2364
|
group: row,
|
|
@@ -2234,7 +2370,7 @@ var GridBody = ({
|
|
|
2234
2370
|
pinnedLeft,
|
|
2235
2371
|
pinnedRight
|
|
2236
2372
|
}
|
|
2237
|
-
), showGroupFooters && row.isExpanded && aggregateConfigs.length > 0 && /* @__PURE__ */
|
|
2373
|
+
), showGroupFooters && row.isExpanded && aggregateConfigs.length > 0 && /* @__PURE__ */ React8.createElement(
|
|
2238
2374
|
GroupFooterRow,
|
|
2239
2375
|
{
|
|
2240
2376
|
group: row,
|
|
@@ -2249,7 +2385,7 @@ var GridBody = ({
|
|
|
2249
2385
|
));
|
|
2250
2386
|
}
|
|
2251
2387
|
if ((treeConfig == null ? void 0 : treeConfig.enabled) && isTreeNode(row)) {
|
|
2252
|
-
return /* @__PURE__ */
|
|
2388
|
+
return /* @__PURE__ */ React8.createElement(
|
|
2253
2389
|
TreeRow,
|
|
2254
2390
|
{
|
|
2255
2391
|
key: row.id,
|
|
@@ -2278,7 +2414,7 @@ var GridBody = ({
|
|
|
2278
2414
|
const isDragEnabled = (dragRowConfig == null ? void 0 : dragRowConfig.enabled) && !isLoadingRow;
|
|
2279
2415
|
const showDragHandle = isDragEnabled && dragRowConfig.showDragHandle !== false;
|
|
2280
2416
|
const handlePosition = (dragRowConfig == null ? void 0 : dragRowConfig.dragHandlePosition) || "left";
|
|
2281
|
-
const rowContent = /* @__PURE__ */
|
|
2417
|
+
const rowContent = /* @__PURE__ */ React8.createElement(
|
|
2282
2418
|
"div",
|
|
2283
2419
|
{
|
|
2284
2420
|
key: row.id,
|
|
@@ -2299,7 +2435,39 @@ var GridBody = ({
|
|
|
2299
2435
|
onMouseLeave: (e) => !isSelected && !isLoadingRow && (e.currentTarget.style.backgroundColor = "var(--grid-bg)"),
|
|
2300
2436
|
onClick: (e) => !isLoadingRow && handleRowClick(row, rowIndex, e)
|
|
2301
2437
|
},
|
|
2302
|
-
|
|
2438
|
+
(masterDetailConfig == null ? void 0 : masterDetailConfig.enabled) && /* @__PURE__ */ React8.createElement(
|
|
2439
|
+
"div",
|
|
2440
|
+
{
|
|
2441
|
+
style: {
|
|
2442
|
+
width: "48px",
|
|
2443
|
+
display: "flex",
|
|
2444
|
+
alignItems: "center",
|
|
2445
|
+
justifyContent: "center",
|
|
2446
|
+
flexShrink: 0,
|
|
2447
|
+
borderRight: "var(--grid-border-width, 1px) solid var(--grid-border)"
|
|
2448
|
+
}
|
|
2449
|
+
},
|
|
2450
|
+
/* @__PURE__ */ React8.createElement(
|
|
2451
|
+
MasterDetailCell,
|
|
2452
|
+
{
|
|
2453
|
+
row,
|
|
2454
|
+
isExpanded: expandedMasterRows[String(row.id)] || false,
|
|
2455
|
+
isMasterRow: masterDetailConfig.isRowMaster ? masterDetailConfig.isRowMaster(row) : true,
|
|
2456
|
+
onToggle: () => {
|
|
2457
|
+
dispatch({ type: "TOGGLE_MASTER_ROW", payload: row.id });
|
|
2458
|
+
if (masterDetailConfig.onDetailRowToggled) {
|
|
2459
|
+
const isCurrentlyExpanded = expandedMasterRows[String(row.id)] || false;
|
|
2460
|
+
masterDetailConfig.onDetailRowToggled({
|
|
2461
|
+
masterRow: row,
|
|
2462
|
+
rowIndex,
|
|
2463
|
+
isOpen: !isCurrentlyExpanded
|
|
2464
|
+
});
|
|
2465
|
+
}
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2468
|
+
)
|
|
2469
|
+
),
|
|
2470
|
+
showDragHandle && handlePosition === "left" && /* @__PURE__ */ React8.createElement(
|
|
2303
2471
|
"div",
|
|
2304
2472
|
{
|
|
2305
2473
|
style: {
|
|
@@ -2322,7 +2490,7 @@ var GridBody = ({
|
|
|
2322
2490
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
2323
2491
|
}
|
|
2324
2492
|
},
|
|
2325
|
-
/* @__PURE__ */
|
|
2493
|
+
/* @__PURE__ */ React8.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React8.createElement("circle", { cx: "7", cy: "5", r: "1.5" }), /* @__PURE__ */ React8.createElement("circle", { cx: "13", cy: "5", r: "1.5" }), /* @__PURE__ */ React8.createElement("circle", { cx: "7", cy: "10", r: "1.5" }), /* @__PURE__ */ React8.createElement("circle", { cx: "13", cy: "10", r: "1.5" }), /* @__PURE__ */ React8.createElement("circle", { cx: "7", cy: "15", r: "1.5" }), /* @__PURE__ */ React8.createElement("circle", { cx: "13", cy: "15", r: "1.5" }))
|
|
2326
2494
|
),
|
|
2327
2495
|
displayColumnOrder.map((field, columnIndex) => {
|
|
2328
2496
|
const column = columnMap.get(field);
|
|
@@ -2331,7 +2499,7 @@ var GridBody = ({
|
|
|
2331
2499
|
const isEditing = editState.rowId === row.id && editState.field === field;
|
|
2332
2500
|
const isCellFocused = (focusState == null ? void 0 : focusState.rowIndex) === rowIndex && (focusState == null ? void 0 : focusState.columnIndex) === columnIndex;
|
|
2333
2501
|
const cellStyle = getPinnedCellStyle(field);
|
|
2334
|
-
return /* @__PURE__ */
|
|
2502
|
+
return /* @__PURE__ */ React8.createElement(
|
|
2335
2503
|
"div",
|
|
2336
2504
|
{
|
|
2337
2505
|
key: `${row.id}-${field}`,
|
|
@@ -2365,7 +2533,7 @@ var GridBody = ({
|
|
|
2365
2533
|
onCancel: () => dispatch({ type: "END_EDIT" }),
|
|
2366
2534
|
autoFocus: true,
|
|
2367
2535
|
...column.editorParams
|
|
2368
|
-
}) : /* @__PURE__ */
|
|
2536
|
+
}) : /* @__PURE__ */ React8.createElement(
|
|
2369
2537
|
"input",
|
|
2370
2538
|
{
|
|
2371
2539
|
ref: editInputRef,
|
|
@@ -2394,13 +2562,13 @@ var GridBody = ({
|
|
|
2394
2562
|
}
|
|
2395
2563
|
}
|
|
2396
2564
|
}
|
|
2397
|
-
) : /* @__PURE__ */
|
|
2565
|
+
) : /* @__PURE__ */ React8.createElement("div", { style: {
|
|
2398
2566
|
overflow: "hidden",
|
|
2399
2567
|
textOverflow: "ellipsis",
|
|
2400
2568
|
whiteSpace: "nowrap",
|
|
2401
2569
|
display: "block",
|
|
2402
2570
|
color: isLoadingRow ? "var(--grid-text-secondary)" : "var(--grid-text)"
|
|
2403
|
-
} }, isLoadingRow ? /* @__PURE__ */
|
|
2571
|
+
} }, isLoadingRow ? /* @__PURE__ */ React8.createElement("span", { style: {
|
|
2404
2572
|
display: "inline-block",
|
|
2405
2573
|
width: "80%",
|
|
2406
2574
|
height: "12px",
|
|
@@ -2410,7 +2578,7 @@ var GridBody = ({
|
|
|
2410
2578
|
} }) : column.renderCell ? column.renderCell(row) : cellValue ?? "")
|
|
2411
2579
|
);
|
|
2412
2580
|
}),
|
|
2413
|
-
showDragHandle && handlePosition === "right" && /* @__PURE__ */
|
|
2581
|
+
showDragHandle && handlePosition === "right" && /* @__PURE__ */ React8.createElement(
|
|
2414
2582
|
"div",
|
|
2415
2583
|
{
|
|
2416
2584
|
style: {
|
|
@@ -2433,11 +2601,11 @@ var GridBody = ({
|
|
|
2433
2601
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
2434
2602
|
}
|
|
2435
2603
|
},
|
|
2436
|
-
/* @__PURE__ */
|
|
2604
|
+
/* @__PURE__ */ React8.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React8.createElement("circle", { cx: "7", cy: "5", r: "1.5" }), /* @__PURE__ */ React8.createElement("circle", { cx: "13", cy: "5", r: "1.5" }), /* @__PURE__ */ React8.createElement("circle", { cx: "7", cy: "10", r: "1.5" }), /* @__PURE__ */ React8.createElement("circle", { cx: "13", cy: "10", r: "1.5" }), /* @__PURE__ */ React8.createElement("circle", { cx: "7", cy: "15", r: "1.5" }), /* @__PURE__ */ React8.createElement("circle", { cx: "13", cy: "15", r: "1.5" }))
|
|
2437
2605
|
)
|
|
2438
2606
|
);
|
|
2439
2607
|
if ((dragRowConfig == null ? void 0 : dragRowConfig.enabled) && !isLoadingRow) {
|
|
2440
|
-
return /* @__PURE__ */
|
|
2608
|
+
return /* @__PURE__ */ React8.createElement(
|
|
2441
2609
|
DraggableRow,
|
|
2442
2610
|
{
|
|
2443
2611
|
key: row.id,
|
|
@@ -2456,11 +2624,11 @@ var GridBody = ({
|
|
|
2456
2624
|
};
|
|
2457
2625
|
const renderPinnedTopRows = () => {
|
|
2458
2626
|
if (pinnedRowsTop.length === 0) return null;
|
|
2459
|
-
return /* @__PURE__ */
|
|
2627
|
+
return /* @__PURE__ */ React8.createElement("div", { style: { position: "sticky", top: 0, zIndex: 15, backgroundColor: "var(--grid-bg)" } }, pinnedRowsTop.map((row, rowIndex) => renderRowContent(row, rowIndex)));
|
|
2460
2628
|
};
|
|
2461
2629
|
const renderPinnedBottomRows = () => {
|
|
2462
2630
|
if (pinnedRowsBottom.length === 0) return null;
|
|
2463
|
-
return /* @__PURE__ */
|
|
2631
|
+
return /* @__PURE__ */ React8.createElement("div", { style: { position: "sticky", bottom: 0, zIndex: 15, backgroundColor: "var(--grid-bg)" } }, pinnedRowsBottom.map((row, rowIndex) => renderRowContent(row, rowIndex + rows.length + pinnedRowsTop.length)));
|
|
2464
2632
|
};
|
|
2465
2633
|
if (virtualScrollConfig == null ? void 0 : virtualScrollConfig.enabled) {
|
|
2466
2634
|
const virtualColumns = displayColumnOrder.map((field) => ({
|
|
@@ -2469,7 +2637,7 @@ var GridBody = ({
|
|
|
2469
2637
|
}));
|
|
2470
2638
|
const totalColumnWidth = virtualColumns.reduce((sum, col) => sum + col.width, 0);
|
|
2471
2639
|
const enableColumnVirtualization = virtualScrollConfig.enableColumnVirtualization ?? true;
|
|
2472
|
-
return /* @__PURE__ */
|
|
2640
|
+
return /* @__PURE__ */ React8.createElement("div", { ref: bodyRef, role: "rowgroup", style: { position: "relative", flex: 1, display: "flex", flexDirection: "column", width: "100%", backgroundColor: "var(--grid-bg)" } }, renderPinnedTopRows(), /* @__PURE__ */ React8.createElement(
|
|
2473
2641
|
VirtualScroller,
|
|
2474
2642
|
{
|
|
2475
2643
|
items: rows,
|
|
@@ -2487,7 +2655,7 @@ var GridBody = ({
|
|
|
2487
2655
|
}
|
|
2488
2656
|
const isSelected = selectedRows.has(row.id);
|
|
2489
2657
|
const isFocused = (focusState == null ? void 0 : focusState.rowIndex) === index;
|
|
2490
|
-
return /* @__PURE__ */
|
|
2658
|
+
return /* @__PURE__ */ React8.createElement(
|
|
2491
2659
|
"div",
|
|
2492
2660
|
{
|
|
2493
2661
|
role: "row",
|
|
@@ -2518,7 +2686,7 @@ var GridBody = ({
|
|
|
2518
2686
|
const cellValue = row[field];
|
|
2519
2687
|
const isEditing = editState.rowId === row.id && editState.field === field;
|
|
2520
2688
|
const isCellFocused = (focusState == null ? void 0 : focusState.rowIndex) === index && (focusState == null ? void 0 : focusState.columnIndex) === displayColumnOrder.indexOf(field);
|
|
2521
|
-
return /* @__PURE__ */
|
|
2689
|
+
return /* @__PURE__ */ React8.createElement(
|
|
2522
2690
|
"div",
|
|
2523
2691
|
{
|
|
2524
2692
|
key: `${row.id}-${field}`,
|
|
@@ -2545,7 +2713,7 @@ var GridBody = ({
|
|
|
2545
2713
|
onKeyDown: (e) => handleKeyDown(e, index, columnIndex),
|
|
2546
2714
|
tabIndex: isCellFocused ? 0 : -1
|
|
2547
2715
|
},
|
|
2548
|
-
isEditing ? /* @__PURE__ */
|
|
2716
|
+
isEditing ? /* @__PURE__ */ React8.createElement(
|
|
2549
2717
|
"input",
|
|
2550
2718
|
{
|
|
2551
2719
|
ref: editInputRef,
|
|
@@ -2564,7 +2732,7 @@ var GridBody = ({
|
|
|
2564
2732
|
}
|
|
2565
2733
|
}
|
|
2566
2734
|
}
|
|
2567
|
-
) : /* @__PURE__ */
|
|
2735
|
+
) : /* @__PURE__ */ React8.createElement("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", display: "block" } }, cellValue ?? "")
|
|
2568
2736
|
);
|
|
2569
2737
|
})
|
|
2570
2738
|
);
|
|
@@ -2572,11 +2740,44 @@ var GridBody = ({
|
|
|
2572
2740
|
}
|
|
2573
2741
|
), renderPinnedBottomRows());
|
|
2574
2742
|
}
|
|
2575
|
-
|
|
2743
|
+
const renderRowsWithDetails = () => {
|
|
2744
|
+
const elements = [];
|
|
2745
|
+
rows.forEach((row, rowIndex) => {
|
|
2746
|
+
const rowId = isGroupedRow(row) ? row.groupKey : row.id;
|
|
2747
|
+
elements.push(
|
|
2748
|
+
/* @__PURE__ */ React8.createElement(React8.Fragment, { key: `row-${rowId}` }, renderRowContent(row, rowIndex + pinnedRowsTop.length))
|
|
2749
|
+
);
|
|
2750
|
+
if ((masterDetailConfig == null ? void 0 : masterDetailConfig.enabled) && !isGroupedRow(row) && !isTreeNode(row)) {
|
|
2751
|
+
const isMasterRow = masterDetailConfig.isRowMaster ? masterDetailConfig.isRowMaster(row) : true;
|
|
2752
|
+
const isExpanded = expandedMasterRows[String(row.id)] || false;
|
|
2753
|
+
if (isMasterRow && isExpanded) {
|
|
2754
|
+
let columnCount = displayColumnOrder.length;
|
|
2755
|
+
if (masterDetailConfig == null ? void 0 : masterDetailConfig.enabled) columnCount += 1;
|
|
2756
|
+
if ((dragRowConfig == null ? void 0 : dragRowConfig.enabled) && dragRowConfig.showDragHandle !== false) columnCount += 1;
|
|
2757
|
+
elements.push(
|
|
2758
|
+
/* @__PURE__ */ React8.createElement(
|
|
2759
|
+
DetailRow,
|
|
2760
|
+
{
|
|
2761
|
+
key: `detail-${row.id}`,
|
|
2762
|
+
masterRow: row,
|
|
2763
|
+
rowIndex,
|
|
2764
|
+
renderDetailRow: masterDetailConfig.renderDetailRow,
|
|
2765
|
+
columnCount,
|
|
2766
|
+
detailRowHeight: masterDetailConfig.detailRowHeight,
|
|
2767
|
+
detailRowAutoHeight: masterDetailConfig.detailRowAutoHeight
|
|
2768
|
+
}
|
|
2769
|
+
)
|
|
2770
|
+
);
|
|
2771
|
+
}
|
|
2772
|
+
}
|
|
2773
|
+
});
|
|
2774
|
+
return elements;
|
|
2775
|
+
};
|
|
2776
|
+
return /* @__PURE__ */ React8.createElement("div", { ref: bodyRef, role: "rowgroup", style: { overflow: "auto", maxHeight: "500px", position: "relative", backgroundColor: "var(--grid-bg)", width: "100%" } }, renderPinnedTopRows(), (masterDetailConfig == null ? void 0 : masterDetailConfig.enabled) ? renderRowsWithDetails() : rows.map((row, rowIndex) => renderRowContent(row, rowIndex + pinnedRowsTop.length)), renderPinnedBottomRows());
|
|
2576
2777
|
};
|
|
2577
2778
|
|
|
2578
2779
|
// src/components/DataGrid/GridPagination.tsx
|
|
2579
|
-
import
|
|
2780
|
+
import React9 from "react";
|
|
2580
2781
|
var GridPagination = ({
|
|
2581
2782
|
currentPage,
|
|
2582
2783
|
pageSize,
|
|
@@ -2618,7 +2819,7 @@ var GridPagination = ({
|
|
|
2618
2819
|
}
|
|
2619
2820
|
return pages;
|
|
2620
2821
|
};
|
|
2621
|
-
return /* @__PURE__ */
|
|
2822
|
+
return /* @__PURE__ */ React9.createElement("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", paddingLeft: "16px", paddingRight: "16px", paddingTop: "12px", paddingBottom: "12px", backgroundColor: "var(--grid-footer-bg)", borderTop: "var(--grid-border-width, 1px) solid var(--grid-border)" } }, /* @__PURE__ */ React9.createElement("div", { style: { display: "flex", alignItems: "center", gap: "12px" } }, /* @__PURE__ */ React9.createElement("span", { style: { fontSize: "var(--grid-font-size, 13px)", color: "var(--grid-text)", fontWeight: "500" } }, "Rows per page:"), /* @__PURE__ */ React9.createElement(
|
|
2622
2823
|
"select",
|
|
2623
2824
|
{
|
|
2624
2825
|
style: {
|
|
@@ -2645,10 +2846,10 @@ var GridPagination = ({
|
|
|
2645
2846
|
e.target.style.boxShadow = "none";
|
|
2646
2847
|
}
|
|
2647
2848
|
},
|
|
2648
|
-
/* @__PURE__ */
|
|
2649
|
-
/* @__PURE__ */
|
|
2650
|
-
/* @__PURE__ */
|
|
2651
|
-
)), /* @__PURE__ */
|
|
2849
|
+
/* @__PURE__ */ React9.createElement("option", { value: 10 }, "10"),
|
|
2850
|
+
/* @__PURE__ */ React9.createElement("option", { value: 20 }, "20"),
|
|
2851
|
+
/* @__PURE__ */ React9.createElement("option", { value: 50 }, "50")
|
|
2852
|
+
)), /* @__PURE__ */ React9.createElement("div", { style: { fontSize: "var(--grid-font-size, 13px)", color: "var(--grid-text-secondary)", fontWeight: "500" } }, totalRows === 0 ? "No rows" : /* @__PURE__ */ React9.createElement(React9.Fragment, null, startRow, "-", endRow, " of ", totalRows)), /* @__PURE__ */ React9.createElement("div", { style: { display: "flex", alignItems: "center", gap: "3px" } }, /* @__PURE__ */ React9.createElement(
|
|
2652
2853
|
"button",
|
|
2653
2854
|
{
|
|
2654
2855
|
style: {
|
|
@@ -2671,7 +2872,7 @@ var GridPagination = ({
|
|
|
2671
2872
|
title: "First page"
|
|
2672
2873
|
},
|
|
2673
2874
|
"\u27EA"
|
|
2674
|
-
), /* @__PURE__ */
|
|
2875
|
+
), /* @__PURE__ */ React9.createElement(
|
|
2675
2876
|
"button",
|
|
2676
2877
|
{
|
|
2677
2878
|
style: {
|
|
@@ -2696,10 +2897,10 @@ var GridPagination = ({
|
|
|
2696
2897
|
"\u2039"
|
|
2697
2898
|
), getPageNumbers().map((page, index) => {
|
|
2698
2899
|
if (page === "...") {
|
|
2699
|
-
return /* @__PURE__ */
|
|
2900
|
+
return /* @__PURE__ */ React9.createElement("span", { key: `ellipsis-${index}`, style: { paddingLeft: "8px", paddingRight: "8px", paddingTop: "6px", paddingBottom: "6px", fontSize: "var(--grid-font-size, 13px)", color: "var(--grid-text-secondary)" } }, "...");
|
|
2700
2901
|
}
|
|
2701
2902
|
const isCurrentPage = currentPage === page;
|
|
2702
|
-
return /* @__PURE__ */
|
|
2903
|
+
return /* @__PURE__ */ React9.createElement(
|
|
2703
2904
|
"button",
|
|
2704
2905
|
{
|
|
2705
2906
|
key: page,
|
|
@@ -2722,7 +2923,7 @@ var GridPagination = ({
|
|
|
2722
2923
|
},
|
|
2723
2924
|
page + 1
|
|
2724
2925
|
);
|
|
2725
|
-
}), /* @__PURE__ */
|
|
2926
|
+
}), /* @__PURE__ */ React9.createElement(
|
|
2726
2927
|
"button",
|
|
2727
2928
|
{
|
|
2728
2929
|
style: {
|
|
@@ -2745,7 +2946,7 @@ var GridPagination = ({
|
|
|
2745
2946
|
title: "Next page"
|
|
2746
2947
|
},
|
|
2747
2948
|
"\u203A"
|
|
2748
|
-
), /* @__PURE__ */
|
|
2949
|
+
), /* @__PURE__ */ React9.createElement(
|
|
2749
2950
|
"button",
|
|
2750
2951
|
{
|
|
2751
2952
|
style: {
|
|
@@ -2772,7 +2973,7 @@ var GridPagination = ({
|
|
|
2772
2973
|
};
|
|
2773
2974
|
|
|
2774
2975
|
// src/components/DataGrid/GroupByPanel.tsx
|
|
2775
|
-
import
|
|
2976
|
+
import React10, { useState as useState4 } from "react";
|
|
2776
2977
|
var GroupByPanel = ({
|
|
2777
2978
|
columns,
|
|
2778
2979
|
groupBy,
|
|
@@ -2822,7 +3023,7 @@ var GroupByPanel = ({
|
|
|
2822
3023
|
const handleClearAll = () => {
|
|
2823
3024
|
dispatch({ type: "CLEAR_GROUPS" });
|
|
2824
3025
|
};
|
|
2825
|
-
return /* @__PURE__ */
|
|
3026
|
+
return /* @__PURE__ */ React10.createElement(
|
|
2826
3027
|
"div",
|
|
2827
3028
|
{
|
|
2828
3029
|
style: {
|
|
@@ -2838,9 +3039,9 @@ var GroupByPanel = ({
|
|
|
2838
3039
|
onDragLeave: handleDragLeave,
|
|
2839
3040
|
onDrop: handleDrop
|
|
2840
3041
|
},
|
|
2841
|
-
/* @__PURE__ */
|
|
3042
|
+
/* @__PURE__ */ React10.createElement("div", { style: { display: "flex", alignItems: "center", gap: "8px", flexWrap: "wrap" } }, groupBy.length === 0 ? /* @__PURE__ */ React10.createElement("div", { style: { color: "var(--grid-text-secondary)", fontSize: "var(--grid-font-size, 13px)", display: "flex", alignItems: "center", gap: "8px", fontStyle: "italic" } }, "\u26A1 Drag columns here to group rows") : /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement("span", { style: { fontSize: "12px", color: "var(--grid-text-secondary)", fontWeight: "600", textTransform: "uppercase", letterSpacing: "0.5px" } }, "Group by:"), groupBy.map((field, index) => {
|
|
2842
3043
|
const column = columnMap.get(field);
|
|
2843
|
-
return /* @__PURE__ */
|
|
3044
|
+
return /* @__PURE__ */ React10.createElement(
|
|
2844
3045
|
"div",
|
|
2845
3046
|
{
|
|
2846
3047
|
key: field,
|
|
@@ -2875,9 +3076,9 @@ var GroupByPanel = ({
|
|
|
2875
3076
|
e.currentTarget.style.boxShadow = "var(--grid-shadow-light, 0 2px 4px rgba(0, 102, 204, 0.15))";
|
|
2876
3077
|
}
|
|
2877
3078
|
},
|
|
2878
|
-
index > 0 && /* @__PURE__ */
|
|
2879
|
-
/* @__PURE__ */
|
|
2880
|
-
/* @__PURE__ */
|
|
3079
|
+
index > 0 && /* @__PURE__ */ React10.createElement("span", { style: { color: "rgba(255, 255, 255, 0.7)", marginRight: "4px" } }, "?"),
|
|
3080
|
+
/* @__PURE__ */ React10.createElement("span", null, (column == null ? void 0 : column.headerName) || field),
|
|
3081
|
+
/* @__PURE__ */ React10.createElement(
|
|
2881
3082
|
"button",
|
|
2882
3083
|
{
|
|
2883
3084
|
onClick: () => handleRemoveGroup(field),
|
|
@@ -2899,7 +3100,7 @@ var GroupByPanel = ({
|
|
|
2899
3100
|
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "transparent",
|
|
2900
3101
|
title: "Remove grouping"
|
|
2901
3102
|
},
|
|
2902
|
-
/* @__PURE__ */
|
|
3103
|
+
/* @__PURE__ */ React10.createElement(
|
|
2903
3104
|
"svg",
|
|
2904
3105
|
{
|
|
2905
3106
|
style: { width: "12px", height: "12px" },
|
|
@@ -2907,7 +3108,7 @@ var GroupByPanel = ({
|
|
|
2907
3108
|
stroke: "currentColor",
|
|
2908
3109
|
viewBox: "0 0 24 24"
|
|
2909
3110
|
},
|
|
2910
|
-
/* @__PURE__ */
|
|
3111
|
+
/* @__PURE__ */ React10.createElement(
|
|
2911
3112
|
"path",
|
|
2912
3113
|
{
|
|
2913
3114
|
strokeLinecap: "round",
|
|
@@ -2919,7 +3120,7 @@ var GroupByPanel = ({
|
|
|
2919
3120
|
)
|
|
2920
3121
|
)
|
|
2921
3122
|
);
|
|
2922
|
-
}), /* @__PURE__ */
|
|
3123
|
+
}), /* @__PURE__ */ React10.createElement(
|
|
2923
3124
|
"button",
|
|
2924
3125
|
{
|
|
2925
3126
|
onClick: handleClearAll,
|
|
@@ -2950,7 +3151,7 @@ var GroupByPanel = ({
|
|
|
2950
3151
|
};
|
|
2951
3152
|
|
|
2952
3153
|
// src/components/DataGrid/GridFooter.tsx
|
|
2953
|
-
import
|
|
3154
|
+
import React11 from "react";
|
|
2954
3155
|
var GridFooter = ({
|
|
2955
3156
|
columns,
|
|
2956
3157
|
displayColumnOrder,
|
|
@@ -3002,26 +3203,26 @@ var GridFooter = ({
|
|
|
3002
3203
|
const isFirstColumn = (field) => {
|
|
3003
3204
|
return displayColumnOrder[0] === field;
|
|
3004
3205
|
};
|
|
3005
|
-
return /* @__PURE__ */
|
|
3206
|
+
return /* @__PURE__ */ React11.createElement("div", { style: { display: "flex", minWidth: "100%", borderTop: "2px solid var(--grid-border)", backgroundColor: "var(--grid-footer-bg)", fontWeight: "var(--grid-header-font-weight, 600)" } }, displayColumnOrder.map((field, columnIndex) => {
|
|
3006
3207
|
const column = columnMap.get(field);
|
|
3007
3208
|
if (!column) return null;
|
|
3008
3209
|
const cellStyle = getPinnedCellStyle(field);
|
|
3009
3210
|
const configs = fieldAggregateMap.get(field);
|
|
3010
3211
|
let cellContent;
|
|
3011
3212
|
if (isFirstColumn(field) && columnIndex === 0) {
|
|
3012
|
-
cellContent = /* @__PURE__ */
|
|
3213
|
+
cellContent = /* @__PURE__ */ React11.createElement("span", { style: { color: "var(--grid-text)", fontWeight: "var(--grid-header-font-weight, 600)" } }, label);
|
|
3013
3214
|
} else if (configs && configs.length > 0) {
|
|
3014
|
-
cellContent = /* @__PURE__ */
|
|
3215
|
+
cellContent = /* @__PURE__ */ React11.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "3px" } }, configs.map((config, idx) => {
|
|
3015
3216
|
const key = `${config.field}_${config.function}`;
|
|
3016
3217
|
const value = aggregates[key];
|
|
3017
3218
|
const formattedValue = formatAggregateValue(value, config.function);
|
|
3018
3219
|
const displayLabel = config.label || getAggregateLabel(config.function);
|
|
3019
|
-
return /* @__PURE__ */
|
|
3220
|
+
return /* @__PURE__ */ React11.createElement("div", { key: idx, style: { fontSize: "12px" } }, configs.length > 1 && /* @__PURE__ */ React11.createElement("span", { style: { color: "var(--grid-text-secondary)", marginRight: "4px", fontWeight: "500" } }, displayLabel, ":"), /* @__PURE__ */ React11.createElement("span", { style: { color: "var(--grid-text)", fontWeight: "var(--grid-header-font-weight, 600)" } }, formattedValue));
|
|
3020
3221
|
}));
|
|
3021
3222
|
} else {
|
|
3022
3223
|
cellContent = null;
|
|
3023
3224
|
}
|
|
3024
|
-
return /* @__PURE__ */
|
|
3225
|
+
return /* @__PURE__ */ React11.createElement(
|
|
3025
3226
|
"div",
|
|
3026
3227
|
{
|
|
3027
3228
|
key: `footer-${field}`,
|
|
@@ -3040,7 +3241,7 @@ var GridFooter = ({
|
|
|
3040
3241
|
};
|
|
3041
3242
|
|
|
3042
3243
|
// src/components/DataGrid/ColumnChooser.tsx
|
|
3043
|
-
import
|
|
3244
|
+
import React12, { useState as useState5, useRef as useRef5, useEffect as useEffect3, useMemo as useMemo2 } from "react";
|
|
3044
3245
|
import { createPortal } from "react-dom";
|
|
3045
3246
|
var ColumnChooser = ({
|
|
3046
3247
|
columns,
|
|
@@ -3118,7 +3319,7 @@ var ColumnChooser = ({
|
|
|
3118
3319
|
}
|
|
3119
3320
|
}
|
|
3120
3321
|
};
|
|
3121
|
-
const panelContent = isOpen && /* @__PURE__ */
|
|
3322
|
+
const panelContent = isOpen && /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement("div", { style: { position: "fixed", inset: 0, zIndex: 9999, backgroundColor: "rgba(0, 0, 0, 0.3)" }, onClick: () => setIsOpen(false) }), /* @__PURE__ */ React12.createElement(
|
|
3122
3323
|
"div",
|
|
3123
3324
|
{
|
|
3124
3325
|
ref: panelRef,
|
|
@@ -3136,16 +3337,16 @@ var ColumnChooser = ({
|
|
|
3136
3337
|
maxHeight: "500px"
|
|
3137
3338
|
}
|
|
3138
3339
|
},
|
|
3139
|
-
/* @__PURE__ */
|
|
3340
|
+
/* @__PURE__ */ React12.createElement("div", { style: { paddingLeft: "16px", paddingRight: "16px", paddingTop: "12px", paddingBottom: "12px", backgroundColor: "var(--grid-bg-alt)", borderBottom: "1px solid var(--grid-border)", display: "flex", alignItems: "center", justifyContent: "space-between" } }, /* @__PURE__ */ React12.createElement("h3", { style: { fontSize: "14px", fontWeight: "600", color: "var(--grid-text)", margin: 0 } }, "Select Columns"), /* @__PURE__ */ React12.createElement("div", { style: { display: "flex", gap: "8px" } }, /* @__PURE__ */ React12.createElement("button", { onClick: onResetLayout, style: { fontSize: "12px", color: "#2563eb", fontWeight: "500", backgroundColor: "transparent", border: "none", cursor: "pointer", textDecoration: "none", padding: 0 }, onMouseEnter: (e) => {
|
|
3140
3341
|
e.currentTarget.style.color = "#1d4ed8";
|
|
3141
3342
|
e.currentTarget.style.textDecoration = "underline";
|
|
3142
3343
|
}, onMouseLeave: (e) => {
|
|
3143
3344
|
e.currentTarget.style.color = "#2563eb";
|
|
3144
3345
|
e.currentTarget.style.textDecoration = "none";
|
|
3145
|
-
} }, "Reset"), /* @__PURE__ */
|
|
3146
|
-
/* @__PURE__ */
|
|
3346
|
+
} }, "Reset"), /* @__PURE__ */ React12.createElement("button", { onClick: () => setIsOpen(false), style: { color: "#6b7280", backgroundColor: "transparent", border: "none", cursor: "pointer", fontSize: "16px", padding: 0, margin: 0 }, onMouseEnter: (e) => e.currentTarget.style.color = "#374151", onMouseLeave: (e) => e.currentTarget.style.color = "#6b7280" }, "\u2715"))),
|
|
3347
|
+
/* @__PURE__ */ React12.createElement("div", { style: { padding: "16px", display: "flex", gap: "12px", height: "400px" } }, /* @__PURE__ */ React12.createElement("div", { style: { flex: 1, display: "flex", flexDirection: "column" } }, /* @__PURE__ */ React12.createElement("div", { style: { fontSize: "12px", fontWeight: "600", color: "var(--grid-text)", marginBottom: "8px" } }, "Available Columns (", availableColumns.length, ")"), /* @__PURE__ */ React12.createElement("div", { style: { flex: 1, border: "1px solid var(--grid-border)", borderRadius: "4px", overflowY: "scroll", backgroundColor: "var(--grid-bg)" } }, availableColumns.map((column) => {
|
|
3147
3348
|
const isSelected = selectedAvailable === column.field;
|
|
3148
|
-
return /* @__PURE__ */
|
|
3349
|
+
return /* @__PURE__ */ React12.createElement(
|
|
3149
3350
|
"div",
|
|
3150
3351
|
{
|
|
3151
3352
|
key: column.field,
|
|
@@ -3166,9 +3367,9 @@ var ColumnChooser = ({
|
|
|
3166
3367
|
},
|
|
3167
3368
|
column.headerName
|
|
3168
3369
|
);
|
|
3169
|
-
}), availableColumns.length === 0 && /* @__PURE__ */
|
|
3370
|
+
}), availableColumns.length === 0 && /* @__PURE__ */ React12.createElement("div", { style: { padding: "32px 12px", textAlign: "center", color: "var(--grid-text-secondary)", fontSize: "14px" } }, "All columns are visible"))), /* @__PURE__ */ React12.createElement("div", { style: { display: "flex", flexDirection: "column", justifyContent: "center", gap: "8px" } }, /* @__PURE__ */ React12.createElement("button", { onClick: moveToVisible, disabled: !selectedAvailable, style: { paddingLeft: "12px", paddingRight: "12px", paddingTop: "8px", paddingBottom: "8px", backgroundColor: !selectedAvailable ? "#d1d5db" : "#3b82f6", color: "#fff", borderRadius: "4px", border: "none", cursor: !selectedAvailable ? "not-allowed" : "pointer" }, onMouseEnter: (e) => !selectedAvailable ? null : e.currentTarget.style.backgroundColor = "#1d4ed8", onMouseLeave: (e) => !selectedAvailable ? null : e.currentTarget.style.backgroundColor = "#3b82f6", title: "Add selected" }, ">"), /* @__PURE__ */ React12.createElement("button", { onClick: moveAllToVisible, disabled: availableColumns.length === 0, style: { paddingLeft: "12px", paddingRight: "12px", paddingTop: "8px", paddingBottom: "8px", backgroundColor: availableColumns.length === 0 ? "#d1d5db" : "#3b82f6", color: "#fff", borderRadius: "4px", border: "none", cursor: availableColumns.length === 0 ? "not-allowed" : "pointer" }, onMouseEnter: (e) => availableColumns.length === 0 ? null : e.currentTarget.style.backgroundColor = "#1d4ed8", onMouseLeave: (e) => availableColumns.length === 0 ? null : e.currentTarget.style.backgroundColor = "#3b82f6", title: "Add all" }, ">>"), /* @__PURE__ */ React12.createElement("button", { onClick: moveToAvailable, disabled: !selectedVisible || visibleColumns.length === 1, style: { paddingLeft: "12px", paddingRight: "12px", paddingTop: "8px", paddingBottom: "8px", backgroundColor: !selectedVisible || visibleColumns.length === 1 ? "#d1d5db" : "#3b82f6", color: "#fff", borderRadius: "4px", border: "none", cursor: !selectedVisible || visibleColumns.length === 1 ? "not-allowed" : "pointer" }, onMouseEnter: (e) => !selectedVisible || visibleColumns.length === 1 ? null : e.currentTarget.style.backgroundColor = "#1d4ed8", onMouseLeave: (e) => !selectedVisible || visibleColumns.length === 1 ? null : e.currentTarget.style.backgroundColor = "#3b82f6", title: "Remove selected" }, "<"), /* @__PURE__ */ React12.createElement("button", { onClick: moveAllToAvailable, disabled: visibleColumns.length === 0, style: { paddingLeft: "12px", paddingRight: "12px", paddingTop: "8px", paddingBottom: "8px", backgroundColor: visibleColumns.length === 0 ? "#d1d5db" : "#3b82f6", color: "#fff", borderRadius: "4px", border: "none", cursor: visibleColumns.length === 0 ? "not-allowed" : "pointer" }, onMouseEnter: (e) => visibleColumns.length === 0 ? null : e.currentTarget.style.backgroundColor = "#1d4ed8", onMouseLeave: (e) => visibleColumns.length === 0 ? null : e.currentTarget.style.backgroundColor = "#3b82f6", title: "Remove all" }, "<<")), /* @__PURE__ */ React12.createElement("div", { style: { flex: 1, display: "flex", flexDirection: "column" } }, /* @__PURE__ */ React12.createElement("div", { style: { fontSize: "12px", fontWeight: "600", color: "var(--grid-text)", marginBottom: "8px" } }, "Visible Columns (", visibleColumns.length, ")"), /* @__PURE__ */ React12.createElement("div", { style: { flex: 1, border: "1px solid var(--grid-border)", borderRadius: "4px", overflowY: "scroll", backgroundColor: "var(--grid-bg)" } }, visibleColumns.map((column) => {
|
|
3170
3371
|
const isSelected = selectedVisible === column.field;
|
|
3171
|
-
return /* @__PURE__ */
|
|
3372
|
+
return /* @__PURE__ */ React12.createElement(
|
|
3172
3373
|
"div",
|
|
3173
3374
|
{
|
|
3174
3375
|
key: column.field,
|
|
@@ -3189,7 +3390,7 @@ var ColumnChooser = ({
|
|
|
3189
3390
|
},
|
|
3190
3391
|
column.headerName
|
|
3191
3392
|
);
|
|
3192
|
-
}))), /* @__PURE__ */
|
|
3393
|
+
}))), /* @__PURE__ */ React12.createElement("div", { style: { display: "flex", flexDirection: "column", justifyContent: "center", gap: "8px" } }, /* @__PURE__ */ React12.createElement(
|
|
3193
3394
|
"button",
|
|
3194
3395
|
{
|
|
3195
3396
|
onClick: () => {
|
|
@@ -3202,7 +3403,7 @@ var ColumnChooser = ({
|
|
|
3202
3403
|
title: "Move up"
|
|
3203
3404
|
},
|
|
3204
3405
|
"\u25B2"
|
|
3205
|
-
), /* @__PURE__ */
|
|
3406
|
+
), /* @__PURE__ */ React12.createElement(
|
|
3206
3407
|
"button",
|
|
3207
3408
|
{
|
|
3208
3409
|
onClick: () => {
|
|
@@ -3216,7 +3417,7 @@ var ColumnChooser = ({
|
|
|
3216
3417
|
},
|
|
3217
3418
|
"\u25BC"
|
|
3218
3419
|
))),
|
|
3219
|
-
/* @__PURE__ */
|
|
3420
|
+
/* @__PURE__ */ React12.createElement("div", { style: { paddingLeft: "16px", paddingRight: "16px", paddingTop: "8px", paddingBottom: "8px", backgroundColor: "var(--grid-bg-alt)", borderTop: "1px solid var(--grid-border)", display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React12.createElement(
|
|
3220
3421
|
"button",
|
|
3221
3422
|
{
|
|
3222
3423
|
onClick: () => {
|
|
@@ -3231,7 +3432,7 @@ var ColumnChooser = ({
|
|
|
3231
3432
|
"Done"
|
|
3232
3433
|
))
|
|
3233
3434
|
));
|
|
3234
|
-
return /* @__PURE__ */
|
|
3435
|
+
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(
|
|
3235
3436
|
"button",
|
|
3236
3437
|
{
|
|
3237
3438
|
ref: buttonRef,
|
|
@@ -3247,13 +3448,13 @@ var ColumnChooser = ({
|
|
|
3247
3448
|
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "var(--grid-bg)",
|
|
3248
3449
|
title: "Select Columns"
|
|
3249
3450
|
},
|
|
3250
|
-
/* @__PURE__ */
|
|
3451
|
+
/* @__PURE__ */ React12.createElement("svg", { style: { width: "16px", height: "16px" }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" }, /* @__PURE__ */ React12.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 17V7m0 10a2 2 0 01-2 2H5a2 2 0 01-2-2V7a2 2 0 012-2h2a2 2 0 012 2m0 10a2 2 0 002 2h2a2 2 0 002-2M9 7a2 2 0 012-2h2a2 2 0 012 2m0 10V7m0 10a2 2 0 002 2h2a2 2 0 002-2V7a2 2 0 00-2-2h-2a2 2 0 00-2 2" })),
|
|
3251
3452
|
"Columns"
|
|
3252
3453
|
), panelContent && createPortal(panelContent, document.body));
|
|
3253
3454
|
};
|
|
3254
3455
|
|
|
3255
3456
|
// src/components/DataGrid/ExportMenu.tsx
|
|
3256
|
-
import
|
|
3457
|
+
import React13, { useState as useState6 } from "react";
|
|
3257
3458
|
|
|
3258
3459
|
// src/components/DataGrid/exportUtils.ts
|
|
3259
3460
|
import ExcelJS from "exceljs";
|
|
@@ -3380,7 +3581,7 @@ var ExportMenu = ({
|
|
|
3380
3581
|
const [scope, setScope] = useState6("filtered");
|
|
3381
3582
|
const [styling, setStyling] = useState6("basic");
|
|
3382
3583
|
const [buttonRect, setButtonRect] = useState6(null);
|
|
3383
|
-
const buttonRef =
|
|
3584
|
+
const buttonRef = React13.useRef(null);
|
|
3384
3585
|
const getDataByScope = () => {
|
|
3385
3586
|
switch (scope) {
|
|
3386
3587
|
case "all":
|
|
@@ -3427,7 +3628,7 @@ var ExportMenu = ({
|
|
|
3427
3628
|
disabled: currentPageData.length === 0
|
|
3428
3629
|
}
|
|
3429
3630
|
];
|
|
3430
|
-
return /* @__PURE__ */
|
|
3631
|
+
return /* @__PURE__ */ React13.createElement("div", { style: { position: "relative" } }, /* @__PURE__ */ React13.createElement(
|
|
3431
3632
|
"button",
|
|
3432
3633
|
{
|
|
3433
3634
|
ref: buttonRef,
|
|
@@ -3463,7 +3664,7 @@ var ExportMenu = ({
|
|
|
3463
3664
|
},
|
|
3464
3665
|
title: "Export data to CSV or XLSX format"
|
|
3465
3666
|
},
|
|
3466
|
-
/* @__PURE__ */
|
|
3667
|
+
/* @__PURE__ */ React13.createElement(
|
|
3467
3668
|
"svg",
|
|
3468
3669
|
{
|
|
3469
3670
|
style: { width: "16px", height: "16px" },
|
|
@@ -3471,7 +3672,7 @@ var ExportMenu = ({
|
|
|
3471
3672
|
stroke: "currentColor",
|
|
3472
3673
|
viewBox: "0 0 24 24"
|
|
3473
3674
|
},
|
|
3474
|
-
/* @__PURE__ */
|
|
3675
|
+
/* @__PURE__ */ React13.createElement(
|
|
3475
3676
|
"path",
|
|
3476
3677
|
{
|
|
3477
3678
|
strokeLinecap: "round",
|
|
@@ -3482,7 +3683,7 @@ var ExportMenu = ({
|
|
|
3482
3683
|
)
|
|
3483
3684
|
),
|
|
3484
3685
|
"Export"
|
|
3485
|
-
), showMenu && buttonRect && /* @__PURE__ */
|
|
3686
|
+
), showMenu && buttonRect && /* @__PURE__ */ React13.createElement(
|
|
3486
3687
|
"div",
|
|
3487
3688
|
{
|
|
3488
3689
|
style: {
|
|
@@ -3502,7 +3703,7 @@ var ExportMenu = ({
|
|
|
3502
3703
|
overflowY: "auto"
|
|
3503
3704
|
}
|
|
3504
3705
|
},
|
|
3505
|
-
/* @__PURE__ */
|
|
3706
|
+
/* @__PURE__ */ React13.createElement("div", { style: { marginBottom: "20px" } }, /* @__PURE__ */ React13.createElement("label", { style: { display: "block", fontSize: "14px", fontWeight: "600", color: "#1f2937", marginBottom: "12px" } }, "Format"), /* @__PURE__ */ React13.createElement("div", { style: { display: "flex", gap: "16px" } }, /* @__PURE__ */ React13.createElement("label", { style: { display: "flex", alignItems: "center", gap: "8px", cursor: "pointer" } }, /* @__PURE__ */ React13.createElement(
|
|
3506
3707
|
"input",
|
|
3507
3708
|
{
|
|
3508
3709
|
type: "radio",
|
|
@@ -3512,7 +3713,7 @@ var ExportMenu = ({
|
|
|
3512
3713
|
onChange: (e) => setFormat(e.target.value),
|
|
3513
3714
|
style: { width: "16px", height: "16px", cursor: "pointer" }
|
|
3514
3715
|
}
|
|
3515
|
-
), /* @__PURE__ */
|
|
3716
|
+
), /* @__PURE__ */ React13.createElement("span", { style: { fontSize: "14px", color: "#374151" } }, "CSV")), /* @__PURE__ */ React13.createElement("label", { style: { display: "flex", alignItems: "center", gap: "8px", cursor: "pointer" } }, /* @__PURE__ */ React13.createElement(
|
|
3516
3717
|
"input",
|
|
3517
3718
|
{
|
|
3518
3719
|
type: "radio",
|
|
@@ -3522,8 +3723,8 @@ var ExportMenu = ({
|
|
|
3522
3723
|
onChange: (e) => setFormat(e.target.value),
|
|
3523
3724
|
style: { width: "16px", height: "16px", cursor: "pointer" }
|
|
3524
3725
|
}
|
|
3525
|
-
), /* @__PURE__ */
|
|
3526
|
-
/* @__PURE__ */
|
|
3726
|
+
), /* @__PURE__ */ React13.createElement("span", { style: { fontSize: "14px", color: "#374151" } }, "XLSX (Excel)")))),
|
|
3727
|
+
/* @__PURE__ */ React13.createElement("div", { style: { marginBottom: "20px" } }, /* @__PURE__ */ React13.createElement("label", { style: { display: "block", fontSize: "14px", fontWeight: "600", color: "#1f2937", marginBottom: "12px" } }, "Data Scope"), /* @__PURE__ */ React13.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "10px" } }, scopeOptions.map((option) => /* @__PURE__ */ React13.createElement(
|
|
3527
3728
|
"label",
|
|
3528
3729
|
{
|
|
3529
3730
|
key: option.value,
|
|
@@ -3548,7 +3749,7 @@ var ExportMenu = ({
|
|
|
3548
3749
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
3549
3750
|
}
|
|
3550
3751
|
},
|
|
3551
|
-
/* @__PURE__ */
|
|
3752
|
+
/* @__PURE__ */ React13.createElement(
|
|
3552
3753
|
"input",
|
|
3553
3754
|
{
|
|
3554
3755
|
type: "radio",
|
|
@@ -3560,9 +3761,9 @@ var ExportMenu = ({
|
|
|
3560
3761
|
style: { width: "16px", height: "16px", cursor: option.disabled ? "not-allowed" : "pointer" }
|
|
3561
3762
|
}
|
|
3562
3763
|
),
|
|
3563
|
-
/* @__PURE__ */
|
|
3764
|
+
/* @__PURE__ */ React13.createElement("span", { style: { fontSize: "14px", color: "#374151" } }, option.label)
|
|
3564
3765
|
)))),
|
|
3565
|
-
format === "xlsx" && /* @__PURE__ */
|
|
3766
|
+
format === "xlsx" && /* @__PURE__ */ React13.createElement("div", { style: { marginBottom: "20px" } }, /* @__PURE__ */ React13.createElement("label", { style: { display: "block", fontSize: "14px", fontWeight: "600", color: "#1f2937", marginBottom: "12px" } }, "Styling"), /* @__PURE__ */ React13.createElement("div", { style: { marginBottom: "10px" } }, /* @__PURE__ */ React13.createElement("div", { style: { display: "flex", gap: "16px" } }, /* @__PURE__ */ React13.createElement("label", { style: { display: "flex", alignItems: "center", gap: "8px", cursor: "pointer" } }, /* @__PURE__ */ React13.createElement(
|
|
3566
3767
|
"input",
|
|
3567
3768
|
{
|
|
3568
3769
|
type: "radio",
|
|
@@ -3572,7 +3773,7 @@ var ExportMenu = ({
|
|
|
3572
3773
|
onChange: (e) => setStyling(e.target.value),
|
|
3573
3774
|
style: { width: "16px", height: "16px", cursor: "pointer" }
|
|
3574
3775
|
}
|
|
3575
|
-
), /* @__PURE__ */
|
|
3776
|
+
), /* @__PURE__ */ React13.createElement("span", { style: { fontSize: "14px", color: "#374151" } }, "Basic")), /* @__PURE__ */ React13.createElement("label", { style: { display: "flex", alignItems: "center", gap: "8px", cursor: "pointer" } }, /* @__PURE__ */ React13.createElement(
|
|
3576
3777
|
"input",
|
|
3577
3778
|
{
|
|
3578
3779
|
type: "radio",
|
|
@@ -3582,9 +3783,9 @@ var ExportMenu = ({
|
|
|
3582
3783
|
onChange: (e) => setStyling(e.target.value),
|
|
3583
3784
|
style: { width: "16px", height: "16px", cursor: "pointer" }
|
|
3584
3785
|
}
|
|
3585
|
-
), /* @__PURE__ */
|
|
3586
|
-
/* @__PURE__ */
|
|
3587
|
-
/* @__PURE__ */
|
|
3786
|
+
), /* @__PURE__ */ React13.createElement("span", { style: { fontSize: "14px", color: "#374151" } }, "Professional")))), /* @__PURE__ */ React13.createElement("p", { style: { fontSize: "12px", color: "#6b7280", margin: "0" } }, "Professional adds colors, borders, and frozen header row")),
|
|
3787
|
+
/* @__PURE__ */ React13.createElement("div", { style: { backgroundColor: "#f3f4f6", borderRadius: "6px", padding: "12px", marginBottom: "20px", fontSize: "13px", color: "#4b5563" } }, /* @__PURE__ */ React13.createElement("p", { style: { margin: "6px 0" } }, /* @__PURE__ */ React13.createElement("strong", null, "Data to export:"), " ", getDataByScope().length, " row(s)"), /* @__PURE__ */ React13.createElement("p", { style: { margin: "6px 0" } }, /* @__PURE__ */ React13.createElement("strong", null, "Columns:"), " ", columns.length)),
|
|
3788
|
+
/* @__PURE__ */ React13.createElement("div", { style: { display: "flex", gap: "10px", justifyContent: "flex-end" } }, /* @__PURE__ */ React13.createElement(
|
|
3588
3789
|
"button",
|
|
3589
3790
|
{
|
|
3590
3791
|
onClick: () => setShowMenu(false),
|
|
@@ -3607,7 +3808,7 @@ var ExportMenu = ({
|
|
|
3607
3808
|
}
|
|
3608
3809
|
},
|
|
3609
3810
|
"Cancel"
|
|
3610
|
-
), /* @__PURE__ */
|
|
3811
|
+
), /* @__PURE__ */ React13.createElement(
|
|
3611
3812
|
"button",
|
|
3612
3813
|
{
|
|
3613
3814
|
onClick: handleExportClick,
|
|
@@ -3637,7 +3838,7 @@ var ExportMenu = ({
|
|
|
3637
3838
|
},
|
|
3638
3839
|
"Export Now"
|
|
3639
3840
|
))
|
|
3640
|
-
), showMenu && /* @__PURE__ */
|
|
3841
|
+
), showMenu && /* @__PURE__ */ React13.createElement(
|
|
3641
3842
|
"div",
|
|
3642
3843
|
{
|
|
3643
3844
|
style: {
|
|
@@ -3651,10 +3852,10 @@ var ExportMenu = ({
|
|
|
3651
3852
|
};
|
|
3652
3853
|
|
|
3653
3854
|
// src/components/DataGrid/ColumnFilters.tsx
|
|
3654
|
-
import
|
|
3855
|
+
import React15, { useState as useState8, useEffect as useEffect4 } from "react";
|
|
3655
3856
|
|
|
3656
3857
|
// src/components/DataGrid/AdvancedFilterBuilder.tsx
|
|
3657
|
-
import
|
|
3858
|
+
import React14, { useState as useState7 } from "react";
|
|
3658
3859
|
var getColumnFilterType = (column) => {
|
|
3659
3860
|
if (column.filterType) {
|
|
3660
3861
|
if (column.filterType === "multi") return "set";
|
|
@@ -3816,7 +4017,7 @@ var AdvancedFilterBuilder = ({
|
|
|
3816
4017
|
updateCondition(index, { values: filteredValues });
|
|
3817
4018
|
}
|
|
3818
4019
|
};
|
|
3819
|
-
return /* @__PURE__ */
|
|
4020
|
+
return /* @__PURE__ */ React14.createElement("div", { style: { marginTop: "8px" } }, /* @__PURE__ */ React14.createElement(
|
|
3820
4021
|
"input",
|
|
3821
4022
|
{
|
|
3822
4023
|
type: "text",
|
|
@@ -3835,13 +4036,13 @@ var AdvancedFilterBuilder = ({
|
|
|
3835
4036
|
onChange: (e) => updateTempState(index, { searchTerm: e.target.value }),
|
|
3836
4037
|
placeholder: "Search values..."
|
|
3837
4038
|
}
|
|
3838
|
-
), /* @__PURE__ */
|
|
4039
|
+
), /* @__PURE__ */ React14.createElement("div", { style: {
|
|
3839
4040
|
maxHeight: "150px",
|
|
3840
4041
|
overflowY: "auto",
|
|
3841
4042
|
border: "1px solid var(--grid-border)",
|
|
3842
4043
|
borderRadius: "var(--grid-border-radius, 4px)",
|
|
3843
4044
|
padding: "4px"
|
|
3844
|
-
} }, /* @__PURE__ */
|
|
4045
|
+
} }, /* @__PURE__ */ React14.createElement(
|
|
3845
4046
|
"label",
|
|
3846
4047
|
{
|
|
3847
4048
|
style: {
|
|
@@ -3853,7 +4054,7 @@ var AdvancedFilterBuilder = ({
|
|
|
3853
4054
|
fontSize: "var(--grid-font-size-sm, 12px)"
|
|
3854
4055
|
}
|
|
3855
4056
|
},
|
|
3856
|
-
/* @__PURE__ */
|
|
4057
|
+
/* @__PURE__ */ React14.createElement(
|
|
3857
4058
|
"input",
|
|
3858
4059
|
{
|
|
3859
4060
|
type: "checkbox",
|
|
@@ -3862,8 +4063,8 @@ var AdvancedFilterBuilder = ({
|
|
|
3862
4063
|
style: { width: "14px", height: "14px", cursor: "pointer" }
|
|
3863
4064
|
}
|
|
3864
4065
|
),
|
|
3865
|
-
/* @__PURE__ */
|
|
3866
|
-
), filteredValues.map((value, idx) => /* @__PURE__ */
|
|
4066
|
+
/* @__PURE__ */ React14.createElement("span", { style: { fontWeight: 500, color: "var(--grid-text)" } }, "(Select All)")
|
|
4067
|
+
), filteredValues.map((value, idx) => /* @__PURE__ */ React14.createElement(
|
|
3867
4068
|
"label",
|
|
3868
4069
|
{
|
|
3869
4070
|
key: idx,
|
|
@@ -3876,7 +4077,7 @@ var AdvancedFilterBuilder = ({
|
|
|
3876
4077
|
fontSize: "var(--grid-font-size-sm, 12px)"
|
|
3877
4078
|
}
|
|
3878
4079
|
},
|
|
3879
|
-
/* @__PURE__ */
|
|
4080
|
+
/* @__PURE__ */ React14.createElement(
|
|
3880
4081
|
"input",
|
|
3881
4082
|
{
|
|
3882
4083
|
type: "checkbox",
|
|
@@ -3885,8 +4086,8 @@ var AdvancedFilterBuilder = ({
|
|
|
3885
4086
|
style: { width: "14px", height: "14px", cursor: "pointer" }
|
|
3886
4087
|
}
|
|
3887
4088
|
),
|
|
3888
|
-
/* @__PURE__ */
|
|
3889
|
-
))), selectedValues.size > 0 && /* @__PURE__ */
|
|
4089
|
+
/* @__PURE__ */ React14.createElement("span", { style: { color: "var(--grid-text)" } }, String(value))
|
|
4090
|
+
))), selectedValues.size > 0 && /* @__PURE__ */ React14.createElement("div", { style: {
|
|
3890
4091
|
marginTop: "6px",
|
|
3891
4092
|
fontSize: "var(--grid-font-size-sm, 12px)",
|
|
3892
4093
|
color: "var(--grid-primary)",
|
|
@@ -3897,7 +4098,7 @@ var AdvancedFilterBuilder = ({
|
|
|
3897
4098
|
return null;
|
|
3898
4099
|
}
|
|
3899
4100
|
if (requiresSecondValue(condition.type)) {
|
|
3900
|
-
return /* @__PURE__ */
|
|
4101
|
+
return /* @__PURE__ */ React14.createElement("div", { style: { marginTop: "8px", display: "flex", gap: "8px", alignItems: "center" } }, /* @__PURE__ */ React14.createElement(
|
|
3901
4102
|
"input",
|
|
3902
4103
|
{
|
|
3903
4104
|
type: filterType === "date" ? "date" : filterType === "number" ? "number" : "text",
|
|
@@ -3915,7 +4116,7 @@ var AdvancedFilterBuilder = ({
|
|
|
3915
4116
|
onChange: (e) => updateCondition(index, { value: e.target.value }),
|
|
3916
4117
|
placeholder: "From"
|
|
3917
4118
|
}
|
|
3918
|
-
), /* @__PURE__ */
|
|
4119
|
+
), /* @__PURE__ */ React14.createElement("span", { style: { color: "var(--grid-text-secondary)", fontSize: "var(--grid-font-size-sm, 12px)" } }, "to"), /* @__PURE__ */ React14.createElement(
|
|
3919
4120
|
"input",
|
|
3920
4121
|
{
|
|
3921
4122
|
type: filterType === "date" ? "date" : filterType === "number" ? "number" : "text",
|
|
@@ -3935,7 +4136,7 @@ var AdvancedFilterBuilder = ({
|
|
|
3935
4136
|
}
|
|
3936
4137
|
));
|
|
3937
4138
|
}
|
|
3938
|
-
return /* @__PURE__ */
|
|
4139
|
+
return /* @__PURE__ */ React14.createElement("div", { style: { marginTop: "8px" } }, /* @__PURE__ */ React14.createElement(
|
|
3939
4140
|
"input",
|
|
3940
4141
|
{
|
|
3941
4142
|
type: filterType === "date" ? "date" : filterType === "number" ? "number" : "text",
|
|
@@ -3955,7 +4156,7 @@ var AdvancedFilterBuilder = ({
|
|
|
3955
4156
|
}
|
|
3956
4157
|
));
|
|
3957
4158
|
};
|
|
3958
|
-
return /* @__PURE__ */
|
|
4159
|
+
return /* @__PURE__ */ React14.createElement(
|
|
3959
4160
|
"div",
|
|
3960
4161
|
{
|
|
3961
4162
|
style: {
|
|
@@ -3977,27 +4178,27 @@ var AdvancedFilterBuilder = ({
|
|
|
3977
4178
|
},
|
|
3978
4179
|
onClick: (e) => e.stopPropagation()
|
|
3979
4180
|
},
|
|
3980
|
-
/* @__PURE__ */
|
|
4181
|
+
/* @__PURE__ */ React14.createElement("div", { style: {
|
|
3981
4182
|
marginBottom: "16px",
|
|
3982
4183
|
paddingBottom: "12px",
|
|
3983
4184
|
borderBottom: "1px solid var(--grid-border)"
|
|
3984
|
-
} }, /* @__PURE__ */
|
|
4185
|
+
} }, /* @__PURE__ */ React14.createElement("h4", { style: {
|
|
3985
4186
|
margin: 0,
|
|
3986
4187
|
fontSize: "var(--grid-font-size, 14px)",
|
|
3987
4188
|
fontWeight: 600,
|
|
3988
4189
|
color: "var(--grid-text)"
|
|
3989
|
-
} }, "Advanced Filter: ", column.headerName), /* @__PURE__ */
|
|
4190
|
+
} }, "Advanced Filter: ", column.headerName), /* @__PURE__ */ React14.createElement("p", { style: {
|
|
3990
4191
|
margin: "4px 0 0 0",
|
|
3991
4192
|
fontSize: "var(--grid-font-size-sm, 12px)",
|
|
3992
4193
|
color: "var(--grid-text-secondary)"
|
|
3993
4194
|
} }, "Add multiple conditions with AND/OR logic")),
|
|
3994
|
-
conditions.length > 1 && /* @__PURE__ */
|
|
4195
|
+
conditions.length > 1 && /* @__PURE__ */ React14.createElement("div", { style: { marginBottom: "16px" } }, /* @__PURE__ */ React14.createElement("label", { style: {
|
|
3995
4196
|
display: "block",
|
|
3996
4197
|
fontSize: "var(--grid-font-size-sm, 12px)",
|
|
3997
4198
|
fontWeight: 500,
|
|
3998
4199
|
color: "var(--grid-text)",
|
|
3999
4200
|
marginBottom: "6px"
|
|
4000
|
-
} }, "Combine Conditions"), /* @__PURE__ */
|
|
4201
|
+
} }, "Combine Conditions"), /* @__PURE__ */ React14.createElement("div", { style: { display: "flex", gap: "8px" } }, /* @__PURE__ */ React14.createElement(
|
|
4001
4202
|
"button",
|
|
4002
4203
|
{
|
|
4003
4204
|
style: {
|
|
@@ -4015,7 +4216,7 @@ var AdvancedFilterBuilder = ({
|
|
|
4015
4216
|
onClick: () => setOperator("AND")
|
|
4016
4217
|
},
|
|
4017
4218
|
"AND"
|
|
4018
|
-
), /* @__PURE__ */
|
|
4219
|
+
), /* @__PURE__ */ React14.createElement(
|
|
4019
4220
|
"button",
|
|
4020
4221
|
{
|
|
4021
4222
|
style: {
|
|
@@ -4034,7 +4235,7 @@ var AdvancedFilterBuilder = ({
|
|
|
4034
4235
|
},
|
|
4035
4236
|
"OR"
|
|
4036
4237
|
))),
|
|
4037
|
-
/* @__PURE__ */
|
|
4238
|
+
/* @__PURE__ */ React14.createElement("div", { style: { flex: 1, overflowY: "auto", marginBottom: "12px" } }, conditions.map((condition, index) => /* @__PURE__ */ React14.createElement(
|
|
4038
4239
|
"div",
|
|
4039
4240
|
{
|
|
4040
4241
|
key: index,
|
|
@@ -4046,11 +4247,11 @@ var AdvancedFilterBuilder = ({
|
|
|
4046
4247
|
border: "1px solid var(--grid-border)"
|
|
4047
4248
|
}
|
|
4048
4249
|
},
|
|
4049
|
-
/* @__PURE__ */
|
|
4250
|
+
/* @__PURE__ */ React14.createElement("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "8px" } }, /* @__PURE__ */ React14.createElement("label", { style: {
|
|
4050
4251
|
fontSize: "var(--grid-font-size-sm, 12px)",
|
|
4051
4252
|
fontWeight: 500,
|
|
4052
4253
|
color: "var(--grid-text)"
|
|
4053
|
-
} }, "Condition ", index + 1), conditions.length > 1 && /* @__PURE__ */
|
|
4254
|
+
} }, "Condition ", index + 1), conditions.length > 1 && /* @__PURE__ */ React14.createElement(
|
|
4054
4255
|
"button",
|
|
4055
4256
|
{
|
|
4056
4257
|
style: {
|
|
@@ -4069,7 +4270,7 @@ var AdvancedFilterBuilder = ({
|
|
|
4069
4270
|
},
|
|
4070
4271
|
"\u2715"
|
|
4071
4272
|
)),
|
|
4072
|
-
/* @__PURE__ */
|
|
4273
|
+
/* @__PURE__ */ React14.createElement(
|
|
4073
4274
|
"select",
|
|
4074
4275
|
{
|
|
4075
4276
|
style: {
|
|
@@ -4085,10 +4286,10 @@ var AdvancedFilterBuilder = ({
|
|
|
4085
4286
|
value: condition.type,
|
|
4086
4287
|
onChange: (e) => updateCondition(index, { type: e.target.value, value: "", value2: "", values: [] })
|
|
4087
4288
|
},
|
|
4088
|
-
operations.map((op) => /* @__PURE__ */
|
|
4289
|
+
operations.map((op) => /* @__PURE__ */ React14.createElement("option", { key: op.value, value: op.value }, op.label))
|
|
4089
4290
|
),
|
|
4090
4291
|
renderConditionInput(condition, index),
|
|
4091
|
-
index < conditions.length - 1 && conditions.length > 1 && /* @__PURE__ */
|
|
4292
|
+
index < conditions.length - 1 && conditions.length > 1 && /* @__PURE__ */ React14.createElement("div", { style: {
|
|
4092
4293
|
marginTop: "12px",
|
|
4093
4294
|
padding: "4px 8px",
|
|
4094
4295
|
textAlign: "center",
|
|
@@ -4099,7 +4300,7 @@ var AdvancedFilterBuilder = ({
|
|
|
4099
4300
|
borderRadius: "var(--grid-border-radius, 4px)"
|
|
4100
4301
|
} }, operator)
|
|
4101
4302
|
))),
|
|
4102
|
-
/* @__PURE__ */
|
|
4303
|
+
/* @__PURE__ */ React14.createElement(
|
|
4103
4304
|
"button",
|
|
4104
4305
|
{
|
|
4105
4306
|
style: {
|
|
@@ -4121,12 +4322,12 @@ var AdvancedFilterBuilder = ({
|
|
|
4121
4322
|
},
|
|
4122
4323
|
"+ Add Condition"
|
|
4123
4324
|
),
|
|
4124
|
-
/* @__PURE__ */
|
|
4325
|
+
/* @__PURE__ */ React14.createElement("div", { style: {
|
|
4125
4326
|
display: "flex",
|
|
4126
4327
|
gap: "8px",
|
|
4127
4328
|
paddingTop: "12px",
|
|
4128
4329
|
borderTop: "1px solid var(--grid-border)"
|
|
4129
|
-
} }, /* @__PURE__ */
|
|
4330
|
+
} }, /* @__PURE__ */ React14.createElement(
|
|
4130
4331
|
"button",
|
|
4131
4332
|
{
|
|
4132
4333
|
style: {
|
|
@@ -4146,7 +4347,7 @@ var AdvancedFilterBuilder = ({
|
|
|
4146
4347
|
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "var(--grid-bg-alt)"
|
|
4147
4348
|
},
|
|
4148
4349
|
"Reset"
|
|
4149
|
-
), /* @__PURE__ */
|
|
4350
|
+
), /* @__PURE__ */ React14.createElement(
|
|
4150
4351
|
"button",
|
|
4151
4352
|
{
|
|
4152
4353
|
style: {
|
|
@@ -4166,7 +4367,7 @@ var AdvancedFilterBuilder = ({
|
|
|
4166
4367
|
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "var(--grid-bg-alt)"
|
|
4167
4368
|
},
|
|
4168
4369
|
"Clear"
|
|
4169
|
-
), /* @__PURE__ */
|
|
4370
|
+
), /* @__PURE__ */ React14.createElement(
|
|
4170
4371
|
"button",
|
|
4171
4372
|
{
|
|
4172
4373
|
style: {
|
|
@@ -4213,7 +4414,7 @@ var TextFilterMenu = ({ filterValue, onApplyFilter, onClose, anchorEl, showAdvan
|
|
|
4213
4414
|
onApplyFilter(null);
|
|
4214
4415
|
onClose();
|
|
4215
4416
|
};
|
|
4216
|
-
return /* @__PURE__ */
|
|
4417
|
+
return /* @__PURE__ */ React15.createElement(
|
|
4217
4418
|
"div",
|
|
4218
4419
|
{
|
|
4219
4420
|
style: {
|
|
@@ -4230,7 +4431,7 @@ var TextFilterMenu = ({ filterValue, onApplyFilter, onClose, anchorEl, showAdvan
|
|
|
4230
4431
|
},
|
|
4231
4432
|
onClick: (e) => e.stopPropagation()
|
|
4232
4433
|
},
|
|
4233
|
-
/* @__PURE__ */
|
|
4434
|
+
/* @__PURE__ */ React15.createElement("div", { style: { marginBottom: "12px" } }, /* @__PURE__ */ React15.createElement("label", { style: { display: "block", fontSize: "var(--grid-font-size, 14px)", fontWeight: 500, color: "var(--grid-text)", marginBottom: "4px" } }, "Filter Type"), /* @__PURE__ */ React15.createElement(
|
|
4234
4435
|
"select",
|
|
4235
4436
|
{
|
|
4236
4437
|
style: {
|
|
@@ -4246,13 +4447,13 @@ var TextFilterMenu = ({ filterValue, onApplyFilter, onClose, anchorEl, showAdvan
|
|
|
4246
4447
|
value: filterType,
|
|
4247
4448
|
onChange: (e) => setFilterType(e.target.value)
|
|
4248
4449
|
},
|
|
4249
|
-
/* @__PURE__ */
|
|
4250
|
-
/* @__PURE__ */
|
|
4251
|
-
/* @__PURE__ */
|
|
4252
|
-
/* @__PURE__ */
|
|
4253
|
-
/* @__PURE__ */
|
|
4450
|
+
/* @__PURE__ */ React15.createElement("option", { value: "contains" }, "Contains"),
|
|
4451
|
+
/* @__PURE__ */ React15.createElement("option", { value: "notContains" }, "Not Contains"),
|
|
4452
|
+
/* @__PURE__ */ React15.createElement("option", { value: "equals" }, "Equals"),
|
|
4453
|
+
/* @__PURE__ */ React15.createElement("option", { value: "startsWith" }, "Starts With"),
|
|
4454
|
+
/* @__PURE__ */ React15.createElement("option", { value: "endsWith" }, "Ends With")
|
|
4254
4455
|
)),
|
|
4255
|
-
/* @__PURE__ */
|
|
4456
|
+
/* @__PURE__ */ React15.createElement("div", { style: { marginBottom: "12px" } }, /* @__PURE__ */ React15.createElement("label", { style: { display: "block", fontSize: "var(--grid-font-size, 14px)", fontWeight: 500, color: "var(--grid-text)", marginBottom: "4px" } }, "Value"), /* @__PURE__ */ React15.createElement(
|
|
4256
4457
|
"input",
|
|
4257
4458
|
{
|
|
4258
4459
|
type: "text",
|
|
@@ -4272,7 +4473,7 @@ var TextFilterMenu = ({ filterValue, onApplyFilter, onClose, anchorEl, showAdvan
|
|
|
4272
4473
|
autoFocus: true
|
|
4273
4474
|
}
|
|
4274
4475
|
)),
|
|
4275
|
-
/* @__PURE__ */
|
|
4476
|
+
/* @__PURE__ */ React15.createElement("div", { style: { display: "flex", gap: "8px", justifyContent: "flex-end" } }, /* @__PURE__ */ React15.createElement(
|
|
4276
4477
|
"button",
|
|
4277
4478
|
{
|
|
4278
4479
|
style: {
|
|
@@ -4289,7 +4490,7 @@ var TextFilterMenu = ({ filterValue, onApplyFilter, onClose, anchorEl, showAdvan
|
|
|
4289
4490
|
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "var(--grid-bg-alt)"
|
|
4290
4491
|
},
|
|
4291
4492
|
"Clear"
|
|
4292
|
-
), /* @__PURE__ */
|
|
4493
|
+
), /* @__PURE__ */ React15.createElement(
|
|
4293
4494
|
"button",
|
|
4294
4495
|
{
|
|
4295
4496
|
style: {
|
|
@@ -4335,7 +4536,7 @@ var NumberFilterMenu = ({ filterValue, onApplyFilter, onClose, anchorEl, showAdv
|
|
|
4335
4536
|
onApplyFilter(null);
|
|
4336
4537
|
onClose();
|
|
4337
4538
|
};
|
|
4338
|
-
return /* @__PURE__ */
|
|
4539
|
+
return /* @__PURE__ */ React15.createElement(
|
|
4339
4540
|
"div",
|
|
4340
4541
|
{
|
|
4341
4542
|
style: {
|
|
@@ -4352,22 +4553,22 @@ var NumberFilterMenu = ({ filterValue, onApplyFilter, onClose, anchorEl, showAdv
|
|
|
4352
4553
|
},
|
|
4353
4554
|
onClick: (e) => e.stopPropagation()
|
|
4354
4555
|
},
|
|
4355
|
-
/* @__PURE__ */
|
|
4556
|
+
/* @__PURE__ */ React15.createElement("div", { style: { marginBottom: "12px" } }, /* @__PURE__ */ React15.createElement("label", { style: { display: "block", fontSize: "var(--grid-font-size, 14px)", fontWeight: 500, color: "var(--grid-text)", marginBottom: "4px" } }, "Filter Type"), /* @__PURE__ */ React15.createElement(
|
|
4356
4557
|
"select",
|
|
4357
4558
|
{
|
|
4358
4559
|
style: { width: "100%", padding: "8px 12px", border: "1px solid var(--grid-border)", borderRadius: "var(--grid-border-radius, 6px)", fontSize: "var(--grid-font-size, 14px)", outline: "none", backgroundColor: "var(--grid-bg)", color: "var(--grid-text)" },
|
|
4359
4560
|
value: filterType,
|
|
4360
4561
|
onChange: (e) => setFilterType(e.target.value)
|
|
4361
4562
|
},
|
|
4362
|
-
/* @__PURE__ */
|
|
4363
|
-
/* @__PURE__ */
|
|
4364
|
-
/* @__PURE__ */
|
|
4365
|
-
/* @__PURE__ */
|
|
4366
|
-
/* @__PURE__ */
|
|
4367
|
-
/* @__PURE__ */
|
|
4368
|
-
/* @__PURE__ */
|
|
4563
|
+
/* @__PURE__ */ React15.createElement("option", { value: "equals" }, "Equals"),
|
|
4564
|
+
/* @__PURE__ */ React15.createElement("option", { value: "notEquals" }, "Not Equals"),
|
|
4565
|
+
/* @__PURE__ */ React15.createElement("option", { value: "greaterThan" }, "Greater Than"),
|
|
4566
|
+
/* @__PURE__ */ React15.createElement("option", { value: "greaterThanOrEqual" }, "Greater Than or Equal"),
|
|
4567
|
+
/* @__PURE__ */ React15.createElement("option", { value: "lessThan" }, "Less Than"),
|
|
4568
|
+
/* @__PURE__ */ React15.createElement("option", { value: "lessThanOrEqual" }, "Less Than or Equal"),
|
|
4569
|
+
/* @__PURE__ */ React15.createElement("option", { value: "inRange" }, "In Range")
|
|
4369
4570
|
)),
|
|
4370
|
-
/* @__PURE__ */
|
|
4571
|
+
/* @__PURE__ */ React15.createElement("div", { style: { marginBottom: "12px" } }, /* @__PURE__ */ React15.createElement("label", { style: { display: "block", fontSize: "var(--grid-font-size, 14px)", fontWeight: 500, color: "var(--grid-text)", marginBottom: "4px" } }, "Value"), /* @__PURE__ */ React15.createElement(
|
|
4371
4572
|
"input",
|
|
4372
4573
|
{
|
|
4373
4574
|
type: "number",
|
|
@@ -4378,7 +4579,7 @@ var NumberFilterMenu = ({ filterValue, onApplyFilter, onClose, anchorEl, showAdv
|
|
|
4378
4579
|
autoFocus: true
|
|
4379
4580
|
}
|
|
4380
4581
|
)),
|
|
4381
|
-
filterType === "inRange" && /* @__PURE__ */
|
|
4582
|
+
filterType === "inRange" && /* @__PURE__ */ React15.createElement("div", { style: { marginBottom: "12px" } }, /* @__PURE__ */ React15.createElement("label", { style: { display: "block", fontSize: "var(--grid-font-size, 14px)", fontWeight: 500, color: "var(--grid-text)", marginBottom: "4px" } }, "To"), /* @__PURE__ */ React15.createElement(
|
|
4382
4583
|
"input",
|
|
4383
4584
|
{
|
|
4384
4585
|
type: "number",
|
|
@@ -4388,7 +4589,7 @@ var NumberFilterMenu = ({ filterValue, onApplyFilter, onClose, anchorEl, showAdv
|
|
|
4388
4589
|
placeholder: "Enter max value..."
|
|
4389
4590
|
}
|
|
4390
4591
|
)),
|
|
4391
|
-
/* @__PURE__ */
|
|
4592
|
+
/* @__PURE__ */ React15.createElement("div", { style: { display: "flex", gap: "8px", justifyContent: "flex-end" } }, /* @__PURE__ */ React15.createElement(
|
|
4392
4593
|
"button",
|
|
4393
4594
|
{
|
|
4394
4595
|
style: {
|
|
@@ -4405,7 +4606,7 @@ var NumberFilterMenu = ({ filterValue, onApplyFilter, onClose, anchorEl, showAdv
|
|
|
4405
4606
|
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "var(--grid-bg-alt)"
|
|
4406
4607
|
},
|
|
4407
4608
|
"Clear"
|
|
4408
|
-
), /* @__PURE__ */
|
|
4609
|
+
), /* @__PURE__ */ React15.createElement(
|
|
4409
4610
|
"button",
|
|
4410
4611
|
{
|
|
4411
4612
|
style: {
|
|
@@ -4451,7 +4652,7 @@ var DateFilterMenu = ({ filterValue, onApplyFilter, onClose, anchorEl, showAdvan
|
|
|
4451
4652
|
onApplyFilter(null);
|
|
4452
4653
|
onClose();
|
|
4453
4654
|
};
|
|
4454
|
-
return /* @__PURE__ */
|
|
4655
|
+
return /* @__PURE__ */ React15.createElement(
|
|
4455
4656
|
"div",
|
|
4456
4657
|
{
|
|
4457
4658
|
style: {
|
|
@@ -4468,19 +4669,19 @@ var DateFilterMenu = ({ filterValue, onApplyFilter, onClose, anchorEl, showAdvan
|
|
|
4468
4669
|
},
|
|
4469
4670
|
onClick: (e) => e.stopPropagation()
|
|
4470
4671
|
},
|
|
4471
|
-
/* @__PURE__ */
|
|
4672
|
+
/* @__PURE__ */ React15.createElement("div", { style: { marginBottom: "12px" } }, /* @__PURE__ */ React15.createElement("label", { style: { display: "block", fontSize: "var(--grid-font-size, 14px)", fontWeight: 500, color: "var(--grid-text)", marginBottom: "4px" } }, "Filter Type"), /* @__PURE__ */ React15.createElement(
|
|
4472
4673
|
"select",
|
|
4473
4674
|
{
|
|
4474
4675
|
style: { width: "100%", padding: "8px 12px", border: "1px solid var(--grid-border)", borderRadius: "var(--grid-border-radius, 6px)", fontSize: "var(--grid-font-size, 14px)", outline: "none", backgroundColor: "var(--grid-bg)", color: "var(--grid-text)" },
|
|
4475
4676
|
value: filterType,
|
|
4476
4677
|
onChange: (e) => setFilterType(e.target.value)
|
|
4477
4678
|
},
|
|
4478
|
-
/* @__PURE__ */
|
|
4479
|
-
/* @__PURE__ */
|
|
4480
|
-
/* @__PURE__ */
|
|
4481
|
-
/* @__PURE__ */
|
|
4679
|
+
/* @__PURE__ */ React15.createElement("option", { value: "equals" }, "Equals"),
|
|
4680
|
+
/* @__PURE__ */ React15.createElement("option", { value: "before" }, "Before"),
|
|
4681
|
+
/* @__PURE__ */ React15.createElement("option", { value: "after" }, "After"),
|
|
4682
|
+
/* @__PURE__ */ React15.createElement("option", { value: "inRange" }, "In Range")
|
|
4482
4683
|
)),
|
|
4483
|
-
/* @__PURE__ */
|
|
4684
|
+
/* @__PURE__ */ React15.createElement("div", { style: { marginBottom: "12px" } }, /* @__PURE__ */ React15.createElement("label", { style: { display: "block", fontSize: "var(--grid-font-size, 14px)", fontWeight: 500, color: "var(--grid-text)", marginBottom: "4px" } }, "Date"), /* @__PURE__ */ React15.createElement(
|
|
4484
4685
|
"input",
|
|
4485
4686
|
{
|
|
4486
4687
|
type: "date",
|
|
@@ -4490,7 +4691,7 @@ var DateFilterMenu = ({ filterValue, onApplyFilter, onClose, anchorEl, showAdvan
|
|
|
4490
4691
|
autoFocus: true
|
|
4491
4692
|
}
|
|
4492
4693
|
)),
|
|
4493
|
-
filterType === "inRange" && /* @__PURE__ */
|
|
4694
|
+
filterType === "inRange" && /* @__PURE__ */ React15.createElement("div", { style: { marginBottom: "12px" } }, /* @__PURE__ */ React15.createElement("label", { style: { display: "block", fontSize: "var(--grid-font-size, 14px)", fontWeight: 500, color: "var(--grid-text)", marginBottom: "4px" } }, "To"), /* @__PURE__ */ React15.createElement(
|
|
4494
4695
|
"input",
|
|
4495
4696
|
{
|
|
4496
4697
|
type: "date",
|
|
@@ -4499,7 +4700,7 @@ var DateFilterMenu = ({ filterValue, onApplyFilter, onClose, anchorEl, showAdvan
|
|
|
4499
4700
|
onChange: (e) => setValue2(e.target.value)
|
|
4500
4701
|
}
|
|
4501
4702
|
)),
|
|
4502
|
-
/* @__PURE__ */
|
|
4703
|
+
/* @__PURE__ */ React15.createElement("div", { style: { display: "flex", gap: "8px", justifyContent: "flex-end" } }, /* @__PURE__ */ React15.createElement(
|
|
4503
4704
|
"button",
|
|
4504
4705
|
{
|
|
4505
4706
|
style: {
|
|
@@ -4516,7 +4717,7 @@ var DateFilterMenu = ({ filterValue, onApplyFilter, onClose, anchorEl, showAdvan
|
|
|
4516
4717
|
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "var(--grid-bg-alt)"
|
|
4517
4718
|
},
|
|
4518
4719
|
"Clear"
|
|
4519
|
-
), /* @__PURE__ */
|
|
4720
|
+
), /* @__PURE__ */ React15.createElement(
|
|
4520
4721
|
"button",
|
|
4521
4722
|
{
|
|
4522
4723
|
style: {
|
|
@@ -4575,7 +4776,7 @@ var SetFilterMenu = ({ column, filterValue, onApplyFilter, onClose, rows, anchor
|
|
|
4575
4776
|
onApplyFilter(null);
|
|
4576
4777
|
onClose();
|
|
4577
4778
|
};
|
|
4578
|
-
return /* @__PURE__ */
|
|
4779
|
+
return /* @__PURE__ */ React15.createElement(
|
|
4579
4780
|
"div",
|
|
4580
4781
|
{
|
|
4581
4782
|
style: {
|
|
@@ -4595,7 +4796,7 @@ var SetFilterMenu = ({ column, filterValue, onApplyFilter, onClose, rows, anchor
|
|
|
4595
4796
|
},
|
|
4596
4797
|
onClick: (e) => e.stopPropagation()
|
|
4597
4798
|
},
|
|
4598
|
-
/* @__PURE__ */
|
|
4799
|
+
/* @__PURE__ */ React15.createElement("div", { style: { marginBottom: "12px" } }, /* @__PURE__ */ React15.createElement(
|
|
4599
4800
|
"input",
|
|
4600
4801
|
{
|
|
4601
4802
|
type: "text",
|
|
@@ -4606,14 +4807,14 @@ var SetFilterMenu = ({ column, filterValue, onApplyFilter, onClose, rows, anchor
|
|
|
4606
4807
|
autoFocus: true
|
|
4607
4808
|
}
|
|
4608
4809
|
)),
|
|
4609
|
-
/* @__PURE__ */
|
|
4810
|
+
/* @__PURE__ */ React15.createElement("div", { style: { marginBottom: "8px" } }, /* @__PURE__ */ React15.createElement(
|
|
4610
4811
|
"label",
|
|
4611
4812
|
{
|
|
4612
4813
|
style: { display: "flex", alignItems: "center", gap: "8px", cursor: "pointer", padding: "8px", borderRadius: "4px" },
|
|
4613
4814
|
onMouseEnter: (e) => e.currentTarget.style.backgroundColor = "var(--grid-hover)",
|
|
4614
4815
|
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "transparent"
|
|
4615
4816
|
},
|
|
4616
|
-
/* @__PURE__ */
|
|
4817
|
+
/* @__PURE__ */ React15.createElement(
|
|
4617
4818
|
"input",
|
|
4618
4819
|
{
|
|
4619
4820
|
type: "checkbox",
|
|
@@ -4622,9 +4823,9 @@ var SetFilterMenu = ({ column, filterValue, onApplyFilter, onClose, rows, anchor
|
|
|
4622
4823
|
style: { width: "16px", height: "16px", cursor: "pointer" }
|
|
4623
4824
|
}
|
|
4624
4825
|
),
|
|
4625
|
-
/* @__PURE__ */
|
|
4826
|
+
/* @__PURE__ */ React15.createElement("span", { style: { fontSize: "var(--grid-font-size, 14px)", fontWeight: 500, color: "var(--grid-text)" } }, "(Select All)")
|
|
4626
4827
|
)),
|
|
4627
|
-
/* @__PURE__ */
|
|
4828
|
+
/* @__PURE__ */ React15.createElement("div", { style: { flex: 1, overflowY: "auto", marginBottom: "12px", border: "1px solid var(--grid-border)", borderRadius: "var(--grid-border-radius, 6px)", maxHeight: "200px" } }, filteredValues.map((value, idx) => /* @__PURE__ */ React15.createElement(
|
|
4628
4829
|
"label",
|
|
4629
4830
|
{
|
|
4630
4831
|
key: idx,
|
|
@@ -4632,7 +4833,7 @@ var SetFilterMenu = ({ column, filterValue, onApplyFilter, onClose, rows, anchor
|
|
|
4632
4833
|
onMouseEnter: (e) => e.currentTarget.style.backgroundColor = "var(--grid-hover)",
|
|
4633
4834
|
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "transparent"
|
|
4634
4835
|
},
|
|
4635
|
-
/* @__PURE__ */
|
|
4836
|
+
/* @__PURE__ */ React15.createElement(
|
|
4636
4837
|
"input",
|
|
4637
4838
|
{
|
|
4638
4839
|
type: "checkbox",
|
|
@@ -4641,9 +4842,9 @@ var SetFilterMenu = ({ column, filterValue, onApplyFilter, onClose, rows, anchor
|
|
|
4641
4842
|
style: { width: "16px", height: "16px", cursor: "pointer" }
|
|
4642
4843
|
}
|
|
4643
4844
|
),
|
|
4644
|
-
/* @__PURE__ */
|
|
4845
|
+
/* @__PURE__ */ React15.createElement("span", { style: { fontSize: "var(--grid-font-size, 14px)", color: "var(--grid-text)" } }, String(value))
|
|
4645
4846
|
))),
|
|
4646
|
-
/* @__PURE__ */
|
|
4847
|
+
/* @__PURE__ */ React15.createElement("div", { style: { display: "flex", gap: "8px", justifyContent: "flex-end", paddingTop: "8px", borderTop: "1px solid var(--grid-border)" } }, /* @__PURE__ */ React15.createElement(
|
|
4647
4848
|
"button",
|
|
4648
4849
|
{
|
|
4649
4850
|
style: {
|
|
@@ -4660,7 +4861,7 @@ var SetFilterMenu = ({ column, filterValue, onApplyFilter, onClose, rows, anchor
|
|
|
4660
4861
|
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "var(--grid-bg-alt)"
|
|
4661
4862
|
},
|
|
4662
4863
|
"Clear"
|
|
4663
|
-
), /* @__PURE__ */
|
|
4864
|
+
), /* @__PURE__ */ React15.createElement(
|
|
4664
4865
|
"button",
|
|
4665
4866
|
{
|
|
4666
4867
|
style: {
|
|
@@ -4683,7 +4884,7 @@ var SetFilterMenu = ({ column, filterValue, onApplyFilter, onClose, rows, anchor
|
|
|
4683
4884
|
);
|
|
4684
4885
|
};
|
|
4685
4886
|
var MultiSelectFilterMenu = ({ column, filterValue, onApplyFilter, onClose, rows, anchorEl }) => {
|
|
4686
|
-
return /* @__PURE__ */
|
|
4887
|
+
return /* @__PURE__ */ React15.createElement(SetFilterMenu, { column, filterValue, onApplyFilter, onClose, rows, anchorEl });
|
|
4687
4888
|
};
|
|
4688
4889
|
var ColumnFilters = ({
|
|
4689
4890
|
columns,
|
|
@@ -4693,7 +4894,9 @@ var ColumnFilters = ({
|
|
|
4693
4894
|
dispatch,
|
|
4694
4895
|
pinnedLeft,
|
|
4695
4896
|
pinnedRight,
|
|
4696
|
-
rows
|
|
4897
|
+
rows,
|
|
4898
|
+
masterDetailConfig,
|
|
4899
|
+
dragRowConfig
|
|
4697
4900
|
}) => {
|
|
4698
4901
|
const [openFilterMenu, setOpenFilterMenu] = useState8(null);
|
|
4699
4902
|
const [filterAnchors, setFilterAnchors] = useState8({});
|
|
@@ -4788,22 +4991,22 @@ var ColumnFilters = ({
|
|
|
4788
4991
|
};
|
|
4789
4992
|
switch (filterType) {
|
|
4790
4993
|
case "number":
|
|
4791
|
-
return /* @__PURE__ */
|
|
4994
|
+
return /* @__PURE__ */ React15.createElement(NumberFilterMenu, { ...commonProps });
|
|
4792
4995
|
case "date":
|
|
4793
|
-
return /* @__PURE__ */
|
|
4996
|
+
return /* @__PURE__ */ React15.createElement(DateFilterMenu, { ...commonProps });
|
|
4794
4997
|
case "set":
|
|
4795
|
-
return /* @__PURE__ */
|
|
4998
|
+
return /* @__PURE__ */ React15.createElement(SetFilterMenu, { ...commonProps });
|
|
4796
4999
|
case "multi":
|
|
4797
|
-
return /* @__PURE__ */
|
|
5000
|
+
return /* @__PURE__ */ React15.createElement(MultiSelectFilterMenu, { ...commonProps });
|
|
4798
5001
|
default:
|
|
4799
|
-
return /* @__PURE__ */
|
|
5002
|
+
return /* @__PURE__ */ React15.createElement(TextFilterMenu, { ...commonProps });
|
|
4800
5003
|
}
|
|
4801
5004
|
};
|
|
4802
5005
|
const renderAdvancedFilterMenu = (column) => {
|
|
4803
5006
|
const filterValue = filterConfig[column.field];
|
|
4804
5007
|
const anchorEl = filterAnchors[column.field];
|
|
4805
5008
|
const advancedFilter = isAdvancedFilter(filterValue) ? filterValue : null;
|
|
4806
|
-
return /* @__PURE__ */
|
|
5009
|
+
return /* @__PURE__ */ React15.createElement(
|
|
4807
5010
|
AdvancedFilterBuilder,
|
|
4808
5011
|
{
|
|
4809
5012
|
column,
|
|
@@ -4833,10 +5036,30 @@ var ColumnFilters = ({
|
|
|
4833
5036
|
const hasActiveFilter = (field) => {
|
|
4834
5037
|
return !!filterConfig[field];
|
|
4835
5038
|
};
|
|
4836
|
-
return /* @__PURE__ */
|
|
5039
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement("div", { style: { display: "flex", minWidth: "100%", borderBottom: "1px solid var(--grid-border)", backgroundColor: "var(--grid-header-bg)" } }, (masterDetailConfig == null ? void 0 : masterDetailConfig.enabled) && /* @__PURE__ */ React15.createElement(
|
|
5040
|
+
"div",
|
|
5041
|
+
{
|
|
5042
|
+
style: {
|
|
5043
|
+
width: "48px",
|
|
5044
|
+
flexShrink: 0,
|
|
5045
|
+
borderRight: "1px solid var(--grid-border)",
|
|
5046
|
+
minHeight: "38px"
|
|
5047
|
+
}
|
|
5048
|
+
}
|
|
5049
|
+
), (dragRowConfig == null ? void 0 : dragRowConfig.enabled) && dragRowConfig.showDragHandle !== false && dragRowConfig.dragHandlePosition === "left" && /* @__PURE__ */ React15.createElement(
|
|
5050
|
+
"div",
|
|
5051
|
+
{
|
|
5052
|
+
style: {
|
|
5053
|
+
width: "32px",
|
|
5054
|
+
flexShrink: 0,
|
|
5055
|
+
borderRight: "1px solid var(--grid-border)",
|
|
5056
|
+
minHeight: "38px"
|
|
5057
|
+
}
|
|
5058
|
+
}
|
|
5059
|
+
), displayColumnOrder.map((field) => {
|
|
4837
5060
|
const column = columnMap.get(field);
|
|
4838
5061
|
if (!column || column.filterable === false) {
|
|
4839
|
-
return /* @__PURE__ */
|
|
5062
|
+
return /* @__PURE__ */ React15.createElement(
|
|
4840
5063
|
"div",
|
|
4841
5064
|
{
|
|
4842
5065
|
key: field,
|
|
@@ -4850,7 +5073,7 @@ var ColumnFilters = ({
|
|
|
4850
5073
|
);
|
|
4851
5074
|
}
|
|
4852
5075
|
const isActive = hasActiveFilter(field);
|
|
4853
|
-
return /* @__PURE__ */
|
|
5076
|
+
return /* @__PURE__ */ React15.createElement(
|
|
4854
5077
|
"div",
|
|
4855
5078
|
{
|
|
4856
5079
|
key: field,
|
|
@@ -4864,7 +5087,7 @@ var ColumnFilters = ({
|
|
|
4864
5087
|
alignItems: "center"
|
|
4865
5088
|
}
|
|
4866
5089
|
},
|
|
4867
|
-
/* @__PURE__ */
|
|
5090
|
+
/* @__PURE__ */ React15.createElement(
|
|
4868
5091
|
"div",
|
|
4869
5092
|
{
|
|
4870
5093
|
style: {
|
|
@@ -4874,7 +5097,7 @@ var ColumnFilters = ({
|
|
|
4874
5097
|
onClick: (e) => handleFilterClick(field, e),
|
|
4875
5098
|
title: "Click to filter, Shift+Click for advanced filter"
|
|
4876
5099
|
},
|
|
4877
|
-
/* @__PURE__ */
|
|
5100
|
+
/* @__PURE__ */ React15.createElement(
|
|
4878
5101
|
"div",
|
|
4879
5102
|
{
|
|
4880
5103
|
style: {
|
|
@@ -4899,13 +5122,13 @@ var ColumnFilters = ({
|
|
|
4899
5122
|
if (!isActive) e.currentTarget.style.borderColor = "var(--grid-border)";
|
|
4900
5123
|
}
|
|
4901
5124
|
},
|
|
4902
|
-
/* @__PURE__ */
|
|
5125
|
+
/* @__PURE__ */ React15.createElement("span", { style: {
|
|
4903
5126
|
flex: 1,
|
|
4904
5127
|
overflow: "hidden",
|
|
4905
5128
|
textOverflow: "ellipsis",
|
|
4906
5129
|
whiteSpace: "nowrap"
|
|
4907
5130
|
} }, isActive ? getFilterDisplayText(field) : "Filter..."),
|
|
4908
|
-
/* @__PURE__ */
|
|
5131
|
+
/* @__PURE__ */ React15.createElement(
|
|
4909
5132
|
"svg",
|
|
4910
5133
|
{
|
|
4911
5134
|
style: {
|
|
@@ -4919,7 +5142,7 @@ var ColumnFilters = ({
|
|
|
4919
5142
|
viewBox: "0 0 24 24",
|
|
4920
5143
|
strokeWidth: "2.5"
|
|
4921
5144
|
},
|
|
4922
|
-
/* @__PURE__ */
|
|
5145
|
+
/* @__PURE__ */ React15.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 4h18v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V20l-4-2v-3.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z" })
|
|
4923
5146
|
)
|
|
4924
5147
|
)
|
|
4925
5148
|
),
|
|
@@ -4930,7 +5153,7 @@ var ColumnFilters = ({
|
|
|
4930
5153
|
};
|
|
4931
5154
|
|
|
4932
5155
|
// src/components/DataGrid/LayoutPresetsManager.tsx
|
|
4933
|
-
import
|
|
5156
|
+
import React16, { useState as useState9, useEffect as useEffect5, useCallback as useCallback2 } from "react";
|
|
4934
5157
|
var LayoutPresetsManager = ({
|
|
4935
5158
|
manager,
|
|
4936
5159
|
currentLayout,
|
|
@@ -5039,7 +5262,7 @@ var LayoutPresetsManager = ({
|
|
|
5039
5262
|
const formatDate2 = (timestamp) => {
|
|
5040
5263
|
return new Date(timestamp).toLocaleString();
|
|
5041
5264
|
};
|
|
5042
|
-
return /* @__PURE__ */
|
|
5265
|
+
return /* @__PURE__ */ React16.createElement("div", { className: "relative inline-block" }, /* @__PURE__ */ React16.createElement(
|
|
5043
5266
|
"button",
|
|
5044
5267
|
{
|
|
5045
5268
|
onClick: () => setShowMenu(!showMenu),
|
|
@@ -5056,10 +5279,10 @@ var LayoutPresetsManager = ({
|
|
|
5056
5279
|
},
|
|
5057
5280
|
disabled: loading
|
|
5058
5281
|
},
|
|
5059
|
-
/* @__PURE__ */
|
|
5282
|
+
/* @__PURE__ */ React16.createElement("svg", { style: { width: "14px", height: "14px", flexShrink: 0 }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" }, /* @__PURE__ */ React16.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 7h16M4 12h16M4 17h16" })),
|
|
5060
5283
|
"Layout Presets",
|
|
5061
|
-
/* @__PURE__ */
|
|
5062
|
-
), showMenu && /* @__PURE__ */
|
|
5284
|
+
/* @__PURE__ */ React16.createElement("svg", { style: { width: "14px", height: "14px", flexShrink: 0, transform: showMenu ? "rotate(180deg)" : "rotate(0deg)", transition: "transform 0.2s" }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" }, /* @__PURE__ */ React16.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }))
|
|
5285
|
+
), showMenu && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
|
|
5063
5286
|
"div",
|
|
5064
5287
|
{
|
|
5065
5288
|
style: {
|
|
@@ -5069,7 +5292,7 @@ var LayoutPresetsManager = ({
|
|
|
5069
5292
|
},
|
|
5070
5293
|
onClick: () => setShowMenu(false)
|
|
5071
5294
|
}
|
|
5072
|
-
), /* @__PURE__ */
|
|
5295
|
+
), /* @__PURE__ */ React16.createElement("div", { style: {
|
|
5073
5296
|
position: "absolute",
|
|
5074
5297
|
right: 0,
|
|
5075
5298
|
marginTop: "8px",
|
|
@@ -5081,7 +5304,7 @@ var LayoutPresetsManager = ({
|
|
|
5081
5304
|
zIndex: 20,
|
|
5082
5305
|
maxHeight: "384px",
|
|
5083
5306
|
overflowY: "auto"
|
|
5084
|
-
} }, /* @__PURE__ */
|
|
5307
|
+
} }, /* @__PURE__ */ React16.createElement("div", { style: { padding: "12px", borderBottom: "1px solid #e5e7eb", backgroundColor: "#f9fafb" } }, /* @__PURE__ */ React16.createElement("h3", { style: { fontWeight: "600", fontSize: "14px", color: "#111827" } }, "Layout Presets")), error && /* @__PURE__ */ React16.createElement("div", { style: { padding: "12px", backgroundColor: "#fef2f2", borderBottom: "1px solid #fecaca" } }, /* @__PURE__ */ React16.createElement("p", { style: { fontSize: "14px", color: "#dc2626" } }, error)), /* @__PURE__ */ React16.createElement("div", { style: { padding: "8px", borderBottom: "1px solid #e5e7eb", display: "flex", gap: "8px" } }, /* @__PURE__ */ React16.createElement(
|
|
5085
5308
|
"button",
|
|
5086
5309
|
{
|
|
5087
5310
|
onClick: () => {
|
|
@@ -5103,9 +5326,9 @@ var LayoutPresetsManager = ({
|
|
|
5103
5326
|
gap: "8px"
|
|
5104
5327
|
}
|
|
5105
5328
|
},
|
|
5106
|
-
/* @__PURE__ */
|
|
5329
|
+
/* @__PURE__ */ React16.createElement("svg", { style: { width: "14px", height: "14px", flexShrink: 0 }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" }, /* @__PURE__ */ React16.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4" })),
|
|
5107
5330
|
"Save Current"
|
|
5108
|
-
), /* @__PURE__ */
|
|
5331
|
+
), /* @__PURE__ */ React16.createElement(
|
|
5109
5332
|
"button",
|
|
5110
5333
|
{
|
|
5111
5334
|
onClick: () => {
|
|
@@ -5127,9 +5350,9 @@ var LayoutPresetsManager = ({
|
|
|
5127
5350
|
gap: "8px"
|
|
5128
5351
|
}
|
|
5129
5352
|
},
|
|
5130
|
-
/* @__PURE__ */
|
|
5353
|
+
/* @__PURE__ */ React16.createElement("svg", { style: { width: "14px", height: "14px", flexShrink: 0 }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" }, /* @__PURE__ */ React16.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" })),
|
|
5131
5354
|
"Reset"
|
|
5132
|
-
)), /* @__PURE__ */
|
|
5355
|
+
)), /* @__PURE__ */ React16.createElement("div", { style: { maxHeight: "256px", overflowY: "auto" } }, loading && presets.length === 0 ? /* @__PURE__ */ React16.createElement("div", { style: { padding: "16px", textAlign: "center", color: "#6b7280", fontSize: "14px" } }, "Loading presets...") : presets.length === 0 ? /* @__PURE__ */ React16.createElement("div", { style: { padding: "16px", textAlign: "center", color: "#6b7280", fontSize: "14px" } }, "No saved presets. Save your current layout to get started.") : /* @__PURE__ */ React16.createElement("div", null, presets.map((preset) => /* @__PURE__ */ React16.createElement(
|
|
5133
5356
|
"div",
|
|
5134
5357
|
{
|
|
5135
5358
|
key: preset.id,
|
|
@@ -5150,7 +5373,7 @@ var LayoutPresetsManager = ({
|
|
|
5150
5373
|
if (buttons) buttons.style.opacity = "0";
|
|
5151
5374
|
}
|
|
5152
5375
|
},
|
|
5153
|
-
/* @__PURE__ */
|
|
5376
|
+
/* @__PURE__ */ React16.createElement("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between" } }, /* @__PURE__ */ React16.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React16.createElement("h4", { style: { fontSize: "14px", fontWeight: "500", color: "#111827", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, preset.name), preset.description && /* @__PURE__ */ React16.createElement("p", { style: { fontSize: "12px", color: "#6b7280", marginTop: "4px", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, preset.description), /* @__PURE__ */ React16.createElement("p", { style: { fontSize: "12px", color: "#9ca3af", marginTop: "4px" } }, "Updated: ", formatDate2(preset.updatedAt))), /* @__PURE__ */ React16.createElement("div", { className: "preset-actions", style: { display: "flex", gap: "4px", marginLeft: "8px", opacity: 0, transition: "opacity 0.2s" } }, /* @__PURE__ */ React16.createElement(
|
|
5154
5377
|
"button",
|
|
5155
5378
|
{
|
|
5156
5379
|
onClick: (e) => handleUpdatePreset(preset, e),
|
|
@@ -5166,8 +5389,8 @@ var LayoutPresetsManager = ({
|
|
|
5166
5389
|
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "transparent",
|
|
5167
5390
|
title: "Update with current layout"
|
|
5168
5391
|
},
|
|
5169
|
-
/* @__PURE__ */
|
|
5170
|
-
), /* @__PURE__ */
|
|
5392
|
+
/* @__PURE__ */ React16.createElement("svg", { style: { width: "14px", height: "14px" }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" }, /* @__PURE__ */ React16.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" }))
|
|
5393
|
+
), /* @__PURE__ */ React16.createElement(
|
|
5171
5394
|
"button",
|
|
5172
5395
|
{
|
|
5173
5396
|
onClick: (e) => handleDeletePreset(preset.id, e),
|
|
@@ -5183,9 +5406,9 @@ var LayoutPresetsManager = ({
|
|
|
5183
5406
|
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "transparent",
|
|
5184
5407
|
title: "Delete preset"
|
|
5185
5408
|
},
|
|
5186
|
-
/* @__PURE__ */
|
|
5409
|
+
/* @__PURE__ */ React16.createElement("svg", { style: { width: "14px", height: "14px" }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" }, /* @__PURE__ */ React16.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" }))
|
|
5187
5410
|
)))
|
|
5188
|
-
)))))), showSaveDialog && /* @__PURE__ */
|
|
5411
|
+
)))))), showSaveDialog && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
|
|
5189
5412
|
"div",
|
|
5190
5413
|
{
|
|
5191
5414
|
style: {
|
|
@@ -5199,7 +5422,7 @@ var LayoutPresetsManager = ({
|
|
|
5199
5422
|
},
|
|
5200
5423
|
onClick: () => setShowSaveDialog(false)
|
|
5201
5424
|
}
|
|
5202
|
-
), /* @__PURE__ */
|
|
5425
|
+
), /* @__PURE__ */ React16.createElement("div", { style: { position: "fixed", inset: 0, zIndex: 40, display: "flex", alignItems: "center", justifyContent: "center", padding: "16px" } }, /* @__PURE__ */ React16.createElement(
|
|
5203
5426
|
"div",
|
|
5204
5427
|
{
|
|
5205
5428
|
style: {
|
|
@@ -5212,9 +5435,9 @@ var LayoutPresetsManager = ({
|
|
|
5212
5435
|
},
|
|
5213
5436
|
onClick: (e) => e.stopPropagation()
|
|
5214
5437
|
},
|
|
5215
|
-
/* @__PURE__ */
|
|
5216
|
-
error && /* @__PURE__ */
|
|
5217
|
-
/* @__PURE__ */
|
|
5438
|
+
/* @__PURE__ */ React16.createElement("h2", { style: { fontSize: "20px", fontWeight: "600", marginBottom: "16px" } }, "Save Layout Preset"),
|
|
5439
|
+
error && /* @__PURE__ */ React16.createElement("div", { style: { marginBottom: "16px", padding: "12px", backgroundColor: "#fef2f2", border: "1px solid #fecaca", borderRadius: "4px" } }, /* @__PURE__ */ React16.createElement("p", { style: { fontSize: "14px", color: "#dc2626" } }, error)),
|
|
5440
|
+
/* @__PURE__ */ React16.createElement("div", null, /* @__PURE__ */ React16.createElement("div", { style: { marginBottom: "16px" } }, /* @__PURE__ */ React16.createElement("label", { htmlFor: "preset-name", style: { display: "block", fontSize: "14px", fontWeight: "500", color: "#374151", marginBottom: "4px" } }, "Preset Name *"), /* @__PURE__ */ React16.createElement(
|
|
5218
5441
|
"input",
|
|
5219
5442
|
{
|
|
5220
5443
|
id: "preset-name",
|
|
@@ -5231,7 +5454,7 @@ var LayoutPresetsManager = ({
|
|
|
5231
5454
|
placeholder: "e.g., Sales Dashboard Layout",
|
|
5232
5455
|
autoFocus: true
|
|
5233
5456
|
}
|
|
5234
|
-
)), /* @__PURE__ */
|
|
5457
|
+
)), /* @__PURE__ */ React16.createElement("div", null, /* @__PURE__ */ React16.createElement("label", { htmlFor: "preset-description", style: { display: "block", fontSize: "14px", fontWeight: "500", color: "#374151", marginBottom: "4px" } }, "Description (optional)"), /* @__PURE__ */ React16.createElement(
|
|
5235
5458
|
"textarea",
|
|
5236
5459
|
{
|
|
5237
5460
|
id: "preset-description",
|
|
@@ -5248,7 +5471,7 @@ var LayoutPresetsManager = ({
|
|
|
5248
5471
|
rows: 3
|
|
5249
5472
|
}
|
|
5250
5473
|
))),
|
|
5251
|
-
/* @__PURE__ */
|
|
5474
|
+
/* @__PURE__ */ React16.createElement("div", { style: { marginTop: "24px", display: "flex", gap: "12px", justifyContent: "flex-end" } }, /* @__PURE__ */ React16.createElement(
|
|
5252
5475
|
"button",
|
|
5253
5476
|
{
|
|
5254
5477
|
onClick: () => {
|
|
@@ -5271,7 +5494,7 @@ var LayoutPresetsManager = ({
|
|
|
5271
5494
|
disabled: loading
|
|
5272
5495
|
},
|
|
5273
5496
|
"Cancel"
|
|
5274
|
-
), /* @__PURE__ */
|
|
5497
|
+
), /* @__PURE__ */ React16.createElement(
|
|
5275
5498
|
"button",
|
|
5276
5499
|
{
|
|
5277
5500
|
onClick: handleSavePreset,
|
|
@@ -5294,7 +5517,7 @@ var LayoutPresetsManager = ({
|
|
|
5294
5517
|
};
|
|
5295
5518
|
|
|
5296
5519
|
// src/components/DataGrid/ContextMenu.tsx
|
|
5297
|
-
import
|
|
5520
|
+
import React17, { useEffect as useEffect6, useRef as useRef6, useCallback as useCallback3 } from "react";
|
|
5298
5521
|
var ContextMenu = ({
|
|
5299
5522
|
x,
|
|
5300
5523
|
y,
|
|
@@ -5302,7 +5525,7 @@ var ContextMenu = ({
|
|
|
5302
5525
|
onClose
|
|
5303
5526
|
}) => {
|
|
5304
5527
|
const menuRef = useRef6(null);
|
|
5305
|
-
const [openSubmenu, setOpenSubmenu] =
|
|
5528
|
+
const [openSubmenu, setOpenSubmenu] = React17.useState(null);
|
|
5306
5529
|
useEffect6(() => {
|
|
5307
5530
|
const handleClickOutside = (event) => {
|
|
5308
5531
|
if (menuRef.current && !menuRef.current.contains(event.target)) {
|
|
@@ -5371,7 +5594,7 @@ var ContextMenu = ({
|
|
|
5371
5594
|
}, [onClose, openSubmenu]);
|
|
5372
5595
|
const renderMenuItem = (item, index) => {
|
|
5373
5596
|
if (item.type === "separator") {
|
|
5374
|
-
return /* @__PURE__ */
|
|
5597
|
+
return /* @__PURE__ */ React17.createElement(
|
|
5375
5598
|
"div",
|
|
5376
5599
|
{
|
|
5377
5600
|
key: `separator-${index}`,
|
|
@@ -5380,7 +5603,7 @@ var ContextMenu = ({
|
|
|
5380
5603
|
}
|
|
5381
5604
|
);
|
|
5382
5605
|
}
|
|
5383
|
-
return /* @__PURE__ */
|
|
5606
|
+
return /* @__PURE__ */ React17.createElement("div", { key: item.id || index, className: "context-menu-item-wrapper" }, /* @__PURE__ */ React17.createElement(
|
|
5384
5607
|
"div",
|
|
5385
5608
|
{
|
|
5386
5609
|
className: `context-menu-item ${item.disabled ? "disabled" : ""} ${item.danger ? "danger" : ""} ${item.submenu ? "has-submenu" : ""}`,
|
|
@@ -5389,13 +5612,13 @@ var ContextMenu = ({
|
|
|
5389
5612
|
"aria-disabled": item.disabled,
|
|
5390
5613
|
tabIndex: item.disabled ? -1 : 0
|
|
5391
5614
|
},
|
|
5392
|
-
item.icon && /* @__PURE__ */
|
|
5393
|
-
/* @__PURE__ */
|
|
5394
|
-
item.shortcut && /* @__PURE__ */
|
|
5395
|
-
item.submenu && /* @__PURE__ */
|
|
5396
|
-
), item.submenu && openSubmenu === item.id && /* @__PURE__ */
|
|
5615
|
+
item.icon && /* @__PURE__ */ React17.createElement("span", { className: "context-menu-icon" }, item.icon),
|
|
5616
|
+
/* @__PURE__ */ React17.createElement("span", { className: "context-menu-label" }, item.label),
|
|
5617
|
+
item.shortcut && /* @__PURE__ */ React17.createElement("span", { className: "context-menu-shortcut" }, item.shortcut),
|
|
5618
|
+
item.submenu && /* @__PURE__ */ React17.createElement("span", { className: "context-menu-arrow" }, "\u25B6")
|
|
5619
|
+
), item.submenu && openSubmenu === item.id && /* @__PURE__ */ React17.createElement("div", { className: "context-menu-submenu" }, item.submenu.map((subItem, subIndex) => renderMenuItem(subItem, subIndex))));
|
|
5397
5620
|
};
|
|
5398
|
-
return /* @__PURE__ */
|
|
5621
|
+
return /* @__PURE__ */ React17.createElement(
|
|
5399
5622
|
"div",
|
|
5400
5623
|
{
|
|
5401
5624
|
ref: menuRef,
|
|
@@ -5871,7 +6094,7 @@ var useContextMenu = ({
|
|
|
5871
6094
|
};
|
|
5872
6095
|
|
|
5873
6096
|
// src/components/DataGrid/Tooltip.tsx
|
|
5874
|
-
import
|
|
6097
|
+
import React18, { useLayoutEffect, useRef as useRef7, useState as useState11 } from "react";
|
|
5875
6098
|
import { createPortal as createPortal2 } from "react-dom";
|
|
5876
6099
|
var Tooltip = ({
|
|
5877
6100
|
state,
|
|
@@ -5959,7 +6182,7 @@ var Tooltip = ({
|
|
|
5959
6182
|
return null;
|
|
5960
6183
|
}
|
|
5961
6184
|
const content = typeof state.content === "string" ? { content: state.content } : state.content;
|
|
5962
|
-
const tooltipElement = /* @__PURE__ */
|
|
6185
|
+
const tooltipElement = /* @__PURE__ */ React18.createElement(
|
|
5963
6186
|
"div",
|
|
5964
6187
|
{
|
|
5965
6188
|
ref: tooltipRef,
|
|
@@ -5976,7 +6199,7 @@ var Tooltip = ({
|
|
|
5976
6199
|
transition: "opacity 0.15s ease-in-out"
|
|
5977
6200
|
}
|
|
5978
6201
|
},
|
|
5979
|
-
/* @__PURE__ */
|
|
6202
|
+
/* @__PURE__ */ React18.createElement(
|
|
5980
6203
|
"div",
|
|
5981
6204
|
{
|
|
5982
6205
|
style: {
|
|
@@ -5990,7 +6213,7 @@ var Tooltip = ({
|
|
|
5990
6213
|
wordWrap: "break-word"
|
|
5991
6214
|
}
|
|
5992
6215
|
},
|
|
5993
|
-
content.title && /* @__PURE__ */
|
|
6216
|
+
content.title && /* @__PURE__ */ React18.createElement(
|
|
5994
6217
|
"div",
|
|
5995
6218
|
{
|
|
5996
6219
|
style: {
|
|
@@ -6001,9 +6224,9 @@ var Tooltip = ({
|
|
|
6001
6224
|
},
|
|
6002
6225
|
content.title
|
|
6003
6226
|
),
|
|
6004
|
-
/* @__PURE__ */
|
|
6227
|
+
/* @__PURE__ */ React18.createElement("div", null, content.content)
|
|
6005
6228
|
),
|
|
6006
|
-
/* @__PURE__ */
|
|
6229
|
+
/* @__PURE__ */ React18.createElement(
|
|
6007
6230
|
"div",
|
|
6008
6231
|
{
|
|
6009
6232
|
style: {
|
|
@@ -6173,7 +6396,7 @@ var useTooltip = ({ config = {} } = {}) => {
|
|
|
6173
6396
|
};
|
|
6174
6397
|
|
|
6175
6398
|
// src/components/DataGrid/DensityToggle.tsx
|
|
6176
|
-
import
|
|
6399
|
+
import React19 from "react";
|
|
6177
6400
|
|
|
6178
6401
|
// src/components/DataGrid/densityModes.ts
|
|
6179
6402
|
var densityConfigs = {
|
|
@@ -6262,7 +6485,7 @@ var DensityToggle = ({
|
|
|
6262
6485
|
disabled = false
|
|
6263
6486
|
}) => {
|
|
6264
6487
|
const modes = ["ultraCompact", "compact", "normal", "comfortable"];
|
|
6265
|
-
return /* @__PURE__ */
|
|
6488
|
+
return /* @__PURE__ */ React19.createElement(
|
|
6266
6489
|
"div",
|
|
6267
6490
|
{
|
|
6268
6491
|
className: `density-toggle ${className}`,
|
|
@@ -6277,7 +6500,7 @@ var DensityToggle = ({
|
|
|
6277
6500
|
role: "group",
|
|
6278
6501
|
"aria-label": "Density mode selector"
|
|
6279
6502
|
},
|
|
6280
|
-
modes.map((mode) => /* @__PURE__ */
|
|
6503
|
+
modes.map((mode) => /* @__PURE__ */ React19.createElement(
|
|
6281
6504
|
"button",
|
|
6282
6505
|
{
|
|
6283
6506
|
key: mode,
|
|
@@ -7124,9 +7347,9 @@ function generateThemeCSS(theme) {
|
|
|
7124
7347
|
}
|
|
7125
7348
|
|
|
7126
7349
|
// src/components/DataGrid/useScreenReaderAnnouncements.tsx
|
|
7127
|
-
import
|
|
7350
|
+
import React20, { useRef as useRef9, useCallback as useCallback6, useEffect as useEffect8 } from "react";
|
|
7128
7351
|
var useScreenReaderAnnouncements = () => {
|
|
7129
|
-
const announcementRef =
|
|
7352
|
+
const announcementRef = React20.useRef("");
|
|
7130
7353
|
const timeoutRef = useRef9(null);
|
|
7131
7354
|
useEffect8(() => {
|
|
7132
7355
|
return () => {
|
|
@@ -7220,12 +7443,12 @@ var useScreenReaderAnnouncements = () => {
|
|
|
7220
7443
|
};
|
|
7221
7444
|
|
|
7222
7445
|
// src/components/DataGrid/ScreenReaderAnnouncer.tsx
|
|
7223
|
-
import
|
|
7446
|
+
import React21 from "react";
|
|
7224
7447
|
var ScreenReaderAnnouncer = ({
|
|
7225
7448
|
message,
|
|
7226
7449
|
priority = "polite"
|
|
7227
7450
|
}) => {
|
|
7228
|
-
return /* @__PURE__ */
|
|
7451
|
+
return /* @__PURE__ */ React21.createElement(
|
|
7229
7452
|
"div",
|
|
7230
7453
|
{
|
|
7231
7454
|
role: priority === "assertive" ? "alert" : "status",
|
|
@@ -8314,6 +8537,7 @@ var DataGrid = forwardRef(({
|
|
|
8314
8537
|
contextMenuConfig,
|
|
8315
8538
|
tooltipConfig,
|
|
8316
8539
|
pivotConfig,
|
|
8540
|
+
masterDetailConfig,
|
|
8317
8541
|
tableId,
|
|
8318
8542
|
theme: _theme = "quartz",
|
|
8319
8543
|
densityMode: _densityMode = "normal",
|
|
@@ -8355,7 +8579,7 @@ var DataGrid = forwardRef(({
|
|
|
8355
8579
|
renderCell: col.isTotalColumn || col.isPivotColumn ? (row) => {
|
|
8356
8580
|
const value = row[col.field];
|
|
8357
8581
|
if (typeof value === "number") {
|
|
8358
|
-
return /* @__PURE__ */
|
|
8582
|
+
return /* @__PURE__ */ React22.createElement("span", { style: {
|
|
8359
8583
|
fontWeight: col.isTotalColumn ? "700" : "600",
|
|
8360
8584
|
color: col.isTotalColumn ? "#0f766e" : "#475569"
|
|
8361
8585
|
} }, value.toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 }));
|
|
@@ -8390,6 +8614,15 @@ var DataGrid = forwardRef(({
|
|
|
8390
8614
|
setDensityMode(_densityMode);
|
|
8391
8615
|
}
|
|
8392
8616
|
}, [_densityMode, densityMode, setDensityMode]);
|
|
8617
|
+
useEffect9(() => {
|
|
8618
|
+
if ((masterDetailConfig == null ? void 0 : masterDetailConfig.enabled) && masterDetailConfig.defaultExpandedMasterRowKeys) {
|
|
8619
|
+
const expandedRows = {};
|
|
8620
|
+
masterDetailConfig.defaultExpandedMasterRowKeys.forEach((key) => {
|
|
8621
|
+
expandedRows[String(key)] = true;
|
|
8622
|
+
});
|
|
8623
|
+
dispatch({ type: "SET_EXPANDED_MASTER_ROWS", payload: expandedRows });
|
|
8624
|
+
}
|
|
8625
|
+
}, [masterDetailConfig == null ? void 0 : masterDetailConfig.enabled, masterDetailConfig == null ? void 0 : masterDetailConfig.defaultExpandedMasterRowKeys]);
|
|
8393
8626
|
const themeStyles = useMemo4(() => {
|
|
8394
8627
|
const currentTheme = getTheme(_theme);
|
|
8395
8628
|
return generateThemeCSS(currentTheme);
|
|
@@ -8749,7 +8982,7 @@ var DataGrid = forwardRef(({
|
|
|
8749
8982
|
},
|
|
8750
8983
|
[onCellEdit, paginatedRows, rows]
|
|
8751
8984
|
);
|
|
8752
|
-
return /* @__PURE__ */
|
|
8985
|
+
return /* @__PURE__ */ React22.createElement(
|
|
8753
8986
|
"div",
|
|
8754
8987
|
{
|
|
8755
8988
|
ref: containerRef,
|
|
@@ -8770,8 +9003,8 @@ var DataGrid = forwardRef(({
|
|
|
8770
9003
|
},
|
|
8771
9004
|
className: `data-grid density-${densityMode}`
|
|
8772
9005
|
},
|
|
8773
|
-
/* @__PURE__ */
|
|
8774
|
-
/* @__PURE__ */
|
|
9006
|
+
/* @__PURE__ */ React22.createElement(ScreenReaderAnnouncer, { message: announcementMessage, priority: "polite" }),
|
|
9007
|
+
/* @__PURE__ */ React22.createElement("div", { style: { position: "relative", display: "flex", alignItems: "center", justifyContent: "space-between", paddingLeft: "16px", paddingRight: "16px", paddingTop: "10px", paddingBottom: "10px", backgroundColor: "var(--grid-bg-alt)", borderBottom: "var(--grid-border-width, 1px) solid var(--grid-border)", zIndex: 30 } }, /* @__PURE__ */ React22.createElement("div", { style: { position: "relative", display: "flex", alignItems: "center", gap: "8px" } }, /* @__PURE__ */ React22.createElement(
|
|
8775
9008
|
ColumnChooser,
|
|
8776
9009
|
{
|
|
8777
9010
|
columns: effectiveColumns,
|
|
@@ -8781,7 +9014,7 @@ var DataGrid = forwardRef(({
|
|
|
8781
9014
|
onReorderColumns: (fromIndex, toIndex) => dispatch({ type: "REORDER_COLUMNS", payload: { fromIndex, toIndex } }),
|
|
8782
9015
|
onResetLayout: () => dispatch({ type: "RESET_COLUMN_LAYOUT" })
|
|
8783
9016
|
}
|
|
8784
|
-
), /* @__PURE__ */
|
|
9017
|
+
), /* @__PURE__ */ React22.createElement(
|
|
8785
9018
|
ExportMenu,
|
|
8786
9019
|
{
|
|
8787
9020
|
columns: effectiveColumns,
|
|
@@ -8790,7 +9023,7 @@ var DataGrid = forwardRef(({
|
|
|
8790
9023
|
selectedRows: state.selection.selectedRows,
|
|
8791
9024
|
currentPageData: paginatedRows.filter((r) => !("isGroup" in r))
|
|
8792
9025
|
}
|
|
8793
|
-
), (persistenceConfig == null ? void 0 : persistenceConfig.enabled) && persistenceManager && /* @__PURE__ */
|
|
9026
|
+
), (persistenceConfig == null ? void 0 : persistenceConfig.enabled) && persistenceManager && /* @__PURE__ */ React22.createElement(
|
|
8794
9027
|
LayoutPresetsManager,
|
|
8795
9028
|
{
|
|
8796
9029
|
manager: persistenceManager,
|
|
@@ -8798,8 +9031,8 @@ var DataGrid = forwardRef(({
|
|
|
8798
9031
|
onLoadPreset: (layout) => dispatch({ type: "LOAD_LAYOUT_PRESET", payload: layout }),
|
|
8799
9032
|
onResetLayout: () => dispatch({ type: "RESET_COLUMN_LAYOUT" })
|
|
8800
9033
|
}
|
|
8801
|
-
)), showDensityToggle && /* @__PURE__ */
|
|
8802
|
-
/* @__PURE__ */
|
|
9034
|
+
)), showDensityToggle && /* @__PURE__ */ React22.createElement("div", { style: { display: "flex", alignItems: "center", gap: "8px" } }, /* @__PURE__ */ React22.createElement("span", { style: { fontSize: "13px", color: "var(--grid-text-secondary)", fontWeight: "500" } }, "Density:"), /* @__PURE__ */ React22.createElement(DensityToggle, { value: densityMode, onChange: setDensityMode }))),
|
|
9035
|
+
/* @__PURE__ */ React22.createElement(
|
|
8803
9036
|
GroupByPanel,
|
|
8804
9037
|
{
|
|
8805
9038
|
columns: effectiveColumns,
|
|
@@ -8807,7 +9040,7 @@ var DataGrid = forwardRef(({
|
|
|
8807
9040
|
dispatch
|
|
8808
9041
|
}
|
|
8809
9042
|
),
|
|
8810
|
-
/* @__PURE__ */
|
|
9043
|
+
/* @__PURE__ */ React22.createElement("div", { role: "rowgroup", style: { position: "sticky", top: 0, zIndex: 20, width: "100%" } }, /* @__PURE__ */ React22.createElement(
|
|
8811
9044
|
GridHeader,
|
|
8812
9045
|
{
|
|
8813
9046
|
columns: effectiveColumns,
|
|
@@ -8819,6 +9052,8 @@ var DataGrid = forwardRef(({
|
|
|
8819
9052
|
pinnedLeft: pinnedLeftFields,
|
|
8820
9053
|
pinnedRight: pinnedRightFields,
|
|
8821
9054
|
showColumnPinning,
|
|
9055
|
+
masterDetailConfig,
|
|
9056
|
+
dragRowConfig,
|
|
8822
9057
|
onContextMenu: (event, column, columnIndex) => handleContextMenu({
|
|
8823
9058
|
type: "header",
|
|
8824
9059
|
column,
|
|
@@ -8826,7 +9061,7 @@ var DataGrid = forwardRef(({
|
|
|
8826
9061
|
event
|
|
8827
9062
|
})
|
|
8828
9063
|
}
|
|
8829
|
-
), /* @__PURE__ */
|
|
9064
|
+
), /* @__PURE__ */ React22.createElement(
|
|
8830
9065
|
ColumnFilters,
|
|
8831
9066
|
{
|
|
8832
9067
|
columns: effectiveColumns,
|
|
@@ -8836,10 +9071,12 @@ var DataGrid = forwardRef(({
|
|
|
8836
9071
|
dispatch,
|
|
8837
9072
|
pinnedLeft: pinnedLeftFields,
|
|
8838
9073
|
pinnedRight: pinnedRightFields,
|
|
8839
|
-
rows: filteredRows
|
|
9074
|
+
rows: filteredRows,
|
|
9075
|
+
masterDetailConfig,
|
|
9076
|
+
dragRowConfig
|
|
8840
9077
|
}
|
|
8841
9078
|
)),
|
|
8842
|
-
/* @__PURE__ */
|
|
9079
|
+
/* @__PURE__ */ React22.createElement(
|
|
8843
9080
|
GridBody,
|
|
8844
9081
|
{
|
|
8845
9082
|
columns: effectiveColumns,
|
|
@@ -8863,6 +9100,8 @@ var DataGrid = forwardRef(({
|
|
|
8863
9100
|
virtualScrollConfig,
|
|
8864
9101
|
treeConfig,
|
|
8865
9102
|
dragRowConfig,
|
|
9103
|
+
masterDetailConfig,
|
|
9104
|
+
expandedMasterRows: state.detailRowState.expandedMasterRows,
|
|
8866
9105
|
tableId,
|
|
8867
9106
|
onRowReorder,
|
|
8868
9107
|
currentPage: state.currentPage,
|
|
@@ -8879,7 +9118,7 @@ var DataGrid = forwardRef(({
|
|
|
8879
9118
|
...tooltipHandlers
|
|
8880
9119
|
}
|
|
8881
9120
|
),
|
|
8882
|
-
(footerConfig == null ? void 0 : footerConfig.show) && footerConfig.aggregates && /* @__PURE__ */
|
|
9121
|
+
(footerConfig == null ? void 0 : footerConfig.show) && footerConfig.aggregates && /* @__PURE__ */ React22.createElement(
|
|
8883
9122
|
GridFooter,
|
|
8884
9123
|
{
|
|
8885
9124
|
columns: effectiveColumns,
|
|
@@ -8891,7 +9130,7 @@ var DataGrid = forwardRef(({
|
|
|
8891
9130
|
pinnedRight: pinnedRightFields
|
|
8892
9131
|
}
|
|
8893
9132
|
),
|
|
8894
|
-
!(virtualScrollConfig == null ? void 0 : virtualScrollConfig.enabled) && /* @__PURE__ */
|
|
9133
|
+
!(virtualScrollConfig == null ? void 0 : virtualScrollConfig.enabled) && /* @__PURE__ */ React22.createElement(
|
|
8895
9134
|
GridPagination,
|
|
8896
9135
|
{
|
|
8897
9136
|
currentPage: state.currentPage,
|
|
@@ -8900,7 +9139,7 @@ var DataGrid = forwardRef(({
|
|
|
8900
9139
|
dispatch
|
|
8901
9140
|
}
|
|
8902
9141
|
),
|
|
8903
|
-
contextMenu.isOpen && /* @__PURE__ */
|
|
9142
|
+
contextMenu.isOpen && /* @__PURE__ */ React22.createElement(
|
|
8904
9143
|
ContextMenu,
|
|
8905
9144
|
{
|
|
8906
9145
|
x: contextMenu.x,
|
|
@@ -8909,7 +9148,7 @@ var DataGrid = forwardRef(({
|
|
|
8909
9148
|
onClose: closeContextMenu
|
|
8910
9149
|
}
|
|
8911
9150
|
),
|
|
8912
|
-
(tooltipConfig == null ? void 0 : tooltipConfig.enabled) && /* @__PURE__ */
|
|
9151
|
+
(tooltipConfig == null ? void 0 : tooltipConfig.enabled) && /* @__PURE__ */ React22.createElement(
|
|
8913
9152
|
Tooltip,
|
|
8914
9153
|
{
|
|
8915
9154
|
state: tooltipState,
|
|
@@ -8922,12 +9161,12 @@ var DataGrid = forwardRef(({
|
|
|
8922
9161
|
DataGrid.displayName = "DataGrid";
|
|
8923
9162
|
|
|
8924
9163
|
// src/components/DataGrid/FacetedSearch.tsx
|
|
8925
|
-
import
|
|
8926
|
-
var XIcon = () => /* @__PURE__ */
|
|
8927
|
-
var SearchIcon = () => /* @__PURE__ */
|
|
8928
|
-
var ChevronDownIcon = () => /* @__PURE__ */
|
|
8929
|
-
var ChevronRightIcon = () => /* @__PURE__ */
|
|
8930
|
-
var FilterIcon = () => /* @__PURE__ */
|
|
9164
|
+
import React23, { useState as useState15, useMemo as useMemo5 } from "react";
|
|
9165
|
+
var XIcon = () => /* @__PURE__ */ React23.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React23.createElement("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /* @__PURE__ */ React23.createElement("line", { x1: "6", y1: "6", x2: "18", y2: "18" }));
|
|
9166
|
+
var SearchIcon = () => /* @__PURE__ */ React23.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React23.createElement("circle", { cx: "11", cy: "11", r: "8" }), /* @__PURE__ */ React23.createElement("path", { d: "m21 21-4.35-4.35" }));
|
|
9167
|
+
var ChevronDownIcon = () => /* @__PURE__ */ React23.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React23.createElement("polyline", { points: "6 9 12 15 18 9" }));
|
|
9168
|
+
var ChevronRightIcon = () => /* @__PURE__ */ React23.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React23.createElement("polyline", { points: "9 18 15 12 9 6" }));
|
|
9169
|
+
var FilterIcon = () => /* @__PURE__ */ React23.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React23.createElement("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" }));
|
|
8931
9170
|
var extractFacetValues = (rows, field, filterConfig, currentField) => {
|
|
8932
9171
|
const valueCounts = /* @__PURE__ */ new Map();
|
|
8933
9172
|
const filteredRows = rows.filter((row) => {
|
|
@@ -9055,7 +9294,7 @@ var FacetedSearch = ({
|
|
|
9055
9294
|
return false;
|
|
9056
9295
|
}).length;
|
|
9057
9296
|
}, [filterConfig]);
|
|
9058
|
-
return /* @__PURE__ */
|
|
9297
|
+
return /* @__PURE__ */ React23.createElement(
|
|
9059
9298
|
"div",
|
|
9060
9299
|
{
|
|
9061
9300
|
className: `faceted-search ${className || ""}`,
|
|
@@ -9067,7 +9306,7 @@ var FacetedSearch = ({
|
|
|
9067
9306
|
height: "100%"
|
|
9068
9307
|
}
|
|
9069
9308
|
},
|
|
9070
|
-
/* @__PURE__ */
|
|
9309
|
+
/* @__PURE__ */ React23.createElement("div", { style: {
|
|
9071
9310
|
position: "sticky",
|
|
9072
9311
|
top: 0,
|
|
9073
9312
|
zIndex: 10,
|
|
@@ -9075,28 +9314,28 @@ var FacetedSearch = ({
|
|
|
9075
9314
|
borderBottom: "1px solid #e5e7eb",
|
|
9076
9315
|
padding: "16px",
|
|
9077
9316
|
flexShrink: 0
|
|
9078
|
-
} }, /* @__PURE__ */
|
|
9317
|
+
} }, /* @__PURE__ */ React23.createElement("div", { style: {
|
|
9079
9318
|
display: "flex",
|
|
9080
9319
|
alignItems: "center",
|
|
9081
9320
|
justifyContent: "space-between",
|
|
9082
9321
|
marginBottom: "8px"
|
|
9083
|
-
} }, /* @__PURE__ */
|
|
9322
|
+
} }, /* @__PURE__ */ React23.createElement("div", { style: {
|
|
9084
9323
|
display: "flex",
|
|
9085
9324
|
alignItems: "center",
|
|
9086
9325
|
gap: "8px"
|
|
9087
|
-
} }, /* @__PURE__ */
|
|
9326
|
+
} }, /* @__PURE__ */ React23.createElement(FilterIcon, null), /* @__PURE__ */ React23.createElement("h3", { style: {
|
|
9088
9327
|
fontSize: "18px",
|
|
9089
9328
|
fontWeight: 600,
|
|
9090
9329
|
color: "#111827",
|
|
9091
9330
|
margin: 0
|
|
9092
|
-
} }, "Filters"), activeFilterCount > 0 && /* @__PURE__ */
|
|
9331
|
+
} }, "Filters"), activeFilterCount > 0 && /* @__PURE__ */ React23.createElement("span", { style: {
|
|
9093
9332
|
padding: "2px 8px",
|
|
9094
9333
|
fontSize: "12px",
|
|
9095
9334
|
fontWeight: 500,
|
|
9096
9335
|
backgroundColor: "#dbeafe",
|
|
9097
9336
|
color: "#1e40af",
|
|
9098
9337
|
borderRadius: "9999px"
|
|
9099
|
-
} }, activeFilterCount)), activeFilterCount > 0 && onClearAll && /* @__PURE__ */
|
|
9338
|
+
} }, activeFilterCount)), activeFilterCount > 0 && onClearAll && /* @__PURE__ */ React23.createElement(
|
|
9100
9339
|
"button",
|
|
9101
9340
|
{
|
|
9102
9341
|
onClick: onClearAll,
|
|
@@ -9114,7 +9353,7 @@ var FacetedSearch = ({
|
|
|
9114
9353
|
},
|
|
9115
9354
|
"Clear All"
|
|
9116
9355
|
))),
|
|
9117
|
-
/* @__PURE__ */
|
|
9356
|
+
/* @__PURE__ */ React23.createElement("div", { style: {
|
|
9118
9357
|
overflowY: "auto",
|
|
9119
9358
|
flex: 1
|
|
9120
9359
|
} }, facetGroups.map((group) => {
|
|
@@ -9126,16 +9365,16 @@ var FacetedSearch = ({
|
|
|
9126
9365
|
const displayedValues = group.showAll ? filteredValues : filteredValues.slice(0, maxItems);
|
|
9127
9366
|
const hasMore = filteredValues.length > maxItems;
|
|
9128
9367
|
const selectedCount = group.values.filter((v) => v.selected).length;
|
|
9129
|
-
return /* @__PURE__ */
|
|
9368
|
+
return /* @__PURE__ */ React23.createElement("div", { key: group.field, style: {
|
|
9130
9369
|
borderBottom: "1px solid #e5e7eb"
|
|
9131
|
-
} }, /* @__PURE__ */
|
|
9370
|
+
} }, /* @__PURE__ */ React23.createElement("div", { style: {
|
|
9132
9371
|
padding: "16px",
|
|
9133
9372
|
backgroundColor: "#f9fafb"
|
|
9134
|
-
} }, /* @__PURE__ */
|
|
9373
|
+
} }, /* @__PURE__ */ React23.createElement("div", { style: {
|
|
9135
9374
|
display: "flex",
|
|
9136
9375
|
alignItems: "center",
|
|
9137
9376
|
justifyContent: "space-between"
|
|
9138
|
-
} }, /* @__PURE__ */
|
|
9377
|
+
} }, /* @__PURE__ */ React23.createElement(
|
|
9139
9378
|
"button",
|
|
9140
9379
|
{
|
|
9141
9380
|
onClick: () => updateFacetState(group.field, { expanded: !group.expanded }),
|
|
@@ -9155,9 +9394,9 @@ var FacetedSearch = ({
|
|
|
9155
9394
|
onMouseOver: (e) => collapsible && (e.currentTarget.style.color = "#374151"),
|
|
9156
9395
|
onMouseOut: (e) => collapsible && (e.currentTarget.style.color = "#111827")
|
|
9157
9396
|
},
|
|
9158
|
-
collapsible && (group.expanded ? /* @__PURE__ */
|
|
9159
|
-
/* @__PURE__ */
|
|
9160
|
-
selectedCount > 0 && /* @__PURE__ */
|
|
9397
|
+
collapsible && (group.expanded ? /* @__PURE__ */ React23.createElement(ChevronDownIcon, null) : /* @__PURE__ */ React23.createElement(ChevronRightIcon, null)),
|
|
9398
|
+
/* @__PURE__ */ React23.createElement("span", null, group.label),
|
|
9399
|
+
selectedCount > 0 && /* @__PURE__ */ React23.createElement("span", { style: {
|
|
9161
9400
|
padding: "2px 8px",
|
|
9162
9401
|
fontSize: "12px",
|
|
9163
9402
|
fontWeight: 500,
|
|
@@ -9165,7 +9404,7 @@ var FacetedSearch = ({
|
|
|
9165
9404
|
color: "#1e40af",
|
|
9166
9405
|
borderRadius: "9999px"
|
|
9167
9406
|
} }, selectedCount)
|
|
9168
|
-
), selectedCount > 0 && /* @__PURE__ */
|
|
9407
|
+
), selectedCount > 0 && /* @__PURE__ */ React23.createElement(
|
|
9169
9408
|
"button",
|
|
9170
9409
|
{
|
|
9171
9410
|
onClick: () => clearFacet(group.field),
|
|
@@ -9182,16 +9421,16 @@ var FacetedSearch = ({
|
|
|
9182
9421
|
onMouseOver: (e) => e.currentTarget.style.color = "#374151",
|
|
9183
9422
|
onMouseOut: (e) => e.currentTarget.style.color = "#6b7280"
|
|
9184
9423
|
},
|
|
9185
|
-
/* @__PURE__ */
|
|
9186
|
-
)), showSearch && group.expanded && group.values.length > 5 && /* @__PURE__ */
|
|
9424
|
+
/* @__PURE__ */ React23.createElement(XIcon, null)
|
|
9425
|
+
)), showSearch && group.expanded && group.values.length > 5 && /* @__PURE__ */ React23.createElement("div", { style: {
|
|
9187
9426
|
marginTop: "8px",
|
|
9188
9427
|
position: "relative"
|
|
9189
|
-
} }, /* @__PURE__ */
|
|
9428
|
+
} }, /* @__PURE__ */ React23.createElement("div", { style: {
|
|
9190
9429
|
position: "absolute",
|
|
9191
9430
|
left: "8px",
|
|
9192
9431
|
top: "8px",
|
|
9193
9432
|
color: "#9ca3af"
|
|
9194
|
-
} }, /* @__PURE__ */
|
|
9433
|
+
} }, /* @__PURE__ */ React23.createElement(SearchIcon, null)), /* @__PURE__ */ React23.createElement(
|
|
9195
9434
|
"input",
|
|
9196
9435
|
{
|
|
9197
9436
|
type: "text",
|
|
@@ -9212,16 +9451,16 @@ var FacetedSearch = ({
|
|
|
9212
9451
|
onFocus: (e) => e.currentTarget.style.boxShadow = "0 0 0 2px #3b82f6",
|
|
9213
9452
|
onBlur: (e) => e.currentTarget.style.boxShadow = "none"
|
|
9214
9453
|
}
|
|
9215
|
-
))), group.expanded && /* @__PURE__ */
|
|
9454
|
+
))), group.expanded && /* @__PURE__ */ React23.createElement("div", { style: {
|
|
9216
9455
|
padding: "16px",
|
|
9217
9456
|
display: "flex",
|
|
9218
9457
|
flexDirection: "column",
|
|
9219
9458
|
gap: "4px"
|
|
9220
|
-
} }, displayedValues.length === 0 ? /* @__PURE__ */
|
|
9459
|
+
} }, displayedValues.length === 0 ? /* @__PURE__ */ React23.createElement("div", { style: {
|
|
9221
9460
|
fontSize: "14px",
|
|
9222
9461
|
color: "#6b7280",
|
|
9223
9462
|
fontStyle: "italic"
|
|
9224
|
-
} }, "No values found") : /* @__PURE__ */
|
|
9463
|
+
} }, "No values found") : /* @__PURE__ */ React23.createElement(React23.Fragment, null, filteredValues.length > 1 && selectedCount < filteredValues.length && /* @__PURE__ */ React23.createElement(
|
|
9225
9464
|
"button",
|
|
9226
9465
|
{
|
|
9227
9466
|
onClick: () => selectAll(group.field, filteredValues.map((v) => v.value)),
|
|
@@ -9242,7 +9481,7 @@ var FacetedSearch = ({
|
|
|
9242
9481
|
"Select All (",
|
|
9243
9482
|
filteredValues.length,
|
|
9244
9483
|
")"
|
|
9245
|
-
), displayedValues.map((facetValue, idx) => /* @__PURE__ */
|
|
9484
|
+
), displayedValues.map((facetValue, idx) => /* @__PURE__ */ React23.createElement(
|
|
9246
9485
|
"label",
|
|
9247
9486
|
{
|
|
9248
9487
|
key: `${facetValue.value}-${idx}`,
|
|
@@ -9260,13 +9499,13 @@ var FacetedSearch = ({
|
|
|
9260
9499
|
onMouseOver: (e) => e.currentTarget.style.backgroundColor = "#f9fafb",
|
|
9261
9500
|
onMouseOut: (e) => e.currentTarget.style.backgroundColor = "transparent"
|
|
9262
9501
|
},
|
|
9263
|
-
/* @__PURE__ */
|
|
9502
|
+
/* @__PURE__ */ React23.createElement("div", { style: {
|
|
9264
9503
|
display: "flex",
|
|
9265
9504
|
alignItems: "center",
|
|
9266
9505
|
gap: "8px",
|
|
9267
9506
|
flex: 1,
|
|
9268
9507
|
minWidth: 0
|
|
9269
|
-
} }, /* @__PURE__ */
|
|
9508
|
+
} }, /* @__PURE__ */ React23.createElement(
|
|
9270
9509
|
"input",
|
|
9271
9510
|
{
|
|
9272
9511
|
type: "checkbox",
|
|
@@ -9279,7 +9518,7 @@ var FacetedSearch = ({
|
|
|
9279
9518
|
accentColor: "#2563eb"
|
|
9280
9519
|
}
|
|
9281
9520
|
}
|
|
9282
|
-
), /* @__PURE__ */
|
|
9521
|
+
), /* @__PURE__ */ React23.createElement("span", { style: {
|
|
9283
9522
|
fontSize: "14px",
|
|
9284
9523
|
color: "#374151",
|
|
9285
9524
|
overflow: "hidden",
|
|
@@ -9287,14 +9526,14 @@ var FacetedSearch = ({
|
|
|
9287
9526
|
whiteSpace: "nowrap",
|
|
9288
9527
|
flex: 1
|
|
9289
9528
|
} }, facetValue.label)),
|
|
9290
|
-
/* @__PURE__ */
|
|
9529
|
+
/* @__PURE__ */ React23.createElement("span", { style: {
|
|
9291
9530
|
fontSize: "12px",
|
|
9292
9531
|
color: "#6b7280",
|
|
9293
9532
|
fontWeight: 500,
|
|
9294
9533
|
marginLeft: "8px",
|
|
9295
9534
|
flexShrink: 0
|
|
9296
9535
|
} }, facetValue.count)
|
|
9297
|
-
)), hasMore && !group.searchTerm && /* @__PURE__ */
|
|
9536
|
+
)), hasMore && !group.searchTerm && /* @__PURE__ */ React23.createElement(
|
|
9298
9537
|
"button",
|
|
9299
9538
|
{
|
|
9300
9539
|
onClick: () => updateFacetState(group.field, { showAll: !group.showAll }),
|
|
@@ -9315,16 +9554,16 @@ var FacetedSearch = ({
|
|
|
9315
9554
|
},
|
|
9316
9555
|
group.showAll ? "Show Less" : `Show More (${filteredValues.length - maxItems} more)`
|
|
9317
9556
|
))));
|
|
9318
|
-
}), facetGroups.length === 0 && /* @__PURE__ */
|
|
9557
|
+
}), facetGroups.length === 0 && /* @__PURE__ */ React23.createElement("div", { style: {
|
|
9319
9558
|
padding: "32px",
|
|
9320
9559
|
textAlign: "center",
|
|
9321
9560
|
color: "#6b7280"
|
|
9322
|
-
} }, /* @__PURE__ */
|
|
9561
|
+
} }, /* @__PURE__ */ React23.createElement("div", { style: {
|
|
9323
9562
|
width: "48px",
|
|
9324
9563
|
height: "48px",
|
|
9325
9564
|
margin: "0 auto 12px",
|
|
9326
9565
|
color: "#9ca3af"
|
|
9327
|
-
} }, /* @__PURE__ */
|
|
9566
|
+
} }, /* @__PURE__ */ React23.createElement("svg", { width: "48", height: "48", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React23.createElement("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" }))), /* @__PURE__ */ React23.createElement("p", { style: {
|
|
9328
9567
|
fontSize: "14px",
|
|
9329
9568
|
margin: 0
|
|
9330
9569
|
} }, "No facets configured")))
|
|
@@ -9332,7 +9571,7 @@ var FacetedSearch = ({
|
|
|
9332
9571
|
};
|
|
9333
9572
|
|
|
9334
9573
|
// src/components/DataGrid/FilteredSearchBar.tsx
|
|
9335
|
-
import
|
|
9574
|
+
import React24, { useState as useState16, useRef as useRef11, useEffect as useEffect10 } from "react";
|
|
9336
9575
|
|
|
9337
9576
|
// node_modules/uuid/dist/esm-node/rng.js
|
|
9338
9577
|
import crypto from "crypto";
|
|
@@ -9398,7 +9637,7 @@ var FilteredSearchBar = ({
|
|
|
9398
9637
|
const [inputValue, setInputValue] = useState16("");
|
|
9399
9638
|
const [showDropdown, setShowDropdown] = useState16(false);
|
|
9400
9639
|
const [selectedFilterField, setSelectedFilterField] = useState16(null);
|
|
9401
|
-
const filteredOptions =
|
|
9640
|
+
const filteredOptions = React24.useMemo(() => {
|
|
9402
9641
|
var _a2;
|
|
9403
9642
|
if (!selectedFilterField) {
|
|
9404
9643
|
return filters.filter(
|
|
@@ -9505,7 +9744,7 @@ var FilteredSearchBar = ({
|
|
|
9505
9744
|
document.addEventListener("mousedown", handleClickOutside);
|
|
9506
9745
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
9507
9746
|
}, []);
|
|
9508
|
-
return /* @__PURE__ */
|
|
9747
|
+
return /* @__PURE__ */ React24.createElement("div", { style: { position: "relative", width: "100%" } }, /* @__PURE__ */ React24.createElement(
|
|
9509
9748
|
"div",
|
|
9510
9749
|
{
|
|
9511
9750
|
style: {
|
|
@@ -9527,7 +9766,7 @@ var FilteredSearchBar = ({
|
|
|
9527
9766
|
return (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
9528
9767
|
}
|
|
9529
9768
|
},
|
|
9530
|
-
tokens.map((token) => /* @__PURE__ */
|
|
9769
|
+
tokens.map((token) => /* @__PURE__ */ React24.createElement(
|
|
9531
9770
|
"div",
|
|
9532
9771
|
{
|
|
9533
9772
|
key: token.id,
|
|
@@ -9543,9 +9782,9 @@ var FilteredSearchBar = ({
|
|
|
9543
9782
|
fontWeight: "500"
|
|
9544
9783
|
}
|
|
9545
9784
|
},
|
|
9546
|
-
/* @__PURE__ */
|
|
9547
|
-
/* @__PURE__ */
|
|
9548
|
-
/* @__PURE__ */
|
|
9785
|
+
/* @__PURE__ */ React24.createElement("span", { style: { fontWeight: "600" } }, token.label, ":"),
|
|
9786
|
+
/* @__PURE__ */ React24.createElement("span", null, Array.isArray(token.value) ? token.value.join(", ") : token.value),
|
|
9787
|
+
/* @__PURE__ */ React24.createElement(
|
|
9549
9788
|
"button",
|
|
9550
9789
|
{
|
|
9551
9790
|
onClick: (e) => {
|
|
@@ -9568,7 +9807,7 @@ var FilteredSearchBar = ({
|
|
|
9568
9807
|
"\xD7"
|
|
9569
9808
|
)
|
|
9570
9809
|
)),
|
|
9571
|
-
/* @__PURE__ */
|
|
9810
|
+
/* @__PURE__ */ React24.createElement(
|
|
9572
9811
|
"input",
|
|
9573
9812
|
{
|
|
9574
9813
|
ref: inputRef,
|
|
@@ -9590,7 +9829,7 @@ var FilteredSearchBar = ({
|
|
|
9590
9829
|
disabled: tokens.length >= maxTokens
|
|
9591
9830
|
}
|
|
9592
9831
|
)
|
|
9593
|
-
), showDropdown && /* @__PURE__ */
|
|
9832
|
+
), showDropdown && /* @__PURE__ */ React24.createElement(
|
|
9594
9833
|
"div",
|
|
9595
9834
|
{
|
|
9596
9835
|
ref: dropdownRef,
|
|
@@ -9611,7 +9850,7 @@ var FilteredSearchBar = ({
|
|
|
9611
9850
|
},
|
|
9612
9851
|
selectedFilterField ? (
|
|
9613
9852
|
// Show values for selected filter
|
|
9614
|
-
/* @__PURE__ */
|
|
9853
|
+
/* @__PURE__ */ React24.createElement("div", null, /* @__PURE__ */ React24.createElement(
|
|
9615
9854
|
"div",
|
|
9616
9855
|
{
|
|
9617
9856
|
style: {
|
|
@@ -9625,7 +9864,7 @@ var FilteredSearchBar = ({
|
|
|
9625
9864
|
gap: "8px"
|
|
9626
9865
|
}
|
|
9627
9866
|
},
|
|
9628
|
-
/* @__PURE__ */
|
|
9867
|
+
/* @__PURE__ */ React24.createElement(
|
|
9629
9868
|
"button",
|
|
9630
9869
|
{
|
|
9631
9870
|
onClick: () => {
|
|
@@ -9644,7 +9883,7 @@ var FilteredSearchBar = ({
|
|
|
9644
9883
|
"\u2190"
|
|
9645
9884
|
),
|
|
9646
9885
|
(_a = filters.find((f) => f.field === selectedFilterField)) == null ? void 0 : _a.label
|
|
9647
|
-
), (_c = (_b = filteredOptions[0]) == null ? void 0 : _b.options) == null ? void 0 : _c.map((option, index) => /* @__PURE__ */
|
|
9886
|
+
), (_c = (_b = filteredOptions[0]) == null ? void 0 : _b.options) == null ? void 0 : _c.map((option, index) => /* @__PURE__ */ React24.createElement(
|
|
9648
9887
|
"div",
|
|
9649
9888
|
{
|
|
9650
9889
|
key: option,
|
|
@@ -9662,7 +9901,7 @@ var FilteredSearchBar = ({
|
|
|
9662
9901
|
)))
|
|
9663
9902
|
) : (
|
|
9664
9903
|
// Show filter options
|
|
9665
|
-
/* @__PURE__ */
|
|
9904
|
+
/* @__PURE__ */ React24.createElement("div", null, /* @__PURE__ */ React24.createElement(
|
|
9666
9905
|
"div",
|
|
9667
9906
|
{
|
|
9668
9907
|
style: {
|
|
@@ -9674,7 +9913,7 @@ var FilteredSearchBar = ({
|
|
|
9674
9913
|
}
|
|
9675
9914
|
},
|
|
9676
9915
|
"Filter by"
|
|
9677
|
-
), filteredOptions.map((filter, index) => /* @__PURE__ */
|
|
9916
|
+
), filteredOptions.map((filter, index) => /* @__PURE__ */ React24.createElement(
|
|
9678
9917
|
"div",
|
|
9679
9918
|
{
|
|
9680
9919
|
key: filter.field,
|
|
@@ -9691,7 +9930,7 @@ var FilteredSearchBar = ({
|
|
|
9691
9930
|
},
|
|
9692
9931
|
onMouseEnter: () => setHighlightedIndex(index)
|
|
9693
9932
|
},
|
|
9694
|
-
/* @__PURE__ */
|
|
9933
|
+
/* @__PURE__ */ React24.createElement(
|
|
9695
9934
|
"div",
|
|
9696
9935
|
{
|
|
9697
9936
|
style: {
|
|
@@ -9702,15 +9941,15 @@ var FilteredSearchBar = ({
|
|
|
9702
9941
|
}
|
|
9703
9942
|
}
|
|
9704
9943
|
),
|
|
9705
|
-
/* @__PURE__ */
|
|
9706
|
-
/* @__PURE__ */
|
|
9944
|
+
/* @__PURE__ */ React24.createElement("span", { style: { fontWeight: "500" } }, filter.label),
|
|
9945
|
+
/* @__PURE__ */ React24.createElement("span", { style: { marginLeft: "auto", fontSize: "12px", color: "#94a3b8" } }, filter.type)
|
|
9707
9946
|
)))
|
|
9708
9947
|
)
|
|
9709
9948
|
));
|
|
9710
9949
|
};
|
|
9711
9950
|
|
|
9712
9951
|
// src/components/DataGrid/InfiniteScrollDataGrid.tsx
|
|
9713
|
-
import
|
|
9952
|
+
import React25, { useReducer as useReducer2, useMemo as useMemo6, useEffect as useEffect11, useCallback as useCallback8, useState as useState17, useLayoutEffect as useLayoutEffect2 } from "react";
|
|
9714
9953
|
|
|
9715
9954
|
// src/components/DataGrid/ServerSideDataSource.ts
|
|
9716
9955
|
var BlockStatus = {
|
|
@@ -10198,14 +10437,14 @@ var InfiniteScrollDataGrid = ({
|
|
|
10198
10437
|
[onCellEdit, state.currentPage, pageSize]
|
|
10199
10438
|
);
|
|
10200
10439
|
if (!dataSourceInstance) {
|
|
10201
|
-
return /* @__PURE__ */
|
|
10440
|
+
return /* @__PURE__ */ React25.createElement("div", { style: {
|
|
10202
10441
|
padding: "20px",
|
|
10203
10442
|
textAlign: "center",
|
|
10204
10443
|
border: "1px solid #e2e8f0",
|
|
10205
10444
|
borderRadius: "6px"
|
|
10206
10445
|
} }, "Loading data source...");
|
|
10207
10446
|
}
|
|
10208
|
-
return /* @__PURE__ */
|
|
10447
|
+
return /* @__PURE__ */ React25.createElement("div", { style: {
|
|
10209
10448
|
...themeStyles,
|
|
10210
10449
|
border: "var(--grid-border-width, 1px) solid var(--grid-border)",
|
|
10211
10450
|
borderRadius: "var(--grid-border-radius, 6px)",
|
|
@@ -10215,7 +10454,7 @@ var InfiniteScrollDataGrid = ({
|
|
|
10215
10454
|
display: "flex",
|
|
10216
10455
|
flexDirection: "column",
|
|
10217
10456
|
height: (virtualScrollConfig == null ? void 0 : virtualScrollConfig.containerHeight) ? `${virtualScrollConfig.containerHeight + 150}px` : "auto"
|
|
10218
|
-
} }, /* @__PURE__ */
|
|
10457
|
+
} }, /* @__PURE__ */ React25.createElement("div", { style: {
|
|
10219
10458
|
position: "relative",
|
|
10220
10459
|
display: "flex",
|
|
10221
10460
|
alignItems: "center",
|
|
@@ -10227,12 +10466,12 @@ var InfiniteScrollDataGrid = ({
|
|
|
10227
10466
|
backgroundColor: "var(--grid-bg-alt)",
|
|
10228
10467
|
borderBottom: "var(--grid-border-width, 1px) solid var(--grid-border)",
|
|
10229
10468
|
zIndex: 30
|
|
10230
|
-
} }, /* @__PURE__ */
|
|
10469
|
+
} }, /* @__PURE__ */ React25.createElement("div", { style: {
|
|
10231
10470
|
position: "relative",
|
|
10232
10471
|
display: "flex",
|
|
10233
10472
|
alignItems: "center",
|
|
10234
10473
|
gap: "8px"
|
|
10235
|
-
} }, /* @__PURE__ */
|
|
10474
|
+
} }, /* @__PURE__ */ React25.createElement(
|
|
10236
10475
|
ColumnChooser,
|
|
10237
10476
|
{
|
|
10238
10477
|
columns,
|
|
@@ -10242,18 +10481,18 @@ var InfiniteScrollDataGrid = ({
|
|
|
10242
10481
|
onReorderColumns: (fromIndex, toIndex) => dispatch({ type: "REORDER_COLUMNS", payload: { fromIndex, toIndex } }),
|
|
10243
10482
|
onResetLayout: () => dispatch({ type: "RESET_COLUMN_LAYOUT" })
|
|
10244
10483
|
}
|
|
10245
|
-
), /* @__PURE__ */
|
|
10484
|
+
), /* @__PURE__ */ React25.createElement("div", { style: {
|
|
10246
10485
|
fontSize: "14px",
|
|
10247
10486
|
color: "#64748b",
|
|
10248
10487
|
marginLeft: "12px"
|
|
10249
|
-
} }, totalRows !== void 0 ? `${totalRows.toLocaleString()} total rows` : "Loading..."))), /* @__PURE__ */
|
|
10488
|
+
} }, totalRows !== void 0 ? `${totalRows.toLocaleString()} total rows` : "Loading..."))), /* @__PURE__ */ React25.createElement(
|
|
10250
10489
|
GroupByPanel,
|
|
10251
10490
|
{
|
|
10252
10491
|
columns,
|
|
10253
10492
|
groupBy: state.groupBy,
|
|
10254
10493
|
dispatch
|
|
10255
10494
|
}
|
|
10256
|
-
), /* @__PURE__ */
|
|
10495
|
+
), /* @__PURE__ */ React25.createElement("div", { style: { position: "sticky", top: 0, zIndex: 20 } }, /* @__PURE__ */ React25.createElement(
|
|
10257
10496
|
GridHeader,
|
|
10258
10497
|
{
|
|
10259
10498
|
columns,
|
|
@@ -10266,7 +10505,7 @@ var InfiniteScrollDataGrid = ({
|
|
|
10266
10505
|
pinnedRight: pinnedRightFields,
|
|
10267
10506
|
showColumnPinning
|
|
10268
10507
|
}
|
|
10269
|
-
), /* @__PURE__ */
|
|
10508
|
+
), /* @__PURE__ */ React25.createElement(
|
|
10270
10509
|
ColumnFilters,
|
|
10271
10510
|
{
|
|
10272
10511
|
columns,
|
|
@@ -10278,7 +10517,7 @@ var InfiniteScrollDataGrid = ({
|
|
|
10278
10517
|
pinnedRight: pinnedRightFields,
|
|
10279
10518
|
rows: visibleRows
|
|
10280
10519
|
}
|
|
10281
|
-
)), /* @__PURE__ */
|
|
10520
|
+
)), /* @__PURE__ */ React25.createElement(
|
|
10282
10521
|
GridBody,
|
|
10283
10522
|
{
|
|
10284
10523
|
columns,
|
|
@@ -10300,7 +10539,7 @@ var InfiniteScrollDataGrid = ({
|
|
|
10300
10539
|
enabled: true
|
|
10301
10540
|
}
|
|
10302
10541
|
}
|
|
10303
|
-
), /* @__PURE__ */
|
|
10542
|
+
), /* @__PURE__ */ React25.createElement("div", { style: {
|
|
10304
10543
|
padding: "8px 16px",
|
|
10305
10544
|
backgroundColor: "var(--grid-footer-bg)",
|
|
10306
10545
|
borderTop: "var(--grid-border-width, 1px) solid var(--grid-border)",
|
|
@@ -10309,12 +10548,12 @@ var InfiniteScrollDataGrid = ({
|
|
|
10309
10548
|
display: "flex",
|
|
10310
10549
|
justifyContent: "space-between",
|
|
10311
10550
|
alignItems: "center"
|
|
10312
|
-
} }, /* @__PURE__ */
|
|
10551
|
+
} }, /* @__PURE__ */ React25.createElement("div", null, "Server-side infinite scrolling enabled"), /* @__PURE__ */ React25.createElement("div", null, "Rows loaded: ", visibleRows.length)));
|
|
10313
10552
|
};
|
|
10314
10553
|
var ThemedInfiniteScrollDataGrid = InfiniteScrollDataGrid;
|
|
10315
10554
|
|
|
10316
10555
|
// src/components/DataGrid/ThemeSelector.tsx
|
|
10317
|
-
import
|
|
10556
|
+
import React26 from "react";
|
|
10318
10557
|
var ThemeSelector = ({
|
|
10319
10558
|
currentTheme,
|
|
10320
10559
|
onThemeChange
|
|
@@ -10335,7 +10574,7 @@ var ThemeSelector = ({
|
|
|
10335
10574
|
onThemeChange(event.target.value);
|
|
10336
10575
|
};
|
|
10337
10576
|
const theme = getTheme(currentTheme);
|
|
10338
|
-
return /* @__PURE__ */
|
|
10577
|
+
return /* @__PURE__ */ React26.createElement("div", { style: { display: "inline-flex", alignItems: "center", gap: "8px" } }, /* @__PURE__ */ React26.createElement(
|
|
10339
10578
|
"label",
|
|
10340
10579
|
{
|
|
10341
10580
|
htmlFor: "theme-selector",
|
|
@@ -10346,7 +10585,7 @@ var ThemeSelector = ({
|
|
|
10346
10585
|
}
|
|
10347
10586
|
},
|
|
10348
10587
|
"Theme:"
|
|
10349
|
-
), /* @__PURE__ */
|
|
10588
|
+
), /* @__PURE__ */ React26.createElement(
|
|
10350
10589
|
"select",
|
|
10351
10590
|
{
|
|
10352
10591
|
id: "theme-selector",
|
|
@@ -10375,12 +10614,12 @@ var ThemeSelector = ({
|
|
|
10375
10614
|
e.currentTarget.style.borderColor = theme.colors.border;
|
|
10376
10615
|
}
|
|
10377
10616
|
},
|
|
10378
|
-
themes2.map((themeOption) => /* @__PURE__ */
|
|
10617
|
+
themes2.map((themeOption) => /* @__PURE__ */ React26.createElement("option", { key: themeOption.value, value: themeOption.value }, themeOption.label))
|
|
10379
10618
|
));
|
|
10380
10619
|
};
|
|
10381
10620
|
|
|
10382
10621
|
// src/components/DataGrid/CellRenderers.tsx
|
|
10383
|
-
import
|
|
10622
|
+
import React27 from "react";
|
|
10384
10623
|
var StatusChip = ({ status }) => {
|
|
10385
10624
|
const getStatusStyles = (status2) => {
|
|
10386
10625
|
const normalized = status2.toLowerCase();
|
|
@@ -10418,7 +10657,7 @@ var StatusChip = ({ status }) => {
|
|
|
10418
10657
|
}
|
|
10419
10658
|
};
|
|
10420
10659
|
const styles = getStatusStyles(status);
|
|
10421
|
-
return /* @__PURE__ */
|
|
10660
|
+
return /* @__PURE__ */ React27.createElement(
|
|
10422
10661
|
"span",
|
|
10423
10662
|
{
|
|
10424
10663
|
style: {
|
|
@@ -10442,7 +10681,7 @@ var ProgressBar = ({
|
|
|
10442
10681
|
showLabel = true
|
|
10443
10682
|
}) => {
|
|
10444
10683
|
const clampedValue = Math.max(0, Math.min(100, value));
|
|
10445
|
-
return /* @__PURE__ */
|
|
10684
|
+
return /* @__PURE__ */ React27.createElement("div", { style: { display: "flex", alignItems: "center", gap: "8px", width: "100%" } }, /* @__PURE__ */ React27.createElement(
|
|
10446
10685
|
"div",
|
|
10447
10686
|
{
|
|
10448
10687
|
style: {
|
|
@@ -10453,7 +10692,7 @@ var ProgressBar = ({
|
|
|
10453
10692
|
overflow: "hidden"
|
|
10454
10693
|
}
|
|
10455
10694
|
},
|
|
10456
|
-
/* @__PURE__ */
|
|
10695
|
+
/* @__PURE__ */ React27.createElement(
|
|
10457
10696
|
"div",
|
|
10458
10697
|
{
|
|
10459
10698
|
style: {
|
|
@@ -10464,10 +10703,10 @@ var ProgressBar = ({
|
|
|
10464
10703
|
}
|
|
10465
10704
|
}
|
|
10466
10705
|
)
|
|
10467
|
-
), showLabel && /* @__PURE__ */
|
|
10706
|
+
), showLabel && /* @__PURE__ */ React27.createElement("span", { style: { fontSize: "12px", fontWeight: 500, color: "#6b7280", minWidth: "35px" } }, clampedValue, "%"));
|
|
10468
10707
|
};
|
|
10469
10708
|
var IconCell = ({ icon, text, iconColor }) => {
|
|
10470
|
-
return /* @__PURE__ */
|
|
10709
|
+
return /* @__PURE__ */ React27.createElement("div", { style: { display: "flex", alignItems: "center", gap: "8px" } }, /* @__PURE__ */ React27.createElement("span", { style: { fontSize: "16px", color: iconColor } }, icon), text && /* @__PURE__ */ React27.createElement("span", { style: { fontSize: "13px" } }, text));
|
|
10471
10710
|
};
|
|
10472
10711
|
var ImageCell = ({
|
|
10473
10712
|
src,
|
|
@@ -10475,7 +10714,7 @@ var ImageCell = ({
|
|
|
10475
10714
|
text,
|
|
10476
10715
|
size = 32
|
|
10477
10716
|
}) => {
|
|
10478
|
-
return /* @__PURE__ */
|
|
10717
|
+
return /* @__PURE__ */ React27.createElement("div", { style: { display: "flex", alignItems: "center", gap: "8px" } }, /* @__PURE__ */ React27.createElement(
|
|
10479
10718
|
"img",
|
|
10480
10719
|
{
|
|
10481
10720
|
src,
|
|
@@ -10488,7 +10727,7 @@ var ImageCell = ({
|
|
|
10488
10727
|
border: "2px solid #e5e7eb"
|
|
10489
10728
|
}
|
|
10490
10729
|
}
|
|
10491
|
-
), text && /* @__PURE__ */
|
|
10730
|
+
), text && /* @__PURE__ */ React27.createElement("span", { style: { fontSize: "13px" } }, text));
|
|
10492
10731
|
};
|
|
10493
10732
|
var ButtonCell = ({
|
|
10494
10733
|
label,
|
|
@@ -10530,7 +10769,7 @@ var ButtonCell = ({
|
|
|
10530
10769
|
}
|
|
10531
10770
|
};
|
|
10532
10771
|
const styles = getButtonStyles();
|
|
10533
|
-
return /* @__PURE__ */
|
|
10772
|
+
return /* @__PURE__ */ React27.createElement(
|
|
10534
10773
|
"button",
|
|
10535
10774
|
{
|
|
10536
10775
|
onClick: (e) => {
|
|
@@ -10572,7 +10811,7 @@ var BadgeCell = ({
|
|
|
10572
10811
|
color = "#1f2937",
|
|
10573
10812
|
backgroundColor = "#f3f4f6"
|
|
10574
10813
|
}) => {
|
|
10575
|
-
return /* @__PURE__ */
|
|
10814
|
+
return /* @__PURE__ */ React27.createElement(
|
|
10576
10815
|
"span",
|
|
10577
10816
|
{
|
|
10578
10817
|
style: {
|
|
@@ -10603,11 +10842,11 @@ var PriorityIndicator = ({ priority }) => {
|
|
|
10603
10842
|
}
|
|
10604
10843
|
};
|
|
10605
10844
|
const styles = getPriorityStyles();
|
|
10606
|
-
return /* @__PURE__ */
|
|
10845
|
+
return /* @__PURE__ */ React27.createElement("div", { style: { display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React27.createElement("span", { style: { color: styles.color, fontSize: "18px" } }, styles.icon), /* @__PURE__ */ React27.createElement("span", { style: { fontSize: "13px", fontWeight: 500 } }, styles.text));
|
|
10607
10846
|
};
|
|
10608
10847
|
var Rating = ({ rating, maxRating = 5 }) => {
|
|
10609
10848
|
const stars = Array.from({ length: maxRating }, (_, i) => i < rating ? "\u2605" : "\u2606");
|
|
10610
|
-
return /* @__PURE__ */
|
|
10849
|
+
return /* @__PURE__ */ React27.createElement("div", { style: { display: "flex", gap: "2px", fontSize: "14px", color: "#f59e0b" } }, stars.map((star, i) => /* @__PURE__ */ React27.createElement("span", { key: i }, star)));
|
|
10611
10850
|
};
|
|
10612
10851
|
var CurrencyCell = ({
|
|
10613
10852
|
amount,
|
|
@@ -10618,11 +10857,11 @@ var CurrencyCell = ({
|
|
|
10618
10857
|
style: "currency",
|
|
10619
10858
|
currency
|
|
10620
10859
|
}).format(amount);
|
|
10621
|
-
return /* @__PURE__ */
|
|
10860
|
+
return /* @__PURE__ */ React27.createElement("span", { style: { fontWeight: 500, color: amount < 0 ? "#ef4444" : "#059669" } }, formatted);
|
|
10622
10861
|
};
|
|
10623
10862
|
|
|
10624
10863
|
// src/components/DataGrid/GridApiDemo.tsx
|
|
10625
|
-
import
|
|
10864
|
+
import React28, { useRef as useRef12, useState as useState18 } from "react";
|
|
10626
10865
|
var GridApiDemo = () => {
|
|
10627
10866
|
const gridRef = useRef12(null);
|
|
10628
10867
|
const [logs, setLogs] = useState18([]);
|
|
@@ -10881,7 +11120,7 @@ var GridApiDemo = () => {
|
|
|
10881
11120
|
const totalPages = api.paginationGetTotalPages();
|
|
10882
11121
|
addLog(`Rows: ${totalRows}, Selected: ${selectedCount}, Filters: ${hasFilters}, Page: ${currentPage + 1}/${totalPages}`);
|
|
10883
11122
|
};
|
|
10884
|
-
return /* @__PURE__ */
|
|
11123
|
+
return /* @__PURE__ */ React28.createElement("div", { style: { padding: "20px", maxWidth: "1400px", margin: "0 auto" } }, /* @__PURE__ */ React28.createElement("div", { style: { marginBottom: "20px" } }, /* @__PURE__ */ React28.createElement("h2", null, "Grid API Demo"), /* @__PURE__ */ React28.createElement("p", { style: { color: "#666" } }, "Demonstrates programmatic control of the DataGrid using the GridApi ref (AG Grid-inspired API)")), /* @__PURE__ */ React28.createElement("div", { style: {
|
|
10885
11124
|
display: "grid",
|
|
10886
11125
|
gridTemplateColumns: "repeat(auto-fit, minmax(200px, 1fr))",
|
|
10887
11126
|
gap: "10px",
|
|
@@ -10889,7 +11128,7 @@ var GridApiDemo = () => {
|
|
|
10889
11128
|
padding: "15px",
|
|
10890
11129
|
backgroundColor: "#f5f5f5",
|
|
10891
11130
|
borderRadius: "8px"
|
|
10892
|
-
} }, /* @__PURE__ */
|
|
11131
|
+
} }, /* @__PURE__ */ React28.createElement("div", null, /* @__PURE__ */ React28.createElement("h4", { style: { margin: "0 0 10px 0", fontSize: "14px", fontWeight: "600" } }, "Data Operations"), /* @__PURE__ */ React28.createElement("button", { onClick: handleAddRow, style: buttonStyle }, "Add Row"), /* @__PURE__ */ React28.createElement("button", { onClick: handleUpdateSelectedRows, style: buttonStyle }, "Update Selected"), /* @__PURE__ */ React28.createElement("button", { onClick: handleRemoveSelectedRows, style: buttonStyle }, "Remove Selected")), /* @__PURE__ */ React28.createElement("div", null, /* @__PURE__ */ React28.createElement("h4", { style: { margin: "0 0 10px 0", fontSize: "14px", fontWeight: "600" } }, "Column Operations"), /* @__PURE__ */ React28.createElement("button", { onClick: handleHideColumn, style: buttonStyle }, "Hide Email"), /* @__PURE__ */ React28.createElement("button", { onClick: handleShowColumn, style: buttonStyle }, "Show Email"), /* @__PURE__ */ React28.createElement("button", { onClick: handlePinColumn, style: buttonStyle }, "Pin Name"), /* @__PURE__ */ React28.createElement("button", { onClick: handleUnpinColumn, style: buttonStyle }, "Unpin Name"), /* @__PURE__ */ React28.createElement("button", { onClick: handleAutoSizeColumns, style: buttonStyle }, "Auto-size Columns"), /* @__PURE__ */ React28.createElement("button", { onClick: handleSizeColumnsToFit, style: buttonStyle }, "Fit to Width")), /* @__PURE__ */ React28.createElement("div", null, /* @__PURE__ */ React28.createElement("h4", { style: { margin: "0 0 10px 0", fontSize: "14px", fontWeight: "600" } }, "Filter & Sort"), /* @__PURE__ */ React28.createElement("button", { onClick: handleApplyFilter, style: buttonStyle }, "Filter Active"), /* @__PURE__ */ React28.createElement("button", { onClick: handleClearFilters, style: buttonStyle }, "Clear Filters"), /* @__PURE__ */ React28.createElement("button", { onClick: handleApplySort, style: buttonStyle }, "Sort by Score"), /* @__PURE__ */ React28.createElement("button", { onClick: handleClearSort, style: buttonStyle }, "Clear Sort")), /* @__PURE__ */ React28.createElement("div", null, /* @__PURE__ */ React28.createElement("h4", { style: { margin: "0 0 10px 0", fontSize: "14px", fontWeight: "600" } }, "Selection"), /* @__PURE__ */ React28.createElement("button", { onClick: handleSelectAll, style: buttonStyle }, "Select All"), /* @__PURE__ */ React28.createElement("button", { onClick: handleDeselectAll, style: buttonStyle }, "Deselect All"), /* @__PURE__ */ React28.createElement("button", { onClick: handleSelectFiltered, style: buttonStyle }, "Select Filtered"), /* @__PURE__ */ React28.createElement("button", { onClick: handleGetSelection, style: buttonStyle }, "Get Selection")), /* @__PURE__ */ React28.createElement("div", null, /* @__PURE__ */ React28.createElement("h4", { style: { margin: "0 0 10px 0", fontSize: "14px", fontWeight: "600" } }, "Export & Clipboard"), /* @__PURE__ */ React28.createElement("button", { onClick: handleExportCSV, style: buttonStyle }, "Export CSV"), /* @__PURE__ */ React28.createElement("button", { onClick: handleCopyToClipboard, style: buttonStyle }, "Copy to Clipboard")), /* @__PURE__ */ React28.createElement("div", null, /* @__PURE__ */ React28.createElement("h4", { style: { margin: "0 0 10px 0", fontSize: "14px", fontWeight: "600" } }, "Navigation"), /* @__PURE__ */ React28.createElement("button", { onClick: handleScrollToRow, style: buttonStyle }, "Scroll to Middle"), /* @__PURE__ */ React28.createElement("button", { onClick: handleFocusCell, style: buttonStyle }, "Focus Cell"), /* @__PURE__ */ React28.createElement("button", { onClick: handleNextPage, style: buttonStyle }, "Next Page"), /* @__PURE__ */ React28.createElement("button", { onClick: handlePreviousPage, style: buttonStyle }, "Previous Page"), /* @__PURE__ */ React28.createElement("button", { onClick: handleSetPageSize, style: buttonStyle }, "Page Size: 20")), /* @__PURE__ */ React28.createElement("div", null, /* @__PURE__ */ React28.createElement("h4", { style: { margin: "0 0 10px 0", fontSize: "14px", fontWeight: "600" } }, "Info"), /* @__PURE__ */ React28.createElement("button", { onClick: handleGetInfo, style: buttonStyle }, "Get Grid Info"))), /* @__PURE__ */ React28.createElement("div", { style: {
|
|
10893
11132
|
marginBottom: "20px",
|
|
10894
11133
|
padding: "10px",
|
|
10895
11134
|
backgroundColor: "#f9f9f9",
|
|
@@ -10899,7 +11138,7 @@ var GridApiDemo = () => {
|
|
|
10899
11138
|
overflow: "auto",
|
|
10900
11139
|
fontFamily: "monospace",
|
|
10901
11140
|
fontSize: "12px"
|
|
10902
|
-
} }, /* @__PURE__ */
|
|
11141
|
+
} }, /* @__PURE__ */ React28.createElement("div", { style: { fontWeight: "600", marginBottom: "5px" } }, "Activity Log:"), logs.length === 0 ? /* @__PURE__ */ React28.createElement("div", { style: { color: "#999" } }, "No actions yet. Click buttons above to interact with the grid.") : logs.map((log, i) => /* @__PURE__ */ React28.createElement("div", { key: i, style: { padding: "2px 0" } }, log))), /* @__PURE__ */ React28.createElement("div", { style: { marginBottom: "10px", padding: "10px", backgroundColor: isGridReady ? "#d4edda" : "#f8d7da", borderRadius: "4px", border: `1px solid ${isGridReady ? "#c3e6cb" : "#f5c6cb"}` } }, /* @__PURE__ */ React28.createElement("strong", null, "Grid Status:"), " ", isGridReady ? "\u2705 Ready" : "\u23F3 Initializing..."), /* @__PURE__ */ React28.createElement(
|
|
10903
11142
|
DataGrid,
|
|
10904
11143
|
{
|
|
10905
11144
|
ref: gridRef,
|
|
@@ -10914,7 +11153,7 @@ var GridApiDemo = () => {
|
|
|
10914
11153
|
addLog(`Selection changed: ${selectedIds.length} row(s)`);
|
|
10915
11154
|
}
|
|
10916
11155
|
}
|
|
10917
|
-
), /* @__PURE__ */
|
|
11156
|
+
), /* @__PURE__ */ React28.createElement("div", { style: { marginTop: "30px", padding: "20px", backgroundColor: "#e8f5e9", borderRadius: "8px", marginBottom: "20px" } }, /* @__PURE__ */ React28.createElement("h3", { style: { marginTop: 0 } }, "\u{1F4D8} Using onGridReady Event"), /* @__PURE__ */ React28.createElement("p", { style: { fontSize: "14px", lineHeight: "1.6" } }, "The ", /* @__PURE__ */ React28.createElement("code", null, "onGridReady"), " callback is fired when the grid API is fully initialized and ready to use. This is similar to AG-Grid's ", /* @__PURE__ */ React28.createElement("code", null, "onGridReady"), " event."), /* @__PURE__ */ React28.createElement("pre", { style: { backgroundColor: "#fff", padding: "15px", borderRadius: "4px", overflow: "auto", fontSize: "13px" } }, `// Example usage
|
|
10918
11157
|
const MyComponent = () => {
|
|
10919
11158
|
const gridRef = useRef<GridApi>(null);
|
|
10920
11159
|
|
|
@@ -10932,14 +11171,14 @@ const MyComponent = () => {
|
|
|
10932
11171
|
onGridReady={handleGridReady} // \u2705 Called when API is ready
|
|
10933
11172
|
/>
|
|
10934
11173
|
);
|
|
10935
|
-
};`)), /* @__PURE__ */
|
|
11174
|
+
};`)), /* @__PURE__ */ React28.createElement("div", { style: {
|
|
10936
11175
|
marginTop: "30px",
|
|
10937
11176
|
padding: "24px",
|
|
10938
11177
|
background: "linear-gradient(to bottom right, #ffffff, #f9fafb)",
|
|
10939
11178
|
border: "1px solid #e5e7eb",
|
|
10940
11179
|
borderRadius: "12px",
|
|
10941
11180
|
boxShadow: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"
|
|
10942
|
-
} }, /* @__PURE__ */
|
|
11181
|
+
} }, /* @__PURE__ */ React28.createElement("h3", { style: {
|
|
10943
11182
|
fontSize: "20px",
|
|
10944
11183
|
fontWeight: "700",
|
|
10945
11184
|
marginBottom: "20px",
|
|
@@ -10947,7 +11186,7 @@ const MyComponent = () => {
|
|
|
10947
11186
|
display: "flex",
|
|
10948
11187
|
alignItems: "center",
|
|
10949
11188
|
gap: "8px"
|
|
10950
|
-
} }, /* @__PURE__ */
|
|
11189
|
+
} }, /* @__PURE__ */ React28.createElement("span", { style: {
|
|
10951
11190
|
display: "inline-flex",
|
|
10952
11191
|
alignItems: "center",
|
|
10953
11192
|
justifyContent: "center",
|
|
@@ -10957,14 +11196,14 @@ const MyComponent = () => {
|
|
|
10957
11196
|
borderRadius: "8px",
|
|
10958
11197
|
color: "white",
|
|
10959
11198
|
fontSize: "18px"
|
|
10960
|
-
} }, "\u26A1"), "Grid API Methods Available"), /* @__PURE__ */
|
|
11199
|
+
} }, "\u26A1"), "Grid API Methods Available"), /* @__PURE__ */ React28.createElement("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))", gap: "16px" } }, /* @__PURE__ */ React28.createElement("div", { style: {
|
|
10961
11200
|
padding: "16px",
|
|
10962
11201
|
backgroundColor: "#ffffff",
|
|
10963
11202
|
borderRadius: "8px",
|
|
10964
11203
|
border: "1px solid #e5e7eb",
|
|
10965
11204
|
transition: "all 0.2s ease",
|
|
10966
11205
|
boxShadow: "0 1px 3px rgba(0,0,0,0.05)"
|
|
10967
|
-
} }, /* @__PURE__ */
|
|
11206
|
+
} }, /* @__PURE__ */ React28.createElement("h4", { style: {
|
|
10968
11207
|
fontSize: "14px",
|
|
10969
11208
|
fontWeight: "600",
|
|
10970
11209
|
marginBottom: "12px",
|
|
@@ -10972,14 +11211,14 @@ const MyComponent = () => {
|
|
|
10972
11211
|
display: "flex",
|
|
10973
11212
|
alignItems: "center",
|
|
10974
11213
|
gap: "6px"
|
|
10975
|
-
} }, /* @__PURE__ */
|
|
11214
|
+
} }, /* @__PURE__ */ React28.createElement("span", null, "\u{1F4CA}"), " Data & Model"), /* @__PURE__ */ React28.createElement("ul", { style: { fontSize: "13px", lineHeight: "1.8", listStyle: "none", padding: 0, margin: 0 } }, /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#10b981", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "setRowData(rows)")), /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#10b981", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "applyTransaction(tx)")), /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#10b981", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "getModel()")), /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#10b981", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "getDisplayedRowCount()")), /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#10b981", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "forEachNode(callback)")))), /* @__PURE__ */ React28.createElement("div", { style: {
|
|
10976
11215
|
padding: "16px",
|
|
10977
11216
|
backgroundColor: "#ffffff",
|
|
10978
11217
|
borderRadius: "8px",
|
|
10979
11218
|
border: "1px solid #e5e7eb",
|
|
10980
11219
|
transition: "all 0.2s ease",
|
|
10981
11220
|
boxShadow: "0 1px 3px rgba(0,0,0,0.05)"
|
|
10982
|
-
} }, /* @__PURE__ */
|
|
11221
|
+
} }, /* @__PURE__ */ React28.createElement("h4", { style: {
|
|
10983
11222
|
fontSize: "14px",
|
|
10984
11223
|
fontWeight: "600",
|
|
10985
11224
|
marginBottom: "12px",
|
|
@@ -10987,14 +11226,14 @@ const MyComponent = () => {
|
|
|
10987
11226
|
display: "flex",
|
|
10988
11227
|
alignItems: "center",
|
|
10989
11228
|
gap: "6px"
|
|
10990
|
-
} }, /* @__PURE__ */
|
|
11229
|
+
} }, /* @__PURE__ */ React28.createElement("span", null, "\u{1F4CB}"), " Columns"), /* @__PURE__ */ React28.createElement("ul", { style: { fontSize: "13px", lineHeight: "1.8", listStyle: "none", padding: 0, margin: 0 } }, /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#8b5cf6", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "getColumnDefs()")), /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#8b5cf6", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "setColumnVisible(key, visible)")), /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#8b5cf6", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "setColumnPinned(key, pinned)")), /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#8b5cf6", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "autoSizeColumns(keys?)")), /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#8b5cf6", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "sizeColumnsToFit()")))), /* @__PURE__ */ React28.createElement("div", { style: {
|
|
10991
11230
|
padding: "16px",
|
|
10992
11231
|
backgroundColor: "#ffffff",
|
|
10993
11232
|
borderRadius: "8px",
|
|
10994
11233
|
border: "1px solid #e5e7eb",
|
|
10995
11234
|
transition: "all 0.2s ease",
|
|
10996
11235
|
boxShadow: "0 1px 3px rgba(0,0,0,0.05)"
|
|
10997
|
-
} }, /* @__PURE__ */
|
|
11236
|
+
} }, /* @__PURE__ */ React28.createElement("h4", { style: {
|
|
10998
11237
|
fontSize: "14px",
|
|
10999
11238
|
fontWeight: "600",
|
|
11000
11239
|
marginBottom: "12px",
|
|
@@ -11002,14 +11241,14 @@ const MyComponent = () => {
|
|
|
11002
11241
|
display: "flex",
|
|
11003
11242
|
alignItems: "center",
|
|
11004
11243
|
gap: "6px"
|
|
11005
|
-
} }, /* @__PURE__ */
|
|
11244
|
+
} }, /* @__PURE__ */ React28.createElement("span", null, "\u{1F50D}"), " Filtering & Sorting"), /* @__PURE__ */ React28.createElement("ul", { style: { fontSize: "13px", lineHeight: "1.8", listStyle: "none", padding: 0, margin: 0 } }, /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#f59e0b", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "getFilterModel()")), /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#f59e0b", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "setFilterModel(model)")), /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#f59e0b", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "getSortModel()")), /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#f59e0b", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "setSortModel(model)")), /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#f59e0b", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "clearAllFilters()")))), /* @__PURE__ */ React28.createElement("div", { style: {
|
|
11006
11245
|
padding: "16px",
|
|
11007
11246
|
backgroundColor: "#ffffff",
|
|
11008
11247
|
borderRadius: "8px",
|
|
11009
11248
|
border: "1px solid #e5e7eb",
|
|
11010
11249
|
transition: "all 0.2s ease",
|
|
11011
11250
|
boxShadow: "0 1px 3px rgba(0,0,0,0.05)"
|
|
11012
|
-
} }, /* @__PURE__ */
|
|
11251
|
+
} }, /* @__PURE__ */ React28.createElement("h4", { style: {
|
|
11013
11252
|
fontSize: "14px",
|
|
11014
11253
|
fontWeight: "600",
|
|
11015
11254
|
marginBottom: "12px",
|
|
@@ -11017,14 +11256,14 @@ const MyComponent = () => {
|
|
|
11017
11256
|
display: "flex",
|
|
11018
11257
|
alignItems: "center",
|
|
11019
11258
|
gap: "6px"
|
|
11020
|
-
} }, /* @__PURE__ */
|
|
11259
|
+
} }, /* @__PURE__ */ React28.createElement("span", null, "\u2705"), " Selection"), /* @__PURE__ */ React28.createElement("ul", { style: { fontSize: "13px", lineHeight: "1.8", listStyle: "none", padding: 0, margin: 0 } }, /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#ec4899", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "getSelectedRows()")), /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#ec4899", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "selectAll()")), /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#ec4899", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "deselectAll()")), /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#ec4899", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "selectAllFiltered()")), /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#ec4899", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "getSelectedRowCount()")))), /* @__PURE__ */ React28.createElement("div", { style: {
|
|
11021
11260
|
padding: "16px",
|
|
11022
11261
|
backgroundColor: "#ffffff",
|
|
11023
11262
|
borderRadius: "8px",
|
|
11024
11263
|
border: "1px solid #e5e7eb",
|
|
11025
11264
|
transition: "all 0.2s ease",
|
|
11026
11265
|
boxShadow: "0 1px 3px rgba(0,0,0,0.05)"
|
|
11027
|
-
} }, /* @__PURE__ */
|
|
11266
|
+
} }, /* @__PURE__ */ React28.createElement("h4", { style: {
|
|
11028
11267
|
fontSize: "14px",
|
|
11029
11268
|
fontWeight: "600",
|
|
11030
11269
|
marginBottom: "12px",
|
|
@@ -11032,14 +11271,14 @@ const MyComponent = () => {
|
|
|
11032
11271
|
display: "flex",
|
|
11033
11272
|
alignItems: "center",
|
|
11034
11273
|
gap: "6px"
|
|
11035
|
-
} }, /* @__PURE__ */
|
|
11274
|
+
} }, /* @__PURE__ */ React28.createElement("span", null, "\u{1F9ED}"), " Navigation"), /* @__PURE__ */ React28.createElement("ul", { style: { fontSize: "13px", lineHeight: "1.8", listStyle: "none", padding: 0, margin: 0 } }, /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#14b8a6", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "ensureIndexVisible(index)")), /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#14b8a6", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "setFocusedCell(row, col)")), /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#14b8a6", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "clearFocusedCell()")))), /* @__PURE__ */ React28.createElement("div", { style: {
|
|
11036
11275
|
padding: "16px",
|
|
11037
11276
|
backgroundColor: "#ffffff",
|
|
11038
11277
|
borderRadius: "8px",
|
|
11039
11278
|
border: "1px solid #e5e7eb",
|
|
11040
11279
|
transition: "all 0.2s ease",
|
|
11041
11280
|
boxShadow: "0 1px 3px rgba(0,0,0,0.05)"
|
|
11042
|
-
} }, /* @__PURE__ */
|
|
11281
|
+
} }, /* @__PURE__ */ React28.createElement("h4", { style: {
|
|
11043
11282
|
fontSize: "14px",
|
|
11044
11283
|
fontWeight: "600",
|
|
11045
11284
|
marginBottom: "12px",
|
|
@@ -11047,7 +11286,7 @@ const MyComponent = () => {
|
|
|
11047
11286
|
display: "flex",
|
|
11048
11287
|
alignItems: "center",
|
|
11049
11288
|
gap: "6px"
|
|
11050
|
-
} }, /* @__PURE__ */
|
|
11289
|
+
} }, /* @__PURE__ */ React28.createElement("span", null, "\u{1F4E4}"), " Export"), /* @__PURE__ */ React28.createElement("ul", { style: { fontSize: "13px", lineHeight: "1.8", listStyle: "none", padding: 0, margin: 0 } }, /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#06b6d4", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "exportDataAsCsv(params?)")), /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#06b6d4", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "getDataAsCsv(params?)")), /* @__PURE__ */ React28.createElement("li", { style: { padding: "4px 0", display: "flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React28.createElement("span", { style: { color: "#06b6d4", fontSize: "10px" } }, "\u25CF"), /* @__PURE__ */ React28.createElement("code", { style: { backgroundColor: "#f3f4f6", padding: "2px 6px", borderRadius: "4px", fontSize: "12px" } }, "copySelectedRowsToClipboard()")))))));
|
|
11051
11290
|
};
|
|
11052
11291
|
var buttonStyle = {
|
|
11053
11292
|
display: "block",
|
|
@@ -11064,10 +11303,10 @@ var buttonStyle = {
|
|
|
11064
11303
|
};
|
|
11065
11304
|
|
|
11066
11305
|
// src/components/DataGrid/MarketDataGrid.tsx
|
|
11067
|
-
import
|
|
11306
|
+
import React30, { useRef as useRef13, useEffect as useEffect12, useMemo as useMemo7, useCallback as useCallback9 } from "react";
|
|
11068
11307
|
|
|
11069
11308
|
// src/components/DataGrid/MarketDataGridUtils.tsx
|
|
11070
|
-
import
|
|
11309
|
+
import React29 from "react";
|
|
11071
11310
|
var getColumnClass = (field) => {
|
|
11072
11311
|
const numericFields = ["price", "bid", "ask", "size", "volume", "change", "changePercent", "high", "low", "open"];
|
|
11073
11312
|
return numericFields.includes(field) ? "numeric-cell" : "";
|
|
@@ -11090,10 +11329,10 @@ var formatPrice = (value) => {
|
|
|
11090
11329
|
});
|
|
11091
11330
|
};
|
|
11092
11331
|
var formatChange = (value, isPercent) => {
|
|
11093
|
-
if (value == null) return /* @__PURE__ */
|
|
11332
|
+
if (value == null) return /* @__PURE__ */ React29.createElement("span", null, "-");
|
|
11094
11333
|
const formatted = isPercent ? `${value >= 0 ? "+" : ""}${value.toFixed(2)}%` : `${value >= 0 ? "+" : ""}${value.toFixed(2)}`;
|
|
11095
11334
|
const className = value >= 0 ? "change-positive" : "change-negative";
|
|
11096
|
-
return /* @__PURE__ */
|
|
11335
|
+
return /* @__PURE__ */ React29.createElement("span", { className }, formatted);
|
|
11097
11336
|
};
|
|
11098
11337
|
var formatVolume = (value) => {
|
|
11099
11338
|
if (value == null) return "";
|
|
@@ -11158,7 +11397,7 @@ var MarketDataGrid = ({
|
|
|
11158
11397
|
const handleRowClick = useCallback9((row) => {
|
|
11159
11398
|
onRowClick == null ? void 0 : onRowClick(row);
|
|
11160
11399
|
}, [onRowClick]);
|
|
11161
|
-
const renderHeader = () => /* @__PURE__ */
|
|
11400
|
+
const renderHeader = () => /* @__PURE__ */ React30.createElement("div", { className: "market-grid-header" }, /* @__PURE__ */ React30.createElement("div", { className: "market-grid-header-row" }, enhancedColumns.map((col) => /* @__PURE__ */ React30.createElement(
|
|
11162
11401
|
"div",
|
|
11163
11402
|
{
|
|
11164
11403
|
key: col.field,
|
|
@@ -11167,7 +11406,7 @@ var MarketDataGrid = ({
|
|
|
11167
11406
|
},
|
|
11168
11407
|
col.headerName
|
|
11169
11408
|
))));
|
|
11170
|
-
const renderBody = () => /* @__PURE__ */
|
|
11409
|
+
const renderBody = () => /* @__PURE__ */ React30.createElement("div", { className: "market-grid-body" }, rows.map((row) => /* @__PURE__ */ React30.createElement(
|
|
11171
11410
|
"div",
|
|
11172
11411
|
{
|
|
11173
11412
|
key: row.id,
|
|
@@ -11176,7 +11415,7 @@ var MarketDataGrid = ({
|
|
|
11176
11415
|
},
|
|
11177
11416
|
enhancedColumns.map((col) => {
|
|
11178
11417
|
const value = row[col.field];
|
|
11179
|
-
return /* @__PURE__ */
|
|
11418
|
+
return /* @__PURE__ */ React30.createElement(
|
|
11180
11419
|
"div",
|
|
11181
11420
|
{
|
|
11182
11421
|
key: col.field,
|
|
@@ -11194,7 +11433,7 @@ var MarketDataGrid = ({
|
|
|
11194
11433
|
})
|
|
11195
11434
|
)));
|
|
11196
11435
|
const containerClassName = `market-data-grid ${(config == null ? void 0 : config.densityMode) ? "density-compact" : ""} ${className}`.trim();
|
|
11197
|
-
return /* @__PURE__ */
|
|
11436
|
+
return /* @__PURE__ */ React30.createElement("div", { ref: tableRef, className: containerClassName, "data-testid": "data-grid" }, renderHeader(), renderBody());
|
|
11198
11437
|
};
|
|
11199
11438
|
|
|
11200
11439
|
// src/components/DataGrid/MarketDataEngine.ts
|
|
@@ -12049,7 +12288,7 @@ function createMockFeed(config) {
|
|
|
12049
12288
|
}
|
|
12050
12289
|
|
|
12051
12290
|
// src/components/DataGrid/PivotToolbar.tsx
|
|
12052
|
-
import
|
|
12291
|
+
import React31, { useState as useState20, useMemo as useMemo8 } from "react";
|
|
12053
12292
|
var AGGREGATOR_OPTIONS = [
|
|
12054
12293
|
{ value: "sum", label: "Sum" },
|
|
12055
12294
|
{ value: "avg", label: "Average" },
|
|
@@ -12105,7 +12344,7 @@ var PivotToolbar = ({
|
|
|
12105
12344
|
const handleToggle = () => {
|
|
12106
12345
|
setIsExpanded(!isExpanded);
|
|
12107
12346
|
};
|
|
12108
|
-
return /* @__PURE__ */
|
|
12347
|
+
return /* @__PURE__ */ React31.createElement(
|
|
12109
12348
|
"div",
|
|
12110
12349
|
{
|
|
12111
12350
|
className,
|
|
@@ -12117,14 +12356,14 @@ var PivotToolbar = ({
|
|
|
12117
12356
|
...style
|
|
12118
12357
|
}
|
|
12119
12358
|
},
|
|
12120
|
-
/* @__PURE__ */
|
|
12359
|
+
/* @__PURE__ */ React31.createElement("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: isExpanded ? "12px" : "0" } }, /* @__PURE__ */ React31.createElement("div", { style: { display: "flex", alignItems: "center", gap: "8px" } }, /* @__PURE__ */ React31.createElement("span", { style: { fontSize: "20px" } }, "\u{1F4CA}"), /* @__PURE__ */ React31.createElement("h3", { style: { margin: 0, fontSize: "14px", fontWeight: "600", color: "#1e293b" } }, "Pivot Table"), isPivotMode && /* @__PURE__ */ React31.createElement("span", { style: {
|
|
12121
12360
|
backgroundColor: "#10b981",
|
|
12122
12361
|
color: "white",
|
|
12123
12362
|
padding: "2px 8px",
|
|
12124
12363
|
borderRadius: "12px",
|
|
12125
12364
|
fontSize: "11px",
|
|
12126
12365
|
fontWeight: "600"
|
|
12127
|
-
} }, "Active")), /* @__PURE__ */
|
|
12366
|
+
} }, "Active")), /* @__PURE__ */ React31.createElement("div", { style: { display: "flex", gap: "8px" } }, isPivotMode && /* @__PURE__ */ React31.createElement(
|
|
12128
12367
|
"button",
|
|
12129
12368
|
{
|
|
12130
12369
|
onClick: handleClear,
|
|
@@ -12147,7 +12386,7 @@ var PivotToolbar = ({
|
|
|
12147
12386
|
}
|
|
12148
12387
|
},
|
|
12149
12388
|
"Clear Pivot"
|
|
12150
|
-
), /* @__PURE__ */
|
|
12389
|
+
), /* @__PURE__ */ React31.createElement(
|
|
12151
12390
|
"button",
|
|
12152
12391
|
{
|
|
12153
12392
|
onClick: handleToggle,
|
|
@@ -12170,7 +12409,7 @@ var PivotToolbar = ({
|
|
|
12170
12409
|
},
|
|
12171
12410
|
isExpanded ? "\u25B2" : "\u25BC"
|
|
12172
12411
|
))),
|
|
12173
|
-
isExpanded && /* @__PURE__ */
|
|
12412
|
+
isExpanded && /* @__PURE__ */ React31.createElement("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(200px, 1fr))", gap: "12px" } }, /* @__PURE__ */ React31.createElement("div", null, /* @__PURE__ */ React31.createElement("label", { style: { display: "block", fontSize: "12px", fontWeight: "600", color: "#475569", marginBottom: "6px" } }, "Row Group By ", /* @__PURE__ */ React31.createElement("span", { style: { color: "#dc2626" } }, "*")), /* @__PURE__ */ React31.createElement(
|
|
12174
12413
|
"select",
|
|
12175
12414
|
{
|
|
12176
12415
|
value: rowGroupColumn,
|
|
@@ -12186,9 +12425,9 @@ var PivotToolbar = ({
|
|
|
12186
12425
|
cursor: "pointer"
|
|
12187
12426
|
}
|
|
12188
12427
|
},
|
|
12189
|
-
/* @__PURE__ */
|
|
12190
|
-
columns.map((col) => /* @__PURE__ */
|
|
12191
|
-
)), /* @__PURE__ */
|
|
12428
|
+
/* @__PURE__ */ React31.createElement("option", { value: "" }, "Select column..."),
|
|
12429
|
+
columns.map((col) => /* @__PURE__ */ React31.createElement("option", { key: col.field, value: col.field }, col.headerName))
|
|
12430
|
+
)), /* @__PURE__ */ React31.createElement("div", null, /* @__PURE__ */ React31.createElement("label", { style: { display: "block", fontSize: "12px", fontWeight: "600", color: "#475569", marginBottom: "6px" } }, "Pivot Column ", /* @__PURE__ */ React31.createElement("span", { style: { color: "#dc2626" } }, "*")), /* @__PURE__ */ React31.createElement(
|
|
12192
12431
|
"select",
|
|
12193
12432
|
{
|
|
12194
12433
|
value: pivotColumn,
|
|
@@ -12204,9 +12443,9 @@ var PivotToolbar = ({
|
|
|
12204
12443
|
cursor: "pointer"
|
|
12205
12444
|
}
|
|
12206
12445
|
},
|
|
12207
|
-
/* @__PURE__ */
|
|
12208
|
-
columns.map((col) => /* @__PURE__ */
|
|
12209
|
-
)), /* @__PURE__ */
|
|
12446
|
+
/* @__PURE__ */ React31.createElement("option", { value: "" }, "Select column..."),
|
|
12447
|
+
columns.map((col) => /* @__PURE__ */ React31.createElement("option", { key: col.field, value: col.field }, col.headerName))
|
|
12448
|
+
)), /* @__PURE__ */ React31.createElement("div", null, /* @__PURE__ */ React31.createElement("label", { style: { display: "block", fontSize: "12px", fontWeight: "600", color: "#475569", marginBottom: "6px" } }, "Value Column ", /* @__PURE__ */ React31.createElement("span", { style: { color: "#dc2626" } }, "*")), /* @__PURE__ */ React31.createElement(
|
|
12210
12449
|
"select",
|
|
12211
12450
|
{
|
|
12212
12451
|
value: valueColumn,
|
|
@@ -12222,9 +12461,9 @@ var PivotToolbar = ({
|
|
|
12222
12461
|
cursor: "pointer"
|
|
12223
12462
|
}
|
|
12224
12463
|
},
|
|
12225
|
-
/* @__PURE__ */
|
|
12226
|
-
columns.map((col) => /* @__PURE__ */
|
|
12227
|
-
)), /* @__PURE__ */
|
|
12464
|
+
/* @__PURE__ */ React31.createElement("option", { value: "" }, "Select column..."),
|
|
12465
|
+
columns.map((col) => /* @__PURE__ */ React31.createElement("option", { key: col.field, value: col.field }, col.headerName))
|
|
12466
|
+
)), /* @__PURE__ */ React31.createElement("div", null, /* @__PURE__ */ React31.createElement("label", { style: { display: "block", fontSize: "12px", fontWeight: "600", color: "#475569", marginBottom: "6px" } }, "Aggregation"), /* @__PURE__ */ React31.createElement(
|
|
12228
12467
|
"select",
|
|
12229
12468
|
{
|
|
12230
12469
|
value: aggregator,
|
|
@@ -12240,8 +12479,8 @@ var PivotToolbar = ({
|
|
|
12240
12479
|
cursor: "pointer"
|
|
12241
12480
|
}
|
|
12242
12481
|
},
|
|
12243
|
-
AGGREGATOR_OPTIONS.map((opt) => /* @__PURE__ */
|
|
12244
|
-
)), /* @__PURE__ */
|
|
12482
|
+
AGGREGATOR_OPTIONS.map((opt) => /* @__PURE__ */ React31.createElement("option", { key: opt.value, value: opt.value }, opt.label))
|
|
12483
|
+
)), /* @__PURE__ */ React31.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "8px", justifyContent: "center" } }, /* @__PURE__ */ React31.createElement("label", { style: { display: "flex", alignItems: "center", gap: "6px", fontSize: "13px", color: "#475569", cursor: "pointer" } }, /* @__PURE__ */ React31.createElement(
|
|
12245
12484
|
"input",
|
|
12246
12485
|
{
|
|
12247
12486
|
type: "checkbox",
|
|
@@ -12249,7 +12488,7 @@ var PivotToolbar = ({
|
|
|
12249
12488
|
onChange: (e) => setShowTotals(e.target.checked),
|
|
12250
12489
|
style: { cursor: "pointer" }
|
|
12251
12490
|
}
|
|
12252
|
-
), "Show Totals Row"), /* @__PURE__ */
|
|
12491
|
+
), "Show Totals Row"), /* @__PURE__ */ React31.createElement("label", { style: { display: "flex", alignItems: "center", gap: "6px", fontSize: "13px", color: "#475569", cursor: "pointer" } }, /* @__PURE__ */ React31.createElement(
|
|
12253
12492
|
"input",
|
|
12254
12493
|
{
|
|
12255
12494
|
type: "checkbox",
|
|
@@ -12257,7 +12496,7 @@ var PivotToolbar = ({
|
|
|
12257
12496
|
onChange: (e) => setShowGrandTotal(e.target.checked),
|
|
12258
12497
|
style: { cursor: "pointer" }
|
|
12259
12498
|
}
|
|
12260
|
-
), "Show Grand Total Column")), /* @__PURE__ */
|
|
12499
|
+
), "Show Grand Total Column")), /* @__PURE__ */ React31.createElement("div", { style: { display: "flex", alignItems: "flex-end" } }, /* @__PURE__ */ React31.createElement(
|
|
12261
12500
|
"button",
|
|
12262
12501
|
{
|
|
12263
12502
|
onClick: handleApply,
|
|
@@ -12288,7 +12527,7 @@ var PivotToolbar = ({
|
|
|
12288
12527
|
},
|
|
12289
12528
|
"Apply Pivot"
|
|
12290
12529
|
))),
|
|
12291
|
-
isExpanded && /* @__PURE__ */
|
|
12530
|
+
isExpanded && /* @__PURE__ */ React31.createElement("div", { style: {
|
|
12292
12531
|
marginTop: "12px",
|
|
12293
12532
|
padding: "10px",
|
|
12294
12533
|
backgroundColor: "#eff6ff",
|
|
@@ -12296,7 +12535,7 @@ var PivotToolbar = ({
|
|
|
12296
12535
|
borderRadius: "6px",
|
|
12297
12536
|
fontSize: "12px",
|
|
12298
12537
|
color: "#1e40af"
|
|
12299
|
-
} }, /* @__PURE__ */
|
|
12538
|
+
} }, /* @__PURE__ */ React31.createElement("strong", null, "\u{1F4A1} Tip:"), " Select a Row Group column to organize data by, a Pivot column whose values become new columns, and a Value column to aggregate.")
|
|
12300
12539
|
);
|
|
12301
12540
|
};
|
|
12302
12541
|
|
|
@@ -12496,7 +12735,7 @@ function filterOptions(options, searchQuery) {
|
|
|
12496
12735
|
}
|
|
12497
12736
|
|
|
12498
12737
|
// src/editors/RichSelectEditor.tsx
|
|
12499
|
-
import
|
|
12738
|
+
import React32, { useState as useState21, useRef as useRef16, useEffect as useEffect15, useMemo as useMemo9 } from "react";
|
|
12500
12739
|
function RichSelectEditor(props) {
|
|
12501
12740
|
const {
|
|
12502
12741
|
value,
|
|
@@ -12613,16 +12852,16 @@ function RichSelectEditor(props) {
|
|
|
12613
12852
|
if (renderOptionLabel) {
|
|
12614
12853
|
return renderOptionLabel(option);
|
|
12615
12854
|
}
|
|
12616
|
-
return /* @__PURE__ */
|
|
12855
|
+
return /* @__PURE__ */ React32.createElement("div", { className: "editor-option-content" }, option.icon && /* @__PURE__ */ React32.createElement("span", { className: "editor-option-icon" }, option.icon), /* @__PURE__ */ React32.createElement("div", { className: "editor-option-text" }, /* @__PURE__ */ React32.createElement("div", { className: "editor-option-label" }, option.label), option.description && /* @__PURE__ */ React32.createElement("div", { className: "editor-option-description" }, option.description)));
|
|
12617
12856
|
};
|
|
12618
|
-
return /* @__PURE__ */
|
|
12857
|
+
return /* @__PURE__ */ React32.createElement(
|
|
12619
12858
|
"div",
|
|
12620
12859
|
{
|
|
12621
12860
|
ref: containerRef,
|
|
12622
12861
|
className: "editor-container editor-richselect-container",
|
|
12623
12862
|
onKeyDown: handleKeyDown
|
|
12624
12863
|
},
|
|
12625
|
-
/* @__PURE__ */
|
|
12864
|
+
/* @__PURE__ */ React32.createElement("div", { className: "editor-input-wrapper" }, /* @__PURE__ */ React32.createElement(
|
|
12626
12865
|
"input",
|
|
12627
12866
|
{
|
|
12628
12867
|
ref: inputRef,
|
|
@@ -12642,7 +12881,7 @@ function RichSelectEditor(props) {
|
|
|
12642
12881
|
"aria-controls": "richselect-dropdown",
|
|
12643
12882
|
autoComplete: "off"
|
|
12644
12883
|
}
|
|
12645
|
-
), /* @__PURE__ */
|
|
12884
|
+
), /* @__PURE__ */ React32.createElement("div", { className: "editor-input-actions" }, allowClear && value !== null && value !== void 0 && /* @__PURE__ */ React32.createElement(
|
|
12646
12885
|
"button",
|
|
12647
12886
|
{
|
|
12648
12887
|
type: "button",
|
|
@@ -12652,8 +12891,8 @@ function RichSelectEditor(props) {
|
|
|
12652
12891
|
tabIndex: -1
|
|
12653
12892
|
},
|
|
12654
12893
|
"\xD7"
|
|
12655
|
-
), /* @__PURE__ */
|
|
12656
|
-
isOpen && /* @__PURE__ */
|
|
12894
|
+
), /* @__PURE__ */ React32.createElement("span", { className: "editor-dropdown-icon", "aria-hidden": "true" }, "\u25BC"))),
|
|
12895
|
+
isOpen && /* @__PURE__ */ React32.createElement(
|
|
12657
12896
|
"div",
|
|
12658
12897
|
{
|
|
12659
12898
|
ref: dropdownRef,
|
|
@@ -12662,7 +12901,7 @@ function RichSelectEditor(props) {
|
|
|
12662
12901
|
role: "listbox",
|
|
12663
12902
|
style: { maxHeight: maxDropdownHeight }
|
|
12664
12903
|
},
|
|
12665
|
-
filteredOptions.length === 0 ? /* @__PURE__ */
|
|
12904
|
+
filteredOptions.length === 0 ? /* @__PURE__ */ React32.createElement("div", { className: "editor-dropdown-empty" }, "No options found") : filteredOptions.map((option, index) => /* @__PURE__ */ React32.createElement(
|
|
12666
12905
|
"div",
|
|
12667
12906
|
{
|
|
12668
12907
|
key: option.value,
|
|
@@ -12684,7 +12923,7 @@ function RichSelectEditor(props) {
|
|
|
12684
12923
|
RichSelectEditor.displayName = "RichSelectEditor";
|
|
12685
12924
|
|
|
12686
12925
|
// src/editors/DateEditor.tsx
|
|
12687
|
-
import
|
|
12926
|
+
import React33, { useState as useState22, useRef as useRef17, useMemo as useMemo10 } from "react";
|
|
12688
12927
|
function DateEditor(props) {
|
|
12689
12928
|
const {
|
|
12690
12929
|
value,
|
|
@@ -12710,7 +12949,7 @@ function DateEditor(props) {
|
|
|
12710
12949
|
const parsed = new Date(value);
|
|
12711
12950
|
return isNaN(parsed.getTime()) ? null : parsed;
|
|
12712
12951
|
}, [value]);
|
|
12713
|
-
|
|
12952
|
+
React33.useEffect(() => {
|
|
12714
12953
|
if (parsedValue) {
|
|
12715
12954
|
setInputValue(formatDate(parsedValue, dateFormat, showTime));
|
|
12716
12955
|
setViewDate(parsedValue);
|
|
@@ -12783,14 +13022,14 @@ function DateEditor(props) {
|
|
|
12783
13022
|
const calendarDays = useMemo10(() => {
|
|
12784
13023
|
return generateCalendarDays(viewDate, parsedValue, minDate, maxDate);
|
|
12785
13024
|
}, [viewDate, parsedValue, minDate, maxDate]);
|
|
12786
|
-
return /* @__PURE__ */
|
|
13025
|
+
return /* @__PURE__ */ React33.createElement(
|
|
12787
13026
|
"div",
|
|
12788
13027
|
{
|
|
12789
13028
|
ref: containerRef,
|
|
12790
13029
|
className: "editor-container editor-date-container",
|
|
12791
13030
|
onKeyDown: handleKeyDown
|
|
12792
13031
|
},
|
|
12793
|
-
/* @__PURE__ */
|
|
13032
|
+
/* @__PURE__ */ React33.createElement("div", { className: "editor-input-wrapper" }, /* @__PURE__ */ React33.createElement(
|
|
12794
13033
|
"input",
|
|
12795
13034
|
{
|
|
12796
13035
|
ref: inputRef,
|
|
@@ -12803,8 +13042,8 @@ function DateEditor(props) {
|
|
|
12803
13042
|
"aria-label": "Date input",
|
|
12804
13043
|
autoComplete: "off"
|
|
12805
13044
|
}
|
|
12806
|
-
), /* @__PURE__ */
|
|
12807
|
-
isOpen && /* @__PURE__ */
|
|
13045
|
+
), /* @__PURE__ */ React33.createElement("span", { className: "editor-calendar-icon", "aria-hidden": "true" }, "\u{1F4C5}")),
|
|
13046
|
+
isOpen && /* @__PURE__ */ React33.createElement("div", { ref: calendarRef, className: "editor-dropdown editor-calendar" }, /* @__PURE__ */ React33.createElement("div", { className: "editor-calendar-header" }, /* @__PURE__ */ React33.createElement(
|
|
12808
13047
|
"button",
|
|
12809
13048
|
{
|
|
12810
13049
|
type: "button",
|
|
@@ -12813,10 +13052,10 @@ function DateEditor(props) {
|
|
|
12813
13052
|
"aria-label": "Previous month"
|
|
12814
13053
|
},
|
|
12815
13054
|
"\u2039"
|
|
12816
|
-
), /* @__PURE__ */
|
|
13055
|
+
), /* @__PURE__ */ React33.createElement("div", { className: "editor-calendar-title" }, viewDate.toLocaleDateString("en-US", {
|
|
12817
13056
|
month: "long",
|
|
12818
13057
|
year: "numeric"
|
|
12819
|
-
})), /* @__PURE__ */
|
|
13058
|
+
})), /* @__PURE__ */ React33.createElement(
|
|
12820
13059
|
"button",
|
|
12821
13060
|
{
|
|
12822
13061
|
type: "button",
|
|
@@ -12825,7 +13064,7 @@ function DateEditor(props) {
|
|
|
12825
13064
|
"aria-label": "Next month"
|
|
12826
13065
|
},
|
|
12827
13066
|
"\u203A"
|
|
12828
|
-
)), /* @__PURE__ */
|
|
13067
|
+
)), /* @__PURE__ */ React33.createElement("div", { className: "editor-calendar-weekdays" }, ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((day) => /* @__PURE__ */ React33.createElement("div", { key: day, className: "editor-calendar-weekday" }, day))), /* @__PURE__ */ React33.createElement("div", { className: "editor-calendar-days" }, calendarDays.map((day, index) => /* @__PURE__ */ React33.createElement(
|
|
12829
13068
|
"button",
|
|
12830
13069
|
{
|
|
12831
13070
|
key: index,
|
|
@@ -12836,7 +13075,7 @@ function DateEditor(props) {
|
|
|
12836
13075
|
"aria-label": day.date ? day.date.toDateString() : ""
|
|
12837
13076
|
},
|
|
12838
13077
|
day.label
|
|
12839
|
-
))), showTime && /* @__PURE__ */
|
|
13078
|
+
))), showTime && /* @__PURE__ */ React33.createElement("div", { className: "editor-calendar-time" }, /* @__PURE__ */ React33.createElement(
|
|
12840
13079
|
"input",
|
|
12841
13080
|
{
|
|
12842
13081
|
type: "time",
|
|
@@ -12949,7 +13188,7 @@ function isDateDisabled(date, minDate, maxDate) {
|
|
|
12949
13188
|
}
|
|
12950
13189
|
|
|
12951
13190
|
// src/editors/NumericEditor.tsx
|
|
12952
|
-
import
|
|
13191
|
+
import React34, { useState as useState23, useEffect as useEffect16 } from "react";
|
|
12953
13192
|
function NumericEditor(props) {
|
|
12954
13193
|
const {
|
|
12955
13194
|
value,
|
|
@@ -13059,7 +13298,7 @@ function NumericEditor(props) {
|
|
|
13059
13298
|
handleEditorKeyDown(e);
|
|
13060
13299
|
};
|
|
13061
13300
|
const displayValue = isFocused ? inputValue : inputValue ? `${prefix}${inputValue}${suffix}` : "";
|
|
13062
|
-
return /* @__PURE__ */
|
|
13301
|
+
return /* @__PURE__ */ React34.createElement("div", { className: "editor-container editor-numeric-container" }, /* @__PURE__ */ React34.createElement("div", { className: "editor-input-wrapper" }, prefix && !isFocused && /* @__PURE__ */ React34.createElement("span", { className: "editor-numeric-prefix" }, prefix), /* @__PURE__ */ React34.createElement(
|
|
13063
13302
|
"input",
|
|
13064
13303
|
{
|
|
13065
13304
|
ref: inputRef,
|
|
@@ -13077,7 +13316,7 @@ function NumericEditor(props) {
|
|
|
13077
13316
|
"aria-valuenow": value ?? void 0,
|
|
13078
13317
|
autoComplete: "off"
|
|
13079
13318
|
}
|
|
13080
|
-
), suffix && !isFocused && /* @__PURE__ */
|
|
13319
|
+
), suffix && !isFocused && /* @__PURE__ */ React34.createElement("span", { className: "editor-numeric-suffix" }, suffix), showSteppers && /* @__PURE__ */ React34.createElement("div", { className: "editor-numeric-steppers" }, /* @__PURE__ */ React34.createElement(
|
|
13081
13320
|
"button",
|
|
13082
13321
|
{
|
|
13083
13322
|
type: "button",
|
|
@@ -13089,7 +13328,7 @@ function NumericEditor(props) {
|
|
|
13089
13328
|
tabIndex: -1
|
|
13090
13329
|
},
|
|
13091
13330
|
"\u25B2"
|
|
13092
|
-
), /* @__PURE__ */
|
|
13331
|
+
), /* @__PURE__ */ React34.createElement(
|
|
13093
13332
|
"button",
|
|
13094
13333
|
{
|
|
13095
13334
|
type: "button",
|
|
@@ -13101,12 +13340,12 @@ function NumericEditor(props) {
|
|
|
13101
13340
|
tabIndex: -1
|
|
13102
13341
|
},
|
|
13103
13342
|
"\u25BC"
|
|
13104
|
-
))), (min !== void 0 || max !== void 0) && /* @__PURE__ */
|
|
13343
|
+
))), (min !== void 0 || max !== void 0) && /* @__PURE__ */ React34.createElement("div", { className: "editor-numeric-range" }, min !== void 0 && /* @__PURE__ */ React34.createElement("span", null, "Min: ", min), max !== void 0 && /* @__PURE__ */ React34.createElement("span", null, "Max: ", max)));
|
|
13105
13344
|
}
|
|
13106
13345
|
NumericEditor.displayName = "NumericEditor";
|
|
13107
13346
|
|
|
13108
13347
|
// src/editors/MultiSelectEditor.tsx
|
|
13109
|
-
import
|
|
13348
|
+
import React35, { useState as useState24, useRef as useRef18, useMemo as useMemo11 } from "react";
|
|
13110
13349
|
function MultiSelectEditor(props) {
|
|
13111
13350
|
const {
|
|
13112
13351
|
value = [],
|
|
@@ -13229,20 +13468,20 @@ function MultiSelectEditor(props) {
|
|
|
13229
13468
|
};
|
|
13230
13469
|
const visibleTags = selectedOptions.slice(0, maxTagCount);
|
|
13231
13470
|
const collapsedCount = Math.max(0, selectedOptions.length - maxTagCount);
|
|
13232
|
-
return /* @__PURE__ */
|
|
13471
|
+
return /* @__PURE__ */ React35.createElement(
|
|
13233
13472
|
"div",
|
|
13234
13473
|
{
|
|
13235
13474
|
ref: containerRef,
|
|
13236
13475
|
className: "editor-container editor-multiselect-container",
|
|
13237
13476
|
onKeyDown: handleCombinedKeyDown
|
|
13238
13477
|
},
|
|
13239
|
-
/* @__PURE__ */
|
|
13478
|
+
/* @__PURE__ */ React35.createElement(
|
|
13240
13479
|
"div",
|
|
13241
13480
|
{
|
|
13242
13481
|
ref: tagContainerRef,
|
|
13243
13482
|
className: "editor-input-wrapper editor-multiselect-wrapper"
|
|
13244
13483
|
},
|
|
13245
|
-
/* @__PURE__ */
|
|
13484
|
+
/* @__PURE__ */ React35.createElement("div", { className: "editor-multiselect-tags" }, visibleTags.map((option) => /* @__PURE__ */ React35.createElement("div", { key: option.value, className: "editor-tag" }, option.icon && /* @__PURE__ */ React35.createElement("span", { className: "editor-tag-icon" }, option.icon), /* @__PURE__ */ React35.createElement("span", { className: "editor-tag-label" }, option.label), /* @__PURE__ */ React35.createElement(
|
|
13246
13485
|
"button",
|
|
13247
13486
|
{
|
|
13248
13487
|
type: "button",
|
|
@@ -13252,8 +13491,8 @@ function MultiSelectEditor(props) {
|
|
|
13252
13491
|
tabIndex: -1
|
|
13253
13492
|
},
|
|
13254
13493
|
"\xD7"
|
|
13255
|
-
))), collapsedCount > 0 && /* @__PURE__ */
|
|
13256
|
-
/* @__PURE__ */
|
|
13494
|
+
))), collapsedCount > 0 && /* @__PURE__ */ React35.createElement("div", { className: "editor-tag editor-tag-collapsed" }, "+", collapsedCount)),
|
|
13495
|
+
/* @__PURE__ */ React35.createElement(
|
|
13257
13496
|
"input",
|
|
13258
13497
|
{
|
|
13259
13498
|
ref: inputRef,
|
|
@@ -13272,9 +13511,9 @@ function MultiSelectEditor(props) {
|
|
|
13272
13511
|
autoComplete: "off"
|
|
13273
13512
|
}
|
|
13274
13513
|
),
|
|
13275
|
-
/* @__PURE__ */
|
|
13514
|
+
/* @__PURE__ */ React35.createElement("span", { className: "editor-dropdown-icon", "aria-hidden": "true" }, "\u25BC")
|
|
13276
13515
|
),
|
|
13277
|
-
isOpen && /* @__PURE__ */
|
|
13516
|
+
isOpen && /* @__PURE__ */ React35.createElement(
|
|
13278
13517
|
"div",
|
|
13279
13518
|
{
|
|
13280
13519
|
ref: dropdownRef,
|
|
@@ -13284,9 +13523,9 @@ function MultiSelectEditor(props) {
|
|
|
13284
13523
|
"aria-multiselectable": "true",
|
|
13285
13524
|
style: { maxHeight: maxDropdownHeight }
|
|
13286
13525
|
},
|
|
13287
|
-
filteredOptions.length === 0 ? /* @__PURE__ */
|
|
13526
|
+
filteredOptions.length === 0 ? /* @__PURE__ */ React35.createElement("div", { className: "editor-dropdown-empty" }, "No options found") : filteredOptions.map((option, index) => {
|
|
13288
13527
|
const isSelected = selectedValues.includes(option.value);
|
|
13289
|
-
return /* @__PURE__ */
|
|
13528
|
+
return /* @__PURE__ */ React35.createElement(
|
|
13290
13529
|
"div",
|
|
13291
13530
|
{
|
|
13292
13531
|
key: option.value,
|
|
@@ -13297,7 +13536,7 @@ function MultiSelectEditor(props) {
|
|
|
13297
13536
|
onClick: () => handleToggleOption(option),
|
|
13298
13537
|
onMouseEnter: () => !option.disabled && setFocusedIndex(index)
|
|
13299
13538
|
},
|
|
13300
|
-
/* @__PURE__ */
|
|
13539
|
+
/* @__PURE__ */ React35.createElement(
|
|
13301
13540
|
"input",
|
|
13302
13541
|
{
|
|
13303
13542
|
type: "checkbox",
|
|
@@ -13310,7 +13549,7 @@ function MultiSelectEditor(props) {
|
|
|
13310
13549
|
"aria-hidden": "true"
|
|
13311
13550
|
}
|
|
13312
13551
|
),
|
|
13313
|
-
/* @__PURE__ */
|
|
13552
|
+
/* @__PURE__ */ React35.createElement("div", { className: "editor-option-content" }, option.icon && /* @__PURE__ */ React35.createElement("span", { className: "editor-option-icon" }, option.icon), /* @__PURE__ */ React35.createElement("span", { className: "editor-option-label" }, option.label))
|
|
13314
13553
|
);
|
|
13315
13554
|
})
|
|
13316
13555
|
)
|
|
@@ -13319,7 +13558,7 @@ function MultiSelectEditor(props) {
|
|
|
13319
13558
|
MultiSelectEditor.displayName = "MultiSelectEditor";
|
|
13320
13559
|
|
|
13321
13560
|
// src/editors/MarkdownEditor.tsx
|
|
13322
|
-
import
|
|
13561
|
+
import React36, { useState as useState25, useRef as useRef19, useMemo as useMemo12 } from "react";
|
|
13323
13562
|
function MarkdownEditor(props) {
|
|
13324
13563
|
const {
|
|
13325
13564
|
value = "",
|
|
@@ -13430,14 +13669,14 @@ function MarkdownEditor(props) {
|
|
|
13430
13669
|
const previewHtml = useMemo12(() => {
|
|
13431
13670
|
return renderMarkdownPreview(internalValue);
|
|
13432
13671
|
}, [internalValue]);
|
|
13433
|
-
return /* @__PURE__ */
|
|
13672
|
+
return /* @__PURE__ */ React36.createElement(
|
|
13434
13673
|
"div",
|
|
13435
13674
|
{
|
|
13436
13675
|
ref: containerRef,
|
|
13437
13676
|
className: "editor-container editor-markdown-container",
|
|
13438
13677
|
style: { minHeight }
|
|
13439
13678
|
},
|
|
13440
|
-
/* @__PURE__ */
|
|
13679
|
+
/* @__PURE__ */ React36.createElement("div", { className: "editor-markdown-toolbar" }, /* @__PURE__ */ React36.createElement("div", { className: "editor-markdown-toolbar-group" }, /* @__PURE__ */ React36.createElement(
|
|
13441
13680
|
"button",
|
|
13442
13681
|
{
|
|
13443
13682
|
type: "button",
|
|
@@ -13456,8 +13695,8 @@ function MarkdownEditor(props) {
|
|
|
13456
13695
|
title: "Bold (Ctrl+B)",
|
|
13457
13696
|
"aria-label": "Bold"
|
|
13458
13697
|
},
|
|
13459
|
-
/* @__PURE__ */
|
|
13460
|
-
), /* @__PURE__ */
|
|
13698
|
+
/* @__PURE__ */ React36.createElement("strong", null, "B")
|
|
13699
|
+
), /* @__PURE__ */ React36.createElement(
|
|
13461
13700
|
"button",
|
|
13462
13701
|
{
|
|
13463
13702
|
type: "button",
|
|
@@ -13476,8 +13715,8 @@ function MarkdownEditor(props) {
|
|
|
13476
13715
|
title: "Italic (Ctrl+I)",
|
|
13477
13716
|
"aria-label": "Italic"
|
|
13478
13717
|
},
|
|
13479
|
-
/* @__PURE__ */
|
|
13480
|
-
), /* @__PURE__ */
|
|
13718
|
+
/* @__PURE__ */ React36.createElement("em", null, "I")
|
|
13719
|
+
), /* @__PURE__ */ React36.createElement(
|
|
13481
13720
|
"button",
|
|
13482
13721
|
{
|
|
13483
13722
|
type: "button",
|
|
@@ -13497,7 +13736,7 @@ function MarkdownEditor(props) {
|
|
|
13497
13736
|
"aria-label": "Link"
|
|
13498
13737
|
},
|
|
13499
13738
|
"\u{1F517}"
|
|
13500
|
-
)), /* @__PURE__ */
|
|
13739
|
+
)), /* @__PURE__ */ React36.createElement("div", { className: "editor-markdown-toolbar-group" }, /* @__PURE__ */ React36.createElement(
|
|
13501
13740
|
"button",
|
|
13502
13741
|
{
|
|
13503
13742
|
type: "button",
|
|
@@ -13509,7 +13748,7 @@ function MarkdownEditor(props) {
|
|
|
13509
13748
|
},
|
|
13510
13749
|
"\u{1F441}"
|
|
13511
13750
|
))),
|
|
13512
|
-
/* @__PURE__ */
|
|
13751
|
+
/* @__PURE__ */ React36.createElement("div", { className: `editor-markdown-content ${showPreviewPanel ? "split" : ""}` }, /* @__PURE__ */ React36.createElement("div", { className: "editor-markdown-editor" }, /* @__PURE__ */ React36.createElement(
|
|
13513
13752
|
"textarea",
|
|
13514
13753
|
{
|
|
13515
13754
|
ref: textareaRef,
|
|
@@ -13523,14 +13762,14 @@ function MarkdownEditor(props) {
|
|
|
13523
13762
|
"aria-label": "Markdown editor",
|
|
13524
13763
|
style: { maxHeight }
|
|
13525
13764
|
}
|
|
13526
|
-
), /* @__PURE__ */
|
|
13765
|
+
), /* @__PURE__ */ React36.createElement("div", { className: `editor-markdown-char-count ${charCountClass}` }, charCount, maxLength && ` / ${maxLength}`)), showPreviewPanel && /* @__PURE__ */ React36.createElement("div", { className: "editor-markdown-preview" }, /* @__PURE__ */ React36.createElement("div", { className: "editor-markdown-preview-label" }, "Preview"), /* @__PURE__ */ React36.createElement(
|
|
13527
13766
|
"div",
|
|
13528
13767
|
{
|
|
13529
13768
|
className: "editor-markdown-preview-content",
|
|
13530
13769
|
dangerouslySetInnerHTML: { __html: previewHtml }
|
|
13531
13770
|
}
|
|
13532
13771
|
))),
|
|
13533
|
-
/* @__PURE__ */
|
|
13772
|
+
/* @__PURE__ */ React36.createElement("div", { className: "editor-markdown-footer" }, /* @__PURE__ */ React36.createElement("div", { className: "editor-markdown-hint" }, /* @__PURE__ */ React36.createElement("kbd", null, "Ctrl+Enter"), " to save \u2022 ", /* @__PURE__ */ React36.createElement("kbd", null, "Esc"), " to cancel"), /* @__PURE__ */ React36.createElement("div", { className: "editor-markdown-actions" }, /* @__PURE__ */ React36.createElement(
|
|
13534
13773
|
"button",
|
|
13535
13774
|
{
|
|
13536
13775
|
type: "button",
|
|
@@ -13538,7 +13777,7 @@ function MarkdownEditor(props) {
|
|
|
13538
13777
|
onClick: onCancel
|
|
13539
13778
|
},
|
|
13540
13779
|
"Cancel"
|
|
13541
|
-
), /* @__PURE__ */
|
|
13780
|
+
), /* @__PURE__ */ React36.createElement(
|
|
13542
13781
|
"button",
|
|
13543
13782
|
{
|
|
13544
13783
|
type: "button",
|
|
@@ -13736,7 +13975,7 @@ function updateChartTheme(config, newTheme) {
|
|
|
13736
13975
|
}
|
|
13737
13976
|
|
|
13738
13977
|
// src/charts/QuickChart.tsx
|
|
13739
|
-
import
|
|
13978
|
+
import React37, { useRef as useRef20 } from "react";
|
|
13740
13979
|
import {
|
|
13741
13980
|
LineChart,
|
|
13742
13981
|
Line,
|
|
@@ -13822,7 +14061,7 @@ var QuickChart = ({
|
|
|
13822
14061
|
};
|
|
13823
14062
|
switch (config.type) {
|
|
13824
14063
|
case "line":
|
|
13825
|
-
return /* @__PURE__ */
|
|
14064
|
+
return /* @__PURE__ */ React37.createElement(ResponsiveContainer, { width: "100%", height: "100%" }, /* @__PURE__ */ React37.createElement(LineChart, { ...commonProps }, /* @__PURE__ */ React37.createElement(CartesianGrid, { ...gridProps }), /* @__PURE__ */ React37.createElement(XAxis, { dataKey: "name", ...axisProps }), /* @__PURE__ */ React37.createElement(YAxis, { ...axisProps }), /* @__PURE__ */ React37.createElement(
|
|
13826
14065
|
Tooltip2,
|
|
13827
14066
|
{
|
|
13828
14067
|
contentStyle: {
|
|
@@ -13831,7 +14070,7 @@ var QuickChart = ({
|
|
|
13831
14070
|
color: theme === "dark" ? "#fff" : "#000"
|
|
13832
14071
|
}
|
|
13833
14072
|
}
|
|
13834
|
-
), /* @__PURE__ */
|
|
14073
|
+
), /* @__PURE__ */ React37.createElement(Legend, null), config.series.map((series) => /* @__PURE__ */ React37.createElement(
|
|
13835
14074
|
Line,
|
|
13836
14075
|
{
|
|
13837
14076
|
key: series.name,
|
|
@@ -13844,7 +14083,7 @@ var QuickChart = ({
|
|
|
13844
14083
|
}
|
|
13845
14084
|
))));
|
|
13846
14085
|
case "bar":
|
|
13847
|
-
return /* @__PURE__ */
|
|
14086
|
+
return /* @__PURE__ */ React37.createElement(ResponsiveContainer, { width: "100%", height: "100%" }, /* @__PURE__ */ React37.createElement(BarChart, { ...commonProps }, /* @__PURE__ */ React37.createElement(CartesianGrid, { ...gridProps }), /* @__PURE__ */ React37.createElement(XAxis, { dataKey: "name", ...axisProps }), /* @__PURE__ */ React37.createElement(YAxis, { ...axisProps }), /* @__PURE__ */ React37.createElement(
|
|
13848
14087
|
Tooltip2,
|
|
13849
14088
|
{
|
|
13850
14089
|
contentStyle: {
|
|
@@ -13853,9 +14092,9 @@ var QuickChart = ({
|
|
|
13853
14092
|
color: theme === "dark" ? "#fff" : "#000"
|
|
13854
14093
|
}
|
|
13855
14094
|
}
|
|
13856
|
-
), /* @__PURE__ */
|
|
14095
|
+
), /* @__PURE__ */ React37.createElement(Legend, null), config.series.map((series) => /* @__PURE__ */ React37.createElement(Bar, { key: series.name, dataKey: series.name, fill: series.color }))));
|
|
13857
14096
|
case "area":
|
|
13858
|
-
return /* @__PURE__ */
|
|
14097
|
+
return /* @__PURE__ */ React37.createElement(ResponsiveContainer, { width: "100%", height: "100%" }, /* @__PURE__ */ React37.createElement(AreaChart, { ...commonProps }, /* @__PURE__ */ React37.createElement(CartesianGrid, { ...gridProps }), /* @__PURE__ */ React37.createElement(XAxis, { dataKey: "name", ...axisProps }), /* @__PURE__ */ React37.createElement(YAxis, { ...axisProps }), /* @__PURE__ */ React37.createElement(
|
|
13859
14098
|
Tooltip2,
|
|
13860
14099
|
{
|
|
13861
14100
|
contentStyle: {
|
|
@@ -13864,7 +14103,7 @@ var QuickChart = ({
|
|
|
13864
14103
|
color: theme === "dark" ? "#fff" : "#000"
|
|
13865
14104
|
}
|
|
13866
14105
|
}
|
|
13867
|
-
), /* @__PURE__ */
|
|
14106
|
+
), /* @__PURE__ */ React37.createElement(Legend, null), config.series.map((series) => /* @__PURE__ */ React37.createElement(
|
|
13868
14107
|
Area,
|
|
13869
14108
|
{
|
|
13870
14109
|
key: series.name,
|
|
@@ -13876,7 +14115,7 @@ var QuickChart = ({
|
|
|
13876
14115
|
}
|
|
13877
14116
|
))));
|
|
13878
14117
|
case "pie":
|
|
13879
|
-
return /* @__PURE__ */
|
|
14118
|
+
return /* @__PURE__ */ React37.createElement(ResponsiveContainer, { width: "100%", height: "100%" }, /* @__PURE__ */ React37.createElement(PieChart, null, /* @__PURE__ */ React37.createElement(
|
|
13880
14119
|
Pie,
|
|
13881
14120
|
{
|
|
13882
14121
|
data: pieData,
|
|
@@ -13888,14 +14127,14 @@ var QuickChart = ({
|
|
|
13888
14127
|
fill: "#8884d8",
|
|
13889
14128
|
dataKey: "value"
|
|
13890
14129
|
},
|
|
13891
|
-
pieData.map((_, index) => /* @__PURE__ */
|
|
14130
|
+
pieData.map((_, index) => /* @__PURE__ */ React37.createElement(
|
|
13892
14131
|
Cell,
|
|
13893
14132
|
{
|
|
13894
14133
|
key: `cell-${index}`,
|
|
13895
14134
|
fill: DEFAULT_COLORS[index % DEFAULT_COLORS.length]
|
|
13896
14135
|
}
|
|
13897
14136
|
))
|
|
13898
|
-
), /* @__PURE__ */
|
|
14137
|
+
), /* @__PURE__ */ React37.createElement(
|
|
13899
14138
|
Tooltip2,
|
|
13900
14139
|
{
|
|
13901
14140
|
contentStyle: {
|
|
@@ -13904,19 +14143,19 @@ var QuickChart = ({
|
|
|
13904
14143
|
color: theme === "dark" ? "#fff" : "#000"
|
|
13905
14144
|
}
|
|
13906
14145
|
}
|
|
13907
|
-
), /* @__PURE__ */
|
|
14146
|
+
), /* @__PURE__ */ React37.createElement(Legend, null)));
|
|
13908
14147
|
default:
|
|
13909
|
-
return /* @__PURE__ */
|
|
14148
|
+
return /* @__PURE__ */ React37.createElement("div", null, "Unsupported chart type");
|
|
13910
14149
|
}
|
|
13911
14150
|
};
|
|
13912
|
-
return /* @__PURE__ */
|
|
14151
|
+
return /* @__PURE__ */ React37.createElement(
|
|
13913
14152
|
"div",
|
|
13914
14153
|
{
|
|
13915
14154
|
ref: chartRef,
|
|
13916
14155
|
className: `quick-chart quick-chart--${theme}`,
|
|
13917
14156
|
style: { width, height }
|
|
13918
14157
|
},
|
|
13919
|
-
/* @__PURE__ */
|
|
14158
|
+
/* @__PURE__ */ React37.createElement("div", { className: "quick-chart__header" }, /* @__PURE__ */ React37.createElement("h3", { className: "quick-chart__title" }, config.title), /* @__PURE__ */ React37.createElement("div", { className: "quick-chart__controls" }, allowTypeSwitch && onChangeType && /* @__PURE__ */ React37.createElement("div", { className: "quick-chart__type-selector" }, ["line", "bar", "area", "pie"].map((type) => /* @__PURE__ */ React37.createElement(
|
|
13920
14159
|
"button",
|
|
13921
14160
|
{
|
|
13922
14161
|
key: type,
|
|
@@ -13926,7 +14165,7 @@ var QuickChart = ({
|
|
|
13926
14165
|
"aria-label": `Switch to ${type} chart`
|
|
13927
14166
|
},
|
|
13928
14167
|
chartTypeIcon(type)
|
|
13929
|
-
))), allowThemeSwitch && onToggleTheme && /* @__PURE__ */
|
|
14168
|
+
))), allowThemeSwitch && onToggleTheme && /* @__PURE__ */ React37.createElement(
|
|
13930
14169
|
"button",
|
|
13931
14170
|
{
|
|
13932
14171
|
className: "quick-chart__btn",
|
|
@@ -13935,7 +14174,7 @@ var QuickChart = ({
|
|
|
13935
14174
|
"aria-label": "Toggle theme"
|
|
13936
14175
|
},
|
|
13937
14176
|
theme === "dark" ? "\u2600\uFE0F" : "\u{1F319}"
|
|
13938
|
-
), /* @__PURE__ */
|
|
14177
|
+
), /* @__PURE__ */ React37.createElement(
|
|
13939
14178
|
"button",
|
|
13940
14179
|
{
|
|
13941
14180
|
className: "quick-chart__btn",
|
|
@@ -13944,7 +14183,7 @@ var QuickChart = ({
|
|
|
13944
14183
|
"aria-label": "Export chart as PNG"
|
|
13945
14184
|
},
|
|
13946
14185
|
"\u{1F4E5}"
|
|
13947
|
-
), onClose && /* @__PURE__ */
|
|
14186
|
+
), onClose && /* @__PURE__ */ React37.createElement(
|
|
13948
14187
|
"button",
|
|
13949
14188
|
{
|
|
13950
14189
|
className: "quick-chart__btn quick-chart__close",
|
|
@@ -13954,12 +14193,12 @@ var QuickChart = ({
|
|
|
13954
14193
|
},
|
|
13955
14194
|
"\xD7"
|
|
13956
14195
|
))),
|
|
13957
|
-
/* @__PURE__ */
|
|
14196
|
+
/* @__PURE__ */ React37.createElement("div", { className: "quick-chart__body" }, renderChart())
|
|
13958
14197
|
);
|
|
13959
14198
|
};
|
|
13960
14199
|
|
|
13961
14200
|
// src/charts/ChartOverlay.tsx
|
|
13962
|
-
import
|
|
14201
|
+
import React38, { useEffect as useEffect17, useRef as useRef21, useState as useState26 } from "react";
|
|
13963
14202
|
var ChartOverlay = ({
|
|
13964
14203
|
config,
|
|
13965
14204
|
onClose,
|
|
@@ -14050,7 +14289,7 @@ var ChartOverlay = ({
|
|
|
14050
14289
|
document.addEventListener("keydown", handleKeyDown);
|
|
14051
14290
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
14052
14291
|
}, [onClose]);
|
|
14053
|
-
return /* @__PURE__ */
|
|
14292
|
+
return /* @__PURE__ */ React38.createElement("div", { className: "chart-overlay" }, /* @__PURE__ */ React38.createElement("div", { className: "chart-overlay__backdrop", onClick: onClose }), /* @__PURE__ */ React38.createElement(
|
|
14054
14293
|
"div",
|
|
14055
14294
|
{
|
|
14056
14295
|
ref: overlayRef,
|
|
@@ -14063,7 +14302,7 @@ var ChartOverlay = ({
|
|
|
14063
14302
|
},
|
|
14064
14303
|
onMouseDown: handleMouseDown
|
|
14065
14304
|
},
|
|
14066
|
-
/* @__PURE__ */
|
|
14305
|
+
/* @__PURE__ */ React38.createElement(
|
|
14067
14306
|
QuickChart,
|
|
14068
14307
|
{
|
|
14069
14308
|
config,
|