@mui/lab 5.0.0-alpha.68 → 5.0.0-alpha.71
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/AdapterDateFns/index.d.ts +1 -1
- package/AdapterDayjs/index.d.ts +1 -1
- package/AdapterLuxon/index.d.ts +1 -1
- package/AdapterMoment/index.d.ts +1 -1
- package/CHANGELOG.md +177 -0
- package/CalendarPicker/CalendarPicker.d.ts +106 -106
- package/CalendarPicker/PickersCalendar.d.ts +47 -47
- package/CalendarPicker/PickersCalendarHeader.d.ts +43 -43
- package/CalendarPicker/PickersFadeTransitionGroup.d.ts +12 -12
- package/CalendarPicker/PickersSlideTransition.d.ts +16 -16
- package/CalendarPicker/index.d.ts +5 -5
- package/CalendarPicker/shared.d.ts +1 -1
- package/CalendarPicker/useCalendarState.d.ts +32 -32
- package/CalendarPickerSkeleton/CalendarPickerSkeleton.d.ts +41 -41
- package/CalendarPickerSkeleton/index.d.ts +3 -3
- package/ClockPicker/Clock.d.ts +28 -28
- package/ClockPicker/ClockNumber.d.ts +19 -19
- package/ClockPicker/ClockNumbers.d.ts +24 -24
- package/ClockPicker/ClockPicker.d.ts +121 -121
- package/ClockPicker/ClockPickerStandalone.d.ts +28 -28
- package/ClockPicker/ClockPointer.d.ts +23 -23
- package/ClockPicker/index.d.ts +5 -5
- package/ClockPicker/shared.d.ts +5 -5
- package/DatePicker/DatePicker.d.ts +27 -27
- package/DatePicker/DatePicker.js +3 -1
- package/DatePicker/DatePickerToolbar.d.ts +23 -23
- package/DatePicker/index.d.ts +2 -2
- package/DatePicker/shared.d.ts +45 -45
- package/DateRangePicker/DateRangePicker.d.ts +65 -65
- package/DateRangePicker/DateRangePickerInput.d.ts +35 -35
- package/DateRangePicker/DateRangePickerToolbar.d.ts +15 -15
- package/DateRangePicker/DateRangePickerView.d.ts +44 -44
- package/DateRangePicker/DateRangePickerViewDesktop.d.ts +29 -29
- package/DateRangePicker/DateRangePickerViewMobile.d.ts +17 -17
- package/DateRangePicker/RangeTypes.d.ts +8 -8
- package/DateRangePicker/date-range-manager.d.ts +14 -14
- package/DateRangePicker/index.d.ts +3 -3
- package/DateRangePickerDay/DateRangePickerDay.d.ts +79 -79
- package/DateRangePickerDay/index.d.ts +2 -2
- package/DateTimePicker/DateTimePicker.d.ts +27 -27
- package/DateTimePicker/DateTimePickerTabs.d.ts +13 -13
- package/DateTimePicker/DateTimePickerToolbar.d.ts +7 -7
- package/DateTimePicker/index.d.ts +2 -2
- package/DateTimePicker/shared.d.ts +67 -67
- package/DesktopDatePicker/DesktopDatePicker.d.ts +20 -20
- package/DesktopDatePicker/DesktopDatePicker.js +18 -2
- package/DesktopDatePicker/index.d.ts +2 -2
- package/DesktopDateRangePicker/DesktopDateRangePicker.d.ts +64 -64
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +12 -0
- package/DesktopDateRangePicker/index.d.ts +2 -2
- package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +20 -20
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +12 -0
- package/DesktopDateTimePicker/index.d.ts +2 -2
- package/DesktopTimePicker/DesktopTimePicker.d.ts +20 -20
- package/DesktopTimePicker/DesktopTimePicker.js +12 -0
- package/DesktopTimePicker/index.d.ts +2 -2
- package/LoadingButton/loadingButtonClasses.d.ts +22 -22
- package/LocalizationProvider/LocalizationProvider.d.ts +35 -35
- package/LocalizationProvider/index.d.ts +2 -2
- package/Masonry/masonryClasses.d.ts +8 -8
- package/MobileDatePicker/MobileDatePicker.d.ts +20 -20
- package/MobileDatePicker/index.d.ts +2 -2
- package/MobileDateRangePicker/MobileDateRangePicker.d.ts +64 -64
- package/MobileDateRangePicker/index.d.ts +2 -2
- package/MobileDateTimePicker/MobileDateTimePicker.d.ts +20 -20
- package/MobileDateTimePicker/index.d.ts +2 -2
- package/MobileTimePicker/MobileTimePicker.d.ts +20 -20
- package/MobileTimePicker/index.d.ts +2 -2
- package/MonthPicker/MonthPicker.d.ts +53 -53
- package/MonthPicker/PickersMonth.d.ts +15 -15
- package/MonthPicker/index.d.ts +3 -3
- package/PickersDay/PickersDay.d.ts +93 -93
- package/PickersDay/index.d.ts +4 -4
- package/StaticDatePicker/StaticDatePicker.d.ts +25 -25
- package/StaticDatePicker/index.d.ts +2 -2
- package/StaticDateRangePicker/StaticDateRangePicker.d.ts +67 -67
- package/StaticDateRangePicker/index.d.ts +2 -2
- package/StaticDateTimePicker/StaticDateTimePicker.d.ts +25 -25
- package/StaticDateTimePicker/index.d.ts +2 -2
- package/StaticTimePicker/StaticTimePicker.d.ts +25 -25
- package/StaticTimePicker/index.d.ts +2 -2
- package/TabPanel/tabPanelClasses.d.ts +8 -8
- package/TimePicker/TimePicker.d.ts +27 -27
- package/TimePicker/TimePickerToolbar.d.ts +23 -23
- package/TimePicker/index.d.ts +2 -2
- package/TimePicker/shared.d.ts +36 -36
- package/Timeline/Timeline.d.ts +59 -59
- package/Timeline/TimelineContext.d.ts +6 -6
- package/Timeline/index.d.ts +5 -5
- package/Timeline/timelineClasses.d.ts +3 -3
- package/TimelineConnector/timelineConnectorClasses.d.ts +8 -8
- package/TimelineContent/timelineContentClasses.d.ts +14 -14
- package/TimelineDot/timelineDotClasses.d.ts +24 -24
- package/TimelineItem/timelineItemClasses.d.ts +16 -16
- package/TimelineOppositeContent/timelineOppositeContentClasses.d.ts +14 -14
- package/TimelineSeparator/timelineSeparatorClasses.d.ts +8 -8
- package/TreeItem/treeItemClasses.d.ts +24 -24
- package/TreeView/treeViewClasses.d.ts +8 -8
- package/YearPicker/PickersYear.d.ts +28 -28
- package/YearPicker/YearPicker.d.ts +44 -44
- package/YearPicker/index.d.ts +5 -5
- package/YearPicker/yearPickerClasses.d.ts +3 -3
- package/index.js +1 -1
- package/internal/pickers/KeyboardDateInput.d.ts +4 -4
- package/internal/pickers/Picker/Picker.d.ts +33 -33
- package/internal/pickers/Picker/PickerView.d.ts +3 -3
- package/internal/pickers/PickersArrowSwitcher.d.ts +41 -41
- package/internal/pickers/PickersModalDialog.d.ts +47 -47
- package/internal/pickers/PickersPopper.d.ts +44 -33
- package/internal/pickers/PickersPopper.js +26 -2
- package/internal/pickers/PickersToolbar.d.ts +14 -14
- package/internal/pickers/PickersToolbarButton.d.ts +13 -13
- package/internal/pickers/PickersToolbarText.d.ts +8 -8
- package/internal/pickers/PureDateInput.d.ts +80 -80
- package/internal/pickers/constants/dimensions.d.ts +4 -4
- package/internal/pickers/constants/prop-types.d.ts +1 -1
- package/internal/pickers/date-time-utils.d.ts +8 -8
- package/internal/pickers/date-utils.d.ts +52 -52
- package/internal/pickers/hooks/date-helpers-hooks.d.ts +16 -16
- package/internal/pickers/hooks/useIsLandscape.d.ts +4 -4
- package/internal/pickers/hooks/useMaskedInput.d.ts +7 -7
- package/internal/pickers/hooks/useOpenState.d.ts +10 -10
- package/internal/pickers/hooks/usePickerState.d.ts +38 -38
- package/internal/pickers/hooks/useUtils.d.ts +7 -7
- package/internal/pickers/hooks/useValidation.d.ts +23 -23
- package/internal/pickers/hooks/useViews.d.ts +19 -19
- package/internal/pickers/text-field-helper.d.ts +11 -11
- package/internal/pickers/time-utils.d.ts +33 -33
- package/internal/pickers/typings/BasePicker.d.ts +95 -95
- package/internal/pickers/typings/Views.d.ts +1 -1
- package/internal/pickers/typings/helpers.d.ts +9 -9
- package/internal/pickers/utils.d.ts +7 -7
- package/internal/pickers/wrappers/DesktopTooltipWrapper.d.ts +4 -4
- package/internal/pickers/wrappers/DesktopWrapper.d.ts +16 -16
- package/internal/pickers/wrappers/DesktopWrapper.js +7 -1
- package/internal/pickers/wrappers/MobileWrapper.d.ts +14 -14
- package/internal/pickers/wrappers/PickerStaticWrapper.d.ts +21 -21
- package/internal/pickers/wrappers/ResponsiveWrapper.d.ts +23 -23
- package/internal/pickers/wrappers/WrapperProps.d.ts +13 -13
- package/internal/pickers/wrappers/WrapperVariantContext.d.ts +11 -11
- package/internal/svg-icons/ArrowDropDown.d.ts +7 -7
- package/internal/svg-icons/ArrowLeft.d.ts +7 -7
- package/internal/svg-icons/ArrowRight.d.ts +7 -7
- package/internal/svg-icons/Calendar.d.ts +7 -7
- package/internal/svg-icons/Clock.d.ts +7 -7
- package/internal/svg-icons/DateRange.d.ts +7 -7
- package/internal/svg-icons/Pen.d.ts +7 -7
- package/internal/svg-icons/Time.d.ts +7 -7
- package/legacy/DatePicker/DatePicker.js +3 -1
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +17 -1
- package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +12 -0
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +12 -0
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +12 -0
- package/legacy/index.js +1 -1
- package/legacy/internal/pickers/PickersPopper.js +32 -5
- package/legacy/internal/pickers/wrappers/DesktopWrapper.js +7 -1
- package/modern/DatePicker/DatePicker.js +3 -1
- package/modern/DesktopDatePicker/DesktopDatePicker.js +18 -2
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +12 -0
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +12 -0
- package/modern/DesktopTimePicker/DesktopTimePicker.js +12 -0
- package/modern/index.js +1 -1
- package/modern/internal/pickers/PickersPopper.js +26 -2
- package/modern/internal/pickers/wrappers/DesktopWrapper.js +7 -1
- package/node/DatePicker/DatePicker.js +3 -1
- package/node/DesktopDatePicker/DesktopDatePicker.js +18 -2
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +12 -0
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +12 -0
- package/node/DesktopTimePicker/DesktopTimePicker.js +12 -0
- package/node/index.js +1 -1
- package/node/internal/pickers/PickersPopper.js +27 -2
- package/node/internal/pickers/wrappers/DesktopWrapper.js +7 -1
- package/package.json +9 -9
- package/themeAugmentation/components.d.ts +0 -66
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { DialogProps as MuiDialogProps } from '@mui/material/Dialog';
|
|
3
|
-
export interface ExportedPickerModalProps {
|
|
4
|
-
/**
|
|
5
|
-
* Ok button text.
|
|
6
|
-
* @default 'OK'
|
|
7
|
-
*/
|
|
8
|
-
okText?: React.ReactNode;
|
|
9
|
-
/**
|
|
10
|
-
* Cancel text message.
|
|
11
|
-
* @default 'Cancel'
|
|
12
|
-
*/
|
|
13
|
-
cancelText?: React.ReactNode;
|
|
14
|
-
/**
|
|
15
|
-
* Clear text message.
|
|
16
|
-
* @default 'Clear'
|
|
17
|
-
*/
|
|
18
|
-
clearText?: React.ReactNode;
|
|
19
|
-
/**
|
|
20
|
-
* Today text message.
|
|
21
|
-
* @default 'Today'
|
|
22
|
-
*/
|
|
23
|
-
todayText?: React.ReactNode;
|
|
24
|
-
/**
|
|
25
|
-
* If `true`, it shows the clear action in the picker dialog.
|
|
26
|
-
* @default false
|
|
27
|
-
*/
|
|
28
|
-
clearable?: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* If `true`, the today button is displayed. **Note** that `showClearButton` has a higher priority.
|
|
31
|
-
* @default false
|
|
32
|
-
*/
|
|
33
|
-
showTodayButton?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Props applied to the [`Dialog`](/api/dialog/) element.
|
|
36
|
-
*/
|
|
37
|
-
DialogProps?: Partial<MuiDialogProps>;
|
|
38
|
-
}
|
|
39
|
-
export interface PickersModalDialogProps extends ExportedPickerModalProps {
|
|
40
|
-
onAccept: () => void;
|
|
41
|
-
onClear: () => void;
|
|
42
|
-
onDismiss: () => void;
|
|
43
|
-
onSetToday: () => void;
|
|
44
|
-
open: boolean;
|
|
45
|
-
}
|
|
46
|
-
declare const PickersModalDialog: (props: React.PropsWithChildren<PickersModalDialogProps>) => JSX.Element;
|
|
47
|
-
export default PickersModalDialog;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DialogProps as MuiDialogProps } from '@mui/material/Dialog';
|
|
3
|
+
export interface ExportedPickerModalProps {
|
|
4
|
+
/**
|
|
5
|
+
* Ok button text.
|
|
6
|
+
* @default 'OK'
|
|
7
|
+
*/
|
|
8
|
+
okText?: React.ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Cancel text message.
|
|
11
|
+
* @default 'Cancel'
|
|
12
|
+
*/
|
|
13
|
+
cancelText?: React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Clear text message.
|
|
16
|
+
* @default 'Clear'
|
|
17
|
+
*/
|
|
18
|
+
clearText?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Today text message.
|
|
21
|
+
* @default 'Today'
|
|
22
|
+
*/
|
|
23
|
+
todayText?: React.ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* If `true`, it shows the clear action in the picker dialog.
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
clearable?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* If `true`, the today button is displayed. **Note** that `showClearButton` has a higher priority.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
showTodayButton?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Props applied to the [`Dialog`](/api/dialog/) element.
|
|
36
|
+
*/
|
|
37
|
+
DialogProps?: Partial<MuiDialogProps>;
|
|
38
|
+
}
|
|
39
|
+
export interface PickersModalDialogProps extends ExportedPickerModalProps {
|
|
40
|
+
onAccept: () => void;
|
|
41
|
+
onClear: () => void;
|
|
42
|
+
onDismiss: () => void;
|
|
43
|
+
onSetToday: () => void;
|
|
44
|
+
open: boolean;
|
|
45
|
+
}
|
|
46
|
+
declare const PickersModalDialog: (props: React.PropsWithChildren<PickersModalDialogProps>) => JSX.Element;
|
|
47
|
+
export default PickersModalDialog;
|
|
@@ -1,33 +1,44 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { PaperProps as MuiPaperProps } from '@mui/material/Paper';
|
|
3
|
-
import { PopperProps as MuiPopperProps } from '@mui/material/Popper';
|
|
4
|
-
import { TrapFocusProps as MuiTrapFocusProps } from '@mui/material/Unstable_TrapFocus';
|
|
5
|
-
import { TransitionProps as MuiTransitionProps } from '@mui/material/transitions';
|
|
6
|
-
export interface ExportedPickerPaperProps {
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
export interface
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PaperProps as MuiPaperProps } from '@mui/material/Paper';
|
|
3
|
+
import { PopperProps as MuiPopperProps } from '@mui/material/Popper';
|
|
4
|
+
import { TrapFocusProps as MuiTrapFocusProps } from '@mui/material/Unstable_TrapFocus';
|
|
5
|
+
import { TransitionProps as MuiTransitionProps } from '@mui/material/transitions';
|
|
6
|
+
export interface ExportedPickerPaperProps {
|
|
7
|
+
/**
|
|
8
|
+
* If `true`, it shows the clear action in the picker dialog.
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
clearable?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Clear text message.
|
|
14
|
+
* @default 'Clear'
|
|
15
|
+
*/
|
|
16
|
+
clearText?: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Paper props passed down to [Paper](https://mui.com/api/paper/) component.
|
|
19
|
+
*/
|
|
20
|
+
PaperProps?: Partial<MuiPaperProps>;
|
|
21
|
+
}
|
|
22
|
+
export interface ExportedPickerPopperProps {
|
|
23
|
+
/**
|
|
24
|
+
* Popper props passed down to [Popper](https://mui.com/api/popper/) component.
|
|
25
|
+
*/
|
|
26
|
+
PopperProps?: Partial<MuiPopperProps>;
|
|
27
|
+
/**
|
|
28
|
+
* Custom component for popper [Transition](https://mui.com/components/transitions/#transitioncomponent-prop).
|
|
29
|
+
*/
|
|
30
|
+
TransitionComponent?: React.JSXElementConstructor<MuiTransitionProps>;
|
|
31
|
+
}
|
|
32
|
+
export interface PickerPopperProps extends ExportedPickerPopperProps, ExportedPickerPaperProps {
|
|
33
|
+
role: 'tooltip' | 'dialog';
|
|
34
|
+
TrapFocusProps?: Partial<MuiTrapFocusProps>;
|
|
35
|
+
anchorEl: MuiPopperProps['anchorEl'];
|
|
36
|
+
open: MuiPopperProps['open'];
|
|
37
|
+
containerRef?: React.Ref<HTMLDivElement>;
|
|
38
|
+
children?: React.ReactNode;
|
|
39
|
+
onClose: () => void;
|
|
40
|
+
onBlur?: () => void;
|
|
41
|
+
onClear?: () => void;
|
|
42
|
+
}
|
|
43
|
+
declare const PickersPopper: (props: PickerPopperProps) => JSX.Element;
|
|
44
|
+
export default PickersPopper;
|
|
@@ -8,7 +8,10 @@ import Popper from '@mui/material/Popper';
|
|
|
8
8
|
import TrapFocus from '@mui/material/Unstable_TrapFocus';
|
|
9
9
|
import { useForkRef, useEventCallback, ownerDocument } from '@mui/material/utils';
|
|
10
10
|
import { styled } from '@mui/material/styles';
|
|
11
|
+
import Button from '@mui/material/Button';
|
|
12
|
+
import DialogActions from '@mui/material/DialogActions';
|
|
11
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
15
|
const PickersPopperRoot = styled(Popper)(({
|
|
13
16
|
theme
|
|
14
17
|
}) => ({
|
|
@@ -22,6 +25,16 @@ const PickersPopperPaper = styled(Paper)(({
|
|
|
22
25
|
}, ownerState.placement === 'top' && {
|
|
23
26
|
transformOrigin: 'bottom center'
|
|
24
27
|
}));
|
|
28
|
+
const PickersPopperAction = styled(DialogActions)(({
|
|
29
|
+
ownerState
|
|
30
|
+
}) => _extends({}, ownerState.clearable ? {
|
|
31
|
+
justifyContent: 'flex-start',
|
|
32
|
+
'& > *:first-of-type': {
|
|
33
|
+
marginRight: 'auto'
|
|
34
|
+
}
|
|
35
|
+
} : {
|
|
36
|
+
padding: 0
|
|
37
|
+
}));
|
|
25
38
|
|
|
26
39
|
function clickedRootScrollbar(event, doc) {
|
|
27
40
|
return doc.documentElement.clientWidth < event.clientX || doc.documentElement.clientHeight < event.clientY;
|
|
@@ -145,11 +158,16 @@ function useClickAwayListener(active, onClickAway) {
|
|
|
145
158
|
}
|
|
146
159
|
|
|
147
160
|
const PickersPopper = props => {
|
|
161
|
+
var _Button;
|
|
162
|
+
|
|
148
163
|
const {
|
|
149
164
|
anchorEl,
|
|
150
165
|
children,
|
|
151
166
|
containerRef = null,
|
|
152
167
|
onClose,
|
|
168
|
+
onClear,
|
|
169
|
+
clearable = false,
|
|
170
|
+
clearText = 'Clear',
|
|
153
171
|
open,
|
|
154
172
|
PopperProps,
|
|
155
173
|
role,
|
|
@@ -211,7 +229,7 @@ const PickersPopper = props => {
|
|
|
211
229
|
isEnabled: () => true
|
|
212
230
|
}, TrapFocusProps, {
|
|
213
231
|
children: /*#__PURE__*/_jsx(TransitionComponent, _extends({}, TransitionProps, {
|
|
214
|
-
children: /*#__PURE__*/
|
|
232
|
+
children: /*#__PURE__*/_jsxs(PickersPopperPaper, _extends({
|
|
215
233
|
tabIndex: -1,
|
|
216
234
|
elevation: 8,
|
|
217
235
|
ref: handlePaperRef,
|
|
@@ -233,7 +251,13 @@ const PickersPopper = props => {
|
|
|
233
251
|
placement
|
|
234
252
|
})
|
|
235
253
|
}, otherPaperProps, {
|
|
236
|
-
children: children
|
|
254
|
+
children: [children, /*#__PURE__*/_jsx(PickersPopperAction, {
|
|
255
|
+
ownerState: ownerState,
|
|
256
|
+
children: clearable && (_Button || (_Button = /*#__PURE__*/_jsx(Button, {
|
|
257
|
+
onClick: onClear,
|
|
258
|
+
children: clearText
|
|
259
|
+
})))
|
|
260
|
+
})]
|
|
237
261
|
}))
|
|
238
262
|
}))
|
|
239
263
|
}))
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ToolbarComponentProps } from './typings/BasePicker';
|
|
3
|
-
export interface PickersToolbarProps extends Pick<ToolbarComponentProps, 'getMobileKeyboardInputViewButtonText' | 'isMobileKeyboardViewOpen' | 'toggleMobileKeyboardView'> {
|
|
4
|
-
className?: string;
|
|
5
|
-
viewType?: 'calendar' | 'clock';
|
|
6
|
-
isLandscape: boolean;
|
|
7
|
-
landscapeDirection?: 'row' | 'column';
|
|
8
|
-
penIconClassName?: string;
|
|
9
|
-
toolbarTitle: React.ReactNode;
|
|
10
|
-
}
|
|
11
|
-
declare const PickersToolbar: React.ForwardRefExoticComponent<PickersToolbarProps & {
|
|
12
|
-
children?: React.ReactNode;
|
|
13
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
-
export default PickersToolbar;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ToolbarComponentProps } from './typings/BasePicker';
|
|
3
|
+
export interface PickersToolbarProps extends Pick<ToolbarComponentProps, 'getMobileKeyboardInputViewButtonText' | 'isMobileKeyboardViewOpen' | 'toggleMobileKeyboardView'> {
|
|
4
|
+
className?: string;
|
|
5
|
+
viewType?: 'calendar' | 'clock';
|
|
6
|
+
isLandscape: boolean;
|
|
7
|
+
landscapeDirection?: 'row' | 'column';
|
|
8
|
+
penIconClassName?: string;
|
|
9
|
+
toolbarTitle: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare const PickersToolbar: React.ForwardRefExoticComponent<PickersToolbarProps & {
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export default PickersToolbar;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ButtonProps } from '@mui/material/Button';
|
|
3
|
-
import { TypographyProps } from '@mui/material/Typography';
|
|
4
|
-
import { ExtendMui } from './typings/helpers';
|
|
5
|
-
export interface PickersToolbarButtonProps extends ExtendMui<ButtonProps, 'value' | 'variant'> {
|
|
6
|
-
align?: TypographyProps['align'];
|
|
7
|
-
selected: boolean;
|
|
8
|
-
typographyClassName?: string;
|
|
9
|
-
value: React.ReactNode;
|
|
10
|
-
variant: TypographyProps['variant'];
|
|
11
|
-
}
|
|
12
|
-
declare const PickersToolbarButton: React.FunctionComponent<PickersToolbarButtonProps>;
|
|
13
|
-
export default PickersToolbarButton;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ButtonProps } from '@mui/material/Button';
|
|
3
|
+
import { TypographyProps } from '@mui/material/Typography';
|
|
4
|
+
import { ExtendMui } from './typings/helpers';
|
|
5
|
+
export interface PickersToolbarButtonProps extends ExtendMui<ButtonProps, 'value' | 'variant'> {
|
|
6
|
+
align?: TypographyProps['align'];
|
|
7
|
+
selected: boolean;
|
|
8
|
+
typographyClassName?: string;
|
|
9
|
+
value: React.ReactNode;
|
|
10
|
+
variant: TypographyProps['variant'];
|
|
11
|
+
}
|
|
12
|
+
declare const PickersToolbarButton: React.FunctionComponent<PickersToolbarButtonProps>;
|
|
13
|
+
export default PickersToolbarButton;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { TypographyProps } from '@mui/material/Typography';
|
|
3
|
-
export interface PickersToolbarTextProps extends Omit<TypographyProps, 'classes'> {
|
|
4
|
-
selected?: boolean;
|
|
5
|
-
value: React.ReactNode;
|
|
6
|
-
}
|
|
7
|
-
declare const PickersToolbarText: React.ForwardRefExoticComponent<Pick<PickersToolbarTextProps, "p" | "slot" | "style" | "title" | "hidden" | "className" | "selected" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "translate" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "sx" | "variant" | "variantMapping" | "value"> & React.RefAttributes<HTMLSpanElement>>;
|
|
8
|
-
export default PickersToolbarText;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TypographyProps } from '@mui/material/Typography';
|
|
3
|
+
export interface PickersToolbarTextProps extends Omit<TypographyProps, 'classes'> {
|
|
4
|
+
selected?: boolean;
|
|
5
|
+
value: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare const PickersToolbarText: React.ForwardRefExoticComponent<Pick<PickersToolbarTextProps, "p" | "slot" | "style" | "title" | "hidden" | "className" | "selected" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "translate" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "sx" | "variant" | "variantMapping" | "value"> & React.RefAttributes<HTMLSpanElement>>;
|
|
8
|
+
export default PickersToolbarText;
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { TextFieldProps as MuiTextFieldPropsType } from '@mui/material/TextField';
|
|
3
|
-
import { IconButtonProps } from '@mui/material/IconButton';
|
|
4
|
-
import { InputAdornmentProps } from '@mui/material/InputAdornment';
|
|
5
|
-
import { ParseableDate } from './constants/prop-types';
|
|
6
|
-
import { MuiPickersAdapter } from './hooks/useUtils';
|
|
7
|
-
export declare type MuiTextFieldProps = MuiTextFieldPropsType | Omit<MuiTextFieldPropsType, 'variant'>;
|
|
8
|
-
export interface DateInputProps<TInputValue = ParseableDate<unknown>, TDateValue = unknown> {
|
|
9
|
-
/**
|
|
10
|
-
* Regular expression to detect "accepted" symbols.
|
|
11
|
-
* @default /\dap/gi
|
|
12
|
-
*/
|
|
13
|
-
acceptRegex?: RegExp;
|
|
14
|
-
/**
|
|
15
|
-
* The components used for each slot.
|
|
16
|
-
* Either a string to use a HTML element or a component.
|
|
17
|
-
*/
|
|
18
|
-
components?: {
|
|
19
|
-
OpenPickerIcon?: React.ElementType;
|
|
20
|
-
};
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Disable mask on the keyboard, this should be used rarely. Consider passing proper mask for your format.
|
|
24
|
-
* @default false
|
|
25
|
-
*/
|
|
26
|
-
disableMaskedInput?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Do not render open picker button (renders only text field with validation).
|
|
29
|
-
* @default false
|
|
30
|
-
*/
|
|
31
|
-
disableOpenPicker?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Get aria-label text for control that opens picker dialog. Aria-label text must include selected date. @DateIOType
|
|
34
|
-
* @default (value, utils) => `Choose date, selected date is ${utils.format(utils.date(value), 'fullDate')}`
|
|
35
|
-
*/
|
|
36
|
-
getOpenDialogAriaText?: (value: ParseableDate<TDateValue>, utils: MuiPickersAdapter<TDateValue>) => string;
|
|
37
|
-
ignoreInvalidInputs?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Props to pass to keyboard input adornment.
|
|
40
|
-
*/
|
|
41
|
-
InputAdornmentProps?: Partial<InputAdornmentProps>;
|
|
42
|
-
inputFormat: string;
|
|
43
|
-
InputProps?: MuiTextFieldProps['InputProps'];
|
|
44
|
-
/**
|
|
45
|
-
* Pass a ref to the `input` element.
|
|
46
|
-
*/
|
|
47
|
-
inputRef?: React.Ref<HTMLInputElement>;
|
|
48
|
-
label?: MuiTextFieldProps['label'];
|
|
49
|
-
/**
|
|
50
|
-
* Custom mask. Can be used to override generate from format. (e.g. `__/__/____ __:__` or `__/__/____ __:__ _M`).
|
|
51
|
-
*/
|
|
52
|
-
mask?: string;
|
|
53
|
-
onBlur?: () => void;
|
|
54
|
-
onChange: (date: TDateValue, keyboardInputValue?: string) => void;
|
|
55
|
-
open: boolean;
|
|
56
|
-
openPicker: () => void;
|
|
57
|
-
/**
|
|
58
|
-
* Props to pass to keyboard adornment button.
|
|
59
|
-
*/
|
|
60
|
-
OpenPickerButtonProps?: Partial<IconButtonProps>;
|
|
61
|
-
rawValue: TInputValue;
|
|
62
|
-
readOnly?: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* The `renderInput` prop allows you to customize the rendered input.
|
|
65
|
-
* The `props` argument of this render prop contains props of [TextField](https://mui.com/api/text-field/#textfield-api) that you need to forward.
|
|
66
|
-
* Pay specific attention to the `ref` and `inputProps` keys.
|
|
67
|
-
* @example ```jsx
|
|
68
|
-
* renderInput={props => <TextField {...props} />}
|
|
69
|
-
* ````
|
|
70
|
-
*/
|
|
71
|
-
renderInput: (props: MuiTextFieldPropsType) => React.ReactElement;
|
|
72
|
-
/**
|
|
73
|
-
* Custom formatter to be passed into Rifm component.
|
|
74
|
-
*/
|
|
75
|
-
rifmFormatter?: (str: string) => string;
|
|
76
|
-
TextFieldProps?: Partial<MuiTextFieldProps>;
|
|
77
|
-
validationError?: boolean;
|
|
78
|
-
}
|
|
79
|
-
export declare type ExportedDateInputProps<TInputValue, TDateValue> = Omit<DateInputProps<TInputValue, TDateValue>, 'inputFormat' | 'inputValue' | 'onBlur' | 'onChange' | 'open' | 'openPicker' | 'rawValue' | 'TextFieldProps' | 'validationError'>;
|
|
80
|
-
export declare const PureDateInput: React.ForwardRefExoticComponent<DateInputProps<unknown, unknown> & React.RefAttributes<HTMLDivElement>>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TextFieldProps as MuiTextFieldPropsType } from '@mui/material/TextField';
|
|
3
|
+
import { IconButtonProps } from '@mui/material/IconButton';
|
|
4
|
+
import { InputAdornmentProps } from '@mui/material/InputAdornment';
|
|
5
|
+
import { ParseableDate } from './constants/prop-types';
|
|
6
|
+
import { MuiPickersAdapter } from './hooks/useUtils';
|
|
7
|
+
export declare type MuiTextFieldProps = MuiTextFieldPropsType | Omit<MuiTextFieldPropsType, 'variant'>;
|
|
8
|
+
export interface DateInputProps<TInputValue = ParseableDate<unknown>, TDateValue = unknown> {
|
|
9
|
+
/**
|
|
10
|
+
* Regular expression to detect "accepted" symbols.
|
|
11
|
+
* @default /\dap/gi
|
|
12
|
+
*/
|
|
13
|
+
acceptRegex?: RegExp;
|
|
14
|
+
/**
|
|
15
|
+
* The components used for each slot.
|
|
16
|
+
* Either a string to use a HTML element or a component.
|
|
17
|
+
*/
|
|
18
|
+
components?: {
|
|
19
|
+
OpenPickerIcon?: React.ElementType;
|
|
20
|
+
};
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Disable mask on the keyboard, this should be used rarely. Consider passing proper mask for your format.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
disableMaskedInput?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Do not render open picker button (renders only text field with validation).
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
disableOpenPicker?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Get aria-label text for control that opens picker dialog. Aria-label text must include selected date. @DateIOType
|
|
34
|
+
* @default (value, utils) => `Choose date, selected date is ${utils.format(utils.date(value), 'fullDate')}`
|
|
35
|
+
*/
|
|
36
|
+
getOpenDialogAriaText?: (value: ParseableDate<TDateValue>, utils: MuiPickersAdapter<TDateValue>) => string;
|
|
37
|
+
ignoreInvalidInputs?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Props to pass to keyboard input adornment.
|
|
40
|
+
*/
|
|
41
|
+
InputAdornmentProps?: Partial<InputAdornmentProps>;
|
|
42
|
+
inputFormat: string;
|
|
43
|
+
InputProps?: MuiTextFieldProps['InputProps'];
|
|
44
|
+
/**
|
|
45
|
+
* Pass a ref to the `input` element.
|
|
46
|
+
*/
|
|
47
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
48
|
+
label?: MuiTextFieldProps['label'];
|
|
49
|
+
/**
|
|
50
|
+
* Custom mask. Can be used to override generate from format. (e.g. `__/__/____ __:__` or `__/__/____ __:__ _M`).
|
|
51
|
+
*/
|
|
52
|
+
mask?: string;
|
|
53
|
+
onBlur?: () => void;
|
|
54
|
+
onChange: (date: TDateValue, keyboardInputValue?: string) => void;
|
|
55
|
+
open: boolean;
|
|
56
|
+
openPicker: () => void;
|
|
57
|
+
/**
|
|
58
|
+
* Props to pass to keyboard adornment button.
|
|
59
|
+
*/
|
|
60
|
+
OpenPickerButtonProps?: Partial<IconButtonProps>;
|
|
61
|
+
rawValue: TInputValue;
|
|
62
|
+
readOnly?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* The `renderInput` prop allows you to customize the rendered input.
|
|
65
|
+
* The `props` argument of this render prop contains props of [TextField](https://mui.com/api/text-field/#textfield-api) that you need to forward.
|
|
66
|
+
* Pay specific attention to the `ref` and `inputProps` keys.
|
|
67
|
+
* @example ```jsx
|
|
68
|
+
* renderInput={props => <TextField {...props} />}
|
|
69
|
+
* ````
|
|
70
|
+
*/
|
|
71
|
+
renderInput: (props: MuiTextFieldPropsType) => React.ReactElement;
|
|
72
|
+
/**
|
|
73
|
+
* Custom formatter to be passed into Rifm component.
|
|
74
|
+
*/
|
|
75
|
+
rifmFormatter?: (str: string) => string;
|
|
76
|
+
TextFieldProps?: Partial<MuiTextFieldProps>;
|
|
77
|
+
validationError?: boolean;
|
|
78
|
+
}
|
|
79
|
+
export declare type ExportedDateInputProps<TInputValue, TDateValue> = Omit<DateInputProps<TInputValue, TDateValue>, 'inputFormat' | 'inputValue' | 'onBlur' | 'onChange' | 'open' | 'openPicker' | 'rawValue' | 'TextFieldProps' | 'validationError'>;
|
|
80
|
+
export declare const PureDateInput: React.ForwardRefExoticComponent<DateInputProps<unknown, unknown> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const DAY_SIZE = 36;
|
|
2
|
-
export declare const DAY_MARGIN = 2;
|
|
3
|
-
export declare const DIALOG_WIDTH = 320;
|
|
4
|
-
export declare const VIEW_HEIGHT = 358;
|
|
1
|
+
export declare const DAY_SIZE = 36;
|
|
2
|
+
export declare const DAY_MARGIN = 2;
|
|
3
|
+
export declare const DIALOG_WIDTH = 320;
|
|
4
|
+
export declare const VIEW_HEIGHT = 358;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare type ParseableDate<TDate> = string | number | Date | null | undefined | TDate;
|
|
1
|
+
export declare type ParseableDate<TDate> = string | number | Date | null | undefined | TDate;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ParseableDate } from './constants/prop-types';
|
|
2
|
-
import { MuiPickersAdapter } from './hooks/useUtils';
|
|
3
|
-
import { DateValidationProps } from './date-utils';
|
|
4
|
-
import { TimeValidationProps } from './time-utils';
|
|
5
|
-
export interface DateTimeValidationProps<TDate> extends DateValidationProps<TDate>, TimeValidationProps<TDate> {
|
|
6
|
-
}
|
|
7
|
-
export declare function validateDateTime<TDate>(utils: MuiPickersAdapter<TDate>, value: ParseableDate<TDate>, { minDate, maxDate, disableFuture, shouldDisableDate, disablePast, ...timeValidationProps }: DateTimeValidationProps<TDate>): "invalidDate" | "shouldDisableDate" | "disableFuture" | "disablePast" | "minDate" | "maxDate" | "minTime" | "maxTime" | "shouldDisableTime-hours" | "shouldDisableTime-minutes" | "shouldDisableTime-seconds" | null;
|
|
8
|
-
export declare type DateTimeValidationError = ReturnType<typeof validateDateTime>;
|
|
1
|
+
import { ParseableDate } from './constants/prop-types';
|
|
2
|
+
import { MuiPickersAdapter } from './hooks/useUtils';
|
|
3
|
+
import { DateValidationProps } from './date-utils';
|
|
4
|
+
import { TimeValidationProps } from './time-utils';
|
|
5
|
+
export interface DateTimeValidationProps<TDate> extends DateValidationProps<TDate>, TimeValidationProps<TDate> {
|
|
6
|
+
}
|
|
7
|
+
export declare function validateDateTime<TDate>(utils: MuiPickersAdapter<TDate>, value: ParseableDate<TDate>, { minDate, maxDate, disableFuture, shouldDisableDate, disablePast, ...timeValidationProps }: DateTimeValidationProps<TDate>): "invalidDate" | "shouldDisableDate" | "disableFuture" | "disablePast" | "minDate" | "maxDate" | "minTime" | "maxTime" | "shouldDisableTime-hours" | "shouldDisableTime-minutes" | "shouldDisableTime-seconds" | null;
|
|
8
|
+
export declare type DateTimeValidationError = ReturnType<typeof validateDateTime>;
|