@mui/x-data-grid-pro 7.13.0 → 7.15.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 +151 -2
- package/components/GridColumnMenuPinningItem.js +3 -3
- package/components/GridDataSourceTreeDataGroupingCell.js +4 -4
- package/components/GridRowReorderCell.d.ts +3 -0
- package/components/GridRowReorderCell.js +66 -0
- package/components/index.d.ts +1 -0
- package/components/index.js +11 -0
- package/esm/components/GridColumnMenuPinningItem.js +3 -3
- package/esm/components/GridDataSourceTreeDataGroupingCell.js +4 -4
- package/esm/components/GridRowReorderCell.js +66 -0
- package/esm/components/index.js +1 -0
- package/esm/hooks/features/columnReorder/useGridColumnReorder.js +5 -5
- package/esm/hooks/features/dataSource/gridDataSourceSelector.js +4 -2
- package/esm/utils/releaseInfo.js +1 -1
- package/hooks/features/columnReorder/useGridColumnReorder.js +5 -5
- package/hooks/features/dataSource/gridDataSourceSelector.d.ts +5 -3
- package/hooks/features/dataSource/gridDataSourceSelector.js +4 -2
- package/index.js +1 -1
- package/models/dataGridProProps.d.ts +1 -1
- package/modern/components/GridColumnMenuPinningItem.js +3 -3
- package/modern/components/GridDataSourceTreeDataGroupingCell.js +4 -4
- package/modern/components/GridRowReorderCell.js +66 -0
- package/modern/components/index.js +1 -0
- package/modern/hooks/features/columnReorder/useGridColumnReorder.js +5 -5
- package/modern/hooks/features/dataSource/gridDataSourceSelector.js +4 -2
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/package.json +8 -8
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,155 @@
|
|
|
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.15.0
|
|
7
|
+
|
|
8
|
+
_Aug 29, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 💫 Support Material UI v6 (`@mui/material@6`) peer dependency (#14142) @cherniavskii
|
|
13
|
+
|
|
14
|
+
You can now use MUI X components with either v5 or v6 of `@mui/material` package 🎉
|
|
15
|
+
|
|
16
|
+
- 🐞 Bugfixes
|
|
17
|
+
|
|
18
|
+
### Data Grid
|
|
19
|
+
|
|
20
|
+
#### `@mui/x-data-grid-pro@7.15.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
21
|
+
|
|
22
|
+
- [DataGridPro] Export `GridRowReorderCell` component (#14079) @genepaul
|
|
23
|
+
|
|
24
|
+
#### `@mui/x-data-grid-premium@7.15.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
25
|
+
|
|
26
|
+
Same changes as in `@mui/x-data-grid-pro@7.15.0`.
|
|
27
|
+
|
|
28
|
+
### Date and Time Pickers
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-date-pickers@7.15.0`
|
|
31
|
+
|
|
32
|
+
- [pickers] Add `onTouchStart` handler for `TimeClock` (#14305) @arthurbalduini
|
|
33
|
+
|
|
34
|
+
#### `@mui/x-date-pickers-pro@7.15.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
35
|
+
|
|
36
|
+
Same changes as in `@mui/x-date-pickers@7.15.0`, plus:
|
|
37
|
+
|
|
38
|
+
- [DateTimeRangePicker] Fix date format resolving from views on 24hr locales (#14341) @arthurbalduini
|
|
39
|
+
|
|
40
|
+
### Charts
|
|
41
|
+
|
|
42
|
+
#### `@mui/x-charts@7.15.0`
|
|
43
|
+
|
|
44
|
+
- [charts] Add missing `themeAugmentation` in pro plan (#14313) @lhilgert9
|
|
45
|
+
- [charts] Fix `LineChart` transition stopping before completion (#14366) @JCQuintas
|
|
46
|
+
- [charts] Fix tooltip with horizontal layout (#14337) @alexfauquette
|
|
47
|
+
- [charts] Keep axis root classe usage explicit (#14378) @alexfauquette
|
|
48
|
+
|
|
49
|
+
#### `@mui/x-charts-pro@7.0.0-alpha.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
50
|
+
|
|
51
|
+
Same changes as in `@mui/x-charts@7.15.0`, plus:
|
|
52
|
+
|
|
53
|
+
- [charts pro] Avoid relative reference to `@mui/x-charts` package (#14335) @LukasTy
|
|
54
|
+
|
|
55
|
+
### Docs
|
|
56
|
+
|
|
57
|
+
- [docs] Fix sentence case `h2` @oliviertassinari
|
|
58
|
+
- [docs] Clarify contribution guide references @oliviertassinari
|
|
59
|
+
- [docs] Fix Stack Overflow issue canned response @oliviertassinari
|
|
60
|
+
- [docs] Fix outdated link to support page @oliviertassinari
|
|
61
|
+
- [docs] Fix use of Material UI @oliviertassinari
|
|
62
|
+
- [docs] Update deprecated props in docs (#14295) @JCQuintas
|
|
63
|
+
|
|
64
|
+
### Core
|
|
65
|
+
|
|
66
|
+
- [core] Allow only v5.x for `MUI Core` renovate group (#14382) @LukasTy
|
|
67
|
+
- [core] Avoid visual regression when using `@mui/material@6` (#14357) @cherniavskii
|
|
68
|
+
- [core] Remove renovate rule targeting only `next` releases of `@mui/docs` (#14364) @LukasTy
|
|
69
|
+
- [core] Support `@mui/material@6` peer dependency (#14142) @cherniavskii
|
|
70
|
+
- [core] Use `useRtl` instead of `useTheme` to access direction (#14359) @LukasTy
|
|
71
|
+
- [code-infra] Typecheck nested folders in playground (#14352) @JCQuintas
|
|
72
|
+
- [infra] Fix Issue cleanup action @oliviertassinari
|
|
73
|
+
- [license] Prepare renaming of argument names @oliviertassinari
|
|
74
|
+
|
|
75
|
+
## 7.14.0
|
|
76
|
+
|
|
77
|
+
_Aug 23, 2024_
|
|
78
|
+
|
|
79
|
+
We'd like to offer a big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
|
|
80
|
+
|
|
81
|
+
- 💫 Allow [filtering the axis on zoom](https://mui.com/x/react-charts/zoom-and-pan/#zoom-filtering), making the axis adapt by removing values outside the view.
|
|
82
|
+
|
|
83
|
+
<img width="600" src="https://github.com/user-attachments/assets/e65bbd00-d2a8-4136-81cd-3598f1373c16" alt="filtering the axis on zoom" />
|
|
84
|
+
|
|
85
|
+
- 📊 Improve bar chart performances
|
|
86
|
+
- 🌍 Improve Czech (cs-CZ) and Hebrew (he-IL) locales on the Data Grid
|
|
87
|
+
- 🌍 Improve Chinese (zh-HK), Hebrew (he-IL), and Vietnamese (vi-VN) locales on the Date and Time Pickers
|
|
88
|
+
- 🐞 Bugfixes
|
|
89
|
+
|
|
90
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
91
|
+
|
|
92
|
+
### Data Grid
|
|
93
|
+
|
|
94
|
+
#### `@mui/x-data-grid@7.14.0`
|
|
95
|
+
|
|
96
|
+
- [DataGrid] Use readonly array result for `getTreeDataPath` (#11743) @pcorpet
|
|
97
|
+
- [DataGrid] Use `event.key` for `Tab` and `Escape` keys (#14170) @k-rajat19
|
|
98
|
+
- [DataGrid] Introduce selectors with arguments (#14236) @MBilalShafi
|
|
99
|
+
- [DataGrid] include `api` in `gridCellParams` interface (#14201) @k-rajat19
|
|
100
|
+
- [l10n] Improve Czech (cs-CZ) locale (#14135) @chirimiri22
|
|
101
|
+
- [l10n] Improve Hebrew (he-IL) locale (#14287) @rotembarsela
|
|
102
|
+
|
|
103
|
+
#### `@mui/x-data-grid-pro@7.14.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
104
|
+
|
|
105
|
+
Same changes as in `@mui/x-data-grid@7.14.0`.
|
|
106
|
+
|
|
107
|
+
#### `@mui/x-data-grid-premium@7.14.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
108
|
+
|
|
109
|
+
Same changes as in `@mui/x-data-grid-pro@7.14.0`, plus:
|
|
110
|
+
|
|
111
|
+
- [DataGridPremium] Fix clipboard paste not working for a single cell on non-first page (#14261) @arminmeh
|
|
112
|
+
- [DataGridPremium] Fix `onCellSelectionModelChange` not triggered when additional cell range is selected (#14199) @arminmeh
|
|
113
|
+
|
|
114
|
+
### Date and Time Pickers
|
|
115
|
+
|
|
116
|
+
#### `@mui/x-date-pickers@7.14.0`
|
|
117
|
+
|
|
118
|
+
- [l10n] Improve Chinese (zh-HK) locale (#13289) @yeeharn
|
|
119
|
+
- [l10n] Improve Hebrew (he-IL) locale (#14287) @rotembarsela
|
|
120
|
+
- [l10n] Improve Vietnamese (vi-VN) locale (#14238) @locnbk2002
|
|
121
|
+
- [TimePicker] Handle `Space` and `Enter` on the `TimeClock` component @arthurbalduini
|
|
122
|
+
|
|
123
|
+
#### `@mui/x-date-pickers-pro@7.14.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
124
|
+
|
|
125
|
+
Same changes as in `@mui/x-date-pickers@7.14.0`.
|
|
126
|
+
|
|
127
|
+
### Charts
|
|
128
|
+
|
|
129
|
+
#### `@mui/x-charts@7.14.0`
|
|
130
|
+
|
|
131
|
+
- [charts] Fix grid overflow with zooming (#14280) @alexfauquette
|
|
132
|
+
- [charts] Improve bar chart performances (#14278) @alexfauquette
|
|
133
|
+
- [charts] Test pointer events (#14042) @alexfauquette
|
|
134
|
+
- [charts] Use `isPointInside` function for both graphs and axis (#14222) @JCQuintas
|
|
135
|
+
|
|
136
|
+
#### `@mui/x-charts-pro@7.0.0-alpha.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
137
|
+
|
|
138
|
+
Same changes as in `@mui/x-charts@7.14.0`, plus:
|
|
139
|
+
|
|
140
|
+
- [charts-pro] Zoom axis filtering (#14121) @JCQuintas
|
|
141
|
+
|
|
142
|
+
### Docs
|
|
143
|
+
|
|
144
|
+
- [docs] Consistent use of UTC and timezones (#14250) @oliviertassinari
|
|
145
|
+
- [docs] Fix missing leading slashes in URLs (#14249) @oliviertassinari
|
|
146
|
+
- [docs] Dash usage revision on pickers pages (#14260) @arthurbalduini
|
|
147
|
+
|
|
148
|
+
### Core
|
|
149
|
+
|
|
150
|
+
- [core] Follow JSDocs convention @oliviertassinari
|
|
151
|
+
- [core] Prepare for material v6 (#14143) @LukasTy
|
|
152
|
+
- [code-infra] Set up `eslint-plugin-testing-library` (#14232) @LukasTy
|
|
153
|
+
- [infra] Updated mui-x roadmap links with new project URL (#14271) @michelengelen
|
|
154
|
+
|
|
6
155
|
## 7.13.0
|
|
7
156
|
|
|
8
157
|
_Aug 16, 2024_
|
|
@@ -58,7 +207,7 @@ Same changes as in `@mui/x-date-pickers@7.13.0`.
|
|
|
58
207
|
- [charts] Rename `CartesianContextProvider` to `CartesianProvider` (#14102) @JCQuintas
|
|
59
208
|
- [charts] Support axis with the same value for all data points (#14191) @alexfauquette
|
|
60
209
|
|
|
61
|
-
#### `@mui/x-
|
|
210
|
+
#### `@mui/x-charts-pro@7.0.0-alpha.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
62
211
|
|
|
63
212
|
Same changes as in `@mui/x-charts@7.13.0`.
|
|
64
213
|
|
|
@@ -132,7 +281,7 @@ Same changes as in `@mui/x-date-pickers@7.12.1`.
|
|
|
132
281
|
- [charts] Fix charts vendor publish config (#14073) @JCQuintas
|
|
133
282
|
- [charts] Move `plugins` to `PluginProvider` (#14056) @JCQuintas
|
|
134
283
|
|
|
135
|
-
#### `@mui/x-
|
|
284
|
+
#### `@mui/x-charts-pro@7.0.0-alpha.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
136
285
|
|
|
137
286
|
Same changes as in `@mui/x-charts@7.12.1`, plus:
|
|
138
287
|
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.GridColumnMenuPinningItem = GridColumnMenuPinningItem;
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
var
|
|
9
|
+
var _RtlProvider = require("@mui/system/RtlProvider");
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
12
12
|
var _ListItemIcon = _interopRequireDefault(require("@mui/material/ListItemIcon"));
|
|
@@ -24,7 +24,7 @@ function GridColumnMenuPinningItem(props) {
|
|
|
24
24
|
} = props;
|
|
25
25
|
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
26
26
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
27
|
-
const
|
|
27
|
+
const isRtl = (0, _RtlProvider.useRtl)();
|
|
28
28
|
const pinColumn = React.useCallback(side => event => {
|
|
29
29
|
apiRef.current.pinColumn(colDef.field, side);
|
|
30
30
|
onClick(event);
|
|
@@ -79,7 +79,7 @@ function GridColumnMenuPinningItem(props) {
|
|
|
79
79
|
})]
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
-
if (
|
|
82
|
+
if (isRtl) {
|
|
83
83
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
84
84
|
children: [pinToRightMenuItem, pinToLeftMenuItem]
|
|
85
85
|
});
|
|
@@ -11,9 +11,11 @@ var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"
|
|
|
11
11
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
12
12
|
var _Badge = _interopRequireDefault(require("@mui/material/Badge"));
|
|
13
13
|
var _xDataGrid = require("@mui/x-data-grid");
|
|
14
|
+
var _internals = require("@mui/x-data-grid/internals");
|
|
14
15
|
var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
|
|
15
16
|
var _useGridRootProps = require("../hooks/utils/useGridRootProps");
|
|
16
17
|
var _useGridPrivateApiContext = require("../hooks/utils/useGridPrivateApiContext");
|
|
18
|
+
var _gridDataSourceSelector = require("../hooks/features/dataSource/gridDataSourceSelector");
|
|
17
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
20
|
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
21
|
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; }
|
|
@@ -38,10 +40,8 @@ function GridTreeDataGroupingCellIcon(props) {
|
|
|
38
40
|
field,
|
|
39
41
|
descendantCount
|
|
40
42
|
} = props;
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const isDataLoading = (0, _xDataGrid.useGridSelector)(apiRef, loadingSelector);
|
|
44
|
-
const error = (0, _xDataGrid.useGridSelector)(apiRef, errorSelector);
|
|
43
|
+
const isDataLoading = (0, _internals.useGridSelectorV8)(apiRef, _gridDataSourceSelector.gridDataSourceLoadingIdSelector, id);
|
|
44
|
+
const error = (0, _internals.useGridSelectorV8)(apiRef, _gridDataSourceSelector.gridDataSourceErrorSelector, id);
|
|
45
45
|
const handleClick = event => {
|
|
46
46
|
if (!rowNode.childrenExpanded) {
|
|
47
47
|
// always fetch/get from cache the children when the node is expanded
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridRenderCellParams } from '@mui/x-data-grid';
|
|
3
3
|
declare function GridRowReorderCell(params: GridRenderCellParams): React.JSX.Element | null;
|
|
4
|
+
declare namespace GridRowReorderCell {
|
|
5
|
+
var propTypes: any;
|
|
6
|
+
}
|
|
4
7
|
export { GridRowReorderCell };
|
|
5
8
|
export declare const renderRowReorderCell: (params: GridRenderCellParams) => React.JSX.Element | null;
|
|
@@ -8,6 +8,7 @@ exports.GridRowReorderCell = GridRowReorderCell;
|
|
|
8
8
|
exports.renderRowReorderCell = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
12
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
12
13
|
var _xDataGrid = require("@mui/x-data-grid");
|
|
13
14
|
var _internals = require("@mui/x-data-grid/internals");
|
|
@@ -75,6 +76,71 @@ function GridRowReorderCell(params) {
|
|
|
75
76
|
})]
|
|
76
77
|
}));
|
|
77
78
|
}
|
|
79
|
+
process.env.NODE_ENV !== "production" ? GridRowReorderCell.propTypes = {
|
|
80
|
+
// ----------------------------- Warning --------------------------------
|
|
81
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
82
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
83
|
+
// ----------------------------------------------------------------------
|
|
84
|
+
/**
|
|
85
|
+
* GridApi that let you manipulate the grid.
|
|
86
|
+
*/
|
|
87
|
+
api: _propTypes.default.object.isRequired,
|
|
88
|
+
/**
|
|
89
|
+
* The mode of the cell.
|
|
90
|
+
*/
|
|
91
|
+
cellMode: _propTypes.default.oneOf(['edit', 'view']).isRequired,
|
|
92
|
+
/**
|
|
93
|
+
* The column of the row that the current cell belongs to.
|
|
94
|
+
*/
|
|
95
|
+
colDef: _propTypes.default.object.isRequired,
|
|
96
|
+
/**
|
|
97
|
+
* The column field of the cell that triggered the event.
|
|
98
|
+
*/
|
|
99
|
+
field: _propTypes.default.string.isRequired,
|
|
100
|
+
/**
|
|
101
|
+
* A ref allowing to set imperative focus.
|
|
102
|
+
* It can be passed to the element that should receive focus.
|
|
103
|
+
* @ignore - do not document.
|
|
104
|
+
*/
|
|
105
|
+
focusElementRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
|
|
106
|
+
current: _propTypes.default.shape({
|
|
107
|
+
focus: _propTypes.default.func.isRequired
|
|
108
|
+
})
|
|
109
|
+
})]),
|
|
110
|
+
/**
|
|
111
|
+
* The cell value formatted with the column valueFormatter.
|
|
112
|
+
*/
|
|
113
|
+
formattedValue: _propTypes.default.any,
|
|
114
|
+
/**
|
|
115
|
+
* If true, the cell is the active element.
|
|
116
|
+
*/
|
|
117
|
+
hasFocus: _propTypes.default.bool.isRequired,
|
|
118
|
+
/**
|
|
119
|
+
* The grid row id.
|
|
120
|
+
*/
|
|
121
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
122
|
+
/**
|
|
123
|
+
* If true, the cell is editable.
|
|
124
|
+
*/
|
|
125
|
+
isEditable: _propTypes.default.bool,
|
|
126
|
+
/**
|
|
127
|
+
* The row model of the row that the current cell belongs to.
|
|
128
|
+
*/
|
|
129
|
+
row: _propTypes.default.any.isRequired,
|
|
130
|
+
/**
|
|
131
|
+
* The node of the row that the current cell belongs to.
|
|
132
|
+
*/
|
|
133
|
+
rowNode: _propTypes.default.object.isRequired,
|
|
134
|
+
/**
|
|
135
|
+
* the tabIndex value.
|
|
136
|
+
*/
|
|
137
|
+
tabIndex: _propTypes.default.oneOf([-1, 0]).isRequired,
|
|
138
|
+
/**
|
|
139
|
+
* The cell value.
|
|
140
|
+
* If the column has `valueGetter`, use `params.row` to directly access the fields.
|
|
141
|
+
*/
|
|
142
|
+
value: _propTypes.default.any
|
|
143
|
+
} : void 0;
|
|
78
144
|
const renderRowReorderCell = params => {
|
|
79
145
|
if (params.rowNode.type === 'footer' || params.rowNode.type === 'pinnedRow') {
|
|
80
146
|
return null;
|
package/components/index.d.ts
CHANGED
package/components/index.js
CHANGED
|
@@ -36,6 +36,17 @@ Object.keys(_GridDetailPanelToggleCell).forEach(function (key) {
|
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
|
+
var _GridRowReorderCell = require("./GridRowReorderCell");
|
|
40
|
+
Object.keys(_GridRowReorderCell).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _GridRowReorderCell[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _GridRowReorderCell[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
39
50
|
var _icons = require("../material/icons");
|
|
40
51
|
Object.keys(_icons).forEach(function (key) {
|
|
41
52
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useRtl } from '@mui/system/RtlProvider';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import MenuItem from '@mui/material/MenuItem';
|
|
5
5
|
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
@@ -15,7 +15,7 @@ function GridColumnMenuPinningItem(props) {
|
|
|
15
15
|
} = props;
|
|
16
16
|
const apiRef = useGridApiContext();
|
|
17
17
|
const rootProps = useGridRootProps();
|
|
18
|
-
const
|
|
18
|
+
const isRtl = useRtl();
|
|
19
19
|
const pinColumn = React.useCallback(side => event => {
|
|
20
20
|
apiRef.current.pinColumn(colDef.field, side);
|
|
21
21
|
onClick(event);
|
|
@@ -70,7 +70,7 @@ function GridColumnMenuPinningItem(props) {
|
|
|
70
70
|
})]
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
if (
|
|
73
|
+
if (isRtl) {
|
|
74
74
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
75
75
|
children: [pinToRightMenuItem, pinToLeftMenuItem]
|
|
76
76
|
});
|
|
@@ -4,9 +4,11 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
4
4
|
import Box from '@mui/material/Box';
|
|
5
5
|
import Badge from '@mui/material/Badge';
|
|
6
6
|
import { getDataGridUtilityClass, useGridSelector } from '@mui/x-data-grid';
|
|
7
|
+
import { useGridSelectorV8 } from '@mui/x-data-grid/internals';
|
|
7
8
|
import CircularProgress from '@mui/material/CircularProgress';
|
|
8
9
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
9
10
|
import { useGridPrivateApiContext } from '../hooks/utils/useGridPrivateApiContext';
|
|
11
|
+
import { gridDataSourceErrorSelector, gridDataSourceLoadingIdSelector } from '../hooks/features/dataSource/gridDataSourceSelector';
|
|
10
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
13
|
const useUtilityClasses = ownerState => {
|
|
12
14
|
const {
|
|
@@ -29,10 +31,8 @@ function GridTreeDataGroupingCellIcon(props) {
|
|
|
29
31
|
field,
|
|
30
32
|
descendantCount
|
|
31
33
|
} = props;
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const isDataLoading = useGridSelector(apiRef, loadingSelector);
|
|
35
|
-
const error = useGridSelector(apiRef, errorSelector);
|
|
34
|
+
const isDataLoading = useGridSelectorV8(apiRef, gridDataSourceLoadingIdSelector, id);
|
|
35
|
+
const error = useGridSelectorV8(apiRef, gridDataSourceErrorSelector, id);
|
|
36
36
|
const handleClick = event => {
|
|
37
37
|
if (!rowNode.childrenExpanded) {
|
|
38
38
|
// always fetch/get from cache the children when the node is expanded
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
3
4
|
import composeClasses from '@mui/utils/composeClasses';
|
|
4
5
|
import { gridRowMaximumTreeDepthSelector, gridSortModelSelector, useGridApiContext, useGridSelector, getDataGridUtilityClass } from '@mui/x-data-grid';
|
|
5
6
|
import { gridEditRowsStateSelector, isEventTargetInPortal } from '@mui/x-data-grid/internals';
|
|
@@ -65,6 +66,71 @@ function GridRowReorderCell(params) {
|
|
|
65
66
|
})]
|
|
66
67
|
}));
|
|
67
68
|
}
|
|
69
|
+
process.env.NODE_ENV !== "production" ? GridRowReorderCell.propTypes = {
|
|
70
|
+
// ----------------------------- Warning --------------------------------
|
|
71
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
72
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
73
|
+
// ----------------------------------------------------------------------
|
|
74
|
+
/**
|
|
75
|
+
* GridApi that let you manipulate the grid.
|
|
76
|
+
*/
|
|
77
|
+
api: PropTypes.object.isRequired,
|
|
78
|
+
/**
|
|
79
|
+
* The mode of the cell.
|
|
80
|
+
*/
|
|
81
|
+
cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
|
|
82
|
+
/**
|
|
83
|
+
* The column of the row that the current cell belongs to.
|
|
84
|
+
*/
|
|
85
|
+
colDef: PropTypes.object.isRequired,
|
|
86
|
+
/**
|
|
87
|
+
* The column field of the cell that triggered the event.
|
|
88
|
+
*/
|
|
89
|
+
field: PropTypes.string.isRequired,
|
|
90
|
+
/**
|
|
91
|
+
* A ref allowing to set imperative focus.
|
|
92
|
+
* It can be passed to the element that should receive focus.
|
|
93
|
+
* @ignore - do not document.
|
|
94
|
+
*/
|
|
95
|
+
focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
96
|
+
current: PropTypes.shape({
|
|
97
|
+
focus: PropTypes.func.isRequired
|
|
98
|
+
})
|
|
99
|
+
})]),
|
|
100
|
+
/**
|
|
101
|
+
* The cell value formatted with the column valueFormatter.
|
|
102
|
+
*/
|
|
103
|
+
formattedValue: PropTypes.any,
|
|
104
|
+
/**
|
|
105
|
+
* If true, the cell is the active element.
|
|
106
|
+
*/
|
|
107
|
+
hasFocus: PropTypes.bool.isRequired,
|
|
108
|
+
/**
|
|
109
|
+
* The grid row id.
|
|
110
|
+
*/
|
|
111
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
112
|
+
/**
|
|
113
|
+
* If true, the cell is editable.
|
|
114
|
+
*/
|
|
115
|
+
isEditable: PropTypes.bool,
|
|
116
|
+
/**
|
|
117
|
+
* The row model of the row that the current cell belongs to.
|
|
118
|
+
*/
|
|
119
|
+
row: PropTypes.any.isRequired,
|
|
120
|
+
/**
|
|
121
|
+
* The node of the row that the current cell belongs to.
|
|
122
|
+
*/
|
|
123
|
+
rowNode: PropTypes.object.isRequired,
|
|
124
|
+
/**
|
|
125
|
+
* the tabIndex value.
|
|
126
|
+
*/
|
|
127
|
+
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
128
|
+
/**
|
|
129
|
+
* The cell value.
|
|
130
|
+
* If the column has `valueGetter`, use `params.row` to directly access the fields.
|
|
131
|
+
*/
|
|
132
|
+
value: PropTypes.any
|
|
133
|
+
} : void 0;
|
|
68
134
|
export { GridRowReorderCell };
|
|
69
135
|
export const renderRowReorderCell = params => {
|
|
70
136
|
if (params.rowNode.type === 'footer' || params.rowNode.type === 'pinnedRow') {
|
package/esm/components/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import composeClasses from '@mui/utils/composeClasses';
|
|
4
|
-
import {
|
|
4
|
+
import { useRtl } from '@mui/system/RtlProvider';
|
|
5
5
|
import { useGridApiEventHandler, getDataGridUtilityClass, useGridLogger, useGridApiOptionHandler } from '@mui/x-data-grid';
|
|
6
6
|
import { gridColumnReorderDragColSelector } from './columnReorderSelector';
|
|
7
7
|
const CURSOR_MOVE_DIRECTION_LEFT = 'left';
|
|
@@ -42,7 +42,7 @@ export const useGridColumnReorder = (apiRef, props) => {
|
|
|
42
42
|
classes: props.classes
|
|
43
43
|
};
|
|
44
44
|
const classes = useUtilityClasses(ownerState);
|
|
45
|
-
const
|
|
45
|
+
const isRtl = useRtl();
|
|
46
46
|
React.useEffect(() => {
|
|
47
47
|
return () => {
|
|
48
48
|
clearTimeout(removeDnDStylesTimeout.current);
|
|
@@ -152,8 +152,8 @@ export const useGridColumnReorder = (apiRef, props) => {
|
|
|
152
152
|
const visibleColumns = apiRef.current.getVisibleColumns();
|
|
153
153
|
const allColumns = apiRef.current.getAllColumns();
|
|
154
154
|
const cursorMoveDirectionX = getCursorMoveDirectionX(cursorPosition.current, coordinates);
|
|
155
|
-
const hasMovedLeft = cursorMoveDirectionX === CURSOR_MOVE_DIRECTION_LEFT && (
|
|
156
|
-
const hasMovedRight = cursorMoveDirectionX === CURSOR_MOVE_DIRECTION_RIGHT && (
|
|
155
|
+
const hasMovedLeft = cursorMoveDirectionX === CURSOR_MOVE_DIRECTION_LEFT && (isRtl ? dragColIndex < targetColIndex : targetColIndex < dragColIndex);
|
|
156
|
+
const hasMovedRight = cursorMoveDirectionX === CURSOR_MOVE_DIRECTION_RIGHT && (isRtl ? targetColIndex < dragColIndex : dragColIndex < targetColIndex);
|
|
157
157
|
if (hasMovedLeft || hasMovedRight) {
|
|
158
158
|
let canBeReordered;
|
|
159
159
|
let indexOffsetInHiddenColumns = 0;
|
|
@@ -194,7 +194,7 @@ export const useGridColumnReorder = (apiRef, props) => {
|
|
|
194
194
|
}
|
|
195
195
|
cursorPosition.current = coordinates;
|
|
196
196
|
}
|
|
197
|
-
}, [apiRef, logger,
|
|
197
|
+
}, [apiRef, logger, isRtl]);
|
|
198
198
|
const handleDragEnd = React.useCallback((params, event) => {
|
|
199
199
|
const dragColField = gridColumnReorderDragColSelector(apiRef);
|
|
200
200
|
if (props.disableColumnReorder || !dragColField) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { gridFilterModelSelector, gridSortModelSelector, gridPaginationModelSelector } from '@mui/x-data-grid';
|
|
3
|
-
import { createSelector } from '@mui/x-data-grid/internals';
|
|
3
|
+
import { createSelector, createSelectorV8 } from '@mui/x-data-grid/internals';
|
|
4
4
|
const computeStartEnd = paginationModel => {
|
|
5
5
|
const start = paginationModel.page * paginationModel.pageSize;
|
|
6
6
|
const end = start + paginationModel.pageSize - 1;
|
|
@@ -21,4 +21,6 @@ export const gridGetRowsParamsSelector = createSelector(gridFilterModelSelector,
|
|
|
21
21
|
});
|
|
22
22
|
export const gridDataSourceStateSelector = state => state.dataSource;
|
|
23
23
|
export const gridDataSourceLoadingSelector = createSelector(gridDataSourceStateSelector, dataSource => dataSource.loading);
|
|
24
|
-
export const
|
|
24
|
+
export const gridDataSourceLoadingIdSelector = createSelectorV8(gridDataSourceStateSelector, (dataSource, id) => dataSource.loading[id] ?? false);
|
|
25
|
+
export const gridDataSourceErrorsSelector = createSelector(gridDataSourceStateSelector, dataSource => dataSource.errors);
|
|
26
|
+
export const gridDataSourceErrorSelector = createSelectorV8(gridDataSourceStateSelector, (dataSource, id) => dataSource.errors[id]);
|
package/esm/utils/releaseInfo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTcyNDg4MjQwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -8,7 +8,7 @@ exports.useGridColumnReorder = exports.columnReorderStateInitializer = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
11
|
-
var
|
|
11
|
+
var _RtlProvider = require("@mui/system/RtlProvider");
|
|
12
12
|
var _xDataGrid = require("@mui/x-data-grid");
|
|
13
13
|
var _columnReorderSelector = require("./columnReorderSelector");
|
|
14
14
|
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); }
|
|
@@ -52,7 +52,7 @@ const useGridColumnReorder = (apiRef, props) => {
|
|
|
52
52
|
classes: props.classes
|
|
53
53
|
};
|
|
54
54
|
const classes = useUtilityClasses(ownerState);
|
|
55
|
-
const
|
|
55
|
+
const isRtl = (0, _RtlProvider.useRtl)();
|
|
56
56
|
React.useEffect(() => {
|
|
57
57
|
return () => {
|
|
58
58
|
clearTimeout(removeDnDStylesTimeout.current);
|
|
@@ -162,8 +162,8 @@ const useGridColumnReorder = (apiRef, props) => {
|
|
|
162
162
|
const visibleColumns = apiRef.current.getVisibleColumns();
|
|
163
163
|
const allColumns = apiRef.current.getAllColumns();
|
|
164
164
|
const cursorMoveDirectionX = getCursorMoveDirectionX(cursorPosition.current, coordinates);
|
|
165
|
-
const hasMovedLeft = cursorMoveDirectionX === CURSOR_MOVE_DIRECTION_LEFT && (
|
|
166
|
-
const hasMovedRight = cursorMoveDirectionX === CURSOR_MOVE_DIRECTION_RIGHT && (
|
|
165
|
+
const hasMovedLeft = cursorMoveDirectionX === CURSOR_MOVE_DIRECTION_LEFT && (isRtl ? dragColIndex < targetColIndex : targetColIndex < dragColIndex);
|
|
166
|
+
const hasMovedRight = cursorMoveDirectionX === CURSOR_MOVE_DIRECTION_RIGHT && (isRtl ? targetColIndex < dragColIndex : dragColIndex < targetColIndex);
|
|
167
167
|
if (hasMovedLeft || hasMovedRight) {
|
|
168
168
|
let canBeReordered;
|
|
169
169
|
let indexOffsetInHiddenColumns = 0;
|
|
@@ -204,7 +204,7 @@ const useGridColumnReorder = (apiRef, props) => {
|
|
|
204
204
|
}
|
|
205
205
|
cursorPosition.current = coordinates;
|
|
206
206
|
}
|
|
207
|
-
}, [apiRef, logger,
|
|
207
|
+
}, [apiRef, logger, isRtl]);
|
|
208
208
|
const handleDragEnd = React.useCallback((params, event) => {
|
|
209
209
|
const dragColField = (0, _columnReorderSelector.gridColumnReorderDragColSelector)(apiRef);
|
|
210
210
|
if (props.disableColumnReorder || !dragColField) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GridPaginationModel } from '@mui/x-data-grid';
|
|
1
|
+
import { GridPaginationModel, GridRowId } from '@mui/x-data-grid';
|
|
2
2
|
import { GridStatePro } from '../../../models/gridStatePro';
|
|
3
3
|
export declare const gridGetRowsParamsSelector: import("@mui/x-data-grid").OutputSelector<import("@mui/x-data-grid/models/gridStateCommunity").GridStateCommunity, {
|
|
4
4
|
start: number;
|
|
@@ -10,5 +10,7 @@ export declare const gridGetRowsParamsSelector: import("@mui/x-data-grid").Outpu
|
|
|
10
10
|
filterModel: import("@mui/x-data-grid").GridFilterModel;
|
|
11
11
|
}>;
|
|
12
12
|
export declare const gridDataSourceStateSelector: (state: GridStatePro) => import("./interfaces").GridDataSourceState;
|
|
13
|
-
export declare const gridDataSourceLoadingSelector: import("@mui/x-data-grid").OutputSelector<GridStatePro, Record<
|
|
14
|
-
export declare const
|
|
13
|
+
export declare const gridDataSourceLoadingSelector: import("@mui/x-data-grid").OutputSelector<GridStatePro, Record<GridRowId, boolean>>;
|
|
14
|
+
export declare const gridDataSourceLoadingIdSelector: import("@mui/x-data-grid/utils/createSelector").OutputSelectorV8<GridStatePro, GridRowId, boolean>;
|
|
15
|
+
export declare const gridDataSourceErrorsSelector: import("@mui/x-data-grid").OutputSelector<GridStatePro, Record<GridRowId, any>>;
|
|
16
|
+
export declare const gridDataSourceErrorSelector: import("@mui/x-data-grid/utils/createSelector").OutputSelectorV8<GridStatePro, GridRowId, any>;
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.gridGetRowsParamsSelector = exports.gridDataSourceStateSelector = exports.gridDataSourceLoadingSelector = exports.gridDataSourceErrorsSelector = void 0;
|
|
7
|
+
exports.gridGetRowsParamsSelector = exports.gridDataSourceStateSelector = exports.gridDataSourceLoadingSelector = exports.gridDataSourceLoadingIdSelector = exports.gridDataSourceErrorsSelector = exports.gridDataSourceErrorSelector = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _xDataGrid = require("@mui/x-data-grid");
|
|
10
10
|
var _internals = require("@mui/x-data-grid/internals");
|
|
@@ -29,4 +29,6 @@ const gridGetRowsParamsSelector = exports.gridGetRowsParamsSelector = (0, _inter
|
|
|
29
29
|
const gridDataSourceStateSelector = state => state.dataSource;
|
|
30
30
|
exports.gridDataSourceStateSelector = gridDataSourceStateSelector;
|
|
31
31
|
const gridDataSourceLoadingSelector = exports.gridDataSourceLoadingSelector = (0, _internals.createSelector)(gridDataSourceStateSelector, dataSource => dataSource.loading);
|
|
32
|
-
const
|
|
32
|
+
const gridDataSourceLoadingIdSelector = exports.gridDataSourceLoadingIdSelector = (0, _internals.createSelectorV8)(gridDataSourceStateSelector, (dataSource, id) => dataSource.loading[id] ?? false);
|
|
33
|
+
const gridDataSourceErrorsSelector = exports.gridDataSourceErrorsSelector = (0, _internals.createSelector)(gridDataSourceStateSelector, dataSource => dataSource.errors);
|
|
34
|
+
const gridDataSourceErrorSelector = exports.gridDataSourceErrorSelector = (0, _internals.createSelectorV8)(gridDataSourceStateSelector, (dataSource, id) => dataSource.errors[id]);
|
package/index.js
CHANGED
|
@@ -112,7 +112,7 @@ interface DataGridProRegularProps<R extends GridValidRowModel> {
|
|
|
112
112
|
* @param {R} row The row from which we want the path.
|
|
113
113
|
* @returns {string[]} The path to the row.
|
|
114
114
|
*/
|
|
115
|
-
getTreeDataPath?: (row: R) => string[];
|
|
115
|
+
getTreeDataPath?: (row: R) => readonly string[];
|
|
116
116
|
}
|
|
117
117
|
export interface DataGridProPropsWithoutDefaultValue<R extends GridValidRowModel = any> extends Omit<DataGridPropsWithoutDefaultValue<R>, 'initialState' | 'componentsProps' | 'slotProps'>, DataGridProRegularProps<R>, DataGridProDataSourceProps, DataGridProSharedPropsWithoutDefaultValue {
|
|
118
118
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useRtl } from '@mui/system/RtlProvider';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import MenuItem from '@mui/material/MenuItem';
|
|
5
5
|
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
@@ -15,7 +15,7 @@ function GridColumnMenuPinningItem(props) {
|
|
|
15
15
|
} = props;
|
|
16
16
|
const apiRef = useGridApiContext();
|
|
17
17
|
const rootProps = useGridRootProps();
|
|
18
|
-
const
|
|
18
|
+
const isRtl = useRtl();
|
|
19
19
|
const pinColumn = React.useCallback(side => event => {
|
|
20
20
|
apiRef.current.pinColumn(colDef.field, side);
|
|
21
21
|
onClick(event);
|
|
@@ -70,7 +70,7 @@ function GridColumnMenuPinningItem(props) {
|
|
|
70
70
|
})]
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
if (
|
|
73
|
+
if (isRtl) {
|
|
74
74
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
75
75
|
children: [pinToRightMenuItem, pinToLeftMenuItem]
|
|
76
76
|
});
|
|
@@ -4,9 +4,11 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
4
4
|
import Box from '@mui/material/Box';
|
|
5
5
|
import Badge from '@mui/material/Badge';
|
|
6
6
|
import { getDataGridUtilityClass, useGridSelector } from '@mui/x-data-grid';
|
|
7
|
+
import { useGridSelectorV8 } from '@mui/x-data-grid/internals';
|
|
7
8
|
import CircularProgress from '@mui/material/CircularProgress';
|
|
8
9
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
9
10
|
import { useGridPrivateApiContext } from '../hooks/utils/useGridPrivateApiContext';
|
|
11
|
+
import { gridDataSourceErrorSelector, gridDataSourceLoadingIdSelector } from '../hooks/features/dataSource/gridDataSourceSelector';
|
|
10
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
13
|
const useUtilityClasses = ownerState => {
|
|
12
14
|
const {
|
|
@@ -29,10 +31,8 @@ function GridTreeDataGroupingCellIcon(props) {
|
|
|
29
31
|
field,
|
|
30
32
|
descendantCount
|
|
31
33
|
} = props;
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const isDataLoading = useGridSelector(apiRef, loadingSelector);
|
|
35
|
-
const error = useGridSelector(apiRef, errorSelector);
|
|
34
|
+
const isDataLoading = useGridSelectorV8(apiRef, gridDataSourceLoadingIdSelector, id);
|
|
35
|
+
const error = useGridSelectorV8(apiRef, gridDataSourceErrorSelector, id);
|
|
36
36
|
const handleClick = event => {
|
|
37
37
|
if (!rowNode.childrenExpanded) {
|
|
38
38
|
// always fetch/get from cache the children when the node is expanded
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
3
4
|
import composeClasses from '@mui/utils/composeClasses';
|
|
4
5
|
import { gridRowMaximumTreeDepthSelector, gridSortModelSelector, useGridApiContext, useGridSelector, getDataGridUtilityClass } from '@mui/x-data-grid';
|
|
5
6
|
import { gridEditRowsStateSelector, isEventTargetInPortal } from '@mui/x-data-grid/internals';
|
|
@@ -65,6 +66,71 @@ function GridRowReorderCell(params) {
|
|
|
65
66
|
})]
|
|
66
67
|
}));
|
|
67
68
|
}
|
|
69
|
+
process.env.NODE_ENV !== "production" ? GridRowReorderCell.propTypes = {
|
|
70
|
+
// ----------------------------- Warning --------------------------------
|
|
71
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
72
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
73
|
+
// ----------------------------------------------------------------------
|
|
74
|
+
/**
|
|
75
|
+
* GridApi that let you manipulate the grid.
|
|
76
|
+
*/
|
|
77
|
+
api: PropTypes.object.isRequired,
|
|
78
|
+
/**
|
|
79
|
+
* The mode of the cell.
|
|
80
|
+
*/
|
|
81
|
+
cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
|
|
82
|
+
/**
|
|
83
|
+
* The column of the row that the current cell belongs to.
|
|
84
|
+
*/
|
|
85
|
+
colDef: PropTypes.object.isRequired,
|
|
86
|
+
/**
|
|
87
|
+
* The column field of the cell that triggered the event.
|
|
88
|
+
*/
|
|
89
|
+
field: PropTypes.string.isRequired,
|
|
90
|
+
/**
|
|
91
|
+
* A ref allowing to set imperative focus.
|
|
92
|
+
* It can be passed to the element that should receive focus.
|
|
93
|
+
* @ignore - do not document.
|
|
94
|
+
*/
|
|
95
|
+
focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
96
|
+
current: PropTypes.shape({
|
|
97
|
+
focus: PropTypes.func.isRequired
|
|
98
|
+
})
|
|
99
|
+
})]),
|
|
100
|
+
/**
|
|
101
|
+
* The cell value formatted with the column valueFormatter.
|
|
102
|
+
*/
|
|
103
|
+
formattedValue: PropTypes.any,
|
|
104
|
+
/**
|
|
105
|
+
* If true, the cell is the active element.
|
|
106
|
+
*/
|
|
107
|
+
hasFocus: PropTypes.bool.isRequired,
|
|
108
|
+
/**
|
|
109
|
+
* The grid row id.
|
|
110
|
+
*/
|
|
111
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
112
|
+
/**
|
|
113
|
+
* If true, the cell is editable.
|
|
114
|
+
*/
|
|
115
|
+
isEditable: PropTypes.bool,
|
|
116
|
+
/**
|
|
117
|
+
* The row model of the row that the current cell belongs to.
|
|
118
|
+
*/
|
|
119
|
+
row: PropTypes.any.isRequired,
|
|
120
|
+
/**
|
|
121
|
+
* The node of the row that the current cell belongs to.
|
|
122
|
+
*/
|
|
123
|
+
rowNode: PropTypes.object.isRequired,
|
|
124
|
+
/**
|
|
125
|
+
* the tabIndex value.
|
|
126
|
+
*/
|
|
127
|
+
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
128
|
+
/**
|
|
129
|
+
* The cell value.
|
|
130
|
+
* If the column has `valueGetter`, use `params.row` to directly access the fields.
|
|
131
|
+
*/
|
|
132
|
+
value: PropTypes.any
|
|
133
|
+
} : void 0;
|
|
68
134
|
export { GridRowReorderCell };
|
|
69
135
|
export const renderRowReorderCell = params => {
|
|
70
136
|
if (params.rowNode.type === 'footer' || params.rowNode.type === 'pinnedRow') {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import composeClasses from '@mui/utils/composeClasses';
|
|
4
|
-
import {
|
|
4
|
+
import { useRtl } from '@mui/system/RtlProvider';
|
|
5
5
|
import { useGridApiEventHandler, getDataGridUtilityClass, useGridLogger, useGridApiOptionHandler } from '@mui/x-data-grid';
|
|
6
6
|
import { gridColumnReorderDragColSelector } from './columnReorderSelector';
|
|
7
7
|
const CURSOR_MOVE_DIRECTION_LEFT = 'left';
|
|
@@ -42,7 +42,7 @@ export const useGridColumnReorder = (apiRef, props) => {
|
|
|
42
42
|
classes: props.classes
|
|
43
43
|
};
|
|
44
44
|
const classes = useUtilityClasses(ownerState);
|
|
45
|
-
const
|
|
45
|
+
const isRtl = useRtl();
|
|
46
46
|
React.useEffect(() => {
|
|
47
47
|
return () => {
|
|
48
48
|
clearTimeout(removeDnDStylesTimeout.current);
|
|
@@ -152,8 +152,8 @@ export const useGridColumnReorder = (apiRef, props) => {
|
|
|
152
152
|
const visibleColumns = apiRef.current.getVisibleColumns();
|
|
153
153
|
const allColumns = apiRef.current.getAllColumns();
|
|
154
154
|
const cursorMoveDirectionX = getCursorMoveDirectionX(cursorPosition.current, coordinates);
|
|
155
|
-
const hasMovedLeft = cursorMoveDirectionX === CURSOR_MOVE_DIRECTION_LEFT && (
|
|
156
|
-
const hasMovedRight = cursorMoveDirectionX === CURSOR_MOVE_DIRECTION_RIGHT && (
|
|
155
|
+
const hasMovedLeft = cursorMoveDirectionX === CURSOR_MOVE_DIRECTION_LEFT && (isRtl ? dragColIndex < targetColIndex : targetColIndex < dragColIndex);
|
|
156
|
+
const hasMovedRight = cursorMoveDirectionX === CURSOR_MOVE_DIRECTION_RIGHT && (isRtl ? targetColIndex < dragColIndex : dragColIndex < targetColIndex);
|
|
157
157
|
if (hasMovedLeft || hasMovedRight) {
|
|
158
158
|
let canBeReordered;
|
|
159
159
|
let indexOffsetInHiddenColumns = 0;
|
|
@@ -194,7 +194,7 @@ export const useGridColumnReorder = (apiRef, props) => {
|
|
|
194
194
|
}
|
|
195
195
|
cursorPosition.current = coordinates;
|
|
196
196
|
}
|
|
197
|
-
}, [apiRef, logger,
|
|
197
|
+
}, [apiRef, logger, isRtl]);
|
|
198
198
|
const handleDragEnd = React.useCallback((params, event) => {
|
|
199
199
|
const dragColField = gridColumnReorderDragColSelector(apiRef);
|
|
200
200
|
if (props.disableColumnReorder || !dragColField) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { gridFilterModelSelector, gridSortModelSelector, gridPaginationModelSelector } from '@mui/x-data-grid';
|
|
3
|
-
import { createSelector } from '@mui/x-data-grid/internals';
|
|
3
|
+
import { createSelector, createSelectorV8 } from '@mui/x-data-grid/internals';
|
|
4
4
|
const computeStartEnd = paginationModel => {
|
|
5
5
|
const start = paginationModel.page * paginationModel.pageSize;
|
|
6
6
|
const end = start + paginationModel.pageSize - 1;
|
|
@@ -21,4 +21,6 @@ export const gridGetRowsParamsSelector = createSelector(gridFilterModelSelector,
|
|
|
21
21
|
});
|
|
22
22
|
export const gridDataSourceStateSelector = state => state.dataSource;
|
|
23
23
|
export const gridDataSourceLoadingSelector = createSelector(gridDataSourceStateSelector, dataSource => dataSource.loading);
|
|
24
|
-
export const
|
|
24
|
+
export const gridDataSourceLoadingIdSelector = createSelectorV8(gridDataSourceStateSelector, (dataSource, id) => dataSource.loading[id] ?? false);
|
|
25
|
+
export const gridDataSourceErrorsSelector = createSelector(gridDataSourceStateSelector, dataSource => dataSource.errors);
|
|
26
|
+
export const gridDataSourceErrorSelector = createSelectorV8(gridDataSourceStateSelector, (dataSource, id) => dataSource.errors[id]);
|
package/modern/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTcyNDg4MjQwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-pro",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.15.0",
|
|
4
4
|
"description": "The Pro plan edition of the Data Grid components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -33,21 +33,21 @@
|
|
|
33
33
|
"directory": "packages/x-data-grid-pro"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@babel/runtime": "^7.25.
|
|
37
|
-
"@mui/
|
|
38
|
-
"@mui/utils": "^5.16.5",
|
|
36
|
+
"@babel/runtime": "^7.25.4",
|
|
37
|
+
"@mui/utils": "^5.16.6",
|
|
39
38
|
"@types/format-util": "^1.0.4",
|
|
40
39
|
"clsx": "^2.1.1",
|
|
41
40
|
"prop-types": "^15.8.1",
|
|
42
41
|
"reselect": "^4.1.8",
|
|
43
|
-
"@mui/x-
|
|
44
|
-
"@mui/x-
|
|
45
|
-
"@mui/x-license": "7.
|
|
42
|
+
"@mui/x-internals": "7.15.0",
|
|
43
|
+
"@mui/x-data-grid": "7.15.0",
|
|
44
|
+
"@mui/x-license": "7.15.0"
|
|
46
45
|
},
|
|
47
46
|
"peerDependencies": {
|
|
48
47
|
"@emotion/react": "^11.9.0",
|
|
49
48
|
"@emotion/styled": "^11.8.1",
|
|
50
|
-
"@mui/material": "^5.15.14",
|
|
49
|
+
"@mui/material": "^5.15.14 || ^6.0.0",
|
|
50
|
+
"@mui/system": "^5.15.14 || ^6.0.0",
|
|
51
51
|
"react": "^17.0.0 || ^18.0.0",
|
|
52
52
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
53
53
|
},
|
package/utils/releaseInfo.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getReleaseInfo = void 0;
|
|
7
7
|
var _utils = require("@mui/utils");
|
|
8
8
|
const getReleaseInfo = () => {
|
|
9
|
-
const releaseInfo = "
|
|
9
|
+
const releaseInfo = "MTcyNDg4MjQwMDAwMA==";
|
|
10
10
|
if (process.env.NODE_ENV !== 'production') {
|
|
11
11
|
// A simple hack to set the value in the test environment (has no build step).
|
|
12
12
|
// eslint-disable-next-line no-useless-concat
|