@mui/x-date-pickers-pro
Version:
The Pro plan edition of the MUI X Date and Time Picker components.
26 lines • 977 B
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import * as React from 'react';
import { useThemeProps } from '@mui/material/styles';
import { useApplyDefaultValuesToDateValidationProps } from '@mui/x-date-pickers/internals';
import { DateRangePickerToolbar } from "./DateRangePickerToolbar.js";
export function useDateRangePickerDefaultizedProps(props, name) {
const themeProps = useThemeProps({
props,
name
});
const validationProps = useApplyDefaultValuesToDateValidationProps(themeProps);
const localeText = React.useMemo(() => {
if (themeProps.localeText?.toolbarTitle == null) {
return themeProps.localeText;
}
return _extends({}, themeProps.localeText, {
dateRangePickerToolbarTitle: themeProps.localeText.toolbarTitle
});
}, [themeProps.localeText]);
return _extends({}, themeProps, validationProps, {
localeText,
slots: _extends({
toolbar: DateRangePickerToolbar
}, themeProps.slots)
});
}