@mui/x-data-grid-pro 5.8.0 → 5.11.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 +333 -66
- package/DataGridPro/DataGridPro.d.ts +1 -1
- package/DataGridPro/DataGridPro.js +51 -3
- package/DataGridPro/useDataGridProComponent.js +9 -4
- package/DataGridPro/useDataGridProProps.js +20 -5
- package/LICENSE +12 -0
- package/README.md +7 -5
- package/components/DataGridProColumnHeaders.js +2 -8
- package/components/DataGridProVirtualScroller.js +7 -7
- package/components/GridDetailPanelToggleCell.js +13 -2
- package/components/GridGroupingCriteriaCell.js +2 -2
- package/components/GridRowReorderCell.d.ts +5 -0
- package/components/GridRowReorderCell.js +72 -0
- package/components/GridTreeDataGroupingCell.js +15 -4
- package/hooks/features/columnPinning/useGridColumnPinning.js +4 -4
- package/hooks/features/columnReorder/useGridColumnReorder.d.ts +0 -1
- package/hooks/features/columnReorder/useGridColumnReorder.js +8 -9
- package/hooks/features/columnResize/useGridColumnResize.d.ts +0 -1
- package/hooks/features/columnResize/useGridColumnResize.js +31 -20
- package/hooks/features/detailPanel/useGridDetailPanel.js +14 -6
- package/hooks/features/detailPanel/useGridDetailPanelCache.js +2 -2
- package/hooks/features/index.d.ts +1 -1
- package/hooks/features/index.js +1 -1
- package/hooks/features/infiniteLoader/useGridInfiniteLoader.d.ts +0 -1
- package/hooks/features/infiniteLoader/useGridInfiniteLoader.js +4 -5
- package/hooks/features/rowGrouping/createGroupingColDef.d.ts +1 -1
- package/hooks/features/rowGrouping/gridRowGroupingInterfaces.d.ts +1 -1
- package/hooks/features/rowGrouping/gridRowGroupingUtils.js +4 -4
- package/hooks/features/rowGrouping/useGridRowGrouping.d.ts +0 -2
- package/hooks/features/rowGrouping/useGridRowGrouping.js +8 -12
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -2
- package/hooks/features/rowReorder/gridRowReorderColDef.d.ts +2 -0
- package/hooks/features/rowReorder/gridRowReorderColDef.js +18 -0
- package/hooks/features/rowReorder/index.d.ts +1 -0
- package/hooks/features/rowReorder/index.js +1 -0
- package/hooks/features/rowReorder/useGridRowReorder.d.ts +8 -0
- package/hooks/features/rowReorder/useGridRowReorder.js +111 -0
- package/hooks/features/rowReorder/useGridRowReorderPreProcessors.d.ts +4 -0
- package/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +51 -0
- package/hooks/features/treeData/useGridTreeData.d.ts +0 -3
- package/hooks/features/treeData/useGridTreeData.js +2 -8
- package/index.d.ts +6 -1
- package/index.js +7 -3
- package/internals/index.d.ts +19 -0
- package/internals/index.js +17 -0
- package/internals/package.json +6 -0
- package/legacy/DataGridPro/DataGridPro.js +51 -3
- package/legacy/DataGridPro/useDataGridProComponent.js +9 -4
- package/legacy/DataGridPro/useDataGridProProps.js +20 -5
- package/legacy/components/DataGridProColumnHeaders.js +2 -8
- package/legacy/components/DataGridProVirtualScroller.js +7 -7
- package/legacy/components/GridDetailPanelToggleCell.js +13 -2
- package/legacy/components/GridGroupingCriteriaCell.js +2 -2
- package/legacy/components/GridRowReorderCell.js +74 -0
- package/legacy/components/GridTreeDataGroupingCell.js +15 -4
- package/legacy/hooks/features/columnPinning/useGridColumnPinning.js +4 -4
- package/legacy/hooks/features/columnReorder/useGridColumnReorder.js +8 -9
- package/legacy/hooks/features/columnResize/useGridColumnResize.js +31 -20
- package/legacy/hooks/features/detailPanel/useGridDetailPanel.js +14 -6
- package/legacy/hooks/features/detailPanel/useGridDetailPanelCache.js +2 -2
- package/legacy/hooks/features/index.js +1 -1
- package/legacy/hooks/features/infiniteLoader/useGridInfiniteLoader.js +4 -5
- package/legacy/hooks/features/rowGrouping/gridRowGroupingUtils.js +5 -5
- package/legacy/hooks/features/rowGrouping/useGridRowGrouping.js +8 -12
- package/legacy/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -2
- package/legacy/hooks/features/rowReorder/gridRowReorderColDef.js +20 -0
- package/legacy/hooks/features/rowReorder/index.js +1 -0
- package/legacy/hooks/features/rowReorder/useGridRowReorder.js +115 -0
- package/legacy/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +52 -0
- package/legacy/hooks/features/treeData/useGridTreeData.js +2 -8
- package/legacy/index.js +7 -3
- package/legacy/internals/index.js +17 -0
- package/legacy/models/gridRowOrderChangeParams.js +1 -0
- package/legacy/models/index.js +1 -2
- package/legacy/typeOverloads/index.js +1 -0
- package/legacy/utils/domUtils.js +30 -3
- package/legacy/utils/index.js +1 -0
- package/legacy/utils/releaseInfo.js +1 -1
- package/legacy/utils/tree/buildRowTree.js +11 -4
- package/legacy/utils/tree/index.js +1 -0
- package/models/dataGridProProps.d.ts +36 -24
- package/models/gridApiPro.d.ts +3 -2
- package/models/gridRowOrderChangeParams.d.ts +18 -0
- package/models/gridRowOrderChangeParams.js +1 -0
- package/models/gridStatePro.d.ts +4 -3
- package/models/index.d.ts +1 -2
- package/models/index.js +1 -2
- package/modern/DataGridPro/DataGridPro.js +51 -3
- package/modern/DataGridPro/useDataGridProComponent.js +9 -4
- package/modern/DataGridPro/useDataGridProProps.js +16 -3
- package/modern/components/DataGridProColumnHeaders.js +2 -8
- package/modern/components/DataGridProVirtualScroller.js +7 -7
- package/modern/components/GridDetailPanelToggleCell.js +13 -2
- package/modern/components/GridGroupingCriteriaCell.js +2 -2
- package/modern/components/GridRowReorderCell.js +72 -0
- package/modern/components/GridTreeDataGroupingCell.js +15 -4
- package/modern/hooks/features/columnPinning/useGridColumnPinning.js +4 -4
- package/modern/hooks/features/columnReorder/useGridColumnReorder.js +8 -9
- package/modern/hooks/features/columnResize/useGridColumnResize.js +31 -20
- package/modern/hooks/features/detailPanel/useGridDetailPanel.js +14 -6
- package/modern/hooks/features/detailPanel/useGridDetailPanelCache.js +2 -2
- package/modern/hooks/features/index.js +1 -1
- package/modern/hooks/features/infiniteLoader/useGridInfiniteLoader.js +4 -5
- package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +4 -4
- package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +8 -12
- package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -2
- package/modern/hooks/features/rowReorder/gridRowReorderColDef.js +18 -0
- package/modern/hooks/features/rowReorder/index.js +1 -0
- package/modern/hooks/features/rowReorder/useGridRowReorder.js +111 -0
- package/modern/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +51 -0
- package/modern/hooks/features/treeData/useGridTreeData.js +2 -8
- package/modern/index.js +7 -3
- package/modern/internals/index.js +17 -0
- package/modern/models/gridRowOrderChangeParams.js +1 -0
- package/modern/models/index.js +1 -2
- package/modern/typeOverloads/index.js +1 -0
- package/modern/utils/domUtils.js +30 -3
- package/modern/utils/index.js +1 -0
- package/modern/utils/releaseInfo.js +1 -1
- package/modern/utils/tree/buildRowTree.js +9 -2
- package/modern/utils/tree/index.js +1 -0
- package/node/DataGridPro/DataGridPro.js +51 -3
- package/node/DataGridPro/useDataGridProComponent.js +12 -5
- package/node/DataGridPro/useDataGridProProps.js +21 -5
- package/node/components/DataGridProColumnHeaders.js +1 -7
- package/node/components/DataGridProVirtualScroller.js +6 -6
- package/node/components/GridDetailPanelToggleCell.js +13 -2
- package/node/components/GridGroupingCriteriaCell.js +1 -1
- package/node/components/GridRowReorderCell.js +92 -0
- package/node/components/GridTreeDataGroupingCell.js +14 -3
- package/node/hooks/features/columnPinning/useGridColumnPinning.js +3 -3
- package/node/hooks/features/columnReorder/useGridColumnReorder.js +7 -8
- package/node/hooks/features/columnResize/useGridColumnResize.js +30 -19
- package/node/hooks/features/detailPanel/useGridDetailPanel.js +13 -5
- package/node/hooks/features/detailPanel/useGridDetailPanelCache.js +1 -1
- package/node/hooks/features/index.js +4 -4
- package/node/hooks/features/infiniteLoader/useGridInfiniteLoader.js +3 -4
- package/node/hooks/features/rowGrouping/gridRowGroupingUtils.js +4 -4
- package/node/hooks/features/rowGrouping/useGridRowGrouping.js +7 -11
- package/node/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +4 -4
- package/node/hooks/features/rowReorder/gridRowReorderColDef.js +31 -0
- package/node/hooks/features/rowReorder/index.js +18 -0
- package/node/hooks/features/rowReorder/useGridRowReorder.js +126 -0
- package/node/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +70 -0
- package/node/hooks/features/treeData/useGridTreeData.js +1 -6
- package/node/index.js +45 -3
- package/node/internals/index.js +193 -0
- package/node/models/gridRowOrderChangeParams.js +5 -0
- package/node/models/index.js +4 -4
- package/node/typeOverloads/index.js +18 -0
- package/node/utils/domUtils.js +30 -3
- package/node/utils/index.js +18 -0
- package/node/utils/releaseInfo.js +1 -1
- package/node/utils/tree/buildRowTree.js +12 -2
- package/node/utils/tree/index.js +13 -0
- package/package.json +8 -8
- package/typeOverloads/index.d.ts +1 -0
- package/typeOverloads/index.js +1 -0
- package/typeOverloads/modules.d.ts +41 -15
- package/typeOverloads/package.json +6 -0
- package/utils/domUtils.d.ts +2 -1
- package/utils/domUtils.js +30 -3
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/package.json +6 -0
- package/utils/releaseInfo.js +1 -1
- package/utils/tree/buildRowTree.d.ts +1 -0
- package/utils/tree/buildRowTree.js +9 -2
- package/utils/tree/index.d.ts +1 -0
- package/utils/tree/index.js +1 -0
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './typeOverloads
|
|
1
|
+
import './typeOverloads';
|
|
2
2
|
export { LicenseInfo } from '@mui/x-license-pro';
|
|
3
3
|
export * from '@mui/x-data-grid/components';
|
|
4
4
|
export * from '@mui/x-data-grid/constants';
|
|
@@ -8,9 +8,14 @@ export * from '@mui/x-data-grid/models';
|
|
|
8
8
|
export * from '@mui/x-data-grid/context';
|
|
9
9
|
export * from '@mui/x-data-grid/utils';
|
|
10
10
|
export * from '@mui/x-data-grid/colDef';
|
|
11
|
+
export type { GridExportFormat, GridExportExtension, GridToolbarExportProps, } from '@mui/x-data-grid';
|
|
11
12
|
export * from './DataGridPro';
|
|
12
13
|
export * from './hooks';
|
|
13
14
|
export * from './models';
|
|
14
15
|
export * from './components';
|
|
16
|
+
export * from './utils';
|
|
17
|
+
export type { DataGridProProps, GridExperimentalProFeatures } from './models/dataGridProProps';
|
|
15
18
|
export { useGridApiContext, useGridApiRef, useGridRootProps } from './typeOverloads/reexports';
|
|
16
19
|
export type { GridApiRef, GridApi, GridInitialState, GridState } from './typeOverloads/reexports';
|
|
20
|
+
export * from './hooks/features/rowGrouping';
|
|
21
|
+
export * from './models/gridGroupingValueGetterParams';
|
package/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/** @license MUI v5.
|
|
1
|
+
/** @license MUI v5.11.0
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
5
5
|
*/
|
|
6
|
-
import './typeOverloads
|
|
6
|
+
import './typeOverloads';
|
|
7
7
|
export { LicenseInfo } from '@mui/x-license-pro';
|
|
8
8
|
export * from '@mui/x-data-grid/components';
|
|
9
9
|
export * from '@mui/x-data-grid/constants';
|
|
@@ -17,4 +17,8 @@ export * from './DataGridPro';
|
|
|
17
17
|
export * from './hooks';
|
|
18
18
|
export * from './models';
|
|
19
19
|
export * from './components';
|
|
20
|
-
export
|
|
20
|
+
export * from './utils';
|
|
21
|
+
export { useGridApiContext, useGridApiRef, useGridRootProps } from './typeOverloads/reexports';
|
|
22
|
+
// We export them from here to avoid export duplication between pro and premium
|
|
23
|
+
export * from './hooks/features/rowGrouping';
|
|
24
|
+
export * from './models/gridGroupingValueGetterParams';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from '@mui/x-data-grid/internals';
|
|
2
|
+
export { DataGridProVirtualScroller } from '../components/DataGridProVirtualScroller';
|
|
3
|
+
export { DataGridProColumnHeaders } from '../components/DataGridProColumnHeaders';
|
|
4
|
+
export { useGridColumnResize, columnResizeStateInitializer, } from '../hooks/features/columnResize/useGridColumnResize';
|
|
5
|
+
export { useGridColumnPinning, columnPinningStateInitializer, } from '../hooks/features/columnPinning/useGridColumnPinning';
|
|
6
|
+
export { useGridColumnPinningPreProcessors } from '../hooks/features/columnPinning/useGridColumnPinningPreProcessors';
|
|
7
|
+
export { useGridColumnReorder, columnReorderStateInitializer, } from '../hooks/features/columnReorder/useGridColumnReorder';
|
|
8
|
+
export { useGridDetailPanel, detailPanelStateInitializer, } from '../hooks/features/detailPanel/useGridDetailPanel';
|
|
9
|
+
export { useGridDetailPanelCache } from '../hooks/features/detailPanel/useGridDetailPanelCache';
|
|
10
|
+
export { useGridDetailPanelPreProcessors } from '../hooks/features/detailPanel/useGridDetailPanelPreProcessors';
|
|
11
|
+
export { useGridInfiniteLoader } from '../hooks/features/infiniteLoader/useGridInfiniteLoader';
|
|
12
|
+
export { useGridRowReorder } from '../hooks/features/rowReorder/useGridRowReorder';
|
|
13
|
+
export { useGridRowReorderPreProcessors } from '../hooks/features/rowReorder/useGridRowReorderPreProcessors';
|
|
14
|
+
export { useGridTreeData } from '../hooks/features/treeData/useGridTreeData';
|
|
15
|
+
export { useGridTreeDataPreProcessors } from '../hooks/features/treeData/useGridTreeDataPreProcessors';
|
|
16
|
+
export type { GridExperimentalProFeatures, DataGridProPropsWithoutDefaultValue, DataGridProPropsWithDefaultValue, } from '../models/dataGridProProps';
|
|
17
|
+
export { buildRowTree } from '../utils/tree/buildRowTree';
|
|
18
|
+
export type { BuildRowTreeGroupingCriteria } from '../utils/tree/buildRowTree';
|
|
19
|
+
export { sortRowTree } from '../utils/tree/sortRowTree';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from '@mui/x-data-grid/internals';
|
|
2
|
+
export { DataGridProVirtualScroller } from '../components/DataGridProVirtualScroller';
|
|
3
|
+
export { DataGridProColumnHeaders } from '../components/DataGridProColumnHeaders';
|
|
4
|
+
export { useGridColumnResize, columnResizeStateInitializer } from '../hooks/features/columnResize/useGridColumnResize';
|
|
5
|
+
export { useGridColumnPinning, columnPinningStateInitializer } from '../hooks/features/columnPinning/useGridColumnPinning';
|
|
6
|
+
export { useGridColumnPinningPreProcessors } from '../hooks/features/columnPinning/useGridColumnPinningPreProcessors';
|
|
7
|
+
export { useGridColumnReorder, columnReorderStateInitializer } from '../hooks/features/columnReorder/useGridColumnReorder';
|
|
8
|
+
export { useGridDetailPanel, detailPanelStateInitializer } from '../hooks/features/detailPanel/useGridDetailPanel';
|
|
9
|
+
export { useGridDetailPanelCache } from '../hooks/features/detailPanel/useGridDetailPanelCache';
|
|
10
|
+
export { useGridDetailPanelPreProcessors } from '../hooks/features/detailPanel/useGridDetailPanelPreProcessors';
|
|
11
|
+
export { useGridInfiniteLoader } from '../hooks/features/infiniteLoader/useGridInfiniteLoader';
|
|
12
|
+
export { useGridRowReorder } from '../hooks/features/rowReorder/useGridRowReorder';
|
|
13
|
+
export { useGridRowReorderPreProcessors } from '../hooks/features/rowReorder/useGridRowReorderPreProcessors';
|
|
14
|
+
export { useGridTreeData } from '../hooks/features/treeData/useGridTreeData';
|
|
15
|
+
export { useGridTreeDataPreProcessors } from '../hooks/features/treeData/useGridTreeDataPreProcessors';
|
|
16
|
+
export { buildRowTree } from '../utils/tree/buildRowTree';
|
|
17
|
+
export { sortRowTree } from '../utils/tree/sortRowTree';
|
|
@@ -72,6 +72,11 @@ DataGridProRaw.propTypes = {
|
|
|
72
72
|
*/
|
|
73
73
|
autoPageSize: PropTypes.bool,
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Controls the modes of the cells.
|
|
77
|
+
*/
|
|
78
|
+
cellModesModel: PropTypes.object,
|
|
79
|
+
|
|
75
80
|
/**
|
|
76
81
|
* If `true`, the grid get a first column with a checkbox that allows to select rows.
|
|
77
82
|
* @default false
|
|
@@ -225,7 +230,7 @@ DataGridProRaw.propTypes = {
|
|
|
225
230
|
disableMultipleColumnsSorting: PropTypes.bool,
|
|
226
231
|
|
|
227
232
|
/**
|
|
228
|
-
* If `true`, multiple selection using the
|
|
233
|
+
* If `true`, multiple selection using the Ctrl or CMD key is disabled.
|
|
229
234
|
* @default false
|
|
230
235
|
*/
|
|
231
236
|
disableMultipleSelection: PropTypes.bool,
|
|
@@ -298,7 +303,9 @@ DataGridProRaw.propTypes = {
|
|
|
298
303
|
operatorValue: PropTypes.string,
|
|
299
304
|
value: PropTypes.any
|
|
300
305
|
})).isRequired,
|
|
301
|
-
linkOperator: PropTypes.oneOf(['and', 'or'])
|
|
306
|
+
linkOperator: PropTypes.oneOf(['and', 'or']),
|
|
307
|
+
quickFilterLogicOperator: PropTypes.oneOf(['and', 'or']),
|
|
308
|
+
quickFilterValues: PropTypes.array
|
|
302
309
|
}),
|
|
303
310
|
|
|
304
311
|
/**
|
|
@@ -430,6 +437,14 @@ DataGridProRaw.propTypes = {
|
|
|
430
437
|
*/
|
|
431
438
|
isRowSelectable: PropTypes.func,
|
|
432
439
|
|
|
440
|
+
/**
|
|
441
|
+
* If `true`, the selection model will retain selected rows that do not exist.
|
|
442
|
+
* Useful when using server side pagination and row selections need to be retained
|
|
443
|
+
* when changing pages.
|
|
444
|
+
* @default false
|
|
445
|
+
*/
|
|
446
|
+
keepNonExistentRowsSelected: PropTypes.bool,
|
|
447
|
+
|
|
433
448
|
/**
|
|
434
449
|
* If `true`, a loading overlay is displayed.
|
|
435
450
|
*/
|
|
@@ -517,6 +532,13 @@ DataGridProRaw.propTypes = {
|
|
|
517
532
|
*/
|
|
518
533
|
onCellKeyDown: PropTypes.func,
|
|
519
534
|
|
|
535
|
+
/**
|
|
536
|
+
* Callback fired when the `cellModesModel` prop changes.
|
|
537
|
+
* @param {GridCellModesModel} cellModesModel Object containig which cells are in "edit" mode.
|
|
538
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
539
|
+
*/
|
|
540
|
+
onCellModesModelChange: PropTypes.func,
|
|
541
|
+
|
|
520
542
|
/**
|
|
521
543
|
* Callback fired when a click event comes from a column header element.
|
|
522
544
|
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
|
|
@@ -618,7 +640,7 @@ DataGridProRaw.propTypes = {
|
|
|
618
640
|
* @param {GridEditCellPropsParams} params With all properties from [[GridEditCellPropsParams]].
|
|
619
641
|
* @param {MuiEvent<React.SyntheticEvent>} event The event that caused this prop to be called.
|
|
620
642
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
621
|
-
* @deprecated use `preProcessEditCellProps` from the [`GridColDef`](/api/data-grid/grid-col-def/)
|
|
643
|
+
* @deprecated use `preProcessEditCellProps` from the [`GridColDef`](/x/api/data-grid/grid-col-def/)
|
|
622
644
|
*/
|
|
623
645
|
onEditCellPropsChange: PropTypes.func,
|
|
624
646
|
|
|
@@ -740,6 +762,21 @@ DataGridProRaw.propTypes = {
|
|
|
740
762
|
*/
|
|
741
763
|
onRowGroupingModelChange: PropTypes.func,
|
|
742
764
|
|
|
765
|
+
/**
|
|
766
|
+
* Callback fired when the `rowModesModel` prop changes.
|
|
767
|
+
* @param {GridRowModesModel} rowModesModel Object containig which rows are in "edit" mode.
|
|
768
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
769
|
+
*/
|
|
770
|
+
onRowModesModelChange: PropTypes.func,
|
|
771
|
+
|
|
772
|
+
/**
|
|
773
|
+
* Callback fired when a row is being reordered.
|
|
774
|
+
* @param {GridRowOrderChangeParams} params With all properties from [[GridRowOrderChangeParams]].
|
|
775
|
+
* @param {MuiEvent<{}>} event The event object.
|
|
776
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
777
|
+
*/
|
|
778
|
+
onRowOrderChange: PropTypes.func,
|
|
779
|
+
|
|
743
780
|
/**
|
|
744
781
|
* Callback fired when scrolling to the bottom of the grid viewport.
|
|
745
782
|
* @param {GridRowScrollEndParams} params With all properties from [[GridRowScrollEndParams]].
|
|
@@ -846,6 +883,17 @@ DataGridProRaw.propTypes = {
|
|
|
846
883
|
*/
|
|
847
884
|
rowHeight: PropTypes.number,
|
|
848
885
|
|
|
886
|
+
/**
|
|
887
|
+
* Controls the modes of the rows.
|
|
888
|
+
*/
|
|
889
|
+
rowModesModel: PropTypes.object,
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
* If `true`, the reordering of rows is enabled.
|
|
893
|
+
* @default false
|
|
894
|
+
*/
|
|
895
|
+
rowReordering: PropTypes.bool,
|
|
896
|
+
|
|
849
897
|
/**
|
|
850
898
|
* Set of rows of type [[GridRowsProp]].
|
|
851
899
|
*/
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing_new, useGridEditing_old, editingStateInitializer_old, editingStateInitializer_new, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, useGridDimensions, useGridStatePersistence, useGridSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, selectionStateInitializer } from '@mui/x-data-grid/internals';
|
|
1
|
+
import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing_new, useGridEditing_old, editingStateInitializer_old, editingStateInitializer_new, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, useGridDimensions, useGridStatePersistence, useGridSelectionPreProcessors, useGridColumnSpanning, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, selectionStateInitializer } from '@mui/x-data-grid/internals';
|
|
2
2
|
// Pro-only features
|
|
3
3
|
import { useGridInfiniteLoader } from '../hooks/features/infiniteLoader/useGridInfiniteLoader';
|
|
4
4
|
import { useGridColumnReorder, columnReorderStateInitializer } from '../hooks/features/columnReorder/useGridColumnReorder';
|
|
5
5
|
import { useGridColumnResize, columnResizeStateInitializer } from '../hooks/features/columnResize/useGridColumnResize';
|
|
6
6
|
import { useGridTreeData } from '../hooks/features/treeData/useGridTreeData';
|
|
7
7
|
import { useGridTreeDataPreProcessors } from '../hooks/features/treeData/useGridTreeDataPreProcessors';
|
|
8
|
-
import { useGridRowGrouping, rowGroupingStateInitializer } from '../hooks/features/rowGrouping/useGridRowGrouping';
|
|
9
|
-
import { useGridRowGroupingPreProcessors } from '../hooks/features/rowGrouping/useGridRowGroupingPreProcessors';
|
|
10
8
|
import { useGridColumnPinning, columnPinningStateInitializer } from '../hooks/features/columnPinning/useGridColumnPinning';
|
|
11
9
|
import { useGridColumnPinningPreProcessors } from '../hooks/features/columnPinning/useGridColumnPinningPreProcessors';
|
|
12
10
|
import { useGridDetailPanel, detailPanelStateInitializer } from '../hooks/features/detailPanel/useGridDetailPanel';
|
|
13
11
|
import { useGridDetailPanelCache } from '../hooks/features/detailPanel/useGridDetailPanelCache';
|
|
14
12
|
import { useGridDetailPanelPreProcessors } from '../hooks/features/detailPanel/useGridDetailPanelPreProcessors';
|
|
13
|
+
import { useGridRowReorder } from '../hooks/features/rowReorder/useGridRowReorder';
|
|
14
|
+
import { useGridRowReorderPreProcessors } from '../hooks/features/rowReorder/useGridRowReorderPreProcessors';
|
|
15
|
+
import { useGridRowGrouping, rowGroupingStateInitializer } from '../hooks/features/rowGrouping/useGridRowGrouping';
|
|
16
|
+
import { useGridRowGroupingPreProcessors } from '../hooks/features/rowGrouping/useGridRowGroupingPreProcessors';
|
|
15
17
|
export var useDataGridProComponent = function useDataGridProComponent(inputApiRef, props) {
|
|
16
18
|
var _props$experimentalFe, _props$experimentalFe2;
|
|
17
19
|
|
|
@@ -21,6 +23,7 @@ export var useDataGridProComponent = function useDataGridProComponent(inputApiRe
|
|
|
21
23
|
*/
|
|
22
24
|
|
|
23
25
|
useGridSelectionPreProcessors(apiRef, props);
|
|
26
|
+
useGridRowReorderPreProcessors(apiRef, props);
|
|
24
27
|
useGridRowGroupingPreProcessors(apiRef, props);
|
|
25
28
|
useGridTreeDataPreProcessors(apiRef, props);
|
|
26
29
|
useGridDetailPanelPreProcessors(apiRef, props); // The column pinning `hydrateColumns` pre-processor must be after every other `hydrateColumns` pre-processors
|
|
@@ -58,18 +61,20 @@ export var useDataGridProComponent = function useDataGridProComponent(inputApiRe
|
|
|
58
61
|
useGridColumns(apiRef, props);
|
|
59
62
|
useGridRows(apiRef, props);
|
|
60
63
|
useGridParamsApi(apiRef);
|
|
64
|
+
useGridColumnSpanning(apiRef);
|
|
61
65
|
useGridDetailPanelCache(apiRef, props);
|
|
62
66
|
var useGridEditing = (_props$experimentalFe2 = props.experimentalFeatures) != null && _props$experimentalFe2.newEditingApi ? useGridEditing_new : useGridEditing_old;
|
|
63
67
|
useGridEditing(apiRef, props);
|
|
64
68
|
useGridFocus(apiRef, props);
|
|
65
|
-
useGridSorting(apiRef, props);
|
|
66
69
|
useGridPreferencesPanel(apiRef);
|
|
67
70
|
useGridFilter(apiRef, props);
|
|
71
|
+
useGridSorting(apiRef, props);
|
|
68
72
|
useGridDensity(apiRef, props);
|
|
69
73
|
useGridColumnReorder(apiRef, props);
|
|
70
74
|
useGridColumnResize(apiRef, props);
|
|
71
75
|
useGridPagination(apiRef, props);
|
|
72
76
|
useGridRowsMeta(apiRef, props);
|
|
77
|
+
useGridRowReorder(apiRef, props);
|
|
73
78
|
useGridScroll(apiRef, props);
|
|
74
79
|
useGridInfiniteLoader(apiRef, props);
|
|
75
80
|
useGridColumnMenu(apiRef);
|
|
@@ -3,6 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useThemeProps } from '@mui/material/styles';
|
|
5
5
|
import { DATA_GRID_DEFAULT_SLOTS_COMPONENTS, GRID_DEFAULT_LOCALE_TEXT, DATA_GRID_PROPS_DEFAULT_VALUES } from '@mui/x-data-grid';
|
|
6
|
+
import { buildWarning } from '@mui/x-data-grid/internals';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* The default values of `DataGridProPropsWithDefaultValue` to inject in the props of DataGridPro.
|
|
@@ -12,14 +13,16 @@ export var DATA_GRID_PRO_PROPS_DEFAULT_VALUES = _extends({}, DATA_GRID_PROPS_DEF
|
|
|
12
13
|
treeData: false,
|
|
13
14
|
defaultGroupingExpansionDepth: 0,
|
|
14
15
|
disableColumnPinning: false,
|
|
15
|
-
disableRowGrouping: false,
|
|
16
16
|
disableChildrenFiltering: false,
|
|
17
17
|
disableChildrenSorting: false,
|
|
18
|
-
|
|
18
|
+
rowReordering: false,
|
|
19
19
|
getDetailPanelHeight: function getDetailPanelHeight() {
|
|
20
20
|
return 500;
|
|
21
|
-
}
|
|
21
|
+
},
|
|
22
|
+
disableRowGrouping: false,
|
|
23
|
+
rowGroupingColumnMode: 'single'
|
|
22
24
|
});
|
|
25
|
+
var rowGroupingWarning = buildWarning(['MUI: The row grouping has been moved to the new `@mui/x-data-grid-premium` package.', 'The feature is deprecated in `@mui/x-data-grid-pro`, and it will soon be removed from this package.'], 'error');
|
|
23
26
|
export var useDataGridProProps = function useDataGridProProps(inProps) {
|
|
24
27
|
var themedProps = useThemeProps({
|
|
25
28
|
props: inProps,
|
|
@@ -45,11 +48,23 @@ export var useDataGridProProps = function useDataGridProProps(inProps) {
|
|
|
45
48
|
});
|
|
46
49
|
return mergedComponents;
|
|
47
50
|
}, [themedProps.components]);
|
|
51
|
+
|
|
52
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
53
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
54
|
+
React.useEffect(function () {
|
|
55
|
+
var _themedProps$experime;
|
|
56
|
+
|
|
57
|
+
if ((_themedProps$experime = themedProps.experimentalFeatures) != null && _themedProps$experime.rowGrouping) {
|
|
58
|
+
rowGroupingWarning();
|
|
59
|
+
}
|
|
60
|
+
}, [themedProps.experimentalFeatures]);
|
|
61
|
+
}
|
|
62
|
+
|
|
48
63
|
return React.useMemo(function () {
|
|
49
|
-
var _themedProps$
|
|
64
|
+
var _themedProps$experime2;
|
|
50
65
|
|
|
51
66
|
return _extends({}, DATA_GRID_PRO_PROPS_DEFAULT_VALUES, themedProps, {
|
|
52
|
-
disableRowGrouping: themedProps.disableRowGrouping || !((_themedProps$
|
|
67
|
+
disableRowGrouping: themedProps.disableRowGrouping || !((_themedProps$experime2 = themedProps.experimentalFeatures) != null && _themedProps$experime2.rowGrouping),
|
|
53
68
|
localeText: localeText,
|
|
54
69
|
components: components,
|
|
55
70
|
signature: 'DataGridPro'
|
|
@@ -6,7 +6,7 @@ var _excluded = ["style", "className", "innerRef"];
|
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
8
8
|
import { styled, alpha } from '@mui/material/styles';
|
|
9
|
-
import { getDataGridUtilityClass, gridClasses, useGridSelector, useGridApiEventHandler, gridVisibleColumnFieldsSelector,
|
|
9
|
+
import { getDataGridUtilityClass, gridClasses, useGridSelector, useGridApiEventHandler, gridVisibleColumnFieldsSelector, GridColumnHeaderSeparatorSides } from '@mui/x-data-grid';
|
|
10
10
|
import { GridColumnHeaders, GridColumnHeadersInner, useGridColumnHeaders } from '@mui/x-data-grid/internals';
|
|
11
11
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
12
12
|
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
@@ -90,7 +90,7 @@ export var DataGridProColumnHeaders = /*#__PURE__*/React.forwardRef(function Dat
|
|
|
90
90
|
var newScrollbarSize = apiRef.current.windowRef.current.offsetWidth - apiRef.current.windowRef.current.clientWidth;
|
|
91
91
|
setScrollbarSize(newScrollbarSize);
|
|
92
92
|
}, [apiRef]);
|
|
93
|
-
useGridApiEventHandler(apiRef,
|
|
93
|
+
useGridApiEventHandler(apiRef, 'virtualScrollerContentSizeChange', handleContentSizeChange);
|
|
94
94
|
var pinnedColumns = useGridSelector(apiRef, gridPinnedColumnsSelector);
|
|
95
95
|
|
|
96
96
|
var _filterColumns = filterColumns(pinnedColumns, visibleColumnFields),
|
|
@@ -104,7 +104,6 @@ export var DataGridProColumnHeaders = /*#__PURE__*/React.forwardRef(function Dat
|
|
|
104
104
|
}),
|
|
105
105
|
isDragging = _useGridColumnHeaders.isDragging,
|
|
106
106
|
renderContext = _useGridColumnHeaders.renderContext,
|
|
107
|
-
updateInnerPosition = _useGridColumnHeaders.updateInnerPosition,
|
|
108
107
|
getRootProps = _useGridColumnHeaders.getRootProps,
|
|
109
108
|
getInnerProps = _useGridColumnHeaders.getInnerProps,
|
|
110
109
|
getColumns = _useGridColumnHeaders.getColumns;
|
|
@@ -115,11 +114,6 @@ export var DataGridProColumnHeaders = /*#__PURE__*/React.forwardRef(function Dat
|
|
|
115
114
|
classes: rootProps.classes
|
|
116
115
|
};
|
|
117
116
|
var classes = useUtilityClasses(ownerState);
|
|
118
|
-
React.useEffect(function () {
|
|
119
|
-
if (renderContext) {
|
|
120
|
-
updateInnerPosition(renderContext);
|
|
121
|
-
}
|
|
122
|
-
}, [renderContext, updateInnerPosition]);
|
|
123
117
|
var leftRenderContext = renderContext && leftPinnedColumns.length ? _extends({}, renderContext, {
|
|
124
118
|
firstColumnIndex: 0,
|
|
125
119
|
lastColumnIndex: leftPinnedColumns.length
|
|
@@ -8,7 +8,7 @@ import * as React from 'react';
|
|
|
8
8
|
import { styled, alpha } from '@mui/material/styles';
|
|
9
9
|
import Box from '@mui/material/Box';
|
|
10
10
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
11
|
-
import { useGridSelector, getDataGridUtilityClass, gridClasses, gridVisibleColumnFieldsSelector, gridRowsMetaSelector, useGridApiEventHandler
|
|
11
|
+
import { useGridSelector, getDataGridUtilityClass, gridClasses, gridVisibleColumnFieldsSelector, gridRowsMetaSelector, useGridApiEventHandler } from '@mui/x-data-grid';
|
|
12
12
|
import { GridVirtualScroller, GridVirtualScrollerContent, GridVirtualScrollerRenderZone, useGridVirtualScroller } from '@mui/x-data-grid/internals';
|
|
13
13
|
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
14
14
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
@@ -78,7 +78,9 @@ var VirtualScrollerDetailPanels = styled('div', {
|
|
|
78
78
|
overridesResolver: function overridesResolver(props, styles) {
|
|
79
79
|
return styles.detailPanels;
|
|
80
80
|
}
|
|
81
|
-
})({
|
|
81
|
+
})({
|
|
82
|
+
position: 'relative'
|
|
83
|
+
});
|
|
82
84
|
var VirtualScrollerDetailPanel = styled(Box, {
|
|
83
85
|
name: 'MuiDataGrid',
|
|
84
86
|
slot: 'DetailPanel',
|
|
@@ -190,11 +192,9 @@ var DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGrid
|
|
|
190
192
|
updateRenderZonePosition(renderContext);
|
|
191
193
|
}
|
|
192
194
|
}, [renderContext, updateRenderZonePosition]);
|
|
193
|
-
useGridApiEventHandler(apiRef,
|
|
194
|
-
useGridApiEventHandler(apiRef,
|
|
195
|
-
|
|
196
|
-
refreshRenderZonePosition();
|
|
197
|
-
}, [refreshRenderZonePosition]);
|
|
195
|
+
useGridApiEventHandler(apiRef, 'columnWidthChange', refreshRenderZonePosition);
|
|
196
|
+
useGridApiEventHandler(apiRef, 'columnOrderChange', refreshRenderZonePosition);
|
|
197
|
+
useGridApiEventHandler(apiRef, 'rowOrderChange', refreshRenderZonePosition);
|
|
198
198
|
var leftRenderContext = renderContext && leftPinnedColumns.length > 0 ? _extends({}, renderContext, {
|
|
199
199
|
firstColumnIndex: 0,
|
|
200
200
|
lastColumnIndex: leftPinnedColumns.length
|
|
@@ -69,10 +69,21 @@ process.env.NODE_ENV !== "production" ? GridDetailPanelToggleCell.propTypes = {
|
|
|
69
69
|
*/
|
|
70
70
|
field: PropTypes.string.isRequired,
|
|
71
71
|
|
|
72
|
+
/**
|
|
73
|
+
* A ref allowing to set imperative focus.
|
|
74
|
+
* It can be passed to the element that should receive focus.
|
|
75
|
+
* @ignore - do not document.
|
|
76
|
+
*/
|
|
77
|
+
focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
78
|
+
current: PropTypes.shape({
|
|
79
|
+
focus: PropTypes.func.isRequired
|
|
80
|
+
})
|
|
81
|
+
})]),
|
|
82
|
+
|
|
72
83
|
/**
|
|
73
84
|
* The cell value formatted with the column valueFormatter.
|
|
74
85
|
*/
|
|
75
|
-
formattedValue: PropTypes.any
|
|
86
|
+
formattedValue: PropTypes.any,
|
|
76
87
|
|
|
77
88
|
/**
|
|
78
89
|
* Get the cell value of a row and field.
|
|
@@ -116,6 +127,6 @@ process.env.NODE_ENV !== "production" ? GridDetailPanelToggleCell.propTypes = {
|
|
|
116
127
|
/**
|
|
117
128
|
* The cell value, but if the column has valueGetter, use getValue.
|
|
118
129
|
*/
|
|
119
|
-
value: PropTypes.any
|
|
130
|
+
value: PropTypes.any
|
|
120
131
|
} : void 0;
|
|
121
132
|
export { GridDetailPanelToggleCell };
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
3
3
|
import IconButton from '@mui/material/IconButton';
|
|
4
4
|
import Box from '@mui/material/Box';
|
|
5
|
-
import { useGridSelector, gridFilteredDescendantCountLookupSelector, getDataGridUtilityClass
|
|
5
|
+
import { useGridSelector, gridFilteredDescendantCountLookupSelector, getDataGridUtilityClass } from '@mui/x-data-grid';
|
|
6
6
|
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
7
7
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -40,7 +40,7 @@ export var GridGroupingCriteriaCell = function GridGroupingCriteriaCell(props) {
|
|
|
40
40
|
event.stopPropagation();
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
apiRef.current.publishEvent(
|
|
43
|
+
apiRef.current.publishEvent('cellKeyDown', props, event);
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
var handleClick = function handleClick(event) {
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
4
|
+
import { gridRowTreeDepthSelector, gridSortModelSelector, useGridApiContext, useGridSelector, getDataGridUtilityClass, gridEditRowsStateSelector } from '@mui/x-data-grid';
|
|
5
|
+
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
10
|
+
var isDraggable = ownerState.isDraggable,
|
|
11
|
+
classes = ownerState.classes;
|
|
12
|
+
var slots = {
|
|
13
|
+
root: ['rowReorderCell', isDraggable && 'rowReorderCell--draggable'],
|
|
14
|
+
placeholder: ['rowReorderCellPlaceholder']
|
|
15
|
+
};
|
|
16
|
+
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
var GridRowReorderCell = function GridRowReorderCell(params) {
|
|
20
|
+
var apiRef = useGridApiContext();
|
|
21
|
+
var rootProps = useGridRootProps();
|
|
22
|
+
var sortModel = useGridSelector(apiRef, gridSortModelSelector);
|
|
23
|
+
var treeDepth = useGridSelector(apiRef, gridRowTreeDepthSelector);
|
|
24
|
+
var editRowsState = useGridSelector(apiRef, gridEditRowsStateSelector); // eslint-disable-next-line no-underscore-dangle
|
|
25
|
+
|
|
26
|
+
var cellValue = params.row.__reorder__ || params.id; // TODO: remove sortModel and treeDepth checks once row reorder is compatible
|
|
27
|
+
|
|
28
|
+
var isDraggable = !!rootProps.rowReordering && !sortModel.length && treeDepth === 1 && Object.keys(editRowsState).length === 0;
|
|
29
|
+
var ownerState = {
|
|
30
|
+
isDraggable: isDraggable,
|
|
31
|
+
classes: rootProps.classes
|
|
32
|
+
};
|
|
33
|
+
var classes = useUtilityClasses(ownerState);
|
|
34
|
+
var publish = React.useCallback(function (eventName, propHandler) {
|
|
35
|
+
return function (event) {
|
|
36
|
+
// Ignore portal
|
|
37
|
+
// The target is not an element when triggered by a Select inside the cell
|
|
38
|
+
// See https://github.com/mui/material-ui/issues/10534
|
|
39
|
+
if (event.target.nodeType === 1 && !event.currentTarget.contains(event.target)) {
|
|
40
|
+
return;
|
|
41
|
+
} // The row might have been deleted
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
if (!apiRef.current.getRow(params.row.id)) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
apiRef.current.publishEvent(eventName, apiRef.current.getRowParams(params.row.id), event);
|
|
49
|
+
|
|
50
|
+
if (propHandler) {
|
|
51
|
+
propHandler(event);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}, [apiRef, params.row.id]);
|
|
55
|
+
var draggableEventHandlers = {
|
|
56
|
+
onDragStart: publish('rowDragStart'),
|
|
57
|
+
onDragOver: publish('rowDragOver'),
|
|
58
|
+
onDragEnd: publish('rowDragEnd')
|
|
59
|
+
};
|
|
60
|
+
return /*#__PURE__*/_jsxs("div", _extends({
|
|
61
|
+
className: classes.root,
|
|
62
|
+
draggable: isDraggable
|
|
63
|
+
}, draggableEventHandlers, {
|
|
64
|
+
children: [/*#__PURE__*/_jsx(rootProps.components.RowReorderIcon, {}), /*#__PURE__*/_jsx("div", {
|
|
65
|
+
className: classes.placeholder,
|
|
66
|
+
children: cellValue
|
|
67
|
+
})]
|
|
68
|
+
}));
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export { GridRowReorderCell };
|
|
72
|
+
export var renderRowReorderCell = function renderRowReorderCell(params) {
|
|
73
|
+
return /*#__PURE__*/_jsx(GridRowReorderCell, _extends({}, params));
|
|
74
|
+
};
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
4
4
|
import IconButton from '@mui/material/IconButton';
|
|
5
5
|
import Box from '@mui/material/Box';
|
|
6
|
-
import { useGridSelector, gridFilteredDescendantCountLookupSelector, getDataGridUtilityClass
|
|
6
|
+
import { useGridSelector, gridFilteredDescendantCountLookupSelector, getDataGridUtilityClass } from '@mui/x-data-grid';
|
|
7
7
|
import { isNavigationKey } from '@mui/x-data-grid/internals';
|
|
8
8
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
9
9
|
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
@@ -43,7 +43,7 @@ var GridTreeDataGroupingCell = function GridTreeDataGroupingCell(props) {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
if (isNavigationKey(event.key) && !event.shiftKey) {
|
|
46
|
-
apiRef.current.publishEvent(
|
|
46
|
+
apiRef.current.publishEvent('cellNavigationKeyDown', props, event);
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
|
|
@@ -103,10 +103,21 @@ process.env.NODE_ENV !== "production" ? GridTreeDataGroupingCell.propTypes = {
|
|
|
103
103
|
*/
|
|
104
104
|
field: PropTypes.string.isRequired,
|
|
105
105
|
|
|
106
|
+
/**
|
|
107
|
+
* A ref allowing to set imperative focus.
|
|
108
|
+
* It can be passed to the element that should receive focus.
|
|
109
|
+
* @ignore - do not document.
|
|
110
|
+
*/
|
|
111
|
+
focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
112
|
+
current: PropTypes.shape({
|
|
113
|
+
focus: PropTypes.func.isRequired
|
|
114
|
+
})
|
|
115
|
+
})]),
|
|
116
|
+
|
|
106
117
|
/**
|
|
107
118
|
* The cell value formatted with the column valueFormatter.
|
|
108
119
|
*/
|
|
109
|
-
formattedValue: PropTypes.any
|
|
120
|
+
formattedValue: PropTypes.any,
|
|
110
121
|
|
|
111
122
|
/**
|
|
112
123
|
* Get the cell value of a row and field.
|
|
@@ -151,6 +162,6 @@ process.env.NODE_ENV !== "production" ? GridTreeDataGroupingCell.propTypes = {
|
|
|
151
162
|
/**
|
|
152
163
|
* The cell value, but if the column has valueGetter, use getValue.
|
|
153
164
|
*/
|
|
154
|
-
value: PropTypes.any
|
|
165
|
+
value: PropTypes.any
|
|
155
166
|
} : void 0;
|
|
156
167
|
export { GridTreeDataGroupingCell };
|
|
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
4
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import MuiDivider from '@mui/material/Divider';
|
|
7
|
-
import { useGridSelector, gridVisibleColumnDefinitionsSelector, gridColumnsTotalWidthSelector, gridColumnPositionsSelector, gridVisibleColumnFieldsSelector, gridClasses,
|
|
7
|
+
import { useGridSelector, gridVisibleColumnDefinitionsSelector, gridColumnsTotalWidthSelector, gridColumnPositionsSelector, gridVisibleColumnFieldsSelector, gridClasses, useGridApiMethod, useGridApiEventHandler } from '@mui/x-data-grid';
|
|
8
8
|
import { useGridRegisterPipeProcessor } from '@mui/x-data-grid/internals';
|
|
9
9
|
import { GridColumnPinningMenuItems } from '../../../components/GridColumnPinningMenuItems';
|
|
10
10
|
import { GridPinnedPosition } from './gridColumnPinningInterface';
|
|
@@ -94,8 +94,8 @@ export var useGridColumnPinning = function useGridColumnPinning(apiRef, props) {
|
|
|
94
94
|
var handleMouseLeave = React.useCallback(function (params, event) {
|
|
95
95
|
updateHoveredClassOnSiblingRows(event);
|
|
96
96
|
}, [updateHoveredClassOnSiblingRows]);
|
|
97
|
-
useGridApiEventHandler(apiRef,
|
|
98
|
-
useGridApiEventHandler(apiRef,
|
|
97
|
+
useGridApiEventHandler(apiRef, 'rowMouseEnter', handleMouseEnter);
|
|
98
|
+
useGridApiEventHandler(apiRef, 'rowMouseLeave', handleMouseLeave);
|
|
99
99
|
/**
|
|
100
100
|
* PRE-PROCESSING
|
|
101
101
|
*/
|
|
@@ -210,7 +210,7 @@ export var useGridColumnPinning = function useGridColumnPinning(apiRef, props) {
|
|
|
210
210
|
propModel: props.pinnedColumns,
|
|
211
211
|
propOnChange: props.onPinnedColumnsChange,
|
|
212
212
|
stateSelector: gridPinnedColumnsSelector,
|
|
213
|
-
changeEvent:
|
|
213
|
+
changeEvent: 'pinnedColumnsChange'
|
|
214
214
|
});
|
|
215
215
|
var checkIfEnabled = React.useCallback(function (methodName) {
|
|
216
216
|
if (props.disableColumnPinning) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
4
|
-
import { useGridApiEventHandler, getDataGridUtilityClass,
|
|
4
|
+
import { useGridApiEventHandler, getDataGridUtilityClass, useGridLogger } from '@mui/x-data-grid';
|
|
5
5
|
import { gridColumnReorderDragColSelector } from './columnReorderSelector';
|
|
6
6
|
var CURSOR_MOVE_DIRECTION_LEFT = 'left';
|
|
7
7
|
var CURSOR_MOVE_DIRECTION_RIGHT = 'right';
|
|
@@ -30,7 +30,6 @@ export var columnReorderStateInitializer = function columnReorderStateInitialize
|
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
|
-
* Only available in DataGridPro
|
|
34
33
|
* @requires useGridColumns (method)
|
|
35
34
|
*/
|
|
36
35
|
|
|
@@ -52,7 +51,7 @@ export var useGridColumnReorder = function useGridColumnReorder(apiRef, props) {
|
|
|
52
51
|
clearTimeout(removeDnDStylesTimeout.current);
|
|
53
52
|
};
|
|
54
53
|
}, []);
|
|
55
|
-
var
|
|
54
|
+
var handleDragStart = React.useCallback(function (params, event) {
|
|
56
55
|
if (props.disableColumnReorder || params.colDef.disableReorder) {
|
|
57
56
|
return;
|
|
58
57
|
}
|
|
@@ -162,10 +161,10 @@ export var useGridColumnReorder = function useGridColumnReorder(apiRef, props) {
|
|
|
162
161
|
});
|
|
163
162
|
apiRef.current.forceUpdate();
|
|
164
163
|
}, [props.disableColumnReorder, logger, apiRef]);
|
|
165
|
-
useGridApiEventHandler(apiRef,
|
|
166
|
-
useGridApiEventHandler(apiRef,
|
|
167
|
-
useGridApiEventHandler(apiRef,
|
|
168
|
-
useGridApiEventHandler(apiRef,
|
|
169
|
-
useGridApiEventHandler(apiRef,
|
|
170
|
-
useGridApiEventHandler(apiRef,
|
|
164
|
+
useGridApiEventHandler(apiRef, 'columnHeaderDragStart', handleDragStart);
|
|
165
|
+
useGridApiEventHandler(apiRef, 'columnHeaderDragEnter', handleDragEnter);
|
|
166
|
+
useGridApiEventHandler(apiRef, 'columnHeaderDragOver', handleDragOver);
|
|
167
|
+
useGridApiEventHandler(apiRef, 'columnHeaderDragEnd', handleDragEnd);
|
|
168
|
+
useGridApiEventHandler(apiRef, 'cellDragEnter', handleDragEnter);
|
|
169
|
+
useGridApiEventHandler(apiRef, 'cellDragOver', handleDragOver);
|
|
171
170
|
};
|