@mui/x-data-grid 8.27.3 → 8.27.5
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 +121 -0
- package/components/GridScrollArea.js +6 -9
- package/components/columnHeaders/GridColumnGroupHeader.js +2 -1
- package/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
- package/components/columnSelection/GridHeaderCheckbox.js +7 -5
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +12 -9
- package/constants/gridClasses.js +1 -1
- package/esm/components/GridScrollArea.js +6 -9
- package/esm/components/columnHeaders/GridColumnGroupHeader.js +2 -1
- package/esm/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/esm/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
- package/esm/components/columnSelection/GridHeaderCheckbox.js +7 -5
- package/esm/components/panel/filterPanel/GridFilterInputMultipleValue.js +11 -8
- package/esm/constants/gridClasses.js +1 -1
- package/esm/hooks/features/columns/gridColumnsSelector.js +5 -14
- package/esm/hooks/features/dataSource/useGridDataSourceBase.js +2 -1
- package/esm/hooks/features/editing/useGridRowEditing.js +12 -4
- package/esm/index.js +1 -1
- package/esm/locales/ukUA.js +13 -12
- package/hooks/features/columns/gridColumnsSelector.js +5 -14
- package/hooks/features/dataSource/useGridDataSourceBase.js +2 -1
- package/hooks/features/editing/useGridRowEditing.js +12 -4
- package/index.js +1 -1
- package/locales/ukUA.js +13 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,127 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.27.5
|
|
9
|
+
|
|
10
|
+
_Mar 11, 2026_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 7 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
|
|
16
|
+
The following team members contributed to this release:
|
|
17
|
+
@bernardobelchior, @JCQuintas, @MBilalShafi, @michelengelen, @mj12albert, @sai6855, @siriwatknp
|
|
18
|
+
|
|
19
|
+
### Data Grid
|
|
20
|
+
|
|
21
|
+
#### `@mui/x-data-grid@8.27.5`
|
|
22
|
+
|
|
23
|
+
- [DataGrid] Fix crash when `rows` and `rowModesModel` are updated simultaneously (#21684) @michelengelen
|
|
24
|
+
- [DataGrid] Forward rest props in `GridFilterInputMultipleValue` (#21444) @siriwatknp
|
|
25
|
+
- [DataGrid] Remove double rtl inversion logic for columns pinning (#21443) @siriwatknp
|
|
26
|
+
- [DataGrid] Add missing `resizablePanelHandle` classes to `gridClasses` object (#21632) @sai6855
|
|
27
|
+
- [DataGrid] Refactor `headerAlign` style calls (#21633) @sai6855
|
|
28
|
+
- [DataGrid] Fix keyboard navigation with single-row checkbox selection (#21529) @mj12albert
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-data-grid-pro@8.27.5` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
31
|
+
|
|
32
|
+
Same changes as in `@mui/x-data-grid@8.27.5`, plus:
|
|
33
|
+
|
|
34
|
+
- [DataGridPro] Add `role="presentation"` to detail panel toggle header content (#21691) @michelengelen
|
|
35
|
+
- [DataGridPro] Fix sorting not reflected in nested server-side data (#21641) @MBilalShafi
|
|
36
|
+
|
|
37
|
+
#### `@mui/x-data-grid-premium@8.27.5` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
38
|
+
|
|
39
|
+
Same changes as in `@mui/x-data-grid-pro@8.27.5`.
|
|
40
|
+
|
|
41
|
+
### Charts
|
|
42
|
+
|
|
43
|
+
#### `@mui/x-charts@8.27.5`
|
|
44
|
+
|
|
45
|
+
- [charts] Refactor `BarChart` classes structure (#21601) (#21644) @JCQuintas
|
|
46
|
+
- [charts] Refactor `LineChart` classes structure (#21672) @JCQuintas
|
|
47
|
+
- [charts] Refactor `ScatterChart` classes structure (#21706) @JCQuintas
|
|
48
|
+
|
|
49
|
+
#### `@mui/x-charts-pro@8.27.5` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
50
|
+
|
|
51
|
+
Same changes as in `@mui/x-charts@8.27.5`, plus:
|
|
52
|
+
|
|
53
|
+
- [charts-pro] Fix image export truncated when page is zoomed out (#21696) @bernardobelchior
|
|
54
|
+
|
|
55
|
+
#### `@mui/x-charts-premium@8.27.5` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
56
|
+
|
|
57
|
+
Same changes as in `@mui/x-charts-pro@8.27.5`.
|
|
58
|
+
|
|
59
|
+
### Docs
|
|
60
|
+
|
|
61
|
+
- [docs] Fix `AssistantWithDataSource` demo crashing (#21631) @sai6855
|
|
62
|
+
- [docs] Move Range Bar Chart to existing charts (#21122) @bernardobelchior
|
|
63
|
+
|
|
64
|
+
### Core
|
|
65
|
+
|
|
66
|
+
- [code-infra] Fix datagrid test flakyness (#21657) @JCQuintas
|
|
67
|
+
- [code-infra] Removed `getTeamMembers` function and usage from the release script (#21608) @michelengelen
|
|
68
|
+
|
|
69
|
+
### Miscellaneous
|
|
70
|
+
|
|
71
|
+
- [test] Add missing tests for forwarding props to filter operators in DataGrid (#21700) @siriwatknp
|
|
72
|
+
|
|
73
|
+
## 8.27.4
|
|
74
|
+
|
|
75
|
+
_Mar 5, 2026_
|
|
76
|
+
|
|
77
|
+
We'd like to extend a big thank you to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
78
|
+
|
|
79
|
+
- 🐞 Bugfixes
|
|
80
|
+
- 🌎 Improve Ukrainian (uk-UA) locale
|
|
81
|
+
|
|
82
|
+
Special thanks go out to this community member for their valuable contribution:
|
|
83
|
+
@lion1963
|
|
84
|
+
|
|
85
|
+
The following team members contributed to this release:
|
|
86
|
+
@arminmeh, @brijeshb42, @dav-is, @JCQuintas, @sai6855
|
|
87
|
+
|
|
88
|
+
### Data Grid
|
|
89
|
+
|
|
90
|
+
#### `@mui/x-data-grid@8.27.4`
|
|
91
|
+
|
|
92
|
+
- [DataGrid] Prevent unnecessary row selection checkbox rerendering (#21571) @arminmeh
|
|
93
|
+
- [DataGrid] Make `GridScrollArea` overrides resolver dynamic (#21612) @sai6855
|
|
94
|
+
- [l10n] Improve Ukrainian (uk-UA) locale (#21381) @lion1963
|
|
95
|
+
|
|
96
|
+
#### `@mui/x-data-grid-pro@8.27.4` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
97
|
+
|
|
98
|
+
Same changes as in `@mui/x-data-grid@8.27.4`, plus:
|
|
99
|
+
|
|
100
|
+
- [DataGridPro] Use `getRowId` prop to calculate the tree data row update (#21544) @arminmeh
|
|
101
|
+
|
|
102
|
+
#### `@mui/x-data-grid-premium@8.27.4` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
103
|
+
|
|
104
|
+
Same changes as in `@mui/x-data-grid-pro@8.27.4`.
|
|
105
|
+
|
|
106
|
+
### Charts
|
|
107
|
+
|
|
108
|
+
#### `@mui/x-charts@8.27.4`
|
|
109
|
+
|
|
110
|
+
- [charts] Deprecate `ChartDataProvider` in favour of `ChartsDataProvider` (#21549) @JCQuintas
|
|
111
|
+
- [charts] Rename `ChartContainer` to `ChartsContainer` (#21186) @JCQuintas
|
|
112
|
+
- [charts] Rename `ChartZoomSlider` to `ChartsZoomSlider` (#21572) @JCQuintas
|
|
113
|
+
|
|
114
|
+
#### `@mui/x-charts-pro@8.27.4` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
115
|
+
|
|
116
|
+
Same changes as in `@mui/x-charts@8.27.4`.
|
|
117
|
+
|
|
118
|
+
#### `@mui/x-charts-premium@8.27.4` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
119
|
+
|
|
120
|
+
Same changes as in `@mui/x-charts-pro@8.27.4`.
|
|
121
|
+
|
|
122
|
+
### Core
|
|
123
|
+
|
|
124
|
+
- [code-infra] Add eslint rule to prevent `Math.random` in docs (#21505) (#21563) @JCQuintas
|
|
125
|
+
- [code-infra] V8 Dedupe (#21561) @JCQuintas
|
|
126
|
+
- [docs-infra] Apply Cookie Banner to v8.x Branch (#21448) @dav-is
|
|
127
|
+
- [code-infra] Setup checkout to do full clone for non master branches (#21624) @brijeshb42
|
|
128
|
+
|
|
8
129
|
## 8.27.3
|
|
9
130
|
|
|
10
131
|
_Feb 25, 2026_
|
|
@@ -42,15 +42,12 @@ const useUtilityClasses = ownerState => {
|
|
|
42
42
|
const GridScrollAreaRawRoot = (0, _styles.styled)('div', {
|
|
43
43
|
name: 'MuiDataGrid',
|
|
44
44
|
slot: 'ScrollArea',
|
|
45
|
-
overridesResolver: (props, styles) =>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}, {
|
|
52
|
-
[`&.${_constants.gridClasses['scrollArea--down']}`]: styles['scrollArea--down']
|
|
53
|
-
}, styles.scrollArea]
|
|
45
|
+
overridesResolver: (props, styles) => {
|
|
46
|
+
const {
|
|
47
|
+
ownerState
|
|
48
|
+
} = props;
|
|
49
|
+
return [styles.scrollArea, styles[`scrollArea--${ownerState.scrollDirection}`]];
|
|
50
|
+
}
|
|
54
51
|
})(() => ({
|
|
55
52
|
position: 'absolute',
|
|
56
53
|
zIndex: 101,
|
|
@@ -11,6 +11,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _useId = _interopRequireDefault(require("@mui/utils/useId"));
|
|
13
13
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
14
|
+
var _capitalize = _interopRequireDefault(require("@mui/utils/capitalize"));
|
|
14
15
|
var _RtlProvider = require("@mui/system/RtlProvider");
|
|
15
16
|
var _doesSupportPreventScroll = require("../../utils/doesSupportPreventScroll");
|
|
16
17
|
var _gridClasses = require("../../constants/gridClasses");
|
|
@@ -35,7 +36,7 @@ const useUtilityClasses = ownerState => {
|
|
|
35
36
|
pinnedPosition
|
|
36
37
|
} = ownerState;
|
|
37
38
|
const slots = {
|
|
38
|
-
root: ['columnHeader', headerAlign
|
|
39
|
+
root: ['columnHeader', headerAlign && `columnHeader--align${(0, _capitalize.default)(headerAlign)}`, isDragging && 'columnHeader--moving', showRightBorder && 'columnHeader--withRightBorder', showLeftBorder && 'columnHeader--withLeftBorder', 'withBorderColor', groupId === null ? 'columnHeader--emptyGroup' : 'columnHeader--filledGroup', pinnedPosition === _constants.PinnedColumnPosition.LEFT && 'columnHeader--pinnedLeft', pinnedPosition === _constants.PinnedColumnPosition.RIGHT && 'columnHeader--pinnedRight', isLastColumn && 'columnHeader--last'],
|
|
39
40
|
draggableContainer: ['columnHeaderDraggableContainer'],
|
|
40
41
|
titleContainer: ['columnHeaderTitleContainer', 'withBorderColor'],
|
|
41
42
|
titleContainerContent: ['columnHeaderTitleContainerContent']
|
|
@@ -12,6 +12,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
14
14
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
15
|
+
var _capitalize = _interopRequireDefault(require("@mui/utils/capitalize"));
|
|
15
16
|
var _useId = _interopRequireDefault(require("@mui/utils/useId"));
|
|
16
17
|
var _fastMemo = require("@mui/x-internals/fastMemo");
|
|
17
18
|
var _RtlProvider = require("@mui/system/RtlProvider");
|
|
@@ -48,7 +49,7 @@ const useUtilityClasses = ownerState => {
|
|
|
48
49
|
// todo refactor to a prop on col isNumeric or ?? ie: coltype===price wont work
|
|
49
50
|
const isColumnNumeric = colDef.type === 'number';
|
|
50
51
|
const slots = {
|
|
51
|
-
root: ['columnHeader', colDef.headerAlign
|
|
52
|
+
root: ['columnHeader', colDef.headerAlign && `columnHeader--align${(0, _capitalize.default)(colDef.headerAlign)}`, isColumnSortable && 'columnHeader--sortable', isDragging && 'columnHeader--moving', isColumnSorted && 'columnHeader--sorted', isColumnFiltered && 'columnHeader--filtered', isColumnNumeric && 'columnHeader--numeric', 'withBorderColor', showRightBorder && 'columnHeader--withRightBorder', showLeftBorder && 'columnHeader--withLeftBorder', pinnedPosition === _constants.PinnedColumnPosition.LEFT && 'columnHeader--pinnedLeft', pinnedPosition === _constants.PinnedColumnPosition.RIGHT && 'columnHeader--pinnedRight',
|
|
52
53
|
// TODO: Remove classes below and restore `:has` selectors when they are supported in jsdom
|
|
53
54
|
// See https://github.com/mui/mui-x/pull/14559
|
|
54
55
|
isSiblingFocused && 'columnHeader--siblingFocused'],
|
|
@@ -52,7 +52,7 @@ const GridCellCheckboxForwardRef = exports.GridCellCheckboxForwardRef = (0, _for
|
|
|
52
52
|
} = (0, _useGridSelector.useGridSelector)(apiRef, _utils.checkboxPropsSelector, {
|
|
53
53
|
groupId: id,
|
|
54
54
|
autoSelectParents: rootProps.rowSelectionPropagation?.parents ?? false
|
|
55
|
-
});
|
|
55
|
+
}, _useGridSelector.objectShallowCompare);
|
|
56
56
|
const disabled = !isSelectable;
|
|
57
57
|
const handleChange = event => {
|
|
58
58
|
if (disabled) {
|
|
@@ -12,6 +12,7 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
15
|
+
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
15
16
|
var _forwardRef = require("@mui/x-internals/forwardRef");
|
|
16
17
|
var _utils = require("../../hooks/features/rowSelection/utils");
|
|
17
18
|
var _useGridSelector = require("../../hooks/utils/useGridSelector");
|
|
@@ -125,13 +126,14 @@ const GridHeaderCheckbox = exports.GridHeaderCheckbox = (0, _forwardRef.forwardR
|
|
|
125
126
|
};
|
|
126
127
|
apiRef.current.publishEvent('headerSelectionCheckboxChange', params);
|
|
127
128
|
};
|
|
128
|
-
const
|
|
129
|
-
|
|
129
|
+
const multipleSelectionEnabled = (0, _utils.isMultipleRowSelectionEnabled)(rootProps);
|
|
130
|
+
const tabIndex = tabIndexState !== null && tabIndexState.field === props.field && multipleSelectionEnabled ? 0 : -1;
|
|
131
|
+
(0, _useEnhancedEffect.default)(() => {
|
|
130
132
|
const element = apiRef.current.getColumnHeaderElement(props.field);
|
|
131
|
-
if (tabIndex === 0 && element) {
|
|
133
|
+
if (tabIndex === 0 && element && multipleSelectionEnabled) {
|
|
132
134
|
element.tabIndex = -1;
|
|
133
135
|
}
|
|
134
|
-
}, [tabIndex, apiRef, props.field]);
|
|
136
|
+
}, [tabIndex, apiRef, props.field, multipleSelectionEnabled]);
|
|
135
137
|
const handleKeyDown = React.useCallback(event => {
|
|
136
138
|
if (event.key === ' ') {
|
|
137
139
|
// imperative toggle the checkbox because Space is disable by some preventDefault
|
|
@@ -160,7 +162,7 @@ const GridHeaderCheckbox = exports.GridHeaderCheckbox = (0, _forwardRef.forwardR
|
|
|
160
162
|
},
|
|
161
163
|
tabIndex: tabIndex,
|
|
162
164
|
onKeyDown: handleKeyDown,
|
|
163
|
-
disabled: !
|
|
165
|
+
disabled: !multipleSelectionEnabled
|
|
164
166
|
}, rootProps.slotProps?.baseCheckbox, other, {
|
|
165
167
|
ref: ref
|
|
166
168
|
}));
|
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
3
|
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
9
|
exports.GridFilterInputMultipleValue = GridFilterInputMultipleValue;
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
12
|
var React = _interopRequireWildcard(require("react"));
|
|
12
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
14
|
var _useId = _interopRequireDefault(require("@mui/utils/useId"));
|
|
14
15
|
var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
|
|
15
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "slotProps"];
|
|
16
18
|
function GridFilterInputMultipleValue(props) {
|
|
17
19
|
const {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
item,
|
|
21
|
+
applyValue,
|
|
22
|
+
type,
|
|
23
|
+
apiRef,
|
|
24
|
+
focusElementRef,
|
|
25
|
+
slotProps
|
|
26
|
+
} = props,
|
|
27
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
25
28
|
const id = (0, _useId.default)();
|
|
26
29
|
const [options, setOptions] = React.useState([]);
|
|
27
30
|
const [filterValueState, setFilterValueState] = React.useState(item.value || []);
|
|
@@ -60,7 +63,7 @@ function GridFilterInputMultipleValue(props) {
|
|
|
60
63
|
inputRef: focusElementRef
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
|
-
}, slotProps?.root));
|
|
66
|
+
}, other, slotProps?.root));
|
|
64
67
|
}
|
|
65
68
|
process.env.NODE_ENV !== "production" ? GridFilterInputMultipleValue.propTypes = {
|
|
66
69
|
// ----------------------------- Warning --------------------------------
|
package/constants/gridClasses.js
CHANGED
|
@@ -13,4 +13,4 @@ function getDataGridUtilityClass(slot) {
|
|
|
13
13
|
}
|
|
14
14
|
const gridClasses = exports.gridClasses = (0, _generateUtilityClasses.default)('MuiDataGrid', ['aiAssistantPanel', 'aiAssistantPanelHeader', 'aiAssistantPanelTitleContainer', 'aiAssistantPanelTitle', 'aiAssistantPanelBody', 'aiAssistantPanelEmptyText', 'aiAssistantPanelFooter', 'aiAssistantPanelConversation', 'aiAssistantPanelConversationList', 'aiAssistantPanelConversationTitle', 'aiAssistantPanelSuggestions', 'aiAssistantPanelSuggestionsList', 'aiAssistantPanelSuggestionsItem', 'aiAssistantPanelSuggestionsLabel', 'actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'aggregationColumnHeaderLabel', 'aggregationRowOverlayWrapper', 'autoHeight', 'autosizing', 'mainContent', 'withSidePanel', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--flex', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell--pinnedLeft', 'cell--pinnedRight', 'cell--selectionMode', 'cell', 'cellCheckbox', 'cellEmpty', 'cellSkeleton', 'cellOffsetLeft', 'checkboxInput', 'collapsible', 'collapsibleTrigger', 'collapsibleIcon', 'collapsiblePanel', 'columnHeader', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader--pinnedLeft', 'columnHeader--pinnedRight', 'columnHeader--last', 'columnHeader--siblingFocused', 'columnHeader--filter', 'columnHeaderFilterInput', 'columnHeaderFilterOperatorLabel', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeaders', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsManagement', 'columnsManagementRow', 'columnsManagementHeader', 'columnsManagementSearchInput', 'columnsManagementFooter', 'columnsManagementScrollArea', 'columnsManagementEmptyText', 'container--top', 'container--bottom', 'detailPanel', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'longTextCell', 'longTextCellContent', 'longTextCellExpandButton', 'longTextCellCollapseButton', 'longTextCellPopup', 'longTextCellPopperContent', 'editLongTextCell', 'editLongTextCellValue', 'editLongTextCellPopup', 'editLongTextCellPopperContent', 'editLongTextCellTextarea', 'filler', 'filler--borderBottom', 'filler--pinnedLeft', 'filler--pinnedRight', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'headerFilterRow', 'iconButtonContainer', 'iconSeparator', 'main', 'main--hasPinnedRight', 'main--hiddenContent', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'root--noToolbar', 'row', 'row--editable', 'row--editing', 'row--firstVisible', 'row--lastVisible',
|
|
15
15
|
// TODO v9: Rename to `cell--dragging`
|
|
16
|
-
'row--dragging', 'row--beingDragged', 'row--dynamicHeight', 'row--detailPanelExpanded', 'row--borderBottom', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'rowReorderIcon', 'rowSkeleton', 'scrollArea--left', 'scrollArea--right', 'scrollArea--up', 'scrollArea--down', 'scrollArea', 'scrollbar', 'scrollbar--vertical', 'scrollbar--horizontal', 'scrollbarFiller', 'scrollbarFiller--pinnedRight', 'scrollShadow', 'scrollShadow--vertical', 'scrollShadow--horizontal', 'selectedRowCount', 'sortButton', 'sortIcon', 'shadowScrollArea', 'sidebar', 'sidebarHeader', 'toolbarContainer', 'toolbar', 'toolbarLabel', 'toolbarDivider', 'toolbarFilterList', 'toolbarQuickFilter', 'toolbarQuickFilterTrigger', 'toolbarQuickFilterControl', 'virtualScroller', 'virtualScroller--hasScrollX', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'withVerticalBorder', 'withBorderColor', 'cell--withRightBorder', 'cell--withLeftBorder', 'columnHeader--withRightBorder', 'columnHeader--withLeftBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'treeDataGroupingCellLoadingContainer', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'groupingCriteriaCellLoadingContainer', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pivotPanelAvailableFields', 'pivotPanelField', 'pivotPanelField--sorted', 'pivotPanelFieldActionContainer', 'pivotPanelFieldCheckbox', 'pivotPanelFieldDragIcon', 'pivotPanelFieldList', 'pivotPanelFieldName', 'pivotPanelHeader', 'pivotPanelPlaceholder', 'pivotPanelScrollArea', 'pivotPanelSearchContainer', 'pivotPanelSection', 'pivotPanelSectionTitle', 'pivotPanelSections', 'pivotPanelSwitch', 'pivotPanelSwitchLabel', 'prompt', 'promptContent', 'promptText', 'promptFeedback', 'promptChangeList', 'promptChangesToggle', 'promptChangesToggleIcon', 'promptIcon', 'promptIconContainer', 'promptError', 'promptAction']);
|
|
16
|
+
'row--dragging', 'row--beingDragged', 'row--dynamicHeight', 'row--detailPanelExpanded', 'row--borderBottom', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'rowReorderIcon', 'rowSkeleton', 'scrollArea--left', 'scrollArea--right', 'scrollArea--up', 'scrollArea--down', 'scrollArea', 'scrollbar', 'scrollbar--vertical', 'scrollbar--horizontal', 'scrollbarFiller', 'scrollbarFiller--pinnedRight', 'scrollShadow', 'scrollShadow--vertical', 'scrollShadow--horizontal', 'selectedRowCount', 'sortButton', 'sortIcon', 'shadowScrollArea', 'sidebar', 'sidebarHeader', 'toolbarContainer', 'toolbar', 'toolbarLabel', 'toolbarDivider', 'toolbarFilterList', 'toolbarQuickFilter', 'toolbarQuickFilterTrigger', 'toolbarQuickFilterControl', 'virtualScroller', 'virtualScroller--hasScrollX', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'withVerticalBorder', 'withBorderColor', 'cell--withRightBorder', 'cell--withLeftBorder', 'columnHeader--withRightBorder', 'columnHeader--withLeftBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'treeDataGroupingCellLoadingContainer', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'groupingCriteriaCellLoadingContainer', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pivotPanelAvailableFields', 'pivotPanelField', 'pivotPanelField--sorted', 'pivotPanelFieldActionContainer', 'pivotPanelFieldCheckbox', 'pivotPanelFieldDragIcon', 'pivotPanelFieldList', 'pivotPanelFieldName', 'pivotPanelHeader', 'pivotPanelPlaceholder', 'pivotPanelScrollArea', 'pivotPanelSearchContainer', 'pivotPanelSection', 'pivotPanelSectionTitle', 'pivotPanelSections', 'pivotPanelSwitch', 'pivotPanelSwitchLabel', 'prompt', 'promptContent', 'promptText', 'promptFeedback', 'promptChangeList', 'promptChangesToggle', 'promptChangesToggleIcon', 'promptIcon', 'promptIconContainer', 'promptError', 'promptAction', 'resizablePanelHandle', 'resizablePanelHandle--horizontal', 'resizablePanelHandle--vertical']);
|
|
@@ -35,15 +35,12 @@ const useUtilityClasses = ownerState => {
|
|
|
35
35
|
const GridScrollAreaRawRoot = styled('div', {
|
|
36
36
|
name: 'MuiDataGrid',
|
|
37
37
|
slot: 'ScrollArea',
|
|
38
|
-
overridesResolver: (props, styles) =>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}, {
|
|
45
|
-
[`&.${gridClasses['scrollArea--down']}`]: styles['scrollArea--down']
|
|
46
|
-
}, styles.scrollArea]
|
|
38
|
+
overridesResolver: (props, styles) => {
|
|
39
|
+
const {
|
|
40
|
+
ownerState
|
|
41
|
+
} = props;
|
|
42
|
+
return [styles.scrollArea, styles[`scrollArea--${ownerState.scrollDirection}`]];
|
|
43
|
+
}
|
|
47
44
|
})(() => ({
|
|
48
45
|
position: 'absolute',
|
|
49
46
|
zIndex: 101,
|
|
@@ -4,6 +4,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import useId from '@mui/utils/useId';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
+
import capitalize from '@mui/utils/capitalize';
|
|
7
8
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
8
9
|
import { doesSupportPreventScroll } from "../../utils/doesSupportPreventScroll.js";
|
|
9
10
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
@@ -28,7 +29,7 @@ const useUtilityClasses = ownerState => {
|
|
|
28
29
|
pinnedPosition
|
|
29
30
|
} = ownerState;
|
|
30
31
|
const slots = {
|
|
31
|
-
root: ['columnHeader', headerAlign
|
|
32
|
+
root: ['columnHeader', headerAlign && `columnHeader--align${capitalize(headerAlign)}`, isDragging && 'columnHeader--moving', showRightBorder && 'columnHeader--withRightBorder', showLeftBorder && 'columnHeader--withLeftBorder', 'withBorderColor', groupId === null ? 'columnHeader--emptyGroup' : 'columnHeader--filledGroup', pinnedPosition === PinnedColumnPosition.LEFT && 'columnHeader--pinnedLeft', pinnedPosition === PinnedColumnPosition.RIGHT && 'columnHeader--pinnedRight', isLastColumn && 'columnHeader--last'],
|
|
32
33
|
draggableContainer: ['columnHeaderDraggableContainer'],
|
|
33
34
|
titleContainer: ['columnHeaderTitleContainer', 'withBorderColor'],
|
|
34
35
|
titleContainerContent: ['columnHeaderTitleContainerContent']
|
|
@@ -5,6 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import composeClasses from '@mui/utils/composeClasses';
|
|
8
|
+
import capitalize from '@mui/utils/capitalize';
|
|
8
9
|
import useId from '@mui/utils/useId';
|
|
9
10
|
import { fastMemo } from '@mui/x-internals/fastMemo';
|
|
10
11
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
@@ -41,7 +42,7 @@ const useUtilityClasses = ownerState => {
|
|
|
41
42
|
// todo refactor to a prop on col isNumeric or ?? ie: coltype===price wont work
|
|
42
43
|
const isColumnNumeric = colDef.type === 'number';
|
|
43
44
|
const slots = {
|
|
44
|
-
root: ['columnHeader', colDef.headerAlign
|
|
45
|
+
root: ['columnHeader', colDef.headerAlign && `columnHeader--align${capitalize(colDef.headerAlign)}`, isColumnSortable && 'columnHeader--sortable', isDragging && 'columnHeader--moving', isColumnSorted && 'columnHeader--sorted', isColumnFiltered && 'columnHeader--filtered', isColumnNumeric && 'columnHeader--numeric', 'withBorderColor', showRightBorder && 'columnHeader--withRightBorder', showLeftBorder && 'columnHeader--withLeftBorder', pinnedPosition === PinnedColumnPosition.LEFT && 'columnHeader--pinnedLeft', pinnedPosition === PinnedColumnPosition.RIGHT && 'columnHeader--pinnedRight',
|
|
45
46
|
// TODO: Remove classes below and restore `:has` selectors when they are supported in jsdom
|
|
46
47
|
// See https://github.com/mui/mui-x/pull/14559
|
|
47
48
|
isSiblingFocused && 'columnHeader--siblingFocused'],
|
|
@@ -12,7 +12,7 @@ import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
|
12
12
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
13
13
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
14
14
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
15
|
-
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
15
|
+
import { useGridSelector, objectShallowCompare } from "../../hooks/utils/useGridSelector.js";
|
|
16
16
|
import { checkboxPropsSelector } from "../../hooks/features/rowSelection/utils.js";
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
18
|
const useUtilityClasses = ownerState => {
|
|
@@ -45,7 +45,7 @@ const GridCellCheckboxForwardRef = forwardRef(function GridCellCheckboxRenderer(
|
|
|
45
45
|
} = useGridSelector(apiRef, checkboxPropsSelector, {
|
|
46
46
|
groupId: id,
|
|
47
47
|
autoSelectParents: rootProps.rowSelectionPropagation?.parents ?? false
|
|
48
|
-
});
|
|
48
|
+
}, objectShallowCompare);
|
|
49
49
|
const disabled = !isSelectable;
|
|
50
50
|
const handleChange = event => {
|
|
51
51
|
if (disabled) {
|
|
@@ -6,6 +6,7 @@ const _excluded = ["field", "colDef"];
|
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import composeClasses from '@mui/utils/composeClasses';
|
|
9
|
+
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
9
10
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
10
11
|
import { isMultipleRowSelectionEnabled } from "../../hooks/features/rowSelection/utils.js";
|
|
11
12
|
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
@@ -118,13 +119,14 @@ const GridHeaderCheckbox = forwardRef(function GridHeaderCheckbox(props, ref) {
|
|
|
118
119
|
};
|
|
119
120
|
apiRef.current.publishEvent('headerSelectionCheckboxChange', params);
|
|
120
121
|
};
|
|
121
|
-
const
|
|
122
|
-
|
|
122
|
+
const multipleSelectionEnabled = isMultipleRowSelectionEnabled(rootProps);
|
|
123
|
+
const tabIndex = tabIndexState !== null && tabIndexState.field === props.field && multipleSelectionEnabled ? 0 : -1;
|
|
124
|
+
useEnhancedEffect(() => {
|
|
123
125
|
const element = apiRef.current.getColumnHeaderElement(props.field);
|
|
124
|
-
if (tabIndex === 0 && element) {
|
|
126
|
+
if (tabIndex === 0 && element && multipleSelectionEnabled) {
|
|
125
127
|
element.tabIndex = -1;
|
|
126
128
|
}
|
|
127
|
-
}, [tabIndex, apiRef, props.field]);
|
|
129
|
+
}, [tabIndex, apiRef, props.field, multipleSelectionEnabled]);
|
|
128
130
|
const handleKeyDown = React.useCallback(event => {
|
|
129
131
|
if (event.key === ' ') {
|
|
130
132
|
// imperative toggle the checkbox because Space is disable by some preventDefault
|
|
@@ -153,7 +155,7 @@ const GridHeaderCheckbox = forwardRef(function GridHeaderCheckbox(props, ref) {
|
|
|
153
155
|
},
|
|
154
156
|
tabIndex: tabIndex,
|
|
155
157
|
onKeyDown: handleKeyDown,
|
|
156
|
-
disabled: !
|
|
158
|
+
disabled: !multipleSelectionEnabled
|
|
157
159
|
}, rootProps.slotProps?.baseCheckbox, other, {
|
|
158
160
|
ref: ref
|
|
159
161
|
}));
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "slotProps"];
|
|
4
6
|
import * as React from 'react';
|
|
5
7
|
import PropTypes from 'prop-types';
|
|
6
8
|
import useId from '@mui/utils/useId';
|
|
@@ -8,13 +10,14 @@ import { useGridRootProps } from "../../../hooks/utils/useGridRootProps.js";
|
|
|
8
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
11
|
function GridFilterInputMultipleValue(props) {
|
|
10
12
|
const {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
item,
|
|
14
|
+
applyValue,
|
|
15
|
+
type,
|
|
16
|
+
apiRef,
|
|
17
|
+
focusElementRef,
|
|
18
|
+
slotProps
|
|
19
|
+
} = props,
|
|
20
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
18
21
|
const id = useId();
|
|
19
22
|
const [options, setOptions] = React.useState([]);
|
|
20
23
|
const [filterValueState, setFilterValueState] = React.useState(item.value || []);
|
|
@@ -53,7 +56,7 @@ function GridFilterInputMultipleValue(props) {
|
|
|
53
56
|
inputRef: focusElementRef
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
|
-
}, slotProps?.root));
|
|
59
|
+
}, other, slotProps?.root));
|
|
57
60
|
}
|
|
58
61
|
process.env.NODE_ENV !== "production" ? GridFilterInputMultipleValue.propTypes = {
|
|
59
62
|
// ----------------------------- Warning --------------------------------
|
|
@@ -5,4 +5,4 @@ export function getDataGridUtilityClass(slot) {
|
|
|
5
5
|
}
|
|
6
6
|
export const gridClasses = generateUtilityClasses('MuiDataGrid', ['aiAssistantPanel', 'aiAssistantPanelHeader', 'aiAssistantPanelTitleContainer', 'aiAssistantPanelTitle', 'aiAssistantPanelBody', 'aiAssistantPanelEmptyText', 'aiAssistantPanelFooter', 'aiAssistantPanelConversation', 'aiAssistantPanelConversationList', 'aiAssistantPanelConversationTitle', 'aiAssistantPanelSuggestions', 'aiAssistantPanelSuggestionsList', 'aiAssistantPanelSuggestionsItem', 'aiAssistantPanelSuggestionsLabel', 'actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'aggregationColumnHeaderLabel', 'aggregationRowOverlayWrapper', 'autoHeight', 'autosizing', 'mainContent', 'withSidePanel', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--flex', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell--pinnedLeft', 'cell--pinnedRight', 'cell--selectionMode', 'cell', 'cellCheckbox', 'cellEmpty', 'cellSkeleton', 'cellOffsetLeft', 'checkboxInput', 'collapsible', 'collapsibleTrigger', 'collapsibleIcon', 'collapsiblePanel', 'columnHeader', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader--pinnedLeft', 'columnHeader--pinnedRight', 'columnHeader--last', 'columnHeader--siblingFocused', 'columnHeader--filter', 'columnHeaderFilterInput', 'columnHeaderFilterOperatorLabel', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeaders', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsManagement', 'columnsManagementRow', 'columnsManagementHeader', 'columnsManagementSearchInput', 'columnsManagementFooter', 'columnsManagementScrollArea', 'columnsManagementEmptyText', 'container--top', 'container--bottom', 'detailPanel', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'longTextCell', 'longTextCellContent', 'longTextCellExpandButton', 'longTextCellCollapseButton', 'longTextCellPopup', 'longTextCellPopperContent', 'editLongTextCell', 'editLongTextCellValue', 'editLongTextCellPopup', 'editLongTextCellPopperContent', 'editLongTextCellTextarea', 'filler', 'filler--borderBottom', 'filler--pinnedLeft', 'filler--pinnedRight', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'headerFilterRow', 'iconButtonContainer', 'iconSeparator', 'main', 'main--hasPinnedRight', 'main--hiddenContent', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'root--noToolbar', 'row', 'row--editable', 'row--editing', 'row--firstVisible', 'row--lastVisible',
|
|
7
7
|
// TODO v9: Rename to `cell--dragging`
|
|
8
|
-
'row--dragging', 'row--beingDragged', 'row--dynamicHeight', 'row--detailPanelExpanded', 'row--borderBottom', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'rowReorderIcon', 'rowSkeleton', 'scrollArea--left', 'scrollArea--right', 'scrollArea--up', 'scrollArea--down', 'scrollArea', 'scrollbar', 'scrollbar--vertical', 'scrollbar--horizontal', 'scrollbarFiller', 'scrollbarFiller--pinnedRight', 'scrollShadow', 'scrollShadow--vertical', 'scrollShadow--horizontal', 'selectedRowCount', 'sortButton', 'sortIcon', 'shadowScrollArea', 'sidebar', 'sidebarHeader', 'toolbarContainer', 'toolbar', 'toolbarLabel', 'toolbarDivider', 'toolbarFilterList', 'toolbarQuickFilter', 'toolbarQuickFilterTrigger', 'toolbarQuickFilterControl', 'virtualScroller', 'virtualScroller--hasScrollX', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'withVerticalBorder', 'withBorderColor', 'cell--withRightBorder', 'cell--withLeftBorder', 'columnHeader--withRightBorder', 'columnHeader--withLeftBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'treeDataGroupingCellLoadingContainer', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'groupingCriteriaCellLoadingContainer', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pivotPanelAvailableFields', 'pivotPanelField', 'pivotPanelField--sorted', 'pivotPanelFieldActionContainer', 'pivotPanelFieldCheckbox', 'pivotPanelFieldDragIcon', 'pivotPanelFieldList', 'pivotPanelFieldName', 'pivotPanelHeader', 'pivotPanelPlaceholder', 'pivotPanelScrollArea', 'pivotPanelSearchContainer', 'pivotPanelSection', 'pivotPanelSectionTitle', 'pivotPanelSections', 'pivotPanelSwitch', 'pivotPanelSwitchLabel', 'prompt', 'promptContent', 'promptText', 'promptFeedback', 'promptChangeList', 'promptChangesToggle', 'promptChangesToggleIcon', 'promptIcon', 'promptIconContainer', 'promptError', 'promptAction']);
|
|
8
|
+
'row--dragging', 'row--beingDragged', 'row--dynamicHeight', 'row--detailPanelExpanded', 'row--borderBottom', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'rowReorderIcon', 'rowSkeleton', 'scrollArea--left', 'scrollArea--right', 'scrollArea--up', 'scrollArea--down', 'scrollArea', 'scrollbar', 'scrollbar--vertical', 'scrollbar--horizontal', 'scrollbarFiller', 'scrollbarFiller--pinnedRight', 'scrollShadow', 'scrollShadow--vertical', 'scrollShadow--horizontal', 'selectedRowCount', 'sortButton', 'sortIcon', 'shadowScrollArea', 'sidebar', 'sidebarHeader', 'toolbarContainer', 'toolbar', 'toolbarLabel', 'toolbarDivider', 'toolbarFilterList', 'toolbarQuickFilter', 'toolbarQuickFilterTrigger', 'toolbarQuickFilterControl', 'virtualScroller', 'virtualScroller--hasScrollX', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'withVerticalBorder', 'withBorderColor', 'cell--withRightBorder', 'cell--withLeftBorder', 'columnHeader--withRightBorder', 'columnHeader--withLeftBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'treeDataGroupingCellLoadingContainer', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'groupingCriteriaCellLoadingContainer', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pivotPanelAvailableFields', 'pivotPanelField', 'pivotPanelField--sorted', 'pivotPanelFieldActionContainer', 'pivotPanelFieldCheckbox', 'pivotPanelFieldDragIcon', 'pivotPanelFieldList', 'pivotPanelFieldName', 'pivotPanelHeader', 'pivotPanelPlaceholder', 'pivotPanelScrollArea', 'pivotPanelSearchContainer', 'pivotPanelSection', 'pivotPanelSectionTitle', 'pivotPanelSections', 'pivotPanelSwitch', 'pivotPanelSwitchLabel', 'prompt', 'promptContent', 'promptText', 'promptFeedback', 'promptChangeList', 'promptChangesToggle', 'promptChangesToggleIcon', 'promptIcon', 'promptIconContainer', 'promptError', 'promptAction', 'resizablePanelHandle', 'resizablePanelHandle--horizontal', 'resizablePanelHandle--vertical']);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createSelector, createSelectorMemoized, createRootSelector } from "../../../utils/createSelector.js";
|
|
2
2
|
import { EMPTY_PINNED_COLUMN_FIELDS } from "./gridColumnsInterfaces.js";
|
|
3
|
-
import { gridIsRtlSelector } from "../../core/gridCoreSelector.js";
|
|
4
3
|
import { gridListColumnSelector, gridListViewSelector } from "../listView/index.js";
|
|
5
4
|
|
|
6
5
|
/**
|
|
@@ -65,24 +64,24 @@ export const gridPinnedColumnsSelector = createRootSelector(state => state.pinne
|
|
|
65
64
|
* @category Pinned Columns
|
|
66
65
|
* @ignore - Do not document
|
|
67
66
|
*/
|
|
68
|
-
export const gridExistingPinnedColumnSelector = createSelectorMemoized(gridPinnedColumnsSelector, gridColumnFieldsSelector,
|
|
67
|
+
export const gridExistingPinnedColumnSelector = createSelectorMemoized(gridPinnedColumnsSelector, gridColumnFieldsSelector, (model, orderedFields) => filterMissingColumns(model, orderedFields));
|
|
69
68
|
|
|
70
69
|
/**
|
|
71
70
|
* Get the visible pinned columns.
|
|
72
71
|
* @category Visible Columns
|
|
73
72
|
*/
|
|
74
|
-
export const gridVisiblePinnedColumnDefinitionsSelector = createSelectorMemoized(gridColumnsStateSelector, gridPinnedColumnsSelector, gridVisibleColumnFieldsSelector,
|
|
73
|
+
export const gridVisiblePinnedColumnDefinitionsSelector = createSelectorMemoized(gridColumnsStateSelector, gridPinnedColumnsSelector, gridVisibleColumnFieldsSelector, gridListViewSelector, (columnsState, model, visibleColumnFields, listView) => {
|
|
75
74
|
if (listView) {
|
|
76
75
|
return EMPTY_PINNED_COLUMN_FIELDS;
|
|
77
76
|
}
|
|
78
|
-
const visiblePinnedFields = filterMissingColumns(model, visibleColumnFields
|
|
77
|
+
const visiblePinnedFields = filterMissingColumns(model, visibleColumnFields);
|
|
79
78
|
const visiblePinnedColumns = {
|
|
80
79
|
left: visiblePinnedFields.left.map(field => columnsState.lookup[field]),
|
|
81
80
|
right: visiblePinnedFields.right.map(field => columnsState.lookup[field])
|
|
82
81
|
};
|
|
83
82
|
return visiblePinnedColumns;
|
|
84
83
|
});
|
|
85
|
-
function filterMissingColumns(pinnedColumns, columns
|
|
84
|
+
function filterMissingColumns(pinnedColumns, columns) {
|
|
86
85
|
if (!Array.isArray(pinnedColumns.left) && !Array.isArray(pinnedColumns.right)) {
|
|
87
86
|
return EMPTY_PINNED_COLUMN_FIELDS;
|
|
88
87
|
}
|
|
@@ -96,16 +95,8 @@ function filterMissingColumns(pinnedColumns, columns, invert) {
|
|
|
96
95
|
return newPinnedColumns.filter(field => remainingColumns.includes(field));
|
|
97
96
|
};
|
|
98
97
|
const leftPinnedColumns = filter(pinnedColumns.left, columns);
|
|
99
|
-
const columnsWithoutLeftPinnedColumns = columns.filter(
|
|
100
|
-
// Filter out from the remaining columns those columns already pinned to the left
|
|
101
|
-
field => !leftPinnedColumns.includes(field));
|
|
98
|
+
const columnsWithoutLeftPinnedColumns = columns.filter(field => !leftPinnedColumns.includes(field));
|
|
102
99
|
const rightPinnedColumns = filter(pinnedColumns.right, columnsWithoutLeftPinnedColumns);
|
|
103
|
-
if (invert) {
|
|
104
|
-
return {
|
|
105
|
-
left: rightPinnedColumns,
|
|
106
|
-
right: leftPinnedColumns
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
100
|
return {
|
|
110
101
|
left: leftPinnedColumns,
|
|
111
102
|
right: rightPinnedColumns
|
|
@@ -253,9 +253,10 @@ export const useGridDataSourceBase = (apiRef, props, options = {}) => {
|
|
|
253
253
|
};
|
|
254
254
|
const debouncedFetchRows = React.useMemo(() => debounce(fetchRows, 0), [fetchRows]);
|
|
255
255
|
const handleFetchRowsOnParamsChange = React.useCallback(() => {
|
|
256
|
+
apiRef.current.setRows([]);
|
|
256
257
|
stopPolling();
|
|
257
258
|
debouncedFetchRows();
|
|
258
|
-
}, [stopPolling, debouncedFetchRows]);
|
|
259
|
+
}, [stopPolling, debouncedFetchRows, apiRef]);
|
|
259
260
|
const isFirstRender = React.useRef(true);
|
|
260
261
|
React.useEffect(() => {
|
|
261
262
|
if (isFirstRender.current) {
|
|
@@ -403,11 +403,15 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
403
403
|
updateRowInRowModesModel(id, null);
|
|
404
404
|
delete prevRowValuesLookup.current[id];
|
|
405
405
|
};
|
|
406
|
-
if (ignoreModifications) {
|
|
406
|
+
if (ignoreModifications && apiRef.current.getRow(id)) {
|
|
407
407
|
finishRowEditMode();
|
|
408
408
|
return;
|
|
409
409
|
}
|
|
410
410
|
const editingState = gridEditRowsStateSelector(apiRef);
|
|
411
|
+
if (!editingState[id]) {
|
|
412
|
+
finishRowEditMode();
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
411
415
|
const row = prevRowValuesLookup.current[id];
|
|
412
416
|
const isSomeFieldProcessingProps = Object.values(editingState[id]).some(fieldProps => fieldProps.isProcessingProps);
|
|
413
417
|
if (isSomeFieldProcessingProps) {
|
|
@@ -466,14 +470,18 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
466
470
|
Promise.resolve(processRowUpdate(rowUpdate, row, {
|
|
467
471
|
rowId: id
|
|
468
472
|
})).then(finalRowUpdate => {
|
|
469
|
-
apiRef.current.
|
|
473
|
+
if (apiRef.current.getRow(id)) {
|
|
474
|
+
apiRef.current.updateRows([finalRowUpdate]);
|
|
475
|
+
}
|
|
470
476
|
finishRowEditMode();
|
|
471
477
|
}).catch(handleError);
|
|
472
478
|
} catch (errorThrown) {
|
|
473
479
|
handleError(errorThrown);
|
|
474
480
|
}
|
|
475
481
|
} else {
|
|
476
|
-
apiRef.current.
|
|
482
|
+
if (apiRef.current.getRow(id)) {
|
|
483
|
+
apiRef.current.updateRows([rowUpdate]);
|
|
484
|
+
}
|
|
477
485
|
finishRowEditMode();
|
|
478
486
|
}
|
|
479
487
|
});
|
|
@@ -641,5 +649,5 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
641
649
|
}, params));
|
|
642
650
|
}
|
|
643
651
|
});
|
|
644
|
-
}, [apiRef, rowModesModel, updateStateToStartRowEditMode, updateStateToStopRowEditMode]);
|
|
652
|
+
}, [apiRef, rowModesModel, updateOrDeleteRowState, updateStateToStartRowEditMode, updateStateToStopRowEditMode, updateRowInRowModesModel]);
|
|
645
653
|
};
|
package/esm/index.js
CHANGED
package/esm/locales/ukUA.js
CHANGED
|
@@ -188,18 +188,19 @@ const ukUAGrid = {
|
|
|
188
188
|
collapseDetailPanel: 'Приховати',
|
|
189
189
|
// Pagination
|
|
190
190
|
paginationRowsPerPage: 'Рядків на сторінці:',
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
191
|
+
paginationDisplayedRows: ({
|
|
192
|
+
from,
|
|
193
|
+
to,
|
|
194
|
+
count,
|
|
195
|
+
estimated
|
|
196
|
+
}) => {
|
|
197
|
+
const unknownRowCount = count == null || count === -1;
|
|
198
|
+
if (!estimated) {
|
|
199
|
+
return `${from}–${to} з ${!unknownRowCount ? count : `більше ніж ${to}`}`;
|
|
200
|
+
}
|
|
201
|
+
const estimatedLabel = estimated && estimated > to ? `близько ${estimated}` : `більше ніж ${to}`;
|
|
202
|
+
return `${from}–${to} з ${!unknownRowCount ? count : estimatedLabel}`;
|
|
203
|
+
},
|
|
203
204
|
paginationItemAriaLabel: type => {
|
|
204
205
|
if (type === 'first') {
|
|
205
206
|
return 'Перейти на першу сторінку';
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.gridVisiblePinnedColumnDefinitionsSelector = exports.gridVisibleColumnFieldsSelector = exports.gridVisibleColumnDefinitionsSelector = exports.gridPinnedColumnsSelector = exports.gridInitialColumnVisibilityModelSelector = exports.gridHasColSpanSelector = exports.gridFilterableColumnLookupSelector = exports.gridFilterableColumnDefinitionsSelector = exports.gridExistingPinnedColumnSelector = exports.gridColumnsStateSelector = exports.gridColumnVisibilityModelSelector = exports.gridColumnPositionsSelector = exports.gridColumnLookupSelector = exports.gridColumnFieldsSelector = exports.gridColumnDefinitionsSelector = void 0;
|
|
7
7
|
var _createSelector = require("../../../utils/createSelector");
|
|
8
8
|
var _gridColumnsInterfaces = require("./gridColumnsInterfaces");
|
|
9
|
-
var _gridCoreSelector = require("../../core/gridCoreSelector");
|
|
10
9
|
var _listView = require("../listView");
|
|
11
10
|
/**
|
|
12
11
|
* Get the columns state
|
|
@@ -70,24 +69,24 @@ const gridPinnedColumnsSelector = exports.gridPinnedColumnsSelector = (0, _creat
|
|
|
70
69
|
* @category Pinned Columns
|
|
71
70
|
* @ignore - Do not document
|
|
72
71
|
*/
|
|
73
|
-
const gridExistingPinnedColumnSelector = exports.gridExistingPinnedColumnSelector = (0, _createSelector.createSelectorMemoized)(gridPinnedColumnsSelector, gridColumnFieldsSelector,
|
|
72
|
+
const gridExistingPinnedColumnSelector = exports.gridExistingPinnedColumnSelector = (0, _createSelector.createSelectorMemoized)(gridPinnedColumnsSelector, gridColumnFieldsSelector, (model, orderedFields) => filterMissingColumns(model, orderedFields));
|
|
74
73
|
|
|
75
74
|
/**
|
|
76
75
|
* Get the visible pinned columns.
|
|
77
76
|
* @category Visible Columns
|
|
78
77
|
*/
|
|
79
|
-
const gridVisiblePinnedColumnDefinitionsSelector = exports.gridVisiblePinnedColumnDefinitionsSelector = (0, _createSelector.createSelectorMemoized)(gridColumnsStateSelector, gridPinnedColumnsSelector, gridVisibleColumnFieldsSelector,
|
|
78
|
+
const gridVisiblePinnedColumnDefinitionsSelector = exports.gridVisiblePinnedColumnDefinitionsSelector = (0, _createSelector.createSelectorMemoized)(gridColumnsStateSelector, gridPinnedColumnsSelector, gridVisibleColumnFieldsSelector, _listView.gridListViewSelector, (columnsState, model, visibleColumnFields, listView) => {
|
|
80
79
|
if (listView) {
|
|
81
80
|
return _gridColumnsInterfaces.EMPTY_PINNED_COLUMN_FIELDS;
|
|
82
81
|
}
|
|
83
|
-
const visiblePinnedFields = filterMissingColumns(model, visibleColumnFields
|
|
82
|
+
const visiblePinnedFields = filterMissingColumns(model, visibleColumnFields);
|
|
84
83
|
const visiblePinnedColumns = {
|
|
85
84
|
left: visiblePinnedFields.left.map(field => columnsState.lookup[field]),
|
|
86
85
|
right: visiblePinnedFields.right.map(field => columnsState.lookup[field])
|
|
87
86
|
};
|
|
88
87
|
return visiblePinnedColumns;
|
|
89
88
|
});
|
|
90
|
-
function filterMissingColumns(pinnedColumns, columns
|
|
89
|
+
function filterMissingColumns(pinnedColumns, columns) {
|
|
91
90
|
if (!Array.isArray(pinnedColumns.left) && !Array.isArray(pinnedColumns.right)) {
|
|
92
91
|
return _gridColumnsInterfaces.EMPTY_PINNED_COLUMN_FIELDS;
|
|
93
92
|
}
|
|
@@ -101,16 +100,8 @@ function filterMissingColumns(pinnedColumns, columns, invert) {
|
|
|
101
100
|
return newPinnedColumns.filter(field => remainingColumns.includes(field));
|
|
102
101
|
};
|
|
103
102
|
const leftPinnedColumns = filter(pinnedColumns.left, columns);
|
|
104
|
-
const columnsWithoutLeftPinnedColumns = columns.filter(
|
|
105
|
-
// Filter out from the remaining columns those columns already pinned to the left
|
|
106
|
-
field => !leftPinnedColumns.includes(field));
|
|
103
|
+
const columnsWithoutLeftPinnedColumns = columns.filter(field => !leftPinnedColumns.includes(field));
|
|
107
104
|
const rightPinnedColumns = filter(pinnedColumns.right, columnsWithoutLeftPinnedColumns);
|
|
108
|
-
if (invert) {
|
|
109
|
-
return {
|
|
110
|
-
left: rightPinnedColumns,
|
|
111
|
-
right: leftPinnedColumns
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
105
|
return {
|
|
115
106
|
left: leftPinnedColumns,
|
|
116
107
|
right: rightPinnedColumns
|
|
@@ -260,9 +260,10 @@ const useGridDataSourceBase = (apiRef, props, options = {}) => {
|
|
|
260
260
|
};
|
|
261
261
|
const debouncedFetchRows = React.useMemo(() => (0, _debounce.default)(fetchRows, 0), [fetchRows]);
|
|
262
262
|
const handleFetchRowsOnParamsChange = React.useCallback(() => {
|
|
263
|
+
apiRef.current.setRows([]);
|
|
263
264
|
stopPolling();
|
|
264
265
|
debouncedFetchRows();
|
|
265
|
-
}, [stopPolling, debouncedFetchRows]);
|
|
266
|
+
}, [stopPolling, debouncedFetchRows, apiRef]);
|
|
266
267
|
const isFirstRender = React.useRef(true);
|
|
267
268
|
React.useEffect(() => {
|
|
268
269
|
if (isFirstRender.current) {
|
|
@@ -410,11 +410,15 @@ const useGridRowEditing = (apiRef, props) => {
|
|
|
410
410
|
updateRowInRowModesModel(id, null);
|
|
411
411
|
delete prevRowValuesLookup.current[id];
|
|
412
412
|
};
|
|
413
|
-
if (ignoreModifications) {
|
|
413
|
+
if (ignoreModifications && apiRef.current.getRow(id)) {
|
|
414
414
|
finishRowEditMode();
|
|
415
415
|
return;
|
|
416
416
|
}
|
|
417
417
|
const editingState = (0, _gridEditingSelectors.gridEditRowsStateSelector)(apiRef);
|
|
418
|
+
if (!editingState[id]) {
|
|
419
|
+
finishRowEditMode();
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
418
422
|
const row = prevRowValuesLookup.current[id];
|
|
419
423
|
const isSomeFieldProcessingProps = Object.values(editingState[id]).some(fieldProps => fieldProps.isProcessingProps);
|
|
420
424
|
if (isSomeFieldProcessingProps) {
|
|
@@ -473,14 +477,18 @@ const useGridRowEditing = (apiRef, props) => {
|
|
|
473
477
|
Promise.resolve(processRowUpdate(rowUpdate, row, {
|
|
474
478
|
rowId: id
|
|
475
479
|
})).then(finalRowUpdate => {
|
|
476
|
-
apiRef.current.
|
|
480
|
+
if (apiRef.current.getRow(id)) {
|
|
481
|
+
apiRef.current.updateRows([finalRowUpdate]);
|
|
482
|
+
}
|
|
477
483
|
finishRowEditMode();
|
|
478
484
|
}).catch(handleError);
|
|
479
485
|
} catch (errorThrown) {
|
|
480
486
|
handleError(errorThrown);
|
|
481
487
|
}
|
|
482
488
|
} else {
|
|
483
|
-
apiRef.current.
|
|
489
|
+
if (apiRef.current.getRow(id)) {
|
|
490
|
+
apiRef.current.updateRows([rowUpdate]);
|
|
491
|
+
}
|
|
484
492
|
finishRowEditMode();
|
|
485
493
|
}
|
|
486
494
|
});
|
|
@@ -648,6 +656,6 @@ const useGridRowEditing = (apiRef, props) => {
|
|
|
648
656
|
}, params));
|
|
649
657
|
}
|
|
650
658
|
});
|
|
651
|
-
}, [apiRef, rowModesModel, updateStateToStartRowEditMode, updateStateToStopRowEditMode]);
|
|
659
|
+
}, [apiRef, rowModesModel, updateOrDeleteRowState, updateStateToStartRowEditMode, updateStateToStopRowEditMode, updateRowInRowModesModel]);
|
|
652
660
|
};
|
|
653
661
|
exports.useGridRowEditing = useGridRowEditing;
|
package/index.js
CHANGED
package/locales/ukUA.js
CHANGED
|
@@ -194,18 +194,19 @@ const ukUAGrid = {
|
|
|
194
194
|
collapseDetailPanel: 'Приховати',
|
|
195
195
|
// Pagination
|
|
196
196
|
paginationRowsPerPage: 'Рядків на сторінці:',
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
197
|
+
paginationDisplayedRows: ({
|
|
198
|
+
from,
|
|
199
|
+
to,
|
|
200
|
+
count,
|
|
201
|
+
estimated
|
|
202
|
+
}) => {
|
|
203
|
+
const unknownRowCount = count == null || count === -1;
|
|
204
|
+
if (!estimated) {
|
|
205
|
+
return `${from}–${to} з ${!unknownRowCount ? count : `більше ніж ${to}`}`;
|
|
206
|
+
}
|
|
207
|
+
const estimatedLabel = estimated && estimated > to ? `близько ${estimated}` : `більше ніж ${to}`;
|
|
208
|
+
return `${from}–${to} з ${!unknownRowCount ? count : estimatedLabel}`;
|
|
209
|
+
},
|
|
209
210
|
paginationItemAriaLabel: type => {
|
|
210
211
|
if (type === 'first') {
|
|
211
212
|
return 'Перейти на першу сторінку';
|