@mui/x-data-grid 7.6.1 → 7.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +147 -0
- package/components/GridRow.js +0 -6
- package/components/columnHeaders/GridColumnGroupHeader.js +1 -1
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +16 -8
- package/components/toolbar/GridToolbarQuickFilter.js +0 -7
- package/hooks/features/dimensions/useGridDimensions.js +11 -12
- package/hooks/features/filter/gridFilterUtils.js +1 -3
- package/hooks/features/filter/useGridFilter.js +16 -8
- package/hooks/features/rows/useGridRowsMeta.js +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +3 -0
- package/index.js +1 -1
- package/locales/beBY.js +8 -8
- package/locales/faIR.js +1 -2
- package/locales/ptBR.js +1 -2
- package/locales/ruRU.js +26 -30
- package/locales/ukUA.js +6 -5
- package/models/api/gridFilterApi.d.ts +7 -0
- package/modern/components/GridRow.js +0 -6
- package/modern/components/columnHeaders/GridColumnGroupHeader.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +16 -8
- package/modern/components/toolbar/GridToolbarQuickFilter.js +0 -7
- package/modern/hooks/features/dimensions/useGridDimensions.js +11 -12
- package/modern/hooks/features/filter/gridFilterUtils.js +1 -3
- package/modern/hooks/features/filter/useGridFilter.js +16 -8
- package/modern/hooks/features/rows/useGridRowsMeta.js +1 -1
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +3 -0
- package/modern/index.js +1 -1
- package/modern/locales/beBY.js +8 -8
- package/modern/locales/faIR.js +1 -2
- package/modern/locales/ptBR.js +1 -2
- package/modern/locales/ruRU.js +26 -30
- package/modern/locales/ukUA.js +6 -5
- package/modern/utils/domUtils.js +3 -0
- package/modern/utils/fastObjectShallowCompare.js +0 -4
- package/node/components/GridRow.js +0 -6
- package/node/components/columnHeaders/GridColumnGroupHeader.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +16 -8
- package/node/components/toolbar/GridToolbarQuickFilter.js +0 -7
- package/node/hooks/features/dimensions/useGridDimensions.js +11 -12
- package/node/hooks/features/filter/gridFilterUtils.js +1 -3
- package/node/hooks/features/filter/useGridFilter.js +16 -8
- package/node/hooks/features/rows/useGridRowsMeta.js +1 -1
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +3 -0
- package/node/index.js +1 -1
- package/node/locales/beBY.js +8 -8
- package/node/locales/faIR.js +1 -2
- package/node/locales/ptBR.js +1 -2
- package/node/locales/ruRU.js +26 -30
- package/node/locales/ukUA.js +6 -5
- package/node/utils/domUtils.js +3 -0
- package/node/utils/fastObjectShallowCompare.js +0 -4
- package/package.json +2 -2
- package/utils/domUtils.js +3 -0
- package/utils/fastObjectShallowCompare.js +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,153 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 7.7.0
|
|
7
|
+
|
|
8
|
+
_Jun 13, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🎁 Allow customization of the Pickers month and the year buttons
|
|
13
|
+
- 🌍 Improve Persian (fa-IR), Portuguese (pt-PT), and Russian (ru-RU) locales on the Data Grid
|
|
14
|
+
- 🌍 Improve Korean (ko-KR) and Persian (fa-IR) locales on the Date and Time Pickers
|
|
15
|
+
- 🐞 Bugfixes
|
|
16
|
+
- 📚 Documentation improvements
|
|
17
|
+
|
|
18
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
19
|
+
|
|
20
|
+
### Data Grid
|
|
21
|
+
|
|
22
|
+
#### `@mui/x-data-grid@7.7.0`
|
|
23
|
+
|
|
24
|
+
- [DataGrid] Add `getFilterState` method (#13418) @cherniavskii
|
|
25
|
+
- [DataGrid] Do not show resize separators for column groups (#13455) @cherniavskii
|
|
26
|
+
- [l10n] Improve Persian (fa-IR) locale (#13402) @fakhamatia
|
|
27
|
+
- [l10n] Improve Portuguese (pt-PT) locale (#13384) @olavocarvalho
|
|
28
|
+
- [l10n] Improve Russian (ru-RU) locale (#11210) @dastan-akhmetov-scity
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-data-grid-pro@7.7.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
31
|
+
|
|
32
|
+
Same changes as in `@mui/x-data-grid@7.7.0`, plus:
|
|
33
|
+
|
|
34
|
+
- [DataGridPro] Do not render detail panel if the focused cell is not visible (#13456) @cherniavskii
|
|
35
|
+
|
|
36
|
+
#### `@mui/x-data-grid-premium@7.7.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
37
|
+
|
|
38
|
+
Same changes as in `@mui/x-data-grid-pro@7.7.0`.
|
|
39
|
+
|
|
40
|
+
### Date and Time Pickers
|
|
41
|
+
|
|
42
|
+
#### `@mui/x-date-pickers@7.7.0`
|
|
43
|
+
|
|
44
|
+
- [l10n] Improve Korean (ko-KR) locale (#13452) @ryxxn
|
|
45
|
+
- [l10n] Improve Persian (fa-IR) locale (#13402) @fakhamatia
|
|
46
|
+
- [pickers] Allow to customize the month and the year buttons (#13321) @flaviendelangle
|
|
47
|
+
|
|
48
|
+
#### `@mui/x-date-pickers-pro@7.7.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
49
|
+
|
|
50
|
+
Same changes as in `@mui/x-date-pickers@7.7.0`.
|
|
51
|
+
|
|
52
|
+
### Charts
|
|
53
|
+
|
|
54
|
+
#### `@mui/x-charts@7.7.0`
|
|
55
|
+
|
|
56
|
+
- [charts] Add watermark on the pro `ResponsiveChartContainer` (#13398) @alexfauquette
|
|
57
|
+
- [charts] Allow to specify y-axis configuration (#13438) @alexfauquette
|
|
58
|
+
- [charts] Fix eslint for react compiler (#13444) @alexfauquette
|
|
59
|
+
- [charts] Improve themeAugmentation typing (#13433) @noraleonte
|
|
60
|
+
- [charts] Move the `ZAxisContextProvider` by default in the `ChartContainer` (#13465) @alexfauquette
|
|
61
|
+
- [charts] Use plugins to define series extremum and colors (#13397) @alexfauquette
|
|
62
|
+
|
|
63
|
+
### Tree View
|
|
64
|
+
|
|
65
|
+
#### `@mui/x-tree-view@7.7.0`
|
|
66
|
+
|
|
67
|
+
- [TreeView] Improve TypeScript for plugins (#13380) @flaviendelangle
|
|
68
|
+
- [TreeView] Improve the typing of the cancelable events (#13152) @flaviendelangle
|
|
69
|
+
- [TreeView] Prepare support for PigmentCSS (#13412) @flaviendelangle
|
|
70
|
+
- [TreeView] Refactor the tree view internals to prepare for headless API (#13311) @flaviendelangle
|
|
71
|
+
|
|
72
|
+
### Docs
|
|
73
|
+
|
|
74
|
+
- [docs] Add `renderHeader` recipe to the Master Details docs (#13370) @michelengelen
|
|
75
|
+
- [docs] Add lazy loading detail panel demo (#13453) @cherniavskii
|
|
76
|
+
- [docs] Add small edits to the Data Grid overview page (#13060) @danilo-leal
|
|
77
|
+
- [docs] Update a11y pages description (#13417) @danilo-leal
|
|
78
|
+
- [docs] improve the writing on the "Quick filter outside of the grid" example (#13155) @michelengelen
|
|
79
|
+
|
|
80
|
+
### Core
|
|
81
|
+
|
|
82
|
+
- [core] Add `eslint-plugin-react-compiler` experimental version and rules (#13415) @JCQuintas
|
|
83
|
+
- [core] Minor setup cleanup (#13467) @LukasTy
|
|
84
|
+
- [infra] Adjust CI setup (#13448) @LukasTy
|
|
85
|
+
- [test] Add tests for the custom slots of `TreeItem2` (#13314) @flaviendelangle
|
|
86
|
+
|
|
87
|
+
## 7.6.2
|
|
88
|
+
|
|
89
|
+
_Jun 6, 2024_
|
|
90
|
+
|
|
91
|
+
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
92
|
+
|
|
93
|
+
- 📚 Adds Date and Time Pickers accessibility page
|
|
94
|
+
- 🐞 Bugfixes
|
|
95
|
+
- 📚 Documentation improvements
|
|
96
|
+
|
|
97
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
98
|
+
|
|
99
|
+
### Data Grid
|
|
100
|
+
|
|
101
|
+
#### `@mui/x-data-grid@7.6.2`
|
|
102
|
+
|
|
103
|
+
- [DataGrid] Add the `areElementSizesEqual` utility to improve code readability (#13254) @layerok
|
|
104
|
+
- [DataGrid] Clean up IE remnants from the codebase (#13390) @MBilalShafi
|
|
105
|
+
|
|
106
|
+
#### `@mui/x-data-grid-pro@7.6.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
107
|
+
|
|
108
|
+
Same changes as in `@mui/x-data-grid@7.6.2`.
|
|
109
|
+
|
|
110
|
+
#### `@mui/x-data-grid-premium@7.6.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
111
|
+
|
|
112
|
+
Same changes as in `@mui/x-data-grid-pro@7.6.2`.
|
|
113
|
+
|
|
114
|
+
### Date and Time Pickers
|
|
115
|
+
|
|
116
|
+
#### `@mui/x-date-pickers@7.6.2`
|
|
117
|
+
|
|
118
|
+
- [fields] Fix `PageUp` and `PageDown` editing on letter sections (#13310) @arthurbalduini
|
|
119
|
+
- [pickers] Fix `AdapterDayjs` timezone behavior (#13362) @LukasTy
|
|
120
|
+
- [pickers] Use `useRtl` instead of `useTheme` to access direction (#13363) @flaviendelangle
|
|
121
|
+
|
|
122
|
+
#### `@mui/x-date-pickers-pro@7.6.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
123
|
+
|
|
124
|
+
Same changes as in `@mui/x-date-pickers@7.6.2`.
|
|
125
|
+
|
|
126
|
+
### Charts
|
|
127
|
+
|
|
128
|
+
#### `@mui/x-charts@7.6.2`
|
|
129
|
+
|
|
130
|
+
- [charts] Add `Initializable` type and behaviour to allow checking if a complex context has been initialized. (#13365) @JCQuintas
|
|
131
|
+
- [charts] Fix some props not working in `xAxis` and `yAxis` (#13372) @Valyok26
|
|
132
|
+
- [charts] Harmonize charts types (#13366) @alexfauquette
|
|
133
|
+
- [charts] Introduce plugins system (#13367) @alexfauquette
|
|
134
|
+
- [charts] Simplify plugin types (#13396) @JCQuintas
|
|
135
|
+
|
|
136
|
+
### Docs
|
|
137
|
+
|
|
138
|
+
- [docs] Add badges like in Material UI @oliviertassinari
|
|
139
|
+
- [docs] Update twitter.com to x.com @oliviertassinari
|
|
140
|
+
- [docs] Fix the description of `tickInterval` (#13355) @alexfauquette
|
|
141
|
+
- [docs] Adjust the code example for `quickFilterValues` (#12919) @michelengelen
|
|
142
|
+
- [docs] Create Pickers accessibility page (#13274) @arthurbalduini
|
|
143
|
+
|
|
144
|
+
### Core
|
|
145
|
+
|
|
146
|
+
- [core] Comment on `CSS.escape` for the future @oliviertassinari
|
|
147
|
+
- [core] Fix `l10n` action setup (#13382) @LukasTy
|
|
148
|
+
- [core] Fixes in preparation for React 18.3 (#13378) @LukasTy
|
|
149
|
+
- [core] Remove explicit `marked` dependency (#13383) @LukasTy
|
|
150
|
+
- [core] Remove unused `@types/prettier` dependency (#13389) @LukasTy
|
|
151
|
+
- [core] Add `docs/.env.local` to `.gitignore` (#13377) @KenanYusuf
|
|
152
|
+
|
|
6
153
|
## 7.6.1
|
|
7
154
|
|
|
8
155
|
_May 31, 2024_
|
package/components/GridRow.js
CHANGED
|
@@ -108,12 +108,6 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
108
108
|
rowHeight
|
|
109
109
|
};
|
|
110
110
|
const classes = useUtilityClasses(ownerState);
|
|
111
|
-
React.useLayoutEffect(() => {
|
|
112
|
-
if (rowHeight === 'auto' && ref.current && typeof ResizeObserver === 'undefined') {
|
|
113
|
-
// Fallback for IE
|
|
114
|
-
apiRef.current.unstable_storeRowHeightMeasurement(rowId, ref.current.clientHeight);
|
|
115
|
-
}
|
|
116
|
-
}, [apiRef, rowHeight, rowId]);
|
|
117
111
|
React.useLayoutEffect(() => {
|
|
118
112
|
if (currentPage.range) {
|
|
119
113
|
// The index prop is relative to the rows from all pages. As example, the index prop of the
|
|
@@ -127,7 +127,7 @@ function GridColumnGroupHeader(props) {
|
|
|
127
127
|
width: width,
|
|
128
128
|
columnMenuIconButton: null,
|
|
129
129
|
columnTitleIconButtons: null,
|
|
130
|
-
resizable:
|
|
130
|
+
resizable: false,
|
|
131
131
|
label: label,
|
|
132
132
|
"aria-colspan": fields.length
|
|
133
133
|
// The fields are wrapped between |-...-| to avoid confusion between fields "id" and "id2" when using selector data-fields~=
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "color", "error", "helperText", "size", "variant"]
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "color", "error", "helperText", "size", "variant"],
|
|
4
|
+
_excluded2 = ["key"];
|
|
4
5
|
import * as React from 'react';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
7
|
import Autocomplete, { createFilterOptions } from '@mui/material/Autocomplete';
|
|
@@ -73,13 +74,20 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
73
74
|
value: filteredValues,
|
|
74
75
|
onChange: handleChange,
|
|
75
76
|
getOptionLabel: getOptionLabel,
|
|
76
|
-
renderTags: (value, getTagProps) => value.map((option, index) =>
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
renderTags: (value, getTagProps) => value.map((option, index) => {
|
|
78
|
+
const _getTagProps = getTagProps({
|
|
79
|
+
index
|
|
80
|
+
}),
|
|
81
|
+
{
|
|
82
|
+
key
|
|
83
|
+
} = _getTagProps,
|
|
84
|
+
tagProps = _objectWithoutPropertiesLoose(_getTagProps, _excluded2);
|
|
85
|
+
return /*#__PURE__*/_jsx(rootProps.slots.baseChip, _extends({
|
|
86
|
+
variant: "outlined",
|
|
87
|
+
size: "small",
|
|
88
|
+
label: getOptionLabel(option)
|
|
89
|
+
}, tagProps), key);
|
|
90
|
+
}),
|
|
83
91
|
renderInput: params => /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({}, params, {
|
|
84
92
|
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
85
93
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
@@ -39,13 +39,6 @@ const GridToolbarQuickFilterRoot = styled(TextField, {
|
|
|
39
39
|
'& .MuiInput-underline:before': {
|
|
40
40
|
borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`
|
|
41
41
|
},
|
|
42
|
-
[`& input[type=search]::-ms-clear,
|
|
43
|
-
& input[type=search]::-ms-reveal`]: {
|
|
44
|
-
/* clears the 'X' icon from IE */
|
|
45
|
-
display: 'none',
|
|
46
|
-
width: 0,
|
|
47
|
-
height: 0
|
|
48
|
-
},
|
|
49
42
|
[`& input[type="search"]::-webkit-search-decoration,
|
|
50
43
|
& input[type="search"]::-webkit-search-cancel-button,
|
|
51
44
|
& input[type="search"]::-webkit-search-results-button,
|
|
@@ -74,17 +74,13 @@ export function useGridDimensions(apiRef, props) {
|
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
76
|
const computedStyle = ownerWindow(element).getComputedStyle(element);
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (!previousSize.current ||
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
height
|
|
85
|
-
};
|
|
86
|
-
apiRef.current.publishEvent('resize', size);
|
|
87
|
-
previousSize.current = size;
|
|
77
|
+
const newSize = {
|
|
78
|
+
width: parseFloat(computedStyle.width) || 0,
|
|
79
|
+
height: parseFloat(computedStyle.height) || 0
|
|
80
|
+
};
|
|
81
|
+
if (!previousSize.current || !areElementSizesEqual(previousSize.current, newSize)) {
|
|
82
|
+
apiRef.current.publishEvent('resize', newSize);
|
|
83
|
+
previousSize.current = newSize;
|
|
88
84
|
}
|
|
89
85
|
}, [apiRef]);
|
|
90
86
|
const getViewportPageSize = React.useCallback(() => {
|
|
@@ -190,7 +186,7 @@ export function useGridDimensions(apiRef, props) {
|
|
|
190
186
|
};
|
|
191
187
|
const prevDimensions = apiRef.current.state.dimensions;
|
|
192
188
|
setDimensions(newDimensions);
|
|
193
|
-
if (newDimensions.viewportInnerSize
|
|
189
|
+
if (!areElementSizesEqual(newDimensions.viewportInnerSize, prevDimensions.viewportInnerSize)) {
|
|
194
190
|
apiRef.current.publishEvent('viewportInnerSizeChange', newDimensions.viewportInnerSize);
|
|
195
191
|
}
|
|
196
192
|
apiRef.current.updateRenderContext?.();
|
|
@@ -285,4 +281,7 @@ function measureScrollbarSize(rootElement, columnsTotalWidth, scrollbarSize) {
|
|
|
285
281
|
// https://github.com/mui/mui-x/issues/9550#issuecomment-1619020477
|
|
286
282
|
function roundToDecimalPlaces(value, decimals) {
|
|
287
283
|
return Math.round(value * 10 ** decimals) / 10 ** decimals;
|
|
284
|
+
}
|
|
285
|
+
function areElementSizesEqual(a, b) {
|
|
286
|
+
return a.width === b.width && a.height === b.height;
|
|
288
287
|
}
|
|
@@ -210,7 +210,7 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
|
|
|
210
210
|
return function isRowMatchingQuickFilter(row, shouldApplyFilter) {
|
|
211
211
|
const result = {};
|
|
212
212
|
|
|
213
|
-
/* eslint-disable no-
|
|
213
|
+
/* eslint-disable no-labels */
|
|
214
214
|
outer: for (let v = 0; v < quickFilterValues.length; v += 1) {
|
|
215
215
|
const filterValue = quickFilterValues[v];
|
|
216
216
|
for (let i = 0; i < appliersPerField.length; i += 1) {
|
|
@@ -240,8 +240,6 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
|
|
|
240
240
|
}
|
|
241
241
|
result[filterValue] = false;
|
|
242
242
|
}
|
|
243
|
-
/* eslint-enable no-restricted-syntax, no-labels */
|
|
244
|
-
|
|
245
243
|
return result;
|
|
246
244
|
};
|
|
247
245
|
};
|
|
@@ -59,13 +59,9 @@ export const useGridFilter = (apiRef, props) => {
|
|
|
59
59
|
const updateFilteredRows = React.useCallback(() => {
|
|
60
60
|
apiRef.current.setState(state => {
|
|
61
61
|
const filterModel = gridFilterModelSelector(state, apiRef.current.instanceId);
|
|
62
|
-
const
|
|
63
|
-
const filteringResult = apiRef.current.applyStrategyProcessor('filtering', {
|
|
64
|
-
isRowMatchingFilters,
|
|
65
|
-
filterModel: filterModel ?? getDefaultGridFilterModel()
|
|
66
|
-
});
|
|
62
|
+
const filterState = apiRef.current.getFilterState(filterModel);
|
|
67
63
|
const newState = _extends({}, state, {
|
|
68
|
-
filter: _extends({}, state.filter,
|
|
64
|
+
filter: _extends({}, state.filter, filterState)
|
|
69
65
|
});
|
|
70
66
|
const visibleRowsLookupState = getVisibleRowsLookupState(apiRef, newState);
|
|
71
67
|
return _extends({}, newState, {
|
|
@@ -73,7 +69,7 @@ export const useGridFilter = (apiRef, props) => {
|
|
|
73
69
|
});
|
|
74
70
|
});
|
|
75
71
|
apiRef.current.publishEvent('filteredRowsSet');
|
|
76
|
-
}, [apiRef
|
|
72
|
+
}, [apiRef]);
|
|
77
73
|
const addColumnMenuItem = React.useCallback((columnMenuItems, colDef) => {
|
|
78
74
|
if (colDef == null || colDef.filterable === false || props.disableColumnFilter) {
|
|
79
75
|
return columnMenuItems;
|
|
@@ -203,6 +199,17 @@ export const useGridFilter = (apiRef, props) => {
|
|
|
203
199
|
apiRef.current.unstable_applyFilters();
|
|
204
200
|
}
|
|
205
201
|
}, [apiRef, logger, props.disableMultipleColumnsFiltering]);
|
|
202
|
+
const getFilterState = React.useCallback(inputFilterModel => {
|
|
203
|
+
const filterModel = sanitizeFilterModel(inputFilterModel, props.disableMultipleColumnsFiltering, apiRef);
|
|
204
|
+
const isRowMatchingFilters = props.filterMode === 'client' ? buildAggregatedFilterApplier(filterModel, apiRef, props.disableEval) : null;
|
|
205
|
+
const filterResult = apiRef.current.applyStrategyProcessor('filtering', {
|
|
206
|
+
isRowMatchingFilters,
|
|
207
|
+
filterModel: filterModel ?? getDefaultGridFilterModel()
|
|
208
|
+
});
|
|
209
|
+
return _extends({}, filterResult, {
|
|
210
|
+
filterModel
|
|
211
|
+
});
|
|
212
|
+
}, [props.disableMultipleColumnsFiltering, props.filterMode, props.disableEval, apiRef]);
|
|
206
213
|
const filterApi = {
|
|
207
214
|
setFilterLogicOperator,
|
|
208
215
|
unstable_applyFilters: applyFilters,
|
|
@@ -213,7 +220,8 @@ export const useGridFilter = (apiRef, props) => {
|
|
|
213
220
|
showFilterPanel,
|
|
214
221
|
hideFilterPanel,
|
|
215
222
|
setQuickFilterValues,
|
|
216
|
-
ignoreDiacritics: props.ignoreDiacritics
|
|
223
|
+
ignoreDiacritics: props.ignoreDiacritics,
|
|
224
|
+
getFilterState
|
|
217
225
|
};
|
|
218
226
|
useGridApiMethod(apiRef, filterApi, 'public');
|
|
219
227
|
|
|
@@ -128,7 +128,7 @@ export const useGridRowsMeta = (apiRef, props) => {
|
|
|
128
128
|
positions.push(acc);
|
|
129
129
|
let otherSizes = 0;
|
|
130
130
|
const processedSizes = calculateRowProcessedSizes(row);
|
|
131
|
-
/* eslint-disable-next-line
|
|
131
|
+
/* eslint-disable-next-line guard-for-in */
|
|
132
132
|
for (const key in processedSizes) {
|
|
133
133
|
const value = processedSizes[key];
|
|
134
134
|
if (key !== 'baseCenter') {
|
package/index.js
CHANGED
package/locales/beBY.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { beBYCore } from './coreLocales';
|
|
2
2
|
import { getGridLocalization } from '../utils/getGridLocalization';
|
|
3
3
|
const getPluralForm = (count, options) => {
|
|
4
|
-
let pluralForm = options.
|
|
4
|
+
let pluralForm = options.many;
|
|
5
5
|
const lastDigit = count % 10;
|
|
6
6
|
if (lastDigit > 1 && lastDigit < 5 && (count < 10 || count > 20)) {
|
|
7
|
-
pluralForm = options.
|
|
7
|
+
pluralForm = options.few;
|
|
8
8
|
} else if (lastDigit === 1 && count % 100 !== 11) {
|
|
9
9
|
pluralForm = options.one;
|
|
10
10
|
}
|
|
@@ -30,8 +30,8 @@ const beBYGrid = {
|
|
|
30
30
|
toolbarFiltersTooltipShow: 'Паказаць фільтры',
|
|
31
31
|
toolbarFiltersTooltipActive: count => getPluralForm(count, {
|
|
32
32
|
one: 'актыўны фільтр',
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
few: 'актыўных фільтра',
|
|
34
|
+
many: 'актыўных фільтраў'
|
|
35
35
|
}),
|
|
36
36
|
// Quick filter toolbar field
|
|
37
37
|
toolbarQuickFilterPlaceholder: 'Пошук…',
|
|
@@ -118,16 +118,16 @@ const beBYGrid = {
|
|
|
118
118
|
// Column header text
|
|
119
119
|
columnHeaderFiltersTooltipActive: count => getPluralForm(count, {
|
|
120
120
|
one: 'актыўны фільтр',
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
few: 'актыўных фільтра',
|
|
122
|
+
many: 'актыўных фільтраў'
|
|
123
123
|
}),
|
|
124
124
|
columnHeaderFiltersLabel: 'Паказаць фільтры',
|
|
125
125
|
columnHeaderSortIconLabel: 'Сартыраваць',
|
|
126
126
|
// Rows selected footer text
|
|
127
127
|
footerRowSelected: count => getPluralForm(count, {
|
|
128
128
|
one: 'абраны радок',
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
few: 'абраных радка',
|
|
130
|
+
many: 'абраных радкоў'
|
|
131
131
|
}),
|
|
132
132
|
// Total row amount footer text
|
|
133
133
|
footerTotalRows: 'Усяго радкоў:',
|
package/locales/faIR.js
CHANGED
|
@@ -33,8 +33,7 @@ const faIRGrid = {
|
|
|
33
33
|
columnsManagementSearchTitle: 'جستجو',
|
|
34
34
|
columnsManagementNoColumns: 'بدون سطر',
|
|
35
35
|
columnsManagementShowHideAllText: 'نمایش/مخفی کردن همه',
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
columnsManagementReset: 'بازنشانی',
|
|
38
37
|
// Filter panel text
|
|
39
38
|
filterPanelAddFilter: 'افزودن فیلتر',
|
|
40
39
|
filterPanelRemoveAll: 'حذف همه',
|
package/locales/ptBR.js
CHANGED
|
@@ -33,8 +33,7 @@ const ptBRGrid = {
|
|
|
33
33
|
columnsManagementSearchTitle: 'Buscar',
|
|
34
34
|
columnsManagementNoColumns: 'Nenhuma coluna',
|
|
35
35
|
columnsManagementShowHideAllText: 'Mostrar/Ocultar Todas',
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
columnsManagementReset: 'Redefinir',
|
|
38
37
|
// Filter panel text
|
|
39
38
|
filterPanelAddFilter: 'Adicionar filtro',
|
|
40
39
|
filterPanelRemoveAll: 'Remover todos',
|
package/locales/ruRU.js
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { ruRU as ruRUCore } from '@mui/material/locale';
|
|
2
2
|
import { getGridLocalization } from '../utils/getGridLocalization';
|
|
3
|
+
function getPluralForm(count, options) {
|
|
4
|
+
const penultimateDigit = Math.floor(count / 10) % 10;
|
|
5
|
+
const lastDigit = count % 10;
|
|
6
|
+
let pluralForm = options.many;
|
|
7
|
+
if (penultimateDigit !== 1 && lastDigit > 1 && lastDigit < 5) {
|
|
8
|
+
pluralForm = options.few;
|
|
9
|
+
} else if (penultimateDigit !== 1 && lastDigit === 1) {
|
|
10
|
+
pluralForm = options.one;
|
|
11
|
+
}
|
|
12
|
+
return `${count} ${pluralForm}`;
|
|
13
|
+
}
|
|
3
14
|
const ruRUGrid = {
|
|
4
15
|
// Root
|
|
5
16
|
noRowsLabel: 'Нет строк',
|
|
@@ -18,16 +29,11 @@ const ruRUGrid = {
|
|
|
18
29
|
toolbarFiltersLabel: 'Показать фильтры',
|
|
19
30
|
toolbarFiltersTooltipHide: 'Скрыть фильтры',
|
|
20
31
|
toolbarFiltersTooltipShow: 'Показать фильтры',
|
|
21
|
-
toolbarFiltersTooltipActive: count => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} else if (lastDigit === 1) {
|
|
27
|
-
pluralForm = 'активный фильтр';
|
|
28
|
-
}
|
|
29
|
-
return `${count} ${pluralForm}`;
|
|
30
|
-
},
|
|
32
|
+
toolbarFiltersTooltipActive: count => getPluralForm(count, {
|
|
33
|
+
one: 'активный фильтр',
|
|
34
|
+
few: 'активных фильтра',
|
|
35
|
+
many: 'активных фильтров'
|
|
36
|
+
}),
|
|
31
37
|
// Quick filter toolbar field
|
|
32
38
|
toolbarQuickFilterPlaceholder: 'Поиск…',
|
|
33
39
|
toolbarQuickFilterLabel: 'Поиск',
|
|
@@ -109,29 +115,19 @@ const ruRUGrid = {
|
|
|
109
115
|
columnMenuSortAsc: 'Сортировать по возрастанию',
|
|
110
116
|
columnMenuSortDesc: 'Сортировать по убыванию',
|
|
111
117
|
// Column header text
|
|
112
|
-
columnHeaderFiltersTooltipActive: count => {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
} else if (lastDigit === 1) {
|
|
118
|
-
pluralForm = 'активный фильтр';
|
|
119
|
-
}
|
|
120
|
-
return `${count} ${pluralForm}`;
|
|
121
|
-
},
|
|
118
|
+
columnHeaderFiltersTooltipActive: count => getPluralForm(count, {
|
|
119
|
+
one: 'активный фильтр',
|
|
120
|
+
few: 'активных фильтра',
|
|
121
|
+
many: 'активных фильтров'
|
|
122
|
+
}),
|
|
122
123
|
columnHeaderFiltersLabel: 'Показать фильтры',
|
|
123
124
|
columnHeaderSortIconLabel: 'Сортировать',
|
|
124
125
|
// Rows selected footer text
|
|
125
|
-
footerRowSelected: count => {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
} else if (lastDigit === 1) {
|
|
131
|
-
pluralForm = 'строка выбрана';
|
|
132
|
-
}
|
|
133
|
-
return `${count} ${pluralForm}`;
|
|
134
|
-
},
|
|
126
|
+
footerRowSelected: count => getPluralForm(count, {
|
|
127
|
+
one: 'строка выбрана',
|
|
128
|
+
few: 'строки выбраны',
|
|
129
|
+
many: 'строк выбрано'
|
|
130
|
+
}),
|
|
135
131
|
// Total row amount footer text
|
|
136
132
|
footerTotalRows: 'Всего строк:',
|
|
137
133
|
// Total visible row amount footer text
|
package/locales/ukUA.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { ukUA as ukUACore } from '@mui/material/locale';
|
|
2
2
|
import { getGridLocalization } from '../utils/getGridLocalization';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
function getPluralForm(count, options) {
|
|
4
|
+
const penultimateDigit = Math.floor(count / 10) % 10;
|
|
5
5
|
const lastDigit = count % 10;
|
|
6
|
-
|
|
6
|
+
let pluralForm = options.many;
|
|
7
|
+
if (penultimateDigit !== 1 && lastDigit > 1 && lastDigit < 5) {
|
|
7
8
|
pluralForm = options.few;
|
|
8
|
-
} else if (lastDigit === 1) {
|
|
9
|
+
} else if (penultimateDigit !== 1 && lastDigit === 1) {
|
|
9
10
|
pluralForm = options.one;
|
|
10
11
|
}
|
|
11
12
|
return `${count} ${pluralForm}`;
|
|
12
|
-
}
|
|
13
|
+
}
|
|
13
14
|
const ukUAGrid = {
|
|
14
15
|
// Root
|
|
15
16
|
noRowsLabel: 'Немає рядків',
|
|
@@ -2,6 +2,7 @@ import { GridFilterModel } from '../gridFilterModel';
|
|
|
2
2
|
import { GridFilterItem, GridLogicOperator } from '../gridFilterItem';
|
|
3
3
|
import { GridControlledStateReasonLookup } from '../events';
|
|
4
4
|
import type { DataGridProcessedProps } from '../props/DataGridProps';
|
|
5
|
+
import { GridStateCommunity } from '../gridStateCommunity';
|
|
5
6
|
/**
|
|
6
7
|
* The filter API interface that is available in the grid [[apiRef]].
|
|
7
8
|
*/
|
|
@@ -57,4 +58,10 @@ export interface GridFilterApi {
|
|
|
57
58
|
* Returns the value of the `ignoreDiacritics` prop.
|
|
58
59
|
*/
|
|
59
60
|
ignoreDiacritics: DataGridProcessedProps['ignoreDiacritics'];
|
|
61
|
+
/**
|
|
62
|
+
* Returns the filter state for the given filter model without applying it to the data grid.
|
|
63
|
+
* @param {GridFilterModel} filterModel The filter model to get the state for.
|
|
64
|
+
* @returns {GridStateCommunity['filter']} The filter state.
|
|
65
|
+
*/
|
|
66
|
+
getFilterState: (filterModel: GridFilterModel) => GridStateCommunity['filter'];
|
|
60
67
|
}
|
|
@@ -108,12 +108,6 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
108
108
|
rowHeight
|
|
109
109
|
};
|
|
110
110
|
const classes = useUtilityClasses(ownerState);
|
|
111
|
-
React.useLayoutEffect(() => {
|
|
112
|
-
if (rowHeight === 'auto' && ref.current && typeof ResizeObserver === 'undefined') {
|
|
113
|
-
// Fallback for IE
|
|
114
|
-
apiRef.current.unstable_storeRowHeightMeasurement(rowId, ref.current.clientHeight);
|
|
115
|
-
}
|
|
116
|
-
}, [apiRef, rowHeight, rowId]);
|
|
117
111
|
React.useLayoutEffect(() => {
|
|
118
112
|
if (currentPage.range) {
|
|
119
113
|
// The index prop is relative to the rows from all pages. As example, the index prop of the
|
|
@@ -127,7 +127,7 @@ function GridColumnGroupHeader(props) {
|
|
|
127
127
|
width: width,
|
|
128
128
|
columnMenuIconButton: null,
|
|
129
129
|
columnTitleIconButtons: null,
|
|
130
|
-
resizable:
|
|
130
|
+
resizable: false,
|
|
131
131
|
label: label,
|
|
132
132
|
"aria-colspan": fields.length
|
|
133
133
|
// The fields are wrapped between |-...-| to avoid confusion between fields "id" and "id2" when using selector data-fields~=
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "color", "error", "helperText", "size", "variant"]
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "color", "error", "helperText", "size", "variant"],
|
|
4
|
+
_excluded2 = ["key"];
|
|
4
5
|
import * as React from 'react';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
7
|
import Autocomplete, { createFilterOptions } from '@mui/material/Autocomplete';
|
|
@@ -73,13 +74,20 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
73
74
|
value: filteredValues,
|
|
74
75
|
onChange: handleChange,
|
|
75
76
|
getOptionLabel: getOptionLabel,
|
|
76
|
-
renderTags: (value, getTagProps) => value.map((option, index) =>
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
renderTags: (value, getTagProps) => value.map((option, index) => {
|
|
78
|
+
const _getTagProps = getTagProps({
|
|
79
|
+
index
|
|
80
|
+
}),
|
|
81
|
+
{
|
|
82
|
+
key
|
|
83
|
+
} = _getTagProps,
|
|
84
|
+
tagProps = _objectWithoutPropertiesLoose(_getTagProps, _excluded2);
|
|
85
|
+
return /*#__PURE__*/_jsx(rootProps.slots.baseChip, _extends({
|
|
86
|
+
variant: "outlined",
|
|
87
|
+
size: "small",
|
|
88
|
+
label: getOptionLabel(option)
|
|
89
|
+
}, tagProps), key);
|
|
90
|
+
}),
|
|
83
91
|
renderInput: params => /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({}, params, {
|
|
84
92
|
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
85
93
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
@@ -39,13 +39,6 @@ const GridToolbarQuickFilterRoot = styled(TextField, {
|
|
|
39
39
|
'& .MuiInput-underline:before': {
|
|
40
40
|
borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`
|
|
41
41
|
},
|
|
42
|
-
[`& input[type=search]::-ms-clear,
|
|
43
|
-
& input[type=search]::-ms-reveal`]: {
|
|
44
|
-
/* clears the 'X' icon from IE */
|
|
45
|
-
display: 'none',
|
|
46
|
-
width: 0,
|
|
47
|
-
height: 0
|
|
48
|
-
},
|
|
49
42
|
[`& input[type="search"]::-webkit-search-decoration,
|
|
50
43
|
& input[type="search"]::-webkit-search-cancel-button,
|
|
51
44
|
& input[type="search"]::-webkit-search-results-button,
|