@mui/x-date-pickers-pro 7.0.0-beta.4 → 7.0.0-beta.5
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 +138 -14
- package/DateRangePicker/DateRangePickerToolbar.d.ts +3 -3
- package/DateRangePicker/DateRangePickerToolbar.js +16 -2
- package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +39 -9
- package/DateTimeRangePicker/shared.js +8 -3
- package/DesktopDateRangePicker/DesktopDateRangePicker.types.d.ts +1 -1
- package/MobileDateRangePicker/MobileDateRangePicker.types.d.ts +1 -1
- package/StaticDateRangePicker/StaticDateRangePicker.types.d.ts +1 -1
- package/index.js +1 -1
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +1 -1
- package/internals/utils/releaseInfo.js +1 -1
- package/modern/DateRangePicker/DateRangePickerToolbar.js +16 -2
- package/modern/DateTimeRangePicker/DateTimeRangePickerToolbar.js +39 -9
- package/modern/DateTimeRangePicker/shared.js +7 -2
- package/modern/index.js +1 -1
- package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +1 -1
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/node/DateRangePicker/DateRangePickerToolbar.js +16 -2
- package/node/DateTimeRangePicker/DateTimeRangePickerToolbar.js +39 -9
- package/node/DateTimeRangePicker/shared.js +7 -2
- package/node/index.js +1 -1
- package/node/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +1 -1
- package/node/internals/utils/releaseInfo.js +1 -1
- package/package.json +2 -2
- package/themeAugmentation/props.d.ts +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,89 @@
|
|
|
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.0.0-beta.5
|
|
7
|
+
|
|
8
|
+
_Mar 1, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🎁 Add `getSortComparator` for more advanced sorting behaviors (#12215) @cherniavskii
|
|
13
|
+
- 🚀 Add `use client` directive to the Grid packages (#11803) @MBilalShafi
|
|
14
|
+
- 🌍 Improve Korean (ko-KR) and Chinese (zh-CN) locales on the Pickers
|
|
15
|
+
- 🐞 Bugfixes
|
|
16
|
+
- 📚 Documentation improvements
|
|
17
|
+
|
|
18
|
+
### Data Grid
|
|
19
|
+
|
|
20
|
+
#### `@mui/x-data-grid@7.0.0-beta.5`
|
|
21
|
+
|
|
22
|
+
- [DataGrid] Add `getSortComparator` for more advanced sorting behaviors (#12215) @cherniavskii
|
|
23
|
+
- [DataGrid] Add `use client` directive to the Grid packages (#11803) @MBilalShafi
|
|
24
|
+
- [DataGrid] Fix `disableResetButton` and `disableShowHideToggle` flags to not exclude each other (#12169) @adyry
|
|
25
|
+
- [DataGrid] Fix cell range classnames (#12230) @romgrk
|
|
26
|
+
- [DataGrid] Fix wrong offset for right-pinned columns when toggling dark/light modes (#12233) @cherniavskii
|
|
27
|
+
- [DataGrid] Improve row virtualization and rendering performance (#12247) @romgrk
|
|
28
|
+
- [DataGrid] Improve performance by removing `querySelector` call (#12229) @romgrk
|
|
29
|
+
- [DataGrid] Fix `onColumnWidthChange` called before autosize affects column width (#12140) @shaharyar-shamshi
|
|
30
|
+
- [DataGrid] Fix boolean "is" filter (#12117) @shaharyar-shamshi
|
|
31
|
+
- [DataGrid] Fix `upsertFilterItems` removing filters that are not part of the update (#11954) @gitstart
|
|
32
|
+
- [DataGrid] Render scrollbars only if there is scroll (#12265) @cherniavskii
|
|
33
|
+
|
|
34
|
+
#### `@mui/x-data-grid-pro@7.0.0-beta.5` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
35
|
+
|
|
36
|
+
Same changes as in `@mui/x-data-grid@7.0.0-beta.5`, plus:
|
|
37
|
+
|
|
38
|
+
- [DataGridPro] Fix column resize errors on MacOS with automatic scrollbars enabled (#12217) @cherniavskii
|
|
39
|
+
- [DataGridPro] Fix lazy-loading crash (#12080) @romgrk
|
|
40
|
+
- [DataGridPro] Fix useGridRows not giving error on reversed data (#10821) @martijn-basesoft
|
|
41
|
+
|
|
42
|
+
#### `@mui/x-data-grid-premium@7.0.0-beta.5` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
43
|
+
|
|
44
|
+
Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.5`, plus:
|
|
45
|
+
|
|
46
|
+
- [DataGridPremium] Make clipboard copy respect the sorting during cell selection (#12235) @MBilalShafi
|
|
47
|
+
|
|
48
|
+
### Date Pickers
|
|
49
|
+
|
|
50
|
+
#### `@mui/x-date-pickers@7.0.0-beta.5`
|
|
51
|
+
|
|
52
|
+
- [pickers] Fix toolbar components props handling (#12211) @LukasTy
|
|
53
|
+
- [l10n] Improve Chinese (zh-CN) locale (#12245) @headironc
|
|
54
|
+
- [l10n] Improve Korean (ko-KR) locale (#12192) @Luzi
|
|
55
|
+
|
|
56
|
+
#### `@mui/x-date-pickers-pro@7.0.0-beta.5` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
57
|
+
|
|
58
|
+
Same changes as in `@mui/x-date-pickers@7.0.0-beta.5`.
|
|
59
|
+
|
|
60
|
+
- [DateTimeRangePicker] Fix validation behavior (#12243) @LukasTy
|
|
61
|
+
|
|
62
|
+
### Charts / `@mui/x-charts@7.0.0-beta.5`
|
|
63
|
+
|
|
64
|
+
- [charts] Fix grid duplicated key (#12208) @alexfauquette
|
|
65
|
+
|
|
66
|
+
### Tree View / `@mui/x-tree-view@7.0.0-beta.5`
|
|
67
|
+
|
|
68
|
+
- [TreeView] Add public API and expose focus method (#12143) @noraleonte
|
|
69
|
+
|
|
70
|
+
### Docs
|
|
71
|
+
|
|
72
|
+
- [docs] Fix image layout shift when loading @oliviertassinari
|
|
73
|
+
- [docs] Match Material UI repo comment for redirections @oliviertassinari
|
|
74
|
+
- [docs] Non breaking spaces @oliviertassinari
|
|
75
|
+
- [docs] Polish the Date Picker playground (#11869) @zanivan
|
|
76
|
+
- [docs] Standardize WAI-ARIA references @oliviertassinari
|
|
77
|
+
|
|
78
|
+
### Core
|
|
79
|
+
|
|
80
|
+
- [core] Allow local docs next.js settings (#12227) @romgrk
|
|
81
|
+
- [core] Remove grid folder from `getComponentInfo` RegExp (#12241) @flaviendelangle
|
|
82
|
+
- [core] Remove `window.` reference for common globals @oliviertassinari
|
|
83
|
+
- [core] Use runtime agnostic setTimeout type @oliviertassinari
|
|
84
|
+
- [docs-infra] Fix Stack Overflow breaking space @oliviertassinari
|
|
85
|
+
- [docs-infra] Fix missing non breaking spaces @oliviertassinari
|
|
86
|
+
- [github] Update `no-response` workflow (#12193) @MBilalShafi
|
|
87
|
+
- [infra] Fix missing permission reset @oliviertassinari
|
|
88
|
+
|
|
6
89
|
## 7.0.0-beta.4
|
|
7
90
|
|
|
8
91
|
_Feb 23, 2024_
|
|
@@ -49,7 +132,7 @@ Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.4`.
|
|
|
49
132
|
<DateField
|
|
50
133
|
- selectedSections={{ startIndex: 0, endIndex: 0 }}
|
|
51
134
|
+ selectedSections={0}
|
|
52
|
-
|
|
135
|
+
|
|
53
136
|
// If the field has 3 sections
|
|
54
137
|
- selectedSections={{ startIndex: 0, endIndex: 2 }}
|
|
55
138
|
+ selectedSections="all"
|
|
@@ -68,20 +151,20 @@ Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.4`.
|
|
|
68
151
|
+ enableAccessibleFieldDOMStructure,
|
|
69
152
|
// ... rest of the props you are using
|
|
70
153
|
} = props;
|
|
71
|
-
|
|
154
|
+
|
|
72
155
|
return ( /* Some UI to edit the date */ )
|
|
73
156
|
}
|
|
74
|
-
|
|
157
|
+
|
|
75
158
|
function MyCustomField(props) {
|
|
76
159
|
const fieldResponse = useDateField<Dayjs, false, typeof textFieldProps>({
|
|
77
160
|
...props,
|
|
78
161
|
+ // If you only support one DOM structure, we advise you to hardcode it here to avoid unwanted switches in your application
|
|
79
162
|
+ enableAccessibleFieldDOMStructure: false,
|
|
80
163
|
});
|
|
81
|
-
|
|
164
|
+
|
|
82
165
|
return <MyCustomTextField ref={ref} {...fieldResponse} />;
|
|
83
166
|
}
|
|
84
|
-
|
|
167
|
+
|
|
85
168
|
function App() {
|
|
86
169
|
return <DatePicker slots={{ field: MyCustomField }} />;
|
|
87
170
|
}
|
|
@@ -2352,6 +2435,47 @@ Here is an example of the renaming for the `<ChartsTooltip />` component.
|
|
|
2352
2435
|
- [core] Update release instructions as per v7 configuration (#10962) @MBilalShafi
|
|
2353
2436
|
- [license] Correctly throw errors (#10924) @oliviertassinari
|
|
2354
2437
|
|
|
2438
|
+
## 6.19.6
|
|
2439
|
+
|
|
2440
|
+
_Mar 1, 2024_
|
|
2441
|
+
|
|
2442
|
+
We'd like to offer a big thanks to the 4 contributors who made this release possible. Here are some highlights ✨:
|
|
2443
|
+
|
|
2444
|
+
- 🌍 Improve Korean (ko-KR) and Chinese (zh-CN) locales on the Pickers
|
|
2445
|
+
- 🐞 Bugfixes
|
|
2446
|
+
- 📚 Documentation improvements
|
|
2447
|
+
|
|
2448
|
+
### Data Grid
|
|
2449
|
+
|
|
2450
|
+
#### `@mui/x-data-grid@6.19.6`
|
|
2451
|
+
|
|
2452
|
+
- [DataGrid] Fix error when existing rows are passed to `replaceRows` (@martijn-basesoft)
|
|
2453
|
+
|
|
2454
|
+
#### `@mui/x-data-grid-pro@6.19.6` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
2455
|
+
|
|
2456
|
+
Same changes as in `@mui/x-data-grid@6.19.6`.
|
|
2457
|
+
|
|
2458
|
+
#### `@mui/x-data-grid-premium@6.19.6` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
2459
|
+
|
|
2460
|
+
Same changes as in `@mui/x-data-grid-pro@6.19.6`, plus:
|
|
2461
|
+
|
|
2462
|
+
- [DataGridPremium] Make clipboard copy respect the sorting during cell selection (#12255) @MBilalShafi
|
|
2463
|
+
|
|
2464
|
+
### Date Pickers
|
|
2465
|
+
|
|
2466
|
+
#### `@mui/x-date-pickers@6.19.6`
|
|
2467
|
+
|
|
2468
|
+
- [l10n] Improve Chinese (zh-CN) locale (#12250) @headironc
|
|
2469
|
+
- [l10n] Improve Korean (ko-KR) locale (#12186) @Luzi
|
|
2470
|
+
|
|
2471
|
+
#### `@mui/x-date-pickers-pro@6.19.6` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
2472
|
+
|
|
2473
|
+
Same changes as in `@mui/x-date-pickers@6.19.6`.
|
|
2474
|
+
|
|
2475
|
+
### Docs
|
|
2476
|
+
|
|
2477
|
+
- [docs] Update lazy loading demo to show skeleton rows during initial rows fetch (#12062) @cherniavskii
|
|
2478
|
+
|
|
2355
2479
|
## 6.19.5
|
|
2356
2480
|
|
|
2357
2481
|
_Feb 23, 2024_
|
|
@@ -2394,8 +2518,8 @@ Same changes as in `@mui/x-date-pickers@6.19.5`.
|
|
|
2394
2518
|
|
|
2395
2519
|
- [docs] Clarify Pickers 'Component composition' section (#12147) @LukasTy
|
|
2396
2520
|
- [docs] Fix 301 redirection to StackBlitz @oliviertassinari
|
|
2397
|
-
- [docs] Fix 301 to Material
|
|
2398
|
-
- [docs] Fix 301 to Material
|
|
2521
|
+
- [docs] Fix 301 to Material UI @oliviertassinari
|
|
2522
|
+
- [docs] Fix 301 to Material UI @oliviertassinari
|
|
2399
2523
|
- [docs] Fix 404 links to translation source @oliviertassinari
|
|
2400
2524
|
- [docs] Fix dead link to translations @oliviertassinari
|
|
2401
2525
|
- [docs] Fix the Treemap illustration (#12189) @danilo-leal
|
|
@@ -4264,7 +4388,7 @@ We'd like to offer a big thanks to the 13 contributors who made this release pos
|
|
|
4264
4388
|
|
|
4265
4389
|
#### `@mui/x-data-grid@6.9.1`
|
|
4266
4390
|
|
|
4267
|
-
- [DataGrid] Add Joy
|
|
4391
|
+
- [DataGrid] Add Joy UI `tooltip` and `loadingOverlay` slots (#9028) @cherniavskii
|
|
4268
4392
|
- [DataGrid] Add section about enabling pagination on Pro and Premium (#8759) @joserodolfofreitas
|
|
4269
4393
|
- [DataGrid] Don't forward `editCellState` prop to DOM element (#9501) @m4theushw
|
|
4270
4394
|
- [DataGrid] Add experimental API for faster filtering performance (#9254) @romgrk
|
|
@@ -4395,7 +4519,7 @@ Same changes as in `@mui/x-date-pickers@6.9.0`.
|
|
|
4395
4519
|
- [docs] Fix random screenshot generation (#9364) @cherniavskii
|
|
4396
4520
|
- [docs] Remove random generation from chart doc example (#9343) @flaviendelangle
|
|
4397
4521
|
- [docs] Sync h1 with sidenav link (#9252) @oliviertassinari
|
|
4398
|
-
- [docs] Use the mui-x Stack
|
|
4522
|
+
- [docs] Use the mui-x Stack Overflow tag (#9352) @oliviertassinari
|
|
4399
4523
|
|
|
4400
4524
|
### Core
|
|
4401
4525
|
|
|
@@ -4722,8 +4846,8 @@ We'd like to offer a big thanks to the 12 contributors who made this release pos
|
|
|
4722
4846
|
|
|
4723
4847
|
- [DataGrid] Fix DataGrid rendering in JSDOM (#8968) @cherniavskii
|
|
4724
4848
|
- [DataGrid] Fix layout when rendered inside a parent with `display: grid` (#8577) @cherniavskii
|
|
4725
|
-
- [DataGrid] Add Joy
|
|
4726
|
-
- [DataGrid] Add Joy
|
|
4849
|
+
- [DataGrid] Add Joy UI icon slots (#8940) @siriwatknp
|
|
4850
|
+
- [DataGrid] Add Joy UI pagination slot (#8871) @cherniavskii
|
|
4727
4851
|
- [DataGrid] Extract `baseChip` slot (#8748) @cherniavskii
|
|
4728
4852
|
- [DataGridPremium] Implement Clipboard import (#7389) @cherniavskii
|
|
4729
4853
|
- [l10n] Improve French (fr-FR) locale (#8825) @allereaugabriel
|
|
@@ -4773,7 +4897,7 @@ We'd like to offer a big thanks to the 7 contributors who made this release poss
|
|
|
4773
4897
|
- [DataGrid] Fix falsy filter values not showing in filter button tooltip (#8550) @ithrforu
|
|
4774
4898
|
- [DataGrid] Fix missing watermark in Pro and Premium packages (#8797) @cherniavskii
|
|
4775
4899
|
- [DataGrid] Remove unwarranted warning log (#8847) @romgrk
|
|
4776
|
-
- [DataGrid] Add Joy
|
|
4900
|
+
- [DataGrid] Add Joy UI slots (`Select`, `SelectOption`, `InputLabel`, `FormControl`) (#8747) @cherniavskii
|
|
4777
4901
|
- [DataGridPremium] Fix expanded groups being collapsed after calling `updateRows` (#8823) @cherniavskii
|
|
4778
4902
|
|
|
4779
4903
|
### `@mui/x-date-pickers@6.3.1` / `@mui/x-date-pickers-pro@6.3.1`
|
|
@@ -4824,7 +4948,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
|
|
|
4824
4948
|
- [DataGrid] Add overlay classes to `gridClasses` (#8686) @lindapaiste
|
|
4825
4949
|
- [DataGrid] Avoid passing `api` prop to div (#8679) @someden
|
|
4826
4950
|
- [DataGrid] Fix 'ResizeObserver loop limit exceeded' error (#8744) @m4theushw
|
|
4827
|
-
- [DataGrid] Add Joy
|
|
4951
|
+
- [DataGrid] Add Joy UI slots (button and switch) (#8699) @siriwatknp
|
|
4828
4952
|
- [DataGrid] Fix aggregation label alignment (#8694) @joserodolfofreitas
|
|
4829
4953
|
- [DataGridPremium] Fix infinite loop when updating grouped rows (#8693) @cherniavskii
|
|
4830
4954
|
- [DataGridPro] Fix error after updating `columns` and `columnGroupingModel` at once (#8730) @cherniavskii
|
|
@@ -4886,7 +5010,7 @@ We'd like to offer a big thanks to the 9 contributors who made this release poss
|
|
|
4886
5010
|
#### Changes
|
|
4887
5011
|
|
|
4888
5012
|
- [DataGrid] Add `getTogglableColumns` to `Hide all` and `Show all` actions (#8496) @MBilalShafi
|
|
4889
|
-
- [DataGrid] Add Grid + Joy
|
|
5013
|
+
- [DataGrid] Add Grid + Joy UI experiment page (#8067) @cherniavskii
|
|
4890
5014
|
- [DataGrid] Fix print style when rendering inside Shadow DOM (#8656) @Bwatermelon
|
|
4891
5015
|
- [DataGrid] Replace `GridAutoSizer` with `ResizeObserver` (#8091) @m4theushw
|
|
4892
5016
|
- [DataGrid] Use stable ID for the placeholder filter item (#8603) @m4theushw
|
|
@@ -4,14 +4,14 @@ import { PickerValidDate } from '@mui/x-date-pickers/models';
|
|
|
4
4
|
import { DateRange } from '../models';
|
|
5
5
|
import { UseRangePositionResponse } from '../internals/hooks/useRangePosition';
|
|
6
6
|
import { DateRangePickerToolbarClasses } from './dateRangePickerToolbarClasses';
|
|
7
|
-
export interface DateRangePickerToolbarProps<TDate extends PickerValidDate> extends Omit<BaseToolbarProps<DateRange<TDate>, 'day'>, '
|
|
7
|
+
export interface DateRangePickerToolbarProps<TDate extends PickerValidDate> extends ExportedDateRangePickerToolbarProps, Omit<BaseToolbarProps<DateRange<TDate>, 'day'>, 'onChange' | 'isLandscape'>, Pick<UseRangePositionResponse, 'rangePosition' | 'onRangePositionChange'> {
|
|
8
|
+
}
|
|
9
|
+
export interface ExportedDateRangePickerToolbarProps extends ExportedBaseToolbarProps {
|
|
8
10
|
/**
|
|
9
11
|
* Override or extend the styles applied to the component.
|
|
10
12
|
*/
|
|
11
13
|
classes?: Partial<DateRangePickerToolbarClasses>;
|
|
12
14
|
}
|
|
13
|
-
export interface ExportedDateRangePickerToolbarProps extends ExportedBaseToolbarProps {
|
|
14
|
-
}
|
|
15
15
|
/**
|
|
16
16
|
* Demos:
|
|
17
17
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["value", "rangePosition", "onRangePositionChange", "toolbarFormat", "className"];
|
|
3
|
+
const _excluded = ["value", "rangePosition", "onRangePositionChange", "toolbarFormat", "className", "onViewChange", "view", "views"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -105,6 +105,12 @@ process.env.NODE_ENV !== "production" ? DateRangePickerToolbar.propTypes = {
|
|
|
105
105
|
*/
|
|
106
106
|
hidden: PropTypes.bool,
|
|
107
107
|
onRangePositionChange: PropTypes.func.isRequired,
|
|
108
|
+
/**
|
|
109
|
+
* Callback called when a toolbar is clicked
|
|
110
|
+
* @template TView
|
|
111
|
+
* @param {TView} view The view to open
|
|
112
|
+
*/
|
|
113
|
+
onViewChange: PropTypes.func.isRequired,
|
|
108
114
|
rangePosition: PropTypes.oneOf(['end', 'start']).isRequired,
|
|
109
115
|
readOnly: PropTypes.bool,
|
|
110
116
|
/**
|
|
@@ -121,6 +127,14 @@ process.env.NODE_ENV !== "production" ? DateRangePickerToolbar.propTypes = {
|
|
|
121
127
|
* @default "––"
|
|
122
128
|
*/
|
|
123
129
|
toolbarPlaceholder: PropTypes.node,
|
|
124
|
-
value: PropTypes.arrayOf(PropTypes.object).isRequired
|
|
130
|
+
value: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
131
|
+
/**
|
|
132
|
+
* Currently visible picker view.
|
|
133
|
+
*/
|
|
134
|
+
view: PropTypes.oneOf(['day']).isRequired,
|
|
135
|
+
/**
|
|
136
|
+
* Available views.
|
|
137
|
+
*/
|
|
138
|
+
views: PropTypes.arrayOf(PropTypes.oneOf(['day'])).isRequired
|
|
125
139
|
} : void 0;
|
|
126
140
|
export { DateRangePickerToolbar };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["value", "rangePosition", "onRangePositionChange", "className", "onViewChange", "toolbarVariant", "onChange", "classes", "view"];
|
|
3
|
+
const _excluded = ["value", "rangePosition", "onRangePositionChange", "className", "onViewChange", "toolbarVariant", "onChange", "classes", "view", "isLandscape", "views", "ampm", "disabled", "readOnly", "hidden", "toolbarFormat", "toolbarPlaceholder", "titleId", "sx"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -66,9 +66,29 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
|
|
|
66
66
|
className,
|
|
67
67
|
onViewChange,
|
|
68
68
|
onChange,
|
|
69
|
-
view
|
|
69
|
+
view,
|
|
70
|
+
isLandscape,
|
|
71
|
+
views,
|
|
72
|
+
ampm,
|
|
73
|
+
disabled,
|
|
74
|
+
readOnly,
|
|
75
|
+
hidden,
|
|
76
|
+
toolbarFormat,
|
|
77
|
+
toolbarPlaceholder,
|
|
78
|
+
titleId,
|
|
79
|
+
sx
|
|
70
80
|
} = props,
|
|
71
81
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
82
|
+
const commonToolbarProps = {
|
|
83
|
+
isLandscape,
|
|
84
|
+
views,
|
|
85
|
+
ampm,
|
|
86
|
+
disabled,
|
|
87
|
+
readOnly,
|
|
88
|
+
hidden,
|
|
89
|
+
toolbarFormat,
|
|
90
|
+
toolbarPlaceholder
|
|
91
|
+
};
|
|
72
92
|
const localeText = useLocaleText();
|
|
73
93
|
const ownerState = props;
|
|
74
94
|
const classes = useUtilityClasses(ownerState);
|
|
@@ -104,11 +124,16 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
|
|
|
104
124
|
onRangePositionChange(nextSelection);
|
|
105
125
|
onChange(newRange);
|
|
106
126
|
}, [onChange, onRangePositionChange, props.value, rangePosition, utils]);
|
|
107
|
-
|
|
127
|
+
if (hidden) {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
return /*#__PURE__*/_jsxs(DateTimeRangePickerToolbarRoot, _extends({
|
|
108
131
|
className: clsx(className, classes.root),
|
|
109
132
|
ownerState: ownerState,
|
|
110
133
|
ref: ref,
|
|
111
|
-
|
|
134
|
+
sx: sx
|
|
135
|
+
}, other, {
|
|
136
|
+
children: [/*#__PURE__*/_jsx(DateTimeRangePickerToolbarStart, _extends({
|
|
112
137
|
value: start,
|
|
113
138
|
onViewChange: handleStartRangeViewChange,
|
|
114
139
|
toolbarTitle: localeText.start,
|
|
@@ -116,8 +141,9 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
|
|
|
116
141
|
toolbarVariant: "desktop",
|
|
117
142
|
view: rangePosition === 'start' ? view : undefined,
|
|
118
143
|
className: classes.startToolbar,
|
|
119
|
-
onChange: handleOnChange
|
|
120
|
-
|
|
144
|
+
onChange: handleOnChange,
|
|
145
|
+
titleId: titleId ? `${titleId}-start-toolbar` : undefined
|
|
146
|
+
}, commonToolbarProps)), /*#__PURE__*/_jsx(DateTimeRangePickerToolbarEnd, _extends({
|
|
121
147
|
value: end,
|
|
122
148
|
onViewChange: handleEndRangeViewChange,
|
|
123
149
|
toolbarTitle: localeText.end,
|
|
@@ -125,9 +151,10 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
|
|
|
125
151
|
toolbarVariant: "desktop",
|
|
126
152
|
view: rangePosition === 'end' ? view : undefined,
|
|
127
153
|
className: classes.endToolbar,
|
|
128
|
-
onChange: handleOnChange
|
|
129
|
-
|
|
130
|
-
|
|
154
|
+
onChange: handleOnChange,
|
|
155
|
+
titleId: titleId ? `${titleId}-end-toolbar` : undefined
|
|
156
|
+
}, commonToolbarProps))]
|
|
157
|
+
}));
|
|
131
158
|
});
|
|
132
159
|
process.env.NODE_ENV !== "production" ? DateTimeRangePickerToolbar.propTypes = {
|
|
133
160
|
// ----------------------------- Warning --------------------------------
|
|
@@ -177,6 +204,9 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePickerToolbar.propTypes = {
|
|
|
177
204
|
* Currently visible picker view.
|
|
178
205
|
*/
|
|
179
206
|
view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'seconds']).isRequired,
|
|
207
|
+
/**
|
|
208
|
+
* Available views.
|
|
209
|
+
*/
|
|
180
210
|
views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'seconds']).isRequired).isRequired
|
|
181
211
|
} : void 0;
|
|
182
212
|
export { DateTimeRangePickerToolbar };
|
|
@@ -4,7 +4,7 @@ import { useDefaultDates, useUtils, applyDefaultDate, applyDefaultViewProps, res
|
|
|
4
4
|
import { DateTimeRangePickerToolbar } from './DateTimeRangePickerToolbar';
|
|
5
5
|
import { DateTimeRangePickerTabs } from './DateTimeRangePickerTabs';
|
|
6
6
|
export function useDateTimeRangePickerDefaultizedProps(props, name) {
|
|
7
|
-
var _themeProps$ampm, _themeProps$disableFu, _themeProps$disablePa, _themeProps$slotProps;
|
|
7
|
+
var _themeProps$ampm, _themeProps$disableFu, _themeProps$disablePa, _themeProps$minDateTi, _themeProps$maxDateTi, _themeProps$minDateTi2, _themeProps$maxDateTi2, _themeProps$disableIg, _themeProps$slotProps;
|
|
8
8
|
const utils = useUtils();
|
|
9
9
|
const defaultDates = useDefaultDates();
|
|
10
10
|
const themeProps = useThemeProps({
|
|
@@ -41,8 +41,13 @@ export function useDateTimeRangePickerDefaultizedProps(props, name) {
|
|
|
41
41
|
ampm,
|
|
42
42
|
disableFuture: (_themeProps$disableFu = themeProps.disableFuture) != null ? _themeProps$disableFu : false,
|
|
43
43
|
disablePast: (_themeProps$disablePa = themeProps.disablePast) != null ? _themeProps$disablePa : false,
|
|
44
|
-
minDate: applyDefaultDate(utils, themeProps.minDate, defaultDates.minDate),
|
|
45
|
-
maxDate: applyDefaultDate(utils, themeProps.maxDate, defaultDates.maxDate),
|
|
44
|
+
minDate: applyDefaultDate(utils, (_themeProps$minDateTi = themeProps.minDateTime) != null ? _themeProps$minDateTi : themeProps.minDate, defaultDates.minDate),
|
|
45
|
+
maxDate: applyDefaultDate(utils, (_themeProps$maxDateTi = themeProps.maxDateTime) != null ? _themeProps$maxDateTi : themeProps.maxDate, defaultDates.maxDate),
|
|
46
|
+
minTime: (_themeProps$minDateTi2 = themeProps.minDateTime) != null ? _themeProps$minDateTi2 : themeProps.minTime,
|
|
47
|
+
maxTime: (_themeProps$maxDateTi2 = themeProps.maxDateTime) != null ? _themeProps$maxDateTi2 : themeProps.maxTime,
|
|
48
|
+
disableIgnoringDatePartForTimeValidation: (_themeProps$disableIg = themeProps.disableIgnoringDatePartForTimeValidation) != null ? _themeProps$disableIg : Boolean(themeProps.minDateTime || themeProps.maxDateTime ||
|
|
49
|
+
// allow digital clocks to correctly check time validity: https://github.com/mui/mui-x/issues/12048
|
|
50
|
+
themeProps.disablePast || themeProps.disableFuture),
|
|
46
51
|
slots: _extends({
|
|
47
52
|
tabs: DateTimeRangePickerTabs,
|
|
48
53
|
toolbar: DateTimeRangePickerToolbar
|
|
@@ -4,7 +4,7 @@ import { UseDesktopRangePickerSlots, UseDesktopRangePickerSlotProps, DesktopRang
|
|
|
4
4
|
import { BaseDateRangePickerProps, BaseDateRangePickerSlots, BaseDateRangePickerSlotProps } from '../DateRangePicker/shared';
|
|
5
5
|
export interface DesktopDateRangePickerSlots<TDate extends PickerValidDate> extends BaseDateRangePickerSlots<TDate>, MakeOptional<UseDesktopRangePickerSlots<TDate, 'day'>, 'field'> {
|
|
6
6
|
}
|
|
7
|
-
export interface DesktopDateRangePickerSlotProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends BaseDateRangePickerSlotProps<TDate>, Omit<UseDesktopRangePickerSlotProps<TDate, 'day', TEnableAccessibleFieldDOMStructure>, 'tabs'> {
|
|
7
|
+
export interface DesktopDateRangePickerSlotProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends BaseDateRangePickerSlotProps<TDate>, Omit<UseDesktopRangePickerSlotProps<TDate, 'day', TEnableAccessibleFieldDOMStructure>, 'tabs' | 'toolbar'> {
|
|
8
8
|
}
|
|
9
9
|
export interface DesktopDateRangePickerProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> extends BaseDateRangePickerProps<TDate>, DesktopRangeOnlyPickerProps {
|
|
10
10
|
/**
|
|
@@ -4,7 +4,7 @@ import { UseMobileRangePickerSlots, UseMobileRangePickerSlotProps, MobileRangeOn
|
|
|
4
4
|
import { BaseDateRangePickerProps, BaseDateRangePickerSlots, BaseDateRangePickerSlotProps } from '../DateRangePicker/shared';
|
|
5
5
|
export interface MobileDateRangePickerSlots<TDate extends PickerValidDate> extends BaseDateRangePickerSlots<TDate>, MakeOptional<UseMobileRangePickerSlots<TDate, 'day'>, 'field'> {
|
|
6
6
|
}
|
|
7
|
-
export interface MobileDateRangePickerSlotProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends BaseDateRangePickerSlotProps<TDate>, Omit<UseMobileRangePickerSlotProps<TDate, 'day', TEnableAccessibleFieldDOMStructure>, 'tabs'> {
|
|
7
|
+
export interface MobileDateRangePickerSlotProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends BaseDateRangePickerSlotProps<TDate>, Omit<UseMobileRangePickerSlotProps<TDate, 'day', TEnableAccessibleFieldDOMStructure>, 'tabs' | 'toolbar'> {
|
|
8
8
|
}
|
|
9
9
|
export interface MobileDateRangePickerProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> extends BaseDateRangePickerProps<TDate>, MobileRangeOnlyPickerProps {
|
|
10
10
|
/**
|
|
@@ -4,7 +4,7 @@ import { StaticRangeOnlyPickerProps, UseStaticRangePickerSlots, UseStaticRangePi
|
|
|
4
4
|
import { BaseDateRangePickerProps, BaseDateRangePickerSlots, BaseDateRangePickerSlotProps } from '../DateRangePicker/shared';
|
|
5
5
|
export interface StaticDateRangePickerSlots<TDate extends PickerValidDate> extends BaseDateRangePickerSlots<TDate>, UseStaticRangePickerSlots<TDate, 'day'> {
|
|
6
6
|
}
|
|
7
|
-
export interface StaticDateRangePickerSlotProps<TDate extends PickerValidDate> extends BaseDateRangePickerSlotProps<TDate>, UseStaticRangePickerSlotProps<TDate, 'day'> {
|
|
7
|
+
export interface StaticDateRangePickerSlotProps<TDate extends PickerValidDate> extends BaseDateRangePickerSlotProps<TDate>, Omit<UseStaticRangePickerSlotProps<TDate, 'day'>, 'toolbar'> {
|
|
8
8
|
}
|
|
9
9
|
export interface StaticDateRangePickerProps<TDate extends PickerValidDate> extends BaseDateRangePickerProps<TDate>, MakeOptional<StaticRangeOnlyPickerProps, 'displayStaticWrapperAs'> {
|
|
10
10
|
/**
|
package/index.js
CHANGED
|
@@ -118,7 +118,7 @@ export const useMobileRangePicker = _ref => {
|
|
|
118
118
|
});
|
|
119
119
|
const Layout = (_slots$layout = slots == null ? void 0 : slots.layout) != null ? _slots$layout : PickersLayout;
|
|
120
120
|
const finalLocaleText = _extends({}, contextLocaleText, localeText);
|
|
121
|
-
let labelledById = labelId;
|
|
121
|
+
let labelledById = pickerParams.valueType === 'date-time' ? `${labelId}-start-toolbar ${labelId}-end-toolbar` : labelId;
|
|
122
122
|
if (isToolbarHidden) {
|
|
123
123
|
const labels = [];
|
|
124
124
|
if (fieldType === 'multi-input') {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTcwOTM1NTYwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["value", "rangePosition", "onRangePositionChange", "toolbarFormat", "className"];
|
|
3
|
+
const _excluded = ["value", "rangePosition", "onRangePositionChange", "toolbarFormat", "className", "onViewChange", "view", "views"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -105,6 +105,12 @@ process.env.NODE_ENV !== "production" ? DateRangePickerToolbar.propTypes = {
|
|
|
105
105
|
*/
|
|
106
106
|
hidden: PropTypes.bool,
|
|
107
107
|
onRangePositionChange: PropTypes.func.isRequired,
|
|
108
|
+
/**
|
|
109
|
+
* Callback called when a toolbar is clicked
|
|
110
|
+
* @template TView
|
|
111
|
+
* @param {TView} view The view to open
|
|
112
|
+
*/
|
|
113
|
+
onViewChange: PropTypes.func.isRequired,
|
|
108
114
|
rangePosition: PropTypes.oneOf(['end', 'start']).isRequired,
|
|
109
115
|
readOnly: PropTypes.bool,
|
|
110
116
|
/**
|
|
@@ -121,6 +127,14 @@ process.env.NODE_ENV !== "production" ? DateRangePickerToolbar.propTypes = {
|
|
|
121
127
|
* @default "––"
|
|
122
128
|
*/
|
|
123
129
|
toolbarPlaceholder: PropTypes.node,
|
|
124
|
-
value: PropTypes.arrayOf(PropTypes.object).isRequired
|
|
130
|
+
value: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
131
|
+
/**
|
|
132
|
+
* Currently visible picker view.
|
|
133
|
+
*/
|
|
134
|
+
view: PropTypes.oneOf(['day']).isRequired,
|
|
135
|
+
/**
|
|
136
|
+
* Available views.
|
|
137
|
+
*/
|
|
138
|
+
views: PropTypes.arrayOf(PropTypes.oneOf(['day'])).isRequired
|
|
125
139
|
} : void 0;
|
|
126
140
|
export { DateRangePickerToolbar };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["value", "rangePosition", "onRangePositionChange", "className", "onViewChange", "toolbarVariant", "onChange", "classes", "view"];
|
|
3
|
+
const _excluded = ["value", "rangePosition", "onRangePositionChange", "className", "onViewChange", "toolbarVariant", "onChange", "classes", "view", "isLandscape", "views", "ampm", "disabled", "readOnly", "hidden", "toolbarFormat", "toolbarPlaceholder", "titleId", "sx"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -66,9 +66,29 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
|
|
|
66
66
|
className,
|
|
67
67
|
onViewChange,
|
|
68
68
|
onChange,
|
|
69
|
-
view
|
|
69
|
+
view,
|
|
70
|
+
isLandscape,
|
|
71
|
+
views,
|
|
72
|
+
ampm,
|
|
73
|
+
disabled,
|
|
74
|
+
readOnly,
|
|
75
|
+
hidden,
|
|
76
|
+
toolbarFormat,
|
|
77
|
+
toolbarPlaceholder,
|
|
78
|
+
titleId,
|
|
79
|
+
sx
|
|
70
80
|
} = props,
|
|
71
81
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
82
|
+
const commonToolbarProps = {
|
|
83
|
+
isLandscape,
|
|
84
|
+
views,
|
|
85
|
+
ampm,
|
|
86
|
+
disabled,
|
|
87
|
+
readOnly,
|
|
88
|
+
hidden,
|
|
89
|
+
toolbarFormat,
|
|
90
|
+
toolbarPlaceholder
|
|
91
|
+
};
|
|
72
92
|
const localeText = useLocaleText();
|
|
73
93
|
const ownerState = props;
|
|
74
94
|
const classes = useUtilityClasses(ownerState);
|
|
@@ -104,11 +124,16 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
|
|
|
104
124
|
onRangePositionChange(nextSelection);
|
|
105
125
|
onChange(newRange);
|
|
106
126
|
}, [onChange, onRangePositionChange, props.value, rangePosition, utils]);
|
|
107
|
-
|
|
127
|
+
if (hidden) {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
return /*#__PURE__*/_jsxs(DateTimeRangePickerToolbarRoot, _extends({
|
|
108
131
|
className: clsx(className, classes.root),
|
|
109
132
|
ownerState: ownerState,
|
|
110
133
|
ref: ref,
|
|
111
|
-
|
|
134
|
+
sx: sx
|
|
135
|
+
}, other, {
|
|
136
|
+
children: [/*#__PURE__*/_jsx(DateTimeRangePickerToolbarStart, _extends({
|
|
112
137
|
value: start,
|
|
113
138
|
onViewChange: handleStartRangeViewChange,
|
|
114
139
|
toolbarTitle: localeText.start,
|
|
@@ -116,8 +141,9 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
|
|
|
116
141
|
toolbarVariant: "desktop",
|
|
117
142
|
view: rangePosition === 'start' ? view : undefined,
|
|
118
143
|
className: classes.startToolbar,
|
|
119
|
-
onChange: handleOnChange
|
|
120
|
-
|
|
144
|
+
onChange: handleOnChange,
|
|
145
|
+
titleId: titleId ? `${titleId}-start-toolbar` : undefined
|
|
146
|
+
}, commonToolbarProps)), /*#__PURE__*/_jsx(DateTimeRangePickerToolbarEnd, _extends({
|
|
121
147
|
value: end,
|
|
122
148
|
onViewChange: handleEndRangeViewChange,
|
|
123
149
|
toolbarTitle: localeText.end,
|
|
@@ -125,9 +151,10 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
|
|
|
125
151
|
toolbarVariant: "desktop",
|
|
126
152
|
view: rangePosition === 'end' ? view : undefined,
|
|
127
153
|
className: classes.endToolbar,
|
|
128
|
-
onChange: handleOnChange
|
|
129
|
-
|
|
130
|
-
|
|
154
|
+
onChange: handleOnChange,
|
|
155
|
+
titleId: titleId ? `${titleId}-end-toolbar` : undefined
|
|
156
|
+
}, commonToolbarProps))]
|
|
157
|
+
}));
|
|
131
158
|
});
|
|
132
159
|
process.env.NODE_ENV !== "production" ? DateTimeRangePickerToolbar.propTypes = {
|
|
133
160
|
// ----------------------------- Warning --------------------------------
|
|
@@ -177,6 +204,9 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePickerToolbar.propTypes = {
|
|
|
177
204
|
* Currently visible picker view.
|
|
178
205
|
*/
|
|
179
206
|
view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'seconds']).isRequired,
|
|
207
|
+
/**
|
|
208
|
+
* Available views.
|
|
209
|
+
*/
|
|
180
210
|
views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'seconds']).isRequired).isRequired
|
|
181
211
|
} : void 0;
|
|
182
212
|
export { DateTimeRangePickerToolbar };
|
|
@@ -40,8 +40,13 @@ export function useDateTimeRangePickerDefaultizedProps(props, name) {
|
|
|
40
40
|
ampm,
|
|
41
41
|
disableFuture: themeProps.disableFuture ?? false,
|
|
42
42
|
disablePast: themeProps.disablePast ?? false,
|
|
43
|
-
minDate: applyDefaultDate(utils, themeProps.minDate, defaultDates.minDate),
|
|
44
|
-
maxDate: applyDefaultDate(utils, themeProps.maxDate, defaultDates.maxDate),
|
|
43
|
+
minDate: applyDefaultDate(utils, themeProps.minDateTime ?? themeProps.minDate, defaultDates.minDate),
|
|
44
|
+
maxDate: applyDefaultDate(utils, themeProps.maxDateTime ?? themeProps.maxDate, defaultDates.maxDate),
|
|
45
|
+
minTime: themeProps.minDateTime ?? themeProps.minTime,
|
|
46
|
+
maxTime: themeProps.maxDateTime ?? themeProps.maxTime,
|
|
47
|
+
disableIgnoringDatePartForTimeValidation: themeProps.disableIgnoringDatePartForTimeValidation ?? Boolean(themeProps.minDateTime || themeProps.maxDateTime ||
|
|
48
|
+
// allow digital clocks to correctly check time validity: https://github.com/mui/mui-x/issues/12048
|
|
49
|
+
themeProps.disablePast || themeProps.disableFuture),
|
|
45
50
|
slots: _extends({
|
|
46
51
|
tabs: DateTimeRangePickerTabs,
|
|
47
52
|
toolbar: DateTimeRangePickerToolbar
|
package/modern/index.js
CHANGED
|
@@ -117,7 +117,7 @@ export const useMobileRangePicker = _ref => {
|
|
|
117
117
|
});
|
|
118
118
|
const Layout = slots?.layout ?? PickersLayout;
|
|
119
119
|
const finalLocaleText = _extends({}, contextLocaleText, localeText);
|
|
120
|
-
let labelledById = labelId;
|
|
120
|
+
let labelledById = pickerParams.valueType === 'date-time' ? `${labelId}-start-toolbar ${labelId}-end-toolbar` : labelId;
|
|
121
121
|
if (isToolbarHidden) {
|
|
122
122
|
const labels = [];
|
|
123
123
|
if (fieldType === 'multi-input') {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTcwOTM1NTYwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -16,7 +16,7 @@ var _utils = require("@mui/utils");
|
|
|
16
16
|
var _internals = require("@mui/x-date-pickers/internals");
|
|
17
17
|
var _dateRangePickerToolbarClasses = require("./dateRangePickerToolbarClasses");
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
const _excluded = ["value", "rangePosition", "onRangePositionChange", "toolbarFormat", "className"];
|
|
19
|
+
const _excluded = ["value", "rangePosition", "onRangePositionChange", "toolbarFormat", "className", "onViewChange", "view", "views"];
|
|
20
20
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
21
21
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
22
22
|
const useUtilityClasses = ownerState => {
|
|
@@ -113,6 +113,12 @@ process.env.NODE_ENV !== "production" ? DateRangePickerToolbar.propTypes = {
|
|
|
113
113
|
*/
|
|
114
114
|
hidden: _propTypes.default.bool,
|
|
115
115
|
onRangePositionChange: _propTypes.default.func.isRequired,
|
|
116
|
+
/**
|
|
117
|
+
* Callback called when a toolbar is clicked
|
|
118
|
+
* @template TView
|
|
119
|
+
* @param {TView} view The view to open
|
|
120
|
+
*/
|
|
121
|
+
onViewChange: _propTypes.default.func.isRequired,
|
|
116
122
|
rangePosition: _propTypes.default.oneOf(['end', 'start']).isRequired,
|
|
117
123
|
readOnly: _propTypes.default.bool,
|
|
118
124
|
/**
|
|
@@ -129,5 +135,13 @@ process.env.NODE_ENV !== "production" ? DateRangePickerToolbar.propTypes = {
|
|
|
129
135
|
* @default "––"
|
|
130
136
|
*/
|
|
131
137
|
toolbarPlaceholder: _propTypes.default.node,
|
|
132
|
-
value: _propTypes.default.arrayOf(_propTypes.default.object).isRequired
|
|
138
|
+
value: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
139
|
+
/**
|
|
140
|
+
* Currently visible picker view.
|
|
141
|
+
*/
|
|
142
|
+
view: _propTypes.default.oneOf(['day']).isRequired,
|
|
143
|
+
/**
|
|
144
|
+
* Available views.
|
|
145
|
+
*/
|
|
146
|
+
views: _propTypes.default.arrayOf(_propTypes.default.oneOf(['day'])).isRequired
|
|
133
147
|
} : void 0;
|
|
@@ -17,7 +17,7 @@ var _DateTimePicker = require("@mui/x-date-pickers/DateTimePicker");
|
|
|
17
17
|
var _dateTimeRangePickerToolbarClasses = require("./dateTimeRangePickerToolbarClasses");
|
|
18
18
|
var _dateRangeManager = require("../internals/utils/date-range-manager");
|
|
19
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
-
const _excluded = ["value", "rangePosition", "onRangePositionChange", "className", "onViewChange", "toolbarVariant", "onChange", "classes", "view"];
|
|
20
|
+
const _excluded = ["value", "rangePosition", "onRangePositionChange", "className", "onViewChange", "toolbarVariant", "onChange", "classes", "view", "isLandscape", "views", "ampm", "disabled", "readOnly", "hidden", "toolbarFormat", "toolbarPlaceholder", "titleId", "sx"];
|
|
21
21
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
22
22
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
23
|
const useUtilityClasses = ownerState => {
|
|
@@ -74,9 +74,29 @@ const DateTimeRangePickerToolbar = exports.DateTimeRangePickerToolbar = /*#__PUR
|
|
|
74
74
|
className,
|
|
75
75
|
onViewChange,
|
|
76
76
|
onChange,
|
|
77
|
-
view
|
|
77
|
+
view,
|
|
78
|
+
isLandscape,
|
|
79
|
+
views,
|
|
80
|
+
ampm,
|
|
81
|
+
disabled,
|
|
82
|
+
readOnly,
|
|
83
|
+
hidden,
|
|
84
|
+
toolbarFormat,
|
|
85
|
+
toolbarPlaceholder,
|
|
86
|
+
titleId,
|
|
87
|
+
sx
|
|
78
88
|
} = props,
|
|
79
89
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
90
|
+
const commonToolbarProps = {
|
|
91
|
+
isLandscape,
|
|
92
|
+
views,
|
|
93
|
+
ampm,
|
|
94
|
+
disabled,
|
|
95
|
+
readOnly,
|
|
96
|
+
hidden,
|
|
97
|
+
toolbarFormat,
|
|
98
|
+
toolbarPlaceholder
|
|
99
|
+
};
|
|
80
100
|
const localeText = (0, _internals.useLocaleText)();
|
|
81
101
|
const ownerState = props;
|
|
82
102
|
const classes = useUtilityClasses(ownerState);
|
|
@@ -112,11 +132,16 @@ const DateTimeRangePickerToolbar = exports.DateTimeRangePickerToolbar = /*#__PUR
|
|
|
112
132
|
onRangePositionChange(nextSelection);
|
|
113
133
|
onChange(newRange);
|
|
114
134
|
}, [onChange, onRangePositionChange, props.value, rangePosition, utils]);
|
|
115
|
-
|
|
135
|
+
if (hidden) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(DateTimeRangePickerToolbarRoot, (0, _extends2.default)({
|
|
116
139
|
className: (0, _clsx.default)(className, classes.root),
|
|
117
140
|
ownerState: ownerState,
|
|
118
141
|
ref: ref,
|
|
119
|
-
|
|
142
|
+
sx: sx
|
|
143
|
+
}, other, {
|
|
144
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(DateTimeRangePickerToolbarStart, (0, _extends2.default)({
|
|
120
145
|
value: start,
|
|
121
146
|
onViewChange: handleStartRangeViewChange,
|
|
122
147
|
toolbarTitle: localeText.start,
|
|
@@ -124,8 +149,9 @@ const DateTimeRangePickerToolbar = exports.DateTimeRangePickerToolbar = /*#__PUR
|
|
|
124
149
|
toolbarVariant: "desktop",
|
|
125
150
|
view: rangePosition === 'start' ? view : undefined,
|
|
126
151
|
className: classes.startToolbar,
|
|
127
|
-
onChange: handleOnChange
|
|
128
|
-
|
|
152
|
+
onChange: handleOnChange,
|
|
153
|
+
titleId: titleId ? `${titleId}-start-toolbar` : undefined
|
|
154
|
+
}, commonToolbarProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(DateTimeRangePickerToolbarEnd, (0, _extends2.default)({
|
|
129
155
|
value: end,
|
|
130
156
|
onViewChange: handleEndRangeViewChange,
|
|
131
157
|
toolbarTitle: localeText.end,
|
|
@@ -133,9 +159,10 @@ const DateTimeRangePickerToolbar = exports.DateTimeRangePickerToolbar = /*#__PUR
|
|
|
133
159
|
toolbarVariant: "desktop",
|
|
134
160
|
view: rangePosition === 'end' ? view : undefined,
|
|
135
161
|
className: classes.endToolbar,
|
|
136
|
-
onChange: handleOnChange
|
|
137
|
-
|
|
138
|
-
|
|
162
|
+
onChange: handleOnChange,
|
|
163
|
+
titleId: titleId ? `${titleId}-end-toolbar` : undefined
|
|
164
|
+
}, commonToolbarProps))]
|
|
165
|
+
}));
|
|
139
166
|
});
|
|
140
167
|
process.env.NODE_ENV !== "production" ? DateTimeRangePickerToolbar.propTypes = {
|
|
141
168
|
// ----------------------------- Warning --------------------------------
|
|
@@ -185,5 +212,8 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePickerToolbar.propTypes = {
|
|
|
185
212
|
* Currently visible picker view.
|
|
186
213
|
*/
|
|
187
214
|
view: _propTypes.default.oneOf(['day', 'hours', 'meridiem', 'minutes', 'seconds']).isRequired,
|
|
215
|
+
/**
|
|
216
|
+
* Available views.
|
|
217
|
+
*/
|
|
188
218
|
views: _propTypes.default.arrayOf(_propTypes.default.oneOf(['day', 'hours', 'meridiem', 'minutes', 'seconds']).isRequired).isRequired
|
|
189
219
|
} : void 0;
|
|
@@ -47,8 +47,13 @@ function useDateTimeRangePickerDefaultizedProps(props, name) {
|
|
|
47
47
|
ampm,
|
|
48
48
|
disableFuture: themeProps.disableFuture ?? false,
|
|
49
49
|
disablePast: themeProps.disablePast ?? false,
|
|
50
|
-
minDate: (0, _internals.applyDefaultDate)(utils, themeProps.minDate, defaultDates.minDate),
|
|
51
|
-
maxDate: (0, _internals.applyDefaultDate)(utils, themeProps.maxDate, defaultDates.maxDate),
|
|
50
|
+
minDate: (0, _internals.applyDefaultDate)(utils, themeProps.minDateTime ?? themeProps.minDate, defaultDates.minDate),
|
|
51
|
+
maxDate: (0, _internals.applyDefaultDate)(utils, themeProps.maxDateTime ?? themeProps.maxDate, defaultDates.maxDate),
|
|
52
|
+
minTime: themeProps.minDateTime ?? themeProps.minTime,
|
|
53
|
+
maxTime: themeProps.maxDateTime ?? themeProps.maxTime,
|
|
54
|
+
disableIgnoringDatePartForTimeValidation: themeProps.disableIgnoringDatePartForTimeValidation ?? Boolean(themeProps.minDateTime || themeProps.maxDateTime ||
|
|
55
|
+
// allow digital clocks to correctly check time validity: https://github.com/mui/mui-x/issues/12048
|
|
56
|
+
themeProps.disablePast || themeProps.disableFuture),
|
|
52
57
|
slots: (0, _extends2.default)({
|
|
53
58
|
tabs: _DateTimeRangePickerTabs.DateTimeRangePickerTabs,
|
|
54
59
|
toolbar: _DateTimeRangePickerToolbar.DateTimeRangePickerToolbar
|
package/node/index.js
CHANGED
|
@@ -125,7 +125,7 @@ const useMobileRangePicker = _ref => {
|
|
|
125
125
|
});
|
|
126
126
|
const Layout = slots?.layout ?? _PickersLayout.PickersLayout;
|
|
127
127
|
const finalLocaleText = (0, _extends2.default)({}, contextLocaleText, localeText);
|
|
128
|
-
let labelledById = labelId;
|
|
128
|
+
let labelledById = pickerParams.valueType === 'date-time' ? `${labelId}-start-toolbar ${labelId}-end-toolbar` : labelId;
|
|
129
129
|
if (isToolbarHidden) {
|
|
130
130
|
const labels = [];
|
|
131
131
|
if (fieldType === 'multi-input') {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getReleaseInfo = void 0;
|
|
7
7
|
var _utils = require("@mui/utils");
|
|
8
8
|
const getReleaseInfo = () => {
|
|
9
|
-
const releaseInfo = "
|
|
9
|
+
const releaseInfo = "MTcwOTM1NTYwMDAwMA==";
|
|
10
10
|
if (process.env.NODE_ENV !== 'production') {
|
|
11
11
|
// A simple hack to set the value in the test environment (has no build step).
|
|
12
12
|
// eslint-disable-next-line no-useless-concat
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-date-pickers-pro",
|
|
3
|
-
"version": "7.0.0-beta.
|
|
3
|
+
"version": "7.0.0-beta.5",
|
|
4
4
|
"description": "The commercial edition of the date picker components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@mui/base": "^5.0.0-beta.36",
|
|
36
36
|
"@mui/system": "^5.15.9",
|
|
37
37
|
"@mui/utils": "^5.15.9",
|
|
38
|
-
"@mui/x-date-pickers": "7.0.0-beta.
|
|
38
|
+
"@mui/x-date-pickers": "7.0.0-beta.5",
|
|
39
39
|
"@mui/x-license": "7.0.0-beta.2",
|
|
40
40
|
"clsx": "^2.1.0",
|
|
41
41
|
"prop-types": "^15.8.1",
|
|
@@ -3,7 +3,8 @@ import { DateRangePickerDayProps } from '../DateRangePickerDay';
|
|
|
3
3
|
import { MultiInputDateRangeFieldProps } from '../MultiInputDateRangeField/MultiInputDateRangeField.types';
|
|
4
4
|
import { SingleInputDateRangeFieldProps } from '../SingleInputDateRangeField/SingleInputDateRangeField.types';
|
|
5
5
|
import { DateRangeCalendarProps } from '../DateRangeCalendar';
|
|
6
|
-
import { DateRangePickerProps
|
|
6
|
+
import { DateRangePickerProps } from '../DateRangePicker';
|
|
7
|
+
import { ExportedDateRangePickerToolbarProps } from '../DateRangePicker/DateRangePickerToolbar';
|
|
7
8
|
import { DesktopDateRangePickerProps } from '../DesktopDateRangePicker';
|
|
8
9
|
import { MobileDateRangePickerProps } from '../MobileDateRangePicker';
|
|
9
10
|
import { StaticDateRangePickerProps } from '../StaticDateRangePicker';
|
|
@@ -21,7 +22,7 @@ export interface PickersProComponentsPropsList {
|
|
|
21
22
|
MuiDateRangeCalendar: DateRangeCalendarProps<PickerValidDate>;
|
|
22
23
|
MuiDateRangePickerDay: DateRangePickerDayProps<PickerValidDate>;
|
|
23
24
|
MuiDateTimeRangePickerTabs: ExportedDateTimeRangePickerTabsProps;
|
|
24
|
-
MuiDateRangePickerToolbar:
|
|
25
|
+
MuiDateRangePickerToolbar: ExportedDateRangePickerToolbarProps;
|
|
25
26
|
MuiDateTimeRangePickerToolbar: ExportedDateTimeRangePickerToolbarProps;
|
|
26
27
|
|
|
27
28
|
// Multi input range fields
|