@mui/x-data-grid 5.11.1 → 5.12.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 +95 -18
- package/DataGrid/DataGrid.js +26 -1
- package/README.md +2 -2
- package/components/GridRow.d.ts +1 -1
- package/components/GridRow.js +51 -12
- package/components/cell/GridActionsCellItem.d.ts +1 -1
- package/components/cell/GridCell.d.ts +2 -1
- package/components/cell/GridCell.js +12 -7
- package/components/columnHeaders/GridColumnHeaderItem.js +4 -3
- package/components/containers/GridRootStyles.js +4 -2
- package/components/menu/GridMenu.js +9 -2
- package/components/panel/GridColumnsPanel.js +10 -2
- package/components/panel/GridPanelWrapper.d.ts +1 -1
- package/components/panel/GridPanelWrapper.js +3 -3
- package/components/panel/filterPanel/GridFilterForm.d.ts +61 -4
- package/components/panel/filterPanel/GridFilterForm.js +88 -8
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
- package/components/panel/filterPanel/GridFilterPanel.d.ts +8 -5
- package/components/panel/filterPanel/GridFilterPanel.js +24 -6
- package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
- package/constants/gridClasses.d.ts +4 -0
- package/constants/gridClasses.js +1 -1
- package/hooks/features/columns/gridColumnsInterfaces.d.ts +3 -0
- package/hooks/features/columns/useGridColumns.js +12 -14
- package/hooks/features/editRows/useGridCellEditing.new.js +11 -4
- package/hooks/features/editRows/useGridRowEditing.new.js +10 -4
- package/hooks/features/events/useGridEvents.d.ts +1 -1
- package/hooks/features/events/useGridEvents.js +2 -0
- package/hooks/features/filter/gridFilterUtils.d.ts +9 -1
- package/hooks/features/filter/gridFilterUtils.js +1 -2
- package/hooks/features/filter/useGridFilter.js +5 -5
- package/hooks/features/rows/useGridRowsMeta.d.ts +1 -1
- package/hooks/features/rows/useGridRowsMeta.js +107 -43
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +1 -0
- package/hooks/features/virtualization/useGridVirtualScroller.js +27 -7
- package/index.js +1 -1
- package/internals/index.d.ts +1 -0
- package/legacy/DataGrid/DataGrid.js +26 -1
- package/legacy/components/GridRow.js +56 -12
- package/legacy/components/cell/GridCell.js +12 -7
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +6 -3
- package/legacy/components/containers/GridRootStyles.js +3 -2
- package/legacy/components/menu/GridMenu.js +9 -2
- package/legacy/components/panel/GridColumnsPanel.js +12 -2
- package/legacy/components/panel/GridPanelWrapper.js +3 -3
- package/legacy/components/panel/filterPanel/GridFilterForm.js +89 -8
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +25 -6
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/hooks/features/columns/useGridColumns.js +12 -14
- package/legacy/hooks/features/editRows/useGridCellEditing.new.js +14 -7
- package/legacy/hooks/features/editRows/useGridRowEditing.new.js +10 -4
- package/legacy/hooks/features/events/useGridEvents.js +2 -0
- package/legacy/hooks/features/filter/gridFilterUtils.js +1 -2
- package/legacy/hooks/features/filter/useGridFilter.js +5 -5
- package/legacy/hooks/features/rows/useGridRowsMeta.js +104 -41
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +46 -22
- package/legacy/index.js +1 -1
- package/legacy/locales/heIL.js +9 -9
- package/legacy/locales/nbNO.js +127 -0
- package/legacy/locales/trTR.js +7 -7
- package/legacy/models/events/gridEvents.js +2 -0
- package/legacy/models/gridApiCaches.js +1 -0
- package/legacy/models/params/gridMenuParams.js +1 -0
- package/legacy/models/params/index.js +2 -1
- package/locales/heIL.js +9 -9
- package/locales/nbNO.d.ts +2 -0
- package/locales/nbNO.js +115 -0
- package/locales/trTR.js +7 -7
- package/models/api/gridCoreApi.d.ts +2 -6
- package/models/api/gridRowsMetaApi.d.ts +24 -0
- package/models/colDef/gridColDef.d.ts +3 -3
- package/models/events/gridEventLookup.d.ts +13 -1
- package/models/events/gridEvents.d.ts +3 -1
- package/models/events/gridEvents.js +2 -0
- package/models/gridApiCaches.d.ts +6 -0
- package/models/gridApiCaches.js +1 -0
- package/models/params/gridMenuParams.d.ts +7 -0
- package/models/params/gridMenuParams.js +1 -0
- package/models/params/gridRowParams.d.ts +1 -1
- package/models/params/index.d.ts +1 -0
- package/models/params/index.js +2 -1
- package/models/props/DataGridProps.d.ts +23 -1
- package/modern/DataGrid/DataGrid.js +26 -1
- package/modern/components/GridRow.js +51 -12
- package/modern/components/cell/GridCell.js +12 -7
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +4 -3
- package/modern/components/containers/GridRootStyles.js +4 -2
- package/modern/components/menu/GridMenu.js +9 -2
- package/modern/components/panel/GridColumnsPanel.js +10 -2
- package/modern/components/panel/GridPanelWrapper.js +3 -3
- package/modern/components/panel/filterPanel/GridFilterForm.js +88 -8
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
- package/modern/components/panel/filterPanel/GridFilterPanel.js +24 -6
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/features/columns/useGridColumns.js +11 -13
- package/modern/hooks/features/editRows/useGridCellEditing.new.js +10 -3
- package/modern/hooks/features/editRows/useGridRowEditing.new.js +9 -3
- package/modern/hooks/features/events/useGridEvents.js +2 -0
- package/modern/hooks/features/filter/gridFilterUtils.js +1 -2
- package/modern/hooks/features/filter/useGridFilter.js +5 -5
- package/modern/hooks/features/rows/useGridRowsMeta.js +105 -37
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +27 -7
- package/modern/index.js +1 -1
- package/modern/locales/heIL.js +9 -9
- package/modern/locales/nbNO.js +115 -0
- package/modern/locales/trTR.js +7 -7
- package/modern/models/events/gridEvents.js +2 -0
- package/modern/models/gridApiCaches.js +1 -0
- package/modern/models/params/gridMenuParams.js +1 -0
- package/modern/models/params/index.js +2 -1
- package/node/DataGrid/DataGrid.js +26 -1
- package/node/components/GridRow.js +53 -12
- package/node/components/cell/GridCell.js +12 -7
- package/node/components/columnHeaders/GridColumnHeaderItem.js +4 -3
- package/node/components/containers/GridRootStyles.js +4 -2
- package/node/components/menu/GridMenu.js +10 -2
- package/node/components/panel/GridColumnsPanel.js +10 -2
- package/node/components/panel/GridPanelWrapper.js +5 -3
- package/node/components/panel/filterPanel/GridFilterForm.js +91 -9
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
- package/node/components/panel/filterPanel/GridFilterPanel.js +26 -6
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/features/columns/useGridColumns.js +12 -14
- package/node/hooks/features/editRows/useGridCellEditing.new.js +11 -4
- package/node/hooks/features/editRows/useGridRowEditing.new.js +10 -4
- package/node/hooks/features/events/useGridEvents.js +2 -0
- package/node/hooks/features/filter/gridFilterUtils.js +2 -1
- package/node/hooks/features/filter/useGridFilter.js +4 -4
- package/node/hooks/features/rows/useGridRowsMeta.js +107 -43
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +27 -7
- package/node/index.js +1 -1
- package/node/locales/heIL.js +9 -9
- package/node/locales/nbNO.js +125 -0
- package/node/locales/trTR.js +7 -7
- package/node/models/events/gridEvents.js +2 -0
- package/node/models/gridApiCaches.js +5 -0
- package/node/models/params/gridMenuParams.js +5 -0
- package/node/models/params/index.js +13 -0
- package/package.json +4 -4
|
@@ -21,37 +21,76 @@ export const rowsMetaStateInitializer = state => _extends({}, state, {
|
|
|
21
21
|
|
|
22
22
|
export const useGridRowsMeta = (apiRef, props) => {
|
|
23
23
|
const {
|
|
24
|
-
getRowHeight,
|
|
25
|
-
getRowSpacing
|
|
24
|
+
getRowHeight: getRowHeightProp,
|
|
25
|
+
getRowSpacing,
|
|
26
|
+
getEstimatedRowHeight
|
|
26
27
|
} = props;
|
|
27
|
-
const rowsHeightLookup = React.useRef({});
|
|
28
|
-
|
|
28
|
+
const rowsHeightLookup = React.useRef({}); // Inspired by https://github.com/bvaughn/react-virtualized/blob/master/source/Grid/utils/CellSizeAndPositionManager.js
|
|
29
|
+
|
|
30
|
+
const lastMeasuredRowIndex = React.useRef(-1);
|
|
31
|
+
const hasRowWithAutoHeight = React.useRef(false);
|
|
32
|
+
const rowHeightFromDensity = useGridSelector(apiRef, gridDensityRowHeightSelector);
|
|
29
33
|
const filterState = useGridSelector(apiRef, gridFilterStateSelector);
|
|
30
34
|
const paginationState = useGridSelector(apiRef, gridPaginationSelector);
|
|
31
35
|
const sortingState = useGridSelector(apiRef, gridSortingStateSelector);
|
|
32
36
|
const currentPage = useGridVisibleRows(apiRef, props);
|
|
33
37
|
const hydrateRowsMeta = React.useCallback(() => {
|
|
38
|
+
hasRowWithAutoHeight.current = false;
|
|
34
39
|
apiRef.current.setState(state => {
|
|
35
|
-
const positions = [];
|
|
36
40
|
const densityFactor = gridDensityFactorSelector(state, apiRef.current.instanceId);
|
|
37
|
-
const
|
|
41
|
+
const positions = [];
|
|
38
42
|
const currentPageTotalHeight = currentPage.rows.reduce((acc, row) => {
|
|
39
43
|
positions.push(acc);
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
|
|
45
|
+
if (!rowsHeightLookup.current[row.id]) {
|
|
46
|
+
rowsHeightLookup.current[row.id] = {
|
|
47
|
+
sizes: {
|
|
48
|
+
base: rowHeightFromDensity
|
|
49
|
+
},
|
|
50
|
+
isResized: false,
|
|
51
|
+
autoHeight: false,
|
|
52
|
+
needsFirstMeasurement: true // Assume all rows will need to be measured by default
|
|
53
|
+
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const {
|
|
58
|
+
isResized,
|
|
59
|
+
needsFirstMeasurement,
|
|
60
|
+
sizes
|
|
61
|
+
} = rowsHeightLookup.current[row.id];
|
|
62
|
+
let baseRowHeight = rowHeightFromDensity;
|
|
63
|
+
const existingBaseRowHeight = sizes.base;
|
|
42
64
|
|
|
43
65
|
if (isResized) {
|
|
44
|
-
//
|
|
45
|
-
baseRowHeight =
|
|
46
|
-
} else {
|
|
47
|
-
|
|
66
|
+
// Do not recalculate resized row height and use the value from the lookup
|
|
67
|
+
baseRowHeight = existingBaseRowHeight;
|
|
68
|
+
} else if (getRowHeightProp) {
|
|
69
|
+
const rowHeightFromUser = getRowHeightProp(_extends({}, row, {
|
|
70
|
+
densityFactor
|
|
71
|
+
}));
|
|
72
|
+
|
|
73
|
+
if (rowHeightFromUser === 'auto') {
|
|
74
|
+
if (needsFirstMeasurement) {
|
|
75
|
+
const estimatedRowHeight = getEstimatedRowHeight ? getEstimatedRowHeight(_extends({}, row, {
|
|
76
|
+
densityFactor
|
|
77
|
+
})) : rowHeightFromDensity; // If the row was not measured yet use the estimated row height
|
|
48
78
|
|
|
49
|
-
|
|
79
|
+
baseRowHeight = estimatedRowHeight ?? rowHeightFromDensity;
|
|
80
|
+
} else {
|
|
81
|
+
baseRowHeight = existingBaseRowHeight;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
hasRowWithAutoHeight.current = true;
|
|
85
|
+
rowsHeightLookup.current[row.id].autoHeight = true;
|
|
86
|
+
} else {
|
|
50
87
|
// Default back to base rowHeight if getRowHeight returns null or undefined.
|
|
51
|
-
baseRowHeight =
|
|
52
|
-
|
|
53
|
-
|
|
88
|
+
baseRowHeight = rowHeightFromUser ?? rowHeightFromDensity;
|
|
89
|
+
rowsHeightLookup.current[row.id].needsFirstMeasurement = false;
|
|
90
|
+
rowsHeightLookup.current[row.id].autoHeight = false;
|
|
54
91
|
}
|
|
92
|
+
} else {
|
|
93
|
+
rowsHeightLookup.current[row.id].needsFirstMeasurement = false;
|
|
55
94
|
} // We use an object to make simple to check if a height is already added or not
|
|
56
95
|
|
|
57
96
|
|
|
@@ -70,13 +109,9 @@ export const useGridRowsMeta = (apiRef, props) => {
|
|
|
70
109
|
initialHeights.spacingBottom = spacing.bottom ?? 0;
|
|
71
110
|
}
|
|
72
111
|
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
value: baseRowHeight,
|
|
77
|
-
sizes,
|
|
78
|
-
isResized
|
|
79
|
-
};
|
|
112
|
+
const processedSizes = apiRef.current.unstable_applyPipeProcessors('rowHeight', initialHeights, row);
|
|
113
|
+
rowsHeightLookup.current[row.id].sizes = processedSizes;
|
|
114
|
+
const finalRowHeight = Object.values(processedSizes).reduce((acc2, value) => acc2 + value, 0);
|
|
80
115
|
return acc + finalRowHeight;
|
|
81
116
|
}, 0);
|
|
82
117
|
return _extends({}, state, {
|
|
@@ -86,33 +121,66 @@ export const useGridRowsMeta = (apiRef, props) => {
|
|
|
86
121
|
}
|
|
87
122
|
});
|
|
88
123
|
});
|
|
89
|
-
apiRef.current.forceUpdate();
|
|
90
|
-
}, [apiRef, currentPage.rows, getRowSpacing, getRowHeight]);
|
|
91
124
|
|
|
92
|
-
|
|
125
|
+
if (!hasRowWithAutoHeight.current) {
|
|
126
|
+
// No row has height=auto, so all rows are already measured
|
|
127
|
+
lastMeasuredRowIndex.current = Infinity;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
apiRef.current.forceUpdate();
|
|
131
|
+
}, [apiRef, currentPage.rows, rowHeightFromDensity, getRowHeightProp, getRowSpacing, getEstimatedRowHeight]);
|
|
132
|
+
const getRowHeight = React.useCallback(rowId => {
|
|
133
|
+
const height = rowsHeightLookup.current[rowId];
|
|
134
|
+
return height ? height.sizes.base : rowHeightFromDensity;
|
|
135
|
+
}, [rowHeightFromDensity]);
|
|
93
136
|
|
|
94
137
|
const getRowInternalSizes = rowId => rowsHeightLookup.current[rowId]?.sizes;
|
|
95
138
|
|
|
96
139
|
const setRowHeight = React.useCallback((id, height) => {
|
|
97
|
-
rowsHeightLookup.current[id] =
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
sizes: _extends({}, rowsHeightLookup.current[id].sizes, {
|
|
101
|
-
base: height
|
|
102
|
-
})
|
|
103
|
-
};
|
|
140
|
+
rowsHeightLookup.current[id].sizes.base = height;
|
|
141
|
+
rowsHeightLookup.current[id].isResized = true;
|
|
142
|
+
rowsHeightLookup.current[id].needsFirstMeasurement = false;
|
|
104
143
|
hydrateRowsMeta();
|
|
105
|
-
}, [hydrateRowsMeta]);
|
|
144
|
+
}, [hydrateRowsMeta]);
|
|
145
|
+
const storeMeasuredRowHeight = React.useCallback((id, height) => {
|
|
146
|
+
if (!rowsHeightLookup.current[id] || !rowsHeightLookup.current[id].autoHeight) {
|
|
147
|
+
return;
|
|
148
|
+
} // Only trigger hydration if the value is different, otherwise we trigger a loop
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
const needsHydration = rowsHeightLookup.current[id].sizes.base !== height;
|
|
152
|
+
rowsHeightLookup.current[id].needsFirstMeasurement = false;
|
|
153
|
+
rowsHeightLookup.current[id].sizes.base = height;
|
|
154
|
+
|
|
155
|
+
if (needsHydration) {
|
|
156
|
+
hydrateRowsMeta();
|
|
157
|
+
}
|
|
158
|
+
}, [hydrateRowsMeta]);
|
|
159
|
+
const rowHasAutoHeight = React.useCallback(id => {
|
|
160
|
+
return rowsHeightLookup.current[id]?.autoHeight || false;
|
|
161
|
+
}, []);
|
|
162
|
+
const getLastMeasuredRowIndex = React.useCallback(() => {
|
|
163
|
+
return lastMeasuredRowIndex.current;
|
|
164
|
+
}, []);
|
|
165
|
+
const setLastMeasuredRowIndex = React.useCallback(index => {
|
|
166
|
+
if (hasRowWithAutoHeight.current) {
|
|
167
|
+
lastMeasuredRowIndex.current = index;
|
|
168
|
+
}
|
|
169
|
+
}, []); // The effect is used to build the rows meta data - currentPageTotalHeight and positions.
|
|
106
170
|
// Because of variable row height this is needed for the virtualization
|
|
107
171
|
|
|
108
172
|
React.useEffect(() => {
|
|
109
173
|
hydrateRowsMeta();
|
|
110
|
-
}, [
|
|
174
|
+
}, [rowHeightFromDensity, filterState, paginationState, sortingState, hydrateRowsMeta]);
|
|
111
175
|
useGridRegisterPipeApplier(apiRef, 'rowHeight', hydrateRowsMeta);
|
|
112
176
|
const rowsMetaApi = {
|
|
113
|
-
|
|
177
|
+
unstable_getLastMeasuredRowIndex: getLastMeasuredRowIndex,
|
|
178
|
+
unstable_setLastMeasuredRowIndex: setLastMeasuredRowIndex,
|
|
179
|
+
unstable_rowHasAutoHeight: rowHasAutoHeight,
|
|
180
|
+
unstable_getRowHeight: getRowHeight,
|
|
114
181
|
unstable_getRowInternalSizes: getRowInternalSizes,
|
|
115
|
-
unstable_setRowHeight: setRowHeight
|
|
182
|
+
unstable_setRowHeight: setRowHeight,
|
|
183
|
+
unstable_storeRowHeightMeasurement: storeMeasuredRowHeight
|
|
116
184
|
};
|
|
117
185
|
useGridApiMethod(apiRef, rowsMetaApi, 'GridRowsMetaApi');
|
|
118
186
|
};
|
|
@@ -87,17 +87,36 @@ export const useGridVirtualScroller = props => {
|
|
|
87
87
|
top,
|
|
88
88
|
left
|
|
89
89
|
} = scrollPosition.current;
|
|
90
|
-
const firstRowIndex = getIndexFromScroll(top, rowsMeta.positions);
|
|
90
|
+
const firstRowIndex = Math.min(Math.max(0, apiRef.current.unstable_getLastMeasuredRowIndex()), getIndexFromScroll(top, rowsMeta.positions));
|
|
91
91
|
const lastRowIndex = rootProps.autoHeight ? firstRowIndex + currentPage.rows.length : getIndexFromScroll(top + rootRef.current.clientHeight, rowsMeta.positions);
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
let hasRowWithAutoHeight = false;
|
|
93
|
+
let firstColumnIndex = 0;
|
|
94
|
+
let lastColumnIndex = columnPositions.length;
|
|
95
|
+
const [firstRowToRender, lastRowToRender] = getRenderableIndexes({
|
|
96
|
+
firstIndex: firstRowIndex,
|
|
97
|
+
lastIndex: lastRowIndex,
|
|
98
|
+
minFirstIndex: 0,
|
|
99
|
+
maxLastIndex: currentPage.rows.length,
|
|
100
|
+
buffer: rootProps.rowBuffer
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
for (let i = firstRowToRender; i < lastRowToRender && !hasRowWithAutoHeight; i += 1) {
|
|
104
|
+
const row = currentPage.rows[i];
|
|
105
|
+
hasRowWithAutoHeight = apiRef.current.unstable_rowHasAutoHeight(row.id);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (!hasRowWithAutoHeight) {
|
|
109
|
+
firstColumnIndex = getIndexFromScroll(left, columnPositions);
|
|
110
|
+
lastColumnIndex = getIndexFromScroll(left + containerWidth, columnPositions);
|
|
111
|
+
}
|
|
112
|
+
|
|
94
113
|
return {
|
|
95
114
|
firstRowIndex,
|
|
96
115
|
lastRowIndex,
|
|
97
116
|
firstColumnIndex,
|
|
98
117
|
lastColumnIndex
|
|
99
118
|
};
|
|
100
|
-
}, [disableVirtualization, rowsMeta.positions, rootProps.autoHeight, currentPage.rows
|
|
119
|
+
}, [disableVirtualization, rowsMeta.positions, rootProps.autoHeight, rootProps.rowBuffer, currentPage.rows, columnPositions, visibleColumns.length, apiRef, containerWidth]);
|
|
101
120
|
React.useEffect(() => {
|
|
102
121
|
if (disableVirtualization) {
|
|
103
122
|
renderZoneRef.current.style.transform = `translate3d(0px, 0px, 0px)`;
|
|
@@ -228,7 +247,8 @@ export const useGridVirtualScroller = props => {
|
|
|
228
247
|
renderContext: nextRenderContext,
|
|
229
248
|
minFirstColumn = renderZoneMinColumnIndex,
|
|
230
249
|
maxLastColumn = renderZoneMaxColumnIndex,
|
|
231
|
-
availableSpace = containerWidth
|
|
250
|
+
availableSpace = containerWidth,
|
|
251
|
+
ignoreAutoHeight
|
|
232
252
|
} = params;
|
|
233
253
|
|
|
234
254
|
if (!currentPage.range || !nextRenderContext || availableSpace == null) {
|
|
@@ -279,7 +299,7 @@ export const useGridVirtualScroller = props => {
|
|
|
279
299
|
model
|
|
280
300
|
} = renderedRows[i];
|
|
281
301
|
const lastVisibleRowIndex = firstRowToRender + i === currentPage.rows.length - 1;
|
|
282
|
-
const
|
|
302
|
+
const baseRowHeight = !apiRef.current.unstable_rowHasAutoHeight(id) || ignoreAutoHeight ? apiRef.current.unstable_getRowHeight(id) : 'auto';
|
|
283
303
|
let isSelected;
|
|
284
304
|
|
|
285
305
|
if (selectedRowsLookup[id] == null) {
|
|
@@ -293,7 +313,7 @@ export const useGridVirtualScroller = props => {
|
|
|
293
313
|
rows.push( /*#__PURE__*/_jsx(rootProps.components.Row, _extends({
|
|
294
314
|
row: model,
|
|
295
315
|
rowId: id,
|
|
296
|
-
rowHeight:
|
|
316
|
+
rowHeight: baseRowHeight,
|
|
297
317
|
cellFocus: cellFocus // TODO move to inside the row
|
|
298
318
|
,
|
|
299
319
|
cellTabIndex: cellTabIndex // TODO move to inside the row
|
package/modern/index.js
CHANGED
package/modern/locales/heIL.js
CHANGED
|
@@ -21,15 +21,15 @@ const heILGrid = {
|
|
|
21
21
|
toolbarFiltersTooltipShow: 'הצג מסננים',
|
|
22
22
|
toolbarFiltersTooltipActive: count => count !== 1 ? `${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
|
-
toolbarExportCSV: '
|
|
30
|
+
toolbarExportCSV: 'ייצוא ל- CSV',
|
|
31
31
|
toolbarExportPrint: 'הדפסה',
|
|
32
|
-
|
|
32
|
+
toolbarExportExcel: 'ייצוא ל- Excel',
|
|
33
33
|
// Columns panel text
|
|
34
34
|
columnsPanelTextFieldLabel: 'חפש עמודה',
|
|
35
35
|
columnsPanelTextFieldPlaceholder: 'כותרת עמודה',
|
|
@@ -39,7 +39,7 @@ const heILGrid = {
|
|
|
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: 'וגם',
|
|
@@ -108,8 +108,8 @@ const heILGrid = {
|
|
|
108
108
|
unGroupColumn: name => `הפסק לקבץ לפי ${name}`,
|
|
109
109
|
// Master/detail
|
|
110
110
|
expandDetailPanel: 'הרחב',
|
|
111
|
-
collapseDetailPanel: 'כווץ'
|
|
112
|
-
//
|
|
113
|
-
|
|
111
|
+
collapseDetailPanel: 'כווץ',
|
|
112
|
+
// Row reordering text
|
|
113
|
+
rowReorderingHeaderName: 'סידור שורות'
|
|
114
114
|
};
|
|
115
115
|
export const heIL = getGridLocalization(heILGrid, heILCore);
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { nbNO as nbNOCore } from '@mui/material/locale';
|
|
2
|
+
import { getGridLocalization } from '../utils/getGridLocalization';
|
|
3
|
+
const nbNOGrid = {
|
|
4
|
+
// Root
|
|
5
|
+
noRowsLabel: 'Ingen rader',
|
|
6
|
+
noResultsOverlayLabel: 'Fant ingen resultat.',
|
|
7
|
+
errorOverlayDefaultLabel: 'Det skjedde en feil.',
|
|
8
|
+
// Density selector toolbar button text
|
|
9
|
+
toolbarDensity: 'Tetthet',
|
|
10
|
+
toolbarDensityLabel: 'Tetthet',
|
|
11
|
+
toolbarDensityCompact: 'Kompakt',
|
|
12
|
+
toolbarDensityStandard: 'Standard',
|
|
13
|
+
toolbarDensityComfortable: 'Komfortabelt',
|
|
14
|
+
// Columns selector toolbar button text
|
|
15
|
+
toolbarColumns: 'Kolonner',
|
|
16
|
+
toolbarColumnsLabel: 'Velg kolonner',
|
|
17
|
+
// Filters toolbar button text
|
|
18
|
+
toolbarFilters: 'Filter',
|
|
19
|
+
toolbarFiltersLabel: 'Vis filter',
|
|
20
|
+
toolbarFiltersTooltipHide: 'Skjul fitler',
|
|
21
|
+
toolbarFiltersTooltipShow: 'Vis filter',
|
|
22
|
+
toolbarFiltersTooltipActive: count => count !== 1 ? `${count} aktive filter` : `${count} aktivt filter`,
|
|
23
|
+
// Quick filter toolbar field
|
|
24
|
+
toolbarQuickFilterPlaceholder: 'Søk...',
|
|
25
|
+
toolbarQuickFilterLabel: 'Søk',
|
|
26
|
+
toolbarQuickFilterDeleteIconLabel: 'Slett',
|
|
27
|
+
// Export selector toolbar button text
|
|
28
|
+
toolbarExport: 'Eksporter',
|
|
29
|
+
toolbarExportLabel: 'Eksporter',
|
|
30
|
+
toolbarExportCSV: 'Last ned som CSV',
|
|
31
|
+
toolbarExportPrint: 'Skriv ut',
|
|
32
|
+
toolbarExportExcel: 'Last ned som Excel',
|
|
33
|
+
// Columns panel text
|
|
34
|
+
columnsPanelTextFieldLabel: 'Finn kolonne',
|
|
35
|
+
columnsPanelTextFieldPlaceholder: 'Kolonne tittel',
|
|
36
|
+
columnsPanelDragIconLabel: 'Reorganiser kolonne',
|
|
37
|
+
columnsPanelShowAllButton: 'Vis alle',
|
|
38
|
+
columnsPanelHideAllButton: 'Skjul alle',
|
|
39
|
+
// Filter panel text
|
|
40
|
+
filterPanelAddFilter: 'Legg til filter',
|
|
41
|
+
filterPanelDeleteIconLabel: 'Slett',
|
|
42
|
+
filterPanelLinkOperator: 'Logisk operator',
|
|
43
|
+
filterPanelOperators: 'Operatører',
|
|
44
|
+
// TODO v6: rename to filterPanelOperator
|
|
45
|
+
filterPanelOperatorAnd: 'Og',
|
|
46
|
+
filterPanelOperatorOr: 'Eller',
|
|
47
|
+
filterPanelColumns: 'Kolonner',
|
|
48
|
+
filterPanelInputLabel: 'Verdi',
|
|
49
|
+
filterPanelInputPlaceholder: 'Filter verdi',
|
|
50
|
+
// Filter operators text
|
|
51
|
+
filterOperatorContains: 'inneholder',
|
|
52
|
+
filterOperatorEquals: 'er lik',
|
|
53
|
+
filterOperatorStartsWith: 'starter med',
|
|
54
|
+
filterOperatorEndsWith: 'slutter med',
|
|
55
|
+
filterOperatorIs: 'er',
|
|
56
|
+
filterOperatorNot: 'er ikke',
|
|
57
|
+
filterOperatorAfter: 'er etter',
|
|
58
|
+
filterOperatorOnOrAfter: 'er på eller etter',
|
|
59
|
+
filterOperatorBefore: 'er før',
|
|
60
|
+
filterOperatorOnOrBefore: 'er på eller før',
|
|
61
|
+
filterOperatorIsEmpty: 'er tom',
|
|
62
|
+
filterOperatorIsNotEmpty: 'er ikke tom',
|
|
63
|
+
filterOperatorIsAnyOf: 'er en av',
|
|
64
|
+
// Filter values text
|
|
65
|
+
filterValueAny: 'noen',
|
|
66
|
+
filterValueTrue: 'sant',
|
|
67
|
+
filterValueFalse: 'usant',
|
|
68
|
+
// Column menu text
|
|
69
|
+
columnMenuLabel: 'Meny',
|
|
70
|
+
columnMenuShowColumns: 'Vis kolonner',
|
|
71
|
+
columnMenuFilter: 'Filter',
|
|
72
|
+
columnMenuHideColumn: 'Skjul',
|
|
73
|
+
columnMenuUnsort: 'Usorter',
|
|
74
|
+
columnMenuSortAsc: 'Sorter ØKENDE',
|
|
75
|
+
columnMenuSortDesc: 'Sorter SYNKENDE',
|
|
76
|
+
// Column header text
|
|
77
|
+
columnHeaderFiltersTooltipActive: count => count !== 1 ? `${count} aktive filter` : `${count} aktivt filter`,
|
|
78
|
+
columnHeaderFiltersLabel: 'Vis filter',
|
|
79
|
+
columnHeaderSortIconLabel: 'Sorter',
|
|
80
|
+
// Rows selected footer text
|
|
81
|
+
footerRowSelected: count => count !== 1 ? `${count.toLocaleString()} rader valgt` : `${count.toLocaleString()} rad valgt`,
|
|
82
|
+
// Total row amount footer text
|
|
83
|
+
footerTotalRows: 'Totalt antall rader:',
|
|
84
|
+
// Total visible row amount footer text
|
|
85
|
+
footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} av ${totalCount.toLocaleString()}`,
|
|
86
|
+
// Checkbox selection text
|
|
87
|
+
checkboxSelectionHeaderName: 'Avmerkingsboks valgt',
|
|
88
|
+
checkboxSelectionSelectAllRows: 'Velg alle rader',
|
|
89
|
+
checkboxSelectionUnselectAllRows: 'Velg bort alle rader',
|
|
90
|
+
checkboxSelectionSelectRow: 'Velg rad',
|
|
91
|
+
checkboxSelectionUnselectRow: 'Velg bort rad',
|
|
92
|
+
// Boolean cell text
|
|
93
|
+
booleanCellTrueLabel: 'sant',
|
|
94
|
+
booleanCellFalseLabel: 'usant',
|
|
95
|
+
// Actions cell more text
|
|
96
|
+
actionsCellMore: 'mer',
|
|
97
|
+
// Column pinning text
|
|
98
|
+
pinToLeft: 'Fest til venstre',
|
|
99
|
+
pinToRight: 'Fest til høyre',
|
|
100
|
+
unpin: 'Løsne',
|
|
101
|
+
// Tree Data
|
|
102
|
+
treeDataGroupingHeaderName: 'Grupper',
|
|
103
|
+
treeDataExpand: 'se barn',
|
|
104
|
+
treeDataCollapse: 'skjul barn',
|
|
105
|
+
// Grouping columns
|
|
106
|
+
groupingColumnHeaderName: 'Grupper',
|
|
107
|
+
groupColumn: name => `Grupper på ${name}`,
|
|
108
|
+
unGroupColumn: name => `Stopp å grupper på ${name}`,
|
|
109
|
+
// Master/detail
|
|
110
|
+
expandDetailPanel: 'Utvid',
|
|
111
|
+
collapseDetailPanel: 'Kollaps',
|
|
112
|
+
// Row reordering text
|
|
113
|
+
rowReorderingHeaderName: 'Rad reorganisering'
|
|
114
|
+
};
|
|
115
|
+
export const nbNO = getGridLocalization(nbNOGrid, nbNOCore);
|
package/modern/locales/trTR.js
CHANGED
|
@@ -21,15 +21,15 @@ const trTRGrid = {
|
|
|
21
21
|
toolbarFiltersTooltipShow: 'Filtreleri göster',
|
|
22
22
|
toolbarFiltersTooltipActive: count => `${count} aktif filtre`,
|
|
23
23
|
// Quick filter toolbar field
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
toolbarQuickFilterPlaceholder: 'Ara...',
|
|
25
|
+
toolbarQuickFilterLabel: 'Ara',
|
|
26
|
+
toolbarQuickFilterDeleteIconLabel: 'Temizle',
|
|
27
27
|
// Export selector toolbar button text
|
|
28
28
|
toolbarExport: 'Dışa aktar',
|
|
29
29
|
toolbarExportLabel: 'Dışa aktar',
|
|
30
30
|
toolbarExportCSV: 'CSV olarak aktar',
|
|
31
31
|
toolbarExportPrint: 'Yazdır',
|
|
32
|
-
|
|
32
|
+
toolbarExportExcel: 'Excel olarak aktar',
|
|
33
33
|
// Columns panel text
|
|
34
34
|
columnsPanelTextFieldLabel: 'Sütun ara',
|
|
35
35
|
columnsPanelTextFieldPlaceholder: 'Sütun adı',
|
|
@@ -62,9 +62,9 @@ const trTRGrid = {
|
|
|
62
62
|
filterOperatorIsNotEmpty: 'dolu',
|
|
63
63
|
filterOperatorIsAnyOf: 'herhangi biri',
|
|
64
64
|
// Filter values text
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
filterValueAny: 'herhangi',
|
|
66
|
+
filterValueTrue: 'doğru',
|
|
67
|
+
filterValueFalse: 'yanlış',
|
|
68
68
|
// Column menu text
|
|
69
69
|
columnMenuLabel: 'Menü',
|
|
70
70
|
columnMenuShowColumns: 'Sütunları göster',
|
|
@@ -82,6 +82,8 @@ var GridEvents;
|
|
|
82
82
|
GridEvents["virtualScrollerTouchMove"] = "virtualScrollerTouchMove";
|
|
83
83
|
GridEvents["preferencePanelClose"] = "preferencePanelClose";
|
|
84
84
|
GridEvents["preferencePanelOpen"] = "preferencePanelOpen";
|
|
85
|
+
GridEvents["menuOpen"] = "menuOpen";
|
|
86
|
+
GridEvents["menuClose"] = "menuClose";
|
|
85
87
|
})(GridEvents || (GridEvents = {}));
|
|
86
88
|
|
|
87
89
|
export { GridEvents };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -10,4 +10,5 @@ export * from './gridHeaderSelectionCheckboxParams';
|
|
|
10
10
|
export * from './gridValueOptionsParams';
|
|
11
11
|
export * from './gridCellParams';
|
|
12
12
|
export * from './gridSortModelParams';
|
|
13
|
-
export * from './gridPreferencePanelParams';
|
|
13
|
+
export * from './gridPreferencePanelParams';
|
|
14
|
+
export * from './gridMenuParams';
|
|
@@ -252,6 +252,15 @@ DataGridRaw.propTypes = {
|
|
|
252
252
|
*/
|
|
253
253
|
getDetailPanelContent: _propTypes.default.func,
|
|
254
254
|
|
|
255
|
+
/**
|
|
256
|
+
* Function that returns the estimated height for a row.
|
|
257
|
+
* Only works if dynamic row height is used.
|
|
258
|
+
* Once the row height is measured this value is discarded.
|
|
259
|
+
* @param {GridRowHeightParams} params With all properties from [[GridRowHeightParams]].
|
|
260
|
+
* @returns {number | null} The estimated row height value. If `null` or `undefined` then the default row height, based on the density, is applied.
|
|
261
|
+
*/
|
|
262
|
+
getEstimatedRowHeight: _propTypes.default.func,
|
|
263
|
+
|
|
255
264
|
/**
|
|
256
265
|
* Function that applies CSS classes dynamically on rows.
|
|
257
266
|
* @param {GridRowClassNameParams} params With all properties from [[GridRowClassNameParams]].
|
|
@@ -262,7 +271,7 @@ DataGridRaw.propTypes = {
|
|
|
262
271
|
/**
|
|
263
272
|
* Function that sets the row height per row.
|
|
264
273
|
* @param {GridRowHeightParams} params With all properties from [[GridRowHeightParams]].
|
|
265
|
-
* @returns {GridRowHeightReturnValue} The row height value. If `null` or `undefined` then the default row height is applied.
|
|
274
|
+
* @returns {GridRowHeightReturnValue} The row height value. If `null` or `undefined` then the default row height is applied. If "auto" then the row height is calculated based on the content.
|
|
266
275
|
*/
|
|
267
276
|
getRowHeight: _propTypes.default.func,
|
|
268
277
|
|
|
@@ -529,6 +538,22 @@ DataGridRaw.propTypes = {
|
|
|
529
538
|
*/
|
|
530
539
|
onFilterModelChange: _propTypes.default.func,
|
|
531
540
|
|
|
541
|
+
/**
|
|
542
|
+
* Callback fired when the menu is closed.
|
|
543
|
+
* @param {GridMenuParams} params With all properties from [[GridMenuParams]].
|
|
544
|
+
* @param {MuiEvent<{}>} event The event object.
|
|
545
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
546
|
+
*/
|
|
547
|
+
onMenuClose: _propTypes.default.func,
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* Callback fired when the menu is opened.
|
|
551
|
+
* @param {GridMenuParams} params With all properties from [[GridMenuParams]].
|
|
552
|
+
* @param {MuiEvent<{}>} event The event object.
|
|
553
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
554
|
+
*/
|
|
555
|
+
onMenuOpen: _propTypes.default.func,
|
|
556
|
+
|
|
532
557
|
/**
|
|
533
558
|
* Callback fired when the current page has changed.
|
|
534
559
|
* @param {number} page Index of the page displayed on the Grid.
|