@mui/x-data-grid 6.19.4 → 6.19.6
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 +112 -10
- package/DataGrid/DataGrid.js +1 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.js +6 -4
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +7 -5
- package/components/panel/filterPanel/GridFilterInputValue.js +4 -3
- package/hooks/features/rows/useGridRows.js +8 -4
- package/index.js +1 -1
- package/legacy/DataGrid/DataGrid.js +1 -1
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +6 -3
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -5
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +4 -2
- package/legacy/hooks/features/rows/useGridRows.js +8 -4
- package/legacy/index.js +1 -1
- package/models/props/DataGridProps.d.ts +1 -1
- package/modern/DataGrid/DataGrid.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +6 -4
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +7 -5
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +4 -3
- package/modern/hooks/features/rows/useGridRows.js +8 -4
- package/modern/index.js +1 -1
- package/node/DataGrid/DataGrid.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +6 -4
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +7 -5
- package/node/components/panel/filterPanel/GridFilterInputValue.js +4 -3
- package/node/hooks/features/rows/useGridRows.js +8 -4
- package/node/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,109 @@
|
|
|
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
|
-
##
|
|
6
|
+
## 6.19.6
|
|
7
|
+
|
|
8
|
+
_Mar 1, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 4 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🌍 Improve Korean (ko-KR) and Chinese (zh-CN) locales on the Pickers
|
|
13
|
+
- 🐞 Bugfixes
|
|
14
|
+
- 📚 Documentation improvements
|
|
15
|
+
|
|
16
|
+
### Data Grid
|
|
17
|
+
|
|
18
|
+
#### `@mui/x-data-grid@6.19.6`
|
|
19
|
+
|
|
20
|
+
- [DataGrid] Fix error when existing rows are passed to `replaceRows` (@martijn-basesoft)
|
|
21
|
+
|
|
22
|
+
#### `@mui/x-data-grid-pro@6.19.6` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
23
|
+
|
|
24
|
+
Same changes as in `@mui/x-data-grid@6.19.6`.
|
|
25
|
+
|
|
26
|
+
#### `@mui/x-data-grid-premium@6.19.6` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
27
|
+
|
|
28
|
+
Same changes as in `@mui/x-data-grid-pro@6.19.6`, plus:
|
|
29
|
+
|
|
30
|
+
- [DataGridPremium] Make clipboard copy respect the sorting during cell selection (#12255) @MBilalShafi
|
|
31
|
+
|
|
32
|
+
### Date Pickers
|
|
33
|
+
|
|
34
|
+
#### `@mui/x-date-pickers@6.19.6`
|
|
35
|
+
|
|
36
|
+
- [l10n] Improve Chinese (zh-CN) locale (#12250) @headironc
|
|
37
|
+
- [l10n] Improve Korean (ko-KR) locale (#12186) @Luzi
|
|
38
|
+
|
|
39
|
+
#### `@mui/x-date-pickers-pro@6.19.6` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
40
|
+
|
|
41
|
+
Same changes as in `@mui/x-date-pickers@6.19.6`.
|
|
42
|
+
|
|
43
|
+
### Docs
|
|
44
|
+
|
|
45
|
+
- [docs] Update lazy loading demo to show skeleton rows during initial rows fetch (#12062) @cherniavskii
|
|
46
|
+
|
|
47
|
+
## 6.19.5
|
|
48
|
+
|
|
49
|
+
_Feb 23, 2024_
|
|
50
|
+
|
|
51
|
+
We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
52
|
+
|
|
53
|
+
- 🐞 Bugfixes
|
|
54
|
+
- 📚 Documentation improvements
|
|
55
|
+
|
|
56
|
+
### Data Grid
|
|
57
|
+
|
|
58
|
+
#### `@mui/x-data-grid@6.19.5`
|
|
59
|
+
|
|
60
|
+
- [DataGrid] Fix styling grid filter input single select (#12079) @FreakDroid
|
|
61
|
+
|
|
62
|
+
#### `@mui/x-data-grid-pro@6.19.5` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
63
|
+
|
|
64
|
+
Same changes as in `@mui/x-data-grid@6.19.5`.
|
|
65
|
+
|
|
66
|
+
#### `@mui/x-data-grid-premium@6.19.5` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
67
|
+
|
|
68
|
+
Same changes as in `@mui/x-data-grid-pro@6.19.5`.
|
|
69
|
+
|
|
70
|
+
### Date Pickers
|
|
71
|
+
|
|
72
|
+
#### `@mui/x-date-pickers@6.19.5`
|
|
73
|
+
|
|
74
|
+
- [pickers] Fix `referenceDate` day calendar focus (#12136) @LukasTy
|
|
75
|
+
- [pickers] Fix styling props propagation to `DateTimePickerTabs` (#12131) @LukasTy
|
|
76
|
+
|
|
77
|
+
#### `@mui/x-date-pickers-pro@6.19.5` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
78
|
+
|
|
79
|
+
Same changes as in `@mui/x-date-pickers@6.19.5`.
|
|
80
|
+
|
|
81
|
+
### Charts / `@mui/x-charts@6.19.5`
|
|
82
|
+
|
|
83
|
+
- [charts] Allow to skip animation on sparkline bar (#12160) @alexfauquette
|
|
84
|
+
|
|
85
|
+
### Docs
|
|
86
|
+
|
|
87
|
+
- [docs] Clarify Pickers 'Component composition' section (#12147) @LukasTy
|
|
88
|
+
- [docs] Fix 301 redirection to StackBlitz @oliviertassinari
|
|
89
|
+
- [docs] Fix 301 to Material UI @oliviertassinari
|
|
90
|
+
- [docs] Fix 301 to Material UI @oliviertassinari
|
|
91
|
+
- [docs] Fix 404 links to translation source @oliviertassinari
|
|
92
|
+
- [docs] Fix dead link to translations @oliviertassinari
|
|
93
|
+
- [docs] Fix the Treemap illustration (#12189) @danilo-leal
|
|
94
|
+
- [docs] Fix typo for `AdapterDateFnsV3` (#12037) @flaviendelangle
|
|
95
|
+
- [docs] Improve performance on Charts entry point @oliviertassinari
|
|
96
|
+
- [docs] Move Heatmap to pro (#12170) @alexfauquette
|
|
97
|
+
- [docs] Remove Charts installation next tag call-out (#12133) @LukasTy
|
|
98
|
+
- [docs] Removed `focused` prop from demo (#12126) @michelengelen
|
|
99
|
+
- [docs] Add missing Heatmap pro icon @oliviertassinari
|
|
100
|
+
- [docs] Add more illustrations to the Overview page (#12041) @danilo-leal
|
|
101
|
+
- [docs] Avoid use of shorthand (#12009) @oliviertassinari
|
|
102
|
+
|
|
103
|
+
### Core
|
|
104
|
+
|
|
105
|
+
- [core] Fix CI @oliviertassinari
|
|
106
|
+
- [core] Fix docs link check (#12137) @LukasTy
|
|
107
|
+
|
|
108
|
+
## 6.19.4
|
|
7
109
|
|
|
8
110
|
_Feb 9, 2024_
|
|
9
111
|
|
|
@@ -15,7 +117,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
|
|
|
15
117
|
|
|
16
118
|
### Data Grid
|
|
17
119
|
|
|
18
|
-
#### `@mui/x-data-grid@
|
|
120
|
+
#### `@mui/x-data-grid@6.19.4`
|
|
19
121
|
|
|
20
122
|
- [DataGrid] Add support for dialogs in menu actions (#11937) @cherniavskii
|
|
21
123
|
- [DataGrid] Allow passing readonly arrays to `pageSizeOptions` prop (#11992) @pcorpet
|
|
@@ -23,28 +125,28 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
|
|
|
23
125
|
- [DataGrid] Replace `eval` with `new Function` (#11962) @cherniavskii
|
|
24
126
|
- [l10n] Improve Danish (da-DK) locale (#11972) @ShahrazH
|
|
25
127
|
|
|
26
|
-
#### `@mui/x-data-grid-pro@
|
|
128
|
+
#### `@mui/x-data-grid-pro@6.19.4` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
27
129
|
|
|
28
|
-
Same changes as in `@mui/x-data-grid@
|
|
130
|
+
Same changes as in `@mui/x-data-grid@6.19.4`.
|
|
29
131
|
|
|
30
|
-
#### `@mui/x-data-grid-premium@
|
|
132
|
+
#### `@mui/x-data-grid-premium@6.19.4` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
31
133
|
|
|
32
|
-
Same changes as in `@mui/x-data-grid-pro@
|
|
134
|
+
Same changes as in `@mui/x-data-grid-pro@6.19.4`, plus:
|
|
33
135
|
|
|
34
136
|
- [DataGridPremium] Fix autosize grouping cell (#11990) @romgrk
|
|
35
137
|
- [DataGridPremium] Fix error after closing print export (#11889) @cherniavskii
|
|
36
138
|
|
|
37
139
|
### Date Pickers
|
|
38
140
|
|
|
39
|
-
#### `@mui/x-date-pickers@
|
|
141
|
+
#### `@mui/x-date-pickers@6.19.4`
|
|
40
142
|
|
|
41
143
|
- [pickers] Avoid relying on locale in Luxon `isWithinRange` method (#11940) @LukasTy
|
|
42
144
|
|
|
43
|
-
#### `@mui/x-date-pickers-pro@
|
|
145
|
+
#### `@mui/x-date-pickers-pro@6.19.4` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
44
146
|
|
|
45
|
-
Same changes as in `@mui/x-date-pickers@
|
|
147
|
+
Same changes as in `@mui/x-date-pickers@6.19.4`.
|
|
46
148
|
|
|
47
|
-
### Charts / `@mui/x-charts@
|
|
149
|
+
### Charts / `@mui/x-charts@6.19.4`
|
|
48
150
|
|
|
49
151
|
- [charts] Add `reverse` property to axes (#11959) @alexfauquette
|
|
50
152
|
- [charts] Allow series ids to be numbers (#11960) @alexfauquette
|
package/DataGrid/DataGrid.js
CHANGED
|
@@ -314,7 +314,7 @@ DataGridRaw.propTypes = {
|
|
|
314
314
|
loading: PropTypes.bool,
|
|
315
315
|
/**
|
|
316
316
|
* Set the locale text of the Data Grid.
|
|
317
|
-
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/
|
|
317
|
+
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/v6.19.4/packages/grid/x-data-grid/src/constants/localeTextConstants.ts) in the GitHub repository.
|
|
318
318
|
*/
|
|
319
319
|
localeText: PropTypes.object,
|
|
320
320
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
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", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "InputLabelProps"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "variant", "InputLabelProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { refType, unstable_useId as useId } from '@mui/utils';
|
|
@@ -25,7 +25,8 @@ function GridFilterInputBoolean(props) {
|
|
|
25
25
|
focusElementRef,
|
|
26
26
|
clearButton,
|
|
27
27
|
tabIndex,
|
|
28
|
-
label: labelProp
|
|
28
|
+
label: labelProp,
|
|
29
|
+
variant = 'standard'
|
|
29
30
|
} = props,
|
|
30
31
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
31
32
|
const [filterValueState, setFilterValueState] = React.useState(item.value || '');
|
|
@@ -52,7 +53,7 @@ function GridFilterInputBoolean(props) {
|
|
|
52
53
|
children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseInputLabel, {
|
|
53
54
|
id: labelId,
|
|
54
55
|
shrink: true,
|
|
55
|
-
variant:
|
|
56
|
+
variant: variant,
|
|
56
57
|
children: label
|
|
57
58
|
})), /*#__PURE__*/_jsxs(rootProps.slots.baseSelect, _extends({
|
|
58
59
|
labelId: labelId,
|
|
@@ -60,7 +61,8 @@ function GridFilterInputBoolean(props) {
|
|
|
60
61
|
label: label,
|
|
61
62
|
value: filterValueState,
|
|
62
63
|
onChange: onFilterChange,
|
|
63
|
-
variant:
|
|
64
|
+
variant: variant,
|
|
65
|
+
notched: variant === 'outlined' ? true : undefined,
|
|
64
66
|
native: isSelectNative,
|
|
65
67
|
displayEmpty: true,
|
|
66
68
|
inputProps: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "variant", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/utils';
|
|
@@ -55,6 +55,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
55
55
|
placeholder,
|
|
56
56
|
tabIndex,
|
|
57
57
|
label: labelProp,
|
|
58
|
+
variant = 'standard',
|
|
58
59
|
clearButton
|
|
59
60
|
} = props,
|
|
60
61
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -121,7 +122,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
121
122
|
id: labelId,
|
|
122
123
|
htmlFor: id,
|
|
123
124
|
shrink: true,
|
|
124
|
-
variant:
|
|
125
|
+
variant: variant,
|
|
125
126
|
children: label
|
|
126
127
|
})), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
|
|
127
128
|
id: id,
|
|
@@ -129,15 +130,16 @@ function GridFilterInputSingleSelect(props) {
|
|
|
129
130
|
labelId: labelId,
|
|
130
131
|
value: filterValueState,
|
|
131
132
|
onChange: onFilterChange,
|
|
132
|
-
variant:
|
|
133
|
+
variant: variant,
|
|
133
134
|
type: type || 'text',
|
|
134
135
|
inputProps: {
|
|
135
136
|
tabIndex,
|
|
136
137
|
ref: focusElementRef,
|
|
137
138
|
placeholder: placeholder != null ? placeholder : apiRef.current.getLocaleText('filterPanelInputPlaceholder')
|
|
138
139
|
},
|
|
139
|
-
native: isSelectNative
|
|
140
|
-
|
|
140
|
+
native: isSelectNative,
|
|
141
|
+
notched: variant === 'outlined' ? true : undefined
|
|
142
|
+
}, others /* FIXME: typing error */, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseSelect, {
|
|
141
143
|
children: renderSingleSelectOptions({
|
|
142
144
|
column: resolvedColumn,
|
|
143
145
|
OptionComponent: rootProps.slots.baseSelectOption,
|
|
@@ -1,6 +1,6 @@
|
|
|
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", "tabIndex", "disabled", "isFilterActive", "clearButton", "InputProps"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "isFilterActive", "clearButton", "InputProps", "variant"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/utils';
|
|
@@ -18,7 +18,8 @@ function GridFilterInputValue(props) {
|
|
|
18
18
|
tabIndex,
|
|
19
19
|
disabled,
|
|
20
20
|
clearButton,
|
|
21
|
-
InputProps
|
|
21
|
+
InputProps,
|
|
22
|
+
variant = 'standard'
|
|
22
23
|
} = props,
|
|
23
24
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
24
25
|
const filterTimeout = useTimeout();
|
|
@@ -54,7 +55,7 @@ function GridFilterInputValue(props) {
|
|
|
54
55
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
55
56
|
value: filterValueState,
|
|
56
57
|
onChange: onFilterChange,
|
|
57
|
-
variant:
|
|
58
|
+
variant: variant,
|
|
58
59
|
type: type || 'text',
|
|
59
60
|
InputProps: _extends({}, applying || clearButton ? {
|
|
60
61
|
endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
@@ -266,13 +266,16 @@ export const useGridRows = (apiRef, props) => {
|
|
|
266
266
|
const dataRowIdToIdLookup = _extends({}, gridRowsDataRowIdToIdLookupSelector(apiRef));
|
|
267
267
|
const rootGroup = tree[GRID_ROOT_GROUP_ID];
|
|
268
268
|
const rootGroupChildren = [...rootGroup.children];
|
|
269
|
+
const seenIds = new Set();
|
|
269
270
|
for (let i = 0; i < newRows.length; i += 1) {
|
|
270
271
|
const rowModel = newRows[i];
|
|
271
272
|
const rowId = getRowIdFromRowModel(rowModel, props.getRowId, 'A row was provided without id when calling replaceRows().');
|
|
272
|
-
const [
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
273
|
+
const [removedRowId] = rootGroupChildren.splice(firstRowToRender + i, 1, rowId);
|
|
274
|
+
if (!seenIds.has(removedRowId)) {
|
|
275
|
+
delete dataRowIdToModelLookup[removedRowId];
|
|
276
|
+
delete dataRowIdToIdLookup[removedRowId];
|
|
277
|
+
delete tree[removedRowId];
|
|
278
|
+
}
|
|
276
279
|
const rowTreeNodeConfig = {
|
|
277
280
|
id: rowId,
|
|
278
281
|
depth: 0,
|
|
@@ -283,6 +286,7 @@ export const useGridRows = (apiRef, props) => {
|
|
|
283
286
|
dataRowIdToModelLookup[rowId] = rowModel;
|
|
284
287
|
dataRowIdToIdLookup[rowId] = rowId;
|
|
285
288
|
tree[rowId] = rowTreeNodeConfig;
|
|
289
|
+
seenIds.add(rowId);
|
|
286
290
|
}
|
|
287
291
|
tree[GRID_ROOT_GROUP_ID] = _extends({}, rootGroup, {
|
|
288
292
|
children: rootGroupChildren
|
package/index.js
CHANGED
|
@@ -316,7 +316,7 @@ DataGridRaw.propTypes = {
|
|
|
316
316
|
loading: PropTypes.bool,
|
|
317
317
|
/**
|
|
318
318
|
* Set the locale text of the Data Grid.
|
|
319
|
-
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/
|
|
319
|
+
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/v6.19.4/packages/grid/x-data-grid/src/constants/localeTextConstants.ts) in the GitHub repository.
|
|
320
320
|
*/
|
|
321
321
|
localeText: PropTypes.object,
|
|
322
322
|
/**
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
|
-
var _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "InputLabelProps"];
|
|
5
|
+
var _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "variant", "InputLabelProps"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { refType, unstable_useId as useId } from '@mui/utils';
|
|
@@ -27,6 +27,8 @@ function GridFilterInputBoolean(props) {
|
|
|
27
27
|
clearButton = props.clearButton,
|
|
28
28
|
tabIndex = props.tabIndex,
|
|
29
29
|
labelProp = props.label,
|
|
30
|
+
_props$variant = props.variant,
|
|
31
|
+
variant = _props$variant === void 0 ? 'standard' : _props$variant,
|
|
30
32
|
InputLabelProps = props.InputLabelProps,
|
|
31
33
|
others = _objectWithoutProperties(props, _excluded);
|
|
32
34
|
var _React$useState = React.useState(item.value || ''),
|
|
@@ -56,7 +58,7 @@ function GridFilterInputBoolean(props) {
|
|
|
56
58
|
children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseInputLabel, {
|
|
57
59
|
id: labelId,
|
|
58
60
|
shrink: true,
|
|
59
|
-
variant:
|
|
61
|
+
variant: variant,
|
|
60
62
|
children: label
|
|
61
63
|
})), /*#__PURE__*/_jsxs(rootProps.slots.baseSelect, _extends({
|
|
62
64
|
labelId: labelId,
|
|
@@ -64,7 +66,8 @@ function GridFilterInputBoolean(props) {
|
|
|
64
66
|
label: label,
|
|
65
67
|
value: filterValueState,
|
|
66
68
|
onChange: onFilterChange,
|
|
67
|
-
variant:
|
|
69
|
+
variant: variant,
|
|
70
|
+
notched: variant === 'outlined' ? true : undefined,
|
|
68
71
|
native: isSelectNative,
|
|
69
72
|
displayEmpty: true,
|
|
70
73
|
inputProps: {
|
|
@@ -3,7 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
5
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
6
|
-
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
6
|
+
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "variant", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import { unstable_useId as useId } from '@mui/utils';
|
|
@@ -54,6 +54,8 @@ function GridFilterInputSingleSelect(props) {
|
|
|
54
54
|
placeholder = props.placeholder,
|
|
55
55
|
tabIndex = props.tabIndex,
|
|
56
56
|
labelProp = props.label,
|
|
57
|
+
_props$variant = props.variant,
|
|
58
|
+
variant = _props$variant === void 0 ? 'standard' : _props$variant,
|
|
57
59
|
isFilterActive = props.isFilterActive,
|
|
58
60
|
clearButton = props.clearButton,
|
|
59
61
|
InputLabelProps = props.InputLabelProps,
|
|
@@ -124,7 +126,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
124
126
|
id: labelId,
|
|
125
127
|
htmlFor: id,
|
|
126
128
|
shrink: true,
|
|
127
|
-
variant:
|
|
129
|
+
variant: variant,
|
|
128
130
|
children: label
|
|
129
131
|
})), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
|
|
130
132
|
id: id,
|
|
@@ -132,15 +134,16 @@ function GridFilterInputSingleSelect(props) {
|
|
|
132
134
|
labelId: labelId,
|
|
133
135
|
value: filterValueState,
|
|
134
136
|
onChange: onFilterChange,
|
|
135
|
-
variant:
|
|
137
|
+
variant: variant,
|
|
136
138
|
type: type || 'text',
|
|
137
139
|
inputProps: {
|
|
138
140
|
tabIndex: tabIndex,
|
|
139
141
|
ref: focusElementRef,
|
|
140
142
|
placeholder: placeholder != null ? placeholder : apiRef.current.getLocaleText('filterPanelInputPlaceholder')
|
|
141
143
|
},
|
|
142
|
-
native: isSelectNative
|
|
143
|
-
|
|
144
|
+
native: isSelectNative,
|
|
145
|
+
notched: variant === 'outlined' ? true : undefined
|
|
146
|
+
}, others /* FIXME: typing error */, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseSelect, {
|
|
144
147
|
children: renderSingleSelectOptions({
|
|
145
148
|
column: resolvedColumn,
|
|
146
149
|
OptionComponent: rootProps.slots.baseSelectOption,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "isFilterActive", "clearButton", "InputProps"];
|
|
4
|
+
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "isFilterActive", "clearButton", "InputProps", "variant"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { unstable_useId as useId } from '@mui/utils';
|
|
@@ -20,6 +20,8 @@ function GridFilterInputValue(props) {
|
|
|
20
20
|
isFilterActive = props.isFilterActive,
|
|
21
21
|
clearButton = props.clearButton,
|
|
22
22
|
InputProps = props.InputProps,
|
|
23
|
+
_props$variant = props.variant,
|
|
24
|
+
variant = _props$variant === void 0 ? 'standard' : _props$variant,
|
|
23
25
|
others = _objectWithoutProperties(props, _excluded);
|
|
24
26
|
var filterTimeout = useTimeout();
|
|
25
27
|
var _React$useState = React.useState((_item$value = item.value) != null ? _item$value : ''),
|
|
@@ -58,7 +60,7 @@ function GridFilterInputValue(props) {
|
|
|
58
60
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
59
61
|
value: filterValueState,
|
|
60
62
|
onChange: onFilterChange,
|
|
61
|
-
variant:
|
|
63
|
+
variant: variant,
|
|
62
64
|
type: type || 'text',
|
|
63
65
|
InputProps: _extends({}, applying || clearButton ? {
|
|
64
66
|
endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
@@ -277,15 +277,18 @@ export var useGridRows = function useGridRows(apiRef, props) {
|
|
|
277
277
|
var dataRowIdToIdLookup = _extends({}, gridRowsDataRowIdToIdLookupSelector(apiRef));
|
|
278
278
|
var rootGroup = tree[GRID_ROOT_GROUP_ID];
|
|
279
279
|
var rootGroupChildren = _toConsumableArray(rootGroup.children);
|
|
280
|
+
var seenIds = new Set();
|
|
280
281
|
for (var i = 0; i < newRows.length; i += 1) {
|
|
281
282
|
var rowModel = newRows[i];
|
|
282
283
|
var rowId = getRowIdFromRowModel(rowModel, props.getRowId, 'A row was provided without id when calling replaceRows().');
|
|
283
284
|
var _rootGroupChildren$sp = rootGroupChildren.splice(firstRowToRender + i, 1, rowId),
|
|
284
285
|
_rootGroupChildren$sp2 = _slicedToArray(_rootGroupChildren$sp, 1),
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
286
|
+
removedRowId = _rootGroupChildren$sp2[0];
|
|
287
|
+
if (!seenIds.has(removedRowId)) {
|
|
288
|
+
delete dataRowIdToModelLookup[removedRowId];
|
|
289
|
+
delete dataRowIdToIdLookup[removedRowId];
|
|
290
|
+
delete tree[removedRowId];
|
|
291
|
+
}
|
|
289
292
|
var rowTreeNodeConfig = {
|
|
290
293
|
id: rowId,
|
|
291
294
|
depth: 0,
|
|
@@ -296,6 +299,7 @@ export var useGridRows = function useGridRows(apiRef, props) {
|
|
|
296
299
|
dataRowIdToModelLookup[rowId] = rowModel;
|
|
297
300
|
dataRowIdToIdLookup[rowId] = rowId;
|
|
298
301
|
tree[rowId] = rowTreeNodeConfig;
|
|
302
|
+
seenIds.add(rowId);
|
|
299
303
|
}
|
|
300
304
|
tree[GRID_ROOT_GROUP_ID] = _extends({}, rootGroup, {
|
|
301
305
|
children: rootGroupChildren
|
package/legacy/index.js
CHANGED
|
@@ -80,7 +80,7 @@ export interface DataGridPropsWithComplexDefaultValueBeforeProcessing {
|
|
|
80
80
|
slots?: UncapitalizeObjectKeys<Partial<GridSlotsComponent>>;
|
|
81
81
|
/**
|
|
82
82
|
* Set the locale text of the Data Grid.
|
|
83
|
-
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/
|
|
83
|
+
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/v6.19.4/packages/grid/x-data-grid/src/constants/localeTextConstants.ts) in the GitHub repository.
|
|
84
84
|
*/
|
|
85
85
|
localeText?: Partial<GridLocaleText>;
|
|
86
86
|
}
|
|
@@ -314,7 +314,7 @@ DataGridRaw.propTypes = {
|
|
|
314
314
|
loading: PropTypes.bool,
|
|
315
315
|
/**
|
|
316
316
|
* Set the locale text of the Data Grid.
|
|
317
|
-
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/
|
|
317
|
+
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/v6.19.4/packages/grid/x-data-grid/src/constants/localeTextConstants.ts) in the GitHub repository.
|
|
318
318
|
*/
|
|
319
319
|
localeText: PropTypes.object,
|
|
320
320
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
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", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "InputLabelProps"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "variant", "InputLabelProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { refType, unstable_useId as useId } from '@mui/utils';
|
|
@@ -24,7 +24,8 @@ function GridFilterInputBoolean(props) {
|
|
|
24
24
|
focusElementRef,
|
|
25
25
|
clearButton,
|
|
26
26
|
tabIndex,
|
|
27
|
-
label: labelProp
|
|
27
|
+
label: labelProp,
|
|
28
|
+
variant = 'standard'
|
|
28
29
|
} = props,
|
|
29
30
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
30
31
|
const [filterValueState, setFilterValueState] = React.useState(item.value || '');
|
|
@@ -51,7 +52,7 @@ function GridFilterInputBoolean(props) {
|
|
|
51
52
|
children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, rootProps.slotProps?.baseInputLabel, {
|
|
52
53
|
id: labelId,
|
|
53
54
|
shrink: true,
|
|
54
|
-
variant:
|
|
55
|
+
variant: variant,
|
|
55
56
|
children: label
|
|
56
57
|
})), /*#__PURE__*/_jsxs(rootProps.slots.baseSelect, _extends({
|
|
57
58
|
labelId: labelId,
|
|
@@ -59,7 +60,8 @@ function GridFilterInputBoolean(props) {
|
|
|
59
60
|
label: label,
|
|
60
61
|
value: filterValueState,
|
|
61
62
|
onChange: onFilterChange,
|
|
62
|
-
variant:
|
|
63
|
+
variant: variant,
|
|
64
|
+
notched: variant === 'outlined' ? true : undefined,
|
|
63
65
|
native: isSelectNative,
|
|
64
66
|
displayEmpty: true,
|
|
65
67
|
inputProps: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "variant", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/utils';
|
|
@@ -54,6 +54,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
54
54
|
placeholder,
|
|
55
55
|
tabIndex,
|
|
56
56
|
label: labelProp,
|
|
57
|
+
variant = 'standard',
|
|
57
58
|
clearButton
|
|
58
59
|
} = props,
|
|
59
60
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -119,7 +120,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
119
120
|
id: labelId,
|
|
120
121
|
htmlFor: id,
|
|
121
122
|
shrink: true,
|
|
122
|
-
variant:
|
|
123
|
+
variant: variant,
|
|
123
124
|
children: label
|
|
124
125
|
})), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
|
|
125
126
|
id: id,
|
|
@@ -127,15 +128,16 @@ function GridFilterInputSingleSelect(props) {
|
|
|
127
128
|
labelId: labelId,
|
|
128
129
|
value: filterValueState,
|
|
129
130
|
onChange: onFilterChange,
|
|
130
|
-
variant:
|
|
131
|
+
variant: variant,
|
|
131
132
|
type: type || 'text',
|
|
132
133
|
inputProps: {
|
|
133
134
|
tabIndex,
|
|
134
135
|
ref: focusElementRef,
|
|
135
136
|
placeholder: placeholder ?? apiRef.current.getLocaleText('filterPanelInputPlaceholder')
|
|
136
137
|
},
|
|
137
|
-
native: isSelectNative
|
|
138
|
-
|
|
138
|
+
native: isSelectNative,
|
|
139
|
+
notched: variant === 'outlined' ? true : undefined
|
|
140
|
+
}, others /* FIXME: typing error */, rootProps.slotProps?.baseSelect, {
|
|
139
141
|
children: renderSingleSelectOptions({
|
|
140
142
|
column: resolvedColumn,
|
|
141
143
|
OptionComponent: rootProps.slots.baseSelectOption,
|
|
@@ -1,6 +1,6 @@
|
|
|
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", "tabIndex", "disabled", "isFilterActive", "clearButton", "InputProps"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "isFilterActive", "clearButton", "InputProps", "variant"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/utils';
|
|
@@ -17,7 +17,8 @@ function GridFilterInputValue(props) {
|
|
|
17
17
|
tabIndex,
|
|
18
18
|
disabled,
|
|
19
19
|
clearButton,
|
|
20
|
-
InputProps
|
|
20
|
+
InputProps,
|
|
21
|
+
variant = 'standard'
|
|
21
22
|
} = props,
|
|
22
23
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
23
24
|
const filterTimeout = useTimeout();
|
|
@@ -52,7 +53,7 @@ function GridFilterInputValue(props) {
|
|
|
52
53
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
53
54
|
value: filterValueState,
|
|
54
55
|
onChange: onFilterChange,
|
|
55
|
-
variant:
|
|
56
|
+
variant: variant,
|
|
56
57
|
type: type || 'text',
|
|
57
58
|
InputProps: _extends({}, applying || clearButton ? {
|
|
58
59
|
endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
@@ -260,13 +260,16 @@ export const useGridRows = (apiRef, props) => {
|
|
|
260
260
|
const dataRowIdToIdLookup = _extends({}, gridRowsDataRowIdToIdLookupSelector(apiRef));
|
|
261
261
|
const rootGroup = tree[GRID_ROOT_GROUP_ID];
|
|
262
262
|
const rootGroupChildren = [...rootGroup.children];
|
|
263
|
+
const seenIds = new Set();
|
|
263
264
|
for (let i = 0; i < newRows.length; i += 1) {
|
|
264
265
|
const rowModel = newRows[i];
|
|
265
266
|
const rowId = getRowIdFromRowModel(rowModel, props.getRowId, 'A row was provided without id when calling replaceRows().');
|
|
266
|
-
const [
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
267
|
+
const [removedRowId] = rootGroupChildren.splice(firstRowToRender + i, 1, rowId);
|
|
268
|
+
if (!seenIds.has(removedRowId)) {
|
|
269
|
+
delete dataRowIdToModelLookup[removedRowId];
|
|
270
|
+
delete dataRowIdToIdLookup[removedRowId];
|
|
271
|
+
delete tree[removedRowId];
|
|
272
|
+
}
|
|
270
273
|
const rowTreeNodeConfig = {
|
|
271
274
|
id: rowId,
|
|
272
275
|
depth: 0,
|
|
@@ -277,6 +280,7 @@ export const useGridRows = (apiRef, props) => {
|
|
|
277
280
|
dataRowIdToModelLookup[rowId] = rowModel;
|
|
278
281
|
dataRowIdToIdLookup[rowId] = rowId;
|
|
279
282
|
tree[rowId] = rowTreeNodeConfig;
|
|
283
|
+
seenIds.add(rowId);
|
|
280
284
|
}
|
|
281
285
|
tree[GRID_ROOT_GROUP_ID] = _extends({}, rootGroup, {
|
|
282
286
|
children: rootGroupChildren
|
package/modern/index.js
CHANGED
|
@@ -322,7 +322,7 @@ DataGridRaw.propTypes = {
|
|
|
322
322
|
loading: _propTypes.default.bool,
|
|
323
323
|
/**
|
|
324
324
|
* Set the locale text of the Data Grid.
|
|
325
|
-
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/
|
|
325
|
+
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/v6.19.4/packages/grid/x-data-grid/src/constants/localeTextConstants.ts) in the GitHub repository.
|
|
326
326
|
*/
|
|
327
327
|
localeText: _propTypes.default.object,
|
|
328
328
|
/**
|
|
@@ -13,7 +13,7 @@ var _utils = require("@mui/utils");
|
|
|
13
13
|
var _styles = require("@mui/material/styles");
|
|
14
14
|
var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "InputLabelProps"];
|
|
16
|
+
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "variant", "InputLabelProps"];
|
|
17
17
|
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); }
|
|
18
18
|
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 && Object.prototype.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; }
|
|
19
19
|
const BooleanOperatorContainer = (0, _styles.styled)('div')({
|
|
@@ -32,7 +32,8 @@ function GridFilterInputBoolean(props) {
|
|
|
32
32
|
focusElementRef,
|
|
33
33
|
clearButton,
|
|
34
34
|
tabIndex,
|
|
35
|
-
label: labelProp
|
|
35
|
+
label: labelProp,
|
|
36
|
+
variant = 'standard'
|
|
36
37
|
} = props,
|
|
37
38
|
others = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
38
39
|
const [filterValueState, setFilterValueState] = React.useState(item.value || '');
|
|
@@ -59,7 +60,7 @@ function GridFilterInputBoolean(props) {
|
|
|
59
60
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseInputLabel, (0, _extends2.default)({}, rootProps.slotProps?.baseInputLabel, {
|
|
60
61
|
id: labelId,
|
|
61
62
|
shrink: true,
|
|
62
|
-
variant:
|
|
63
|
+
variant: variant,
|
|
63
64
|
children: label
|
|
64
65
|
})), /*#__PURE__*/(0, _jsxRuntime.jsxs)(rootProps.slots.baseSelect, (0, _extends2.default)({
|
|
65
66
|
labelId: labelId,
|
|
@@ -67,7 +68,8 @@ function GridFilterInputBoolean(props) {
|
|
|
67
68
|
label: label,
|
|
68
69
|
value: filterValueState,
|
|
69
70
|
onChange: onFilterChange,
|
|
70
|
-
variant:
|
|
71
|
+
variant: variant,
|
|
72
|
+
notched: variant === 'outlined' ? true : undefined,
|
|
71
73
|
native: isSelectNative,
|
|
72
74
|
displayEmpty: true,
|
|
73
75
|
inputProps: {
|
|
@@ -15,7 +15,7 @@ var _styles = require("@mui/material/styles");
|
|
|
15
15
|
var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
|
|
16
16
|
var _filterPanelUtils = require("./filterPanelUtils");
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
18
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "variant", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
19
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); }
|
|
20
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 && Object.prototype.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; }
|
|
21
21
|
const renderSingleSelectOptions = ({
|
|
@@ -62,6 +62,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
62
62
|
placeholder,
|
|
63
63
|
tabIndex,
|
|
64
64
|
label: labelProp,
|
|
65
|
+
variant = 'standard',
|
|
65
66
|
clearButton
|
|
66
67
|
} = props,
|
|
67
68
|
others = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
@@ -127,7 +128,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
127
128
|
id: labelId,
|
|
128
129
|
htmlFor: id,
|
|
129
130
|
shrink: true,
|
|
130
|
-
variant:
|
|
131
|
+
variant: variant,
|
|
131
132
|
children: label
|
|
132
133
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseSelect, (0, _extends2.default)({
|
|
133
134
|
id: id,
|
|
@@ -135,15 +136,16 @@ function GridFilterInputSingleSelect(props) {
|
|
|
135
136
|
labelId: labelId,
|
|
136
137
|
value: filterValueState,
|
|
137
138
|
onChange: onFilterChange,
|
|
138
|
-
variant:
|
|
139
|
+
variant: variant,
|
|
139
140
|
type: type || 'text',
|
|
140
141
|
inputProps: {
|
|
141
142
|
tabIndex,
|
|
142
143
|
ref: focusElementRef,
|
|
143
144
|
placeholder: placeholder ?? apiRef.current.getLocaleText('filterPanelInputPlaceholder')
|
|
144
145
|
},
|
|
145
|
-
native: isSelectNative
|
|
146
|
-
|
|
146
|
+
native: isSelectNative,
|
|
147
|
+
notched: variant === 'outlined' ? true : undefined
|
|
148
|
+
}, others /* FIXME: typing error */, rootProps.slotProps?.baseSelect, {
|
|
147
149
|
children: renderSingleSelectOptions({
|
|
148
150
|
column: resolvedColumn,
|
|
149
151
|
OptionComponent: rootProps.slots.baseSelectOption,
|
|
@@ -13,7 +13,7 @@ var _utils = require("@mui/utils");
|
|
|
13
13
|
var _useTimeout = require("../../../hooks/utils/useTimeout");
|
|
14
14
|
var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "isFilterActive", "clearButton", "InputProps"];
|
|
16
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "isFilterActive", "clearButton", "InputProps", "variant"];
|
|
17
17
|
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); }
|
|
18
18
|
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 && Object.prototype.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; }
|
|
19
19
|
function GridFilterInputValue(props) {
|
|
@@ -26,7 +26,8 @@ function GridFilterInputValue(props) {
|
|
|
26
26
|
tabIndex,
|
|
27
27
|
disabled,
|
|
28
28
|
clearButton,
|
|
29
|
-
InputProps
|
|
29
|
+
InputProps,
|
|
30
|
+
variant = 'standard'
|
|
30
31
|
} = props,
|
|
31
32
|
others = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
32
33
|
const filterTimeout = (0, _useTimeout.useTimeout)();
|
|
@@ -61,7 +62,7 @@ function GridFilterInputValue(props) {
|
|
|
61
62
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
62
63
|
value: filterValueState,
|
|
63
64
|
onChange: onFilterChange,
|
|
64
|
-
variant:
|
|
65
|
+
variant: variant,
|
|
65
66
|
type: type || 'text',
|
|
66
67
|
InputProps: (0, _extends2.default)({}, applying || clearButton ? {
|
|
67
68
|
endAdornment: applying ? /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.loadIcon, {
|
|
@@ -270,13 +270,16 @@ const useGridRows = (apiRef, props) => {
|
|
|
270
270
|
const dataRowIdToIdLookup = (0, _extends2.default)({}, (0, _gridRowsSelector.gridRowsDataRowIdToIdLookupSelector)(apiRef));
|
|
271
271
|
const rootGroup = tree[_gridRowsUtils.GRID_ROOT_GROUP_ID];
|
|
272
272
|
const rootGroupChildren = [...rootGroup.children];
|
|
273
|
+
const seenIds = new Set();
|
|
273
274
|
for (let i = 0; i < newRows.length; i += 1) {
|
|
274
275
|
const rowModel = newRows[i];
|
|
275
276
|
const rowId = (0, _gridRowsUtils.getRowIdFromRowModel)(rowModel, props.getRowId, 'A row was provided without id when calling replaceRows().');
|
|
276
|
-
const [
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
277
|
+
const [removedRowId] = rootGroupChildren.splice(firstRowToRender + i, 1, rowId);
|
|
278
|
+
if (!seenIds.has(removedRowId)) {
|
|
279
|
+
delete dataRowIdToModelLookup[removedRowId];
|
|
280
|
+
delete dataRowIdToIdLookup[removedRowId];
|
|
281
|
+
delete tree[removedRowId];
|
|
282
|
+
}
|
|
280
283
|
const rowTreeNodeConfig = {
|
|
281
284
|
id: rowId,
|
|
282
285
|
depth: 0,
|
|
@@ -287,6 +290,7 @@ const useGridRows = (apiRef, props) => {
|
|
|
287
290
|
dataRowIdToModelLookup[rowId] = rowModel;
|
|
288
291
|
dataRowIdToIdLookup[rowId] = rowId;
|
|
289
292
|
tree[rowId] = rowTreeNodeConfig;
|
|
293
|
+
seenIds.add(rowId);
|
|
290
294
|
}
|
|
291
295
|
tree[_gridRowsUtils.GRID_ROOT_GROUP_ID] = (0, _extends2.default)({}, rootGroup, {
|
|
292
296
|
children: rootGroupChildren
|
package/node/index.js
CHANGED