@mui/x-data-grid-premium 8.0.0-beta.2 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +423 -96
- package/DataGridPremium/DataGridPremium.js +188 -26
- package/DataGridPremium/useDataGridPremiumComponent.d.ts +2 -2
- package/DataGridPremium/useDataGridPremiumComponent.js +22 -3
- package/DataGridPremium/useDataGridPremiumProps.js +5 -1
- package/components/GridColumnMenuPivotItem.d.ts +3 -0
- package/components/GridColumnMenuPivotItem.js +33 -0
- package/components/GridEmptyPivotOverlay.d.ts +6 -0
- package/components/GridEmptyPivotOverlay.js +29 -0
- package/components/GridGroupingCriteriaCell.js +8 -3
- package/components/GridPremiumColumnMenu.d.ts +5 -0
- package/components/GridPremiumColumnMenu.js +6 -1
- package/components/GridPremiumToolbar.d.ts +1 -1
- package/components/GridPremiumToolbar.js +29 -1
- package/components/aiAssistantPanel/AiAssistantPanelTrigger.d.ts +33 -0
- package/components/aiAssistantPanel/AiAssistantPanelTrigger.js +107 -0
- package/components/aiAssistantPanel/GridAiAssistantPanel.d.ts +3 -0
- package/components/aiAssistantPanel/GridAiAssistantPanel.js +195 -0
- package/components/aiAssistantPanel/GridAiAssistantPanelConversation.d.ts +7 -0
- package/components/aiAssistantPanel/GridAiAssistantPanelConversation.js +71 -0
- package/components/aiAssistantPanel/GridAiAssistantPanelConversationsMenu.d.ts +3 -0
- package/components/aiAssistantPanel/GridAiAssistantPanelConversationsMenu.js +92 -0
- package/components/aiAssistantPanel/GridAiAssistantPanelSuggestions.d.ts +7 -0
- package/components/aiAssistantPanel/GridAiAssistantPanelSuggestions.js +86 -0
- package/components/aiAssistantPanel/index.d.ts +2 -0
- package/components/aiAssistantPanel/index.js +27 -0
- package/components/collapsible/Collapsible.d.ts +4 -0
- package/components/collapsible/Collapsible.js +70 -0
- package/components/collapsible/CollapsibleContext.d.ts +8 -0
- package/components/collapsible/CollapsibleContext.js +17 -0
- package/components/collapsible/CollapsiblePanel.d.ts +4 -0
- package/components/collapsible/CollapsiblePanel.js +64 -0
- package/components/collapsible/CollapsibleTrigger.d.ts +4 -0
- package/components/collapsible/CollapsibleTrigger.js +106 -0
- package/components/collapsible/index.d.ts +4 -0
- package/components/collapsible/index.js +49 -0
- package/components/export/ExportExcel.js +4 -129
- package/components/index.d.ts +5 -2
- package/components/index.js +40 -4
- package/components/pivotPanel/GridPivotPanel.d.ts +3 -0
- package/components/pivotPanel/GridPivotPanel.js +22 -0
- package/components/pivotPanel/GridPivotPanelBody.d.ts +11 -0
- package/components/pivotPanel/GridPivotPanelBody.js +368 -0
- package/components/pivotPanel/GridPivotPanelField.d.ts +22 -0
- package/components/pivotPanel/GridPivotPanelField.js +338 -0
- package/components/pivotPanel/GridPivotPanelFieldMenu.d.ts +8 -0
- package/components/pivotPanel/GridPivotPanelFieldMenu.js +177 -0
- package/components/pivotPanel/GridPivotPanelHeader.d.ts +7 -0
- package/components/pivotPanel/GridPivotPanelHeader.js +101 -0
- package/components/pivotPanel/GridPivotPanelSearch.d.ts +7 -0
- package/components/pivotPanel/GridPivotPanelSearch.js +77 -0
- package/components/pivotPanel/PivotPanelTrigger.d.ts +37 -0
- package/components/pivotPanel/PivotPanelTrigger.js +93 -0
- package/components/pivotPanel/index.d.ts +2 -0
- package/components/pivotPanel/index.js +27 -0
- package/components/prompt/GridPrompt.d.ts +7 -0
- package/components/prompt/GridPrompt.js +364 -0
- package/components/prompt/index.d.ts +1 -0
- package/components/prompt/index.js +12 -0
- package/components/promptField/GridPromptField.d.ts +4 -0
- package/components/promptField/GridPromptField.js +86 -0
- package/components/promptField/PromptField.d.ts +66 -0
- package/components/promptField/PromptField.js +95 -0
- package/components/promptField/PromptFieldContext.d.ts +16 -0
- package/components/promptField/PromptFieldContext.js +17 -0
- package/components/promptField/PromptFieldControl.d.ts +27 -0
- package/components/promptField/PromptFieldControl.js +102 -0
- package/components/promptField/PromptFieldRecord.d.ts +27 -0
- package/components/promptField/PromptFieldRecord.js +158 -0
- package/components/promptField/PromptFieldSend.d.ts +27 -0
- package/components/promptField/PromptFieldSend.js +83 -0
- package/components/promptField/index.d.ts +4 -0
- package/components/promptField/index.js +49 -0
- package/components/resizablePanel/ResizablePanel.d.ts +10 -0
- package/components/resizablePanel/ResizablePanel.js +59 -0
- package/components/resizablePanel/ResizablePanelContext.d.ts +7 -0
- package/components/resizablePanel/ResizablePanelContext.js +17 -0
- package/components/resizablePanel/ResizablePanelHandle.d.ts +4 -0
- package/components/resizablePanel/ResizablePanelHandle.js +115 -0
- package/components/resizablePanel/index.d.ts +3 -0
- package/components/resizablePanel/index.js +38 -0
- package/components/sidebar/Sidebar.d.ts +4 -0
- package/components/sidebar/Sidebar.js +54 -0
- package/components/sidebar/SidebarHeader.d.ts +4 -0
- package/components/sidebar/SidebarHeader.js +51 -0
- package/components/sidebar/index.d.ts +2 -0
- package/components/sidebar/index.js +27 -0
- package/constants/dataGridPremiumDefaultSlotsComponents.js +3 -0
- package/esm/DataGridPremium/DataGridPremium.js +190 -28
- package/esm/DataGridPremium/useDataGridPremiumComponent.d.ts +2 -2
- package/esm/DataGridPremium/useDataGridPremiumComponent.js +20 -3
- package/esm/DataGridPremium/useDataGridPremiumProps.js +5 -1
- package/esm/components/GridColumnMenuPivotItem.d.ts +3 -0
- package/esm/components/GridColumnMenuPivotItem.js +26 -0
- package/esm/components/GridEmptyPivotOverlay.d.ts +6 -0
- package/esm/components/GridEmptyPivotOverlay.js +22 -0
- package/esm/components/GridGroupingCriteriaCell.js +9 -4
- package/esm/components/GridPremiumColumnMenu.d.ts +5 -0
- package/esm/components/GridPremiumColumnMenu.js +6 -1
- package/esm/components/GridPremiumToolbar.d.ts +1 -1
- package/esm/components/GridPremiumToolbar.js +30 -2
- package/esm/components/aiAssistantPanel/AiAssistantPanelTrigger.d.ts +33 -0
- package/esm/components/aiAssistantPanel/AiAssistantPanelTrigger.js +100 -0
- package/esm/components/aiAssistantPanel/GridAiAssistantPanel.d.ts +3 -0
- package/esm/components/aiAssistantPanel/GridAiAssistantPanel.js +188 -0
- package/esm/components/aiAssistantPanel/GridAiAssistantPanelConversation.d.ts +7 -0
- package/esm/components/aiAssistantPanel/GridAiAssistantPanelConversation.js +64 -0
- package/esm/components/aiAssistantPanel/GridAiAssistantPanelConversationsMenu.d.ts +3 -0
- package/esm/components/aiAssistantPanel/GridAiAssistantPanelConversationsMenu.js +85 -0
- package/esm/components/aiAssistantPanel/GridAiAssistantPanelSuggestions.d.ts +7 -0
- package/esm/components/aiAssistantPanel/GridAiAssistantPanelSuggestions.js +80 -0
- package/esm/components/aiAssistantPanel/index.d.ts +2 -0
- package/esm/components/aiAssistantPanel/index.js +2 -0
- package/esm/components/collapsible/Collapsible.d.ts +4 -0
- package/esm/components/collapsible/Collapsible.js +63 -0
- package/esm/components/collapsible/CollapsibleContext.d.ts +8 -0
- package/esm/components/collapsible/CollapsibleContext.js +9 -0
- package/esm/components/collapsible/CollapsiblePanel.d.ts +4 -0
- package/esm/components/collapsible/CollapsiblePanel.js +57 -0
- package/esm/components/collapsible/CollapsibleTrigger.d.ts +4 -0
- package/esm/components/collapsible/CollapsibleTrigger.js +99 -0
- package/esm/components/collapsible/index.d.ts +4 -0
- package/esm/components/collapsible/index.js +4 -0
- package/esm/components/export/ExportExcel.js +4 -129
- package/esm/components/index.d.ts +5 -2
- package/esm/components/index.js +5 -2
- package/esm/components/pivotPanel/GridPivotPanel.d.ts +3 -0
- package/esm/components/pivotPanel/GridPivotPanel.js +16 -0
- package/esm/components/pivotPanel/GridPivotPanelBody.d.ts +11 -0
- package/esm/components/pivotPanel/GridPivotPanelBody.js +361 -0
- package/esm/components/pivotPanel/GridPivotPanelField.d.ts +22 -0
- package/esm/components/pivotPanel/GridPivotPanelField.js +331 -0
- package/esm/components/pivotPanel/GridPivotPanelFieldMenu.d.ts +8 -0
- package/esm/components/pivotPanel/GridPivotPanelFieldMenu.js +170 -0
- package/esm/components/pivotPanel/GridPivotPanelHeader.d.ts +7 -0
- package/esm/components/pivotPanel/GridPivotPanelHeader.js +94 -0
- package/esm/components/pivotPanel/GridPivotPanelSearch.d.ts +7 -0
- package/esm/components/pivotPanel/GridPivotPanelSearch.js +70 -0
- package/esm/components/pivotPanel/PivotPanelTrigger.d.ts +37 -0
- package/esm/components/pivotPanel/PivotPanelTrigger.js +86 -0
- package/esm/components/pivotPanel/index.d.ts +2 -0
- package/esm/components/pivotPanel/index.js +2 -0
- package/esm/components/prompt/GridPrompt.d.ts +7 -0
- package/esm/components/prompt/GridPrompt.js +357 -0
- package/esm/components/prompt/index.d.ts +1 -0
- package/esm/components/prompt/index.js +1 -0
- package/esm/components/promptField/GridPromptField.d.ts +4 -0
- package/esm/components/promptField/GridPromptField.js +79 -0
- package/esm/components/promptField/PromptField.d.ts +66 -0
- package/esm/components/promptField/PromptField.js +88 -0
- package/esm/components/promptField/PromptFieldContext.d.ts +16 -0
- package/esm/components/promptField/PromptFieldContext.js +9 -0
- package/esm/components/promptField/PromptFieldControl.d.ts +27 -0
- package/esm/components/promptField/PromptFieldControl.js +95 -0
- package/esm/components/promptField/PromptFieldRecord.d.ts +27 -0
- package/esm/components/promptField/PromptFieldRecord.js +151 -0
- package/esm/components/promptField/PromptFieldSend.d.ts +27 -0
- package/esm/components/promptField/PromptFieldSend.js +76 -0
- package/esm/components/promptField/index.d.ts +4 -0
- package/esm/components/promptField/index.js +4 -0
- package/esm/components/resizablePanel/ResizablePanel.d.ts +10 -0
- package/esm/components/resizablePanel/ResizablePanel.js +52 -0
- package/esm/components/resizablePanel/ResizablePanelContext.d.ts +7 -0
- package/esm/components/resizablePanel/ResizablePanelContext.js +9 -0
- package/esm/components/resizablePanel/ResizablePanelHandle.d.ts +4 -0
- package/esm/components/resizablePanel/ResizablePanelHandle.js +108 -0
- package/esm/components/resizablePanel/index.d.ts +3 -0
- package/esm/components/resizablePanel/index.js +3 -0
- package/esm/components/sidebar/Sidebar.d.ts +4 -0
- package/esm/components/sidebar/Sidebar.js +47 -0
- package/esm/components/sidebar/SidebarHeader.d.ts +4 -0
- package/esm/components/sidebar/SidebarHeader.js +44 -0
- package/esm/components/sidebar/index.d.ts +2 -0
- package/esm/components/sidebar/index.js +2 -0
- package/esm/constants/dataGridPremiumDefaultSlotsComponents.js +3 -0
- package/esm/hooks/features/aggregation/gridAggregationFunctions.js +13 -0
- package/esm/hooks/features/aggregation/gridAggregationSelectors.d.ts +10 -1
- package/esm/hooks/features/aggregation/gridAggregationSelectors.js +28 -1
- package/esm/hooks/features/aggregation/gridAggregationUtils.d.ts +1 -1
- package/esm/hooks/features/aggregation/index.d.ts +1 -1
- package/esm/hooks/features/aggregation/index.js +1 -1
- package/esm/hooks/features/aggregation/useGridAggregation.js +7 -11
- package/esm/hooks/features/aggregation/useGridAggregationPreProcessors.js +2 -8
- package/esm/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +5 -25
- package/esm/hooks/features/aggregation/wrapColumnWithAggregation.js +23 -10
- package/esm/hooks/features/aiAssistant/api.d.ts +12 -0
- package/esm/hooks/features/aiAssistant/api.js +31 -0
- package/esm/hooks/features/aiAssistant/gridAiAssistantInterfaces.d.ts +82 -0
- package/esm/hooks/features/aiAssistant/gridAiAssistantSelectors.d.ts +5 -0
- package/esm/hooks/features/aiAssistant/gridAiAssistantSelectors.js +5 -0
- package/esm/hooks/features/aiAssistant/index.d.ts +2 -0
- package/esm/hooks/features/aiAssistant/useGridAiAssistant.d.ts +6 -0
- package/esm/hooks/features/aiAssistant/useGridAiAssistant.js +293 -0
- package/esm/hooks/features/cellSelection/useGridCellSelection.js +6 -6
- package/esm/hooks/features/clipboard/useGridClipboardImport.js +4 -4
- package/esm/hooks/features/dataSource/useGridDataSourcePremium.js +4 -1
- package/esm/hooks/features/export/useGridExcelExport.js +2 -2
- package/esm/hooks/features/index.d.ts +1 -1
- package/esm/hooks/features/index.js +1 -1
- package/esm/hooks/features/pivoting/gridPivotingInterfaces.d.ts +69 -0
- package/esm/hooks/features/pivoting/gridPivotingSelectors.d.ts +4 -0
- package/esm/hooks/features/pivoting/gridPivotingSelectors.js +5 -0
- package/esm/hooks/features/pivoting/useGridPivoting.d.ts +7 -0
- package/esm/hooks/features/pivoting/useGridPivoting.js +339 -0
- package/esm/hooks/features/pivoting/utils.d.ts +21 -0
- package/esm/hooks/features/pivoting/utils.js +259 -0
- package/esm/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +1 -4
- package/esm/hooks/features/rowGrouping/useGridRowGrouping.js +4 -5
- package/esm/hooks/utils/useResize.d.ts +9 -0
- package/esm/hooks/utils/useResize.js +52 -0
- package/esm/index.d.ts +4 -1
- package/esm/index.js +4 -2
- package/esm/material/icons.d.ts +15 -15
- package/esm/material/icons.js +32 -5
- package/esm/material/index.d.ts +31 -5
- package/esm/material/index.js +31 -3
- package/esm/models/dataGridPremiumProps.d.ts +96 -2
- package/esm/models/gridApiPremium.d.ts +4 -2
- package/esm/models/gridPremiumIconSlotsComponent.d.ts +141 -8
- package/esm/models/gridPremiumSlotsComponent.d.ts +13 -1
- package/esm/models/gridStatePremium.d.ts +6 -0
- package/esm/package.json +1 -1
- package/esm/setupExcelExportWebWorker/index.d.ts +1 -0
- package/esm/setupExcelExportWebWorker/index.js +1 -0
- package/esm/typeOverloads/modules.d.ts +32 -1
- package/esm/utils/speechRecognition.d.ts +2 -0
- package/esm/utils/speechRecognition.js +2 -0
- package/hooks/features/aggregation/gridAggregationFunctions.js +13 -0
- package/hooks/features/aggregation/gridAggregationSelectors.d.ts +10 -1
- package/hooks/features/aggregation/gridAggregationSelectors.js +29 -2
- package/hooks/features/aggregation/gridAggregationUtils.d.ts +1 -1
- package/hooks/features/aggregation/index.d.ts +1 -1
- package/hooks/features/aggregation/index.js +21 -11
- package/hooks/features/aggregation/useGridAggregation.js +6 -10
- package/hooks/features/aggregation/useGridAggregationPreProcessors.js +2 -8
- package/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +5 -25
- package/hooks/features/aggregation/wrapColumnWithAggregation.js +24 -11
- package/hooks/features/aiAssistant/api.d.ts +12 -0
- package/hooks/features/aiAssistant/api.js +37 -0
- package/hooks/features/aiAssistant/gridAiAssistantInterfaces.d.ts +82 -0
- package/hooks/features/aiAssistant/gridAiAssistantSelectors.d.ts +5 -0
- package/hooks/features/aiAssistant/gridAiAssistantSelectors.js +11 -0
- package/hooks/features/aiAssistant/index.d.ts +2 -0
- package/hooks/features/aiAssistant/useGridAiAssistant.d.ts +6 -0
- package/hooks/features/aiAssistant/useGridAiAssistant.js +303 -0
- package/hooks/features/cellSelection/useGridCellSelection.js +5 -5
- package/hooks/features/clipboard/useGridClipboardImport.js +3 -3
- package/hooks/features/dataSource/useGridDataSourcePremium.js +4 -1
- package/hooks/features/export/useGridExcelExport.js +1 -1
- package/hooks/features/index.d.ts +1 -1
- package/hooks/features/index.js +4 -4
- package/hooks/features/pivoting/gridPivotingInterfaces.d.ts +69 -0
- package/hooks/features/pivoting/gridPivotingInterfaces.js +5 -0
- package/hooks/features/pivoting/gridPivotingSelectors.d.ts +4 -0
- package/hooks/features/pivoting/gridPivotingSelectors.js +30 -0
- package/hooks/features/pivoting/useGridPivoting.d.ts +7 -0
- package/hooks/features/pivoting/useGridPivoting.js +349 -0
- package/hooks/features/pivoting/utils.d.ts +21 -0
- package/hooks/features/pivoting/utils.js +270 -0
- package/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +1 -4
- package/hooks/features/rowGrouping/useGridRowGrouping.js +3 -4
- package/hooks/utils/useResize.d.ts +9 -0
- package/hooks/utils/useResize.js +60 -0
- package/index.d.ts +4 -1
- package/index.js +19 -3
- package/material/icons.d.ts +15 -15
- package/material/icons.js +36 -9
- package/material/index.d.ts +31 -5
- package/material/index.js +30 -2
- package/models/dataGridPremiumProps.d.ts +96 -2
- package/models/gridApiPremium.d.ts +4 -2
- package/models/gridPremiumIconSlotsComponent.d.ts +141 -8
- package/models/gridPremiumSlotsComponent.d.ts +13 -1
- package/models/gridStatePremium.d.ts +6 -0
- package/package.json +12 -18
- package/setupExcelExportWebWorker/index.d.ts +1 -0
- package/{setupExcelExportWebWorker.js → setupExcelExportWebWorker/index.js} +1 -1
- package/typeOverloads/modules.d.ts +32 -1
- package/utils/speechRecognition.d.ts +2 -0
- package/utils/speechRecognition.js +8 -0
- package/components/promptControl/GridToolbarPromptControl.d.ts +0 -26
- package/components/promptControl/GridToolbarPromptControl.js +0 -222
- package/components/promptControl/RecordButton.d.ts +0 -16
- package/components/promptControl/RecordButton.js +0 -119
- package/components/promptControl/index.d.ts +0 -1
- package/components/promptControl/index.js +0 -12
- package/esm/components/promptControl/GridToolbarPromptControl.d.ts +0 -26
- package/esm/components/promptControl/GridToolbarPromptControl.js +0 -215
- package/esm/components/promptControl/RecordButton.d.ts +0 -16
- package/esm/components/promptControl/RecordButton.js +0 -111
- package/esm/components/promptControl/index.d.ts +0 -1
- package/esm/components/promptControl/index.js +0 -1
- package/esm/hooks/features/promptControl/api.d.ts +0 -2
- package/esm/hooks/features/promptControl/api.js +0 -22
- package/esm/hooks/features/promptControl/index.d.ts +0 -2
- package/esm/hooks/features/promptControl/types.d.ts +0 -25
- package/esm/setupExcelExportWebWorker.d.ts +0 -1
- package/esm/setupExcelExportWebWorker.js +0 -1
- package/esm/utils/releaseInfo.d.ts +0 -1
- package/esm/utils/releaseInfo.js +0 -13
- package/hooks/features/promptControl/api.d.ts +0 -2
- package/hooks/features/promptControl/api.js +0 -28
- package/hooks/features/promptControl/index.d.ts +0 -2
- package/hooks/features/promptControl/types.d.ts +0 -25
- package/modern/DataGridPremium/DataGrid.d.ts +0 -8
- package/modern/DataGridPremium/DataGrid.js +0 -19
- package/modern/DataGridPremium/DataGridPremium.d.ts +0 -16
- package/modern/DataGridPremium/DataGridPremium.js +0 -1121
- package/modern/DataGridPremium/index.d.ts +0 -3
- package/modern/DataGridPremium/index.js +0 -3
- package/modern/DataGridPremium/useDataGridPremiumComponent.d.ts +0 -4
- package/modern/DataGridPremium/useDataGridPremiumComponent.js +0 -108
- package/modern/DataGridPremium/useDataGridPremiumProps.d.ts +0 -6
- package/modern/DataGridPremium/useDataGridPremiumProps.js +0 -54
- package/modern/components/GridAggregationHeader.d.ts +0 -7
- package/modern/components/GridAggregationHeader.js +0 -89
- package/modern/components/GridAggregationRowOverlay.d.ts +0 -3
- package/modern/components/GridAggregationRowOverlay.js +0 -37
- package/modern/components/GridBottomContainer.d.ts +0 -3
- package/modern/components/GridBottomContainer.js +0 -43
- package/modern/components/GridColumnMenuAggregationItem.d.ts +0 -7
- package/modern/components/GridColumnMenuAggregationItem.js +0 -124
- package/modern/components/GridColumnMenuRowGroupItem.d.ts +0 -3
- package/modern/components/GridColumnMenuRowGroupItem.js +0 -42
- package/modern/components/GridColumnMenuRowUngroupItem.d.ts +0 -3
- package/modern/components/GridColumnMenuRowUngroupItem.js +0 -44
- package/modern/components/GridDataSourceGroupingCriteriaCell.d.ts +0 -7
- package/modern/components/GridDataSourceGroupingCriteriaCell.js +0 -121
- package/modern/components/GridExcelExportMenuItem.d.ts +0 -9
- package/modern/components/GridExcelExportMenuItem.js +0 -48
- package/modern/components/GridFooterCell.d.ts +0 -9
- package/modern/components/GridFooterCell.js +0 -43
- package/modern/components/GridGroupingColumnFooterCell.d.ts +0 -4
- package/modern/components/GridGroupingColumnFooterCell.js +0 -23
- package/modern/components/GridGroupingColumnLeafCell.d.ts +0 -4
- package/modern/components/GridGroupingColumnLeafCell.js +0 -17
- package/modern/components/GridGroupingCriteriaCell.d.ts +0 -7
- package/modern/components/GridGroupingCriteriaCell.js +0 -87
- package/modern/components/GridPremiumColumnMenu.d.ts +0 -33
- package/modern/components/GridPremiumColumnMenu.js +0 -37
- package/modern/components/GridPremiumToolbar.d.ts +0 -3
- package/modern/components/GridPremiumToolbar.js +0 -23
- package/modern/components/export/ExportExcel.d.ts +0 -29
- package/modern/components/export/ExportExcel.js +0 -209
- package/modern/components/export/index.d.ts +0 -1
- package/modern/components/export/index.js +0 -1
- package/modern/components/index.d.ts +0 -6
- package/modern/components/index.js +0 -6
- package/modern/components/promptControl/GridToolbarPromptControl.d.ts +0 -26
- package/modern/components/promptControl/GridToolbarPromptControl.js +0 -215
- package/modern/components/promptControl/RecordButton.d.ts +0 -16
- package/modern/components/promptControl/RecordButton.js +0 -111
- package/modern/components/promptControl/index.d.ts +0 -1
- package/modern/components/promptControl/index.js +0 -1
- package/modern/components/reexports.d.ts +0 -1
- package/modern/components/reexports.js +0 -1
- package/modern/constants/dataGridPremiumDefaultSlotsComponents.d.ts +0 -2
- package/modern/constants/dataGridPremiumDefaultSlotsComponents.js +0 -11
- package/modern/hooks/features/aggregation/createAggregationLookup.d.ts +0 -17
- package/modern/hooks/features/aggregation/createAggregationLookup.js +0 -111
- package/modern/hooks/features/aggregation/gridAggregationFunctions.d.ts +0 -8
- package/modern/hooks/features/aggregation/gridAggregationFunctions.js +0 -93
- package/modern/hooks/features/aggregation/gridAggregationInterfaces.d.ts +0 -129
- package/modern/hooks/features/aggregation/gridAggregationSelectors.d.ts +0 -13
- package/modern/hooks/features/aggregation/gridAggregationSelectors.js +0 -15
- package/modern/hooks/features/aggregation/gridAggregationUtils.d.ts +0 -62
- package/modern/hooks/features/aggregation/gridAggregationUtils.js +0 -180
- package/modern/hooks/features/aggregation/index.d.ts +0 -4
- package/modern/hooks/features/aggregation/index.js +0 -3
- package/modern/hooks/features/aggregation/useGridAggregation.d.ts +0 -6
- package/modern/hooks/features/aggregation/useGridAggregation.js +0 -103
- package/modern/hooks/features/aggregation/useGridAggregationPreProcessors.d.ts +0 -4
- package/modern/hooks/features/aggregation/useGridAggregationPreProcessors.js +0 -96
- package/modern/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +0 -81
- package/modern/hooks/features/aggregation/wrapColumnWithAggregation.js +0 -215
- package/modern/hooks/features/cellSelection/gridCellSelectionInterfaces.d.ts +0 -40
- package/modern/hooks/features/cellSelection/gridCellSelectionInterfaces.js +0 -1
- package/modern/hooks/features/cellSelection/gridCellSelectionSelector.d.ts +0 -2
- package/modern/hooks/features/cellSelection/gridCellSelectionSelector.js +0 -2
- package/modern/hooks/features/cellSelection/index.d.ts +0 -1
- package/modern/hooks/features/cellSelection/index.js +0 -1
- package/modern/hooks/features/cellSelection/useGridCellSelection.d.ts +0 -6
- package/modern/hooks/features/cellSelection/useGridCellSelection.js +0 -486
- package/modern/hooks/features/clipboard/useGridClipboardImport.d.ts +0 -4
- package/modern/hooks/features/clipboard/useGridClipboardImport.js +0 -335
- package/modern/hooks/features/dataSource/models.d.ts +0 -54
- package/modern/hooks/features/dataSource/models.js +0 -1
- package/modern/hooks/features/dataSource/useGridDataSourcePremium.d.ts +0 -4
- package/modern/hooks/features/dataSource/useGridDataSourcePremium.js +0 -59
- package/modern/hooks/features/export/gridExcelExportInterface.d.ts +0 -71
- package/modern/hooks/features/export/gridExcelExportInterface.js +0 -1
- package/modern/hooks/features/export/index.d.ts +0 -2
- package/modern/hooks/features/export/index.js +0 -2
- package/modern/hooks/features/export/serializer/excelSerializer.d.ts +0 -40
- package/modern/hooks/features/export/serializer/excelSerializer.js +0 -269
- package/modern/hooks/features/export/serializer/setupExcelExportWebWorker.d.ts +0 -2
- package/modern/hooks/features/export/serializer/setupExcelExportWebWorker.js +0 -53
- package/modern/hooks/features/export/serializer/utils.d.ts +0 -36
- package/modern/hooks/features/export/serializer/utils.js +0 -93
- package/modern/hooks/features/export/useGridExcelExport.d.ts +0 -11
- package/modern/hooks/features/export/useGridExcelExport.js +0 -139
- package/modern/hooks/features/index.d.ts +0 -5
- package/modern/hooks/features/index.js +0 -6
- package/modern/hooks/features/promptControl/api.d.ts +0 -2
- package/modern/hooks/features/promptControl/api.js +0 -22
- package/modern/hooks/features/promptControl/index.d.ts +0 -2
- package/modern/hooks/features/promptControl/index.js +0 -1
- package/modern/hooks/features/promptControl/types.d.ts +0 -25
- package/modern/hooks/features/promptControl/types.js +0 -1
- package/modern/hooks/features/rowGrouping/createGroupingColDef.d.ts +0 -57
- package/modern/hooks/features/rowGrouping/createGroupingColDef.js +0 -272
- package/modern/hooks/features/rowGrouping/gridRowGroupingInterfaces.d.ts +0 -44
- package/modern/hooks/features/rowGrouping/gridRowGroupingInterfaces.js +0 -1
- package/modern/hooks/features/rowGrouping/gridRowGroupingSelector.d.ts +0 -3
- package/modern/hooks/features/rowGrouping/gridRowGroupingSelector.js +0 -5
- package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +0 -54
- package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +0 -173
- package/modern/hooks/features/rowGrouping/index.d.ts +0 -3
- package/modern/hooks/features/rowGrouping/index.js +0 -3
- package/modern/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.d.ts +0 -4
- package/modern/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +0 -73
- package/modern/hooks/features/rowGrouping/useGridRowGrouping.d.ts +0 -11
- package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +0 -182
- package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.d.ts +0 -4
- package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +0 -157
- package/modern/hooks/features/rows/index.d.ts +0 -1
- package/modern/hooks/features/rows/index.js +0 -1
- package/modern/hooks/features/rows/useGridRowAriaAttributes.d.ts +0 -1
- package/modern/hooks/features/rows/useGridRowAriaAttributes.js +0 -8
- package/modern/hooks/index.d.ts +0 -2
- package/modern/hooks/index.js +0 -3
- package/modern/hooks/utils/index.d.ts +0 -1
- package/modern/hooks/utils/index.js +0 -1
- package/modern/hooks/utils/useGridApiContext.d.ts +0 -4
- package/modern/hooks/utils/useGridApiContext.js +0 -2
- package/modern/hooks/utils/useGridApiRef.d.ts +0 -4
- package/modern/hooks/utils/useGridApiRef.js +0 -2
- package/modern/hooks/utils/useGridAriaAttributes.d.ts +0 -2
- package/modern/hooks/utils/useGridAriaAttributes.js +0 -13
- package/modern/hooks/utils/useGridPrivateApiContext.d.ts +0 -2
- package/modern/hooks/utils/useGridPrivateApiContext.js +0 -2
- package/modern/hooks/utils/useGridRootProps.d.ts +0 -2
- package/modern/hooks/utils/useGridRootProps.js +0 -2
- package/modern/hooks/utils/useKeepGroupedColumnsHidden.d.ts +0 -12
- package/modern/hooks/utils/useKeepGroupedColumnsHidden.js +0 -43
- package/modern/index.d.ts +0 -23
- package/modern/index.js +0 -26
- package/modern/locales.d.ts +0 -1
- package/modern/locales.js +0 -1
- package/modern/material/icons.d.ts +0 -15
- package/modern/material/icons.js +0 -20
- package/modern/material/index.d.ts +0 -8
- package/modern/material/index.js +0 -11
- package/modern/models/dataGridPremiumProps.d.ts +0 -162
- package/modern/models/dataGridPremiumProps.js +0 -1
- package/modern/models/gridApiPremium.d.ts +0 -14
- package/modern/models/gridApiPremium.js +0 -1
- package/modern/models/gridGroupingValueGetter.d.ts +0 -4
- package/modern/models/gridGroupingValueGetter.js +0 -1
- package/modern/models/gridPastedValueParser.d.ts +0 -4
- package/modern/models/gridPastedValueParser.js +0 -1
- package/modern/models/gridPremiumIconSlotsComponent.d.ts +0 -28
- package/modern/models/gridPremiumIconSlotsComponent.js +0 -1
- package/modern/models/gridPremiumSlotsComponent.d.ts +0 -7
- package/modern/models/gridPremiumSlotsComponent.js +0 -1
- package/modern/models/gridStatePremium.d.ts +0 -18
- package/modern/models/gridStatePremium.js +0 -1
- package/modern/models/index.d.ts +0 -4
- package/modern/models/index.js +0 -4
- package/modern/package.json +0 -1
- package/modern/setupExcelExportWebWorker.d.ts +0 -1
- package/modern/setupExcelExportWebWorker.js +0 -1
- package/modern/themeAugmentation/index.d.ts +0 -2
- package/modern/themeAugmentation/index.js +0 -4
- package/modern/themeAugmentation/overrides.d.ts +0 -7
- package/modern/themeAugmentation/overrides.js +0 -1
- package/modern/themeAugmentation/props.d.ts +0 -15
- package/modern/themeAugmentation/props.js +0 -1
- package/modern/typeOverloads/index.d.ts +0 -2
- package/modern/typeOverloads/index.js +0 -2
- package/modern/typeOverloads/modules.d.ts +0 -97
- package/modern/typeOverloads/modules.js +0 -1
- package/modern/typeOverloads/reexports.d.ts +0 -17
- package/modern/typeOverloads/reexports.js +0 -15
- package/modern/utils/releaseInfo.d.ts +0 -1
- package/modern/utils/releaseInfo.js +0 -13
- package/setupExcelExportWebWorker.d.ts +0 -1
- package/tsconfig.build.tsbuildinfo +0 -1
- package/utils/releaseInfo.d.ts +0 -1
- package/utils/releaseInfo.js +0 -20
- /package/esm/hooks/features/{promptControl/types.js → aiAssistant/gridAiAssistantInterfaces.js} +0 -0
- /package/esm/hooks/features/{promptControl → aiAssistant}/index.js +0 -0
- /package/{modern/hooks/features/aggregation/gridAggregationInterfaces.js → esm/hooks/features/pivoting/gridPivotingInterfaces.js} +0 -0
- /package/hooks/features/{promptControl/types.js → aiAssistant/gridAiAssistantInterfaces.js} +0 -0
- /package/hooks/features/{promptControl → aiAssistant}/index.js +0 -0
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { GRID_DATE_COL_DEF, GRID_DATETIME_COL_DEF } from '@mui/x-data-grid-pro';
|
|
3
|
-
import { isObject, isSingleSelectColDef, gridHasColSpanSelector } from '@mui/x-data-grid/internals';
|
|
4
|
-
import { warnOnce } from '@mui/x-internals/warning';
|
|
5
|
-
import { addColumnGroupingHeaders, addSerializedRowToWorksheet, createValueOptionsSheetIfNeeded, getExcelJs } from "./utils.js";
|
|
6
|
-
const getFormattedValueOptions = (colDef, row, valueOptions, api, callback) => {
|
|
7
|
-
if (!colDef.valueOptions) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
const valueFormatter = colDef.valueFormatter;
|
|
11
|
-
for (let i = 0; i < valueOptions.length; i += 1) {
|
|
12
|
-
const option = valueOptions[i];
|
|
13
|
-
let value;
|
|
14
|
-
if (valueFormatter) {
|
|
15
|
-
if (typeof option === 'object') {
|
|
16
|
-
value = option.label;
|
|
17
|
-
} else {
|
|
18
|
-
value = String(colDef.valueFormatter(option, row, colDef, {
|
|
19
|
-
current: api
|
|
20
|
-
}));
|
|
21
|
-
}
|
|
22
|
-
} else {
|
|
23
|
-
value = typeof option === 'object' ? option.label : option;
|
|
24
|
-
}
|
|
25
|
-
callback(value, i);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const commaRegex = /,/g;
|
|
29
|
-
const commaReplacement = 'CHAR(44)';
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* FIXME: This function mutates the colspan info, but colspan info assumes that the columns
|
|
33
|
-
* passed to it are always consistent. In this case, the exported columns may differ from the
|
|
34
|
-
* actual rendered columns.
|
|
35
|
-
* The caller of this function MUST call `resetColSpan()` before and after usage.
|
|
36
|
-
*/
|
|
37
|
-
export const serializeRowUnsafe = (id, columns, apiRef, defaultValueOptionsFormulae, options) => {
|
|
38
|
-
const serializedRow = {};
|
|
39
|
-
const dataValidation = {};
|
|
40
|
-
const mergedCells = [];
|
|
41
|
-
const row = apiRef.current.getRow(id);
|
|
42
|
-
const rowNode = apiRef.current.getRowNode(id);
|
|
43
|
-
if (!row || !rowNode) {
|
|
44
|
-
throw new Error(`No row with id #${id} found`);
|
|
45
|
-
}
|
|
46
|
-
const outlineLevel = rowNode.depth;
|
|
47
|
-
const hasColSpan = gridHasColSpanSelector(apiRef);
|
|
48
|
-
if (hasColSpan) {
|
|
49
|
-
// `colSpan` is only calculated for rendered rows, so we need to calculate it during export for every row
|
|
50
|
-
apiRef.current.calculateColSpan({
|
|
51
|
-
rowId: id,
|
|
52
|
-
minFirstColumn: 0,
|
|
53
|
-
maxLastColumn: columns.length,
|
|
54
|
-
columns
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
columns.forEach((column, colIndex) => {
|
|
58
|
-
const colSpanInfo = hasColSpan ? apiRef.current.unstable_getCellColSpanInfo(id, colIndex) : undefined;
|
|
59
|
-
if (colSpanInfo && colSpanInfo.spannedByColSpan) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
if (colSpanInfo && colSpanInfo.cellProps.colSpan > 1) {
|
|
63
|
-
mergedCells.push({
|
|
64
|
-
leftIndex: colIndex + 1,
|
|
65
|
-
rightIndex: colIndex + colSpanInfo.cellProps.colSpan
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
let cellValue;
|
|
69
|
-
switch (column.type) {
|
|
70
|
-
case 'singleSelect':
|
|
71
|
-
{
|
|
72
|
-
const castColumn = column;
|
|
73
|
-
if (typeof castColumn.valueOptions === 'function') {
|
|
74
|
-
// If value option depends on the row, set specific options to the cell
|
|
75
|
-
// This dataValidation is buggy with LibreOffice and does not allow to have coma
|
|
76
|
-
const valueOptions = castColumn.valueOptions({
|
|
77
|
-
id,
|
|
78
|
-
row,
|
|
79
|
-
field: column.field
|
|
80
|
-
});
|
|
81
|
-
let formulae = '"';
|
|
82
|
-
getFormattedValueOptions(castColumn, row, valueOptions, apiRef.current, (value, index) => {
|
|
83
|
-
const formatted = value.toString().replace(commaRegex, commaReplacement);
|
|
84
|
-
formulae += formatted;
|
|
85
|
-
if (index < valueOptions.length - 1) {
|
|
86
|
-
formulae += ',';
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
formulae += '"';
|
|
90
|
-
dataValidation[castColumn.field] = {
|
|
91
|
-
type: 'list',
|
|
92
|
-
allowBlank: true,
|
|
93
|
-
formulae: [formulae]
|
|
94
|
-
};
|
|
95
|
-
} else {
|
|
96
|
-
const address = defaultValueOptionsFormulae[column.field].address;
|
|
97
|
-
|
|
98
|
-
// If value option is defined for the column, refer to another sheet
|
|
99
|
-
dataValidation[castColumn.field] = {
|
|
100
|
-
type: 'list',
|
|
101
|
-
allowBlank: true,
|
|
102
|
-
formulae: [address]
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
const formattedValue = apiRef.current.getRowFormattedValue(row, castColumn);
|
|
106
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
107
|
-
if (String(formattedValue) === '[object Object]') {
|
|
108
|
-
warnOnce(['MUI X: When the value of a field is an object or a `renderCell` is provided, the Excel export might not display the value correctly.', 'You can provide a `valueFormatter` with a string representation to be used.']);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
if (isObject(formattedValue)) {
|
|
112
|
-
serializedRow[castColumn.field] = formattedValue?.label;
|
|
113
|
-
} else {
|
|
114
|
-
serializedRow[castColumn.field] = formattedValue;
|
|
115
|
-
}
|
|
116
|
-
break;
|
|
117
|
-
}
|
|
118
|
-
case 'boolean':
|
|
119
|
-
case 'number':
|
|
120
|
-
cellValue = apiRef.current.getRowValue(row, column);
|
|
121
|
-
break;
|
|
122
|
-
case 'date':
|
|
123
|
-
case 'dateTime':
|
|
124
|
-
{
|
|
125
|
-
// Excel does not do any timezone conversion, so we create a date using UTC instead of local timezone
|
|
126
|
-
// Solution from: https://github.com/exceljs/exceljs/issues/486#issuecomment-432557582
|
|
127
|
-
// About Date.UTC(): https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC#exemples
|
|
128
|
-
const value = apiRef.current.getRowValue(row, column);
|
|
129
|
-
// value may be `undefined` in auto-generated grouping rows
|
|
130
|
-
if (!value) {
|
|
131
|
-
break;
|
|
132
|
-
}
|
|
133
|
-
const utcDate = new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate(), value.getHours(), value.getMinutes(), value.getSeconds()));
|
|
134
|
-
serializedRow[column.field] = utcDate;
|
|
135
|
-
break;
|
|
136
|
-
}
|
|
137
|
-
case 'actions':
|
|
138
|
-
break;
|
|
139
|
-
default:
|
|
140
|
-
cellValue = apiRef.current.getRowFormattedValue(row, column);
|
|
141
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
142
|
-
if (String(cellValue) === '[object Object]') {
|
|
143
|
-
warnOnce(['MUI X: When the value of a field is an object or a `renderCell` is provided, the Excel export might not display the value correctly.', 'You can provide a `valueFormatter` with a string representation to be used.']);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
if (typeof cellValue === 'string' && options.escapeFormulas) {
|
|
149
|
-
// See https://owasp.org/www-community/attacks/CSV_Injection
|
|
150
|
-
if (['=', '+', '-', '@', '\t', '\r'].includes(cellValue[0])) {
|
|
151
|
-
cellValue = `'${cellValue}`;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
if (typeof cellValue !== 'undefined') {
|
|
155
|
-
serializedRow[column.field] = cellValue;
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
return {
|
|
159
|
-
row: serializedRow,
|
|
160
|
-
dataValidation,
|
|
161
|
-
outlineLevel,
|
|
162
|
-
mergedCells
|
|
163
|
-
};
|
|
164
|
-
};
|
|
165
|
-
const defaultColumnsStyles = {
|
|
166
|
-
[GRID_DATE_COL_DEF.type]: {
|
|
167
|
-
numFmt: 'dd.mm.yyyy'
|
|
168
|
-
},
|
|
169
|
-
[GRID_DATETIME_COL_DEF.type]: {
|
|
170
|
-
numFmt: 'dd.mm.yyyy hh:mm'
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
export const serializeColumn = (column, columnsStyles) => {
|
|
174
|
-
const {
|
|
175
|
-
field,
|
|
176
|
-
type
|
|
177
|
-
} = column;
|
|
178
|
-
return {
|
|
179
|
-
key: field,
|
|
180
|
-
headerText: column.headerName ?? column.field,
|
|
181
|
-
// Excel width must stay between 0 and 255 (https://support.microsoft.com/en-us/office/change-the-column-width-and-row-height-72f5e3cc-994d-43e8-ae58-9774a0905f46)
|
|
182
|
-
// From the example of column width behavior (https://docs.microsoft.com/en-US/office/troubleshoot/excel/determine-column-widths#example-of-column-width-behavior)
|
|
183
|
-
// a value of 10 corresponds to 75px. This is an approximation, because column width depends on the font-size
|
|
184
|
-
width: Math.min(255, column.width ? column.width / 7.5 : 8.43),
|
|
185
|
-
style: _extends({}, type && defaultColumnsStyles?.[type], columnsStyles?.[field])
|
|
186
|
-
};
|
|
187
|
-
};
|
|
188
|
-
export function serializeColumns(columns, styles) {
|
|
189
|
-
return columns.map(column => serializeColumn(column, styles));
|
|
190
|
-
}
|
|
191
|
-
export async function getDataForValueOptionsSheet(columns, valueOptionsSheetName, api) {
|
|
192
|
-
// Creates a temp worksheet to obtain the column letters
|
|
193
|
-
const excelJS = await getExcelJs();
|
|
194
|
-
const workbook = new excelJS.Workbook();
|
|
195
|
-
const worksheet = workbook.addWorksheet('Sheet1');
|
|
196
|
-
const record = {};
|
|
197
|
-
const worksheetColumns = [];
|
|
198
|
-
for (let i = 0; i < columns.length; i += 1) {
|
|
199
|
-
const column = columns[i];
|
|
200
|
-
const isCandidateColumn = isSingleSelectColDef(column) && Array.isArray(column.valueOptions);
|
|
201
|
-
if (!isCandidateColumn) {
|
|
202
|
-
continue;
|
|
203
|
-
}
|
|
204
|
-
worksheetColumns.push({
|
|
205
|
-
key: column.field
|
|
206
|
-
});
|
|
207
|
-
worksheet.columns = worksheetColumns;
|
|
208
|
-
const header = column.headerName ?? column.field;
|
|
209
|
-
const values = [header];
|
|
210
|
-
getFormattedValueOptions(column, {}, column.valueOptions, api, value => {
|
|
211
|
-
values.push(value);
|
|
212
|
-
});
|
|
213
|
-
const letter = worksheet.getColumn(column.field).letter;
|
|
214
|
-
const address = `${valueOptionsSheetName}!$${letter}$2:$${letter}$${values.length}`;
|
|
215
|
-
record[column.field] = {
|
|
216
|
-
values,
|
|
217
|
-
address
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
return record;
|
|
221
|
-
}
|
|
222
|
-
export async function buildExcel(options, apiRef) {
|
|
223
|
-
const {
|
|
224
|
-
columns,
|
|
225
|
-
rowIds,
|
|
226
|
-
includeHeaders,
|
|
227
|
-
includeColumnGroupsHeaders,
|
|
228
|
-
valueOptionsSheetName = 'Options',
|
|
229
|
-
exceljsPreProcess,
|
|
230
|
-
exceljsPostProcess,
|
|
231
|
-
columnsStyles = {}
|
|
232
|
-
} = options;
|
|
233
|
-
const excelJS = await getExcelJs();
|
|
234
|
-
const workbook = new excelJS.Workbook();
|
|
235
|
-
const worksheet = workbook.addWorksheet('Sheet1');
|
|
236
|
-
const serializedColumns = serializeColumns(columns, columnsStyles);
|
|
237
|
-
worksheet.columns = serializedColumns;
|
|
238
|
-
if (exceljsPreProcess) {
|
|
239
|
-
await exceljsPreProcess({
|
|
240
|
-
workbook,
|
|
241
|
-
worksheet
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
if (includeColumnGroupsHeaders) {
|
|
245
|
-
const columnGroupPaths = columns.reduce((acc, column) => {
|
|
246
|
-
acc[column.field] = apiRef.current.getColumnGroupPath(column.field);
|
|
247
|
-
return acc;
|
|
248
|
-
}, {});
|
|
249
|
-
addColumnGroupingHeaders(worksheet, serializedColumns, columnGroupPaths, apiRef.current.getAllGroupDetails());
|
|
250
|
-
}
|
|
251
|
-
if (includeHeaders) {
|
|
252
|
-
worksheet.addRow(columns.map(column => column.headerName ?? column.field));
|
|
253
|
-
}
|
|
254
|
-
const valueOptionsData = await getDataForValueOptionsSheet(columns, valueOptionsSheetName, apiRef.current);
|
|
255
|
-
createValueOptionsSheetIfNeeded(valueOptionsData, valueOptionsSheetName, workbook);
|
|
256
|
-
apiRef.current.resetColSpan();
|
|
257
|
-
rowIds.forEach(id => {
|
|
258
|
-
const serializedRow = serializeRowUnsafe(id, columns, apiRef, valueOptionsData, options);
|
|
259
|
-
addSerializedRowToWorksheet(serializedRow, worksheet);
|
|
260
|
-
});
|
|
261
|
-
apiRef.current.resetColSpan();
|
|
262
|
-
if (exceljsPostProcess) {
|
|
263
|
-
await exceljsPostProcess({
|
|
264
|
-
workbook,
|
|
265
|
-
worksheet
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
return workbook;
|
|
269
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { addColumnGroupingHeaders, addSerializedRowToWorksheet, createValueOptionsSheetIfNeeded, getExcelJs } from "./utils.js";
|
|
2
|
-
export function setupExcelExportWebWorker(workerOptions = {}) {
|
|
3
|
-
// eslint-disable-next-line no-restricted-globals
|
|
4
|
-
addEventListener('message', async event => {
|
|
5
|
-
const {
|
|
6
|
-
namespace,
|
|
7
|
-
serializedColumns,
|
|
8
|
-
serializedRows,
|
|
9
|
-
options,
|
|
10
|
-
valueOptionsSheetName,
|
|
11
|
-
valueOptionsData,
|
|
12
|
-
columnGroupDetails,
|
|
13
|
-
columnGroupPaths
|
|
14
|
-
} = event.data;
|
|
15
|
-
|
|
16
|
-
// workers share the pub-sub channel namespace. Use this property to filter out messages.
|
|
17
|
-
if (namespace !== 'mui-x-data-grid-export') {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const {
|
|
21
|
-
exceljsPostProcess,
|
|
22
|
-
exceljsPreProcess
|
|
23
|
-
} = workerOptions;
|
|
24
|
-
const excelJS = await getExcelJs();
|
|
25
|
-
const workbook = new excelJS.Workbook();
|
|
26
|
-
const worksheet = workbook.addWorksheet('Sheet1');
|
|
27
|
-
worksheet.columns = serializedColumns;
|
|
28
|
-
if (exceljsPreProcess) {
|
|
29
|
-
await exceljsPreProcess({
|
|
30
|
-
workbook,
|
|
31
|
-
worksheet
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
if (options.includeColumnGroupsHeaders) {
|
|
35
|
-
addColumnGroupingHeaders(worksheet, serializedColumns, columnGroupPaths, columnGroupDetails);
|
|
36
|
-
}
|
|
37
|
-
const includeHeaders = options.includeHeaders ?? true;
|
|
38
|
-
if (includeHeaders) {
|
|
39
|
-
worksheet.addRow(serializedColumns.map(column => column.headerText));
|
|
40
|
-
}
|
|
41
|
-
createValueOptionsSheetIfNeeded(valueOptionsData, valueOptionsSheetName, workbook);
|
|
42
|
-
serializedRows.forEach(serializedRow => {
|
|
43
|
-
addSerializedRowToWorksheet(serializedRow, worksheet);
|
|
44
|
-
});
|
|
45
|
-
if (exceljsPostProcess) {
|
|
46
|
-
await exceljsPostProcess({
|
|
47
|
-
workbook,
|
|
48
|
-
worksheet
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
postMessage(await workbook.xlsx.writeBuffer());
|
|
52
|
-
});
|
|
53
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type * as Excel from 'exceljs';
|
|
2
|
-
import type { GridColumnGroupLookup } from '@mui/x-data-grid/internals';
|
|
3
|
-
import type { GridExcelExportOptions } from '../gridExcelExportInterface';
|
|
4
|
-
export declare const getExcelJs: () => Promise<typeof Excel>;
|
|
5
|
-
export interface SerializedRow {
|
|
6
|
-
row: Record<string, undefined | number | boolean | string | Date>;
|
|
7
|
-
dataValidation: Record<string, Excel.DataValidation>;
|
|
8
|
-
outlineLevel: number;
|
|
9
|
-
mergedCells: {
|
|
10
|
-
leftIndex: number;
|
|
11
|
-
rightIndex: number;
|
|
12
|
-
}[];
|
|
13
|
-
}
|
|
14
|
-
export declare const addColumnGroupingHeaders: (worksheet: Excel.Worksheet, columns: SerializedColumns, columnGroupPaths: Record<string, string[]>, columnGroupDetails: GridColumnGroupLookup) => void;
|
|
15
|
-
export type SerializedColumns = Array<{
|
|
16
|
-
key: string;
|
|
17
|
-
width: number;
|
|
18
|
-
style: Partial<Excel.Style>;
|
|
19
|
-
headerText: string;
|
|
20
|
-
}>;
|
|
21
|
-
export type ValueOptionsData = Record<string, {
|
|
22
|
-
values: (string | number)[];
|
|
23
|
-
address: string;
|
|
24
|
-
}>;
|
|
25
|
-
export declare function addSerializedRowToWorksheet(serializedRow: SerializedRow, worksheet: Excel.Worksheet): void;
|
|
26
|
-
export declare function createValueOptionsSheetIfNeeded(valueOptionsData: ValueOptionsData, sheetName: string, workbook: Excel.Workbook): Promise<void>;
|
|
27
|
-
export interface ExcelExportInitEvent {
|
|
28
|
-
namespace?: string;
|
|
29
|
-
serializedColumns: SerializedColumns;
|
|
30
|
-
serializedRows: SerializedRow[];
|
|
31
|
-
valueOptionsSheetName: string;
|
|
32
|
-
columnGroupPaths: Record<string, string[]>;
|
|
33
|
-
columnGroupDetails: GridColumnGroupLookup;
|
|
34
|
-
valueOptionsData: ValueOptionsData;
|
|
35
|
-
options: Omit<GridExcelExportOptions, 'exceljsPreProcess' | 'exceljsPostProcess' | 'columnsStyles' | 'valueOptionsSheetName'>;
|
|
36
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
export const getExcelJs = async () => {
|
|
3
|
-
const excelJsModule = await import('exceljs');
|
|
4
|
-
return excelJsModule.default ?? excelJsModule;
|
|
5
|
-
};
|
|
6
|
-
export const addColumnGroupingHeaders = (worksheet, columns, columnGroupPaths, columnGroupDetails) => {
|
|
7
|
-
const maxDepth = Math.max(...columns.map(({
|
|
8
|
-
key
|
|
9
|
-
}) => columnGroupPaths[key]?.length ?? 0));
|
|
10
|
-
if (maxDepth === 0) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
for (let rowIndex = 0; rowIndex < maxDepth; rowIndex += 1) {
|
|
14
|
-
const row = columns.map(({
|
|
15
|
-
key
|
|
16
|
-
}) => {
|
|
17
|
-
const groupingPath = columnGroupPaths[key];
|
|
18
|
-
if (groupingPath.length <= rowIndex) {
|
|
19
|
-
return {
|
|
20
|
-
groupId: null,
|
|
21
|
-
parents: groupingPath
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
return _extends({}, columnGroupDetails[groupingPath[rowIndex]], {
|
|
25
|
-
parents: groupingPath.slice(0, rowIndex)
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
const newRow = worksheet.addRow(row.map(group => group.groupId === null ? null : group?.headerName ?? group.groupId));
|
|
29
|
-
|
|
30
|
-
// use `rowCount`, since worksheet can have additional rows added in `exceljsPreProcess`
|
|
31
|
-
const lastRowIndex = newRow.worksheet.rowCount;
|
|
32
|
-
let leftIndex = 0;
|
|
33
|
-
let rightIndex = 1;
|
|
34
|
-
while (rightIndex < columns.length) {
|
|
35
|
-
const {
|
|
36
|
-
groupId: leftGroupId,
|
|
37
|
-
parents: leftParents
|
|
38
|
-
} = row[leftIndex];
|
|
39
|
-
const {
|
|
40
|
-
groupId: rightGroupId,
|
|
41
|
-
parents: rightParents
|
|
42
|
-
} = row[rightIndex];
|
|
43
|
-
const areInSameGroup = leftGroupId === rightGroupId && leftParents.length === rightParents.length && leftParents.every((leftParent, index) => rightParents[index] === leftParent);
|
|
44
|
-
if (areInSameGroup) {
|
|
45
|
-
rightIndex += 1;
|
|
46
|
-
} else {
|
|
47
|
-
if (rightIndex - leftIndex > 1) {
|
|
48
|
-
worksheet.mergeCells(lastRowIndex, leftIndex + 1, lastRowIndex, rightIndex);
|
|
49
|
-
}
|
|
50
|
-
leftIndex = rightIndex;
|
|
51
|
-
rightIndex += 1;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
if (rightIndex - leftIndex > 1) {
|
|
55
|
-
worksheet.mergeCells(lastRowIndex, leftIndex + 1, lastRowIndex, rightIndex);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
export function addSerializedRowToWorksheet(serializedRow, worksheet) {
|
|
60
|
-
const {
|
|
61
|
-
row,
|
|
62
|
-
dataValidation,
|
|
63
|
-
outlineLevel,
|
|
64
|
-
mergedCells
|
|
65
|
-
} = serializedRow;
|
|
66
|
-
const newRow = worksheet.addRow(row);
|
|
67
|
-
Object.keys(dataValidation).forEach(field => {
|
|
68
|
-
newRow.getCell(field).dataValidation = _extends({}, dataValidation[field]);
|
|
69
|
-
});
|
|
70
|
-
if (outlineLevel) {
|
|
71
|
-
newRow.outlineLevel = outlineLevel;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// use `rowCount`, since worksheet can have additional rows added in `exceljsPreProcess`
|
|
75
|
-
const lastRowIndex = newRow.worksheet.rowCount;
|
|
76
|
-
mergedCells.forEach(mergedCell => {
|
|
77
|
-
worksheet.mergeCells(lastRowIndex, mergedCell.leftIndex, lastRowIndex, mergedCell.rightIndex);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
export async function createValueOptionsSheetIfNeeded(valueOptionsData, sheetName, workbook) {
|
|
81
|
-
if (Object.keys(valueOptionsData).length === 0) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
const valueOptionsWorksheet = workbook.addWorksheet(sheetName);
|
|
85
|
-
valueOptionsWorksheet.columns = Object.keys(valueOptionsData).map(key => ({
|
|
86
|
-
key
|
|
87
|
-
}));
|
|
88
|
-
Object.entries(valueOptionsData).forEach(([field, {
|
|
89
|
-
values
|
|
90
|
-
}]) => {
|
|
91
|
-
valueOptionsWorksheet.getColumn(field).values = values;
|
|
92
|
-
});
|
|
93
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
-
import { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
|
|
3
|
-
import { DataGridPremiumProps } from "../../../models/dataGridPremiumProps.js";
|
|
4
|
-
/**
|
|
5
|
-
* @requires useGridColumns (state)
|
|
6
|
-
* @requires useGridFilter (state)
|
|
7
|
-
* @requires useGridSorting (state)
|
|
8
|
-
* @requires useGridSelection (state)
|
|
9
|
-
* @requires useGridParamsApi (method)
|
|
10
|
-
*/
|
|
11
|
-
export declare const useGridExcelExport: (apiRef: RefObject<GridPrivateApiPremium>, props: DataGridPremiumProps) => void;
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
-
const _excluded = ["worker", "exceljsPostProcess", "exceljsPreProcess", "columnsStyles", "includeHeaders", "getRowsToExport", "valueOptionsSheetName"];
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { useGridApiMethod, useGridLogger, useGridApiOptionHandler } from '@mui/x-data-grid';
|
|
5
|
-
import { useGridRegisterPipeProcessor, exportAs, getColumnsToExport, defaultGetRowsToExport } from '@mui/x-data-grid/internals';
|
|
6
|
-
import { buildExcel, getDataForValueOptionsSheet, serializeColumns, serializeRowUnsafe } from "./serializer/excelSerializer.js";
|
|
7
|
-
import { GridExcelExportMenuItem } from "../../../components/index.js";
|
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
/**
|
|
10
|
-
* @requires useGridColumns (state)
|
|
11
|
-
* @requires useGridFilter (state)
|
|
12
|
-
* @requires useGridSorting (state)
|
|
13
|
-
* @requires useGridSelection (state)
|
|
14
|
-
* @requires useGridParamsApi (method)
|
|
15
|
-
*/
|
|
16
|
-
export const useGridExcelExport = (apiRef, props) => {
|
|
17
|
-
const logger = useGridLogger(apiRef, 'useGridExcelExport');
|
|
18
|
-
const getDataAsExcel = React.useCallback((options = {}) => {
|
|
19
|
-
logger.debug(`Get data as excel`);
|
|
20
|
-
const getRowsToExport = options.getRowsToExport ?? defaultGetRowsToExport;
|
|
21
|
-
const exportedRowIds = getRowsToExport({
|
|
22
|
-
apiRef
|
|
23
|
-
});
|
|
24
|
-
const exportedColumns = getColumnsToExport({
|
|
25
|
-
apiRef,
|
|
26
|
-
options
|
|
27
|
-
});
|
|
28
|
-
return buildExcel({
|
|
29
|
-
columns: exportedColumns,
|
|
30
|
-
rowIds: exportedRowIds,
|
|
31
|
-
includeHeaders: options.includeHeaders ?? true,
|
|
32
|
-
includeColumnGroupsHeaders: options.includeColumnGroupsHeaders ?? true,
|
|
33
|
-
valueOptionsSheetName: options?.valueOptionsSheetName || 'Options',
|
|
34
|
-
columnsStyles: options?.columnsStyles,
|
|
35
|
-
exceljsPreProcess: options?.exceljsPreProcess,
|
|
36
|
-
exceljsPostProcess: options?.exceljsPostProcess,
|
|
37
|
-
escapeFormulas: options.escapeFormulas ?? true
|
|
38
|
-
}, apiRef);
|
|
39
|
-
}, [logger, apiRef]);
|
|
40
|
-
const exportDataAsExcel = React.useCallback(async (options = {}) => {
|
|
41
|
-
const {
|
|
42
|
-
worker: workerFn,
|
|
43
|
-
exceljsPostProcess,
|
|
44
|
-
exceljsPreProcess,
|
|
45
|
-
getRowsToExport = defaultGetRowsToExport,
|
|
46
|
-
valueOptionsSheetName = 'Options'
|
|
47
|
-
} = options,
|
|
48
|
-
cloneableOptions = _objectWithoutPropertiesLoose(options, _excluded);
|
|
49
|
-
const sendExcelToUser = buffer => {
|
|
50
|
-
const blob = new Blob([buffer], {
|
|
51
|
-
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
52
|
-
});
|
|
53
|
-
exportAs(blob, 'xlsx', options?.fileName);
|
|
54
|
-
};
|
|
55
|
-
if (!workerFn) {
|
|
56
|
-
apiRef.current.publishEvent('excelExportStateChange', 'pending');
|
|
57
|
-
const workbook = await getDataAsExcel(options);
|
|
58
|
-
if (workbook === null) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
const content = await workbook.xlsx.writeBuffer();
|
|
62
|
-
apiRef.current.publishEvent('excelExportStateChange', 'finished');
|
|
63
|
-
sendExcelToUser(content);
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
67
|
-
if (exceljsPostProcess) {
|
|
68
|
-
console.warn([`MUI X: The exceljsPostProcess option is not supported when a web worker is used.`, 'As alternative, pass the callback to the same option in setupExcelExportWebWorker.'].join('\n'));
|
|
69
|
-
}
|
|
70
|
-
if (exceljsPreProcess) {
|
|
71
|
-
console.warn([`MUI X: The exceljsPreProcess option is not supported when a web worker is used.`, 'As alternative, pass the callback to the same option in setupExcelExportWebWorker.'].join('\n'));
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
const worker = workerFn();
|
|
75
|
-
apiRef.current.publishEvent('excelExportStateChange', 'pending');
|
|
76
|
-
worker.onmessage = async event => {
|
|
77
|
-
sendExcelToUser(event.data);
|
|
78
|
-
apiRef.current.publishEvent('excelExportStateChange', 'finished');
|
|
79
|
-
worker.terminate();
|
|
80
|
-
};
|
|
81
|
-
const exportedRowIds = getRowsToExport({
|
|
82
|
-
apiRef
|
|
83
|
-
});
|
|
84
|
-
const exportedColumns = getColumnsToExport({
|
|
85
|
-
apiRef,
|
|
86
|
-
options
|
|
87
|
-
});
|
|
88
|
-
const valueOptionsData = await getDataForValueOptionsSheet(exportedColumns, valueOptionsSheetName, apiRef.current);
|
|
89
|
-
const serializedColumns = serializeColumns(exportedColumns, options.columnsStyles || {});
|
|
90
|
-
apiRef.current.resetColSpan();
|
|
91
|
-
const serializedRows = [];
|
|
92
|
-
for (let i = 0; i < exportedRowIds.length; i += 1) {
|
|
93
|
-
const id = exportedRowIds[i];
|
|
94
|
-
const serializedRow = serializeRowUnsafe(id, exportedColumns, apiRef, valueOptionsData, {
|
|
95
|
-
escapeFormulas: options.escapeFormulas ?? true
|
|
96
|
-
});
|
|
97
|
-
serializedRows.push(serializedRow);
|
|
98
|
-
}
|
|
99
|
-
apiRef.current.resetColSpan();
|
|
100
|
-
const columnGroupPaths = exportedColumns.reduce((acc, column) => {
|
|
101
|
-
acc[column.field] = apiRef.current.getColumnGroupPath(column.field);
|
|
102
|
-
return acc;
|
|
103
|
-
}, {});
|
|
104
|
-
const message = {
|
|
105
|
-
// workers share the pub-sub channel namespace. Use this property to filter out messages.
|
|
106
|
-
namespace: 'mui-x-data-grid-export',
|
|
107
|
-
serializedColumns,
|
|
108
|
-
serializedRows,
|
|
109
|
-
valueOptionsData,
|
|
110
|
-
columnGroupPaths,
|
|
111
|
-
columnGroupDetails: apiRef.current.getAllGroupDetails(),
|
|
112
|
-
options: cloneableOptions,
|
|
113
|
-
valueOptionsSheetName
|
|
114
|
-
};
|
|
115
|
-
worker.postMessage(message);
|
|
116
|
-
}, [apiRef, getDataAsExcel]);
|
|
117
|
-
const excelExportApi = {
|
|
118
|
-
getDataAsExcel,
|
|
119
|
-
exportDataAsExcel
|
|
120
|
-
};
|
|
121
|
-
useGridApiMethod(apiRef, excelExportApi, 'public');
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* PRE-PROCESSING
|
|
125
|
-
*/
|
|
126
|
-
const addExportMenuButtons = React.useCallback((initialValue, options) => {
|
|
127
|
-
if (options.excelOptions?.disableToolbarButton) {
|
|
128
|
-
return initialValue;
|
|
129
|
-
}
|
|
130
|
-
return [...initialValue, {
|
|
131
|
-
component: /*#__PURE__*/_jsx(GridExcelExportMenuItem, {
|
|
132
|
-
options: options.excelOptions
|
|
133
|
-
}),
|
|
134
|
-
componentName: 'excelExport'
|
|
135
|
-
}];
|
|
136
|
-
}, []);
|
|
137
|
-
useGridRegisterPipeProcessor(apiRef, 'exportMenu', addExportMenuButtons);
|
|
138
|
-
useGridApiOptionHandler(apiRef, 'excelExportStateChange', props.onExcelExportStateChange);
|
|
139
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// Only export the variable and types that should be publicly exposed and re-exported from `@mui/x-data-grid-premium`
|
|
2
|
-
export * from "./aggregation/index.js";
|
|
3
|
-
export * from "./rowGrouping/index.js";
|
|
4
|
-
export * from "./export/index.js";
|
|
5
|
-
export * from "./cellSelection/index.js";
|
|
6
|
-
export * from "./promptControl/index.js";
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export function gridDefaultPromptResolver(url, context, query) {
|
|
2
|
-
return fetch(url, {
|
|
3
|
-
mode: 'cors',
|
|
4
|
-
method: 'POST',
|
|
5
|
-
headers: {
|
|
6
|
-
'content-type': 'application/json'
|
|
7
|
-
},
|
|
8
|
-
credentials: 'include',
|
|
9
|
-
body: JSON.stringify({
|
|
10
|
-
context,
|
|
11
|
-
query
|
|
12
|
-
})
|
|
13
|
-
}).then(result => result.json()).then(result => {
|
|
14
|
-
if (result.ok === false) {
|
|
15
|
-
return Promise.reject(new Error(result.message));
|
|
16
|
-
}
|
|
17
|
-
if (result.data.error) {
|
|
18
|
-
return Promise.reject(new Error(result.data.error));
|
|
19
|
-
}
|
|
20
|
-
return result.data;
|
|
21
|
-
});
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { gridDefaultPromptResolver as unstable_gridDefaultPromptResolver } from "./api.js";
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export type Sort = {
|
|
2
|
-
column: string;
|
|
3
|
-
direction: 'asc' | 'desc';
|
|
4
|
-
};
|
|
5
|
-
export type Grouping = {
|
|
6
|
-
column: string;
|
|
7
|
-
};
|
|
8
|
-
export type Filter = {
|
|
9
|
-
operator: string;
|
|
10
|
-
value: string | number | boolean | string[] | number[];
|
|
11
|
-
column: string;
|
|
12
|
-
};
|
|
13
|
-
export type AggregationFunction = 'avg' | 'sum' | 'min' | 'max' | 'size';
|
|
14
|
-
export type Aggregation = {
|
|
15
|
-
[column: string]: AggregationFunction;
|
|
16
|
-
};
|
|
17
|
-
export type PromptResponse = {
|
|
18
|
-
select: number;
|
|
19
|
-
filters: Filter[];
|
|
20
|
-
filterOperator?: 'and' | 'or';
|
|
21
|
-
aggregation: Aggregation;
|
|
22
|
-
sorting: Sort[];
|
|
23
|
-
grouping: Grouping[];
|
|
24
|
-
error: string | null;
|
|
25
|
-
};
|