@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,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,20 @@
|
|
|
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
|
+
const {
|
|
8
|
+
rowNode
|
|
9
|
+
} = props;
|
|
10
|
+
const rootProps = useGridRootProps();
|
|
11
|
+
const marginLeft = rootProps.rowGroupingColumnMode === 'multiple' ? 1 : rowNode.depth * 2;
|
|
12
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
13
|
+
sx: {
|
|
14
|
+
ml: marginLeft
|
|
15
|
+
},
|
|
16
|
+
children: props.formattedValue ?? props.value
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { GridGroupingColumnLeafCell };
|
|
@@ -0,0 +1,148 @@
|
|
|
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
|
+
const {
|
|
25
|
+
id,
|
|
26
|
+
field,
|
|
27
|
+
rowNode,
|
|
28
|
+
hideDescendantCount,
|
|
29
|
+
formattedValue
|
|
30
|
+
} = props;
|
|
31
|
+
const rootProps = useGridRootProps();
|
|
32
|
+
const apiRef = useGridApiContext();
|
|
33
|
+
const ownerState = {
|
|
34
|
+
classes: rootProps.classes
|
|
35
|
+
};
|
|
36
|
+
const classes = useUtilityClasses(ownerState);
|
|
37
|
+
const filteredDescendantCountLookup = useGridSelector(apiRef, gridFilteredDescendantCountLookupSelector);
|
|
38
|
+
const filteredDescendantCount = filteredDescendantCountLookup[rowNode.id] ?? 0;
|
|
39
|
+
const Icon = rowNode.childrenExpanded ? rootProps.components.GroupingCriteriaCollapseIcon : rootProps.components.GroupingCriteriaExpandIcon;
|
|
40
|
+
|
|
41
|
+
const handleKeyDown = event => {
|
|
42
|
+
if (event.key === ' ') {
|
|
43
|
+
event.stopPropagation();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
apiRef.current.publishEvent(GridEvents.cellKeyDown, props, event);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const handleClick = event => {
|
|
50
|
+
apiRef.current.setRowChildrenExpansion(id, !rowNode.childrenExpanded);
|
|
51
|
+
apiRef.current.setCellFocus(id, field);
|
|
52
|
+
event.stopPropagation();
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const marginLeft = rootProps.rowGroupingColumnMode === 'multiple' ? 0 : rowNode.depth * 2;
|
|
56
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
57
|
+
className: classes.root,
|
|
58
|
+
sx: {
|
|
59
|
+
ml: marginLeft
|
|
60
|
+
},
|
|
61
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
62
|
+
className: classes.toggle,
|
|
63
|
+
children: filteredDescendantCount > 0 && /*#__PURE__*/_jsx(IconButton, {
|
|
64
|
+
size: "small",
|
|
65
|
+
onClick: handleClick,
|
|
66
|
+
onKeyDown: handleKeyDown,
|
|
67
|
+
tabIndex: -1,
|
|
68
|
+
"aria-label": rowNode.childrenExpanded ? apiRef.current.getLocaleText('treeDataCollapse') : apiRef.current.getLocaleText('treeDataExpand'),
|
|
69
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
70
|
+
fontSize: "inherit"
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
}), /*#__PURE__*/_jsxs("span", {
|
|
74
|
+
children: [formattedValue === undefined ? rowNode.groupingKey : formattedValue, !hideDescendantCount && filteredDescendantCount > 0 ? ` (${filteredDescendantCount})` : '']
|
|
75
|
+
})]
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
process.env.NODE_ENV !== "production" ? GridGroupingCriteriaCell.propTypes = {
|
|
80
|
+
// ----------------------------- Warning --------------------------------
|
|
81
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
82
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
83
|
+
// ----------------------------------------------------------------------
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* GridApi that let you manipulate the grid.
|
|
87
|
+
*/
|
|
88
|
+
api: PropTypes.any.isRequired,
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The mode of the cell.
|
|
92
|
+
*/
|
|
93
|
+
cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* The column of the row that the current cell belongs to.
|
|
97
|
+
*/
|
|
98
|
+
colDef: PropTypes.object.isRequired,
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The column field of the cell that triggered the event.
|
|
102
|
+
*/
|
|
103
|
+
field: PropTypes.string.isRequired,
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* The cell value formatted with the column valueFormatter.
|
|
107
|
+
*/
|
|
108
|
+
formattedValue: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.object, PropTypes.string, PropTypes.bool]),
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Get the cell value of a row and field.
|
|
112
|
+
* @param {GridRowId} id The row id.
|
|
113
|
+
* @param {string} field The field.
|
|
114
|
+
* @returns {GridCellValue} The cell value.
|
|
115
|
+
*/
|
|
116
|
+
getValue: PropTypes.func.isRequired,
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* If true, the cell is the active element.
|
|
120
|
+
*/
|
|
121
|
+
hasFocus: PropTypes.bool.isRequired,
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The grid row id.
|
|
125
|
+
*/
|
|
126
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* If true, the cell is editable.
|
|
130
|
+
*/
|
|
131
|
+
isEditable: PropTypes.bool,
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* The row model of the row that the current cell belongs to.
|
|
135
|
+
*/
|
|
136
|
+
row: PropTypes.object.isRequired,
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* the tabIndex value.
|
|
140
|
+
*/
|
|
141
|
+
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* The cell value, but if the column has valueGetter, use getValue.
|
|
145
|
+
*/
|
|
146
|
+
value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.object, PropTypes.string, PropTypes.bool])
|
|
147
|
+
} : void 0;
|
|
148
|
+
export { GridGroupingCriteriaCell };
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
const {
|
|
11
|
+
column,
|
|
12
|
+
onClick
|
|
13
|
+
} = props;
|
|
14
|
+
const apiRef = useGridApiContext();
|
|
15
|
+
const rowGroupingModel = useGridSelector(apiRef, gridRowGroupingSanitizedModelSelector);
|
|
16
|
+
const columnsLookup = useGridSelector(apiRef, gridColumnLookupSelector);
|
|
17
|
+
|
|
18
|
+
if (!column?.groupable) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const ungroupColumn = event => {
|
|
23
|
+
apiRef.current.removeRowGroupingCriteria(column.field);
|
|
24
|
+
|
|
25
|
+
if (onClick) {
|
|
26
|
+
onClick(event);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const groupColumn = event => {
|
|
31
|
+
apiRef.current.addRowGroupingCriteria(column.field);
|
|
32
|
+
|
|
33
|
+
if (onClick) {
|
|
34
|
+
onClick(event);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const name = columnsLookup[column.field].headerName ?? column.field;
|
|
39
|
+
|
|
40
|
+
if (rowGroupingModel.includes(column.field)) {
|
|
41
|
+
return /*#__PURE__*/_jsx(MenuItem, {
|
|
42
|
+
onClick: ungroupColumn,
|
|
43
|
+
children: apiRef.current.getLocaleText('unGroupColumn')(name)
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return /*#__PURE__*/_jsx(MenuItem, {
|
|
48
|
+
onClick: groupColumn,
|
|
49
|
+
children: apiRef.current.getLocaleText('groupColumn')(name)
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
process.env.NODE_ENV !== "production" ? GridRowGroupableColumnMenuItems.propTypes = {
|
|
54
|
+
// ----------------------------- Warning --------------------------------
|
|
55
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
56
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
57
|
+
// ----------------------------------------------------------------------
|
|
58
|
+
column: PropTypes.object,
|
|
59
|
+
onClick: PropTypes.func
|
|
60
|
+
} : void 0;
|
|
61
|
+
export { GridRowGroupableColumnMenuItems };
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
const ungroupColumn = event => {
|
|
21
|
+
apiRef.current.removeRowGroupingCriteria(field);
|
|
22
|
+
|
|
23
|
+
if (onClick) {
|
|
24
|
+
onClick(event);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const name = columnsLookup[field].headerName ?? field;
|
|
29
|
+
return /*#__PURE__*/_jsx(MenuItem, {
|
|
30
|
+
onClick: ungroupColumn,
|
|
31
|
+
children: apiRef.current.getLocaleText('unGroupColumn')(name)
|
|
32
|
+
}, field);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
if (!column || !isGroupingColumn(column.field)) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (column.field === GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD) {
|
|
40
|
+
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
41
|
+
children: rowGroupingModel.map(renderUnGroupingMenuItem)
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return renderUnGroupingMenuItem(getRowGroupingCriteriaFromGroupingField(column.field));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
process.env.NODE_ENV !== "production" ? GridRowGroupingColumnMenuItems.propTypes = {
|
|
49
|
+
// ----------------------------- Warning --------------------------------
|
|
50
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
51
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
52
|
+
// ----------------------------------------------------------------------
|
|
53
|
+
column: PropTypes.object,
|
|
54
|
+
onClick: PropTypes.func
|
|
55
|
+
} : void 0;
|
|
56
|
+
export { GridRowGroupingColumnMenuItems };
|
|
@@ -0,0 +1,157 @@
|
|
|
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 { isNavigationKey } from '@mui/x-data-grid/internals';
|
|
8
|
+
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
9
|
+
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
|
|
13
|
+
const useUtilityClasses = ownerState => {
|
|
14
|
+
const {
|
|
15
|
+
classes
|
|
16
|
+
} = ownerState;
|
|
17
|
+
const slots = {
|
|
18
|
+
root: ['treeDataGroupingCell'],
|
|
19
|
+
toggle: ['treeDataGroupingCellToggle']
|
|
20
|
+
};
|
|
21
|
+
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const GridTreeDataGroupingCell = props => {
|
|
25
|
+
const {
|
|
26
|
+
id,
|
|
27
|
+
field,
|
|
28
|
+
formattedValue,
|
|
29
|
+
rowNode,
|
|
30
|
+
hideDescendantCount
|
|
31
|
+
} = props;
|
|
32
|
+
const rootProps = useGridRootProps();
|
|
33
|
+
const apiRef = useGridApiContext();
|
|
34
|
+
const ownerState = {
|
|
35
|
+
classes: rootProps.classes
|
|
36
|
+
};
|
|
37
|
+
const classes = useUtilityClasses(ownerState);
|
|
38
|
+
const filteredDescendantCountLookup = useGridSelector(apiRef, gridFilteredDescendantCountLookupSelector);
|
|
39
|
+
const filteredDescendantCount = filteredDescendantCountLookup[rowNode.id] ?? 0;
|
|
40
|
+
const Icon = rowNode.childrenExpanded ? rootProps.components.TreeDataCollapseIcon : rootProps.components.TreeDataExpandIcon;
|
|
41
|
+
|
|
42
|
+
const handleKeyDown = event => {
|
|
43
|
+
if (event.key === ' ') {
|
|
44
|
+
event.stopPropagation();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (isNavigationKey(event.key) && !event.shiftKey) {
|
|
48
|
+
apiRef.current.publishEvent(GridEvents.cellNavigationKeyDown, props, event);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const handleClick = event => {
|
|
53
|
+
apiRef.current.setRowChildrenExpansion(id, !rowNode.childrenExpanded);
|
|
54
|
+
apiRef.current.setCellFocus(id, field);
|
|
55
|
+
event.stopPropagation(); // TODO remove event.stopPropagation
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
59
|
+
className: classes.root,
|
|
60
|
+
sx: {
|
|
61
|
+
ml: rowNode.depth * 2
|
|
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" ? GridTreeDataGroupingCell.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.object.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.any.isRequired,
|
|
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
|
+
* @deprecated Use `params.row` to directly access the fields you want instead.
|
|
118
|
+
*/
|
|
119
|
+
getValue: PropTypes.func.isRequired,
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* If true, the cell is the active element.
|
|
123
|
+
*/
|
|
124
|
+
hasFocus: PropTypes.bool.isRequired,
|
|
125
|
+
hideDescendantCount: PropTypes.bool,
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The grid row id.
|
|
129
|
+
*/
|
|
130
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* If true, the cell is editable.
|
|
134
|
+
*/
|
|
135
|
+
isEditable: PropTypes.bool,
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* The row model of the row that the current cell belongs to.
|
|
139
|
+
*/
|
|
140
|
+
row: PropTypes.any.isRequired,
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* The node of the row that the current cell belongs to.
|
|
144
|
+
*/
|
|
145
|
+
rowNode: PropTypes.object.isRequired,
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* the tabIndex value.
|
|
149
|
+
*/
|
|
150
|
+
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* The cell value, but if the column has valueGetter, use getValue.
|
|
154
|
+
*/
|
|
155
|
+
value: PropTypes.any.isRequired
|
|
156
|
+
} : void 0;
|
|
157
|
+
export { GridTreeDataGroupingCell };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useLicenseVerifier, LicenseStatus } from '@mui/x-license-pro';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
function getLicenseErrorMessage(licenseStatus) {
|
|
6
|
+
switch (licenseStatus) {
|
|
7
|
+
case LicenseStatus.Expired:
|
|
8
|
+
return 'MUI X: License key expired';
|
|
9
|
+
|
|
10
|
+
case LicenseStatus.Invalid:
|
|
11
|
+
return 'MUI X: Invalid license key';
|
|
12
|
+
|
|
13
|
+
case LicenseStatus.NotFound:
|
|
14
|
+
return 'MUI X: Missing license key';
|
|
15
|
+
|
|
16
|
+
default:
|
|
17
|
+
throw new Error('MUI: Unhandled MUI X license status.');
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function Watermark() {
|
|
22
|
+
const licenseStatus = useLicenseVerifier();
|
|
23
|
+
|
|
24
|
+
if (licenseStatus === LicenseStatus.Valid) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return /*#__PURE__*/_jsx("div", {
|
|
29
|
+
style: {
|
|
30
|
+
position: 'absolute',
|
|
31
|
+
pointerEvents: 'none',
|
|
32
|
+
color: '#8282829e',
|
|
33
|
+
zIndex: 100000,
|
|
34
|
+
width: '100%',
|
|
35
|
+
textAlign: 'center',
|
|
36
|
+
bottom: '50%',
|
|
37
|
+
right: 0,
|
|
38
|
+
letterSpacing: 5,
|
|
39
|
+
fontSize: 24
|
|
40
|
+
},
|
|
41
|
+
children: getLicenseErrorMessage(licenseStatus)
|
|
42
|
+
});
|
|
43
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var GridPinnedPosition;
|
|
2
|
+
/**
|
|
3
|
+
* The column pinning API interface that is available in the grid [[apiRef]].
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
(function (GridPinnedPosition) {
|
|
7
|
+
GridPinnedPosition["left"] = "left";
|
|
8
|
+
GridPinnedPosition["right"] = "right";
|
|
9
|
+
})(GridPinnedPosition || (GridPinnedPosition = {}));
|
|
10
|
+
|
|
11
|
+
export { GridPinnedPosition };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const gridPinnedColumnsSelector = state => state.pinnedColumns;
|