@mui/x-data-grid 6.0.3 → 6.1.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 +119 -0
- package/components/GridAutoSizer.js +3 -0
- package/components/GridPagination.d.ts +6 -6
- package/components/GridRow.js +4 -2
- package/components/cell/GridActionsCellItem.d.ts +2 -2
- package/components/cell/GridEditDateCell.js +37 -16
- package/components/columnHeaders/ColumnHeaderMenuIcon.js +20 -16
- package/components/columnHeaders/GridColumnHeaderTitle.js +5 -5
- package/components/menu/columnMenu/GridColumnHeaderMenu.js +4 -2
- package/components/menu/columnMenu/GridColumnMenu.d.ts +5 -5
- package/components/menu/columnMenu/GridColumnMenu.js +30 -30
- package/components/menu/columnMenu/GridColumnMenuProps.d.ts +1 -1
- package/components/panel/GridColumnsPanel.d.ts +8 -0
- package/components/panel/GridColumnsPanel.js +18 -6
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/components/reexportable.d.ts +1 -1
- package/components/reexportable.js +1 -1
- package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
- package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
- package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
- package/hooks/core/useGridApiInitialization.js +3 -3
- package/hooks/features/columnMenu/columnMenuInterfaces.d.ts +11 -11
- package/hooks/features/columnMenu/{useGridColumnMenuComponents.d.ts → useGridColumnMenuSlots.d.ts} +4 -4
- package/hooks/features/columnMenu/{useGridColumnMenuComponents.js → useGridColumnMenuSlots.js} +21 -26
- package/hooks/features/columns/gridColumnsSelector.d.ts +3 -3
- package/hooks/features/columns/useGridColumns.js +1 -1
- package/hooks/features/editing/useGridCellEditing.js +5 -1
- package/hooks/features/editing/useGridEditing.js +1 -3
- package/hooks/features/editing/useGridRowEditing.js +5 -1
- package/hooks/features/filter/gridFilterState.js +6 -1
- package/hooks/features/filter/useGridFilter.js +6 -1
- package/hooks/features/sorting/useGridSorting.js +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +1 -1
- package/index.d.ts +1 -1
- package/index.js +10 -2
- package/legacy/components/GridAutoSizer.js +3 -0
- package/legacy/components/GridRow.js +5 -2
- package/legacy/components/cell/GridEditBooleanCell.js +19 -21
- package/legacy/components/cell/GridEditDateCell.js +69 -39
- package/legacy/components/cell/GridEditInputCell.js +25 -27
- package/legacy/components/cell/GridEditSingleSelectCell.js +26 -28
- package/legacy/components/columnHeaders/ColumnHeaderMenuIcon.js +20 -16
- package/legacy/components/columnHeaders/GridColumnHeaderTitle.js +5 -5
- package/legacy/components/menu/columnMenu/GridColumnHeaderMenu.js +4 -2
- package/legacy/components/menu/columnMenu/GridColumnMenu.js +32 -32
- package/legacy/components/panel/GridColumnsPanel.js +19 -6
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/legacy/components/reexportable.js +1 -1
- package/legacy/hooks/core/useGridApiInitialization.js +3 -3
- package/legacy/hooks/features/columnMenu/{useGridColumnMenuComponents.js → useGridColumnMenuSlots.js} +25 -30
- package/legacy/hooks/features/columns/gridColumnsUtils.js +2 -2
- package/legacy/hooks/features/columns/useGridColumns.js +1 -1
- package/legacy/hooks/features/editing/useGridCellEditing.js +120 -120
- package/legacy/hooks/features/editing/useGridEditing.js +17 -21
- package/legacy/hooks/features/editing/useGridRowEditing.js +5 -1
- package/legacy/hooks/features/export/useGridPrintExport.js +45 -47
- package/legacy/hooks/features/filter/gridFilterState.js +6 -1
- package/legacy/hooks/features/filter/useGridFilter.js +6 -1
- package/legacy/hooks/features/rows/gridRowsUtils.js +2 -2
- package/legacy/hooks/features/sorting/useGridSorting.js +1 -1
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +7 -7
- package/legacy/index.js +10 -2
- package/legacy/locales/coreLocales.js +0 -1
- package/legacy/locales/daDK.js +16 -21
- package/legacy/locales/esES.js +1 -1
- package/legacy/locales/huHU.js +15 -20
- package/legacy/locales/jaJP.js +1 -1
- package/legacy/locales/nbNO.js +10 -12
- package/legacy/locales/nlNL.js +3 -3
- package/legacy/locales/ptBR.js +7 -9
- package/legacy/locales/ruRU.js +1 -1
- package/legacy/locales/svSE.js +2 -2
- package/legacy/models/gridColumnGrouping.js +4 -0
- package/legacy/models/params/gridRowParams.js +8 -0
- package/legacy/utils/createSelector.js +14 -22
- package/locales/coreLocales.js +0 -1
- package/locales/daDK.js +16 -21
- package/locales/esES.js +1 -1
- package/locales/huHU.js +15 -20
- package/locales/jaJP.js +1 -1
- package/locales/nbNO.js +10 -12
- package/locales/nlNL.js +3 -3
- package/locales/ptBR.js +7 -9
- package/locales/ruRU.js +1 -1
- package/locales/svSE.js +2 -2
- package/models/api/gridCoreApi.d.ts +3 -1
- package/models/api/gridEditingApi.d.ts +4 -0
- package/models/gridColumnGrouping.js +4 -0
- package/models/params/gridRowParams.js +8 -0
- package/modern/components/GridAutoSizer.js +3 -0
- package/modern/components/GridRow.js +4 -2
- package/modern/components/cell/GridEditDateCell.js +37 -16
- package/modern/components/columnHeaders/ColumnHeaderMenuIcon.js +19 -15
- package/modern/components/columnHeaders/GridColumnHeaderTitle.js +5 -5
- package/modern/components/menu/columnMenu/GridColumnHeaderMenu.js +4 -2
- package/modern/components/menu/columnMenu/GridColumnMenu.js +30 -30
- package/modern/components/panel/GridColumnsPanel.js +18 -6
- package/modern/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/modern/components/reexportable.js +1 -1
- package/modern/hooks/core/useGridApiInitialization.js +3 -3
- package/modern/hooks/features/columnMenu/{useGridColumnMenuComponents.js → useGridColumnMenuSlots.js} +21 -26
- package/modern/hooks/features/columns/useGridColumns.js +1 -1
- package/modern/hooks/features/editing/useGridCellEditing.js +5 -1
- package/modern/hooks/features/editing/useGridEditing.js +1 -3
- package/modern/hooks/features/editing/useGridRowEditing.js +5 -1
- package/modern/hooks/features/filter/gridFilterState.js +6 -1
- package/modern/hooks/features/filter/useGridFilter.js +6 -1
- package/modern/hooks/features/sorting/useGridSorting.js +1 -1
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +1 -1
- package/modern/index.js +10 -2
- package/modern/locales/coreLocales.js +0 -1
- package/modern/locales/daDK.js +16 -21
- package/modern/locales/esES.js +1 -1
- package/modern/locales/huHU.js +15 -20
- package/modern/locales/jaJP.js +1 -1
- package/modern/locales/nbNO.js +10 -12
- package/modern/locales/nlNL.js +3 -3
- package/modern/locales/ptBR.js +7 -9
- package/modern/locales/ruRU.js +1 -1
- package/modern/locales/svSE.js +2 -2
- package/modern/models/gridColumnGrouping.js +4 -0
- package/modern/models/params/gridRowParams.js +8 -0
- package/modern/utils/createSelector.js +12 -22
- package/node/components/GridAutoSizer.js +3 -1
- package/node/components/GridRow.js +4 -2
- package/node/components/cell/GridCell.js +1 -0
- package/node/components/cell/GridEditDateCell.js +37 -16
- package/node/components/columnHeaders/ColumnHeaderMenuIcon.js +19 -15
- package/node/components/columnHeaders/GridColumnHeaderTitle.js +5 -5
- package/node/components/menu/columnMenu/GridColumnHeaderMenu.js +4 -2
- package/node/components/menu/columnMenu/GridColumnMenu.js +33 -33
- package/node/components/panel/GridColumnsPanel.js +18 -6
- package/node/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/node/components/reexportable.js +4 -4
- package/node/hooks/core/useGridApiInitialization.js +3 -3
- package/node/hooks/features/columnMenu/{useGridColumnMenuComponents.js → useGridColumnMenuSlots.js} +22 -27
- package/node/hooks/features/columns/useGridColumns.js +1 -1
- package/node/hooks/features/editing/useGridCellEditing.js +5 -1
- package/node/hooks/features/editing/useGridEditing.js +1 -3
- package/node/hooks/features/editing/useGridRowEditing.js +5 -1
- package/node/hooks/features/filter/gridFilterState.js +5 -0
- package/node/hooks/features/filter/useGridFilter.js +6 -1
- package/node/hooks/features/sorting/useGridSorting.js +1 -1
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +1 -1
- package/node/index.js +7 -7
- package/node/locales/daDK.js +16 -21
- package/node/locales/esES.js +1 -1
- package/node/locales/huHU.js +15 -20
- package/node/locales/jaJP.js +1 -1
- package/node/locales/nbNO.js +10 -12
- package/node/locales/nlNL.js +3 -3
- package/node/locales/ptBR.js +7 -9
- package/node/locales/ruRU.js +1 -1
- package/node/locales/svSE.js +2 -2
- package/node/models/gridColumnGrouping.js +4 -0
- package/node/models/params/gridEditCellParams.js +1 -0
- package/node/models/params/gridRowParams.js +9 -0
- package/node/utils/createSelector.js +12 -22
- package/package.json +1 -1
- package/utils/createSelector.d.ts +4 -4
- package/utils/createSelector.js +14 -22
|
@@ -4,44 +4,39 @@ const _excluded = ["displayOrder"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import Divider from '@mui/material/Divider';
|
|
6
6
|
import { useGridPrivateApiContext } from '../../utils/useGridPrivateApiContext';
|
|
7
|
-
const
|
|
8
|
-
const camelCase = pascalCase.split('');
|
|
9
|
-
camelCase[0] = camelCase[0].toLowerCase();
|
|
10
|
-
return camelCase.join('');
|
|
11
|
-
};
|
|
12
|
-
const useGridColumnMenuComponents = props => {
|
|
7
|
+
const useGridColumnMenuSlots = props => {
|
|
13
8
|
const apiRef = useGridPrivateApiContext();
|
|
14
9
|
const {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
defaultSlots,
|
|
11
|
+
defaultSlotProps,
|
|
12
|
+
slots = {},
|
|
13
|
+
slotProps = {},
|
|
19
14
|
hideMenu,
|
|
20
15
|
colDef,
|
|
21
16
|
addDividers = true
|
|
22
17
|
} = props;
|
|
23
|
-
const processedComponents = React.useMemo(() => _extends({},
|
|
24
|
-
const
|
|
25
|
-
if (!
|
|
26
|
-
return
|
|
18
|
+
const processedComponents = React.useMemo(() => _extends({}, defaultSlots, slots), [defaultSlots, slots]);
|
|
19
|
+
const processedSlotProps = React.useMemo(() => {
|
|
20
|
+
if (!slotProps || Object.keys(slotProps).length === 0) {
|
|
21
|
+
return defaultSlotProps;
|
|
27
22
|
}
|
|
28
|
-
const mergedProps = _extends({},
|
|
29
|
-
Object.entries(
|
|
30
|
-
mergedProps[key] = _extends({},
|
|
23
|
+
const mergedProps = _extends({}, slotProps);
|
|
24
|
+
Object.entries(defaultSlotProps).forEach(([key, currentSlotProps]) => {
|
|
25
|
+
mergedProps[key] = _extends({}, currentSlotProps, slotProps[key] || {});
|
|
31
26
|
});
|
|
32
27
|
return mergedProps;
|
|
33
|
-
}, [
|
|
28
|
+
}, [defaultSlotProps, slotProps]);
|
|
34
29
|
const defaultItems = apiRef.current.unstable_applyPipeProcessors('columnMenu', [], props.colDef);
|
|
35
30
|
const userItems = React.useMemo(() => {
|
|
36
|
-
const defaultComponentKeys = Object.keys(
|
|
37
|
-
return Object.keys(
|
|
38
|
-
}, [
|
|
31
|
+
const defaultComponentKeys = Object.keys(defaultSlots);
|
|
32
|
+
return Object.keys(slots).filter(key => !defaultComponentKeys.includes(key));
|
|
33
|
+
}, [slots, defaultSlots]);
|
|
39
34
|
return React.useMemo(() => {
|
|
40
35
|
const uniqueItems = Array.from(new Set([...defaultItems, ...userItems]));
|
|
41
36
|
const cleansedItems = uniqueItems.filter(key => processedComponents[key] != null);
|
|
42
37
|
const sorted = cleansedItems.sort((a, b) => {
|
|
43
|
-
const leftItemProps =
|
|
44
|
-
const rightItemProps =
|
|
38
|
+
const leftItemProps = processedSlotProps[a];
|
|
39
|
+
const rightItemProps = processedSlotProps[b];
|
|
45
40
|
const leftDisplayOrder = Number.isFinite(leftItemProps?.displayOrder) ? leftItemProps.displayOrder : 100;
|
|
46
41
|
const rightDisplayOrder = Number.isFinite(rightItemProps?.displayOrder) ? rightItemProps.displayOrder : 100;
|
|
47
42
|
return leftDisplayOrder - rightDisplayOrder;
|
|
@@ -51,13 +46,13 @@ const useGridColumnMenuComponents = props => {
|
|
|
51
46
|
colDef,
|
|
52
47
|
onClick: hideMenu
|
|
53
48
|
};
|
|
54
|
-
const processedComponentProps =
|
|
49
|
+
const processedComponentProps = processedSlotProps[key];
|
|
55
50
|
if (processedComponentProps) {
|
|
56
51
|
const customProps = _objectWithoutPropertiesLoose(processedComponentProps, _excluded);
|
|
57
52
|
itemProps = _extends({}, itemProps, customProps);
|
|
58
53
|
}
|
|
59
54
|
return addDividers && index !== sorted.length - 1 ? [...acc, [processedComponents[key], itemProps], [Divider, {}]] : [...acc, [processedComponents[key], itemProps]];
|
|
60
55
|
}, []);
|
|
61
|
-
}, [addDividers, colDef, defaultItems, hideMenu, processedComponents,
|
|
56
|
+
}, [addDividers, colDef, defaultItems, hideMenu, processedComponents, processedSlotProps, userItems]);
|
|
62
57
|
};
|
|
63
|
-
export {
|
|
58
|
+
export { useGridColumnMenuSlots };
|
|
@@ -226,7 +226,7 @@ export function useGridColumns(apiRef, props) {
|
|
|
226
226
|
if (props.disableColumnSelector) {
|
|
227
227
|
return columnMenuItems;
|
|
228
228
|
}
|
|
229
|
-
return [...columnMenuItems, '
|
|
229
|
+
return [...columnMenuItems, 'columnMenuColumnsItem'];
|
|
230
230
|
}, [props.disableColumnSelector]);
|
|
231
231
|
useGridRegisterPipeProcessor(apiRef, 'columnMenu', addColumnMenuItems);
|
|
232
232
|
useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);
|
|
@@ -242,13 +242,17 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
242
242
|
initialValue
|
|
243
243
|
} = params;
|
|
244
244
|
let newValue = apiRef.current.getCellValue(id, field);
|
|
245
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
246
|
+
let unstable_updateValueOnRender = false;
|
|
245
247
|
if (deleteValue || initialValue) {
|
|
246
248
|
newValue = deleteValue ? '' : initialValue;
|
|
249
|
+
unstable_updateValueOnRender = true;
|
|
247
250
|
}
|
|
248
251
|
const newProps = {
|
|
249
252
|
value: newValue,
|
|
250
253
|
error: false,
|
|
251
|
-
isProcessingProps: false
|
|
254
|
+
isProcessingProps: false,
|
|
255
|
+
unstable_updateValueOnRender
|
|
252
256
|
};
|
|
253
257
|
updateOrDeleteFieldState(id, field, newProps);
|
|
254
258
|
apiRef.current.setCellFocus(id, field);
|
|
@@ -110,9 +110,7 @@ export const useGridEditing = (apiRef, props) => {
|
|
|
110
110
|
}, [apiRef, props.editMode]);
|
|
111
111
|
const getEditCellMeta = React.useCallback((id, field) => {
|
|
112
112
|
const editingState = gridEditRowsStateSelector(apiRef.current.state);
|
|
113
|
-
return
|
|
114
|
-
changeReason: editingState[id][field].changeReason
|
|
115
|
-
};
|
|
113
|
+
return editingState[id][field];
|
|
116
114
|
}, [apiRef]);
|
|
117
115
|
const editingSharedApi = {
|
|
118
116
|
isCellEditable,
|
|
@@ -310,13 +310,17 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
310
310
|
return acc;
|
|
311
311
|
}
|
|
312
312
|
let newValue = apiRef.current.getCellValue(id, field);
|
|
313
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
314
|
+
let unstable_updateValueOnRender = false;
|
|
313
315
|
if (fieldToFocus === field && (deleteValue || initialValue)) {
|
|
314
316
|
newValue = deleteValue ? '' : initialValue;
|
|
317
|
+
unstable_updateValueOnRender = true;
|
|
315
318
|
}
|
|
316
319
|
acc[field] = {
|
|
317
320
|
value: newValue,
|
|
318
321
|
error: false,
|
|
319
|
-
isProcessingProps: false
|
|
322
|
+
isProcessingProps: false,
|
|
323
|
+
unstable_updateValueOnRender
|
|
320
324
|
};
|
|
321
325
|
return acc;
|
|
322
326
|
}, {});
|
|
@@ -4,4 +4,9 @@ export const getDefaultGridFilterModel = () => ({
|
|
|
4
4
|
logicOperator: GridLogicOperator.And,
|
|
5
5
|
quickFilterValues: [],
|
|
6
6
|
quickFilterLogicOperator: GridLogicOperator.And
|
|
7
|
-
});
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @param {GridRowId} rowId The id of the row we want to filter.
|
|
11
|
+
* @param {(filterItem: GridFilterItem) => boolean} shouldApplyItem An optional callback to allow the filtering engine to only apply some items.
|
|
12
|
+
*/
|
|
@@ -57,7 +57,7 @@ export const useGridFilter = (apiRef, props) => {
|
|
|
57
57
|
if (colDef == null || colDef.filterable === false || props.disableColumnFilter) {
|
|
58
58
|
return columnMenuItems;
|
|
59
59
|
}
|
|
60
|
-
return [...columnMenuItems, '
|
|
60
|
+
return [...columnMenuItems, 'columnMenuFilterItem'];
|
|
61
61
|
}, [props.disableColumnFilter]);
|
|
62
62
|
|
|
63
63
|
/**
|
|
@@ -111,6 +111,11 @@ export const useGridFilter = (apiRef, props) => {
|
|
|
111
111
|
const filterModel = gridFilterModelSelector(apiRef);
|
|
112
112
|
const filterItemsWithValue = filterModel.items.filter(item => {
|
|
113
113
|
if (item.value !== undefined) {
|
|
114
|
+
// Some filters like `isAnyOf` support array as `item.value`.
|
|
115
|
+
// If array is empty, we want to remove it from the filter model.
|
|
116
|
+
if (Array.isArray(item.value) && item.value.length === 0) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
114
119
|
return true;
|
|
115
120
|
}
|
|
116
121
|
const column = apiRef.current.getColumn(item.field);
|
|
@@ -70,7 +70,7 @@ export const useGridSorting = (apiRef, props) => {
|
|
|
70
70
|
}
|
|
71
71
|
const sortingOrder = colDef.sortingOrder || props.sortingOrder;
|
|
72
72
|
if (sortingOrder.some(item => !!item)) {
|
|
73
|
-
return [...columnMenuItems, '
|
|
73
|
+
return [...columnMenuItems, 'columnMenuSortItem'];
|
|
74
74
|
}
|
|
75
75
|
return columnMenuItems;
|
|
76
76
|
}, [props.sortingOrder]);
|
|
@@ -425,7 +425,7 @@ export const useGridVirtualScroller = props => {
|
|
|
425
425
|
prevRootRowStyle.current = rootRowStyle;
|
|
426
426
|
return rows;
|
|
427
427
|
};
|
|
428
|
-
const needsHorizontalScrollbar = containerDimensions.width && columnsTotalWidth
|
|
428
|
+
const needsHorizontalScrollbar = containerDimensions.width && columnsTotalWidth >= containerDimensions.width;
|
|
429
429
|
const contentSize = React.useMemo(() => {
|
|
430
430
|
// In cases where the columns exceed the available width,
|
|
431
431
|
// the horizontal scrollbar should be shown even when there're no rows.
|
package/modern/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-data-grid v6.0
|
|
2
|
+
* @mui/x-data-grid v6.1.0
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -22,10 +22,18 @@ export { GridColumnHeaders } from './components/GridColumnHeaders';
|
|
|
22
22
|
/**
|
|
23
23
|
* Reexportable components.
|
|
24
24
|
*/
|
|
25
|
-
export { GridColumnMenu,
|
|
25
|
+
export { GridColumnMenu, GRID_COLUMN_MENU_SLOTS, GRID_COLUMN_MENU_SLOT_PROPS } from './components/reexportable';
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* The full grid API.
|
|
29
29
|
* @demos
|
|
30
30
|
* - [API object](/x/react-data-grid/api-object/)
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The state of `DataGrid`.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The initial state of `DataGrid`.
|
|
31
39
|
*/
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// This allows not to bump the minimal version of `@mui/material` in peerDependencies which results
|
|
4
4
|
// in broader compatibility between the packages.
|
|
5
5
|
// See https://github.com/mui/mui-x/pull/7646#issuecomment-1404605556 for additional context.
|
|
6
|
-
|
|
7
6
|
export const beBYCore = {
|
|
8
7
|
components: {
|
|
9
8
|
MuiTablePagination: {
|
package/modern/locales/daDK.js
CHANGED
|
@@ -20,17 +20,15 @@ const daDKGrid = {
|
|
|
20
20
|
toolbarFiltersTooltipShow: 'Vis filtre',
|
|
21
21
|
toolbarFiltersTooltipActive: count => count !== 1 ? `${count} aktive filtre` : `${count} aktivt filter`,
|
|
22
22
|
// Quick filter toolbar field
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
toolbarQuickFilterPlaceholder: 'Søg…',
|
|
24
|
+
toolbarQuickFilterLabel: 'Søg',
|
|
25
|
+
toolbarQuickFilterDeleteIconLabel: 'Ryd',
|
|
27
26
|
// Export selector toolbar button text
|
|
28
|
-
|
|
27
|
+
toolbarExport: 'Eksport',
|
|
29
28
|
toolbarExportLabel: 'Eksporter',
|
|
30
29
|
toolbarExportCSV: 'Download som CSV',
|
|
31
30
|
toolbarExportPrint: 'Print',
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
toolbarExportExcel: 'Download som Excel',
|
|
34
32
|
// Columns panel text
|
|
35
33
|
columnsPanelTextFieldLabel: 'Find kolonne',
|
|
36
34
|
columnsPanelTextFieldPlaceholder: 'Kolonne titel',
|
|
@@ -39,7 +37,7 @@ const daDKGrid = {
|
|
|
39
37
|
columnsPanelHideAllButton: 'Skjul alle',
|
|
40
38
|
// Filter panel text
|
|
41
39
|
filterPanelAddFilter: 'Tilføj filter',
|
|
42
|
-
|
|
40
|
+
filterPanelRemoveAll: 'Fjern alle',
|
|
43
41
|
filterPanelDeleteIconLabel: 'Slet',
|
|
44
42
|
filterPanelLogicOperator: 'Logisk operator',
|
|
45
43
|
filterPanelOperator: 'Operatorer',
|
|
@@ -69,7 +67,7 @@ const daDKGrid = {
|
|
|
69
67
|
// Column menu text
|
|
70
68
|
columnMenuLabel: 'Menu',
|
|
71
69
|
columnMenuShowColumns: 'Vis Kolonner',
|
|
72
|
-
|
|
70
|
+
columnMenuManageColumns: 'Administrer kolonner',
|
|
73
71
|
columnMenuFilter: 'Filtre',
|
|
74
72
|
columnMenuHideColumn: 'Skjul',
|
|
75
73
|
columnMenuUnsort: 'Fjern sortering',
|
|
@@ -109,20 +107,17 @@ const daDKGrid = {
|
|
|
109
107
|
groupColumn: name => `Gruppér efter ${name}`,
|
|
110
108
|
unGroupColumn: name => `Fjern gruppéring efter ${name}`,
|
|
111
109
|
// Master/detail
|
|
112
|
-
|
|
110
|
+
detailPanelToggle: 'Udvid/kollaps detaljepanel',
|
|
113
111
|
expandDetailPanel: 'Udvid',
|
|
114
|
-
collapseDetailPanel: 'Kollaps'
|
|
115
|
-
|
|
112
|
+
collapseDetailPanel: 'Kollaps',
|
|
116
113
|
// Row reordering text
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
rowReorderingHeaderName: 'Omarrangering af rækker',
|
|
119
115
|
// Aggregation
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
116
|
+
aggregationMenuItemHeader: 'Aggregation',
|
|
117
|
+
aggregationFunctionLabelSum: 'sum',
|
|
118
|
+
aggregationFunctionLabelAvg: 'gns',
|
|
119
|
+
aggregationFunctionLabelMin: 'min',
|
|
120
|
+
aggregationFunctionLabelMax: 'max',
|
|
121
|
+
aggregationFunctionLabelSize: 'størrelse'
|
|
126
122
|
};
|
|
127
|
-
|
|
128
123
|
export const daDK = getGridLocalization(daDKGrid, daDKCore);
|
package/modern/locales/esES.js
CHANGED
|
@@ -67,7 +67,7 @@ const esESGrid = {
|
|
|
67
67
|
// Column menu text
|
|
68
68
|
columnMenuLabel: 'Menú',
|
|
69
69
|
columnMenuShowColumns: 'Mostrar columnas',
|
|
70
|
-
|
|
70
|
+
columnMenuManageColumns: 'Administrar columnas',
|
|
71
71
|
columnMenuFilter: 'Filtro',
|
|
72
72
|
columnMenuHideColumn: 'Ocultar',
|
|
73
73
|
columnMenuUnsort: 'Desordenar',
|
package/modern/locales/huHU.js
CHANGED
|
@@ -20,17 +20,15 @@ const huHUGrid = {
|
|
|
20
20
|
toolbarFiltersTooltipShow: 'Szűrők megjelenítése',
|
|
21
21
|
toolbarFiltersTooltipActive: count => `${count} aktív szűrő`,
|
|
22
22
|
// Quick filter toolbar field
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
toolbarQuickFilterPlaceholder: 'Keresés…',
|
|
24
|
+
toolbarQuickFilterLabel: 'Keresés',
|
|
25
|
+
toolbarQuickFilterDeleteIconLabel: 'Törlés',
|
|
27
26
|
// Export selector toolbar button text
|
|
28
27
|
toolbarExport: 'Exportálás',
|
|
29
28
|
toolbarExportLabel: 'Exportálás',
|
|
30
29
|
toolbarExportCSV: 'Mentés CSV fájlként',
|
|
31
30
|
toolbarExportPrint: 'Nyomtatás',
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
toolbarExportExcel: 'Mentés Excel fájlként',
|
|
34
32
|
// Columns panel text
|
|
35
33
|
columnsPanelTextFieldLabel: 'Oszlop keresése',
|
|
36
34
|
columnsPanelTextFieldPlaceholder: 'Oszlop neve',
|
|
@@ -39,7 +37,7 @@ const huHUGrid = {
|
|
|
39
37
|
columnsPanelHideAllButton: 'Összes elrejtése',
|
|
40
38
|
// Filter panel text
|
|
41
39
|
filterPanelAddFilter: 'Szűrő hozzáadása',
|
|
42
|
-
|
|
40
|
+
filterPanelRemoveAll: 'Összes törlése',
|
|
43
41
|
filterPanelDeleteIconLabel: 'Törlés',
|
|
44
42
|
filterPanelLogicOperator: 'Logikai operátor',
|
|
45
43
|
filterPanelOperator: 'Operátorok',
|
|
@@ -69,7 +67,7 @@ const huHUGrid = {
|
|
|
69
67
|
// Column menu text
|
|
70
68
|
columnMenuLabel: 'Menü',
|
|
71
69
|
columnMenuShowColumns: 'Oszlopok megjelenítése',
|
|
72
|
-
|
|
70
|
+
columnMenuManageColumns: 'Oszlopok kezelése',
|
|
73
71
|
columnMenuFilter: 'Szűrők',
|
|
74
72
|
columnMenuHideColumn: 'Elrejtés',
|
|
75
73
|
columnMenuUnsort: 'Sorrend visszaállítása',
|
|
@@ -109,20 +107,17 @@ const huHUGrid = {
|
|
|
109
107
|
groupColumn: name => `Csoportosítás ${name} szerint`,
|
|
110
108
|
unGroupColumn: name => `${name} szerinti csoportosítás törlése`,
|
|
111
109
|
// Master/detail
|
|
112
|
-
|
|
110
|
+
detailPanelToggle: 'Részletek panel váltása',
|
|
113
111
|
expandDetailPanel: 'Kibontás',
|
|
114
|
-
collapseDetailPanel: 'Összecsukás'
|
|
115
|
-
|
|
112
|
+
collapseDetailPanel: 'Összecsukás',
|
|
116
113
|
// Row reordering text
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
rowReorderingHeaderName: 'Sorok újrarendezése',
|
|
119
115
|
// Aggregation
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
116
|
+
aggregationMenuItemHeader: 'Összesítés',
|
|
117
|
+
aggregationFunctionLabelSum: 'Összeg',
|
|
118
|
+
aggregationFunctionLabelAvg: 'Átlag',
|
|
119
|
+
aggregationFunctionLabelMin: 'Minimum',
|
|
120
|
+
aggregationFunctionLabelMax: 'Maximum',
|
|
121
|
+
aggregationFunctionLabelSize: 'Darabszám'
|
|
126
122
|
};
|
|
127
|
-
|
|
128
123
|
export const huHU = getGridLocalization(huHUGrid, huHUCore);
|
package/modern/locales/jaJP.js
CHANGED
|
@@ -37,7 +37,7 @@ const jaJPGrid = {
|
|
|
37
37
|
columnsPanelHideAllButton: 'すべて非表示',
|
|
38
38
|
// Filter panel text
|
|
39
39
|
filterPanelAddFilter: 'フィルター追加',
|
|
40
|
-
|
|
40
|
+
filterPanelRemoveAll: 'すべて削除',
|
|
41
41
|
filterPanelDeleteIconLabel: '削除',
|
|
42
42
|
filterPanelLogicOperator: '論理演算子',
|
|
43
43
|
filterPanelOperator: '演算子',
|
package/modern/locales/nbNO.js
CHANGED
|
@@ -37,7 +37,7 @@ const nbNOGrid = {
|
|
|
37
37
|
columnsPanelHideAllButton: 'Skjul alle',
|
|
38
38
|
// Filter panel text
|
|
39
39
|
filterPanelAddFilter: 'Legg til filter',
|
|
40
|
-
|
|
40
|
+
filterPanelRemoveAll: 'Fjern alle',
|
|
41
41
|
filterPanelDeleteIconLabel: 'Slett',
|
|
42
42
|
filterPanelLogicOperator: 'Logisk operator',
|
|
43
43
|
filterPanelOperator: 'Operatører',
|
|
@@ -67,7 +67,7 @@ const nbNOGrid = {
|
|
|
67
67
|
// Column menu text
|
|
68
68
|
columnMenuLabel: 'Meny',
|
|
69
69
|
columnMenuShowColumns: 'Vis kolonner',
|
|
70
|
-
|
|
70
|
+
columnMenuManageColumns: 'Administrer kolonner',
|
|
71
71
|
columnMenuFilter: 'Filter',
|
|
72
72
|
columnMenuHideColumn: 'Skjul',
|
|
73
73
|
columnMenuUnsort: 'Usorter',
|
|
@@ -107,19 +107,17 @@ const nbNOGrid = {
|
|
|
107
107
|
groupColumn: name => `Grupper på ${name}`,
|
|
108
108
|
unGroupColumn: name => `Stopp å grupper på ${name}`,
|
|
109
109
|
// Master/detail
|
|
110
|
-
|
|
110
|
+
detailPanelToggle: 'Utvid/kollaps detalj panel',
|
|
111
111
|
expandDetailPanel: 'Utvid',
|
|
112
112
|
collapseDetailPanel: 'Kollaps',
|
|
113
113
|
// Row reordering text
|
|
114
|
-
rowReorderingHeaderName: 'Rad reorganisering'
|
|
115
|
-
|
|
114
|
+
rowReorderingHeaderName: 'Rad reorganisering',
|
|
116
115
|
// Aggregation
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
116
|
+
aggregationMenuItemHeader: 'Aggregering',
|
|
117
|
+
aggregationFunctionLabelSum: 'sum',
|
|
118
|
+
aggregationFunctionLabelAvg: 'snitt',
|
|
119
|
+
aggregationFunctionLabelMin: 'min',
|
|
120
|
+
aggregationFunctionLabelMax: 'maks',
|
|
121
|
+
aggregationFunctionLabelSize: 'størrelse'
|
|
123
122
|
};
|
|
124
|
-
|
|
125
123
|
export const nbNO = getGridLocalization(nbNOGrid, nbNOCore);
|
package/modern/locales/nlNL.js
CHANGED
|
@@ -37,7 +37,7 @@ const nlNLGrid = {
|
|
|
37
37
|
columnsPanelHideAllButton: 'Alles verbergen',
|
|
38
38
|
// Filter panel text
|
|
39
39
|
filterPanelAddFilter: 'Filter toevoegen',
|
|
40
|
-
|
|
40
|
+
filterPanelRemoveAll: 'Alles verwijderen',
|
|
41
41
|
filterPanelDeleteIconLabel: 'Verwijderen',
|
|
42
42
|
filterPanelLogicOperator: 'Logische operator',
|
|
43
43
|
filterPanelOperator: 'Operatoren',
|
|
@@ -67,7 +67,7 @@ const nlNLGrid = {
|
|
|
67
67
|
// Column menu text
|
|
68
68
|
columnMenuLabel: 'Menu',
|
|
69
69
|
columnMenuShowColumns: 'Toon kolommen',
|
|
70
|
-
|
|
70
|
+
columnMenuManageColumns: 'Kolommen beheren',
|
|
71
71
|
columnMenuFilter: 'Filteren',
|
|
72
72
|
columnMenuHideColumn: 'Verbergen',
|
|
73
73
|
columnMenuUnsort: 'Annuleer sortering',
|
|
@@ -107,7 +107,7 @@ const nlNLGrid = {
|
|
|
107
107
|
groupColumn: name => `Groepeer op ${name}`,
|
|
108
108
|
unGroupColumn: name => `Stop groeperen op ${name}`,
|
|
109
109
|
// Master/detail
|
|
110
|
-
|
|
110
|
+
detailPanelToggle: 'Detailmenu in- of uitklappen',
|
|
111
111
|
expandDetailPanel: 'Uitklappen',
|
|
112
112
|
collapseDetailPanel: 'Inklappen',
|
|
113
113
|
// Row reordering text
|
package/modern/locales/ptBR.js
CHANGED
|
@@ -111,15 +111,13 @@ const ptBRGrid = {
|
|
|
111
111
|
expandDetailPanel: 'Expandir',
|
|
112
112
|
collapseDetailPanel: 'Esconder',
|
|
113
113
|
// Row reordering text
|
|
114
|
-
rowReorderingHeaderName: 'Reorganizar linhas'
|
|
115
|
-
|
|
114
|
+
rowReorderingHeaderName: 'Reorganizar linhas',
|
|
116
115
|
// Aggregation
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
116
|
+
aggregationMenuItemHeader: 'Agrupar',
|
|
117
|
+
aggregationFunctionLabelSum: 'soma',
|
|
118
|
+
aggregationFunctionLabelAvg: 'média',
|
|
119
|
+
aggregationFunctionLabelMin: 'mín',
|
|
120
|
+
aggregationFunctionLabelMax: 'máx',
|
|
121
|
+
aggregationFunctionLabelSize: 'tamanho'
|
|
123
122
|
};
|
|
124
|
-
|
|
125
123
|
export const ptBR = getGridLocalization(ptBRGrid, ptBRCore);
|
package/modern/locales/ruRU.js
CHANGED
|
@@ -76,7 +76,7 @@ const ruRUGrid = {
|
|
|
76
76
|
// Column menu text
|
|
77
77
|
columnMenuLabel: 'Меню',
|
|
78
78
|
columnMenuShowColumns: 'Показать столбцы',
|
|
79
|
-
|
|
79
|
+
columnMenuManageColumns: 'Управление колонками',
|
|
80
80
|
columnMenuFilter: 'Фильтр',
|
|
81
81
|
columnMenuHideColumn: 'Скрыть',
|
|
82
82
|
columnMenuUnsort: 'Отменить сортировку',
|
package/modern/locales/svSE.js
CHANGED
|
@@ -37,7 +37,7 @@ const svSEGrid = {
|
|
|
37
37
|
columnsPanelHideAllButton: 'Dölj alla',
|
|
38
38
|
// Filter panel text
|
|
39
39
|
filterPanelAddFilter: 'Lägg till filter',
|
|
40
|
-
|
|
40
|
+
filterPanelRemoveAll: 'Ta bort alla',
|
|
41
41
|
filterPanelDeleteIconLabel: 'Ta bort',
|
|
42
42
|
filterPanelLogicOperator: 'Logisk operatör',
|
|
43
43
|
filterPanelOperator: 'Operatör',
|
|
@@ -67,7 +67,7 @@ const svSEGrid = {
|
|
|
67
67
|
// Column menu text
|
|
68
68
|
columnMenuLabel: 'Meny',
|
|
69
69
|
columnMenuShowColumns: 'Visa kolumner',
|
|
70
|
-
|
|
70
|
+
columnMenuManageColumns: 'Hantera kolumner',
|
|
71
71
|
columnMenuFilter: 'Filtrera',
|
|
72
72
|
columnMenuHideColumn: 'Dölj',
|
|
73
73
|
columnMenuUnsort: 'Osortera',
|
|
@@ -32,5 +32,13 @@ var GridRowEditStopReasons = /*#__PURE__*/function (GridRowEditStopReasons) {
|
|
|
32
32
|
GridRowEditStopReasons["shiftTabKeyDown"] = "shiftTabKeyDown";
|
|
33
33
|
return GridRowEditStopReasons;
|
|
34
34
|
}(GridRowEditStopReasons || {});
|
|
35
|
+
/**
|
|
36
|
+
* Object passed as parameter in the row `getRowSpacing` callback prop.
|
|
37
|
+
* @demos
|
|
38
|
+
* - [Row spacing](/x/react-data-grid/row-height/#row-spacing)
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* The getRowSpacing return value.
|
|
42
|
+
*/
|
|
35
43
|
// https://github.com/mui/mui-x/pull/3738#discussion_r798504277
|
|
36
44
|
export { GridRowEditStartReasons, GridRowEditStopReasons };
|
|
@@ -1,39 +1,35 @@
|
|
|
1
1
|
import { createSelector as reselectCreateSelector } from 'reselect';
|
|
2
2
|
import { buildWarning } from './warning';
|
|
3
3
|
const cacheContainer = {
|
|
4
|
-
cache:
|
|
4
|
+
cache: new WeakMap()
|
|
5
5
|
};
|
|
6
6
|
const missingInstanceIdWarning = buildWarning(['MUI: A selector was called without passing the instance ID, which may impact the performance of the grid.', 'To fix, call it with `apiRef`, e.g. `mySelector(apiRef)`, or pass the instance ID explicitly, e.g `mySelector(state, apiRef.current.instanceId)`.']);
|
|
7
7
|
export const createSelector = (...args) => {
|
|
8
|
-
if (cacheContainer.cache === null) {
|
|
9
|
-
cacheContainer.cache = {};
|
|
10
|
-
}
|
|
11
8
|
const selector = (...selectorArgs) => {
|
|
12
9
|
const [stateOrApiRef, instanceId] = selectorArgs;
|
|
13
10
|
const isApiRef = !!stateOrApiRef.current;
|
|
14
|
-
const cacheKey = isApiRef ? stateOrApiRef.current.instanceId : instanceId ??
|
|
11
|
+
const cacheKey = isApiRef ? stateOrApiRef.current.instanceId : instanceId ?? {
|
|
12
|
+
id: 'default'
|
|
13
|
+
};
|
|
15
14
|
const state = isApiRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
16
15
|
if (process.env.NODE_ENV !== 'production') {
|
|
17
|
-
if (cacheKey === 'default') {
|
|
16
|
+
if (cacheKey.id === 'default') {
|
|
18
17
|
missingInstanceIdWarning();
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
|
-
if (cacheContainer.cache === null) {
|
|
22
|
-
cacheContainer.cache = {};
|
|
23
|
-
}
|
|
24
20
|
const {
|
|
25
21
|
cache
|
|
26
22
|
} = cacheContainer;
|
|
27
|
-
if (cache
|
|
23
|
+
if (cache.get(cacheKey) && cache.get(cacheKey)?.get(args)) {
|
|
28
24
|
// We pass the cache key because the called selector might have as
|
|
29
25
|
// dependency another selector created with this `createSelector`.
|
|
30
|
-
return cache
|
|
26
|
+
return cache.get(cacheKey)?.get(args)(state, cacheKey);
|
|
31
27
|
}
|
|
32
28
|
const newSelector = reselectCreateSelector(...args);
|
|
33
|
-
if (!cache
|
|
34
|
-
cache
|
|
29
|
+
if (!cache.get(cacheKey)) {
|
|
30
|
+
cache.set(cacheKey, new Map());
|
|
35
31
|
}
|
|
36
|
-
cache
|
|
32
|
+
cache.get(cacheKey)?.set(args, newSelector);
|
|
37
33
|
return newSelector(state, cacheKey);
|
|
38
34
|
};
|
|
39
35
|
|
|
@@ -44,12 +40,6 @@ export const createSelector = (...args) => {
|
|
|
44
40
|
};
|
|
45
41
|
|
|
46
42
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
47
|
-
export const unstable_resetCreateSelectorCache =
|
|
48
|
-
|
|
49
|
-
if (cacheContainer.cache && cacheContainer.cache[cacheKey]) {
|
|
50
|
-
delete cacheContainer.cache[cacheKey];
|
|
51
|
-
}
|
|
52
|
-
} else {
|
|
53
|
-
cacheContainer.cache = null;
|
|
54
|
-
}
|
|
43
|
+
export const unstable_resetCreateSelectorCache = () => {
|
|
44
|
+
cacheContainer.cache = new WeakMap();
|
|
55
45
|
};
|
|
@@ -12,7 +12,9 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
12
12
|
var _utils = require("@mui/utils");
|
|
13
13
|
var _createDetectElementResize = _interopRequireDefault(require("../lib/createDetectElementResize"));
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
const _excluded = ["children", "defaultHeight", "defaultWidth", "disableHeight", "disableWidth", "nonce", "onResize", "style"];
|
|
15
|
+
const _excluded = ["children", "defaultHeight", "defaultWidth", "disableHeight", "disableWidth", "nonce", "onResize", "style"]; // TODO replace with https://caniuse.com/resizeobserver.
|
|
16
|
+
// Credit to https://github.com/bvaughn/react-virtualized/blob/master/source/AutoSizer/AutoSizer.js
|
|
17
|
+
// for the sources.
|
|
16
18
|
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); }
|
|
17
19
|
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; }
|
|
18
20
|
const GridAutoSizer = /*#__PURE__*/React.forwardRef(function AutoSizer(props, ref) {
|