@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,215 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { styled } from '@mui/material/styles';
|
|
4
|
-
import composeClasses from '@mui/utils/composeClasses';
|
|
5
|
-
import useEventCallback from '@mui/utils/useEventCallback';
|
|
6
|
-
import { getDataGridUtilityClass, GRID_CHECKBOX_SELECTION_FIELD, gridColumnDefinitionsSelector, gridColumnLookupSelector, GridLogicOperator, gridRowsLookupSelector } from '@mui/x-data-grid';
|
|
7
|
-
import { getValueOptions, getVisibleRows } from '@mui/x-data-grid/internals';
|
|
8
|
-
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
9
|
-
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
10
|
-
import { RecordButton, BrowserSpeechRecognition } from "./RecordButton.js";
|
|
11
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
const supportsSpeechRecognition = !!BrowserSpeechRecognition;
|
|
13
|
-
const useUtilityClasses = ownerState => {
|
|
14
|
-
const {
|
|
15
|
-
classes,
|
|
16
|
-
recording
|
|
17
|
-
} = ownerState;
|
|
18
|
-
const slots = {
|
|
19
|
-
root: ['toolbarPromptControl', recording && 'toolbarPromptControl--recording'],
|
|
20
|
-
recordingIndicator: ['toolbarPromptControlRecordingIndicator'],
|
|
21
|
-
recordButton: ['toolbarPromptControlRecordButton'],
|
|
22
|
-
sendButton: ['toolbarPromptControlSendButton']
|
|
23
|
-
};
|
|
24
|
-
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
25
|
-
};
|
|
26
|
-
const GridToolbarPromptControlRoot = styled('div', {
|
|
27
|
-
name: 'MuiDataGrid',
|
|
28
|
-
slot: 'ToolbarPromptControl',
|
|
29
|
-
overridesResolver: (props, styles) => {
|
|
30
|
-
const {
|
|
31
|
-
ownerState
|
|
32
|
-
} = props;
|
|
33
|
-
return [styles.toolbarPromptControl, ownerState.recording && styles['toolbarPromptControl--recording']];
|
|
34
|
-
}
|
|
35
|
-
})({
|
|
36
|
-
flex: 1,
|
|
37
|
-
display: 'flex',
|
|
38
|
-
flexDirection: 'row'
|
|
39
|
-
});
|
|
40
|
-
function sampleData(apiRef) {
|
|
41
|
-
const columns = gridColumnDefinitionsSelector(apiRef);
|
|
42
|
-
const rows = Object.values(gridRowsLookupSelector(apiRef));
|
|
43
|
-
const columnExamples = {};
|
|
44
|
-
columns.forEach(column => {
|
|
45
|
-
columnExamples[column.field] = Array.from({
|
|
46
|
-
length: Math.min(5, rows.length)
|
|
47
|
-
}).map(() => {
|
|
48
|
-
const row = rows[Math.floor(Math.random() * rows.length)];
|
|
49
|
-
if (column.valueGetter) {
|
|
50
|
-
return column.valueGetter(row[column.field], row, column, apiRef);
|
|
51
|
-
}
|
|
52
|
-
return row[column.field];
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
return columnExamples;
|
|
56
|
-
}
|
|
57
|
-
function generateContext(apiRef, examples) {
|
|
58
|
-
const columns = gridColumnDefinitionsSelector(apiRef);
|
|
59
|
-
const columnsContext = columns.map(column => ({
|
|
60
|
-
field: column.field,
|
|
61
|
-
description: column.description ?? null,
|
|
62
|
-
examples: examples?.[column.field] ?? column.unstable_examples ?? [],
|
|
63
|
-
type: column.type ?? 'string',
|
|
64
|
-
allowedOperators: column.filterOperators?.map(operator => operator.value) ?? []
|
|
65
|
-
}));
|
|
66
|
-
return `The columns are described by the following JSON:\n${JSON.stringify(columnsContext)}`;
|
|
67
|
-
}
|
|
68
|
-
function GridToolbarPromptControl(props) {
|
|
69
|
-
const apiRef = useGridApiContext();
|
|
70
|
-
const rootProps = useGridRootProps();
|
|
71
|
-
const {
|
|
72
|
-
onPrompt,
|
|
73
|
-
lang,
|
|
74
|
-
allowDataSampling = false
|
|
75
|
-
} = props;
|
|
76
|
-
const [isLoading, setLoading] = React.useState(false);
|
|
77
|
-
const [error, setError] = React.useState(null);
|
|
78
|
-
const [isRecording, setRecording] = React.useState(false);
|
|
79
|
-
const [query, setQuery] = React.useState('');
|
|
80
|
-
const ownerState = {
|
|
81
|
-
classes: rootProps.classes,
|
|
82
|
-
recording: isRecording
|
|
83
|
-
};
|
|
84
|
-
const classes = useUtilityClasses(ownerState);
|
|
85
|
-
const examplesFromData = React.useMemo(() => allowDataSampling ? sampleData(apiRef) : undefined, [apiRef, allowDataSampling]);
|
|
86
|
-
const processPrompt = React.useCallback(() => {
|
|
87
|
-
const context = generateContext(apiRef, examplesFromData);
|
|
88
|
-
const columnsByField = gridColumnLookupSelector(apiRef);
|
|
89
|
-
setLoading(true);
|
|
90
|
-
setError(null);
|
|
91
|
-
apiRef.current.setLoading(true);
|
|
92
|
-
onPrompt(context, query).then(result => {
|
|
93
|
-
const interestColumns = [];
|
|
94
|
-
apiRef.current.setFilterModel({
|
|
95
|
-
items: result.filters.map((filter, index) => {
|
|
96
|
-
const item = {
|
|
97
|
-
id: index,
|
|
98
|
-
field: filter.column,
|
|
99
|
-
operator: filter.operator,
|
|
100
|
-
value: filter.value
|
|
101
|
-
};
|
|
102
|
-
const column = columnsByField[filter.column];
|
|
103
|
-
if (column.type === 'singleSelect') {
|
|
104
|
-
const options = getValueOptions(column) ?? [];
|
|
105
|
-
const found = options.find(option => typeof option === 'object' && option.label === filter.value);
|
|
106
|
-
if (found) {
|
|
107
|
-
item.value = found.value;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return item;
|
|
111
|
-
}),
|
|
112
|
-
logicOperator: result.filterOperator ?? GridLogicOperator.And,
|
|
113
|
-
quickFilterValues: []
|
|
114
|
-
});
|
|
115
|
-
apiRef.current.setRowGroupingModel(result.grouping.map(g => g.column));
|
|
116
|
-
apiRef.current.setAggregationModel(result.aggregation);
|
|
117
|
-
apiRef.current.setSortModel(result.sorting.map(s => ({
|
|
118
|
-
field: s.column,
|
|
119
|
-
sort: s.direction
|
|
120
|
-
})));
|
|
121
|
-
const rows = getVisibleRows(apiRef, rootProps);
|
|
122
|
-
const rowSelectionModel = {
|
|
123
|
-
type: 'include',
|
|
124
|
-
ids: new Set()
|
|
125
|
-
};
|
|
126
|
-
if (result.select !== -1) {
|
|
127
|
-
for (let i = 0; i < result.select; i += 1) {
|
|
128
|
-
const row = rows.rows[i];
|
|
129
|
-
const id = apiRef.current.getRowId(row);
|
|
130
|
-
rowSelectionModel.ids.add(id);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
apiRef.current.setRowSelectionModel(rowSelectionModel);
|
|
134
|
-
const columns = apiRef.current.getAllColumns();
|
|
135
|
-
const targetIndex = Number(columns.find(c => c.field === GRID_CHECKBOX_SELECTION_FIELD) !== undefined) + Number(result.grouping.length);
|
|
136
|
-
interestColumns.push(...Object.keys(result.aggregation));
|
|
137
|
-
interestColumns.push(...result.filters.map(f => f.column));
|
|
138
|
-
interestColumns.reverse().forEach(c => apiRef.current.setColumnIndex(c, targetIndex));
|
|
139
|
-
}).catch(_ => {
|
|
140
|
-
setError(apiRef.current.getLocaleText('toolbarPromptControlErrorMessage'));
|
|
141
|
-
}).finally(() => {
|
|
142
|
-
setLoading(false);
|
|
143
|
-
apiRef.current.setState(state => _extends({}, state, {
|
|
144
|
-
rows: _extends({}, state.rows, {
|
|
145
|
-
loading: false
|
|
146
|
-
})
|
|
147
|
-
}));
|
|
148
|
-
});
|
|
149
|
-
}, [apiRef, rootProps, onPrompt, examplesFromData, query]);
|
|
150
|
-
const handleChange = useEventCallback(event => {
|
|
151
|
-
setQuery(event.target.value);
|
|
152
|
-
});
|
|
153
|
-
const handleKeyDown = useEventCallback(event => {
|
|
154
|
-
if (event.code === 'Enter') {
|
|
155
|
-
processPrompt();
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
const handleDone = useEventCallback(value => {
|
|
159
|
-
setQuery(value);
|
|
160
|
-
if (value) {
|
|
161
|
-
processPrompt();
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
const placeholder = supportsSpeechRecognition ? apiRef.current.getLocaleText('toolbarPromptControlWithRecordingPlaceholder') : apiRef.current.getLocaleText('toolbarPromptControlPlaceholder');
|
|
165
|
-
return /*#__PURE__*/_jsx(GridToolbarPromptControlRoot, {
|
|
166
|
-
ownerState: ownerState,
|
|
167
|
-
className: classes.root,
|
|
168
|
-
children: /*#__PURE__*/_jsx(rootProps.slots.baseTextField, {
|
|
169
|
-
placeholder: isRecording ? apiRef.current.getLocaleText('toolbarPromptControlRecordingPlaceholder') : placeholder,
|
|
170
|
-
"aria-label": apiRef.current.getLocaleText('toolbarPromptControlLabel'),
|
|
171
|
-
disabled: isLoading,
|
|
172
|
-
value: query,
|
|
173
|
-
style: {
|
|
174
|
-
flex: 1
|
|
175
|
-
},
|
|
176
|
-
onChange: handleChange,
|
|
177
|
-
size: "small",
|
|
178
|
-
onKeyDown: handleKeyDown,
|
|
179
|
-
error: !!error,
|
|
180
|
-
helperText: error,
|
|
181
|
-
slotProps: {
|
|
182
|
-
input: {
|
|
183
|
-
startAdornment: supportsSpeechRecognition && /*#__PURE__*/_jsx(RecordButton, {
|
|
184
|
-
className: classes.recordButton,
|
|
185
|
-
lang: lang,
|
|
186
|
-
recording: isRecording,
|
|
187
|
-
setRecording: setRecording,
|
|
188
|
-
disabled: isLoading,
|
|
189
|
-
onUpdate: setQuery,
|
|
190
|
-
onDone: handleDone,
|
|
191
|
-
onError: setError
|
|
192
|
-
}),
|
|
193
|
-
endAdornment: /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, {
|
|
194
|
-
title: apiRef.current.getLocaleText('toolbarPromptControlSendActionLabel'),
|
|
195
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
196
|
-
children: /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, {
|
|
197
|
-
className: classes.sendButton,
|
|
198
|
-
disabled: isLoading || isRecording || query === '',
|
|
199
|
-
color: "primary",
|
|
200
|
-
onClick: processPrompt,
|
|
201
|
-
size: "small",
|
|
202
|
-
"aria-label": apiRef.current.getLocaleText('toolbarPromptControlSendActionAriaLabel'),
|
|
203
|
-
edge: "end",
|
|
204
|
-
children: /*#__PURE__*/_jsx(rootProps.slots.toolbarPromptSendIcon, {
|
|
205
|
-
fontSize: "small"
|
|
206
|
-
})
|
|
207
|
-
})
|
|
208
|
-
})
|
|
209
|
-
})
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
})
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
export { GridToolbarPromptControl };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export declare const BrowserSpeechRecognition: any;
|
|
3
|
-
type SpeechRecognitionOptions = {
|
|
4
|
-
onUpdate: (value: string) => void;
|
|
5
|
-
onDone: (value: string) => void;
|
|
6
|
-
onError: (error: string) => void;
|
|
7
|
-
};
|
|
8
|
-
interface RecordButtonProps extends SpeechRecognitionOptions {
|
|
9
|
-
disabled: boolean;
|
|
10
|
-
lang?: string;
|
|
11
|
-
recording: boolean;
|
|
12
|
-
setRecording: (value: boolean) => void;
|
|
13
|
-
className: string;
|
|
14
|
-
}
|
|
15
|
-
declare function RecordButton(props: RecordButtonProps): React.JSX.Element;
|
|
16
|
-
export { RecordButton };
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Timeout } from '@mui/utils/useTimeout';
|
|
3
|
-
import useLazyRef from '@mui/utils/useLazyRef';
|
|
4
|
-
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
5
|
-
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
export const BrowserSpeechRecognition = globalThis.SpeechRecognition || globalThis.webkitSpeechRecognition;
|
|
8
|
-
function RecordButton(props) {
|
|
9
|
-
const apiRef = useGridApiContext();
|
|
10
|
-
const rootProps = useGridRootProps();
|
|
11
|
-
const {
|
|
12
|
-
lang,
|
|
13
|
-
recording,
|
|
14
|
-
setRecording,
|
|
15
|
-
disabled,
|
|
16
|
-
className,
|
|
17
|
-
onDone,
|
|
18
|
-
onUpdate,
|
|
19
|
-
onError
|
|
20
|
-
} = props;
|
|
21
|
-
const buttonRef = React.useRef(null);
|
|
22
|
-
const recognition = useLazyRef(() => {
|
|
23
|
-
if (!BrowserSpeechRecognition) {
|
|
24
|
-
return {
|
|
25
|
-
start: () => {},
|
|
26
|
-
abort: () => {}
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
const timeout = new Timeout();
|
|
30
|
-
const instance = new BrowserSpeechRecognition();
|
|
31
|
-
instance.continuous = true;
|
|
32
|
-
instance.interimResults = true;
|
|
33
|
-
instance.lang = lang;
|
|
34
|
-
let finalResult = '';
|
|
35
|
-
let interimResult = '';
|
|
36
|
-
function start(options) {
|
|
37
|
-
if (recording) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
setRecording(true);
|
|
41
|
-
instance.onresult = event => {
|
|
42
|
-
finalResult = '';
|
|
43
|
-
interimResult = '';
|
|
44
|
-
if (typeof event.results === 'undefined') {
|
|
45
|
-
instance.stop();
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
for (let i = event.resultIndex; i < event.results.length; i += 1) {
|
|
49
|
-
if (event.results[i].isFinal) {
|
|
50
|
-
finalResult += event.results[i][0].transcript;
|
|
51
|
-
} else {
|
|
52
|
-
interimResult += event.results[i][0].transcript;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if (finalResult === '') {
|
|
56
|
-
options.onUpdate(interimResult);
|
|
57
|
-
}
|
|
58
|
-
timeout.start(1000, () => instance.stop());
|
|
59
|
-
};
|
|
60
|
-
instance.onsoundend = () => {
|
|
61
|
-
instance.stop();
|
|
62
|
-
};
|
|
63
|
-
instance.onend = () => {
|
|
64
|
-
options.onDone(finalResult);
|
|
65
|
-
setRecording(false);
|
|
66
|
-
};
|
|
67
|
-
instance.onerror = error => {
|
|
68
|
-
options.onError(error.message);
|
|
69
|
-
instance.stop();
|
|
70
|
-
setRecording(false);
|
|
71
|
-
};
|
|
72
|
-
instance.start();
|
|
73
|
-
}
|
|
74
|
-
function abort() {
|
|
75
|
-
instance.abort();
|
|
76
|
-
}
|
|
77
|
-
return {
|
|
78
|
-
start,
|
|
79
|
-
abort
|
|
80
|
-
};
|
|
81
|
-
}).current;
|
|
82
|
-
const handleClick = () => {
|
|
83
|
-
if (!recording) {
|
|
84
|
-
recognition.start({
|
|
85
|
-
onDone,
|
|
86
|
-
onUpdate,
|
|
87
|
-
onError
|
|
88
|
-
});
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
recognition.abort();
|
|
92
|
-
};
|
|
93
|
-
return /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, {
|
|
94
|
-
title: recording ? apiRef.current.getLocaleText('toolbarPromptControlRecordButtonActiveLabel') : apiRef.current.getLocaleText('toolbarPromptControlRecordButtonDefaultLabel'),
|
|
95
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
96
|
-
children: /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, {
|
|
97
|
-
color: recording ? 'primary' : 'default',
|
|
98
|
-
className: className,
|
|
99
|
-
disabled: disabled,
|
|
100
|
-
onClick: handleClick,
|
|
101
|
-
ref: buttonRef,
|
|
102
|
-
size: "small",
|
|
103
|
-
edge: "start",
|
|
104
|
-
children: /*#__PURE__*/_jsx(rootProps.slots.toolbarPromptRecordIcon, {
|
|
105
|
-
fontSize: "small"
|
|
106
|
-
})
|
|
107
|
-
})
|
|
108
|
-
})
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
export { RecordButton };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { GridToolbarPromptControl as Unstable_GridToolbarPromptControl } from "./GridToolbarPromptControl.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { GridToolbarPromptControl as Unstable_GridToolbarPromptControl } from "./GridToolbarPromptControl.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { GridPremiumColumnMenu as GridColumnMenu, GRID_COLUMN_MENU_SLOTS_PREMIUM as GRID_COLUMN_MENU_SLOTS, GRID_COLUMN_MENU_SLOT_PROPS_PREMIUM as GRID_COLUMN_MENU_SLOT_PROPS } from "./GridPremiumColumnMenu.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { GridPremiumColumnMenu as GridColumnMenu, GRID_COLUMN_MENU_SLOTS_PREMIUM as GRID_COLUMN_MENU_SLOTS, GRID_COLUMN_MENU_SLOT_PROPS_PREMIUM as GRID_COLUMN_MENU_SLOT_PROPS } from "./GridPremiumColumnMenu.js";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS } from '@mui/x-data-grid-pro/internals';
|
|
3
|
-
import { GridPremiumColumnMenu } from "../components/GridPremiumColumnMenu.js";
|
|
4
|
-
import materialSlots from "../material/index.js";
|
|
5
|
-
import { GridBottomContainer } from "../components/GridBottomContainer.js";
|
|
6
|
-
import { GridPremiumToolbar } from "../components/GridPremiumToolbar.js";
|
|
7
|
-
export const DATA_GRID_PREMIUM_DEFAULT_SLOTS_COMPONENTS = _extends({}, DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS, materialSlots, {
|
|
8
|
-
columnMenu: GridPremiumColumnMenu,
|
|
9
|
-
bottomContainer: GridBottomContainer,
|
|
10
|
-
toolbar: GridPremiumToolbar
|
|
11
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
-
import { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
|
|
3
|
-
import { DataGridPremiumProcessedProps } from "../../../models/dataGridPremiumProps.js";
|
|
4
|
-
import { GridAggregationFunction, GridAggregationFunctionDataSource, GridAggregationLookup } from "./gridAggregationInterfaces.js";
|
|
5
|
-
export declare const createAggregationLookup: ({
|
|
6
|
-
apiRef,
|
|
7
|
-
aggregationFunctions,
|
|
8
|
-
aggregationRowsScope,
|
|
9
|
-
getAggregationPosition,
|
|
10
|
-
isDataSource
|
|
11
|
-
}: {
|
|
12
|
-
apiRef: RefObject<GridPrivateApiPremium>;
|
|
13
|
-
aggregationFunctions: Record<string, GridAggregationFunction> | Record<string, GridAggregationFunctionDataSource>;
|
|
14
|
-
aggregationRowsScope: DataGridPremiumProcessedProps["aggregationRowsScope"];
|
|
15
|
-
getAggregationPosition: DataGridPremiumProcessedProps["getAggregationPosition"];
|
|
16
|
-
isDataSource: boolean;
|
|
17
|
-
}) => GridAggregationLookup;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { gridColumnLookupSelector, gridFilteredRowsLookupSelector, gridRowTreeSelector, GRID_ROOT_GROUP_ID, gridRowNodeSelector } from '@mui/x-data-grid-pro';
|
|
2
|
-
import { getAggregationRules } from "./gridAggregationUtils.js";
|
|
3
|
-
import { gridAggregationModelSelector } from "./gridAggregationSelectors.js";
|
|
4
|
-
const getGroupAggregatedValue = (groupId, apiRef, aggregationRowsScope, aggregatedFields, aggregationRules, position) => {
|
|
5
|
-
const groupAggregationLookup = {};
|
|
6
|
-
const aggregatedValues = [];
|
|
7
|
-
const rowIds = apiRef.current.getRowGroupChildren({
|
|
8
|
-
groupId
|
|
9
|
-
});
|
|
10
|
-
const filteredRowsLookup = gridFilteredRowsLookupSelector(apiRef);
|
|
11
|
-
rowIds.forEach(rowId => {
|
|
12
|
-
if (aggregationRowsScope === 'filtered' && filteredRowsLookup[rowId] === false) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// If the row is a group, we want to aggregate based on its children
|
|
17
|
-
// For instance in the following tree, we want the aggregated values of A to be based on A.A, A.B.A and A.B.B but not A.B
|
|
18
|
-
// A
|
|
19
|
-
// A.A
|
|
20
|
-
// A.B
|
|
21
|
-
// A.B.A
|
|
22
|
-
// A.B.B
|
|
23
|
-
const rowNode = gridRowNodeSelector(apiRef, rowId);
|
|
24
|
-
if (rowNode.type === 'group') {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
const row = apiRef.current.getRow(rowId);
|
|
28
|
-
for (let j = 0; j < aggregatedFields.length; j += 1) {
|
|
29
|
-
const aggregatedField = aggregatedFields[j];
|
|
30
|
-
const columnAggregationRules = aggregationRules[aggregatedField];
|
|
31
|
-
const aggregationFunction = columnAggregationRules.aggregationFunction;
|
|
32
|
-
const field = aggregatedField;
|
|
33
|
-
if (aggregatedValues[j] === undefined) {
|
|
34
|
-
aggregatedValues[j] = {
|
|
35
|
-
aggregatedField,
|
|
36
|
-
values: []
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
if (typeof aggregationFunction.getCellValue === 'function') {
|
|
40
|
-
aggregatedValues[j].values.push(aggregationFunction.getCellValue({
|
|
41
|
-
row
|
|
42
|
-
}));
|
|
43
|
-
} else {
|
|
44
|
-
const colDef = apiRef.current.getColumn(field);
|
|
45
|
-
aggregatedValues[j].values.push(apiRef.current.getRowValue(row, colDef));
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
for (let i = 0; i < aggregatedValues.length; i += 1) {
|
|
50
|
-
const {
|
|
51
|
-
aggregatedField,
|
|
52
|
-
values
|
|
53
|
-
} = aggregatedValues[i];
|
|
54
|
-
const aggregationFunction = aggregationRules[aggregatedField].aggregationFunction;
|
|
55
|
-
const value = aggregationFunction.apply({
|
|
56
|
-
values,
|
|
57
|
-
groupId,
|
|
58
|
-
field: aggregatedField // Added per user request in https://github.com/mui/mui-x/issues/6995#issuecomment-1327423455
|
|
59
|
-
});
|
|
60
|
-
groupAggregationLookup[aggregatedField] = {
|
|
61
|
-
position,
|
|
62
|
-
value
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
return groupAggregationLookup;
|
|
66
|
-
};
|
|
67
|
-
const getGroupAggregatedValueDataSource = (groupId, apiRef, aggregatedFields, position) => {
|
|
68
|
-
const groupAggregationLookup = {};
|
|
69
|
-
for (let j = 0; j < aggregatedFields.length; j += 1) {
|
|
70
|
-
const aggregatedField = aggregatedFields[j];
|
|
71
|
-
groupAggregationLookup[aggregatedField] = {
|
|
72
|
-
position,
|
|
73
|
-
value: apiRef.current.resolveGroupAggregation?.(groupId, aggregatedField) ?? ''
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
return groupAggregationLookup;
|
|
77
|
-
};
|
|
78
|
-
export const createAggregationLookup = ({
|
|
79
|
-
apiRef,
|
|
80
|
-
aggregationFunctions,
|
|
81
|
-
aggregationRowsScope,
|
|
82
|
-
getAggregationPosition,
|
|
83
|
-
isDataSource
|
|
84
|
-
}) => {
|
|
85
|
-
const aggregationRules = getAggregationRules(gridColumnLookupSelector(apiRef), gridAggregationModelSelector(apiRef), aggregationFunctions, isDataSource);
|
|
86
|
-
const aggregatedFields = Object.keys(aggregationRules);
|
|
87
|
-
if (aggregatedFields.length === 0) {
|
|
88
|
-
return {};
|
|
89
|
-
}
|
|
90
|
-
const aggregationLookup = {};
|
|
91
|
-
const rowTree = gridRowTreeSelector(apiRef);
|
|
92
|
-
const createGroupAggregationLookup = groupNode => {
|
|
93
|
-
for (let i = 0; i < groupNode.children.length; i += 1) {
|
|
94
|
-
const childId = groupNode.children[i];
|
|
95
|
-
const childNode = rowTree[childId];
|
|
96
|
-
if (childNode.type === 'group') {
|
|
97
|
-
createGroupAggregationLookup(childNode);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
const position = getAggregationPosition(groupNode);
|
|
101
|
-
if (position !== null) {
|
|
102
|
-
if (isDataSource) {
|
|
103
|
-
aggregationLookup[groupNode.id] = getGroupAggregatedValueDataSource(groupNode.id, apiRef, aggregatedFields, position);
|
|
104
|
-
} else if (groupNode.children.length) {
|
|
105
|
-
aggregationLookup[groupNode.id] = getGroupAggregatedValue(groupNode.id, apiRef, aggregationRowsScope, aggregatedFields, aggregationRules, position);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
createGroupAggregationLookup(rowTree[GRID_ROOT_GROUP_ID]);
|
|
110
|
-
return aggregationLookup;
|
|
111
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { GridAggregationFunction } from "./gridAggregationInterfaces.js";
|
|
2
|
-
export declare const GRID_AGGREGATION_FUNCTIONS: {
|
|
3
|
-
sum: GridAggregationFunction<unknown, number>;
|
|
4
|
-
avg: GridAggregationFunction<unknown, number>;
|
|
5
|
-
min: GridAggregationFunction<number | Date, number | Date>;
|
|
6
|
-
max: GridAggregationFunction<number | Date, number | Date>;
|
|
7
|
-
size: GridAggregationFunction<unknown, number>;
|
|
8
|
-
};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { isNumber } from '@mui/x-data-grid-pro/internals';
|
|
2
|
-
const sumAgg = {
|
|
3
|
-
apply: ({
|
|
4
|
-
values
|
|
5
|
-
}) => {
|
|
6
|
-
let sum = 0;
|
|
7
|
-
for (let i = 0; i < values.length; i += 1) {
|
|
8
|
-
const value = values[i];
|
|
9
|
-
if (isNumber(value)) {
|
|
10
|
-
sum += value;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return sum;
|
|
14
|
-
},
|
|
15
|
-
columnTypes: ['number']
|
|
16
|
-
};
|
|
17
|
-
const avgAgg = {
|
|
18
|
-
apply: ({
|
|
19
|
-
values
|
|
20
|
-
}) => {
|
|
21
|
-
if (values.length === 0) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
let sum = 0;
|
|
25
|
-
let valuesCount = 0;
|
|
26
|
-
for (let i = 0; i < values.length; i += 1) {
|
|
27
|
-
const value = values[i];
|
|
28
|
-
if (isNumber(value)) {
|
|
29
|
-
valuesCount += 1;
|
|
30
|
-
sum += value;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return sum / valuesCount;
|
|
34
|
-
},
|
|
35
|
-
columnTypes: ['number']
|
|
36
|
-
};
|
|
37
|
-
const minAgg = {
|
|
38
|
-
apply: ({
|
|
39
|
-
values
|
|
40
|
-
}) => {
|
|
41
|
-
if (values.length === 0) {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
let min = +Infinity;
|
|
45
|
-
for (let i = 0; i < values.length; i += 1) {
|
|
46
|
-
const value = values[i];
|
|
47
|
-
if (value != null && value < min) {
|
|
48
|
-
min = value;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return min;
|
|
52
|
-
},
|
|
53
|
-
columnTypes: ['number', 'date', 'dateTime']
|
|
54
|
-
};
|
|
55
|
-
const maxAgg = {
|
|
56
|
-
apply: ({
|
|
57
|
-
values
|
|
58
|
-
}) => {
|
|
59
|
-
if (values.length === 0) {
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
let max = -Infinity;
|
|
63
|
-
for (let i = 0; i < values.length; i += 1) {
|
|
64
|
-
const value = values[i];
|
|
65
|
-
if (value != null && value > max) {
|
|
66
|
-
max = value;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return max;
|
|
70
|
-
},
|
|
71
|
-
columnTypes: ['number', 'date', 'dateTime']
|
|
72
|
-
};
|
|
73
|
-
const sizeAgg = {
|
|
74
|
-
apply: ({
|
|
75
|
-
values
|
|
76
|
-
}) => {
|
|
77
|
-
return values.filter(value => typeof value !== 'undefined').length;
|
|
78
|
-
},
|
|
79
|
-
valueFormatter: value => {
|
|
80
|
-
if (value == null || !isNumber(value)) {
|
|
81
|
-
return value;
|
|
82
|
-
}
|
|
83
|
-
return value.toLocaleString();
|
|
84
|
-
},
|
|
85
|
-
hasCellUnit: false
|
|
86
|
-
};
|
|
87
|
-
export const GRID_AGGREGATION_FUNCTIONS = {
|
|
88
|
-
sum: sumAgg,
|
|
89
|
-
avg: avgAgg,
|
|
90
|
-
min: minAgg,
|
|
91
|
-
max: maxAgg,
|
|
92
|
-
size: sizeAgg
|
|
93
|
-
};
|