@mui/x-date-pickers-pro 9.0.0 → 9.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +351 -6891
- package/DateRangeCalendar/DateRangeCalendar.js +2 -2
- package/DateRangeCalendar/DateRangeCalendar.mjs +2 -2
- package/DateRangeCalendar/useDragRange.js +87 -20
- package/DateRangeCalendar/useDragRange.mjs +87 -20
- package/DateRangePickerDay/DateRangePickerDay.js +2 -2
- package/DateRangePickerDay/DateRangePickerDay.mjs +2 -2
- package/MultiInputDateRangeField/MultiInputDateRangeField.js +1 -1
- package/MultiInputDateRangeField/MultiInputDateRangeField.mjs +1 -1
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +1 -1
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.mjs +1 -1
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +1 -1
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.mjs +1 -1
- package/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -0
- package/SingleInputDateRangeField/SingleInputDateRangeField.mjs +6 -0
- package/SingleInputDateRangeField/SingleInputDateRangeField.types.d.mts +1 -1
- package/SingleInputDateRangeField/SingleInputDateRangeField.types.d.ts +1 -1
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +6 -0
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.mjs +6 -0
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.types.d.mts +1 -1
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.types.d.ts +1 -1
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -0
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.mjs +6 -0
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.types.d.mts +1 -1
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.types.d.ts +1 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +3 -2
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.mjs +4 -3
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +3 -2
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.mjs +4 -3
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +1 -1
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.mjs +2 -2
- package/package.json +4 -4
|
@@ -37,8 +37,8 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
37
37
|
const _excluded = ["value", "defaultValue", "referenceDate", "onChange", "className", "classes", "disableFuture", "disablePast", "minDate", "maxDate", "shouldDisableDate", "reduceAnimations", "onMonthChange", "rangePosition", "defaultRangePosition", "onRangePositionChange", "calendars", "currentMonthCalendarPosition", "slots", "slotProps", "loading", "renderLoading", "disableHighlightToday", "focusedView", "onFocusedViewChange", "readOnly", "disabled", "showDaysOutsideCurrentMonth", "dayOfWeekFormatter", "disableAutoMonthSwitching", "autoFocus", "fixedWeekNumber", "disableDragEditing", "displayWeekNumber", "timezone", "availableRangePositions", "views", "view", "openTo", "onViewChange"],
|
|
38
38
|
_excluded2 = ["isDragging", "rangeDragDay", "draggingDatePosition"];
|
|
39
39
|
const packageInfo = {
|
|
40
|
-
releaseDate: "
|
|
41
|
-
version: "9.0.
|
|
40
|
+
releaseDate: "MTc3NzI0ODAwMDAwMA==",
|
|
41
|
+
version: "9.0.3",
|
|
42
42
|
name: 'x-date-pickers-pro'
|
|
43
43
|
};
|
|
44
44
|
const DateRangeCalendarRoot = (0, _styles.styled)('div', {
|
|
@@ -30,8 +30,8 @@ import { PickersRangeCalendarHeader } from "../PickersRangeCalendarHeader/index.
|
|
|
30
30
|
import { useNullablePickerRangePositionContext } from "../internals/hooks/useNullablePickerRangePositionContext.mjs";
|
|
31
31
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
32
32
|
const packageInfo = {
|
|
33
|
-
releaseDate: "
|
|
34
|
-
version: "9.0.
|
|
33
|
+
releaseDate: "MTc3NzI0ODAwMDAwMA==",
|
|
34
|
+
version: "9.0.3",
|
|
35
35
|
name: 'x-date-pickers-pro'
|
|
36
36
|
};
|
|
37
37
|
const DateRangeCalendarRoot = styled('div', {
|
|
@@ -10,30 +10,91 @@ exports.useDragRange = void 0;
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
13
|
+
var _domUtils = require("@mui/x-internals/domUtils");
|
|
13
14
|
var _dateUtils = require("../internals/utils/date-utils");
|
|
15
|
+
const isEnabledButtonElement = element => (0, _domUtils.isHTMLElement)(element) && element.tagName === 'BUTTON' && !element.disabled;
|
|
16
|
+
/**
|
|
17
|
+
* Finds the closest ancestor element (or the element itself) that has the specified data attribute.
|
|
18
|
+
* This is needed because drag/touch events can target child elements (e.g., text spans)
|
|
19
|
+
* inside the button, which don't have the data attributes directly.
|
|
20
|
+
*
|
|
21
|
+
* @param element The element to start searching from.
|
|
22
|
+
* @param dataAttribute The data attribute name — must be a single lowercase word
|
|
23
|
+
* (e.g., 'timestamp', 'position') because `dataset[attr]` uses camelCase
|
|
24
|
+
* while `.closest()` uses kebab-case, and these only align for single-word names.
|
|
25
|
+
*/
|
|
26
|
+
const getClosestElementWithDataAttribute = (element, dataAttribute) => {
|
|
27
|
+
if (!element) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
return element.dataset[dataAttribute] != null ? element : element.closest(`[data-${dataAttribute}]`);
|
|
31
|
+
};
|
|
14
32
|
const resolveDateFromTarget = (target, adapter, timezone) => {
|
|
15
|
-
|
|
33
|
+
if (!(0, _domUtils.isHTMLElement)(target)) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
const element = getClosestElementWithDataAttribute(target, 'timestamp');
|
|
37
|
+
const timestampString = element?.dataset.timestamp;
|
|
16
38
|
if (!timestampString) {
|
|
17
39
|
return null;
|
|
18
40
|
}
|
|
19
|
-
const timestamp =
|
|
41
|
+
const timestamp = Number(timestampString);
|
|
20
42
|
return adapter.date(new Date(timestamp).toISOString(), timezone);
|
|
21
43
|
};
|
|
22
44
|
const isSameAsDraggingDate = event => {
|
|
23
|
-
const
|
|
24
|
-
|
|
45
|
+
const target = (0, _domUtils.getTarget)(event.nativeEvent);
|
|
46
|
+
if (!(0, _domUtils.isHTMLElement)(target)) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
const element = getClosestElementWithDataAttribute(target, 'timestamp');
|
|
50
|
+
return element?.dataset.timestamp === event.dataTransfer.getData('draggingDate');
|
|
25
51
|
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Resolves a button element from a given element.
|
|
55
|
+
* Searches both upward (ancestors) and downward (children) since:
|
|
56
|
+
* - Touch events may target child elements inside the button (e.g., TouchRipple)
|
|
57
|
+
* - `elementFromPoint` may return wrapper divs containing the button
|
|
58
|
+
*/
|
|
26
59
|
const resolveButtonElement = element => {
|
|
27
|
-
if (element) {
|
|
28
|
-
|
|
29
|
-
|
|
60
|
+
if (!element) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Check if element itself is a valid button
|
|
65
|
+
if (isEnabledButtonElement(element)) {
|
|
66
|
+
return element;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Search upward - element could be a child of the button (e.g., text span, TouchRipple)
|
|
70
|
+
const closestButton = element.closest('button');
|
|
71
|
+
if (isEnabledButtonElement(closestButton)) {
|
|
72
|
+
return closestButton;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Search downward (breadth-first, max 3 levels) - element could be a wrapper containing the button.
|
|
76
|
+
// Day cells have shallow DOM, so a small depth limit keeps this efficient.
|
|
77
|
+
const queue = Array.from(element.children).map(el => ({
|
|
78
|
+
el,
|
|
79
|
+
depth: 1
|
|
80
|
+
}));
|
|
81
|
+
const maxDepth = 3;
|
|
82
|
+
while (queue.length > 0) {
|
|
83
|
+
const {
|
|
84
|
+
el: current,
|
|
85
|
+
depth
|
|
86
|
+
} = queue.shift();
|
|
87
|
+
if (isEnabledButtonElement(current)) {
|
|
88
|
+
return current;
|
|
30
89
|
}
|
|
31
|
-
if (
|
|
32
|
-
|
|
90
|
+
if (depth < maxDepth) {
|
|
91
|
+
queue.push(...Array.from(current.children).map(el => ({
|
|
92
|
+
el,
|
|
93
|
+
depth: depth + 1
|
|
94
|
+
})));
|
|
33
95
|
}
|
|
34
|
-
return null;
|
|
35
96
|
}
|
|
36
|
-
return
|
|
97
|
+
return null;
|
|
37
98
|
};
|
|
38
99
|
const resolveElementFromTouch = (event, ignoreTouchTarget) => {
|
|
39
100
|
// don't parse multi-touch result
|
|
@@ -76,7 +137,7 @@ const useDragRangeEvents = ({
|
|
|
76
137
|
return shouldInitDragging && (isSelectedStartDate || isSelectedEndDate);
|
|
77
138
|
};
|
|
78
139
|
const handleDragStart = (0, _useEventCallback.default)(event => {
|
|
79
|
-
const newDate = resolveDateFromTarget(event.
|
|
140
|
+
const newDate = resolveDateFromTarget((0, _domUtils.getTarget)(event.nativeEvent), adapter, timezone);
|
|
80
141
|
if (!isElementDraggable(newDate)) {
|
|
81
142
|
return;
|
|
82
143
|
}
|
|
@@ -87,11 +148,14 @@ const useDragRangeEvents = ({
|
|
|
87
148
|
setRangeDragDay(newDate);
|
|
88
149
|
event.dataTransfer.effectAllowed = 'move';
|
|
89
150
|
setIsDragging(true);
|
|
90
|
-
|
|
91
|
-
|
|
151
|
+
// Use currentTarget (the element the handler is attached to) rather than target
|
|
152
|
+
// because we need the button's dataset, not a potential child element's dataset.
|
|
153
|
+
const element = getClosestElementWithDataAttribute(event.currentTarget, 'timestamp');
|
|
154
|
+
const buttonDataset = element?.dataset;
|
|
155
|
+
if (buttonDataset?.timestamp) {
|
|
92
156
|
event.dataTransfer.setData('draggingDate', buttonDataset.timestamp);
|
|
93
157
|
}
|
|
94
|
-
if (buttonDataset
|
|
158
|
+
if (buttonDataset?.position) {
|
|
95
159
|
onDatePositionChange(buttonDataset.position);
|
|
96
160
|
}
|
|
97
161
|
});
|
|
@@ -113,7 +177,7 @@ const useDragRangeEvents = ({
|
|
|
113
177
|
event.preventDefault();
|
|
114
178
|
event.stopPropagation();
|
|
115
179
|
event.dataTransfer.dropEffect = 'move';
|
|
116
|
-
setRangeDragDay(resolveDateFromTarget(event.
|
|
180
|
+
setRangeDragDay(resolveDateFromTarget((0, _domUtils.getTarget)(event.nativeEvent), adapter, timezone));
|
|
117
181
|
});
|
|
118
182
|
const handleTouchMove = (0, _useEventCallback.default)(event => {
|
|
119
183
|
const target = resolveElementFromTouch(event);
|
|
@@ -133,9 +197,12 @@ const useDragRangeEvents = ({
|
|
|
133
197
|
|
|
134
198
|
// on mobile we should only initialize dragging state after move is detected
|
|
135
199
|
setIsDragging(true);
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
200
|
+
|
|
201
|
+
// Use currentTarget (the element the handler is attached to) rather than target
|
|
202
|
+
// because we need the button's dataset, not a potential child element's dataset.
|
|
203
|
+
const element = getClosestElementWithDataAttribute(event.currentTarget, 'position');
|
|
204
|
+
const buttonDataset = element?.dataset;
|
|
205
|
+
if (buttonDataset?.position) {
|
|
139
206
|
onDatePositionChange(buttonDataset.position);
|
|
140
207
|
}
|
|
141
208
|
});
|
|
@@ -194,7 +261,7 @@ const useDragRangeEvents = ({
|
|
|
194
261
|
if (isSameAsDraggingDate(event)) {
|
|
195
262
|
return;
|
|
196
263
|
}
|
|
197
|
-
const newDate = resolveDateFromTarget(event.
|
|
264
|
+
const newDate = resolveDateFromTarget((0, _domUtils.getTarget)(event.nativeEvent), adapter, timezone);
|
|
198
265
|
if (newDate) {
|
|
199
266
|
onDrop(newDate);
|
|
200
267
|
}
|
|
@@ -3,30 +3,91 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
6
|
+
import { getTarget, isHTMLElement } from '@mui/x-internals/domUtils';
|
|
6
7
|
import { isEndOfRange, isStartOfRange } from "../internals/utils/date-utils.mjs";
|
|
8
|
+
const isEnabledButtonElement = element => isHTMLElement(element) && element.tagName === 'BUTTON' && !element.disabled;
|
|
9
|
+
/**
|
|
10
|
+
* Finds the closest ancestor element (or the element itself) that has the specified data attribute.
|
|
11
|
+
* This is needed because drag/touch events can target child elements (e.g., text spans)
|
|
12
|
+
* inside the button, which don't have the data attributes directly.
|
|
13
|
+
*
|
|
14
|
+
* @param element The element to start searching from.
|
|
15
|
+
* @param dataAttribute The data attribute name — must be a single lowercase word
|
|
16
|
+
* (e.g., 'timestamp', 'position') because `dataset[attr]` uses camelCase
|
|
17
|
+
* while `.closest()` uses kebab-case, and these only align for single-word names.
|
|
18
|
+
*/
|
|
19
|
+
const getClosestElementWithDataAttribute = (element, dataAttribute) => {
|
|
20
|
+
if (!element) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
return element.dataset[dataAttribute] != null ? element : element.closest(`[data-${dataAttribute}]`);
|
|
24
|
+
};
|
|
7
25
|
const resolveDateFromTarget = (target, adapter, timezone) => {
|
|
8
|
-
|
|
26
|
+
if (!isHTMLElement(target)) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const element = getClosestElementWithDataAttribute(target, 'timestamp');
|
|
30
|
+
const timestampString = element?.dataset.timestamp;
|
|
9
31
|
if (!timestampString) {
|
|
10
32
|
return null;
|
|
11
33
|
}
|
|
12
|
-
const timestamp =
|
|
34
|
+
const timestamp = Number(timestampString);
|
|
13
35
|
return adapter.date(new Date(timestamp).toISOString(), timezone);
|
|
14
36
|
};
|
|
15
37
|
const isSameAsDraggingDate = event => {
|
|
16
|
-
const
|
|
17
|
-
|
|
38
|
+
const target = getTarget(event.nativeEvent);
|
|
39
|
+
if (!isHTMLElement(target)) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
const element = getClosestElementWithDataAttribute(target, 'timestamp');
|
|
43
|
+
return element?.dataset.timestamp === event.dataTransfer.getData('draggingDate');
|
|
18
44
|
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Resolves a button element from a given element.
|
|
48
|
+
* Searches both upward (ancestors) and downward (children) since:
|
|
49
|
+
* - Touch events may target child elements inside the button (e.g., TouchRipple)
|
|
50
|
+
* - `elementFromPoint` may return wrapper divs containing the button
|
|
51
|
+
*/
|
|
19
52
|
const resolveButtonElement = element => {
|
|
20
|
-
if (element) {
|
|
21
|
-
|
|
22
|
-
|
|
53
|
+
if (!element) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Check if element itself is a valid button
|
|
58
|
+
if (isEnabledButtonElement(element)) {
|
|
59
|
+
return element;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Search upward - element could be a child of the button (e.g., text span, TouchRipple)
|
|
63
|
+
const closestButton = element.closest('button');
|
|
64
|
+
if (isEnabledButtonElement(closestButton)) {
|
|
65
|
+
return closestButton;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Search downward (breadth-first, max 3 levels) - element could be a wrapper containing the button.
|
|
69
|
+
// Day cells have shallow DOM, so a small depth limit keeps this efficient.
|
|
70
|
+
const queue = Array.from(element.children).map(el => ({
|
|
71
|
+
el,
|
|
72
|
+
depth: 1
|
|
73
|
+
}));
|
|
74
|
+
const maxDepth = 3;
|
|
75
|
+
while (queue.length > 0) {
|
|
76
|
+
const {
|
|
77
|
+
el: current,
|
|
78
|
+
depth
|
|
79
|
+
} = queue.shift();
|
|
80
|
+
if (isEnabledButtonElement(current)) {
|
|
81
|
+
return current;
|
|
23
82
|
}
|
|
24
|
-
if (
|
|
25
|
-
|
|
83
|
+
if (depth < maxDepth) {
|
|
84
|
+
queue.push(...Array.from(current.children).map(el => ({
|
|
85
|
+
el,
|
|
86
|
+
depth: depth + 1
|
|
87
|
+
})));
|
|
26
88
|
}
|
|
27
|
-
return null;
|
|
28
89
|
}
|
|
29
|
-
return
|
|
90
|
+
return null;
|
|
30
91
|
};
|
|
31
92
|
const resolveElementFromTouch = (event, ignoreTouchTarget) => {
|
|
32
93
|
// don't parse multi-touch result
|
|
@@ -69,7 +130,7 @@ const useDragRangeEvents = ({
|
|
|
69
130
|
return shouldInitDragging && (isSelectedStartDate || isSelectedEndDate);
|
|
70
131
|
};
|
|
71
132
|
const handleDragStart = useEventCallback(event => {
|
|
72
|
-
const newDate = resolveDateFromTarget(event.
|
|
133
|
+
const newDate = resolveDateFromTarget(getTarget(event.nativeEvent), adapter, timezone);
|
|
73
134
|
if (!isElementDraggable(newDate)) {
|
|
74
135
|
return;
|
|
75
136
|
}
|
|
@@ -80,11 +141,14 @@ const useDragRangeEvents = ({
|
|
|
80
141
|
setRangeDragDay(newDate);
|
|
81
142
|
event.dataTransfer.effectAllowed = 'move';
|
|
82
143
|
setIsDragging(true);
|
|
83
|
-
|
|
84
|
-
|
|
144
|
+
// Use currentTarget (the element the handler is attached to) rather than target
|
|
145
|
+
// because we need the button's dataset, not a potential child element's dataset.
|
|
146
|
+
const element = getClosestElementWithDataAttribute(event.currentTarget, 'timestamp');
|
|
147
|
+
const buttonDataset = element?.dataset;
|
|
148
|
+
if (buttonDataset?.timestamp) {
|
|
85
149
|
event.dataTransfer.setData('draggingDate', buttonDataset.timestamp);
|
|
86
150
|
}
|
|
87
|
-
if (buttonDataset
|
|
151
|
+
if (buttonDataset?.position) {
|
|
88
152
|
onDatePositionChange(buttonDataset.position);
|
|
89
153
|
}
|
|
90
154
|
});
|
|
@@ -106,7 +170,7 @@ const useDragRangeEvents = ({
|
|
|
106
170
|
event.preventDefault();
|
|
107
171
|
event.stopPropagation();
|
|
108
172
|
event.dataTransfer.dropEffect = 'move';
|
|
109
|
-
setRangeDragDay(resolveDateFromTarget(event.
|
|
173
|
+
setRangeDragDay(resolveDateFromTarget(getTarget(event.nativeEvent), adapter, timezone));
|
|
110
174
|
});
|
|
111
175
|
const handleTouchMove = useEventCallback(event => {
|
|
112
176
|
const target = resolveElementFromTouch(event);
|
|
@@ -126,9 +190,12 @@ const useDragRangeEvents = ({
|
|
|
126
190
|
|
|
127
191
|
// on mobile we should only initialize dragging state after move is detected
|
|
128
192
|
setIsDragging(true);
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
193
|
+
|
|
194
|
+
// Use currentTarget (the element the handler is attached to) rather than target
|
|
195
|
+
// because we need the button's dataset, not a potential child element's dataset.
|
|
196
|
+
const element = getClosestElementWithDataAttribute(event.currentTarget, 'position');
|
|
197
|
+
const buttonDataset = element?.dataset;
|
|
198
|
+
if (buttonDataset?.position) {
|
|
132
199
|
onDatePositionChange(buttonDataset.position);
|
|
133
200
|
}
|
|
134
201
|
});
|
|
@@ -187,7 +254,7 @@ const useDragRangeEvents = ({
|
|
|
187
254
|
if (isSameAsDraggingDate(event)) {
|
|
188
255
|
return;
|
|
189
256
|
}
|
|
190
|
-
const newDate = resolveDateFromTarget(event.
|
|
257
|
+
const newDate = resolveDateFromTarget(getTarget(event.nativeEvent), adapter, timezone);
|
|
191
258
|
if (newDate) {
|
|
192
259
|
onDrop(newDate);
|
|
193
260
|
}
|
|
@@ -322,8 +322,8 @@ const DateRangePickerDayRaw = /*#__PURE__*/React.forwardRef(function DateRangePi
|
|
|
322
322
|
name: 'MuiDateRangePickerDay'
|
|
323
323
|
});
|
|
324
324
|
(0, _internals.useLicenseVerifier)({
|
|
325
|
-
releaseDate: "
|
|
326
|
-
version: "9.0.
|
|
325
|
+
releaseDate: "MTc3NzI0ODAwMDAwMA==",
|
|
326
|
+
version: "9.0.3",
|
|
327
327
|
name: 'x-date-pickers-pro'
|
|
328
328
|
});
|
|
329
329
|
const adapter = (0, _hooks.usePickerAdapter)();
|
|
@@ -315,8 +315,8 @@ const DateRangePickerDayRaw = /*#__PURE__*/React.forwardRef(function DateRangePi
|
|
|
315
315
|
name: 'MuiDateRangePickerDay'
|
|
316
316
|
});
|
|
317
317
|
useLicenseVerifier({
|
|
318
|
-
releaseDate: "
|
|
319
|
-
version: "9.0.
|
|
318
|
+
releaseDate: "MTc3NzI0ODAwMDAwMA==",
|
|
319
|
+
version: "9.0.3",
|
|
320
320
|
name: 'x-date-pickers-pro'
|
|
321
321
|
});
|
|
322
322
|
const adapter = usePickerAdapter();
|
|
@@ -31,7 +31,7 @@ MultiInputDateRangeField.propTypes = {
|
|
|
31
31
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
32
32
|
// ----------------------------------------------------------------------
|
|
33
33
|
/**
|
|
34
|
-
* If `true`, the
|
|
34
|
+
* If `true`, the field is focused during the first mount.
|
|
35
35
|
* @default false
|
|
36
36
|
*/
|
|
37
37
|
autoFocus: _propTypes.default.bool,
|
|
@@ -27,7 +27,7 @@ MultiInputDateRangeField.propTypes = {
|
|
|
27
27
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
28
28
|
// ----------------------------------------------------------------------
|
|
29
29
|
/**
|
|
30
|
-
* If `true`, the
|
|
30
|
+
* If `true`, the field is focused during the first mount.
|
|
31
31
|
* @default false
|
|
32
32
|
*/
|
|
33
33
|
autoFocus: PropTypes.bool,
|
|
@@ -36,7 +36,7 @@ MultiInputDateTimeRangeField.propTypes = {
|
|
|
36
36
|
*/
|
|
37
37
|
ampm: _propTypes.default.bool,
|
|
38
38
|
/**
|
|
39
|
-
* If `true`, the
|
|
39
|
+
* If `true`, the field is focused during the first mount.
|
|
40
40
|
* @default false
|
|
41
41
|
*/
|
|
42
42
|
autoFocus: _propTypes.default.bool,
|
|
@@ -32,7 +32,7 @@ MultiInputDateTimeRangeField.propTypes = {
|
|
|
32
32
|
*/
|
|
33
33
|
ampm: PropTypes.bool,
|
|
34
34
|
/**
|
|
35
|
-
* If `true`, the
|
|
35
|
+
* If `true`, the field is focused during the first mount.
|
|
36
36
|
* @default false
|
|
37
37
|
*/
|
|
38
38
|
autoFocus: PropTypes.bool,
|
|
@@ -37,7 +37,7 @@ MultiInputTimeRangeField.propTypes = {
|
|
|
37
37
|
*/
|
|
38
38
|
ampm: _propTypes.default.bool,
|
|
39
39
|
/**
|
|
40
|
-
* If `true`, the
|
|
40
|
+
* If `true`, the field is focused during the first mount.
|
|
41
41
|
* @default false
|
|
42
42
|
*/
|
|
43
43
|
autoFocus: _propTypes.default.bool,
|
|
@@ -33,7 +33,7 @@ MultiInputTimeRangeField.propTypes = {
|
|
|
33
33
|
*/
|
|
34
34
|
ampm: PropTypes.bool,
|
|
35
35
|
/**
|
|
36
|
-
* If `true`, the
|
|
36
|
+
* If `true`, the field is focused during the first mount.
|
|
37
37
|
* @default false
|
|
38
38
|
*/
|
|
39
39
|
autoFocus: PropTypes.bool,
|
|
@@ -223,6 +223,12 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
|
|
|
223
223
|
* @param {FieldSelectedSections} newValue The new selected sections.
|
|
224
224
|
*/
|
|
225
225
|
onSelectedSectionsChange: _propTypes.default.func,
|
|
226
|
+
/**
|
|
227
|
+
* The position at which the opening button is placed.
|
|
228
|
+
* If there is no Picker to open, the button is not rendered
|
|
229
|
+
* @default 'end'
|
|
230
|
+
*/
|
|
231
|
+
openPickerButtonPosition: _propTypes.default.oneOf(['end', 'start']),
|
|
226
232
|
/**
|
|
227
233
|
* If `true`, the component is read-only.
|
|
228
234
|
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
@@ -216,6 +216,12 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
|
|
|
216
216
|
* @param {FieldSelectedSections} newValue The new selected sections.
|
|
217
217
|
*/
|
|
218
218
|
onSelectedSectionsChange: PropTypes.func,
|
|
219
|
+
/**
|
|
220
|
+
* The position at which the opening button is placed.
|
|
221
|
+
* If there is no Picker to open, the button is not rendered
|
|
222
|
+
* @default 'end'
|
|
223
|
+
*/
|
|
224
|
+
openPickerButtonPosition: PropTypes.oneOf(['end', 'start']),
|
|
219
225
|
/**
|
|
220
226
|
* If `true`, the component is read-only.
|
|
221
227
|
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ExportedPickerFieldUIProps, PickerFieldUISlots, PickerFieldUISlotProps } from '@mui/x-date-pickers/internals';
|
|
2
2
|
import { BuiltInFieldTextFieldProps } from '@mui/x-date-pickers/models';
|
|
3
3
|
import { DateRangeManagerFieldInternalProps } from "../managers/useDateRangeManager.mjs";
|
|
4
|
-
export interface UseSingleInputDateRangeFieldProps extends DateRangeManagerFieldInternalProps,
|
|
4
|
+
export interface UseSingleInputDateRangeFieldProps extends DateRangeManagerFieldInternalProps, ExportedPickerFieldUIProps {}
|
|
5
5
|
export type SingleInputDateRangeFieldProps = Omit<BuiltInFieldTextFieldProps, keyof UseSingleInputDateRangeFieldProps> & UseSingleInputDateRangeFieldProps & {
|
|
6
6
|
/**
|
|
7
7
|
* Overridable component slots.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ExportedPickerFieldUIProps, PickerFieldUISlots, PickerFieldUISlotProps } from '@mui/x-date-pickers/internals';
|
|
2
2
|
import { BuiltInFieldTextFieldProps } from '@mui/x-date-pickers/models';
|
|
3
3
|
import { DateRangeManagerFieldInternalProps } from "../managers/useDateRangeManager.js";
|
|
4
|
-
export interface UseSingleInputDateRangeFieldProps extends DateRangeManagerFieldInternalProps,
|
|
4
|
+
export interface UseSingleInputDateRangeFieldProps extends DateRangeManagerFieldInternalProps, ExportedPickerFieldUIProps {}
|
|
5
5
|
export type SingleInputDateRangeFieldProps = Omit<BuiltInFieldTextFieldProps, keyof UseSingleInputDateRangeFieldProps> & UseSingleInputDateRangeFieldProps & {
|
|
6
6
|
/**
|
|
7
7
|
* Overridable component slots.
|
|
@@ -256,6 +256,12 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
|
|
|
256
256
|
* @param {FieldSelectedSections} newValue The new selected sections.
|
|
257
257
|
*/
|
|
258
258
|
onSelectedSectionsChange: _propTypes.default.func,
|
|
259
|
+
/**
|
|
260
|
+
* The position at which the opening button is placed.
|
|
261
|
+
* If there is no Picker to open, the button is not rendered
|
|
262
|
+
* @default 'end'
|
|
263
|
+
*/
|
|
264
|
+
openPickerButtonPosition: _propTypes.default.oneOf(['end', 'start']),
|
|
259
265
|
/**
|
|
260
266
|
* If `true`, the component is read-only.
|
|
261
267
|
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
@@ -249,6 +249,12 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
|
|
|
249
249
|
* @param {FieldSelectedSections} newValue The new selected sections.
|
|
250
250
|
*/
|
|
251
251
|
onSelectedSectionsChange: PropTypes.func,
|
|
252
|
+
/**
|
|
253
|
+
* The position at which the opening button is placed.
|
|
254
|
+
* If there is no Picker to open, the button is not rendered
|
|
255
|
+
* @default 'end'
|
|
256
|
+
*/
|
|
257
|
+
openPickerButtonPosition: PropTypes.oneOf(['end', 'start']),
|
|
252
258
|
/**
|
|
253
259
|
* If `true`, the component is read-only.
|
|
254
260
|
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ExportedPickerFieldUIProps, PickerFieldUISlots, PickerFieldUISlotProps } from '@mui/x-date-pickers/internals';
|
|
2
2
|
import { BuiltInFieldTextFieldProps } from '@mui/x-date-pickers/models';
|
|
3
3
|
import { DateTimeRangeManagerFieldInternalProps } from "../managers/useDateTimeRangeManager.mjs";
|
|
4
|
-
export interface UseSingleInputDateTimeRangeFieldProps extends DateTimeRangeManagerFieldInternalProps,
|
|
4
|
+
export interface UseSingleInputDateTimeRangeFieldProps extends DateTimeRangeManagerFieldInternalProps, ExportedPickerFieldUIProps {}
|
|
5
5
|
export type SingleInputDateTimeRangeFieldProps = Omit<BuiltInFieldTextFieldProps, keyof UseSingleInputDateTimeRangeFieldProps> & UseSingleInputDateTimeRangeFieldProps & {
|
|
6
6
|
/**
|
|
7
7
|
* Overridable component slots.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ExportedPickerFieldUIProps, PickerFieldUISlots, PickerFieldUISlotProps } from '@mui/x-date-pickers/internals';
|
|
2
2
|
import { BuiltInFieldTextFieldProps } from '@mui/x-date-pickers/models';
|
|
3
3
|
import { DateTimeRangeManagerFieldInternalProps } from "../managers/useDateTimeRangeManager.js";
|
|
4
|
-
export interface UseSingleInputDateTimeRangeFieldProps extends DateTimeRangeManagerFieldInternalProps,
|
|
4
|
+
export interface UseSingleInputDateTimeRangeFieldProps extends DateTimeRangeManagerFieldInternalProps, ExportedPickerFieldUIProps {}
|
|
5
5
|
export type SingleInputDateTimeRangeFieldProps = Omit<BuiltInFieldTextFieldProps, keyof UseSingleInputDateTimeRangeFieldProps> & UseSingleInputDateTimeRangeFieldProps & {
|
|
6
6
|
/**
|
|
7
7
|
* Overridable component slots.
|
|
@@ -238,6 +238,12 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
|
|
|
238
238
|
* @param {FieldSelectedSections} newValue The new selected sections.
|
|
239
239
|
*/
|
|
240
240
|
onSelectedSectionsChange: _propTypes.default.func,
|
|
241
|
+
/**
|
|
242
|
+
* The position at which the opening button is placed.
|
|
243
|
+
* If there is no Picker to open, the button is not rendered
|
|
244
|
+
* @default 'end'
|
|
245
|
+
*/
|
|
246
|
+
openPickerButtonPosition: _propTypes.default.oneOf(['end', 'start']),
|
|
241
247
|
/**
|
|
242
248
|
* If `true`, the component is read-only.
|
|
243
249
|
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
@@ -231,6 +231,12 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
|
|
|
231
231
|
* @param {FieldSelectedSections} newValue The new selected sections.
|
|
232
232
|
*/
|
|
233
233
|
onSelectedSectionsChange: PropTypes.func,
|
|
234
|
+
/**
|
|
235
|
+
* The position at which the opening button is placed.
|
|
236
|
+
* If there is no Picker to open, the button is not rendered
|
|
237
|
+
* @default 'end'
|
|
238
|
+
*/
|
|
239
|
+
openPickerButtonPosition: PropTypes.oneOf(['end', 'start']),
|
|
234
240
|
/**
|
|
235
241
|
* If `true`, the component is read-only.
|
|
236
242
|
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ExportedPickerFieldUIProps, PickerFieldUISlots, PickerFieldUISlotProps } from '@mui/x-date-pickers/internals';
|
|
2
2
|
import { BuiltInFieldTextFieldProps } from '@mui/x-date-pickers/models';
|
|
3
3
|
import { TimeRangeManagerFieldInternalProps } from "../managers/useTimeRangeManager.mjs";
|
|
4
|
-
export interface UseSingleInputTimeRangeFieldProps extends TimeRangeManagerFieldInternalProps,
|
|
4
|
+
export interface UseSingleInputTimeRangeFieldProps extends TimeRangeManagerFieldInternalProps, ExportedPickerFieldUIProps {}
|
|
5
5
|
export type SingleInputTimeRangeFieldProps = Omit<BuiltInFieldTextFieldProps, keyof UseSingleInputTimeRangeFieldProps> & UseSingleInputTimeRangeFieldProps & {
|
|
6
6
|
/**
|
|
7
7
|
* Overridable component slots.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ExportedPickerFieldUIProps, PickerFieldUISlots, PickerFieldUISlotProps } from '@mui/x-date-pickers/internals';
|
|
2
2
|
import { BuiltInFieldTextFieldProps } from '@mui/x-date-pickers/models';
|
|
3
3
|
import { TimeRangeManagerFieldInternalProps } from "../managers/useTimeRangeManager.js";
|
|
4
|
-
export interface UseSingleInputTimeRangeFieldProps extends TimeRangeManagerFieldInternalProps,
|
|
4
|
+
export interface UseSingleInputTimeRangeFieldProps extends TimeRangeManagerFieldInternalProps, ExportedPickerFieldUIProps {}
|
|
5
5
|
export type SingleInputTimeRangeFieldProps = Omit<BuiltInFieldTextFieldProps, keyof UseSingleInputTimeRangeFieldProps> & UseSingleInputTimeRangeFieldProps & {
|
|
6
6
|
/**
|
|
7
7
|
* Overridable component slots.
|
package/index.js
CHANGED
package/index.mjs
CHANGED
|
@@ -26,8 +26,8 @@ const useDesktopRangePicker = _ref => {
|
|
|
26
26
|
} = _ref,
|
|
27
27
|
pickerParams = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
28
28
|
(0, _internals.useLicenseVerifier)({
|
|
29
|
-
releaseDate: "
|
|
30
|
-
version: "9.0.
|
|
29
|
+
releaseDate: "MTc3NzI0ODAwMDAwMA==",
|
|
30
|
+
version: "9.0.3",
|
|
31
31
|
name: 'x-date-pickers-pro'
|
|
32
32
|
});
|
|
33
33
|
const {
|
|
@@ -64,6 +64,7 @@ const useDesktopRangePicker = _ref => {
|
|
|
64
64
|
const _useSlotProps = (0, _useSlotProps2.default)({
|
|
65
65
|
elementType: Field,
|
|
66
66
|
externalSlotProps: slotProps?.field,
|
|
67
|
+
externalForwardedProps: (0, _internals2.extractRootForwardedProps)(props),
|
|
67
68
|
ownerState,
|
|
68
69
|
additionalProps: {
|
|
69
70
|
'data-active-range-position': providerProps.contextValue.open ? rangePositionResponse.rangePosition : undefined
|