@mui/x-data-grid 8.0.0-alpha.12 → 8.0.0-alpha.13
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 +299 -0
- package/DataGrid/DataGrid.js +31 -22
- package/DataGrid/useDataGridProps.js +1 -1
- package/colDef/gridCheckboxSelectionColDef.js +1 -3
- package/components/GridFooter.js +1 -1
- package/components/GridHeader.js +1 -1
- package/components/GridPagination.js +5 -6
- package/components/GridRowCount.js +4 -5
- package/components/GridScrollArea.js +4 -3
- package/components/GridSelectedRowCount.js +5 -6
- package/components/GridShadowScrollArea.d.ts +8 -0
- package/components/GridShadowScrollArea.js +82 -0
- package/components/cell/GridEditInputCell.js +2 -3
- package/components/columnSelection/GridHeaderCheckbox.js +51 -17
- package/components/columnsManagement/GridColumnsManagement.js +59 -61
- package/components/containers/GridOverlay.js +6 -8
- package/components/containers/GridRoot.js +4 -2
- package/components/containers/GridRootStyles.d.ts +1 -2
- package/components/containers/GridRootStyles.js +77 -100
- package/components/containers/GridToolbarContainer.js +5 -6
- package/components/menu/GridMenu.js +7 -6
- package/components/menu/columnMenu/GridColumnHeaderMenu.js +4 -3
- package/components/panel/GridPanel.js +18 -20
- package/components/panel/GridPanelContent.js +6 -8
- package/components/panel/GridPanelFooter.js +5 -6
- package/components/panel/GridPanelHeader.js +4 -5
- package/components/panel/filterPanel/GridFilterForm.js +13 -20
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -2
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +10 -39
- package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +2 -2
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +20 -45
- package/components/panel/filterPanel/GridFilterInputValue.js +3 -6
- package/components/toolbar/GridToolbarFilterButton.js +5 -6
- package/components/toolbar/GridToolbarQuickFilter.js +23 -30
- package/components/virtualization/GridVirtualScrollbar.js +8 -5
- package/components/virtualization/GridVirtualScrollerFiller.js +2 -1
- package/constants/cssVariables.d.ts +294 -0
- package/constants/cssVariables.js +168 -0
- package/constants/dataGridPropsDefaultValues.js +1 -0
- package/constants/defaultGridSlotsComponents.js +1 -1
- package/constants/gridClasses.d.ts +13 -0
- package/constants/gridClasses.js +1 -1
- package/context/GridContextProvider.js +4 -1
- package/esm/DataGrid/DataGrid.js +31 -22
- package/esm/DataGrid/useDataGridProps.js +1 -1
- package/esm/colDef/gridCheckboxSelectionColDef.js +1 -3
- package/esm/components/GridFooter.js +2 -2
- package/esm/components/GridHeader.js +1 -1
- package/esm/components/GridPagination.js +5 -6
- package/esm/components/GridRowCount.js +4 -5
- package/esm/components/GridScrollArea.js +2 -1
- package/esm/components/GridSelectedRowCount.js +5 -6
- package/esm/components/GridShadowScrollArea.d.ts +8 -0
- package/esm/components/GridShadowScrollArea.js +74 -0
- package/esm/components/cell/GridEditInputCell.js +2 -3
- package/esm/components/columnSelection/GridHeaderCheckbox.js +51 -17
- package/esm/components/columnsManagement/GridColumnsManagement.js +60 -62
- package/esm/components/containers/GridOverlay.js +6 -8
- package/esm/components/containers/GridRoot.js +4 -2
- package/esm/components/containers/GridRootStyles.d.ts +1 -2
- package/esm/components/containers/GridRootStyles.js +78 -101
- package/esm/components/containers/GridToolbarContainer.js +5 -6
- package/esm/components/menu/GridMenu.js +7 -6
- package/esm/components/menu/columnMenu/GridColumnHeaderMenu.js +2 -1
- package/esm/components/panel/GridPanel.js +18 -20
- package/esm/components/panel/GridPanelContent.js +6 -8
- package/esm/components/panel/GridPanelFooter.js +5 -6
- package/esm/components/panel/GridPanelHeader.js +4 -5
- package/esm/components/panel/filterPanel/GridFilterForm.js +13 -20
- package/esm/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -2
- package/esm/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +10 -39
- package/esm/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +2 -2
- package/esm/components/panel/filterPanel/GridFilterInputMultipleValue.js +19 -44
- package/esm/components/panel/filterPanel/GridFilterInputValue.js +3 -6
- package/esm/components/toolbar/GridToolbarFilterButton.js +5 -6
- package/esm/components/toolbar/GridToolbarQuickFilter.js +23 -30
- package/esm/components/virtualization/GridVirtualScrollbar.js +3 -1
- package/esm/components/virtualization/GridVirtualScrollerFiller.js +2 -1
- package/esm/constants/cssVariables.d.ts +294 -0
- package/esm/constants/cssVariables.js +161 -0
- package/esm/constants/dataGridPropsDefaultValues.js +1 -0
- package/esm/constants/defaultGridSlotsComponents.js +2 -2
- package/esm/constants/gridClasses.d.ts +13 -0
- package/esm/constants/gridClasses.js +1 -1
- package/esm/context/GridContextProvider.js +4 -1
- package/esm/hooks/features/clipboard/useGridClipboard.js +3 -2
- package/esm/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
- package/esm/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/esm/hooks/features/columns/gridColumnsInterfaces.d.ts +1 -0
- package/esm/hooks/features/columns/gridColumnsSelector.d.ts +7 -0
- package/esm/hooks/features/columns/gridColumnsSelector.js +8 -0
- package/esm/hooks/features/columns/gridColumnsUtils.d.ts +3 -1
- package/esm/hooks/features/columns/gridColumnsUtils.js +6 -3
- package/esm/hooks/features/columns/index.d.ts +1 -1
- package/esm/hooks/features/columns/index.js +1 -1
- package/esm/hooks/features/columns/useGridColumns.js +4 -2
- package/esm/hooks/features/dataSource/gridDataSourceError.d.ts +31 -0
- package/esm/hooks/features/dataSource/gridDataSourceError.js +32 -0
- package/esm/hooks/features/dataSource/index.d.ts +2 -0
- package/esm/hooks/features/dataSource/index.js +2 -0
- package/esm/hooks/features/dataSource/models.d.ts +1 -1
- package/esm/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
- package/esm/hooks/features/dataSource/useGridDataSourceBase.js +27 -17
- package/esm/hooks/features/dimensions/useGridDimensions.js +11 -10
- package/esm/hooks/features/editing/useGridCellEditing.js +2 -1
- package/esm/hooks/features/editing/useGridRowEditing.js +2 -1
- package/esm/hooks/features/export/utils.js +4 -2
- package/esm/hooks/features/focus/useGridFocus.js +3 -2
- package/esm/hooks/features/index.d.ts +1 -1
- package/esm/hooks/features/index.js +1 -1
- package/esm/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +3 -3
- package/esm/hooks/features/rowSelection/gridRowSelectionSelector.js +27 -7
- package/esm/hooks/features/rowSelection/useGridRowSelection.js +148 -81
- package/esm/hooks/features/rowSelection/utils.d.ts +2 -2
- package/esm/hooks/features/rowSelection/utils.js +11 -11
- package/esm/hooks/features/rows/gridRowsInterfaces.d.ts +1 -1
- package/esm/hooks/features/rows/gridRowsUtils.d.ts +2 -1
- package/esm/hooks/features/rows/gridRowsUtils.js +8 -0
- package/esm/hooks/features/rows/useGridParamsApi.js +2 -8
- package/esm/hooks/features/rows/useGridRowAriaAttributes.js +2 -4
- package/esm/hooks/features/rows/useGridRows.d.ts +2 -2
- package/esm/hooks/features/rows/useGridRows.js +7 -7
- package/esm/hooks/features/virtualization/useGridVirtualScroller.js +5 -9
- package/esm/hooks/utils/useGridSelector.js +4 -1
- package/esm/hooks/utils/useIsSSR.js +4 -1
- package/esm/index.js +1 -1
- package/esm/internals/index.d.ts +2 -1
- package/esm/internals/index.js +2 -1
- package/esm/internals/utils/propValidation.js +1 -1
- package/esm/locales/bnBD.d.ts +2 -0
- package/esm/locales/bnBD.js +167 -0
- package/esm/locales/deDE.js +3 -5
- package/esm/locales/huHU.js +10 -13
- package/esm/locales/index.d.ts +1 -0
- package/esm/locales/index.js +1 -0
- package/esm/locales/ruRU.js +17 -21
- package/esm/material/index.d.ts +1 -0
- package/esm/material/index.js +164 -49
- package/esm/material/variables.d.ts +5 -0
- package/esm/material/variables.js +89 -0
- package/esm/models/api/gridRowSelectionApi.d.ts +4 -2
- package/esm/models/api/gridSortApi.d.ts +1 -1
- package/esm/models/configuration/gridConfiguration.d.ts +7 -1
- package/esm/models/gridBaseSlots.d.ts +56 -6
- package/esm/models/gridDataSource.d.ts +9 -4
- package/esm/models/gridRowSelectionManager.d.ts +9 -0
- package/esm/models/gridRowSelectionManager.js +36 -0
- package/esm/models/gridRowSelectionModel.d.ts +4 -2
- package/esm/models/gridSlotsComponent.d.ts +7 -27
- package/esm/models/gridSlotsComponentsProps.d.ts +3 -11
- package/esm/models/gridSortModel.d.ts +1 -1
- package/esm/models/index.d.ts +2 -1
- package/esm/models/index.js +2 -3
- package/esm/models/props/DataGridProps.d.ts +22 -17
- package/esm/utils/css/context.d.ts +14 -0
- package/esm/utils/css/context.js +54 -0
- package/esm/utils/index.d.ts +2 -1
- package/esm/utils/index.js +1 -1
- package/hooks/features/clipboard/useGridClipboard.js +3 -2
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
- package/hooks/features/columnResize/useGridColumnResize.js +28 -27
- package/hooks/features/columns/gridColumnsInterfaces.d.ts +1 -0
- package/hooks/features/columns/gridColumnsSelector.d.ts +7 -0
- package/hooks/features/columns/gridColumnsSelector.js +9 -1
- package/hooks/features/columns/gridColumnsUtils.d.ts +3 -1
- package/hooks/features/columns/gridColumnsUtils.js +6 -3
- package/hooks/features/columns/index.d.ts +1 -1
- package/hooks/features/columns/index.js +94 -10
- package/hooks/features/columns/useGridColumns.js +4 -2
- package/hooks/features/dataSource/gridDataSourceError.d.ts +31 -0
- package/hooks/features/dataSource/gridDataSourceError.js +40 -0
- package/hooks/features/dataSource/index.d.ts +2 -0
- package/hooks/features/dataSource/index.js +25 -0
- package/hooks/features/dataSource/models.d.ts +1 -1
- package/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
- package/hooks/features/dataSource/useGridDataSourceBase.js +27 -17
- package/hooks/features/dimensions/useGridDimensions.js +19 -18
- package/hooks/features/editing/useGridCellEditing.js +10 -9
- package/hooks/features/editing/useGridRowEditing.js +11 -10
- package/hooks/features/export/utils.js +4 -2
- package/hooks/features/focus/useGridFocus.js +8 -7
- package/hooks/features/index.d.ts +1 -1
- package/hooks/features/index.js +11 -28
- package/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +3 -3
- package/hooks/features/rowSelection/gridRowSelectionSelector.js +27 -7
- package/hooks/features/rowSelection/useGridRowSelection.js +146 -79
- package/hooks/features/rowSelection/utils.d.ts +2 -2
- package/hooks/features/rowSelection/utils.js +10 -10
- package/hooks/features/rows/gridRowsInterfaces.d.ts +1 -1
- package/hooks/features/rows/gridRowsUtils.d.ts +2 -1
- package/hooks/features/rows/gridRowsUtils.js +10 -1
- package/hooks/features/rows/useGridParamsApi.js +2 -8
- package/hooks/features/rows/useGridRowAriaAttributes.js +2 -4
- package/hooks/features/rows/useGridRows.d.ts +2 -2
- package/hooks/features/rows/useGridRows.js +7 -7
- package/hooks/features/virtualization/useGridVirtualScroller.js +21 -25
- package/hooks/utils/useGridSelector.js +6 -2
- package/hooks/utils/useIsSSR.js +6 -2
- package/index.js +1 -1
- package/internals/index.d.ts +2 -1
- package/internals/index.js +15 -0
- package/internals/utils/propValidation.js +1 -1
- package/locales/bnBD.d.ts +2 -0
- package/locales/bnBD.js +173 -0
- package/locales/deDE.js +3 -5
- package/locales/huHU.js +10 -13
- package/locales/index.d.ts +1 -0
- package/locales/index.js +11 -0
- package/locales/ruRU.js +17 -21
- package/material/index.d.ts +1 -0
- package/material/index.js +170 -49
- package/material/variables.d.ts +5 -0
- package/material/variables.js +95 -0
- package/models/api/gridRowSelectionApi.d.ts +4 -2
- package/models/api/gridSortApi.d.ts +1 -1
- package/models/configuration/gridConfiguration.d.ts +7 -1
- package/models/gridBaseSlots.d.ts +56 -6
- package/models/gridDataSource.d.ts +9 -4
- package/models/gridRowSelectionManager.d.ts +9 -0
- package/models/gridRowSelectionManager.js +43 -0
- package/models/gridRowSelectionModel.d.ts +4 -2
- package/models/gridSlotsComponent.d.ts +7 -27
- package/models/gridSlotsComponentsProps.d.ts +3 -11
- package/models/gridSortModel.d.ts +1 -1
- package/models/index.d.ts +2 -1
- package/models/index.js +34 -11
- package/models/props/DataGridProps.d.ts +22 -17
- package/modern/DataGrid/DataGrid.js +31 -22
- package/modern/DataGrid/useDataGridProps.js +1 -1
- package/modern/colDef/gridCheckboxSelectionColDef.js +1 -3
- package/modern/components/GridFooter.js +2 -2
- package/modern/components/GridHeader.js +1 -1
- package/modern/components/GridPagination.js +5 -6
- package/modern/components/GridRowCount.js +4 -5
- package/modern/components/GridScrollArea.js +2 -1
- package/modern/components/GridSelectedRowCount.js +5 -6
- package/modern/components/GridShadowScrollArea.d.ts +8 -0
- package/modern/components/GridShadowScrollArea.js +74 -0
- package/modern/components/cell/GridEditInputCell.js +2 -3
- package/modern/components/columnSelection/GridHeaderCheckbox.js +51 -17
- package/modern/components/columnsManagement/GridColumnsManagement.js +60 -62
- package/modern/components/containers/GridOverlay.js +6 -8
- package/modern/components/containers/GridRoot.js +4 -2
- package/modern/components/containers/GridRootStyles.d.ts +1 -2
- package/modern/components/containers/GridRootStyles.js +78 -101
- package/modern/components/containers/GridToolbarContainer.js +5 -6
- package/modern/components/menu/GridMenu.js +7 -6
- package/modern/components/menu/columnMenu/GridColumnHeaderMenu.js +2 -1
- package/modern/components/panel/GridPanel.js +18 -20
- package/modern/components/panel/GridPanelContent.js +6 -8
- package/modern/components/panel/GridPanelFooter.js +5 -6
- package/modern/components/panel/GridPanelHeader.js +4 -5
- package/modern/components/panel/filterPanel/GridFilterForm.js +13 -20
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -2
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +10 -39
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +2 -2
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +19 -44
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +3 -6
- package/modern/components/toolbar/GridToolbarFilterButton.js +5 -6
- package/modern/components/toolbar/GridToolbarQuickFilter.js +23 -30
- package/modern/components/virtualization/GridVirtualScrollbar.js +3 -1
- package/modern/components/virtualization/GridVirtualScrollerFiller.js +2 -1
- package/modern/constants/cssVariables.d.ts +294 -0
- package/modern/constants/cssVariables.js +161 -0
- package/modern/constants/dataGridPropsDefaultValues.js +1 -0
- package/modern/constants/defaultGridSlotsComponents.js +2 -2
- package/modern/constants/gridClasses.d.ts +13 -0
- package/modern/constants/gridClasses.js +1 -1
- package/modern/context/GridContextProvider.js +4 -1
- package/modern/hooks/features/clipboard/useGridClipboard.js +3 -2
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
- package/modern/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/modern/hooks/features/columns/gridColumnsInterfaces.d.ts +1 -0
- package/modern/hooks/features/columns/gridColumnsSelector.d.ts +7 -0
- package/modern/hooks/features/columns/gridColumnsSelector.js +8 -0
- package/modern/hooks/features/columns/gridColumnsUtils.d.ts +3 -1
- package/modern/hooks/features/columns/gridColumnsUtils.js +6 -3
- package/modern/hooks/features/columns/index.d.ts +1 -1
- package/modern/hooks/features/columns/index.js +1 -1
- package/modern/hooks/features/columns/useGridColumns.js +4 -2
- package/modern/hooks/features/dataSource/gridDataSourceError.d.ts +31 -0
- package/modern/hooks/features/dataSource/gridDataSourceError.js +32 -0
- package/modern/hooks/features/dataSource/index.d.ts +2 -0
- package/modern/hooks/features/dataSource/index.js +2 -0
- package/modern/hooks/features/dataSource/models.d.ts +1 -1
- package/modern/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
- package/modern/hooks/features/dataSource/useGridDataSourceBase.js +27 -17
- package/modern/hooks/features/dimensions/useGridDimensions.js +11 -10
- package/modern/hooks/features/editing/useGridCellEditing.js +2 -1
- package/modern/hooks/features/editing/useGridRowEditing.js +2 -1
- package/modern/hooks/features/export/utils.js +4 -2
- package/modern/hooks/features/focus/useGridFocus.js +3 -2
- package/modern/hooks/features/index.d.ts +1 -1
- package/modern/hooks/features/index.js +1 -1
- package/modern/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +3 -3
- package/modern/hooks/features/rowSelection/gridRowSelectionSelector.js +27 -7
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +148 -81
- package/modern/hooks/features/rowSelection/utils.d.ts +2 -2
- package/modern/hooks/features/rowSelection/utils.js +11 -11
- package/modern/hooks/features/rows/gridRowsInterfaces.d.ts +1 -1
- package/modern/hooks/features/rows/gridRowsUtils.d.ts +2 -1
- package/modern/hooks/features/rows/gridRowsUtils.js +8 -0
- package/modern/hooks/features/rows/useGridParamsApi.js +2 -8
- package/modern/hooks/features/rows/useGridRowAriaAttributes.js +2 -4
- package/modern/hooks/features/rows/useGridRows.d.ts +2 -2
- package/modern/hooks/features/rows/useGridRows.js +7 -7
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +5 -9
- package/modern/hooks/utils/useGridSelector.js +4 -1
- package/modern/hooks/utils/useIsSSR.js +4 -1
- package/modern/index.js +1 -1
- package/modern/internals/index.d.ts +2 -1
- package/modern/internals/index.js +2 -1
- package/modern/internals/utils/propValidation.js +1 -1
- package/modern/locales/bnBD.d.ts +2 -0
- package/modern/locales/bnBD.js +167 -0
- package/modern/locales/deDE.js +3 -5
- package/modern/locales/huHU.js +10 -13
- package/modern/locales/index.d.ts +1 -0
- package/modern/locales/index.js +1 -0
- package/modern/locales/ruRU.js +17 -21
- package/modern/material/index.d.ts +1 -0
- package/modern/material/index.js +164 -49
- package/modern/material/variables.d.ts +5 -0
- package/modern/material/variables.js +89 -0
- package/modern/models/api/gridRowSelectionApi.d.ts +4 -2
- package/modern/models/api/gridSortApi.d.ts +1 -1
- package/modern/models/configuration/gridConfiguration.d.ts +7 -1
- package/modern/models/gridBaseSlots.d.ts +56 -6
- package/modern/models/gridDataSource.d.ts +9 -4
- package/modern/models/gridRowSelectionManager.d.ts +9 -0
- package/modern/models/gridRowSelectionManager.js +36 -0
- package/modern/models/gridRowSelectionModel.d.ts +4 -2
- package/modern/models/gridSlotsComponent.d.ts +7 -27
- package/modern/models/gridSlotsComponentsProps.d.ts +3 -11
- package/modern/models/gridSortModel.d.ts +1 -1
- package/modern/models/index.d.ts +2 -1
- package/modern/models/index.js +2 -3
- package/modern/models/props/DataGridProps.d.ts +22 -17
- package/modern/utils/css/context.d.ts +14 -0
- package/modern/utils/css/context.js +54 -0
- package/modern/utils/index.d.ts +2 -1
- package/modern/utils/index.js +1 -1
- package/package.json +2 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/utils/css/context.d.ts +14 -0
- package/utils/css/context.js +64 -0
- package/utils/index.d.ts +2 -1
- package/utils/index.js +8 -1
|
@@ -10,7 +10,8 @@ var _toPropertyKey2 = _interopRequireDefault(require("@babel/runtime/helpers/toP
|
|
|
10
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
11
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
|
-
var
|
|
13
|
+
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
14
|
+
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
14
15
|
var _warning = require("@mui/x-internals/warning");
|
|
15
16
|
var _useGridApiEventHandler = require("../../utils/useGridApiEventHandler");
|
|
16
17
|
var _gridEditRowModel = require("../../../models/gridEditRowModel");
|
|
@@ -19,10 +20,10 @@ var _gridEditingSelectors = require("./gridEditingSelectors");
|
|
|
19
20
|
var _keyboardUtils = require("../../../utils/keyboardUtils");
|
|
20
21
|
var _gridColumnsSelector = require("../columns/gridColumnsSelector");
|
|
21
22
|
var _gridRowsSelector = require("../rows/gridRowsSelector");
|
|
22
|
-
var
|
|
23
|
+
var _utils = require("../../../utils/utils");
|
|
23
24
|
var _gridRowParams = require("../../../models/params/gridRowParams");
|
|
24
25
|
var _colDef = require("../../../colDef");
|
|
25
|
-
var
|
|
26
|
+
var _utils2 = require("./utils");
|
|
26
27
|
const _excluded = ["id"],
|
|
27
28
|
_excluded2 = ["id"];
|
|
28
29
|
const useGridRowEditing = (apiRef, props) => {
|
|
@@ -246,7 +247,7 @@ const useGridRowEditing = (apiRef, props) => {
|
|
|
246
247
|
});
|
|
247
248
|
return isEditing ? _gridEditRowModel.GridRowModes.Edit : _gridEditRowModel.GridRowModes.View;
|
|
248
249
|
}, [apiRef, props.editMode]);
|
|
249
|
-
const updateRowModesModel = (0,
|
|
250
|
+
const updateRowModesModel = (0, _useEventCallback.default)(newModel => {
|
|
250
251
|
const isNewModelDifferentFromProp = newModel !== props.rowModesModel;
|
|
251
252
|
if (onRowModesModelChange && isNewModelDifferentFromProp) {
|
|
252
253
|
onRowModesModelChange(newModel, {
|
|
@@ -310,7 +311,7 @@ const useGridRowEditing = (apiRef, props) => {
|
|
|
310
311
|
mode: _gridEditRowModel.GridRowModes.Edit
|
|
311
312
|
}, other));
|
|
312
313
|
}, [throwIfNotInMode, updateRowInRowModesModel]);
|
|
313
|
-
const updateStateToStartRowEditMode = (0,
|
|
314
|
+
const updateStateToStartRowEditMode = (0, _useEventCallback.default)(params => {
|
|
314
315
|
const {
|
|
315
316
|
id,
|
|
316
317
|
fieldToFocus,
|
|
@@ -327,7 +328,7 @@ const useGridRowEditing = (apiRef, props) => {
|
|
|
327
328
|
let newValue = apiRef.current.getCellValue(id, field);
|
|
328
329
|
if (fieldToFocus === field && (deleteValue || initialValue)) {
|
|
329
330
|
if (deleteValue) {
|
|
330
|
-
newValue = (0,
|
|
331
|
+
newValue = (0, _utils2.getDefaultCellValue)(column);
|
|
331
332
|
} else if (initialValue) {
|
|
332
333
|
newValue = initialValue;
|
|
333
334
|
}
|
|
@@ -346,7 +347,7 @@ const useGridRowEditing = (apiRef, props) => {
|
|
|
346
347
|
columnFields.filter(field => !!apiRef.current.getColumn(field).preProcessEditCellProps && deleteValue).forEach(field => {
|
|
347
348
|
const column = apiRef.current.getColumn(field);
|
|
348
349
|
const value = apiRef.current.getCellValue(id, field);
|
|
349
|
-
const newValue = deleteValue ? (0,
|
|
350
|
+
const newValue = deleteValue ? (0, _utils2.getDefaultCellValue)(column) : initialValue ?? value;
|
|
350
351
|
Promise.resolve(column.preProcessEditCellProps({
|
|
351
352
|
id,
|
|
352
353
|
row: apiRef.current.getRow(id),
|
|
@@ -374,7 +375,7 @@ const useGridRowEditing = (apiRef, props) => {
|
|
|
374
375
|
mode: _gridEditRowModel.GridRowModes.View
|
|
375
376
|
}, other));
|
|
376
377
|
}, [throwIfNotInMode, updateRowInRowModesModel]);
|
|
377
|
-
const updateStateToStopRowEditMode = (0,
|
|
378
|
+
const updateStateToStopRowEditMode = (0, _useEventCallback.default)(params => {
|
|
378
379
|
const {
|
|
379
380
|
id,
|
|
380
381
|
ignoreModifications,
|
|
@@ -575,12 +576,12 @@ const useGridRowEditing = (apiRef, props) => {
|
|
|
575
576
|
}, [rowModesModelProp, updateRowModesModel]);
|
|
576
577
|
|
|
577
578
|
// Run this effect synchronously so that the keyboard event can impact the yet-to-be-rendered input.
|
|
578
|
-
(0,
|
|
579
|
+
(0, _useEnhancedEffect.default)(() => {
|
|
579
580
|
const rowsLookup = (0, _gridRowsSelector.gridRowsLookupSelector)(apiRef);
|
|
580
581
|
|
|
581
582
|
// Update the ref here because updateStateToStopRowEditMode may change it later
|
|
582
583
|
const copyOfPrevRowModesModel = prevRowModesModel.current;
|
|
583
|
-
prevRowModesModel.current = (0,
|
|
584
|
+
prevRowModesModel.current = (0, _utils.deepClone)(rowModesModel); // Do a deep-clone because the attributes might be changed later
|
|
584
585
|
|
|
585
586
|
const ids = new Set([...Object.keys(rowModesModel), ...Object.keys(copyOfPrevRowModesModel)]);
|
|
586
587
|
Array.from(ids).forEach(id => {
|
|
@@ -7,6 +7,7 @@ exports.getColumnsToExport = exports.defaultGetRowsToExport = void 0;
|
|
|
7
7
|
var _columns = require("../columns");
|
|
8
8
|
var _filter = require("../filter");
|
|
9
9
|
var _gridRowsSelector = require("../rows/gridRowsSelector");
|
|
10
|
+
var _gridRowSelectionSelector = require("../rowSelection/gridRowSelectionSelector");
|
|
10
11
|
const getColumnsToExport = ({
|
|
11
12
|
apiRef,
|
|
12
13
|
options
|
|
@@ -30,14 +31,15 @@ const defaultGetRowsToExport = ({
|
|
|
30
31
|
}) => {
|
|
31
32
|
const filteredSortedRowIds = (0, _filter.gridFilteredSortedRowIdsSelector)(apiRef);
|
|
32
33
|
const rowTree = (0, _gridRowsSelector.gridRowTreeSelector)(apiRef);
|
|
33
|
-
const
|
|
34
|
+
const selectedRowsCount = (0, _gridRowSelectionSelector.gridRowSelectionCountSelector)(apiRef);
|
|
34
35
|
const bodyRows = filteredSortedRowIds.filter(id => rowTree[id].type !== 'footer');
|
|
35
36
|
const pinnedRows = (0, _gridRowsSelector.gridPinnedRowsSelector)(apiRef);
|
|
36
37
|
const topPinnedRowsIds = pinnedRows?.top?.map(row => row.id) || [];
|
|
37
38
|
const bottomPinnedRowsIds = pinnedRows?.bottom?.map(row => row.id) || [];
|
|
38
39
|
bodyRows.unshift(...topPinnedRowsIds);
|
|
39
40
|
bodyRows.push(...bottomPinnedRowsIds);
|
|
40
|
-
if (
|
|
41
|
+
if (selectedRowsCount > 0) {
|
|
42
|
+
const selectedRows = (0, _gridRowSelectionSelector.gridRowSelectionIdsSelector)(apiRef);
|
|
41
43
|
return bodyRows.filter(id => selectedRows.has(id));
|
|
42
44
|
}
|
|
43
45
|
return bodyRows;
|
|
@@ -8,7 +8,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.useGridFocus = exports.focusStateInitializer = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
var
|
|
11
|
+
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
12
|
+
var _ownerDocument = _interopRequireDefault(require("@mui/utils/ownerDocument"));
|
|
12
13
|
var _gridClasses = require("../../../constants/gridClasses");
|
|
13
14
|
var _useGridApiMethod = require("../../utils/useGridApiMethod");
|
|
14
15
|
var _useGridLogger = require("../../utils/useGridLogger");
|
|
@@ -17,7 +18,7 @@ var _keyboardUtils = require("../../../utils/keyboardUtils");
|
|
|
17
18
|
var _gridFocusStateSelector = require("./gridFocusStateSelector");
|
|
18
19
|
var _gridColumnsSelector = require("../columns/gridColumnsSelector");
|
|
19
20
|
var _useGridVisibleRows = require("../../utils/useGridVisibleRows");
|
|
20
|
-
var
|
|
21
|
+
var _utils = require("../../../utils/utils");
|
|
21
22
|
var _gridRowsSelector = require("../rows/gridRowsSelector");
|
|
22
23
|
const focusStateInitializer = state => (0, _extends2.default)({}, state, {
|
|
23
24
|
focus: {
|
|
@@ -205,7 +206,7 @@ const useGridFocus = (apiRef, props) => {
|
|
|
205
206
|
columnIndexToFocus = visibleColumns.length - 1;
|
|
206
207
|
}
|
|
207
208
|
}
|
|
208
|
-
rowIndexToFocus = (0,
|
|
209
|
+
rowIndexToFocus = (0, _utils.clamp)(rowIndexToFocus, 0, currentPageRows.length - 1);
|
|
209
210
|
const rowToFocus = currentPageRows[rowIndexToFocus];
|
|
210
211
|
if (!rowToFocus) {
|
|
211
212
|
return;
|
|
@@ -218,7 +219,7 @@ const useGridFocus = (apiRef, props) => {
|
|
|
218
219
|
columnIndexToFocus = colSpanInfo.rightVisibleCellIndex;
|
|
219
220
|
}
|
|
220
221
|
}
|
|
221
|
-
columnIndexToFocus = (0,
|
|
222
|
+
columnIndexToFocus = (0, _utils.clamp)(columnIndexToFocus, 0, visibleColumns.length - 1);
|
|
222
223
|
const columnToFocus = visibleColumns[columnIndexToFocus];
|
|
223
224
|
apiRef.current.setCellFocus(rowToFocus.id, columnToFocus.field);
|
|
224
225
|
}, [apiRef, props.pagination, props.paginationMode]);
|
|
@@ -339,7 +340,7 @@ const useGridFocus = (apiRef, props) => {
|
|
|
339
340
|
pagination: props.pagination,
|
|
340
341
|
paginationMode: props.paginationMode
|
|
341
342
|
});
|
|
342
|
-
const nextRow = currentPage.rows[(0,
|
|
343
|
+
const nextRow = currentPage.rows[(0, _utils.clamp)(lastFocusedRowIndex, 0, currentPage.rows.length - 1)];
|
|
343
344
|
nextRowId = nextRow?.id ?? null;
|
|
344
345
|
}
|
|
345
346
|
apiRef.current.setState(state => (0, _extends2.default)({}, state, {
|
|
@@ -355,7 +356,7 @@ const useGridFocus = (apiRef, props) => {
|
|
|
355
356
|
}));
|
|
356
357
|
}
|
|
357
358
|
}, [apiRef, props.pagination, props.paginationMode]);
|
|
358
|
-
const handlePaginationModelChange = (0,
|
|
359
|
+
const handlePaginationModelChange = (0, _useEventCallback.default)(() => {
|
|
359
360
|
const currentFocusedCell = (0, _gridFocusStateSelector.gridFocusCellSelector)(apiRef);
|
|
360
361
|
if (!currentFocusedCell) {
|
|
361
362
|
return;
|
|
@@ -396,7 +397,7 @@ const useGridFocus = (apiRef, props) => {
|
|
|
396
397
|
(0, _useGridApiMethod.useGridApiMethod)(apiRef, focusApi, 'public');
|
|
397
398
|
(0, _useGridApiMethod.useGridApiMethod)(apiRef, focusPrivateApi, 'private');
|
|
398
399
|
React.useEffect(() => {
|
|
399
|
-
const doc = (0,
|
|
400
|
+
const doc = (0, _ownerDocument.default)(apiRef.current.rootElementRef.current);
|
|
400
401
|
doc.addEventListener('mouseup', handleDocumentClick);
|
|
401
402
|
return () => {
|
|
402
403
|
doc.removeEventListener('mouseup', handleDocumentClick);
|
|
@@ -16,4 +16,4 @@ export * from "./dimensions/index.js";
|
|
|
16
16
|
export * from "./statePersistence/index.js";
|
|
17
17
|
export * from "./headerFiltering/index.js";
|
|
18
18
|
export * from "./virtualization/index.js";
|
|
19
|
-
export
|
|
19
|
+
export * from "./dataSource/index.js";
|
package/hooks/features/index.js
CHANGED
|
@@ -3,19 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var _exportNames = {
|
|
7
|
-
GridDataSourceCacheDefault: true
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "GridDataSourceCacheDefault", {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () {
|
|
12
|
-
return _cache.GridDataSourceCacheDefault;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
6
|
var _columnMenu = require("./columnMenu");
|
|
16
7
|
Object.keys(_columnMenu).forEach(function (key) {
|
|
17
8
|
if (key === "default" || key === "__esModule") return;
|
|
18
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
19
9
|
if (key in exports && exports[key] === _columnMenu[key]) return;
|
|
20
10
|
Object.defineProperty(exports, key, {
|
|
21
11
|
enumerable: true,
|
|
@@ -27,7 +17,6 @@ Object.keys(_columnMenu).forEach(function (key) {
|
|
|
27
17
|
var _columns = require("./columns");
|
|
28
18
|
Object.keys(_columns).forEach(function (key) {
|
|
29
19
|
if (key === "default" || key === "__esModule") return;
|
|
30
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
31
20
|
if (key in exports && exports[key] === _columns[key]) return;
|
|
32
21
|
Object.defineProperty(exports, key, {
|
|
33
22
|
enumerable: true,
|
|
@@ -39,7 +28,6 @@ Object.keys(_columns).forEach(function (key) {
|
|
|
39
28
|
var _columnGrouping = require("./columnGrouping");
|
|
40
29
|
Object.keys(_columnGrouping).forEach(function (key) {
|
|
41
30
|
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
43
31
|
if (key in exports && exports[key] === _columnGrouping[key]) return;
|
|
44
32
|
Object.defineProperty(exports, key, {
|
|
45
33
|
enumerable: true,
|
|
@@ -51,7 +39,6 @@ Object.keys(_columnGrouping).forEach(function (key) {
|
|
|
51
39
|
var _columnResize = require("./columnResize");
|
|
52
40
|
Object.keys(_columnResize).forEach(function (key) {
|
|
53
41
|
if (key === "default" || key === "__esModule") return;
|
|
54
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
55
42
|
if (key in exports && exports[key] === _columnResize[key]) return;
|
|
56
43
|
Object.defineProperty(exports, key, {
|
|
57
44
|
enumerable: true,
|
|
@@ -63,7 +50,6 @@ Object.keys(_columnResize).forEach(function (key) {
|
|
|
63
50
|
var _density = require("./density");
|
|
64
51
|
Object.keys(_density).forEach(function (key) {
|
|
65
52
|
if (key === "default" || key === "__esModule") return;
|
|
66
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
67
53
|
if (key in exports && exports[key] === _density[key]) return;
|
|
68
54
|
Object.defineProperty(exports, key, {
|
|
69
55
|
enumerable: true,
|
|
@@ -75,7 +61,6 @@ Object.keys(_density).forEach(function (key) {
|
|
|
75
61
|
var _editing = require("./editing");
|
|
76
62
|
Object.keys(_editing).forEach(function (key) {
|
|
77
63
|
if (key === "default" || key === "__esModule") return;
|
|
78
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
79
64
|
if (key in exports && exports[key] === _editing[key]) return;
|
|
80
65
|
Object.defineProperty(exports, key, {
|
|
81
66
|
enumerable: true,
|
|
@@ -87,7 +72,6 @@ Object.keys(_editing).forEach(function (key) {
|
|
|
87
72
|
var _filter = require("./filter");
|
|
88
73
|
Object.keys(_filter).forEach(function (key) {
|
|
89
74
|
if (key === "default" || key === "__esModule") return;
|
|
90
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
91
75
|
if (key in exports && exports[key] === _filter[key]) return;
|
|
92
76
|
Object.defineProperty(exports, key, {
|
|
93
77
|
enumerable: true,
|
|
@@ -99,7 +83,6 @@ Object.keys(_filter).forEach(function (key) {
|
|
|
99
83
|
var _focus = require("./focus");
|
|
100
84
|
Object.keys(_focus).forEach(function (key) {
|
|
101
85
|
if (key === "default" || key === "__esModule") return;
|
|
102
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
103
86
|
if (key in exports && exports[key] === _focus[key]) return;
|
|
104
87
|
Object.defineProperty(exports, key, {
|
|
105
88
|
enumerable: true,
|
|
@@ -111,7 +94,6 @@ Object.keys(_focus).forEach(function (key) {
|
|
|
111
94
|
var _listView = require("./listView");
|
|
112
95
|
Object.keys(_listView).forEach(function (key) {
|
|
113
96
|
if (key === "default" || key === "__esModule") return;
|
|
114
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
115
97
|
if (key in exports && exports[key] === _listView[key]) return;
|
|
116
98
|
Object.defineProperty(exports, key, {
|
|
117
99
|
enumerable: true,
|
|
@@ -123,7 +105,6 @@ Object.keys(_listView).forEach(function (key) {
|
|
|
123
105
|
var _pagination = require("./pagination");
|
|
124
106
|
Object.keys(_pagination).forEach(function (key) {
|
|
125
107
|
if (key === "default" || key === "__esModule") return;
|
|
126
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
127
108
|
if (key in exports && exports[key] === _pagination[key]) return;
|
|
128
109
|
Object.defineProperty(exports, key, {
|
|
129
110
|
enumerable: true,
|
|
@@ -135,7 +116,6 @@ Object.keys(_pagination).forEach(function (key) {
|
|
|
135
116
|
var _preferencesPanel = require("./preferencesPanel");
|
|
136
117
|
Object.keys(_preferencesPanel).forEach(function (key) {
|
|
137
118
|
if (key === "default" || key === "__esModule") return;
|
|
138
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
139
119
|
if (key in exports && exports[key] === _preferencesPanel[key]) return;
|
|
140
120
|
Object.defineProperty(exports, key, {
|
|
141
121
|
enumerable: true,
|
|
@@ -147,7 +127,6 @@ Object.keys(_preferencesPanel).forEach(function (key) {
|
|
|
147
127
|
var _rows = require("./rows");
|
|
148
128
|
Object.keys(_rows).forEach(function (key) {
|
|
149
129
|
if (key === "default" || key === "__esModule") return;
|
|
150
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
151
130
|
if (key in exports && exports[key] === _rows[key]) return;
|
|
152
131
|
Object.defineProperty(exports, key, {
|
|
153
132
|
enumerable: true,
|
|
@@ -159,7 +138,6 @@ Object.keys(_rows).forEach(function (key) {
|
|
|
159
138
|
var _rowSelection = require("./rowSelection");
|
|
160
139
|
Object.keys(_rowSelection).forEach(function (key) {
|
|
161
140
|
if (key === "default" || key === "__esModule") return;
|
|
162
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
163
141
|
if (key in exports && exports[key] === _rowSelection[key]) return;
|
|
164
142
|
Object.defineProperty(exports, key, {
|
|
165
143
|
enumerable: true,
|
|
@@ -171,7 +149,6 @@ Object.keys(_rowSelection).forEach(function (key) {
|
|
|
171
149
|
var _sorting = require("./sorting");
|
|
172
150
|
Object.keys(_sorting).forEach(function (key) {
|
|
173
151
|
if (key === "default" || key === "__esModule") return;
|
|
174
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
175
152
|
if (key in exports && exports[key] === _sorting[key]) return;
|
|
176
153
|
Object.defineProperty(exports, key, {
|
|
177
154
|
enumerable: true,
|
|
@@ -183,7 +160,6 @@ Object.keys(_sorting).forEach(function (key) {
|
|
|
183
160
|
var _dimensions = require("./dimensions");
|
|
184
161
|
Object.keys(_dimensions).forEach(function (key) {
|
|
185
162
|
if (key === "default" || key === "__esModule") return;
|
|
186
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
187
163
|
if (key in exports && exports[key] === _dimensions[key]) return;
|
|
188
164
|
Object.defineProperty(exports, key, {
|
|
189
165
|
enumerable: true,
|
|
@@ -195,7 +171,6 @@ Object.keys(_dimensions).forEach(function (key) {
|
|
|
195
171
|
var _statePersistence = require("./statePersistence");
|
|
196
172
|
Object.keys(_statePersistence).forEach(function (key) {
|
|
197
173
|
if (key === "default" || key === "__esModule") return;
|
|
198
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
199
174
|
if (key in exports && exports[key] === _statePersistence[key]) return;
|
|
200
175
|
Object.defineProperty(exports, key, {
|
|
201
176
|
enumerable: true,
|
|
@@ -207,7 +182,6 @@ Object.keys(_statePersistence).forEach(function (key) {
|
|
|
207
182
|
var _headerFiltering = require("./headerFiltering");
|
|
208
183
|
Object.keys(_headerFiltering).forEach(function (key) {
|
|
209
184
|
if (key === "default" || key === "__esModule") return;
|
|
210
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
211
185
|
if (key in exports && exports[key] === _headerFiltering[key]) return;
|
|
212
186
|
Object.defineProperty(exports, key, {
|
|
213
187
|
enumerable: true,
|
|
@@ -219,7 +193,6 @@ Object.keys(_headerFiltering).forEach(function (key) {
|
|
|
219
193
|
var _virtualization = require("./virtualization");
|
|
220
194
|
Object.keys(_virtualization).forEach(function (key) {
|
|
221
195
|
if (key === "default" || key === "__esModule") return;
|
|
222
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
223
196
|
if (key in exports && exports[key] === _virtualization[key]) return;
|
|
224
197
|
Object.defineProperty(exports, key, {
|
|
225
198
|
enumerable: true,
|
|
@@ -228,4 +201,14 @@ Object.keys(_virtualization).forEach(function (key) {
|
|
|
228
201
|
}
|
|
229
202
|
});
|
|
230
203
|
});
|
|
231
|
-
var
|
|
204
|
+
var _dataSource = require("./dataSource");
|
|
205
|
+
Object.keys(_dataSource).forEach(function (key) {
|
|
206
|
+
if (key === "default" || key === "__esModule") return;
|
|
207
|
+
if (key in exports && exports[key] === _dataSource[key]) return;
|
|
208
|
+
Object.defineProperty(exports, key, {
|
|
209
|
+
enumerable: true,
|
|
210
|
+
get: function () {
|
|
211
|
+
return _dataSource[key];
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GridStateCommunity } from "../../../models/gridStateCommunity.js";
|
|
2
2
|
import { GridRowId } from "../../../models/gridRows.js";
|
|
3
3
|
export declare const gridRowSelectionStateSelector: import("../../..").OutputSelector<GridStateCommunity, unknown, import("../../..").GridRowSelectionModel>;
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
4
|
+
export declare const gridRowSelectionManagerSelector: import("../../..").OutputSelector<GridStateCommunity, import("../../..").GridRowSelectionModel, import("../../../models/gridRowSelectionManager").RowSelectionManager>;
|
|
5
|
+
export declare const gridRowSelectionCountSelector: import("../../..").OutputSelector<GridStateCommunity, number, number>;
|
|
6
|
+
export declare const gridRowSelectionIdsSelector: import("../../..").OutputSelector<GridStateCommunity, GridRowId[], Map<GridRowId, import("../../..").GridValidRowModel>>;
|
|
@@ -3,13 +3,33 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.gridRowSelectionStateSelector = exports.gridRowSelectionManagerSelector = exports.gridRowSelectionIdsSelector = exports.gridRowSelectionCountSelector = void 0;
|
|
7
7
|
var _createSelector = require("../../../utils/createSelector");
|
|
8
8
|
var _gridRowsSelector = require("../rows/gridRowsSelector");
|
|
9
|
+
var _gridFilterSelector = require("../filter/gridFilterSelector");
|
|
10
|
+
var _gridRowSelectionManager = require("../../../models/gridRowSelectionManager");
|
|
9
11
|
const gridRowSelectionStateSelector = exports.gridRowSelectionStateSelector = (0, _createSelector.createRootSelector)(state => state.rowSelection);
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const gridRowSelectionManagerSelector = exports.gridRowSelectionManagerSelector = (0, _createSelector.createSelectorMemoized)(gridRowSelectionStateSelector, _gridRowSelectionManager.createRowSelectionManager);
|
|
13
|
+
const gridRowSelectionCountSelector = exports.gridRowSelectionCountSelector = (0, _createSelector.createSelector)(gridRowSelectionStateSelector, _gridFilterSelector.gridFilteredRowCountSelector, (selection, filteredRowCount) => {
|
|
14
|
+
if (selection.type === 'include') {
|
|
15
|
+
return selection.ids.size;
|
|
16
|
+
}
|
|
17
|
+
// In exclude selection, all rows are selectable.
|
|
18
|
+
return filteredRowCount - selection.ids.size;
|
|
19
|
+
});
|
|
20
|
+
const gridRowSelectionIdsSelector = exports.gridRowSelectionIdsSelector = (0, _createSelector.createSelectorMemoized)(gridRowSelectionStateSelector, _gridRowsSelector.gridRowsLookupSelector, _gridRowsSelector.gridDataRowIdsSelector, (selectionModel, rowsLookup, rowIds) => {
|
|
21
|
+
const map = new Map();
|
|
22
|
+
if (selectionModel.type === 'include') {
|
|
23
|
+
for (const id of selectionModel.ids) {
|
|
24
|
+
map.set(id, rowsLookup[id]);
|
|
25
|
+
}
|
|
26
|
+
} else {
|
|
27
|
+
for (let i = 0; i < rowIds.length; i += 1) {
|
|
28
|
+
const id = rowIds[i];
|
|
29
|
+
if (!selectionModel.ids.has(id)) {
|
|
30
|
+
map.set(id, rowsLookup[id]);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return map;
|
|
35
|
+
});
|