@mui/x-data-grid 6.5.0 → 6.7.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 +150 -2
- package/DataGrid/DataGrid.js +10 -3
- package/README.md +2 -2
- package/components/GridColumnHeaders.js +4 -9
- package/components/GridHeader.d.ts +2 -2
- package/components/base/GridBody.d.ts +1 -1
- package/components/base/GridFooterPlaceholder.d.ts +2 -2
- package/components/base/GridOverlays.d.ts +2 -2
- package/components/cell/GridActionsCell.d.ts +3 -3
- package/components/cell/GridActionsCell.js +3 -3
- package/components/cell/GridBooleanCell.d.ts +1 -1
- package/components/cell/GridEditBooleanCell.d.ts +2 -2
- package/components/cell/GridEditDateCell.d.ts +2 -2
- package/components/cell/GridEditInputCell.d.ts +1 -1
- package/components/cell/GridEditSingleSelectCell.d.ts +3 -3
- package/components/cell/GridEditSingleSelectCell.js +5 -5
- package/components/cell/GridSkeletonCell.d.ts +1 -1
- package/components/columnHeaders/ColumnHeaderMenuIcon.d.ts +1 -1
- package/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
- package/components/columnHeaders/GridColumnGroupHeader.d.ts +2 -2
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +13 -4
- package/components/columnHeaders/GridColumnHeaderItem.d.ts +2 -2
- package/components/columnHeaders/GridColumnHeaderSeparator.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeaderSortIcon.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeaderTitle.d.ts +1 -1
- package/components/containers/GridRoot.js +1 -3
- package/components/containers/GridRootStyles.js +8 -1
- package/components/index.d.ts +0 -1
- package/components/index.js +1 -2
- package/components/menu/GridMenu.d.ts +1 -1
- package/components/menu/columnMenu/GridColumnHeaderMenu.d.ts +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.d.ts +2 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.d.ts +2 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.d.ts +2 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.d.ts +2 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.d.ts +2 -2
- package/components/panel/GridColumnsPanel.d.ts +16 -2
- package/components/panel/GridColumnsPanel.js +14 -0
- package/components/panel/GridPanelContent.d.ts +1 -1
- package/components/panel/GridPanelFooter.d.ts +1 -1
- package/components/panel/GridPanelHeader.d.ts +1 -1
- package/components/panel/GridPreferencesPanel.js +3 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +1 -2
- package/components/panel/filterPanel/GridFilterInputBoolean.js +6 -7
- package/components/panel/filterPanel/GridFilterInputDate.d.ts +1 -2
- package/components/panel/filterPanel/GridFilterInputDate.js +1 -6
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -2
- package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +2 -2
- package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +1 -2
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +6 -6
- package/components/panel/filterPanel/GridFilterInputValue.d.ts +1 -2
- package/components/panel/filterPanel/GridFilterInputValue.js +1 -6
- package/components/panel/filterPanel/GridFilterPanel.d.ts +8 -0
- package/components/panel/filterPanel/GridFilterPanel.js +8 -0
- package/components/toolbar/GridToolbarColumnsButton.js +11 -6
- package/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/components/toolbar/GridToolbarExport.d.ts +2 -2
- package/components/toolbar/GridToolbarExportContainer.js +7 -7
- package/components/toolbar/GridToolbarFilterButton.js +11 -4
- package/components/toolbar/GridToolbarQuickFilter.d.ts +2 -2
- package/constants/gridClasses.d.ts +4 -0
- package/constants/gridClasses.js +1 -1
- package/constants/localeTextConstants.js +4 -4
- package/context/GridContextProvider.d.ts +1 -1
- package/hooks/core/strategyProcessing/gridStrategyProcessingApi.d.ts +10 -2
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +1 -1
- package/hooks/features/filter/gridFilterSelector.d.ts +2 -2
- package/hooks/features/filter/gridFilterSelector.js +2 -2
- package/hooks/features/filter/gridFilterState.d.ts +6 -6
- package/hooks/features/filter/gridFilterState.js +6 -0
- package/hooks/features/filter/useGridFilter.js +31 -10
- package/hooks/features/focus/useGridFocus.js +1 -0
- package/hooks/features/preferencesPanel/gridPreferencePanelState.d.ts +2 -0
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
- package/hooks/features/rows/useGridRowsMeta.js +12 -13
- package/hooks/features/sorting/useGridSorting.js +2 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
- package/index.js +1 -1
- package/internals/utils/useProps.js +21 -1
- package/legacy/DataGrid/DataGrid.js +10 -3
- package/legacy/components/GridColumnHeaders.js +4 -9
- package/legacy/components/cell/GridActionsCell.js +3 -3
- package/legacy/components/cell/GridEditSingleSelectCell.js +5 -5
- package/legacy/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
- package/legacy/components/columnHeaders/GridColumnHeaderFilterIconButton.js +13 -4
- package/legacy/components/containers/GridRoot.js +1 -3
- package/legacy/components/containers/GridRootStyles.js +8 -4
- package/legacy/components/index.js +1 -2
- package/legacy/components/panel/GridColumnsPanel.js +14 -0
- package/legacy/components/panel/GridPreferencesPanel.js +3 -1
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +7 -7
- package/legacy/components/panel/filterPanel/GridFilterInputDate.js +1 -5
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +7 -6
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +1 -5
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +8 -0
- package/legacy/components/toolbar/GridToolbarColumnsButton.js +11 -5
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/legacy/components/toolbar/GridToolbarExportContainer.js +7 -7
- package/legacy/components/toolbar/GridToolbarFilterButton.js +11 -4
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/constants/localeTextConstants.js +4 -4
- package/legacy/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
- package/legacy/hooks/features/filter/gridFilterSelector.js +4 -4
- package/legacy/hooks/features/filter/gridFilterState.js +6 -0
- package/legacy/hooks/features/filter/useGridFilter.js +31 -10
- package/legacy/hooks/features/focus/useGridFocus.js +1 -0
- package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
- package/legacy/hooks/features/rows/useGridRowsMeta.js +13 -21
- package/legacy/hooks/features/sorting/useGridSorting.js +2 -1
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
- package/legacy/index.js +1 -1
- package/legacy/internals/utils/useProps.js +23 -1
- package/legacy/locales/arSD.js +12 -12
- package/legacy/locales/beBY.js +12 -12
- package/legacy/locales/bgBG.js +12 -12
- package/legacy/locales/csCZ.js +25 -27
- package/legacy/locales/daDK.js +12 -12
- package/legacy/locales/deDE.js +25 -27
- package/legacy/locales/elGR.js +12 -12
- package/legacy/locales/esES.js +12 -12
- package/legacy/locales/faIR.js +12 -12
- package/legacy/locales/fiFI.js +12 -12
- package/legacy/locales/frFR.js +25 -27
- package/legacy/locales/heIL.js +12 -12
- package/legacy/locales/huHU.js +12 -12
- package/legacy/locales/itIT.js +12 -12
- package/legacy/locales/jaJP.js +12 -12
- package/legacy/locales/koKR.js +12 -12
- package/legacy/locales/nbNO.js +12 -12
- package/legacy/locales/nlNL.js +25 -27
- package/legacy/locales/plPL.js +12 -12
- package/legacy/locales/ptBR.js +12 -12
- package/legacy/locales/roRO.js +12 -12
- package/legacy/locales/ruRU.js +12 -12
- package/legacy/locales/skSK.js +12 -12
- package/legacy/locales/svSE.js +12 -12
- package/legacy/locales/trTR.js +18 -19
- package/legacy/locales/ukUA.js +12 -12
- package/legacy/locales/urPK.js +12 -12
- package/legacy/locales/viVN.js +12 -12
- package/legacy/locales/zhCN.js +12 -12
- package/legacy/locales/zhTW.js +12 -12
- package/legacy/models/gridFilterItem.js +1 -1
- package/legacy/utils/EventManager.js +2 -2
- package/locales/arSD.js +12 -12
- package/locales/beBY.js +12 -12
- package/locales/bgBG.js +12 -12
- package/locales/csCZ.js +25 -27
- package/locales/daDK.js +12 -12
- package/locales/deDE.js +25 -27
- package/locales/elGR.js +12 -12
- package/locales/esES.js +12 -12
- package/locales/faIR.js +12 -12
- package/locales/fiFI.js +12 -12
- package/locales/frFR.js +25 -27
- package/locales/heIL.js +12 -12
- package/locales/huHU.js +12 -12
- package/locales/itIT.js +12 -12
- package/locales/jaJP.js +12 -12
- package/locales/koKR.js +12 -12
- package/locales/nbNO.js +12 -12
- package/locales/nlNL.js +25 -27
- package/locales/plPL.js +12 -12
- package/locales/ptBR.js +12 -12
- package/locales/roRO.js +12 -12
- package/locales/ruRU.js +12 -12
- package/locales/skSK.js +12 -12
- package/locales/svSE.js +12 -12
- package/locales/trTR.js +18 -19
- package/locales/ukUA.js +12 -12
- package/locales/urPK.js +12 -12
- package/locales/viVN.js +12 -12
- package/locales/zhCN.js +12 -12
- package/locales/zhTW.js +12 -12
- package/material/components/MUISelectOption.d.ts +2 -2
- package/models/api/gridFilterApi.d.ts +3 -1
- package/models/api/gridPreferencesPanelApi.d.ts +3 -1
- package/models/events/gridEventLookup.d.ts +8 -0
- package/models/gridFilterItem.d.ts +1 -1
- package/models/gridFilterItem.js +1 -1
- package/models/gridFilterOperator.d.ts +1 -1
- package/models/gridStateCommunity.d.ts +2 -0
- package/models/props/DataGridProps.d.ts +5 -0
- package/modern/DataGrid/DataGrid.js +10 -3
- package/modern/components/GridColumnHeaders.js +4 -9
- package/modern/components/cell/GridActionsCell.js +3 -3
- package/modern/components/cell/GridEditSingleSelectCell.js +5 -5
- package/modern/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
- package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +13 -4
- package/modern/components/containers/GridRoot.js +1 -3
- package/modern/components/containers/GridRootStyles.js +8 -1
- package/modern/components/index.js +1 -2
- package/modern/components/panel/GridColumnsPanel.js +14 -0
- package/modern/components/panel/GridPreferencesPanel.js +3 -1
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +6 -7
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +1 -6
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +6 -6
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +1 -6
- package/modern/components/panel/filterPanel/GridFilterPanel.js +8 -0
- package/modern/components/toolbar/GridToolbarColumnsButton.js +11 -6
- package/modern/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/modern/components/toolbar/GridToolbarExportContainer.js +7 -7
- package/modern/components/toolbar/GridToolbarFilterButton.js +11 -4
- package/modern/constants/gridClasses.js +1 -1
- package/modern/constants/localeTextConstants.js +4 -4
- package/modern/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
- package/modern/hooks/features/filter/gridFilterSelector.js +2 -2
- package/modern/hooks/features/filter/gridFilterState.js +6 -0
- package/modern/hooks/features/filter/useGridFilter.js +31 -10
- package/modern/hooks/features/focus/useGridFocus.js +1 -0
- package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
- package/modern/hooks/features/rows/useGridRowsMeta.js +12 -13
- package/modern/hooks/features/sorting/useGridSorting.js +2 -1
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
- package/modern/index.js +1 -1
- package/modern/internals/utils/useProps.js +20 -1
- package/modern/locales/arSD.js +12 -12
- package/modern/locales/beBY.js +12 -12
- package/modern/locales/bgBG.js +12 -12
- package/modern/locales/csCZ.js +25 -27
- package/modern/locales/daDK.js +12 -12
- package/modern/locales/deDE.js +25 -27
- package/modern/locales/elGR.js +12 -12
- package/modern/locales/esES.js +12 -12
- package/modern/locales/faIR.js +12 -12
- package/modern/locales/fiFI.js +12 -12
- package/modern/locales/frFR.js +25 -27
- package/modern/locales/heIL.js +12 -12
- package/modern/locales/huHU.js +12 -12
- package/modern/locales/itIT.js +12 -12
- package/modern/locales/jaJP.js +12 -12
- package/modern/locales/koKR.js +12 -12
- package/modern/locales/nbNO.js +12 -12
- package/modern/locales/nlNL.js +25 -27
- package/modern/locales/plPL.js +12 -12
- package/modern/locales/ptBR.js +12 -12
- package/modern/locales/roRO.js +12 -12
- package/modern/locales/ruRU.js +12 -12
- package/modern/locales/skSK.js +12 -12
- package/modern/locales/svSE.js +12 -12
- package/modern/locales/trTR.js +18 -19
- package/modern/locales/ukUA.js +12 -12
- package/modern/locales/urPK.js +12 -12
- package/modern/locales/viVN.js +12 -12
- package/modern/locales/zhCN.js +12 -12
- package/modern/locales/zhTW.js +12 -12
- package/modern/models/gridFilterItem.js +1 -1
- package/modern/utils/EventManager.js +2 -2
- package/node/DataGrid/DataGrid.js +10 -3
- package/node/components/GridColumnHeaders.js +3 -8
- package/node/components/cell/GridActionsCell.js +3 -3
- package/node/components/cell/GridEditSingleSelectCell.js +5 -5
- package/node/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
- package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +12 -3
- package/node/components/containers/GridRoot.js +1 -3
- package/node/components/containers/GridRootStyles.js +8 -1
- package/node/components/index.js +0 -11
- package/node/components/panel/GridColumnsPanel.js +14 -0
- package/node/components/panel/GridPreferencesPanel.js +3 -1
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +6 -7
- package/node/components/panel/filterPanel/GridFilterInputDate.js +1 -6
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +6 -6
- package/node/components/panel/filterPanel/GridFilterInputValue.js +1 -6
- package/node/components/panel/filterPanel/GridFilterPanel.js +8 -0
- package/node/components/toolbar/GridToolbarColumnsButton.js +11 -6
- package/node/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/node/components/toolbar/GridToolbarExportContainer.js +7 -7
- package/node/components/toolbar/GridToolbarFilterButton.js +10 -3
- package/node/constants/gridClasses.js +1 -1
- package/node/constants/localeTextConstants.js +4 -4
- package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
- package/node/hooks/features/filter/gridFilterSelector.js +2 -2
- package/node/hooks/features/filter/gridFilterState.js +6 -0
- package/node/hooks/features/filter/useGridFilter.js +35 -14
- package/node/hooks/features/focus/useGridFocus.js +1 -0
- package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
- package/node/hooks/features/rows/useGridRowsMeta.js +12 -13
- package/node/hooks/features/sorting/useGridSorting.js +2 -1
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
- package/node/index.js +1 -1
- package/node/internals/utils/useProps.js +20 -1
- package/node/locales/arSD.js +12 -12
- package/node/locales/beBY.js +12 -12
- package/node/locales/bgBG.js +12 -12
- package/node/locales/csCZ.js +25 -27
- package/node/locales/daDK.js +12 -12
- package/node/locales/deDE.js +25 -27
- package/node/locales/elGR.js +12 -12
- package/node/locales/esES.js +12 -12
- package/node/locales/faIR.js +12 -12
- package/node/locales/fiFI.js +12 -12
- package/node/locales/frFR.js +25 -27
- package/node/locales/heIL.js +12 -12
- package/node/locales/huHU.js +12 -12
- package/node/locales/itIT.js +12 -12
- package/node/locales/jaJP.js +12 -12
- package/node/locales/koKR.js +12 -12
- package/node/locales/nbNO.js +12 -12
- package/node/locales/nlNL.js +25 -27
- package/node/locales/plPL.js +12 -12
- package/node/locales/ptBR.js +12 -12
- package/node/locales/roRO.js +12 -12
- package/node/locales/ruRU.js +12 -12
- package/node/locales/skSK.js +12 -12
- package/node/locales/svSE.js +12 -12
- package/node/locales/trTR.js +18 -19
- package/node/locales/ukUA.js +12 -12
- package/node/locales/urPK.js +12 -12
- package/node/locales/viVN.js +12 -12
- package/node/locales/zhCN.js +12 -12
- package/node/locales/zhTW.js +12 -12
- package/node/models/gridFilterItem.js +1 -1
- package/node/utils/EventManager.js +2 -2
- package/package.json +4 -4
- package/themeAugmentation/overrides.d.ts +1 -1
- package/utils/EventManager.js +2 -2
- package/components/GridScrollArea.d.ts +0 -10
- package/components/GridScrollArea.js +0 -117
- package/legacy/components/GridScrollArea.js +0 -119
- package/legacy/lib/createDetectElementResize/index.js +0 -145
- package/lib/createDetectElementResize/index.d.ts +0 -18
- package/lib/createDetectElementResize/index.js +0 -145
- package/lib/createDetectElementResize/types.d.ts +0 -9
- package/modern/components/GridScrollArea.js +0 -117
- package/modern/lib/createDetectElementResize/index.js +0 -145
- package/node/components/GridScrollArea.js +0 -126
- package/node/lib/createDetectElementResize/index.js +0 -151
package/node/locales/trTR.js
CHANGED
|
@@ -66,18 +66,17 @@ const trTRGrid = {
|
|
|
66
66
|
filterOperatorIsEmpty: 'boş',
|
|
67
67
|
filterOperatorIsNotEmpty: 'dolu',
|
|
68
68
|
filterOperatorIsAnyOf: 'herhangi biri',
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
'filterOperator=': '=',
|
|
70
|
+
'filterOperator!=': '!=',
|
|
71
|
+
'filterOperator>': '>',
|
|
72
|
+
'filterOperator>=': '>=',
|
|
73
|
+
'filterOperator<': '<',
|
|
74
|
+
'filterOperator<=': '<=',
|
|
76
75
|
// Header filter operators text
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
headerFilterOperatorContains: 'Şunu içerir',
|
|
77
|
+
headerFilterOperatorEquals: 'Şuna eşittir',
|
|
78
|
+
headerFilterOperatorStartsWith: 'Şununla başlar',
|
|
79
|
+
headerFilterOperatorEndsWith: 'Şununla biter',
|
|
81
80
|
// headerFilterOperatorIs: 'Is',
|
|
82
81
|
// headerFilterOperatorNot: 'Is not',
|
|
83
82
|
// headerFilterOperatorAfter: 'Is after',
|
|
@@ -87,12 +86,12 @@ const trTRGrid = {
|
|
|
87
86
|
// headerFilterOperatorIsEmpty: 'Is empty',
|
|
88
87
|
// headerFilterOperatorIsNotEmpty: 'Is not empty',
|
|
89
88
|
// headerFilterOperatorIsAnyOf: 'Is any of',
|
|
90
|
-
// headerFilterOperator
|
|
91
|
-
// headerFilterOperator
|
|
92
|
-
// headerFilterOperator
|
|
93
|
-
// headerFilterOperator
|
|
94
|
-
// headerFilterOperator
|
|
95
|
-
// headerFilterOperator
|
|
89
|
+
// 'headerFilterOperator=': 'Equals',
|
|
90
|
+
// 'headerFilterOperator!=': 'Not equals',
|
|
91
|
+
// 'headerFilterOperator>': 'Greater than',
|
|
92
|
+
// 'headerFilterOperator>=': 'Greater than or equal to',
|
|
93
|
+
// 'headerFilterOperator<': 'Less than',
|
|
94
|
+
// 'headerFilterOperator<=': 'Less than or equal to',
|
|
96
95
|
|
|
97
96
|
// Filter values text
|
|
98
97
|
filterValueAny: 'herhangi',
|
|
@@ -102,9 +101,9 @@ const trTRGrid = {
|
|
|
102
101
|
columnMenuLabel: 'Menü',
|
|
103
102
|
columnMenuShowColumns: 'Sütunları göster',
|
|
104
103
|
columnMenuManageColumns: 'Sütunları yönet',
|
|
105
|
-
columnMenuFilter: 'Filtre
|
|
104
|
+
columnMenuFilter: 'Filtre Ekle',
|
|
106
105
|
columnMenuHideColumn: 'Gizle',
|
|
107
|
-
columnMenuUnsort: 'Sıralama',
|
|
106
|
+
columnMenuUnsort: 'Varsayılan Sıralama',
|
|
108
107
|
columnMenuSortAsc: 'Sırala - Artan',
|
|
109
108
|
columnMenuSortDesc: 'Sırala - Azalan',
|
|
110
109
|
// Column header text
|
package/node/locales/ukUA.js
CHANGED
|
@@ -80,12 +80,12 @@ const ukUAGrid = {
|
|
|
80
80
|
filterOperatorIsEmpty: 'порожній',
|
|
81
81
|
filterOperatorIsNotEmpty: 'не порожній',
|
|
82
82
|
filterOperatorIsAnyOf: 'будь-що із',
|
|
83
|
-
// filterOperator
|
|
84
|
-
// filterOperator
|
|
85
|
-
// filterOperator
|
|
86
|
-
// filterOperator
|
|
87
|
-
// filterOperator
|
|
88
|
-
// filterOperator
|
|
83
|
+
// 'filterOperator=': '=',
|
|
84
|
+
// 'filterOperator!=': '!=',
|
|
85
|
+
// 'filterOperator>': '>',
|
|
86
|
+
// 'filterOperator>=': '>=',
|
|
87
|
+
// 'filterOperator<': '<',
|
|
88
|
+
// 'filterOperator<=': '<=',
|
|
89
89
|
|
|
90
90
|
// Header filter operators text
|
|
91
91
|
// headerFilterOperatorContains: 'Contains',
|
|
@@ -101,12 +101,12 @@ const ukUAGrid = {
|
|
|
101
101
|
// headerFilterOperatorIsEmpty: 'Is empty',
|
|
102
102
|
// headerFilterOperatorIsNotEmpty: 'Is not empty',
|
|
103
103
|
// headerFilterOperatorIsAnyOf: 'Is any of',
|
|
104
|
-
// headerFilterOperator
|
|
105
|
-
// headerFilterOperator
|
|
106
|
-
// headerFilterOperator
|
|
107
|
-
// headerFilterOperator
|
|
108
|
-
// headerFilterOperator
|
|
109
|
-
// headerFilterOperator
|
|
104
|
+
// 'headerFilterOperator=': 'Equals',
|
|
105
|
+
// 'headerFilterOperator!=': 'Not equals',
|
|
106
|
+
// 'headerFilterOperator>': 'Greater than',
|
|
107
|
+
// 'headerFilterOperator>=': 'Greater than or equal to',
|
|
108
|
+
// 'headerFilterOperator<': 'Less than',
|
|
109
|
+
// 'headerFilterOperator<=': 'Less than or equal to',
|
|
110
110
|
|
|
111
111
|
// Filter values text
|
|
112
112
|
filterValueAny: 'будь-який',
|
package/node/locales/urPK.js
CHANGED
|
@@ -66,12 +66,12 @@ const urPKGrid = {
|
|
|
66
66
|
filterOperatorIsEmpty: 'خالی ہے',
|
|
67
67
|
filterOperatorIsNotEmpty: 'خالی نہیں ہے',
|
|
68
68
|
filterOperatorIsAnyOf: 'ان میں سے کوئی ہے',
|
|
69
|
-
// filterOperator
|
|
70
|
-
// filterOperator
|
|
71
|
-
// filterOperator
|
|
72
|
-
// filterOperator
|
|
73
|
-
// filterOperator
|
|
74
|
-
// filterOperator
|
|
69
|
+
// 'filterOperator=': '=',
|
|
70
|
+
// 'filterOperator!=': '!=',
|
|
71
|
+
// 'filterOperator>': '>',
|
|
72
|
+
// 'filterOperator>=': '>=',
|
|
73
|
+
// 'filterOperator<': '<',
|
|
74
|
+
// 'filterOperator<=': '<=',
|
|
75
75
|
|
|
76
76
|
// Header filter operators text
|
|
77
77
|
// headerFilterOperatorContains: 'Contains',
|
|
@@ -87,12 +87,12 @@ const urPKGrid = {
|
|
|
87
87
|
// headerFilterOperatorIsEmpty: 'Is empty',
|
|
88
88
|
// headerFilterOperatorIsNotEmpty: 'Is not empty',
|
|
89
89
|
// headerFilterOperatorIsAnyOf: 'Is any of',
|
|
90
|
-
// headerFilterOperator
|
|
91
|
-
// headerFilterOperator
|
|
92
|
-
// headerFilterOperator
|
|
93
|
-
// headerFilterOperator
|
|
94
|
-
// headerFilterOperator
|
|
95
|
-
// headerFilterOperator
|
|
90
|
+
// 'headerFilterOperator=': 'Equals',
|
|
91
|
+
// 'headerFilterOperator!=': 'Not equals',
|
|
92
|
+
// 'headerFilterOperator>': 'Greater than',
|
|
93
|
+
// 'headerFilterOperator>=': 'Greater than or equal to',
|
|
94
|
+
// 'headerFilterOperator<': 'Less than',
|
|
95
|
+
// 'headerFilterOperator<=': 'Less than or equal to',
|
|
96
96
|
|
|
97
97
|
// Filter values text
|
|
98
98
|
filterValueAny: 'کوئی بھی',
|
package/node/locales/viVN.js
CHANGED
|
@@ -66,12 +66,12 @@ const viVNGrid = {
|
|
|
66
66
|
filterOperatorIsEmpty: 'Rỗng',
|
|
67
67
|
filterOperatorIsNotEmpty: 'Khác rỗng',
|
|
68
68
|
// filterOperatorIsAnyOf: 'is any of',
|
|
69
|
-
// filterOperator
|
|
70
|
-
// filterOperator
|
|
71
|
-
// filterOperator
|
|
72
|
-
// filterOperator
|
|
73
|
-
// filterOperator
|
|
74
|
-
// filterOperator
|
|
69
|
+
// 'filterOperator=': '=',
|
|
70
|
+
// 'filterOperator!=': '!=',
|
|
71
|
+
// 'filterOperator>': '>',
|
|
72
|
+
// 'filterOperator>=': '>=',
|
|
73
|
+
// 'filterOperator<': '<',
|
|
74
|
+
// 'filterOperator<=': '<=',
|
|
75
75
|
|
|
76
76
|
// Header filter operators text
|
|
77
77
|
// headerFilterOperatorContains: 'Contains',
|
|
@@ -87,12 +87,12 @@ const viVNGrid = {
|
|
|
87
87
|
// headerFilterOperatorIsEmpty: 'Is empty',
|
|
88
88
|
// headerFilterOperatorIsNotEmpty: 'Is not empty',
|
|
89
89
|
// headerFilterOperatorIsAnyOf: 'Is any of',
|
|
90
|
-
// headerFilterOperator
|
|
91
|
-
// headerFilterOperator
|
|
92
|
-
// headerFilterOperator
|
|
93
|
-
// headerFilterOperator
|
|
94
|
-
// headerFilterOperator
|
|
95
|
-
// headerFilterOperator
|
|
90
|
+
// 'headerFilterOperator=': 'Equals',
|
|
91
|
+
// 'headerFilterOperator!=': 'Not equals',
|
|
92
|
+
// 'headerFilterOperator>': 'Greater than',
|
|
93
|
+
// 'headerFilterOperator>=': 'Greater than or equal to',
|
|
94
|
+
// 'headerFilterOperator<': 'Less than',
|
|
95
|
+
// 'headerFilterOperator<=': 'Less than or equal to',
|
|
96
96
|
|
|
97
97
|
// Filter values text
|
|
98
98
|
filterValueAny: 'bất kỳ giá trị nào',
|
package/node/locales/zhCN.js
CHANGED
|
@@ -66,12 +66,12 @@ const zhCNGrid = {
|
|
|
66
66
|
filterOperatorIsEmpty: '为空',
|
|
67
67
|
filterOperatorIsNotEmpty: '不为空',
|
|
68
68
|
filterOperatorIsAnyOf: '属于',
|
|
69
|
-
// filterOperator
|
|
70
|
-
// filterOperator
|
|
71
|
-
// filterOperator
|
|
72
|
-
// filterOperator
|
|
73
|
-
// filterOperator
|
|
74
|
-
// filterOperator
|
|
69
|
+
// 'filterOperator=': '=',
|
|
70
|
+
// 'filterOperator!=': '!=',
|
|
71
|
+
// 'filterOperator>': '>',
|
|
72
|
+
// 'filterOperator>=': '>=',
|
|
73
|
+
// 'filterOperator<': '<',
|
|
74
|
+
// 'filterOperator<=': '<=',
|
|
75
75
|
|
|
76
76
|
// Header filter operators text
|
|
77
77
|
// headerFilterOperatorContains: 'Contains',
|
|
@@ -87,12 +87,12 @@ const zhCNGrid = {
|
|
|
87
87
|
// headerFilterOperatorIsEmpty: 'Is empty',
|
|
88
88
|
// headerFilterOperatorIsNotEmpty: 'Is not empty',
|
|
89
89
|
// headerFilterOperatorIsAnyOf: 'Is any of',
|
|
90
|
-
// headerFilterOperator
|
|
91
|
-
// headerFilterOperator
|
|
92
|
-
// headerFilterOperator
|
|
93
|
-
// headerFilterOperator
|
|
94
|
-
// headerFilterOperator
|
|
95
|
-
// headerFilterOperator
|
|
90
|
+
// 'headerFilterOperator=': 'Equals',
|
|
91
|
+
// 'headerFilterOperator!=': 'Not equals',
|
|
92
|
+
// 'headerFilterOperator>': 'Greater than',
|
|
93
|
+
// 'headerFilterOperator>=': 'Greater than or equal to',
|
|
94
|
+
// 'headerFilterOperator<': 'Less than',
|
|
95
|
+
// 'headerFilterOperator<=': 'Less than or equal to',
|
|
96
96
|
|
|
97
97
|
// Filter values text
|
|
98
98
|
filterValueAny: '任何',
|
package/node/locales/zhTW.js
CHANGED
|
@@ -66,12 +66,12 @@ const zhTWGrid = {
|
|
|
66
66
|
filterOperatorIsEmpty: '為空',
|
|
67
67
|
filterOperatorIsNotEmpty: '不為空',
|
|
68
68
|
filterOperatorIsAnyOf: '是其中之一',
|
|
69
|
-
// filterOperator
|
|
70
|
-
// filterOperator
|
|
71
|
-
// filterOperator
|
|
72
|
-
// filterOperator
|
|
73
|
-
// filterOperator
|
|
74
|
-
// filterOperator
|
|
69
|
+
// 'filterOperator=': '=',
|
|
70
|
+
// 'filterOperator!=': '!=',
|
|
71
|
+
// 'filterOperator>': '>',
|
|
72
|
+
// 'filterOperator>=': '>=',
|
|
73
|
+
// 'filterOperator<': '<',
|
|
74
|
+
// 'filterOperator<=': '<=',
|
|
75
75
|
|
|
76
76
|
// Header filter operators text
|
|
77
77
|
// headerFilterOperatorContains: 'Contains',
|
|
@@ -87,12 +87,12 @@ const zhTWGrid = {
|
|
|
87
87
|
// headerFilterOperatorIsEmpty: 'Is empty',
|
|
88
88
|
// headerFilterOperatorIsNotEmpty: 'Is not empty',
|
|
89
89
|
// headerFilterOperatorIsAnyOf: 'Is any of',
|
|
90
|
-
// headerFilterOperator
|
|
91
|
-
// headerFilterOperator
|
|
92
|
-
// headerFilterOperator
|
|
93
|
-
// headerFilterOperator
|
|
94
|
-
// headerFilterOperator
|
|
95
|
-
// headerFilterOperator
|
|
90
|
+
// 'headerFilterOperator=': 'Equals',
|
|
91
|
+
// 'headerFilterOperator!=': 'Not equals',
|
|
92
|
+
// 'headerFilterOperator>': 'Greater than',
|
|
93
|
+
// 'headerFilterOperator>=': 'Greater than or equal to',
|
|
94
|
+
// 'headerFilterOperator<': 'Less than',
|
|
95
|
+
// 'headerFilterOperator<=': 'Less than or equal to',
|
|
96
96
|
|
|
97
97
|
// Filter values text
|
|
98
98
|
filterValueAny: '任何值',
|
|
@@ -7,7 +7,7 @@ exports.GridLogicOperator = void 0;
|
|
|
7
7
|
/**
|
|
8
8
|
* Filter item definition interface.
|
|
9
9
|
* @demos
|
|
10
|
-
* - [Custom filter operator](/x/react-data-grid/filtering/#create-a-custom-operator)
|
|
10
|
+
* - [Custom filter operator](/x/react-data-grid/filtering/customization/#create-a-custom-operator)
|
|
11
11
|
*/
|
|
12
12
|
var GridLogicOperator = /*#__PURE__*/function (GridLogicOperator) {
|
|
13
13
|
GridLogicOperator["And"] = "and";
|
|
@@ -9,7 +9,7 @@ exports.EventManager = void 0;
|
|
|
9
9
|
// the Node.js (https://nodejs.org/api/events.html) polyfill used by webpack.
|
|
10
10
|
class EventManager {
|
|
11
11
|
constructor() {
|
|
12
|
-
this.maxListeners =
|
|
12
|
+
this.maxListeners = 20;
|
|
13
13
|
this.warnOnce = false;
|
|
14
14
|
this.events = {};
|
|
15
15
|
}
|
|
@@ -31,7 +31,7 @@ class EventManager {
|
|
|
31
31
|
const collectionSize = collection.highPriority.size + collection.regular.size;
|
|
32
32
|
if (collectionSize > this.maxListeners && !this.warnOnce) {
|
|
33
33
|
this.warnOnce = true;
|
|
34
|
-
console.warn([`Possible EventEmitter memory leak detected. ${collectionSize} ${eventName} listeners added
|
|
34
|
+
console.warn([`Possible EventEmitter memory leak detected. ${collectionSize} ${eventName} listeners added.`].join('\n'));
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.7.0",
|
|
4
4
|
"description": "The community edition of the data grid component (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@babel/runtime": "^7.21.0",
|
|
39
|
-
"@mui/utils": "^5.
|
|
39
|
+
"@mui/utils": "^5.13.1",
|
|
40
40
|
"clsx": "^1.2.1",
|
|
41
41
|
"prop-types": "^15.8.1",
|
|
42
42
|
"reselect": "^4.1.8"
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@mui/material": "^5.4.1",
|
|
46
46
|
"@mui/system": "^5.4.1",
|
|
47
|
-
"react": "^17.0.
|
|
48
|
-
"react-dom": "^17.0.
|
|
47
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
48
|
+
"react-dom": "^17.0.0 || ^18.0.0"
|
|
49
49
|
},
|
|
50
50
|
"setupFiles": [
|
|
51
51
|
"<rootDir>/src/setupTests.js"
|
|
@@ -2,7 +2,7 @@ import { GridClassKey } from '../constants/gridClasses';
|
|
|
2
2
|
export interface DataGridComponentNameToClassKey {
|
|
3
3
|
MuiDataGrid: GridClassKey;
|
|
4
4
|
}
|
|
5
|
-
declare module '@mui/material/styles
|
|
5
|
+
declare module '@mui/material/styles' {
|
|
6
6
|
interface ComponentNameToClassKey extends DataGridComponentNameToClassKey {
|
|
7
7
|
}
|
|
8
8
|
}
|
package/utils/EventManager.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// the Node.js (https://nodejs.org/api/events.html) polyfill used by webpack.
|
|
4
4
|
export class EventManager {
|
|
5
5
|
constructor() {
|
|
6
|
-
this.maxListeners =
|
|
6
|
+
this.maxListeners = 20;
|
|
7
7
|
this.warnOnce = false;
|
|
8
8
|
this.events = {};
|
|
9
9
|
}
|
|
@@ -25,7 +25,7 @@ export class EventManager {
|
|
|
25
25
|
const collectionSize = collection.highPriority.size + collection.regular.size;
|
|
26
26
|
if (collectionSize > this.maxListeners && !this.warnOnce) {
|
|
27
27
|
this.warnOnce = true;
|
|
28
|
-
console.warn([`Possible EventEmitter memory leak detected. ${collectionSize} ${eventName} listeners added
|
|
28
|
+
console.warn([`Possible EventEmitter memory leak detected. ${collectionSize} ${eventName} listeners added.`].join('\n'));
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
interface ScrollAreaProps {
|
|
3
|
-
scrollDirection: 'left' | 'right';
|
|
4
|
-
}
|
|
5
|
-
declare function GridScrollAreaRaw(props: ScrollAreaProps): JSX.Element | null;
|
|
6
|
-
declare namespace GridScrollAreaRaw {
|
|
7
|
-
var propTypes: any;
|
|
8
|
-
}
|
|
9
|
-
declare const GridScrollArea: React.MemoExoticComponent<typeof GridScrollAreaRaw>;
|
|
10
|
-
export { GridScrollArea };
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
6
|
-
import { styled } from '@mui/system';
|
|
7
|
-
import { useGridApiEventHandler } from '../hooks/utils/useGridApiEventHandler';
|
|
8
|
-
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
9
|
-
import { getDataGridUtilityClass, gridClasses } from '../constants/gridClasses';
|
|
10
|
-
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
11
|
-
import { gridDensityFactorSelector } from '../hooks/features/density/densitySelector';
|
|
12
|
-
import { useGridSelector } from '../hooks/utils/useGridSelector';
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
const CLIFF = 1;
|
|
15
|
-
const SLOP = 1.5;
|
|
16
|
-
const useUtilityClasses = ownerState => {
|
|
17
|
-
const {
|
|
18
|
-
scrollDirection,
|
|
19
|
-
classes
|
|
20
|
-
} = ownerState;
|
|
21
|
-
const slots = {
|
|
22
|
-
root: ['scrollArea', `scrollArea--${scrollDirection}`]
|
|
23
|
-
};
|
|
24
|
-
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
25
|
-
};
|
|
26
|
-
const GridScrollAreaRawRoot = styled('div', {
|
|
27
|
-
name: 'MuiDataGrid',
|
|
28
|
-
slot: 'ScrollArea',
|
|
29
|
-
overridesResolver: (props, styles) => [{
|
|
30
|
-
[`&.${gridClasses['scrollArea--left']}`]: styles['scrollArea--left']
|
|
31
|
-
}, {
|
|
32
|
-
[`&.${gridClasses['scrollArea--right']}`]: styles['scrollArea--right']
|
|
33
|
-
}, styles.scrollArea]
|
|
34
|
-
})(() => ({
|
|
35
|
-
position: 'absolute',
|
|
36
|
-
top: 0,
|
|
37
|
-
zIndex: 101,
|
|
38
|
-
width: 20,
|
|
39
|
-
bottom: 0,
|
|
40
|
-
[`&.${gridClasses['scrollArea--left']}`]: {
|
|
41
|
-
left: 0
|
|
42
|
-
},
|
|
43
|
-
[`&.${gridClasses['scrollArea--right']}`]: {
|
|
44
|
-
right: 0
|
|
45
|
-
}
|
|
46
|
-
}));
|
|
47
|
-
function GridScrollAreaRaw(props) {
|
|
48
|
-
const {
|
|
49
|
-
scrollDirection
|
|
50
|
-
} = props;
|
|
51
|
-
const rootRef = React.useRef(null);
|
|
52
|
-
const apiRef = useGridApiContext();
|
|
53
|
-
const timeout = React.useRef();
|
|
54
|
-
const [dragging, setDragging] = React.useState(false);
|
|
55
|
-
const densityFactor = useGridSelector(apiRef, gridDensityFactorSelector);
|
|
56
|
-
const scrollPosition = React.useRef({
|
|
57
|
-
left: 0,
|
|
58
|
-
top: 0
|
|
59
|
-
});
|
|
60
|
-
const rootProps = useGridRootProps();
|
|
61
|
-
const ownerState = _extends({}, rootProps, {
|
|
62
|
-
scrollDirection
|
|
63
|
-
});
|
|
64
|
-
const classes = useUtilityClasses(ownerState);
|
|
65
|
-
const headerHeight = Math.floor(rootProps.columnHeaderHeight * densityFactor);
|
|
66
|
-
const handleScrolling = React.useCallback(newScrollPosition => {
|
|
67
|
-
scrollPosition.current = newScrollPosition;
|
|
68
|
-
}, []);
|
|
69
|
-
const handleDragOver = React.useCallback(event => {
|
|
70
|
-
let offset;
|
|
71
|
-
if (scrollDirection === 'left') {
|
|
72
|
-
offset = event.clientX - rootRef.current.getBoundingClientRect().right;
|
|
73
|
-
} else if (scrollDirection === 'right') {
|
|
74
|
-
offset = Math.max(1, event.clientX - rootRef.current.getBoundingClientRect().left);
|
|
75
|
-
} else {
|
|
76
|
-
throw new Error('MUI: Wrong drag direction');
|
|
77
|
-
}
|
|
78
|
-
offset = (offset - CLIFF) * SLOP + CLIFF;
|
|
79
|
-
clearTimeout(timeout.current);
|
|
80
|
-
// Avoid freeze and inertia.
|
|
81
|
-
timeout.current = setTimeout(() => {
|
|
82
|
-
apiRef.current.scroll({
|
|
83
|
-
left: scrollPosition.current.left + offset,
|
|
84
|
-
top: scrollPosition.current.top
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
}, [scrollDirection, apiRef]);
|
|
88
|
-
React.useEffect(() => {
|
|
89
|
-
return () => {
|
|
90
|
-
clearTimeout(timeout.current);
|
|
91
|
-
};
|
|
92
|
-
}, []);
|
|
93
|
-
const toggleDragging = React.useCallback(() => {
|
|
94
|
-
setDragging(prevDragging => !prevDragging);
|
|
95
|
-
}, []);
|
|
96
|
-
useGridApiEventHandler(apiRef, 'scrollPositionChange', handleScrolling);
|
|
97
|
-
useGridApiEventHandler(apiRef, 'columnHeaderDragStart', toggleDragging);
|
|
98
|
-
useGridApiEventHandler(apiRef, 'columnHeaderDragEnd', toggleDragging);
|
|
99
|
-
return dragging ? /*#__PURE__*/_jsx(GridScrollAreaRawRoot, {
|
|
100
|
-
ref: rootRef,
|
|
101
|
-
className: clsx(classes.root),
|
|
102
|
-
ownerState: ownerState,
|
|
103
|
-
onDragOver: handleDragOver,
|
|
104
|
-
style: {
|
|
105
|
-
height: headerHeight
|
|
106
|
-
}
|
|
107
|
-
}) : null;
|
|
108
|
-
}
|
|
109
|
-
process.env.NODE_ENV !== "production" ? GridScrollAreaRaw.propTypes = {
|
|
110
|
-
// ----------------------------- Warning --------------------------------
|
|
111
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
112
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
113
|
-
// ----------------------------------------------------------------------
|
|
114
|
-
scrollDirection: PropTypes.oneOf(['left', 'right']).isRequired
|
|
115
|
-
} : void 0;
|
|
116
|
-
const GridScrollArea = /*#__PURE__*/React.memo(GridScrollAreaRaw);
|
|
117
|
-
export { GridScrollArea };
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
|
-
import clsx from 'clsx';
|
|
7
|
-
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
8
|
-
import { styled } from '@mui/system';
|
|
9
|
-
import { useGridApiEventHandler } from '../hooks/utils/useGridApiEventHandler';
|
|
10
|
-
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
11
|
-
import { getDataGridUtilityClass, gridClasses } from '../constants/gridClasses';
|
|
12
|
-
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
13
|
-
import { gridDensityFactorSelector } from '../hooks/features/density/densitySelector';
|
|
14
|
-
import { useGridSelector } from '../hooks/utils/useGridSelector';
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
var CLIFF = 1;
|
|
17
|
-
var SLOP = 1.5;
|
|
18
|
-
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
19
|
-
var scrollDirection = ownerState.scrollDirection,
|
|
20
|
-
classes = ownerState.classes;
|
|
21
|
-
var slots = {
|
|
22
|
-
root: ['scrollArea', "scrollArea--".concat(scrollDirection)]
|
|
23
|
-
};
|
|
24
|
-
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
25
|
-
};
|
|
26
|
-
var GridScrollAreaRawRoot = styled('div', {
|
|
27
|
-
name: 'MuiDataGrid',
|
|
28
|
-
slot: 'ScrollArea',
|
|
29
|
-
overridesResolver: function overridesResolver(props, styles) {
|
|
30
|
-
return [_defineProperty({}, "&.".concat(gridClasses['scrollArea--left']), styles['scrollArea--left']), _defineProperty({}, "&.".concat(gridClasses['scrollArea--right']), styles['scrollArea--right']), styles.scrollArea];
|
|
31
|
-
}
|
|
32
|
-
})(function () {
|
|
33
|
-
var _ref3;
|
|
34
|
-
return _ref3 = {
|
|
35
|
-
position: 'absolute',
|
|
36
|
-
top: 0,
|
|
37
|
-
zIndex: 101,
|
|
38
|
-
width: 20,
|
|
39
|
-
bottom: 0
|
|
40
|
-
}, _defineProperty(_ref3, "&.".concat(gridClasses['scrollArea--left']), {
|
|
41
|
-
left: 0
|
|
42
|
-
}), _defineProperty(_ref3, "&.".concat(gridClasses['scrollArea--right']), {
|
|
43
|
-
right: 0
|
|
44
|
-
}), _ref3;
|
|
45
|
-
});
|
|
46
|
-
function GridScrollAreaRaw(props) {
|
|
47
|
-
var scrollDirection = props.scrollDirection;
|
|
48
|
-
var rootRef = React.useRef(null);
|
|
49
|
-
var apiRef = useGridApiContext();
|
|
50
|
-
var timeout = React.useRef();
|
|
51
|
-
var _React$useState = React.useState(false),
|
|
52
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
53
|
-
dragging = _React$useState2[0],
|
|
54
|
-
setDragging = _React$useState2[1];
|
|
55
|
-
var densityFactor = useGridSelector(apiRef, gridDensityFactorSelector);
|
|
56
|
-
var scrollPosition = React.useRef({
|
|
57
|
-
left: 0,
|
|
58
|
-
top: 0
|
|
59
|
-
});
|
|
60
|
-
var rootProps = useGridRootProps();
|
|
61
|
-
var ownerState = _extends({}, rootProps, {
|
|
62
|
-
scrollDirection: scrollDirection
|
|
63
|
-
});
|
|
64
|
-
var classes = useUtilityClasses(ownerState);
|
|
65
|
-
var headerHeight = Math.floor(rootProps.columnHeaderHeight * densityFactor);
|
|
66
|
-
var handleScrolling = React.useCallback(function (newScrollPosition) {
|
|
67
|
-
scrollPosition.current = newScrollPosition;
|
|
68
|
-
}, []);
|
|
69
|
-
var handleDragOver = React.useCallback(function (event) {
|
|
70
|
-
var offset;
|
|
71
|
-
if (scrollDirection === 'left') {
|
|
72
|
-
offset = event.clientX - rootRef.current.getBoundingClientRect().right;
|
|
73
|
-
} else if (scrollDirection === 'right') {
|
|
74
|
-
offset = Math.max(1, event.clientX - rootRef.current.getBoundingClientRect().left);
|
|
75
|
-
} else {
|
|
76
|
-
throw new Error('MUI: Wrong drag direction');
|
|
77
|
-
}
|
|
78
|
-
offset = (offset - CLIFF) * SLOP + CLIFF;
|
|
79
|
-
clearTimeout(timeout.current);
|
|
80
|
-
// Avoid freeze and inertia.
|
|
81
|
-
timeout.current = setTimeout(function () {
|
|
82
|
-
apiRef.current.scroll({
|
|
83
|
-
left: scrollPosition.current.left + offset,
|
|
84
|
-
top: scrollPosition.current.top
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
}, [scrollDirection, apiRef]);
|
|
88
|
-
React.useEffect(function () {
|
|
89
|
-
return function () {
|
|
90
|
-
clearTimeout(timeout.current);
|
|
91
|
-
};
|
|
92
|
-
}, []);
|
|
93
|
-
var toggleDragging = React.useCallback(function () {
|
|
94
|
-
setDragging(function (prevDragging) {
|
|
95
|
-
return !prevDragging;
|
|
96
|
-
});
|
|
97
|
-
}, []);
|
|
98
|
-
useGridApiEventHandler(apiRef, 'scrollPositionChange', handleScrolling);
|
|
99
|
-
useGridApiEventHandler(apiRef, 'columnHeaderDragStart', toggleDragging);
|
|
100
|
-
useGridApiEventHandler(apiRef, 'columnHeaderDragEnd', toggleDragging);
|
|
101
|
-
return dragging ? /*#__PURE__*/_jsx(GridScrollAreaRawRoot, {
|
|
102
|
-
ref: rootRef,
|
|
103
|
-
className: clsx(classes.root),
|
|
104
|
-
ownerState: ownerState,
|
|
105
|
-
onDragOver: handleDragOver,
|
|
106
|
-
style: {
|
|
107
|
-
height: headerHeight
|
|
108
|
-
}
|
|
109
|
-
}) : null;
|
|
110
|
-
}
|
|
111
|
-
process.env.NODE_ENV !== "production" ? GridScrollAreaRaw.propTypes = {
|
|
112
|
-
// ----------------------------- Warning --------------------------------
|
|
113
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
114
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
115
|
-
// ----------------------------------------------------------------------
|
|
116
|
-
scrollDirection: PropTypes.oneOf(['left', 'right']).isRequired
|
|
117
|
-
} : void 0;
|
|
118
|
-
var GridScrollArea = /*#__PURE__*/React.memo(GridScrollAreaRaw);
|
|
119
|
-
export { GridScrollArea };
|