react-open-source-grid 1.5.3 → 1.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/App.d.ts +3 -0
- package/dist/lib/chunk-FG3FLQAE.js +296 -0
- package/dist/lib/components/AccessibilityDemo.d.ts +8 -0
- package/dist/lib/components/ApiReferencePage.d.ts +2 -0
- package/dist/lib/components/BenchmarkDemo.d.ts +2 -0
- package/dist/lib/components/CellRenderersDemo.d.ts +16 -0
- package/dist/lib/components/CodeBlock.d.ts +10 -0
- package/dist/lib/components/ColumnFiltersDemo.d.ts +5 -0
- package/dist/lib/components/CompleteApiReferencePage.d.ts +2 -0
- package/dist/lib/components/ContextMenuDemo.d.ts +12 -0
- package/dist/lib/components/DataGrid/ARCHITECTURE.md.d.ts +288 -0
- package/dist/lib/components/DataGrid/AdvancedFilterBuilder.d.ts +12 -0
- package/dist/lib/components/DataGrid/CellRenderers.d.ts +64 -0
- package/dist/lib/components/DataGrid/ColumnChooser.d.ts +12 -0
- package/dist/lib/components/DataGrid/ColumnFilters.d.ts +16 -0
- package/dist/lib/components/DataGrid/ContextMenu.d.ts +10 -0
- package/dist/lib/components/DataGrid/DataGrid.d.ts +22 -0
- package/dist/lib/components/DataGrid/DensityToggle.d.ts +23 -0
- package/dist/lib/components/DataGrid/DragHandle.d.ts +7 -0
- package/dist/lib/components/DataGrid/DraggableRow.d.ts +14 -0
- package/dist/lib/components/DataGrid/ExportMenu.d.ts +12 -0
- package/dist/lib/components/DataGrid/FacetedSearch.d.ts +29 -0
- package/dist/lib/components/DataGrid/FilteredSearchBar.d.ts +36 -0
- package/dist/lib/components/DataGrid/FocusTrap.d.ts +12 -0
- package/dist/lib/components/DataGrid/GridApiDemo.d.ts +6 -0
- package/dist/lib/components/DataGrid/GridBody.d.ts +42 -0
- package/dist/lib/components/DataGrid/GridFooter.d.ts +18 -0
- package/dist/lib/components/DataGrid/GridHeader.d.ts +18 -0
- package/dist/lib/components/DataGrid/GridPagination.d.ts +10 -0
- package/dist/lib/components/DataGrid/GroupByPanel.d.ts +9 -0
- package/dist/lib/components/DataGrid/GroupRow.d.ts +31 -0
- package/dist/lib/components/DataGrid/InfiniteScrollDataGrid.d.ts +39 -0
- package/dist/lib/components/DataGrid/LayoutPresetsManager.d.ts +11 -0
- package/dist/lib/components/DataGrid/MarketDataEngine.d.ts +165 -0
- package/dist/lib/components/DataGrid/MarketDataGrid.d.ts +33 -0
- package/dist/lib/components/DataGrid/MarketDataGridUtils.d.ts +13 -0
- package/dist/lib/components/DataGrid/ScreenReaderAnnouncer.d.ts +8 -0
- package/dist/lib/components/DataGrid/ServerSideDataSource.d.ts +136 -0
- package/dist/lib/components/DataGrid/ThemeSelector.d.ts +12 -0
- package/dist/lib/components/DataGrid/Tooltip.d.ts +15 -0
- package/dist/lib/components/DataGrid/TreeRow.d.ts +31 -0
- package/dist/lib/components/DataGrid/VirtualScroller.d.ts +35 -0
- package/dist/lib/components/DataGrid/WebSocketMockFeed.d.ts +121 -0
- package/dist/lib/components/DataGrid/aggregationUtils.d.ts +25 -0
- package/dist/lib/components/DataGrid/contextMenuUtils.d.ts +36 -0
- package/dist/lib/components/DataGrid/demos/TooltipDemo.d.ts +1 -0
- package/dist/lib/components/DataGrid/densityModes.d.ts +42 -0
- package/dist/lib/components/DataGrid/dragRowUtils.d.ts +98 -0
- package/dist/lib/components/DataGrid/exportUtils.d.ts +30 -0
- package/dist/lib/components/DataGrid/filterUtils.d.ts +17 -0
- package/dist/lib/components/DataGrid/gridApi.d.ts +142 -0
- package/dist/lib/components/DataGrid/gridApi.types.d.ts +348 -0
- package/dist/lib/components/DataGrid/gridReducer.d.ts +4 -0
- package/dist/lib/components/DataGrid/groupingUtils.d.ts +17 -0
- package/dist/lib/components/DataGrid/index.d.ts +41 -0
- package/dist/lib/components/DataGrid/layoutPersistence.d.ts +95 -0
- package/dist/lib/components/DataGrid/themes.d.ts +113 -0
- package/dist/lib/components/DataGrid/treeDataUtils.d.ts +97 -0
- package/dist/lib/components/DataGrid/types.d.ts +536 -0
- package/dist/lib/components/DataGrid/useContextMenu.d.ts +31 -0
- package/dist/lib/components/DataGrid/useDensityMode.d.ts +36 -0
- package/dist/lib/components/DataGrid/useFocusTrap.d.ts +14 -0
- package/dist/lib/components/DataGrid/useMarketData.d.ts +57 -0
- package/dist/lib/components/DataGrid/useScreenReaderAnnouncements.d.ts +23 -0
- package/dist/lib/components/DataGrid/useTooltip.d.ts +21 -0
- package/dist/lib/components/DemoGridPage.d.ts +2 -0
- package/dist/lib/components/DensityModeDemo.d.ts +12 -0
- package/dist/lib/components/FacetedSearchDemo.d.ts +8 -0
- package/dist/lib/components/FeatureGallery.d.ts +2 -0
- package/dist/lib/components/FilteredSearchDemo.d.ts +7 -0
- package/dist/lib/components/GridApiDemoPage.d.ts +2 -0
- package/dist/lib/components/HomePage.d.ts +1 -0
- package/dist/lib/components/InfiniteScrollDemo.d.ts +13 -0
- package/dist/lib/components/LayoutPersistenceDemo.d.ts +2 -0
- package/dist/lib/components/LiveMarketDemo.d.ts +18 -0
- package/dist/lib/components/MarketDataExamples.d.ts +42 -0
- package/dist/lib/components/RowDraggingDemo.d.ts +3 -0
- package/dist/lib/components/RowPinningDemo.d.ts +12 -0
- package/dist/lib/components/ThemesDemo.d.ts +17 -0
- package/dist/lib/components/TooltipDemo.d.ts +1 -0
- package/dist/lib/components/TreeDataDemo.d.ts +3 -0
- package/dist/lib/components/VirtualScrollDemo.d.ts +13 -0
- package/dist/lib/index.cjs +12233 -0
- package/dist/lib/index.css +465 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +11827 -0
- package/dist/lib/layoutPersistence-2MPTAEYI.js +20 -0
- package/dist/lib/main.d.ts +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DataGrid Theme System
|
|
3
|
+
* Provides multiple pre-built themes: Quartz, Alpine, Material, Dark
|
|
4
|
+
*/
|
|
5
|
+
export type ThemeName = 'quartz' | 'alpine' | 'material' | 'dark' | 'nord' | 'dracula' | 'solarized-light' | 'solarized-dark' | 'monokai' | 'one-dark';
|
|
6
|
+
export interface GridTheme {
|
|
7
|
+
name: ThemeName;
|
|
8
|
+
displayName: string;
|
|
9
|
+
colors: {
|
|
10
|
+
background: string;
|
|
11
|
+
backgroundAlt: string;
|
|
12
|
+
headerBackground: string;
|
|
13
|
+
footerBackground: string;
|
|
14
|
+
border: string;
|
|
15
|
+
borderLight: string;
|
|
16
|
+
text: string;
|
|
17
|
+
textSecondary: string;
|
|
18
|
+
textInverse: string;
|
|
19
|
+
headerText: string;
|
|
20
|
+
hover: string;
|
|
21
|
+
active: string;
|
|
22
|
+
selected: string;
|
|
23
|
+
primary: string;
|
|
24
|
+
primaryHover: string;
|
|
25
|
+
primaryLight: string;
|
|
26
|
+
primaryDark: string;
|
|
27
|
+
primaryBackground: string;
|
|
28
|
+
textMuted: string;
|
|
29
|
+
borderHover: string;
|
|
30
|
+
success: string;
|
|
31
|
+
warning: string;
|
|
32
|
+
error: string;
|
|
33
|
+
info: string;
|
|
34
|
+
};
|
|
35
|
+
spacing: {
|
|
36
|
+
cellPadding: string;
|
|
37
|
+
headerPadding: string;
|
|
38
|
+
rowHeight: string;
|
|
39
|
+
};
|
|
40
|
+
typography: {
|
|
41
|
+
fontFamily: string;
|
|
42
|
+
fontSize: string;
|
|
43
|
+
fontSizeSmall: string;
|
|
44
|
+
fontWeight: string;
|
|
45
|
+
headerFontWeight: string;
|
|
46
|
+
};
|
|
47
|
+
borders: {
|
|
48
|
+
width: string;
|
|
49
|
+
radius: string;
|
|
50
|
+
style: string;
|
|
51
|
+
};
|
|
52
|
+
shadows: {
|
|
53
|
+
light: string;
|
|
54
|
+
medium: string;
|
|
55
|
+
heavy: string;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Quartz Theme - Modern white with clean aesthetics
|
|
60
|
+
*/
|
|
61
|
+
export declare const quartzTheme: GridTheme;
|
|
62
|
+
/**
|
|
63
|
+
* Alpine Theme - Classic business with professional look
|
|
64
|
+
*/
|
|
65
|
+
export declare const alpineTheme: GridTheme;
|
|
66
|
+
/**
|
|
67
|
+
* Material Theme - Material Design inspired
|
|
68
|
+
*/
|
|
69
|
+
export declare const materialTheme: GridTheme;
|
|
70
|
+
/**
|
|
71
|
+
* Dark Theme - Dark mode for reduced eye strain
|
|
72
|
+
*/
|
|
73
|
+
export declare const darkTheme: GridTheme;
|
|
74
|
+
/**
|
|
75
|
+
* Nord Theme - Cool, arctic-inspired colors
|
|
76
|
+
*/
|
|
77
|
+
export declare const nordTheme: GridTheme;
|
|
78
|
+
/**
|
|
79
|
+
* Dracula Theme - Popular purple-tinted dark theme
|
|
80
|
+
*/
|
|
81
|
+
export declare const draculaTheme: GridTheme;
|
|
82
|
+
/**
|
|
83
|
+
* Solarized Light Theme - Precision colors for readability
|
|
84
|
+
*/
|
|
85
|
+
export declare const solarizedLightTheme: GridTheme;
|
|
86
|
+
/**
|
|
87
|
+
* Solarized Dark Theme - Dark variant of Solarized
|
|
88
|
+
*/
|
|
89
|
+
export declare const solarizedDarkTheme: GridTheme;
|
|
90
|
+
/**
|
|
91
|
+
* Monokai Theme - Vibrant colors on dark background
|
|
92
|
+
*/
|
|
93
|
+
export declare const monokaiTheme: GridTheme;
|
|
94
|
+
/**
|
|
95
|
+
* One Dark Theme - Atom's iconic dark theme
|
|
96
|
+
*/
|
|
97
|
+
export declare const oneDarkTheme: GridTheme;
|
|
98
|
+
/**
|
|
99
|
+
* Theme registry - all available themes
|
|
100
|
+
*/
|
|
101
|
+
export declare const themes: Record<ThemeName, GridTheme>;
|
|
102
|
+
/**
|
|
103
|
+
* Get theme by name
|
|
104
|
+
*/
|
|
105
|
+
export declare function getTheme(themeName: ThemeName): GridTheme;
|
|
106
|
+
/**
|
|
107
|
+
* Get all available theme names
|
|
108
|
+
*/
|
|
109
|
+
export declare function getThemeNames(): ThemeName[];
|
|
110
|
+
/**
|
|
111
|
+
* Generate CSS variables from theme
|
|
112
|
+
*/
|
|
113
|
+
export declare function generateThemeCSS(theme: GridTheme): Record<string, string>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { Row, TreeNode, TreeConfig, ExpandedNodes } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Tree Data Utilities
|
|
4
|
+
*
|
|
5
|
+
* Utilities for managing hierarchical/tree data structures in the DataGrid.
|
|
6
|
+
* Useful for org charts, file explorers, product categories, etc.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Type guard to check if a row is a tree node
|
|
10
|
+
*/
|
|
11
|
+
export declare const isTreeNode: (row: Row | TreeNode) => row is TreeNode;
|
|
12
|
+
/**
|
|
13
|
+
* Build tree structure from flat data
|
|
14
|
+
* Converts a flat array of rows with parent-child relationships into a hierarchical tree structure.
|
|
15
|
+
*
|
|
16
|
+
* @param rows - Flat array of rows
|
|
17
|
+
* @param config - Tree configuration specifying id, parentId, and children fields
|
|
18
|
+
* @returns Array of root-level tree nodes
|
|
19
|
+
*/
|
|
20
|
+
export declare const buildTreeFromFlat: (rows: Row[], config: TreeConfig) => TreeNode[];
|
|
21
|
+
/**
|
|
22
|
+
* Flatten tree structure for rendering
|
|
23
|
+
* Converts a hierarchical tree structure into a flat array respecting expand/collapse state.
|
|
24
|
+
*
|
|
25
|
+
* @param nodes - Array of tree nodes (can be root or any level)
|
|
26
|
+
* @param expandedNodes - Map of node IDs to their expanded state
|
|
27
|
+
* @param config - Tree configuration
|
|
28
|
+
* @returns Flat array of visible tree nodes
|
|
29
|
+
*/
|
|
30
|
+
export declare const flattenTree: (nodes: TreeNode[], expandedNodes: ExpandedNodes, config: TreeConfig) => TreeNode[];
|
|
31
|
+
/**
|
|
32
|
+
* Toggle expand/collapse state of a tree node
|
|
33
|
+
*
|
|
34
|
+
* @param nodeId - ID of the node to toggle
|
|
35
|
+
* @param expandedNodes - Current expanded state map
|
|
36
|
+
* @returns Updated expanded state map
|
|
37
|
+
*/
|
|
38
|
+
export declare const toggleNodeExpansion: (nodeId: string | number, expandedNodes: ExpandedNodes) => ExpandedNodes;
|
|
39
|
+
/**
|
|
40
|
+
* Expand all nodes in the tree
|
|
41
|
+
*
|
|
42
|
+
* @param nodes - Array of tree nodes
|
|
43
|
+
* @param config - Tree configuration
|
|
44
|
+
* @returns Expanded state map with all nodes set to expanded
|
|
45
|
+
*/
|
|
46
|
+
export declare const expandAllNodes: (nodes: TreeNode[], config: TreeConfig) => ExpandedNodes;
|
|
47
|
+
/**
|
|
48
|
+
* Collapse all nodes in the tree
|
|
49
|
+
*
|
|
50
|
+
* @param nodes - Array of tree nodes
|
|
51
|
+
* @param config - Tree configuration
|
|
52
|
+
* @returns Expanded state map with all nodes set to collapsed
|
|
53
|
+
*/
|
|
54
|
+
export declare const collapseAllNodes: (nodes: TreeNode[], config: TreeConfig) => ExpandedNodes;
|
|
55
|
+
/**
|
|
56
|
+
* Get all descendant node IDs of a given node
|
|
57
|
+
*
|
|
58
|
+
* @param node - The tree node
|
|
59
|
+
* @param config - Tree configuration
|
|
60
|
+
* @returns Array of all descendant node IDs
|
|
61
|
+
*/
|
|
62
|
+
export declare const getDescendantIds: (node: TreeNode, config: TreeConfig) => (string | number)[];
|
|
63
|
+
/**
|
|
64
|
+
* Get the path from root to a specific node
|
|
65
|
+
*
|
|
66
|
+
* @param nodeId - ID of the target node
|
|
67
|
+
* @param nodes - Array of root tree nodes
|
|
68
|
+
* @param config - Tree configuration
|
|
69
|
+
* @returns Array of node IDs representing the path, or null if not found
|
|
70
|
+
*/
|
|
71
|
+
export declare const getNodePath: (nodeId: string | number, nodes: TreeNode[], config: TreeConfig) => (string | number)[] | null;
|
|
72
|
+
/**
|
|
73
|
+
* Get the maximum depth of the tree
|
|
74
|
+
*
|
|
75
|
+
* @param nodes - Array of tree nodes
|
|
76
|
+
* @param config - Tree configuration
|
|
77
|
+
* @returns Maximum depth (levels) of the tree
|
|
78
|
+
*/
|
|
79
|
+
export declare const getTreeDepth: (nodes: TreeNode[], config: TreeConfig) => number;
|
|
80
|
+
/**
|
|
81
|
+
* Count total number of nodes in the tree
|
|
82
|
+
*
|
|
83
|
+
* @param nodes - Array of tree nodes
|
|
84
|
+
* @param config - Tree configuration
|
|
85
|
+
* @returns Total count of nodes
|
|
86
|
+
*/
|
|
87
|
+
export declare const countTreeNodes: (nodes: TreeNode[], config: TreeConfig) => number;
|
|
88
|
+
/**
|
|
89
|
+
* Filter tree nodes by a predicate function
|
|
90
|
+
* Returns a new tree structure containing only matching nodes and their ancestors
|
|
91
|
+
*
|
|
92
|
+
* @param nodes - Array of tree nodes
|
|
93
|
+
* @param predicate - Function to test each node
|
|
94
|
+
* @param config - Tree configuration
|
|
95
|
+
* @returns Filtered tree structure
|
|
96
|
+
*/
|
|
97
|
+
export declare const filterTree: (nodes: TreeNode[], predicate: (node: TreeNode) => boolean, config: TreeConfig) => TreeNode[];
|