@mui/x-data-grid-premium 8.0.0-beta.3 → 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 +282 -96
- package/DataGridPremium/DataGridPremium.js +165 -9
- 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/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 +167 -11
- 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/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/{modern/components/export/ExportExcel.js → esm/components/promptField/PromptFieldSend.js} +30 -38
- 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 +3 -7
- 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/dataSource/useGridDataSourcePremium.js +4 -1
- 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 +0 -1
- 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 +3 -7
- 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/dataSource/useGridDataSourcePremium.js +3 -0
- 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 +0 -1
- 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 +9 -15
- 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 -1127
- 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/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,486 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import ownerDocument from '@mui/utils/ownerDocument';
|
|
4
|
-
import useEventCallback from '@mui/utils/useEventCallback';
|
|
5
|
-
import { getTotalHeaderHeight, getVisibleRows, isNavigationKey, serializeCellValue, useGridRegisterPipeProcessor } from '@mui/x-data-grid-pro/internals';
|
|
6
|
-
import { useGridEvent, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF, gridSortedRowIdsSelector, gridDimensionsSelector } from '@mui/x-data-grid-pro';
|
|
7
|
-
import { gridCellSelectionStateSelector } from "./gridCellSelectionSelector.js";
|
|
8
|
-
export const cellSelectionStateInitializer = (state, props) => _extends({}, state, {
|
|
9
|
-
cellSelection: _extends({}, props.cellSelectionModel ?? props.initialState?.cellSelection)
|
|
10
|
-
});
|
|
11
|
-
function isKeyboardEvent(event) {
|
|
12
|
-
return !!event.key;
|
|
13
|
-
}
|
|
14
|
-
const AUTO_SCROLL_SENSITIVITY = 50; // The distance from the edge to start scrolling
|
|
15
|
-
const AUTO_SCROLL_SPEED = 20; // The speed to scroll once the mouse enters the sensitivity area
|
|
16
|
-
|
|
17
|
-
export const useGridCellSelection = (apiRef, props) => {
|
|
18
|
-
const hasRootReference = apiRef.current.rootElementRef.current !== null;
|
|
19
|
-
const cellWithVirtualFocus = React.useRef(null);
|
|
20
|
-
const lastMouseDownCell = React.useRef(null);
|
|
21
|
-
const mousePosition = React.useRef(null);
|
|
22
|
-
const autoScrollRAF = React.useRef(null);
|
|
23
|
-
const totalHeaderHeight = getTotalHeaderHeight(apiRef, props);
|
|
24
|
-
const ignoreValueFormatterProp = props.ignoreValueFormatterDuringExport;
|
|
25
|
-
const ignoreValueFormatter = (typeof ignoreValueFormatterProp === 'object' ? ignoreValueFormatterProp?.clipboardExport : ignoreValueFormatterProp) || false;
|
|
26
|
-
const clipboardCopyCellDelimiter = props.clipboardCopyCellDelimiter;
|
|
27
|
-
apiRef.current.registerControlState({
|
|
28
|
-
stateId: 'cellSelection',
|
|
29
|
-
propModel: props.cellSelectionModel,
|
|
30
|
-
propOnChange: props.onCellSelectionModelChange,
|
|
31
|
-
stateSelector: gridCellSelectionStateSelector,
|
|
32
|
-
changeEvent: 'cellSelectionChange'
|
|
33
|
-
});
|
|
34
|
-
const runIfCellSelectionIsEnabled = callback => (...args) => {
|
|
35
|
-
if (props.cellSelection) {
|
|
36
|
-
callback(...args);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
const isCellSelected = React.useCallback((id, field) => {
|
|
40
|
-
if (!props.cellSelection) {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
const cellSelectionModel = gridCellSelectionStateSelector(apiRef);
|
|
44
|
-
return cellSelectionModel[id] ? !!cellSelectionModel[id][field] : false;
|
|
45
|
-
}, [apiRef, props.cellSelection]);
|
|
46
|
-
const getCellSelectionModel = React.useCallback(() => {
|
|
47
|
-
return gridCellSelectionStateSelector(apiRef);
|
|
48
|
-
}, [apiRef]);
|
|
49
|
-
const setCellSelectionModel = React.useCallback(newModel => {
|
|
50
|
-
if (!props.cellSelection) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
apiRef.current.setState(prevState => _extends({}, prevState, {
|
|
54
|
-
cellSelection: newModel
|
|
55
|
-
}));
|
|
56
|
-
}, [apiRef, props.cellSelection]);
|
|
57
|
-
const selectCellRange = React.useCallback((start, end, keepOtherSelected = false) => {
|
|
58
|
-
const startRowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(start.id);
|
|
59
|
-
const startColumnIndex = apiRef.current.getColumnIndex(start.field);
|
|
60
|
-
const endRowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(end.id);
|
|
61
|
-
const endColumnIndex = apiRef.current.getColumnIndex(end.field);
|
|
62
|
-
let finalStartRowIndex = startRowIndex;
|
|
63
|
-
let finalStartColumnIndex = startColumnIndex;
|
|
64
|
-
let finalEndRowIndex = endRowIndex;
|
|
65
|
-
let finalEndColumnIndex = endColumnIndex;
|
|
66
|
-
if (finalStartRowIndex > finalEndRowIndex) {
|
|
67
|
-
finalStartRowIndex = endRowIndex;
|
|
68
|
-
finalEndRowIndex = startRowIndex;
|
|
69
|
-
}
|
|
70
|
-
if (finalStartColumnIndex > finalEndColumnIndex) {
|
|
71
|
-
finalStartColumnIndex = endColumnIndex;
|
|
72
|
-
finalEndColumnIndex = startColumnIndex;
|
|
73
|
-
}
|
|
74
|
-
const visibleColumns = apiRef.current.getVisibleColumns();
|
|
75
|
-
const visibleRows = getVisibleRows(apiRef);
|
|
76
|
-
const rowsInRange = visibleRows.rows.slice(finalStartRowIndex, finalEndRowIndex + 1);
|
|
77
|
-
const columnsInRange = visibleColumns.slice(finalStartColumnIndex, finalEndColumnIndex + 1);
|
|
78
|
-
const newModel = keepOtherSelected ? _extends({}, apiRef.current.getCellSelectionModel()) : {};
|
|
79
|
-
rowsInRange.forEach(row => {
|
|
80
|
-
if (!newModel[row.id]) {
|
|
81
|
-
newModel[row.id] = {};
|
|
82
|
-
}
|
|
83
|
-
columnsInRange.forEach(column => {
|
|
84
|
-
newModel[row.id][column.field] = true;
|
|
85
|
-
}, {});
|
|
86
|
-
});
|
|
87
|
-
apiRef.current.setCellSelectionModel(newModel);
|
|
88
|
-
}, [apiRef]);
|
|
89
|
-
const getSelectedCellsAsArray = React.useCallback(() => {
|
|
90
|
-
const selectionModel = apiRef.current.getCellSelectionModel();
|
|
91
|
-
const currentVisibleRows = getVisibleRows(apiRef, props);
|
|
92
|
-
const sortedEntries = currentVisibleRows.rows.reduce((result, row) => {
|
|
93
|
-
if (row.id in selectionModel) {
|
|
94
|
-
result.push([row.id, selectionModel[row.id]]);
|
|
95
|
-
}
|
|
96
|
-
return result;
|
|
97
|
-
}, []);
|
|
98
|
-
return sortedEntries.reduce((selectedCells, [id, fields]) => {
|
|
99
|
-
selectedCells.push(...Object.entries(fields).reduce((selectedFields, [field, isSelected]) => {
|
|
100
|
-
if (isSelected) {
|
|
101
|
-
selectedFields.push({
|
|
102
|
-
id,
|
|
103
|
-
field
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
return selectedFields;
|
|
107
|
-
}, []));
|
|
108
|
-
return selectedCells;
|
|
109
|
-
}, []);
|
|
110
|
-
}, [apiRef, props]);
|
|
111
|
-
const cellSelectionApi = {
|
|
112
|
-
isCellSelected,
|
|
113
|
-
getCellSelectionModel,
|
|
114
|
-
setCellSelectionModel,
|
|
115
|
-
selectCellRange,
|
|
116
|
-
getSelectedCellsAsArray
|
|
117
|
-
};
|
|
118
|
-
useGridApiMethod(apiRef, cellSelectionApi, 'public');
|
|
119
|
-
const hasClickedValidCellForRangeSelection = React.useCallback(params => {
|
|
120
|
-
if (params.field === GRID_CHECKBOX_SELECTION_COL_DEF.field) {
|
|
121
|
-
return false;
|
|
122
|
-
}
|
|
123
|
-
if (params.field === GRID_DETAIL_PANEL_TOGGLE_FIELD) {
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
const column = apiRef.current.getColumn(params.field);
|
|
127
|
-
if (column.type === GRID_ACTIONS_COLUMN_TYPE) {
|
|
128
|
-
return false;
|
|
129
|
-
}
|
|
130
|
-
return params.rowNode.type !== 'pinnedRow';
|
|
131
|
-
}, [apiRef]);
|
|
132
|
-
const handleMouseUp = useEventCallback(() => {
|
|
133
|
-
lastMouseDownCell.current = null;
|
|
134
|
-
apiRef.current.rootElementRef?.current?.classList.remove(gridClasses['root--disableUserSelection']);
|
|
135
|
-
|
|
136
|
-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
137
|
-
stopAutoScroll();
|
|
138
|
-
});
|
|
139
|
-
const handleCellMouseDown = React.useCallback((params, event) => {
|
|
140
|
-
// Skip if the click comes from the right-button or, only on macOS, Ctrl is pressed
|
|
141
|
-
// Fix for https://github.com/mui/mui-x/pull/6567#issuecomment-1329155578
|
|
142
|
-
const isMacOs = window.navigator.platform.toUpperCase().indexOf('MAC') >= 0;
|
|
143
|
-
if (event.button !== 0 || event.ctrlKey && isMacOs) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
if (params.field === GRID_REORDER_COL_DEF.field) {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
const focusedCell = gridFocusCellSelector(apiRef);
|
|
150
|
-
if (hasClickedValidCellForRangeSelection(params) && event.shiftKey && focusedCell) {
|
|
151
|
-
event.preventDefault();
|
|
152
|
-
}
|
|
153
|
-
lastMouseDownCell.current = {
|
|
154
|
-
id: params.id,
|
|
155
|
-
field: params.field
|
|
156
|
-
};
|
|
157
|
-
apiRef.current.rootElementRef?.current?.classList.add(gridClasses['root--disableUserSelection']);
|
|
158
|
-
const document = ownerDocument(apiRef.current.rootElementRef?.current);
|
|
159
|
-
document.addEventListener('mouseup', handleMouseUp, {
|
|
160
|
-
once: true
|
|
161
|
-
});
|
|
162
|
-
}, [apiRef, handleMouseUp, hasClickedValidCellForRangeSelection]);
|
|
163
|
-
const stopAutoScroll = React.useCallback(() => {
|
|
164
|
-
if (autoScrollRAF.current) {
|
|
165
|
-
cancelAnimationFrame(autoScrollRAF.current);
|
|
166
|
-
autoScrollRAF.current = null;
|
|
167
|
-
}
|
|
168
|
-
}, []);
|
|
169
|
-
const handleCellFocusIn = React.useCallback(params => {
|
|
170
|
-
cellWithVirtualFocus.current = {
|
|
171
|
-
id: params.id,
|
|
172
|
-
field: params.field
|
|
173
|
-
};
|
|
174
|
-
}, []);
|
|
175
|
-
const startAutoScroll = React.useCallback(() => {
|
|
176
|
-
if (autoScrollRAF.current) {
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
if (!apiRef.current.virtualScrollerRef?.current) {
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
function autoScroll() {
|
|
183
|
-
if (!mousePosition.current || !apiRef.current.virtualScrollerRef?.current) {
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
const dimensions = gridDimensionsSelector(apiRef);
|
|
187
|
-
const {
|
|
188
|
-
x: mouseX,
|
|
189
|
-
y: mouseY
|
|
190
|
-
} = mousePosition.current;
|
|
191
|
-
const {
|
|
192
|
-
width,
|
|
193
|
-
height: viewportOuterHeight
|
|
194
|
-
} = dimensions.viewportOuterSize;
|
|
195
|
-
const height = viewportOuterHeight - totalHeaderHeight;
|
|
196
|
-
let deltaX = 0;
|
|
197
|
-
let deltaY = 0;
|
|
198
|
-
let factor = 0;
|
|
199
|
-
if (mouseY <= AUTO_SCROLL_SENSITIVITY && dimensions.hasScrollY) {
|
|
200
|
-
// When scrolling up, the multiplier increases going closer to the top edge
|
|
201
|
-
factor = (AUTO_SCROLL_SENSITIVITY - mouseY) / -AUTO_SCROLL_SENSITIVITY;
|
|
202
|
-
deltaY = AUTO_SCROLL_SPEED;
|
|
203
|
-
} else if (mouseY >= height - AUTO_SCROLL_SENSITIVITY && dimensions.hasScrollY) {
|
|
204
|
-
// When scrolling down, the multiplier increases going closer to the bottom edge
|
|
205
|
-
factor = (mouseY - (height - AUTO_SCROLL_SENSITIVITY)) / AUTO_SCROLL_SENSITIVITY;
|
|
206
|
-
deltaY = AUTO_SCROLL_SPEED;
|
|
207
|
-
} else if (mouseX <= AUTO_SCROLL_SENSITIVITY && dimensions.hasScrollX) {
|
|
208
|
-
// When scrolling left, the multiplier increases going closer to the left edge
|
|
209
|
-
factor = (AUTO_SCROLL_SENSITIVITY - mouseX) / -AUTO_SCROLL_SENSITIVITY;
|
|
210
|
-
deltaX = AUTO_SCROLL_SPEED;
|
|
211
|
-
} else if (mouseX >= width - AUTO_SCROLL_SENSITIVITY && dimensions.hasScrollX) {
|
|
212
|
-
// When scrolling right, the multiplier increases going closer to the right edge
|
|
213
|
-
factor = (mouseX - (width - AUTO_SCROLL_SENSITIVITY)) / AUTO_SCROLL_SENSITIVITY;
|
|
214
|
-
deltaX = AUTO_SCROLL_SPEED;
|
|
215
|
-
}
|
|
216
|
-
if (deltaX !== 0 || deltaY !== 0) {
|
|
217
|
-
const {
|
|
218
|
-
scrollLeft,
|
|
219
|
-
scrollTop
|
|
220
|
-
} = apiRef.current.virtualScrollerRef.current;
|
|
221
|
-
apiRef.current.scroll({
|
|
222
|
-
top: scrollTop + deltaY * factor,
|
|
223
|
-
left: scrollLeft + deltaX * factor
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
autoScrollRAF.current = requestAnimationFrame(autoScroll);
|
|
227
|
-
}
|
|
228
|
-
autoScroll();
|
|
229
|
-
}, [apiRef, totalHeaderHeight]);
|
|
230
|
-
const handleCellMouseOver = React.useCallback((params, event) => {
|
|
231
|
-
if (!lastMouseDownCell.current) {
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
const {
|
|
235
|
-
id,
|
|
236
|
-
field
|
|
237
|
-
} = params;
|
|
238
|
-
apiRef.current.selectCellRange(lastMouseDownCell.current, {
|
|
239
|
-
id,
|
|
240
|
-
field
|
|
241
|
-
}, event.ctrlKey || event.metaKey);
|
|
242
|
-
const virtualScrollerRect = apiRef.current.virtualScrollerRef?.current?.getBoundingClientRect();
|
|
243
|
-
if (!virtualScrollerRect) {
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
|
-
const dimensions = gridDimensionsSelector(apiRef);
|
|
247
|
-
const {
|
|
248
|
-
x,
|
|
249
|
-
y
|
|
250
|
-
} = virtualScrollerRect;
|
|
251
|
-
const {
|
|
252
|
-
width,
|
|
253
|
-
height: viewportOuterHeight
|
|
254
|
-
} = dimensions.viewportOuterSize;
|
|
255
|
-
const height = viewportOuterHeight - totalHeaderHeight;
|
|
256
|
-
const mouseX = event.clientX - x;
|
|
257
|
-
const mouseY = event.clientY - y - totalHeaderHeight;
|
|
258
|
-
mousePosition.current = {
|
|
259
|
-
x: mouseX,
|
|
260
|
-
y: mouseY
|
|
261
|
-
};
|
|
262
|
-
const hasEnteredVerticalSensitivityArea = mouseY <= AUTO_SCROLL_SENSITIVITY || mouseY >= height - AUTO_SCROLL_SENSITIVITY;
|
|
263
|
-
const hasEnteredHorizontalSensitivityArea = mouseX <= AUTO_SCROLL_SENSITIVITY || mouseX >= width - AUTO_SCROLL_SENSITIVITY;
|
|
264
|
-
const hasEnteredSensitivityArea = hasEnteredVerticalSensitivityArea || hasEnteredHorizontalSensitivityArea;
|
|
265
|
-
if (hasEnteredSensitivityArea) {
|
|
266
|
-
// Mouse has entered the sensitity area for the first time
|
|
267
|
-
startAutoScroll();
|
|
268
|
-
} else {
|
|
269
|
-
// Mouse has left the sensitivity area while auto scroll is on
|
|
270
|
-
stopAutoScroll();
|
|
271
|
-
}
|
|
272
|
-
}, [apiRef, startAutoScroll, stopAutoScroll, totalHeaderHeight]);
|
|
273
|
-
const handleCellClick = useEventCallback((params, event) => {
|
|
274
|
-
const {
|
|
275
|
-
id,
|
|
276
|
-
field
|
|
277
|
-
} = params;
|
|
278
|
-
if (!hasClickedValidCellForRangeSelection(params)) {
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
const focusedCell = gridFocusCellSelector(apiRef);
|
|
282
|
-
if (event.shiftKey && focusedCell) {
|
|
283
|
-
apiRef.current.selectCellRange(focusedCell, {
|
|
284
|
-
id,
|
|
285
|
-
field
|
|
286
|
-
});
|
|
287
|
-
cellWithVirtualFocus.current = {
|
|
288
|
-
id,
|
|
289
|
-
field
|
|
290
|
-
};
|
|
291
|
-
return;
|
|
292
|
-
}
|
|
293
|
-
if (event.ctrlKey || event.metaKey) {
|
|
294
|
-
// Add the clicked cell to the selection
|
|
295
|
-
const prevModel = apiRef.current.getCellSelectionModel();
|
|
296
|
-
apiRef.current.setCellSelectionModel(_extends({}, prevModel, {
|
|
297
|
-
[id]: _extends({}, prevModel[id], {
|
|
298
|
-
[field]: !apiRef.current.isCellSelected(id, field)
|
|
299
|
-
})
|
|
300
|
-
}));
|
|
301
|
-
} else {
|
|
302
|
-
// Clear the selection and keep only the clicked cell selected
|
|
303
|
-
apiRef.current.setCellSelectionModel({
|
|
304
|
-
[id]: {
|
|
305
|
-
[field]: true
|
|
306
|
-
}
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
const handleCellKeyDown = useEventCallback((params, event) => {
|
|
311
|
-
if (!isNavigationKey(event.key) || !cellWithVirtualFocus.current) {
|
|
312
|
-
return;
|
|
313
|
-
}
|
|
314
|
-
if (!event.shiftKey) {
|
|
315
|
-
apiRef.current.setCellSelectionModel({});
|
|
316
|
-
return;
|
|
317
|
-
}
|
|
318
|
-
const {
|
|
319
|
-
current: otherCell
|
|
320
|
-
} = cellWithVirtualFocus;
|
|
321
|
-
let endRowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(otherCell.id);
|
|
322
|
-
let endColumnIndex = apiRef.current.getColumnIndex(otherCell.field);
|
|
323
|
-
if (event.key === 'ArrowDown') {
|
|
324
|
-
endRowIndex += 1;
|
|
325
|
-
} else if (event.key === 'ArrowUp') {
|
|
326
|
-
endRowIndex -= 1;
|
|
327
|
-
} else if (event.key === 'ArrowRight') {
|
|
328
|
-
endColumnIndex += 1;
|
|
329
|
-
} else if (event.key === 'ArrowLeft') {
|
|
330
|
-
endColumnIndex -= 1;
|
|
331
|
-
}
|
|
332
|
-
const visibleRows = getVisibleRows(apiRef);
|
|
333
|
-
if (endRowIndex < 0 || endRowIndex >= visibleRows.rows.length) {
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
const visibleColumns = apiRef.current.getVisibleColumns();
|
|
337
|
-
if (endColumnIndex < 0 || endColumnIndex >= visibleColumns.length) {
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
-
cellWithVirtualFocus.current = {
|
|
341
|
-
id: visibleRows.rows[endRowIndex].id,
|
|
342
|
-
field: visibleColumns[endColumnIndex].field
|
|
343
|
-
};
|
|
344
|
-
apiRef.current.scrollToIndexes({
|
|
345
|
-
rowIndex: endRowIndex,
|
|
346
|
-
colIndex: endColumnIndex
|
|
347
|
-
});
|
|
348
|
-
const {
|
|
349
|
-
id,
|
|
350
|
-
field
|
|
351
|
-
} = params;
|
|
352
|
-
apiRef.current.selectCellRange({
|
|
353
|
-
id,
|
|
354
|
-
field
|
|
355
|
-
}, cellWithVirtualFocus.current);
|
|
356
|
-
});
|
|
357
|
-
useGridEvent(apiRef, 'cellClick', runIfCellSelectionIsEnabled(handleCellClick));
|
|
358
|
-
useGridEvent(apiRef, 'cellFocusIn', runIfCellSelectionIsEnabled(handleCellFocusIn));
|
|
359
|
-
useGridEvent(apiRef, 'cellKeyDown', runIfCellSelectionIsEnabled(handleCellKeyDown));
|
|
360
|
-
useGridEvent(apiRef, 'cellMouseDown', runIfCellSelectionIsEnabled(handleCellMouseDown));
|
|
361
|
-
useGridEvent(apiRef, 'cellMouseOver', runIfCellSelectionIsEnabled(handleCellMouseOver));
|
|
362
|
-
React.useEffect(() => {
|
|
363
|
-
if (props.cellSelectionModel) {
|
|
364
|
-
apiRef.current.setCellSelectionModel(props.cellSelectionModel);
|
|
365
|
-
}
|
|
366
|
-
}, [apiRef, props.cellSelectionModel]);
|
|
367
|
-
React.useEffect(() => {
|
|
368
|
-
const rootRef = apiRef.current.rootElementRef?.current;
|
|
369
|
-
return () => {
|
|
370
|
-
stopAutoScroll();
|
|
371
|
-
const document = ownerDocument(rootRef);
|
|
372
|
-
document.removeEventListener('mouseup', handleMouseUp);
|
|
373
|
-
};
|
|
374
|
-
}, [apiRef, hasRootReference, handleMouseUp, stopAutoScroll]);
|
|
375
|
-
const checkIfCellIsSelected = React.useCallback((isSelected, {
|
|
376
|
-
id,
|
|
377
|
-
field
|
|
378
|
-
}) => {
|
|
379
|
-
return apiRef.current.isCellSelected(id, field);
|
|
380
|
-
}, [apiRef]);
|
|
381
|
-
const addClassesToCells = React.useCallback((classes, {
|
|
382
|
-
id,
|
|
383
|
-
field
|
|
384
|
-
}) => {
|
|
385
|
-
const visibleRows = getVisibleRows(apiRef);
|
|
386
|
-
if (!visibleRows.range || !apiRef.current.isCellSelected(id, field)) {
|
|
387
|
-
return classes;
|
|
388
|
-
}
|
|
389
|
-
const newClasses = [...classes];
|
|
390
|
-
const rowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(id);
|
|
391
|
-
const columnIndex = apiRef.current.getColumnIndex(field);
|
|
392
|
-
const visibleColumns = apiRef.current.getVisibleColumns();
|
|
393
|
-
if (rowIndex > 0) {
|
|
394
|
-
const {
|
|
395
|
-
id: previousRowId
|
|
396
|
-
} = visibleRows.rows[rowIndex - 1];
|
|
397
|
-
if (!apiRef.current.isCellSelected(previousRowId, field)) {
|
|
398
|
-
newClasses.push(gridClasses['cell--rangeTop']);
|
|
399
|
-
}
|
|
400
|
-
} else {
|
|
401
|
-
newClasses.push(gridClasses['cell--rangeTop']);
|
|
402
|
-
}
|
|
403
|
-
if (rowIndex + visibleRows.range.firstRowIndex < visibleRows.range.lastRowIndex) {
|
|
404
|
-
const {
|
|
405
|
-
id: nextRowId
|
|
406
|
-
} = visibleRows.rows[rowIndex + 1];
|
|
407
|
-
if (!apiRef.current.isCellSelected(nextRowId, field)) {
|
|
408
|
-
newClasses.push(gridClasses['cell--rangeBottom']);
|
|
409
|
-
}
|
|
410
|
-
} else {
|
|
411
|
-
newClasses.push(gridClasses['cell--rangeBottom']);
|
|
412
|
-
}
|
|
413
|
-
if (columnIndex > 0) {
|
|
414
|
-
const {
|
|
415
|
-
field: previousColumnField
|
|
416
|
-
} = visibleColumns[columnIndex - 1];
|
|
417
|
-
if (!apiRef.current.isCellSelected(id, previousColumnField)) {
|
|
418
|
-
newClasses.push(gridClasses['cell--rangeLeft']);
|
|
419
|
-
}
|
|
420
|
-
} else {
|
|
421
|
-
newClasses.push(gridClasses['cell--rangeLeft']);
|
|
422
|
-
}
|
|
423
|
-
if (columnIndex < visibleColumns.length - 1) {
|
|
424
|
-
const {
|
|
425
|
-
field: nextColumnField
|
|
426
|
-
} = visibleColumns[columnIndex + 1];
|
|
427
|
-
if (!apiRef.current.isCellSelected(id, nextColumnField)) {
|
|
428
|
-
newClasses.push(gridClasses['cell--rangeRight']);
|
|
429
|
-
}
|
|
430
|
-
} else {
|
|
431
|
-
newClasses.push(gridClasses['cell--rangeRight']);
|
|
432
|
-
}
|
|
433
|
-
return newClasses;
|
|
434
|
-
}, [apiRef]);
|
|
435
|
-
const canUpdateFocus = React.useCallback((initialValue, {
|
|
436
|
-
event,
|
|
437
|
-
cell
|
|
438
|
-
}) => {
|
|
439
|
-
if (!cell || !props.cellSelection || !event.shiftKey) {
|
|
440
|
-
return initialValue;
|
|
441
|
-
}
|
|
442
|
-
if (isKeyboardEvent(event)) {
|
|
443
|
-
return isNavigationKey(event.key) ? false : initialValue;
|
|
444
|
-
}
|
|
445
|
-
const focusedCell = gridFocusCellSelector(apiRef);
|
|
446
|
-
if (hasClickedValidCellForRangeSelection(cell) && focusedCell) {
|
|
447
|
-
return false;
|
|
448
|
-
}
|
|
449
|
-
return initialValue;
|
|
450
|
-
}, [apiRef, props.cellSelection, hasClickedValidCellForRangeSelection]);
|
|
451
|
-
const handleClipboardCopy = React.useCallback(value => {
|
|
452
|
-
if (apiRef.current.getSelectedCellsAsArray().length <= 1) {
|
|
453
|
-
return value;
|
|
454
|
-
}
|
|
455
|
-
const sortedRowIds = gridSortedRowIdsSelector(apiRef);
|
|
456
|
-
const cellSelectionModel = apiRef.current.getCellSelectionModel();
|
|
457
|
-
const unsortedSelectedRowIds = Object.keys(cellSelectionModel);
|
|
458
|
-
const sortedSelectedRowIds = sortedRowIds.filter(id => unsortedSelectedRowIds.includes(`${id}`));
|
|
459
|
-
const copyData = sortedSelectedRowIds.reduce((acc, rowId) => {
|
|
460
|
-
const fieldsMap = cellSelectionModel[rowId];
|
|
461
|
-
const rowString = Object.keys(fieldsMap).reduce((acc2, field) => {
|
|
462
|
-
let cellData;
|
|
463
|
-
if (fieldsMap[field]) {
|
|
464
|
-
const cellParams = apiRef.current.getCellParams(rowId, field);
|
|
465
|
-
cellData = serializeCellValue(cellParams, {
|
|
466
|
-
csvOptions: {
|
|
467
|
-
delimiter: clipboardCopyCellDelimiter,
|
|
468
|
-
shouldAppendQuotes: false,
|
|
469
|
-
escapeFormulas: false
|
|
470
|
-
},
|
|
471
|
-
ignoreValueFormatter
|
|
472
|
-
});
|
|
473
|
-
} else {
|
|
474
|
-
cellData = '';
|
|
475
|
-
}
|
|
476
|
-
return acc2 === '' ? cellData : [acc2, cellData].join(clipboardCopyCellDelimiter);
|
|
477
|
-
}, '');
|
|
478
|
-
return acc === '' ? rowString : [acc, rowString].join('\r\n');
|
|
479
|
-
}, '');
|
|
480
|
-
return copyData;
|
|
481
|
-
}, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter]);
|
|
482
|
-
useGridRegisterPipeProcessor(apiRef, 'isCellSelected', checkIfCellIsSelected);
|
|
483
|
-
useGridRegisterPipeProcessor(apiRef, 'cellClassName', addClassesToCells);
|
|
484
|
-
useGridRegisterPipeProcessor(apiRef, 'canUpdateFocus', canUpdateFocus);
|
|
485
|
-
useGridRegisterPipeProcessor(apiRef, 'clipboardCopy', handleClipboardCopy);
|
|
486
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
-
import { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
|
|
3
|
-
import type { DataGridPremiumProcessedProps } from '../../../models/dataGridPremiumProps';
|
|
4
|
-
export declare const useGridClipboardImport: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "pagination" | "paginationMode" | "processRowUpdate" | "onProcessRowUpdateError" | "getRowId" | "onClipboardPasteStart" | "onClipboardPasteEnd" | "splitClipboardPastedText" | "disableClipboardPaste" | "onBeforeClipboardPasteStart">) => void;
|