UNPKG

@mui/x-date-pickers

Version:

The community edition of the Date and Time Picker components (MUI X).

68 lines (66 loc) 2.26 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default; var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default; Object.defineProperty(exports, "__esModule", { value: true }); exports.PickersFadeTransitionGroup = PickersFadeTransitionGroup; var React = _interopRequireWildcard(require("react")); var _clsx = _interopRequireDefault(require("clsx")); var _reactTransitionGroup = require("react-transition-group"); var _Fade = _interopRequireDefault(require("@mui/material/Fade")); var _styles = require("@mui/material/styles"); var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses")); var _pickersFadeTransitionGroupClasses = require("./pickersFadeTransitionGroupClasses"); var _jsxRuntime = require("react/jsx-runtime"); const useUtilityClasses = ownerState => { const { classes } = ownerState; const slots = { root: ['root'] }; return (0, _composeClasses.default)(slots, _pickersFadeTransitionGroupClasses.getPickersFadeTransitionGroupUtilityClass, classes); }; const PickersFadeTransitionGroupRoot = (0, _styles.styled)(_reactTransitionGroup.TransitionGroup, { name: 'MuiPickersFadeTransitionGroup', slot: 'Root', overridesResolver: (_, styles) => styles.root })({ display: 'block', position: 'relative' }); /** * @ignore - do not document. */ function PickersFadeTransitionGroup(inProps) { const props = (0, _styles.useThemeProps)({ props: inProps, name: 'MuiPickersFadeTransitionGroup' }); const { children, className, reduceAnimations, transKey } = props; const classes = useUtilityClasses(props); const theme = (0, _styles.useTheme)(); if (reduceAnimations) { return children; } return /*#__PURE__*/(0, _jsxRuntime.jsx)(PickersFadeTransitionGroupRoot, { className: (0, _clsx.default)(classes.root, className), children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Fade.default, { appear: false, mountOnEnter: true, unmountOnExit: true, timeout: { appear: theme.transitions.duration.enteringScreen, enter: theme.transitions.duration.enteringScreen, exit: 0 }, children: children }, transKey) }); }