@mui/x-data-grid-pro 5.5.1 → 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 +116 -0
- 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 +10 -12
- 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 -5495
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["hideDescendantCount"];
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { useGridRegisterPreProcessor } from '@mui/x-data-grid/internals';
|
|
7
|
+
import { GRID_TREE_DATA_GROUPING_COL_DEF, GRID_TREE_DATA_GROUPING_COL_DEF_FORCED_PROPERTIES } from './gridTreeDataGroupColDef';
|
|
8
|
+
import { TREE_DATA_GROUPING_NAME } from './useGridTreeData';
|
|
9
|
+
import { GridTreeDataGroupingCell } from '../../../components';
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
export var useGridTreeDataPreProcessors = function useGridTreeDataPreProcessors(apiRef, props) {
|
|
12
|
+
var getGroupingColDef = React.useCallback(function () {
|
|
13
|
+
var _colDefOverride;
|
|
14
|
+
|
|
15
|
+
var groupingColDefProp = props.groupingColDef;
|
|
16
|
+
var colDefOverride;
|
|
17
|
+
|
|
18
|
+
if (typeof groupingColDefProp === 'function') {
|
|
19
|
+
var params = {
|
|
20
|
+
groupingName: TREE_DATA_GROUPING_NAME,
|
|
21
|
+
fields: []
|
|
22
|
+
};
|
|
23
|
+
colDefOverride = groupingColDefProp(params);
|
|
24
|
+
} else {
|
|
25
|
+
colDefOverride = groupingColDefProp;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var _ref = (_colDefOverride = colDefOverride) != null ? _colDefOverride : {},
|
|
29
|
+
hideDescendantCount = _ref.hideDescendantCount,
|
|
30
|
+
colDefOverrideProperties = _objectWithoutProperties(_ref, _excluded);
|
|
31
|
+
|
|
32
|
+
var commonProperties = _extends({}, GRID_TREE_DATA_GROUPING_COL_DEF, {
|
|
33
|
+
renderCell: function renderCell(params) {
|
|
34
|
+
return /*#__PURE__*/_jsx(GridTreeDataGroupingCell, _extends({}, params, {
|
|
35
|
+
hideDescendantCount: hideDescendantCount
|
|
36
|
+
}));
|
|
37
|
+
},
|
|
38
|
+
headerName: apiRef.current.getLocaleText('treeDataGroupingHeaderName')
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return _extends({}, commonProperties, colDefOverrideProperties, GRID_TREE_DATA_GROUPING_COL_DEF_FORCED_PROPERTIES);
|
|
42
|
+
}, [apiRef, props.groupingColDef]);
|
|
43
|
+
var updateGroupingColumn = React.useCallback(function (columnsState) {
|
|
44
|
+
var groupingColDefField = GRID_TREE_DATA_GROUPING_COL_DEF_FORCED_PROPERTIES.field;
|
|
45
|
+
var shouldHaveGroupingColumn = props.treeData;
|
|
46
|
+
var prevGroupingColumn = columnsState.lookup[groupingColDefField];
|
|
47
|
+
|
|
48
|
+
if (shouldHaveGroupingColumn) {
|
|
49
|
+
var newGroupingColumn = getGroupingColDef();
|
|
50
|
+
|
|
51
|
+
if (prevGroupingColumn) {
|
|
52
|
+
newGroupingColumn.width = prevGroupingColumn.width;
|
|
53
|
+
newGroupingColumn.flex = prevGroupingColumn.flex;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
columnsState.lookup[groupingColDefField] = newGroupingColumn;
|
|
57
|
+
|
|
58
|
+
if (prevGroupingColumn == null) {
|
|
59
|
+
var index = columnsState.all[0] === '__check__' ? 1 : 0;
|
|
60
|
+
columnsState.all = [].concat(_toConsumableArray(columnsState.all.slice(0, index)), [groupingColDefField], _toConsumableArray(columnsState.all.slice(index)));
|
|
61
|
+
}
|
|
62
|
+
} else if (!shouldHaveGroupingColumn && prevGroupingColumn) {
|
|
63
|
+
delete columnsState.lookup[groupingColDefField];
|
|
64
|
+
columnsState.all = columnsState.all.filter(function (field) {
|
|
65
|
+
return field !== groupingColDefField;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return columnsState;
|
|
70
|
+
}, [props.treeData, getGroupingColDef]);
|
|
71
|
+
useGridRegisterPreProcessor(apiRef, 'hydrateColumns', updateGroupingColumn);
|
|
72
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './features';
|
package/legacy/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** @license MUI v5.6.0
|
|
2
|
+
*
|
|
3
|
+
* This source code is licensed under the MIT license found in the
|
|
4
|
+
* LICENSE file in the root directory of this source tree.
|
|
5
|
+
*/
|
|
6
|
+
import './typeOverloads/modules';
|
|
7
|
+
export { LicenseInfo } from '@mui/x-license-pro';
|
|
8
|
+
export * from '@mui/x-data-grid/components';
|
|
9
|
+
export * from '@mui/x-data-grid/constants';
|
|
10
|
+
export * from '@mui/x-data-grid/hooks';
|
|
11
|
+
export * from '@mui/x-data-grid/locales';
|
|
12
|
+
export * from '@mui/x-data-grid/models';
|
|
13
|
+
export * from '@mui/x-data-grid/context';
|
|
14
|
+
export * from '@mui/x-data-grid/colDef';
|
|
15
|
+
export * from '@mui/x-data-grid/utils';
|
|
16
|
+
export * from './DataGridPro';
|
|
17
|
+
export * from './hooks';
|
|
18
|
+
export * from './models';
|
|
19
|
+
export { useGridApiContext, useGridApiRef, useGridRootProps } from './typeOverloads/reexports';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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=\"".concat(field, "\"]"));
|
|
8
|
+
}
|
|
9
|
+
export function findGridCellElementsFromCol(col) {
|
|
10
|
+
var field = col.getAttribute('data-field');
|
|
11
|
+
var root = findParentElementFromClassName(col, 'MuiDataGrid-root');
|
|
12
|
+
|
|
13
|
+
if (!root) {
|
|
14
|
+
throw new Error('MUI: The root element is not found.');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var cells = root.querySelectorAll(".".concat(gridClasses.cell, "[data-field=\"").concat(field, "\"]"));
|
|
18
|
+
return cells;
|
|
19
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Transform a list of rows into a tree structure where each row references its parent and children.
|
|
6
|
+
* If a row have a parent which does not exist in the input rows, creates an auto generated row
|
|
7
|
+
*
|
|
8
|
+
```
|
|
9
|
+
params = {
|
|
10
|
+
ids: [0, 1, 2],
|
|
11
|
+
idRowsLookup: { 0: {...}, 1: {...}, 2: {...} },
|
|
12
|
+
rows: [
|
|
13
|
+
{ id: 0, path: ['A'] },
|
|
14
|
+
{ id: 1, path: ['B', 'A'] },
|
|
15
|
+
{ id: 2, path: ['B', 'A', 'A'] }
|
|
16
|
+
],
|
|
17
|
+
defaultGroupingExpansionDepth: 0,
|
|
18
|
+
}
|
|
19
|
+
Returns:
|
|
20
|
+
{
|
|
21
|
+
ids: [0, 1, 2, 'auto-generated-row-B'],
|
|
22
|
+
idRowsLookup: { 0: {...}, 1: {...}, 2: {...}, 'auto-generated-row-B': {} },
|
|
23
|
+
tree: {
|
|
24
|
+
'0': { id: 0, parent: null, childrenExpanded: false, depth: 0, groupingKey: 'A' },
|
|
25
|
+
'auto-generated-row-B': { id: 'auto-generated-row-B', parent: null, childrenExpanded: false, depth: 0, groupingKey: 'B' },
|
|
26
|
+
'1': { id: 1, parent: 'auto-generated-row-B', childrenExpanded: false, depth: 1, groupingKey: 'A' },
|
|
27
|
+
'2': { id: 2, parent: 1, childrenExpanded: false, depth: 2, groupingKey: 'A' },
|
|
28
|
+
},
|
|
29
|
+
treeDepth: 3,
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
*/
|
|
33
|
+
export var buildRowTree = function buildRowTree(params) {
|
|
34
|
+
// During the build, we store the children as a Record to avoid linear complexity when checking if a children is already defined.
|
|
35
|
+
var tempTree = {};
|
|
36
|
+
var treeDepth = 1;
|
|
37
|
+
|
|
38
|
+
var ids = _toConsumableArray(params.ids);
|
|
39
|
+
|
|
40
|
+
var idRowsLookup = _extends({}, params.idRowsLookup);
|
|
41
|
+
|
|
42
|
+
var groupingCriteriaToIdTree = {};
|
|
43
|
+
|
|
44
|
+
var isGroupExpandedByDefault = function isGroupExpandedByDefault(node) {
|
|
45
|
+
var _params$previousTree, _params$previousTree$;
|
|
46
|
+
|
|
47
|
+
var previousExpansion = (_params$previousTree = params.previousTree) == null ? void 0 : (_params$previousTree$ = _params$previousTree[node.id]) == null ? void 0 : _params$previousTree$.childrenExpanded;
|
|
48
|
+
|
|
49
|
+
if (previousExpansion != null) {
|
|
50
|
+
return previousExpansion;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (!node.children || !node.children.length) {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (params.isGroupExpandedByDefault) {
|
|
58
|
+
return params.isGroupExpandedByDefault(node);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return params.defaultGroupingExpansionDepth === -1 || params.defaultGroupingExpansionDepth > node.depth;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
for (var i = 0; i < params.rows.length; i += 1) {
|
|
65
|
+
var row = params.rows[i];
|
|
66
|
+
var keyToIdSubTree = groupingCriteriaToIdTree;
|
|
67
|
+
var parentNode = null;
|
|
68
|
+
|
|
69
|
+
for (var depth = 0; depth < row.path.length; depth += 1) {
|
|
70
|
+
var _row$path$depth = row.path[depth],
|
|
71
|
+
_key = _row$path$depth.key,
|
|
72
|
+
rawField = _row$path$depth.field;
|
|
73
|
+
|
|
74
|
+
var _field = rawField != null ? rawField : '__no_field__';
|
|
75
|
+
|
|
76
|
+
var nodeId = void 0;
|
|
77
|
+
var fieldSubTree = keyToIdSubTree[_field];
|
|
78
|
+
|
|
79
|
+
if (!fieldSubTree) {
|
|
80
|
+
fieldSubTree = {};
|
|
81
|
+
keyToIdSubTree[_field] = fieldSubTree;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
var keyConfig = fieldSubTree[_key.toString()];
|
|
85
|
+
|
|
86
|
+
if (keyConfig) {
|
|
87
|
+
if (depth === row.path.length - 1) {
|
|
88
|
+
var _params$onDuplicatePa;
|
|
89
|
+
|
|
90
|
+
(_params$onDuplicatePa = params.onDuplicatePath) == null ? void 0 : _params$onDuplicatePa.call(params, keyConfig.id, row.id, row.path);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
nodeId = keyConfig.id;
|
|
94
|
+
} else {
|
|
95
|
+
if (depth === row.path.length - 1) {
|
|
96
|
+
nodeId = row.id;
|
|
97
|
+
} else {
|
|
98
|
+
nodeId = "auto-generated-row-".concat(row.path.map(function (groupingCriteria) {
|
|
99
|
+
return "".concat(groupingCriteria.field, "/").concat(groupingCriteria.key);
|
|
100
|
+
}).slice(0, depth + 1).join('-'));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
keyConfig = {
|
|
104
|
+
id: nodeId,
|
|
105
|
+
children: {}
|
|
106
|
+
};
|
|
107
|
+
fieldSubTree[_key.toString()] = keyConfig;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
keyToIdSubTree = keyConfig.children;
|
|
111
|
+
|
|
112
|
+
if (!tempTree[nodeId]) {
|
|
113
|
+
var _parentNode$id, _parentNode;
|
|
114
|
+
|
|
115
|
+
var isAutoGenerated = depth < row.path.length - 1;
|
|
116
|
+
var _node = {
|
|
117
|
+
id: nodeId,
|
|
118
|
+
isAutoGenerated: isAutoGenerated,
|
|
119
|
+
parent: (_parentNode$id = (_parentNode = parentNode) == null ? void 0 : _parentNode.id) != null ? _parentNode$id : null,
|
|
120
|
+
groupingKey: _key,
|
|
121
|
+
groupingField: rawField,
|
|
122
|
+
depth: depth
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
if (isAutoGenerated) {
|
|
126
|
+
idRowsLookup[nodeId] = {};
|
|
127
|
+
ids.push(nodeId);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
tempTree[nodeId] = _node;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (parentNode != null) {
|
|
134
|
+
if (!parentNode.children) {
|
|
135
|
+
parentNode.children = {};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
parentNode.children[nodeId] = nodeId;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
parentNode = tempTree[nodeId];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
treeDepth = Math.max(treeDepth, row.path.length);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
var tree = {};
|
|
148
|
+
|
|
149
|
+
var _loop = function _loop(_i) {
|
|
150
|
+
var _params$previousTree2, _previousNode$childre, _node$children, _previousNode$childre2;
|
|
151
|
+
|
|
152
|
+
var rowId = ids[_i];
|
|
153
|
+
var tempNode = tempTree[rowId];
|
|
154
|
+
|
|
155
|
+
var nodeWithoutChildrenExpansion = _extends({}, tempNode, {
|
|
156
|
+
children: tempNode.children ? Object.values(tempNode.children) : undefined
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
var node = _extends({}, nodeWithoutChildrenExpansion, {
|
|
160
|
+
childrenExpanded: isGroupExpandedByDefault(nodeWithoutChildrenExpansion)
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
var previousNode = (_params$previousTree2 = params.previousTree) == null ? void 0 : _params$previousTree2[node.id];
|
|
164
|
+
var 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(function (childId, index) {
|
|
165
|
+
var _node$children2;
|
|
166
|
+
|
|
167
|
+
return ((_node$children2 = node.children) == null ? void 0 : _node$children2[index]) === childId;
|
|
168
|
+
}));
|
|
169
|
+
|
|
170
|
+
if (shouldReUsePreviousNode) {
|
|
171
|
+
tree[rowId] = previousNode;
|
|
172
|
+
} else {
|
|
173
|
+
tree[rowId] = node;
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
for (var _i = 0; _i < ids.length; _i += 1) {
|
|
178
|
+
_loop(_i);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return {
|
|
182
|
+
tree: tree,
|
|
183
|
+
treeDepth: treeDepth,
|
|
184
|
+
ids: ids,
|
|
185
|
+
idRowsLookup: idRowsLookup,
|
|
186
|
+
groupingName: params.groupingName
|
|
187
|
+
};
|
|
188
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
export var sortRowTree = function sortRowTree(params) {
|
|
3
|
+
var rowIds = params.rowIds,
|
|
4
|
+
rowTree = params.rowTree,
|
|
5
|
+
disableChildrenSorting = params.disableChildrenSorting,
|
|
6
|
+
sortRowList = params.sortRowList;
|
|
7
|
+
var sortedRows = []; // Group the rows by parent
|
|
8
|
+
|
|
9
|
+
var groupedByParentRows = new Map([[null, []]]);
|
|
10
|
+
|
|
11
|
+
for (var i = 0; i < rowIds.length; i += 1) {
|
|
12
|
+
var rowId = rowIds[i];
|
|
13
|
+
var node = rowTree[rowId];
|
|
14
|
+
var group = groupedByParentRows.get(node.parent);
|
|
15
|
+
|
|
16
|
+
if (!group) {
|
|
17
|
+
group = [];
|
|
18
|
+
groupedByParentRows.set(node.parent, group);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
group.push(node);
|
|
22
|
+
} // Apply the sorting to each list of children
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
var sortedGroupedByParentRows = new Map();
|
|
26
|
+
groupedByParentRows.forEach(function (rowList, parent) {
|
|
27
|
+
if (rowList.length === 0) {
|
|
28
|
+
sortedGroupedByParentRows.set(parent, []);
|
|
29
|
+
} else {
|
|
30
|
+
var depth = rowList[0].depth;
|
|
31
|
+
|
|
32
|
+
if (depth > 0 && disableChildrenSorting) {
|
|
33
|
+
sortedGroupedByParentRows.set(parent, rowList.map(function (row) {
|
|
34
|
+
return row.id;
|
|
35
|
+
}));
|
|
36
|
+
} else if (!sortRowList) {
|
|
37
|
+
sortedGroupedByParentRows.set(parent, rowList.map(function (row) {
|
|
38
|
+
return row.id;
|
|
39
|
+
}));
|
|
40
|
+
} else {
|
|
41
|
+
sortedGroupedByParentRows.set(parent, sortRowList(rowList));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}); // Flatten the sorted lists to have children just after their parent
|
|
45
|
+
|
|
46
|
+
var insertRowListIntoSortedRows = function insertRowListIntoSortedRows(startIndex, rowList) {
|
|
47
|
+
sortedRows = [].concat(_toConsumableArray(sortedRows.slice(0, startIndex)), _toConsumableArray(rowList), _toConsumableArray(sortedRows.slice(startIndex)));
|
|
48
|
+
var treeSize = 0;
|
|
49
|
+
rowList.forEach(function (rowId) {
|
|
50
|
+
treeSize += 1;
|
|
51
|
+
var children = sortedGroupedByParentRows.get(rowId);
|
|
52
|
+
|
|
53
|
+
if (children != null && children.length) {
|
|
54
|
+
var subTreeSize = insertRowListIntoSortedRows(startIndex + treeSize, children);
|
|
55
|
+
treeSize += subTreeSize;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
return treeSize;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
insertRowListIntoSortedRows(0, sortedGroupedByParentRows.get(null));
|
|
62
|
+
return sortedRows;
|
|
63
|
+
};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GridRowModel, GridRowTreeNodeConfig, GridEventListener, GridEvents, GridCallbackDetails, GridRowParams, GridRowId } from '@mui/x-data-grid';
|
|
3
|
+
import { GridExperimentalFeatures, DataGridPropsWithoutDefaultValue, DataGridPropsWithDefaultValues, DataGridPropsWithComplexDefaultValueAfterProcessing, DataGridPropsWithComplexDefaultValueBeforeProcessing } from '@mui/x-data-grid/internals';
|
|
4
|
+
import type { GridPinnedColumns } from '../hooks/features/columnPinning';
|
|
5
|
+
import { GridApiPro } from './gridApiPro';
|
|
6
|
+
import { GridGroupingColDefOverride, GridGroupingColDefOverrideParams } from './gridGroupingColDefOverride';
|
|
7
|
+
import type { GridRowGroupingModel } from '../hooks/features/rowGrouping';
|
|
8
|
+
import { GridInitialStatePro } from './gridStatePro';
|
|
9
|
+
export interface GridExperimentalProFeatures extends GridExperimentalFeatures {
|
|
10
|
+
/**
|
|
11
|
+
* Will be part of the premium-plan when fully ready.
|
|
12
|
+
*/
|
|
13
|
+
rowGrouping: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The props users can give to the `DataGridProProps` component.
|
|
17
|
+
*/
|
|
18
|
+
export interface DataGridProProps extends Omit<Partial<DataGridProPropsWithDefaultValue> & DataGridPropsWithComplexDefaultValueBeforeProcessing & DataGridProPropsWithoutDefaultValue, DataGridProForcedPropsKey> {
|
|
19
|
+
/**
|
|
20
|
+
* Features under development.
|
|
21
|
+
* For each feature, if the flag is not explicitly set to `true`, the feature will be fully disabled and any property / method call will not have any effect.
|
|
22
|
+
*/
|
|
23
|
+
experimentalFeatures?: Partial<GridExperimentalProFeatures>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The props of the `DataGridPro` component after the pre-processing phase.
|
|
27
|
+
*/
|
|
28
|
+
export interface DataGridProProcessedProps extends DataGridProPropsWithDefaultValue, DataGridPropsWithComplexDefaultValueAfterProcessing, DataGridProPropsWithoutDefaultValue {
|
|
29
|
+
}
|
|
30
|
+
export declare type DataGridProForcedPropsKey = 'signature';
|
|
31
|
+
/**
|
|
32
|
+
* The `DataGridPro` options with a default value overridable through props
|
|
33
|
+
* None of the entry of this interface should be optional, they all have default values and `DataGridProps` already applies a `Partial<DataGridSimpleOptions>` for the public interface
|
|
34
|
+
* The controlled model do not have a default value at the prop processing level, so they must be defined in `DataGridOtherProps`
|
|
35
|
+
*/
|
|
36
|
+
export interface DataGridProPropsWithDefaultValue extends DataGridPropsWithDefaultValues {
|
|
37
|
+
/**
|
|
38
|
+
* Set the area in `px` at the bottom of the grid viewport where onRowsScrollEnd is called.
|
|
39
|
+
* @default 80
|
|
40
|
+
*/
|
|
41
|
+
scrollEndThreshold: number;
|
|
42
|
+
/**
|
|
43
|
+
* If `true`, the rows will be gathered in a tree structure according to the `getTreeDataPath` prop.
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
treeData: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* If above 0, the row children will be expanded up to this depth.
|
|
49
|
+
* If equal to -1, all the row children will be expanded.
|
|
50
|
+
* @default 0
|
|
51
|
+
*/
|
|
52
|
+
defaultGroupingExpansionDepth: number;
|
|
53
|
+
/**
|
|
54
|
+
* Determines if a group should be expanded after its creation.
|
|
55
|
+
* This prop takes priority over the `defaultGroupingExpansionDepth` prop.
|
|
56
|
+
* @param {GridRowTreeNodeConfig} node The node of the group to test.
|
|
57
|
+
* @returns {boolean} A boolean indicating if the group is expanded.
|
|
58
|
+
*/
|
|
59
|
+
isGroupExpandedByDefault?: (node: GridRowTreeNodeConfig) => boolean;
|
|
60
|
+
/**
|
|
61
|
+
* If `true`, the column pinning is disabled.
|
|
62
|
+
* @default false
|
|
63
|
+
*/
|
|
64
|
+
disableColumnPinning: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* If `true`, the filtering will only be applied to the top level rows when grouping rows with the `treeData` prop.
|
|
67
|
+
* @default false
|
|
68
|
+
*/
|
|
69
|
+
disableChildrenFiltering: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* If `true`, the sorting will only be applied to the top level rows when grouping rows with the `treeData` prop.
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
74
|
+
disableChildrenSorting: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* If `true`, the row grouping is disabled.
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
79
|
+
disableRowGrouping: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* If `single`, all column we are grouping by will be represented in the same grouping the same column.
|
|
82
|
+
* If `multiple`, each column we are grouping by will be represented in its own column.
|
|
83
|
+
* @default 'single'
|
|
84
|
+
*/
|
|
85
|
+
rowGroupingColumnMode: 'single' | 'multiple';
|
|
86
|
+
/**
|
|
87
|
+
* Function that returns the height of the row detail panel.
|
|
88
|
+
* @param {GridRowParams} params With all properties from [[GridRowParams]].
|
|
89
|
+
* @returns {number} The height in pixels.
|
|
90
|
+
* @default "() => 500"
|
|
91
|
+
*/
|
|
92
|
+
getDetailPanelHeight: (params: GridRowParams) => number;
|
|
93
|
+
}
|
|
94
|
+
export interface DataGridProPropsWithoutDefaultValue extends Omit<DataGridPropsWithoutDefaultValue, 'initialState'> {
|
|
95
|
+
/**
|
|
96
|
+
* The ref object that allows grid manipulation. Can be instantiated with [[useGridApiRef()]].
|
|
97
|
+
*/
|
|
98
|
+
apiRef?: React.MutableRefObject<GridApiPro>;
|
|
99
|
+
/**
|
|
100
|
+
* The initial state of the DataGridPro.
|
|
101
|
+
* The data in it will be set in the state on initialization but will not be controlled.
|
|
102
|
+
* If one of the data in `initialState` is also being controlled, then the control state wins.
|
|
103
|
+
*/
|
|
104
|
+
initialState?: GridInitialStatePro;
|
|
105
|
+
/**
|
|
106
|
+
* Determines the path of a row in the tree data.
|
|
107
|
+
* For instance, a row with the path ["A", "B"] is the child of the row with the path ["A"].
|
|
108
|
+
* Note that all paths must contain at least one element.
|
|
109
|
+
* @param {GridRowModel} row The row from which we want the path.
|
|
110
|
+
* @returns {string[]} The path to the row.
|
|
111
|
+
*/
|
|
112
|
+
getTreeDataPath?: (row: GridRowModel) => string[];
|
|
113
|
+
/**
|
|
114
|
+
* Callback fired while a column is being resized.
|
|
115
|
+
* @param {GridColumnResizeParams} params With all properties from [[GridColumnResizeParams]].
|
|
116
|
+
* @param {MuiEvent<React.MouseEvent>} event The event object.
|
|
117
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
118
|
+
*/
|
|
119
|
+
onColumnResize?: GridEventListener<GridEvents.columnResize>;
|
|
120
|
+
/**
|
|
121
|
+
* Callback fired when the width of a column is changed.
|
|
122
|
+
* @param {GridColumnResizeParams} params With all properties from [[GridColumnResizeParams]].
|
|
123
|
+
* @param {MuiEvent<React.MouseEvent>} event The event object.
|
|
124
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
125
|
+
*/
|
|
126
|
+
onColumnWidthChange?: GridEventListener<GridEvents.columnWidthChange>;
|
|
127
|
+
/**
|
|
128
|
+
* Callback fired when scrolling to the bottom of the grid viewport.
|
|
129
|
+
* @param {GridRowScrollEndParams} params With all properties from [[GridRowScrollEndParams]].
|
|
130
|
+
* @param {MuiEvent<{}>} event The event object.
|
|
131
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
132
|
+
*/
|
|
133
|
+
onRowsScrollEnd?: GridEventListener<GridEvents.rowsScrollEnd>;
|
|
134
|
+
/**
|
|
135
|
+
* The column fields to display pinned to left or right.
|
|
136
|
+
*/
|
|
137
|
+
pinnedColumns?: GridPinnedColumns;
|
|
138
|
+
/**
|
|
139
|
+
* Callback fired when the pinned columns have changed.
|
|
140
|
+
* @param {GridPinnedColumns} pinnedColumns The changed pinned columns.
|
|
141
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
142
|
+
*/
|
|
143
|
+
onPinnedColumnsChange?: (pinnedColumns: GridPinnedColumns, details: GridCallbackDetails) => void;
|
|
144
|
+
/**
|
|
145
|
+
* Set the row grouping model of the grid.
|
|
146
|
+
*/
|
|
147
|
+
rowGroupingModel?: GridRowGroupingModel;
|
|
148
|
+
/**
|
|
149
|
+
* Callback fired when the row grouping model changes.
|
|
150
|
+
* @param {GridRowGroupingModel} model Columns used as grouping criteria.
|
|
151
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
152
|
+
*/
|
|
153
|
+
onRowGroupingModelChange?: (model: GridRowGroupingModel, details: GridCallbackDetails) => void;
|
|
154
|
+
/**
|
|
155
|
+
* The grouping column used by the tree data.
|
|
156
|
+
*/
|
|
157
|
+
groupingColDef?: GridGroupingColDefOverride | ((params: GridGroupingColDefOverrideParams) => GridGroupingColDefOverride | undefined | null);
|
|
158
|
+
/**
|
|
159
|
+
* The row ids to show the detail panel.
|
|
160
|
+
*/
|
|
161
|
+
detailPanelExpandedRowIds?: GridRowId[];
|
|
162
|
+
/**
|
|
163
|
+
* Callback fired when the detail panel of a row is opened or closed.
|
|
164
|
+
* @param {GridRowId[]} ids The ids of the rows which have the detail panel open.
|
|
165
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
166
|
+
*/
|
|
167
|
+
onDetailPanelExpandedRowIdsChange?: (ids: GridRowId[], details: GridCallbackDetails) => void;
|
|
168
|
+
/**
|
|
169
|
+
* Function that returns the element to render in row detail.
|
|
170
|
+
* @param {GridRowParams} params With all properties from [[GridRowParams]].
|
|
171
|
+
* @returns {JSX.Element} The row detail element.
|
|
172
|
+
*/
|
|
173
|
+
getDetailPanelContent?: (params: GridRowParams) => React.ReactNode;
|
|
174
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GridApiCommon, GridStateApi, GridStatePersistenceApi } from '@mui/x-data-grid';
|
|
2
|
+
import { GridInitialStatePro, GridStatePro } from './gridStatePro';
|
|
3
|
+
import type { GridColumnPinningApi, GridRowGroupingApi, GridDetailPanelApi } from '../hooks';
|
|
4
|
+
declare type GridStateApiUntyped = {
|
|
5
|
+
[key in keyof (GridStateApi<any> & GridStatePersistenceApi<any>)]: any;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The api of `DataGridPro`.
|
|
9
|
+
*/
|
|
10
|
+
export interface GridApiPro extends Omit<GridApiCommon, keyof GridStateApiUntyped>, GridStateApi<GridStatePro>, GridStatePersistenceApi<GridInitialStatePro>, GridRowGroupingApi, GridColumnPinningApi, GridDetailPanelApi {
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { GridColDef } from '@mui/x-data-grid';
|
|
2
|
+
export interface GridGroupingColDefOverride extends Omit<GridColDef, 'editable' | 'valueSetter' | 'field' | 'type' | 'preProcessEditCellProps' | 'renderEditCell' | 'groupable'> {
|
|
3
|
+
/**
|
|
4
|
+
* The field from which we want to apply the sorting and the filtering for the grouping column.
|
|
5
|
+
* It is only useful when `props.rowGroupingColumnMode === "multiple"` to decide which grouping criteria should be used for sorting and filtering.
|
|
6
|
+
* Do not have any effect when building the tree with the `props.treeData` feature.
|
|
7
|
+
* @default: The sorting and filtering is applied based on the leaf field in any, otherwise based on top level grouping criteria.
|
|
8
|
+
*/
|
|
9
|
+
mainGroupingCriteria?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The field from which we want to render the leaves of the tree.
|
|
12
|
+
* Do not have any effect when building the tree with the `props.treeData` feature.
|
|
13
|
+
*/
|
|
14
|
+
leafField?: string;
|
|
15
|
+
/**
|
|
16
|
+
* If `true`, the grouping cells will not render the amount of descendants.
|
|
17
|
+
* @default: false
|
|
18
|
+
*/
|
|
19
|
+
hideDescendantCount?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface GridGroupingColDefOverrideParams {
|
|
22
|
+
/**
|
|
23
|
+
* The name of the grouping algorithm currently building the grouping column.
|
|
24
|
+
*/
|
|
25
|
+
groupingName: string;
|
|
26
|
+
/**
|
|
27
|
+
* The fields of the columns from which we want to group the values on this new grouping column.
|
|
28
|
+
*/
|
|
29
|
+
fields: string[];
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|