@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/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.
|
|
@@ -47,7 +47,7 @@ function EmptyCell(_ref) {
|
|
|
47
47
|
width: width
|
|
48
48
|
};
|
|
49
49
|
return /*#__PURE__*/_jsx("div", {
|
|
50
|
-
className: "
|
|
50
|
+
className: "".concat(gridClasses.cell, " ").concat(gridClasses.withBorderColor),
|
|
51
51
|
style: style
|
|
52
52
|
}); // TODO change to .MuiDataGrid-emptyCell or .MuiDataGrid-rowFiller
|
|
53
53
|
}
|
|
@@ -45,16 +45,15 @@ var ColumnHeaderInnerTitle = /*#__PURE__*/React.forwardRef(function ColumnHeader
|
|
|
45
45
|
function GridColumnHeaderTitle(props) {
|
|
46
46
|
var _rootProps$slotProps;
|
|
47
47
|
var label = props.label,
|
|
48
|
-
description = props.description
|
|
49
|
-
columnWidth = props.columnWidth;
|
|
48
|
+
description = props.description;
|
|
50
49
|
var rootProps = useGridRootProps();
|
|
51
50
|
var titleRef = React.useRef(null);
|
|
52
51
|
var _React$useState = React.useState(''),
|
|
53
52
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
54
53
|
tooltip = _React$useState2[0],
|
|
55
54
|
setTooltip = _React$useState2[1];
|
|
56
|
-
React.
|
|
57
|
-
if (!description && titleRef && titleRef.current) {
|
|
55
|
+
var handleMouseOver = React.useCallback(function () {
|
|
56
|
+
if (!description && titleRef != null && titleRef.current) {
|
|
58
57
|
var isOver = isOverflown(titleRef.current);
|
|
59
58
|
if (isOver) {
|
|
60
59
|
setTooltip(label);
|
|
@@ -62,11 +61,12 @@ function GridColumnHeaderTitle(props) {
|
|
|
62
61
|
setTooltip('');
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
|
-
}, [
|
|
64
|
+
}, [description, label]);
|
|
66
65
|
return /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({
|
|
67
66
|
title: description || tooltip
|
|
68
67
|
}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseTooltip, {
|
|
69
68
|
children: /*#__PURE__*/_jsx(ColumnHeaderInnerTitle, {
|
|
69
|
+
onMouseOver: handleMouseOver,
|
|
70
70
|
ref: titleRef,
|
|
71
71
|
children: label
|
|
72
72
|
})
|
|
@@ -19,8 +19,10 @@ function GridColumnHeaderMenu(_ref) {
|
|
|
19
19
|
var hideMenu = React.useCallback(function (event) {
|
|
20
20
|
// Prevent triggering the sorting
|
|
21
21
|
event.stopPropagation();
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
if (!(target != null && target.contains(event.target))) {
|
|
23
|
+
apiRef.current.hideColumnMenu();
|
|
24
|
+
}
|
|
25
|
+
}, [apiRef, target]);
|
|
24
26
|
if (!target) {
|
|
25
27
|
return null;
|
|
26
28
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["
|
|
4
|
+
var _excluded = ["defaultSlots", "defaultSlotProps", "slots", "slotProps"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
-
import {
|
|
7
|
+
import { useGridColumnMenuSlots } from '../../../hooks/features/columnMenu/useGridColumnMenuSlots';
|
|
8
8
|
import { GridColumnMenuContainer } from './GridColumnMenuContainer';
|
|
9
9
|
import { GridColumnMenuColumnsItem } from './menuItems/GridColumnMenuColumnsItem';
|
|
10
10
|
import { GridColumnMenuFilterItem } from './menuItems/GridColumnMenuFilterItem';
|
|
11
11
|
import { GridColumnMenuSortItem } from './menuItems/GridColumnMenuSortItem';
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
export var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
export var GRID_COLUMN_MENU_SLOTS = {
|
|
14
|
+
columnMenuSortItem: GridColumnMenuSortItem,
|
|
15
|
+
columnMenuFilterItem: GridColumnMenuFilterItem,
|
|
16
|
+
columnMenuColumnsItem: GridColumnMenuColumnsItem
|
|
17
17
|
};
|
|
18
|
-
export var
|
|
18
|
+
export var GRID_COLUMN_MENU_SLOT_PROPS = {
|
|
19
19
|
columnMenuSortItem: {
|
|
20
20
|
displayOrder: 10
|
|
21
21
|
},
|
|
@@ -27,33 +27,33 @@ export var GRID_COLUMN_MENU_COMPONENTS_PROPS = {
|
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
var GridGenericColumnMenu = /*#__PURE__*/React.forwardRef(function GridGenericColumnMenu(props, ref) {
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
var defaultSlots = props.defaultSlots,
|
|
31
|
+
defaultSlotProps = props.defaultSlotProps,
|
|
32
|
+
slots = props.slots,
|
|
33
|
+
slotProps = props.slotProps,
|
|
34
34
|
other = _objectWithoutProperties(props, _excluded);
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
var orderedSlots = useGridColumnMenuSlots(_extends({}, other, {
|
|
36
|
+
defaultSlots: defaultSlots,
|
|
37
|
+
defaultSlotProps: defaultSlotProps,
|
|
38
|
+
slots: slots,
|
|
39
|
+
slotProps: slotProps
|
|
40
40
|
}));
|
|
41
41
|
return /*#__PURE__*/_jsx(GridColumnMenuContainer, _extends({
|
|
42
42
|
ref: ref
|
|
43
43
|
}, other, {
|
|
44
|
-
children:
|
|
44
|
+
children: orderedSlots.map(function (_ref, index) {
|
|
45
45
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
46
46
|
Component = _ref2[0],
|
|
47
|
-
|
|
48
|
-
return /*#__PURE__*/_jsx(Component, _extends({},
|
|
47
|
+
otherProps = _ref2[1];
|
|
48
|
+
return /*#__PURE__*/_jsx(Component, _extends({}, otherProps), index);
|
|
49
49
|
})
|
|
50
50
|
}));
|
|
51
51
|
});
|
|
52
52
|
var GridColumnMenu = /*#__PURE__*/React.forwardRef(function GridColumnMenu(props, ref) {
|
|
53
53
|
return /*#__PURE__*/_jsx(GridGenericColumnMenu, _extends({}, props, {
|
|
54
54
|
ref: ref,
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
defaultSlots: GRID_COLUMN_MENU_SLOTS,
|
|
56
|
+
defaultSlotProps: GRID_COLUMN_MENU_SLOT_PROPS
|
|
57
57
|
}));
|
|
58
58
|
});
|
|
59
59
|
process.env.NODE_ENV !== "production" ? GridColumnMenu.propTypes = {
|
|
@@ -62,20 +62,20 @@ process.env.NODE_ENV !== "production" ? GridColumnMenu.propTypes = {
|
|
|
62
62
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
63
63
|
// ----------------------------------------------------------------------
|
|
64
64
|
colDef: PropTypes.object.isRequired,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
*/
|
|
70
|
-
components: PropTypes.object,
|
|
65
|
+
hideMenu: PropTypes.func.isRequired,
|
|
66
|
+
id: PropTypes.string,
|
|
67
|
+
labelledby: PropTypes.string,
|
|
68
|
+
open: PropTypes.bool.isRequired,
|
|
71
69
|
/**
|
|
72
70
|
* Could be used to pass new props or override props specific to a column menu component
|
|
73
71
|
* e.g. `displayOrder`
|
|
74
72
|
*/
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
slotProps: PropTypes.object,
|
|
74
|
+
/**
|
|
75
|
+
* `slots` could be used to add new and (or) override default column menu items
|
|
76
|
+
* If you register a nee component you must pass it's `displayOrder` in `slotProps`
|
|
77
|
+
* or it will be placed in the end of the list
|
|
78
|
+
*/
|
|
79
|
+
slots: PropTypes.object
|
|
80
80
|
} : void 0;
|
|
81
81
|
export { GridColumnMenu, GridGenericColumnMenu };
|
|
@@ -156,7 +156,7 @@ var GridFilterPanel = /*#__PURE__*/React.forwardRef(function GridFilterPanel(pro
|
|
|
156
156
|
columnsSort: columnsSort
|
|
157
157
|
}, filterFormProps), item.id == null ? index : item.id);
|
|
158
158
|
})
|
|
159
|
-
}), !rootProps.disableMultipleColumnsFiltering && !disableAddFilterButton &&
|
|
159
|
+
}), !rootProps.disableMultipleColumnsFiltering && !(disableAddFilterButton && disableRemoveAllButton) ? /*#__PURE__*/_jsxs(GridPanelFooter, {
|
|
160
160
|
children: [!disableAddFilterButton ? /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({
|
|
161
161
|
onClick: addNewFilter,
|
|
162
162
|
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';
|
|
@@ -6,54 +6,49 @@ var _excluded = ["displayOrder"];
|
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import Divider from '@mui/material/Divider';
|
|
8
8
|
import { useGridPrivateApiContext } from '../../utils/useGridPrivateApiContext';
|
|
9
|
-
var
|
|
10
|
-
var camelCase = pascalCase.split('');
|
|
11
|
-
camelCase[0] = camelCase[0].toLowerCase();
|
|
12
|
-
return camelCase.join('');
|
|
13
|
-
};
|
|
14
|
-
var useGridColumnMenuComponents = function useGridColumnMenuComponents(props) {
|
|
9
|
+
var useGridColumnMenuSlots = function useGridColumnMenuSlots(props) {
|
|
15
10
|
var apiRef = useGridPrivateApiContext();
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
_props$
|
|
19
|
-
|
|
20
|
-
_props$
|
|
21
|
-
|
|
11
|
+
var defaultSlots = props.defaultSlots,
|
|
12
|
+
defaultSlotProps = props.defaultSlotProps,
|
|
13
|
+
_props$slots = props.slots,
|
|
14
|
+
slots = _props$slots === void 0 ? {} : _props$slots,
|
|
15
|
+
_props$slotProps = props.slotProps,
|
|
16
|
+
slotProps = _props$slotProps === void 0 ? {} : _props$slotProps,
|
|
22
17
|
hideMenu = props.hideMenu,
|
|
23
18
|
colDef = props.colDef,
|
|
24
19
|
_props$addDividers = props.addDividers,
|
|
25
20
|
addDividers = _props$addDividers === void 0 ? true : _props$addDividers;
|
|
26
21
|
var processedComponents = React.useMemo(function () {
|
|
27
|
-
return _extends({},
|
|
28
|
-
}, [
|
|
29
|
-
var
|
|
30
|
-
if (!
|
|
31
|
-
return
|
|
22
|
+
return _extends({}, defaultSlots, slots);
|
|
23
|
+
}, [defaultSlots, slots]);
|
|
24
|
+
var processedSlotProps = React.useMemo(function () {
|
|
25
|
+
if (!slotProps || Object.keys(slotProps).length === 0) {
|
|
26
|
+
return defaultSlotProps;
|
|
32
27
|
}
|
|
33
|
-
var mergedProps = _extends({},
|
|
34
|
-
Object.entries(
|
|
28
|
+
var mergedProps = _extends({}, slotProps);
|
|
29
|
+
Object.entries(defaultSlotProps).forEach(function (_ref) {
|
|
35
30
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
36
31
|
key = _ref2[0],
|
|
37
|
-
|
|
38
|
-
mergedProps[key] = _extends({},
|
|
32
|
+
currentSlotProps = _ref2[1];
|
|
33
|
+
mergedProps[key] = _extends({}, currentSlotProps, slotProps[key] || {});
|
|
39
34
|
});
|
|
40
35
|
return mergedProps;
|
|
41
|
-
}, [
|
|
36
|
+
}, [defaultSlotProps, slotProps]);
|
|
42
37
|
var defaultItems = apiRef.current.unstable_applyPipeProcessors('columnMenu', [], props.colDef);
|
|
43
38
|
var userItems = React.useMemo(function () {
|
|
44
|
-
var defaultComponentKeys = Object.keys(
|
|
45
|
-
return Object.keys(
|
|
39
|
+
var defaultComponentKeys = Object.keys(defaultSlots);
|
|
40
|
+
return Object.keys(slots).filter(function (key) {
|
|
46
41
|
return !defaultComponentKeys.includes(key);
|
|
47
42
|
});
|
|
48
|
-
}, [
|
|
43
|
+
}, [slots, defaultSlots]);
|
|
49
44
|
return React.useMemo(function () {
|
|
50
45
|
var uniqueItems = Array.from(new Set([].concat(_toConsumableArray(defaultItems), _toConsumableArray(userItems))));
|
|
51
46
|
var cleansedItems = uniqueItems.filter(function (key) {
|
|
52
47
|
return processedComponents[key] != null;
|
|
53
48
|
});
|
|
54
49
|
var sorted = cleansedItems.sort(function (a, b) {
|
|
55
|
-
var leftItemProps =
|
|
56
|
-
var rightItemProps =
|
|
50
|
+
var leftItemProps = processedSlotProps[a];
|
|
51
|
+
var rightItemProps = processedSlotProps[b];
|
|
57
52
|
var leftDisplayOrder = Number.isFinite(leftItemProps == null ? void 0 : leftItemProps.displayOrder) ? leftItemProps.displayOrder : 100;
|
|
58
53
|
var rightDisplayOrder = Number.isFinite(rightItemProps == null ? void 0 : rightItemProps.displayOrder) ? rightItemProps.displayOrder : 100;
|
|
59
54
|
return leftDisplayOrder - rightDisplayOrder;
|
|
@@ -63,7 +58,7 @@ var useGridColumnMenuComponents = function useGridColumnMenuComponents(props) {
|
|
|
63
58
|
colDef: colDef,
|
|
64
59
|
onClick: hideMenu
|
|
65
60
|
};
|
|
66
|
-
var processedComponentProps =
|
|
61
|
+
var processedComponentProps = processedSlotProps[key];
|
|
67
62
|
if (processedComponentProps) {
|
|
68
63
|
var displayOrder = processedComponentProps.displayOrder,
|
|
69
64
|
customProps = _objectWithoutProperties(processedComponentProps, _excluded);
|
|
@@ -71,6 +66,6 @@ var useGridColumnMenuComponents = function useGridColumnMenuComponents(props) {
|
|
|
71
66
|
}
|
|
72
67
|
return addDividers && index !== sorted.length - 1 ? [].concat(_toConsumableArray(acc), [[processedComponents[key], itemProps], [Divider, {}]]) : [].concat(_toConsumableArray(acc), [[processedComponents[key], itemProps]]);
|
|
73
68
|
}, []);
|
|
74
|
-
}, [addDividers, colDef, defaultItems, hideMenu, processedComponents,
|
|
69
|
+
}, [addDividers, colDef, defaultItems, hideMenu, processedComponents, processedSlotProps, userItems]);
|
|
75
70
|
};
|
|
76
|
-
export {
|
|
71
|
+
export { useGridColumnMenuSlots };
|
|
@@ -245,7 +245,7 @@ export function useGridColumns(apiRef, props) {
|
|
|
245
245
|
if (props.disableColumnSelector) {
|
|
246
246
|
return columnMenuItems;
|
|
247
247
|
}
|
|
248
|
-
return [].concat(_toConsumableArray(columnMenuItems), ['
|
|
248
|
+
return [].concat(_toConsumableArray(columnMenuItems), ['columnMenuColumnsItem']);
|
|
249
249
|
}, [props.disableColumnSelector]);
|
|
250
250
|
useGridRegisterPipeProcessor(apiRef, 'columnMenu', addColumnMenuItems);
|
|
251
251
|
useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);
|
|
@@ -60,7 +60,7 @@ export var useGridFilter = function useGridFilter(apiRef, props) {
|
|
|
60
60
|
if (colDef == null || colDef.filterable === false || props.disableColumnFilter) {
|
|
61
61
|
return columnMenuItems;
|
|
62
62
|
}
|
|
63
|
-
return [].concat(_toConsumableArray(columnMenuItems), ['
|
|
63
|
+
return [].concat(_toConsumableArray(columnMenuItems), ['columnMenuFilterItem']);
|
|
64
64
|
}, [props.disableColumnFilter]);
|
|
65
65
|
|
|
66
66
|
/**
|
|
@@ -81,7 +81,7 @@ export var useGridSorting = function useGridSorting(apiRef, props) {
|
|
|
81
81
|
if (sortingOrder.some(function (item) {
|
|
82
82
|
return !!item;
|
|
83
83
|
})) {
|
|
84
|
-
return [].concat(_toConsumableArray(columnMenuItems), ['
|
|
84
|
+
return [].concat(_toConsumableArray(columnMenuItems), ['columnMenuSortItem']);
|
|
85
85
|
}
|
|
86
86
|
return columnMenuItems;
|
|
87
87
|
}, [props.sortingOrder]);
|
|
@@ -450,7 +450,7 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
|
|
|
450
450
|
prevRootRowStyle.current = rootRowStyle;
|
|
451
451
|
return rows;
|
|
452
452
|
};
|
|
453
|
-
var needsHorizontalScrollbar = containerDimensions.width && columnsTotalWidth
|
|
453
|
+
var needsHorizontalScrollbar = containerDimensions.width && columnsTotalWidth >= containerDimensions.width;
|
|
454
454
|
var contentSize = React.useMemo(function () {
|
|
455
455
|
// In cases where the columns exceed the available width,
|
|
456
456
|
// the horizontal scrollbar should be shown even when there're no rows.
|
package/legacy/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/legacy/locales/daDK.js
CHANGED
|
@@ -22,17 +22,15 @@ var daDKGrid = {
|
|
|
22
22
|
return count !== 1 ? "".concat(count, " aktive filtre") : "".concat(count, " aktivt filter");
|
|
23
23
|
},
|
|
24
24
|
// Quick filter toolbar field
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
toolbarQuickFilterPlaceholder: 'Søg…',
|
|
26
|
+
toolbarQuickFilterLabel: 'Søg',
|
|
27
|
+
toolbarQuickFilterDeleteIconLabel: 'Ryd',
|
|
29
28
|
// Export selector toolbar button text
|
|
30
|
-
|
|
29
|
+
toolbarExport: 'Eksport',
|
|
31
30
|
toolbarExportLabel: 'Eksporter',
|
|
32
31
|
toolbarExportCSV: 'Download som CSV',
|
|
33
32
|
toolbarExportPrint: 'Print',
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
toolbarExportExcel: 'Download som Excel',
|
|
36
34
|
// Columns panel text
|
|
37
35
|
columnsPanelTextFieldLabel: 'Find kolonne',
|
|
38
36
|
columnsPanelTextFieldPlaceholder: 'Kolonne titel',
|
|
@@ -41,7 +39,7 @@ var daDKGrid = {
|
|
|
41
39
|
columnsPanelHideAllButton: 'Skjul alle',
|
|
42
40
|
// Filter panel text
|
|
43
41
|
filterPanelAddFilter: 'Tilføj filter',
|
|
44
|
-
|
|
42
|
+
filterPanelRemoveAll: 'Fjern alle',
|
|
45
43
|
filterPanelDeleteIconLabel: 'Slet',
|
|
46
44
|
filterPanelLogicOperator: 'Logisk operator',
|
|
47
45
|
filterPanelOperator: 'Operatorer',
|
|
@@ -71,7 +69,7 @@ var daDKGrid = {
|
|
|
71
69
|
// Column menu text
|
|
72
70
|
columnMenuLabel: 'Menu',
|
|
73
71
|
columnMenuShowColumns: 'Vis Kolonner',
|
|
74
|
-
|
|
72
|
+
columnMenuManageColumns: 'Administrer kolonner',
|
|
75
73
|
columnMenuFilter: 'Filtre',
|
|
76
74
|
columnMenuHideColumn: 'Skjul',
|
|
77
75
|
columnMenuUnsort: 'Fjern sortering',
|
|
@@ -121,20 +119,17 @@ var daDKGrid = {
|
|
|
121
119
|
return "Fjern grupp\xE9ring efter ".concat(name);
|
|
122
120
|
},
|
|
123
121
|
// Master/detail
|
|
124
|
-
|
|
122
|
+
detailPanelToggle: 'Udvid/kollaps detaljepanel',
|
|
125
123
|
expandDetailPanel: 'Udvid',
|
|
126
|
-
collapseDetailPanel: 'Kollaps'
|
|
127
|
-
|
|
124
|
+
collapseDetailPanel: 'Kollaps',
|
|
128
125
|
// Row reordering text
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
rowReorderingHeaderName: 'Omarrangering af rækker',
|
|
131
127
|
// Aggregation
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
128
|
+
aggregationMenuItemHeader: 'Aggregation',
|
|
129
|
+
aggregationFunctionLabelSum: 'sum',
|
|
130
|
+
aggregationFunctionLabelAvg: 'gns',
|
|
131
|
+
aggregationFunctionLabelMin: 'min',
|
|
132
|
+
aggregationFunctionLabelMax: 'max',
|
|
133
|
+
aggregationFunctionLabelSize: 'størrelse'
|
|
138
134
|
};
|
|
139
|
-
|
|
140
135
|
export var daDK = getGridLocalization(daDKGrid, daDKCore);
|
package/legacy/locales/esES.js
CHANGED
|
@@ -69,7 +69,7 @@ var esESGrid = {
|
|
|
69
69
|
// Column menu text
|
|
70
70
|
columnMenuLabel: 'Menú',
|
|
71
71
|
columnMenuShowColumns: 'Mostrar columnas',
|
|
72
|
-
|
|
72
|
+
columnMenuManageColumns: 'Administrar columnas',
|
|
73
73
|
columnMenuFilter: 'Filtro',
|
|
74
74
|
columnMenuHideColumn: 'Ocultar',
|
|
75
75
|
columnMenuUnsort: 'Desordenar',
|
package/legacy/locales/nbNO.js
CHANGED
|
@@ -39,7 +39,7 @@ var nbNOGrid = {
|
|
|
39
39
|
columnsPanelHideAllButton: 'Skjul alle',
|
|
40
40
|
// Filter panel text
|
|
41
41
|
filterPanelAddFilter: 'Legg til filter',
|
|
42
|
-
|
|
42
|
+
filterPanelRemoveAll: 'Fjern alle',
|
|
43
43
|
filterPanelDeleteIconLabel: 'Slett',
|
|
44
44
|
filterPanelLogicOperator: 'Logisk operator',
|
|
45
45
|
filterPanelOperator: 'Operatører',
|
|
@@ -69,7 +69,7 @@ var nbNOGrid = {
|
|
|
69
69
|
// Column menu text
|
|
70
70
|
columnMenuLabel: 'Meny',
|
|
71
71
|
columnMenuShowColumns: 'Vis kolonner',
|
|
72
|
-
|
|
72
|
+
columnMenuManageColumns: 'Administrer kolonner',
|
|
73
73
|
columnMenuFilter: 'Filter',
|
|
74
74
|
columnMenuHideColumn: 'Skjul',
|
|
75
75
|
columnMenuUnsort: 'Usorter',
|
|
@@ -119,19 +119,17 @@ var nbNOGrid = {
|
|
|
119
119
|
return "Stopp \xE5 grupper p\xE5 ".concat(name);
|
|
120
120
|
},
|
|
121
121
|
// Master/detail
|
|
122
|
-
|
|
122
|
+
detailPanelToggle: 'Utvid/kollaps detalj panel',
|
|
123
123
|
expandDetailPanel: 'Utvid',
|
|
124
124
|
collapseDetailPanel: 'Kollaps',
|
|
125
125
|
// Row reordering text
|
|
126
|
-
rowReorderingHeaderName: 'Rad reorganisering'
|
|
127
|
-
|
|
126
|
+
rowReorderingHeaderName: 'Rad reorganisering',
|
|
128
127
|
// Aggregation
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
128
|
+
aggregationMenuItemHeader: 'Aggregering',
|
|
129
|
+
aggregationFunctionLabelSum: 'sum',
|
|
130
|
+
aggregationFunctionLabelAvg: 'snitt',
|
|
131
|
+
aggregationFunctionLabelMin: 'min',
|
|
132
|
+
aggregationFunctionLabelMax: 'maks',
|
|
133
|
+
aggregationFunctionLabelSize: 'størrelse'
|
|
135
134
|
};
|
|
136
|
-
|
|
137
135
|
export var nbNO = getGridLocalization(nbNOGrid, nbNOCore);
|
package/legacy/locales/svSE.js
CHANGED
|
@@ -39,7 +39,7 @@ var svSEGrid = {
|
|
|
39
39
|
columnsPanelHideAllButton: 'Dölj alla',
|
|
40
40
|
// Filter panel text
|
|
41
41
|
filterPanelAddFilter: 'Lägg till filter',
|
|
42
|
-
|
|
42
|
+
filterPanelRemoveAll: 'Ta bort alla',
|
|
43
43
|
filterPanelDeleteIconLabel: 'Ta bort',
|
|
44
44
|
filterPanelLogicOperator: 'Logisk operatör',
|
|
45
45
|
filterPanelOperator: 'Operatör',
|
|
@@ -69,7 +69,7 @@ var svSEGrid = {
|
|
|
69
69
|
// Column menu text
|
|
70
70
|
columnMenuLabel: 'Meny',
|
|
71
71
|
columnMenuShowColumns: 'Visa kolumner',
|
|
72
|
-
|
|
72
|
+
columnMenuManageColumns: 'Hantera kolumner',
|
|
73
73
|
columnMenuFilter: 'Filtrera',
|
|
74
74
|
columnMenuHideColumn: 'Dölj',
|
|
75
75
|
columnMenuUnsort: 'Osortera',
|
package/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/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/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);
|