@mui/x-date-pickers 6.0.3 → 6.0.4
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/AdapterDateFnsJalali/index.js +68 -0
- package/AdapterLuxon/index.js +12 -3
- package/CHANGELOG.md +61 -0
- package/DateCalendar/DateCalendar.types.d.ts +1 -1
- package/DateCalendar/PickersCalendarHeader.d.ts +1 -1
- package/DateCalendar/index.d.ts +0 -1
- package/DateField/DateField.types.d.ts +2 -2
- package/DatePicker/DatePickerToolbar.d.ts +1 -1
- package/DatePicker/shared.d.ts +2 -2
- package/DateTimeField/DateTimeField.types.d.ts +2 -2
- package/DateTimePicker/DateTimePickerTabs.d.ts +1 -1
- package/DateTimePicker/DateTimePickerToolbar.d.ts +1 -1
- package/DateTimePicker/shared.d.ts +1 -2
- package/DesktopDatePicker/DesktopDatePicker.types.d.ts +1 -1
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +1 -1
- package/DesktopTimePicker/DesktopTimePicker.types.d.ts +1 -1
- package/MobileDatePicker/MobileDatePicker.types.d.ts +1 -1
- package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +1 -1
- package/MobileTimePicker/MobileTimePicker.types.d.ts +1 -1
- package/PickersLayout/PickersLayout.d.ts +1 -1
- package/PickersLayout/PickersLayout.types.d.ts +1 -1
- package/PickersLayout/index.d.ts +1 -1
- package/PickersLayout/usePickerLayout.d.ts +1 -1
- package/README.md +1 -1
- package/StaticDatePicker/StaticDatePicker.types.d.ts +2 -1
- package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +2 -1
- package/StaticTimePicker/StaticTimePicker.types.d.ts +2 -1
- package/TimeClock/Clock.d.ts +1 -1
- package/TimeClock/ClockPointer.d.ts +1 -1
- package/TimeClock/TimeClock.types.d.ts +1 -1
- package/TimeClock/index.d.ts +0 -1
- package/TimeField/TimeField.types.d.ts +2 -2
- package/TimePicker/TimePickerToolbar.d.ts +1 -1
- package/TimePicker/shared.d.ts +1 -2
- package/dateViewRenderers/dateViewRenderers.d.ts +1 -1
- package/index.js +1 -1
- package/internals/components/PickersToolbar.d.ts +1 -1
- package/internals/demo/DemoContainer.js +15 -7
- package/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +1 -1
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +4 -5
- package/internals/hooks/useField/index.d.ts +1 -1
- package/internals/hooks/useField/useField.d.ts +2 -1
- package/internals/hooks/useField/useField.js +9 -7
- package/internals/hooks/useField/useField.types.d.ts +24 -104
- package/internals/hooks/useField/useField.utils.d.ts +7 -5
- package/internals/hooks/useField/useField.utils.js +68 -50
- package/internals/hooks/useField/useFieldCharacterEditing.d.ts +2 -1
- package/internals/hooks/useField/useFieldState.d.ts +3 -1
- package/internals/hooks/useField/useFieldState.js +88 -62
- package/internals/hooks/useIsLandscape.d.ts +1 -1
- package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +1 -1
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +4 -5
- package/internals/hooks/usePicker/usePicker.d.ts +1 -2
- package/internals/hooks/usePicker/usePicker.types.d.ts +1 -2
- package/internals/hooks/usePicker/usePickerLayoutProps.d.ts +1 -1
- package/internals/hooks/usePicker/usePickerValue.d.ts +2 -1
- package/internals/hooks/usePicker/usePickerViews.d.ts +1 -1
- package/internals/hooks/useStaticPicker/useStaticPicker.d.ts +1 -1
- package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +1 -2
- package/internals/hooks/useViews.d.ts +1 -1
- package/internals/hooks/useViews.js +8 -0
- package/internals/hooks/validation/models.d.ts +1 -1
- package/internals/hooks/validation/useDateTimeValidation.d.ts +3 -3
- package/internals/hooks/validation/useDateValidation.d.ts +2 -2
- package/internals/hooks/validation/useTimeValidation.d.ts +2 -2
- package/internals/index.d.ts +3 -7
- package/internals/index.js +1 -1
- package/internals/models/fields.d.ts +2 -20
- package/internals/models/index.d.ts +0 -1
- package/internals/models/index.js +0 -1
- package/internals/models/muiPickersAdapter.d.ts +1 -10
- package/internals/models/props/basePickerProps.d.ts +3 -3
- package/internals/models/props/tabs.d.ts +1 -1
- package/internals/models/props/toolbar.d.ts +1 -1
- package/internals/utils/time-utils.d.ts +2 -1
- package/internals/utils/utils.d.ts +1 -1
- package/internals/utils/utils.js +3 -3
- package/internals/utils/validation.d.ts +1 -1
- package/internals/utils/valueManagers.d.ts +2 -4
- package/internals/utils/valueManagers.js +8 -8
- package/internals/utils/views.d.ts +1 -1
- package/legacy/AdapterDateFnsJalali/index.js +68 -0
- package/legacy/AdapterLuxon/index.js +12 -3
- package/legacy/index.js +1 -1
- package/legacy/internals/demo/DemoContainer.js +12 -6
- package/legacy/internals/hooks/useField/useField.js +10 -8
- package/legacy/internals/hooks/useField/useField.utils.js +76 -54
- package/legacy/internals/hooks/useField/useFieldState.js +94 -67
- package/legacy/internals/hooks/useViews.js +10 -0
- package/legacy/internals/index.js +1 -1
- package/legacy/internals/models/index.js +0 -1
- package/legacy/internals/utils/utils.js +3 -3
- package/legacy/internals/utils/valueManagers.js +10 -12
- package/legacy/locales/daDK.js +91 -0
- package/legacy/locales/nbNO.js +12 -10
- package/legacy/locales/svSE.js +12 -10
- package/legacy/models/index.js +3 -1
- package/locales/daDK.d.ts +51 -0
- package/locales/daDK.js +59 -0
- package/locales/nbNO.js +8 -10
- package/locales/nlNL.d.ts +4 -4
- package/locales/svSE.js +8 -10
- package/locales/utils/pickersLocaleTextApi.d.ts +2 -1
- package/models/fields.d.ts +117 -0
- package/models/fields.js +1 -0
- package/models/index.d.ts +3 -6
- package/models/index.js +3 -1
- package/models/validation.d.ts +8 -0
- package/models/validation.js +1 -0
- package/models/views.js +1 -0
- package/modern/AdapterDateFnsJalali/index.js +68 -0
- package/modern/AdapterLuxon/index.js +12 -3
- package/modern/index.js +1 -1
- package/modern/internals/demo/DemoContainer.js +15 -7
- package/modern/internals/hooks/useField/useField.js +8 -6
- package/modern/internals/hooks/useField/useField.utils.js +68 -50
- package/modern/internals/hooks/useField/useFieldState.js +88 -62
- package/modern/internals/hooks/useViews.js +8 -0
- package/modern/internals/index.js +1 -1
- package/modern/internals/models/index.js +0 -1
- package/modern/internals/utils/utils.js +3 -3
- package/modern/internals/utils/valueManagers.js +8 -8
- package/modern/locales/daDK.js +56 -0
- package/modern/locales/nbNO.js +8 -10
- package/modern/locales/svSE.js +8 -10
- package/modern/models/fields.js +1 -0
- package/modern/models/index.js +3 -1
- package/modern/models/validation.js +1 -0
- package/modern/models/views.js +1 -0
- package/node/AdapterDateFnsJalali/index.js +68 -0
- package/node/AdapterLuxon/index.js +12 -3
- package/node/index.js +1 -1
- package/node/internals/demo/DemoContainer.js +15 -7
- package/node/internals/hooks/useField/useField.js +8 -6
- package/node/internals/hooks/useField/useField.utils.js +71 -52
- package/node/internals/hooks/useField/useFieldState.js +87 -61
- package/node/internals/hooks/useViews.js +8 -0
- package/node/internals/index.js +0 -6
- package/node/internals/models/index.js +0 -11
- package/node/internals/utils/utils.js +3 -3
- package/node/internals/utils/valueManagers.js +7 -7
- package/node/locales/daDK.js +62 -0
- package/node/locales/nbNO.js +8 -10
- package/node/locales/svSE.js +8 -10
- package/node/models/index.js +33 -0
- package/node/models/validation.js +5 -0
- package/node/models/views.js +5 -0
- package/package.json +1 -1
- package/themeAugmentation/props.d.ts +1 -1
- package/timeViewRenderers/timeViewRenderers.d.ts +1 -1
- /package/{internals/models/views.js → legacy/models/fields.js} +0 -0
- /package/legacy/{internals/models/views.js → models/validation.js} +0 -0
- /package/{modern/internals → legacy}/models/views.js +0 -0
- /package/{internals/models → models}/views.d.ts +0 -0
- /package/node/{internals/models/views.js → models/fields.js} +0 -0
|
@@ -31,6 +31,74 @@ const formatTokenMap = {
|
|
|
31
31
|
// Day of the month
|
|
32
32
|
d: 'day',
|
|
33
33
|
dd: 'day',
|
|
34
|
+
do: 'day',
|
|
35
|
+
// Day of the week
|
|
36
|
+
E: {
|
|
37
|
+
sectionType: 'weekDay',
|
|
38
|
+
contentType: 'letter'
|
|
39
|
+
},
|
|
40
|
+
EE: {
|
|
41
|
+
sectionType: 'weekDay',
|
|
42
|
+
contentType: 'letter'
|
|
43
|
+
},
|
|
44
|
+
EEE: {
|
|
45
|
+
sectionType: 'weekDay',
|
|
46
|
+
contentType: 'letter'
|
|
47
|
+
},
|
|
48
|
+
EEEE: {
|
|
49
|
+
sectionType: 'weekDay',
|
|
50
|
+
contentType: 'letter'
|
|
51
|
+
},
|
|
52
|
+
EEEEE: {
|
|
53
|
+
sectionType: 'weekDay',
|
|
54
|
+
contentType: 'letter'
|
|
55
|
+
},
|
|
56
|
+
i: 'weekDay',
|
|
57
|
+
ii: 'weekDay',
|
|
58
|
+
iii: {
|
|
59
|
+
sectionType: 'weekDay',
|
|
60
|
+
contentType: 'letter'
|
|
61
|
+
},
|
|
62
|
+
iiii: {
|
|
63
|
+
sectionType: 'weekDay',
|
|
64
|
+
contentType: 'letter'
|
|
65
|
+
},
|
|
66
|
+
e: 'weekDay',
|
|
67
|
+
ee: 'weekDay',
|
|
68
|
+
eee: {
|
|
69
|
+
sectionType: 'weekDay',
|
|
70
|
+
contentType: 'letter'
|
|
71
|
+
},
|
|
72
|
+
eeee: {
|
|
73
|
+
sectionType: 'weekDay',
|
|
74
|
+
contentType: 'letter'
|
|
75
|
+
},
|
|
76
|
+
eeeee: {
|
|
77
|
+
sectionType: 'weekDay',
|
|
78
|
+
contentType: 'letter'
|
|
79
|
+
},
|
|
80
|
+
eeeeee: {
|
|
81
|
+
sectionType: 'weekDay',
|
|
82
|
+
contentType: 'letter'
|
|
83
|
+
},
|
|
84
|
+
c: 'weekDay',
|
|
85
|
+
cc: 'weekDay',
|
|
86
|
+
ccc: {
|
|
87
|
+
sectionType: 'weekDay',
|
|
88
|
+
contentType: 'letter'
|
|
89
|
+
},
|
|
90
|
+
cccc: {
|
|
91
|
+
sectionType: 'weekDay',
|
|
92
|
+
contentType: 'letter'
|
|
93
|
+
},
|
|
94
|
+
ccccc: {
|
|
95
|
+
sectionType: 'weekDay',
|
|
96
|
+
contentType: 'letter'
|
|
97
|
+
},
|
|
98
|
+
cccccc: {
|
|
99
|
+
sectionType: 'weekDay',
|
|
100
|
+
contentType: 'letter'
|
|
101
|
+
},
|
|
34
102
|
// Meridiem
|
|
35
103
|
a: 'meridiem',
|
|
36
104
|
aa: 'meridiem',
|
package/AdapterLuxon/index.js
CHANGED
|
@@ -84,12 +84,21 @@ export class AdapterLuxon extends BaseAdapterLuxon {
|
|
|
84
84
|
if (!DateTime.expandFormat) {
|
|
85
85
|
throw Error('Your luxon version does not support `expandFormat`. Consider upgrading it to v3.0.2');
|
|
86
86
|
}
|
|
87
|
+
// Extract escaped section to avoid entending them
|
|
88
|
+
const longFormatRegexp = /''|'(''|[^'])+('|$)|[^']*/g;
|
|
89
|
+
return format.match(longFormatRegexp).map(token => {
|
|
90
|
+
const firstCharacter = token[0];
|
|
91
|
+
if (firstCharacter === "'") {
|
|
92
|
+
return token;
|
|
93
|
+
}
|
|
94
|
+
return DateTime.expandFormat(token, {
|
|
95
|
+
locale: this.locale
|
|
96
|
+
});
|
|
97
|
+
}).join('')
|
|
87
98
|
// The returned format can contain `yyyyy` which means year between 4 and 6 digits.
|
|
88
99
|
// This value is supported by luxon parser but not luxon formatter.
|
|
89
100
|
// To avoid conflicts, we replace it by 4 digits which is enough for most use-cases.
|
|
90
|
-
|
|
91
|
-
locale: this.locale
|
|
92
|
-
}).replace('yyyyy', 'yyyy');
|
|
101
|
+
.replace('yyyyy', 'yyyy');
|
|
93
102
|
};
|
|
94
103
|
// Redefined here just to show how it can be written using expandFormat
|
|
95
104
|
this.getFormatHelperText = format => {
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,67 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 6.0.4
|
|
7
|
+
|
|
8
|
+
_Mar 30, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🌍 Add Danish (da-DK), and improve Norwegian (nb-NO), Spanish (es-ES), and Swedish (sv-SE) locales
|
|
13
|
+
- 🐞 Bugfixes
|
|
14
|
+
- 📚 Documentation improvements
|
|
15
|
+
|
|
16
|
+
### `@mui/x-data-grid@v6.0.4` / `@mui/x-data-grid-pro@v6.0.4` / `@mui/x-data-grid-premium@v6.0.4`
|
|
17
|
+
|
|
18
|
+
#### Changes
|
|
19
|
+
|
|
20
|
+
- [DataGrid] Fix column header tooltip not showing when the title is truncated (#8433) @rohitnatesh
|
|
21
|
+
- [DataGrid] Fix filter model buttons' display condition (#8415) @MBilalShafi
|
|
22
|
+
- [DataGrid] Fix infinite rerender in a flex parent (#8436) @cherniavskii
|
|
23
|
+
- [DataGrid] Prevent reopening column menu when clicking in the button while it is open (#8286) @tanuj-22
|
|
24
|
+
- [DataGrid] Rename `components` by `slots` in column menu API (#7999) @MBilalShafi
|
|
25
|
+
- [DataGrid] Remove hardcoded CSS classes' usages (#8444) @MBilalShafi
|
|
26
|
+
- [DataGridPremium] Fix aggregation initial state causing issue with quick filter (#8441) @MBilalShafi
|
|
27
|
+
- [l10n] Improve Danish (da-DK) locale (#8368) @BossElijah
|
|
28
|
+
- [l10n] Improve Danish (da-DK) locale (#8378) @BossElijah
|
|
29
|
+
- [l10n] Improve Norwegian (nb-NO) locale (#8367) @BossElijah
|
|
30
|
+
- [l10n] Improve Norwegian (nb-NO) locale (#8409) @BossElijah
|
|
31
|
+
- [l10n] Improve Spanish (es-ES) locale (#8420) @martjanz
|
|
32
|
+
- [l10n] Improve Swedish (sv-SE) locale (#8381) @BossElijah
|
|
33
|
+
|
|
34
|
+
### `@mui/x-date-pickers@v6.0.4` / `@mui/x-date-pickers-pro@v6.0.4`
|
|
35
|
+
|
|
36
|
+
#### Changes
|
|
37
|
+
|
|
38
|
+
- [fields] Add missing tokens to `AdapterDateFnsJalali` (#8402) @flaviendelangle
|
|
39
|
+
- [fields] Clean the active date manager (#8370) @flaviendelangle
|
|
40
|
+
- [fields] Cleanup `useFieldState` (#8292) @flaviendelangle
|
|
41
|
+
- [fields] Only add RTL characters when needed (#8325) @flaviendelangle
|
|
42
|
+
- [pickers] Add support for single input fields in range pickers (#7927) @flaviendelangle
|
|
43
|
+
- [pickers] Allows non token characters in format (#8256) @alexfauquette
|
|
44
|
+
- [pickers] Avoid root imports and move public models to the models folder (#8337) @flaviendelangle
|
|
45
|
+
- [pickers] Update `view` when `views` or `openTo` changes (#8361) @LukasTy
|
|
46
|
+
- [l10n] Improve Norwegian (nb-NO) locale (#8382) @BossElijah
|
|
47
|
+
- [l10n] Add Danish (da-DK) locale (#8379) @BossElijah
|
|
48
|
+
- [l10n] Improve Swedish (sv-SE) locale (#8381) @BossElijah
|
|
49
|
+
|
|
50
|
+
### `@mui/x-codemod@v6.0.4`
|
|
51
|
+
|
|
52
|
+
#### Changes
|
|
53
|
+
|
|
54
|
+
- [codemod] Fix `remove-stabilized-experimentalFeatures` codemod (#8289) @alexfauquette
|
|
55
|
+
|
|
56
|
+
### Docs
|
|
57
|
+
|
|
58
|
+
- [docs] Fix `GridCellParams` signature in migration guide (#8427) @cherniavskii
|
|
59
|
+
- [docs] Fix "Custom field" demos responsive styles (#8408) @LukasTy
|
|
60
|
+
- [docs] Remove `label` from demos where it reduces clarity (#8416) @LukasTy
|
|
61
|
+
- [docs] Update slots' references in Data Grid migration guide (#8159) @MBilalShafi
|
|
62
|
+
|
|
63
|
+
### Core
|
|
64
|
+
|
|
65
|
+
- [charts] Work on typing (#8421) @flaviendelangle
|
|
66
|
+
|
|
6
67
|
## 6.0.3
|
|
7
68
|
|
|
8
69
|
_Mar 23, 2023_
|
|
@@ -7,7 +7,7 @@ import { DateCalendarClasses } from './dateCalendarClasses';
|
|
|
7
7
|
import { BaseDateValidationProps, YearValidationProps, MonthValidationProps, DayValidationProps } from '../internals/hooks/validation/models';
|
|
8
8
|
import { PickerSelectionState } from '../internals/hooks/usePicker/usePickerValue';
|
|
9
9
|
import { ExportedUseViewsOptions } from '../internals/hooks/useViews';
|
|
10
|
-
import { DateView } from '../
|
|
10
|
+
import { DateView } from '../models';
|
|
11
11
|
import { DefaultizedProps } from '../internals/models/helpers';
|
|
12
12
|
import { SlotsAndSlotProps } from '../internals/utils/slots-migration';
|
|
13
13
|
import { ExportedYearCalendarProps } from '../YearCalendar/YearCalendar.types';
|
|
@@ -5,7 +5,7 @@ import SvgIcon from '@mui/material/SvgIcon';
|
|
|
5
5
|
import { SlideDirection } from './PickersSlideTransition';
|
|
6
6
|
import { DateComponentValidationProps } from '../internals/hooks/validation/useDateValidation';
|
|
7
7
|
import { ExportedPickersArrowSwitcherProps, PickersArrowSwitcherSlotsComponent, PickersArrowSwitcherSlotsComponentsProps } from '../internals/components/PickersArrowSwitcher';
|
|
8
|
-
import { DateView } from '../
|
|
8
|
+
import { DateView } from '../models';
|
|
9
9
|
import { PickersCalendarHeaderClasses } from './pickersCalendarHeaderClasses';
|
|
10
10
|
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
11
11
|
export type ExportedCalendarHeaderProps<TDate> = Pick<PickersCalendarHeaderProps<TDate>, 'classes'>;
|
package/DateCalendar/index.d.ts
CHANGED
|
@@ -12,4 +12,3 @@ export type { PickersFadeTransitionGroupClassKey, PickersFadeTransitionGroupClas
|
|
|
12
12
|
export { pickersSlideTransitionClasses } from './pickersSlideTransitionClasses';
|
|
13
13
|
export type { PickersSlideTransitionClassKey, PickersSlideTransitionClasses, } from './pickersSlideTransitionClasses';
|
|
14
14
|
export type { ExportedSlideTransitionProps } from './PickersSlideTransition';
|
|
15
|
-
export type { DateView } from '../internals/models';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SlotComponentProps } from '@mui/base/utils';
|
|
3
3
|
import TextField from '@mui/material/TextField';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { DateValidationError, FieldSection } from '../models';
|
|
5
|
+
import { UseFieldInternalProps } from '../internals/hooks/useField';
|
|
6
6
|
import { DefaultizedProps, MakeOptional } from '../internals/models/helpers';
|
|
7
7
|
import { BaseDateValidationProps, DayValidationProps, MonthValidationProps, YearValidationProps } from '../internals/hooks/validation/models';
|
|
8
8
|
import { FieldsTextFieldProps } from '../internals';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
3
|
import { BaseToolbarProps, ExportedBaseToolbarProps } from '../internals/models/props/toolbar';
|
|
4
|
-
import { DateView } from '../
|
|
4
|
+
import { DateView } from '../models';
|
|
5
5
|
import { DatePickerToolbarClasses } from './datePickerToolbarClasses';
|
|
6
6
|
export interface DatePickerToolbarProps<TDate> extends BaseToolbarProps<TDate | null, DateView> {
|
|
7
7
|
classes?: Partial<DatePickerToolbarClasses>;
|
package/DatePicker/shared.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DefaultizedProps } from '../internals/models/helpers';
|
|
3
3
|
import { DateCalendarSlotsComponent, DateCalendarSlotsComponentsProps, ExportedDateCalendarProps } from '../DateCalendar/DateCalendar.types';
|
|
4
|
-
import { DateValidationError } from '../
|
|
4
|
+
import { DateValidationError, DateView } from '../models';
|
|
5
5
|
import { BasePickerInputProps } from '../internals/models/props/basePickerProps';
|
|
6
|
-
import { BaseDateValidationProps,
|
|
6
|
+
import { BaseDateValidationProps, MuiPickersAdapter, UncapitalizeObjectKeys } from '../internals';
|
|
7
7
|
import { LocalizedComponent } from '../locales/utils/pickersLocaleTextApi';
|
|
8
8
|
import { DatePickerToolbarProps, ExportedDatePickerToolbarProps } from './DatePickerToolbar';
|
|
9
9
|
import { PickerViewRendererLookup } from '../internals/hooks/usePicker/usePickerViews';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SlotComponentProps } from '@mui/base/utils';
|
|
3
3
|
import TextField from '@mui/material/TextField';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { DateTimeValidationError, FieldSection } from '../models';
|
|
5
|
+
import { UseFieldInternalProps } from '../internals/hooks/useField';
|
|
6
6
|
import { DefaultizedProps, MakeOptional } from '../internals/models/helpers';
|
|
7
7
|
import { BaseDateValidationProps, BaseTimeValidationProps, DayValidationProps, MonthValidationProps, TimeValidationProps, YearValidationProps } from '../internals/hooks/validation/models';
|
|
8
8
|
import { FieldsTextFieldProps, UncapitalizeObjectKeys } from '../internals';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DateOrTimeView } from '../
|
|
2
|
+
import { DateOrTimeView } from '../models';
|
|
3
3
|
import { DateTimePickerTabsClasses } from './dateTimePickerTabsClasses';
|
|
4
4
|
import { BaseTabsProps, ExportedBaseTabsProps } from '../internals/models/props/tabs';
|
|
5
5
|
export interface ExportedDateTimePickerTabsProps extends ExportedBaseTabsProps {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BaseToolbarProps, ExportedBaseToolbarProps } from '../internals/models/props/toolbar';
|
|
3
3
|
import { DateTimePickerToolbarClasses } from './dateTimePickerToolbarClasses';
|
|
4
|
-
import { DateOrTimeView } from '../
|
|
4
|
+
import { DateOrTimeView } from '../models';
|
|
5
5
|
export interface ExportedDateTimePickerToolbarProps extends ExportedBaseToolbarProps {
|
|
6
6
|
ampm?: boolean;
|
|
7
7
|
ampmInClock?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DefaultizedProps } from '../internals/models/helpers';
|
|
3
|
-
import { DateOrTimeView } from '../
|
|
3
|
+
import { DateOrTimeView, DateTimeValidationError } from '../models';
|
|
4
4
|
import { DateCalendarSlotsComponent, DateCalendarSlotsComponentsProps, ExportedDateCalendarProps } from '../DateCalendar/DateCalendar.types';
|
|
5
5
|
import { TimeClockSlotsComponent, TimeClockSlotsComponentsProps, ExportedTimeClockProps } from '../TimeClock/TimeClock.types';
|
|
6
6
|
import { BasePickerInputProps } from '../internals/models/props/basePickerProps';
|
|
@@ -8,7 +8,6 @@ import { DateTimePickerTabsProps, ExportedDateTimePickerTabsProps } from './Date
|
|
|
8
8
|
import { BaseDateValidationProps, BaseTimeValidationProps } from '../internals/hooks/validation/models';
|
|
9
9
|
import { LocalizedComponent } from '../locales/utils/pickersLocaleTextApi';
|
|
10
10
|
import { DateTimePickerToolbarProps, ExportedDateTimePickerToolbarProps } from './DateTimePickerToolbar';
|
|
11
|
-
import { DateTimeValidationError } from '../internals/hooks/validation/useDateTimeValidation';
|
|
12
11
|
import { PickerViewRendererLookup } from '../internals/hooks/usePicker/usePickerViews';
|
|
13
12
|
import { DateViewRendererProps } from '../dateViewRenderers';
|
|
14
13
|
import { TimeViewRendererProps } from '../timeViewRenderers';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseDesktopPickerSlotsComponent, ExportedUseDesktopPickerSlotsComponentsProps, DesktopOnlyPickerProps } from '../internals/hooks/useDesktopPicker';
|
|
2
2
|
import { BaseDatePickerProps, BaseDatePickerSlotsComponent, BaseDatePickerSlotsComponentsProps } from '../DatePicker/shared';
|
|
3
3
|
import { MakeOptional } from '../internals/models/helpers';
|
|
4
|
-
import { DateView } from '../
|
|
4
|
+
import { DateView } from '../models';
|
|
5
5
|
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
6
6
|
export interface DesktopDatePickerSlotsComponent<TDate> extends BaseDatePickerSlotsComponent<TDate>, MakeOptional<UseDesktopPickerSlotsComponent<TDate, DateView>, 'Field' | 'OpenPickerIcon'> {
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseDesktopPickerSlotsComponent, ExportedUseDesktopPickerSlotsComponentsProps, DesktopOnlyPickerProps } from '../internals/hooks/useDesktopPicker';
|
|
2
2
|
import { BaseDateTimePickerProps, BaseDateTimePickerSlotsComponent, BaseDateTimePickerSlotsComponentsProps } from '../DateTimePicker/shared';
|
|
3
3
|
import { MakeOptional } from '../internals/models/helpers';
|
|
4
|
-
import { DateOrTimeView } from '../
|
|
4
|
+
import { DateOrTimeView } from '../models';
|
|
5
5
|
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
6
6
|
export interface DesktopDateTimePickerSlotsComponent<TDate> extends BaseDateTimePickerSlotsComponent<TDate>, MakeOptional<UseDesktopPickerSlotsComponent<TDate, DateOrTimeView>, 'Field' | 'OpenPickerIcon'> {
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseDesktopPickerSlotsComponent, ExportedUseDesktopPickerSlotsComponentsProps, DesktopOnlyPickerProps } from '../internals/hooks/useDesktopPicker';
|
|
2
2
|
import { BaseTimePickerProps, BaseTimePickerSlotsComponent, BaseTimePickerSlotsComponentsProps } from '../TimePicker/shared';
|
|
3
3
|
import { MakeOptional } from '../internals/models/helpers';
|
|
4
|
-
import { TimeView } from '../
|
|
4
|
+
import { TimeView } from '../models';
|
|
5
5
|
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
6
6
|
export interface DesktopTimePickerSlotsComponent<TDate> extends BaseTimePickerSlotsComponent<TDate>, MakeOptional<UseDesktopPickerSlotsComponent<TDate, TimeView>, 'Field' | 'OpenPickerIcon'> {
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseMobilePickerSlotsComponent, MobileOnlyPickerProps, ExportedUseMobilePickerSlotsComponentsProps } from '../internals/hooks/useMobilePicker';
|
|
2
2
|
import { BaseDatePickerProps, BaseDatePickerSlotsComponent, BaseDatePickerSlotsComponentsProps } from '../DatePicker/shared';
|
|
3
3
|
import { MakeOptional } from '../internals/models/helpers';
|
|
4
|
-
import { DateView } from '../
|
|
4
|
+
import { DateView } from '../models';
|
|
5
5
|
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
6
6
|
export interface MobileDatePickerSlotsComponent<TDate> extends BaseDatePickerSlotsComponent<TDate>, MakeOptional<UseMobilePickerSlotsComponent<TDate, DateView>, 'Field'> {
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseMobilePickerSlotsComponent, ExportedUseMobilePickerSlotsComponentsProps, MobileOnlyPickerProps } from '../internals/hooks/useMobilePicker';
|
|
2
2
|
import { BaseDateTimePickerProps, BaseDateTimePickerSlotsComponent, BaseDateTimePickerSlotsComponentsProps } from '../DateTimePicker/shared';
|
|
3
3
|
import { MakeOptional } from '../internals/models/helpers';
|
|
4
|
-
import { DateOrTimeView } from '../
|
|
4
|
+
import { DateOrTimeView } from '../models';
|
|
5
5
|
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
6
6
|
export interface MobileDateTimePickerSlotsComponent<TDate> extends BaseDateTimePickerSlotsComponent<TDate>, MakeOptional<UseMobilePickerSlotsComponent<TDate, DateOrTimeView>, 'Field'> {
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseMobilePickerSlotsComponent, ExportedUseMobilePickerSlotsComponentsProps, MobileOnlyPickerProps } from '../internals/hooks/useMobilePicker';
|
|
2
2
|
import { BaseTimePickerProps, BaseTimePickerSlotsComponent, BaseTimePickerSlotsComponentsProps } from '../TimePicker/shared';
|
|
3
3
|
import { MakeOptional } from '../internals/models/helpers';
|
|
4
|
-
import { TimeView } from '../
|
|
4
|
+
import { TimeView } from '../models';
|
|
5
5
|
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
6
6
|
export interface MobileTimePickerSlotsComponent<TDate> extends BaseTimePickerSlotsComponent<TDate>, MakeOptional<UseMobilePickerSlotsComponent<TDate, TimeView>, 'Field'> {
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { PickersLayoutProps } from './PickersLayout.types';
|
|
3
|
-
import { DateOrTimeView } from '../
|
|
3
|
+
import { DateOrTimeView } from '../models';
|
|
4
4
|
declare const PickersLayoutRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
5
5
|
ownerState: {
|
|
6
6
|
isLandscape: boolean;
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
3
|
import { SlotComponentProps } from '@mui/base/utils';
|
|
4
4
|
import { PickersActionBarProps } from '../PickersActionBar';
|
|
5
|
-
import { DateOrTimeView } from '../
|
|
5
|
+
import { DateOrTimeView } from '../models';
|
|
6
6
|
import { BaseToolbarProps, ExportedBaseToolbarProps } from '../internals/models/props/toolbar';
|
|
7
7
|
import { BaseTabsProps, ExportedBaseTabsProps } from '../internals/models/props/tabs';
|
|
8
8
|
import { UsePickerLayoutPropsResponseLayoutProps } from '../internals/hooks/usePicker/usePickerLayoutProps';
|
package/PickersLayout/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { PickersLayout, PickersLayoutRoot, PickersLayoutContentWrapper } from './PickersLayout';
|
|
2
|
-
export type { PickersLayoutProps, PickersLayoutSlotsComponent, PickersLayoutSlotsComponentsProps, } from './PickersLayout.types';
|
|
2
|
+
export type { PickersLayoutProps, PickersLayoutSlotsComponent, PickersLayoutSlotsComponentsProps, ExportedPickersLayoutSlotsComponent, ExportedPickersLayoutSlotsComponentsProps, } from './PickersLayout.types';
|
|
3
3
|
export { default as usePickerLayout } from './usePickerLayout';
|
|
4
4
|
export { pickersLayoutClasses } from './pickersLayoutClasses';
|
|
5
5
|
export type { PickersLayoutClassKey } from './pickersLayoutClasses';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PickersLayoutProps, SubComponents } from './PickersLayout.types';
|
|
2
|
-
import { DateOrTimeView } from '../
|
|
2
|
+
import { DateOrTimeView } from '../models';
|
|
3
3
|
interface UsePickerLayoutResponse extends SubComponents {
|
|
4
4
|
}
|
|
5
5
|
declare const usePickerLayout: <TValue, TDate, TView extends DateOrTimeView>(props: PickersLayoutProps<TValue, TDate, TView>) => UsePickerLayoutResponse;
|
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ After installation completed, you have to set the `dateAdapter` prop of the `Loc
|
|
|
54
54
|
The supported adapters are exported from `@mui/x-date-pickers`.
|
|
55
55
|
|
|
56
56
|
```jsx
|
|
57
|
-
import { LocalizationProvider } from '@mui/x-date-pickers';
|
|
57
|
+
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
|
58
58
|
// date-fns
|
|
59
59
|
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
|
|
60
60
|
// or for dayjs
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseDatePickerProps, BaseDatePickerSlotsComponent, BaseDatePickerSlotsComponentsProps } from '../DatePicker/shared';
|
|
2
2
|
import { StaticOnlyPickerProps, UseStaticPickerSlotsComponent, UseStaticPickerSlotsComponentsProps } from '../internals/hooks/useStaticPicker';
|
|
3
|
-
import {
|
|
3
|
+
import { MakeOptional, UncapitalizeObjectKeys } from '../internals';
|
|
4
|
+
import { DateView } from '../models';
|
|
4
5
|
export interface StaticDatePickerSlotsComponent<TDate> extends BaseDatePickerSlotsComponent<TDate>, UseStaticPickerSlotsComponent<TDate, DateView> {
|
|
5
6
|
}
|
|
6
7
|
export interface StaticDatePickerSlotsComponentsProps<TDate> extends BaseDatePickerSlotsComponentsProps<TDate>, UseStaticPickerSlotsComponentsProps<TDate, DateView> {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseDateTimePickerProps, BaseDateTimePickerSlotsComponent, BaseDateTimePickerSlotsComponentsProps } from '../DateTimePicker/shared';
|
|
2
2
|
import { StaticOnlyPickerProps, UseStaticPickerSlotsComponent, UseStaticPickerSlotsComponentsProps } from '../internals/hooks/useStaticPicker';
|
|
3
|
-
import {
|
|
3
|
+
import { MakeOptional, UncapitalizeObjectKeys } from '../internals';
|
|
4
|
+
import { DateOrTimeView } from '../models';
|
|
4
5
|
export interface StaticDateTimePickerSlotsComponent<TDate> extends BaseDateTimePickerSlotsComponent<TDate>, UseStaticPickerSlotsComponent<TDate, DateOrTimeView> {
|
|
5
6
|
}
|
|
6
7
|
export interface StaticDateTimePickerSlotsComponentsProps<TDate> extends BaseDateTimePickerSlotsComponentsProps<TDate>, UseStaticPickerSlotsComponentsProps<TDate, DateOrTimeView> {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseTimePickerProps, BaseTimePickerSlotsComponent, BaseTimePickerSlotsComponentsProps } from '../TimePicker/shared';
|
|
2
2
|
import { StaticOnlyPickerProps, UseStaticPickerSlotsComponent, UseStaticPickerSlotsComponentsProps } from '../internals/hooks/useStaticPicker';
|
|
3
|
-
import { MakeOptional,
|
|
3
|
+
import { MakeOptional, UncapitalizeObjectKeys } from '../internals';
|
|
4
|
+
import { TimeView } from '../models';
|
|
4
5
|
export interface StaticTimePickerSlotsComponent<TDate> extends BaseTimePickerSlotsComponent<TDate>, UseStaticPickerSlotsComponent<TDate, TimeView> {
|
|
5
6
|
}
|
|
6
7
|
export interface StaticTimePickerSlotsComponentsProps<TDate> extends BaseTimePickerSlotsComponentsProps, UseStaticPickerSlotsComponentsProps<TDate, TimeView> {
|
package/TimeClock/Clock.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { PickerSelectionState } from '../internals/hooks/usePicker';
|
|
3
3
|
import { useMeridiemMode } from '../internals/hooks/date-helpers-hooks';
|
|
4
|
-
import { TimeView } from '../
|
|
4
|
+
import { TimeView } from '../models';
|
|
5
5
|
import { ClockClasses } from './clockClasses';
|
|
6
6
|
export interface ClockProps<TDate> extends ReturnType<typeof useMeridiemMode> {
|
|
7
7
|
ampm: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { TimeView } from '../
|
|
2
|
+
import { TimeView } from '../models';
|
|
3
3
|
import { ClockPointerClasses } from './clockPointerClasses';
|
|
4
4
|
export interface ClockPointerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
hasSelected: boolean;
|
|
@@ -3,7 +3,7 @@ import { Theme } from '@mui/material/styles';
|
|
|
3
3
|
import { TimeClockClasses } from './timeClockClasses';
|
|
4
4
|
import { TimeValidationProps, BaseTimeValidationProps } from '../internals/hooks/validation/models';
|
|
5
5
|
import { PickersArrowSwitcherSlotsComponent, PickersArrowSwitcherSlotsComponentsProps } from '../internals/components/PickersArrowSwitcher';
|
|
6
|
-
import { TimeView } from '../
|
|
6
|
+
import { TimeView } from '../models';
|
|
7
7
|
import { PickerSelectionState } from '../internals/hooks/usePicker/usePickerValue';
|
|
8
8
|
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
9
9
|
export interface ExportedTimeClockProps<TDate> extends TimeValidationProps<TDate>, BaseTimeValidationProps {
|
package/TimeClock/index.d.ts
CHANGED
|
@@ -11,4 +11,3 @@ export type { TimeClockClasses, TimeClockClassKey } from './timeClockClasses';
|
|
|
11
11
|
export { clockPointerClasses } from './clockPointerClasses';
|
|
12
12
|
export type { ClockPointerClasses, ClockPointerClassKey } from './clockPointerClasses';
|
|
13
13
|
export type { ClockPointerProps } from './ClockPointer';
|
|
14
|
-
export type { TimeView } from '../internals/models';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SlotComponentProps } from '@mui/base/utils';
|
|
3
3
|
import TextField from '@mui/material/TextField';
|
|
4
|
-
import {
|
|
5
|
-
import { TimeValidationError } from '../internals/hooks/validation/useTimeValidation';
|
|
4
|
+
import { UseFieldInternalProps } from '../internals/hooks/useField';
|
|
6
5
|
import { DefaultizedProps, MakeOptional } from '../internals/models/helpers';
|
|
7
6
|
import { BaseTimeValidationProps, TimeValidationProps } from '../internals/hooks/validation/models';
|
|
8
7
|
import { FieldsTextFieldProps, UncapitalizeObjectKeys } from '../internals';
|
|
8
|
+
import { FieldSection, TimeValidationError } from '../models';
|
|
9
9
|
export interface UseTimeFieldParams<TDate, TChildProps extends {}> {
|
|
10
10
|
props: UseTimeFieldComponentProps<TDate, TChildProps>;
|
|
11
11
|
inputRef?: React.Ref<HTMLInputElement>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BaseToolbarProps, ExportedBaseToolbarProps } from '../internals/models/props/toolbar';
|
|
3
3
|
import { TimePickerToolbarClasses } from './timePickerToolbarClasses';
|
|
4
|
-
import { TimeView } from '../
|
|
4
|
+
import { TimeView } from '../models';
|
|
5
5
|
export interface TimePickerToolbarProps<TDate> extends BaseToolbarProps<TDate | null, TimeView> {
|
|
6
6
|
ampm?: boolean;
|
|
7
7
|
ampmInClock?: boolean;
|
package/TimePicker/shared.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DefaultizedProps } from '../internals/models/helpers';
|
|
3
|
-
import { TimeView } from '../TimeClock';
|
|
4
3
|
import { TimeClockSlotsComponent, TimeClockSlotsComponentsProps, ExportedTimeClockProps } from '../TimeClock/TimeClock.types';
|
|
5
4
|
import { BasePickerInputProps } from '../internals/models/props/basePickerProps';
|
|
6
5
|
import { BaseTimeValidationProps } from '../internals/hooks/validation/models';
|
|
7
6
|
import { LocalizedComponent } from '../locales/utils/pickersLocaleTextApi';
|
|
8
7
|
import { TimePickerToolbarProps, ExportedTimePickerToolbarProps } from './TimePickerToolbar';
|
|
9
|
-
import { TimeValidationError } from '../
|
|
8
|
+
import { TimeValidationError, TimeView } from '../models';
|
|
10
9
|
import { PickerViewRendererLookup } from '../internals/hooks/usePicker/usePickerViews';
|
|
11
10
|
import { TimeViewRendererProps } from '../timeViewRenderers';
|
|
12
11
|
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DateCalendarProps } from '../DateCalendar';
|
|
3
|
-
import { DateOrTimeView } from '../
|
|
3
|
+
import { DateOrTimeView } from '../models';
|
|
4
4
|
export interface DateViewRendererProps<TDate, TView extends DateOrTimeView> extends Omit<DateCalendarProps<TDate>, 'views' | 'openTo' | 'view' | 'onViewChange' | 'focusedView'> {
|
|
5
5
|
view: TView;
|
|
6
6
|
onViewChange?: (view: TView) => void;
|
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BaseToolbarProps } from '../models/props/toolbar';
|
|
3
3
|
import { PickersToolbarClasses } from './pickersToolbarClasses';
|
|
4
|
-
import { DateOrTimeView } from '
|
|
4
|
+
import { DateOrTimeView } from '../../models';
|
|
5
5
|
export interface PickersToolbarProps<TValue, TView extends DateOrTimeView> extends Pick<BaseToolbarProps<TValue, TView>, 'isLandscape' | 'hidden' | 'titleId'> {
|
|
6
6
|
className?: string;
|
|
7
7
|
landscapeDirection?: 'row' | 'column';
|
|
@@ -100,14 +100,22 @@ export function DemoContainer(props) {
|
|
|
100
100
|
if (childrenTypes.has('UI-view')) {
|
|
101
101
|
// noop
|
|
102
102
|
} else if (childrenTypes.has('single-input-range-field')) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
md: 400
|
|
103
|
+
if (!childrenSupportedSections.has('date-time')) {
|
|
104
|
+
sx = _extends({}, sx, {
|
|
105
|
+
[`& > .${textFieldClasses.root}`]: {
|
|
106
|
+
minWidth: 300
|
|
108
107
|
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
108
|
+
});
|
|
109
|
+
} else {
|
|
110
|
+
sx = _extends({}, sx, {
|
|
111
|
+
[`& > .${textFieldClasses.root}`]: {
|
|
112
|
+
minWidth: {
|
|
113
|
+
xs: 300,
|
|
114
|
+
md: 400
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
111
119
|
} else if (childrenSupportedSections.has('date-time')) {
|
|
112
120
|
sx = _extends({}, sx, {
|
|
113
121
|
[`& > .${textFieldClasses.root}`]: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { DateOrTimeView } from '../../models/views';
|
|
3
2
|
import { UseDesktopPickerParams, UseDesktopPickerProps } from './useDesktopPicker.types';
|
|
3
|
+
import { DateOrTimeView } from '../../../models';
|
|
4
4
|
/**
|
|
5
5
|
* Hook managing all the single-date desktop pickers:
|
|
6
6
|
* - DesktopDatePicker
|
|
@@ -3,16 +3,15 @@ import IconButton, { IconButtonProps } from '@mui/material/IconButton';
|
|
|
3
3
|
import { InputAdornmentProps } from '@mui/material/InputAdornment';
|
|
4
4
|
import TextField, { TextFieldProps } from '@mui/material/TextField';
|
|
5
5
|
import { SlotComponentProps } from '@mui/base/utils';
|
|
6
|
-
import {
|
|
7
|
-
import { BaseNonStaticPickerProps, BasePickerProps,
|
|
6
|
+
import { MuiPickersAdapter } from '../../models';
|
|
7
|
+
import { BaseNonStaticPickerProps, BasePickerProps, BaseNonRangeNonStaticPickerProps } from '../../models/props/basePickerProps';
|
|
8
8
|
import { PickersPopperSlotsComponent, PickersPopperSlotsComponentsProps } from '../../components/PickersPopper';
|
|
9
9
|
import { UsePickerParams, UsePickerProps } from '../usePicker';
|
|
10
|
-
import { BaseSingleInputFieldProps } from '
|
|
10
|
+
import { BaseSingleInputFieldProps, FieldSection, DateOrTimeView } from '../../../models';
|
|
11
11
|
import { ExportedPickersLayoutSlotsComponent, ExportedPickersLayoutSlotsComponentsProps, PickersLayoutSlotsComponentsProps } from '../../../PickersLayout/PickersLayout.types';
|
|
12
12
|
import { UsePickerValueNonStaticProps } from '../usePicker/usePickerValue';
|
|
13
13
|
import { UsePickerViewsNonStaticProps, UsePickerViewsProps } from '../usePicker/usePickerViews';
|
|
14
14
|
import { UncapitalizeObjectKeys } from '../../utils/slots-migration';
|
|
15
|
-
import { FieldSection } from '../useField';
|
|
16
15
|
export interface UseDesktopPickerSlotsComponent<TDate, TView extends DateOrTimeView> extends Pick<PickersPopperSlotsComponent, 'DesktopPaper' | 'DesktopTransition' | 'DesktopTrapFocus' | 'Popper'>, ExportedPickersLayoutSlotsComponent<TDate | null, TDate, TView> {
|
|
17
16
|
/**
|
|
18
17
|
* Component used to enter the date with the keyboard.
|
|
@@ -48,7 +47,7 @@ export interface ExportedUseDesktopPickerSlotsComponentsProps<TDate, TView exten
|
|
|
48
47
|
openPickerButton?: SlotComponentProps<typeof IconButton, {}, UseDesktopPickerProps<TDate, any, any, any>>;
|
|
49
48
|
openPickerIcon?: Record<string, any>;
|
|
50
49
|
}
|
|
51
|
-
export interface DesktopOnlyPickerProps<TDate> extends BaseNonStaticPickerProps,
|
|
50
|
+
export interface DesktopOnlyPickerProps<TDate> extends BaseNonStaticPickerProps, BaseNonRangeNonStaticPickerProps, UsePickerValueNonStaticProps<TDate | null, FieldSection>, UsePickerViewsNonStaticProps {
|
|
52
51
|
/**
|
|
53
52
|
* If `true`, the `input` element is focused during the first mount.
|
|
54
53
|
*/
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { useField } from './useField';
|
|
2
|
-
export type { FieldValueManager,
|
|
2
|
+
export type { FieldValueManager, UseFieldInternalProps, UseFieldForwardedProps, UseFieldParams, UseFieldResponse, FieldChangeHandler, FieldChangeHandlerContext, FieldRef, } from './useField.types';
|
|
3
3
|
export { splitFormatIntoSections, addPositionPropertiesToSections, createDateStrForInputFromSections, } from './useField.utils';
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UseFieldParams, UseFieldResponse, UseFieldForwardedProps, UseFieldInternalProps } from './useField.types';
|
|
2
|
+
import { FieldSection } from '../../../models';
|
|
2
3
|
export declare const useField: <TValue, TDate, TSection extends FieldSection, TForwardedProps extends UseFieldForwardedProps, TInternalProps extends UseFieldInternalProps<any, any, any>>(params: UseFieldParams<TValue, TDate, TSection, TForwardedProps, TInternalProps>) => UseFieldResponse<TForwardedProps>;
|