@mui/x-data-grid-pro 5.5.1 → 5.7.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 +229 -0
- package/DataGridPro/DataGridPro.d.ts +3 -0
- package/DataGridPro/DataGridPro.js +915 -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 +84 -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 +270 -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 +125 -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 +160 -0
- package/components/index.d.ts +3 -0
- package/components/index.js +4 -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 +10 -0
- package/hooks/features/columnReorder/useGridColumnReorder.js +165 -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 +11 -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 +6 -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 +37 -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 +27 -0
- package/hooks/features/rowGrouping/gridRowGroupingUtils.js +139 -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 +204 -0
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.d.ts +4 -0
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +203 -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 +15 -0
- package/hooks/features/treeData/gridTreeDataUtils.js +88 -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 +6 -0
- package/hooks/features/treeData/useGridTreeData.js +29 -0
- package/hooks/features/treeData/useGridTreeDataPreProcessors.d.ts +4 -0
- package/hooks/features/treeData/useGridTreeDataPreProcessors.js +138 -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 +16 -0
- package/index.js +20 -0
- package/legacy/DataGridPro/DataGridPro.js +915 -0
- package/legacy/DataGridPro/index.js +2 -0
- package/legacy/DataGridPro/useDataGridProComponent.js +84 -0
- package/legacy/DataGridPro/useDataGridProProps.js +58 -0
- package/legacy/components/DataGridProColumnHeaders.js +173 -0
- package/legacy/components/DataGridProVirtualScroller.js +287 -0
- package/legacy/components/GridColumnPinningMenuItems.js +71 -0
- package/legacy/components/GridDetailPanelToggleCell.js +121 -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 +156 -0
- package/legacy/components/index.js +4 -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 +171 -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 +147 -0
- package/legacy/hooks/features/rowGrouping/index.js +3 -0
- package/legacy/hooks/features/rowGrouping/useGridRowGrouping.js +210 -0
- package/legacy/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +217 -0
- package/legacy/hooks/features/treeData/gridTreeDataGroupColDef.js +24 -0
- package/legacy/hooks/features/treeData/gridTreeDataUtils.js +86 -0
- package/legacy/hooks/features/treeData/index.js +1 -0
- package/legacy/hooks/features/treeData/useGridTreeData.js +29 -0
- package/legacy/hooks/features/treeData/useGridTreeDataPreProcessors.js +153 -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 +20 -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/releaseInfo.js +15 -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 +915 -0
- package/modern/DataGridPro/index.js +2 -0
- package/modern/DataGridPro/useDataGridProComponent.js +82 -0
- package/modern/DataGridPro/useDataGridProProps.js +45 -0
- package/modern/components/DataGridProColumnHeaders.js +163 -0
- package/modern/components/DataGridProVirtualScroller.js +268 -0
- package/modern/components/GridColumnPinningMenuItems.js +71 -0
- package/modern/components/GridDetailPanelToggleCell.js +125 -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 +158 -0
- package/modern/components/index.js +4 -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 +165 -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 +137 -0
- package/modern/hooks/features/rowGrouping/index.js +3 -0
- package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +196 -0
- package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +203 -0
- package/modern/hooks/features/treeData/gridTreeDataGroupColDef.js +22 -0
- package/modern/hooks/features/treeData/gridTreeDataUtils.js +84 -0
- package/modern/hooks/features/treeData/index.js +1 -0
- package/modern/hooks/features/treeData/useGridTreeData.js +27 -0
- package/modern/hooks/features/treeData/useGridTreeDataPreProcessors.js +136 -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 +20 -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/releaseInfo.js +15 -0
- package/modern/utils/tree/buildRowTree.js +167 -0
- package/modern/utils/tree/sortRowTree.js +60 -0
- package/node/DataGridPro/DataGridPro.js +939 -0
- package/node/DataGridPro/index.js +30 -0
- package/node/DataGridPro/useDataGridProComponent.js +106 -0
- package/node/DataGridPro/useDataGridProProps.js +69 -0
- package/node/components/DataGridProColumnHeaders.js +189 -0
- package/node/components/DataGridProVirtualScroller.js +297 -0
- package/node/components/GridColumnPinningMenuItems.js +88 -0
- package/node/components/GridDetailPanelToggleCell.js +146 -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 +181 -0
- package/node/components/index.js +44 -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 +188 -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 +329 -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 +133 -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 +172 -0
- package/node/hooks/features/rowGrouping/index.js +51 -0
- package/node/hooks/features/rowGrouping/useGridRowGrouping.js +232 -0
- package/node/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +227 -0
- package/node/hooks/features/treeData/gridTreeDataGroupColDef.js +35 -0
- package/node/hooks/features/treeData/gridTreeDataUtils.js +98 -0
- package/node/hooks/features/treeData/index.js +13 -0
- package/node/hooks/features/treeData/useGridTreeData.js +43 -0
- package/node/hooks/features/treeData/useGridTreeDataPreProcessors.js +164 -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 +214 -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/releaseInfo.js +25 -0
- package/node/utils/tree/buildRowTree.js +185 -0
- package/node/utils/tree/sortRowTree.js +69 -0
- package/package.json +11 -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/releaseInfo.d.ts +1 -0
- package/utils/releaseInfo.js +15 -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 @@
|
|
|
1
|
+
export declare const getReleaseInfo: () => any;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ponyfillGlobal } from '@mui/utils';
|
|
2
|
+
export const getReleaseInfo = () => {
|
|
3
|
+
const releaseInfo = "MTY0ODA5MDgwMDAwMA==";
|
|
4
|
+
|
|
5
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6
|
+
// A simple hack to set the value in the test environment (has no build step).
|
|
7
|
+
// eslint-disable-next-line no-useless-concat
|
|
8
|
+
if (releaseInfo === '__RELEASE' + '_INFO__') {
|
|
9
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
10
|
+
return ponyfillGlobal.__MUI_RELEASE_INFO__;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return releaseInfo;
|
|
15
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { GridRowTreeNodeConfig, GridRowId, GridKeyValue } from '@mui/x-data-grid';
|
|
2
|
+
import { GridRowTreeCreationParams, GridRowTreeCreationValue } from '@mui/x-data-grid/internals';
|
|
3
|
+
export interface BuildRowTreeGroupingCriteria {
|
|
4
|
+
field: string | null;
|
|
5
|
+
key: GridKeyValue;
|
|
6
|
+
}
|
|
7
|
+
interface BuildRowTreeParams extends GridRowTreeCreationParams {
|
|
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) => GridRowTreeCreationValue;
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Transform a list of rows into a tree structure where each row references its parent and children.
|
|
5
|
+
* If a row have a parent which does not exist in the input rows, creates an auto generated row
|
|
6
|
+
*
|
|
7
|
+
```
|
|
8
|
+
params = {
|
|
9
|
+
ids: [0, 1, 2],
|
|
10
|
+
idRowsLookup: { 0: {...}, 1: {...}, 2: {...} },
|
|
11
|
+
rows: [
|
|
12
|
+
{ id: 0, path: ['A'] },
|
|
13
|
+
{ id: 1, path: ['B', 'A'] },
|
|
14
|
+
{ id: 2, path: ['B', 'A', 'A'] }
|
|
15
|
+
],
|
|
16
|
+
defaultGroupingExpansionDepth: 0,
|
|
17
|
+
}
|
|
18
|
+
Returns:
|
|
19
|
+
{
|
|
20
|
+
ids: [0, 1, 2, 'auto-generated-row-B'],
|
|
21
|
+
idRowsLookup: { 0: {...}, 1: {...}, 2: {...}, 'auto-generated-row-B': {} },
|
|
22
|
+
tree: {
|
|
23
|
+
'0': { id: 0, parent: null, childrenExpanded: false, depth: 0, groupingKey: 'A' },
|
|
24
|
+
'auto-generated-row-B': { id: 'auto-generated-row-B', parent: null, childrenExpanded: false, depth: 0, groupingKey: 'B' },
|
|
25
|
+
'1': { id: 1, parent: 'auto-generated-row-B', childrenExpanded: false, depth: 1, groupingKey: 'A' },
|
|
26
|
+
'2': { id: 2, parent: 1, childrenExpanded: false, depth: 2, groupingKey: 'A' },
|
|
27
|
+
},
|
|
28
|
+
treeDepth: 3,
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
*/
|
|
32
|
+
export const buildRowTree = params => {
|
|
33
|
+
// During the build, we store the children as a Record to avoid linear complexity when checking if a children is already defined.
|
|
34
|
+
const tempTree = {};
|
|
35
|
+
let treeDepth = 1;
|
|
36
|
+
const ids = [...params.ids];
|
|
37
|
+
|
|
38
|
+
const idRowsLookup = _extends({}, params.idRowsLookup);
|
|
39
|
+
|
|
40
|
+
const groupingCriteriaToIdTree = {};
|
|
41
|
+
|
|
42
|
+
const isGroupExpandedByDefault = node => {
|
|
43
|
+
var _params$previousTree, _params$previousTree$;
|
|
44
|
+
|
|
45
|
+
const previousExpansion = (_params$previousTree = params.previousTree) == null ? void 0 : (_params$previousTree$ = _params$previousTree[node.id]) == null ? void 0 : _params$previousTree$.childrenExpanded;
|
|
46
|
+
|
|
47
|
+
if (previousExpansion != null) {
|
|
48
|
+
return previousExpansion;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (!node.children || !node.children.length) {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (params.isGroupExpandedByDefault) {
|
|
56
|
+
return params.isGroupExpandedByDefault(node);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return params.defaultGroupingExpansionDepth === -1 || params.defaultGroupingExpansionDepth > node.depth;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
for (let i = 0; i < params.rows.length; i += 1) {
|
|
63
|
+
const row = params.rows[i];
|
|
64
|
+
let keyToIdSubTree = groupingCriteriaToIdTree;
|
|
65
|
+
let parentNode = null;
|
|
66
|
+
|
|
67
|
+
for (let depth = 0; depth < row.path.length; depth += 1) {
|
|
68
|
+
const {
|
|
69
|
+
key,
|
|
70
|
+
field: rawField
|
|
71
|
+
} = row.path[depth];
|
|
72
|
+
const field = rawField != null ? rawField : '__no_field__';
|
|
73
|
+
let nodeId;
|
|
74
|
+
let fieldSubTree = keyToIdSubTree[field];
|
|
75
|
+
|
|
76
|
+
if (!fieldSubTree) {
|
|
77
|
+
fieldSubTree = {};
|
|
78
|
+
keyToIdSubTree[field] = fieldSubTree;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
let keyConfig = fieldSubTree[key.toString()];
|
|
82
|
+
|
|
83
|
+
if (keyConfig) {
|
|
84
|
+
if (depth === row.path.length - 1) {
|
|
85
|
+
var _params$onDuplicatePa;
|
|
86
|
+
|
|
87
|
+
(_params$onDuplicatePa = params.onDuplicatePath) == null ? void 0 : _params$onDuplicatePa.call(params, keyConfig.id, row.id, row.path);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
nodeId = keyConfig.id;
|
|
91
|
+
} else {
|
|
92
|
+
if (depth === row.path.length - 1) {
|
|
93
|
+
nodeId = row.id;
|
|
94
|
+
} else {
|
|
95
|
+
nodeId = `auto-generated-row-${row.path.map(groupingCriteria => `${groupingCriteria.field}/${groupingCriteria.key}`).slice(0, depth + 1).join('-')}`;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
keyConfig = {
|
|
99
|
+
id: nodeId,
|
|
100
|
+
children: {}
|
|
101
|
+
};
|
|
102
|
+
fieldSubTree[key.toString()] = keyConfig;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
keyToIdSubTree = keyConfig.children;
|
|
106
|
+
|
|
107
|
+
if (!tempTree[nodeId]) {
|
|
108
|
+
var _parentNode$id, _parentNode;
|
|
109
|
+
|
|
110
|
+
const isAutoGenerated = depth < row.path.length - 1;
|
|
111
|
+
const node = {
|
|
112
|
+
id: nodeId,
|
|
113
|
+
isAutoGenerated,
|
|
114
|
+
parent: (_parentNode$id = (_parentNode = parentNode) == null ? void 0 : _parentNode.id) != null ? _parentNode$id : null,
|
|
115
|
+
groupingKey: key,
|
|
116
|
+
groupingField: rawField,
|
|
117
|
+
depth
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
if (isAutoGenerated) {
|
|
121
|
+
idRowsLookup[nodeId] = {};
|
|
122
|
+
ids.push(nodeId);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
tempTree[nodeId] = node;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (parentNode != null) {
|
|
129
|
+
if (!parentNode.children) {
|
|
130
|
+
parentNode.children = {};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
parentNode.children[nodeId] = nodeId;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
parentNode = tempTree[nodeId];
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
treeDepth = Math.max(treeDepth, row.path.length);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const tree = {};
|
|
143
|
+
|
|
144
|
+
for (let i = 0; i < ids.length; i += 1) {
|
|
145
|
+
var _params$previousTree2, _previousNode$childre, _node$children, _previousNode$childre2;
|
|
146
|
+
|
|
147
|
+
const rowId = ids[i];
|
|
148
|
+
const tempNode = tempTree[rowId];
|
|
149
|
+
|
|
150
|
+
const nodeWithoutChildrenExpansion = _extends({}, tempNode, {
|
|
151
|
+
children: tempNode.children ? Object.values(tempNode.children) : undefined
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
const node = _extends({}, nodeWithoutChildrenExpansion, {
|
|
155
|
+
childrenExpanded: isGroupExpandedByDefault(nodeWithoutChildrenExpansion)
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
const previousNode = (_params$previousTree2 = params.previousTree) == null ? void 0 : _params$previousTree2[node.id];
|
|
159
|
+
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) => {
|
|
160
|
+
var _node$children2;
|
|
161
|
+
|
|
162
|
+
return ((_node$children2 = node.children) == null ? void 0 : _node$children2[index]) === childId;
|
|
163
|
+
}));
|
|
164
|
+
|
|
165
|
+
if (shouldReUsePreviousNode) {
|
|
166
|
+
tree[rowId] = previousNode;
|
|
167
|
+
} else {
|
|
168
|
+
tree[rowId] = node;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return {
|
|
173
|
+
tree,
|
|
174
|
+
treeDepth,
|
|
175
|
+
ids,
|
|
176
|
+
idRowsLookup,
|
|
177
|
+
groupingName: params.groupingName
|
|
178
|
+
};
|
|
179
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GridRowId, GridRowTreeConfig } from '@mui/x-data-grid';
|
|
2
|
+
import { GridSortingModelApplier } from '@mui/x-data-grid/internals';
|
|
3
|
+
interface SortRowTreeParams {
|
|
4
|
+
rowIds: GridRowId[];
|
|
5
|
+
rowTree: GridRowTreeConfig;
|
|
6
|
+
disableChildrenSorting: boolean;
|
|
7
|
+
sortRowList: GridSortingModelApplier | null;
|
|
8
|
+
}
|
|
9
|
+
export declare const sortRowTree: (params: SortRowTreeParams) => GridRowId[];
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export const sortRowTree = params => {
|
|
2
|
+
const {
|
|
3
|
+
rowIds,
|
|
4
|
+
rowTree,
|
|
5
|
+
disableChildrenSorting,
|
|
6
|
+
sortRowList
|
|
7
|
+
} = params;
|
|
8
|
+
let sortedRows = []; // Group the rows by parent
|
|
9
|
+
|
|
10
|
+
const groupedByParentRows = new Map([[null, []]]);
|
|
11
|
+
|
|
12
|
+
for (let i = 0; i < rowIds.length; i += 1) {
|
|
13
|
+
const rowId = rowIds[i];
|
|
14
|
+
const node = rowTree[rowId];
|
|
15
|
+
let group = groupedByParentRows.get(node.parent);
|
|
16
|
+
|
|
17
|
+
if (!group) {
|
|
18
|
+
group = [];
|
|
19
|
+
groupedByParentRows.set(node.parent, group);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
group.push(node);
|
|
23
|
+
} // Apply the sorting to each list of children
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
const sortedGroupedByParentRows = new Map();
|
|
27
|
+
groupedByParentRows.forEach((rowList, parent) => {
|
|
28
|
+
if (rowList.length === 0) {
|
|
29
|
+
sortedGroupedByParentRows.set(parent, []);
|
|
30
|
+
} else {
|
|
31
|
+
const depth = rowList[0].depth;
|
|
32
|
+
|
|
33
|
+
if (depth > 0 && disableChildrenSorting) {
|
|
34
|
+
sortedGroupedByParentRows.set(parent, rowList.map(row => row.id));
|
|
35
|
+
} else if (!sortRowList) {
|
|
36
|
+
sortedGroupedByParentRows.set(parent, rowList.map(row => row.id));
|
|
37
|
+
} else {
|
|
38
|
+
sortedGroupedByParentRows.set(parent, sortRowList(rowList));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}); // Flatten the sorted lists to have children just after their parent
|
|
42
|
+
|
|
43
|
+
const insertRowListIntoSortedRows = (startIndex, rowList) => {
|
|
44
|
+
sortedRows = [...sortedRows.slice(0, startIndex), ...rowList, ...sortedRows.slice(startIndex)];
|
|
45
|
+
let treeSize = 0;
|
|
46
|
+
rowList.forEach(rowId => {
|
|
47
|
+
treeSize += 1;
|
|
48
|
+
const children = sortedGroupedByParentRows.get(rowId);
|
|
49
|
+
|
|
50
|
+
if (children != null && children.length) {
|
|
51
|
+
const subTreeSize = insertRowListIntoSortedRows(startIndex + treeSize, children);
|
|
52
|
+
treeSize += subTreeSize;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return treeSize;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
insertRowListIntoSortedRows(0, sortedGroupedByParentRows.get(null));
|
|
59
|
+
return sortedRows;
|
|
60
|
+
};
|
package/LICENSE
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
Commercial License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 Material-UI SAS
|
|
4
|
-
|
|
5
|
-
MUI X Pro (https://mui.com/pricing/) is commercial software. You must purchase
|
|
6
|
-
a license and agree to the End User License Agreement (EULA: https://mui.com/x/license/)
|
|
7
|
-
to be able to use the software.
|
|
8
|
-
|
|
9
|
-
Commercial licenses can be obtained at https://mui.com/store/items/material-ui-pro/.
|
|
10
|
-
You are free to install and try the software without a license key as long as it
|
|
11
|
-
is not used for the development of a feature intended for production use. You can
|
|
12
|
-
find more details under the "Evaluation (trial) licenses" section of the EULA.
|