@mui/x-data-grid 8.0.0-alpha.5 → 8.0.0-alpha.7
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 +206 -1
- package/DataGrid/DataGrid.js +4 -3
- package/DataGrid/useDataGridComponent.d.ts +1 -1
- package/components/GridColumnHeaders.d.ts +1 -1
- package/components/GridColumnHeaders.js +4 -4
- package/components/GridFooter.d.ts +2 -1
- package/components/GridFooter.js +4 -4
- package/components/GridLoadingOverlay.d.ts +1 -1
- package/components/GridLoadingOverlay.js +10 -8
- package/components/GridNoResultsOverlay.d.ts +2 -1
- package/components/GridNoResultsOverlay.js +4 -4
- package/components/GridNoRowsOverlay.d.ts +2 -1
- package/components/GridNoRowsOverlay.js +4 -4
- package/components/GridPagination.d.ts +1 -1
- package/components/GridPagination.js +5 -3
- package/components/GridRow.d.ts +1 -1
- package/components/GridRow.js +3 -2
- package/components/GridRowCount.d.ts +1 -1
- package/components/GridRowCount.js +3 -2
- package/components/GridSelectedRowCount.d.ts +4 -1
- package/components/GridSelectedRowCount.js +3 -2
- package/components/GridSkeletonLoadingOverlay.d.ts +1 -1
- package/components/GridSkeletonLoadingOverlay.js +4 -3
- package/components/cell/GridActionsCellItem.d.ts +17 -10
- package/components/cell/GridActionsCellItem.js +5 -2
- package/components/cell/GridCell.d.ts +1 -1
- package/components/cell/GridCell.js +3 -2
- package/components/cell/GridEditDateCell.js +1 -1
- package/components/cell/GridEditInputCell.d.ts +1 -1
- package/components/cell/GridEditInputCell.js +73 -4
- package/components/cell/GridEditSingleSelectCell.js +2 -2
- package/components/cell/GridSkeletonCell.js +1 -2
- package/components/columnHeaders/ColumnHeaderMenuIcon.d.ts +1 -1
- package/components/columnHeaders/GridBaseColumnHeaders.d.ts +1 -1
- package/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -1
- package/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
- package/components/columnHeaders/GridGenericColumnHeaderItem.d.ts +1 -1
- package/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
- package/components/columnHeaders/GridIconButtonContainer.d.ts +1 -1
- package/components/columnHeaders/GridIconButtonContainer.js +5 -3
- package/components/columnSelection/GridCellCheckboxRenderer.d.ts +2 -2
- package/components/columnSelection/GridCellCheckboxRenderer.js +7 -4
- package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
- package/components/columnSelection/GridHeaderCheckbox.js +11 -5
- package/components/columnsManagement/GridColumnsManagement.js +2 -2
- package/components/containers/GridFooterContainer.d.ts +1 -1
- package/components/containers/GridFooterContainer.js +5 -3
- package/components/containers/GridOverlay.d.ts +1 -1
- package/components/containers/GridOverlay.js +5 -3
- package/components/containers/GridRoot.d.ts +1 -1
- package/components/containers/GridRoot.js +5 -3
- package/components/containers/GridToolbarContainer.d.ts +1 -1
- package/components/containers/GridToolbarContainer.js +3 -2
- package/components/menu/columnMenu/GridColumnMenu.d.ts +2 -2
- package/components/menu/columnMenu/GridColumnMenu.js +5 -5
- package/components/menu/columnMenu/GridColumnMenuContainer.d.ts +1 -1
- package/components/menu/columnMenu/GridColumnMenuContainer.js +3 -2
- package/components/panel/GridPanel.d.ts +2 -2
- package/components/panel/GridPanel.js +3 -2
- package/components/panel/GridPanelWrapper.d.ts +1 -1
- package/components/panel/GridPanelWrapper.js +5 -3
- package/components/panel/filterPanel/GridFilterForm.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterForm.js +3 -2
- package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.js +9 -9
- package/components/panel/filterPanel/GridFilterInputValue.js +13 -9
- package/components/panel/filterPanel/GridFilterPanel.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterPanel.js +4 -4
- package/components/panel/filterPanel/index.d.ts +2 -1
- package/components/panel/filterPanel/index.js +1 -1
- package/components/toolbar/GridToolbar.d.ts +1 -1
- package/components/toolbar/GridToolbar.js +4 -4
- package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
- package/components/toolbar/GridToolbarColumnsButton.js +3 -2
- package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
- package/components/toolbar/GridToolbarDensitySelector.js +3 -2
- package/components/toolbar/GridToolbarExport.d.ts +1 -1
- package/components/toolbar/GridToolbarExport.js +2 -1
- package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
- package/components/toolbar/GridToolbarExportContainer.js +3 -2
- package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
- package/components/toolbar/GridToolbarFilterButton.js +3 -2
- package/components/toolbar/GridToolbarQuickFilter.js +2 -2
- package/components/virtualization/GridMainContainer.d.ts +3 -1
- package/components/virtualization/GridMainContainer.js +3 -2
- package/components/virtualization/GridVirtualScrollbar.d.ts +1 -1
- package/components/virtualization/GridVirtualScrollbar.js +2 -1
- package/components/virtualization/GridVirtualScrollerContent.d.ts +2 -0
- package/components/virtualization/GridVirtualScrollerContent.js +5 -5
- package/components/virtualization/GridVirtualScrollerRenderZone.d.ts +2 -0
- package/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +9 -2
- package/hooks/core/pipeProcessing/useGridPipeProcessing.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
- package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.d.ts +1 -1
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +1 -1
- package/hooks/core/useGridApiInitialization.d.ts +1 -1
- package/hooks/core/useGridApiInitialization.js +2 -2
- package/hooks/core/useGridInitialization.d.ts +1 -1
- package/hooks/core/useGridIsRtl.d.ts +1 -1
- package/hooks/core/useGridLocaleText.d.ts +1 -1
- package/hooks/core/useGridLoggerFactory.d.ts +1 -1
- package/hooks/core/useGridRefs.d.ts +1 -1
- package/hooks/core/useGridStateInitialization.d.ts +1 -1
- package/hooks/features/columnResize/useGridColumnResize.d.ts +1 -1
- package/hooks/features/columnResize/useGridColumnResize.js +4 -4
- package/hooks/features/editing/useGridRowEditing.js +1 -1
- package/hooks/features/export/useGridPrintExport.js +1 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
- package/hooks/features/rowSelection/useGridRowSelectionPreProcessors.d.ts +1 -1
- package/hooks/features/rows/useGridRowSpanning.js +76 -87
- package/hooks/features/rows/useGridRowsPreProcessors.d.ts +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +3 -3
- package/hooks/features/virtualization/useGridVirtualScroller.js +5 -1
- package/hooks/utils/useGridApiEventHandler.js +1 -1
- package/hooks/utils/useGridApiMethod.d.ts +1 -1
- package/hooks/utils/useGridApiRef.d.ts +1 -1
- package/hooks/utils/useGridInitializeState.d.ts +2 -2
- package/hooks/utils/useGridLogger.d.ts +1 -1
- package/hooks/utils/useGridVisibleRows.d.ts +2 -2
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/locales/nlNL.js +5 -6
- package/material/index.js +6 -0
- package/models/api/gridCoreApi.d.ts +7 -7
- package/models/api/gridDensityApi.d.ts +1 -1
- package/models/gridBaseSlots.d.ts +47 -2
- package/models/gridSlotsComponent.d.ts +16 -1
- package/models/gridSlotsComponentsProps.d.ts +24 -7
- package/models/props/DataGridProps.d.ts +1 -1
- package/modern/DataGrid/DataGrid.js +4 -3
- package/modern/components/GridColumnHeaders.js +4 -4
- package/modern/components/GridFooter.js +4 -4
- package/modern/components/GridLoadingOverlay.js +10 -8
- package/modern/components/GridNoResultsOverlay.js +4 -4
- package/modern/components/GridNoRowsOverlay.js +4 -4
- package/modern/components/GridPagination.js +5 -3
- package/modern/components/GridRow.js +3 -2
- package/modern/components/GridRowCount.js +3 -2
- package/modern/components/GridSelectedRowCount.js +3 -2
- package/modern/components/GridSkeletonLoadingOverlay.js +4 -3
- package/modern/components/cell/GridActionsCellItem.js +5 -2
- package/modern/components/cell/GridCell.js +3 -2
- package/modern/components/cell/GridEditDateCell.js +1 -1
- package/modern/components/cell/GridEditInputCell.js +73 -4
- package/modern/components/cell/GridEditSingleSelectCell.js +2 -2
- package/modern/components/cell/GridSkeletonCell.js +1 -2
- package/modern/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
- package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -1
- package/modern/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
- package/modern/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
- package/modern/components/columnHeaders/GridIconButtonContainer.js +5 -3
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +7 -4
- package/modern/components/columnSelection/GridHeaderCheckbox.js +11 -5
- package/modern/components/columnsManagement/GridColumnsManagement.js +2 -2
- package/modern/components/containers/GridFooterContainer.js +5 -3
- package/modern/components/containers/GridOverlay.js +5 -3
- package/modern/components/containers/GridRoot.js +5 -3
- package/modern/components/containers/GridToolbarContainer.js +3 -2
- package/modern/components/menu/columnMenu/GridColumnMenu.js +5 -5
- package/modern/components/menu/columnMenu/GridColumnMenuContainer.js +3 -2
- package/modern/components/panel/GridPanel.js +3 -2
- package/modern/components/panel/GridPanelWrapper.js +5 -3
- package/modern/components/panel/filterPanel/GridFilterForm.js +3 -2
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +9 -9
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +13 -9
- package/modern/components/panel/filterPanel/GridFilterPanel.js +4 -4
- package/modern/components/panel/filterPanel/index.js +1 -1
- package/modern/components/toolbar/GridToolbar.js +4 -4
- package/modern/components/toolbar/GridToolbarColumnsButton.js +3 -2
- package/modern/components/toolbar/GridToolbarDensitySelector.js +3 -2
- package/modern/components/toolbar/GridToolbarExport.js +2 -1
- package/modern/components/toolbar/GridToolbarExportContainer.js +3 -2
- package/modern/components/toolbar/GridToolbarFilterButton.js +3 -2
- package/modern/components/toolbar/GridToolbarQuickFilter.js +2 -2
- package/modern/components/virtualization/GridMainContainer.js +3 -2
- package/modern/components/virtualization/GridVirtualScrollbar.js +2 -1
- package/modern/components/virtualization/GridVirtualScrollerContent.js +5 -5
- package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
- package/modern/hooks/core/useGridApiInitialization.js +2 -2
- package/modern/hooks/features/columnResize/useGridColumnResize.js +4 -4
- package/modern/hooks/features/editing/useGridRowEditing.js +1 -1
- package/modern/hooks/features/export/useGridPrintExport.js +1 -1
- package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
- package/modern/hooks/features/rows/useGridRowSpanning.js +76 -87
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +5 -1
- package/modern/hooks/utils/useGridApiEventHandler.js +1 -1
- package/modern/index.js +1 -1
- package/modern/locales/nlNL.js +5 -6
- package/modern/material/index.js +6 -0
- package/modern/utils/utils.js +6 -1
- package/node/DataGrid/DataGrid.js +4 -3
- package/node/components/GridColumnHeaders.js +4 -4
- package/node/components/GridFooter.js +4 -4
- package/node/components/GridLoadingOverlay.js +10 -8
- package/node/components/GridNoResultsOverlay.js +4 -4
- package/node/components/GridNoRowsOverlay.js +4 -4
- package/node/components/GridPagination.js +5 -3
- package/node/components/GridRow.js +3 -2
- package/node/components/GridRowCount.js +3 -2
- package/node/components/GridSelectedRowCount.js +3 -2
- package/node/components/GridSkeletonLoadingOverlay.js +4 -3
- package/node/components/cell/GridActionsCellItem.js +4 -3
- package/node/components/cell/GridCell.js +3 -2
- package/node/components/cell/GridEditDateCell.js +1 -1
- package/node/components/cell/GridEditInputCell.js +73 -4
- package/node/components/cell/GridEditSingleSelectCell.js +2 -2
- package/node/components/cell/GridSkeletonCell.js +1 -2
- package/node/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
- package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -1
- package/node/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
- package/node/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
- package/node/components/columnHeaders/GridIconButtonContainer.js +5 -3
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +7 -4
- package/node/components/columnSelection/GridHeaderCheckbox.js +11 -5
- package/node/components/columnsManagement/GridColumnsManagement.js +2 -2
- package/node/components/containers/GridFooterContainer.js +5 -3
- package/node/components/containers/GridOverlay.js +5 -3
- package/node/components/containers/GridRoot.js +5 -3
- package/node/components/containers/GridToolbarContainer.js +3 -2
- package/node/components/menu/columnMenu/GridColumnMenu.js +5 -5
- package/node/components/menu/columnMenu/GridColumnMenuContainer.js +3 -2
- package/node/components/panel/GridPanel.js +3 -2
- package/node/components/panel/GridPanelWrapper.js +5 -3
- package/node/components/panel/filterPanel/GridFilterForm.js +3 -2
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +10 -11
- package/node/components/panel/filterPanel/GridFilterInputValue.js +13 -9
- package/node/components/panel/filterPanel/GridFilterPanel.js +4 -4
- package/node/components/panel/filterPanel/index.js +7 -11
- package/node/components/toolbar/GridToolbar.js +4 -4
- package/node/components/toolbar/GridToolbarColumnsButton.js +3 -2
- package/node/components/toolbar/GridToolbarDensitySelector.js +3 -2
- package/node/components/toolbar/GridToolbarExport.js +2 -1
- package/node/components/toolbar/GridToolbarExportContainer.js +3 -2
- package/node/components/toolbar/GridToolbarFilterButton.js +3 -2
- package/node/components/toolbar/GridToolbarQuickFilter.js +2 -2
- package/node/components/virtualization/GridMainContainer.js +3 -2
- package/node/components/virtualization/GridVirtualScrollbar.js +2 -1
- package/node/components/virtualization/GridVirtualScrollerContent.js +5 -5
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
- package/node/hooks/core/useGridApiInitialization.js +2 -2
- package/node/hooks/features/columnResize/useGridColumnResize.js +4 -4
- package/node/hooks/features/editing/useGridRowEditing.js +1 -1
- package/node/hooks/features/export/useGridPrintExport.js +1 -1
- package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
- package/node/hooks/features/rows/useGridRowSpanning.js +74 -85
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +5 -1
- package/node/hooks/utils/useGridApiEventHandler.js +1 -1
- package/node/index.js +1 -1
- package/node/locales/nlNL.js +5 -6
- package/node/material/index.js +6 -0
- package/node/utils/utils.js +8 -1
- package/package.json +2 -2
- package/utils/utils.d.ts +1 -0
- package/utils/utils.js +6 -1
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { BadgeProps as MUIBadgeProps } from '@mui/material/Badge';
|
|
3
|
+
import type { ButtonProps as MUIButtonProps } from '@mui/material/Button';
|
|
3
4
|
import type { CheckboxProps } from '@mui/material/Checkbox';
|
|
5
|
+
import type { CircularProgressProps as MUICircularProgressProps } from '@mui/material/CircularProgress';
|
|
6
|
+
import type { LinearProgressProps as MUILinearProgressProps } from '@mui/material/LinearProgress';
|
|
4
7
|
import type { MenuListProps } from '@mui/material/MenuList';
|
|
5
8
|
import type { MenuItemProps as MUIMenuItemProps } from '@mui/material/MenuItem';
|
|
6
9
|
import type { TextFieldProps } from '@mui/material/TextField';
|
|
7
10
|
import type { FormControlProps } from '@mui/material/FormControl';
|
|
8
11
|
import type { SelectProps } from '@mui/material/Select';
|
|
9
12
|
import type { SwitchProps } from '@mui/material/Switch';
|
|
10
|
-
import type {
|
|
11
|
-
import type { IconButtonProps } from '@mui/material/IconButton';
|
|
13
|
+
import type { IconButtonProps as MUIIconButtonProps } from '@mui/material/IconButton';
|
|
12
14
|
import type { InputAdornmentProps } from '@mui/material/InputAdornment';
|
|
13
|
-
import type { TooltipProps } from '@mui/material/Tooltip';
|
|
15
|
+
import type { TooltipProps as MUITooltipProps } from '@mui/material/Tooltip';
|
|
14
16
|
import type { InputLabelProps } from '@mui/material/InputLabel';
|
|
15
17
|
import type { PopperProps } from '@mui/material/Popper';
|
|
16
18
|
import type { TablePaginationProps } from '@mui/material/TablePagination';
|
|
@@ -33,15 +35,19 @@ import type { GridColumnsManagementProps } from '../components/columnsManagement
|
|
|
33
35
|
import type { GridLoadingOverlayProps } from '../components/GridLoadingOverlay';
|
|
34
36
|
import type { GridRowCountProps } from '../components/GridRowCount';
|
|
35
37
|
import type { GridColumnHeaderSortIconProps } from '../components/columnHeaders/GridColumnHeaderSortIcon';
|
|
36
|
-
import type { BadgeProps, DividerProps, MenuItemProps } from './gridBaseSlots';
|
|
38
|
+
import type { BadgeProps, ButtonProps, CircularProgressProps, DividerProps, IconButtonProps, LinearProgressProps, MenuItemProps, SkeletonProps, TooltipProps } from './gridBaseSlots';
|
|
37
39
|
type RootProps = React.HTMLAttributes<HTMLDivElement> & Record<`data-${string}`, string>;
|
|
38
40
|
type MainProps = React.HTMLAttributes<HTMLDivElement> & Record<`data-${string}`, string>;
|
|
39
41
|
export interface BaseBadgePropsOverrides {
|
|
40
42
|
}
|
|
41
43
|
export interface BaseCheckboxPropsOverrides {
|
|
42
44
|
}
|
|
45
|
+
export interface BaseCircularProgressPropsOverrides {
|
|
46
|
+
}
|
|
43
47
|
export interface BaseDividerPropsOverrides {
|
|
44
48
|
}
|
|
49
|
+
export interface BaseLinearProgressPropsOverrides {
|
|
50
|
+
}
|
|
45
51
|
export interface BaseMenuListPropsOverrides {
|
|
46
52
|
}
|
|
47
53
|
export interface BaseMenuItemPropsOverrides {
|
|
@@ -68,6 +74,8 @@ export interface BaseInputLabelPropsOverrides {
|
|
|
68
74
|
}
|
|
69
75
|
export interface BaseSelectOptionPropsOverrides {
|
|
70
76
|
}
|
|
77
|
+
export interface BaseSkeletonPropsOverrides {
|
|
78
|
+
}
|
|
71
79
|
export interface BaseChipPropsOverrides {
|
|
72
80
|
}
|
|
73
81
|
export interface CellPropsOverrides {
|
|
@@ -111,7 +119,9 @@ export interface RowPropsOverrides {
|
|
|
111
119
|
interface BaseSlotProps {
|
|
112
120
|
baseBadge: BadgeProps & BaseBadgePropsOverrides;
|
|
113
121
|
baseCheckbox: CheckboxProps & BaseCheckboxPropsOverrides;
|
|
122
|
+
baseCircularProgress: CircularProgressProps & BaseCircularProgressPropsOverrides;
|
|
114
123
|
baseDivider: DividerProps & BaseDividerPropsOverrides;
|
|
124
|
+
baseLinearProgress: LinearProgressProps & BaseLinearProgressPropsOverrides;
|
|
115
125
|
baseMenuList: MenuListProps & BaseMenuListPropsOverrides;
|
|
116
126
|
baseMenuItem: MenuItemProps & BaseMenuItemPropsOverrides;
|
|
117
127
|
baseTextField: TextFieldProps & BaseTextFieldPropsOverrides;
|
|
@@ -129,11 +139,17 @@ interface BaseSlotProps {
|
|
|
129
139
|
value: any;
|
|
130
140
|
children?: React.ReactNode;
|
|
131
141
|
} & BaseSelectOptionPropsOverrides;
|
|
142
|
+
baseSkeleton: SkeletonProps & BaseSkeletonPropsOverrides;
|
|
132
143
|
baseChip: ChipProps & BaseChipPropsOverrides;
|
|
133
144
|
}
|
|
134
145
|
interface MaterialSlotProps {
|
|
135
146
|
baseBadge: MUIBadgeProps;
|
|
147
|
+
baseButton: MUIButtonProps;
|
|
148
|
+
baseIconButton: MUIIconButtonProps;
|
|
149
|
+
baseLinearProgress: MUILinearProgressProps;
|
|
150
|
+
baseCircularProgress: MUICircularProgressProps;
|
|
136
151
|
baseMenuItem: MUIMenuItemProps;
|
|
152
|
+
baseTooltip: MUITooltipProps;
|
|
137
153
|
}
|
|
138
154
|
interface ElementSlotProps {
|
|
139
155
|
cell: GridCellProps & CellPropsOverrides;
|
|
@@ -157,16 +173,17 @@ interface ElementSlotProps {
|
|
|
157
173
|
skeletonCell: GridSkeletonCellProps & SkeletonCellPropsOverrides;
|
|
158
174
|
toolbar: GridToolbarProps & ToolbarPropsOverrides;
|
|
159
175
|
/**
|
|
160
|
-
* Props passed to the `.main` (role="grid") element
|
|
176
|
+
* Props passed to the `.main` (role="grid") element.
|
|
161
177
|
*/
|
|
162
178
|
main: MainProps;
|
|
163
179
|
/**
|
|
164
|
-
* Props passed to the `.root` element
|
|
180
|
+
* Props passed to the `.root` element.
|
|
165
181
|
*/
|
|
166
182
|
root: RootProps;
|
|
167
183
|
}
|
|
184
|
+
type Select<A, B, K> = K extends keyof A ? A[K] : K extends keyof B ? B[K] : never;
|
|
168
185
|
type Merge<A, B> = {
|
|
169
|
-
[K in keyof A | keyof B]: K extends keyof A & keyof B ? A[K] & B[K] : K extends keyof B ? B[K] : K extends keyof A ? A[K] : never;
|
|
186
|
+
[K in keyof A | keyof B]: K extends 'ref' ? Select<A, B, 'ref'> : K extends keyof A & keyof B ? A[K] & B[K] : K extends keyof B ? B[K] : K extends keyof A ? A[K] : never;
|
|
170
187
|
};
|
|
171
188
|
export type GridSlotProps = Merge<BaseSlotProps, MaterialSlotProps> & ElementSlotProps;
|
|
172
189
|
/**
|
|
@@ -369,7 +369,7 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
369
369
|
/**
|
|
370
370
|
* The ref object that allows Data Grid manipulation. Can be instantiated with `useGridApiRef()`.
|
|
371
371
|
*/
|
|
372
|
-
apiRef?: React.
|
|
372
|
+
apiRef?: React.RefObject<GridApiCommunity>;
|
|
373
373
|
/**
|
|
374
374
|
* Signal to the underlying logic what version of the public component API
|
|
375
375
|
* of the Data Grid is exposed [[GridSignature]].
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
6
7
|
import { GridBody, GridFooterPlaceholder, GridHeader, GridRoot } from "../components/index.js";
|
|
7
8
|
import { useGridAriaAttributes } from "../hooks/utils/useGridAriaAttributes.js";
|
|
8
9
|
import { useGridRowAriaAttributes } from "../hooks/features/rows/useGridRowAriaAttributes.js";
|
|
@@ -23,7 +24,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
23
24
|
// Only validate in MIT version
|
|
24
25
|
props => props.columns && props.columns.some(column => column.resizable) && [`MUI X: \`column.resizable = true\` is not a valid prop.`, 'Column resizing is not available in the MIT version.', '', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n') || undefined];
|
|
25
26
|
}
|
|
26
|
-
const DataGridRaw =
|
|
27
|
+
const DataGridRaw = forwardRef(function DataGrid(inProps, ref) {
|
|
27
28
|
const props = useDataGridProps(inProps);
|
|
28
29
|
const privateApiRef = useDataGridComponent(props.apiRef, props);
|
|
29
30
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -36,9 +37,9 @@ const DataGridRaw = /*#__PURE__*/React.forwardRef(function DataGrid(inProps, ref
|
|
|
36
37
|
children: /*#__PURE__*/_jsxs(GridRoot, _extends({
|
|
37
38
|
className: props.className,
|
|
38
39
|
style: props.style,
|
|
39
|
-
sx: props.sx
|
|
40
|
-
ref: ref
|
|
40
|
+
sx: props.sx
|
|
41
41
|
}, props.slotProps?.root, {
|
|
42
|
+
ref: ref,
|
|
42
43
|
children: [/*#__PURE__*/_jsx(GridHeader, {}), /*#__PURE__*/_jsx(GridBody, {}), /*#__PURE__*/_jsx(GridFooterPlaceholder, {})]
|
|
43
44
|
}))
|
|
44
45
|
});
|
|
@@ -4,10 +4,11 @@ const _excluded = ["className", "visibleColumns", "sortColumnLookup", "filterCol
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { fastMemo } from '@mui/x-internals/fastMemo';
|
|
7
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
7
8
|
import { useGridColumnHeaders } from "../hooks/features/columnHeaders/useGridColumnHeaders.js";
|
|
8
9
|
import { GridBaseColumnHeaders } from "./columnHeaders/GridBaseColumnHeaders.js";
|
|
9
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
const GridColumnHeaders =
|
|
11
|
+
const GridColumnHeaders = forwardRef(function GridColumnHeaders(props, ref) {
|
|
11
12
|
const {
|
|
12
13
|
visibleColumns,
|
|
13
14
|
sortColumnLookup,
|
|
@@ -41,9 +42,8 @@ const GridColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnHeade
|
|
|
41
42
|
columnGroupsHeaderStructure,
|
|
42
43
|
hasOtherElementInTabSequence
|
|
43
44
|
});
|
|
44
|
-
return /*#__PURE__*/_jsxs(GridBaseColumnHeaders, _extends({
|
|
45
|
-
ref: ref
|
|
46
|
-
}, other, getInnerProps(), {
|
|
45
|
+
return /*#__PURE__*/_jsxs(GridBaseColumnHeaders, _extends({}, other, getInnerProps(), {
|
|
46
|
+
ref: ref,
|
|
47
47
|
children: [getColumnGroupHeadersRows(), getColumnHeadersRow()]
|
|
48
48
|
}));
|
|
49
49
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
4
5
|
import { useGridSelector } from "../hooks/utils/useGridSelector.js";
|
|
5
6
|
import { gridTopLevelRowCountSelector } from "../hooks/features/rows/gridRowsSelector.js";
|
|
6
7
|
import { selectedGridRowsCountSelector } from "../hooks/features/rowSelection/gridRowSelectionSelector.js";
|
|
@@ -10,7 +11,7 @@ import { GridSelectedRowCount } from "./GridSelectedRowCount.js";
|
|
|
10
11
|
import { GridFooterContainer } from "./containers/GridFooterContainer.js";
|
|
11
12
|
import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
12
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
const GridFooter =
|
|
14
|
+
const GridFooter = forwardRef(function GridFooter(props, ref) {
|
|
14
15
|
const apiRef = useGridApiContext();
|
|
15
16
|
const rootProps = useGridRootProps();
|
|
16
17
|
const totalTopLevelRowCount = useGridSelector(apiRef, gridTopLevelRowCountSelector);
|
|
@@ -24,9 +25,8 @@ const GridFooter = /*#__PURE__*/React.forwardRef(function GridFooter(props, ref)
|
|
|
24
25
|
visibleRowCount: visibleTopLevelRowCount
|
|
25
26
|
})) : null;
|
|
26
27
|
const paginationElement = rootProps.pagination && !rootProps.hideFooterPagination && rootProps.slots.pagination && /*#__PURE__*/_jsx(rootProps.slots.pagination, _extends({}, rootProps.slotProps?.pagination));
|
|
27
|
-
return /*#__PURE__*/_jsxs(GridFooterContainer, _extends({
|
|
28
|
-
ref: ref
|
|
29
|
-
}, props, {
|
|
28
|
+
return /*#__PURE__*/_jsxs(GridFooterContainer, _extends({}, props, {
|
|
29
|
+
ref: ref,
|
|
30
30
|
children: [selectedRowCountElement, rowCountElement, paginationElement]
|
|
31
31
|
}));
|
|
32
32
|
});
|
|
@@ -3,8 +3,8 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["variant", "noRowsVariant", "style"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
7
|
+
import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
8
8
|
import { GridOverlay } from "./containers/GridOverlay.js";
|
|
9
9
|
import { GridSkeletonLoadingOverlay } from "./GridSkeletonLoadingOverlay.js";
|
|
10
10
|
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
@@ -12,23 +12,23 @@ import { gridRowCountSelector, useGridSelector } from "../hooks/index.js";
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
const LOADING_VARIANTS = {
|
|
14
14
|
'circular-progress': {
|
|
15
|
-
component:
|
|
15
|
+
component: rootProps => rootProps.slots.baseCircularProgress,
|
|
16
16
|
style: {}
|
|
17
17
|
},
|
|
18
18
|
'linear-progress': {
|
|
19
|
-
component:
|
|
19
|
+
component: rootProps => rootProps.slots.baseLinearProgress,
|
|
20
20
|
style: {
|
|
21
21
|
display: 'block'
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
skeleton: {
|
|
25
|
-
component: GridSkeletonLoadingOverlay,
|
|
25
|
+
component: () => GridSkeletonLoadingOverlay,
|
|
26
26
|
style: {
|
|
27
27
|
display: 'block'
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
const GridLoadingOverlay =
|
|
31
|
+
const GridLoadingOverlay = forwardRef(function GridLoadingOverlay(props, ref) {
|
|
32
32
|
const {
|
|
33
33
|
variant = 'linear-progress',
|
|
34
34
|
noRowsVariant = 'skeleton',
|
|
@@ -36,13 +36,15 @@ const GridLoadingOverlay = /*#__PURE__*/React.forwardRef(function GridLoadingOve
|
|
|
36
36
|
} = props,
|
|
37
37
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
38
38
|
const apiRef = useGridApiContext();
|
|
39
|
+
const rootProps = useGridRootProps();
|
|
39
40
|
const rowsCount = useGridSelector(apiRef, gridRowCountSelector);
|
|
40
41
|
const activeVariant = LOADING_VARIANTS[rowsCount === 0 ? noRowsVariant : variant];
|
|
42
|
+
const Component = activeVariant.component(rootProps);
|
|
41
43
|
return /*#__PURE__*/_jsx(GridOverlay, _extends({
|
|
42
|
-
ref: ref,
|
|
43
44
|
style: _extends({}, activeVariant.style, style)
|
|
44
45
|
}, other, {
|
|
45
|
-
|
|
46
|
+
ref: ref,
|
|
47
|
+
children: /*#__PURE__*/_jsx(Component, {})
|
|
46
48
|
}));
|
|
47
49
|
});
|
|
48
50
|
process.env.NODE_ENV !== "production" ? GridLoadingOverlay.propTypes = {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
3
4
|
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
4
5
|
import { GridOverlay } from "./containers/GridOverlay.js";
|
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
export const GridNoResultsOverlay =
|
|
7
|
+
export const GridNoResultsOverlay = forwardRef(function GridNoResultsOverlay(props, ref) {
|
|
7
8
|
const apiRef = useGridApiContext();
|
|
8
9
|
const noResultsOverlayLabel = apiRef.current.getLocaleText('noResultsOverlayLabel');
|
|
9
|
-
return /*#__PURE__*/_jsx(GridOverlay, _extends({
|
|
10
|
-
ref: ref
|
|
11
|
-
}, props, {
|
|
10
|
+
return /*#__PURE__*/_jsx(GridOverlay, _extends({}, props, {
|
|
11
|
+
ref: ref,
|
|
12
12
|
children: noResultsOverlayLabel
|
|
13
13
|
}));
|
|
14
14
|
});
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
4
5
|
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
5
6
|
import { GridOverlay } from "./containers/GridOverlay.js";
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
const GridNoRowsOverlay =
|
|
8
|
+
const GridNoRowsOverlay = forwardRef(function GridNoRowsOverlay(props, ref) {
|
|
8
9
|
const apiRef = useGridApiContext();
|
|
9
10
|
const noRowsLabel = apiRef.current.getLocaleText('noRowsLabel');
|
|
10
|
-
return /*#__PURE__*/_jsx(GridOverlay, _extends({
|
|
11
|
-
ref: ref
|
|
12
|
-
}, props, {
|
|
11
|
+
return /*#__PURE__*/_jsx(GridOverlay, _extends({}, props, {
|
|
12
|
+
ref: ref,
|
|
13
13
|
children: noRowsLabel
|
|
14
14
|
}));
|
|
15
15
|
});
|
|
@@ -3,6 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { styled } from '@mui/material/styles';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import TablePagination, { tablePaginationClasses } from '@mui/material/TablePagination';
|
|
6
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
6
7
|
import { useGridSelector } from "../hooks/utils/useGridSelector.js";
|
|
7
8
|
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
8
9
|
import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
@@ -56,7 +57,7 @@ const defaultLabelDisplayedRows = ({
|
|
|
56
57
|
|
|
57
58
|
// A mutable version of a readonly array.
|
|
58
59
|
|
|
59
|
-
const GridPagination =
|
|
60
|
+
const GridPagination = forwardRef(function GridPagination(props, ref) {
|
|
60
61
|
const apiRef = useGridApiContext();
|
|
61
62
|
const rootProps = useGridRootProps();
|
|
62
63
|
const paginationModel = useGridSelector(apiRef, gridPaginationModelSelector);
|
|
@@ -120,7 +121,6 @@ const GridPagination = /*#__PURE__*/React.forwardRef(function GridPagination(pro
|
|
|
120
121
|
const locales = apiRef.current.getLocaleText('MuiTablePagination');
|
|
121
122
|
const wrappedLabelDisplayedRows = wrapLabelDisplayedRows(locales.labelDisplayedRows || defaultLabelDisplayedRows, estimatedRowCount);
|
|
122
123
|
return /*#__PURE__*/_jsx(GridPaginationRoot, _extends({
|
|
123
|
-
ref: ref,
|
|
124
124
|
component: "div",
|
|
125
125
|
count: rowCount,
|
|
126
126
|
page: computedPage
|
|
@@ -134,7 +134,9 @@ const GridPagination = /*#__PURE__*/React.forwardRef(function GridPagination(pro
|
|
|
134
134
|
onRowsPerPageChange: handlePageSizeChange
|
|
135
135
|
}, computedProps, locales, {
|
|
136
136
|
labelDisplayedRows: wrappedLabelDisplayedRows
|
|
137
|
-
}, props
|
|
137
|
+
}, props, {
|
|
138
|
+
ref: ref
|
|
139
|
+
}));
|
|
138
140
|
});
|
|
139
141
|
process.env.NODE_ENV !== "production" ? GridPagination.propTypes = {
|
|
140
142
|
// ----------------------------- Warning --------------------------------
|
|
@@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { unstable_useForkRef as useForkRef } from '@mui/utils';
|
|
8
8
|
import { fastMemo } from '@mui/x-internals/fastMemo';
|
|
9
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
9
10
|
import { GridEditModes, GridRowModes, GridCellModes } from "../models/gridEditRowModel.js";
|
|
10
11
|
import { gridClasses } from "../constants/gridClasses.js";
|
|
11
12
|
import { composeGridClasses } from "../utils/composeGridClasses.js";
|
|
@@ -27,7 +28,7 @@ import { useGridConfiguration } from "../hooks/utils/useGridConfiguration.js";
|
|
|
27
28
|
import { useGridPrivateApiContext } from "../hooks/utils/useGridPrivateApiContext.js";
|
|
28
29
|
import { gridVirtualizationColumnEnabledSelector } from "../hooks/index.js";
|
|
29
30
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
|
-
const GridRow =
|
|
31
|
+
const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
31
32
|
const {
|
|
32
33
|
selected,
|
|
33
34
|
rowId,
|
|
@@ -280,13 +281,13 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
280
281
|
onMouseOver: publish('rowMouseOver', onMouseOver)
|
|
281
282
|
} : null;
|
|
282
283
|
return /*#__PURE__*/_jsxs("div", _extends({
|
|
283
|
-
ref: handleRef,
|
|
284
284
|
"data-id": rowId,
|
|
285
285
|
"data-rowindex": index,
|
|
286
286
|
role: "row",
|
|
287
287
|
className: clsx(...rowClassNames, classes.root, className),
|
|
288
288
|
style: style
|
|
289
289
|
}, ariaAttributes, eventHandlers, other, {
|
|
290
|
+
ref: handleRef,
|
|
290
291
|
children: [leftCells, /*#__PURE__*/_jsx("div", {
|
|
291
292
|
role: "presentation",
|
|
292
293
|
className: gridClasses.cellOffsetLeft,
|
|
@@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import composeClasses from '@mui/utils/composeClasses';
|
|
8
8
|
import { styled } from '@mui/system';
|
|
9
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
9
10
|
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
10
11
|
import { getDataGridUtilityClass } from "../constants/gridClasses.js";
|
|
11
12
|
import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
@@ -30,7 +31,7 @@ const GridRowCountRoot = styled('div', {
|
|
|
30
31
|
display: 'flex',
|
|
31
32
|
margin: theme.spacing(0, 2)
|
|
32
33
|
}));
|
|
33
|
-
const GridRowCount =
|
|
34
|
+
const GridRowCount = forwardRef(function GridRowCount(props, ref) {
|
|
34
35
|
const {
|
|
35
36
|
className,
|
|
36
37
|
rowCount,
|
|
@@ -45,10 +46,10 @@ const GridRowCount = /*#__PURE__*/React.forwardRef(function GridRowCount(props,
|
|
|
45
46
|
}
|
|
46
47
|
const text = visibleRowCount < rowCount ? apiRef.current.getLocaleText('footerTotalVisibleRows')(visibleRowCount, rowCount) : rowCount.toLocaleString();
|
|
47
48
|
return /*#__PURE__*/_jsxs(GridRowCountRoot, _extends({
|
|
48
|
-
ref: ref,
|
|
49
49
|
className: clsx(classes.root, className),
|
|
50
50
|
ownerState: ownerState
|
|
51
51
|
}, other, {
|
|
52
|
+
ref: ref,
|
|
52
53
|
children: [apiRef.current.getLocaleText('footerTotalRows'), " ", text]
|
|
53
54
|
}));
|
|
54
55
|
});
|
|
@@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import composeClasses from '@mui/utils/composeClasses';
|
|
8
8
|
import { styled } from '@mui/system';
|
|
9
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
9
10
|
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
10
11
|
import { getDataGridUtilityClass } from "../constants/gridClasses.js";
|
|
11
12
|
import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
@@ -38,7 +39,7 @@ const GridSelectedRowCountRoot = styled('div', {
|
|
|
38
39
|
height: 'auto'
|
|
39
40
|
}
|
|
40
41
|
}));
|
|
41
|
-
const GridSelectedRowCount =
|
|
42
|
+
const GridSelectedRowCount = forwardRef(function GridSelectedRowCount(props, ref) {
|
|
42
43
|
const {
|
|
43
44
|
className,
|
|
44
45
|
selectedRowCount
|
|
@@ -49,10 +50,10 @@ const GridSelectedRowCount = /*#__PURE__*/React.forwardRef(function GridSelected
|
|
|
49
50
|
const classes = useUtilityClasses(ownerState);
|
|
50
51
|
const rowSelectedText = apiRef.current.getLocaleText('footerRowSelected')(selectedRowCount);
|
|
51
52
|
return /*#__PURE__*/_jsx(GridSelectedRowCountRoot, _extends({
|
|
52
|
-
ref: ref,
|
|
53
53
|
className: clsx(classes.root, className),
|
|
54
54
|
ownerState: ownerState
|
|
55
55
|
}, other, {
|
|
56
|
+
ref: ref,
|
|
56
57
|
children: rowSelectedText
|
|
57
58
|
}));
|
|
58
59
|
});
|
|
@@ -4,6 +4,7 @@ import clsx from 'clsx';
|
|
|
4
4
|
import { styled } from '@mui/system';
|
|
5
5
|
import useForkRef from '@mui/utils/useForkRef';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
7
8
|
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
8
9
|
import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
9
10
|
import { GridPinnedColumnPosition, gridColumnPositionsSelector, gridColumnsTotalWidthSelector, gridDimensionsSelector, gridVisibleColumnDefinitionsSelector, gridVisiblePinnedColumnDefinitionsSelector, useGridApiEventHandler, useGridSelector } from "../hooks/index.js";
|
|
@@ -34,7 +35,7 @@ const useUtilityClasses = ownerState => {
|
|
|
34
35
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
35
36
|
};
|
|
36
37
|
const getColIndex = el => parseInt(el.getAttribute('data-colindex'), 10);
|
|
37
|
-
const GridSkeletonLoadingOverlay =
|
|
38
|
+
const GridSkeletonLoadingOverlay = forwardRef(function GridSkeletonLoadingOverlay(props, forwardedRef) {
|
|
38
39
|
const rootProps = useGridRootProps();
|
|
39
40
|
const {
|
|
40
41
|
slots
|
|
@@ -172,9 +173,9 @@ const GridSkeletonLoadingOverlay = /*#__PURE__*/React.forwardRef(function GridSk
|
|
|
172
173
|
};
|
|
173
174
|
useGridApiEventHandler(apiRef, 'columnResize', handleColumnResize);
|
|
174
175
|
return /*#__PURE__*/_jsx(SkeletonOverlay, _extends({
|
|
175
|
-
className: classes.root
|
|
176
|
-
ref: handleRef
|
|
176
|
+
className: classes.root
|
|
177
177
|
}, props, {
|
|
178
|
+
ref: handleRef,
|
|
178
179
|
children: children
|
|
179
180
|
}));
|
|
180
181
|
});
|
|
@@ -4,9 +4,12 @@ const _excluded = ["label", "icon", "showInMenu", "onClick"],
|
|
|
4
4
|
_excluded2 = ["label", "icon", "showInMenu", "onClick", "closeMenuOnClick", "closeMenu"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
7
8
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
9
|
+
|
|
10
|
+
// FIXME(v8:romgrk): Make parametric
|
|
8
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
const GridActionsCellItem =
|
|
12
|
+
const GridActionsCellItem = forwardRef((props, ref) => {
|
|
10
13
|
const rootProps = useGridRootProps();
|
|
11
14
|
if (!props.showInMenu) {
|
|
12
15
|
const {
|
|
@@ -19,13 +22,13 @@ const GridActionsCellItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
19
22
|
onClick?.(event);
|
|
20
23
|
};
|
|
21
24
|
return /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
22
|
-
ref: ref,
|
|
23
25
|
size: "small",
|
|
24
26
|
role: "menuitem",
|
|
25
27
|
"aria-label": label
|
|
26
28
|
}, other, {
|
|
27
29
|
onClick: handleClick
|
|
28
30
|
}, rootProps.slotProps?.baseIconButton, {
|
|
31
|
+
ref: ref,
|
|
29
32
|
children: /*#__PURE__*/React.cloneElement(icon, {
|
|
30
33
|
fontSize: 'small'
|
|
31
34
|
})
|
|
@@ -8,6 +8,7 @@ import clsx from 'clsx';
|
|
|
8
8
|
import { unstable_useForkRef as useForkRef, unstable_composeClasses as composeClasses, unstable_ownerDocument as ownerDocument, unstable_capitalize as capitalize } from '@mui/utils';
|
|
9
9
|
import { fastMemo } from '@mui/x-internals/fastMemo';
|
|
10
10
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
11
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
11
12
|
import { doesSupportPreventScroll } from "../../utils/doesSupportPreventScroll.js";
|
|
12
13
|
import { getDataGridUtilityClass, gridClasses } from "../../constants/gridClasses.js";
|
|
13
14
|
import { GridCellModes } from "../../models/index.js";
|
|
@@ -76,7 +77,7 @@ let warnedOnce = false;
|
|
|
76
77
|
|
|
77
78
|
// TODO(v7): Removing the wrapper will break the docs performance visualization demo.
|
|
78
79
|
|
|
79
|
-
const GridCell =
|
|
80
|
+
const GridCell = forwardRef(function GridCell(props, ref) {
|
|
80
81
|
const {
|
|
81
82
|
column,
|
|
82
83
|
rowId,
|
|
@@ -313,7 +314,6 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
313
314
|
onDragOver: publish('cellDragOver', onDragOver)
|
|
314
315
|
};
|
|
315
316
|
return /*#__PURE__*/_jsx("div", _extends({
|
|
316
|
-
ref: handleRef,
|
|
317
317
|
className: clsx(classes.root, classNames, className),
|
|
318
318
|
role: "gridcell",
|
|
319
319
|
"data-field": field,
|
|
@@ -333,6 +333,7 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
333
333
|
onKeyUp: publish('cellKeyUp', onKeyUp)
|
|
334
334
|
}, draggableEventHandlers, other, {
|
|
335
335
|
onFocus: handleFocus,
|
|
336
|
+
ref: handleRef,
|
|
336
337
|
children: children
|
|
337
338
|
}));
|
|
338
339
|
});
|
|
@@ -35,7 +35,7 @@ function GridEditDateCell(props) {
|
|
|
35
35
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
36
36
|
const isDateTime = colDef.type === 'dateTime';
|
|
37
37
|
const apiRef = useGridApiContext();
|
|
38
|
-
const inputRef = React.useRef();
|
|
38
|
+
const inputRef = React.useRef(null);
|
|
39
39
|
const valueTransformed = React.useMemo(() => {
|
|
40
40
|
let parsedDate;
|
|
41
41
|
if (valueProp == null) {
|
|
@@ -2,9 +2,11 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "isValidating", "debounceMs", "isProcessingProps", "onValueChange"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
5
6
|
import { unstable_composeClasses as composeClasses, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
6
7
|
import { styled } from '@mui/material/styles';
|
|
7
8
|
import InputBase from '@mui/material/InputBase';
|
|
9
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
8
10
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
9
11
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
10
12
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
@@ -31,7 +33,7 @@ const GridEditInputCellRoot = styled(InputBase, {
|
|
|
31
33
|
height: '100%'
|
|
32
34
|
}
|
|
33
35
|
}));
|
|
34
|
-
const GridEditInputCell =
|
|
36
|
+
const GridEditInputCell = forwardRef((props, ref) => {
|
|
35
37
|
const rootProps = useGridRootProps();
|
|
36
38
|
const {
|
|
37
39
|
id,
|
|
@@ -45,7 +47,7 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
45
47
|
} = props,
|
|
46
48
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
47
49
|
const apiRef = useGridApiContext();
|
|
48
|
-
const inputRef = React.useRef();
|
|
50
|
+
const inputRef = React.useRef(null);
|
|
49
51
|
const [valueState, setValueState] = React.useState(value);
|
|
50
52
|
const classes = useUtilityClasses(rootProps);
|
|
51
53
|
const handleChange = React.useCallback(async event => {
|
|
@@ -79,7 +81,6 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
79
81
|
}
|
|
80
82
|
}, [hasFocus]);
|
|
81
83
|
return /*#__PURE__*/_jsx(GridEditInputCellRoot, _extends({
|
|
82
|
-
ref: ref,
|
|
83
84
|
inputRef: inputRef,
|
|
84
85
|
className: classes.root,
|
|
85
86
|
ownerState: rootProps,
|
|
@@ -91,7 +92,75 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
91
92
|
fontSize: "small",
|
|
92
93
|
color: "action"
|
|
93
94
|
}) : undefined
|
|
94
|
-
}, other
|
|
95
|
+
}, other, {
|
|
96
|
+
ref: ref
|
|
97
|
+
}));
|
|
95
98
|
});
|
|
99
|
+
process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
100
|
+
// ----------------------------- Warning --------------------------------
|
|
101
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
102
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
103
|
+
// ----------------------------------------------------------------------
|
|
104
|
+
/**
|
|
105
|
+
* GridApi that let you manipulate the grid.
|
|
106
|
+
*/
|
|
107
|
+
api: PropTypes.object.isRequired,
|
|
108
|
+
/**
|
|
109
|
+
* The mode of the cell.
|
|
110
|
+
*/
|
|
111
|
+
cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
|
|
112
|
+
changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),
|
|
113
|
+
/**
|
|
114
|
+
* The column of the row that the current cell belongs to.
|
|
115
|
+
*/
|
|
116
|
+
colDef: PropTypes.object.isRequired,
|
|
117
|
+
debounceMs: PropTypes.number,
|
|
118
|
+
/**
|
|
119
|
+
* The column field of the cell that triggered the event.
|
|
120
|
+
*/
|
|
121
|
+
field: PropTypes.string.isRequired,
|
|
122
|
+
/**
|
|
123
|
+
* The cell value formatted with the column valueFormatter.
|
|
124
|
+
*/
|
|
125
|
+
formattedValue: PropTypes.any,
|
|
126
|
+
/**
|
|
127
|
+
* If true, the cell is the active element.
|
|
128
|
+
*/
|
|
129
|
+
hasFocus: PropTypes.bool.isRequired,
|
|
130
|
+
/**
|
|
131
|
+
* The grid row id.
|
|
132
|
+
*/
|
|
133
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
134
|
+
/**
|
|
135
|
+
* If true, the cell is editable.
|
|
136
|
+
*/
|
|
137
|
+
isEditable: PropTypes.bool,
|
|
138
|
+
isProcessingProps: PropTypes.bool,
|
|
139
|
+
isValidating: PropTypes.bool,
|
|
140
|
+
/**
|
|
141
|
+
* Callback called when the value is changed by the user.
|
|
142
|
+
* @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
|
|
143
|
+
* @param {Date | null} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.
|
|
144
|
+
* @returns {Promise<void> | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`
|
|
145
|
+
*/
|
|
146
|
+
onValueChange: PropTypes.func,
|
|
147
|
+
/**
|
|
148
|
+
* The row model of the row that the current cell belongs to.
|
|
149
|
+
*/
|
|
150
|
+
row: PropTypes.any.isRequired,
|
|
151
|
+
/**
|
|
152
|
+
* The node of the row that the current cell belongs to.
|
|
153
|
+
*/
|
|
154
|
+
rowNode: PropTypes.object.isRequired,
|
|
155
|
+
/**
|
|
156
|
+
* the tabIndex value.
|
|
157
|
+
*/
|
|
158
|
+
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
159
|
+
/**
|
|
160
|
+
* The cell value.
|
|
161
|
+
* If the column has `valueGetter`, use `params.row` to directly access the fields.
|
|
162
|
+
*/
|
|
163
|
+
value: PropTypes.any
|
|
164
|
+
} : void 0;
|
|
96
165
|
export { GridEditInputCell };
|
|
97
166
|
export const renderEditInputCell = params => /*#__PURE__*/_jsx(GridEditInputCell, _extends({}, params));
|
|
@@ -30,8 +30,8 @@ function GridEditSingleSelectCell(props) {
|
|
|
30
30
|
} = props,
|
|
31
31
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
32
32
|
const apiRef = useGridApiContext();
|
|
33
|
-
const ref = React.useRef();
|
|
34
|
-
const inputRef = React.useRef();
|
|
33
|
+
const ref = React.useRef(null);
|
|
34
|
+
const inputRef = React.useRef(null);
|
|
35
35
|
const [open, setOpen] = React.useState(initialOpen);
|
|
36
36
|
const baseSelectProps = rootProps.slotProps?.baseSelect || {};
|
|
37
37
|
const isSelectNative = baseSelectProps.native ?? false;
|