paradiego
This commit is contained in:
50
node_modules/@mui/material/Grow/Grow.d.ts
generated
vendored
Normal file
50
node_modules/@mui/material/Grow/Grow.d.ts
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
import * as React from 'react';
|
||||
import { TransitionProps } from '../transitions/transition';
|
||||
|
||||
export interface GrowProps extends Omit<TransitionProps, 'timeout'> {
|
||||
/**
|
||||
* Perform the enter transition when it first mounts if `in` is also `true`.
|
||||
* Set this to `false` to disable this behavior.
|
||||
* @default true
|
||||
*/
|
||||
appear?: boolean;
|
||||
/**
|
||||
* A single child content element.
|
||||
*/
|
||||
children: React.ReactElement<unknown, any>;
|
||||
/**
|
||||
* The transition timing function.
|
||||
* You may specify a single easing or a object containing enter and exit values.
|
||||
*/
|
||||
easing?: TransitionProps['easing'];
|
||||
/**
|
||||
* If `true`, the component will transition in.
|
||||
*/
|
||||
in?: boolean;
|
||||
ref?: React.Ref<unknown>;
|
||||
/**
|
||||
* The duration for the transition, in milliseconds.
|
||||
* You may specify a single timeout for all transitions, or individually with an object.
|
||||
*
|
||||
* Set to 'auto' to automatically calculate transition time based on height.
|
||||
* @default 'auto'
|
||||
*/
|
||||
timeout?: TransitionProps['timeout'] | 'auto';
|
||||
}
|
||||
|
||||
/**
|
||||
* The Grow transition is used by the [Tooltip](https://mui.com/material-ui/react-tooltip/) and
|
||||
* [Popover](https://mui.com/material-ui/react-popover/) components.
|
||||
* It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
|
||||
*
|
||||
* Demos:
|
||||
*
|
||||
* - [Popover](https://mui.com/material-ui/react-popover/)
|
||||
* - [Transitions](https://mui.com/material-ui/transitions/)
|
||||
*
|
||||
* API:
|
||||
*
|
||||
* - [Grow API](https://mui.com/material-ui/api/grow/)
|
||||
* - inherits [Transition API](https://reactcommunity.org/react-transition-group/transition/#Transition-props)
|
||||
*/
|
||||
export default function Grow(props: GrowProps): React.JSX.Element;
|
||||
259
node_modules/@mui/material/Grow/Grow.js
generated
vendored
Normal file
259
node_modules/@mui/material/Grow/Grow.js
generated
vendored
Normal file
@@ -0,0 +1,259 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import useTimeout from '@mui/utils/useTimeout';
|
||||
import elementAcceptingRef from '@mui/utils/elementAcceptingRef';
|
||||
import getReactNodeRef from '@mui/utils/getReactNodeRef';
|
||||
import { Transition } from 'react-transition-group';
|
||||
import { useTheme } from "../zero-styled/index.js";
|
||||
import { getTransitionProps, reflow } from "../transitions/utils.js";
|
||||
import useForkRef from "../utils/useForkRef.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
function getScale(value) {
|
||||
return `scale(${value}, ${value ** 2})`;
|
||||
}
|
||||
const styles = {
|
||||
entering: {
|
||||
opacity: 1,
|
||||
transform: getScale(1)
|
||||
},
|
||||
entered: {
|
||||
opacity: 1,
|
||||
transform: 'none'
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
TODO v6: remove
|
||||
Conditionally apply a workaround for the CSS transition bug in Safari 15.4 / WebKit browsers.
|
||||
*/
|
||||
const isWebKit154 = typeof navigator !== 'undefined' && /^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent) && /(os |version\/)15(.|_)4/i.test(navigator.userAgent);
|
||||
|
||||
/**
|
||||
* The Grow transition is used by the [Tooltip](/material-ui/react-tooltip/) and
|
||||
* [Popover](/material-ui/react-popover/) components.
|
||||
* It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
|
||||
*/
|
||||
const Grow = /*#__PURE__*/React.forwardRef(function Grow(props, ref) {
|
||||
const {
|
||||
addEndListener,
|
||||
appear = true,
|
||||
children,
|
||||
easing,
|
||||
in: inProp,
|
||||
onEnter,
|
||||
onEntered,
|
||||
onEntering,
|
||||
onExit,
|
||||
onExited,
|
||||
onExiting,
|
||||
style,
|
||||
timeout = 'auto',
|
||||
// eslint-disable-next-line react/prop-types
|
||||
TransitionComponent = Transition,
|
||||
...other
|
||||
} = props;
|
||||
const timer = useTimeout();
|
||||
const autoTimeout = React.useRef();
|
||||
const theme = useTheme();
|
||||
const nodeRef = React.useRef(null);
|
||||
const handleRef = useForkRef(nodeRef, getReactNodeRef(children), ref);
|
||||
const normalizedTransitionCallback = callback => maybeIsAppearing => {
|
||||
if (callback) {
|
||||
const node = nodeRef.current;
|
||||
|
||||
// onEnterXxx and onExitXxx callbacks have a different arguments.length value.
|
||||
if (maybeIsAppearing === undefined) {
|
||||
callback(node);
|
||||
} else {
|
||||
callback(node, maybeIsAppearing);
|
||||
}
|
||||
}
|
||||
};
|
||||
const handleEntering = normalizedTransitionCallback(onEntering);
|
||||
const handleEnter = normalizedTransitionCallback((node, isAppearing) => {
|
||||
reflow(node); // So the animation always start from the start.
|
||||
|
||||
const {
|
||||
duration: transitionDuration,
|
||||
delay,
|
||||
easing: transitionTimingFunction
|
||||
} = getTransitionProps({
|
||||
style,
|
||||
timeout,
|
||||
easing
|
||||
}, {
|
||||
mode: 'enter'
|
||||
});
|
||||
let duration;
|
||||
if (timeout === 'auto') {
|
||||
duration = theme.transitions.getAutoHeightDuration(node.clientHeight);
|
||||
autoTimeout.current = duration;
|
||||
} else {
|
||||
duration = transitionDuration;
|
||||
}
|
||||
node.style.transition = [theme.transitions.create('opacity', {
|
||||
duration,
|
||||
delay
|
||||
}), theme.transitions.create('transform', {
|
||||
duration: isWebKit154 ? duration : duration * 0.666,
|
||||
delay,
|
||||
easing: transitionTimingFunction
|
||||
})].join(',');
|
||||
if (onEnter) {
|
||||
onEnter(node, isAppearing);
|
||||
}
|
||||
});
|
||||
const handleEntered = normalizedTransitionCallback(onEntered);
|
||||
const handleExiting = normalizedTransitionCallback(onExiting);
|
||||
const handleExit = normalizedTransitionCallback(node => {
|
||||
const {
|
||||
duration: transitionDuration,
|
||||
delay,
|
||||
easing: transitionTimingFunction
|
||||
} = getTransitionProps({
|
||||
style,
|
||||
timeout,
|
||||
easing
|
||||
}, {
|
||||
mode: 'exit'
|
||||
});
|
||||
let duration;
|
||||
if (timeout === 'auto') {
|
||||
duration = theme.transitions.getAutoHeightDuration(node.clientHeight);
|
||||
autoTimeout.current = duration;
|
||||
} else {
|
||||
duration = transitionDuration;
|
||||
}
|
||||
node.style.transition = [theme.transitions.create('opacity', {
|
||||
duration,
|
||||
delay
|
||||
}), theme.transitions.create('transform', {
|
||||
duration: isWebKit154 ? duration : duration * 0.666,
|
||||
delay: isWebKit154 ? delay : delay || duration * 0.333,
|
||||
easing: transitionTimingFunction
|
||||
})].join(',');
|
||||
node.style.opacity = 0;
|
||||
node.style.transform = getScale(0.75);
|
||||
if (onExit) {
|
||||
onExit(node);
|
||||
}
|
||||
});
|
||||
const handleExited = normalizedTransitionCallback(onExited);
|
||||
const handleAddEndListener = next => {
|
||||
if (timeout === 'auto') {
|
||||
timer.start(autoTimeout.current || 0, next);
|
||||
}
|
||||
if (addEndListener) {
|
||||
// Old call signature before `react-transition-group` implemented `nodeRef`
|
||||
addEndListener(nodeRef.current, next);
|
||||
}
|
||||
};
|
||||
return /*#__PURE__*/_jsx(TransitionComponent, {
|
||||
appear: appear,
|
||||
in: inProp,
|
||||
nodeRef: nodeRef,
|
||||
onEnter: handleEnter,
|
||||
onEntered: handleEntered,
|
||||
onEntering: handleEntering,
|
||||
onExit: handleExit,
|
||||
onExited: handleExited,
|
||||
onExiting: handleExiting,
|
||||
addEndListener: handleAddEndListener,
|
||||
timeout: timeout === 'auto' ? null : timeout,
|
||||
...other,
|
||||
children: (state, childProps) => {
|
||||
return /*#__PURE__*/React.cloneElement(children, {
|
||||
style: {
|
||||
opacity: 0,
|
||||
transform: getScale(0.75),
|
||||
visibility: state === 'exited' && !inProp ? 'hidden' : undefined,
|
||||
...styles[state],
|
||||
...style,
|
||||
...children.props.style
|
||||
},
|
||||
ref: handleRef,
|
||||
...childProps
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? Grow.propTypes /* remove-proptypes */ = {
|
||||
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
||||
// │ These PropTypes are generated from the TypeScript type definitions. │
|
||||
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
||||
// └─────────────────────────────────────────────────────────────────────┘
|
||||
/**
|
||||
* Add a custom transition end trigger. Called with the transitioning DOM
|
||||
* node and a done callback. Allows for more fine grained transition end
|
||||
* logic. Note: Timeouts are still used as a fallback if provided.
|
||||
*/
|
||||
addEndListener: PropTypes.func,
|
||||
/**
|
||||
* Perform the enter transition when it first mounts if `in` is also `true`.
|
||||
* Set this to `false` to disable this behavior.
|
||||
* @default true
|
||||
*/
|
||||
appear: PropTypes.bool,
|
||||
/**
|
||||
* A single child content element.
|
||||
*/
|
||||
children: elementAcceptingRef.isRequired,
|
||||
/**
|
||||
* The transition timing function.
|
||||
* You may specify a single easing or a object containing enter and exit values.
|
||||
*/
|
||||
easing: PropTypes.oneOfType([PropTypes.shape({
|
||||
enter: PropTypes.string,
|
||||
exit: PropTypes.string
|
||||
}), PropTypes.string]),
|
||||
/**
|
||||
* If `true`, the component will transition in.
|
||||
*/
|
||||
in: PropTypes.bool,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onEnter: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onEntered: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onEntering: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onExit: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onExited: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onExiting: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
style: PropTypes.object,
|
||||
/**
|
||||
* The duration for the transition, in milliseconds.
|
||||
* You may specify a single timeout for all transitions, or individually with an object.
|
||||
*
|
||||
* Set to 'auto' to automatically calculate transition time based on height.
|
||||
* @default 'auto'
|
||||
*/
|
||||
timeout: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.shape({
|
||||
appear: PropTypes.number,
|
||||
enter: PropTypes.number,
|
||||
exit: PropTypes.number
|
||||
})])
|
||||
} : void 0;
|
||||
if (Grow) {
|
||||
Grow.muiSupportAuto = true;
|
||||
}
|
||||
export default Grow;
|
||||
2
node_modules/@mui/material/Grow/index.d.ts
generated
vendored
Normal file
2
node_modules/@mui/material/Grow/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export { default } from './Grow';
|
||||
export * from './Grow';
|
||||
1
node_modules/@mui/material/Grow/index.js
generated
vendored
Normal file
1
node_modules/@mui/material/Grow/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { default } from "./Grow.js";
|
||||
6
node_modules/@mui/material/Grow/package.json
generated
vendored
Normal file
6
node_modules/@mui/material/Grow/package.json
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/Grow/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
Reference in New Issue
Block a user