@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
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { styled } from '@mui/system';
|
|
4
|
+
import { getDataGridUtilityClass, gridClasses, GridMenu, useGridSelector } from '@mui/x-data-grid-pro';
|
|
5
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
6
|
+
import { GridColumnSortButton, NotRendered, vars } from '@mui/x-data-grid-pro/internals';
|
|
7
|
+
import useId from '@mui/utils/useId';
|
|
8
|
+
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
9
|
+
import { getAvailableAggregationFunctions } from "../../hooks/features/aggregation/gridAggregationUtils.js";
|
|
10
|
+
import { GridPivotPanelFieldMenu } from "./GridPivotPanelFieldMenu.js";
|
|
11
|
+
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
12
|
+
import { gridPivotInitialColumnsSelector } from "../../hooks/features/pivoting/gridPivotingSelectors.js";
|
|
13
|
+
import { useGridPrivateApiContext } from "../../hooks/utils/useGridPrivateApiContext.js";
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
const useUtilityClasses = ownerState => {
|
|
16
|
+
const {
|
|
17
|
+
classes,
|
|
18
|
+
modelKey
|
|
19
|
+
} = ownerState;
|
|
20
|
+
const sorted = modelKey === 'columns' && ownerState.modelValue.sort;
|
|
21
|
+
const slots = {
|
|
22
|
+
root: ['pivotPanelField', sorted && 'pivotPanelField--sorted'],
|
|
23
|
+
name: ['pivotPanelFieldName'],
|
|
24
|
+
actionContainer: ['pivotPanelFieldActionContainer'],
|
|
25
|
+
dragIcon: ['pivotPanelFieldDragIcon'],
|
|
26
|
+
checkbox: ['pivotPanelFieldCheckbox']
|
|
27
|
+
};
|
|
28
|
+
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
29
|
+
};
|
|
30
|
+
const GridPivotPanelFieldRoot = styled('div', {
|
|
31
|
+
name: 'MuiDataGrid',
|
|
32
|
+
slot: 'PivotPanelField',
|
|
33
|
+
overridesResolver: (props, styles) => [{
|
|
34
|
+
[`&.${gridClasses['pivotPanelField--sorted']}`]: styles['pivotPanelField--sorted']
|
|
35
|
+
}, styles.pivotPanelField]
|
|
36
|
+
})({
|
|
37
|
+
flexShrink: 0,
|
|
38
|
+
position: 'relative',
|
|
39
|
+
padding: vars.spacing(0, 1, 0, 2),
|
|
40
|
+
height: 32,
|
|
41
|
+
display: 'flex',
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
gap: vars.spacing(0.5),
|
|
44
|
+
borderWidth: 0,
|
|
45
|
+
borderTopWidth: 2,
|
|
46
|
+
borderBottomWidth: 2,
|
|
47
|
+
borderStyle: 'solid',
|
|
48
|
+
borderColor: 'transparent',
|
|
49
|
+
margin: '-1px 0',
|
|
50
|
+
// collapse vertical borders
|
|
51
|
+
cursor: 'grab',
|
|
52
|
+
variants: [{
|
|
53
|
+
props: {
|
|
54
|
+
dropPosition: 'top'
|
|
55
|
+
},
|
|
56
|
+
style: {
|
|
57
|
+
borderTopColor: vars.colors.interactive.selected
|
|
58
|
+
}
|
|
59
|
+
}, {
|
|
60
|
+
props: {
|
|
61
|
+
dropPosition: 'bottom'
|
|
62
|
+
},
|
|
63
|
+
style: {
|
|
64
|
+
borderBottomColor: vars.colors.interactive.selected
|
|
65
|
+
}
|
|
66
|
+
}, {
|
|
67
|
+
props: {
|
|
68
|
+
section: null
|
|
69
|
+
},
|
|
70
|
+
style: {
|
|
71
|
+
borderTopColor: 'transparent',
|
|
72
|
+
borderBottomColor: 'transparent'
|
|
73
|
+
}
|
|
74
|
+
}],
|
|
75
|
+
'&:hover': {
|
|
76
|
+
backgroundColor: vars.colors.interactive.hover
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
const GridPivotPanelFieldName = styled('span', {
|
|
80
|
+
name: 'MuiDataGrid',
|
|
81
|
+
slot: 'PivotPanelFieldName'
|
|
82
|
+
})({
|
|
83
|
+
flex: 1,
|
|
84
|
+
overflow: 'hidden',
|
|
85
|
+
textOverflow: 'ellipsis',
|
|
86
|
+
whiteSpace: 'nowrap'
|
|
87
|
+
});
|
|
88
|
+
const GridPivotPanelFieldActionContainer = styled('div', {
|
|
89
|
+
name: 'MuiDataGrid',
|
|
90
|
+
slot: 'PivotPanelFieldActionContainer'
|
|
91
|
+
})({
|
|
92
|
+
display: 'flex',
|
|
93
|
+
alignItems: 'center'
|
|
94
|
+
});
|
|
95
|
+
const GridPivotPanelFieldDragIcon = styled('div', {
|
|
96
|
+
name: 'MuiDataGrid',
|
|
97
|
+
slot: 'PivotPanelFieldDragIcon'
|
|
98
|
+
})({
|
|
99
|
+
position: 'absolute',
|
|
100
|
+
left: -1,
|
|
101
|
+
width: 16,
|
|
102
|
+
display: 'flex',
|
|
103
|
+
justifyContent: 'center',
|
|
104
|
+
color: vars.colors.foreground.base,
|
|
105
|
+
opacity: 0,
|
|
106
|
+
'[draggable="true"]:hover > &': {
|
|
107
|
+
opacity: 0.3
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
const GridPivotPanelFieldCheckbox = styled(NotRendered, {
|
|
111
|
+
name: 'MuiDataGrid',
|
|
112
|
+
slot: 'PivotPanelFieldCheckbox'
|
|
113
|
+
})({
|
|
114
|
+
flex: 1,
|
|
115
|
+
position: 'relative',
|
|
116
|
+
margin: vars.spacing(0, 0, 0, -1),
|
|
117
|
+
cursor: 'grab'
|
|
118
|
+
});
|
|
119
|
+
function AggregationSelect({
|
|
120
|
+
aggFunc,
|
|
121
|
+
field
|
|
122
|
+
}) {
|
|
123
|
+
const rootProps = useGridRootProps();
|
|
124
|
+
const [aggregationMenuOpen, setAggregationMenuOpen] = React.useState(false);
|
|
125
|
+
const aggregationMenuTriggerRef = React.useRef(null);
|
|
126
|
+
const aggregationMenuTriggerId = useId();
|
|
127
|
+
const aggregationMenuId = useId();
|
|
128
|
+
const apiRef = useGridApiContext();
|
|
129
|
+
const initialColumns = useGridSelector(apiRef, gridPivotInitialColumnsSelector);
|
|
130
|
+
const colDef = initialColumns.get(field);
|
|
131
|
+
const availableAggregationFunctions = React.useMemo(() => getAvailableAggregationFunctions({
|
|
132
|
+
aggregationFunctions: rootProps.aggregationFunctions,
|
|
133
|
+
colDef,
|
|
134
|
+
isDataSource: false
|
|
135
|
+
}), [colDef, rootProps.aggregationFunctions]);
|
|
136
|
+
const handleClick = func => {
|
|
137
|
+
apiRef.current.setPivotModel(prev => {
|
|
138
|
+
return _extends({}, prev, {
|
|
139
|
+
values: prev.values.map(col => {
|
|
140
|
+
if (col.field === field) {
|
|
141
|
+
return _extends({}, col, {
|
|
142
|
+
aggFunc: func
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return col;
|
|
146
|
+
})
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
setAggregationMenuOpen(false);
|
|
150
|
+
};
|
|
151
|
+
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
152
|
+
children: [/*#__PURE__*/_jsx(rootProps.slots.baseChip, {
|
|
153
|
+
label: aggFunc,
|
|
154
|
+
size: "small",
|
|
155
|
+
variant: "outlined",
|
|
156
|
+
ref: aggregationMenuTriggerRef,
|
|
157
|
+
id: aggregationMenuTriggerId,
|
|
158
|
+
"aria-haspopup": "true",
|
|
159
|
+
"aria-controls": aggregationMenuOpen ? aggregationMenuId : undefined,
|
|
160
|
+
"aria-expanded": aggregationMenuOpen ? 'true' : undefined,
|
|
161
|
+
onClick: () => setAggregationMenuOpen(!aggregationMenuOpen)
|
|
162
|
+
}), /*#__PURE__*/_jsx(GridMenu, {
|
|
163
|
+
open: aggregationMenuOpen,
|
|
164
|
+
onClose: () => setAggregationMenuOpen(false),
|
|
165
|
+
target: aggregationMenuTriggerRef.current,
|
|
166
|
+
position: "bottom-start",
|
|
167
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.baseMenuList, _extends({
|
|
168
|
+
id: aggregationMenuId,
|
|
169
|
+
"aria-labelledby": aggregationMenuTriggerId,
|
|
170
|
+
autoFocusItem: true
|
|
171
|
+
}, rootProps.slotProps?.baseMenuList, {
|
|
172
|
+
children: availableAggregationFunctions.map(func => /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, _extends({
|
|
173
|
+
selected: aggFunc === func,
|
|
174
|
+
onClick: () => handleClick(func)
|
|
175
|
+
}, rootProps.slotProps?.baseMenuItem, {
|
|
176
|
+
children: func
|
|
177
|
+
}), func))
|
|
178
|
+
}))
|
|
179
|
+
})]
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
function GridPivotPanelField(props) {
|
|
183
|
+
const {
|
|
184
|
+
children,
|
|
185
|
+
field,
|
|
186
|
+
onDragStart,
|
|
187
|
+
onDragEnd
|
|
188
|
+
} = props;
|
|
189
|
+
const rootProps = useGridRootProps();
|
|
190
|
+
const [dropPosition, setDropPosition] = React.useState(null);
|
|
191
|
+
const section = props.modelKey;
|
|
192
|
+
const ownerState = _extends({}, props, {
|
|
193
|
+
classes: rootProps.classes,
|
|
194
|
+
dropPosition,
|
|
195
|
+
section
|
|
196
|
+
});
|
|
197
|
+
const classes = useUtilityClasses(ownerState);
|
|
198
|
+
const apiRef = useGridPrivateApiContext();
|
|
199
|
+
const handleDragStart = React.useCallback(event => {
|
|
200
|
+
const data = {
|
|
201
|
+
field,
|
|
202
|
+
modelKey: section
|
|
203
|
+
};
|
|
204
|
+
event.dataTransfer.setData('text/plain', JSON.stringify(data));
|
|
205
|
+
event.dataTransfer.dropEffect = 'move';
|
|
206
|
+
onDragStart(section);
|
|
207
|
+
}, [field, onDragStart, section]);
|
|
208
|
+
const getDropPosition = React.useCallback(event => {
|
|
209
|
+
const rect = event.target.getBoundingClientRect();
|
|
210
|
+
const y = event.clientY - rect.top;
|
|
211
|
+
if (y < rect.height / 2) {
|
|
212
|
+
return 'top';
|
|
213
|
+
}
|
|
214
|
+
return 'bottom';
|
|
215
|
+
}, []);
|
|
216
|
+
const handleDragOver = React.useCallback(event => {
|
|
217
|
+
if (!event.currentTarget.contains(event.relatedTarget)) {
|
|
218
|
+
setDropPosition(getDropPosition(event));
|
|
219
|
+
}
|
|
220
|
+
}, [getDropPosition]);
|
|
221
|
+
const handleDragLeave = React.useCallback(event => {
|
|
222
|
+
if (!event.currentTarget.contains(event.relatedTarget)) {
|
|
223
|
+
setDropPosition(null);
|
|
224
|
+
}
|
|
225
|
+
}, []);
|
|
226
|
+
const handleDrop = React.useCallback(event => {
|
|
227
|
+
setDropPosition(null);
|
|
228
|
+
if (!event.currentTarget.contains(event.relatedTarget)) {
|
|
229
|
+
event.preventDefault();
|
|
230
|
+
const position = getDropPosition(event);
|
|
231
|
+
const {
|
|
232
|
+
field: droppedField,
|
|
233
|
+
modelKey: originSection
|
|
234
|
+
} = JSON.parse(event.dataTransfer.getData('text/plain'));
|
|
235
|
+
apiRef.current.updatePivotModel({
|
|
236
|
+
field: droppedField,
|
|
237
|
+
targetField: field,
|
|
238
|
+
targetFieldPosition: position,
|
|
239
|
+
originSection,
|
|
240
|
+
targetSection: section
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}, [getDropPosition, apiRef, field, section]);
|
|
244
|
+
const handleSort = () => {
|
|
245
|
+
const currentSort = section === 'columns' ? props.modelValue.sort : null;
|
|
246
|
+
let newValue;
|
|
247
|
+
if (currentSort === 'asc') {
|
|
248
|
+
newValue = 'desc';
|
|
249
|
+
} else if (currentSort === 'desc') {
|
|
250
|
+
newValue = undefined;
|
|
251
|
+
} else {
|
|
252
|
+
newValue = 'asc';
|
|
253
|
+
}
|
|
254
|
+
apiRef.current.setPivotModel(prev => {
|
|
255
|
+
return _extends({}, prev, {
|
|
256
|
+
columns: prev.columns.map(col => {
|
|
257
|
+
if (col.field === field) {
|
|
258
|
+
return _extends({}, col, {
|
|
259
|
+
sort: newValue
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
return col;
|
|
263
|
+
})
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
};
|
|
267
|
+
const handleVisibilityChange = event => {
|
|
268
|
+
if (section) {
|
|
269
|
+
apiRef.current.setPivotModel(prev => {
|
|
270
|
+
return _extends({}, prev, {
|
|
271
|
+
[section]: prev[section].map(col => {
|
|
272
|
+
if (col.field === field) {
|
|
273
|
+
return _extends({}, col, {
|
|
274
|
+
hidden: !event.target.checked
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
return col;
|
|
278
|
+
})
|
|
279
|
+
});
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
const hideable = section !== null;
|
|
284
|
+
return /*#__PURE__*/_jsxs(GridPivotPanelFieldRoot, {
|
|
285
|
+
ownerState: ownerState,
|
|
286
|
+
className: classes.root,
|
|
287
|
+
onDragOver: handleDragOver,
|
|
288
|
+
onDragLeave: handleDragLeave,
|
|
289
|
+
onDrop: handleDrop,
|
|
290
|
+
onDragStart: handleDragStart,
|
|
291
|
+
onDragEnd: onDragEnd,
|
|
292
|
+
draggable: "true",
|
|
293
|
+
children: [/*#__PURE__*/_jsx(GridPivotPanelFieldDragIcon, {
|
|
294
|
+
ownerState: ownerState,
|
|
295
|
+
className: classes.dragIcon,
|
|
296
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.columnReorderIcon, {
|
|
297
|
+
fontSize: "small"
|
|
298
|
+
})
|
|
299
|
+
}), hideable ? /*#__PURE__*/_jsx(GridPivotPanelFieldCheckbox, _extends({
|
|
300
|
+
ownerState: ownerState,
|
|
301
|
+
className: classes.checkbox,
|
|
302
|
+
as: rootProps.slots.baseCheckbox,
|
|
303
|
+
size: "small",
|
|
304
|
+
density: "compact"
|
|
305
|
+
}, rootProps.slotProps?.baseCheckbox, {
|
|
306
|
+
checked: !props.modelValue.hidden || false,
|
|
307
|
+
onChange: handleVisibilityChange,
|
|
308
|
+
label: children
|
|
309
|
+
})) : /*#__PURE__*/_jsx(GridPivotPanelFieldName, {
|
|
310
|
+
ownerState: ownerState,
|
|
311
|
+
className: classes.name,
|
|
312
|
+
children: children
|
|
313
|
+
}), /*#__PURE__*/_jsxs(GridPivotPanelFieldActionContainer, {
|
|
314
|
+
ownerState: ownerState,
|
|
315
|
+
className: classes.actionContainer,
|
|
316
|
+
children: [section === 'columns' && /*#__PURE__*/_jsx(GridColumnSortButton, {
|
|
317
|
+
field: field,
|
|
318
|
+
direction: props.modelValue.sort,
|
|
319
|
+
sortingOrder: rootProps.sortingOrder,
|
|
320
|
+
onClick: handleSort
|
|
321
|
+
}), section === 'values' && /*#__PURE__*/_jsx(AggregationSelect, {
|
|
322
|
+
aggFunc: props.modelValue.aggFunc,
|
|
323
|
+
field: field
|
|
324
|
+
}), /*#__PURE__*/_jsx(GridPivotPanelFieldMenu, {
|
|
325
|
+
field: field,
|
|
326
|
+
modelKey: section
|
|
327
|
+
})]
|
|
328
|
+
})]
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
export { GridPivotPanelField };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { FieldTransferObject } from './GridPivotPanelBody';
|
|
3
|
+
interface GridPivotPanelFieldMenuProps {
|
|
4
|
+
field: string;
|
|
5
|
+
modelKey: FieldTransferObject['modelKey'];
|
|
6
|
+
}
|
|
7
|
+
declare function GridPivotPanelFieldMenu(props: GridPivotPanelFieldMenuProps): React.JSX.Element;
|
|
8
|
+
export { GridPivotPanelFieldMenu };
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { GridMenu, useGridSelector } from '@mui/x-data-grid-pro';
|
|
4
|
+
import useId from '@mui/utils/useId';
|
|
5
|
+
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
6
|
+
import { useGridPrivateApiContext } from "../../hooks/utils/useGridPrivateApiContext.js";
|
|
7
|
+
import { gridPivotModelSelector } from "../../hooks/features/pivoting/gridPivotingSelectors.js";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
function GridPivotPanelFieldMenu(props) {
|
|
10
|
+
const {
|
|
11
|
+
field,
|
|
12
|
+
modelKey
|
|
13
|
+
} = props;
|
|
14
|
+
const rootProps = useGridRootProps();
|
|
15
|
+
const [open, setOpen] = React.useState(false);
|
|
16
|
+
const apiRef = useGridPrivateApiContext();
|
|
17
|
+
const isAvailableField = modelKey === null;
|
|
18
|
+
const pivotModel = useGridSelector(apiRef, gridPivotModelSelector);
|
|
19
|
+
const fieldIndexInModel = !isAvailableField ? pivotModel[modelKey].findIndex(item => item.field === field) : -1;
|
|
20
|
+
const modelLength = !isAvailableField ? pivotModel[modelKey].length : 0;
|
|
21
|
+
const canMoveUp = fieldIndexInModel > 0;
|
|
22
|
+
const canMoveDown = !isAvailableField && fieldIndexInModel < modelLength - 1;
|
|
23
|
+
const menuId = useId();
|
|
24
|
+
const triggerId = useId();
|
|
25
|
+
const triggerRef = React.useRef(null);
|
|
26
|
+
const getMenuItems = React.useCallback(() => {
|
|
27
|
+
if (isAvailableField) {
|
|
28
|
+
return [{
|
|
29
|
+
key: 'rows',
|
|
30
|
+
label: apiRef.current.getLocaleText('pivotMenuAddToRows')
|
|
31
|
+
}, {
|
|
32
|
+
key: 'columns',
|
|
33
|
+
label: apiRef.current.getLocaleText('pivotMenuAddToColumns')
|
|
34
|
+
}, {
|
|
35
|
+
key: 'values',
|
|
36
|
+
label: apiRef.current.getLocaleText('pivotMenuAddToValues')
|
|
37
|
+
}];
|
|
38
|
+
}
|
|
39
|
+
return [{
|
|
40
|
+
key: 'up',
|
|
41
|
+
label: apiRef.current.getLocaleText('pivotMenuMoveUp'),
|
|
42
|
+
icon: /*#__PURE__*/_jsx(rootProps.slots.pivotMenuMoveUpIcon, {}),
|
|
43
|
+
disabled: !canMoveUp
|
|
44
|
+
}, {
|
|
45
|
+
key: 'down',
|
|
46
|
+
label: apiRef.current.getLocaleText('pivotMenuMoveDown'),
|
|
47
|
+
icon: /*#__PURE__*/_jsx(rootProps.slots.pivotMenuMoveDownIcon, {}),
|
|
48
|
+
disabled: !canMoveDown
|
|
49
|
+
}, {
|
|
50
|
+
divider: true
|
|
51
|
+
}, {
|
|
52
|
+
key: 'top',
|
|
53
|
+
label: apiRef.current.getLocaleText('pivotMenuMoveToTop'),
|
|
54
|
+
icon: /*#__PURE__*/_jsx(rootProps.slots.pivotMenuMoveToTopIcon, {}),
|
|
55
|
+
disabled: !canMoveUp
|
|
56
|
+
}, {
|
|
57
|
+
key: 'bottom',
|
|
58
|
+
label: apiRef.current.getLocaleText('pivotMenuMoveToBottom'),
|
|
59
|
+
icon: /*#__PURE__*/_jsx(rootProps.slots.pivotMenuMoveToBottomIcon, {}),
|
|
60
|
+
disabled: !canMoveDown
|
|
61
|
+
}, {
|
|
62
|
+
divider: true
|
|
63
|
+
}, {
|
|
64
|
+
key: 'rows',
|
|
65
|
+
label: apiRef.current.getLocaleText('pivotMenuRows'),
|
|
66
|
+
icon: modelKey === 'rows' ? /*#__PURE__*/_jsx(rootProps.slots.pivotMenuCheckIcon, {}) : /*#__PURE__*/_jsx("span", {})
|
|
67
|
+
}, {
|
|
68
|
+
key: 'columns',
|
|
69
|
+
label: apiRef.current.getLocaleText('pivotMenuColumns'),
|
|
70
|
+
icon: modelKey === 'columns' ? /*#__PURE__*/_jsx(rootProps.slots.pivotMenuCheckIcon, {}) : /*#__PURE__*/_jsx("span", {})
|
|
71
|
+
}, {
|
|
72
|
+
key: 'values',
|
|
73
|
+
label: apiRef.current.getLocaleText('pivotMenuValues'),
|
|
74
|
+
icon: modelKey === 'values' ? /*#__PURE__*/_jsx(rootProps.slots.pivotMenuCheckIcon, {}) : /*#__PURE__*/_jsx("span", {})
|
|
75
|
+
}, {
|
|
76
|
+
divider: true
|
|
77
|
+
}, {
|
|
78
|
+
key: null,
|
|
79
|
+
label: apiRef.current.getLocaleText('pivotMenuRemove'),
|
|
80
|
+
icon: /*#__PURE__*/_jsx(rootProps.slots.pivotMenuRemoveIcon, {})
|
|
81
|
+
}];
|
|
82
|
+
}, [isAvailableField, apiRef, rootProps, canMoveUp, canMoveDown, modelKey]);
|
|
83
|
+
const handleClick = () => {
|
|
84
|
+
setOpen(!open);
|
|
85
|
+
};
|
|
86
|
+
const handleClose = () => {
|
|
87
|
+
setOpen(false);
|
|
88
|
+
};
|
|
89
|
+
const handleMove = to => {
|
|
90
|
+
handleClose();
|
|
91
|
+
|
|
92
|
+
// Do nothing if the field is already in the target section
|
|
93
|
+
if (to === modelKey) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
let targetField;
|
|
97
|
+
let targetFieldPosition = null;
|
|
98
|
+
let targetSection = modelKey;
|
|
99
|
+
switch (to) {
|
|
100
|
+
case 'up':
|
|
101
|
+
targetField = pivotModel[modelKey][fieldIndexInModel - 1].field;
|
|
102
|
+
targetFieldPosition = 'top';
|
|
103
|
+
break;
|
|
104
|
+
case 'down':
|
|
105
|
+
targetField = pivotModel[modelKey][fieldIndexInModel + 1].field;
|
|
106
|
+
targetFieldPosition = 'bottom';
|
|
107
|
+
break;
|
|
108
|
+
case 'top':
|
|
109
|
+
targetField = pivotModel[modelKey][0].field;
|
|
110
|
+
targetFieldPosition = 'top';
|
|
111
|
+
break;
|
|
112
|
+
case 'bottom':
|
|
113
|
+
targetField = pivotModel[modelKey][modelLength - 1].field;
|
|
114
|
+
targetFieldPosition = 'bottom';
|
|
115
|
+
break;
|
|
116
|
+
case 'rows':
|
|
117
|
+
case 'columns':
|
|
118
|
+
case 'values':
|
|
119
|
+
case null:
|
|
120
|
+
targetSection = to;
|
|
121
|
+
break;
|
|
122
|
+
default:
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
apiRef.current.updatePivotModel({
|
|
126
|
+
field,
|
|
127
|
+
targetField,
|
|
128
|
+
targetFieldPosition,
|
|
129
|
+
targetSection,
|
|
130
|
+
originSection: modelKey
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
134
|
+
children: [/*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
135
|
+
size: "small"
|
|
136
|
+
}, rootProps.slotProps?.baseIconButton, {
|
|
137
|
+
id: triggerId,
|
|
138
|
+
"aria-haspopup": "true",
|
|
139
|
+
"aria-controls": open ? menuId : undefined,
|
|
140
|
+
"aria-expanded": open ? 'true' : undefined,
|
|
141
|
+
"aria-label": apiRef.current.getLocaleText('pivotMenuOptions'),
|
|
142
|
+
onClick: handleClick,
|
|
143
|
+
ref: triggerRef,
|
|
144
|
+
children: isAvailableField ? /*#__PURE__*/_jsx(rootProps.slots.pivotMenuAddIcon, {
|
|
145
|
+
fontSize: "small"
|
|
146
|
+
}) : /*#__PURE__*/_jsx(rootProps.slots.columnMenuIcon, {
|
|
147
|
+
fontSize: "small"
|
|
148
|
+
})
|
|
149
|
+
})), /*#__PURE__*/_jsx(GridMenu, {
|
|
150
|
+
target: triggerRef.current,
|
|
151
|
+
open: open,
|
|
152
|
+
onClose: handleClose,
|
|
153
|
+
position: "bottom-start",
|
|
154
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.baseMenuList, _extends({
|
|
155
|
+
id: menuId,
|
|
156
|
+
"aria-labelledby": triggerId,
|
|
157
|
+
autoFocusItem: true
|
|
158
|
+
}, rootProps.slotProps?.baseMenuList, {
|
|
159
|
+
children: getMenuItems().map((item, index) => 'divider' in item ? /*#__PURE__*/_jsx(rootProps.slots.baseDivider, {}, `divider-${index}`) : /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, _extends({
|
|
160
|
+
disabled: item.disabled,
|
|
161
|
+
onClick: () => handleMove(item.key),
|
|
162
|
+
iconStart: item.icon
|
|
163
|
+
}, rootProps.slotProps?.baseMenuItem, {
|
|
164
|
+
children: item.label
|
|
165
|
+
}), item.key))
|
|
166
|
+
}))
|
|
167
|
+
})]
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
export { GridPivotPanelFieldMenu };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface GridPivotPanelHeaderProps {
|
|
3
|
+
searchValue: string;
|
|
4
|
+
onSearchValueChange: (value: string) => void;
|
|
5
|
+
}
|
|
6
|
+
declare function GridPivotPanelHeader(props: GridPivotPanelHeaderProps): React.JSX.Element;
|
|
7
|
+
export { GridPivotPanelHeader };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { styled } from '@mui/system';
|
|
4
|
+
import { useGridSelector, getDataGridUtilityClass, gridRowCountSelector } from '@mui/x-data-grid-pro';
|
|
5
|
+
import { vars, NotRendered } from '@mui/x-data-grid-pro/internals';
|
|
6
|
+
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
7
|
+
import { SidebarHeader } from "../sidebar/index.js";
|
|
8
|
+
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
9
|
+
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
10
|
+
import { gridPivotActiveSelector } from "../../hooks/features/pivoting/gridPivotingSelectors.js";
|
|
11
|
+
import { GridPivotPanelSearch } from "./GridPivotPanelSearch.js";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
const useUtilityClasses = ownerState => {
|
|
14
|
+
const {
|
|
15
|
+
classes
|
|
16
|
+
} = ownerState;
|
|
17
|
+
const slots = {
|
|
18
|
+
root: ['pivotPanelHeader'],
|
|
19
|
+
switch: ['pivotPanelSwitch'],
|
|
20
|
+
label: ['pivotPanelSwitchLabel']
|
|
21
|
+
};
|
|
22
|
+
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
23
|
+
};
|
|
24
|
+
const GridPivotPanelHeaderRoot = styled('div', {
|
|
25
|
+
name: 'MuiDataGrid',
|
|
26
|
+
slot: 'PivotPanelHeader'
|
|
27
|
+
})({
|
|
28
|
+
display: 'flex',
|
|
29
|
+
alignItems: 'center',
|
|
30
|
+
gap: vars.spacing(1),
|
|
31
|
+
padding: vars.spacing(0, 0.75, 0, 1),
|
|
32
|
+
boxSizing: 'border-box',
|
|
33
|
+
height: 52
|
|
34
|
+
});
|
|
35
|
+
const GridPivotPanelSwitch = styled(NotRendered, {
|
|
36
|
+
name: 'MuiDataGrid',
|
|
37
|
+
slot: 'PivotPanelSwitch'
|
|
38
|
+
})({
|
|
39
|
+
marginRight: 'auto'
|
|
40
|
+
});
|
|
41
|
+
const GridPivotPanelSwitchLabel = styled('span', {
|
|
42
|
+
name: 'MuiDataGrid',
|
|
43
|
+
slot: 'PivotPanelSwitchLabel'
|
|
44
|
+
})({
|
|
45
|
+
fontWeight: vars.typography.fontWeight.medium
|
|
46
|
+
});
|
|
47
|
+
function GridPivotPanelHeader(props) {
|
|
48
|
+
const {
|
|
49
|
+
searchValue,
|
|
50
|
+
onSearchValueChange
|
|
51
|
+
} = props;
|
|
52
|
+
const apiRef = useGridApiContext();
|
|
53
|
+
const rootProps = useGridRootProps();
|
|
54
|
+
const pivotActive = useGridSelector(apiRef, gridPivotActiveSelector);
|
|
55
|
+
const classes = useUtilityClasses(rootProps);
|
|
56
|
+
const rows = useGridSelector(apiRef, gridRowCountSelector);
|
|
57
|
+
const isEmptyPivot = pivotActive && rows === 0;
|
|
58
|
+
return /*#__PURE__*/_jsxs(SidebarHeader, {
|
|
59
|
+
children: [/*#__PURE__*/_jsxs(GridPivotPanelHeaderRoot, {
|
|
60
|
+
ownerState: rootProps,
|
|
61
|
+
className: classes.root,
|
|
62
|
+
children: [/*#__PURE__*/_jsx(GridPivotPanelSwitch, _extends({
|
|
63
|
+
as: rootProps.slots.baseSwitch,
|
|
64
|
+
ownerState: rootProps,
|
|
65
|
+
className: classes.switch,
|
|
66
|
+
checked: pivotActive,
|
|
67
|
+
onChange: event => apiRef.current.setPivotActive(event.target.checked),
|
|
68
|
+
size: "small",
|
|
69
|
+
label: /*#__PURE__*/_jsx(GridPivotPanelSwitchLabel, {
|
|
70
|
+
ownerState: rootProps,
|
|
71
|
+
className: classes.label,
|
|
72
|
+
children: apiRef.current.getLocaleText('pivotToggleLabel')
|
|
73
|
+
})
|
|
74
|
+
}, rootProps.slotProps?.baseSwitch)), /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
75
|
+
onClick: () => {
|
|
76
|
+
apiRef.current.setPivotPanelOpen(false);
|
|
77
|
+
if (isEmptyPivot) {
|
|
78
|
+
apiRef.current.setPivotActive(false);
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"aria-label": apiRef.current.getLocaleText('pivotCloseButton')
|
|
82
|
+
}, rootProps.slotProps?.baseIconButton, {
|
|
83
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.sidebarCloseIcon, {
|
|
84
|
+
fontSize: "small"
|
|
85
|
+
})
|
|
86
|
+
}))]
|
|
87
|
+
}), /*#__PURE__*/_jsx(GridPivotPanelSearch, {
|
|
88
|
+
value: searchValue,
|
|
89
|
+
onClear: () => onSearchValueChange(''),
|
|
90
|
+
onChange: event => onSearchValueChange(event.target.value)
|
|
91
|
+
})]
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
export { GridPivotPanelHeader };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GridSlotProps } from '@mui/x-data-grid-pro';
|
|
3
|
+
export type GridPivotPanelSearchProps = Pick<GridSlotProps['baseTextField'], 'value' | 'onChange'> & {
|
|
4
|
+
onClear: () => void;
|
|
5
|
+
};
|
|
6
|
+
declare function GridPivotPanelSearch(props: GridPivotPanelSearchProps): React.JSX.Element;
|
|
7
|
+
export { GridPivotPanelSearch };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { getDataGridUtilityClass } from '@mui/x-data-grid-pro';
|
|
4
|
+
import { styled } from '@mui/system';
|
|
5
|
+
import { vars } from '@mui/x-data-grid-pro/internals';
|
|
6
|
+
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
7
|
+
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
8
|
+
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
const useUtilityClasses = ownerState => {
|
|
11
|
+
const {
|
|
12
|
+
classes
|
|
13
|
+
} = ownerState;
|
|
14
|
+
const slots = {
|
|
15
|
+
container: ['pivotPanelSearchContainer']
|
|
16
|
+
};
|
|
17
|
+
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
18
|
+
};
|
|
19
|
+
const GridPivotPanelSearchContainer = styled('div', {
|
|
20
|
+
name: 'MuiDataGrid',
|
|
21
|
+
slot: 'PivotPanelSearchContainer'
|
|
22
|
+
})({
|
|
23
|
+
padding: vars.spacing(0, 1, 1)
|
|
24
|
+
});
|
|
25
|
+
function GridPivotPanelSearch(props) {
|
|
26
|
+
const {
|
|
27
|
+
onClear,
|
|
28
|
+
value,
|
|
29
|
+
onChange
|
|
30
|
+
} = props;
|
|
31
|
+
const rootProps = useGridRootProps();
|
|
32
|
+
const apiRef = useGridApiContext();
|
|
33
|
+
const classes = useUtilityClasses(rootProps);
|
|
34
|
+
const handleKeyDown = event => {
|
|
35
|
+
if (event.key === 'Escape') {
|
|
36
|
+
onClear();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
return /*#__PURE__*/_jsx(GridPivotPanelSearchContainer, {
|
|
40
|
+
ownerState: rootProps,
|
|
41
|
+
className: classes.container,
|
|
42
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({
|
|
43
|
+
size: "small",
|
|
44
|
+
"aria-label": apiRef.current.getLocaleText('pivotSearchControlLabel'),
|
|
45
|
+
placeholder: apiRef.current.getLocaleText('pivotSearchControlPlaceholder'),
|
|
46
|
+
onKeyDown: handleKeyDown,
|
|
47
|
+
fullWidth: true,
|
|
48
|
+
slotProps: {
|
|
49
|
+
input: {
|
|
50
|
+
startAdornment: /*#__PURE__*/_jsx(rootProps.slots.pivotSearchIcon, {
|
|
51
|
+
fontSize: "small"
|
|
52
|
+
}),
|
|
53
|
+
endAdornment: value ? /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, {
|
|
54
|
+
edge: "end",
|
|
55
|
+
size: "small",
|
|
56
|
+
onClick: onClear,
|
|
57
|
+
"aria-label": apiRef.current.getLocaleText('pivotSearchControlClear'),
|
|
58
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.pivotSearchClearIcon, {
|
|
59
|
+
fontSize: "small"
|
|
60
|
+
})
|
|
61
|
+
}) : null
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}, rootProps.slotProps?.baseTextField, {
|
|
65
|
+
value: value,
|
|
66
|
+
onChange: onChange
|
|
67
|
+
}))
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
export { GridPivotPanelSearch };
|