@mui/x-data-grid 6.3.0 → 6.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +105 -2
- package/DataGrid/DataGrid.js +20 -1
- package/DataGrid/useDataGridComponent.js +2 -2
- package/DataGrid/useDataGridProps.js +3 -1
- package/colDef/gridBooleanColDef.js +19 -1
- package/colDef/gridDateColDef.js +6 -2
- package/colDef/gridSingleSelectColDef.js +21 -1
- package/components/GridPagination.js +3 -1
- package/components/base/GridBody.d.ts +1 -0
- package/components/base/GridBody.js +6 -3
- package/components/containers/GridRootStyles.js +1 -0
- package/components/panel/GridPanel.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -2
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -2
- package/components/toolbar/GridToolbarFilterButton.js +3 -1
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +12 -1
- package/hooks/features/clipboard/useGridClipboard.d.ts +2 -1
- package/hooks/features/clipboard/useGridClipboard.js +43 -26
- package/hooks/features/dimensions/useGridDimensions.js +2 -4
- package/hooks/features/editing/useGridCellEditing.js +7 -3
- package/hooks/features/editing/useGridRowEditing.js +7 -3
- package/hooks/features/export/serializers/csvSerializer.d.ts +5 -0
- package/hooks/features/export/serializers/csvSerializer.js +46 -6
- package/hooks/features/export/useGridCsvExport.d.ts +2 -1
- package/hooks/features/export/useGridCsvExport.js +7 -5
- package/hooks/features/focus/useGridFocus.js +2 -2
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +11 -0
- package/index.js +1 -1
- package/internals/index.d.ts +3 -2
- package/internals/index.js +3 -2
- package/joy/icons.d.ts +33 -0
- package/joy/icons.js +433 -0
- package/joy/joySlots.js +254 -42
- package/legacy/DataGrid/DataGrid.js +20 -1
- package/legacy/DataGrid/useDataGridComponent.js +2 -2
- package/legacy/DataGrid/useDataGridProps.js +3 -1
- package/legacy/colDef/gridBooleanColDef.js +21 -1
- package/legacy/colDef/gridDateColDef.js +10 -2
- package/legacy/colDef/gridSingleSelectColDef.js +21 -1
- package/legacy/components/GridPagination.js +3 -1
- package/legacy/components/base/GridBody.js +6 -3
- package/legacy/components/containers/GridRootStyles.js +1 -0
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -2
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -2
- package/legacy/components/toolbar/GridToolbarFilterButton.js +3 -1
- package/legacy/hooks/features/clipboard/useGridClipboard.js +44 -26
- package/legacy/hooks/features/dimensions/useGridDimensions.js +2 -4
- package/legacy/hooks/features/editing/useGridCellEditing.js +7 -3
- package/legacy/hooks/features/editing/useGridRowEditing.js +7 -3
- package/legacy/hooks/features/export/serializers/csvSerializer.js +43 -6
- package/legacy/hooks/features/export/useGridCsvExport.js +8 -5
- package/legacy/hooks/features/focus/useGridFocus.js +2 -2
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +10 -0
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +3 -2
- package/legacy/joy/icons.js +432 -0
- package/legacy/joy/joySlots.js +273 -54
- package/legacy/locales/deDE.js +2 -2
- package/legacy/locales/frFR.js +6 -6
- package/legacy/locales/ptBR.js +1 -1
- package/legacy/locales/ukUA.js +8 -9
- package/legacy/material/index.js +3 -1
- package/legacy/models/api/index.js +0 -1
- package/legacy/utils/domUtils.js +14 -1
- package/locales/deDE.js +2 -2
- package/locales/frFR.js +6 -6
- package/locales/ptBR.js +1 -1
- package/locales/ukUA.js +8 -9
- package/material/index.d.ts +3 -1
- package/material/index.js +3 -1
- package/models/api/gridApiCommon.d.ts +1 -2
- package/models/api/gridCoreApi.d.ts +4 -0
- package/models/api/index.d.ts +0 -1
- package/models/api/index.js +0 -1
- package/models/events/gridEventLookup.d.ts +6 -0
- package/models/gridSlotsComponent.d.ts +5 -0
- package/models/gridSlotsComponentsProps.d.ts +4 -0
- package/models/props/DataGridProps.d.ts +19 -0
- package/modern/DataGrid/DataGrid.js +20 -1
- package/modern/DataGrid/useDataGridComponent.js +2 -2
- package/modern/DataGrid/useDataGridProps.js +3 -1
- package/modern/colDef/gridBooleanColDef.js +19 -1
- package/modern/colDef/gridDateColDef.js +6 -2
- package/modern/colDef/gridSingleSelectColDef.js +21 -1
- package/modern/components/GridPagination.js +2 -1
- package/modern/components/base/GridBody.js +6 -3
- package/modern/components/containers/GridRootStyles.js +1 -0
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -2
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -2
- package/modern/components/toolbar/GridToolbarFilterButton.js +3 -1
- package/modern/hooks/features/clipboard/useGridClipboard.js +43 -26
- package/modern/hooks/features/dimensions/useGridDimensions.js +1 -3
- package/modern/hooks/features/editing/useGridCellEditing.js +7 -3
- package/modern/hooks/features/editing/useGridRowEditing.js +7 -3
- package/modern/hooks/features/export/serializers/csvSerializer.js +44 -6
- package/modern/hooks/features/export/useGridCsvExport.js +7 -5
- package/modern/hooks/features/focus/useGridFocus.js +2 -2
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +11 -0
- package/modern/index.js +1 -1
- package/modern/internals/index.js +3 -2
- package/modern/joy/icons.js +433 -0
- package/modern/joy/joySlots.js +248 -41
- package/modern/locales/deDE.js +2 -2
- package/modern/locales/frFR.js +6 -6
- package/modern/locales/ptBR.js +1 -1
- package/modern/locales/ukUA.js +8 -9
- package/modern/material/index.js +3 -1
- package/modern/models/api/index.js +0 -1
- package/modern/utils/domUtils.js +13 -1
- package/node/DataGrid/DataGrid.js +20 -1
- package/node/DataGrid/useDataGridComponent.js +2 -2
- package/node/DataGrid/useDataGridProps.js +3 -1
- package/node/colDef/gridBooleanColDef.js +19 -1
- package/node/colDef/gridDateColDef.js +6 -2
- package/node/colDef/gridSingleSelectColDef.js +21 -1
- package/node/components/GridPagination.js +2 -1
- package/node/components/base/GridBody.js +6 -3
- package/node/components/containers/GridRootStyles.js +1 -0
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -2
- package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -2
- package/node/components/toolbar/GridToolbarFilterButton.js +3 -1
- package/node/hooks/features/clipboard/useGridClipboard.js +42 -25
- package/node/hooks/features/dimensions/useGridDimensions.js +1 -3
- package/node/hooks/features/editing/useGridCellEditing.js +7 -3
- package/node/hooks/features/editing/useGridRowEditing.js +7 -3
- package/node/hooks/features/export/serializers/csvSerializer.js +46 -6
- package/node/hooks/features/export/useGridCsvExport.js +6 -3
- package/node/hooks/features/focus/useGridFocus.js +2 -2
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +11 -0
- package/node/index.js +1 -1
- package/node/internals/index.js +23 -1
- package/node/joy/icons.js +471 -0
- package/node/joy/joySlots.js +248 -40
- package/node/locales/deDE.js +2 -2
- package/node/locales/frFR.js +6 -6
- package/node/locales/ptBR.js +1 -1
- package/node/locales/ukUA.js +8 -9
- package/node/material/index.js +3 -1
- package/node/models/api/index.js +0 -11
- package/node/utils/domUtils.js +15 -1
- package/package.json +2 -2
- package/utils/domUtils.d.ts +1 -0
- package/utils/domUtils.js +13 -1
- package/legacy/models/api/gridClipboardApi.js +0 -1
- package/models/api/gridClipboardApi.d.ts +0 -11
- package/models/api/gridClipboardApi.js +0 -1
- package/modern/models/api/gridClipboardApi.js +0 -1
- package/node/models/api/gridClipboardApi.js +0 -5
package/locales/ukUA.js
CHANGED
|
@@ -51,7 +51,7 @@ const ukUAGrid = {
|
|
|
51
51
|
columnsPanelHideAllButton: 'Приховати всі',
|
|
52
52
|
// Filter panel text
|
|
53
53
|
filterPanelAddFilter: 'Додати фільтр',
|
|
54
|
-
|
|
54
|
+
filterPanelRemoveAll: 'Видалити всі',
|
|
55
55
|
filterPanelDeleteIconLabel: 'Видалити',
|
|
56
56
|
filterPanelLogicOperator: 'Логічна функція',
|
|
57
57
|
filterPanelOperator: 'Оператори',
|
|
@@ -81,7 +81,7 @@ const ukUAGrid = {
|
|
|
81
81
|
// Column menu text
|
|
82
82
|
columnMenuLabel: 'Меню',
|
|
83
83
|
columnMenuShowColumns: 'Показати стовпці',
|
|
84
|
-
|
|
84
|
+
columnMenuManageColumns: 'Керування стовпцями',
|
|
85
85
|
columnMenuFilter: 'Фільтр',
|
|
86
86
|
columnMenuHideColumn: 'Приховати',
|
|
87
87
|
columnMenuUnsort: 'Скасувати сортування',
|
|
@@ -135,12 +135,11 @@ const ukUAGrid = {
|
|
|
135
135
|
// Row reordering text
|
|
136
136
|
rowReorderingHeaderName: 'Порядок рядків',
|
|
137
137
|
// Aggregation
|
|
138
|
-
aggregationMenuItemHeader: 'Агрегація'
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
138
|
+
aggregationMenuItemHeader: 'Агрегація',
|
|
139
|
+
aggregationFunctionLabelSum: 'сума',
|
|
140
|
+
aggregationFunctionLabelAvg: 'сер',
|
|
141
|
+
aggregationFunctionLabelMin: 'мін',
|
|
142
|
+
aggregationFunctionLabelMax: 'макс',
|
|
143
|
+
aggregationFunctionLabelSize: 'кількість'
|
|
144
144
|
};
|
|
145
|
-
|
|
146
145
|
export const ukUA = getGridLocalization(ukUAGrid, ukUACore);
|
package/material/index.d.ts
CHANGED
|
@@ -15,7 +15,8 @@ declare const materialSlots: {
|
|
|
15
15
|
BaseButton: import("@mui/material").ExtendButtonBase<import("@mui/material/Button").ButtonTypeMap<{}, "button">>;
|
|
16
16
|
BaseIconButton: import("@mui/material").ExtendButtonBase<import("@mui/material/IconButton").IconButtonTypeMap<{}, "button">>;
|
|
17
17
|
BaseTooltip: typeof MUITooltip;
|
|
18
|
-
BasePopper: import("react").ForwardRefExoticComponent<Omit<import("@mui/base").PopperProps<"div"
|
|
18
|
+
BasePopper: import("react").ForwardRefExoticComponent<Omit<import("@mui/base").PopperProps<"div">, "direction"> & {
|
|
19
|
+
component?: import("react").ElementType<any> | undefined;
|
|
19
20
|
components?: {
|
|
20
21
|
Root?: import("react").ElementType<any> | undefined;
|
|
21
22
|
} | undefined;
|
|
@@ -26,6 +27,7 @@ declare const materialSlots: {
|
|
|
26
27
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
27
28
|
BaseInputLabel: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material/InputLabel").InputLabelTypeMap<{}, "label">>;
|
|
28
29
|
BaseSelectOption: typeof MUISelectOption;
|
|
30
|
+
BaseChip: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material/Chip").ChipTypeMap<{}, "div">>;
|
|
29
31
|
BooleanCellTrueIcon: import("react").JSXElementConstructor<any>;
|
|
30
32
|
BooleanCellFalseIcon: import("react").JSXElementConstructor<any>;
|
|
31
33
|
ColumnMenuIcon: import("react").JSXElementConstructor<any>;
|
package/material/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import MUIIconButton from '@mui/material/IconButton';
|
|
|
9
9
|
import MUITooltip from '@mui/material/Tooltip';
|
|
10
10
|
import MUIPopper from '@mui/material/Popper';
|
|
11
11
|
import MUIInputLabel from '@mui/material/InputLabel';
|
|
12
|
+
import MUIChip from '@mui/material/Chip';
|
|
12
13
|
import { GridColumnUnsortedIcon } from './icons/GridColumnUnsortedIcon';
|
|
13
14
|
import { GridAddIcon, GridArrowDownwardIcon, GridArrowUpwardIcon, GridCheckIcon, GridCloseIcon, GridColumnIcon, GridDragIcon, GridExpandMoreIcon, GridFilterAltIcon, GridFilterListIcon, GridKeyboardArrowRight, GridMoreVertIcon, GridRemoveIcon, GridSaveAltIcon, GridSearchIcon, GridSeparatorIcon, GridTableRowsIcon, GridTripleDotsVerticalIcon, GridViewHeadlineIcon, GridViewStreamIcon, GridVisibilityOffIcon, GridViewColumnIcon, GridClearIcon, GridLoadIcon, GridDeleteForeverIcon } from './icons';
|
|
14
15
|
import MUISelectOption from './components/MUISelectOption';
|
|
@@ -60,6 +61,7 @@ const materialSlots = _extends({}, iconSlots, {
|
|
|
60
61
|
BaseTooltip: MUITooltip,
|
|
61
62
|
BasePopper: MUIPopper,
|
|
62
63
|
BaseInputLabel: MUIInputLabel,
|
|
63
|
-
BaseSelectOption: MUISelectOption
|
|
64
|
+
BaseSelectOption: MUISelectOption,
|
|
65
|
+
BaseChip: MUIChip
|
|
64
66
|
});
|
|
65
67
|
export default materialSlots;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { GridColumnApi } from './gridColumnApi';
|
|
2
2
|
import { GridColumnMenuApi } from './gridColumnMenuApi';
|
|
3
3
|
import { GridCoreApi, GridCorePrivateApi } from './gridCoreApi';
|
|
4
|
-
import { GridClipboardApi } from './gridClipboardApi';
|
|
5
4
|
import { GridCsvExportApi } from './gridCsvExportApi';
|
|
6
5
|
import { GridDensityApi } from './gridDensityApi';
|
|
7
6
|
import { GridEditingApi, GridEditingPrivateApi } from './gridEditingApi';
|
|
@@ -28,7 +27,7 @@ import type { GridPaginationApi } from '../../hooks/features/pagination';
|
|
|
28
27
|
import type { GridStatePersistenceApi } from '../../hooks/features/statePersistence';
|
|
29
28
|
import { GridColumnGroupingApi } from './gridColumnGroupingApi';
|
|
30
29
|
import type { GridInitialStateCommunity, GridStateCommunity } from '../gridStateCommunity';
|
|
31
|
-
export interface GridApiCommon<GridState extends GridStateCommunity = any, GridInitialState extends GridInitialStateCommunity = any> extends GridCoreApi, GridPipeProcessingApi, GridDensityApi, GridDimensionsApi, GridRowApi, GridRowsMetaApi, GridEditingApi, GridParamsApi, GridColumnApi, GridRowSelectionApi, GridSortApi, GridPaginationApi, GridCsvExportApi, GridFocusApi, GridFilterApi, GridColumnMenuApi, GridPreferencesPanelApi, GridPrintExportApi, GridDisableVirtualizationApi, GridLocaleTextApi,
|
|
30
|
+
export interface GridApiCommon<GridState extends GridStateCommunity = any, GridInitialState extends GridInitialStateCommunity = any> extends GridCoreApi, GridPipeProcessingApi, GridDensityApi, GridDimensionsApi, GridRowApi, GridRowsMetaApi, GridEditingApi, GridParamsApi, GridColumnApi, GridRowSelectionApi, GridSortApi, GridPaginationApi, GridCsvExportApi, GridFocusApi, GridFilterApi, GridColumnMenuApi, GridPreferencesPanelApi, GridPrintExportApi, GridDisableVirtualizationApi, GridLocaleTextApi, GridScrollApi, GridColumnSpanningApi, GridStateApi<GridState>, GridStatePersistenceApi<GridInitialState>, GridColumnGroupingApi {
|
|
32
31
|
}
|
|
33
32
|
export interface GridPrivateOnlyApiCommon<Api extends GridApiCommon, PrivateApi extends GridPrivateApiCommon> extends GridCorePrivateApi<Api, PrivateApi>, GridStatePrivateApi<PrivateApi['state']>, GridPipeProcessingPrivateApi, GridStrategyProcessingApi, GridColumnSpanningPrivateApi, GridRowsMetaPrivateApi, GridDimensionsPrivateApi, GridVirtualScrollerApi, GridEditingPrivateApi, GridLoggerApi, GridFocusPrivateApi {
|
|
34
33
|
}
|
|
@@ -53,6 +53,10 @@ export interface GridCorePrivateApi<GridPublicApi extends GridApiCommon, GridPri
|
|
|
53
53
|
* The React ref of the grid virtual scroller container element.
|
|
54
54
|
*/
|
|
55
55
|
virtualScrollerRef?: React.RefObject<HTMLDivElement>;
|
|
56
|
+
/**
|
|
57
|
+
* The React ref of the grid main container div element.
|
|
58
|
+
*/
|
|
59
|
+
mainElementRef?: React.RefObject<HTMLDivElement>;
|
|
56
60
|
register: <V extends 'public' | 'private', T extends V extends 'public' ? Partial<GridPublicApi> : Partial<Omit<GridPrivateApi, keyof GridPublicApi>>>(visibility: V, methods: T) => void;
|
|
57
61
|
/**
|
|
58
62
|
* Returns the public API.
|
package/models/api/index.d.ts
CHANGED
|
@@ -16,7 +16,6 @@ export * from './gridColumnMenuApi';
|
|
|
16
16
|
export * from './gridPreferencesPanelApi';
|
|
17
17
|
export * from './gridPrintExportApi';
|
|
18
18
|
export * from './gridDisableVirtualizationApi';
|
|
19
|
-
export * from './gridClipboardApi';
|
|
20
19
|
export * from './gridCallbackDetails';
|
|
21
20
|
export * from './gridScrollApi';
|
|
22
21
|
export * from './gridVirtualScrollerApi';
|
package/models/api/index.js
CHANGED
|
@@ -11,7 +11,6 @@ export * from './gridColumnMenuApi';
|
|
|
11
11
|
export * from './gridPreferencesPanelApi';
|
|
12
12
|
export * from './gridPrintExportApi';
|
|
13
13
|
export * from './gridDisableVirtualizationApi';
|
|
14
|
-
export * from './gridClipboardApi';
|
|
15
14
|
export * from './gridCallbackDetails';
|
|
16
15
|
export * from './gridScrollApi';
|
|
17
16
|
export * from './gridVirtualScrollerApi';
|
|
@@ -541,6 +541,12 @@ export interface GridEventLookup extends GridRowEventLookup, GridColumnHeaderEve
|
|
|
541
541
|
params: GridRowSelectionCheckboxParams;
|
|
542
542
|
event: React.ChangeEvent<HTMLElement>;
|
|
543
543
|
};
|
|
544
|
+
/**
|
|
545
|
+
* Fired when the data is copied to the clipboard
|
|
546
|
+
*/
|
|
547
|
+
clipboardCopy: {
|
|
548
|
+
params: string;
|
|
549
|
+
};
|
|
544
550
|
/**
|
|
545
551
|
* Fired when the preference panel is closed.
|
|
546
552
|
*/
|
|
@@ -60,6 +60,11 @@ export interface GridSlotsComponent extends GridIconSlotsComponent {
|
|
|
60
60
|
* @default MenuItem
|
|
61
61
|
*/
|
|
62
62
|
BaseSelectOption: React.JSXElementConstructor<any>;
|
|
63
|
+
/**
|
|
64
|
+
* The custom Chip component used in the grid.
|
|
65
|
+
* @default Chip
|
|
66
|
+
*/
|
|
67
|
+
BaseChip: React.JSXElementConstructor<any>;
|
|
63
68
|
/**
|
|
64
69
|
* Component rendered for each cell.
|
|
65
70
|
* @default GridCell
|
|
@@ -10,6 +10,7 @@ import { TooltipProps } from '@mui/material/Tooltip';
|
|
|
10
10
|
import type { InputLabelProps } from '@mui/material/InputLabel';
|
|
11
11
|
import { PopperProps } from '@mui/material/Popper';
|
|
12
12
|
import { TablePaginationProps } from '@mui/material/TablePagination';
|
|
13
|
+
import { ChipProps } from '@mui/material/Chip';
|
|
13
14
|
import { GridToolbarProps } from '../components/toolbar/GridToolbar';
|
|
14
15
|
import { ColumnHeaderFilterIconButtonProps } from '../components/columnHeaders/GridColumnHeaderFilterIconButton';
|
|
15
16
|
import { GridColumnMenuProps } from '../components/menu/columnMenu/GridColumnMenuProps';
|
|
@@ -42,6 +43,8 @@ export interface BaseInputLabelPropsOverrides {
|
|
|
42
43
|
}
|
|
43
44
|
export interface BaseSelectOptionPropsOverrides {
|
|
44
45
|
}
|
|
46
|
+
export interface BaseChipPropsOverrides {
|
|
47
|
+
}
|
|
45
48
|
export interface CellPropsOverrides {
|
|
46
49
|
}
|
|
47
50
|
export interface ToolbarPropsOverrides {
|
|
@@ -90,6 +93,7 @@ export interface GridSlotsComponentsProps {
|
|
|
90
93
|
value: any;
|
|
91
94
|
children?: React.ReactNode;
|
|
92
95
|
}, BaseSelectOptionPropsOverrides>;
|
|
96
|
+
baseChip?: SlotProps<ChipProps, BaseChipPropsOverrides>;
|
|
93
97
|
cell?: SlotProps<GridCellProps, CellPropsOverrides>;
|
|
94
98
|
columnHeaderFilterIconButton?: SlotProps<ColumnHeaderFilterIconButtonProps, ColumnHeaderFilterIconButtonPropsOverrides>;
|
|
95
99
|
columnMenu?: SlotProps<GridColumnMenuProps, ColumnMenuPropsOverrides>;
|
|
@@ -306,6 +306,20 @@ export interface DataGridPropsWithDefaultValues {
|
|
|
306
306
|
* @default false
|
|
307
307
|
*/
|
|
308
308
|
keepColumnPositionIfDraggedOutside: boolean;
|
|
309
|
+
/**
|
|
310
|
+
* If `true`, the grid will not use `valueFormatter` when exporting to CSV or copying to clipboard.
|
|
311
|
+
* If an object is provided, you can choose to ignore the `valueFormatter` for CSV export or clipboard export.
|
|
312
|
+
* @default: false
|
|
313
|
+
*/
|
|
314
|
+
unstable_ignoreValueFormatterDuringExport: boolean | {
|
|
315
|
+
csvExport?: boolean;
|
|
316
|
+
clipboardExport?: boolean;
|
|
317
|
+
};
|
|
318
|
+
/**
|
|
319
|
+
* The character used to separate cell values when copying to the clipboard.
|
|
320
|
+
* @default '\t'
|
|
321
|
+
*/
|
|
322
|
+
clipboardCopyCellDelimiter: string;
|
|
309
323
|
}
|
|
310
324
|
/**
|
|
311
325
|
* The `DataGrid` props with no default value.
|
|
@@ -679,4 +693,9 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
679
693
|
*/
|
|
680
694
|
onProcessRowUpdateError?: (error: any) => void;
|
|
681
695
|
columnGroupingModel?: GridColumnGroupingModel;
|
|
696
|
+
/**
|
|
697
|
+
* Callback called when the data is copied to the clipboard.
|
|
698
|
+
* @param {string} data The data copied to the clipboard.
|
|
699
|
+
*/
|
|
700
|
+
onClipboardCopy?: GridEventListener<'clipboardCopy'>;
|
|
682
701
|
}
|
|
@@ -68,6 +68,11 @@ DataGridRaw.propTypes = {
|
|
|
68
68
|
* Override or extend the styles applied to the component.
|
|
69
69
|
*/
|
|
70
70
|
classes: PropTypes.object,
|
|
71
|
+
/**
|
|
72
|
+
* The character used to separate cell values when copying to the clipboard.
|
|
73
|
+
* @default '\t'
|
|
74
|
+
*/
|
|
75
|
+
clipboardCopyCellDelimiter: PropTypes.string,
|
|
71
76
|
/**
|
|
72
77
|
* Number of extra columns to be rendered before/after the visible slice.
|
|
73
78
|
* @default 3
|
|
@@ -326,6 +331,11 @@ DataGridRaw.propTypes = {
|
|
|
326
331
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
327
332
|
*/
|
|
328
333
|
onCellModesModelChange: PropTypes.func,
|
|
334
|
+
/**
|
|
335
|
+
* Callback called when the data is copied to the clipboard.
|
|
336
|
+
* @param {string} data The data copied to the clipboard.
|
|
337
|
+
*/
|
|
338
|
+
onClipboardCopy: PropTypes.func,
|
|
329
339
|
/**
|
|
330
340
|
* Callback fired when a click event comes from a column header element.
|
|
331
341
|
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
|
|
@@ -611,5 +621,14 @@ DataGridRaw.propTypes = {
|
|
|
611
621
|
/**
|
|
612
622
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
613
623
|
*/
|
|
614
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
624
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
625
|
+
/**
|
|
626
|
+
* If `true`, the grid will not use `valueFormatter` when exporting to CSV or copying to clipboard.
|
|
627
|
+
* If an object is provided, you can choose to ignore the `valueFormatter` for CSV export or clipboard export.
|
|
628
|
+
* @default: false
|
|
629
|
+
*/
|
|
630
|
+
unstable_ignoreValueFormatterDuringExport: PropTypes.oneOfType([PropTypes.shape({
|
|
631
|
+
clipboardExport: PropTypes.bool,
|
|
632
|
+
csvExport: PropTypes.bool
|
|
633
|
+
}), PropTypes.bool])
|
|
615
634
|
};
|
|
@@ -67,9 +67,9 @@ export const useDataGridComponent = (inputApiRef, props) => {
|
|
|
67
67
|
useGridRowsMeta(privateApiRef, props);
|
|
68
68
|
useGridScroll(privateApiRef, props);
|
|
69
69
|
useGridColumnMenu(privateApiRef);
|
|
70
|
-
useGridCsvExport(privateApiRef);
|
|
70
|
+
useGridCsvExport(privateApiRef, props);
|
|
71
71
|
useGridPrintExport(privateApiRef, props);
|
|
72
|
-
useGridClipboard(privateApiRef);
|
|
72
|
+
useGridClipboard(privateApiRef, props);
|
|
73
73
|
useGridDimensions(privateApiRef, props);
|
|
74
74
|
useGridEvents(privateApiRef, props);
|
|
75
75
|
useGridStatePersistence(privateApiRef);
|
|
@@ -66,7 +66,9 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
66
66
|
disableColumnReorder: false,
|
|
67
67
|
disableColumnResize: false,
|
|
68
68
|
keepNonExistentRowsSelected: false,
|
|
69
|
-
keepColumnPositionIfDraggedOutside: false
|
|
69
|
+
keepColumnPositionIfDraggedOutside: false,
|
|
70
|
+
unstable_ignoreValueFormatterDuringExport: false,
|
|
71
|
+
clipboardCopyCellDelimiter: '\t'
|
|
70
72
|
};
|
|
71
73
|
const defaultSlots = uncapitalizeObjectKeys(DATA_GRID_DEFAULT_SLOTS_COMPONENTS);
|
|
72
74
|
export const useDataGridProps = inProps => {
|
|
@@ -10,6 +10,22 @@ function gridBooleanFormatter({
|
|
|
10
10
|
}) {
|
|
11
11
|
return value ? api.getLocaleText('booleanCellTrueLabel') : api.getLocaleText('booleanCellFalseLabel');
|
|
12
12
|
}
|
|
13
|
+
const stringToBoolean = value => {
|
|
14
|
+
switch (value.toLowerCase().trim()) {
|
|
15
|
+
case 'true':
|
|
16
|
+
case 'yes':
|
|
17
|
+
case '1':
|
|
18
|
+
return true;
|
|
19
|
+
case 'false':
|
|
20
|
+
case 'no':
|
|
21
|
+
case '0':
|
|
22
|
+
case 'null':
|
|
23
|
+
case 'undefined':
|
|
24
|
+
return false;
|
|
25
|
+
default:
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
13
29
|
export const GRID_BOOLEAN_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
14
30
|
type: 'boolean',
|
|
15
31
|
align: 'center',
|
|
@@ -21,5 +37,7 @@ export const GRID_BOOLEAN_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
|
21
37
|
filterOperators: getGridBooleanOperators(),
|
|
22
38
|
getApplyQuickFilterFn: undefined,
|
|
23
39
|
// @ts-ignore
|
|
24
|
-
aggregable: false
|
|
40
|
+
aggregable: false,
|
|
41
|
+
// @ts-ignore
|
|
42
|
+
pastedValueParser: value => stringToBoolean(value)
|
|
25
43
|
});
|
|
@@ -51,7 +51,9 @@ export const GRID_DATE_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
|
51
51
|
valueFormatter: gridDateFormatter,
|
|
52
52
|
filterOperators: getGridDateOperators(),
|
|
53
53
|
renderEditCell: renderEditDateCell,
|
|
54
|
-
getApplyQuickFilterFn: undefined
|
|
54
|
+
getApplyQuickFilterFn: undefined,
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
pastedValueParser: value => new Date(value)
|
|
55
57
|
});
|
|
56
58
|
export const GRID_DATETIME_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
57
59
|
type: 'dateTime',
|
|
@@ -59,5 +61,7 @@ export const GRID_DATETIME_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
|
59
61
|
valueFormatter: gridDateTimeFormatter,
|
|
60
62
|
filterOperators: getGridDateOperators(true),
|
|
61
63
|
renderEditCell: renderEditDateCell,
|
|
62
|
-
getApplyQuickFilterFn: undefined
|
|
64
|
+
getApplyQuickFilterFn: undefined,
|
|
65
|
+
// @ts-ignore
|
|
66
|
+
pastedValueParser: value => new Date(value)
|
|
63
67
|
});
|
|
@@ -51,5 +51,25 @@ export const GRID_SINGLE_SELECT_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
|
51
51
|
return valueOption ? colDef.getOptionLabel(valueOption) : '';
|
|
52
52
|
},
|
|
53
53
|
renderEditCell: renderEditSingleSelectCell,
|
|
54
|
-
filterOperators: getGridSingleSelectOperators()
|
|
54
|
+
filterOperators: getGridSingleSelectOperators(),
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
pastedValueParser: (value, params) => {
|
|
57
|
+
const colDef = params.colDef;
|
|
58
|
+
const colDefValueOptions = colDef.valueOptions;
|
|
59
|
+
const valueOptions = typeof colDefValueOptions === 'function' ? colDefValueOptions({
|
|
60
|
+
field: colDef.field
|
|
61
|
+
}) : colDefValueOptions || [];
|
|
62
|
+
const getOptionValue = colDef.getOptionValue;
|
|
63
|
+
const valueOption = valueOptions.find(option => {
|
|
64
|
+
if (getOptionValue(option) === value) {
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
return false;
|
|
68
|
+
});
|
|
69
|
+
if (valueOption) {
|
|
70
|
+
return value;
|
|
71
|
+
}
|
|
72
|
+
// do not paste the value if it is not in the valueOptions
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
55
75
|
});
|
|
@@ -41,7 +41,8 @@ export const GridPagination = /*#__PURE__*/React.forwardRef(function GridPaginat
|
|
|
41
41
|
if (process.env.NODE_ENV !== 'production') {
|
|
42
42
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
43
43
|
const warnedOnceMissingInPageSizeOptions = React.useRef(false);
|
|
44
|
-
|
|
44
|
+
const pageSize = rootProps.paginationModel?.pageSize ?? paginationModel.pageSize;
|
|
45
|
+
if (!warnedOnceMissingInPageSizeOptions.current && !rootProps.autoPageSize && !rootProps.pageSizeOptions.includes(pageSize)) {
|
|
45
46
|
console.warn([`MUI: The page size \`${paginationModel.pageSize}\` is not preset in the \`pageSizeOptions\``, `Add it to show the pagination select.`].join('\n'));
|
|
46
47
|
warnedOnceMissingInPageSizeOptions.current = true;
|
|
47
48
|
}
|
|
@@ -18,7 +18,8 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
18
18
|
function GridBody(props) {
|
|
19
19
|
const {
|
|
20
20
|
VirtualScrollerComponent,
|
|
21
|
-
ColumnHeadersProps
|
|
21
|
+
ColumnHeadersProps,
|
|
22
|
+
children
|
|
22
23
|
} = props;
|
|
23
24
|
const apiRef = useGridPrivateApiContext();
|
|
24
25
|
const rootProps = useGridRootProps();
|
|
@@ -88,7 +89,8 @@ function GridBody(props) {
|
|
|
88
89
|
apiRef.current.register('private', {
|
|
89
90
|
columnHeadersContainerElementRef: columnsContainerRef,
|
|
90
91
|
columnHeadersElementRef: columnHeadersRef,
|
|
91
|
-
virtualScrollerRef
|
|
92
|
+
virtualScrollerRef,
|
|
93
|
+
mainElementRef: rootRef
|
|
92
94
|
});
|
|
93
95
|
const hasDimensions = !!apiRef.current.getRootDimensions();
|
|
94
96
|
return /*#__PURE__*/_jsxs(GridMainContainer, {
|
|
@@ -119,7 +121,7 @@ function GridBody(props) {
|
|
|
119
121
|
, {
|
|
120
122
|
ref: virtualScrollerRef,
|
|
121
123
|
disableVirtualization: isVirtualizationDisabled
|
|
122
|
-
})]
|
|
124
|
+
}), children]
|
|
123
125
|
});
|
|
124
126
|
}
|
|
125
127
|
process.env.NODE_ENV !== "production" ? GridBody.propTypes = {
|
|
@@ -127,6 +129,7 @@ process.env.NODE_ENV !== "production" ? GridBody.propTypes = {
|
|
|
127
129
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
128
130
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
129
131
|
// ----------------------------------------------------------------------
|
|
132
|
+
children: PropTypes.node,
|
|
130
133
|
ColumnHeadersProps: PropTypes.object,
|
|
131
134
|
VirtualScrollerComponent: PropTypes.elementType.isRequired
|
|
132
135
|
} : void 0;
|
|
@@ -4,7 +4,6 @@ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "c
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import Autocomplete, { createFilterOptions } from '@mui/material/Autocomplete';
|
|
7
|
-
import Chip from '@mui/material/Chip';
|
|
8
7
|
import { unstable_useId as useId } from '@mui/utils';
|
|
9
8
|
import { isSingleSelectColDef } from './filterPanelUtils';
|
|
10
9
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
@@ -96,7 +95,7 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
96
95
|
value: filteredValues,
|
|
97
96
|
onChange: handleChange,
|
|
98
97
|
getOptionLabel: getOptionLabel,
|
|
99
|
-
renderTags: (value, getTagProps) => value.map((option, index) => /*#__PURE__*/_jsx(
|
|
98
|
+
renderTags: (value, getTagProps) => value.map((option, index) => /*#__PURE__*/_jsx(rootProps.slots.baseChip, _extends({
|
|
100
99
|
variant: "outlined",
|
|
101
100
|
size: "small",
|
|
102
101
|
label: getOptionLabel(option)
|
|
@@ -4,7 +4,6 @@ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "c
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import Autocomplete from '@mui/material/Autocomplete';
|
|
7
|
-
import Chip from '@mui/material/Chip';
|
|
8
7
|
import { unstable_useId as useId } from '@mui/utils';
|
|
9
8
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
10
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -55,7 +54,7 @@ function GridFilterInputMultipleValue(props) {
|
|
|
55
54
|
id: id,
|
|
56
55
|
value: filterValueState,
|
|
57
56
|
onChange: handleChange,
|
|
58
|
-
renderTags: (value, getTagProps) => value.map((option, index) => /*#__PURE__*/_jsx(
|
|
57
|
+
renderTags: (value, getTagProps) => value.map((option, index) => /*#__PURE__*/_jsx(rootProps.slots.baseChip, _extends({
|
|
59
58
|
variant: "outlined",
|
|
60
59
|
size: "small",
|
|
61
60
|
label: option
|
|
@@ -68,7 +68,9 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
|
|
|
68
68
|
children: activeFilters.map((item, index) => _extends({}, lookup[item.field] && /*#__PURE__*/_jsx("li", {
|
|
69
69
|
children: `${lookup[item.field].headerName || item.field}
|
|
70
70
|
${getOperatorLabel(item)}
|
|
71
|
-
${
|
|
71
|
+
${
|
|
72
|
+
// implicit check for null and undefined
|
|
73
|
+
item.value != null ? getFilterItemValue(item) : ''}`
|
|
72
74
|
}, index)))
|
|
73
75
|
})]
|
|
74
76
|
});
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useGridApiOptionHandler, useGridNativeEventListener } from '../../utils';
|
|
3
|
+
import { gridFocusCellSelector } from '../focus/gridFocusStateSelector';
|
|
4
|
+
import { serializeCellValue } from '../export/serializers/csvSerializer';
|
|
3
5
|
function writeToClipboardPolyfill(data) {
|
|
4
6
|
const span = document.createElement('span');
|
|
5
7
|
span.style.whiteSpace = 'pre';
|
|
@@ -18,6 +20,15 @@ function writeToClipboardPolyfill(data) {
|
|
|
18
20
|
document.body.removeChild(span);
|
|
19
21
|
}
|
|
20
22
|
}
|
|
23
|
+
function copyToClipboard(data) {
|
|
24
|
+
if (navigator.clipboard) {
|
|
25
|
+
navigator.clipboard.writeText(data).catch(() => {
|
|
26
|
+
writeToClipboardPolyfill(data);
|
|
27
|
+
});
|
|
28
|
+
} else {
|
|
29
|
+
writeToClipboardPolyfill(data);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
21
32
|
function hasNativeSelection(element) {
|
|
22
33
|
// When getSelection is called on an <iframe> that is not displayed Firefox will return null.
|
|
23
34
|
if (window.getSelection()?.toString()) {
|
|
@@ -37,24 +48,11 @@ function hasNativeSelection(element) {
|
|
|
37
48
|
* @requires useGridCsvExport (method)
|
|
38
49
|
* @requires useGridSelection (method)
|
|
39
50
|
*/
|
|
40
|
-
export const useGridClipboard = apiRef => {
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const data = apiRef.current.getDataAsCsv({
|
|
46
|
-
includeHeaders: false,
|
|
47
|
-
delimiter: '\t'
|
|
48
|
-
});
|
|
49
|
-
if (navigator.clipboard) {
|
|
50
|
-
navigator.clipboard.writeText(data).catch(() => {
|
|
51
|
-
writeToClipboardPolyfill(data);
|
|
52
|
-
});
|
|
53
|
-
} else {
|
|
54
|
-
writeToClipboardPolyfill(data);
|
|
55
|
-
}
|
|
56
|
-
}, [apiRef]);
|
|
57
|
-
const handleKeydown = React.useCallback(event => {
|
|
51
|
+
export const useGridClipboard = (apiRef, props) => {
|
|
52
|
+
const ignoreValueFormatterProp = props.unstable_ignoreValueFormatterDuringExport;
|
|
53
|
+
const ignoreValueFormatter = (typeof ignoreValueFormatterProp === 'object' ? ignoreValueFormatterProp?.clipboardExport : ignoreValueFormatterProp) || false;
|
|
54
|
+
const clipboardCopyCellDelimiter = props.clipboardCopyCellDelimiter;
|
|
55
|
+
const handleCopy = React.useCallback(event => {
|
|
58
56
|
const isModifierKeyPressed = event.ctrlKey || event.metaKey;
|
|
59
57
|
// event.code === 'KeyC' is not enough as event.code assume a QWERTY keyboard layout which would
|
|
60
58
|
// be wrong with a Dvorak keyboard (as if pressing J).
|
|
@@ -66,11 +64,30 @@ export const useGridClipboard = apiRef => {
|
|
|
66
64
|
if (hasNativeSelection(event.target)) {
|
|
67
65
|
return;
|
|
68
66
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
let textToCopy = '';
|
|
68
|
+
const selectedRows = apiRef.current.getSelectedRows();
|
|
69
|
+
if (selectedRows.size > 0) {
|
|
70
|
+
textToCopy = apiRef.current.getDataAsCsv({
|
|
71
|
+
includeHeaders: false,
|
|
72
|
+
// TODO: make it configurable
|
|
73
|
+
delimiter: clipboardCopyCellDelimiter
|
|
74
|
+
});
|
|
75
|
+
} else {
|
|
76
|
+
const focusedCell = gridFocusCellSelector(apiRef);
|
|
77
|
+
if (focusedCell) {
|
|
78
|
+
const cellParams = apiRef.current.getCellParams(focusedCell.id, focusedCell.field);
|
|
79
|
+
textToCopy = serializeCellValue(cellParams, {
|
|
80
|
+
delimiterCharacter: clipboardCopyCellDelimiter,
|
|
81
|
+
ignoreValueFormatter
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
textToCopy = apiRef.current.unstable_applyPipeProcessors('clipboardCopy', textToCopy);
|
|
86
|
+
if (textToCopy) {
|
|
87
|
+
copyToClipboard(textToCopy);
|
|
88
|
+
apiRef.current.publishEvent('clipboardCopy', textToCopy);
|
|
89
|
+
}
|
|
90
|
+
}, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter]);
|
|
91
|
+
useGridNativeEventListener(apiRef, apiRef.current.rootElementRef, 'keydown', handleCopy);
|
|
92
|
+
useGridApiOptionHandler(apiRef, 'clipboardCopy', props.onClipboardCopy);
|
|
76
93
|
};
|
|
@@ -10,7 +10,6 @@ import { getVisibleRows } from '../../utils/useGridVisibleRows';
|
|
|
10
10
|
import { gridRowsMetaSelector } from '../rows/gridRowsMetaSelector';
|
|
11
11
|
import { calculatePinnedRowsHeight } from '../rows/gridRowsUtils';
|
|
12
12
|
import { getTotalHeaderHeight } from '../columns/gridColumnsUtils';
|
|
13
|
-
import { gridClasses } from '../../../constants/gridClasses';
|
|
14
13
|
const isTestEnvironment = process.env.NODE_ENV === 'test';
|
|
15
14
|
const hasScroll = ({
|
|
16
15
|
content,
|
|
@@ -150,8 +149,7 @@ export function useGridDimensions(apiRef, props) {
|
|
|
150
149
|
return Math.min(maximumPageSizeWithoutScrollBar, currentPage.rows.length);
|
|
151
150
|
}, [apiRef, props.pagination, props.paginationMode, props.getRowHeight, rowHeight]);
|
|
152
151
|
const computeSizeAndPublishResizeEvent = React.useCallback(() => {
|
|
153
|
-
const
|
|
154
|
-
const mainEl = rootEl?.querySelector(`.${gridClasses.main}`);
|
|
152
|
+
const mainEl = apiRef.current.mainElementRef?.current;
|
|
155
153
|
if (!mainEl) {
|
|
156
154
|
return;
|
|
157
155
|
}
|
|
@@ -90,10 +90,14 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
90
90
|
}
|
|
91
91
|
} else if (params.isEditable) {
|
|
92
92
|
let reason;
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
const canStartEditing = apiRef.current.unstable_applyPipeProcessors('canStartEditing', true, {
|
|
94
|
+
event,
|
|
95
|
+
cellParams: params,
|
|
96
|
+
editMode: 'cell'
|
|
97
|
+
});
|
|
98
|
+
if (!canStartEditing) {
|
|
99
|
+
return;
|
|
95
100
|
}
|
|
96
|
-
|
|
97
101
|
if (isPrintableKey(event)) {
|
|
98
102
|
reason = GridCellEditStartReasons.printableKeyDown;
|
|
99
103
|
} else if ((event.ctrlKey || event.metaKey) && event.key === 'v') {
|
|
@@ -143,10 +143,14 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
143
143
|
}
|
|
144
144
|
} else if (params.isEditable) {
|
|
145
145
|
let reason;
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
const canStartEditing = apiRef.current.unstable_applyPipeProcessors('canStartEditing', true, {
|
|
147
|
+
event,
|
|
148
|
+
cellParams: params,
|
|
149
|
+
editMode: 'row'
|
|
150
|
+
});
|
|
151
|
+
if (!canStartEditing) {
|
|
152
|
+
return;
|
|
148
153
|
}
|
|
149
|
-
|
|
150
154
|
if (isPrintableKey(event)) {
|
|
151
155
|
reason = GridRowEditStartReasons.printableKeyDown;
|
|
152
156
|
} else if ((event.ctrlKey || event.metaKey) && event.key === 'v') {
|