@mui/x-data-grid-premium 8.0.0-beta.2 → 8.0.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 +423 -96
- package/DataGridPremium/DataGridPremium.js +188 -26
- package/DataGridPremium/useDataGridPremiumComponent.d.ts +2 -2
- package/DataGridPremium/useDataGridPremiumComponent.js +22 -3
- package/DataGridPremium/useDataGridPremiumProps.js +5 -1
- package/components/GridColumnMenuPivotItem.d.ts +3 -0
- package/components/GridColumnMenuPivotItem.js +33 -0
- package/components/GridEmptyPivotOverlay.d.ts +6 -0
- package/components/GridEmptyPivotOverlay.js +29 -0
- package/components/GridGroupingCriteriaCell.js +8 -3
- package/components/GridPremiumColumnMenu.d.ts +5 -0
- package/components/GridPremiumColumnMenu.js +6 -1
- package/components/GridPremiumToolbar.d.ts +1 -1
- package/components/GridPremiumToolbar.js +29 -1
- package/components/aiAssistantPanel/AiAssistantPanelTrigger.d.ts +33 -0
- package/components/aiAssistantPanel/AiAssistantPanelTrigger.js +107 -0
- package/components/aiAssistantPanel/GridAiAssistantPanel.d.ts +3 -0
- package/components/aiAssistantPanel/GridAiAssistantPanel.js +195 -0
- package/components/aiAssistantPanel/GridAiAssistantPanelConversation.d.ts +7 -0
- package/components/aiAssistantPanel/GridAiAssistantPanelConversation.js +71 -0
- package/components/aiAssistantPanel/GridAiAssistantPanelConversationsMenu.d.ts +3 -0
- package/components/aiAssistantPanel/GridAiAssistantPanelConversationsMenu.js +92 -0
- package/components/aiAssistantPanel/GridAiAssistantPanelSuggestions.d.ts +7 -0
- package/components/aiAssistantPanel/GridAiAssistantPanelSuggestions.js +86 -0
- package/components/aiAssistantPanel/index.d.ts +2 -0
- package/components/aiAssistantPanel/index.js +27 -0
- package/components/collapsible/Collapsible.d.ts +4 -0
- package/components/collapsible/Collapsible.js +70 -0
- package/components/collapsible/CollapsibleContext.d.ts +8 -0
- package/components/collapsible/CollapsibleContext.js +17 -0
- package/components/collapsible/CollapsiblePanel.d.ts +4 -0
- package/components/collapsible/CollapsiblePanel.js +64 -0
- package/components/collapsible/CollapsibleTrigger.d.ts +4 -0
- package/components/collapsible/CollapsibleTrigger.js +106 -0
- package/components/collapsible/index.d.ts +4 -0
- package/components/collapsible/index.js +49 -0
- package/components/export/ExportExcel.js +4 -129
- package/components/index.d.ts +5 -2
- package/components/index.js +40 -4
- package/components/pivotPanel/GridPivotPanel.d.ts +3 -0
- package/components/pivotPanel/GridPivotPanel.js +22 -0
- package/components/pivotPanel/GridPivotPanelBody.d.ts +11 -0
- package/components/pivotPanel/GridPivotPanelBody.js +368 -0
- package/components/pivotPanel/GridPivotPanelField.d.ts +22 -0
- package/components/pivotPanel/GridPivotPanelField.js +338 -0
- package/components/pivotPanel/GridPivotPanelFieldMenu.d.ts +8 -0
- package/components/pivotPanel/GridPivotPanelFieldMenu.js +177 -0
- package/components/pivotPanel/GridPivotPanelHeader.d.ts +7 -0
- package/components/pivotPanel/GridPivotPanelHeader.js +101 -0
- package/components/pivotPanel/GridPivotPanelSearch.d.ts +7 -0
- package/components/pivotPanel/GridPivotPanelSearch.js +77 -0
- package/components/pivotPanel/PivotPanelTrigger.d.ts +37 -0
- package/components/pivotPanel/PivotPanelTrigger.js +93 -0
- package/components/pivotPanel/index.d.ts +2 -0
- package/components/pivotPanel/index.js +27 -0
- package/components/prompt/GridPrompt.d.ts +7 -0
- package/components/prompt/GridPrompt.js +364 -0
- package/components/prompt/index.d.ts +1 -0
- package/components/prompt/index.js +12 -0
- package/components/promptField/GridPromptField.d.ts +4 -0
- package/components/promptField/GridPromptField.js +86 -0
- package/components/promptField/PromptField.d.ts +66 -0
- package/components/promptField/PromptField.js +95 -0
- package/components/promptField/PromptFieldContext.d.ts +16 -0
- package/components/promptField/PromptFieldContext.js +17 -0
- package/components/promptField/PromptFieldControl.d.ts +27 -0
- package/components/promptField/PromptFieldControl.js +102 -0
- package/components/promptField/PromptFieldRecord.d.ts +27 -0
- package/components/promptField/PromptFieldRecord.js +158 -0
- package/components/promptField/PromptFieldSend.d.ts +27 -0
- package/components/promptField/PromptFieldSend.js +83 -0
- package/components/promptField/index.d.ts +4 -0
- package/components/promptField/index.js +49 -0
- package/components/resizablePanel/ResizablePanel.d.ts +10 -0
- package/components/resizablePanel/ResizablePanel.js +59 -0
- package/components/resizablePanel/ResizablePanelContext.d.ts +7 -0
- package/components/resizablePanel/ResizablePanelContext.js +17 -0
- package/components/resizablePanel/ResizablePanelHandle.d.ts +4 -0
- package/components/resizablePanel/ResizablePanelHandle.js +115 -0
- package/components/resizablePanel/index.d.ts +3 -0
- package/components/resizablePanel/index.js +38 -0
- package/components/sidebar/Sidebar.d.ts +4 -0
- package/components/sidebar/Sidebar.js +54 -0
- package/components/sidebar/SidebarHeader.d.ts +4 -0
- package/components/sidebar/SidebarHeader.js +51 -0
- package/components/sidebar/index.d.ts +2 -0
- package/components/sidebar/index.js +27 -0
- package/constants/dataGridPremiumDefaultSlotsComponents.js +3 -0
- package/esm/DataGridPremium/DataGridPremium.js +190 -28
- package/esm/DataGridPremium/useDataGridPremiumComponent.d.ts +2 -2
- package/esm/DataGridPremium/useDataGridPremiumComponent.js +20 -3
- package/esm/DataGridPremium/useDataGridPremiumProps.js +5 -1
- package/esm/components/GridColumnMenuPivotItem.d.ts +3 -0
- package/esm/components/GridColumnMenuPivotItem.js +26 -0
- package/esm/components/GridEmptyPivotOverlay.d.ts +6 -0
- package/esm/components/GridEmptyPivotOverlay.js +22 -0
- package/esm/components/GridGroupingCriteriaCell.js +9 -4
- package/esm/components/GridPremiumColumnMenu.d.ts +5 -0
- package/esm/components/GridPremiumColumnMenu.js +6 -1
- package/esm/components/GridPremiumToolbar.d.ts +1 -1
- package/esm/components/GridPremiumToolbar.js +30 -2
- package/esm/components/aiAssistantPanel/AiAssistantPanelTrigger.d.ts +33 -0
- package/esm/components/aiAssistantPanel/AiAssistantPanelTrigger.js +100 -0
- package/esm/components/aiAssistantPanel/GridAiAssistantPanel.d.ts +3 -0
- package/esm/components/aiAssistantPanel/GridAiAssistantPanel.js +188 -0
- package/esm/components/aiAssistantPanel/GridAiAssistantPanelConversation.d.ts +7 -0
- package/esm/components/aiAssistantPanel/GridAiAssistantPanelConversation.js +64 -0
- package/esm/components/aiAssistantPanel/GridAiAssistantPanelConversationsMenu.d.ts +3 -0
- package/esm/components/aiAssistantPanel/GridAiAssistantPanelConversationsMenu.js +85 -0
- package/esm/components/aiAssistantPanel/GridAiAssistantPanelSuggestions.d.ts +7 -0
- package/esm/components/aiAssistantPanel/GridAiAssistantPanelSuggestions.js +80 -0
- package/esm/components/aiAssistantPanel/index.d.ts +2 -0
- package/esm/components/aiAssistantPanel/index.js +2 -0
- package/esm/components/collapsible/Collapsible.d.ts +4 -0
- package/esm/components/collapsible/Collapsible.js +63 -0
- package/esm/components/collapsible/CollapsibleContext.d.ts +8 -0
- package/esm/components/collapsible/CollapsibleContext.js +9 -0
- package/esm/components/collapsible/CollapsiblePanel.d.ts +4 -0
- package/esm/components/collapsible/CollapsiblePanel.js +57 -0
- package/esm/components/collapsible/CollapsibleTrigger.d.ts +4 -0
- package/esm/components/collapsible/CollapsibleTrigger.js +99 -0
- package/esm/components/collapsible/index.d.ts +4 -0
- package/esm/components/collapsible/index.js +4 -0
- package/esm/components/export/ExportExcel.js +4 -129
- package/esm/components/index.d.ts +5 -2
- package/esm/components/index.js +5 -2
- package/esm/components/pivotPanel/GridPivotPanel.d.ts +3 -0
- package/esm/components/pivotPanel/GridPivotPanel.js +16 -0
- package/esm/components/pivotPanel/GridPivotPanelBody.d.ts +11 -0
- package/esm/components/pivotPanel/GridPivotPanelBody.js +361 -0
- package/esm/components/pivotPanel/GridPivotPanelField.d.ts +22 -0
- package/esm/components/pivotPanel/GridPivotPanelField.js +331 -0
- package/esm/components/pivotPanel/GridPivotPanelFieldMenu.d.ts +8 -0
- package/esm/components/pivotPanel/GridPivotPanelFieldMenu.js +170 -0
- package/esm/components/pivotPanel/GridPivotPanelHeader.d.ts +7 -0
- package/esm/components/pivotPanel/GridPivotPanelHeader.js +94 -0
- package/esm/components/pivotPanel/GridPivotPanelSearch.d.ts +7 -0
- package/esm/components/pivotPanel/GridPivotPanelSearch.js +70 -0
- package/esm/components/pivotPanel/PivotPanelTrigger.d.ts +37 -0
- package/esm/components/pivotPanel/PivotPanelTrigger.js +86 -0
- package/esm/components/pivotPanel/index.d.ts +2 -0
- package/esm/components/pivotPanel/index.js +2 -0
- package/esm/components/prompt/GridPrompt.d.ts +7 -0
- package/esm/components/prompt/GridPrompt.js +357 -0
- package/esm/components/prompt/index.d.ts +1 -0
- package/esm/components/prompt/index.js +1 -0
- package/esm/components/promptField/GridPromptField.d.ts +4 -0
- package/esm/components/promptField/GridPromptField.js +79 -0
- package/esm/components/promptField/PromptField.d.ts +66 -0
- package/esm/components/promptField/PromptField.js +88 -0
- package/esm/components/promptField/PromptFieldContext.d.ts +16 -0
- package/esm/components/promptField/PromptFieldContext.js +9 -0
- package/esm/components/promptField/PromptFieldControl.d.ts +27 -0
- package/esm/components/promptField/PromptFieldControl.js +95 -0
- package/esm/components/promptField/PromptFieldRecord.d.ts +27 -0
- package/esm/components/promptField/PromptFieldRecord.js +151 -0
- package/esm/components/promptField/PromptFieldSend.d.ts +27 -0
- package/esm/components/promptField/PromptFieldSend.js +76 -0
- package/esm/components/promptField/index.d.ts +4 -0
- package/esm/components/promptField/index.js +4 -0
- package/esm/components/resizablePanel/ResizablePanel.d.ts +10 -0
- package/esm/components/resizablePanel/ResizablePanel.js +52 -0
- package/esm/components/resizablePanel/ResizablePanelContext.d.ts +7 -0
- package/esm/components/resizablePanel/ResizablePanelContext.js +9 -0
- package/esm/components/resizablePanel/ResizablePanelHandle.d.ts +4 -0
- package/esm/components/resizablePanel/ResizablePanelHandle.js +108 -0
- package/esm/components/resizablePanel/index.d.ts +3 -0
- package/esm/components/resizablePanel/index.js +3 -0
- package/esm/components/sidebar/Sidebar.d.ts +4 -0
- package/esm/components/sidebar/Sidebar.js +47 -0
- package/esm/components/sidebar/SidebarHeader.d.ts +4 -0
- package/esm/components/sidebar/SidebarHeader.js +44 -0
- package/esm/components/sidebar/index.d.ts +2 -0
- package/esm/components/sidebar/index.js +2 -0
- package/esm/constants/dataGridPremiumDefaultSlotsComponents.js +3 -0
- package/esm/hooks/features/aggregation/gridAggregationFunctions.js +13 -0
- package/esm/hooks/features/aggregation/gridAggregationSelectors.d.ts +10 -1
- package/esm/hooks/features/aggregation/gridAggregationSelectors.js +28 -1
- package/esm/hooks/features/aggregation/gridAggregationUtils.d.ts +1 -1
- package/esm/hooks/features/aggregation/index.d.ts +1 -1
- package/esm/hooks/features/aggregation/index.js +1 -1
- package/esm/hooks/features/aggregation/useGridAggregation.js +7 -11
- package/esm/hooks/features/aggregation/useGridAggregationPreProcessors.js +2 -8
- package/esm/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +5 -25
- package/esm/hooks/features/aggregation/wrapColumnWithAggregation.js +23 -10
- package/esm/hooks/features/aiAssistant/api.d.ts +12 -0
- package/esm/hooks/features/aiAssistant/api.js +31 -0
- package/esm/hooks/features/aiAssistant/gridAiAssistantInterfaces.d.ts +82 -0
- package/esm/hooks/features/aiAssistant/gridAiAssistantSelectors.d.ts +5 -0
- package/esm/hooks/features/aiAssistant/gridAiAssistantSelectors.js +5 -0
- package/esm/hooks/features/aiAssistant/index.d.ts +2 -0
- package/esm/hooks/features/aiAssistant/useGridAiAssistant.d.ts +6 -0
- package/esm/hooks/features/aiAssistant/useGridAiAssistant.js +293 -0
- package/esm/hooks/features/cellSelection/useGridCellSelection.js +6 -6
- package/esm/hooks/features/clipboard/useGridClipboardImport.js +4 -4
- package/esm/hooks/features/dataSource/useGridDataSourcePremium.js +4 -1
- package/esm/hooks/features/export/useGridExcelExport.js +2 -2
- package/esm/hooks/features/index.d.ts +1 -1
- package/esm/hooks/features/index.js +1 -1
- package/esm/hooks/features/pivoting/gridPivotingInterfaces.d.ts +69 -0
- package/esm/hooks/features/pivoting/gridPivotingSelectors.d.ts +4 -0
- package/esm/hooks/features/pivoting/gridPivotingSelectors.js +5 -0
- package/esm/hooks/features/pivoting/useGridPivoting.d.ts +7 -0
- package/esm/hooks/features/pivoting/useGridPivoting.js +339 -0
- package/esm/hooks/features/pivoting/utils.d.ts +21 -0
- package/esm/hooks/features/pivoting/utils.js +259 -0
- package/esm/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +1 -4
- package/esm/hooks/features/rowGrouping/useGridRowGrouping.js +4 -5
- package/esm/hooks/utils/useResize.d.ts +9 -0
- package/esm/hooks/utils/useResize.js +52 -0
- package/esm/index.d.ts +4 -1
- package/esm/index.js +4 -2
- package/esm/material/icons.d.ts +15 -15
- package/esm/material/icons.js +32 -5
- package/esm/material/index.d.ts +31 -5
- package/esm/material/index.js +31 -3
- package/esm/models/dataGridPremiumProps.d.ts +96 -2
- package/esm/models/gridApiPremium.d.ts +4 -2
- package/esm/models/gridPremiumIconSlotsComponent.d.ts +141 -8
- package/esm/models/gridPremiumSlotsComponent.d.ts +13 -1
- package/esm/models/gridStatePremium.d.ts +6 -0
- package/esm/package.json +1 -1
- package/esm/setupExcelExportWebWorker/index.d.ts +1 -0
- package/esm/setupExcelExportWebWorker/index.js +1 -0
- package/esm/typeOverloads/modules.d.ts +32 -1
- package/esm/utils/speechRecognition.d.ts +2 -0
- package/esm/utils/speechRecognition.js +2 -0
- package/hooks/features/aggregation/gridAggregationFunctions.js +13 -0
- package/hooks/features/aggregation/gridAggregationSelectors.d.ts +10 -1
- package/hooks/features/aggregation/gridAggregationSelectors.js +29 -2
- package/hooks/features/aggregation/gridAggregationUtils.d.ts +1 -1
- package/hooks/features/aggregation/index.d.ts +1 -1
- package/hooks/features/aggregation/index.js +21 -11
- package/hooks/features/aggregation/useGridAggregation.js +6 -10
- package/hooks/features/aggregation/useGridAggregationPreProcessors.js +2 -8
- package/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +5 -25
- package/hooks/features/aggregation/wrapColumnWithAggregation.js +24 -11
- package/hooks/features/aiAssistant/api.d.ts +12 -0
- package/hooks/features/aiAssistant/api.js +37 -0
- package/hooks/features/aiAssistant/gridAiAssistantInterfaces.d.ts +82 -0
- package/hooks/features/aiAssistant/gridAiAssistantSelectors.d.ts +5 -0
- package/hooks/features/aiAssistant/gridAiAssistantSelectors.js +11 -0
- package/hooks/features/aiAssistant/index.d.ts +2 -0
- package/hooks/features/aiAssistant/useGridAiAssistant.d.ts +6 -0
- package/hooks/features/aiAssistant/useGridAiAssistant.js +303 -0
- package/hooks/features/cellSelection/useGridCellSelection.js +5 -5
- package/hooks/features/clipboard/useGridClipboardImport.js +3 -3
- package/hooks/features/dataSource/useGridDataSourcePremium.js +4 -1
- package/hooks/features/export/useGridExcelExport.js +1 -1
- package/hooks/features/index.d.ts +1 -1
- package/hooks/features/index.js +4 -4
- package/hooks/features/pivoting/gridPivotingInterfaces.d.ts +69 -0
- package/hooks/features/pivoting/gridPivotingInterfaces.js +5 -0
- package/hooks/features/pivoting/gridPivotingSelectors.d.ts +4 -0
- package/hooks/features/pivoting/gridPivotingSelectors.js +30 -0
- package/hooks/features/pivoting/useGridPivoting.d.ts +7 -0
- package/hooks/features/pivoting/useGridPivoting.js +349 -0
- package/hooks/features/pivoting/utils.d.ts +21 -0
- package/hooks/features/pivoting/utils.js +270 -0
- package/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +1 -4
- package/hooks/features/rowGrouping/useGridRowGrouping.js +3 -4
- package/hooks/utils/useResize.d.ts +9 -0
- package/hooks/utils/useResize.js +60 -0
- package/index.d.ts +4 -1
- package/index.js +19 -3
- package/material/icons.d.ts +15 -15
- package/material/icons.js +36 -9
- package/material/index.d.ts +31 -5
- package/material/index.js +30 -2
- package/models/dataGridPremiumProps.d.ts +96 -2
- package/models/gridApiPremium.d.ts +4 -2
- package/models/gridPremiumIconSlotsComponent.d.ts +141 -8
- package/models/gridPremiumSlotsComponent.d.ts +13 -1
- package/models/gridStatePremium.d.ts +6 -0
- package/package.json +12 -18
- package/setupExcelExportWebWorker/index.d.ts +1 -0
- package/{setupExcelExportWebWorker.js → setupExcelExportWebWorker/index.js} +1 -1
- package/typeOverloads/modules.d.ts +32 -1
- package/utils/speechRecognition.d.ts +2 -0
- package/utils/speechRecognition.js +8 -0
- package/components/promptControl/GridToolbarPromptControl.d.ts +0 -26
- package/components/promptControl/GridToolbarPromptControl.js +0 -222
- package/components/promptControl/RecordButton.d.ts +0 -16
- package/components/promptControl/RecordButton.js +0 -119
- package/components/promptControl/index.d.ts +0 -1
- package/components/promptControl/index.js +0 -12
- package/esm/components/promptControl/GridToolbarPromptControl.d.ts +0 -26
- package/esm/components/promptControl/GridToolbarPromptControl.js +0 -215
- package/esm/components/promptControl/RecordButton.d.ts +0 -16
- package/esm/components/promptControl/RecordButton.js +0 -111
- package/esm/components/promptControl/index.d.ts +0 -1
- package/esm/components/promptControl/index.js +0 -1
- package/esm/hooks/features/promptControl/api.d.ts +0 -2
- package/esm/hooks/features/promptControl/api.js +0 -22
- package/esm/hooks/features/promptControl/index.d.ts +0 -2
- package/esm/hooks/features/promptControl/types.d.ts +0 -25
- package/esm/setupExcelExportWebWorker.d.ts +0 -1
- package/esm/setupExcelExportWebWorker.js +0 -1
- package/esm/utils/releaseInfo.d.ts +0 -1
- package/esm/utils/releaseInfo.js +0 -13
- package/hooks/features/promptControl/api.d.ts +0 -2
- package/hooks/features/promptControl/api.js +0 -28
- package/hooks/features/promptControl/index.d.ts +0 -2
- package/hooks/features/promptControl/types.d.ts +0 -25
- package/modern/DataGridPremium/DataGrid.d.ts +0 -8
- package/modern/DataGridPremium/DataGrid.js +0 -19
- package/modern/DataGridPremium/DataGridPremium.d.ts +0 -16
- package/modern/DataGridPremium/DataGridPremium.js +0 -1121
- package/modern/DataGridPremium/index.d.ts +0 -3
- package/modern/DataGridPremium/index.js +0 -3
- package/modern/DataGridPremium/useDataGridPremiumComponent.d.ts +0 -4
- package/modern/DataGridPremium/useDataGridPremiumComponent.js +0 -108
- package/modern/DataGridPremium/useDataGridPremiumProps.d.ts +0 -6
- package/modern/DataGridPremium/useDataGridPremiumProps.js +0 -54
- package/modern/components/GridAggregationHeader.d.ts +0 -7
- package/modern/components/GridAggregationHeader.js +0 -89
- package/modern/components/GridAggregationRowOverlay.d.ts +0 -3
- package/modern/components/GridAggregationRowOverlay.js +0 -37
- package/modern/components/GridBottomContainer.d.ts +0 -3
- package/modern/components/GridBottomContainer.js +0 -43
- package/modern/components/GridColumnMenuAggregationItem.d.ts +0 -7
- package/modern/components/GridColumnMenuAggregationItem.js +0 -124
- package/modern/components/GridColumnMenuRowGroupItem.d.ts +0 -3
- package/modern/components/GridColumnMenuRowGroupItem.js +0 -42
- package/modern/components/GridColumnMenuRowUngroupItem.d.ts +0 -3
- package/modern/components/GridColumnMenuRowUngroupItem.js +0 -44
- package/modern/components/GridDataSourceGroupingCriteriaCell.d.ts +0 -7
- package/modern/components/GridDataSourceGroupingCriteriaCell.js +0 -121
- package/modern/components/GridExcelExportMenuItem.d.ts +0 -9
- package/modern/components/GridExcelExportMenuItem.js +0 -48
- package/modern/components/GridFooterCell.d.ts +0 -9
- package/modern/components/GridFooterCell.js +0 -43
- package/modern/components/GridGroupingColumnFooterCell.d.ts +0 -4
- package/modern/components/GridGroupingColumnFooterCell.js +0 -23
- package/modern/components/GridGroupingColumnLeafCell.d.ts +0 -4
- package/modern/components/GridGroupingColumnLeafCell.js +0 -17
- package/modern/components/GridGroupingCriteriaCell.d.ts +0 -7
- package/modern/components/GridGroupingCriteriaCell.js +0 -87
- package/modern/components/GridPremiumColumnMenu.d.ts +0 -33
- package/modern/components/GridPremiumColumnMenu.js +0 -37
- package/modern/components/GridPremiumToolbar.d.ts +0 -3
- package/modern/components/GridPremiumToolbar.js +0 -23
- package/modern/components/export/ExportExcel.d.ts +0 -29
- package/modern/components/export/ExportExcel.js +0 -209
- package/modern/components/export/index.d.ts +0 -1
- package/modern/components/export/index.js +0 -1
- package/modern/components/index.d.ts +0 -6
- package/modern/components/index.js +0 -6
- package/modern/components/promptControl/GridToolbarPromptControl.d.ts +0 -26
- package/modern/components/promptControl/GridToolbarPromptControl.js +0 -215
- package/modern/components/promptControl/RecordButton.d.ts +0 -16
- package/modern/components/promptControl/RecordButton.js +0 -111
- package/modern/components/promptControl/index.d.ts +0 -1
- package/modern/components/promptControl/index.js +0 -1
- package/modern/components/reexports.d.ts +0 -1
- package/modern/components/reexports.js +0 -1
- package/modern/constants/dataGridPremiumDefaultSlotsComponents.d.ts +0 -2
- package/modern/constants/dataGridPremiumDefaultSlotsComponents.js +0 -11
- package/modern/hooks/features/aggregation/createAggregationLookup.d.ts +0 -17
- package/modern/hooks/features/aggregation/createAggregationLookup.js +0 -111
- package/modern/hooks/features/aggregation/gridAggregationFunctions.d.ts +0 -8
- package/modern/hooks/features/aggregation/gridAggregationFunctions.js +0 -93
- package/modern/hooks/features/aggregation/gridAggregationInterfaces.d.ts +0 -129
- package/modern/hooks/features/aggregation/gridAggregationSelectors.d.ts +0 -13
- package/modern/hooks/features/aggregation/gridAggregationSelectors.js +0 -15
- package/modern/hooks/features/aggregation/gridAggregationUtils.d.ts +0 -62
- package/modern/hooks/features/aggregation/gridAggregationUtils.js +0 -180
- package/modern/hooks/features/aggregation/index.d.ts +0 -4
- package/modern/hooks/features/aggregation/index.js +0 -3
- package/modern/hooks/features/aggregation/useGridAggregation.d.ts +0 -6
- package/modern/hooks/features/aggregation/useGridAggregation.js +0 -103
- package/modern/hooks/features/aggregation/useGridAggregationPreProcessors.d.ts +0 -4
- package/modern/hooks/features/aggregation/useGridAggregationPreProcessors.js +0 -96
- package/modern/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +0 -81
- package/modern/hooks/features/aggregation/wrapColumnWithAggregation.js +0 -215
- package/modern/hooks/features/cellSelection/gridCellSelectionInterfaces.d.ts +0 -40
- package/modern/hooks/features/cellSelection/gridCellSelectionInterfaces.js +0 -1
- package/modern/hooks/features/cellSelection/gridCellSelectionSelector.d.ts +0 -2
- package/modern/hooks/features/cellSelection/gridCellSelectionSelector.js +0 -2
- package/modern/hooks/features/cellSelection/index.d.ts +0 -1
- package/modern/hooks/features/cellSelection/index.js +0 -1
- package/modern/hooks/features/cellSelection/useGridCellSelection.d.ts +0 -6
- package/modern/hooks/features/cellSelection/useGridCellSelection.js +0 -486
- package/modern/hooks/features/clipboard/useGridClipboardImport.d.ts +0 -4
- package/modern/hooks/features/clipboard/useGridClipboardImport.js +0 -335
- package/modern/hooks/features/dataSource/models.d.ts +0 -54
- package/modern/hooks/features/dataSource/models.js +0 -1
- package/modern/hooks/features/dataSource/useGridDataSourcePremium.d.ts +0 -4
- package/modern/hooks/features/dataSource/useGridDataSourcePremium.js +0 -59
- package/modern/hooks/features/export/gridExcelExportInterface.d.ts +0 -71
- package/modern/hooks/features/export/gridExcelExportInterface.js +0 -1
- package/modern/hooks/features/export/index.d.ts +0 -2
- package/modern/hooks/features/export/index.js +0 -2
- package/modern/hooks/features/export/serializer/excelSerializer.d.ts +0 -40
- package/modern/hooks/features/export/serializer/excelSerializer.js +0 -269
- package/modern/hooks/features/export/serializer/setupExcelExportWebWorker.d.ts +0 -2
- package/modern/hooks/features/export/serializer/setupExcelExportWebWorker.js +0 -53
- package/modern/hooks/features/export/serializer/utils.d.ts +0 -36
- package/modern/hooks/features/export/serializer/utils.js +0 -93
- package/modern/hooks/features/export/useGridExcelExport.d.ts +0 -11
- package/modern/hooks/features/export/useGridExcelExport.js +0 -139
- package/modern/hooks/features/index.d.ts +0 -5
- package/modern/hooks/features/index.js +0 -6
- package/modern/hooks/features/promptControl/api.d.ts +0 -2
- package/modern/hooks/features/promptControl/api.js +0 -22
- package/modern/hooks/features/promptControl/index.d.ts +0 -2
- package/modern/hooks/features/promptControl/index.js +0 -1
- package/modern/hooks/features/promptControl/types.d.ts +0 -25
- package/modern/hooks/features/promptControl/types.js +0 -1
- package/modern/hooks/features/rowGrouping/createGroupingColDef.d.ts +0 -57
- package/modern/hooks/features/rowGrouping/createGroupingColDef.js +0 -272
- package/modern/hooks/features/rowGrouping/gridRowGroupingInterfaces.d.ts +0 -44
- package/modern/hooks/features/rowGrouping/gridRowGroupingInterfaces.js +0 -1
- package/modern/hooks/features/rowGrouping/gridRowGroupingSelector.d.ts +0 -3
- package/modern/hooks/features/rowGrouping/gridRowGroupingSelector.js +0 -5
- package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +0 -54
- package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +0 -173
- package/modern/hooks/features/rowGrouping/index.d.ts +0 -3
- package/modern/hooks/features/rowGrouping/index.js +0 -3
- package/modern/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.d.ts +0 -4
- package/modern/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +0 -73
- package/modern/hooks/features/rowGrouping/useGridRowGrouping.d.ts +0 -11
- package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +0 -182
- package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.d.ts +0 -4
- package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +0 -157
- package/modern/hooks/features/rows/index.d.ts +0 -1
- package/modern/hooks/features/rows/index.js +0 -1
- package/modern/hooks/features/rows/useGridRowAriaAttributes.d.ts +0 -1
- package/modern/hooks/features/rows/useGridRowAriaAttributes.js +0 -8
- package/modern/hooks/index.d.ts +0 -2
- package/modern/hooks/index.js +0 -3
- package/modern/hooks/utils/index.d.ts +0 -1
- package/modern/hooks/utils/index.js +0 -1
- package/modern/hooks/utils/useGridApiContext.d.ts +0 -4
- package/modern/hooks/utils/useGridApiContext.js +0 -2
- package/modern/hooks/utils/useGridApiRef.d.ts +0 -4
- package/modern/hooks/utils/useGridApiRef.js +0 -2
- package/modern/hooks/utils/useGridAriaAttributes.d.ts +0 -2
- package/modern/hooks/utils/useGridAriaAttributes.js +0 -13
- package/modern/hooks/utils/useGridPrivateApiContext.d.ts +0 -2
- package/modern/hooks/utils/useGridPrivateApiContext.js +0 -2
- package/modern/hooks/utils/useGridRootProps.d.ts +0 -2
- package/modern/hooks/utils/useGridRootProps.js +0 -2
- package/modern/hooks/utils/useKeepGroupedColumnsHidden.d.ts +0 -12
- package/modern/hooks/utils/useKeepGroupedColumnsHidden.js +0 -43
- package/modern/index.d.ts +0 -23
- package/modern/index.js +0 -26
- package/modern/locales.d.ts +0 -1
- package/modern/locales.js +0 -1
- package/modern/material/icons.d.ts +0 -15
- package/modern/material/icons.js +0 -20
- package/modern/material/index.d.ts +0 -8
- package/modern/material/index.js +0 -11
- package/modern/models/dataGridPremiumProps.d.ts +0 -162
- package/modern/models/dataGridPremiumProps.js +0 -1
- package/modern/models/gridApiPremium.d.ts +0 -14
- package/modern/models/gridApiPremium.js +0 -1
- package/modern/models/gridGroupingValueGetter.d.ts +0 -4
- package/modern/models/gridGroupingValueGetter.js +0 -1
- package/modern/models/gridPastedValueParser.d.ts +0 -4
- package/modern/models/gridPastedValueParser.js +0 -1
- package/modern/models/gridPremiumIconSlotsComponent.d.ts +0 -28
- package/modern/models/gridPremiumIconSlotsComponent.js +0 -1
- package/modern/models/gridPremiumSlotsComponent.d.ts +0 -7
- package/modern/models/gridPremiumSlotsComponent.js +0 -1
- package/modern/models/gridStatePremium.d.ts +0 -18
- package/modern/models/gridStatePremium.js +0 -1
- package/modern/models/index.d.ts +0 -4
- package/modern/models/index.js +0 -4
- package/modern/package.json +0 -1
- package/modern/setupExcelExportWebWorker.d.ts +0 -1
- package/modern/setupExcelExportWebWorker.js +0 -1
- package/modern/themeAugmentation/index.d.ts +0 -2
- package/modern/themeAugmentation/index.js +0 -4
- package/modern/themeAugmentation/overrides.d.ts +0 -7
- package/modern/themeAugmentation/overrides.js +0 -1
- package/modern/themeAugmentation/props.d.ts +0 -15
- package/modern/themeAugmentation/props.js +0 -1
- package/modern/typeOverloads/index.d.ts +0 -2
- package/modern/typeOverloads/index.js +0 -2
- package/modern/typeOverloads/modules.d.ts +0 -97
- package/modern/typeOverloads/modules.js +0 -1
- package/modern/typeOverloads/reexports.d.ts +0 -17
- package/modern/typeOverloads/reexports.js +0 -15
- package/modern/utils/releaseInfo.d.ts +0 -1
- package/modern/utils/releaseInfo.js +0 -13
- package/setupExcelExportWebWorker.d.ts +0 -1
- package/tsconfig.build.tsbuildinfo +0 -1
- package/utils/releaseInfo.d.ts +0 -1
- package/utils/releaseInfo.js +0 -20
- /package/esm/hooks/features/{promptControl/types.js → aiAssistant/gridAiAssistantInterfaces.js} +0 -0
- /package/esm/hooks/features/{promptControl → aiAssistant}/index.js +0 -0
- /package/{modern/hooks/features/aggregation/gridAggregationInterfaces.js → esm/hooks/features/pivoting/gridPivotingInterfaces.js} +0 -0
- /package/hooks/features/{promptControl/types.js → aiAssistant/gridAiAssistantInterfaces.js} +0 -0
- /package/hooks/features/{promptControl → aiAssistant}/index.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
-
import { GridColDef, GridGroupingColDefOverride } from '@mui/x-data-grid-pro';
|
|
3
|
-
import { GridColumnRawLookup } from '@mui/x-data-grid-pro/internals';
|
|
4
|
-
import { GridApiPremium } from "../../../models/gridApiPremium.js";
|
|
5
|
-
import { RowGroupingStrategy } from "./gridRowGroupingUtils.js";
|
|
6
|
-
interface CreateGroupingColDefMonoCriteriaParams {
|
|
7
|
-
columnsLookup: GridColumnRawLookup;
|
|
8
|
-
/**
|
|
9
|
-
* The field from which we are grouping the rows.
|
|
10
|
-
*/
|
|
11
|
-
groupingCriteria: string;
|
|
12
|
-
/**
|
|
13
|
-
* The col def from which we are grouping the rows.
|
|
14
|
-
*/
|
|
15
|
-
groupedByColDef: GridColDef;
|
|
16
|
-
/**
|
|
17
|
-
* The col def properties the user wants to override.
|
|
18
|
-
* This value comes `prop.groupingColDef`.
|
|
19
|
-
*/
|
|
20
|
-
colDefOverride: GridGroupingColDefOverride | null | undefined;
|
|
21
|
-
strategy?: RowGroupingStrategy;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Creates the `GridColDef` for a grouping column that only takes care of a single grouping criteria
|
|
25
|
-
*/
|
|
26
|
-
export declare const createGroupingColDefForOneGroupingCriteria: ({
|
|
27
|
-
columnsLookup,
|
|
28
|
-
groupedByColDef,
|
|
29
|
-
groupingCriteria,
|
|
30
|
-
colDefOverride,
|
|
31
|
-
strategy
|
|
32
|
-
}: CreateGroupingColDefMonoCriteriaParams) => GridColDef;
|
|
33
|
-
interface CreateGroupingColDefSeveralCriteriaParams {
|
|
34
|
-
apiRef: RefObject<GridApiPremium>;
|
|
35
|
-
columnsLookup: GridColumnRawLookup;
|
|
36
|
-
/**
|
|
37
|
-
* The fields from which we are grouping the rows.
|
|
38
|
-
*/
|
|
39
|
-
rowGroupingModel: string[];
|
|
40
|
-
/**
|
|
41
|
-
* The col def properties the user wants to override.
|
|
42
|
-
* This value comes `prop.groupingColDef`.
|
|
43
|
-
*/
|
|
44
|
-
colDefOverride: GridGroupingColDefOverride | null | undefined;
|
|
45
|
-
strategy?: RowGroupingStrategy;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Creates the `GridColDef` for a grouping column that takes care of all the grouping criteria
|
|
49
|
-
*/
|
|
50
|
-
export declare const createGroupingColDefForAllGroupingCriteria: ({
|
|
51
|
-
apiRef,
|
|
52
|
-
columnsLookup,
|
|
53
|
-
rowGroupingModel,
|
|
54
|
-
colDefOverride,
|
|
55
|
-
strategy
|
|
56
|
-
}: CreateGroupingColDefSeveralCriteriaParams) => GridColDef;
|
|
57
|
-
export {};
|
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["leafField", "mainGroupingCriteria", "hideDescendantCount"],
|
|
4
|
-
_excluded2 = ["leafField", "mainGroupingCriteria", "hideDescendantCount"];
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import { GRID_STRING_COL_DEF, gridRowIdSelector, gridRowNodeSelector } from '@mui/x-data-grid-pro';
|
|
7
|
-
import { isSingleSelectColDef } from '@mui/x-data-grid-pro/internals';
|
|
8
|
-
import { GridGroupingColumnFooterCell } from "../../../components/GridGroupingColumnFooterCell.js";
|
|
9
|
-
import { GridGroupingCriteriaCell } from "../../../components/GridGroupingCriteriaCell.js";
|
|
10
|
-
import { GridDataSourceGroupingCriteriaCell } from "../../../components/GridDataSourceGroupingCriteriaCell.js";
|
|
11
|
-
import { GridGroupingColumnLeafCell } from "../../../components/GridGroupingColumnLeafCell.js";
|
|
12
|
-
import { getRowGroupingFieldFromGroupingCriteria, GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD, RowGroupingStrategy } from "./gridRowGroupingUtils.js";
|
|
13
|
-
import { gridRowGroupingSanitizedModelSelector } from "./gridRowGroupingSelector.js";
|
|
14
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
const GROUPING_COL_DEF_DEFAULT_PROPERTIES = _extends({}, GRID_STRING_COL_DEF, {
|
|
16
|
-
type: 'custom',
|
|
17
|
-
disableReorder: true
|
|
18
|
-
});
|
|
19
|
-
const GROUPING_COL_DEF_FORCED_PROPERTIES_DEFAULT = {
|
|
20
|
-
editable: false,
|
|
21
|
-
groupable: false
|
|
22
|
-
};
|
|
23
|
-
const GROUPING_COL_DEF_FORCED_PROPERTIES_DATA_SOURCE = _extends({}, GROUPING_COL_DEF_FORCED_PROPERTIES_DEFAULT, {
|
|
24
|
-
// TODO: Support these features on the grouping column(s)
|
|
25
|
-
filterable: false,
|
|
26
|
-
sortable: false
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* When sorting two cells with different grouping criteria, we consider that the cell with the grouping criteria coming first in the model should be displayed below.
|
|
31
|
-
* This can occur when some rows don't have all the fields. In which case we want the rows with the missing field to be displayed above.
|
|
32
|
-
* TODO: Make this index comparator depth invariant, the logic should not be inverted when sorting in the "desc" direction (but the current return format of `sortComparator` does not support this behavior).
|
|
33
|
-
*/
|
|
34
|
-
const groupingFieldIndexComparator = (v1, v2, cellParams1, cellParams2) => {
|
|
35
|
-
const model = gridRowGroupingSanitizedModelSelector({
|
|
36
|
-
current: cellParams1.api
|
|
37
|
-
});
|
|
38
|
-
const groupingField1 = cellParams1.rowNode.groupingField ?? null;
|
|
39
|
-
const groupingField2 = cellParams2.rowNode.groupingField ?? null;
|
|
40
|
-
if (groupingField1 === groupingField2) {
|
|
41
|
-
return 0;
|
|
42
|
-
}
|
|
43
|
-
if (groupingField1 == null) {
|
|
44
|
-
return -1;
|
|
45
|
-
}
|
|
46
|
-
if (groupingField2 == null) {
|
|
47
|
-
return 1;
|
|
48
|
-
}
|
|
49
|
-
if (model.indexOf(groupingField1) < model.indexOf(groupingField2)) {
|
|
50
|
-
return -1;
|
|
51
|
-
}
|
|
52
|
-
return 1;
|
|
53
|
-
};
|
|
54
|
-
const getLeafProperties = leafColDef => ({
|
|
55
|
-
headerName: leafColDef.headerName ?? leafColDef.field,
|
|
56
|
-
sortable: leafColDef.sortable,
|
|
57
|
-
filterable: leafColDef.filterable,
|
|
58
|
-
valueOptions: isSingleSelectColDef(leafColDef) ? leafColDef.valueOptions : undefined,
|
|
59
|
-
filterOperators: leafColDef.filterOperators,
|
|
60
|
-
sortComparator: (v1, v2, cellParams1, cellParams2) => {
|
|
61
|
-
// We only want to sort the leaves
|
|
62
|
-
if (cellParams1.rowNode.type === 'leaf' && cellParams2.rowNode.type === 'leaf') {
|
|
63
|
-
return leafColDef.sortComparator(v1, v2, cellParams1, cellParams2);
|
|
64
|
-
}
|
|
65
|
-
return groupingFieldIndexComparator(v1, v2, cellParams1, cellParams2);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
const groupedByColValueFormatter = groupedByColDef => (value, row, _, apiRef) => groupedByColDef.valueFormatter(value, row, groupedByColDef, apiRef);
|
|
69
|
-
const getGroupingCriteriaProperties = (groupedByColDef, applyHeaderName) => {
|
|
70
|
-
const properties = {
|
|
71
|
-
sortable: groupedByColDef.sortable,
|
|
72
|
-
filterable: groupedByColDef.filterable,
|
|
73
|
-
valueFormatter: groupedByColDef.valueFormatter ? groupedByColValueFormatter(groupedByColDef) : undefined,
|
|
74
|
-
valueOptions: isSingleSelectColDef(groupedByColDef) ? groupedByColDef.valueOptions : undefined,
|
|
75
|
-
sortComparator: (v1, v2, cellParams1, cellParams2) => {
|
|
76
|
-
// We only want to sort the groups of the current grouping criteria
|
|
77
|
-
if (cellParams1.rowNode.type === 'group' && cellParams2.rowNode.type === 'group' && cellParams1.rowNode.groupingField === cellParams2.rowNode.groupingField) {
|
|
78
|
-
const colDef = cellParams1.api.getColumn(cellParams1.rowNode.groupingField);
|
|
79
|
-
return colDef.sortComparator(v1, v2, cellParams1, cellParams2);
|
|
80
|
-
}
|
|
81
|
-
return groupingFieldIndexComparator(v1, v2, cellParams1, cellParams2);
|
|
82
|
-
},
|
|
83
|
-
filterOperators: groupedByColDef.filterOperators
|
|
84
|
-
};
|
|
85
|
-
if (applyHeaderName) {
|
|
86
|
-
properties.headerName = groupedByColDef.headerName ?? groupedByColDef.field;
|
|
87
|
-
}
|
|
88
|
-
return properties;
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* Creates the `GridColDef` for a grouping column that only takes care of a single grouping criteria
|
|
92
|
-
*/
|
|
93
|
-
export const createGroupingColDefForOneGroupingCriteria = ({
|
|
94
|
-
columnsLookup,
|
|
95
|
-
groupedByColDef,
|
|
96
|
-
groupingCriteria,
|
|
97
|
-
colDefOverride,
|
|
98
|
-
strategy = RowGroupingStrategy.Default
|
|
99
|
-
}) => {
|
|
100
|
-
const _ref = colDefOverride ?? {},
|
|
101
|
-
{
|
|
102
|
-
leafField,
|
|
103
|
-
mainGroupingCriteria,
|
|
104
|
-
hideDescendantCount
|
|
105
|
-
} = _ref,
|
|
106
|
-
colDefOverrideProperties = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
107
|
-
const leafColDef = leafField ? columnsLookup[leafField] : null;
|
|
108
|
-
const CriteriaCell = strategy === RowGroupingStrategy.Default ? GridGroupingCriteriaCell : GridDataSourceGroupingCriteriaCell;
|
|
109
|
-
|
|
110
|
-
// The properties that do not depend on the presence of a `leafColDef` and that can be overridden by `colDefOverride`
|
|
111
|
-
const commonProperties = {
|
|
112
|
-
width: Math.max((groupedByColDef.width ?? GRID_STRING_COL_DEF.width) + 40, leafColDef?.width ?? 0),
|
|
113
|
-
renderCell: params => {
|
|
114
|
-
// Render footer
|
|
115
|
-
if (params.rowNode.type === 'footer' || params.rowNode.type === 'pinnedRow') {
|
|
116
|
-
return /*#__PURE__*/_jsx(GridGroupingColumnFooterCell, _extends({}, params));
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// Render leaves
|
|
120
|
-
if (params.rowNode.type === 'leaf') {
|
|
121
|
-
if (leafColDef) {
|
|
122
|
-
const leafParams = _extends({}, params.api.getCellParams(params.id, leafField), {
|
|
123
|
-
api: params.api,
|
|
124
|
-
hasFocus: params.hasFocus
|
|
125
|
-
});
|
|
126
|
-
if (leafColDef.renderCell) {
|
|
127
|
-
return leafColDef.renderCell(leafParams);
|
|
128
|
-
}
|
|
129
|
-
return /*#__PURE__*/_jsx(GridGroupingColumnLeafCell, _extends({}, leafParams));
|
|
130
|
-
}
|
|
131
|
-
return '';
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// Render current grouping criteria groups
|
|
135
|
-
if (params.rowNode.groupingField === groupingCriteria) {
|
|
136
|
-
return /*#__PURE__*/_jsx(CriteriaCell, _extends({}, params, {
|
|
137
|
-
hideDescendantCount: hideDescendantCount
|
|
138
|
-
}));
|
|
139
|
-
}
|
|
140
|
-
return '';
|
|
141
|
-
},
|
|
142
|
-
valueGetter: (value, row, column, apiRef) => {
|
|
143
|
-
const rowId = gridRowIdSelector(apiRef, row);
|
|
144
|
-
const rowNode = gridRowNodeSelector(apiRef, rowId);
|
|
145
|
-
if (!rowNode || rowNode.type === 'footer' || rowNode.type === 'pinnedRow') {
|
|
146
|
-
return undefined;
|
|
147
|
-
}
|
|
148
|
-
if (rowNode.type === 'leaf') {
|
|
149
|
-
if (leafColDef) {
|
|
150
|
-
return apiRef.current.getCellValue(rowId, leafField);
|
|
151
|
-
}
|
|
152
|
-
return undefined;
|
|
153
|
-
}
|
|
154
|
-
if (rowNode.groupingField === groupingCriteria) {
|
|
155
|
-
return rowNode.groupingKey;
|
|
156
|
-
}
|
|
157
|
-
return undefined;
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
// If we have a `mainGroupingCriteria` defined and matching the `groupingCriteria`
|
|
162
|
-
// Then we apply the sorting / filtering on the groups of this column's grouping criteria based on the properties of `groupedByColDef`.
|
|
163
|
-
// It can be useful to define a `leafField` for leaves rendering but still use the grouping criteria for the sorting / filtering
|
|
164
|
-
//
|
|
165
|
-
// If we have a `leafField` defined and matching an existing column
|
|
166
|
-
// Then we apply the sorting / filtering on the leaves based on the properties of `leavesColDef`
|
|
167
|
-
//
|
|
168
|
-
// By default, we apply the sorting / filtering on the groups of this column's grouping criteria based on the properties of `groupedColDef`.
|
|
169
|
-
let sourceProperties;
|
|
170
|
-
if (mainGroupingCriteria && mainGroupingCriteria === groupingCriteria) {
|
|
171
|
-
sourceProperties = getGroupingCriteriaProperties(groupedByColDef, true);
|
|
172
|
-
} else if (leafColDef) {
|
|
173
|
-
sourceProperties = getLeafProperties(leafColDef);
|
|
174
|
-
} else {
|
|
175
|
-
sourceProperties = getGroupingCriteriaProperties(groupedByColDef, true);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
// The properties that can't be overridden with `colDefOverride`
|
|
179
|
-
const forcedProperties = _extends({
|
|
180
|
-
field: getRowGroupingFieldFromGroupingCriteria(groupingCriteria)
|
|
181
|
-
}, GROUPING_COL_DEF_FORCED_PROPERTIES_DEFAULT);
|
|
182
|
-
return _extends({}, GROUPING_COL_DEF_DEFAULT_PROPERTIES, commonProperties, sourceProperties, colDefOverrideProperties, forcedProperties);
|
|
183
|
-
};
|
|
184
|
-
/**
|
|
185
|
-
* Creates the `GridColDef` for a grouping column that takes care of all the grouping criteria
|
|
186
|
-
*/
|
|
187
|
-
export const createGroupingColDefForAllGroupingCriteria = ({
|
|
188
|
-
apiRef,
|
|
189
|
-
columnsLookup,
|
|
190
|
-
rowGroupingModel,
|
|
191
|
-
colDefOverride,
|
|
192
|
-
strategy = RowGroupingStrategy.Default
|
|
193
|
-
}) => {
|
|
194
|
-
const _ref2 = colDefOverride ?? {},
|
|
195
|
-
{
|
|
196
|
-
leafField,
|
|
197
|
-
mainGroupingCriteria,
|
|
198
|
-
hideDescendantCount
|
|
199
|
-
} = _ref2,
|
|
200
|
-
colDefOverrideProperties = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
201
|
-
const leafColDef = leafField ? columnsLookup[leafField] : null;
|
|
202
|
-
const CriteriaCell = strategy === RowGroupingStrategy.Default ? GridGroupingCriteriaCell : GridDataSourceGroupingCriteriaCell;
|
|
203
|
-
|
|
204
|
-
// The properties that do not depend on the presence of a `leafColDef` and that can be overridden by `colDefOverride`
|
|
205
|
-
const commonProperties = {
|
|
206
|
-
headerName: apiRef.current.getLocaleText('groupingColumnHeaderName'),
|
|
207
|
-
width: Math.max(...rowGroupingModel.map(field => (columnsLookup[field].width ?? GRID_STRING_COL_DEF.width) + 40), leafColDef?.width ?? 0),
|
|
208
|
-
renderCell: params => {
|
|
209
|
-
// Render footer
|
|
210
|
-
if (params.rowNode.type === 'footer' || params.rowNode.type === 'pinnedRow') {
|
|
211
|
-
return /*#__PURE__*/_jsx(GridGroupingColumnFooterCell, _extends({}, params));
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
// Render the leaves
|
|
215
|
-
if (params.rowNode.type === 'leaf') {
|
|
216
|
-
if (leafColDef) {
|
|
217
|
-
const leafParams = _extends({}, params.api.getCellParams(params.id, leafField), {
|
|
218
|
-
api: params.api,
|
|
219
|
-
hasFocus: params.hasFocus
|
|
220
|
-
});
|
|
221
|
-
if (leafColDef.renderCell) {
|
|
222
|
-
return leafColDef.renderCell(leafParams);
|
|
223
|
-
}
|
|
224
|
-
return /*#__PURE__*/_jsx(GridGroupingColumnLeafCell, _extends({}, leafParams));
|
|
225
|
-
}
|
|
226
|
-
return '';
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
// Render the groups
|
|
230
|
-
return /*#__PURE__*/_jsx(CriteriaCell, _extends({}, params, {
|
|
231
|
-
hideDescendantCount: hideDescendantCount
|
|
232
|
-
}));
|
|
233
|
-
},
|
|
234
|
-
valueGetter: (value, row) => {
|
|
235
|
-
const rowId = gridRowIdSelector(apiRef, row);
|
|
236
|
-
const rowNode = gridRowNodeSelector(apiRef, rowId);
|
|
237
|
-
if (!rowNode || rowNode.type === 'footer' || rowNode.type === 'pinnedRow') {
|
|
238
|
-
return undefined;
|
|
239
|
-
}
|
|
240
|
-
if (rowNode.type === 'leaf') {
|
|
241
|
-
if (leafColDef) {
|
|
242
|
-
return apiRef.current.getCellValue(rowId, leafField);
|
|
243
|
-
}
|
|
244
|
-
return undefined;
|
|
245
|
-
}
|
|
246
|
-
return rowNode.groupingKey;
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
// If we have a `mainGroupingCriteria` defined and matching one of the `orderedGroupedByFields`
|
|
251
|
-
// Then we apply the sorting / filtering on the groups of this column's grouping criteria based on the properties of `columnsLookup[mainGroupingCriteria]`.
|
|
252
|
-
// It can be useful to use another grouping criteria than the top level one for the sorting / filtering
|
|
253
|
-
//
|
|
254
|
-
// If we have a `leafField` defined and matching an existing column
|
|
255
|
-
// Then we apply the sorting / filtering on the leaves based on the properties of `leavesColDef`
|
|
256
|
-
//
|
|
257
|
-
// By default, we apply the sorting / filtering on the groups of the top level grouping criteria based on the properties of `columnsLookup[orderedGroupedByFields[0]]`.
|
|
258
|
-
let sourceProperties;
|
|
259
|
-
if (mainGroupingCriteria && rowGroupingModel.includes(mainGroupingCriteria)) {
|
|
260
|
-
sourceProperties = getGroupingCriteriaProperties(columnsLookup[mainGroupingCriteria], true);
|
|
261
|
-
} else if (leafColDef) {
|
|
262
|
-
sourceProperties = getLeafProperties(leafColDef);
|
|
263
|
-
} else {
|
|
264
|
-
sourceProperties = getGroupingCriteriaProperties(columnsLookup[rowGroupingModel[0]], rowGroupingModel.length === 1);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
// The properties that can't be overridden with `colDefOverride`
|
|
268
|
-
const forcedProperties = _extends({
|
|
269
|
-
field: GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD
|
|
270
|
-
}, strategy === RowGroupingStrategy.Default ? GROUPING_COL_DEF_FORCED_PROPERTIES_DEFAULT : GROUPING_COL_DEF_FORCED_PROPERTIES_DATA_SOURCE);
|
|
271
|
-
return _extends({}, GROUPING_COL_DEF_DEFAULT_PROPERTIES, commonProperties, sourceProperties, colDefOverrideProperties, forcedProperties);
|
|
272
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { GridColDef, GridValidRowModel } from '@mui/x-data-grid';
|
|
2
|
-
export type GridRowGroupingModel = string[];
|
|
3
|
-
export interface GridRowGroupingState {
|
|
4
|
-
model: GridRowGroupingModel;
|
|
5
|
-
}
|
|
6
|
-
export interface GridRowGroupingInitialState {
|
|
7
|
-
model?: GridRowGroupingModel;
|
|
8
|
-
}
|
|
9
|
-
export interface GridRowGroupingInternalCache {
|
|
10
|
-
/**
|
|
11
|
-
* Tracks the model on the last pre-processing
|
|
12
|
-
* Allows to check if we need to re-build the grouping columns when the grid upserts a column.
|
|
13
|
-
*/
|
|
14
|
-
rulesOnLastRowTreeCreation: GridGroupingRules;
|
|
15
|
-
}
|
|
16
|
-
export interface GridRowGroupingApi {
|
|
17
|
-
/**
|
|
18
|
-
* Sets the columns to use as grouping criteria.
|
|
19
|
-
* @param {GridRowGroupingModel} model The columns to use as grouping criteria.
|
|
20
|
-
*/
|
|
21
|
-
setRowGroupingModel: (model: GridRowGroupingModel) => void;
|
|
22
|
-
/**
|
|
23
|
-
* Adds the field to the row grouping model.
|
|
24
|
-
* @param {string} groupingCriteriaField The field from which we want to group the rows.
|
|
25
|
-
* @param {number | undefined} groupingIndex The grouping index at which we want to insert the new grouping criteria. By default, it will be inserted at the end of the model.
|
|
26
|
-
*/
|
|
27
|
-
addRowGroupingCriteria: (groupingCriteriaField: string, groupingIndex?: number) => void;
|
|
28
|
-
/**
|
|
29
|
-
* Remove the field from the row grouping model.
|
|
30
|
-
* @param {string} groupingCriteriaField The field from which we want to stop grouping the rows.
|
|
31
|
-
*/
|
|
32
|
-
removeRowGroupingCriteria: (groupingCriteriaField: string) => void;
|
|
33
|
-
/**
|
|
34
|
-
* Sets the grouping index of a grouping criteria.
|
|
35
|
-
* @param {string} groupingCriteriaField The field of the grouping criteria from which we want to change the grouping index.
|
|
36
|
-
* @param {number} groupingIndex The new grouping index of this grouping criteria.
|
|
37
|
-
*/
|
|
38
|
-
setRowGroupingCriteriaIndex: (groupingCriteriaField: string, groupingIndex: number) => void;
|
|
39
|
-
}
|
|
40
|
-
export interface GridGroupingRule<R extends GridValidRowModel = GridValidRowModel, V = any> {
|
|
41
|
-
field: string;
|
|
42
|
-
groupingValueGetter?: GridColDef<R, V>['groupingValueGetter'];
|
|
43
|
-
}
|
|
44
|
-
export type GridGroupingRules<R extends GridValidRowModel = GridValidRowModel> = GridGroupingRule<R>[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { GridStatePremium } from "../../../models/gridStatePremium.js";
|
|
2
|
-
export declare const gridRowGroupingModelSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, import("./gridRowGroupingInterfaces").GridRowGroupingState, import("./gridRowGroupingInterfaces").GridRowGroupingModel>;
|
|
3
|
-
export declare const gridRowGroupingSanitizedModelSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, import("@mui/x-data-grid").GridColumnLookup, string[]>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { gridColumnLookupSelector } from '@mui/x-data-grid-pro';
|
|
2
|
-
import { createSelector, createRootSelector, createSelectorMemoized } from '@mui/x-data-grid-pro/internals';
|
|
3
|
-
const gridRowGroupingStateSelector = createRootSelector(state => state.rowGrouping);
|
|
4
|
-
export const gridRowGroupingModelSelector = createSelector(gridRowGroupingStateSelector, rowGrouping => rowGrouping.model);
|
|
5
|
-
export const gridRowGroupingSanitizedModelSelector = createSelectorMemoized(gridRowGroupingModelSelector, gridColumnLookupSelector, (model, columnsLookup) => model.filter(field => !!columnsLookup[field]));
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
-
import { GridRowTreeConfig, GridFilterState, GridFilterModel, GridRowModel, GridColDef, GridKeyValue, GridDataSource } from '@mui/x-data-grid-pro';
|
|
3
|
-
import { GridAggregatedFilterItemApplier, GridColumnRawLookup, GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD, getRowGroupingCriteriaFromGroupingField, isGroupingColumn } from '@mui/x-data-grid-pro/internals';
|
|
4
|
-
import { DataGridPremiumProcessedProps } from "../../../models/dataGridPremiumProps.js";
|
|
5
|
-
import { GridGroupingRule, GridGroupingRules, GridRowGroupingModel } from "./gridRowGroupingInterfaces.js";
|
|
6
|
-
import { GridStatePremium } from "../../../models/gridStatePremium.js";
|
|
7
|
-
import { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
|
|
8
|
-
export { GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD, getRowGroupingCriteriaFromGroupingField, isGroupingColumn };
|
|
9
|
-
export declare enum RowGroupingStrategy {
|
|
10
|
-
Default = "grouping-columns",
|
|
11
|
-
DataSource = "grouping-columns-data-source",
|
|
12
|
-
}
|
|
13
|
-
export declare const getRowGroupingFieldFromGroupingCriteria: (groupingCriteria: string | null) => string;
|
|
14
|
-
interface FilterRowTreeFromTreeDataParams {
|
|
15
|
-
rowTree: GridRowTreeConfig;
|
|
16
|
-
isRowMatchingFilters: GridAggregatedFilterItemApplier | null;
|
|
17
|
-
filterModel: GridFilterModel;
|
|
18
|
-
apiRef: RefObject<GridPrivateApiPremium>;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* A leaf is visible if it passed the filter
|
|
22
|
-
* A group is visible if all the following criteria are met:
|
|
23
|
-
* - One of its children is passing the filter
|
|
24
|
-
* - It is passing the filter
|
|
25
|
-
*/
|
|
26
|
-
export declare const filterRowTreeFromGroupingColumns: (params: FilterRowTreeFromTreeDataParams) => Omit<GridFilterState, "filterModel">;
|
|
27
|
-
export declare const getColDefOverrides: (groupingColDefProp: DataGridPremiumProcessedProps["groupingColDef"], fields: string[], strategy?: RowGroupingStrategy) => import("@mui/x-data-grid-pro").GridGroupingColDefOverride<any> | null | undefined;
|
|
28
|
-
export declare const mergeStateWithRowGroupingModel: (rowGroupingModel: GridRowGroupingModel) => (state: GridStatePremium) => GridStatePremium;
|
|
29
|
-
export declare const setStrategyAvailability: (privateApiRef: RefObject<GridPrivateApiPremium>, disableRowGrouping: boolean, dataSource?: GridDataSource) => void;
|
|
30
|
-
export declare const getCellGroupingCriteria: ({
|
|
31
|
-
row,
|
|
32
|
-
colDef,
|
|
33
|
-
groupingRule,
|
|
34
|
-
apiRef
|
|
35
|
-
}: {
|
|
36
|
-
row: GridRowModel;
|
|
37
|
-
colDef: GridColDef;
|
|
38
|
-
groupingRule: GridGroupingRule;
|
|
39
|
-
apiRef: RefObject<GridPrivateApiPremium>;
|
|
40
|
-
}) => {
|
|
41
|
-
key: GridKeyValue | null | undefined;
|
|
42
|
-
field: string;
|
|
43
|
-
};
|
|
44
|
-
export declare const getGroupingRules: ({
|
|
45
|
-
sanitizedRowGroupingModel,
|
|
46
|
-
columnsLookup
|
|
47
|
-
}: {
|
|
48
|
-
sanitizedRowGroupingModel: GridRowGroupingModel;
|
|
49
|
-
columnsLookup: GridColumnRawLookup;
|
|
50
|
-
}) => GridGroupingRules;
|
|
51
|
-
/**
|
|
52
|
-
* Compares two sets of grouping rules to determine if they are equal or not.
|
|
53
|
-
*/
|
|
54
|
-
export declare const areGroupingRulesEqual: (newValue: GridGroupingRules, previousValue: GridGroupingRules) => boolean;
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { passFilterLogic, GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD, getRowGroupingCriteriaFromGroupingField, isGroupingColumn, GridStrategyGroup, getRowValue } from '@mui/x-data-grid-pro/internals';
|
|
3
|
-
import { gridRowGroupingSanitizedModelSelector } from "./gridRowGroupingSelector.js";
|
|
4
|
-
export { GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD, getRowGroupingCriteriaFromGroupingField, isGroupingColumn };
|
|
5
|
-
export let RowGroupingStrategy = /*#__PURE__*/function (RowGroupingStrategy) {
|
|
6
|
-
RowGroupingStrategy["Default"] = "grouping-columns";
|
|
7
|
-
RowGroupingStrategy["DataSource"] = "grouping-columns-data-source";
|
|
8
|
-
return RowGroupingStrategy;
|
|
9
|
-
}({});
|
|
10
|
-
export const getRowGroupingFieldFromGroupingCriteria = groupingCriteria => {
|
|
11
|
-
if (groupingCriteria === null) {
|
|
12
|
-
return GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD;
|
|
13
|
-
}
|
|
14
|
-
return `__row_group_by_columns_group_${groupingCriteria}__`;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* When filtering a group, we only want to filter according to the items related to this grouping column.
|
|
18
|
-
*/
|
|
19
|
-
const shouldApplyFilterItemOnGroup = (columnField, node) => {
|
|
20
|
-
if (columnField === GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD) {
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
const groupingCriteriaField = getRowGroupingCriteriaFromGroupingField(columnField);
|
|
24
|
-
return groupingCriteriaField === node.groupingField;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* A leaf is visible if it passed the filter
|
|
29
|
-
* A group is visible if all the following criteria are met:
|
|
30
|
-
* - One of its children is passing the filter
|
|
31
|
-
* - It is passing the filter
|
|
32
|
-
*/
|
|
33
|
-
export const filterRowTreeFromGroupingColumns = params => {
|
|
34
|
-
const {
|
|
35
|
-
apiRef,
|
|
36
|
-
rowTree,
|
|
37
|
-
isRowMatchingFilters,
|
|
38
|
-
filterModel
|
|
39
|
-
} = params;
|
|
40
|
-
const filteredRowsLookup = {};
|
|
41
|
-
const filteredChildrenCountLookup = {};
|
|
42
|
-
const filteredDescendantCountLookup = {};
|
|
43
|
-
const filterCache = {};
|
|
44
|
-
const filterTreeNode = (node, areAncestorsExpanded, ancestorsResults) => {
|
|
45
|
-
const filterResults = {
|
|
46
|
-
passingFilterItems: null,
|
|
47
|
-
passingQuickFilterValues: null
|
|
48
|
-
};
|
|
49
|
-
let isPassingFiltering = false;
|
|
50
|
-
if (isRowMatchingFilters && node.type !== 'footer') {
|
|
51
|
-
const shouldApplyItem = node.type === 'group' && node.isAutoGenerated ? columnField => shouldApplyFilterItemOnGroup(columnField, node) : undefined;
|
|
52
|
-
const row = apiRef.current.getRow(node.id);
|
|
53
|
-
isRowMatchingFilters(row, shouldApplyItem, filterResults);
|
|
54
|
-
} else {
|
|
55
|
-
isPassingFiltering = true;
|
|
56
|
-
}
|
|
57
|
-
let filteredChildrenCount = 0;
|
|
58
|
-
let filteredDescendantCount = 0;
|
|
59
|
-
if (node.type === 'group') {
|
|
60
|
-
node.children.forEach(childId => {
|
|
61
|
-
const childNode = rowTree[childId];
|
|
62
|
-
const childSubTreeSize = filterTreeNode(childNode, areAncestorsExpanded && !!node.childrenExpanded, [...ancestorsResults, filterResults]);
|
|
63
|
-
filteredDescendantCount += childSubTreeSize;
|
|
64
|
-
if (childSubTreeSize > 0) {
|
|
65
|
-
filteredChildrenCount += 1;
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
if (isPassingFiltering === false) {
|
|
70
|
-
if (node.type === 'group') {
|
|
71
|
-
// If node has children - it's passing if at least one child passes filters
|
|
72
|
-
isPassingFiltering = filteredDescendantCount > 0;
|
|
73
|
-
} else {
|
|
74
|
-
const allResults = [...ancestorsResults, filterResults];
|
|
75
|
-
isPassingFiltering = passFilterLogic(allResults.map(result => result.passingFilterItems), allResults.map(result => result.passingQuickFilterValues), filterModel, params.apiRef, filterCache);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
if (!isPassingFiltering) {
|
|
79
|
-
filteredRowsLookup[node.id] = false;
|
|
80
|
-
}
|
|
81
|
-
if (!isPassingFiltering) {
|
|
82
|
-
return 0;
|
|
83
|
-
}
|
|
84
|
-
filteredChildrenCountLookup[node.id] = filteredChildrenCount;
|
|
85
|
-
filteredDescendantCountLookup[node.id] = filteredDescendantCount;
|
|
86
|
-
if (node.type !== 'group') {
|
|
87
|
-
return filteredDescendantCount + 1;
|
|
88
|
-
}
|
|
89
|
-
return filteredDescendantCount;
|
|
90
|
-
};
|
|
91
|
-
const nodes = Object.values(rowTree);
|
|
92
|
-
for (let i = 0; i < nodes.length; i += 1) {
|
|
93
|
-
const node = nodes[i];
|
|
94
|
-
if (node.depth === 0) {
|
|
95
|
-
filterTreeNode(node, true, []);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return {
|
|
99
|
-
filteredRowsLookup,
|
|
100
|
-
filteredChildrenCountLookup,
|
|
101
|
-
filteredDescendantCountLookup
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
export const getColDefOverrides = (groupingColDefProp, fields, strategy) => {
|
|
105
|
-
if (typeof groupingColDefProp === 'function') {
|
|
106
|
-
return groupingColDefProp({
|
|
107
|
-
groupingName: strategy ?? RowGroupingStrategy.Default,
|
|
108
|
-
fields
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
return groupingColDefProp;
|
|
112
|
-
};
|
|
113
|
-
export const mergeStateWithRowGroupingModel = rowGroupingModel => state => _extends({}, state, {
|
|
114
|
-
rowGrouping: _extends({}, state.rowGrouping, {
|
|
115
|
-
model: rowGroupingModel
|
|
116
|
-
})
|
|
117
|
-
});
|
|
118
|
-
export const setStrategyAvailability = (privateApiRef, disableRowGrouping, dataSource) => {
|
|
119
|
-
let isAvailable;
|
|
120
|
-
if (disableRowGrouping) {
|
|
121
|
-
isAvailable = () => false;
|
|
122
|
-
} else {
|
|
123
|
-
isAvailable = () => {
|
|
124
|
-
const rowGroupingSanitizedModel = gridRowGroupingSanitizedModelSelector(privateApiRef);
|
|
125
|
-
return rowGroupingSanitizedModel.length > 0;
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
const strategy = dataSource ? RowGroupingStrategy.DataSource : RowGroupingStrategy.Default;
|
|
129
|
-
privateApiRef.current.setStrategyAvailability(GridStrategyGroup.RowTree, strategy, isAvailable);
|
|
130
|
-
};
|
|
131
|
-
export const getCellGroupingCriteria = ({
|
|
132
|
-
row,
|
|
133
|
-
colDef,
|
|
134
|
-
groupingRule,
|
|
135
|
-
apiRef
|
|
136
|
-
}) => {
|
|
137
|
-
let key;
|
|
138
|
-
if (groupingRule.groupingValueGetter) {
|
|
139
|
-
key = groupingRule.groupingValueGetter(row[groupingRule.field], row, colDef, apiRef);
|
|
140
|
-
} else {
|
|
141
|
-
key = getRowValue(row, colDef, apiRef);
|
|
142
|
-
}
|
|
143
|
-
return {
|
|
144
|
-
key,
|
|
145
|
-
field: groupingRule.field
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
export const getGroupingRules = ({
|
|
149
|
-
sanitizedRowGroupingModel,
|
|
150
|
-
columnsLookup
|
|
151
|
-
}) => sanitizedRowGroupingModel.map(field => ({
|
|
152
|
-
field,
|
|
153
|
-
groupingValueGetter: columnsLookup[field]?.groupingValueGetter
|
|
154
|
-
}));
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Compares two sets of grouping rules to determine if they are equal or not.
|
|
158
|
-
*/
|
|
159
|
-
export const areGroupingRulesEqual = (newValue, previousValue) => {
|
|
160
|
-
if (previousValue.length !== newValue.length) {
|
|
161
|
-
return false;
|
|
162
|
-
}
|
|
163
|
-
return newValue.every((newRule, newRuleIndex) => {
|
|
164
|
-
const previousRule = previousValue[newRuleIndex];
|
|
165
|
-
if (previousRule.groupingValueGetter !== newRule.groupingValueGetter) {
|
|
166
|
-
return false;
|
|
167
|
-
}
|
|
168
|
-
if (previousRule.field !== newRule.field) {
|
|
169
|
-
return false;
|
|
170
|
-
}
|
|
171
|
-
return true;
|
|
172
|
-
});
|
|
173
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
-
import { DataGridPremiumProcessedProps } from "../../../models/dataGridPremiumProps.js";
|
|
3
|
-
import { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
|
|
4
|
-
export declare const useGridDataSourceRowGroupingPreProcessors: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "disableRowGrouping" | "groupingColDef" | "rowGroupingColumnMode" | "defaultGroupingExpansionDepth" | "isGroupExpandedByDefault" | "dataSource">) => void;
|