@mui/x-date-pickers-pro 8.0.0-alpha.7 → 8.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +115 -0
- package/DateRangeCalendar/DateRangeCalendar.js +4 -4
- package/DateRangePicker/DateRangePickerToolbar.js +3 -3
- package/DateTimeRangePicker/DateTimeRangePickerTabs.js +3 -3
- package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +2 -2
- package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +7 -7
- package/MultiInputDateRangeField/MultiInputDateRangeField.d.ts +9 -4
- package/MultiInputDateRangeField/MultiInputDateRangeField.js +12 -116
- package/MultiInputDateRangeField/index.d.ts +5 -3
- package/MultiInputDateRangeField/index.js +2 -2
- package/MultiInputDateRangeField/multiInputDateRangeFieldClasses.d.ts +6 -0
- package/MultiInputDateRangeField/multiInputDateRangeFieldClasses.js +4 -0
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.d.ts +9 -4
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +12 -116
- package/MultiInputDateTimeRangeField/index.d.ts +5 -3
- package/MultiInputDateTimeRangeField/index.js +2 -2
- package/MultiInputDateTimeRangeField/multiInputDateTimeRangeFieldClasses.d.ts +6 -0
- package/MultiInputDateTimeRangeField/multiInputDateTimeRangeFieldClasses.js +4 -0
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.d.ts +9 -4
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +13 -117
- package/MultiInputTimeRangeField/index.d.ts +5 -3
- package/MultiInputTimeRangeField/index.js +2 -2
- package/MultiInputTimeRangeField/multiInputTimeRangeFieldClasses.d.ts +6 -0
- package/MultiInputTimeRangeField/multiInputTimeRangeFieldClasses.js +4 -0
- package/SingleInputDateRangeField/SingleInputDateRangeField.js +20 -30
- package/SingleInputDateRangeField/SingleInputDateRangeField.types.d.ts +6 -17
- package/SingleInputDateRangeField/useSingleInputDateRangeField.d.ts +1 -1
- package/SingleInputDateRangeField/useSingleInputDateRangeField.js +2 -1
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +20 -30
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.types.d.ts +6 -18
- package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.d.ts +1 -1
- package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +2 -1
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +20 -30
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.types.d.ts +6 -18
- package/SingleInputTimeRangeField/useSingleInputTimeRangeField.d.ts +1 -1
- package/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +2 -1
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +2 -1
- package/hooks/useMultiInputRangeField/index.d.ts +1 -0
- package/hooks/useMultiInputRangeField/index.js +1 -0
- package/hooks/useMultiInputRangeField/useMultiInputRangeField.d.ts +53 -0
- package/hooks/useMultiInputRangeField/useMultiInputRangeField.js +149 -0
- package/{internals/hooks/useMultiInputFieldSelectedSections.d.ts → hooks/useMultiInputRangeField/useMultiInputRangeFieldSelectedSections.d.ts} +3 -4
- package/{modern/internals/hooks/useMultiInputFieldSelectedSections.js → hooks/useMultiInputRangeField/useMultiInputRangeFieldSelectedSections.js} +10 -8
- package/hooks/useMultiInputRangeField/useMultiInputRangeFieldTextFieldProps.d.ts +17 -0
- package/hooks/useMultiInputRangeField/useMultiInputRangeFieldTextFieldProps.js +59 -0
- package/index.js +1 -1
- package/internals/hooks/models/index.d.ts +1 -1
- package/internals/hooks/models/useRangePicker.d.ts +4 -6
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +32 -42
- package/internals/hooks/{useEnrichedRangePickerFieldProps.d.ts → useEnrichedRangePickerField.d.ts} +15 -6
- package/internals/hooks/{useEnrichedRangePickerFieldProps.js → useEnrichedRangePickerField.js} +39 -52
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +23 -32
- package/internals/hooks/useRangePosition.d.ts +1 -1
- package/internals/hooks/useRangePosition.js +1 -1
- package/internals/models/dateTimeRange.d.ts +1 -6
- package/internals/models/fields.d.ts +1 -2
- package/internals/models/index.d.ts +0 -1
- package/internals/models/index.js +0 -1
- package/internals/models/managers.d.ts +3 -0
- package/internals/utils/createMultiInputRangeField/createMultiInputRangeField.d.ts +3 -0
- package/internals/utils/createMultiInputRangeField/createMultiInputRangeField.js +133 -0
- package/internals/utils/createMultiInputRangeField/createMultiInputRangeField.types.d.ts +72 -0
- package/internals/utils/createMultiInputRangeField/index.d.ts +3 -0
- package/internals/utils/createMultiInputRangeField/index.js +2 -0
- package/internals/utils/releaseInfo.js +1 -1
- package/managers/index.d.ts +3 -3
- package/managers/useDateRangeManager.d.ts +1 -1
- package/managers/useDateRangeManager.js +3 -1
- package/managers/useDateTimeRangeManager.d.ts +1 -1
- package/managers/useDateTimeRangeManager.js +3 -1
- package/managers/useTimeRangeManager.d.ts +1 -1
- package/managers/useTimeRangeManager.js +3 -1
- package/models/fields.d.ts +1 -2
- package/models/index.d.ts +0 -2
- package/models/index.js +0 -2
- package/modern/DateRangeCalendar/DateRangeCalendar.js +4 -4
- package/modern/DateRangePicker/DateRangePickerToolbar.js +3 -3
- package/modern/DateTimeRangePicker/DateTimeRangePickerTabs.js +3 -3
- package/modern/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +2 -2
- package/modern/DateTimeRangePicker/DateTimeRangePickerToolbar.js +7 -7
- package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +12 -116
- package/modern/MultiInputDateRangeField/index.js +2 -2
- package/modern/MultiInputDateRangeField/multiInputDateRangeFieldClasses.js +4 -0
- package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +12 -116
- package/modern/MultiInputDateTimeRangeField/index.js +2 -2
- package/modern/MultiInputDateTimeRangeField/multiInputDateTimeRangeFieldClasses.js +4 -0
- package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +13 -117
- package/modern/MultiInputTimeRangeField/index.js +2 -2
- package/modern/MultiInputTimeRangeField/multiInputTimeRangeFieldClasses.js +4 -0
- package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +20 -30
- package/modern/SingleInputDateRangeField/useSingleInputDateRangeField.js +2 -1
- package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +20 -30
- package/modern/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +2 -1
- package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +20 -30
- package/modern/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +2 -1
- package/modern/hooks/index.js +2 -1
- package/modern/hooks/useMultiInputRangeField/index.js +1 -0
- package/modern/hooks/useMultiInputRangeField/useMultiInputRangeField.js +149 -0
- package/{internals/hooks/useMultiInputFieldSelectedSections.js → modern/hooks/useMultiInputRangeField/useMultiInputRangeFieldSelectedSections.js} +10 -8
- package/modern/hooks/useMultiInputRangeField/useMultiInputRangeFieldTextFieldProps.js +59 -0
- package/modern/index.js +1 -1
- package/modern/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +32 -42
- package/modern/internals/hooks/{useEnrichedRangePickerFieldProps.js → useEnrichedRangePickerField.js} +39 -52
- package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +23 -32
- package/modern/internals/hooks/useRangePosition.js +1 -1
- package/modern/internals/models/index.js +0 -1
- package/modern/internals/utils/createMultiInputRangeField/createMultiInputRangeField.js +133 -0
- package/modern/internals/utils/createMultiInputRangeField/index.js +2 -0
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/modern/managers/useDateRangeManager.js +3 -1
- package/modern/managers/useDateTimeRangeManager.js +3 -1
- package/modern/managers/useTimeRangeManager.js +3 -1
- package/modern/models/index.js +0 -2
- package/node/DateRangeCalendar/DateRangeCalendar.js +4 -4
- package/node/DateRangePicker/DateRangePickerToolbar.js +3 -3
- package/node/DateTimeRangePicker/DateTimeRangePickerTabs.js +3 -3
- package/node/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +2 -2
- package/node/DateTimeRangePicker/DateTimeRangePickerToolbar.js +7 -7
- package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +11 -119
- package/node/MultiInputDateRangeField/index.js +3 -9
- package/node/MultiInputDateRangeField/multiInputDateRangeFieldClasses.js +12 -0
- package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +11 -119
- package/node/MultiInputDateTimeRangeField/index.js +3 -9
- package/node/MultiInputDateTimeRangeField/multiInputDateTimeRangeFieldClasses.js +12 -0
- package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +12 -120
- package/node/MultiInputTimeRangeField/index.js +3 -9
- package/node/MultiInputTimeRangeField/multiInputTimeRangeFieldClasses.js +12 -0
- package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +19 -29
- package/node/SingleInputDateRangeField/useSingleInputDateRangeField.js +2 -1
- package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +19 -29
- package/node/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +2 -1
- package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +19 -29
- package/node/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +2 -1
- package/node/hooks/index.js +8 -1
- package/node/hooks/useMultiInputRangeField/index.js +12 -0
- package/node/hooks/useMultiInputRangeField/useMultiInputRangeField.js +155 -0
- package/node/{internals/hooks/useMultiInputFieldSelectedSections.js → hooks/useMultiInputRangeField/useMultiInputRangeFieldSelectedSections.js} +11 -10
- package/node/hooks/useMultiInputRangeField/useMultiInputRangeFieldTextFieldProps.js +66 -0
- package/node/index.js +1 -1
- package/node/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +31 -41
- package/node/internals/hooks/{useEnrichedRangePickerFieldProps.js → useEnrichedRangePickerField.js} +41 -54
- package/node/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +22 -31
- package/node/internals/hooks/useRangePosition.js +1 -1
- package/node/internals/models/index.js +0 -11
- package/node/internals/utils/createMultiInputRangeField/createMultiInputRangeField.js +140 -0
- package/node/internals/utils/createMultiInputRangeField/index.js +19 -0
- package/node/internals/utils/releaseInfo.js +1 -1
- package/node/managers/useDateRangeManager.js +3 -1
- package/node/managers/useDateTimeRangeManager.js +3 -1
- package/node/managers/useTimeRangeManager.js +3 -1
- package/node/models/index.js +0 -22
- package/package.json +4 -4
- package/themeAugmentation/overrides.d.ts +6 -4
- package/themeAugmentation/props.d.ts +2 -2
- package/MultiInputDateRangeField/MultiInputDateRangeField.types.d.ts +0 -55
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.d.ts +0 -56
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.types.d.ts +0 -56
- package/internals/hooks/useMultiInputRangeField/shared.d.ts +0 -1
- package/internals/hooks/useMultiInputRangeField/shared.js +0 -9
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.d.ts +0 -3
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +0 -118
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.d.ts +0 -3
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +0 -118
- package/internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.d.ts +0 -11
- package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.d.ts +0 -3
- package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +0 -118
- package/internals/models/timeRange.d.ts +0 -6
- package/internals/models/timeRange.js +0 -1
- package/models/dateRange.d.ts +0 -7
- package/models/dateRange.js +0 -1
- package/models/multiInputRangeFieldClasses.d.ts +0 -7
- package/models/multiInputRangeFieldClasses.js +0 -1
- package/modern/MultiInputDateRangeField/MultiInputDateRangeField.types.js +0 -1
- package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.js +0 -1
- package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.types.js +0 -1
- package/modern/internals/hooks/useMultiInputRangeField/shared.js +0 -9
- package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +0 -118
- package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +0 -118
- package/modern/internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.js +0 -1
- package/modern/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +0 -118
- package/modern/internals/models/timeRange.js +0 -1
- package/modern/models/dateRange.js +0 -1
- package/modern/models/multiInputRangeFieldClasses.js +0 -1
- package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.types.js +0 -5
- package/node/internals/hooks/useMultiInputRangeField/shared.js +0 -16
- package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +0 -126
- package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +0 -126
- package/node/internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.js +0 -5
- package/node/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +0 -126
- package/node/internals/models/timeRange.js +0 -5
- package/node/models/dateRange.js +0 -5
- package/node/models/multiInputRangeFieldClasses.js +0 -5
- /package/{MultiInputDateRangeField/MultiInputDateRangeField.types.js → internals/models/managers.js} +0 -0
- /package/{MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.js → internals/utils/createMultiInputRangeField/createMultiInputRangeField.types.js} +0 -0
- /package/{MultiInputTimeRangeField/MultiInputTimeRangeField.types.js → modern/internals/models/managers.js} +0 -0
- /package/{internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.js → modern/internals/utils/createMultiInputRangeField/createMultiInputRangeField.types.js} +0 -0
- /package/node/{MultiInputDateRangeField/MultiInputDateRangeField.types.js → internals/models/managers.js} +0 -0
- /package/node/{MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.js → internals/utils/createMultiInputRangeField/createMultiInputRangeField.types.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,121 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.0.0-alpha.8
|
|
9
|
+
|
|
10
|
+
_Jan 16, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 🍬 Improved design for Data Grid [Header filters](https://next.mui.com/x/react-data-grid/filtering/header-filters/)
|
|
15
|
+
|
|
16
|
+
<img width="100%" alt="Data Grid Header filters" src="https://github.com/user-attachments/assets/74a50cd9-7a55-41fc-a2b8-f8a0d5b9120e" />
|
|
17
|
+
|
|
18
|
+
- 🔄 Data Grid [Scroll restoration](https://next.mui.com/x/react-data-grid/scrolling/#scroll-restoration)
|
|
19
|
+
- 📊 Charts support server-side rendering under [some conditions](https://next.mui.com/x/react-charts/getting-started/#server-side-rendering)
|
|
20
|
+
- 🐞 Bugfixes
|
|
21
|
+
|
|
22
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
23
|
+
@lauri865.
|
|
24
|
+
Following are all team members who have contributed to this release:
|
|
25
|
+
@arminmeh, @romgrk, @samuelsycamore, @alexfauquette, @cherniavskii, @flaviendelangle, @JCQuintas, @KenanYusuf, @LukasTy, @michelengelen.
|
|
26
|
+
|
|
27
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
28
|
+
|
|
29
|
+
### Data Grid
|
|
30
|
+
|
|
31
|
+
#### Breaking changes
|
|
32
|
+
|
|
33
|
+
- The clear button in header filter cells has been moved to the header filter menu. Use `slotProps={{ headerFilterCell: { showClearIcon: true } }}` to restore the clear button in the cell.
|
|
34
|
+
|
|
35
|
+
#### `@mui/x-data-grid@8.0.0-alpha.8`
|
|
36
|
+
|
|
37
|
+
- [DataGrid] Improve scrollbar deadzone with overlay scrollbars (#15961) @lauri865
|
|
38
|
+
- [DataGrid] Header filter design improvements (#15991) @KenanYusuf
|
|
39
|
+
- [DataGrid] Scroll restoration (#15623) @lauri865
|
|
40
|
+
- [DataGrid] Fix row, cell and header memoizations (#15666) @lauri865
|
|
41
|
+
|
|
42
|
+
#### `@mui/x-data-grid-pro@8.0.0-alpha.8` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
43
|
+
|
|
44
|
+
Same changes as in `@mui/x-data-grid@8.0.0-alpha.8`, plus:
|
|
45
|
+
|
|
46
|
+
- [DataGridPro] Add test for column pinning with disabled column virtualization (#16176) @cherniavskii
|
|
47
|
+
- [DataGridPro] Fix width of right-pinned column group during resize (#16199) @cherniavskii
|
|
48
|
+
|
|
49
|
+
#### `@mui/x-data-grid-premium@8.0.0-alpha.8` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
50
|
+
|
|
51
|
+
Same changes as in `@mui/x-data-grid-pro@8.0.0-alpha.8`.
|
|
52
|
+
|
|
53
|
+
### Date and Time Pickers
|
|
54
|
+
|
|
55
|
+
#### Breaking changes
|
|
56
|
+
|
|
57
|
+
- The field is now editable if rendered inside a mobile Picker — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#field-editing-on-mobile-pickers)
|
|
58
|
+
- The `useMultiInputDateRangeField`, `useMultiInputTimeRangeField`, and `useMultiInputDateTimeRangeField` hooks have been removed in favor of the new `useMultiInputRangeField` hook — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#usemultiinputdaterangefield)
|
|
59
|
+
- The component passed to the `field` slot no longer receives the `value`, `onChange`, `timezone`, `format`, `disabled`, `formatDensity`, `enableAccessibleFieldDOMStructure`, `selectedSections` and `onSelectedSectionsChange` props — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-field)
|
|
60
|
+
|
|
61
|
+
#### `@mui/x-date-pickers@8.0.0-alpha.8`
|
|
62
|
+
|
|
63
|
+
- [pickers] Let the field components handle their opening UI, and allow field editing on mobile pickers (#15671) @flaviendelangle
|
|
64
|
+
- [pickers] Remove code duplication for the multi input range fields (#15505) @flaviendelangle
|
|
65
|
+
- [pickers] Rename `onRangePositionChange` into `setRangePosition` in `usePickerRangePositionContext` (#16189) @flaviendelangle
|
|
66
|
+
- [pickers] Use context to pass props from the picker to the field (#16042) @flaviendelangle
|
|
67
|
+
|
|
68
|
+
#### `@mui/x-date-pickers-pro@8.0.0-alpha.8` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
69
|
+
|
|
70
|
+
Same changes as in `@mui/x-date-pickers@8.0.0-alpha.8`.
|
|
71
|
+
|
|
72
|
+
### Charts
|
|
73
|
+
|
|
74
|
+
#### Breaking changes
|
|
75
|
+
|
|
76
|
+
- Charts tooltip markers now have different styles for each chart type. The tooltip and legend marks are now the same.
|
|
77
|
+
- Duplicate axis id's across `x` and `y` axis now log a warning in dev mode. Axis ids should be unique to prevent internal issues.
|
|
78
|
+
|
|
79
|
+
#### `@mui/x-charts@8.0.0-alpha.8`
|
|
80
|
+
|
|
81
|
+
- [charts] Fix flaky charts tests (#16180) @JCQuintas
|
|
82
|
+
- [charts] Handle case where gradient stop `offset` could be `Infinite` (#16131) @JCQuintas
|
|
83
|
+
- [charts] Make `useChartGradientId` public (#16106) @JCQuintas
|
|
84
|
+
- [charts] Move z-axis to plugin (#16130) @alexfauquette
|
|
85
|
+
- [charts] Plot data at first render if `skipAnimation` is set to `true` (#16166) @alexfauquette
|
|
86
|
+
- [charts] Replace tooltip mark with style (#16117) @JCQuintas
|
|
87
|
+
- [charts] Support `rtl` for gradient legend (#16115) @JCQuintas
|
|
88
|
+
- [charts] Use plugin system for series and axes (#15865) @alexfauquette
|
|
89
|
+
|
|
90
|
+
#### `@mui/x-charts-pro@8.0.0-alpha.8` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
91
|
+
|
|
92
|
+
Same changes as in `@mui/x-charts@8.0.0-alpha.8`.
|
|
93
|
+
|
|
94
|
+
### Tree View
|
|
95
|
+
|
|
96
|
+
#### `@mui/x-tree-view@8.0.0-alpha.8`
|
|
97
|
+
|
|
98
|
+
No changes since `@mui/x-tree-view-pro@v8.0.0-alpha.7`.
|
|
99
|
+
|
|
100
|
+
#### `@mui/x-tree-view-pro@8.0.0-alpha.8` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
101
|
+
|
|
102
|
+
Same changes as in `@mui/x-tree-view@8.0.0-alpha.8`.
|
|
103
|
+
|
|
104
|
+
### Docs
|
|
105
|
+
|
|
106
|
+
- [docs] Add example for custom legend (#16169) @alexfauquette
|
|
107
|
+
- [docs] Add full custom field creation example (#15194) @flaviendelangle
|
|
108
|
+
- [docs] Copyedit the Data Grid cell selection page (#16099) @samuelsycamore
|
|
109
|
+
- [docs] Fix demo rendering issue on Codesandbox (#16118) @arminmeh
|
|
110
|
+
- [docs] Remove broken links (#16167) @alexfauquette
|
|
111
|
+
- [docs] Split the Data Grid editing page (#14931) @MBilalShafi
|
|
112
|
+
- [docs] Fix wrong props warnings (#16119) @JCQuintas
|
|
113
|
+
|
|
114
|
+
### Core
|
|
115
|
+
|
|
116
|
+
- [core] Type all references as `RefObject` (#16124) @arminmeh
|
|
117
|
+
- [code-infra] Refactor `react` and `react-dom` definitions to simplify dep resolving (#16160) @LukasTy
|
|
118
|
+
- [code-infra] Stop renovate from updating `date-fns-v2` (#16158) @LukasTy
|
|
119
|
+
- [infra] Improve cherry-pick action target list (#16184) @michelengelen
|
|
120
|
+
- [test] Fix flaky column pinning unit test (#16202) @cherniavskii
|
|
121
|
+
- [test] Fix flaky screenshot (#16182) @cherniavskii
|
|
122
|
+
|
|
8
123
|
## 8.0.0-alpha.7
|
|
9
124
|
|
|
10
125
|
_Jan 9, 2025_
|
|
@@ -192,15 +192,15 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
|
|
|
192
192
|
const id = useId();
|
|
193
193
|
const {
|
|
194
194
|
rangePosition,
|
|
195
|
-
|
|
195
|
+
setRangePosition
|
|
196
196
|
} = useRangePosition({
|
|
197
197
|
rangePosition: rangePositionProp ?? rangePositionContext?.rangePosition,
|
|
198
198
|
defaultRangePosition: defaultRangePositionProp,
|
|
199
|
-
onRangePositionChange: onRangePositionChangeProp ?? rangePositionContext?.
|
|
199
|
+
onRangePositionChange: onRangePositionChangeProp ?? rangePositionContext?.setRangePosition
|
|
200
200
|
});
|
|
201
201
|
const handleDatePositionChange = useEventCallback(position => {
|
|
202
202
|
if (rangePosition !== position) {
|
|
203
|
-
|
|
203
|
+
setRangePosition(position);
|
|
204
204
|
}
|
|
205
205
|
});
|
|
206
206
|
const handleSelectedDayChange = useEventCallback((newDate, selectionState, allowRangeFlip = false) => {
|
|
@@ -218,7 +218,7 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
|
|
|
218
218
|
});
|
|
219
219
|
const isNextSectionAvailable = availableRangePositions.includes(nextSelection);
|
|
220
220
|
if (isNextSectionAvailable) {
|
|
221
|
-
|
|
221
|
+
setRangePosition(nextSelection);
|
|
222
222
|
}
|
|
223
223
|
const isFullRangeSelected = rangePosition === 'end' && isRangeValid(utils, newRange);
|
|
224
224
|
setValueAndGoToNextView(newRange, isFullRangeSelected || !isNextSectionAvailable ? 'finish' : 'partial', view);
|
|
@@ -62,7 +62,7 @@ const DateRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateRangeP
|
|
|
62
62
|
const ownerState = useToolbarOwnerState();
|
|
63
63
|
const {
|
|
64
64
|
rangePosition,
|
|
65
|
-
|
|
65
|
+
setRangePosition
|
|
66
66
|
} = usePickerRangePositionContext();
|
|
67
67
|
const classes = useUtilityClasses(classesProp);
|
|
68
68
|
|
|
@@ -85,7 +85,7 @@ const DateRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateRangeP
|
|
|
85
85
|
variant: value[0] == null ? 'h6' : 'h5',
|
|
86
86
|
value: formatDate(value[0], translations.start),
|
|
87
87
|
selected: rangePosition === 'start',
|
|
88
|
-
onClick: () =>
|
|
88
|
+
onClick: () => setRangePosition('start')
|
|
89
89
|
}), /*#__PURE__*/_jsxs(Typography, {
|
|
90
90
|
variant: "h5",
|
|
91
91
|
children: ["\xA0", '–', "\xA0"]
|
|
@@ -93,7 +93,7 @@ const DateRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateRangeP
|
|
|
93
93
|
variant: value[1] == null ? 'h6' : 'h5',
|
|
94
94
|
value: formatDate(value[1], translations.end),
|
|
95
95
|
selected: rangePosition === 'end',
|
|
96
|
-
onClick: () =>
|
|
96
|
+
onClick: () => setRangePosition('end')
|
|
97
97
|
})]
|
|
98
98
|
})
|
|
99
99
|
}));
|
|
@@ -87,7 +87,7 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
|
|
|
87
87
|
const classes = useUtilityClasses(classesProp);
|
|
88
88
|
const {
|
|
89
89
|
rangePosition,
|
|
90
|
-
|
|
90
|
+
setRangePosition
|
|
91
91
|
} = usePickerRangePositionContext();
|
|
92
92
|
const value = React.useMemo(() => view == null ? null : viewToTab(view, rangePosition), [view, rangePosition]);
|
|
93
93
|
const isPreviousHidden = value === 'start-date';
|
|
@@ -108,9 +108,9 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
|
|
|
108
108
|
}, [translations.endDate, translations.endTime, translations.startDate, translations.startTime, value]);
|
|
109
109
|
const handleRangePositionChange = useEventCallback(newTab => {
|
|
110
110
|
if (newTab.includes('start')) {
|
|
111
|
-
|
|
111
|
+
setRangePosition('start');
|
|
112
112
|
} else {
|
|
113
|
-
|
|
113
|
+
setRangePosition('end');
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
116
|
const changeToPreviousTab = useEventCallback(() => {
|
|
@@ -21,7 +21,7 @@ function DateTimeRangePickerTimeWrapper(props) {
|
|
|
21
21
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
22
22
|
const {
|
|
23
23
|
rangePosition,
|
|
24
|
-
|
|
24
|
+
setRangePosition
|
|
25
25
|
} = usePickerRangePositionContext();
|
|
26
26
|
if (!viewRenderer) {
|
|
27
27
|
return null;
|
|
@@ -45,7 +45,7 @@ function DateTimeRangePickerTimeWrapper(props) {
|
|
|
45
45
|
// reset view to the first time view and swap range position after selecting the last time view (start or end position)
|
|
46
46
|
if (selectedView === timeViews[timeViews.length - 1] && onViewChange) {
|
|
47
47
|
onViewChange(views[0]);
|
|
48
|
-
|
|
48
|
+
setRangePosition(rangePosition === 'start' ? 'end' : 'start');
|
|
49
49
|
}
|
|
50
50
|
onChange(newRange, isFullRangeSelected ? 'finish' : 'partial', selectedView);
|
|
51
51
|
};
|
|
@@ -74,7 +74,7 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
|
|
|
74
74
|
const ownerState = useToolbarOwnerState();
|
|
75
75
|
const {
|
|
76
76
|
rangePosition,
|
|
77
|
-
|
|
77
|
+
setRangePosition
|
|
78
78
|
} = usePickerRangePositionContext();
|
|
79
79
|
const classes = useUtilityClasses(classesProp);
|
|
80
80
|
const commonToolbarProps = {
|
|
@@ -97,18 +97,18 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
|
|
|
97
97
|
rangePosition,
|
|
98
98
|
allowRangeFlip: true
|
|
99
99
|
});
|
|
100
|
-
|
|
100
|
+
setRangePosition(nextSelection);
|
|
101
101
|
setValue(newRange, {
|
|
102
102
|
changeImportance: 'set'
|
|
103
103
|
});
|
|
104
|
-
}, [setValue,
|
|
104
|
+
}, [setValue, setRangePosition, value, rangePosition, utils]);
|
|
105
105
|
const startOverrides = React.useMemo(() => {
|
|
106
106
|
const handleStartRangeViewChange = newView => {
|
|
107
107
|
if (newView === 'year' || newView === 'month') {
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
110
|
if (rangePosition !== 'start') {
|
|
111
|
-
|
|
111
|
+
setRangePosition('start');
|
|
112
112
|
}
|
|
113
113
|
setView(newView);
|
|
114
114
|
};
|
|
@@ -119,14 +119,14 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
|
|
|
119
119
|
setView: handleStartRangeViewChange,
|
|
120
120
|
view: rangePosition === 'start' ? view : null
|
|
121
121
|
};
|
|
122
|
-
}, [value, wrappedSetValue, rangePosition, view,
|
|
122
|
+
}, [value, wrappedSetValue, rangePosition, view, setRangePosition, setView]);
|
|
123
123
|
const endOverrides = React.useMemo(() => {
|
|
124
124
|
const handleEndRangeViewChange = newView => {
|
|
125
125
|
if (newView === 'year' || newView === 'month') {
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
128
|
if (rangePosition !== 'end') {
|
|
129
|
-
|
|
129
|
+
setRangePosition('end');
|
|
130
130
|
}
|
|
131
131
|
setView(newView);
|
|
132
132
|
};
|
|
@@ -137,7 +137,7 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
|
|
|
137
137
|
setView: handleEndRangeViewChange,
|
|
138
138
|
view: rangePosition === 'end' ? view : null
|
|
139
139
|
};
|
|
140
|
-
}, [value, wrappedSetValue, rangePosition, view,
|
|
140
|
+
}, [value, wrappedSetValue, rangePosition, view, setRangePosition, setView]);
|
|
141
141
|
if (hidden) {
|
|
142
142
|
return null;
|
|
143
143
|
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export
|
|
2
|
+
import { UseDateRangeManagerReturnValue } from '../managers';
|
|
3
|
+
import { MultiInputRangeFieldProps } from '../internals/utils/createMultiInputRangeField';
|
|
4
|
+
import { MultiInputDateRangeFieldClasses } from './multiInputDateRangeFieldClasses';
|
|
5
|
+
export interface MultiInputDateRangeFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> extends MultiInputRangeFieldProps<UseDateRangeManagerReturnValue<TEnableAccessibleFieldDOMStructure>> {
|
|
6
|
+
/**
|
|
7
|
+
* Override or extend the styles applied to the component.
|
|
8
|
+
*/
|
|
9
|
+
classes?: Partial<MultiInputDateRangeFieldClasses>;
|
|
10
|
+
}
|
|
6
11
|
type MultiInputDateRangeFieldComponent = (<TEnableAccessibleFieldDOMStructure extends boolean = true>(props: MultiInputDateRangeFieldProps<TEnableAccessibleFieldDOMStructure> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
7
12
|
propTypes?: any;
|
|
8
13
|
};
|
|
@@ -1,48 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
|
-
const _excluded = ["slots", "slotProps", "unstableStartFieldRef", "unstableEndFieldRef", "className", "classes"];
|
|
6
|
-
import * as React from 'react';
|
|
7
3
|
import PropTypes from 'prop-types';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
import useSlotProps from '@mui/utils/useSlotProps';
|
|
14
|
-
import { unstable_composeClasses as composeClasses, unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
|
|
15
|
-
import { convertFieldResponseIntoMuiTextFieldProps, useFieldOwnerState } from '@mui/x-date-pickers/internals';
|
|
16
|
-
import { useSplitFieldProps } from '@mui/x-date-pickers/hooks';
|
|
17
|
-
import { PickersTextField } from '@mui/x-date-pickers/PickersTextField';
|
|
18
|
-
import { useMultiInputDateRangeField } from "../internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js";
|
|
19
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
-
export const multiInputDateRangeFieldClasses = generateUtilityClasses('MuiMultiInputDateRangeField', ['root', 'separator']);
|
|
21
|
-
export const getMultiInputDateRangeFieldUtilityClass = slot => generateUtilityClass('MuiMultiInputDateRangeField', slot);
|
|
22
|
-
const useUtilityClasses = classes => {
|
|
23
|
-
const slots = {
|
|
24
|
-
root: ['root'],
|
|
25
|
-
separator: ['separator']
|
|
26
|
-
};
|
|
27
|
-
return composeClasses(slots, getMultiInputDateRangeFieldUtilityClass, classes);
|
|
28
|
-
};
|
|
29
|
-
const MultiInputDateRangeFieldRoot = styled(/*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/_jsx(Stack, _extends({
|
|
30
|
-
ref: ref,
|
|
31
|
-
spacing: 2,
|
|
32
|
-
direction: "row",
|
|
33
|
-
alignItems: "center"
|
|
34
|
-
}, props))), {
|
|
35
|
-
name: 'MuiMultiInputDateRangeField',
|
|
36
|
-
slot: 'Root',
|
|
37
|
-
overridesResolver: (props, styles) => styles.root
|
|
38
|
-
})({});
|
|
39
|
-
const MultiInputDateRangeFieldSeparator = styled(Typography, {
|
|
40
|
-
name: 'MuiMultiInputDateRangeField',
|
|
41
|
-
slot: 'Separator',
|
|
42
|
-
overridesResolver: (props, styles) => styles.separator
|
|
43
|
-
})({
|
|
44
|
-
lineHeight: '1.4375em' // 23px
|
|
45
|
-
});
|
|
4
|
+
import { useDateRangeManager } from "../managers/index.js";
|
|
5
|
+
import {
|
|
6
|
+
// The alias is needed to have the doc gen working.
|
|
7
|
+
createMultiInputRangeField as createMultiInputDateRangeField } from "../internals/utils/createMultiInputRangeField/index.js";
|
|
8
|
+
import { getMultiInputDateRangeFieldUtilityClass } from "./multiInputDateRangeFieldClasses.js";
|
|
46
9
|
/**
|
|
47
10
|
* Demos:
|
|
48
11
|
*
|
|
@@ -53,86 +16,19 @@ const MultiInputDateRangeFieldSeparator = styled(Typography, {
|
|
|
53
16
|
*
|
|
54
17
|
* - [MultiInputDateRangeField API](https://mui.com/x/api/multi-input-date-range-field/)
|
|
55
18
|
*/
|
|
56
|
-
const MultiInputDateRangeField =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
});
|
|
61
|
-
const {
|
|
62
|
-
internalProps,
|
|
63
|
-
forwardedProps
|
|
64
|
-
} = useSplitFieldProps(themeProps, 'date');
|
|
65
|
-
const {
|
|
66
|
-
slots,
|
|
67
|
-
slotProps,
|
|
68
|
-
unstableStartFieldRef,
|
|
69
|
-
unstableEndFieldRef,
|
|
70
|
-
className,
|
|
71
|
-
classes: classesProp
|
|
72
|
-
} = forwardedProps,
|
|
73
|
-
otherForwardedProps = _objectWithoutPropertiesLoose(forwardedProps, _excluded);
|
|
74
|
-
const ownerState = useFieldOwnerState(internalProps);
|
|
75
|
-
const classes = useUtilityClasses(classesProp);
|
|
76
|
-
const Root = slots?.root ?? MultiInputDateRangeFieldRoot;
|
|
77
|
-
const rootProps = useSlotProps({
|
|
78
|
-
elementType: Root,
|
|
79
|
-
externalSlotProps: slotProps?.root,
|
|
80
|
-
externalForwardedProps: otherForwardedProps,
|
|
81
|
-
additionalProps: {
|
|
82
|
-
ref
|
|
83
|
-
},
|
|
84
|
-
ownerState,
|
|
85
|
-
className: clsx(className, classes.root)
|
|
86
|
-
});
|
|
87
|
-
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure === false ? MuiTextField : PickersTextField);
|
|
88
|
-
const startTextFieldProps = useSlotProps({
|
|
89
|
-
elementType: TextField,
|
|
90
|
-
externalSlotProps: slotProps?.textField,
|
|
91
|
-
ownerState: _extends({}, ownerState, {
|
|
92
|
-
position: 'start'
|
|
93
|
-
})
|
|
94
|
-
});
|
|
95
|
-
const endTextFieldProps = useSlotProps({
|
|
96
|
-
elementType: TextField,
|
|
97
|
-
externalSlotProps: slotProps?.textField,
|
|
98
|
-
ownerState: _extends({}, ownerState, {
|
|
99
|
-
position: 'end'
|
|
100
|
-
})
|
|
101
|
-
});
|
|
102
|
-
const Separator = slots?.separator ?? MultiInputDateRangeFieldSeparator;
|
|
103
|
-
const separatorProps = useSlotProps({
|
|
104
|
-
elementType: Separator,
|
|
105
|
-
externalSlotProps: slotProps?.separator,
|
|
106
|
-
additionalProps: {
|
|
107
|
-
children: ` ${internalProps.dateSeparator ?? '–'} `
|
|
108
|
-
},
|
|
109
|
-
ownerState,
|
|
110
|
-
className: classes.separator
|
|
111
|
-
});
|
|
112
|
-
const fieldResponse = useMultiInputDateRangeField({
|
|
113
|
-
sharedProps: internalProps,
|
|
114
|
-
startTextFieldProps,
|
|
115
|
-
endTextFieldProps,
|
|
116
|
-
unstableStartFieldRef,
|
|
117
|
-
unstableEndFieldRef
|
|
118
|
-
});
|
|
119
|
-
const startDateProps = convertFieldResponseIntoMuiTextFieldProps(fieldResponse.startDate);
|
|
120
|
-
const endDateProps = convertFieldResponseIntoMuiTextFieldProps(fieldResponse.endDate);
|
|
121
|
-
return /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, {
|
|
122
|
-
children: [/*#__PURE__*/_jsx(TextField, _extends({
|
|
123
|
-
fullWidth: true
|
|
124
|
-
}, startDateProps)), /*#__PURE__*/_jsx(Separator, _extends({}, separatorProps)), /*#__PURE__*/_jsx(TextField, _extends({
|
|
125
|
-
fullWidth: true
|
|
126
|
-
}, endDateProps))]
|
|
127
|
-
}));
|
|
19
|
+
const MultiInputDateRangeField = createMultiInputDateRangeField({
|
|
20
|
+
name: 'MuiMultiInputDateRangeField',
|
|
21
|
+
getUtilityClass: getMultiInputDateRangeFieldUtilityClass,
|
|
22
|
+
useManager: useDateRangeManager
|
|
128
23
|
});
|
|
129
|
-
|
|
24
|
+
MultiInputDateRangeField.propTypes = {
|
|
130
25
|
// ----------------------------- Warning --------------------------------
|
|
131
26
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
132
27
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
133
28
|
// ----------------------------------------------------------------------
|
|
134
29
|
/**
|
|
135
30
|
* If `true`, the `input` element is focused during the first mount.
|
|
31
|
+
* @default false
|
|
136
32
|
*/
|
|
137
33
|
autoFocus: PropTypes.bool,
|
|
138
34
|
/**
|
|
@@ -315,5 +211,5 @@ process.env.NODE_ENV !== "production" ? MultiInputDateRangeField.propTypes = {
|
|
|
315
211
|
* Used when the component is controlled.
|
|
316
212
|
*/
|
|
317
213
|
value: PropTypes.arrayOf(PropTypes.object)
|
|
318
|
-
}
|
|
214
|
+
};
|
|
319
215
|
export { MultiInputDateRangeField };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export { MultiInputDateRangeField
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
1
|
+
export { MultiInputDateRangeField } from './MultiInputDateRangeField';
|
|
2
|
+
export type { MultiInputDateRangeFieldProps } from './MultiInputDateRangeField';
|
|
3
|
+
export { multiInputDateRangeFieldClasses, getMultiInputDateRangeFieldUtilityClass, } from './multiInputDateRangeFieldClasses';
|
|
4
|
+
export type { MultiInputDateRangeFieldClassKey, MultiInputDateRangeFieldClasses, } from './multiInputDateRangeFieldClasses';
|
|
5
|
+
export type { MultiInputRangeFieldSlots as MultiInputDateRangeFieldSlots, MultiInputRangeFieldSlotProps as MultiInputDateRangeFieldSlotProps, } from '../internals/utils/createMultiInputRangeField';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MultiInputDateRangeField
|
|
2
|
-
export {
|
|
1
|
+
export { MultiInputDateRangeField } from "./MultiInputDateRangeField.js";
|
|
2
|
+
export { multiInputDateRangeFieldClasses, getMultiInputDateRangeFieldUtilityClass } from "./multiInputDateRangeFieldClasses.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MultiInputRangeFieldClasses } from '../internals/utils/createMultiInputRangeField';
|
|
2
|
+
export interface MultiInputDateRangeFieldClasses extends MultiInputRangeFieldClasses {
|
|
3
|
+
}
|
|
4
|
+
export type MultiInputDateRangeFieldClassKey = keyof MultiInputRangeFieldClasses;
|
|
5
|
+
export declare const multiInputDateRangeFieldClasses: MultiInputRangeFieldClasses;
|
|
6
|
+
export declare const getMultiInputDateRangeFieldUtilityClass: (slot: string) => string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
2
|
+
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
3
|
+
export const multiInputDateRangeFieldClasses = generateUtilityClasses('MuiMultiInputDateRangeField', ['root', 'separator']);
|
|
4
|
+
export const getMultiInputDateRangeFieldUtilityClass = slot => generateUtilityClass('MuiMultiInputDateRangeField', slot);
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export
|
|
2
|
+
import { UseDateTimeRangeManagerReturnValue } from '../managers';
|
|
3
|
+
import { MultiInputRangeFieldProps } from '../internals/utils/createMultiInputRangeField';
|
|
4
|
+
import { MultiInputDateTimeRangeFieldClasses } from './multiInputDateTimeRangeFieldClasses';
|
|
5
|
+
export interface MultiInputDateTimeRangeFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> extends MultiInputRangeFieldProps<UseDateTimeRangeManagerReturnValue<TEnableAccessibleFieldDOMStructure>> {
|
|
6
|
+
/**
|
|
7
|
+
* Override or extend the styles applied to the component.
|
|
8
|
+
*/
|
|
9
|
+
classes?: Partial<MultiInputDateTimeRangeFieldClasses>;
|
|
10
|
+
}
|
|
6
11
|
type MultiInputDateTimeRangeFieldComponent = (<TEnableAccessibleFieldDOMStructure extends boolean = true>(props: MultiInputDateTimeRangeFieldProps<TEnableAccessibleFieldDOMStructure> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
7
12
|
propTypes?: any;
|
|
8
13
|
};
|
|
@@ -1,48 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
|
-
const _excluded = ["slots", "slotProps", "unstableStartFieldRef", "unstableEndFieldRef", "className", "classes"];
|
|
6
|
-
import * as React from 'react';
|
|
7
3
|
import PropTypes from 'prop-types';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
import useSlotProps from '@mui/utils/useSlotProps';
|
|
14
|
-
import { unstable_composeClasses as composeClasses, unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
|
|
15
|
-
import { convertFieldResponseIntoMuiTextFieldProps, useFieldOwnerState } from '@mui/x-date-pickers/internals';
|
|
16
|
-
import { useSplitFieldProps } from '@mui/x-date-pickers/hooks';
|
|
17
|
-
import { PickersTextField } from '@mui/x-date-pickers/PickersTextField';
|
|
18
|
-
import { useMultiInputDateTimeRangeField } from "../internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js";
|
|
19
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
-
export const multiInputDateTimeRangeFieldClasses = generateUtilityClasses('MuiMultiInputDateTimeRangeField', ['root', 'separator']);
|
|
21
|
-
export const getMultiInputDateTimeRangeFieldUtilityClass = slot => generateUtilityClass('MuiMultiInputDateTimeRangeField', slot);
|
|
22
|
-
const useUtilityClasses = classes => {
|
|
23
|
-
const slots = {
|
|
24
|
-
root: ['root'],
|
|
25
|
-
separator: ['separator']
|
|
26
|
-
};
|
|
27
|
-
return composeClasses(slots, getMultiInputDateTimeRangeFieldUtilityClass, classes);
|
|
28
|
-
};
|
|
29
|
-
const MultiInputDateTimeRangeFieldRoot = styled(/*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/_jsx(Stack, _extends({
|
|
30
|
-
ref: ref,
|
|
31
|
-
spacing: 2,
|
|
32
|
-
direction: "row",
|
|
33
|
-
alignItems: "center"
|
|
34
|
-
}, props))), {
|
|
35
|
-
name: 'MuiMultiInputDateTimeRangeField',
|
|
36
|
-
slot: 'Root',
|
|
37
|
-
overridesResolver: (props, styles) => styles.root
|
|
38
|
-
})({});
|
|
39
|
-
const MultiInputDateTimeRangeFieldSeparator = styled(Typography, {
|
|
40
|
-
name: 'MuiMultiInputDateTimeRangeField',
|
|
41
|
-
slot: 'Separator',
|
|
42
|
-
overridesResolver: (props, styles) => styles.separator
|
|
43
|
-
})({
|
|
44
|
-
lineHeight: '1.4375em' // 23px
|
|
45
|
-
});
|
|
4
|
+
import { useDateTimeRangeManager } from "../managers/index.js";
|
|
5
|
+
import {
|
|
6
|
+
// The alias is needed to have the doc gen working.
|
|
7
|
+
createMultiInputRangeField as createMultiInputDateTimeRangeField } from "../internals/utils/createMultiInputRangeField/index.js";
|
|
8
|
+
import { getMultiInputDateTimeRangeFieldUtilityClass } from "./multiInputDateTimeRangeFieldClasses.js";
|
|
46
9
|
/**
|
|
47
10
|
* Demos:
|
|
48
11
|
*
|
|
@@ -53,80 +16,12 @@ const MultiInputDateTimeRangeFieldSeparator = styled(Typography, {
|
|
|
53
16
|
*
|
|
54
17
|
* - [MultiInputDateTimeRangeField API](https://mui.com/x/api/multi-input-date-time-range-field/)
|
|
55
18
|
*/
|
|
56
|
-
const MultiInputDateTimeRangeField =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
});
|
|
61
|
-
const {
|
|
62
|
-
internalProps,
|
|
63
|
-
forwardedProps
|
|
64
|
-
} = useSplitFieldProps(themeProps, 'date-time');
|
|
65
|
-
const {
|
|
66
|
-
slots,
|
|
67
|
-
slotProps,
|
|
68
|
-
unstableStartFieldRef,
|
|
69
|
-
unstableEndFieldRef,
|
|
70
|
-
className,
|
|
71
|
-
classes: classesProp
|
|
72
|
-
} = forwardedProps,
|
|
73
|
-
otherForwardedProps = _objectWithoutPropertiesLoose(forwardedProps, _excluded);
|
|
74
|
-
const ownerState = useFieldOwnerState(themeProps);
|
|
75
|
-
const classes = useUtilityClasses(classesProp);
|
|
76
|
-
const Root = slots?.root ?? MultiInputDateTimeRangeFieldRoot;
|
|
77
|
-
const rootProps = useSlotProps({
|
|
78
|
-
elementType: Root,
|
|
79
|
-
externalSlotProps: slotProps?.root,
|
|
80
|
-
externalForwardedProps: otherForwardedProps,
|
|
81
|
-
additionalProps: {
|
|
82
|
-
ref
|
|
83
|
-
},
|
|
84
|
-
ownerState,
|
|
85
|
-
className: clsx(className, classes.root)
|
|
86
|
-
});
|
|
87
|
-
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure === false ? MuiTextField : PickersTextField);
|
|
88
|
-
const startTextFieldProps = useSlotProps({
|
|
89
|
-
elementType: TextField,
|
|
90
|
-
externalSlotProps: slotProps?.textField,
|
|
91
|
-
ownerState: _extends({}, ownerState, {
|
|
92
|
-
position: 'start'
|
|
93
|
-
})
|
|
94
|
-
});
|
|
95
|
-
const endTextFieldProps = useSlotProps({
|
|
96
|
-
elementType: TextField,
|
|
97
|
-
externalSlotProps: slotProps?.textField,
|
|
98
|
-
ownerState: _extends({}, ownerState, {
|
|
99
|
-
position: 'end'
|
|
100
|
-
})
|
|
101
|
-
});
|
|
102
|
-
const Separator = slots?.separator ?? MultiInputDateTimeRangeFieldSeparator;
|
|
103
|
-
const separatorProps = useSlotProps({
|
|
104
|
-
elementType: Separator,
|
|
105
|
-
externalSlotProps: slotProps?.separator,
|
|
106
|
-
additionalProps: {
|
|
107
|
-
children: ` ${internalProps.dateSeparator ?? '–'} `
|
|
108
|
-
},
|
|
109
|
-
ownerState,
|
|
110
|
-
className: classes.separator
|
|
111
|
-
});
|
|
112
|
-
const fieldResponse = useMultiInputDateTimeRangeField({
|
|
113
|
-
sharedProps: internalProps,
|
|
114
|
-
startTextFieldProps,
|
|
115
|
-
endTextFieldProps,
|
|
116
|
-
unstableStartFieldRef,
|
|
117
|
-
unstableEndFieldRef
|
|
118
|
-
});
|
|
119
|
-
const startDateProps = convertFieldResponseIntoMuiTextFieldProps(fieldResponse.startDate);
|
|
120
|
-
const endDateProps = convertFieldResponseIntoMuiTextFieldProps(fieldResponse.endDate);
|
|
121
|
-
return /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, {
|
|
122
|
-
children: [/*#__PURE__*/_jsx(TextField, _extends({
|
|
123
|
-
fullWidth: true
|
|
124
|
-
}, startDateProps)), /*#__PURE__*/_jsx(Separator, _extends({}, separatorProps)), /*#__PURE__*/_jsx(TextField, _extends({
|
|
125
|
-
fullWidth: true
|
|
126
|
-
}, endDateProps))]
|
|
127
|
-
}));
|
|
19
|
+
const MultiInputDateTimeRangeField = createMultiInputDateTimeRangeField({
|
|
20
|
+
name: 'MuiMultiInputDateTimeRangeField',
|
|
21
|
+
getUtilityClass: getMultiInputDateTimeRangeFieldUtilityClass,
|
|
22
|
+
useManager: useDateTimeRangeManager
|
|
128
23
|
});
|
|
129
|
-
|
|
24
|
+
MultiInputDateTimeRangeField.propTypes = {
|
|
130
25
|
// ----------------------------- Warning --------------------------------
|
|
131
26
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
132
27
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -138,6 +33,7 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
|
|
|
138
33
|
ampm: PropTypes.bool,
|
|
139
34
|
/**
|
|
140
35
|
* If `true`, the `input` element is focused during the first mount.
|
|
36
|
+
* @default false
|
|
141
37
|
*/
|
|
142
38
|
autoFocus: PropTypes.bool,
|
|
143
39
|
/**
|
|
@@ -355,5 +251,5 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
|
|
|
355
251
|
* Used when the component is controlled.
|
|
356
252
|
*/
|
|
357
253
|
value: PropTypes.arrayOf(PropTypes.object)
|
|
358
|
-
}
|
|
254
|
+
};
|
|
359
255
|
export { MultiInputDateTimeRangeField };
|