@mui/x-date-pickers 6.19.9 → 6.20.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.
@@ -189,14 +189,10 @@ export class AdapterMomentJalaali extends AdapterMoment {
189
189
  return this.moment(value).isSame(comparing);
190
190
  };
191
191
  this.isSameYear = (value, comparing) => {
192
- // `isSame` seems to mutate the date on `moment-jalaali`
193
- // @ts-ignore
194
- return value.clone().isSame(comparing, 'jYear');
192
+ return value.jYear() === comparing.jYear();
195
193
  };
196
194
  this.isSameMonth = (value, comparing) => {
197
- // `isSame` seems to mutate the date on `moment-jalaali`
198
- // @ts-ignore
199
- return value.clone().isSame(comparing, 'jMonth');
195
+ return value.jYear() === comparing.jYear() && value.jMonth() === comparing.jMonth();
200
196
  };
201
197
  this.isAfterYear = (value, comparing) => {
202
198
  return value.jYear() > comparing.jYear();
package/CHANGELOG.md CHANGED
@@ -3,6 +3,110 @@
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.20.0
7
+
8
+ _May 24, 2024_
9
+
10
+ We'd like to offer a big thanks to the 2 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🐞 Bugfixes
13
+
14
+ ### Data Grid
15
+
16
+ #### `@mui/x-data-grid@6.20.0`
17
+
18
+ - [DataGrid] Escape formulas in CSV and Excel export (#13190) @cherniavskii
19
+
20
+ #### `@mui/x-data-grid-pro@6.20.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
21
+
22
+ Same changes as in `@mui/x-data-grid@6.20.0`.
23
+
24
+ #### `@mui/x-data-grid-premium@6.20.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
25
+
26
+ Same changes as in `@mui/x-data-grid-pro@6.20.0`.
27
+
28
+ ### Date Pickers
29
+
30
+ #### `@mui/x-date-pickers@6.20.0`
31
+
32
+ - [pickers] Fix `disableOpenPicker` prop behavior (#13221) @LukasTy
33
+
34
+ #### `@mui/x-date-pickers-pro@6.20.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
35
+
36
+ Same changes as in `@mui/x-date-pickers@6.20.0`.
37
+
38
+ ## 6.19.12
39
+
40
+ _May 17, 2024_
41
+
42
+ We'd like to offer a big thanks to the 2 contributors who made this release possible. Here are some highlights ✨:
43
+
44
+ - 🐞 Bugfixes
45
+
46
+ ### Date Pickers
47
+
48
+ #### `@mui/x-date-pickers@6.19.12`
49
+
50
+ - [pickers] Fix `AdapterMomentJalaali` regression (#13150) @LukasTy
51
+
52
+ #### `@mui/x-date-pickers-pro@6.19.12` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
53
+
54
+ Same changes as in `@mui/x-date-pickers@6.19.12`.
55
+
56
+ ### Docs
57
+
58
+ - [docs] Use MUI X v6 in Codesandbox and Stackblitz demos (#12838) @cherniavskii
59
+
60
+ ## 6.19.11
61
+
62
+ _Apr 18, 2024_
63
+
64
+ We'd like to offer a big thanks to the 1 contributor who made this release possible. Here are some highlights ✨:
65
+
66
+ - 🐞 Bugfixes
67
+
68
+ ### Data Grid
69
+
70
+ #### `@mui/x-data-grid@6.19.11`
71
+
72
+ - [DataGrid] Fix virtualization memory leak (#12812) @romgrk
73
+
74
+ #### `@mui/x-data-grid-pro@6.19.11` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
75
+
76
+ Same changes as in `@mui/x-data-grid@6.19.11`.
77
+
78
+ #### `@mui/x-data-grid-premium@6.19.11` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
79
+
80
+ Same changes as in `@mui/x-data-grid-pro@6.19.11`.
81
+
82
+ ## 6.19.10
83
+
84
+ _Apr 12, 2024_
85
+
86
+ We'd like to offer a big thanks to the 2 contributors who made this release possible. Here are some highlights ✨:
87
+
88
+ - 🐞 Bugfixes
89
+ - 📚 Documentation improvements
90
+
91
+ ### Data Grid
92
+
93
+ #### `@mui/x-data-grid@6.19.10`
94
+
95
+ - [DataGrid] Do not escape double quotes when copying to clipboard (#12734) @cherniavskii
96
+ - [DataGrid] Fix bug in suspense (#12754) @cherniavskii
97
+
98
+ #### `@mui/x-data-grid-pro@6.19.10` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
99
+
100
+ Same changes as in `@mui/x-data-grid@6.19.10`.
101
+
102
+ #### `@mui/x-data-grid-premium@6.19.10` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
103
+
104
+ Same changes as in `@mui/x-data-grid-pro@6.19.10`.
105
+
106
+ ### Core
107
+
108
+ - [core] Update the docs release source branch (#12685) @LukasTy
109
+
6
110
  ## 6.19.9
7
111
 
8
112
  _Apr 5, 2024_
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.19.9
2
+ * @mui/x-date-pickers v6.20.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -115,7 +115,8 @@ export const useDesktopPicker = _ref => {
115
115
  // TODO: Move to `useSlotProps` when https://github.com/mui/material-ui/pull/35088 will be merged
116
116
  if (hasUIView) {
117
117
  fieldProps.InputProps = _extends({}, fieldProps.InputProps, {
118
- ref: containerRef,
118
+ ref: containerRef
119
+ }, !props.disableOpenPicker && {
119
120
  [`${inputAdornmentProps.position}Adornment`]: /*#__PURE__*/_jsx(InputAdornment, _extends({}, inputAdornmentProps, {
120
121
  children: /*#__PURE__*/_jsx(OpenPickerButton, _extends({}, openPickerButtonProps, {
121
122
  children: /*#__PURE__*/_jsx(OpenPickerIcon, _extends({}, innerSlotProps == null ? void 0 : innerSlotProps.openPickerIcon))
@@ -55,7 +55,7 @@ export interface UsePickerViewsNonStaticProps {
55
55
  /**
56
56
  * Props used to handle the value of the pickers.
57
57
  */
58
- export interface UsePickerViewsProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends UsePickerViewsBaseProps<TValue, TDate, TView, TExternalProps, TAdditionalProps>, UsePickerViewsNonStaticProps {
58
+ export interface UsePickerViewsProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends UsePickerViewsBaseProps<TValue, TDate, TView, TExternalProps, TAdditionalProps> {
59
59
  className?: string;
60
60
  sx?: SxProps<Theme>;
61
61
  }
@@ -68,8 +68,7 @@ export interface UsePickerViewParams<TValue, TDate, TView extends DateOrTimeView
68
68
  }
69
69
  export interface UsePickerViewsResponse<TView extends DateOrTimeViewWithMeridiem> {
70
70
  /**
71
- * Does the picker have at least one view that should be rendered in UI mode ?
72
- * If not, we can hide the icon to open the picker.
71
+ * Indicates if the the picker has at least one view that should be rendered in UI.
73
72
  */
74
73
  hasUIView: boolean;
75
74
  renderCurrentView: () => React.ReactNode;
@@ -42,7 +42,6 @@ export const usePickerViews = ({
42
42
  views,
43
43
  openTo,
44
44
  onViewChange,
45
- disableOpenPicker,
46
45
  viewRenderers,
47
46
  timezone
48
47
  } = props;
@@ -67,9 +66,7 @@ export const usePickerViews = ({
67
66
  viewModeLookup
68
67
  } = React.useMemo(() => views.reduce((acc, viewForReduce) => {
69
68
  let viewMode;
70
- if (disableOpenPicker) {
71
- viewMode = 'field';
72
- } else if (viewRenderers[viewForReduce] != null) {
69
+ if (viewRenderers[viewForReduce] != null) {
73
70
  viewMode = 'UI';
74
71
  } else {
75
72
  viewMode = 'field';
@@ -82,7 +79,7 @@ export const usePickerViews = ({
82
79
  }, {
83
80
  hasUIView: false,
84
81
  viewModeLookup: {}
85
- }), [disableOpenPicker, viewRenderers, views]);
82
+ }), [viewRenderers, views]);
86
83
  const timeViewsCount = React.useMemo(() => views.reduce((acc, viewForReduce) => {
87
84
  if (viewRenderers[viewForReduce] != null && isTimeView(viewForReduce)) {
88
85
  return acc + 1;
@@ -201,14 +201,10 @@ export var AdapterMomentJalaali = /*#__PURE__*/function (_AdapterMoment) {
201
201
  return _this.moment(value).isSame(comparing);
202
202
  };
203
203
  _this.isSameYear = function (value, comparing) {
204
- // `isSame` seems to mutate the date on `moment-jalaali`
205
- // @ts-ignore
206
- return value.clone().isSame(comparing, 'jYear');
204
+ return value.jYear() === comparing.jYear();
207
205
  };
208
206
  _this.isSameMonth = function (value, comparing) {
209
- // `isSame` seems to mutate the date on `moment-jalaali`
210
- // @ts-ignore
211
- return value.clone().isSame(comparing, 'jMonth');
207
+ return value.jYear() === comparing.jYear() && value.jMonth() === comparing.jMonth();
212
208
  };
213
209
  _this.isAfterYear = function (value, comparing) {
214
210
  return value.jYear() > comparing.jYear();
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.19.9
2
+ * @mui/x-date-pickers v6.20.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -112,9 +112,9 @@ export var useDesktopPicker = function useDesktopPicker(_ref) {
112
112
 
113
113
  // TODO: Move to `useSlotProps` when https://github.com/mui/material-ui/pull/35088 will be merged
114
114
  if (hasUIView) {
115
- fieldProps.InputProps = _extends({}, fieldProps.InputProps, _defineProperty({
115
+ fieldProps.InputProps = _extends({}, fieldProps.InputProps, {
116
116
  ref: containerRef
117
- }, "".concat(inputAdornmentProps.position, "Adornment"), /*#__PURE__*/_jsx(InputAdornment, _extends({}, inputAdornmentProps, {
117
+ }, !props.disableOpenPicker && _defineProperty({}, "".concat(inputAdornmentProps.position, "Adornment"), /*#__PURE__*/_jsx(InputAdornment, _extends({}, inputAdornmentProps, {
118
118
  children: /*#__PURE__*/_jsx(OpenPickerButton, _extends({}, openPickerButtonProps, {
119
119
  children: /*#__PURE__*/_jsx(OpenPickerIcon, _extends({}, innerSlotProps == null ? void 0 : innerSlotProps.openPickerIcon))
120
120
  }))
@@ -39,7 +39,6 @@ export var usePickerViews = function usePickerViews(_ref) {
39
39
  var views = props.views,
40
40
  openTo = props.openTo,
41
41
  onViewChange = props.onViewChange,
42
- disableOpenPicker = props.disableOpenPicker,
43
42
  viewRenderers = props.viewRenderers,
44
43
  timezone = props.timezone;
45
44
  var className = props.className,
@@ -62,9 +61,7 @@ export var usePickerViews = function usePickerViews(_ref) {
62
61
  var _React$useMemo = React.useMemo(function () {
63
62
  return views.reduce(function (acc, viewForReduce) {
64
63
  var viewMode;
65
- if (disableOpenPicker) {
66
- viewMode = 'field';
67
- } else if (viewRenderers[viewForReduce] != null) {
64
+ if (viewRenderers[viewForReduce] != null) {
68
65
  viewMode = 'UI';
69
66
  } else {
70
67
  viewMode = 'field';
@@ -78,7 +75,7 @@ export var usePickerViews = function usePickerViews(_ref) {
78
75
  hasUIView: false,
79
76
  viewModeLookup: {}
80
77
  });
81
- }, [disableOpenPicker, viewRenderers, views]),
78
+ }, [viewRenderers, views]),
82
79
  hasUIView = _React$useMemo.hasUIView,
83
80
  viewModeLookup = _React$useMemo.viewModeLookup;
84
81
  var timeViewsCount = React.useMemo(function () {
@@ -189,14 +189,10 @@ export class AdapterMomentJalaali extends AdapterMoment {
189
189
  return this.moment(value).isSame(comparing);
190
190
  };
191
191
  this.isSameYear = (value, comparing) => {
192
- // `isSame` seems to mutate the date on `moment-jalaali`
193
- // @ts-ignore
194
- return value.clone().isSame(comparing, 'jYear');
192
+ return value.jYear() === comparing.jYear();
195
193
  };
196
194
  this.isSameMonth = (value, comparing) => {
197
- // `isSame` seems to mutate the date on `moment-jalaali`
198
- // @ts-ignore
199
- return value.clone().isSame(comparing, 'jMonth');
195
+ return value.jYear() === comparing.jYear() && value.jMonth() === comparing.jMonth();
200
196
  };
201
197
  this.isAfterYear = (value, comparing) => {
202
198
  return value.jYear() > comparing.jYear();
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.19.9
2
+ * @mui/x-date-pickers v6.20.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -114,7 +114,8 @@ export const useDesktopPicker = _ref => {
114
114
  // TODO: Move to `useSlotProps` when https://github.com/mui/material-ui/pull/35088 will be merged
115
115
  if (hasUIView) {
116
116
  fieldProps.InputProps = _extends({}, fieldProps.InputProps, {
117
- ref: containerRef,
117
+ ref: containerRef
118
+ }, !props.disableOpenPicker && {
118
119
  [`${inputAdornmentProps.position}Adornment`]: /*#__PURE__*/_jsx(InputAdornment, _extends({}, inputAdornmentProps, {
119
120
  children: /*#__PURE__*/_jsx(OpenPickerButton, _extends({}, openPickerButtonProps, {
120
121
  children: /*#__PURE__*/_jsx(OpenPickerIcon, _extends({}, innerSlotProps?.openPickerIcon))
@@ -42,7 +42,6 @@ export const usePickerViews = ({
42
42
  views,
43
43
  openTo,
44
44
  onViewChange,
45
- disableOpenPicker,
46
45
  viewRenderers,
47
46
  timezone
48
47
  } = props;
@@ -67,9 +66,7 @@ export const usePickerViews = ({
67
66
  viewModeLookup
68
67
  } = React.useMemo(() => views.reduce((acc, viewForReduce) => {
69
68
  let viewMode;
70
- if (disableOpenPicker) {
71
- viewMode = 'field';
72
- } else if (viewRenderers[viewForReduce] != null) {
69
+ if (viewRenderers[viewForReduce] != null) {
73
70
  viewMode = 'UI';
74
71
  } else {
75
72
  viewMode = 'field';
@@ -82,7 +79,7 @@ export const usePickerViews = ({
82
79
  }, {
83
80
  hasUIView: false,
84
81
  viewModeLookup: {}
85
- }), [disableOpenPicker, viewRenderers, views]);
82
+ }), [viewRenderers, views]);
86
83
  const timeViewsCount = React.useMemo(() => views.reduce((acc, viewForReduce) => {
87
84
  if (viewRenderers[viewForReduce] != null && isTimeView(viewForReduce)) {
88
85
  return acc + 1;
@@ -197,14 +197,10 @@ class AdapterMomentJalaali extends _AdapterMoment.AdapterMoment {
197
197
  return this.moment(value).isSame(comparing);
198
198
  };
199
199
  this.isSameYear = (value, comparing) => {
200
- // `isSame` seems to mutate the date on `moment-jalaali`
201
- // @ts-ignore
202
- return value.clone().isSame(comparing, 'jYear');
200
+ return value.jYear() === comparing.jYear();
203
201
  };
204
202
  this.isSameMonth = (value, comparing) => {
205
- // `isSame` seems to mutate the date on `moment-jalaali`
206
- // @ts-ignore
207
- return value.clone().isSame(comparing, 'jMonth');
203
+ return value.jYear() === comparing.jYear() && value.jMonth() === comparing.jMonth();
208
204
  };
209
205
  this.isAfterYear = (value, comparing) => {
210
206
  return value.jYear() > comparing.jYear();
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.19.9
2
+ * @mui/x-date-pickers v6.20.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -122,7 +122,8 @@ const useDesktopPicker = _ref => {
122
122
  // TODO: Move to `useSlotProps` when https://github.com/mui/material-ui/pull/35088 will be merged
123
123
  if (hasUIView) {
124
124
  fieldProps.InputProps = (0, _extends2.default)({}, fieldProps.InputProps, {
125
- ref: containerRef,
125
+ ref: containerRef
126
+ }, !props.disableOpenPicker && {
126
127
  [`${inputAdornmentProps.position}Adornment`]: /*#__PURE__*/(0, _jsxRuntime.jsx)(InputAdornment, (0, _extends2.default)({}, inputAdornmentProps, {
127
128
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(OpenPickerButton, (0, _extends2.default)({}, openPickerButtonProps, {
128
129
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(OpenPickerIcon, (0, _extends2.default)({}, innerSlotProps?.openPickerIcon))
@@ -50,7 +50,6 @@ const usePickerViews = ({
50
50
  views,
51
51
  openTo,
52
52
  onViewChange,
53
- disableOpenPicker,
54
53
  viewRenderers,
55
54
  timezone
56
55
  } = props;
@@ -75,9 +74,7 @@ const usePickerViews = ({
75
74
  viewModeLookup
76
75
  } = React.useMemo(() => views.reduce((acc, viewForReduce) => {
77
76
  let viewMode;
78
- if (disableOpenPicker) {
79
- viewMode = 'field';
80
- } else if (viewRenderers[viewForReduce] != null) {
77
+ if (viewRenderers[viewForReduce] != null) {
81
78
  viewMode = 'UI';
82
79
  } else {
83
80
  viewMode = 'field';
@@ -90,7 +87,7 @@ const usePickerViews = ({
90
87
  }, {
91
88
  hasUIView: false,
92
89
  viewModeLookup: {}
93
- }), [disableOpenPicker, viewRenderers, views]);
90
+ }), [viewRenderers, views]);
94
91
  const timeViewsCount = React.useMemo(() => views.reduce((acc, viewForReduce) => {
95
92
  if (viewRenderers[viewForReduce] != null && (0, _timeUtils.isTimeView)(viewForReduce)) {
96
93
  return acc + 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-date-pickers",
3
- "version": "6.19.9",
3
+ "version": "6.20.0",
4
4
  "description": "The community edition of the date picker components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",