@mui/x-data-grid 7.6.1 → 7.6.2
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 +66 -0
- package/components/GridRow.js +0 -6
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +16 -8
- package/components/toolbar/GridToolbarQuickFilter.js +0 -7
- package/hooks/features/dimensions/useGridDimensions.js +11 -12
- package/index.js +1 -1
- package/modern/components/GridRow.js +0 -6
- 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/index.js +1 -1
- package/modern/utils/domUtils.js +3 -0
- package/node/components/GridRow.js +0 -6
- 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/index.js +1 -1
- package/node/utils/domUtils.js +3 -0
- package/package.json +1 -1
- package/utils/domUtils.js +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,72 @@
|
|
|
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.6.2
|
|
7
|
+
|
|
8
|
+
_Jun 6, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 📚 Adds Date and Time Pickers accessibility page
|
|
13
|
+
- 🐞 Bugfixes
|
|
14
|
+
- 📚 Documentation improvements
|
|
15
|
+
|
|
16
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
17
|
+
|
|
18
|
+
### Data Grid
|
|
19
|
+
|
|
20
|
+
#### `@mui/x-data-grid@7.6.2`
|
|
21
|
+
|
|
22
|
+
- [DataGrid] Add the `areElementSizesEqual` utility to improve code readability (#13254) @layerok
|
|
23
|
+
- [DataGrid] Clean up IE remnants from the codebase (#13390) @MBilalShafi
|
|
24
|
+
|
|
25
|
+
#### `@mui/x-data-grid-pro@7.6.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
26
|
+
|
|
27
|
+
Same changes as in `@mui/x-data-grid@7.6.2`.
|
|
28
|
+
|
|
29
|
+
#### `@mui/x-data-grid-premium@7.6.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
30
|
+
|
|
31
|
+
Same changes as in `@mui/x-data-grid-pro@7.6.2`.
|
|
32
|
+
|
|
33
|
+
### Date and Time Pickers
|
|
34
|
+
|
|
35
|
+
#### `@mui/x-date-pickers@7.6.2`
|
|
36
|
+
|
|
37
|
+
- [fields] Fix `PageUp` and `PageDown` editing on letter sections (#13310) @arthurbalduini
|
|
38
|
+
- [pickers] Fix `AdapterDayjs` timezone behavior (#13362) @LukasTy
|
|
39
|
+
- [pickers] Use `useRtl` instead of `useTheme` to access direction (#13363) @flaviendelangle
|
|
40
|
+
|
|
41
|
+
#### `@mui/x-date-pickers-pro@7.6.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
42
|
+
|
|
43
|
+
Same changes as in `@mui/x-date-pickers@7.6.2`.
|
|
44
|
+
|
|
45
|
+
### Charts
|
|
46
|
+
|
|
47
|
+
#### `@mui/x-charts@7.6.2`
|
|
48
|
+
|
|
49
|
+
- [charts] Add `Initializable` type and behaviour to allow checking if a complex context has been initialized. (#13365) @JCQuintas
|
|
50
|
+
- [charts] Fix some props not working in `xAxis` and `yAxis` (#13372) @Valyok26
|
|
51
|
+
- [charts] Harmonize charts types (#13366) @alexfauquette
|
|
52
|
+
- [charts] Introduce plugins system (#13367) @alexfauquette
|
|
53
|
+
- [charts] Simplify plugin types (#13396) @JCQuintas
|
|
54
|
+
|
|
55
|
+
### Docs
|
|
56
|
+
|
|
57
|
+
- [docs] Add badges like in Material UI @oliviertassinari
|
|
58
|
+
- [docs] Update twitter.com to x.com @oliviertassinari
|
|
59
|
+
- [docs] Fix the description of `tickInterval` (#13355) @alexfauquette
|
|
60
|
+
- [docs] Adjust the code example for `quickFilterValues` (#12919) @michelengelen
|
|
61
|
+
- [docs] Create Pickers accessibility page (#13274) @arthurbalduini
|
|
62
|
+
|
|
63
|
+
### Core
|
|
64
|
+
|
|
65
|
+
- [core] Comment on `CSS.escape` for the future @oliviertassinari
|
|
66
|
+
- [core] Fix `l10n` action setup (#13382) @LukasTy
|
|
67
|
+
- [core] Fixes in preparation for React 18.3 (#13378) @LukasTy
|
|
68
|
+
- [core] Remove explicit `marked` dependency (#13383) @LukasTy
|
|
69
|
+
- [core] Remove unused `@types/prettier` dependency (#13389) @LukasTy
|
|
70
|
+
- [core] Add `docs/.env.local` to `.gitignore` (#13377) @KenanYusuf
|
|
71
|
+
|
|
6
72
|
## 7.6.1
|
|
7
73
|
|
|
8
74
|
_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
|
|
@@ -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
|
}
|
package/index.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
|
|
@@ -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
|
}
|
package/modern/index.js
CHANGED
package/modern/utils/domUtils.js
CHANGED
|
@@ -5,6 +5,9 @@ export function isOverflown(element) {
|
|
|
5
5
|
export function findParentElementFromClassName(elem, className) {
|
|
6
6
|
return elem.closest(`.${className}`);
|
|
7
7
|
}
|
|
8
|
+
|
|
9
|
+
// TODO, eventually replaces this function with CSS.escape, once available in jsdom, either added manually or built in
|
|
10
|
+
// https://github.com/jsdom/jsdom/issues/1550#issuecomment-236734471
|
|
8
11
|
export function escapeOperandAttributeSelector(operand) {
|
|
9
12
|
return operand.replace(/["\\]/g, '\\$&');
|
|
10
13
|
}
|
|
@@ -117,12 +117,6 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
117
117
|
rowHeight
|
|
118
118
|
};
|
|
119
119
|
const classes = useUtilityClasses(ownerState);
|
|
120
|
-
React.useLayoutEffect(() => {
|
|
121
|
-
if (rowHeight === 'auto' && ref.current && typeof ResizeObserver === 'undefined') {
|
|
122
|
-
// Fallback for IE
|
|
123
|
-
apiRef.current.unstable_storeRowHeightMeasurement(rowId, ref.current.clientHeight);
|
|
124
|
-
}
|
|
125
|
-
}, [apiRef, rowHeight, rowId]);
|
|
126
120
|
React.useLayoutEffect(() => {
|
|
127
121
|
if (currentPage.range) {
|
|
128
122
|
// The index prop is relative to the rows from all pages. As example, the index prop of the
|
|
@@ -14,7 +14,8 @@ var _utils = require("@mui/utils");
|
|
|
14
14
|
var _filterPanelUtils = require("./filterPanelUtils");
|
|
15
15
|
var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "color", "error", "helperText", "size", "variant"]
|
|
17
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "color", "error", "helperText", "size", "variant"],
|
|
18
|
+
_excluded2 = ["key"];
|
|
18
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
19
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
21
|
const filter = (0, _Autocomplete.createFilterOptions)();
|
|
@@ -82,13 +83,20 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
82
83
|
value: filteredValues,
|
|
83
84
|
onChange: handleChange,
|
|
84
85
|
getOptionLabel: getOptionLabel,
|
|
85
|
-
renderTags: (value, getTagProps) => value.map((option, index) =>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
86
|
+
renderTags: (value, getTagProps) => value.map((option, index) => {
|
|
87
|
+
const _getTagProps = getTagProps({
|
|
88
|
+
index
|
|
89
|
+
}),
|
|
90
|
+
{
|
|
91
|
+
key
|
|
92
|
+
} = _getTagProps,
|
|
93
|
+
tagProps = (0, _objectWithoutPropertiesLoose2.default)(_getTagProps, _excluded2);
|
|
94
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseChip, (0, _extends2.default)({
|
|
95
|
+
variant: "outlined",
|
|
96
|
+
size: "small",
|
|
97
|
+
label: getOptionLabel(option)
|
|
98
|
+
}, tagProps), key);
|
|
99
|
+
}),
|
|
92
100
|
renderInput: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTextField, (0, _extends2.default)({}, params, {
|
|
93
101
|
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
94
102
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
@@ -48,13 +48,6 @@ const GridToolbarQuickFilterRoot = (0, _styles.styled)(_TextField.default, {
|
|
|
48
48
|
'& .MuiInput-underline:before': {
|
|
49
49
|
borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`
|
|
50
50
|
},
|
|
51
|
-
[`& input[type=search]::-ms-clear,
|
|
52
|
-
& input[type=search]::-ms-reveal`]: {
|
|
53
|
-
/* clears the 'X' icon from IE */
|
|
54
|
-
display: 'none',
|
|
55
|
-
width: 0,
|
|
56
|
-
height: 0
|
|
57
|
-
},
|
|
58
51
|
[`& input[type="search"]::-webkit-search-decoration,
|
|
59
52
|
& input[type="search"]::-webkit-search-cancel-button,
|
|
60
53
|
& input[type="search"]::-webkit-search-results-button,
|
|
@@ -85,17 +85,13 @@ function useGridDimensions(apiRef, props) {
|
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
87
|
const computedStyle = (0, _utils.unstable_ownerWindow)(element).getComputedStyle(element);
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
if (!previousSize.current ||
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
height
|
|
96
|
-
};
|
|
97
|
-
apiRef.current.publishEvent('resize', size);
|
|
98
|
-
previousSize.current = size;
|
|
88
|
+
const newSize = {
|
|
89
|
+
width: parseFloat(computedStyle.width) || 0,
|
|
90
|
+
height: parseFloat(computedStyle.height) || 0
|
|
91
|
+
};
|
|
92
|
+
if (!previousSize.current || !areElementSizesEqual(previousSize.current, newSize)) {
|
|
93
|
+
apiRef.current.publishEvent('resize', newSize);
|
|
94
|
+
previousSize.current = newSize;
|
|
99
95
|
}
|
|
100
96
|
}, [apiRef]);
|
|
101
97
|
const getViewportPageSize = React.useCallback(() => {
|
|
@@ -201,7 +197,7 @@ function useGridDimensions(apiRef, props) {
|
|
|
201
197
|
};
|
|
202
198
|
const prevDimensions = apiRef.current.state.dimensions;
|
|
203
199
|
setDimensions(newDimensions);
|
|
204
|
-
if (newDimensions.viewportInnerSize
|
|
200
|
+
if (!areElementSizesEqual(newDimensions.viewportInnerSize, prevDimensions.viewportInnerSize)) {
|
|
205
201
|
apiRef.current.publishEvent('viewportInnerSizeChange', newDimensions.viewportInnerSize);
|
|
206
202
|
}
|
|
207
203
|
apiRef.current.updateRenderContext?.();
|
|
@@ -296,4 +292,7 @@ function measureScrollbarSize(rootElement, columnsTotalWidth, scrollbarSize) {
|
|
|
296
292
|
// https://github.com/mui/mui-x/issues/9550#issuecomment-1619020477
|
|
297
293
|
function roundToDecimalPlaces(value, decimals) {
|
|
298
294
|
return Math.round(value * 10 ** decimals) / 10 ** decimals;
|
|
295
|
+
}
|
|
296
|
+
function areElementSizesEqual(a, b) {
|
|
297
|
+
return a.width === b.width && a.height === b.height;
|
|
299
298
|
}
|
package/node/index.js
CHANGED
package/node/utils/domUtils.js
CHANGED
|
@@ -30,6 +30,9 @@ function isOverflown(element) {
|
|
|
30
30
|
function findParentElementFromClassName(elem, className) {
|
|
31
31
|
return elem.closest(`.${className}`);
|
|
32
32
|
}
|
|
33
|
+
|
|
34
|
+
// TODO, eventually replaces this function with CSS.escape, once available in jsdom, either added manually or built in
|
|
35
|
+
// https://github.com/jsdom/jsdom/issues/1550#issuecomment-236734471
|
|
33
36
|
function escapeOperandAttributeSelector(operand) {
|
|
34
37
|
return operand.replace(/["\\]/g, '\\$&');
|
|
35
38
|
}
|
package/package.json
CHANGED
package/utils/domUtils.js
CHANGED
|
@@ -5,6 +5,9 @@ export function isOverflown(element) {
|
|
|
5
5
|
export function findParentElementFromClassName(elem, className) {
|
|
6
6
|
return elem.closest(`.${className}`);
|
|
7
7
|
}
|
|
8
|
+
|
|
9
|
+
// TODO, eventually replaces this function with CSS.escape, once available in jsdom, either added manually or built in
|
|
10
|
+
// https://github.com/jsdom/jsdom/issues/1550#issuecomment-236734471
|
|
8
11
|
export function escapeOperandAttributeSelector(operand) {
|
|
9
12
|
return operand.replace(/["\\]/g, '\\$&');
|
|
10
13
|
}
|