@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
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useGridAiAssistant = exports.aiAssistantStateInitializer = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _xDataGridPro = require("@mui/x-data-grid-pro");
|
|
12
|
+
var _internals = require("@mui/x-data-grid-pro/internals");
|
|
13
|
+
var _gridAiAssistantSelectors = require("./gridAiAssistantSelectors");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
const DEFAULT_SAMPLE_COUNT = 5;
|
|
16
|
+
const aiAssistantStateInitializer = (state, props) => {
|
|
17
|
+
if (!props.aiAssistant) {
|
|
18
|
+
return (0, _extends2.default)({}, state, {
|
|
19
|
+
aiAssistant: {
|
|
20
|
+
activeConversationIndex: 0,
|
|
21
|
+
conversations: []
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return (0, _extends2.default)({}, state, {
|
|
26
|
+
aiAssistant: {
|
|
27
|
+
activeConversationIndex: 0,
|
|
28
|
+
conversations: props.aiAssistantConversations ?? props.initialState?.aiAssistant?.conversations ?? []
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
exports.aiAssistantStateInitializer = aiAssistantStateInitializer;
|
|
33
|
+
const useGridAiAssistant = (apiRef, props) => {
|
|
34
|
+
const {
|
|
35
|
+
onPrompt,
|
|
36
|
+
allowAiAssistantDataSampling,
|
|
37
|
+
slots,
|
|
38
|
+
disableColumnFilter,
|
|
39
|
+
disableRowGrouping,
|
|
40
|
+
disableAggregation,
|
|
41
|
+
disableColumnSorting,
|
|
42
|
+
disablePivoting
|
|
43
|
+
} = props;
|
|
44
|
+
const columnsLookup = (0, _xDataGridPro.gridColumnLookupSelector)(apiRef);
|
|
45
|
+
const columns = Object.values(columnsLookup);
|
|
46
|
+
const rows = Object.values((0, _xDataGridPro.gridRowsLookupSelector)(apiRef));
|
|
47
|
+
const isAiAssistantAvailable = !!props.aiAssistant;
|
|
48
|
+
apiRef.current.registerControlState({
|
|
49
|
+
stateId: 'aiAssistantConversations',
|
|
50
|
+
propModel: props.aiAssistantConversations,
|
|
51
|
+
propOnChange: props.onAiAssistantConversationsChange,
|
|
52
|
+
stateSelector: _gridAiAssistantSelectors.gridAiAssistantConversationsSelector,
|
|
53
|
+
changeEvent: 'aiAssistantConversationsChange'
|
|
54
|
+
});
|
|
55
|
+
apiRef.current.registerControlState({
|
|
56
|
+
stateId: 'aiAssistantActiveConversationIndex',
|
|
57
|
+
propModel: props.aiAssistantActiveConversationIndex,
|
|
58
|
+
propOnChange: props.onAiAssistantActiveConversationIndexChange,
|
|
59
|
+
stateSelector: _gridAiAssistantSelectors.gridAiAssistantActiveConversationIndexSelector,
|
|
60
|
+
changeEvent: 'aiAssistantActiveConversationIndexChange'
|
|
61
|
+
});
|
|
62
|
+
const preferencePanelPreProcessing = React.useCallback((initialValue, value) => {
|
|
63
|
+
if (isAiAssistantAvailable && slots.aiAssistantPanel && value === _xDataGridPro.GridPreferencePanelsValue.aiAssistant) {
|
|
64
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(slots.aiAssistantPanel, {});
|
|
65
|
+
}
|
|
66
|
+
return initialValue;
|
|
67
|
+
}, [isAiAssistantAvailable, slots]);
|
|
68
|
+
const collectSampleData = React.useCallback(() => {
|
|
69
|
+
const columnExamples = {};
|
|
70
|
+
columns.forEach(column => {
|
|
71
|
+
columnExamples[column.field] = Array.from({
|
|
72
|
+
length: Math.min(DEFAULT_SAMPLE_COUNT, rows.length)
|
|
73
|
+
}).map(() => {
|
|
74
|
+
const row = rows[Math.floor(Math.random() * rows.length)];
|
|
75
|
+
if (column.valueGetter) {
|
|
76
|
+
return column.valueGetter(row[column.field], row, column, apiRef);
|
|
77
|
+
}
|
|
78
|
+
return row[column.field];
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
return columnExamples;
|
|
82
|
+
}, [apiRef, columns, rows]);
|
|
83
|
+
const getPromptContext = React.useCallback((allowDataSampling = false) => {
|
|
84
|
+
if (!isAiAssistantAvailable) {
|
|
85
|
+
return '';
|
|
86
|
+
}
|
|
87
|
+
const examples = allowDataSampling ? collectSampleData() : {};
|
|
88
|
+
const columnsContext = columns.map(column => ({
|
|
89
|
+
field: column.field,
|
|
90
|
+
description: column.description ?? null,
|
|
91
|
+
examples: examples[column.field] ?? column.examples ?? [],
|
|
92
|
+
type: column.type ?? 'string',
|
|
93
|
+
allowedOperators: column.filterOperators?.map(operator => operator.value) ?? []
|
|
94
|
+
}));
|
|
95
|
+
return JSON.stringify(columnsContext);
|
|
96
|
+
}, [columns, collectSampleData, isAiAssistantAvailable]);
|
|
97
|
+
const applyPromptResult = React.useCallback(result => {
|
|
98
|
+
if (!isAiAssistantAvailable) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const interestColumns = [];
|
|
102
|
+
if (!disableColumnFilter) {
|
|
103
|
+
apiRef.current.setFilterModel({
|
|
104
|
+
items: result.filters.map((filter, index) => {
|
|
105
|
+
const item = {
|
|
106
|
+
id: index,
|
|
107
|
+
field: filter.column,
|
|
108
|
+
operator: filter.operator,
|
|
109
|
+
value: filter.value
|
|
110
|
+
};
|
|
111
|
+
const column = columnsLookup[filter.column];
|
|
112
|
+
if (column.type === 'singleSelect') {
|
|
113
|
+
const options = (0, _internals.getValueOptions)(column) ?? [];
|
|
114
|
+
const found = options.find(option => typeof option === 'object' && option.label === filter.value);
|
|
115
|
+
if (found) {
|
|
116
|
+
item.value = found.value;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return item;
|
|
120
|
+
}),
|
|
121
|
+
logicOperator: result.filterOperator ?? _xDataGridPro.GridLogicOperator.And,
|
|
122
|
+
quickFilterValues: []
|
|
123
|
+
});
|
|
124
|
+
interestColumns.push(...result.filters.map(f => f.column));
|
|
125
|
+
}
|
|
126
|
+
let appliedPivoting = false;
|
|
127
|
+
if (!disablePivoting && 'columns' in result.pivoting) {
|
|
128
|
+
apiRef.current.setPivotActive(true);
|
|
129
|
+
apiRef.current.setPivotModel({
|
|
130
|
+
columns: result.pivoting.columns.map(c => ({
|
|
131
|
+
field: c.column,
|
|
132
|
+
sort: c.direction
|
|
133
|
+
})),
|
|
134
|
+
rows: result.pivoting.rows.map(r => ({
|
|
135
|
+
field: r
|
|
136
|
+
})),
|
|
137
|
+
values: result.pivoting.values.map(valueObj => {
|
|
138
|
+
const [field] = Object.keys(valueObj);
|
|
139
|
+
return {
|
|
140
|
+
field,
|
|
141
|
+
aggFunc: valueObj[field]
|
|
142
|
+
};
|
|
143
|
+
})
|
|
144
|
+
});
|
|
145
|
+
appliedPivoting = true;
|
|
146
|
+
} else if ('columns' in result.pivoting) {
|
|
147
|
+
// if pivoting is disabled and there are pivoting results, try to move them into grouping and aggregation
|
|
148
|
+
result.pivoting.columns.forEach(c => {
|
|
149
|
+
result.grouping.push({
|
|
150
|
+
column: c.column
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
result.pivoting.rows.forEach(r => {
|
|
154
|
+
result.grouping.push({
|
|
155
|
+
column: r
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
result.pivoting.values.forEach(valueObj => {
|
|
159
|
+
const [field] = Object.keys(valueObj);
|
|
160
|
+
result.aggregation[field] = valueObj[field];
|
|
161
|
+
});
|
|
162
|
+
// remove the pivoting results data
|
|
163
|
+
result.pivoting = {};
|
|
164
|
+
}
|
|
165
|
+
if (!disableRowGrouping && !appliedPivoting) {
|
|
166
|
+
apiRef.current.setRowGroupingModel(result.grouping.map(g => g.column));
|
|
167
|
+
}
|
|
168
|
+
if (!disableAggregation && !appliedPivoting) {
|
|
169
|
+
apiRef.current.setAggregationModel(result.aggregation);
|
|
170
|
+
interestColumns.push(...Object.keys(result.aggregation));
|
|
171
|
+
}
|
|
172
|
+
if (!disableColumnSorting) {
|
|
173
|
+
apiRef.current.setSortModel(result.sorting.map(s => ({
|
|
174
|
+
field: s.column,
|
|
175
|
+
sort: s.direction
|
|
176
|
+
})));
|
|
177
|
+
}
|
|
178
|
+
const visibleRowsData = (0, _internals.getVisibleRows)(apiRef);
|
|
179
|
+
const rowSelectionModel = {
|
|
180
|
+
type: 'include',
|
|
181
|
+
ids: new Set()
|
|
182
|
+
};
|
|
183
|
+
if (result.select !== -1) {
|
|
184
|
+
for (let i = 0; i < result.select; i += 1) {
|
|
185
|
+
const row = visibleRowsData.rows[i];
|
|
186
|
+
const id = apiRef.current.getRowId(row);
|
|
187
|
+
rowSelectionModel.ids.add(id);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
apiRef.current.setRowSelectionModel(rowSelectionModel);
|
|
191
|
+
const targetIndex = Number(columnsLookup[_xDataGridPro.GRID_CHECKBOX_SELECTION_FIELD] !== undefined) + Number(result.grouping.length);
|
|
192
|
+
interestColumns.reverse().forEach(c => apiRef.current.setColumnIndex(c, targetIndex));
|
|
193
|
+
}, [apiRef, disableColumnFilter, disableRowGrouping, disableAggregation, disableColumnSorting, disablePivoting, columnsLookup, isAiAssistantAvailable]);
|
|
194
|
+
const setActiveConversationId = React.useCallback(id => {
|
|
195
|
+
if (!isAiAssistantAvailable) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
const conversations = (0, _gridAiAssistantSelectors.gridAiAssistantConversationsSelector)(apiRef);
|
|
199
|
+
const activeConversationIndex = (0, _gridAiAssistantSelectors.gridAiAssistantActiveConversationIndexSelector)(apiRef);
|
|
200
|
+
if (!conversations[activeConversationIndex]) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
conversations[activeConversationIndex].id = id;
|
|
204
|
+
apiRef.current.setState(state => (0, _extends2.default)({}, state, {
|
|
205
|
+
aiAssistant: (0, _extends2.default)({}, state.aiAssistant, {
|
|
206
|
+
conversations
|
|
207
|
+
})
|
|
208
|
+
}));
|
|
209
|
+
}, [apiRef, isAiAssistantAvailable]);
|
|
210
|
+
const setConversationPrompts = React.useCallback((index, callback) => {
|
|
211
|
+
if (!isAiAssistantAvailable) {
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
const currentConversations = (0, _gridAiAssistantSelectors.gridAiAssistantConversationsSelector)(apiRef);
|
|
215
|
+
const targetConversation = currentConversations[index];
|
|
216
|
+
const newPrompts = typeof callback === 'function' ? callback(targetConversation === undefined ? [] : targetConversation.prompts) : callback;
|
|
217
|
+
const newConversations = currentConversations.toSpliced(targetConversation === undefined ? currentConversations.length : index, 1, (0, _extends2.default)({}, targetConversation, {
|
|
218
|
+
title: newPrompts[newPrompts.length - 1].value,
|
|
219
|
+
// TODO: make the title configurable
|
|
220
|
+
prompts: newPrompts
|
|
221
|
+
}));
|
|
222
|
+
apiRef.current.setState(state => (0, _extends2.default)({}, state, {
|
|
223
|
+
aiAssistant: (0, _extends2.default)({}, state.aiAssistant, {
|
|
224
|
+
conversations: newConversations
|
|
225
|
+
})
|
|
226
|
+
}));
|
|
227
|
+
}, [apiRef, isAiAssistantAvailable]);
|
|
228
|
+
const processPrompt = React.useCallback(async value => {
|
|
229
|
+
if (!onPrompt) {
|
|
230
|
+
return undefined;
|
|
231
|
+
}
|
|
232
|
+
const activeConversationIndex = (0, _gridAiAssistantSelectors.gridAiAssistantActiveConversationIndexSelector)(apiRef);
|
|
233
|
+
const activeConversation = (0, _gridAiAssistantSelectors.gridAiAssistantActiveConversationSelector)(apiRef);
|
|
234
|
+
const date = Date.now();
|
|
235
|
+
apiRef.current.setLoading(true);
|
|
236
|
+
setConversationPrompts(activeConversationIndex, prevPrompts => [...prevPrompts, {
|
|
237
|
+
value,
|
|
238
|
+
createdAt: new Date(date),
|
|
239
|
+
variant: 'processing',
|
|
240
|
+
helperText: apiRef.current.getLocaleText('promptProcessing')
|
|
241
|
+
}]);
|
|
242
|
+
try {
|
|
243
|
+
const response = await onPrompt(value, getPromptContext(allowAiAssistantDataSampling), activeConversation?.id);
|
|
244
|
+
applyPromptResult(response);
|
|
245
|
+
setActiveConversationId(response.conversationId);
|
|
246
|
+
setConversationPrompts(activeConversationIndex, prevPrompts => prevPrompts.map(item => item.createdAt.getTime() === date ? (0, _extends2.default)({}, item, {
|
|
247
|
+
response,
|
|
248
|
+
variant: 'success',
|
|
249
|
+
helperText: ''
|
|
250
|
+
}) : item));
|
|
251
|
+
return response;
|
|
252
|
+
} catch (error) {
|
|
253
|
+
setConversationPrompts(activeConversationIndex, prevPrompts => prevPrompts.map(item => item.createdAt.getTime() === date ? (0, _extends2.default)({}, item, {
|
|
254
|
+
variant: 'error',
|
|
255
|
+
helperText: error.message
|
|
256
|
+
}) : item));
|
|
257
|
+
return error;
|
|
258
|
+
} finally {
|
|
259
|
+
apiRef.current.setLoading(false);
|
|
260
|
+
}
|
|
261
|
+
}, [apiRef, allowAiAssistantDataSampling, onPrompt, getPromptContext, applyPromptResult, setConversationPrompts, setActiveConversationId]);
|
|
262
|
+
const setActiveConversationIndex = React.useCallback(index => {
|
|
263
|
+
apiRef.current.setState(state => (0, _extends2.default)({}, state, {
|
|
264
|
+
aiAssistant: (0, _extends2.default)({}, state.aiAssistant, {
|
|
265
|
+
activeConversationIndex: index
|
|
266
|
+
})
|
|
267
|
+
}));
|
|
268
|
+
const conversation = (0, _gridAiAssistantSelectors.gridAiAssistantActiveConversationSelector)(apiRef);
|
|
269
|
+
if (!conversation) {
|
|
270
|
+
throw new Error('Conversation not found');
|
|
271
|
+
}
|
|
272
|
+
return conversation;
|
|
273
|
+
}, [apiRef]);
|
|
274
|
+
const setConversations = React.useCallback(callback => {
|
|
275
|
+
if (!isAiAssistantAvailable) {
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
apiRef.current.setState(state => (0, _extends2.default)({}, state, {
|
|
279
|
+
aiAssistant: (0, _extends2.default)({}, state.aiAssistant, {
|
|
280
|
+
conversations: typeof callback === 'function' ? callback(state.aiAssistant?.conversations) : callback
|
|
281
|
+
})
|
|
282
|
+
}));
|
|
283
|
+
}, [apiRef, isAiAssistantAvailable]);
|
|
284
|
+
React.useEffect(() => {
|
|
285
|
+
if (props.aiAssistantConversations) {
|
|
286
|
+
setConversations(props.aiAssistantConversations);
|
|
287
|
+
}
|
|
288
|
+
}, [apiRef, props.aiAssistantConversations, setConversations]);
|
|
289
|
+
React.useEffect(() => {
|
|
290
|
+
if (props.aiAssistantActiveConversationIndex) {
|
|
291
|
+
setActiveConversationIndex(props.aiAssistantActiveConversationIndex);
|
|
292
|
+
}
|
|
293
|
+
}, [apiRef, props.aiAssistantActiveConversationIndex, setActiveConversationIndex]);
|
|
294
|
+
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'preferencePanel', preferencePanelPreProcessing);
|
|
295
|
+
(0, _xDataGridPro.useGridApiMethod)(apiRef, {
|
|
296
|
+
aiAssistant: {
|
|
297
|
+
processPrompt,
|
|
298
|
+
setConversations,
|
|
299
|
+
setActiveConversationIndex
|
|
300
|
+
}
|
|
301
|
+
}, 'public');
|
|
302
|
+
};
|
|
303
|
+
exports.useGridAiAssistant = useGridAiAssistant;
|
|
@@ -363,11 +363,11 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
363
363
|
field
|
|
364
364
|
}, cellWithVirtualFocus.current);
|
|
365
365
|
});
|
|
366
|
-
(0, _xDataGridPro.
|
|
367
|
-
(0, _xDataGridPro.
|
|
368
|
-
(0, _xDataGridPro.
|
|
369
|
-
(0, _xDataGridPro.
|
|
370
|
-
(0, _xDataGridPro.
|
|
366
|
+
(0, _xDataGridPro.useGridEvent)(apiRef, 'cellClick', runIfCellSelectionIsEnabled(handleCellClick));
|
|
367
|
+
(0, _xDataGridPro.useGridEvent)(apiRef, 'cellFocusIn', runIfCellSelectionIsEnabled(handleCellFocusIn));
|
|
368
|
+
(0, _xDataGridPro.useGridEvent)(apiRef, 'cellKeyDown', runIfCellSelectionIsEnabled(handleCellKeyDown));
|
|
369
|
+
(0, _xDataGridPro.useGridEvent)(apiRef, 'cellMouseDown', runIfCellSelectionIsEnabled(handleCellMouseDown));
|
|
370
|
+
(0, _xDataGridPro.useGridEvent)(apiRef, 'cellMouseOver', runIfCellSelectionIsEnabled(handleCellMouseOver));
|
|
371
371
|
React.useEffect(() => {
|
|
372
372
|
if (props.cellSelectionModel) {
|
|
373
373
|
apiRef.current.setCellSelectionModel(props.cellSelectionModel);
|
|
@@ -336,9 +336,9 @@ const useGridClipboardImport = (apiRef, props) => {
|
|
|
336
336
|
}
|
|
337
337
|
return initialValue;
|
|
338
338
|
}, [enableClipboardPaste]);
|
|
339
|
-
(0, _xDataGrid.
|
|
340
|
-
(0, _xDataGrid.
|
|
341
|
-
(0, _xDataGrid.
|
|
339
|
+
(0, _xDataGrid.useGridEvent)(apiRef, 'cellKeyDown', handlePaste);
|
|
340
|
+
(0, _xDataGrid.useGridEventPriority)(apiRef, 'clipboardPasteStart', props.onClipboardPasteStart);
|
|
341
|
+
(0, _xDataGrid.useGridEventPriority)(apiRef, 'clipboardPasteEnd', props.onClipboardPasteEnd);
|
|
342
342
|
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'canStartEditing', checkIfCanStartEditing);
|
|
343
343
|
};
|
|
344
344
|
exports.useGridClipboardImport = useGridClipboardImport;
|
|
@@ -21,6 +21,7 @@ const options = {
|
|
|
21
21
|
const useGridDataSourcePremium = (apiRef, props) => {
|
|
22
22
|
const {
|
|
23
23
|
api,
|
|
24
|
+
debouncedFetchRows,
|
|
24
25
|
strategyProcessor,
|
|
25
26
|
events,
|
|
26
27
|
setStrategyAvailability
|
|
@@ -59,8 +60,10 @@ const useGridDataSourcePremium = (apiRef, props) => {
|
|
|
59
60
|
(0, _internals.useGridRegisterStrategyProcessor)(apiRef, strategyProcessor.strategyName, strategyProcessor.group, strategyProcessor.processor);
|
|
60
61
|
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'processDataSourceRows', processDataSourceRows);
|
|
61
62
|
Object.entries(events).forEach(([event, handler]) => {
|
|
62
|
-
(0, _xDataGridPro.
|
|
63
|
+
(0, _xDataGridPro.useGridEvent)(apiRef, event, handler);
|
|
63
64
|
});
|
|
65
|
+
(0, _xDataGridPro.useGridEvent)(apiRef, 'rowGroupingModelChange', () => debouncedFetchRows());
|
|
66
|
+
(0, _xDataGridPro.useGridEvent)(apiRef, 'aggregationModelChange', () => debouncedFetchRows());
|
|
64
67
|
React.useEffect(() => {
|
|
65
68
|
setStrategyAvailability();
|
|
66
69
|
}, [setStrategyAvailability]);
|
|
@@ -143,6 +143,6 @@ const useGridExcelExport = (apiRef, props) => {
|
|
|
143
143
|
}];
|
|
144
144
|
}, []);
|
|
145
145
|
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'exportMenu', addExportMenuButtons);
|
|
146
|
-
(0, _xDataGrid.
|
|
146
|
+
(0, _xDataGrid.useGridEventPriority)(apiRef, 'excelExportStateChange', props.onExcelExportStateChange);
|
|
147
147
|
};
|
|
148
148
|
exports.useGridExcelExport = useGridExcelExport;
|
package/hooks/features/index.js
CHANGED
|
@@ -47,14 +47,14 @@ Object.keys(_cellSelection).forEach(function (key) {
|
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
|
-
var
|
|
51
|
-
Object.keys(
|
|
50
|
+
var _aiAssistant = require("./aiAssistant");
|
|
51
|
+
Object.keys(_aiAssistant).forEach(function (key) {
|
|
52
52
|
if (key === "default" || key === "__esModule") return;
|
|
53
|
-
if (key in exports && exports[key] ===
|
|
53
|
+
if (key in exports && exports[key] === _aiAssistant[key]) return;
|
|
54
54
|
Object.defineProperty(exports, key, {
|
|
55
55
|
enumerable: true,
|
|
56
56
|
get: function () {
|
|
57
|
-
return
|
|
57
|
+
return _aiAssistant[key];
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { GridColDef } from '@mui/x-data-grid-pro';
|
|
2
|
+
import type { GridPivotingPrivateApiCommunity, GridPivotingStatePartial } from '@mui/x-data-grid/internals';
|
|
3
|
+
import type { DataGridPremiumProcessedProps } from '../../../models/dataGridPremiumProps';
|
|
4
|
+
export type GridPivotingPropsOverrides = {
|
|
5
|
+
rows: DataGridPremiumProcessedProps['rows'];
|
|
6
|
+
columns: DataGridPremiumProcessedProps['columns'];
|
|
7
|
+
rowGroupingModel: NonNullable<DataGridPremiumProcessedProps['rowGroupingModel']>;
|
|
8
|
+
aggregationModel: NonNullable<DataGridPremiumProcessedProps['aggregationModel']>;
|
|
9
|
+
getAggregationPosition: NonNullable<DataGridPremiumProcessedProps['getAggregationPosition']>;
|
|
10
|
+
columnVisibilityModel: NonNullable<DataGridPremiumProcessedProps['columnVisibilityModel']>;
|
|
11
|
+
columnGroupingModel: NonNullable<DataGridPremiumProcessedProps['columnGroupingModel']>;
|
|
12
|
+
groupingColDef: NonNullable<DataGridPremiumProcessedProps['groupingColDef']>;
|
|
13
|
+
headerFilters: NonNullable<DataGridPremiumProcessedProps['headerFilters']>;
|
|
14
|
+
disableAggregation: NonNullable<DataGridPremiumProcessedProps['disableAggregation']>;
|
|
15
|
+
disableRowGrouping: NonNullable<DataGridPremiumProcessedProps['disableRowGrouping']>;
|
|
16
|
+
};
|
|
17
|
+
export interface GridPivotingState extends GridPivotingStatePartial {
|
|
18
|
+
model: GridPivotModel;
|
|
19
|
+
propsOverrides: GridPivotingPropsOverrides | undefined;
|
|
20
|
+
}
|
|
21
|
+
export interface GridPivotingInitialState {
|
|
22
|
+
model?: GridPivotModel;
|
|
23
|
+
enabled?: boolean;
|
|
24
|
+
panelOpen?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface GridPivotModel {
|
|
27
|
+
columns: {
|
|
28
|
+
field: GridColDef['field'];
|
|
29
|
+
sort?: 'asc' | 'desc';
|
|
30
|
+
hidden?: boolean;
|
|
31
|
+
}[];
|
|
32
|
+
rows: {
|
|
33
|
+
field: GridColDef['field'];
|
|
34
|
+
hidden?: boolean;
|
|
35
|
+
}[];
|
|
36
|
+
values: {
|
|
37
|
+
field: GridColDef['field'];
|
|
38
|
+
aggFunc: string;
|
|
39
|
+
hidden?: boolean;
|
|
40
|
+
}[];
|
|
41
|
+
}
|
|
42
|
+
export type DropPosition = 'top' | 'bottom' | null;
|
|
43
|
+
export interface GridPivotingApi {
|
|
44
|
+
/**
|
|
45
|
+
* Sets the pivot model to use in the pivot mode.
|
|
46
|
+
* @param {GridPivotModel | ((prev: GridPivotModel) => GridPivotModel)} model - The pivot model to set.
|
|
47
|
+
*/
|
|
48
|
+
setPivotModel: (model: GridPivotModel | ((prev: GridPivotModel) => GridPivotModel)) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Sets whether the pivot mode is active.
|
|
51
|
+
* @param {boolean | ((prev: boolean) => boolean)} active - The new value of the pivot mode state.
|
|
52
|
+
*/
|
|
53
|
+
setPivotActive: (active: boolean | ((prev: boolean) => boolean)) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Sets whether the pivot panel is open.
|
|
56
|
+
* @param {boolean | ((prev: boolean) => boolean)} open - The new value of the pivot panel open state.
|
|
57
|
+
*/
|
|
58
|
+
setPivotPanelOpen: (open: boolean | ((prev: boolean) => boolean)) => void;
|
|
59
|
+
}
|
|
60
|
+
export interface GridPivotingPrivateApi extends GridPivotingPrivateApiCommunity {
|
|
61
|
+
updatePivotModel: (params: {
|
|
62
|
+
field: string;
|
|
63
|
+
targetSection: 'columns' | 'rows' | 'values' | null;
|
|
64
|
+
originSection: 'columns' | 'rows' | 'values' | null;
|
|
65
|
+
targetField?: string;
|
|
66
|
+
targetFieldPosition?: DropPosition;
|
|
67
|
+
}) => void;
|
|
68
|
+
}
|
|
69
|
+
export type GridPivotingColDefOverrides = Pick<GridColDef, 'width' | 'flex' | 'headerName' | 'description' | 'align' | 'headerAlign' | 'cellClassName' | 'headerClassName' | 'display' | 'maxWidth' | 'minWidth' | 'resizable' | 'sortingOrder'>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { GridStatePremium } from '../../../models/gridStatePremium';
|
|
2
|
+
export declare const gridPivotModelSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, import("./gridPivotingInterfaces").GridPivotingState, import("./gridPivotingInterfaces").GridPivotModel>;
|
|
3
|
+
export declare const gridPivotPropsOverridesSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, import("./gridPivotingInterfaces").GridPivotingState, import("./gridPivotingInterfaces").GridPivotingPropsOverrides | undefined>;
|
|
4
|
+
export { gridPivotActiveSelector, gridPivotInitialColumnsSelector, gridPivotPanelOpenSelector } from '@mui/x-data-grid/internals';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "gridPivotActiveSelector", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _internals2.gridPivotActiveSelector;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "gridPivotInitialColumnsSelector", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _internals2.gridPivotInitialColumnsSelector;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
exports.gridPivotModelSelector = void 0;
|
|
19
|
+
Object.defineProperty(exports, "gridPivotPanelOpenSelector", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () {
|
|
22
|
+
return _internals2.gridPivotPanelOpenSelector;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
exports.gridPivotPropsOverridesSelector = void 0;
|
|
26
|
+
var _internals = require("@mui/x-data-grid-pro/internals");
|
|
27
|
+
var _internals2 = require("@mui/x-data-grid/internals");
|
|
28
|
+
const gridPivotingStateSelector = (0, _internals.createRootSelector)(state => state.pivoting);
|
|
29
|
+
const gridPivotModelSelector = exports.gridPivotModelSelector = (0, _internals.createSelector)(gridPivotingStateSelector, pivoting => pivoting?.model);
|
|
30
|
+
const gridPivotPropsOverridesSelector = exports.gridPivotPropsOverridesSelector = (0, _internals.createSelector)(gridPivotingStateSelector, pivoting => pivoting?.active ? pivoting.propsOverrides : undefined);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GridColDef, GridRowModel } from '@mui/x-data-grid-pro';
|
|
2
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
3
|
+
import { GridStateInitializer } from '@mui/x-data-grid-pro/internals';
|
|
4
|
+
import type { DataGridPremiumProcessedProps } from '../../../models/dataGridPremiumProps';
|
|
5
|
+
import { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
|
|
6
|
+
export declare const pivotingStateInitializer: GridStateInitializer<Pick<DataGridPremiumProcessedProps, 'pivotActive' | 'pivotModel' | 'pivotPanelOpen' | 'initialState' | 'disablePivoting' | 'getPivotDerivedColumns' | 'columns'>>;
|
|
7
|
+
export declare const useGridPivoting: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "pivotActive" | "onPivotActiveChange" | "pivotModel" | "onPivotModelChange" | "pivotPanelOpen" | "onPivotPanelOpenChange" | "disablePivoting" | "getPivotDerivedColumns" | "pivotingColDef" | "aggregationFunctions">, originalColumnsProp: readonly GridColDef[], originalRowsProp: readonly GridRowModel[]) => void;
|