@mui/x-date-pickers 9.0.2 → 9.0.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/AdapterDateFnsBase/AdapterDateFnsBase.js +14 -0
- package/AdapterDateFnsBase/AdapterDateFnsBase.mjs +14 -0
- package/AdapterDayjs/AdapterDayjs.js +1 -13
- package/AdapterDayjs/AdapterDayjs.mjs +1 -13
- package/AdapterMoment/AdapterMoment.js +6 -0
- package/AdapterMoment/AdapterMoment.mjs +6 -0
- package/CHANGELOG.md +136 -0
- package/PickersLayout/PickersLayout.js +12 -7
- package/PickersLayout/PickersLayout.mjs +12 -7
- package/PickersLayout/PickersLayout.types.d.mts +1 -1
- package/PickersLayout/PickersLayout.types.d.ts +1 -1
- package/PickersTextField/PickersFilledInput/PickersFilledInput.js +2 -2
- package/PickersTextField/PickersFilledInput/PickersFilledInput.mjs +2 -2
- package/PickersTextField/PickersInput/PickersInput.js +2 -2
- package/PickersTextField/PickersInput/PickersInput.mjs +2 -2
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +3 -3
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.mjs +3 -3
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/components/PickerPopper/PickerPopper.js +1 -1
- package/internals/components/PickerPopper/PickerPopper.mjs +1 -1
- package/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -0
- package/internals/hooks/useDesktopPicker/useDesktopPicker.mjs +2 -0
- package/internals/hooks/useField/useField.utils.js +22 -2
- package/internals/hooks/useField/useField.utils.mjs +22 -2
- package/internals/hooks/useField/useFieldRootProps.js +1 -1
- package/internals/hooks/useField/useFieldRootProps.mjs +1 -1
- package/internals/hooks/useMobilePicker/useMobilePicker.js +2 -0
- package/internals/hooks/useMobilePicker/useMobilePicker.mjs +2 -0
- package/internals/hooks/useStaticPicker/useStaticPicker.js +1 -1
- package/internals/hooks/useStaticPicker/useStaticPicker.mjs +2 -2
- package/internals/index.d.mts +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/index.js +6 -0
- package/internals/index.mjs +1 -1
- package/internals/utils/utils.d.mts +6 -0
- package/internals/utils/utils.d.ts +6 -0
- package/internals/utils/utils.js +18 -1
- package/internals/utils/utils.mjs +15 -0
- package/package.json +122 -122
|
@@ -157,6 +157,20 @@ const formatTokenMap = {
|
|
|
157
157
|
maxLength: 2
|
|
158
158
|
},
|
|
159
159
|
hh: 'hours',
|
|
160
|
+
// Hour [0-11] (12h cycle, 0-based) — date-fns only
|
|
161
|
+
K: {
|
|
162
|
+
sectionType: 'hours',
|
|
163
|
+
contentType: 'digit',
|
|
164
|
+
maxLength: 2
|
|
165
|
+
},
|
|
166
|
+
KK: 'hours',
|
|
167
|
+
// Hour [1-24] (24h cycle, 1-based) — date-fns only
|
|
168
|
+
k: {
|
|
169
|
+
sectionType: 'hours',
|
|
170
|
+
contentType: 'digit',
|
|
171
|
+
maxLength: 2
|
|
172
|
+
},
|
|
173
|
+
kk: 'hours',
|
|
160
174
|
// Minutes
|
|
161
175
|
m: {
|
|
162
176
|
sectionType: 'minutes',
|
|
@@ -150,6 +150,20 @@ const formatTokenMap = {
|
|
|
150
150
|
maxLength: 2
|
|
151
151
|
},
|
|
152
152
|
hh: 'hours',
|
|
153
|
+
// Hour [0-11] (12h cycle, 0-based) — date-fns only
|
|
154
|
+
K: {
|
|
155
|
+
sectionType: 'hours',
|
|
156
|
+
contentType: 'digit',
|
|
157
|
+
maxLength: 2
|
|
158
|
+
},
|
|
159
|
+
KK: 'hours',
|
|
160
|
+
// Hour [1-24] (24h cycle, 1-based) — date-fns only
|
|
161
|
+
k: {
|
|
162
|
+
sectionType: 'hours',
|
|
163
|
+
contentType: 'digit',
|
|
164
|
+
maxLength: 2
|
|
165
|
+
},
|
|
166
|
+
kk: 'hours',
|
|
153
167
|
// Minutes
|
|
154
168
|
m: {
|
|
155
169
|
sectionType: 'minutes',
|
|
@@ -218,19 +218,7 @@ class AdapterDayjs {
|
|
|
218
218
|
}
|
|
219
219
|
};
|
|
220
220
|
createSystemDate = value => {
|
|
221
|
-
|
|
222
|
-
if (this.hasUTCPlugin() && this.hasTimezonePlugin()) {
|
|
223
|
-
const timezone = _dayjs.default.tz.guess();
|
|
224
|
-
if (timezone === 'UTC') {
|
|
225
|
-
date = (0, _dayjs.default)(value);
|
|
226
|
-
} /* v8 ignore next 3 */else {
|
|
227
|
-
// We can't change the system timezone in the tests
|
|
228
|
-
date = _dayjs.default.tz(value, timezone);
|
|
229
|
-
}
|
|
230
|
-
} else {
|
|
231
|
-
date = (0, _dayjs.default)(value);
|
|
232
|
-
}
|
|
233
|
-
return this.setLocaleToValue(date);
|
|
221
|
+
return this.setLocaleToValue((0, _dayjs.default)(value));
|
|
234
222
|
};
|
|
235
223
|
createUTCDate = value => {
|
|
236
224
|
/* v8 ignore next 3 */
|
|
@@ -208,19 +208,7 @@ export class AdapterDayjs {
|
|
|
208
208
|
}
|
|
209
209
|
};
|
|
210
210
|
createSystemDate = value => {
|
|
211
|
-
|
|
212
|
-
if (this.hasUTCPlugin() && this.hasTimezonePlugin()) {
|
|
213
|
-
const timezone = dayjs.tz.guess();
|
|
214
|
-
if (timezone === 'UTC') {
|
|
215
|
-
date = dayjs(value);
|
|
216
|
-
} /* v8 ignore next 3 */else {
|
|
217
|
-
// We can't change the system timezone in the tests
|
|
218
|
-
date = dayjs.tz(value, timezone);
|
|
219
|
-
}
|
|
220
|
-
} else {
|
|
221
|
-
date = dayjs(value);
|
|
222
|
-
}
|
|
223
|
-
return this.setLocaleToValue(date);
|
|
211
|
+
return this.setLocaleToValue(dayjs(value));
|
|
224
212
|
};
|
|
225
213
|
createUTCDate = value => {
|
|
226
214
|
/* v8 ignore next 3 */
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,141 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 9.0.3
|
|
4
|
+
|
|
5
|
+
_Apr 27, 2026_
|
|
6
|
+
|
|
7
|
+
We'd like to extend a big thank you to the 16 contributors who made this release possible. Here are some highlights ✨:
|
|
8
|
+
|
|
9
|
+
- ⌨️ Keyboard support for creating events in the Scheduler
|
|
10
|
+
|
|
11
|
+
Special thanks go out to these community members for their valuable contributions:
|
|
12
|
+
@supunsathsara, @ZAKIURREHMAN
|
|
13
|
+
|
|
14
|
+
The following team members contributed to this release:
|
|
15
|
+
@aemartos, @alexfauquette, @arminmeh, @brijeshb42, @Janpot, @JCQuintas, @LukasTy, @MBilalShafi, @michelengelen, @oliviertassinari, @rita-codes, @romgrk, @sai6855, @siriwatknp
|
|
16
|
+
|
|
17
|
+
### Data Grid
|
|
18
|
+
|
|
19
|
+
#### `@mui/x-data-grid@9.0.3`
|
|
20
|
+
|
|
21
|
+
- [DataGrid] Fix `:first-child` SSR warning when `MuiDataGrid.styleOverrides` is set (#22081) @siriwatknp
|
|
22
|
+
- [DataGrid] Fix row reordering when filter hides rows (#22096) @siriwatknp
|
|
23
|
+
- [DataGrid] Remove unused `LayoutDataGridLegacy` class (#22009) @romgrk
|
|
24
|
+
- [DataGrid] Remove unused code, clean up grid-related utilities and deprecate `GridPanelHeader` (#22112) @sai6855
|
|
25
|
+
- [DataGrid] Fix columns cutting off after resizing (#22088) @ZAKIURREHMAN
|
|
26
|
+
|
|
27
|
+
#### `@mui/x-data-grid-pro@9.0.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
28
|
+
|
|
29
|
+
Same changes as in `@mui/x-data-grid@9.0.3`.
|
|
30
|
+
|
|
31
|
+
#### `@mui/x-data-grid-premium@9.0.3` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
32
|
+
|
|
33
|
+
Same changes as in `@mui/x-data-grid-pro@9.0.3`, plus:
|
|
34
|
+
|
|
35
|
+
- [DataGridPremium] Fix row grouping model updates not being reflected (#22122) @MBilalShafi
|
|
36
|
+
|
|
37
|
+
### Date and Time Pickers
|
|
38
|
+
|
|
39
|
+
#### `@mui/x-date-pickers@9.0.3`
|
|
40
|
+
|
|
41
|
+
- [pickers] Fix `DateRangeCalendar` drag with `AdapterDayjs` plain-constructor values (#22165) @LukasTy
|
|
42
|
+
- [pickers] Fix disabled state not overriding error border color (#21169) @supunsathsara
|
|
43
|
+
- [pickers] Forward `data-*` and `aria-*` attributes to the root (#22147) @LukasTy
|
|
44
|
+
- [pickers] Support `K` and `k` hour format tokens (#22108) @michelengelen
|
|
45
|
+
|
|
46
|
+
#### `@mui/x-date-pickers-pro@9.0.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
47
|
+
|
|
48
|
+
Same changes as in `@mui/x-date-pickers@9.0.3`, plus:
|
|
49
|
+
|
|
50
|
+
- [DateRangeCalendar] Ensure date dragging triggers regardless of trigger element (#21868) @michelengelen
|
|
51
|
+
|
|
52
|
+
### Charts
|
|
53
|
+
|
|
54
|
+
#### `@mui/x-charts@9.0.3`
|
|
55
|
+
|
|
56
|
+
- [charts] Centralize WebGL clear/render cycle (context-based) (#22127) @JCQuintas
|
|
57
|
+
- [charts] Fix closest series detection for line charts (#22168) @alexfauquette
|
|
58
|
+
- [charts] Fix radius grid lines when axis uses point scale (#22134) @alexfauquette
|
|
59
|
+
- [charts] Use cubic solver for berzier intersection (#22152) @alexfauquette
|
|
60
|
+
|
|
61
|
+
#### `@mui/x-charts-pro@9.0.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
62
|
+
|
|
63
|
+
Same changes as in `@mui/x-charts@9.0.3`, plus:
|
|
64
|
+
|
|
65
|
+
- [charts-pro] Fix wheel zoom clamping with custom `minStart`/`maxEnd` (#22159) @JCQuintas
|
|
66
|
+
|
|
67
|
+
#### `@mui/x-charts-premium@9.0.3` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
68
|
+
|
|
69
|
+
Same changes as in `@mui/x-charts-pro@9.0.3`, plus:
|
|
70
|
+
|
|
71
|
+
- [charts] Create a `'radialLine'` series type (#22066) @alexfauquette
|
|
72
|
+
- [charts] Plot radial line (#22133) @alexfauquette
|
|
73
|
+
- [charts] Remove `HeatmapWebGLRenderer` indirection (#22169) @JCQuintas
|
|
74
|
+
|
|
75
|
+
### Tree View
|
|
76
|
+
|
|
77
|
+
#### `@mui/x-tree-view@9.0.2`
|
|
78
|
+
|
|
79
|
+
Internal changes.
|
|
80
|
+
|
|
81
|
+
#### `@mui/x-tree-view-pro@9.0.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
82
|
+
|
|
83
|
+
Same changes as in `@mui/x-tree-view@9.0.2`.
|
|
84
|
+
|
|
85
|
+
### Scheduler
|
|
86
|
+
|
|
87
|
+
#### Breaking changes
|
|
88
|
+
|
|
89
|
+
- The `views` of `EventTimelinePremium` have been renamed to `presets`, with names that describe the header layout. The props `view`/`defaultView`/`views`/`onViewChange` are now `preset`/`defaultPreset`/`presets`/`onPresetChange`, and the type `EventTimelinePremiumView` is now `EventTimelinePremiumPreset`.
|
|
90
|
+
|
|
91
|
+
| Old | New |
|
|
92
|
+
| :------- | :------------- |
|
|
93
|
+
| `time` | `dayAndHour` |
|
|
94
|
+
| `days` | `day` |
|
|
95
|
+
| `weeks` | `dayAndWeek` |
|
|
96
|
+
| `months` | `monthAndYear` |
|
|
97
|
+
| `years` | `year` |
|
|
98
|
+
|
|
99
|
+
CSS variables (`--time-cell-width`, etc.) and headless store state (`state.view`, `setView`) follow the same rename. The `presets` array is now sorted internally against a canonical zoom order.
|
|
100
|
+
|
|
101
|
+
#### `@mui/x-scheduler@9.0.0-alpha.3`
|
|
102
|
+
|
|
103
|
+
- [scheduler] Allow creating events via keyboard - EventCalendar (#21967) @rita-codes
|
|
104
|
+
- [scheduler] Prefix element IDs with a unique Scheduler instance ID (#22109) @rita-codes
|
|
105
|
+
|
|
106
|
+
#### `@mui/x-scheduler-premium@9.0.0-alpha.3` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
107
|
+
|
|
108
|
+
Same changes as in `@mui/x-scheduler@9.0.0-alpha.3`.
|
|
109
|
+
|
|
110
|
+
- [scheduler] Allow creating events via keyboard - `EventTimeline` (#22119) @rita-codes
|
|
111
|
+
- [scheduler] Rename `EventTimeline` `views` to ordered presets (#22130) @rita-codes
|
|
112
|
+
|
|
113
|
+
### Docs
|
|
114
|
+
|
|
115
|
+
- [docs] Cleanup generated llm md files for chat (#22163) @brijeshb42
|
|
116
|
+
- [docs] Fix `highlightScope` description (#22154) @alexfauquette
|
|
117
|
+
- [docs] Remove obsolete v7 deprecation warning for `dayOfWeekFormatter` (#22111) @LukasTy
|
|
118
|
+
- [docs] Use mui.com for broken links checker known targets (#22129) @JCQuintas
|
|
119
|
+
- [docs] Document picker behavior inside MUI `Dialog` and provide recommended solutions (#22144) @michelengelen
|
|
120
|
+
- [docs] Improve v9 license key version mismatch error guidance (#22180) @aemartos
|
|
121
|
+
|
|
122
|
+
### Core
|
|
123
|
+
|
|
124
|
+
- [code-infra] Reduce concurrency for package build to 5 (#22115) @Janpot
|
|
125
|
+
- [code-infra] Rename `docsx` alias to `docs` (#22155) @brijeshb42
|
|
126
|
+
- [docs-infra] Remove monorepo dependency (#22025) @brijeshb42
|
|
127
|
+
- [docs-infra] Use latest published packages (#22086) @brijeshb42
|
|
128
|
+
- [test] Refactor Pickers tests to async user-event (#22043) @LukasTy
|
|
129
|
+
- [test] Remove redundant explicit `unmount()` calls from Pickers tests (#22118) @LukasTy
|
|
130
|
+
|
|
131
|
+
### Miscellaneous
|
|
132
|
+
|
|
133
|
+
- [infra] Update `.gitignore` to exclude `.claude/worktrees` (#22145) @michelengelen
|
|
134
|
+
- [infra] Enable branch tracking when creating release branch (#22177) @michelengelen
|
|
135
|
+
- [license] Add MIT license to `x-virtualizer` package (#22164) @michelengelen
|
|
136
|
+
- [website] Fix outdated MUI logos (#22117) @oliviertassinari
|
|
137
|
+
- [internal] Try avoiding store update when virtualization is disabled (#22093) @arminmeh
|
|
138
|
+
|
|
3
139
|
## 9.0.2
|
|
4
140
|
|
|
5
141
|
<!-- generated comparing v9.0.1..master -->
|
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
9
|
exports.PickersLayoutRoot = exports.PickersLayoutContentWrapper = exports.PickersLayout = void 0;
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
12
|
var React = _interopRequireWildcard(require("react"));
|
|
11
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
14
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
@@ -16,6 +18,7 @@ var _pickersLayoutClasses = require("./pickersLayoutClasses");
|
|
|
16
18
|
var _usePickerLayout = _interopRequireDefault(require("./usePickerLayout"));
|
|
17
19
|
var _usePickerContext = require("../hooks/usePickerContext");
|
|
18
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
const _excluded = ["sx", "className", "classes", "children", "slots", "slotProps"];
|
|
19
22
|
const useUtilityClasses = (classes, ownerState) => {
|
|
20
23
|
const {
|
|
21
24
|
pickerOrientation
|
|
@@ -126,16 +129,18 @@ const PickersLayout = exports.PickersLayout = /*#__PURE__*/React.forwardRef(func
|
|
|
126
129
|
variant
|
|
127
130
|
} = (0, _usePickerContext.usePickerContext)();
|
|
128
131
|
const {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
sx,
|
|
133
|
+
className,
|
|
134
|
+
classes: classesProp
|
|
135
|
+
} = props,
|
|
136
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
133
137
|
const classes = useUtilityClasses(classesProp, ownerState);
|
|
134
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(PickersLayoutRoot, {
|
|
138
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(PickersLayoutRoot, (0, _extends2.default)({
|
|
135
139
|
ref: ref,
|
|
136
140
|
sx: sx,
|
|
137
141
|
className: (0, _clsx.default)(classes.root, className),
|
|
138
|
-
ownerState: ownerState
|
|
142
|
+
ownerState: ownerState
|
|
143
|
+
}, other, {
|
|
139
144
|
children: [orientation === 'landscape' ? shortcuts : toolbar, orientation === 'landscape' ? toolbar : shortcuts, /*#__PURE__*/(0, _jsxRuntime.jsx)(PickersLayoutContentWrapper, {
|
|
140
145
|
className: classes.contentWrapper,
|
|
141
146
|
ownerState: ownerState,
|
|
@@ -145,7 +150,7 @@ const PickersLayout = exports.PickersLayout = /*#__PURE__*/React.forwardRef(func
|
|
|
145
150
|
children: [tabs, content]
|
|
146
151
|
})
|
|
147
152
|
}), actionBar]
|
|
148
|
-
});
|
|
153
|
+
}));
|
|
149
154
|
});
|
|
150
155
|
if (process.env.NODE_ENV !== "production") PickersLayout.displayName = "PickersLayout";
|
|
151
156
|
process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
+
const _excluded = ["sx", "className", "classes", "children", "slots", "slotProps"];
|
|
3
6
|
import * as React from 'react';
|
|
4
7
|
import PropTypes from 'prop-types';
|
|
5
8
|
import clsx from 'clsx';
|
|
@@ -119,16 +122,18 @@ const PickersLayout = /*#__PURE__*/React.forwardRef(function PickersLayout(inPro
|
|
|
119
122
|
variant
|
|
120
123
|
} = usePickerContext();
|
|
121
124
|
const {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
sx,
|
|
126
|
+
className,
|
|
127
|
+
classes: classesProp
|
|
128
|
+
} = props,
|
|
129
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
126
130
|
const classes = useUtilityClasses(classesProp, ownerState);
|
|
127
|
-
return /*#__PURE__*/_jsxs(PickersLayoutRoot, {
|
|
131
|
+
return /*#__PURE__*/_jsxs(PickersLayoutRoot, _extends({
|
|
128
132
|
ref: ref,
|
|
129
133
|
sx: sx,
|
|
130
134
|
className: clsx(classes.root, className),
|
|
131
|
-
ownerState: ownerState
|
|
135
|
+
ownerState: ownerState
|
|
136
|
+
}, other, {
|
|
132
137
|
children: [orientation === 'landscape' ? shortcuts : toolbar, orientation === 'landscape' ? toolbar : shortcuts, /*#__PURE__*/_jsx(PickersLayoutContentWrapper, {
|
|
133
138
|
className: classes.contentWrapper,
|
|
134
139
|
ownerState: ownerState,
|
|
@@ -138,7 +143,7 @@ const PickersLayout = /*#__PURE__*/React.forwardRef(function PickersLayout(inPro
|
|
|
138
143
|
children: [tabs, content]
|
|
139
144
|
})
|
|
140
145
|
}), actionBar]
|
|
141
|
-
});
|
|
146
|
+
}));
|
|
142
147
|
});
|
|
143
148
|
if (process.env.NODE_ENV !== "production") PickersLayout.displayName = "PickersLayout";
|
|
144
149
|
process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
|
|
@@ -74,7 +74,7 @@ export interface PickersLayoutSlotProps<TValue extends PickerValidValue> extends
|
|
|
74
74
|
*/
|
|
75
75
|
toolbar?: ExportedBaseToolbarProps;
|
|
76
76
|
}
|
|
77
|
-
export interface PickersLayoutProps<TValue extends PickerValidValue> {
|
|
77
|
+
export interface PickersLayoutProps<TValue extends PickerValidValue> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'className'> {
|
|
78
78
|
className?: string;
|
|
79
79
|
children?: React.ReactNode;
|
|
80
80
|
/**
|
|
@@ -74,7 +74,7 @@ export interface PickersLayoutSlotProps<TValue extends PickerValidValue> extends
|
|
|
74
74
|
*/
|
|
75
75
|
toolbar?: ExportedBaseToolbarProps;
|
|
76
76
|
}
|
|
77
|
-
export interface PickersLayoutProps<TValue extends PickerValidValue> {
|
|
77
|
+
export interface PickersLayoutProps<TValue extends PickerValidValue> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'className'> {
|
|
78
78
|
className?: string;
|
|
79
79
|
children?: React.ReactNode;
|
|
80
80
|
/**
|
|
@@ -75,7 +75,7 @@ const PickersFilledInputRoot = (0, _styles.styled)(_PickersInputBase2.PickersInp
|
|
|
75
75
|
'&::after': {
|
|
76
76
|
left: 0,
|
|
77
77
|
bottom: 0,
|
|
78
|
-
// Doing the other way around crash on
|
|
78
|
+
// Doing the other way around crash on IE 11 "''" https://github.com/cssinjs/jss/issues/242
|
|
79
79
|
content: '""',
|
|
80
80
|
position: 'absolute',
|
|
81
81
|
right: 0,
|
|
@@ -100,7 +100,7 @@ const PickersFilledInputRoot = (0, _styles.styled)(_PickersInputBase2.PickersInp
|
|
|
100
100
|
borderBottom: `1px solid ${theme.vars ? theme.alpha(theme.vars.palette.common.onBackground, theme.vars.opacity.inputUnderline) : bottomLineColor}`,
|
|
101
101
|
left: 0,
|
|
102
102
|
bottom: 0,
|
|
103
|
-
// Doing the other way around crash on
|
|
103
|
+
// Doing the other way around crash on IE 11 "''" https://github.com/cssinjs/jss/issues/242
|
|
104
104
|
content: '"\\00a0"',
|
|
105
105
|
position: 'absolute',
|
|
106
106
|
right: 0,
|
|
@@ -68,7 +68,7 @@ const PickersFilledInputRoot = styled(PickersInputBaseRoot, {
|
|
|
68
68
|
'&::after': {
|
|
69
69
|
left: 0,
|
|
70
70
|
bottom: 0,
|
|
71
|
-
// Doing the other way around crash on
|
|
71
|
+
// Doing the other way around crash on IE 11 "''" https://github.com/cssinjs/jss/issues/242
|
|
72
72
|
content: '""',
|
|
73
73
|
position: 'absolute',
|
|
74
74
|
right: 0,
|
|
@@ -93,7 +93,7 @@ const PickersFilledInputRoot = styled(PickersInputBaseRoot, {
|
|
|
93
93
|
borderBottom: `1px solid ${theme.vars ? theme.alpha(theme.vars.palette.common.onBackground, theme.vars.opacity.inputUnderline) : bottomLineColor}`,
|
|
94
94
|
left: 0,
|
|
95
95
|
bottom: 0,
|
|
96
|
-
// Doing the other way around crash on
|
|
96
|
+
// Doing the other way around crash on IE 11 "''" https://github.com/cssinjs/jss/issues/242
|
|
97
97
|
content: '"\\00a0"',
|
|
98
98
|
position: 'absolute',
|
|
99
99
|
right: 0,
|
|
@@ -59,7 +59,7 @@ const PickersInputRoot = (0, _styles.styled)(_PickersInputBase2.PickersInputBase
|
|
|
59
59
|
background: 'red',
|
|
60
60
|
left: 0,
|
|
61
61
|
bottom: 0,
|
|
62
|
-
// Doing the other way around crash on
|
|
62
|
+
// Doing the other way around crash on IE 11 "''" https://github.com/cssinjs/jss/issues/242
|
|
63
63
|
content: '""',
|
|
64
64
|
position: 'absolute',
|
|
65
65
|
right: 0,
|
|
@@ -84,7 +84,7 @@ const PickersInputRoot = (0, _styles.styled)(_PickersInputBase2.PickersInputBase
|
|
|
84
84
|
borderBottom: `1px solid ${bottomLineColor}`,
|
|
85
85
|
left: 0,
|
|
86
86
|
bottom: 0,
|
|
87
|
-
// Doing the other way around crash on
|
|
87
|
+
// Doing the other way around crash on IE 11 "''" https://github.com/cssinjs/jss/issues/242
|
|
88
88
|
content: '"\\00a0"',
|
|
89
89
|
position: 'absolute',
|
|
90
90
|
right: 0,
|
|
@@ -52,7 +52,7 @@ const PickersInputRoot = styled(PickersInputBaseRoot, {
|
|
|
52
52
|
background: 'red',
|
|
53
53
|
left: 0,
|
|
54
54
|
bottom: 0,
|
|
55
|
-
// Doing the other way around crash on
|
|
55
|
+
// Doing the other way around crash on IE 11 "''" https://github.com/cssinjs/jss/issues/242
|
|
56
56
|
content: '""',
|
|
57
57
|
position: 'absolute',
|
|
58
58
|
right: 0,
|
|
@@ -77,7 +77,7 @@ const PickersInputRoot = styled(PickersInputBaseRoot, {
|
|
|
77
77
|
borderBottom: `1px solid ${bottomLineColor}`,
|
|
78
78
|
left: 0,
|
|
79
79
|
bottom: 0,
|
|
80
|
-
// Doing the other way around crash on
|
|
80
|
+
// Doing the other way around crash on IE 11 "''" https://github.com/cssinjs/jss/issues/242
|
|
81
81
|
content: '"\\00a0"',
|
|
82
82
|
position: 'absolute',
|
|
83
83
|
right: 0,
|
|
@@ -44,6 +44,9 @@ const PickersOutlinedInputRoot = (0, _styles.styled)(_PickersInputBase2.PickersI
|
|
|
44
44
|
borderStyle: 'solid',
|
|
45
45
|
borderWidth: 2
|
|
46
46
|
},
|
|
47
|
+
[`&.${_pickersOutlinedInputClasses.pickersOutlinedInputClasses.error} .${_pickersOutlinedInputClasses.pickersOutlinedInputClasses.notchedOutline}`]: {
|
|
48
|
+
borderColor: (theme.vars || theme).palette.error.main
|
|
49
|
+
},
|
|
47
50
|
[`&.${_pickersOutlinedInputClasses.pickersOutlinedInputClasses.disabled}`]: {
|
|
48
51
|
[`& .${_pickersOutlinedInputClasses.pickersOutlinedInputClasses.notchedOutline}`]: {
|
|
49
52
|
borderColor: (theme.vars || theme).palette.action.disabled
|
|
@@ -52,9 +55,6 @@ const PickersOutlinedInputRoot = (0, _styles.styled)(_PickersInputBase2.PickersI
|
|
|
52
55
|
color: (theme.vars || theme).palette.action.disabled
|
|
53
56
|
}
|
|
54
57
|
},
|
|
55
|
-
[`&.${_pickersOutlinedInputClasses.pickersOutlinedInputClasses.error} .${_pickersOutlinedInputClasses.pickersOutlinedInputClasses.notchedOutline}`]: {
|
|
56
|
-
borderColor: (theme.vars || theme).palette.error.main
|
|
57
|
-
},
|
|
58
58
|
variants: Object.keys((theme.vars ?? theme).palette)
|
|
59
59
|
// @ts-ignore
|
|
60
60
|
.filter(key => (theme.vars ?? theme).palette[key]?.main ?? false).map(color => ({
|
|
@@ -37,6 +37,9 @@ const PickersOutlinedInputRoot = styled(PickersInputBaseRoot, {
|
|
|
37
37
|
borderStyle: 'solid',
|
|
38
38
|
borderWidth: 2
|
|
39
39
|
},
|
|
40
|
+
[`&.${pickersOutlinedInputClasses.error} .${pickersOutlinedInputClasses.notchedOutline}`]: {
|
|
41
|
+
borderColor: (theme.vars || theme).palette.error.main
|
|
42
|
+
},
|
|
40
43
|
[`&.${pickersOutlinedInputClasses.disabled}`]: {
|
|
41
44
|
[`& .${pickersOutlinedInputClasses.notchedOutline}`]: {
|
|
42
45
|
borderColor: (theme.vars || theme).palette.action.disabled
|
|
@@ -45,9 +48,6 @@ const PickersOutlinedInputRoot = styled(PickersInputBaseRoot, {
|
|
|
45
48
|
color: (theme.vars || theme).palette.action.disabled
|
|
46
49
|
}
|
|
47
50
|
},
|
|
48
|
-
[`&.${pickersOutlinedInputClasses.error} .${pickersOutlinedInputClasses.notchedOutline}`]: {
|
|
49
|
-
borderColor: (theme.vars || theme).palette.error.main
|
|
50
|
-
},
|
|
51
51
|
variants: Object.keys((theme.vars ?? theme).palette)
|
|
52
52
|
// @ts-ignore
|
|
53
53
|
.filter(key => (theme.vars ?? theme).palette[key]?.main ?? false).map(color => ({
|
package/index.js
CHANGED
package/index.mjs
CHANGED
|
@@ -112,7 +112,7 @@ function useClickAwayListener(active, onClickAway) {
|
|
|
112
112
|
syntheticEventRef.current = false;
|
|
113
113
|
const doc = (0, _ownerDocument.default)(nodeRef.current);
|
|
114
114
|
|
|
115
|
-
// 1.
|
|
115
|
+
// 1. IE 11 support, which trigger the handleClickAway even after the unbind
|
|
116
116
|
// 2. The child might render null.
|
|
117
117
|
// 3. Behave like a blur listener.
|
|
118
118
|
if (!nodeRef.current ||
|
|
@@ -105,7 +105,7 @@ function useClickAwayListener(active, onClickAway) {
|
|
|
105
105
|
syntheticEventRef.current = false;
|
|
106
106
|
const doc = ownerDocument(nodeRef.current);
|
|
107
107
|
|
|
108
|
-
// 1.
|
|
108
|
+
// 1. IE 11 support, which trigger the handleClickAway even after the unbind
|
|
109
109
|
// 2. The child might render null.
|
|
110
110
|
// 3. Behave like a blur listener.
|
|
111
111
|
if (!nodeRef.current ||
|
|
@@ -13,6 +13,7 @@ var _usePicker = require("../usePicker");
|
|
|
13
13
|
var _PickersLayout = require("../../../PickersLayout");
|
|
14
14
|
var _PickerProvider = require("../../components/PickerProvider");
|
|
15
15
|
var _createNonRangePickerStepNavigation = require("../../utils/createNonRangePickerStepNavigation");
|
|
16
|
+
var _utils = require("../../utils/utils");
|
|
16
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
18
|
const _excluded = ["props", "steps"],
|
|
18
19
|
_excluded2 = ["ownerState"];
|
|
@@ -56,6 +57,7 @@ const useDesktopPicker = _ref => {
|
|
|
56
57
|
const _useSlotProps = (0, _useSlotProps2.default)({
|
|
57
58
|
elementType: Field,
|
|
58
59
|
externalSlotProps: innerSlotProps?.field,
|
|
60
|
+
externalForwardedProps: (0, _utils.extractRootForwardedProps)(props),
|
|
59
61
|
additionalProps: (0, _extends2.default)({}, isToolbarHidden && {
|
|
60
62
|
id: labelId
|
|
61
63
|
}),
|
|
@@ -8,6 +8,7 @@ import { usePicker } from "../usePicker/index.mjs";
|
|
|
8
8
|
import { PickersLayout } from "../../../PickersLayout/index.mjs";
|
|
9
9
|
import { PickerProvider } from "../../components/PickerProvider.mjs";
|
|
10
10
|
import { createNonRangePickerStepNavigation } from "../../utils/createNonRangePickerStepNavigation.mjs";
|
|
11
|
+
import { extractRootForwardedProps } from "../../utils/utils.mjs";
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Hook managing all the single-date desktop pickers:
|
|
@@ -50,6 +51,7 @@ export const useDesktopPicker = _ref => {
|
|
|
50
51
|
const _useSlotProps = useSlotProps({
|
|
51
52
|
elementType: Field,
|
|
52
53
|
externalSlotProps: innerSlotProps?.field,
|
|
54
|
+
externalForwardedProps: extractRootForwardedProps(props),
|
|
53
55
|
additionalProps: _extends({}, isToolbarHidden && {
|
|
54
56
|
id: labelId
|
|
55
57
|
}),
|
|
@@ -306,13 +306,33 @@ const getSectionsBoundaries = (adapter, localizedDigits, timezone) => {
|
|
|
306
306
|
format
|
|
307
307
|
}) => {
|
|
308
308
|
const lastHourInDay = adapter.getHours(endOfDay);
|
|
309
|
-
const
|
|
309
|
+
const formattedMidnight = Number(removeLocalizedDigits(adapter.formatByString(adapter.startOfDay(today), format), localizedDigits));
|
|
310
|
+
const formattedEndOfDay = Number(removeLocalizedDigits(adapter.formatByString(adapter.endOfDay(today), format), localizedDigits));
|
|
311
|
+
const hasMeridiem = formattedEndOfDay !== lastHourInDay;
|
|
310
312
|
if (hasMeridiem) {
|
|
313
|
+
// K/KK format (hour 0-11): midnight formats as 0
|
|
314
|
+
if (formattedMidnight === 0) {
|
|
315
|
+
return {
|
|
316
|
+
minimum: 0,
|
|
317
|
+
maximum: formattedEndOfDay
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
// h/hh format (hour 1-12): midnight formats as 12
|
|
311
321
|
return {
|
|
312
322
|
minimum: 1,
|
|
313
|
-
maximum:
|
|
323
|
+
maximum: formattedMidnight
|
|
314
324
|
};
|
|
315
325
|
}
|
|
326
|
+
|
|
327
|
+
// k/kk format (hour 1-24): midnight formats as 24 (> lastHourInDay)
|
|
328
|
+
if (formattedMidnight > lastHourInDay) {
|
|
329
|
+
return {
|
|
330
|
+
minimum: 1,
|
|
331
|
+
maximum: formattedMidnight
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// H/HH format (hour 0-23)
|
|
316
336
|
return {
|
|
317
337
|
minimum: 0,
|
|
318
338
|
maximum: lastHourInDay
|
|
@@ -285,13 +285,33 @@ export const getSectionsBoundaries = (adapter, localizedDigits, timezone) => {
|
|
|
285
285
|
format
|
|
286
286
|
}) => {
|
|
287
287
|
const lastHourInDay = adapter.getHours(endOfDay);
|
|
288
|
-
const
|
|
288
|
+
const formattedMidnight = Number(removeLocalizedDigits(adapter.formatByString(adapter.startOfDay(today), format), localizedDigits));
|
|
289
|
+
const formattedEndOfDay = Number(removeLocalizedDigits(adapter.formatByString(adapter.endOfDay(today), format), localizedDigits));
|
|
290
|
+
const hasMeridiem = formattedEndOfDay !== lastHourInDay;
|
|
289
291
|
if (hasMeridiem) {
|
|
292
|
+
// K/KK format (hour 0-11): midnight formats as 0
|
|
293
|
+
if (formattedMidnight === 0) {
|
|
294
|
+
return {
|
|
295
|
+
minimum: 0,
|
|
296
|
+
maximum: formattedEndOfDay
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
// h/hh format (hour 1-12): midnight formats as 12
|
|
290
300
|
return {
|
|
291
301
|
minimum: 1,
|
|
292
|
-
maximum:
|
|
302
|
+
maximum: formattedMidnight
|
|
293
303
|
};
|
|
294
304
|
}
|
|
305
|
+
|
|
306
|
+
// k/kk format (hour 1-24): midnight formats as 24 (> lastHourInDay)
|
|
307
|
+
if (formattedMidnight > lastHourInDay) {
|
|
308
|
+
return {
|
|
309
|
+
minimum: 1,
|
|
310
|
+
maximum: formattedMidnight
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// H/HH format (hour 0-23)
|
|
295
315
|
return {
|
|
296
316
|
minimum: 0,
|
|
297
317
|
maximum: lastHourInDay
|
|
@@ -60,7 +60,7 @@ function useFieldRootProps(parameters) {
|
|
|
60
60
|
// eslint-disable-next-line default-case
|
|
61
61
|
switch (true) {
|
|
62
62
|
// Select all
|
|
63
|
-
case (event.ctrlKey || event.metaKey) && String.fromCharCode(event.keyCode) === 'A' && !event.shiftKey && !event.altKey:
|
|
63
|
+
case (event.ctrlKey || event.metaKey) && (event.key?.toUpperCase() === 'A' || String.fromCharCode(event.keyCode) === 'A') && !event.shiftKey && !event.altKey:
|
|
64
64
|
{
|
|
65
65
|
// prevent default to make sure that the next line "select all" while updating
|
|
66
66
|
// the internal state at the same time.
|
|
@@ -54,7 +54,7 @@ export function useFieldRootProps(parameters) {
|
|
|
54
54
|
// eslint-disable-next-line default-case
|
|
55
55
|
switch (true) {
|
|
56
56
|
// Select all
|
|
57
|
-
case (event.ctrlKey || event.metaKey) && String.fromCharCode(event.keyCode) === 'A' && !event.shiftKey && !event.altKey:
|
|
57
|
+
case (event.ctrlKey || event.metaKey) && (event.key?.toUpperCase() === 'A' || String.fromCharCode(event.keyCode) === 'A') && !event.shiftKey && !event.altKey:
|
|
58
58
|
{
|
|
59
59
|
// prevent default to make sure that the next line "select all" while updating
|
|
60
60
|
// the internal state at the same time.
|