@mui/x-data-grid 8.0.0-alpha.7 → 8.0.0-alpha.8
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 +115 -0
- package/DataGrid/DataGrid.js +4 -5
- package/DataGrid/useDataGridComponent.js +1 -1
- package/components/GridHeaders.js +2 -2
- package/components/GridRow.d.ts +5 -9
- package/components/GridRow.js +26 -78
- package/components/GridSkeletonLoadingOverlay.js +18 -18
- package/components/cell/GridCell.d.ts +9 -16
- package/components/cell/GridCell.js +17 -35
- 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 +2 -2
- package/components/containers/GridRoot.d.ts +2 -2
- package/components/containers/GridRoot.js +14 -6
- package/components/containers/GridRootStyles.js +7 -0
- package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +1 -0
- package/components/panel/filterPanel/GridFilterInputBoolean.js +12 -16
- package/components/panel/filterPanel/GridFilterInputDate.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterInputDate.js +32 -29
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +1 -0
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +13 -17
- package/components/panel/filterPanel/GridFilterInputValue.d.ts +1 -0
- package/components/panel/filterPanel/GridFilterInputValue.js +34 -28
- package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +1 -1
- package/components/virtualization/GridVirtualScrollbar.js +11 -12
- package/components/virtualization/GridVirtualScroller.js +4 -4
- package/constants/gridClasses.d.ts +12 -0
- package/constants/gridClasses.js +1 -1
- package/constants/localeTextConstants.js +1 -0
- package/context/GridContextProvider.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/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/editing/useGridCellEditing.d.ts +1 -1
- package/hooks/features/editing/useGridCellEditing.js +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/utils.d.ts +1 -1
- package/hooks/features/filter/gridFilterSelector.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/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 +21 -2
- 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/rowSelection/useGridRowSelection.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/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 +2 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +91 -42
- 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/useGridNativeEventListener.d.ts +1 -1
- package/hooks/utils/useGridPrivateApiContext.d.ts +1 -1
- package/hooks/utils/useGridSelector.d.ts +1 -1
- 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/arSD.js +2 -0
- package/locales/beBY.js +1 -0
- package/locales/bgBG.js +2 -0
- package/locales/csCZ.js +2 -0
- package/locales/daDK.js +2 -0
- package/locales/deDE.js +2 -0
- package/locales/elGR.js +2 -0
- package/locales/esES.js +2 -0
- package/locales/faIR.js +2 -0
- package/locales/fiFI.js +2 -0
- package/locales/frFR.js +2 -0
- package/locales/heIL.js +2 -0
- package/locales/hrHR.js +2 -0
- package/locales/huHU.js +2 -0
- package/locales/isIS.js +2 -0
- package/locales/itIT.js +2 -0
- package/locales/jaJP.js +2 -0
- package/locales/koKR.js +2 -0
- package/locales/nbNO.js +2 -0
- package/locales/nlNL.js +2 -0
- package/locales/nnNO.js +2 -0
- package/locales/plPL.js +2 -0
- package/locales/ptBR.js +2 -0
- package/locales/ptPT.js +2 -0
- package/locales/roRO.js +2 -0
- package/locales/ruRU.js +2 -0
- package/locales/skSK.js +2 -0
- package/locales/svSE.js +2 -0
- package/locales/trTR.js +2 -0
- package/locales/ukUA.js +2 -0
- package/locales/urPK.js +2 -0
- package/locales/viVN.js +2 -0
- package/locales/zhCN.js +2 -0
- package/locales/zhHK.js +2 -0
- package/locales/zhTW.js +2 -0
- package/material/index.js +2 -1
- package/models/api/gridLocaleTextApi.d.ts +1 -0
- 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/gridIconSlotsComponent.d.ts +5 -0
- package/models/gridStateCommunity.d.ts +4 -0
- 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 +26 -78
- package/modern/components/GridSkeletonLoadingOverlay.js +18 -18
- package/modern/components/cell/GridCell.js +17 -35
- package/modern/components/columnHeaders/GridColumnGroupHeader.js +7 -10
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +13 -12
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
- package/modern/components/containers/GridRoot.js +14 -6
- package/modern/components/containers/GridRootStyles.js +7 -0
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +12 -16
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +32 -29
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +13 -17
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +34 -28
- package/modern/components/virtualization/GridVirtualScrollbar.js +11 -12
- package/modern/components/virtualization/GridVirtualScroller.js +4 -4
- package/modern/constants/gridClasses.js +1 -1
- package/modern/constants/localeTextConstants.js +1 -0
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +34 -76
- package/modern/hooks/features/editing/useGridCellEditing.js +1 -1
- package/modern/hooks/features/editing/useGridRowEditing.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/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 +91 -42
- 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/arSD.js +2 -0
- package/modern/locales/beBY.js +1 -0
- package/modern/locales/bgBG.js +2 -0
- package/modern/locales/csCZ.js +2 -0
- package/modern/locales/daDK.js +2 -0
- package/modern/locales/deDE.js +2 -0
- package/modern/locales/elGR.js +2 -0
- package/modern/locales/esES.js +2 -0
- package/modern/locales/faIR.js +2 -0
- package/modern/locales/fiFI.js +2 -0
- package/modern/locales/frFR.js +2 -0
- package/modern/locales/heIL.js +2 -0
- package/modern/locales/hrHR.js +2 -0
- package/modern/locales/huHU.js +2 -0
- package/modern/locales/isIS.js +2 -0
- package/modern/locales/itIT.js +2 -0
- package/modern/locales/jaJP.js +2 -0
- package/modern/locales/koKR.js +2 -0
- package/modern/locales/nbNO.js +2 -0
- package/modern/locales/nlNL.js +2 -0
- package/modern/locales/nnNO.js +2 -0
- package/modern/locales/plPL.js +2 -0
- package/modern/locales/ptBR.js +2 -0
- package/modern/locales/ptPT.js +2 -0
- package/modern/locales/roRO.js +2 -0
- package/modern/locales/ruRU.js +2 -0
- package/modern/locales/skSK.js +2 -0
- package/modern/locales/svSE.js +2 -0
- package/modern/locales/trTR.js +2 -0
- package/modern/locales/ukUA.js +2 -0
- package/modern/locales/urPK.js +2 -0
- package/modern/locales/viVN.js +2 -0
- package/modern/locales/zhCN.js +2 -0
- package/modern/locales/zhHK.js +2 -0
- package/modern/locales/zhTW.js +2 -0
- package/modern/material/index.js +2 -1
- 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 +25 -77
- package/node/components/GridSkeletonLoadingOverlay.js +17 -17
- package/node/components/cell/GridCell.js +18 -36
- package/node/components/columnHeaders/GridColumnGroupHeader.js +7 -10
- package/node/components/columnHeaders/GridColumnHeaderItem.js +13 -12
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
- package/node/components/containers/GridRoot.js +14 -6
- package/node/components/containers/GridRootStyles.js +7 -0
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +12 -16
- package/node/components/panel/filterPanel/GridFilterInputDate.js +31 -28
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +13 -17
- package/node/components/panel/filterPanel/GridFilterInputValue.js +33 -27
- package/node/components/virtualization/GridVirtualScrollbar.js +11 -12
- package/node/components/virtualization/GridVirtualScroller.js +4 -4
- package/node/constants/gridClasses.js +1 -1
- package/node/constants/localeTextConstants.js +1 -0
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +32 -74
- package/node/hooks/features/editing/useGridCellEditing.js +1 -1
- package/node/hooks/features/editing/useGridRowEditing.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/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 +91 -42
- 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/arSD.js +2 -0
- package/node/locales/beBY.js +1 -0
- package/node/locales/bgBG.js +2 -0
- package/node/locales/csCZ.js +2 -0
- package/node/locales/daDK.js +2 -0
- package/node/locales/deDE.js +2 -0
- package/node/locales/elGR.js +2 -0
- package/node/locales/esES.js +2 -0
- package/node/locales/faIR.js +2 -0
- package/node/locales/fiFI.js +2 -0
- package/node/locales/frFR.js +2 -0
- package/node/locales/heIL.js +2 -0
- package/node/locales/hrHR.js +2 -0
- package/node/locales/huHU.js +2 -0
- package/node/locales/isIS.js +2 -0
- package/node/locales/itIT.js +2 -0
- package/node/locales/jaJP.js +2 -0
- package/node/locales/koKR.js +2 -0
- package/node/locales/nbNO.js +2 -0
- package/node/locales/nlNL.js +2 -0
- package/node/locales/nnNO.js +2 -0
- package/node/locales/plPL.js +2 -0
- package/node/locales/ptBR.js +2 -0
- package/node/locales/ptPT.js +2 -0
- package/node/locales/roRO.js +2 -0
- package/node/locales/ruRU.js +2 -0
- package/node/locales/skSK.js +2 -0
- package/node/locales/svSE.js +2 -0
- package/node/locales/trTR.js +2 -0
- package/node/locales/ukUA.js +2 -0
- package/node/locales/urPK.js +2 -0
- package/node/locales/viVN.js +2 -0
- package/node/locales/zhCN.js +2 -0
- package/node/locales/zhHK.js +2 -0
- package/node/locales/zhTW.js +2 -0
- package/node/material/index.js +2 -1
- 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 +1 -1
- 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
package/modern/locales/trTR.js
CHANGED
|
@@ -100,6 +100,8 @@ const trTRGrid = {
|
|
|
100
100
|
'headerFilterOperator>=': 'Büyük veya eşit',
|
|
101
101
|
'headerFilterOperator<': 'Küçüktür',
|
|
102
102
|
'headerFilterOperator<=': 'Küçük veya eşit',
|
|
103
|
+
// headerFilterClear: 'Clear filter',
|
|
104
|
+
|
|
103
105
|
// Filter values text
|
|
104
106
|
filterValueAny: 'herhangi',
|
|
105
107
|
filterValueTrue: 'doğru',
|
package/modern/locales/ukUA.js
CHANGED
|
@@ -117,6 +117,8 @@ const ukUAGrid = {
|
|
|
117
117
|
'headerFilterOperator>=': 'Більше або дорівнює',
|
|
118
118
|
'headerFilterOperator<': 'Менше ніж',
|
|
119
119
|
'headerFilterOperator<=': 'Менше або дорівнює',
|
|
120
|
+
// headerFilterClear: 'Clear filter',
|
|
121
|
+
|
|
120
122
|
// Filter values text
|
|
121
123
|
filterValueAny: 'будь-який',
|
|
122
124
|
filterValueTrue: 'так',
|
package/modern/locales/urPK.js
CHANGED
|
@@ -102,6 +102,8 @@ const urPKGrid = {
|
|
|
102
102
|
'headerFilterOperator>=': 'ذیادہ یا برابر ہے',
|
|
103
103
|
'headerFilterOperator<': 'کم ہے',
|
|
104
104
|
'headerFilterOperator<=': 'کم یا برابر ہے',
|
|
105
|
+
// headerFilterClear: 'Clear filter',
|
|
106
|
+
|
|
105
107
|
// Filter values text
|
|
106
108
|
filterValueAny: 'کوئی بھی',
|
|
107
109
|
filterValueTrue: 'صحیح',
|
package/modern/locales/viVN.js
CHANGED
|
@@ -102,6 +102,8 @@ const viVNGrid = {
|
|
|
102
102
|
'headerFilterOperator>=': 'Lớn hơn hoặc bằng',
|
|
103
103
|
'headerFilterOperator<': 'Nhỏ hơn',
|
|
104
104
|
'headerFilterOperator<=': 'Nhỏ hơn hoặc bằng',
|
|
105
|
+
// headerFilterClear: 'Clear filter',
|
|
106
|
+
|
|
105
107
|
// Filter values text
|
|
106
108
|
filterValueAny: 'bất kỳ giá trị nào',
|
|
107
109
|
filterValueTrue: 'Có',
|
package/modern/locales/zhCN.js
CHANGED
|
@@ -100,6 +100,8 @@ const zhCNGrid = {
|
|
|
100
100
|
'headerFilterOperator>=': '大于或等于',
|
|
101
101
|
'headerFilterOperator<': '小于',
|
|
102
102
|
'headerFilterOperator<=': '小于或等于',
|
|
103
|
+
// headerFilterClear: 'Clear filter',
|
|
104
|
+
|
|
103
105
|
// Filter values text
|
|
104
106
|
filterValueAny: '任何',
|
|
105
107
|
filterValueTrue: '真',
|
package/modern/locales/zhHK.js
CHANGED
|
@@ -102,6 +102,8 @@ const zhHKGrid = {
|
|
|
102
102
|
'headerFilterOperator>=': '大於或等於',
|
|
103
103
|
'headerFilterOperator<': '少於',
|
|
104
104
|
'headerFilterOperator<=': '小於或等於',
|
|
105
|
+
// headerFilterClear: 'Clear filter',
|
|
106
|
+
|
|
105
107
|
// Filter values text
|
|
106
108
|
filterValueAny: '任何',
|
|
107
109
|
filterValueTrue: '真的',
|
package/modern/locales/zhTW.js
CHANGED
|
@@ -102,6 +102,8 @@ const zhTWGrid = {
|
|
|
102
102
|
'headerFilterOperator>=': '大於或等於',
|
|
103
103
|
'headerFilterOperator<': '小於',
|
|
104
104
|
'headerFilterOperator<=': '小於或等於',
|
|
105
|
+
// headerFilterClear: 'Clear filter',
|
|
106
|
+
|
|
105
107
|
// Filter values text
|
|
106
108
|
filterValueAny: '任何值',
|
|
107
109
|
filterValueTrue: '真',
|
package/modern/material/index.js
CHANGED
|
@@ -61,7 +61,8 @@ const iconSlots = {
|
|
|
61
61
|
loadIcon: GridLoadIcon,
|
|
62
62
|
filterPanelAddIcon: GridAddIcon,
|
|
63
63
|
filterPanelRemoveAllIcon: GridDeleteForeverIcon,
|
|
64
|
-
columnReorderIcon: GridDragIcon
|
|
64
|
+
columnReorderIcon: GridDragIcon,
|
|
65
|
+
menuItemCheckIcon: GridCheckIcon
|
|
65
66
|
};
|
|
66
67
|
const baseSlots = {
|
|
67
68
|
baseBadge: MUIBadge,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PinnedColumnPosition } from "../internals/constants.js";
|
|
2
2
|
export const shouldCellShowRightBorder = (pinnedPosition, indexInSection, sectionLength, showCellVerticalBorderRootProp, gridHasFiller) => {
|
|
3
3
|
const isSectionLastCell = indexInSection === sectionLength - 1;
|
|
4
|
-
if (pinnedPosition ===
|
|
4
|
+
if (pinnedPosition === PinnedColumnPosition.LEFT && isSectionLastCell) {
|
|
5
5
|
return true;
|
|
6
6
|
}
|
|
7
7
|
if (showCellVerticalBorderRootProp) {
|
|
8
|
-
if (pinnedPosition ===
|
|
8
|
+
if (pinnedPosition === PinnedColumnPosition.LEFT) {
|
|
9
9
|
return true;
|
|
10
10
|
}
|
|
11
|
-
if (pinnedPosition ===
|
|
11
|
+
if (pinnedPosition === PinnedColumnPosition.RIGHT) {
|
|
12
12
|
return !isSectionLastCell;
|
|
13
13
|
}
|
|
14
14
|
// pinnedPosition === undefined, middle section
|
|
@@ -17,5 +17,5 @@ export const shouldCellShowRightBorder = (pinnedPosition, indexInSection, sectio
|
|
|
17
17
|
return false;
|
|
18
18
|
};
|
|
19
19
|
export const shouldCellShowLeftBorder = (pinnedPosition, indexInSection) => {
|
|
20
|
-
return pinnedPosition ===
|
|
20
|
+
return pinnedPosition === PinnedColumnPosition.RIGHT && indexInSection === 0;
|
|
21
21
|
};
|
package/modern/utils/domUtils.js
CHANGED
|
@@ -153,7 +153,7 @@ const findPinnedHeaders = ({
|
|
|
153
153
|
const elements = [];
|
|
154
154
|
api.columnHeadersContainerRef.current.querySelectorAll(`.${gridClasses[position === 'left' ? 'columnHeader--pinnedLeft' : 'columnHeader--pinnedRight']}`).forEach(element => {
|
|
155
155
|
const currentColIndex = parseCellColIndex(element);
|
|
156
|
-
if (currentColIndex !== null && filterFn(currentColIndex)) {
|
|
156
|
+
if (currentColIndex !== null && filterFn(currentColIndex, element)) {
|
|
157
157
|
elements.push(element);
|
|
158
158
|
}
|
|
159
159
|
});
|
|
@@ -174,7 +174,12 @@ export function findRightPinnedHeadersBeforeCol(api, col, isRtl) {
|
|
|
174
174
|
api,
|
|
175
175
|
position: isRtl ? 'left' : 'right',
|
|
176
176
|
colIndex,
|
|
177
|
-
filterFn: index =>
|
|
177
|
+
filterFn: (index, element) => {
|
|
178
|
+
if (element.classList.contains(gridClasses['columnHeader--last'])) {
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
return isRtl ? index > colIndex : index < colIndex;
|
|
182
|
+
}
|
|
178
183
|
});
|
|
179
184
|
}
|
|
180
185
|
export function findGridHeader(api, field) {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { PinnedColumnPosition } from "../internals/constants.js";
|
|
2
|
+
export const rtlFlipSide = (position, isRtl) => {
|
|
3
|
+
if (!position) {
|
|
4
|
+
return undefined;
|
|
5
|
+
}
|
|
6
|
+
if (!isRtl) {
|
|
7
|
+
if (position === PinnedColumnPosition.LEFT) {
|
|
8
|
+
return 'left';
|
|
9
|
+
}
|
|
10
|
+
if (position === PinnedColumnPosition.RIGHT) {
|
|
11
|
+
return 'right';
|
|
12
|
+
}
|
|
13
|
+
} else {
|
|
14
|
+
if (position === PinnedColumnPosition.LEFT) {
|
|
15
|
+
return 'right';
|
|
16
|
+
}
|
|
17
|
+
if (position === PinnedColumnPosition.RIGHT) {
|
|
18
|
+
return 'left';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
};
|
|
@@ -41,13 +41,12 @@ const DataGridRaw = (0, _forwardRef.forwardRef)(function DataGrid(inProps, ref)
|
|
|
41
41
|
privateApiRef: privateApiRef,
|
|
42
42
|
configuration: configuration,
|
|
43
43
|
props: props,
|
|
44
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
44
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.GridRoot, (0, _extends2.default)({
|
|
45
45
|
className: props.className,
|
|
46
46
|
style: props.style,
|
|
47
47
|
sx: props.sx
|
|
48
48
|
}, props.slotProps?.root, {
|
|
49
|
-
ref: ref
|
|
50
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.GridHeader, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.GridBody, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.GridFooterPlaceholder, {})]
|
|
49
|
+
ref: ref
|
|
51
50
|
}))
|
|
52
51
|
});
|
|
53
52
|
});
|
|
@@ -50,6 +50,7 @@ const useDataGridComponent = (inputApiRef, props) => {
|
|
|
50
50
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridDimensions.dimensionsStateInitializer, apiRef, props);
|
|
51
51
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridRowSelection.rowSelectionStateInitializer, apiRef, props);
|
|
52
52
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridColumns.columnsStateInitializer, apiRef, props);
|
|
53
|
+
(0, _useGridInitializeState.useGridInitializeState)(_useGridPagination.paginationStateInitializer, apiRef, props);
|
|
53
54
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridRows.rowsStateInitializer, apiRef, props);
|
|
54
55
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridEditing.editingStateInitializer, apiRef, props);
|
|
55
56
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridFocus.focusStateInitializer, apiRef, props);
|
|
@@ -59,7 +60,6 @@ const useDataGridComponent = (inputApiRef, props) => {
|
|
|
59
60
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridRowSpanning.rowSpanningStateInitializer, apiRef, props);
|
|
60
61
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridDensity.densityStateInitializer, apiRef, props);
|
|
61
62
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridColumnResize.columnResizeStateInitializer, apiRef, props);
|
|
62
|
-
(0, _useGridInitializeState.useGridInitializeState)(_useGridPagination.paginationStateInitializer, apiRef, props);
|
|
63
63
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridRowsMeta.rowsMetaStateInitializer, apiRef, props);
|
|
64
64
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridColumnMenu.columnMenuStateInitializer, apiRef, props);
|
|
65
65
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridColumnGrouping.columnGroupsStateInitializer, apiRef, props);
|
|
@@ -26,7 +26,7 @@ function GridHeaders() {
|
|
|
26
26
|
const filterColumnLookup = (0, _useGridSelector.useGridSelector)(apiRef, _gridFilterSelector.gridFilterActiveItemsLookupSelector);
|
|
27
27
|
const sortColumnLookup = (0, _useGridSelector.useGridSelector)(apiRef, _gridSortingSelector.gridSortColumnLookupSelector);
|
|
28
28
|
const columnHeaderTabIndexState = (0, _useGridSelector.useGridSelector)(apiRef, _gridFocusStateSelector.gridTabIndexColumnHeaderSelector);
|
|
29
|
-
const
|
|
29
|
+
const hasNoCellTabIndexState = (0, _useGridSelector.useGridSelector)(apiRef, () => (0, _gridFocusStateSelector.gridTabIndexCellSelector)(apiRef) === null);
|
|
30
30
|
const columnGroupHeaderTabIndexState = (0, _useGridSelector.useGridSelector)(apiRef, _gridFocusStateSelector.gridTabIndexColumnGroupHeaderSelector);
|
|
31
31
|
const columnHeaderFocus = (0, _useGridSelector.useGridSelector)(apiRef, _gridFocusStateSelector.gridFocusColumnHeaderSelector);
|
|
32
32
|
const columnGroupHeaderFocus = (0, _useGridSelector.useGridSelector)(apiRef, _gridFocusStateSelector.gridFocusColumnGroupHeaderSelector);
|
|
@@ -34,7 +34,7 @@ function GridHeaders() {
|
|
|
34
34
|
const columnMenuState = (0, _useGridSelector.useGridSelector)(apiRef, _columnMenuSelector.gridColumnMenuSelector);
|
|
35
35
|
const columnVisibility = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnsSelector.gridColumnVisibilityModelSelector);
|
|
36
36
|
const columnGroupsHeaderStructure = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnGroupsSelector.gridColumnGroupsHeaderStructureSelector);
|
|
37
|
-
const hasOtherElementInTabSequence = !(columnGroupHeaderTabIndexState === null && columnHeaderTabIndexState === null &&
|
|
37
|
+
const hasOtherElementInTabSequence = !(columnGroupHeaderTabIndexState === null && columnHeaderTabIndexState === null && hasNoCellTabIndexState);
|
|
38
38
|
const columnsContainerRef = apiRef.current.columnHeadersContainerRef;
|
|
39
39
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.columnHeaders, (0, _extends2.default)({
|
|
40
40
|
ref: columnsContainerRef,
|
|
@@ -18,6 +18,7 @@ var _gridEditRowModel = require("../models/gridEditRowModel");
|
|
|
18
18
|
var _gridClasses = require("../constants/gridClasses");
|
|
19
19
|
var _composeGridClasses = require("../utils/composeGridClasses");
|
|
20
20
|
var _useGridRootProps = require("../hooks/utils/useGridRootProps");
|
|
21
|
+
var _cellBorderUtils = require("../utils/cellBorderUtils");
|
|
21
22
|
var _gridColumnsSelector = require("../hooks/features/columns/gridColumnsSelector");
|
|
22
23
|
var _useGridSelector = require("../hooks/utils/useGridSelector");
|
|
23
24
|
var _useGridVisibleRows = require("../hooks/utils/useGridVisibleRows");
|
|
@@ -28,14 +29,12 @@ var _constants = require("../internals/constants");
|
|
|
28
29
|
var _gridSortingSelector = require("../hooks/features/sorting/gridSortingSelector");
|
|
29
30
|
var _gridRowsSelector = require("../hooks/features/rows/gridRowsSelector");
|
|
30
31
|
var _gridEditingSelectors = require("../hooks/features/editing/gridEditingSelectors");
|
|
31
|
-
var _GridCell = require("./cell/GridCell");
|
|
32
32
|
var _GridScrollbarFillerCell = require("./GridScrollbarFillerCell");
|
|
33
33
|
var _getPinnedCellOffset = require("../internals/utils/getPinnedCellOffset");
|
|
34
34
|
var _useGridConfiguration = require("../hooks/utils/useGridConfiguration");
|
|
35
35
|
var _useGridPrivateApiContext = require("../hooks/utils/useGridPrivateApiContext");
|
|
36
|
-
var _hooks = require("../hooks");
|
|
37
36
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
38
|
-
const _excluded = ["selected", "rowId", "row", "index", "style", "rowHeight", "className", "visibleColumns", "pinnedColumns", "offsetTop", "offsetLeft", "
|
|
37
|
+
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"];
|
|
39
38
|
const GridRow = (0, _forwardRef.forwardRef)(function GridRow(props, refProp) {
|
|
40
39
|
const {
|
|
41
40
|
selected,
|
|
@@ -48,13 +47,16 @@ const GridRow = (0, _forwardRef.forwardRef)(function GridRow(props, refProp) {
|
|
|
48
47
|
visibleColumns,
|
|
49
48
|
pinnedColumns,
|
|
50
49
|
offsetLeft,
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
columnsTotalWidth,
|
|
51
|
+
firstColumnIndex,
|
|
52
|
+
lastColumnIndex,
|
|
53
53
|
focusedColumnIndex,
|
|
54
54
|
isFirstVisible,
|
|
55
55
|
isLastVisible,
|
|
56
56
|
isNotVisible,
|
|
57
57
|
showBottomBorder,
|
|
58
|
+
scrollbarWidth,
|
|
59
|
+
gridHasFiller,
|
|
58
60
|
onClick,
|
|
59
61
|
onDoubleClick,
|
|
60
62
|
onMouseEnter,
|
|
@@ -74,14 +76,11 @@ const GridRow = (0, _forwardRef.forwardRef)(function GridRow(props, refProp) {
|
|
|
74
76
|
const editRowsState = (0, _useGridSelector.useGridSelector)(apiRef, _gridEditingSelectors.gridEditRowsStateSelector);
|
|
75
77
|
const handleRef = (0, _utils.unstable_useForkRef)(ref, refProp);
|
|
76
78
|
const rowNode = apiRef.current.getRowNode(rowId);
|
|
77
|
-
const scrollbarWidth = dimensions.hasScrollY ? dimensions.scrollbarSize : 0;
|
|
78
|
-
const gridHasFiller = dimensions.columnsTotalWidth < dimensions.viewportOuterSize.width;
|
|
79
79
|
const editing = apiRef.current.getRowMode(rowId) === _gridEditRowModel.GridRowModes.Edit;
|
|
80
80
|
const editable = rootProps.editMode === _gridEditRowModel.GridEditModes.Row;
|
|
81
|
-
const hasColumnVirtualization = (0, _useGridSelector.useGridSelector)(apiRef, _hooks.gridVirtualizationColumnEnabledSelector);
|
|
82
81
|
const hasFocusCell = focusedColumnIndex !== undefined;
|
|
83
|
-
const hasVirtualFocusCellLeft = hasFocusCell && focusedColumnIndex >= pinnedColumns.left.length && focusedColumnIndex <
|
|
84
|
-
const hasVirtualFocusCellRight = hasFocusCell && focusedColumnIndex < visibleColumns.length - pinnedColumns.right.length && focusedColumnIndex >=
|
|
82
|
+
const hasVirtualFocusCellLeft = hasFocusCell && focusedColumnIndex >= pinnedColumns.left.length && focusedColumnIndex < firstColumnIndex;
|
|
83
|
+
const hasVirtualFocusCellRight = hasFocusCell && focusedColumnIndex < visibleColumns.length - pinnedColumns.right.length && focusedColumnIndex >= lastColumnIndex;
|
|
85
84
|
const classes = (0, _composeGridClasses.composeGridClasses)(rootProps.classes, {
|
|
86
85
|
root: ['row', selected && 'selected', editable && 'row--editable', editing && 'row--editing', isFirstVisible && 'row--firstVisible', isLastVisible && 'row--lastVisible', showBottomBorder && 'row--borderBottom', rowHeight === 'auto' && 'row--dynamicHeight']
|
|
87
86
|
});
|
|
@@ -197,14 +196,14 @@ const GridRow = (0, _forwardRef.forwardRef)(function GridRow(props, refProp) {
|
|
|
197
196
|
});
|
|
198
197
|
rowClassNames.push(rootProps.getRowClassName(rowParams));
|
|
199
198
|
}
|
|
200
|
-
const getCell = (column, indexInSection, indexRelativeToAllColumns, sectionLength, pinnedPosition =
|
|
199
|
+
const getCell = (column, indexInSection, indexRelativeToAllColumns, sectionLength, pinnedPosition = _constants.PinnedColumnPosition.NONE) => {
|
|
201
200
|
const cellColSpanInfo = apiRef.current.unstable_getCellColSpanInfo(rowId, indexRelativeToAllColumns);
|
|
202
201
|
if (cellColSpanInfo?.spannedByColSpan) {
|
|
203
202
|
return null;
|
|
204
203
|
}
|
|
205
204
|
const width = cellColSpanInfo?.cellProps.width ?? column.computedWidth;
|
|
206
205
|
const colSpan = cellColSpanInfo?.cellProps.colSpan ?? 1;
|
|
207
|
-
const pinnedOffset = (0, _getPinnedCellOffset.getPinnedCellOffset)(
|
|
206
|
+
const pinnedOffset = (0, _getPinnedCellOffset.getPinnedCellOffset)(pinnedPosition, column.computedWidth, indexRelativeToAllColumns, columnPositions, columnsTotalWidth, scrollbarWidth);
|
|
208
207
|
if (rowNode?.type === 'skeletonRow') {
|
|
209
208
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(slots.skeletonCell, {
|
|
210
209
|
type: column.type,
|
|
@@ -223,7 +222,9 @@ const GridRow = (0, _forwardRef.forwardRef)(function GridRow(props, refProp) {
|
|
|
223
222
|
const canReorderColumn = !(disableColumnReorder || column.disableReorder);
|
|
224
223
|
const canReorderRow = rowReordering && !sortModel.length && treeDepth <= 1 && !isEditingRows;
|
|
225
224
|
const disableDragEvents = !(canReorderColumn || isReorderCell && canReorderRow);
|
|
226
|
-
const cellIsNotVisible = pinnedPosition ===
|
|
225
|
+
const cellIsNotVisible = pinnedPosition === _constants.PinnedColumnPosition.VIRTUAL;
|
|
226
|
+
const showLeftBorder = (0, _cellBorderUtils.shouldCellShowLeftBorder)(pinnedPosition, indexInSection);
|
|
227
|
+
const showRightBorder = (0, _cellBorderUtils.shouldCellShowRightBorder)(pinnedPosition, indexInSection, sectionLength, rootProps.showCellVerticalBorder, gridHasFiller);
|
|
227
228
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(slots.cell, (0, _extends2.default)({
|
|
228
229
|
column: column,
|
|
229
230
|
width: width,
|
|
@@ -236,9 +237,8 @@ const GridRow = (0, _forwardRef.forwardRef)(function GridRow(props, refProp) {
|
|
|
236
237
|
isNotVisible: cellIsNotVisible,
|
|
237
238
|
pinnedOffset: pinnedOffset,
|
|
238
239
|
pinnedPosition: pinnedPosition,
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
gridHasFiller: gridHasFiller
|
|
240
|
+
showLeftBorder: showLeftBorder,
|
|
241
|
+
showRightBorder: showRightBorder
|
|
242
242
|
}, slotProps?.cell), column.field);
|
|
243
243
|
};
|
|
244
244
|
|
|
@@ -249,25 +249,16 @@ const GridRow = (0, _forwardRef.forwardRef)(function GridRow(props, refProp) {
|
|
|
249
249
|
}
|
|
250
250
|
const leftCells = pinnedColumns.left.map((column, i) => {
|
|
251
251
|
const indexRelativeToAllColumns = i;
|
|
252
|
-
return getCell(column, i, indexRelativeToAllColumns, pinnedColumns.left.length,
|
|
252
|
+
return getCell(column, i, indexRelativeToAllColumns, pinnedColumns.left.length, _constants.PinnedColumnPosition.LEFT);
|
|
253
253
|
});
|
|
254
254
|
const rightCells = pinnedColumns.right.map((column, i) => {
|
|
255
255
|
const indexRelativeToAllColumns = visibleColumns.length - pinnedColumns.right.length + i;
|
|
256
|
-
return getCell(column, i, indexRelativeToAllColumns, pinnedColumns.right.length,
|
|
256
|
+
return getCell(column, i, indexRelativeToAllColumns, pinnedColumns.right.length, _constants.PinnedColumnPosition.RIGHT);
|
|
257
257
|
});
|
|
258
258
|
const middleColumnsLength = visibleColumns.length - pinnedColumns.left.length - pinnedColumns.right.length;
|
|
259
259
|
const cells = [];
|
|
260
260
|
if (hasVirtualFocusCellLeft) {
|
|
261
|
-
cells.push(getCell(visibleColumns[focusedColumnIndex], focusedColumnIndex - pinnedColumns.left.length, focusedColumnIndex, middleColumnsLength,
|
|
262
|
-
}
|
|
263
|
-
let firstColumnIndex;
|
|
264
|
-
let lastColumnIndex;
|
|
265
|
-
if (!rootProps.disableVirtualization && !hasColumnVirtualization) {
|
|
266
|
-
firstColumnIndex = 0;
|
|
267
|
-
lastColumnIndex = visibleColumns.length;
|
|
268
|
-
} else {
|
|
269
|
-
firstColumnIndex = renderContext.firstColumnIndex;
|
|
270
|
-
lastColumnIndex = renderContext.lastColumnIndex;
|
|
261
|
+
cells.push(getCell(visibleColumns[focusedColumnIndex], focusedColumnIndex - pinnedColumns.left.length, focusedColumnIndex, middleColumnsLength, _constants.PinnedColumnPosition.VIRTUAL));
|
|
271
262
|
}
|
|
272
263
|
for (let i = firstColumnIndex; i < lastColumnIndex; i += 1) {
|
|
273
264
|
const column = visibleColumns[i];
|
|
@@ -278,7 +269,7 @@ const GridRow = (0, _forwardRef.forwardRef)(function GridRow(props, refProp) {
|
|
|
278
269
|
cells.push(getCell(column, indexInSection, i, middleColumnsLength));
|
|
279
270
|
}
|
|
280
271
|
if (hasVirtualFocusCellRight) {
|
|
281
|
-
cells.push(getCell(visibleColumns[focusedColumnIndex], focusedColumnIndex - pinnedColumns.left.length, focusedColumnIndex, middleColumnsLength,
|
|
272
|
+
cells.push(getCell(visibleColumns[focusedColumnIndex], focusedColumnIndex - pinnedColumns.left.length, focusedColumnIndex, middleColumnsLength, _constants.PinnedColumnPosition.VIRTUAL));
|
|
282
273
|
}
|
|
283
274
|
const eventHandlers = row ? {
|
|
284
275
|
onClick: publishClick,
|
|
@@ -315,48 +306,14 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
315
306
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
316
307
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
317
308
|
// ----------------------------------------------------------------------
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
columnsTotalWidth: _propTypes.default.number.isRequired,
|
|
321
|
-
contentSize: _propTypes.default.shape({
|
|
322
|
-
height: _propTypes.default.number.isRequired,
|
|
323
|
-
width: _propTypes.default.number.isRequired
|
|
324
|
-
}).isRequired,
|
|
325
|
-
groupHeaderHeight: _propTypes.default.number.isRequired,
|
|
326
|
-
hasScrollX: _propTypes.default.bool.isRequired,
|
|
327
|
-
hasScrollY: _propTypes.default.bool.isRequired,
|
|
328
|
-
headerFilterHeight: _propTypes.default.number.isRequired,
|
|
329
|
-
headerHeight: _propTypes.default.number.isRequired,
|
|
330
|
-
headersTotalHeight: _propTypes.default.number.isRequired,
|
|
331
|
-
isReady: _propTypes.default.bool.isRequired,
|
|
332
|
-
leftPinnedWidth: _propTypes.default.number.isRequired,
|
|
333
|
-
minimumSize: _propTypes.default.shape({
|
|
334
|
-
height: _propTypes.default.number.isRequired,
|
|
335
|
-
width: _propTypes.default.number.isRequired
|
|
336
|
-
}).isRequired,
|
|
337
|
-
rightPinnedWidth: _propTypes.default.number.isRequired,
|
|
338
|
-
root: _propTypes.default.shape({
|
|
339
|
-
height: _propTypes.default.number.isRequired,
|
|
340
|
-
width: _propTypes.default.number.isRequired
|
|
341
|
-
}).isRequired,
|
|
342
|
-
rowHeight: _propTypes.default.number.isRequired,
|
|
343
|
-
rowWidth: _propTypes.default.number.isRequired,
|
|
344
|
-
scrollbarSize: _propTypes.default.number.isRequired,
|
|
345
|
-
topContainerHeight: _propTypes.default.number.isRequired,
|
|
346
|
-
viewportInnerSize: _propTypes.default.shape({
|
|
347
|
-
height: _propTypes.default.number.isRequired,
|
|
348
|
-
width: _propTypes.default.number.isRequired
|
|
349
|
-
}).isRequired,
|
|
350
|
-
viewportOuterSize: _propTypes.default.shape({
|
|
351
|
-
height: _propTypes.default.number.isRequired,
|
|
352
|
-
width: _propTypes.default.number.isRequired
|
|
353
|
-
}).isRequired
|
|
354
|
-
}).isRequired,
|
|
309
|
+
columnsTotalWidth: _propTypes.default.number.isRequired,
|
|
310
|
+
firstColumnIndex: _propTypes.default.number.isRequired,
|
|
355
311
|
/**
|
|
356
312
|
* Determines which cell has focus.
|
|
357
313
|
* If `null`, no cell in this row has focus.
|
|
358
314
|
*/
|
|
359
315
|
focusedColumnIndex: _propTypes.default.number,
|
|
316
|
+
gridHasFiller: _propTypes.default.bool.isRequired,
|
|
360
317
|
/**
|
|
361
318
|
* Index of the row in the whole sorted and filtered dataset.
|
|
362
319
|
* If some rows above have expanded children, this index also take those children into account.
|
|
@@ -365,6 +322,7 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
365
322
|
isFirstVisible: _propTypes.default.bool.isRequired,
|
|
366
323
|
isLastVisible: _propTypes.default.bool.isRequired,
|
|
367
324
|
isNotVisible: _propTypes.default.bool.isRequired,
|
|
325
|
+
lastColumnIndex: _propTypes.default.number.isRequired,
|
|
368
326
|
offsetLeft: _propTypes.default.number.isRequired,
|
|
369
327
|
offsetTop: _propTypes.default.number,
|
|
370
328
|
onClick: _propTypes.default.func,
|
|
@@ -372,22 +330,12 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
372
330
|
onMouseEnter: _propTypes.default.func,
|
|
373
331
|
onMouseLeave: _propTypes.default.func,
|
|
374
332
|
pinnedColumns: _propTypes.default.object.isRequired,
|
|
375
|
-
renderContext: _propTypes.default.shape({
|
|
376
|
-
firstColumnIndex: _propTypes.default.number.isRequired,
|
|
377
|
-
firstRowIndex: _propTypes.default.number.isRequired,
|
|
378
|
-
lastColumnIndex: _propTypes.default.number.isRequired,
|
|
379
|
-
lastRowIndex: _propTypes.default.number.isRequired
|
|
380
|
-
}).isRequired,
|
|
381
333
|
row: _propTypes.default.object.isRequired,
|
|
382
334
|
rowHeight: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number]).isRequired,
|
|
383
335
|
rowId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
336
|
+
scrollbarWidth: _propTypes.default.number.isRequired,
|
|
384
337
|
selected: _propTypes.default.bool.isRequired,
|
|
385
338
|
showBottomBorder: _propTypes.default.bool.isRequired,
|
|
386
|
-
/**
|
|
387
|
-
* Determines which cell should be tabbable by having tabIndex=0.
|
|
388
|
-
* If `null`, no cell in this row is in the tab sequence.
|
|
389
|
-
*/
|
|
390
|
-
tabbableCell: _propTypes.default.string,
|
|
391
339
|
visibleColumns: _propTypes.default.arrayOf(_propTypes.default.object).isRequired
|
|
392
340
|
} : void 0;
|
|
393
341
|
const MemoizedGridRow = exports.GridRow = (0, _fastMemo.fastMemo)(GridRow);
|
|
@@ -12,15 +12,19 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
12
12
|
var _system = require("@mui/system");
|
|
13
13
|
var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
|
|
14
14
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
15
|
+
var _RtlProvider = require("@mui/system/RtlProvider");
|
|
15
16
|
var _forwardRef = require("@mui/x-internals/forwardRef");
|
|
16
17
|
var _useGridApiContext = require("../hooks/utils/useGridApiContext");
|
|
17
18
|
var _useGridRootProps = require("../hooks/utils/useGridRootProps");
|
|
18
19
|
var _hooks = require("../hooks");
|
|
20
|
+
var _constants = require("../internals/constants");
|
|
19
21
|
var _gridClasses = require("../constants/gridClasses");
|
|
20
22
|
var _getPinnedCellOffset = require("../internals/utils/getPinnedCellOffset");
|
|
21
23
|
var _cellBorderUtils = require("../utils/cellBorderUtils");
|
|
22
24
|
var _domUtils = require("../utils/domUtils");
|
|
23
25
|
var _GridScrollbarFillerCell = require("./GridScrollbarFillerCell");
|
|
26
|
+
var _rtlFlipSide = require("../utils/rtlFlipSide");
|
|
27
|
+
var _utils = require("../internals/utils");
|
|
24
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
29
|
const SkeletonOverlay = (0, _system.styled)('div', {
|
|
26
30
|
name: 'MuiDataGrid',
|
|
@@ -48,6 +52,7 @@ const GridSkeletonLoadingOverlay = exports.GridSkeletonLoadingOverlay = (0, _for
|
|
|
48
52
|
const {
|
|
49
53
|
slots
|
|
50
54
|
} = rootProps;
|
|
55
|
+
const isRtl = (0, _RtlProvider.useRtl)();
|
|
51
56
|
const classes = useUtilityClasses({
|
|
52
57
|
classes: rootProps.classes
|
|
53
58
|
});
|
|
@@ -63,18 +68,12 @@ const GridSkeletonLoadingOverlay = exports.GridSkeletonLoadingOverlay = (0, _for
|
|
|
63
68
|
const allVisibleColumns = (0, _hooks.useGridSelector)(apiRef, _hooks.gridVisibleColumnDefinitionsSelector);
|
|
64
69
|
const columns = React.useMemo(() => allVisibleColumns.slice(0, inViewportCount), [allVisibleColumns, inViewportCount]);
|
|
65
70
|
const pinnedColumns = (0, _hooks.useGridSelector)(apiRef, _hooks.gridVisiblePinnedColumnDefinitionsSelector);
|
|
66
|
-
const getPinnedStyle = React.useCallback((computedWidth, index, position) => {
|
|
67
|
-
const pinnedOffset = (0, _getPinnedCellOffset.getPinnedCellOffset)(position, computedWidth, index, positions, dimensions);
|
|
68
|
-
return {
|
|
69
|
-
[position]: pinnedOffset
|
|
70
|
-
};
|
|
71
|
-
}, [dimensions, positions]);
|
|
72
71
|
const getPinnedPosition = React.useCallback(field => {
|
|
73
72
|
if (pinnedColumns.left.findIndex(col => col.field === field) !== -1) {
|
|
74
|
-
return
|
|
73
|
+
return _constants.PinnedColumnPosition.LEFT;
|
|
75
74
|
}
|
|
76
75
|
if (pinnedColumns.right.findIndex(col => col.field === field) !== -1) {
|
|
77
|
-
return
|
|
76
|
+
return _constants.PinnedColumnPosition.RIGHT;
|
|
78
77
|
}
|
|
79
78
|
return undefined;
|
|
80
79
|
}, [pinnedColumns.left, pinnedColumns.right]);
|
|
@@ -85,13 +84,15 @@ const GridSkeletonLoadingOverlay = exports.GridSkeletonLoadingOverlay = (0, _for
|
|
|
85
84
|
for (let colIndex = 0; colIndex < columns.length; colIndex += 1) {
|
|
86
85
|
const column = columns[colIndex];
|
|
87
86
|
const pinnedPosition = getPinnedPosition(column.field);
|
|
88
|
-
const isPinnedLeft = pinnedPosition ===
|
|
89
|
-
const isPinnedRight = pinnedPosition ===
|
|
90
|
-
const
|
|
87
|
+
const isPinnedLeft = pinnedPosition === _constants.PinnedColumnPosition.LEFT;
|
|
88
|
+
const isPinnedRight = pinnedPosition === _constants.PinnedColumnPosition.RIGHT;
|
|
89
|
+
const pinnedSide = (0, _rtlFlipSide.rtlFlipSide)(pinnedPosition, isRtl);
|
|
90
|
+
const sectionLength = pinnedSide ? pinnedColumns[pinnedSide].length // pinned section
|
|
91
91
|
: columns.length - pinnedColumns.left.length - pinnedColumns.right.length; // middle section
|
|
92
|
-
const sectionIndex =
|
|
92
|
+
const sectionIndex = pinnedSide ? pinnedColumns[pinnedSide].findIndex(col => col.field === column.field) // pinned section
|
|
93
93
|
: colIndex - pinnedColumns.left.length; // middle section
|
|
94
|
-
const
|
|
94
|
+
const scrollbarWidth = dimensions.hasScrollY ? dimensions.scrollbarSize : 0;
|
|
95
|
+
const pinnedStyle = (0, _utils.attachPinnedStyle)({}, isRtl, pinnedPosition, (0, _getPinnedCellOffset.getPinnedCellOffset)(pinnedPosition, column.computedWidth, colIndex, positions, dimensions.columnsTotalWidth, scrollbarWidth));
|
|
95
96
|
const gridHasFiller = dimensions.columnsTotalWidth < dimensions.viewportOuterSize.width;
|
|
96
97
|
const showRightBorder = (0, _cellBorderUtils.shouldCellShowRightBorder)(pinnedPosition, sectionIndex, sectionLength, rootProps.showCellVerticalBorder, gridHasFiller);
|
|
97
98
|
const showLeftBorder = (0, _cellBorderUtils.shouldCellShowLeftBorder)(pinnedPosition, sectionIndex);
|
|
@@ -105,7 +106,6 @@ const GridSkeletonLoadingOverlay = exports.GridSkeletonLoadingOverlay = (0, _for
|
|
|
105
106
|
width: emptyCellWidth,
|
|
106
107
|
empty: true
|
|
107
108
|
}, `skeleton-filler-column-${i}`);
|
|
108
|
-
const scrollbarWidth = dimensions.hasScrollY ? dimensions.scrollbarSize : 0;
|
|
109
109
|
const hasScrollbarFiller = isLastColumn && scrollbarWidth !== 0;
|
|
110
110
|
if (hasFillerBefore) {
|
|
111
111
|
rowCells.push(emptyCell);
|
|
@@ -137,7 +137,7 @@ const GridSkeletonLoadingOverlay = exports.GridSkeletonLoadingOverlay = (0, _for
|
|
|
137
137
|
}, `skeleton-row-${i}`));
|
|
138
138
|
}
|
|
139
139
|
return array;
|
|
140
|
-
}, [slots, columns, pinnedColumns, skeletonRowsCount, rootProps.showCellVerticalBorder, dimensions
|
|
140
|
+
}, [slots, columns, pinnedColumns, skeletonRowsCount, rootProps.showCellVerticalBorder, dimensions, positions, getPinnedPosition, isRtl]);
|
|
141
141
|
|
|
142
142
|
// Sync the column resize of the overlay columns with the grid
|
|
143
143
|
const handleColumnResize = params => {
|
|
@@ -151,8 +151,8 @@ const GridSkeletonLoadingOverlay = exports.GridSkeletonLoadingOverlay = (0, _for
|
|
|
151
151
|
}
|
|
152
152
|
const resizedColIndex = columns.findIndex(col => col.field === colDef.field);
|
|
153
153
|
const pinnedPosition = getPinnedPosition(colDef.field);
|
|
154
|
-
const isPinnedLeft = pinnedPosition ===
|
|
155
|
-
const isPinnedRight = pinnedPosition ===
|
|
154
|
+
const isPinnedLeft = pinnedPosition === _constants.PinnedColumnPosition.LEFT;
|
|
155
|
+
const isPinnedRight = pinnedPosition === _constants.PinnedColumnPosition.RIGHT;
|
|
156
156
|
const currentWidth = getComputedStyle(cells[0]).getPropertyValue('--width');
|
|
157
157
|
const delta = parseInt(currentWidth, 10) - width;
|
|
158
158
|
if (cells) {
|