@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
|
@@ -3,6 +3,11 @@ import type { GridSlotProps } from './gridSlotsComponentsProps';
|
|
|
3
3
|
import type { GridIconSlotsComponent } from './gridIconSlotsComponent';
|
|
4
4
|
export type { GridSlotProps } from './gridSlotsComponentsProps';
|
|
5
5
|
export interface GridBaseSlots {
|
|
6
|
+
/**
|
|
7
|
+
* The custom Autocomplete component used in the grid for both header and cells.
|
|
8
|
+
* @default Autocomplete
|
|
9
|
+
*/
|
|
10
|
+
baseAutocomplete: React.JSXElementConstructor<GridSlotProps['baseAutocomplete']>;
|
|
6
11
|
/**
|
|
7
12
|
* The custom Badge component used in the grid for both header and cells.
|
|
8
13
|
* @default Badge
|
|
@@ -18,11 +23,6 @@ export interface GridBaseSlots {
|
|
|
18
23
|
* @default CircularProgress
|
|
19
24
|
*/
|
|
20
25
|
baseCircularProgress: React.JSXElementConstructor<GridSlotProps['baseCircularProgress']>;
|
|
21
|
-
/**
|
|
22
|
-
* The custom Chip component used in the grid.
|
|
23
|
-
* @default Chip
|
|
24
|
-
*/
|
|
25
|
-
baseChip: React.JSXElementConstructor<GridSlotProps['baseChip']>;
|
|
26
26
|
/**
|
|
27
27
|
* The custom Divider component used in the grid.
|
|
28
28
|
* @default Divider
|
|
@@ -43,21 +43,11 @@ export interface GridBaseSlots {
|
|
|
43
43
|
* @default MenuItem
|
|
44
44
|
*/
|
|
45
45
|
baseMenuItem: React.JSXElementConstructor<GridSlotProps['baseMenuItem']>;
|
|
46
|
-
/**
|
|
47
|
-
* The custom InputAdornment component used in the grid.
|
|
48
|
-
* @default InputAdornment
|
|
49
|
-
*/
|
|
50
|
-
baseInputAdornment: React.JSXElementConstructor<GridSlotProps['baseInputAdornment']>;
|
|
51
46
|
/**
|
|
52
47
|
* The custom TextField component used in the grid.
|
|
53
48
|
* @default TextField
|
|
54
49
|
*/
|
|
55
50
|
baseTextField: React.JSXElementConstructor<GridSlotProps['baseTextField']>;
|
|
56
|
-
/**
|
|
57
|
-
* The custom FormControl component used in the grid.
|
|
58
|
-
* @default FormControl
|
|
59
|
-
*/
|
|
60
|
-
baseFormControl: React.JSXElementConstructor<GridSlotProps['baseFormControl']>;
|
|
61
51
|
/**
|
|
62
52
|
* The custom Select component used in the grid.
|
|
63
53
|
* @default Select
|
|
@@ -88,11 +78,6 @@ export interface GridBaseSlots {
|
|
|
88
78
|
* @default Popper
|
|
89
79
|
*/
|
|
90
80
|
basePopper: React.JSXElementConstructor<GridSlotProps['basePopper']>;
|
|
91
|
-
/**
|
|
92
|
-
* The custom InputLabel component used in the grid.
|
|
93
|
-
* @default InputLabel
|
|
94
|
-
*/
|
|
95
|
-
baseInputLabel: React.JSXElementConstructor<GridSlotProps['baseInputLabel']>;
|
|
96
81
|
/**
|
|
97
82
|
* The custom SelectOption component used in the grid.
|
|
98
83
|
* @default SelectOption
|
|
@@ -113,11 +98,6 @@ export interface GridBaseSlots {
|
|
|
113
98
|
* Grid components React prop interface containing all the overridable components.
|
|
114
99
|
*/
|
|
115
100
|
export interface GridSlotsComponent extends GridBaseSlots, GridIconSlotsComponent {
|
|
116
|
-
/**
|
|
117
|
-
* The custom Chip component used in the grid.
|
|
118
|
-
* @default Chip
|
|
119
|
-
*/
|
|
120
|
-
baseChip: React.JSXElementConstructor<GridSlotProps['baseChip']>;
|
|
121
101
|
/**
|
|
122
102
|
* Component rendered for the bottom container.
|
|
123
103
|
* @default GridBottomContainer
|
|
@@ -170,9 +150,9 @@ export interface GridSlotsComponent extends GridBaseSlots, GridIconSlotsComponen
|
|
|
170
150
|
footerRowCount: React.JSXElementConstructor<GridSlotProps['footerRowCount']>;
|
|
171
151
|
/**
|
|
172
152
|
* Toolbar component rendered inside the Header component.
|
|
173
|
-
* @default
|
|
153
|
+
* @default GridToolbar
|
|
174
154
|
*/
|
|
175
|
-
toolbar: React.JSXElementConstructor<GridSlotProps['toolbar']
|
|
155
|
+
toolbar: React.JSXElementConstructor<GridSlotProps['toolbar']>;
|
|
176
156
|
/**
|
|
177
157
|
* Pinned rows container.
|
|
178
158
|
* @ignore - do not document
|
|
@@ -4,13 +4,9 @@ import type { ButtonProps as MUIButtonProps } from '@mui/material/Button';
|
|
|
4
4
|
import type { CircularProgressProps as MUICircularProgressProps } from '@mui/material/CircularProgress';
|
|
5
5
|
import type { LinearProgressProps as MUILinearProgressProps } from '@mui/material/LinearProgress';
|
|
6
6
|
import type { MenuItemProps as MUIMenuItemProps } from '@mui/material/MenuItem';
|
|
7
|
-
import type { FormControlProps } from '@mui/material/FormControl';
|
|
8
7
|
import type { IconButtonProps as MUIIconButtonProps } from '@mui/material/IconButton';
|
|
9
|
-
import type { InputAdornmentProps } from '@mui/material/InputAdornment';
|
|
10
8
|
import type { TooltipProps as MUITooltipProps } from '@mui/material/Tooltip';
|
|
11
|
-
import type { InputLabelProps } from '@mui/material/InputLabel';
|
|
12
9
|
import type { TablePaginationProps } from '@mui/material/TablePagination';
|
|
13
|
-
import type { ChipProps } from '@mui/material/Chip';
|
|
14
10
|
import type { GridToolbarProps } from '../components/toolbar/GridToolbar';
|
|
15
11
|
import type { ColumnHeaderFilterIconButtonProps } from '../components/columnHeaders/GridColumnHeaderFilterIconButton';
|
|
16
12
|
import type { GridColumnMenuProps } from '../components/menu/columnMenu/GridColumnMenuProps';
|
|
@@ -30,9 +26,10 @@ import type { GridLoadingOverlayProps } from '../components/GridLoadingOverlay';
|
|
|
30
26
|
import type { GridRowCountProps } from '../components/GridRowCount';
|
|
31
27
|
import type { GridColumnHeaderSortIconProps } from '../components/columnHeaders/GridColumnHeaderSortIcon';
|
|
32
28
|
import type { GridBottomContainerProps } from '../components/virtualization/GridBottomContainer';
|
|
33
|
-
import type { BadgeProps, ButtonProps, CheckboxProps, CircularProgressProps, DividerProps, IconButtonProps, InputProps, LinearProgressProps, MenuListProps, MenuItemProps, PopperProps, SelectProps, SelectOptionProps, SkeletonProps, SwitchProps, TooltipProps, TextFieldProps } from './gridBaseSlots';
|
|
29
|
+
import type { AutocompleteProps, BadgeProps, ButtonProps, CheckboxProps, CircularProgressProps, DividerProps, IconButtonProps, InputProps, LinearProgressProps, MenuListProps, MenuItemProps, PopperProps, SelectProps, SelectOptionProps, SkeletonProps, SwitchProps, TooltipProps, TextFieldProps } from './gridBaseSlots';
|
|
34
30
|
type RootProps = React.HTMLAttributes<HTMLDivElement> & Record<`data-${string}`, string>;
|
|
35
31
|
type MainProps = React.HTMLAttributes<HTMLDivElement> & Record<`data-${string}`, string>;
|
|
32
|
+
export interface BaseAutocompletePropsOverrides {}
|
|
36
33
|
export interface BaseBadgePropsOverrides {}
|
|
37
34
|
export interface BaseCheckboxPropsOverrides {}
|
|
38
35
|
export interface BaseCircularProgressPropsOverrides {}
|
|
@@ -41,12 +38,10 @@ export interface BaseLinearProgressPropsOverrides {}
|
|
|
41
38
|
export interface BaseMenuListPropsOverrides {}
|
|
42
39
|
export interface BaseMenuItemPropsOverrides {}
|
|
43
40
|
export interface BaseTextFieldPropsOverrides {}
|
|
44
|
-
export interface BaseFormControlPropsOverrides {}
|
|
45
41
|
export interface BaseSelectPropsOverrides {}
|
|
46
42
|
export interface BaseSwitchPropsOverrides {}
|
|
47
43
|
export interface BaseButtonPropsOverrides {}
|
|
48
44
|
export interface BaseIconButtonPropsOverrides {}
|
|
49
|
-
export interface BaseInputAdornmentPropsOverrides {}
|
|
50
45
|
export interface BaseTooltipPropsOverrides {}
|
|
51
46
|
export interface BasePopperPropsOverrides {}
|
|
52
47
|
export interface BaseInputPropsOverrides {}
|
|
@@ -76,6 +71,7 @@ export interface SkeletonCellPropsOverrides {}
|
|
|
76
71
|
export interface RowPropsOverrides {}
|
|
77
72
|
export interface BottomContainerPropsOverrides {}
|
|
78
73
|
interface BaseSlotProps {
|
|
74
|
+
baseAutocomplete: AutocompleteProps<string, true, false, true> & BaseAutocompletePropsOverrides;
|
|
79
75
|
baseBadge: BadgeProps & BaseBadgePropsOverrides;
|
|
80
76
|
baseCheckbox: CheckboxProps & BaseCheckboxPropsOverrides;
|
|
81
77
|
baseCircularProgress: CircularProgressProps & BaseCircularProgressPropsOverrides;
|
|
@@ -84,19 +80,15 @@ interface BaseSlotProps {
|
|
|
84
80
|
baseMenuList: MenuListProps & BaseMenuListPropsOverrides;
|
|
85
81
|
baseMenuItem: MenuItemProps & BaseMenuItemPropsOverrides;
|
|
86
82
|
baseTextField: TextFieldProps & BaseTextFieldPropsOverrides;
|
|
87
|
-
baseFormControl: FormControlProps & BaseFormControlPropsOverrides;
|
|
88
83
|
baseSwitch: SwitchProps & BaseSwitchPropsOverrides;
|
|
89
84
|
baseButton: ButtonProps & BaseButtonPropsOverrides;
|
|
90
85
|
baseIconButton: IconButtonProps & BaseIconButtonPropsOverrides;
|
|
91
86
|
basePopper: PopperProps & BasePopperPropsOverrides;
|
|
92
87
|
baseTooltip: TooltipProps & BaseTooltipPropsOverrides;
|
|
93
88
|
baseInput: InputProps & BaseInputPropsOverrides;
|
|
94
|
-
baseInputLabel: InputLabelProps & BaseInputLabelPropsOverrides;
|
|
95
|
-
baseInputAdornment: InputAdornmentProps & BaseInputAdornmentPropsOverrides;
|
|
96
89
|
baseSelect: SelectProps & BaseSelectPropsOverrides;
|
|
97
90
|
baseSelectOption: SelectOptionProps & BaseSelectOptionPropsOverrides;
|
|
98
91
|
baseSkeleton: SkeletonProps & BaseSkeletonPropsOverrides;
|
|
99
|
-
baseChip: ChipProps & BaseChipPropsOverrides;
|
|
100
92
|
}
|
|
101
93
|
interface MaterialSlotProps {
|
|
102
94
|
baseBadge: MUIBadgeProps;
|
package/esm/models/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from "./gridPaginationProps.js";
|
|
|
10
10
|
export * from "./gridRenderContextProps.js";
|
|
11
11
|
export * from "./gridRows.js";
|
|
12
12
|
export * from "./gridRowSelectionModel.js";
|
|
13
|
+
export { createRowSelectionManager } from "./gridRowSelectionManager.js";
|
|
13
14
|
export * from "./params/index.js";
|
|
14
15
|
export * from "./gridCellClass.js";
|
|
15
16
|
export * from "./gridCell.js";
|
|
@@ -22,7 +23,7 @@ export * from "./gridDensity.js";
|
|
|
22
23
|
export * from "./logger.js";
|
|
23
24
|
export * from "./muiEvent.js";
|
|
24
25
|
export * from "./events/index.js";
|
|
25
|
-
export
|
|
26
|
+
export type { GridSortCellParams, GridSortDirection, GridComparatorFn, GridSortModel } from './gridSortModel';
|
|
26
27
|
export * from "./gridColumnGrouping.js";
|
|
27
28
|
export type { GridDataSourceCache } from './gridDataSource';
|
|
28
29
|
export type { GridExportOptions, GridFileExportOptions, GridGetRowsToExportParams, GridCsvGetRowsToExportParams, GridPrintGetRowsToExportParams, GridCsvExportOptions, GridPrintExportOptions } from './gridExport';
|
package/esm/models/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./gridPaginationProps.js";
|
|
|
9
9
|
export * from "./gridRenderContextProps.js";
|
|
10
10
|
export * from "./gridRows.js";
|
|
11
11
|
export * from "./gridRowSelectionModel.js";
|
|
12
|
+
export { createRowSelectionManager } from "./gridRowSelectionManager.js";
|
|
12
13
|
export * from "./params/index.js";
|
|
13
14
|
export * from "./gridCellClass.js";
|
|
14
15
|
export * from "./gridCell.js";
|
|
@@ -20,12 +21,10 @@ export * from "./gridDensity.js";
|
|
|
20
21
|
export * from "./logger.js";
|
|
21
22
|
export * from "./muiEvent.js";
|
|
22
23
|
export * from "./events/index.js";
|
|
23
|
-
export * from "./gridSortModel.js";
|
|
24
24
|
export * from "./gridColumnGrouping.js";
|
|
25
25
|
|
|
26
26
|
// Do not export GridExportFormat and GridExportExtension which are override in pro package
|
|
27
27
|
|
|
28
28
|
export * from "./gridFilterOperator.js";
|
|
29
29
|
|
|
30
|
-
// Utils shared across the X packages
|
|
31
|
-
export {};
|
|
30
|
+
// Utils shared across the X packages
|
|
@@ -18,7 +18,7 @@ import { GridClasses } from "../../constants/gridClasses.js";
|
|
|
18
18
|
import { GridRowHeightParams, GridRowHeightReturnValue, GridRowParams, GridRowSpacing, GridRowSpacingParams, GridRowClassNameParams } from "../params/index.js";
|
|
19
19
|
import { GridCellParams } from "../params/gridCellParams.js";
|
|
20
20
|
import { GridFilterModel } from "../gridFilterModel.js";
|
|
21
|
-
import {
|
|
21
|
+
import { GridRowSelectionModel } from "../gridRowSelectionModel.js";
|
|
22
22
|
import { GridInitialStateCommunity } from "../gridStateCommunity.js";
|
|
23
23
|
import { GridSlotsComponentsProps } from "../gridSlotsComponentsProps.js";
|
|
24
24
|
import { GridColumnVisibilityModel } from "../../hooks/features/columns/gridColumnsInterfaces.js";
|
|
@@ -26,8 +26,9 @@ import { GridCellModesModel, GridRowModesModel } from "../api/gridEditingApi.js"
|
|
|
26
26
|
import { GridColumnGroupingModel } from "../gridColumnGrouping.js";
|
|
27
27
|
import { GridPaginationMeta, GridPaginationModel } from "../gridPaginationProps.js";
|
|
28
28
|
import type { GridAutosizeOptions } from '../../hooks/features/columnResize';
|
|
29
|
-
import type { GridDataSource, GridDataSourceCache
|
|
29
|
+
import type { GridDataSource, GridDataSourceCache } from '../gridDataSource';
|
|
30
30
|
import type { GridRowSelectionPropagation } from '../gridRowSelectionModel';
|
|
31
|
+
import type { GridGetRowsError, GridUpdateRowError } from '../../hooks/features/dataSource/gridDataSourceError';
|
|
31
32
|
export interface GridExperimentalFeatures {
|
|
32
33
|
/**
|
|
33
34
|
* Emits a warning if the cell receives focus without also syncing the focus state.
|
|
@@ -291,6 +292,11 @@ export interface DataGridPropsWithDefaultValues<R extends GridValidRowModel = an
|
|
|
291
292
|
* @default false
|
|
292
293
|
*/
|
|
293
294
|
showColumnVerticalBorder: boolean;
|
|
295
|
+
/**
|
|
296
|
+
* If `true`, the toolbar is displayed.
|
|
297
|
+
* @default false
|
|
298
|
+
*/
|
|
299
|
+
showToolbar: boolean;
|
|
294
300
|
/**
|
|
295
301
|
* The order of the sorting sequence.
|
|
296
302
|
* @default ['asc', 'desc', null]
|
|
@@ -381,6 +387,14 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
381
387
|
* Override or extend the styles applied to the component.
|
|
382
388
|
*/
|
|
383
389
|
classes?: Partial<GridClasses>;
|
|
390
|
+
/**
|
|
391
|
+
* The data source object.
|
|
392
|
+
*/
|
|
393
|
+
dataSource?: GridDataSource;
|
|
394
|
+
/**
|
|
395
|
+
* Data source cache object.
|
|
396
|
+
*/
|
|
397
|
+
dataSourceCache?: GridDataSourceCache | null;
|
|
384
398
|
/**
|
|
385
399
|
* Set the density of the Data Grid.
|
|
386
400
|
* @default "standard"
|
|
@@ -464,6 +478,11 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
464
478
|
* @param {MuiEvent<MuiBaseEvent>} event The event that caused this prop to be called.
|
|
465
479
|
*/
|
|
466
480
|
onCellEditStop?: GridEventListener<'cellEditStop'>;
|
|
481
|
+
/**
|
|
482
|
+
* Callback fired when a data source request fails.
|
|
483
|
+
* @param {GridGetRowsError | GridUpdateRowError} error The data source error object.
|
|
484
|
+
*/
|
|
485
|
+
onDataSourceError?: (error: GridGetRowsError | GridUpdateRowError) => void;
|
|
467
486
|
/**
|
|
468
487
|
* Callback fired when the row turns to edit mode.
|
|
469
488
|
* @param {GridRowParams} params With all properties from [[GridRowParams]].
|
|
@@ -673,7 +692,7 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
673
692
|
/**
|
|
674
693
|
* Sets the row selection model of the Data Grid.
|
|
675
694
|
*/
|
|
676
|
-
rowSelectionModel?:
|
|
695
|
+
rowSelectionModel?: GridRowSelectionModel;
|
|
677
696
|
/**
|
|
678
697
|
* Callback fired when the selection state of one or multiple rows changes.
|
|
679
698
|
* @param {GridRowSelectionModel} rowSelectionModel With all the row ids [[GridSelectionModel]].
|
|
@@ -787,20 +806,6 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
787
806
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
788
807
|
*/
|
|
789
808
|
onColumnWidthChange?: GridEventListener<'columnWidthChange'>;
|
|
790
|
-
/**
|
|
791
|
-
* The data source object.
|
|
792
|
-
*/
|
|
793
|
-
unstable_dataSource?: GridDataSource;
|
|
794
|
-
/**
|
|
795
|
-
* Data source cache object.
|
|
796
|
-
*/
|
|
797
|
-
unstable_dataSourceCache?: GridDataSourceCache | null;
|
|
798
|
-
/**
|
|
799
|
-
* Callback fired when the data source request fails.
|
|
800
|
-
* @param {Error} error The error object.
|
|
801
|
-
* @param {GridGetRowsParams} params With all properties from [[GridGetRowsParams]].
|
|
802
|
-
*/
|
|
803
|
-
unstable_onDataSourceError?: (error: Error, params: GridGetRowsParams) => void;
|
|
804
809
|
}
|
|
805
810
|
export interface DataGridProSharedPropsWithDefaultValue {
|
|
806
811
|
/**
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare function useCSSVariablesClass(): string;
|
|
3
|
+
export declare function useCSSVariablesContext(): {
|
|
4
|
+
className: string;
|
|
5
|
+
tag: React.JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
export declare function GridPortalWrapper({
|
|
8
|
+
children
|
|
9
|
+
}: {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
export declare function GridCSSVariablesContext(props: {
|
|
13
|
+
children: any;
|
|
14
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useGridConfiguration } from "../../hooks/utils/useGridConfiguration.js";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
const CLASSNAME_PREFIX = 'MuiDataGridVariables';
|
|
5
|
+
const CSSVariablesContext = /*#__PURE__*/React.createContext({
|
|
6
|
+
className: 'unset',
|
|
7
|
+
tag: /*#__PURE__*/_jsx("style", {
|
|
8
|
+
href: "/unset"
|
|
9
|
+
})
|
|
10
|
+
});
|
|
11
|
+
export function useCSSVariablesClass() {
|
|
12
|
+
return React.useContext(CSSVariablesContext).className;
|
|
13
|
+
}
|
|
14
|
+
export function useCSSVariablesContext() {
|
|
15
|
+
return React.useContext(CSSVariablesContext);
|
|
16
|
+
}
|
|
17
|
+
export function GridPortalWrapper({
|
|
18
|
+
children
|
|
19
|
+
}) {
|
|
20
|
+
const className = useCSSVariablesClass();
|
|
21
|
+
return /*#__PURE__*/_jsx("div", {
|
|
22
|
+
className: className,
|
|
23
|
+
children: children
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
export function GridCSSVariablesContext(props) {
|
|
27
|
+
const config = useGridConfiguration();
|
|
28
|
+
const description = config.hooks.useCSSVariables();
|
|
29
|
+
const context = React.useMemo(() => {
|
|
30
|
+
const className = `${CLASSNAME_PREFIX}-${description.id}`;
|
|
31
|
+
const cssString = `.${className}{${variablesToString(description.variables)}}`;
|
|
32
|
+
const tag = /*#__PURE__*/_jsx("style", {
|
|
33
|
+
href: `/${className}`,
|
|
34
|
+
children: cssString
|
|
35
|
+
});
|
|
36
|
+
return {
|
|
37
|
+
className,
|
|
38
|
+
tag
|
|
39
|
+
};
|
|
40
|
+
}, [description]);
|
|
41
|
+
return /*#__PURE__*/_jsx(CSSVariablesContext.Provider, {
|
|
42
|
+
value: context,
|
|
43
|
+
children: props.children
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function variablesToString(variables) {
|
|
47
|
+
let output = '';
|
|
48
|
+
for (const key in variables) {
|
|
49
|
+
if (Object.hasOwn(variables, key)) {
|
|
50
|
+
output += `${key}:${variables[key]};`;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return output;
|
|
54
|
+
}
|
package/esm/utils/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export type { OutputSelector } from './createSelector';
|
|
1
|
+
export type { OutputSelector } from './createSelector';
|
|
2
|
+
export { GridPortalWrapper } from "./css/context.js";
|
package/esm/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { GridPortalWrapper } from "./css/context.js";
|
|
@@ -10,6 +10,7 @@ var _utils = require("../../utils");
|
|
|
10
10
|
var _gridFocusStateSelector = require("../focus/gridFocusStateSelector");
|
|
11
11
|
var _csvSerializer = require("../export/serializers/csvSerializer");
|
|
12
12
|
var _keyboardUtils = require("../../../utils/keyboardUtils");
|
|
13
|
+
var _rowSelection = require("../rowSelection");
|
|
13
14
|
function writeToClipboardPolyfill(data) {
|
|
14
15
|
const span = document.createElement('span');
|
|
15
16
|
span.style.whiteSpace = 'pre';
|
|
@@ -70,8 +71,8 @@ const useGridClipboard = (apiRef, props) => {
|
|
|
70
71
|
return;
|
|
71
72
|
}
|
|
72
73
|
let textToCopy = '';
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
74
|
+
const selectedRowsCount = (0, _rowSelection.gridRowSelectionCountSelector)(apiRef);
|
|
75
|
+
if (selectedRowsCount > 0) {
|
|
75
76
|
textToCopy = apiRef.current.getDataAsCsv({
|
|
76
77
|
includeHeaders: false,
|
|
77
78
|
delimiter: clipboardCopyCellDelimiter,
|
|
@@ -143,7 +143,7 @@ const useGridColumnHeaders = props => {
|
|
|
143
143
|
const indexInSection = i;
|
|
144
144
|
const sectionLength = renderedColumns.length;
|
|
145
145
|
const showLeftBorder = (0, _cellBorderUtils.shouldCellShowLeftBorder)(pinnedPosition, indexInSection);
|
|
146
|
-
const showRightBorder = (0, _cellBorderUtils.shouldCellShowRightBorder)(pinnedPosition, indexInSection, sectionLength, rootProps.
|
|
146
|
+
const showRightBorder = (0, _cellBorderUtils.shouldCellShowRightBorder)(pinnedPosition, indexInSection, sectionLength, rootProps.showColumnVerticalBorder, gridHasFiller);
|
|
147
147
|
columns.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_GridColumnHeaderItem.GridColumnHeaderItem, (0, _extends2.default)({}, sortColumnLookup[colDef.field], {
|
|
148
148
|
columnMenuOpen: open,
|
|
149
149
|
filterItemsCounter: filterColumnLookup[colDef.field] && filterColumnLookup[colDef.field].length,
|
|
@@ -263,7 +263,7 @@ const useGridColumnHeaders = props => {
|
|
|
263
263
|
pinnedPosition: pinnedPosition,
|
|
264
264
|
pinnedOffset: pinnedOffset,
|
|
265
265
|
showLeftBorder: (0, _cellBorderUtils.shouldCellShowLeftBorder)(pinnedPosition, indexInSection),
|
|
266
|
-
showRightBorder: (0, _cellBorderUtils.shouldCellShowRightBorder)(pinnedPosition, indexInSection, visibleColumnGroupHeader.length, rootProps.
|
|
266
|
+
showRightBorder: (0, _cellBorderUtils.shouldCellShowRightBorder)(pinnedPosition, indexInSection, visibleColumnGroupHeader.length, rootProps.showColumnVerticalBorder, gridHasFiller)
|
|
267
267
|
}, index);
|
|
268
268
|
});
|
|
269
269
|
return getFillers(params, children, leftOverflow);
|
|
@@ -8,16 +8,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.useGridColumnResize = exports.columnResizeStateInitializer = 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 _useLazyRef = _interopRequireDefault(require("@mui/utils/useLazyRef"));
|
|
13
14
|
var _RtlProvider = require("@mui/system/RtlProvider");
|
|
14
15
|
var _domUtils = require("../../../utils/domUtils");
|
|
15
16
|
var _gridColumnResizeApi = require("./gridColumnResizeApi");
|
|
16
17
|
var _gridClasses = require("../../../constants/gridClasses");
|
|
17
|
-
var
|
|
18
|
+
var _utils = require("../../utils");
|
|
18
19
|
var _virtualization = require("../virtualization");
|
|
19
20
|
var _createControllablePromise = require("../../../utils/createControllablePromise");
|
|
20
|
-
var
|
|
21
|
+
var _utils2 = require("../../../utils/utils");
|
|
21
22
|
var _useTimeout = require("../../utils/useTimeout");
|
|
22
23
|
var _gridColumnsInterfaces = require("../columns/gridColumnsInterfaces");
|
|
23
24
|
var _columns = require("../columns");
|
|
@@ -80,7 +81,7 @@ function preventClick(event) {
|
|
|
80
81
|
function useColumnVirtualizationDisabled(apiRef) {
|
|
81
82
|
const promise = React.useRef(undefined);
|
|
82
83
|
const selector = () => (0, _virtualization.gridVirtualizationColumnEnabledSelector)(apiRef);
|
|
83
|
-
const value = (0,
|
|
84
|
+
const value = (0, _utils.useGridSelector)(apiRef, selector);
|
|
84
85
|
React.useEffect(() => {
|
|
85
86
|
if (promise.current && value === false) {
|
|
86
87
|
promise.current.resolve();
|
|
@@ -151,7 +152,7 @@ function extractColumnWidths(apiRef, options, columns) {
|
|
|
151
152
|
const min = hasColumnMin ? column.minWidth : 0;
|
|
152
153
|
const max = hasColumnMax ? column.maxWidth : Infinity;
|
|
153
154
|
const maxContent = filteredWidths.length === 0 ? 0 : Math.max(...filteredWidths);
|
|
154
|
-
widthByField[column.field] = (0,
|
|
155
|
+
widthByField[column.field] = (0, _utils2.clamp)(maxContent, min, max);
|
|
155
156
|
});
|
|
156
157
|
root.classList.remove(_gridClasses.gridClasses.autosizing);
|
|
157
158
|
return widthByField;
|
|
@@ -187,7 +188,7 @@ function createResizeRefs() {
|
|
|
187
188
|
*/
|
|
188
189
|
const useGridColumnResize = (apiRef, props) => {
|
|
189
190
|
const isRtl = (0, _RtlProvider.useRtl)();
|
|
190
|
-
const logger = (0,
|
|
191
|
+
const logger = (0, _utils.useGridLogger)(apiRef, 'useGridColumnResize');
|
|
191
192
|
const refs = (0, _useLazyRef.default)(createResizeRefs).current;
|
|
192
193
|
|
|
193
194
|
// To improve accessibility, the separator has padding on both sides.
|
|
@@ -323,15 +324,15 @@ const useGridColumnResize = (apiRef, props) => {
|
|
|
323
324
|
resizeDirection.current = getResizeDirection(separator, isRtl);
|
|
324
325
|
initialOffsetToSeparator.current = computeOffsetToSeparator(xStart, refs.columnHeaderElement.getBoundingClientRect(), resizeDirection.current);
|
|
325
326
|
};
|
|
326
|
-
const handleResizeMouseUp = (0,
|
|
327
|
-
const handleResizeMouseMove = (0,
|
|
327
|
+
const handleResizeMouseUp = (0, _useEventCallback.default)(finishResize);
|
|
328
|
+
const handleResizeMouseMove = (0, _useEventCallback.default)(nativeEvent => {
|
|
328
329
|
// Cancel move in case some other element consumed a mouseup event and it was not fired.
|
|
329
330
|
if (nativeEvent.buttons === 0) {
|
|
330
331
|
handleResizeMouseUp(nativeEvent);
|
|
331
332
|
return;
|
|
332
333
|
}
|
|
333
334
|
let newWidth = computeNewWidth(initialOffsetToSeparator.current, nativeEvent.clientX, refs.columnHeaderElement.getBoundingClientRect(), resizeDirection.current);
|
|
334
|
-
newWidth = (0,
|
|
335
|
+
newWidth = (0, _utils2.clamp)(newWidth, refs.colDef.minWidth, refs.colDef.maxWidth);
|
|
335
336
|
updateWidth(newWidth);
|
|
336
337
|
const params = {
|
|
337
338
|
element: refs.columnHeaderElement,
|
|
@@ -340,14 +341,14 @@ const useGridColumnResize = (apiRef, props) => {
|
|
|
340
341
|
};
|
|
341
342
|
apiRef.current.publishEvent('columnResize', params, nativeEvent);
|
|
342
343
|
});
|
|
343
|
-
const handleTouchEnd = (0,
|
|
344
|
+
const handleTouchEnd = (0, _useEventCallback.default)(nativeEvent => {
|
|
344
345
|
const finger = trackFinger(nativeEvent, touchId.current);
|
|
345
346
|
if (!finger) {
|
|
346
347
|
return;
|
|
347
348
|
}
|
|
348
349
|
finishResize(nativeEvent);
|
|
349
350
|
});
|
|
350
|
-
const handleTouchMove = (0,
|
|
351
|
+
const handleTouchMove = (0, _useEventCallback.default)(nativeEvent => {
|
|
351
352
|
const finger = trackFinger(nativeEvent, touchId.current);
|
|
352
353
|
if (!finger) {
|
|
353
354
|
return;
|
|
@@ -359,7 +360,7 @@ const useGridColumnResize = (apiRef, props) => {
|
|
|
359
360
|
return;
|
|
360
361
|
}
|
|
361
362
|
let newWidth = computeNewWidth(initialOffsetToSeparator.current, finger.x, refs.columnHeaderElement.getBoundingClientRect(), resizeDirection.current);
|
|
362
|
-
newWidth = (0,
|
|
363
|
+
newWidth = (0, _utils2.clamp)(newWidth, refs.colDef.minWidth, refs.colDef.maxWidth);
|
|
363
364
|
updateWidth(newWidth);
|
|
364
365
|
const params = {
|
|
365
366
|
element: refs.columnHeaderElement,
|
|
@@ -368,7 +369,7 @@ const useGridColumnResize = (apiRef, props) => {
|
|
|
368
369
|
};
|
|
369
370
|
apiRef.current.publishEvent('columnResize', params, nativeEvent);
|
|
370
371
|
});
|
|
371
|
-
const handleTouchStart = (0,
|
|
372
|
+
const handleTouchStart = (0, _useEventCallback.default)(event => {
|
|
372
373
|
const cellSeparator = (0, _domUtils.findParentElementFromClassName)(event.target, _gridClasses.gridClasses['columnSeparator--resizable']);
|
|
373
374
|
// Let the event bubble if the target is not a col separator
|
|
374
375
|
if (!cellSeparator) {
|
|
@@ -387,12 +388,12 @@ const useGridColumnResize = (apiRef, props) => {
|
|
|
387
388
|
field
|
|
388
389
|
}, event);
|
|
389
390
|
storeReferences(colDef, cellSeparator, touch.clientX);
|
|
390
|
-
const doc = (0,
|
|
391
|
+
const doc = (0, _ownerDocument.default)(event.currentTarget);
|
|
391
392
|
doc.addEventListener('touchmove', handleTouchMove);
|
|
392
393
|
doc.addEventListener('touchend', handleTouchEnd);
|
|
393
394
|
});
|
|
394
395
|
const stopListening = React.useCallback(() => {
|
|
395
|
-
const doc = (0,
|
|
396
|
+
const doc = (0, _ownerDocument.default)(apiRef.current.rootElementRef.current);
|
|
396
397
|
doc.body.style.removeProperty('cursor');
|
|
397
398
|
doc.removeEventListener('mousemove', handleResizeMouseMove);
|
|
398
399
|
doc.removeEventListener('mouseup', handleResizeMouseUp);
|
|
@@ -423,7 +424,7 @@ const useGridColumnResize = (apiRef, props) => {
|
|
|
423
424
|
})
|
|
424
425
|
}));
|
|
425
426
|
}, [apiRef]);
|
|
426
|
-
const handleColumnResizeMouseDown = (0,
|
|
427
|
+
const handleColumnResizeMouseDown = (0, _useEventCallback.default)(({
|
|
427
428
|
colDef
|
|
428
429
|
}, event) => {
|
|
429
430
|
// Only handle left clicks
|
|
@@ -443,7 +444,7 @@ const useGridColumnResize = (apiRef, props) => {
|
|
|
443
444
|
field: colDef.field
|
|
444
445
|
}, event);
|
|
445
446
|
storeReferences(colDef, event.currentTarget, event.clientX);
|
|
446
|
-
const doc = (0,
|
|
447
|
+
const doc = (0, _ownerDocument.default)(apiRef.current.rootElementRef.current);
|
|
447
448
|
doc.body.style.cursor = 'col-resize';
|
|
448
449
|
refs.previousMouseClickEvent = event.nativeEvent;
|
|
449
450
|
doc.addEventListener('mousemove', handleResizeMouseMove);
|
|
@@ -453,7 +454,7 @@ const useGridColumnResize = (apiRef, props) => {
|
|
|
453
454
|
// Fixes https://github.com/mui/mui-x/issues/4777
|
|
454
455
|
doc.addEventListener('click', preventClick, true);
|
|
455
456
|
});
|
|
456
|
-
const handleColumnSeparatorDoubleClick = (0,
|
|
457
|
+
const handleColumnSeparatorDoubleClick = (0, _useEventCallback.default)((params, event) => {
|
|
457
458
|
if (props.disableAutosize) {
|
|
458
459
|
return;
|
|
459
460
|
}
|
|
@@ -542,25 +543,25 @@ const useGridColumnResize = (apiRef, props) => {
|
|
|
542
543
|
*/
|
|
543
544
|
|
|
544
545
|
React.useEffect(() => stopListening, [stopListening]);
|
|
545
|
-
(0,
|
|
546
|
+
(0, _utils.useOnMount)(() => {
|
|
546
547
|
if (props.autosizeOnMount) {
|
|
547
548
|
Promise.resolve().then(() => {
|
|
548
549
|
apiRef.current.autosizeColumns(props.autosizeOptions);
|
|
549
550
|
});
|
|
550
551
|
}
|
|
551
552
|
});
|
|
552
|
-
(0,
|
|
553
|
+
(0, _utils.useGridNativeEventListener)(apiRef, () => apiRef.current.columnHeadersContainerRef?.current, 'touchstart', handleTouchStart, {
|
|
553
554
|
passive: true
|
|
554
555
|
});
|
|
555
|
-
(0,
|
|
556
|
+
(0, _utils.useGridApiMethod)(apiRef, {
|
|
556
557
|
autosizeColumns
|
|
557
558
|
}, 'public');
|
|
558
|
-
(0,
|
|
559
|
-
(0,
|
|
560
|
-
(0,
|
|
561
|
-
(0,
|
|
562
|
-
(0,
|
|
563
|
-
(0,
|
|
559
|
+
(0, _utils.useGridApiEventHandler)(apiRef, 'columnResizeStop', handleResizeStop);
|
|
560
|
+
(0, _utils.useGridApiEventHandler)(apiRef, 'columnResizeStart', handleResizeStart);
|
|
561
|
+
(0, _utils.useGridApiEventHandler)(apiRef, 'columnSeparatorMouseDown', handleColumnResizeMouseDown);
|
|
562
|
+
(0, _utils.useGridApiEventHandler)(apiRef, 'columnSeparatorDoubleClick', handleColumnSeparatorDoubleClick);
|
|
563
|
+
(0, _utils.useGridApiOptionHandler)(apiRef, 'columnResize', props.onColumnResize);
|
|
564
|
+
(0, _utils.useGridApiOptionHandler)(apiRef, 'columnWidthChange', props.onColumnWidthChange);
|
|
564
565
|
};
|
|
565
566
|
exports.useGridColumnResize = useGridColumnResize;
|
|
566
567
|
function updateProperty(element, property, delta) {
|
|
@@ -14,6 +14,7 @@ export interface GridColumnsState {
|
|
|
14
14
|
orderedFields: string[];
|
|
15
15
|
lookup: GridColumnLookup;
|
|
16
16
|
columnVisibilityModel: GridColumnVisibilityModel;
|
|
17
|
+
initialColumnVisibilityModel: GridColumnVisibilityModel;
|
|
17
18
|
}
|
|
18
19
|
export interface GridPinnedColumnFields {
|
|
19
20
|
left?: string[];
|
|
@@ -26,6 +26,13 @@ export declare const gridColumnDefinitionsSelector: import("../../..").OutputSel
|
|
|
26
26
|
* @category Visible Columns
|
|
27
27
|
*/
|
|
28
28
|
export declare const gridColumnVisibilityModelSelector: import("../../..").OutputSelector<GridStateCommunity, import("./gridColumnsInterfaces").GridColumnsState, import("./gridColumnsInterfaces").GridColumnVisibilityModel>;
|
|
29
|
+
/**
|
|
30
|
+
* Get the "initial" column visibility model, containing the visibility status of each column.
|
|
31
|
+
* It is updated when the `columns` prop is updated or when `updateColumns` API method is called.
|
|
32
|
+
* If a column is not registered in the model, it is visible.
|
|
33
|
+
* @category Visible Columns
|
|
34
|
+
*/
|
|
35
|
+
export declare const gridInitialColumnVisibilityModelSelector: import("../../..").OutputSelector<GridStateCommunity, import("./gridColumnsInterfaces").GridColumnsState, import("./gridColumnsInterfaces").GridColumnVisibilityModel>;
|
|
29
36
|
/**
|
|
30
37
|
* Get the visible columns as a lookup (an object containing the field for keys and the definition for values).
|
|
31
38
|
* @category Visible Columns
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.gridVisiblePinnedColumnDefinitionsSelector = exports.gridVisibleColumnFieldsSelector = exports.gridVisibleColumnDefinitionsSelector = exports.gridPinnedColumnsSelector = exports.gridHasColSpanSelector = exports.gridFilterableColumnLookupSelector = exports.gridFilterableColumnDefinitionsSelector = exports.gridColumnsStateSelector = exports.gridColumnVisibilityModelSelector = exports.gridColumnPositionsSelector = exports.gridColumnLookupSelector = exports.gridColumnFieldsSelector = exports.gridColumnDefinitionsSelector = void 0;
|
|
6
|
+
exports.gridVisiblePinnedColumnDefinitionsSelector = exports.gridVisibleColumnFieldsSelector = exports.gridVisibleColumnDefinitionsSelector = exports.gridPinnedColumnsSelector = exports.gridInitialColumnVisibilityModelSelector = exports.gridHasColSpanSelector = exports.gridFilterableColumnLookupSelector = exports.gridFilterableColumnDefinitionsSelector = exports.gridColumnsStateSelector = exports.gridColumnVisibilityModelSelector = exports.gridColumnPositionsSelector = exports.gridColumnLookupSelector = exports.gridColumnFieldsSelector = exports.gridColumnDefinitionsSelector = void 0;
|
|
7
7
|
var _createSelector = require("../../../utils/createSelector");
|
|
8
8
|
var _gridColumnsInterfaces = require("./gridColumnsInterfaces");
|
|
9
9
|
var _gridCoreSelector = require("../../core/gridCoreSelector");
|
|
@@ -38,6 +38,14 @@ const gridColumnDefinitionsSelector = exports.gridColumnDefinitionsSelector = (0
|
|
|
38
38
|
*/
|
|
39
39
|
const gridColumnVisibilityModelSelector = exports.gridColumnVisibilityModelSelector = (0, _createSelector.createSelector)(gridColumnsStateSelector, columnsState => columnsState.columnVisibilityModel);
|
|
40
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Get the "initial" column visibility model, containing the visibility status of each column.
|
|
43
|
+
* It is updated when the `columns` prop is updated or when `updateColumns` API method is called.
|
|
44
|
+
* If a column is not registered in the model, it is visible.
|
|
45
|
+
* @category Visible Columns
|
|
46
|
+
*/
|
|
47
|
+
const gridInitialColumnVisibilityModelSelector = exports.gridInitialColumnVisibilityModelSelector = (0, _createSelector.createSelector)(gridColumnsStateSelector, columnsState => columnsState.initialColumnVisibilityModel);
|
|
48
|
+
|
|
41
49
|
/**
|
|
42
50
|
* Get the visible columns as a lookup (an object containing the field for keys and the definition for values).
|
|
43
51
|
* @category Visible Columns
|
|
@@ -48,12 +48,14 @@ export declare const createColumnsState: ({
|
|
|
48
48
|
columnsToUpsert,
|
|
49
49
|
initialState,
|
|
50
50
|
columnVisibilityModel,
|
|
51
|
-
keepOnlyColumnsToUpsert
|
|
51
|
+
keepOnlyColumnsToUpsert,
|
|
52
|
+
updateInitialVisibilityModel
|
|
52
53
|
}: {
|
|
53
54
|
columnsToUpsert: readonly GridColDef[];
|
|
54
55
|
initialState: GridColumnsInitialState | undefined;
|
|
55
56
|
columnVisibilityModel?: GridColumnVisibilityModel;
|
|
56
57
|
keepOnlyColumnsToUpsert: boolean;
|
|
58
|
+
updateInitialVisibilityModel?: boolean;
|
|
57
59
|
apiRef: RefObject<GridApiCommunity>;
|
|
58
60
|
}) => GridColumnsState;
|
|
59
61
|
export declare function getFirstNonSpannedColumnToRender({
|