@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,71 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
4
|
+
import { GridPinnedPosition } from '../hooks/features/columnPinning';
|
|
5
|
+
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
const GridColumnPinningMenuItems = props => {
|
|
10
|
+
const {
|
|
11
|
+
column,
|
|
12
|
+
onClick
|
|
13
|
+
} = props;
|
|
14
|
+
const apiRef = useGridApiContext();
|
|
15
|
+
|
|
16
|
+
const pinColumn = side => event => {
|
|
17
|
+
apiRef.current.pinColumn(column.field, side);
|
|
18
|
+
|
|
19
|
+
if (onClick) {
|
|
20
|
+
onClick(event);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const unpinColumn = event => {
|
|
25
|
+
apiRef.current.unpinColumn(column.field);
|
|
26
|
+
|
|
27
|
+
if (onClick) {
|
|
28
|
+
onClick(event);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
if (!column) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const side = apiRef.current.isColumnPinned(column.field);
|
|
37
|
+
|
|
38
|
+
if (side) {
|
|
39
|
+
const otherSide = side === GridPinnedPosition.right ? GridPinnedPosition.left : GridPinnedPosition.right;
|
|
40
|
+
const label = otherSide === GridPinnedPosition.right ? 'pinToRight' : 'pinToLeft';
|
|
41
|
+
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
42
|
+
children: [/*#__PURE__*/_jsx(MenuItem, {
|
|
43
|
+
onClick: pinColumn(otherSide),
|
|
44
|
+
children: apiRef.current.getLocaleText(label)
|
|
45
|
+
}), /*#__PURE__*/_jsx(MenuItem, {
|
|
46
|
+
onClick: unpinColumn,
|
|
47
|
+
children: apiRef.current.getLocaleText('unpin')
|
|
48
|
+
})]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
53
|
+
children: [/*#__PURE__*/_jsx(MenuItem, {
|
|
54
|
+
onClick: pinColumn(GridPinnedPosition.left),
|
|
55
|
+
children: apiRef.current.getLocaleText('pinToLeft')
|
|
56
|
+
}), /*#__PURE__*/_jsx(MenuItem, {
|
|
57
|
+
onClick: pinColumn(GridPinnedPosition.right),
|
|
58
|
+
children: apiRef.current.getLocaleText('pinToRight')
|
|
59
|
+
})]
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
process.env.NODE_ENV !== "production" ? GridColumnPinningMenuItems.propTypes = {
|
|
64
|
+
// ----------------------------- Warning --------------------------------
|
|
65
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
66
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
67
|
+
// ----------------------------------------------------------------------
|
|
68
|
+
column: PropTypes.object,
|
|
69
|
+
onClick: PropTypes.func
|
|
70
|
+
} : void 0;
|
|
71
|
+
export { GridColumnPinningMenuItems };
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
4
|
+
import IconButton from '@mui/material/IconButton';
|
|
5
|
+
import { getDataGridUtilityClass, useGridSelector } from '@mui/x-data-grid';
|
|
6
|
+
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
7
|
+
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
8
|
+
import { gridDetailPanelExpandedRowsContentCacheSelector } from '../hooks/features/detailPanel/gridDetailPanelSelector';
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
|
|
11
|
+
const useUtilityClasses = ownerState => {
|
|
12
|
+
const {
|
|
13
|
+
classes,
|
|
14
|
+
isExpanded
|
|
15
|
+
} = ownerState;
|
|
16
|
+
const slots = {
|
|
17
|
+
root: ['detailPanelToggleCell', isExpanded && 'detailPanelToggleCell--expanded']
|
|
18
|
+
};
|
|
19
|
+
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const GridDetailPanelToggleCell = props => {
|
|
23
|
+
const {
|
|
24
|
+
id,
|
|
25
|
+
value: isExpanded
|
|
26
|
+
} = props;
|
|
27
|
+
const rootProps = useGridRootProps();
|
|
28
|
+
const apiRef = useGridApiContext();
|
|
29
|
+
const ownerState = {
|
|
30
|
+
classes: rootProps.classes,
|
|
31
|
+
isExpanded
|
|
32
|
+
};
|
|
33
|
+
const classes = useUtilityClasses(ownerState);
|
|
34
|
+
const contentCache = useGridSelector(apiRef, gridDetailPanelExpandedRowsContentCacheSelector);
|
|
35
|
+
const hasContent = /*#__PURE__*/React.isValidElement(contentCache[id]);
|
|
36
|
+
const Icon = isExpanded ? rootProps.components.DetailPanelCollapseIcon : rootProps.components.DetailPanelExpandIcon;
|
|
37
|
+
return /*#__PURE__*/_jsx(IconButton, {
|
|
38
|
+
size: "small",
|
|
39
|
+
tabIndex: -1,
|
|
40
|
+
disabled: !hasContent,
|
|
41
|
+
className: classes.root,
|
|
42
|
+
"aria-label": isExpanded ? apiRef.current.getLocaleText('collapseDetailPanel') : apiRef.current.getLocaleText('expandDetailPanel'),
|
|
43
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
44
|
+
fontSize: "inherit"
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
process.env.NODE_ENV !== "production" ? GridDetailPanelToggleCell.propTypes = {
|
|
50
|
+
// ----------------------------- Warning --------------------------------
|
|
51
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
52
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
53
|
+
// ----------------------------------------------------------------------
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* GridApi that let you manipulate the grid.
|
|
57
|
+
*/
|
|
58
|
+
api: PropTypes.object.isRequired,
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The mode of the cell.
|
|
62
|
+
*/
|
|
63
|
+
cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The column of the row that the current cell belongs to.
|
|
67
|
+
*/
|
|
68
|
+
colDef: PropTypes.object.isRequired,
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The column field of the cell that triggered the event.
|
|
72
|
+
*/
|
|
73
|
+
field: PropTypes.string.isRequired,
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The cell value formatted with the column valueFormatter.
|
|
77
|
+
*/
|
|
78
|
+
formattedValue: PropTypes.any.isRequired,
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Get the cell value of a row and field.
|
|
82
|
+
* @param {GridRowId} id The row id.
|
|
83
|
+
* @param {string} field The field.
|
|
84
|
+
* @returns {GridCellValue} The cell value.
|
|
85
|
+
* @deprecated Use `params.row` to directly access the fields you want instead.
|
|
86
|
+
*/
|
|
87
|
+
getValue: PropTypes.func.isRequired,
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* If true, the cell is the active element.
|
|
91
|
+
*/
|
|
92
|
+
hasFocus: PropTypes.bool.isRequired,
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The grid row id.
|
|
96
|
+
*/
|
|
97
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* If true, the cell is editable.
|
|
101
|
+
*/
|
|
102
|
+
isEditable: PropTypes.bool,
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The row model of the row that the current cell belongs to.
|
|
106
|
+
*/
|
|
107
|
+
row: PropTypes.any.isRequired,
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The node of the row that the current cell belongs to.
|
|
111
|
+
*/
|
|
112
|
+
rowNode: PropTypes.object.isRequired,
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* the tabIndex value.
|
|
116
|
+
*/
|
|
117
|
+
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The cell value, but if the column has valueGetter, use getValue.
|
|
121
|
+
*/
|
|
122
|
+
value: PropTypes.any.isRequired
|
|
123
|
+
} : void 0;
|
|
124
|
+
export { GridDetailPanelToggleCell };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Box from '@mui/material/Box';
|
|
3
|
+
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
const GridGroupingColumnLeafCell = props => {
|
|
7
|
+
var _props$formattedValue;
|
|
8
|
+
|
|
9
|
+
const {
|
|
10
|
+
rowNode
|
|
11
|
+
} = props;
|
|
12
|
+
const rootProps = useGridRootProps();
|
|
13
|
+
const marginLeft = rootProps.rowGroupingColumnMode === 'multiple' ? 1 : rowNode.depth * 2;
|
|
14
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
15
|
+
sx: {
|
|
16
|
+
ml: marginLeft
|
|
17
|
+
},
|
|
18
|
+
children: (_props$formattedValue = props.formattedValue) != null ? _props$formattedValue : props.value
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { GridGroupingColumnLeafCell };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { GridRenderCellParams } from '@mui/x-data-grid';
|
|
3
|
+
interface GridGroupingCriteriaCellProps extends GridRenderCellParams {
|
|
4
|
+
hideDescendantCount?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const GridGroupingCriteriaCell: {
|
|
7
|
+
(props: GridGroupingCriteriaCellProps): JSX.Element;
|
|
8
|
+
propTypes: any;
|
|
9
|
+
};
|
|
10
|
+
export { GridGroupingCriteriaCell };
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
4
|
+
import IconButton from '@mui/material/IconButton';
|
|
5
|
+
import Box from '@mui/material/Box';
|
|
6
|
+
import { useGridSelector, gridFilteredDescendantCountLookupSelector, getDataGridUtilityClass, GridEvents } from '@mui/x-data-grid';
|
|
7
|
+
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
8
|
+
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
|
|
12
|
+
const useUtilityClasses = ownerState => {
|
|
13
|
+
const {
|
|
14
|
+
classes
|
|
15
|
+
} = ownerState;
|
|
16
|
+
const slots = {
|
|
17
|
+
root: ['groupingCriteriaCell'],
|
|
18
|
+
toggle: ['groupingCriteriaCellToggle']
|
|
19
|
+
};
|
|
20
|
+
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const GridGroupingCriteriaCell = props => {
|
|
24
|
+
var _filteredDescendantCo;
|
|
25
|
+
|
|
26
|
+
const {
|
|
27
|
+
id,
|
|
28
|
+
field,
|
|
29
|
+
rowNode,
|
|
30
|
+
hideDescendantCount,
|
|
31
|
+
formattedValue
|
|
32
|
+
} = props;
|
|
33
|
+
const rootProps = useGridRootProps();
|
|
34
|
+
const apiRef = useGridApiContext();
|
|
35
|
+
const ownerState = {
|
|
36
|
+
classes: rootProps.classes
|
|
37
|
+
};
|
|
38
|
+
const classes = useUtilityClasses(ownerState);
|
|
39
|
+
const filteredDescendantCountLookup = useGridSelector(apiRef, gridFilteredDescendantCountLookupSelector);
|
|
40
|
+
const filteredDescendantCount = (_filteredDescendantCo = filteredDescendantCountLookup[rowNode.id]) != null ? _filteredDescendantCo : 0;
|
|
41
|
+
const Icon = rowNode.childrenExpanded ? rootProps.components.GroupingCriteriaCollapseIcon : rootProps.components.GroupingCriteriaExpandIcon;
|
|
42
|
+
|
|
43
|
+
const handleKeyDown = event => {
|
|
44
|
+
if (event.key === ' ') {
|
|
45
|
+
event.stopPropagation();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
apiRef.current.publishEvent(GridEvents.cellKeyDown, props, event);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const handleClick = event => {
|
|
52
|
+
apiRef.current.setRowChildrenExpansion(id, !rowNode.childrenExpanded);
|
|
53
|
+
apiRef.current.setCellFocus(id, field);
|
|
54
|
+
event.stopPropagation();
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const marginLeft = rootProps.rowGroupingColumnMode === 'multiple' ? 0 : rowNode.depth * 2;
|
|
58
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
59
|
+
className: classes.root,
|
|
60
|
+
sx: {
|
|
61
|
+
ml: marginLeft
|
|
62
|
+
},
|
|
63
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
64
|
+
className: classes.toggle,
|
|
65
|
+
children: filteredDescendantCount > 0 && /*#__PURE__*/_jsx(IconButton, {
|
|
66
|
+
size: "small",
|
|
67
|
+
onClick: handleClick,
|
|
68
|
+
onKeyDown: handleKeyDown,
|
|
69
|
+
tabIndex: -1,
|
|
70
|
+
"aria-label": rowNode.childrenExpanded ? apiRef.current.getLocaleText('treeDataCollapse') : apiRef.current.getLocaleText('treeDataExpand'),
|
|
71
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
72
|
+
fontSize: "inherit"
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
}), /*#__PURE__*/_jsxs("span", {
|
|
76
|
+
children: [formattedValue === undefined ? rowNode.groupingKey : formattedValue, !hideDescendantCount && filteredDescendantCount > 0 ? ` (${filteredDescendantCount})` : '']
|
|
77
|
+
})]
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
process.env.NODE_ENV !== "production" ? GridGroupingCriteriaCell.propTypes = {
|
|
82
|
+
// ----------------------------- Warning --------------------------------
|
|
83
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
84
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
85
|
+
// ----------------------------------------------------------------------
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* GridApi that let you manipulate the grid.
|
|
89
|
+
*/
|
|
90
|
+
api: PropTypes.any.isRequired,
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The mode of the cell.
|
|
94
|
+
*/
|
|
95
|
+
cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* The column of the row that the current cell belongs to.
|
|
99
|
+
*/
|
|
100
|
+
colDef: PropTypes.object.isRequired,
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* The column field of the cell that triggered the event.
|
|
104
|
+
*/
|
|
105
|
+
field: PropTypes.string.isRequired,
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* The cell value formatted with the column valueFormatter.
|
|
109
|
+
*/
|
|
110
|
+
formattedValue: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.object, PropTypes.string, PropTypes.bool]),
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Get the cell value of a row and field.
|
|
114
|
+
* @param {GridRowId} id The row id.
|
|
115
|
+
* @param {string} field The field.
|
|
116
|
+
* @returns {GridCellValue} The cell value.
|
|
117
|
+
*/
|
|
118
|
+
getValue: PropTypes.func.isRequired,
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* If true, the cell is the active element.
|
|
122
|
+
*/
|
|
123
|
+
hasFocus: PropTypes.bool.isRequired,
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* The grid row id.
|
|
127
|
+
*/
|
|
128
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* If true, the cell is editable.
|
|
132
|
+
*/
|
|
133
|
+
isEditable: PropTypes.bool,
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* The row model of the row that the current cell belongs to.
|
|
137
|
+
*/
|
|
138
|
+
row: PropTypes.object.isRequired,
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* the tabIndex value.
|
|
142
|
+
*/
|
|
143
|
+
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* The cell value, but if the column has valueGetter, use getValue.
|
|
147
|
+
*/
|
|
148
|
+
value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.object, PropTypes.string, PropTypes.bool])
|
|
149
|
+
} : void 0;
|
|
150
|
+
export { GridGroupingCriteriaCell };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GridColDef } from '@mui/x-data-grid';
|
|
3
|
+
interface GridRowGroupableColumnMenuItemsProps {
|
|
4
|
+
column?: GridColDef;
|
|
5
|
+
onClick?: (event: React.MouseEvent<any>) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const GridRowGroupableColumnMenuItems: {
|
|
8
|
+
(props: GridRowGroupableColumnMenuItemsProps): JSX.Element | null;
|
|
9
|
+
propTypes: any;
|
|
10
|
+
};
|
|
11
|
+
export { GridRowGroupableColumnMenuItems };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
4
|
+
import { gridColumnLookupSelector, useGridSelector } from '@mui/x-data-grid';
|
|
5
|
+
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
6
|
+
import { gridRowGroupingSanitizedModelSelector } from '../hooks/features/rowGrouping/gridRowGroupingSelector';
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
const GridRowGroupableColumnMenuItems = props => {
|
|
10
|
+
var _columnsLookup$column;
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
column,
|
|
14
|
+
onClick
|
|
15
|
+
} = props;
|
|
16
|
+
const apiRef = useGridApiContext();
|
|
17
|
+
const rowGroupingModel = useGridSelector(apiRef, gridRowGroupingSanitizedModelSelector);
|
|
18
|
+
const columnsLookup = useGridSelector(apiRef, gridColumnLookupSelector);
|
|
19
|
+
|
|
20
|
+
if (!(column != null && column.groupable)) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const ungroupColumn = event => {
|
|
25
|
+
apiRef.current.removeRowGroupingCriteria(column.field);
|
|
26
|
+
|
|
27
|
+
if (onClick) {
|
|
28
|
+
onClick(event);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const groupColumn = event => {
|
|
33
|
+
apiRef.current.addRowGroupingCriteria(column.field);
|
|
34
|
+
|
|
35
|
+
if (onClick) {
|
|
36
|
+
onClick(event);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const name = (_columnsLookup$column = columnsLookup[column.field].headerName) != null ? _columnsLookup$column : column.field;
|
|
41
|
+
|
|
42
|
+
if (rowGroupingModel.includes(column.field)) {
|
|
43
|
+
return /*#__PURE__*/_jsx(MenuItem, {
|
|
44
|
+
onClick: ungroupColumn,
|
|
45
|
+
children: apiRef.current.getLocaleText('unGroupColumn')(name)
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return /*#__PURE__*/_jsx(MenuItem, {
|
|
50
|
+
onClick: groupColumn,
|
|
51
|
+
children: apiRef.current.getLocaleText('groupColumn')(name)
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
process.env.NODE_ENV !== "production" ? GridRowGroupableColumnMenuItems.propTypes = {
|
|
56
|
+
// ----------------------------- Warning --------------------------------
|
|
57
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
58
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
59
|
+
// ----------------------------------------------------------------------
|
|
60
|
+
column: PropTypes.object,
|
|
61
|
+
onClick: PropTypes.func
|
|
62
|
+
} : void 0;
|
|
63
|
+
export { GridRowGroupableColumnMenuItems };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GridColDef } from '@mui/x-data-grid';
|
|
3
|
+
interface GridRowGroupingColumnMenuItemsProps {
|
|
4
|
+
column?: GridColDef;
|
|
5
|
+
onClick?: (event: React.MouseEvent<any>) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const GridRowGroupingColumnMenuItems: {
|
|
8
|
+
(props: GridRowGroupingColumnMenuItemsProps): JSX.Element | null;
|
|
9
|
+
propTypes: any;
|
|
10
|
+
};
|
|
11
|
+
export { GridRowGroupingColumnMenuItems };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
4
|
+
import { useGridSelector, gridColumnLookupSelector } from '@mui/x-data-grid';
|
|
5
|
+
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
6
|
+
import { gridRowGroupingSanitizedModelSelector } from '../hooks/features/rowGrouping/gridRowGroupingSelector';
|
|
7
|
+
import { getRowGroupingCriteriaFromGroupingField, GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD, isGroupingColumn } from '../hooks/features/rowGrouping/gridRowGroupingUtils';
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
|
|
10
|
+
const GridRowGroupingColumnMenuItems = props => {
|
|
11
|
+
const {
|
|
12
|
+
column,
|
|
13
|
+
onClick
|
|
14
|
+
} = props;
|
|
15
|
+
const apiRef = useGridApiContext();
|
|
16
|
+
const rowGroupingModel = useGridSelector(apiRef, gridRowGroupingSanitizedModelSelector);
|
|
17
|
+
const columnsLookup = useGridSelector(apiRef, gridColumnLookupSelector);
|
|
18
|
+
|
|
19
|
+
const renderUnGroupingMenuItem = field => {
|
|
20
|
+
var _columnsLookup$field$;
|
|
21
|
+
|
|
22
|
+
const ungroupColumn = event => {
|
|
23
|
+
apiRef.current.removeRowGroupingCriteria(field);
|
|
24
|
+
|
|
25
|
+
if (onClick) {
|
|
26
|
+
onClick(event);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const name = (_columnsLookup$field$ = columnsLookup[field].headerName) != null ? _columnsLookup$field$ : field;
|
|
31
|
+
return /*#__PURE__*/_jsx(MenuItem, {
|
|
32
|
+
onClick: ungroupColumn,
|
|
33
|
+
children: apiRef.current.getLocaleText('unGroupColumn')(name)
|
|
34
|
+
}, field);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
if (!column || !isGroupingColumn(column.field)) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (column.field === GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD) {
|
|
42
|
+
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
43
|
+
children: rowGroupingModel.map(renderUnGroupingMenuItem)
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return renderUnGroupingMenuItem(getRowGroupingCriteriaFromGroupingField(column.field));
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
process.env.NODE_ENV !== "production" ? GridRowGroupingColumnMenuItems.propTypes = {
|
|
51
|
+
// ----------------------------- Warning --------------------------------
|
|
52
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
53
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
54
|
+
// ----------------------------------------------------------------------
|
|
55
|
+
column: PropTypes.object,
|
|
56
|
+
onClick: PropTypes.func
|
|
57
|
+
} : void 0;
|
|
58
|
+
export { GridRowGroupingColumnMenuItems };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { GridRenderCellParams } from '@mui/x-data-grid';
|
|
3
|
+
interface GridTreeDataGroupingCellProps extends GridRenderCellParams {
|
|
4
|
+
hideDescendantCount?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const GridTreeDataGroupingCell: {
|
|
7
|
+
(props: GridTreeDataGroupingCellProps): JSX.Element;
|
|
8
|
+
propTypes: any;
|
|
9
|
+
};
|
|
10
|
+
export { GridTreeDataGroupingCell };
|