@mui/x-date-pickers 8.11.2 → 8.11.3
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 +86 -0
- package/DateField/DateField.js +6 -3
- package/DateTimeField/DateTimeField.js +6 -3
- package/TimeField/TimeField.js +6 -3
- package/esm/DateField/DateField.js +7 -4
- package/esm/DateTimeField/DateTimeField.js +7 -4
- package/esm/TimeField/TimeField.js +7 -4
- package/esm/index.js +1 -1
- package/esm/internals/components/PickerFieldUI.d.ts +0 -10
- package/esm/internals/components/PickerFieldUI.js +12 -10
- package/esm/internals/hooks/useDesktopPicker/useDesktopPicker.js +10 -12
- package/esm/internals/hooks/useMobilePicker/useMobilePicker.js +10 -12
- package/index.js +1 -1
- package/internals/components/PickerFieldUI.d.ts +0 -10
- package/internals/components/PickerFieldUI.js +12 -10
- package/internals/hooks/useDesktopPicker/useDesktopPicker.js +10 -12
- package/internals/hooks/useMobilePicker/useMobilePicker.js +10 -12
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,92 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.11.3
|
|
9
|
+
|
|
10
|
+
_Sep 16, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
|
|
17
|
+
Special thanks go out to the community members for their valuable contributions:
|
|
18
|
+
@sai6855
|
|
19
|
+
|
|
20
|
+
The following are all team members who have contributed to this release:
|
|
21
|
+
@alexfauquette, @bernardobelchior, @brijeshb42, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @LukasTy, @rita-codes, @siriwatknp
|
|
22
|
+
|
|
23
|
+
### Data Grid
|
|
24
|
+
|
|
25
|
+
#### `@mui/x-data-grid@8.11.3`
|
|
26
|
+
|
|
27
|
+
- [DataGrid] Fix numeric font size not being applied (#19552) @cherniavskii
|
|
28
|
+
- [DataGrid] Improve `operator` types to display literal values (#19529) @siriwatknp
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-data-grid-pro@8.11.3` [](https://mui.com/r/x-pro-svg-link "Pro plan")
|
|
31
|
+
|
|
32
|
+
Same changes as in `@mui/x-data-grid@8.11.3`.
|
|
33
|
+
|
|
34
|
+
#### `@mui/x-data-grid-premium@8.11.3` [](https://mui.com/r/x-premium-svg-link "Premium plan")
|
|
35
|
+
|
|
36
|
+
Same changes as in `@mui/x-data-grid-pro@8.11.3`.
|
|
37
|
+
|
|
38
|
+
### Date and Time Pickers
|
|
39
|
+
|
|
40
|
+
#### `@mui/x-date-pickers@8.11.3`
|
|
41
|
+
|
|
42
|
+
- [pickers] Refactor `slots` and `slotProps` propagation strategy (#18867) @LukasTy
|
|
43
|
+
|
|
44
|
+
#### `@mui/x-date-pickers-pro@8.11.3` [](https://mui.com/r/x-pro-svg-link "Pro plan")
|
|
45
|
+
|
|
46
|
+
Same changes as in `@mui/x-date-pickers@8.11.3`.
|
|
47
|
+
|
|
48
|
+
### Charts
|
|
49
|
+
|
|
50
|
+
#### `@mui/x-charts@8.11.3`
|
|
51
|
+
|
|
52
|
+
- [charts] Add `inline-` piecewise legend options (#19382) @JCQuintas
|
|
53
|
+
- [charts] Add bar gradient example (#19174) @bernardobelchior
|
|
54
|
+
- [charts] Ignore empty tick labels in label overlap computation (#19547) @alexfauquette
|
|
55
|
+
- [charts] Rename `isBandScale` to `isDiscreteScale` (#19514) @bernardobelchior
|
|
56
|
+
- [charts] Fix legend position affecting toolbar's position (#19257) @sai6855
|
|
57
|
+
|
|
58
|
+
#### `@mui/x-charts-pro@8.11.3` [](https://mui.com/r/x-pro-svg-link "Pro plan")
|
|
59
|
+
|
|
60
|
+
Same changes as in `@mui/x-charts@8.11.3`, plus:
|
|
61
|
+
|
|
62
|
+
- [charts-pro] Add chart title and caption to export demo (#19524) @bernardobelchior
|
|
63
|
+
|
|
64
|
+
### Tree View
|
|
65
|
+
|
|
66
|
+
#### `@mui/x-tree-view@8.11.3`
|
|
67
|
+
|
|
68
|
+
- [tree view] Stop looping through all items to publish the `removeItem` event (#19500) @flaviendelangle
|
|
69
|
+
- [tree view] Support flat DOM structure (#19350) @flaviendelangle
|
|
70
|
+
- [tree view] Update cursor styles for disabled TreeItem (#19548) @sai6855
|
|
71
|
+
|
|
72
|
+
#### `@mui/x-tree-view-pro@8.11.3` [](https://mui.com/r/x-pro-svg-link "Pro plan")
|
|
73
|
+
|
|
74
|
+
Same changes as in `@mui/x-tree-view@8.11.3`.
|
|
75
|
+
|
|
76
|
+
### Codemod
|
|
77
|
+
|
|
78
|
+
#### `@mui/x-codemod@8.11.3`
|
|
79
|
+
|
|
80
|
+
Internal changes.
|
|
81
|
+
|
|
82
|
+
### Docs
|
|
83
|
+
|
|
84
|
+
- [docs] Add styling row group recipe (#19349) @siriwatknp
|
|
85
|
+
- [docs] Group demos data into the dataset folder (#19549) @alexfauquette
|
|
86
|
+
- [docs] Add `shiny` bar chart example at the top (#19416) @JCQuintas
|
|
87
|
+
|
|
88
|
+
### Core
|
|
89
|
+
|
|
90
|
+
- [code-infra] Axios update (#19577) @Janpot
|
|
91
|
+
- [code-infra] Remove usage of copy-files command from code-infra (#19518) @brijeshb42
|
|
92
|
+
- [internal] Fix naming to match convention @oliviertassinari
|
|
93
|
+
|
|
8
94
|
## 8.11.2
|
|
9
95
|
|
|
10
96
|
_Sep 10, 2025_
|
package/DateField/DateField.js
CHANGED
|
@@ -43,11 +43,14 @@ const DateField = exports.DateField = /*#__PURE__*/React.forwardRef(function Dat
|
|
|
43
43
|
externalForwardedProps: other
|
|
44
44
|
});
|
|
45
45
|
const fieldResponse = (0, _useDateField.useDateField)(textFieldProps);
|
|
46
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PickerFieldUI.
|
|
46
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PickerFieldUI.PickerFieldUIContextProvider, {
|
|
47
47
|
slots: slots,
|
|
48
48
|
slotProps: slotProps,
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
inputRef: other.inputRef,
|
|
50
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PickerFieldUI.PickerFieldUI, {
|
|
51
|
+
fieldResponse: fieldResponse,
|
|
52
|
+
defaultOpenPickerIcon: _icons.CalendarIcon
|
|
53
|
+
})
|
|
51
54
|
});
|
|
52
55
|
});
|
|
53
56
|
if (process.env.NODE_ENV !== "production") DateField.displayName = "DateField";
|
|
@@ -43,11 +43,14 @@ const DateTimeField = exports.DateTimeField = /*#__PURE__*/React.forwardRef(func
|
|
|
43
43
|
externalForwardedProps: other
|
|
44
44
|
});
|
|
45
45
|
const fieldResponse = (0, _useDateTimeField.useDateTimeField)(textFieldProps);
|
|
46
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PickerFieldUI.
|
|
46
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PickerFieldUI.PickerFieldUIContextProvider, {
|
|
47
47
|
slots: slots,
|
|
48
48
|
slotProps: slotProps,
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
inputRef: other.inputRef,
|
|
50
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PickerFieldUI.PickerFieldUI, {
|
|
51
|
+
fieldResponse: fieldResponse,
|
|
52
|
+
defaultOpenPickerIcon: _icons.CalendarIcon
|
|
53
|
+
})
|
|
51
54
|
});
|
|
52
55
|
});
|
|
53
56
|
if (process.env.NODE_ENV !== "production") DateTimeField.displayName = "DateTimeField";
|
package/TimeField/TimeField.js
CHANGED
|
@@ -43,11 +43,14 @@ const TimeField = exports.TimeField = /*#__PURE__*/React.forwardRef(function Tim
|
|
|
43
43
|
externalForwardedProps: other
|
|
44
44
|
});
|
|
45
45
|
const fieldResponse = (0, _useTimeField.useTimeField)(textFieldProps);
|
|
46
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PickerFieldUI.
|
|
46
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PickerFieldUI.PickerFieldUIContextProvider, {
|
|
47
47
|
slots: slots,
|
|
48
48
|
slotProps: slotProps,
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
inputRef: other.inputRef,
|
|
50
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PickerFieldUI.PickerFieldUI, {
|
|
51
|
+
fieldResponse: fieldResponse,
|
|
52
|
+
defaultOpenPickerIcon: _icons.ClockIcon
|
|
53
|
+
})
|
|
51
54
|
});
|
|
52
55
|
});
|
|
53
56
|
if (process.env.NODE_ENV !== "production") TimeField.displayName = "TimeField";
|
|
@@ -7,7 +7,7 @@ import PropTypes from 'prop-types';
|
|
|
7
7
|
import { useThemeProps } from '@mui/material/styles';
|
|
8
8
|
import refType from '@mui/utils/refType';
|
|
9
9
|
import { useDateField } from "./useDateField.js";
|
|
10
|
-
import { PickerFieldUI, useFieldTextFieldProps } from "../internals/components/PickerFieldUI.js";
|
|
10
|
+
import { PickerFieldUI, PickerFieldUIContextProvider, useFieldTextFieldProps } from "../internals/components/PickerFieldUI.js";
|
|
11
11
|
import { CalendarIcon } from "../icons/index.js";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
/**
|
|
@@ -36,11 +36,14 @@ const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, inRe
|
|
|
36
36
|
externalForwardedProps: other
|
|
37
37
|
});
|
|
38
38
|
const fieldResponse = useDateField(textFieldProps);
|
|
39
|
-
return /*#__PURE__*/_jsx(
|
|
39
|
+
return /*#__PURE__*/_jsx(PickerFieldUIContextProvider, {
|
|
40
40
|
slots: slots,
|
|
41
41
|
slotProps: slotProps,
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
inputRef: other.inputRef,
|
|
43
|
+
children: /*#__PURE__*/_jsx(PickerFieldUI, {
|
|
44
|
+
fieldResponse: fieldResponse,
|
|
45
|
+
defaultOpenPickerIcon: CalendarIcon
|
|
46
|
+
})
|
|
44
47
|
});
|
|
45
48
|
});
|
|
46
49
|
if (process.env.NODE_ENV !== "production") DateField.displayName = "DateField";
|
|
@@ -7,7 +7,7 @@ import PropTypes from 'prop-types';
|
|
|
7
7
|
import { useThemeProps } from '@mui/material/styles';
|
|
8
8
|
import refType from '@mui/utils/refType';
|
|
9
9
|
import { useDateTimeField } from "./useDateTimeField.js";
|
|
10
|
-
import { PickerFieldUI, useFieldTextFieldProps } from "../internals/components/PickerFieldUI.js";
|
|
10
|
+
import { PickerFieldUI, PickerFieldUIContextProvider, useFieldTextFieldProps } from "../internals/components/PickerFieldUI.js";
|
|
11
11
|
import { CalendarIcon } from "../icons/index.js";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
/**
|
|
@@ -36,11 +36,14 @@ const DateTimeField = /*#__PURE__*/React.forwardRef(function DateTimeField(inPro
|
|
|
36
36
|
externalForwardedProps: other
|
|
37
37
|
});
|
|
38
38
|
const fieldResponse = useDateTimeField(textFieldProps);
|
|
39
|
-
return /*#__PURE__*/_jsx(
|
|
39
|
+
return /*#__PURE__*/_jsx(PickerFieldUIContextProvider, {
|
|
40
40
|
slots: slots,
|
|
41
41
|
slotProps: slotProps,
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
inputRef: other.inputRef,
|
|
43
|
+
children: /*#__PURE__*/_jsx(PickerFieldUI, {
|
|
44
|
+
fieldResponse: fieldResponse,
|
|
45
|
+
defaultOpenPickerIcon: CalendarIcon
|
|
46
|
+
})
|
|
44
47
|
});
|
|
45
48
|
});
|
|
46
49
|
if (process.env.NODE_ENV !== "production") DateTimeField.displayName = "DateTimeField";
|
|
@@ -7,7 +7,7 @@ import PropTypes from 'prop-types';
|
|
|
7
7
|
import { useThemeProps } from '@mui/material/styles';
|
|
8
8
|
import refType from '@mui/utils/refType';
|
|
9
9
|
import { useTimeField } from "./useTimeField.js";
|
|
10
|
-
import { PickerFieldUI, useFieldTextFieldProps } from "../internals/components/PickerFieldUI.js";
|
|
10
|
+
import { PickerFieldUI, PickerFieldUIContextProvider, useFieldTextFieldProps } from "../internals/components/PickerFieldUI.js";
|
|
11
11
|
import { ClockIcon } from "../icons/index.js";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
/**
|
|
@@ -36,11 +36,14 @@ const TimeField = /*#__PURE__*/React.forwardRef(function TimeField(inProps, inRe
|
|
|
36
36
|
externalForwardedProps: other
|
|
37
37
|
});
|
|
38
38
|
const fieldResponse = useTimeField(textFieldProps);
|
|
39
|
-
return /*#__PURE__*/_jsx(
|
|
39
|
+
return /*#__PURE__*/_jsx(PickerFieldUIContextProvider, {
|
|
40
40
|
slots: slots,
|
|
41
41
|
slotProps: slotProps,
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
inputRef: other.inputRef,
|
|
43
|
+
children: /*#__PURE__*/_jsx(PickerFieldUI, {
|
|
44
|
+
fieldResponse: fieldResponse,
|
|
45
|
+
defaultOpenPickerIcon: ClockIcon
|
|
46
|
+
})
|
|
44
47
|
});
|
|
45
48
|
});
|
|
46
49
|
if (process.env.NODE_ENV !== "production") TimeField.displayName = "TimeField";
|
package/esm/index.js
CHANGED
|
@@ -47,16 +47,6 @@ export interface ExportedPickerFieldUIProps {
|
|
|
47
47
|
openPickerButtonPosition?: 'start' | 'end';
|
|
48
48
|
}
|
|
49
49
|
export interface PickerFieldUIProps<TEnableAccessibleFieldDOMStructure extends boolean, TProps extends UseFieldProps<TEnableAccessibleFieldDOMStructure>> {
|
|
50
|
-
/**
|
|
51
|
-
* Overridable component slots.
|
|
52
|
-
* @default {}
|
|
53
|
-
*/
|
|
54
|
-
slots?: PickerFieldUISlots;
|
|
55
|
-
/**
|
|
56
|
-
* The props used for each component slot.
|
|
57
|
-
* @default {}
|
|
58
|
-
*/
|
|
59
|
-
slotProps?: PickerFieldUISlotProps;
|
|
60
50
|
/**
|
|
61
51
|
* Object returned by the `useField` hook or one of its wrapper (for example `useDateField`).
|
|
62
52
|
*/
|
|
@@ -123,8 +123,6 @@ export const PickerFieldUIContext = /*#__PURE__*/React.createContext({
|
|
|
123
123
|
if (process.env.NODE_ENV !== "production") PickerFieldUIContext.displayName = "PickerFieldUIContext";
|
|
124
124
|
export function PickerFieldUI(props) {
|
|
125
125
|
const {
|
|
126
|
-
slots,
|
|
127
|
-
slotProps,
|
|
128
126
|
fieldResponse,
|
|
129
127
|
defaultOpenPickerIcon
|
|
130
128
|
} = props;
|
|
@@ -147,11 +145,11 @@ export function PickerFieldUI(props) {
|
|
|
147
145
|
const triggerStatus = pickerContext ? pickerContext.triggerStatus : 'hidden';
|
|
148
146
|
const clearButtonPosition = clearable ? clearButtonPositionProp : null;
|
|
149
147
|
const openPickerButtonPosition = triggerStatus !== 'hidden' ? openPickerButtonPositionProp : null;
|
|
150
|
-
const TextField =
|
|
151
|
-
const InputAdornment =
|
|
148
|
+
const TextField = pickerFieldUIContext.slots.textField ?? (fieldResponse.enableAccessibleFieldDOMStructure === false ? MuiTextField : PickersTextField);
|
|
149
|
+
const InputAdornment = pickerFieldUIContext.slots.inputAdornment ?? MuiInputAdornment;
|
|
152
150
|
const _useSlotProps = useSlotProps({
|
|
153
151
|
elementType: InputAdornment,
|
|
154
|
-
externalSlotProps:
|
|
152
|
+
externalSlotProps: pickerFieldUIContext.slotProps.inputAdornment,
|
|
155
153
|
additionalProps: {
|
|
156
154
|
position: 'start'
|
|
157
155
|
},
|
|
@@ -162,7 +160,7 @@ export function PickerFieldUI(props) {
|
|
|
162
160
|
startInputAdornmentProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded4);
|
|
163
161
|
const _useSlotProps2 = useSlotProps({
|
|
164
162
|
elementType: InputAdornment,
|
|
165
|
-
externalSlotProps:
|
|
163
|
+
externalSlotProps: pickerFieldUIContext.slotProps.inputAdornment,
|
|
166
164
|
additionalProps: {
|
|
167
165
|
position: 'end'
|
|
168
166
|
},
|
|
@@ -193,11 +191,11 @@ export function PickerFieldUI(props) {
|
|
|
193
191
|
externalSlotProps: pickerFieldUIContext.slotProps.openPickerIcon,
|
|
194
192
|
ownerState
|
|
195
193
|
});
|
|
196
|
-
const ClearButton =
|
|
194
|
+
const ClearButton = pickerFieldUIContext.slots.clearButton ?? MuiIconButton;
|
|
197
195
|
// We don't want to forward the `ownerState` to the `<IconButton />` component, see mui/material-ui#34056
|
|
198
196
|
const _useSlotProps4 = useSlotProps({
|
|
199
197
|
elementType: ClearButton,
|
|
200
|
-
externalSlotProps:
|
|
198
|
+
externalSlotProps: pickerFieldUIContext.slotProps.clearButton,
|
|
201
199
|
className: 'clearButton',
|
|
202
200
|
additionalProps: {
|
|
203
201
|
title: translations.fieldClearLabel,
|
|
@@ -211,10 +209,10 @@ export function PickerFieldUI(props) {
|
|
|
211
209
|
ownerState
|
|
212
210
|
}),
|
|
213
211
|
clearButtonProps = _objectWithoutPropertiesLoose(_useSlotProps4, _excluded7);
|
|
214
|
-
const ClearIcon =
|
|
212
|
+
const ClearIcon = pickerFieldUIContext.slots.clearIcon ?? MuiClearIcon;
|
|
215
213
|
const clearIconProps = useSlotProps({
|
|
216
214
|
elementType: ClearIcon,
|
|
217
|
-
externalSlotProps:
|
|
215
|
+
externalSlotProps: pickerFieldUIContext.slotProps.clearIcon,
|
|
218
216
|
additionalProps: {
|
|
219
217
|
fontSize: 'small'
|
|
220
218
|
},
|
|
@@ -244,6 +242,10 @@ export function PickerFieldUI(props) {
|
|
|
244
242
|
}))]
|
|
245
243
|
}));
|
|
246
244
|
}
|
|
245
|
+
// handle the case of showing custom `inputAdornment` for Field components
|
|
246
|
+
if (!additionalTextFieldInputProps?.endAdornment && !additionalTextFieldInputProps?.startAdornment && pickerFieldUIContext.slots.inputAdornment) {
|
|
247
|
+
additionalTextFieldInputProps.endAdornment = /*#__PURE__*/_jsx(InputAdornment, _extends({}, endInputAdornmentProps));
|
|
248
|
+
}
|
|
247
249
|
if (clearButtonPosition != null) {
|
|
248
250
|
textFieldProps.sx = [{
|
|
249
251
|
'& .clearButton': {
|
|
@@ -8,7 +8,6 @@ import { PickerPopper } from "../../components/PickerPopper/PickerPopper.js";
|
|
|
8
8
|
import { usePicker } from "../usePicker/index.js";
|
|
9
9
|
import { PickersLayout } from "../../../PickersLayout/index.js";
|
|
10
10
|
import { PickerProvider } from "../../components/PickerProvider.js";
|
|
11
|
-
import { PickerFieldUIContextProvider } from "../../components/PickerFieldUI.js";
|
|
12
11
|
import { createNonRangePickerStepNavigation } from "../../utils/createNonRangePickerStepNavigation.js";
|
|
13
12
|
|
|
14
13
|
/**
|
|
@@ -75,21 +74,20 @@ export const useDesktopPicker = _ref => {
|
|
|
75
74
|
'aria-labelledby': labelledById
|
|
76
75
|
}, innerSlotProps?.popper)
|
|
77
76
|
});
|
|
78
|
-
const renderPicker = () => /*#__PURE__*/
|
|
79
|
-
children: /*#__PURE__*/
|
|
77
|
+
const renderPicker = () => /*#__PURE__*/_jsxs(PickerProvider, _extends({}, providerProps, {
|
|
78
|
+
children: [/*#__PURE__*/_jsx(Field, _extends({}, fieldProps, {
|
|
80
79
|
slots: slots,
|
|
81
80
|
slotProps: slotProps,
|
|
82
|
-
inputRef: inputRef
|
|
83
|
-
|
|
81
|
+
inputRef: inputRef
|
|
82
|
+
})), /*#__PURE__*/_jsx(PickerPopper, {
|
|
83
|
+
slots: slots,
|
|
84
|
+
slotProps: slotProps,
|
|
85
|
+
children: /*#__PURE__*/_jsx(Layout, _extends({}, slotProps?.layout, {
|
|
84
86
|
slots: slots,
|
|
85
87
|
slotProps: slotProps,
|
|
86
|
-
children:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
children: renderCurrentView()
|
|
90
|
-
}))
|
|
91
|
-
})]
|
|
92
|
-
})
|
|
88
|
+
children: renderCurrentView()
|
|
89
|
+
}))
|
|
90
|
+
})]
|
|
93
91
|
}));
|
|
94
92
|
if (process.env.NODE_ENV !== "production") renderPicker.displayName = "renderPicker";
|
|
95
93
|
return {
|
|
@@ -8,7 +8,6 @@ import { PickersModalDialog } from "../../components/PickersModalDialog.js";
|
|
|
8
8
|
import { usePicker } from "../usePicker/index.js";
|
|
9
9
|
import { PickersLayout } from "../../../PickersLayout/index.js";
|
|
10
10
|
import { PickerProvider } from "../../components/PickerProvider.js";
|
|
11
|
-
import { PickerFieldUIContextProvider } from "../../components/PickerFieldUI.js";
|
|
12
11
|
import { createNonRangePickerStepNavigation } from "../../utils/createNonRangePickerStepNavigation.js";
|
|
13
12
|
|
|
14
13
|
/**
|
|
@@ -75,21 +74,20 @@ export const useMobilePicker = _ref => {
|
|
|
75
74
|
'aria-labelledby': labelledById
|
|
76
75
|
}, innerSlotProps?.mobilePaper)
|
|
77
76
|
});
|
|
78
|
-
const renderPicker = () => /*#__PURE__*/
|
|
79
|
-
children: /*#__PURE__*/
|
|
77
|
+
const renderPicker = () => /*#__PURE__*/_jsxs(PickerProvider, _extends({}, providerProps, {
|
|
78
|
+
children: [/*#__PURE__*/_jsx(Field, _extends({}, fieldProps, {
|
|
80
79
|
slots: slots,
|
|
81
80
|
slotProps: slotProps,
|
|
82
|
-
inputRef: inputRef
|
|
83
|
-
|
|
81
|
+
inputRef: inputRef
|
|
82
|
+
})), /*#__PURE__*/_jsx(PickersModalDialog, {
|
|
83
|
+
slots: slots,
|
|
84
|
+
slotProps: slotProps,
|
|
85
|
+
children: /*#__PURE__*/_jsx(Layout, _extends({}, slotProps?.layout, {
|
|
84
86
|
slots: slots,
|
|
85
87
|
slotProps: slotProps,
|
|
86
|
-
children:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
children: renderCurrentView()
|
|
90
|
-
}))
|
|
91
|
-
})]
|
|
92
|
-
})
|
|
88
|
+
children: renderCurrentView()
|
|
89
|
+
}))
|
|
90
|
+
})]
|
|
93
91
|
}));
|
|
94
92
|
if (process.env.NODE_ENV !== "production") renderPicker.displayName = "renderPicker";
|
|
95
93
|
return {
|
package/index.js
CHANGED
|
@@ -47,16 +47,6 @@ export interface ExportedPickerFieldUIProps {
|
|
|
47
47
|
openPickerButtonPosition?: 'start' | 'end';
|
|
48
48
|
}
|
|
49
49
|
export interface PickerFieldUIProps<TEnableAccessibleFieldDOMStructure extends boolean, TProps extends UseFieldProps<TEnableAccessibleFieldDOMStructure>> {
|
|
50
|
-
/**
|
|
51
|
-
* Overridable component slots.
|
|
52
|
-
* @default {}
|
|
53
|
-
*/
|
|
54
|
-
slots?: PickerFieldUISlots;
|
|
55
|
-
/**
|
|
56
|
-
* The props used for each component slot.
|
|
57
|
-
* @default {}
|
|
58
|
-
*/
|
|
59
|
-
slotProps?: PickerFieldUISlotProps;
|
|
60
50
|
/**
|
|
61
51
|
* Object returned by the `useField` hook or one of its wrapper (for example `useDateField`).
|
|
62
52
|
*/
|
|
@@ -136,8 +136,6 @@ const PickerFieldUIContext = exports.PickerFieldUIContext = /*#__PURE__*/React.c
|
|
|
136
136
|
if (process.env.NODE_ENV !== "production") PickerFieldUIContext.displayName = "PickerFieldUIContext";
|
|
137
137
|
function PickerFieldUI(props) {
|
|
138
138
|
const {
|
|
139
|
-
slots,
|
|
140
|
-
slotProps,
|
|
141
139
|
fieldResponse,
|
|
142
140
|
defaultOpenPickerIcon
|
|
143
141
|
} = props;
|
|
@@ -160,11 +158,11 @@ function PickerFieldUI(props) {
|
|
|
160
158
|
const triggerStatus = pickerContext ? pickerContext.triggerStatus : 'hidden';
|
|
161
159
|
const clearButtonPosition = clearable ? clearButtonPositionProp : null;
|
|
162
160
|
const openPickerButtonPosition = triggerStatus !== 'hidden' ? openPickerButtonPositionProp : null;
|
|
163
|
-
const TextField =
|
|
164
|
-
const InputAdornment =
|
|
161
|
+
const TextField = pickerFieldUIContext.slots.textField ?? (fieldResponse.enableAccessibleFieldDOMStructure === false ? _TextField.default : _PickersTextField.PickersTextField);
|
|
162
|
+
const InputAdornment = pickerFieldUIContext.slots.inputAdornment ?? _InputAdornment.default;
|
|
165
163
|
const _useSlotProps = (0, _useSlotProps5.default)({
|
|
166
164
|
elementType: InputAdornment,
|
|
167
|
-
externalSlotProps:
|
|
165
|
+
externalSlotProps: pickerFieldUIContext.slotProps.inputAdornment,
|
|
168
166
|
additionalProps: {
|
|
169
167
|
position: 'start'
|
|
170
168
|
},
|
|
@@ -175,7 +173,7 @@ function PickerFieldUI(props) {
|
|
|
175
173
|
startInputAdornmentProps = (0, _objectWithoutPropertiesLoose2.default)(_useSlotProps, _excluded4);
|
|
176
174
|
const _useSlotProps2 = (0, _useSlotProps5.default)({
|
|
177
175
|
elementType: InputAdornment,
|
|
178
|
-
externalSlotProps:
|
|
176
|
+
externalSlotProps: pickerFieldUIContext.slotProps.inputAdornment,
|
|
179
177
|
additionalProps: {
|
|
180
178
|
position: 'end'
|
|
181
179
|
},
|
|
@@ -206,11 +204,11 @@ function PickerFieldUI(props) {
|
|
|
206
204
|
externalSlotProps: pickerFieldUIContext.slotProps.openPickerIcon,
|
|
207
205
|
ownerState
|
|
208
206
|
});
|
|
209
|
-
const ClearButton =
|
|
207
|
+
const ClearButton = pickerFieldUIContext.slots.clearButton ?? _IconButton.default;
|
|
210
208
|
// We don't want to forward the `ownerState` to the `<IconButton />` component, see mui/material-ui#34056
|
|
211
209
|
const _useSlotProps4 = (0, _useSlotProps5.default)({
|
|
212
210
|
elementType: ClearButton,
|
|
213
|
-
externalSlotProps:
|
|
211
|
+
externalSlotProps: pickerFieldUIContext.slotProps.clearButton,
|
|
214
212
|
className: 'clearButton',
|
|
215
213
|
additionalProps: {
|
|
216
214
|
title: translations.fieldClearLabel,
|
|
@@ -224,10 +222,10 @@ function PickerFieldUI(props) {
|
|
|
224
222
|
ownerState
|
|
225
223
|
}),
|
|
226
224
|
clearButtonProps = (0, _objectWithoutPropertiesLoose2.default)(_useSlotProps4, _excluded7);
|
|
227
|
-
const ClearIcon =
|
|
225
|
+
const ClearIcon = pickerFieldUIContext.slots.clearIcon ?? _icons.ClearIcon;
|
|
228
226
|
const clearIconProps = (0, _useSlotProps5.default)({
|
|
229
227
|
elementType: ClearIcon,
|
|
230
|
-
externalSlotProps:
|
|
228
|
+
externalSlotProps: pickerFieldUIContext.slotProps.clearIcon,
|
|
231
229
|
additionalProps: {
|
|
232
230
|
fontSize: 'small'
|
|
233
231
|
},
|
|
@@ -257,6 +255,10 @@ function PickerFieldUI(props) {
|
|
|
257
255
|
}))]
|
|
258
256
|
}));
|
|
259
257
|
}
|
|
258
|
+
// handle the case of showing custom `inputAdornment` for Field components
|
|
259
|
+
if (!additionalTextFieldInputProps?.endAdornment && !additionalTextFieldInputProps?.startAdornment && pickerFieldUIContext.slots.inputAdornment) {
|
|
260
|
+
additionalTextFieldInputProps.endAdornment = /*#__PURE__*/(0, _jsxRuntime.jsx)(InputAdornment, (0, _extends2.default)({}, endInputAdornmentProps));
|
|
261
|
+
}
|
|
260
262
|
if (clearButtonPosition != null) {
|
|
261
263
|
textFieldProps.sx = [{
|
|
262
264
|
'& .clearButton': {
|
|
@@ -14,7 +14,6 @@ var _PickerPopper = require("../../components/PickerPopper/PickerPopper");
|
|
|
14
14
|
var _usePicker = require("../usePicker");
|
|
15
15
|
var _PickersLayout = require("../../../PickersLayout");
|
|
16
16
|
var _PickerProvider = require("../../components/PickerProvider");
|
|
17
|
-
var _PickerFieldUI = require("../../components/PickerFieldUI");
|
|
18
17
|
var _createNonRangePickerStepNavigation = require("../../utils/createNonRangePickerStepNavigation");
|
|
19
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
19
|
const _excluded = ["props", "steps"],
|
|
@@ -82,21 +81,20 @@ const useDesktopPicker = _ref => {
|
|
|
82
81
|
'aria-labelledby': labelledById
|
|
83
82
|
}, innerSlotProps?.popper)
|
|
84
83
|
});
|
|
85
|
-
const renderPicker = () => /*#__PURE__*/(0, _jsxRuntime.
|
|
86
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
84
|
+
const renderPicker = () => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PickerProvider.PickerProvider, (0, _extends2.default)({}, providerProps, {
|
|
85
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Field, (0, _extends2.default)({}, fieldProps, {
|
|
87
86
|
slots: slots,
|
|
88
87
|
slotProps: slotProps,
|
|
89
|
-
inputRef: inputRef
|
|
90
|
-
|
|
88
|
+
inputRef: inputRef
|
|
89
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PickerPopper.PickerPopper, {
|
|
90
|
+
slots: slots,
|
|
91
|
+
slotProps: slotProps,
|
|
92
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Layout, (0, _extends2.default)({}, slotProps?.layout, {
|
|
91
93
|
slots: slots,
|
|
92
94
|
slotProps: slotProps,
|
|
93
|
-
children:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
children: renderCurrentView()
|
|
97
|
-
}))
|
|
98
|
-
})]
|
|
99
|
-
})
|
|
95
|
+
children: renderCurrentView()
|
|
96
|
+
}))
|
|
97
|
+
})]
|
|
100
98
|
}));
|
|
101
99
|
if (process.env.NODE_ENV !== "production") renderPicker.displayName = "renderPicker";
|
|
102
100
|
return {
|
|
@@ -14,7 +14,6 @@ var _PickersModalDialog = require("../../components/PickersModalDialog");
|
|
|
14
14
|
var _usePicker = require("../usePicker");
|
|
15
15
|
var _PickersLayout = require("../../../PickersLayout");
|
|
16
16
|
var _PickerProvider = require("../../components/PickerProvider");
|
|
17
|
-
var _PickerFieldUI = require("../../components/PickerFieldUI");
|
|
18
17
|
var _createNonRangePickerStepNavigation = require("../../utils/createNonRangePickerStepNavigation");
|
|
19
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
19
|
const _excluded = ["props", "steps"],
|
|
@@ -82,21 +81,20 @@ const useMobilePicker = _ref => {
|
|
|
82
81
|
'aria-labelledby': labelledById
|
|
83
82
|
}, innerSlotProps?.mobilePaper)
|
|
84
83
|
});
|
|
85
|
-
const renderPicker = () => /*#__PURE__*/(0, _jsxRuntime.
|
|
86
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
84
|
+
const renderPicker = () => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PickerProvider.PickerProvider, (0, _extends2.default)({}, providerProps, {
|
|
85
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Field, (0, _extends2.default)({}, fieldProps, {
|
|
87
86
|
slots: slots,
|
|
88
87
|
slotProps: slotProps,
|
|
89
|
-
inputRef: inputRef
|
|
90
|
-
|
|
88
|
+
inputRef: inputRef
|
|
89
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PickersModalDialog.PickersModalDialog, {
|
|
90
|
+
slots: slots,
|
|
91
|
+
slotProps: slotProps,
|
|
92
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Layout, (0, _extends2.default)({}, slotProps?.layout, {
|
|
91
93
|
slots: slots,
|
|
92
94
|
slotProps: slotProps,
|
|
93
|
-
children:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
children: renderCurrentView()
|
|
97
|
-
}))
|
|
98
|
-
})]
|
|
99
|
-
})
|
|
95
|
+
children: renderCurrentView()
|
|
96
|
+
}))
|
|
97
|
+
})]
|
|
100
98
|
}));
|
|
101
99
|
if (process.env.NODE_ENV !== "production") renderPicker.displayName = "renderPicker";
|
|
102
100
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-date-pickers",
|
|
3
|
-
"version": "8.11.
|
|
3
|
+
"version": "8.11.3",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The community edition of the MUI X Date and Time Picker components.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"clsx": "^2.1.1",
|
|
40
40
|
"prop-types": "^15.8.1",
|
|
41
41
|
"react-transition-group": "^4.4.5",
|
|
42
|
-
"@mui/x-internals": "8.11.
|
|
42
|
+
"@mui/x-internals": "8.11.3"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@emotion/react": "^11.9.0",
|