@mui/x-date-pickers 7.23.2 โ†’ 7.23.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CHANGELOG.md +190 -0
  2. package/DateCalendar/PickersFadeTransitionGroup.d.ts +1 -1
  3. package/DateCalendar/PickersSlideTransition.d.ts +1 -1
  4. package/DateField/useDateField.d.ts +1 -1
  5. package/DateTimeField/useDateTimeField.d.ts +1 -1
  6. package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -0
  7. package/README.md +1 -1
  8. package/TimeClock/Clock.d.ts +4 -0
  9. package/TimeClock/Clock.js +9 -6
  10. package/TimeClock/TimeClock.js +21 -4
  11. package/TimeField/useTimeField.d.ts +1 -1
  12. package/index.js +1 -1
  13. package/internals/hooks/useField/useFieldV6TextField.js +2 -2
  14. package/internals/hooks/usePicker/usePickerViews.d.ts +1 -1
  15. package/internals/hooks/useStaticPicker/useStaticPicker.js +0 -1
  16. package/internals/hooks/useUtils.js +1 -1
  17. package/locales/index.d.ts +1 -0
  18. package/locales/index.js +1 -0
  19. package/locales/nbNO.js +15 -19
  20. package/locales/zhTW.d.ts +80 -0
  21. package/locales/zhTW.js +73 -0
  22. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -0
  23. package/modern/TimeClock/Clock.js +9 -6
  24. package/modern/TimeClock/TimeClock.js +21 -4
  25. package/modern/index.js +1 -1
  26. package/modern/internals/hooks/useField/useFieldV6TextField.js +2 -2
  27. package/modern/internals/hooks/useStaticPicker/useStaticPicker.js +0 -1
  28. package/modern/internals/hooks/useUtils.js +1 -1
  29. package/modern/locales/index.js +1 -0
  30. package/modern/locales/nbNO.js +15 -19
  31. package/modern/locales/zhTW.js +73 -0
  32. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -0
  33. package/node/TimeClock/Clock.js +9 -6
  34. package/node/TimeClock/TimeClock.js +21 -4
  35. package/node/index.js +1 -1
  36. package/node/internals/hooks/useField/useFieldV6TextField.js +2 -2
  37. package/node/internals/hooks/useStaticPicker/useStaticPicker.js +0 -1
  38. package/node/internals/hooks/useUtils.js +1 -1
  39. package/node/locales/index.js +11 -0
  40. package/node/locales/nbNO.js +15 -19
  41. package/node/locales/zhTW.js +79 -0
  42. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -3,6 +3,196 @@
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.23.6
7
+
8
+ _Jan 9, 2025_
9
+
10
+ We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights โœจ:
11
+
12
+ - ๐ŸŒ Add Chinese (Taiwan) (zh-TW) locale on the Date and Time Pickers
13
+ - ๐ŸŒ Improve Norwegian (nb-NO) locale on the Date and Time Pickers
14
+ - ๐ŸŒ Improve Dutch (nl-NL) locale on the Data Grid
15
+ - ๐Ÿž Bugfixes
16
+
17
+ Special thanks go out to the community contributors who have helped make this release possible:
18
+ @josteinjhauge, @derek-0000, @nusr, @k-rajat19, @tomashauser.
19
+ Following are all team members who have contributed to this release:
20
+ @flaviendelangle, @LukasTy, @MBilalShafi, @arminmeh, @oliviertassinari, @cherniavskii.
21
+
22
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
23
+
24
+ ### Data Grid
25
+
26
+ #### `@mui/x-data-grid@7.23.6`
27
+
28
+ - [DataGrid] Improve React 19 support (#16048) @LukasTy
29
+ - [DataGrid] Add `name` attribute to selection checkboxes (#16041) @derek-0000
30
+ - [DataGrid] Fix number filter field formatting values while typing (#16068) @arminmeh
31
+ - [DataGrid] Fix select all checkbox state reset with server side data (#16039) @MBilalShafi
32
+
33
+ #### `@mui/x-data-grid-pro@7.23.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
34
+
35
+ Same changes as in `@mui/x-data-grid@7.23.6`.
36
+
37
+ #### `@mui/x-data-grid-premium@7.23.6` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
38
+
39
+ Same changes as in `@mui/x-data-grid-pro@7.23.6`.
40
+
41
+ ### Date and Time Pickers
42
+
43
+ #### `@mui/x-date-pickers@7.23.6`
44
+
45
+ - [pickers] Improve React 19 support (#16048) @LukasTy
46
+ - [l10n] Add Chinese (Taiwan) (zh-TW) locale (#16057) @nusr
47
+ - [l10n] Improve Norwegian (nb-NO) locale (#16083) @josteinjhauge
48
+ - [pickers] Support `date-fns-jalali` v4 (#16013) @LukasTy
49
+
50
+ #### `@mui/x-date-pickers-pro@7.23.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
51
+
52
+ Same changes as in `@mui/x-date-pickers@7.23.6`.
53
+
54
+ ### Charts
55
+
56
+ #### `@mui/x-charts@7.23.6`
57
+
58
+ - [charts] Improve React 19 support (#16048) @LukasTy
59
+ - [charts] Fix 301 redirection in the API documentation @oliviertassinari
60
+
61
+ #### `@mui/x-charts-pro@7.23.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
62
+
63
+ Same changes as in `@mui/x-charts@7.23.6`.
64
+
65
+ ### Tree View
66
+
67
+ #### `@mui/x-tree-view@7.23.6`
68
+
69
+ - [TreeView] Improve React 19 support (#16048) @LukasTy
70
+
71
+ #### `@mui/x-tree-view-pro@7.23.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
72
+
73
+ Same changes as in `@mui/x-tree-view@7.23.6`.
74
+
75
+ ### Docs
76
+
77
+ - [docs] Fix `EditingWithDatePickers` demo (#16047) @k-rajat19
78
+ - [docs] Fix doc warning for automatic children selection on tree view (#16037) @flaviendelangle
79
+ - [docs] Fix non-existing "adapter" property of `LocalizationProvider` (#16088) @tomashauser
80
+
81
+ ### Core
82
+
83
+ - [core] Clarify the release strategy (#16012) @MBilalShafi
84
+ - [core] Update the `release:version` docs (#16040) @cherniavskii
85
+
86
+ ## 7.23.5
87
+
88
+ _Dec 27, 2024_
89
+
90
+ Here are some highlights โœจ:
91
+
92
+ - ๐Ÿž Fix version mismatch issue in Data Grid codesandbox/stackblitz demos
93
+
94
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
95
+
96
+ ### Data Grid
97
+
98
+ #### `@mui/x-data-grid@7.23.5`
99
+
100
+ No changes since `@mui/x-data-grid@v7.23.4`.
101
+
102
+ #### `@mui/x-data-grid-pro@7.23.5` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
103
+
104
+ Same changes as in `@mui/x-data-grid@7.23.5`.
105
+
106
+ #### `@mui/x-data-grid-premium@7.23.5` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
107
+
108
+ Same changes as in `@mui/x-data-grid-pro@7.23.5`.
109
+
110
+ ## v7.23.4
111
+
112
+ _Dec 27, 2024_
113
+
114
+ We'd like to offer a big thanks to the 4 contributors who made this release possible. Here are some highlights โœจ:
115
+
116
+ - ๐ŸŒ Improve Dutch (nl-NL) locale on the Data Grid
117
+ - ๐Ÿž Bugfixes
118
+
119
+ Special thanks go out to the community contributor who has helped make this release possible:
120
+ @JoepVerkoelen.
121
+ Following are all team members who have contributed to this release:
122
+ @arminmeh, @oliviertassinari.
123
+
124
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
125
+
126
+ ### Data Grid
127
+
128
+ #### `@mui/x-data-grid@7.23.4`
129
+
130
+ - [DataGrid] Fix header filters showing clear button while empty (#15990) @k-rajat19
131
+ - [DataGrid] Replace `forwardRef` with a shim for forward compatibility (#15984) @lauri865
132
+ - [l10n] Improve Dutch (nl-NL) locale (#15920) @JoepVerkoelen
133
+
134
+ #### `@mui/x-data-grid-pro@7.23.4` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
135
+
136
+ Same changes as in `@mui/x-data-grid@7.23.4`.
137
+
138
+ #### `@mui/x-data-grid-premium@7.23.4` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
139
+
140
+ Same changes as in `@mui/x-data-grid-pro@7.23.4`, plus:
141
+
142
+ - [DataGridPremium] Fix column pinning with checkbox selection and row grouping (#15949) @k-rajat19
143
+
144
+ ### Docs
145
+
146
+ - [docs] Fix outdated link to handbook (#15855) @oliviertassinari
147
+
148
+ ## 7.23.3
149
+
150
+ _Dec 19, 2024_
151
+
152
+ We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights โœจ:
153
+
154
+ - ๐ŸŒ Improve Korean (ko-KR) locale on the Data Grid
155
+ - ๐Ÿž Bugfixes
156
+
157
+ Special thanks go out to the community contributors who have helped make this release possible:
158
+ @k-rajat19, @good-jinu.
159
+ Following are all team members who have contributed to this release:
160
+ @KenanYusuf, @MBilalShafi, @arminmeh, @flaviendelangle.
161
+
162
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
163
+
164
+ ### Data Grid
165
+
166
+ #### `@mui/x-data-grid@7.23.3`
167
+
168
+ - [DataGrid] Allow passing custom props to `.main` element (#15919) @MBilalShafi
169
+ - [DataGrid] Consider `columnGroupHeaderHeight` prop in `getTotalHeaderHeight` method (#15927) @k-rajat19
170
+ - [DataGrid] Deprecate `indeterminateCheckboxAction` prop (#15862) @MBilalShafi
171
+ - [DataGrid] Fix `aria-label` value for group checkboxes (#15861) @MBilalShafi
172
+ - [DataGrid] Fix autosizing with virtualized columns (#15929) @k-rajat19
173
+ - [DataGrid] Round dimensions to avoid subpixel rendering error (#15873) @KenanYusuf
174
+ - [DataGrid] Toggle menu on click in `<GridActionsCell />` (#15871) @k-rajat19
175
+ - [DataGrid] Trigger row spanning computation on rows update (#15872) @MBilalShafi
176
+ - [l10n] Improve Korean (ko-KR) locale (#15906) @good-jinu
177
+
178
+ #### `@mui/x-data-grid-pro@7.23.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
179
+
180
+ Same changes as in `@mui/x-data-grid@7.23.3`.
181
+
182
+ #### `@mui/x-data-grid-premium@7.23.3` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
183
+
184
+ Same changes as in `@mui/x-data-grid-pro@7.23.3`.
185
+
186
+ ### Date and Time Pickers
187
+
188
+ #### `@mui/x-date-pickers@7.23.3`
189
+
190
+ - [pickers] Add verification to disable skipped hours in spring forward DST (#15918) @flaviendelangle
191
+
192
+ #### `@mui/x-date-pickers-pro@7.23.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
193
+
194
+ Same changes as in `@mui/x-date-pickers@7.23.3`.
195
+
6
196
  ## 7.23.2
7
197
 
8
198
  _Dec 12, 2024_
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { PickersFadeTransitionGroupClasses } from './pickersFadeTransitionGroupClasses';
3
3
  export interface PickersFadeTransitionGroupProps {
4
- children: React.ReactElement;
4
+ children: React.ReactElement<any>;
5
5
  className?: string;
6
6
  reduceAnimations: boolean;
7
7
  transKey: React.Key;
@@ -9,7 +9,7 @@ export interface ExportedSlideTransitionProps {
9
9
  classes?: Partial<PickersSlideTransitionClasses>;
10
10
  }
11
11
  export interface SlideTransitionProps extends Omit<CSSTransitionProps, 'timeout'>, ExportedSlideTransitionProps {
12
- children: React.ReactElement;
12
+ children: React.ReactElement<any>;
13
13
  className?: string;
14
14
  reduceAnimations: boolean;
15
15
  slideDirection: SlideDirection;
@@ -1,3 +1,3 @@
1
1
  import { UseDateFieldProps } from './DateField.types';
2
2
  import { PickerValidDate } from '../models';
3
- export declare const useDateField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("../internals").UseFieldResponse<TEnableAccessibleFieldDOMStructure, Omit<TAllProps & Omit<UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateFieldBaseProps<any>> & Required<Pick<UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateFieldBaseProps<any>>>, "disabled" | "format" | "onChange" | "onError" | "defaultValue" | "value" | "readOnly" | "timezone" | "referenceDate" | "formatDensity" | "shouldRespectLeadingZeros" | "selectedSections" | "onSelectedSectionsChange" | "unstableFieldRef" | "enableAccessibleFieldDOMStructure" | "shouldDisableDate" | "shouldDisableMonth" | "shouldDisableYear" | keyof import("../internals").BaseDateValidationProps<any> | "dateSeparator">>;
3
+ export declare const useDateField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("../internals").UseFieldResponse<TEnableAccessibleFieldDOMStructure, Omit<TAllProps & Omit<UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateFieldBaseProps<any>> & Required<Pick<UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateFieldBaseProps<any>>>, "disabled" | "readOnly" | "value" | "defaultValue" | "onChange" | "onError" | "format" | "timezone" | "referenceDate" | "formatDensity" | "shouldRespectLeadingZeros" | "selectedSections" | "onSelectedSectionsChange" | "unstableFieldRef" | "enableAccessibleFieldDOMStructure" | "shouldDisableDate" | "shouldDisableMonth" | "shouldDisableYear" | keyof import("../internals").BaseDateValidationProps<any> | "dateSeparator">>;
@@ -1,3 +1,3 @@
1
1
  import { UseDateTimeFieldProps } from './DateTimeField.types';
2
2
  import { PickerValidDate } from '../models';
3
- export declare const useDateTimeField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("../internals").UseFieldResponse<TEnableAccessibleFieldDOMStructure, Omit<TAllProps & Omit<UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateTimeFieldBaseProps<any>> & Required<Pick<UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateTimeFieldBaseProps<any>>>, "disabled" | "format" | "onChange" | "onError" | "defaultValue" | "value" | "readOnly" | "minDate" | "maxDate" | "ampm" | "disableFuture" | "disablePast" | "timezone" | "referenceDate" | "formatDensity" | "shouldRespectLeadingZeros" | "selectedSections" | "onSelectedSectionsChange" | "unstableFieldRef" | "enableAccessibleFieldDOMStructure" | "minutesStep" | "shouldDisableDate" | "shouldDisableMonth" | "shouldDisableYear" | "minTime" | "maxTime" | "shouldDisableTime" | "disableIgnoringDatePartForTimeValidation" | "minDateTime" | "maxDateTime" | "dateSeparator">>;
3
+ export declare const useDateTimeField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("../internals").UseFieldResponse<TEnableAccessibleFieldDOMStructure, Omit<TAllProps & Omit<UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateTimeFieldBaseProps<any>> & Required<Pick<UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedDateTimeFieldBaseProps<any>>>, "disabled" | "readOnly" | "value" | "defaultValue" | "onChange" | "onError" | "format" | "minDate" | "maxDate" | "ampm" | "disableFuture" | "disablePast" | "timezone" | "referenceDate" | "formatDensity" | "shouldRespectLeadingZeros" | "selectedSections" | "onSelectedSectionsChange" | "unstableFieldRef" | "enableAccessibleFieldDOMStructure" | "minutesStep" | "shouldDisableDate" | "shouldDisableMonth" | "shouldDisableYear" | "minTime" | "maxTime" | "shouldDisableTime" | "disableIgnoringDatePartForTimeValidation" | "minDateTime" | "maxDateTime" | "dateSeparator">>;
@@ -190,6 +190,9 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
190
190
  {
191
191
  const valueWithMeridiem = convertValueToMeridiem(rawValue, meridiemMode, ampm);
192
192
  const dateWithNewHours = utils.setHours(valueOrReferenceDate, valueWithMeridiem);
193
+ if (utils.getHours(dateWithNewHours) !== valueWithMeridiem) {
194
+ return true;
195
+ }
193
196
  const start = utils.setSeconds(utils.setMinutes(dateWithNewHours, 0), 0);
194
197
  const end = utils.setSeconds(utils.setMinutes(dateWithNewHours, 59), 59);
195
198
  return !containsValidTime({
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # MUIย X Date Pickers
2
2
 
3
3
  This package is the Community plan edition of the Date and Time Picker components.
4
- It's part of [MUIย X](https://mui.com/x/), an open-core extension of MUIย Core, with advanced components.
4
+ It's part of [MUIย X](https://mui.com/x/), an open-core extension of our Core libraries, with advanced components.
5
5
 
6
6
  ## Installation
7
7
 
@@ -25,6 +25,10 @@ export interface ClockProps<TDate extends PickerValidDate> extends ReturnType<ty
25
25
  * The current full date value.
26
26
  */
27
27
  value: TDate | null;
28
+ /**
29
+ * Minimum and maximum value of the clock.
30
+ */
31
+ viewRange: [number, number];
28
32
  disabled?: boolean;
29
33
  readOnly?: boolean;
30
34
  className?: string;
@@ -180,6 +180,7 @@ export function Clock(inProps) {
180
180
  selectedId,
181
181
  type,
182
182
  viewValue,
183
+ viewRange: [minViewValue, maxViewValue],
183
184
  disabled = false,
184
185
  readOnly,
185
186
  className
@@ -252,6 +253,8 @@ export function Clock(inProps) {
252
253
  listboxRef.current.focus();
253
254
  }
254
255
  }, [autoFocus]);
256
+ const clampValue = newValue => Math.max(minViewValue, Math.min(maxViewValue, newValue));
257
+ const circleValue = newValue => (newValue + (maxViewValue + 1)) % (maxViewValue + 1);
255
258
  const handleKeyDown = event => {
256
259
  // TODO: Why this early exit?
257
260
  if (isMoving.current) {
@@ -260,27 +263,27 @@ export function Clock(inProps) {
260
263
  switch (event.key) {
261
264
  case 'Home':
262
265
  // reset both hours and minutes
263
- handleValueChange(0, 'partial');
266
+ handleValueChange(minViewValue, 'partial');
264
267
  event.preventDefault();
265
268
  break;
266
269
  case 'End':
267
- handleValueChange(type === 'minutes' ? 59 : 23, 'partial');
270
+ handleValueChange(maxViewValue, 'partial');
268
271
  event.preventDefault();
269
272
  break;
270
273
  case 'ArrowUp':
271
- handleValueChange(viewValue + keyboardControlStep, 'partial');
274
+ handleValueChange(circleValue(viewValue + keyboardControlStep), 'partial');
272
275
  event.preventDefault();
273
276
  break;
274
277
  case 'ArrowDown':
275
- handleValueChange(viewValue - keyboardControlStep, 'partial');
278
+ handleValueChange(circleValue(viewValue - keyboardControlStep), 'partial');
276
279
  event.preventDefault();
277
280
  break;
278
281
  case 'PageUp':
279
- handleValueChange(viewValue + 5, 'partial');
282
+ handleValueChange(clampValue(viewValue + 5), 'partial');
280
283
  event.preventDefault();
281
284
  break;
282
285
  case 'PageDown':
283
- handleValueChange(viewValue - 5, 'partial');
286
+ handleValueChange(clampValue(viewValue - 5), 'partial');
284
287
  event.preventDefault();
285
288
  break;
286
289
  case 'Enter':
@@ -183,6 +183,9 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
183
183
  {
184
184
  const valueWithMeridiem = convertValueToMeridiem(rawValue, meridiemMode, ampm);
185
185
  const dateWithNewHours = utils.setHours(valueOrReferenceDate, valueWithMeridiem);
186
+ if (utils.getHours(dateWithNewHours) !== valueWithMeridiem) {
187
+ return true;
188
+ }
186
189
  const start = utils.setSeconds(utils.setMinutes(dateWithNewHours, 0), 0);
187
190
  const end = utils.setSeconds(utils.setMinutes(dateWithNewHours, 59), 59);
188
191
  return !containsValidTime({
@@ -223,9 +226,20 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
223
226
  const valueWithMeridiem = convertValueToMeridiem(hourValue, meridiemMode, ampm);
224
227
  setValueAndGoToNextView(utils.setHours(valueOrReferenceDate, valueWithMeridiem), isFinish, 'hours');
225
228
  };
229
+ const viewValue = utils.getHours(valueOrReferenceDate);
230
+ let viewRange;
231
+ if (ampm) {
232
+ if (viewValue > 12) {
233
+ viewRange = [12, 23];
234
+ } else {
235
+ viewRange = [0, 11];
236
+ }
237
+ } else {
238
+ viewRange = [0, 23];
239
+ }
226
240
  return {
227
241
  onChange: handleHoursChange,
228
- viewValue: utils.getHours(valueOrReferenceDate),
242
+ viewValue,
229
243
  children: getHourNumbers({
230
244
  value,
231
245
  utils,
@@ -234,7 +248,8 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
234
248
  getClockNumberText: translations.hoursClockNumberText,
235
249
  isDisabled: hourValue => disabled || isTimeDisabled(hourValue, 'hours'),
236
250
  selectedId
237
- })
251
+ }),
252
+ viewRange
238
253
  };
239
254
  }
240
255
  case 'minutes':
@@ -253,7 +268,8 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
253
268
  getClockNumberText: translations.minutesClockNumberText,
254
269
  isDisabled: minuteValue => disabled || isTimeDisabled(minuteValue, 'minutes'),
255
270
  selectedId
256
- })
271
+ }),
272
+ viewRange: [0, 59]
257
273
  };
258
274
  }
259
275
  case 'seconds':
@@ -272,7 +288,8 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
272
288
  getClockNumberText: translations.secondsClockNumberText,
273
289
  isDisabled: secondValue => disabled || isTimeDisabled(secondValue, 'seconds'),
274
290
  selectedId
275
- })
291
+ }),
292
+ viewRange: [0, 59]
276
293
  };
277
294
  }
278
295
  default:
@@ -1,3 +1,3 @@
1
1
  import { UseTimeFieldProps } from './TimeField.types';
2
2
  import { PickerValidDate } from '../models';
3
- export declare const useTimeField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("../internals").UseFieldResponse<TEnableAccessibleFieldDOMStructure, Omit<TAllProps & Omit<UseTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedTimeFieldBaseProps> & Required<Pick<UseTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedTimeFieldBaseProps>>, "disabled" | "format" | "onChange" | "onError" | "defaultValue" | "value" | "readOnly" | "ampm" | "timezone" | "referenceDate" | "formatDensity" | "shouldRespectLeadingZeros" | "selectedSections" | "onSelectedSectionsChange" | "unstableFieldRef" | "enableAccessibleFieldDOMStructure" | keyof import("../internals").BaseTimeValidationProps | keyof import("../internals").TimeValidationProps<any> | "dateSeparator">>;
3
+ export declare const useTimeField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("../internals").UseFieldResponse<TEnableAccessibleFieldDOMStructure, Omit<TAllProps & Omit<UseTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedTimeFieldBaseProps> & Required<Pick<UseTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("../internals/hooks/defaultizedFieldProps").UseDefaultizedTimeFieldBaseProps>>, "disabled" | "readOnly" | "value" | "defaultValue" | "onChange" | "onError" | "format" | "ampm" | "timezone" | "referenceDate" | "formatDensity" | "shouldRespectLeadingZeros" | "selectedSections" | "onSelectedSectionsChange" | "unstableFieldRef" | "enableAccessibleFieldDOMStructure" | keyof import("../internals").BaseTimeValidationProps | keyof import("../internals").TimeValidationProps<any> | "dateSeparator">>;
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v7.23.2
2
+ * @mui/x-date-pickers v7.23.6
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -35,8 +35,8 @@ export const addPositionPropertiesToSections = (sections, localizedDigits, isRtl
35
35
  };
36
36
  export const useFieldV6TextField = params => {
37
37
  const isRtl = useRtl();
38
- const focusTimeoutRef = React.useRef();
39
- const selectionSyncTimeoutRef = React.useRef();
38
+ const focusTimeoutRef = React.useRef(undefined);
39
+ const selectionSyncTimeoutRef = React.useRef(undefined);
40
40
  const {
41
41
  forwardedProps: {
42
42
  onFocus,
@@ -66,7 +66,7 @@ export interface UsePickerViewParams<TValue, TDate extends PickerValidDate, TVie
66
66
  propsFromPickerValue: UsePickerValueViewsResponse<TValue>;
67
67
  additionalViewProps: TAdditionalProps;
68
68
  autoFocusView: boolean;
69
- fieldRef: React.RefObject<FieldRef<TSection>> | undefined;
69
+ fieldRef?: React.RefObject<FieldRef<TSection> | null>;
70
70
  /**
71
71
  * A function that intercepts the regular picker rendering.
72
72
  * Can be used to consume the provided `viewRenderers` and render a custom component wrapping them.
@@ -44,7 +44,6 @@ export const useStaticPicker = _ref => {
44
44
  } = usePicker(_extends({}, pickerParams, {
45
45
  props,
46
46
  autoFocusView: autoFocus ?? false,
47
- fieldRef: undefined,
48
47
  additionalViewProps: {},
49
48
  wrapperVariant: displayStaticWrapperAs
50
49
  }));
@@ -19,7 +19,7 @@ export const useUtils = () => useLocalizationContext().utils;
19
19
  export const useDefaultDates = () => useLocalizationContext().defaultDates;
20
20
  export const useNow = timezone => {
21
21
  const utils = useUtils();
22
- const now = React.useRef();
22
+ const now = React.useRef(undefined);
23
23
  if (now.current === undefined) {
24
24
  now.current = utils.date(undefined, timezone);
25
25
  }
@@ -36,4 +36,5 @@ export * from './urPK';
36
36
  export * from './viVN';
37
37
  export * from './zhCN';
38
38
  export * from './zhHK';
39
+ export * from './zhTW';
39
40
  export * from './utils/pickersLocaleTextApi';
package/locales/index.js CHANGED
@@ -36,4 +36,5 @@ export * from "./urPK.js";
36
36
  export * from "./viVN.js";
37
37
  export * from "./zhCN.js";
38
38
  export * from "./zhHK.js";
39
+ export * from "./zhTW.js";
39
40
  export * from "./utils/pickersLocaleTextApi.js";
package/locales/nbNO.js CHANGED
@@ -16,11 +16,10 @@ const nbNOPickers = {
16
16
  // DateRange labels
17
17
  start: 'Start',
18
18
  end: 'Slutt',
19
- // startDate: 'Start date',
20
- // startTime: 'Start time',
21
- // endDate: 'End date',
22
- // endTime: 'End time',
23
-
19
+ startDate: 'Startdato',
20
+ startTime: 'Starttid',
21
+ endDate: 'Sluttdato',
22
+ endTime: 'Slutttid',
24
23
  // Action bar
25
24
  cancelButtonLabel: 'Avbryt',
26
25
  clearButtonLabel: 'Fjern',
@@ -46,8 +45,7 @@ const nbNOPickers = {
46
45
  // Open picker labels
47
46
  openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Velg dato, valgt dato er ${formattedDate ?? utils.format(value, 'fullDate')}` : 'Velg dato',
48
47
  openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Velg tid, valgt tid er ${formattedTime ?? utils.format(value, 'fullTime')}` : 'Velg tid',
49
- // fieldClearLabel: 'Clear',
50
-
48
+ fieldClearLabel: 'Slett',
51
49
  // Table labels
52
50
  timeTableLabel: 'velg tid',
53
51
  dateTableLabel: 'velg dato',
@@ -59,19 +57,17 @@ const nbNOPickers = {
59
57
  fieldHoursPlaceholder: () => 'tt',
60
58
  fieldMinutesPlaceholder: () => 'mm',
61
59
  fieldSecondsPlaceholder: () => 'ss',
62
- fieldMeridiemPlaceholder: () => 'aa'
63
-
60
+ fieldMeridiemPlaceholder: () => 'aa',
64
61
  // View names
65
- // year: 'Year',
66
- // month: 'Month',
67
- // day: 'Day',
68
- // weekDay: 'Week day',
69
- // hours: 'Hours',
70
- // minutes: 'Minutes',
71
- // seconds: 'Seconds',
72
- // meridiem: 'Meridiem',
73
-
62
+ year: 'ร…r',
63
+ month: 'Mรฅned',
64
+ day: 'Dag',
65
+ weekDay: 'Ukedag',
66
+ hours: 'Timer',
67
+ minutes: 'Minutter',
68
+ seconds: 'Sekunder',
69
+ meridiem: 'Meridiem',
74
70
  // Common
75
- // empty: 'Empty',
71
+ empty: 'Tรธm'
76
72
  };
77
73
  export const nbNO = getPickersLocalization(nbNOPickers);
@@ -0,0 +1,80 @@
1
+ import { TimeViewWithMeridiem } from '../internals/models';
2
+ export declare const zhTW: {
3
+ components: {
4
+ MuiLocalizationProvider: {
5
+ defaultProps: {
6
+ localeText: {
7
+ previousMonth?: string | undefined;
8
+ nextMonth?: string | undefined;
9
+ calendarWeekNumberHeaderLabel?: string | undefined;
10
+ calendarWeekNumberHeaderText?: string | undefined;
11
+ calendarWeekNumberAriaLabelText?: ((weekNumber: number) => string) | undefined;
12
+ calendarWeekNumberText?: ((weekNumber: number) => string) | undefined;
13
+ openPreviousView?: string | undefined;
14
+ openNextView?: string | undefined;
15
+ calendarViewSwitchingButtonAriaLabel?: ((currentView: import("@mui/x-date-pickers/models").DateView) => string) | undefined;
16
+ start?: string | undefined;
17
+ end?: string | undefined;
18
+ startDate?: string | undefined;
19
+ startTime?: string | undefined;
20
+ endDate?: string | undefined;
21
+ endTime?: string | undefined;
22
+ cancelButtonLabel?: string | undefined;
23
+ clearButtonLabel?: string | undefined;
24
+ okButtonLabel?: string | undefined;
25
+ todayButtonLabel?: string | undefined;
26
+ clockLabelText?: ((view: import("@mui/x-date-pickers/models").TimeView, time: any, utils: import("@mui/x-date-pickers/models").MuiPickersAdapter<any, any>, formattedTime?: string | null) => string) | undefined;
27
+ hoursClockNumberText?: ((hours: string) => string) | undefined;
28
+ minutesClockNumberText?: ((minutes: string) => string) | undefined;
29
+ secondsClockNumberText?: ((seconds: string) => string) | undefined;
30
+ selectViewText?: ((view: TimeViewWithMeridiem) => string) | undefined;
31
+ openDatePickerDialogue?: ((date: any, utils: import("@mui/x-date-pickers/models").MuiPickersAdapter<any, any>, formattedDate: string | null) => string) | undefined;
32
+ openTimePickerDialogue?: ((date: any, utils: import("@mui/x-date-pickers/models").MuiPickersAdapter<any, any>, formattedTime: string | null) => string) | undefined;
33
+ fieldClearLabel?: string | undefined;
34
+ timeTableLabel?: string | undefined;
35
+ dateTableLabel?: string | undefined;
36
+ fieldYearPlaceholder?: ((params: {
37
+ digitAmount: number;
38
+ format: string;
39
+ }) => string) | undefined;
40
+ fieldMonthPlaceholder?: ((params: {
41
+ contentType: import("@mui/x-date-pickers/models").FieldSectionContentType;
42
+ format: string;
43
+ }) => string) | undefined;
44
+ fieldDayPlaceholder?: ((params: {
45
+ format: string;
46
+ }) => string) | undefined;
47
+ fieldWeekDayPlaceholder?: ((params: {
48
+ contentType: import("@mui/x-date-pickers/models").FieldSectionContentType;
49
+ format: string;
50
+ }) => string) | undefined;
51
+ fieldHoursPlaceholder?: ((params: {
52
+ format: string;
53
+ }) => string) | undefined;
54
+ fieldMinutesPlaceholder?: ((params: {
55
+ format: string;
56
+ }) => string) | undefined;
57
+ fieldSecondsPlaceholder?: ((params: {
58
+ format: string;
59
+ }) => string) | undefined;
60
+ fieldMeridiemPlaceholder?: ((params: {
61
+ format: string;
62
+ }) => string) | undefined;
63
+ year?: string | undefined;
64
+ month?: string | undefined;
65
+ day?: string | undefined;
66
+ weekDay?: string | undefined;
67
+ hours?: string | undefined;
68
+ minutes?: string | undefined;
69
+ seconds?: string | undefined;
70
+ meridiem?: string | undefined;
71
+ empty?: string | undefined;
72
+ datePickerToolbarTitle?: string | undefined;
73
+ timePickerToolbarTitle?: string | undefined;
74
+ dateTimePickerToolbarTitle?: string | undefined;
75
+ dateRangePickerToolbarTitle?: string | undefined;
76
+ };
77
+ };
78
+ };
79
+ };
80
+ };