@mui/x-data-grid-pro 5.4.0 → 5.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +321 -113
- package/DataGridPro/DataGridPro.d.ts +3 -0
- package/DataGridPro/DataGridPro.js +896 -0
- package/DataGridPro/index.d.ts +2 -0
- package/DataGridPro/index.js +2 -0
- package/DataGridPro/package.json +6 -0
- package/DataGridPro/useDataGridProComponent.d.ts +4 -0
- package/DataGridPro/useDataGridProComponent.js +72 -0
- package/DataGridPro/useDataGridProProps.d.ts +6 -0
- package/DataGridPro/useDataGridProProps.js +49 -0
- package/components/DataGridProColumnHeaders.d.ts +6 -0
- package/components/DataGridProColumnHeaders.js +165 -0
- package/components/DataGridProVirtualScroller.d.ts +8 -0
- package/components/DataGridProVirtualScroller.js +281 -0
- package/components/GridColumnPinningMenuItems.d.ts +11 -0
- package/components/GridColumnPinningMenuItems.js +71 -0
- package/components/GridDetailPanelToggleCell.d.ts +7 -0
- package/components/GridDetailPanelToggleCell.js +124 -0
- package/components/GridGroupingColumnLeafCell.d.ts +4 -0
- package/components/GridGroupingColumnLeafCell.js +22 -0
- package/components/GridGroupingCriteriaCell.d.ts +10 -0
- package/components/GridGroupingCriteriaCell.js +150 -0
- package/components/GridRowGroupableColumnMenuItems.d.ts +11 -0
- package/components/GridRowGroupableColumnMenuItems.js +63 -0
- package/components/GridRowGroupingColumnMenuItems.d.ts +11 -0
- package/components/GridRowGroupingColumnMenuItems.js +58 -0
- package/components/GridTreeDataGroupingCell.d.ts +10 -0
- package/components/GridTreeDataGroupingCell.js +159 -0
- package/components/Watermark.d.ts +2 -0
- package/components/Watermark.js +43 -0
- package/components/index.d.ts +2 -0
- package/components/index.js +3 -0
- package/components/package.json +6 -0
- package/hooks/features/columnPinning/gridColumnPinningInterface.d.ts +42 -0
- package/hooks/features/columnPinning/gridColumnPinningInterface.js +11 -0
- package/hooks/features/columnPinning/gridColumnPinningSelector.d.ts +2 -0
- package/hooks/features/columnPinning/gridColumnPinningSelector.js +1 -0
- package/hooks/features/columnPinning/index.d.ts +2 -0
- package/hooks/features/columnPinning/index.js +2 -0
- package/hooks/features/columnPinning/useGridColumnPinning.d.ts +6 -0
- package/hooks/features/columnPinning/useGridColumnPinning.js +274 -0
- package/hooks/features/columnPinning/useGridColumnPinningPreProcessors.d.ts +4 -0
- package/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +45 -0
- package/hooks/features/columnReorder/columnReorderInterfaces.d.ts +6 -0
- package/hooks/features/columnReorder/columnReorderInterfaces.js +1 -0
- package/hooks/features/columnReorder/columnReorderSelector.d.ts +3 -0
- package/hooks/features/columnReorder/columnReorderSelector.js +3 -0
- package/hooks/features/columnReorder/index.d.ts +2 -0
- package/hooks/features/columnReorder/index.js +2 -0
- package/hooks/features/columnReorder/useGridColumnReorder.d.ts +8 -0
- package/hooks/features/columnReorder/useGridColumnReorder.js +166 -0
- package/hooks/features/columnResize/columnResizeSelector.d.ts +3 -0
- package/hooks/features/columnResize/columnResizeSelector.js +3 -0
- package/hooks/features/columnResize/columnResizeState.d.ts +3 -0
- package/hooks/features/columnResize/columnResizeState.js +1 -0
- package/hooks/features/columnResize/index.d.ts +2 -0
- package/hooks/features/columnResize/index.js +2 -0
- package/hooks/features/columnResize/useGridColumnResize.d.ts +9 -0
- package/hooks/features/columnResize/useGridColumnResize.js +305 -0
- package/hooks/features/detailPanel/gridDetailPanelInterface.d.ts +28 -0
- package/hooks/features/detailPanel/gridDetailPanelInterface.js +1 -0
- package/hooks/features/detailPanel/gridDetailPanelSelector.d.ts +5 -0
- package/hooks/features/detailPanel/gridDetailPanelSelector.js +3 -0
- package/hooks/features/detailPanel/gridDetailPanelToggleColDef.d.ts +3 -0
- package/hooks/features/detailPanel/gridDetailPanelToggleColDef.js +26 -0
- package/hooks/features/detailPanel/index.d.ts +3 -0
- package/hooks/features/detailPanel/index.js +3 -0
- package/hooks/features/detailPanel/useGridDetailPanel.d.ts +4 -0
- package/hooks/features/detailPanel/useGridDetailPanel.js +109 -0
- package/hooks/features/detailPanel/useGridDetailPanelCache.d.ts +4 -0
- package/hooks/features/detailPanel/useGridDetailPanelCache.js +57 -0
- package/hooks/features/detailPanel/useGridDetailPanelPreProcessors.d.ts +4 -0
- package/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +28 -0
- package/hooks/features/index.d.ts +6 -0
- package/hooks/features/index.js +7 -0
- package/hooks/features/infiniteLoader/useGridInfiniteLoader.d.ts +10 -0
- package/hooks/features/infiniteLoader/useGridInfiniteLoader.js +52 -0
- package/hooks/features/rowGrouping/createGroupingColDef.d.ts +43 -0
- package/hooks/features/rowGrouping/createGroupingColDef.js +318 -0
- package/hooks/features/rowGrouping/gridRowGroupingInterfaces.d.ts +31 -0
- package/hooks/features/rowGrouping/gridRowGroupingInterfaces.js +1 -0
- package/hooks/features/rowGrouping/gridRowGroupingSelector.d.ts +4 -0
- package/hooks/features/rowGrouping/gridRowGroupingSelector.js +5 -0
- package/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +24 -0
- package/hooks/features/rowGrouping/gridRowGroupingUtils.js +124 -0
- package/hooks/features/rowGrouping/index.d.ts +3 -0
- package/hooks/features/rowGrouping/index.js +3 -0
- package/hooks/features/rowGrouping/useGridRowGrouping.d.ts +13 -0
- package/hooks/features/rowGrouping/useGridRowGrouping.js +325 -0
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.d.ts +4 -0
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +76 -0
- package/hooks/features/treeData/gridTreeDataGroupColDef.d.ts +7 -0
- package/hooks/features/treeData/gridTreeDataGroupColDef.js +22 -0
- package/hooks/features/treeData/gridTreeDataUtils.d.ts +14 -0
- package/hooks/features/treeData/gridTreeDataUtils.js +86 -0
- package/hooks/features/treeData/index.d.ts +1 -0
- package/hooks/features/treeData/index.js +1 -0
- package/hooks/features/treeData/useGridTreeData.d.ts +10 -0
- package/hooks/features/treeData/useGridTreeData.js +108 -0
- package/hooks/features/treeData/useGridTreeDataPreProcessors.d.ts +4 -0
- package/hooks/features/treeData/useGridTreeDataPreProcessors.js +69 -0
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +1 -0
- package/hooks/package.json +6 -0
- package/hooks/utils/useGridApiContext.d.ts +4 -0
- package/hooks/utils/useGridApiContext.js +2 -0
- package/hooks/utils/useGridApiRef.d.ts +4 -0
- package/hooks/utils/useGridApiRef.js +2 -0
- package/hooks/utils/useGridRootProps.d.ts +2 -0
- package/hooks/utils/useGridRootProps.js +2 -0
- package/index.d.ts +15 -0
- package/index.js +19 -0
- package/legacy/DataGridPro/DataGridPro.js +896 -0
- package/legacy/DataGridPro/index.js +2 -0
- package/legacy/DataGridPro/useDataGridProComponent.js +72 -0
- package/legacy/DataGridPro/useDataGridProProps.js +53 -0
- package/legacy/components/DataGridProColumnHeaders.js +173 -0
- package/legacy/components/DataGridProVirtualScroller.js +297 -0
- package/legacy/components/GridColumnPinningMenuItems.js +71 -0
- package/legacy/components/GridDetailPanelToggleCell.js +120 -0
- package/legacy/components/GridGroupingColumnLeafCell.js +20 -0
- package/legacy/components/GridGroupingCriteriaCell.js +146 -0
- package/legacy/components/GridRowGroupableColumnMenuItems.js +61 -0
- package/legacy/components/GridRowGroupingColumnMenuItems.js +56 -0
- package/legacy/components/GridTreeDataGroupingCell.js +155 -0
- package/legacy/components/Watermark.js +43 -0
- package/legacy/components/index.js +3 -0
- package/legacy/hooks/features/columnPinning/gridColumnPinningInterface.js +11 -0
- package/legacy/hooks/features/columnPinning/gridColumnPinningSelector.js +3 -0
- package/legacy/hooks/features/columnPinning/index.js +2 -0
- package/legacy/hooks/features/columnPinning/useGridColumnPinning.js +298 -0
- package/legacy/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +48 -0
- package/legacy/hooks/features/columnReorder/columnReorderInterfaces.js +1 -0
- package/legacy/hooks/features/columnReorder/columnReorderSelector.js +7 -0
- package/legacy/hooks/features/columnReorder/index.js +2 -0
- package/legacy/hooks/features/columnReorder/useGridColumnReorder.js +172 -0
- package/legacy/hooks/features/columnResize/columnResizeSelector.js +7 -0
- package/legacy/hooks/features/columnResize/columnResizeState.js +1 -0
- package/legacy/hooks/features/columnResize/index.js +2 -0
- package/legacy/hooks/features/columnResize/useGridColumnResize.js +310 -0
- package/legacy/hooks/features/detailPanel/gridDetailPanelInterface.js +1 -0
- package/legacy/hooks/features/detailPanel/gridDetailPanelSelector.js +9 -0
- package/legacy/hooks/features/detailPanel/gridDetailPanelToggleColDef.js +28 -0
- package/legacy/hooks/features/detailPanel/index.js +3 -0
- package/legacy/hooks/features/detailPanel/useGridDetailPanel.js +114 -0
- package/legacy/hooks/features/detailPanel/useGridDetailPanelCache.js +57 -0
- package/legacy/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +31 -0
- package/legacy/hooks/features/index.js +7 -0
- package/legacy/hooks/features/infiniteLoader/useGridInfiniteLoader.js +51 -0
- package/legacy/hooks/features/rowGrouping/createGroupingColDef.js +319 -0
- package/legacy/hooks/features/rowGrouping/gridRowGroupingInterfaces.js +1 -0
- package/legacy/hooks/features/rowGrouping/gridRowGroupingSelector.js +13 -0
- package/legacy/hooks/features/rowGrouping/gridRowGroupingUtils.js +130 -0
- package/legacy/hooks/features/rowGrouping/index.js +3 -0
- package/legacy/hooks/features/rowGrouping/useGridRowGrouping.js +334 -0
- package/legacy/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +83 -0
- package/legacy/hooks/features/treeData/gridTreeDataGroupColDef.js +24 -0
- package/legacy/hooks/features/treeData/gridTreeDataUtils.js +84 -0
- package/legacy/hooks/features/treeData/index.js +1 -0
- package/legacy/hooks/features/treeData/useGridTreeData.js +116 -0
- package/legacy/hooks/features/treeData/useGridTreeDataPreProcessors.js +72 -0
- package/legacy/hooks/index.js +1 -0
- package/legacy/hooks/utils/useGridApiContext.js +2 -0
- package/legacy/hooks/utils/useGridApiRef.js +2 -0
- package/legacy/hooks/utils/useGridRootProps.js +2 -0
- package/legacy/index.js +19 -0
- package/legacy/models/dataGridProProps.js +1 -0
- package/legacy/models/gridApiPro.js +1 -0
- package/legacy/models/gridGroupingColDefOverride.js +1 -0
- package/legacy/models/gridGroupingValueGetterParams.js +1 -0
- package/legacy/models/gridRowScrollEndParams.js +1 -0
- package/legacy/models/gridStatePro.js +1 -0
- package/legacy/models/index.js +4 -0
- package/legacy/themeAugmentation/index.js +3 -0
- package/legacy/themeAugmentation/overrides.js +1 -0
- package/legacy/themeAugmentation/props.js +1 -0
- package/legacy/typeOverloads/modules.js +1 -0
- package/legacy/typeOverloads/reexports.js +6 -0
- package/legacy/utils/domUtils.js +19 -0
- package/legacy/utils/tree/buildRowTree.js +188 -0
- package/legacy/utils/tree/sortRowTree.js +63 -0
- package/models/dataGridProProps.d.ts +174 -0
- package/models/dataGridProProps.js +1 -0
- package/models/gridApiPro.d.ts +12 -0
- package/models/gridApiPro.js +1 -0
- package/models/gridGroupingColDefOverride.d.ts +30 -0
- package/models/gridGroupingColDefOverride.js +1 -0
- package/models/gridGroupingValueGetterParams.d.ts +31 -0
- package/models/gridGroupingValueGetterParams.js +1 -0
- package/models/gridRowScrollEndParams.d.ts +18 -0
- package/models/gridRowScrollEndParams.js +1 -0
- package/models/gridStatePro.d.ts +20 -0
- package/models/gridStatePro.js +1 -0
- package/models/index.d.ts +4 -0
- package/models/index.js +4 -0
- package/models/package.json +6 -0
- package/modern/DataGridPro/DataGridPro.js +896 -0
- package/modern/DataGridPro/index.js +2 -0
- package/modern/DataGridPro/useDataGridProComponent.js +72 -0
- package/modern/DataGridPro/useDataGridProProps.js +45 -0
- package/modern/components/DataGridProColumnHeaders.js +163 -0
- package/modern/components/DataGridProVirtualScroller.js +279 -0
- package/modern/components/GridColumnPinningMenuItems.js +71 -0
- package/modern/components/GridDetailPanelToggleCell.js +124 -0
- package/modern/components/GridGroupingColumnLeafCell.js +20 -0
- package/modern/components/GridGroupingCriteriaCell.js +148 -0
- package/modern/components/GridRowGroupableColumnMenuItems.js +61 -0
- package/modern/components/GridRowGroupingColumnMenuItems.js +56 -0
- package/modern/components/GridTreeDataGroupingCell.js +157 -0
- package/modern/components/Watermark.js +43 -0
- package/modern/components/index.js +3 -0
- package/modern/hooks/features/columnPinning/gridColumnPinningInterface.js +11 -0
- package/modern/hooks/features/columnPinning/gridColumnPinningSelector.js +1 -0
- package/modern/hooks/features/columnPinning/index.js +2 -0
- package/modern/hooks/features/columnPinning/useGridColumnPinning.js +268 -0
- package/modern/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +45 -0
- package/modern/hooks/features/columnReorder/columnReorderInterfaces.js +1 -0
- package/modern/hooks/features/columnReorder/columnReorderSelector.js +3 -0
- package/modern/hooks/features/columnReorder/index.js +2 -0
- package/modern/hooks/features/columnReorder/useGridColumnReorder.js +166 -0
- package/modern/hooks/features/columnResize/columnResizeSelector.js +3 -0
- package/modern/hooks/features/columnResize/columnResizeState.js +1 -0
- package/modern/hooks/features/columnResize/index.js +2 -0
- package/modern/hooks/features/columnResize/useGridColumnResize.js +295 -0
- package/modern/hooks/features/detailPanel/gridDetailPanelInterface.js +1 -0
- package/modern/hooks/features/detailPanel/gridDetailPanelSelector.js +3 -0
- package/modern/hooks/features/detailPanel/gridDetailPanelToggleColDef.js +26 -0
- package/modern/hooks/features/detailPanel/index.js +3 -0
- package/modern/hooks/features/detailPanel/useGridDetailPanel.js +105 -0
- package/modern/hooks/features/detailPanel/useGridDetailPanelCache.js +57 -0
- package/modern/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +28 -0
- package/modern/hooks/features/index.js +7 -0
- package/modern/hooks/features/infiniteLoader/useGridInfiniteLoader.js +52 -0
- package/modern/hooks/features/rowGrouping/createGroupingColDef.js +302 -0
- package/modern/hooks/features/rowGrouping/gridRowGroupingInterfaces.js +1 -0
- package/modern/hooks/features/rowGrouping/gridRowGroupingSelector.js +5 -0
- package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +122 -0
- package/modern/hooks/features/rowGrouping/index.js +3 -0
- package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +317 -0
- package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +76 -0
- package/modern/hooks/features/treeData/gridTreeDataGroupColDef.js +22 -0
- package/modern/hooks/features/treeData/gridTreeDataUtils.js +82 -0
- package/modern/hooks/features/treeData/index.js +1 -0
- package/modern/hooks/features/treeData/useGridTreeData.js +106 -0
- package/modern/hooks/features/treeData/useGridTreeDataPreProcessors.js +67 -0
- package/modern/hooks/index.js +1 -0
- package/modern/hooks/utils/useGridApiContext.js +2 -0
- package/modern/hooks/utils/useGridApiRef.js +2 -0
- package/modern/hooks/utils/useGridRootProps.js +2 -0
- package/modern/index.js +19 -0
- package/modern/models/dataGridProProps.js +1 -0
- package/modern/models/gridApiPro.js +1 -0
- package/modern/models/gridGroupingColDefOverride.js +1 -0
- package/modern/models/gridGroupingValueGetterParams.js +1 -0
- package/modern/models/gridRowScrollEndParams.js +1 -0
- package/modern/models/gridStatePro.js +1 -0
- package/modern/models/index.js +4 -0
- package/modern/themeAugmentation/index.js +3 -0
- package/modern/themeAugmentation/overrides.js +1 -0
- package/modern/themeAugmentation/props.js +1 -0
- package/modern/typeOverloads/modules.js +1 -0
- package/modern/typeOverloads/reexports.js +6 -0
- package/modern/utils/domUtils.js +19 -0
- package/modern/utils/tree/buildRowTree.js +167 -0
- package/modern/utils/tree/sortRowTree.js +60 -0
- package/node/DataGridPro/DataGridPro.js +921 -0
- package/node/DataGridPro/index.js +30 -0
- package/node/DataGridPro/useDataGridProComponent.js +94 -0
- package/node/DataGridPro/useDataGridProProps.js +69 -0
- package/node/components/DataGridProColumnHeaders.js +189 -0
- package/node/components/DataGridProVirtualScroller.js +308 -0
- package/node/components/GridColumnPinningMenuItems.js +88 -0
- package/node/components/GridDetailPanelToggleCell.js +145 -0
- package/node/components/GridGroupingColumnLeafCell.js +38 -0
- package/node/components/GridGroupingCriteriaCell.js +170 -0
- package/node/components/GridRowGroupableColumnMenuItems.js +82 -0
- package/node/components/GridRowGroupingColumnMenuItems.js +78 -0
- package/node/components/GridTreeDataGroupingCell.js +180 -0
- package/node/components/Watermark.js +56 -0
- package/node/components/index.js +31 -0
- package/node/hooks/features/columnPinning/gridColumnPinningInterface.js +17 -0
- package/node/hooks/features/columnPinning/gridColumnPinningSelector.js +10 -0
- package/node/hooks/features/columnPinning/index.js +31 -0
- package/node/hooks/features/columnPinning/useGridColumnPinning.js +297 -0
- package/node/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +66 -0
- package/node/hooks/features/columnReorder/columnReorderInterfaces.js +5 -0
- package/node/hooks/features/columnReorder/columnReorderSelector.js +14 -0
- package/node/hooks/features/columnReorder/index.js +18 -0
- package/node/hooks/features/columnReorder/useGridColumnReorder.js +187 -0
- package/node/hooks/features/columnResize/columnResizeSelector.js +14 -0
- package/node/hooks/features/columnResize/columnResizeState.js +5 -0
- package/node/hooks/features/columnResize/index.js +31 -0
- package/node/hooks/features/columnResize/useGridColumnResize.js +326 -0
- package/node/hooks/features/detailPanel/gridDetailPanelInterface.js +5 -0
- package/node/hooks/features/detailPanel/gridDetailPanelSelector.js +18 -0
- package/node/hooks/features/detailPanel/gridDetailPanelToggleColDef.js +47 -0
- package/node/hooks/features/detailPanel/index.js +44 -0
- package/node/hooks/features/detailPanel/useGridDetailPanel.js +130 -0
- package/node/hooks/features/detailPanel/useGridDetailPanelCache.js +74 -0
- package/node/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +44 -0
- package/node/hooks/features/index.js +83 -0
- package/node/hooks/features/infiniteLoader/useGridInfiniteLoader.js +67 -0
- package/node/hooks/features/rowGrouping/createGroupingColDef.js +341 -0
- package/node/hooks/features/rowGrouping/gridRowGroupingInterfaces.js +5 -0
- package/node/hooks/features/rowGrouping/gridRowGroupingSelector.js +18 -0
- package/node/hooks/features/rowGrouping/gridRowGroupingUtils.js +153 -0
- package/node/hooks/features/rowGrouping/index.js +51 -0
- package/node/hooks/features/rowGrouping/useGridRowGrouping.js +355 -0
- package/node/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +94 -0
- package/node/hooks/features/treeData/gridTreeDataGroupColDef.js +35 -0
- package/node/hooks/features/treeData/gridTreeDataUtils.js +95 -0
- package/node/hooks/features/treeData/index.js +13 -0
- package/node/hooks/features/treeData/useGridTreeData.js +132 -0
- package/node/hooks/features/treeData/useGridTreeDataPreProcessors.js +92 -0
- package/node/hooks/index.js +18 -0
- package/node/hooks/utils/useGridApiContext.js +11 -0
- package/node/hooks/utils/useGridApiRef.js +11 -0
- package/node/hooks/utils/useGridRootProps.js +11 -0
- package/node/index.js +200 -0
- package/node/models/dataGridProProps.js +5 -0
- package/node/models/gridApiPro.js +5 -0
- package/node/models/gridGroupingColDefOverride.js +5 -0
- package/node/models/gridGroupingValueGetterParams.js +5 -0
- package/node/models/gridRowScrollEndParams.js +5 -0
- package/node/models/gridStatePro.js +5 -0
- package/node/models/index.js +44 -0
- package/node/themeAugmentation/index.js +31 -0
- package/node/themeAugmentation/overrides.js +5 -0
- package/node/themeAugmentation/props.js +5 -0
- package/node/typeOverloads/modules.js +5 -0
- package/node/typeOverloads/reexports.js +29 -0
- package/node/utils/domUtils.js +32 -0
- package/node/utils/tree/buildRowTree.js +185 -0
- package/node/utils/tree/sortRowTree.js +69 -0
- package/package.json +12 -14
- package/themeAugmentation/index.d.ts +2 -2
- package/themeAugmentation/index.js +3 -0
- package/themeAugmentation/overrides.d.ts +8 -8
- package/themeAugmentation/overrides.js +1 -0
- package/themeAugmentation/package.json +6 -0
- package/themeAugmentation/props.d.ts +19 -19
- package/themeAugmentation/props.js +1 -0
- package/typeOverloads/modules.d.ts +41 -0
- package/typeOverloads/modules.js +1 -0
- package/typeOverloads/reexports.d.ts +22 -0
- package/typeOverloads/reexports.js +6 -0
- package/utils/domUtils.d.ts +3 -0
- package/utils/domUtils.js +19 -0
- package/utils/tree/buildRowTree.d.ts +47 -0
- package/utils/tree/buildRowTree.js +179 -0
- package/utils/tree/sortRowTree.d.ts +10 -0
- package/utils/tree/sortRowTree.js +60 -0
- package/LICENSE +0 -12
- package/index-cjs.js +0 -15
- package/index-esm.js +0 -15
- package/x-data-grid-pro.d.ts +0 -5251
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _overrides = require("./overrides");
|
|
8
|
+
|
|
9
|
+
Object.keys(_overrides).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _overrides[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _overrides[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _props = require("./props");
|
|
21
|
+
|
|
22
|
+
Object.keys(_props).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _props[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _props[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "useGridApiContext", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _useGridApiContext.useGridApiContext;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "useGridApiRef", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _useGridApiRef.useGridApiRef;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "useGridRootProps", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _useGridRootProps.useGridRootProps;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
var _useGridApiContext = require("../hooks/utils/useGridApiContext");
|
|
26
|
+
|
|
27
|
+
var _useGridApiRef = require("../hooks/utils/useGridApiRef");
|
|
28
|
+
|
|
29
|
+
var _useGridRootProps = require("../hooks/utils/useGridRootProps");
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.findGridCellElementsFromCol = findGridCellElementsFromCol;
|
|
7
|
+
exports.findHeaderElementFromField = findHeaderElementFromField;
|
|
8
|
+
exports.getFieldFromHeaderElem = getFieldFromHeaderElem;
|
|
9
|
+
|
|
10
|
+
var _xDataGrid = require("@mui/x-data-grid");
|
|
11
|
+
|
|
12
|
+
var _internals = require("@mui/x-data-grid/internals");
|
|
13
|
+
|
|
14
|
+
function getFieldFromHeaderElem(colCellEl) {
|
|
15
|
+
return colCellEl.getAttribute('data-field');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function findHeaderElementFromField(elem, field) {
|
|
19
|
+
return elem.querySelector(`[data-field="${field}"]`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function findGridCellElementsFromCol(col) {
|
|
23
|
+
const field = col.getAttribute('data-field');
|
|
24
|
+
const root = (0, _internals.findParentElementFromClassName)(col, 'MuiDataGrid-root');
|
|
25
|
+
|
|
26
|
+
if (!root) {
|
|
27
|
+
throw new Error('MUI: The root element is not found.');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const cells = root.querySelectorAll(`.${_xDataGrid.gridClasses.cell}[data-field="${field}"]`);
|
|
31
|
+
return cells;
|
|
32
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.buildRowTree = void 0;
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Transform a list of rows into a tree structure where each row references its parent and children.
|
|
14
|
+
* If a row have a parent which does not exist in the input rows, creates an auto generated row
|
|
15
|
+
*
|
|
16
|
+
```
|
|
17
|
+
params = {
|
|
18
|
+
ids: [0, 1, 2],
|
|
19
|
+
idRowsLookup: { 0: {...}, 1: {...}, 2: {...} },
|
|
20
|
+
rows: [
|
|
21
|
+
{ id: 0, path: ['A'] },
|
|
22
|
+
{ id: 1, path: ['B', 'A'] },
|
|
23
|
+
{ id: 2, path: ['B', 'A', 'A'] }
|
|
24
|
+
],
|
|
25
|
+
defaultGroupingExpansionDepth: 0,
|
|
26
|
+
}
|
|
27
|
+
Returns:
|
|
28
|
+
{
|
|
29
|
+
ids: [0, 1, 2, 'auto-generated-row-B'],
|
|
30
|
+
idRowsLookup: { 0: {...}, 1: {...}, 2: {...}, 'auto-generated-row-B': {} },
|
|
31
|
+
tree: {
|
|
32
|
+
'0': { id: 0, parent: null, childrenExpanded: false, depth: 0, groupingKey: 'A' },
|
|
33
|
+
'auto-generated-row-B': { id: 'auto-generated-row-B', parent: null, childrenExpanded: false, depth: 0, groupingKey: 'B' },
|
|
34
|
+
'1': { id: 1, parent: 'auto-generated-row-B', childrenExpanded: false, depth: 1, groupingKey: 'A' },
|
|
35
|
+
'2': { id: 2, parent: 1, childrenExpanded: false, depth: 2, groupingKey: 'A' },
|
|
36
|
+
},
|
|
37
|
+
treeDepth: 3,
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
*/
|
|
41
|
+
const buildRowTree = params => {
|
|
42
|
+
// During the build, we store the children as a Record to avoid linear complexity when checking if a children is already defined.
|
|
43
|
+
const tempTree = {};
|
|
44
|
+
let treeDepth = 1;
|
|
45
|
+
const ids = [...params.ids];
|
|
46
|
+
const idRowsLookup = (0, _extends2.default)({}, params.idRowsLookup);
|
|
47
|
+
const groupingCriteriaToIdTree = {};
|
|
48
|
+
|
|
49
|
+
const isGroupExpandedByDefault = node => {
|
|
50
|
+
var _params$previousTree, _params$previousTree$;
|
|
51
|
+
|
|
52
|
+
const previousExpansion = (_params$previousTree = params.previousTree) == null ? void 0 : (_params$previousTree$ = _params$previousTree[node.id]) == null ? void 0 : _params$previousTree$.childrenExpanded;
|
|
53
|
+
|
|
54
|
+
if (previousExpansion != null) {
|
|
55
|
+
return previousExpansion;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (!node.children || !node.children.length) {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (params.isGroupExpandedByDefault) {
|
|
63
|
+
return params.isGroupExpandedByDefault(node);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return params.defaultGroupingExpansionDepth === -1 || params.defaultGroupingExpansionDepth > node.depth;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
for (let i = 0; i < params.rows.length; i += 1) {
|
|
70
|
+
const row = params.rows[i];
|
|
71
|
+
let keyToIdSubTree = groupingCriteriaToIdTree;
|
|
72
|
+
let parentNode = null;
|
|
73
|
+
|
|
74
|
+
for (let depth = 0; depth < row.path.length; depth += 1) {
|
|
75
|
+
const {
|
|
76
|
+
key,
|
|
77
|
+
field: rawField
|
|
78
|
+
} = row.path[depth];
|
|
79
|
+
const field = rawField != null ? rawField : '__no_field__';
|
|
80
|
+
let nodeId;
|
|
81
|
+
let fieldSubTree = keyToIdSubTree[field];
|
|
82
|
+
|
|
83
|
+
if (!fieldSubTree) {
|
|
84
|
+
fieldSubTree = {};
|
|
85
|
+
keyToIdSubTree[field] = fieldSubTree;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
let keyConfig = fieldSubTree[key.toString()];
|
|
89
|
+
|
|
90
|
+
if (keyConfig) {
|
|
91
|
+
if (depth === row.path.length - 1) {
|
|
92
|
+
var _params$onDuplicatePa;
|
|
93
|
+
|
|
94
|
+
(_params$onDuplicatePa = params.onDuplicatePath) == null ? void 0 : _params$onDuplicatePa.call(params, keyConfig.id, row.id, row.path);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
nodeId = keyConfig.id;
|
|
98
|
+
} else {
|
|
99
|
+
if (depth === row.path.length - 1) {
|
|
100
|
+
nodeId = row.id;
|
|
101
|
+
} else {
|
|
102
|
+
nodeId = `auto-generated-row-${row.path.map(groupingCriteria => `${groupingCriteria.field}/${groupingCriteria.key}`).slice(0, depth + 1).join('-')}`;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
keyConfig = {
|
|
106
|
+
id: nodeId,
|
|
107
|
+
children: {}
|
|
108
|
+
};
|
|
109
|
+
fieldSubTree[key.toString()] = keyConfig;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
keyToIdSubTree = keyConfig.children;
|
|
113
|
+
|
|
114
|
+
if (!tempTree[nodeId]) {
|
|
115
|
+
var _parentNode$id, _parentNode;
|
|
116
|
+
|
|
117
|
+
const isAutoGenerated = depth < row.path.length - 1;
|
|
118
|
+
const node = {
|
|
119
|
+
id: nodeId,
|
|
120
|
+
isAutoGenerated,
|
|
121
|
+
parent: (_parentNode$id = (_parentNode = parentNode) == null ? void 0 : _parentNode.id) != null ? _parentNode$id : null,
|
|
122
|
+
groupingKey: key,
|
|
123
|
+
groupingField: rawField,
|
|
124
|
+
depth
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
if (isAutoGenerated) {
|
|
128
|
+
idRowsLookup[nodeId] = {};
|
|
129
|
+
ids.push(nodeId);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
tempTree[nodeId] = node;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (parentNode != null) {
|
|
136
|
+
if (!parentNode.children) {
|
|
137
|
+
parentNode.children = {};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
parentNode.children[nodeId] = nodeId;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
parentNode = tempTree[nodeId];
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
treeDepth = Math.max(treeDepth, row.path.length);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const tree = {};
|
|
150
|
+
|
|
151
|
+
for (let i = 0; i < ids.length; i += 1) {
|
|
152
|
+
var _params$previousTree2, _previousNode$childre, _node$children, _previousNode$childre2;
|
|
153
|
+
|
|
154
|
+
const rowId = ids[i];
|
|
155
|
+
const tempNode = tempTree[rowId];
|
|
156
|
+
const nodeWithoutChildrenExpansion = (0, _extends2.default)({}, tempNode, {
|
|
157
|
+
children: tempNode.children ? Object.values(tempNode.children) : undefined
|
|
158
|
+
});
|
|
159
|
+
const node = (0, _extends2.default)({}, nodeWithoutChildrenExpansion, {
|
|
160
|
+
childrenExpanded: isGroupExpandedByDefault(nodeWithoutChildrenExpansion)
|
|
161
|
+
});
|
|
162
|
+
const previousNode = (_params$previousTree2 = params.previousTree) == null ? void 0 : _params$previousTree2[node.id];
|
|
163
|
+
const shouldReUsePreviousNode = previousNode && previousNode.isAutoGenerated === node.isAutoGenerated && previousNode.parent === node.parent && previousNode.groupingKey === node.groupingKey && previousNode.groupingField === node.groupingField && previousNode.depth === node.depth && previousNode.childrenExpanded === node.childrenExpanded && ((_previousNode$childre = previousNode.children) == null ? void 0 : _previousNode$childre.length) === ((_node$children = node.children) == null ? void 0 : _node$children.length) && ((_previousNode$childre2 = previousNode.children) == null ? void 0 : _previousNode$childre2.every((childId, index) => {
|
|
164
|
+
var _node$children2;
|
|
165
|
+
|
|
166
|
+
return ((_node$children2 = node.children) == null ? void 0 : _node$children2[index]) === childId;
|
|
167
|
+
}));
|
|
168
|
+
|
|
169
|
+
if (shouldReUsePreviousNode) {
|
|
170
|
+
tree[rowId] = previousNode;
|
|
171
|
+
} else {
|
|
172
|
+
tree[rowId] = node;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return {
|
|
177
|
+
tree,
|
|
178
|
+
treeDepth,
|
|
179
|
+
ids,
|
|
180
|
+
idRowsLookup,
|
|
181
|
+
groupingName: params.groupingName
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
exports.buildRowTree = buildRowTree;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.sortRowTree = void 0;
|
|
7
|
+
|
|
8
|
+
const sortRowTree = params => {
|
|
9
|
+
const {
|
|
10
|
+
rowIds,
|
|
11
|
+
rowTree,
|
|
12
|
+
disableChildrenSorting,
|
|
13
|
+
sortRowList
|
|
14
|
+
} = params;
|
|
15
|
+
let sortedRows = []; // Group the rows by parent
|
|
16
|
+
|
|
17
|
+
const groupedByParentRows = new Map([[null, []]]);
|
|
18
|
+
|
|
19
|
+
for (let i = 0; i < rowIds.length; i += 1) {
|
|
20
|
+
const rowId = rowIds[i];
|
|
21
|
+
const node = rowTree[rowId];
|
|
22
|
+
let group = groupedByParentRows.get(node.parent);
|
|
23
|
+
|
|
24
|
+
if (!group) {
|
|
25
|
+
group = [];
|
|
26
|
+
groupedByParentRows.set(node.parent, group);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
group.push(node);
|
|
30
|
+
} // Apply the sorting to each list of children
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
const sortedGroupedByParentRows = new Map();
|
|
34
|
+
groupedByParentRows.forEach((rowList, parent) => {
|
|
35
|
+
if (rowList.length === 0) {
|
|
36
|
+
sortedGroupedByParentRows.set(parent, []);
|
|
37
|
+
} else {
|
|
38
|
+
const depth = rowList[0].depth;
|
|
39
|
+
|
|
40
|
+
if (depth > 0 && disableChildrenSorting) {
|
|
41
|
+
sortedGroupedByParentRows.set(parent, rowList.map(row => row.id));
|
|
42
|
+
} else if (!sortRowList) {
|
|
43
|
+
sortedGroupedByParentRows.set(parent, rowList.map(row => row.id));
|
|
44
|
+
} else {
|
|
45
|
+
sortedGroupedByParentRows.set(parent, sortRowList(rowList));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}); // Flatten the sorted lists to have children just after their parent
|
|
49
|
+
|
|
50
|
+
const insertRowListIntoSortedRows = (startIndex, rowList) => {
|
|
51
|
+
sortedRows = [...sortedRows.slice(0, startIndex), ...rowList, ...sortedRows.slice(startIndex)];
|
|
52
|
+
let treeSize = 0;
|
|
53
|
+
rowList.forEach(rowId => {
|
|
54
|
+
treeSize += 1;
|
|
55
|
+
const children = sortedGroupedByParentRows.get(rowId);
|
|
56
|
+
|
|
57
|
+
if (children != null && children.length) {
|
|
58
|
+
const subTreeSize = insertRowListIntoSortedRows(startIndex + treeSize, children);
|
|
59
|
+
treeSize += subTreeSize;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
return treeSize;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
insertRowListIntoSortedRows(0, sortedGroupedByParentRows.get(null));
|
|
66
|
+
return sortedRows;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
exports.sortRowTree = sortRowTree;
|
package/package.json
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-pro",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.0",
|
|
4
4
|
"description": "The commercial edition of the data grid component (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
|
-
"main": "index
|
|
7
|
-
"
|
|
8
|
-
"types": "x-data-grid-pro.d.ts",
|
|
9
|
-
"license": "See LICENSE file",
|
|
6
|
+
"main": "./node/index.js",
|
|
7
|
+
"license": "SEE LICENSE IN LICENSE.txt",
|
|
10
8
|
"bugs": {
|
|
11
|
-
"url": "https://github.com/mui
|
|
9
|
+
"url": "https://github.com/mui/mui-x/issues"
|
|
12
10
|
},
|
|
13
11
|
"homepage": "https://mui.com/components/data-grid/",
|
|
14
12
|
"sideEffects": false,
|
|
@@ -27,18 +25,15 @@
|
|
|
27
25
|
"datagrid",
|
|
28
26
|
"data-grid"
|
|
29
27
|
],
|
|
30
|
-
"scripts": {
|
|
31
|
-
"typescript": "tsc -p tsconfig.json",
|
|
32
|
-
"build": "cd ../ && rollup --config rollup.x-data-grid-pro.config.js"
|
|
33
|
-
},
|
|
34
28
|
"repository": {
|
|
35
29
|
"type": "git",
|
|
36
|
-
"url": "https://github.com/mui
|
|
30
|
+
"url": "https://github.com/mui/mui-x.git",
|
|
37
31
|
"directory": "packages/grid/x-data-grid-pro"
|
|
38
32
|
},
|
|
39
33
|
"dependencies": {
|
|
40
|
-
"@mui/utils": "^5.
|
|
41
|
-
"@mui/x-
|
|
34
|
+
"@mui/utils": "^5.4.2",
|
|
35
|
+
"@mui/x-data-grid": "5.6.0",
|
|
36
|
+
"@mui/x-license-pro": "5.6.0",
|
|
42
37
|
"clsx": "^1.0.4",
|
|
43
38
|
"prop-types": "^15.8.1",
|
|
44
39
|
"reselect": "^4.1.5"
|
|
@@ -53,5 +48,8 @@
|
|
|
53
48
|
],
|
|
54
49
|
"engines": {
|
|
55
50
|
"node": ">=12.0.0"
|
|
56
|
-
}
|
|
51
|
+
},
|
|
52
|
+
"private": false,
|
|
53
|
+
"module": "./index.js",
|
|
54
|
+
"types": "./index.d.ts"
|
|
57
55
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './overrides';
|
|
2
|
-
export * from './props';
|
|
1
|
+
export * from './overrides';
|
|
2
|
+
export * from './props';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { GridClassKey } from '
|
|
2
|
-
export interface DataGridProComponentNameToClassKey {
|
|
3
|
-
MuiDataGrid: GridClassKey;
|
|
4
|
-
}
|
|
5
|
-
declare module '@mui/material/styles/overrides' {
|
|
6
|
-
interface ComponentNameToClassKey extends DataGridProComponentNameToClassKey {
|
|
7
|
-
}
|
|
8
|
-
}
|
|
1
|
+
import { GridClassKey } from '@mui/x-data-grid';
|
|
2
|
+
export interface DataGridProComponentNameToClassKey {
|
|
3
|
+
MuiDataGrid: GridClassKey;
|
|
4
|
+
}
|
|
5
|
+
declare module '@mui/material/styles/overrides' {
|
|
6
|
+
interface ComponentNameToClassKey extends DataGridProComponentNameToClassKey {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ComponentsOverrides, ComponentsProps } from '@mui/material/styles';
|
|
2
|
-
import { DataGridProProps } from '
|
|
3
|
-
export interface DataGridProComponentsPropsList {
|
|
4
|
-
MuiDataGrid: DataGridProProps;
|
|
5
|
-
}
|
|
6
|
-
export interface DataGridProComponents {
|
|
7
|
-
MuiDataGrid?: {
|
|
8
|
-
defaultProps?: ComponentsProps['MuiDataGrid'];
|
|
9
|
-
styleOverrides?: ComponentsOverrides['MuiDataGrid'];
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
declare module '@mui/material/styles' {
|
|
13
|
-
interface ComponentsPropsList extends DataGridProComponentsPropsList {
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
declare module '@mui/material/styles/components' {
|
|
17
|
-
interface Components extends DataGridProComponents {
|
|
18
|
-
}
|
|
19
|
-
}
|
|
1
|
+
import { ComponentsOverrides, ComponentsProps } from '@mui/material/styles';
|
|
2
|
+
import { DataGridProProps } from '../models/dataGridProProps';
|
|
3
|
+
export interface DataGridProComponentsPropsList {
|
|
4
|
+
MuiDataGrid: DataGridProProps;
|
|
5
|
+
}
|
|
6
|
+
export interface DataGridProComponents {
|
|
7
|
+
MuiDataGrid?: {
|
|
8
|
+
defaultProps?: ComponentsProps['MuiDataGrid'];
|
|
9
|
+
styleOverrides?: ComponentsOverrides['MuiDataGrid'];
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
declare module '@mui/material/styles' {
|
|
13
|
+
interface ComponentsPropsList extends DataGridProComponentsPropsList {
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
declare module '@mui/material/styles/components' {
|
|
17
|
+
interface Components extends DataGridProComponents {
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { GridKeyValue } from '@mui/x-data-grid';
|
|
2
|
+
import type { GridRowScrollEndParams, GridGroupingValueGetterParams } from '../models';
|
|
3
|
+
import type { GridPinnedColumns, GridRowGroupingModel } from '../hooks';
|
|
4
|
+
import type { GridCanBeReorderedPreProcessingContext } from '../hooks/features/columnReorder/columnReorderInterfaces';
|
|
5
|
+
export interface GridControlledStateEventLookupPro {
|
|
6
|
+
rowGroupingModelChange: {
|
|
7
|
+
params: GridRowGroupingModel;
|
|
8
|
+
};
|
|
9
|
+
pinnedColumnsChange: {
|
|
10
|
+
params: GridPinnedColumns;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface GridEventLookupPro {
|
|
14
|
+
rowsScrollEnd: {
|
|
15
|
+
params: GridRowScrollEndParams;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface GridPreProcessingGroupLookupPro {
|
|
19
|
+
canBeReordered: {
|
|
20
|
+
value: boolean;
|
|
21
|
+
context: GridCanBeReorderedPreProcessingContext;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface GridColDefPro {
|
|
25
|
+
/**
|
|
26
|
+
* Function that transforms a complex cell value into a key that be used for grouping the rows.
|
|
27
|
+
* @param {GridGroupingValueGetterParams} params Object containing parameters for the getter.
|
|
28
|
+
* @returns {GridKeyValue | null | undefined} The cell key.
|
|
29
|
+
*/
|
|
30
|
+
groupingValueGetter?: (params: GridGroupingValueGetterParams) => GridKeyValue | null | undefined;
|
|
31
|
+
}
|
|
32
|
+
declare module '@mui/x-data-grid' {
|
|
33
|
+
interface GridColDef extends GridColDefPro {
|
|
34
|
+
}
|
|
35
|
+
interface GridEventLookup extends GridEventLookupPro {
|
|
36
|
+
}
|
|
37
|
+
interface GridControlledStateEventLookup extends GridControlledStateEventLookupPro {
|
|
38
|
+
}
|
|
39
|
+
interface GridPreProcessingGroupLookup extends GridPreProcessingGroupLookupPro {
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { GridApiPro } from '../models/gridApiPro';
|
|
3
|
+
import { GridInitialStatePro, GridStatePro } from '../models/gridStatePro';
|
|
4
|
+
export { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
5
|
+
export { useGridApiRef } from '../hooks/utils/useGridApiRef';
|
|
6
|
+
export { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
7
|
+
/**
|
|
8
|
+
* The full grid API.
|
|
9
|
+
*/
|
|
10
|
+
export declare type GridApi = GridApiPro;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Use `React.MutableRefObject<GridApi>` instead
|
|
13
|
+
*/
|
|
14
|
+
export declare type GridApiRef = React.MutableRefObject<GridApiPro>;
|
|
15
|
+
/**
|
|
16
|
+
* The state of `DataGridPro`.
|
|
17
|
+
*/
|
|
18
|
+
export declare type GridState = GridStatePro;
|
|
19
|
+
/**
|
|
20
|
+
* The initial state of `DataGridPro`.
|
|
21
|
+
*/
|
|
22
|
+
export declare type GridInitialState = GridInitialStatePro;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function getFieldFromHeaderElem(colCellEl: Element): string;
|
|
2
|
+
export declare function findHeaderElementFromField(elem: Element, field: string): Element | null;
|
|
3
|
+
export declare function findGridCellElementsFromCol(col: HTMLElement): NodeListOf<Element> | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { gridClasses } from '@mui/x-data-grid';
|
|
2
|
+
import { findParentElementFromClassName } from '@mui/x-data-grid/internals';
|
|
3
|
+
export function getFieldFromHeaderElem(colCellEl) {
|
|
4
|
+
return colCellEl.getAttribute('data-field');
|
|
5
|
+
}
|
|
6
|
+
export function findHeaderElementFromField(elem, field) {
|
|
7
|
+
return elem.querySelector(`[data-field="${field}"]`);
|
|
8
|
+
}
|
|
9
|
+
export function findGridCellElementsFromCol(col) {
|
|
10
|
+
const field = col.getAttribute('data-field');
|
|
11
|
+
const root = findParentElementFromClassName(col, 'MuiDataGrid-root');
|
|
12
|
+
|
|
13
|
+
if (!root) {
|
|
14
|
+
throw new Error('MUI: The root element is not found.');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const cells = root.querySelectorAll(`.${gridClasses.cell}[data-field="${field}"]`);
|
|
18
|
+
return cells;
|
|
19
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { GridRowTreeNodeConfig, GridRowId, GridKeyValue } from '@mui/x-data-grid';
|
|
2
|
+
import { GridRowGroupParams, GridRowGroupingResult } from '@mui/x-data-grid/internals';
|
|
3
|
+
export interface BuildRowTreeGroupingCriteria {
|
|
4
|
+
field: string | null;
|
|
5
|
+
key: GridKeyValue;
|
|
6
|
+
}
|
|
7
|
+
interface BuildRowTreeParams extends GridRowGroupParams {
|
|
8
|
+
rows: {
|
|
9
|
+
id: GridRowId;
|
|
10
|
+
path: BuildRowTreeGroupingCriteria[];
|
|
11
|
+
}[];
|
|
12
|
+
defaultGroupingExpansionDepth: number;
|
|
13
|
+
isGroupExpandedByDefault?: (node: GridRowTreeNodeConfig) => boolean;
|
|
14
|
+
groupingName: string;
|
|
15
|
+
onDuplicatePath?: (firstId: GridRowId, secondId: GridRowId, path: BuildRowTreeGroupingCriteria[]) => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Transform a list of rows into a tree structure where each row references its parent and children.
|
|
19
|
+
* If a row have a parent which does not exist in the input rows, creates an auto generated row
|
|
20
|
+
*
|
|
21
|
+
```
|
|
22
|
+
params = {
|
|
23
|
+
ids: [0, 1, 2],
|
|
24
|
+
idRowsLookup: { 0: {...}, 1: {...}, 2: {...} },
|
|
25
|
+
rows: [
|
|
26
|
+
{ id: 0, path: ['A'] },
|
|
27
|
+
{ id: 1, path: ['B', 'A'] },
|
|
28
|
+
{ id: 2, path: ['B', 'A', 'A'] }
|
|
29
|
+
],
|
|
30
|
+
defaultGroupingExpansionDepth: 0,
|
|
31
|
+
}
|
|
32
|
+
Returns:
|
|
33
|
+
{
|
|
34
|
+
ids: [0, 1, 2, 'auto-generated-row-B'],
|
|
35
|
+
idRowsLookup: { 0: {...}, 1: {...}, 2: {...}, 'auto-generated-row-B': {} },
|
|
36
|
+
tree: {
|
|
37
|
+
'0': { id: 0, parent: null, childrenExpanded: false, depth: 0, groupingKey: 'A' },
|
|
38
|
+
'auto-generated-row-B': { id: 'auto-generated-row-B', parent: null, childrenExpanded: false, depth: 0, groupingKey: 'B' },
|
|
39
|
+
'1': { id: 1, parent: 'auto-generated-row-B', childrenExpanded: false, depth: 1, groupingKey: 'A' },
|
|
40
|
+
'2': { id: 2, parent: 1, childrenExpanded: false, depth: 2, groupingKey: 'A' },
|
|
41
|
+
},
|
|
42
|
+
treeDepth: 3,
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
*/
|
|
46
|
+
export declare const buildRowTree: (params: BuildRowTreeParams) => GridRowGroupingResult;
|
|
47
|
+
export {};
|