@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
|
@@ -4,27 +4,27 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.GridGenericColumnMenu = exports.GridColumnMenu = exports.
|
|
7
|
+
exports.GridGenericColumnMenu = exports.GridColumnMenu = exports.GRID_COLUMN_MENU_SLOT_PROPS = exports.GRID_COLUMN_MENU_SLOTS = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
-
var
|
|
12
|
+
var _useGridColumnMenuSlots = require("../../../hooks/features/columnMenu/useGridColumnMenuSlots");
|
|
13
13
|
var _GridColumnMenuContainer = require("./GridColumnMenuContainer");
|
|
14
14
|
var _GridColumnMenuColumnsItem = require("./menuItems/GridColumnMenuColumnsItem");
|
|
15
15
|
var _GridColumnMenuFilterItem = require("./menuItems/GridColumnMenuFilterItem");
|
|
16
16
|
var _GridColumnMenuSortItem = require("./menuItems/GridColumnMenuSortItem");
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
const _excluded = ["
|
|
18
|
+
const _excluded = ["defaultSlots", "defaultSlotProps", "slots", "slotProps"];
|
|
19
19
|
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); }
|
|
20
20
|
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; }
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const GRID_COLUMN_MENU_SLOTS = {
|
|
22
|
+
columnMenuSortItem: _GridColumnMenuSortItem.GridColumnMenuSortItem,
|
|
23
|
+
columnMenuFilterItem: _GridColumnMenuFilterItem.GridColumnMenuFilterItem,
|
|
24
|
+
columnMenuColumnsItem: _GridColumnMenuColumnsItem.GridColumnMenuColumnsItem
|
|
25
25
|
};
|
|
26
|
-
exports.
|
|
27
|
-
const
|
|
26
|
+
exports.GRID_COLUMN_MENU_SLOTS = GRID_COLUMN_MENU_SLOTS;
|
|
27
|
+
const GRID_COLUMN_MENU_SLOT_PROPS = {
|
|
28
28
|
columnMenuSortItem: {
|
|
29
29
|
displayOrder: 10
|
|
30
30
|
},
|
|
@@ -35,33 +35,33 @@ const GRID_COLUMN_MENU_COMPONENTS_PROPS = {
|
|
|
35
35
|
displayOrder: 30
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
exports.
|
|
38
|
+
exports.GRID_COLUMN_MENU_SLOT_PROPS = GRID_COLUMN_MENU_SLOT_PROPS;
|
|
39
39
|
const GridGenericColumnMenu = /*#__PURE__*/React.forwardRef(function GridGenericColumnMenu(props, ref) {
|
|
40
40
|
const {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
defaultSlots,
|
|
42
|
+
defaultSlotProps,
|
|
43
|
+
slots,
|
|
44
|
+
slotProps
|
|
45
45
|
} = props,
|
|
46
46
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
const orderedSlots = (0, _useGridColumnMenuSlots.useGridColumnMenuSlots)((0, _extends2.default)({}, other, {
|
|
48
|
+
defaultSlots,
|
|
49
|
+
defaultSlotProps,
|
|
50
|
+
slots,
|
|
51
|
+
slotProps
|
|
52
52
|
}));
|
|
53
53
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridColumnMenuContainer.GridColumnMenuContainer, (0, _extends2.default)({
|
|
54
54
|
ref: ref
|
|
55
55
|
}, other, {
|
|
56
|
-
children:
|
|
56
|
+
children: orderedSlots.map(([Component, otherProps], index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, (0, _extends2.default)({}, otherProps), index))
|
|
57
57
|
}));
|
|
58
58
|
});
|
|
59
59
|
exports.GridGenericColumnMenu = GridGenericColumnMenu;
|
|
60
60
|
const GridColumnMenu = /*#__PURE__*/React.forwardRef(function GridColumnMenu(props, ref) {
|
|
61
61
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridGenericColumnMenu, (0, _extends2.default)({}, props, {
|
|
62
62
|
ref: ref,
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
defaultSlots: GRID_COLUMN_MENU_SLOTS,
|
|
64
|
+
defaultSlotProps: GRID_COLUMN_MENU_SLOT_PROPS
|
|
65
65
|
}));
|
|
66
66
|
});
|
|
67
67
|
exports.GridColumnMenu = GridColumnMenu;
|
|
@@ -71,19 +71,19 @@ process.env.NODE_ENV !== "production" ? GridColumnMenu.propTypes = {
|
|
|
71
71
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
72
72
|
// ----------------------------------------------------------------------
|
|
73
73
|
colDef: _propTypes.default.object.isRequired,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
*/
|
|
79
|
-
components: _propTypes.default.object,
|
|
74
|
+
hideMenu: _propTypes.default.func.isRequired,
|
|
75
|
+
id: _propTypes.default.string,
|
|
76
|
+
labelledby: _propTypes.default.string,
|
|
77
|
+
open: _propTypes.default.bool.isRequired,
|
|
80
78
|
/**
|
|
81
79
|
* Could be used to pass new props or override props specific to a column menu component
|
|
82
80
|
* e.g. `displayOrder`
|
|
83
81
|
*/
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
82
|
+
slotProps: _propTypes.default.object,
|
|
83
|
+
/**
|
|
84
|
+
* `slots` could be used to add new and (or) override default column menu items
|
|
85
|
+
* If you register a nee component you must pass it's `displayOrder` in `slotProps`
|
|
86
|
+
* or it will be placed in the end of the list
|
|
87
|
+
*/
|
|
88
|
+
slots: _propTypes.default.object
|
|
89
89
|
} : void 0;
|
|
@@ -151,7 +151,7 @@ const GridFilterPanel = /*#__PURE__*/React.forwardRef(function GridFilterPanel(p
|
|
|
151
151
|
logicOperators: logicOperators,
|
|
152
152
|
columnsSort: columnsSort
|
|
153
153
|
}, filterFormProps), item.id == null ? index : item.id))
|
|
154
|
-
}), !rootProps.disableMultipleColumnsFiltering && !disableAddFilterButton &&
|
|
154
|
+
}), !rootProps.disableMultipleColumnsFiltering && !(disableAddFilterButton && disableRemoveAllButton) ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_GridPanelFooter.GridPanelFooter, {
|
|
155
155
|
children: [!disableAddFilterButton ? /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseButton, (0, _extends2.default)({
|
|
156
156
|
onClick: addNewFilter,
|
|
157
157
|
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.filterPanelAddIcon, {})
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "GRID_COLUMN_MENU_SLOTS", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function () {
|
|
9
|
-
return _GridColumnMenu.
|
|
9
|
+
return _GridColumnMenu.GRID_COLUMN_MENU_SLOTS;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "GRID_COLUMN_MENU_SLOT_PROPS", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function () {
|
|
15
|
-
return _GridColumnMenu.
|
|
15
|
+
return _GridColumnMenu.GRID_COLUMN_MENU_SLOT_PROPS;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "GridColumnMenu", {
|
package/node/hooks/features/columnMenu/{useGridColumnMenuComponents.js → useGridColumnMenuSlots.js}
RENAMED
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.useGridColumnMenuSlots = void 0;
|
|
8
8
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
@@ -13,44 +13,39 @@ var _useGridPrivateApiContext = require("../../utils/useGridPrivateApiContext");
|
|
|
13
13
|
const _excluded = ["displayOrder"];
|
|
14
14
|
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); }
|
|
15
15
|
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; }
|
|
16
|
-
const
|
|
17
|
-
const camelCase = pascalCase.split('');
|
|
18
|
-
camelCase[0] = camelCase[0].toLowerCase();
|
|
19
|
-
return camelCase.join('');
|
|
20
|
-
};
|
|
21
|
-
const useGridColumnMenuComponents = props => {
|
|
16
|
+
const useGridColumnMenuSlots = props => {
|
|
22
17
|
const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
|
|
23
18
|
const {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
defaultSlots,
|
|
20
|
+
defaultSlotProps,
|
|
21
|
+
slots = {},
|
|
22
|
+
slotProps = {},
|
|
28
23
|
hideMenu,
|
|
29
24
|
colDef,
|
|
30
25
|
addDividers = true
|
|
31
26
|
} = props;
|
|
32
|
-
const processedComponents = React.useMemo(() => (0, _extends2.default)({},
|
|
33
|
-
const
|
|
34
|
-
if (!
|
|
35
|
-
return
|
|
27
|
+
const processedComponents = React.useMemo(() => (0, _extends2.default)({}, defaultSlots, slots), [defaultSlots, slots]);
|
|
28
|
+
const processedSlotProps = React.useMemo(() => {
|
|
29
|
+
if (!slotProps || Object.keys(slotProps).length === 0) {
|
|
30
|
+
return defaultSlotProps;
|
|
36
31
|
}
|
|
37
|
-
const mergedProps = (0, _extends2.default)({},
|
|
38
|
-
Object.entries(
|
|
39
|
-
mergedProps[key] = (0, _extends2.default)({},
|
|
32
|
+
const mergedProps = (0, _extends2.default)({}, slotProps);
|
|
33
|
+
Object.entries(defaultSlotProps).forEach(([key, currentSlotProps]) => {
|
|
34
|
+
mergedProps[key] = (0, _extends2.default)({}, currentSlotProps, slotProps[key] || {});
|
|
40
35
|
});
|
|
41
36
|
return mergedProps;
|
|
42
|
-
}, [
|
|
37
|
+
}, [defaultSlotProps, slotProps]);
|
|
43
38
|
const defaultItems = apiRef.current.unstable_applyPipeProcessors('columnMenu', [], props.colDef);
|
|
44
39
|
const userItems = React.useMemo(() => {
|
|
45
|
-
const defaultComponentKeys = Object.keys(
|
|
46
|
-
return Object.keys(
|
|
47
|
-
}, [
|
|
40
|
+
const defaultComponentKeys = Object.keys(defaultSlots);
|
|
41
|
+
return Object.keys(slots).filter(key => !defaultComponentKeys.includes(key));
|
|
42
|
+
}, [slots, defaultSlots]);
|
|
48
43
|
return React.useMemo(() => {
|
|
49
44
|
const uniqueItems = Array.from(new Set([...defaultItems, ...userItems]));
|
|
50
45
|
const cleansedItems = uniqueItems.filter(key => processedComponents[key] != null);
|
|
51
46
|
const sorted = cleansedItems.sort((a, b) => {
|
|
52
|
-
const leftItemProps =
|
|
53
|
-
const rightItemProps =
|
|
47
|
+
const leftItemProps = processedSlotProps[a];
|
|
48
|
+
const rightItemProps = processedSlotProps[b];
|
|
54
49
|
const leftDisplayOrder = Number.isFinite(leftItemProps?.displayOrder) ? leftItemProps.displayOrder : 100;
|
|
55
50
|
const rightDisplayOrder = Number.isFinite(rightItemProps?.displayOrder) ? rightItemProps.displayOrder : 100;
|
|
56
51
|
return leftDisplayOrder - rightDisplayOrder;
|
|
@@ -60,13 +55,13 @@ const useGridColumnMenuComponents = props => {
|
|
|
60
55
|
colDef,
|
|
61
56
|
onClick: hideMenu
|
|
62
57
|
};
|
|
63
|
-
const processedComponentProps =
|
|
58
|
+
const processedComponentProps = processedSlotProps[key];
|
|
64
59
|
if (processedComponentProps) {
|
|
65
60
|
const customProps = (0, _objectWithoutPropertiesLoose2.default)(processedComponentProps, _excluded);
|
|
66
61
|
itemProps = (0, _extends2.default)({}, itemProps, customProps);
|
|
67
62
|
}
|
|
68
63
|
return addDividers && index !== sorted.length - 1 ? [...acc, [processedComponents[key], itemProps], [_Divider.default, {}]] : [...acc, [processedComponents[key], itemProps]];
|
|
69
64
|
}, []);
|
|
70
|
-
}, [addDividers, colDef, defaultItems, hideMenu, processedComponents,
|
|
65
|
+
}, [addDividers, colDef, defaultItems, hideMenu, processedComponents, processedSlotProps, userItems]);
|
|
71
66
|
};
|
|
72
|
-
exports.
|
|
67
|
+
exports.useGridColumnMenuSlots = useGridColumnMenuSlots;
|
|
@@ -237,7 +237,7 @@ function useGridColumns(apiRef, props) {
|
|
|
237
237
|
if (props.disableColumnSelector) {
|
|
238
238
|
return columnMenuItems;
|
|
239
239
|
}
|
|
240
|
-
return [...columnMenuItems, '
|
|
240
|
+
return [...columnMenuItems, 'columnMenuColumnsItem'];
|
|
241
241
|
}, [props.disableColumnSelector]);
|
|
242
242
|
(0, _pipeProcessing.useGridRegisterPipeProcessor)(apiRef, 'columnMenu', addColumnMenuItems);
|
|
243
243
|
(0, _pipeProcessing.useGridRegisterPipeProcessor)(apiRef, 'exportState', stateExportPreProcessing);
|
|
@@ -67,7 +67,7 @@ const useGridFilter = (apiRef, props) => {
|
|
|
67
67
|
if (colDef == null || colDef.filterable === false || props.disableColumnFilter) {
|
|
68
68
|
return columnMenuItems;
|
|
69
69
|
}
|
|
70
|
-
return [...columnMenuItems, '
|
|
70
|
+
return [...columnMenuItems, 'columnMenuFilterItem'];
|
|
71
71
|
}, [props.disableColumnFilter]);
|
|
72
72
|
|
|
73
73
|
/**
|
|
@@ -80,7 +80,7 @@ const useGridSorting = (apiRef, props) => {
|
|
|
80
80
|
}
|
|
81
81
|
const sortingOrder = colDef.sortingOrder || props.sortingOrder;
|
|
82
82
|
if (sortingOrder.some(item => !!item)) {
|
|
83
|
-
return [...columnMenuItems, '
|
|
83
|
+
return [...columnMenuItems, 'columnMenuSortItem'];
|
|
84
84
|
}
|
|
85
85
|
return columnMenuItems;
|
|
86
86
|
}, [props.sortingOrder]);
|
|
@@ -436,7 +436,7 @@ const useGridVirtualScroller = props => {
|
|
|
436
436
|
prevRootRowStyle.current = rootRowStyle;
|
|
437
437
|
return rows;
|
|
438
438
|
};
|
|
439
|
-
const needsHorizontalScrollbar = containerDimensions.width && columnsTotalWidth
|
|
439
|
+
const needsHorizontalScrollbar = containerDimensions.width && columnsTotalWidth >= containerDimensions.width;
|
|
440
440
|
const contentSize = React.useMemo(() => {
|
|
441
441
|
// In cases where the columns exceed the available width,
|
|
442
442
|
// the horizontal scrollbar should be shown even when there're no rows.
|
package/node/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
|
|
@@ -16,19 +16,19 @@ var _exportNames = {
|
|
|
16
16
|
useGridRootProps: true,
|
|
17
17
|
GridColumnHeaders: true,
|
|
18
18
|
GridColumnMenu: true,
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
GRID_COLUMN_MENU_SLOTS: true,
|
|
20
|
+
GRID_COLUMN_MENU_SLOT_PROPS: true
|
|
21
21
|
};
|
|
22
|
-
Object.defineProperty(exports, "
|
|
22
|
+
Object.defineProperty(exports, "GRID_COLUMN_MENU_SLOTS", {
|
|
23
23
|
enumerable: true,
|
|
24
24
|
get: function () {
|
|
25
|
-
return _reexportable.
|
|
25
|
+
return _reexportable.GRID_COLUMN_MENU_SLOTS;
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
Object.defineProperty(exports, "
|
|
28
|
+
Object.defineProperty(exports, "GRID_COLUMN_MENU_SLOT_PROPS", {
|
|
29
29
|
enumerable: true,
|
|
30
30
|
get: function () {
|
|
31
|
-
return _reexportable.
|
|
31
|
+
return _reexportable.GRID_COLUMN_MENU_SLOT_PROPS;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
Object.defineProperty(exports, "GridColumnHeaders", {
|
package/node/locales/daDK.js
CHANGED
|
@@ -26,17 +26,15 @@ const daDKGrid = {
|
|
|
26
26
|
toolbarFiltersTooltipShow: 'Vis filtre',
|
|
27
27
|
toolbarFiltersTooltipActive: count => count !== 1 ? `${count} aktive filtre` : `${count} aktivt filter`,
|
|
28
28
|
// Quick filter toolbar field
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
toolbarQuickFilterPlaceholder: 'Søg…',
|
|
30
|
+
toolbarQuickFilterLabel: 'Søg',
|
|
31
|
+
toolbarQuickFilterDeleteIconLabel: 'Ryd',
|
|
33
32
|
// Export selector toolbar button text
|
|
34
|
-
|
|
33
|
+
toolbarExport: 'Eksport',
|
|
35
34
|
toolbarExportLabel: 'Eksporter',
|
|
36
35
|
toolbarExportCSV: 'Download som CSV',
|
|
37
36
|
toolbarExportPrint: 'Print',
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
toolbarExportExcel: 'Download som Excel',
|
|
40
38
|
// Columns panel text
|
|
41
39
|
columnsPanelTextFieldLabel: 'Find kolonne',
|
|
42
40
|
columnsPanelTextFieldPlaceholder: 'Kolonne titel',
|
|
@@ -45,7 +43,7 @@ const daDKGrid = {
|
|
|
45
43
|
columnsPanelHideAllButton: 'Skjul alle',
|
|
46
44
|
// Filter panel text
|
|
47
45
|
filterPanelAddFilter: 'Tilføj filter',
|
|
48
|
-
|
|
46
|
+
filterPanelRemoveAll: 'Fjern alle',
|
|
49
47
|
filterPanelDeleteIconLabel: 'Slet',
|
|
50
48
|
filterPanelLogicOperator: 'Logisk operator',
|
|
51
49
|
filterPanelOperator: 'Operatorer',
|
|
@@ -75,7 +73,7 @@ const daDKGrid = {
|
|
|
75
73
|
// Column menu text
|
|
76
74
|
columnMenuLabel: 'Menu',
|
|
77
75
|
columnMenuShowColumns: 'Vis Kolonner',
|
|
78
|
-
|
|
76
|
+
columnMenuManageColumns: 'Administrer kolonner',
|
|
79
77
|
columnMenuFilter: 'Filtre',
|
|
80
78
|
columnMenuHideColumn: 'Skjul',
|
|
81
79
|
columnMenuUnsort: 'Fjern sortering',
|
|
@@ -115,21 +113,18 @@ const daDKGrid = {
|
|
|
115
113
|
groupColumn: name => `Gruppér efter ${name}`,
|
|
116
114
|
unGroupColumn: name => `Fjern gruppéring efter ${name}`,
|
|
117
115
|
// Master/detail
|
|
118
|
-
|
|
116
|
+
detailPanelToggle: 'Udvid/kollaps detaljepanel',
|
|
119
117
|
expandDetailPanel: 'Udvid',
|
|
120
|
-
collapseDetailPanel: 'Kollaps'
|
|
121
|
-
|
|
118
|
+
collapseDetailPanel: 'Kollaps',
|
|
122
119
|
// Row reordering text
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
rowReorderingHeaderName: 'Omarrangering af rækker',
|
|
125
121
|
// Aggregation
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
122
|
+
aggregationMenuItemHeader: 'Aggregation',
|
|
123
|
+
aggregationFunctionLabelSum: 'sum',
|
|
124
|
+
aggregationFunctionLabelAvg: 'gns',
|
|
125
|
+
aggregationFunctionLabelMin: 'min',
|
|
126
|
+
aggregationFunctionLabelMax: 'max',
|
|
127
|
+
aggregationFunctionLabelSize: 'størrelse'
|
|
132
128
|
};
|
|
133
|
-
|
|
134
129
|
const daDK = (0, _getGridLocalization.getGridLocalization)(daDKGrid, _locale.daDK);
|
|
135
130
|
exports.daDK = daDK;
|
package/node/locales/esES.js
CHANGED
|
@@ -73,7 +73,7 @@ const esESGrid = {
|
|
|
73
73
|
// Column menu text
|
|
74
74
|
columnMenuLabel: 'Menú',
|
|
75
75
|
columnMenuShowColumns: 'Mostrar columnas',
|
|
76
|
-
|
|
76
|
+
columnMenuManageColumns: 'Administrar columnas',
|
|
77
77
|
columnMenuFilter: 'Filtro',
|
|
78
78
|
columnMenuHideColumn: 'Ocultar',
|
|
79
79
|
columnMenuUnsort: 'Desordenar',
|
package/node/locales/nbNO.js
CHANGED
|
@@ -43,7 +43,7 @@ const nbNOGrid = {
|
|
|
43
43
|
columnsPanelHideAllButton: 'Skjul alle',
|
|
44
44
|
// Filter panel text
|
|
45
45
|
filterPanelAddFilter: 'Legg til filter',
|
|
46
|
-
|
|
46
|
+
filterPanelRemoveAll: 'Fjern alle',
|
|
47
47
|
filterPanelDeleteIconLabel: 'Slett',
|
|
48
48
|
filterPanelLogicOperator: 'Logisk operator',
|
|
49
49
|
filterPanelOperator: 'Operatører',
|
|
@@ -73,7 +73,7 @@ const nbNOGrid = {
|
|
|
73
73
|
// Column menu text
|
|
74
74
|
columnMenuLabel: 'Meny',
|
|
75
75
|
columnMenuShowColumns: 'Vis kolonner',
|
|
76
|
-
|
|
76
|
+
columnMenuManageColumns: 'Administrer kolonner',
|
|
77
77
|
columnMenuFilter: 'Filter',
|
|
78
78
|
columnMenuHideColumn: 'Skjul',
|
|
79
79
|
columnMenuUnsort: 'Usorter',
|
|
@@ -113,20 +113,18 @@ const nbNOGrid = {
|
|
|
113
113
|
groupColumn: name => `Grupper på ${name}`,
|
|
114
114
|
unGroupColumn: name => `Stopp å grupper på ${name}`,
|
|
115
115
|
// Master/detail
|
|
116
|
-
|
|
116
|
+
detailPanelToggle: 'Utvid/kollaps detalj panel',
|
|
117
117
|
expandDetailPanel: 'Utvid',
|
|
118
118
|
collapseDetailPanel: 'Kollaps',
|
|
119
119
|
// Row reordering text
|
|
120
|
-
rowReorderingHeaderName: 'Rad reorganisering'
|
|
121
|
-
|
|
120
|
+
rowReorderingHeaderName: 'Rad reorganisering',
|
|
122
121
|
// Aggregation
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
122
|
+
aggregationMenuItemHeader: 'Aggregering',
|
|
123
|
+
aggregationFunctionLabelSum: 'sum',
|
|
124
|
+
aggregationFunctionLabelAvg: 'snitt',
|
|
125
|
+
aggregationFunctionLabelMin: 'min',
|
|
126
|
+
aggregationFunctionLabelMax: 'maks',
|
|
127
|
+
aggregationFunctionLabelSize: 'størrelse'
|
|
129
128
|
};
|
|
130
|
-
|
|
131
129
|
const nbNO = (0, _getGridLocalization.getGridLocalization)(nbNOGrid, _locale.nbNO);
|
|
132
130
|
exports.nbNO = nbNO;
|
package/node/locales/svSE.js
CHANGED
|
@@ -43,7 +43,7 @@ const svSEGrid = {
|
|
|
43
43
|
columnsPanelHideAllButton: 'Dölj alla',
|
|
44
44
|
// Filter panel text
|
|
45
45
|
filterPanelAddFilter: 'Lägg till filter',
|
|
46
|
-
|
|
46
|
+
filterPanelRemoveAll: 'Ta bort alla',
|
|
47
47
|
filterPanelDeleteIconLabel: 'Ta bort',
|
|
48
48
|
filterPanelLogicOperator: 'Logisk operatör',
|
|
49
49
|
filterPanelOperator: 'Operatör',
|
|
@@ -73,7 +73,7 @@ const svSEGrid = {
|
|
|
73
73
|
// Column menu text
|
|
74
74
|
columnMenuLabel: 'Meny',
|
|
75
75
|
columnMenuShowColumns: 'Visa kolumner',
|
|
76
|
-
|
|
76
|
+
columnMenuManageColumns: 'Hantera kolumner',
|
|
77
77
|
columnMenuFilter: 'Filtrera',
|
|
78
78
|
columnMenuHideColumn: 'Dölj',
|
|
79
79
|
columnMenuUnsort: 'Osortera',
|