@mui/x-data-grid 5.6.1 → 5.9.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 +275 -53
- package/DataGrid/DataGrid.d.ts +8 -3
- package/DataGrid/DataGrid.js +35 -2
- package/DataGrid/useDataGridComponent.js +13 -7
- package/DataGrid/useDataGridProps.d.ts +2 -1
- package/LICENSE +21 -0
- package/README.md +1 -1
- package/colDef/gridBooleanColDef.d.ts +1 -1
- package/colDef/gridBooleanOperators.d.ts +1 -1
- package/colDef/gridDateColDef.d.ts +5 -9
- package/colDef/gridDateColDef.js +2 -2
- package/colDef/gridDateOperators.d.ts +1 -1
- package/{models/colDef → colDef}/gridDefaultColumnTypes.d.ts +1 -1
- package/{models/colDef → colDef}/gridDefaultColumnTypes.js +6 -6
- package/colDef/gridNumericColDef.d.ts +1 -1
- package/colDef/gridNumericOperators.d.ts +2 -2
- package/colDef/gridStringColDef.d.ts +1 -1
- package/colDef/gridStringOperators.d.ts +1 -1
- package/colDef/index.d.ts +1 -0
- package/colDef/index.js +2 -1
- package/components/ErrorOverlay.js +8 -1
- package/components/GridLoadingOverlay.d.ts +4 -2
- package/components/GridLoadingOverlay.js +11 -2
- package/components/GridNoResultsOverlay.d.ts +3 -2
- package/components/GridNoRowsOverlay.d.ts +4 -2
- package/components/GridNoRowsOverlay.js +11 -2
- package/components/GridRow.d.ts +4 -0
- package/components/GridRow.js +50 -24
- package/components/base/GridErrorHandler.js +6 -25
- package/components/base/GridOverlays.js +4 -3
- package/components/cell/GridActionsCell.d.ts +5 -1
- package/components/cell/GridActionsCell.js +170 -21
- package/components/cell/GridActionsCellItem.d.ts +66 -4
- package/components/cell/GridActionsCellItem.js +7 -5
- package/components/cell/GridCell.d.ts +5 -4
- package/components/cell/GridCell.js +30 -9
- package/components/cell/GridEditBooleanCell.js +1 -1
- package/components/cell/GridEditDateCell.js +1 -1
- package/components/cell/GridEditInputCell.js +66 -5
- package/components/cell/GridEditSingleSelectCell.js +97 -16
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.ts +12 -0
- package/components/columnHeaders/{ColumnHeaderFilterIcon.js → GridColumnHeaderFilterIconButton.js} +22 -4
- package/components/columnHeaders/GridColumnHeaderItem.js +9 -12
- package/components/columnHeaders/GridColumnHeaderTitle.d.ts +2 -2
- package/components/columnHeaders/GridColumnHeaderTitle.js +1 -1
- package/components/columnHeaders/GridColumnHeaders.d.ts +0 -1
- package/components/columnHeaders/GridColumnHeaders.js +4 -2
- package/components/columnHeaders/index.d.ts +1 -0
- package/components/columnHeaders/index.js +1 -0
- package/components/columnSelection/GridCellCheckboxRenderer.d.ts +3 -3
- package/components/columnSelection/GridCellCheckboxRenderer.js +22 -5
- package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
- package/components/containers/GridOverlay.d.ts +9 -2
- package/components/containers/GridOverlay.js +11 -2
- package/components/containers/GridRoot.js +29 -17
- package/components/containers/GridRootStyles.js +2 -2
- package/components/menu/columnMenu/GridColumnMenu.js +1 -1
- package/components/panel/GridColumnsPanel.d.ts +4 -1
- package/components/panel/GridColumnsPanel.js +3 -3
- package/components/panel/GridPanel.d.ts +2 -2
- package/components/panel/GridPanel.js +1 -0
- package/components/panel/GridPanelWrapper.d.ts +1 -1
- package/components/panel/GridPreferencesPanel.js +4 -6
- package/components/panel/filterPanel/GridFilterForm.js +14 -10
- package/components/panel/filterPanel/GridFilterInputBoolean.js +13 -8
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +22 -15
- package/components/panel/filterPanel/GridFilterInputValue.js +22 -15
- package/components/toolbar/GridToolbarDensitySelector.js +1 -1
- package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
- package/components/virtualization/GridVirtualScroller.js +2 -0
- package/components/virtualization/GridVirtualScrollerContent.js +1 -3
- package/constants/defaultGridSlotsComponents.js +2 -1
- package/constants/gridClasses.d.ts +15 -3
- package/constants/gridDetailPanelToggleField.d.ts +1 -0
- package/constants/gridDetailPanelToggleField.js +2 -0
- package/hooks/core/index.d.ts +1 -1
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +85 -0
- package/hooks/core/{preProcessing/gridPreProcessingApi.js → pipeProcessing/gridPipeProcessingApi.js} +0 -0
- package/hooks/core/pipeProcessing/index.d.ts +4 -0
- package/hooks/core/pipeProcessing/index.js +4 -0
- package/hooks/core/pipeProcessing/useGridPipeProcessing.d.ts +32 -0
- package/hooks/core/pipeProcessing/useGridPipeProcessing.js +108 -0
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +3 -0
- package/hooks/core/{preProcessing/useGridRegisterPreProcessor.js → pipeProcessing/useGridRegisterPipeApplier.js} +2 -2
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +4 -0
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +27 -0
- package/hooks/core/strategyProcessing/gridStrategyProcessingApi.d.ts +58 -0
- package/hooks/core/{rowGroupsPreProcessing/gridRowGroupsPreProcessingApi.js → strategyProcessing/gridStrategyProcessingApi.js} +0 -0
- package/hooks/core/strategyProcessing/index.d.ts +3 -0
- package/hooks/core/strategyProcessing/index.js +3 -0
- package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.d.ts +4 -0
- package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.js +18 -0
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +48 -0
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +125 -0
- package/hooks/core/useGridInitialization.js +4 -4
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +0 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +77 -11
- package/hooks/features/columns/gridColumnsInterfaces.d.ts +8 -1
- package/hooks/features/columns/gridColumnsSelector.d.ts +6 -6
- package/hooks/features/columns/gridColumnsUtils.d.ts +33 -7
- package/hooks/features/columns/gridColumnsUtils.js +210 -41
- package/hooks/features/columns/useGridColumnSpanning.d.ts +7 -0
- package/hooks/features/columns/useGridColumnSpanning.js +109 -0
- package/hooks/features/columns/useGridColumns.d.ts +1 -1
- package/hooks/features/columns/useGridColumns.js +117 -65
- package/hooks/features/dimensions/gridDimensionsApi.d.ts +5 -0
- package/hooks/features/dimensions/useGridDimensions.js +5 -4
- package/hooks/features/editRows/useGridCellEditing.new.d.ts +4 -0
- package/hooks/features/editRows/useGridCellEditing.new.js +338 -0
- package/hooks/features/editRows/{useGridCellEditing.d.ts → useGridCellEditing.old.d.ts} +0 -0
- package/hooks/features/editRows/{useGridCellEditing.js → useGridCellEditing.old.js} +1 -1
- package/hooks/features/editRows/useGridEditing.new.d.ts +6 -0
- package/hooks/features/editRows/useGridEditing.new.js +122 -0
- package/hooks/features/editRows/{useGridEditing.d.ts → useGridEditing.old.d.ts} +0 -0
- package/hooks/features/editRows/{useGridEditing.js → useGridEditing.old.js} +4 -4
- package/hooks/features/editRows/useGridRowEditing.new.d.ts +4 -0
- package/hooks/features/editRows/useGridRowEditing.new.js +509 -0
- package/hooks/features/editRows/{useGridRowEditing.d.ts → useGridRowEditing.old.d.ts} +0 -0
- package/hooks/features/editRows/{useGridRowEditing.js → useGridRowEditing.old.js} +7 -7
- package/hooks/features/events/useGridEvents.d.ts +1 -1
- package/hooks/features/events/useGridEvents.js +2 -0
- package/hooks/features/filter/gridFilterSelector.d.ts +3 -9
- package/hooks/features/filter/gridFilterState.d.ts +2 -5
- package/hooks/features/filter/useGridFilter.d.ts +1 -1
- package/hooks/features/filter/useGridFilter.js +38 -39
- package/hooks/features/focus/useGridFocus.d.ts +1 -1
- package/hooks/features/focus/useGridFocus.js +47 -1
- package/hooks/features/{keyboard → keyboardNavigation}/useGridKeyboardNavigation.d.ts +3 -5
- package/hooks/features/{keyboard → keyboardNavigation}/useGridKeyboardNavigation.js +66 -13
- package/hooks/features/pagination/gridPaginationSelector.d.ts +1 -3
- package/hooks/features/pagination/useGridPage.js +9 -4
- package/hooks/features/pagination/useGridPageSize.js +3 -3
- package/hooks/features/preferencesPanel/gridPreferencePanelState.d.ts +5 -0
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +18 -5
- package/hooks/features/rows/gridRowsSelector.d.ts +2 -1
- package/hooks/features/rows/gridRowsSelector.js +1 -0
- package/hooks/features/rows/gridRowsState.d.ts +24 -5
- package/hooks/features/rows/gridRowsUtils.d.ts +8 -0
- package/hooks/features/rows/gridRowsUtils.js +11 -0
- package/hooks/features/rows/index.d.ts +1 -0
- package/hooks/features/rows/index.js +1 -1
- package/hooks/features/rows/useGridRows.d.ts +2 -5
- package/hooks/features/rows/useGridRows.js +71 -49
- package/hooks/features/rows/useGridRowsMeta.js +7 -14
- package/hooks/features/rows/useGridRowsPreProcessors.d.ts +3 -0
- package/hooks/features/rows/useGridRowsPreProcessors.js +37 -0
- package/hooks/features/scroll/useGridScroll.d.ts +2 -0
- package/hooks/features/scroll/useGridScroll.js +27 -14
- package/hooks/features/selection/gridSelectionSelector.d.ts +1 -3
- package/hooks/features/selection/useGridSelection.d.ts +4 -2
- package/hooks/features/selection/useGridSelection.js +79 -27
- package/hooks/features/selection/useGridSelectionPreProcessors.js +2 -2
- package/hooks/features/sorting/gridSortingSelector.d.ts +1 -3
- package/hooks/features/sorting/gridSortingState.d.ts +2 -5
- package/hooks/features/sorting/gridSortingUtils.d.ts +1 -2
- package/hooks/features/sorting/useGridSorting.js +18 -37
- package/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +7 -0
- package/hooks/features/virtualization/useGridVirtualScroller.js +59 -30
- package/hooks/utils/useGridRootProps.d.ts +1 -1
- package/hooks/utils/useGridVisibleRows.d.ts +2 -2
- package/index.js +1 -1
- package/internals/index.d.ts +14 -13
- package/internals/index.js +7 -6
- package/legacy/DataGrid/DataGrid.js +35 -2
- package/legacy/DataGrid/useDataGridComponent.js +13 -7
- package/legacy/colDef/gridDateColDef.js +2 -2
- package/legacy/{models/colDef → colDef}/gridDefaultColumnTypes.js +6 -6
- package/legacy/colDef/index.js +2 -1
- package/legacy/components/ErrorOverlay.js +8 -1
- package/legacy/components/GridLoadingOverlay.js +11 -2
- package/legacy/components/GridNoRowsOverlay.js +11 -2
- package/legacy/components/GridRow.js +48 -24
- package/legacy/components/base/GridErrorHandler.js +3 -24
- package/legacy/components/base/GridOverlays.js +4 -3
- package/legacy/components/cell/GridActionsCell.js +188 -27
- package/legacy/components/cell/GridActionsCellItem.js +7 -5
- package/legacy/components/cell/GridCell.js +31 -9
- package/legacy/components/cell/GridEditBooleanCell.js +2 -1
- package/legacy/components/cell/GridEditDateCell.js +2 -1
- package/legacy/components/cell/GridEditInputCell.js +66 -5
- package/legacy/components/cell/GridEditSingleSelectCell.js +109 -24
- package/legacy/components/columnHeaders/{ColumnHeaderFilterIcon.js → GridColumnHeaderFilterIconButton.js} +22 -4
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +9 -12
- package/legacy/components/columnHeaders/GridColumnHeaderTitle.js +1 -1
- package/legacy/components/columnHeaders/GridColumnHeaders.js +5 -4
- package/legacy/components/columnHeaders/index.js +1 -0
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +23 -5
- package/legacy/components/containers/GridOverlay.js +11 -2
- package/legacy/components/containers/GridRoot.js +34 -17
- package/legacy/components/containers/GridRootStyles.js +2 -2
- package/legacy/components/menu/columnMenu/GridColumnMenu.js +1 -1
- package/legacy/components/panel/GridColumnsPanel.js +3 -3
- package/legacy/components/panel/GridPanel.js +1 -0
- package/legacy/components/panel/GridPreferencesPanel.js +4 -6
- package/legacy/components/panel/filterPanel/GridFilterForm.js +14 -10
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +13 -8
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +22 -17
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +22 -17
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +1 -1
- package/legacy/components/virtualization/GridVirtualScroller.js +2 -0
- package/legacy/components/virtualization/GridVirtualScrollerContent.js +1 -3
- package/legacy/constants/defaultGridSlotsComponents.js +2 -1
- package/legacy/constants/gridDetailPanelToggleField.js +2 -0
- package/legacy/hooks/core/{preProcessing/gridPreProcessingApi.js → pipeProcessing/gridPipeProcessingApi.js} +0 -0
- package/legacy/hooks/core/pipeProcessing/index.js +4 -0
- package/legacy/hooks/core/pipeProcessing/useGridPipeProcessing.js +119 -0
- package/legacy/hooks/core/{preProcessing/useGridRegisterPreProcessor.js → pipeProcessing/useGridRegisterPipeApplier.js} +2 -2
- package/legacy/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +27 -0
- package/legacy/hooks/core/{rowGroupsPreProcessing/gridRowGroupsPreProcessingApi.js → strategyProcessing/gridStrategyProcessingApi.js} +0 -0
- package/legacy/hooks/core/strategyProcessing/index.js +3 -0
- package/legacy/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.js +18 -0
- package/legacy/hooks/core/strategyProcessing/useGridStrategyProcessing.js +130 -0
- package/legacy/hooks/core/useGridInitialization.js +4 -4
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +90 -11
- package/legacy/hooks/features/columns/gridColumnsUtils.js +222 -44
- package/legacy/hooks/features/columns/useGridColumnSpanning.js +107 -0
- package/legacy/hooks/features/columns/useGridColumns.js +118 -66
- package/legacy/hooks/features/dimensions/useGridDimensions.js +5 -4
- package/legacy/hooks/features/editRows/useGridCellEditing.new.js +350 -0
- package/legacy/hooks/features/editRows/{useGridCellEditing.js → useGridCellEditing.old.js} +1 -1
- package/legacy/hooks/features/editRows/useGridEditing.new.js +156 -0
- package/legacy/hooks/features/editRows/{useGridEditing.js → useGridEditing.old.js} +4 -4
- package/legacy/hooks/features/editRows/useGridRowEditing.new.js +516 -0
- package/legacy/hooks/features/editRows/{useGridRowEditing.js → useGridRowEditing.old.js} +7 -7
- package/legacy/hooks/features/events/useGridEvents.js +2 -0
- package/legacy/hooks/features/filter/useGridFilter.js +38 -39
- package/legacy/hooks/features/focus/useGridFocus.js +47 -1
- package/legacy/hooks/features/{keyboard → keyboardNavigation}/useGridKeyboardNavigation.js +66 -12
- package/legacy/hooks/features/pagination/useGridPage.js +11 -4
- package/legacy/hooks/features/pagination/useGridPageSize.js +3 -3
- package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +18 -5
- package/legacy/hooks/features/rows/gridRowsSelector.js +3 -0
- package/legacy/hooks/features/rows/gridRowsUtils.js +13 -0
- package/legacy/hooks/features/rows/index.js +1 -1
- package/legacy/hooks/features/rows/useGridRows.js +75 -53
- package/legacy/hooks/features/rows/useGridRowsMeta.js +7 -14
- package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +36 -0
- package/legacy/hooks/features/scroll/useGridScroll.js +27 -14
- package/legacy/hooks/features/selection/useGridSelection.js +81 -27
- package/legacy/hooks/features/selection/useGridSelectionPreProcessors.js +2 -2
- package/legacy/hooks/features/sorting/useGridSorting.js +14 -35
- package/legacy/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +70 -40
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +7 -6
- package/legacy/locales/arSD.js +62 -58
- package/legacy/locales/daDK.js +36 -32
- package/legacy/locales/faIR.js +26 -22
- package/legacy/locales/huHU.js +120 -0
- package/legacy/locales/index.js +1 -0
- package/legacy/locales/koKR.js +1 -1
- package/legacy/locales/plPL.js +30 -26
- package/{modern/hooks/core/preProcessing/gridPreProcessingApi.js → legacy/models/api/gridColumnSpanning.js} +0 -0
- package/legacy/models/colDef/index.js +1 -2
- package/legacy/models/events/gridEvents.js +6 -4
- package/{modern/hooks/core/rowGroupsPreProcessing/gridRowGroupsPreProcessingApi.js → legacy/models/gridColumnSpanning.js} +0 -0
- package/legacy/models/gridEditRowModel.js +1 -0
- package/legacy/models/gridRows.js +1 -33
- package/legacy/models/index.js +2 -2
- package/legacy/models/params/gridEditCellParams.js +34 -1
- package/legacy/models/params/gridPreferencePanelParams.js +1 -0
- package/legacy/models/params/gridRowParams.js +39 -1
- package/legacy/models/params/index.js +2 -1
- package/legacy/utils/cleanupTracking/TimerBasedCleanupTracking.js +5 -1
- package/legacy/utils/utils.js +150 -3
- package/locales/arSD.js +58 -58
- package/locales/daDK.js +32 -32
- package/locales/faIR.js +22 -22
- package/locales/huHU.d.ts +2 -0
- package/locales/huHU.js +108 -0
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/locales/koKR.js +1 -1
- package/locales/plPL.js +26 -26
- package/models/api/gridApiCommon.d.ts +4 -3
- package/models/api/gridColumnSpanning.d.ts +28 -0
- package/models/api/gridColumnSpanning.js +1 -0
- package/models/api/gridEditingApi.d.ts +174 -7
- package/models/api/gridFocusApi.d.ts +9 -0
- package/models/api/gridParamsApi.d.ts +5 -5
- package/models/api/gridRowApi.d.ts +2 -2
- package/models/api/index.d.ts +1 -1
- package/models/colDef/gridColDef.d.ts +42 -28
- package/models/colDef/index.d.ts +0 -1
- package/models/colDef/index.js +1 -2
- package/models/events/gridEventLookup.d.ts +20 -13
- package/models/events/gridEvents.d.ts +22 -14
- package/models/events/gridEvents.js +6 -4
- package/models/gridCell.d.ts +1 -0
- package/models/gridColumnSpanning.d.ts +12 -0
- package/models/gridColumnSpanning.js +1 -0
- package/models/gridEditRowModel.d.ts +4 -3
- package/models/gridEditRowModel.js +1 -0
- package/models/gridFilterOperator.d.ts +3 -2
- package/models/gridRows.d.ts +10 -18
- package/models/gridRows.js +1 -31
- package/models/gridSlotsComponent.d.ts +5 -0
- package/models/gridSlotsComponentsProps.d.ts +1 -0
- package/models/gridSortModel.d.ts +3 -4
- package/models/index.d.ts +1 -1
- package/models/index.js +2 -2
- package/models/params/gridCellParams.d.ts +34 -15
- package/models/params/gridColumnHeaderParams.d.ts +3 -2
- package/models/params/gridEditCellParams.d.ts +52 -3
- package/models/params/gridEditCellParams.js +34 -1
- package/models/params/gridPreferencePanelParams.d.ts +3 -0
- package/models/params/gridPreferencePanelParams.js +1 -0
- package/models/params/gridRowParams.d.ts +51 -7
- package/models/params/gridRowParams.js +39 -1
- package/models/params/gridValueOptionsParams.d.ts +3 -3
- package/models/params/index.d.ts +1 -0
- package/models/params/index.js +2 -1
- package/models/props/DataGridProps.d.ts +45 -13
- package/modern/DataGrid/DataGrid.js +35 -2
- package/modern/DataGrid/useDataGridComponent.js +11 -7
- package/modern/colDef/gridDateColDef.js +2 -2
- package/modern/{models/colDef → colDef}/gridDefaultColumnTypes.js +6 -6
- package/modern/colDef/index.js +2 -1
- package/modern/components/ErrorOverlay.js +8 -1
- package/modern/components/GridLoadingOverlay.js +11 -2
- package/modern/components/GridNoRowsOverlay.js +11 -2
- package/modern/components/GridRow.js +48 -22
- package/modern/components/base/GridErrorHandler.js +1 -20
- package/modern/components/base/GridOverlays.js +4 -3
- package/modern/components/cell/GridActionsCell.js +168 -21
- package/modern/components/cell/GridActionsCellItem.js +7 -5
- package/modern/components/cell/GridCell.js +30 -9
- package/modern/components/cell/GridEditBooleanCell.js +1 -1
- package/modern/components/cell/GridEditDateCell.js +1 -1
- package/modern/components/cell/GridEditInputCell.js +64 -5
- package/modern/components/cell/GridEditSingleSelectCell.js +91 -14
- package/modern/components/columnHeaders/{ColumnHeaderFilterIcon.js → GridColumnHeaderFilterIconButton.js} +22 -4
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +7 -10
- package/modern/components/columnHeaders/GridColumnHeaderTitle.js +1 -1
- package/modern/components/columnHeaders/GridColumnHeaders.js +4 -2
- package/modern/components/columnHeaders/index.js +1 -0
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +22 -5
- package/modern/components/containers/GridOverlay.js +11 -2
- package/modern/components/containers/GridRoot.js +29 -17
- package/modern/components/containers/GridRootStyles.js +2 -2
- package/modern/components/menu/columnMenu/GridColumnMenu.js +1 -1
- package/modern/components/panel/GridColumnsPanel.js +3 -3
- package/modern/components/panel/GridPanel.js +1 -0
- package/modern/components/panel/GridPreferencesPanel.js +3 -5
- package/modern/components/panel/filterPanel/GridFilterForm.js +10 -6
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +11 -6
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +20 -13
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +20 -13
- package/modern/components/toolbar/GridToolbarDensitySelector.js +1 -1
- package/modern/components/virtualization/GridVirtualScroller.js +2 -0
- package/modern/components/virtualization/GridVirtualScrollerContent.js +1 -3
- package/modern/constants/defaultGridSlotsComponents.js +2 -1
- package/modern/constants/gridDetailPanelToggleField.js +2 -0
- package/modern/hooks/core/pipeProcessing/gridPipeProcessingApi.js +1 -0
- package/modern/hooks/core/pipeProcessing/index.js +4 -0
- package/modern/hooks/core/pipeProcessing/useGridPipeProcessing.js +108 -0
- package/modern/hooks/core/{preProcessing/useGridRegisterPreProcessor.js → pipeProcessing/useGridRegisterPipeApplier.js} +2 -2
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +27 -0
- package/modern/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +1 -0
- package/modern/hooks/core/strategyProcessing/index.js +3 -0
- package/modern/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.js +18 -0
- package/modern/hooks/core/strategyProcessing/useGridStrategyProcessing.js +123 -0
- package/modern/hooks/core/useGridInitialization.js +4 -4
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +77 -11
- package/modern/hooks/features/columns/gridColumnsUtils.js +210 -39
- package/modern/hooks/features/columns/useGridColumnSpanning.js +107 -0
- package/modern/hooks/features/columns/useGridColumns.js +112 -62
- package/modern/hooks/features/dimensions/useGridDimensions.js +5 -4
- package/modern/hooks/features/editRows/useGridCellEditing.new.js +338 -0
- package/modern/hooks/features/editRows/{useGridCellEditing.js → useGridCellEditing.old.js} +1 -1
- package/modern/hooks/features/editRows/useGridEditing.new.js +122 -0
- package/modern/hooks/features/editRows/{useGridEditing.js → useGridEditing.old.js} +4 -4
- package/modern/hooks/features/editRows/useGridRowEditing.new.js +507 -0
- package/modern/hooks/features/editRows/{useGridRowEditing.js → useGridRowEditing.old.js} +7 -7
- package/modern/hooks/features/events/useGridEvents.js +2 -0
- package/modern/hooks/features/filter/useGridFilter.js +34 -39
- package/modern/hooks/features/focus/useGridFocus.js +47 -1
- package/modern/hooks/features/{keyboard → keyboardNavigation}/useGridKeyboardNavigation.js +64 -13
- package/modern/hooks/features/pagination/useGridPage.js +9 -4
- package/modern/hooks/features/pagination/useGridPageSize.js +3 -3
- package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +18 -5
- package/modern/hooks/features/rows/gridRowsSelector.js +1 -0
- package/modern/hooks/features/rows/gridRowsUtils.js +11 -0
- package/modern/hooks/features/rows/index.js +1 -1
- package/modern/hooks/features/rows/useGridRows.js +69 -47
- package/modern/hooks/features/rows/useGridRowsMeta.js +7 -14
- package/modern/hooks/features/rows/useGridRowsPreProcessors.js +37 -0
- package/modern/hooks/features/scroll/useGridScroll.js +25 -10
- package/modern/hooks/features/selection/useGridSelection.js +79 -27
- package/modern/hooks/features/selection/useGridSelectionPreProcessors.js +2 -2
- package/modern/hooks/features/sorting/useGridSorting.js +18 -37
- package/modern/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +59 -26
- package/modern/index.js +1 -1
- package/modern/internals/index.js +7 -6
- package/modern/locales/arSD.js +58 -58
- package/modern/locales/daDK.js +32 -32
- package/modern/locales/faIR.js +22 -22
- package/modern/locales/huHU.js +108 -0
- package/modern/locales/index.js +1 -0
- package/modern/locales/koKR.js +1 -1
- package/modern/locales/plPL.js +26 -26
- package/modern/models/api/gridColumnSpanning.js +1 -0
- package/modern/models/colDef/index.js +1 -2
- package/modern/models/events/gridEvents.js +6 -4
- package/modern/models/gridColumnSpanning.js +1 -0
- package/modern/models/gridEditRowModel.js +1 -0
- package/modern/models/gridRows.js +1 -31
- package/modern/models/index.js +2 -2
- package/modern/models/params/gridEditCellParams.js +34 -1
- package/modern/models/params/gridPreferencePanelParams.js +1 -0
- package/modern/models/params/gridRowParams.js +39 -1
- package/modern/models/params/index.js +2 -1
- package/modern/utils/cleanupTracking/TimerBasedCleanupTracking.js +4 -2
- package/modern/utils/utils.js +150 -3
- package/node/DataGrid/DataGrid.js +35 -2
- package/node/DataGrid/useDataGridComponent.js +17 -9
- package/node/colDef/gridDateColDef.js +2 -2
- package/node/{models/colDef → colDef}/gridDefaultColumnTypes.js +6 -6
- package/node/colDef/index.js +13 -0
- package/node/components/ErrorOverlay.js +10 -1
- package/node/components/GridLoadingOverlay.js +10 -1
- package/node/components/GridNoRowsOverlay.js +10 -1
- package/node/components/GridRow.js +51 -24
- package/node/components/base/GridErrorHandler.js +7 -30
- package/node/components/base/GridOverlays.js +3 -2
- package/node/components/cell/GridActionsCell.js +172 -21
- package/node/components/cell/GridActionsCellItem.js +7 -4
- package/node/components/cell/GridCell.js +30 -9
- package/node/components/cell/GridEditBooleanCell.js +1 -1
- package/node/components/cell/GridEditDateCell.js +1 -1
- package/node/components/cell/GridEditInputCell.js +66 -5
- package/node/components/cell/GridEditSingleSelectCell.js +98 -16
- package/node/components/columnHeaders/{ColumnHeaderFilterIcon.js → GridColumnHeaderFilterIconButton.js} +23 -5
- package/node/components/columnHeaders/GridColumnHeaderItem.js +9 -13
- package/node/components/columnHeaders/GridColumnHeaderTitle.js +1 -1
- package/node/components/columnHeaders/GridColumnHeaders.js +4 -2
- package/node/components/columnHeaders/index.js +13 -0
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +22 -5
- package/node/components/containers/GridOverlay.js +10 -1
- package/node/components/containers/GridRoot.js +28 -17
- package/node/components/containers/GridRootStyles.js +2 -2
- package/node/components/menu/columnMenu/GridColumnMenu.js +1 -1
- package/node/components/panel/GridColumnsPanel.js +3 -3
- package/node/components/panel/GridPanel.js +1 -0
- package/node/components/panel/GridPreferencesPanel.js +4 -5
- package/node/components/panel/filterPanel/GridFilterForm.js +15 -10
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +14 -8
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +23 -15
- package/node/components/panel/filterPanel/GridFilterInputValue.js +23 -15
- package/node/components/toolbar/GridToolbarDensitySelector.js +1 -1
- package/node/components/virtualization/GridVirtualScroller.js +2 -0
- package/node/components/virtualization/GridVirtualScrollerContent.js +1 -3
- package/node/constants/defaultGridSlotsComponents.js +1 -0
- package/node/constants/gridDetailPanelToggleField.js +9 -0
- package/node/hooks/core/{preProcessing/gridPreProcessingApi.js → pipeProcessing/gridPipeProcessingApi.js} +0 -0
- package/node/hooks/core/pipeProcessing/index.js +57 -0
- package/node/hooks/core/pipeProcessing/useGridPipeProcessing.js +124 -0
- package/node/hooks/core/{preProcessing/useGridRegisterPreProcessor.js → pipeProcessing/useGridRegisterPipeApplier.js} +4 -4
- package/node/hooks/{features/filter/useGridRegisterFilteringMethod.js → core/pipeProcessing/useGridRegisterPipeProcessor.js} +27 -9
- package/node/hooks/core/{rowGroupsPreProcessing/gridRowGroupsPreProcessingApi.js → strategyProcessing/gridStrategyProcessingApi.js} +0 -0
- package/node/hooks/core/strategyProcessing/index.js +44 -0
- package/node/hooks/{features/sorting/useGridRegisterSortingMethod.js → core/strategyProcessing/useGridRegisterStrategyProcessor.js} +18 -9
- package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +146 -0
- package/node/hooks/core/useGridInitialization.js +4 -4
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +81 -11
- package/node/hooks/features/columns/gridColumnsUtils.js +222 -46
- package/node/hooks/features/columns/useGridColumnSpanning.js +130 -0
- package/node/hooks/features/columns/useGridColumns.js +120 -64
- package/node/hooks/features/dimensions/useGridDimensions.js +5 -4
- package/node/hooks/features/editRows/useGridCellEditing.new.js +359 -0
- package/node/hooks/features/editRows/{useGridCellEditing.js → useGridCellEditing.old.js} +1 -1
- package/node/hooks/features/editRows/useGridEditing.new.js +146 -0
- package/node/hooks/features/editRows/{useGridEditing.js → useGridEditing.old.js} +4 -4
- package/node/hooks/features/editRows/useGridRowEditing.new.js +523 -0
- package/node/hooks/features/editRows/{useGridRowEditing.js → useGridRowEditing.old.js} +6 -6
- package/node/hooks/features/events/useGridEvents.js +2 -0
- package/node/hooks/features/filter/useGridFilter.js +38 -38
- package/node/hooks/features/focus/useGridFocus.js +50 -1
- package/node/hooks/features/{keyboard → keyboardNavigation}/useGridKeyboardNavigation.js +69 -13
- package/node/hooks/features/pagination/useGridPage.js +8 -3
- package/node/hooks/features/pagination/useGridPageSize.js +3 -3
- package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +20 -5
- package/node/hooks/features/rows/gridRowsSelector.js +3 -1
- package/node/hooks/features/rows/gridRowsUtils.js +18 -0
- package/node/hooks/features/rows/index.js +15 -1
- package/node/hooks/features/rows/useGridRows.js +72 -50
- package/node/hooks/features/rows/useGridRowsMeta.js +7 -15
- package/node/hooks/features/rows/useGridRowsPreProcessors.js +46 -0
- package/node/hooks/features/scroll/useGridScroll.js +28 -14
- package/node/hooks/features/selection/useGridSelection.js +79 -26
- package/node/hooks/features/selection/useGridSelectionPreProcessors.js +2 -2
- package/node/hooks/features/sorting/useGridSorting.js +18 -37
- package/node/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +64 -30
- package/node/index.js +1 -1
- package/node/internals/index.js +41 -27
- package/node/locales/arSD.js +58 -58
- package/node/locales/daDK.js +32 -32
- package/node/locales/faIR.js +22 -22
- package/node/locales/huHU.js +118 -0
- package/node/locales/index.js +13 -0
- package/node/locales/koKR.js +1 -1
- package/node/locales/plPL.js +26 -26
- package/node/models/api/gridColumnSpanning.js +5 -0
- package/node/models/colDef/index.js +0 -13
- package/node/models/events/gridEvents.js +6 -4
- package/node/models/gridColumnSpanning.js +5 -0
- package/node/models/gridEditRowModel.js +1 -0
- package/node/models/gridRows.js +1 -34
- package/node/models/index.js +13 -13
- package/node/models/params/gridEditCellParams.js +37 -1
- package/node/models/params/gridPreferencePanelParams.js +5 -0
- package/node/models/params/gridRowParams.js +42 -1
- package/node/models/params/index.js +13 -0
- package/node/utils/cleanupTracking/TimerBasedCleanupTracking.js +4 -2
- package/node/utils/utils.js +152 -11
- package/package.json +4 -4
- package/utils/cleanupTracking/TimerBasedCleanupTracking.d.ts +2 -0
- package/utils/cleanupTracking/TimerBasedCleanupTracking.js +4 -2
- package/utils/domUtils.d.ts +2 -2
- package/utils/utils.d.ts +27 -2
- package/utils/utils.js +150 -3
- package/components/columnHeaders/ColumnHeaderFilterIcon.d.ts +0 -5
- package/hooks/core/preProcessing/gridPreProcessingApi.d.ts +0 -71
- package/hooks/core/preProcessing/index.d.ts +0 -3
- package/hooks/core/preProcessing/index.js +0 -3
- package/hooks/core/preProcessing/useGridPreProcessing.d.ts +0 -3
- package/hooks/core/preProcessing/useGridPreProcessing.js +0 -49
- package/hooks/core/preProcessing/useGridRegisterPreProcessor.d.ts +0 -4
- package/hooks/core/rowGroupsPreProcessing/gridRowGroupsPreProcessingApi.d.ts +0 -35
- package/hooks/core/rowGroupsPreProcessing/index.d.ts +0 -2
- package/hooks/core/rowGroupsPreProcessing/index.js +0 -2
- package/hooks/core/rowGroupsPreProcessing/useGridRowGroupsPreProcessing.d.ts +0 -3
- package/hooks/core/rowGroupsPreProcessing/useGridRowGroupsPreProcessing.js +0 -72
- package/hooks/features/filter/useGridRegisterFilteringMethod.d.ts +0 -4
- package/hooks/features/filter/useGridRegisterFilteringMethod.js +0 -9
- package/hooks/features/keyboard/useGridKeyboard.d.ts +0 -10
- package/hooks/features/keyboard/useGridKeyboard.js +0 -70
- package/hooks/features/sorting/useGridRegisterSortingMethod.d.ts +0 -4
- package/hooks/features/sorting/useGridRegisterSortingMethod.js +0 -9
- package/legacy/hooks/core/preProcessing/index.js +0 -3
- package/legacy/hooks/core/preProcessing/useGridPreProcessing.js +0 -58
- package/legacy/hooks/core/rowGroupsPreProcessing/index.js +0 -2
- package/legacy/hooks/core/rowGroupsPreProcessing/useGridRowGroupsPreProcessing.js +0 -71
- package/legacy/hooks/features/filter/useGridRegisterFilteringMethod.js +0 -9
- package/legacy/hooks/features/keyboard/useGridKeyboard.js +0 -70
- package/legacy/hooks/features/sorting/useGridRegisterSortingMethod.js +0 -9
- package/legacy/lib/lodash/_DataView.js +0 -8
- package/legacy/lib/lodash/_Hash.js +0 -33
- package/legacy/lib/lodash/_ListCache.js +0 -33
- package/legacy/lib/lodash/_Map.js +0 -8
- package/legacy/lib/lodash/_MapCache.js +0 -33
- package/legacy/lib/lodash/_Promise.js +0 -8
- package/legacy/lib/lodash/_Set.js +0 -8
- package/legacy/lib/lodash/_SetCache.js +0 -28
- package/legacy/lib/lodash/_Stack.js +0 -28
- package/legacy/lib/lodash/_Symbol.js +0 -7
- package/legacy/lib/lodash/_Uint8Array.js +0 -7
- package/legacy/lib/lodash/_WeakMap.js +0 -8
- package/legacy/lib/lodash/_arrayFilter.js +0 -29
- package/legacy/lib/lodash/_arrayLikeKeys.js +0 -46
- package/legacy/lib/lodash/_arrayPush.js +0 -23
- package/legacy/lib/lodash/_arraySome.js +0 -26
- package/legacy/lib/lodash/_assocIndexOf.js +0 -25
- package/legacy/lib/lodash/_baseGetAllKeys.js +0 -22
- package/legacy/lib/lodash/_baseGetTag.js +0 -29
- package/legacy/lib/lodash/_baseIsArguments.js +0 -20
- package/legacy/lib/lodash/_baseIsEqual.js +0 -32
- package/legacy/lib/lodash/_baseIsEqualDeep.js +0 -85
- package/legacy/lib/lodash/_baseIsNative.js +0 -47
- package/legacy/lib/lodash/_baseIsTypedArray.js +0 -49
- package/legacy/lib/lodash/_baseKeys.js +0 -35
- package/legacy/lib/lodash/_baseTimes.js +0 -23
- package/legacy/lib/lodash/_baseUnary.js +0 -16
- package/legacy/lib/lodash/_cacheHas.js +0 -15
- package/legacy/lib/lodash/_coreJsData.js +0 -7
- package/legacy/lib/lodash/_equalArrays.js +0 -84
- package/legacy/lib/lodash/_equalByTag.js +0 -117
- package/legacy/lib/lodash/_equalObjects.js +0 -92
- package/legacy/lib/lodash/_freeGlobal.js +0 -6
- package/legacy/lib/lodash/_getAllKeys.js +0 -18
- package/legacy/lib/lodash/_getMapData.js +0 -18
- package/legacy/lib/lodash/_getNative.js +0 -19
- package/legacy/lib/lodash/_getRawTag.js +0 -50
- package/legacy/lib/lodash/_getSymbols.js +0 -32
- package/legacy/lib/lodash/_getTag.js +0 -64
- package/legacy/lib/lodash/_getValue.js +0 -15
- package/legacy/lib/lodash/_hashClear.js +0 -17
- package/legacy/lib/lodash/_hashDelete.js +0 -19
- package/legacy/lib/lodash/_hashGet.js +0 -34
- package/legacy/lib/lodash/_hashHas.js +0 -25
- package/legacy/lib/lodash/_hashSet.js +0 -25
- package/legacy/lib/lodash/_isIndex.js +0 -25
- package/legacy/lib/lodash/_isKeyable.js +0 -18
- package/legacy/lib/lodash/_isMasked.js +0 -23
- package/legacy/lib/lodash/_isPrototype.js +0 -19
- package/legacy/lib/lodash/_listCacheClear.js +0 -15
- package/legacy/lib/lodash/_listCacheDelete.js +0 -40
- package/legacy/lib/lodash/_listCacheGet.js +0 -20
- package/legacy/lib/lodash/_listCacheHas.js +0 -18
- package/legacy/lib/lodash/_listCacheSet.js +0 -29
- package/legacy/lib/lodash/_mapCacheClear.js +0 -23
- package/legacy/lib/lodash/_mapCacheDelete.js +0 -20
- package/legacy/lib/lodash/_mapCacheGet.js +0 -18
- package/legacy/lib/lodash/_mapCacheHas.js +0 -18
- package/legacy/lib/lodash/_mapCacheSet.js +0 -23
- package/legacy/lib/lodash/_mapToArray.js +0 -19
- package/legacy/lib/lodash/_nativeCreate.js +0 -7
- package/legacy/lib/lodash/_nativeKeys.js +0 -7
- package/legacy/lib/lodash/_nodeUtil.js +0 -25
- package/legacy/lib/lodash/_objectToString.js +0 -24
- package/legacy/lib/lodash/_overArg.js +0 -17
- package/legacy/lib/lodash/_root.js +0 -11
- package/legacy/lib/lodash/_setCacheAdd.js +0 -22
- package/legacy/lib/lodash/_setCacheHas.js +0 -16
- package/legacy/lib/lodash/_setToArray.js +0 -19
- package/legacy/lib/lodash/_stackClear.js +0 -17
- package/legacy/lib/lodash/_stackDelete.js +0 -19
- package/legacy/lib/lodash/_stackGet.js +0 -16
- package/legacy/lib/lodash/_stackHas.js +0 -16
- package/legacy/lib/lodash/_stackSet.js +0 -40
- package/legacy/lib/lodash/_toSource.js +0 -30
- package/legacy/lib/lodash/date.default.js +0 -4
- package/legacy/lib/lodash/date.js +0 -2
- package/legacy/lib/lodash/eq.js +0 -39
- package/legacy/lib/lodash/function.default.js +0 -4
- package/legacy/lib/lodash/function.js +0 -2
- package/legacy/lib/lodash/isArguments.js +0 -38
- package/legacy/lib/lodash/isArray.js +0 -27
- package/legacy/lib/lodash/isArrayLike.js +0 -35
- package/legacy/lib/lodash/isBuffer.js +0 -40
- package/legacy/lib/lodash/isDeepEqual.js +0 -45
- package/legacy/lib/lodash/isFunction.js +0 -40
- package/legacy/lib/lodash/isLength.js +0 -36
- package/legacy/lib/lodash/isObject.js +0 -36
- package/legacy/lib/lodash/isObjectLike.js +0 -33
- package/legacy/lib/lodash/isSymbol.js +0 -31
- package/legacy/lib/lodash/isTypedArray.js +0 -28
- package/legacy/lib/lodash/keys.js +0 -39
- package/legacy/lib/lodash/lang.default.js +0 -28
- package/legacy/lib/lodash/lang.js +0 -14
- package/legacy/lib/lodash/now.js +0 -25
- package/legacy/lib/lodash/object.default.js +0 -4
- package/legacy/lib/lodash/object.js +0 -2
- package/legacy/lib/lodash/stubArray.js +0 -25
- package/legacy/lib/lodash/stubFalse.js +0 -20
- package/legacy/lib/lodash/toNumber.js +0 -70
- package/legacy/lib/lodash/util.default.js +0 -6
- package/legacy/lib/lodash/util.js +0 -3
- package/lib/lodash/_DataView.d.ts +0 -2
- package/lib/lodash/_DataView.js +0 -8
- package/lib/lodash/_Hash.d.ts +0 -29
- package/lib/lodash/_Hash.js +0 -33
- package/lib/lodash/_ListCache.d.ts +0 -29
- package/lib/lodash/_ListCache.js +0 -33
- package/lib/lodash/_Map.d.ts +0 -2
- package/lib/lodash/_Map.js +0 -8
- package/lib/lodash/_MapCache.d.ts +0 -29
- package/lib/lodash/_MapCache.js +0 -33
- package/lib/lodash/_Promise.d.ts +0 -2
- package/lib/lodash/_Promise.js +0 -8
- package/lib/lodash/_Set.d.ts +0 -2
- package/lib/lodash/_Set.js +0 -8
- package/lib/lodash/_SetCache.d.ts +0 -28
- package/lib/lodash/_SetCache.js +0 -28
- package/lib/lodash/_Stack.d.ts +0 -32
- package/lib/lodash/_Stack.js +0 -28
- package/lib/lodash/_Symbol.d.ts +0 -3
- package/lib/lodash/_Symbol.js +0 -7
- package/lib/lodash/_Uint8Array.d.ts +0 -3
- package/lib/lodash/_Uint8Array.js +0 -7
- package/lib/lodash/_WeakMap.d.ts +0 -2
- package/lib/lodash/_WeakMap.js +0 -8
- package/lib/lodash/_arrayFilter.d.ts +0 -11
- package/lib/lodash/_arrayFilter.js +0 -29
- package/lib/lodash/_arrayLikeKeys.d.ts +0 -10
- package/lib/lodash/_arrayLikeKeys.js +0 -46
- package/lib/lodash/_arrayPush.d.ts +0 -10
- package/lib/lodash/_arrayPush.js +0 -23
- package/lib/lodash/_arraySome.d.ts +0 -12
- package/lib/lodash/_arraySome.js +0 -26
- package/lib/lodash/_assocIndexOf.d.ts +0 -10
- package/lib/lodash/_assocIndexOf.js +0 -25
- package/lib/lodash/_baseGetAllKeys.d.ts +0 -13
- package/lib/lodash/_baseGetAllKeys.js +0 -22
- package/lib/lodash/_baseGetTag.d.ts +0 -9
- package/lib/lodash/_baseGetTag.js +0 -29
- package/lib/lodash/_baseIsArguments.d.ts +0 -9
- package/lib/lodash/_baseIsArguments.js +0 -20
- package/lib/lodash/_baseIsEqual.d.ts +0 -16
- package/lib/lodash/_baseIsEqual.js +0 -32
- package/lib/lodash/_baseIsEqualDeep.d.ts +0 -16
- package/lib/lodash/_baseIsEqualDeep.js +0 -85
- package/lib/lodash/_baseIsNative.d.ts +0 -10
- package/lib/lodash/_baseIsNative.js +0 -47
- package/lib/lodash/_baseIsTypedArray.d.ts +0 -9
- package/lib/lodash/_baseIsTypedArray.js +0 -49
- package/lib/lodash/_baseKeys.d.ts +0 -9
- package/lib/lodash/_baseKeys.js +0 -35
- package/lib/lodash/_baseTimes.d.ts +0 -11
- package/lib/lodash/_baseTimes.js +0 -23
- package/lib/lodash/_baseUnary.d.ts +0 -9
- package/lib/lodash/_baseUnary.js +0 -16
- package/lib/lodash/_cacheHas.d.ts +0 -10
- package/lib/lodash/_cacheHas.js +0 -15
- package/lib/lodash/_coreJsData.d.ts +0 -3
- package/lib/lodash/_coreJsData.js +0 -7
- package/lib/lodash/_equalArrays.d.ts +0 -15
- package/lib/lodash/_equalArrays.js +0 -84
- package/lib/lodash/_equalByTag.d.ts +0 -19
- package/lib/lodash/_equalByTag.js +0 -117
- package/lib/lodash/_equalObjects.d.ts +0 -15
- package/lib/lodash/_equalObjects.js +0 -92
- package/lib/lodash/_freeGlobal.d.ts +0 -3
- package/lib/lodash/_freeGlobal.js +0 -5
- package/lib/lodash/_getAllKeys.d.ts +0 -9
- package/lib/lodash/_getAllKeys.js +0 -18
- package/lib/lodash/_getMapData.d.ts +0 -10
- package/lib/lodash/_getMapData.js +0 -18
- package/lib/lodash/_getNative.d.ts +0 -10
- package/lib/lodash/_getNative.js +0 -19
- package/lib/lodash/_getRawTag.d.ts +0 -9
- package/lib/lodash/_getRawTag.js +0 -50
- package/lib/lodash/_getSymbols.d.ts +0 -2
- package/lib/lodash/_getSymbols.js +0 -32
- package/lib/lodash/_getTag.d.ts +0 -10
- package/lib/lodash/_getTag.js +0 -64
- package/lib/lodash/_getValue.d.ts +0 -10
- package/lib/lodash/_getValue.js +0 -15
- package/lib/lodash/_hashClear.d.ts +0 -13
- package/lib/lodash/_hashClear.js +0 -17
- package/lib/lodash/_hashDelete.d.ts +0 -12
- package/lib/lodash/_hashDelete.js +0 -19
- package/lib/lodash/_hashGet.d.ts +0 -11
- package/lib/lodash/_hashGet.js +0 -34
- package/lib/lodash/_hashHas.d.ts +0 -11
- package/lib/lodash/_hashHas.js +0 -25
- package/lib/lodash/_hashSet.d.ts +0 -12
- package/lib/lodash/_hashSet.js +0 -25
- package/lib/lodash/_isIndex.d.ts +0 -10
- package/lib/lodash/_isIndex.js +0 -23
- package/lib/lodash/_isKeyable.d.ts +0 -9
- package/lib/lodash/_isKeyable.js +0 -15
- package/lib/lodash/_isMasked.d.ts +0 -9
- package/lib/lodash/_isMasked.js +0 -23
- package/lib/lodash/_isPrototype.d.ts +0 -9
- package/lib/lodash/_isPrototype.js +0 -19
- package/lib/lodash/_listCacheClear.d.ts +0 -13
- package/lib/lodash/_listCacheClear.js +0 -15
- package/lib/lodash/_listCacheDelete.d.ts +0 -11
- package/lib/lodash/_listCacheDelete.js +0 -40
- package/lib/lodash/_listCacheGet.d.ts +0 -11
- package/lib/lodash/_listCacheGet.js +0 -20
- package/lib/lodash/_listCacheHas.d.ts +0 -11
- package/lib/lodash/_listCacheHas.js +0 -18
- package/lib/lodash/_listCacheSet.d.ts +0 -12
- package/lib/lodash/_listCacheSet.js +0 -29
- package/lib/lodash/_mapCacheClear.d.ts +0 -18
- package/lib/lodash/_mapCacheClear.js +0 -23
- package/lib/lodash/_mapCacheDelete.d.ts +0 -11
- package/lib/lodash/_mapCacheDelete.js +0 -20
- package/lib/lodash/_mapCacheGet.d.ts +0 -11
- package/lib/lodash/_mapCacheGet.js +0 -18
- package/lib/lodash/_mapCacheHas.d.ts +0 -11
- package/lib/lodash/_mapCacheHas.js +0 -18
- package/lib/lodash/_mapCacheSet.d.ts +0 -12
- package/lib/lodash/_mapCacheSet.js +0 -23
- package/lib/lodash/_mapToArray.d.ts +0 -9
- package/lib/lodash/_mapToArray.js +0 -19
- package/lib/lodash/_nativeCreate.d.ts +0 -2
- package/lib/lodash/_nativeCreate.js +0 -7
- package/lib/lodash/_nativeKeys.d.ts +0 -2
- package/lib/lodash/_nativeKeys.js +0 -7
- package/lib/lodash/_nodeUtil.d.ts +0 -3
- package/lib/lodash/_nodeUtil.js +0 -24
- package/lib/lodash/_objectToString.d.ts +0 -9
- package/lib/lodash/_objectToString.js +0 -24
- package/lib/lodash/_overArg.d.ts +0 -10
- package/lib/lodash/_overArg.js +0 -17
- package/lib/lodash/_root.d.ts +0 -3
- package/lib/lodash/_root.js +0 -10
- package/lib/lodash/_setCacheAdd.d.ts +0 -12
- package/lib/lodash/_setCacheAdd.js +0 -22
- package/lib/lodash/_setCacheHas.d.ts +0 -11
- package/lib/lodash/_setCacheHas.js +0 -16
- package/lib/lodash/_setToArray.d.ts +0 -9
- package/lib/lodash/_setToArray.js +0 -19
- package/lib/lodash/_stackClear.d.ts +0 -14
- package/lib/lodash/_stackClear.js +0 -17
- package/lib/lodash/_stackDelete.d.ts +0 -24
- package/lib/lodash/_stackDelete.js +0 -19
- package/lib/lodash/_stackGet.d.ts +0 -11
- package/lib/lodash/_stackGet.js +0 -16
- package/lib/lodash/_stackHas.d.ts +0 -11
- package/lib/lodash/_stackHas.js +0 -16
- package/lib/lodash/_stackSet.d.ts +0 -28
- package/lib/lodash/_stackSet.js +0 -40
- package/lib/lodash/_toSource.d.ts +0 -9
- package/lib/lodash/_toSource.js +0 -30
- package/lib/lodash/date.d.ts +0 -2
- package/lib/lodash/date.default.d.ts +0 -5
- package/lib/lodash/date.default.js +0 -4
- package/lib/lodash/date.js +0 -2
- package/lib/lodash/eq.d.ts +0 -34
- package/lib/lodash/eq.js +0 -39
- package/lib/lodash/function.d.ts +0 -1
- package/lib/lodash/function.default.d.ts +0 -4
- package/lib/lodash/function.default.js +0 -4
- package/lib/lodash/function.js +0 -2
- package/lib/lodash/isArguments.d.ts +0 -2
- package/lib/lodash/isArguments.js +0 -38
- package/lib/lodash/isArray.d.ts +0 -25
- package/lib/lodash/isArray.js +0 -27
- package/lib/lodash/isArrayLike.d.ts +0 -27
- package/lib/lodash/isArrayLike.js +0 -35
- package/lib/lodash/isBuffer.d.ts +0 -19
- package/lib/lodash/isBuffer.js +0 -39
- package/lib/lodash/isDeepEqual.d.ts +0 -30
- package/lib/lodash/isDeepEqual.js +0 -45
- package/lib/lodash/isFunction.d.ts +0 -19
- package/lib/lodash/isFunction.js +0 -40
- package/lib/lodash/isLength.d.ts +0 -28
- package/lib/lodash/isLength.js +0 -36
- package/lib/lodash/isObject.d.ts +0 -27
- package/lib/lodash/isObject.js +0 -33
- package/lib/lodash/isObjectLike.d.ts +0 -26
- package/lib/lodash/isObjectLike.js +0 -31
- package/lib/lodash/isSymbol.d.ts +0 -19
- package/lib/lodash/isSymbol.js +0 -30
- package/lib/lodash/isTypedArray.d.ts +0 -19
- package/lib/lodash/isTypedArray.js +0 -28
- package/lib/lodash/keys.d.ts +0 -30
- package/lib/lodash/keys.js +0 -39
- package/lib/lodash/lang.d.ts +0 -14
- package/lib/lodash/lang.default.d.ts +0 -29
- package/lib/lodash/lang.default.js +0 -28
- package/lib/lodash/lang.js +0 -14
- package/lib/lodash/now.d.ts +0 -18
- package/lib/lodash/now.js +0 -25
- package/lib/lodash/object.d.ts +0 -2
- package/lib/lodash/object.default.d.ts +0 -5
- package/lib/lodash/object.default.js +0 -4
- package/lib/lodash/object.js +0 -2
- package/lib/lodash/stubArray.d.ts +0 -20
- package/lib/lodash/stubArray.js +0 -25
- package/lib/lodash/stubFalse.d.ts +0 -15
- package/lib/lodash/stubFalse.js +0 -20
- package/lib/lodash/toNumber.d.ts +0 -25
- package/lib/lodash/toNumber.js +0 -70
- package/lib/lodash/util.d.ts +0 -3
- package/lib/lodash/util.default.d.ts +0 -7
- package/lib/lodash/util.default.js +0 -6
- package/lib/lodash/util.js +0 -3
- package/modern/hooks/core/preProcessing/index.js +0 -3
- package/modern/hooks/core/preProcessing/useGridPreProcessing.js +0 -49
- package/modern/hooks/core/rowGroupsPreProcessing/index.js +0 -2
- package/modern/hooks/core/rowGroupsPreProcessing/useGridRowGroupsPreProcessing.js +0 -70
- package/modern/hooks/features/filter/useGridRegisterFilteringMethod.js +0 -9
- package/modern/hooks/features/keyboard/useGridKeyboard.js +0 -70
- package/modern/hooks/features/sorting/useGridRegisterSortingMethod.js +0 -9
- package/modern/lib/lodash/_DataView.js +0 -8
- package/modern/lib/lodash/_Hash.js +0 -33
- package/modern/lib/lodash/_ListCache.js +0 -33
- package/modern/lib/lodash/_Map.js +0 -8
- package/modern/lib/lodash/_MapCache.js +0 -33
- package/modern/lib/lodash/_Promise.js +0 -8
- package/modern/lib/lodash/_Set.js +0 -8
- package/modern/lib/lodash/_SetCache.js +0 -28
- package/modern/lib/lodash/_Stack.js +0 -28
- package/modern/lib/lodash/_Symbol.js +0 -7
- package/modern/lib/lodash/_Uint8Array.js +0 -7
- package/modern/lib/lodash/_WeakMap.js +0 -8
- package/modern/lib/lodash/_arrayFilter.js +0 -29
- package/modern/lib/lodash/_arrayLikeKeys.js +0 -46
- package/modern/lib/lodash/_arrayPush.js +0 -23
- package/modern/lib/lodash/_arraySome.js +0 -26
- package/modern/lib/lodash/_assocIndexOf.js +0 -25
- package/modern/lib/lodash/_baseGetAllKeys.js +0 -22
- package/modern/lib/lodash/_baseGetTag.js +0 -29
- package/modern/lib/lodash/_baseIsArguments.js +0 -20
- package/modern/lib/lodash/_baseIsEqual.js +0 -32
- package/modern/lib/lodash/_baseIsEqualDeep.js +0 -85
- package/modern/lib/lodash/_baseIsNative.js +0 -47
- package/modern/lib/lodash/_baseIsTypedArray.js +0 -49
- package/modern/lib/lodash/_baseKeys.js +0 -35
- package/modern/lib/lodash/_baseTimes.js +0 -23
- package/modern/lib/lodash/_baseUnary.js +0 -16
- package/modern/lib/lodash/_cacheHas.js +0 -15
- package/modern/lib/lodash/_coreJsData.js +0 -7
- package/modern/lib/lodash/_equalArrays.js +0 -84
- package/modern/lib/lodash/_equalByTag.js +0 -117
- package/modern/lib/lodash/_equalObjects.js +0 -92
- package/modern/lib/lodash/_freeGlobal.js +0 -5
- package/modern/lib/lodash/_getAllKeys.js +0 -18
- package/modern/lib/lodash/_getMapData.js +0 -18
- package/modern/lib/lodash/_getNative.js +0 -19
- package/modern/lib/lodash/_getRawTag.js +0 -50
- package/modern/lib/lodash/_getSymbols.js +0 -32
- package/modern/lib/lodash/_getTag.js +0 -64
- package/modern/lib/lodash/_getValue.js +0 -15
- package/modern/lib/lodash/_hashClear.js +0 -17
- package/modern/lib/lodash/_hashDelete.js +0 -19
- package/modern/lib/lodash/_hashGet.js +0 -34
- package/modern/lib/lodash/_hashHas.js +0 -25
- package/modern/lib/lodash/_hashSet.js +0 -25
- package/modern/lib/lodash/_isIndex.js +0 -23
- package/modern/lib/lodash/_isKeyable.js +0 -15
- package/modern/lib/lodash/_isMasked.js +0 -23
- package/modern/lib/lodash/_isPrototype.js +0 -19
- package/modern/lib/lodash/_listCacheClear.js +0 -15
- package/modern/lib/lodash/_listCacheDelete.js +0 -40
- package/modern/lib/lodash/_listCacheGet.js +0 -20
- package/modern/lib/lodash/_listCacheHas.js +0 -18
- package/modern/lib/lodash/_listCacheSet.js +0 -29
- package/modern/lib/lodash/_mapCacheClear.js +0 -23
- package/modern/lib/lodash/_mapCacheDelete.js +0 -20
- package/modern/lib/lodash/_mapCacheGet.js +0 -18
- package/modern/lib/lodash/_mapCacheHas.js +0 -18
- package/modern/lib/lodash/_mapCacheSet.js +0 -23
- package/modern/lib/lodash/_mapToArray.js +0 -19
- package/modern/lib/lodash/_nativeCreate.js +0 -7
- package/modern/lib/lodash/_nativeKeys.js +0 -7
- package/modern/lib/lodash/_nodeUtil.js +0 -24
- package/modern/lib/lodash/_objectToString.js +0 -24
- package/modern/lib/lodash/_overArg.js +0 -17
- package/modern/lib/lodash/_root.js +0 -10
- package/modern/lib/lodash/_setCacheAdd.js +0 -22
- package/modern/lib/lodash/_setCacheHas.js +0 -16
- package/modern/lib/lodash/_setToArray.js +0 -19
- package/modern/lib/lodash/_stackClear.js +0 -17
- package/modern/lib/lodash/_stackDelete.js +0 -19
- package/modern/lib/lodash/_stackGet.js +0 -16
- package/modern/lib/lodash/_stackHas.js +0 -16
- package/modern/lib/lodash/_stackSet.js +0 -40
- package/modern/lib/lodash/_toSource.js +0 -30
- package/modern/lib/lodash/date.default.js +0 -4
- package/modern/lib/lodash/date.js +0 -2
- package/modern/lib/lodash/eq.js +0 -39
- package/modern/lib/lodash/function.default.js +0 -4
- package/modern/lib/lodash/function.js +0 -2
- package/modern/lib/lodash/isArguments.js +0 -38
- package/modern/lib/lodash/isArray.js +0 -27
- package/modern/lib/lodash/isArrayLike.js +0 -35
- package/modern/lib/lodash/isBuffer.js +0 -39
- package/modern/lib/lodash/isDeepEqual.js +0 -45
- package/modern/lib/lodash/isFunction.js +0 -40
- package/modern/lib/lodash/isLength.js +0 -36
- package/modern/lib/lodash/isObject.js +0 -33
- package/modern/lib/lodash/isObjectLike.js +0 -31
- package/modern/lib/lodash/isSymbol.js +0 -30
- package/modern/lib/lodash/isTypedArray.js +0 -28
- package/modern/lib/lodash/keys.js +0 -39
- package/modern/lib/lodash/lang.default.js +0 -28
- package/modern/lib/lodash/lang.js +0 -14
- package/modern/lib/lodash/now.js +0 -25
- package/modern/lib/lodash/object.default.js +0 -4
- package/modern/lib/lodash/object.js +0 -2
- package/modern/lib/lodash/stubArray.js +0 -25
- package/modern/lib/lodash/stubFalse.js +0 -20
- package/modern/lib/lodash/toNumber.js +0 -70
- package/modern/lib/lodash/util.default.js +0 -6
- package/modern/lib/lodash/util.js +0 -3
- package/node/hooks/core/preProcessing/index.js +0 -44
- package/node/hooks/core/preProcessing/useGridPreProcessing.js +0 -69
- package/node/hooks/core/rowGroupsPreProcessing/index.js +0 -31
- package/node/hooks/core/rowGroupsPreProcessing/useGridRowGroupsPreProcessing.js +0 -87
- package/node/hooks/features/keyboard/useGridKeyboard.js +0 -91
- package/node/lib/lodash/_DataView.js +0 -20
- package/node/lib/lodash/_Hash.js +0 -48
- package/node/lib/lodash/_ListCache.js +0 -48
- package/node/lib/lodash/_Map.js +0 -20
- package/node/lib/lodash/_MapCache.js +0 -48
- package/node/lib/lodash/_Promise.js +0 -20
- package/node/lib/lodash/_Set.js +0 -20
- package/node/lib/lodash/_SetCache.js +0 -41
- package/node/lib/lodash/_Stack.js +0 -44
- package/node/lib/lodash/_Symbol.js +0 -18
- package/node/lib/lodash/_Uint8Array.js +0 -18
- package/node/lib/lodash/_WeakMap.js +0 -20
- package/node/lib/lodash/_arrayFilter.js +0 -35
- package/node/lib/lodash/_arrayLikeKeys.js +0 -62
- package/node/lib/lodash/_arrayPush.js +0 -29
- package/node/lib/lodash/_arraySome.js +0 -32
- package/node/lib/lodash/_assocIndexOf.js +0 -36
- package/node/lib/lodash/_baseGetAllKeys.js +0 -34
- package/node/lib/lodash/_baseGetTag.js +0 -42
- package/node/lib/lodash/_baseIsArguments.js +0 -32
- package/node/lib/lodash/_baseIsEqual.js +0 -44
- package/node/lib/lodash/_baseIsEqualDeep.js +0 -103
- package/node/lib/lodash/_baseIsNative.js +0 -61
- package/node/lib/lodash/_baseIsTypedArray.js +0 -62
- package/node/lib/lodash/_baseKeys.js +0 -47
- package/node/lib/lodash/_baseTimes.js +0 -29
- package/node/lib/lodash/_baseUnary.js +0 -22
- package/node/lib/lodash/_cacheHas.js +0 -21
- package/node/lib/lodash/_coreJsData.js +0 -18
- package/node/lib/lodash/_equalArrays.js +0 -97
- package/node/lib/lodash/_equalByTag.js +0 -133
- package/node/lib/lodash/_equalObjects.js +0 -103
- package/node/lib/lodash/_freeGlobal.js +0 -10
- package/node/lib/lodash/_getAllKeys.js +0 -31
- package/node/lib/lodash/_getMapData.js +0 -29
- package/node/lib/lodash/_getNative.js +0 -31
- package/node/lib/lodash/_getRawTag.js +0 -61
- package/node/lib/lodash/_getSymbols.js +0 -44
- package/node/lib/lodash/_getTag.js +0 -81
- package/node/lib/lodash/_getValue.js +0 -21
- package/node/lib/lodash/_hashClear.js +0 -28
- package/node/lib/lodash/_hashDelete.js +0 -25
- package/node/lib/lodash/_hashGet.js +0 -45
- package/node/lib/lodash/_hashHas.js +0 -36
- package/node/lib/lodash/_hashSet.js +0 -36
- package/node/lib/lodash/_isIndex.js +0 -28
- package/node/lib/lodash/_isKeyable.js +0 -21
- package/node/lib/lodash/_isMasked.js +0 -34
- package/node/lib/lodash/_isPrototype.js +0 -24
- package/node/lib/lodash/_listCacheClear.js +0 -21
- package/node/lib/lodash/_listCacheDelete.js +0 -51
- package/node/lib/lodash/_listCacheGet.js +0 -31
- package/node/lib/lodash/_listCacheHas.js +0 -29
- package/node/lib/lodash/_listCacheSet.js +0 -40
- package/node/lib/lodash/_mapCacheClear.js +0 -36
- package/node/lib/lodash/_mapCacheDelete.js +0 -31
- package/node/lib/lodash/_mapCacheGet.js +0 -29
- package/node/lib/lodash/_mapCacheHas.js +0 -29
- package/node/lib/lodash/_mapCacheSet.js +0 -34
- package/node/lib/lodash/_mapToArray.js +0 -25
- package/node/lib/lodash/_nativeCreate.js +0 -18
- package/node/lib/lodash/_nativeKeys.js +0 -18
- package/node/lib/lodash/_nodeUtil.js +0 -35
- package/node/lib/lodash/_objectToString.js +0 -29
- package/node/lib/lodash/_overArg.js +0 -23
- package/node/lib/lodash/_root.js +0 -21
- package/node/lib/lodash/_setCacheAdd.js +0 -27
- package/node/lib/lodash/_setCacheHas.js +0 -22
- package/node/lib/lodash/_setToArray.js +0 -25
- package/node/lib/lodash/_stackClear.js +0 -28
- package/node/lib/lodash/_stackDelete.js +0 -25
- package/node/lib/lodash/_stackGet.js +0 -22
- package/node/lib/lodash/_stackHas.js +0 -22
- package/node/lib/lodash/_stackSet.js +0 -53
- package/node/lib/lodash/_toSource.js +0 -35
- package/node/lib/lodash/date.default.js +0 -15
- package/node/lib/lodash/date.js +0 -23
- package/node/lib/lodash/eq.js +0 -45
- package/node/lib/lodash/function.default.js +0 -15
- package/node/lib/lodash/function.js +0 -23
- package/node/lib/lodash/isArguments.js +0 -50
- package/node/lib/lodash/isArray.js +0 -32
- package/node/lib/lodash/isArrayLike.js +0 -47
- package/node/lib/lodash/isBuffer.js +0 -51
- package/node/lib/lodash/isDeepEqual.js +0 -56
- package/node/lib/lodash/isFunction.js +0 -52
- package/node/lib/lodash/isLength.js +0 -41
- package/node/lib/lodash/isObject.js +0 -39
- package/node/lib/lodash/isObjectLike.js +0 -37
- package/node/lib/lodash/isSymbol.js +0 -42
- package/node/lib/lodash/isTypedArray.js +0 -41
- package/node/lib/lodash/keys.js +0 -52
- package/node/lib/lodash/lang.default.js +0 -51
- package/node/lib/lodash/lang.js +0 -119
- package/node/lib/lodash/now.js +0 -36
- package/node/lib/lodash/object.default.js +0 -15
- package/node/lib/lodash/object.js +0 -23
- package/node/lib/lodash/stubArray.js +0 -31
- package/node/lib/lodash/stubFalse.js +0 -26
- package/node/lib/lodash/toNumber.js +0 -82
- package/node/lib/lodash/util.default.js +0 -18
- package/node/lib/lodash/util.js +0 -31
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
+
import _toPropertyKey from "@babel/runtime/helpers/esm/toPropertyKey";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { useGridApiMethod } from '../../utils/useGridApiMethod';
|
|
5
|
+
import { GridEvents } from '../../../models/events';
|
|
6
|
+
export const GRID_DEFAULT_STRATEGY = 'none';
|
|
7
|
+
export const GRID_STRATEGIES_PROCESSORS = {
|
|
8
|
+
rowTreeCreation: 'rowTree',
|
|
9
|
+
filtering: 'rowTree',
|
|
10
|
+
sorting: 'rowTree'
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Implements a variant of the Strategy Pattern (see https://en.wikipedia.org/wiki/Strategy_pattern)
|
|
15
|
+
*
|
|
16
|
+
* More information and detailed example in (TODO add link to technical doc when ready)
|
|
17
|
+
*
|
|
18
|
+
* Some plugins contains custom logic that must only be applied if the right strategy is active.
|
|
19
|
+
* For instance, the row grouping plugin has a custom filtering algorithm.
|
|
20
|
+
* This algorithm must be applied by the filtering plugin if the row grouping is the current way of grouping rows,
|
|
21
|
+
* but not if the tree data is the current way of grouping rows.
|
|
22
|
+
*
|
|
23
|
+
* =====================================================================================================================
|
|
24
|
+
*
|
|
25
|
+
* The plugin containing the custom logic must use:
|
|
26
|
+
*
|
|
27
|
+
* - `useGridRegisterStrategyProcessor` to register their processor.
|
|
28
|
+
* When the processor of the active strategy changes, it will fire `GridEvents.activeStrategyProcessorChange` to re-apply the processor.
|
|
29
|
+
*
|
|
30
|
+
* - `apiRef.current.unstable_setStrategyAvailability` to tell if their strategy can be used.
|
|
31
|
+
*
|
|
32
|
+
* =====================================================================================================================
|
|
33
|
+
*
|
|
34
|
+
* The plugin or component that needs to apply the custom logic of the current strategy must use:
|
|
35
|
+
*
|
|
36
|
+
* - `apiRef.current.unstable_applyStrategyProcessor` to run the processor of the active strategy for a given processor name.
|
|
37
|
+
*
|
|
38
|
+
* - `GridEvents.strategyAvailabilityChange` to update something when the active strategy changes.
|
|
39
|
+
* Warning: Be careful not to apply the processor several times.
|
|
40
|
+
* For instance `GridEvents.rowsSet` is fired by `useGridRows` whenever the active strategy changes.
|
|
41
|
+
* So listening to both would most likely run your logic twice.
|
|
42
|
+
*
|
|
43
|
+
* - `GridEvents.activeStrategyProcessorChange` to update something when the processor of the active strategy changes.
|
|
44
|
+
*
|
|
45
|
+
* =====================================================================================================================
|
|
46
|
+
*
|
|
47
|
+
* Each processor name is part of a strategy group which can only have one active strategy at the time.
|
|
48
|
+
* For now, there is only one strategy group named `rowTree` which customize
|
|
49
|
+
* - row tree creation algorithm.
|
|
50
|
+
* - sorting algorithm.
|
|
51
|
+
* - filtering algorithm.
|
|
52
|
+
*/
|
|
53
|
+
export const useGridStrategyProcessing = apiRef => {
|
|
54
|
+
const availableStrategies = React.useRef(new Map());
|
|
55
|
+
const strategiesCache = React.useRef({});
|
|
56
|
+
const registerStrategyProcessor = React.useCallback((strategyName, processorName, processor) => {
|
|
57
|
+
const cleanup = () => {
|
|
58
|
+
const _ref = strategiesCache.current[processorName],
|
|
59
|
+
otherProcessors = _objectWithoutPropertiesLoose(_ref, [strategyName].map(_toPropertyKey));
|
|
60
|
+
|
|
61
|
+
strategiesCache.current[processorName] = otherProcessors;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
if (!strategiesCache.current[processorName]) {
|
|
65
|
+
strategiesCache.current[processorName] = {};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const groupPreProcessors = strategiesCache.current[processorName];
|
|
69
|
+
const previousProcessor = groupPreProcessors[strategyName];
|
|
70
|
+
groupPreProcessors[strategyName] = processor;
|
|
71
|
+
|
|
72
|
+
if (!previousProcessor || previousProcessor === processor) {
|
|
73
|
+
return cleanup;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (strategyName === apiRef.current.unstable_getActiveStrategy(GRID_STRATEGIES_PROCESSORS[processorName])) {
|
|
77
|
+
apiRef.current.publishEvent(GridEvents.activeStrategyProcessorChange, processorName);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return cleanup;
|
|
81
|
+
}, [apiRef]);
|
|
82
|
+
const applyStrategyProcessor = React.useCallback((processorName, params) => {
|
|
83
|
+
const activeStrategy = apiRef.current.unstable_getActiveStrategy(GRID_STRATEGIES_PROCESSORS[processorName]);
|
|
84
|
+
|
|
85
|
+
if (activeStrategy == null) {
|
|
86
|
+
throw new Error("Can't apply a strategy processor before defining an active strategy");
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const groupCache = strategiesCache.current[processorName];
|
|
90
|
+
|
|
91
|
+
if (!groupCache || !groupCache[activeStrategy]) {
|
|
92
|
+
throw new Error(`No processor found for processor "${processorName}" on strategy "${activeStrategy}"`);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const processor = groupCache[activeStrategy];
|
|
96
|
+
return processor(params);
|
|
97
|
+
}, [apiRef]);
|
|
98
|
+
const getActiveStrategy = React.useCallback(strategyGroup => {
|
|
99
|
+
const strategyEntries = Array.from(availableStrategies.current.entries());
|
|
100
|
+
const availableStrategyEntry = strategyEntries.find(([, strategy]) => {
|
|
101
|
+
if (strategy.group !== strategyGroup) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return strategy.isAvailable();
|
|
106
|
+
});
|
|
107
|
+
return availableStrategyEntry?.[0] ?? GRID_DEFAULT_STRATEGY;
|
|
108
|
+
}, []);
|
|
109
|
+
const setStrategyAvailability = React.useCallback((strategyGroup, strategyName, isAvailable) => {
|
|
110
|
+
availableStrategies.current.set(strategyName, {
|
|
111
|
+
group: strategyGroup,
|
|
112
|
+
isAvailable
|
|
113
|
+
});
|
|
114
|
+
apiRef.current.publishEvent(GridEvents.strategyAvailabilityChange);
|
|
115
|
+
}, [apiRef]);
|
|
116
|
+
const strategyProcessingApi = {
|
|
117
|
+
unstable_registerStrategyProcessor: registerStrategyProcessor,
|
|
118
|
+
unstable_applyStrategyProcessor: applyStrategyProcessor,
|
|
119
|
+
unstable_getActiveStrategy: getActiveStrategy,
|
|
120
|
+
unstable_setStrategyAvailability: setStrategyAvailability
|
|
121
|
+
};
|
|
122
|
+
useGridApiMethod(apiRef, strategyProcessingApi, 'GridStrategyProcessing');
|
|
123
|
+
};
|
|
@@ -2,8 +2,8 @@ import { useGridLoggerFactory } from './useGridLoggerFactory';
|
|
|
2
2
|
import { useGridApiInitialization } from './useGridApiInitialization';
|
|
3
3
|
import { useGridErrorHandler } from './useGridErrorHandler';
|
|
4
4
|
import { useGridLocaleText } from './useGridLocaleText';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useGridPipeProcessing } from './pipeProcessing';
|
|
6
|
+
import { useGridStrategyProcessing } from './strategyProcessing';
|
|
7
7
|
import { useGridStateInitialization } from './useGridStateInitialization';
|
|
8
8
|
/**
|
|
9
9
|
* Initialize the technical pieces of the DataGrid (logger, state, ...) that any DataGrid implementation needs
|
|
@@ -14,8 +14,8 @@ export const useGridInitialization = (inputApiRef, props) => {
|
|
|
14
14
|
useGridLoggerFactory(apiRef, props);
|
|
15
15
|
useGridErrorHandler(apiRef, props);
|
|
16
16
|
useGridStateInitialization(apiRef, props);
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
useGridPipeProcessing(apiRef);
|
|
18
|
+
useGridStrategyProcessing(apiRef);
|
|
19
19
|
useGridLocaleText(apiRef, props);
|
|
20
20
|
return apiRef;
|
|
21
21
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import * as ReactDOM from 'react-dom';
|
|
3
4
|
import { useForkRef } from '@mui/material/utils';
|
|
5
|
+
import { defaultMemoize } from 'reselect';
|
|
4
6
|
import { useGridApiContext } from '../../utils/useGridApiContext';
|
|
5
7
|
import { useGridSelector } from '../../utils/useGridSelector';
|
|
6
8
|
import { gridVisibleColumnDefinitionsSelector, gridColumnPositionsSelector } from '../columns/gridColumnsSelector';
|
|
@@ -13,7 +15,15 @@ import { useGridRootProps } from '../../utils/useGridRootProps';
|
|
|
13
15
|
import { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';
|
|
14
16
|
import { GridEvents } from '../../../models/events';
|
|
15
17
|
import { GridColumnHeaderItem } from '../../../components/columnHeaders/GridColumnHeaderItem';
|
|
18
|
+
import { getFirstColumnIndexToRender } from '../columns/gridColumnsUtils';
|
|
19
|
+
import { useGridVisibleRows } from '../../utils/useGridVisibleRows';
|
|
20
|
+
import { getRenderableIndexes } from '../virtualization/useGridVirtualScroller';
|
|
16
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
|
|
23
|
+
function isUIEvent(event) {
|
|
24
|
+
return !!event.target;
|
|
25
|
+
}
|
|
26
|
+
|
|
17
27
|
export const useGridColumnHeaders = props => {
|
|
18
28
|
const {
|
|
19
29
|
innerRef: innerRefProp,
|
|
@@ -37,18 +47,43 @@ export const useGridColumnHeaders = props => {
|
|
|
37
47
|
const [renderContext, setRenderContext] = React.useState(null);
|
|
38
48
|
const prevRenderContext = React.useRef(renderContext);
|
|
39
49
|
const prevScrollLeft = React.useRef(0);
|
|
50
|
+
const currentPage = useGridVisibleRows(apiRef, rootProps);
|
|
40
51
|
React.useEffect(() => {
|
|
41
52
|
apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
|
|
42
|
-
}, [apiRef]);
|
|
53
|
+
}, [apiRef]); // memoize `getFirstColumnIndexToRender`, since it's called on scroll
|
|
54
|
+
|
|
55
|
+
const getFirstColumnIndexToRenderRef = React.useRef(defaultMemoize(getFirstColumnIndexToRender, {
|
|
56
|
+
equalityCheck: (a, b) => ['firstColumnIndex', 'minColumnIndex', 'columnBuffer'].every(key => a[key] === b[key])
|
|
57
|
+
}));
|
|
43
58
|
const updateInnerPosition = React.useCallback(nextRenderContext => {
|
|
44
|
-
const
|
|
59
|
+
const [firstRowToRender, lastRowToRender] = getRenderableIndexes({
|
|
60
|
+
firstIndex: nextRenderContext.firstRowIndex,
|
|
61
|
+
lastIndex: nextRenderContext.lastRowIndex,
|
|
62
|
+
minFirstIndex: 0,
|
|
63
|
+
maxLastIndex: currentPage.rows.length,
|
|
64
|
+
buffer: rootProps.rowBuffer
|
|
65
|
+
});
|
|
66
|
+
const firstColumnToRender = getFirstColumnIndexToRenderRef.current({
|
|
67
|
+
firstColumnIndex: nextRenderContext.firstColumnIndex,
|
|
68
|
+
minColumnIndex,
|
|
69
|
+
columnBuffer: rootProps.columnBuffer,
|
|
70
|
+
firstRowToRender,
|
|
71
|
+
lastRowToRender,
|
|
72
|
+
apiRef,
|
|
73
|
+
visibleRows: currentPage.rows
|
|
74
|
+
});
|
|
45
75
|
const offset = firstColumnToRender > 0 ? prevScrollLeft.current - columnPositions[firstColumnToRender] : prevScrollLeft.current;
|
|
46
76
|
innerRef.current.style.transform = `translate3d(${-offset}px, 0px, 0px)`;
|
|
47
|
-
}, [columnPositions, minColumnIndex, rootProps.columnBuffer]);
|
|
77
|
+
}, [columnPositions, minColumnIndex, rootProps.columnBuffer, apiRef, currentPage.rows, rootProps.rowBuffer]);
|
|
78
|
+
React.useLayoutEffect(() => {
|
|
79
|
+
if (renderContext) {
|
|
80
|
+
updateInnerPosition(renderContext);
|
|
81
|
+
}
|
|
82
|
+
}, [renderContext, updateInnerPosition]);
|
|
48
83
|
const handleScroll = React.useCallback(({
|
|
49
84
|
left,
|
|
50
85
|
renderContext: nextRenderContext = null
|
|
51
|
-
}) => {
|
|
86
|
+
}, event) => {
|
|
52
87
|
if (!innerRef.current) {
|
|
53
88
|
return;
|
|
54
89
|
} // Ignore vertical scroll.
|
|
@@ -59,15 +94,32 @@ export const useGridColumnHeaders = props => {
|
|
|
59
94
|
return;
|
|
60
95
|
}
|
|
61
96
|
|
|
62
|
-
prevScrollLeft.current = left;
|
|
97
|
+
prevScrollLeft.current = left; // We can only update the position when we guarantee that the render context has been
|
|
98
|
+
// rendered. This is achieved using ReactDOM.flushSync or when the context doesn't change.
|
|
99
|
+
|
|
100
|
+
let canUpdateInnerPosition = false;
|
|
63
101
|
|
|
64
102
|
if (nextRenderContext !== prevRenderContext.current || !prevRenderContext.current) {
|
|
65
|
-
|
|
103
|
+
// ReactDOM.flushSync cannot be called on `scroll` events fired inside effects
|
|
104
|
+
if (isUIEvent(event)) {
|
|
105
|
+
// To prevent flickering, the inner position can only be updated after the new context has
|
|
106
|
+
// been rendered. ReactDOM.flushSync ensures that the state changes will happen before
|
|
107
|
+
// updating the position.
|
|
108
|
+
ReactDOM.flushSync(() => {
|
|
109
|
+
setRenderContext(nextRenderContext);
|
|
110
|
+
});
|
|
111
|
+
canUpdateInnerPosition = true;
|
|
112
|
+
} else {
|
|
113
|
+
setRenderContext(nextRenderContext);
|
|
114
|
+
}
|
|
115
|
+
|
|
66
116
|
prevRenderContext.current = nextRenderContext;
|
|
117
|
+
} else {
|
|
118
|
+
canUpdateInnerPosition = true;
|
|
67
119
|
} // Pass directly the render context to avoid waiting for the next render
|
|
68
120
|
|
|
69
121
|
|
|
70
|
-
if (nextRenderContext) {
|
|
122
|
+
if (nextRenderContext && canUpdateInnerPosition) {
|
|
71
123
|
updateInnerPosition(nextRenderContext);
|
|
72
124
|
}
|
|
73
125
|
}, [updateInnerPosition]);
|
|
@@ -93,7 +145,22 @@ export const useGridColumnHeaders = props => {
|
|
|
93
145
|
}
|
|
94
146
|
|
|
95
147
|
const columns = [];
|
|
96
|
-
const
|
|
148
|
+
const [firstRowToRender, lastRowToRender] = getRenderableIndexes({
|
|
149
|
+
firstIndex: nextRenderContext.firstRowIndex,
|
|
150
|
+
lastIndex: nextRenderContext.lastRowIndex,
|
|
151
|
+
minFirstIndex: 0,
|
|
152
|
+
maxLastIndex: currentPage.rows.length,
|
|
153
|
+
buffer: rootProps.rowBuffer
|
|
154
|
+
});
|
|
155
|
+
const firstColumnToRender = getFirstColumnIndexToRenderRef.current({
|
|
156
|
+
firstColumnIndex: nextRenderContext.firstColumnIndex,
|
|
157
|
+
minColumnIndex: minFirstColumn,
|
|
158
|
+
columnBuffer: rootProps.columnBuffer,
|
|
159
|
+
apiRef,
|
|
160
|
+
firstRowToRender,
|
|
161
|
+
lastRowToRender,
|
|
162
|
+
visibleRows: currentPage.rows
|
|
163
|
+
});
|
|
97
164
|
const lastColumnToRender = Math.min(nextRenderContext.lastColumnIndex + rootProps.columnBuffer, maxLastColumn);
|
|
98
165
|
const renderedColumns = visibleColumns.slice(firstColumnToRender, lastColumnToRender);
|
|
99
166
|
|
|
@@ -113,11 +180,11 @@ export const useGridColumnHeaders = props => {
|
|
|
113
180
|
column: column,
|
|
114
181
|
colIndex: columnIndex,
|
|
115
182
|
isResizing: resizeCol === column.field,
|
|
116
|
-
isLastColumn: columnIndex ===
|
|
183
|
+
isLastColumn: columnIndex === visibleColumns.length - 1,
|
|
117
184
|
extendRowFullWidth: !rootProps.disableExtendRowFullWidth,
|
|
118
185
|
hasFocus: hasFocus,
|
|
119
186
|
tabIndex: tabIndex
|
|
120
|
-
}, other),
|
|
187
|
+
}, other), column.field));
|
|
121
188
|
}
|
|
122
189
|
|
|
123
190
|
return columns;
|
|
@@ -132,7 +199,6 @@ export const useGridColumnHeaders = props => {
|
|
|
132
199
|
renderContext,
|
|
133
200
|
getColumns,
|
|
134
201
|
isDragging: !!dragCol,
|
|
135
|
-
updateInnerPosition,
|
|
136
202
|
getRootProps: (other = {}) => _extends({
|
|
137
203
|
style: rootStyle
|
|
138
204
|
}, other),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { DEFAULT_GRID_COL_TYPE_KEY, getGridDefaultColumnTypes } from '../../../
|
|
2
|
+
import { DEFAULT_GRID_COL_TYPE_KEY, getGridDefaultColumnTypes } from '../../../colDef';
|
|
3
3
|
import { gridColumnsSelector, gridColumnVisibilityModelSelector } from './gridColumnsSelector';
|
|
4
4
|
import { clamp } from '../../../utils/utils';
|
|
5
|
+
export const COLUMNS_DIMENSION_PROPERTIES = ['maxWidth', 'minWidth', 'width', 'flex'];
|
|
5
6
|
export const computeColumnTypes = (customColumnTypes = {}) => {
|
|
6
7
|
const mergedColumnTypes = _extends({}, getGridDefaultColumnTypes());
|
|
7
8
|
|
|
@@ -167,6 +168,61 @@ export const hydrateColumnsWidth = (rawState, viewportInnerWidth) => {
|
|
|
167
168
|
});
|
|
168
169
|
};
|
|
169
170
|
let columnTypeWarnedOnce = false;
|
|
171
|
+
/**
|
|
172
|
+
* Apply the order and the dimensions of the initial state.
|
|
173
|
+
* The columns not registered in `orderedFields` will be placed after the imported columns.
|
|
174
|
+
*/
|
|
175
|
+
|
|
176
|
+
export const applyInitialState = (columnsState, initialState) => {
|
|
177
|
+
if (!initialState) {
|
|
178
|
+
return columnsState;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const {
|
|
182
|
+
orderedFields = [],
|
|
183
|
+
dimensions = {}
|
|
184
|
+
} = initialState;
|
|
185
|
+
const columnsWithUpdatedDimensions = Object.keys(dimensions);
|
|
186
|
+
|
|
187
|
+
if (columnsWithUpdatedDimensions.length === 0 && orderedFields.length === 0) {
|
|
188
|
+
return columnsState;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const orderedFieldsLookup = {};
|
|
192
|
+
const cleanOrderedFields = [];
|
|
193
|
+
|
|
194
|
+
for (let i = 0; i < orderedFields.length; i += 1) {
|
|
195
|
+
const field = orderedFields[i]; // Ignores the fields in the initialState that matches no field on the current column state
|
|
196
|
+
|
|
197
|
+
if (columnsState.lookup[field]) {
|
|
198
|
+
orderedFieldsLookup[field] = true;
|
|
199
|
+
cleanOrderedFields.push(field);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const newOrderedFields = cleanOrderedFields.length === 0 ? columnsState.all : [...cleanOrderedFields, ...columnsState.all.filter(field => !orderedFieldsLookup[field])];
|
|
204
|
+
|
|
205
|
+
const newColumnLookup = _extends({}, columnsState.lookup);
|
|
206
|
+
|
|
207
|
+
for (let i = 0; i < columnsWithUpdatedDimensions.length; i += 1) {
|
|
208
|
+
const field = columnsWithUpdatedDimensions[i];
|
|
209
|
+
|
|
210
|
+
const newColDef = _extends({}, newColumnLookup[field], {
|
|
211
|
+
hasBeenResized: true
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
Object.entries(dimensions[field]).forEach(([key, value]) => {
|
|
215
|
+
newColDef[key] = value === -1 ? Infinity : value;
|
|
216
|
+
});
|
|
217
|
+
newColumnLookup[field] = newColDef;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const newColumnsState = {
|
|
221
|
+
all: newOrderedFields,
|
|
222
|
+
lookup: newColumnLookup
|
|
223
|
+
};
|
|
224
|
+
return newColumnsState;
|
|
225
|
+
};
|
|
170
226
|
/**
|
|
171
227
|
* @deprecated Should have been internal only, you can inline the logic.
|
|
172
228
|
*/
|
|
@@ -192,14 +248,16 @@ export const getGridColDef = (columnTypes, type) => {
|
|
|
192
248
|
export const createColumnsState = ({
|
|
193
249
|
apiRef,
|
|
194
250
|
columnsToUpsert,
|
|
195
|
-
|
|
251
|
+
initialState,
|
|
252
|
+
columnTypes,
|
|
196
253
|
currentColumnVisibilityModel = gridColumnVisibilityModelSelector(apiRef),
|
|
197
254
|
shouldRegenColumnVisibilityModelFromColumns,
|
|
198
|
-
|
|
255
|
+
keepOnlyColumnsToUpsert = false
|
|
199
256
|
}) => {
|
|
257
|
+
const isInsideStateInitializer = !apiRef.current.state.columns;
|
|
200
258
|
let columnsStateWithoutColumnVisibilityModel;
|
|
201
259
|
|
|
202
|
-
if (
|
|
260
|
+
if (isInsideStateInitializer) {
|
|
203
261
|
columnsStateWithoutColumnVisibilityModel = {
|
|
204
262
|
all: [],
|
|
205
263
|
lookup: {}
|
|
@@ -207,71 +265,184 @@ export const createColumnsState = ({
|
|
|
207
265
|
} else {
|
|
208
266
|
const currentState = gridColumnsSelector(apiRef.current.state);
|
|
209
267
|
columnsStateWithoutColumnVisibilityModel = {
|
|
210
|
-
all: [...currentState.all],
|
|
211
|
-
lookup: _extends({}, currentState.lookup)
|
|
268
|
+
all: keepOnlyColumnsToUpsert ? [] : [...currentState.all],
|
|
269
|
+
lookup: _extends({}, currentState.lookup) // Will be cleaned later if keepOnlyColumnsToUpsert=true
|
|
270
|
+
|
|
212
271
|
};
|
|
213
272
|
}
|
|
214
273
|
|
|
274
|
+
let columnsToKeep = {};
|
|
275
|
+
|
|
276
|
+
if (keepOnlyColumnsToUpsert && !isInsideStateInitializer) {
|
|
277
|
+
columnsToKeep = Object.keys(columnsStateWithoutColumnVisibilityModel.lookup).reduce((acc, key) => _extends({}, acc, {
|
|
278
|
+
[key]: false
|
|
279
|
+
}), {});
|
|
280
|
+
}
|
|
281
|
+
|
|
215
282
|
const columnsToUpsertLookup = {};
|
|
216
283
|
columnsToUpsert.forEach(newColumn => {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
284
|
+
const {
|
|
285
|
+
field
|
|
286
|
+
} = newColumn;
|
|
287
|
+
columnsToUpsertLookup[field] = true;
|
|
288
|
+
columnsToKeep[field] = true;
|
|
289
|
+
let existingState = columnsStateWithoutColumnVisibilityModel.lookup[field];
|
|
290
|
+
|
|
291
|
+
if (existingState == null) {
|
|
220
292
|
// New Column
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
293
|
+
existingState = _extends({}, getGridColDef(columnTypes, newColumn.type), {
|
|
294
|
+
// TODO v6: Inline `getGridColDef`
|
|
295
|
+
field,
|
|
296
|
+
hasBeenResized: false
|
|
297
|
+
});
|
|
298
|
+
columnsStateWithoutColumnVisibilityModel.all.push(field);
|
|
299
|
+
} else if (keepOnlyColumnsToUpsert) {
|
|
300
|
+
columnsStateWithoutColumnVisibilityModel.all.push(field);
|
|
225
301
|
}
|
|
302
|
+
|
|
303
|
+
let hasBeenResized = existingState.hasBeenResized;
|
|
304
|
+
COLUMNS_DIMENSION_PROPERTIES.forEach(key => {
|
|
305
|
+
if (newColumn[key] !== undefined) {
|
|
306
|
+
hasBeenResized = true;
|
|
307
|
+
|
|
308
|
+
if (newColumn[key] === -1) {
|
|
309
|
+
newColumn[key] = Infinity;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
columnsStateWithoutColumnVisibilityModel.lookup[field] = _extends({}, existingState, {
|
|
314
|
+
hide: newColumn.hide == null ? false : newColumn.hide
|
|
315
|
+
}, newColumn, {
|
|
316
|
+
hasBeenResized
|
|
317
|
+
});
|
|
226
318
|
});
|
|
227
319
|
|
|
320
|
+
if (keepOnlyColumnsToUpsert && !isInsideStateInitializer) {
|
|
321
|
+
Object.keys(columnsStateWithoutColumnVisibilityModel.lookup).forEach(field => {
|
|
322
|
+
if (!columnsToKeep[field]) {
|
|
323
|
+
delete columnsStateWithoutColumnVisibilityModel.lookup[field];
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
|
|
228
328
|
const columnsLookupBeforePreProcessing = _extends({}, columnsStateWithoutColumnVisibilityModel.lookup);
|
|
229
329
|
|
|
230
|
-
const columnsStateWithPreProcessing = apiRef.current.
|
|
330
|
+
const columnsStateWithPreProcessing = apiRef.current.unstable_applyPipeProcessors('hydrateColumns', columnsStateWithoutColumnVisibilityModel); // TODO v6: remove the sync between the columns `hide` option and the model.
|
|
231
331
|
|
|
232
332
|
let columnVisibilityModel = {};
|
|
233
333
|
|
|
234
334
|
if (shouldRegenColumnVisibilityModelFromColumns) {
|
|
235
|
-
|
|
236
|
-
columnsStateWithPreProcessing.all.forEach(field => {
|
|
237
|
-
columnVisibilityModel[field] = !columnsStateWithoutColumnVisibilityModel.lookup[field].hide;
|
|
238
|
-
});
|
|
239
|
-
} else {
|
|
240
|
-
const newColumnVisibilityModel = _extends({}, currentColumnVisibilityModel);
|
|
241
|
-
|
|
242
|
-
let hasModelChanged = false;
|
|
243
|
-
columnsStateWithPreProcessing.all.forEach(field => {
|
|
244
|
-
// If neither the `columnsToUpsert` nor the pre-processors updated the column,
|
|
245
|
-
// Then we don't want to update the visibility status of the column in the model.
|
|
246
|
-
if (!columnsToUpsertLookup[field] && columnsLookupBeforePreProcessing[field] === columnsStateWithPreProcessing.lookup[field]) {
|
|
247
|
-
return;
|
|
248
|
-
}
|
|
335
|
+
let hasModelChanged = false;
|
|
249
336
|
|
|
250
|
-
|
|
251
|
-
const isVisibleAfter = !columnsStateWithPreProcessing.lookup[field].hide;
|
|
337
|
+
const newColumnVisibilityModel = _extends({}, currentColumnVisibilityModel);
|
|
252
338
|
|
|
253
|
-
|
|
339
|
+
if (isInsideStateInitializer) {
|
|
340
|
+
columnsStateWithPreProcessing.all.forEach(field => {
|
|
341
|
+
newColumnVisibilityModel[field] = !columnsStateWithoutColumnVisibilityModel.lookup[field].hide;
|
|
342
|
+
});
|
|
343
|
+
} else if (keepOnlyColumnsToUpsert) {
|
|
344
|
+
// At this point, `keepOnlyColumnsToUpsert` has a new meaning: keep the columns
|
|
345
|
+
// passed via `columnToUpsert` + columns added by the pre-processors. We do the following
|
|
346
|
+
// cleanup because a given column may have been removed from the `columns` prop but it still
|
|
347
|
+
// exists in the state.
|
|
348
|
+
Object.keys(newColumnVisibilityModel).forEach(field => {
|
|
349
|
+
if (!columnsStateWithPreProcessing.lookup[field]) {
|
|
350
|
+
delete newColumnVisibilityModel[field];
|
|
254
351
|
hasModelChanged = true;
|
|
255
|
-
newColumnVisibilityModel[field] = isVisibleAfter;
|
|
256
352
|
}
|
|
257
353
|
});
|
|
354
|
+
}
|
|
258
355
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
356
|
+
columnsStateWithPreProcessing.all.forEach(field => {
|
|
357
|
+
// If neither the `columnsToUpsert` nor the pre-processors updated the column,
|
|
358
|
+
// Then we don't want to update the visibility status of the column in the model.
|
|
359
|
+
if (!columnsToUpsertLookup[field] && columnsLookupBeforePreProcessing[field] === columnsStateWithPreProcessing.lookup[field]) {
|
|
360
|
+
return;
|
|
361
|
+
} // We always assume that a column not in the model is visible by default. However, there's an
|
|
362
|
+
// edge case where the column is not in the model but it also doesn't exist in the `columns`
|
|
363
|
+
// prop, meaning that the column is being added. In that case, we assume that the column was
|
|
364
|
+
// not visible before for it be added to the model.
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
let isVisibleBefore = currentColumnVisibilityModel[field];
|
|
368
|
+
|
|
369
|
+
if (isVisibleBefore === undefined) {
|
|
370
|
+
if (isInsideStateInitializer) {
|
|
371
|
+
isVisibleBefore = true;
|
|
372
|
+
} else {
|
|
373
|
+
const currentState = gridColumnsSelector(apiRef.current.state);
|
|
374
|
+
isVisibleBefore = !!currentState.lookup[field];
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
const isVisibleAfter = !columnsStateWithPreProcessing.lookup[field].hide;
|
|
379
|
+
|
|
380
|
+
if (isVisibleAfter !== isVisibleBefore) {
|
|
381
|
+
hasModelChanged = true;
|
|
382
|
+
newColumnVisibilityModel[field] = isVisibleAfter;
|
|
263
383
|
}
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
if (hasModelChanged || isInsideStateInitializer) {
|
|
387
|
+
columnVisibilityModel = newColumnVisibilityModel;
|
|
388
|
+
} else {
|
|
389
|
+
columnVisibilityModel = currentColumnVisibilityModel;
|
|
264
390
|
}
|
|
265
391
|
} else {
|
|
266
392
|
columnVisibilityModel = currentColumnVisibilityModel;
|
|
267
393
|
}
|
|
268
394
|
|
|
269
|
-
const
|
|
395
|
+
const columnsStateWithPortableColumns = applyInitialState(columnsStateWithPreProcessing, initialState);
|
|
396
|
+
|
|
397
|
+
const columnsState = _extends({}, columnsStateWithPortableColumns, {
|
|
270
398
|
columnVisibilityModel
|
|
271
399
|
});
|
|
272
400
|
|
|
273
401
|
return hydrateColumnsWidth(columnsState, apiRef.current.getRootDimensions?.()?.viewportInnerSize.width ?? 0);
|
|
274
402
|
};
|
|
275
|
-
export const
|
|
403
|
+
export const mergeColumnsState = columnsState => state => _extends({}, state, {
|
|
276
404
|
columns: columnsState
|
|
277
|
-
});
|
|
405
|
+
});
|
|
406
|
+
export function getFirstNonSpannedColumnToRender({
|
|
407
|
+
firstColumnToRender,
|
|
408
|
+
apiRef,
|
|
409
|
+
firstRowToRender,
|
|
410
|
+
lastRowToRender,
|
|
411
|
+
visibleRows
|
|
412
|
+
}) {
|
|
413
|
+
let firstNonSpannedColumnToRender = firstColumnToRender;
|
|
414
|
+
|
|
415
|
+
for (let i = firstRowToRender; i < lastRowToRender; i += 1) {
|
|
416
|
+
const row = visibleRows[i];
|
|
417
|
+
|
|
418
|
+
if (row) {
|
|
419
|
+
const rowId = visibleRows[i].id;
|
|
420
|
+
const cellColSpanInfo = apiRef.current.unstable_getCellColSpanInfo(rowId, firstColumnToRender);
|
|
421
|
+
|
|
422
|
+
if (cellColSpanInfo && cellColSpanInfo.spannedByColSpan) {
|
|
423
|
+
firstNonSpannedColumnToRender = cellColSpanInfo.leftVisibleCellIndex;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
return firstNonSpannedColumnToRender;
|
|
429
|
+
}
|
|
430
|
+
export function getFirstColumnIndexToRender({
|
|
431
|
+
firstColumnIndex,
|
|
432
|
+
minColumnIndex,
|
|
433
|
+
columnBuffer,
|
|
434
|
+
firstRowToRender,
|
|
435
|
+
lastRowToRender,
|
|
436
|
+
apiRef,
|
|
437
|
+
visibleRows
|
|
438
|
+
}) {
|
|
439
|
+
const initialFirstColumnToRender = Math.max(firstColumnIndex - columnBuffer, minColumnIndex);
|
|
440
|
+
const firstColumnToRender = getFirstNonSpannedColumnToRender({
|
|
441
|
+
firstColumnToRender: initialFirstColumnToRender,
|
|
442
|
+
apiRef,
|
|
443
|
+
firstRowToRender,
|
|
444
|
+
lastRowToRender,
|
|
445
|
+
visibleRows
|
|
446
|
+
});
|
|
447
|
+
return firstColumnToRender;
|
|
448
|
+
}
|