@mui/x-date-pickers-pro 8.5.1 → 8.5.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +187 -10
  2. package/DateRangeCalendar/DateRangeCalendar.js +3 -2
  3. package/DateRangePickerDay/DateRangePickerDay.js +1 -1
  4. package/DateRangePickerDay2/DateRangePickerDay2.d.ts +7 -0
  5. package/DateRangePickerDay2/DateRangePickerDay2.js +603 -0
  6. package/DateRangePickerDay2/DateRangePickerDay2.types.d.ts +92 -0
  7. package/DateRangePickerDay2/DateRangePickerDay2.types.js +5 -0
  8. package/DateRangePickerDay2/dateRangePickerDay2Classes.d.ts +29 -0
  9. package/DateRangePickerDay2/dateRangePickerDay2Classes.js +14 -0
  10. package/DateRangePickerDay2/index.d.ts +4 -0
  11. package/DateRangePickerDay2/index.js +25 -0
  12. package/esm/DateRangeCalendar/DateRangeCalendar.js +3 -2
  13. package/esm/DateRangePickerDay/DateRangePickerDay.js +1 -1
  14. package/esm/DateRangePickerDay2/DateRangePickerDay2.d.ts +7 -0
  15. package/esm/DateRangePickerDay2/DateRangePickerDay2.js +595 -0
  16. package/esm/DateRangePickerDay2/DateRangePickerDay2.types.d.ts +92 -0
  17. package/esm/DateRangePickerDay2/DateRangePickerDay2.types.js +1 -0
  18. package/esm/DateRangePickerDay2/dateRangePickerDay2Classes.d.ts +29 -0
  19. package/esm/DateRangePickerDay2/dateRangePickerDay2Classes.js +6 -0
  20. package/esm/DateRangePickerDay2/index.d.ts +4 -0
  21. package/esm/DateRangePickerDay2/index.js +2 -0
  22. package/esm/index.d.ts +1 -0
  23. package/esm/index.js +2 -1
  24. package/esm/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +1 -1
  25. package/esm/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +1 -1
  26. package/esm/themeAugmentation/components.d.ts +4 -0
  27. package/esm/themeAugmentation/overrides.d.ts +2 -0
  28. package/esm/themeAugmentation/props.d.ts +2 -0
  29. package/index.d.ts +1 -0
  30. package/index.js +12 -1
  31. package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +1 -1
  32. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +1 -1
  33. package/package.json +5 -5
  34. package/themeAugmentation/components.d.ts +4 -0
  35. package/themeAugmentation/overrides.d.ts +2 -0
  36. package/themeAugmentation/props.d.ts +2 -0
