@mui/x-data-grid 5.14.0 → 5.15.2
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 +147 -5
- package/DataGrid/DataGrid.js +7 -1
- package/DataGrid/useDataGridProps.js +1 -0
- package/colDef/gridStringColDef.js +1 -1
- package/components/GridRow.js +5 -1
- package/components/base/GridOverlays.js +2 -2
- package/components/cell/GridEditInputCell.d.ts +2 -5
- package/components/cell/GridEditInputCell.js +13 -14
- package/components/cell/GridEditSingleSelectCell.d.ts +4 -0
- package/components/cell/GridEditSingleSelectCell.js +11 -4
- package/components/columnSelection/GridCellCheckboxRenderer.js +5 -0
- package/components/containers/GridRoot.js +4 -2
- package/components/toolbar/GridToolbarDensitySelector.js +13 -4
- package/components/toolbar/GridToolbarExportContainer.js +13 -2
- package/constants/envConstants.d.ts +1 -1
- package/constants/envConstants.js +2 -11
- package/constants/gridClasses.d.ts +16 -0
- package/constants/gridClasses.js +1 -1
- package/constants/localeTextConstants.js +1 -1
- package/hooks/features/dimensions/useGridDimensions.js +6 -1
- package/hooks/features/editRows/useGridCellEditing.new.d.ts +1 -1
- package/hooks/features/editRows/useGridCellEditing.new.js +26 -16
- package/hooks/features/editRows/useGridCellEditing.old.js +2 -2
- package/hooks/features/editRows/useGridEditing.new.d.ts +1 -1
- package/hooks/features/editRows/useGridEditing.new.js +4 -0
- package/hooks/features/editRows/useGridEditing.old.js +1 -1
- package/hooks/features/editRows/useGridRowEditing.new.d.ts +1 -1
- package/hooks/features/editRows/useGridRowEditing.new.js +16 -10
- package/hooks/features/export/utils.js +8 -1
- package/hooks/features/filter/gridFilterState.d.ts +12 -1
- package/hooks/features/filter/gridFilterUtils.d.ts +8 -5
- package/hooks/features/filter/gridFilterUtils.js +74 -43
- package/hooks/features/filter/useGridFilter.js +16 -3
- package/hooks/features/focus/useGridFocus.js +11 -6
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +42 -34
- package/hooks/features/pagination/useGridPageSize.js +3 -1
- package/hooks/features/rows/gridRowsSelector.d.ts +14 -0
- package/hooks/features/rows/gridRowsSelector.js +20 -1
- package/hooks/features/rows/gridRowsState.d.ts +8 -1
- package/hooks/features/rows/gridRowsUtils.d.ts +4 -0
- package/hooks/features/rows/gridRowsUtils.js +21 -3
- package/hooks/features/rows/index.d.ts +1 -1
- package/hooks/features/rows/index.js +1 -1
- package/hooks/features/rows/useGridRows.js +5 -2
- package/hooks/features/rows/useGridRowsMeta.js +19 -4
- package/hooks/features/rows/useGridRowsPreProcessors.js +2 -1
- package/hooks/features/scroll/useGridScroll.js +7 -2
- package/hooks/features/selection/useGridSelection.js +7 -3
- package/hooks/features/sorting/useGridSorting.js +8 -0
- package/hooks/features/statePersistence/gridStatePersistenceInterface.d.ts +3 -0
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +3 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +31 -16
- package/index.js +1 -1
- package/internals/index.d.ts +5 -1
- package/internals/index.js +4 -0
- package/legacy/DataGrid/DataGrid.js +7 -1
- package/legacy/DataGrid/useDataGridProps.js +1 -0
- package/legacy/colDef/gridStringColDef.js +1 -1
- package/legacy/components/GridRow.js +5 -1
- package/legacy/components/base/GridOverlays.js +2 -2
- package/legacy/components/cell/GridEditInputCell.js +13 -14
- package/legacy/components/cell/GridEditSingleSelectCell.js +11 -3
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +5 -0
- package/legacy/components/containers/GridRoot.js +4 -2
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +14 -5
- package/legacy/components/toolbar/GridToolbarExportContainer.js +15 -2
- package/legacy/constants/envConstants.js +2 -11
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/constants/localeTextConstants.js +1 -1
- package/legacy/hooks/features/dimensions/useGridDimensions.js +6 -1
- package/legacy/hooks/features/editRows/useGridCellEditing.new.js +27 -17
- package/legacy/hooks/features/editRows/useGridCellEditing.old.js +2 -2
- package/legacy/hooks/features/editRows/useGridEditing.new.js +4 -0
- package/legacy/hooks/features/editRows/useGridEditing.old.js +1 -1
- package/legacy/hooks/features/editRows/useGridRowEditing.new.js +16 -10
- package/legacy/hooks/features/export/utils.js +13 -1
- package/legacy/hooks/features/filter/gridFilterUtils.js +84 -55
- package/legacy/hooks/features/filter/useGridFilter.js +16 -3
- package/legacy/hooks/features/focus/useGridFocus.js +11 -6
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +47 -34
- package/legacy/hooks/features/pagination/useGridPageSize.js +3 -1
- package/legacy/hooks/features/rows/gridRowsSelector.js +23 -0
- package/legacy/hooks/features/rows/gridRowsUtils.js +21 -3
- package/legacy/hooks/features/rows/index.js +1 -1
- package/legacy/hooks/features/rows/useGridRows.js +5 -2
- package/legacy/hooks/features/rows/useGridRowsMeta.js +19 -4
- package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +2 -1
- package/legacy/hooks/features/scroll/useGridScroll.js +7 -2
- package/legacy/hooks/features/selection/useGridSelection.js +7 -3
- package/legacy/hooks/features/sorting/useGridSorting.js +8 -0
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +32 -16
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +4 -0
- package/legacy/locales/arSD.js +1 -1
- package/legacy/locales/bgBG.js +1 -1
- package/legacy/locales/csCZ.js +1 -1
- package/legacy/locales/daDK.js +1 -1
- package/legacy/locales/deDE.js +9 -9
- package/legacy/locales/elGR.js +1 -1
- package/legacy/locales/esES.js +1 -1
- package/legacy/locales/faIR.js +1 -1
- package/legacy/locales/fiFI.js +1 -1
- package/legacy/locales/frFR.js +1 -1
- package/legacy/locales/heIL.js +1 -1
- package/legacy/locales/huHU.js +1 -1
- package/legacy/locales/itIT.js +15 -15
- package/legacy/locales/jaJP.js +3 -3
- package/legacy/locales/koKR.js +34 -30
- package/legacy/locales/nbNO.js +1 -1
- package/legacy/locales/nlNL.js +1 -1
- package/legacy/locales/plPL.js +1 -1
- package/legacy/locales/ptBR.js +1 -1
- package/legacy/locales/roRO.js +1 -1
- package/legacy/locales/ruRU.js +1 -1
- package/legacy/locales/skSK.js +1 -1
- package/legacy/locales/svSE.js +1 -1
- package/legacy/locales/trTR.js +1 -1
- package/legacy/locales/ukUA.js +1 -1
- package/legacy/locales/viVN.js +1 -1
- package/legacy/locales/zhCN.js +37 -33
- package/legacy/locales/zhTW.js +1 -1
- package/legacy/utils/keyboardUtils.js +8 -5
- package/locales/arSD.js +1 -1
- package/locales/bgBG.js +1 -1
- package/locales/csCZ.js +1 -1
- package/locales/daDK.js +1 -1
- package/locales/deDE.js +9 -9
- package/locales/elGR.js +1 -1
- package/locales/esES.js +1 -1
- package/locales/faIR.js +1 -1
- package/locales/fiFI.js +1 -1
- package/locales/frFR.js +1 -1
- package/locales/heIL.js +1 -1
- package/locales/huHU.js +1 -1
- package/locales/itIT.js +15 -15
- package/locales/jaJP.js +3 -3
- package/locales/koKR.js +30 -30
- package/locales/nbNO.js +1 -1
- package/locales/nlNL.js +1 -1
- package/locales/plPL.js +1 -1
- package/locales/ptBR.js +1 -1
- package/locales/roRO.js +1 -1
- package/locales/ruRU.js +1 -1
- package/locales/skSK.js +1 -1
- package/locales/svSE.js +1 -1
- package/locales/trTR.js +1 -1
- package/locales/ukUA.js +1 -1
- package/locales/viVN.js +1 -1
- package/locales/zhCN.js +33 -33
- package/locales/zhTW.js +1 -1
- package/models/gridRows.d.ts +5 -0
- package/models/props/DataGridProps.d.ts +8 -3
- package/modern/DataGrid/DataGrid.js +7 -1
- package/modern/DataGrid/useDataGridProps.js +1 -0
- package/modern/colDef/gridStringColDef.js +1 -1
- package/modern/components/GridRow.js +5 -1
- package/modern/components/base/GridOverlays.js +2 -2
- package/modern/components/cell/GridEditInputCell.js +13 -14
- package/modern/components/cell/GridEditSingleSelectCell.js +11 -4
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +5 -0
- package/modern/components/containers/GridRoot.js +4 -2
- package/modern/components/toolbar/GridToolbarDensitySelector.js +11 -4
- package/modern/components/toolbar/GridToolbarExportContainer.js +11 -2
- package/modern/constants/envConstants.js +2 -11
- package/modern/constants/gridClasses.js +1 -1
- package/modern/constants/localeTextConstants.js +1 -1
- package/modern/hooks/features/dimensions/useGridDimensions.js +6 -1
- package/modern/hooks/features/editRows/useGridCellEditing.new.js +24 -16
- package/modern/hooks/features/editRows/useGridCellEditing.old.js +2 -2
- package/modern/hooks/features/editRows/useGridEditing.new.js +4 -0
- package/modern/hooks/features/editRows/useGridEditing.old.js +1 -1
- package/modern/hooks/features/editRows/useGridRowEditing.new.js +16 -10
- package/modern/hooks/features/export/utils.js +6 -1
- package/modern/hooks/features/filter/gridFilterUtils.js +73 -42
- package/modern/hooks/features/filter/useGridFilter.js +16 -3
- package/modern/hooks/features/focus/useGridFocus.js +11 -6
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +42 -30
- package/modern/hooks/features/pagination/useGridPageSize.js +3 -1
- package/modern/hooks/features/rows/gridRowsSelector.js +18 -1
- package/modern/hooks/features/rows/gridRowsUtils.js +19 -3
- package/modern/hooks/features/rows/index.js +1 -1
- package/modern/hooks/features/rows/useGridRows.js +5 -2
- package/modern/hooks/features/rows/useGridRowsMeta.js +17 -4
- package/modern/hooks/features/rows/useGridRowsPreProcessors.js +2 -1
- package/modern/hooks/features/scroll/useGridScroll.js +5 -2
- package/modern/hooks/features/selection/useGridSelection.js +7 -1
- package/modern/hooks/features/sorting/useGridSorting.js +8 -0
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +30 -15
- package/modern/index.js +1 -1
- package/modern/internals/index.js +4 -0
- package/modern/locales/arSD.js +1 -1
- package/modern/locales/bgBG.js +1 -1
- package/modern/locales/csCZ.js +1 -1
- package/modern/locales/daDK.js +1 -1
- package/modern/locales/deDE.js +9 -9
- package/modern/locales/elGR.js +1 -1
- package/modern/locales/esES.js +1 -1
- package/modern/locales/faIR.js +1 -1
- package/modern/locales/fiFI.js +1 -1
- package/modern/locales/frFR.js +1 -1
- package/modern/locales/heIL.js +1 -1
- package/modern/locales/huHU.js +1 -1
- package/modern/locales/itIT.js +15 -15
- package/modern/locales/jaJP.js +3 -3
- package/modern/locales/koKR.js +30 -30
- package/modern/locales/nbNO.js +1 -1
- package/modern/locales/nlNL.js +1 -1
- package/modern/locales/plPL.js +1 -1
- package/modern/locales/ptBR.js +1 -1
- package/modern/locales/roRO.js +1 -1
- package/modern/locales/ruRU.js +1 -1
- package/modern/locales/skSK.js +1 -1
- package/modern/locales/svSE.js +1 -1
- package/modern/locales/trTR.js +1 -1
- package/modern/locales/ukUA.js +1 -1
- package/modern/locales/viVN.js +1 -1
- package/modern/locales/zhCN.js +33 -33
- package/modern/locales/zhTW.js +1 -1
- package/modern/utils/keyboardUtils.js +7 -2
- package/node/DataGrid/DataGrid.js +7 -1
- package/node/DataGrid/useDataGridProps.js +1 -0
- package/node/colDef/gridStringColDef.js +1 -1
- package/node/components/GridRow.js +5 -1
- package/node/components/base/GridOverlays.js +2 -2
- package/node/components/cell/GridEditInputCell.js +15 -16
- package/node/components/cell/GridEditSingleSelectCell.js +10 -4
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +5 -0
- package/node/components/containers/GridRoot.js +3 -1
- package/node/components/toolbar/GridToolbarDensitySelector.js +13 -4
- package/node/components/toolbar/GridToolbarExportContainer.js +13 -2
- package/node/constants/envConstants.js +2 -13
- package/node/constants/gridClasses.js +1 -1
- package/node/constants/localeTextConstants.js +1 -1
- package/node/hooks/features/dimensions/useGridDimensions.js +7 -1
- package/node/hooks/features/editRows/useGridCellEditing.new.js +26 -16
- package/node/hooks/features/editRows/useGridCellEditing.old.js +2 -2
- package/node/hooks/features/editRows/useGridEditing.new.js +4 -0
- package/node/hooks/features/editRows/useGridEditing.old.js +1 -1
- package/node/hooks/features/editRows/useGridRowEditing.new.js +16 -10
- package/node/hooks/features/export/utils.js +7 -0
- package/node/hooks/features/filter/gridFilterUtils.js +81 -47
- package/node/hooks/features/filter/useGridFilter.js +15 -2
- package/node/hooks/features/focus/useGridFocus.js +11 -6
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +43 -34
- package/node/hooks/features/pagination/useGridPageSize.js +4 -1
- package/node/hooks/features/rows/gridRowsSelector.js +24 -2
- package/node/hooks/features/rows/gridRowsUtils.js +23 -2
- package/node/hooks/features/rows/index.js +70 -12
- package/node/hooks/features/rows/useGridRows.js +5 -2
- package/node/hooks/features/rows/useGridRowsMeta.js +20 -4
- package/node/hooks/features/rows/useGridRowsPreProcessors.js +2 -1
- package/node/hooks/features/scroll/useGridScroll.js +7 -1
- package/node/hooks/features/selection/useGridSelection.js +7 -3
- package/node/hooks/features/sorting/useGridSorting.js +8 -0
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +31 -16
- package/node/index.js +1 -1
- package/node/internals/index.js +36 -0
- package/node/locales/arSD.js +1 -1
- package/node/locales/bgBG.js +1 -1
- package/node/locales/csCZ.js +1 -1
- package/node/locales/daDK.js +1 -1
- package/node/locales/deDE.js +9 -9
- package/node/locales/elGR.js +1 -1
- package/node/locales/esES.js +1 -1
- package/node/locales/faIR.js +1 -1
- package/node/locales/fiFI.js +1 -1
- package/node/locales/frFR.js +1 -1
- package/node/locales/heIL.js +1 -1
- package/node/locales/huHU.js +1 -1
- package/node/locales/itIT.js +15 -15
- package/node/locales/jaJP.js +3 -3
- package/node/locales/koKR.js +30 -30
- package/node/locales/nbNO.js +1 -1
- package/node/locales/nlNL.js +1 -1
- package/node/locales/plPL.js +1 -1
- package/node/locales/ptBR.js +1 -1
- package/node/locales/roRO.js +1 -1
- package/node/locales/ruRU.js +1 -1
- package/node/locales/skSK.js +1 -1
- package/node/locales/svSE.js +1 -1
- package/node/locales/trTR.js +1 -1
- package/node/locales/ukUA.js +1 -1
- package/node/locales/viVN.js +1 -1
- package/node/locales/zhCN.js +33 -33
- package/node/locales/zhTW.js +1 -1
- package/node/utils/keyboardUtils.js +10 -4
- package/package.json +1 -1
- package/utils/keyboardUtils.d.ts +2 -2
- package/utils/keyboardUtils.js +7 -2
package/modern/locales/zhCN.js
CHANGED
|
@@ -21,15 +21,15 @@ const zhCNGrid = {
|
|
|
21
21
|
toolbarFiltersTooltipShow: '显示筛选器',
|
|
22
22
|
toolbarFiltersTooltipActive: count => `${count} 个筛选器`,
|
|
23
23
|
// Quick filter toolbar field
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
toolbarQuickFilterPlaceholder: '搜索…',
|
|
25
|
+
toolbarQuickFilterLabel: '搜索',
|
|
26
|
+
toolbarQuickFilterDeleteIconLabel: '清除',
|
|
27
27
|
// Export selector toolbar button text
|
|
28
28
|
toolbarExport: '导出',
|
|
29
29
|
toolbarExportLabel: '导出',
|
|
30
30
|
toolbarExportCSV: '导出至CSV',
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
toolbarExportPrint: '打印',
|
|
32
|
+
toolbarExportExcel: '导出至Excel',
|
|
33
33
|
// Columns panel text
|
|
34
34
|
columnsPanelTextFieldLabel: '搜索列',
|
|
35
35
|
columnsPanelTextFieldPlaceholder: '列名',
|
|
@@ -39,7 +39,7 @@ const zhCNGrid = {
|
|
|
39
39
|
// Filter panel text
|
|
40
40
|
filterPanelAddFilter: '添加筛选器',
|
|
41
41
|
filterPanelDeleteIconLabel: '删除',
|
|
42
|
-
|
|
42
|
+
filterPanelLinkOperator: '逻辑操作器',
|
|
43
43
|
filterPanelOperators: '操作器',
|
|
44
44
|
// TODO v6: rename to filterPanelOperator
|
|
45
45
|
filterPanelOperatorAnd: '与',
|
|
@@ -60,7 +60,7 @@ const zhCNGrid = {
|
|
|
60
60
|
filterOperatorOnOrBefore: '正在前面',
|
|
61
61
|
filterOperatorIsEmpty: '为空',
|
|
62
62
|
filterOperatorIsNotEmpty: '不为空',
|
|
63
|
-
|
|
63
|
+
filterOperatorIsAnyOf: '属于',
|
|
64
64
|
// Filter values text
|
|
65
65
|
filterValueAny: '任何',
|
|
66
66
|
filterValueTrue: '真',
|
|
@@ -85,39 +85,39 @@ const zhCNGrid = {
|
|
|
85
85
|
footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} / ${totalCount.toLocaleString()}`,
|
|
86
86
|
// Checkbox selection text
|
|
87
87
|
checkboxSelectionHeaderName: '多选框',
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
checkboxSelectionSelectAllRows: '全选行',
|
|
89
|
+
checkboxSelectionUnselectAllRows: '反选所有行',
|
|
90
|
+
checkboxSelectionSelectRow: '选择行',
|
|
91
|
+
checkboxSelectionUnselectRow: '反选行',
|
|
92
92
|
// Boolean cell text
|
|
93
93
|
booleanCellTrueLabel: '真',
|
|
94
|
-
booleanCellFalseLabel: '假'
|
|
95
|
-
//
|
|
94
|
+
booleanCellFalseLabel: '假',
|
|
95
|
+
// Actions cell more text
|
|
96
|
+
actionsCellMore: '更多',
|
|
96
97
|
// Column pinning text
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
pinToLeft: '固定到左侧',
|
|
99
|
+
pinToRight: '固定到右侧',
|
|
100
|
+
unpin: '取消固定',
|
|
100
101
|
// Tree Data
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
treeDataGroupingHeaderName: '组',
|
|
103
|
+
treeDataExpand: '查看子项目',
|
|
104
|
+
treeDataCollapse: '隐藏子项目',
|
|
104
105
|
// Grouping columns
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
groupingColumnHeaderName: '组',
|
|
107
|
+
groupColumn: name => `用${name}分组`,
|
|
108
|
+
unGroupColumn: name => `不再用${name}分组`,
|
|
108
109
|
// Master/detail
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
detailPanelToggle: '详细信息',
|
|
111
|
+
expandDetailPanel: '显示',
|
|
112
|
+
collapseDetailPanel: '折叠',
|
|
112
113
|
// Row reordering text
|
|
113
|
-
|
|
114
|
+
rowReorderingHeaderName: '重新排列行',
|
|
114
115
|
// Aggregation
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
aggregationMenuItemHeader: '集合',
|
|
117
|
+
aggregationFunctionLabelSum: '总数',
|
|
118
|
+
aggregationFunctionLabelAvg: '平均',
|
|
119
|
+
aggregationFunctionLabelMin: '最小',
|
|
120
|
+
aggregationFunctionLabelMax: '最大',
|
|
121
|
+
aggregationFunctionLabelSize: '大小'
|
|
122
122
|
};
|
|
123
123
|
export const zhCN = getGridLocalization(zhCNGrid, zhCNCore);
|
package/modern/locales/zhTW.js
CHANGED
|
@@ -21,7 +21,7 @@ const zhTWGrid = {
|
|
|
21
21
|
toolbarFiltersTooltipShow: '顯示篩選器',
|
|
22
22
|
toolbarFiltersTooltipActive: count => `${count} 個篩選器`,
|
|
23
23
|
// Quick filter toolbar field
|
|
24
|
-
toolbarQuickFilterPlaceholder: '
|
|
24
|
+
toolbarQuickFilterPlaceholder: '搜尋…',
|
|
25
25
|
toolbarQuickFilterLabel: '搜尋',
|
|
26
26
|
toolbarQuickFilterDeleteIconLabel: '清除',
|
|
27
27
|
// Export selector toolbar button text
|
|
@@ -10,13 +10,18 @@ export const isHomeOrEndKeys = key => key === 'Home' || key === 'End';
|
|
|
10
10
|
export const isPageKeys = key => key.indexOf('Page') === 0;
|
|
11
11
|
export const isDeleteKeys = key => key === 'Delete' || key === 'Backspace'; // Non printable keys have a name, e.g. "ArrowRight", see the whole list:
|
|
12
12
|
// https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
|
|
13
|
+
// We need to ignore shortcuts, for example: select all:
|
|
14
|
+
// - Windows: Ctrl+A, event.ctrlKey is true
|
|
15
|
+
// - macOS: ⌘ Command+A, event.metaKey is true
|
|
13
16
|
|
|
14
|
-
export
|
|
17
|
+
export function isPrintableKey(event) {
|
|
18
|
+
return event.key.length === 1 && event.ctrlKey === false && event.metaKey === false;
|
|
19
|
+
}
|
|
15
20
|
export const GRID_MULTIPLE_SELECTION_KEYS = ['Meta', 'Control', 'Shift'];
|
|
16
21
|
export const GRID_CELL_EXIT_EDIT_MODE_KEYS = ['Enter', 'Escape', 'Tab'];
|
|
17
22
|
export const GRID_CELL_EDIT_COMMIT_KEYS = ['Enter', 'Tab'];
|
|
18
23
|
export const isMultipleKey = key => GRID_MULTIPLE_SELECTION_KEYS.indexOf(key) > -1;
|
|
19
|
-
export const isCellEnterEditModeKeys =
|
|
24
|
+
export const isCellEnterEditModeKeys = event => isEnterKey(event.key) || isDeleteKeys(event.key) || isPrintableKey(event);
|
|
20
25
|
export const isCellExitEditModeKeys = key => GRID_CELL_EXIT_EDIT_MODE_KEYS.indexOf(key) > -1;
|
|
21
26
|
export const isCellEditCommitKeys = key => GRID_CELL_EDIT_COMMIT_KEYS.indexOf(key) > -1;
|
|
22
27
|
export const isNavigationKey = key => isHomeOrEndKeys(key) || isArrowKeys(key) || isPageKeys(key) || isSpaceKey(key);
|
|
@@ -178,6 +178,12 @@ DataGridRaw.propTypes = {
|
|
|
178
178
|
*/
|
|
179
179
|
disableExtendRowFullWidth: _propTypes.default.bool,
|
|
180
180
|
|
|
181
|
+
/**
|
|
182
|
+
* If `true`, modification to a cell will not be discarded if the mode is changed from "edit" to "view" while processing props.
|
|
183
|
+
* @default false
|
|
184
|
+
*/
|
|
185
|
+
disableIgnoreModificationsIfProcessingProps: _propTypes.default.bool,
|
|
186
|
+
|
|
181
187
|
/**
|
|
182
188
|
* If `true`, the selection on click on a row or cell is disabled.
|
|
183
189
|
* @default false
|
|
@@ -662,7 +668,7 @@ DataGridRaw.propTypes = {
|
|
|
662
668
|
* @param {GridState} state The new state.
|
|
663
669
|
* @param {MuiEvent<{}>} event The event object.
|
|
664
670
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
665
|
-
* @
|
|
671
|
+
* @ignore - do not document.
|
|
666
672
|
*/
|
|
667
673
|
onStateChange: _propTypes.default.func,
|
|
668
674
|
|
|
@@ -60,6 +60,7 @@ const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
60
60
|
disableMultipleColumnsSorting: false,
|
|
61
61
|
disableSelectionOnClick: false,
|
|
62
62
|
disableVirtualization: false,
|
|
63
|
+
disableIgnoreModificationsIfProcessingProps: false,
|
|
63
64
|
editMode: _models.GridEditModes.Cell,
|
|
64
65
|
filterMode: _models.GridFeatureModeConstant.client,
|
|
65
66
|
headerHeight: 56,
|
|
@@ -147,7 +147,11 @@ function GridRow(props) {
|
|
|
147
147
|
// doesn't care about pagination and considers the rows from the current page only, so the
|
|
148
148
|
// first row always has index=0. We need to subtract the index of the first row to make it
|
|
149
149
|
// compatible with the index used by the virtualization.
|
|
150
|
-
apiRef.current.
|
|
150
|
+
const rowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(rowId); // pinned rows are not part of the visible rows
|
|
151
|
+
|
|
152
|
+
if (rowIndex != null) {
|
|
153
|
+
apiRef.current.unstable_setLastMeasuredRowIndex(rowIndex);
|
|
154
|
+
}
|
|
151
155
|
}
|
|
152
156
|
|
|
153
157
|
const rootElement = ref.current;
|
|
@@ -67,8 +67,8 @@ function GridOverlayWrapper(props) {
|
|
|
67
67
|
position: 'absolute',
|
|
68
68
|
top: headerHeight,
|
|
69
69
|
bottom: height === 'auto' ? 0 : undefined,
|
|
70
|
-
zIndex:
|
|
71
|
-
// should be above pinned columns and detail panel
|
|
70
|
+
zIndex: 4,
|
|
71
|
+
// should be above pinned columns, pinned rows and detail panel
|
|
72
72
|
pointerEvents: 'none'
|
|
73
73
|
}
|
|
74
74
|
}, props));
|
|
@@ -5,8 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.GridEditInputCell =
|
|
9
|
-
exports.renderEditInputCell = void 0;
|
|
8
|
+
exports.renderEditInputCell = exports.GridEditInputCell = void 0;
|
|
10
9
|
|
|
11
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
12
11
|
|
|
@@ -65,8 +64,7 @@ const GridEditInputCellRoot = (0, _styles.styled)(_InputBase.default, {
|
|
|
65
64
|
height: '100%'
|
|
66
65
|
}
|
|
67
66
|
}));
|
|
68
|
-
|
|
69
|
-
function GridEditInputCell(props) {
|
|
67
|
+
const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
70
68
|
var _rootProps$experiment;
|
|
71
69
|
|
|
72
70
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
@@ -112,6 +110,7 @@ function GridEditInputCell(props) {
|
|
|
112
110
|
}
|
|
113
111
|
}, [hasFocus]);
|
|
114
112
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridEditInputCellRoot, (0, _extends2.default)({
|
|
113
|
+
ref: ref,
|
|
115
114
|
inputRef: inputRef,
|
|
116
115
|
className: classes.root,
|
|
117
116
|
fullWidth: true,
|
|
@@ -120,8 +119,8 @@ function GridEditInputCell(props) {
|
|
|
120
119
|
onChange: handleChange,
|
|
121
120
|
endAdornment: isProcessingProps ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.GridLoadIcon, {}) : undefined
|
|
122
121
|
}, other));
|
|
123
|
-
}
|
|
124
|
-
|
|
122
|
+
});
|
|
123
|
+
exports.GridEditInputCell = GridEditInputCell;
|
|
125
124
|
process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
126
125
|
// ----------------------------- Warning --------------------------------
|
|
127
126
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -132,23 +131,23 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
|
132
131
|
* GridApi that let you manipulate the grid.
|
|
133
132
|
* @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
|
|
134
133
|
*/
|
|
135
|
-
api: _propTypes.default.any
|
|
134
|
+
api: _propTypes.default.any,
|
|
136
135
|
|
|
137
136
|
/**
|
|
138
137
|
* The mode of the cell.
|
|
139
138
|
*/
|
|
140
|
-
cellMode: _propTypes.default.oneOf(['edit', 'view'])
|
|
139
|
+
cellMode: _propTypes.default.oneOf(['edit', 'view']),
|
|
141
140
|
|
|
142
141
|
/**
|
|
143
142
|
* The column of the row that the current cell belongs to.
|
|
144
143
|
*/
|
|
145
|
-
colDef: _propTypes.default.object
|
|
144
|
+
colDef: _propTypes.default.object,
|
|
146
145
|
debounceMs: _propTypes.default.number,
|
|
147
146
|
|
|
148
147
|
/**
|
|
149
148
|
* The column field of the cell that triggered the event.
|
|
150
149
|
*/
|
|
151
|
-
field: _propTypes.default.string
|
|
150
|
+
field: _propTypes.default.string,
|
|
152
151
|
|
|
153
152
|
/**
|
|
154
153
|
* The cell value formatted with the column valueFormatter.
|
|
@@ -162,17 +161,17 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
|
162
161
|
* @returns {any} The cell value.
|
|
163
162
|
* @deprecated Use `params.row` to directly access the fields you want instead.
|
|
164
163
|
*/
|
|
165
|
-
getValue: _propTypes.default.func
|
|
164
|
+
getValue: _propTypes.default.func,
|
|
166
165
|
|
|
167
166
|
/**
|
|
168
167
|
* If true, the cell is the active element.
|
|
169
168
|
*/
|
|
170
|
-
hasFocus: _propTypes.default.bool
|
|
169
|
+
hasFocus: _propTypes.default.bool,
|
|
171
170
|
|
|
172
171
|
/**
|
|
173
172
|
* The grid row id.
|
|
174
173
|
*/
|
|
175
|
-
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
|
|
174
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
176
175
|
|
|
177
176
|
/**
|
|
178
177
|
* If true, the cell is editable.
|
|
@@ -192,17 +191,17 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
|
192
191
|
/**
|
|
193
192
|
* The row model of the row that the current cell belongs to.
|
|
194
193
|
*/
|
|
195
|
-
row: _propTypes.default.object
|
|
194
|
+
row: _propTypes.default.object,
|
|
196
195
|
|
|
197
196
|
/**
|
|
198
197
|
* The node of the row that the current cell belongs to.
|
|
199
198
|
*/
|
|
200
|
-
rowNode: _propTypes.default.object
|
|
199
|
+
rowNode: _propTypes.default.object,
|
|
201
200
|
|
|
202
201
|
/**
|
|
203
202
|
* the tabIndex value.
|
|
204
203
|
*/
|
|
205
|
-
tabIndex: _propTypes.default.oneOf([-1, 0])
|
|
204
|
+
tabIndex: _propTypes.default.oneOf([-1, 0]),
|
|
206
205
|
|
|
207
206
|
/**
|
|
208
207
|
* The cell value, but if the column has valueGetter, use getValue.
|
|
@@ -32,7 +32,7 @@ var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
|
32
32
|
|
|
33
33
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
34
34
|
|
|
35
|
-
const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "getValue", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange"];
|
|
35
|
+
const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "getValue", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange", "initialOpen"];
|
|
36
36
|
|
|
37
37
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
38
38
|
|
|
@@ -52,6 +52,7 @@ const renderSingleSelectOptions = (option, OptionComponent) => {
|
|
|
52
52
|
function GridEditSingleSelectCell(props) {
|
|
53
53
|
var _rootProps$components, _baseSelectProps$nati, _rootProps$components2;
|
|
54
54
|
|
|
55
|
+
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
55
56
|
const {
|
|
56
57
|
id,
|
|
57
58
|
value,
|
|
@@ -61,14 +62,14 @@ function GridEditSingleSelectCell(props) {
|
|
|
61
62
|
colDef,
|
|
62
63
|
hasFocus,
|
|
63
64
|
error,
|
|
64
|
-
onValueChange
|
|
65
|
+
onValueChange,
|
|
66
|
+
initialOpen = rootProps.editMode === _gridEditRowModel.GridEditModes.Cell
|
|
65
67
|
} = props,
|
|
66
68
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
67
69
|
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
68
70
|
const ref = React.useRef();
|
|
69
71
|
const inputRef = React.useRef();
|
|
70
|
-
const
|
|
71
|
-
const [open, setOpen] = React.useState(rootProps.editMode === 'cell');
|
|
72
|
+
const [open, setOpen] = React.useState(initialOpen);
|
|
72
73
|
const baseSelectProps = ((_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseSelect) || {};
|
|
73
74
|
const isSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : false;
|
|
74
75
|
let valueOptionsFormatted;
|
|
@@ -243,6 +244,11 @@ process.env.NODE_ENV !== "production" ? GridEditSingleSelectCell.propTypes = {
|
|
|
243
244
|
*/
|
|
244
245
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
245
246
|
|
|
247
|
+
/**
|
|
248
|
+
* If true, the select opens by default.
|
|
249
|
+
*/
|
|
250
|
+
initialOpen: _propTypes.default.bool,
|
|
251
|
+
|
|
246
252
|
/**
|
|
247
253
|
* If true, the cell is editable.
|
|
248
254
|
*/
|
|
@@ -108,6 +108,11 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
108
108
|
|
|
109
109
|
const isSelectable = apiRef.current.isRowSelectable(id);
|
|
110
110
|
const label = apiRef.current.getLocaleText(isChecked ? 'checkboxSelectionUnselectRow' : 'checkboxSelectionSelectRow');
|
|
111
|
+
|
|
112
|
+
if (rowNode.isPinned) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
|
|
111
116
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseCheckbox, (0, _extends2.default)({
|
|
112
117
|
ref: handleRef,
|
|
113
118
|
tabIndex: tabIndex,
|
|
@@ -70,6 +70,7 @@ const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
|
|
|
70
70
|
const densityValue = (0, _useGridSelector.useGridSelector)(apiRef, _densitySelector.gridDensityValueSelector);
|
|
71
71
|
const rootContainerRef = React.useRef(null);
|
|
72
72
|
const handleRef = (0, _utils.useForkRef)(rootContainerRef, ref);
|
|
73
|
+
const pinnedRowsCount = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowsSelector.gridPinnedRowsCountSelector);
|
|
73
74
|
const ownerState = {
|
|
74
75
|
density: densityValue,
|
|
75
76
|
classes: rootProps.classes,
|
|
@@ -97,7 +98,8 @@ const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
|
|
|
97
98
|
className: (0, _clsx.default)(className, classes.root),
|
|
98
99
|
role: "grid",
|
|
99
100
|
"aria-colcount": visibleColumns.length,
|
|
100
|
-
"aria-rowcount": totalRowCount
|
|
101
|
+
"aria-rowcount": totalRowCount + pinnedRowsCount + 1 // +1 for the header row
|
|
102
|
+
,
|
|
101
103
|
"aria-multiselectable": !rootProps.disableMultipleSelection,
|
|
102
104
|
"aria-label": rootProps['aria-label'],
|
|
103
105
|
"aria-labelledby": rootProps['aria-labelledby']
|
|
@@ -87,11 +87,20 @@ const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function GridTo
|
|
|
87
87
|
}, [densityValue, rootProps]);
|
|
88
88
|
|
|
89
89
|
const handleDensitySelectorOpen = event => {
|
|
90
|
-
setOpen(
|
|
90
|
+
setOpen(prevOpen => !prevOpen);
|
|
91
91
|
onClick == null ? void 0 : onClick(event);
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
-
const
|
|
94
|
+
const handleDensitySelectorClickAway = event => {
|
|
95
|
+
var _buttonRef$current;
|
|
96
|
+
|
|
97
|
+
if (buttonRef.current === event.target || // if user clicked on the icon
|
|
98
|
+
(_buttonRef$current = buttonRef.current) != null && _buttonRef$current.contains(event.target)) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
setOpen(false);
|
|
103
|
+
};
|
|
95
104
|
|
|
96
105
|
const handleDensityUpdate = newDensity => {
|
|
97
106
|
apiRef.current.setDensity(newDensity);
|
|
@@ -104,7 +113,7 @@ const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function GridTo
|
|
|
104
113
|
}
|
|
105
114
|
|
|
106
115
|
if ((0, _keyboardUtils.isHideMenuKey)(event.key)) {
|
|
107
|
-
|
|
116
|
+
setOpen(false);
|
|
108
117
|
}
|
|
109
118
|
}; // Disable the button if the corresponding is disabled
|
|
110
119
|
|
|
@@ -137,7 +146,7 @@ const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function GridTo
|
|
|
137
146
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridMenu.GridMenu, {
|
|
138
147
|
open: open,
|
|
139
148
|
target: buttonRef.current,
|
|
140
|
-
onClickAway:
|
|
149
|
+
onClickAway: handleDensitySelectorClickAway,
|
|
141
150
|
position: "bottom-start",
|
|
142
151
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuList.default, {
|
|
143
152
|
id: densityMenuId,
|
|
@@ -52,7 +52,7 @@ const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function GridTo
|
|
|
52
52
|
const handleRef = (0, _utils.useForkRef)(ref, buttonRef);
|
|
53
53
|
|
|
54
54
|
const handleMenuOpen = event => {
|
|
55
|
-
setOpen(
|
|
55
|
+
setOpen(prevOpen => !prevOpen);
|
|
56
56
|
onClick == null ? void 0 : onClick(event);
|
|
57
57
|
};
|
|
58
58
|
|
|
@@ -68,6 +68,17 @@ const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function GridTo
|
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
+
const handleMenuClickAway = event => {
|
|
72
|
+
var _buttonRef$current;
|
|
73
|
+
|
|
74
|
+
if (buttonRef.current === event.target || // if user clicked on the icon
|
|
75
|
+
(_buttonRef$current = buttonRef.current) != null && _buttonRef$current.contains(event.target)) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
setOpen(false);
|
|
80
|
+
};
|
|
81
|
+
|
|
71
82
|
if (children == null) {
|
|
72
83
|
return null;
|
|
73
84
|
}
|
|
@@ -89,7 +100,7 @@ const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function GridTo
|
|
|
89
100
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridMenu.GridMenu, {
|
|
90
101
|
open: open,
|
|
91
102
|
target: buttonRef.current,
|
|
92
|
-
onClickAway:
|
|
103
|
+
onClickAway: handleMenuClickAway,
|
|
93
104
|
position: "bottom-start",
|
|
94
105
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuList.default, {
|
|
95
106
|
id: menuId,
|
|
@@ -4,10 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.GRID_EXPERIMENTAL_ENABLED = void 0;
|
|
7
|
-
|
|
8
|
-
var _utils = require("../utils/utils");
|
|
9
|
-
|
|
10
|
-
// A guide to feature toggling.
|
|
7
|
+
// A guide to feature toggling (deprecated)
|
|
11
8
|
//
|
|
12
9
|
// The feature toggle is:
|
|
13
10
|
// - independent from the NODE_ENV
|
|
@@ -24,13 +21,5 @@ var _utils = require("../utils/utils");
|
|
|
24
21
|
//
|
|
25
22
|
// Developers (users) are discouraged to enable the experimental feature by setting the GRID_EXPERIMENTAL_ENABLED env.
|
|
26
23
|
// Instead, prefer exposing experimental APIs, for instance, a prop or a new `unstable_` module.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (typeof process !== 'undefined' && process.env.GRID_EXPERIMENTAL_ENABLED !== undefined && (0, _utils.localStorageAvailable)() && window.localStorage.getItem('GRID_EXPERIMENTAL_ENABLED')) {
|
|
30
|
-
experimentalEnabled = window.localStorage.getItem('GRID_EXPERIMENTAL_ENABLED') === 'true';
|
|
31
|
-
} else if (typeof process !== 'undefined') {
|
|
32
|
-
experimentalEnabled = process.env.GRID_EXPERIMENTAL_ENABLED === 'true';
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const GRID_EXPERIMENTAL_ENABLED = experimentalEnabled;
|
|
24
|
+
const GRID_EXPERIMENTAL_ENABLED = false;
|
|
36
25
|
exports.GRID_EXPERIMENTAL_ENABLED = GRID_EXPERIMENTAL_ENABLED;
|
|
@@ -12,5 +12,5 @@ function getDataGridUtilityClass(slot) {
|
|
|
12
12
|
return (0, _material.generateUtilityClass)('MuiDataGrid', slot);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const gridClasses = (0, _material.generateUtilityClasses)('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'autoHeight', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell', 'cellContent', 'cellCheckbox', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLinkOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'row', 'row--editable', 'row--editing', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle']);
|
|
15
|
+
const gridClasses = (0, _material.generateUtilityClasses)('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'autoHeight', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell', 'cellContent', 'cellCheckbox', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLinkOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'row', 'row--editable', 'row--editing', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);
|
|
16
16
|
exports.gridClasses = gridClasses;
|
|
@@ -25,7 +25,7 @@ const GRID_DEFAULT_LOCALE_TEXT = {
|
|
|
25
25
|
toolbarFiltersTooltipShow: 'Show filters',
|
|
26
26
|
toolbarFiltersTooltipActive: count => count !== 1 ? `${count} active filters` : `${count} active filter`,
|
|
27
27
|
// Quick filter toolbar field
|
|
28
|
-
toolbarQuickFilterPlaceholder: 'Search
|
|
28
|
+
toolbarQuickFilterPlaceholder: 'Search…',
|
|
29
29
|
toolbarQuickFilterLabel: 'Search',
|
|
30
30
|
toolbarQuickFilterDeleteIconLabel: 'Clear',
|
|
31
31
|
// Export selector toolbar button text
|
|
@@ -25,6 +25,8 @@ var _useGridVisibleRows = require("../../utils/useGridVisibleRows");
|
|
|
25
25
|
|
|
26
26
|
var _gridRowsMetaSelector = require("../rows/gridRowsMetaSelector");
|
|
27
27
|
|
|
28
|
+
var _gridRowsUtils = require("../rows/gridRowsUtils");
|
|
29
|
+
|
|
28
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
31
|
|
|
30
32
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -68,6 +70,7 @@ function useGridDimensions(apiRef, props) {
|
|
|
68
70
|
|
|
69
71
|
const rootElement = (_apiRef$current$rootE = apiRef.current.rootElementRef) == null ? void 0 : _apiRef$current$rootE.current;
|
|
70
72
|
const columnsTotalWidth = (0, _columns.gridColumnsTotalWidthSelector)(apiRef);
|
|
73
|
+
const pinnedRowsHeight = (0, _gridRowsUtils.calculatePinnedRowsHeight)(apiRef);
|
|
71
74
|
|
|
72
75
|
if (!rootDimensionsRef.current) {
|
|
73
76
|
return;
|
|
@@ -113,7 +116,10 @@ function useGridDimensions(apiRef, props) {
|
|
|
113
116
|
width: Math.round(columnsTotalWidth),
|
|
114
117
|
height: rowsMeta.currentPageTotalHeight
|
|
115
118
|
},
|
|
116
|
-
container:
|
|
119
|
+
container: {
|
|
120
|
+
width: viewportOuterSize.width,
|
|
121
|
+
height: viewportOuterSize.height - pinnedRowsHeight.top - pinnedRowsHeight.bottom
|
|
122
|
+
},
|
|
117
123
|
scrollBarSize
|
|
118
124
|
});
|
|
119
125
|
hasScrollY = scrollInformation.hasScrollY;
|