react-open-source-grid 1.7.16 → 1.7.18
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-DY5UPTqS.js} +272 -133
- package/dist/assets/index.js +1 -1
- package/dist/assets/{layoutPersistence-DKb0Rxme.js → layoutPersistence-kMUHjw0E.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 +37 -0
- package/dist/lib/components/MasterDetailDemo.d.ts +2 -0
- package/dist/lib/index.cjs +933 -693
- package/dist/lib/index.css +103 -0
- package/dist/lib/index.js +680 -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,10 +8537,12 @@ 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",
|
|
8320
8544
|
showDensityToggle = false,
|
|
8545
|
+
hideToolbar = false,
|
|
8321
8546
|
onDensityChange,
|
|
8322
8547
|
onRowClick,
|
|
8323
8548
|
onCellEdit,
|
|
@@ -8355,7 +8580,7 @@ var DataGrid = forwardRef(({
|
|
|
8355
8580
|
renderCell: col.isTotalColumn || col.isPivotColumn ? (row) => {
|
|
8356
8581
|
const value = row[col.field];
|
|
8357
8582
|
if (typeof value === "number") {
|
|
8358
|
-
return /* @__PURE__ */
|
|
8583
|
+
return /* @__PURE__ */ React22.createElement("span", { style: {
|
|
8359
8584
|
fontWeight: col.isTotalColumn ? "700" : "600",
|
|
8360
8585
|
color: col.isTotalColumn ? "#0f766e" : "#475569"
|
|
8361
8586
|
} }, value.toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 }));
|
|
@@ -8390,6 +8615,15 @@ var DataGrid = forwardRef(({
|
|
|
8390
8615
|
setDensityMode(_densityMode);
|
|
8391
8616
|
}
|
|
8392
8617
|
}, [_densityMode, densityMode, setDensityMode]);
|
|
8618
|
+
useEffect9(() => {
|
|
8619
|
+
if ((masterDetailConfig == null ? void 0 : masterDetailConfig.enabled) && masterDetailConfig.defaultExpandedMasterRowKeys) {
|
|
8620
|
+
const expandedRows = {};
|
|
8621
|
+
masterDetailConfig.defaultExpandedMasterRowKeys.forEach((key) => {
|
|
8622
|
+
expandedRows[String(key)] = true;
|
|
8623
|
+
});
|
|
8624
|
+
dispatch({ type: "SET_EXPANDED_MASTER_ROWS", payload: expandedRows });
|
|
8625
|
+
}
|
|
8626
|
+
}, [masterDetailConfig == null ? void 0 : masterDetailConfig.enabled, masterDetailConfig == null ? void 0 : masterDetailConfig.defaultExpandedMasterRowKeys]);
|
|
8393
8627
|
const themeStyles = useMemo4(() => {
|
|
8394
8628
|
const currentTheme = getTheme(_theme);
|
|
8395
8629
|
return generateThemeCSS(currentTheme);
|
|
@@ -8749,7 +8983,7 @@ var DataGrid = forwardRef(({
|
|
|
8749
8983
|
},
|
|
8750
8984
|
[onCellEdit, paginatedRows, rows]
|
|
8751
8985
|
);
|
|
8752
|
-
return /* @__PURE__ */
|
|
8986
|
+
return /* @__PURE__ */ React22.createElement(
|
|
8753
8987
|
"div",
|
|
8754
8988
|
{
|
|
8755
8989
|
ref: containerRef,
|
|
@@ -8770,8 +9004,8 @@ var DataGrid = forwardRef(({
|
|
|
8770
9004
|
},
|
|
8771
9005
|
className: `data-grid density-${densityMode}`
|
|
8772
9006
|
},
|
|
8773
|
-
/* @__PURE__ */
|
|
8774
|
-
/* @__PURE__ */
|
|
9007
|
+
/* @__PURE__ */ React22.createElement(ScreenReaderAnnouncer, { message: announcementMessage, priority: "polite" }),
|
|
9008
|
+
!hideToolbar && /* @__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
9009
|
ColumnChooser,
|
|
8776
9010
|
{
|
|
8777
9011
|
columns: effectiveColumns,
|
|
@@ -8781,7 +9015,7 @@ var DataGrid = forwardRef(({
|
|
|
8781
9015
|
onReorderColumns: (fromIndex, toIndex) => dispatch({ type: "REORDER_COLUMNS", payload: { fromIndex, toIndex } }),
|
|
8782
9016
|
onResetLayout: () => dispatch({ type: "RESET_COLUMN_LAYOUT" })
|
|
8783
9017
|
}
|
|
8784
|
-
), /* @__PURE__ */
|
|
9018
|
+
), /* @__PURE__ */ React22.createElement(
|
|
8785
9019
|
ExportMenu,
|
|
8786
9020
|
{
|
|
8787
9021
|
columns: effectiveColumns,
|
|
@@ -8790,7 +9024,7 @@ var DataGrid = forwardRef(({
|
|
|
8790
9024
|
selectedRows: state.selection.selectedRows,
|
|
8791
9025
|
currentPageData: paginatedRows.filter((r) => !("isGroup" in r))
|
|
8792
9026
|
}
|
|
8793
|
-
), (persistenceConfig == null ? void 0 : persistenceConfig.enabled) && persistenceManager && /* @__PURE__ */
|
|
9027
|
+
), (persistenceConfig == null ? void 0 : persistenceConfig.enabled) && persistenceManager && /* @__PURE__ */ React22.createElement(
|
|
8794
9028
|
LayoutPresetsManager,
|
|
8795
9029
|
{
|
|
8796
9030
|
manager: persistenceManager,
|
|
@@ -8798,8 +9032,8 @@ var DataGrid = forwardRef(({
|
|
|
8798
9032
|
onLoadPreset: (layout) => dispatch({ type: "LOAD_LAYOUT_PRESET", payload: layout }),
|
|
8799
9033
|
onResetLayout: () => dispatch({ type: "RESET_COLUMN_LAYOUT" })
|
|
8800
9034
|
}
|
|
8801
|
-
)), showDensityToggle && /* @__PURE__ */
|
|
8802
|
-
/* @__PURE__ */
|
|
9035
|
+
)), 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 }))),
|
|
9036
|
+
!hideToolbar && /* @__PURE__ */ React22.createElement(
|
|
8803
9037
|
GroupByPanel,
|
|
8804
9038
|
{
|
|
8805
9039
|
columns: effectiveColumns,
|
|
@@ -8807,7 +9041,7 @@ var DataGrid = forwardRef(({
|
|
|
8807
9041
|
dispatch
|
|
8808
9042
|
}
|
|
8809
9043
|
),
|
|
8810
|
-
/* @__PURE__ */
|
|
9044
|
+
/* @__PURE__ */ React22.createElement("div", { role: "rowgroup", style: { position: "sticky", top: 0, zIndex: 20, width: "100%" } }, /* @__PURE__ */ React22.createElement(
|
|
8811
9045
|
GridHeader,
|
|
8812
9046
|
{
|
|
8813
9047
|
columns: effectiveColumns,
|
|
@@ -8819,6 +9053,8 @@ var DataGrid = forwardRef(({
|
|
|
8819
9053
|
pinnedLeft: pinnedLeftFields,
|
|
8820
9054
|
pinnedRight: pinnedRightFields,
|
|
8821
9055
|
showColumnPinning,
|
|
9056
|
+
masterDetailConfig,
|
|
9057
|
+
dragRowConfig,
|
|
8822
9058
|
onContextMenu: (event, column, columnIndex) => handleContextMenu({
|
|
8823
9059
|
type: "header",
|
|
8824
9060
|
column,
|
|
@@ -8826,7 +9062,7 @@ var DataGrid = forwardRef(({
|
|
|
8826
9062
|
event
|
|
8827
9063
|
})
|
|
8828
9064
|
}
|
|
8829
|
-
), /* @__PURE__ */
|
|
9065
|
+
), !hideToolbar && /* @__PURE__ */ React22.createElement(
|
|
8830
9066
|
ColumnFilters,
|
|
8831
9067
|
{
|
|
8832
9068
|
columns: effectiveColumns,
|
|
@@ -8836,10 +9072,12 @@ var DataGrid = forwardRef(({
|
|
|
8836
9072
|
dispatch,
|
|
8837
9073
|
pinnedLeft: pinnedLeftFields,
|
|
8838
9074
|
pinnedRight: pinnedRightFields,
|
|
8839
|
-
rows: filteredRows
|
|
9075
|
+
rows: filteredRows,
|
|
9076
|
+
masterDetailConfig,
|
|
9077
|
+
dragRowConfig
|
|
8840
9078
|
}
|
|
8841
9079
|
)),
|
|
8842
|
-
/* @__PURE__ */
|
|
9080
|
+
/* @__PURE__ */ React22.createElement(
|
|
8843
9081
|
GridBody,
|
|
8844
9082
|
{
|
|
8845
9083
|
columns: effectiveColumns,
|
|
@@ -8863,6 +9101,8 @@ var DataGrid = forwardRef(({
|
|
|
8863
9101
|
virtualScrollConfig,
|
|
8864
9102
|
treeConfig,
|
|
8865
9103
|
dragRowConfig,
|
|
9104
|
+
masterDetailConfig,
|
|
9105
|
+
expandedMasterRows: state.detailRowState.expandedMasterRows,
|
|
8866
9106
|
tableId,
|
|
8867
9107
|
onRowReorder,
|
|
8868
9108
|
currentPage: state.currentPage,
|
|
@@ -8879,7 +9119,7 @@ var DataGrid = forwardRef(({
|
|
|
8879
9119
|
...tooltipHandlers
|
|
8880
9120
|
}
|
|
8881
9121
|
),
|
|
8882
|
-
(footerConfig == null ? void 0 : footerConfig.show) && footerConfig.aggregates && /* @__PURE__ */
|
|
9122
|
+
(footerConfig == null ? void 0 : footerConfig.show) && footerConfig.aggregates && /* @__PURE__ */ React22.createElement(
|
|
8883
9123
|
GridFooter,
|
|
8884
9124
|
{
|
|
8885
9125
|
columns: effectiveColumns,
|
|
@@ -8891,7 +9131,7 @@ var DataGrid = forwardRef(({
|
|
|
8891
9131
|
pinnedRight: pinnedRightFields
|
|
8892
9132
|
}
|
|
8893
9133
|
),
|
|
8894
|
-
!(virtualScrollConfig == null ? void 0 : virtualScrollConfig.enabled) && /* @__PURE__ */
|
|
9134
|
+
!(virtualScrollConfig == null ? void 0 : virtualScrollConfig.enabled) && /* @__PURE__ */ React22.createElement(
|
|
8895
9135
|
GridPagination,
|
|
8896
9136
|
{
|
|
8897
9137
|
currentPage: state.currentPage,
|
|
@@ -8900,7 +9140,7 @@ var DataGrid = forwardRef(({
|
|
|
8900
9140
|
dispatch
|
|
8901
9141
|
}
|
|
8902
9142
|
),
|
|
8903
|
-
contextMenu.isOpen && /* @__PURE__ */
|
|
9143
|
+
contextMenu.isOpen && /* @__PURE__ */ React22.createElement(
|
|
8904
9144
|
ContextMenu,
|
|
8905
9145
|
{
|
|
8906
9146
|
x: contextMenu.x,
|
|
@@ -8909,7 +9149,7 @@ var DataGrid = forwardRef(({
|
|
|
8909
9149
|
onClose: closeContextMenu
|
|
8910
9150
|
}
|
|
8911
9151
|
),
|
|
8912
|
-
(tooltipConfig == null ? void 0 : tooltipConfig.enabled) && /* @__PURE__ */
|
|
9152
|
+
(tooltipConfig == null ? void 0 : tooltipConfig.enabled) && /* @__PURE__ */ React22.createElement(
|
|
8913
9153
|
Tooltip,
|
|
8914
9154
|
{
|
|
8915
9155
|
state: tooltipState,
|
|
@@ -8922,12 +9162,12 @@ var DataGrid = forwardRef(({
|
|
|
8922
9162
|
DataGrid.displayName = "DataGrid";
|
|
8923
9163
|
|
|
8924
9164
|
// 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__ */
|
|
9165
|
+
import React23, { useState as useState15, useMemo as useMemo5 } from "react";
|
|
9166
|
+
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" }));
|
|
9167
|
+
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" }));
|
|
9168
|
+
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" }));
|
|
9169
|
+
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" }));
|
|
9170
|
+
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
9171
|
var extractFacetValues = (rows, field, filterConfig, currentField) => {
|
|
8932
9172
|
const valueCounts = /* @__PURE__ */ new Map();
|
|
8933
9173
|
const filteredRows = rows.filter((row) => {
|
|
@@ -9055,7 +9295,7 @@ var FacetedSearch = ({
|
|
|
9055
9295
|
return false;
|
|
9056
9296
|
}).length;
|
|
9057
9297
|
}, [filterConfig]);
|
|
9058
|
-
return /* @__PURE__ */
|
|
9298
|
+
return /* @__PURE__ */ React23.createElement(
|
|
9059
9299
|
"div",
|
|
9060
9300
|
{
|
|
9061
9301
|
className: `faceted-search ${className || ""}`,
|
|
@@ -9067,7 +9307,7 @@ var FacetedSearch = ({
|
|
|
9067
9307
|
height: "100%"
|
|
9068
9308
|
}
|
|
9069
9309
|
},
|
|
9070
|
-
/* @__PURE__ */
|
|
9310
|
+
/* @__PURE__ */ React23.createElement("div", { style: {
|
|
9071
9311
|
position: "sticky",
|
|
9072
9312
|
top: 0,
|
|
9073
9313
|
zIndex: 10,
|
|
@@ -9075,28 +9315,28 @@ var FacetedSearch = ({
|
|
|
9075
9315
|
borderBottom: "1px solid #e5e7eb",
|
|
9076
9316
|
padding: "16px",
|
|
9077
9317
|
flexShrink: 0
|
|
9078
|
-
} }, /* @__PURE__ */
|
|
9318
|
+
} }, /* @__PURE__ */ React23.createElement("div", { style: {
|
|
9079
9319
|
display: "flex",
|
|
9080
9320
|
alignItems: "center",
|
|
9081
9321
|
justifyContent: "space-between",
|
|
9082
9322
|
marginBottom: "8px"
|
|
9083
|
-
} }, /* @__PURE__ */
|
|
9323
|
+
} }, /* @__PURE__ */ React23.createElement("div", { style: {
|
|
9084
9324
|
display: "flex",
|
|
9085
9325
|
alignItems: "center",
|
|
9086
9326
|
gap: "8px"
|
|
9087
|
-
} }, /* @__PURE__ */
|
|
9327
|
+
} }, /* @__PURE__ */ React23.createElement(FilterIcon, null), /* @__PURE__ */ React23.createElement("h3", { style: {
|
|
9088
9328
|
fontSize: "18px",
|
|
9089
9329
|
fontWeight: 600,
|
|
9090
9330
|
color: "#111827",
|
|
9091
9331
|
margin: 0
|
|
9092
|
-
} }, "Filters"), activeFilterCount > 0 && /* @__PURE__ */
|
|
9332
|
+
} }, "Filters"), activeFilterCount > 0 && /* @__PURE__ */ React23.createElement("span", { style: {
|
|
9093
9333
|
padding: "2px 8px",
|
|
9094
9334
|
fontSize: "12px",
|
|
9095
9335
|
fontWeight: 500,
|
|
9096
9336
|
backgroundColor: "#dbeafe",
|
|
9097
9337
|
color: "#1e40af",
|
|
9098
9338
|
borderRadius: "9999px"
|
|
9099
|
-
} }, activeFilterCount)), activeFilterCount > 0 && onClearAll && /* @__PURE__ */
|
|
9339
|
+
} }, activeFilterCount)), activeFilterCount > 0 && onClearAll && /* @__PURE__ */ React23.createElement(
|
|
9100
9340
|
"button",
|
|
9101
9341
|
{
|
|
9102
9342
|
onClick: onClearAll,
|
|
@@ -9114,7 +9354,7 @@ var FacetedSearch = ({
|
|
|
9114
9354
|
},
|
|
9115
9355
|
"Clear All"
|
|
9116
9356
|
))),
|
|
9117
|
-
/* @__PURE__ */
|
|
9357
|
+
/* @__PURE__ */ React23.createElement("div", { style: {
|
|
9118
9358
|
overflowY: "auto",
|
|
9119
9359
|
flex: 1
|
|
9120
9360
|
} }, facetGroups.map((group) => {
|
|
@@ -9126,16 +9366,16 @@ var FacetedSearch = ({
|
|
|
9126
9366
|
const displayedValues = group.showAll ? filteredValues : filteredValues.slice(0, maxItems);
|
|
9127
9367
|
const hasMore = filteredValues.length > maxItems;
|
|
9128
9368
|
const selectedCount = group.values.filter((v) => v.selected).length;
|
|
9129
|
-
return /* @__PURE__ */
|
|
9369
|
+
return /* @__PURE__ */ React23.createElement("div", { key: group.field, style: {
|
|
9130
9370
|
borderBottom: "1px solid #e5e7eb"
|
|
9131
|
-
} }, /* @__PURE__ */
|
|
9371
|
+
} }, /* @__PURE__ */ React23.createElement("div", { style: {
|
|
9132
9372
|
padding: "16px",
|
|
9133
9373
|
backgroundColor: "#f9fafb"
|
|
9134
|
-
} }, /* @__PURE__ */
|
|
9374
|
+
} }, /* @__PURE__ */ React23.createElement("div", { style: {
|
|
9135
9375
|
display: "flex",
|
|
9136
9376
|
alignItems: "center",
|
|
9137
9377
|
justifyContent: "space-between"
|
|
9138
|
-
} }, /* @__PURE__ */
|
|
9378
|
+
} }, /* @__PURE__ */ React23.createElement(
|
|
9139
9379
|
"button",
|
|
9140
9380
|
{
|
|
9141
9381
|
onClick: () => updateFacetState(group.field, { expanded: !group.expanded }),
|
|
@@ -9155,9 +9395,9 @@ var FacetedSearch = ({
|
|
|
9155
9395
|
onMouseOver: (e) => collapsible && (e.currentTarget.style.color = "#374151"),
|
|
9156
9396
|
onMouseOut: (e) => collapsible && (e.currentTarget.style.color = "#111827")
|
|
9157
9397
|
},
|
|
9158
|
-
collapsible && (group.expanded ? /* @__PURE__ */
|
|
9159
|
-
/* @__PURE__ */
|
|
9160
|
-
selectedCount > 0 && /* @__PURE__ */
|
|
9398
|
+
collapsible && (group.expanded ? /* @__PURE__ */ React23.createElement(ChevronDownIcon, null) : /* @__PURE__ */ React23.createElement(ChevronRightIcon, null)),
|
|
9399
|
+
/* @__PURE__ */ React23.createElement("span", null, group.label),
|
|
9400
|
+
selectedCount > 0 && /* @__PURE__ */ React23.createElement("span", { style: {
|
|
9161
9401
|
padding: "2px 8px",
|
|
9162
9402
|
fontSize: "12px",
|
|
9163
9403
|
fontWeight: 500,
|
|
@@ -9165,7 +9405,7 @@ var FacetedSearch = ({
|
|
|
9165
9405
|
color: "#1e40af",
|
|
9166
9406
|
borderRadius: "9999px"
|
|
9167
9407
|
} }, selectedCount)
|
|
9168
|
-
), selectedCount > 0 && /* @__PURE__ */
|
|
9408
|
+
), selectedCount > 0 && /* @__PURE__ */ React23.createElement(
|
|
9169
9409
|
"button",
|
|
9170
9410
|
{
|
|
9171
9411
|
onClick: () => clearFacet(group.field),
|
|
@@ -9182,16 +9422,16 @@ var FacetedSearch = ({
|
|
|
9182
9422
|
onMouseOver: (e) => e.currentTarget.style.color = "#374151",
|
|
9183
9423
|
onMouseOut: (e) => e.currentTarget.style.color = "#6b7280"
|
|
9184
9424
|
},
|
|
9185
|
-
/* @__PURE__ */
|
|
9186
|
-
)), showSearch && group.expanded && group.values.length > 5 && /* @__PURE__ */
|
|
9425
|
+
/* @__PURE__ */ React23.createElement(XIcon, null)
|
|
9426
|
+
)), showSearch && group.expanded && group.values.length > 5 && /* @__PURE__ */ React23.createElement("div", { style: {
|
|
9187
9427
|
marginTop: "8px",
|
|
9188
9428
|
position: "relative"
|
|
9189
|
-
} }, /* @__PURE__ */
|
|
9429
|
+
} }, /* @__PURE__ */ React23.createElement("div", { style: {
|
|
9190
9430
|
position: "absolute",
|
|
9191
9431
|
left: "8px",
|
|
9192
9432
|
top: "8px",
|
|
9193
9433
|
color: "#9ca3af"
|
|
9194
|
-
} }, /* @__PURE__ */
|
|
9434
|
+
} }, /* @__PURE__ */ React23.createElement(SearchIcon, null)), /* @__PURE__ */ React23.createElement(
|
|
9195
9435
|
"input",
|
|
9196
9436
|
{
|
|
9197
9437
|
type: "text",
|
|
@@ -9212,16 +9452,16 @@ var FacetedSearch = ({
|
|
|
9212
9452
|
onFocus: (e) => e.currentTarget.style.boxShadow = "0 0 0 2px #3b82f6",
|
|
9213
9453
|
onBlur: (e) => e.currentTarget.style.boxShadow = "none"
|
|
9214
9454
|
}
|
|
9215
|
-
))), group.expanded && /* @__PURE__ */
|
|
9455
|
+
))), group.expanded && /* @__PURE__ */ React23.createElement("div", { style: {
|
|
9216
9456
|
padding: "16px",
|
|
9217
9457
|
display: "flex",
|
|
9218
9458
|
flexDirection: "column",
|
|
9219
9459
|
gap: "4px"
|
|
9220
|
-
} }, displayedValues.length === 0 ? /* @__PURE__ */
|
|
9460
|
+
} }, displayedValues.length === 0 ? /* @__PURE__ */ React23.createElement("div", { style: {
|
|
9221
9461
|
fontSize: "14px",
|
|
9222
9462
|
color: "#6b7280",
|
|
9223
9463
|
fontStyle: "italic"
|
|
9224
|
-
} }, "No values found") : /* @__PURE__ */
|
|
9464
|
+
} }, "No values found") : /* @__PURE__ */ React23.createElement(React23.Fragment, null, filteredValues.length > 1 && selectedCount < filteredValues.length && /* @__PURE__ */ React23.createElement(
|
|
9225
9465
|
"button",
|
|
9226
9466
|
{
|
|
9227
9467
|
onClick: () => selectAll(group.field, filteredValues.map((v) => v.value)),
|
|
@@ -9242,7 +9482,7 @@ var FacetedSearch = ({
|
|
|
9242
9482
|
"Select All (",
|
|
9243
9483
|
filteredValues.length,
|
|
9244
9484
|
")"
|
|
9245
|
-
), displayedValues.map((facetValue, idx) => /* @__PURE__ */
|
|
9485
|
+
), displayedValues.map((facetValue, idx) => /* @__PURE__ */ React23.createElement(
|
|
9246
9486
|
"label",
|
|
9247
9487
|
{
|
|
9248
9488
|
key: `${facetValue.value}-${idx}`,
|
|
@@ -9260,13 +9500,13 @@ var FacetedSearch = ({
|
|
|
9260
9500
|
onMouseOver: (e) => e.currentTarget.style.backgroundColor = "#f9fafb",
|
|
9261
9501
|
onMouseOut: (e) => e.currentTarget.style.backgroundColor = "transparent"
|
|
9262
9502
|
},
|
|
9263
|
-
/* @__PURE__ */
|
|
9503
|
+
/* @__PURE__ */ React23.createElement("div", { style: {
|
|
9264
9504
|
display: "flex",
|
|
9265
9505
|
alignItems: "center",
|
|
9266
9506
|
gap: "8px",
|
|
9267
9507
|
flex: 1,
|
|
9268
9508
|
minWidth: 0
|
|
9269
|
-
} }, /* @__PURE__ */
|
|
9509
|
+
} }, /* @__PURE__ */ React23.createElement(
|
|
9270
9510
|
"input",
|
|
9271
9511
|
{
|
|
9272
9512
|
type: "checkbox",
|
|
@@ -9279,7 +9519,7 @@ var FacetedSearch = ({
|
|
|
9279
9519
|
accentColor: "#2563eb"
|
|
9280
9520
|
}
|
|
9281
9521
|
}
|
|
9282
|
-
), /* @__PURE__ */
|
|
9522
|
+
), /* @__PURE__ */ React23.createElement("span", { style: {
|
|
9283
9523
|
fontSize: "14px",
|
|
9284
9524
|
color: "#374151",
|
|
9285
9525
|
overflow: "hidden",
|
|
@@ -9287,14 +9527,14 @@ var FacetedSearch = ({
|
|
|
9287
9527
|
whiteSpace: "nowrap",
|
|
9288
9528
|
flex: 1
|
|
9289
9529
|
} }, facetValue.label)),
|
|
9290
|
-
/* @__PURE__ */
|
|
9530
|
+
/* @__PURE__ */ React23.createElement("span", { style: {
|
|
9291
9531
|
fontSize: "12px",
|
|
9292
9532
|
color: "#6b7280",
|
|
9293
9533
|
fontWeight: 500,
|
|
9294
9534
|
marginLeft: "8px",
|
|
9295
9535
|
flexShrink: 0
|
|
9296
9536
|
} }, facetValue.count)
|
|
9297
|
-
)), hasMore && !group.searchTerm && /* @__PURE__ */
|
|
9537
|
+
)), hasMore && !group.searchTerm && /* @__PURE__ */ React23.createElement(
|
|
9298
9538
|
"button",
|
|
9299
9539
|
{
|
|
9300
9540
|
onClick: () => updateFacetState(group.field, { showAll: !group.showAll }),
|
|
@@ -9315,16 +9555,16 @@ var FacetedSearch = ({
|
|
|
9315
9555
|
},
|
|
9316
9556
|
group.showAll ? "Show Less" : `Show More (${filteredValues.length - maxItems} more)`
|
|
9317
9557
|
))));
|
|
9318
|
-
}), facetGroups.length === 0 && /* @__PURE__ */
|
|
9558
|
+
}), facetGroups.length === 0 && /* @__PURE__ */ React23.createElement("div", { style: {
|
|
9319
9559
|
padding: "32px",
|
|
9320
9560
|
textAlign: "center",
|
|
9321
9561
|
color: "#6b7280"
|
|
9322
|
-
} }, /* @__PURE__ */
|
|
9562
|
+
} }, /* @__PURE__ */ React23.createElement("div", { style: {
|
|
9323
9563
|
width: "48px",
|
|
9324
9564
|
height: "48px",
|
|
9325
9565
|
margin: "0 auto 12px",
|
|
9326
9566
|
color: "#9ca3af"
|
|
9327
|
-
} }, /* @__PURE__ */
|
|
9567
|
+
} }, /* @__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
9568
|
fontSize: "14px",
|
|
9329
9569
|
margin: 0
|
|
9330
9570
|
} }, "No facets configured")))
|
|
@@ -9332,7 +9572,7 @@ var FacetedSearch = ({
|
|
|
9332
9572
|
};
|
|
9333
9573
|
|
|
9334
9574
|
// src/components/DataGrid/FilteredSearchBar.tsx
|
|
9335
|
-
import
|
|
9575
|
+
import React24, { useState as useState16, useRef as useRef11, useEffect as useEffect10 } from "react";
|
|
9336
9576
|
|
|
9337
9577
|
// node_modules/uuid/dist/esm-node/rng.js
|
|
9338
9578
|
import crypto from "crypto";
|
|
@@ -9398,7 +9638,7 @@ var FilteredSearchBar = ({
|
|
|
9398
9638
|
const [inputValue, setInputValue] = useState16("");
|
|
9399
9639
|
const [showDropdown, setShowDropdown] = useState16(false);
|
|
9400
9640
|
const [selectedFilterField, setSelectedFilterField] = useState16(null);
|
|
9401
|
-
const filteredOptions =
|
|
9641
|
+
const filteredOptions = React24.useMemo(() => {
|
|
9402
9642
|
var _a2;
|
|
9403
9643
|
if (!selectedFilterField) {
|
|
9404
9644
|
return filters.filter(
|
|
@@ -9505,7 +9745,7 @@ var FilteredSearchBar = ({
|
|
|
9505
9745
|
document.addEventListener("mousedown", handleClickOutside);
|
|
9506
9746
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
9507
9747
|
}, []);
|
|
9508
|
-
return /* @__PURE__ */
|
|
9748
|
+
return /* @__PURE__ */ React24.createElement("div", { style: { position: "relative", width: "100%" } }, /* @__PURE__ */ React24.createElement(
|
|
9509
9749
|
"div",
|
|
9510
9750
|
{
|
|
9511
9751
|
style: {
|
|
@@ -9527,7 +9767,7 @@ var FilteredSearchBar = ({
|
|
|
9527
9767
|
return (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
9528
9768
|
}
|
|
9529
9769
|
},
|
|
9530
|
-
tokens.map((token) => /* @__PURE__ */
|
|
9770
|
+
tokens.map((token) => /* @__PURE__ */ React24.createElement(
|
|
9531
9771
|
"div",
|
|
9532
9772
|
{
|
|
9533
9773
|
key: token.id,
|
|
@@ -9543,9 +9783,9 @@ var FilteredSearchBar = ({
|
|
|
9543
9783
|
fontWeight: "500"
|
|
9544
9784
|
}
|
|
9545
9785
|
},
|
|
9546
|
-
/* @__PURE__ */
|
|
9547
|
-
/* @__PURE__ */
|
|
9548
|
-
/* @__PURE__ */
|
|
9786
|
+
/* @__PURE__ */ React24.createElement("span", { style: { fontWeight: "600" } }, token.label, ":"),
|
|
9787
|
+
/* @__PURE__ */ React24.createElement("span", null, Array.isArray(token.value) ? token.value.join(", ") : token.value),
|
|
9788
|
+
/* @__PURE__ */ React24.createElement(
|
|
9549
9789
|
"button",
|
|
9550
9790
|
{
|
|
9551
9791
|
onClick: (e) => {
|
|
@@ -9568,7 +9808,7 @@ var FilteredSearchBar = ({
|
|
|
9568
9808
|
"\xD7"
|
|
9569
9809
|
)
|
|
9570
9810
|
)),
|
|
9571
|
-
/* @__PURE__ */
|
|
9811
|
+
/* @__PURE__ */ React24.createElement(
|
|
9572
9812
|
"input",
|
|
9573
9813
|
{
|
|
9574
9814
|
ref: inputRef,
|
|
@@ -9590,7 +9830,7 @@ var FilteredSearchBar = ({
|
|
|
9590
9830
|
disabled: tokens.length >= maxTokens
|
|
9591
9831
|
}
|
|
9592
9832
|
)
|
|
9593
|
-
), showDropdown && /* @__PURE__ */
|
|
9833
|
+
), showDropdown && /* @__PURE__ */ React24.createElement(
|
|
9594
9834
|
"div",
|
|
9595
9835
|
{
|
|
9596
9836
|
ref: dropdownRef,
|
|
@@ -9611,7 +9851,7 @@ var FilteredSearchBar = ({
|
|
|
9611
9851
|
},
|
|
9612
9852
|
selectedFilterField ? (
|
|
9613
9853
|
// Show values for selected filter
|
|
9614
|
-
/* @__PURE__ */
|
|
9854
|
+
/* @__PURE__ */ React24.createElement("div", null, /* @__PURE__ */ React24.createElement(
|
|
9615
9855
|
"div",
|
|
9616
9856
|
{
|
|
9617
9857
|
style: {
|
|
@@ -9625,7 +9865,7 @@ var FilteredSearchBar = ({
|
|
|
9625
9865
|
gap: "8px"
|
|
9626
9866
|
}
|
|
9627
9867
|
},
|
|
9628
|
-
/* @__PURE__ */
|
|
9868
|
+
/* @__PURE__ */ React24.createElement(
|
|
9629
9869
|
"button",
|
|
9630
9870
|
{
|
|
9631
9871
|
onClick: () => {
|
|
@@ -9644,7 +9884,7 @@ var FilteredSearchBar = ({
|
|
|
9644
9884
|
"\u2190"
|
|
9645
9885
|
),
|
|
9646
9886
|
(_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__ */
|
|
9887
|
+
), (_c = (_b = filteredOptions[0]) == null ? void 0 : _b.options) == null ? void 0 : _c.map((option, index) => /* @__PURE__ */ React24.createElement(
|
|
9648
9888
|
"div",
|
|
9649
9889
|
{
|
|
9650
9890
|
key: option,
|
|
@@ -9662,7 +9902,7 @@ var FilteredSearchBar = ({
|
|
|
9662
9902
|
)))
|
|
9663
9903
|
) : (
|
|
9664
9904
|
// Show filter options
|
|
9665
|
-
/* @__PURE__ */
|
|
9905
|
+
/* @__PURE__ */ React24.createElement("div", null, /* @__PURE__ */ React24.createElement(
|
|
9666
9906
|
"div",
|
|
9667
9907
|
{
|
|
9668
9908
|
style: {
|
|
@@ -9674,7 +9914,7 @@ var FilteredSearchBar = ({
|
|
|
9674
9914
|
}
|
|
9675
9915
|
},
|
|
9676
9916
|
"Filter by"
|
|
9677
|
-
), filteredOptions.map((filter, index) => /* @__PURE__ */
|
|
9917
|
+
), filteredOptions.map((filter, index) => /* @__PURE__ */ React24.createElement(
|
|
9678
9918
|
"div",
|
|
9679
9919
|
{
|
|
9680
9920
|
key: filter.field,
|
|
@@ -9691,7 +9931,7 @@ var FilteredSearchBar = ({
|
|
|
9691
9931
|
},
|
|
9692
9932
|
onMouseEnter: () => setHighlightedIndex(index)
|
|
9693
9933
|
},
|
|
9694
|
-
/* @__PURE__ */
|
|
9934
|
+
/* @__PURE__ */ React24.createElement(
|
|
9695
9935
|
"div",
|
|
9696
9936
|
{
|
|
9697
9937
|
style: {
|
|
@@ -9702,15 +9942,15 @@ var FilteredSearchBar = ({
|
|
|
9702
9942
|
}
|
|
9703
9943
|
}
|
|
9704
9944
|
),
|
|
9705
|
-
/* @__PURE__ */
|
|
9706
|
-
/* @__PURE__ */
|
|
9945
|
+
/* @__PURE__ */ React24.createElement("span", { style: { fontWeight: "500" } }, filter.label),
|
|
9946
|
+
/* @__PURE__ */ React24.createElement("span", { style: { marginLeft: "auto", fontSize: "12px", color: "#94a3b8" } }, filter.type)
|
|
9707
9947
|
)))
|
|
9708
9948
|
)
|
|
9709
9949
|
));
|
|
9710
9950
|
};
|
|
9711
9951
|
|
|
9712
9952
|
// src/components/DataGrid/InfiniteScrollDataGrid.tsx
|
|
9713
|
-
import
|
|
9953
|
+
import React25, { useReducer as useReducer2, useMemo as useMemo6, useEffect as useEffect11, useCallback as useCallback8, useState as useState17, useLayoutEffect as useLayoutEffect2 } from "react";
|
|
9714
9954
|
|
|
9715
9955
|
// src/components/DataGrid/ServerSideDataSource.ts
|
|
9716
9956
|
var BlockStatus = {
|
|
@@ -10198,14 +10438,14 @@ var InfiniteScrollDataGrid = ({
|
|
|
10198
10438
|
[onCellEdit, state.currentPage, pageSize]
|
|
10199
10439
|
);
|
|
10200
10440
|
if (!dataSourceInstance) {
|
|
10201
|
-
return /* @__PURE__ */
|
|
10441
|
+
return /* @__PURE__ */ React25.createElement("div", { style: {
|
|
10202
10442
|
padding: "20px",
|
|
10203
10443
|
textAlign: "center",
|
|
10204
10444
|
border: "1px solid #e2e8f0",
|
|
10205
10445
|
borderRadius: "6px"
|
|
10206
10446
|
} }, "Loading data source...");
|
|
10207
10447
|
}
|
|
10208
|
-
return /* @__PURE__ */
|
|
10448
|
+
return /* @__PURE__ */ React25.createElement("div", { style: {
|
|
10209
10449
|
...themeStyles,
|
|
10210
10450
|
border: "var(--grid-border-width, 1px) solid var(--grid-border)",
|
|
10211
10451
|
borderRadius: "var(--grid-border-radius, 6px)",
|
|
@@ -10215,7 +10455,7 @@ var InfiniteScrollDataGrid = ({
|
|
|
10215
10455
|
display: "flex",
|
|
10216
10456
|
flexDirection: "column",
|
|
10217
10457
|
height: (virtualScrollConfig == null ? void 0 : virtualScrollConfig.containerHeight) ? `${virtualScrollConfig.containerHeight + 150}px` : "auto"
|
|
10218
|
-
} }, /* @__PURE__ */
|
|
10458
|
+
} }, /* @__PURE__ */ React25.createElement("div", { style: {
|
|
10219
10459
|
position: "relative",
|
|
10220
10460
|
display: "flex",
|
|
10221
10461
|
alignItems: "center",
|
|
@@ -10227,12 +10467,12 @@ var InfiniteScrollDataGrid = ({
|
|
|
10227
10467
|
backgroundColor: "var(--grid-bg-alt)",
|
|
10228
10468
|
borderBottom: "var(--grid-border-width, 1px) solid var(--grid-border)",
|
|
10229
10469
|
zIndex: 30
|
|
10230
|
-
} }, /* @__PURE__ */
|
|
10470
|
+
} }, /* @__PURE__ */ React25.createElement("div", { style: {
|
|
10231
10471
|
position: "relative",
|
|
10232
10472
|
display: "flex",
|
|
10233
10473
|
alignItems: "center",
|
|
10234
10474
|
gap: "8px"
|
|
10235
|
-
} }, /* @__PURE__ */
|
|
10475
|
+
} }, /* @__PURE__ */ React25.createElement(
|
|
10236
10476
|
ColumnChooser,
|
|
10237
10477
|
{
|
|
10238
10478
|
columns,
|
|
@@ -10242,18 +10482,18 @@ var InfiniteScrollDataGrid = ({
|
|
|
10242
10482
|
onReorderColumns: (fromIndex, toIndex) => dispatch({ type: "REORDER_COLUMNS", payload: { fromIndex, toIndex } }),
|
|
10243
10483
|
onResetLayout: () => dispatch({ type: "RESET_COLUMN_LAYOUT" })
|
|
10244
10484
|
}
|
|
10245
|
-
), /* @__PURE__ */
|
|
10485
|
+
), /* @__PURE__ */ React25.createElement("div", { style: {
|
|
10246
10486
|
fontSize: "14px",
|
|
10247
10487
|
color: "#64748b",
|
|
10248
10488
|
marginLeft: "12px"
|
|
10249
|
-
} }, totalRows !== void 0 ? `${totalRows.toLocaleString()} total rows` : "Loading..."))), /* @__PURE__ */
|
|
10489
|
+
} }, totalRows !== void 0 ? `${totalRows.toLocaleString()} total rows` : "Loading..."))), /* @__PURE__ */ React25.createElement(
|
|
10250
10490
|
GroupByPanel,
|
|
10251
10491
|
{
|
|
10252
10492
|
columns,
|
|
10253
10493
|
groupBy: state.groupBy,
|
|
10254
10494
|
dispatch
|
|
10255
10495
|
}
|
|
10256
|
-
), /* @__PURE__ */
|
|
10496
|
+
), /* @__PURE__ */ React25.createElement("div", { style: { position: "sticky", top: 0, zIndex: 20 } }, /* @__PURE__ */ React25.createElement(
|
|
10257
10497
|
GridHeader,
|
|
10258
10498
|
{
|
|
10259
10499
|
columns,
|
|
@@ -10266,7 +10506,7 @@ var InfiniteScrollDataGrid = ({
|
|
|
10266
10506
|
pinnedRight: pinnedRightFields,
|
|
10267
10507
|
showColumnPinning
|
|
10268
10508
|
}
|
|
10269
|
-
), /* @__PURE__ */
|
|
10509
|
+
), /* @__PURE__ */ React25.createElement(
|
|
10270
10510
|
ColumnFilters,
|
|
10271
10511
|
{
|
|
10272
10512
|
columns,
|
|
@@ -10278,7 +10518,7 @@ var InfiniteScrollDataGrid = ({
|
|
|
10278
10518
|
pinnedRight: pinnedRightFields,
|
|
10279
10519
|
rows: visibleRows
|
|
10280
10520
|
}
|
|
10281
|
-
)), /* @__PURE__ */
|
|
10521
|
+
)), /* @__PURE__ */ React25.createElement(
|
|
10282
10522
|
GridBody,
|
|
10283
10523
|
{
|
|
10284
10524
|
columns,
|
|
@@ -10300,7 +10540,7 @@ var InfiniteScrollDataGrid = ({
|
|
|
10300
10540
|
enabled: true
|
|
10301
10541
|
}
|
|
10302
10542
|
}
|
|
10303
|
-
), /* @__PURE__ */
|
|
10543
|
+
), /* @__PURE__ */ React25.createElement("div", { style: {
|
|
10304
10544
|
padding: "8px 16px",
|
|
10305
10545
|
backgroundColor: "var(--grid-footer-bg)",
|
|
10306
10546
|
borderTop: "var(--grid-border-width, 1px) solid var(--grid-border)",
|
|
@@ -10309,12 +10549,12 @@ var InfiniteScrollDataGrid = ({
|
|
|
10309
10549
|
display: "flex",
|
|
10310
10550
|
justifyContent: "space-between",
|
|
10311
10551
|
alignItems: "center"
|
|
10312
|
-
} }, /* @__PURE__ */
|
|
10552
|
+
} }, /* @__PURE__ */ React25.createElement("div", null, "Server-side infinite scrolling enabled"), /* @__PURE__ */ React25.createElement("div", null, "Rows loaded: ", visibleRows.length)));
|
|
10313
10553
|
};
|
|
10314
10554
|
var ThemedInfiniteScrollDataGrid = InfiniteScrollDataGrid;
|
|
10315
10555
|
|
|
10316
10556
|
// src/components/DataGrid/ThemeSelector.tsx
|
|
10317
|
-
import
|
|
10557
|
+
import React26 from "react";
|
|
10318
10558
|
var ThemeSelector = ({
|
|
10319
10559
|
currentTheme,
|
|
10320
10560
|
onThemeChange
|
|
@@ -10335,7 +10575,7 @@ var ThemeSelector = ({
|
|
|
10335
10575
|
onThemeChange(event.target.value);
|
|
10336
10576
|
};
|
|
10337
10577
|
const theme = getTheme(currentTheme);
|
|
10338
|
-
return /* @__PURE__ */
|
|
10578
|
+
return /* @__PURE__ */ React26.createElement("div", { style: { display: "inline-flex", alignItems: "center", gap: "8px" } }, /* @__PURE__ */ React26.createElement(
|
|
10339
10579
|
"label",
|
|
10340
10580
|
{
|
|
10341
10581
|
htmlFor: "theme-selector",
|
|
@@ -10346,7 +10586,7 @@ var ThemeSelector = ({
|
|
|
10346
10586
|
}
|
|
10347
10587
|
},
|
|
10348
10588
|
"Theme:"
|
|
10349
|
-
), /* @__PURE__ */
|
|
10589
|
+
), /* @__PURE__ */ React26.createElement(
|
|
10350
10590
|
"select",
|
|
10351
10591
|
{
|
|
10352
10592
|
id: "theme-selector",
|
|
@@ -10375,12 +10615,12 @@ var ThemeSelector = ({
|
|
|
10375
10615
|
e.currentTarget.style.borderColor = theme.colors.border;
|
|
10376
10616
|
}
|
|
10377
10617
|
},
|
|
10378
|
-
themes2.map((themeOption) => /* @__PURE__ */
|
|
10618
|
+
themes2.map((themeOption) => /* @__PURE__ */ React26.createElement("option", { key: themeOption.value, value: themeOption.value }, themeOption.label))
|
|
10379
10619
|
));
|
|
10380
10620
|
};
|
|
10381
10621
|
|
|
10382
10622
|
// src/components/DataGrid/CellRenderers.tsx
|
|
10383
|
-
import
|
|
10623
|
+
import React27 from "react";
|
|
10384
10624
|
var StatusChip = ({ status }) => {
|
|
10385
10625
|
const getStatusStyles = (status2) => {
|
|
10386
10626
|
const normalized = status2.toLowerCase();
|
|
@@ -10418,7 +10658,7 @@ var StatusChip = ({ status }) => {
|
|
|
10418
10658
|
}
|
|
10419
10659
|
};
|
|
10420
10660
|
const styles = getStatusStyles(status);
|
|
10421
|
-
return /* @__PURE__ */
|
|
10661
|
+
return /* @__PURE__ */ React27.createElement(
|
|
10422
10662
|
"span",
|
|
10423
10663
|
{
|
|
10424
10664
|
style: {
|
|
@@ -10442,7 +10682,7 @@ var ProgressBar = ({
|
|
|
10442
10682
|
showLabel = true
|
|
10443
10683
|
}) => {
|
|
10444
10684
|
const clampedValue = Math.max(0, Math.min(100, value));
|
|
10445
|
-
return /* @__PURE__ */
|
|
10685
|
+
return /* @__PURE__ */ React27.createElement("div", { style: { display: "flex", alignItems: "center", gap: "8px", width: "100%" } }, /* @__PURE__ */ React27.createElement(
|
|
10446
10686
|
"div",
|
|
10447
10687
|
{
|
|
10448
10688
|
style: {
|
|
@@ -10453,7 +10693,7 @@ var ProgressBar = ({
|
|
|
10453
10693
|
overflow: "hidden"
|
|
10454
10694
|
}
|
|
10455
10695
|
},
|
|
10456
|
-
/* @__PURE__ */
|
|
10696
|
+
/* @__PURE__ */ React27.createElement(
|
|
10457
10697
|
"div",
|
|
10458
10698
|
{
|
|
10459
10699
|
style: {
|
|
@@ -10464,10 +10704,10 @@ var ProgressBar = ({
|
|
|
10464
10704
|
}
|
|
10465
10705
|
}
|
|
10466
10706
|
)
|
|
10467
|
-
), showLabel && /* @__PURE__ */
|
|
10707
|
+
), showLabel && /* @__PURE__ */ React27.createElement("span", { style: { fontSize: "12px", fontWeight: 500, color: "#6b7280", minWidth: "35px" } }, clampedValue, "%"));
|
|
10468
10708
|
};
|
|
10469
10709
|
var IconCell = ({ icon, text, iconColor }) => {
|
|
10470
|
-
return /* @__PURE__ */
|
|
10710
|
+
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
10711
|
};
|
|
10472
10712
|
var ImageCell = ({
|
|
10473
10713
|
src,
|
|
@@ -10475,7 +10715,7 @@ var ImageCell = ({
|
|
|
10475
10715
|
text,
|
|
10476
10716
|
size = 32
|
|
10477
10717
|
}) => {
|
|
10478
|
-
return /* @__PURE__ */
|
|
10718
|
+
return /* @__PURE__ */ React27.createElement("div", { style: { display: "flex", alignItems: "center", gap: "8px" } }, /* @__PURE__ */ React27.createElement(
|
|
10479
10719
|
"img",
|
|
10480
10720
|
{
|
|
10481
10721
|
src,
|
|
@@ -10488,7 +10728,7 @@ var ImageCell = ({
|
|
|
10488
10728
|
border: "2px solid #e5e7eb"
|
|
10489
10729
|
}
|
|
10490
10730
|
}
|
|
10491
|
-
), text && /* @__PURE__ */
|
|
10731
|
+
), text && /* @__PURE__ */ React27.createElement("span", { style: { fontSize: "13px" } }, text));
|
|
10492
10732
|
};
|
|
10493
10733
|
var ButtonCell = ({
|
|
10494
10734
|
label,
|
|
@@ -10530,7 +10770,7 @@ var ButtonCell = ({
|
|
|
10530
10770
|
}
|
|
10531
10771
|
};
|
|
10532
10772
|
const styles = getButtonStyles();
|
|
10533
|
-
return /* @__PURE__ */
|
|
10773
|
+
return /* @__PURE__ */ React27.createElement(
|
|
10534
10774
|
"button",
|
|
10535
10775
|
{
|
|
10536
10776
|
onClick: (e) => {
|
|
@@ -10572,7 +10812,7 @@ var BadgeCell = ({
|
|
|
10572
10812
|
color = "#1f2937",
|
|
10573
10813
|
backgroundColor = "#f3f4f6"
|
|
10574
10814
|
}) => {
|
|
10575
|
-
return /* @__PURE__ */
|
|
10815
|
+
return /* @__PURE__ */ React27.createElement(
|
|
10576
10816
|
"span",
|
|
10577
10817
|
{
|
|
10578
10818
|
style: {
|
|
@@ -10603,11 +10843,11 @@ var PriorityIndicator = ({ priority }) => {
|
|
|
10603
10843
|
}
|
|
10604
10844
|
};
|
|
10605
10845
|
const styles = getPriorityStyles();
|
|
10606
|
-
return /* @__PURE__ */
|
|
10846
|
+
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
10847
|
};
|
|
10608
10848
|
var Rating = ({ rating, maxRating = 5 }) => {
|
|
10609
10849
|
const stars = Array.from({ length: maxRating }, (_, i) => i < rating ? "\u2605" : "\u2606");
|
|
10610
|
-
return /* @__PURE__ */
|
|
10850
|
+
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
10851
|
};
|
|
10612
10852
|
var CurrencyCell = ({
|
|
10613
10853
|
amount,
|
|
@@ -10618,11 +10858,11 @@ var CurrencyCell = ({
|
|
|
10618
10858
|
style: "currency",
|
|
10619
10859
|
currency
|
|
10620
10860
|
}).format(amount);
|
|
10621
|
-
return /* @__PURE__ */
|
|
10861
|
+
return /* @__PURE__ */ React27.createElement("span", { style: { fontWeight: 500, color: amount < 0 ? "#ef4444" : "#059669" } }, formatted);
|
|
10622
10862
|
};
|
|
10623
10863
|
|
|
10624
10864
|
// src/components/DataGrid/GridApiDemo.tsx
|
|
10625
|
-
import
|
|
10865
|
+
import React28, { useRef as useRef12, useState as useState18 } from "react";
|
|
10626
10866
|
var GridApiDemo = () => {
|
|
10627
10867
|
const gridRef = useRef12(null);
|
|
10628
10868
|
const [logs, setLogs] = useState18([]);
|
|
@@ -10881,7 +11121,7 @@ var GridApiDemo = () => {
|
|
|
10881
11121
|
const totalPages = api.paginationGetTotalPages();
|
|
10882
11122
|
addLog(`Rows: ${totalRows}, Selected: ${selectedCount}, Filters: ${hasFilters}, Page: ${currentPage + 1}/${totalPages}`);
|
|
10883
11123
|
};
|
|
10884
|
-
return /* @__PURE__ */
|
|
11124
|
+
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
11125
|
display: "grid",
|
|
10886
11126
|
gridTemplateColumns: "repeat(auto-fit, minmax(200px, 1fr))",
|
|
10887
11127
|
gap: "10px",
|
|
@@ -10889,7 +11129,7 @@ var GridApiDemo = () => {
|
|
|
10889
11129
|
padding: "15px",
|
|
10890
11130
|
backgroundColor: "#f5f5f5",
|
|
10891
11131
|
borderRadius: "8px"
|
|
10892
|
-
} }, /* @__PURE__ */
|
|
11132
|
+
} }, /* @__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
11133
|
marginBottom: "20px",
|
|
10894
11134
|
padding: "10px",
|
|
10895
11135
|
backgroundColor: "#f9f9f9",
|
|
@@ -10899,7 +11139,7 @@ var GridApiDemo = () => {
|
|
|
10899
11139
|
overflow: "auto",
|
|
10900
11140
|
fontFamily: "monospace",
|
|
10901
11141
|
fontSize: "12px"
|
|
10902
|
-
} }, /* @__PURE__ */
|
|
11142
|
+
} }, /* @__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
11143
|
DataGrid,
|
|
10904
11144
|
{
|
|
10905
11145
|
ref: gridRef,
|
|
@@ -10914,7 +11154,7 @@ var GridApiDemo = () => {
|
|
|
10914
11154
|
addLog(`Selection changed: ${selectedIds.length} row(s)`);
|
|
10915
11155
|
}
|
|
10916
11156
|
}
|
|
10917
|
-
), /* @__PURE__ */
|
|
11157
|
+
), /* @__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
11158
|
const MyComponent = () => {
|
|
10919
11159
|
const gridRef = useRef<GridApi>(null);
|
|
10920
11160
|
|
|
@@ -10932,14 +11172,14 @@ const MyComponent = () => {
|
|
|
10932
11172
|
onGridReady={handleGridReady} // \u2705 Called when API is ready
|
|
10933
11173
|
/>
|
|
10934
11174
|
);
|
|
10935
|
-
};`)), /* @__PURE__ */
|
|
11175
|
+
};`)), /* @__PURE__ */ React28.createElement("div", { style: {
|
|
10936
11176
|
marginTop: "30px",
|
|
10937
11177
|
padding: "24px",
|
|
10938
11178
|
background: "linear-gradient(to bottom right, #ffffff, #f9fafb)",
|
|
10939
11179
|
border: "1px solid #e5e7eb",
|
|
10940
11180
|
borderRadius: "12px",
|
|
10941
11181
|
boxShadow: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"
|
|
10942
|
-
} }, /* @__PURE__ */
|
|
11182
|
+
} }, /* @__PURE__ */ React28.createElement("h3", { style: {
|
|
10943
11183
|
fontSize: "20px",
|
|
10944
11184
|
fontWeight: "700",
|
|
10945
11185
|
marginBottom: "20px",
|
|
@@ -10947,7 +11187,7 @@ const MyComponent = () => {
|
|
|
10947
11187
|
display: "flex",
|
|
10948
11188
|
alignItems: "center",
|
|
10949
11189
|
gap: "8px"
|
|
10950
|
-
} }, /* @__PURE__ */
|
|
11190
|
+
} }, /* @__PURE__ */ React28.createElement("span", { style: {
|
|
10951
11191
|
display: "inline-flex",
|
|
10952
11192
|
alignItems: "center",
|
|
10953
11193
|
justifyContent: "center",
|
|
@@ -10957,14 +11197,14 @@ const MyComponent = () => {
|
|
|
10957
11197
|
borderRadius: "8px",
|
|
10958
11198
|
color: "white",
|
|
10959
11199
|
fontSize: "18px"
|
|
10960
|
-
} }, "\u26A1"), "Grid API Methods Available"), /* @__PURE__ */
|
|
11200
|
+
} }, "\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
11201
|
padding: "16px",
|
|
10962
11202
|
backgroundColor: "#ffffff",
|
|
10963
11203
|
borderRadius: "8px",
|
|
10964
11204
|
border: "1px solid #e5e7eb",
|
|
10965
11205
|
transition: "all 0.2s ease",
|
|
10966
11206
|
boxShadow: "0 1px 3px rgba(0,0,0,0.05)"
|
|
10967
|
-
} }, /* @__PURE__ */
|
|
11207
|
+
} }, /* @__PURE__ */ React28.createElement("h4", { style: {
|
|
10968
11208
|
fontSize: "14px",
|
|
10969
11209
|
fontWeight: "600",
|
|
10970
11210
|
marginBottom: "12px",
|
|
@@ -10972,14 +11212,14 @@ const MyComponent = () => {
|
|
|
10972
11212
|
display: "flex",
|
|
10973
11213
|
alignItems: "center",
|
|
10974
11214
|
gap: "6px"
|
|
10975
|
-
} }, /* @__PURE__ */
|
|
11215
|
+
} }, /* @__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
11216
|
padding: "16px",
|
|
10977
11217
|
backgroundColor: "#ffffff",
|
|
10978
11218
|
borderRadius: "8px",
|
|
10979
11219
|
border: "1px solid #e5e7eb",
|
|
10980
11220
|
transition: "all 0.2s ease",
|
|
10981
11221
|
boxShadow: "0 1px 3px rgba(0,0,0,0.05)"
|
|
10982
|
-
} }, /* @__PURE__ */
|
|
11222
|
+
} }, /* @__PURE__ */ React28.createElement("h4", { style: {
|
|
10983
11223
|
fontSize: "14px",
|
|
10984
11224
|
fontWeight: "600",
|
|
10985
11225
|
marginBottom: "12px",
|
|
@@ -10987,14 +11227,14 @@ const MyComponent = () => {
|
|
|
10987
11227
|
display: "flex",
|
|
10988
11228
|
alignItems: "center",
|
|
10989
11229
|
gap: "6px"
|
|
10990
|
-
} }, /* @__PURE__ */
|
|
11230
|
+
} }, /* @__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
11231
|
padding: "16px",
|
|
10992
11232
|
backgroundColor: "#ffffff",
|
|
10993
11233
|
borderRadius: "8px",
|
|
10994
11234
|
border: "1px solid #e5e7eb",
|
|
10995
11235
|
transition: "all 0.2s ease",
|
|
10996
11236
|
boxShadow: "0 1px 3px rgba(0,0,0,0.05)"
|
|
10997
|
-
} }, /* @__PURE__ */
|
|
11237
|
+
} }, /* @__PURE__ */ React28.createElement("h4", { style: {
|
|
10998
11238
|
fontSize: "14px",
|
|
10999
11239
|
fontWeight: "600",
|
|
11000
11240
|
marginBottom: "12px",
|
|
@@ -11002,14 +11242,14 @@ const MyComponent = () => {
|
|
|
11002
11242
|
display: "flex",
|
|
11003
11243
|
alignItems: "center",
|
|
11004
11244
|
gap: "6px"
|
|
11005
|
-
} }, /* @__PURE__ */
|
|
11245
|
+
} }, /* @__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
11246
|
padding: "16px",
|
|
11007
11247
|
backgroundColor: "#ffffff",
|
|
11008
11248
|
borderRadius: "8px",
|
|
11009
11249
|
border: "1px solid #e5e7eb",
|
|
11010
11250
|
transition: "all 0.2s ease",
|
|
11011
11251
|
boxShadow: "0 1px 3px rgba(0,0,0,0.05)"
|
|
11012
|
-
} }, /* @__PURE__ */
|
|
11252
|
+
} }, /* @__PURE__ */ React28.createElement("h4", { style: {
|
|
11013
11253
|
fontSize: "14px",
|
|
11014
11254
|
fontWeight: "600",
|
|
11015
11255
|
marginBottom: "12px",
|
|
@@ -11017,14 +11257,14 @@ const MyComponent = () => {
|
|
|
11017
11257
|
display: "flex",
|
|
11018
11258
|
alignItems: "center",
|
|
11019
11259
|
gap: "6px"
|
|
11020
|
-
} }, /* @__PURE__ */
|
|
11260
|
+
} }, /* @__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
11261
|
padding: "16px",
|
|
11022
11262
|
backgroundColor: "#ffffff",
|
|
11023
11263
|
borderRadius: "8px",
|
|
11024
11264
|
border: "1px solid #e5e7eb",
|
|
11025
11265
|
transition: "all 0.2s ease",
|
|
11026
11266
|
boxShadow: "0 1px 3px rgba(0,0,0,0.05)"
|
|
11027
|
-
} }, /* @__PURE__ */
|
|
11267
|
+
} }, /* @__PURE__ */ React28.createElement("h4", { style: {
|
|
11028
11268
|
fontSize: "14px",
|
|
11029
11269
|
fontWeight: "600",
|
|
11030
11270
|
marginBottom: "12px",
|
|
@@ -11032,14 +11272,14 @@ const MyComponent = () => {
|
|
|
11032
11272
|
display: "flex",
|
|
11033
11273
|
alignItems: "center",
|
|
11034
11274
|
gap: "6px"
|
|
11035
|
-
} }, /* @__PURE__ */
|
|
11275
|
+
} }, /* @__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
11276
|
padding: "16px",
|
|
11037
11277
|
backgroundColor: "#ffffff",
|
|
11038
11278
|
borderRadius: "8px",
|
|
11039
11279
|
border: "1px solid #e5e7eb",
|
|
11040
11280
|
transition: "all 0.2s ease",
|
|
11041
11281
|
boxShadow: "0 1px 3px rgba(0,0,0,0.05)"
|
|
11042
|
-
} }, /* @__PURE__ */
|
|
11282
|
+
} }, /* @__PURE__ */ React28.createElement("h4", { style: {
|
|
11043
11283
|
fontSize: "14px",
|
|
11044
11284
|
fontWeight: "600",
|
|
11045
11285
|
marginBottom: "12px",
|
|
@@ -11047,7 +11287,7 @@ const MyComponent = () => {
|
|
|
11047
11287
|
display: "flex",
|
|
11048
11288
|
alignItems: "center",
|
|
11049
11289
|
gap: "6px"
|
|
11050
|
-
} }, /* @__PURE__ */
|
|
11290
|
+
} }, /* @__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
11291
|
};
|
|
11052
11292
|
var buttonStyle = {
|
|
11053
11293
|
display: "block",
|
|
@@ -11064,10 +11304,10 @@ var buttonStyle = {
|
|
|
11064
11304
|
};
|
|
11065
11305
|
|
|
11066
11306
|
// src/components/DataGrid/MarketDataGrid.tsx
|
|
11067
|
-
import
|
|
11307
|
+
import React30, { useRef as useRef13, useEffect as useEffect12, useMemo as useMemo7, useCallback as useCallback9 } from "react";
|
|
11068
11308
|
|
|
11069
11309
|
// src/components/DataGrid/MarketDataGridUtils.tsx
|
|
11070
|
-
import
|
|
11310
|
+
import React29 from "react";
|
|
11071
11311
|
var getColumnClass = (field) => {
|
|
11072
11312
|
const numericFields = ["price", "bid", "ask", "size", "volume", "change", "changePercent", "high", "low", "open"];
|
|
11073
11313
|
return numericFields.includes(field) ? "numeric-cell" : "";
|
|
@@ -11090,10 +11330,10 @@ var formatPrice = (value) => {
|
|
|
11090
11330
|
});
|
|
11091
11331
|
};
|
|
11092
11332
|
var formatChange = (value, isPercent) => {
|
|
11093
|
-
if (value == null) return /* @__PURE__ */
|
|
11333
|
+
if (value == null) return /* @__PURE__ */ React29.createElement("span", null, "-");
|
|
11094
11334
|
const formatted = isPercent ? `${value >= 0 ? "+" : ""}${value.toFixed(2)}%` : `${value >= 0 ? "+" : ""}${value.toFixed(2)}`;
|
|
11095
11335
|
const className = value >= 0 ? "change-positive" : "change-negative";
|
|
11096
|
-
return /* @__PURE__ */
|
|
11336
|
+
return /* @__PURE__ */ React29.createElement("span", { className }, formatted);
|
|
11097
11337
|
};
|
|
11098
11338
|
var formatVolume = (value) => {
|
|
11099
11339
|
if (value == null) return "";
|
|
@@ -11158,7 +11398,7 @@ var MarketDataGrid = ({
|
|
|
11158
11398
|
const handleRowClick = useCallback9((row) => {
|
|
11159
11399
|
onRowClick == null ? void 0 : onRowClick(row);
|
|
11160
11400
|
}, [onRowClick]);
|
|
11161
|
-
const renderHeader = () => /* @__PURE__ */
|
|
11401
|
+
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
11402
|
"div",
|
|
11163
11403
|
{
|
|
11164
11404
|
key: col.field,
|
|
@@ -11167,7 +11407,7 @@ var MarketDataGrid = ({
|
|
|
11167
11407
|
},
|
|
11168
11408
|
col.headerName
|
|
11169
11409
|
))));
|
|
11170
|
-
const renderBody = () => /* @__PURE__ */
|
|
11410
|
+
const renderBody = () => /* @__PURE__ */ React30.createElement("div", { className: "market-grid-body" }, rows.map((row) => /* @__PURE__ */ React30.createElement(
|
|
11171
11411
|
"div",
|
|
11172
11412
|
{
|
|
11173
11413
|
key: row.id,
|
|
@@ -11176,7 +11416,7 @@ var MarketDataGrid = ({
|
|
|
11176
11416
|
},
|
|
11177
11417
|
enhancedColumns.map((col) => {
|
|
11178
11418
|
const value = row[col.field];
|
|
11179
|
-
return /* @__PURE__ */
|
|
11419
|
+
return /* @__PURE__ */ React30.createElement(
|
|
11180
11420
|
"div",
|
|
11181
11421
|
{
|
|
11182
11422
|
key: col.field,
|
|
@@ -11194,7 +11434,7 @@ var MarketDataGrid = ({
|
|
|
11194
11434
|
})
|
|
11195
11435
|
)));
|
|
11196
11436
|
const containerClassName = `market-data-grid ${(config == null ? void 0 : config.densityMode) ? "density-compact" : ""} ${className}`.trim();
|
|
11197
|
-
return /* @__PURE__ */
|
|
11437
|
+
return /* @__PURE__ */ React30.createElement("div", { ref: tableRef, className: containerClassName, "data-testid": "data-grid" }, renderHeader(), renderBody());
|
|
11198
11438
|
};
|
|
11199
11439
|
|
|
11200
11440
|
// src/components/DataGrid/MarketDataEngine.ts
|
|
@@ -12049,7 +12289,7 @@ function createMockFeed(config) {
|
|
|
12049
12289
|
}
|
|
12050
12290
|
|
|
12051
12291
|
// src/components/DataGrid/PivotToolbar.tsx
|
|
12052
|
-
import
|
|
12292
|
+
import React31, { useState as useState20, useMemo as useMemo8 } from "react";
|
|
12053
12293
|
var AGGREGATOR_OPTIONS = [
|
|
12054
12294
|
{ value: "sum", label: "Sum" },
|
|
12055
12295
|
{ value: "avg", label: "Average" },
|
|
@@ -12105,7 +12345,7 @@ var PivotToolbar = ({
|
|
|
12105
12345
|
const handleToggle = () => {
|
|
12106
12346
|
setIsExpanded(!isExpanded);
|
|
12107
12347
|
};
|
|
12108
|
-
return /* @__PURE__ */
|
|
12348
|
+
return /* @__PURE__ */ React31.createElement(
|
|
12109
12349
|
"div",
|
|
12110
12350
|
{
|
|
12111
12351
|
className,
|
|
@@ -12117,14 +12357,14 @@ var PivotToolbar = ({
|
|
|
12117
12357
|
...style
|
|
12118
12358
|
}
|
|
12119
12359
|
},
|
|
12120
|
-
/* @__PURE__ */
|
|
12360
|
+
/* @__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
12361
|
backgroundColor: "#10b981",
|
|
12122
12362
|
color: "white",
|
|
12123
12363
|
padding: "2px 8px",
|
|
12124
12364
|
borderRadius: "12px",
|
|
12125
12365
|
fontSize: "11px",
|
|
12126
12366
|
fontWeight: "600"
|
|
12127
|
-
} }, "Active")), /* @__PURE__ */
|
|
12367
|
+
} }, "Active")), /* @__PURE__ */ React31.createElement("div", { style: { display: "flex", gap: "8px" } }, isPivotMode && /* @__PURE__ */ React31.createElement(
|
|
12128
12368
|
"button",
|
|
12129
12369
|
{
|
|
12130
12370
|
onClick: handleClear,
|
|
@@ -12147,7 +12387,7 @@ var PivotToolbar = ({
|
|
|
12147
12387
|
}
|
|
12148
12388
|
},
|
|
12149
12389
|
"Clear Pivot"
|
|
12150
|
-
), /* @__PURE__ */
|
|
12390
|
+
), /* @__PURE__ */ React31.createElement(
|
|
12151
12391
|
"button",
|
|
12152
12392
|
{
|
|
12153
12393
|
onClick: handleToggle,
|
|
@@ -12170,7 +12410,7 @@ var PivotToolbar = ({
|
|
|
12170
12410
|
},
|
|
12171
12411
|
isExpanded ? "\u25B2" : "\u25BC"
|
|
12172
12412
|
))),
|
|
12173
|
-
isExpanded && /* @__PURE__ */
|
|
12413
|
+
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
12414
|
"select",
|
|
12175
12415
|
{
|
|
12176
12416
|
value: rowGroupColumn,
|
|
@@ -12186,9 +12426,9 @@ var PivotToolbar = ({
|
|
|
12186
12426
|
cursor: "pointer"
|
|
12187
12427
|
}
|
|
12188
12428
|
},
|
|
12189
|
-
/* @__PURE__ */
|
|
12190
|
-
columns.map((col) => /* @__PURE__ */
|
|
12191
|
-
)), /* @__PURE__ */
|
|
12429
|
+
/* @__PURE__ */ React31.createElement("option", { value: "" }, "Select column..."),
|
|
12430
|
+
columns.map((col) => /* @__PURE__ */ React31.createElement("option", { key: col.field, value: col.field }, col.headerName))
|
|
12431
|
+
)), /* @__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
12432
|
"select",
|
|
12193
12433
|
{
|
|
12194
12434
|
value: pivotColumn,
|
|
@@ -12204,9 +12444,9 @@ var PivotToolbar = ({
|
|
|
12204
12444
|
cursor: "pointer"
|
|
12205
12445
|
}
|
|
12206
12446
|
},
|
|
12207
|
-
/* @__PURE__ */
|
|
12208
|
-
columns.map((col) => /* @__PURE__ */
|
|
12209
|
-
)), /* @__PURE__ */
|
|
12447
|
+
/* @__PURE__ */ React31.createElement("option", { value: "" }, "Select column..."),
|
|
12448
|
+
columns.map((col) => /* @__PURE__ */ React31.createElement("option", { key: col.field, value: col.field }, col.headerName))
|
|
12449
|
+
)), /* @__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
12450
|
"select",
|
|
12211
12451
|
{
|
|
12212
12452
|
value: valueColumn,
|
|
@@ -12222,9 +12462,9 @@ var PivotToolbar = ({
|
|
|
12222
12462
|
cursor: "pointer"
|
|
12223
12463
|
}
|
|
12224
12464
|
},
|
|
12225
|
-
/* @__PURE__ */
|
|
12226
|
-
columns.map((col) => /* @__PURE__ */
|
|
12227
|
-
)), /* @__PURE__ */
|
|
12465
|
+
/* @__PURE__ */ React31.createElement("option", { value: "" }, "Select column..."),
|
|
12466
|
+
columns.map((col) => /* @__PURE__ */ React31.createElement("option", { key: col.field, value: col.field }, col.headerName))
|
|
12467
|
+
)), /* @__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
12468
|
"select",
|
|
12229
12469
|
{
|
|
12230
12470
|
value: aggregator,
|
|
@@ -12240,8 +12480,8 @@ var PivotToolbar = ({
|
|
|
12240
12480
|
cursor: "pointer"
|
|
12241
12481
|
}
|
|
12242
12482
|
},
|
|
12243
|
-
AGGREGATOR_OPTIONS.map((opt) => /* @__PURE__ */
|
|
12244
|
-
)), /* @__PURE__ */
|
|
12483
|
+
AGGREGATOR_OPTIONS.map((opt) => /* @__PURE__ */ React31.createElement("option", { key: opt.value, value: opt.value }, opt.label))
|
|
12484
|
+
)), /* @__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
12485
|
"input",
|
|
12246
12486
|
{
|
|
12247
12487
|
type: "checkbox",
|
|
@@ -12249,7 +12489,7 @@ var PivotToolbar = ({
|
|
|
12249
12489
|
onChange: (e) => setShowTotals(e.target.checked),
|
|
12250
12490
|
style: { cursor: "pointer" }
|
|
12251
12491
|
}
|
|
12252
|
-
), "Show Totals Row"), /* @__PURE__ */
|
|
12492
|
+
), "Show Totals Row"), /* @__PURE__ */ React31.createElement("label", { style: { display: "flex", alignItems: "center", gap: "6px", fontSize: "13px", color: "#475569", cursor: "pointer" } }, /* @__PURE__ */ React31.createElement(
|
|
12253
12493
|
"input",
|
|
12254
12494
|
{
|
|
12255
12495
|
type: "checkbox",
|
|
@@ -12257,7 +12497,7 @@ var PivotToolbar = ({
|
|
|
12257
12497
|
onChange: (e) => setShowGrandTotal(e.target.checked),
|
|
12258
12498
|
style: { cursor: "pointer" }
|
|
12259
12499
|
}
|
|
12260
|
-
), "Show Grand Total Column")), /* @__PURE__ */
|
|
12500
|
+
), "Show Grand Total Column")), /* @__PURE__ */ React31.createElement("div", { style: { display: "flex", alignItems: "flex-end" } }, /* @__PURE__ */ React31.createElement(
|
|
12261
12501
|
"button",
|
|
12262
12502
|
{
|
|
12263
12503
|
onClick: handleApply,
|
|
@@ -12288,7 +12528,7 @@ var PivotToolbar = ({
|
|
|
12288
12528
|
},
|
|
12289
12529
|
"Apply Pivot"
|
|
12290
12530
|
))),
|
|
12291
|
-
isExpanded && /* @__PURE__ */
|
|
12531
|
+
isExpanded && /* @__PURE__ */ React31.createElement("div", { style: {
|
|
12292
12532
|
marginTop: "12px",
|
|
12293
12533
|
padding: "10px",
|
|
12294
12534
|
backgroundColor: "#eff6ff",
|
|
@@ -12296,7 +12536,7 @@ var PivotToolbar = ({
|
|
|
12296
12536
|
borderRadius: "6px",
|
|
12297
12537
|
fontSize: "12px",
|
|
12298
12538
|
color: "#1e40af"
|
|
12299
|
-
} }, /* @__PURE__ */
|
|
12539
|
+
} }, /* @__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
12540
|
);
|
|
12301
12541
|
};
|
|
12302
12542
|
|
|
@@ -12496,7 +12736,7 @@ function filterOptions(options, searchQuery) {
|
|
|
12496
12736
|
}
|
|
12497
12737
|
|
|
12498
12738
|
// src/editors/RichSelectEditor.tsx
|
|
12499
|
-
import
|
|
12739
|
+
import React32, { useState as useState21, useRef as useRef16, useEffect as useEffect15, useMemo as useMemo9 } from "react";
|
|
12500
12740
|
function RichSelectEditor(props) {
|
|
12501
12741
|
const {
|
|
12502
12742
|
value,
|
|
@@ -12613,16 +12853,16 @@ function RichSelectEditor(props) {
|
|
|
12613
12853
|
if (renderOptionLabel) {
|
|
12614
12854
|
return renderOptionLabel(option);
|
|
12615
12855
|
}
|
|
12616
|
-
return /* @__PURE__ */
|
|
12856
|
+
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
12857
|
};
|
|
12618
|
-
return /* @__PURE__ */
|
|
12858
|
+
return /* @__PURE__ */ React32.createElement(
|
|
12619
12859
|
"div",
|
|
12620
12860
|
{
|
|
12621
12861
|
ref: containerRef,
|
|
12622
12862
|
className: "editor-container editor-richselect-container",
|
|
12623
12863
|
onKeyDown: handleKeyDown
|
|
12624
12864
|
},
|
|
12625
|
-
/* @__PURE__ */
|
|
12865
|
+
/* @__PURE__ */ React32.createElement("div", { className: "editor-input-wrapper" }, /* @__PURE__ */ React32.createElement(
|
|
12626
12866
|
"input",
|
|
12627
12867
|
{
|
|
12628
12868
|
ref: inputRef,
|
|
@@ -12642,7 +12882,7 @@ function RichSelectEditor(props) {
|
|
|
12642
12882
|
"aria-controls": "richselect-dropdown",
|
|
12643
12883
|
autoComplete: "off"
|
|
12644
12884
|
}
|
|
12645
|
-
), /* @__PURE__ */
|
|
12885
|
+
), /* @__PURE__ */ React32.createElement("div", { className: "editor-input-actions" }, allowClear && value !== null && value !== void 0 && /* @__PURE__ */ React32.createElement(
|
|
12646
12886
|
"button",
|
|
12647
12887
|
{
|
|
12648
12888
|
type: "button",
|
|
@@ -12652,8 +12892,8 @@ function RichSelectEditor(props) {
|
|
|
12652
12892
|
tabIndex: -1
|
|
12653
12893
|
},
|
|
12654
12894
|
"\xD7"
|
|
12655
|
-
), /* @__PURE__ */
|
|
12656
|
-
isOpen && /* @__PURE__ */
|
|
12895
|
+
), /* @__PURE__ */ React32.createElement("span", { className: "editor-dropdown-icon", "aria-hidden": "true" }, "\u25BC"))),
|
|
12896
|
+
isOpen && /* @__PURE__ */ React32.createElement(
|
|
12657
12897
|
"div",
|
|
12658
12898
|
{
|
|
12659
12899
|
ref: dropdownRef,
|
|
@@ -12662,7 +12902,7 @@ function RichSelectEditor(props) {
|
|
|
12662
12902
|
role: "listbox",
|
|
12663
12903
|
style: { maxHeight: maxDropdownHeight }
|
|
12664
12904
|
},
|
|
12665
|
-
filteredOptions.length === 0 ? /* @__PURE__ */
|
|
12905
|
+
filteredOptions.length === 0 ? /* @__PURE__ */ React32.createElement("div", { className: "editor-dropdown-empty" }, "No options found") : filteredOptions.map((option, index) => /* @__PURE__ */ React32.createElement(
|
|
12666
12906
|
"div",
|
|
12667
12907
|
{
|
|
12668
12908
|
key: option.value,
|
|
@@ -12684,7 +12924,7 @@ function RichSelectEditor(props) {
|
|
|
12684
12924
|
RichSelectEditor.displayName = "RichSelectEditor";
|
|
12685
12925
|
|
|
12686
12926
|
// src/editors/DateEditor.tsx
|
|
12687
|
-
import
|
|
12927
|
+
import React33, { useState as useState22, useRef as useRef17, useMemo as useMemo10 } from "react";
|
|
12688
12928
|
function DateEditor(props) {
|
|
12689
12929
|
const {
|
|
12690
12930
|
value,
|
|
@@ -12710,7 +12950,7 @@ function DateEditor(props) {
|
|
|
12710
12950
|
const parsed = new Date(value);
|
|
12711
12951
|
return isNaN(parsed.getTime()) ? null : parsed;
|
|
12712
12952
|
}, [value]);
|
|
12713
|
-
|
|
12953
|
+
React33.useEffect(() => {
|
|
12714
12954
|
if (parsedValue) {
|
|
12715
12955
|
setInputValue(formatDate(parsedValue, dateFormat, showTime));
|
|
12716
12956
|
setViewDate(parsedValue);
|
|
@@ -12783,14 +13023,14 @@ function DateEditor(props) {
|
|
|
12783
13023
|
const calendarDays = useMemo10(() => {
|
|
12784
13024
|
return generateCalendarDays(viewDate, parsedValue, minDate, maxDate);
|
|
12785
13025
|
}, [viewDate, parsedValue, minDate, maxDate]);
|
|
12786
|
-
return /* @__PURE__ */
|
|
13026
|
+
return /* @__PURE__ */ React33.createElement(
|
|
12787
13027
|
"div",
|
|
12788
13028
|
{
|
|
12789
13029
|
ref: containerRef,
|
|
12790
13030
|
className: "editor-container editor-date-container",
|
|
12791
13031
|
onKeyDown: handleKeyDown
|
|
12792
13032
|
},
|
|
12793
|
-
/* @__PURE__ */
|
|
13033
|
+
/* @__PURE__ */ React33.createElement("div", { className: "editor-input-wrapper" }, /* @__PURE__ */ React33.createElement(
|
|
12794
13034
|
"input",
|
|
12795
13035
|
{
|
|
12796
13036
|
ref: inputRef,
|
|
@@ -12803,8 +13043,8 @@ function DateEditor(props) {
|
|
|
12803
13043
|
"aria-label": "Date input",
|
|
12804
13044
|
autoComplete: "off"
|
|
12805
13045
|
}
|
|
12806
|
-
), /* @__PURE__ */
|
|
12807
|
-
isOpen && /* @__PURE__ */
|
|
13046
|
+
), /* @__PURE__ */ React33.createElement("span", { className: "editor-calendar-icon", "aria-hidden": "true" }, "\u{1F4C5}")),
|
|
13047
|
+
isOpen && /* @__PURE__ */ React33.createElement("div", { ref: calendarRef, className: "editor-dropdown editor-calendar" }, /* @__PURE__ */ React33.createElement("div", { className: "editor-calendar-header" }, /* @__PURE__ */ React33.createElement(
|
|
12808
13048
|
"button",
|
|
12809
13049
|
{
|
|
12810
13050
|
type: "button",
|
|
@@ -12813,10 +13053,10 @@ function DateEditor(props) {
|
|
|
12813
13053
|
"aria-label": "Previous month"
|
|
12814
13054
|
},
|
|
12815
13055
|
"\u2039"
|
|
12816
|
-
), /* @__PURE__ */
|
|
13056
|
+
), /* @__PURE__ */ React33.createElement("div", { className: "editor-calendar-title" }, viewDate.toLocaleDateString("en-US", {
|
|
12817
13057
|
month: "long",
|
|
12818
13058
|
year: "numeric"
|
|
12819
|
-
})), /* @__PURE__ */
|
|
13059
|
+
})), /* @__PURE__ */ React33.createElement(
|
|
12820
13060
|
"button",
|
|
12821
13061
|
{
|
|
12822
13062
|
type: "button",
|
|
@@ -12825,7 +13065,7 @@ function DateEditor(props) {
|
|
|
12825
13065
|
"aria-label": "Next month"
|
|
12826
13066
|
},
|
|
12827
13067
|
"\u203A"
|
|
12828
|
-
)), /* @__PURE__ */
|
|
13068
|
+
)), /* @__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
13069
|
"button",
|
|
12830
13070
|
{
|
|
12831
13071
|
key: index,
|
|
@@ -12836,7 +13076,7 @@ function DateEditor(props) {
|
|
|
12836
13076
|
"aria-label": day.date ? day.date.toDateString() : ""
|
|
12837
13077
|
},
|
|
12838
13078
|
day.label
|
|
12839
|
-
))), showTime && /* @__PURE__ */
|
|
13079
|
+
))), showTime && /* @__PURE__ */ React33.createElement("div", { className: "editor-calendar-time" }, /* @__PURE__ */ React33.createElement(
|
|
12840
13080
|
"input",
|
|
12841
13081
|
{
|
|
12842
13082
|
type: "time",
|
|
@@ -12949,7 +13189,7 @@ function isDateDisabled(date, minDate, maxDate) {
|
|
|
12949
13189
|
}
|
|
12950
13190
|
|
|
12951
13191
|
// src/editors/NumericEditor.tsx
|
|
12952
|
-
import
|
|
13192
|
+
import React34, { useState as useState23, useEffect as useEffect16 } from "react";
|
|
12953
13193
|
function NumericEditor(props) {
|
|
12954
13194
|
const {
|
|
12955
13195
|
value,
|
|
@@ -13059,7 +13299,7 @@ function NumericEditor(props) {
|
|
|
13059
13299
|
handleEditorKeyDown(e);
|
|
13060
13300
|
};
|
|
13061
13301
|
const displayValue = isFocused ? inputValue : inputValue ? `${prefix}${inputValue}${suffix}` : "";
|
|
13062
|
-
return /* @__PURE__ */
|
|
13302
|
+
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
13303
|
"input",
|
|
13064
13304
|
{
|
|
13065
13305
|
ref: inputRef,
|
|
@@ -13077,7 +13317,7 @@ function NumericEditor(props) {
|
|
|
13077
13317
|
"aria-valuenow": value ?? void 0,
|
|
13078
13318
|
autoComplete: "off"
|
|
13079
13319
|
}
|
|
13080
|
-
), suffix && !isFocused && /* @__PURE__ */
|
|
13320
|
+
), suffix && !isFocused && /* @__PURE__ */ React34.createElement("span", { className: "editor-numeric-suffix" }, suffix), showSteppers && /* @__PURE__ */ React34.createElement("div", { className: "editor-numeric-steppers" }, /* @__PURE__ */ React34.createElement(
|
|
13081
13321
|
"button",
|
|
13082
13322
|
{
|
|
13083
13323
|
type: "button",
|
|
@@ -13089,7 +13329,7 @@ function NumericEditor(props) {
|
|
|
13089
13329
|
tabIndex: -1
|
|
13090
13330
|
},
|
|
13091
13331
|
"\u25B2"
|
|
13092
|
-
), /* @__PURE__ */
|
|
13332
|
+
), /* @__PURE__ */ React34.createElement(
|
|
13093
13333
|
"button",
|
|
13094
13334
|
{
|
|
13095
13335
|
type: "button",
|
|
@@ -13101,12 +13341,12 @@ function NumericEditor(props) {
|
|
|
13101
13341
|
tabIndex: -1
|
|
13102
13342
|
},
|
|
13103
13343
|
"\u25BC"
|
|
13104
|
-
))), (min !== void 0 || max !== void 0) && /* @__PURE__ */
|
|
13344
|
+
))), (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
13345
|
}
|
|
13106
13346
|
NumericEditor.displayName = "NumericEditor";
|
|
13107
13347
|
|
|
13108
13348
|
// src/editors/MultiSelectEditor.tsx
|
|
13109
|
-
import
|
|
13349
|
+
import React35, { useState as useState24, useRef as useRef18, useMemo as useMemo11 } from "react";
|
|
13110
13350
|
function MultiSelectEditor(props) {
|
|
13111
13351
|
const {
|
|
13112
13352
|
value = [],
|
|
@@ -13229,20 +13469,20 @@ function MultiSelectEditor(props) {
|
|
|
13229
13469
|
};
|
|
13230
13470
|
const visibleTags = selectedOptions.slice(0, maxTagCount);
|
|
13231
13471
|
const collapsedCount = Math.max(0, selectedOptions.length - maxTagCount);
|
|
13232
|
-
return /* @__PURE__ */
|
|
13472
|
+
return /* @__PURE__ */ React35.createElement(
|
|
13233
13473
|
"div",
|
|
13234
13474
|
{
|
|
13235
13475
|
ref: containerRef,
|
|
13236
13476
|
className: "editor-container editor-multiselect-container",
|
|
13237
13477
|
onKeyDown: handleCombinedKeyDown
|
|
13238
13478
|
},
|
|
13239
|
-
/* @__PURE__ */
|
|
13479
|
+
/* @__PURE__ */ React35.createElement(
|
|
13240
13480
|
"div",
|
|
13241
13481
|
{
|
|
13242
13482
|
ref: tagContainerRef,
|
|
13243
13483
|
className: "editor-input-wrapper editor-multiselect-wrapper"
|
|
13244
13484
|
},
|
|
13245
|
-
/* @__PURE__ */
|
|
13485
|
+
/* @__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
13486
|
"button",
|
|
13247
13487
|
{
|
|
13248
13488
|
type: "button",
|
|
@@ -13252,8 +13492,8 @@ function MultiSelectEditor(props) {
|
|
|
13252
13492
|
tabIndex: -1
|
|
13253
13493
|
},
|
|
13254
13494
|
"\xD7"
|
|
13255
|
-
))), collapsedCount > 0 && /* @__PURE__ */
|
|
13256
|
-
/* @__PURE__ */
|
|
13495
|
+
))), collapsedCount > 0 && /* @__PURE__ */ React35.createElement("div", { className: "editor-tag editor-tag-collapsed" }, "+", collapsedCount)),
|
|
13496
|
+
/* @__PURE__ */ React35.createElement(
|
|
13257
13497
|
"input",
|
|
13258
13498
|
{
|
|
13259
13499
|
ref: inputRef,
|
|
@@ -13272,9 +13512,9 @@ function MultiSelectEditor(props) {
|
|
|
13272
13512
|
autoComplete: "off"
|
|
13273
13513
|
}
|
|
13274
13514
|
),
|
|
13275
|
-
/* @__PURE__ */
|
|
13515
|
+
/* @__PURE__ */ React35.createElement("span", { className: "editor-dropdown-icon", "aria-hidden": "true" }, "\u25BC")
|
|
13276
13516
|
),
|
|
13277
|
-
isOpen && /* @__PURE__ */
|
|
13517
|
+
isOpen && /* @__PURE__ */ React35.createElement(
|
|
13278
13518
|
"div",
|
|
13279
13519
|
{
|
|
13280
13520
|
ref: dropdownRef,
|
|
@@ -13284,9 +13524,9 @@ function MultiSelectEditor(props) {
|
|
|
13284
13524
|
"aria-multiselectable": "true",
|
|
13285
13525
|
style: { maxHeight: maxDropdownHeight }
|
|
13286
13526
|
},
|
|
13287
|
-
filteredOptions.length === 0 ? /* @__PURE__ */
|
|
13527
|
+
filteredOptions.length === 0 ? /* @__PURE__ */ React35.createElement("div", { className: "editor-dropdown-empty" }, "No options found") : filteredOptions.map((option, index) => {
|
|
13288
13528
|
const isSelected = selectedValues.includes(option.value);
|
|
13289
|
-
return /* @__PURE__ */
|
|
13529
|
+
return /* @__PURE__ */ React35.createElement(
|
|
13290
13530
|
"div",
|
|
13291
13531
|
{
|
|
13292
13532
|
key: option.value,
|
|
@@ -13297,7 +13537,7 @@ function MultiSelectEditor(props) {
|
|
|
13297
13537
|
onClick: () => handleToggleOption(option),
|
|
13298
13538
|
onMouseEnter: () => !option.disabled && setFocusedIndex(index)
|
|
13299
13539
|
},
|
|
13300
|
-
/* @__PURE__ */
|
|
13540
|
+
/* @__PURE__ */ React35.createElement(
|
|
13301
13541
|
"input",
|
|
13302
13542
|
{
|
|
13303
13543
|
type: "checkbox",
|
|
@@ -13310,7 +13550,7 @@ function MultiSelectEditor(props) {
|
|
|
13310
13550
|
"aria-hidden": "true"
|
|
13311
13551
|
}
|
|
13312
13552
|
),
|
|
13313
|
-
/* @__PURE__ */
|
|
13553
|
+
/* @__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
13554
|
);
|
|
13315
13555
|
})
|
|
13316
13556
|
)
|
|
@@ -13319,7 +13559,7 @@ function MultiSelectEditor(props) {
|
|
|
13319
13559
|
MultiSelectEditor.displayName = "MultiSelectEditor";
|
|
13320
13560
|
|
|
13321
13561
|
// src/editors/MarkdownEditor.tsx
|
|
13322
|
-
import
|
|
13562
|
+
import React36, { useState as useState25, useRef as useRef19, useMemo as useMemo12 } from "react";
|
|
13323
13563
|
function MarkdownEditor(props) {
|
|
13324
13564
|
const {
|
|
13325
13565
|
value = "",
|
|
@@ -13430,14 +13670,14 @@ function MarkdownEditor(props) {
|
|
|
13430
13670
|
const previewHtml = useMemo12(() => {
|
|
13431
13671
|
return renderMarkdownPreview(internalValue);
|
|
13432
13672
|
}, [internalValue]);
|
|
13433
|
-
return /* @__PURE__ */
|
|
13673
|
+
return /* @__PURE__ */ React36.createElement(
|
|
13434
13674
|
"div",
|
|
13435
13675
|
{
|
|
13436
13676
|
ref: containerRef,
|
|
13437
13677
|
className: "editor-container editor-markdown-container",
|
|
13438
13678
|
style: { minHeight }
|
|
13439
13679
|
},
|
|
13440
|
-
/* @__PURE__ */
|
|
13680
|
+
/* @__PURE__ */ React36.createElement("div", { className: "editor-markdown-toolbar" }, /* @__PURE__ */ React36.createElement("div", { className: "editor-markdown-toolbar-group" }, /* @__PURE__ */ React36.createElement(
|
|
13441
13681
|
"button",
|
|
13442
13682
|
{
|
|
13443
13683
|
type: "button",
|
|
@@ -13456,8 +13696,8 @@ function MarkdownEditor(props) {
|
|
|
13456
13696
|
title: "Bold (Ctrl+B)",
|
|
13457
13697
|
"aria-label": "Bold"
|
|
13458
13698
|
},
|
|
13459
|
-
/* @__PURE__ */
|
|
13460
|
-
), /* @__PURE__ */
|
|
13699
|
+
/* @__PURE__ */ React36.createElement("strong", null, "B")
|
|
13700
|
+
), /* @__PURE__ */ React36.createElement(
|
|
13461
13701
|
"button",
|
|
13462
13702
|
{
|
|
13463
13703
|
type: "button",
|
|
@@ -13476,8 +13716,8 @@ function MarkdownEditor(props) {
|
|
|
13476
13716
|
title: "Italic (Ctrl+I)",
|
|
13477
13717
|
"aria-label": "Italic"
|
|
13478
13718
|
},
|
|
13479
|
-
/* @__PURE__ */
|
|
13480
|
-
), /* @__PURE__ */
|
|
13719
|
+
/* @__PURE__ */ React36.createElement("em", null, "I")
|
|
13720
|
+
), /* @__PURE__ */ React36.createElement(
|
|
13481
13721
|
"button",
|
|
13482
13722
|
{
|
|
13483
13723
|
type: "button",
|
|
@@ -13497,7 +13737,7 @@ function MarkdownEditor(props) {
|
|
|
13497
13737
|
"aria-label": "Link"
|
|
13498
13738
|
},
|
|
13499
13739
|
"\u{1F517}"
|
|
13500
|
-
)), /* @__PURE__ */
|
|
13740
|
+
)), /* @__PURE__ */ React36.createElement("div", { className: "editor-markdown-toolbar-group" }, /* @__PURE__ */ React36.createElement(
|
|
13501
13741
|
"button",
|
|
13502
13742
|
{
|
|
13503
13743
|
type: "button",
|
|
@@ -13509,7 +13749,7 @@ function MarkdownEditor(props) {
|
|
|
13509
13749
|
},
|
|
13510
13750
|
"\u{1F441}"
|
|
13511
13751
|
))),
|
|
13512
|
-
/* @__PURE__ */
|
|
13752
|
+
/* @__PURE__ */ React36.createElement("div", { className: `editor-markdown-content ${showPreviewPanel ? "split" : ""}` }, /* @__PURE__ */ React36.createElement("div", { className: "editor-markdown-editor" }, /* @__PURE__ */ React36.createElement(
|
|
13513
13753
|
"textarea",
|
|
13514
13754
|
{
|
|
13515
13755
|
ref: textareaRef,
|
|
@@ -13523,14 +13763,14 @@ function MarkdownEditor(props) {
|
|
|
13523
13763
|
"aria-label": "Markdown editor",
|
|
13524
13764
|
style: { maxHeight }
|
|
13525
13765
|
}
|
|
13526
|
-
), /* @__PURE__ */
|
|
13766
|
+
), /* @__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
13767
|
"div",
|
|
13528
13768
|
{
|
|
13529
13769
|
className: "editor-markdown-preview-content",
|
|
13530
13770
|
dangerouslySetInnerHTML: { __html: previewHtml }
|
|
13531
13771
|
}
|
|
13532
13772
|
))),
|
|
13533
|
-
/* @__PURE__ */
|
|
13773
|
+
/* @__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
13774
|
"button",
|
|
13535
13775
|
{
|
|
13536
13776
|
type: "button",
|
|
@@ -13538,7 +13778,7 @@ function MarkdownEditor(props) {
|
|
|
13538
13778
|
onClick: onCancel
|
|
13539
13779
|
},
|
|
13540
13780
|
"Cancel"
|
|
13541
|
-
), /* @__PURE__ */
|
|
13781
|
+
), /* @__PURE__ */ React36.createElement(
|
|
13542
13782
|
"button",
|
|
13543
13783
|
{
|
|
13544
13784
|
type: "button",
|
|
@@ -13736,7 +13976,7 @@ function updateChartTheme(config, newTheme) {
|
|
|
13736
13976
|
}
|
|
13737
13977
|
|
|
13738
13978
|
// src/charts/QuickChart.tsx
|
|
13739
|
-
import
|
|
13979
|
+
import React37, { useRef as useRef20 } from "react";
|
|
13740
13980
|
import {
|
|
13741
13981
|
LineChart,
|
|
13742
13982
|
Line,
|
|
@@ -13822,7 +14062,7 @@ var QuickChart = ({
|
|
|
13822
14062
|
};
|
|
13823
14063
|
switch (config.type) {
|
|
13824
14064
|
case "line":
|
|
13825
|
-
return /* @__PURE__ */
|
|
14065
|
+
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
14066
|
Tooltip2,
|
|
13827
14067
|
{
|
|
13828
14068
|
contentStyle: {
|
|
@@ -13831,7 +14071,7 @@ var QuickChart = ({
|
|
|
13831
14071
|
color: theme === "dark" ? "#fff" : "#000"
|
|
13832
14072
|
}
|
|
13833
14073
|
}
|
|
13834
|
-
), /* @__PURE__ */
|
|
14074
|
+
), /* @__PURE__ */ React37.createElement(Legend, null), config.series.map((series) => /* @__PURE__ */ React37.createElement(
|
|
13835
14075
|
Line,
|
|
13836
14076
|
{
|
|
13837
14077
|
key: series.name,
|
|
@@ -13844,7 +14084,7 @@ var QuickChart = ({
|
|
|
13844
14084
|
}
|
|
13845
14085
|
))));
|
|
13846
14086
|
case "bar":
|
|
13847
|
-
return /* @__PURE__ */
|
|
14087
|
+
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
14088
|
Tooltip2,
|
|
13849
14089
|
{
|
|
13850
14090
|
contentStyle: {
|
|
@@ -13853,9 +14093,9 @@ var QuickChart = ({
|
|
|
13853
14093
|
color: theme === "dark" ? "#fff" : "#000"
|
|
13854
14094
|
}
|
|
13855
14095
|
}
|
|
13856
|
-
), /* @__PURE__ */
|
|
14096
|
+
), /* @__PURE__ */ React37.createElement(Legend, null), config.series.map((series) => /* @__PURE__ */ React37.createElement(Bar, { key: series.name, dataKey: series.name, fill: series.color }))));
|
|
13857
14097
|
case "area":
|
|
13858
|
-
return /* @__PURE__ */
|
|
14098
|
+
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
14099
|
Tooltip2,
|
|
13860
14100
|
{
|
|
13861
14101
|
contentStyle: {
|
|
@@ -13864,7 +14104,7 @@ var QuickChart = ({
|
|
|
13864
14104
|
color: theme === "dark" ? "#fff" : "#000"
|
|
13865
14105
|
}
|
|
13866
14106
|
}
|
|
13867
|
-
), /* @__PURE__ */
|
|
14107
|
+
), /* @__PURE__ */ React37.createElement(Legend, null), config.series.map((series) => /* @__PURE__ */ React37.createElement(
|
|
13868
14108
|
Area,
|
|
13869
14109
|
{
|
|
13870
14110
|
key: series.name,
|
|
@@ -13876,7 +14116,7 @@ var QuickChart = ({
|
|
|
13876
14116
|
}
|
|
13877
14117
|
))));
|
|
13878
14118
|
case "pie":
|
|
13879
|
-
return /* @__PURE__ */
|
|
14119
|
+
return /* @__PURE__ */ React37.createElement(ResponsiveContainer, { width: "100%", height: "100%" }, /* @__PURE__ */ React37.createElement(PieChart, null, /* @__PURE__ */ React37.createElement(
|
|
13880
14120
|
Pie,
|
|
13881
14121
|
{
|
|
13882
14122
|
data: pieData,
|
|
@@ -13888,14 +14128,14 @@ var QuickChart = ({
|
|
|
13888
14128
|
fill: "#8884d8",
|
|
13889
14129
|
dataKey: "value"
|
|
13890
14130
|
},
|
|
13891
|
-
pieData.map((_, index) => /* @__PURE__ */
|
|
14131
|
+
pieData.map((_, index) => /* @__PURE__ */ React37.createElement(
|
|
13892
14132
|
Cell,
|
|
13893
14133
|
{
|
|
13894
14134
|
key: `cell-${index}`,
|
|
13895
14135
|
fill: DEFAULT_COLORS[index % DEFAULT_COLORS.length]
|
|
13896
14136
|
}
|
|
13897
14137
|
))
|
|
13898
|
-
), /* @__PURE__ */
|
|
14138
|
+
), /* @__PURE__ */ React37.createElement(
|
|
13899
14139
|
Tooltip2,
|
|
13900
14140
|
{
|
|
13901
14141
|
contentStyle: {
|
|
@@ -13904,19 +14144,19 @@ var QuickChart = ({
|
|
|
13904
14144
|
color: theme === "dark" ? "#fff" : "#000"
|
|
13905
14145
|
}
|
|
13906
14146
|
}
|
|
13907
|
-
), /* @__PURE__ */
|
|
14147
|
+
), /* @__PURE__ */ React37.createElement(Legend, null)));
|
|
13908
14148
|
default:
|
|
13909
|
-
return /* @__PURE__ */
|
|
14149
|
+
return /* @__PURE__ */ React37.createElement("div", null, "Unsupported chart type");
|
|
13910
14150
|
}
|
|
13911
14151
|
};
|
|
13912
|
-
return /* @__PURE__ */
|
|
14152
|
+
return /* @__PURE__ */ React37.createElement(
|
|
13913
14153
|
"div",
|
|
13914
14154
|
{
|
|
13915
14155
|
ref: chartRef,
|
|
13916
14156
|
className: `quick-chart quick-chart--${theme}`,
|
|
13917
14157
|
style: { width, height }
|
|
13918
14158
|
},
|
|
13919
|
-
/* @__PURE__ */
|
|
14159
|
+
/* @__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
14160
|
"button",
|
|
13921
14161
|
{
|
|
13922
14162
|
key: type,
|
|
@@ -13926,7 +14166,7 @@ var QuickChart = ({
|
|
|
13926
14166
|
"aria-label": `Switch to ${type} chart`
|
|
13927
14167
|
},
|
|
13928
14168
|
chartTypeIcon(type)
|
|
13929
|
-
))), allowThemeSwitch && onToggleTheme && /* @__PURE__ */
|
|
14169
|
+
))), allowThemeSwitch && onToggleTheme && /* @__PURE__ */ React37.createElement(
|
|
13930
14170
|
"button",
|
|
13931
14171
|
{
|
|
13932
14172
|
className: "quick-chart__btn",
|
|
@@ -13935,7 +14175,7 @@ var QuickChart = ({
|
|
|
13935
14175
|
"aria-label": "Toggle theme"
|
|
13936
14176
|
},
|
|
13937
14177
|
theme === "dark" ? "\u2600\uFE0F" : "\u{1F319}"
|
|
13938
|
-
), /* @__PURE__ */
|
|
14178
|
+
), /* @__PURE__ */ React37.createElement(
|
|
13939
14179
|
"button",
|
|
13940
14180
|
{
|
|
13941
14181
|
className: "quick-chart__btn",
|
|
@@ -13944,7 +14184,7 @@ var QuickChart = ({
|
|
|
13944
14184
|
"aria-label": "Export chart as PNG"
|
|
13945
14185
|
},
|
|
13946
14186
|
"\u{1F4E5}"
|
|
13947
|
-
), onClose && /* @__PURE__ */
|
|
14187
|
+
), onClose && /* @__PURE__ */ React37.createElement(
|
|
13948
14188
|
"button",
|
|
13949
14189
|
{
|
|
13950
14190
|
className: "quick-chart__btn quick-chart__close",
|
|
@@ -13954,12 +14194,12 @@ var QuickChart = ({
|
|
|
13954
14194
|
},
|
|
13955
14195
|
"\xD7"
|
|
13956
14196
|
))),
|
|
13957
|
-
/* @__PURE__ */
|
|
14197
|
+
/* @__PURE__ */ React37.createElement("div", { className: "quick-chart__body" }, renderChart())
|
|
13958
14198
|
);
|
|
13959
14199
|
};
|
|
13960
14200
|
|
|
13961
14201
|
// src/charts/ChartOverlay.tsx
|
|
13962
|
-
import
|
|
14202
|
+
import React38, { useEffect as useEffect17, useRef as useRef21, useState as useState26 } from "react";
|
|
13963
14203
|
var ChartOverlay = ({
|
|
13964
14204
|
config,
|
|
13965
14205
|
onClose,
|
|
@@ -14050,7 +14290,7 @@ var ChartOverlay = ({
|
|
|
14050
14290
|
document.addEventListener("keydown", handleKeyDown);
|
|
14051
14291
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
14052
14292
|
}, [onClose]);
|
|
14053
|
-
return /* @__PURE__ */
|
|
14293
|
+
return /* @__PURE__ */ React38.createElement("div", { className: "chart-overlay" }, /* @__PURE__ */ React38.createElement("div", { className: "chart-overlay__backdrop", onClick: onClose }), /* @__PURE__ */ React38.createElement(
|
|
14054
14294
|
"div",
|
|
14055
14295
|
{
|
|
14056
14296
|
ref: overlayRef,
|
|
@@ -14063,7 +14303,7 @@ var ChartOverlay = ({
|
|
|
14063
14303
|
},
|
|
14064
14304
|
onMouseDown: handleMouseDown
|
|
14065
14305
|
},
|
|
14066
|
-
/* @__PURE__ */
|
|
14306
|
+
/* @__PURE__ */ React38.createElement(
|
|
14067
14307
|
QuickChart,
|
|
14068
14308
|
{
|
|
14069
14309
|
config,
|