@@ -0,0 +1,603 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.DateRangePickerDay2 = void 0;
9
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _propTypes = _interopRequireDefault(require("prop-types"));
13
+ var _clsx = _interopRequireDefault(require("clsx"));
14
+ var _styles = require("@mui/material/styles");
15
+ var _ButtonBase = _interopRequireDefault(require("@mui/material/ButtonBase"));
16
+ var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
17
+ var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
18
+ var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
19
+ var _internals = require("@mui/x-date-pickers/internals");
20
+ var _dateRangePickerDay2Classes = require("./dateRangePickerDay2Classes");
21
+ var _jsxRuntime = require("react/jsx-runtime");
22
+ const _excluded = ["autoFocus", "className", "classes", "hidden", "isAnimating", "onClick", "onDaySelect", "onFocus", "onBlur", "onKeyDown", "onMouseDown", "onMouseEnter", "children", "isFirstVisibleCell", "isLastVisibleCell", "day", "selected", "disabled", "today", "outsideCurrentMonth", "disableHighlightToday", "showDaysOutsideCurrentMonth", "isEndOfHighlighting", "isEndOfPreviewing", "isHighlighting", "isPreviewing", "isStartOfHighlighting", "isStartOfPreviewing", "isVisuallySelected", "draggable"];
23
+ const useUtilityClasses = (ownerState, classes) => {
24
+ const {
25
+ isDaySelected,
26
+ disableHighlightToday,
27
+ isDayCurrent,
28
+ isDayDisabled,
29
+ isDayOutsideMonth,
30
+ isDayFillerCell,
31
+ isDayPreviewStart,
32
+ isDayPreviewEnd,
33
+ isDayInsidePreview,
34
+ isDayPreviewed,
35
+ isDaySelectionStart,
36
+ isDaySelectionEnd,
37
+ isDayInsideSelection,
38
+ isDayStartOfWeek,
39
+ isDayEndOfWeek,
40
+ isDayStartOfMonth,
41
+ isDayEndOfMonth,
42
+ isDayDraggable
43
+ } = ownerState;
44
+ const slots = {
45
+ root: ['root', isDayDisabled && 'disabled', !disableHighlightToday && isDayCurrent && !isDaySelected && !isDayFillerCell && 'today', isDayOutsideMonth && 'dayOutsideMonth', isDayFillerCell && 'fillerCell', isDaySelected && 'selected', isDayPreviewStart && 'previewStart', isDayPreviewEnd && 'previewEnd', isDayInsidePreview && 'insidePreviewing', isDaySelectionStart && 'selectionStart', isDaySelectionEnd && 'selectionEnd', isDayInsideSelection && 'insideSelection', isDayEndOfWeek && 'endOfWeek', isDayStartOfWeek && 'startOfWeek', isDayPreviewed && 'previewed', isDayStartOfMonth && 'startOfMonth', isDayEndOfMonth && 'endOfMonth', isDayDraggable && 'draggable']
46
+ };
47
+ return (0, _composeClasses.default)(slots, _dateRangePickerDay2Classes.getDateRangePickerDay2UtilityClass, classes);
48
+ };
49
+ const highlightStyles = theme => ({
50
+ content: '""' /* Creates an empty element */,
51
+ height: '100%',
52
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.focusOpacity})` : (0, _styles.alpha)(theme.palette.primary.main, theme.palette.action.focusOpacity),
53
+ boxSizing: 'border-box',
54
+ left: 'calc(var(--PickerDay-horizontalMargin) * (-1))',
55
+ right: 'calc(var(--PickerDay-horizontalMargin) * (-1))'
56
+ });
57
+ const previewStyles = theme => ({
58
+ content: '""' /* Creates an empty element */,
59
+ height: '100%',
60
+ border: `1.2px dashed ${(theme.vars || theme).palette.divider}`,
61
+ borderLeftColor: 'transparent',
62
+ borderRightColor: 'transparent',
63
+ boxSizing: 'border-box',
64
+ borderOffset: '-1px',
65
+ left: 'calc(-1 * var(--PickerDay-horizontalMargin))',
66
+ right: 'calc(-1 * var(--PickerDay-horizontalMargin))'
67
+ });
68
+ const selectedDayStyles = theme => ({
69
+ color: (theme.vars || theme).palette.primary.contrastText,
70
+ backgroundColor: (theme.vars || theme).palette.primary.main,
71
+ fontWeight: theme.typography.fontWeightMedium,
72
+ '&:focus, &:hover': {
73
+ willChange: 'background-color',
74
+ backgroundColor: (theme.vars || theme).palette.primary.dark
75
+ },
76
+ [`&.${_dateRangePickerDay2Classes.dateRangePickerDay2Classes.disabled}`]: {
77
+ opacity: 0.6
78
+ }
79
+ });
80
+ const DateRangePickerDay2Root = (0, _styles.styled)(_ButtonBase.default, {
81
+ name: 'MuiDateRangePickerDay2',
82
+ slot: 'Root',
83
+ overridesResolver: (props, styles) => {
84
+ const {
85
+ ownerState
86
+ } = props;
87
+ return [styles.root, !ownerState.disableHighlightToday && ownerState.isDayCurrent && styles.today, !ownerState.isDayOutsideMonth && styles.dayOutsideMonth, ownerState.isDayFillerCell && styles.fillerCell, ownerState.isDaySelected && !ownerState.isDayInsideSelection && styles.selected, ownerState.isDayPreviewStart && styles.previewStart, ownerState.isDayPreviewEnd && styles.previewEnd, ownerState.isDayInsidePreview && styles.insidePreviewing, ownerState.isDaySelectionStart && styles.selectionStart, ownerState.isDaySelectionEnd && styles.selectionEnd, ownerState.isDayInsideSelection && styles.insideSelection, ownerState.isDayDraggable && styles.draggable, ownerState.isDayStartOfWeek && styles.startOfWeek, ownerState.isDayEndOfWeek && styles.endOfWeek];
88
+ }
89
+ })(({
90
+ theme
91
+ }) => (0, _extends2.default)({
92
+ '--PickerDay-horizontalMargin': '2px',
93
+ '--PickerDay-size': '36px'
94
+ }, theme.typography.caption, {
95
+ width: 'var(--PickerDay-size)',
96
+ height: 'var(--PickerDay-size)',
97
+ borderRadius: '18px',
98
+ padding: 0,
99
+ position: 'relative',
100
+ marginLeft: 'var(--PickerDay-horizontalMargin)',
101
+ marginRight: 'var(--PickerDay-horizontalMargin)',
102
+ // explicitly setting to `transparent` to avoid potentially getting impacted by change from the overridden component
103
+ backgroundColor: 'transparent',
104
+ transition: theme.transitions.create('background-color', {
105
+ duration: theme.transitions.duration.short
106
+ }),
107
+ color: (theme.vars || theme).palette.text.primary,
108
+ '@media (pointer: fine)': {
109
+ '&:hover': {
110
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _styles.alpha)(theme.palette.primary.main, theme.palette.action.hoverOpacity)
111
+ }
112
+ },
113
+ '&:focus': {
114
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.focusOpacity})` : (0, _styles.alpha)(theme.palette.primary.main, theme.palette.action.focusOpacity)
115
+ },
116
+ zIndex: 1,
117
+ isolation: 'isolate',
118
+ '&::before, &::after': {
119
+ zIndex: -1,
120
+ position: 'absolute',
121
+ pointerEvents: 'none',
122
+ mixBlendMode: 'multiply'
123
+ },
124
+ variants: [{
125
+ props: {
126
+ isDayDisabled: true
127
+ },
128
+ style: {
129
+ color: (theme.vars || theme).palette.text.disabled
130
+ }
131
+ }, {
132
+ props: {
133
+ isDayFillerCell: true
134
+ },
135
+ style: {
136
+ // visibility: 'hidden' does not work here as it hides the element from screen readers
137
+ // and results in unexpected relationships between week day and day columns.
138
+ opacity: 0,
139
+ pointerEvents: 'none'
140
+ }
141
+ }, {
142
+ props: {
143
+ isDayOutsideMonth: true
144
+ },
145
+ style: {
146
+ color: (theme.vars || theme).palette.text.secondary
147
+ }
148
+ }, {
149
+ props: {
150
+ isDayCurrent: true,
151
+ isDaySelected: false
152
+ },
153
+ style: {
154
+ outline: `1px solid ${(theme.vars || theme).palette.text.secondary}`,
155
+ outlineOffset: -1
156
+ }
157
+ }, {
158
+ props: {
159
+ isDayDraggable: true
160
+ },
161
+ style: {
162
+ cursor: 'grab',
163
+ touchAction: 'none'
164
+ }
165
+ }, {
166
+ props: {
167
+ isDayPreviewStart: true
168
+ },
169
+ style: {
170
+ '::after': (0, _extends2.default)({}, previewStyles(theme), {
171
+ borderTopLeftRadius: 'inherit',
172
+ borderBottomLeftRadius: 'inherit',
173
+ borderLeftColor: (theme.vars || theme).palette.divider,
174
+ left: 0
175
+ })
176
+ }
177
+ }, {
178
+ props: {
179
+ isDayPreviewEnd: true
180
+ },
181
+ style: {
182
+ '::after': (0, _extends2.default)({}, previewStyles(theme), {
183
+ borderTopRightRadius: 'inherit',
184
+ borderBottomRightRadius: 'inherit',
185
+ borderRightColor: (theme.vars || theme).palette.divider,
186
+ right: 0
187
+ })
188
+ }
189
+ }, {
190
+ props: {
191
+ isDayInsidePreview: true
192
+ },
193
+ style: {
194
+ '::after': (0, _extends2.default)({}, previewStyles(theme))
195
+ }
196
+ }, {
197
+ props: {
198
+ isDaySelectionStart: true
199
+ },
200
+ style: {
201
+ '::before': (0, _extends2.default)({}, highlightStyles(theme), {
202
+ borderTopLeftRadius: 'inherit',
203
+ borderBottomLeftRadius: 'inherit',
204
+ left: 0
205
+ })
206
+ }
207
+ }, {
208
+ props: {
209
+ isDaySelectionEnd: true
210
+ },
211
+ style: {
212
+ '::before': (0, _extends2.default)({}, highlightStyles(theme), {
213
+ borderTopRightRadius: 'inherit',
214
+ borderBottomRightRadius: 'inherit',
215
+ right: 0
216
+ }),
217
+ '::after': {
218
+ borderLeftColor: 'transparent'
219
+ }
220
+ }
221
+ }, {
222
+ props: {
223
+ isDayInsideSelection: true
224
+ },
225
+ color: 'initial',
226
+ background: 'initial',
227
+ style: {
228
+ '::before': (0, _extends2.default)({}, highlightStyles(theme))
229
+ }
230
+ }, {
231
+ props: {
232
+ isDaySelected: true,
233
+ isDayInsideSelection: false
234
+ },
235
+ style: (0, _extends2.default)({}, selectedDayStyles(theme))
236
+ }, {
237
+ props: {
238
+ isDaySelectionStart: true,
239
+ isDaySelectionEnd: true
240
+ },
241
+ style: {
242
+ '::before': {
243
+ left: 0,
244
+ right: 0
245
+ }
246
+ }
247
+ }, {
248
+ props: {
249
+ isDaySelectionStart: true,
250
+ isDaySelectionEnd: true,
251
+ isDayPreviewEnd: false,
252
+ isDayPreviewStart: false
253
+ },
254
+ style: {
255
+ '::after': {
256
+ left: 0,
257
+ right: 0
258
+ }
259
+ }
260
+ }, {
261
+ props: {
262
+ isDayPreviewEnd: true,
263
+ isDayPreviewStart: true
264
+ },
265
+ style: {
266
+ '::after': {
267
+ left: 0,
268
+ right: 0
269
+ }
270
+ }
271
+ }, {
272
+ props: {
273
+ isDayEndOfWeek: true
274
+ },
275
+ style: {
276
+ '::after': {
277
+ borderTopRightRadius: 'inherit',
278
+ borderBottomRightRadius: 'inherit',
279
+ borderRightColor: (theme.vars || theme).palette.divider,
280
+ right: 0
281
+ },
282
+ '::before': {
283
+ borderTopRightRadius: 'inherit',
284
+ borderBottomRightRadius: 'inherit',
285
+ right: 0
286
+ }
287
+ }
288
+ }, {
289
+ props: {
290
+ isDayStartOfWeek: true
291
+ },
292
+ style: {
293
+ '::after': {
294
+ borderTopLeftRadius: 'inherit',
295
+ borderBottomLeftRadius: 'inherit',
296
+ borderLeftColor: (theme.vars || theme).palette.divider,
297
+ left: 0
298
+ },
299
+ '::before': {
300
+ borderTopLeftRadius: 'inherit',
301
+ borderBottomLeftRadius: 'inherit',
302
+ left: 0
303
+ }
304
+ }
305
+ }]
306
+ }));
307
+ const noop = () => {};
308
+ const DateRangePickerDay2Raw = /*#__PURE__*/React.forwardRef(function DateRangePickerDay2(inProps, forwardedRef) {
309
+ const props = (0, _styles.useThemeProps)({
310
+ props: inProps,
311
+ name: 'MuiDateRangePickerDay2'
312
+ });
313
+ const utils = (0, _internals.useUtils)();
314
+ const {
315
+ autoFocus = false,
316
+ className,
317
+ classes: classesProp,
318
+ isAnimating,
319
+ onClick,
320
+ onDaySelect,
321
+ onFocus = noop,
322
+ onBlur = noop,
323
+ onKeyDown = noop,
324
+ onMouseDown = noop,
325
+ onMouseEnter = noop,
326
+ children,
327
+ isFirstVisibleCell,
328
+ isLastVisibleCell,
329
+ day,
330
+ selected,
331
+ disabled,
332
+ today,
333
+ outsideCurrentMonth,
334
+ disableHighlightToday,
335
+ showDaysOutsideCurrentMonth,
336
+ isEndOfHighlighting,
337
+ isEndOfPreviewing,
338
+ isHighlighting,
339
+ isPreviewing,
340
+ isStartOfHighlighting,
341
+ isStartOfPreviewing,
342
+ draggable
343
+ } = props,
344
+ other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
345
+ const pickersDayOwnerState = (0, _internals.usePickerDayOwnerState)({
346
+ day,
347
+ selected,
348
+ disabled,
349
+ today,
350
+ outsideCurrentMonth,
351
+ disableMargin: false,
352
+ disableHighlightToday,
353
+ showDaysOutsideCurrentMonth
354
+ });
355
+ const ownerState = (0, _extends2.default)({}, pickersDayOwnerState, {
356
+ // Properties that the Base UI implementation will have
357
+ isDaySelectionStart: isStartOfHighlighting,
358
+ isDaySelectionEnd: isEndOfHighlighting,
359
+ isDayInsideSelection: isHighlighting && !isStartOfHighlighting && !isEndOfHighlighting,
360
+ isDaySelected: isHighlighting || Boolean(selected),
361
+ isDayPreviewed: isPreviewing,
362
+ isDayPreviewStart: isStartOfPreviewing,
363
+ isDayPreviewEnd: isEndOfPreviewing,
364
+ isDayInsidePreview: isPreviewing && !isStartOfPreviewing && !isEndOfPreviewing,
365
+ // Properties specific to the MUI implementation (some might be removed in the next major)
366
+ isDayStartOfMonth: utils.isSameDay(day, utils.startOfMonth(day)),
367
+ isDayEndOfMonth: utils.isSameDay(day, utils.endOfMonth(day)),
368
+ isDayFirstVisibleCell: isFirstVisibleCell,
369
+ isDayLastVisibleCell: isLastVisibleCell,
370
+ isDayFillerCell: outsideCurrentMonth && !showDaysOutsideCurrentMonth,
371
+ isDayDraggable: Boolean(draggable)
372
+ });
373
+ const classes = useUtilityClasses(ownerState, classesProp);
374
+ const ref = React.useRef(null);
375
+ const handleRef = (0, _useForkRef.default)(ref, forwardedRef);
376
+
377
+ // Since this is rendered when a Popper is opened we can't use passive effects.
378
+ // Focusing in passive effects in Popper causes scroll jump.
379
+ (0, _useEnhancedEffect.default)(() => {
380
+ if (autoFocus && !disabled && !isAnimating && !outsideCurrentMonth) {
381
+ // ref.current being null would be a bug in MUI
382
+ ref.current.focus();
383
+ }
384
+ }, [autoFocus, disabled, isAnimating, outsideCurrentMonth]);
385
+
386
+ // For a day outside the current month, move the focus from mouseDown to mouseUp
387
+ // Goal: have the onClick ends before sliding to the new month
388
+ const handleMouseDown = event => {
389
+ onMouseDown(event);
390
+ if (outsideCurrentMonth) {
391
+ event.preventDefault();
392
+ }
393
+ };
394
+ const handleClick = event => {
395
+ if (!disabled) {
396
+ onDaySelect(day);
397
+ }
398
+ if (outsideCurrentMonth) {
399
+ event.currentTarget.focus();
400
+ }
401
+ if (onClick) {
402
+ onClick(event);
403
+ }
404
+ };
405
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(DateRangePickerDay2Root, (0, _extends2.default)({
406
+ ref: handleRef,
407
+ centerRipple: true
408
+ // compat with DateRangePickerDay for tests
409
+ ,
410
+
411
+ disabled: ownerState.isDayFillerCell ? undefined : disabled,
412
+ tabIndex: selected ? 0 : -1,
413
+ onKeyDown: event => onKeyDown(event, day),
414
+ onFocus: event => onFocus(event, day),
415
+ onBlur: event => onBlur(event, day),
416
+ onMouseEnter: event => onMouseEnter(event, day),
417
+ onClick: handleClick,
418
+ onMouseDown: handleMouseDown,
419
+ draggable: draggable
420
+ }, other, {
421
+ ownerState: ownerState,
422
+ className: (0, _clsx.default)(classes.root, className),
423
+ children: children ?? (ownerState.isDayFillerCell ? null : utils.format(day, 'dayOfMonth'))
424
+ }));
425
+ });
426
+ if (process.env.NODE_ENV !== "production") DateRangePickerDay2Raw.displayName = "DateRangePickerDay2Raw";
427
+ process.env.NODE_ENV !== "production" ? DateRangePickerDay2Raw.propTypes = {
428
+ // ----------------------------- Warning --------------------------------
429
+ // | These PropTypes are generated from the TypeScript type definitions |
430
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
431
+ // ----------------------------------------------------------------------
432
+ /**
433
+ * A ref for imperative actions.
434
+ * It currently only supports `focusVisible()` action.
435
+ */
436
+ action: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
437
+ current: _propTypes.default.shape({
438
+ focusVisible: _propTypes.default.func.isRequired
439
+ })
440
+ })]),
441
+ /**
442
+ * If `true`, the ripples are centered.
443
+ * They won't start at the cursor interaction position.
444
+ * @default false
445
+ */
446
+ centerRipple: _propTypes.default.bool,
447
+ /**
448
+ * Override or extend the styles applied to the component.
449
+ */
450
+ classes: _propTypes.default.object,
451
+ className: _propTypes.default.string,
452
+ component: _propTypes.default.elementType,
453
+ /**
454
+ * The date to show.
455
+ */
456
+ day: _propTypes.default.object.isRequired,
457
+ /**
458
+ * If `true`, renders as disabled.
459
+ * @default false
460
+ */
461
+ disabled: _propTypes.default.bool,
462
+ /**
463
+ * If `true`, today's date is rendering without highlighting with circle.
464
+ * @default false
465
+ */
466
+ disableHighlightToday: _propTypes.default.bool,
467
+ /**
468
+ * If `true`, days are rendering without margin. Useful for displaying linked range of days.
469
+ * @default false
470
+ */
471
+ disableMargin: _propTypes.default.bool,
472
+ /**
473
+ * If `true`, the ripple effect is disabled.
474
+ *
475
+ * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
476
+ * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
477
+ * @default false
478
+ */
479
+ disableRipple: _propTypes.default.bool,
480
+ /**
481
+ * If `true`, the touch ripple effect is disabled.
482
+ * @default false
483
+ */
484
+ disableTouchRipple: _propTypes.default.bool,
485
+ /**
486
+ * If `true`, the day can be dragged to change the current date range.
487
+ * @default false
488
+ */
489
+ draggable: _propTypes.default.bool,
490
+ /**
491
+ * If `true`, the base button will have a keyboard focus ripple.
492
+ * @default false
493
+ */
494
+ focusRipple: _propTypes.default.bool,
495
+ /**
496
+ * This prop can help identify which element has keyboard focus.
497
+ * The class name will be applied when the element gains the focus through keyboard interaction.
498
+ * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
499
+ * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
500
+ * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
501
+ * if needed.
502
+ */
503
+ focusVisibleClassName: _propTypes.default.string,
504
+ isAnimating: _propTypes.default.bool,
505
+ /**
506
+ * Set to `true` if the `day` is the end of a highlighted date range.
507
+ */
508
+ isEndOfHighlighting: _propTypes.default.bool.isRequired,
509
+ /**
510
+ * Set to `true` if the `day` is the end of a previewing date range.
511
+ */
512
+ isEndOfPreviewing: _propTypes.default.bool.isRequired,
513
+ /**
514
+ * If `true`, day is the first visible cell of the month.
515
+ * Either the first day of the month or the first day of the week depending on `showDaysOutsideCurrentMonth`.
516
+ */
517
+ isFirstVisibleCell: _propTypes.default.bool.isRequired,
518
+ /**
519
+ * Set to `true` if the `day` is in a highlighted date range.
520
+ */
521
+ isHighlighting: _propTypes.default.bool.isRequired,
522
+ /**
523
+ * If `true`, day is the last visible cell of the month.
524
+ * Either the last day of the month or the last day of the week depending on `showDaysOutsideCurrentMonth`.
525
+ */
526
+ isLastVisibleCell: _propTypes.default.bool.isRequired,
527
+ /**
528
+ * Set to `true` if the `day` is in a preview date range.
529
+ */
530
+ isPreviewing: _propTypes.default.bool.isRequired,
531
+ /**
532
+ * Set to `true` if the `day` is the start of a highlighted date range.
533
+ */
534
+ isStartOfHighlighting: _propTypes.default.bool.isRequired,
535
+ /**
536
+ * Set to `true` if the `day` is the start of a previewing date range.
537
+ */
538
+ isStartOfPreviewing: _propTypes.default.bool.isRequired,
539
+ /**
540
+ * Indicates if the day should be visually selected.
541
+ */
542
+ isVisuallySelected: _propTypes.default.bool,
543
+ onBlur: _propTypes.default.func,
544
+ onDaySelect: _propTypes.default.func.isRequired,
545
+ onFocus: _propTypes.default.func,
546
+ /**
547
+ * Callback fired when the component is focused with a keyboard.
548
+ * We trigger a `onFocus` callback too.
549
+ */
550
+ onFocusVisible: _propTypes.default.func,
551
+ onKeyDown: _propTypes.default.func,
552
+ onMouseEnter: _propTypes.default.func,
553
+ /**
554
+ * If `true`, day is outside of month and will be hidden.
555
+ */
556
+ outsideCurrentMonth: _propTypes.default.bool.isRequired,
557
+ /**
558
+ * If `true`, renders as selected.
559
+ * @default false
560
+ */
561
+ selected: _propTypes.default.bool,
562
+ /**
563
+ * If `true`, days outside the current month are rendered:
564
+ *
565
+ * - if `fixedWeekNumber` is defined, renders days to have the weeks requested.
566
+ *
567
+ * - if `fixedWeekNumber` is not defined, renders day to fill the first and last week of the current month.
568
+ *
569
+ * - ignored if `calendars` equals more than `1` on range pickers.
570
+ * @default false
571
+ */
572
+ showDaysOutsideCurrentMonth: _propTypes.default.bool,
573
+ style: _propTypes.default.object,
574
+ /**
575
+ * The system prop that allows defining system overrides as well as additional CSS styles.
576
+ */
577
+ sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
578
+ /**
579
+ * @default 0
580
+ */
581
+ tabIndex: _propTypes.default.number,
582
+ /**
583
+ * If `true`, renders as today date.
584
+ * @default false
585
+ */
586
+ today: _propTypes.default.bool,
587
+ /**
588
+ * Props applied to the `TouchRipple` element.
589
+ */
590
+ TouchRippleProps: _propTypes.default.object,
591
+ /**
592
+ * A ref that points to the `TouchRipple` element.
593
+ */
594
+ touchRippleRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
595
+ current: _propTypes.default.shape({
596
+ pulsate: _propTypes.default.func.isRequired,
597
+ start: _propTypes.default.func.isRequired,
598
+ stop: _propTypes.default.func.isRequired
599
+ })
600
+ })])
601
+ } : void 0;
602
+ const DateRangePickerDay2 = exports.DateRangePickerDay2 = /*#__PURE__*/React.memo(DateRangePickerDay2Raw);
603
+ if (process.env.NODE_ENV !== "production") DateRangePickerDay2.displayName = "DateRangePickerDay2";
@@ -0,0 +1,92 @@
1
+ import { PickerDay2OwnerState, PickerDay2Props } from '@mui/x-date-pickers/PickerDay2';
2
+ import { DateRangePickerDay2Classes } from "./dateRangePickerDay2Classes.js";
3
+ export interface DateRangePickerDay2Props extends Omit<PickerDay2Props, 'classes'> {
4
+ /**
5
+ * Set to `true` if the `day` is in a highlighted date range.
6
+ */
7
+ isHighlighting: boolean;
8
+ /**
9
+ * Set to `true` if the `day` is the end of a highlighted date range.
10
+ */
11
+ isEndOfHighlighting: boolean;
12
+ /**
13
+ * Set to `true` if the `day` is the start of a highlighted date range.
14
+ */
15
+ isStartOfHighlighting: boolean;
16
+ /**
17
+ * Set to `true` if the `day` is in a preview date range.
18
+ */
19
+ isPreviewing: boolean;
20
+ /**
21
+ * Set to `true` if the `day` is the end of a previewing date range.
22
+ */
23
+ isEndOfPreviewing: boolean;
24
+ /**
25
+ * Set to `true` if the `day` is the start of a previewing date range.
26
+ */
27
+ isStartOfPreviewing: boolean;
28
+ /**
29
+ * Override or extend the styles applied to the component.
30
+ */
31
+ classes?: Partial<DateRangePickerDay2Classes>;
32
+ /**
33
+ * Indicates if the day should be visually selected.
34
+ */
35
+ isVisuallySelected?: boolean;
36
+ /**
37
+ * If `true`, the day can be dragged to change the current date range.
38
+ * @default false
39
+ */
40
+ draggable?: boolean;
41
+ }
42
+ export interface DateRangePickerDay2OwnerState extends PickerDay2OwnerState {
43
+ /**
44
+ * Whether the day is the first day of the selected range.
45
+ */
46
+ isDaySelectionStart: boolean;
47
+ /**
48
+ * Whether the day is the last day of the selected range.
49
+ */
50
+ isDaySelectionEnd: boolean;
51
+ /**
52
+ * Whether the day is within the selected range and is not its first or last day.
53
+ */
54
+ isDayInsideSelection: boolean;
55
+ /**
56
+ * Whether the day is within the preview range.
57
+ */
58
+ isDayPreviewed: boolean;
59
+ /**
60
+ * Whether the day is the first day of the preview range.
61
+ */
62
+ isDayPreviewStart: boolean;
63
+ /**
64
+ * Whether the day is the last day of the preview range.
65
+ */
66
+ isDayPreviewEnd: boolean;
67
+ /**
68
+ * Whether the day is within the preview range and is not its first or last day.
69
+ */
70
+ isDayInsidePreview: boolean;
71
+ /**
72
+ * If `true`, the day can be dragged to change the current date range.
73
+ * @default false
74
+ */
75
+ isDayDraggable?: boolean;
76
+ /**
77
+ * Whether the day is the first day of the month.
78
+ */
79
+ isDayStartOfMonth: boolean;
80
+ /**
81
+ * Whether the day is the last day of the month.
82
+ */
83
+ isDayEndOfMonth: boolean;
84
+ /**
85
+ * Whether the day is the first visible cell of the month it's being rendered in.
86
+ */
87
+ isDayFirstVisibleCell: boolean;
88
+ /**
89
+ * Whether the day is the last visible cell of the month it's being rendered in.
90
+ */
91
+ isDayLastVisibleCell: boolean;
92
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });