react-open-source-grid 1.7.15 → 1.7.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-BzDbdtZY.css +1 -0
- package/dist/assets/{index-BCQXykGJ.js → index-DbTnZTkL.js} +279 -131
- package/dist/assets/index.js +1 -1
- package/dist/assets/{layoutPersistence-DVnlRvDW.js → layoutPersistence-BomhL2-B.js} +1 -1
- package/dist/index.html +2 -2
- package/dist/lib/components/DataGrid/ColumnFilters.d.ts +3 -1
- package/dist/lib/components/DataGrid/DetailRow.d.ts +19 -0
- package/dist/lib/components/DataGrid/GridBody.d.ts +3 -1
- package/dist/lib/components/DataGrid/GridHeader.d.ts +3 -1
- package/dist/lib/components/DataGrid/MasterDetailCell.d.ts +14 -0
- package/dist/lib/components/DataGrid/index.d.ts +1 -1
- package/dist/lib/components/DataGrid/types.d.ts +36 -0
- package/dist/lib/components/MasterDetailDemo.d.ts +2 -0
- package/dist/lib/index.cjs +932 -693
- package/dist/lib/index.css +103 -0
- package/dist/lib/index.js +679 -440
- package/package.json +1 -1
- package/dist/assets/index-B400HUc-.css +0 -1
package/dist/assets/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './index-
|
|
1
|
+
export * from './index-DbTnZTkL.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./index-
|
|
1
|
+
import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./index-DbTnZTkL.js";export{e as createPreset};
|
package/dist/index.html
CHANGED
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
}
|
|
71
71
|
})();
|
|
72
72
|
</script>
|
|
73
|
-
<script type="module" crossorigin src="/assets/index-
|
|
74
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
73
|
+
<script type="module" crossorigin src="/assets/index-DbTnZTkL.js"></script>
|
|
74
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BzDbdtZY.css">
|
|
75
75
|
</head>
|
|
76
76
|
<body>
|
|
77
77
|
<!-- SEO Content Section -->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Column, FilterConfig, GridAction, Row } from './types';
|
|
2
|
+
import type { Column, FilterConfig, GridAction, Row, MasterDetailConfig, DragRowConfig } from './types';
|
|
3
3
|
interface ColumnFiltersProps {
|
|
4
4
|
columns: Column[];
|
|
5
5
|
displayColumnOrder: string[];
|
|
@@ -11,6 +11,8 @@ interface ColumnFiltersProps {
|
|
|
11
11
|
pinnedLeft: string[];
|
|
12
12
|
pinnedRight: string[];
|
|
13
13
|
rows: Row[];
|
|
14
|
+
masterDetailConfig?: MasterDetailConfig;
|
|
15
|
+
dragRowConfig?: DragRowConfig;
|
|
14
16
|
}
|
|
15
17
|
export declare const ColumnFilters: React.FC<ColumnFiltersProps>;
|
|
16
18
|
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Row } from './types';
|
|
3
|
+
import './MasterDetailCell.css';
|
|
4
|
+
interface DetailRowProps {
|
|
5
|
+
masterRow: Row;
|
|
6
|
+
rowIndex: number;
|
|
7
|
+
renderDetailRow: (params: {
|
|
8
|
+
masterRow: Row;
|
|
9
|
+
rowIndex: number;
|
|
10
|
+
}) => React.ReactNode;
|
|
11
|
+
columnCount: number;
|
|
12
|
+
detailRowHeight?: number;
|
|
13
|
+
detailRowAutoHeight?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* DetailRow component - renders the detail content below an expanded master row
|
|
17
|
+
*/
|
|
18
|
+
export declare const DetailRow: React.FC<DetailRowProps>;
|
|
19
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Column, Row, GridAction, EditState, FocusState, GroupedRow, AggregateConfig, VirtualScrollConfig, TreeNode, TreeConfig, DragRowConfig } from './types';
|
|
2
|
+
import type { Column, Row, GridAction, EditState, FocusState, GroupedRow, AggregateConfig, VirtualScrollConfig, TreeNode, TreeConfig, DragRowConfig, MasterDetailConfig, ExpandedMasterRows } from './types';
|
|
3
3
|
interface GridBodyProps {
|
|
4
4
|
columns: Column[];
|
|
5
5
|
rows: (Row | GroupedRow | TreeNode)[];
|
|
@@ -26,6 +26,8 @@ interface GridBodyProps {
|
|
|
26
26
|
virtualScrollConfig?: VirtualScrollConfig;
|
|
27
27
|
treeConfig?: TreeConfig;
|
|
28
28
|
dragRowConfig?: DragRowConfig;
|
|
29
|
+
masterDetailConfig?: MasterDetailConfig;
|
|
30
|
+
expandedMasterRows?: ExpandedMasterRows;
|
|
29
31
|
tableId?: string;
|
|
30
32
|
onRowReorder?: (rows: Row[]) => void;
|
|
31
33
|
onScroll?: (scrollTop: number, scrollLeft: number) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Column, GridAction, SortConfig } from './types';
|
|
2
|
+
import type { Column, GridAction, SortConfig, MasterDetailConfig, DragRowConfig } from './types';
|
|
3
3
|
interface GridHeaderProps {
|
|
4
4
|
columns: Column[];
|
|
5
5
|
columnOrder: string[];
|
|
@@ -12,6 +12,8 @@ interface GridHeaderProps {
|
|
|
12
12
|
pinnedLeft: string[];
|
|
13
13
|
pinnedRight: string[];
|
|
14
14
|
showColumnPinning: boolean;
|
|
15
|
+
masterDetailConfig?: MasterDetailConfig;
|
|
16
|
+
dragRowConfig?: DragRowConfig;
|
|
15
17
|
onContextMenu?: (event: React.MouseEvent, column: Column, columnIndex: number) => void;
|
|
16
18
|
}
|
|
17
19
|
export declare const GridHeader: React.FC<GridHeaderProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Row } from './types';
|
|
3
|
+
import './MasterDetailCell.css';
|
|
4
|
+
interface MasterDetailCellProps {
|
|
5
|
+
row: Row;
|
|
6
|
+
isExpanded: boolean;
|
|
7
|
+
isMasterRow: boolean;
|
|
8
|
+
onToggle: () => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* MasterDetailCell component - renders the expand/collapse icon for master rows
|
|
12
|
+
*/
|
|
13
|
+
export declare const MasterDetailCell: React.FC<MasterDetailCellProps>;
|
|
14
|
+
export {};
|
|
@@ -21,7 +21,7 @@ export { useDensityMode } from './useDensityMode';
|
|
|
21
21
|
export type { UseDensityModeOptions, UseDensityModeReturn } from './useDensityMode';
|
|
22
22
|
export { getDensityConfig, getDensityModes, getDensityLabel, generateDensityCSS, saveDensityMode, loadDensityMode, densityConfigs } from './densityModes';
|
|
23
23
|
export type { DensityMode, DensityConfig } from './densityModes';
|
|
24
|
-
export type { Column, Row, DataGridProps, GroupedRow, AggregateFunction, AggregateConfig, FooterConfig, VirtualScrollConfig, FilterType, FilterValue, FilterCondition, AdvancedFilterValue, FilterConfig, LayoutPreset, StorageStrategy, StorageAdapter, ServerConfig, UserProfileConfig, PersistenceConfig, TreeNode, TreeConfig, ExpandedNodes, RowPinConfig, ContextMenuItem, ContextMenuConfig, ContextMenuEvent, TooltipConfig, TooltipContent, TooltipPlacement } from './types';
|
|
24
|
+
export type { Column, Row, DataGridProps, GroupedRow, AggregateFunction, AggregateConfig, FooterConfig, VirtualScrollConfig, FilterType, FilterValue, FilterCondition, AdvancedFilterValue, FilterConfig, LayoutPreset, StorageStrategy, StorageAdapter, ServerConfig, UserProfileConfig, PersistenceConfig, TreeNode, TreeConfig, ExpandedNodes, RowPinConfig, ContextMenuItem, ContextMenuConfig, ContextMenuEvent, TooltipConfig, TooltipContent, TooltipPlacement, MasterDetailConfig, ExpandedMasterRows } from './types';
|
|
25
25
|
export type { ServerSideDataSourceConfig, ServerSideRequest, ServerSideResponse } from './ServerSideDataSource';
|
|
26
26
|
export type { InfiniteScrollDataGridProps } from './InfiniteScrollDataGrid';
|
|
27
27
|
export { handleExport, exportToCSV, exportToXLSX, generateFilename } from './exportUtils';
|
|
@@ -136,6 +136,7 @@ export interface GridState {
|
|
|
136
136
|
dragState: DragState;
|
|
137
137
|
pinnedRowsTop: (string | number)[];
|
|
138
138
|
pinnedRowsBottom: (string | number)[];
|
|
139
|
+
detailRowState: DetailRowState;
|
|
139
140
|
}
|
|
140
141
|
export type GridAction = {
|
|
141
142
|
type: 'SET_SORT';
|
|
@@ -269,6 +270,18 @@ export type GridAction = {
|
|
|
269
270
|
} | {
|
|
270
271
|
type: 'UNPIN_ROW';
|
|
271
272
|
payload: string | number;
|
|
273
|
+
} | {
|
|
274
|
+
type: 'TOGGLE_MASTER_ROW';
|
|
275
|
+
payload: string | number;
|
|
276
|
+
} | {
|
|
277
|
+
type: 'EXPAND_MASTER_ROW';
|
|
278
|
+
payload: string | number;
|
|
279
|
+
} | {
|
|
280
|
+
type: 'COLLAPSE_MASTER_ROW';
|
|
281
|
+
payload: string | number;
|
|
282
|
+
} | {
|
|
283
|
+
type: 'SET_EXPANDED_MASTER_ROWS';
|
|
284
|
+
payload: ExpandedMasterRows;
|
|
272
285
|
} | {
|
|
273
286
|
type: 'SET_ROW_DATA';
|
|
274
287
|
payload: Row[];
|
|
@@ -513,6 +526,28 @@ export interface TooltipState {
|
|
|
513
526
|
content: TooltipContent | null;
|
|
514
527
|
targetRect: DOMRect | null;
|
|
515
528
|
}
|
|
529
|
+
export interface MasterDetailConfig {
|
|
530
|
+
enabled: boolean;
|
|
531
|
+
isRowMaster?: (row: Row) => boolean;
|
|
532
|
+
renderDetailRow: (params: {
|
|
533
|
+
masterRow: Row;
|
|
534
|
+
rowIndex: number;
|
|
535
|
+
}) => React.ReactNode;
|
|
536
|
+
detailRowHeight?: number;
|
|
537
|
+
detailRowAutoHeight?: boolean;
|
|
538
|
+
defaultExpandedMasterRowKeys?: (string | number)[];
|
|
539
|
+
onDetailRowToggled?: (params: {
|
|
540
|
+
masterRow: Row;
|
|
541
|
+
rowIndex: number;
|
|
542
|
+
isOpen: boolean;
|
|
543
|
+
}) => void;
|
|
544
|
+
}
|
|
545
|
+
export interface ExpandedMasterRows {
|
|
546
|
+
[rowKey: string]: boolean;
|
|
547
|
+
}
|
|
548
|
+
export interface DetailRowState {
|
|
549
|
+
expandedMasterRows: ExpandedMasterRows;
|
|
550
|
+
}
|
|
516
551
|
export interface DataGridProps {
|
|
517
552
|
columns: Column[];
|
|
518
553
|
rows: Row[];
|
|
@@ -528,6 +563,7 @@ export interface DataGridProps {
|
|
|
528
563
|
contextMenuConfig?: ContextMenuConfig;
|
|
529
564
|
tooltipConfig?: TooltipConfig;
|
|
530
565
|
pivotConfig?: PivotConfig | null;
|
|
566
|
+
masterDetailConfig?: MasterDetailConfig;
|
|
531
567
|
tableId?: string;
|
|
532
568
|
theme?: ThemeName;
|
|
533
569
|
densityMode?: DensityMode;
|