@mui/x-data-grid 6.0.3 → 6.0.4
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 +61 -0
- package/components/GridPagination.d.ts +2 -2
- package/components/GridRow.js +1 -1
- 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/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/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/useGridColumns.js +1 -1
- package/hooks/features/filter/useGridFilter.js +1 -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 +2 -2
- package/legacy/components/GridRow.js +1 -1
- 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/filterPanel/GridFilterPanel.js +1 -1
- package/legacy/components/reexportable.js +1 -1
- package/legacy/hooks/features/columnMenu/{useGridColumnMenuComponents.js → useGridColumnMenuSlots.js} +25 -30
- package/legacy/hooks/features/columns/useGridColumns.js +1 -1
- package/legacy/hooks/features/filter/useGridFilter.js +1 -1
- package/legacy/hooks/features/sorting/useGridSorting.js +1 -1
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +1 -1
- package/legacy/index.js +2 -2
- package/legacy/locales/daDK.js +16 -21
- package/legacy/locales/esES.js +1 -1
- package/legacy/locales/nbNO.js +10 -12
- package/legacy/locales/svSE.js +2 -2
- package/locales/daDK.js +16 -21
- package/locales/esES.js +1 -1
- package/locales/nbNO.js +10 -12
- package/locales/svSE.js +2 -2
- package/modern/components/GridRow.js +1 -1
- 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/filterPanel/GridFilterPanel.js +1 -1
- package/modern/components/reexportable.js +1 -1
- package/modern/hooks/features/columnMenu/{useGridColumnMenuComponents.js → useGridColumnMenuSlots.js} +21 -26
- package/modern/hooks/features/columns/useGridColumns.js +1 -1
- package/modern/hooks/features/filter/useGridFilter.js +1 -1
- package/modern/hooks/features/sorting/useGridSorting.js +1 -1
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +1 -1
- package/modern/index.js +2 -2
- package/modern/locales/daDK.js +16 -21
- package/modern/locales/esES.js +1 -1
- package/modern/locales/nbNO.js +10 -12
- package/modern/locales/svSE.js +2 -2
- package/node/components/GridRow.js +1 -1
- 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/filterPanel/GridFilterPanel.js +1 -1
- package/node/components/reexportable.js +4 -4
- package/node/hooks/features/columnMenu/{useGridColumnMenuComponents.js → useGridColumnMenuSlots.js} +22 -27
- package/node/hooks/features/columns/useGridColumns.js +1 -1
- package/node/hooks/features/filter/useGridFilter.js +1 -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/nbNO.js +10 -12
- package/node/locales/svSE.js +2 -2
- package/package.json +1 -1
package/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',
|
|
@@ -48,7 +48,7 @@ function EmptyCell({
|
|
|
48
48
|
width
|
|
49
49
|
};
|
|
50
50
|
return /*#__PURE__*/_jsx("div", {
|
|
51
|
-
className:
|
|
51
|
+
className: `${gridClasses.cell} ${gridClasses.withBorderColor}`,
|
|
52
52
|
style: style
|
|
53
53
|
}); // TODO change to .MuiDataGrid-emptyCell or .MuiDataGrid-rowFiller
|
|
54
54
|
}
|
|
@@ -46,14 +46,13 @@ const ColumnHeaderInnerTitle = /*#__PURE__*/React.forwardRef(function ColumnHead
|
|
|
46
46
|
function GridColumnHeaderTitle(props) {
|
|
47
47
|
const {
|
|
48
48
|
label,
|
|
49
|
-
description
|
|
50
|
-
columnWidth
|
|
49
|
+
description
|
|
51
50
|
} = props;
|
|
52
51
|
const rootProps = useGridRootProps();
|
|
53
52
|
const titleRef = React.useRef(null);
|
|
54
53
|
const [tooltip, setTooltip] = React.useState('');
|
|
55
|
-
React.
|
|
56
|
-
if (!description && titleRef
|
|
54
|
+
const handleMouseOver = React.useCallback(() => {
|
|
55
|
+
if (!description && titleRef?.current) {
|
|
57
56
|
const isOver = isOverflown(titleRef.current);
|
|
58
57
|
if (isOver) {
|
|
59
58
|
setTooltip(label);
|
|
@@ -61,11 +60,12 @@ function GridColumnHeaderTitle(props) {
|
|
|
61
60
|
setTooltip('');
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
|
-
}, [
|
|
63
|
+
}, [description, label]);
|
|
65
64
|
return /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({
|
|
66
65
|
title: description || tooltip
|
|
67
66
|
}, rootProps.slotProps?.baseTooltip, {
|
|
68
67
|
children: /*#__PURE__*/_jsx(ColumnHeaderInnerTitle, {
|
|
68
|
+
onMouseOver: handleMouseOver,
|
|
69
69
|
ref: titleRef,
|
|
70
70
|
children: label
|
|
71
71
|
})
|
|
@@ -20,8 +20,10 @@ function GridColumnHeaderMenu({
|
|
|
20
20
|
const hideMenu = React.useCallback(event => {
|
|
21
21
|
// Prevent triggering the sorting
|
|
22
22
|
event.stopPropagation();
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
if (!target?.contains(event.target)) {
|
|
24
|
+
apiRef.current.hideColumnMenu();
|
|
25
|
+
}
|
|
26
|
+
}, [apiRef, target]);
|
|
25
27
|
if (!target) {
|
|
26
28
|
return null;
|
|
27
29
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["
|
|
3
|
+
const _excluded = ["defaultSlots", "defaultSlotProps", "slots", "slotProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import {
|
|
6
|
+
import { useGridColumnMenuSlots } from '../../../hooks/features/columnMenu/useGridColumnMenuSlots';
|
|
7
7
|
import { GridColumnMenuContainer } from './GridColumnMenuContainer';
|
|
8
8
|
import { GridColumnMenuColumnsItem } from './menuItems/GridColumnMenuColumnsItem';
|
|
9
9
|
import { GridColumnMenuFilterItem } from './menuItems/GridColumnMenuFilterItem';
|
|
10
10
|
import { GridColumnMenuSortItem } from './menuItems/GridColumnMenuSortItem';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
export const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
export const GRID_COLUMN_MENU_SLOTS = {
|
|
13
|
+
columnMenuSortItem: GridColumnMenuSortItem,
|
|
14
|
+
columnMenuFilterItem: GridColumnMenuFilterItem,
|
|
15
|
+
columnMenuColumnsItem: GridColumnMenuColumnsItem
|
|
16
16
|
};
|
|
17
|
-
export const
|
|
17
|
+
export const GRID_COLUMN_MENU_SLOT_PROPS = {
|
|
18
18
|
columnMenuSortItem: {
|
|
19
19
|
displayOrder: 10
|
|
20
20
|
},
|
|
@@ -27,29 +27,29 @@ export const GRID_COLUMN_MENU_COMPONENTS_PROPS = {
|
|
|
27
27
|
};
|
|
28
28
|
const GridGenericColumnMenu = /*#__PURE__*/React.forwardRef(function GridGenericColumnMenu(props, ref) {
|
|
29
29
|
const {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
defaultSlots,
|
|
31
|
+
defaultSlotProps,
|
|
32
|
+
slots,
|
|
33
|
+
slotProps
|
|
34
34
|
} = props,
|
|
35
35
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
const orderedSlots = useGridColumnMenuSlots(_extends({}, other, {
|
|
37
|
+
defaultSlots,
|
|
38
|
+
defaultSlotProps,
|
|
39
|
+
slots,
|
|
40
|
+
slotProps
|
|
41
41
|
}));
|
|
42
42
|
return /*#__PURE__*/_jsx(GridColumnMenuContainer, _extends({
|
|
43
43
|
ref: ref
|
|
44
44
|
}, other, {
|
|
45
|
-
children:
|
|
45
|
+
children: orderedSlots.map(([Component, otherProps], index) => /*#__PURE__*/_jsx(Component, _extends({}, otherProps), index))
|
|
46
46
|
}));
|
|
47
47
|
});
|
|
48
48
|
const GridColumnMenu = /*#__PURE__*/React.forwardRef(function GridColumnMenu(props, ref) {
|
|
49
49
|
return /*#__PURE__*/_jsx(GridGenericColumnMenu, _extends({}, props, {
|
|
50
50
|
ref: ref,
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
defaultSlots: GRID_COLUMN_MENU_SLOTS,
|
|
52
|
+
defaultSlotProps: GRID_COLUMN_MENU_SLOT_PROPS
|
|
53
53
|
}));
|
|
54
54
|
});
|
|
55
55
|
process.env.NODE_ENV !== "production" ? GridColumnMenu.propTypes = {
|
|
@@ -58,20 +58,20 @@ process.env.NODE_ENV !== "production" ? GridColumnMenu.propTypes = {
|
|
|
58
58
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
59
59
|
// ----------------------------------------------------------------------
|
|
60
60
|
colDef: PropTypes.object.isRequired,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
*/
|
|
66
|
-
components: PropTypes.object,
|
|
61
|
+
hideMenu: PropTypes.func.isRequired,
|
|
62
|
+
id: PropTypes.string,
|
|
63
|
+
labelledby: PropTypes.string,
|
|
64
|
+
open: PropTypes.bool.isRequired,
|
|
67
65
|
/**
|
|
68
66
|
* Could be used to pass new props or override props specific to a column menu component
|
|
69
67
|
* e.g. `displayOrder`
|
|
70
68
|
*/
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
slotProps: PropTypes.object,
|
|
70
|
+
/**
|
|
71
|
+
* `slots` could be used to add new and (or) override default column menu items
|
|
72
|
+
* If you register a nee component you must pass it's `displayOrder` in `slotProps`
|
|
73
|
+
* or it will be placed in the end of the list
|
|
74
|
+
*/
|
|
75
|
+
slots: PropTypes.object
|
|
76
76
|
} : void 0;
|
|
77
77
|
export { GridColumnMenu, GridGenericColumnMenu };
|
|
@@ -143,7 +143,7 @@ const GridFilterPanel = /*#__PURE__*/React.forwardRef(function GridFilterPanel(p
|
|
|
143
143
|
logicOperators: logicOperators,
|
|
144
144
|
columnsSort: columnsSort
|
|
145
145
|
}, filterFormProps), item.id == null ? index : item.id))
|
|
146
|
-
}), !rootProps.disableMultipleColumnsFiltering && !disableAddFilterButton &&
|
|
146
|
+
}), !rootProps.disableMultipleColumnsFiltering && !(disableAddFilterButton && disableRemoveAllButton) ? /*#__PURE__*/_jsxs(GridPanelFooter, {
|
|
147
147
|
children: [!disableAddFilterButton ? /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({
|
|
148
148
|
onClick: addNewFilter,
|
|
149
149
|
startIcon: /*#__PURE__*/_jsx(rootProps.slots.filterPanelAddIcon, {})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { GridColumnMenu,
|
|
1
|
+
export { GridColumnMenu, GRID_COLUMN_MENU_SLOTS, GRID_COLUMN_MENU_SLOT_PROPS } from './menu/columnMenu/GridColumnMenu';
|
|
@@ -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);
|
|
@@ -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
|
/**
|
|
@@ -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.0.4
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -22,7 +22,7 @@ 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.
|
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/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/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',
|
|
@@ -56,7 +56,7 @@ function EmptyCell({
|
|
|
56
56
|
width
|
|
57
57
|
};
|
|
58
58
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
59
|
-
className:
|
|
59
|
+
className: `${_gridClasses.gridClasses.cell} ${_gridClasses.gridClasses.withBorderColor}`,
|
|
60
60
|
style: style
|
|
61
61
|
}); // TODO change to .MuiDataGrid-emptyCell or .MuiDataGrid-rowFiller
|
|
62
62
|
}
|
|
@@ -55,14 +55,13 @@ const ColumnHeaderInnerTitle = /*#__PURE__*/React.forwardRef(function ColumnHead
|
|
|
55
55
|
function GridColumnHeaderTitle(props) {
|
|
56
56
|
const {
|
|
57
57
|
label,
|
|
58
|
-
description
|
|
59
|
-
columnWidth
|
|
58
|
+
description
|
|
60
59
|
} = props;
|
|
61
60
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
62
61
|
const titleRef = React.useRef(null);
|
|
63
62
|
const [tooltip, setTooltip] = React.useState('');
|
|
64
|
-
React.
|
|
65
|
-
if (!description && titleRef
|
|
63
|
+
const handleMouseOver = React.useCallback(() => {
|
|
64
|
+
if (!description && titleRef?.current) {
|
|
66
65
|
const isOver = (0, _domUtils.isOverflown)(titleRef.current);
|
|
67
66
|
if (isOver) {
|
|
68
67
|
setTooltip(label);
|
|
@@ -70,11 +69,12 @@ function GridColumnHeaderTitle(props) {
|
|
|
70
69
|
setTooltip('');
|
|
71
70
|
}
|
|
72
71
|
}
|
|
73
|
-
}, [
|
|
72
|
+
}, [description, label]);
|
|
74
73
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTooltip, (0, _extends2.default)({
|
|
75
74
|
title: description || tooltip
|
|
76
75
|
}, rootProps.slotProps?.baseTooltip, {
|
|
77
76
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ColumnHeaderInnerTitle, {
|
|
77
|
+
onMouseOver: handleMouseOver,
|
|
78
78
|
ref: titleRef,
|
|
79
79
|
children: label
|
|
80
80
|
})
|
|
@@ -29,8 +29,10 @@ function GridColumnHeaderMenu({
|
|
|
29
29
|
const hideMenu = React.useCallback(event => {
|
|
30
30
|
// Prevent triggering the sorting
|
|
31
31
|
event.stopPropagation();
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
if (!target?.contains(event.target)) {
|
|
33
|
+
apiRef.current.hideColumnMenu();
|
|
34
|
+
}
|
|
35
|
+
}, [apiRef, target]);
|
|
34
36
|
if (!target) {
|
|
35
37
|
return null;
|
|
36
38
|
}
|