@mui/x-data-grid 8.0.0-alpha.4 → 8.0.0-alpha.6
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 +182 -0
- package/DataGrid/DataGrid.js +6 -9
- package/DataGrid/useDataGridProps.js +3 -3
- 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 +15 -3
- 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 +1 -1
- package/components/cell/GridActionsCellItem.js +7 -8
- package/components/cell/GridCell.d.ts +1 -1
- package/components/cell/GridCell.js +3 -2
- package/components/cell/GridEditInputCell.d.ts +1 -1
- package/components/cell/GridEditInputCell.js +72 -3
- package/components/cell/GridSkeletonCell.js +1 -2
- package/components/columnHeaders/GridBaseColumnHeaders.d.ts +1 -1
- package/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
- 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 +5 -3
- package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
- package/components/columnSelection/GridHeaderCheckbox.js +5 -3
- 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/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +6 -11
- package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +6 -11
- package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +6 -11
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
- package/components/panel/GridPanel.d.ts +1 -1
- 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 +17 -10
- 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 +6 -7
- 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 +2 -2
- package/components/toolbar/GridToolbarFilterButton.js +6 -2
- package/components/toolbar/GridToolbarQuickFilter.js +27 -23
- package/components/virtualization/GridMainContainer.d.ts +3 -1
- package/components/virtualization/GridMainContainer.js +4 -3
- 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/features/columnHeaders/useGridColumnHeaders.js +10 -3
- package/hooks/features/columnResize/gridColumnResizeApi.d.ts +6 -0
- package/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
- package/hooks/features/columnResize/useGridColumnResize.d.ts +1 -1
- package/hooks/features/columnResize/useGridColumnResize.js +9 -4
- package/hooks/features/columns/gridColumnsUtils.d.ts +1 -1
- package/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/hooks/features/rows/useGridRowSpanning.js +76 -87
- package/index.js +1 -1
- package/internals/utils/index.d.ts +0 -1
- package/internals/utils/index.js +0 -1
- package/locales/koKR.js +45 -49
- package/locales/nlNL.js +5 -6
- package/material/index.js +36 -4
- package/models/gridBaseSlots.d.ts +36 -0
- package/models/gridBaseSlots.js +1 -0
- package/models/gridSlotsComponent.d.ts +16 -1
- package/models/gridSlotsComponentsProps.d.ts +38 -5
- package/models/props/DataGridProps.d.ts +0 -5
- package/modern/DataGrid/DataGrid.js +6 -9
- package/modern/DataGrid/useDataGridProps.js +3 -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 +15 -3
- 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 +7 -8
- package/modern/components/cell/GridCell.js +3 -2
- package/modern/components/cell/GridEditInputCell.js +72 -3
- package/modern/components/cell/GridSkeletonCell.js +1 -2
- package/modern/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
- 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 +5 -3
- package/modern/components/columnSelection/GridHeaderCheckbox.js +5 -3
- 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/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +6 -11
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +6 -11
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +6 -11
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
- 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 +17 -10
- 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 +6 -7
- package/modern/components/toolbar/GridToolbarExport.js +2 -1
- package/modern/components/toolbar/GridToolbarExportContainer.js +3 -2
- package/modern/components/toolbar/GridToolbarFilterButton.js +6 -2
- package/modern/components/toolbar/GridToolbarQuickFilter.js +27 -23
- package/modern/components/virtualization/GridMainContainer.js +4 -3
- 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/features/columnHeaders/useGridColumnHeaders.js +10 -3
- package/modern/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
- package/modern/hooks/features/columnResize/useGridColumnResize.js +9 -4
- package/modern/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/modern/hooks/features/rows/useGridRowSpanning.js +76 -87
- package/modern/index.js +1 -1
- package/modern/internals/utils/index.js +0 -1
- package/modern/locales/koKR.js +45 -49
- package/modern/locales/nlNL.js +5 -6
- package/modern/material/index.js +36 -4
- package/modern/models/gridBaseSlots.js +1 -0
- package/modern/utils/utils.js +6 -1
- package/node/DataGrid/DataGrid.js +6 -9
- package/node/DataGrid/useDataGridProps.js +2 -2
- 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 +15 -3
- 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 +6 -7
- package/node/components/cell/GridCell.js +3 -2
- package/node/components/cell/GridEditInputCell.js +72 -3
- package/node/components/cell/GridSkeletonCell.js +1 -2
- package/node/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
- 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 +5 -3
- package/node/components/columnSelection/GridHeaderCheckbox.js +5 -3
- 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/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +5 -10
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +5 -10
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +5 -10
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
- 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 +17 -10
- 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 +6 -7
- package/node/components/toolbar/GridToolbarExport.js +2 -1
- package/node/components/toolbar/GridToolbarExportContainer.js +3 -2
- package/node/components/toolbar/GridToolbarFilterButton.js +6 -2
- package/node/components/toolbar/GridToolbarQuickFilter.js +27 -23
- package/node/components/virtualization/GridMainContainer.js +4 -3
- 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/features/columnHeaders/useGridColumnHeaders.js +10 -3
- package/node/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
- package/node/hooks/features/columnResize/useGridColumnResize.js +9 -4
- package/node/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/node/hooks/features/rows/useGridRowSpanning.js +74 -85
- package/node/index.js +1 -1
- package/node/internals/utils/index.js +0 -11
- package/node/locales/koKR.js +45 -49
- package/node/locales/nlNL.js +5 -6
- package/node/material/index.js +37 -4
- package/node/models/gridBaseSlots.js +5 -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
- package/internals/utils/useProps.d.ts +0 -1
- package/internals/utils/useProps.js +0 -24
- package/joy/icons.d.ts +0 -32
- package/joy/icons.js +0 -431
- package/joy/index.d.ts +0 -2
- package/joy/index.js +0 -2
- package/joy/joySlots.d.ts +0 -3
- package/joy/joySlots.js +0 -389
- package/joy/package.json +0 -6
- package/modern/internals/utils/useProps.js +0 -24
- package/modern/joy/icons.js +0 -431
- package/modern/joy/index.js +0 -2
- package/modern/joy/joySlots.js +0 -389
- package/node/internals/utils/useProps.js +0 -30
- package/node/joy/icons.js +0 -439
- package/node/joy/index.js +0 -13
- package/node/joy/joySlots.js +0 -397
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { BadgeProps } from '@mui/material/Badge';
|
|
2
|
+
import type { BadgeProps as MUIBadgeProps } from '@mui/material/Badge';
|
|
3
3
|
import type { CheckboxProps } from '@mui/material/Checkbox';
|
|
4
|
+
import type { CircularProgressProps as MUICircularProgressProps } from '@mui/material/CircularProgress';
|
|
5
|
+
import type { LinearProgressProps as MUILinearProgressProps } from '@mui/material/LinearProgress';
|
|
4
6
|
import type { MenuListProps } from '@mui/material/MenuList';
|
|
5
|
-
import type { MenuItemProps } from '@mui/material/MenuItem';
|
|
7
|
+
import type { MenuItemProps as MUIMenuItemProps } from '@mui/material/MenuItem';
|
|
6
8
|
import type { TextFieldProps } from '@mui/material/TextField';
|
|
7
9
|
import type { FormControlProps } from '@mui/material/FormControl';
|
|
8
10
|
import type { SelectProps } from '@mui/material/Select';
|
|
@@ -33,13 +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
|
-
type DividerProps
|
|
38
|
+
import type { BadgeProps, CircularProgressProps, DividerProps, LinearProgressProps, MenuItemProps, SkeletonProps } from './gridBaseSlots';
|
|
39
|
+
type RootProps = React.HTMLAttributes<HTMLDivElement> & Record<`data-${string}`, string>;
|
|
40
|
+
type MainProps = React.HTMLAttributes<HTMLDivElement> & Record<`data-${string}`, string>;
|
|
37
41
|
export interface BaseBadgePropsOverrides {
|
|
38
42
|
}
|
|
39
43
|
export interface BaseCheckboxPropsOverrides {
|
|
40
44
|
}
|
|
45
|
+
export interface BaseCircularProgressPropsOverrides {
|
|
46
|
+
}
|
|
41
47
|
export interface BaseDividerPropsOverrides {
|
|
42
48
|
}
|
|
49
|
+
export interface BaseLinearProgressPropsOverrides {
|
|
50
|
+
}
|
|
43
51
|
export interface BaseMenuListPropsOverrides {
|
|
44
52
|
}
|
|
45
53
|
export interface BaseMenuItemPropsOverrides {
|
|
@@ -66,6 +74,8 @@ export interface BaseInputLabelPropsOverrides {
|
|
|
66
74
|
}
|
|
67
75
|
export interface BaseSelectOptionPropsOverrides {
|
|
68
76
|
}
|
|
77
|
+
export interface BaseSkeletonPropsOverrides {
|
|
78
|
+
}
|
|
69
79
|
export interface BaseChipPropsOverrides {
|
|
70
80
|
}
|
|
71
81
|
export interface CellPropsOverrides {
|
|
@@ -106,10 +116,12 @@ export interface SkeletonCellPropsOverrides {
|
|
|
106
116
|
}
|
|
107
117
|
export interface RowPropsOverrides {
|
|
108
118
|
}
|
|
109
|
-
|
|
119
|
+
interface BaseSlotProps {
|
|
110
120
|
baseBadge: BadgeProps & BaseBadgePropsOverrides;
|
|
111
121
|
baseCheckbox: CheckboxProps & BaseCheckboxPropsOverrides;
|
|
122
|
+
baseCircularProgress: CircularProgressProps & BaseCircularProgressPropsOverrides;
|
|
112
123
|
baseDivider: DividerProps & BaseDividerPropsOverrides;
|
|
124
|
+
baseLinearProgress: LinearProgressProps & BaseLinearProgressPropsOverrides;
|
|
113
125
|
baseMenuList: MenuListProps & BaseMenuListPropsOverrides;
|
|
114
126
|
baseMenuItem: MenuItemProps & BaseMenuItemPropsOverrides;
|
|
115
127
|
baseTextField: TextFieldProps & BaseTextFieldPropsOverrides;
|
|
@@ -127,7 +139,16 @@ export interface GridSlotProps {
|
|
|
127
139
|
value: any;
|
|
128
140
|
children?: React.ReactNode;
|
|
129
141
|
} & BaseSelectOptionPropsOverrides;
|
|
142
|
+
baseSkeleton: SkeletonProps & BaseSkeletonPropsOverrides;
|
|
130
143
|
baseChip: ChipProps & BaseChipPropsOverrides;
|
|
144
|
+
}
|
|
145
|
+
interface MaterialSlotProps {
|
|
146
|
+
baseBadge: MUIBadgeProps;
|
|
147
|
+
baseCircularProgress: MUICircularProgressProps;
|
|
148
|
+
baseLinearProgress: MUILinearProgressProps;
|
|
149
|
+
baseMenuItem: MUIMenuItemProps;
|
|
150
|
+
}
|
|
151
|
+
interface ElementSlotProps {
|
|
131
152
|
cell: GridCellProps & CellPropsOverrides;
|
|
132
153
|
columnHeaders: GridColumnHeadersProps;
|
|
133
154
|
columnHeaderFilterIconButton: ColumnHeaderFilterIconButtonProps & ColumnHeaderFilterIconButtonPropsOverrides;
|
|
@@ -148,7 +169,19 @@ export interface GridSlotProps {
|
|
|
148
169
|
row: GridRowProps & RowPropsOverrides;
|
|
149
170
|
skeletonCell: GridSkeletonCellProps & SkeletonCellPropsOverrides;
|
|
150
171
|
toolbar: GridToolbarProps & ToolbarPropsOverrides;
|
|
151
|
-
|
|
172
|
+
/**
|
|
173
|
+
* Props passed to the `.main` (role="grid") element
|
|
174
|
+
*/
|
|
175
|
+
main: MainProps;
|
|
176
|
+
/**
|
|
177
|
+
* Props passed to the `.root` element
|
|
178
|
+
*/
|
|
179
|
+
root: RootProps;
|
|
180
|
+
}
|
|
181
|
+
type Merge<A, B> = {
|
|
182
|
+
[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;
|
|
183
|
+
};
|
|
184
|
+
export type GridSlotProps = Merge<BaseSlotProps, MaterialSlotProps> & ElementSlotProps;
|
|
152
185
|
/**
|
|
153
186
|
* Overridable components props dynamically passed to the component at rendering.
|
|
154
187
|
*/
|
|
@@ -370,11 +370,6 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
370
370
|
* The ref object that allows Data Grid manipulation. Can be instantiated with `useGridApiRef()`.
|
|
371
371
|
*/
|
|
372
372
|
apiRef?: React.MutableRefObject<GridApiCommunity>;
|
|
373
|
-
/**
|
|
374
|
-
* Forwarded props for the Data Grid root element.
|
|
375
|
-
* @ignore - do not document.
|
|
376
|
-
*/
|
|
377
|
-
forwardedProps?: Record<string, unknown>;
|
|
378
373
|
/**
|
|
379
374
|
* Signal to the underlying logic what version of the public component API
|
|
380
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
|
-
|
|
41
|
-
|
|
40
|
+
sx: props.sx
|
|
41
|
+
}, props.slotProps?.root, {
|
|
42
|
+
ref: ref,
|
|
42
43
|
children: [/*#__PURE__*/_jsx(GridHeader, {}), /*#__PURE__*/_jsx(GridBody, {}), /*#__PURE__*/_jsx(GridFooterPlaceholder, {})]
|
|
43
44
|
}))
|
|
44
45
|
});
|
|
@@ -95,6 +96,7 @@ DataGridRaw.propTypes = {
|
|
|
95
96
|
*/
|
|
96
97
|
autosizeOptions: PropTypes.shape({
|
|
97
98
|
columns: PropTypes.arrayOf(PropTypes.string),
|
|
99
|
+
disableColumnVirtualization: PropTypes.bool,
|
|
98
100
|
expand: PropTypes.bool,
|
|
99
101
|
includeHeaders: PropTypes.bool,
|
|
100
102
|
includeOutliers: PropTypes.bool,
|
|
@@ -248,11 +250,6 @@ DataGridRaw.propTypes = {
|
|
|
248
250
|
quickFilterLogicOperator: PropTypes.oneOf(['and', 'or']),
|
|
249
251
|
quickFilterValues: PropTypes.array
|
|
250
252
|
}),
|
|
251
|
-
/**
|
|
252
|
-
* Forwarded props for the Data Grid root element.
|
|
253
|
-
* @ignore - do not document.
|
|
254
|
-
*/
|
|
255
|
-
forwardedProps: PropTypes.object,
|
|
256
253
|
/**
|
|
257
254
|
* Function that applies CSS classes dynamically on cells.
|
|
258
255
|
* @param {GridCellParams} params With all properties from [[GridCellParams]].
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { useThemeProps } from '@mui/material/styles';
|
|
4
4
|
import { GRID_DEFAULT_LOCALE_TEXT } from "../constants/index.js";
|
|
5
5
|
import { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from "../constants/defaultGridSlotsComponents.js";
|
|
6
|
-
import { computeSlots
|
|
6
|
+
import { computeSlots } from "../internals/utils/index.js";
|
|
7
7
|
import { DATA_GRID_PROPS_DEFAULT_VALUES } from "../constants/dataGridPropsDefaultValues.js";
|
|
8
8
|
const DATA_GRID_FORCED_PROPS = {
|
|
9
9
|
disableMultipleColumnsFiltering: true,
|
|
@@ -19,12 +19,12 @@ const DATA_GRID_FORCED_PROPS = {
|
|
|
19
19
|
};
|
|
20
20
|
const defaultSlots = DATA_GRID_DEFAULT_SLOTS_COMPONENTS;
|
|
21
21
|
export const useDataGridProps = inProps => {
|
|
22
|
-
const themedProps =
|
|
22
|
+
const themedProps =
|
|
23
23
|
// eslint-disable-next-line material-ui/mui-name-matches-component-name
|
|
24
24
|
useThemeProps({
|
|
25
25
|
props: inProps,
|
|
26
26
|
name: 'MuiDataGrid'
|
|
27
|
-
})
|
|
27
|
+
});
|
|
28
28
|
const localeText = React.useMemo(() => _extends({}, GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText), [themedProps.localeText]);
|
|
29
29
|
const slots = React.useMemo(() => computeSlots({
|
|
30
30
|
defaultSlots,
|
|
@@ -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";
|
|
@@ -25,8 +26,9 @@ import { GridScrollbarFillerCell as ScrollbarFiller } from "./GridScrollbarFille
|
|
|
25
26
|
import { getPinnedCellOffset } from "../internals/utils/getPinnedCellOffset.js";
|
|
26
27
|
import { useGridConfiguration } from "../hooks/utils/useGridConfiguration.js";
|
|
27
28
|
import { useGridPrivateApiContext } from "../hooks/utils/useGridPrivateApiContext.js";
|
|
29
|
+
import { gridVirtualizationColumnEnabledSelector } from "../hooks/index.js";
|
|
28
30
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
|
-
const GridRow =
|
|
31
|
+
const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
30
32
|
const {
|
|
31
33
|
selected,
|
|
32
34
|
rowId,
|
|
@@ -68,6 +70,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
68
70
|
const gridHasFiller = dimensions.columnsTotalWidth < dimensions.viewportOuterSize.width;
|
|
69
71
|
const editing = apiRef.current.getRowMode(rowId) === GridRowModes.Edit;
|
|
70
72
|
const editable = rootProps.editMode === GridEditModes.Row;
|
|
73
|
+
const hasColumnVirtualization = useGridSelector(apiRef, gridVirtualizationColumnEnabledSelector);
|
|
71
74
|
const hasFocusCell = focusedColumnIndex !== undefined;
|
|
72
75
|
const hasVirtualFocusCellLeft = hasFocusCell && focusedColumnIndex >= pinnedColumns.left.length && focusedColumnIndex < renderContext.firstColumnIndex;
|
|
73
76
|
const hasVirtualFocusCellRight = hasFocusCell && focusedColumnIndex < visibleColumns.length - pinnedColumns.right.length && focusedColumnIndex >= renderContext.lastColumnIndex;
|
|
@@ -249,7 +252,16 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
249
252
|
if (hasVirtualFocusCellLeft) {
|
|
250
253
|
cells.push(getCell(visibleColumns[focusedColumnIndex], focusedColumnIndex - pinnedColumns.left.length, focusedColumnIndex, middleColumnsLength, PinnedPosition.VIRTUAL));
|
|
251
254
|
}
|
|
252
|
-
|
|
255
|
+
let firstColumnIndex;
|
|
256
|
+
let lastColumnIndex;
|
|
257
|
+
if (!rootProps.disableVirtualization && !hasColumnVirtualization) {
|
|
258
|
+
firstColumnIndex = 0;
|
|
259
|
+
lastColumnIndex = visibleColumns.length;
|
|
260
|
+
} else {
|
|
261
|
+
firstColumnIndex = renderContext.firstColumnIndex;
|
|
262
|
+
lastColumnIndex = renderContext.lastColumnIndex;
|
|
263
|
+
}
|
|
264
|
+
for (let i = firstColumnIndex; i < lastColumnIndex; i += 1) {
|
|
253
265
|
const column = visibleColumns[i];
|
|
254
266
|
const indexInSection = i - pinnedColumns.left.length;
|
|
255
267
|
if (!column) {
|
|
@@ -269,13 +281,13 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
269
281
|
onMouseOver: publish('rowMouseOver', onMouseOver)
|
|
270
282
|
} : null;
|
|
271
283
|
return /*#__PURE__*/_jsxs("div", _extends({
|
|
272
|
-
ref: handleRef,
|
|
273
284
|
"data-id": rowId,
|
|
274
285
|
"data-rowindex": index,
|
|
275
286
|
role: "row",
|
|
276
287
|
className: clsx(...rowClassNames, classes.root, className),
|
|
277
288
|
style: style
|
|
278
289
|
}, ariaAttributes, eventHandlers, other, {
|
|
290
|
+
ref: handleRef,
|
|
279
291
|
children: [leftCells, /*#__PURE__*/_jsx("div", {
|
|
280
292
|
role: "presentation",
|
|
281
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,10 +4,10 @@ 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
|
|
7
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
8
8
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
9
|
-
import { jsx as _jsx
|
|
10
|
-
const GridActionsCellItem =
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
const GridActionsCellItem = forwardRef((props, ref) => {
|
|
11
11
|
const rootProps = useGridRootProps();
|
|
12
12
|
if (!props.showInMenu) {
|
|
13
13
|
const {
|
|
@@ -20,13 +20,13 @@ const GridActionsCellItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
20
20
|
onClick?.(event);
|
|
21
21
|
};
|
|
22
22
|
return /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
23
|
-
ref: ref,
|
|
24
23
|
size: "small",
|
|
25
24
|
role: "menuitem",
|
|
26
25
|
"aria-label": label
|
|
27
26
|
}, other, {
|
|
28
27
|
onClick: handleClick
|
|
29
28
|
}, rootProps.slotProps?.baseIconButton, {
|
|
29
|
+
ref: ref,
|
|
30
30
|
children: /*#__PURE__*/React.cloneElement(icon, {
|
|
31
31
|
fontSize: 'small'
|
|
32
32
|
})
|
|
@@ -46,13 +46,12 @@ const GridActionsCellItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
46
46
|
closeMenu?.();
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
-
return /*#__PURE__*/
|
|
49
|
+
return /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, _extends({
|
|
50
50
|
ref: ref
|
|
51
51
|
}, other, {
|
|
52
52
|
onClick: handleClick,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}), label]
|
|
53
|
+
iconStart: icon,
|
|
54
|
+
children: label
|
|
56
55
|
}));
|
|
57
56
|
});
|
|
58
57
|
process.env.NODE_ENV !== "production" ? GridActionsCellItem.propTypes = {
|
|
@@ -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
|
});
|