@mui/x-data-grid 7.23.5 → 7.24.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 +159 -0
- package/DataGrid/DataGrid.js +4 -5
- package/DataGrid/useDataGridComponent.d.ts +1 -1
- package/DataGrid/useDataGridComponent.js +1 -1
- package/components/GridHeaders.js +2 -2
- package/components/GridRow.d.ts +5 -9
- package/components/GridRow.js +28 -105
- package/components/GridSkeletonLoadingOverlay.js +18 -18
- package/components/cell/GridActionsCellItem.d.ts +3 -3
- package/components/cell/GridCell.d.ts +9 -16
- package/components/cell/GridCell.js +17 -35
- package/components/cell/GridEditDateCell.js +1 -1
- package/components/cell/GridEditInputCell.js +1 -1
- package/components/cell/GridEditSingleSelectCell.js +2 -2
- package/components/columnHeaders/ColumnHeaderMenuIcon.d.ts +1 -1
- package/components/columnHeaders/GridColumnGroupHeader.d.ts +5 -5
- package/components/columnHeaders/GridColumnGroupHeader.js +7 -10
- package/components/columnHeaders/GridColumnHeaderItem.d.ts +5 -5
- package/components/columnHeaders/GridColumnHeaderItem.js +13 -12
- package/components/columnSelection/GridCellCheckboxRenderer.js +4 -3
- package/components/columnSelection/GridHeaderCheckbox.js +6 -2
- package/components/containers/GridRoot.d.ts +2 -2
- package/components/containers/GridRoot.js +14 -6
- package/components/containers/GridRootStyles.js +1 -0
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterInputValue.js +7 -10
- package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +1 -1
- package/components/virtualization/GridVirtualScrollbar.js +11 -12
- package/components/virtualization/GridVirtualScroller.js +4 -4
- package/context/GridContextProvider.d.ts +1 -1
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridPipeProcessing.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
- package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.d.ts +1 -1
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +1 -1
- package/hooks/core/useGridApiInitialization.d.ts +1 -1
- package/hooks/core/useGridApiInitialization.js +2 -2
- package/hooks/core/useGridInitialization.d.ts +1 -1
- package/hooks/core/useGridIsRtl.d.ts +1 -1
- package/hooks/core/useGridLocaleText.d.ts +1 -1
- package/hooks/core/useGridLoggerFactory.d.ts +1 -1
- package/hooks/core/useGridRefs.d.ts +1 -1
- package/hooks/core/useGridStateInitialization.d.ts +1 -1
- package/hooks/features/clipboard/useGridClipboard.d.ts +1 -1
- package/hooks/features/columnGrouping/useGridColumnGrouping.d.ts +1 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +5 -7
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +34 -76
- package/hooks/features/columnMenu/useGridColumnMenu.d.ts +1 -1
- package/hooks/features/columnResize/useGridColumnResize.d.ts +1 -1
- package/hooks/features/columnResize/useGridColumnResize.js +8 -6
- package/hooks/features/columns/gridColumnsUtils.d.ts +3 -3
- package/hooks/features/columns/useGridColumnSpanning.d.ts +1 -1
- package/hooks/features/columns/useGridColumns.d.ts +1 -1
- package/hooks/features/density/useGridDensity.d.ts +1 -1
- package/hooks/features/dimensions/useGridDimensions.d.ts +1 -1
- package/hooks/features/dimensions/useGridDimensions.js +1 -1
- package/hooks/features/editing/useGridCellEditing.d.ts +1 -1
- package/hooks/features/editing/useGridEditing.d.ts +1 -1
- package/hooks/features/editing/useGridRowEditing.d.ts +1 -1
- package/hooks/features/editing/useGridRowEditing.js +1 -1
- package/hooks/features/events/useGridEvents.d.ts +1 -1
- package/hooks/features/export/serializers/csvSerializer.d.ts +1 -1
- package/hooks/features/export/useGridCsvExport.d.ts +1 -1
- package/hooks/features/export/useGridPrintExport.d.ts +1 -1
- package/hooks/features/export/useGridPrintExport.js +1 -1
- package/hooks/features/export/utils.d.ts +1 -1
- package/hooks/features/filter/gridFilterSelector.js +6 -1
- package/hooks/features/filter/gridFilterUtils.d.ts +6 -6
- package/hooks/features/filter/gridFilterUtils.js +3 -3
- package/hooks/features/filter/useGridFilter.d.ts +1 -1
- package/hooks/features/focus/useGridFocus.d.ts +1 -1
- package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +1 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
- package/hooks/features/keyboardNavigation/utils.d.ts +2 -2
- package/hooks/features/listView/useGridListView.d.ts +1 -1
- package/hooks/features/pagination/gridPaginationInterfaces.d.ts +3 -0
- package/hooks/features/pagination/gridPaginationSelector.d.ts +20 -1
- package/hooks/features/pagination/gridPaginationSelector.js +39 -1
- package/hooks/features/pagination/useGridPagination.d.ts +2 -2
- package/hooks/features/pagination/useGridPagination.js +5 -3
- package/hooks/features/pagination/useGridPaginationMeta.d.ts +1 -1
- package/hooks/features/pagination/useGridPaginationModel.d.ts +1 -1
- package/hooks/features/pagination/useGridPaginationModel.js +23 -1
- package/hooks/features/pagination/useGridRowCount.d.ts +1 -1
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.d.ts +1 -1
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
- package/hooks/features/rowSelection/useGridRowSelection.d.ts +1 -1
- package/hooks/features/rowSelection/useGridRowSelectionPreProcessors.d.ts +1 -1
- package/hooks/features/rowSelection/utils.d.ts +2 -2
- package/hooks/features/rows/gridRowSpanningUtils.d.ts +1 -1
- package/hooks/features/rows/gridRowsSelector.js +1 -1
- package/hooks/features/rows/gridRowsUtils.d.ts +3 -3
- package/hooks/features/rows/useGridParamsApi.d.ts +1 -1
- package/hooks/features/rows/useGridRowSpanning.d.ts +1 -1
- package/hooks/features/rows/useGridRows.d.ts +1 -1
- package/hooks/features/rows/useGridRows.js +2 -2
- package/hooks/features/rows/useGridRowsMeta.d.ts +1 -1
- package/hooks/features/rows/useGridRowsPreProcessors.d.ts +1 -1
- package/hooks/features/scroll/useGridScroll.d.ts +1 -1
- package/hooks/features/sorting/gridSortingUtils.d.ts +2 -2
- package/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/hooks/features/sorting/useGridSorting.d.ts +1 -1
- package/hooks/features/statePersistence/useGridStatePersistence.d.ts +1 -1
- package/hooks/features/virtualization/gridFocusedVirtualCellSelector.d.ts +6 -0
- package/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +42 -0
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +5 -4
- package/hooks/features/virtualization/useGridVirtualScroller.js +96 -43
- package/hooks/features/virtualization/useGridVirtualization.d.ts +1 -1
- package/hooks/utils/useGridApiContext.d.ts +1 -1
- package/hooks/utils/useGridApiEventHandler.d.ts +3 -3
- package/hooks/utils/useGridApiEventHandler.js +1 -1
- package/hooks/utils/useGridApiMethod.d.ts +1 -1
- package/hooks/utils/useGridApiRef.d.ts +1 -1
- package/hooks/utils/useGridInitializeState.d.ts +2 -2
- package/hooks/utils/useGridLogger.d.ts +1 -1
- package/hooks/utils/useGridNativeEventListener.d.ts +1 -1
- package/hooks/utils/useGridPrivateApiContext.d.ts +1 -1
- package/hooks/utils/useGridSelector.d.ts +2 -2
- package/hooks/utils/useGridVisibleRows.d.ts +7 -5
- package/hooks/utils/useGridVisibleRows.js +5 -28
- package/index.js +1 -1
- package/internals/constants.d.ts +6 -0
- package/internals/constants.js +8 -1
- package/internals/index.d.ts +1 -0
- package/internals/index.js +1 -0
- package/internals/utils/attachPinnedStyle.d.ts +2 -0
- package/internals/utils/attachPinnedStyle.js +9 -0
- package/internals/utils/getPinnedCellOffset.d.ts +3 -3
- package/internals/utils/getPinnedCellOffset.js +6 -7
- package/internals/utils/index.d.ts +1 -0
- package/internals/utils/index.js +2 -1
- package/locales/urPK.js +9 -10
- package/models/api/gridCoreApi.d.ts +7 -7
- package/models/api/gridDensityApi.d.ts +1 -1
- package/models/colDef/gridColDef.d.ts +8 -8
- package/models/events/gridEventLookup.d.ts +6 -1
- package/models/gridExport.d.ts +1 -1
- package/models/gridFilterOperator.d.ts +1 -1
- package/models/gridStateCommunity.d.ts +4 -0
- package/models/props/DataGridProps.d.ts +1 -1
- package/modern/DataGrid/DataGrid.js +4 -5
- package/modern/DataGrid/useDataGridComponent.js +1 -1
- package/modern/components/GridHeaders.js +2 -2
- package/modern/components/GridRow.js +28 -105
- package/modern/components/GridSkeletonLoadingOverlay.js +18 -18
- package/modern/components/cell/GridCell.js +17 -35
- package/modern/components/cell/GridEditDateCell.js +1 -1
- package/modern/components/cell/GridEditInputCell.js +1 -1
- package/modern/components/cell/GridEditSingleSelectCell.js +2 -2
- package/modern/components/columnHeaders/GridColumnGroupHeader.js +7 -10
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +13 -12
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +4 -3
- package/modern/components/columnSelection/GridHeaderCheckbox.js +6 -2
- package/modern/components/containers/GridRoot.js +14 -6
- package/modern/components/containers/GridRootStyles.js +1 -0
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +7 -10
- package/modern/components/virtualization/GridVirtualScrollbar.js +11 -12
- package/modern/components/virtualization/GridVirtualScroller.js +4 -4
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
- package/modern/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
- package/modern/hooks/core/useGridApiInitialization.js +2 -2
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +34 -76
- package/modern/hooks/features/columnResize/useGridColumnResize.js +8 -6
- package/modern/hooks/features/dimensions/useGridDimensions.js +1 -1
- package/modern/hooks/features/editing/useGridRowEditing.js +1 -1
- package/modern/hooks/features/export/useGridPrintExport.js +1 -1
- package/modern/hooks/features/filter/gridFilterSelector.js +6 -1
- package/modern/hooks/features/filter/gridFilterUtils.js +3 -3
- package/modern/hooks/features/pagination/gridPaginationSelector.js +39 -1
- package/modern/hooks/features/pagination/useGridPagination.js +5 -3
- package/modern/hooks/features/pagination/useGridPaginationModel.js +23 -1
- package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
- package/modern/hooks/features/rows/gridRowsSelector.js +1 -1
- package/modern/hooks/features/rows/useGridRows.js +2 -2
- package/modern/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/modern/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +42 -0
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +96 -43
- package/modern/hooks/utils/useGridApiEventHandler.js +1 -1
- package/modern/hooks/utils/useGridVisibleRows.js +5 -28
- package/modern/index.js +1 -1
- package/modern/internals/constants.js +8 -1
- package/modern/internals/index.js +1 -0
- package/modern/internals/utils/attachPinnedStyle.js +9 -0
- package/modern/internals/utils/getPinnedCellOffset.js +6 -7
- package/modern/internals/utils/index.js +2 -1
- package/modern/locales/urPK.js +9 -10
- package/modern/utils/cellBorderUtils.js +5 -5
- package/modern/utils/domUtils.js +7 -2
- package/modern/utils/rtlFlipSide.js +22 -0
- package/node/DataGrid/DataGrid.js +2 -3
- package/node/DataGrid/useDataGridComponent.js +1 -1
- package/node/components/GridHeaders.js +2 -2
- package/node/components/GridRow.js +27 -104
- package/node/components/GridSkeletonLoadingOverlay.js +17 -17
- package/node/components/cell/GridCell.js +18 -36
- package/node/components/cell/GridEditDateCell.js +1 -1
- package/node/components/cell/GridEditInputCell.js +1 -1
- package/node/components/cell/GridEditSingleSelectCell.js +2 -2
- package/node/components/columnHeaders/GridColumnGroupHeader.js +7 -10
- package/node/components/columnHeaders/GridColumnHeaderItem.js +13 -12
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +3 -2
- package/node/components/columnSelection/GridHeaderCheckbox.js +6 -2
- package/node/components/containers/GridRoot.js +14 -6
- package/node/components/containers/GridRootStyles.js +1 -0
- package/node/components/panel/filterPanel/GridFilterInputValue.js +7 -10
- package/node/components/virtualization/GridVirtualScrollbar.js +11 -12
- package/node/components/virtualization/GridVirtualScroller.js +4 -4
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
- package/node/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
- package/node/hooks/core/useGridApiInitialization.js +2 -2
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +32 -74
- package/node/hooks/features/columnResize/useGridColumnResize.js +8 -6
- package/node/hooks/features/dimensions/useGridDimensions.js +1 -1
- package/node/hooks/features/editing/useGridRowEditing.js +1 -1
- package/node/hooks/features/export/useGridPrintExport.js +1 -1
- package/node/hooks/features/filter/gridFilterSelector.js +6 -1
- package/node/hooks/features/filter/gridFilterUtils.js +3 -3
- package/node/hooks/features/pagination/gridPaginationSelector.js +41 -3
- package/node/hooks/features/pagination/useGridPagination.js +5 -3
- package/node/hooks/features/pagination/useGridPaginationModel.js +23 -1
- package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
- package/node/hooks/features/rows/gridRowsSelector.js +1 -1
- package/node/hooks/features/rows/useGridRows.js +1 -1
- package/node/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/node/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +49 -0
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +96 -43
- package/node/hooks/utils/useGridApiEventHandler.js +1 -1
- package/node/hooks/utils/useGridVisibleRows.js +3 -28
- package/node/index.js +1 -1
- package/node/internals/constants.js +9 -2
- package/node/internals/index.js +12 -0
- package/node/internals/utils/attachPinnedStyle.js +15 -0
- package/node/internals/utils/getPinnedCellOffset.js +6 -7
- package/node/internals/utils/index.js +11 -0
- package/node/locales/urPK.js +9 -10
- package/node/utils/cellBorderUtils.js +5 -5
- package/node/utils/domUtils.js +7 -2
- package/node/utils/rtlFlipSide.js +29 -0
- package/package.json +2 -2
- package/utils/cellBorderUtils.d.ts +3 -3
- package/utils/cellBorderUtils.js +5 -5
- package/utils/createSelector.d.ts +2 -2
- package/utils/domUtils.js +7 -2
- package/utils/getPublicApiRef.d.ts +1 -1
- package/utils/rtlFlipSide.d.ts +2 -0
- package/utils/rtlFlipSide.js +22 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { rtlFlipSide } from "../../utils/rtlFlipSide.js";
|
|
2
|
+
export function attachPinnedStyle(style, isRtl, pinnedPosition, pinnedOffset) {
|
|
3
|
+
const side = rtlFlipSide(pinnedPosition, isRtl);
|
|
4
|
+
if (!side || pinnedOffset === undefined) {
|
|
5
|
+
return style;
|
|
6
|
+
}
|
|
7
|
+
style[side] = pinnedOffset;
|
|
8
|
+
return style;
|
|
9
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
export declare const getPinnedCellOffset: (pinnedPosition:
|
|
1
|
+
import { PinnedColumnPosition } from '../constants';
|
|
2
|
+
import { gridColumnPositionsSelector } from '../../hooks/features/columns';
|
|
3
|
+
export declare const getPinnedCellOffset: (pinnedPosition: PinnedColumnPosition | undefined, computedWidth: number, columnIndex: number, columnPositions: ReturnType<typeof gridColumnPositionsSelector>, columnsTotalWidth: number, scrollbarWidth: number) => number | undefined;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const getPinnedCellOffset = (pinnedPosition, computedWidth, columnIndex, columnPositions,
|
|
3
|
-
const scrollbarWidth = dimensions.hasScrollY ? dimensions.scrollbarSize : 0;
|
|
1
|
+
import { PinnedColumnPosition } from "../constants.js";
|
|
2
|
+
export const getPinnedCellOffset = (pinnedPosition, computedWidth, columnIndex, columnPositions, columnsTotalWidth, scrollbarWidth) => {
|
|
4
3
|
let pinnedOffset;
|
|
5
4
|
switch (pinnedPosition) {
|
|
6
|
-
case
|
|
5
|
+
case PinnedColumnPosition.LEFT:
|
|
7
6
|
pinnedOffset = columnPositions[columnIndex];
|
|
8
7
|
break;
|
|
9
|
-
case
|
|
10
|
-
pinnedOffset =
|
|
8
|
+
case PinnedColumnPosition.RIGHT:
|
|
9
|
+
pinnedOffset = columnsTotalWidth - columnPositions[columnIndex] - computedWidth + scrollbarWidth;
|
|
11
10
|
break;
|
|
12
11
|
default:
|
|
13
|
-
pinnedOffset =
|
|
12
|
+
pinnedOffset = undefined;
|
|
14
13
|
break;
|
|
15
14
|
}
|
|
16
15
|
return pinnedOffset;
|
package/internals/utils/index.js
CHANGED
package/locales/urPK.js
CHANGED
|
@@ -30,12 +30,11 @@ const urPKGrid = {
|
|
|
30
30
|
toolbarExportPrint: 'پرنٹ کریں',
|
|
31
31
|
toolbarExportExcel: 'ایکسل کے طور پر ڈاوٴنلوڈ کریں',
|
|
32
32
|
// Columns management text
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
columnsManagementSearchTitle: 'تلاش',
|
|
34
|
+
columnsManagementNoColumns: 'کوئی کالم نہیں',
|
|
35
|
+
columnsManagementShowHideAllText: 'تمام دکھائیں/چھپائیں',
|
|
36
|
+
columnsManagementReset: 'ریسیٹ',
|
|
37
|
+
columnsManagementDeleteIconLabel: 'کلئیر',
|
|
39
38
|
// Filter panel text
|
|
40
39
|
filterPanelAddFilter: 'نیا فلٹر',
|
|
41
40
|
filterPanelRemoveAll: 'سارے ختم کریں',
|
|
@@ -49,9 +48,9 @@ const urPKGrid = {
|
|
|
49
48
|
filterPanelInputPlaceholder: 'ویلیو کو فلٹر کریں',
|
|
50
49
|
// Filter operators text
|
|
51
50
|
filterOperatorContains: 'شامل ہے',
|
|
52
|
-
|
|
51
|
+
filterOperatorDoesNotContain: 'موجود نہیں ہے',
|
|
53
52
|
filterOperatorEquals: 'برابر ہے',
|
|
54
|
-
|
|
53
|
+
filterOperatorDoesNotEqual: 'برابر نہیں ہے',
|
|
55
54
|
filterOperatorStartsWith: 'شروع ہوتا ہے',
|
|
56
55
|
filterOperatorEndsWith: 'ختم ہوتا ہے',
|
|
57
56
|
filterOperatorIs: 'ہے',
|
|
@@ -71,9 +70,9 @@ const urPKGrid = {
|
|
|
71
70
|
'filterOperator<=': '<=',
|
|
72
71
|
// Header filter operators text
|
|
73
72
|
headerFilterOperatorContains: 'شامل ہے',
|
|
74
|
-
|
|
73
|
+
headerFilterOperatorDoesNotContain: 'موجود نہیں ہے',
|
|
75
74
|
headerFilterOperatorEquals: 'برابر ہے',
|
|
76
|
-
|
|
75
|
+
headerFilterOperatorDoesNotEqual: 'برابر نہیں ہے',
|
|
77
76
|
headerFilterOperatorStartsWith: 'شروع ہوتا ہے',
|
|
78
77
|
headerFilterOperatorEndsWith: 'ختم ہوتا ہے',
|
|
79
78
|
headerFilterOperatorIs: 'ہے',
|
|
@@ -13,7 +13,7 @@ export interface GridCoreApi {
|
|
|
13
13
|
* The React ref of the grid root container div element.
|
|
14
14
|
* @ignore - do not document.
|
|
15
15
|
*/
|
|
16
|
-
rootElementRef: React.RefObject<HTMLDivElement>;
|
|
16
|
+
rootElementRef: React.RefObject<HTMLDivElement | null>;
|
|
17
17
|
/**
|
|
18
18
|
* Registers a handler for an event.
|
|
19
19
|
* @param {string} event The name of the event.
|
|
@@ -59,27 +59,27 @@ export interface GridCorePrivateApi<GridPublicApi extends GridApiCommon, GridPri
|
|
|
59
59
|
/**
|
|
60
60
|
* The React ref of the grid main container div element.
|
|
61
61
|
*/
|
|
62
|
-
mainElementRef: React.
|
|
62
|
+
mainElementRef: React.RefObject<HTMLDivElement | null>;
|
|
63
63
|
/**
|
|
64
64
|
* The React ref of the grid's virtual scroller container element.
|
|
65
65
|
*/
|
|
66
|
-
virtualScrollerRef: React.RefObject<HTMLDivElement>;
|
|
66
|
+
virtualScrollerRef: React.RefObject<HTMLDivElement | null>;
|
|
67
67
|
/**
|
|
68
68
|
* The React ref of the grid's vertical virtual scrollbar container element.
|
|
69
69
|
*/
|
|
70
|
-
virtualScrollbarVerticalRef: React.RefObject<HTMLDivElement>;
|
|
70
|
+
virtualScrollbarVerticalRef: React.RefObject<HTMLDivElement | null>;
|
|
71
71
|
/**
|
|
72
72
|
* The React ref of the grid's horizontal virtual scrollbar container element.
|
|
73
73
|
*/
|
|
74
|
-
virtualScrollbarHorizontalRef: React.RefObject<HTMLDivElement>;
|
|
74
|
+
virtualScrollbarHorizontalRef: React.RefObject<HTMLDivElement | null>;
|
|
75
75
|
/**
|
|
76
76
|
* The React ref of the grid column container virtualized div element.
|
|
77
77
|
*/
|
|
78
|
-
columnHeadersContainerRef: React.RefObject<HTMLDivElement>;
|
|
78
|
+
columnHeadersContainerRef: React.RefObject<HTMLDivElement | null>;
|
|
79
79
|
/**
|
|
80
80
|
* The React ref of the grid header filter row element.
|
|
81
81
|
*/
|
|
82
|
-
headerFiltersElementRef?: React.RefObject<HTMLDivElement>;
|
|
82
|
+
headerFiltersElementRef?: React.RefObject<HTMLDivElement | null>;
|
|
83
83
|
register: <V extends 'public' | 'private', T extends V extends 'public' ? Partial<GridPublicApi> : Partial<Omit<GridPrivateApi, keyof GridPublicApi>>>(visibility: V, methods: T) => void;
|
|
84
84
|
/**
|
|
85
85
|
* Returns the public API.
|
|
@@ -24,13 +24,13 @@ export type ValueOptions = string | number | {
|
|
|
24
24
|
* Value that can be used as a key for grouping rows
|
|
25
25
|
*/
|
|
26
26
|
export type GridKeyValue = string | number | boolean;
|
|
27
|
-
export type GridApplyQuickFilter<R extends GridValidRowModel = GridValidRowModel, V = any> = (value: V, row: R, column: GridColDef, apiRef: React.
|
|
28
|
-
export type GetApplyQuickFilterFn<R extends GridValidRowModel = GridValidRowModel, V = any> = (value: any, colDef: GridStateColDef<R, V>, apiRef: React.
|
|
29
|
-
export type GridValueGetter<R extends GridValidRowModel = GridValidRowModel, V = any, F = V, TValue = never> = (value: TValue, row: R, column: GridColDef<R, V, F>, apiRef: React.
|
|
30
|
-
export type GridValueFormatter<R extends GridValidRowModel = GridValidRowModel, V = any, F = V, TValue = never> = (value: TValue, row: R, column: GridColDef<R, V, F>, apiRef: React.
|
|
31
|
-
export type GridValueSetter<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> = (value: V, row: R, column: GridColDef<R, V, F>, apiRef: React.
|
|
32
|
-
export type GridValueParser<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> = (value: F | undefined, row: R | undefined, column: GridColDef<R, V, F>, apiRef: React.
|
|
33
|
-
export type GridColSpanFn<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> = (value: V, row: R, column: GridColDef<R, V, F>, apiRef: React.
|
|
27
|
+
export type GridApplyQuickFilter<R extends GridValidRowModel = GridValidRowModel, V = any> = (value: V, row: R, column: GridColDef, apiRef: React.RefObject<GridApiCommunity>) => boolean;
|
|
28
|
+
export type GetApplyQuickFilterFn<R extends GridValidRowModel = GridValidRowModel, V = any> = (value: any, colDef: GridStateColDef<R, V>, apiRef: React.RefObject<GridApiCommunity>) => null | GridApplyQuickFilter<R, V>;
|
|
29
|
+
export type GridValueGetter<R extends GridValidRowModel = GridValidRowModel, V = any, F = V, TValue = never> = (value: TValue, row: R, column: GridColDef<R, V, F>, apiRef: React.RefObject<GridApiCommunity>) => V;
|
|
30
|
+
export type GridValueFormatter<R extends GridValidRowModel = GridValidRowModel, V = any, F = V, TValue = never> = (value: TValue, row: R, column: GridColDef<R, V, F>, apiRef: React.RefObject<GridApiCommunity>) => F;
|
|
31
|
+
export type GridValueSetter<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> = (value: V, row: R, column: GridColDef<R, V, F>, apiRef: React.RefObject<GridApiCommunity>) => R;
|
|
32
|
+
export type GridValueParser<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> = (value: F | undefined, row: R | undefined, column: GridColDef<R, V, F>, apiRef: React.RefObject<GridApiCommunity>) => V;
|
|
33
|
+
export type GridColSpanFn<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> = (value: V, row: R, column: GridColDef<R, V, F>, apiRef: React.RefObject<GridApiCommunity>) => number | undefined;
|
|
34
34
|
/**
|
|
35
35
|
* Column Definition base interface.
|
|
36
36
|
*/
|
|
@@ -217,7 +217,7 @@ export interface GridBaseColDef<R extends GridValidRowModel = GridValidRowModel,
|
|
|
217
217
|
* This function can return `null` to skip filtering for this value and column.
|
|
218
218
|
* @param {any} value The value with which we want to filter the column.
|
|
219
219
|
* @param {GridStateColDef} colDef The column from which we want to filter the rows.
|
|
220
|
-
* @param {React.
|
|
220
|
+
* @param {React.RefObject<GridApiCommunity>} apiRef Deprecated: The API of the grid.
|
|
221
221
|
* @returns {null | GridApplyQuickFilter} The function to call to check if a row pass this filter value or not.
|
|
222
222
|
*/
|
|
223
223
|
getApplyQuickFilterFn?: GetApplyQuickFilterFn<R, V>;
|
|
@@ -583,7 +583,12 @@ export interface GridEventLookup extends GridRowEventLookup, GridColumnHeaderEve
|
|
|
583
583
|
* Fired when the content size used by the `GridVirtualScroller` changes.
|
|
584
584
|
* @ignore - do not document.
|
|
585
585
|
*/
|
|
586
|
-
virtualScrollerContentSizeChange: {
|
|
586
|
+
virtualScrollerContentSizeChange: {
|
|
587
|
+
params: {
|
|
588
|
+
columnsTotalWidth: number;
|
|
589
|
+
contentHeight: number;
|
|
590
|
+
};
|
|
591
|
+
};
|
|
587
592
|
/**
|
|
588
593
|
* Fired when the content is scrolled by the mouse wheel.
|
|
589
594
|
* It's attached to the "mousewheel" event.
|
package/models/gridExport.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export interface GridGetRowsToExportParams<Api extends GridApiCommon = GridApiCo
|
|
|
49
49
|
/**
|
|
50
50
|
* The API of the grid.
|
|
51
51
|
*/
|
|
52
|
-
apiRef: React.
|
|
52
|
+
apiRef: React.RefObject<Api>;
|
|
53
53
|
}
|
|
54
54
|
export interface GridCsvGetRowsToExportParams<Api extends GridApiCommon = GridApiCommunity> extends GridGetRowsToExportParams<Api> {
|
|
55
55
|
}
|
|
@@ -3,7 +3,7 @@ import { GridFilterItem } from './gridFilterItem';
|
|
|
3
3
|
import type { GridColDef } from './colDef/gridColDef';
|
|
4
4
|
import type { GridValidRowModel } from './gridRows';
|
|
5
5
|
import type { GridApiCommunity } from './api/gridApiCommunity';
|
|
6
|
-
type ApplyFilterFn<R extends GridValidRowModel = any, V = any, F = V> = (value: V, row: R, column: GridColDef<R, V, F>, apiRef: React.
|
|
6
|
+
type ApplyFilterFn<R extends GridValidRowModel = any, V = any, F = V> = (value: V, row: R, column: GridColDef<R, V, F>, apiRef: React.RefObject<GridApiCommunity>) => boolean;
|
|
7
7
|
export type GetApplyFilterFn<R extends GridValidRowModel = any, V = any, F = V> = (filterItem: GridFilterItem, column: GridColDef<R, V, F>) => null | ApplyFilterFn<R, V, F>;
|
|
8
8
|
/**
|
|
9
9
|
* Filter operator definition interface.
|
|
@@ -386,7 +386,7 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
386
386
|
/**
|
|
387
387
|
* The ref object that allows Data Grid manipulation. Can be instantiated with `useGridApiRef()`.
|
|
388
388
|
*/
|
|
389
|
-
apiRef?: React.
|
|
389
|
+
apiRef?: React.RefObject<GridApiCommunity>;
|
|
390
390
|
/**
|
|
391
391
|
* Forwarded props for the Data Grid root element.
|
|
392
392
|
* @ignore - do not document.
|
|
@@ -4,14 +4,14 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
7
|
-
import {
|
|
7
|
+
import { GridRoot } from "../components/index.js";
|
|
8
8
|
import { useGridAriaAttributes } from "../hooks/utils/useGridAriaAttributes.js";
|
|
9
9
|
import { useGridRowAriaAttributes } from "../hooks/features/rows/useGridRowAriaAttributes.js";
|
|
10
10
|
import { GridContextProvider } from "../context/GridContextProvider.js";
|
|
11
11
|
import { useDataGridComponent } from "./useDataGridComponent.js";
|
|
12
12
|
import { useDataGridProps } from "./useDataGridProps.js";
|
|
13
13
|
import { propValidatorsDataGrid, validateProps } from "../internals/utils/propValidation.js";
|
|
14
|
-
import { jsx as _jsx
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
15
|
const configuration = {
|
|
16
16
|
hooks: {
|
|
17
17
|
useGridAriaAttributes,
|
|
@@ -34,13 +34,12 @@ const DataGridRaw = forwardRef(function DataGrid(inProps, ref) {
|
|
|
34
34
|
privateApiRef: privateApiRef,
|
|
35
35
|
configuration: configuration,
|
|
36
36
|
props: props,
|
|
37
|
-
children: /*#__PURE__*/
|
|
37
|
+
children: /*#__PURE__*/_jsx(GridRoot, _extends({
|
|
38
38
|
className: props.className,
|
|
39
39
|
style: props.style,
|
|
40
40
|
sx: props.sx
|
|
41
41
|
}, props.forwardedProps, props.slotProps?.root, {
|
|
42
|
-
ref: ref
|
|
43
|
-
children: [/*#__PURE__*/_jsx(GridHeader, {}), /*#__PURE__*/_jsx(GridBody, {}), /*#__PURE__*/_jsx(GridFooterPlaceholder, {})]
|
|
42
|
+
ref: ref
|
|
44
43
|
}))
|
|
45
44
|
});
|
|
46
45
|
});
|
|
@@ -44,6 +44,7 @@ export const useDataGridComponent = (inputApiRef, props) => {
|
|
|
44
44
|
useGridInitializeState(dimensionsStateInitializer, apiRef, props);
|
|
45
45
|
useGridInitializeState(rowSelectionStateInitializer, apiRef, props);
|
|
46
46
|
useGridInitializeState(columnsStateInitializer, apiRef, props);
|
|
47
|
+
useGridInitializeState(paginationStateInitializer, apiRef, props);
|
|
47
48
|
useGridInitializeState(rowsStateInitializer, apiRef, props);
|
|
48
49
|
useGridInitializeState(editingStateInitializer, apiRef, props);
|
|
49
50
|
useGridInitializeState(focusStateInitializer, apiRef, props);
|
|
@@ -53,7 +54,6 @@ export const useDataGridComponent = (inputApiRef, props) => {
|
|
|
53
54
|
useGridInitializeState(rowSpanningStateInitializer, apiRef, props);
|
|
54
55
|
useGridInitializeState(densityStateInitializer, apiRef, props);
|
|
55
56
|
useGridInitializeState(columnResizeStateInitializer, apiRef, props);
|
|
56
|
-
useGridInitializeState(paginationStateInitializer, apiRef, props);
|
|
57
57
|
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
58
58
|
useGridInitializeState(columnMenuStateInitializer, apiRef, props);
|
|
59
59
|
useGridInitializeState(columnGroupsStateInitializer, apiRef, props);
|
|
@@ -18,7 +18,7 @@ function GridHeaders() {
|
|
|
18
18
|
const filterColumnLookup = useGridSelector(apiRef, gridFilterActiveItemsLookupSelector);
|
|
19
19
|
const sortColumnLookup = useGridSelector(apiRef, gridSortColumnLookupSelector);
|
|
20
20
|
const columnHeaderTabIndexState = useGridSelector(apiRef, gridTabIndexColumnHeaderSelector);
|
|
21
|
-
const
|
|
21
|
+
const hasNoCellTabIndexState = useGridSelector(apiRef, () => gridTabIndexCellSelector(apiRef) === null);
|
|
22
22
|
const columnGroupHeaderTabIndexState = useGridSelector(apiRef, gridTabIndexColumnGroupHeaderSelector);
|
|
23
23
|
const columnHeaderFocus = useGridSelector(apiRef, gridFocusColumnHeaderSelector);
|
|
24
24
|
const columnGroupHeaderFocus = useGridSelector(apiRef, gridFocusColumnGroupHeaderSelector);
|
|
@@ -26,7 +26,7 @@ function GridHeaders() {
|
|
|
26
26
|
const columnMenuState = useGridSelector(apiRef, gridColumnMenuSelector);
|
|
27
27
|
const columnVisibility = useGridSelector(apiRef, gridColumnVisibilityModelSelector);
|
|
28
28
|
const columnGroupsHeaderStructure = useGridSelector(apiRef, gridColumnGroupsHeaderStructureSelector);
|
|
29
|
-
const hasOtherElementInTabSequence = !(columnGroupHeaderTabIndexState === null && columnHeaderTabIndexState === null &&
|
|
29
|
+
const hasOtherElementInTabSequence = !(columnGroupHeaderTabIndexState === null && columnHeaderTabIndexState === null && hasNoCellTabIndexState);
|
|
30
30
|
const columnsContainerRef = apiRef.current.columnHeadersContainerRef;
|
|
31
31
|
return /*#__PURE__*/_jsx(rootProps.slots.columnHeaders, _extends({
|
|
32
32
|
ref: columnsContainerRef,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["selected", "rowId", "row", "index", "style", "rowHeight", "className", "visibleColumns", "pinnedColumns", "offsetTop", "offsetLeft", "
|
|
3
|
+
const _excluded = ["selected", "rowId", "row", "index", "style", "rowHeight", "className", "visibleColumns", "pinnedColumns", "offsetTop", "offsetLeft", "columnsTotalWidth", "firstColumnIndex", "lastColumnIndex", "focusedColumnIndex", "isFirstVisible", "isLastVisible", "isNotVisible", "showBottomBorder", "scrollbarWidth", "gridHasFiller", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave", "onMouseOut", "onMouseOver"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -11,44 +11,22 @@ import { GridEditModes, GridRowModes, GridCellModes } from "../models/gridEditRo
|
|
|
11
11
|
import { gridClasses } from "../constants/gridClasses.js";
|
|
12
12
|
import { composeGridClasses } from "../utils/composeGridClasses.js";
|
|
13
13
|
import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
14
|
+
import { shouldCellShowLeftBorder, shouldCellShowRightBorder } from "../utils/cellBorderUtils.js";
|
|
14
15
|
import { gridColumnPositionsSelector } from "../hooks/features/columns/gridColumnsSelector.js";
|
|
15
16
|
import { useGridSelector, objectShallowCompare } from "../hooks/utils/useGridSelector.js";
|
|
16
17
|
import { useGridVisibleRows } from "../hooks/utils/useGridVisibleRows.js";
|
|
17
18
|
import { findParentElementFromClassName, isEventTargetInPortal } from "../utils/domUtils.js";
|
|
18
19
|
import { GRID_CHECKBOX_SELECTION_COL_DEF } from "../colDef/gridCheckboxSelectionColDef.js";
|
|
19
20
|
import { GRID_ACTIONS_COLUMN_TYPE } from "../colDef/gridActionsColDef.js";
|
|
20
|
-
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from "../internals/constants.js";
|
|
21
|
+
import { GRID_DETAIL_PANEL_TOGGLE_FIELD, PinnedColumnPosition } from "../internals/constants.js";
|
|
21
22
|
import { gridSortModelSelector } from "../hooks/features/sorting/gridSortingSelector.js";
|
|
22
23
|
import { gridRowMaximumTreeDepthSelector } from "../hooks/features/rows/gridRowsSelector.js";
|
|
23
24
|
import { gridEditRowsStateSelector } from "../hooks/features/editing/gridEditingSelectors.js";
|
|
24
|
-
import { PinnedPosition, gridPinnedColumnPositionLookup } from "./cell/GridCell.js";
|
|
25
25
|
import { GridScrollbarFillerCell as ScrollbarFiller } from "./GridScrollbarFillerCell.js";
|
|
26
26
|
import { getPinnedCellOffset } from "../internals/utils/getPinnedCellOffset.js";
|
|
27
27
|
import { useGridConfiguration } from "../hooks/utils/useGridConfiguration.js";
|
|
28
28
|
import { useGridPrivateApiContext } from "../hooks/utils/useGridPrivateApiContext.js";
|
|
29
|
-
import { gridVirtualizationColumnEnabledSelector } from "../hooks/index.js";
|
|
30
29
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
31
|
-
function EmptyCell({
|
|
32
|
-
width
|
|
33
|
-
}) {
|
|
34
|
-
if (!width) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
return /*#__PURE__*/_jsx("div", {
|
|
38
|
-
role: "presentation",
|
|
39
|
-
className: clsx(gridClasses.cell, gridClasses.cellEmpty),
|
|
40
|
-
style: {
|
|
41
|
-
'--width': `${width}px`
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
process.env.NODE_ENV !== "production" ? EmptyCell.propTypes = {
|
|
46
|
-
// ----------------------------- Warning --------------------------------
|
|
47
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
48
|
-
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
49
|
-
// ----------------------------------------------------------------------
|
|
50
|
-
width: PropTypes.number.isRequired
|
|
51
|
-
} : void 0;
|
|
52
30
|
const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
53
31
|
const {
|
|
54
32
|
selected,
|
|
@@ -61,13 +39,16 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
61
39
|
visibleColumns,
|
|
62
40
|
pinnedColumns,
|
|
63
41
|
offsetLeft,
|
|
64
|
-
|
|
65
|
-
|
|
42
|
+
columnsTotalWidth,
|
|
43
|
+
firstColumnIndex,
|
|
44
|
+
lastColumnIndex,
|
|
66
45
|
focusedColumnIndex,
|
|
67
46
|
isFirstVisible,
|
|
68
47
|
isLastVisible,
|
|
69
48
|
isNotVisible,
|
|
70
49
|
showBottomBorder,
|
|
50
|
+
scrollbarWidth,
|
|
51
|
+
gridHasFiller,
|
|
71
52
|
onClick,
|
|
72
53
|
onDoubleClick,
|
|
73
54
|
onMouseEnter,
|
|
@@ -87,14 +68,11 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
87
68
|
const editRowsState = useGridSelector(apiRef, gridEditRowsStateSelector);
|
|
88
69
|
const handleRef = useForkRef(ref, refProp);
|
|
89
70
|
const rowNode = apiRef.current.getRowNode(rowId);
|
|
90
|
-
const scrollbarWidth = dimensions.hasScrollY ? dimensions.scrollbarSize : 0;
|
|
91
|
-
const gridHasFiller = dimensions.columnsTotalWidth < dimensions.viewportOuterSize.width;
|
|
92
71
|
const editing = apiRef.current.getRowMode(rowId) === GridRowModes.Edit;
|
|
93
72
|
const editable = rootProps.editMode === GridEditModes.Row;
|
|
94
|
-
const hasColumnVirtualization = useGridSelector(apiRef, gridVirtualizationColumnEnabledSelector);
|
|
95
73
|
const hasFocusCell = focusedColumnIndex !== undefined;
|
|
96
|
-
const hasVirtualFocusCellLeft = hasFocusCell && focusedColumnIndex >= pinnedColumns.left.length && focusedColumnIndex <
|
|
97
|
-
const hasVirtualFocusCellRight = hasFocusCell && focusedColumnIndex < visibleColumns.length - pinnedColumns.right.length && focusedColumnIndex >=
|
|
74
|
+
const hasVirtualFocusCellLeft = hasFocusCell && focusedColumnIndex >= pinnedColumns.left.length && focusedColumnIndex < firstColumnIndex;
|
|
75
|
+
const hasVirtualFocusCellRight = hasFocusCell && focusedColumnIndex < visibleColumns.length - pinnedColumns.right.length && focusedColumnIndex >= lastColumnIndex;
|
|
98
76
|
const classes = composeGridClasses(rootProps.classes, {
|
|
99
77
|
root: ['row', selected && 'selected', editable && 'row--editable', editing && 'row--editing', isFirstVisible && 'row--firstVisible', isLastVisible && 'row--lastVisible', showBottomBorder && 'row--borderBottom', rowHeight === 'auto' && 'row--dynamicHeight']
|
|
100
78
|
});
|
|
@@ -210,14 +188,14 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
210
188
|
});
|
|
211
189
|
rowClassNames.push(rootProps.getRowClassName(rowParams));
|
|
212
190
|
}
|
|
213
|
-
const getCell = (column, indexInSection, indexRelativeToAllColumns, sectionLength, pinnedPosition =
|
|
191
|
+
const getCell = (column, indexInSection, indexRelativeToAllColumns, sectionLength, pinnedPosition = PinnedColumnPosition.NONE) => {
|
|
214
192
|
const cellColSpanInfo = apiRef.current.unstable_getCellColSpanInfo(rowId, indexRelativeToAllColumns);
|
|
215
193
|
if (cellColSpanInfo?.spannedByColSpan) {
|
|
216
194
|
return null;
|
|
217
195
|
}
|
|
218
196
|
const width = cellColSpanInfo?.cellProps.width ?? column.computedWidth;
|
|
219
197
|
const colSpan = cellColSpanInfo?.cellProps.colSpan ?? 1;
|
|
220
|
-
const pinnedOffset = getPinnedCellOffset(
|
|
198
|
+
const pinnedOffset = getPinnedCellOffset(pinnedPosition, column.computedWidth, indexRelativeToAllColumns, columnPositions, columnsTotalWidth, scrollbarWidth);
|
|
221
199
|
if (rowNode?.type === 'skeletonRow') {
|
|
222
200
|
return /*#__PURE__*/_jsx(slots.skeletonCell, {
|
|
223
201
|
type: column.type,
|
|
@@ -236,7 +214,9 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
236
214
|
const canReorderColumn = !(disableColumnReorder || column.disableReorder);
|
|
237
215
|
const canReorderRow = rowReordering && !sortModel.length && treeDepth <= 1 && !isEditingRows;
|
|
238
216
|
const disableDragEvents = !(canReorderColumn || isReorderCell && canReorderRow);
|
|
239
|
-
const cellIsNotVisible = pinnedPosition ===
|
|
217
|
+
const cellIsNotVisible = pinnedPosition === PinnedColumnPosition.VIRTUAL;
|
|
218
|
+
const showLeftBorder = shouldCellShowLeftBorder(pinnedPosition, indexInSection);
|
|
219
|
+
const showRightBorder = shouldCellShowRightBorder(pinnedPosition, indexInSection, sectionLength, rootProps.showCellVerticalBorder, gridHasFiller);
|
|
240
220
|
return /*#__PURE__*/_jsx(slots.cell, _extends({
|
|
241
221
|
column: column,
|
|
242
222
|
width: width,
|
|
@@ -249,9 +229,8 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
249
229
|
isNotVisible: cellIsNotVisible,
|
|
250
230
|
pinnedOffset: pinnedOffset,
|
|
251
231
|
pinnedPosition: pinnedPosition,
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
gridHasFiller: gridHasFiller
|
|
232
|
+
showLeftBorder: showLeftBorder,
|
|
233
|
+
showRightBorder: showRightBorder
|
|
255
234
|
}, slotProps?.cell), column.field);
|
|
256
235
|
};
|
|
257
236
|
|
|
@@ -262,25 +241,16 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
262
241
|
}
|
|
263
242
|
const leftCells = pinnedColumns.left.map((column, i) => {
|
|
264
243
|
const indexRelativeToAllColumns = i;
|
|
265
|
-
return getCell(column, i, indexRelativeToAllColumns, pinnedColumns.left.length,
|
|
244
|
+
return getCell(column, i, indexRelativeToAllColumns, pinnedColumns.left.length, PinnedColumnPosition.LEFT);
|
|
266
245
|
});
|
|
267
246
|
const rightCells = pinnedColumns.right.map((column, i) => {
|
|
268
247
|
const indexRelativeToAllColumns = visibleColumns.length - pinnedColumns.right.length + i;
|
|
269
|
-
return getCell(column, i, indexRelativeToAllColumns, pinnedColumns.right.length,
|
|
248
|
+
return getCell(column, i, indexRelativeToAllColumns, pinnedColumns.right.length, PinnedColumnPosition.RIGHT);
|
|
270
249
|
});
|
|
271
250
|
const middleColumnsLength = visibleColumns.length - pinnedColumns.left.length - pinnedColumns.right.length;
|
|
272
251
|
const cells = [];
|
|
273
252
|
if (hasVirtualFocusCellLeft) {
|
|
274
|
-
cells.push(getCell(visibleColumns[focusedColumnIndex], focusedColumnIndex - pinnedColumns.left.length, focusedColumnIndex, middleColumnsLength,
|
|
275
|
-
}
|
|
276
|
-
let firstColumnIndex;
|
|
277
|
-
let lastColumnIndex;
|
|
278
|
-
if (!rootProps.disableVirtualization && !hasColumnVirtualization) {
|
|
279
|
-
firstColumnIndex = 0;
|
|
280
|
-
lastColumnIndex = visibleColumns.length;
|
|
281
|
-
} else {
|
|
282
|
-
firstColumnIndex = renderContext.firstColumnIndex;
|
|
283
|
-
lastColumnIndex = renderContext.lastColumnIndex;
|
|
253
|
+
cells.push(getCell(visibleColumns[focusedColumnIndex], focusedColumnIndex - pinnedColumns.left.length, focusedColumnIndex, middleColumnsLength, PinnedColumnPosition.VIRTUAL));
|
|
284
254
|
}
|
|
285
255
|
for (let i = firstColumnIndex; i < lastColumnIndex; i += 1) {
|
|
286
256
|
const column = visibleColumns[i];
|
|
@@ -291,7 +261,7 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
291
261
|
cells.push(getCell(column, indexInSection, i, middleColumnsLength));
|
|
292
262
|
}
|
|
293
263
|
if (hasVirtualFocusCellRight) {
|
|
294
|
-
cells.push(getCell(visibleColumns[focusedColumnIndex], focusedColumnIndex - pinnedColumns.left.length, focusedColumnIndex, middleColumnsLength,
|
|
264
|
+
cells.push(getCell(visibleColumns[focusedColumnIndex], focusedColumnIndex - pinnedColumns.left.length, focusedColumnIndex, middleColumnsLength, PinnedColumnPosition.VIRTUAL));
|
|
295
265
|
}
|
|
296
266
|
const eventHandlers = row ? {
|
|
297
267
|
onClick: publishClick,
|
|
@@ -301,8 +271,6 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
301
271
|
onMouseOut: publish('rowMouseOut', onMouseOut),
|
|
302
272
|
onMouseOver: publish('rowMouseOver', onMouseOver)
|
|
303
273
|
} : null;
|
|
304
|
-
const expandedWidth = dimensions.viewportOuterSize.width - dimensions.columnsTotalWidth - scrollbarWidth;
|
|
305
|
-
const emptyCellWidth = Math.max(0, expandedWidth);
|
|
306
274
|
return /*#__PURE__*/_jsxs("div", _extends({
|
|
307
275
|
"data-id": rowId,
|
|
308
276
|
"data-rowindex": index,
|
|
@@ -317,11 +285,9 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
317
285
|
style: {
|
|
318
286
|
width: offsetLeft
|
|
319
287
|
}
|
|
320
|
-
}), cells,
|
|
321
|
-
width: emptyCellWidth
|
|
322
|
-
}), rightCells.length > 0 && /*#__PURE__*/_jsx("div", {
|
|
288
|
+
}), cells, /*#__PURE__*/_jsx("div", {
|
|
323
289
|
role: "presentation",
|
|
324
|
-
className: gridClasses.
|
|
290
|
+
className: clsx(gridClasses.cell, gridClasses.cellEmpty)
|
|
325
291
|
}), rightCells, scrollbarWidth !== 0 && /*#__PURE__*/_jsx(ScrollbarFiller, {
|
|
326
292
|
pinnedRight: pinnedColumns.right.length > 0
|
|
327
293
|
})]
|
|
@@ -332,48 +298,14 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
332
298
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
333
299
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
334
300
|
// ----------------------------------------------------------------------
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
columnsTotalWidth: PropTypes.number.isRequired,
|
|
338
|
-
contentSize: PropTypes.shape({
|
|
339
|
-
height: PropTypes.number.isRequired,
|
|
340
|
-
width: PropTypes.number.isRequired
|
|
341
|
-
}).isRequired,
|
|
342
|
-
groupHeaderHeight: PropTypes.number.isRequired,
|
|
343
|
-
hasScrollX: PropTypes.bool.isRequired,
|
|
344
|
-
hasScrollY: PropTypes.bool.isRequired,
|
|
345
|
-
headerFilterHeight: PropTypes.number.isRequired,
|
|
346
|
-
headerHeight: PropTypes.number.isRequired,
|
|
347
|
-
headersTotalHeight: PropTypes.number.isRequired,
|
|
348
|
-
isReady: PropTypes.bool.isRequired,
|
|
349
|
-
leftPinnedWidth: PropTypes.number.isRequired,
|
|
350
|
-
minimumSize: PropTypes.shape({
|
|
351
|
-
height: PropTypes.number.isRequired,
|
|
352
|
-
width: PropTypes.number.isRequired
|
|
353
|
-
}).isRequired,
|
|
354
|
-
rightPinnedWidth: PropTypes.number.isRequired,
|
|
355
|
-
root: PropTypes.shape({
|
|
356
|
-
height: PropTypes.number.isRequired,
|
|
357
|
-
width: PropTypes.number.isRequired
|
|
358
|
-
}).isRequired,
|
|
359
|
-
rowHeight: PropTypes.number.isRequired,
|
|
360
|
-
rowWidth: PropTypes.number.isRequired,
|
|
361
|
-
scrollbarSize: PropTypes.number.isRequired,
|
|
362
|
-
topContainerHeight: PropTypes.number.isRequired,
|
|
363
|
-
viewportInnerSize: PropTypes.shape({
|
|
364
|
-
height: PropTypes.number.isRequired,
|
|
365
|
-
width: PropTypes.number.isRequired
|
|
366
|
-
}).isRequired,
|
|
367
|
-
viewportOuterSize: PropTypes.shape({
|
|
368
|
-
height: PropTypes.number.isRequired,
|
|
369
|
-
width: PropTypes.number.isRequired
|
|
370
|
-
}).isRequired
|
|
371
|
-
}).isRequired,
|
|
301
|
+
columnsTotalWidth: PropTypes.number.isRequired,
|
|
302
|
+
firstColumnIndex: PropTypes.number.isRequired,
|
|
372
303
|
/**
|
|
373
304
|
* Determines which cell has focus.
|
|
374
305
|
* If `null`, no cell in this row has focus.
|
|
375
306
|
*/
|
|
376
307
|
focusedColumnIndex: PropTypes.number,
|
|
308
|
+
gridHasFiller: PropTypes.bool.isRequired,
|
|
377
309
|
/**
|
|
378
310
|
* Index of the row in the whole sorted and filtered dataset.
|
|
379
311
|
* If some rows above have expanded children, this index also take those children into account.
|
|
@@ -382,6 +314,7 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
382
314
|
isFirstVisible: PropTypes.bool.isRequired,
|
|
383
315
|
isLastVisible: PropTypes.bool.isRequired,
|
|
384
316
|
isNotVisible: PropTypes.bool.isRequired,
|
|
317
|
+
lastColumnIndex: PropTypes.number.isRequired,
|
|
385
318
|
offsetLeft: PropTypes.number.isRequired,
|
|
386
319
|
offsetTop: PropTypes.number,
|
|
387
320
|
onClick: PropTypes.func,
|
|
@@ -389,22 +322,12 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
389
322
|
onMouseEnter: PropTypes.func,
|
|
390
323
|
onMouseLeave: PropTypes.func,
|
|
391
324
|
pinnedColumns: PropTypes.object.isRequired,
|
|
392
|
-
renderContext: PropTypes.shape({
|
|
393
|
-
firstColumnIndex: PropTypes.number.isRequired,
|
|
394
|
-
firstRowIndex: PropTypes.number.isRequired,
|
|
395
|
-
lastColumnIndex: PropTypes.number.isRequired,
|
|
396
|
-
lastRowIndex: PropTypes.number.isRequired
|
|
397
|
-
}).isRequired,
|
|
398
325
|
row: PropTypes.object.isRequired,
|
|
399
326
|
rowHeight: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]).isRequired,
|
|
400
327
|
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
328
|
+
scrollbarWidth: PropTypes.number.isRequired,
|
|
401
329
|
selected: PropTypes.bool.isRequired,
|
|
402
330
|
showBottomBorder: PropTypes.bool.isRequired,
|
|
403
|
-
/**
|
|
404
|
-
* Determines which cell should be tabbable by having tabIndex=0.
|
|
405
|
-
* If `null`, no cell in this row is in the tab sequence.
|
|
406
|
-
*/
|
|
407
|
-
tabbableCell: PropTypes.string,
|
|
408
331
|
visibleColumns: PropTypes.arrayOf(PropTypes.object).isRequired
|
|
409
332
|
} : void 0;
|
|
410
333
|
const MemoizedGridRow = fastMemo(GridRow);
|